From 80a3aa20ef17e1b9e95d24c7f4793760e3d1c035 Mon Sep 17 00:00:00 2001 From: support Date: Mon, 5 Dec 2022 16:19:30 +0000 Subject: [PATCH] Built motion from commit 64f2f01b.|2.6.25 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage.events.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- server/api/client-side-logs.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.oauth.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../cmContactHasItem.attributes.js | 2 +- .../cmContactHasItem.controller.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.model.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +- server/api/cmContactHasItem/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../cmHopperAdditionalPhone.attributes.js | 2 +- .../cmHopperAdditionalPhone.controller.js | 2 +- .../cmHopperAdditionalPhone.model.js | 2 +- .../cmHopperAdditionalPhone.rpc.js | 2 +- server/api/cmHopperAdditionalPhone/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- .../contactItemType/contactItemType.attributes.js | 2 +- .../contactItemType/contactItemType.controller.js | 2 +- .../api/contactItemType/contactItemType.model.js | 2 +- server/api/contactItemType/contactItemType.rpc.js | 2 +- server/api/contactItemType/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user-setting/index.js | 2 +- server/api/user-setting/user-setting.attributes.js | 2 +- server/api/user-setting/user-setting.controller.js | 2 +- server/api/user-setting/user-setting.events.js | 2 +- server/api/user-setting/user-setting.model.js | 2 +- server/api/user-setting/user-setting.socket.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/contacts/index.js | 2 +- server/components/contacts/sql-utils.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/import/cm/csvUpdates.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/interaction/sql-utils.js | 2 +- .../components/interaction/update-interaction.js | 2 +- server/components/interaction/utils.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/components/realtime/agents.js | 2 +- server/components/realtime/queues.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/api.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/events.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/project.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/models/action.js | 2 +- server/services/ami/dialer/models/agentComplete.js | 2 +- server/services/ami/dialer/models/final.js | 2 +- server/services/ami/dialer/models/hangup.js | 2 +- server/services/ami/dialer/models/history.js | 2 +- .../ami/dialer/models/queueCallerAbandon.js | 2 +- server/services/ami/dialer/utils/hopper.js | 2 +- server/services/ami/dialer/utils/index.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/voiceQueueSummary.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/realtime/utils.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/interval.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- server/utils/client-side-logger.js | 2 +- server/utils/iftime.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- server/utils/update-app-config.js | 2 +- 1203 files changed, 1203 insertions(+), 1203 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 3836cf5..f7d16de 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-12-05T15:42:27.177Z", + "time": "2022-12-05T16:11:31.266Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index d8c6eeb..01a99c2 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-12-05T15:42:27.177Z", + "time": "2022-12-05T16:11:31.266Z", "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 2355bc5..5895a46 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 _0xdf48=['jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x17823f,_0xffd807){var _0x51fc21=function(_0x5e4921){while(--_0x5e4921){_0x17823f['push'](_0x17823f['shift']());}};_0x51fc21(++_0xffd807);}(_0xdf48,0x113));var _0x8df4=function(_0x308c15,_0x3f024e){_0x308c15=_0x308c15-0x0;var _0x49f114=_0xdf48[_0x308c15];return _0x49f114;};'use strict';var Sequelize=require('sequelize');module[_0x8df4('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2ce172){return this[_0x8df4('0x1')](_0x8df4('0x2'));}},'action':{'type':Sequelize[_0x8df4('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x8df4('0x4'),_0x8df4('0x5'),_0x8df4('0x6'),_0x8df4('0x7'),'urlForward',_0x8df4('0x8'),'bot','script']],'msg':_0x8df4('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x8df4('0xa')},'data2':{'type':Sequelize[_0x8df4('0x3')](0x1000),'comment':_0x8df4('0xb')},'data3':{'type':Sequelize[_0x8df4('0x3')](0x1000),'comment':_0x8df4('0xc')},'data4':{'type':Sequelize[_0x8df4('0x3')](0x1000),'comments':_0x8df4('0xd')},'data5':{'type':Sequelize[_0x8df4('0x3')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x8df4('0x3')],'comments':_0x8df4('0xe')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0xeb76=['bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','jscripty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb76,0x171));var _0x6eb7=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0xeb76[_0x3826ad];return _0x17b900;};'use strict';var Sequelize=require(_0x6eb7('0x0'));module[_0x6eb7('0x1')]={'name':{'type':Sequelize[_0x6eb7('0x2')],'get':function(_0x1e5c45){return this['getDataValue'](_0x6eb7('0x3'));}},'action':{'type':Sequelize[_0x6eb7('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6eb7('0x5'),_0x6eb7('0x6'),_0x6eb7('0x7'),_0x6eb7('0x8'),'urlForward','browser',_0x6eb7('0x9'),_0x6eb7('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x6eb7('0xb')},'data1':{'type':Sequelize[_0x6eb7('0x4')](0x1000),'comment':_0x6eb7('0xc')},'data2':{'type':Sequelize[_0x6eb7('0x4')](0x1000),'comment':_0x6eb7('0xd')},'data3':{'type':Sequelize[_0x6eb7('0x4')](0x1000),'comment':_0x6eb7('0xe')},'data4':{'type':Sequelize[_0x6eb7('0x4')](0x1000),'comments':_0x6eb7('0xf')},'data5':{'type':Sequelize[_0x6eb7('0x4')](0x1000),'comments':_0x6eb7('0x10')},'data6':{'type':Sequelize[_0x6eb7('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x6eb7('0x11')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 5d344c5..908b70e 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 _0xe5ca=['moment','bluebird','path','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/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','sendStatus','error','stack','name','update','body','find','params','catch','Action','fast-json-patch','request-promise'];(function(_0x5d8631,_0x44944b){var _0x34c15e=function(_0x4448f8){while(--_0x4448f8){_0x5d8631['push'](_0x5d8631['shift']());}};_0x34c15e(++_0x44944b);}(_0xe5ca,0xd5));var _0xae5c=function(_0x45ee03,_0x2f5319){_0x45ee03=_0x45ee03-0x0;var _0x13d535=_0xe5ca[_0x45ee03];return _0x13d535;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xae5c('0x0'));var rp=require(_0xae5c('0x1'));var moment=require(_0xae5c('0x2'));var BPromise=require(_0xae5c('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xae5c('0x4'));var sox=require('sox');var csv=require(_0xae5c('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae5c('0x6'));var _=require(_0xae5c('0x7'));var squel=require('squel');var crypto=require(_0xae5c('0x8'));var jsforce=require(_0xae5c('0x9'));var deskjs=require(_0xae5c('0xa'));var toCsv=require(_0xae5c('0x5'));var querystring=require(_0xae5c('0xb'));var Papa=require(_0xae5c('0xc'));var Redis=require(_0xae5c('0xd'));var authService=require(_0xae5c('0xe'));var qs=require(_0xae5c('0xf'));var as=require(_0xae5c('0x10'));var hardwareService=require(_0xae5c('0x11'));var logger=require(_0xae5c('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xae5c('0x13'));var licenseUtil=require(_0xae5c('0x14'));var db=require(_0xae5c('0x15'))['db'];function respondWithStatusCode(_0x2a1346,_0x23453e){_0x23453e=_0x23453e||0xcc;return function(_0x3d19e3){if(_0x3d19e3){return _0x2a1346['sendStatus'](_0x23453e);}return _0x2a1346[_0xae5c('0x16')](_0x23453e)[_0xae5c('0x17')]();};}function respondWithResult(_0x3c7c2b,_0x2443b5){_0x2443b5=_0x2443b5||0xc8;return function(_0x796534){if(_0x796534){return _0x3c7c2b[_0xae5c('0x16')](_0x2443b5)[_0xae5c('0x18')](_0x796534);}};}function respondWithFilteredResult(_0x166433,_0x1789cb){return function(_0x138b04){if(_0x138b04){var _0xde6757=typeof _0x1789cb[_0xae5c('0x19')]===_0xae5c('0x1a')&&typeof _0x1789cb[_0xae5c('0x1b')]==='undefined';var _0x49a38b=_0x138b04['count'];var _0x457b89=_0xde6757?0x0:_0x1789cb['offset'];var _0x3dff0c=_0xde6757?_0x138b04['count']:_0x1789cb[_0xae5c('0x19')]+_0x1789cb[_0xae5c('0x1b')];var _0x5e4748;if(_0x3dff0c>=_0x49a38b){_0x3dff0c=_0x49a38b;_0x5e4748=0xc8;}else{_0x5e4748=0xce;}_0x166433[_0xae5c('0x16')](_0x5e4748);return _0x166433[_0xae5c('0x1c')](_0xae5c('0x1d'),_0x457b89+'-'+_0x3dff0c+'/'+_0x49a38b)[_0xae5c('0x18')](_0x138b04);}return null;};}function patchUpdates(_0x2f91ec){return function(_0x4fd05a){try{jsonpatch[_0xae5c('0x1e')](_0x4fd05a,_0x2f91ec,!![]);}catch(_0x1f740b){return BPromise[_0xae5c('0x1f')](_0x1f740b);}return _0x4fd05a['save']();};}function saveUpdates(_0x3f33b9,_0x46d7c0){return function(_0x442a92){if(_0x442a92){return _0x442a92['update'](_0x3f33b9)[_0xae5c('0x20')](function(_0x57de66){return _0x57de66;});}return null;};}function removeEntity(_0x47c90c,_0x5aee27){return function(_0x3b4831){if(_0x3b4831){return _0x3b4831['destroy']()[_0xae5c('0x20')](function(){_0x47c90c['status'](0xcc)[_0xae5c('0x17')]();});}};}function handleEntityNotFound(_0x452f37,_0x4bebba){return function(_0x43bd7c){if(!_0x43bd7c){_0x452f37[_0xae5c('0x21')](0x194);}return _0x43bd7c;};}function handleError(_0x4e840d,_0x1afd4a){_0x1afd4a=_0x1afd4a||0x1f4;return function(_0x3c9daa){logger[_0xae5c('0x22')](_0x3c9daa[_0xae5c('0x23')]);if(_0x3c9daa[_0xae5c('0x24')]){delete _0x3c9daa[_0xae5c('0x24')];}_0x4e840d[_0xae5c('0x16')](_0x1afd4a)['send'](_0x3c9daa);};}exports[_0xae5c('0x25')]=function(_0x96ba46,_0x4a4573){if(_0x96ba46[_0xae5c('0x26')]['id']){delete _0x96ba46[_0xae5c('0x26')]['id'];}return db['Action'][_0xae5c('0x27')]({'where':{'id':_0x96ba46[_0xae5c('0x28')]['id']}})['then'](handleEntityNotFound(_0x4a4573,null))[_0xae5c('0x20')](saveUpdates(_0x96ba46[_0xae5c('0x26')],null))[_0xae5c('0x20')](respondWithResult(_0x4a4573,null))[_0xae5c('0x29')](handleError(_0x4a4573,null));};exports['destroy']=function(_0x360ed7,_0x54e317){return db[_0xae5c('0x2a')][_0xae5c('0x27')]({'where':{'id':_0x360ed7[_0xae5c('0x28')]['id']}})[_0xae5c('0x20')](handleEntityNotFound(_0x54e317,null))[_0xae5c('0x20')](removeEntity(_0x54e317,null))[_0xae5c('0x29')](handleError(_0x54e317,null));}; \ No newline at end of file +var _0x4b30=['jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','error','stack','name','send','update','body','find','params','catch','Action','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x543769,_0x8da6aa){var _0x1be8be=function(_0x5eed72){while(--_0x5eed72){_0x543769['push'](_0x543769['shift']());}};_0x1be8be(++_0x8da6aa);}(_0x4b30,0x102));var _0x04b3=function(_0x123e6f,_0x3a0ccb){_0x123e6f=_0x123e6f-0x0;var _0x2e0627=_0x4b30[_0x123e6f];return _0x2e0627;};'use strict';var emlformat=require(_0x04b3('0x0'));var rimraf=require(_0x04b3('0x1'));var zipdir=require(_0x04b3('0x2'));var jsonpatch=require(_0x04b3('0x3'));var rp=require('request-promise');var moment=require(_0x04b3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x04b3('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x04b3('0x6'));var ejs=require(_0x04b3('0x7'));var fs=require('fs');var fs_extra=require(_0x04b3('0x8'));var _=require(_0x04b3('0x9'));var squel=require(_0x04b3('0xa'));var crypto=require(_0x04b3('0xb'));var jsforce=require(_0x04b3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x04b3('0x6'));var querystring=require('querystring');var Papa=require(_0x04b3('0xd'));var Redis=require(_0x04b3('0xe'));var authService=require(_0x04b3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x04b3('0x10'));var hardwareService=require(_0x04b3('0x11'));var logger=require('../../config/logger')(_0x04b3('0x12'));var utils=require(_0x04b3('0x13'));var config=require(_0x04b3('0x14'));var licenseUtil=require(_0x04b3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1eb8aa,_0x4d217e){_0x4d217e=_0x4d217e||0xcc;return function(_0x25d199){if(_0x25d199){return _0x1eb8aa[_0x04b3('0x16')](_0x4d217e);}return _0x1eb8aa[_0x04b3('0x17')](_0x4d217e)[_0x04b3('0x18')]();};}function respondWithResult(_0x3f2f62,_0x891a2e){_0x891a2e=_0x891a2e||0xc8;return function(_0x386095){if(_0x386095){return _0x3f2f62[_0x04b3('0x17')](_0x891a2e)[_0x04b3('0x19')](_0x386095);}};}function respondWithFilteredResult(_0xe75106,_0x4c2c67){return function(_0x3b716b){if(_0x3b716b){var _0x459909=typeof _0x4c2c67[_0x04b3('0x1a')]===_0x04b3('0x1b')&&typeof _0x4c2c67['limit']===_0x04b3('0x1b');var _0xaa02e2=_0x3b716b[_0x04b3('0x1c')];var _0x2e8fca=_0x459909?0x0:_0x4c2c67['offset'];var _0x494b89=_0x459909?_0x3b716b[_0x04b3('0x1c')]:_0x4c2c67['offset']+_0x4c2c67[_0x04b3('0x1d')];var _0x111cd9;if(_0x494b89>=_0xaa02e2){_0x494b89=_0xaa02e2;_0x111cd9=0xc8;}else{_0x111cd9=0xce;}_0xe75106[_0x04b3('0x17')](_0x111cd9);return _0xe75106[_0x04b3('0x1e')](_0x04b3('0x1f'),_0x2e8fca+'-'+_0x494b89+'/'+_0xaa02e2)[_0x04b3('0x19')](_0x3b716b);}return null;};}function patchUpdates(_0x226189){return function(_0x136fa2){try{jsonpatch[_0x04b3('0x20')](_0x136fa2,_0x226189,!![]);}catch(_0x37d451){return BPromise['reject'](_0x37d451);}return _0x136fa2['save']();};}function saveUpdates(_0x45f1fc,_0xa6d0c1){return function(_0xea1273){if(_0xea1273){return _0xea1273['update'](_0x45f1fc)['then'](function(_0x3799c4){return _0x3799c4;});}return null;};}function removeEntity(_0x199f33,_0x2e4613){return function(_0x32d30d){if(_0x32d30d){return _0x32d30d[_0x04b3('0x21')]()[_0x04b3('0x22')](function(){_0x199f33[_0x04b3('0x17')](0xcc)[_0x04b3('0x18')]();});}};}function handleEntityNotFound(_0x5be1e6,_0x2a33fd){return function(_0x267a62){if(!_0x267a62){_0x5be1e6['sendStatus'](0x194);}return _0x267a62;};}function handleError(_0xdeaef2,_0x2b72d6){_0x2b72d6=_0x2b72d6||0x1f4;return function(_0x19edf6){logger[_0x04b3('0x23')](_0x19edf6[_0x04b3('0x24')]);if(_0x19edf6[_0x04b3('0x25')]){delete _0x19edf6[_0x04b3('0x25')];}_0xdeaef2[_0x04b3('0x17')](_0x2b72d6)[_0x04b3('0x26')](_0x19edf6);};}exports[_0x04b3('0x27')]=function(_0x1f286a,_0x470905){if(_0x1f286a[_0x04b3('0x28')]['id']){delete _0x1f286a[_0x04b3('0x28')]['id'];}return db['Action'][_0x04b3('0x29')]({'where':{'id':_0x1f286a[_0x04b3('0x2a')]['id']}})['then'](handleEntityNotFound(_0x470905,null))[_0x04b3('0x22')](saveUpdates(_0x1f286a['body'],null))[_0x04b3('0x22')](respondWithResult(_0x470905,null))[_0x04b3('0x2b')](handleError(_0x470905,null));};exports[_0x04b3('0x21')]=function(_0x396f8e,_0x529036){return db[_0x04b3('0x2c')][_0x04b3('0x29')]({'where':{'id':_0x396f8e[_0x04b3('0x2a')]['id']}})[_0x04b3('0x22')](handleEntityNotFound(_0x529036,null))['then'](removeEntity(_0x529036,null))[_0x04b3('0x2b')](handleError(_0x529036,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 9dca6ba..fcf4ce9 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 _0xaf11=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xaf11,0xfa));var _0x1af1=function(_0x3cd892,_0x36f921){_0x3cd892=_0x3cd892-0x0;var _0x305844=_0xaf11[_0x3cd892];return _0x305844;};'use strict';var _=require(_0x1af1('0x0'));var util=require(_0x1af1('0x1'));var logger=require(_0x1af1('0x2'))(_0x1af1('0x3'));var moment=require('moment');var BPromise=require(_0x1af1('0x4'));var rp=require(_0x1af1('0x5'));var fs=require('fs');var path=require(_0x1af1('0x6'));var rimraf=require(_0x1af1('0x7'));var config=require(_0x1af1('0x8'));var attributes=require(_0x1af1('0x9'));module[_0x1af1('0xa')]=function(_0x43d868,_0x28eebf){return _0x43d868[_0x1af1('0xb')](_0x1af1('0xc'),attributes,{'tableName':_0x1af1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe205=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./action.attributes','exports','define'];(function(_0x363562,_0x416a2c){var _0x56d17b=function(_0x3ffcdb){while(--_0x3ffcdb){_0x363562['push'](_0x363562['shift']());}};_0x56d17b(++_0x416a2c);}(_0xe205,0x1ec));var _0x5e20=function(_0x26277b,_0x3b474d){_0x26277b=_0x26277b-0x0;var _0x4f2fc3=_0xe205[_0x26277b];return _0x4f2fc3;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var logger=require(_0x5e20('0x2'))(_0x5e20('0x3'));var moment=require(_0x5e20('0x4'));var BPromise=require(_0x5e20('0x5'));var rp=require(_0x5e20('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e20('0x7'));var config=require(_0x5e20('0x8'));var attributes=require(_0x5e20('0x9'));module[_0x5e20('0xa')]=function(_0x4554b5,_0x2e68e6){return _0x4554b5[_0x5e20('0xb')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index dfacd0d..d8db7a4 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1da8db,_0x2306c9){var _0x1acc65=function(_0x48e670){while(--_0x48e670){_0x1da8db['push'](_0x1da8db['shift']());}};_0x1acc65(++_0x2306c9);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xeb7786,_0x53a053){_0xeb7786=_0xeb7786-0x0;var _0x120bbc=_0x7fbe[_0xeb7786];return _0x120bbc;};'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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x53ec,0x192));var _0xc53e=function(_0x44ab9d,_0x3d060c){_0x44ab9d=_0x44ab9d-0x0;var _0x279648=_0x53ec[_0x44ab9d];return _0x279648;};'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')]('Action,\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 diff --git a/server/api/action/index.js b/server/api/action/index.js index 774e2a0..8031971 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 _0x622c=['Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','destroy','exports','multer','path','connect-timeout'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x622c,0xcf));var _0xc622=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0x622c[_0x41d432];return _0x1650f9;};'use strict';var multer=require(_0xc622('0x0'));var util=require('util');var path=require(_0xc622('0x1'));var timeout=require(_0xc622('0x2'));var express=require('express');var router=express[_0xc622('0x3')]();var fs_extra=require(_0xc622('0x4'));var auth=require(_0xc622('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc622('0x6'));var controller=require(_0xc622('0x7'));router[_0xc622('0x8')](_0xc622('0x9'),auth[_0xc622('0xa')](),controller[_0xc622('0xb')]);router['delete'](_0xc622('0x9'),auth['isAuthenticated'](),controller[_0xc622('0xc')]);module[_0xc622('0xd')]=router; \ No newline at end of file +var _0x133a=['destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','/:id','isAuthenticated','update'];(function(_0x46d441,_0x392c98){var _0x419105=function(_0x5b95c4){while(--_0x5b95c4){_0x46d441['push'](_0x46d441['shift']());}};_0x419105(++_0x392c98);}(_0x133a,0x1e3));var _0xa133=function(_0x548657,_0x479937){_0x548657=_0x548657-0x0;var _0x8e3ae5=_0x133a[_0x548657];return _0x8e3ae5;};'use strict';var multer=require(_0xa133('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa133('0x1'));var express=require(_0xa133('0x2'));var router=express[_0xa133('0x3')]();var fs_extra=require(_0xa133('0x4'));var auth=require(_0xa133('0x5'));var interaction=require(_0xa133('0x6'));var config=require('../../config/environment');var controller=require(_0xa133('0x7'));router['put'](_0xa133('0x8'),auth[_0xa133('0x9')](),controller[_0xa133('0xa')]);router['delete'](_0xa133('0x8'),auth[_0xa133('0x9')](),controller[_0xa133('0xb')]);module[_0xa133('0xc')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 9a7a85f..8b87c19 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 _0xae24=['sequelize','STRING'];(function(_0xcdee79,_0x463fc9){var _0x3a7c14=function(_0x44b772){while(--_0x44b772){_0xcdee79['push'](_0xcdee79['shift']());}};_0x3a7c14(++_0x463fc9);}(_0xae24,0x182));var _0x4ae2=function(_0x4ebc2b,_0x589396){_0x4ebc2b=_0x4ebc2b-0x0;var _0x4f2ec3=_0xae24[_0x4ebc2b];return _0x4f2ec3;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ae2('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4ae2('0x1')]},'table':{'type':Sequelize[_0x4ae2('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x44d28c,_0x3a197b){var _0x754673=function(_0x5a5773){while(--_0x5a5773){_0x44d28c['push'](_0x44d28c['shift']());}};_0x754673(++_0x3a197b);}(_0x5fab,0x177));var _0xb5fa=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0x5fab[_0x587dd0];return _0x56f153;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index d4f1ca0..b30a01d 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 _0xbef7=['includeAll','include','findAll','rows','catch','show','params','length','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','MAX(%s)','MIN(%s)','DATE(%s)','ROUND(%s)','keyBy','groupBy','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','savename','QueryTypes','run','runReport','COUNT(DISTINCT\x20%s)','HOUR(%s)','ValidationErrorItem','order','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','CustomReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','options','AnalyticCustomReport'];(function(_0x5ccfdd,_0x4be726){var _0x59761d=function(_0x2ae204){while(--_0x2ae204){_0x5ccfdd['push'](_0x5ccfdd['shift']());}};_0x59761d(++_0x4be726);}(_0xbef7,0x10d));var _0x7bef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbef7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7bef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7bef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7bef('0x2'));var moment=require(_0x7bef('0x3'));var BPromise=require(_0x7bef('0x4'));var Mustache=require(_0x7bef('0x5'));var util=require(_0x7bef('0x6'));var path=require(_0x7bef('0x7'));var sox=require(_0x7bef('0x8'));var csv=require('to-csv');var ejs=require(_0x7bef('0x9'));var fs=require('fs');var fs_extra=require(_0x7bef('0xa'));var _=require('lodash');var squel=require(_0x7bef('0xb'));var crypto=require(_0x7bef('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7bef('0xd'));var toCsv=require(_0x7bef('0xe'));var querystring=require(_0x7bef('0xf'));var Papa=require(_0x7bef('0x10'));var Redis=require(_0x7bef('0x11'));var authService=require(_0x7bef('0x12'));var qs=require(_0x7bef('0x13'));var as=require(_0x7bef('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bef('0x15'))(_0x7bef('0x16'));var utils=require('../../config/utils');var config=require(_0x7bef('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7bef('0x18'))['db'];var dbH=require(_0x7bef('0x18'))[_0x7bef('0x19')];function respondWithStatusCode(_0x1d3f42,_0x2e17b6){_0x2e17b6=_0x2e17b6||0xcc;return function(_0x40822d){if(_0x40822d){return _0x1d3f42[_0x7bef('0x1a')](_0x2e17b6);}return _0x1d3f42[_0x7bef('0x1b')](_0x2e17b6)[_0x7bef('0x1c')]();};}function respondWithResult(_0x4ac0f8,_0x46296b){_0x46296b=_0x46296b||0xc8;return function(_0x80e61f){if(_0x80e61f){return _0x4ac0f8[_0x7bef('0x1b')](_0x46296b)[_0x7bef('0x1d')](_0x80e61f);}};}function respondWithFilteredResult(_0xf6cbc,_0x56c8eb){return function(_0xa576c8){if(_0xa576c8){var _0x360c72=typeof _0x56c8eb[_0x7bef('0x1e')]===_0x7bef('0x1f')&&typeof _0x56c8eb['limit']==='undefined';var _0x595cbc=_0xa576c8[_0x7bef('0x20')];var _0x5d3192=_0x360c72?0x0:_0x56c8eb[_0x7bef('0x1e')];var _0xdba49c=_0x360c72?_0xa576c8[_0x7bef('0x20')]:_0x56c8eb[_0x7bef('0x1e')]+_0x56c8eb['limit'];var _0x24f380;if(_0xdba49c>=_0x595cbc){_0xdba49c=_0x595cbc;_0x24f380=0xc8;}else{_0x24f380=0xce;}_0xf6cbc[_0x7bef('0x1b')](_0x24f380);return _0xf6cbc[_0x7bef('0x21')](_0x7bef('0x22'),_0x5d3192+'-'+_0xdba49c+'/'+_0x595cbc)[_0x7bef('0x1d')](_0xa576c8);}return null;};}function patchUpdates(_0x3f8ad7){return function(_0x5363c6){try{jsonpatch[_0x7bef('0x23')](_0x5363c6,_0x3f8ad7,!![]);}catch(_0x1761b1){return BPromise[_0x7bef('0x24')](_0x1761b1);}return _0x5363c6[_0x7bef('0x25')]();};}function saveUpdates(_0x4e60fb,_0x1df621){return function(_0x3711b8){if(_0x3711b8){return _0x3711b8[_0x7bef('0x26')](_0x4e60fb)['then'](function(_0x31d6f6){return _0x31d6f6;});}return null;};}function removeEntity(_0x291abb,_0x3289fe){return function(_0x424ff3){if(_0x424ff3){return _0x424ff3['destroy']()[_0x7bef('0x27')](function(){var _0x4fb161=_0x424ff3['get']({'plain':!![]});var _0x4d06b3=_0x7bef('0x28');return db[_0x7bef('0x29')]['destroy']({'where':{'type':_0x4d06b3,'resourceId':_0x4fb161['id']}})[_0x7bef('0x27')](function(){return _0x424ff3;});})['then'](function(){_0x291abb[_0x7bef('0x1b')](0xcc)[_0x7bef('0x1c')]();});}};}function handleEntityNotFound(_0x59c080,_0x314ee0){return function(_0x166c79){if(!_0x166c79){_0x59c080[_0x7bef('0x1a')](0x194);}return _0x166c79;};}function handleError(_0x2ee1c2,_0x3bbca2){_0x3bbca2=_0x3bbca2||0x1f4;return function(_0x10f26f){logger[_0x7bef('0x2a')](_0x10f26f[_0x7bef('0x2b')]);if(_0x10f26f['name']){delete _0x10f26f[_0x7bef('0x2c')];}_0x2ee1c2['status'](_0x3bbca2)[_0x7bef('0x2d')](_0x10f26f);};}exports[_0x7bef('0x2e')]=function(_0x2a1836,_0x191a15){var _0x35f99d={},_0x236c74={},_0x169e96={'count':0x0,'rows':[]};var _0x2f809c=_[_0x7bef('0x2f')](db['AnalyticCustomReport'][_0x7bef('0x30')],function(_0x9d8ce7){return{'name':_0x9d8ce7[_0x7bef('0x31')],'type':_0x9d8ce7[_0x7bef('0x32')][_0x7bef('0x33')]};});_0x236c74[_0x7bef('0x34')]=_[_0x7bef('0x2f')](_0x2f809c,_0x7bef('0x2c'));_0x236c74[_0x7bef('0x35')]=_[_0x7bef('0x36')](_0x2a1836[_0x7bef('0x35')]);_0x236c74[_0x7bef('0x37')]=_[_0x7bef('0x38')](_0x236c74[_0x7bef('0x34')],_0x236c74[_0x7bef('0x35')]);_0x35f99d['attributes']=_[_0x7bef('0x38')](_0x236c74[_0x7bef('0x34')],qs[_0x7bef('0x39')](_0x2a1836[_0x7bef('0x35')][_0x7bef('0x39')]));_0x35f99d[_0x7bef('0x3a')]=_0x35f99d[_0x7bef('0x3a')]['length']?_0x35f99d[_0x7bef('0x3a')]:_0x236c74['model'];if(!_0x2a1836['query'][_0x7bef('0x3b')](_0x7bef('0x3c'))){_0x35f99d[_0x7bef('0x3d')]=qs[_0x7bef('0x3d')](_0x2a1836[_0x7bef('0x35')][_0x7bef('0x3d')]);_0x35f99d['offset']=qs[_0x7bef('0x1e')](_0x2a1836[_0x7bef('0x35')][_0x7bef('0x1e')]);}_0x35f99d['order']=qs['sort'](_0x2a1836['query'][_0x7bef('0x3e')]);_0x35f99d['where']=qs[_0x7bef('0x37')](_[_0x7bef('0x3f')](_0x2a1836[_0x7bef('0x35')],_0x236c74[_0x7bef('0x37')]),_0x2f809c);if(_0x2a1836[_0x7bef('0x35')][_0x7bef('0x40')]){_0x35f99d[_0x7bef('0x41')]=_[_0x7bef('0x42')](_0x35f99d[_0x7bef('0x41')],{'$or':_[_0x7bef('0x2f')](_0x2f809c,function(_0x307709){if(_0x307709[_0x7bef('0x32')]!=='VIRTUAL'){var _0x1388c7={};_0x1388c7[_0x307709['name']]={'$like':'%'+_0x2a1836[_0x7bef('0x35')]['filter']+'%'};return _0x1388c7;}})});}_0x35f99d=_['merge']({},_0x35f99d,_0x2a1836[_0x7bef('0x43')]);var _0x4ced83={'where':_0x35f99d[_0x7bef('0x41')]};return db[_0x7bef('0x44')][_0x7bef('0x20')](_0x4ced83)[_0x7bef('0x27')](function(_0x77618f){_0x169e96['count']=_0x77618f;if(_0x2a1836['query'][_0x7bef('0x45')]){_0x35f99d[_0x7bef('0x46')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x7bef('0x47')](_0x35f99d);})[_0x7bef('0x27')](function(_0x12558b){_0x169e96[_0x7bef('0x48')]=_0x12558b;return _0x169e96;})[_0x7bef('0x27')](respondWithFilteredResult(_0x191a15,_0x35f99d))[_0x7bef('0x49')](handleError(_0x191a15,null));};exports[_0x7bef('0x4a')]=function(_0x3e53b3,_0x322490){var _0x52a894={'raw':![],'where':{'id':_0x3e53b3[_0x7bef('0x4b')]['id']}},_0x4c8a9e={};_0x4c8a9e[_0x7bef('0x34')]=_['keys'](db[_0x7bef('0x44')]['rawAttributes']);_0x4c8a9e[_0x7bef('0x35')]=_[_0x7bef('0x36')](_0x3e53b3[_0x7bef('0x35')]);_0x4c8a9e[_0x7bef('0x37')]=_[_0x7bef('0x38')](_0x4c8a9e[_0x7bef('0x34')],_0x4c8a9e[_0x7bef('0x35')]);_0x52a894[_0x7bef('0x3a')]=_[_0x7bef('0x38')](_0x4c8a9e['model'],qs[_0x7bef('0x39')](_0x3e53b3[_0x7bef('0x35')][_0x7bef('0x39')]));_0x52a894[_0x7bef('0x3a')]=_0x52a894[_0x7bef('0x3a')][_0x7bef('0x4c')]?_0x52a894[_0x7bef('0x3a')]:_0x4c8a9e[_0x7bef('0x34')];if(_0x3e53b3[_0x7bef('0x35')][_0x7bef('0x45')]){_0x52a894[_0x7bef('0x46')]=[{'all':!![]}];}_0x52a894=_[_0x7bef('0x42')]({},_0x52a894,_0x3e53b3[_0x7bef('0x43')]);return db[_0x7bef('0x44')]['find'](_0x52a894)['then'](handleEntityNotFound(_0x322490,null))[_0x7bef('0x27')](respondWithResult(_0x322490,null))[_0x7bef('0x49')](handleError(_0x322490,null));};exports[_0x7bef('0x4d')]=function(_0x4d86bf,_0x3ff7c5){return db['AnalyticCustomReport'][_0x7bef('0x4d')](_0x4d86bf['body'],{})['then'](function(_0x4e8339){var _0x5b6c6a=_0x4d86bf[_0x7bef('0x4e')][_0x7bef('0x4f')]({'plain':!![]});if(!_0x5b6c6a)throw new Error(_0x7bef('0x50'));if(_0x5b6c6a[_0x7bef('0x51')]===_0x7bef('0x4e')){var _0x18b8cc=_0x4e8339[_0x7bef('0x4f')]({'plain':!![]});var _0x58f0b3=_0x7bef('0x52');return db[_0x7bef('0x53')][_0x7bef('0x54')]({'where':{'name':_0x58f0b3,'userProfileId':_0x5b6c6a['userProfileId']},'raw':!![]})[_0x7bef('0x27')](function(_0x254aca){if(_0x254aca&&_0x254aca[_0x7bef('0x55')]===0x0){return db['UserProfileResource'][_0x7bef('0x4d')]({'name':_0x18b8cc[_0x7bef('0x2c')],'resourceId':_0x18b8cc['id'],'type':_0x7bef('0x28'),'sectionId':_0x254aca['id']},{})[_0x7bef('0x27')](function(){return _0x4e8339;});}else{return _0x4e8339;}})['catch'](function(_0x3ead5f){logger['error'](_0x7bef('0x56'),_0x3ead5f);throw _0x3ead5f;});}return _0x4e8339;})['then'](respondWithResult(_0x3ff7c5,0xc9))[_0x7bef('0x49')](handleError(_0x3ff7c5,null));};exports[_0x7bef('0x26')]=function(_0x5130d7,_0x115467){if(_0x5130d7[_0x7bef('0x57')]['id']){delete _0x5130d7[_0x7bef('0x57')]['id'];}return db[_0x7bef('0x44')][_0x7bef('0x54')]({'where':{'id':_0x5130d7[_0x7bef('0x4b')]['id']}})['then'](handleEntityNotFound(_0x115467,null))[_0x7bef('0x27')](saveUpdates(_0x5130d7[_0x7bef('0x57')],null))[_0x7bef('0x27')](respondWithResult(_0x115467,null))[_0x7bef('0x49')](handleError(_0x115467,null));};exports[_0x7bef('0x58')]=function(_0xd62f74,_0x406486){return db['AnalyticCustomReport']['find']({'where':{'id':_0xd62f74['params']['id']}})['then'](handleEntityNotFound(_0x406486,null))[_0x7bef('0x27')](removeEntity(_0x406486,null))['catch'](handleError(_0x406486,null));};exports['preview']=function(_0x4afa42,_0x19a224){var _0x5945dd=0xa;var _0x52f88e=[_0x7bef('0x59'),_0x7bef('0x5a'),_0x7bef('0x5b'),_0x7bef('0x5c')];var _0x2bb7ea={'SUM':_0x7bef('0x5d'),'COUNT':_0x7bef('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x7bef('0x5f'),'GROUP_CONCAT':_0x7bef('0x60'),'GROUP_CONCAT ASC':_0x7bef('0x61'),'GROUP_CONCAT DESC':_0x7bef('0x62')};var _0x2c2f46={'SEC_TO_TIME':_0x7bef('0x63'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7bef('0x64')};var _0x1fc334=function(_0x50bbac){return!_['includes']([_0x7bef('0x65'),_0x7bef('0x66'),_0x7bef('0x67'),_0x7bef('0x68')],_0x50bbac);};var _0x1ac8ff=function(_0x706871){if(!_0x706871||!_0x706871[_0x7bef('0x69')][_0x7bef('0x4c')]){return'';}for(var _0x4f2e0e='(',_0x1d8dc8=0x0;_0x1d8dc8<_0x706871[_0x7bef('0x69')][_0x7bef('0x4c')];_0x1d8dc8+=0x1){_0x1d8dc8>0x0&&(_0x4f2e0e+='\x20'+_0x706871[_0x7bef('0x6a')]+'\x20');_0x4f2e0e+=_0x706871[_0x7bef('0x69')][_0x1d8dc8][_0x7bef('0x6b')]?_0x1ac8ff(_0x706871[_0x7bef('0x69')][_0x1d8dc8][_0x7bef('0x6b')]):_0x706871[_0x7bef('0x69')][_0x1d8dc8][_0x7bef('0x6c')]+'\x20'+_0x706871['rules'][_0x1d8dc8][_0x7bef('0x6d')]+(_0x1fc334(_0x706871[_0x7bef('0x69')][_0x1d8dc8][_0x7bef('0x6d')])?'\x20'+_0x706871[_0x7bef('0x69')][_0x1d8dc8][_0x7bef('0x6e')]:'');}return _0x4f2e0e+')';};var _0x58cb18={'where':{'id':_0x4afa42['params']['id']}},_0x5323bf,_0x464406,_0x16e24e,_0x3505b8,_0x4f7c1f;_0x58cb18=_[_0x7bef('0x42')]({},_0x58cb18,_0x4afa42['options']);return db[_0x7bef('0x44')][_0x7bef('0x54')](_0x58cb18)['then'](function(_0x457f30){if(_0x457f30){_0x5323bf=_0x457f30;return _0x457f30[_0x7bef('0x6f')]();}return null;})[_0x7bef('0x27')](function(_0x581960){if(_0x581960){if(!_0x581960[_0x7bef('0x4c')]){throw new db[(_0x7bef('0x70'))]['ValidationErrorItem'](_0x7bef('0x71'),0x193);}_0x464406=_0x581960;return db[_0x7bef('0x72')][_0x7bef('0x47')]({'raw':!![]});}return null;})[_0x7bef('0x27')](function(_0x10c9e6){if(_0x10c9e6){_0x16e24e=_['keyBy'](_0x10c9e6,'id');var _0x2c6f72;var _0x158ffc=squel[_0x7bef('0x73')]();_0x158ffc[_0x7bef('0x74')](_0x5323bf[_0x7bef('0x75')]);for(var _0x5ee5c8=0x0;_0x5ee5c8<_0x464406[_0x7bef('0x4c')];_0x5ee5c8+=0x1){_0x2c6f72=_0x464406[_0x5ee5c8][_0x7bef('0x76')]?_0x16e24e[_0x464406[_0x5ee5c8][_0x7bef('0x76')]][_0x7bef('0x77')]:_0x464406[_0x5ee5c8]['field'];_0x2c6f72=_0x464406[_0x5ee5c8][_0x7bef('0x78')]?_[_0x7bef('0x79')](_0x2bb7ea[_0x464406[_0x5ee5c8][_0x7bef('0x78')]],'%s',_0x2c6f72):_0x2c6f72;_0x2c6f72=_0x464406[_0x5ee5c8][_0x7bef('0x7a')]?_[_0x7bef('0x79')](_0x2c2f46[_0x464406[_0x5ee5c8][_0x7bef('0x7a')]],'%s',_0x2c6f72):_0x2c6f72;if(_0x464406[_0x5ee5c8]['groupBy']){_0x158ffc[_0x7bef('0x6b')](_0x2c6f72);}_0x464406[_0x5ee5c8][_0x7bef('0x7b')]&&_0x158ffc['order'](_0x2c6f72,_0x464406[_0x5ee5c8]['orderBy']===_0x7bef('0x7c')?![]:!![]);_0x158ffc[_0x7bef('0x6c')](_0x2c6f72,_0x464406[_0x5ee5c8][_0x7bef('0x7d')]||_0x2c6f72);}if(_0x5323bf[_0x7bef('0x7e')]){_0x5323bf[_0x7bef('0x7e')]=JSON[_0x7bef('0x7f')](_0x5323bf[_0x7bef('0x7e')]);for(var _0x412021=0x0;_0x412021<_0x5323bf['joins'][_0x7bef('0x4c')];_0x412021+=0x1){if(_0x5323bf[_0x7bef('0x7e')][_0x412021][_0x7bef('0x32')]&&_[_0x7bef('0x80')](_0x52f88e,_0x5323bf[_0x7bef('0x7e')][_0x412021][_0x7bef('0x32')])&&_0x5323bf[_0x7bef('0x7e')][_0x412021][_0x7bef('0x81')]&&_0x5323bf[_0x7bef('0x7e')][_0x412021][_0x7bef('0x82')]&&_0x5323bf['joins'][_0x412021][_0x7bef('0x83')]){_0x158ffc[_0x5323bf[_0x7bef('0x7e')][_0x412021]['type']](_0x5323bf[_0x7bef('0x7e')][_0x412021]['foreignTable'],null,util['format'](_0x7bef('0x84'),_0x5323bf['table'],_0x5323bf['joins'][_0x412021]['parentKey'],_0x5323bf[_0x7bef('0x7e')][_0x412021][_0x7bef('0x82')],_0x5323bf['joins'][_0x412021][_0x7bef('0x83')]));}}}if(_0x5323bf[_0x7bef('0x85')]){_0x5323bf[_0x7bef('0x85')]=JSON['parse'](_0x5323bf[_0x7bef('0x85')]);_0x158ffc[_0x7bef('0x41')](_0x1ac8ff(_0x5323bf[_0x7bef('0x85')]['group']));}_0x4f7c1f=_0x158ffc['clone']();_0x158ffc[_0x7bef('0x3d')](_0x5945dd);_0x158ffc[_0x7bef('0x1e')](0x0);logger[_0x7bef('0x86')](_0x7bef('0x87'),_0x158ffc[_0x7bef('0x88')]());return dbH[_0x7bef('0x89')][_0x7bef('0x35')](_0x158ffc['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x7bef('0x8a')]});}})['then'](respondWithResult(_0x19a224,null))[_0x7bef('0x49')](handleError(_0x19a224,null));};function runReport(_0x2a31af,_0x2b836a,_0x487728){var _0x5f275f=_0x2b836a[_0x7bef('0x2c')];var _0x45647d=0xa;var _0x18fc51=['join',_0x7bef('0x5a'),_0x7bef('0x5b'),'cross_join'];var _0x14e6a4={'SUM':_0x7bef('0x5d'),'COUNT':_0x7bef('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7bef('0x8b'),'MIN':_0x7bef('0x8c'),'AVG':_0x7bef('0x5f'),'GROUP_CONCAT':_0x7bef('0x60'),'GROUP_CONCAT ASC':_0x7bef('0x61'),'GROUP_CONCAT DESC':_0x7bef('0x62')};var _0x56cd26={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x7bef('0x8d'),'HOUR':'HOUR(%s)','ROUND':_0x7bef('0x8e'),'UNIX_TIMESTAMP':_0x7bef('0x64')};var _0x37ba45=function(_0x1436a3){return!_['includes']([_0x7bef('0x65'),_0x7bef('0x66'),_0x7bef('0x67'),_0x7bef('0x68')],_0x1436a3);};var _0x8629f3=function(_0x5df38d){if(!_0x5df38d||!_0x5df38d[_0x7bef('0x69')][_0x7bef('0x4c')]){return'';}for(var _0x3debfc='(',_0x2d5260=0x0;_0x2d5260<_0x5df38d['rules'][_0x7bef('0x4c')];_0x2d5260+=0x1){_0x2d5260>0x0&&(_0x3debfc+='\x20'+_0x5df38d[_0x7bef('0x6a')]+'\x20');_0x3debfc+=_0x5df38d[_0x7bef('0x69')][_0x2d5260][_0x7bef('0x6b')]?_0x8629f3(_0x5df38d[_0x7bef('0x69')][_0x2d5260][_0x7bef('0x6b')]):_0x5df38d[_0x7bef('0x69')][_0x2d5260][_0x7bef('0x6c')]+'\x20'+_0x5df38d['rules'][_0x2d5260][_0x7bef('0x6d')]+(_0x37ba45(_0x5df38d[_0x7bef('0x69')][_0x2d5260][_0x7bef('0x6d')])?'\x20'+_0x5df38d[_0x7bef('0x69')][_0x2d5260][_0x7bef('0x6e')]:'');}return _0x3debfc+')';};var _0x17ea2e={'where':{'id':_0x2a31af['id']}},_0x3a9e81,_0x29bea3,_0x2da09d,_0x4dab48,_0x4fc4c9;_0x17ea2e=_[_0x7bef('0x42')]({},_0x17ea2e,_0x487728);return db[_0x7bef('0x44')][_0x7bef('0x54')](_0x17ea2e)['then'](function(_0x8aac3d){if(_0x8aac3d){_0x3a9e81=_0x8aac3d;return _0x8aac3d[_0x7bef('0x6f')]();}return null;})['then'](function(_0x4542c8){if(_0x4542c8){if(!_0x4542c8[_0x7bef('0x4c')]){throw new db[(_0x7bef('0x70'))]['ValidationErrorItem'](_0x7bef('0x71'),0x193);}_0x29bea3=_0x4542c8;return db[_0x7bef('0x72')][_0x7bef('0x47')]({'raw':!![]});}return null;})['then'](function(_0x5e2807){if(_0x5e2807){_0x2da09d=_[_0x7bef('0x8f')](_0x5e2807,'id');var _0x230ae1;var _0x1e5e22=squel[_0x7bef('0x73')]();_0x1e5e22[_0x7bef('0x74')](_0x3a9e81[_0x7bef('0x75')]);for(var _0x5f4b5d=0x0;_0x5f4b5d<_0x29bea3[_0x7bef('0x4c')];_0x5f4b5d+=0x1){_0x230ae1=_0x29bea3[_0x5f4b5d][_0x7bef('0x76')]?_0x2da09d[_0x29bea3[_0x5f4b5d][_0x7bef('0x76')]][_0x7bef('0x77')]:_0x29bea3[_0x5f4b5d][_0x7bef('0x6c')];_0x230ae1=_0x29bea3[_0x5f4b5d][_0x7bef('0x78')]?_['replace'](_0x14e6a4[_0x29bea3[_0x5f4b5d]['function']],'%s',_0x230ae1):_0x230ae1;_0x230ae1=_0x29bea3[_0x5f4b5d][_0x7bef('0x7a')]?_[_0x7bef('0x79')](_0x56cd26[_0x29bea3[_0x5f4b5d][_0x7bef('0x7a')]],'%s',_0x230ae1):_0x230ae1;if(_0x29bea3[_0x5f4b5d][_0x7bef('0x90')]){_0x1e5e22[_0x7bef('0x6b')](_0x230ae1);}_0x29bea3[_0x5f4b5d]['orderBy']&&_0x1e5e22['order'](_0x230ae1,_0x29bea3[_0x5f4b5d][_0x7bef('0x7b')]==='DESC'?![]:!![]);_0x1e5e22[_0x7bef('0x6c')](_0x230ae1,_0x29bea3[_0x5f4b5d]['alias']||_0x230ae1);}if(_0x3a9e81[_0x7bef('0x7e')]){_0x3a9e81[_0x7bef('0x7e')]=JSON[_0x7bef('0x7f')](_0x3a9e81[_0x7bef('0x7e')]);for(var _0x28fa4e=0x0;_0x28fa4e<_0x3a9e81['joins'][_0x7bef('0x4c')];_0x28fa4e+=0x1){if(_0x3a9e81[_0x7bef('0x7e')][_0x28fa4e]['type']&&_[_0x7bef('0x80')](_0x18fc51,_0x3a9e81[_0x7bef('0x7e')][_0x28fa4e]['type'])&&_0x3a9e81[_0x7bef('0x7e')][_0x28fa4e][_0x7bef('0x81')]&&_0x3a9e81[_0x7bef('0x7e')][_0x28fa4e][_0x7bef('0x82')]&&_0x3a9e81[_0x7bef('0x7e')][_0x28fa4e][_0x7bef('0x83')]){_0x1e5e22[_0x3a9e81[_0x7bef('0x7e')][_0x28fa4e][_0x7bef('0x32')]](_0x3a9e81[_0x7bef('0x7e')][_0x28fa4e]['foreignTable'],null,util[_0x7bef('0x7a')](_0x7bef('0x84'),_0x3a9e81[_0x7bef('0x75')],_0x3a9e81[_0x7bef('0x7e')][_0x28fa4e][_0x7bef('0x81')],_0x3a9e81[_0x7bef('0x7e')][_0x28fa4e][_0x7bef('0x82')],_0x3a9e81[_0x7bef('0x7e')][_0x28fa4e]['foreignKey']));}}}if(_0x3a9e81[_0x7bef('0x85')]){_0x3a9e81[_0x7bef('0x85')]=JSON[_0x7bef('0x7f')](_0x3a9e81[_0x7bef('0x85')]);_0x1e5e22[_0x7bef('0x41')](_0x8629f3(_0x3a9e81[_0x7bef('0x85')][_0x7bef('0x6b')]));}_0x4fc4c9=_0x1e5e22[_0x7bef('0x91')]();_0x1e5e22[_0x7bef('0x3d')](_0x45647d);_0x1e5e22[_0x7bef('0x1e')](0x0);return;}})[_0x7bef('0x27')](function(){if(_0x2b836a[_0x7bef('0x92')]===_0x7bef('0x93')){return null;}var _0x2c0a62=_[_0x7bef('0x42')](_0x2b836a,{'name':_0x2b836a[_0x7bef('0x94')]||_0x2b836a[_0x7bef('0x2c')]||_0x3a9e81[_0x7bef('0x2c')],'basename':_0x5f275f,'savename':util[_0x7bef('0x7a')](_0x7bef('0x95'),_0x2b836a[_0x7bef('0x2c')]||_0x3a9e81[_0x7bef('0x2c')],require(_0x7bef('0x96'))[_0x7bef('0x97')](0x4),_0x2b836a[_0x7bef('0x92')]||_0x7bef('0x98')),'reportId':_0x3a9e81['id'],'reportType':_0x7bef('0x99')});return db[_0x7bef('0x9a')][_0x7bef('0x4d')](_0x2c0a62,{'raw':!![]});})['then'](function(_0x52e213){if(_0x3a9e81['table']==='cdr'){_0x4fc4c9[_0x7bef('0x41')](_0x3a9e81[_0x7bef('0x75')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x2b836a[_0x7bef('0x9b')],_0x2b836a[_0x7bef('0x9c')]);}else{_0x4fc4c9['where'](_0x3a9e81['table']+_0x7bef('0x9d'),_0x2b836a['startDate'],_0x2b836a[_0x7bef('0x9c')]);}if(_0x52e213){logger[_0x7bef('0x9e')]('Run\x20Query:',_0x4fc4c9['toString']());require(_0x7bef('0x9f'))[_0x7bef('0xa0')](path[_0x7bef('0x59')](__dirname,'../../components/export/',_0x52e213[_0x7bef('0x92')]),[_0x52e213['id'],_0x4fc4c9[_0x7bef('0x88')](),path[_0x7bef('0x59')](__dirname,'../../files/reports',_0x52e213[_0x7bef('0xa1')]),_0x5f275f]);return _0x52e213;}else{var _0xc63ca0=squel[_0x7bef('0x73')]();_0xc63ca0[_0x7bef('0x74')]('('+_0x4fc4c9['toString']()+')','countTable');_0xc63ca0['field']('COUNT(*)',_0x7bef('0x20'));_0x4fc4c9[_0x7bef('0x3d')](_0x2b836a[_0x7bef('0x3d')]||_0x45647d);_0x4fc4c9[_0x7bef('0x1e')](_0x2b836a[_0x7bef('0x1e')]||0x0);return dbH[_0x7bef('0x89')][_0x7bef('0x35')](_0xc63ca0['toString'](),{'type':dbH[_0x7bef('0x89')][_0x7bef('0xa2')][_0x7bef('0x8a')]})[_0x7bef('0x27')](function(_0x2104de){if(!_0x2104de['length']){_0x4dab48=0x0;}else{_0x4dab48=_0x2104de[0x0]['count']||0x0;}return dbH[_0x7bef('0x89')][_0x7bef('0x35')](_0x4fc4c9[_0x7bef('0x88')](),{'type':dbH[_0x7bef('0x89')]['QueryTypes'][_0x7bef('0x8a')]});})[_0x7bef('0x27')](function(_0x3fc55b){return{'rows':_0x3fc55b||[],'count':_0x4dab48};});}});}exports[_0x7bef('0xa3')]=function(_0x46be58,_0x5053a3){return runReport(_0x46be58[_0x7bef('0x4b')],_0x46be58[_0x7bef('0x35')],_0x46be58['options'])[_0x7bef('0x27')](respondWithResult(_0x5053a3,null))[_0x7bef('0x49')](handleError(_0x5053a3,null));};exports[_0x7bef('0xa4')]=runReport;exports[_0x7bef('0x35')]=function(_0x20fcfd,_0x13c149){var _0x313b04=0xa;var _0x2fe8ae=['join',_0x7bef('0x5a'),'right_join',_0x7bef('0x5c')];var _0xfbfa39={'SUM':'SUM(%s)','COUNT':_0x7bef('0x5e'),'COUNT DISTINCT':_0x7bef('0xa5'),'MAX':_0x7bef('0x8b'),'MIN':'MIN(%s)','AVG':_0x7bef('0x5f'),'GROUP_CONCAT':_0x7bef('0x60'),'GROUP_CONCAT ASC':_0x7bef('0x61'),'GROUP_CONCAT DESC':_0x7bef('0x62')};var _0x44cf94={'SEC_TO_TIME':_0x7bef('0x63'),'DATE':_0x7bef('0x8d'),'HOUR':_0x7bef('0xa6'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7bef('0x64')};var _0x48c36f=function(_0x14b465){return!_['includes']([_0x7bef('0x65'),_0x7bef('0x66'),_0x7bef('0x67'),_0x7bef('0x68')],_0x14b465);};var _0x3baf27=function(_0x30825e){if(!_0x30825e||!_0x30825e[_0x7bef('0x69')][_0x7bef('0x4c')]){return'';}for(var _0x26e4da='(',_0x140203=0x0;_0x140203<_0x30825e[_0x7bef('0x69')][_0x7bef('0x4c')];_0x140203+=0x1){_0x140203>0x0&&(_0x26e4da+='\x20'+_0x30825e[_0x7bef('0x6a')]+'\x20');_0x26e4da+=_0x30825e[_0x7bef('0x69')][_0x140203][_0x7bef('0x6b')]?_0x3baf27(_0x30825e['rules'][_0x140203][_0x7bef('0x6b')]):_0x30825e[_0x7bef('0x69')][_0x140203][_0x7bef('0x6c')]+'\x20'+_0x30825e[_0x7bef('0x69')][_0x140203][_0x7bef('0x6d')]+(_0x48c36f(_0x30825e[_0x7bef('0x69')][_0x140203][_0x7bef('0x6d')])?'\x20'+_0x30825e[_0x7bef('0x69')][_0x140203]['value']:'');}return _0x26e4da+')';};var _0x3b2932={'where':{'id':_0x20fcfd[_0x7bef('0x4b')]['id']}},_0x508abc,_0x1bad68,_0x2292a0,_0x112c9b,_0x3907f3;_0x3b2932=_[_0x7bef('0x42')]({},_0x3b2932,_0x20fcfd[_0x7bef('0x43')]);return db['AnalyticCustomReport'][_0x7bef('0x54')](_0x3b2932)[_0x7bef('0x27')](function(_0x449705){if(_0x449705){_0x508abc=_0x449705;return _0x449705[_0x7bef('0x6f')]();}return null;})[_0x7bef('0x27')](function(_0x2450fc){if(_0x2450fc){if(!_0x2450fc['length']){throw new db['Sequelize'][(_0x7bef('0xa7'))](_0x7bef('0x71'),0x193);}_0x1bad68=_0x2450fc;return db['AnalyticMetric'][_0x7bef('0x47')]({'raw':!![]});}return null;})['then'](function(_0x291610){if(_0x291610){_0x2292a0=_[_0x7bef('0x8f')](_0x291610,'id');var _0x4a6847;var _0x4ce4b1=squel[_0x7bef('0x73')]();_0x4ce4b1[_0x7bef('0x74')](_0x508abc[_0x7bef('0x75')]);for(var _0x4707bb=0x0;_0x4707bb<_0x1bad68[_0x7bef('0x4c')];_0x4707bb+=0x1){_0x4a6847=_0x1bad68[_0x4707bb]['MetricId']?_0x2292a0[_0x1bad68[_0x4707bb]['MetricId']]['metric']:_0x1bad68[_0x4707bb][_0x7bef('0x6c')];_0x4a6847=_0x1bad68[_0x4707bb]['function']?_[_0x7bef('0x79')](_0xfbfa39[_0x1bad68[_0x4707bb][_0x7bef('0x78')]],'%s',_0x4a6847):_0x4a6847;_0x4a6847=_0x1bad68[_0x4707bb]['format']?_['replace'](_0x44cf94[_0x1bad68[_0x4707bb][_0x7bef('0x7a')]],'%s',_0x4a6847):_0x4a6847;if(_0x1bad68[_0x4707bb][_0x7bef('0x90')]){_0x4ce4b1['group'](_0x4a6847);}_0x1bad68[_0x4707bb][_0x7bef('0x7b')]&&_0x4ce4b1[_0x7bef('0xa8')](_0x4a6847,_0x1bad68[_0x4707bb]['orderBy']==='DESC'?![]:!![]);_0x4ce4b1[_0x7bef('0x6c')](_0x4a6847,_0x1bad68[_0x4707bb]['alias']||_0x4a6847);}if(_0x508abc[_0x7bef('0x7e')]){_0x508abc[_0x7bef('0x7e')]=JSON[_0x7bef('0x7f')](_0x508abc[_0x7bef('0x7e')]);for(var _0x5176e2=0x0;_0x5176e2<_0x508abc[_0x7bef('0x7e')][_0x7bef('0x4c')];_0x5176e2+=0x1){if(_0x508abc[_0x7bef('0x7e')][_0x5176e2][_0x7bef('0x32')]&&_[_0x7bef('0x80')](_0x2fe8ae,_0x508abc[_0x7bef('0x7e')][_0x5176e2][_0x7bef('0x32')])&&_0x508abc['joins'][_0x5176e2]['parentKey']&&_0x508abc[_0x7bef('0x7e')][_0x5176e2]['foreignTable']&&_0x508abc[_0x7bef('0x7e')][_0x5176e2]['foreignKey']){_0x4ce4b1[_0x508abc[_0x7bef('0x7e')][_0x5176e2][_0x7bef('0x32')]](_0x508abc[_0x7bef('0x7e')][_0x5176e2]['foreignTable'],null,util[_0x7bef('0x7a')](_0x7bef('0x84'),_0x508abc[_0x7bef('0x75')],_0x508abc[_0x7bef('0x7e')][_0x5176e2][_0x7bef('0x81')],_0x508abc[_0x7bef('0x7e')][_0x5176e2][_0x7bef('0x82')],_0x508abc[_0x7bef('0x7e')][_0x5176e2]['foreignKey']));}}}if(_0x508abc[_0x7bef('0x85')]){_0x508abc['conditions']=JSON[_0x7bef('0x7f')](_0x508abc[_0x7bef('0x85')]);_0x4ce4b1[_0x7bef('0x41')](_0x3baf27(_0x508abc[_0x7bef('0x85')]['group']));}_0x3907f3=_0x4ce4b1[_0x7bef('0x91')]();_0x4ce4b1[_0x7bef('0x3d')](_0x313b04);_0x4ce4b1['offset'](0x0);logger[_0x7bef('0x86')](_0x7bef('0x87'),_0x4ce4b1[_0x7bef('0x88')]());return dbH[_0x7bef('0x89')][_0x7bef('0x35')](_0x4ce4b1[_0x7bef('0x88')](),{'type':dbH[_0x7bef('0x89')]['QueryTypes'][_0x7bef('0x8a')]});}})['then'](function(){return{'sql':_0x3907f3[_0x7bef('0x88')]()};})[_0x7bef('0x27')](respondWithResult(_0x13c149,null))[_0x7bef('0x49')](handleError(_0x13c149,null));}; \ No newline at end of file +var _0x009e=['type','key','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','count','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','table','MetricId','metric','field','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','keyBy','from','groupBy','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','../../components/export/','select','countTable','COUNT(*)','run','HOUR(%s)','operator','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','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','set','Content-Range','apply','save','update','get','CustomReports','UserProfileResource','then','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x1524a4,_0x33f93e){var _0x388207=function(_0x4d2db6){while(--_0x4d2db6){_0x1524a4['push'](_0x1524a4['shift']());}};_0x388207(++_0x33f93e);}(_0x009e,0x11c));var _0xe009=function(_0x4663f7,_0x41b7b8){_0x4663f7=_0x4663f7-0x0;var _0x5f450b=_0x009e[_0x4663f7];return _0x5f450b;};'use strict';var emlformat=require(_0xe009('0x0'));var rimraf=require(_0xe009('0x1'));var zipdir=require(_0xe009('0x2'));var jsonpatch=require(_0xe009('0x3'));var rp=require(_0xe009('0x4'));var moment=require('moment');var BPromise=require(_0xe009('0x5'));var Mustache=require('mustache');var util=require(_0xe009('0x6'));var path=require('path');var sox=require(_0xe009('0x7'));var csv=require(_0xe009('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe009('0x9'));var _=require('lodash');var squel=require(_0xe009('0xa'));var crypto=require(_0xe009('0xb'));var jsforce=require(_0xe009('0xc'));var deskjs=require(_0xe009('0xd'));var toCsv=require(_0xe009('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe009('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe009('0xf'));var as=require(_0xe009('0x10'));var hardwareService=require(_0xe009('0x11'));var logger=require(_0xe009('0x12'))(_0xe009('0x13'));var utils=require(_0xe009('0x14'));var config=require(_0xe009('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe009('0x16'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x3c6791,_0x2f411a){_0x2f411a=_0x2f411a||0xcc;return function(_0x3fb2a8){if(_0x3fb2a8){return _0x3c6791[_0xe009('0x17')](_0x2f411a);}return _0x3c6791[_0xe009('0x18')](_0x2f411a)[_0xe009('0x19')]();};}function respondWithResult(_0x198d15,_0x3737d6){_0x3737d6=_0x3737d6||0xc8;return function(_0x1ffa85){if(_0x1ffa85){return _0x198d15[_0xe009('0x18')](_0x3737d6)[_0xe009('0x1a')](_0x1ffa85);}};}function respondWithFilteredResult(_0x22e5ad,_0xfdbbe8){return function(_0x4494c3){if(_0x4494c3){var _0xa007b9=typeof _0xfdbbe8[_0xe009('0x1b')]===_0xe009('0x1c')&&typeof _0xfdbbe8[_0xe009('0x1d')]===_0xe009('0x1c');var _0x4eefa4=_0x4494c3['count'];var _0x570741=_0xa007b9?0x0:_0xfdbbe8[_0xe009('0x1b')];var _0x1611e2=_0xa007b9?_0x4494c3['count']:_0xfdbbe8['offset']+_0xfdbbe8[_0xe009('0x1d')];var _0xd0ed82;if(_0x1611e2>=_0x4eefa4){_0x1611e2=_0x4eefa4;_0xd0ed82=0xc8;}else{_0xd0ed82=0xce;}_0x22e5ad[_0xe009('0x18')](_0xd0ed82);return _0x22e5ad[_0xe009('0x1e')](_0xe009('0x1f'),_0x570741+'-'+_0x1611e2+'/'+_0x4eefa4)[_0xe009('0x1a')](_0x4494c3);}return null;};}function patchUpdates(_0x19686c){return function(_0x2aec0c){try{jsonpatch[_0xe009('0x20')](_0x2aec0c,_0x19686c,!![]);}catch(_0x5c8653){return BPromise['reject'](_0x5c8653);}return _0x2aec0c[_0xe009('0x21')]();};}function saveUpdates(_0x2b4120,_0x53dab6){return function(_0x26ba88){if(_0x26ba88){return _0x26ba88[_0xe009('0x22')](_0x2b4120)['then'](function(_0x80156c){return _0x80156c;});}return null;};}function removeEntity(_0x37a881,_0x14eef6){return function(_0x475d92){if(_0x475d92){return _0x475d92['destroy']()['then'](function(){var _0x417dac=_0x475d92[_0xe009('0x23')]({'plain':!![]});var _0x517f72=_0xe009('0x24');return db[_0xe009('0x25')]['destroy']({'where':{'type':_0x517f72,'resourceId':_0x417dac['id']}})['then'](function(){return _0x475d92;});})[_0xe009('0x26')](function(){_0x37a881[_0xe009('0x18')](0xcc)[_0xe009('0x19')]();});}};}function handleEntityNotFound(_0x3ebefb,_0x503646){return function(_0x25ff53){if(!_0x25ff53){_0x3ebefb[_0xe009('0x17')](0x194);}return _0x25ff53;};}function handleError(_0x51c2f1,_0x5567c2){_0x5567c2=_0x5567c2||0x1f4;return function(_0x4769e6){logger['error'](_0x4769e6[_0xe009('0x27')]);if(_0x4769e6[_0xe009('0x28')]){delete _0x4769e6[_0xe009('0x28')];}_0x51c2f1[_0xe009('0x18')](_0x5567c2)[_0xe009('0x29')](_0x4769e6);};}exports[_0xe009('0x2a')]=function(_0x4fe786,_0x137bdd){var _0x117d7e={},_0x3bb962={},_0x29d0e8={'count':0x0,'rows':[]};var _0x90a38d=_[_0xe009('0x2b')](db['AnalyticCustomReport'][_0xe009('0x2c')],function(_0x1f5d94){return{'name':_0x1f5d94[_0xe009('0x2d')],'type':_0x1f5d94[_0xe009('0x2e')][_0xe009('0x2f')]};});_0x3bb962['model']=_['map'](_0x90a38d,_0xe009('0x28'));_0x3bb962[_0xe009('0x30')]=_['keys'](_0x4fe786['query']);_0x3bb962[_0xe009('0x31')]=_['intersection'](_0x3bb962['model'],_0x3bb962[_0xe009('0x30')]);_0x117d7e['attributes']=_[_0xe009('0x32')](_0x3bb962[_0xe009('0x33')],qs[_0xe009('0x34')](_0x4fe786[_0xe009('0x30')][_0xe009('0x34')]));_0x117d7e[_0xe009('0x35')]=_0x117d7e[_0xe009('0x35')]['length']?_0x117d7e['attributes']:_0x3bb962[_0xe009('0x33')];if(!_0x4fe786[_0xe009('0x30')]['hasOwnProperty'](_0xe009('0x36'))){_0x117d7e[_0xe009('0x1d')]=qs['limit'](_0x4fe786[_0xe009('0x30')][_0xe009('0x1d')]);_0x117d7e[_0xe009('0x1b')]=qs[_0xe009('0x1b')](_0x4fe786[_0xe009('0x30')]['offset']);}_0x117d7e[_0xe009('0x37')]=qs[_0xe009('0x38')](_0x4fe786[_0xe009('0x30')][_0xe009('0x38')]);_0x117d7e[_0xe009('0x39')]=qs[_0xe009('0x31')](_[_0xe009('0x3a')](_0x4fe786[_0xe009('0x30')],_0x3bb962[_0xe009('0x31')]),_0x90a38d);if(_0x4fe786[_0xe009('0x30')][_0xe009('0x3b')]){_0x117d7e[_0xe009('0x39')]=_[_0xe009('0x3c')](_0x117d7e[_0xe009('0x39')],{'$or':_[_0xe009('0x2b')](_0x90a38d,function(_0xbf0d51){if(_0xbf0d51[_0xe009('0x2e')]!==_0xe009('0x3d')){var _0x52450d={};_0x52450d[_0xbf0d51['name']]={'$like':'%'+_0x4fe786[_0xe009('0x30')][_0xe009('0x3b')]+'%'};return _0x52450d;}})});}_0x117d7e=_['merge']({},_0x117d7e,_0x4fe786[_0xe009('0x3e')]);var _0x29cac0={'where':_0x117d7e[_0xe009('0x39')]};return db[_0xe009('0x3f')][_0xe009('0x40')](_0x29cac0)[_0xe009('0x26')](function(_0x15f515){_0x29d0e8[_0xe009('0x40')]=_0x15f515;if(_0x4fe786[_0xe009('0x30')][_0xe009('0x41')]){_0x117d7e[_0xe009('0x42')]=[{'all':!![]}];}return db[_0xe009('0x3f')][_0xe009('0x43')](_0x117d7e);})[_0xe009('0x26')](function(_0x5b2fa4){_0x29d0e8[_0xe009('0x44')]=_0x5b2fa4;return _0x29d0e8;})[_0xe009('0x26')](respondWithFilteredResult(_0x137bdd,_0x117d7e))[_0xe009('0x45')](handleError(_0x137bdd,null));};exports[_0xe009('0x46')]=function(_0x491105,_0x2e2055){var _0x2b205d={'raw':![],'where':{'id':_0x491105['params']['id']}},_0x4da5c6={};_0x4da5c6[_0xe009('0x33')]=_[_0xe009('0x47')](db['AnalyticCustomReport'][_0xe009('0x2c')]);_0x4da5c6['query']=_[_0xe009('0x47')](_0x491105[_0xe009('0x30')]);_0x4da5c6[_0xe009('0x31')]=_[_0xe009('0x32')](_0x4da5c6['model'],_0x4da5c6[_0xe009('0x30')]);_0x2b205d[_0xe009('0x35')]=_[_0xe009('0x32')](_0x4da5c6[_0xe009('0x33')],qs['fields'](_0x491105[_0xe009('0x30')][_0xe009('0x34')]));_0x2b205d[_0xe009('0x35')]=_0x2b205d['attributes'][_0xe009('0x48')]?_0x2b205d[_0xe009('0x35')]:_0x4da5c6[_0xe009('0x33')];if(_0x491105[_0xe009('0x30')]['includeAll']){_0x2b205d[_0xe009('0x42')]=[{'all':!![]}];}_0x2b205d=_[_0xe009('0x3c')]({},_0x2b205d,_0x491105[_0xe009('0x3e')]);return db['AnalyticCustomReport'][_0xe009('0x49')](_0x2b205d)[_0xe009('0x26')](handleEntityNotFound(_0x2e2055,null))[_0xe009('0x26')](respondWithResult(_0x2e2055,null))[_0xe009('0x45')](handleError(_0x2e2055,null));};exports[_0xe009('0x4a')]=function(_0x55a736,_0x219b3f){return db['AnalyticCustomReport'][_0xe009('0x4a')](_0x55a736[_0xe009('0x4b')],{})[_0xe009('0x26')](function(_0x4b4f50){var _0x3f587a=_0x55a736['user'][_0xe009('0x23')]({'plain':!![]});if(!_0x3f587a)throw new Error(_0xe009('0x4c'));if(_0x3f587a['role']===_0xe009('0x4d')){var _0x1068b0=_0x4b4f50[_0xe009('0x23')]({'plain':!![]});var _0x17a2cc=_0xe009('0x4e');return db[_0xe009('0x4f')][_0xe009('0x49')]({'where':{'name':_0x17a2cc,'userProfileId':_0x3f587a[_0xe009('0x50')]},'raw':!![]})['then'](function(_0x27f3ae){if(_0x27f3ae&&_0x27f3ae[_0xe009('0x51')]===0x0){return db[_0xe009('0x25')][_0xe009('0x4a')]({'name':_0x1068b0[_0xe009('0x28')],'resourceId':_0x1068b0['id'],'type':_0xe009('0x24'),'sectionId':_0x27f3ae['id']},{})[_0xe009('0x26')](function(){return _0x4b4f50;});}else{return _0x4b4f50;}})[_0xe009('0x45')](function(_0x82af5){logger[_0xe009('0x52')](_0xe009('0x53'),_0x82af5);throw _0x82af5;});}return _0x4b4f50;})[_0xe009('0x26')](respondWithResult(_0x219b3f,0xc9))['catch'](handleError(_0x219b3f,null));};exports[_0xe009('0x22')]=function(_0x3f1829,_0x27e66b){if(_0x3f1829['body']['id']){delete _0x3f1829[_0xe009('0x4b')]['id'];}return db[_0xe009('0x3f')][_0xe009('0x49')]({'where':{'id':_0x3f1829[_0xe009('0x54')]['id']}})[_0xe009('0x26')](handleEntityNotFound(_0x27e66b,null))[_0xe009('0x26')](saveUpdates(_0x3f1829[_0xe009('0x4b')],null))[_0xe009('0x26')](respondWithResult(_0x27e66b,null))[_0xe009('0x45')](handleError(_0x27e66b,null));};exports[_0xe009('0x55')]=function(_0x16c7a8,_0x2ab008){return db[_0xe009('0x3f')][_0xe009('0x49')]({'where':{'id':_0x16c7a8['params']['id']}})[_0xe009('0x26')](handleEntityNotFound(_0x2ab008,null))['then'](removeEntity(_0x2ab008,null))[_0xe009('0x45')](handleError(_0x2ab008,null));};exports['preview']=function(_0x243dde,_0x44b93c){var _0x2d1446=0xa;var _0xb23c79=[_0xe009('0x56'),_0xe009('0x57'),_0xe009('0x58'),_0xe009('0x59')];var _0x171b44={'SUM':_0xe009('0x5a'),'COUNT':_0xe009('0x5b'),'COUNT DISTINCT':_0xe009('0x5c'),'MAX':_0xe009('0x5d'),'MIN':'MIN(%s)','AVG':_0xe009('0x5e'),'GROUP_CONCAT':_0xe009('0x5f'),'GROUP_CONCAT ASC':_0xe009('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x19a162={'SEC_TO_TIME':_0xe009('0x61'),'DATE':_0xe009('0x62'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1bff70=function(_0x5da0ca){return!_[_0xe009('0x63')]([_0xe009('0x64'),_0xe009('0x65'),_0xe009('0x66'),'IS\x20NOT\x20EMPTY'],_0x5da0ca);};var _0xc859bf=function(_0x611770){if(!_0x611770||!_0x611770[_0xe009('0x67')]['length']){return'';}for(var _0x4790a6='(',_0x56d9c5=0x0;_0x56d9c5<_0x611770[_0xe009('0x67')][_0xe009('0x48')];_0x56d9c5+=0x1){_0x56d9c5>0x0&&(_0x4790a6+='\x20'+_0x611770['operator']+'\x20');_0x4790a6+=_0x611770[_0xe009('0x67')][_0x56d9c5][_0xe009('0x68')]?_0xc859bf(_0x611770[_0xe009('0x67')][_0x56d9c5]['group']):_0x611770[_0xe009('0x67')][_0x56d9c5]['field']+'\x20'+_0x611770[_0xe009('0x67')][_0x56d9c5][_0xe009('0x69')]+(_0x1bff70(_0x611770[_0xe009('0x67')][_0x56d9c5][_0xe009('0x69')])?'\x20'+_0x611770[_0xe009('0x67')][_0x56d9c5][_0xe009('0x6a')]:'');}return _0x4790a6+')';};var _0x914923={'where':{'id':_0x243dde['params']['id']}},_0x4cb72c,_0x4360ab,_0x1f0902,_0x2bd865,_0x486a8a;_0x914923=_[_0xe009('0x3c')]({},_0x914923,_0x243dde[_0xe009('0x3e')]);return db[_0xe009('0x3f')][_0xe009('0x49')](_0x914923)['then'](function(_0x32c909){if(_0x32c909){_0x4cb72c=_0x32c909;return _0x32c909[_0xe009('0x6b')]();}return null;})[_0xe009('0x26')](function(_0x1ad80a){if(_0x1ad80a){if(!_0x1ad80a['length']){throw new db[(_0xe009('0x6c'))][(_0xe009('0x6d'))](_0xe009('0x6e'),0x193);}_0x4360ab=_0x1ad80a;return db[_0xe009('0x6f')]['findAll']({'raw':!![]});}return null;})[_0xe009('0x26')](function(_0x2da7f7){if(_0x2da7f7){_0x1f0902=_['keyBy'](_0x2da7f7,'id');var _0x4597e2;var _0x5a3678=squel['select']();_0x5a3678['from'](_0x4cb72c[_0xe009('0x70')]);for(var _0x4f480b=0x0;_0x4f480b<_0x4360ab[_0xe009('0x48')];_0x4f480b+=0x1){_0x4597e2=_0x4360ab[_0x4f480b][_0xe009('0x71')]?_0x1f0902[_0x4360ab[_0x4f480b][_0xe009('0x71')]][_0xe009('0x72')]:_0x4360ab[_0x4f480b][_0xe009('0x73')];_0x4597e2=_0x4360ab[_0x4f480b][_0xe009('0x74')]?_[_0xe009('0x75')](_0x171b44[_0x4360ab[_0x4f480b][_0xe009('0x74')]],'%s',_0x4597e2):_0x4597e2;_0x4597e2=_0x4360ab[_0x4f480b][_0xe009('0x76')]?_[_0xe009('0x75')](_0x19a162[_0x4360ab[_0x4f480b][_0xe009('0x76')]],'%s',_0x4597e2):_0x4597e2;if(_0x4360ab[_0x4f480b]['groupBy']){_0x5a3678[_0xe009('0x68')](_0x4597e2);}_0x4360ab[_0x4f480b][_0xe009('0x77')]&&_0x5a3678[_0xe009('0x37')](_0x4597e2,_0x4360ab[_0x4f480b][_0xe009('0x77')]===_0xe009('0x78')?![]:!![]);_0x5a3678[_0xe009('0x73')](_0x4597e2,_0x4360ab[_0x4f480b][_0xe009('0x79')]||_0x4597e2);}if(_0x4cb72c[_0xe009('0x7a')]){_0x4cb72c[_0xe009('0x7a')]=JSON[_0xe009('0x7b')](_0x4cb72c[_0xe009('0x7a')]);for(var _0x3efed0=0x0;_0x3efed0<_0x4cb72c[_0xe009('0x7a')][_0xe009('0x48')];_0x3efed0+=0x1){if(_0x4cb72c[_0xe009('0x7a')][_0x3efed0]['type']&&_[_0xe009('0x63')](_0xb23c79,_0x4cb72c[_0xe009('0x7a')][_0x3efed0][_0xe009('0x2e')])&&_0x4cb72c[_0xe009('0x7a')][_0x3efed0][_0xe009('0x7c')]&&_0x4cb72c[_0xe009('0x7a')][_0x3efed0][_0xe009('0x7d')]&&_0x4cb72c[_0xe009('0x7a')][_0x3efed0][_0xe009('0x7e')]){_0x5a3678[_0x4cb72c[_0xe009('0x7a')][_0x3efed0][_0xe009('0x2e')]](_0x4cb72c[_0xe009('0x7a')][_0x3efed0][_0xe009('0x7d')],null,util[_0xe009('0x76')]('%s.%s\x20=\x20%s.%s',_0x4cb72c['table'],_0x4cb72c[_0xe009('0x7a')][_0x3efed0]['parentKey'],_0x4cb72c['joins'][_0x3efed0][_0xe009('0x7d')],_0x4cb72c[_0xe009('0x7a')][_0x3efed0][_0xe009('0x7e')]));}}}if(_0x4cb72c[_0xe009('0x7f')]){_0x4cb72c[_0xe009('0x7f')]=JSON[_0xe009('0x7b')](_0x4cb72c['conditions']);_0x5a3678[_0xe009('0x39')](_0xc859bf(_0x4cb72c[_0xe009('0x7f')]['group']));}_0x486a8a=_0x5a3678['clone']();_0x5a3678[_0xe009('0x1d')](_0x2d1446);_0x5a3678[_0xe009('0x1b')](0x0);logger[_0xe009('0x80')](_0xe009('0x81'),_0x5a3678['toString']());return dbH[_0xe009('0x82')][_0xe009('0x30')](_0x5a3678[_0xe009('0x83')](),{'type':dbH['sequelize'][_0xe009('0x84')][_0xe009('0x85')]});}})[_0xe009('0x26')](respondWithResult(_0x44b93c,null))[_0xe009('0x45')](handleError(_0x44b93c,null));};function runReport(_0x3264d9,_0x47467c,_0x5cda68){var _0x87b397=_0x47467c[_0xe009('0x28')];var _0xa7777=0xa;var _0x31f028=[_0xe009('0x56'),_0xe009('0x57'),'right_join','cross_join'];var _0x5a5242={'SUM':_0xe009('0x5a'),'COUNT':_0xe009('0x5b'),'COUNT DISTINCT':_0xe009('0x5c'),'MAX':_0xe009('0x5d'),'MIN':_0xe009('0x86'),'AVG':_0xe009('0x5e'),'GROUP_CONCAT':_0xe009('0x5f'),'GROUP_CONCAT ASC':_0xe009('0x60'),'GROUP_CONCAT DESC':_0xe009('0x87')};var _0x430c14={'SEC_TO_TIME':_0xe009('0x61'),'DATE':_0xe009('0x62'),'HOUR':'HOUR(%s)','ROUND':_0xe009('0x88'),'UNIX_TIMESTAMP':_0xe009('0x89')};var _0x297144=function(_0x502224){return!_['includes']([_0xe009('0x64'),'IS\x20NOT\x20NULL',_0xe009('0x66'),_0xe009('0x8a')],_0x502224);};var _0x45a9c8=function(_0x1903ff){if(!_0x1903ff||!_0x1903ff[_0xe009('0x67')][_0xe009('0x48')]){return'';}for(var _0x276ff8='(',_0x2d833d=0x0;_0x2d833d<_0x1903ff['rules']['length'];_0x2d833d+=0x1){_0x2d833d>0x0&&(_0x276ff8+='\x20'+_0x1903ff['operator']+'\x20');_0x276ff8+=_0x1903ff['rules'][_0x2d833d][_0xe009('0x68')]?_0x45a9c8(_0x1903ff[_0xe009('0x67')][_0x2d833d][_0xe009('0x68')]):_0x1903ff[_0xe009('0x67')][_0x2d833d]['field']+'\x20'+_0x1903ff[_0xe009('0x67')][_0x2d833d][_0xe009('0x69')]+(_0x297144(_0x1903ff[_0xe009('0x67')][_0x2d833d]['condition'])?'\x20'+_0x1903ff[_0xe009('0x67')][_0x2d833d][_0xe009('0x6a')]:'');}return _0x276ff8+')';};var _0x1615ca={'where':{'id':_0x3264d9['id']}},_0x3cd004,_0x4905bf,_0x4a3db2,_0x10b2db,_0x4bc02b;_0x1615ca=_[_0xe009('0x3c')]({},_0x1615ca,_0x5cda68);return db['AnalyticCustomReport'][_0xe009('0x49')](_0x1615ca)[_0xe009('0x26')](function(_0x386046){if(_0x386046){_0x3cd004=_0x386046;return _0x386046[_0xe009('0x6b')]();}return null;})[_0xe009('0x26')](function(_0x3f7954){if(_0x3f7954){if(!_0x3f7954[_0xe009('0x48')]){throw new db[(_0xe009('0x6c'))][(_0xe009('0x6d'))](_0xe009('0x6e'),0x193);}_0x4905bf=_0x3f7954;return db[_0xe009('0x6f')][_0xe009('0x43')]({'raw':!![]});}return null;})[_0xe009('0x26')](function(_0x4b1c51){if(_0x4b1c51){_0x4a3db2=_[_0xe009('0x8b')](_0x4b1c51,'id');var _0xcf40e0;var _0x2e1534=squel['select']();_0x2e1534[_0xe009('0x8c')](_0x3cd004[_0xe009('0x70')]);for(var _0xcb65fa=0x0;_0xcb65fa<_0x4905bf['length'];_0xcb65fa+=0x1){_0xcf40e0=_0x4905bf[_0xcb65fa][_0xe009('0x71')]?_0x4a3db2[_0x4905bf[_0xcb65fa][_0xe009('0x71')]]['metric']:_0x4905bf[_0xcb65fa][_0xe009('0x73')];_0xcf40e0=_0x4905bf[_0xcb65fa][_0xe009('0x74')]?_[_0xe009('0x75')](_0x5a5242[_0x4905bf[_0xcb65fa]['function']],'%s',_0xcf40e0):_0xcf40e0;_0xcf40e0=_0x4905bf[_0xcb65fa][_0xe009('0x76')]?_[_0xe009('0x75')](_0x430c14[_0x4905bf[_0xcb65fa]['format']],'%s',_0xcf40e0):_0xcf40e0;if(_0x4905bf[_0xcb65fa][_0xe009('0x8d')]){_0x2e1534[_0xe009('0x68')](_0xcf40e0);}_0x4905bf[_0xcb65fa]['orderBy']&&_0x2e1534[_0xe009('0x37')](_0xcf40e0,_0x4905bf[_0xcb65fa][_0xe009('0x77')]===_0xe009('0x78')?![]:!![]);_0x2e1534[_0xe009('0x73')](_0xcf40e0,_0x4905bf[_0xcb65fa]['alias']||_0xcf40e0);}if(_0x3cd004['joins']){_0x3cd004['joins']=JSON[_0xe009('0x7b')](_0x3cd004['joins']);for(var _0x2495ed=0x0;_0x2495ed<_0x3cd004[_0xe009('0x7a')][_0xe009('0x48')];_0x2495ed+=0x1){if(_0x3cd004[_0xe009('0x7a')][_0x2495ed][_0xe009('0x2e')]&&_[_0xe009('0x63')](_0x31f028,_0x3cd004['joins'][_0x2495ed][_0xe009('0x2e')])&&_0x3cd004[_0xe009('0x7a')][_0x2495ed][_0xe009('0x7c')]&&_0x3cd004[_0xe009('0x7a')][_0x2495ed][_0xe009('0x7d')]&&_0x3cd004[_0xe009('0x7a')][_0x2495ed][_0xe009('0x7e')]){_0x2e1534[_0x3cd004[_0xe009('0x7a')][_0x2495ed][_0xe009('0x2e')]](_0x3cd004['joins'][_0x2495ed][_0xe009('0x7d')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3cd004[_0xe009('0x70')],_0x3cd004[_0xe009('0x7a')][_0x2495ed][_0xe009('0x7c')],_0x3cd004[_0xe009('0x7a')][_0x2495ed]['foreignTable'],_0x3cd004[_0xe009('0x7a')][_0x2495ed][_0xe009('0x7e')]));}}}if(_0x3cd004['conditions']){_0x3cd004['conditions']=JSON[_0xe009('0x7b')](_0x3cd004[_0xe009('0x7f')]);_0x2e1534[_0xe009('0x39')](_0x45a9c8(_0x3cd004[_0xe009('0x7f')][_0xe009('0x68')]));}_0x4bc02b=_0x2e1534[_0xe009('0x8e')]();_0x2e1534[_0xe009('0x1d')](_0xa7777);_0x2e1534['offset'](0x0);return;}})[_0xe009('0x26')](function(){if(_0x47467c[_0xe009('0x8f')]===_0xe009('0x90')){return null;}var _0x39c42e=_[_0xe009('0x3c')](_0x47467c,{'name':_0x47467c[_0xe009('0x91')]||_0x47467c[_0xe009('0x28')]||_0x3cd004['name'],'basename':_0x87b397,'savename':util[_0xe009('0x76')](_0xe009('0x92'),_0x47467c[_0xe009('0x28')]||_0x3cd004[_0xe009('0x28')],require(_0xe009('0x93'))[_0xe009('0x94')](0x4),_0x47467c[_0xe009('0x8f')]||_0xe009('0x95')),'reportId':_0x3cd004['id'],'reportType':'custom'});return db['AnalyticExtractedReport']['create'](_0x39c42e,{'raw':!![]});})[_0xe009('0x26')](function(_0x2ba59b){if(_0x3cd004[_0xe009('0x70')]===_0xe009('0x96')){_0x4bc02b[_0xe009('0x39')](_0x3cd004['table']+_0xe009('0x97'),_0x47467c[_0xe009('0x98')],_0x47467c[_0xe009('0x99')]);}else{_0x4bc02b[_0xe009('0x39')](_0x3cd004[_0xe009('0x70')]+_0xe009('0x9a'),_0x47467c[_0xe009('0x98')],_0x47467c[_0xe009('0x99')]);}if(_0x2ba59b){logger['info'](_0xe009('0x9b'),_0x4bc02b[_0xe009('0x83')]());require(_0xe009('0x9c'))['fork'](path[_0xe009('0x56')](__dirname,_0xe009('0x9d'),_0x2ba59b['output']),[_0x2ba59b['id'],_0x4bc02b[_0xe009('0x83')](),path[_0xe009('0x56')](__dirname,'../../files/reports',_0x2ba59b['savename']),_0x87b397]);return _0x2ba59b;}else{var _0x3a7357=squel[_0xe009('0x9e')]();_0x3a7357[_0xe009('0x8c')]('('+_0x4bc02b[_0xe009('0x83')]()+')',_0xe009('0x9f'));_0x3a7357[_0xe009('0x73')](_0xe009('0xa0'),_0xe009('0x40'));_0x4bc02b[_0xe009('0x1d')](_0x47467c[_0xe009('0x1d')]||_0xa7777);_0x4bc02b[_0xe009('0x1b')](_0x47467c['offset']||0x0);return dbH[_0xe009('0x82')][_0xe009('0x30')](_0x3a7357[_0xe009('0x83')](),{'type':dbH[_0xe009('0x82')][_0xe009('0x84')][_0xe009('0x85')]})['then'](function(_0x58963d){if(!_0x58963d[_0xe009('0x48')]){_0x10b2db=0x0;}else{_0x10b2db=_0x58963d[0x0][_0xe009('0x40')]||0x0;}return dbH['sequelize'][_0xe009('0x30')](_0x4bc02b['toString'](),{'type':dbH[_0xe009('0x82')][_0xe009('0x84')]['SELECT']});})[_0xe009('0x26')](function(_0x5461c9){return{'rows':_0x5461c9||[],'count':_0x10b2db};});}});}exports[_0xe009('0xa1')]=function(_0x4c9cac,_0x6c288a){return runReport(_0x4c9cac[_0xe009('0x54')],_0x4c9cac['query'],_0x4c9cac[_0xe009('0x3e')])[_0xe009('0x26')](respondWithResult(_0x6c288a,null))[_0xe009('0x45')](handleError(_0x6c288a,null));};exports['runReport']=runReport;exports['query']=function(_0x32f555,_0xe0613d){var _0x42270a=0xa;var _0x184891=['join',_0xe009('0x57'),_0xe009('0x58'),'cross_join'];var _0x1c3d3c={'SUM':_0xe009('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe009('0x5c'),'MAX':_0xe009('0x5d'),'MIN':_0xe009('0x86'),'AVG':_0xe009('0x5e'),'GROUP_CONCAT':_0xe009('0x5f'),'GROUP_CONCAT ASC':_0xe009('0x60'),'GROUP_CONCAT DESC':_0xe009('0x87')};var _0x46b91d={'SEC_TO_TIME':_0xe009('0x61'),'DATE':_0xe009('0x62'),'HOUR':_0xe009('0xa2'),'ROUND':_0xe009('0x88'),'UNIX_TIMESTAMP':_0xe009('0x89')};var _0x15d2d5=function(_0x2c8ed9){return!_[_0xe009('0x63')]([_0xe009('0x64'),'IS\x20NOT\x20NULL',_0xe009('0x66'),_0xe009('0x8a')],_0x2c8ed9);};var _0x5e90ba=function(_0x5076dc){if(!_0x5076dc||!_0x5076dc['rules'][_0xe009('0x48')]){return'';}for(var _0x3035a5='(',_0x106186=0x0;_0x106186<_0x5076dc[_0xe009('0x67')][_0xe009('0x48')];_0x106186+=0x1){_0x106186>0x0&&(_0x3035a5+='\x20'+_0x5076dc[_0xe009('0xa3')]+'\x20');_0x3035a5+=_0x5076dc[_0xe009('0x67')][_0x106186][_0xe009('0x68')]?_0x5e90ba(_0x5076dc['rules'][_0x106186][_0xe009('0x68')]):_0x5076dc['rules'][_0x106186][_0xe009('0x73')]+'\x20'+_0x5076dc[_0xe009('0x67')][_0x106186]['condition']+(_0x15d2d5(_0x5076dc[_0xe009('0x67')][_0x106186][_0xe009('0x69')])?'\x20'+_0x5076dc['rules'][_0x106186]['value']:'');}return _0x3035a5+')';};var _0x5d351c={'where':{'id':_0x32f555[_0xe009('0x54')]['id']}},_0x36cd39,_0x26cfca,_0x4e81d1,_0x46bcab,_0x1e9374;_0x5d351c=_[_0xe009('0x3c')]({},_0x5d351c,_0x32f555[_0xe009('0x3e')]);return db[_0xe009('0x3f')][_0xe009('0x49')](_0x5d351c)['then'](function(_0x410809){if(_0x410809){_0x36cd39=_0x410809;return _0x410809['getFields']();}return null;})[_0xe009('0x26')](function(_0x3c5e61){if(_0x3c5e61){if(!_0x3c5e61[_0xe009('0x48')]){throw new db[(_0xe009('0x6c'))][(_0xe009('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x26cfca=_0x3c5e61;return db[_0xe009('0x6f')][_0xe009('0x43')]({'raw':!![]});}return null;})['then'](function(_0x3ea34f){if(_0x3ea34f){_0x4e81d1=_[_0xe009('0x8b')](_0x3ea34f,'id');var _0x5dba23;var _0x2aebe4=squel[_0xe009('0x9e')]();_0x2aebe4[_0xe009('0x8c')](_0x36cd39['table']);for(var _0x1f5db5=0x0;_0x1f5db5<_0x26cfca[_0xe009('0x48')];_0x1f5db5+=0x1){_0x5dba23=_0x26cfca[_0x1f5db5][_0xe009('0x71')]?_0x4e81d1[_0x26cfca[_0x1f5db5][_0xe009('0x71')]][_0xe009('0x72')]:_0x26cfca[_0x1f5db5][_0xe009('0x73')];_0x5dba23=_0x26cfca[_0x1f5db5][_0xe009('0x74')]?_[_0xe009('0x75')](_0x1c3d3c[_0x26cfca[_0x1f5db5][_0xe009('0x74')]],'%s',_0x5dba23):_0x5dba23;_0x5dba23=_0x26cfca[_0x1f5db5][_0xe009('0x76')]?_['replace'](_0x46b91d[_0x26cfca[_0x1f5db5]['format']],'%s',_0x5dba23):_0x5dba23;if(_0x26cfca[_0x1f5db5][_0xe009('0x8d')]){_0x2aebe4[_0xe009('0x68')](_0x5dba23);}_0x26cfca[_0x1f5db5]['orderBy']&&_0x2aebe4[_0xe009('0x37')](_0x5dba23,_0x26cfca[_0x1f5db5][_0xe009('0x77')]===_0xe009('0x78')?![]:!![]);_0x2aebe4[_0xe009('0x73')](_0x5dba23,_0x26cfca[_0x1f5db5][_0xe009('0x79')]||_0x5dba23);}if(_0x36cd39[_0xe009('0x7a')]){_0x36cd39[_0xe009('0x7a')]=JSON['parse'](_0x36cd39['joins']);for(var _0x213211=0x0;_0x213211<_0x36cd39['joins'][_0xe009('0x48')];_0x213211+=0x1){if(_0x36cd39[_0xe009('0x7a')][_0x213211]['type']&&_[_0xe009('0x63')](_0x184891,_0x36cd39[_0xe009('0x7a')][_0x213211]['type'])&&_0x36cd39[_0xe009('0x7a')][_0x213211]['parentKey']&&_0x36cd39[_0xe009('0x7a')][_0x213211]['foreignTable']&&_0x36cd39[_0xe009('0x7a')][_0x213211][_0xe009('0x7e')]){_0x2aebe4[_0x36cd39[_0xe009('0x7a')][_0x213211]['type']](_0x36cd39[_0xe009('0x7a')][_0x213211][_0xe009('0x7d')],null,util['format'](_0xe009('0xa4'),_0x36cd39['table'],_0x36cd39['joins'][_0x213211][_0xe009('0x7c')],_0x36cd39[_0xe009('0x7a')][_0x213211][_0xe009('0x7d')],_0x36cd39[_0xe009('0x7a')][_0x213211][_0xe009('0x7e')]));}}}if(_0x36cd39[_0xe009('0x7f')]){_0x36cd39[_0xe009('0x7f')]=JSON[_0xe009('0x7b')](_0x36cd39[_0xe009('0x7f')]);_0x2aebe4['where'](_0x5e90ba(_0x36cd39[_0xe009('0x7f')][_0xe009('0x68')]));}_0x1e9374=_0x2aebe4[_0xe009('0x8e')]();_0x2aebe4[_0xe009('0x1d')](_0x42270a);_0x2aebe4['offset'](0x0);logger[_0xe009('0x80')]('Limited\x20Query:',_0x2aebe4[_0xe009('0x83')]());return dbH[_0xe009('0x82')][_0xe009('0x30')](_0x2aebe4['toString'](),{'type':dbH['sequelize'][_0xe009('0x84')][_0xe009('0x85')]});}})[_0xe009('0x26')](function(){return{'sql':_0x1e9374[_0xe009('0x83')]()};})[_0xe009('0x26')](respondWithResult(_0xe0613d,null))[_0xe009('0x45')](handleError(_0xe0613d,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 8aef81a..28c51f3 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 _0x3e70=['exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','moment','path','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3e70,0xbf));var _0x03e7=function(_0x12a026,_0x2a9a93){_0x12a026=_0x12a026-0x0;var _0x2d05c7=_0x3e70[_0x12a026];return _0x2d05c7;};'use strict';var _=require(_0x03e7('0x0'));var util=require(_0x03e7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x03e7('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x03e7('0x3'));var rimraf=require(_0x03e7('0x4'));var config=require(_0x03e7('0x5'));var attributes=require(_0x03e7('0x6'));module[_0x03e7('0x7')]=function(_0x12e445,_0x533881){return _0x12e445[_0x03e7('0x8')](_0x03e7('0x9'),attributes,{'tableName':_0x03e7('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbeab=['../../config/logger','api','bluebird','path','../../config/environment','exports','define','analytics_custom_reports','lodash','util'];(function(_0x23d521,_0x5aaab6){var _0x13ed95=function(_0x5d6874){while(--_0x5d6874){_0x23d521['push'](_0x23d521['shift']());}};_0x13ed95(++_0x5aaab6);}(_0xbeab,0x198));var _0xbbea=function(_0x3dad23,_0x2a41b5){_0x3dad23=_0x3dad23-0x0;var _0x24b0cb=_0xbeab[_0x3dad23];return _0x24b0cb;};'use strict';var _=require(_0xbbea('0x0'));var util=require(_0xbbea('0x1'));var logger=require(_0xbbea('0x2'))(_0xbbea('0x3'));var moment=require('moment');var BPromise=require(_0xbbea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbea('0x5'));var rimraf=require('rimraf');var config=require(_0xbbea('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0xbbea('0x7')]=function(_0x1d302b,_0x54c899){return _0x1d302b[_0xbbea('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0xbbea('0x9'),'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 b7cdb83..19f07aa 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 _0xb0de=['error','code','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0xb0de,0x156));var _0xeb0d=function(_0x32c8b0,_0x2dc4d2){_0x32c8b0=_0x32c8b0-0x0;var _0x341777=_0xb0de[_0x32c8b0];return _0x341777;};'use strict';var _=require(_0xeb0d('0x0'));var util=require(_0xeb0d('0x1'));var moment=require(_0xeb0d('0x2'));var BPromise=require(_0xeb0d('0x3'));var rs=require(_0xeb0d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb0d('0x5'))['db'];var utils=require(_0xeb0d('0x6'));var logger=require(_0xeb0d('0x7'))(_0xeb0d('0x8'));var config=require('../../config/environment');var jayson=require(_0xeb0d('0x9'));var client=jayson[_0xeb0d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46fbf4,_0xb96a23,_0x2c14cc){return new BPromise(function(_0x424f5d,_0x4eb913){return client[_0xeb0d('0xb')](_0x46fbf4,_0x2c14cc)[_0xeb0d('0xc')](function(_0x53c63e){logger[_0xeb0d('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0xb96a23,'request\x20sent');logger[_0xeb0d('0xe')](_0xeb0d('0xf'),_0xb96a23,_0xeb0d('0x10'),JSON[_0xeb0d('0x11')](_0x53c63e));if(_0x53c63e[_0xeb0d('0x12')]){if(_0x53c63e['error'][_0xeb0d('0x13')]===0x1f4){logger[_0xeb0d('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0xb96a23,_0x53c63e[_0xeb0d('0x12')][_0xeb0d('0x14')]);return _0x4eb913(_0x53c63e[_0xeb0d('0x12')][_0xeb0d('0x14')]);}logger[_0xeb0d('0x12')](_0xeb0d('0x15'),_0xb96a23,_0x53c63e[_0xeb0d('0x12')][_0xeb0d('0x14')]);return _0x424f5d(_0x53c63e[_0xeb0d('0x12')][_0xeb0d('0x14')]);}else{logger[_0xeb0d('0xd')](_0xeb0d('0x15'),_0xb96a23,_0xeb0d('0x10'));_0x424f5d(_0x53c63e[_0xeb0d('0x16')][_0xeb0d('0x14')]);}})[_0xeb0d('0x17')](function(_0x3af7ee){logger[_0xeb0d('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0xb96a23,_0x3af7ee);_0x4eb913(_0x3af7ee);});});} \ No newline at end of file +var _0x56db=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x36e0ef,_0x310e21){var _0x35d366=function(_0x461cbf){while(--_0x461cbf){_0x36e0ef['push'](_0x36e0ef['shift']());}};_0x35d366(++_0x310e21);}(_0x56db,0xed));var _0xb56d=function(_0x2d873a,_0x4656a0){_0x2d873a=_0x2d873a-0x0;var _0x4e45b9=_0x56db[_0x2d873a];return _0x4e45b9;};'use strict';var _=require(_0xb56d('0x0'));var util=require(_0xb56d('0x1'));var moment=require(_0xb56d('0x2'));var BPromise=require(_0xb56d('0x3'));var rs=require(_0xb56d('0x4'));var fs=require('fs');var Redis=require(_0xb56d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb56d('0x6'));var logger=require('../../config/logger')(_0xb56d('0x7'));var config=require(_0xb56d('0x8'));var jayson=require(_0xb56d('0x9'));var client=jayson['client'][_0xb56d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ebcca,_0x2b29e3,_0x1f665b){return new BPromise(function(_0x4fd914,_0x3a5491){return client['request'](_0x5ebcca,_0x1f665b)[_0xb56d('0xb')](function(_0x205623){logger['info'](_0xb56d('0xc'),_0x2b29e3,_0xb56d('0xd'));logger[_0xb56d('0xe')](_0xb56d('0xf'),_0x2b29e3,_0xb56d('0xd'),JSON[_0xb56d('0x10')](_0x205623));if(_0x205623[_0xb56d('0x11')]){if(_0x205623['error'][_0xb56d('0x12')]===0x1f4){logger[_0xb56d('0x11')](_0xb56d('0xc'),_0x2b29e3,_0x205623[_0xb56d('0x11')][_0xb56d('0x13')]);return _0x3a5491(_0x205623['error'][_0xb56d('0x13')]);}logger[_0xb56d('0x11')](_0xb56d('0xc'),_0x2b29e3,_0x205623[_0xb56d('0x11')][_0xb56d('0x13')]);return _0x4fd914(_0x205623[_0xb56d('0x11')][_0xb56d('0x13')]);}else{logger[_0xb56d('0x14')](_0xb56d('0xc'),_0x2b29e3,_0xb56d('0xd'));_0x4fd914(_0x205623[_0xb56d('0x15')][_0xb56d('0x13')]);}})[_0xb56d('0x16')](function(_0x477dd7){logger[_0xb56d('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2b29e3,_0x477dd7);_0x3a5491(_0x477dd7);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index b279cba..7406e45 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 _0x8af3=['query','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8af3,0x164));var _0x38af=function(_0x587bde,_0xa1fb2a){_0x587bde=_0x587bde-0x0;var _0x470d63=_0x8af3[_0x587bde];return _0x470d63;};'use strict';var multer=require(_0x38af('0x0'));var util=require(_0x38af('0x1'));var path=require(_0x38af('0x2'));var timeout=require(_0x38af('0x3'));var express=require(_0x38af('0x4'));var router=express[_0x38af('0x5')]();var fs_extra=require(_0x38af('0x6'));var auth=require(_0x38af('0x7'));var interaction=require(_0x38af('0x8'));var config=require(_0x38af('0x9'));var controller=require('./analyticCustomReport.controller');router[_0x38af('0xa')]('/',auth[_0x38af('0xb')](),controller[_0x38af('0xc')]);router[_0x38af('0xa')](_0x38af('0xd'),auth['isAuthenticated'](),controller[_0x38af('0xe')]);router['get'](_0x38af('0xf'),auth[_0x38af('0xb')](),controller[_0x38af('0x10')]);router[_0x38af('0xa')](_0x38af('0x11'),auth[_0x38af('0xb')](),controller[_0x38af('0x12')]);router[_0x38af('0xa')]('/:id/query',auth[_0x38af('0xb')](),controller[_0x38af('0x13')]);router[_0x38af('0x14')]('/',auth[_0x38af('0xb')](),controller[_0x38af('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x38af('0x16')]);router[_0x38af('0x17')](_0x38af('0xd'),auth[_0x38af('0xb')](),controller[_0x38af('0x18')]);module['exports']=router; \ No newline at end of file +var _0xa64e=['../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x26b1ff,_0x4dea7c){var _0x502074=function(_0x54731a){while(--_0x54731a){_0x26b1ff['push'](_0x26b1ff['shift']());}};_0x502074(++_0x4dea7c);}(_0xa64e,0x131));var _0xea64=function(_0x211b80,_0x5cb5fa){_0x211b80=_0x211b80-0x0;var _0x1c3037=_0xa64e[_0x211b80];return _0x1c3037;};'use strict';var multer=require('multer');var util=require(_0xea64('0x0'));var path=require(_0xea64('0x1'));var timeout=require(_0xea64('0x2'));var express=require(_0xea64('0x3'));var router=express[_0xea64('0x4')]();var fs_extra=require(_0xea64('0x5'));var auth=require(_0xea64('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xea64('0x7'));var controller=require(_0xea64('0x8'));router[_0xea64('0x9')]('/',auth[_0xea64('0xa')](),controller[_0xea64('0xb')]);router[_0xea64('0x9')](_0xea64('0xc'),auth[_0xea64('0xa')](),controller[_0xea64('0xd')]);router['get'](_0xea64('0xe'),auth['isAuthenticated'](),controller[_0xea64('0xf')]);router[_0xea64('0x9')](_0xea64('0x10'),auth[_0xea64('0xa')](),controller[_0xea64('0x11')]);router[_0xea64('0x9')](_0xea64('0x12'),auth['isAuthenticated'](),controller[_0xea64('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xea64('0x14')]);router[_0xea64('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xea64('0x16')]);router['delete'](_0xea64('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xea64('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 21f156e..e70bf2b 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 _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x1c3370,_0xf617e8){var _0xa9b358=function(_0x39cb44){while(--_0x39cb44){_0x1c3370['push'](_0x1c3370['shift']());}};_0xa9b358(++_0xf617e8);}(_0xdc97,0x13b));var _0x7dc9=function(_0x174994,_0x28abbb){_0x174994=_0x174994-0x0;var _0x3a6f82=_0xdc97[_0x174994];return _0x3a6f82;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}}; \ No newline at end of file +var _0x7217=['sequelize','STRING','TEXT'];(function(_0x505457,_0x183165){var _0x596444=function(_0x1f7238){while(--_0x1f7238){_0x505457['push'](_0x505457['shift']());}};_0x596444(++_0x183165);}(_0x7217,0x19e));var _0x7721=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x7217[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index cdfc337..f933401 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 _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','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','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x5d258e,_0x4141f5){var _0x5eac06=function(_0x199b51){while(--_0x199b51){_0x5d258e['push'](_0x5d258e['shift']());}};_0x5eac06(++_0x4141f5);}(_0x7a54,0x106));var _0x47a5=function(_0x5ad277,_0x25e754){_0x5ad277=_0x5ad277-0x0;var _0x31be96=_0x7a54[_0x5ad277];return _0x31be96;};'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'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));}; \ No newline at end of file +var _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0x7f537e,_0x2757d3){var _0x386a50=function(_0x535748){while(--_0x535748){_0x7f537e['push'](_0x7f537e['shift']());}};_0x386a50(++_0x2757d3);}(_0x2675,0x75));var _0x5267=function(_0xebaa92,_0x5bacb2){_0xebaa92=_0xebaa92-0x0;var _0x1f2153=_0x2675[_0xebaa92];return _0x1f2153;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index a29e1b0..2317794 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 _0x13ed=['AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','define'];(function(_0x30eddf,_0x4c3d10){var _0x951da2=function(_0x5b6658){while(--_0x5b6658){_0x30eddf['push'](_0x30eddf['shift']());}};_0x951da2(++_0x4c3d10);}(_0x13ed,0x1de));var _0xd13e=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0x13ed[_0x57486e];return _0x5f110b;};'use strict';var _=require(_0xd13e('0x0'));var util=require(_0xd13e('0x1'));var logger=require(_0xd13e('0x2'))(_0xd13e('0x3'));var moment=require(_0xd13e('0x4'));var BPromise=require(_0xd13e('0x5'));var rp=require(_0xd13e('0x6'));var fs=require('fs');var path=require(_0xd13e('0x7'));var rimraf=require('rimraf');var config=require(_0xd13e('0x8'));var attributes=require(_0xd13e('0x9'));module[_0xd13e('0xa')]=function(_0xfbf478,_0x28e269){return _0xfbf478[_0xd13e('0xb')](_0xd13e('0xc'),attributes,{'tableName':_0xd13e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeaf3=['./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x47e669,_0x14922f){var _0x148310=function(_0xa0718f){while(--_0xa0718f){_0x47e669['push'](_0x47e669['shift']());}};_0x148310(++_0x14922f);}(_0xeaf3,0x1e5));var _0x3eaf=function(_0xd59766,_0x8d1df1){_0xd59766=_0xd59766-0x0;var _0x5e850e=_0xeaf3[_0xd59766];return _0x5e850e;};'use strict';var _=require(_0x3eaf('0x0'));var util=require(_0x3eaf('0x1'));var logger=require(_0x3eaf('0x2'))(_0x3eaf('0x3'));var moment=require(_0x3eaf('0x4'));var BPromise=require('bluebird');var rp=require(_0x3eaf('0x5'));var fs=require('fs');var path=require(_0x3eaf('0x6'));var rimraf=require(_0x3eaf('0x7'));var config=require(_0x3eaf('0x8'));var attributes=require(_0x3eaf('0x9'));module[_0x3eaf('0xa')]=function(_0x282054,_0x3dc4dc){return _0x282054[_0x3eaf('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0x3eaf('0xc'),'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 8bf55f0..049cedb 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 _0x02a3=['result','catch','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x524b0a,_0x5e0d71){var _0x55758f=function(_0x4e9794){while(--_0x4e9794){_0x524b0a['push'](_0x524b0a['shift']());}};_0x55758f(++_0x5e0d71);}(_0x02a3,0x6e));var _0x302a=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x02a3[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0x302a('0x0'));var util=require(_0x302a('0x1'));var moment=require(_0x302a('0x2'));var BPromise=require('bluebird');var rs=require(_0x302a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x302a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x302a('0x5'));var config=require(_0x302a('0x6'));var jayson=require(_0x302a('0x7'));var client=jayson[_0x302a('0x8')][_0x302a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23d25f,_0x31b16c,_0x8548dd){return new BPromise(function(_0x1447eb,_0x295391){return client['request'](_0x23d25f,_0x8548dd)['then'](function(_0x1a5039){logger['info'](_0x302a('0xa'),_0x31b16c,_0x302a('0xb'));logger[_0x302a('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x31b16c,_0x302a('0xb'),JSON['stringify'](_0x1a5039));if(_0x1a5039[_0x302a('0xd')]){if(_0x1a5039[_0x302a('0xd')][_0x302a('0xe')]===0x1f4){logger[_0x302a('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x31b16c,_0x1a5039[_0x302a('0xd')][_0x302a('0xf')]);return _0x295391(_0x1a5039[_0x302a('0xd')][_0x302a('0xf')]);}logger[_0x302a('0xd')](_0x302a('0xa'),_0x31b16c,_0x1a5039[_0x302a('0xd')][_0x302a('0xf')]);return _0x1447eb(_0x1a5039['error'][_0x302a('0xf')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x31b16c,_0x302a('0xb'));_0x1447eb(_0x1a5039[_0x302a('0x10')][_0x302a('0xf')]);}})[_0x302a('0x11')](function(_0x5a324a){logger['error'](_0x302a('0xa'),_0x31b16c,_0x5a324a);_0x295391(_0x5a324a);});});} \ No newline at end of file +var _0x2afb=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3cb530,_0x170e8c){var _0x4168ea=function(_0x83990a){while(--_0x83990a){_0x3cb530['push'](_0x3cb530['shift']());}};_0x4168ea(++_0x170e8c);}(_0x2afb,0x6b));var _0xb2af=function(_0x4492af,_0x47e25d){_0x4492af=_0x4492af-0x0;var _0x216729=_0x2afb[_0x4492af];return _0x216729;};'use strict';var _=require(_0xb2af('0x0'));var util=require(_0xb2af('0x1'));var moment=require(_0xb2af('0x2'));var BPromise=require(_0xb2af('0x3'));var rs=require(_0xb2af('0x4'));var fs=require('fs');var Redis=require(_0xb2af('0x5'));var db=require(_0xb2af('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb2af('0x7'))(_0xb2af('0x8'));var config=require(_0xb2af('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb2af('0xa')][_0xb2af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5cc19f,_0x385f35,_0x556dda){return new BPromise(function(_0x127df0,_0x4e6b4b){return client[_0xb2af('0xc')](_0x5cc19f,_0x556dda)[_0xb2af('0xd')](function(_0xa6f42f){logger[_0xb2af('0xe')](_0xb2af('0xf'),_0x385f35,_0xb2af('0x10'));logger[_0xb2af('0x11')](_0xb2af('0x12'),_0x385f35,'request\x20sent',JSON[_0xb2af('0x13')](_0xa6f42f));if(_0xa6f42f[_0xb2af('0x14')]){if(_0xa6f42f[_0xb2af('0x14')][_0xb2af('0x15')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x385f35,_0xa6f42f[_0xb2af('0x14')][_0xb2af('0x16')]);return _0x4e6b4b(_0xa6f42f['error'][_0xb2af('0x16')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x385f35,_0xa6f42f['error'][_0xb2af('0x16')]);return _0x127df0(_0xa6f42f['error']['message']);}else{logger[_0xb2af('0xe')](_0xb2af('0xf'),_0x385f35,'request\x20sent');_0x127df0(_0xa6f42f[_0xb2af('0x17')]['message']);}})[_0xb2af('0x18')](function(_0x66577b){logger[_0xb2af('0x14')](_0xb2af('0xf'),_0x385f35,_0x66577b);_0x4e6b4b(_0x66577b);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 4776ca2..380897c 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 _0x44d7=['update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','/:id','/:id/preview','preview','run','query','post','create','put'];(function(_0xe00b31,_0xa975d2){var _0x3d21a5=function(_0x27f36b){while(--_0x27f36b){_0xe00b31['push'](_0xe00b31['shift']());}};_0x3d21a5(++_0xa975d2);}(_0x44d7,0x136));var _0x744d=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x44d7[_0x2b7764];return _0x848dcb;};'use strict';var multer=require(_0x744d('0x0'));var util=require(_0x744d('0x1'));var path=require(_0x744d('0x2'));var timeout=require(_0x744d('0x3'));var express=require(_0x744d('0x4'));var router=express[_0x744d('0x5')]();var fs_extra=require(_0x744d('0x6'));var auth=require(_0x744d('0x7'));var interaction=require(_0x744d('0x8'));var config=require('../../config/environment');var controller=require(_0x744d('0x9'));router[_0x744d('0xa')]('/',auth[_0x744d('0xb')](),controller['index']);router[_0x744d('0xa')](_0x744d('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x744d('0xd'),auth[_0x744d('0xb')](),controller[_0x744d('0xe')]);router[_0x744d('0xa')]('/:id/run',auth[_0x744d('0xb')](),controller[_0x744d('0xf')]);router[_0x744d('0xa')]('/:id/query',auth[_0x744d('0xb')](),controller[_0x744d('0x10')]);router[_0x744d('0x11')]('/',auth[_0x744d('0xb')](),controller[_0x744d('0x12')]);router[_0x744d('0x13')]('/:id',auth[_0x744d('0xb')](),controller[_0x744d('0x14')]);router[_0x744d('0x15')](_0x744d('0xc'),auth[_0x744d('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb334=['../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','/:id','show','get','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2ede49,_0x56bd37){var _0x699234=function(_0x27e2d9){while(--_0x27e2d9){_0x2ede49['push'](_0x2ede49['shift']());}};_0x699234(++_0x56bd37);}(_0xb334,0x101));var _0x4b33=function(_0x42c437,_0x4cf128){_0x42c437=_0x42c437-0x0;var _0x57640a=_0xb334[_0x42c437];return _0x57640a;};'use strict';var multer=require('multer');var util=require(_0x4b33('0x0'));var path=require(_0x4b33('0x1'));var timeout=require(_0x4b33('0x2'));var express=require(_0x4b33('0x3'));var router=express[_0x4b33('0x4')]();var fs_extra=require(_0x4b33('0x5'));var auth=require(_0x4b33('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4b33('0x7'));var controller=require(_0x4b33('0x8'));router['get']('/',auth[_0x4b33('0x9')](),controller[_0x4b33('0xa')]);router['get'](_0x4b33('0xb'),auth[_0x4b33('0x9')](),controller[_0x4b33('0xc')]);router[_0x4b33('0xd')](_0x4b33('0xe'),auth[_0x4b33('0x9')](),controller['preview']);router['get'](_0x4b33('0xf'),auth[_0x4b33('0x9')](),controller[_0x4b33('0x10')]);router[_0x4b33('0xd')](_0x4b33('0x11'),auth[_0x4b33('0x9')](),controller[_0x4b33('0x12')]);router[_0x4b33('0x13')]('/',auth[_0x4b33('0x9')](),controller[_0x4b33('0x14')]);router[_0x4b33('0x15')](_0x4b33('0xb'),auth[_0x4b33('0x9')](),controller[_0x4b33('0x16')]);router['delete']('/:id',auth[_0x4b33('0x9')](),controller['destroy']);module[_0x4b33('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 9f92199..d0154bb 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 _0x9eb6=['INTEGER','sequelize','moment','exports','STRING','csv','pdf','xlsx','DATE','Loading','ENUM','manual','scheduled'];(function(_0x2df62f,_0x108081){var _0x36c339=function(_0x1f3c30){while(--_0x1f3c30){_0x2df62f['push'](_0x2df62f['shift']());}};_0x36c339(++_0x108081);}(_0x9eb6,0xeb));var _0x69eb=function(_0x16b1a5,_0x318267){_0x16b1a5=_0x16b1a5-0x0;var _0x475e25=_0x9eb6[_0x16b1a5];return _0x475e25;};'use strict';var Sequelize=require(_0x69eb('0x0'));var moment=require(_0x69eb('0x1'));module[_0x69eb('0x2')]={'name':{'type':Sequelize[_0x69eb('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x69eb('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x69eb('0x4'),_0x69eb('0x5'),_0x69eb('0x6')),'allowNull':![],'defaultValue':_0x69eb('0x4')},'savename':{'type':Sequelize[_0x69eb('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x69eb('0x7')]},'endDate':{'type':Sequelize[_0x69eb('0x7')]},'status':{'type':Sequelize[_0x69eb('0x3')],'defaultValue':_0x69eb('0x8')},'type':{'type':Sequelize[_0x69eb('0x9')](_0x69eb('0xa'),_0x69eb('0xb')),'allowNull':![],'defaultValue':_0x69eb('0xa')},'reportId':{'type':Sequelize[_0x69eb('0xc')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x69eb('0x3')]}}; \ No newline at end of file +var _0x82bb=['exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment'];(function(_0x43fb15,_0x4b3f5b){var _0x42d47a=function(_0x27859b){while(--_0x27859b){_0x43fb15['push'](_0x43fb15['shift']());}};_0x42d47a(++_0x4b3f5b);}(_0x82bb,0x1ec));var _0xb82b=function(_0x588afd,_0x3e0d6e){_0x588afd=_0x588afd-0x0;var _0x2a4b57=_0x82bb[_0x588afd];return _0x2a4b57;};'use strict';var Sequelize=require(_0xb82b('0x0'));var moment=require(_0xb82b('0x1'));module[_0xb82b('0x2')]={'name':{'type':Sequelize[_0xb82b('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xb82b('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xb82b('0x4')](_0xb82b('0x5'),_0xb82b('0x6'),_0xb82b('0x7')),'allowNull':![],'defaultValue':_0xb82b('0x5')},'savename':{'type':Sequelize[_0xb82b('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xb82b('0x8')]},'endDate':{'type':Sequelize[_0xb82b('0x8')]},'status':{'type':Sequelize[_0xb82b('0x3')],'defaultValue':_0xb82b('0x9')},'type':{'type':Sequelize[_0xb82b('0x4')](_0xb82b('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0xb82b('0xa')},'reportId':{'type':Sequelize[_0xb82b('0xb')](0xb)[_0xb82b('0xc')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index ef3396c..76d7ce6 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 _0xd6bd=['output','existsSync','join','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','ExtractedReports','UserProfileResource','error','stack','name','send','index','AnalyticExtractedReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','include','findAll','rows','show','params','includeAll','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','basename','savename'];(function(_0x2d5df3,_0x114958){var _0xdc373=function(_0x40629e){while(--_0x40629e){_0x2d5df3['push'](_0x2d5df3['shift']());}};_0xdc373(++_0x114958);}(_0xd6bd,0x64));var _0xdd6b=function(_0x2122aa,_0x113985){_0x2122aa=_0x2122aa-0x0;var _0x1f1bc6=_0xd6bd[_0x2122aa];return _0x1f1bc6;};'use strict';var emlformat=require(_0xdd6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd6b('0x1'));var jsonpatch=require(_0xdd6b('0x2'));var rp=require(_0xdd6b('0x3'));var moment=require('moment');var BPromise=require(_0xdd6b('0x4'));var Mustache=require(_0xdd6b('0x5'));var util=require(_0xdd6b('0x6'));var path=require(_0xdd6b('0x7'));var sox=require(_0xdd6b('0x8'));var csv=require(_0xdd6b('0x9'));var ejs=require(_0xdd6b('0xa'));var fs=require('fs');var fs_extra=require(_0xdd6b('0xb'));var _=require('lodash');var squel=require(_0xdd6b('0xc'));var crypto=require('crypto');var jsforce=require(_0xdd6b('0xd'));var deskjs=require(_0xdd6b('0xe'));var toCsv=require(_0xdd6b('0x9'));var querystring=require('querystring');var Papa=require(_0xdd6b('0xf'));var Redis=require('ioredis');var authService=require(_0xdd6b('0x10'));var qs=require(_0xdd6b('0x11'));var as=require(_0xdd6b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd6b('0x13'))(_0xdd6b('0x14'));var utils=require(_0xdd6b('0x15'));var config=require(_0xdd6b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdd6b('0x17'))['db'];function respondWithStatusCode(_0x1335a1,_0x55885f){_0x55885f=_0x55885f||0xcc;return function(_0x3b8810){if(_0x3b8810){return _0x1335a1[_0xdd6b('0x18')](_0x55885f);}return _0x1335a1['status'](_0x55885f)[_0xdd6b('0x19')]();};}function respondWithResult(_0x5f5a26,_0x28b2a5){_0x28b2a5=_0x28b2a5||0xc8;return function(_0x3bc6cf){if(_0x3bc6cf){return _0x5f5a26[_0xdd6b('0x1a')](_0x28b2a5)[_0xdd6b('0x1b')](_0x3bc6cf);}};}function respondWithFilteredResult(_0x45353c,_0x471b66){return function(_0x160266){if(_0x160266){var _0x51c196=typeof _0x471b66[_0xdd6b('0x1c')]==='undefined'&&typeof _0x471b66[_0xdd6b('0x1d')]===_0xdd6b('0x1e');var _0x41cbb6=_0x160266[_0xdd6b('0x1f')];var _0x3abe3f=_0x51c196?0x0:_0x471b66[_0xdd6b('0x1c')];var _0x10c5fb=_0x51c196?_0x160266[_0xdd6b('0x1f')]:_0x471b66['offset']+_0x471b66[_0xdd6b('0x1d')];var _0x125766;if(_0x10c5fb>=_0x41cbb6){_0x10c5fb=_0x41cbb6;_0x125766=0xc8;}else{_0x125766=0xce;}_0x45353c[_0xdd6b('0x1a')](_0x125766);return _0x45353c[_0xdd6b('0x20')]('Content-Range',_0x3abe3f+'-'+_0x10c5fb+'/'+_0x41cbb6)['json'](_0x160266);}return null;};}function patchUpdates(_0xfa72dc){return function(_0x221fcf){try{jsonpatch[_0xdd6b('0x21')](_0x221fcf,_0xfa72dc,!![]);}catch(_0x4b0eef){return BPromise[_0xdd6b('0x22')](_0x4b0eef);}return _0x221fcf[_0xdd6b('0x23')]();};}function saveUpdates(_0x5638bf,_0x28bf5e){return function(_0x332b50){if(_0x332b50){return _0x332b50[_0xdd6b('0x24')](_0x5638bf)['then'](function(_0x1009d4){return _0x1009d4;});}return null;};}function removeEntity(_0x253a40,_0x40b115){return function(_0x152203){if(_0x152203){return _0x152203[_0xdd6b('0x25')]()[_0xdd6b('0x26')](function(){var _0x4a638c=_0x152203['get']({'plain':!![]});var _0x3b1c48=_0xdd6b('0x27');return db[_0xdd6b('0x28')][_0xdd6b('0x25')]({'where':{'type':_0x3b1c48,'resourceId':_0x4a638c['id']}})[_0xdd6b('0x26')](function(){return _0x152203;});})['then'](function(){_0x253a40[_0xdd6b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x155a1c,_0x7a232e){return function(_0x3a29c3){if(!_0x3a29c3){_0x155a1c[_0xdd6b('0x18')](0x194);}return _0x3a29c3;};}function handleError(_0x3fec19,_0x5516e4){_0x5516e4=_0x5516e4||0x1f4;return function(_0x54440c){logger[_0xdd6b('0x29')](_0x54440c[_0xdd6b('0x2a')]);if(_0x54440c[_0xdd6b('0x2b')]){delete _0x54440c[_0xdd6b('0x2b')];}_0x3fec19[_0xdd6b('0x1a')](_0x5516e4)[_0xdd6b('0x2c')](_0x54440c);};}exports[_0xdd6b('0x2d')]=function(_0x2ef2c9,_0x49220e){var _0x5f357a={},_0x142784={},_0x2e0f8e={'count':0x0,'rows':[]};var _0x3dab7e=_['map'](db[_0xdd6b('0x2e')]['rawAttributes'],function(_0x41cf9e){return{'name':_0x41cf9e[_0xdd6b('0x2f')],'type':_0x41cf9e[_0xdd6b('0x30')][_0xdd6b('0x31')]};});_0x142784[_0xdd6b('0x32')]=_[_0xdd6b('0x33')](_0x3dab7e,_0xdd6b('0x2b'));_0x142784[_0xdd6b('0x34')]=_[_0xdd6b('0x35')](_0x2ef2c9['query']);_0x142784[_0xdd6b('0x36')]=_[_0xdd6b('0x37')](_0x142784[_0xdd6b('0x32')],_0x142784[_0xdd6b('0x34')]);_0x5f357a[_0xdd6b('0x38')]=_['intersection'](_0x142784['model'],qs['fields'](_0x2ef2c9[_0xdd6b('0x34')][_0xdd6b('0x39')]));_0x5f357a['attributes']=_0x5f357a['attributes'][_0xdd6b('0x3a')]?_0x5f357a[_0xdd6b('0x38')]:_0x142784[_0xdd6b('0x32')];if(!_0x2ef2c9[_0xdd6b('0x34')][_0xdd6b('0x3b')](_0xdd6b('0x3c'))){_0x5f357a[_0xdd6b('0x1d')]=qs['limit'](_0x2ef2c9[_0xdd6b('0x34')][_0xdd6b('0x1d')]);_0x5f357a['offset']=qs['offset'](_0x2ef2c9[_0xdd6b('0x34')][_0xdd6b('0x1c')]);}_0x5f357a[_0xdd6b('0x3d')]=qs[_0xdd6b('0x3e')](_0x2ef2c9[_0xdd6b('0x34')][_0xdd6b('0x3e')]);_0x5f357a[_0xdd6b('0x3f')]=qs[_0xdd6b('0x36')](_[_0xdd6b('0x40')](_0x2ef2c9[_0xdd6b('0x34')],_0x142784[_0xdd6b('0x36')]),_0x3dab7e);if(_0x2ef2c9[_0xdd6b('0x34')]['filter']){_0x5f357a[_0xdd6b('0x3f')]=_[_0xdd6b('0x41')](_0x5f357a['where'],{'$or':_[_0xdd6b('0x33')](_0x3dab7e,function(_0x495d5e){if(_0x495d5e[_0xdd6b('0x30')]!=='VIRTUAL'){var _0x52cea0={};_0x52cea0[_0x495d5e[_0xdd6b('0x2b')]]={'$like':'%'+_0x2ef2c9['query']['filter']+'%'};return _0x52cea0;}})});}_0x5f357a=_[_0xdd6b('0x41')]({},_0x5f357a,_0x2ef2c9['options']);var _0x5b122b={'where':_0x5f357a[_0xdd6b('0x3f')]};return db[_0xdd6b('0x2e')][_0xdd6b('0x1f')](_0x5b122b)['then'](function(_0x5072af){_0x2e0f8e[_0xdd6b('0x1f')]=_0x5072af;if(_0x2ef2c9[_0xdd6b('0x34')]['includeAll']){_0x5f357a[_0xdd6b('0x42')]=[{'all':!![]}];}return db[_0xdd6b('0x2e')][_0xdd6b('0x43')](_0x5f357a);})['then'](function(_0x5c7daa){_0x2e0f8e[_0xdd6b('0x44')]=_0x5c7daa;return _0x2e0f8e;})[_0xdd6b('0x26')](respondWithFilteredResult(_0x49220e,_0x5f357a))['catch'](handleError(_0x49220e,null));};exports[_0xdd6b('0x45')]=function(_0x171037,_0x265a6b){var _0x437d3e={'raw':!![],'where':{'id':_0x171037[_0xdd6b('0x46')]['id']}},_0x45ccfa={};_0x45ccfa[_0xdd6b('0x32')]=_[_0xdd6b('0x35')](db[_0xdd6b('0x2e')]['rawAttributes']);_0x45ccfa['query']=_[_0xdd6b('0x35')](_0x171037[_0xdd6b('0x34')]);_0x45ccfa[_0xdd6b('0x36')]=_[_0xdd6b('0x37')](_0x45ccfa[_0xdd6b('0x32')],_0x45ccfa['query']);_0x437d3e['attributes']=_[_0xdd6b('0x37')](_0x45ccfa['model'],qs['fields'](_0x171037[_0xdd6b('0x34')]['fields']));_0x437d3e['attributes']=_0x437d3e[_0xdd6b('0x38')][_0xdd6b('0x3a')]?_0x437d3e[_0xdd6b('0x38')]:_0x45ccfa[_0xdd6b('0x32')];if(_0x171037[_0xdd6b('0x34')][_0xdd6b('0x47')]){_0x437d3e['include']=[{'all':!![]}];}_0x437d3e=_[_0xdd6b('0x41')]({},_0x437d3e,_0x171037[_0xdd6b('0x48')]);return db[_0xdd6b('0x2e')][_0xdd6b('0x49')](_0x437d3e)[_0xdd6b('0x26')](handleEntityNotFound(_0x265a6b,null))[_0xdd6b('0x26')](respondWithResult(_0x265a6b,null))['catch'](handleError(_0x265a6b,null));};exports[_0xdd6b('0x4a')]=function(_0x50b2af,_0x998143){return db[_0xdd6b('0x2e')]['create'](_0x50b2af['body'],{})[_0xdd6b('0x26')](function(_0x5d1f58){var _0x57ebe5=_0x50b2af[_0xdd6b('0x4b')][_0xdd6b('0x4c')]({'plain':!![]});if(!_0x57ebe5)throw new Error(_0xdd6b('0x4d'));if(_0x57ebe5['role']===_0xdd6b('0x4b')){var _0x116a35=_0x5d1f58['get']({'plain':!![]});var _0x2e0ea7=_0xdd6b('0x27');return db[_0xdd6b('0x4e')][_0xdd6b('0x49')]({'where':{'name':_0x2e0ea7,'userProfileId':_0x57ebe5[_0xdd6b('0x4f')]},'raw':!![]})[_0xdd6b('0x26')](function(_0x155e66){if(_0x155e66&&_0x155e66['autoAssociation']===0x0){return db[_0xdd6b('0x28')][_0xdd6b('0x4a')]({'name':_0x116a35[_0xdd6b('0x2b')],'resourceId':_0x116a35['id'],'type':_0x155e66['name'],'sectionId':_0x155e66['id']},{})[_0xdd6b('0x26')](function(){return _0x5d1f58;});}else{return _0x5d1f58;}})['catch'](function(_0x4c6548){logger[_0xdd6b('0x29')](_0xdd6b('0x50'),_0x4c6548);throw _0x4c6548;});}return _0x5d1f58;})[_0xdd6b('0x26')](respondWithResult(_0x998143,0xc9))['catch'](handleError(_0x998143,null));};exports[_0xdd6b('0x24')]=function(_0x185d65,_0x40d307){if(_0x185d65[_0xdd6b('0x51')]['id']){delete _0x185d65[_0xdd6b('0x51')]['id'];}return db[_0xdd6b('0x2e')][_0xdd6b('0x49')]({'where':{'id':_0x185d65[_0xdd6b('0x46')]['id']}})[_0xdd6b('0x26')](handleEntityNotFound(_0x40d307,null))['then'](saveUpdates(_0x185d65[_0xdd6b('0x51')],null))['then'](respondWithResult(_0x40d307,null))['catch'](handleError(_0x40d307,null));};exports['destroy']=function(_0x264aa1,_0x2f9c4b){return db[_0xdd6b('0x2e')][_0xdd6b('0x49')]({'where':{'id':_0x264aa1[_0xdd6b('0x46')]['id']}})[_0xdd6b('0x26')](handleEntityNotFound(_0x2f9c4b,null))[_0xdd6b('0x26')](removeEntity(_0x2f9c4b,null))['catch'](handleError(_0x2f9c4b,null));};exports['download']=function(_0xfad5d4,_0x3f6990,_0x5268f0){return db['AnalyticExtractedReport'][_0xdd6b('0x49')]({'where':{'id':_0xfad5d4[_0xdd6b('0x46')]['id']},'attributes':[_0xdd6b('0x2b'),_0xdd6b('0x52'),_0xdd6b('0x53'),_0xdd6b('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x3f6990,null))['then'](function(_0x54dd8c){if(_0x54dd8c){if(!fs[_0xdd6b('0x55')](path[_0xdd6b('0x56')](config['root'],'server/files/reports',_0x54dd8c[_0xdd6b('0x53')]))){throw new db['Sequelize'][(_0xdd6b('0x57'))](_0xdd6b('0x58'));}if(_0xfad5d4[_0xdd6b('0x34')][_0xdd6b('0x59')]){return _0x3f6990['sendStatus'](0xc8);}return _0x3f6990['download'](path[_0xdd6b('0x56')](config['root'],'server/files/reports',_0x54dd8c['savename']),util['format'](_0xdd6b('0x5a'),_0x54dd8c[_0xdd6b('0x52')]||_0x54dd8c[_0xdd6b('0x2b')],_0x54dd8c['output'][_0xdd6b('0x5b')]()));}})['catch'](handleError(_0x3f6990,null));}; \ No newline at end of file +var _0xb08f=['reject','save','update','then','destroy','get','UserProfileResource','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','offset','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','include','findAll','rows','catch','show','params','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','find','autoAssociation','body','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','rimraf','zip-dir','fast-json-patch','moment','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','set','apply'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0xb08f,0xa1));var _0xfb08=function(_0x534e94,_0x7c755e){_0x534e94=_0x534e94-0x0;var _0x4e1d5c=_0xb08f[_0x534e94];return _0x4e1d5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb08('0x0'));var zipdir=require(_0xfb08('0x1'));var jsonpatch=require(_0xfb08('0x2'));var rp=require('request-promise');var moment=require(_0xfb08('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfb08('0x4'));var path=require('path');var sox=require(_0xfb08('0x5'));var csv=require('to-csv');var ejs=require(_0xfb08('0x6'));var fs=require('fs');var fs_extra=require(_0xfb08('0x7'));var _=require(_0xfb08('0x8'));var squel=require(_0xfb08('0x9'));var crypto=require(_0xfb08('0xa'));var jsforce=require(_0xfb08('0xb'));var deskjs=require(_0xfb08('0xc'));var toCsv=require(_0xfb08('0xd'));var querystring=require('querystring');var Papa=require(_0xfb08('0xe'));var Redis=require(_0xfb08('0xf'));var authService=require(_0xfb08('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xfb08('0x11'));var hardwareService=require(_0xfb08('0x12'));var logger=require(_0xfb08('0x13'))(_0xfb08('0x14'));var utils=require(_0xfb08('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfb08('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24feb8,_0x20dd55){_0x20dd55=_0x20dd55||0xcc;return function(_0x3ce01f){if(_0x3ce01f){return _0x24feb8[_0xfb08('0x17')](_0x20dd55);}return _0x24feb8[_0xfb08('0x18')](_0x20dd55)[_0xfb08('0x19')]();};}function respondWithResult(_0x427991,_0x3f60aa){_0x3f60aa=_0x3f60aa||0xc8;return function(_0x1ea9d0){if(_0x1ea9d0){return _0x427991['status'](_0x3f60aa)[_0xfb08('0x1a')](_0x1ea9d0);}};}function respondWithFilteredResult(_0x2eeea5,_0x505597){return function(_0x1177ce){if(_0x1177ce){var _0x308be2=typeof _0x505597['offset']===_0xfb08('0x1b')&&typeof _0x505597[_0xfb08('0x1c')]==='undefined';var _0x2af683=_0x1177ce['count'];var _0xd8822e=_0x308be2?0x0:_0x505597['offset'];var _0x32c3d6=_0x308be2?_0x1177ce['count']:_0x505597['offset']+_0x505597['limit'];var _0x3df52e;if(_0x32c3d6>=_0x2af683){_0x32c3d6=_0x2af683;_0x3df52e=0xc8;}else{_0x3df52e=0xce;}_0x2eeea5[_0xfb08('0x18')](_0x3df52e);return _0x2eeea5[_0xfb08('0x1d')]('Content-Range',_0xd8822e+'-'+_0x32c3d6+'/'+_0x2af683)[_0xfb08('0x1a')](_0x1177ce);}return null;};}function patchUpdates(_0x2648c1){return function(_0x3cb358){try{jsonpatch[_0xfb08('0x1e')](_0x3cb358,_0x2648c1,!![]);}catch(_0x2f743d){return BPromise[_0xfb08('0x1f')](_0x2f743d);}return _0x3cb358[_0xfb08('0x20')]();};}function saveUpdates(_0x65f73d,_0x5ed8bc){return function(_0x21cef7){if(_0x21cef7){return _0x21cef7[_0xfb08('0x21')](_0x65f73d)[_0xfb08('0x22')](function(_0x419c03){return _0x419c03;});}return null;};}function removeEntity(_0xd61689,_0x3d8ba5){return function(_0x10ccab){if(_0x10ccab){return _0x10ccab[_0xfb08('0x23')]()['then'](function(){var _0x13db13=_0x10ccab[_0xfb08('0x24')]({'plain':!![]});var _0x48f398='ExtractedReports';return db[_0xfb08('0x25')][_0xfb08('0x23')]({'where':{'type':_0x48f398,'resourceId':_0x13db13['id']}})[_0xfb08('0x22')](function(){return _0x10ccab;});})['then'](function(){_0xd61689[_0xfb08('0x18')](0xcc)[_0xfb08('0x19')]();});}};}function handleEntityNotFound(_0xfa7eeb,_0x2c9424){return function(_0x3086af){if(!_0x3086af){_0xfa7eeb['sendStatus'](0x194);}return _0x3086af;};}function handleError(_0x3407d9,_0x54d6a4){_0x54d6a4=_0x54d6a4||0x1f4;return function(_0x156763){logger[_0xfb08('0x26')](_0x156763['stack']);if(_0x156763[_0xfb08('0x27')]){delete _0x156763[_0xfb08('0x27')];}_0x3407d9[_0xfb08('0x18')](_0x54d6a4)[_0xfb08('0x28')](_0x156763);};}exports[_0xfb08('0x29')]=function(_0x39647c,_0x4cf3e1){var _0x1d1983={},_0x2317b9={},_0x554b6f={'count':0x0,'rows':[]};var _0x4e868a=_[_0xfb08('0x2a')](db[_0xfb08('0x2b')][_0xfb08('0x2c')],function(_0x27ac12){return{'name':_0x27ac12[_0xfb08('0x2d')],'type':_0x27ac12[_0xfb08('0x2e')][_0xfb08('0x2f')]};});_0x2317b9['model']=_['map'](_0x4e868a,_0xfb08('0x27'));_0x2317b9[_0xfb08('0x30')]=_[_0xfb08('0x31')](_0x39647c[_0xfb08('0x30')]);_0x2317b9['filters']=_[_0xfb08('0x32')](_0x2317b9[_0xfb08('0x33')],_0x2317b9['query']);_0x1d1983[_0xfb08('0x34')]=_[_0xfb08('0x32')](_0x2317b9[_0xfb08('0x33')],qs[_0xfb08('0x35')](_0x39647c[_0xfb08('0x30')][_0xfb08('0x35')]));_0x1d1983[_0xfb08('0x34')]=_0x1d1983[_0xfb08('0x34')][_0xfb08('0x36')]?_0x1d1983[_0xfb08('0x34')]:_0x2317b9[_0xfb08('0x33')];if(!_0x39647c[_0xfb08('0x30')]['hasOwnProperty'](_0xfb08('0x37'))){_0x1d1983[_0xfb08('0x1c')]=qs[_0xfb08('0x1c')](_0x39647c[_0xfb08('0x30')]['limit']);_0x1d1983['offset']=qs[_0xfb08('0x38')](_0x39647c[_0xfb08('0x30')][_0xfb08('0x38')]);}_0x1d1983[_0xfb08('0x39')]=qs[_0xfb08('0x3a')](_0x39647c[_0xfb08('0x30')][_0xfb08('0x3a')]);_0x1d1983[_0xfb08('0x3b')]=qs[_0xfb08('0x3c')](_[_0xfb08('0x3d')](_0x39647c[_0xfb08('0x30')],_0x2317b9['filters']),_0x4e868a);if(_0x39647c[_0xfb08('0x30')][_0xfb08('0x3e')]){_0x1d1983[_0xfb08('0x3b')]=_['merge'](_0x1d1983[_0xfb08('0x3b')],{'$or':_[_0xfb08('0x2a')](_0x4e868a,function(_0x539d71){if(_0x539d71[_0xfb08('0x2e')]!==_0xfb08('0x3f')){var _0x2f85be={};_0x2f85be[_0x539d71['name']]={'$like':'%'+_0x39647c[_0xfb08('0x30')][_0xfb08('0x3e')]+'%'};return _0x2f85be;}})});}_0x1d1983=_[_0xfb08('0x40')]({},_0x1d1983,_0x39647c[_0xfb08('0x41')]);var _0x5dc08b={'where':_0x1d1983['where']};return db[_0xfb08('0x2b')][_0xfb08('0x42')](_0x5dc08b)[_0xfb08('0x22')](function(_0x92b1d7){_0x554b6f['count']=_0x92b1d7;if(_0x39647c[_0xfb08('0x30')]['includeAll']){_0x1d1983[_0xfb08('0x43')]=[{'all':!![]}];}return db[_0xfb08('0x2b')][_0xfb08('0x44')](_0x1d1983);})[_0xfb08('0x22')](function(_0x4a078d){_0x554b6f[_0xfb08('0x45')]=_0x4a078d;return _0x554b6f;})['then'](respondWithFilteredResult(_0x4cf3e1,_0x1d1983))[_0xfb08('0x46')](handleError(_0x4cf3e1,null));};exports[_0xfb08('0x47')]=function(_0x13965a,_0x148c25){var _0x3a3095={'raw':!![],'where':{'id':_0x13965a[_0xfb08('0x48')]['id']}},_0x2c69f8={};_0x2c69f8[_0xfb08('0x33')]=_[_0xfb08('0x31')](db[_0xfb08('0x2b')][_0xfb08('0x2c')]);_0x2c69f8[_0xfb08('0x30')]=_[_0xfb08('0x31')](_0x13965a['query']);_0x2c69f8[_0xfb08('0x3c')]=_[_0xfb08('0x32')](_0x2c69f8[_0xfb08('0x33')],_0x2c69f8[_0xfb08('0x30')]);_0x3a3095[_0xfb08('0x34')]=_[_0xfb08('0x32')](_0x2c69f8[_0xfb08('0x33')],qs[_0xfb08('0x35')](_0x13965a[_0xfb08('0x30')]['fields']));_0x3a3095[_0xfb08('0x34')]=_0x3a3095['attributes'][_0xfb08('0x36')]?_0x3a3095[_0xfb08('0x34')]:_0x2c69f8['model'];if(_0x13965a['query'][_0xfb08('0x49')]){_0x3a3095[_0xfb08('0x43')]=[{'all':!![]}];}_0x3a3095=_[_0xfb08('0x40')]({},_0x3a3095,_0x13965a[_0xfb08('0x41')]);return db['AnalyticExtractedReport']['find'](_0x3a3095)[_0xfb08('0x22')](handleEntityNotFound(_0x148c25,null))[_0xfb08('0x22')](respondWithResult(_0x148c25,null))['catch'](handleError(_0x148c25,null));};exports[_0xfb08('0x4a')]=function(_0x34157f,_0x3fd503){return db['AnalyticExtractedReport'][_0xfb08('0x4a')](_0x34157f['body'],{})[_0xfb08('0x22')](function(_0x3227a1){var _0x35253a=_0x34157f[_0xfb08('0x4b')][_0xfb08('0x24')]({'plain':!![]});if(!_0x35253a)throw new Error(_0xfb08('0x4c'));if(_0x35253a[_0xfb08('0x4d')]===_0xfb08('0x4b')){var _0x48ceaa=_0x3227a1['get']({'plain':!![]});var _0x955c0d=_0xfb08('0x4e');return db[_0xfb08('0x4f')][_0xfb08('0x50')]({'where':{'name':_0x955c0d,'userProfileId':_0x35253a['userProfileId']},'raw':!![]})[_0xfb08('0x22')](function(_0x42ba5d){if(_0x42ba5d&&_0x42ba5d[_0xfb08('0x51')]===0x0){return db[_0xfb08('0x25')][_0xfb08('0x4a')]({'name':_0x48ceaa['name'],'resourceId':_0x48ceaa['id'],'type':_0x42ba5d[_0xfb08('0x27')],'sectionId':_0x42ba5d['id']},{})[_0xfb08('0x22')](function(){return _0x3227a1;});}else{return _0x3227a1;}})[_0xfb08('0x46')](function(_0x179d62){logger[_0xfb08('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x179d62);throw _0x179d62;});}return _0x3227a1;})[_0xfb08('0x22')](respondWithResult(_0x3fd503,0xc9))[_0xfb08('0x46')](handleError(_0x3fd503,null));};exports[_0xfb08('0x21')]=function(_0x4d1c7e,_0x5e2fc0){if(_0x4d1c7e['body']['id']){delete _0x4d1c7e[_0xfb08('0x52')]['id'];}return db[_0xfb08('0x2b')]['find']({'where':{'id':_0x4d1c7e[_0xfb08('0x48')]['id']}})[_0xfb08('0x22')](handleEntityNotFound(_0x5e2fc0,null))[_0xfb08('0x22')](saveUpdates(_0x4d1c7e[_0xfb08('0x52')],null))[_0xfb08('0x22')](respondWithResult(_0x5e2fc0,null))['catch'](handleError(_0x5e2fc0,null));};exports[_0xfb08('0x23')]=function(_0x2eba31,_0x122337){return db[_0xfb08('0x2b')][_0xfb08('0x50')]({'where':{'id':_0x2eba31[_0xfb08('0x48')]['id']}})[_0xfb08('0x22')](handleEntityNotFound(_0x122337,null))[_0xfb08('0x22')](removeEntity(_0x122337,null))[_0xfb08('0x46')](handleError(_0x122337,null));};exports['download']=function(_0x3e2837,_0x18d2e1,_0x3d789d){return db[_0xfb08('0x2b')][_0xfb08('0x50')]({'where':{'id':_0x3e2837['params']['id']},'attributes':[_0xfb08('0x27'),_0xfb08('0x53'),_0xfb08('0x54'),_0xfb08('0x55')],'raw':!![]})[_0xfb08('0x22')](handleEntityNotFound(_0x18d2e1,null))[_0xfb08('0x22')](function(_0x4b6628){if(_0x4b6628){if(!fs[_0xfb08('0x56')](path[_0xfb08('0x57')](config[_0xfb08('0x58')],_0xfb08('0x59'),_0x4b6628[_0xfb08('0x54')]))){throw new db[(_0xfb08('0x5a'))]['ValidationError'](_0xfb08('0x5b'));}if(_0x3e2837[_0xfb08('0x30')][_0xfb08('0x5c')]){return _0x18d2e1['sendStatus'](0xc8);}return _0x18d2e1[_0xfb08('0x5d')](path['join'](config['root'],_0xfb08('0x59'),_0x4b6628['savename']),util[_0xfb08('0x5e')](_0xfb08('0x5f'),_0x4b6628[_0xfb08('0x53')]||_0x4b6628['name'],_0x4b6628[_0xfb08('0x55')]['toLowerCase']()));}})['catch'](handleError(_0x18d2e1,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index e0bbcf3..b6e0e7d 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 _0xa1ef=['./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3e3bec,_0x1cc68e){var _0x3dde3b=function(_0xf36f96){while(--_0xf36f96){_0x3e3bec['push'](_0x3e3bec['shift']());}};_0x3dde3b(++_0x1cc68e);}(_0xa1ef,0xac));var _0xfa1e=function(_0x51ce14,_0x5cd58b){_0x51ce14=_0x51ce14-0x0;var _0x301a2d=_0xa1ef[_0x51ce14];return _0x301a2d;};'use strict';var _=require(_0xfa1e('0x0'));var util=require(_0xfa1e('0x1'));var logger=require(_0xfa1e('0x2'))(_0xfa1e('0x3'));var moment=require(_0xfa1e('0x4'));var BPromise=require(_0xfa1e('0x5'));var rp=require(_0xfa1e('0x6'));var fs=require('fs');var path=require(_0xfa1e('0x7'));var rimraf=require(_0xfa1e('0x8'));var config=require(_0xfa1e('0x9'));var attributes=require(_0xfa1e('0xa'));module['exports']=function(_0x43ab3b,_0x476e14){return _0x43ab3b[_0xfa1e('0xb')](_0xfa1e('0xc'),attributes,{'tableName':_0xfa1e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcbbc=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','moment','request-promise'];(function(_0x2b9e6c,_0x39e705){var _0x4ed3da=function(_0x240c88){while(--_0x240c88){_0x2b9e6c['push'](_0x2b9e6c['shift']());}};_0x4ed3da(++_0x39e705);}(_0xcbbc,0xeb));var _0xccbb=function(_0x57db49,_0x288094){_0x57db49=_0x57db49-0x0;var _0xd0636f=_0xcbbc[_0x57db49];return _0xd0636f;};'use strict';var _=require('lodash');var util=require(_0xccbb('0x0'));var logger=require(_0xccbb('0x1'))(_0xccbb('0x2'));var moment=require(_0xccbb('0x3'));var BPromise=require('bluebird');var rp=require(_0xccbb('0x4'));var fs=require('fs');var path=require(_0xccbb('0x5'));var rimraf=require(_0xccbb('0x6'));var config=require(_0xccbb('0x7'));var attributes=require(_0xccbb('0x8'));module[_0xccbb('0x9')]=function(_0x23fcfe,_0x52dc6f){return _0x23fcfe['define'](_0xccbb('0xa'),attributes,{'tableName':_0xccbb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 0baad48..1c29572 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 _0x2de3=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x29fc75,_0x365045){var _0x424889=function(_0x4727ce){while(--_0x4727ce){_0x29fc75['push'](_0x29fc75['shift']());}};_0x424889(++_0x365045);}(_0x2de3,0x150));var _0x32de=function(_0x306435,_0x5954f6){_0x306435=_0x306435-0x0;var _0x286199=_0x2de3[_0x306435];return _0x286199;};'use strict';var _=require('lodash');var util=require(_0x32de('0x0'));var moment=require(_0x32de('0x1'));var BPromise=require(_0x32de('0x2'));var rs=require(_0x32de('0x3'));var fs=require('fs');var Redis=require(_0x32de('0x4'));var db=require(_0x32de('0x5'))['db'];var utils=require(_0x32de('0x6'));var logger=require('../../config/logger')(_0x32de('0x7'));var config=require(_0x32de('0x8'));var jayson=require(_0x32de('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x375fde,_0x3cb4ad,_0x5e4d89){return new BPromise(function(_0x5907f2,_0xd0a079){return client['request'](_0x375fde,_0x5e4d89)[_0x32de('0xa')](function(_0x4a7c14){logger[_0x32de('0xb')](_0x32de('0xc'),_0x3cb4ad,_0x32de('0xd'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x3cb4ad,_0x32de('0xd'),JSON[_0x32de('0xe')](_0x4a7c14));if(_0x4a7c14[_0x32de('0xf')]){if(_0x4a7c14[_0x32de('0xf')][_0x32de('0x10')]===0x1f4){logger['error'](_0x32de('0xc'),_0x3cb4ad,_0x4a7c14[_0x32de('0xf')][_0x32de('0x11')]);return _0xd0a079(_0x4a7c14[_0x32de('0xf')]['message']);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x3cb4ad,_0x4a7c14[_0x32de('0xf')][_0x32de('0x11')]);return _0x5907f2(_0x4a7c14[_0x32de('0xf')][_0x32de('0x11')]);}else{logger[_0x32de('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3cb4ad,_0x32de('0xd'));_0x5907f2(_0x4a7c14[_0x32de('0x12')]['message']);}})[_0x32de('0x13')](function(_0x70b72){logger[_0x32de('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3cb4ad,_0x70b72);_0xd0a079(_0x70b72);});});} \ No newline at end of file +var _0xfa88=['code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfa88,0x1a7));var _0x8fa8=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xfa88[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x8fa8('0x0'));var util=require(_0x8fa8('0x1'));var moment=require('moment');var BPromise=require(_0x8fa8('0x2'));var rs=require(_0x8fa8('0x3'));var fs=require('fs');var Redis=require(_0x8fa8('0x4'));var db=require(_0x8fa8('0x5'))['db'];var utils=require(_0x8fa8('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8fa8('0x7'));var client=jayson[_0x8fa8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c40d8,_0x5dcb2a,_0x5f54b4){return new BPromise(function(_0x3f08be,_0x31a69a){return client[_0x8fa8('0x9')](_0x5c40d8,_0x5f54b4)['then'](function(_0x5d29ef){logger[_0x8fa8('0xa')](_0x8fa8('0xb'),_0x5dcb2a,_0x8fa8('0xc'));logger[_0x8fa8('0xd')](_0x8fa8('0xe'),_0x5dcb2a,_0x8fa8('0xc'),JSON[_0x8fa8('0xf')](_0x5d29ef));if(_0x5d29ef[_0x8fa8('0x10')]){if(_0x5d29ef['error'][_0x8fa8('0x11')]===0x1f4){logger[_0x8fa8('0x10')](_0x8fa8('0xb'),_0x5dcb2a,_0x5d29ef[_0x8fa8('0x10')][_0x8fa8('0x12')]);return _0x31a69a(_0x5d29ef[_0x8fa8('0x10')][_0x8fa8('0x12')]);}logger[_0x8fa8('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5dcb2a,_0x5d29ef[_0x8fa8('0x10')][_0x8fa8('0x12')]);return _0x3f08be(_0x5d29ef['error']['message']);}else{logger[_0x8fa8('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5dcb2a,'request\x20sent');_0x3f08be(_0x5d29ef['result']['message']);}})[_0x8fa8('0x13')](function(_0x1c106f){logger[_0x8fa8('0x10')](_0x8fa8('0xb'),_0x5dcb2a,_0x1c106f);_0x31a69a(_0x1c106f);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index c1804fa..3a470d0 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 _0xd629=['get','isAuthenticated','index','show','/:id/download','download','post','create','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xd629,0x15c));var _0x9d62=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0xd629[_0xbb9dbf];return _0x30223c;};'use strict';var multer=require(_0x9d62('0x0'));var util=require(_0x9d62('0x1'));var path=require('path');var timeout=require(_0x9d62('0x2'));var express=require(_0x9d62('0x3'));var router=express[_0x9d62('0x4')]();var fs_extra=require(_0x9d62('0x5'));var auth=require(_0x9d62('0x6'));var interaction=require(_0x9d62('0x7'));var config=require('../../config/environment');var controller=require(_0x9d62('0x8'));router[_0x9d62('0x9')]('/',auth[_0x9d62('0xa')](),controller[_0x9d62('0xb')]);router[_0x9d62('0x9')]('/:id',auth[_0x9d62('0xa')](),controller[_0x9d62('0xc')]);router['get'](_0x9d62('0xd'),auth[_0x9d62('0xa')](),controller[_0x9d62('0xe')]);router[_0x9d62('0xf')]('/',auth[_0x9d62('0xa')](),controller[_0x9d62('0x10')]);router['put'](_0x9d62('0x11'),auth[_0x9d62('0xa')](),controller[_0x9d62('0x12')]);router['delete'](_0x9d62('0x11'),auth[_0x9d62('0xa')](),controller[_0x9d62('0x13')]);module[_0x9d62('0x14')]=router; \ No newline at end of file +var _0x452f=['express','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x22660a,_0x32955a){var _0x10785a=function(_0x126cf5){while(--_0x126cf5){_0x22660a['push'](_0x22660a['shift']());}};_0x10785a(++_0x32955a);}(_0x452f,0x138));var _0xf452=function(_0x1562a2,_0x2e4655){_0x1562a2=_0x1562a2-0x0;var _0x39a636=_0x452f[_0x1562a2];return _0x39a636;};'use strict';var multer=require(_0xf452('0x0'));var util=require('util');var path=require(_0xf452('0x1'));var timeout=require(_0xf452('0x2'));var express=require(_0xf452('0x3'));var router=express[_0xf452('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf452('0x5'));var config=require(_0xf452('0x6'));var controller=require(_0xf452('0x7'));router[_0xf452('0x8')]('/',auth[_0xf452('0x9')](),controller[_0xf452('0xa')]);router[_0xf452('0x8')](_0xf452('0xb'),auth['isAuthenticated'](),controller[_0xf452('0xc')]);router['get'](_0xf452('0xd'),auth[_0xf452('0x9')](),controller[_0xf452('0xe')]);router['post']('/',auth[_0xf452('0x9')](),controller[_0xf452('0xf')]);router[_0xf452('0x10')](_0xf452('0xb'),auth[_0xf452('0x9')](),controller[_0xf452('0x11')]);router[_0xf452('0x12')](_0xf452('0xb'),auth['isAuthenticated'](),controller[_0xf452('0x13')]);module[_0xf452('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 9654d18..5806bd9 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 _0xbdd5=['sequelize','STRING'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xbdd5,0x19e));var _0x5bdd=function(_0x5044b7,_0x3675ba){_0x5044b7=_0x5044b7-0x0;var _0x5330ab=_0xbdd5[_0x5044b7];return _0x5330ab;};'use strict';var Sequelize=require(_0x5bdd('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x5bdd('0x1')]},'format':{'type':Sequelize[_0x5bdd('0x1')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x5bdd('0x1')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7f14=['STRING','BOOLEAN','exports','TEXT'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0x7f14,0x1ba));var _0x47f1=function(_0x273c4e,_0x42074a){_0x273c4e=_0x273c4e-0x0;var _0x13feda=_0x7f14[_0x273c4e];return _0x13feda;};'use strict';var Sequelize=require('sequelize');module[_0x47f1('0x0')]={'field':{'type':Sequelize[_0x47f1('0x1')]},'alias':{'type':Sequelize[_0x47f1('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x47f1('0x2')]},'groupBy':{'type':Sequelize[_0x47f1('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 0f1c5b2..1bedae4 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 _0x2ecd=['fields','length','hasOwnProperty','order','sort','pick','filter','where','type','VIRTUAL','name','merge','options','include','findAll','rows','params','keys','includeAll','catch','create','body','bulkCreate','bulkDestroy','destroy','ids','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','end','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','model','query','filters','intersection','attributes'];(function(_0x1f5cb5,_0x2329dc){var _0x13d4e2=function(_0x4840c5){while(--_0x4840c5){_0x1f5cb5['push'](_0x1f5cb5['shift']());}};_0x13d4e2(++_0x2329dc);}(_0x2ecd,0x16a));var _0xd2ec=function(_0xc18927,_0x3807b6){_0xc18927=_0xc18927-0x0;var _0xc91043=_0x2ecd[_0xc18927];return _0xc91043;};'use strict';var emlformat=require(_0xd2ec('0x0'));var rimraf=require(_0xd2ec('0x1'));var zipdir=require(_0xd2ec('0x2'));var jsonpatch=require(_0xd2ec('0x3'));var rp=require('request-promise');var moment=require(_0xd2ec('0x4'));var BPromise=require(_0xd2ec('0x5'));var Mustache=require(_0xd2ec('0x6'));var util=require(_0xd2ec('0x7'));var path=require('path');var sox=require(_0xd2ec('0x8'));var csv=require(_0xd2ec('0x9'));var ejs=require(_0xd2ec('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd2ec('0xb'));var squel=require(_0xd2ec('0xc'));var crypto=require(_0xd2ec('0xd'));var jsforce=require(_0xd2ec('0xe'));var deskjs=require(_0xd2ec('0xf'));var toCsv=require(_0xd2ec('0x9'));var querystring=require(_0xd2ec('0x10'));var Papa=require(_0xd2ec('0x11'));var Redis=require(_0xd2ec('0x12'));var authService=require(_0xd2ec('0x13'));var qs=require(_0xd2ec('0x14'));var as=require(_0xd2ec('0x15'));var hardwareService=require(_0xd2ec('0x16'));var logger=require(_0xd2ec('0x17'))('api');var utils=require(_0xd2ec('0x18'));var config=require(_0xd2ec('0x19'));var licenseUtil=require(_0xd2ec('0x1a'));var db=require(_0xd2ec('0x1b'))['db'];function respondWithStatusCode(_0x143ed1,_0xc136d0){_0xc136d0=_0xc136d0||0xcc;return function(_0x544916){if(_0x544916){return _0x143ed1[_0xd2ec('0x1c')](_0xc136d0);}return _0x143ed1[_0xd2ec('0x1d')](_0xc136d0)['end']();};}function respondWithResult(_0xf7236c,_0x27fc9c){_0x27fc9c=_0x27fc9c||0xc8;return function(_0x132441){if(_0x132441){return _0xf7236c[_0xd2ec('0x1d')](_0x27fc9c)[_0xd2ec('0x1e')](_0x132441);}};}function respondWithFilteredResult(_0x15315c,_0x75415){return function(_0x700abc){if(_0x700abc){var _0x9c3750=typeof _0x75415[_0xd2ec('0x1f')]==='undefined'&&typeof _0x75415[_0xd2ec('0x20')]==='undefined';var _0x3ebba1=_0x700abc[_0xd2ec('0x21')];var _0xc05d61=_0x9c3750?0x0:_0x75415[_0xd2ec('0x1f')];var _0x50a6f8=_0x9c3750?_0x700abc[_0xd2ec('0x21')]:_0x75415[_0xd2ec('0x1f')]+_0x75415['limit'];var _0xf64fa9;if(_0x50a6f8>=_0x3ebba1){_0x50a6f8=_0x3ebba1;_0xf64fa9=0xc8;}else{_0xf64fa9=0xce;}_0x15315c[_0xd2ec('0x1d')](_0xf64fa9);return _0x15315c[_0xd2ec('0x22')](_0xd2ec('0x23'),_0xc05d61+'-'+_0x50a6f8+'/'+_0x3ebba1)[_0xd2ec('0x1e')](_0x700abc);}return null;};}function patchUpdates(_0xf5450b){return function(_0x401d5b){try{jsonpatch[_0xd2ec('0x24')](_0x401d5b,_0xf5450b,!![]);}catch(_0x224e9a){return BPromise[_0xd2ec('0x25')](_0x224e9a);}return _0x401d5b[_0xd2ec('0x26')]();};}function saveUpdates(_0x5bab03,_0x167080){return function(_0x5d9962){if(_0x5d9962){return _0x5d9962[_0xd2ec('0x27')](_0x5bab03)[_0xd2ec('0x28')](function(_0x3aa2ab){return _0x3aa2ab;});}return null;};}function removeEntity(_0x6809fa,_0x262f05){return function(_0x30c340){if(_0x30c340){return _0x30c340['destroy']()[_0xd2ec('0x28')](function(){_0x6809fa[_0xd2ec('0x1d')](0xcc)[_0xd2ec('0x29')]();});}};}function handleEntityNotFound(_0x534d63,_0x32a81e){return function(_0x598652){if(!_0x598652){_0x534d63[_0xd2ec('0x1c')](0x194);}return _0x598652;};}function handleError(_0x200f29,_0x2db80c){_0x2db80c=_0x2db80c||0x1f4;return function(_0x58f3cc){logger['error'](_0x58f3cc['stack']);if(_0x58f3cc['name']){delete _0x58f3cc['name'];}_0x200f29['status'](_0x2db80c)[_0xd2ec('0x2a')](_0x58f3cc);};}exports[_0xd2ec('0x2b')]=function(_0x422131,_0x2e04db){var _0x394a68={},_0x152730={},_0x28ad6e={'count':0x0,'rows':[]};var _0x51f578=_[_0xd2ec('0x2c')](db[_0xd2ec('0x2d')][_0xd2ec('0x2e')],function(_0x3ca8e6){return{'name':_0x3ca8e6[_0xd2ec('0x2f')],'type':_0x3ca8e6['type']['key']};});_0x152730[_0xd2ec('0x30')]=_[_0xd2ec('0x2c')](_0x51f578,'name');_0x152730[_0xd2ec('0x31')]=_['keys'](_0x422131[_0xd2ec('0x31')]);_0x152730[_0xd2ec('0x32')]=_[_0xd2ec('0x33')](_0x152730['model'],_0x152730[_0xd2ec('0x31')]);_0x394a68[_0xd2ec('0x34')]=_[_0xd2ec('0x33')](_0x152730['model'],qs[_0xd2ec('0x35')](_0x422131[_0xd2ec('0x31')]['fields']));_0x394a68[_0xd2ec('0x34')]=_0x394a68[_0xd2ec('0x34')][_0xd2ec('0x36')]?_0x394a68[_0xd2ec('0x34')]:_0x152730[_0xd2ec('0x30')];if(!_0x422131['query'][_0xd2ec('0x37')]('nolimit')){_0x394a68['limit']=qs['limit'](_0x422131[_0xd2ec('0x31')][_0xd2ec('0x20')]);_0x394a68[_0xd2ec('0x1f')]=qs[_0xd2ec('0x1f')](_0x422131[_0xd2ec('0x31')][_0xd2ec('0x1f')]);}_0x394a68[_0xd2ec('0x38')]=qs[_0xd2ec('0x39')](_0x422131[_0xd2ec('0x31')][_0xd2ec('0x39')]);_0x394a68['where']=qs['filters'](_[_0xd2ec('0x3a')](_0x422131['query'],_0x152730['filters']),_0x51f578);if(_0x422131[_0xd2ec('0x31')][_0xd2ec('0x3b')]){_0x394a68[_0xd2ec('0x3c')]=_['merge'](_0x394a68['where'],{'$or':_['map'](_0x51f578,function(_0x5d26e1){if(_0x5d26e1[_0xd2ec('0x3d')]!==_0xd2ec('0x3e')){var _0x57e98f={};_0x57e98f[_0x5d26e1[_0xd2ec('0x3f')]]={'$like':'%'+_0x422131[_0xd2ec('0x31')]['filter']+'%'};return _0x57e98f;}})});}_0x394a68=_[_0xd2ec('0x40')]({},_0x394a68,_0x422131[_0xd2ec('0x41')]);var _0x2fae44={'where':_0x394a68['where']};return db[_0xd2ec('0x2d')][_0xd2ec('0x21')](_0x2fae44)[_0xd2ec('0x28')](function(_0xb65294){_0x28ad6e[_0xd2ec('0x21')]=_0xb65294;if(_0x422131[_0xd2ec('0x31')]['includeAll']){_0x394a68[_0xd2ec('0x42')]=[{'all':!![]}];}return db[_0xd2ec('0x2d')][_0xd2ec('0x43')](_0x394a68);})[_0xd2ec('0x28')](function(_0x39dff7){_0x28ad6e[_0xd2ec('0x44')]=_0x39dff7;return _0x28ad6e;})['then'](respondWithFilteredResult(_0x2e04db,_0x394a68))['catch'](handleError(_0x2e04db,null));};exports['show']=function(_0x1b8e09,_0x7f3f22){var _0x2c4c63={'raw':![],'where':{'id':_0x1b8e09[_0xd2ec('0x45')]['id']}},_0x4bb770={};_0x4bb770[_0xd2ec('0x30')]=_[_0xd2ec('0x46')](db['AnalyticFieldReport'][_0xd2ec('0x2e')]);_0x4bb770[_0xd2ec('0x31')]=_['keys'](_0x1b8e09[_0xd2ec('0x31')]);_0x4bb770[_0xd2ec('0x32')]=_[_0xd2ec('0x33')](_0x4bb770[_0xd2ec('0x30')],_0x4bb770['query']);_0x2c4c63[_0xd2ec('0x34')]=_[_0xd2ec('0x33')](_0x4bb770['model'],qs[_0xd2ec('0x35')](_0x1b8e09[_0xd2ec('0x31')][_0xd2ec('0x35')]));_0x2c4c63['attributes']=_0x2c4c63['attributes'][_0xd2ec('0x36')]?_0x2c4c63['attributes']:_0x4bb770[_0xd2ec('0x30')];if(_0x1b8e09[_0xd2ec('0x31')][_0xd2ec('0x47')]){_0x2c4c63[_0xd2ec('0x42')]=[{'all':!![]}];}_0x2c4c63=_[_0xd2ec('0x40')]({},_0x2c4c63,_0x1b8e09[_0xd2ec('0x41')]);return db[_0xd2ec('0x2d')]['find'](_0x2c4c63)[_0xd2ec('0x28')](handleEntityNotFound(_0x7f3f22,null))['then'](respondWithResult(_0x7f3f22,null))[_0xd2ec('0x48')](handleError(_0x7f3f22,null));};exports[_0xd2ec('0x49')]=function(_0x790e8a,_0x3e9326){return db[_0xd2ec('0x2d')]['create'](_0x790e8a[_0xd2ec('0x4a')],{})[_0xd2ec('0x28')](respondWithResult(_0x3e9326,0xc9))[_0xd2ec('0x48')](handleError(_0x3e9326,null));};exports['bulkCreate']=function(_0x85190c,_0x3074dc){return db[_0xd2ec('0x2d')][_0xd2ec('0x4b')](_0x85190c['body'],{'raw':![],'individualHooks':!![]})[_0xd2ec('0x28')](respondWithResult(_0x3074dc,0xc9))[_0xd2ec('0x48')](handleError(_0x3074dc,null));};exports['update']=function(_0x307b5e,_0x1f6db2){if(_0x307b5e[_0xd2ec('0x4a')]['id']){delete _0x307b5e[_0xd2ec('0x4a')]['id'];}return db[_0xd2ec('0x2d')]['find']({'where':{'id':_0x307b5e[_0xd2ec('0x45')]['id']}})[_0xd2ec('0x28')](handleEntityNotFound(_0x1f6db2,null))[_0xd2ec('0x28')](saveUpdates(_0x307b5e[_0xd2ec('0x4a')],null))[_0xd2ec('0x28')](respondWithResult(_0x1f6db2,null))[_0xd2ec('0x48')](handleError(_0x1f6db2,null));};exports['destroy']=function(_0x54c689,_0xf10196){return db[_0xd2ec('0x2d')]['find']({'where':{'id':_0x54c689[_0xd2ec('0x45')]['id']}})[_0xd2ec('0x28')](handleEntityNotFound(_0xf10196,null))[_0xd2ec('0x28')](removeEntity(_0xf10196,null))['catch'](handleError(_0xf10196,null));};exports[_0xd2ec('0x4c')]=function(_0x2c5450,_0x409a02){return db[_0xd2ec('0x2d')][_0xd2ec('0x4d')]({'where':{'id':_0x2c5450[_0xd2ec('0x31')][_0xd2ec('0x4e')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x409a02,0xcc))[_0xd2ec('0x48')](handleError(_0x409a02,null));};exports['addFields']=function(_0x49c0d8,_0x11a266,_0x29bd24){return db[_0xd2ec('0x4f')]['findOne']({'where':{'id':_0x49c0d8[_0xd2ec('0x45')]['id']}})[_0xd2ec('0x28')](handleEntityNotFound(_0x11a266,null))['then'](function(_0x2063ca){if(_0x2063ca){return db[_0xd2ec('0x50')][_0xd2ec('0x51')](function(_0x31eb56){return db[_0xd2ec('0x2d')][_0xd2ec('0x4d')]({'where':{'CustomReportId':_0x49c0d8[_0xd2ec('0x45')]['id']},'transaction':_0x31eb56})[_0xd2ec('0x28')](function(_0x4508dd){var _0x27f5a6=_[_0xd2ec('0x2c')](_0x49c0d8['body'],function(_0x5d2a37){delete _0x5d2a37['id'];_0x5d2a37[_0xd2ec('0x52')]=_0x49c0d8[_0xd2ec('0x45')]['id'];return _0x5d2a37;});return db[_0xd2ec('0x2d')][_0xd2ec('0x4b')](_0x27f5a6,{'transaction':_0x31eb56});});})['then'](function(){return db[_0xd2ec('0x2d')][_0xd2ec('0x43')]({'where':{'CustomReportId':_0x49c0d8[_0xd2ec('0x45')]['id']}});});}})[_0xd2ec('0x28')](respondWithResult(_0x11a266,null))[_0xd2ec('0x48')](handleError(_0x11a266,null));}; \ No newline at end of file +var _0x0b99=['index','map','AnalyticFieldReport','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','options','include','findAll','params','includeAll','find','catch','create','body','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','bulkCreate','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','error','name','send'];(function(_0x243bba,_0x1ea69f){var _0x12e696=function(_0x5d3ab5){while(--_0x5d3ab5){_0x243bba['push'](_0x243bba['shift']());}};_0x12e696(++_0x1ea69f);}(_0x0b99,0x1bc));var _0x90b9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0b99[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x90b9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x90b9('0x1'));var BPromise=require(_0x90b9('0x2'));var Mustache=require(_0x90b9('0x3'));var util=require(_0x90b9('0x4'));var path=require(_0x90b9('0x5'));var sox=require(_0x90b9('0x6'));var csv=require(_0x90b9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x90b9('0x8'));var _=require(_0x90b9('0x9'));var squel=require(_0x90b9('0xa'));var crypto=require('crypto');var jsforce=require(_0x90b9('0xb'));var deskjs=require(_0x90b9('0xc'));var toCsv=require(_0x90b9('0x7'));var querystring=require(_0x90b9('0xd'));var Papa=require('papaparse');var Redis=require(_0x90b9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x90b9('0xf'));var as=require(_0x90b9('0x10'));var hardwareService=require(_0x90b9('0x11'));var logger=require(_0x90b9('0x12'))(_0x90b9('0x13'));var utils=require(_0x90b9('0x14'));var config=require(_0x90b9('0x15'));var licenseUtil=require(_0x90b9('0x16'));var db=require(_0x90b9('0x17'))['db'];function respondWithStatusCode(_0x55d111,_0x235580){_0x235580=_0x235580||0xcc;return function(_0x7521b){if(_0x7521b){return _0x55d111[_0x90b9('0x18')](_0x235580);}return _0x55d111['status'](_0x235580)[_0x90b9('0x19')]();};}function respondWithResult(_0x11f325,_0x1b254b){_0x1b254b=_0x1b254b||0xc8;return function(_0x2f31f6){if(_0x2f31f6){return _0x11f325['status'](_0x1b254b)[_0x90b9('0x1a')](_0x2f31f6);}};}function respondWithFilteredResult(_0x42c3b1,_0x4fcc49){return function(_0x417049){if(_0x417049){var _0x23a32a=typeof _0x4fcc49[_0x90b9('0x1b')]===_0x90b9('0x1c')&&typeof _0x4fcc49[_0x90b9('0x1d')]==='undefined';var _0x1bce2a=_0x417049[_0x90b9('0x1e')];var _0x5d921a=_0x23a32a?0x0:_0x4fcc49[_0x90b9('0x1b')];var _0x3a5e3d=_0x23a32a?_0x417049['count']:_0x4fcc49['offset']+_0x4fcc49['limit'];var _0x570ff4;if(_0x3a5e3d>=_0x1bce2a){_0x3a5e3d=_0x1bce2a;_0x570ff4=0xc8;}else{_0x570ff4=0xce;}_0x42c3b1[_0x90b9('0x1f')](_0x570ff4);return _0x42c3b1[_0x90b9('0x20')](_0x90b9('0x21'),_0x5d921a+'-'+_0x3a5e3d+'/'+_0x1bce2a)['json'](_0x417049);}return null;};}function patchUpdates(_0x4628da){return function(_0x2c1ad8){try{jsonpatch[_0x90b9('0x22')](_0x2c1ad8,_0x4628da,!![]);}catch(_0x3ac16a){return BPromise[_0x90b9('0x23')](_0x3ac16a);}return _0x2c1ad8[_0x90b9('0x24')]();};}function saveUpdates(_0x35b43b,_0x5dae0b){return function(_0x3ec4fa){if(_0x3ec4fa){return _0x3ec4fa[_0x90b9('0x25')](_0x35b43b)[_0x90b9('0x26')](function(_0x266a39){return _0x266a39;});}return null;};}function removeEntity(_0x388684,_0x2a75a9){return function(_0x4ccddf){if(_0x4ccddf){return _0x4ccddf['destroy']()['then'](function(){_0x388684[_0x90b9('0x1f')](0xcc)[_0x90b9('0x19')]();});}};}function handleEntityNotFound(_0x28b56a,_0xb47df7){return function(_0x4179eb){if(!_0x4179eb){_0x28b56a['sendStatus'](0x194);}return _0x4179eb;};}function handleError(_0x3d7490,_0x820186){_0x820186=_0x820186||0x1f4;return function(_0x47c2e1){logger[_0x90b9('0x27')](_0x47c2e1['stack']);if(_0x47c2e1['name']){delete _0x47c2e1[_0x90b9('0x28')];}_0x3d7490[_0x90b9('0x1f')](_0x820186)[_0x90b9('0x29')](_0x47c2e1);};}exports[_0x90b9('0x2a')]=function(_0x1ab4f6,_0x160729){var _0x4ed665={},_0x1350b2={},_0x8432ac={'count':0x0,'rows':[]};var _0x4c3f15=_[_0x90b9('0x2b')](db[_0x90b9('0x2c')]['rawAttributes'],function(_0x5a1a58){return{'name':_0x5a1a58[_0x90b9('0x2d')],'type':_0x5a1a58[_0x90b9('0x2e')][_0x90b9('0x2f')]};});_0x1350b2[_0x90b9('0x30')]=_['map'](_0x4c3f15,_0x90b9('0x28'));_0x1350b2[_0x90b9('0x31')]=_[_0x90b9('0x32')](_0x1ab4f6['query']);_0x1350b2['filters']=_[_0x90b9('0x33')](_0x1350b2[_0x90b9('0x30')],_0x1350b2[_0x90b9('0x31')]);_0x4ed665['attributes']=_[_0x90b9('0x33')](_0x1350b2[_0x90b9('0x30')],qs[_0x90b9('0x34')](_0x1ab4f6[_0x90b9('0x31')][_0x90b9('0x34')]));_0x4ed665[_0x90b9('0x35')]=_0x4ed665['attributes'][_0x90b9('0x36')]?_0x4ed665[_0x90b9('0x35')]:_0x1350b2[_0x90b9('0x30')];if(!_0x1ab4f6[_0x90b9('0x31')][_0x90b9('0x37')](_0x90b9('0x38'))){_0x4ed665[_0x90b9('0x1d')]=qs[_0x90b9('0x1d')](_0x1ab4f6[_0x90b9('0x31')][_0x90b9('0x1d')]);_0x4ed665[_0x90b9('0x1b')]=qs[_0x90b9('0x1b')](_0x1ab4f6[_0x90b9('0x31')]['offset']);}_0x4ed665[_0x90b9('0x39')]=qs[_0x90b9('0x3a')](_0x1ab4f6[_0x90b9('0x31')][_0x90b9('0x3a')]);_0x4ed665['where']=qs[_0x90b9('0x3b')](_['pick'](_0x1ab4f6['query'],_0x1350b2[_0x90b9('0x3b')]),_0x4c3f15);if(_0x1ab4f6[_0x90b9('0x31')][_0x90b9('0x3c')]){_0x4ed665[_0x90b9('0x3d')]=_[_0x90b9('0x3e')](_0x4ed665[_0x90b9('0x3d')],{'$or':_[_0x90b9('0x2b')](_0x4c3f15,function(_0x755dcf){if(_0x755dcf[_0x90b9('0x2e')]!=='VIRTUAL'){var _0x179475={};_0x179475[_0x755dcf[_0x90b9('0x28')]]={'$like':'%'+_0x1ab4f6['query']['filter']+'%'};return _0x179475;}})});}_0x4ed665=_[_0x90b9('0x3e')]({},_0x4ed665,_0x1ab4f6[_0x90b9('0x3f')]);var _0x3c620d={'where':_0x4ed665[_0x90b9('0x3d')]};return db['AnalyticFieldReport'][_0x90b9('0x1e')](_0x3c620d)[_0x90b9('0x26')](function(_0x5a8aff){_0x8432ac[_0x90b9('0x1e')]=_0x5a8aff;if(_0x1ab4f6['query']['includeAll']){_0x4ed665[_0x90b9('0x40')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x90b9('0x41')](_0x4ed665);})['then'](function(_0x132202){_0x8432ac['rows']=_0x132202;return _0x8432ac;})[_0x90b9('0x26')](respondWithFilteredResult(_0x160729,_0x4ed665))['catch'](handleError(_0x160729,null));};exports['show']=function(_0x385a80,_0x45780b){var _0x9fb2d3={'raw':![],'where':{'id':_0x385a80[_0x90b9('0x42')]['id']}},_0x3eaff2={};_0x3eaff2[_0x90b9('0x30')]=_[_0x90b9('0x32')](db[_0x90b9('0x2c')]['rawAttributes']);_0x3eaff2['query']=_['keys'](_0x385a80['query']);_0x3eaff2[_0x90b9('0x3b')]=_[_0x90b9('0x33')](_0x3eaff2[_0x90b9('0x30')],_0x3eaff2[_0x90b9('0x31')]);_0x9fb2d3['attributes']=_[_0x90b9('0x33')](_0x3eaff2[_0x90b9('0x30')],qs[_0x90b9('0x34')](_0x385a80['query'][_0x90b9('0x34')]));_0x9fb2d3['attributes']=_0x9fb2d3[_0x90b9('0x35')][_0x90b9('0x36')]?_0x9fb2d3['attributes']:_0x3eaff2[_0x90b9('0x30')];if(_0x385a80[_0x90b9('0x31')][_0x90b9('0x43')]){_0x9fb2d3['include']=[{'all':!![]}];}_0x9fb2d3=_[_0x90b9('0x3e')]({},_0x9fb2d3,_0x385a80['options']);return db['AnalyticFieldReport'][_0x90b9('0x44')](_0x9fb2d3)['then'](handleEntityNotFound(_0x45780b,null))[_0x90b9('0x26')](respondWithResult(_0x45780b,null))[_0x90b9('0x45')](handleError(_0x45780b,null));};exports['create']=function(_0x11593b,_0x44849d){return db['AnalyticFieldReport'][_0x90b9('0x46')](_0x11593b[_0x90b9('0x47')],{})[_0x90b9('0x26')](respondWithResult(_0x44849d,0xc9))[_0x90b9('0x45')](handleError(_0x44849d,null));};exports['bulkCreate']=function(_0x57e514,_0x5ae415){return db[_0x90b9('0x2c')]['bulkCreate'](_0x57e514[_0x90b9('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5ae415,0xc9))[_0x90b9('0x45')](handleError(_0x5ae415,null));};exports[_0x90b9('0x25')]=function(_0x5b88cf,_0x3da282){if(_0x5b88cf[_0x90b9('0x47')]['id']){delete _0x5b88cf['body']['id'];}return db['AnalyticFieldReport'][_0x90b9('0x44')]({'where':{'id':_0x5b88cf[_0x90b9('0x42')]['id']}})['then'](handleEntityNotFound(_0x3da282,null))['then'](saveUpdates(_0x5b88cf[_0x90b9('0x47')],null))[_0x90b9('0x26')](respondWithResult(_0x3da282,null))[_0x90b9('0x45')](handleError(_0x3da282,null));};exports[_0x90b9('0x48')]=function(_0x47095a,_0x4e8ebe){return db[_0x90b9('0x2c')][_0x90b9('0x44')]({'where':{'id':_0x47095a[_0x90b9('0x42')]['id']}})[_0x90b9('0x26')](handleEntityNotFound(_0x4e8ebe,null))[_0x90b9('0x26')](removeEntity(_0x4e8ebe,null))['catch'](handleError(_0x4e8ebe,null));};exports[_0x90b9('0x49')]=function(_0xf59833,_0x3d7ef0){return db[_0x90b9('0x2c')][_0x90b9('0x48')]({'where':{'id':_0xf59833['query'][_0x90b9('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x90b9('0x26')](respondWithResult(_0x3d7ef0,0xcc))[_0x90b9('0x45')](handleError(_0x3d7ef0,null));};exports[_0x90b9('0x4b')]=function(_0x258671,_0x2e2e9b,_0x5d8b68){return db[_0x90b9('0x4c')][_0x90b9('0x4d')]({'where':{'id':_0x258671[_0x90b9('0x42')]['id']}})[_0x90b9('0x26')](handleEntityNotFound(_0x2e2e9b,null))[_0x90b9('0x26')](function(_0x1b9d42){if(_0x1b9d42){return db[_0x90b9('0x4e')]['transaction'](function(_0x1d4705){return db[_0x90b9('0x2c')][_0x90b9('0x48')]({'where':{'CustomReportId':_0x258671[_0x90b9('0x42')]['id']},'transaction':_0x1d4705})[_0x90b9('0x26')](function(_0x56d8aa){var _0xf6dc85=_[_0x90b9('0x2b')](_0x258671[_0x90b9('0x47')],function(_0x5af3f6){delete _0x5af3f6['id'];_0x5af3f6[_0x90b9('0x4f')]=_0x258671[_0x90b9('0x42')]['id'];return _0x5af3f6;});return db[_0x90b9('0x2c')][_0x90b9('0x50')](_0xf6dc85,{'transaction':_0x1d4705});});})[_0x90b9('0x26')](function(){return db[_0x90b9('0x2c')][_0x90b9('0x41')]({'where':{'CustomReportId':_0x258671[_0x90b9('0x42')]['id']}});});}})['then'](respondWithResult(_0x2e2e9b,null))[_0x90b9('0x45')](handleError(_0x2e2e9b,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 0a092d5..c1e4118 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 _0x7d38=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','define','analytics_report_fields'];(function(_0x2340c3,_0x110d33){var _0x4f0198=function(_0x183e3c){while(--_0x183e3c){_0x2340c3['push'](_0x2340c3['shift']());}};_0x4f0198(++_0x110d33);}(_0x7d38,0xf2));var _0x87d3=function(_0x3a9513,_0x3c02c0){_0x3a9513=_0x3a9513-0x0;var _0x293839=_0x7d38[_0x3a9513];return _0x293839;};'use strict';var _=require(_0x87d3('0x0'));var util=require(_0x87d3('0x1'));var logger=require('../../config/logger')(_0x87d3('0x2'));var moment=require(_0x87d3('0x3'));var BPromise=require(_0x87d3('0x4'));var rp=require(_0x87d3('0x5'));var fs=require('fs');var path=require(_0x87d3('0x6'));var rimraf=require('rimraf');var config=require(_0x87d3('0x7'));var attributes=require(_0x87d3('0x8'));module['exports']=function(_0x2c93aa,_0x2074ef){return _0x2c93aa[_0x87d3('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0x87d3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3cd2=['request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','lodash','util','../../config/logger','moment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3cd2,0x18c));var _0x23cd=function(_0x3644f9,_0x501c12){_0x3644f9=_0x3644f9-0x0;var _0x5aaa15=_0x3cd2[_0x3644f9];return _0x5aaa15;};'use strict';var _=require(_0x23cd('0x0'));var util=require(_0x23cd('0x1'));var logger=require(_0x23cd('0x2'))('api');var moment=require(_0x23cd('0x3'));var BPromise=require('bluebird');var rp=require(_0x23cd('0x4'));var fs=require('fs');var path=require(_0x23cd('0x5'));var rimraf=require('rimraf');var config=require(_0x23cd('0x6'));var attributes=require(_0x23cd('0x7'));module[_0x23cd('0x8')]=function(_0x257f43,_0x1b4222){return _0x257f43['define'](_0x23cd('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 0bcd640..2d7a442 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 _0x66cf=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','rpc','jayson/promise','client','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x17abcf,_0xdd5674){var _0x547fab=function(_0x380374){while(--_0x380374){_0x17abcf['push'](_0x17abcf['shift']());}};_0x547fab(++_0xdd5674);}(_0x66cf,0x148));var _0xf66c=function(_0x36c6a4,_0x14daeb){_0x36c6a4=_0x36c6a4-0x0;var _0x1ed1c6=_0x66cf[_0x36c6a4];return _0x1ed1c6;};'use strict';var _=require(_0xf66c('0x0'));var util=require(_0xf66c('0x1'));var moment=require('moment');var BPromise=require(_0xf66c('0x2'));var rs=require(_0xf66c('0x3'));var fs=require('fs');var Redis=require(_0xf66c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf66c('0x5'));var config=require('../../config/environment');var jayson=require(_0xf66c('0x6'));var client=jayson[_0xf66c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22f22c,_0x496e83,_0x183a05){return new BPromise(function(_0x958efa,_0x14efd6){return client[_0xf66c('0x8')](_0x22f22c,_0x183a05)['then'](function(_0x7ac497){logger[_0xf66c('0x9')](_0xf66c('0xa'),_0x496e83,_0xf66c('0xb'));logger['debug'](_0xf66c('0xc'),_0x496e83,_0xf66c('0xb'),JSON[_0xf66c('0xd')](_0x7ac497));if(_0x7ac497['error']){if(_0x7ac497[_0xf66c('0xe')][_0xf66c('0xf')]===0x1f4){logger[_0xf66c('0xe')](_0xf66c('0xa'),_0x496e83,_0x7ac497[_0xf66c('0xe')]['message']);return _0x14efd6(_0x7ac497['error'][_0xf66c('0x10')]);}logger[_0xf66c('0xe')](_0xf66c('0xa'),_0x496e83,_0x7ac497[_0xf66c('0xe')][_0xf66c('0x10')]);return _0x958efa(_0x7ac497[_0xf66c('0xe')][_0xf66c('0x10')]);}else{logger['info'](_0xf66c('0xa'),_0x496e83,_0xf66c('0xb'));_0x958efa(_0x7ac497[_0xf66c('0x11')]['message']);}})[_0xf66c('0x12')](function(_0x383b87){logger[_0xf66c('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x496e83,_0x383b87);_0x14efd6(_0x383b87);});});} \ No newline at end of file +var _0x5cfd=['client','http','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0xf2dad0,_0x499aa9){var _0x447e18=function(_0x5df4ca){while(--_0x5df4ca){_0xf2dad0['push'](_0xf2dad0['shift']());}};_0x447e18(++_0x499aa9);}(_0x5cfd,0xdd));var _0xd5cf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5cfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd5cf('0x0'));var util=require(_0xd5cf('0x1'));var moment=require(_0xd5cf('0x2'));var BPromise=require('bluebird');var rs=require(_0xd5cf('0x3'));var fs=require('fs');var Redis=require(_0xd5cf('0x4'));var db=require(_0xd5cf('0x5'))['db'];var utils=require(_0xd5cf('0x6'));var logger=require(_0xd5cf('0x7'))('rpc');var config=require(_0xd5cf('0x8'));var jayson=require(_0xd5cf('0x9'));var client=jayson[_0xd5cf('0xa')][_0xd5cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4924f3,_0x22f7a3,_0x264443){return new BPromise(function(_0x20e01d,_0x5b221a){return client[_0xd5cf('0xc')](_0x4924f3,_0x264443)['then'](function(_0x456632){logger['info'](_0xd5cf('0xd'),_0x22f7a3,_0xd5cf('0xe'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x22f7a3,_0xd5cf('0xe'),JSON[_0xd5cf('0xf')](_0x456632));if(_0x456632[_0xd5cf('0x10')]){if(_0x456632[_0xd5cf('0x10')]['code']===0x1f4){logger[_0xd5cf('0x10')](_0xd5cf('0xd'),_0x22f7a3,_0x456632[_0xd5cf('0x10')][_0xd5cf('0x11')]);return _0x5b221a(_0x456632[_0xd5cf('0x10')]['message']);}logger[_0xd5cf('0x10')](_0xd5cf('0xd'),_0x22f7a3,_0x456632[_0xd5cf('0x10')][_0xd5cf('0x11')]);return _0x20e01d(_0x456632[_0xd5cf('0x10')][_0xd5cf('0x11')]);}else{logger[_0xd5cf('0x12')](_0xd5cf('0xd'),_0x22f7a3,_0xd5cf('0xe'));_0x20e01d(_0x456632[_0xd5cf('0x13')]['message']);}})[_0xd5cf('0x14')](function(_0x14c467){logger[_0xd5cf('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x22f7a3,_0x14c467);_0x5b221a(_0x14c467);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 175a481..6162445 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(_0x1a7986,_0x3d5e72){var _0x4eb402=function(_0x48280b){while(--_0x48280b){_0x1a7986['push'](_0x1a7986['shift']());}};_0x4eb402(++_0x3d5e72);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x63ef97,_0x457ea8){var _0x1d7e21=function(_0xda9eae){while(--_0xda9eae){_0x63ef97['push'](_0x63ef97['shift']());}};_0x1d7e21(++_0x457ea8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 d724135..ea323fe 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 _0x438a=['sequelize','exports','STRING','name','TEXT'];(function(_0x217c2e,_0x358f06){var _0x22b7d8=function(_0x111c48){while(--_0x111c48){_0x217c2e['push'](_0x217c2e['shift']());}};_0x22b7d8(++_0x358f06);}(_0x438a,0x18b));var _0xa438=function(_0x2a1e28,_0x75f505){_0x2a1e28=_0x2a1e28-0x0;var _0xa8dbfe=_0x438a[_0x2a1e28];return _0xa8dbfe;};'use strict';var Sequelize=require(_0xa438('0x0'));module[_0xa438('0x1')]={'name':{'type':Sequelize[_0xa438('0x2')],'allowNull':![],'unique':_0xa438('0x3')},'table':{'type':Sequelize[_0xa438('0x2')]},'metric':{'type':Sequelize[_0xa438('0x4')]},'description':{'type':Sequelize[_0xa438('0x2')]}}; \ No newline at end of file +var _0xbee0=['STRING','name','TEXT','exports'];(function(_0x564f68,_0x4da1ff){var _0x4330f5=function(_0x3c546d){while(--_0x3c546d){_0x564f68['push'](_0x564f68['shift']());}};_0x4330f5(++_0x4da1ff);}(_0xbee0,0x147));var _0x0bee=function(_0x162707,_0x4059d7){_0x162707=_0x162707-0x0;var _0x4e2fd5=_0xbee0[_0x162707];return _0x4e2fd5;};'use strict';var Sequelize=require('sequelize');module[_0x0bee('0x0')]={'name':{'type':Sequelize[_0x0bee('0x1')],'allowNull':![],'unique':_0x0bee('0x2')},'table':{'type':Sequelize[_0x0bee('0x1')]},'metric':{'type':Sequelize[_0x0bee('0x3')]},'description':{'type':Sequelize[_0x0bee('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 241ffc4..31aaa47 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 _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','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/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0x1493cb,_0x5711f1){var _0x3a6357=function(_0x263875){while(--_0x263875){_0x1493cb['push'](_0x1493cb['shift']());}};_0x3a6357(++_0x5711f1);}(_0x81bd,0x7c));var _0xd81b=function(_0x22808b,_0x329b6a){_0x22808b=_0x22808b-0x0;var _0x42cbd2=_0x81bd[_0x22808b];return _0x42cbd2;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));}; \ No newline at end of file +var _0x8ef6=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','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','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x22a112,_0x4ef65c){var _0x83d8c7=function(_0x39a793){while(--_0x39a793){_0x22a112['push'](_0x22a112['shift']());}};_0x83d8c7(++_0x4ef65c);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2c6a9d,_0x8479bc){_0x2c6a9d=_0x2c6a9d-0x0;var _0x22181e=_0x8ef6[_0x2c6a9d];return _0x22181e;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){var _0x49374f=_0x438b4c[_0x68ef('0x29')]({'plain':!![]});var _0x13280b='Metrics';return db[_0x68ef('0x2a')]['destroy']({'where':{'type':_0x13280b,'resourceId':_0x49374f['id']}})['then'](function(){return _0x438b4c;});})['then'](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x123041,_0x29518e){return function(_0x52e67e){if(!_0x52e67e){_0x123041['sendStatus'](0x194);}return _0x52e67e;};}function handleError(_0x1cbe4f,_0x28907a){_0x28907a=_0x28907a||0x1f4;return function(_0x7bf96){logger[_0x68ef('0x2b')](_0x7bf96[_0x68ef('0x2c')]);if(_0x7bf96[_0x68ef('0x2d')]){delete _0x7bf96[_0x68ef('0x2d')];}_0x1cbe4f[_0x68ef('0x1d')](_0x28907a)['send'](_0x7bf96);};}exports[_0x68ef('0x2e')]=function(_0x4314bd,_0x132d9e){var _0x4c25aa={},_0x370a8f={},_0x523120={'count':0x0,'rows':[]};var _0x133788=_[_0x68ef('0x2f')](db['AnalyticMetric']['rawAttributes'],function(_0x159395){return{'name':_0x159395[_0x68ef('0x30')],'type':_0x159395['type'][_0x68ef('0x31')]};});_0x370a8f[_0x68ef('0x32')]=_[_0x68ef('0x2f')](_0x133788,_0x68ef('0x2d'));_0x370a8f['query']=_[_0x68ef('0x33')](_0x4314bd[_0x68ef('0x34')]);_0x370a8f['filters']=_[_0x68ef('0x35')](_0x370a8f['model'],_0x370a8f[_0x68ef('0x34')]);_0x4c25aa[_0x68ef('0x36')]=_['intersection'](_0x370a8f[_0x68ef('0x32')],qs['fields'](_0x4314bd[_0x68ef('0x34')]['fields']));_0x4c25aa[_0x68ef('0x36')]=_0x4c25aa[_0x68ef('0x36')][_0x68ef('0x37')]?_0x4c25aa['attributes']:_0x370a8f[_0x68ef('0x32')];if(!_0x4314bd['query'][_0x68ef('0x38')]('nolimit')){_0x4c25aa[_0x68ef('0x21')]=qs[_0x68ef('0x21')](_0x4314bd[_0x68ef('0x34')][_0x68ef('0x21')]);_0x4c25aa[_0x68ef('0x1f')]=qs[_0x68ef('0x1f')](_0x4314bd['query'][_0x68ef('0x1f')]);}_0x4c25aa[_0x68ef('0x39')]=qs[_0x68ef('0x3a')](_0x4314bd['query'][_0x68ef('0x3a')]);_0x4c25aa[_0x68ef('0x3b')]=qs[_0x68ef('0x3c')](_['pick'](_0x4314bd['query'],_0x370a8f[_0x68ef('0x3c')]),_0x133788);if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x3d')]){_0x4c25aa[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x4c25aa[_0x68ef('0x3b')],{'$or':_[_0x68ef('0x2f')](_0x133788,function(_0x5b1246){if(_0x5b1246[_0x68ef('0x3f')]!==_0x68ef('0x40')){var _0x2f6ee0={};_0x2f6ee0[_0x5b1246[_0x68ef('0x2d')]]={'$like':'%'+_0x4314bd['query'][_0x68ef('0x3d')]+'%'};return _0x2f6ee0;}})});}_0x4c25aa=_[_0x68ef('0x3e')]({},_0x4c25aa,_0x4314bd[_0x68ef('0x41')]);var _0x410c10={'where':_0x4c25aa[_0x68ef('0x3b')]};return db[_0x68ef('0x42')]['count'](_0x410c10)[_0x68ef('0x27')](function(_0x3f7699){_0x523120[_0x68ef('0x43')]=_0x3f7699;if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x44')]){_0x4c25aa[_0x68ef('0x45')]=[{'all':!![]}];}return db[_0x68ef('0x42')][_0x68ef('0x46')](_0x4c25aa);})[_0x68ef('0x27')](function(_0x531096){_0x523120[_0x68ef('0x47')]=_0x531096;return _0x523120;})[_0x68ef('0x27')](respondWithFilteredResult(_0x132d9e,_0x4c25aa))[_0x68ef('0x48')](handleError(_0x132d9e,null));};exports[_0x68ef('0x49')]=function(_0xdeacf2,_0x183377){var _0xcac58f={'raw':!![],'where':{'id':_0xdeacf2[_0x68ef('0x4a')]['id']}},_0x576767={};_0x576767['model']=_[_0x68ef('0x33')](db[_0x68ef('0x42')][_0x68ef('0x4b')]);_0x576767[_0x68ef('0x34')]=_['keys'](_0xdeacf2[_0x68ef('0x34')]);_0x576767['filters']=_[_0x68ef('0x35')](_0x576767['model'],_0x576767[_0x68ef('0x34')]);_0xcac58f[_0x68ef('0x36')]=_[_0x68ef('0x35')](_0x576767['model'],qs['fields'](_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x4c')]));_0xcac58f['attributes']=_0xcac58f['attributes']['length']?_0xcac58f[_0x68ef('0x36')]:_0x576767[_0x68ef('0x32')];if(_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x44')]){_0xcac58f[_0x68ef('0x45')]=[{'all':!![]}];}_0xcac58f=_['merge']({},_0xcac58f,_0xdeacf2['options']);return db[_0x68ef('0x42')][_0x68ef('0x4d')](_0xcac58f)[_0x68ef('0x27')](handleEntityNotFound(_0x183377,null))[_0x68ef('0x27')](respondWithResult(_0x183377,null))['catch'](handleError(_0x183377,null));};exports[_0x68ef('0x4e')]=function(_0x474e5a,_0x1c9b6f){return db[_0x68ef('0x42')]['create'](_0x474e5a['body'],{})[_0x68ef('0x27')](function(_0x3c3074){var _0x566e7c=_0x474e5a[_0x68ef('0x4f')][_0x68ef('0x29')]({'plain':!![]});if(!_0x566e7c)throw new Error(_0x68ef('0x50'));if(_0x566e7c[_0x68ef('0x51')]===_0x68ef('0x4f')){var _0x4f0f77=_0x3c3074[_0x68ef('0x29')]({'plain':!![]});var _0x3984ca=_0x68ef('0x52');return db['UserProfileSection'][_0x68ef('0x4d')]({'where':{'name':_0x3984ca,'userProfileId':_0x566e7c[_0x68ef('0x53')]},'raw':!![]})[_0x68ef('0x27')](function(_0x50ef1f){if(_0x50ef1f&&_0x50ef1f[_0x68ef('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4f0f77[_0x68ef('0x2d')],'resourceId':_0x4f0f77['id'],'type':_0x50ef1f['name'],'sectionId':_0x50ef1f['id']},{})[_0x68ef('0x27')](function(){return _0x3c3074;});}else{return _0x3c3074;}})[_0x68ef('0x48')](function(_0x53ebd){logger[_0x68ef('0x2b')](_0x68ef('0x55'),_0x53ebd);throw _0x53ebd;});}return _0x3c3074;})[_0x68ef('0x27')](respondWithResult(_0x1c9b6f,0xc9))[_0x68ef('0x48')](handleError(_0x1c9b6f,null));};exports[_0x68ef('0x56')]=function(_0x2b35f4,_0x247915){if(_0x2b35f4['body']['id']){delete _0x2b35f4['body']['id'];}return db[_0x68ef('0x42')][_0x68ef('0x4d')]({'where':{'id':_0x2b35f4[_0x68ef('0x4a')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x247915,null))[_0x68ef('0x27')](saveUpdates(_0x2b35f4[_0x68ef('0x57')],null))[_0x68ef('0x27')](respondWithResult(_0x247915,null))[_0x68ef('0x48')](handleError(_0x247915,null));};exports[_0x68ef('0x28')]=function(_0x4c2e9c,_0x5685bb){return db[_0x68ef('0x42')]['find']({'where':{'id':_0x4c2e9c[_0x68ef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5685bb,null))[_0x68ef('0x27')](removeEntity(_0x5685bb,null))[_0x68ef('0x48')](handleError(_0x5685bb,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 9d4bdd7..be2f4bb 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 _0x33ac=['exports','AnalyticMetric','analytics_metrics','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x19424d,_0x1ab0fb){var _0x5063bc=function(_0x5d8101){while(--_0x5d8101){_0x19424d['push'](_0x19424d['shift']());}};_0x5063bc(++_0x1ab0fb);}(_0x33ac,0x1f2));var _0xc33a=function(_0x34f8fd,_0x3523e5){_0x34f8fd=_0x34f8fd-0x0;var _0x307a14=_0x33ac[_0x34f8fd];return _0x307a14;};'use strict';var _=require('lodash');var util=require(_0xc33a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc33a('0x1'));var BPromise=require(_0xc33a('0x2'));var rp=require(_0xc33a('0x3'));var fs=require('fs');var path=require(_0xc33a('0x4'));var rimraf=require(_0xc33a('0x5'));var config=require(_0xc33a('0x6'));var attributes=require(_0xc33a('0x7'));module[_0xc33a('0x8')]=function(_0x322368,_0x554de7){return _0x322368['define'](_0xc33a('0x9'),attributes,{'tableName':_0xc33a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c91=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticMetric','lodash','util','../../config/logger'];(function(_0x281a8d,_0x447bde){var _0x136e85=function(_0x5752dd){while(--_0x5752dd){_0x281a8d['push'](_0x281a8d['shift']());}};_0x136e85(++_0x447bde);}(_0x5c91,0x1e9));var _0x15c9=function(_0x22216a,_0xecb681){_0x22216a=_0x22216a-0x0;var _0x1195e9=_0x5c91[_0x22216a];return _0x1195e9;};'use strict';var _=require(_0x15c9('0x0'));var util=require(_0x15c9('0x1'));var logger=require(_0x15c9('0x2'))('api');var moment=require(_0x15c9('0x3'));var BPromise=require(_0x15c9('0x4'));var rp=require(_0x15c9('0x5'));var fs=require('fs');var path=require(_0x15c9('0x6'));var rimraf=require(_0x15c9('0x7'));var config=require(_0x15c9('0x8'));var attributes=require('./analyticMetric.attributes');module[_0x15c9('0x9')]=function(_0x216469,_0x1ce11a){return _0x216469[_0x15c9('0xa')](_0x15c9('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 260a9a9..68ce495 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 _0xd54b=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x16c9a3,_0x138f2b){var _0x15c1d1=function(_0x1afde0){while(--_0x1afde0){_0x16c9a3['push'](_0x16c9a3['shift']());}};_0x15c1d1(++_0x138f2b);}(_0xd54b,0x1d4));var _0xbd54=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd54b[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xbd54('0x0'));var util=require(_0xbd54('0x1'));var moment=require(_0xbd54('0x2'));var BPromise=require(_0xbd54('0x3'));var rs=require(_0xbd54('0x4'));var fs=require('fs');var Redis=require(_0xbd54('0x5'));var db=require(_0xbd54('0x6'))['db'];var utils=require(_0xbd54('0x7'));var logger=require('../../config/logger')(_0xbd54('0x8'));var config=require(_0xbd54('0x9'));var jayson=require(_0xbd54('0xa'));var client=jayson[_0xbd54('0xb')][_0xbd54('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3bc5df,_0x1efa2d,_0x6d3784){return new BPromise(function(_0x29299f,_0xb8141c){return client['request'](_0x3bc5df,_0x6d3784)[_0xbd54('0xd')](function(_0x4d0b9c){logger[_0xbd54('0xe')](_0xbd54('0xf'),_0x1efa2d,_0xbd54('0x10'));logger[_0xbd54('0x11')](_0xbd54('0x12'),_0x1efa2d,_0xbd54('0x10'),JSON[_0xbd54('0x13')](_0x4d0b9c));if(_0x4d0b9c[_0xbd54('0x14')]){if(_0x4d0b9c[_0xbd54('0x14')][_0xbd54('0x15')]===0x1f4){logger[_0xbd54('0x14')](_0xbd54('0xf'),_0x1efa2d,_0x4d0b9c[_0xbd54('0x14')]['message']);return _0xb8141c(_0x4d0b9c[_0xbd54('0x14')][_0xbd54('0x16')]);}logger[_0xbd54('0x14')](_0xbd54('0xf'),_0x1efa2d,_0x4d0b9c[_0xbd54('0x14')][_0xbd54('0x16')]);return _0x29299f(_0x4d0b9c[_0xbd54('0x14')]['message']);}else{logger[_0xbd54('0xe')](_0xbd54('0xf'),_0x1efa2d,_0xbd54('0x10'));_0x29299f(_0x4d0b9c[_0xbd54('0x17')][_0xbd54('0x16')]);}})[_0xbd54('0x18')](function(_0x2fcc0a){logger[_0xbd54('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x1efa2d,_0x2fcc0a);_0xb8141c(_0x2fcc0a);});});} \ No newline at end of file +var _0x0f6d=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1777d3,_0x35d883){var _0x3a87e8=function(_0x2e57b8){while(--_0x2e57b8){_0x1777d3['push'](_0x1777d3['shift']());}};_0x3a87e8(++_0x35d883);}(_0x0f6d,0x182));var _0xd0f6=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0x0f6d[_0x107f10];return _0x811cab;};'use strict';var _=require(_0xd0f6('0x0'));var util=require('util');var moment=require(_0xd0f6('0x1'));var BPromise=require(_0xd0f6('0x2'));var rs=require(_0xd0f6('0x3'));var fs=require('fs');var Redis=require(_0xd0f6('0x4'));var db=require(_0xd0f6('0x5'))['db'];var utils=require(_0xd0f6('0x6'));var logger=require(_0xd0f6('0x7'))(_0xd0f6('0x8'));var config=require('../../config/environment');var jayson=require(_0xd0f6('0x9'));var client=jayson['client'][_0xd0f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5234ff,_0xc983a8,_0x4c17eb){return new BPromise(function(_0x3c9489,_0x5e2aa4){return client[_0xd0f6('0xb')](_0x5234ff,_0x4c17eb)[_0xd0f6('0xc')](function(_0x429fbc){logger[_0xd0f6('0xd')](_0xd0f6('0xe'),_0xc983a8,_0xd0f6('0xf'));logger[_0xd0f6('0x10')](_0xd0f6('0x11'),_0xc983a8,'request\x20sent',JSON[_0xd0f6('0x12')](_0x429fbc));if(_0x429fbc['error']){if(_0x429fbc[_0xd0f6('0x13')][_0xd0f6('0x14')]===0x1f4){logger[_0xd0f6('0x13')](_0xd0f6('0xe'),_0xc983a8,_0x429fbc[_0xd0f6('0x13')]['message']);return _0x5e2aa4(_0x429fbc[_0xd0f6('0x13')][_0xd0f6('0x15')]);}logger[_0xd0f6('0x13')](_0xd0f6('0xe'),_0xc983a8,_0x429fbc[_0xd0f6('0x13')][_0xd0f6('0x15')]);return _0x3c9489(_0x429fbc['error'][_0xd0f6('0x15')]);}else{logger[_0xd0f6('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0xc983a8,_0xd0f6('0xf'));_0x3c9489(_0x429fbc[_0xd0f6('0x16')][_0xd0f6('0x15')]);}})[_0xd0f6('0x17')](function(_0x1ce546){logger['error'](_0xd0f6('0xe'),_0xc983a8,_0x1ce546);_0x5e2aa4(_0x1ce546);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 4d0b70d..588b7cb 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 _0x394e=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','update'];(function(_0x31d8d7,_0x52aee6){var _0x48dd27=function(_0x48dcfd){while(--_0x48dcfd){_0x31d8d7['push'](_0x31d8d7['shift']());}};_0x48dd27(++_0x52aee6);}(_0x394e,0x88));var _0xe394=function(_0xa84046,_0x456128){_0xa84046=_0xa84046-0x0;var _0x156dae=_0x394e[_0xa84046];return _0x156dae;};'use strict';var multer=require(_0xe394('0x0'));var util=require(_0xe394('0x1'));var path=require('path');var timeout=require(_0xe394('0x2'));var express=require(_0xe394('0x3'));var router=express[_0xe394('0x4')]();var fs_extra=require(_0xe394('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe394('0x6'));var config=require(_0xe394('0x7'));var controller=require(_0xe394('0x8'));router[_0xe394('0x9')]('/',auth[_0xe394('0xa')](),controller[_0xe394('0xb')]);router[_0xe394('0x9')](_0xe394('0xc'),auth[_0xe394('0xa')](),controller[_0xe394('0xd')]);router[_0xe394('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe394('0xc'),auth[_0xe394('0xa')](),controller[_0xe394('0xf')]);router[_0xe394('0x10')](_0xe394('0xc'),auth[_0xe394('0xa')](),controller[_0xe394('0x11')]);module[_0xe394('0x12')]=router; \ No newline at end of file +var _0x7f3f=['Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7f3f,0x1c8));var _0xf7f3=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x7f3f[_0x40a825];return _0x273a54;};'use strict';var multer=require(_0xf7f3('0x0'));var util=require(_0xf7f3('0x1'));var path=require('path');var timeout=require(_0xf7f3('0x2'));var express=require(_0xf7f3('0x3'));var router=express[_0xf7f3('0x4')]();var fs_extra=require(_0xf7f3('0x5'));var auth=require(_0xf7f3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf7f3('0x7'));var controller=require(_0xf7f3('0x8'));router['get']('/',auth[_0xf7f3('0x9')](),controller[_0xf7f3('0xa')]);router[_0xf7f3('0xb')](_0xf7f3('0xc'),auth[_0xf7f3('0x9')](),controller[_0xf7f3('0xd')]);router[_0xf7f3('0xe')]('/',auth['isAuthenticated'](),controller[_0xf7f3('0xf')]);router[_0xf7f3('0x10')](_0xf7f3('0xc'),auth[_0xf7f3('0x9')](),controller[_0xf7f3('0x11')]);router[_0xf7f3('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xf7f3('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index e9a8975..4dae772 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 _0xdd87=['TEXT','sequelize','exports'];(function(_0x4b3e49,_0x9e566c){var _0x57e339=function(_0x1430e9){while(--_0x1430e9){_0x4b3e49['push'](_0x4b3e49['shift']());}};_0x57e339(++_0x9e566c);}(_0xdd87,0x9a));var _0x7dd8=function(_0x3cbee3,_0x19d02f){_0x3cbee3=_0x3cbee3-0x0;var _0x42cd84=_0xdd87[_0x3cbee3];return _0x42cd84;};'use strict';var Sequelize=require(_0x7dd8('0x0'));module[_0x7dd8('0x1')]={'tree':{'type':Sequelize[_0x7dd8('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x2b44=['TEXT','sequelize'];(function(_0x4a2555,_0x3df257){var _0x13c557=function(_0x762348){while(--_0x762348){_0x4a2555['push'](_0x4a2555['shift']());}};_0x13c557(++_0x3df257);}(_0x2b44,0x1d7));var _0x42b4=function(_0x4cae6a,_0x41fe19){_0x4cae6a=_0x4cae6a-0x0;var _0x2fe2b8=_0x2b44[_0x4cae6a];return _0x2fe2b8;};'use strict';var Sequelize=require(_0x42b4('0x0'));module['exports']={'tree':{'type':Sequelize[_0x42b4('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 969d1ef..c5e3ab3 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 _0x14e6=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x15ccbc,_0x4da02b){var _0x4904a0=function(_0x2ff7f3){while(--_0x2ff7f3){_0x15ccbc['push'](_0x15ccbc['shift']());}};_0x4904a0(++_0x4da02b);}(_0x14e6,0x7d));var _0x614e=function(_0x4b3661,_0x1be781){_0x4b3661=_0x4b3661-0x0;var _0x582d0c=_0x14e6[_0x4b3661];return _0x582d0c;};'use strict';var emlformat=require(_0x614e('0x0'));var rimraf=require(_0x614e('0x1'));var zipdir=require(_0x614e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x614e('0x3'));var moment=require(_0x614e('0x4'));var BPromise=require(_0x614e('0x5'));var Mustache=require(_0x614e('0x6'));var util=require('util');var path=require(_0x614e('0x7'));var sox=require(_0x614e('0x8'));var csv=require(_0x614e('0x9'));var ejs=require(_0x614e('0xa'));var fs=require('fs');var fs_extra=require(_0x614e('0xb'));var _=require(_0x614e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x614e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x614e('0xe'));var Papa=require(_0x614e('0xf'));var Redis=require(_0x614e('0x10'));var authService=require(_0x614e('0x11'));var qs=require(_0x614e('0x12'));var as=require(_0x614e('0x13'));var hardwareService=require(_0x614e('0x14'));var logger=require(_0x614e('0x15'))(_0x614e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x614e('0x17'));var db=require(_0x614e('0x18'))['db'];function respondWithStatusCode(_0x17ecb5,_0x546abf){_0x546abf=_0x546abf||0xcc;return function(_0x2b8bd3){if(_0x2b8bd3){return _0x17ecb5[_0x614e('0x19')](_0x546abf);}return _0x17ecb5[_0x614e('0x1a')](_0x546abf)[_0x614e('0x1b')]();};}function respondWithResult(_0x4e862a,_0x252b7e){_0x252b7e=_0x252b7e||0xc8;return function(_0x129c47){if(_0x129c47){return _0x4e862a[_0x614e('0x1a')](_0x252b7e)[_0x614e('0x1c')](_0x129c47);}};}function respondWithFilteredResult(_0xf4fb2e,_0x4c21a2){return function(_0x230da9){if(_0x230da9){var _0x1e6272=typeof _0x4c21a2[_0x614e('0x1d')]===_0x614e('0x1e')&&typeof _0x4c21a2[_0x614e('0x1f')]===_0x614e('0x1e');var _0x53dbac=_0x230da9['count'];var _0x3141f2=_0x1e6272?0x0:_0x4c21a2['offset'];var _0x835546=_0x1e6272?_0x230da9[_0x614e('0x20')]:_0x4c21a2[_0x614e('0x1d')]+_0x4c21a2[_0x614e('0x1f')];var _0x55a201;if(_0x835546>=_0x53dbac){_0x835546=_0x53dbac;_0x55a201=0xc8;}else{_0x55a201=0xce;}_0xf4fb2e[_0x614e('0x1a')](_0x55a201);return _0xf4fb2e[_0x614e('0x21')](_0x614e('0x22'),_0x3141f2+'-'+_0x835546+'/'+_0x53dbac)['json'](_0x230da9);}return null;};}function patchUpdates(_0x3b3e08){return function(_0x371968){try{jsonpatch[_0x614e('0x23')](_0x371968,_0x3b3e08,!![]);}catch(_0x3552ea){return BPromise[_0x614e('0x24')](_0x3552ea);}return _0x371968[_0x614e('0x25')]();};}function saveUpdates(_0x4443d0,_0x38f194){return function(_0x5408fa){if(_0x5408fa){return _0x5408fa[_0x614e('0x26')](_0x4443d0)[_0x614e('0x27')](function(_0x2fec48){return _0x2fec48;});}return null;};}function removeEntity(_0x4153b9,_0x301fe2){return function(_0x5f20a4){if(_0x5f20a4){return _0x5f20a4[_0x614e('0x28')]()['then'](function(){_0x4153b9[_0x614e('0x1a')](0xcc)[_0x614e('0x1b')]();});}};}function handleEntityNotFound(_0x1bd805,_0x4a7591){return function(_0x4fe706){if(!_0x4fe706){_0x1bd805[_0x614e('0x19')](0x194);}return _0x4fe706;};}function handleError(_0x2a28c0,_0x3b24c1){_0x3b24c1=_0x3b24c1||0x1f4;return function(_0x3c48ec){logger[_0x614e('0x29')](_0x3c48ec[_0x614e('0x2a')]);if(_0x3c48ec[_0x614e('0x2b')]){delete _0x3c48ec['name'];}_0x2a28c0[_0x614e('0x1a')](_0x3b24c1)[_0x614e('0x2c')](_0x3c48ec);};}exports[_0x614e('0x2d')]=function(_0x59ac8c,_0x31645c){var _0x3ea498={},_0x4b068d={},_0x2e33d9={'count':0x0,'rows':[]};var _0xea70d=_[_0x614e('0x2e')](db[_0x614e('0x2f')][_0x614e('0x30')],function(_0x203360){return{'name':_0x203360[_0x614e('0x31')],'type':_0x203360[_0x614e('0x32')][_0x614e('0x33')]};});_0x4b068d[_0x614e('0x34')]=_[_0x614e('0x2e')](_0xea70d,_0x614e('0x2b'));_0x4b068d[_0x614e('0x35')]=_[_0x614e('0x36')](_0x59ac8c[_0x614e('0x35')]);_0x4b068d[_0x614e('0x37')]=_[_0x614e('0x38')](_0x4b068d[_0x614e('0x34')],_0x4b068d['query']);_0x3ea498[_0x614e('0x39')]=_[_0x614e('0x38')](_0x4b068d[_0x614e('0x34')],qs['fields'](_0x59ac8c[_0x614e('0x35')][_0x614e('0x3a')]));_0x3ea498[_0x614e('0x39')]=_0x3ea498['attributes']['length']?_0x3ea498['attributes']:_0x4b068d['model'];if(!_0x59ac8c[_0x614e('0x35')][_0x614e('0x3b')](_0x614e('0x3c'))){_0x3ea498['limit']=qs[_0x614e('0x1f')](_0x59ac8c['query'][_0x614e('0x1f')]);_0x3ea498[_0x614e('0x1d')]=qs[_0x614e('0x1d')](_0x59ac8c[_0x614e('0x35')][_0x614e('0x1d')]);}_0x3ea498[_0x614e('0x3d')]=qs[_0x614e('0x3e')](_0x59ac8c[_0x614e('0x35')]['sort']);_0x3ea498[_0x614e('0x3f')]=qs[_0x614e('0x37')](_[_0x614e('0x40')](_0x59ac8c[_0x614e('0x35')],_0x4b068d[_0x614e('0x37')]),_0xea70d);if(_0x59ac8c[_0x614e('0x35')]['filter']){_0x3ea498[_0x614e('0x3f')]=_[_0x614e('0x41')](_0x3ea498['where'],{'$or':_['map'](_0xea70d,function(_0x10d89d){if(_0x10d89d[_0x614e('0x32')]!=='VIRTUAL'){var _0x47b9cc={};_0x47b9cc[_0x10d89d[_0x614e('0x2b')]]={'$like':'%'+_0x59ac8c[_0x614e('0x35')][_0x614e('0x42')]+'%'};return _0x47b9cc;}})});}_0x3ea498=_[_0x614e('0x41')]({},_0x3ea498,_0x59ac8c[_0x614e('0x43')]);var _0x11d692={'where':_0x3ea498[_0x614e('0x3f')]};return db[_0x614e('0x2f')][_0x614e('0x20')](_0x11d692)['then'](function(_0x2ada63){_0x2e33d9[_0x614e('0x20')]=_0x2ada63;if(_0x59ac8c[_0x614e('0x35')][_0x614e('0x44')]){_0x3ea498[_0x614e('0x45')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x614e('0x46')](_0x3ea498);})[_0x614e('0x27')](function(_0x15aed2){_0x2e33d9[_0x614e('0x47')]=_0x15aed2;return _0x2e33d9;})[_0x614e('0x27')](respondWithFilteredResult(_0x31645c,_0x3ea498))[_0x614e('0x48')](handleError(_0x31645c,null));};exports[_0x614e('0x49')]=function(_0x230ddc,_0x550c03){var _0x4f7b1d={'raw':!![],'where':{'id':_0x230ddc[_0x614e('0x4a')]['id']}},_0x304729={};_0x304729[_0x614e('0x34')]=_[_0x614e('0x36')](db[_0x614e('0x2f')][_0x614e('0x30')]);_0x304729[_0x614e('0x35')]=_[_0x614e('0x36')](_0x230ddc['query']);_0x304729[_0x614e('0x37')]=_['intersection'](_0x304729[_0x614e('0x34')],_0x304729[_0x614e('0x35')]);_0x4f7b1d[_0x614e('0x39')]=_[_0x614e('0x38')](_0x304729[_0x614e('0x34')],qs[_0x614e('0x3a')](_0x230ddc[_0x614e('0x35')][_0x614e('0x3a')]));_0x4f7b1d['attributes']=_0x4f7b1d['attributes']['length']?_0x4f7b1d[_0x614e('0x39')]:_0x304729[_0x614e('0x34')];if(_0x230ddc[_0x614e('0x35')][_0x614e('0x44')]){_0x4f7b1d[_0x614e('0x45')]=[{'all':!![]}];}_0x4f7b1d=_['merge']({},_0x4f7b1d,_0x230ddc['options']);return db['AnalyticTreeReport']['find'](_0x4f7b1d)[_0x614e('0x27')](handleEntityNotFound(_0x550c03,null))['then'](respondWithResult(_0x550c03,null))[_0x614e('0x48')](handleError(_0x550c03,null));};exports[_0x614e('0x4b')]=function(_0x33c7d5,_0x322eef){return db[_0x614e('0x2f')][_0x614e('0x4b')](_0x33c7d5[_0x614e('0x4c')],{})[_0x614e('0x27')](respondWithResult(_0x322eef,0xc9))['catch'](handleError(_0x322eef,null));};exports[_0x614e('0x26')]=function(_0x567c1a,_0xde104c){if(_0x567c1a['body']['id']){delete _0x567c1a[_0x614e('0x4c')]['id'];}return db[_0x614e('0x2f')][_0x614e('0x4d')]({'where':{'id':_0x567c1a[_0x614e('0x4a')]['id']}})[_0x614e('0x27')](handleEntityNotFound(_0xde104c,null))[_0x614e('0x27')](saveUpdates(_0x567c1a[_0x614e('0x4c')],null))['then'](respondWithResult(_0xde104c,null))['catch'](handleError(_0xde104c,null));};exports[_0x614e('0x28')]=function(_0x1a0cb3,_0x488200){return db[_0x614e('0x2f')][_0x614e('0x4d')]({'where':{'id':_0x1a0cb3['params']['id']}})[_0x614e('0x27')](handleEntityNotFound(_0x488200,null))[_0x614e('0x27')](removeEntity(_0x488200,null))[_0x614e('0x48')](handleError(_0x488200,null));}; \ No newline at end of file +var _0xa13b=['moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','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','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','AnalyticTreeReport','keys','find','create','body','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x4ee813,_0x59f32b){var _0xa254ec=function(_0x34c3dd){while(--_0x34c3dd){_0x4ee813['push'](_0x4ee813['shift']());}};_0xa254ec(++_0x59f32b);}(_0xa13b,0x94));var _0xba13=function(_0x3ff07a,_0x1c4e69){_0x3ff07a=_0x3ff07a-0x0;var _0x2e5ce4=_0xa13b[_0x3ff07a];return _0x2e5ce4;};'use strict';var emlformat=require(_0xba13('0x0'));var rimraf=require(_0xba13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba13('0x2'));var rp=require(_0xba13('0x3'));var moment=require(_0xba13('0x4'));var BPromise=require(_0xba13('0x5'));var Mustache=require(_0xba13('0x6'));var util=require('util');var path=require(_0xba13('0x7'));var sox=require(_0xba13('0x8'));var csv=require(_0xba13('0x9'));var ejs=require(_0xba13('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba13('0xb'));var squel=require(_0xba13('0xc'));var crypto=require(_0xba13('0xd'));var jsforce=require(_0xba13('0xe'));var deskjs=require(_0xba13('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xba13('0x10'));var Redis=require(_0xba13('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xba13('0x12'));var as=require(_0xba13('0x13'));var hardwareService=require(_0xba13('0x14'));var logger=require(_0xba13('0x15'))(_0xba13('0x16'));var utils=require(_0xba13('0x17'));var config=require(_0xba13('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xba13('0x19'))['db'];function respondWithStatusCode(_0x1d4824,_0x4f6d4c){_0x4f6d4c=_0x4f6d4c||0xcc;return function(_0x3ec76a){if(_0x3ec76a){return _0x1d4824[_0xba13('0x1a')](_0x4f6d4c);}return _0x1d4824[_0xba13('0x1b')](_0x4f6d4c)[_0xba13('0x1c')]();};}function respondWithResult(_0x27b18f,_0x2bc677){_0x2bc677=_0x2bc677||0xc8;return function(_0x5c98b7){if(_0x5c98b7){return _0x27b18f['status'](_0x2bc677)['json'](_0x5c98b7);}};}function respondWithFilteredResult(_0x22d975,_0x338fe3){return function(_0x13fe79){if(_0x13fe79){var _0x2c3434=typeof _0x338fe3[_0xba13('0x1d')]===_0xba13('0x1e')&&typeof _0x338fe3[_0xba13('0x1f')]===_0xba13('0x1e');var _0x5ce355=_0x13fe79[_0xba13('0x20')];var _0x4f353b=_0x2c3434?0x0:_0x338fe3['offset'];var _0x4e2209=_0x2c3434?_0x13fe79[_0xba13('0x20')]:_0x338fe3[_0xba13('0x1d')]+_0x338fe3[_0xba13('0x1f')];var _0x32b069;if(_0x4e2209>=_0x5ce355){_0x4e2209=_0x5ce355;_0x32b069=0xc8;}else{_0x32b069=0xce;}_0x22d975[_0xba13('0x1b')](_0x32b069);return _0x22d975[_0xba13('0x21')](_0xba13('0x22'),_0x4f353b+'-'+_0x4e2209+'/'+_0x5ce355)['json'](_0x13fe79);}return null;};}function patchUpdates(_0x156229){return function(_0x4e1cb2){try{jsonpatch[_0xba13('0x23')](_0x4e1cb2,_0x156229,!![]);}catch(_0x3b8883){return BPromise[_0xba13('0x24')](_0x3b8883);}return _0x4e1cb2[_0xba13('0x25')]();};}function saveUpdates(_0x54641d,_0x340b10){return function(_0x1e5942){if(_0x1e5942){return _0x1e5942[_0xba13('0x26')](_0x54641d)[_0xba13('0x27')](function(_0xd7c4a){return _0xd7c4a;});}return null;};}function removeEntity(_0x3a38f,_0x57c077){return function(_0x1a33bb){if(_0x1a33bb){return _0x1a33bb[_0xba13('0x28')]()[_0xba13('0x27')](function(){_0x3a38f[_0xba13('0x1b')](0xcc)[_0xba13('0x1c')]();});}};}function handleEntityNotFound(_0x261569,_0x4fd47f){return function(_0x414b5e){if(!_0x414b5e){_0x261569[_0xba13('0x1a')](0x194);}return _0x414b5e;};}function handleError(_0x76787b,_0x30edf3){_0x30edf3=_0x30edf3||0x1f4;return function(_0x454cbc){logger[_0xba13('0x29')](_0x454cbc[_0xba13('0x2a')]);if(_0x454cbc['name']){delete _0x454cbc[_0xba13('0x2b')];}_0x76787b[_0xba13('0x1b')](_0x30edf3)[_0xba13('0x2c')](_0x454cbc);};}exports[_0xba13('0x2d')]=function(_0x5d4848,_0x23e0f9){var _0x4f000c={},_0x413e58={},_0x1adf15={'count':0x0,'rows':[]};var _0x34a104=_['map'](db['AnalyticTreeReport'][_0xba13('0x2e')],function(_0x42a165){return{'name':_0x42a165[_0xba13('0x2f')],'type':_0x42a165[_0xba13('0x30')]['key']};});_0x413e58['model']=_[_0xba13('0x31')](_0x34a104,_0xba13('0x2b'));_0x413e58['query']=_['keys'](_0x5d4848[_0xba13('0x32')]);_0x413e58[_0xba13('0x33')]=_[_0xba13('0x34')](_0x413e58[_0xba13('0x35')],_0x413e58['query']);_0x4f000c[_0xba13('0x36')]=_[_0xba13('0x34')](_0x413e58[_0xba13('0x35')],qs[_0xba13('0x37')](_0x5d4848[_0xba13('0x32')]['fields']));_0x4f000c[_0xba13('0x36')]=_0x4f000c[_0xba13('0x36')]['length']?_0x4f000c[_0xba13('0x36')]:_0x413e58[_0xba13('0x35')];if(!_0x5d4848[_0xba13('0x32')]['hasOwnProperty'](_0xba13('0x38'))){_0x4f000c[_0xba13('0x1f')]=qs['limit'](_0x5d4848[_0xba13('0x32')][_0xba13('0x1f')]);_0x4f000c['offset']=qs[_0xba13('0x1d')](_0x5d4848[_0xba13('0x32')][_0xba13('0x1d')]);}_0x4f000c[_0xba13('0x39')]=qs[_0xba13('0x3a')](_0x5d4848[_0xba13('0x32')]['sort']);_0x4f000c[_0xba13('0x3b')]=qs[_0xba13('0x33')](_[_0xba13('0x3c')](_0x5d4848['query'],_0x413e58['filters']),_0x34a104);if(_0x5d4848[_0xba13('0x32')][_0xba13('0x3d')]){_0x4f000c[_0xba13('0x3b')]=_[_0xba13('0x3e')](_0x4f000c[_0xba13('0x3b')],{'$or':_[_0xba13('0x31')](_0x34a104,function(_0x525711){if(_0x525711[_0xba13('0x30')]!==_0xba13('0x3f')){var _0x107a8c={};_0x107a8c[_0x525711['name']]={'$like':'%'+_0x5d4848[_0xba13('0x32')][_0xba13('0x3d')]+'%'};return _0x107a8c;}})});}_0x4f000c=_['merge']({},_0x4f000c,_0x5d4848[_0xba13('0x40')]);var _0x526dc4={'where':_0x4f000c[_0xba13('0x3b')]};return db['AnalyticTreeReport'][_0xba13('0x20')](_0x526dc4)[_0xba13('0x27')](function(_0x399147){_0x1adf15[_0xba13('0x20')]=_0x399147;if(_0x5d4848[_0xba13('0x32')][_0xba13('0x41')]){_0x4f000c[_0xba13('0x42')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x4f000c);})[_0xba13('0x27')](function(_0x19e7f4){_0x1adf15[_0xba13('0x43')]=_0x19e7f4;return _0x1adf15;})[_0xba13('0x27')](respondWithFilteredResult(_0x23e0f9,_0x4f000c))[_0xba13('0x44')](handleError(_0x23e0f9,null));};exports[_0xba13('0x45')]=function(_0x37f5e6,_0x251cfe){var _0x574911={'raw':!![],'where':{'id':_0x37f5e6[_0xba13('0x46')]['id']}},_0x12a667={};_0x12a667['model']=_['keys'](db[_0xba13('0x47')][_0xba13('0x2e')]);_0x12a667[_0xba13('0x32')]=_[_0xba13('0x48')](_0x37f5e6['query']);_0x12a667[_0xba13('0x33')]=_[_0xba13('0x34')](_0x12a667['model'],_0x12a667[_0xba13('0x32')]);_0x574911['attributes']=_[_0xba13('0x34')](_0x12a667[_0xba13('0x35')],qs[_0xba13('0x37')](_0x37f5e6[_0xba13('0x32')][_0xba13('0x37')]));_0x574911[_0xba13('0x36')]=_0x574911[_0xba13('0x36')]['length']?_0x574911[_0xba13('0x36')]:_0x12a667[_0xba13('0x35')];if(_0x37f5e6[_0xba13('0x32')][_0xba13('0x41')]){_0x574911['include']=[{'all':!![]}];}_0x574911=_[_0xba13('0x3e')]({},_0x574911,_0x37f5e6[_0xba13('0x40')]);return db['AnalyticTreeReport'][_0xba13('0x49')](_0x574911)[_0xba13('0x27')](handleEntityNotFound(_0x251cfe,null))['then'](respondWithResult(_0x251cfe,null))[_0xba13('0x44')](handleError(_0x251cfe,null));};exports[_0xba13('0x4a')]=function(_0x74039d,_0x387730){return db[_0xba13('0x47')][_0xba13('0x4a')](_0x74039d[_0xba13('0x4b')],{})[_0xba13('0x27')](respondWithResult(_0x387730,0xc9))[_0xba13('0x44')](handleError(_0x387730,null));};exports[_0xba13('0x26')]=function(_0x3a17f8,_0x375a60){if(_0x3a17f8[_0xba13('0x4b')]['id']){delete _0x3a17f8[_0xba13('0x4b')]['id'];}return db[_0xba13('0x47')][_0xba13('0x49')]({'where':{'id':_0x3a17f8['params']['id']}})['then'](handleEntityNotFound(_0x375a60,null))[_0xba13('0x27')](saveUpdates(_0x3a17f8[_0xba13('0x4b')],null))['then'](respondWithResult(_0x375a60,null))[_0xba13('0x44')](handleError(_0x375a60,null));};exports[_0xba13('0x28')]=function(_0x10e707,_0x229d0f){return db[_0xba13('0x47')][_0xba13('0x49')]({'where':{'id':_0x10e707[_0xba13('0x46')]['id']}})['then'](handleEntityNotFound(_0x229d0f,null))['then'](removeEntity(_0x229d0f,null))['catch'](handleError(_0x229d0f,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 25d6467..223caa8 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 _0xc3f7=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xc3f7,0x191));var _0x7c3f=function(_0x1e8fd2,_0x2ab84b){_0x1e8fd2=_0x1e8fd2-0x0;var _0x389a37=_0xc3f7[_0x1e8fd2];return _0x389a37;};'use strict';var _=require(_0x7c3f('0x0'));var util=require('util');var logger=require(_0x7c3f('0x1'))(_0x7c3f('0x2'));var moment=require('moment');var BPromise=require(_0x7c3f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c3f('0x4'));var rimraf=require(_0x7c3f('0x5'));var config=require(_0x7c3f('0x6'));var attributes=require(_0x7c3f('0x7'));module[_0x7c3f('0x8')]=function(_0x1f3446,_0x28db6f){return _0x1f3446[_0x7c3f('0x9')](_0x7c3f('0xa'),attributes,{'tableName':_0x7c3f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f79=['util','../../config/logger','api','request-promise','path','rimraf','exports','define','lodash'];(function(_0x2241f6,_0xb1cce9){var _0x199d95=function(_0x134215){while(--_0x134215){_0x2241f6['push'](_0x2241f6['shift']());}};_0x199d95(++_0xb1cce9);}(_0x2f79,0x194));var _0x92f7=function(_0x1c5ae6,_0x30f2bd){_0x1c5ae6=_0x1c5ae6-0x0;var _0x4623f3=_0x2f79[_0x1c5ae6];return _0x4623f3;};'use strict';var _=require(_0x92f7('0x0'));var util=require(_0x92f7('0x1'));var logger=require(_0x92f7('0x2'))(_0x92f7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x92f7('0x4'));var fs=require('fs');var path=require(_0x92f7('0x5'));var rimraf=require(_0x92f7('0x6'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x92f7('0x7')]=function(_0x4583da,_0x2475e6){return _0x4583da[_0x92f7('0x8')]('AnalyticTreeReport',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 93f5e35..67ee857 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x127fb5,_0xf08b53){var _0x2e966c=function(_0x57ea6e){while(--_0x57ea6e){_0x127fb5['push'](_0x127fb5['shift']());}};_0x2e966c(++_0xf08b53);}(_0x5f2f,0x73));var _0xf5f2=function(_0x22468b,_0x3871e6){_0x22468b=_0x22468b-0x0;var _0x18ba7f=_0x5f2f[_0x22468b];return _0x18ba7f;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x533439,_0x218a06){_0x533439=_0x533439-0x0;var _0xf75563=_0x7a54[_0x533439];return _0xf75563;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index d17fb8f..0a396c5 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 _0xe63b=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','put','/:id','delete'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0xe63b,0x146));var _0xbe63=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0xe63b[_0x2c0be1];return _0x3d4bd2;};'use strict';var multer=require(_0xbe63('0x0'));var util=require(_0xbe63('0x1'));var path=require(_0xbe63('0x2'));var timeout=require(_0xbe63('0x3'));var express=require(_0xbe63('0x4'));var router=express[_0xbe63('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbe63('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbe63('0x7'));var controller=require('./analyticTreeReport.controller');router[_0xbe63('0x8')]('/',auth[_0xbe63('0x9')](),controller[_0xbe63('0xa')]);router[_0xbe63('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbe63('0xb')]);router[_0xbe63('0xc')]('/',auth[_0xbe63('0x9')](),controller['create']);router[_0xbe63('0xd')](_0xbe63('0xe'),auth[_0xbe63('0x9')](),controller['update']);router[_0xbe63('0xf')](_0xbe63('0xe'),auth[_0xbe63('0x9')](),controller[_0xbe63('0x10')]);module[_0xbe63('0x11')]=router; \ No newline at end of file +var _0xc01c=['put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0xc01c,0xd4));var _0xcc01=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc01c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcc01('0x0'));var util=require(_0xcc01('0x1'));var path=require(_0xcc01('0x2'));var timeout=require(_0xcc01('0x3'));var express=require(_0xcc01('0x4'));var router=express['Router']();var fs_extra=require(_0xcc01('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcc01('0x6'));var config=require(_0xcc01('0x7'));var controller=require('./analyticTreeReport.controller');router[_0xcc01('0x8')]('/',auth[_0xcc01('0x9')](),controller['index']);router['get'](_0xcc01('0xa'),auth[_0xcc01('0x9')](),controller['show']);router[_0xcc01('0xb')]('/',auth[_0xcc01('0x9')](),controller['create']);router[_0xcc01('0xc')]('/:id',auth[_0xcc01('0x9')](),controller[_0xcc01('0xd')]);router[_0xcc01('0xe')](_0xcc01('0xa'),auth[_0xcc01('0x9')](),controller[_0xcc01('0xf')]);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 9c2ac7e..7cde43d 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 _0xd0bb=['exports','STRING','sequelize'];(function(_0x1a667b,_0x140ac0){var _0x15e22a=function(_0x4fb60c){while(--_0x4fb60c){_0x1a667b['push'](_0x1a667b['shift']());}};_0x15e22a(++_0x140ac0);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x4179e2,_0xf2dbb){_0x4179e2=_0x4179e2-0x0;var _0x24cb50=_0xd0bb[_0x4179e2];return _0x24cb50;};'use strict';var Sequelize=require(_0xbd0b('0x0'));module[_0xbd0b('0x1')]={'name':{'type':Sequelize[_0xbd0b('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbd0b('0x2')]}}; \ No newline at end of file +var _0xc831=['STRING','exports'];(function(_0x2bdd8d,_0xec359a){var _0x20f57e=function(_0x1af017){while(--_0x1af017){_0x2bdd8d['push'](_0x2bdd8d['shift']());}};_0x20f57e(++_0xec359a);}(_0xc831,0x103));var _0x1c83=function(_0x4cae1e,_0x3447fb){_0x4cae1e=_0x4cae1e-0x0;var _0x17210e=_0xc831[_0x4cae1e];return _0x17210e;};'use strict';var Sequelize=require('sequelize');module[_0x1c83('0x0')]={'name':{'type':Sequelize[_0x1c83('0x1')]},'basename':{'type':Sequelize[_0x1c83('0x1')]},'type':{'type':Sequelize[_0x1c83('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index e7f749a..e46aad8 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 _0xa2f8=['end','status','json','undefined','offset','count','apply','reject','save','update','destroy','error','stack','name','index','map','Attachment','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','options','then','catch','show','includeAll','include','find','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','mimetype','download','findOne','params','ChatOfflineMessageId','join','root','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x16fdf0,_0x5d4f60){var _0x55b60b=function(_0x50d574){while(--_0x50d574){_0x16fdf0['push'](_0x16fdf0['shift']());}};_0x55b60b(++_0x5d4f60);}(_0xa2f8,0x1f3));var _0x8a2f=function(_0x36fe69,_0x3c30d5){_0x36fe69=_0x36fe69-0x0;var _0x1f6171=_0xa2f8[_0x36fe69];return _0x1f6171;};'use strict';var emlformat=require(_0x8a2f('0x0'));var rimraf=require(_0x8a2f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8a2f('0x2'));var rp=require(_0x8a2f('0x3'));var moment=require(_0x8a2f('0x4'));var BPromise=require(_0x8a2f('0x5'));var Mustache=require(_0x8a2f('0x6'));var util=require(_0x8a2f('0x7'));var path=require(_0x8a2f('0x8'));var sox=require(_0x8a2f('0x9'));var csv=require('to-csv');var ejs=require(_0x8a2f('0xa'));var fs=require('fs');var fs_extra=require(_0x8a2f('0xb'));var _=require(_0x8a2f('0xc'));var squel=require(_0x8a2f('0xd'));var crypto=require('crypto');var jsforce=require(_0x8a2f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8a2f('0xf'));var querystring=require(_0x8a2f('0x10'));var Papa=require(_0x8a2f('0x11'));var Redis=require(_0x8a2f('0x12'));var authService=require(_0x8a2f('0x13'));var qs=require(_0x8a2f('0x14'));var as=require(_0x8a2f('0x15'));var hardwareService=require(_0x8a2f('0x16'));var logger=require(_0x8a2f('0x17'))(_0x8a2f('0x18'));var utils=require(_0x8a2f('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x8a2f('0x1a'));var db=require(_0x8a2f('0x1b'))['db'];function respondWithStatusCode(_0x5bf1a4,_0x2547df){_0x2547df=_0x2547df||0xcc;return function(_0x3f829c){if(_0x3f829c){return _0x5bf1a4[_0x8a2f('0x1c')](_0x2547df);}return _0x5bf1a4['status'](_0x2547df)[_0x8a2f('0x1d')]();};}function respondWithResult(_0x242f8f,_0x58b5f7){_0x58b5f7=_0x58b5f7||0xc8;return function(_0x386509){if(_0x386509){return _0x242f8f[_0x8a2f('0x1e')](_0x58b5f7)[_0x8a2f('0x1f')](_0x386509);}};}function respondWithFilteredResult(_0x35cbb2,_0x44264d){return function(_0x27566c){if(_0x27566c){var _0x1a0604=typeof _0x44264d['offset']===_0x8a2f('0x20')&&typeof _0x44264d['limit']===_0x8a2f('0x20');var _0x1b3f86=_0x27566c['count'];var _0x1ef6e1=_0x1a0604?0x0:_0x44264d[_0x8a2f('0x21')];var _0x283c73=_0x1a0604?_0x27566c[_0x8a2f('0x22')]:_0x44264d[_0x8a2f('0x21')]+_0x44264d['limit'];var _0x468703;if(_0x283c73>=_0x1b3f86){_0x283c73=_0x1b3f86;_0x468703=0xc8;}else{_0x468703=0xce;}_0x35cbb2['status'](_0x468703);return _0x35cbb2['set']('Content-Range',_0x1ef6e1+'-'+_0x283c73+'/'+_0x1b3f86)[_0x8a2f('0x1f')](_0x27566c);}return null;};}function patchUpdates(_0x38cd65){return function(_0x2c3606){try{jsonpatch[_0x8a2f('0x23')](_0x2c3606,_0x38cd65,!![]);}catch(_0x3d2124){return BPromise[_0x8a2f('0x24')](_0x3d2124);}return _0x2c3606[_0x8a2f('0x25')]();};}function saveUpdates(_0x377676,_0x2bbff4){return function(_0x4770ea){if(_0x4770ea){return _0x4770ea[_0x8a2f('0x26')](_0x377676)['then'](function(_0x5ec259){return _0x5ec259;});}return null;};}function removeEntity(_0x49c81e,_0x343493){return function(_0x5bb8c7){if(_0x5bb8c7){return _0x5bb8c7[_0x8a2f('0x27')]()['then'](function(){_0x49c81e[_0x8a2f('0x1e')](0xcc)[_0x8a2f('0x1d')]();});}};}function handleEntityNotFound(_0x5bbece,_0x47d9e2){return function(_0x50128e){if(!_0x50128e){_0x5bbece['sendStatus'](0x194);}return _0x50128e;};}function handleError(_0x35e392,_0x32fe45){_0x32fe45=_0x32fe45||0x1f4;return function(_0x3df697){logger[_0x8a2f('0x28')](_0x3df697[_0x8a2f('0x29')]);if(_0x3df697[_0x8a2f('0x2a')]){delete _0x3df697['name'];}_0x35e392['status'](_0x32fe45)['send'](_0x3df697);};}exports[_0x8a2f('0x2b')]=function(_0x4a185c,_0xf11e8){var _0xd06016={},_0x4f67da={},_0x188a1f={'count':0x0,'rows':[]};var _0x2fb300=_[_0x8a2f('0x2c')](db[_0x8a2f('0x2d')][_0x8a2f('0x2e')],function(_0x27ea9e){return{'name':_0x27ea9e['fieldName'],'type':_0x27ea9e[_0x8a2f('0x2f')][_0x8a2f('0x30')]};});_0x4f67da[_0x8a2f('0x31')]=_[_0x8a2f('0x2c')](_0x2fb300,'name');_0x4f67da[_0x8a2f('0x32')]=_[_0x8a2f('0x33')](_0x4a185c[_0x8a2f('0x32')]);_0x4f67da[_0x8a2f('0x34')]=_[_0x8a2f('0x35')](_0x4f67da['model'],_0x4f67da[_0x8a2f('0x32')]);_0xd06016[_0x8a2f('0x36')]=_[_0x8a2f('0x35')](_0x4f67da[_0x8a2f('0x31')],qs[_0x8a2f('0x37')](_0x4a185c['query'][_0x8a2f('0x37')]));_0xd06016['attributes']=_0xd06016[_0x8a2f('0x36')][_0x8a2f('0x38')]?_0xd06016[_0x8a2f('0x36')]:_0x4f67da[_0x8a2f('0x31')];if(!_0x4a185c[_0x8a2f('0x32')]['hasOwnProperty'](_0x8a2f('0x39'))){_0xd06016[_0x8a2f('0x3a')]=qs['limit'](_0x4a185c[_0x8a2f('0x32')]['limit']);_0xd06016[_0x8a2f('0x21')]=qs[_0x8a2f('0x21')](_0x4a185c['query'][_0x8a2f('0x21')]);}_0xd06016['order']=qs[_0x8a2f('0x3b')](_0x4a185c[_0x8a2f('0x32')][_0x8a2f('0x3b')]);_0xd06016[_0x8a2f('0x3c')]=qs['filters'](_[_0x8a2f('0x3d')](_0x4a185c[_0x8a2f('0x32')],_0x4f67da[_0x8a2f('0x34')]),_0x2fb300);if(_0x4a185c[_0x8a2f('0x32')][_0x8a2f('0x3e')]){_0xd06016['where']=_[_0x8a2f('0x3f')](_0xd06016[_0x8a2f('0x3c')],{'$or':_[_0x8a2f('0x2c')](_0x2fb300,function(_0x48a7c7){if(_0x48a7c7['type']!=='VIRTUAL'){var _0x79be68={};_0x79be68[_0x48a7c7['name']]={'$like':'%'+_0x4a185c[_0x8a2f('0x32')]['filter']+'%'};return _0x79be68;}})});}_0xd06016=_[_0x8a2f('0x3f')]({},_0xd06016,_0x4a185c[_0x8a2f('0x40')]);var _0x157693={'where':_0xd06016[_0x8a2f('0x3c')]};return db['Attachment'][_0x8a2f('0x22')](_0x157693)[_0x8a2f('0x41')](function(_0xc357b1){_0x188a1f['count']=_0xc357b1;if(_0x4a185c['query']['includeAll']){_0xd06016['include']=[{'all':!![]}];}return db['Attachment']['findAll'](_0xd06016);})[_0x8a2f('0x41')](function(_0x5ba0f3){_0x188a1f['rows']=_0x5ba0f3;return _0x188a1f;})[_0x8a2f('0x41')](respondWithFilteredResult(_0xf11e8,_0xd06016))[_0x8a2f('0x42')](handleError(_0xf11e8,null));};exports[_0x8a2f('0x43')]=function(_0x174662,_0x160c43){var _0x496ab6={'raw':!![],'where':{'id':_0x174662['params']['id']}},_0x17c6cd={};_0x17c6cd[_0x8a2f('0x31')]=_[_0x8a2f('0x33')](db['Attachment'][_0x8a2f('0x2e')]);_0x17c6cd[_0x8a2f('0x32')]=_[_0x8a2f('0x33')](_0x174662[_0x8a2f('0x32')]);_0x17c6cd[_0x8a2f('0x34')]=_[_0x8a2f('0x35')](_0x17c6cd[_0x8a2f('0x31')],_0x17c6cd['query']);_0x496ab6[_0x8a2f('0x36')]=_[_0x8a2f('0x35')](_0x17c6cd[_0x8a2f('0x31')],qs[_0x8a2f('0x37')](_0x174662[_0x8a2f('0x32')]['fields']));_0x496ab6[_0x8a2f('0x36')]=_0x496ab6['attributes']['length']?_0x496ab6[_0x8a2f('0x36')]:_0x17c6cd[_0x8a2f('0x31')];if(_0x174662[_0x8a2f('0x32')][_0x8a2f('0x44')]){_0x496ab6[_0x8a2f('0x45')]=[{'all':!![]}];}_0x496ab6=_[_0x8a2f('0x3f')]({},_0x496ab6,_0x174662[_0x8a2f('0x40')]);return db[_0x8a2f('0x2d')]['find'](_0x496ab6)['then'](handleEntityNotFound(_0x160c43,null))[_0x8a2f('0x41')](respondWithResult(_0x160c43,null))[_0x8a2f('0x42')](handleError(_0x160c43,null));};exports['clone']=function(_0x5a37de,_0x58df0b){var _0x2bb23c={'where':{'id':_0x5a37de['params']['id']}},_0x613ba={};_0x613ba[_0x8a2f('0x31')]=_[_0x8a2f('0x33')](db[_0x8a2f('0x2d')][_0x8a2f('0x2e')]);_0x2bb23c[_0x8a2f('0x36')]=_['intersection'](_0x613ba[_0x8a2f('0x31')],qs[_0x8a2f('0x37')](_0x5a37de[_0x8a2f('0x32')]['fields']));_0x2bb23c[_0x8a2f('0x36')]=_0x2bb23c[_0x8a2f('0x36')][_0x8a2f('0x38')]?_0x2bb23c[_0x8a2f('0x36')]:_0x613ba[_0x8a2f('0x31')];if(_0x5a37de[_0x8a2f('0x32')][_0x8a2f('0x44')]){_0x2bb23c[_0x8a2f('0x45')]=[{'all':!![]}];}_0x2bb23c=_[_0x8a2f('0x3f')]({},_0x2bb23c,_0x5a37de[_0x8a2f('0x40')]);return db[_0x8a2f('0x2d')][_0x8a2f('0x46')](_0x2bb23c)[_0x8a2f('0x41')](handleEntityNotFound(_0x58df0b,null))['then'](function(_0x2445ca){if(_0x2445ca){var _0x3bb1ae=_0x2445ca[_0x8a2f('0x47')]({'plain':!![]});_0x3bb1ae=qs[_0x8a2f('0x48')](_0x3bb1ae,['id',_0x8a2f('0x49'),_0x8a2f('0x4a')]);_0x5a37de[_0x8a2f('0x4b')]=_[_0x8a2f('0x48')](_0x5a37de[_0x8a2f('0x4b')],['id',_0x8a2f('0x49'),_0x8a2f('0x4a')]);return db[_0x8a2f('0x2d')][_0x8a2f('0x4c')](_['merge'](_0x3bb1ae,_0x5a37de['body']),{'include':_0x5a37de[_0x8a2f('0x32')][_0x8a2f('0x44')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x58df0b,0xc9))[_0x8a2f('0x42')](handleError(_0x58df0b,null));};exports[_0x8a2f('0x26')]=function(_0x51f591,_0x46200a){if(_0x51f591[_0x8a2f('0x4b')]['id']){delete _0x51f591[_0x8a2f('0x4b')]['id'];}return db['Attachment'][_0x8a2f('0x46')]({'where':{'id':_0x51f591['params']['id']}})[_0x8a2f('0x41')](handleEntityNotFound(_0x46200a,null))[_0x8a2f('0x41')](saveUpdates(_0x51f591['body'],null))[_0x8a2f('0x41')](respondWithResult(_0x46200a,null))[_0x8a2f('0x42')](handleError(_0x46200a,null));};exports['destroy']=function(_0x49e449,_0x20a710){return db['Attachment'][_0x8a2f('0x46')]({'where':{'id':_0x49e449['params']['id']}})[_0x8a2f('0x41')](handleEntityNotFound(_0x20a710,null))[_0x8a2f('0x41')](removeEntity(_0x20a710,null))[_0x8a2f('0x42')](handleError(_0x20a710,null));};exports[_0x8a2f('0x4c')]=function(_0x292d27,_0x448d7e,_0x93ca2f){_0x292d27[_0x8a2f('0x4b')]['name']=_0x292d27[_0x8a2f('0x4d')][_0x8a2f('0x4e')];_0x292d27[_0x8a2f('0x4b')][_0x8a2f('0x4f')]=_0x292d27[_0x8a2f('0x4d')]['filename'];_0x292d27['body'][_0x8a2f('0x2f')]=_0x292d27[_0x8a2f('0x4d')][_0x8a2f('0x50')];return db[_0x8a2f('0x2d')][_0x8a2f('0x4c')](_0x292d27['body'])[_0x8a2f('0x41')](respondWithResult(_0x448d7e,0xc9))[_0x8a2f('0x42')](handleError(_0x448d7e,null));};exports[_0x8a2f('0x51')]=function(_0x1810ea,_0x39c100,_0x52e548){return db[_0x8a2f('0x2d')][_0x8a2f('0x52')]({'where':{'id':_0x1810ea[_0x8a2f('0x53')]['id']},'raw':!![]})[_0x8a2f('0x41')](handleEntityNotFound(_0x39c100,null))['then'](function(_0x2515ac){if(_0x2515ac){var _0x4752f5=_0x2515ac[_0x8a2f('0x54')]!==null;var _0x2c3f7c=path[_0x8a2f('0x55')](config[_0x8a2f('0x56')],'server/files/attachments/');if(_0x4752f5){_0x2c3f7c=path[_0x8a2f('0x55')](_0x2c3f7c,_0x8a2f('0x57'));}var _0x5d01eb=path[_0x8a2f('0x55')](_0x2c3f7c,_0x2515ac[_0x8a2f('0x4f')]);return _0x39c100[_0x8a2f('0x51')](_0x5d01eb);}})['catch'](handleError(_0x39c100,null));}; \ No newline at end of file +var _0x6ba7=['rimraf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','Attachment','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','clone','omit','updatedAt','body','create','file','originalname','basename','type','mimetype','download','ChatOfflineMessageId','join','server/files/attachments/','eml-format'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6ba7,0x104));var _0x76ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6ba7[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x76ba('0x0'));var rimraf=require(_0x76ba('0x1'));var zipdir=require(_0x76ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x76ba('0x3'));var moment=require(_0x76ba('0x4'));var BPromise=require(_0x76ba('0x5'));var Mustache=require('mustache');var util=require(_0x76ba('0x6'));var path=require('path');var sox=require(_0x76ba('0x7'));var csv=require('to-csv');var ejs=require(_0x76ba('0x8'));var fs=require('fs');var fs_extra=require(_0x76ba('0x9'));var _=require(_0x76ba('0xa'));var squel=require(_0x76ba('0xb'));var crypto=require(_0x76ba('0xc'));var jsforce=require(_0x76ba('0xd'));var deskjs=require(_0x76ba('0xe'));var toCsv=require(_0x76ba('0xf'));var querystring=require(_0x76ba('0x10'));var Papa=require('papaparse');var Redis=require(_0x76ba('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x76ba('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76ba('0x13'));var logger=require(_0x76ba('0x14'))(_0x76ba('0x15'));var utils=require('../../config/utils');var config=require(_0x76ba('0x16'));var licenseUtil=require(_0x76ba('0x17'));var db=require(_0x76ba('0x18'))['db'];function respondWithStatusCode(_0x25b458,_0x32527e){_0x32527e=_0x32527e||0xcc;return function(_0xa76d59){if(_0xa76d59){return _0x25b458[_0x76ba('0x19')](_0x32527e);}return _0x25b458[_0x76ba('0x1a')](_0x32527e)[_0x76ba('0x1b')]();};}function respondWithResult(_0x50fcac,_0x37e39e){_0x37e39e=_0x37e39e||0xc8;return function(_0x50b759){if(_0x50b759){return _0x50fcac['status'](_0x37e39e)[_0x76ba('0x1c')](_0x50b759);}};}function respondWithFilteredResult(_0x4d2bbf,_0x2d7674){return function(_0x50263f){if(_0x50263f){var _0x2367ce=typeof _0x2d7674[_0x76ba('0x1d')]==='undefined'&&typeof _0x2d7674[_0x76ba('0x1e')]===_0x76ba('0x1f');var _0x5a61b0=_0x50263f['count'];var _0x447c8e=_0x2367ce?0x0:_0x2d7674[_0x76ba('0x1d')];var _0xab4a06=_0x2367ce?_0x50263f[_0x76ba('0x20')]:_0x2d7674[_0x76ba('0x1d')]+_0x2d7674['limit'];var _0x158510;if(_0xab4a06>=_0x5a61b0){_0xab4a06=_0x5a61b0;_0x158510=0xc8;}else{_0x158510=0xce;}_0x4d2bbf[_0x76ba('0x1a')](_0x158510);return _0x4d2bbf[_0x76ba('0x21')](_0x76ba('0x22'),_0x447c8e+'-'+_0xab4a06+'/'+_0x5a61b0)[_0x76ba('0x1c')](_0x50263f);}return null;};}function patchUpdates(_0x302c02){return function(_0x577816){try{jsonpatch[_0x76ba('0x23')](_0x577816,_0x302c02,!![]);}catch(_0x8b8cf7){return BPromise[_0x76ba('0x24')](_0x8b8cf7);}return _0x577816[_0x76ba('0x25')]();};}function saveUpdates(_0x7086e7,_0x3eb00f){return function(_0x25cd14){if(_0x25cd14){return _0x25cd14[_0x76ba('0x26')](_0x7086e7)['then'](function(_0x4614f5){return _0x4614f5;});}return null;};}function removeEntity(_0x4656a0,_0x3c92d7){return function(_0x544321){if(_0x544321){return _0x544321[_0x76ba('0x27')]()[_0x76ba('0x28')](function(){_0x4656a0[_0x76ba('0x1a')](0xcc)[_0x76ba('0x1b')]();});}};}function handleEntityNotFound(_0x1da710,_0x510a5e){return function(_0x256449){if(!_0x256449){_0x1da710[_0x76ba('0x19')](0x194);}return _0x256449;};}function handleError(_0x9022d7,_0x539be1){_0x539be1=_0x539be1||0x1f4;return function(_0x35f426){logger[_0x76ba('0x29')](_0x35f426['stack']);if(_0x35f426[_0x76ba('0x2a')]){delete _0x35f426[_0x76ba('0x2a')];}_0x9022d7[_0x76ba('0x1a')](_0x539be1)[_0x76ba('0x2b')](_0x35f426);};}exports[_0x76ba('0x2c')]=function(_0x282a98,_0x2354c5){var _0x1ec408={},_0x59c6bc={},_0x5af678={'count':0x0,'rows':[]};var _0xf5dd30=_[_0x76ba('0x2d')](db[_0x76ba('0x2e')][_0x76ba('0x2f')],function(_0x156576){return{'name':_0x156576[_0x76ba('0x30')],'type':_0x156576['type']['key']};});_0x59c6bc[_0x76ba('0x31')]=_[_0x76ba('0x2d')](_0xf5dd30,'name');_0x59c6bc[_0x76ba('0x32')]=_[_0x76ba('0x33')](_0x282a98[_0x76ba('0x32')]);_0x59c6bc[_0x76ba('0x34')]=_[_0x76ba('0x35')](_0x59c6bc[_0x76ba('0x31')],_0x59c6bc[_0x76ba('0x32')]);_0x1ec408[_0x76ba('0x36')]=_['intersection'](_0x59c6bc['model'],qs[_0x76ba('0x37')](_0x282a98['query'][_0x76ba('0x37')]));_0x1ec408[_0x76ba('0x36')]=_0x1ec408['attributes']['length']?_0x1ec408['attributes']:_0x59c6bc[_0x76ba('0x31')];if(!_0x282a98[_0x76ba('0x32')][_0x76ba('0x38')](_0x76ba('0x39'))){_0x1ec408[_0x76ba('0x1e')]=qs[_0x76ba('0x1e')](_0x282a98[_0x76ba('0x32')][_0x76ba('0x1e')]);_0x1ec408[_0x76ba('0x1d')]=qs[_0x76ba('0x1d')](_0x282a98[_0x76ba('0x32')]['offset']);}_0x1ec408['order']=qs[_0x76ba('0x3a')](_0x282a98['query'][_0x76ba('0x3a')]);_0x1ec408[_0x76ba('0x3b')]=qs[_0x76ba('0x34')](_[_0x76ba('0x3c')](_0x282a98[_0x76ba('0x32')],_0x59c6bc['filters']),_0xf5dd30);if(_0x282a98[_0x76ba('0x32')][_0x76ba('0x3d')]){_0x1ec408[_0x76ba('0x3b')]=_[_0x76ba('0x3e')](_0x1ec408[_0x76ba('0x3b')],{'$or':_[_0x76ba('0x2d')](_0xf5dd30,function(_0x81f828){if(_0x81f828['type']!=='VIRTUAL'){var _0x1bf4d1={};_0x1bf4d1[_0x81f828[_0x76ba('0x2a')]]={'$like':'%'+_0x282a98[_0x76ba('0x32')]['filter']+'%'};return _0x1bf4d1;}})});}_0x1ec408=_['merge']({},_0x1ec408,_0x282a98['options']);var _0x31e43e={'where':_0x1ec408[_0x76ba('0x3b')]};return db[_0x76ba('0x2e')]['count'](_0x31e43e)[_0x76ba('0x28')](function(_0x369a40){_0x5af678[_0x76ba('0x20')]=_0x369a40;if(_0x282a98[_0x76ba('0x32')][_0x76ba('0x3f')]){_0x1ec408[_0x76ba('0x40')]=[{'all':!![]}];}return db[_0x76ba('0x2e')][_0x76ba('0x41')](_0x1ec408);})['then'](function(_0x2f6cfa){_0x5af678[_0x76ba('0x42')]=_0x2f6cfa;return _0x5af678;})[_0x76ba('0x28')](respondWithFilteredResult(_0x2354c5,_0x1ec408))[_0x76ba('0x43')](handleError(_0x2354c5,null));};exports[_0x76ba('0x44')]=function(_0x1879d1,_0x44c8be){var _0x364eab={'raw':!![],'where':{'id':_0x1879d1[_0x76ba('0x45')]['id']}},_0x5d4092={};_0x5d4092[_0x76ba('0x31')]=_['keys'](db[_0x76ba('0x2e')][_0x76ba('0x2f')]);_0x5d4092[_0x76ba('0x32')]=_[_0x76ba('0x33')](_0x1879d1[_0x76ba('0x32')]);_0x5d4092['filters']=_['intersection'](_0x5d4092[_0x76ba('0x31')],_0x5d4092[_0x76ba('0x32')]);_0x364eab[_0x76ba('0x36')]=_['intersection'](_0x5d4092['model'],qs[_0x76ba('0x37')](_0x1879d1[_0x76ba('0x32')][_0x76ba('0x37')]));_0x364eab['attributes']=_0x364eab[_0x76ba('0x36')][_0x76ba('0x46')]?_0x364eab[_0x76ba('0x36')]:_0x5d4092['model'];if(_0x1879d1[_0x76ba('0x32')]['includeAll']){_0x364eab['include']=[{'all':!![]}];}_0x364eab=_[_0x76ba('0x3e')]({},_0x364eab,_0x1879d1[_0x76ba('0x47')]);return db[_0x76ba('0x2e')][_0x76ba('0x48')](_0x364eab)[_0x76ba('0x28')](handleEntityNotFound(_0x44c8be,null))[_0x76ba('0x28')](respondWithResult(_0x44c8be,null))[_0x76ba('0x43')](handleError(_0x44c8be,null));};exports[_0x76ba('0x49')]=function(_0x413a40,_0x3d2a1f){var _0x1b20a3={'where':{'id':_0x413a40[_0x76ba('0x45')]['id']}},_0x53ecd8={};_0x53ecd8[_0x76ba('0x31')]=_[_0x76ba('0x33')](db[_0x76ba('0x2e')][_0x76ba('0x2f')]);_0x1b20a3['attributes']=_['intersection'](_0x53ecd8['model'],qs[_0x76ba('0x37')](_0x413a40[_0x76ba('0x32')][_0x76ba('0x37')]));_0x1b20a3[_0x76ba('0x36')]=_0x1b20a3['attributes'][_0x76ba('0x46')]?_0x1b20a3[_0x76ba('0x36')]:_0x53ecd8['model'];if(_0x413a40[_0x76ba('0x32')][_0x76ba('0x3f')]){_0x1b20a3[_0x76ba('0x40')]=[{'all':!![]}];}_0x1b20a3=_[_0x76ba('0x3e')]({},_0x1b20a3,_0x413a40[_0x76ba('0x47')]);return db[_0x76ba('0x2e')][_0x76ba('0x48')](_0x1b20a3)[_0x76ba('0x28')](handleEntityNotFound(_0x3d2a1f,null))[_0x76ba('0x28')](function(_0x1fc6fd){if(_0x1fc6fd){var _0x3fc834=_0x1fc6fd['get']({'plain':!![]});_0x3fc834=qs[_0x76ba('0x4a')](_0x3fc834,['id','createdAt',_0x76ba('0x4b')]);_0x413a40['body']=_[_0x76ba('0x4a')](_0x413a40[_0x76ba('0x4c')],['id','createdAt',_0x76ba('0x4b')]);return db['Attachment'][_0x76ba('0x4d')](_[_0x76ba('0x3e')](_0x3fc834,_0x413a40[_0x76ba('0x4c')]),{'include':_0x413a40[_0x76ba('0x32')][_0x76ba('0x3f')]?[{'all':!![]}]:undefined});}})[_0x76ba('0x28')](respondWithResult(_0x3d2a1f,0xc9))[_0x76ba('0x43')](handleError(_0x3d2a1f,null));};exports[_0x76ba('0x26')]=function(_0x30f34b,_0x50fdf1){if(_0x30f34b[_0x76ba('0x4c')]['id']){delete _0x30f34b[_0x76ba('0x4c')]['id'];}return db[_0x76ba('0x2e')][_0x76ba('0x48')]({'where':{'id':_0x30f34b[_0x76ba('0x45')]['id']}})['then'](handleEntityNotFound(_0x50fdf1,null))[_0x76ba('0x28')](saveUpdates(_0x30f34b[_0x76ba('0x4c')],null))[_0x76ba('0x28')](respondWithResult(_0x50fdf1,null))[_0x76ba('0x43')](handleError(_0x50fdf1,null));};exports[_0x76ba('0x27')]=function(_0x2fbaeb,_0x18ec07){return db[_0x76ba('0x2e')][_0x76ba('0x48')]({'where':{'id':_0x2fbaeb[_0x76ba('0x45')]['id']}})[_0x76ba('0x28')](handleEntityNotFound(_0x18ec07,null))[_0x76ba('0x28')](removeEntity(_0x18ec07,null))[_0x76ba('0x43')](handleError(_0x18ec07,null));};exports[_0x76ba('0x4d')]=function(_0xf439a3,_0xb996eb,_0x344ea7){_0xf439a3[_0x76ba('0x4c')][_0x76ba('0x2a')]=_0xf439a3[_0x76ba('0x4e')][_0x76ba('0x4f')];_0xf439a3[_0x76ba('0x4c')][_0x76ba('0x50')]=_0xf439a3[_0x76ba('0x4e')]['filename'];_0xf439a3[_0x76ba('0x4c')][_0x76ba('0x51')]=_0xf439a3[_0x76ba('0x4e')][_0x76ba('0x52')];return db[_0x76ba('0x2e')][_0x76ba('0x4d')](_0xf439a3[_0x76ba('0x4c')])['then'](respondWithResult(_0xb996eb,0xc9))[_0x76ba('0x43')](handleError(_0xb996eb,null));};exports[_0x76ba('0x53')]=function(_0x19bd7b,_0x4cecd3,_0x60a5b1){return db[_0x76ba('0x2e')]['findOne']({'where':{'id':_0x19bd7b['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4cecd3,null))[_0x76ba('0x28')](function(_0x5d1993){if(_0x5d1993){var _0x13e70f=_0x5d1993[_0x76ba('0x54')]!==null;var _0x1b3a1c=path[_0x76ba('0x55')](config['root'],_0x76ba('0x56'));if(_0x13e70f){_0x1b3a1c=path[_0x76ba('0x55')](_0x1b3a1c,'offline-chat/');}var _0x2c093d=path['join'](_0x1b3a1c,_0x5d1993['basename']);return _0x4cecd3['download'](_0x2c093d);}})[_0x76ba('0x43')](handleError(_0x4cecd3,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 655820d..bcf6cc9 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 _0x9cfb=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','lodash','util'];(function(_0x58ebbf,_0x895e78){var _0x28a1ad=function(_0xc2f1ff){while(--_0xc2f1ff){_0x58ebbf['push'](_0x58ebbf['shift']());}};_0x28a1ad(++_0x895e78);}(_0x9cfb,0x98));var _0xb9cf=function(_0x58a2d5,_0xae8a3e){_0x58a2d5=_0x58a2d5-0x0;var _0xd65b4a=_0x9cfb[_0x58a2d5];return _0xd65b4a;};'use strict';var _=require(_0xb9cf('0x0'));var util=require(_0xb9cf('0x1'));var logger=require(_0xb9cf('0x2'))(_0xb9cf('0x3'));var moment=require(_0xb9cf('0x4'));var BPromise=require(_0xb9cf('0x5'));var rp=require(_0xb9cf('0x6'));var fs=require('fs');var path=require(_0xb9cf('0x7'));var rimraf=require(_0xb9cf('0x8'));var config=require(_0xb9cf('0x9'));var attributes=require(_0xb9cf('0xa'));module[_0xb9cf('0xb')]=function(_0x20fb15,_0x43dac8){return _0x20fb15[_0xb9cf('0xc')](_0xb9cf('0xd'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48d7=['api','moment','bluebird','request-promise','../../config/environment','define','Attachment','util'];(function(_0x538f18,_0x3f3236){var _0x1d72d4=function(_0x177255){while(--_0x177255){_0x538f18['push'](_0x538f18['shift']());}};_0x1d72d4(++_0x3f3236);}(_0x48d7,0x1a7));var _0x748d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x48d7[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0x748d('0x0'));var logger=require('../../config/logger')(_0x748d('0x1'));var moment=require(_0x748d('0x2'));var BPromise=require(_0x748d('0x3'));var rp=require(_0x748d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x748d('0x5'));var attributes=require('./attachment.attributes');module['exports']=function(_0x47e22a,_0x1eca71){return _0x47e22a[_0x748d('0x6')](_0x748d('0x7'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 7af7457..b9a6f7d 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 _0x0a9a=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','CreateAttachment','Attachment','create','body','options','raw','debug','util','bluebird','randomstring'];(function(_0x168564,_0x44a949){var _0x13483e=function(_0x34ee2d){while(--_0x34ee2d){_0x168564['push'](_0x168564['shift']());}};_0x13483e(++_0x44a949);}(_0x0a9a,0x183));var _0xa0a9=function(_0xf308b6,_0x37a144){_0xf308b6=_0xf308b6-0x0;var _0x145dd6=_0x0a9a[_0xf308b6];return _0x145dd6;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31d689,_0x499a29,_0x2b2eb4){return new BPromise(function(_0x520f42,_0x10aa8a){return client[_0xa0a9('0xa')](_0x31d689,_0x2b2eb4)[_0xa0a9('0xb')](function(_0x2d6ac0){logger['info'](_0xa0a9('0xc'),_0x499a29,_0xa0a9('0xd'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x499a29,_0xa0a9('0xd'),JSON[_0xa0a9('0xe')](_0x2d6ac0));if(_0x2d6ac0['error']){if(_0x2d6ac0[_0xa0a9('0xf')]['code']===0x1f4){logger[_0xa0a9('0xf')]('Attachment,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x10aa8a(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}logger[_0xa0a9('0xf')]('Attachment,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x520f42(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}else{logger[_0xa0a9('0x11')](_0xa0a9('0xc'),_0x499a29,'request\x20sent');_0x520f42(_0x2d6ac0[_0xa0a9('0x12')]['message']);}})['catch'](function(_0x347092){logger[_0xa0a9('0xf')](_0xa0a9('0xc'),_0x499a29,_0x347092);_0x10aa8a(_0x347092);});});}exports[_0xa0a9('0x13')]=function(_0x568409){var _0x320735=this;return new Promise(function(_0x126401,_0x33eb8f){return db[_0xa0a9('0x14')][_0xa0a9('0x15')](_0x568409[_0xa0a9('0x16')],{'raw':_0x568409['options']?_0x568409[_0xa0a9('0x17')][_0xa0a9('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x53b99d){logger[_0xa0a9('0x11')](_0xa0a9('0x13'),_0x568409);logger[_0xa0a9('0x19')]('CreateAttachment',_0x568409,JSON[_0xa0a9('0xe')](_0x53b99d));_0x126401(_0x53b99d);})['catch'](function(_0x1fb36b){logger['error'](_0xa0a9('0x13'),_0x1fb36b[_0xa0a9('0x10')],_0x568409);_0x33eb8f(_0x320735[_0xa0a9('0xf')](0x1f4,_0x1fb36b[_0xa0a9('0x10')]));});});}; \ No newline at end of file +var _0xfd2f=['rpc','../../config/environment','then','info','Attachment,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','CreateAttachment','Attachment','create','body','raw','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x31d91a,_0x3fa4bb){var _0xf9398c=function(_0x3e6149){while(--_0x3e6149){_0x31d91a['push'](_0x31d91a['shift']());}};_0xf9398c(++_0x3fa4bb);}(_0xfd2f,0x14a));var _0xffd2=function(_0x4bf20d,_0x188fa2){_0x4bf20d=_0x4bf20d-0x0;var _0x5ffdca=_0xfd2f[_0x4bf20d];return _0x5ffdca;};'use strict';var _=require(_0xffd2('0x0'));var util=require(_0xffd2('0x1'));var moment=require(_0xffd2('0x2'));var BPromise=require('bluebird');var rs=require(_0xffd2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffd2('0x4'))['db'];var utils=require(_0xffd2('0x5'));var logger=require('../../config/logger')(_0xffd2('0x6'));var config=require(_0xffd2('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd5e752,_0x2074e0,_0x56a1e2){return new BPromise(function(_0x35d327,_0x5b24ca){return client['request'](_0xd5e752,_0x56a1e2)[_0xffd2('0x8')](function(_0x15e33f){logger[_0xffd2('0x9')](_0xffd2('0xa'),_0x2074e0,'request\x20sent');logger[_0xffd2('0xb')]('Attachment,\x20%s,\x20%s,\x20%s',_0x2074e0,'request\x20sent',JSON['stringify'](_0x15e33f));if(_0x15e33f[_0xffd2('0xc')]){if(_0x15e33f[_0xffd2('0xc')][_0xffd2('0xd')]===0x1f4){logger[_0xffd2('0xc')](_0xffd2('0xa'),_0x2074e0,_0x15e33f[_0xffd2('0xc')][_0xffd2('0xe')]);return _0x5b24ca(_0x15e33f['error']['message']);}logger['error']('Attachment,\x20%s,\x20%s',_0x2074e0,_0x15e33f[_0xffd2('0xc')][_0xffd2('0xe')]);return _0x35d327(_0x15e33f['error'][_0xffd2('0xe')]);}else{logger[_0xffd2('0x9')](_0xffd2('0xa'),_0x2074e0,_0xffd2('0xf'));_0x35d327(_0x15e33f[_0xffd2('0x10')][_0xffd2('0xe')]);}})[_0xffd2('0x11')](function(_0x132d38){logger[_0xffd2('0xc')]('Attachment,\x20%s,\x20%s',_0x2074e0,_0x132d38);_0x5b24ca(_0x132d38);});});}exports[_0xffd2('0x12')]=function(_0x1f3c23){var _0x214737=this;return new Promise(function(_0x53f6e6,_0x2b2f71){return db[_0xffd2('0x13')][_0xffd2('0x14')](_0x1f3c23[_0xffd2('0x15')],{'raw':_0x1f3c23['options']?_0x1f3c23['options'][_0xffd2('0x16')]===undefined?!![]:![]:!![]})[_0xffd2('0x8')](function(_0x40a88c){logger['info'](_0xffd2('0x12'),_0x1f3c23);logger['debug'](_0xffd2('0x12'),_0x1f3c23,JSON[_0xffd2('0x17')](_0x40a88c));_0x53f6e6(_0x40a88c);})['catch'](function(_0x3ed47f){logger[_0xffd2('0xc')](_0xffd2('0x12'),_0x3ed47f[_0xffd2('0xe')],_0x1f3c23);_0x2b2f71(_0x214737[_0xffd2('0xc')](0x1f4,_0x3ed47f[_0xffd2('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 343b7df..ae0a703 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 _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x4cc991,_0x11b2e0){var _0x42980e=function(_0x1caa9f){while(--_0x1caa9f){_0x4cc991['push'](_0x4cc991['shift']());}};_0x42980e(++_0x11b2e0);}(_0xadb5,0xad));var _0x5adb=function(_0x1102c1,_0x102f80){_0x1102c1=_0x1102c1-0x0;var _0x106aa0=_0xadb5[_0x1102c1];return _0x106aa0;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file +var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x547e20,_0x284545){_0x547e20=_0x547e20-0x0;var _0x359171=_0x0b0e[_0x547e20];return _0x359171;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 7aee088..f20b19d 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 _0x089a=['../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','disabled','blocked','blockedAt','online','admin','user','blockDuration','minutes','clearBlockUser','getLicense','catch','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','ad-login','User','passport','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb'];(function(_0x51f784,_0x3af0c1){var _0x1a9dc9=function(_0x7f2c4e){while(--_0x7f2c4e){_0x51f784['push'](_0x51f784['shift']());}};_0x1a9dc9(++_0x3af0c1);}(_0x089a,0xb5));var _0xa089=function(_0x1cf9c2,_0x2d8052){_0x1cf9c2=_0x1cf9c2-0x0;var _0x2ec6e9=_0x089a[_0x1cf9c2];return _0x2ec6e9;};'use strict';var passport=require(_0xa089('0x0'));var LocalStrategy=require('passport-local')[_0xa089('0x1')];var moment=require(_0xa089('0x2'));var ActiveDirectory=require(_0xa089('0x3'));var BPromise=require(_0xa089('0x4'));var util=require(_0xa089('0x5'));var db=require(_0xa089('0x6'))['db'];var authService=require(_0xa089('0x7'));var utils=require('../../config/utils');var config=require(_0xa089('0x8'));var logger=require(_0xa089('0x9'))(_0xa089('0xa'));function isActiveDirectoryConfigured(_0x16f617){var _0x44ba92=![];if(typeof _0x16f617[_0xa089('0xb')]!==_0xa089('0xc')){_0x44ba92=_0x16f617[_0xa089('0xb')][_0xa089('0xd')]&&_0x16f617[_0xa089('0xb')][_0xa089('0xe')]&&_0x16f617[_0xa089('0xb')][_0xa089('0xf')];}return _0x44ba92;}function adAuthenticate(_0x1cc6df,_0x10f93c,_0x2b38b7){return new BPromise(function(_0x227ea0,_0x4c2008){try{var _0x35c66d=new ActiveDirectory(_0x1cc6df);_0x35c66d[_0xa089('0x10')](_0x10f93c,_0x2b38b7,function(_0x245c83,_0x192694){if(_0x245c83){logger['error'](_0xa089('0x11'),_0x10f93c,util[_0xa089('0x12')](_0x245c83,{'showHidden':![],'depth':null}));_0x4c2008(_0xa089('0x13'));}else if(!_0x192694){logger[_0xa089('0x14')](_0xa089('0x15'),_0x10f93c);_0x4c2008('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x227ea0(_0x192694);}});}catch(_0xced1eb){_0x4c2008(_0xced1eb);}});}function ActiveDirectoryAuthenticate(_0x3461b0,_0x1842fe,_0x3007ca,_0x446fb8){var _0x263471,_0x353148;if(!isActiveDirectoryConfigured(config)){logger[_0xa089('0x14')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x1842fe);return _0x446fb8(null,![],{'message':_0xa089('0x13')});}return db[_0xa089('0x16')][_0xa089('0x17')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})[_0xa089('0x18')](function(_0x26469f){_0x263471=_0x26469f;if(!_0x263471[_0xa089('0x19')]){logger['error'](_0xa089('0x1a'),_0x1842fe);throw new Error(_0xa089('0x13'));}return _0x3461b0[_0xa089('0x17')]({'attributes':['id',_0xa089('0x1b'),_0xa089('0x1c'),'salt','role',_0xa089('0x1d'),_0xa089('0x1e'),_0xa089('0x1f'),_0xa089('0x20')],'where':{'name':_0x1842fe,'role':{'$or':[_0xa089('0x21'),_0xa089('0x22'),'agent']},'adSsoEnabled':!![]}});})[_0xa089('0x18')](function(_0x4d3c50){if(!_0x4d3c50||_0x4d3c50&&_0x4d3c50[_0xa089('0x1b')]!==_0x1842fe){throw new Error(_0xa089('0x13'));}_0x353148=_0x4d3c50;var _0x47a23b=_0x353148[_0xa089('0x1b')]+'@'+config[_0xa089('0xb')][_0xa089('0xf')];return adAuthenticate(config[_0xa089('0xb')],_0x47a23b,_0x3007ca);})[_0xa089('0x18')](function(_0x46122c){if(_0x353148[_0xa089('0x1d')]){throw new Error(_0xa089('0x13'));}if(_0x263471[_0xa089('0x23')]>0x0){if(_0x353148['blocked']){if(moment(_0x353148[_0xa089('0x1f')])['add'](_0x263471[_0xa089('0x23')],_0xa089('0x24'))>moment()){throw new Error(_0xa089('0x13'));}return utils[_0xa089('0x25')](_0x353148,0x0,![],null)['then'](function(){return utils[_0xa089('0x26')](_0x353148);})[_0xa089('0x18')](function(){return _0x446fb8(null,_0x353148);});}else{return utils[_0xa089('0x26')](_0x353148)[_0xa089('0x18')](function(){return _0x446fb8(null,_0x353148);});}}else{return utils['getLicense'](_0x353148)[_0xa089('0x18')](function(){return _0x446fb8(null,_0x353148);});}})[_0xa089('0x27')](function(_0xf186cc){return _0x446fb8(null,![],_0xf186cc);});}function handleError(_0x132837,_0x7c22c6,_0x1e0bd9){return _0x132837['status'](_0x7c22c6||0x1f4)['send']({'message':_0x1e0bd9?_0x1e0bd9[_0xa089('0x28')]||_0x1e0bd9:''});}exports[_0xa089('0x29')]=function(_0x2d7e65,_0x4ba2d5,_0x45a78f){passport[_0xa089('0x10')]('ad-login',function(_0x1d844f,_0x2765cd,_0x13522c){var _0xaf47ad=_0x1d844f||_0x13522c;if(_0xaf47ad){return handleError(_0x4ba2d5,0x191,_0xaf47ad);}if(!_0x2765cd){return handleError(_0x4ba2d5,0x194,{'message':_0xa089('0x2a')});}else{var _0x5b2477={'payload':{'id':_0x2765cd['id'],'role':_0x2765cd[_0xa089('0x2b')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5b2477)[_0xa089('0x18')](function(_0x4e4100){_0x4ba2d5[_0xa089('0x2c')]({'id':_0x2765cd['id'],'token':_0x4e4100,'statusCall':'','isAlreadyLogged':_0x2765cd['online']});});}})(_0x2d7e65,_0x4ba2d5,_0x45a78f);};passport['use'](_0xa089('0x2d'),new LocalStrategy({'usernameField':_0xa089('0x1b'),'passwordField':_0xa089('0x1c')},function(_0x2f036f,_0x2b71e7,_0x5a56d3){return ActiveDirectoryAuthenticate(db[_0xa089('0x2e')],_0x2f036f,_0x2b71e7,_0x5a56d3);})); \ No newline at end of file +var _0xf7ec=['password','salt','blocked','blockedAt','admin','user','agent','name','disabled','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','online','User','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/logger','api','activedirectory','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled'];(function(_0x40b66c,_0x5c1d58){var _0x159671=function(_0x17a129){while(--_0x17a129){_0x40b66c['push'](_0x40b66c['shift']());}};_0x159671(++_0x5c1d58);}(_0xf7ec,0x1cc));var _0xcf7e=function(_0x19a61d,_0x55d5da){_0x19a61d=_0x19a61d-0x0;var _0xe7b18a=_0xf7ec[_0x19a61d];return _0xe7b18a;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xcf7e('0x0'))[_0xcf7e('0x1')];var moment=require('moment');var ActiveDirectory=require(_0xcf7e('0x2'));var BPromise=require(_0xcf7e('0x3'));var util=require(_0xcf7e('0x4'));var db=require(_0xcf7e('0x5'))['db'];var authService=require(_0xcf7e('0x6'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0xcf7e('0x7'))(_0xcf7e('0x8'));function isActiveDirectoryConfigured(_0x145528){var _0x447bd5=![];if(typeof _0x145528[_0xcf7e('0x9')]!=='undefined'){_0x447bd5=_0x145528[_0xcf7e('0x9')]['baseDN']&&_0x145528[_0xcf7e('0x9')][_0xcf7e('0xa')]&&_0x145528[_0xcf7e('0x9')][_0xcf7e('0xb')];}return _0x447bd5;}function adAuthenticate(_0x49456c,_0x432008,_0x4507f2){return new BPromise(function(_0x32da64,_0x177833){try{var _0xa00508=new ActiveDirectory(_0x49456c);_0xa00508[_0xcf7e('0xc')](_0x432008,_0x4507f2,function(_0x101aca,_0x313f2c){if(_0x101aca){logger[_0xcf7e('0xd')](_0xcf7e('0xe'),_0x432008,util['inspect'](_0x101aca,{'showHidden':![],'depth':null}));_0x177833(_0xcf7e('0xf'));}else if(!_0x313f2c){logger['error'](_0xcf7e('0x10'),_0x432008);_0x177833(_0xcf7e('0xf'));}else{_0x32da64(_0x313f2c);}});}catch(_0x3d583e){_0x177833(_0x3d583e);}});}function ActiveDirectoryAuthenticate(_0x2368e4,_0x17bdc5,_0xe3b2fc,_0x51e391){var _0x243f54,_0x37872f;if(!isActiveDirectoryConfigured(config)){logger[_0xcf7e('0xd')](_0xcf7e('0x11'),_0x17bdc5);return _0x51e391(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xcf7e('0x12')][_0xcf7e('0x13')]({'where':{'id':0x1},'attributes':[_0xcf7e('0x14'),_0xcf7e('0x15')],'raw':!![]})[_0xcf7e('0x16')](function(_0xbae394){_0x243f54=_0xbae394;if(!_0x243f54[_0xcf7e('0x14')]){logger['error'](_0xcf7e('0x17'),_0x17bdc5);throw new Error(_0xcf7e('0xf'));}return _0x2368e4[_0xcf7e('0x13')]({'attributes':['id','name',_0xcf7e('0x18'),_0xcf7e('0x19'),'role','disabled',_0xcf7e('0x1a'),_0xcf7e('0x1b'),'online'],'where':{'name':_0x17bdc5,'role':{'$or':[_0xcf7e('0x1c'),_0xcf7e('0x1d'),_0xcf7e('0x1e')]},'adSsoEnabled':!![]}});})[_0xcf7e('0x16')](function(_0x1dfd02){if(!_0x1dfd02||_0x1dfd02&&_0x1dfd02['name']!==_0x17bdc5){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x37872f=_0x1dfd02;var _0x2563e4=_0x37872f[_0xcf7e('0x1f')]+'@'+config['activedirectory'][_0xcf7e('0xb')];return adAuthenticate(config[_0xcf7e('0x9')],_0x2563e4,_0xe3b2fc);})[_0xcf7e('0x16')](function(_0x35e888){if(_0x37872f[_0xcf7e('0x20')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x243f54[_0xcf7e('0x15')]>0x0){if(_0x37872f[_0xcf7e('0x1a')]){if(moment(_0x37872f[_0xcf7e('0x1b')])['add'](_0x243f54[_0xcf7e('0x15')],_0xcf7e('0x21'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xcf7e('0x22')](_0x37872f,0x0,![],null)[_0xcf7e('0x16')](function(){return utils['getLicense'](_0x37872f);})[_0xcf7e('0x16')](function(){return _0x51e391(null,_0x37872f);});}else{return utils['getLicense'](_0x37872f)['then'](function(){return _0x51e391(null,_0x37872f);});}}else{return utils[_0xcf7e('0x23')](_0x37872f)['then'](function(){return _0x51e391(null,_0x37872f);});}})[_0xcf7e('0x24')](function(_0x35769f){return _0x51e391(null,![],_0x35769f);});}function handleError(_0x3d6725,_0x5143be,_0x2157ba){return _0x3d6725[_0xcf7e('0x25')](_0x5143be||0x1f4)[_0xcf7e('0x26')]({'message':_0x2157ba?_0x2157ba[_0xcf7e('0x27')]||_0x2157ba:''});}exports[_0xcf7e('0x28')]=function(_0x17acb8,_0x5de987,_0x26c19f){passport[_0xcf7e('0xc')](_0xcf7e('0x29'),function(_0x38df72,_0x16dcbd,_0x198c07){var _0x40bf62=_0x38df72||_0x198c07;if(_0x40bf62){return handleError(_0x5de987,0x191,_0x40bf62);}if(!_0x16dcbd){return handleError(_0x5de987,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x11994e={'payload':{'id':_0x16dcbd['id'],'role':_0x16dcbd['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x11994e)[_0xcf7e('0x16')](function(_0x45a38a){_0x5de987['json']({'id':_0x16dcbd['id'],'token':_0x45a38a,'statusCall':'','isAlreadyLogged':_0x16dcbd[_0xcf7e('0x2a')]});});}})(_0x17acb8,_0x5de987,_0x26c19f);};passport['use'](_0xcf7e('0x29'),new LocalStrategy({'usernameField':_0xcf7e('0x1f'),'passwordField':_0xcf7e('0x18')},function(_0x43881f,_0x4dcca9,_0x2725d6){return ActiveDirectoryAuthenticate(db[_0xcf7e('0x2b')],_0x43881f,_0x4dcca9,_0x2725d6);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 0987aec..e89869f 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 _0x471c=['./authActiveDirectory.controller','post','login','Router'];(function(_0x409388,_0x325a64){var _0x2d8d5a=function(_0x74f8fc){while(--_0x74f8fc){_0x409388['push'](_0x409388['shift']());}};_0x2d8d5a(++_0x325a64);}(_0x471c,0x9b));var _0xc471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x471c[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0xc471('0x0')]();var controller=require(_0xc471('0x1'));router[_0xc471('0x2')]('/',controller[_0xc471('0x3')]);module['exports']=router; \ No newline at end of file +var _0x272f=['post','login','exports','express'];(function(_0x305c31,_0x466b17){var _0x17f39f=function(_0x53ae03){while(--_0x53ae03){_0x305c31['push'](_0x305c31['shift']());}};_0x17f39f(++_0x466b17);}(_0x272f,0xbb));var _0xf272=function(_0x372922,_0x42883c){_0x372922=_0x372922-0x0;var _0x4e20d6=_0x272f[_0x372922];return _0x4e20d6;};'use strict';var express=require(_0xf272('0x0'));var router=express['Router']();var controller=require('./authActiveDirectory.controller');router[_0xf272('0x1')]('/',controller[_0xf272('0x2')]);module[_0xf272('0x3')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index f4ca54b..3d34b11 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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x4bb6f6,_0x44aff4){var _0x4e71c3=function(_0x446a1a){while(--_0x446a1a){_0x4bb6f6['push'](_0x4bb6f6['shift']());}};_0x4e71c3(++_0x44aff4);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x30d166,_0x5ed9d7){var _0x3a7284=function(_0x1e6e10){while(--_0x1e6e10){_0x30d166['push'](_0x30d166['shift']());}};_0x3a7284(++_0x5ed9d7);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 6dd0d52..80b51af 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 _0x82dc=['/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x12e99d,_0x232b4f){var _0x271c62=function(_0x379c1d){while(--_0x379c1d){_0x12e99d['push'](_0x12e99d['shift']());}};_0x271c62(++_0x232b4f);}(_0x82dc,0x109));var _0xc82d=function(_0x53e411,_0x5bb91b){_0x53e411=_0x53e411-0x0;var _0x4fbf13=_0x82dc[_0x53e411];return _0x4fbf13;};'use strict';var express=require(_0xc82d('0x0'));var passport=require(_0xc82d('0x1'));var router=express[_0xc82d('0x2')]();var controller=require(_0xc82d('0x3'));var userController=require(_0xc82d('0x4'));var authService=require(_0xc82d('0x5'));router[_0xc82d('0x6')]('/',controller[_0xc82d('0x7')]);router['get'](_0xc82d('0x8'),controller[_0xc82d('0x9')],authService[_0xc82d('0xa')],userController['login'],authService[_0xc82d('0xb')]);module[_0xc82d('0xc')]=router; \ No newline at end of file +var _0x2c58=['./authGoogle.controller','../../components/auth/service','get','/callback','callback','isMiddleware','login','setTokenCookie','exports','passport','Router'];(function(_0x1ec684,_0xee510d){var _0x4477ed=function(_0x13777d){while(--_0x13777d){_0x1ec684['push'](_0x1ec684['shift']());}};_0x4477ed(++_0xee510d);}(_0x2c58,0x1ab));var _0x82c5=function(_0x17380d,_0x1ad894){_0x17380d=_0x17380d-0x0;var _0x522f70=_0x2c58[_0x17380d];return _0x522f70;};'use strict';var express=require('express');var passport=require(_0x82c5('0x0'));var router=express[_0x82c5('0x1')]();var controller=require(_0x82c5('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x82c5('0x3'));router[_0x82c5('0x4')]('/',controller['login']);router['get'](_0x82c5('0x5'),controller[_0x82c5('0x6')],authService[_0x82c5('0x7')],userController[_0x82c5('0x8')],authService[_0x82c5('0x9')]);module[_0x82c5('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 ae76608..902bd70 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 _0x8f66=['User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','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','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','password','salt','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','Smtp','SendMail','error','status','send','message','authenticate','local-login','role','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase'];(function(_0x3872c7,_0x4be340){var _0x570420=function(_0x150811){while(--_0x150811){_0x3872c7['push'](_0x3872c7['shift']());}};_0x570420(++_0x4be340);}(_0x8f66,0x6d));var _0x68f6=function(_0xf1d988,_0x341f87){_0xf1d988=_0xf1d988-0x0;var _0x264fa0=_0x8f66[_0xf1d988];return _0x264fa0;};'use strict';var util=require(_0x68f6('0x0'));var passport=require(_0x68f6('0x1'));var LocalStrategy=require(_0x68f6('0x2'))[_0x68f6('0x3')];var jayson=require(_0x68f6('0x4'));var _=require(_0x68f6('0x5'));var rs=require(_0x68f6('0x6'));var moment=require(_0x68f6('0x7'));var db=require(_0x68f6('0x8'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0x68f6('0x9')][_0x68f6('0xa')]({'port':0x232b});function localAuthenticate(_0xcf5c78,_0x5f3bec,_0x1e47f6,_0x1ef83c){var _0x3489b8,_0x27b0dc;return db[_0x68f6('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x68f6('0xc'),_0x68f6('0xd')],'raw':!![]})[_0x68f6('0xe')](function(_0x5dc6e4){_0x3489b8=_0x5dc6e4;return _0xcf5c78[_0x68f6('0xf')]({'attributes':['id',_0x68f6('0x10'),_0x68f6('0x11'),_0x68f6('0x12'),'role',_0x68f6('0x13'),'blocked',_0x68f6('0x14'),_0x68f6('0x15')],'where':{'name':_0x5f3bec,'role':{'$or':[_0x68f6('0x16'),_0x68f6('0x17'),_0x68f6('0x18')]}}});})['then'](function(_0x56ad16){if(!_0x56ad16||_0x56ad16&&_0x56ad16[_0x68f6('0x10')]!==_0x5f3bec){throw new Error(_0x68f6('0x19'));}else{_0x27b0dc=_0x56ad16;return _0x27b0dc;}})[_0x68f6('0xe')](function(){_0x27b0dc['authenticate'](_0x1e47f6,function(_0x1c10f3,_0x5a72f7){var _0x2d6dfe=_0x27b0dc[_0x68f6('0x15')]+0x1;if(_0x1c10f3){return _0x1ef83c(_0x1c10f3);}else if(!_0x5a72f7){if(_0x27b0dc[_0x68f6('0x13')]){return _0x1ef83c(null,![],{'message':_0x68f6('0x19')});}else if(_0x3489b8['allowedLoginAttempts']>0x0){if(_0x27b0dc[_0x68f6('0x1a')]){if(_0x3489b8['blockDuration']>0x0){if(moment(_0x27b0dc[_0x68f6('0x14')])['add'](_0x3489b8[_0x68f6('0xd')],_0x68f6('0x1b'))>moment()){return _0x1ef83c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x68f6('0x1c')](_0x27b0dc,_0x2d6dfe,![],null)[_0x68f6('0xe')](function(){return _0x1ef83c(null,![],{'message':_0x68f6('0x19')});});}}else{return _0x1ef83c(null,![],{'message':_0x68f6('0x19')});}}else{if(_0x2d6dfe>=_0x3489b8[_0x68f6('0xc')]){return utils[_0x68f6('0x1c')](_0x27b0dc,0x0,!![],moment())[_0x68f6('0xe')](function(){return _0x1ef83c(null,![],{'message':_0x68f6('0x19')});});}else{return utils[_0x68f6('0x1c')](_0x27b0dc,_0x2d6dfe,![],null)[_0x68f6('0xe')](function(){return _0x1ef83c(null,![],{'message':_0x68f6('0x19')});});}}}else{return _0x1ef83c(null,![],{'message':_0x68f6('0x19')});}}else{if(_0x27b0dc[_0x68f6('0x13')]){return _0x1ef83c(null,![],{'message':_0x68f6('0x19')});}else if(_0x3489b8[_0x68f6('0xc')]>0x0){if(_0x27b0dc[_0x68f6('0x1a')]){if(_0x3489b8['blockDuration']>0x0){if(moment(_0x27b0dc[_0x68f6('0x14')])[_0x68f6('0x1d')](_0x3489b8[_0x68f6('0xd')],_0x68f6('0x1b'))>moment()){return _0x1ef83c(null,![],{'message':_0x68f6('0x19')});}else{return utils[_0x68f6('0x1c')](_0x27b0dc,0x0,![],null)[_0x68f6('0xe')](function(){return utils[_0x68f6('0x1e')](_0x27b0dc);})['then'](function(){return _0x1ef83c(null,_0x27b0dc);});}}else{return _0x1ef83c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x27b0dc,0x0,![],null)['then'](function(){return utils['getLicense'](_0x27b0dc);})[_0x68f6('0xe')](function(){return _0x1ef83c(null,_0x27b0dc);})['catch'](function(_0x852dd6){return _0x1ef83c(null,![],_0x852dd6);});}}else{if(_0x27b0dc[_0x68f6('0x1a')]){return _0x1ef83c(null,![],{'message':_0x68f6('0x19')});}else{return utils[_0x68f6('0x1e')](_0x27b0dc)[_0x68f6('0xe')](function(){return _0x1ef83c(null,_0x27b0dc);});}}}});})[_0x68f6('0x1f')](function(_0x5427ef){return _0x1ef83c(null,![],_0x5427ef);});}function sendServiceMail(_0x1c26da){return db[_0x68f6('0x20')][_0x68f6('0x21')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x68f6('0x22')],'as':_0x68f6('0x22')}]}]})['then'](function(_0x1bb619){if(!_0x1bb619){throw new Error(_0x68f6('0x23'));}var _0x2295ee=_0x1bb619[_0x68f6('0x24')]();var _0x2b8446={'account':_0x2295ee,'message':_[_0x68f6('0x25')]({'from':util[_0x68f6('0x26')](_0x68f6('0x27'),_0x1bb619[_0x68f6('0x10')],_0x1bb619[_0x68f6('0x28')]||_0x1bb619[_0x68f6('0x29')][_0x68f6('0x17')])},_0x1c26da)};return client['request'](_0x68f6('0x2a'),_0x2b8446);})[_0x68f6('0xe')](function(_0x2b96c1){if(_0x2b96c1[_0x68f6('0x2b')]){throw new Error(util[_0x68f6('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x2b96c1[_0x68f6('0x2b')]['message']||JSON['stringify'](_0x2b96c1[_0x68f6('0x2b')])));}return!![];});}function handleError(_0x517dab,_0x58ae46,_0x2289f8){return _0x517dab[_0x68f6('0x2c')](_0x58ae46||0x1f4)[_0x68f6('0x2d')]({'message':_0x2289f8?_0x2289f8[_0x68f6('0x2e')]||_0x2289f8:''});}exports['login']=function(_0x2a62e7,_0x3a5462,_0x4bf4ec){passport[_0x68f6('0x2f')](_0x68f6('0x30'),function(_0x1d743f,_0x38113d,_0x3d1f07){var _0x10148e=_0x1d743f||_0x3d1f07;if(_0x10148e){return handleError(_0x3a5462,0x191,_0x10148e);}if(!_0x38113d){return handleError(_0x3a5462,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x26de8d={'payload':{'id':_0x38113d['id'],'role':_0x38113d[_0x68f6('0x31')]},'options':{'expiresIn':0x15180}};return authService[_0x68f6('0x32')](_0x26de8d)[_0x68f6('0xe')](function(_0x1a9fb8){_0x3a5462[_0x68f6('0x33')]({'id':_0x38113d['id'],'token':_0x1a9fb8,'statusCall':'','isAlreadyLogged':_0x38113d[_0x68f6('0x34')]});});}})(_0x2a62e7,_0x3a5462,_0x4bf4ec);};exports[_0x68f6('0x35')]=function(_0x2b0479,_0x2252e7){if(!_0x2b0479[_0x68f6('0x36')]['email']){return handleError(_0x2252e7,0x1f4,{'message':_0x68f6('0x37')});}var _0x45ca42=rs[_0x68f6('0x38')]();_0x2b0479[_0x68f6('0x36')]['email']=_0x2b0479[_0x68f6('0x36')][_0x68f6('0x28')][_0x68f6('0x39')]()[_0x68f6('0x3a')]();var _0xeb69fa;return db[_0x68f6('0xb')][_0x68f6('0xf')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x68f6('0xe')](function(_0x107906){_0xeb69fa=_0x107906;return db[_0x68f6('0x3b')]['find']({'where':{'email':_0x2b0479[_0x68f6('0x36')]['email']}});})[_0x68f6('0xe')](function(_0x348599){if(!_0x348599){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x348599[_0x68f6('0x13')]){throw new Error(_0x68f6('0x3c'));}if(_0x348599[_0x68f6('0x1a')]){if(moment(_0x348599[_0x68f6('0x14')])['add'](_0xeb69fa['blockDuration'],_0x68f6('0x1b'))>moment()){throw new Error(_0x68f6('0x3d'));}else{_0x348599[_0x68f6('0x1a')]=![];_0x348599[_0x68f6('0x14')]=null;}}_0x348599['resetPasswordToken']=_0x45ca42;_0x348599[_0x68f6('0x3e')]=Date[_0x68f6('0x3f')]()+0x36ee80;return _0x348599[_0x68f6('0x40')]();})['then'](function(){return sendServiceMail({'to':_0x2b0479[_0x68f6('0x36')][_0x68f6('0x28')],'subject':_0x68f6('0x41'),'text':_0x68f6('0x42')+_0x68f6('0x43')+_0x68f6('0x44')+_0x2b0479[_0x68f6('0x45')][_0x68f6('0x46')]+'/reset/'+_0x45ca42+'\x0a\x0a'+_0x68f6('0x47')});})[_0x68f6('0xe')](function(){_0x2252e7[_0x68f6('0x2c')](0xc8)[_0x68f6('0x2d')]({'message':_0x68f6('0x48')});})[_0x68f6('0x1f')](function(_0xd199d0){return handleError(_0x2252e7,0x1f4,_0xd199d0);});};exports[_0x68f6('0x49')]=function(_0x8196a9,_0x574225){return db['User'][_0x68f6('0x21')]({'where':{'resetPasswordToken':_0x8196a9[_0x68f6('0x4a')][_0x68f6('0x4b')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x68f6('0xe')](function(_0x2fcf17){if(!_0x2fcf17){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x68f6('0xf')]({'attributes':['id',_0x68f6('0x4c'),_0x68f6('0x4d'),_0x68f6('0x4e')]})['then'](function(_0x11fdd7){if(_0x11fdd7['securePassword'])authService[_0x68f6('0x4f')](_0x8196a9['body'][_0x68f6('0x11')]);if(!_0x11fdd7[_0x68f6('0x4d')]||!_0x2fcf17[_0x68f6('0x50')])return _0x2fcf17;authService[_0x68f6('0x51')](_0x8196a9['body'][_0x68f6('0x11')],_0x2fcf17['previousPasswords'],_0x11fdd7[_0x68f6('0x4e')]);return _0x2fcf17;})['then'](function(){_0x2fcf17['password']=_0x8196a9[_0x68f6('0x36')][_0x68f6('0x11')];_0x2fcf17['resetPasswordToken']=null;_0x2fcf17[_0x68f6('0x3e')]=null;return _0x2fcf17['save']();});})['then'](function(){_0x574225[_0x68f6('0x2c')](0xc8)['send']({'message':_0x68f6('0x52')});})[_0x68f6('0x1f')](function(_0x21aa74){return handleError(_0x574225,0x1f4,_0x21aa74);});};passport[_0x68f6('0x53')]('local-login',new LocalStrategy({'usernameField':_0x68f6('0x10'),'passwordField':'password'},function(_0x4ea3af,_0x2717cf,_0x68f3fd){return localAuthenticate(db['User'],_0x4ea3af,_0x2717cf,_0x68f3fd);})); \ No newline at end of file +var _0x278a=['enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','validatePasswordHistory','local-login','util','passport','passport-local','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','password','salt','role','blockedAt','loginAttempts','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','disabled','catch','getLicense','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','authenticate','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x278a,0x162));var _0xa278=function(_0x427220,_0x1a15d0){_0x427220=_0x427220-0x0;var _0x243f59=_0x278a[_0x427220];return _0x243f59;};'use strict';var util=require(_0xa278('0x0'));var passport=require(_0xa278('0x1'));var LocalStrategy=require(_0xa278('0x2'))['Strategy'];var jayson=require(_0xa278('0x3'));var _=require('lodash');var rs=require(_0xa278('0x4'));var moment=require(_0xa278('0x5'));var db=require(_0xa278('0x6'))['db'];var authService=require(_0xa278('0x7'));var utils=require(_0xa278('0x8'));var client=jayson[_0xa278('0x9')][_0xa278('0xa')]({'port':0x232b});function localAuthenticate(_0x43a541,_0x6c0b4,_0x359903,_0x25903e){var _0x22aa0d,_0x2ec401;return db[_0xa278('0xb')][_0xa278('0xc')]({'where':{'id':0x1},'attributes':[_0xa278('0xd'),_0xa278('0xe')],'raw':!![]})[_0xa278('0xf')](function(_0x2bd547){_0x22aa0d=_0x2bd547;return _0x43a541[_0xa278('0xc')]({'attributes':['id','name',_0xa278('0x10'),_0xa278('0x11'),_0xa278('0x12'),'disabled','blocked',_0xa278('0x13'),_0xa278('0x14')],'where':{'name':_0x6c0b4,'role':{'$or':[_0xa278('0x15'),_0xa278('0x16'),_0xa278('0x17')]}}});})[_0xa278('0xf')](function(_0x5200c1){if(!_0x5200c1||_0x5200c1&&_0x5200c1[_0xa278('0x18')]!==_0x6c0b4){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2ec401=_0x5200c1;return _0x2ec401;}})[_0xa278('0xf')](function(){_0x2ec401['authenticate'](_0x359903,function(_0x821598,_0x1642c7){var _0x46f4dd=_0x2ec401[_0xa278('0x14')]+0x1;if(_0x821598){return _0x25903e(_0x821598);}else if(!_0x1642c7){if(_0x2ec401['disabled']){return _0x25903e(null,![],{'message':_0xa278('0x19')});}else if(_0x22aa0d[_0xa278('0xd')]>0x0){if(_0x2ec401[_0xa278('0x1a')]){if(_0x22aa0d[_0xa278('0xe')]>0x0){if(moment(_0x2ec401[_0xa278('0x13')])[_0xa278('0x1b')](_0x22aa0d[_0xa278('0xe')],_0xa278('0x1c'))>moment()){return _0x25903e(null,![],{'message':_0xa278('0x19')});}else{return utils['clearBlockUser'](_0x2ec401,_0x46f4dd,![],null)[_0xa278('0xf')](function(){return _0x25903e(null,![],{'message':_0xa278('0x19')});});}}else{return _0x25903e(null,![],{'message':_0xa278('0x19')});}}else{if(_0x46f4dd>=_0x22aa0d[_0xa278('0xd')]){return utils[_0xa278('0x1d')](_0x2ec401,0x0,!![],moment())['then'](function(){return _0x25903e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x2ec401,_0x46f4dd,![],null)['then'](function(){return _0x25903e(null,![],{'message':_0xa278('0x19')});});}}}else{return _0x25903e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2ec401[_0xa278('0x1e')]){return _0x25903e(null,![],{'message':_0xa278('0x19')});}else if(_0x22aa0d[_0xa278('0xd')]>0x0){if(_0x2ec401[_0xa278('0x1a')]){if(_0x22aa0d[_0xa278('0xe')]>0x0){if(moment(_0x2ec401[_0xa278('0x13')])[_0xa278('0x1b')](_0x22aa0d[_0xa278('0xe')],'minutes')>moment()){return _0x25903e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xa278('0x1d')](_0x2ec401,0x0,![],null)[_0xa278('0xf')](function(){return utils['getLicense'](_0x2ec401);})[_0xa278('0xf')](function(){return _0x25903e(null,_0x2ec401);});}}else{return _0x25903e(null,![],{'message':_0xa278('0x19')});}}else{return utils[_0xa278('0x1d')](_0x2ec401,0x0,![],null)['then'](function(){return utils['getLicense'](_0x2ec401);})[_0xa278('0xf')](function(){return _0x25903e(null,_0x2ec401);})[_0xa278('0x1f')](function(_0x25bef2){return _0x25903e(null,![],_0x25bef2);});}}else{if(_0x2ec401[_0xa278('0x1a')]){return _0x25903e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xa278('0x20')](_0x2ec401)[_0xa278('0xf')](function(){return _0x25903e(null,_0x2ec401);});}}}});})[_0xa278('0x1f')](function(_0x3c6adb){return _0x25903e(null,![],_0x3c6adb);});}function sendServiceMail(_0x3feae2){return db[_0xa278('0x21')][_0xa278('0x22')]({'where':{'service':!![]},'attributes':['id',_0xa278('0x18'),_0xa278('0x23')],'include':[{'model':db[_0xa278('0x24')],'as':_0xa278('0x25'),'include':[{'model':db[_0xa278('0x26')],'as':_0xa278('0x26')}]}]})[_0xa278('0xf')](function(_0x573abd){if(!_0x573abd){throw new Error(_0xa278('0x27'));}var _0x1d6427=_0x573abd[_0xa278('0x28')]();var _0x5e5307={'account':_0x1d6427,'message':_[_0xa278('0x29')]({'from':util[_0xa278('0x2a')](_0xa278('0x2b'),_0x573abd[_0xa278('0x18')],_0x573abd['email']||_0x573abd[_0xa278('0x25')]['user'])},_0x3feae2)};return client[_0xa278('0x2c')](_0xa278('0x2d'),_0x5e5307);})['then'](function(_0x47c2b2){if(_0x47c2b2[_0xa278('0x2e')]){throw new Error(util[_0xa278('0x2a')](_0xa278('0x2f'),_0x47c2b2[_0xa278('0x2e')][_0xa278('0x30')]||JSON['stringify'](_0x47c2b2[_0xa278('0x2e')])));}return!![];});}function handleError(_0xb62b73,_0x36bc70,_0x25bdb9){return _0xb62b73[_0xa278('0x31')](_0x36bc70||0x1f4)[_0xa278('0x32')]({'message':_0x25bdb9?_0x25bdb9[_0xa278('0x30')]||_0x25bdb9:''});}exports[_0xa278('0x33')]=function(_0x71c14f,_0x4d0246,_0x11f7a2){passport[_0xa278('0x34')]('local-login',function(_0x5a80bd,_0x4faa7a,_0x50fd64){var _0x52d55d=_0x5a80bd||_0x50fd64;if(_0x52d55d){return handleError(_0x4d0246,0x191,_0x52d55d);}if(!_0x4faa7a){return handleError(_0x4d0246,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x579cea={'payload':{'id':_0x4faa7a['id'],'role':_0x4faa7a[_0xa278('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0xa278('0x35')](_0x579cea)[_0xa278('0xf')](function(_0x3ed078){_0x4d0246[_0xa278('0x36')]({'id':_0x4faa7a['id'],'token':_0x3ed078,'statusCall':'','isAlreadyLogged':_0x4faa7a[_0xa278('0x37')]});});}})(_0x71c14f,_0x4d0246,_0x11f7a2);};exports[_0xa278('0x38')]=function(_0xcadb1,_0x1e345e){if(!_0xcadb1[_0xa278('0x39')][_0xa278('0x23')]){return handleError(_0x1e345e,0x1f4,{'message':_0xa278('0x3a')});}var _0x4b517b=rs[_0xa278('0x3b')]();_0xcadb1['body'][_0xa278('0x23')]=_0xcadb1['body'][_0xa278('0x23')][_0xa278('0x3c')]()[_0xa278('0x3d')]();var _0x1747d7;return db[_0xa278('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0xa278('0xd'),_0xa278('0xe')],'raw':!![]})[_0xa278('0xf')](function(_0x10ca05){_0x1747d7=_0x10ca05;return db[_0xa278('0x3e')][_0xa278('0x22')]({'where':{'email':_0xcadb1[_0xa278('0x39')][_0xa278('0x23')]}});})['then'](function(_0x27645a){if(!_0x27645a){throw new Error(_0xa278('0x3f'));}if(_0x27645a['disabled']){throw new Error(_0xa278('0x40'));}if(_0x27645a['blocked']){if(moment(_0x27645a[_0xa278('0x13')])[_0xa278('0x1b')](_0x1747d7[_0xa278('0xe')],_0xa278('0x1c'))>moment()){throw new Error(_0xa278('0x41'));}else{_0x27645a[_0xa278('0x1a')]=![];_0x27645a[_0xa278('0x13')]=null;}}_0x27645a[_0xa278('0x42')]=_0x4b517b;_0x27645a[_0xa278('0x43')]=Date[_0xa278('0x44')]()+0x36ee80;return _0x27645a[_0xa278('0x45')]();})[_0xa278('0xf')](function(){return sendServiceMail({'to':_0xcadb1[_0xa278('0x39')]['email'],'subject':_0xa278('0x46'),'text':_0xa278('0x47')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xa278('0x48')+_0xcadb1['headers'][_0xa278('0x49')]+_0xa278('0x4a')+_0x4b517b+'\x0a\x0a'+_0xa278('0x4b')});})[_0xa278('0xf')](function(){_0x1e345e['status'](0xc8)[_0xa278('0x32')]({'message':_0xa278('0x4c')});})[_0xa278('0x1f')](function(_0x5192b0){return handleError(_0x1e345e,0x1f4,_0x5192b0);});};exports[_0xa278('0x4d')]=function(_0x10c827,_0xc4cfe5){return db[_0xa278('0x3e')][_0xa278('0x22')]({'where':{'resetPasswordToken':_0x10c827[_0xa278('0x4e')][_0xa278('0x4f')],'resetPasswordExpires':{'$gt':Date[_0xa278('0x44')]()}}})['then'](function(_0x4e5bfd){if(!_0x4e5bfd){throw new Error(_0xa278('0x50'));}return db['Setting'][_0xa278('0xc')]({'attributes':['id','securePassword',_0xa278('0x51'),_0xa278('0x52')]})[_0xa278('0xf')](function(_0x5c955e){if(_0x5c955e[_0xa278('0x53')])authService['validatePasswordPattern'](_0x10c827[_0xa278('0x39')][_0xa278('0x10')]);if(!_0x5c955e[_0xa278('0x51')]||!_0x4e5bfd[_0xa278('0x54')])return _0x4e5bfd;authService[_0xa278('0x55')](_0x10c827['body'][_0xa278('0x10')],_0x4e5bfd['previousPasswords'],_0x5c955e['passwordHistoryLimit']);return _0x4e5bfd;})[_0xa278('0xf')](function(){_0x4e5bfd[_0xa278('0x10')]=_0x10c827[_0xa278('0x39')][_0xa278('0x10')];_0x4e5bfd[_0xa278('0x42')]=null;_0x4e5bfd[_0xa278('0x43')]=null;return _0x4e5bfd['save']();});})[_0xa278('0xf')](function(){_0xc4cfe5['status'](0xc8)[_0xa278('0x32')]({'message':'Password\x20reset!'});})['catch'](function(_0x573e05){return handleError(_0xc4cfe5,0x1f4,_0x573e05);});};passport['use'](_0xa278('0x56'),new LocalStrategy({'usernameField':'name','passwordField':_0xa278('0x10')},function(_0x2264fb,_0x434f42,_0x422cda){return localAuthenticate(db[_0xa278('0x3e')],_0x2264fb,_0x434f42,_0x422cda);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 447a85f..551ef8c 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 _0x1a2b=['exports','express','Router','./authLocal.controller','post','/forgot','/reset/:token','reset'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x1a2b,0x119));var _0xb1a2=function(_0x35a441,_0x3a2ec6){_0x35a441=_0x35a441-0x0;var _0x571ce3=_0x1a2b[_0x35a441];return _0x571ce3;};'use strict';var express=require(_0xb1a2('0x0'));var router=express[_0xb1a2('0x1')]();var controller=require(_0xb1a2('0x2'));router[_0xb1a2('0x3')]('/',controller['login']);router[_0xb1a2('0x3')](_0xb1a2('0x4'),controller['forgot']);router['post'](_0xb1a2('0x5'),controller[_0xb1a2('0x6')]);module[_0xb1a2('0x7')]=router; \ No newline at end of file +var _0xcfd7=['./authLocal.controller','post','login','/forgot','reset','exports','express','Router'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0xcfd7,0x1c6));var _0x7cfd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcfd7[_0x321bb2];return _0x9c12ed;};'use strict';var express=require(_0x7cfd('0x0'));var router=express[_0x7cfd('0x1')]();var controller=require(_0x7cfd('0x2'));router[_0x7cfd('0x3')]('/',controller[_0x7cfd('0x4')]);router['post'](_0x7cfd('0x5'),controller['forgot']);router[_0x7cfd('0x3')]('/reset/:token',controller[_0x7cfd('0x6')]);module[_0x7cfd('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 50c1171..debea07 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 _0xd3a6=['exports','STRING'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xd3a6,0xea));var _0x6d3a=function(_0xce6907,_0x244781){_0xce6907=_0xce6907-0x0;var _0xf51c07=_0xd3a6[_0xce6907];return _0xf51c07;};'use strict';var Sequelize=require('sequelize');module[_0x6d3a('0x0')]={'name':{'type':Sequelize[_0x6d3a('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x6d3a('0x1')]},'description':{'type':Sequelize[_0x6d3a('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x92f0=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x463b0c,_0x385dd4){var _0x386455=function(_0x53781d){while(--_0x53781d){_0x463b0c['push'](_0x463b0c['shift']());}};_0x386455(++_0x385dd4);}(_0x92f0,0x191));var _0x092f=function(_0x1a4a06,_0x36a5c2){_0x1a4a06=_0x1a4a06-0x0;var _0x49ec08=_0x92f0[_0x1a4a06];return _0x49ec08;};'use strict';var Sequelize=require(_0x092f('0x0'));module[_0x092f('0x1')]={'name':{'type':Sequelize[_0x092f('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x092f('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x092f('0x4')],'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 6935474..6746bd6 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 _0x4d43=['keys','filters','model','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','Action','addActions','getActions','hasOwnProperty','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','Automation','rawAttributes','key','map','query'];(function(_0xccd633,_0x40ee58){var _0x45dbfa=function(_0x418f3b){while(--_0x418f3b){_0xccd633['push'](_0xccd633['shift']());}};_0x45dbfa(++_0x40ee58);}(_0x4d43,0x114));var _0x34d4=function(_0x191068,_0x5462a4){_0x191068=_0x191068-0x0;var _0x1c4a5b=_0x4d43[_0x191068];return _0x1c4a5b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x34d4('0x0'));var zipdir=require(_0x34d4('0x1'));var jsonpatch=require(_0x34d4('0x2'));var rp=require('request-promise');var moment=require(_0x34d4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x34d4('0x4'));var util=require(_0x34d4('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x34d4('0x6'));var ejs=require(_0x34d4('0x7'));var fs=require('fs');var fs_extra=require(_0x34d4('0x8'));var _=require(_0x34d4('0x9'));var squel=require('squel');var crypto=require(_0x34d4('0xa'));var jsforce=require(_0x34d4('0xb'));var deskjs=require(_0x34d4('0xc'));var toCsv=require(_0x34d4('0x6'));var querystring=require(_0x34d4('0xd'));var Papa=require('papaparse');var Redis=require(_0x34d4('0xe'));var authService=require(_0x34d4('0xf'));var qs=require(_0x34d4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x34d4('0x11'));var logger=require(_0x34d4('0x12'))(_0x34d4('0x13'));var utils=require(_0x34d4('0x14'));var config=require(_0x34d4('0x15'));var licenseUtil=require(_0x34d4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35c199,_0x3aa4ad){_0x3aa4ad=_0x3aa4ad||0xcc;return function(_0x31bba1){if(_0x31bba1){return _0x35c199[_0x34d4('0x17')](_0x3aa4ad);}return _0x35c199[_0x34d4('0x18')](_0x3aa4ad)[_0x34d4('0x19')]();};}function respondWithResult(_0x5f11be,_0x11d3a7){_0x11d3a7=_0x11d3a7||0xc8;return function(_0x123dae){if(_0x123dae){return _0x5f11be[_0x34d4('0x18')](_0x11d3a7)['json'](_0x123dae);}};}function respondWithFilteredResult(_0x18fec4,_0x116102){return function(_0x9e29b4){if(_0x9e29b4){var _0x22a576=typeof _0x116102[_0x34d4('0x1a')]===_0x34d4('0x1b')&&typeof _0x116102[_0x34d4('0x1c')]===_0x34d4('0x1b');var _0x173437=_0x9e29b4[_0x34d4('0x1d')];var _0x3a7443=_0x22a576?0x0:_0x116102['offset'];var _0x188c3a=_0x22a576?_0x9e29b4[_0x34d4('0x1d')]:_0x116102[_0x34d4('0x1a')]+_0x116102[_0x34d4('0x1c')];var _0x32a79f;if(_0x188c3a>=_0x173437){_0x188c3a=_0x173437;_0x32a79f=0xc8;}else{_0x32a79f=0xce;}_0x18fec4['status'](_0x32a79f);return _0x18fec4['set'](_0x34d4('0x1e'),_0x3a7443+'-'+_0x188c3a+'/'+_0x173437)['json'](_0x9e29b4);}return null;};}function patchUpdates(_0x14996f){return function(_0x599009){try{jsonpatch[_0x34d4('0x1f')](_0x599009,_0x14996f,!![]);}catch(_0x3a70e8){return BPromise[_0x34d4('0x20')](_0x3a70e8);}return _0x599009['save']();};}function saveUpdates(_0x2b9797,_0x512b25){return function(_0x37d1e3){if(_0x37d1e3){return _0x37d1e3[_0x34d4('0x21')](_0x2b9797)[_0x34d4('0x22')](function(_0x1dc7ff){return _0x1dc7ff;});}return null;};}function removeEntity(_0x28b270,_0x38964d){return function(_0x40a396){if(_0x40a396){return _0x40a396['destroy']()[_0x34d4('0x22')](function(){_0x28b270[_0x34d4('0x18')](0xcc)[_0x34d4('0x19')]();});}};}function handleEntityNotFound(_0x2fea76,_0x35cd66){return function(_0x35b591){if(!_0x35b591){_0x2fea76['sendStatus'](0x194);}return _0x35b591;};}function handleError(_0x5a5f62,_0x3c24de){_0x3c24de=_0x3c24de||0x1f4;return function(_0x507169){logger[_0x34d4('0x23')](_0x507169[_0x34d4('0x24')]);if(_0x507169[_0x34d4('0x25')]){delete _0x507169['name'];}_0x5a5f62[_0x34d4('0x18')](_0x3c24de)[_0x34d4('0x26')](_0x507169);};}exports['index']=function(_0x38e00a,_0x2980b1){var _0x10c512={},_0x256fcb={},_0x567f19={'count':0x0,'rows':[]};var _0x33c530=_['map'](db[_0x34d4('0x27')][_0x34d4('0x28')],function(_0x31663f){return{'name':_0x31663f['fieldName'],'type':_0x31663f['type'][_0x34d4('0x29')]};});_0x256fcb['model']=_[_0x34d4('0x2a')](_0x33c530,_0x34d4('0x25'));_0x256fcb[_0x34d4('0x2b')]=_[_0x34d4('0x2c')](_0x38e00a[_0x34d4('0x2b')]);_0x256fcb[_0x34d4('0x2d')]=_['intersection'](_0x256fcb[_0x34d4('0x2e')],_0x256fcb[_0x34d4('0x2b')]);_0x10c512['attributes']=_[_0x34d4('0x2f')](_0x256fcb[_0x34d4('0x2e')],qs[_0x34d4('0x30')](_0x38e00a[_0x34d4('0x2b')][_0x34d4('0x30')]));_0x10c512[_0x34d4('0x31')]=_0x10c512[_0x34d4('0x31')][_0x34d4('0x32')]?_0x10c512['attributes']:_0x256fcb[_0x34d4('0x2e')];if(!_0x38e00a[_0x34d4('0x2b')]['hasOwnProperty']('nolimit')){_0x10c512['limit']=qs[_0x34d4('0x1c')](_0x38e00a[_0x34d4('0x2b')][_0x34d4('0x1c')]);_0x10c512[_0x34d4('0x1a')]=qs['offset'](_0x38e00a[_0x34d4('0x2b')]['offset']);}_0x10c512[_0x34d4('0x33')]=qs['sort'](_0x38e00a[_0x34d4('0x2b')][_0x34d4('0x34')]);_0x10c512[_0x34d4('0x35')]=qs[_0x34d4('0x2d')](_[_0x34d4('0x36')](_0x38e00a[_0x34d4('0x2b')],_0x256fcb[_0x34d4('0x2d')]),_0x33c530);if(_0x38e00a[_0x34d4('0x2b')][_0x34d4('0x37')]){_0x10c512[_0x34d4('0x35')]=_[_0x34d4('0x38')](_0x10c512['where'],{'$or':_[_0x34d4('0x2a')](_0x33c530,function(_0x56a072){if(_0x56a072[_0x34d4('0x39')]!=='VIRTUAL'){var _0x31ceba={};_0x31ceba[_0x56a072[_0x34d4('0x25')]]={'$like':'%'+_0x38e00a[_0x34d4('0x2b')][_0x34d4('0x37')]+'%'};return _0x31ceba;}})});}_0x10c512=_[_0x34d4('0x38')]({},_0x10c512,_0x38e00a[_0x34d4('0x3a')]);var _0x2e08a7={'where':_0x10c512[_0x34d4('0x35')]};return db[_0x34d4('0x27')][_0x34d4('0x1d')](_0x2e08a7)[_0x34d4('0x22')](function(_0x3cd440){_0x567f19[_0x34d4('0x1d')]=_0x3cd440;if(_0x38e00a[_0x34d4('0x2b')][_0x34d4('0x3b')]){_0x10c512[_0x34d4('0x3c')]=[{'all':!![]}];}return db[_0x34d4('0x27')][_0x34d4('0x3d')](_0x10c512);})[_0x34d4('0x22')](function(_0x41a0af){_0x567f19[_0x34d4('0x3e')]=_0x41a0af;return _0x567f19;})[_0x34d4('0x22')](respondWithFilteredResult(_0x2980b1,_0x10c512))[_0x34d4('0x3f')](handleError(_0x2980b1,null));};exports[_0x34d4('0x40')]=function(_0x185720,_0x5af7ea){var _0x275963={'raw':![],'where':{'id':_0x185720['params']['id']}},_0x11215c={};_0x11215c[_0x34d4('0x2e')]=_[_0x34d4('0x2c')](db[_0x34d4('0x27')][_0x34d4('0x28')]);_0x11215c['query']=_[_0x34d4('0x2c')](_0x185720[_0x34d4('0x2b')]);_0x11215c[_0x34d4('0x2d')]=_[_0x34d4('0x2f')](_0x11215c[_0x34d4('0x2e')],_0x11215c['query']);_0x275963['attributes']=_['intersection'](_0x11215c[_0x34d4('0x2e')],qs['fields'](_0x185720[_0x34d4('0x2b')][_0x34d4('0x30')]));_0x275963[_0x34d4('0x31')]=_0x275963['attributes'][_0x34d4('0x32')]?_0x275963['attributes']:_0x11215c[_0x34d4('0x2e')];if(_0x185720[_0x34d4('0x2b')][_0x34d4('0x3b')]){_0x275963[_0x34d4('0x3c')]=[{'all':!![]}];}_0x275963=_[_0x34d4('0x38')]({},_0x275963,_0x185720['options']);return db[_0x34d4('0x27')][_0x34d4('0x41')](_0x275963)[_0x34d4('0x22')](handleEntityNotFound(_0x5af7ea,null))['then'](respondWithResult(_0x5af7ea,null))[_0x34d4('0x3f')](handleError(_0x5af7ea,null));};exports[_0x34d4('0x42')]=function(_0x1c7750,_0x5cf0db){return db[_0x34d4('0x27')][_0x34d4('0x42')](_0x1c7750[_0x34d4('0x43')],{})['then'](respondWithResult(_0x5cf0db,0xc9))['catch'](handleError(_0x5cf0db,null));};exports['update']=function(_0x5ed889,_0x4fcd96){if(_0x5ed889['body']['id']){delete _0x5ed889['body']['id'];}return db[_0x34d4('0x27')][_0x34d4('0x41')]({'where':{'id':_0x5ed889[_0x34d4('0x44')]['id']}})[_0x34d4('0x22')](handleEntityNotFound(_0x4fcd96,null))[_0x34d4('0x22')](saveUpdates(_0x5ed889[_0x34d4('0x43')],null))['then'](respondWithResult(_0x4fcd96,null))['catch'](handleError(_0x4fcd96,null));};exports['destroy']=function(_0x3a77d8,_0x45964f){return db['Automation']['find']({'where':{'id':_0x3a77d8['params']['id']}})[_0x34d4('0x22')](handleEntityNotFound(_0x45964f,null))['then'](removeEntity(_0x45964f,null))['catch'](handleError(_0x45964f,null));};exports[_0x34d4('0x45')]=function(_0x520bba,_0x1bbe20,_0x117d5b){return db[_0x34d4('0x46')][_0x34d4('0x41')]({'where':{'id':_0x520bba[_0x34d4('0x44')]['id']}})[_0x34d4('0x22')](handleEntityNotFound(_0x1bbe20,null))[_0x34d4('0x22')](function(_0x5c15ba){if(_0x5c15ba){return _0x5c15ba[_0x34d4('0x45')](_0x520bba['body'][_0x34d4('0x47')],_[_0x34d4('0x48')](_0x520bba[_0x34d4('0x43')],[_0x34d4('0x47'),'id'])||{});}})['then'](respondWithResult(_0x1bbe20,null))[_0x34d4('0x3f')](handleError(_0x1bbe20,null));};exports[_0x34d4('0x49')]=function(_0x1a906d,_0x28488d,_0x5e533b){var _0x1086f7={};var _0xc3200d={};var _0x2f2aaa;var _0x5dcf09;return db[_0x34d4('0x27')][_0x34d4('0x4a')]({'where':{'id':_0x1a906d[_0x34d4('0x44')]['id']}})['then'](handleEntityNotFound(_0x28488d,null))['then'](function(_0xcedf2c){if(_0xcedf2c){_0x2f2aaa=_0xcedf2c;_0xc3200d[_0x34d4('0x2e')]=_[_0x34d4('0x2c')](db[_0x34d4('0x46')][_0x34d4('0x28')]);_0xc3200d['query']=_['keys'](_0x1a906d[_0x34d4('0x2b')]);_0xc3200d[_0x34d4('0x2d')]=_['intersection'](_0xc3200d[_0x34d4('0x2e')],_0xc3200d[_0x34d4('0x2b')]);_0x1086f7[_0x34d4('0x31')]=_[_0x34d4('0x2f')](_0xc3200d[_0x34d4('0x2e')],qs[_0x34d4('0x30')](_0x1a906d[_0x34d4('0x2b')][_0x34d4('0x30')]));_0x1086f7[_0x34d4('0x31')]=_0x1086f7[_0x34d4('0x31')][_0x34d4('0x32')]?_0x1086f7[_0x34d4('0x31')]:_0xc3200d[_0x34d4('0x2e')];_0x1086f7[_0x34d4('0x33')]=qs[_0x34d4('0x34')](_0x1a906d[_0x34d4('0x2b')][_0x34d4('0x34')]);_0x1086f7['where']=qs[_0x34d4('0x2d')](_[_0x34d4('0x36')](_0x1a906d[_0x34d4('0x2b')],_0xc3200d[_0x34d4('0x2d')]));if(_0x1a906d[_0x34d4('0x2b')][_0x34d4('0x37')]){_0x1086f7[_0x34d4('0x35')]=_[_0x34d4('0x38')](_0x1086f7[_0x34d4('0x35')],{'$or':_[_0x34d4('0x2a')](_0x1086f7['attributes'],function(_0x4e36aa){var _0x3a2b6f={};_0x3a2b6f[_0x4e36aa]={'$like':'%'+_0x1a906d['query']['filter']+'%'};return _0x3a2b6f;})});}_0x1086f7=_[_0x34d4('0x38')]({},_0x1086f7,_0x1a906d['options']);return _0x2f2aaa['getConditions'](_0x1086f7);}})[_0x34d4('0x22')](function(_0x35386e){if(_0x35386e){_0x5dcf09=_0x35386e[_0x34d4('0x32')];if(!_0x1a906d[_0x34d4('0x2b')]['hasOwnProperty'](_0x34d4('0x4b'))){_0x1086f7[_0x34d4('0x1c')]=qs[_0x34d4('0x1c')](_0x1a906d[_0x34d4('0x2b')][_0x34d4('0x1c')]);_0x1086f7[_0x34d4('0x1a')]=qs[_0x34d4('0x1a')](_0x1a906d[_0x34d4('0x2b')]['offset']);}return _0x2f2aaa[_0x34d4('0x49')](_0x1086f7);}})['then'](function(_0x10459f){if(_0x10459f){return _0x10459f?{'count':_0x5dcf09,'rows':_0x10459f}:null;}})['then'](respondWithResult(_0x28488d,null))[_0x34d4('0x3f')](handleError(_0x28488d,null));};exports['addActions']=function(_0x3c9f85,_0x300a5d,_0x27ce5d){return db[_0x34d4('0x4c')][_0x34d4('0x41')]({'where':{'id':_0x3c9f85[_0x34d4('0x44')]['id']}})['then'](handleEntityNotFound(_0x300a5d,null))['then'](function(_0x5e5c42){if(_0x5e5c42){return _0x5e5c42[_0x34d4('0x4d')](_0x3c9f85[_0x34d4('0x43')][_0x34d4('0x47')],_[_0x34d4('0x48')](_0x3c9f85[_0x34d4('0x43')],[_0x34d4('0x47'),'id'])||{});}})[_0x34d4('0x22')](respondWithResult(_0x300a5d,null))[_0x34d4('0x3f')](handleError(_0x300a5d,null));};exports[_0x34d4('0x4e')]=function(_0x2930e5,_0x1bcd0c,_0x476935){var _0x31c818={};var _0x14f061={};var _0x525e1b;var _0x35af09;return db['Automation'][_0x34d4('0x4a')]({'where':{'id':_0x2930e5[_0x34d4('0x44')]['id']}})[_0x34d4('0x22')](handleEntityNotFound(_0x1bcd0c,null))[_0x34d4('0x22')](function(_0x2c9cf3){if(_0x2c9cf3){_0x525e1b=_0x2c9cf3;_0x14f061[_0x34d4('0x2e')]=_[_0x34d4('0x2c')](db['Action']['rawAttributes']);_0x14f061[_0x34d4('0x2b')]=_[_0x34d4('0x2c')](_0x2930e5['query']);_0x14f061[_0x34d4('0x2d')]=_['intersection'](_0x14f061[_0x34d4('0x2e')],_0x14f061[_0x34d4('0x2b')]);_0x31c818['attributes']=_['intersection'](_0x14f061[_0x34d4('0x2e')],qs[_0x34d4('0x30')](_0x2930e5['query'][_0x34d4('0x30')]));_0x31c818[_0x34d4('0x31')]=_0x31c818['attributes'][_0x34d4('0x32')]?_0x31c818[_0x34d4('0x31')]:_0x14f061[_0x34d4('0x2e')];_0x31c818[_0x34d4('0x33')]=qs[_0x34d4('0x34')](_0x2930e5[_0x34d4('0x2b')]['sort']);_0x31c818['where']=qs[_0x34d4('0x2d')](_[_0x34d4('0x36')](_0x2930e5[_0x34d4('0x2b')],_0x14f061['filters']));if(_0x2930e5['query']['filter']){_0x31c818[_0x34d4('0x35')]=_[_0x34d4('0x38')](_0x31c818['where'],{'$or':_['map'](_0x31c818['attributes'],function(_0x4cc3a7){var _0x5b6828={};_0x5b6828[_0x4cc3a7]={'$like':'%'+_0x2930e5[_0x34d4('0x2b')][_0x34d4('0x37')]+'%'};return _0x5b6828;})});}_0x31c818=_[_0x34d4('0x38')]({},_0x31c818,_0x2930e5['options']);return _0x525e1b['getActions'](_0x31c818);}})[_0x34d4('0x22')](function(_0x428663){if(_0x428663){_0x35af09=_0x428663['length'];if(!_0x2930e5[_0x34d4('0x2b')][_0x34d4('0x4f')]('nolimit')){_0x31c818[_0x34d4('0x1c')]=qs[_0x34d4('0x1c')](_0x2930e5[_0x34d4('0x2b')][_0x34d4('0x1c')]);_0x31c818[_0x34d4('0x1a')]=qs[_0x34d4('0x1a')](_0x2930e5[_0x34d4('0x2b')][_0x34d4('0x1a')]);}return _0x525e1b[_0x34d4('0x4e')](_0x31c818);}})[_0x34d4('0x22')](function(_0x2a3bb5){if(_0x2a3bb5){return _0x2a3bb5?{'count':_0x35af09,'rows':_0x2a3bb5}:null;}})['then'](respondWithResult(_0x1bcd0c,null))[_0x34d4('0x3f')](handleError(_0x1bcd0c,null));}; \ No newline at end of file +var _0xc79b=['addActions','Action','ids','getActions','hasOwnProperty','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','index','map','Automation','rawAttributes','fieldName','type','key','model','name','keys','intersection','query','attributes','fields','length','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','update','body','find','params','addConditions','omit','findOne','Condition','order','getConditions','nolimit'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc79b,0x104));var _0xbc79=function(_0x45f8c0,_0x60b02){_0x45f8c0=_0x45f8c0-0x0;var _0x188b09=_0xc79b[_0x45f8c0];return _0x188b09;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbc79('0x0'));var jsonpatch=require(_0xbc79('0x1'));var rp=require('request-promise');var moment=require(_0xbc79('0x2'));var BPromise=require(_0xbc79('0x3'));var Mustache=require(_0xbc79('0x4'));var util=require('util');var path=require(_0xbc79('0x5'));var sox=require(_0xbc79('0x6'));var csv=require(_0xbc79('0x7'));var ejs=require(_0xbc79('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbc79('0x9'));var crypto=require(_0xbc79('0xa'));var jsforce=require(_0xbc79('0xb'));var deskjs=require(_0xbc79('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbc79('0xd'));var Papa=require(_0xbc79('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbc79('0xf'));var as=require(_0xbc79('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc79('0x11'))(_0xbc79('0x12'));var utils=require(_0xbc79('0x13'));var config=require(_0xbc79('0x14'));var licenseUtil=require(_0xbc79('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f1a46,_0x3ef3b9){_0x3ef3b9=_0x3ef3b9||0xcc;return function(_0x34a83d){if(_0x34a83d){return _0x3f1a46[_0xbc79('0x16')](_0x3ef3b9);}return _0x3f1a46[_0xbc79('0x17')](_0x3ef3b9)['end']();};}function respondWithResult(_0x57d82f,_0x232173){_0x232173=_0x232173||0xc8;return function(_0xa8ab12){if(_0xa8ab12){return _0x57d82f[_0xbc79('0x17')](_0x232173)[_0xbc79('0x18')](_0xa8ab12);}};}function respondWithFilteredResult(_0x3e942d,_0x302040){return function(_0x2d8455){if(_0x2d8455){var _0x57dd49=typeof _0x302040['offset']===_0xbc79('0x19')&&typeof _0x302040[_0xbc79('0x1a')]===_0xbc79('0x19');var _0x3fbecb=_0x2d8455['count'];var _0x7e867f=_0x57dd49?0x0:_0x302040[_0xbc79('0x1b')];var _0x52b5f1=_0x57dd49?_0x2d8455[_0xbc79('0x1c')]:_0x302040[_0xbc79('0x1b')]+_0x302040[_0xbc79('0x1a')];var _0x1ee684;if(_0x52b5f1>=_0x3fbecb){_0x52b5f1=_0x3fbecb;_0x1ee684=0xc8;}else{_0x1ee684=0xce;}_0x3e942d[_0xbc79('0x17')](_0x1ee684);return _0x3e942d[_0xbc79('0x1d')](_0xbc79('0x1e'),_0x7e867f+'-'+_0x52b5f1+'/'+_0x3fbecb)[_0xbc79('0x18')](_0x2d8455);}return null;};}function patchUpdates(_0x6918f7){return function(_0xff4bf6){try{jsonpatch[_0xbc79('0x1f')](_0xff4bf6,_0x6918f7,!![]);}catch(_0x83e20d){return BPromise[_0xbc79('0x20')](_0x83e20d);}return _0xff4bf6[_0xbc79('0x21')]();};}function saveUpdates(_0x13bb31,_0x16f38d){return function(_0x3de33c){if(_0x3de33c){return _0x3de33c['update'](_0x13bb31)[_0xbc79('0x22')](function(_0x5d7152){return _0x5d7152;});}return null;};}function removeEntity(_0x185ccc,_0x3e176b){return function(_0x43755c){if(_0x43755c){return _0x43755c[_0xbc79('0x23')]()[_0xbc79('0x22')](function(){_0x185ccc['status'](0xcc)[_0xbc79('0x24')]();});}};}function handleEntityNotFound(_0x506453,_0x1b95b8){return function(_0x7ceca9){if(!_0x7ceca9){_0x506453[_0xbc79('0x16')](0x194);}return _0x7ceca9;};}function handleError(_0x1654c2,_0x49fbc9){_0x49fbc9=_0x49fbc9||0x1f4;return function(_0x338e79){logger[_0xbc79('0x25')](_0x338e79[_0xbc79('0x26')]);if(_0x338e79['name']){delete _0x338e79['name'];}_0x1654c2[_0xbc79('0x17')](_0x49fbc9)['send'](_0x338e79);};}exports[_0xbc79('0x27')]=function(_0x28792b,_0x51822c){var _0xdfaab0={},_0x25f2e3={},_0x6e91b6={'count':0x0,'rows':[]};var _0x19d789=_[_0xbc79('0x28')](db[_0xbc79('0x29')][_0xbc79('0x2a')],function(_0x4ffcad){return{'name':_0x4ffcad[_0xbc79('0x2b')],'type':_0x4ffcad[_0xbc79('0x2c')][_0xbc79('0x2d')]};});_0x25f2e3[_0xbc79('0x2e')]=_[_0xbc79('0x28')](_0x19d789,_0xbc79('0x2f'));_0x25f2e3['query']=_[_0xbc79('0x30')](_0x28792b['query']);_0x25f2e3['filters']=_[_0xbc79('0x31')](_0x25f2e3['model'],_0x25f2e3[_0xbc79('0x32')]);_0xdfaab0[_0xbc79('0x33')]=_[_0xbc79('0x31')](_0x25f2e3[_0xbc79('0x2e')],qs[_0xbc79('0x34')](_0x28792b[_0xbc79('0x32')][_0xbc79('0x34')]));_0xdfaab0[_0xbc79('0x33')]=_0xdfaab0[_0xbc79('0x33')][_0xbc79('0x35')]?_0xdfaab0[_0xbc79('0x33')]:_0x25f2e3[_0xbc79('0x2e')];if(!_0x28792b['query']['hasOwnProperty']('nolimit')){_0xdfaab0['limit']=qs[_0xbc79('0x1a')](_0x28792b[_0xbc79('0x32')]['limit']);_0xdfaab0[_0xbc79('0x1b')]=qs[_0xbc79('0x1b')](_0x28792b[_0xbc79('0x32')][_0xbc79('0x1b')]);}_0xdfaab0['order']=qs[_0xbc79('0x36')](_0x28792b[_0xbc79('0x32')]['sort']);_0xdfaab0['where']=qs[_0xbc79('0x37')](_[_0xbc79('0x38')](_0x28792b[_0xbc79('0x32')],_0x25f2e3[_0xbc79('0x37')]),_0x19d789);if(_0x28792b[_0xbc79('0x32')][_0xbc79('0x39')]){_0xdfaab0[_0xbc79('0x3a')]=_[_0xbc79('0x3b')](_0xdfaab0[_0xbc79('0x3a')],{'$or':_[_0xbc79('0x28')](_0x19d789,function(_0x2d3893){if(_0x2d3893['type']!==_0xbc79('0x3c')){var _0x8eae2a={};_0x8eae2a[_0x2d3893[_0xbc79('0x2f')]]={'$like':'%'+_0x28792b['query'][_0xbc79('0x39')]+'%'};return _0x8eae2a;}})});}_0xdfaab0=_['merge']({},_0xdfaab0,_0x28792b[_0xbc79('0x3d')]);var _0x21ee80={'where':_0xdfaab0[_0xbc79('0x3a')]};return db['Automation'][_0xbc79('0x1c')](_0x21ee80)[_0xbc79('0x22')](function(_0x57f266){_0x6e91b6[_0xbc79('0x1c')]=_0x57f266;if(_0x28792b[_0xbc79('0x32')][_0xbc79('0x3e')]){_0xdfaab0[_0xbc79('0x3f')]=[{'all':!![]}];}return db['Automation'][_0xbc79('0x40')](_0xdfaab0);})[_0xbc79('0x22')](function(_0x387d31){_0x6e91b6[_0xbc79('0x41')]=_0x387d31;return _0x6e91b6;})[_0xbc79('0x22')](respondWithFilteredResult(_0x51822c,_0xdfaab0))[_0xbc79('0x42')](handleError(_0x51822c,null));};exports[_0xbc79('0x43')]=function(_0x261e1d,_0x41fc88){var _0xf3dac4={'raw':![],'where':{'id':_0x261e1d['params']['id']}},_0xd0c0d2={};_0xd0c0d2[_0xbc79('0x2e')]=_[_0xbc79('0x30')](db[_0xbc79('0x29')]['rawAttributes']);_0xd0c0d2[_0xbc79('0x32')]=_['keys'](_0x261e1d[_0xbc79('0x32')]);_0xd0c0d2['filters']=_['intersection'](_0xd0c0d2['model'],_0xd0c0d2[_0xbc79('0x32')]);_0xf3dac4['attributes']=_[_0xbc79('0x31')](_0xd0c0d2[_0xbc79('0x2e')],qs[_0xbc79('0x34')](_0x261e1d[_0xbc79('0x32')][_0xbc79('0x34')]));_0xf3dac4[_0xbc79('0x33')]=_0xf3dac4['attributes'][_0xbc79('0x35')]?_0xf3dac4[_0xbc79('0x33')]:_0xd0c0d2[_0xbc79('0x2e')];if(_0x261e1d[_0xbc79('0x32')][_0xbc79('0x3e')]){_0xf3dac4['include']=[{'all':!![]}];}_0xf3dac4=_[_0xbc79('0x3b')]({},_0xf3dac4,_0x261e1d[_0xbc79('0x3d')]);return db[_0xbc79('0x29')]['find'](_0xf3dac4)[_0xbc79('0x22')](handleEntityNotFound(_0x41fc88,null))[_0xbc79('0x22')](respondWithResult(_0x41fc88,null))[_0xbc79('0x42')](handleError(_0x41fc88,null));};exports[_0xbc79('0x44')]=function(_0x556f50,_0x43c7e7){return db[_0xbc79('0x29')][_0xbc79('0x44')](_0x556f50['body'],{})[_0xbc79('0x22')](respondWithResult(_0x43c7e7,0xc9))[_0xbc79('0x42')](handleError(_0x43c7e7,null));};exports[_0xbc79('0x45')]=function(_0x1ec8f0,_0x431a85){if(_0x1ec8f0[_0xbc79('0x46')]['id']){delete _0x1ec8f0[_0xbc79('0x46')]['id'];}return db[_0xbc79('0x29')][_0xbc79('0x47')]({'where':{'id':_0x1ec8f0[_0xbc79('0x48')]['id']}})[_0xbc79('0x22')](handleEntityNotFound(_0x431a85,null))[_0xbc79('0x22')](saveUpdates(_0x1ec8f0[_0xbc79('0x46')],null))[_0xbc79('0x22')](respondWithResult(_0x431a85,null))[_0xbc79('0x42')](handleError(_0x431a85,null));};exports[_0xbc79('0x23')]=function(_0x198f1d,_0x190f6f){return db[_0xbc79('0x29')][_0xbc79('0x47')]({'where':{'id':_0x198f1d[_0xbc79('0x48')]['id']}})[_0xbc79('0x22')](handleEntityNotFound(_0x190f6f,null))[_0xbc79('0x22')](removeEntity(_0x190f6f,null))[_0xbc79('0x42')](handleError(_0x190f6f,null));};exports[_0xbc79('0x49')]=function(_0x3d949d,_0x3e9652,_0x3dfd15){return db['Condition'][_0xbc79('0x47')]({'where':{'id':_0x3d949d[_0xbc79('0x48')]['id']}})[_0xbc79('0x22')](handleEntityNotFound(_0x3e9652,null))[_0xbc79('0x22')](function(_0x252bad){if(_0x252bad){return _0x252bad[_0xbc79('0x49')](_0x3d949d[_0xbc79('0x46')]['ids'],_[_0xbc79('0x4a')](_0x3d949d[_0xbc79('0x46')],['ids','id'])||{});}})[_0xbc79('0x22')](respondWithResult(_0x3e9652,null))[_0xbc79('0x42')](handleError(_0x3e9652,null));};exports['getConditions']=function(_0x4441ae,_0x41da6d,_0x2a879a){var _0x932394={};var _0x8d6c9d={};var _0x14a2ee;var _0x3b3129;return db[_0xbc79('0x29')][_0xbc79('0x4b')]({'where':{'id':_0x4441ae[_0xbc79('0x48')]['id']}})[_0xbc79('0x22')](handleEntityNotFound(_0x41da6d,null))['then'](function(_0x34bc3f){if(_0x34bc3f){_0x14a2ee=_0x34bc3f;_0x8d6c9d[_0xbc79('0x2e')]=_[_0xbc79('0x30')](db[_0xbc79('0x4c')][_0xbc79('0x2a')]);_0x8d6c9d[_0xbc79('0x32')]=_[_0xbc79('0x30')](_0x4441ae[_0xbc79('0x32')]);_0x8d6c9d[_0xbc79('0x37')]=_[_0xbc79('0x31')](_0x8d6c9d[_0xbc79('0x2e')],_0x8d6c9d[_0xbc79('0x32')]);_0x932394[_0xbc79('0x33')]=_[_0xbc79('0x31')](_0x8d6c9d[_0xbc79('0x2e')],qs[_0xbc79('0x34')](_0x4441ae[_0xbc79('0x32')][_0xbc79('0x34')]));_0x932394[_0xbc79('0x33')]=_0x932394['attributes'][_0xbc79('0x35')]?_0x932394[_0xbc79('0x33')]:_0x8d6c9d[_0xbc79('0x2e')];_0x932394[_0xbc79('0x4d')]=qs['sort'](_0x4441ae[_0xbc79('0x32')][_0xbc79('0x36')]);_0x932394['where']=qs[_0xbc79('0x37')](_[_0xbc79('0x38')](_0x4441ae[_0xbc79('0x32')],_0x8d6c9d[_0xbc79('0x37')]));if(_0x4441ae['query']['filter']){_0x932394[_0xbc79('0x3a')]=_[_0xbc79('0x3b')](_0x932394[_0xbc79('0x3a')],{'$or':_['map'](_0x932394[_0xbc79('0x33')],function(_0x2861a2){var _0x3b8c9a={};_0x3b8c9a[_0x2861a2]={'$like':'%'+_0x4441ae[_0xbc79('0x32')][_0xbc79('0x39')]+'%'};return _0x3b8c9a;})});}_0x932394=_[_0xbc79('0x3b')]({},_0x932394,_0x4441ae[_0xbc79('0x3d')]);return _0x14a2ee[_0xbc79('0x4e')](_0x932394);}})[_0xbc79('0x22')](function(_0x477e9b){if(_0x477e9b){_0x3b3129=_0x477e9b[_0xbc79('0x35')];if(!_0x4441ae[_0xbc79('0x32')]['hasOwnProperty'](_0xbc79('0x4f'))){_0x932394[_0xbc79('0x1a')]=qs[_0xbc79('0x1a')](_0x4441ae[_0xbc79('0x32')]['limit']);_0x932394[_0xbc79('0x1b')]=qs[_0xbc79('0x1b')](_0x4441ae[_0xbc79('0x32')][_0xbc79('0x1b')]);}return _0x14a2ee[_0xbc79('0x4e')](_0x932394);}})['then'](function(_0xc7a506){if(_0xc7a506){return _0xc7a506?{'count':_0x3b3129,'rows':_0xc7a506}:null;}})[_0xbc79('0x22')](respondWithResult(_0x41da6d,null))['catch'](handleError(_0x41da6d,null));};exports[_0xbc79('0x50')]=function(_0x2aeb95,_0x3b51e2,_0x3321a2){return db[_0xbc79('0x51')]['find']({'where':{'id':_0x2aeb95[_0xbc79('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b51e2,null))['then'](function(_0x32d38c){if(_0x32d38c){return _0x32d38c['addActions'](_0x2aeb95['body'][_0xbc79('0x52')],_[_0xbc79('0x4a')](_0x2aeb95[_0xbc79('0x46')],['ids','id'])||{});}})[_0xbc79('0x22')](respondWithResult(_0x3b51e2,null))[_0xbc79('0x42')](handleError(_0x3b51e2,null));};exports[_0xbc79('0x53')]=function(_0x4b485d,_0x139d70,_0x2181e0){var _0x233e6e={};var _0x4b47b3={};var _0xd0edf4;var _0x4ddeef;return db[_0xbc79('0x29')]['findOne']({'where':{'id':_0x4b485d['params']['id']}})['then'](handleEntityNotFound(_0x139d70,null))[_0xbc79('0x22')](function(_0x2657fc){if(_0x2657fc){_0xd0edf4=_0x2657fc;_0x4b47b3[_0xbc79('0x2e')]=_[_0xbc79('0x30')](db[_0xbc79('0x51')]['rawAttributes']);_0x4b47b3[_0xbc79('0x32')]=_[_0xbc79('0x30')](_0x4b485d[_0xbc79('0x32')]);_0x4b47b3[_0xbc79('0x37')]=_['intersection'](_0x4b47b3['model'],_0x4b47b3[_0xbc79('0x32')]);_0x233e6e[_0xbc79('0x33')]=_['intersection'](_0x4b47b3['model'],qs[_0xbc79('0x34')](_0x4b485d[_0xbc79('0x32')][_0xbc79('0x34')]));_0x233e6e[_0xbc79('0x33')]=_0x233e6e[_0xbc79('0x33')][_0xbc79('0x35')]?_0x233e6e[_0xbc79('0x33')]:_0x4b47b3['model'];_0x233e6e[_0xbc79('0x4d')]=qs['sort'](_0x4b485d[_0xbc79('0x32')]['sort']);_0x233e6e['where']=qs[_0xbc79('0x37')](_['pick'](_0x4b485d[_0xbc79('0x32')],_0x4b47b3['filters']));if(_0x4b485d[_0xbc79('0x32')]['filter']){_0x233e6e[_0xbc79('0x3a')]=_[_0xbc79('0x3b')](_0x233e6e['where'],{'$or':_[_0xbc79('0x28')](_0x233e6e[_0xbc79('0x33')],function(_0x3eaa47){var _0x55e7b7={};_0x55e7b7[_0x3eaa47]={'$like':'%'+_0x4b485d[_0xbc79('0x32')]['filter']+'%'};return _0x55e7b7;})});}_0x233e6e=_['merge']({},_0x233e6e,_0x4b485d[_0xbc79('0x3d')]);return _0xd0edf4[_0xbc79('0x53')](_0x233e6e);}})['then'](function(_0x16dfb2){if(_0x16dfb2){_0x4ddeef=_0x16dfb2[_0xbc79('0x35')];if(!_0x4b485d['query'][_0xbc79('0x54')](_0xbc79('0x4f'))){_0x233e6e['limit']=qs[_0xbc79('0x1a')](_0x4b485d['query'][_0xbc79('0x1a')]);_0x233e6e[_0xbc79('0x1b')]=qs['offset'](_0x4b485d['query'][_0xbc79('0x1b')]);}return _0xd0edf4[_0xbc79('0x53')](_0x233e6e);}})['then'](function(_0x377ab7){if(_0x377ab7){return _0x377ab7?{'count':_0x4ddeef,'rows':_0x377ab7}:null;}})['then'](respondWithResult(_0x139d70,null))['catch'](handleError(_0x139d70,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 1d6b7bc..29497d4 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 _0x819d=['define','Automation','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports'];(function(_0x21c601,_0x26f456){var _0xd423f=function(_0x52bc27){while(--_0x52bc27){_0x21c601['push'](_0x21c601['shift']());}};_0xd423f(++_0x26f456);}(_0x819d,0x178));var _0xd819=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x819d[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xd819('0x0'));var util=require('util');var logger=require(_0xd819('0x1'))(_0xd819('0x2'));var moment=require('moment');var BPromise=require(_0xd819('0x3'));var rp=require(_0xd819('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd819('0x5'));var config=require(_0xd819('0x6'));var attributes=require(_0xd819('0x7'));module[_0xd819('0x8')]=function(_0x4665c4,_0x2c85a2){return _0x4665c4[_0xd819('0x9')](_0xd819('0xa'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea5e=['define','Automation','tools_automations','api','moment','bluebird','request-promise','path','rimraf','./automation.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xea5e,0x1a5));var _0xeea5=function(_0xb3546a,_0x716a9d){_0xb3546a=_0xb3546a-0x0;var _0x170e67=_0xea5e[_0xb3546a];return _0x170e67;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xeea5('0x0'));var moment=require(_0xeea5('0x1'));var BPromise=require(_0xeea5('0x2'));var rp=require(_0xeea5('0x3'));var fs=require('fs');var path=require(_0xeea5('0x4'));var rimraf=require(_0xeea5('0x5'));var config=require('../../config/environment');var attributes=require(_0xeea5('0x6'));module[_0xeea5('0x7')]=function(_0x514fb4,_0x5c3af5){return _0x514fb4[_0xeea5('0x8')](_0xeea5('0x9'),attributes,{'tableName':_0xeea5('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 ef5967c..16d4741 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 _0x486e=['Automation,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x400bf3,_0x111912){var _0x295212=function(_0x40bbaf){while(--_0x40bbaf){_0x400bf3['push'](_0x400bf3['shift']());}};_0x295212(++_0x111912);}(_0x486e,0xb2));var _0xe486=function(_0x315d6f,_0x8cb82c){_0x315d6f=_0x315d6f-0x0;var _0xe0f2ae=_0x486e[_0x315d6f];return _0xe0f2ae;};'use strict';var _=require(_0xe486('0x0'));var util=require(_0xe486('0x1'));var moment=require('moment');var BPromise=require(_0xe486('0x2'));var rs=require(_0xe486('0x3'));var fs=require('fs');var Redis=require(_0xe486('0x4'));var db=require(_0xe486('0x5'))['db'];var utils=require(_0xe486('0x6'));var logger=require(_0xe486('0x7'))(_0xe486('0x8'));var config=require(_0xe486('0x9'));var jayson=require(_0xe486('0xa'));var client=jayson[_0xe486('0xb')][_0xe486('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4fac5d,_0x2d0712,_0xea849d){return new BPromise(function(_0x8a85c7,_0x2114a5){return client[_0xe486('0xd')](_0x4fac5d,_0xea849d)[_0xe486('0xe')](function(_0x42c4b3){logger[_0xe486('0xf')]('Automation,\x20%s,\x20%s',_0x2d0712,'request\x20sent');logger[_0xe486('0x10')](_0xe486('0x11'),_0x2d0712,_0xe486('0x12'),JSON[_0xe486('0x13')](_0x42c4b3));if(_0x42c4b3[_0xe486('0x14')]){if(_0x42c4b3[_0xe486('0x14')][_0xe486('0x15')]===0x1f4){logger[_0xe486('0x14')](_0xe486('0x16'),_0x2d0712,_0x42c4b3['error']['message']);return _0x2114a5(_0x42c4b3[_0xe486('0x14')][_0xe486('0x17')]);}logger[_0xe486('0x14')]('Automation,\x20%s,\x20%s',_0x2d0712,_0x42c4b3['error'][_0xe486('0x17')]);return _0x8a85c7(_0x42c4b3['error'][_0xe486('0x17')]);}else{logger[_0xe486('0xf')](_0xe486('0x16'),_0x2d0712,_0xe486('0x12'));_0x8a85c7(_0x42c4b3['result']['message']);}})[_0xe486('0x18')](function(_0x21fca9){logger['error'](_0xe486('0x16'),_0x2d0712,_0x21fca9);_0x2114a5(_0x21fca9);});});} \ No newline at end of file +var _0x9458=['moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x9458,0x1b8));var _0x8945=function(_0xf1a8a6,_0x270451){_0xf1a8a6=_0xf1a8a6-0x0;var _0x49d0cc=_0x9458[_0xf1a8a6];return _0x49d0cc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8945('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8945('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x8945('0x2'));var logger=require(_0x8945('0x3'))(_0x8945('0x4'));var config=require(_0x8945('0x5'));var jayson=require(_0x8945('0x6'));var client=jayson[_0x8945('0x7')][_0x8945('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12187d,_0x928802,_0x1a2b8f){return new BPromise(function(_0x4aec0b,_0x29eaed){return client[_0x8945('0x9')](_0x12187d,_0x1a2b8f)[_0x8945('0xa')](function(_0x307b9e){logger[_0x8945('0xb')](_0x8945('0xc'),_0x928802,'request\x20sent');logger[_0x8945('0xd')](_0x8945('0xe'),_0x928802,'request\x20sent',JSON['stringify'](_0x307b9e));if(_0x307b9e[_0x8945('0xf')]){if(_0x307b9e['error'][_0x8945('0x10')]===0x1f4){logger[_0x8945('0xf')](_0x8945('0xc'),_0x928802,_0x307b9e[_0x8945('0xf')][_0x8945('0x11')]);return _0x29eaed(_0x307b9e[_0x8945('0xf')]['message']);}logger[_0x8945('0xf')](_0x8945('0xc'),_0x928802,_0x307b9e['error'][_0x8945('0x11')]);return _0x4aec0b(_0x307b9e[_0x8945('0xf')][_0x8945('0x11')]);}else{logger[_0x8945('0xb')](_0x8945('0xc'),_0x928802,_0x8945('0x12'));_0x4aec0b(_0x307b9e['result']['message']);}})[_0x8945('0x13')](function(_0x4c0b8f){logger['error'](_0x8945('0xc'),_0x928802,_0x4c0b8f);_0x29eaed(_0x4c0b8f);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 851d1a2..69977ee 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 _0x5fbd=['addActions','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','getActions','post','create','addConditions','/:id/actions'];(function(_0x199c03,_0x3254aa){var _0x11a7d4=function(_0x49e1da){while(--_0x49e1da){_0x199c03['push'](_0x199c03['shift']());}};_0x11a7d4(++_0x3254aa);}(_0x5fbd,0xea));var _0xd5fb=function(_0x58a4f9,_0x117cd){_0x58a4f9=_0x58a4f9-0x0;var _0x27f2ab=_0x5fbd[_0x58a4f9];return _0x27f2ab;};'use strict';var multer=require(_0xd5fb('0x0'));var util=require(_0xd5fb('0x1'));var path=require(_0xd5fb('0x2'));var timeout=require(_0xd5fb('0x3'));var express=require(_0xd5fb('0x4'));var router=express[_0xd5fb('0x5')]();var fs_extra=require(_0xd5fb('0x6'));var auth=require(_0xd5fb('0x7'));var interaction=require(_0xd5fb('0x8'));var config=require('../../config/environment');var controller=require(_0xd5fb('0x9'));router[_0xd5fb('0xa')]('/',auth[_0xd5fb('0xb')](),controller[_0xd5fb('0xc')]);router[_0xd5fb('0xa')](_0xd5fb('0xd'),auth[_0xd5fb('0xb')](),controller['show']);router[_0xd5fb('0xa')]('/:id/conditions',auth['isAuthenticated'](),controller['getConditions']);router[_0xd5fb('0xa')]('/:id/actions',auth[_0xd5fb('0xb')](),controller[_0xd5fb('0xe')]);router[_0xd5fb('0xf')]('/',auth[_0xd5fb('0xb')](),controller[_0xd5fb('0x10')]);router[_0xd5fb('0xf')]('/:id/conditions',auth['isAuthenticated'](),controller[_0xd5fb('0x11')]);router[_0xd5fb('0xf')](_0xd5fb('0x12'),auth['isAuthenticated'](),controller[_0xd5fb('0x13')]);router[_0xd5fb('0x14')](_0xd5fb('0xd'),auth['isAuthenticated'](),controller[_0xd5fb('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd5fb('0x16')]);module['exports']=router; \ No newline at end of file +var _0x35aa=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','getActions','post','addConditions','/:id/actions','addActions','put','update','exports','util','path'];(function(_0x4c15f9,_0xcf53db){var _0xfd429b=function(_0x28213b){while(--_0x28213b){_0x4c15f9['push'](_0x4c15f9['shift']());}};_0xfd429b(++_0xcf53db);}(_0x35aa,0xbe));var _0xa35a=function(_0xc6879,_0x84a966){_0xc6879=_0xc6879-0x0;var _0x54f7a4=_0x35aa[_0xc6879];return _0x54f7a4;};'use strict';var multer=require('multer');var util=require(_0xa35a('0x0'));var path=require(_0xa35a('0x1'));var timeout=require(_0xa35a('0x2'));var express=require(_0xa35a('0x3'));var router=express['Router']();var fs_extra=require(_0xa35a('0x4'));var auth=require(_0xa35a('0x5'));var interaction=require(_0xa35a('0x6'));var config=require(_0xa35a('0x7'));var controller=require(_0xa35a('0x8'));router[_0xa35a('0x9')]('/',auth[_0xa35a('0xa')](),controller[_0xa35a('0xb')]);router['get'](_0xa35a('0xc'),auth['isAuthenticated'](),controller[_0xa35a('0xd')]);router[_0xa35a('0x9')](_0xa35a('0xe'),auth[_0xa35a('0xa')](),controller[_0xa35a('0xf')]);router[_0xa35a('0x9')]('/:id/actions',auth[_0xa35a('0xa')](),controller[_0xa35a('0x10')]);router[_0xa35a('0x11')]('/',auth[_0xa35a('0xa')](),controller['create']);router[_0xa35a('0x11')](_0xa35a('0xe'),auth['isAuthenticated'](),controller[_0xa35a('0x12')]);router[_0xa35a('0x11')](_0xa35a('0x13'),auth[_0xa35a('0xa')](),controller[_0xa35a('0x14')]);router[_0xa35a('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xa35a('0x16')]);router['delete'](_0xa35a('0xc'),auth[_0xa35a('0xa')](),controller['destroy']);module[_0xa35a('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index cf1e8b2..9486825 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 _0xe3e7=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','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\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x47dc85,_0x3e8361){var _0x4d1959=function(_0x72495d){while(--_0x72495d){_0x47dc85['push'](_0x47dc85['shift']());}};_0x4d1959(++_0x3e8361);}(_0xe3e7,0xe0));var _0x7e3e=function(_0x2af411,_0x1193b8){_0x2af411=_0x2af411-0x0;var _0x2a0e39=_0xe3e7[_0x2af411];return _0x2a0e39;};'use strict';var Sequelize=require(_0x7e3e('0x0'));module[_0x7e3e('0x1')]={'name':{'type':Sequelize[_0x7e3e('0x2')],'unique':_0x7e3e('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7e3e('0x4')](_0x7e3e('0x5')),'allowNull':![],'defaultValue':_0x7e3e('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x7e3e('0x6')],'defaultValue':0x0,'comment':_0x7e3e('0x7')},'limitCalls':{'type':Sequelize[_0x7e3e('0x8')](0x4)[_0x7e3e('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x7e3e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7e3e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7e3e('0x8')](0x3)[_0x7e3e('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7e3e('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7e3e('0x8')](0x3)[_0x7e3e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7e3e('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7e3e('0x8')](0x5)[_0x7e3e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7e3e('0xc')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7e3e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x7e3e('0x8')](0x5)[_0x7e3e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7e3e('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7e3e('0x8')](0x3)[_0x7e3e('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7e3e('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7e3e('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7e3e('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x7e3e('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x7e3e('0x10'),_0x7e3e('0x11'),_0x7e3e('0x12')),'defaultValue':_0x7e3e('0x10')},'dialAMDActive':{'type':Sequelize[_0x7e3e('0x6')],'defaultValue':0x0,'comment':_0x7e3e('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7e3e('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7e3e('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7e3e('0x8')](0x9)[_0x7e3e('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7e3e('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7e3e('0x8')](0x9)[_0x7e3e('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7e3e('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x7e3e('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7e3e('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7e3e('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7e3e('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7e3e('0x8')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7e3e('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7e3e('0x8')](0x5)[_0x7e3e('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7e3e('0x8')](0x9)[_0x7e3e('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x7e3e('0x1a'),_0x7e3e('0x1b')),'defaultValue':_0x7e3e('0x1a')},'dialPrefix':{'type':Sequelize[_0x7e3e('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7e3e('0x8')](0x3)[_0x7e3e('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7e3e('0x1c')},'dialCutDigit':{'type':Sequelize[_0x7e3e('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7e3e('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7e3e('0x8')](0x3)[_0x7e3e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7e3e('0x8')](0x5)[_0x7e3e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7e3e('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x7e3e('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7e3e('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x7e3e('0x8')](0x5)[_0x7e3e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7e3e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7e3e('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7e3e('0x8')](0x5)[_0x7e3e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x7e3e('0x8')](0x3)[_0x7e3e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7e3e('0x21')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7e3e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7e3e('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7e3e('0x8')](0x3)[_0x7e3e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7e3e('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7e3e('0x8')](0x5)[_0x7e3e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7e3e('0x24')}}; \ No newline at end of file +var _0x866a=['never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always'];(function(_0x39285d,_0x4e7c32){var _0x5b809b=function(_0x1c0b21){while(--_0x1c0b21){_0x39285d['push'](_0x39285d['shift']());}};_0x5b809b(++_0x4e7c32);}(_0x866a,0x156));var _0xa866=function(_0x14909f,_0xe25f2e){_0x14909f=_0x14909f-0x0;var _0x19698c=_0x866a[_0x14909f];return _0x19698c;};'use strict';var Sequelize=require('sequelize');module[_0xa866('0x0')]={'name':{'type':Sequelize[_0xa866('0x1')],'unique':_0xa866('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa866('0x3')](_0xa866('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xa866('0x1')]},'active':{'type':Sequelize[_0xa866('0x5')],'defaultValue':0x0,'comment':_0xa866('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xa866('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa866('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa866('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa866('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xa866('0x9')](0x3)[_0xa866('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa866('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa866('0x9')](0x3)[_0xa866('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa866('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa866('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa866('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xa866('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa866('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa866('0x9')](0x5)[_0xa866('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa866('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa866('0x9')](0x3)[_0xa866('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa866('0x9')](0x5)[_0xa866('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa866('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa866('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa866('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa866('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xa866('0x3')](_0xa866('0x11'),_0xa866('0x12'),'onlyIfOpen'),'defaultValue':_0xa866('0x11')},'dialAMDActive':{'type':Sequelize[_0xa866('0x5')],'defaultValue':0x0,'comment':_0xa866('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xa866('0x9')](0x9)[_0xa866('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa866('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xa866('0x9')](0x9)[_0xa866('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa866('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa866('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa866('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa866('0x9')](0x9)[_0xa866('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa866('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xa866('0x9')](0x9)[_0xa866('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa866('0x9')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa866('0x9')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa866('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa866('0x9')](0x5)[_0xa866('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xa866('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa866('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xa866('0x1a'),_0xa866('0x1b')),'defaultValue':_0xa866('0x1a')},'dialPrefix':{'type':Sequelize[_0xa866('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xa866('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa866('0x1c')},'dialCutDigit':{'type':Sequelize[_0xa866('0x9')](0x3)[_0xa866('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa866('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa866('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa866('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa866('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xa866('0x9')](0x3)[_0xa866('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa866('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa866('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa866('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa866('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa866('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa866('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xa866('0x9')](0x3)[_0xa866('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa866('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa866('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa866('0x9')](0x3)[_0xa866('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa866('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa866('0x9')](0x5)[_0xa866('0x7')],'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 90814f2..e90fcbf 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 _0x25c2=['IvrCampaigns','userProfileId','autoAssociation','UserProfileResource','clone','params','keys','body','createdAt','updatedAt','create','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','hasOwnProperty','CampaignId','findAll','getHopperHistories','CmHopperHistory','order','getHopperFinals','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','omit','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','scheduledAt','ContactId','select','field','phone','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','ListId','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','sendStatus','error','name','map','Campaign','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x5a2946,_0x291bf1){var _0x3ec82a=function(_0xc0d2bc){while(--_0xc0d2bc){_0x5a2946['push'](_0x5a2946['shift']());}};_0x3ec82a(++_0x291bf1);}(_0x25c2,0xdd));var _0x225c=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0x25c2[_0x2962d5];return _0x273406;};'use strict';var emlformat=require(_0x225c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x225c('0x1'));var jsonpatch=require(_0x225c('0x2'));var rp=require('request-promise');var moment=require(_0x225c('0x3'));var BPromise=require(_0x225c('0x4'));var Mustache=require('mustache');var util=require(_0x225c('0x5'));var path=require(_0x225c('0x6'));var sox=require('sox');var csv=require(_0x225c('0x7'));var ejs=require(_0x225c('0x8'));var fs=require('fs');var fs_extra=require(_0x225c('0x9'));var _=require(_0x225c('0xa'));var squel=require(_0x225c('0xb'));var crypto=require(_0x225c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x225c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x225c('0xe'));var Redis=require(_0x225c('0xf'));var authService=require(_0x225c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x225c('0x11'));var hardwareService=require(_0x225c('0x12'));var logger=require(_0x225c('0x13'))(_0x225c('0x14'));var utils=require('../../config/utils');var config=require(_0x225c('0x15'));var licenseUtil=require(_0x225c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1384bd,_0x45368a){_0x45368a=_0x45368a||0xcc;return function(_0x18ab23){if(_0x18ab23){return _0x1384bd['sendStatus'](_0x45368a);}return _0x1384bd[_0x225c('0x17')](_0x45368a)[_0x225c('0x18')]();};}function respondWithResult(_0x33f961,_0x39d22d){_0x39d22d=_0x39d22d||0xc8;return function(_0x1f9782){if(_0x1f9782){return _0x33f961[_0x225c('0x17')](_0x39d22d)[_0x225c('0x19')](_0x1f9782);}};}function respondWithFilteredResult(_0x1b28d3,_0x51235b){return function(_0x5a2c4b){if(_0x5a2c4b){var _0x801c1b=typeof _0x51235b[_0x225c('0x1a')]===_0x225c('0x1b')&&typeof _0x51235b[_0x225c('0x1c')]==='undefined';var _0x3e1c8a=_0x5a2c4b[_0x225c('0x1d')];var _0x3d52ba=_0x801c1b?0x0:_0x51235b[_0x225c('0x1a')];var _0x5a9da9=_0x801c1b?_0x5a2c4b['count']:_0x51235b['offset']+_0x51235b[_0x225c('0x1c')];var _0x208a1a;if(_0x5a9da9>=_0x3e1c8a){_0x5a9da9=_0x3e1c8a;_0x208a1a=0xc8;}else{_0x208a1a=0xce;}_0x1b28d3[_0x225c('0x17')](_0x208a1a);return _0x1b28d3[_0x225c('0x1e')](_0x225c('0x1f'),_0x3d52ba+'-'+_0x5a9da9+'/'+_0x3e1c8a)[_0x225c('0x19')](_0x5a2c4b);}return null;};}function patchUpdates(_0x484cd6){return function(_0x32e525){try{jsonpatch[_0x225c('0x20')](_0x32e525,_0x484cd6,!![]);}catch(_0x33c38f){return BPromise[_0x225c('0x21')](_0x33c38f);}return _0x32e525[_0x225c('0x22')]();};}function saveUpdates(_0x56bb67,_0x2696ca){return function(_0x369e41){if(_0x369e41){return _0x369e41[_0x225c('0x23')](_0x56bb67)['then'](function(_0x4e0e11){return _0x4e0e11;});}return null;};}function removeEntity(_0x167a7c,_0x4abf2c){return function(_0x355523){if(_0x355523){return _0x355523[_0x225c('0x24')]()[_0x225c('0x25')](function(){var _0x107de1=_0x355523[_0x225c('0x26')]({'plain':!![]});var _0x132f82='IvrCampaigns';return db['UserProfileResource'][_0x225c('0x24')]({'where':{'type':_0x132f82,'resourceId':_0x107de1['id']}})[_0x225c('0x25')](function(){return _0x355523;});})['then'](function(){_0x167a7c[_0x225c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35acd5,_0x572380){return function(_0x5aa346){if(!_0x5aa346){_0x35acd5[_0x225c('0x27')](0x194);}return _0x5aa346;};}function handleError(_0x50ace7,_0x569685){_0x569685=_0x569685||0x1f4;return function(_0x51f413){logger[_0x225c('0x28')](_0x51f413['stack']);if(_0x51f413[_0x225c('0x29')]){delete _0x51f413[_0x225c('0x29')];}_0x50ace7[_0x225c('0x17')](_0x569685)['send'](_0x51f413);};}exports['index']=function(_0x4f17e7,_0x347f8f){var _0x75cc09={},_0x2169e1={},_0x13306e={'count':0x0,'rows':[]};var _0x5ee044=_[_0x225c('0x2a')](db[_0x225c('0x2b')][_0x225c('0x2c')],function(_0x295dde){return{'name':_0x295dde[_0x225c('0x2d')],'type':_0x295dde[_0x225c('0x2e')][_0x225c('0x2f')]};});_0x2169e1[_0x225c('0x30')]=_[_0x225c('0x2a')](_0x5ee044,_0x225c('0x29'));_0x2169e1['query']=_['keys'](_0x4f17e7[_0x225c('0x31')]);_0x2169e1[_0x225c('0x32')]=_['intersection'](_0x2169e1[_0x225c('0x30')],_0x2169e1['query']);_0x75cc09[_0x225c('0x33')]=_[_0x225c('0x34')](_0x2169e1['model'],qs['fields'](_0x4f17e7[_0x225c('0x31')][_0x225c('0x35')]));_0x75cc09[_0x225c('0x33')]=_0x75cc09[_0x225c('0x33')][_0x225c('0x36')]?_0x75cc09[_0x225c('0x33')]:_0x2169e1[_0x225c('0x30')];if(!_0x4f17e7[_0x225c('0x31')]['hasOwnProperty'](_0x225c('0x37'))){_0x75cc09[_0x225c('0x1c')]=qs['limit'](_0x4f17e7[_0x225c('0x31')][_0x225c('0x1c')]);_0x75cc09[_0x225c('0x1a')]=qs[_0x225c('0x1a')](_0x4f17e7[_0x225c('0x31')][_0x225c('0x1a')]);}_0x75cc09['order']=qs[_0x225c('0x38')](_0x4f17e7[_0x225c('0x31')]['sort']);_0x75cc09[_0x225c('0x39')]=qs[_0x225c('0x32')](_[_0x225c('0x3a')](_0x4f17e7['query'],_0x2169e1[_0x225c('0x32')]),_0x5ee044);if(_0x4f17e7[_0x225c('0x31')][_0x225c('0x3b')]){_0x75cc09[_0x225c('0x39')]=_[_0x225c('0x3c')](_0x75cc09[_0x225c('0x39')],{'$or':_[_0x225c('0x2a')](_0x5ee044,function(_0x48fbe9){if(_0x48fbe9[_0x225c('0x2e')]!==_0x225c('0x3d')){var _0x127de6={};_0x127de6[_0x48fbe9[_0x225c('0x29')]]={'$like':'%'+_0x4f17e7[_0x225c('0x31')][_0x225c('0x3b')]+'%'};return _0x127de6;}})});}_0x75cc09=_['merge']({},_0x75cc09,_0x4f17e7[_0x225c('0x3e')]);var _0xaef377={'where':_0x75cc09[_0x225c('0x39')]};return db[_0x225c('0x2b')][_0x225c('0x1d')](_0xaef377)['then'](function(_0x2048bc){_0x13306e[_0x225c('0x1d')]=_0x2048bc;if(_0x4f17e7[_0x225c('0x31')][_0x225c('0x3f')]){_0x75cc09[_0x225c('0x40')]=[{'all':!![]}];}return db[_0x225c('0x2b')]['findAll'](_0x75cc09);})[_0x225c('0x25')](function(_0x35f3b1){_0x13306e[_0x225c('0x41')]=_0x35f3b1;return _0x13306e;})[_0x225c('0x25')](respondWithFilteredResult(_0x347f8f,_0x75cc09))[_0x225c('0x42')](handleError(_0x347f8f,null));};exports['show']=function(_0x5b326c,_0x1847a6){var _0x19d3da={'raw':![],'where':{'id':_0x5b326c['params']['id']}},_0x335cd2={};_0x335cd2['model']=_['keys'](db['Campaign'][_0x225c('0x2c')]);_0x335cd2[_0x225c('0x31')]=_['keys'](_0x5b326c[_0x225c('0x31')]);_0x335cd2[_0x225c('0x32')]=_[_0x225c('0x34')](_0x335cd2['model'],_0x335cd2['query']);_0x19d3da[_0x225c('0x33')]=_[_0x225c('0x34')](_0x335cd2[_0x225c('0x30')],qs[_0x225c('0x35')](_0x5b326c['query']['fields']));_0x19d3da['attributes']=_0x19d3da[_0x225c('0x33')][_0x225c('0x36')]?_0x19d3da[_0x225c('0x33')]:_0x335cd2['model'];if(_0x5b326c[_0x225c('0x31')][_0x225c('0x3f')]){_0x19d3da[_0x225c('0x40')]=[{'all':!![]}];}_0x19d3da=_[_0x225c('0x3c')]({},_0x19d3da,_0x5b326c[_0x225c('0x3e')]);return db[_0x225c('0x2b')][_0x225c('0x43')](_0x19d3da)[_0x225c('0x25')](handleEntityNotFound(_0x1847a6,null))[_0x225c('0x25')](respondWithResult(_0x1847a6,null))['catch'](handleError(_0x1847a6,null));};exports['create']=function(_0x443350,_0x1be7d6){return db[_0x225c('0x2b')]['create'](_0x443350['body'],{})[_0x225c('0x25')](function(_0x370b73){var _0x42d48d=_0x443350[_0x225c('0x44')]['get']({'plain':!![]});if(!_0x42d48d)throw new Error(_0x225c('0x45'));if(_0x42d48d[_0x225c('0x46')]===_0x225c('0x44')){var _0x38921f=_0x370b73['get']({'plain':!![]});var _0x35ddee=_0x225c('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x35ddee,'userProfileId':_0x42d48d[_0x225c('0x48')]},'raw':!![]})[_0x225c('0x25')](function(_0x4ef0b8){if(_0x4ef0b8&&_0x4ef0b8[_0x225c('0x49')]===0x0){return db[_0x225c('0x4a')]['create']({'name':_0x38921f['name'],'resourceId':_0x38921f['id'],'type':_0x4ef0b8[_0x225c('0x29')],'sectionId':_0x4ef0b8['id']},{})[_0x225c('0x25')](function(){return _0x370b73;});}else{return _0x370b73;}})[_0x225c('0x42')](function(_0x1bb064){logger[_0x225c('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1bb064);throw _0x1bb064;});}return _0x370b73;})[_0x225c('0x25')](respondWithResult(_0x1be7d6,0xc9))['catch'](handleError(_0x1be7d6,null));};exports[_0x225c('0x4b')]=function(_0x43497b,_0x587ec5){var _0x1d473b={'where':{'id':_0x43497b[_0x225c('0x4c')]['id']}},_0x3d0b7e={};_0x3d0b7e['model']=_[_0x225c('0x4d')](db[_0x225c('0x2b')][_0x225c('0x2c')]);_0x1d473b[_0x225c('0x33')]=_[_0x225c('0x34')](_0x3d0b7e[_0x225c('0x30')],qs[_0x225c('0x35')](_0x43497b['query'][_0x225c('0x35')]));_0x1d473b[_0x225c('0x33')]=_0x1d473b[_0x225c('0x33')][_0x225c('0x36')]?_0x1d473b['attributes']:_0x3d0b7e['model'];if(_0x43497b[_0x225c('0x31')][_0x225c('0x3f')]){_0x1d473b[_0x225c('0x40')]=[{'all':!![]}];}_0x1d473b=_[_0x225c('0x3c')]({},_0x1d473b,_0x43497b[_0x225c('0x3e')]);return db[_0x225c('0x2b')][_0x225c('0x43')](_0x1d473b)['then'](handleEntityNotFound(_0x587ec5,null))[_0x225c('0x25')](function(_0x2a5fb8){if(_0x2a5fb8){var _0x5a7d60=_0x2a5fb8[_0x225c('0x26')]({'plain':!![]});_0x5a7d60=qs['omit'](_0x5a7d60,['id','createdAt','updatedAt']);_0x43497b[_0x225c('0x4e')]=_['omit'](_0x43497b['body'],['id',_0x225c('0x4f'),_0x225c('0x50')]);return db['Campaign'][_0x225c('0x51')](_[_0x225c('0x3c')](_0x5a7d60,_0x43497b[_0x225c('0x4e')]),{'include':_0x43497b['query'][_0x225c('0x3f')]?[{'all':!![]}]:undefined})[_0x225c('0x25')](function(_0x4e93e1){var _0x777aa0=_0x43497b[_0x225c('0x44')][_0x225c('0x26')]({'plain':!![]});if(!_0x777aa0)throw new Error(_0x225c('0x45'));if(_0x777aa0['role']===_0x225c('0x44')){var _0x3d62b1=_0x4e93e1[_0x225c('0x26')]({'plain':!![]});var _0x53a31b='IvrCampaigns';return db[_0x225c('0x52')][_0x225c('0x43')]({'where':{'name':_0x53a31b,'userProfileId':_0x777aa0[_0x225c('0x48')]},'raw':!![]})[_0x225c('0x25')](function(_0x2ee88c){if(_0x2ee88c&&_0x2ee88c['autoAssociation']===0x0){return db[_0x225c('0x4a')][_0x225c('0x51')]({'name':_0x3d62b1[_0x225c('0x29')],'resourceId':_0x3d62b1['id'],'type':_0x2ee88c[_0x225c('0x29')],'sectionId':_0x2ee88c['id']},{})[_0x225c('0x25')](function(){return _0x4e93e1;});}else{return _0x4e93e1;}})['catch'](function(_0x55541c){logger[_0x225c('0x28')](_0x225c('0x53'),_0x55541c);throw _0x55541c;});}return _0x4e93e1;});}})[_0x225c('0x25')](respondWithResult(_0x587ec5,0xc9))['catch'](handleError(_0x587ec5,null));};exports['update']=function(_0x5585e1,_0x13147b){if(_0x5585e1[_0x225c('0x4e')]['id']){delete _0x5585e1[_0x225c('0x4e')]['id'];}return db[_0x225c('0x2b')][_0x225c('0x43')]({'where':{'id':_0x5585e1[_0x225c('0x4c')]['id']}})[_0x225c('0x25')](handleEntityNotFound(_0x13147b,null))['then'](saveUpdates(_0x5585e1[_0x225c('0x4e')],null))[_0x225c('0x25')](respondWithResult(_0x13147b,null))[_0x225c('0x42')](handleError(_0x13147b,null));};exports[_0x225c('0x24')]=function(_0x376dc8,_0x58c8ab){return db['Campaign']['find']({'where':{'id':_0x376dc8[_0x225c('0x4c')]['id']}})[_0x225c('0x25')](handleEntityNotFound(_0x58c8ab,null))[_0x225c('0x25')](removeEntity(_0x58c8ab,null))[_0x225c('0x42')](handleError(_0x58c8ab,null));};exports['getHoppers']=function(_0x16abff,_0x1583e4,_0xb0ba24){var _0x2510b3={'raw':!![],'where':{}};var _0x795c86={};var _0x6c9775={'count':0x0,'rows':[]};return db[_0x225c('0x2b')][_0x225c('0x54')]({'where':{'id':_0x16abff['params']['id']}})[_0x225c('0x25')](handleEntityNotFound(_0x1583e4,null))[_0x225c('0x25')](function(_0x124ecc){if(_0x124ecc){_0x795c86[_0x225c('0x30')]=_['keys'](db[_0x225c('0x55')][_0x225c('0x2c')]);_0x795c86[_0x225c('0x31')]=_[_0x225c('0x4d')](_0x16abff[_0x225c('0x31')]);_0x795c86[_0x225c('0x32')]=_[_0x225c('0x34')](_0x795c86[_0x225c('0x30')],_0x795c86[_0x225c('0x31')]);_0x2510b3['attributes']=_['intersection'](_0x795c86['model'],qs[_0x225c('0x35')](_0x16abff[_0x225c('0x31')]['fields']));_0x2510b3[_0x225c('0x33')]=_0x2510b3[_0x225c('0x33')]['length']?_0x2510b3['attributes']:_0x795c86[_0x225c('0x30')];if(!_0x16abff[_0x225c('0x31')][_0x225c('0x56')](_0x225c('0x37'))){_0x2510b3[_0x225c('0x1c')]=qs[_0x225c('0x1c')](_0x16abff[_0x225c('0x31')][_0x225c('0x1c')]);_0x2510b3[_0x225c('0x1a')]=qs[_0x225c('0x1a')](_0x16abff[_0x225c('0x31')][_0x225c('0x1a')]);}_0x2510b3['order']=qs[_0x225c('0x38')](_0x16abff[_0x225c('0x31')][_0x225c('0x38')]);_0x2510b3['where']=qs[_0x225c('0x32')](_[_0x225c('0x3a')](_0x16abff[_0x225c('0x31')],_0x795c86[_0x225c('0x32')]));_0x2510b3['where'][_0x225c('0x57')]=_0x124ecc['id'];if(_0x16abff[_0x225c('0x31')][_0x225c('0x3b')]){_0x2510b3['where']=_[_0x225c('0x3c')](_0x2510b3[_0x225c('0x39')],{'$or':_[_0x225c('0x2a')](_0x2510b3[_0x225c('0x33')],function(_0x43658f){var _0x21b103={};_0x21b103[_0x43658f]={'$like':'%'+_0x16abff[_0x225c('0x31')][_0x225c('0x3b')]+'%'};return _0x21b103;})});}_0x2510b3=_[_0x225c('0x3c')]({},_0x2510b3,_0x16abff['options']);return db[_0x225c('0x55')][_0x225c('0x1d')]({'where':_0x2510b3[_0x225c('0x39')]})[_0x225c('0x25')](function(_0xa01ece){_0x6c9775[_0x225c('0x1d')]=_0xa01ece;if(_0x16abff['query'][_0x225c('0x3f')]){_0x2510b3[_0x225c('0x40')]=[{'all':!![]}];}return db['CmHopper'][_0x225c('0x58')](_0x2510b3);})[_0x225c('0x25')](function(_0x403c94){_0x6c9775[_0x225c('0x41')]=_0x403c94;return _0x6c9775;});}})[_0x225c('0x25')](respondWithFilteredResult(_0x1583e4,_0x2510b3))[_0x225c('0x42')](handleError(_0x1583e4,null));};exports[_0x225c('0x59')]=function(_0x1b1a85,_0x28ae3a,_0x5df5bf){var _0x191867={'raw':!![],'where':{}};var _0x4f172f={};var _0x5cdd44={'count':0x0,'rows':[]};return db[_0x225c('0x2b')]['findOne']({'where':{'id':_0x1b1a85[_0x225c('0x4c')]['id']}})[_0x225c('0x25')](handleEntityNotFound(_0x28ae3a,null))['then'](function(_0x2dfdd5){if(_0x2dfdd5){_0x4f172f[_0x225c('0x30')]=_[_0x225c('0x4d')](db[_0x225c('0x5a')][_0x225c('0x2c')]);_0x4f172f[_0x225c('0x31')]=_['keys'](_0x1b1a85['query']);_0x4f172f[_0x225c('0x32')]=_[_0x225c('0x34')](_0x4f172f[_0x225c('0x30')],_0x4f172f[_0x225c('0x31')]);_0x191867['attributes']=_[_0x225c('0x34')](_0x4f172f['model'],qs[_0x225c('0x35')](_0x1b1a85['query'][_0x225c('0x35')]));_0x191867[_0x225c('0x33')]=_0x191867[_0x225c('0x33')]['length']?_0x191867[_0x225c('0x33')]:_0x4f172f[_0x225c('0x30')];if(!_0x1b1a85['query'][_0x225c('0x56')]('nolimit')){_0x191867[_0x225c('0x1c')]=qs[_0x225c('0x1c')](_0x1b1a85[_0x225c('0x31')]['limit']);_0x191867[_0x225c('0x1a')]=qs[_0x225c('0x1a')](_0x1b1a85[_0x225c('0x31')][_0x225c('0x1a')]);}_0x191867[_0x225c('0x5b')]=qs[_0x225c('0x38')](_0x1b1a85[_0x225c('0x31')][_0x225c('0x38')]);_0x191867[_0x225c('0x39')]=qs['filters'](_[_0x225c('0x3a')](_0x1b1a85[_0x225c('0x31')],_0x4f172f[_0x225c('0x32')]));_0x191867[_0x225c('0x39')][_0x225c('0x57')]=_0x2dfdd5['id'];if(_0x1b1a85[_0x225c('0x31')][_0x225c('0x3b')]){_0x191867['where']=_[_0x225c('0x3c')](_0x191867['where'],{'$or':_[_0x225c('0x2a')](_0x191867[_0x225c('0x33')],function(_0x5643a9){var _0x360bc9={};_0x360bc9[_0x5643a9]={'$like':'%'+_0x1b1a85[_0x225c('0x31')][_0x225c('0x3b')]+'%'};return _0x360bc9;})});}_0x191867=_[_0x225c('0x3c')]({},_0x191867,_0x1b1a85[_0x225c('0x3e')]);return db[_0x225c('0x5a')][_0x225c('0x1d')]({'where':_0x191867[_0x225c('0x39')]})[_0x225c('0x25')](function(_0x487b3b){_0x5cdd44['count']=_0x487b3b;if(_0x1b1a85['query'][_0x225c('0x3f')]){_0x191867[_0x225c('0x40')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x191867);})[_0x225c('0x25')](function(_0x222852){_0x5cdd44['rows']=_0x222852;return _0x5cdd44;});}})[_0x225c('0x25')](respondWithFilteredResult(_0x28ae3a,_0x191867))[_0x225c('0x42')](handleError(_0x28ae3a,null));};exports[_0x225c('0x5c')]=function(_0x5c999b,_0x2a4b22,_0x4794c1){var _0x1ae02f={'raw':!![],'where':{}};var _0x17866d={};var _0x2511f3={'count':0x0,'rows':[]};return db[_0x225c('0x2b')][_0x225c('0x54')]({'where':{'id':_0x5c999b['params']['id']}})[_0x225c('0x25')](handleEntityNotFound(_0x2a4b22,null))['then'](function(_0x595d57){if(_0x595d57){_0x17866d['model']=_[_0x225c('0x4d')](db['CmHopperFinal'][_0x225c('0x2c')]);_0x17866d['query']=_[_0x225c('0x4d')](_0x5c999b[_0x225c('0x31')]);_0x17866d[_0x225c('0x32')]=_[_0x225c('0x34')](_0x17866d[_0x225c('0x30')],_0x17866d[_0x225c('0x31')]);_0x1ae02f[_0x225c('0x33')]=_['intersection'](_0x17866d[_0x225c('0x30')],qs[_0x225c('0x35')](_0x5c999b[_0x225c('0x31')]['fields']));_0x1ae02f['attributes']=_0x1ae02f['attributes']['length']?_0x1ae02f['attributes']:_0x17866d[_0x225c('0x30')];if(!_0x5c999b['query'][_0x225c('0x56')]('nolimit')){_0x1ae02f[_0x225c('0x1c')]=qs[_0x225c('0x1c')](_0x5c999b[_0x225c('0x31')][_0x225c('0x1c')]);_0x1ae02f[_0x225c('0x1a')]=qs[_0x225c('0x1a')](_0x5c999b['query']['offset']);}_0x1ae02f[_0x225c('0x5b')]=qs[_0x225c('0x38')](_0x5c999b[_0x225c('0x31')][_0x225c('0x38')]);_0x1ae02f[_0x225c('0x39')]=qs[_0x225c('0x32')](_[_0x225c('0x3a')](_0x5c999b[_0x225c('0x31')],_0x17866d[_0x225c('0x32')]));_0x1ae02f[_0x225c('0x39')][_0x225c('0x57')]=_0x595d57['id'];if(_0x5c999b['query'][_0x225c('0x3b')]){_0x1ae02f[_0x225c('0x39')]=_[_0x225c('0x3c')](_0x1ae02f[_0x225c('0x39')],{'$or':_[_0x225c('0x2a')](_0x1ae02f['attributes'],function(_0x1d5c27){var _0xa89f9a={};_0xa89f9a[_0x1d5c27]={'$like':'%'+_0x5c999b[_0x225c('0x31')][_0x225c('0x3b')]+'%'};return _0xa89f9a;})});}_0x1ae02f=_[_0x225c('0x3c')]({},_0x1ae02f,_0x5c999b[_0x225c('0x3e')]);return db['CmHopperFinal']['count']({'where':_0x1ae02f['where']})[_0x225c('0x25')](function(_0x1c10d7){_0x2511f3[_0x225c('0x1d')]=_0x1c10d7;if(_0x5c999b[_0x225c('0x31')]['includeAll']){_0x1ae02f[_0x225c('0x40')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x1ae02f);})[_0x225c('0x25')](function(_0x38453f){_0x2511f3[_0x225c('0x41')]=_0x38453f;return _0x2511f3;});}})[_0x225c('0x25')](respondWithFilteredResult(_0x2a4b22,_0x1ae02f))['catch'](handleError(_0x2a4b22,null));};exports[_0x225c('0x5d')]=function(_0x2bcba6,_0x30b666,_0x52fd41){var _0x324c4f={'raw':!![],'where':{}};var _0x1d88a1={};var _0x5590d3={'count':0x0,'rows':[]};return db[_0x225c('0x2b')][_0x225c('0x54')]({'where':{'id':_0x2bcba6[_0x225c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x30b666,null))[_0x225c('0x25')](function(_0x20988a){if(_0x20988a){_0x1d88a1[_0x225c('0x30')]=_[_0x225c('0x4d')](db[_0x225c('0x5e')][_0x225c('0x2c')]);_0x1d88a1[_0x225c('0x31')]=_[_0x225c('0x4d')](_0x2bcba6[_0x225c('0x31')]);_0x1d88a1[_0x225c('0x32')]=_[_0x225c('0x34')](_0x1d88a1['model'],_0x1d88a1[_0x225c('0x31')]);_0x324c4f[_0x225c('0x33')]=_[_0x225c('0x34')](_0x1d88a1['model'],qs[_0x225c('0x35')](_0x2bcba6[_0x225c('0x31')][_0x225c('0x35')]));_0x324c4f[_0x225c('0x33')]=_0x324c4f['attributes']['length']?_0x324c4f['attributes']:_0x1d88a1[_0x225c('0x30')];if(!_0x2bcba6['query'][_0x225c('0x56')](_0x225c('0x37'))){_0x324c4f[_0x225c('0x1c')]=qs[_0x225c('0x1c')](_0x2bcba6[_0x225c('0x31')][_0x225c('0x1c')]);_0x324c4f[_0x225c('0x1a')]=qs[_0x225c('0x1a')](_0x2bcba6[_0x225c('0x31')][_0x225c('0x1a')]);}_0x324c4f[_0x225c('0x5b')]=qs['sort'](_0x2bcba6[_0x225c('0x31')][_0x225c('0x38')]);_0x324c4f['where']=qs['filters'](_[_0x225c('0x3a')](_0x2bcba6[_0x225c('0x31')],_0x1d88a1[_0x225c('0x32')]));_0x324c4f[_0x225c('0x39')]['CampaignId']=_0x20988a['id'];if(_0x2bcba6[_0x225c('0x31')][_0x225c('0x3b')]){_0x324c4f[_0x225c('0x39')]=_[_0x225c('0x3c')](_0x324c4f[_0x225c('0x39')],{'$or':_[_0x225c('0x2a')](_0x324c4f[_0x225c('0x33')],function(_0x21986e){var _0x1ededd={};_0x1ededd[_0x21986e]={'$like':'%'+_0x2bcba6[_0x225c('0x31')][_0x225c('0x3b')]+'%'};return _0x1ededd;})});}_0x324c4f=_[_0x225c('0x3c')]({},_0x324c4f,_0x2bcba6[_0x225c('0x3e')]);return db['CmHopperBlack'][_0x225c('0x1d')]({'where':_0x324c4f[_0x225c('0x39')]})[_0x225c('0x25')](function(_0x416732){_0x5590d3[_0x225c('0x1d')]=_0x416732;if(_0x2bcba6[_0x225c('0x31')]['includeAll']){_0x324c4f['include']=[{'all':!![]}];}return db[_0x225c('0x5e')][_0x225c('0x58')](_0x324c4f);})[_0x225c('0x25')](function(_0x3e9423){_0x5590d3['rows']=_0x3e9423;return _0x5590d3;});}})[_0x225c('0x25')](respondWithFilteredResult(_0x30b666,_0x324c4f))[_0x225c('0x42')](handleError(_0x30b666,null));};exports[_0x225c('0x5f')]=function(_0x545998,_0x342005,_0x5d210b){var _0x5d46b8={};var _0x1e5ef8={};var _0x409440;var _0x2986c2;return db[_0x225c('0x2b')][_0x225c('0x54')]({'where':{'id':_0x545998[_0x225c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x342005,null))[_0x225c('0x25')](function(_0x1fc199){if(_0x1fc199){_0x409440=_0x1fc199;_0x1e5ef8[_0x225c('0x30')]=_['keys'](db[_0x225c('0x60')]['rawAttributes']);_0x1e5ef8['query']=_[_0x225c('0x4d')](_0x545998['query']);_0x1e5ef8[_0x225c('0x32')]=_[_0x225c('0x34')](_0x1e5ef8['model'],_0x1e5ef8['query']);_0x5d46b8['attributes']=_[_0x225c('0x34')](_0x1e5ef8['model'],qs['fields'](_0x545998[_0x225c('0x31')][_0x225c('0x35')]));_0x5d46b8[_0x225c('0x33')]=_0x5d46b8['attributes']['length']?_0x5d46b8[_0x225c('0x33')]:_0x1e5ef8[_0x225c('0x30')];_0x5d46b8[_0x225c('0x5b')]=qs[_0x225c('0x38')](_0x545998[_0x225c('0x31')][_0x225c('0x38')]);_0x5d46b8[_0x225c('0x39')]=qs[_0x225c('0x32')](_[_0x225c('0x3a')](_0x545998[_0x225c('0x31')],_0x1e5ef8[_0x225c('0x32')]));if(_0x545998[_0x225c('0x31')][_0x225c('0x3b')]){_0x5d46b8[_0x225c('0x39')]=_[_0x225c('0x3c')](_0x5d46b8[_0x225c('0x39')],{'$or':_['map'](_0x5d46b8['attributes'],function(_0x180910){var _0x36d817={};_0x36d817[_0x180910]={'$like':'%'+_0x545998['query'][_0x225c('0x3b')]+'%'};return _0x36d817;})});}_0x5d46b8=_[_0x225c('0x3c')]({},_0x5d46b8,_0x545998['options']);return _0x409440[_0x225c('0x5f')](_0x5d46b8);}})['then'](function(_0xecf20d){if(_0xecf20d){_0x2986c2=_0xecf20d['length'];if(!_0x545998[_0x225c('0x31')][_0x225c('0x56')]('nolimit')){_0x5d46b8[_0x225c('0x1c')]=qs['limit'](_0x545998[_0x225c('0x31')][_0x225c('0x1c')]);_0x5d46b8[_0x225c('0x1a')]=qs[_0x225c('0x1a')](_0x545998[_0x225c('0x31')][_0x225c('0x1a')]);}return _0x409440['getLists'](_0x5d46b8);}})[_0x225c('0x25')](function(_0x41d495){if(_0x41d495){return _0x41d495?{'count':_0x2986c2,'rows':_0x41d495}:null;}})[_0x225c('0x25')](respondWithResult(_0x342005,null))[_0x225c('0x42')](handleError(_0x342005,null));};exports[_0x225c('0x61')]=function(_0x2b7a0d,_0x542d5f,_0x3ecb18){var _0x26aba7,_0x3da95e;var _0x2efd7d=[];var _0xd98444=moment()[_0x225c('0x62')](_0x225c('0x63'));return db[_0x225c('0x2b')][_0x225c('0x43')]({'where':{'id':_0x2b7a0d['params']['id']}})[_0x225c('0x25')](handleEntityNotFound(_0x542d5f,null))[_0x225c('0x25')](function(_0x1b57c6){if(_0x1b57c6){_0x3da95e=_0x1b57c6;return _0x1b57c6['addLists'](_0x2b7a0d[_0x225c('0x4e')][_0x225c('0x64')],_[_0x225c('0x65')](_0x2b7a0d[_0x225c('0x4e')],['ids','id'])||{});}return null;})['spread'](function(_0xf514d3){var _0x45469;var _0x42ecec;_0x26aba7=_0xf514d3||[];var _0x26dd54=[];if(_0xf514d3){for(var _0x328bdc=0x0;_0x328bdc<_0xf514d3[_0x225c('0x36')];_0x328bdc+=0x1){var _0x24a571=_0xf514d3[_0x328bdc][_0x225c('0x26')]({'plain':!![]});_0x3da95e[_0x225c('0x66')]=_0x2b7a0d[_0x225c('0x4e')][_0x225c('0x66')]?_0x2b7a0d[_0x225c('0x4e')][_0x225c('0x66')]:_0x3da95e[_0x225c('0x66')];switch(_0x3da95e['dialCheckDuplicateType']){case _0x225c('0x67'):_0x45469=squel['insert']()[_0x225c('0x68')](_0x225c('0x69'))[_0x225c('0x6a')](['phone',_0x225c('0x6b'),_0x225c('0x6c'),'ListId','CampaignId',_0x225c('0x4f'),_0x225c('0x50')],squel[_0x225c('0x6d')]()[_0x225c('0x6e')](_0x225c('0x6f'),_0x225c('0x6f'))[_0x225c('0x6e')](_0x225c('0x70'),_0x225c('0x6b'))[_0x225c('0x6e')]('id','ContactId')['field'](_0x24a571['CmListId'][_0x225c('0x71')](),'ListId')[_0x225c('0x6e')](_0x2b7a0d[_0x225c('0x4c')]['id']['toString'](),_0x225c('0x57'))[_0x225c('0x6e')]('\x27'+_0xd98444+'\x27',_0x225c('0x4f'))[_0x225c('0x6e')]('\x27'+_0xd98444+'\x27',_0x225c('0x50'))[_0x225c('0x72')](_0x225c('0x73'))[_0x225c('0x39')](_0x225c('0x74'))[_0x225c('0x39')]('ListId\x20=\x20?',_0x24a571[_0x225c('0x75')]['toString']())[_0x225c('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0x225c('0x39')](_0x225c('0x76'),squel[_0x225c('0x6d')]()[_0x225c('0x6e')](_0x225c('0x77'))[_0x225c('0x72')](_0x225c('0x78'))[_0x225c('0x39')](_0x225c('0x79'),_0x2b7a0d[_0x225c('0x4c')]['id']['toString']()))[_0x225c('0x39')](_0x225c('0x76'),squel[_0x225c('0x6d')]()[_0x225c('0x6e')](_0x225c('0x7a'))[_0x225c('0x72')](_0x225c('0x69'))[_0x225c('0x39')](_0x225c('0x79'),_0x2b7a0d['params']['id'][_0x225c('0x71')]())))[_0x225c('0x71')]();break;case'onlyIfOpen':_0x45469=squel[_0x225c('0x7b')]()[_0x225c('0x68')](_0x225c('0x69'))[_0x225c('0x6a')]([_0x225c('0x6f'),'scheduledAt',_0x225c('0x6c'),_0x225c('0x7c'),_0x225c('0x57'),'createdAt',_0x225c('0x50')],squel[_0x225c('0x6d')]()[_0x225c('0x6e')]('phone',_0x225c('0x6f'))[_0x225c('0x6e')]('NOW()','scheduledAt')[_0x225c('0x6e')]('id',_0x225c('0x6c'))[_0x225c('0x6e')](_0x24a571[_0x225c('0x75')][_0x225c('0x71')](),'ListId')[_0x225c('0x6e')](_0x2b7a0d['params']['id']['toString'](),_0x225c('0x57'))[_0x225c('0x6e')]('\x27'+_0xd98444+'\x27',_0x225c('0x4f'))['field']('\x27'+_0xd98444+'\x27','updatedAt')[_0x225c('0x72')](_0x225c('0x73'))[_0x225c('0x39')](_0x225c('0x74'))[_0x225c('0x39')](_0x225c('0x7d'),_0x24a571[_0x225c('0x75')]['toString']())[_0x225c('0x39')](_0x225c('0x7e'))[_0x225c('0x39')](_0x225c('0x76'),squel[_0x225c('0x6d')]()[_0x225c('0x6e')](_0x225c('0x7a'))[_0x225c('0x72')](_0x225c('0x69'))[_0x225c('0x39')](_0x225c('0x79'),_0x2b7a0d[_0x225c('0x4c')]['id'][_0x225c('0x71')]())))[_0x225c('0x71')]();break;default:_0x45469=squel[_0x225c('0x7b')]()[_0x225c('0x68')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x225c('0x6c'),_0x225c('0x7c'),_0x225c('0x57'),_0x225c('0x4f'),_0x225c('0x50')],squel[_0x225c('0x6d')]()['field'](_0x225c('0x6f'),_0x225c('0x6f'))[_0x225c('0x6e')](_0x225c('0x70'),_0x225c('0x6b'))[_0x225c('0x6e')]('id',_0x225c('0x6c'))[_0x225c('0x6e')](_0x24a571['CmListId']['toString'](),'ListId')[_0x225c('0x6e')](_0x2b7a0d['params']['id'][_0x225c('0x71')](),'CampaignId')[_0x225c('0x6e')]('\x27'+_0xd98444+'\x27',_0x225c('0x4f'))['field']('\x27'+_0xd98444+'\x27',_0x225c('0x50'))[_0x225c('0x72')](_0x225c('0x73'))[_0x225c('0x39')]('deletedAt\x20IS\x20NULL')['where'](_0x225c('0x7d'),_0x24a571['CmListId'][_0x225c('0x71')]())[_0x225c('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0x225c('0x71')]();}_0x42ecec=squel[_0x225c('0x7b')]()['into'](_0x225c('0x7f'))['fromQuery']([_0x225c('0x80'),_0x225c('0x6b'),_0x225c('0x6f'),_0x225c('0x81'),_0x225c('0x4f'),'updatedAt'],squel[_0x225c('0x6d')]()[_0x225c('0x6e')](_0x225c('0x82'),'id')[_0x225c('0x6e')]('NOW()',_0x225c('0x6b'))[_0x225c('0x6e')](_0x225c('0x83'),'phone')[_0x225c('0x6e')](_0x225c('0x84'),_0x225c('0x81'))['field']('\x27'+_0xd98444+'\x27',_0x225c('0x4f'))[_0x225c('0x6e')]('\x27'+_0xd98444+'\x27',_0x225c('0x50'))[_0x225c('0x72')](_0x225c('0x85'),'ci')['join']('cm_hopper','h',_0x225c('0x86'))['where']('h.ListId\x20=\x20?',_0x24a571[_0x225c('0x75')][_0x225c('0x71')]())[_0x225c('0x39')](_0x225c('0x87'),_0x2b7a0d['params']['id']['toString']())[_0x225c('0x39')](_0x225c('0x88'),_0xd98444))[_0x225c('0x71')]();_0x26dd54[_0x225c('0x89')](db[_0x225c('0x8a')][_0x225c('0x31')](_0x45469));_0x2efd7d[_0x225c('0x89')](db[_0x225c('0x8a')]['query'](_0x42ecec));}return BPromise['all'](_0x26dd54);}})['then'](function(){return BPromise[_0x225c('0x8b')](_0x2efd7d);})['then'](function(){return _0x26aba7;})[_0x225c('0x25')](respondWithResult(_0x542d5f,null))[_0x225c('0x42')](handleError(_0x542d5f,null));};exports[_0x225c('0x8c')]=function(_0x32f491,_0x596d97,_0x5aa7a5){return db['Campaign'][_0x225c('0x43')]({'where':{'id':_0x32f491['params']['id']}})['then'](handleEntityNotFound(_0x596d97,null))['then'](function(_0x11fc31){if(_0x11fc31){return _0x11fc31[_0x225c('0x8c')](_0x32f491['query'][_0x225c('0x64')]);}})[_0x225c('0x25')](function(_0x22985c){if(_0x22985c){return db[_0x225c('0x55')][_0x225c('0x24')]({'where':{'ListId':_0x32f491['query'][_0x225c('0x64')],'CampaignId':_0x32f491[_0x225c('0x4c')]['id']}})[_0x225c('0x25')](function(){return _0x22985c;});}})[_0x225c('0x25')](respondWithStatusCode(_0x596d97,null))['catch'](handleError(_0x596d97,null));};exports[_0x225c('0x8d')]=function(_0x19352a,_0x24b978,_0x4bfd6a){var _0x738cec={};var _0x27328a={};var _0x3243c8;var _0x538c95;return db['Campaign'][_0x225c('0x54')]({'where':{'id':_0x19352a[_0x225c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x24b978,null))['then'](function(_0x1259e3){if(_0x1259e3){_0x3243c8=_0x1259e3;_0x27328a[_0x225c('0x30')]=_[_0x225c('0x4d')](db[_0x225c('0x60')][_0x225c('0x2c')]);_0x27328a[_0x225c('0x31')]=_[_0x225c('0x4d')](_0x19352a['query']);_0x27328a[_0x225c('0x32')]=_[_0x225c('0x34')](_0x27328a[_0x225c('0x30')],_0x27328a['query']);_0x738cec[_0x225c('0x33')]=_[_0x225c('0x34')](_0x27328a[_0x225c('0x30')],qs[_0x225c('0x35')](_0x19352a[_0x225c('0x31')]['fields']));_0x738cec[_0x225c('0x33')]=_0x738cec['attributes']['length']?_0x738cec[_0x225c('0x33')]:_0x27328a[_0x225c('0x30')];_0x738cec['order']=qs[_0x225c('0x38')](_0x19352a[_0x225c('0x31')][_0x225c('0x38')]);_0x738cec['where']=qs[_0x225c('0x32')](_[_0x225c('0x3a')](_0x19352a[_0x225c('0x31')],_0x27328a[_0x225c('0x32')]));if(_0x19352a[_0x225c('0x31')]['filter']){_0x738cec[_0x225c('0x39')]=_['merge'](_0x738cec['where'],{'$or':_[_0x225c('0x2a')](_0x738cec[_0x225c('0x33')],function(_0x476689){var _0x58bfb7={};_0x58bfb7[_0x476689]={'$like':'%'+_0x19352a[_0x225c('0x31')][_0x225c('0x3b')]+'%'};return _0x58bfb7;})});}_0x738cec=_[_0x225c('0x3c')]({},_0x738cec,_0x19352a[_0x225c('0x3e')]);return _0x3243c8['getBlackLists'](_0x738cec);}})[_0x225c('0x25')](function(_0x28683e){if(_0x28683e){_0x538c95=_0x28683e[_0x225c('0x36')];if(!_0x19352a[_0x225c('0x31')][_0x225c('0x56')]('nolimit')){_0x738cec[_0x225c('0x1c')]=qs[_0x225c('0x1c')](_0x19352a[_0x225c('0x31')][_0x225c('0x1c')]);_0x738cec[_0x225c('0x1a')]=qs[_0x225c('0x1a')](_0x19352a[_0x225c('0x31')][_0x225c('0x1a')]);}return _0x3243c8[_0x225c('0x8d')](_0x738cec);}})[_0x225c('0x25')](function(_0x1da5c3){if(_0x1da5c3){return _0x1da5c3?{'count':_0x538c95,'rows':_0x1da5c3}:null;}})[_0x225c('0x25')](respondWithResult(_0x24b978,null))[_0x225c('0x42')](handleError(_0x24b978,null));};exports['addBlackLists']=function(_0x25d3fa,_0x20e8d7,_0x5042f5){var _0x4562d1,_0x2f1fa1;var _0x12eb4a=[];var _0x49e9f8=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign']['find']({'where':{'id':_0x25d3fa[_0x225c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x20e8d7,null))[_0x225c('0x25')](function(_0x3de02a){if(_0x3de02a){_0x2f1fa1=_0x3de02a;return _0x3de02a[_0x225c('0x8e')](_0x25d3fa['body']['ids'],_[_0x225c('0x65')](_0x25d3fa[_0x225c('0x4e')],['ids','id'])||{});}return null;})[_0x225c('0x8f')](function(_0x3f94c2){var _0x2a0af0;var _0x4a735f;_0x4562d1=_0x3f94c2||[];var _0x50b1ee=[];if(_0x3f94c2){for(var _0x43969f=0x0;_0x43969f<_0x3f94c2['length'];_0x43969f+=0x1){var _0x253721=_0x3f94c2[_0x43969f]['get']({'plain':!![]});_0x2a0af0=squel['insert']()['into'](_0x225c('0x90'))[_0x225c('0x6a')]([_0x225c('0x6f'),_0x225c('0x6c'),'ListId','CampaignId','createdAt',_0x225c('0x50')],squel[_0x225c('0x6d')]()[_0x225c('0x6e')](_0x225c('0x6f'),_0x225c('0x6f'))[_0x225c('0x6e')]('id',_0x225c('0x6c'))[_0x225c('0x6e')](_0x253721[_0x225c('0x75')]['toString'](),_0x225c('0x7c'))[_0x225c('0x6e')](_0x25d3fa['params']['id'][_0x225c('0x71')](),_0x225c('0x57'))['field'](_0x225c('0x70'),_0x225c('0x4f'))[_0x225c('0x6e')](_0x225c('0x70'),_0x225c('0x50'))[_0x225c('0x72')](_0x225c('0x73'))[_0x225c('0x39')]('deletedAt\x20IS\x20NULL')['where'](_0x225c('0x7d'),_0x253721['CmListId'][_0x225c('0x71')]())[_0x225c('0x39')](_0x225c('0x7e')))[_0x225c('0x71')]();_0x50b1ee[_0x225c('0x89')](db[_0x225c('0x8a')][_0x225c('0x31')](_0x2a0af0));}return BPromise['all'](_0x50b1ee);}})[_0x225c('0x25')](function(){return _0x4562d1;})[_0x225c('0x25')](respondWithResult(_0x20e8d7,null))[_0x225c('0x42')](handleError(_0x20e8d7,null));};exports['removeBlackLists']=function(_0x48c233,_0x2883e6,_0x5b4ccc){return db['Campaign'][_0x225c('0x43')]({'where':{'id':_0x48c233[_0x225c('0x4c')]['id']}})[_0x225c('0x25')](handleEntityNotFound(_0x2883e6,null))['then'](function(_0x4da214){if(_0x4da214){return _0x4da214[_0x225c('0x91')](_0x48c233[_0x225c('0x31')][_0x225c('0x64')]);}})[_0x225c('0x25')](function(_0x36fd9e){if(_0x36fd9e){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x48c233[_0x225c('0x31')][_0x225c('0x64')],'CampaignId':_0x48c233[_0x225c('0x4c')]['id']}})[_0x225c('0x25')](function(){return _0x36fd9e;});}})[_0x225c('0x25')](respondWithStatusCode(_0x2883e6,null))[_0x225c('0x42')](handleError(_0x2883e6,null));}; \ No newline at end of file +var _0x48b2=['include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','omit','createdAt','UserProfileSection','getHoppers','findOne','CmHopper','findAll','rows','getHopperHistories','CampaignId','CmHopperHistory','getHopperFinals','pick','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','select','field','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','NOW()','CmListId','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','then','destroy','get','IvrCampaigns','stack','name','send','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','catch','show','params','filters'];(function(_0x1325a0,_0x241c6e){var _0x511d7c=function(_0xd686d2){while(--_0xd686d2){_0x1325a0['push'](_0x1325a0['shift']());}};_0x511d7c(++_0x241c6e);}(_0x48b2,0x176));var _0x248b=function(_0x11c702,_0x50d44a){_0x11c702=_0x11c702-0x0;var _0x425081=_0x48b2[_0x11c702];return _0x425081;};'use strict';var emlformat=require(_0x248b('0x0'));var rimraf=require(_0x248b('0x1'));var zipdir=require(_0x248b('0x2'));var jsonpatch=require(_0x248b('0x3'));var rp=require(_0x248b('0x4'));var moment=require(_0x248b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x248b('0x6'));var util=require('util');var path=require(_0x248b('0x7'));var sox=require(_0x248b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x248b('0x9'));var _=require('lodash');var squel=require(_0x248b('0xa'));var crypto=require(_0x248b('0xb'));var jsforce=require(_0x248b('0xc'));var deskjs=require(_0x248b('0xd'));var toCsv=require(_0x248b('0xe'));var querystring=require(_0x248b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x248b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x248b('0x11'));var hardwareService=require(_0x248b('0x12'));var logger=require('../../config/logger')(_0x248b('0x13'));var utils=require(_0x248b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x248b('0x15'));var db=require(_0x248b('0x16'))['db'];function respondWithStatusCode(_0x6f87d6,_0x5ecea6){_0x5ecea6=_0x5ecea6||0xcc;return function(_0x49a44a){if(_0x49a44a){return _0x6f87d6[_0x248b('0x17')](_0x5ecea6);}return _0x6f87d6[_0x248b('0x18')](_0x5ecea6)[_0x248b('0x19')]();};}function respondWithResult(_0x253f02,_0x358b7b){_0x358b7b=_0x358b7b||0xc8;return function(_0x6cd69c){if(_0x6cd69c){return _0x253f02[_0x248b('0x18')](_0x358b7b)['json'](_0x6cd69c);}};}function respondWithFilteredResult(_0x4e6d6c,_0x157aca){return function(_0x3d0a94){if(_0x3d0a94){var _0x4ed6c2=typeof _0x157aca[_0x248b('0x1a')]===_0x248b('0x1b')&&typeof _0x157aca[_0x248b('0x1c')]===_0x248b('0x1b');var _0x4de747=_0x3d0a94[_0x248b('0x1d')];var _0x146300=_0x4ed6c2?0x0:_0x157aca[_0x248b('0x1a')];var _0x3bb21f=_0x4ed6c2?_0x3d0a94['count']:_0x157aca[_0x248b('0x1a')]+_0x157aca['limit'];var _0x1a8e3f;if(_0x3bb21f>=_0x4de747){_0x3bb21f=_0x4de747;_0x1a8e3f=0xc8;}else{_0x1a8e3f=0xce;}_0x4e6d6c[_0x248b('0x18')](_0x1a8e3f);return _0x4e6d6c[_0x248b('0x1e')]('Content-Range',_0x146300+'-'+_0x3bb21f+'/'+_0x4de747)[_0x248b('0x1f')](_0x3d0a94);}return null;};}function patchUpdates(_0x40a6b7){return function(_0x3bd633){try{jsonpatch[_0x248b('0x20')](_0x3bd633,_0x40a6b7,!![]);}catch(_0x3c87d0){return BPromise[_0x248b('0x21')](_0x3c87d0);}return _0x3bd633['save']();};}function saveUpdates(_0x3b4814,_0x1cb2a7){return function(_0x175f51){if(_0x175f51){return _0x175f51['update'](_0x3b4814)[_0x248b('0x22')](function(_0x2cb0a8){return _0x2cb0a8;});}return null;};}function removeEntity(_0x5389ce,_0x5abc94){return function(_0x20123f){if(_0x20123f){return _0x20123f[_0x248b('0x23')]()[_0x248b('0x22')](function(){var _0x4980b4=_0x20123f[_0x248b('0x24')]({'plain':!![]});var _0x3b6ce9=_0x248b('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x3b6ce9,'resourceId':_0x4980b4['id']}})['then'](function(){return _0x20123f;});})['then'](function(){_0x5389ce[_0x248b('0x18')](0xcc)[_0x248b('0x19')]();});}};}function handleEntityNotFound(_0x4262c9,_0x4b1a25){return function(_0x299db2){if(!_0x299db2){_0x4262c9[_0x248b('0x17')](0x194);}return _0x299db2;};}function handleError(_0x55a230,_0x581246){_0x581246=_0x581246||0x1f4;return function(_0xec0d4a){logger['error'](_0xec0d4a[_0x248b('0x26')]);if(_0xec0d4a[_0x248b('0x27')]){delete _0xec0d4a['name'];}_0x55a230[_0x248b('0x18')](_0x581246)[_0x248b('0x28')](_0xec0d4a);};}exports['index']=function(_0x5e8fe7,_0x5eebd8){var _0x3f602f={},_0x7d2d09={},_0x17d7b8={'count':0x0,'rows':[]};var _0x38daee=_[_0x248b('0x29')](db[_0x248b('0x2a')][_0x248b('0x2b')],function(_0x5dd1c1){return{'name':_0x5dd1c1[_0x248b('0x2c')],'type':_0x5dd1c1[_0x248b('0x2d')][_0x248b('0x2e')]};});_0x7d2d09[_0x248b('0x2f')]=_[_0x248b('0x29')](_0x38daee,_0x248b('0x27'));_0x7d2d09[_0x248b('0x30')]=_[_0x248b('0x31')](_0x5e8fe7[_0x248b('0x30')]);_0x7d2d09['filters']=_[_0x248b('0x32')](_0x7d2d09[_0x248b('0x2f')],_0x7d2d09[_0x248b('0x30')]);_0x3f602f[_0x248b('0x33')]=_[_0x248b('0x32')](_0x7d2d09[_0x248b('0x2f')],qs[_0x248b('0x34')](_0x5e8fe7[_0x248b('0x30')]['fields']));_0x3f602f[_0x248b('0x33')]=_0x3f602f[_0x248b('0x33')][_0x248b('0x35')]?_0x3f602f['attributes']:_0x7d2d09[_0x248b('0x2f')];if(!_0x5e8fe7['query'][_0x248b('0x36')](_0x248b('0x37'))){_0x3f602f[_0x248b('0x1c')]=qs[_0x248b('0x1c')](_0x5e8fe7[_0x248b('0x30')][_0x248b('0x1c')]);_0x3f602f[_0x248b('0x1a')]=qs[_0x248b('0x1a')](_0x5e8fe7['query'][_0x248b('0x1a')]);}_0x3f602f[_0x248b('0x38')]=qs[_0x248b('0x39')](_0x5e8fe7['query']['sort']);_0x3f602f['where']=qs['filters'](_['pick'](_0x5e8fe7[_0x248b('0x30')],_0x7d2d09['filters']),_0x38daee);if(_0x5e8fe7[_0x248b('0x30')][_0x248b('0x3a')]){_0x3f602f[_0x248b('0x3b')]=_[_0x248b('0x3c')](_0x3f602f[_0x248b('0x3b')],{'$or':_[_0x248b('0x29')](_0x38daee,function(_0x439dfa){if(_0x439dfa[_0x248b('0x2d')]!=='VIRTUAL'){var _0x4f9e74={};_0x4f9e74[_0x439dfa[_0x248b('0x27')]]={'$like':'%'+_0x5e8fe7[_0x248b('0x30')][_0x248b('0x3a')]+'%'};return _0x4f9e74;}})});}_0x3f602f=_[_0x248b('0x3c')]({},_0x3f602f,_0x5e8fe7[_0x248b('0x3d')]);var _0x5dce08={'where':_0x3f602f['where']};return db[_0x248b('0x2a')][_0x248b('0x1d')](_0x5dce08)[_0x248b('0x22')](function(_0x52e335){_0x17d7b8['count']=_0x52e335;if(_0x5e8fe7[_0x248b('0x30')][_0x248b('0x3e')]){_0x3f602f['include']=[{'all':!![]}];}return db[_0x248b('0x2a')]['findAll'](_0x3f602f);})[_0x248b('0x22')](function(_0x4c47df){_0x17d7b8['rows']=_0x4c47df;return _0x17d7b8;})[_0x248b('0x22')](respondWithFilteredResult(_0x5eebd8,_0x3f602f))[_0x248b('0x3f')](handleError(_0x5eebd8,null));};exports[_0x248b('0x40')]=function(_0x4b6d75,_0x31234b){var _0x2f1d41={'raw':![],'where':{'id':_0x4b6d75[_0x248b('0x41')]['id']}},_0x3f2bf8={};_0x3f2bf8[_0x248b('0x2f')]=_['keys'](db[_0x248b('0x2a')]['rawAttributes']);_0x3f2bf8[_0x248b('0x30')]=_[_0x248b('0x31')](_0x4b6d75[_0x248b('0x30')]);_0x3f2bf8[_0x248b('0x42')]=_[_0x248b('0x32')](_0x3f2bf8[_0x248b('0x2f')],_0x3f2bf8[_0x248b('0x30')]);_0x2f1d41[_0x248b('0x33')]=_[_0x248b('0x32')](_0x3f2bf8[_0x248b('0x2f')],qs['fields'](_0x4b6d75[_0x248b('0x30')][_0x248b('0x34')]));_0x2f1d41[_0x248b('0x33')]=_0x2f1d41[_0x248b('0x33')][_0x248b('0x35')]?_0x2f1d41[_0x248b('0x33')]:_0x3f2bf8['model'];if(_0x4b6d75[_0x248b('0x30')][_0x248b('0x3e')]){_0x2f1d41[_0x248b('0x43')]=[{'all':!![]}];}_0x2f1d41=_[_0x248b('0x3c')]({},_0x2f1d41,_0x4b6d75[_0x248b('0x3d')]);return db['Campaign'][_0x248b('0x44')](_0x2f1d41)['then'](handleEntityNotFound(_0x31234b,null))[_0x248b('0x22')](respondWithResult(_0x31234b,null))[_0x248b('0x3f')](handleError(_0x31234b,null));};exports[_0x248b('0x45')]=function(_0x4fade1,_0x2c54ae){return db['Campaign'][_0x248b('0x45')](_0x4fade1['body'],{})[_0x248b('0x22')](function(_0x1e7ee8){var _0x4fc28c=_0x4fade1[_0x248b('0x46')]['get']({'plain':!![]});if(!_0x4fc28c)throw new Error(_0x248b('0x47'));if(_0x4fc28c[_0x248b('0x48')]===_0x248b('0x46')){var _0x1363cd=_0x1e7ee8[_0x248b('0x24')]({'plain':!![]});var _0x42907b=_0x248b('0x25');return db['UserProfileSection'][_0x248b('0x44')]({'where':{'name':_0x42907b,'userProfileId':_0x4fc28c[_0x248b('0x49')]},'raw':!![]})[_0x248b('0x22')](function(_0x57c6b4){if(_0x57c6b4&&_0x57c6b4[_0x248b('0x4a')]===0x0){return db[_0x248b('0x4b')][_0x248b('0x45')]({'name':_0x1363cd[_0x248b('0x27')],'resourceId':_0x1363cd['id'],'type':_0x57c6b4[_0x248b('0x27')],'sectionId':_0x57c6b4['id']},{})[_0x248b('0x22')](function(){return _0x1e7ee8;});}else{return _0x1e7ee8;}})[_0x248b('0x3f')](function(_0x39c0b5){logger[_0x248b('0x4c')](_0x248b('0x4d'),_0x39c0b5);throw _0x39c0b5;});}return _0x1e7ee8;})['then'](respondWithResult(_0x2c54ae,0xc9))[_0x248b('0x3f')](handleError(_0x2c54ae,null));};exports[_0x248b('0x4e')]=function(_0x395ce2,_0x4adba8){var _0x522c16={'where':{'id':_0x395ce2[_0x248b('0x41')]['id']}},_0x316f08={};_0x316f08[_0x248b('0x2f')]=_[_0x248b('0x31')](db[_0x248b('0x2a')][_0x248b('0x2b')]);_0x522c16['attributes']=_[_0x248b('0x32')](_0x316f08[_0x248b('0x2f')],qs[_0x248b('0x34')](_0x395ce2[_0x248b('0x30')]['fields']));_0x522c16[_0x248b('0x33')]=_0x522c16['attributes']['length']?_0x522c16[_0x248b('0x33')]:_0x316f08[_0x248b('0x2f')];if(_0x395ce2['query'][_0x248b('0x3e')]){_0x522c16[_0x248b('0x43')]=[{'all':!![]}];}_0x522c16=_[_0x248b('0x3c')]({},_0x522c16,_0x395ce2['options']);return db[_0x248b('0x2a')][_0x248b('0x44')](_0x522c16)[_0x248b('0x22')](handleEntityNotFound(_0x4adba8,null))['then'](function(_0x59b950){if(_0x59b950){var _0x3e05ba=_0x59b950['get']({'plain':!![]});_0x3e05ba=qs['omit'](_0x3e05ba,['id','createdAt',_0x248b('0x4f')]);_0x395ce2[_0x248b('0x50')]=_[_0x248b('0x51')](_0x395ce2[_0x248b('0x50')],['id',_0x248b('0x52'),_0x248b('0x4f')]);return db[_0x248b('0x2a')][_0x248b('0x45')](_[_0x248b('0x3c')](_0x3e05ba,_0x395ce2[_0x248b('0x50')]),{'include':_0x395ce2[_0x248b('0x30')][_0x248b('0x3e')]?[{'all':!![]}]:undefined})[_0x248b('0x22')](function(_0x7879cd){var _0x4ea1a4=_0x395ce2[_0x248b('0x46')]['get']({'plain':!![]});if(!_0x4ea1a4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea1a4['role']==='user'){var _0x1fcaab=_0x7879cd[_0x248b('0x24')]({'plain':!![]});var _0x367cca=_0x248b('0x25');return db[_0x248b('0x53')]['find']({'where':{'name':_0x367cca,'userProfileId':_0x4ea1a4[_0x248b('0x49')]},'raw':!![]})['then'](function(_0x429732){if(_0x429732&&_0x429732[_0x248b('0x4a')]===0x0){return db[_0x248b('0x4b')][_0x248b('0x45')]({'name':_0x1fcaab[_0x248b('0x27')],'resourceId':_0x1fcaab['id'],'type':_0x429732[_0x248b('0x27')],'sectionId':_0x429732['id']},{})[_0x248b('0x22')](function(){return _0x7879cd;});}else{return _0x7879cd;}})[_0x248b('0x3f')](function(_0x41b35a){logger[_0x248b('0x4c')](_0x248b('0x4d'),_0x41b35a);throw _0x41b35a;});}return _0x7879cd;});}})['then'](respondWithResult(_0x4adba8,0xc9))[_0x248b('0x3f')](handleError(_0x4adba8,null));};exports['update']=function(_0x1389da,_0x2e919b){if(_0x1389da[_0x248b('0x50')]['id']){delete _0x1389da['body']['id'];}return db[_0x248b('0x2a')]['find']({'where':{'id':_0x1389da[_0x248b('0x41')]['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x2e919b,null))['then'](saveUpdates(_0x1389da['body'],null))[_0x248b('0x22')](respondWithResult(_0x2e919b,null))[_0x248b('0x3f')](handleError(_0x2e919b,null));};exports[_0x248b('0x23')]=function(_0x4bb190,_0x45459f){return db[_0x248b('0x2a')][_0x248b('0x44')]({'where':{'id':_0x4bb190[_0x248b('0x41')]['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x45459f,null))['then'](removeEntity(_0x45459f,null))[_0x248b('0x3f')](handleError(_0x45459f,null));};exports[_0x248b('0x54')]=function(_0x3eb6f1,_0xf76394,_0x49a74a){var _0x542d96={'raw':!![],'where':{}};var _0x2e425b={};var _0x566786={'count':0x0,'rows':[]};return db[_0x248b('0x2a')][_0x248b('0x55')]({'where':{'id':_0x3eb6f1[_0x248b('0x41')]['id']}})['then'](handleEntityNotFound(_0xf76394,null))[_0x248b('0x22')](function(_0x1c4518){if(_0x1c4518){_0x2e425b[_0x248b('0x2f')]=_['keys'](db[_0x248b('0x56')][_0x248b('0x2b')]);_0x2e425b['query']=_['keys'](_0x3eb6f1['query']);_0x2e425b['filters']=_[_0x248b('0x32')](_0x2e425b[_0x248b('0x2f')],_0x2e425b[_0x248b('0x30')]);_0x542d96[_0x248b('0x33')]=_['intersection'](_0x2e425b[_0x248b('0x2f')],qs[_0x248b('0x34')](_0x3eb6f1['query'][_0x248b('0x34')]));_0x542d96['attributes']=_0x542d96[_0x248b('0x33')][_0x248b('0x35')]?_0x542d96['attributes']:_0x2e425b[_0x248b('0x2f')];if(!_0x3eb6f1['query']['hasOwnProperty'](_0x248b('0x37'))){_0x542d96[_0x248b('0x1c')]=qs['limit'](_0x3eb6f1['query']['limit']);_0x542d96[_0x248b('0x1a')]=qs[_0x248b('0x1a')](_0x3eb6f1[_0x248b('0x30')][_0x248b('0x1a')]);}_0x542d96[_0x248b('0x38')]=qs[_0x248b('0x39')](_0x3eb6f1[_0x248b('0x30')][_0x248b('0x39')]);_0x542d96[_0x248b('0x3b')]=qs['filters'](_['pick'](_0x3eb6f1[_0x248b('0x30')],_0x2e425b[_0x248b('0x42')]));_0x542d96[_0x248b('0x3b')]['CampaignId']=_0x1c4518['id'];if(_0x3eb6f1['query'][_0x248b('0x3a')]){_0x542d96[_0x248b('0x3b')]=_[_0x248b('0x3c')](_0x542d96[_0x248b('0x3b')],{'$or':_['map'](_0x542d96[_0x248b('0x33')],function(_0x37dd2c){var _0x717572={};_0x717572[_0x37dd2c]={'$like':'%'+_0x3eb6f1[_0x248b('0x30')][_0x248b('0x3a')]+'%'};return _0x717572;})});}_0x542d96=_['merge']({},_0x542d96,_0x3eb6f1[_0x248b('0x3d')]);return db[_0x248b('0x56')]['count']({'where':_0x542d96['where']})['then'](function(_0x49dd50){_0x566786[_0x248b('0x1d')]=_0x49dd50;if(_0x3eb6f1['query'][_0x248b('0x3e')]){_0x542d96[_0x248b('0x43')]=[{'all':!![]}];}return db[_0x248b('0x56')][_0x248b('0x57')](_0x542d96);})[_0x248b('0x22')](function(_0x41eee5){_0x566786[_0x248b('0x58')]=_0x41eee5;return _0x566786;});}})[_0x248b('0x22')](respondWithFilteredResult(_0xf76394,_0x542d96))[_0x248b('0x3f')](handleError(_0xf76394,null));};exports[_0x248b('0x59')]=function(_0x508b78,_0x45bdae,_0x3e8ea4){var _0x257ff0={'raw':!![],'where':{}};var _0x265d8f={};var _0x5dbca3={'count':0x0,'rows':[]};return db[_0x248b('0x2a')][_0x248b('0x55')]({'where':{'id':_0x508b78[_0x248b('0x41')]['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x45bdae,null))[_0x248b('0x22')](function(_0x42f4d7){if(_0x42f4d7){_0x265d8f['model']=_['keys'](db['CmHopperHistory'][_0x248b('0x2b')]);_0x265d8f[_0x248b('0x30')]=_['keys'](_0x508b78[_0x248b('0x30')]);_0x265d8f[_0x248b('0x42')]=_['intersection'](_0x265d8f[_0x248b('0x2f')],_0x265d8f['query']);_0x257ff0[_0x248b('0x33')]=_[_0x248b('0x32')](_0x265d8f['model'],qs[_0x248b('0x34')](_0x508b78[_0x248b('0x30')][_0x248b('0x34')]));_0x257ff0[_0x248b('0x33')]=_0x257ff0[_0x248b('0x33')][_0x248b('0x35')]?_0x257ff0[_0x248b('0x33')]:_0x265d8f[_0x248b('0x2f')];if(!_0x508b78['query'][_0x248b('0x36')](_0x248b('0x37'))){_0x257ff0[_0x248b('0x1c')]=qs[_0x248b('0x1c')](_0x508b78['query']['limit']);_0x257ff0[_0x248b('0x1a')]=qs[_0x248b('0x1a')](_0x508b78[_0x248b('0x30')][_0x248b('0x1a')]);}_0x257ff0['order']=qs[_0x248b('0x39')](_0x508b78[_0x248b('0x30')][_0x248b('0x39')]);_0x257ff0[_0x248b('0x3b')]=qs[_0x248b('0x42')](_['pick'](_0x508b78[_0x248b('0x30')],_0x265d8f[_0x248b('0x42')]));_0x257ff0[_0x248b('0x3b')][_0x248b('0x5a')]=_0x42f4d7['id'];if(_0x508b78[_0x248b('0x30')][_0x248b('0x3a')]){_0x257ff0[_0x248b('0x3b')]=_[_0x248b('0x3c')](_0x257ff0['where'],{'$or':_['map'](_0x257ff0[_0x248b('0x33')],function(_0x4e8e85){var _0x5d896c={};_0x5d896c[_0x4e8e85]={'$like':'%'+_0x508b78[_0x248b('0x30')]['filter']+'%'};return _0x5d896c;})});}_0x257ff0=_[_0x248b('0x3c')]({},_0x257ff0,_0x508b78[_0x248b('0x3d')]);return db[_0x248b('0x5b')][_0x248b('0x1d')]({'where':_0x257ff0[_0x248b('0x3b')]})['then'](function(_0x2080f6){_0x5dbca3[_0x248b('0x1d')]=_0x2080f6;if(_0x508b78[_0x248b('0x30')][_0x248b('0x3e')]){_0x257ff0[_0x248b('0x43')]=[{'all':!![]}];}return db[_0x248b('0x5b')]['findAll'](_0x257ff0);})[_0x248b('0x22')](function(_0x4c330a){_0x5dbca3[_0x248b('0x58')]=_0x4c330a;return _0x5dbca3;});}})['then'](respondWithFilteredResult(_0x45bdae,_0x257ff0))[_0x248b('0x3f')](handleError(_0x45bdae,null));};exports[_0x248b('0x5c')]=function(_0x32ed1b,_0x2eb30f,_0x1f0b8e){var _0x4c651f={'raw':!![],'where':{}};var _0x36251e={};var _0x257ce8={'count':0x0,'rows':[]};return db['Campaign'][_0x248b('0x55')]({'where':{'id':_0x32ed1b[_0x248b('0x41')]['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x2eb30f,null))[_0x248b('0x22')](function(_0x30151c){if(_0x30151c){_0x36251e[_0x248b('0x2f')]=_[_0x248b('0x31')](db['CmHopperFinal']['rawAttributes']);_0x36251e[_0x248b('0x30')]=_[_0x248b('0x31')](_0x32ed1b[_0x248b('0x30')]);_0x36251e[_0x248b('0x42')]=_[_0x248b('0x32')](_0x36251e[_0x248b('0x2f')],_0x36251e['query']);_0x4c651f[_0x248b('0x33')]=_[_0x248b('0x32')](_0x36251e[_0x248b('0x2f')],qs[_0x248b('0x34')](_0x32ed1b['query'][_0x248b('0x34')]));_0x4c651f[_0x248b('0x33')]=_0x4c651f[_0x248b('0x33')][_0x248b('0x35')]?_0x4c651f[_0x248b('0x33')]:_0x36251e[_0x248b('0x2f')];if(!_0x32ed1b[_0x248b('0x30')][_0x248b('0x36')]('nolimit')){_0x4c651f[_0x248b('0x1c')]=qs[_0x248b('0x1c')](_0x32ed1b[_0x248b('0x30')][_0x248b('0x1c')]);_0x4c651f[_0x248b('0x1a')]=qs[_0x248b('0x1a')](_0x32ed1b[_0x248b('0x30')][_0x248b('0x1a')]);}_0x4c651f[_0x248b('0x38')]=qs['sort'](_0x32ed1b[_0x248b('0x30')]['sort']);_0x4c651f['where']=qs['filters'](_[_0x248b('0x5d')](_0x32ed1b[_0x248b('0x30')],_0x36251e[_0x248b('0x42')]));_0x4c651f[_0x248b('0x3b')][_0x248b('0x5a')]=_0x30151c['id'];if(_0x32ed1b[_0x248b('0x30')]['filter']){_0x4c651f['where']=_[_0x248b('0x3c')](_0x4c651f[_0x248b('0x3b')],{'$or':_['map'](_0x4c651f['attributes'],function(_0x483b6d){var _0x33e6a1={};_0x33e6a1[_0x483b6d]={'$like':'%'+_0x32ed1b['query'][_0x248b('0x3a')]+'%'};return _0x33e6a1;})});}_0x4c651f=_[_0x248b('0x3c')]({},_0x4c651f,_0x32ed1b[_0x248b('0x3d')]);return db[_0x248b('0x5e')]['count']({'where':_0x4c651f['where']})[_0x248b('0x22')](function(_0xacf001){_0x257ce8['count']=_0xacf001;if(_0x32ed1b['query']['includeAll']){_0x4c651f['include']=[{'all':!![]}];}return db[_0x248b('0x5e')]['findAll'](_0x4c651f);})[_0x248b('0x22')](function(_0x5dc8ce){_0x257ce8['rows']=_0x5dc8ce;return _0x257ce8;});}})[_0x248b('0x22')](respondWithFilteredResult(_0x2eb30f,_0x4c651f))[_0x248b('0x3f')](handleError(_0x2eb30f,null));};exports[_0x248b('0x5f')]=function(_0x469075,_0x5887f2,_0x751634){var _0x1ee45b={'raw':!![],'where':{}};var _0x118541={};var _0x372799={'count':0x0,'rows':[]};return db[_0x248b('0x2a')]['findOne']({'where':{'id':_0x469075[_0x248b('0x41')]['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x5887f2,null))['then'](function(_0x47e3ea){if(_0x47e3ea){_0x118541[_0x248b('0x2f')]=_[_0x248b('0x31')](db[_0x248b('0x60')][_0x248b('0x2b')]);_0x118541['query']=_['keys'](_0x469075['query']);_0x118541[_0x248b('0x42')]=_['intersection'](_0x118541['model'],_0x118541[_0x248b('0x30')]);_0x1ee45b['attributes']=_[_0x248b('0x32')](_0x118541[_0x248b('0x2f')],qs[_0x248b('0x34')](_0x469075[_0x248b('0x30')][_0x248b('0x34')]));_0x1ee45b[_0x248b('0x33')]=_0x1ee45b[_0x248b('0x33')][_0x248b('0x35')]?_0x1ee45b[_0x248b('0x33')]:_0x118541[_0x248b('0x2f')];if(!_0x469075['query'][_0x248b('0x36')](_0x248b('0x37'))){_0x1ee45b['limit']=qs[_0x248b('0x1c')](_0x469075[_0x248b('0x30')][_0x248b('0x1c')]);_0x1ee45b[_0x248b('0x1a')]=qs[_0x248b('0x1a')](_0x469075['query'][_0x248b('0x1a')]);}_0x1ee45b[_0x248b('0x38')]=qs[_0x248b('0x39')](_0x469075['query']['sort']);_0x1ee45b[_0x248b('0x3b')]=qs['filters'](_[_0x248b('0x5d')](_0x469075[_0x248b('0x30')],_0x118541[_0x248b('0x42')]));_0x1ee45b[_0x248b('0x3b')][_0x248b('0x5a')]=_0x47e3ea['id'];if(_0x469075['query'][_0x248b('0x3a')]){_0x1ee45b[_0x248b('0x3b')]=_[_0x248b('0x3c')](_0x1ee45b['where'],{'$or':_[_0x248b('0x29')](_0x1ee45b[_0x248b('0x33')],function(_0x4ff03a){var _0x147a94={};_0x147a94[_0x4ff03a]={'$like':'%'+_0x469075[_0x248b('0x30')][_0x248b('0x3a')]+'%'};return _0x147a94;})});}_0x1ee45b=_['merge']({},_0x1ee45b,_0x469075['options']);return db[_0x248b('0x60')]['count']({'where':_0x1ee45b[_0x248b('0x3b')]})['then'](function(_0x7c3452){_0x372799['count']=_0x7c3452;if(_0x469075['query'][_0x248b('0x3e')]){_0x1ee45b[_0x248b('0x43')]=[{'all':!![]}];}return db[_0x248b('0x60')][_0x248b('0x57')](_0x1ee45b);})[_0x248b('0x22')](function(_0x44232a){_0x372799['rows']=_0x44232a;return _0x372799;});}})[_0x248b('0x22')](respondWithFilteredResult(_0x5887f2,_0x1ee45b))[_0x248b('0x3f')](handleError(_0x5887f2,null));};exports[_0x248b('0x61')]=function(_0xe6bbb1,_0x2e5faa,_0x4bd4b3){var _0x56e5c1={};var _0x658a09={};var _0x261b19;var _0x2caa49;return db['Campaign'][_0x248b('0x55')]({'where':{'id':_0xe6bbb1[_0x248b('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e5faa,null))[_0x248b('0x22')](function(_0x2763c9){if(_0x2763c9){_0x261b19=_0x2763c9;_0x658a09['model']=_[_0x248b('0x31')](db['CmList'][_0x248b('0x2b')]);_0x658a09[_0x248b('0x30')]=_[_0x248b('0x31')](_0xe6bbb1[_0x248b('0x30')]);_0x658a09[_0x248b('0x42')]=_[_0x248b('0x32')](_0x658a09[_0x248b('0x2f')],_0x658a09['query']);_0x56e5c1[_0x248b('0x33')]=_['intersection'](_0x658a09[_0x248b('0x2f')],qs[_0x248b('0x34')](_0xe6bbb1[_0x248b('0x30')][_0x248b('0x34')]));_0x56e5c1['attributes']=_0x56e5c1[_0x248b('0x33')][_0x248b('0x35')]?_0x56e5c1[_0x248b('0x33')]:_0x658a09[_0x248b('0x2f')];_0x56e5c1[_0x248b('0x38')]=qs[_0x248b('0x39')](_0xe6bbb1[_0x248b('0x30')]['sort']);_0x56e5c1[_0x248b('0x3b')]=qs[_0x248b('0x42')](_[_0x248b('0x5d')](_0xe6bbb1[_0x248b('0x30')],_0x658a09[_0x248b('0x42')]));if(_0xe6bbb1[_0x248b('0x30')][_0x248b('0x3a')]){_0x56e5c1[_0x248b('0x3b')]=_[_0x248b('0x3c')](_0x56e5c1[_0x248b('0x3b')],{'$or':_[_0x248b('0x29')](_0x56e5c1['attributes'],function(_0x3e3eed){var _0x22f76a={};_0x22f76a[_0x3e3eed]={'$like':'%'+_0xe6bbb1[_0x248b('0x30')]['filter']+'%'};return _0x22f76a;})});}_0x56e5c1=_[_0x248b('0x3c')]({},_0x56e5c1,_0xe6bbb1[_0x248b('0x3d')]);return _0x261b19['getLists'](_0x56e5c1);}})[_0x248b('0x22')](function(_0x52b201){if(_0x52b201){_0x2caa49=_0x52b201[_0x248b('0x35')];if(!_0xe6bbb1[_0x248b('0x30')][_0x248b('0x36')](_0x248b('0x37'))){_0x56e5c1[_0x248b('0x1c')]=qs[_0x248b('0x1c')](_0xe6bbb1[_0x248b('0x30')]['limit']);_0x56e5c1[_0x248b('0x1a')]=qs[_0x248b('0x1a')](_0xe6bbb1[_0x248b('0x30')]['offset']);}return _0x261b19[_0x248b('0x61')](_0x56e5c1);}})[_0x248b('0x22')](function(_0x428fb0){if(_0x428fb0){return _0x428fb0?{'count':_0x2caa49,'rows':_0x428fb0}:null;}})['then'](respondWithResult(_0x2e5faa,null))[_0x248b('0x3f')](handleError(_0x2e5faa,null));};exports[_0x248b('0x62')]=function(_0x1899da,_0x456d59,_0x5376ca){var _0x50f565,_0x3f1001;var _0x4899df=[];var _0x35005c=moment()[_0x248b('0x63')](_0x248b('0x64'));return db[_0x248b('0x2a')][_0x248b('0x44')]({'where':{'id':_0x1899da[_0x248b('0x41')]['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x456d59,null))[_0x248b('0x22')](function(_0x3f7028){if(_0x3f7028){_0x3f1001=_0x3f7028;return _0x3f7028[_0x248b('0x62')](_0x1899da[_0x248b('0x50')][_0x248b('0x65')],_['omit'](_0x1899da[_0x248b('0x50')],[_0x248b('0x65'),'id'])||{});}return null;})[_0x248b('0x66')](function(_0x3f1459){var _0x243e39;var _0x50da42;_0x50f565=_0x3f1459||[];var _0x2a5feb=[];if(_0x3f1459){for(var _0x55be0c=0x0;_0x55be0c<_0x3f1459['length'];_0x55be0c+=0x1){var _0x341a45=_0x3f1459[_0x55be0c][_0x248b('0x24')]({'plain':!![]});_0x3f1001[_0x248b('0x67')]=_0x1899da[_0x248b('0x50')][_0x248b('0x67')]?_0x1899da[_0x248b('0x50')]['dialCheckDuplicateType']:_0x3f1001['dialCheckDuplicateType'];switch(_0x3f1001[_0x248b('0x67')]){case _0x248b('0x68'):_0x243e39=squel[_0x248b('0x69')]()[_0x248b('0x6a')](_0x248b('0x6b'))['fromQuery']([_0x248b('0x6c'),_0x248b('0x6d'),_0x248b('0x6e'),'ListId',_0x248b('0x5a'),'createdAt',_0x248b('0x4f')],squel[_0x248b('0x6f')]()['field'](_0x248b('0x6c'),'phone')['field']('NOW()',_0x248b('0x6d'))[_0x248b('0x70')]('id',_0x248b('0x6e'))[_0x248b('0x70')](_0x341a45['CmListId'][_0x248b('0x71')](),_0x248b('0x72'))[_0x248b('0x70')](_0x1899da[_0x248b('0x41')]['id'][_0x248b('0x71')](),_0x248b('0x5a'))[_0x248b('0x70')]('\x27'+_0x35005c+'\x27',_0x248b('0x52'))['field']('\x27'+_0x35005c+'\x27',_0x248b('0x4f'))[_0x248b('0x73')](_0x248b('0x74'))[_0x248b('0x3b')](_0x248b('0x75'))[_0x248b('0x3b')](_0x248b('0x76'),_0x341a45['CmListId'][_0x248b('0x71')]())[_0x248b('0x3b')](_0x248b('0x77'))['where'](_0x248b('0x78'),squel['select']()['field'](_0x248b('0x79'))[_0x248b('0x73')](_0x248b('0x7a'))['where'](_0x248b('0x7b'),_0x1899da['params']['id'][_0x248b('0x71')]()))[_0x248b('0x3b')](_0x248b('0x78'),squel['select']()[_0x248b('0x70')]('COALESCE(phone,\x27\x27)')[_0x248b('0x73')]('cm_hopper')[_0x248b('0x3b')]('CampaignId\x20=\x20?',_0x1899da[_0x248b('0x41')]['id'][_0x248b('0x71')]())))[_0x248b('0x71')]();break;case _0x248b('0x7c'):_0x243e39=squel[_0x248b('0x69')]()[_0x248b('0x6a')](_0x248b('0x6b'))[_0x248b('0x7d')]([_0x248b('0x6c'),_0x248b('0x6d'),_0x248b('0x6e'),_0x248b('0x72'),_0x248b('0x5a'),_0x248b('0x52'),_0x248b('0x4f')],squel[_0x248b('0x6f')]()[_0x248b('0x70')]('phone',_0x248b('0x6c'))[_0x248b('0x70')](_0x248b('0x7e'),'scheduledAt')['field']('id',_0x248b('0x6e'))['field'](_0x341a45['CmListId'][_0x248b('0x71')](),'ListId')[_0x248b('0x70')](_0x1899da[_0x248b('0x41')]['id'][_0x248b('0x71')](),_0x248b('0x5a'))[_0x248b('0x70')]('\x27'+_0x35005c+'\x27',_0x248b('0x52'))[_0x248b('0x70')]('\x27'+_0x35005c+'\x27',_0x248b('0x4f'))['from'](_0x248b('0x74'))[_0x248b('0x3b')](_0x248b('0x75'))[_0x248b('0x3b')](_0x248b('0x76'),_0x341a45[_0x248b('0x7f')]['toString']())[_0x248b('0x3b')](_0x248b('0x77'))[_0x248b('0x3b')](_0x248b('0x78'),squel['select']()[_0x248b('0x70')]('COALESCE(phone,\x27\x27)')[_0x248b('0x73')](_0x248b('0x6b'))[_0x248b('0x3b')](_0x248b('0x7b'),_0x1899da[_0x248b('0x41')]['id'][_0x248b('0x71')]())))['toString']();break;default:_0x243e39=squel[_0x248b('0x69')]()[_0x248b('0x6a')](_0x248b('0x6b'))[_0x248b('0x7d')]([_0x248b('0x6c'),_0x248b('0x6d'),_0x248b('0x6e'),_0x248b('0x72'),_0x248b('0x5a'),_0x248b('0x52'),'updatedAt'],squel[_0x248b('0x6f')]()[_0x248b('0x70')]('phone',_0x248b('0x6c'))[_0x248b('0x70')]('NOW()',_0x248b('0x6d'))[_0x248b('0x70')]('id',_0x248b('0x6e'))[_0x248b('0x70')](_0x341a45[_0x248b('0x7f')]['toString'](),_0x248b('0x72'))[_0x248b('0x70')](_0x1899da['params']['id'][_0x248b('0x71')](),_0x248b('0x5a'))[_0x248b('0x70')]('\x27'+_0x35005c+'\x27',_0x248b('0x52'))[_0x248b('0x70')]('\x27'+_0x35005c+'\x27',_0x248b('0x4f'))[_0x248b('0x73')](_0x248b('0x74'))[_0x248b('0x3b')]('deletedAt\x20IS\x20NULL')[_0x248b('0x3b')]('ListId\x20=\x20?',_0x341a45[_0x248b('0x7f')][_0x248b('0x71')]())[_0x248b('0x3b')](_0x248b('0x77')))[_0x248b('0x71')]();}_0x50da42=squel['insert']()[_0x248b('0x6a')](_0x248b('0x80'))[_0x248b('0x7d')]([_0x248b('0x81'),_0x248b('0x6d'),_0x248b('0x6c'),'OrderBy',_0x248b('0x52'),_0x248b('0x4f')],squel['select']()['field'](_0x248b('0x82'),'id')['field'](_0x248b('0x7e'),_0x248b('0x6d'))[_0x248b('0x70')](_0x248b('0x83'),_0x248b('0x6c'))[_0x248b('0x70')](_0x248b('0x84'),'OrderBy')['field']('\x27'+_0x35005c+'\x27',_0x248b('0x52'))['field']('\x27'+_0x35005c+'\x27',_0x248b('0x4f'))[_0x248b('0x73')](_0x248b('0x85'),'ci')['join'](_0x248b('0x6b'),'h',_0x248b('0x86'))[_0x248b('0x3b')](_0x248b('0x87'),_0x341a45[_0x248b('0x7f')][_0x248b('0x71')]())[_0x248b('0x3b')](_0x248b('0x88'),_0x1899da[_0x248b('0x41')]['id']['toString']())[_0x248b('0x3b')](_0x248b('0x89'),_0x35005c))[_0x248b('0x71')]();_0x2a5feb['push'](db[_0x248b('0x8a')][_0x248b('0x30')](_0x243e39));_0x4899df[_0x248b('0x8b')](db['sequelize'][_0x248b('0x30')](_0x50da42));}return BPromise[_0x248b('0x8c')](_0x2a5feb);}})[_0x248b('0x22')](function(){return BPromise[_0x248b('0x8c')](_0x4899df);})[_0x248b('0x22')](function(){return _0x50f565;})['then'](respondWithResult(_0x456d59,null))[_0x248b('0x3f')](handleError(_0x456d59,null));};exports['removeLists']=function(_0x28eebc,_0x20f103,_0x170366){return db[_0x248b('0x2a')][_0x248b('0x44')]({'where':{'id':_0x28eebc[_0x248b('0x41')]['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x20f103,null))[_0x248b('0x22')](function(_0x5eaf00){if(_0x5eaf00){return _0x5eaf00[_0x248b('0x8d')](_0x28eebc['query'][_0x248b('0x65')]);}})[_0x248b('0x22')](function(_0x247352){if(_0x247352){return db[_0x248b('0x56')][_0x248b('0x23')]({'where':{'ListId':_0x28eebc[_0x248b('0x30')][_0x248b('0x65')],'CampaignId':_0x28eebc[_0x248b('0x41')]['id']}})[_0x248b('0x22')](function(){return _0x247352;});}})[_0x248b('0x22')](respondWithStatusCode(_0x20f103,null))[_0x248b('0x3f')](handleError(_0x20f103,null));};exports['getBlackLists']=function(_0x4785bd,_0x3355f5,_0x48c797){var _0xce6365={};var _0x27e83c={};var _0x5ef087;var _0x2fe048;return db[_0x248b('0x2a')][_0x248b('0x55')]({'where':{'id':_0x4785bd[_0x248b('0x41')]['id']}})['then'](handleEntityNotFound(_0x3355f5,null))[_0x248b('0x22')](function(_0x201216){if(_0x201216){_0x5ef087=_0x201216;_0x27e83c[_0x248b('0x2f')]=_[_0x248b('0x31')](db[_0x248b('0x8e')][_0x248b('0x2b')]);_0x27e83c[_0x248b('0x30')]=_['keys'](_0x4785bd[_0x248b('0x30')]);_0x27e83c['filters']=_[_0x248b('0x32')](_0x27e83c[_0x248b('0x2f')],_0x27e83c[_0x248b('0x30')]);_0xce6365['attributes']=_[_0x248b('0x32')](_0x27e83c[_0x248b('0x2f')],qs[_0x248b('0x34')](_0x4785bd['query'][_0x248b('0x34')]));_0xce6365[_0x248b('0x33')]=_0xce6365[_0x248b('0x33')][_0x248b('0x35')]?_0xce6365['attributes']:_0x27e83c['model'];_0xce6365[_0x248b('0x38')]=qs['sort'](_0x4785bd[_0x248b('0x30')][_0x248b('0x39')]);_0xce6365['where']=qs[_0x248b('0x42')](_[_0x248b('0x5d')](_0x4785bd[_0x248b('0x30')],_0x27e83c['filters']));if(_0x4785bd[_0x248b('0x30')]['filter']){_0xce6365['where']=_[_0x248b('0x3c')](_0xce6365['where'],{'$or':_[_0x248b('0x29')](_0xce6365[_0x248b('0x33')],function(_0x257eb8){var _0x481ac8={};_0x481ac8[_0x257eb8]={'$like':'%'+_0x4785bd[_0x248b('0x30')][_0x248b('0x3a')]+'%'};return _0x481ac8;})});}_0xce6365=_[_0x248b('0x3c')]({},_0xce6365,_0x4785bd[_0x248b('0x3d')]);return _0x5ef087[_0x248b('0x8f')](_0xce6365);}})[_0x248b('0x22')](function(_0x66960b){if(_0x66960b){_0x2fe048=_0x66960b[_0x248b('0x35')];if(!_0x4785bd['query'][_0x248b('0x36')](_0x248b('0x37'))){_0xce6365['limit']=qs[_0x248b('0x1c')](_0x4785bd[_0x248b('0x30')][_0x248b('0x1c')]);_0xce6365[_0x248b('0x1a')]=qs['offset'](_0x4785bd[_0x248b('0x30')][_0x248b('0x1a')]);}return _0x5ef087[_0x248b('0x8f')](_0xce6365);}})['then'](function(_0x43f1c5){if(_0x43f1c5){return _0x43f1c5?{'count':_0x2fe048,'rows':_0x43f1c5}:null;}})['then'](respondWithResult(_0x3355f5,null))[_0x248b('0x3f')](handleError(_0x3355f5,null));};exports[_0x248b('0x90')]=function(_0x597dd2,_0x4c3580,_0x574586){var _0x1a33a7,_0x49d1e3;var _0x4d650c=[];var _0x3be4bb=moment()[_0x248b('0x63')](_0x248b('0x64'));return db[_0x248b('0x2a')]['find']({'where':{'id':_0x597dd2['params']['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x4c3580,null))[_0x248b('0x22')](function(_0x4e1181){if(_0x4e1181){_0x49d1e3=_0x4e1181;return _0x4e1181['addBlackLists'](_0x597dd2[_0x248b('0x50')][_0x248b('0x65')],_['omit'](_0x597dd2['body'],[_0x248b('0x65'),'id'])||{});}return null;})[_0x248b('0x66')](function(_0x576176){var _0x314d1d;var _0x13ffc5;_0x1a33a7=_0x576176||[];var _0x4dd6ea=[];if(_0x576176){for(var _0x36ecdc=0x0;_0x36ecdc<_0x576176[_0x248b('0x35')];_0x36ecdc+=0x1){var _0x2b08bc=_0x576176[_0x36ecdc][_0x248b('0x24')]({'plain':!![]});_0x314d1d=squel[_0x248b('0x69')]()[_0x248b('0x6a')](_0x248b('0x91'))[_0x248b('0x7d')](['phone',_0x248b('0x6e'),_0x248b('0x72'),_0x248b('0x5a'),_0x248b('0x52'),_0x248b('0x4f')],squel['select']()[_0x248b('0x70')](_0x248b('0x6c'),_0x248b('0x6c'))[_0x248b('0x70')]('id',_0x248b('0x6e'))[_0x248b('0x70')](_0x2b08bc[_0x248b('0x7f')][_0x248b('0x71')](),_0x248b('0x72'))[_0x248b('0x70')](_0x597dd2['params']['id'][_0x248b('0x71')](),'CampaignId')[_0x248b('0x70')](_0x248b('0x7e'),'createdAt')[_0x248b('0x70')]('NOW()',_0x248b('0x4f'))['from'](_0x248b('0x74'))[_0x248b('0x3b')](_0x248b('0x75'))[_0x248b('0x3b')]('ListId\x20=\x20?',_0x2b08bc['CmListId'][_0x248b('0x71')]())[_0x248b('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0x248b('0x71')]();_0x4dd6ea['push'](db[_0x248b('0x8a')][_0x248b('0x30')](_0x314d1d));}return BPromise[_0x248b('0x8c')](_0x4dd6ea);}})[_0x248b('0x22')](function(){return _0x1a33a7;})[_0x248b('0x22')](respondWithResult(_0x4c3580,null))['catch'](handleError(_0x4c3580,null));};exports['removeBlackLists']=function(_0x2727ab,_0x3d51e3,_0x542ee2){return db[_0x248b('0x2a')][_0x248b('0x44')]({'where':{'id':_0x2727ab['params']['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x3d51e3,null))[_0x248b('0x22')](function(_0x84d86){if(_0x84d86){return _0x84d86[_0x248b('0x92')](_0x2727ab[_0x248b('0x30')][_0x248b('0x65')]);}})[_0x248b('0x22')](function(_0x22ebb2){if(_0x22ebb2){return db[_0x248b('0x60')][_0x248b('0x23')]({'where':{'ListId':_0x2727ab['query'][_0x248b('0x65')],'CampaignId':_0x2727ab[_0x248b('0x41')]['id']}})[_0x248b('0x22')](function(){return _0x22ebb2;});}})[_0x248b('0x22')](respondWithStatusCode(_0x3d51e3,null))[_0x248b('0x3f')](handleError(_0x3d51e3,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 4387c0d..7de4975 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x22fc1d,_0x5b8ee1){var _0x29e032=function(_0x69e18a){while(--_0x69e18a){_0x22fc1d['push'](_0x22fc1d['shift']());}};_0x29e032(++_0x5b8ee1);}(_0x7a54,0x106));var _0x47a5=function(_0x5509f4,_0x25cbf5){_0x5509f4=_0x5509f4-0x0;var _0x101888=_0x7a54[_0x5509f4];return _0x101888;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x45d809,_0x379b71){var _0x1fdd72=function(_0x57c7c5){while(--_0x57c7c5){_0x45d809['push'](_0x45d809['shift']());}};_0x1fdd72(++_0x379b71);}(_0x7a54,0x106));var _0x47a5=function(_0x5d2b94,_0x1f0128){_0x5d2b94=_0x5d2b94-0x0;var _0x1925a0=_0x7a54[_0x5d2b94];return _0x1925a0;};'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 10b3249..ec9baad 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 _0xd737=['result','catch','Campaign','findAll','options','where','attributes','limit','include','model','map','then','GetCampaign','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','client','http','request','info','Campaign,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x374457,_0x512e82){var _0x269036=function(_0x51f615){while(--_0x51f615){_0x374457['push'](_0x374457['shift']());}};_0x269036(++_0x512e82);}(_0xd737,0x85));var _0x7d73=function(_0x15cbce,_0xda8402){_0x15cbce=_0x15cbce-0x0;var _0x257f29=_0xd737[_0x15cbce];return _0x257f29;};'use strict';var _=require(_0x7d73('0x0'));var util=require('util');var moment=require(_0x7d73('0x1'));var BPromise=require('bluebird');var rs=require(_0x7d73('0x2'));var fs=require('fs');var Redis=require(_0x7d73('0x3'));var db=require(_0x7d73('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7d73('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7d73('0x6')][_0x7d73('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x70a9f1,_0x1bd2f4,_0x10dec9){return new BPromise(function(_0x4552e3,_0x3e100b){return client[_0x7d73('0x8')](_0x70a9f1,_0x10dec9)['then'](function(_0x57fbe4){logger[_0x7d73('0x9')](_0x7d73('0xa'),_0x1bd2f4,'request\x20sent');logger[_0x7d73('0xb')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1bd2f4,_0x7d73('0xc'),JSON[_0x7d73('0xd')](_0x57fbe4));if(_0x57fbe4[_0x7d73('0xe')]){if(_0x57fbe4['error'][_0x7d73('0xf')]===0x1f4){logger[_0x7d73('0xe')]('Campaign,\x20%s,\x20%s',_0x1bd2f4,_0x57fbe4[_0x7d73('0xe')][_0x7d73('0x10')]);return _0x3e100b(_0x57fbe4[_0x7d73('0xe')][_0x7d73('0x10')]);}logger['error'](_0x7d73('0xa'),_0x1bd2f4,_0x57fbe4['error']['message']);return _0x4552e3(_0x57fbe4[_0x7d73('0xe')][_0x7d73('0x10')]);}else{logger[_0x7d73('0x9')]('Campaign,\x20%s,\x20%s',_0x1bd2f4,_0x7d73('0xc'));_0x4552e3(_0x57fbe4[_0x7d73('0x11')][_0x7d73('0x10')]);}})[_0x7d73('0x12')](function(_0x113598){logger[_0x7d73('0xe')](_0x7d73('0xa'),_0x1bd2f4,_0x113598);_0x3e100b(_0x113598);});});}exports['GetCampaign']=function(_0x25868c){var _0x50539e=this;return new Promise(function(_0x50ec8a,_0x185858){return db[_0x7d73('0x13')][_0x7d73('0x14')]({'raw':_0x25868c[_0x7d73('0x15')]?_0x25868c['options']['raw']===undefined?!![]:![]:!![],'where':_0x25868c[_0x7d73('0x15')]?_0x25868c[_0x7d73('0x15')][_0x7d73('0x16')]||null:null,'attributes':_0x25868c[_0x7d73('0x15')]?_0x25868c['options'][_0x7d73('0x17')]||null:null,'limit':_0x25868c[_0x7d73('0x15')]?_0x25868c[_0x7d73('0x15')][_0x7d73('0x18')]||null:null,'include':_0x25868c[_0x7d73('0x15')]?_0x25868c[_0x7d73('0x15')][_0x7d73('0x19')]?_['map'](_0x25868c['options'][_0x7d73('0x19')],function(_0x5a324e){return{'model':db[_0x5a324e[_0x7d73('0x1a')]],'as':_0x5a324e['as'],'attributes':_0x5a324e[_0x7d73('0x17')],'include':_0x5a324e[_0x7d73('0x19')]?_[_0x7d73('0x1b')](_0x5a324e[_0x7d73('0x19')],function(_0x42253b){return{'model':db[_0x42253b['model']],'as':_0x42253b['as'],'attributes':_0x42253b[_0x7d73('0x17')],'include':_0x42253b['include']?_['map'](_0x42253b[_0x7d73('0x19')],function(_0x4e26f7){return{'model':db[_0x4e26f7[_0x7d73('0x1a')]],'as':_0x4e26f7['as'],'attributes':_0x4e26f7[_0x7d73('0x17')]};}):[]};}):[]};}):[]:[]})[_0x7d73('0x1c')](function(_0x227ebc){logger['info'](_0x7d73('0x1d'),_0x25868c);logger['debug']('GetCampaign',_0x25868c,JSON[_0x7d73('0xd')](_0x227ebc));_0x50ec8a(_0x227ebc);})[_0x7d73('0x12')](function(_0x1451bc){logger[_0x7d73('0xe')](_0x7d73('0x1d'),_0x1451bc[_0x7d73('0x10')],_0x25868c);_0x185858(_0x50539e[_0x7d73('0xe')](0x1f4,_0x1451bc[_0x7d73('0x10')]));});});}; \ No newline at end of file +var _0xf9f7=['../../config/environment','jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x5ab190,_0x444ff4){var _0x3097a2=function(_0x579a87){while(--_0x579a87){_0x5ab190['push'](_0x5ab190['shift']());}};_0x3097a2(++_0x444ff4);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x39780c,_0x5782c9){_0x39780c=_0x39780c-0x0;var _0x53c19b=_0xf9f7[_0x39780c];return _0x53c19b;};'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});function respondWithRpcPromise(_0x5b5819,_0x37e39f,_0x3da87e){return new BPromise(function(_0x181328,_0x3e9e75){return client[_0x7f9f('0xc')](_0x5b5819,_0x3da87e)['then'](function(_0x3fda85){logger[_0x7f9f('0xd')](_0x7f9f('0xe'),_0x37e39f,_0x7f9f('0xf'));logger[_0x7f9f('0x10')](_0x7f9f('0x11'),_0x37e39f,_0x7f9f('0xf'),JSON['stringify'](_0x3fda85));if(_0x3fda85[_0x7f9f('0x12')]){if(_0x3fda85[_0x7f9f('0x12')]['code']===0x1f4){logger['error'](_0x7f9f('0xe'),_0x37e39f,_0x3fda85['error'][_0x7f9f('0x13')]);return _0x3e9e75(_0x3fda85[_0x7f9f('0x12')]['message']);}logger[_0x7f9f('0x12')]('Campaign,\x20%s,\x20%s',_0x37e39f,_0x3fda85[_0x7f9f('0x12')][_0x7f9f('0x13')]);return _0x181328(_0x3fda85[_0x7f9f('0x12')][_0x7f9f('0x13')]);}else{logger[_0x7f9f('0xd')]('Campaign,\x20%s,\x20%s',_0x37e39f,_0x7f9f('0xf'));_0x181328(_0x3fda85[_0x7f9f('0x14')]['message']);}})[_0x7f9f('0x15')](function(_0x4a36c8){logger[_0x7f9f('0x12')](_0x7f9f('0xe'),_0x37e39f,_0x4a36c8);_0x3e9e75(_0x4a36c8);});});}exports[_0x7f9f('0x16')]=function(_0x35f6b1){var _0x2d663e=this;return new Promise(function(_0x11e263,_0x47ae52){return db[_0x7f9f('0x17')][_0x7f9f('0x18')]({'raw':_0x35f6b1['options']?_0x35f6b1[_0x7f9f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x35f6b1[_0x7f9f('0x19')]?_0x35f6b1[_0x7f9f('0x19')][_0x7f9f('0x1a')]||null:null,'attributes':_0x35f6b1[_0x7f9f('0x19')]?_0x35f6b1['options'][_0x7f9f('0x1b')]||null:null,'limit':_0x35f6b1['options']?_0x35f6b1['options'][_0x7f9f('0x1c')]||null:null,'include':_0x35f6b1[_0x7f9f('0x19')]?_0x35f6b1[_0x7f9f('0x19')][_0x7f9f('0x1d')]?_[_0x7f9f('0x1e')](_0x35f6b1['options']['include'],function(_0x3ec242){return{'model':db[_0x3ec242['model']],'as':_0x3ec242['as'],'attributes':_0x3ec242[_0x7f9f('0x1b')],'include':_0x3ec242[_0x7f9f('0x1d')]?_[_0x7f9f('0x1e')](_0x3ec242[_0x7f9f('0x1d')],function(_0x1a49a9){return{'model':db[_0x1a49a9[_0x7f9f('0x1f')]],'as':_0x1a49a9['as'],'attributes':_0x1a49a9['attributes'],'include':_0x1a49a9[_0x7f9f('0x1d')]?_['map'](_0x1a49a9[_0x7f9f('0x1d')],function(_0x3464f2){return{'model':db[_0x3464f2[_0x7f9f('0x1f')]],'as':_0x3464f2['as'],'attributes':_0x3464f2['attributes']};}):[]};}):[]};}):[]:[]})[_0x7f9f('0x20')](function(_0x3380d7){logger[_0x7f9f('0xd')]('GetCampaign',_0x35f6b1);logger[_0x7f9f('0x10')](_0x7f9f('0x16'),_0x35f6b1,JSON['stringify'](_0x3380d7));_0x11e263(_0x3380d7);})['catch'](function(_0x5e2428){logger[_0x7f9f('0x12')]('GetCampaign',_0x5e2428[_0x7f9f('0x13')],_0x35f6b1);_0x47ae52(_0x2d663e[_0x7f9f('0x12')](0x1f4,_0x5e2428['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index b0c6ede..365e4bf 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 _0xc8f3=['create','/:id/clone','clone','addLists','addBlackLists','update','/:id','destroy','removeLists','delete','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post'];(function(_0x5c4e16,_0x113035){var _0x36044a=function(_0xde2f25){while(--_0xde2f25){_0x5c4e16['push'](_0x5c4e16['shift']());}};_0x36044a(++_0x113035);}(_0xc8f3,0x1d3));var _0x3c8f=function(_0x3cb3ca,_0x44d697){_0x3cb3ca=_0x3cb3ca-0x0;var _0x214366=_0xc8f3[_0x3cb3ca];return _0x214366;};'use strict';var multer=require(_0x3c8f('0x0'));var util=require(_0x3c8f('0x1'));var path=require(_0x3c8f('0x2'));var timeout=require(_0x3c8f('0x3'));var express=require(_0x3c8f('0x4'));var router=express[_0x3c8f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3c8f('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3c8f('0x7'));router[_0x3c8f('0x8')]('/',auth[_0x3c8f('0x9')](),controller[_0x3c8f('0xa')]);router[_0x3c8f('0x8')]('/:id',auth[_0x3c8f('0x9')](),controller[_0x3c8f('0xb')]);router[_0x3c8f('0x8')](_0x3c8f('0xc'),auth[_0x3c8f('0x9')](),controller[_0x3c8f('0xd')]);router[_0x3c8f('0x8')](_0x3c8f('0xe'),auth[_0x3c8f('0x9')](),controller['getHopperHistories']);router[_0x3c8f('0x8')](_0x3c8f('0xf'),auth['isAuthenticated'](),controller[_0x3c8f('0x10')]);router[_0x3c8f('0x8')](_0x3c8f('0x11'),auth['isAuthenticated'](),controller[_0x3c8f('0x12')]);router['get'](_0x3c8f('0x13'),auth['isAuthenticated'](),controller[_0x3c8f('0x14')]);router['get'](_0x3c8f('0x15'),auth[_0x3c8f('0x9')](),controller['getBlackLists']);router[_0x3c8f('0x16')]('/',auth['isAuthenticated'](),controller[_0x3c8f('0x17')]);router[_0x3c8f('0x16')](_0x3c8f('0x18'),auth[_0x3c8f('0x9')](),controller[_0x3c8f('0x19')]);router[_0x3c8f('0x16')](_0x3c8f('0x13'),auth[_0x3c8f('0x9')](),controller[_0x3c8f('0x1a')]);router['post'](_0x3c8f('0x15'),auth[_0x3c8f('0x9')](),controller[_0x3c8f('0x1b')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3c8f('0x1c')]);router['delete'](_0x3c8f('0x1d'),auth[_0x3c8f('0x9')](),controller[_0x3c8f('0x1e')]);router['delete'](_0x3c8f('0x13'),auth['isAuthenticated'](),controller[_0x3c8f('0x1f')]);router[_0x3c8f('0x20')]('/:id/blacklists',auth[_0x3c8f('0x9')](),controller[_0x3c8f('0x21')]);module[_0x3c8f('0x22')]=router; \ No newline at end of file +var _0x5156=['put','/:id','update','delete','destroy','removeLists','removeBlackLists','util','path','../../config/environment','./campaign.controller','get','isAuthenticated','show','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','create','post','clone','addLists','addBlackLists'];(function(_0x2a0a76,_0x465cd3){var _0x1cd3d6=function(_0x2ea610){while(--_0x2ea610){_0x2a0a76['push'](_0x2a0a76['shift']());}};_0x1cd3d6(++_0x465cd3);}(_0x5156,0xf1));var _0x6515=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0x5156[_0x54c9dd];return _0x855156;};'use strict';var multer=require('multer');var util=require(_0x6515('0x0'));var path=require(_0x6515('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6515('0x2'));var controller=require(_0x6515('0x3'));router[_0x6515('0x4')]('/',auth[_0x6515('0x5')](),controller['index']);router[_0x6515('0x4')]('/:id',auth[_0x6515('0x5')](),controller[_0x6515('0x6')]);router['get']('/:id/hoppers',auth['isAuthenticated'](),controller[_0x6515('0x7')]);router[_0x6515('0x4')]('/:id/hopper_histories',auth[_0x6515('0x5')](),controller[_0x6515('0x8')]);router[_0x6515('0x4')](_0x6515('0x9'),auth[_0x6515('0x5')](),controller[_0x6515('0xa')]);router[_0x6515('0x4')]('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x6515('0x4')](_0x6515('0xb'),auth[_0x6515('0x5')](),controller[_0x6515('0xc')]);router['get'](_0x6515('0xd'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth[_0x6515('0x5')](),controller[_0x6515('0xe')]);router[_0x6515('0xf')]('/:id/clone',auth['isAuthenticated'](),controller[_0x6515('0x10')]);router[_0x6515('0xf')](_0x6515('0xb'),auth[_0x6515('0x5')](),controller[_0x6515('0x11')]);router['post'](_0x6515('0xd'),auth[_0x6515('0x5')](),controller[_0x6515('0x12')]);router[_0x6515('0x13')](_0x6515('0x14'),auth[_0x6515('0x5')](),controller[_0x6515('0x15')]);router[_0x6515('0x16')](_0x6515('0x14'),auth[_0x6515('0x5')](),controller[_0x6515('0x17')]);router[_0x6515('0x16')](_0x6515('0xb'),auth[_0x6515('0x5')](),controller[_0x6515('0x18')]);router['delete'](_0x6515('0xd'),auth[_0x6515('0x5')](),controller[_0x6515('0x19')]);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 3954ea5..4da711b 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 _0x3dc8=['key','sequelize','exports','STRING','TEXT','medium','VIRTUAL','getDataValue'];(function(_0xa4c85,_0x2b52a7){var _0x172c1f=function(_0x149473){while(--_0x149473){_0xa4c85['push'](_0xa4c85['shift']());}};_0x172c1f(++_0x2b52a7);}(_0x3dc8,0xa1));var _0x83dc=function(_0x109c81,_0x441e02){_0x109c81=_0x109c81-0x0;var _0x2666be=_0x3dc8[_0x109c81];return _0x2666be;};'use strict';var Sequelize=require(_0x83dc('0x0'));module[_0x83dc('0x1')]={'key':{'type':Sequelize[_0x83dc('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x83dc('0x3')],'length':_0x83dc('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x83dc('0x5')],'get':function(){return this[_0x83dc('0x6')](_0x83dc('0x7'));}}}; \ No newline at end of file +var _0x214a=['VIRTUAL','getDataValue','key','sequelize','TEXT','medium','STRING'];(function(_0x254c4e,_0x50c941){var _0x327c37=function(_0x406fcb){while(--_0x406fcb){_0x254c4e['push'](_0x254c4e['shift']());}};_0x327c37(++_0x50c941);}(_0x214a,0xff));var _0xa214=function(_0x408755,_0x44dc8d){_0x408755=_0x408755-0x0;var _0x48baf4=_0x214a[_0x408755];return _0x48baf4;};'use strict';var Sequelize=require(_0xa214('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xa214('0x1')],'length':_0xa214('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xa214('0x3')]},'name':{'type':Sequelize[_0xa214('0x4')],'get':function(){return this[_0xa214('0x5')](_0xa214('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 64d8371..6523905 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 _0xc23f=['map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','filter','options','includeAll','include','findAll','show','fields','find','catch','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','sendStatus','stack','name','send','index'];(function(_0xb6e43,_0x1568fc){var _0x47c40f=function(_0x107786){while(--_0x107786){_0xb6e43['push'](_0xb6e43['shift']());}};_0x47c40f(++_0x1568fc);}(_0xc23f,0x18b));var _0xfc23=function(_0x4f0ba1,_0x73d00f){_0x4f0ba1=_0x4f0ba1-0x0;var _0x34c92e=_0xc23f[_0x4f0ba1];return _0x34c92e;};'use strict';var emlformat=require(_0xfc23('0x0'));var rimraf=require(_0xfc23('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfc23('0x2'));var rp=require(_0xfc23('0x3'));var moment=require(_0xfc23('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfc23('0x5'));var util=require('util');var path=require(_0xfc23('0x6'));var sox=require('sox');var csv=require(_0xfc23('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfc23('0x8'));var _=require(_0xfc23('0x9'));var squel=require('squel');var crypto=require(_0xfc23('0xa'));var jsforce=require(_0xfc23('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfc23('0x7'));var querystring=require(_0xfc23('0xc'));var Papa=require(_0xfc23('0xd'));var Redis=require('ioredis');var authService=require(_0xfc23('0xe'));var qs=require(_0xfc23('0xf'));var as=require(_0xfc23('0x10'));var hardwareService=require(_0xfc23('0x11'));var logger=require(_0xfc23('0x12'))(_0xfc23('0x13'));var utils=require(_0xfc23('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfc23('0x15'))['db'];function respondWithStatusCode(_0x5c8a7a,_0xd6d84e){_0xd6d84e=_0xd6d84e||0xcc;return function(_0x537230){if(_0x537230){return _0x5c8a7a['sendStatus'](_0xd6d84e);}return _0x5c8a7a['status'](_0xd6d84e)[_0xfc23('0x16')]();};}function respondWithResult(_0x57fc29,_0xf5ef14){_0xf5ef14=_0xf5ef14||0xc8;return function(_0x53db8d){if(_0x53db8d){return _0x57fc29['status'](_0xf5ef14)['json'](_0x53db8d);}};}function respondWithFilteredResult(_0x1de72a,_0x5f1b3a){return function(_0x5149a1){if(_0x5149a1){var _0x4cf7b6=typeof _0x5f1b3a[_0xfc23('0x17')]===_0xfc23('0x18')&&typeof _0x5f1b3a[_0xfc23('0x19')]===_0xfc23('0x18');var _0x59041d=_0x5149a1[_0xfc23('0x1a')];var _0x542848=_0x4cf7b6?0x0:_0x5f1b3a[_0xfc23('0x17')];var _0x240174=_0x4cf7b6?_0x5149a1['count']:_0x5f1b3a[_0xfc23('0x17')]+_0x5f1b3a[_0xfc23('0x19')];var _0x25623f;if(_0x240174>=_0x59041d){_0x240174=_0x59041d;_0x25623f=0xc8;}else{_0x25623f=0xce;}_0x1de72a[_0xfc23('0x1b')](_0x25623f);return _0x1de72a[_0xfc23('0x1c')](_0xfc23('0x1d'),_0x542848+'-'+_0x240174+'/'+_0x59041d)[_0xfc23('0x1e')](_0x5149a1);}return null;};}function patchUpdates(_0x2d0101){return function(_0xf5dd40){try{jsonpatch[_0xfc23('0x1f')](_0xf5dd40,_0x2d0101,!![]);}catch(_0x3a63a3){return BPromise[_0xfc23('0x20')](_0x3a63a3);}return _0xf5dd40[_0xfc23('0x21')]();};}function saveUpdates(_0x19788c,_0x5c1a18){return function(_0x1332c5){if(_0x1332c5){return _0x1332c5[_0xfc23('0x22')](_0x19788c)['then'](function(_0x46db46){return _0x46db46;});}return null;};}function removeEntity(_0x1ca6f4,_0x336b26){return function(_0x8d2d67){if(_0x8d2d67){return _0x8d2d67[_0xfc23('0x23')]()[_0xfc23('0x24')](function(){var _0x2a78e2=_0x8d2d67[_0xfc23('0x25')]({'plain':!![]});var _0x3cefac=_0xfc23('0x26');return db[_0xfc23('0x27')][_0xfc23('0x23')]({'where':{'type':_0x3cefac,'resourceId':_0x2a78e2['id']}})[_0xfc23('0x24')](function(){return _0x8d2d67;});})[_0xfc23('0x24')](function(){_0x1ca6f4[_0xfc23('0x1b')](0xcc)[_0xfc23('0x16')]();});}};}function handleEntityNotFound(_0x3059b0,_0x327e7b){return function(_0x49ca3a){if(!_0x49ca3a){_0x3059b0[_0xfc23('0x28')](0x194);}return _0x49ca3a;};}function handleError(_0x5f5c7e,_0x5d25c7){_0x5d25c7=_0x5d25c7||0x1f4;return function(_0x1a475e){logger['error'](_0x1a475e[_0xfc23('0x29')]);if(_0x1a475e[_0xfc23('0x2a')]){delete _0x1a475e['name'];}_0x5f5c7e['status'](_0x5d25c7)[_0xfc23('0x2b')](_0x1a475e);};}exports[_0xfc23('0x2c')]=function(_0x2aad41,_0x14f688){var _0x401601={},_0x487074={},_0x33a82a={'count':0x0,'rows':[]};var _0x2ca788=_[_0xfc23('0x2d')](db[_0xfc23('0x2e')][_0xfc23('0x2f')],function(_0x247b30){return{'name':_0x247b30[_0xfc23('0x30')],'type':_0x247b30[_0xfc23('0x31')][_0xfc23('0x32')]};});_0x487074[_0xfc23('0x33')]=_[_0xfc23('0x2d')](_0x2ca788,_0xfc23('0x2a'));_0x487074[_0xfc23('0x34')]=_[_0xfc23('0x35')](_0x2aad41[_0xfc23('0x34')]);_0x487074['filters']=_[_0xfc23('0x36')](_0x487074['model'],_0x487074[_0xfc23('0x34')]);_0x401601[_0xfc23('0x37')]=_[_0xfc23('0x36')](_0x487074[_0xfc23('0x33')],qs['fields'](_0x2aad41[_0xfc23('0x34')]['fields']));_0x401601['attributes']=_0x401601[_0xfc23('0x37')][_0xfc23('0x38')]?_0x401601['attributes']:_0x487074[_0xfc23('0x33')];if(!_0x2aad41['query']['hasOwnProperty'](_0xfc23('0x39'))){_0x401601['limit']=qs[_0xfc23('0x19')](_0x2aad41['query'][_0xfc23('0x19')]);_0x401601[_0xfc23('0x17')]=qs[_0xfc23('0x17')](_0x2aad41[_0xfc23('0x34')]['offset']);}_0x401601[_0xfc23('0x3a')]=qs[_0xfc23('0x3b')](_0x2aad41[_0xfc23('0x34')]['sort']);_0x401601[_0xfc23('0x3c')]=qs[_0xfc23('0x3d')](_['pick'](_0x2aad41[_0xfc23('0x34')],_0x487074[_0xfc23('0x3d')]),_0x2ca788);if(_0x2aad41[_0xfc23('0x34')][_0xfc23('0x3e')]){_0x401601[_0xfc23('0x3c')]=_['merge'](_0x401601['where'],{'$or':[{'key':{'$like':'%'+_0x2aad41[_0xfc23('0x34')][_0xfc23('0x3e')]+'%'}},{'value':{'$like':'%'+_0x2aad41['query']['filter']+'%'}}]});}_0x401601=_['merge']({},_0x401601,_0x2aad41[_0xfc23('0x3f')]);var _0x704232={'where':_0x401601[_0xfc23('0x3c')]};return db[_0xfc23('0x2e')][_0xfc23('0x1a')](_0x704232)[_0xfc23('0x24')](function(_0x3fb3b7){_0x33a82a[_0xfc23('0x1a')]=_0x3fb3b7;if(_0x2aad41[_0xfc23('0x34')][_0xfc23('0x40')]){_0x401601[_0xfc23('0x41')]=[{'all':!![]}];}return db[_0xfc23('0x2e')][_0xfc23('0x42')](_0x401601);})['then'](function(_0x65afd6){_0x33a82a['rows']=_0x65afd6;return _0x33a82a;})[_0xfc23('0x24')](respondWithFilteredResult(_0x14f688,_0x401601))['catch'](handleError(_0x14f688,null));};exports[_0xfc23('0x43')]=function(_0x41f82c,_0x57c795){var _0x2f2f34={'raw':!![],'where':{'id':_0x41f82c['params']['id']}},_0x10631f={};_0x10631f['model']=_[_0xfc23('0x35')](db[_0xfc23('0x2e')]['rawAttributes']);_0x10631f['query']=_[_0xfc23('0x35')](_0x41f82c[_0xfc23('0x34')]);_0x10631f['filters']=_[_0xfc23('0x36')](_0x10631f[_0xfc23('0x33')],_0x10631f[_0xfc23('0x34')]);_0x2f2f34['attributes']=_[_0xfc23('0x36')](_0x10631f[_0xfc23('0x33')],qs[_0xfc23('0x44')](_0x41f82c[_0xfc23('0x34')][_0xfc23('0x44')]));_0x2f2f34[_0xfc23('0x37')]=_0x2f2f34[_0xfc23('0x37')][_0xfc23('0x38')]?_0x2f2f34['attributes']:_0x10631f[_0xfc23('0x33')];if(_0x41f82c[_0xfc23('0x34')][_0xfc23('0x40')]){_0x2f2f34['include']=[{'all':!![]}];}_0x2f2f34=_['merge']({},_0x2f2f34,_0x41f82c[_0xfc23('0x3f')]);return db['CannedAnswer'][_0xfc23('0x45')](_0x2f2f34)[_0xfc23('0x24')](handleEntityNotFound(_0x57c795,null))[_0xfc23('0x24')](respondWithResult(_0x57c795,null))[_0xfc23('0x46')](handleError(_0x57c795,null));};exports[_0xfc23('0x22')]=function(_0x772539,_0x57080a){if(_0x772539[_0xfc23('0x47')]['id']){delete _0x772539[_0xfc23('0x47')]['id'];}return db['CannedAnswer'][_0xfc23('0x45')]({'where':{'id':_0x772539[_0xfc23('0x48')]['id']}})[_0xfc23('0x24')](handleEntityNotFound(_0x57080a,null))[_0xfc23('0x24')](saveUpdates(_0x772539[_0xfc23('0x47')],null))[_0xfc23('0x24')](respondWithResult(_0x57080a,null))[_0xfc23('0x46')](handleError(_0x57080a,null));};exports[_0xfc23('0x23')]=function(_0x32d4c1,_0x580360){return db['CannedAnswer'][_0xfc23('0x45')]({'where':{'id':_0x32d4c1['params']['id']}})[_0xfc23('0x24')](handleEntityNotFound(_0x580360,null))['then'](removeEntity(_0x580360,null))[_0xfc23('0x46')](handleError(_0x580360,null));};exports[_0xfc23('0x49')]=function(_0x152568,_0xd5c1c3){var _0x193cf6={'key':_0x152568[_0xfc23('0x47')][_0xfc23('0x32')]};if(_0x152568[_0xfc23('0x47')][_0xfc23('0x4a')]){_0x193cf6[_0xfc23('0x4a')]=_0x152568[_0xfc23('0x47')][_0xfc23('0x4a')];}else if(_0x152568[_0xfc23('0x47')]['SmsAccountId']){_0x193cf6[_0xfc23('0x4b')]=_0x152568[_0xfc23('0x47')]['SmsAccountId'];}else if(_0x152568[_0xfc23('0x47')]['OpenchannelAccountId']){_0x193cf6[_0xfc23('0x4c')]=_0x152568[_0xfc23('0x47')]['OpenchannelAccountId'];}else if(_0x152568[_0xfc23('0x47')]['ChatWebsiteId']){_0x193cf6[_0xfc23('0x4d')]=_0x152568[_0xfc23('0x47')]['ChatWebsiteId'];}return db[_0xfc23('0x2e')][_0xfc23('0x45')]({'where':_0x193cf6})[_0xfc23('0x24')](function(_0x2f36bb){if(_0x2f36bb){throw new db[(_0xfc23('0x4e'))]['ValidationError'](_0xfc23('0x4f'));}return db[_0xfc23('0x2e')][_0xfc23('0x49')](_0x152568[_0xfc23('0x47')]);})[_0xfc23('0x24')](function(_0x695036){var _0x26462e=_0x152568[_0xfc23('0x50')]['get']({'plain':!![]});if(!_0x26462e)throw new Error(_0xfc23('0x51'));if(_0x26462e[_0xfc23('0x52')]===_0xfc23('0x50')){var _0x3e57a5=_0x695036['get']({'plain':!![]});return db[_0xfc23('0x53')][_0xfc23('0x45')]({'where':{'name':_0xfc23('0x26'),'userProfileId':_0x26462e[_0xfc23('0x54')]},'raw':!![]})['then'](function(_0x422340){if(_0x422340&&_0x422340[_0xfc23('0x55')]===0x0){return db[_0xfc23('0x27')][_0xfc23('0x49')]({'name':_0x3e57a5[_0xfc23('0x2a')],'resourceId':_0x3e57a5['id'],'type':_0x422340['name'],'sectionId':_0x422340['id']},{})[_0xfc23('0x24')](function(){return _0x695036;});}else{return _0x695036;}})['catch'](function(_0x4e8f83){logger[_0xfc23('0x56')](_0xfc23('0x57'),_0x4e8f83);throw _0x4e8f83;});}return _0x695036;})[_0xfc23('0x24')](respondWithResult(_0xd5c1c3,0xc9))[_0xfc23('0x46')](handleError(_0xd5c1c3,null));}; \ No newline at end of file +var _0x084f=['jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','count','set','json','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','update','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x44caf4,_0x238750){var _0x117cad=function(_0x3e64c8){while(--_0x3e64c8){_0x44caf4['push'](_0x44caf4['shift']());}};_0x117cad(++_0x238750);}(_0x084f,0x158));var _0xf084=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x084f[_0x484e36];return _0xafc85d;};'use strict';var emlformat=require(_0xf084('0x0'));var rimraf=require(_0xf084('0x1'));var zipdir=require(_0xf084('0x2'));var jsonpatch=require(_0xf084('0x3'));var rp=require(_0xf084('0x4'));var moment=require(_0xf084('0x5'));var BPromise=require(_0xf084('0x6'));var Mustache=require(_0xf084('0x7'));var util=require(_0xf084('0x8'));var path=require('path');var sox=require(_0xf084('0x9'));var csv=require(_0xf084('0xa'));var ejs=require(_0xf084('0xb'));var fs=require('fs');var fs_extra=require(_0xf084('0xc'));var _=require(_0xf084('0xd'));var squel=require(_0xf084('0xe'));var crypto=require(_0xf084('0xf'));var jsforce=require(_0xf084('0x10'));var deskjs=require(_0xf084('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf084('0x12'));var Redis=require(_0xf084('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf084('0x14'));var as=require(_0xf084('0x15'));var hardwareService=require(_0xf084('0x16'));var logger=require(_0xf084('0x17'))(_0xf084('0x18'));var utils=require(_0xf084('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xf084('0x1a'));var db=require(_0xf084('0x1b'))['db'];function respondWithStatusCode(_0x11b1fc,_0x5e5e8e){_0x5e5e8e=_0x5e5e8e||0xcc;return function(_0x2f8db0){if(_0x2f8db0){return _0x11b1fc['sendStatus'](_0x5e5e8e);}return _0x11b1fc[_0xf084('0x1c')](_0x5e5e8e)[_0xf084('0x1d')]();};}function respondWithResult(_0x4d7148,_0x4597f0){_0x4597f0=_0x4597f0||0xc8;return function(_0x4f7b2d){if(_0x4f7b2d){return _0x4d7148[_0xf084('0x1c')](_0x4597f0)['json'](_0x4f7b2d);}};}function respondWithFilteredResult(_0x5a227f,_0x5bc27b){return function(_0x42706e){if(_0x42706e){var _0x21143f=typeof _0x5bc27b['offset']===_0xf084('0x1e')&&typeof _0x5bc27b['limit']==='undefined';var _0x5f2cd6=_0x42706e['count'];var _0x65e268=_0x21143f?0x0:_0x5bc27b['offset'];var _0x15180a=_0x21143f?_0x42706e[_0xf084('0x1f')]:_0x5bc27b['offset']+_0x5bc27b['limit'];var _0x2cff16;if(_0x15180a>=_0x5f2cd6){_0x15180a=_0x5f2cd6;_0x2cff16=0xc8;}else{_0x2cff16=0xce;}_0x5a227f[_0xf084('0x1c')](_0x2cff16);return _0x5a227f[_0xf084('0x20')]('Content-Range',_0x65e268+'-'+_0x15180a+'/'+_0x5f2cd6)[_0xf084('0x21')](_0x42706e);}return null;};}function patchUpdates(_0x7415b5){return function(_0x161713){try{jsonpatch['apply'](_0x161713,_0x7415b5,!![]);}catch(_0xfa6df0){return BPromise[_0xf084('0x22')](_0xfa6df0);}return _0x161713[_0xf084('0x23')]();};}function saveUpdates(_0x39b57e,_0x591fa8){return function(_0x49ad1a){if(_0x49ad1a){return _0x49ad1a['update'](_0x39b57e)[_0xf084('0x24')](function(_0x39efd9){return _0x39efd9;});}return null;};}function removeEntity(_0x164872,_0x45b9e9){return function(_0x1ef2dc){if(_0x1ef2dc){return _0x1ef2dc[_0xf084('0x25')]()[_0xf084('0x24')](function(){var _0x395068=_0x1ef2dc[_0xf084('0x26')]({'plain':!![]});var _0xe6d8bc=_0xf084('0x27');return db[_0xf084('0x28')]['destroy']({'where':{'type':_0xe6d8bc,'resourceId':_0x395068['id']}})[_0xf084('0x24')](function(){return _0x1ef2dc;});})['then'](function(){_0x164872['status'](0xcc)[_0xf084('0x1d')]();});}};}function handleEntityNotFound(_0x4fdd33,_0x3e6a68){return function(_0x2d5a44){if(!_0x2d5a44){_0x4fdd33['sendStatus'](0x194);}return _0x2d5a44;};}function handleError(_0x3ff3a3,_0xc9ae19){_0xc9ae19=_0xc9ae19||0x1f4;return function(_0xef56b2){logger['error'](_0xef56b2[_0xf084('0x29')]);if(_0xef56b2[_0xf084('0x2a')]){delete _0xef56b2['name'];}_0x3ff3a3[_0xf084('0x1c')](_0xc9ae19)[_0xf084('0x2b')](_0xef56b2);};}exports[_0xf084('0x2c')]=function(_0x42d1c5,_0x39209c){var _0x5f2acd={},_0x30885c={},_0x395331={'count':0x0,'rows':[]};var _0x2da5d9=_[_0xf084('0x2d')](db[_0xf084('0x2e')][_0xf084('0x2f')],function(_0x51501f){return{'name':_0x51501f[_0xf084('0x30')],'type':_0x51501f[_0xf084('0x31')][_0xf084('0x32')]};});_0x30885c[_0xf084('0x33')]=_[_0xf084('0x2d')](_0x2da5d9,_0xf084('0x2a'));_0x30885c[_0xf084('0x34')]=_['keys'](_0x42d1c5['query']);_0x30885c[_0xf084('0x35')]=_['intersection'](_0x30885c[_0xf084('0x33')],_0x30885c[_0xf084('0x34')]);_0x5f2acd[_0xf084('0x36')]=_[_0xf084('0x37')](_0x30885c[_0xf084('0x33')],qs[_0xf084('0x38')](_0x42d1c5[_0xf084('0x34')]['fields']));_0x5f2acd[_0xf084('0x36')]=_0x5f2acd['attributes']['length']?_0x5f2acd[_0xf084('0x36')]:_0x30885c[_0xf084('0x33')];if(!_0x42d1c5[_0xf084('0x34')][_0xf084('0x39')](_0xf084('0x3a'))){_0x5f2acd[_0xf084('0x3b')]=qs[_0xf084('0x3b')](_0x42d1c5['query'][_0xf084('0x3b')]);_0x5f2acd[_0xf084('0x3c')]=qs[_0xf084('0x3c')](_0x42d1c5[_0xf084('0x34')][_0xf084('0x3c')]);}_0x5f2acd[_0xf084('0x3d')]=qs[_0xf084('0x3e')](_0x42d1c5[_0xf084('0x34')][_0xf084('0x3e')]);_0x5f2acd[_0xf084('0x3f')]=qs[_0xf084('0x35')](_[_0xf084('0x40')](_0x42d1c5['query'],_0x30885c[_0xf084('0x35')]),_0x2da5d9);if(_0x42d1c5['query'][_0xf084('0x41')]){_0x5f2acd[_0xf084('0x3f')]=_[_0xf084('0x42')](_0x5f2acd[_0xf084('0x3f')],{'$or':[{'key':{'$like':'%'+_0x42d1c5[_0xf084('0x34')][_0xf084('0x41')]+'%'}},{'value':{'$like':'%'+_0x42d1c5[_0xf084('0x34')][_0xf084('0x41')]+'%'}}]});}_0x5f2acd=_['merge']({},_0x5f2acd,_0x42d1c5[_0xf084('0x43')]);var _0x2508da={'where':_0x5f2acd[_0xf084('0x3f')]};return db[_0xf084('0x2e')][_0xf084('0x1f')](_0x2508da)[_0xf084('0x24')](function(_0x2a3bf8){_0x395331[_0xf084('0x1f')]=_0x2a3bf8;if(_0x42d1c5['query'][_0xf084('0x44')]){_0x5f2acd[_0xf084('0x45')]=[{'all':!![]}];}return db[_0xf084('0x2e')][_0xf084('0x46')](_0x5f2acd);})[_0xf084('0x24')](function(_0x2e7c7f){_0x395331['rows']=_0x2e7c7f;return _0x395331;})[_0xf084('0x24')](respondWithFilteredResult(_0x39209c,_0x5f2acd))[_0xf084('0x47')](handleError(_0x39209c,null));};exports[_0xf084('0x48')]=function(_0x316c06,_0x223e8d){var _0x3e0590={'raw':!![],'where':{'id':_0x316c06[_0xf084('0x49')]['id']}},_0x3eafa4={};_0x3eafa4[_0xf084('0x33')]=_[_0xf084('0x4a')](db[_0xf084('0x2e')][_0xf084('0x2f')]);_0x3eafa4[_0xf084('0x34')]=_['keys'](_0x316c06[_0xf084('0x34')]);_0x3eafa4['filters']=_['intersection'](_0x3eafa4[_0xf084('0x33')],_0x3eafa4[_0xf084('0x34')]);_0x3e0590[_0xf084('0x36')]=_['intersection'](_0x3eafa4[_0xf084('0x33')],qs['fields'](_0x316c06[_0xf084('0x34')][_0xf084('0x38')]));_0x3e0590[_0xf084('0x36')]=_0x3e0590['attributes']['length']?_0x3e0590[_0xf084('0x36')]:_0x3eafa4['model'];if(_0x316c06[_0xf084('0x34')][_0xf084('0x44')]){_0x3e0590[_0xf084('0x45')]=[{'all':!![]}];}_0x3e0590=_['merge']({},_0x3e0590,_0x316c06[_0xf084('0x43')]);return db[_0xf084('0x2e')]['find'](_0x3e0590)[_0xf084('0x24')](handleEntityNotFound(_0x223e8d,null))[_0xf084('0x24')](respondWithResult(_0x223e8d,null))[_0xf084('0x47')](handleError(_0x223e8d,null));};exports[_0xf084('0x4b')]=function(_0x5c6109,_0x4e82c9){if(_0x5c6109[_0xf084('0x4c')]['id']){delete _0x5c6109[_0xf084('0x4c')]['id'];}return db[_0xf084('0x2e')][_0xf084('0x4d')]({'where':{'id':_0x5c6109['params']['id']}})[_0xf084('0x24')](handleEntityNotFound(_0x4e82c9,null))[_0xf084('0x24')](saveUpdates(_0x5c6109[_0xf084('0x4c')],null))['then'](respondWithResult(_0x4e82c9,null))[_0xf084('0x47')](handleError(_0x4e82c9,null));};exports[_0xf084('0x25')]=function(_0x100282,_0x1a177e){return db[_0xf084('0x2e')][_0xf084('0x4d')]({'where':{'id':_0x100282['params']['id']}})['then'](handleEntityNotFound(_0x1a177e,null))[_0xf084('0x24')](removeEntity(_0x1a177e,null))[_0xf084('0x47')](handleError(_0x1a177e,null));};exports[_0xf084('0x4e')]=function(_0x292904,_0x5716ed){var _0x5001ca={'key':_0x292904[_0xf084('0x4c')]['key']};if(_0x292904[_0xf084('0x4c')][_0xf084('0x4f')]){_0x5001ca[_0xf084('0x4f')]=_0x292904['body'][_0xf084('0x4f')];}else if(_0x292904['body'][_0xf084('0x50')]){_0x5001ca[_0xf084('0x50')]=_0x292904[_0xf084('0x4c')][_0xf084('0x50')];}else if(_0x292904['body'][_0xf084('0x51')]){_0x5001ca[_0xf084('0x51')]=_0x292904[_0xf084('0x4c')][_0xf084('0x51')];}else if(_0x292904['body'][_0xf084('0x52')]){_0x5001ca[_0xf084('0x52')]=_0x292904[_0xf084('0x4c')][_0xf084('0x52')];}return db[_0xf084('0x2e')][_0xf084('0x4d')]({'where':_0x5001ca})['then'](function(_0x3e259a){if(_0x3e259a){throw new db[(_0xf084('0x53'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xf084('0x2e')]['create'](_0x292904[_0xf084('0x4c')]);})[_0xf084('0x24')](function(_0x429a4b){var _0x5135e0=_0x292904[_0xf084('0x54')][_0xf084('0x26')]({'plain':!![]});if(!_0x5135e0)throw new Error(_0xf084('0x55'));if(_0x5135e0['role']==='user'){var _0x16d30d=_0x429a4b[_0xf084('0x26')]({'plain':!![]});return db['UserProfileSection'][_0xf084('0x4d')]({'where':{'name':'CannedAnswers','userProfileId':_0x5135e0[_0xf084('0x56')]},'raw':!![]})[_0xf084('0x24')](function(_0xa26e6e){if(_0xa26e6e&&_0xa26e6e[_0xf084('0x57')]===0x0){return db[_0xf084('0x28')]['create']({'name':_0x16d30d[_0xf084('0x2a')],'resourceId':_0x16d30d['id'],'type':_0xa26e6e[_0xf084('0x2a')],'sectionId':_0xa26e6e['id']},{})[_0xf084('0x24')](function(){return _0x429a4b;});}else{return _0x429a4b;}})['catch'](function(_0x59c51e){logger[_0xf084('0x58')](_0xf084('0x59'),_0x59c51e);throw _0x59c51e;});}return _0x429a4b;})[_0xf084('0x24')](respondWithResult(_0x5716ed,0xc9))[_0xf084('0x47')](handleError(_0x5716ed,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 27b7231..4d61ddc 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 _0x0e4a=['rimraf','../../config/environment','./cannedAnswer.attributes','exports','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise'];(function(_0x38c37c,_0x47bc42){var _0x4de49e=function(_0x5a6fa6){while(--_0x5a6fa6){_0x38c37c['push'](_0x38c37c['shift']());}};_0x4de49e(++_0x47bc42);}(_0x0e4a,0xd8));var _0xa0e4=function(_0x490be4,_0x521c66){_0x490be4=_0x490be4-0x0;var _0x173acc=_0x0e4a[_0x490be4];return _0x173acc;};'use strict';var _=require(_0xa0e4('0x0'));var util=require(_0xa0e4('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa0e4('0x2'));var rp=require(_0xa0e4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0e4('0x4'));var config=require(_0xa0e4('0x5'));var attributes=require(_0xa0e4('0x6'));module[_0xa0e4('0x7')]=function(_0x2a57b7,_0x2828d5){return _0x2a57b7['define']('CannedAnswer',attributes,{'tableName':_0xa0e4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa0e4('0x9'),'collate':_0xa0e4('0xa')});}; \ No newline at end of file +var _0x17f8=['rimraf','../../config/environment','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise'];(function(_0x4802ca,_0x433d6b){var _0x372e8c=function(_0x261d69){while(--_0x261d69){_0x4802ca['push'](_0x4802ca['shift']());}};_0x372e8c(++_0x433d6b);}(_0x17f8,0x11b));var _0x817f=function(_0xd81295,_0x326a39){_0xd81295=_0xd81295-0x0;var _0x5db80e=_0x17f8[_0xd81295];return _0x5db80e;};'use strict';var _=require('lodash');var util=require(_0x817f('0x0'));var logger=require(_0x817f('0x1'))(_0x817f('0x2'));var moment=require(_0x817f('0x3'));var BPromise=require('bluebird');var rp=require(_0x817f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x817f('0x5'));var config=require(_0x817f('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x817f('0x7')]=function(_0x4e29a1,_0x5e52c4){return _0x4e29a1[_0x817f('0x8')](_0x817f('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x817f('0xa'),'collate':_0x817f('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index a92e136..9267750 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(_0x306299,_0x3ef34d){var _0x17995c=function(_0x52c98d){while(--_0x52c98d){_0x306299['push'](_0x306299['shift']());}};_0x17995c(++_0x3ef34d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0xb42993,_0x3c222f){var _0x40f778=function(_0x4dd745){while(--_0x4dd745){_0xb42993['push'](_0xb42993['shift']());}};_0x40f778(++_0x3c222f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 71231a7..3dd698e 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 _0x461d=['multer','path','connect-timeout','../../components/auth/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x567b39,_0x1dc05f){var _0x14fa4f=function(_0x222101){while(--_0x222101){_0x567b39['push'](_0x567b39['shift']());}};_0x14fa4f(++_0x1dc05f);}(_0x461d,0x88));var _0xd461=function(_0x4c075d,_0x41f244){_0x4c075d=_0x4c075d-0x0;var _0x44c0df=_0x461d[_0x4c075d];return _0x44c0df;};'use strict';var multer=require(_0xd461('0x0'));var util=require('util');var path=require(_0xd461('0x1'));var timeout=require(_0xd461('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd461('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd461('0x4'));var controller=require(_0xd461('0x5'));router['get']('/',auth[_0xd461('0x6')](),controller[_0xd461('0x7')]);router[_0xd461('0x8')](_0xd461('0x9'),auth[_0xd461('0x6')](),controller[_0xd461('0xa')]);router[_0xd461('0xb')]('/',auth[_0xd461('0x6')](),controller['create']);router[_0xd461('0xc')](_0xd461('0x9'),auth[_0xd461('0x6')](),controller[_0xd461('0xd')]);router[_0xd461('0xe')](_0xd461('0x9'),auth[_0xd461('0x6')](),controller[_0xd461('0xf')]);module[_0xd461('0x10')]=router; \ No newline at end of file +var _0x1128=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','create','put','update','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x543670,_0x4d26b5){var _0x1e1c2d=function(_0x1dc07c){while(--_0x1dc07c){_0x543670['push'](_0x543670['shift']());}};_0x1e1c2d(++_0x4d26b5);}(_0x1128,0x151));var _0x8112=function(_0x479131,_0x2828f4){_0x479131=_0x479131-0x0;var _0x28e996=_0x1128[_0x479131];return _0x28e996;};'use strict';var multer=require(_0x8112('0x0'));var util=require(_0x8112('0x1'));var path=require(_0x8112('0x2'));var timeout=require(_0x8112('0x3'));var express=require('express');var router=express[_0x8112('0x4')]();var fs_extra=require(_0x8112('0x5'));var auth=require(_0x8112('0x6'));var interaction=require(_0x8112('0x7'));var config=require(_0x8112('0x8'));var controller=require(_0x8112('0x9'));router[_0x8112('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8112('0xa')](_0x8112('0xb'),auth[_0x8112('0xc')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x8112('0xd')]);router[_0x8112('0xe')](_0x8112('0xb'),auth[_0x8112('0xc')](),controller[_0x8112('0xf')]);router[_0x8112('0x10')](_0x8112('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x8112('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 7d9c6bf..18e6fe6 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 _0xb49a=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xb49a,0xfb));var _0xab49=function(_0xf925f2,_0x1fb6a0){_0xf925f2=_0xf925f2-0x0;var _0x181a50=_0xb49a[_0xf925f2];return _0x181a50;};'use strict';var Sequelize=require(_0xab49('0x0'));module[_0xab49('0x1')]={'calldate':{'type':Sequelize[_0xab49('0x2')],'allowNull':![],'defaultValue':_0xab49('0x3')},'clid':{'type':Sequelize[_0xab49('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xab49('0x4')]},'dcontext':{'type':Sequelize[_0xab49('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xab49('0x4')]},'lastdata':{'type':Sequelize[_0xab49('0x4')]},'duration':{'type':Sequelize[_0xab49('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xab49('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xab49('0x4')]},'amaflags':{'type':Sequelize[_0xab49('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xab49('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xab49('0x4')]},'linkedid':{'type':Sequelize[_0xab49('0x4')]},'sequence':{'type':Sequelize[_0xab49('0x4')]},'peeraccount':{'type':Sequelize[_0xab49('0x4')]},'type':{'type':Sequelize[_0xab49('0x4')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc73e=['exports','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x3c7880,_0x432f25){var _0x479b3b=function(_0x5385c3){while(--_0x5385c3){_0x3c7880['push'](_0x3c7880['shift']());}};_0x479b3b(++_0x432f25);}(_0xc73e,0x1e9));var _0xec73=function(_0x4adc0e,_0x5b2c31){_0x4adc0e=_0x4adc0e-0x0;var _0x4fbb5f=_0xc73e[_0x4adc0e];return _0x4fbb5f;};'use strict';var Sequelize=require(_0xec73('0x0'));module[_0xec73('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xec73('0x2')},'clid':{'type':Sequelize[_0xec73('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xec73('0x3')]},'dstchannel':{'type':Sequelize[_0xec73('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xec73('0x3')]},'duration':{'type':Sequelize[_0xec73('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xec73('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xec73('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xec73('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xec73('0x3')]},'linkedid':{'type':Sequelize[_0xec73('0x3')]},'sequence':{'type':Sequelize[_0xec73('0x3')]},'peeraccount':{'type':Sequelize[_0xec73('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 0013518..9411c87 100644 --- a/server/api/cdr/cdr.controller.js +++ b/server/api/cdr/cdr.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','Cdr','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x55ca,0x126));var _0xa55c=function(_0x35b87c,_0x166a8c){_0x35b87c=_0x35b87c-0x0;var _0x24795b=_0x55ca[_0x35b87c];return _0x24795b;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['Cdr'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file +var _0x723e=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','sendStatus','error','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Cdr','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch'];(function(_0x1ba9a4,_0x51aa43){var _0x28cb3b=function(_0x38e74a){while(--_0x38e74a){_0x1ba9a4['push'](_0x1ba9a4['shift']());}};_0x28cb3b(++_0x51aa43);}(_0x723e,0x179));var _0xe723=function(_0x362278,_0x4b766e){_0x362278=_0x362278-0x0;var _0xafd897=_0x723e[_0x362278];return _0xafd897;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe723('0x0'));var zipdir=require(_0xe723('0x1'));var jsonpatch=require(_0xe723('0x2'));var rp=require(_0xe723('0x3'));var moment=require(_0xe723('0x4'));var BPromise=require(_0xe723('0x5'));var Mustache=require(_0xe723('0x6'));var util=require(_0xe723('0x7'));var path=require(_0xe723('0x8'));var sox=require(_0xe723('0x9'));var csv=require('to-csv');var ejs=require(_0xe723('0xa'));var fs=require('fs');var fs_extra=require(_0xe723('0xb'));var _=require(_0xe723('0xc'));var squel=require(_0xe723('0xd'));var crypto=require(_0xe723('0xe'));var jsforce=require(_0xe723('0xf'));var deskjs=require(_0xe723('0x10'));var toCsv=require(_0xe723('0x11'));var querystring=require('querystring');var Papa=require(_0xe723('0x12'));var Redis=require(_0xe723('0x13'));var authService=require(_0xe723('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe723('0x15'));var hardwareService=require(_0xe723('0x16'));var logger=require(_0xe723('0x17'))('api');var utils=require(_0xe723('0x18'));var config=require(_0xe723('0x19'));var licenseUtil=require(_0xe723('0x1a'));var db=require(_0xe723('0x1b'))['db'];function respondWithStatusCode(_0x236b69,_0x5c066c){_0x5c066c=_0x5c066c||0xcc;return function(_0x29a1e){if(_0x29a1e){return _0x236b69['sendStatus'](_0x5c066c);}return _0x236b69['status'](_0x5c066c)['end']();};}function respondWithResult(_0x57bc0e,_0x75c12c){_0x75c12c=_0x75c12c||0xc8;return function(_0x30b2ba){if(_0x30b2ba){return _0x57bc0e[_0xe723('0x1c')](_0x75c12c)[_0xe723('0x1d')](_0x30b2ba);}};}function respondWithFilteredResult(_0xf29a39,_0x5aec97){return function(_0x23d0b2){if(_0x23d0b2){var _0xbf5ca3=typeof _0x5aec97[_0xe723('0x1e')]===_0xe723('0x1f')&&typeof _0x5aec97[_0xe723('0x20')]===_0xe723('0x1f');var _0x2cd7ca=_0x23d0b2[_0xe723('0x21')];var _0x17e2c1=_0xbf5ca3?0x0:_0x5aec97[_0xe723('0x1e')];var _0x2057d7=_0xbf5ca3?_0x23d0b2[_0xe723('0x21')]:_0x5aec97[_0xe723('0x1e')]+_0x5aec97[_0xe723('0x20')];var _0x5e8a90;if(_0x2057d7>=_0x2cd7ca){_0x2057d7=_0x2cd7ca;_0x5e8a90=0xc8;}else{_0x5e8a90=0xce;}_0xf29a39['status'](_0x5e8a90);return _0xf29a39[_0xe723('0x22')](_0xe723('0x23'),_0x17e2c1+'-'+_0x2057d7+'/'+_0x2cd7ca)['json'](_0x23d0b2);}return null;};}function patchUpdates(_0x28caca){return function(_0x2762e2){try{jsonpatch['apply'](_0x2762e2,_0x28caca,!![]);}catch(_0x472502){return BPromise['reject'](_0x472502);}return _0x2762e2[_0xe723('0x24')]();};}function saveUpdates(_0x43ccfc,_0x3b82b2){return function(_0x1fe43d){if(_0x1fe43d){return _0x1fe43d[_0xe723('0x25')](_0x43ccfc)[_0xe723('0x26')](function(_0x25f7d2){return _0x25f7d2;});}return null;};}function removeEntity(_0x15196c,_0x1228f2){return function(_0x19bd0c){if(_0x19bd0c){return _0x19bd0c[_0xe723('0x27')]()[_0xe723('0x26')](function(){_0x15196c['status'](0xcc)[_0xe723('0x28')]();});}};}function handleEntityNotFound(_0x59f095,_0xa258f3){return function(_0x3ffa15){if(!_0x3ffa15){_0x59f095[_0xe723('0x29')](0x194);}return _0x3ffa15;};}function handleError(_0xe7e271,_0x1f81ec){_0x1f81ec=_0x1f81ec||0x1f4;return function(_0x598f15){logger[_0xe723('0x2a')](_0x598f15['stack']);if(_0x598f15['name']){delete _0x598f15[_0xe723('0x2b')];}_0xe7e271['status'](_0x1f81ec)[_0xe723('0x2c')](_0x598f15);};}exports[_0xe723('0x2d')]=function(_0x335c66,_0x4d55cc){var _0x1edbb2={},_0x45e162={},_0x48a97a={'count':0x0,'rows':[]};var _0x3c8c56=_['map'](db['Cdr'][_0xe723('0x2e')],function(_0x2c2240){return{'name':_0x2c2240[_0xe723('0x2f')],'type':_0x2c2240[_0xe723('0x30')]['key']};});_0x45e162['model']=_[_0xe723('0x31')](_0x3c8c56,'name');_0x45e162[_0xe723('0x32')]=_[_0xe723('0x33')](_0x335c66[_0xe723('0x32')]);_0x45e162[_0xe723('0x34')]=_[_0xe723('0x35')](_0x45e162[_0xe723('0x36')],_0x45e162[_0xe723('0x32')]);_0x1edbb2[_0xe723('0x37')]=_[_0xe723('0x35')](_0x45e162[_0xe723('0x36')],qs[_0xe723('0x38')](_0x335c66[_0xe723('0x32')][_0xe723('0x38')]));_0x1edbb2[_0xe723('0x37')]=_0x1edbb2['attributes'][_0xe723('0x39')]?_0x1edbb2['attributes']:_0x45e162[_0xe723('0x36')];if(!_0x335c66[_0xe723('0x32')]['hasOwnProperty']('nolimit')){_0x1edbb2[_0xe723('0x20')]=qs[_0xe723('0x20')](_0x335c66[_0xe723('0x32')][_0xe723('0x20')]);_0x1edbb2[_0xe723('0x1e')]=qs[_0xe723('0x1e')](_0x335c66['query'][_0xe723('0x1e')]);}_0x1edbb2[_0xe723('0x3a')]=qs[_0xe723('0x3b')](_0x335c66[_0xe723('0x32')][_0xe723('0x3b')]);_0x1edbb2[_0xe723('0x3c')]=qs[_0xe723('0x34')](_[_0xe723('0x3d')](_0x335c66[_0xe723('0x32')],_0x45e162[_0xe723('0x34')]),_0x3c8c56);if(_0x335c66[_0xe723('0x32')][_0xe723('0x3e')]){_0x1edbb2[_0xe723('0x3c')]=_[_0xe723('0x3f')](_0x1edbb2[_0xe723('0x3c')],{'$or':_[_0xe723('0x31')](_0x3c8c56,function(_0x5c5027){if(_0x5c5027[_0xe723('0x30')]!==_0xe723('0x40')){var _0x68eda5={};_0x68eda5[_0x5c5027[_0xe723('0x2b')]]={'$like':'%'+_0x335c66['query']['filter']+'%'};return _0x68eda5;}})});}_0x1edbb2=_[_0xe723('0x3f')]({},_0x1edbb2,_0x335c66[_0xe723('0x41')]);var _0xc0c2c7={'where':_0x1edbb2[_0xe723('0x3c')]};return db['Cdr']['count'](_0xc0c2c7)[_0xe723('0x26')](function(_0x2f1618){_0x48a97a[_0xe723('0x21')]=_0x2f1618;if(_0x335c66[_0xe723('0x32')][_0xe723('0x42')]){_0x1edbb2[_0xe723('0x43')]=[{'all':!![]}];}return db[_0xe723('0x44')][_0xe723('0x45')](_0x1edbb2);})[_0xe723('0x26')](function(_0x5b0c89){_0x48a97a['rows']=_0x5b0c89;return _0x48a97a;})[_0xe723('0x26')](respondWithFilteredResult(_0x4d55cc,_0x1edbb2))['catch'](handleError(_0x4d55cc,null));};exports['show']=function(_0x18f4a1,_0x55530b){var _0x36272={'raw':!![],'where':{'id':_0x18f4a1[_0xe723('0x46')]['id']}},_0x42bd2f={};_0x42bd2f[_0xe723('0x36')]=_[_0xe723('0x33')](db[_0xe723('0x44')][_0xe723('0x2e')]);_0x42bd2f['query']=_['keys'](_0x18f4a1[_0xe723('0x32')]);_0x42bd2f['filters']=_[_0xe723('0x35')](_0x42bd2f['model'],_0x42bd2f[_0xe723('0x32')]);_0x36272[_0xe723('0x37')]=_[_0xe723('0x35')](_0x42bd2f[_0xe723('0x36')],qs[_0xe723('0x38')](_0x18f4a1[_0xe723('0x32')][_0xe723('0x38')]));_0x36272[_0xe723('0x37')]=_0x36272[_0xe723('0x37')]['length']?_0x36272['attributes']:_0x42bd2f[_0xe723('0x36')];if(_0x18f4a1[_0xe723('0x32')][_0xe723('0x42')]){_0x36272['include']=[{'all':!![]}];}_0x36272=_['merge']({},_0x36272,_0x18f4a1['options']);return db[_0xe723('0x44')][_0xe723('0x47')](_0x36272)[_0xe723('0x26')](handleEntityNotFound(_0x55530b,null))['then'](respondWithResult(_0x55530b,null))[_0xe723('0x48')](handleError(_0x55530b,null));};exports[_0xe723('0x49')]=function(_0x1cb2b2,_0x38bd1a){return db[_0xe723('0x44')]['create'](_0x1cb2b2[_0xe723('0x4a')],{})['then'](respondWithResult(_0x38bd1a,0xc9))[_0xe723('0x48')](handleError(_0x38bd1a,null));};exports['update']=function(_0x52f42e,_0x1590fe){if(_0x52f42e[_0xe723('0x4a')]['id']){delete _0x52f42e[_0xe723('0x4a')]['id'];}return db['Cdr'][_0xe723('0x47')]({'where':{'id':_0x52f42e['params']['id']}})[_0xe723('0x26')](handleEntityNotFound(_0x1590fe,null))[_0xe723('0x26')](saveUpdates(_0x52f42e[_0xe723('0x4a')],null))[_0xe723('0x26')](respondWithResult(_0x1590fe,null))[_0xe723('0x48')](handleError(_0x1590fe,null));};exports[_0xe723('0x27')]=function(_0x41e1c4,_0x16cb50){return db[_0xe723('0x44')]['find']({'where':{'id':_0x41e1c4[_0xe723('0x46')]['id']}})[_0xe723('0x26')](handleEntityNotFound(_0x16cb50,null))['then'](removeEntity(_0x16cb50,null))[_0xe723('0x48')](handleError(_0x16cb50,null));};exports[_0xe723('0x4b')]=function(_0x56e92a,_0x126ca5){return db['Cdr']['describe']()[_0xe723('0x26')](respondWithResult(_0x126ca5,null))[_0xe723('0x48')](handleError(_0x126ca5,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 40275b0..02444a1 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x82954d,_0x40c8cb){var _0x4c73ef=function(_0x579ef7){while(--_0x579ef7){_0x82954d['push'](_0x82954d['shift']());}};_0x4c73ef(++_0x40c8cb);}(_0x7a54,0x106));var _0x47a5=function(_0x55ed39,_0x2e1e4a){_0x55ed39=_0x55ed39-0x0;var _0x23464c=_0x7a54[_0x55ed39];return _0x23464c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x6056a2,_0x156835){var _0x39b066=function(_0x37fe47){while(--_0x37fe47){_0x6056a2['push'](_0x6056a2['shift']());}};_0x39b066(++_0x156835);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 5f3b202..fcdc35b 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 _0x2c82=['Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x180a37,_0x109f8b){var _0x49ec7d=function(_0xe1192f){while(--_0xe1192f){_0x180a37['push'](_0x180a37['shift']());}};_0x49ec7d(++_0x109f8b);}(_0x2c82,0xb0));var _0x22c8=function(_0x154940,_0x4a448a){_0x154940=_0x154940-0x0;var _0x401409=_0x2c82[_0x154940];return _0x401409;};'use strict';var _=require(_0x22c8('0x0'));var util=require(_0x22c8('0x1'));var moment=require('moment');var BPromise=require(_0x22c8('0x2'));var rs=require(_0x22c8('0x3'));var fs=require('fs');var Redis=require(_0x22c8('0x4'));var db=require(_0x22c8('0x5'))['db'];var utils=require(_0x22c8('0x6'));var logger=require(_0x22c8('0x7'))(_0x22c8('0x8'));var config=require(_0x22c8('0x9'));var jayson=require(_0x22c8('0xa'));var client=jayson[_0x22c8('0xb')][_0x22c8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x181015,_0x34a6b9,_0x322ea9){return new BPromise(function(_0x320b16,_0x38a7c4){return client[_0x22c8('0xd')](_0x181015,_0x322ea9)[_0x22c8('0xe')](function(_0x44f03f){logger[_0x22c8('0xf')](_0x22c8('0x10'),_0x34a6b9,'request\x20sent');logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x34a6b9,_0x22c8('0x11'),JSON[_0x22c8('0x12')](_0x44f03f));if(_0x44f03f[_0x22c8('0x13')]){if(_0x44f03f[_0x22c8('0x13')][_0x22c8('0x14')]===0x1f4){logger[_0x22c8('0x13')](_0x22c8('0x10'),_0x34a6b9,_0x44f03f[_0x22c8('0x13')]['message']);return _0x38a7c4(_0x44f03f[_0x22c8('0x13')][_0x22c8('0x15')]);}logger[_0x22c8('0x13')](_0x22c8('0x10'),_0x34a6b9,_0x44f03f[_0x22c8('0x13')][_0x22c8('0x15')]);return _0x320b16(_0x44f03f[_0x22c8('0x13')]['message']);}else{logger['info'](_0x22c8('0x10'),_0x34a6b9,_0x22c8('0x11'));_0x320b16(_0x44f03f[_0x22c8('0x16')][_0x22c8('0x15')]);}})[_0x22c8('0x17')](function(_0x30884b){logger[_0x22c8('0x13')](_0x22c8('0x10'),_0x34a6b9,_0x30884b);_0x38a7c4(_0x30884b);});});} \ No newline at end of file +var _0x7263=['request','then','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x1ad7d3,_0x187a4c){var _0x490430=function(_0x50dc2b){while(--_0x50dc2b){_0x1ad7d3['push'](_0x1ad7d3['shift']());}};_0x490430(++_0x187a4c);}(_0x7263,0x15b));var _0x3726=function(_0xd02eac,_0x1e2933){_0xd02eac=_0xd02eac-0x0;var _0x113bfe=_0x7263[_0xd02eac];return _0x113bfe;};'use strict';var _=require(_0x3726('0x0'));var util=require(_0x3726('0x1'));var moment=require(_0x3726('0x2'));var BPromise=require(_0x3726('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3726('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3726('0x5'));var logger=require(_0x3726('0x6'))('rpc');var config=require(_0x3726('0x7'));var jayson=require(_0x3726('0x8'));var client=jayson['client'][_0x3726('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x369f0b,_0x2aedfd,_0x32cd7e){return new BPromise(function(_0x377407,_0x45e0f2){return client[_0x3726('0xa')](_0x369f0b,_0x32cd7e)[_0x3726('0xb')](function(_0x460685){logger['info'](_0x3726('0xc'),_0x2aedfd,_0x3726('0xd'));logger['debug'](_0x3726('0xe'),_0x2aedfd,_0x3726('0xd'),JSON[_0x3726('0xf')](_0x460685));if(_0x460685[_0x3726('0x10')]){if(_0x460685[_0x3726('0x10')][_0x3726('0x11')]===0x1f4){logger[_0x3726('0x10')]('Cdr,\x20%s,\x20%s',_0x2aedfd,_0x460685[_0x3726('0x10')][_0x3726('0x12')]);return _0x45e0f2(_0x460685['error'][_0x3726('0x12')]);}logger['error'](_0x3726('0xc'),_0x2aedfd,_0x460685[_0x3726('0x10')]['message']);return _0x377407(_0x460685[_0x3726('0x10')][_0x3726('0x12')]);}else{logger[_0x3726('0x13')](_0x3726('0xc'),_0x2aedfd,'request\x20sent');_0x377407(_0x460685[_0x3726('0x14')][_0x3726('0x12')]);}})['catch'](function(_0x3b2a2f){logger[_0x3726('0x10')](_0x3726('0xc'),_0x2aedfd,_0x3b2a2f);_0x45e0f2(_0x3b2a2f);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index bc30d94..64ebdf5 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x235f49,_0x2992b4){var _0x551139=function(_0x35565c){while(--_0x35565c){_0x235f49['push'](_0x235f49['shift']());}};_0x551139(++_0x2992b4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2e10e4,_0x262e36){var _0x4bdb80=function(_0x2ddcd9){while(--_0x2ddcd9){_0x2e10e4['push'](_0x2e10e4['shift']());}};_0x4bdb80(++_0x262e36);}(_0xb10b,0x12a));var _0xbb10=function(_0x42f3a6,_0x45285c){_0x42f3a6=_0x42f3a6-0x0;var _0xdf3c33=_0xb10b[_0x42f3a6];return _0xdf3c33;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 9dd1730..3cce970 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 _0x32f3=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x171e4d,_0x4f2493){var _0x2d2bf4=function(_0x3a74cc){while(--_0x3a74cc){_0x171e4d['push'](_0x171e4d['shift']());}};_0x2d2bf4(++_0x4f2493);}(_0x32f3,0x1b4));var _0x332f=function(_0x3a5bb4,_0x45dd2f){_0x3a5bb4=_0x3a5bb4-0x0;var _0x1affda=_0x32f3[_0x3a5bb4];return _0x1affda;};'use strict';var Sequelize=require(_0x332f('0x0'));module[_0x332f('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x332f('0x2')],'allowNull':![],'defaultValue':_0x332f('0x3')},'appdata':{'type':Sequelize[_0x332f('0x4')]()},'description':{'type':Sequelize[_0x332f('0x2')]},'interval':{'type':Sequelize[_0x332f('0x2')],'defaultValue':_0x332f('0x5')}}; \ No newline at end of file +var _0x724e=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x724e,0x8c));var _0xe724=function(_0x28bbb9,_0x319419){_0x28bbb9=_0x28bbb9-0x0;var _0x104c01=_0x724e[_0x28bbb9];return _0x104c01;};'use strict';var Sequelize=require(_0xe724('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe724('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe724('0x2')],'allowNull':![],'defaultValue':_0xe724('0x3')},'appdata':{'type':Sequelize[_0xe724('0x4')]()},'description':{'type':Sequelize[_0xe724('0x2')]},'interval':{'type':Sequelize[_0xe724('0x2')],'defaultValue':_0xe724('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 7d231de..130772e 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 _0x9ffd=['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','params','model','keys','ChatApplication','rawAttributes','filters','intersection','attributes','fields','length','query','includeAll','include','merge','options','find','catch','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x430f44,_0x4ae21b){var _0x1f6b0f=function(_0x35968f){while(--_0x35968f){_0x430f44['push'](_0x430f44['shift']());}};_0x1f6b0f(++_0x4ae21b);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5b59e0,_0x11a79e){_0x5b59e0=_0x5b59e0-0x0;var _0x1c205a=_0x9ffd[_0x5b59e0];return _0x1c205a;};'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['show']=function(_0x1d3684,_0x3792d9){var _0x44b5a7={'raw':!![],'where':{'id':_0x1d3684[_0xd9ff('0x29')]['id']}},_0x45fb63={};_0x45fb63[_0xd9ff('0x2a')]=_[_0xd9ff('0x2b')](db[_0xd9ff('0x2c')][_0xd9ff('0x2d')]);_0x45fb63['query']=_[_0xd9ff('0x2b')](_0x1d3684['query']);_0x45fb63[_0xd9ff('0x2e')]=_[_0xd9ff('0x2f')](_0x45fb63[_0xd9ff('0x2a')],_0x45fb63['query']);_0x44b5a7[_0xd9ff('0x30')]=_[_0xd9ff('0x2f')](_0x45fb63[_0xd9ff('0x2a')],qs[_0xd9ff('0x31')](_0x1d3684['query'][_0xd9ff('0x31')]));_0x44b5a7['attributes']=_0x44b5a7[_0xd9ff('0x30')][_0xd9ff('0x32')]?_0x44b5a7[_0xd9ff('0x30')]:_0x45fb63[_0xd9ff('0x2a')];if(_0x1d3684[_0xd9ff('0x33')][_0xd9ff('0x34')]){_0x44b5a7[_0xd9ff('0x35')]=[{'all':!![]}];}_0x44b5a7=_[_0xd9ff('0x36')]({},_0x44b5a7,_0x1d3684[_0xd9ff('0x37')]);return db[_0xd9ff('0x2c')][_0xd9ff('0x38')](_0x44b5a7)[_0xd9ff('0x25')](handleEntityNotFound(_0x3792d9,null))[_0xd9ff('0x25')](respondWithResult(_0x3792d9,null))[_0xd9ff('0x39')](handleError(_0x3792d9,null));};exports['update']=function(_0x13322f,_0x1ef7c3){if(_0x13322f[_0xd9ff('0x3a')]['id']){delete _0x13322f['body']['id'];}return db[_0xd9ff('0x2c')]['find']({'where':{'id':_0x13322f[_0xd9ff('0x29')]['id']}})['then'](handleEntityNotFound(_0x1ef7c3,null))[_0xd9ff('0x25')](saveUpdates(_0x13322f['body'],null))[_0xd9ff('0x25')](respondWithResult(_0x1ef7c3,null))[_0xd9ff('0x39')](handleError(_0x1ef7c3,null));};exports[_0xd9ff('0x3b')]=function(_0x5e2391,_0x4db3f6){return db['ChatApplication'][_0xd9ff('0x38')]({'where':{'id':_0x5e2391[_0xd9ff('0x29')]['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x4db3f6,null))[_0xd9ff('0x25')](removeEntity(_0x4db3f6,null))[_0xd9ff('0x39')](handleError(_0x4db3f6,null));}; \ No newline at end of file +var _0xc577=['../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','then','destroy','end','sendStatus','error','name','send','params','model','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','catch','update','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xc577,0x172));var _0x7c57=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0xc577[_0x67f95e];return _0x538f5a;};'use strict';var emlformat=require(_0x7c57('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c57('0x1'));var rp=require(_0x7c57('0x2'));var moment=require(_0x7c57('0x3'));var BPromise=require(_0x7c57('0x4'));var Mustache=require(_0x7c57('0x5'));var util=require(_0x7c57('0x6'));var path=require(_0x7c57('0x7'));var sox=require('sox');var csv=require(_0x7c57('0x8'));var ejs=require(_0x7c57('0x9'));var fs=require('fs');var fs_extra=require(_0x7c57('0xa'));var _=require(_0x7c57('0xb'));var squel=require(_0x7c57('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7c57('0x8'));var querystring=require('querystring');var Papa=require(_0x7c57('0xd'));var Redis=require(_0x7c57('0xe'));var authService=require(_0x7c57('0xf'));var qs=require(_0x7c57('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c57('0x11'));var logger=require(_0x7c57('0x12'))('api');var utils=require(_0x7c57('0x13'));var config=require(_0x7c57('0x14'));var licenseUtil=require(_0x7c57('0x15'));var db=require(_0x7c57('0x16'))['db'];function respondWithStatusCode(_0xbd2172,_0x10a675){_0x10a675=_0x10a675||0xcc;return function(_0x296cef){if(_0x296cef){return _0xbd2172['sendStatus'](_0x10a675);}return _0xbd2172['status'](_0x10a675)['end']();};}function respondWithResult(_0x46cae6,_0x373a4b){_0x373a4b=_0x373a4b||0xc8;return function(_0x4c5af2){if(_0x4c5af2){return _0x46cae6[_0x7c57('0x17')](_0x373a4b)[_0x7c57('0x18')](_0x4c5af2);}};}function respondWithFilteredResult(_0x11903b,_0x1ba2d0){return function(_0x14ce67){if(_0x14ce67){var _0x517d8a=typeof _0x1ba2d0['offset']===_0x7c57('0x19')&&typeof _0x1ba2d0[_0x7c57('0x1a')]===_0x7c57('0x19');var _0x3c40d3=_0x14ce67[_0x7c57('0x1b')];var _0x48cf4f=_0x517d8a?0x0:_0x1ba2d0[_0x7c57('0x1c')];var _0x30f5b1=_0x517d8a?_0x14ce67[_0x7c57('0x1b')]:_0x1ba2d0[_0x7c57('0x1c')]+_0x1ba2d0[_0x7c57('0x1a')];var _0x3e2dc0;if(_0x30f5b1>=_0x3c40d3){_0x30f5b1=_0x3c40d3;_0x3e2dc0=0xc8;}else{_0x3e2dc0=0xce;}_0x11903b[_0x7c57('0x17')](_0x3e2dc0);return _0x11903b[_0x7c57('0x1d')](_0x7c57('0x1e'),_0x48cf4f+'-'+_0x30f5b1+'/'+_0x3c40d3)['json'](_0x14ce67);}return null;};}function patchUpdates(_0x45221e){return function(_0x3472b8){try{jsonpatch[_0x7c57('0x1f')](_0x3472b8,_0x45221e,!![]);}catch(_0x373b5b){return BPromise['reject'](_0x373b5b);}return _0x3472b8['save']();};}function saveUpdates(_0x4c4140,_0x140376){return function(_0x368bb6){if(_0x368bb6){return _0x368bb6['update'](_0x4c4140)[_0x7c57('0x20')](function(_0x13f696){return _0x13f696;});}return null;};}function removeEntity(_0x260d58,_0xfb0f2e){return function(_0x4734de){if(_0x4734de){return _0x4734de[_0x7c57('0x21')]()[_0x7c57('0x20')](function(){_0x260d58['status'](0xcc)[_0x7c57('0x22')]();});}};}function handleEntityNotFound(_0x3232f8,_0x16a517){return function(_0x1641f1){if(!_0x1641f1){_0x3232f8[_0x7c57('0x23')](0x194);}return _0x1641f1;};}function handleError(_0x984924,_0x41125b){_0x41125b=_0x41125b||0x1f4;return function(_0x1219f2){logger[_0x7c57('0x24')](_0x1219f2['stack']);if(_0x1219f2['name']){delete _0x1219f2[_0x7c57('0x25')];}_0x984924[_0x7c57('0x17')](_0x41125b)[_0x7c57('0x26')](_0x1219f2);};}exports['show']=function(_0x9b9d1f,_0x59ae2f){var _0x5acc20={'raw':!![],'where':{'id':_0x9b9d1f[_0x7c57('0x27')]['id']}},_0x5ad979={};_0x5ad979[_0x7c57('0x28')]=_['keys'](db[_0x7c57('0x29')][_0x7c57('0x2a')]);_0x5ad979[_0x7c57('0x2b')]=_['keys'](_0x9b9d1f[_0x7c57('0x2b')]);_0x5ad979[_0x7c57('0x2c')]=_[_0x7c57('0x2d')](_0x5ad979['model'],_0x5ad979[_0x7c57('0x2b')]);_0x5acc20[_0x7c57('0x2e')]=_[_0x7c57('0x2d')](_0x5ad979[_0x7c57('0x28')],qs[_0x7c57('0x2f')](_0x9b9d1f[_0x7c57('0x2b')][_0x7c57('0x2f')]));_0x5acc20[_0x7c57('0x2e')]=_0x5acc20[_0x7c57('0x2e')][_0x7c57('0x30')]?_0x5acc20['attributes']:_0x5ad979[_0x7c57('0x28')];if(_0x9b9d1f[_0x7c57('0x2b')]['includeAll']){_0x5acc20[_0x7c57('0x31')]=[{'all':!![]}];}_0x5acc20=_[_0x7c57('0x32')]({},_0x5acc20,_0x9b9d1f[_0x7c57('0x33')]);return db['ChatApplication'][_0x7c57('0x34')](_0x5acc20)[_0x7c57('0x20')](handleEntityNotFound(_0x59ae2f,null))['then'](respondWithResult(_0x59ae2f,null))[_0x7c57('0x35')](handleError(_0x59ae2f,null));};exports[_0x7c57('0x36')]=function(_0x5e8068,_0x170d19){if(_0x5e8068[_0x7c57('0x37')]['id']){delete _0x5e8068[_0x7c57('0x37')]['id'];}return db[_0x7c57('0x29')]['find']({'where':{'id':_0x5e8068[_0x7c57('0x27')]['id']}})['then'](handleEntityNotFound(_0x170d19,null))['then'](saveUpdates(_0x5e8068[_0x7c57('0x37')],null))[_0x7c57('0x20')](respondWithResult(_0x170d19,null))[_0x7c57('0x35')](handleError(_0x170d19,null));};exports[_0x7c57('0x21')]=function(_0x493381,_0x2aebec){return db[_0x7c57('0x29')][_0x7c57('0x34')]({'where':{'id':_0x493381[_0x7c57('0x27')]['id']}})[_0x7c57('0x20')](handleEntityNotFound(_0x2aebec,null))[_0x7c57('0x20')](removeEntity(_0x2aebec,null))[_0x7c57('0x35')](handleError(_0x2aebec,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index e666b2e..c531097 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 _0x4627=['define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x197981,_0x19bb00){var _0x14f113=function(_0x552a36){while(--_0x552a36){_0x197981['push'](_0x197981['shift']());}};_0x14f113(++_0x19bb00);}(_0x4627,0x115));var _0x7462=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x4627[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x7462('0x0'));var util=require(_0x7462('0x1'));var logger=require(_0x7462('0x2'))(_0x7462('0x3'));var moment=require(_0x7462('0x4'));var BPromise=require(_0x7462('0x5'));var rp=require(_0x7462('0x6'));var fs=require('fs');var path=require(_0x7462('0x7'));var rimraf=require(_0x7462('0x8'));var config=require(_0x7462('0x9'));var attributes=require(_0x7462('0xa'));module[_0x7462('0xb')]=function(_0x363d98,_0x54bd2e){return _0x363d98[_0x7462('0xc')](_0x7462('0xd'),attributes,{'tableName':_0x7462('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7462('0xf'),'collate':_0x7462('0x10')});}; \ No newline at end of file +var _0x4ddd=['path','rimraf','../../config/environment','exports','define','ChatApplication','chat_applications','utf8mb4','lodash'];(function(_0x2fd743,_0x4f01ad){var _0x3eebfc=function(_0x40b500){while(--_0x40b500){_0x2fd743['push'](_0x2fd743['shift']());}};_0x3eebfc(++_0x4f01ad);}(_0x4ddd,0x18b));var _0xd4dd=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x4ddd[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0xd4dd('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd4dd('0x1'));var rimraf=require(_0xd4dd('0x2'));var config=require(_0xd4dd('0x3'));var attributes=require('./chatApplication.attributes');module[_0xd4dd('0x4')]=function(_0x207f91,_0x2796e1){return _0x207f91[_0xd4dd('0x5')](_0xd4dd('0x6'),attributes,{'tableName':_0xd4dd('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd4dd('0x8'),'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 9cd89fa..d3db3eb 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 _0x1965=['stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3ce360,_0x110130){var _0x24336c=function(_0x36dbd2){while(--_0x36dbd2){_0x3ce360['push'](_0x3ce360['shift']());}};_0x24336c(++_0x110130);}(_0x1965,0x1e7));var _0x5196=function(_0x527379,_0x3ec58d){_0x527379=_0x527379-0x0;var _0x219af0=_0x1965[_0x527379];return _0x219af0;};'use strict';var _=require(_0x5196('0x0'));var util=require('util');var moment=require(_0x5196('0x1'));var BPromise=require(_0x5196('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5196('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5196('0x4'))(_0x5196('0x5'));var config=require('../../config/environment');var jayson=require(_0x5196('0x6'));var client=jayson['client'][_0x5196('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x403469,_0x2ecc83,_0x5e5a78){return new BPromise(function(_0x48b652,_0x9f4e5a){return client[_0x5196('0x8')](_0x403469,_0x5e5a78)[_0x5196('0x9')](function(_0x342674){logger[_0x5196('0xa')]('ChatApplication,\x20%s,\x20%s',_0x2ecc83,'request\x20sent');logger['debug'](_0x5196('0xb'),_0x2ecc83,_0x5196('0xc'),JSON[_0x5196('0xd')](_0x342674));if(_0x342674[_0x5196('0xe')]){if(_0x342674[_0x5196('0xe')][_0x5196('0xf')]===0x1f4){logger[_0x5196('0xe')](_0x5196('0x10'),_0x2ecc83,_0x342674['error'][_0x5196('0x11')]);return _0x9f4e5a(_0x342674[_0x5196('0xe')][_0x5196('0x11')]);}logger[_0x5196('0xe')](_0x5196('0x10'),_0x2ecc83,_0x342674[_0x5196('0xe')][_0x5196('0x11')]);return _0x48b652(_0x342674['error'][_0x5196('0x11')]);}else{logger[_0x5196('0xa')](_0x5196('0x10'),_0x2ecc83,_0x5196('0xc'));_0x48b652(_0x342674[_0x5196('0x12')]['message']);}})[_0x5196('0x13')](function(_0x515559){logger[_0x5196('0xe')](_0x5196('0x10'),_0x2ecc83,_0x515559);_0x9f4e5a(_0x515559);});});} \ No newline at end of file +var _0x3508=['../../config/logger','rpc','jayson/promise','client','request','then','ChatApplication,\x20%s,\x20%s','error','code','message','request\x20sent','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x55d260,_0x339f31){var _0x1ec8b4=function(_0x54c556){while(--_0x54c556){_0x55d260['push'](_0x55d260['shift']());}};_0x1ec8b4(++_0x339f31);}(_0x3508,0x1ce));var _0x8350=function(_0x294a4f,_0x2f1d1f){_0x294a4f=_0x294a4f-0x0;var _0x7da50f=_0x3508[_0x294a4f];return _0x7da50f;};'use strict';var _=require(_0x8350('0x0'));var util=require(_0x8350('0x1'));var moment=require('moment');var BPromise=require(_0x8350('0x2'));var rs=require(_0x8350('0x3'));var fs=require('fs');var Redis=require(_0x8350('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8350('0x5'));var logger=require(_0x8350('0x6'))(_0x8350('0x7'));var config=require('../../config/environment');var jayson=require(_0x8350('0x8'));var client=jayson[_0x8350('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f1d0a,_0x16cea4,_0x529fd3){return new BPromise(function(_0x5aec5c,_0x184d0d){return client[_0x8350('0xa')](_0x1f1d0a,_0x529fd3)[_0x8350('0xb')](function(_0x51896a){logger['info'](_0x8350('0xc'),_0x16cea4,'request\x20sent');logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x16cea4,'request\x20sent',JSON['stringify'](_0x51896a));if(_0x51896a[_0x8350('0xd')]){if(_0x51896a[_0x8350('0xd')][_0x8350('0xe')]===0x1f4){logger['error'](_0x8350('0xc'),_0x16cea4,_0x51896a[_0x8350('0xd')][_0x8350('0xf')]);return _0x184d0d(_0x51896a[_0x8350('0xd')][_0x8350('0xf')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x16cea4,_0x51896a[_0x8350('0xd')][_0x8350('0xf')]);return _0x5aec5c(_0x51896a[_0x8350('0xd')][_0x8350('0xf')]);}else{logger['info'](_0x8350('0xc'),_0x16cea4,_0x8350('0x10'));_0x5aec5c(_0x51896a[_0x8350('0x11')][_0x8350('0xf')]);}})['catch'](function(_0x557a44){logger[_0x8350('0xd')](_0x8350('0xc'),_0x16cea4,_0x557a44);_0x184d0d(_0x557a44);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 41a142b..68c701d 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 _0x06e1=['util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','isAuthenticated','show','put','update','delete','/:id','destroy','exports'];(function(_0x5b8af9,_0x2c3a89){var _0x4fbdc6=function(_0x1e860a){while(--_0x1e860a){_0x5b8af9['push'](_0x5b8af9['shift']());}};_0x4fbdc6(++_0x2c3a89);}(_0x06e1,0x177));var _0x106e=function(_0x26e60e,_0x46cef3){_0x26e60e=_0x26e60e-0x0;var _0x47a271=_0x06e1[_0x26e60e];return _0x47a271;};'use strict';var multer=require('multer');var util=require(_0x106e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x106e('0x1'));var router=express[_0x106e('0x2')]();var fs_extra=require(_0x106e('0x3'));var auth=require(_0x106e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x106e('0x5'));var controller=require(_0x106e('0x6'));router['get']('/:id',auth[_0x106e('0x7')](),controller[_0x106e('0x8')]);router[_0x106e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x106e('0xa')]);router[_0x106e('0xb')](_0x106e('0xc'),auth['isAuthenticated'](),controller[_0x106e('0xd')]);module[_0x106e('0xe')]=router; \ No newline at end of file +var _0xa710=['delete','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','update'];(function(_0x25b4cb,_0x45ad64){var _0x4e1e24=function(_0x25576a){while(--_0x25576a){_0x25b4cb['push'](_0x25b4cb['shift']());}};_0x4e1e24(++_0x45ad64);}(_0xa710,0x1f0));var _0x0a71=function(_0x36587e,_0x4fdd5e){_0x36587e=_0x36587e-0x0;var _0x73e98d=_0xa710[_0x36587e];return _0x73e98d;};'use strict';var multer=require(_0x0a71('0x0'));var util=require(_0x0a71('0x1'));var path=require('path');var timeout=require(_0x0a71('0x2'));var express=require(_0x0a71('0x3'));var router=express['Router']();var fs_extra=require(_0x0a71('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a71('0x5'));var config=require(_0x0a71('0x6'));var controller=require('./chatApplication.controller');router['get'](_0x0a71('0x7'),auth[_0x0a71('0x8')](),controller['show']);router['put'](_0x0a71('0x7'),auth[_0x0a71('0x8')](),controller[_0x0a71('0x9')]);router[_0x0a71('0xa')]('/:id',auth[_0x0a71('0x8')](),controller['destroy']);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 683f102..730f4e5 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 _0x74f7=['BOOLEAN','STRING'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0x74f7,0xbd));var _0x774f=function(_0x50781e,_0x1cf063){_0x50781e=_0x50781e-0x0;var _0x90f2f7=_0x74f7[_0x50781e];return _0x90f2f7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x774f('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x774f('0x0')]},'write':{'type':Sequelize[_0x774f('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb43c=['STRING','BOOLEAN','sequelize','exports'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xb43c,0x1ea));var _0xcb43=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb43c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xcb43('0x0'));module[_0xcb43('0x1')]={'name':{'type':Sequelize[_0xcb43('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xcb43('0x2')]},'write':{'type':Sequelize[_0xcb43('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 adffcce..004e9a4 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 _0x3c3e=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','ChatGroup','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','find','create','body','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','findOne','User','getMembers','nolimit','removeMembers','ids','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3c3e,0xbb));var _0xe3c3=function(_0x12c8b4,_0x502eb8){_0x12c8b4=_0x12c8b4-0x0;var _0x1f3756=_0x3c3e[_0x12c8b4];return _0x1f3756;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe3c3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe3c3('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe3c3('0x2'));var Mustache=require(_0xe3c3('0x3'));var util=require(_0xe3c3('0x4'));var path=require(_0xe3c3('0x5'));var sox=require('sox');var csv=require(_0xe3c3('0x6'));var ejs=require(_0xe3c3('0x7'));var fs=require('fs');var fs_extra=require(_0xe3c3('0x8'));var _=require(_0xe3c3('0x9'));var squel=require(_0xe3c3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe3c3('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe3c3('0xc'));var Papa=require(_0xe3c3('0xd'));var Redis=require('ioredis');var authService=require(_0xe3c3('0xe'));var qs=require(_0xe3c3('0xf'));var as=require(_0xe3c3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe3c3('0x11'))(_0xe3c3('0x12'));var utils=require(_0xe3c3('0x13'));var config=require(_0xe3c3('0x14'));var licenseUtil=require(_0xe3c3('0x15'));var db=require(_0xe3c3('0x16'))['db'];config[_0xe3c3('0x17')]=_[_0xe3c3('0x18')](config[_0xe3c3('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xe3c3('0x19'))(new Redis(config[_0xe3c3('0x17')]));require(_0xe3c3('0x1a'))[_0xe3c3('0x1b')](socket);function respondWithStatusCode(_0xae40cd,_0x3c4bf7){_0x3c4bf7=_0x3c4bf7||0xcc;return function(_0x48f7b0){if(_0x48f7b0){return _0xae40cd[_0xe3c3('0x1c')](_0x3c4bf7);}return _0xae40cd['status'](_0x3c4bf7)['end']();};}function respondWithResult(_0x51600f,_0x245bcb){_0x245bcb=_0x245bcb||0xc8;return function(_0x5bfb2){if(_0x5bfb2){return _0x51600f[_0xe3c3('0x1d')](_0x245bcb)[_0xe3c3('0x1e')](_0x5bfb2);}};}function respondWithFilteredResult(_0xc6c6af,_0x13586e){return function(_0xeed6c3){if(_0xeed6c3){var _0x19f0de=typeof _0x13586e[_0xe3c3('0x1f')]===_0xe3c3('0x20')&&typeof _0x13586e[_0xe3c3('0x21')]===_0xe3c3('0x20');var _0x3c0e01=_0xeed6c3['count'];var _0x3a2fc6=_0x19f0de?0x0:_0x13586e['offset'];var _0x20f1ff=_0x19f0de?_0xeed6c3[_0xe3c3('0x22')]:_0x13586e['offset']+_0x13586e['limit'];var _0x29174b;if(_0x20f1ff>=_0x3c0e01){_0x20f1ff=_0x3c0e01;_0x29174b=0xc8;}else{_0x29174b=0xce;}_0xc6c6af[_0xe3c3('0x1d')](_0x29174b);return _0xc6c6af[_0xe3c3('0x23')](_0xe3c3('0x24'),_0x3a2fc6+'-'+_0x20f1ff+'/'+_0x3c0e01)[_0xe3c3('0x1e')](_0xeed6c3);}return null;};}function patchUpdates(_0x540f09){return function(_0x3642a4){try{jsonpatch[_0xe3c3('0x25')](_0x3642a4,_0x540f09,!![]);}catch(_0x335bc4){return BPromise[_0xe3c3('0x26')](_0x335bc4);}return _0x3642a4[_0xe3c3('0x27')]();};}function saveUpdates(_0x527a6f,_0x23d420){return function(_0x125720){if(_0x125720){return _0x125720[_0xe3c3('0x28')](_0x527a6f)[_0xe3c3('0x29')](function(_0x1cafbe){return _0x1cafbe;});}return null;};}function removeEntity(_0xf72440,_0x523248){return function(_0x46b93e){if(_0x46b93e){return _0x46b93e['destroy']()[_0xe3c3('0x29')](function(){_0xf72440[_0xe3c3('0x1d')](0xcc)[_0xe3c3('0x2a')]();});}};}function handleEntityNotFound(_0x55ede6,_0x16d7fe){return function(_0x5bb1b8){if(!_0x5bb1b8){_0x55ede6['sendStatus'](0x194);}return _0x5bb1b8;};}function handleError(_0x4fdc10,_0x614378){_0x614378=_0x614378||0x1f4;return function(_0x3dc083){logger[_0xe3c3('0x2b')](_0x3dc083[_0xe3c3('0x2c')]);if(_0x3dc083[_0xe3c3('0x2d')]){delete _0x3dc083[_0xe3c3('0x2d')];}_0x4fdc10['status'](_0x614378)[_0xe3c3('0x2e')](_0x3dc083);};}exports[_0xe3c3('0x2f')]=function(_0x3b9b2b,_0x1a550b){var _0x58f22e={},_0x488ba5={},_0x59ed1b={'count':0x0,'rows':[]};var _0x1b1dc0=_['map'](db['ChatGroup']['rawAttributes'],function(_0xaee1a3){return{'name':_0xaee1a3['fieldName'],'type':_0xaee1a3[_0xe3c3('0x30')][_0xe3c3('0x31')]};});_0x488ba5[_0xe3c3('0x32')]=_[_0xe3c3('0x33')](_0x1b1dc0,'name');_0x488ba5[_0xe3c3('0x34')]=_['keys'](_0x3b9b2b[_0xe3c3('0x34')]);_0x488ba5[_0xe3c3('0x35')]=_[_0xe3c3('0x36')](_0x488ba5[_0xe3c3('0x32')],_0x488ba5[_0xe3c3('0x34')]);_0x58f22e[_0xe3c3('0x37')]=_['intersection'](_0x488ba5[_0xe3c3('0x32')],qs[_0xe3c3('0x38')](_0x3b9b2b[_0xe3c3('0x34')]['fields']));_0x58f22e[_0xe3c3('0x37')]=_0x58f22e[_0xe3c3('0x37')][_0xe3c3('0x39')]?_0x58f22e['attributes']:_0x488ba5['model'];if(!_0x3b9b2b[_0xe3c3('0x34')][_0xe3c3('0x3a')]('nolimit')){_0x58f22e['limit']=qs[_0xe3c3('0x21')](_0x3b9b2b[_0xe3c3('0x34')][_0xe3c3('0x21')]);_0x58f22e['offset']=qs[_0xe3c3('0x1f')](_0x3b9b2b[_0xe3c3('0x34')]['offset']);}_0x58f22e[_0xe3c3('0x3b')]=qs[_0xe3c3('0x3c')](_0x3b9b2b['query'][_0xe3c3('0x3c')]);_0x58f22e[_0xe3c3('0x3d')]=qs['filters'](_[_0xe3c3('0x3e')](_0x3b9b2b['query'],_0x488ba5['filters']),_0x1b1dc0);if(_0x3b9b2b[_0xe3c3('0x34')]['filter']){_0x58f22e['where']=_[_0xe3c3('0x3f')](_0x58f22e[_0xe3c3('0x3d')],{'$or':_['map'](_0x1b1dc0,function(_0x5a013e){if(_0x5a013e[_0xe3c3('0x30')]!==_0xe3c3('0x40')){var _0x69bbf3={};_0x69bbf3[_0x5a013e['name']]={'$like':'%'+_0x3b9b2b[_0xe3c3('0x34')][_0xe3c3('0x41')]+'%'};return _0x69bbf3;}})});}_0x58f22e=_[_0xe3c3('0x3f')]({},_0x58f22e,_0x3b9b2b[_0xe3c3('0x42')]);var _0x4de1e8={'where':_0x58f22e[_0xe3c3('0x3d')]};return db[_0xe3c3('0x43')][_0xe3c3('0x22')](_0x4de1e8)[_0xe3c3('0x29')](function(_0x10961a){_0x59ed1b[_0xe3c3('0x22')]=_0x10961a;if(_0x3b9b2b[_0xe3c3('0x34')][_0xe3c3('0x44')]){_0x58f22e[_0xe3c3('0x45')]=[{'all':!![]}];}return db['ChatGroup'][_0xe3c3('0x46')](_0x58f22e);})[_0xe3c3('0x29')](function(_0x3e09bf){_0x59ed1b[_0xe3c3('0x47')]=_0x3e09bf;return _0x59ed1b;})[_0xe3c3('0x29')](respondWithFilteredResult(_0x1a550b,_0x58f22e))[_0xe3c3('0x48')](handleError(_0x1a550b,null));};exports[_0xe3c3('0x49')]=function(_0x4209d2,_0x200745){var _0x1d618a={'raw':!![],'where':{'id':_0x4209d2[_0xe3c3('0x4a')]['id']}},_0x116ec7={};_0x116ec7[_0xe3c3('0x32')]=_['keys'](db['ChatGroup'][_0xe3c3('0x4b')]);_0x116ec7['query']=_[_0xe3c3('0x4c')](_0x4209d2['query']);_0x116ec7[_0xe3c3('0x35')]=_[_0xe3c3('0x36')](_0x116ec7['model'],_0x116ec7[_0xe3c3('0x34')]);_0x1d618a[_0xe3c3('0x37')]=_[_0xe3c3('0x36')](_0x116ec7[_0xe3c3('0x32')],qs[_0xe3c3('0x38')](_0x4209d2[_0xe3c3('0x34')]['fields']));_0x1d618a[_0xe3c3('0x37')]=_0x1d618a[_0xe3c3('0x37')]['length']?_0x1d618a[_0xe3c3('0x37')]:_0x116ec7[_0xe3c3('0x32')];if(_0x4209d2['query'][_0xe3c3('0x44')]){_0x1d618a[_0xe3c3('0x45')]=[{'all':!![]}];}_0x1d618a=_['merge']({},_0x1d618a,_0x4209d2[_0xe3c3('0x42')]);return db['ChatGroup'][_0xe3c3('0x4d')](_0x1d618a)[_0xe3c3('0x29')](handleEntityNotFound(_0x200745,null))['then'](respondWithResult(_0x200745,null))[_0xe3c3('0x48')](handleError(_0x200745,null));};exports[_0xe3c3('0x4e')]=function(_0x5d36fe,_0x145f4a){return db[_0xe3c3('0x43')]['create'](_0x5d36fe[_0xe3c3('0x4f')],{})['then'](respondWithResult(_0x145f4a,0xc9))[_0xe3c3('0x48')](handleError(_0x145f4a,null));};exports[_0xe3c3('0x28')]=function(_0x301fbd,_0x318046){if(_0x301fbd[_0xe3c3('0x4f')]['id']){delete _0x301fbd['body']['id'];}return db[_0xe3c3('0x43')]['find']({'where':{'id':_0x301fbd[_0xe3c3('0x4a')]['id']}})[_0xe3c3('0x29')](handleEntityNotFound(_0x318046,null))['then'](saveUpdates(_0x301fbd[_0xe3c3('0x4f')],null))[_0xe3c3('0x29')](respondWithResult(_0x318046,null))[_0xe3c3('0x48')](handleError(_0x318046,null));};exports[_0xe3c3('0x50')]=function(_0x5a2f25,_0x438c7a){return db['ChatGroup'][_0xe3c3('0x4d')]({'where':{'id':_0x5a2f25[_0xe3c3('0x4a')]['id']}})[_0xe3c3('0x29')](handleEntityNotFound(_0x438c7a,null))[_0xe3c3('0x29')](removeEntity(_0x438c7a,null))['catch'](handleError(_0x438c7a,null));};exports['describe']=function(_0x2801ad,_0x328748){return db['ChatGroup'][_0xe3c3('0x51')]()['then'](respondWithResult(_0x328748,null))[_0xe3c3('0x48')](handleError(_0x328748,null));};exports[_0xe3c3('0x52')]=function(_0x1c431d,_0x4ca256,_0x264e27){return db[_0xe3c3('0x53')][_0xe3c3('0x22')]({'where':{'ChatGroupId':_0x1c431d[_0xe3c3('0x4a')]['id'],'ToId':_0x1c431d[_0xe3c3('0x54')]['id'],'read':![]}})[_0xe3c3('0x29')](function(_0x59355d){return{'id':_[_0xe3c3('0x55')](_0x1c431d['params']['id']),'count':_0x59355d};})[_0xe3c3('0x29')](respondWithResult(_0x4ca256,null))[_0xe3c3('0x48')](handleError(_0x4ca256,null));};exports[_0xe3c3('0x56')]=function(_0x2a7d67,_0x33e802,_0x157f1d){return db[_0xe3c3('0x43')][_0xe3c3('0x4d')]({'where':{'id':_0x2a7d67[_0xe3c3('0x4a')]['id']}})[_0xe3c3('0x29')](handleEntityNotFound(_0x33e802,null))[_0xe3c3('0x29')](function(_0x1f479d){if(_0x1f479d){return _0x1f479d[_0xe3c3('0x56')](_0x2a7d67[_0xe3c3('0x4f')]['ids'],_['omit'](_0x2a7d67[_0xe3c3('0x4f')],['ids','id'])||{});}})[_0xe3c3('0x29')](respondWithResult(_0x33e802,null))[_0xe3c3('0x48')](handleError(_0x33e802,null));};exports['getMembers']=function(_0x4e9673,_0xde9702,_0x103103){var _0x545d95={};var _0x319481={};var _0x33dfe1;var _0x50c4a9;return db[_0xe3c3('0x43')][_0xe3c3('0x57')]({'where':{'id':_0x4e9673[_0xe3c3('0x4a')]['id']}})[_0xe3c3('0x29')](handleEntityNotFound(_0xde9702,null))[_0xe3c3('0x29')](function(_0x128caf){if(_0x128caf){_0x33dfe1=_0x128caf;_0x319481[_0xe3c3('0x32')]=_['keys'](db[_0xe3c3('0x58')][_0xe3c3('0x4b')]);_0x319481[_0xe3c3('0x34')]=_['keys'](_0x4e9673[_0xe3c3('0x34')]);_0x319481[_0xe3c3('0x35')]=_[_0xe3c3('0x36')](_0x319481[_0xe3c3('0x32')],_0x319481[_0xe3c3('0x34')]);_0x545d95[_0xe3c3('0x37')]=_[_0xe3c3('0x36')](_0x319481[_0xe3c3('0x32')],qs['fields'](_0x4e9673[_0xe3c3('0x34')][_0xe3c3('0x38')]));_0x545d95['attributes']=_0x545d95[_0xe3c3('0x37')]['length']?_0x545d95[_0xe3c3('0x37')]:_0x319481[_0xe3c3('0x32')];_0x545d95[_0xe3c3('0x3b')]=qs['sort'](_0x4e9673[_0xe3c3('0x34')][_0xe3c3('0x3c')]);_0x545d95['where']=qs['filters'](_['pick'](_0x4e9673[_0xe3c3('0x34')],_0x319481[_0xe3c3('0x35')]));if(_0x4e9673['query']['filter']){_0x545d95['where']=_[_0xe3c3('0x3f')](_0x545d95[_0xe3c3('0x3d')],{'$or':_[_0xe3c3('0x33')](_0x545d95['attributes'],function(_0x1b50da){var _0x1d4ef1={};_0x1d4ef1[_0x1b50da]={'$like':'%'+_0x4e9673[_0xe3c3('0x34')]['filter']+'%'};return _0x1d4ef1;})});}_0x545d95=_[_0xe3c3('0x3f')]({},_0x545d95,_0x4e9673[_0xe3c3('0x42')]);return _0x33dfe1[_0xe3c3('0x59')](_0x545d95);}})['then'](function(_0x21627c){if(_0x21627c){_0x50c4a9=_0x21627c[_0xe3c3('0x39')];if(!_0x4e9673[_0xe3c3('0x34')]['hasOwnProperty'](_0xe3c3('0x5a'))){_0x545d95[_0xe3c3('0x21')]=qs['limit'](_0x4e9673['query'][_0xe3c3('0x21')]);_0x545d95[_0xe3c3('0x1f')]=qs[_0xe3c3('0x1f')](_0x4e9673['query']['offset']);}return _0x33dfe1[_0xe3c3('0x59')](_0x545d95);}})[_0xe3c3('0x29')](function(_0x5e9105){if(_0x5e9105){return _0x5e9105?{'count':_0x50c4a9,'rows':_0x5e9105}:null;}})[_0xe3c3('0x29')](respondWithResult(_0xde9702,null))['catch'](handleError(_0xde9702,null));};exports[_0xe3c3('0x5b')]=function(_0x34decd,_0x5f36cd,_0x4b3f61){return db[_0xe3c3('0x43')][_0xe3c3('0x4d')]({'where':{'id':_0x34decd['params']['id']}})[_0xe3c3('0x29')](handleEntityNotFound(_0x5f36cd,null))[_0xe3c3('0x29')](function(_0x3d9e83){if(_0x3d9e83){return _0x3d9e83['removeMembers'](_0x34decd[_0xe3c3('0x34')][_0xe3c3('0x5c')]);}})[_0xe3c3('0x29')](respondWithStatusCode(_0x5f36cd,null))[_0xe3c3('0x48')](handleError(_0x5f36cd,null));};exports[_0xe3c3('0x5d')]=function(_0x1b5c0d,_0x1fbcc6,_0x2cbb27){if(_0x1b5c0d[_0xe3c3('0x4f')]['id']){delete _0x1b5c0d[_0xe3c3('0x4f')]['id'];}return db[_0xe3c3('0x43')]['find']({'where':{'id':_0x1b5c0d['params']['id']}})['then'](handleEntityNotFound(_0x1fbcc6,null))[_0xe3c3('0x29')](function(_0x88ad77){if(_0x88ad77){_0x1b5c0d['body'][_0xe3c3('0x5e')]=_0x88ad77['id'];return db[_0xe3c3('0x53')][_0xe3c3('0x4e')](_0x1b5c0d[_0xe3c3('0x4f')]);}})['then'](respondWithResult(_0x1fbcc6,null))[_0xe3c3('0x48')](handleError(_0x1fbcc6,null));};exports[_0xe3c3('0x5f')]=function(_0x721d8b,_0x426ede,_0x53f199){var _0x1f027e={};var _0x5c0bdd={};var _0x4e4ab3;var _0x499b14;return db['ChatGroup'][_0xe3c3('0x57')]({'where':{'id':_0x721d8b[_0xe3c3('0x4a')]['id']}})[_0xe3c3('0x29')](handleEntityNotFound(_0x426ede,null))['then'](function(_0x96db87){if(_0x96db87){_0x4e4ab3=_0x96db87;_0x5c0bdd[_0xe3c3('0x32')]=_[_0xe3c3('0x4c')](db[_0xe3c3('0x53')][_0xe3c3('0x4b')]);_0x5c0bdd[_0xe3c3('0x34')]=_['keys'](_0x721d8b['query']);_0x5c0bdd[_0xe3c3('0x35')]=_[_0xe3c3('0x36')](_0x5c0bdd[_0xe3c3('0x32')],_0x5c0bdd[_0xe3c3('0x34')]);_0x1f027e[_0xe3c3('0x37')]=_[_0xe3c3('0x36')](_0x5c0bdd['model'],qs['fields'](_0x721d8b['query']['fields']));_0x1f027e['attributes']=_0x1f027e[_0xe3c3('0x37')][_0xe3c3('0x39')]?_0x1f027e[_0xe3c3('0x37')]:_0x5c0bdd[_0xe3c3('0x32')];_0x1f027e[_0xe3c3('0x3b')]=qs[_0xe3c3('0x3c')](_0x721d8b[_0xe3c3('0x34')][_0xe3c3('0x3c')]);_0x1f027e[_0xe3c3('0x3d')]=qs['filters'](_[_0xe3c3('0x3e')](_0x721d8b[_0xe3c3('0x34')],_0x5c0bdd[_0xe3c3('0x35')]));if(_0x721d8b[_0xe3c3('0x34')][_0xe3c3('0x41')]){_0x1f027e[_0xe3c3('0x3d')]=_[_0xe3c3('0x3f')](_0x1f027e[_0xe3c3('0x3d')],{'$or':_[_0xe3c3('0x33')](_0x1f027e['attributes'],function(_0x3fb6c3){var _0x18f24d={};_0x18f24d[_0x3fb6c3]={'$like':'%'+_0x721d8b[_0xe3c3('0x34')][_0xe3c3('0x41')]+'%'};return _0x18f24d;})});}if(_0x721d8b[_0xe3c3('0x34')][_0xe3c3('0x60')]){var _0x4ee00f=_0x721d8b[_0xe3c3('0x34')][_0xe3c3('0x60')][_0xe3c3('0x61')](',');var _0x17a94d={};_0x17a94d[_0x4ee00f[0x0]]={'$gte':moment(_0x4ee00f[0x1])[_0xe3c3('0x62')](_0xe3c3('0x63'))};_0x1f027e[_0xe3c3('0x3d')]=_[_0xe3c3('0x3f')](_0x1f027e[_0xe3c3('0x3d')],_0x17a94d);}_0x1f027e=_[_0xe3c3('0x3f')]({},_0x1f027e,_0x721d8b[_0xe3c3('0x42')]);return _0x4e4ab3[_0xe3c3('0x5f')](_0x1f027e);}})['then'](function(_0x2e7e47){if(_0x2e7e47){_0x499b14=_0x2e7e47[_0xe3c3('0x39')];if(!_0x721d8b['query']['hasOwnProperty'](_0xe3c3('0x5a'))){_0x1f027e['limit']=qs[_0xe3c3('0x21')](_0x721d8b['query']['limit']);_0x1f027e['offset']=qs[_0xe3c3('0x1f')](_0x721d8b[_0xe3c3('0x34')][_0xe3c3('0x1f')]);}return _0x4e4ab3[_0xe3c3('0x5f')](_0x1f027e);}})[_0xe3c3('0x29')](function(_0x40f475){if(_0x40f475){return _0x40f475?{'count':_0x499b14,'rows':_0x40f475}:null;}})[_0xe3c3('0x29')](respondWithResult(_0x426ede,null))['catch'](handleError(_0x426ede,null));}; \ No newline at end of file +var _0xbb70=['split','getMessages','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge','VIRTUAL','filter','options','ChatGroup','includeAll','include','rows','catch','show','params','length','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','getMembers','User','where','removeMembers','addMessage','ChatGroupId','findOne','ChatInternalMessage','$gte'];(function(_0x2c8374,_0x5814ab){var _0x6c87d9=function(_0x175add){while(--_0x175add){_0x2c8374['push'](_0x2c8374['shift']());}};_0x6c87d9(++_0x5814ab);}(_0xbb70,0x11f));var _0x0bb7=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0xbb70[_0x39d544];return _0x5a5ff2;};'use strict';var emlformat=require(_0x0bb7('0x0'));var rimraf=require(_0x0bb7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0bb7('0x2'));var rp=require('request-promise');var moment=require(_0x0bb7('0x3'));var BPromise=require(_0x0bb7('0x4'));var Mustache=require(_0x0bb7('0x5'));var util=require(_0x0bb7('0x6'));var path=require(_0x0bb7('0x7'));var sox=require(_0x0bb7('0x8'));var csv=require(_0x0bb7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0bb7('0xa'));var _=require(_0x0bb7('0xb'));var squel=require('squel');var crypto=require(_0x0bb7('0xc'));var jsforce=require(_0x0bb7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0bb7('0x9'));var querystring=require(_0x0bb7('0xe'));var Papa=require(_0x0bb7('0xf'));var Redis=require('ioredis');var authService=require(_0x0bb7('0x10'));var qs=require(_0x0bb7('0x11'));var as=require(_0x0bb7('0x12'));var hardwareService=require(_0x0bb7('0x13'));var logger=require(_0x0bb7('0x14'))(_0x0bb7('0x15'));var utils=require(_0x0bb7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0bb7('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0bb7('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0bb7('0x19')]));require('./chatGroup.socket')[_0x0bb7('0x1a')](socket);function respondWithStatusCode(_0x52940d,_0x2e8862){_0x2e8862=_0x2e8862||0xcc;return function(_0x35f754){if(_0x35f754){return _0x52940d[_0x0bb7('0x1b')](_0x2e8862);}return _0x52940d[_0x0bb7('0x1c')](_0x2e8862)[_0x0bb7('0x1d')]();};}function respondWithResult(_0x1230fd,_0x3c6b5e){_0x3c6b5e=_0x3c6b5e||0xc8;return function(_0x50a6f9){if(_0x50a6f9){return _0x1230fd[_0x0bb7('0x1c')](_0x3c6b5e)[_0x0bb7('0x1e')](_0x50a6f9);}};}function respondWithFilteredResult(_0x14f29c,_0x56751d){return function(_0x2a5a04){if(_0x2a5a04){var _0x52e091=typeof _0x56751d[_0x0bb7('0x1f')]===_0x0bb7('0x20')&&typeof _0x56751d[_0x0bb7('0x21')]===_0x0bb7('0x20');var _0x3a49d0=_0x2a5a04[_0x0bb7('0x22')];var _0x4c7944=_0x52e091?0x0:_0x56751d[_0x0bb7('0x1f')];var _0x49009b=_0x52e091?_0x2a5a04[_0x0bb7('0x22')]:_0x56751d[_0x0bb7('0x1f')]+_0x56751d[_0x0bb7('0x21')];var _0x24f8c1;if(_0x49009b>=_0x3a49d0){_0x49009b=_0x3a49d0;_0x24f8c1=0xc8;}else{_0x24f8c1=0xce;}_0x14f29c[_0x0bb7('0x1c')](_0x24f8c1);return _0x14f29c[_0x0bb7('0x23')](_0x0bb7('0x24'),_0x4c7944+'-'+_0x49009b+'/'+_0x3a49d0)[_0x0bb7('0x1e')](_0x2a5a04);}return null;};}function patchUpdates(_0x4f2499){return function(_0x3e774b){try{jsonpatch[_0x0bb7('0x25')](_0x3e774b,_0x4f2499,!![]);}catch(_0x13ca13){return BPromise[_0x0bb7('0x26')](_0x13ca13);}return _0x3e774b['save']();};}function saveUpdates(_0xe1c7eb,_0x1f4f60){return function(_0x1f1f0f){if(_0x1f1f0f){return _0x1f1f0f[_0x0bb7('0x27')](_0xe1c7eb)[_0x0bb7('0x28')](function(_0x47f6e8){return _0x47f6e8;});}return null;};}function removeEntity(_0x27ee27,_0x555d67){return function(_0x5c6b43){if(_0x5c6b43){return _0x5c6b43[_0x0bb7('0x29')]()['then'](function(){_0x27ee27[_0x0bb7('0x1c')](0xcc)[_0x0bb7('0x1d')]();});}};}function handleEntityNotFound(_0x2a360b,_0x4e2a41){return function(_0x2adc29){if(!_0x2adc29){_0x2a360b[_0x0bb7('0x1b')](0x194);}return _0x2adc29;};}function handleError(_0x2b4df8,_0x5a07e0){_0x5a07e0=_0x5a07e0||0x1f4;return function(_0x2db53f){logger[_0x0bb7('0x2a')](_0x2db53f[_0x0bb7('0x2b')]);if(_0x2db53f[_0x0bb7('0x2c')]){delete _0x2db53f[_0x0bb7('0x2c')];}_0x2b4df8[_0x0bb7('0x1c')](_0x5a07e0)[_0x0bb7('0x2d')](_0x2db53f);};}exports['index']=function(_0x4e5615,_0x451ca7){var _0x25aa56={},_0x42f319={},_0x11726a={'count':0x0,'rows':[]};var _0x7e8b7=_[_0x0bb7('0x2e')](db['ChatGroup'][_0x0bb7('0x2f')],function(_0x4b2332){return{'name':_0x4b2332[_0x0bb7('0x30')],'type':_0x4b2332[_0x0bb7('0x31')][_0x0bb7('0x32')]};});_0x42f319['model']=_[_0x0bb7('0x2e')](_0x7e8b7,_0x0bb7('0x2c'));_0x42f319['query']=_[_0x0bb7('0x33')](_0x4e5615[_0x0bb7('0x34')]);_0x42f319[_0x0bb7('0x35')]=_[_0x0bb7('0x36')](_0x42f319[_0x0bb7('0x37')],_0x42f319[_0x0bb7('0x34')]);_0x25aa56[_0x0bb7('0x38')]=_[_0x0bb7('0x36')](_0x42f319[_0x0bb7('0x37')],qs[_0x0bb7('0x39')](_0x4e5615[_0x0bb7('0x34')][_0x0bb7('0x39')]));_0x25aa56[_0x0bb7('0x38')]=_0x25aa56['attributes']['length']?_0x25aa56['attributes']:_0x42f319['model'];if(!_0x4e5615['query'][_0x0bb7('0x3a')](_0x0bb7('0x3b'))){_0x25aa56[_0x0bb7('0x21')]=qs[_0x0bb7('0x21')](_0x4e5615[_0x0bb7('0x34')]['limit']);_0x25aa56[_0x0bb7('0x1f')]=qs[_0x0bb7('0x1f')](_0x4e5615[_0x0bb7('0x34')][_0x0bb7('0x1f')]);}_0x25aa56[_0x0bb7('0x3c')]=qs[_0x0bb7('0x3d')](_0x4e5615[_0x0bb7('0x34')][_0x0bb7('0x3d')]);_0x25aa56['where']=qs[_0x0bb7('0x35')](_[_0x0bb7('0x3e')](_0x4e5615[_0x0bb7('0x34')],_0x42f319[_0x0bb7('0x35')]),_0x7e8b7);if(_0x4e5615[_0x0bb7('0x34')]['filter']){_0x25aa56['where']=_[_0x0bb7('0x3f')](_0x25aa56['where'],{'$or':_[_0x0bb7('0x2e')](_0x7e8b7,function(_0x489e83){if(_0x489e83[_0x0bb7('0x31')]!==_0x0bb7('0x40')){var _0x2eaf61={};_0x2eaf61[_0x489e83['name']]={'$like':'%'+_0x4e5615[_0x0bb7('0x34')][_0x0bb7('0x41')]+'%'};return _0x2eaf61;}})});}_0x25aa56=_[_0x0bb7('0x3f')]({},_0x25aa56,_0x4e5615[_0x0bb7('0x42')]);var _0x474987={'where':_0x25aa56['where']};return db[_0x0bb7('0x43')][_0x0bb7('0x22')](_0x474987)[_0x0bb7('0x28')](function(_0x5a230b){_0x11726a[_0x0bb7('0x22')]=_0x5a230b;if(_0x4e5615[_0x0bb7('0x34')][_0x0bb7('0x44')]){_0x25aa56[_0x0bb7('0x45')]=[{'all':!![]}];}return db[_0x0bb7('0x43')]['findAll'](_0x25aa56);})[_0x0bb7('0x28')](function(_0x117699){_0x11726a[_0x0bb7('0x46')]=_0x117699;return _0x11726a;})[_0x0bb7('0x28')](respondWithFilteredResult(_0x451ca7,_0x25aa56))[_0x0bb7('0x47')](handleError(_0x451ca7,null));};exports[_0x0bb7('0x48')]=function(_0x550354,_0x23723c){var _0x373821={'raw':!![],'where':{'id':_0x550354[_0x0bb7('0x49')]['id']}},_0x4e3a13={};_0x4e3a13['model']=_['keys'](db['ChatGroup']['rawAttributes']);_0x4e3a13[_0x0bb7('0x34')]=_[_0x0bb7('0x33')](_0x550354[_0x0bb7('0x34')]);_0x4e3a13[_0x0bb7('0x35')]=_[_0x0bb7('0x36')](_0x4e3a13['model'],_0x4e3a13[_0x0bb7('0x34')]);_0x373821['attributes']=_[_0x0bb7('0x36')](_0x4e3a13[_0x0bb7('0x37')],qs[_0x0bb7('0x39')](_0x550354['query']['fields']));_0x373821[_0x0bb7('0x38')]=_0x373821[_0x0bb7('0x38')][_0x0bb7('0x4a')]?_0x373821['attributes']:_0x4e3a13[_0x0bb7('0x37')];if(_0x550354['query'][_0x0bb7('0x44')]){_0x373821[_0x0bb7('0x45')]=[{'all':!![]}];}_0x373821=_[_0x0bb7('0x3f')]({},_0x373821,_0x550354[_0x0bb7('0x42')]);return db[_0x0bb7('0x43')][_0x0bb7('0x4b')](_0x373821)[_0x0bb7('0x28')](handleEntityNotFound(_0x23723c,null))[_0x0bb7('0x28')](respondWithResult(_0x23723c,null))[_0x0bb7('0x47')](handleError(_0x23723c,null));};exports[_0x0bb7('0x4c')]=function(_0x376d49,_0x3d7011){return db[_0x0bb7('0x43')][_0x0bb7('0x4c')](_0x376d49[_0x0bb7('0x4d')],{})[_0x0bb7('0x28')](respondWithResult(_0x3d7011,0xc9))[_0x0bb7('0x47')](handleError(_0x3d7011,null));};exports['update']=function(_0x4bf793,_0x3d983e){if(_0x4bf793['body']['id']){delete _0x4bf793[_0x0bb7('0x4d')]['id'];}return db['ChatGroup'][_0x0bb7('0x4b')]({'where':{'id':_0x4bf793[_0x0bb7('0x49')]['id']}})[_0x0bb7('0x28')](handleEntityNotFound(_0x3d983e,null))['then'](saveUpdates(_0x4bf793[_0x0bb7('0x4d')],null))[_0x0bb7('0x28')](respondWithResult(_0x3d983e,null))[_0x0bb7('0x47')](handleError(_0x3d983e,null));};exports[_0x0bb7('0x29')]=function(_0x1ad481,_0x1487db){return db[_0x0bb7('0x43')]['find']({'where':{'id':_0x1ad481[_0x0bb7('0x49')]['id']}})[_0x0bb7('0x28')](handleEntityNotFound(_0x1487db,null))[_0x0bb7('0x28')](removeEntity(_0x1487db,null))[_0x0bb7('0x47')](handleError(_0x1487db,null));};exports[_0x0bb7('0x4e')]=function(_0x328983,_0x4d1110){return db[_0x0bb7('0x43')][_0x0bb7('0x4e')]()[_0x0bb7('0x28')](respondWithResult(_0x4d1110,null))[_0x0bb7('0x47')](handleError(_0x4d1110,null));};exports[_0x0bb7('0x4f')]=function(_0x43adb8,_0x55f5e3,_0xa406ce){return db['ChatInternalMessage'][_0x0bb7('0x22')]({'where':{'ChatGroupId':_0x43adb8[_0x0bb7('0x49')]['id'],'ToId':_0x43adb8[_0x0bb7('0x50')]['id'],'read':![]}})[_0x0bb7('0x28')](function(_0x11d0db){return{'id':_[_0x0bb7('0x51')](_0x43adb8[_0x0bb7('0x49')]['id']),'count':_0x11d0db};})['then'](respondWithResult(_0x55f5e3,null))[_0x0bb7('0x47')](handleError(_0x55f5e3,null));};exports[_0x0bb7('0x52')]=function(_0x3b6180,_0x312160,_0x38bdf0){return db['ChatGroup'][_0x0bb7('0x4b')]({'where':{'id':_0x3b6180[_0x0bb7('0x49')]['id']}})['then'](handleEntityNotFound(_0x312160,null))[_0x0bb7('0x28')](function(_0x5e2b1e){if(_0x5e2b1e){return _0x5e2b1e[_0x0bb7('0x52')](_0x3b6180[_0x0bb7('0x4d')][_0x0bb7('0x53')],_['omit'](_0x3b6180[_0x0bb7('0x4d')],['ids','id'])||{});}})[_0x0bb7('0x28')](respondWithResult(_0x312160,null))['catch'](handleError(_0x312160,null));};exports[_0x0bb7('0x54')]=function(_0x57a06b,_0x4aef79,_0x519f15){var _0x475c4c={};var _0x2d6902={};var _0x59952c;var _0x29b9e8;return db['ChatGroup']['findOne']({'where':{'id':_0x57a06b[_0x0bb7('0x49')]['id']}})[_0x0bb7('0x28')](handleEntityNotFound(_0x4aef79,null))[_0x0bb7('0x28')](function(_0x5823fd){if(_0x5823fd){_0x59952c=_0x5823fd;_0x2d6902[_0x0bb7('0x37')]=_[_0x0bb7('0x33')](db[_0x0bb7('0x55')][_0x0bb7('0x2f')]);_0x2d6902[_0x0bb7('0x34')]=_[_0x0bb7('0x33')](_0x57a06b[_0x0bb7('0x34')]);_0x2d6902[_0x0bb7('0x35')]=_[_0x0bb7('0x36')](_0x2d6902['model'],_0x2d6902[_0x0bb7('0x34')]);_0x475c4c[_0x0bb7('0x38')]=_[_0x0bb7('0x36')](_0x2d6902['model'],qs[_0x0bb7('0x39')](_0x57a06b['query'][_0x0bb7('0x39')]));_0x475c4c['attributes']=_0x475c4c[_0x0bb7('0x38')][_0x0bb7('0x4a')]?_0x475c4c[_0x0bb7('0x38')]:_0x2d6902[_0x0bb7('0x37')];_0x475c4c[_0x0bb7('0x3c')]=qs[_0x0bb7('0x3d')](_0x57a06b[_0x0bb7('0x34')][_0x0bb7('0x3d')]);_0x475c4c[_0x0bb7('0x56')]=qs[_0x0bb7('0x35')](_[_0x0bb7('0x3e')](_0x57a06b[_0x0bb7('0x34')],_0x2d6902[_0x0bb7('0x35')]));if(_0x57a06b['query'][_0x0bb7('0x41')]){_0x475c4c[_0x0bb7('0x56')]=_[_0x0bb7('0x3f')](_0x475c4c[_0x0bb7('0x56')],{'$or':_['map'](_0x475c4c['attributes'],function(_0x56d94b){var _0x5cda63={};_0x5cda63[_0x56d94b]={'$like':'%'+_0x57a06b[_0x0bb7('0x34')][_0x0bb7('0x41')]+'%'};return _0x5cda63;})});}_0x475c4c=_[_0x0bb7('0x3f')]({},_0x475c4c,_0x57a06b[_0x0bb7('0x42')]);return _0x59952c[_0x0bb7('0x54')](_0x475c4c);}})[_0x0bb7('0x28')](function(_0x4e9fa7){if(_0x4e9fa7){_0x29b9e8=_0x4e9fa7['length'];if(!_0x57a06b['query'][_0x0bb7('0x3a')]('nolimit')){_0x475c4c['limit']=qs[_0x0bb7('0x21')](_0x57a06b['query'][_0x0bb7('0x21')]);_0x475c4c[_0x0bb7('0x1f')]=qs[_0x0bb7('0x1f')](_0x57a06b[_0x0bb7('0x34')][_0x0bb7('0x1f')]);}return _0x59952c[_0x0bb7('0x54')](_0x475c4c);}})[_0x0bb7('0x28')](function(_0x15ae95){if(_0x15ae95){return _0x15ae95?{'count':_0x29b9e8,'rows':_0x15ae95}:null;}})[_0x0bb7('0x28')](respondWithResult(_0x4aef79,null))[_0x0bb7('0x47')](handleError(_0x4aef79,null));};exports[_0x0bb7('0x57')]=function(_0x3375e1,_0x44affe,_0x5032a1){return db[_0x0bb7('0x43')][_0x0bb7('0x4b')]({'where':{'id':_0x3375e1[_0x0bb7('0x49')]['id']}})[_0x0bb7('0x28')](handleEntityNotFound(_0x44affe,null))[_0x0bb7('0x28')](function(_0x517d29){if(_0x517d29){return _0x517d29[_0x0bb7('0x57')](_0x3375e1[_0x0bb7('0x34')][_0x0bb7('0x53')]);}})[_0x0bb7('0x28')](respondWithStatusCode(_0x44affe,null))[_0x0bb7('0x47')](handleError(_0x44affe,null));};exports[_0x0bb7('0x58')]=function(_0x14202e,_0x30377d,_0x5e5516){if(_0x14202e[_0x0bb7('0x4d')]['id']){delete _0x14202e[_0x0bb7('0x4d')]['id'];}return db[_0x0bb7('0x43')][_0x0bb7('0x4b')]({'where':{'id':_0x14202e[_0x0bb7('0x49')]['id']}})[_0x0bb7('0x28')](handleEntityNotFound(_0x30377d,null))[_0x0bb7('0x28')](function(_0x585e06){if(_0x585e06){_0x14202e[_0x0bb7('0x4d')][_0x0bb7('0x59')]=_0x585e06['id'];return db['ChatInternalMessage']['create'](_0x14202e[_0x0bb7('0x4d')]);}})[_0x0bb7('0x28')](respondWithResult(_0x30377d,null))[_0x0bb7('0x47')](handleError(_0x30377d,null));};exports['getMessages']=function(_0x1d66a8,_0x1e5df4,_0x3e116c){var _0x3d3e7f={};var _0x55bcf6={};var _0x4476ca;var _0xf06108;return db[_0x0bb7('0x43')][_0x0bb7('0x5a')]({'where':{'id':_0x1d66a8[_0x0bb7('0x49')]['id']}})['then'](handleEntityNotFound(_0x1e5df4,null))[_0x0bb7('0x28')](function(_0x5c3f3e){if(_0x5c3f3e){_0x4476ca=_0x5c3f3e;_0x55bcf6['model']=_[_0x0bb7('0x33')](db[_0x0bb7('0x5b')][_0x0bb7('0x2f')]);_0x55bcf6[_0x0bb7('0x34')]=_[_0x0bb7('0x33')](_0x1d66a8[_0x0bb7('0x34')]);_0x55bcf6['filters']=_['intersection'](_0x55bcf6['model'],_0x55bcf6[_0x0bb7('0x34')]);_0x3d3e7f[_0x0bb7('0x38')]=_[_0x0bb7('0x36')](_0x55bcf6[_0x0bb7('0x37')],qs['fields'](_0x1d66a8[_0x0bb7('0x34')]['fields']));_0x3d3e7f[_0x0bb7('0x38')]=_0x3d3e7f[_0x0bb7('0x38')][_0x0bb7('0x4a')]?_0x3d3e7f[_0x0bb7('0x38')]:_0x55bcf6[_0x0bb7('0x37')];_0x3d3e7f['order']=qs[_0x0bb7('0x3d')](_0x1d66a8[_0x0bb7('0x34')][_0x0bb7('0x3d')]);_0x3d3e7f[_0x0bb7('0x56')]=qs[_0x0bb7('0x35')](_['pick'](_0x1d66a8['query'],_0x55bcf6['filters']));if(_0x1d66a8[_0x0bb7('0x34')][_0x0bb7('0x41')]){_0x3d3e7f['where']=_['merge'](_0x3d3e7f['where'],{'$or':_['map'](_0x3d3e7f[_0x0bb7('0x38')],function(_0xe05b2d){var _0x5c2f52={};_0x5c2f52[_0xe05b2d]={'$like':'%'+_0x1d66a8['query'][_0x0bb7('0x41')]+'%'};return _0x5c2f52;})});}if(_0x1d66a8['query'][_0x0bb7('0x5c')]){var _0x7acec9=_0x1d66a8['query'][_0x0bb7('0x5c')][_0x0bb7('0x5d')](',');var _0x101501={};_0x101501[_0x7acec9[0x0]]={'$gte':moment(_0x7acec9[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3d3e7f[_0x0bb7('0x56')]=_[_0x0bb7('0x3f')](_0x3d3e7f[_0x0bb7('0x56')],_0x101501);}_0x3d3e7f=_[_0x0bb7('0x3f')]({},_0x3d3e7f,_0x1d66a8[_0x0bb7('0x42')]);return _0x4476ca[_0x0bb7('0x5e')](_0x3d3e7f);}})[_0x0bb7('0x28')](function(_0x3ff5d3){if(_0x3ff5d3){_0xf06108=_0x3ff5d3[_0x0bb7('0x4a')];if(!_0x1d66a8[_0x0bb7('0x34')][_0x0bb7('0x3a')](_0x0bb7('0x3b'))){_0x3d3e7f[_0x0bb7('0x21')]=qs[_0x0bb7('0x21')](_0x1d66a8[_0x0bb7('0x34')][_0x0bb7('0x21')]);_0x3d3e7f[_0x0bb7('0x1f')]=qs[_0x0bb7('0x1f')](_0x1d66a8[_0x0bb7('0x34')][_0x0bb7('0x1f')]);}return _0x4476ca['getMessages'](_0x3d3e7f);}})['then'](function(_0x81df0b){if(_0x81df0b){return _0x81df0b?{'count':_0xf06108,'rows':_0x81df0b}:null;}})[_0x0bb7('0x28')](respondWithResult(_0x1e5df4,null))[_0x0bb7('0x47')](handleError(_0x1e5df4,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 51f5aad..edeb105 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 _0xe2d7=['emit','hasOwnProperty','hook','exports','events','ChatGroup','setMaxListeners','save','update','remove'];(function(_0x485f53,_0x104081){var _0x480f1e=function(_0x2d61d2){while(--_0x2d61d2){_0x485f53['push'](_0x485f53['shift']());}};_0x480f1e(++_0x104081);}(_0xe2d7,0x112));var _0x7e2d=function(_0x471fd5,_0x98d92a){_0x471fd5=_0x471fd5-0x0;var _0x3e5b0c=_0xe2d7[_0x471fd5];return _0x3e5b0c;};'use strict';var EventEmitter=require(_0x7e2d('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x7e2d('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7e2d('0x2')](0x0);var events={'afterCreate':_0x7e2d('0x3'),'afterUpdate':_0x7e2d('0x4'),'afterDestroy':_0x7e2d('0x5')};function emitEvent(_0x2bc0c6){return function(_0x1788bb,_0x55bab2,_0x3fad07){ChatGroupEvents[_0x7e2d('0x6')](_0x2bc0c6+':'+_0x1788bb['id'],_0x1788bb);ChatGroupEvents[_0x7e2d('0x6')](_0x2bc0c6,_0x1788bb);_0x3fad07(null);};}for(var e in events){if(events[_0x7e2d('0x7')](e)){var event=events[e];ChatGroup[_0x7e2d('0x8')](e,emitEvent(event));}}module[_0x7e2d('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0x120e=['ChatGroup','setMaxListeners','update','remove','emit','hook'];(function(_0x2313e8,_0x415c7f){var _0x405d3f=function(_0x48f4a1){while(--_0x48f4a1){_0x2313e8['push'](_0x2313e8['shift']());}};_0x405d3f(++_0x415c7f);}(_0x120e,0x17a));var _0xe120=function(_0x141006,_0x36cb84){_0x141006=_0x141006-0x0;var _0x417cc8=_0x120e[_0x141006];return _0x417cc8;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0xe120('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xe120('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe120('0x2'),'afterDestroy':_0xe120('0x3')};function emitEvent(_0x1822ca){return function(_0x4446a0,_0x32cce3,_0x2c38d7){ChatGroupEvents[_0xe120('0x4')](_0x1822ca+':'+_0x4446a0['id'],_0x4446a0);ChatGroupEvents[_0xe120('0x4')](_0x1822ca,_0x4446a0);_0x2c38d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xe120('0x5')](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 7e7aa57..cf92b75 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 _0x80b1=['moment','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0xd40135,_0x4d8539){var _0x41a721=function(_0xe996f3){while(--_0xe996f3){_0xd40135['push'](_0xd40135['shift']());}};_0x41a721(++_0x4d8539);}(_0x80b1,0xcf));var _0x180b=function(_0xc0f10a,_0x3a2702){_0xc0f10a=_0xc0f10a-0x0;var _0x2c8ab6=_0x80b1[_0xc0f10a];return _0x2c8ab6;};'use strict';var _=require(_0x180b('0x0'));var util=require(_0x180b('0x1'));var logger=require(_0x180b('0x2'))('api');var moment=require(_0x180b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x180b('0x4'));var config=require(_0x180b('0x5'));var attributes=require('./chatGroup.attributes');module[_0x180b('0x6')]=function(_0x43b4a2,_0x20dbba){return _0x43b4a2[_0x180b('0x7')](_0x180b('0x8'),attributes,{'tableName':_0x180b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0235=['define','chat_groups','lodash','../../config/logger','moment','bluebird','path','rimraf','./chatGroup.attributes'];(function(_0x383b0a,_0x4aadd8){var _0xa64dee=function(_0x1a894f){while(--_0x1a894f){_0x383b0a['push'](_0x383b0a['shift']());}};_0xa64dee(++_0x4aadd8);}(_0x0235,0x1d6));var _0x5023=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x0235[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x5023('0x0'));var util=require('util');var logger=require(_0x5023('0x1'))('api');var moment=require(_0x5023('0x2'));var BPromise=require(_0x5023('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5023('0x4'));var rimraf=require(_0x5023('0x5'));var config=require('../../config/environment');var attributes=require(_0x5023('0x6'));module['exports']=function(_0x4e267d,_0x38c370){return _0x4e267d[_0x5023('0x7')]('ChatGroup',attributes,{'tableName':_0x5023('0x8'),'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 061371a..5c64ae0 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 _0x6379=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','ChatGroup,\x20%s,\x20%s'];(function(_0x486eff,_0x5cb3b0){var _0x95293b=function(_0x25b947){while(--_0x25b947){_0x486eff['push'](_0x486eff['shift']());}};_0x95293b(++_0x5cb3b0);}(_0x6379,0x84));var _0x9637=function(_0x275a90,_0xa0f3cc){_0x275a90=_0x275a90-0x0;var _0x17b092=_0x6379[_0x275a90];return _0x17b092;};'use strict';var _=require(_0x9637('0x0'));var util=require(_0x9637('0x1'));var moment=require(_0x9637('0x2'));var BPromise=require(_0x9637('0x3'));var rs=require(_0x9637('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9637('0x5'))['db'];var utils=require(_0x9637('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9637('0x7'));var jayson=require(_0x9637('0x8'));var client=jayson[_0x9637('0x9')][_0x9637('0xa')]({'port':0x232a});config[_0x9637('0xb')]=_['defaults'](config['redis'],{'host':_0x9637('0xc'),'port':0x18eb});var socket=require(_0x9637('0xd'))(new Redis(config[_0x9637('0xb')]));require(_0x9637('0xe'))['register'](socket);function respondWithRpcPromise(_0x42ca5a,_0x16edf8,_0x37ea41){return new BPromise(function(_0x426ae2,_0x3d7b1e){return client[_0x9637('0xf')](_0x42ca5a,_0x37ea41)[_0x9637('0x10')](function(_0x2e3a06){logger[_0x9637('0x11')]('ChatGroup,\x20%s,\x20%s',_0x16edf8,_0x9637('0x12'));logger['debug'](_0x9637('0x13'),_0x16edf8,_0x9637('0x12'),JSON['stringify'](_0x2e3a06));if(_0x2e3a06[_0x9637('0x14')]){if(_0x2e3a06[_0x9637('0x14')][_0x9637('0x15')]===0x1f4){logger[_0x9637('0x14')]('ChatGroup,\x20%s,\x20%s',_0x16edf8,_0x2e3a06[_0x9637('0x14')][_0x9637('0x16')]);return _0x3d7b1e(_0x2e3a06[_0x9637('0x14')][_0x9637('0x16')]);}logger[_0x9637('0x14')]('ChatGroup,\x20%s,\x20%s',_0x16edf8,_0x2e3a06[_0x9637('0x14')][_0x9637('0x16')]);return _0x426ae2(_0x2e3a06[_0x9637('0x14')][_0x9637('0x16')]);}else{logger[_0x9637('0x11')](_0x9637('0x17'),_0x16edf8,_0x9637('0x12'));_0x426ae2(_0x2e3a06[_0x9637('0x18')][_0x9637('0x16')]);}})[_0x9637('0x19')](function(_0x5dc995){logger['error'](_0x9637('0x17'),_0x16edf8,_0x5dc995);_0x3d7b1e(_0x5dc995);});});} \ No newline at end of file +var _0x46f4=['localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x46f4,0x115));var _0x446f=function(_0x537530,_0x5c5740){_0x537530=_0x537530-0x0;var _0x237ab5=_0x46f4[_0x537530];return _0x237ab5;};'use strict';var _=require(_0x446f('0x0'));var util=require(_0x446f('0x1'));var moment=require(_0x446f('0x2'));var BPromise=require(_0x446f('0x3'));var rs=require(_0x446f('0x4'));var fs=require('fs');var Redis=require(_0x446f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x446f('0x6'));var logger=require(_0x446f('0x7'))('rpc');var config=require(_0x446f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x446f('0x9')][_0x446f('0xa')]({'port':0x232a});config[_0x446f('0xb')]=_[_0x446f('0xc')](config[_0x446f('0xb')],{'host':_0x446f('0xd'),'port':0x18eb});var socket=require(_0x446f('0xe'))(new Redis(config[_0x446f('0xb')]));require(_0x446f('0xf'))[_0x446f('0x10')](socket);function respondWithRpcPromise(_0x1c4dc9,_0x3f541e,_0x4d7eda){return new BPromise(function(_0x12354b,_0x1818cb){return client[_0x446f('0x11')](_0x1c4dc9,_0x4d7eda)[_0x446f('0x12')](function(_0x4695d6){logger[_0x446f('0x13')]('ChatGroup,\x20%s,\x20%s',_0x3f541e,_0x446f('0x14'));logger[_0x446f('0x15')](_0x446f('0x16'),_0x3f541e,_0x446f('0x14'),JSON[_0x446f('0x17')](_0x4695d6));if(_0x4695d6[_0x446f('0x18')]){if(_0x4695d6[_0x446f('0x18')][_0x446f('0x19')]===0x1f4){logger[_0x446f('0x18')](_0x446f('0x1a'),_0x3f541e,_0x4695d6['error'][_0x446f('0x1b')]);return _0x1818cb(_0x4695d6[_0x446f('0x18')][_0x446f('0x1b')]);}logger[_0x446f('0x18')](_0x446f('0x1a'),_0x3f541e,_0x4695d6[_0x446f('0x18')][_0x446f('0x1b')]);return _0x12354b(_0x4695d6[_0x446f('0x18')][_0x446f('0x1b')]);}else{logger[_0x446f('0x13')](_0x446f('0x1a'),_0x3f541e,_0x446f('0x14'));_0x12354b(_0x4695d6[_0x446f('0x1c')][_0x446f('0x1b')]);}})['catch'](function(_0x4c0df5){logger[_0x446f('0x18')](_0x446f('0x1a'),_0x3f541e,_0x4c0df5);_0x1818cb(_0x4c0df5);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index a1efdfd..9a05731 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 _0x9570=['removeListener','length','chatGroup:','./chatGroup.events','save','emit'];(function(_0x9d1d1f,_0x3d6e3f){var _0x19e276=function(_0x2fb01c){while(--_0x2fb01c){_0x9d1d1f['push'](_0x9d1d1f['shift']());}};_0x19e276(++_0x3d6e3f);}(_0x9570,0x1e9));var _0x0957=function(_0x1c470d,_0x81d66b){_0x1c470d=_0x1c470d-0x0;var _0x12141b=_0x9570[_0x1c470d];return _0x12141b;};'use strict';var ChatGroupEvents=require(_0x0957('0x0'));var events=[_0x0957('0x1'),'remove','update'];function createListener(_0x388b9c,_0x766780){return function(_0x553191){_0x766780[_0x0957('0x2')](_0x388b9c,_0x553191);};}function removeListener(_0x5cf9b6,_0x452874){return function(){ChatGroupEvents[_0x0957('0x3')](_0x5cf9b6,_0x452874);};}exports['register']=function(_0x58743d){for(var _0x1c5f14=0x0,_0x7d3b66=events[_0x0957('0x4')];_0x1c5f14<_0x7d3b66;_0x1c5f14++){var _0x134ddc=events[_0x1c5f14];var _0x2f2aa3=createListener(_0x0957('0x5')+_0x134ddc,_0x58743d);ChatGroupEvents['on'](_0x134ddc,_0x2f2aa3);}}; \ No newline at end of file +var _0x5f2a=['removeListener','register','length','./chatGroup.events','remove','emit'];(function(_0x466014,_0x10fba4){var _0x35769f=function(_0x5edccb){while(--_0x5edccb){_0x466014['push'](_0x466014['shift']());}};_0x35769f(++_0x10fba4);}(_0x5f2a,0x123));var _0xa5f2=function(_0x4a2fde,_0x3a2d4a){_0x4a2fde=_0x4a2fde-0x0;var _0x224d77=_0x5f2a[_0x4a2fde];return _0x224d77;};'use strict';var ChatGroupEvents=require(_0xa5f2('0x0'));var events=['save',_0xa5f2('0x1'),'update'];function createListener(_0x5204e0,_0x2f9ffd){return function(_0x49689b){_0x2f9ffd[_0xa5f2('0x2')](_0x5204e0,_0x49689b);};}function removeListener(_0x285a6d,_0x50e560){return function(){ChatGroupEvents[_0xa5f2('0x3')](_0x285a6d,_0x50e560);};}exports[_0xa5f2('0x4')]=function(_0xdcdd2a){for(var _0x318f6c=0x0,_0x144554=events[_0xa5f2('0x5')];_0x318f6c<_0x144554;_0x318f6c++){var _0xb4669f=events[_0x318f6c];var _0x4be2f=createListener('chatGroup:'+_0xb4669f,_0xdcdd2a);ChatGroupEvents['on'](_0xb4669f,_0x4be2f);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index d4c4aed..418ef49 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 _0x0842=['/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','update','delete','removeMembers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x0842,0x125));var _0x2084=function(_0x25bf87,_0x4dd9db){_0x25bf87=_0x25bf87-0x0;var _0x21451e=_0x0842[_0x25bf87];return _0x21451e;};'use strict';var multer=require('multer');var util=require(_0x2084('0x0'));var path=require(_0x2084('0x1'));var timeout=require(_0x2084('0x2'));var express=require(_0x2084('0x3'));var router=express[_0x2084('0x4')]();var fs_extra=require(_0x2084('0x5'));var auth=require(_0x2084('0x6'));var interaction=require(_0x2084('0x7'));var config=require(_0x2084('0x8'));var controller=require(_0x2084('0x9'));router['get']('/',auth[_0x2084('0xa')](),controller[_0x2084('0xb')]);router[_0x2084('0xc')](_0x2084('0xd'),auth['isAuthenticated'](),controller[_0x2084('0xe')]);router[_0x2084('0xc')](_0x2084('0xf'),auth['isAuthenticated'](),controller[_0x2084('0x10')]);router[_0x2084('0xc')](_0x2084('0x11'),auth['isAuthenticated'](),controller[_0x2084('0x12')]);router[_0x2084('0xc')](_0x2084('0x13'),auth[_0x2084('0xa')](),controller[_0x2084('0x14')]);router[_0x2084('0xc')](_0x2084('0x15'),auth['isAuthenticated'](),controller[_0x2084('0x16')]);router[_0x2084('0x17')]('/',auth[_0x2084('0xa')](),controller['create']);router['post'](_0x2084('0x13'),auth['isAuthenticated'](),controller[_0x2084('0x18')]);router[_0x2084('0x17')](_0x2084('0x15'),auth[_0x2084('0xa')](),controller[_0x2084('0x19')]);router[_0x2084('0x1a')](_0x2084('0xf'),auth[_0x2084('0xa')](),controller[_0x2084('0x1b')]);router['delete'](_0x2084('0xf'),auth[_0x2084('0xa')](),controller['destroy']);router[_0x2084('0x1c')](_0x2084('0x13'),auth[_0x2084('0xa')](),controller[_0x2084('0x1d')]);module[_0x2084('0x1e')]=router; \ No newline at end of file +var _0xaae7=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','/:id/members','removeMembers'];(function(_0xc63cf,_0x4ba8e6){var _0x5a805c=function(_0x34fcc6){while(--_0x34fcc6){_0xc63cf['push'](_0xc63cf['shift']());}};_0x5a805c(++_0x4ba8e6);}(_0xaae7,0xe1));var _0x7aae=function(_0x25990c,_0x3412fb){_0x25990c=_0x25990c-0x0;var _0x56fea2=_0xaae7[_0x25990c];return _0x56fea2;};'use strict';var multer=require(_0x7aae('0x0'));var util=require(_0x7aae('0x1'));var path=require(_0x7aae('0x2'));var timeout=require(_0x7aae('0x3'));var express=require(_0x7aae('0x4'));var router=express[_0x7aae('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7aae('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7aae('0x7'));router[_0x7aae('0x8')]('/',auth['isAuthenticated'](),controller[_0x7aae('0x9')]);router[_0x7aae('0x8')](_0x7aae('0xa'),auth[_0x7aae('0xb')](),controller[_0x7aae('0xc')]);router[_0x7aae('0x8')](_0x7aae('0xd'),auth[_0x7aae('0xb')](),controller[_0x7aae('0xe')]);router[_0x7aae('0x8')]('/:id/unread',auth[_0x7aae('0xb')](),controller['getUnread']);router[_0x7aae('0x8')]('/:id/members',auth[_0x7aae('0xb')](),controller['getMembers']);router[_0x7aae('0x8')](_0x7aae('0xf'),auth[_0x7aae('0xb')](),controller[_0x7aae('0x10')]);router[_0x7aae('0x11')]('/',auth[_0x7aae('0xb')](),controller[_0x7aae('0x12')]);router[_0x7aae('0x11')]('/:id/members',auth['isAuthenticated'](),controller[_0x7aae('0x13')]);router[_0x7aae('0x11')](_0x7aae('0xf'),auth[_0x7aae('0xb')](),controller[_0x7aae('0x14')]);router[_0x7aae('0x15')](_0x7aae('0xd'),auth[_0x7aae('0xb')](),controller[_0x7aae('0x16')]);router[_0x7aae('0x17')](_0x7aae('0xd'),auth[_0x7aae('0xb')](),controller[_0x7aae('0x18')]);router[_0x7aae('0x17')](_0x7aae('0x19'),auth[_0x7aae('0xb')](),controller[_0x7aae('0x1a')]);module[_0x7aae('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 1d6c359..266427d 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 _0x2dab=['ENUM','star','TEXT','DATE','STRING','out','sequelize','INTEGER'];(function(_0x112585,_0x5017b){var _0x38809f=function(_0x24f315){while(--_0x24f315){_0x112585['push'](_0x112585['shift']());}};_0x38809f(++_0x5017b);}(_0x2dab,0xa6));var _0xb2da=function(_0x41098d,_0x83e6fd){_0x41098d=_0x41098d-0x0;var _0x4eede5=_0x2dab[_0x41098d];return _0x4eede5;};'use strict';var Sequelize=require(_0xb2da('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xb2da('0x1')]},'ratingType':{'type':Sequelize[_0xb2da('0x2')](_0xb2da('0x3'),'thumb'),'defaultValue':_0xb2da('0x3')},'ratingMessage':{'type':Sequelize[_0xb2da('0x4')]},'pathTranscript':{'type':Sequelize[_0xb2da('0x4')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xb2da('0x5')]},'disposition':{'type':Sequelize[_0xb2da('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb2da('0x6')]},'note':{'type':Sequelize[_0xb2da('0x6')]},'browserName':{'type':Sequelize[_0xb2da('0x6')]},'browserVersion':{'type':Sequelize[_0xb2da('0x6')]},'osName':{'type':Sequelize[_0xb2da('0x6')]},'osVersion':{'type':Sequelize[_0xb2da('0x6')]},'deviceModel':{'type':Sequelize[_0xb2da('0x6')]},'deviceVendor':{'type':Sequelize[_0xb2da('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xb2da('0x4')]},'customerIp':{'type':Sequelize[_0xb2da('0x6')]},'formData':{'type':Sequelize[_0xb2da('0x4')]('long')},'read1stAt':{'type':Sequelize[_0xb2da('0x5')]},'lastMsgAt':{'type':Sequelize[_0xb2da('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xb2da('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xb2da('0x6')]},'customerPort':{'type':Sequelize[_0xb2da('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xb2da('0x1')]}}; \ No newline at end of file +var _0x12bc=['STRING','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','DATE'];(function(_0x30cd33,_0x1d5b60){var _0x2f34b3=function(_0x17026d){while(--_0x17026d){_0x30cd33['push'](_0x30cd33['shift']());}};_0x2f34b3(++_0x1d5b60);}(_0x12bc,0x7b));var _0xc12b=function(_0x52ba6e,_0x4a1513){_0x52ba6e=_0x52ba6e-0x0;var _0x51668d=_0x12bc[_0x52ba6e];return _0x51668d;};'use strict';var Sequelize=require(_0xc12b('0x0'));module[_0xc12b('0x1')]={'closed':{'type':Sequelize[_0xc12b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc12b('0x3')]},'ratingType':{'type':Sequelize[_0xc12b('0x4')](_0xc12b('0x5'),_0xc12b('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xc12b('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc12b('0x8')]},'disposition':{'type':Sequelize[_0xc12b('0x9')]},'secondDisposition':{'type':Sequelize[_0xc12b('0x9')]},'thirdDisposition':{'type':Sequelize[_0xc12b('0x9')]},'note':{'type':Sequelize[_0xc12b('0x9')]},'browserName':{'type':Sequelize[_0xc12b('0x9')]},'browserVersion':{'type':Sequelize[_0xc12b('0x9')]},'osName':{'type':Sequelize[_0xc12b('0x9')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xc12b('0x9')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xc12b('0x7')]},'customerIp':{'type':Sequelize[_0xc12b('0x9')]},'formData':{'type':Sequelize[_0xc12b('0x7')](_0xc12b('0xa'))},'read1stAt':{'type':Sequelize[_0xc12b('0x8')]},'lastMsgAt':{'type':Sequelize[_0xc12b('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xc12b('0x4')]('in',_0xc12b('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc12b('0x9')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xc12b('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xc12b('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 12708f7..4deea52 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 _0xb5fa=['stack','name','render','merge','body','contact','agent','interaction','account','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','chat','user','show','params','model','keys','query','filters','intersection','attributes','fields','length','options','create','find','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','mimetype','Attachment','Unauthorized','join','server/files/attachments/','offline-chat/','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','ContactId','Messages','UserId','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','alias','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','getSmtpOptions','SendMail','Smtp','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','hasOwnProperty','nolimit','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','rows','getMyMessages','order','push','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','toString','server','files','tmp','attachments','transcript-%d-%s.zip','lastName','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','N.A.','tail','pipe','createdAt','direction','out','Contact','read','value','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','api','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','sendStatus'];(function(_0xbec8e6,_0x2841b5){var _0x4aa6f2=function(_0x583a0a){while(--_0x583a0a){_0xbec8e6['push'](_0xbec8e6['shift']());}};_0x4aa6f2(++_0x2841b5);}(_0xb5fa,0xa4));var _0xab5f=function(_0x3c56ad,_0x433da6){_0x3c56ad=_0x3c56ad-0x0;var _0xf60426=_0xb5fa[_0x3c56ad];return _0xf60426;};'use strict';var rimraf=require(_0xab5f('0x0'));var zipdir=require(_0xab5f('0x1'));var rp=require(_0xab5f('0x2'));var moment=require(_0xab5f('0x3'));var BPromise=require(_0xab5f('0x4'));var Mustache=require(_0xab5f('0x5'));var util=require(_0xab5f('0x6'));var path=require(_0xab5f('0x7'));var ejs=require(_0xab5f('0x8'));var fs=require('fs');var _=require(_0xab5f('0x9'));var Redis=require(_0xab5f('0xa'));var interaction=require('../../components/interaction/service');var qs=require(_0xab5f('0xb'));var pdf=require(_0xab5f('0xc'));var logger=require('../../config/logger')(_0xab5f('0xd'));var config=require('../../config/environment');var db=require(_0xab5f('0xe'))['db'];config['redis']=_[_0xab5f('0xf')](config[_0xab5f('0x10')],{'host':_0xab5f('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xab5f('0x12'))[_0xab5f('0x13')](socket);var jayson=require(_0xab5f('0x14'));var client=jayson[_0xab5f('0x15')][_0xab5f('0x16')]({'port':0x232b});var client9004=jayson[_0xab5f('0x15')]['http']({'port':0x232c});function respondWithRpcPromise(_0x392bfb,_0x1175a0,_0x1e3e96,_0x455a34){return new BPromise(function(_0xd64dab,_0x4230ba){var _0x447701=_0x455a34||client;return _0x447701[_0xab5f('0x17')](_0x392bfb,_0x1e3e96)[_0xab5f('0x18')](function(_0x3e75bb){logger[_0xab5f('0x19')](_0xab5f('0x1a'),_0x1175a0,_0xab5f('0x1b'));logger[_0xab5f('0x1c')](_0xab5f('0x1d'),_0x1175a0,'request\x20sent',JSON[_0xab5f('0x1e')](_0x3e75bb));if(_0x3e75bb[_0xab5f('0x1f')]){if(_0x3e75bb[_0xab5f('0x1f')][_0xab5f('0x20')]===0x1f4){logger[_0xab5f('0x1f')](_0xab5f('0x1a'),_0x1175a0,_0x3e75bb['error']['message']);return _0x4230ba(_0x3e75bb[_0xab5f('0x1f')][_0xab5f('0x21')]);}logger[_0xab5f('0x1f')](_0xab5f('0x1a'),_0x1175a0,_0x3e75bb[_0xab5f('0x1f')][_0xab5f('0x21')]);return _0xd64dab(_0x3e75bb[_0xab5f('0x1f')]['message']);}else{logger[_0xab5f('0x19')](_0xab5f('0x1a'),_0x1175a0,_0xab5f('0x1b'));_0xd64dab(_0x3e75bb[_0xab5f('0x22')][_0xab5f('0x21')]);}})[_0xab5f('0x23')](function(_0x1290a6){logger[_0xab5f('0x1f')](_0xab5f('0x1a'),_0x1175a0,_0x1290a6);_0x4230ba(_0x1290a6);});});}function respondWithStatusCode(_0x5883bb,_0x39cc2e){_0x39cc2e=_0x39cc2e||0xcc;return function(_0xdd23bc){if(_0xdd23bc){return _0x5883bb['sendStatus'](_0x39cc2e);}return _0x5883bb[_0xab5f('0x24')](_0x39cc2e)[_0xab5f('0x25')]();};}function respondWithResult(_0x39506f,_0x1c3a5d){_0x1c3a5d=_0x1c3a5d||0xc8;return function(_0x4d3711){if(_0x4d3711){return _0x39506f[_0xab5f('0x24')](_0x1c3a5d)[_0xab5f('0x26')](_0x4d3711);}};}function respondWithFilteredResult(_0x264bfb,_0x125230){return function(_0x2228be){if(_0x2228be){var _0x2dd35a=typeof _0x125230[_0xab5f('0x27')]===_0xab5f('0x28')&&typeof _0x125230[_0xab5f('0x29')]===_0xab5f('0x28');var _0x523dbc=_0x2228be[_0xab5f('0x2a')];var _0x5156b=_0x2dd35a?0x0:_0x125230[_0xab5f('0x27')];var _0x4852e7=_0x2dd35a?_0x2228be[_0xab5f('0x2a')]:_0x125230[_0xab5f('0x27')]+_0x125230[_0xab5f('0x29')];var _0x4c33e3;if(_0x4852e7>=_0x523dbc){_0x4852e7=_0x523dbc;_0x4c33e3=0xc8;}else{_0x4c33e3=0xce;}_0x264bfb[_0xab5f('0x24')](_0x4c33e3);return _0x264bfb[_0xab5f('0x2b')](_0xab5f('0x2c'),_0x5156b+'-'+_0x4852e7+'/'+_0x523dbc)[_0xab5f('0x26')](_0x2228be);}return null;};}function saveUpdates(_0x5afb7c){return function(_0x255dc0){if(_0x255dc0){return _0x255dc0[_0xab5f('0x2d')](_0x5afb7c)['then'](function(_0x2373d6){return _0x2373d6;});}return null;};}function removeEntity(_0x302885){return function(_0x485eb7){if(_0x485eb7){return _0x485eb7[_0xab5f('0x2e')]()['then'](function(){_0x302885[_0xab5f('0x24')](0xcc)[_0xab5f('0x25')]();});}};}function handleEntityNotFound(_0x3b6764){return function(_0x2e8ffd){if(!_0x2e8ffd){_0x3b6764[_0xab5f('0x2f')](0x194);}return _0x2e8ffd;};}function handleError(_0x27e9e7,_0x52df27){_0x52df27=_0x52df27||0x1f4;return function(_0x44371a){logger[_0xab5f('0x1f')](_0x44371a[_0xab5f('0x30')]);if(_0x44371a[_0xab5f('0x31')]){delete _0x44371a[_0xab5f('0x31')];}_0x27e9e7[_0xab5f('0x24')](_0x52df27)['send'](_0x44371a);};}function getMustacheRender(_0x34d1b9,_0xfc4cc1){return Mustache[_0xab5f('0x32')](_0x34d1b9,_[_0xab5f('0x33')](_0xfc4cc1[_0xab5f('0x34')],{'contact':_0xfc4cc1[_0xab5f('0x35')],'message':_0xfc4cc1[_0xab5f('0x21')],'agent':_0xfc4cc1[_0xab5f('0x36')],'interaction':_0xfc4cc1[_0xab5f('0x37')],'account':_0xfc4cc1[_0xab5f('0x38')]}))||'';}exports['index']=function(_0x4c5281,_0x5fed59){var _0x24641f={};var _0x56a08b=_[_0xab5f('0x39')](db[_0xab5f('0x3a')][_0xab5f('0x3b')],function(_0x213958){return{'name':_0x213958[_0xab5f('0x3c')],'type':_0x213958[_0xab5f('0x3d')][_0xab5f('0x3e')]};});_0x24641f=qs[_0xab5f('0x3f')](_0x56a08b,_0x4c5281);return interaction['findAll'](_0xab5f('0x40'),_0x4c5281['query'],_0x4c5281[_0xab5f('0x41')],_0x24641f,_0x56a08b)[_0xab5f('0x18')](respondWithFilteredResult(_0x5fed59,_0x24641f))['catch'](handleError(_0x5fed59,null));};exports[_0xab5f('0x42')]=function(_0x241568,_0x554f20){var _0x4c1315={'raw':![],'where':{'id':_0x241568[_0xab5f('0x43')]['id']}},_0x5725a1={};_0x5725a1[_0xab5f('0x44')]=_[_0xab5f('0x45')](db[_0xab5f('0x3a')][_0xab5f('0x3b')]);_0x5725a1[_0xab5f('0x46')]=_[_0xab5f('0x45')](_0x241568['query']);_0x5725a1[_0xab5f('0x47')]=_[_0xab5f('0x48')](_0x5725a1[_0xab5f('0x44')],_0x5725a1[_0xab5f('0x46')]);_0x4c1315[_0xab5f('0x49')]=_[_0xab5f('0x48')](_0x5725a1[_0xab5f('0x44')],qs['fields'](_0x241568['query'][_0xab5f('0x4a')]));_0x4c1315[_0xab5f('0x49')]=_0x4c1315['attributes'][_0xab5f('0x4b')]?_0x4c1315[_0xab5f('0x49')]:_0x5725a1[_0xab5f('0x44')];if(_0x241568[_0xab5f('0x46')]['includeAll']){_0x4c1315['include']=[{'all':!![]}];}_0x4c1315=_[_0xab5f('0x33')]({},_0x4c1315,_0x241568[_0xab5f('0x4c')]);return db['ChatInteraction']['find'](_0x4c1315)['then'](handleEntityNotFound(_0x554f20,null))['then'](respondWithResult(_0x554f20,null))['catch'](handleError(_0x554f20,null));};exports['create']=function(_0x176494,_0x1d0e02){return db[_0xab5f('0x3a')][_0xab5f('0x4d')](_0x176494[_0xab5f('0x34')],{})[_0xab5f('0x18')](respondWithResult(_0x1d0e02,0xc9))['catch'](handleError(_0x1d0e02,null));};exports[_0xab5f('0x2d')]=function(_0x200a37,_0x314526){if(_0x200a37[_0xab5f('0x34')]['id']){delete _0x200a37[_0xab5f('0x34')]['id'];}return db['ChatInteraction'][_0xab5f('0x4e')]({'where':{'id':_0x200a37['params']['id']}})[_0xab5f('0x18')](handleEntityNotFound(_0x314526,null))[_0xab5f('0x18')](saveUpdates(_0x200a37['body'],null))['then'](respondWithResult(_0x314526,null))['catch'](handleError(_0x314526,null));};exports[_0xab5f('0x2e')]=function(_0x43f2f9,_0x2676a3){return db['ChatInteraction'][_0xab5f('0x4e')]({'where':{'id':_0x43f2f9[_0xab5f('0x43')]['id']}})[_0xab5f('0x18')](handleEntityNotFound(_0x2676a3,null))['then'](removeEntity(_0x2676a3,null))[_0xab5f('0x23')](handleError(_0x2676a3,null));};exports['describe']=function(_0xc4b139,_0x2b915b){return db[_0xab5f('0x3a')][_0xab5f('0x4f')]()[_0xab5f('0x18')](respondWithResult(_0x2b915b,null))[_0xab5f('0x23')](handleError(_0x2b915b,null));};exports['createVidaooSession']=function(_0x5bd3ec,_0x4775db){var _0x142feb=_0x5bd3ec['params']['id'];var _0x4e056a;var _0x415aac;var _0x5f5d57;return db[_0xab5f('0x3a')][_0xab5f('0x50')]({'where':{'id':_0x142feb}})[_0xab5f('0x18')](function(_0xad326a){_0x4e056a=_0xad326a;return db[_0xab5f('0x51')]['findOne']({'where':{'id':_0xad326a[_0xab5f('0x52')]},'attributes':['id',_0xab5f('0x53'),_0xab5f('0x54'),_0xab5f('0x55'),_0xab5f('0x56'),_0xab5f('0x57')],'raw':!![]});})[_0xab5f('0x18')](function(_0x2a51e2){if(_0x2a51e2&&_0x2a51e2[_0xab5f('0x53')]&&_0x2a51e2[_0xab5f('0x54')]){_0x415aac=_0x2a51e2;var _0x5852ec={'interaction':{'id':_0x142feb},'agent':{'id':_0x5bd3ec['user']['id'],'name':_0x5bd3ec['user']['name'],'fullname':_0x5bd3ec[_0xab5f('0x41')][_0xab5f('0x58')],'email':_0x5bd3ec[_0xab5f('0x41')][_0xab5f('0x59')]},'contact':_0x5bd3ec[_0xab5f('0x34')][_0xab5f('0x35')],'account':_0x5bd3ec[_0xab5f('0x34')]['account']};var _0x359ba6={'rejectUnauthorized':![],'method':_0xab5f('0x5a'),'url':_0xab5f('0x5b'),'headers':{'X-APIKEY':_0x2a51e2['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5bd3ec[_0xab5f('0x41')][_0xab5f('0x59')]],'buttons':null,'topic':_0x415aac[_0xab5f('0x55')],'note':_[_0xab5f('0x5c')](_0x415aac[_0xab5f('0x56')])?null:getMustacheRender(_0x415aac[_0xab5f('0x56')],_0x5852ec),'metadata':null},'redirect':_0xab5f('0x5d'),'json':!![]};try{if(!_[_0xab5f('0x5c')](_0x415aac[_0xab5f('0x57')])){var _0x129175=getMustacheRender(_0x415aac[_0xab5f('0x57')],_0x5852ec);var _0x40825e=JSON[_0xab5f('0x5e')](_0x129175);_0x359ba6['body']['metadata']=_0x40825e;}}catch(_0xd2ecf){throw new db[(_0xab5f('0x5f'))][(_0xab5f('0x60'))](_0xab5f('0x61'));}return rp(_0x359ba6);}else{throw new db[(_0xab5f('0x5f'))]['ValidationError'](_0xab5f('0x62'));}})[_0xab5f('0x18')](function(_0x479ffc){_0x5f5d57=_0x479ffc;if(_0x5f5d57['id']){var _0x52323e={'body':_0x5f5d57[_0xab5f('0x63')],'ChatWebsiteId':_0x415aac['id'],'ChatInteractionId':_0x4e056a['id'],'direction':'out','UserId':_0x5bd3ec[_0xab5f('0x41')]['id']};return db[_0xab5f('0x64')][_0xab5f('0x4d')](_0x52323e,{});}else{throw new db[(_0xab5f('0x5f'))][(_0xab5f('0x60'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x4e056a[_0xab5f('0x65')]({'vidaooSessionId':_0x5f5d57['id']});})['then'](respondWithResult(_0x4775db,null))[_0xab5f('0x23')](handleError(_0x4775db,null));};exports[_0xab5f('0x66')]=function(_0x3e745e,_0x139c8d){if(_0x3e745e['body']['id']){delete _0x3e745e[_0xab5f('0x34')]['id'];}return db[_0xab5f('0x3a')][_0xab5f('0x4e')]({'where':{'id':_0x3e745e['params']['id']},'include':[{'model':db[_0xab5f('0x67')],'as':'Contact'}]})[_0xab5f('0x18')](handleEntityNotFound(_0x139c8d,null))[_0xab5f('0x18')](saveUpdates(_0x3e745e['body'],null))[_0xab5f('0x18')](respondWithResult(_0x139c8d,null))[_0xab5f('0x23')](handleError(_0x139c8d,null));};exports[_0xab5f('0x68')]=function(_0x13a41b,_0x2b8a6b){if(_0x13a41b[_0xab5f('0x34')]['id']){delete _0x13a41b[_0xab5f('0x34')]['id'];}return db[_0xab5f('0x3a')]['find']({'where':{'id':_0x13a41b[_0xab5f('0x43')]['id']}})['then'](function(_0x29a4e4){if(!_0x29a4e4){logger[_0xab5f('0x1f')](_0xab5f('0x69'),_0xab5f('0x68'),0x194,_0xab5f('0x6a'));_0x2b8a6b[_0xab5f('0x2f')](0x194);}else{if(_0x29a4e4['UserId']){throw new db['Sequelize'][(_0xab5f('0x60'))](_0xab5f('0x6b'));}}return _0x29a4e4;})['then'](function(_0x137f19){if(_0x137f19){return _0x137f19[_0xab5f('0x2d')]({'closed':_0x13a41b[_0xab5f('0x34')][_0xab5f('0x6c')],'disposition':_0x13a41b[_0xab5f('0x34')][_0xab5f('0x6d')]})[_0xab5f('0x18')](function(_0x213efd){return _0x213efd;});}})[_0xab5f('0x18')](function(){return respondWithRpcPromise(_0xab5f('0x6e'),'abandon',_0x13a41b['body'],client9004);})[_0xab5f('0x18')](respondWithResult(_0x2b8a6b,null))[_0xab5f('0x23')](handleError(_0x2b8a6b,null));};exports[_0xab5f('0x6f')]=function(_0x4dafdc,_0x49ebcf){_0x4dafdc[_0xab5f('0x34')][_0xab5f('0x31')]=_0x4dafdc[_0xab5f('0x70')]['originalname'];_0x4dafdc[_0xab5f('0x34')][_0xab5f('0x71')]=_0x4dafdc[_0xab5f('0x70')][_0xab5f('0x72')];_0x4dafdc[_0xab5f('0x34')][_0xab5f('0x3d')]=_0x4dafdc[_0xab5f('0x70')][_0xab5f('0x73')];return db[_0xab5f('0x74')][_0xab5f('0x4d')](_0x4dafdc[_0xab5f('0x34')])['then'](respondWithResult(_0x49ebcf,0xc9))[_0xab5f('0x23')](handleError(_0x49ebcf,null));};exports['attachmentDownload']=function(_0x14b0f2,_0x106a52){return db[_0xab5f('0x3a')][_0xab5f('0x50')]({'where':{'id':_0x14b0f2[_0xab5f('0x43')]['id']},'raw':!![]})[_0xab5f('0x18')](handleEntityNotFound(_0x106a52,null))[_0xab5f('0x18')](function(_0x2b83e4){if(_0x2b83e4){if(_0x2b83e4[_0xab5f('0x6c')]){return _0x106a52[_0xab5f('0x24')](0x193)[_0xab5f('0x26')]({'status':0x193,'message':_0xab5f('0x75')});}return db[_0xab5f('0x74')][_0xab5f('0x50')]({'where':{'id':_0x14b0f2[_0xab5f('0x46')]['attachId']},'raw':!![]})[_0xab5f('0x18')](handleEntityNotFound(_0x106a52,null));}})[_0xab5f('0x18')](function(_0x1b9d11){if(_0x1b9d11){var _0x1d9d8c=_0x1b9d11['ChatOfflineMessageId']!==null;var _0xe41ce0=path[_0xab5f('0x76')](config['root'],_0xab5f('0x77'));if(_0x1d9d8c){_0xe41ce0=path[_0xab5f('0x76')](_0xe41ce0,_0xab5f('0x78'));}var _0x46a61d=path[_0xab5f('0x76')](_0xe41ce0,_0x1b9d11[_0xab5f('0x71')]);return _0x106a52['download'](_0x46a61d);}})[_0xab5f('0x23')](handleError(_0x106a52,null));};exports[_0xab5f('0x79')]=function(_0x4bdbbb,_0x3e479e){var _0x394bc0=null;var _0x1426e3=null;var _0x1331af=null;if(_0x4bdbbb[_0xab5f('0x34')]['id']){delete _0x4bdbbb['body']['id'];}if(_0x4bdbbb['body'][_0xab5f('0x7a')]){_0x1331af=path[_0xab5f('0x76')](config[_0xab5f('0x7b')],_0xab5f('0x7c'),util[_0xab5f('0x7d')](_0xab5f('0x7e'),Date[_0xab5f('0x7f')]()));_0x4bdbbb[_0xab5f('0x34')][_0xab5f('0x80')]=_0x1331af;}return db[_0xab5f('0x3a')]['find']({'where':{'id':_0x4bdbbb[_0xab5f('0x43')]['id']},'include':[{'model':db[_0xab5f('0x64')],'as':'Messages','include':[{'model':db[_0xab5f('0x81')],'as':'User'}]}]})[_0xab5f('0x18')](handleEntityNotFound(_0x3e479e,null))['then'](saveUpdates(_0x4bdbbb[_0xab5f('0x34')],null))[_0xab5f('0x18')](function(_0x4095f1){if(_0x4095f1){_0x394bc0=_0x4095f1;return db['ChatWebsite'][_0xab5f('0x4e')]({'where':{'id':_0x394bc0[_0xab5f('0x52')]}});}})[_0xab5f('0x18')](function(_0x51b616){if(_0x51b616){_0x1426e3=_0x51b616;return db[_0xab5f('0x67')]['find']({'where':{'id':_0x394bc0[_0xab5f('0x82')]}});}})[_0xab5f('0x18')](function(_0xf6e38c){if(_0xf6e38c){if(_0x1331af){var _0x32dee6=null;for(var _0x193663=0x1;_0x193663<_0x394bc0[_0xab5f('0x83')][_0xab5f('0x4b')];++_0x193663){_0x32dee6=_0x394bc0['Messages'][_0x193663];var _0x3cccd7=_0x32dee6[_0xab5f('0x84')]?util['format'](_0xab5f('0x85'),_0x1426e3[_0xab5f('0x86')],_0x32dee6[_0xab5f('0x84')]):_0xab5f('0x87');var _0x3f8362=_0x4bdbbb['body'][_0xab5f('0x88')]||util[_0xab5f('0x7d')](_0xab5f('0x85'),'Visitor',_0x32dee6['ContactId']);switch(_0x1426e3[_0xab5f('0x89')]){case _0xab5f('0x8a'):_0x3cccd7=_0x32dee6[_0xab5f('0x84')]?util[_0xab5f('0x7d')]('%s%d',_0x1426e3[_0xab5f('0x86')],_0x32dee6[_0xab5f('0x84')]):_0xab5f('0x87');break;case'agent_alias':_0x3cccd7=_0x32dee6['UserId']?_0x32dee6['User'][_0xab5f('0x8b')]||_0x32dee6['User'][_0xab5f('0x58')]:_0xab5f('0x87');break;case'agent_fullname':_0x3cccd7=_0x32dee6[_0xab5f('0x84')]?_0x32dee6[_0xab5f('0x81')][_0xab5f('0x58')]:_0xab5f('0x87');break;default:_0x3cccd7=_0x32dee6['UserId']?util[_0xab5f('0x7d')]('%s%d',_0x1426e3['agentAlias'],_0x32dee6[_0xab5f('0x84')]):_0xab5f('0x87');}var _0x2e4850=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x32dee6['createdAt'])[_0xab5f('0x7d')](_0xab5f('0x8c')),_0x32dee6['direction']==='in'?_0x3f8362:_0x3cccd7,_0x32dee6[_0xab5f('0x34')]);if(!_0x32dee6[_0xab5f('0x8d')]){fs[_0xab5f('0x8e')](_0x1331af,_0x2e4850);}}return db[_0xab5f('0x8f')][_0xab5f('0x50')]({'where':{'service':!![]},'include':[{'model':db[_0xab5f('0x90')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xab5f('0x91')],'as':_0xab5f('0x91'),'raw':!![]}]}]});}}})['then'](function(_0x142e22){if(!_0x142e22||!_0x142e22['Smtp']||!_0x4bdbbb[_0xab5f('0x34')])return _0x394bc0;var _0x123ea4=_0x142e22[_0xab5f('0x92')]();return respondWithRpcPromise(_0xab5f('0x93'),'sendMail',{'account':_0x123ea4,'message':{'from':util[_0xab5f('0x7d')]('\x22%s\x22\x20<%s>',_0x142e22[_0xab5f('0x31')],_0x142e22[_0xab5f('0x59')]||_0x142e22[_0xab5f('0x94')]['user']),'to':_0x4bdbbb[_0xab5f('0x34')][_0xab5f('0x7a')],'subject':_0xab5f('0x95'),'text':util[_0xab5f('0x7d')](_0xab5f('0x96'),_0x4bdbbb[_0xab5f('0x34')][_0xab5f('0x7a')]),'attachments':[{'path':_0x1331af}]}})['then'](function(){return _0x394bc0;})[_0xab5f('0x23')](function(_0x9a5f13){logger[_0xab5f('0x1f')](_0x9a5f13);});})[_0xab5f('0x18')](respondWithStatusCode(_0x3e479e,0xc8))['catch'](handleError(_0x3e479e,null));};exports[_0xab5f('0x97')]=function(_0x3d0fdf,_0x487c08){return db[_0xab5f('0x64')][_0xab5f('0x4e')]({'where':{'id':_0x3d0fdf[_0xab5f('0x43')]['id']}})[_0xab5f('0x18')](handleEntityNotFound(_0x487c08,null))['then'](function(_0x29ee68){if(_0x29ee68){return _0x29ee68[_0xab5f('0x97')](_0x3d0fdf[_0xab5f('0x34')][_0xab5f('0x98')],_['omit'](_0x3d0fdf[_0xab5f('0x34')],[_0xab5f('0x98'),'id'])||{});}})['then'](respondWithResult(_0x487c08,null))[_0xab5f('0x23')](handleError(_0x487c08,null));};exports[_0xab5f('0x99')]=function(_0x3ceef0,_0x1617e9){var _0x2dd168={'raw':![],'where':{}};var _0xd8be91={};var _0x5a7dc1={'count':0x0,'rows':[]};return db[_0xab5f('0x3a')]['findOne']({'where':{'id':_0x3ceef0['params']['id']}})[_0xab5f('0x18')](handleEntityNotFound(_0x1617e9,null))[_0xab5f('0x18')](function(_0x1bd109){if(_0x1bd109){_0xd8be91[_0xab5f('0x44')]=_['keys'](db['ChatMessage'][_0xab5f('0x3b')]);_0xd8be91[_0xab5f('0x46')]=_[_0xab5f('0x45')](_0x3ceef0[_0xab5f('0x46')]);_0xd8be91[_0xab5f('0x47')]=_[_0xab5f('0x48')](_0xd8be91[_0xab5f('0x44')],_0xd8be91[_0xab5f('0x46')]);_0x2dd168[_0xab5f('0x49')]=_[_0xab5f('0x48')](_0xd8be91[_0xab5f('0x44')],qs[_0xab5f('0x4a')](_0x3ceef0[_0xab5f('0x46')][_0xab5f('0x4a')]));_0x2dd168[_0xab5f('0x49')]=_0x2dd168['attributes'][_0xab5f('0x4b')]?_0x2dd168[_0xab5f('0x49')]:_0xd8be91[_0xab5f('0x44')];if(!_0x3ceef0['query'][_0xab5f('0x9a')](_0xab5f('0x9b'))){_0x2dd168[_0xab5f('0x29')]=qs[_0xab5f('0x29')](_0x3ceef0[_0xab5f('0x46')][_0xab5f('0x29')]);_0x2dd168[_0xab5f('0x27')]=qs[_0xab5f('0x27')](_0x3ceef0['query'][_0xab5f('0x27')]);}_0x2dd168['order']=qs[_0xab5f('0x9c')](_0x3ceef0[_0xab5f('0x46')]['sort']);_0x2dd168[_0xab5f('0x9d')]=qs['filters'](_[_0xab5f('0x9e')](_0x3ceef0['query'],_0xd8be91[_0xab5f('0x47')]));_0x2dd168[_0xab5f('0x9d')][_0xab5f('0x9f')]=_0x1bd109['id'];if(_0x3ceef0[_0xab5f('0x46')][_0xab5f('0xa0')]){_0x2dd168['where']=_['merge'](_0x2dd168[_0xab5f('0x9d')],{'$or':_['map'](_0x2dd168[_0xab5f('0x49')],function(_0x49033a){var _0x3e62b5={};_0x3e62b5[_0x49033a]={'$like':'%'+_0x3ceef0['query'][_0xab5f('0xa0')]+'%'};return _0x3e62b5;})});}if(_0x3ceef0[_0xab5f('0x46')][_0xab5f('0xa1')]){var _0x5188ff=_0x3ceef0['query'][_0xab5f('0xa1')][_0xab5f('0xa2')](',');var _0x5a28fa={};_0x5a28fa[_0x5188ff[0x0]]={'$gte':moment(_0x5188ff[0x1])[_0xab5f('0x7d')](_0xab5f('0xa3'))};_0x2dd168['where']=_[_0xab5f('0x33')](_0x2dd168['where'],_0x5a28fa);}_0x2dd168=_[_0xab5f('0x33')]({},_0x2dd168,_0x3ceef0[_0xab5f('0x4c')]);return db[_0xab5f('0x64')][_0xab5f('0x2a')]({'where':_0x2dd168['where']})[_0xab5f('0x18')](function(_0xca182b){_0x5a7dc1[_0xab5f('0x2a')]=_0xca182b;if(_0x3ceef0[_0xab5f('0x46')][_0xab5f('0xa4')]){_0x2dd168[_0xab5f('0xa5')]=[{'all':!![]}];}return db['ChatMessage'][_0xab5f('0xa6')](_0x2dd168);})['then'](function(_0x4a9f5e){_0x5a7dc1[_0xab5f('0xa7')]=_0x4a9f5e;return _0x5a7dc1;});}})[_0xab5f('0x18')](respondWithFilteredResult(_0x1617e9,_0x2dd168))[_0xab5f('0x23')](handleError(_0x1617e9,null));};exports[_0xab5f('0xa8')]=function(_0x5095c8,_0x355b4d){var _0x556a03={'where':{}},_0x1ebfec={},_0x239e1b={'count':0x0,'rows':[]};return db[_0xab5f('0x3a')][_0xab5f('0x50')]({'where':{'id':_0x5095c8[_0xab5f('0x43')]['id']}})['then'](handleEntityNotFound(_0x355b4d,null))[_0xab5f('0x18')](function(_0xc7a5ae){if(_0xc7a5ae){_0x1ebfec[_0xab5f('0x44')]=_[_0xab5f('0x45')](db[_0xab5f('0x64')][_0xab5f('0x3b')]);_0x1ebfec['query']=_[_0xab5f('0x45')](_0x5095c8[_0xab5f('0x46')]);_0x1ebfec[_0xab5f('0x47')]=_[_0xab5f('0x48')](_0x1ebfec[_0xab5f('0x44')],_0x1ebfec['query']);_0x556a03[_0xab5f('0x49')]=_[_0xab5f('0x48')](_0x1ebfec['model'],qs[_0xab5f('0x4a')](_0x5095c8['query'][_0xab5f('0x4a')]));_0x556a03[_0xab5f('0x49')]=_0x556a03[_0xab5f('0x49')][_0xab5f('0x4b')]?_0x556a03[_0xab5f('0x49')]:_0x1ebfec[_0xab5f('0x44')];if(!_0x5095c8[_0xab5f('0x46')]['hasOwnProperty'](_0xab5f('0x9b'))){_0x556a03[_0xab5f('0x29')]=qs[_0xab5f('0x29')](_0x5095c8[_0xab5f('0x46')][_0xab5f('0x29')]);_0x556a03[_0xab5f('0x27')]=qs[_0xab5f('0x27')](_0x5095c8[_0xab5f('0x46')][_0xab5f('0x27')]);}_0x556a03[_0xab5f('0xa9')]=qs[_0xab5f('0x9c')](_0x5095c8['query'][_0xab5f('0x9c')]);_0x556a03[_0xab5f('0x9d')]=qs[_0xab5f('0x47')](_[_0xab5f('0x9e')](_0x5095c8[_0xab5f('0x46')],_0x1ebfec[_0xab5f('0x47')]));_0x556a03['where'][_0xab5f('0x9f')]=_0xc7a5ae['id'];if(_0x5095c8['query']['filter']){_0x556a03[_0xab5f('0x9d')]=_[_0xab5f('0x33')](_0x556a03[_0xab5f('0x9d')],{'$or':_[_0xab5f('0x39')](_0x556a03[_0xab5f('0x49')],function(_0x8160a6){var _0x55923={};_0x55923[_0x8160a6]={'$like':'%'+_0x5095c8[_0xab5f('0x46')][_0xab5f('0xa0')]+'%'};return _0x55923;})});}_0x556a03[_0xab5f('0x9d')][_0xab5f('0x8d')]=![];if(_0x5095c8[_0xab5f('0x46')]['id']){_0x556a03['where']['id']={'$gt':_0x5095c8[_0xab5f('0x46')]['id']};}_0x556a03=_[_0xab5f('0x33')]({},_0x556a03,_0x5095c8[_0xab5f('0x4c')]);return db[_0xab5f('0x64')][_0xab5f('0x2a')]({'where':_0x556a03[_0xab5f('0x9d')]})[_0xab5f('0x18')](function(_0x1e449a){_0x239e1b['count']=_0x1e449a;_0x556a03['include']=[];if(_0x5095c8[_0xab5f('0x46')]['includeAgent']){_0x556a03[_0xab5f('0xa5')][_0xab5f('0xaa')]({'model':db['User'],'as':'User','attributes':['id',_0xab5f('0x58'),_0xab5f('0x8b')]});}if(_0x5095c8[_0xab5f('0x46')][_0xab5f('0xa4')]){_0x556a03['include']=[{'all':!![]}];}return db['ChatMessage'][_0xab5f('0xa6')](_0x556a03);})[_0xab5f('0x18')](function(_0x4e470b){_0x239e1b[_0xab5f('0xa7')]=_0x4e470b;return _0x239e1b;});}})[_0xab5f('0x18')](respondWithFilteredResult(_0x355b4d,_0x556a03))[_0xab5f('0x23')](handleError(_0x355b4d,null));};exports[_0xab5f('0xab')]=function(_0x5947a4,_0x3fa337){return db['ChatInteraction'][_0xab5f('0x4e')]({'where':{'id':_0x5947a4[_0xab5f('0x43')]['id']}})[_0xab5f('0x18')](handleEntityNotFound(_0x3fa337,null))[_0xab5f('0x18')](function(_0x43f0fa){if(_0x43f0fa){return _0x43f0fa[_0xab5f('0xac')](_0x5947a4['body'][_0xab5f('0x98')],_['omit'](_0x5947a4[_0xab5f('0x34')],[_0xab5f('0x98'),'id'])||{})[_0xab5f('0xad')](function(){return db[_0xab5f('0xae')]['findAll']({'attributes':['id',_0xab5f('0x31'),_0xab5f('0xaf')],'where':{'id':_0x5947a4[_0xab5f('0x34')][_0xab5f('0x98')]}});})[_0xab5f('0x18')](function(_0xf74f1f){socket[_0xab5f('0xb0')](_0xab5f('0xb1'),{'id':Number(_0x5947a4[_0xab5f('0x43')]['id']),'tags':_0xf74f1f||[]});return{'id':Number(_0x5947a4[_0xab5f('0x43')]['id']),'tags':_0xf74f1f||[]};});}})['then'](respondWithResult(_0x3fa337,null))[_0xab5f('0x23')](handleError(_0x3fa337,null));};exports[_0xab5f('0xb2')]=function(_0x4e2be3,_0x3b1ce2){return db['ChatInteraction'][_0xab5f('0x4e')]({'where':{'id':_0x4e2be3[_0xab5f('0x43')]['id']}})[_0xab5f('0x18')](handleEntityNotFound(_0x3b1ce2,null))[_0xab5f('0x18')](function(_0x281d56){if(_0x281d56){return _0x281d56[_0xab5f('0xb2')](_0x4e2be3[_0xab5f('0x46')][_0xab5f('0x98')]);}})['then'](respondWithStatusCode(_0x3b1ce2,null))[_0xab5f('0x23')](handleError(_0x3b1ce2,null));};exports[_0xab5f('0xb3')]=function(_0x29f402,_0x1385b3){var _0x2439ff=moment()['unix']()[_0xab5f('0xb4')]();var _0x3a026a=path[_0xab5f('0x76')](config[_0xab5f('0x7b')],_0xab5f('0xb5'),_0xab5f('0xb6'),_0xab5f('0xb7'));var _0x76c46c=path[_0xab5f('0x76')](config[_0xab5f('0x7b')],_0xab5f('0xb5'),_0xab5f('0xb6'),_0xab5f('0xb8'));var _0x5c6151=path[_0xab5f('0x76')](_0x3a026a,_0x2439ff);var _0x2e76fc=util[_0xab5f('0x7d')](_0xab5f('0xb9'),_0x29f402['params']['id'],_0x2439ff);var _0x1e56bc=path[_0xab5f('0x76')](_0x3a026a,_0x2e76fc);var _0x2357f=[];_0x2357f['push']({'model':db[_0xab5f('0x81')],'as':'User','attributes':['id',_0xab5f('0x58')],'raw':!![]});_0x2357f[_0xab5f('0xaa')]({'model':db[_0xab5f('0x67')],'as':'Contact','attributes':['id','firstName',_0xab5f('0xba')],'raw':!![]});if(_0x29f402['query']['attachments']){_0x2357f[_0xab5f('0xaa')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x38235c=[{'model':db['ChatMessage'],'as':_0xab5f('0x83'),'attributes':['id','body','createdAt','direction','secret','read'],'include':_0x2357f}];_0x38235c[_0xab5f('0xaa')]({'model':db['ChatWebsite'],'as':_0xab5f('0xbb'),'attributes':['id',_0xab5f('0x31')]});_0x38235c[_0xab5f('0xaa')]({'model':db[_0xab5f('0x81')],'as':_0xab5f('0xbc'),'attributes':['id',_0xab5f('0x58')]});return db['ChatInteraction'][_0xab5f('0x4e')]({'where':{'id':_0x29f402[_0xab5f('0x43')]['id']},'include':_0x38235c})[_0xab5f('0x18')](handleEntityNotFound(_0x1385b3,null))[_0xab5f('0x18')](function(_0x9f9a0a){if(_0x9f9a0a){var _0x430d3c=_0x9f9a0a[_0xab5f('0xbd')]({'plain':!![]});fs[_0xab5f('0xbe')](_0x5c6151);var _0x58a9cc={'channel':_0xab5f('0xbf'),'account':_0x430d3c[_0xab5f('0xbb')][_0xab5f('0x31')],'agent':_0x430d3c[_0xab5f('0xbc')]?_0x430d3c[_0xab5f('0xbc')][_0xab5f('0x58')]:'N.A.','createdAt':moment(_0x430d3c['createdAt'])['format'](_0xab5f('0xa3'))[_0xab5f('0xb4')](),'closedAt':_0x430d3c[_0xab5f('0x6c')]?moment(_0x430d3c[_0xab5f('0xc0')])['format'](_0xab5f('0xa3'))[_0xab5f('0xb4')]():'','disposition':_0x430d3c[_0xab5f('0x6d')],'chatInfo':{'browser':_0x430d3c[_0xab5f('0xc1')],'os':_0x430d3c[_0xab5f('0xc2')],'referer':_0x430d3c[_0xab5f('0xc3')],'customerIp':_0x430d3c[_0xab5f('0xc4')],'customerPort':_0x430d3c[_0xab5f('0xc5')]?_0x430d3c[_0xab5f('0xc5')]:_0xab5f('0xc6')},'messages':_(_0x430d3c['Messages'])[_0xab5f('0xc7')]()['filter']({'secret':![]})[_0xab5f('0x39')](function(_0x1a239b){if(_0x1a239b[_0xab5f('0x74')]){var _0x14cebe=path['join'](_0x76c46c,_0x1a239b[_0xab5f('0x74')]['basename']);if(fs['existsSync'](_0x14cebe)){fs['createReadStream'](_0x14cebe)[_0xab5f('0xc8')](fs['createWriteStream'](path[_0xab5f('0x76')](_0x5c6151,_0x1a239b[_0xab5f('0x74')][_0xab5f('0x71')])));}}return{'date':moment(_0x1a239b[_0xab5f('0xc9')])['format'](_0xab5f('0xa3'))[_0xab5f('0xb4')](),'sender':_0x1a239b[_0xab5f('0xca')]===_0xab5f('0xcb')?_0x1a239b[_0xab5f('0x81')]?_0x1a239b[_0xab5f('0x81')][_0xab5f('0x58')]:_0xab5f('0x87'):_0x1a239b[_0xab5f('0xcc')]['firstName']+(_0x1a239b[_0xab5f('0xcc')][_0xab5f('0xba')]?'\x20'+_0x1a239b[_0xab5f('0xcc')][_0xab5f('0xba')]:''),'body':_0x1a239b[_0xab5f('0x74')]?_0x1a239b[_0xab5f('0x74')]['basename']:_0x1a239b[_0xab5f('0x34')],'direction':_0x1a239b[_0xab5f('0xca')]===_0xab5f('0xcb')?'A':'C','secret':_0x1a239b[_0xab5f('0x8d')],'read':_0x1a239b[_0xab5f('0xcd')],'attachment':_0x1a239b[_0xab5f('0x74')]};})[_0xab5f('0xce')]()};return ejs[_0xab5f('0xcf')](path[_0xab5f('0x76')](config['root'],_0xab5f('0xb5'),_0xab5f('0xd0'),_0xab5f('0xd1')),{'interaction':_0x58a9cc})['then'](function(_0x3d2d65){var _0x2524bd=path[_0xab5f('0x76')](_0x5c6151,'transcript-'+_0x430d3c['id']+'-'+_0x2439ff+'.pdf');var _0x48c66d={'path':_0x2524bd,'channel':_0xab5f('0xbf'),'interactionId':_0x430d3c['id']};return pdf[_0xab5f('0xd2')](_0x3d2d65,_0x48c66d);})[_0xab5f('0x18')](function(){return new Promise(function(_0x66ed1b,_0x1a7c79){zipdir(_0x5c6151,{'saveTo':_0x1e56bc},function(_0x547f58,_0x53bd18){if(_0x547f58)return _0x1a7c79(_0x547f58);return _0x66ed1b(_0x53bd18);});})[_0xab5f('0x18')](function(){return new BPromise(function(_0x20e1cf,_0x50a629){rimraf(_0x5c6151,function(_0x17fc0b){if(_0x17fc0b)_0x50a629(_0x17fc0b);return _0x20e1cf();});});})[_0xab5f('0x18')](function(){return _0x1385b3[_0xab5f('0xb3')](_0x1e56bc,_0x2e76fc,function(_0x4e9ad4){if(_0x4e9ad4){logger[_0xab5f('0x1f')]('err',_0x4e9ad4);}else{fs[_0xab5f('0xd3')](_0x1e56bc);}});});});}else{return _0x1385b3['sendStatus'](0xc8);}})['catch'](handleError(_0x1385b3,null));}; \ No newline at end of file +var _0xd3fc=['ContactId','Messages','length','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','filters','hasOwnProperty','pick','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','nolimit','order','sort','includeAgent','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','push','firstName','lastName','get','Chat','Account','Owner','N.A.','toString','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','out','value','renderFile','views','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','stack','name','send','render','merge','body','agent','interaction','account','index','map','ChatInteraction','fieldName','key','getOptions','findAll','chat','query','user','params','model','rawAttributes','keys','intersection','attributes','fields','includeAll','include','options','find','create','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooApiKey','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','UserId','closed','AbandonInteraction','attachmentUpload','type','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','offline-chat/','basename','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','User'];(function(_0x18129d,_0x391a94){var _0x2ad7c6=function(_0x2a95fe){while(--_0x2a95fe){_0x18129d['push'](_0x18129d['shift']());}};_0x2ad7c6(++_0x391a94);}(_0xd3fc,0x11f));var _0xcd3f=function(_0x3652a0,_0x51d3a0){_0x3652a0=_0x3652a0-0x0;var _0x964faa=_0xd3fc[_0x3652a0];return _0x964faa;};'use strict';var rimraf=require(_0xcd3f('0x0'));var zipdir=require(_0xcd3f('0x1'));var rp=require(_0xcd3f('0x2'));var moment=require(_0xcd3f('0x3'));var BPromise=require(_0xcd3f('0x4'));var Mustache=require(_0xcd3f('0x5'));var util=require(_0xcd3f('0x6'));var path=require(_0xcd3f('0x7'));var ejs=require(_0xcd3f('0x8'));var fs=require('fs');var _=require(_0xcd3f('0x9'));var Redis=require(_0xcd3f('0xa'));var interaction=require(_0xcd3f('0xb'));var qs=require(_0xcd3f('0xc'));var pdf=require(_0xcd3f('0xd'));var logger=require('../../config/logger')(_0xcd3f('0xe'));var config=require(_0xcd3f('0xf'));var db=require(_0xcd3f('0x10'))['db'];config[_0xcd3f('0x11')]=_[_0xcd3f('0x12')](config['redis'],{'host':_0xcd3f('0x13'),'port':0x18eb});var socket=require(_0xcd3f('0x14'))(new Redis(config[_0xcd3f('0x11')]));require('./chatInteraction.socket')[_0xcd3f('0x15')](socket);var jayson=require(_0xcd3f('0x16'));var client=jayson[_0xcd3f('0x17')][_0xcd3f('0x18')]({'port':0x232b});var client9004=jayson[_0xcd3f('0x17')][_0xcd3f('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x2032b7,_0x352f58,_0x18bffd,_0x557cc2){return new BPromise(function(_0x58b23a,_0x5e8dca){var _0x4dcb73=_0x557cc2||client;return _0x4dcb73[_0xcd3f('0x19')](_0x2032b7,_0x18bffd)[_0xcd3f('0x1a')](function(_0x17691d){logger['info'](_0xcd3f('0x1b'),_0x352f58,_0xcd3f('0x1c'));logger[_0xcd3f('0x1d')](_0xcd3f('0x1e'),_0x352f58,_0xcd3f('0x1c'),JSON[_0xcd3f('0x1f')](_0x17691d));if(_0x17691d[_0xcd3f('0x20')]){if(_0x17691d[_0xcd3f('0x20')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x352f58,_0x17691d[_0xcd3f('0x20')][_0xcd3f('0x21')]);return _0x5e8dca(_0x17691d[_0xcd3f('0x20')]['message']);}logger[_0xcd3f('0x20')](_0xcd3f('0x1b'),_0x352f58,_0x17691d['error']['message']);return _0x58b23a(_0x17691d[_0xcd3f('0x20')][_0xcd3f('0x21')]);}else{logger[_0xcd3f('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x352f58,_0xcd3f('0x1c'));_0x58b23a(_0x17691d[_0xcd3f('0x23')][_0xcd3f('0x21')]);}})[_0xcd3f('0x24')](function(_0x3b21ad){logger[_0xcd3f('0x20')](_0xcd3f('0x1b'),_0x352f58,_0x3b21ad);_0x5e8dca(_0x3b21ad);});});}function respondWithStatusCode(_0x51e5d6,_0xd03b51){_0xd03b51=_0xd03b51||0xcc;return function(_0x213696){if(_0x213696){return _0x51e5d6[_0xcd3f('0x25')](_0xd03b51);}return _0x51e5d6[_0xcd3f('0x26')](_0xd03b51)[_0xcd3f('0x27')]();};}function respondWithResult(_0x25b6c9,_0x22e7b8){_0x22e7b8=_0x22e7b8||0xc8;return function(_0xd8b536){if(_0xd8b536){return _0x25b6c9[_0xcd3f('0x26')](_0x22e7b8)['json'](_0xd8b536);}};}function respondWithFilteredResult(_0x255104,_0x170be2){return function(_0x1cfa59){if(_0x1cfa59){var _0x39b0ab=typeof _0x170be2[_0xcd3f('0x28')]===_0xcd3f('0x29')&&typeof _0x170be2[_0xcd3f('0x2a')]===_0xcd3f('0x29');var _0x39f93c=_0x1cfa59[_0xcd3f('0x2b')];var _0x27f4ee=_0x39b0ab?0x0:_0x170be2[_0xcd3f('0x28')];var _0x3ff859=_0x39b0ab?_0x1cfa59[_0xcd3f('0x2b')]:_0x170be2['offset']+_0x170be2[_0xcd3f('0x2a')];var _0xf8a9c7;if(_0x3ff859>=_0x39f93c){_0x3ff859=_0x39f93c;_0xf8a9c7=0xc8;}else{_0xf8a9c7=0xce;}_0x255104[_0xcd3f('0x26')](_0xf8a9c7);return _0x255104[_0xcd3f('0x2c')](_0xcd3f('0x2d'),_0x27f4ee+'-'+_0x3ff859+'/'+_0x39f93c)[_0xcd3f('0x2e')](_0x1cfa59);}return null;};}function saveUpdates(_0x42219e){return function(_0x224fe9){if(_0x224fe9){return _0x224fe9[_0xcd3f('0x2f')](_0x42219e)['then'](function(_0x1f818f){return _0x1f818f;});}return null;};}function removeEntity(_0x35ed0a){return function(_0x27f162){if(_0x27f162){return _0x27f162[_0xcd3f('0x30')]()[_0xcd3f('0x1a')](function(){_0x35ed0a[_0xcd3f('0x26')](0xcc)[_0xcd3f('0x27')]();});}};}function handleEntityNotFound(_0x3ed28b){return function(_0x5ba247){if(!_0x5ba247){_0x3ed28b['sendStatus'](0x194);}return _0x5ba247;};}function handleError(_0x27968d,_0x13fb88){_0x13fb88=_0x13fb88||0x1f4;return function(_0x163026){logger[_0xcd3f('0x20')](_0x163026[_0xcd3f('0x31')]);if(_0x163026[_0xcd3f('0x32')]){delete _0x163026[_0xcd3f('0x32')];}_0x27968d[_0xcd3f('0x26')](_0x13fb88)[_0xcd3f('0x33')](_0x163026);};}function getMustacheRender(_0x4408e9,_0x14949d){return Mustache[_0xcd3f('0x34')](_0x4408e9,_[_0xcd3f('0x35')](_0x14949d[_0xcd3f('0x36')],{'contact':_0x14949d['contact'],'message':_0x14949d[_0xcd3f('0x21')],'agent':_0x14949d[_0xcd3f('0x37')],'interaction':_0x14949d[_0xcd3f('0x38')],'account':_0x14949d[_0xcd3f('0x39')]}))||'';}exports[_0xcd3f('0x3a')]=function(_0x5dbe98,_0x2dace2){var _0x7f54a0={};var _0x2b4bc9=_[_0xcd3f('0x3b')](db[_0xcd3f('0x3c')]['rawAttributes'],function(_0xe07084){return{'name':_0xe07084[_0xcd3f('0x3d')],'type':_0xe07084['type'][_0xcd3f('0x3e')]};});_0x7f54a0=qs[_0xcd3f('0x3f')](_0x2b4bc9,_0x5dbe98);return interaction[_0xcd3f('0x40')](_0xcd3f('0x41'),_0x5dbe98[_0xcd3f('0x42')],_0x5dbe98[_0xcd3f('0x43')],_0x7f54a0,_0x2b4bc9)[_0xcd3f('0x1a')](respondWithFilteredResult(_0x2dace2,_0x7f54a0))[_0xcd3f('0x24')](handleError(_0x2dace2,null));};exports['show']=function(_0x5c2327,_0x44a908){var _0x1456e1={'raw':![],'where':{'id':_0x5c2327[_0xcd3f('0x44')]['id']}},_0x5e96cc={};_0x5e96cc[_0xcd3f('0x45')]=_['keys'](db[_0xcd3f('0x3c')][_0xcd3f('0x46')]);_0x5e96cc[_0xcd3f('0x42')]=_[_0xcd3f('0x47')](_0x5c2327[_0xcd3f('0x42')]);_0x5e96cc['filters']=_[_0xcd3f('0x48')](_0x5e96cc['model'],_0x5e96cc[_0xcd3f('0x42')]);_0x1456e1[_0xcd3f('0x49')]=_['intersection'](_0x5e96cc[_0xcd3f('0x45')],qs[_0xcd3f('0x4a')](_0x5c2327[_0xcd3f('0x42')]['fields']));_0x1456e1[_0xcd3f('0x49')]=_0x1456e1[_0xcd3f('0x49')]['length']?_0x1456e1[_0xcd3f('0x49')]:_0x5e96cc['model'];if(_0x5c2327[_0xcd3f('0x42')][_0xcd3f('0x4b')]){_0x1456e1[_0xcd3f('0x4c')]=[{'all':!![]}];}_0x1456e1=_['merge']({},_0x1456e1,_0x5c2327[_0xcd3f('0x4d')]);return db['ChatInteraction'][_0xcd3f('0x4e')](_0x1456e1)['then'](handleEntityNotFound(_0x44a908,null))[_0xcd3f('0x1a')](respondWithResult(_0x44a908,null))['catch'](handleError(_0x44a908,null));};exports[_0xcd3f('0x4f')]=function(_0x17d6c1,_0x5c6e98){return db[_0xcd3f('0x3c')][_0xcd3f('0x4f')](_0x17d6c1[_0xcd3f('0x36')],{})[_0xcd3f('0x1a')](respondWithResult(_0x5c6e98,0xc9))['catch'](handleError(_0x5c6e98,null));};exports[_0xcd3f('0x2f')]=function(_0x1cc871,_0x1142ec){if(_0x1cc871[_0xcd3f('0x36')]['id']){delete _0x1cc871['body']['id'];}return db['ChatInteraction'][_0xcd3f('0x4e')]({'where':{'id':_0x1cc871[_0xcd3f('0x44')]['id']}})['then'](handleEntityNotFound(_0x1142ec,null))[_0xcd3f('0x1a')](saveUpdates(_0x1cc871[_0xcd3f('0x36')],null))[_0xcd3f('0x1a')](respondWithResult(_0x1142ec,null))[_0xcd3f('0x24')](handleError(_0x1142ec,null));};exports['destroy']=function(_0xa1bcbd,_0x38fb9a){return db['ChatInteraction']['find']({'where':{'id':_0xa1bcbd[_0xcd3f('0x44')]['id']}})[_0xcd3f('0x1a')](handleEntityNotFound(_0x38fb9a,null))[_0xcd3f('0x1a')](removeEntity(_0x38fb9a,null))[_0xcd3f('0x24')](handleError(_0x38fb9a,null));};exports[_0xcd3f('0x50')]=function(_0x17d946,_0x24e3c8){return db[_0xcd3f('0x3c')][_0xcd3f('0x50')]()['then'](respondWithResult(_0x24e3c8,null))[_0xcd3f('0x24')](handleError(_0x24e3c8,null));};exports['createVidaooSession']=function(_0x2367eb,_0x48099a){var _0x332746=_0x2367eb[_0xcd3f('0x44')]['id'];var _0x987c0c;var _0x2cd10d;var _0x3a6942;return db['ChatInteraction'][_0xcd3f('0x51')]({'where':{'id':_0x332746}})[_0xcd3f('0x1a')](function(_0x42a445){_0x987c0c=_0x42a445;return db[_0xcd3f('0x52')]['findOne']({'where':{'id':_0x42a445[_0xcd3f('0x53')]},'attributes':['id','vidaooApiKey',_0xcd3f('0x54'),_0xcd3f('0x55'),_0xcd3f('0x56'),'vidaooMetadata'],'raw':!![]});})[_0xcd3f('0x1a')](function(_0x54dff5){if(_0x54dff5&&_0x54dff5[_0xcd3f('0x57')]&&_0x54dff5[_0xcd3f('0x54')]){_0x2cd10d=_0x54dff5;var _0x1a4f46={'interaction':{'id':_0x332746},'agent':{'id':_0x2367eb['user']['id'],'name':_0x2367eb['user'][_0xcd3f('0x32')],'fullname':_0x2367eb[_0xcd3f('0x43')][_0xcd3f('0x58')],'email':_0x2367eb['user'][_0xcd3f('0x59')]},'contact':_0x2367eb[_0xcd3f('0x36')][_0xcd3f('0x5a')],'account':_0x2367eb['body']['account']};var _0x2500e2={'rejectUnauthorized':![],'method':_0xcd3f('0x5b'),'url':_0xcd3f('0x5c'),'headers':{'X-APIKEY':_0x54dff5[_0xcd3f('0x57')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2367eb['user']['email']],'buttons':null,'topic':_0x2cd10d[_0xcd3f('0x55')],'note':_[_0xcd3f('0x5d')](_0x2cd10d['vidaooNote'])?null:getMustacheRender(_0x2cd10d[_0xcd3f('0x56')],_0x1a4f46),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xcd3f('0x5d')](_0x2cd10d['vidaooMetadata'])){var _0x244ecf=getMustacheRender(_0x2cd10d[_0xcd3f('0x5e')],_0x1a4f46);var _0x586fdb=JSON[_0xcd3f('0x5f')](_0x244ecf);_0x2500e2[_0xcd3f('0x36')][_0xcd3f('0x60')]=_0x586fdb;}}catch(_0x71afb){throw new db[(_0xcd3f('0x61'))][(_0xcd3f('0x62'))](_0xcd3f('0x63'));}return rp(_0x2500e2);}else{throw new db[(_0xcd3f('0x61'))][(_0xcd3f('0x62'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x179db2){_0x3a6942=_0x179db2;if(_0x3a6942['id']){var _0x1e96cf={'body':_0x3a6942['join_url'],'ChatWebsiteId':_0x2cd10d['id'],'ChatInteractionId':_0x987c0c['id'],'direction':'out','UserId':_0x2367eb[_0xcd3f('0x43')]['id']};return db[_0xcd3f('0x64')]['create'](_0x1e96cf,{});}else{throw new db[(_0xcd3f('0x61'))][(_0xcd3f('0x62'))](_0xcd3f('0x65'));}})[_0xcd3f('0x1a')](function(){return _0x987c0c['updateAttributes']({'vidaooSessionId':_0x3a6942['id']});})[_0xcd3f('0x1a')](respondWithResult(_0x48099a,null))['catch'](handleError(_0x48099a,null));};exports[_0xcd3f('0x66')]=function(_0x4c2ed5,_0x43ffd1){if(_0x4c2ed5['body']['id']){delete _0x4c2ed5[_0xcd3f('0x36')]['id'];}return db[_0xcd3f('0x3c')][_0xcd3f('0x4e')]({'where':{'id':_0x4c2ed5[_0xcd3f('0x44')]['id']},'include':[{'model':db[_0xcd3f('0x67')],'as':_0xcd3f('0x68')}]})['then'](handleEntityNotFound(_0x43ffd1,null))[_0xcd3f('0x1a')](saveUpdates(_0x4c2ed5[_0xcd3f('0x36')],null))[_0xcd3f('0x1a')](respondWithResult(_0x43ffd1,null))['catch'](handleError(_0x43ffd1,null));};exports[_0xcd3f('0x69')]=function(_0xfcf300,_0x210beb){if(_0xfcf300[_0xcd3f('0x36')]['id']){delete _0xfcf300[_0xcd3f('0x36')]['id'];}return db[_0xcd3f('0x3c')][_0xcd3f('0x4e')]({'where':{'id':_0xfcf300['params']['id']}})[_0xcd3f('0x1a')](function(_0x2a57b3){if(!_0x2a57b3){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xcd3f('0x69'),0x194,'entity\x20not\x20found');_0x210beb[_0xcd3f('0x25')](0x194);}else{if(_0x2a57b3[_0xcd3f('0x6a')]){throw new db['Sequelize'][(_0xcd3f('0x62'))]('Interaction\x20already\x20assigned');}}return _0x2a57b3;})[_0xcd3f('0x1a')](function(_0x1040fa){if(_0x1040fa){return _0x1040fa[_0xcd3f('0x2f')]({'closed':_0xfcf300[_0xcd3f('0x36')][_0xcd3f('0x6b')],'disposition':_0xfcf300[_0xcd3f('0x36')]['disposition']})['then'](function(_0xcf720){return _0xcf720;});}})['then'](function(){return respondWithRpcPromise(_0xcd3f('0x6c'),_0xcd3f('0x69'),_0xfcf300[_0xcd3f('0x36')],client9004);})[_0xcd3f('0x1a')](respondWithResult(_0x210beb,null))[_0xcd3f('0x24')](handleError(_0x210beb,null));};exports[_0xcd3f('0x6d')]=function(_0x3baa5f,_0x5c31c0){_0x3baa5f['body'][_0xcd3f('0x32')]=_0x3baa5f['file']['originalname'];_0x3baa5f[_0xcd3f('0x36')]['basename']=_0x3baa5f['file']['filename'];_0x3baa5f['body'][_0xcd3f('0x6e')]=_0x3baa5f['file'][_0xcd3f('0x6f')];return db[_0xcd3f('0x70')][_0xcd3f('0x4f')](_0x3baa5f[_0xcd3f('0x36')])['then'](respondWithResult(_0x5c31c0,0xc9))[_0xcd3f('0x24')](handleError(_0x5c31c0,null));};exports[_0xcd3f('0x71')]=function(_0x45838a,_0x10070d){return db[_0xcd3f('0x3c')][_0xcd3f('0x51')]({'where':{'id':_0x45838a[_0xcd3f('0x44')]['id']},'raw':!![]})[_0xcd3f('0x1a')](handleEntityNotFound(_0x10070d,null))[_0xcd3f('0x1a')](function(_0x4d7eaa){if(_0x4d7eaa){if(_0x4d7eaa['closed']){return _0x10070d[_0xcd3f('0x26')](0x193)[_0xcd3f('0x2e')]({'status':0x193,'message':_0xcd3f('0x72')});}return db['Attachment'][_0xcd3f('0x51')]({'where':{'id':_0x45838a[_0xcd3f('0x42')]['attachId']},'raw':!![]})[_0xcd3f('0x1a')](handleEntityNotFound(_0x10070d,null));}})[_0xcd3f('0x1a')](function(_0x56c16a){if(_0x56c16a){var _0x1c028d=_0x56c16a[_0xcd3f('0x73')]!==null;var _0x555bd7=path['join'](config['root'],'server/files/attachments/');if(_0x1c028d){_0x555bd7=path[_0xcd3f('0x74')](_0x555bd7,_0xcd3f('0x75'));}var _0xf7a566=path['join'](_0x555bd7,_0x56c16a[_0xcd3f('0x76')]);return _0x10070d[_0xcd3f('0x77')](_0xf7a566);}})['catch'](handleError(_0x10070d,null));};exports[_0xcd3f('0x78')]=function(_0x2600fd,_0x518d26){var _0x125d77=null;var _0x1e413d=null;var _0x250813=null;if(_0x2600fd[_0xcd3f('0x36')]['id']){delete _0x2600fd['body']['id'];}if(_0x2600fd['body'][_0xcd3f('0x79')]){_0x250813=path['join'](config[_0xcd3f('0x7a')],_0xcd3f('0x7b'),util[_0xcd3f('0x7c')](_0xcd3f('0x7d'),Date['now']()));_0x2600fd[_0xcd3f('0x36')]['pathTranscript']=_0x250813;}return db[_0xcd3f('0x3c')][_0xcd3f('0x4e')]({'where':{'id':_0x2600fd[_0xcd3f('0x44')]['id']},'include':[{'model':db[_0xcd3f('0x64')],'as':'Messages','include':[{'model':db[_0xcd3f('0x7e')],'as':_0xcd3f('0x7e')}]}]})[_0xcd3f('0x1a')](handleEntityNotFound(_0x518d26,null))[_0xcd3f('0x1a')](saveUpdates(_0x2600fd[_0xcd3f('0x36')],null))[_0xcd3f('0x1a')](function(_0x258482){if(_0x258482){_0x125d77=_0x258482;return db['ChatWebsite']['find']({'where':{'id':_0x125d77[_0xcd3f('0x53')]}});}})['then'](function(_0x32a08f){if(_0x32a08f){_0x1e413d=_0x32a08f;return db[_0xcd3f('0x67')][_0xcd3f('0x4e')]({'where':{'id':_0x125d77[_0xcd3f('0x7f')]}});}})[_0xcd3f('0x1a')](function(_0x5a35f0){if(_0x5a35f0){if(_0x250813){var _0x59b774=null;for(var _0x882505=0x1;_0x882505<_0x125d77[_0xcd3f('0x80')][_0xcd3f('0x81')];++_0x882505){_0x59b774=_0x125d77[_0xcd3f('0x80')][_0x882505];var _0x1d2ca3=_0x59b774['UserId']?util[_0xcd3f('0x7c')]('%s%d',_0x1e413d[_0xcd3f('0x82')],_0x59b774['UserId']):'System';var _0x264233=_0x2600fd['body'][_0xcd3f('0x83')]||util[_0xcd3f('0x7c')]('%s%d',_0xcd3f('0x84'),_0x59b774['ContactId']);switch(_0x1e413d[_0xcd3f('0x85')]){case _0xcd3f('0x86'):_0x1d2ca3=_0x59b774[_0xcd3f('0x6a')]?util['format']('%s%d',_0x1e413d[_0xcd3f('0x82')],_0x59b774[_0xcd3f('0x6a')]):_0xcd3f('0x87');break;case'agent_alias':_0x1d2ca3=_0x59b774[_0xcd3f('0x6a')]?_0x59b774[_0xcd3f('0x7e')][_0xcd3f('0x88')]||_0x59b774[_0xcd3f('0x7e')][_0xcd3f('0x58')]:_0xcd3f('0x87');break;case'agent_fullname':_0x1d2ca3=_0x59b774[_0xcd3f('0x6a')]?_0x59b774[_0xcd3f('0x7e')][_0xcd3f('0x58')]:_0xcd3f('0x87');break;default:_0x1d2ca3=_0x59b774[_0xcd3f('0x6a')]?util['format']('%s%d',_0x1e413d[_0xcd3f('0x82')],_0x59b774[_0xcd3f('0x6a')]):_0xcd3f('0x87');}var _0x3a1eb6=util[_0xcd3f('0x7c')](_0xcd3f('0x89'),moment(_0x59b774[_0xcd3f('0x8a')])['format'](_0xcd3f('0x8b')),_0x59b774[_0xcd3f('0x8c')]==='in'?_0x264233:_0x1d2ca3,_0x59b774['body']);if(!_0x59b774[_0xcd3f('0x8d')]){fs[_0xcd3f('0x8e')](_0x250813,_0x3a1eb6);}}return db[_0xcd3f('0x8f')][_0xcd3f('0x51')]({'where':{'service':!![]},'include':[{'model':db[_0xcd3f('0x90')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xcd3f('0x91'),'raw':!![]}]}]});}}})[_0xcd3f('0x1a')](function(_0x455ef7){if(!_0x455ef7||!_0x455ef7[_0xcd3f('0x92')]||!_0x2600fd['body'])return _0x125d77;var _0x23009c=_0x455ef7[_0xcd3f('0x93')]();return respondWithRpcPromise(_0xcd3f('0x94'),_0xcd3f('0x95'),{'account':_0x23009c,'message':{'from':util[_0xcd3f('0x7c')]('\x22%s\x22\x20<%s>',_0x455ef7[_0xcd3f('0x32')],_0x455ef7[_0xcd3f('0x59')]||_0x455ef7[_0xcd3f('0x92')][_0xcd3f('0x43')]),'to':_0x2600fd[_0xcd3f('0x36')]['mailTranscript'],'subject':_0xcd3f('0x96'),'text':util['format'](_0xcd3f('0x97'),_0x2600fd['body']['mailTranscript']),'attachments':[{'path':_0x250813}]}})[_0xcd3f('0x1a')](function(){return _0x125d77;})['catch'](function(_0x14fd83){logger['error'](_0x14fd83);});})['then'](respondWithStatusCode(_0x518d26,0xc8))[_0xcd3f('0x24')](handleError(_0x518d26,null));};exports['addMessage']=function(_0x3cbbff,_0x5ec781){return db['ChatMessage'][_0xcd3f('0x4e')]({'where':{'id':_0x3cbbff['params']['id']}})[_0xcd3f('0x1a')](handleEntityNotFound(_0x5ec781,null))[_0xcd3f('0x1a')](function(_0x5f1c06){if(_0x5f1c06){return _0x5f1c06['addMessage'](_0x3cbbff[_0xcd3f('0x36')][_0xcd3f('0x98')],_[_0xcd3f('0x99')](_0x3cbbff[_0xcd3f('0x36')],[_0xcd3f('0x98'),'id'])||{});}})[_0xcd3f('0x1a')](respondWithResult(_0x5ec781,null))[_0xcd3f('0x24')](handleError(_0x5ec781,null));};exports['getMessages']=function(_0x155b74,_0x4790dd){var _0x15b844={'raw':![],'where':{}};var _0x2735f8={};var _0x23178a={'count':0x0,'rows':[]};return db[_0xcd3f('0x3c')][_0xcd3f('0x51')]({'where':{'id':_0x155b74[_0xcd3f('0x44')]['id']}})[_0xcd3f('0x1a')](handleEntityNotFound(_0x4790dd,null))[_0xcd3f('0x1a')](function(_0x52efbf){if(_0x52efbf){_0x2735f8[_0xcd3f('0x45')]=_[_0xcd3f('0x47')](db[_0xcd3f('0x64')][_0xcd3f('0x46')]);_0x2735f8[_0xcd3f('0x42')]=_[_0xcd3f('0x47')](_0x155b74[_0xcd3f('0x42')]);_0x2735f8[_0xcd3f('0x9a')]=_[_0xcd3f('0x48')](_0x2735f8[_0xcd3f('0x45')],_0x2735f8['query']);_0x15b844[_0xcd3f('0x49')]=_[_0xcd3f('0x48')](_0x2735f8['model'],qs['fields'](_0x155b74['query']['fields']));_0x15b844[_0xcd3f('0x49')]=_0x15b844[_0xcd3f('0x49')][_0xcd3f('0x81')]?_0x15b844[_0xcd3f('0x49')]:_0x2735f8['model'];if(!_0x155b74['query'][_0xcd3f('0x9b')]('nolimit')){_0x15b844['limit']=qs['limit'](_0x155b74[_0xcd3f('0x42')][_0xcd3f('0x2a')]);_0x15b844[_0xcd3f('0x28')]=qs[_0xcd3f('0x28')](_0x155b74[_0xcd3f('0x42')][_0xcd3f('0x28')]);}_0x15b844['order']=qs['sort'](_0x155b74[_0xcd3f('0x42')]['sort']);_0x15b844['where']=qs[_0xcd3f('0x9a')](_[_0xcd3f('0x9c')](_0x155b74[_0xcd3f('0x42')],_0x2735f8['filters']));_0x15b844[_0xcd3f('0x9d')][_0xcd3f('0x9e')]=_0x52efbf['id'];if(_0x155b74[_0xcd3f('0x42')][_0xcd3f('0x9f')]){_0x15b844[_0xcd3f('0x9d')]=_[_0xcd3f('0x35')](_0x15b844[_0xcd3f('0x9d')],{'$or':_['map'](_0x15b844[_0xcd3f('0x49')],function(_0x1499b8){var _0x468a4a={};_0x468a4a[_0x1499b8]={'$like':'%'+_0x155b74[_0xcd3f('0x42')][_0xcd3f('0x9f')]+'%'};return _0x468a4a;})});}if(_0x155b74[_0xcd3f('0x42')][_0xcd3f('0xa0')]){var _0x17f775=_0x155b74[_0xcd3f('0x42')]['$gte'][_0xcd3f('0xa1')](',');var _0xaee661={};_0xaee661[_0x17f775[0x0]]={'$gte':moment(_0x17f775[0x1])['format'](_0xcd3f('0xa2'))};_0x15b844[_0xcd3f('0x9d')]=_[_0xcd3f('0x35')](_0x15b844[_0xcd3f('0x9d')],_0xaee661);}_0x15b844=_['merge']({},_0x15b844,_0x155b74[_0xcd3f('0x4d')]);return db[_0xcd3f('0x64')][_0xcd3f('0x2b')]({'where':_0x15b844['where']})['then'](function(_0x53c459){_0x23178a[_0xcd3f('0x2b')]=_0x53c459;if(_0x155b74['query'][_0xcd3f('0x4b')]){_0x15b844[_0xcd3f('0x4c')]=[{'all':!![]}];}return db[_0xcd3f('0x64')]['findAll'](_0x15b844);})[_0xcd3f('0x1a')](function(_0x55897f){_0x23178a[_0xcd3f('0xa3')]=_0x55897f;return _0x23178a;});}})[_0xcd3f('0x1a')](respondWithFilteredResult(_0x4790dd,_0x15b844))[_0xcd3f('0x24')](handleError(_0x4790dd,null));};exports[_0xcd3f('0xa4')]=function(_0x24c24b,_0x1a5ae2){var _0x2df4c5={'where':{}},_0xf2910={},_0x39e47b={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x24c24b[_0xcd3f('0x44')]['id']}})[_0xcd3f('0x1a')](handleEntityNotFound(_0x1a5ae2,null))[_0xcd3f('0x1a')](function(_0x1cc02e){if(_0x1cc02e){_0xf2910['model']=_['keys'](db['ChatMessage'][_0xcd3f('0x46')]);_0xf2910[_0xcd3f('0x42')]=_[_0xcd3f('0x47')](_0x24c24b[_0xcd3f('0x42')]);_0xf2910['filters']=_['intersection'](_0xf2910[_0xcd3f('0x45')],_0xf2910[_0xcd3f('0x42')]);_0x2df4c5[_0xcd3f('0x49')]=_['intersection'](_0xf2910[_0xcd3f('0x45')],qs[_0xcd3f('0x4a')](_0x24c24b[_0xcd3f('0x42')][_0xcd3f('0x4a')]));_0x2df4c5[_0xcd3f('0x49')]=_0x2df4c5[_0xcd3f('0x49')][_0xcd3f('0x81')]?_0x2df4c5[_0xcd3f('0x49')]:_0xf2910[_0xcd3f('0x45')];if(!_0x24c24b[_0xcd3f('0x42')][_0xcd3f('0x9b')](_0xcd3f('0xa5'))){_0x2df4c5['limit']=qs[_0xcd3f('0x2a')](_0x24c24b['query'][_0xcd3f('0x2a')]);_0x2df4c5[_0xcd3f('0x28')]=qs['offset'](_0x24c24b[_0xcd3f('0x42')][_0xcd3f('0x28')]);}_0x2df4c5[_0xcd3f('0xa6')]=qs[_0xcd3f('0xa7')](_0x24c24b[_0xcd3f('0x42')][_0xcd3f('0xa7')]);_0x2df4c5['where']=qs[_0xcd3f('0x9a')](_[_0xcd3f('0x9c')](_0x24c24b[_0xcd3f('0x42')],_0xf2910[_0xcd3f('0x9a')]));_0x2df4c5[_0xcd3f('0x9d')][_0xcd3f('0x9e')]=_0x1cc02e['id'];if(_0x24c24b[_0xcd3f('0x42')]['filter']){_0x2df4c5[_0xcd3f('0x9d')]=_[_0xcd3f('0x35')](_0x2df4c5[_0xcd3f('0x9d')],{'$or':_['map'](_0x2df4c5['attributes'],function(_0x209ed0){var _0x1dc965={};_0x1dc965[_0x209ed0]={'$like':'%'+_0x24c24b[_0xcd3f('0x42')][_0xcd3f('0x9f')]+'%'};return _0x1dc965;})});}_0x2df4c5[_0xcd3f('0x9d')][_0xcd3f('0x8d')]=![];if(_0x24c24b[_0xcd3f('0x42')]['id']){_0x2df4c5[_0xcd3f('0x9d')]['id']={'$gt':_0x24c24b['query']['id']};}_0x2df4c5=_[_0xcd3f('0x35')]({},_0x2df4c5,_0x24c24b[_0xcd3f('0x4d')]);return db['ChatMessage'][_0xcd3f('0x2b')]({'where':_0x2df4c5[_0xcd3f('0x9d')]})[_0xcd3f('0x1a')](function(_0x191ed8){_0x39e47b[_0xcd3f('0x2b')]=_0x191ed8;_0x2df4c5[_0xcd3f('0x4c')]=[];if(_0x24c24b['query'][_0xcd3f('0xa8')]){_0x2df4c5[_0xcd3f('0x4c')]['push']({'model':db[_0xcd3f('0x7e')],'as':'User','attributes':['id','fullname','alias']});}if(_0x24c24b[_0xcd3f('0x42')][_0xcd3f('0x4b')]){_0x2df4c5[_0xcd3f('0x4c')]=[{'all':!![]}];}return db[_0xcd3f('0x64')]['findAll'](_0x2df4c5);})['then'](function(_0x4c96d0){_0x39e47b[_0xcd3f('0xa3')]=_0x4c96d0;return _0x39e47b;});}})[_0xcd3f('0x1a')](respondWithFilteredResult(_0x1a5ae2,_0x2df4c5))[_0xcd3f('0x24')](handleError(_0x1a5ae2,null));};exports['addTags']=function(_0xb987d6,_0x3940a5){return db['ChatInteraction'][_0xcd3f('0x4e')]({'where':{'id':_0xb987d6['params']['id']}})[_0xcd3f('0x1a')](handleEntityNotFound(_0x3940a5,null))[_0xcd3f('0x1a')](function(_0x30534e){if(_0x30534e){return _0x30534e[_0xcd3f('0xa9')](_0xb987d6[_0xcd3f('0x36')]['ids'],_[_0xcd3f('0x99')](_0xb987d6[_0xcd3f('0x36')],['ids','id'])||{})[_0xcd3f('0xaa')](function(){return db[_0xcd3f('0xab')][_0xcd3f('0x40')]({'attributes':['id',_0xcd3f('0x32'),_0xcd3f('0xac')],'where':{'id':_0xb987d6[_0xcd3f('0x36')][_0xcd3f('0x98')]}});})[_0xcd3f('0x1a')](function(_0x5195c3){socket[_0xcd3f('0xad')](_0xcd3f('0xae'),{'id':Number(_0xb987d6[_0xcd3f('0x44')]['id']),'tags':_0x5195c3||[]});return{'id':Number(_0xb987d6[_0xcd3f('0x44')]['id']),'tags':_0x5195c3||[]};});}})['then'](respondWithResult(_0x3940a5,null))[_0xcd3f('0x24')](handleError(_0x3940a5,null));};exports[_0xcd3f('0xaf')]=function(_0x73dc5d,_0x399d6e){return db[_0xcd3f('0x3c')][_0xcd3f('0x4e')]({'where':{'id':_0x73dc5d[_0xcd3f('0x44')]['id']}})[_0xcd3f('0x1a')](handleEntityNotFound(_0x399d6e,null))[_0xcd3f('0x1a')](function(_0x18fd51){if(_0x18fd51){return _0x18fd51[_0xcd3f('0xaf')](_0x73dc5d[_0xcd3f('0x42')][_0xcd3f('0x98')]);}})[_0xcd3f('0x1a')](respondWithStatusCode(_0x399d6e,null))[_0xcd3f('0x24')](handleError(_0x399d6e,null));};exports[_0xcd3f('0x77')]=function(_0x219140,_0x5139c3){var _0x5ac838=moment()[_0xcd3f('0xb0')]()['toString']();var _0x5997af=path[_0xcd3f('0x74')](config['root'],_0xcd3f('0xb1'),_0xcd3f('0xb2'),_0xcd3f('0xb3'));var _0xff4cd6=path[_0xcd3f('0x74')](config['root'],'server',_0xcd3f('0xb2'),_0xcd3f('0xb4'));var _0x1f4c04=path['join'](_0x5997af,_0x5ac838);var _0x12d719=util['format'](_0xcd3f('0xb5'),_0x219140[_0xcd3f('0x44')]['id'],_0x5ac838);var _0x28e59b=path['join'](_0x5997af,_0x12d719);var _0x3e455b=[];_0x3e455b[_0xcd3f('0xb6')]({'model':db['User'],'as':_0xcd3f('0x7e'),'attributes':['id',_0xcd3f('0x58')],'raw':!![]});_0x3e455b[_0xcd3f('0xb6')]({'model':db[_0xcd3f('0x67')],'as':_0xcd3f('0x68'),'attributes':['id',_0xcd3f('0xb7'),_0xcd3f('0xb8')],'raw':!![]});if(_0x219140[_0xcd3f('0x42')][_0xcd3f('0xb4')]){_0x3e455b[_0xcd3f('0xb6')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x234cfd=[{'model':db[_0xcd3f('0x64')],'as':_0xcd3f('0x80'),'attributes':['id',_0xcd3f('0x36'),_0xcd3f('0x8a'),_0xcd3f('0x8c'),_0xcd3f('0x8d'),'read'],'include':_0x3e455b}];_0x234cfd[_0xcd3f('0xb6')]({'model':db[_0xcd3f('0x52')],'as':'Account','attributes':['id',_0xcd3f('0x32')]});_0x234cfd[_0xcd3f('0xb6')]({'model':db['User'],'as':'Owner','attributes':['id',_0xcd3f('0x58')]});return db[_0xcd3f('0x3c')][_0xcd3f('0x4e')]({'where':{'id':_0x219140[_0xcd3f('0x44')]['id']},'include':_0x234cfd})[_0xcd3f('0x1a')](handleEntityNotFound(_0x5139c3,null))['then'](function(_0x22d82c){if(_0x22d82c){var _0x3c75a0=_0x22d82c[_0xcd3f('0xb9')]({'plain':!![]});fs['mkdirSync'](_0x1f4c04);var _0x3be1af={'channel':_0xcd3f('0xba'),'account':_0x3c75a0[_0xcd3f('0xbb')]['name'],'agent':_0x3c75a0['Owner']?_0x3c75a0[_0xcd3f('0xbc')][_0xcd3f('0x58')]:_0xcd3f('0xbd'),'createdAt':moment(_0x3c75a0[_0xcd3f('0x8a')])['format'](_0xcd3f('0xa2'))[_0xcd3f('0xbe')](),'closedAt':_0x3c75a0[_0xcd3f('0x6b')]?moment(_0x3c75a0['closedAt'])[_0xcd3f('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x3c75a0['disposition'],'chatInfo':{'browser':_0x3c75a0[_0xcd3f('0xbf')],'os':_0x3c75a0[_0xcd3f('0xc0')],'referer':_0x3c75a0[_0xcd3f('0xc1')],'customerIp':_0x3c75a0[_0xcd3f('0xc2')],'customerPort':_0x3c75a0[_0xcd3f('0xc3')]?_0x3c75a0[_0xcd3f('0xc3')]:'N.A.'},'messages':_(_0x3c75a0[_0xcd3f('0x80')])[_0xcd3f('0xc4')]()[_0xcd3f('0x9f')]({'secret':![]})[_0xcd3f('0x3b')](function(_0x5c3607){if(_0x5c3607['Attachment']){var _0x85a93a=path[_0xcd3f('0x74')](_0xff4cd6,_0x5c3607[_0xcd3f('0x70')][_0xcd3f('0x76')]);if(fs[_0xcd3f('0xc5')](_0x85a93a)){fs['createReadStream'](_0x85a93a)[_0xcd3f('0xc6')](fs['createWriteStream'](path[_0xcd3f('0x74')](_0x1f4c04,_0x5c3607[_0xcd3f('0x70')]['basename'])));}}return{'date':moment(_0x5c3607['createdAt'])['format'](_0xcd3f('0xa2'))[_0xcd3f('0xbe')](),'sender':_0x5c3607[_0xcd3f('0x8c')]===_0xcd3f('0xc7')?_0x5c3607['User']?_0x5c3607[_0xcd3f('0x7e')][_0xcd3f('0x58')]:_0xcd3f('0x87'):_0x5c3607[_0xcd3f('0x68')]['firstName']+(_0x5c3607[_0xcd3f('0x68')][_0xcd3f('0xb8')]?'\x20'+_0x5c3607[_0xcd3f('0x68')][_0xcd3f('0xb8')]:''),'body':_0x5c3607[_0xcd3f('0x70')]?_0x5c3607[_0xcd3f('0x70')][_0xcd3f('0x76')]:_0x5c3607['body'],'direction':_0x5c3607[_0xcd3f('0x8c')]===_0xcd3f('0xc7')?'A':'C','secret':_0x5c3607['secret'],'read':_0x5c3607['read'],'attachment':_0x5c3607['Attachment']};})[_0xcd3f('0xc8')]()};return ejs[_0xcd3f('0xc9')](path[_0xcd3f('0x74')](config[_0xcd3f('0x7a')],'server',_0xcd3f('0xca'),'downloadInteraction.ejs'),{'interaction':_0x3be1af})['then'](function(_0x16aded){var _0x7e6cb7=path['join'](_0x1f4c04,'transcript-'+_0x3c75a0['id']+'-'+_0x5ac838+_0xcd3f('0xcb'));var _0xeabbe0={'path':_0x7e6cb7,'channel':'Chat','interactionId':_0x3c75a0['id']};return pdf[_0xcd3f('0xcc')](_0x16aded,_0xeabbe0);})['then'](function(){return new Promise(function(_0x1f2604,_0x192efe){zipdir(_0x1f4c04,{'saveTo':_0x28e59b},function(_0x44a322,_0x2dd749){if(_0x44a322)return _0x192efe(_0x44a322);return _0x1f2604(_0x2dd749);});})[_0xcd3f('0x1a')](function(){return new BPromise(function(_0x5e6a8a,_0x44699b){rimraf(_0x1f4c04,function(_0x5bf34e){if(_0x5bf34e)_0x44699b(_0x5bf34e);return _0x5e6a8a();});});})[_0xcd3f('0x1a')](function(){return _0x5139c3['download'](_0x28e59b,_0x12d719,function(_0x3cff09){if(_0x3cff09){logger[_0xcd3f('0x20')](_0xcd3f('0xcd'),_0x3cff09);}else{fs[_0xcd3f('0xce')](_0x28e59b);}});});});}else{return _0x5139c3[_0xcd3f('0x25')](0xc8);}})[_0xcd3f('0x24')](handleError(_0x5139c3,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 436ab62..6cc75b0 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 _0xcc68=['catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','remove','getUsers','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xcc68,0x13e));var _0x8cc6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcc68[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x8cc6('0x0'));var ChatInteraction=require(_0x8cc6('0x1'))['db'][_0x8cc6('0x2')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8cc6('0x3')};function emitEvent(_0x1ba4ff){return function(_0x4c4049,_0x3f0d54,_0x24abaa){_0x4c4049[_0x8cc6('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2526da){_0x4c4049[_0x8cc6('0x5')](_0x8cc6('0x6'),_0x2526da[_0x8cc6('0x7')](function(_0xf6a014){return{'id':_0xf6a014['id']};}));return ChatMessage[_0x8cc6('0x8')]({'where':{'ChatInteractionId':_0x4c4049['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x383ada){_0x4c4049[_0x8cc6('0x5')](_0x8cc6('0x9'),_0x383ada[_0x8cc6('0xa')]);ChatInteractionEvents['emit'](_0x1ba4ff+':'+_0x4c4049['id'],_0x4c4049);ChatInteractionEvents[_0x8cc6('0xb')](_0x1ba4ff,_0x4c4049);_0x24abaa(null);})[_0x8cc6('0xc')](_0x24abaa(null));};}for(var e in events){if(events[_0x8cc6('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x8cc6('0xe')]=ChatInteractionEvents; \ No newline at end of file +var _0x0180=['catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','getUsers','setDataValue','findAll','then','length','emit'];(function(_0x553a87,_0x1d621f){var _0x12d1e6=function(_0x41ae48){while(--_0x41ae48){_0x553a87['push'](_0x553a87['shift']());}};_0x12d1e6(++_0x1d621f);}(_0x0180,0x14e));var _0x0018=function(_0x1b8d44,_0x5d7628){_0x1b8d44=_0x1b8d44-0x0;var _0x2b4056=_0x0180[_0x1b8d44];return _0x2b4056;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x0018('0x0'))['db'][_0x0018('0x1')];var ChatMessage=require(_0x0018('0x0'))['db'][_0x0018('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0018('0x3')](0x0);var events={'afterCreate':_0x0018('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4f06c4){return function(_0x456555,_0x7eecd1,_0x1e3209){_0x456555[_0x0018('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x21a49a){_0x456555[_0x0018('0x6')]('Users',_0x21a49a['map'](function(_0x1b5e34){return{'id':_0x1b5e34['id']};}));return ChatMessage[_0x0018('0x7')]({'where':{'ChatInteractionId':_0x456555['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0018('0x8')](function(_0x1f5478){_0x456555[_0x0018('0x6')]('unreadMessages',_0x1f5478[_0x0018('0x9')]);ChatInteractionEvents[_0x0018('0xa')](_0x4f06c4+':'+_0x456555['id'],_0x456555);ChatInteractionEvents[_0x0018('0xa')](_0x4f06c4,_0x456555);_0x1e3209(null);})[_0x0018('0xb')](_0x1e3209(null));};}for(var e in events){if(events[_0x0018('0xc')](e)){var event=events[e];ChatInteraction[_0x0018('0xd')](e,emitEvent(event));}}module[_0x0018('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 9dd6df9..b72c945 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 _0x5bd5=['rimraf','../../config/environment','./chatInteraction.attributes','ChatInteraction','changed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5d9fd1,_0x599829){var _0x463422=function(_0x43c9c7){while(--_0x43c9c7){_0x5d9fd1['push'](_0x5d9fd1['shift']());}};_0x463422(++_0x599829);}(_0x5bd5,0x99));var _0x55bd=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x5bd5[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0x55bd('0x0'));var util=require(_0x55bd('0x1'));var logger=require(_0x55bd('0x2'))(_0x55bd('0x3'));var moment=require(_0x55bd('0x4'));var BPromise=require(_0x55bd('0x5'));var rp=require(_0x55bd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x55bd('0x7'));var config=require(_0x55bd('0x8'));var attributes=require(_0x55bd('0x9'));module['exports']=function(_0x14069d,_0x11fb2a){return _0x14069d['define'](_0x55bd('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1e55c4,_0x2e2c3a,_0xea7264){if(_0x1e55c4[_0x55bd('0xb')]('closed')){_0x1e55c4[_0x55bd('0xc')]=moment()[_0x55bd('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0xea7264(null,_0x1e55c4);}},'charset':_0x55bd('0xe'),'collate':_0x55bd('0xf')});}; \ No newline at end of file +var _0x309c=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x42fe1c,_0x12e98f){var _0x12d352=function(_0xfe48eb){while(--_0xfe48eb){_0x42fe1c['push'](_0x42fe1c['shift']());}};_0x12d352(++_0x12e98f);}(_0x309c,0xc6));var _0xc309=function(_0x4d458c,_0x572215){_0x4d458c=_0x4d458c-0x0;var _0x59d69b=_0x309c[_0x4d458c];return _0x59d69b;};'use strict';var _=require('lodash');var util=require(_0xc309('0x0'));var logger=require('../../config/logger')(_0xc309('0x1'));var moment=require('moment');var BPromise=require(_0xc309('0x2'));var rp=require(_0xc309('0x3'));var fs=require('fs');var path=require(_0xc309('0x4'));var rimraf=require(_0xc309('0x5'));var config=require(_0xc309('0x6'));var attributes=require(_0xc309('0x7'));module[_0xc309('0x8')]=function(_0x510590,_0x4d3900){return _0x510590[_0xc309('0x9')]('ChatInteraction',attributes,{'tableName':_0xc309('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c8e1b,_0x5e11e6,_0x2675cc){if(_0x2c8e1b[_0xc309('0xb')](_0xc309('0xc'))){_0x2c8e1b[_0xc309('0xd')]=moment()[_0xc309('0xe')](_0xc309('0xf'));}_0x2675cc(null,_0x2c8e1b);}},'charset':_0xc309('0x10'),'collate':_0xc309('0x11')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 3e960a2..29f21f1 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 _0xa0e3=['catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s','message','result'];(function(_0x2801fe,_0x12ff25){var _0x1a16a1=function(_0x11d05b){while(--_0x11d05b){_0x2801fe['push'](_0x2801fe['shift']());}};_0x1a16a1(++_0x12ff25);}(_0xa0e3,0x10d));var _0x3a0e=function(_0x8b16e2,_0x2eeb8e){_0x8b16e2=_0x8b16e2-0x0;var _0x4a7277=_0xa0e3[_0x8b16e2];return _0x4a7277;};'use strict';var _=require(_0x3a0e('0x0'));var util=require(_0x3a0e('0x1'));var moment=require('moment');var BPromise=require(_0x3a0e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a0e('0x3'));var db=require(_0x3a0e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a0e('0x5'))(_0x3a0e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3a0e('0x7')][_0x3a0e('0x8')]({'port':0x232a});config[_0x3a0e('0x9')]=_[_0x3a0e('0xa')](config['redis'],{'host':_0x3a0e('0xb'),'port':0x18eb});var socket=require(_0x3a0e('0xc'))(new Redis(config[_0x3a0e('0x9')]));require(_0x3a0e('0xd'))[_0x3a0e('0xe')](socket);function respondWithRpcPromise(_0x36ed31,_0x1c40d6,_0x1fdb15){return new BPromise(function(_0x2d42eb,_0x32062a){return client[_0x3a0e('0xf')](_0x36ed31,_0x1fdb15)[_0x3a0e('0x10')](function(_0x33e944){logger[_0x3a0e('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x1c40d6,_0x3a0e('0x12'));logger[_0x3a0e('0x13')](_0x3a0e('0x14'),_0x1c40d6,_0x3a0e('0x12'),JSON['stringify'](_0x33e944));if(_0x33e944['error']){if(_0x33e944[_0x3a0e('0x15')]['code']===0x1f4){logger[_0x3a0e('0x15')](_0x3a0e('0x16'),_0x1c40d6,_0x33e944[_0x3a0e('0x15')][_0x3a0e('0x17')]);return _0x32062a(_0x33e944['error'][_0x3a0e('0x17')]);}logger['error'](_0x3a0e('0x16'),_0x1c40d6,_0x33e944[_0x3a0e('0x15')][_0x3a0e('0x17')]);return _0x2d42eb(_0x33e944[_0x3a0e('0x15')]['message']);}else{logger[_0x3a0e('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x1c40d6,_0x3a0e('0x12'));_0x2d42eb(_0x33e944[_0x3a0e('0x18')]['message']);}})[_0x3a0e('0x19')](function(_0xcf6d46){logger[_0x3a0e('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x1c40d6,_0xcf6d46);_0x32062a(_0xcf6d46);});});}exports[_0x3a0e('0x1a')]=function(_0x56dbf7){var _0x4d1936=this;return new Promise(function(_0x440d1e,_0x3f527d){return db[_0x3a0e('0x1b')][_0x3a0e('0x1c')](_0x56dbf7[_0x3a0e('0x1d')],{'raw':_0x56dbf7[_0x3a0e('0x1e')]?_0x56dbf7[_0x3a0e('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56dbf7[_0x3a0e('0x1e')]?_0x56dbf7[_0x3a0e('0x1e')][_0x3a0e('0x1f')]||null:null,'attributes':_0x56dbf7['options']?_0x56dbf7[_0x3a0e('0x1e')][_0x3a0e('0x20')]||null:null,'limit':_0x56dbf7[_0x3a0e('0x1e')]?_0x56dbf7[_0x3a0e('0x1e')][_0x3a0e('0x21')]||null:null})['then'](function(_0x577f96){logger[_0x3a0e('0x11')]('UpdateChatInteraction',_0x56dbf7);logger[_0x3a0e('0x13')](_0x3a0e('0x1a'),_0x56dbf7,JSON[_0x3a0e('0x22')](_0x577f96));_0x440d1e(_0x577f96);})[_0x3a0e('0x19')](function(_0x2990d5){logger['error'](_0x3a0e('0x1a'),_0x2990d5[_0x3a0e('0x17')],_0x56dbf7);_0x3f527d(_0x4d1936[_0x3a0e('0x15')](0x1f4,_0x2990d5['message']));});});};exports[_0x3a0e('0x23')]=function(_0x41a918){return new Promise(function(_0xdf92d2,_0x31ffca){return db[_0x3a0e('0x1b')][_0x3a0e('0x24')]({'where':_0x41a918[_0x3a0e('0x1e')]?_0x41a918[_0x3a0e('0x1e')]['where']||null:null})[_0x3a0e('0x10')](function(_0x1b2ac8){if(_0x1b2ac8){return _0x1b2ac8[_0x3a0e('0x25')](_0x41a918[_0x3a0e('0x1d')][_0x3a0e('0x26')],_[_0x3a0e('0x27')](_0x41a918[_0x3a0e('0x1d')],[_0x3a0e('0x26'),'id'])||{});}})[_0x3a0e('0x28')](function(_0x5597ba){logger[_0x3a0e('0x11')](_0x3a0e('0x29'),_0x41a918);logger['debug'](_0x3a0e('0x29'),_0x41a918,JSON[_0x3a0e('0x22')](_0x5597ba));_0xdf92d2(_0x5597ba);})[_0x3a0e('0x19')](function(_0x3b0327){logger[_0x3a0e('0x15')](_0x3a0e('0x29'),_0x3b0327[_0x3a0e('0x17')],_0x41a918);_0x31ffca(_this[_0x3a0e('0x15')](0x1f4,_0x3b0327['message']));});});}; \ No newline at end of file +var _0x1f66=['ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','update','body','raw','options','attributes','AddTagsToChatInteraction','ChatInteraction','where','ids','omit','spread','AddTags','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3e9fba,_0x442564){var _0x32d982=function(_0x298a91){while(--_0x298a91){_0x3e9fba['push'](_0x3e9fba['shift']());}};_0x32d982(++_0x442564);}(_0x1f66,0x1e5));var _0x61f6=function(_0x38beee,_0x5bd600){_0x38beee=_0x38beee-0x0;var _0x67bb2f=_0x1f66[_0x38beee];return _0x67bb2f;};'use strict';var _=require(_0x61f6('0x0'));var util=require(_0x61f6('0x1'));var moment=require(_0x61f6('0x2'));var BPromise=require('bluebird');var rs=require(_0x61f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x61f6('0x4'))(_0x61f6('0x5'));var config=require(_0x61f6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x61f6('0x7')][_0x61f6('0x8')]({'port':0x232a});config[_0x61f6('0x9')]=_[_0x61f6('0xa')](config[_0x61f6('0x9')],{'host':_0x61f6('0xb'),'port':0x18eb});var socket=require(_0x61f6('0xc'))(new Redis(config[_0x61f6('0x9')]));require('./chatInteraction.socket')[_0x61f6('0xd')](socket);function respondWithRpcPromise(_0x4fd20e,_0x24fdfd,_0x53b6e2){return new BPromise(function(_0x3c1bc5,_0x303d4d){return client['request'](_0x4fd20e,_0x53b6e2)[_0x61f6('0xe')](function(_0x2768de){logger[_0x61f6('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x24fdfd,_0x61f6('0x10'));logger[_0x61f6('0x11')](_0x61f6('0x12'),_0x24fdfd,_0x61f6('0x10'),JSON[_0x61f6('0x13')](_0x2768de));if(_0x2768de[_0x61f6('0x14')]){if(_0x2768de[_0x61f6('0x14')][_0x61f6('0x15')]===0x1f4){logger[_0x61f6('0x14')](_0x61f6('0x16'),_0x24fdfd,_0x2768de['error'][_0x61f6('0x17')]);return _0x303d4d(_0x2768de[_0x61f6('0x14')][_0x61f6('0x17')]);}logger[_0x61f6('0x14')](_0x61f6('0x16'),_0x24fdfd,_0x2768de[_0x61f6('0x14')][_0x61f6('0x17')]);return _0x3c1bc5(_0x2768de[_0x61f6('0x14')][_0x61f6('0x17')]);}else{logger['info'](_0x61f6('0x16'),_0x24fdfd,'request\x20sent');_0x3c1bc5(_0x2768de[_0x61f6('0x18')]['message']);}})[_0x61f6('0x19')](function(_0x5f2a21){logger['error'](_0x61f6('0x16'),_0x24fdfd,_0x5f2a21);_0x303d4d(_0x5f2a21);});});}exports[_0x61f6('0x1a')]=function(_0x16ba05){var _0x246a30=this;return new Promise(function(_0x300fd3,_0x5d331f){return db['ChatInteraction'][_0x61f6('0x1b')](_0x16ba05[_0x61f6('0x1c')],{'raw':_0x16ba05['options']?_0x16ba05['options'][_0x61f6('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16ba05[_0x61f6('0x1e')]?_0x16ba05['options']['where']||null:null,'attributes':_0x16ba05['options']?_0x16ba05[_0x61f6('0x1e')][_0x61f6('0x1f')]||null:null,'limit':_0x16ba05[_0x61f6('0x1e')]?_0x16ba05[_0x61f6('0x1e')]['limit']||null:null})[_0x61f6('0xe')](function(_0x4ff692){logger['info'](_0x61f6('0x1a'),_0x16ba05);logger['debug'](_0x61f6('0x1a'),_0x16ba05,JSON[_0x61f6('0x13')](_0x4ff692));_0x300fd3(_0x4ff692);})[_0x61f6('0x19')](function(_0x2897a0){logger[_0x61f6('0x14')]('UpdateChatInteraction',_0x2897a0[_0x61f6('0x17')],_0x16ba05);_0x5d331f(_0x246a30[_0x61f6('0x14')](0x1f4,_0x2897a0[_0x61f6('0x17')]));});});};exports[_0x61f6('0x20')]=function(_0x17f40d){return new Promise(function(_0x43672c,_0x39aa52){return db[_0x61f6('0x21')]['find']({'where':_0x17f40d[_0x61f6('0x1e')]?_0x17f40d['options'][_0x61f6('0x22')]||null:null})[_0x61f6('0xe')](function(_0x5dd3f1){if(_0x5dd3f1){return _0x5dd3f1['addTags'](_0x17f40d[_0x61f6('0x1c')][_0x61f6('0x23')],_[_0x61f6('0x24')](_0x17f40d[_0x61f6('0x1c')],[_0x61f6('0x23'),'id'])||{});}})[_0x61f6('0x25')](function(_0x2e89c3){logger[_0x61f6('0xf')](_0x61f6('0x26'),_0x17f40d);logger[_0x61f6('0x11')](_0x61f6('0x26'),_0x17f40d,JSON[_0x61f6('0x13')](_0x2e89c3));_0x43672c(_0x2e89c3);})[_0x61f6('0x19')](function(_0x19e75c){logger[_0x61f6('0x14')](_0x61f6('0x26'),_0x19e75c['message'],_0x17f40d);_0x39aa52(_this[_0x61f6('0x14')](0x1f4,_0x19e75c[_0x61f6('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index c6321e6..3c91916 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 _0x3b41=['./chatInteraction.events','save','remove','update','removeListener','register','length','chatInteraction:'];(function(_0x53556b,_0x2f781b){var _0x1b4dce=function(_0x50f717){while(--_0x50f717){_0x53556b['push'](_0x53556b['shift']());}};_0x1b4dce(++_0x2f781b);}(_0x3b41,0x78));var _0x13b4=function(_0xf26d40,_0x2f4f46){_0xf26d40=_0xf26d40-0x0;var _0x50b68c=_0x3b41[_0xf26d40];return _0x50b68c;};'use strict';var ChatInteractionEvents=require(_0x13b4('0x0'));var events=[_0x13b4('0x1'),_0x13b4('0x2'),_0x13b4('0x3')];function createListener(_0x4c325d,_0x2e4927){return function(_0x1b243b){_0x2e4927['emit'](_0x4c325d,_0x1b243b);};}function removeListener(_0xa26237,_0x547701){return function(){ChatInteractionEvents[_0x13b4('0x4')](_0xa26237,_0x547701);};}exports[_0x13b4('0x5')]=function(_0x3b9892){for(var _0xf6d1f4=0x0,_0x43a76a=events[_0x13b4('0x6')];_0xf6d1f4<_0x43a76a;_0xf6d1f4++){var _0xef1e0c=events[_0xf6d1f4];var _0x177388=createListener(_0x13b4('0x7')+_0xef1e0c,_0x3b9892);ChatInteractionEvents['on'](_0xef1e0c,_0x177388);}}; \ No newline at end of file +var _0x3ba1=['update','emit','removeListener','chatInteraction:','save','remove'];(function(_0x502b00,_0x5d8366){var _0x57bba2=function(_0x1dca99){while(--_0x1dca99){_0x502b00['push'](_0x502b00['shift']());}};_0x57bba2(++_0x5d8366);}(_0x3ba1,0x1ae));var _0x13ba=function(_0xf2b54c,_0xed0f68){_0xf2b54c=_0xf2b54c-0x0;var _0x558c5a=_0x3ba1[_0xf2b54c];return _0x558c5a;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x13ba('0x0'),_0x13ba('0x1'),_0x13ba('0x2')];function createListener(_0x25ce9b,_0x4de222){return function(_0x2c8865){_0x4de222[_0x13ba('0x3')](_0x25ce9b,_0x2c8865);};}function removeListener(_0x810ef0,_0x44687b){return function(){ChatInteractionEvents[_0x13ba('0x4')](_0x810ef0,_0x44687b);};}exports['register']=function(_0x112247){for(var _0x3201f7=0x0,_0x472d2e=events['length'];_0x3201f7<_0x472d2e;_0x3201f7++){var _0x5877b1=events[_0x3201f7];var _0x397430=createListener(_0x13ba('0x5')+_0x5877b1,_0x112247);ChatInteractionEvents['on'](_0x5877b1,_0x397430);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 81b71ed..1e27998 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 _0xd819=['put','/:id','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','get','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','now','originalname','/:id/attachment_upload','addMessage','/:id/tags','chat'];(function(_0x480584,_0x4e92b7){var _0xfcfe1a=function(_0x8515c1){while(--_0x8515c1){_0x480584['push'](_0x480584['shift']());}};_0xfcfe1a(++_0x4e92b7);}(_0xd819,0x73));var _0x9d81=function(_0x1ae1fb,_0x81c2ec){_0x1ae1fb=_0x1ae1fb-0x0;var _0x57166=_0xd819[_0x1ae1fb];return _0x57166;};'use strict';var multer=require(_0x9d81('0x0'));var util=require(_0x9d81('0x1'));var path=require(_0x9d81('0x2'));var timeout=require(_0x9d81('0x3'));var express=require('express');var router=express[_0x9d81('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9d81('0x5'));var config=require('../../config/environment');var controller=require(_0x9d81('0x6'));router['get']('/',auth[_0x9d81('0x7')](),controller[_0x9d81('0x8')]);router['get'](_0x9d81('0x9'),auth[_0x9d81('0x7')](),controller[_0x9d81('0xa')]);router['get']('/:id',auth[_0x9d81('0xb')](),controller[_0x9d81('0xc')]);router[_0x9d81('0xd')](_0x9d81('0xe'),auth[_0x9d81('0xb')](),controller['attachmentDownload']);router[_0x9d81('0xd')](_0x9d81('0xf'),auth[_0x9d81('0x7')](),controller[_0x9d81('0x10')]);router[_0x9d81('0xd')](_0x9d81('0x11'),auth[_0x9d81('0xb')](),controller[_0x9d81('0x12')]);router[_0x9d81('0xd')](_0x9d81('0x13'),auth[_0x9d81('0x7')](),controller[_0x9d81('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9d81('0x15')]);router[_0x9d81('0x16')](_0x9d81('0x17'),auth[_0x9d81('0x7')](),controller[_0x9d81('0x18')]);var upload=multer({'storage':multer[_0x9d81('0x19')]({'destination':function(_0x1138be,_0x157c34,_0x5b35ce){_0x5b35ce(null,path[_0x9d81('0x1a')](config[_0x9d81('0x1b')],_0x9d81('0x1c')));},'filename':function(_0x56ee06,_0x46d282,_0x3f604d){_0x3f604d(null,util['format']('%s-%s',Date[_0x9d81('0x1d')](),_0x46d282[_0x9d81('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9d81('0x16')](_0x9d81('0x1f'),upload['single']('file'),controller['attachmentUpload']);router['post'](_0x9d81('0xf'),auth[_0x9d81('0xb')](),controller[_0x9d81('0x20')]);router[_0x9d81('0x16')](_0x9d81('0x21'),auth[_0x9d81('0x7')](),interaction['tracked'](_0x9d81('0x22'),'chatinteraction:addtags'),controller['addTags']);router[_0x9d81('0x23')](_0x9d81('0x24'),auth[_0x9d81('0x7')](),interaction[_0x9d81('0x25')](_0x9d81('0x22'),_0x9d81('0x26')),controller[_0x9d81('0x27')]);router[_0x9d81('0x23')](_0x9d81('0x28'),controller[_0x9d81('0x29')]);router[_0x9d81('0x23')](_0x9d81('0x2a'),auth[_0x9d81('0xb')](),controller[_0x9d81('0x2b')]);router[_0x9d81('0x23')]('/:id/close',controller[_0x9d81('0x2c')]);router[_0x9d81('0x2d')](_0x9d81('0x24'),auth[_0x9d81('0x7')](),interaction[_0x9d81('0x25')](_0x9d81('0x22'),_0x9d81('0x2e')),controller[_0x9d81('0x2f')]);router[_0x9d81('0x2d')](_0x9d81('0x21'),auth['isAuthenticated'](),controller[_0x9d81('0x30')]);module[_0x9d81('0x31')]=router; \ No newline at end of file +var _0xb52b=['download','post','isAuthenticated','create','/:id/vidaoo','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','describe','/:id','show','isChatInteractionAuthorized','/:id/messages','/:id/my_messages','getMyMessages','/:id/download'];(function(_0x5e618e,_0x377107){var _0x3a7aaa=function(_0x2eacf5){while(--_0x2eacf5){_0x5e618e['push'](_0x5e618e['shift']());}};_0x3a7aaa(++_0x377107);}(_0xb52b,0x11e));var _0xbb52=function(_0x3dfc05,_0x5d7f06){_0x3dfc05=_0x3dfc05-0x0;var _0x3d9973=_0xb52b[_0x3dfc05];return _0x3d9973;};'use strict';var multer=require(_0xbb52('0x0'));var util=require(_0xbb52('0x1'));var path=require(_0xbb52('0x2'));var timeout=require(_0xbb52('0x3'));var express=require(_0xbb52('0x4'));var router=express['Router']();var fs_extra=require(_0xbb52('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbb52('0x6'));var config=require(_0xbb52('0x7'));var controller=require(_0xbb52('0x8'));router[_0xbb52('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb52('0xa')]);router[_0xbb52('0x9')](_0xbb52('0xb'),auth['isAuthenticated'](),controller[_0xbb52('0xc')]);router[_0xbb52('0x9')](_0xbb52('0xd'),auth['isChatInteractionAuthorized'](),controller[_0xbb52('0xe')]);router['get']('/:id/attachment_download',auth[_0xbb52('0xf')](),controller['attachmentDownload']);router[_0xbb52('0x9')](_0xbb52('0x10'),auth['isAuthenticated'](),controller['getMessages']);router[_0xbb52('0x9')](_0xbb52('0x11'),auth[_0xbb52('0xf')](),controller[_0xbb52('0x12')]);router['get'](_0xbb52('0x13'),auth['isAuthenticated'](),controller[_0xbb52('0x14')]);router[_0xbb52('0x15')]('/',auth[_0xbb52('0x16')](),controller[_0xbb52('0x17')]);router[_0xbb52('0x15')](_0xbb52('0x18'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xbb52('0x19')]({'destination':function(_0x27bcdf,_0x5e6992,_0x4913db){_0x4913db(null,path['join'](config[_0xbb52('0x1a')],_0xbb52('0x1b')));},'filename':function(_0x4f6bba,_0x4d5376,_0x22a254){_0x22a254(null,util[_0xbb52('0x1c')](_0xbb52('0x1d'),Date[_0xbb52('0x1e')](),_0x4d5376[_0xbb52('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb52('0x15')](_0xbb52('0x20'),upload['single'](_0xbb52('0x21')),controller[_0xbb52('0x22')]);router[_0xbb52('0x15')](_0xbb52('0x10'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0xbb52('0x15')](_0xbb52('0x23'),auth['isAuthenticated'](),interaction[_0xbb52('0x24')](_0xbb52('0x25'),_0xbb52('0x26')),controller[_0xbb52('0x27')]);router[_0xbb52('0x28')](_0xbb52('0xd'),auth[_0xbb52('0x16')](),interaction['tracked'](_0xbb52('0x25'),_0xbb52('0x29')),controller[_0xbb52('0x2a')]);router[_0xbb52('0x28')]('/:id/custom_update',controller[_0xbb52('0x2b')]);router[_0xbb52('0x28')](_0xbb52('0x2c'),auth[_0xbb52('0xf')](),controller[_0xbb52('0x2d')]);router[_0xbb52('0x28')](_0xbb52('0x2e'),controller['close']);router[_0xbb52('0x2f')](_0xbb52('0xd'),auth[_0xbb52('0x16')](),interaction[_0xbb52('0x24')]('chat',_0xbb52('0x30')),controller[_0xbb52('0x31')]);router[_0xbb52('0x2f')](_0xbb52('0x23'),auth[_0xbb52('0x16')](),controller[_0xbb52('0x32')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index f99ce58..50c6cc7 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 _0x25b1=['exports','TEXT','medium','BOOLEAN'];(function(_0xa7f792,_0x547a8e){var _0x2d5610=function(_0x28bf9b){while(--_0x28bf9b){_0xa7f792['push'](_0xa7f792['shift']());}};_0x2d5610(++_0x547a8e);}(_0x25b1,0xf0));var _0x125b=function(_0x1e45b6,_0x1dad3f){_0x1e45b6=_0x1e45b6-0x0;var _0x444f61=_0x25b1[_0x1e45b6];return _0x444f61;};'use strict';var Sequelize=require('sequelize');module[_0x125b('0x0')]={'body':{'type':Sequelize[_0x125b('0x1')](_0x125b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x125b('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x184e=['exports','TEXT','BOOLEAN','INTEGER','sequelize'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x184e,0x10d));var _0xe184=function(_0x4bb593,_0x272ed0){_0x4bb593=_0x4bb593-0x0;var _0x2da2d8=_0x184e[_0x4bb593];return _0x2da2d8;};'use strict';var Sequelize=require(_0xe184('0x0'));module[_0xe184('0x1')]={'body':{'type':Sequelize[_0xe184('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe184('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe184('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 28871a2..222877c 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 _0xdcf9=['sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','ChatInternalMessage','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','destroy','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','role','resourceId','push','user','createdAt','FromId','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','defaults','localhost','redis','./chatInternalMessage.socket','register'];(function(_0xd454b1,_0x2bdfbf){var _0x4b9a04=function(_0x1e578c){while(--_0x1e578c){_0xd454b1['push'](_0xd454b1['shift']());}};_0x4b9a04(++_0x2bdfbf);}(_0xdcf9,0x139));var _0x9dcf=function(_0x5bf01e,_0x3fad73){_0x5bf01e=_0x5bf01e-0x0;var _0x5c5550=_0xdcf9[_0x5bf01e];return _0x5c5550;};'use strict';var emlformat=require(_0x9dcf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9dcf('0x1'));var jsonpatch=require(_0x9dcf('0x2'));var rp=require(_0x9dcf('0x3'));var moment=require(_0x9dcf('0x4'));var BPromise=require(_0x9dcf('0x5'));var Mustache=require(_0x9dcf('0x6'));var util=require(_0x9dcf('0x7'));var path=require(_0x9dcf('0x8'));var sox=require(_0x9dcf('0x9'));var csv=require(_0x9dcf('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9dcf('0xb'));var _=require(_0x9dcf('0xc'));var squel=require(_0x9dcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x9dcf('0xe'));var deskjs=require(_0x9dcf('0xf'));var toCsv=require(_0x9dcf('0xa'));var querystring=require(_0x9dcf('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9dcf('0x11'));var qs=require(_0x9dcf('0x12'));var as=require(_0x9dcf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9dcf('0x14'))(_0x9dcf('0x15'));var utils=require(_0x9dcf('0x16'));var config=require(_0x9dcf('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x9dcf('0x18')](config['redis'],{'host':_0x9dcf('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9dcf('0x1a')]));require(_0x9dcf('0x1b'))[_0x9dcf('0x1c')](socket);function respondWithStatusCode(_0x2d1ad6,_0x4208e0){_0x4208e0=_0x4208e0||0xcc;return function(_0x1a6182){if(_0x1a6182){return _0x2d1ad6[_0x9dcf('0x1d')](_0x4208e0);}return _0x2d1ad6[_0x9dcf('0x1e')](_0x4208e0)[_0x9dcf('0x1f')]();};}function respondWithResult(_0x2ac0e1,_0x49d162){_0x49d162=_0x49d162||0xc8;return function(_0xa6b528){if(_0xa6b528){return _0x2ac0e1[_0x9dcf('0x1e')](_0x49d162)[_0x9dcf('0x20')](_0xa6b528);}};}function respondWithFilteredResult(_0x2fff52,_0xb0c7e7){return function(_0x128ac8){if(_0x128ac8){var _0x1f51ba=typeof _0xb0c7e7[_0x9dcf('0x21')]===_0x9dcf('0x22')&&typeof _0xb0c7e7[_0x9dcf('0x23')]==='undefined';var _0xab2b5e=_0x128ac8[_0x9dcf('0x24')];var _0x5f31b3=_0x1f51ba?0x0:_0xb0c7e7[_0x9dcf('0x21')];var _0x34d35a=_0x1f51ba?_0x128ac8[_0x9dcf('0x24')]:_0xb0c7e7['offset']+_0xb0c7e7[_0x9dcf('0x23')];var _0x8c3097;if(_0x34d35a>=_0xab2b5e){_0x34d35a=_0xab2b5e;_0x8c3097=0xc8;}else{_0x8c3097=0xce;}_0x2fff52[_0x9dcf('0x1e')](_0x8c3097);return _0x2fff52['set'](_0x9dcf('0x25'),_0x5f31b3+'-'+_0x34d35a+'/'+_0xab2b5e)['json'](_0x128ac8);}return null;};}function patchUpdates(_0x41af80){return function(_0x4ce53f){try{jsonpatch[_0x9dcf('0x26')](_0x4ce53f,_0x41af80,!![]);}catch(_0x4c239c){return BPromise[_0x9dcf('0x27')](_0x4c239c);}return _0x4ce53f['save']();};}function saveUpdates(_0x4dae87,_0x1e4975){return function(_0x3fd5e9){if(_0x3fd5e9){return _0x3fd5e9[_0x9dcf('0x28')](_0x4dae87)[_0x9dcf('0x29')](function(_0x1805a0){return _0x1805a0;});}return null;};}function removeEntity(_0x4dfce6,_0x47e6ee){return function(_0x4ec7cc){if(_0x4ec7cc){return _0x4ec7cc['destroy']()[_0x9dcf('0x29')](function(){_0x4dfce6['status'](0xcc)[_0x9dcf('0x1f')]();});}};}function handleEntityNotFound(_0x4ae396,_0x4766a6){return function(_0x9c7ec9){if(!_0x9c7ec9){_0x4ae396['sendStatus'](0x194);}return _0x9c7ec9;};}function handleError(_0xb9052e,_0x3fe184){_0x3fe184=_0x3fe184||0x1f4;return function(_0x3a0420){logger[_0x9dcf('0x2a')](_0x3a0420[_0x9dcf('0x2b')]);if(_0x3a0420['name']){delete _0x3a0420[_0x9dcf('0x2c')];}_0xb9052e[_0x9dcf('0x1e')](_0x3fe184)[_0x9dcf('0x2d')](_0x3a0420);};}exports[_0x9dcf('0x2e')]=function(_0x3cc3dd,_0x38589c){var _0x46504e={},_0x242439={},_0x60fc9b={'count':0x0,'rows':[]};var _0x378acd=_['map'](db[_0x9dcf('0x2f')]['rawAttributes'],function(_0x1bdcc0){return{'name':_0x1bdcc0[_0x9dcf('0x30')],'type':_0x1bdcc0[_0x9dcf('0x31')]['key']};});_0x242439[_0x9dcf('0x32')]=_[_0x9dcf('0x33')](_0x378acd,_0x9dcf('0x2c'));_0x242439['query']=_[_0x9dcf('0x34')](_0x3cc3dd[_0x9dcf('0x35')]);_0x242439['filters']=_[_0x9dcf('0x36')](_0x242439[_0x9dcf('0x32')],_0x242439['query']);_0x46504e[_0x9dcf('0x37')]=_[_0x9dcf('0x36')](_0x242439[_0x9dcf('0x32')],qs[_0x9dcf('0x38')](_0x3cc3dd[_0x9dcf('0x35')][_0x9dcf('0x38')]));_0x46504e[_0x9dcf('0x37')]=_0x46504e[_0x9dcf('0x37')][_0x9dcf('0x39')]?_0x46504e[_0x9dcf('0x37')]:_0x242439[_0x9dcf('0x32')];if(!_0x3cc3dd['query'][_0x9dcf('0x3a')](_0x9dcf('0x3b'))){_0x46504e['limit']=qs['limit'](_0x3cc3dd[_0x9dcf('0x35')][_0x9dcf('0x23')]);_0x46504e[_0x9dcf('0x21')]=qs['offset'](_0x3cc3dd[_0x9dcf('0x35')][_0x9dcf('0x21')]);}_0x46504e[_0x9dcf('0x3c')]=qs[_0x9dcf('0x3d')](_0x3cc3dd['query'][_0x9dcf('0x3d')]);_0x46504e[_0x9dcf('0x3e')]=qs[_0x9dcf('0x3f')](_[_0x9dcf('0x40')](_0x3cc3dd[_0x9dcf('0x35')],_0x242439[_0x9dcf('0x3f')]),_0x378acd);if(_0x3cc3dd[_0x9dcf('0x35')][_0x9dcf('0x41')]){_0x46504e[_0x9dcf('0x3e')]=_[_0x9dcf('0x42')](_0x46504e[_0x9dcf('0x3e')],{'$or':_[_0x9dcf('0x33')](_0x378acd,function(_0x39ff94){if(_0x39ff94[_0x9dcf('0x31')]!=='VIRTUAL'){var _0x452ddf={};_0x452ddf[_0x39ff94[_0x9dcf('0x2c')]]={'$like':'%'+_0x3cc3dd[_0x9dcf('0x35')][_0x9dcf('0x41')]+'%'};return _0x452ddf;}})});}_0x46504e=_[_0x9dcf('0x42')]({},_0x46504e,_0x3cc3dd[_0x9dcf('0x43')]);var _0x4cf8a3={'where':_0x46504e[_0x9dcf('0x3e')]};return db[_0x9dcf('0x2f')][_0x9dcf('0x24')](_0x4cf8a3)[_0x9dcf('0x29')](function(_0x3b4024){_0x60fc9b[_0x9dcf('0x24')]=_0x3b4024;if(_0x3cc3dd[_0x9dcf('0x35')][_0x9dcf('0x44')]){_0x46504e[_0x9dcf('0x45')]=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x46504e);})[_0x9dcf('0x29')](function(_0x3252e6){_0x60fc9b['rows']=_0x3252e6;return _0x60fc9b;})[_0x9dcf('0x29')](respondWithFilteredResult(_0x38589c,_0x46504e))[_0x9dcf('0x46')](handleError(_0x38589c,null));};exports[_0x9dcf('0x47')]=function(_0x49d11b,_0x1c3815){var _0x2bb532={'raw':!![],'where':{'id':_0x49d11b[_0x9dcf('0x48')]['id']}},_0x3d2f81={};_0x3d2f81[_0x9dcf('0x32')]=_[_0x9dcf('0x34')](db[_0x9dcf('0x2f')][_0x9dcf('0x49')]);_0x3d2f81['query']=_['keys'](_0x49d11b[_0x9dcf('0x35')]);_0x3d2f81[_0x9dcf('0x3f')]=_['intersection'](_0x3d2f81[_0x9dcf('0x32')],_0x3d2f81[_0x9dcf('0x35')]);_0x2bb532[_0x9dcf('0x37')]=_[_0x9dcf('0x36')](_0x3d2f81[_0x9dcf('0x32')],qs[_0x9dcf('0x38')](_0x49d11b['query'][_0x9dcf('0x38')]));_0x2bb532['attributes']=_0x2bb532['attributes'][_0x9dcf('0x39')]?_0x2bb532[_0x9dcf('0x37')]:_0x3d2f81[_0x9dcf('0x32')];if(_0x49d11b[_0x9dcf('0x35')][_0x9dcf('0x44')]){_0x2bb532[_0x9dcf('0x45')]=[{'all':!![]}];}_0x2bb532=_[_0x9dcf('0x42')]({},_0x2bb532,_0x49d11b[_0x9dcf('0x43')]);return db[_0x9dcf('0x2f')][_0x9dcf('0x4a')](_0x2bb532)[_0x9dcf('0x29')](handleEntityNotFound(_0x1c3815,null))[_0x9dcf('0x29')](respondWithResult(_0x1c3815,null))['catch'](handleError(_0x1c3815,null));};exports[_0x9dcf('0x4b')]=function(_0x573ce3,_0x446e93){return db[_0x9dcf('0x2f')][_0x9dcf('0x4b')](_0x573ce3['body'],{})[_0x9dcf('0x29')](respondWithResult(_0x446e93,0xc9))[_0x9dcf('0x46')](handleError(_0x446e93,null));};exports['update']=function(_0x33d960,_0x241865){if(_0x33d960[_0x9dcf('0x4c')]['id']){delete _0x33d960[_0x9dcf('0x4c')]['id'];}return db[_0x9dcf('0x2f')]['find']({'where':{'id':_0x33d960[_0x9dcf('0x48')]['id']}})['then'](handleEntityNotFound(_0x241865,null))['then'](saveUpdates(_0x33d960[_0x9dcf('0x4c')],null))[_0x9dcf('0x29')](respondWithResult(_0x241865,null))[_0x9dcf('0x46')](handleError(_0x241865,null));};exports[_0x9dcf('0x4d')]=function(_0x54cd87,_0x2a8f9f){return db['ChatInternalMessage']['find']({'where':{'id':_0x54cd87['params']['id']}})[_0x9dcf('0x29')](handleEntityNotFound(_0x2a8f9f,null))[_0x9dcf('0x29')](removeEntity(_0x2a8f9f,null))[_0x9dcf('0x46')](handleError(_0x2a8f9f,null));};exports[_0x9dcf('0x4e')]=function(_0x5ecfe0,_0x1cc2f4){return db[_0x9dcf('0x2f')][_0x9dcf('0x4e')]()[_0x9dcf('0x29')](respondWithResult(_0x1cc2f4,null))[_0x9dcf('0x46')](handleError(_0x1cc2f4,null));};function wrapUser(_0x290d27){return function(_0x5e24d7){var _0x5c2ae6=_0x290d27[_0x9dcf('0x4f')]({'plain':!![]});_0x5c2ae6[_0x9dcf('0x50')]=[];if(_0x5e24d7){_0x5c2ae6[_0x9dcf('0x51')]=_0x5e24d7['createdAt'];_0x5c2ae6[_0x9dcf('0x52')]=_0x5e24d7;}else{_0x5c2ae6[_0x9dcf('0x51')]=moment(0x0)[_0x9dcf('0x53')](_0x9dcf('0x54'));_0x5c2ae6['lastMessage']={};}return _0x5c2ae6;};}exports[_0x9dcf('0x55')]=function(_0x5983ab,_0xcb871a,_0x4163b3){var _0xc64c=[];return db[_0x9dcf('0x56')][_0x9dcf('0x57')]({'where':{'role':[_0x9dcf('0x58'),'admin','user']},'attributes':['id','fullname',_0x9dcf('0x2c'),'role',_0x9dcf('0x59'),_0x9dcf('0x5a'),_0x9dcf('0x5b'),_0x9dcf('0x5c'),_0x9dcf('0x5d'),_0x9dcf('0x5e')],'order':qs[_0x9dcf('0x3d')](_0x9dcf('0x5f')),'include':[{'model':db[_0x9dcf('0x60')],'as':_0x9dcf('0x61'),'attributes':['id','name',_0x9dcf('0x31')],'through':{'attributes':[]}}]})[_0x9dcf('0x29')](function(_0x268e2f){if(_0x268e2f){var _0x34d6bd=_0x5983ab['user'][_0x9dcf('0x4f')]({'plain':!![]});if(!_0x34d6bd)throw new Error(_0x9dcf('0x62'));if(_0x34d6bd['role']==='user'){return db[_0x9dcf('0x63')][_0x9dcf('0x4a')]({'where':{'name':_0x9dcf('0x64'),'userProfileId':_0x34d6bd[_0x9dcf('0x65')]},'raw':!![]})[_0x9dcf('0x29')](function(_0x295bf0){if(_0x295bf0){if(_0x295bf0[_0x9dcf('0x66')]===0x0){return db[_0x9dcf('0x67')]['findAll']({'where':{'sectionId':_0x295bf0['id']},'raw':!![]})[_0x9dcf('0x29')](function(_0x5c99d7){var _0x4b6ebc=[];if(_['isEmpty'](_0x5c99d7)){_0x4b6ebc=_['filter'](_0x268e2f,function(_0x35f9d2){if(_0x35f9d2[_0x9dcf('0x68')]!==_0x9dcf('0x58')){return _0x35f9d2;}});return _0x4b6ebc;}else{for(var _0x5e8b20=0x0;_0x5e8b20<_0x268e2f[_0x9dcf('0x39')];_0x5e8b20++){var _0x2fd99f=_0x268e2f[_0x5e8b20];if(_0x2fd99f[_0x9dcf('0x68')]===_0x9dcf('0x58')){var _0x543ba3=_['find'](_0x5c99d7,function(_0x203d5a){return _0x203d5a[_0x9dcf('0x69')]===_0x2fd99f['id'];});if(_0x543ba3)_0x4b6ebc[_0x9dcf('0x6a')](_0x2fd99f);}else{_0x4b6ebc[_0x9dcf('0x6a')](_0x2fd99f);}}return _0x4b6ebc;}});}else{return _0x268e2f;}}else{var _0x3cddb4=_[_0x9dcf('0x41')](_0x268e2f,function(_0x2dba9e){if(_0x2dba9e[_0x9dcf('0x68')]!==_0x9dcf('0x58')){return _0x2dba9e;}});return _0x3cddb4;}});}else{return _0x268e2f;}}})[_0x9dcf('0x29')](function(_0x20fe5b){var _0x2691a9=[];if(_0x20fe5b){_0xc64c=_0x20fe5b;for(var _0xf892be=0x0;_0xf892be<_0x20fe5b[_0x9dcf('0x39')];_0xf892be+=0x1){_0xc64c[_0xf892be][_0x9dcf('0x50')]=[];_0x2691a9[_0x9dcf('0x6a')](db[_0x9dcf('0x2f')][_0x9dcf('0x4a')]({'where':{'FromId':[_0x5983ab[_0x9dcf('0x6b')]['id'],_0x20fe5b[_0xf892be]['id']],'ToId':[_0x5983ab[_0x9dcf('0x6b')]['id'],_0x20fe5b[_0xf892be]['id']],'ChatGroupId':null},'attributes':['id',_0x9dcf('0x6c'),_0x9dcf('0x6d'),_0x9dcf('0x6e'),_0x9dcf('0x6f'),_0x9dcf('0x4c')],'order':qs[_0x9dcf('0x3d')](_0x9dcf('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9dcf('0x29')](wrapUser(_0x20fe5b[_0xf892be])));}return BPromise[_0x9dcf('0x71')](_0x2691a9);}return[];})[_0x9dcf('0x29')](function(_0x2f9ef3){return{'rows':_0x2f9ef3,'count':_0x2f9ef3[_0x9dcf('0x39')]};})[_0x9dcf('0x29')](respondWithResult(_0xcb871a,null))[_0x9dcf('0x46')](handleError(_0xcb871a,null));}; \ No newline at end of file +var _0x745d=['-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatInternalMessage.socket','register','status','end','json','undefined','limit','offset','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','catch','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','role','userpic','online','allowmessenger','showWebBar','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','read'];(function(_0x2bea6d,_0x441d1c){var _0x39ee0b=function(_0x1b8aa6){while(--_0x1b8aa6){_0x2bea6d['push'](_0x2bea6d['shift']());}};_0x39ee0b(++_0x441d1c);}(_0x745d,0xe0));var _0xd745=function(_0x585447,_0x7cae27){_0x585447=_0x585447-0x0;var _0x3653ad=_0x745d[_0x585447];return _0x3653ad;};'use strict';var emlformat=require(_0xd745('0x0'));var rimraf=require(_0xd745('0x1'));var zipdir=require(_0xd745('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd745('0x3'));var moment=require(_0xd745('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd745('0x5'));var path=require(_0xd745('0x6'));var sox=require(_0xd745('0x7'));var csv=require('to-csv');var ejs=require(_0xd745('0x8'));var fs=require('fs');var fs_extra=require(_0xd745('0x9'));var _=require(_0xd745('0xa'));var squel=require('squel');var crypto=require(_0xd745('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd745('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd745('0xd'));var Papa=require(_0xd745('0xe'));var Redis=require('ioredis');var authService=require(_0xd745('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd745('0x10'));var hardwareService=require(_0xd745('0x11'));var logger=require(_0xd745('0x12'))('api');var utils=require(_0xd745('0x13'));var config=require(_0xd745('0x14'));var licenseUtil=require(_0xd745('0x15'));var db=require(_0xd745('0x16'))['db'];config[_0xd745('0x17')]=_['defaults'](config['redis'],{'host':_0xd745('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd745('0x17')]));require(_0xd745('0x19'))[_0xd745('0x1a')](socket);function respondWithStatusCode(_0x18e783,_0x5ca73a){_0x5ca73a=_0x5ca73a||0xcc;return function(_0x48dc39){if(_0x48dc39){return _0x18e783['sendStatus'](_0x5ca73a);}return _0x18e783[_0xd745('0x1b')](_0x5ca73a)[_0xd745('0x1c')]();};}function respondWithResult(_0xa6dcbc,_0x583cb4){_0x583cb4=_0x583cb4||0xc8;return function(_0x4dd07b){if(_0x4dd07b){return _0xa6dcbc['status'](_0x583cb4)[_0xd745('0x1d')](_0x4dd07b);}};}function respondWithFilteredResult(_0xad01a0,_0x4e46a7){return function(_0x3cd39e){if(_0x3cd39e){var _0xa6303d=typeof _0x4e46a7['offset']===_0xd745('0x1e')&&typeof _0x4e46a7[_0xd745('0x1f')]===_0xd745('0x1e');var _0x4788bf=_0x3cd39e['count'];var _0x2d3655=_0xa6303d?0x0:_0x4e46a7[_0xd745('0x20')];var _0x3e3fd6=_0xa6303d?_0x3cd39e['count']:_0x4e46a7['offset']+_0x4e46a7['limit'];var _0x54fd12;if(_0x3e3fd6>=_0x4788bf){_0x3e3fd6=_0x4788bf;_0x54fd12=0xc8;}else{_0x54fd12=0xce;}_0xad01a0[_0xd745('0x1b')](_0x54fd12);return _0xad01a0[_0xd745('0x21')]('Content-Range',_0x2d3655+'-'+_0x3e3fd6+'/'+_0x4788bf)[_0xd745('0x1d')](_0x3cd39e);}return null;};}function patchUpdates(_0x21c9f0){return function(_0x5f0ea4){try{jsonpatch[_0xd745('0x22')](_0x5f0ea4,_0x21c9f0,!![]);}catch(_0x2bb149){return BPromise[_0xd745('0x23')](_0x2bb149);}return _0x5f0ea4[_0xd745('0x24')]();};}function saveUpdates(_0x17ede3,_0x3bf473){return function(_0x197883){if(_0x197883){return _0x197883[_0xd745('0x25')](_0x17ede3)[_0xd745('0x26')](function(_0x35eb37){return _0x35eb37;});}return null;};}function removeEntity(_0x43d81d,_0x1ea6ed){return function(_0xf52454){if(_0xf52454){return _0xf52454['destroy']()['then'](function(){_0x43d81d[_0xd745('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ced98,_0x5e8a7f){return function(_0x3391ac){if(!_0x3391ac){_0x3ced98[_0xd745('0x27')](0x194);}return _0x3391ac;};}function handleError(_0x4f5cdd,_0xbc4a5b){_0xbc4a5b=_0xbc4a5b||0x1f4;return function(_0x484fa4){logger[_0xd745('0x28')](_0x484fa4[_0xd745('0x29')]);if(_0x484fa4[_0xd745('0x2a')]){delete _0x484fa4[_0xd745('0x2a')];}_0x4f5cdd[_0xd745('0x1b')](_0xbc4a5b)[_0xd745('0x2b')](_0x484fa4);};}exports[_0xd745('0x2c')]=function(_0x33beec,_0xf5e5f0){var _0x2831e6={},_0x4130b9={},_0xea85a1={'count':0x0,'rows':[]};var _0x25949c=_['map'](db[_0xd745('0x2d')][_0xd745('0x2e')],function(_0x2c0da5){return{'name':_0x2c0da5[_0xd745('0x2f')],'type':_0x2c0da5[_0xd745('0x30')][_0xd745('0x31')]};});_0x4130b9[_0xd745('0x32')]=_[_0xd745('0x33')](_0x25949c,_0xd745('0x2a'));_0x4130b9[_0xd745('0x34')]=_[_0xd745('0x35')](_0x33beec['query']);_0x4130b9[_0xd745('0x36')]=_[_0xd745('0x37')](_0x4130b9['model'],_0x4130b9['query']);_0x2831e6[_0xd745('0x38')]=_[_0xd745('0x37')](_0x4130b9[_0xd745('0x32')],qs[_0xd745('0x39')](_0x33beec[_0xd745('0x34')][_0xd745('0x39')]));_0x2831e6[_0xd745('0x38')]=_0x2831e6['attributes'][_0xd745('0x3a')]?_0x2831e6[_0xd745('0x38')]:_0x4130b9['model'];if(!_0x33beec[_0xd745('0x34')]['hasOwnProperty'](_0xd745('0x3b'))){_0x2831e6[_0xd745('0x1f')]=qs[_0xd745('0x1f')](_0x33beec[_0xd745('0x34')]['limit']);_0x2831e6['offset']=qs['offset'](_0x33beec[_0xd745('0x34')][_0xd745('0x20')]);}_0x2831e6[_0xd745('0x3c')]=qs['sort'](_0x33beec['query'][_0xd745('0x3d')]);_0x2831e6[_0xd745('0x3e')]=qs[_0xd745('0x36')](_[_0xd745('0x3f')](_0x33beec[_0xd745('0x34')],_0x4130b9[_0xd745('0x36')]),_0x25949c);if(_0x33beec[_0xd745('0x34')]['filter']){_0x2831e6[_0xd745('0x3e')]=_[_0xd745('0x40')](_0x2831e6[_0xd745('0x3e')],{'$or':_[_0xd745('0x33')](_0x25949c,function(_0xb18c47){if(_0xb18c47[_0xd745('0x30')]!==_0xd745('0x41')){var _0x2755ab={};_0x2755ab[_0xb18c47[_0xd745('0x2a')]]={'$like':'%'+_0x33beec[_0xd745('0x34')][_0xd745('0x42')]+'%'};return _0x2755ab;}})});}_0x2831e6=_[_0xd745('0x40')]({},_0x2831e6,_0x33beec[_0xd745('0x43')]);var _0x587a08={'where':_0x2831e6['where']};return db[_0xd745('0x2d')][_0xd745('0x44')](_0x587a08)['then'](function(_0x487787){_0xea85a1[_0xd745('0x44')]=_0x487787;if(_0x33beec[_0xd745('0x34')][_0xd745('0x45')]){_0x2831e6[_0xd745('0x46')]=[{'all':!![]}];}return db[_0xd745('0x2d')][_0xd745('0x47')](_0x2831e6);})[_0xd745('0x26')](function(_0xff05a0){_0xea85a1[_0xd745('0x48')]=_0xff05a0;return _0xea85a1;})[_0xd745('0x26')](respondWithFilteredResult(_0xf5e5f0,_0x2831e6))['catch'](handleError(_0xf5e5f0,null));};exports[_0xd745('0x49')]=function(_0x508c21,_0xff088e){var _0x543d38={'raw':!![],'where':{'id':_0x508c21[_0xd745('0x4a')]['id']}},_0x351fed={};_0x351fed[_0xd745('0x32')]=_[_0xd745('0x35')](db[_0xd745('0x2d')][_0xd745('0x2e')]);_0x351fed[_0xd745('0x34')]=_['keys'](_0x508c21[_0xd745('0x34')]);_0x351fed[_0xd745('0x36')]=_[_0xd745('0x37')](_0x351fed[_0xd745('0x32')],_0x351fed[_0xd745('0x34')]);_0x543d38[_0xd745('0x38')]=_[_0xd745('0x37')](_0x351fed[_0xd745('0x32')],qs[_0xd745('0x39')](_0x508c21[_0xd745('0x34')][_0xd745('0x39')]));_0x543d38['attributes']=_0x543d38['attributes'][_0xd745('0x3a')]?_0x543d38[_0xd745('0x38')]:_0x351fed['model'];if(_0x508c21[_0xd745('0x34')][_0xd745('0x45')]){_0x543d38[_0xd745('0x46')]=[{'all':!![]}];}_0x543d38=_[_0xd745('0x40')]({},_0x543d38,_0x508c21[_0xd745('0x43')]);return db[_0xd745('0x2d')]['find'](_0x543d38)[_0xd745('0x26')](handleEntityNotFound(_0xff088e,null))[_0xd745('0x26')](respondWithResult(_0xff088e,null))[_0xd745('0x4b')](handleError(_0xff088e,null));};exports[_0xd745('0x4c')]=function(_0x37862d,_0x4e268b){return db[_0xd745('0x2d')][_0xd745('0x4c')](_0x37862d['body'],{})[_0xd745('0x26')](respondWithResult(_0x4e268b,0xc9))['catch'](handleError(_0x4e268b,null));};exports[_0xd745('0x25')]=function(_0x626fff,_0x14521e){if(_0x626fff[_0xd745('0x4d')]['id']){delete _0x626fff[_0xd745('0x4d')]['id'];}return db[_0xd745('0x2d')]['find']({'where':{'id':_0x626fff[_0xd745('0x4a')]['id']}})[_0xd745('0x26')](handleEntityNotFound(_0x14521e,null))[_0xd745('0x26')](saveUpdates(_0x626fff[_0xd745('0x4d')],null))[_0xd745('0x26')](respondWithResult(_0x14521e,null))[_0xd745('0x4b')](handleError(_0x14521e,null));};exports[_0xd745('0x4e')]=function(_0x2b3caa,_0x5da907){return db[_0xd745('0x2d')]['find']({'where':{'id':_0x2b3caa[_0xd745('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5da907,null))['then'](removeEntity(_0x5da907,null))[_0xd745('0x4b')](handleError(_0x5da907,null));};exports['describe']=function(_0x4d425b,_0x5a8613){return db[_0xd745('0x2d')][_0xd745('0x4f')]()[_0xd745('0x26')](respondWithResult(_0x5a8613,null))[_0xd745('0x4b')](handleError(_0x5a8613,null));};function wrapUser(_0x293918){return function(_0x3f8261){var _0x7e8d5a=_0x293918[_0xd745('0x50')]({'plain':!![]});_0x7e8d5a[_0xd745('0x51')]=[];if(_0x3f8261){_0x7e8d5a[_0xd745('0x52')]=_0x3f8261[_0xd745('0x53')];_0x7e8d5a[_0xd745('0x54')]=_0x3f8261;}else{_0x7e8d5a[_0xd745('0x52')]=moment(0x0)[_0xd745('0x55')](_0xd745('0x56'));_0x7e8d5a['lastMessage']={};}return _0x7e8d5a;};}exports[_0xd745('0x57')]=function(_0x444fa2,_0x1d29c1,_0x435e3e){var _0x480300=[];return db[_0xd745('0x58')][_0xd745('0x47')]({'where':{'role':[_0xd745('0x59'),_0xd745('0x5a'),_0xd745('0x5b')]},'attributes':['id','fullname',_0xd745('0x2a'),_0xd745('0x5c'),_0xd745('0x5d'),'internal',_0xd745('0x5e'),'lastLoginAt',_0xd745('0x5f'),_0xd745('0x60')],'order':qs[_0xd745('0x3d')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0xd745('0x61'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0xd745('0x26')](function(_0x495552){if(_0x495552){var _0x4f6e52=_0x444fa2['user'][_0xd745('0x50')]({'plain':!![]});if(!_0x4f6e52)throw new Error(_0xd745('0x62'));if(_0x4f6e52[_0xd745('0x5c')]==='user'){return db[_0xd745('0x63')][_0xd745('0x64')]({'where':{'name':_0xd745('0x65'),'userProfileId':_0x4f6e52['userProfileId']},'raw':!![]})[_0xd745('0x26')](function(_0x2f3b52){if(_0x2f3b52){if(_0x2f3b52[_0xd745('0x66')]===0x0){return db[_0xd745('0x67')]['findAll']({'where':{'sectionId':_0x2f3b52['id']},'raw':!![]})['then'](function(_0x12521f){var _0x45a991=[];if(_[_0xd745('0x68')](_0x12521f)){_0x45a991=_[_0xd745('0x42')](_0x495552,function(_0x549025){if(_0x549025['role']!==_0xd745('0x59')){return _0x549025;}});return _0x45a991;}else{for(var _0x49baae=0x0;_0x49baae<_0x495552[_0xd745('0x3a')];_0x49baae++){var _0x2a4db1=_0x495552[_0x49baae];if(_0x2a4db1[_0xd745('0x5c')]===_0xd745('0x59')){var _0x2a8765=_[_0xd745('0x64')](_0x12521f,function(_0x16bf78){return _0x16bf78[_0xd745('0x69')]===_0x2a4db1['id'];});if(_0x2a8765)_0x45a991[_0xd745('0x6a')](_0x2a4db1);}else{_0x45a991['push'](_0x2a4db1);}}return _0x45a991;}});}else{return _0x495552;}}else{var _0x3d214c=_[_0xd745('0x42')](_0x495552,function(_0x2f3624){if(_0x2f3624['role']!==_0xd745('0x59')){return _0x2f3624;}});return _0x3d214c;}});}else{return _0x495552;}}})[_0xd745('0x26')](function(_0x3afdd9){var _0x40ccab=[];if(_0x3afdd9){_0x480300=_0x3afdd9;for(var _0x441e67=0x0;_0x441e67<_0x3afdd9['length'];_0x441e67+=0x1){_0x480300[_0x441e67][_0xd745('0x51')]=[];_0x40ccab['push'](db[_0xd745('0x2d')]['find']({'where':{'FromId':[_0x444fa2[_0xd745('0x5b')]['id'],_0x3afdd9[_0x441e67]['id']],'ToId':[_0x444fa2[_0xd745('0x5b')]['id'],_0x3afdd9[_0x441e67]['id']],'ChatGroupId':null},'attributes':['id',_0xd745('0x53'),_0xd745('0x6b'),'ToId',_0xd745('0x6c'),'body'],'order':qs[_0xd745('0x3d')](_0xd745('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd745('0x26')](wrapUser(_0x3afdd9[_0x441e67])));}return BPromise[_0xd745('0x6e')](_0x40ccab);}return[];})[_0xd745('0x26')](function(_0xc0a8aa){return{'rows':_0xc0a8aa,'count':_0xc0a8aa[_0xd745('0x3a')]};})['then'](respondWithResult(_0x1d29c1,null))['catch'](handleError(_0x1d29c1,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 7adac7e..da33791 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 _0xb640=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb640,0xc7));var _0x0b64=function(_0xa68343,_0x7a855d){_0xa68343=_0xa68343-0x0;var _0x1e37e1=_0xb640[_0xa68343];return _0x1e37e1;};'use strict';var EventEmitter=require(_0x0b64('0x0'));var ChatInternalMessage=require(_0x0b64('0x1'))['db'][_0x0b64('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0b64('0x3')](0x0);var events={'afterCreate':_0x0b64('0x4'),'afterUpdate':_0x0b64('0x5'),'afterDestroy':_0x0b64('0x6')};function emitEvent(_0x547486){return function(_0x3e598b,_0x3d8c7e,_0xe9ffce){ChatInternalMessageEvents['emit'](_0x547486+':'+_0x3e598b['id'],_0x3e598b);ChatInternalMessageEvents[_0x0b64('0x7')](_0x547486,_0x3e598b);_0xe9ffce(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x0b64('0x8')](e,emitEvent(event));}}module[_0x0b64('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xa3cb=['hasOwnProperty','hook','exports','events','ChatInternalMessage','setMaxListeners','save','update','emit'];(function(_0xc26a48,_0x42ff7f){var _0x495bc0=function(_0x549479){while(--_0x549479){_0xc26a48['push'](_0xc26a48['shift']());}};_0x495bc0(++_0x42ff7f);}(_0xa3cb,0x1e0));var _0xba3c=function(_0x4aba15,_0x4e90aa){_0x4aba15=_0x4aba15-0x0;var _0x1c8122=_0xa3cb[_0x4aba15];return _0x1c8122;};'use strict';var EventEmitter=require(_0xba3c('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xba3c('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xba3c('0x2')](0x0);var events={'afterCreate':_0xba3c('0x3'),'afterUpdate':_0xba3c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1f8ff1){return function(_0x43b872,_0x478322,_0x10ea36){ChatInternalMessageEvents[_0xba3c('0x5')](_0x1f8ff1+':'+_0x43b872['id'],_0x43b872);ChatInternalMessageEvents[_0xba3c('0x5')](_0x1f8ff1,_0x43b872);_0x10ea36(null);};}for(var e in events){if(events[_0xba3c('0x6')](e)){var event=events[e];ChatInternalMessage[_0xba3c('0x7')](e,emitEvent(event));}}module[_0xba3c('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 30073e0..0619ac1 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 _0xa9fe=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','ChatInternalMessage'];(function(_0x4e1fb2,_0x2ce9da){var _0x98014e=function(_0x4b31f9){while(--_0x4b31f9){_0x4e1fb2['push'](_0x4e1fb2['shift']());}};_0x98014e(++_0x2ce9da);}(_0xa9fe,0x116));var _0xea9f=function(_0xdd55bc,_0x3d78c9){_0xdd55bc=_0xdd55bc-0x0;var _0x14d215=_0xa9fe[_0xdd55bc];return _0x14d215;};'use strict';var _=require('lodash');var util=require(_0xea9f('0x0'));var logger=require(_0xea9f('0x1'))(_0xea9f('0x2'));var moment=require(_0xea9f('0x3'));var BPromise=require(_0xea9f('0x4'));var rp=require(_0xea9f('0x5'));var fs=require('fs');var path=require(_0xea9f('0x6'));var rimraf=require(_0xea9f('0x7'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x4b44d1,_0x285a8d){return _0x4b44d1[_0xea9f('0x8')](_0xea9f('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xea9f('0xa'),'collate':_0xea9f('0xb')});}; \ No newline at end of file +var _0x4d24=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci'];(function(_0x5a764c,_0x12d5e4){var _0x15567b=function(_0x519ac5){while(--_0x519ac5){_0x5a764c['push'](_0x5a764c['shift']());}};_0x15567b(++_0x12d5e4);}(_0x4d24,0x16c));var _0x44d2=function(_0x46e3bd,_0x1b7b0d){_0x46e3bd=_0x46e3bd-0x0;var _0x38a907=_0x4d24[_0x46e3bd];return _0x38a907;};'use strict';var _=require(_0x44d2('0x0'));var util=require(_0x44d2('0x1'));var logger=require(_0x44d2('0x2'))(_0x44d2('0x3'));var moment=require(_0x44d2('0x4'));var BPromise=require(_0x44d2('0x5'));var rp=require(_0x44d2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44d2('0x7'));var config=require(_0x44d2('0x8'));var attributes=require(_0x44d2('0x9'));module['exports']=function(_0x2d36d7,_0x25f0ac){return _0x2d36d7['define'](_0x44d2('0xa'),attributes,{'tableName':_0x44d2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x44d2('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index f7359ef..da05caf 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 _0x4a2e=['then','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0xa990b7,_0x26c527){var _0x52c99c=function(_0xf94328){while(--_0xf94328){_0xa990b7['push'](_0xa990b7['shift']());}};_0x52c99c(++_0x26c527);}(_0x4a2e,0x87));var _0xe4a2=function(_0x1caf3f,_0x1b4800){_0x1caf3f=_0x1caf3f-0x0;var _0x1905f0=_0x4a2e[_0x1caf3f];return _0x1905f0;};'use strict';var _=require(_0xe4a2('0x0'));var util=require(_0xe4a2('0x1'));var moment=require(_0xe4a2('0x2'));var BPromise=require(_0xe4a2('0x3'));var rs=require(_0xe4a2('0x4'));var fs=require('fs');var Redis=require(_0xe4a2('0x5'));var db=require(_0xe4a2('0x6'))['db'];var utils=require(_0xe4a2('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe4a2('0x8')][_0xe4a2('0x9')]({'port':0x232a});config['redis']=_[_0xe4a2('0xa')](config[_0xe4a2('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe4a2('0xc'))(new Redis(config[_0xe4a2('0xb')]));require(_0xe4a2('0xd'))[_0xe4a2('0xe')](socket);function respondWithRpcPromise(_0x26e783,_0xb7de6e,_0x2c9dcf){return new BPromise(function(_0x5f504d,_0x89357c){return client['request'](_0x26e783,_0x2c9dcf)[_0xe4a2('0xf')](function(_0xed338e){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0xb7de6e,'request\x20sent');logger[_0xe4a2('0x10')](_0xe4a2('0x11'),_0xb7de6e,'request\x20sent',JSON[_0xe4a2('0x12')](_0xed338e));if(_0xed338e[_0xe4a2('0x13')]){if(_0xed338e[_0xe4a2('0x13')]['code']===0x1f4){logger[_0xe4a2('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0xb7de6e,_0xed338e['error']['message']);return _0x89357c(_0xed338e[_0xe4a2('0x13')]['message']);}logger[_0xe4a2('0x13')](_0xe4a2('0x14'),_0xb7de6e,_0xed338e[_0xe4a2('0x13')][_0xe4a2('0x15')]);return _0x5f504d(_0xed338e[_0xe4a2('0x13')][_0xe4a2('0x15')]);}else{logger[_0xe4a2('0x16')](_0xe4a2('0x14'),_0xb7de6e,'request\x20sent');_0x5f504d(_0xed338e[_0xe4a2('0x17')][_0xe4a2('0x15')]);}})[_0xe4a2('0x18')](function(_0x2e6be3){logger['error'](_0xe4a2('0x14'),_0xb7de6e,_0x2e6be3);_0x89357c(_0x2e6be3);});});} \ No newline at end of file +var _0x80ce=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','socket.io-emitter','register','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x302aad,_0x5b5ad7){var _0x4274e4=function(_0xdf5496){while(--_0xdf5496){_0x302aad['push'](_0x302aad['shift']());}};_0x4274e4(++_0x5b5ad7);}(_0x80ce,0xae));var _0xe80c=function(_0x56c381,_0x30c0f2){_0x56c381=_0x56c381-0x0;var _0x54d4fc=_0x80ce[_0x56c381];return _0x54d4fc;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe80c('0x0'));var rs=require(_0xe80c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe80c('0x2'))['db'];var utils=require(_0xe80c('0x3'));var logger=require(_0xe80c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe80c('0x5')][_0xe80c('0x6')]({'port':0x232a});config[_0xe80c('0x7')]=_[_0xe80c('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe80c('0x9'))(new Redis(config[_0xe80c('0x7')]));require('./chatInternalMessage.socket')[_0xe80c('0xa')](socket);function respondWithRpcPromise(_0x21f32c,_0x1338af,_0x3cfbeb){return new BPromise(function(_0x75b98f,_0x4881f9){return client['request'](_0x21f32c,_0x3cfbeb)['then'](function(_0xa08bf1){logger[_0xe80c('0xb')](_0xe80c('0xc'),_0x1338af,_0xe80c('0xd'));logger[_0xe80c('0xe')](_0xe80c('0xf'),_0x1338af,_0xe80c('0xd'),JSON[_0xe80c('0x10')](_0xa08bf1));if(_0xa08bf1[_0xe80c('0x11')]){if(_0xa08bf1[_0xe80c('0x11')][_0xe80c('0x12')]===0x1f4){logger[_0xe80c('0x11')](_0xe80c('0xc'),_0x1338af,_0xa08bf1['error'][_0xe80c('0x13')]);return _0x4881f9(_0xa08bf1['error'][_0xe80c('0x13')]);}logger[_0xe80c('0x11')](_0xe80c('0xc'),_0x1338af,_0xa08bf1['error'][_0xe80c('0x13')]);return _0x75b98f(_0xa08bf1[_0xe80c('0x11')]['message']);}else{logger[_0xe80c('0xb')](_0xe80c('0xc'),_0x1338af,'request\x20sent');_0x75b98f(_0xa08bf1[_0xe80c('0x14')][_0xe80c('0x13')]);}})['catch'](function(_0x4c431c){logger[_0xe80c('0x11')](_0xe80c('0xc'),_0x1338af,_0x4c431c);_0x4881f9(_0x4c431c);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index deaeef9..a0d858f 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 _0x0e5a=['remove','emit','register','length','chatInternalMessage:'];(function(_0x1fc5fe,_0x51d294){var _0x291f26=function(_0x2f5316){while(--_0x2f5316){_0x1fc5fe['push'](_0x1fc5fe['shift']());}};_0x291f26(++_0x51d294);}(_0x0e5a,0x78));var _0xa0e5=function(_0x558e9e,_0x5574ff){_0x558e9e=_0x558e9e-0x0;var _0x1adf71=_0x0e5a[_0x558e9e];return _0x1adf71;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0xa0e5('0x0'),'update'];function createListener(_0x5b1fd1,_0x388bb5){return function(_0x2e89d7){_0x388bb5[_0xa0e5('0x1')](_0x5b1fd1,_0x2e89d7);};}function removeListener(_0x3332f6,_0x47bcae){return function(){ChatInternalMessageEvents['removeListener'](_0x3332f6,_0x47bcae);};}exports[_0xa0e5('0x2')]=function(_0xa682f4){for(var _0x3a46ac=0x0,_0x2c1444=events[_0xa0e5('0x3')];_0x3a46ac<_0x2c1444;_0x3a46ac++){var _0x4c531e=events[_0x3a46ac];var _0x407c6b=createListener(_0xa0e5('0x4')+_0x4c531e,_0xa682f4);ChatInternalMessageEvents['on'](_0x4c531e,_0x407c6b);}}; \ No newline at end of file +var _0xd1db=['update','removeListener','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x2b9ba5,_0x26f594){var _0x5cd927=function(_0x159963){while(--_0x159963){_0x2b9ba5['push'](_0x2b9ba5['shift']());}};_0x5cd927(++_0x26f594);}(_0xd1db,0x117));var _0xbd1d=function(_0x179b74,_0x5dc97d){_0x179b74=_0x179b74-0x0;var _0x268f76=_0xd1db[_0x179b74];return _0x268f76;};'use strict';var ChatInternalMessageEvents=require(_0xbd1d('0x0'));var events=[_0xbd1d('0x1'),_0xbd1d('0x2'),_0xbd1d('0x3')];function createListener(_0x3eb6e9,_0x37c592){return function(_0x534e23){_0x37c592['emit'](_0x3eb6e9,_0x534e23);};}function removeListener(_0x3c45b6,_0x4a1986){return function(){ChatInternalMessageEvents[_0xbd1d('0x4')](_0x3c45b6,_0x4a1986);};}exports['register']=function(_0x21173b){for(var _0x5dadf7=0x0,_0x44b791=events['length'];_0x5dadf7<_0x44b791;_0x5dadf7++){var _0x5cf508=events[_0x5dadf7];var _0x2e5527=createListener(_0xbd1d('0x5')+_0x5cf508,_0x21173b);ChatInternalMessageEvents['on'](_0x5cf508,_0x2e5527);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 65dd929..9612ce1 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 _0x7631=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','getUsers','/:id','post','create','put','update','destroy'];(function(_0x301b09,_0x5259ef){var _0x3309ad=function(_0x54ea01){while(--_0x54ea01){_0x301b09['push'](_0x301b09['shift']());}};_0x3309ad(++_0x5259ef);}(_0x7631,0x1cd));var _0x1763=function(_0x3573e1,_0x490385){_0x3573e1=_0x3573e1-0x0;var _0xc09c30=_0x7631[_0x3573e1];return _0xc09c30;};'use strict';var multer=require(_0x1763('0x0'));var util=require(_0x1763('0x1'));var path=require(_0x1763('0x2'));var timeout=require(_0x1763('0x3'));var express=require(_0x1763('0x4'));var router=express[_0x1763('0x5')]();var fs_extra=require(_0x1763('0x6'));var auth=require(_0x1763('0x7'));var interaction=require(_0x1763('0x8'));var config=require(_0x1763('0x9'));var controller=require('./chatInternalMessage.controller');router[_0x1763('0xa')]('/',auth['isAuthenticated'](),controller[_0x1763('0xb')]);router[_0x1763('0xa')](_0x1763('0xc'),auth[_0x1763('0xd')](),controller[_0x1763('0xe')]);router['get']('/users',auth[_0x1763('0xd')](),controller[_0x1763('0xf')]);router['get'](_0x1763('0x10'),auth[_0x1763('0xd')](),controller['show']);router[_0x1763('0x11')]('/',auth[_0x1763('0xd')](),controller[_0x1763('0x12')]);router[_0x1763('0x13')]('/:id',controller[_0x1763('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1763('0x15')]);module[_0x1763('0x16')]=router; \ No newline at end of file +var _0x28a7=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','show','post','/:id','update'];(function(_0x5dd017,_0x28e6db){var _0x571094=function(_0x4a7e1f){while(--_0x4a7e1f){_0x5dd017['push'](_0x5dd017['shift']());}};_0x571094(++_0x28e6db);}(_0x28a7,0x1e1));var _0x728a=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x28a7[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x728a('0x0'));var util=require(_0x728a('0x1'));var path=require('path');var timeout=require(_0x728a('0x2'));var express=require(_0x728a('0x3'));var router=express['Router']();var fs_extra=require(_0x728a('0x4'));var auth=require(_0x728a('0x5'));var interaction=require(_0x728a('0x6'));var config=require(_0x728a('0x7'));var controller=require(_0x728a('0x8'));router[_0x728a('0x9')]('/',auth[_0x728a('0xa')](),controller[_0x728a('0xb')]);router[_0x728a('0x9')](_0x728a('0xc'),auth[_0x728a('0xa')](),controller[_0x728a('0xd')]);router[_0x728a('0x9')](_0x728a('0xe'),auth[_0x728a('0xa')](),controller['getUsers']);router[_0x728a('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x728a('0xf')]);router[_0x728a('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x728a('0x11'),controller[_0x728a('0x12')]);router['delete'](_0x728a('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x728a('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 0ea9fac..3bdab27 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 _0x13f6=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x545737,_0x16f6b6){var _0x5b53ab=function(_0x8a66d2){while(--_0x8a66d2){_0x545737['push'](_0x545737['shift']());}};_0x5b53ab(++_0x16f6b6);}(_0x13f6,0x124));var _0x613f=function(_0x225f3f,_0x2b5e7d){_0x225f3f=_0x225f3f-0x0;var _0x28fc97=_0x13f6[_0x225f3f];return _0x28fc97;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x613f('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x613f('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x613f('0x3')]('in','out'),'defaultValue':_0x613f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x613f('0x5')]},'providerName':{'type':Sequelize[_0x613f('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x536f=['out','STRING','sequelize','BOOLEAN','ENUM'];(function(_0x548cf2,_0x26f00a){var _0x27ecba=function(_0x2fa99f){while(--_0x2fa99f){_0x548cf2['push'](_0x548cf2['shift']());}};_0x27ecba(++_0x26f00a);}(_0x536f,0x70));var _0xf536=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x536f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xf536('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xf536('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf536('0x2')]('in',_0xf536('0x3')),'defaultValue':_0xf536('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xf536('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 3b67562..bcf3909 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 _0x5e72=['stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','reject','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','parse','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','./chatMessage.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','result','message','catch','end','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','status','sendStatus','stack','name','send','index','map','ChatMessage','fieldName','model','query','intersection','fields','length','attributes','nolimit','sort','where','filters','pick','filter','merge','type','includeAll','include','findAll','rows','show','params','keys','find','create','body','describe','chat-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','update','isNil','read1stAt','interaction','user','role'];(function(_0x5e3370,_0x176306){var _0x1afd3f=function(_0xc794d6){while(--_0xc794d6){_0x5e3370['push'](_0x5e3370['shift']());}};_0x1afd3f(++_0x176306);}(_0x5e72,0x120));var _0x25e7=function(_0x2a7173,_0x51ca23){_0x2a7173=_0x2a7173-0x0;var _0x4c62b7=_0x5e72[_0x2a7173];return _0x4c62b7;};'use strict';var emlformat=require(_0x25e7('0x0'));var rimraf=require(_0x25e7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x25e7('0x2'));var rp=require(_0x25e7('0x3'));var moment=require(_0x25e7('0x4'));var BPromise=require(_0x25e7('0x5'));var Mustache=require(_0x25e7('0x6'));var util=require(_0x25e7('0x7'));var path=require(_0x25e7('0x8'));var sox=require(_0x25e7('0x9'));var csv=require(_0x25e7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x25e7('0xb'));var _=require(_0x25e7('0xc'));var squel=require('squel');var crypto=require(_0x25e7('0xd'));var jsforce=require(_0x25e7('0xe'));var deskjs=require(_0x25e7('0xf'));var toCsv=require(_0x25e7('0xa'));var querystring=require(_0x25e7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x25e7('0x11'));var qs=require(_0x25e7('0x12'));var as=require(_0x25e7('0x13'));var hardwareService=require(_0x25e7('0x14'));var logger=require(_0x25e7('0x15'))(_0x25e7('0x16'));var utils=require(_0x25e7('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x25e7('0x18'))['db'];config[_0x25e7('0x19')]=_[_0x25e7('0x1a')](config[_0x25e7('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x25e7('0x19')]));require(_0x25e7('0x1b'))['register'](socket);var jayson=require(_0x25e7('0x1c'));var client=jayson[_0x25e7('0x1d')][_0x25e7('0x1e')]({'port':0x232c});var client9002=jayson[_0x25e7('0x1d')][_0x25e7('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3f7331,_0x2b3c46,_0x25c4ec,_0x179fe0){return new BPromise(function(_0x1f5ca2,_0x456f77){var _0x499b00=_0x179fe0||client;return _0x499b00[_0x25e7('0x1f')](_0x3f7331,_0x25c4ec)[_0x25e7('0x20')](function(_0xee7329){logger[_0x25e7('0x21')]('ChatMessage,\x20%s,\x20%s',_0x2b3c46,_0x25e7('0x22'));logger[_0x25e7('0x23')](_0x25e7('0x24'),_0x2b3c46,'request\x20sent',JSON['stringify'](_0xee7329));if(_0xee7329[_0x25e7('0x25')]){if(_0xee7329[_0x25e7('0x25')][_0x25e7('0x26')]===0x1f4){logger[_0x25e7('0x25')](_0x25e7('0x27'),_0x2b3c46,_0xee7329['error']['message']);return _0x456f77(_0xee7329[_0x25e7('0x25')]['message']);}logger[_0x25e7('0x25')]('ChatMessage,\x20%s,\x20%s',_0x2b3c46,_0xee7329[_0x25e7('0x25')]['message']);return _0x1f5ca2(_0xee7329[_0x25e7('0x25')]['message']);}else{logger[_0x25e7('0x21')](_0x25e7('0x27'),_0x2b3c46,_0x25e7('0x22'));_0x1f5ca2(_0xee7329[_0x25e7('0x28')][_0x25e7('0x29')]);}})[_0x25e7('0x2a')](function(_0x55fb49){logger[_0x25e7('0x25')](_0x25e7('0x27'),_0x2b3c46,_0x55fb49);_0x456f77(_0x55fb49);});});}function respondWithStatusCode(_0x46d0b8,_0x181cf1){_0x181cf1=_0x181cf1||0xcc;return function(_0x37f73c){if(_0x37f73c){return _0x46d0b8['sendStatus'](_0x181cf1);}return _0x46d0b8['status'](_0x181cf1)[_0x25e7('0x2b')]();};}function respondWithResult(_0x4035f1,_0x1112ac){_0x1112ac=_0x1112ac||0xc8;return function(_0x3f2ba6){if(_0x3f2ba6){return _0x4035f1['status'](_0x1112ac)[_0x25e7('0x2c')](_0x3f2ba6);}};}function respondWithFilteredResult(_0x24c435,_0x3bcd3a){return function(_0x544f96){if(_0x544f96){var _0x1b20ce=typeof _0x3bcd3a[_0x25e7('0x2d')]===_0x25e7('0x2e')&&typeof _0x3bcd3a[_0x25e7('0x2f')]==='undefined';var _0x10a750=_0x544f96[_0x25e7('0x30')];var _0x4377ec=_0x1b20ce?0x0:_0x3bcd3a['offset'];var _0x1bc125=_0x1b20ce?_0x544f96[_0x25e7('0x30')]:_0x3bcd3a[_0x25e7('0x2d')]+_0x3bcd3a[_0x25e7('0x2f')];var _0x1b64d9;if(_0x1bc125>=_0x10a750){_0x1bc125=_0x10a750;_0x1b64d9=0xc8;}else{_0x1b64d9=0xce;}_0x24c435['status'](_0x1b64d9);return _0x24c435[_0x25e7('0x31')](_0x25e7('0x32'),_0x4377ec+'-'+_0x1bc125+'/'+_0x10a750)['json'](_0x544f96);}return null;};}function patchUpdates(_0x451d9d){return function(_0x2de56c){try{jsonpatch[_0x25e7('0x33')](_0x2de56c,_0x451d9d,!![]);}catch(_0x457c02){return BPromise['reject'](_0x457c02);}return _0x2de56c['save']();};}function saveUpdates(_0x358230,_0x2ea429){return function(_0x9341d6){if(_0x9341d6){return _0x9341d6['update'](_0x358230)[_0x25e7('0x20')](function(_0x59bb75){return _0x59bb75;});}return null;};}function removeEntity(_0x2f32dc,_0x392ce2){return function(_0x421fa9){if(_0x421fa9){return _0x421fa9[_0x25e7('0x34')]()[_0x25e7('0x20')](function(){_0x2f32dc[_0x25e7('0x35')](0xcc)[_0x25e7('0x2b')]();});}};}function handleEntityNotFound(_0x1f6b4d,_0x349f65){return function(_0x431280){if(!_0x431280){_0x1f6b4d[_0x25e7('0x36')](0x194);}return _0x431280;};}function handleError(_0x5126c9,_0x51aaaf){_0x51aaaf=_0x51aaaf||0x1f4;return function(_0x245c8a){logger[_0x25e7('0x25')](_0x245c8a[_0x25e7('0x37')]);if(_0x245c8a[_0x25e7('0x38')]){delete _0x245c8a[_0x25e7('0x38')];}_0x5126c9['status'](_0x51aaaf)[_0x25e7('0x39')](_0x245c8a);};}exports[_0x25e7('0x3a')]=function(_0x17de74,_0x349cb4){var _0x598fa7={},_0x570d9d={},_0x15f8ad={'count':0x0,'rows':[]};var _0x30ef23=_[_0x25e7('0x3b')](db[_0x25e7('0x3c')]['rawAttributes'],function(_0x13fa62){return{'name':_0x13fa62[_0x25e7('0x3d')],'type':_0x13fa62['type']['key']};});_0x570d9d[_0x25e7('0x3e')]=_[_0x25e7('0x3b')](_0x30ef23,_0x25e7('0x38'));_0x570d9d[_0x25e7('0x3f')]=_['keys'](_0x17de74[_0x25e7('0x3f')]);_0x570d9d['filters']=_[_0x25e7('0x40')](_0x570d9d[_0x25e7('0x3e')],_0x570d9d[_0x25e7('0x3f')]);_0x598fa7['attributes']=_[_0x25e7('0x40')](_0x570d9d[_0x25e7('0x3e')],qs[_0x25e7('0x41')](_0x17de74[_0x25e7('0x3f')][_0x25e7('0x41')]));_0x598fa7['attributes']=_0x598fa7['attributes'][_0x25e7('0x42')]?_0x598fa7[_0x25e7('0x43')]:_0x570d9d[_0x25e7('0x3e')];if(!_0x17de74['query']['hasOwnProperty'](_0x25e7('0x44'))){_0x598fa7[_0x25e7('0x2f')]=qs[_0x25e7('0x2f')](_0x17de74[_0x25e7('0x3f')]['limit']);_0x598fa7[_0x25e7('0x2d')]=qs['offset'](_0x17de74[_0x25e7('0x3f')][_0x25e7('0x2d')]);}_0x598fa7['order']=qs['sort'](_0x17de74[_0x25e7('0x3f')][_0x25e7('0x45')]);_0x598fa7[_0x25e7('0x46')]=qs[_0x25e7('0x47')](_[_0x25e7('0x48')](_0x17de74[_0x25e7('0x3f')],_0x570d9d[_0x25e7('0x47')]),_0x30ef23);if(_0x17de74[_0x25e7('0x3f')][_0x25e7('0x49')]){_0x598fa7[_0x25e7('0x46')]=_[_0x25e7('0x4a')](_0x598fa7[_0x25e7('0x46')],{'$or':_[_0x25e7('0x3b')](_0x30ef23,function(_0x482994){if(_0x482994[_0x25e7('0x4b')]!=='VIRTUAL'){var _0x1e8269={};_0x1e8269[_0x482994['name']]={'$like':'%'+_0x17de74[_0x25e7('0x3f')][_0x25e7('0x49')]+'%'};return _0x1e8269;}})});}_0x598fa7=_[_0x25e7('0x4a')]({},_0x598fa7,_0x17de74['options']);var _0x209da7={'where':_0x598fa7[_0x25e7('0x46')]};return db[_0x25e7('0x3c')][_0x25e7('0x30')](_0x209da7)[_0x25e7('0x20')](function(_0x563e90){_0x15f8ad[_0x25e7('0x30')]=_0x563e90;if(_0x17de74[_0x25e7('0x3f')][_0x25e7('0x4c')]){_0x598fa7[_0x25e7('0x4d')]=[{'all':!![]}];}return db[_0x25e7('0x3c')][_0x25e7('0x4e')](_0x598fa7);})[_0x25e7('0x20')](function(_0x506ad){_0x15f8ad[_0x25e7('0x4f')]=_0x506ad;return _0x15f8ad;})[_0x25e7('0x20')](respondWithFilteredResult(_0x349cb4,_0x598fa7))[_0x25e7('0x2a')](handleError(_0x349cb4,null));};exports[_0x25e7('0x50')]=function(_0x185594,_0x278d5e){var _0x1a6666={'raw':!![],'where':{'id':_0x185594[_0x25e7('0x51')]['id']}},_0x25d6f3={};_0x25d6f3[_0x25e7('0x3e')]=_[_0x25e7('0x52')](db[_0x25e7('0x3c')]['rawAttributes']);_0x25d6f3[_0x25e7('0x3f')]=_[_0x25e7('0x52')](_0x185594[_0x25e7('0x3f')]);_0x25d6f3[_0x25e7('0x47')]=_[_0x25e7('0x40')](_0x25d6f3[_0x25e7('0x3e')],_0x25d6f3[_0x25e7('0x3f')]);_0x1a6666[_0x25e7('0x43')]=_[_0x25e7('0x40')](_0x25d6f3[_0x25e7('0x3e')],qs['fields'](_0x185594[_0x25e7('0x3f')][_0x25e7('0x41')]));_0x1a6666[_0x25e7('0x43')]=_0x1a6666[_0x25e7('0x43')]['length']?_0x1a6666['attributes']:_0x25d6f3[_0x25e7('0x3e')];if(_0x185594[_0x25e7('0x3f')]['includeAll']){_0x1a6666['include']=[{'all':!![]}];}_0x1a6666=_[_0x25e7('0x4a')]({},_0x1a6666,_0x185594['options']);return db[_0x25e7('0x3c')][_0x25e7('0x53')](_0x1a6666)[_0x25e7('0x20')](handleEntityNotFound(_0x278d5e,null))[_0x25e7('0x20')](respondWithResult(_0x278d5e,null))[_0x25e7('0x2a')](handleError(_0x278d5e,null));};exports[_0x25e7('0x54')]=function(_0x3ed168,_0x5a3553){return db[_0x25e7('0x3c')]['create'](_0x3ed168[_0x25e7('0x55')],{})[_0x25e7('0x20')](respondWithResult(_0x5a3553,0xc9))[_0x25e7('0x2a')](handleError(_0x5a3553,null));};exports['update']=function(_0xcbe9b1,_0xe3ef91){if(_0xcbe9b1['body']['id']){delete _0xcbe9b1[_0x25e7('0x55')]['id'];}return db[_0x25e7('0x3c')][_0x25e7('0x53')]({'where':{'id':_0xcbe9b1[_0x25e7('0x51')]['id']}})[_0x25e7('0x20')](handleEntityNotFound(_0xe3ef91,null))[_0x25e7('0x20')](saveUpdates(_0xcbe9b1[_0x25e7('0x55')],null))[_0x25e7('0x20')](respondWithResult(_0xe3ef91,null))[_0x25e7('0x2a')](handleError(_0xe3ef91,null));};exports[_0x25e7('0x34')]=function(_0x4d7305,_0x19ef65){return db['ChatMessage']['find']({'where':{'id':_0x4d7305[_0x25e7('0x51')]['id']}})[_0x25e7('0x20')](handleEntityNotFound(_0x19ef65,null))['then'](removeEntity(_0x19ef65,null))[_0x25e7('0x2a')](handleError(_0x19ef65,null));};exports[_0x25e7('0x56')]=function(_0x178923,_0x57da80){return db['ChatMessage'][_0x25e7('0x56')]()[_0x25e7('0x20')](respondWithResult(_0x57da80,null))[_0x25e7('0x2a')](handleError(_0x57da80,null));};var interaction_log=require(_0x25e7('0x15'))(_0x25e7('0x57'));exports[_0x25e7('0x58')]=function(_0x2e367a,_0x518773,_0x5cc67b){var _0x4e96f7={'agent':{},'channel':'chat'};if(_0x2e367a[_0x25e7('0x55')]['id']){delete _0x2e367a['body']['id'];}_0x2e367a[_0x25e7('0x55')]['read']=!![];_0x2e367a['body'][_0x25e7('0x59')]=moment()[_0x25e7('0x5a')](_0x25e7('0x5b'));_0x2e367a['body'][_0x25e7('0x5c')]=_0x2e367a[_0x25e7('0x55')][_0x25e7('0x5c')]||_0x2e367a['user']['id'];_0x4e96f7[_0x25e7('0x5d')]['id']=_0x2e367a[_0x25e7('0x55')][_0x25e7('0x5c')];return db[_0x25e7('0x3c')][_0x25e7('0x53')]({'where':{'id':_0x2e367a[_0x25e7('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x518773,null))[_0x25e7('0x20')](saveUpdates(_0x2e367a[_0x25e7('0x55')],null))['then'](function(_0x1edd13){if(_0x1edd13){_0x4e96f7['message']=_0x1edd13[_0x25e7('0x5e')]({'plain':!![]});return db[_0x25e7('0x5f')][_0x25e7('0x53')]({'where':{'id':_0x1edd13['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x518773,null))[_0x25e7('0x20')](function(_0x26ee7f){if(_0x26ee7f){return _0x26ee7f[_0x25e7('0x60')]({'UserId':_0x2e367a[_0x25e7('0x55')][_0x25e7('0x5c')],'read1stAt':_[_0x25e7('0x61')](_0x26ee7f[_0x25e7('0x62')])?moment()[_0x25e7('0x5a')](_0x25e7('0x5b')):undefined});}return null;})[_0x25e7('0x20')](function(_0x1d50cb){if(_0x1d50cb){_0x4e96f7[_0x25e7('0x63')]=_0x1d50cb[_0x25e7('0x5e')]({'plain':!![]});interaction_log[_0x25e7('0x21')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2e367a[_0x25e7('0x64')]['id'],_0x2e367a[_0x25e7('0x64')][_0x25e7('0x38')],_0x2e367a[_0x25e7('0x64')][_0x25e7('0x65')],_0x4e96f7[_0x25e7('0x63')]['id'],_0x2e367a['body']?JSON[_0x25e7('0x66')](_0x2e367a[_0x25e7('0x55')]):_0x25e7('0x67'));return respondWithRpcPromise(_0x25e7('0x68'),'acceptMessage',_0x4e96f7);}return null;})['then'](function(_0x220226){var _0x1faa64=_0x25e7('0x69')+_0x220226[_0x25e7('0x29')][_0x25e7('0x6a')];return db[_0x25e7('0x6b')][_0x25e7('0x3f')](_0x1faa64,{'type':db[_0x25e7('0x6c')][_0x25e7('0x6d')][_0x25e7('0x6e')],'raw':!![]})[_0x25e7('0x20')](function(_0x55fa20){return _0x55fa20;});})[_0x25e7('0x20')](function(_0x21056a){if(_0x21056a){_0x4e96f7[_0x25e7('0x29')][_0x25e7('0x6f')]=_0x21056a[0x0];if(!_0x2e367a['body'][_0x25e7('0x5c')])return;return db[_0x25e7('0x70')]['find']({'where':{'id':_0x2e367a[_0x25e7('0x55')][_0x25e7('0x5c')],'role':'agent'},'attributes':['id',_0x25e7('0x38'),_0x25e7('0x71'),_0x25e7('0x72'),_0x25e7('0x73')],'raw':!![]});}return null;})[_0x25e7('0x20')](function(_0x360aec){if(!_0x360aec)return null;_0x4e96f7['message'][_0x25e7('0x5d')]=_0x360aec;return _0x4e96f7;})[_0x25e7('0x20')](function(_0x4cc83c){if(_0x4cc83c){if(_0x2e367a['body']['manual']){_0x4e96f7[_0x25e7('0x29')][_0x25e7('0x74')]=util['format'](_0x25e7('0x75'),_0x2e367a[_0x25e7('0x64')][_0x25e7('0x38')]);_0x4e96f7[_0x25e7('0x29')][_0x25e7('0x76')]=_0x4e96f7[_0x25e7('0x76')];_0x4e96f7[_0x25e7('0x29')][_0x25e7('0x77')]=_0x4e96f7[_0x25e7('0x76')];_0x4e96f7['message'][_0x25e7('0x78')]='accept';return respondWithRpcPromise(_0x25e7('0x79'),'EventManager',{'event':_0x25e7('0x7a'),'message':_[_0x25e7('0x4a')](_0x4e96f7[_0x25e7('0x29')],JSON['parse'](_0x4e96f7['interaction'][_0x25e7('0x7b')]))},client9002)[_0x25e7('0x20')](function(){return _0x4e96f7;});}return _0x4e96f7;}return null;})[_0x25e7('0x20')](respondWithResult(_0x518773,null))[_0x25e7('0x2a')](handleError(_0x518773,null));};var interaction_log=require('../../config/logger')(_0x25e7('0x57'));exports[_0x25e7('0x7c')]=function(_0xa1ef56,_0x2d44e4,_0x27389b){var _0x41394b={'agent':{},'channel':_0x25e7('0x7d')};if(_0xa1ef56[_0x25e7('0x55')]['id']){delete _0xa1ef56['body']['id'];}_0xa1ef56[_0x25e7('0x55')][_0x25e7('0x5c')]=_0xa1ef56[_0x25e7('0x55')][_0x25e7('0x5c')]||_0xa1ef56['user']['id'];_0x41394b['agent']['id']=_0xa1ef56['body']['UserId'];return db[_0x25e7('0x3c')][_0x25e7('0x53')]({'where':{'id':_0xa1ef56[_0x25e7('0x51')]['id'],'UserId':null}})[_0x25e7('0x20')](handleEntityNotFound(_0x2d44e4,null))['then'](function(_0x577f51){if(_0x577f51){_0x41394b['message']=_0x577f51[_0x25e7('0x5e')]({'plain':!![]});return db[_0x25e7('0x5f')]['find']({'where':{'id':_0x577f51['ChatInteractionId']}});}return null;})[_0x25e7('0x20')](handleEntityNotFound(_0x2d44e4,null))[_0x25e7('0x20')](function(_0x1ae9c6){if(_0x1ae9c6){_0x41394b[_0x25e7('0x63')]=_0x1ae9c6[_0x25e7('0x5e')]({'plain':!![]});interaction_log[_0x25e7('0x21')](_0x25e7('0x7e'),_0xa1ef56['user']['id'],_0xa1ef56[_0x25e7('0x64')][_0x25e7('0x38')],_0xa1ef56[_0x25e7('0x64')][_0x25e7('0x65')],_0x41394b[_0x25e7('0x63')]['id'],_0xa1ef56[_0x25e7('0x55')]?JSON[_0x25e7('0x66')](_0xa1ef56[_0x25e7('0x55')]):_0x25e7('0x67'));return respondWithRpcPromise(_0x25e7('0x7f'),_0x25e7('0x80'),_0x41394b);}return null;})[_0x25e7('0x20')](function(_0x1da616){var _0x53d749=_0x25e7('0x69')+_0x1da616['message']['ContactId'];return db[_0x25e7('0x6b')][_0x25e7('0x3f')](_0x53d749,{'type':db[_0x25e7('0x6c')][_0x25e7('0x6d')]['SELECT'],'raw':!![]})['then'](function(_0x556ad3){return _0x556ad3;});})[_0x25e7('0x20')](function(_0x590c88){if(_0x590c88){_0x41394b[_0x25e7('0x29')][_0x25e7('0x6f')]=_0x590c88[0x0];if(!_0xa1ef56['body'][_0x25e7('0x5c')])return;return db[_0x25e7('0x70')][_0x25e7('0x53')]({'where':{'id':_0xa1ef56[_0x25e7('0x55')][_0x25e7('0x5c')],'role':_0x25e7('0x5d')},'attributes':['id','name',_0x25e7('0x71'),_0x25e7('0x72'),_0x25e7('0x73')],'raw':!![]});}return null;})[_0x25e7('0x20')](function(_0x2921f9){if(!_0x2921f9)return null;_0x41394b[_0x25e7('0x29')][_0x25e7('0x5d')]=_0x2921f9;return _0x41394b;})[_0x25e7('0x20')](function(_0x4aa0e8){if(_0x4aa0e8){_0x4aa0e8[_0x25e7('0x29')][_0x25e7('0x74')]=util[_0x25e7('0x5a')](_0x25e7('0x75'),_0xa1ef56[_0x25e7('0x64')][_0x25e7('0x38')]);_0x4aa0e8[_0x25e7('0x29')][_0x25e7('0x76')]=_0x41394b['channel'];_0x4aa0e8[_0x25e7('0x29')]['motionChannel']=_0x41394b[_0x25e7('0x76')];_0x4aa0e8[_0x25e7('0x29')][_0x25e7('0x78')]=_0x25e7('0x7c');respondWithRpcPromise(_0x25e7('0x79'),_0x25e7('0x79'),{'event':'rejectmessage','message':_['merge'](_0x41394b['message'],JSON[_0x25e7('0x81')](_0x41394b[_0x25e7('0x63')]['formData']))},client9002);return _0x41394b;}return null;})[_0x25e7('0x20')](respondWithResult(_0x2d44e4,null))[_0x25e7('0x2a')](handleError(_0x2d44e4,null));}; \ No newline at end of file +var _0xf493=['acceptMessage','sequelize','QueryTypes','SELECT','contact','fullname','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','User','internal','format','rejectmessage','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','client','http','request','then','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','stack','name','send','index','map','ChatMessage','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','describe','chat-interactions','accept','chat','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage'];(function(_0x67754c,_0x4ee2c1){var _0x1f09ec=function(_0x255080){while(--_0x255080){_0x67754c['push'](_0x67754c['shift']());}};_0x1f09ec(++_0x4ee2c1);}(_0xf493,0x116));var _0x3f49=function(_0xabdfcd,_0x4ea11d){_0xabdfcd=_0xabdfcd-0x0;var _0x18172b=_0xf493[_0xabdfcd];return _0x18172b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f49('0x0'));var zipdir=require(_0x3f49('0x1'));var jsonpatch=require(_0x3f49('0x2'));var rp=require('request-promise');var moment=require(_0x3f49('0x3'));var BPromise=require(_0x3f49('0x4'));var Mustache=require(_0x3f49('0x5'));var util=require(_0x3f49('0x6'));var path=require(_0x3f49('0x7'));var sox=require(_0x3f49('0x8'));var csv=require('to-csv');var ejs=require(_0x3f49('0x9'));var fs=require('fs');var fs_extra=require(_0x3f49('0xa'));var _=require('lodash');var squel=require(_0x3f49('0xb'));var crypto=require(_0x3f49('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3f49('0xd'));var toCsv=require(_0x3f49('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3f49('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3f49('0x10'));var as=require(_0x3f49('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f49('0x12'))(_0x3f49('0x13'));var utils=require(_0x3f49('0x14'));var config=require(_0x3f49('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f49('0x16'))['db'];config[_0x3f49('0x17')]=_[_0x3f49('0x18')](config[_0x3f49('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x3f49('0x19'))(new Redis(config['redis']));require(_0x3f49('0x1a'))[_0x3f49('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3f49('0x1c')][_0x3f49('0x1d')]({'port':0x232c});var client9002=jayson[_0x3f49('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33effe,_0x3aa104,_0x44d15c,_0xab7269){return new BPromise(function(_0x4ba304,_0x41d6e6){var _0x29f894=_0xab7269||client;return _0x29f894[_0x3f49('0x1e')](_0x33effe,_0x44d15c)[_0x3f49('0x1f')](function(_0x4c4b30){logger['info']('ChatMessage,\x20%s,\x20%s',_0x3aa104,_0x3f49('0x20'));logger[_0x3f49('0x21')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3aa104,_0x3f49('0x20'),JSON[_0x3f49('0x22')](_0x4c4b30));if(_0x4c4b30['error']){if(_0x4c4b30[_0x3f49('0x23')][_0x3f49('0x24')]===0x1f4){logger[_0x3f49('0x23')](_0x3f49('0x25'),_0x3aa104,_0x4c4b30['error'][_0x3f49('0x26')]);return _0x41d6e6(_0x4c4b30['error']['message']);}logger[_0x3f49('0x23')](_0x3f49('0x25'),_0x3aa104,_0x4c4b30[_0x3f49('0x23')][_0x3f49('0x26')]);return _0x4ba304(_0x4c4b30['error'][_0x3f49('0x26')]);}else{logger[_0x3f49('0x27')](_0x3f49('0x25'),_0x3aa104,_0x3f49('0x20'));_0x4ba304(_0x4c4b30[_0x3f49('0x28')][_0x3f49('0x26')]);}})['catch'](function(_0x207818){logger[_0x3f49('0x23')](_0x3f49('0x25'),_0x3aa104,_0x207818);_0x41d6e6(_0x207818);});});}function respondWithStatusCode(_0x8a9d96,_0xdb0a3e){_0xdb0a3e=_0xdb0a3e||0xcc;return function(_0x5ec906){if(_0x5ec906){return _0x8a9d96[_0x3f49('0x29')](_0xdb0a3e);}return _0x8a9d96[_0x3f49('0x2a')](_0xdb0a3e)[_0x3f49('0x2b')]();};}function respondWithResult(_0x30a899,_0x2dac1a){_0x2dac1a=_0x2dac1a||0xc8;return function(_0x2079df){if(_0x2079df){return _0x30a899[_0x3f49('0x2a')](_0x2dac1a)[_0x3f49('0x2c')](_0x2079df);}};}function respondWithFilteredResult(_0x866e9a,_0x22ab02){return function(_0x4ab3c5){if(_0x4ab3c5){var _0x14e1e4=typeof _0x22ab02[_0x3f49('0x2d')]===_0x3f49('0x2e')&&typeof _0x22ab02[_0x3f49('0x2f')]==='undefined';var _0x4b17f4=_0x4ab3c5[_0x3f49('0x30')];var _0x15d0c3=_0x14e1e4?0x0:_0x22ab02[_0x3f49('0x2d')];var _0x36ff3a=_0x14e1e4?_0x4ab3c5[_0x3f49('0x30')]:_0x22ab02[_0x3f49('0x2d')]+_0x22ab02[_0x3f49('0x2f')];var _0x23f8b3;if(_0x36ff3a>=_0x4b17f4){_0x36ff3a=_0x4b17f4;_0x23f8b3=0xc8;}else{_0x23f8b3=0xce;}_0x866e9a[_0x3f49('0x2a')](_0x23f8b3);return _0x866e9a[_0x3f49('0x31')](_0x3f49('0x32'),_0x15d0c3+'-'+_0x36ff3a+'/'+_0x4b17f4)[_0x3f49('0x2c')](_0x4ab3c5);}return null;};}function patchUpdates(_0x3ae041){return function(_0x234f21){try{jsonpatch['apply'](_0x234f21,_0x3ae041,!![]);}catch(_0x5a8573){return BPromise[_0x3f49('0x33')](_0x5a8573);}return _0x234f21['save']();};}function saveUpdates(_0x1050bc,_0x375652){return function(_0x1989b9){if(_0x1989b9){return _0x1989b9[_0x3f49('0x34')](_0x1050bc)[_0x3f49('0x1f')](function(_0x48372a){return _0x48372a;});}return null;};}function removeEntity(_0x2daf56,_0x158617){return function(_0x22a2da){if(_0x22a2da){return _0x22a2da[_0x3f49('0x35')]()[_0x3f49('0x1f')](function(){_0x2daf56[_0x3f49('0x2a')](0xcc)[_0x3f49('0x2b')]();});}};}function handleEntityNotFound(_0x4593ba,_0x261516){return function(_0x315f48){if(!_0x315f48){_0x4593ba[_0x3f49('0x29')](0x194);}return _0x315f48;};}function handleError(_0x406a9d,_0xba088c){_0xba088c=_0xba088c||0x1f4;return function(_0x573bef){logger[_0x3f49('0x23')](_0x573bef[_0x3f49('0x36')]);if(_0x573bef[_0x3f49('0x37')]){delete _0x573bef['name'];}_0x406a9d[_0x3f49('0x2a')](_0xba088c)[_0x3f49('0x38')](_0x573bef);};}exports[_0x3f49('0x39')]=function(_0x7fe4df,_0x23c454){var _0x33abd9={},_0x5b6c35={},_0x59aae6={'count':0x0,'rows':[]};var _0x47ea41=_[_0x3f49('0x3a')](db[_0x3f49('0x3b')]['rawAttributes'],function(_0x4c547e){return{'name':_0x4c547e['fieldName'],'type':_0x4c547e[_0x3f49('0x3c')]['key']};});_0x5b6c35[_0x3f49('0x3d')]=_[_0x3f49('0x3a')](_0x47ea41,'name');_0x5b6c35[_0x3f49('0x3e')]=_['keys'](_0x7fe4df[_0x3f49('0x3e')]);_0x5b6c35[_0x3f49('0x3f')]=_[_0x3f49('0x40')](_0x5b6c35['model'],_0x5b6c35['query']);_0x33abd9['attributes']=_[_0x3f49('0x40')](_0x5b6c35['model'],qs[_0x3f49('0x41')](_0x7fe4df[_0x3f49('0x3e')]['fields']));_0x33abd9[_0x3f49('0x42')]=_0x33abd9[_0x3f49('0x42')][_0x3f49('0x43')]?_0x33abd9[_0x3f49('0x42')]:_0x5b6c35['model'];if(!_0x7fe4df[_0x3f49('0x3e')][_0x3f49('0x44')](_0x3f49('0x45'))){_0x33abd9[_0x3f49('0x2f')]=qs['limit'](_0x7fe4df[_0x3f49('0x3e')]['limit']);_0x33abd9[_0x3f49('0x2d')]=qs[_0x3f49('0x2d')](_0x7fe4df[_0x3f49('0x3e')][_0x3f49('0x2d')]);}_0x33abd9[_0x3f49('0x46')]=qs[_0x3f49('0x47')](_0x7fe4df[_0x3f49('0x3e')][_0x3f49('0x47')]);_0x33abd9['where']=qs['filters'](_[_0x3f49('0x48')](_0x7fe4df[_0x3f49('0x3e')],_0x5b6c35[_0x3f49('0x3f')]),_0x47ea41);if(_0x7fe4df[_0x3f49('0x3e')][_0x3f49('0x49')]){_0x33abd9[_0x3f49('0x4a')]=_[_0x3f49('0x4b')](_0x33abd9[_0x3f49('0x4a')],{'$or':_[_0x3f49('0x3a')](_0x47ea41,function(_0x20e112){if(_0x20e112[_0x3f49('0x3c')]!==_0x3f49('0x4c')){var _0x1201f5={};_0x1201f5[_0x20e112[_0x3f49('0x37')]]={'$like':'%'+_0x7fe4df['query'][_0x3f49('0x49')]+'%'};return _0x1201f5;}})});}_0x33abd9=_['merge']({},_0x33abd9,_0x7fe4df['options']);var _0x252f31={'where':_0x33abd9[_0x3f49('0x4a')]};return db[_0x3f49('0x3b')]['count'](_0x252f31)[_0x3f49('0x1f')](function(_0x513a15){_0x59aae6[_0x3f49('0x30')]=_0x513a15;if(_0x7fe4df[_0x3f49('0x3e')][_0x3f49('0x4d')]){_0x33abd9[_0x3f49('0x4e')]=[{'all':!![]}];}return db['ChatMessage'][_0x3f49('0x4f')](_0x33abd9);})[_0x3f49('0x1f')](function(_0x51232f){_0x59aae6[_0x3f49('0x50')]=_0x51232f;return _0x59aae6;})[_0x3f49('0x1f')](respondWithFilteredResult(_0x23c454,_0x33abd9))[_0x3f49('0x51')](handleError(_0x23c454,null));};exports['show']=function(_0x53d850,_0x389586){var _0x4b1555={'raw':!![],'where':{'id':_0x53d850[_0x3f49('0x52')]['id']}},_0x566820={};_0x566820[_0x3f49('0x3d')]=_[_0x3f49('0x53')](db[_0x3f49('0x3b')]['rawAttributes']);_0x566820['query']=_[_0x3f49('0x53')](_0x53d850['query']);_0x566820[_0x3f49('0x3f')]=_[_0x3f49('0x40')](_0x566820[_0x3f49('0x3d')],_0x566820[_0x3f49('0x3e')]);_0x4b1555[_0x3f49('0x42')]=_[_0x3f49('0x40')](_0x566820[_0x3f49('0x3d')],qs[_0x3f49('0x41')](_0x53d850[_0x3f49('0x3e')][_0x3f49('0x41')]));_0x4b1555[_0x3f49('0x42')]=_0x4b1555['attributes'][_0x3f49('0x43')]?_0x4b1555[_0x3f49('0x42')]:_0x566820[_0x3f49('0x3d')];if(_0x53d850['query'][_0x3f49('0x4d')]){_0x4b1555[_0x3f49('0x4e')]=[{'all':!![]}];}_0x4b1555=_[_0x3f49('0x4b')]({},_0x4b1555,_0x53d850[_0x3f49('0x54')]);return db[_0x3f49('0x3b')][_0x3f49('0x55')](_0x4b1555)[_0x3f49('0x1f')](handleEntityNotFound(_0x389586,null))[_0x3f49('0x1f')](respondWithResult(_0x389586,null))[_0x3f49('0x51')](handleError(_0x389586,null));};exports[_0x3f49('0x56')]=function(_0x1c8008,_0x36fc90){return db[_0x3f49('0x3b')][_0x3f49('0x56')](_0x1c8008[_0x3f49('0x57')],{})[_0x3f49('0x1f')](respondWithResult(_0x36fc90,0xc9))[_0x3f49('0x51')](handleError(_0x36fc90,null));};exports[_0x3f49('0x34')]=function(_0x2ee7f6,_0x48a9f7){if(_0x2ee7f6[_0x3f49('0x57')]['id']){delete _0x2ee7f6[_0x3f49('0x57')]['id'];}return db[_0x3f49('0x3b')][_0x3f49('0x55')]({'where':{'id':_0x2ee7f6[_0x3f49('0x52')]['id']}})['then'](handleEntityNotFound(_0x48a9f7,null))[_0x3f49('0x1f')](saveUpdates(_0x2ee7f6[_0x3f49('0x57')],null))['then'](respondWithResult(_0x48a9f7,null))[_0x3f49('0x51')](handleError(_0x48a9f7,null));};exports[_0x3f49('0x35')]=function(_0x4820b0,_0x3d3bd2){return db['ChatMessage'][_0x3f49('0x55')]({'where':{'id':_0x4820b0[_0x3f49('0x52')]['id']}})['then'](handleEntityNotFound(_0x3d3bd2,null))[_0x3f49('0x1f')](removeEntity(_0x3d3bd2,null))[_0x3f49('0x51')](handleError(_0x3d3bd2,null));};exports[_0x3f49('0x58')]=function(_0x3e5beb,_0x454590){return db[_0x3f49('0x3b')][_0x3f49('0x58')]()[_0x3f49('0x1f')](respondWithResult(_0x454590,null))['catch'](handleError(_0x454590,null));};var interaction_log=require(_0x3f49('0x12'))(_0x3f49('0x59'));exports[_0x3f49('0x5a')]=function(_0x555363,_0x2e6057,_0x1e0d51){var _0x1e65e8={'agent':{},'channel':_0x3f49('0x5b')};if(_0x555363[_0x3f49('0x57')]['id']){delete _0x555363[_0x3f49('0x57')]['id'];}_0x555363['body']['read']=!![];_0x555363['body']['readAt']=moment()['format'](_0x3f49('0x5c'));_0x555363['body']['UserId']=_0x555363[_0x3f49('0x57')]['UserId']||_0x555363[_0x3f49('0x5d')]['id'];_0x1e65e8[_0x3f49('0x5e')]['id']=_0x555363[_0x3f49('0x57')][_0x3f49('0x5f')];return db['ChatMessage'][_0x3f49('0x55')]({'where':{'id':_0x555363['params']['id'],'UserId':null}})[_0x3f49('0x1f')](handleEntityNotFound(_0x2e6057,null))[_0x3f49('0x1f')](saveUpdates(_0x555363[_0x3f49('0x57')],null))[_0x3f49('0x1f')](function(_0x3a9477){if(_0x3a9477){_0x1e65e8[_0x3f49('0x26')]=_0x3a9477['get']({'plain':!![]});return db[_0x3f49('0x60')]['find']({'where':{'id':_0x3a9477[_0x3f49('0x61')]}});}return null;})[_0x3f49('0x1f')](handleEntityNotFound(_0x2e6057,null))[_0x3f49('0x1f')](function(_0x473802){if(_0x473802){return _0x473802['update']({'UserId':_0x555363['body']['UserId'],'read1stAt':_[_0x3f49('0x62')](_0x473802[_0x3f49('0x63')])?moment()['format'](_0x3f49('0x5c')):undefined});}return null;})['then'](function(_0x39ead){if(_0x39ead){_0x1e65e8[_0x3f49('0x64')]=_0x39ead[_0x3f49('0x65')]({'plain':!![]});interaction_log[_0x3f49('0x27')](_0x3f49('0x66'),_0x555363[_0x3f49('0x5d')]['id'],_0x555363['user']['name'],_0x555363[_0x3f49('0x5d')][_0x3f49('0x67')],_0x1e65e8[_0x3f49('0x64')]['id'],_0x555363[_0x3f49('0x57')]?JSON[_0x3f49('0x22')](_0x555363['body']):_0x3f49('0x68'));return respondWithRpcPromise(_0x3f49('0x69'),_0x3f49('0x6a'),_0x1e65e8);}return null;})['then'](function(_0x2c1bf2){var _0x51a950='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2c1bf2[_0x3f49('0x26')]['ContactId'];return db[_0x3f49('0x6b')][_0x3f49('0x3e')](_0x51a950,{'type':db['Sequelize'][_0x3f49('0x6c')][_0x3f49('0x6d')],'raw':!![]})['then'](function(_0x3b9f1e){return _0x3b9f1e;});})['then'](function(_0x712ea4){if(_0x712ea4){_0x1e65e8[_0x3f49('0x26')][_0x3f49('0x6e')]=_0x712ea4[0x0];if(!_0x555363[_0x3f49('0x57')][_0x3f49('0x5f')])return;return db['User'][_0x3f49('0x55')]({'where':{'id':_0x555363['body'][_0x3f49('0x5f')],'role':_0x3f49('0x5e')},'attributes':['id','name',_0x3f49('0x6f'),'email','internal'],'raw':!![]});}return null;})[_0x3f49('0x1f')](function(_0x53586b){if(!_0x53586b)return null;_0x1e65e8[_0x3f49('0x26')][_0x3f49('0x5e')]=_0x53586b;return _0x1e65e8;})['then'](function(_0x3115d0){if(_0x3115d0){if(_0x555363['body'][_0x3f49('0x70')]){_0x1e65e8[_0x3f49('0x26')][_0x3f49('0x71')]=util['format'](_0x3f49('0x72'),_0x555363[_0x3f49('0x5d')][_0x3f49('0x37')]);_0x1e65e8[_0x3f49('0x26')]['channel']=_0x1e65e8[_0x3f49('0x73')];_0x1e65e8[_0x3f49('0x26')][_0x3f49('0x74')]=_0x1e65e8[_0x3f49('0x73')];_0x1e65e8[_0x3f49('0x26')][_0x3f49('0x75')]='accept';return respondWithRpcPromise('EventManager',_0x3f49('0x76'),{'event':'acceptmessage','message':_[_0x3f49('0x4b')](_0x1e65e8[_0x3f49('0x26')],JSON[_0x3f49('0x77')](_0x1e65e8[_0x3f49('0x64')][_0x3f49('0x78')]))},client9002)[_0x3f49('0x1f')](function(){return _0x1e65e8;});}return _0x1e65e8;}return null;})['then'](respondWithResult(_0x2e6057,null))[_0x3f49('0x51')](handleError(_0x2e6057,null));};var interaction_log=require('../../config/logger')(_0x3f49('0x59'));exports[_0x3f49('0x33')]=function(_0x3cbaca,_0x4cd3ac,_0x5693fa){var _0x4063e6={'agent':{},'channel':_0x3f49('0x5b')};if(_0x3cbaca[_0x3f49('0x57')]['id']){delete _0x3cbaca[_0x3f49('0x57')]['id'];}_0x3cbaca[_0x3f49('0x57')][_0x3f49('0x5f')]=_0x3cbaca[_0x3f49('0x57')][_0x3f49('0x5f')]||_0x3cbaca[_0x3f49('0x5d')]['id'];_0x4063e6[_0x3f49('0x5e')]['id']=_0x3cbaca[_0x3f49('0x57')][_0x3f49('0x5f')];return db[_0x3f49('0x3b')][_0x3f49('0x55')]({'where':{'id':_0x3cbaca[_0x3f49('0x52')]['id'],'UserId':null}})[_0x3f49('0x1f')](handleEntityNotFound(_0x4cd3ac,null))[_0x3f49('0x1f')](function(_0x17ff76){if(_0x17ff76){_0x4063e6[_0x3f49('0x26')]=_0x17ff76[_0x3f49('0x65')]({'plain':!![]});return db[_0x3f49('0x60')]['find']({'where':{'id':_0x17ff76[_0x3f49('0x61')]}});}return null;})[_0x3f49('0x1f')](handleEntityNotFound(_0x4cd3ac,null))[_0x3f49('0x1f')](function(_0x3fc341){if(_0x3fc341){_0x4063e6[_0x3f49('0x64')]=_0x3fc341['get']({'plain':!![]});interaction_log[_0x3f49('0x27')](_0x3f49('0x79'),_0x3cbaca[_0x3f49('0x5d')]['id'],_0x3cbaca['user'][_0x3f49('0x37')],_0x3cbaca['user'][_0x3f49('0x67')],_0x4063e6[_0x3f49('0x64')]['id'],_0x3cbaca[_0x3f49('0x57')]?JSON[_0x3f49('0x22')](_0x3cbaca[_0x3f49('0x57')]):_0x3f49('0x68'));return respondWithRpcPromise('RejectMessage',_0x3f49('0x7a'),_0x4063e6);}return null;})[_0x3f49('0x1f')](function(_0x593eca){var _0xbf5a1a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x593eca['message'][_0x3f49('0x7b')];return db[_0x3f49('0x6b')][_0x3f49('0x3e')](_0xbf5a1a,{'type':db['Sequelize'][_0x3f49('0x6c')][_0x3f49('0x6d')],'raw':!![]})[_0x3f49('0x1f')](function(_0x33472a){return _0x33472a;});})[_0x3f49('0x1f')](function(_0x2f4c5d){if(_0x2f4c5d){_0x4063e6['message'][_0x3f49('0x6e')]=_0x2f4c5d[0x0];if(!_0x3cbaca[_0x3f49('0x57')][_0x3f49('0x5f')])return;return db[_0x3f49('0x7c')][_0x3f49('0x55')]({'where':{'id':_0x3cbaca['body']['UserId'],'role':_0x3f49('0x5e')},'attributes':['id','name',_0x3f49('0x6f'),'email',_0x3f49('0x7d')],'raw':!![]});}return null;})[_0x3f49('0x1f')](function(_0x3b6338){if(!_0x3b6338)return null;_0x4063e6[_0x3f49('0x26')][_0x3f49('0x5e')]=_0x3b6338;return _0x4063e6;})[_0x3f49('0x1f')](function(_0x54f5d7){if(_0x54f5d7){_0x54f5d7[_0x3f49('0x26')][_0x3f49('0x71')]=util[_0x3f49('0x7e')]('SIP/%s',_0x3cbaca[_0x3f49('0x5d')][_0x3f49('0x37')]);_0x54f5d7['message']['channel']=_0x4063e6[_0x3f49('0x73')];_0x54f5d7[_0x3f49('0x26')][_0x3f49('0x74')]=_0x4063e6['channel'];_0x54f5d7[_0x3f49('0x26')][_0x3f49('0x75')]=_0x3f49('0x33');respondWithRpcPromise(_0x3f49('0x76'),_0x3f49('0x76'),{'event':_0x3f49('0x7f'),'message':_[_0x3f49('0x4b')](_0x4063e6[_0x3f49('0x26')],JSON[_0x3f49('0x77')](_0x4063e6['interaction'][_0x3f49('0x78')]))},client9002);return _0x4063e6;}return null;})['then'](respondWithResult(_0x4cd3ac,null))[_0x3f49('0x51')](handleError(_0x4cd3ac,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 121592a..2a7d3fd 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 _0xc813=['emit','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','update','remove'];(function(_0x20a97c,_0x5bd16b){var _0x4038da=function(_0x9937ac){while(--_0x9937ac){_0x20a97c['push'](_0x20a97c['shift']());}};_0x4038da(++_0x5bd16b);}(_0xc813,0xb3));var _0x3c81=function(_0x419bb9,_0x247ffa){_0x419bb9=_0x419bb9-0x0;var _0x594006=_0xc813[_0x419bb9];return _0x594006;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x3c81('0x0'))['db'][_0x3c81('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3c81('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3c81('0x3'),'afterDestroy':_0x3c81('0x4')};function emitEvent(_0x24f86d){return function(_0x3c8e90,_0x2d7440,_0x21b908){ChatMessageEvents[_0x3c81('0x5')](_0x24f86d+':'+_0x3c8e90['id'],_0x3c8e90);ChatMessageEvents[_0x3c81('0x5')](_0x24f86d,_0x3c8e90);_0x21b908(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x3c81('0x6')](e,emitEvent(event));}}module[_0x3c81('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x9a8a=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','emit'];(function(_0x59659b,_0x38a9a7){var _0x5db166=function(_0x2f6c4c){while(--_0x2f6c4c){_0x59659b['push'](_0x59659b['shift']());}};_0x5db166(++_0x38a9a7);}(_0x9a8a,0x161));var _0xa9a8=function(_0x509fa6,_0x47a80d){_0x509fa6=_0x509fa6-0x0;var _0x42b0aa=_0x9a8a[_0x509fa6];return _0x42b0aa;};'use strict';var EventEmitter=require(_0xa9a8('0x0'));var ChatMessage=require(_0xa9a8('0x1'))['db'][_0xa9a8('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa9a8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa9a8('0x4'),'afterDestroy':_0xa9a8('0x5')};function emitEvent(_0x353be4){return function(_0x141aa5,_0x21acea,_0x41aab3){ChatMessageEvents[_0xa9a8('0x6')](_0x353be4+':'+_0x141aa5['id'],_0x141aa5);ChatMessageEvents['emit'](_0x353be4,_0x141aa5);_0x41aab3(null);};}for(var e in events){if(events[_0xa9a8('0x7')](e)){var event=events[e];ChatMessage[_0xa9a8('0x8')](e,emitEvent(event));}}module[_0xa9a8('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 7904d79..32743ec 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 _0xb781=['chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','findOne','ChatInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','define','ChatMessage'];(function(_0x274563,_0x5788b2){var _0x51ecb1=function(_0x33d4c9){while(--_0x33d4c9){_0x274563['push'](_0x274563['shift']());}};_0x51ecb1(++_0x5788b2);}(_0xb781,0x134));var _0x1b78=function(_0x175574,_0x492a83){_0x175574=_0x175574-0x0;var _0x188079=_0xb781[_0x175574];return _0x188079;};'use strict';var _=require(_0x1b78('0x0'));var util=require(_0x1b78('0x1'));var logger=require(_0x1b78('0x2'))(_0x1b78('0x3'));var moment=require('moment');var BPromise=require(_0x1b78('0x4'));var rp=require(_0x1b78('0x5'));var fs=require('fs');var path=require(_0x1b78('0x6'));var rimraf=require('rimraf');var config=require(_0x1b78('0x7'));var attributes=require(_0x1b78('0x8'));module['exports']=function(_0x5634f4,_0x5b58e9){return _0x5634f4[_0x1b78('0x9')](_0x1b78('0xa'),attributes,{'tableName':_0x1b78('0xb'),'paranoid':![],'indexes':[{'name':_0x1b78('0xc'),'fields':[_0x1b78('0xd')],'type':_0x1b78('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1797b5,_0x3ecdc5,_0x12747b){var _0x14c544=_0x5634f4['models'];var _0x5bd63c=_0x1797b5[_0x1b78('0xf')]({'plain':!![]});if(_0x5bd63c[_0x1b78('0x10')][_0x1b78('0x11')]()==='in'||_0x5bd63c[_0x1b78('0x10')][_0x1b78('0x11')]()===_0x1b78('0x12')&&!_0x5bd63c[_0x1b78('0x13')]&&!_[_0x1b78('0x14')](_0x5bd63c['UserId'])){_0x14c544['ChatInteraction'][_0x1b78('0x15')]({'where':{'id':_0x5bd63c[_0x1b78('0x16')]}})[_0x1b78('0x17')](function(_0x181624){if(_0x181624){_0x181624[_0x1b78('0x18')]({'lastMsgAt':_0x5bd63c['createdAt'],'lastMsgDirection':_0x5bd63c[_0x1b78('0x10')][_0x1b78('0x11')]()});}})[_0x1b78('0x19')](function(_0x499b8a){console[_0x1b78('0x1a')](_0x499b8a);});}_0x12747b();}},'charset':_0x1b78('0x1b'),'collate':_0x1b78('0x1c')});}; \ No newline at end of file +var _0x3116=['exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','ChatInteractionId','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./chatMessage.attributes'];(function(_0xec034,_0x16c358){var _0x2c5a19=function(_0xec401c){while(--_0xec401c){_0xec034['push'](_0xec034['shift']());}};_0x2c5a19(++_0x16c358);}(_0x3116,0x165));var _0x6311=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x3116[_0x1d9aa0];return _0x226868;};'use strict';var _=require('lodash');var util=require(_0x6311('0x0'));var logger=require(_0x6311('0x1'))('api');var moment=require(_0x6311('0x2'));var BPromise=require(_0x6311('0x3'));var rp=require(_0x6311('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6311('0x5'));var attributes=require(_0x6311('0x6'));module[_0x6311('0x7')]=function(_0x507964,_0xa3dbdf){return _0x507964[_0x6311('0x8')]('ChatMessage',attributes,{'tableName':_0x6311('0x9'),'paranoid':![],'indexes':[{'name':_0x6311('0xa'),'fields':[_0x6311('0xb')],'type':_0x6311('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xb43df3,_0x4fa064,_0x2614f1){var _0x149d4a=_0x507964[_0x6311('0xd')];var _0x2ad612=_0xb43df3['get']({'plain':!![]});if(_0x2ad612[_0x6311('0xe')][_0x6311('0xf')]()==='in'||_0x2ad612[_0x6311('0xe')][_0x6311('0xf')]()==='out'&&!_0x2ad612[_0x6311('0x10')]&&!_[_0x6311('0x11')](_0x2ad612[_0x6311('0x12')])){_0x149d4a[_0x6311('0x13')]['findOne']({'where':{'id':_0x2ad612[_0x6311('0x14')]}})['then'](function(_0x161bd5){if(_0x161bd5){_0x161bd5['update']({'lastMsgAt':_0x2ad612[_0x6311('0x15')],'lastMsgDirection':_0x2ad612[_0x6311('0xe')][_0x6311('0xf')]()});}})[_0x6311('0x16')](function(_0x428a05){console[_0x6311('0x17')](_0x428a05);});}_0x2614f1();}},'charset':_0x6311('0x18'),'collate':_0x6311('0x19')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index a7e2150..a328558 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 _0x16c4=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateChatMessage','ChatMessage','body','options','raw','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x421e36,_0x18776e){var _0x20b3e3=function(_0x767de4){while(--_0x767de4){_0x421e36['push'](_0x421e36['shift']());}};_0x20b3e3(++_0x18776e);}(_0x16c4,0x100));var _0x416c=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0x16c4[_0x4de586];return _0x46baf5;};'use strict';var _=require(_0x416c('0x0'));var util=require(_0x416c('0x1'));var moment=require(_0x416c('0x2'));var BPromise=require(_0x416c('0x3'));var rs=require(_0x416c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x416c('0x5'))['db'];var utils=require(_0x416c('0x6'));var logger=require('../../config/logger')(_0x416c('0x7'));var config=require(_0x416c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x416c('0x9')][_0x416c('0xa')]({'port':0x232a});config[_0x416c('0xb')]=_[_0x416c('0xc')](config[_0x416c('0xb')],{'host':_0x416c('0xd'),'port':0x18eb});var socket=require(_0x416c('0xe'))(new Redis(config[_0x416c('0xb')]));require('./chatMessage.socket')[_0x416c('0xf')](socket);function respondWithRpcPromise(_0x1e672c,_0x37b21b,_0x25c55a){return new BPromise(function(_0x3b7b3a,_0x236561){return client[_0x416c('0x10')](_0x1e672c,_0x25c55a)['then'](function(_0x1dee6d){logger['info'](_0x416c('0x11'),_0x37b21b,'request\x20sent');logger[_0x416c('0x12')](_0x416c('0x13'),_0x37b21b,_0x416c('0x14'),JSON[_0x416c('0x15')](_0x1dee6d));if(_0x1dee6d['error']){if(_0x1dee6d[_0x416c('0x16')][_0x416c('0x17')]===0x1f4){logger[_0x416c('0x16')]('ChatMessage,\x20%s,\x20%s',_0x37b21b,_0x1dee6d[_0x416c('0x16')][_0x416c('0x18')]);return _0x236561(_0x1dee6d[_0x416c('0x16')][_0x416c('0x18')]);}logger[_0x416c('0x16')]('ChatMessage,\x20%s,\x20%s',_0x37b21b,_0x1dee6d[_0x416c('0x16')][_0x416c('0x18')]);return _0x3b7b3a(_0x1dee6d[_0x416c('0x16')][_0x416c('0x18')]);}else{logger['info'](_0x416c('0x11'),_0x37b21b,_0x416c('0x14'));_0x3b7b3a(_0x1dee6d[_0x416c('0x19')][_0x416c('0x18')]);}})['catch'](function(_0x39da7d){logger[_0x416c('0x16')](_0x416c('0x11'),_0x37b21b,_0x39da7d);_0x236561(_0x39da7d);});});}exports[_0x416c('0x1a')]=function(_0x1466d4){var _0x3b2bbd=this;return new Promise(function(_0x9ee25b,_0x336b3e){return db[_0x416c('0x1b')]['create'](_0x1466d4[_0x416c('0x1c')],{'raw':_0x1466d4[_0x416c('0x1d')]?_0x1466d4['options'][_0x416c('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x5290c9){logger[_0x416c('0x1f')](_0x416c('0x1a'),_0x1466d4);logger[_0x416c('0x12')]('CreateChatMessage',_0x1466d4,JSON[_0x416c('0x15')](_0x5290c9));_0x9ee25b(_0x5290c9);})[_0x416c('0x20')](function(_0x57e1b3){logger[_0x416c('0x16')](_0x416c('0x1a'),_0x57e1b3[_0x416c('0x18')],_0x1466d4);_0x336b3e(_0x3b2bbd['error'](0x1f4,_0x57e1b3[_0x416c('0x18')]));});});}; \ No newline at end of file +var _0x2071=['CreateChatMessage','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','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','error','code','message','result','ChatMessage','create','body','options','raw'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x2071,0xb1));var _0x1207=function(_0x45ac0c,_0x2f8a58){_0x45ac0c=_0x45ac0c-0x0;var _0x4b4074=_0x2071[_0x45ac0c];return _0x4b4074;};'use strict';var _=require(_0x1207('0x0'));var util=require(_0x1207('0x1'));var moment=require(_0x1207('0x2'));var BPromise=require('bluebird');var rs=require(_0x1207('0x3'));var fs=require('fs');var Redis=require(_0x1207('0x4'));var db=require(_0x1207('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1207('0x6'))(_0x1207('0x7'));var config=require(_0x1207('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1207('0x9')][_0x1207('0xa')]({'port':0x232a});config[_0x1207('0xb')]=_['defaults'](config[_0x1207('0xb')],{'host':_0x1207('0xc'),'port':0x18eb});var socket=require(_0x1207('0xd'))(new Redis(config[_0x1207('0xb')]));require(_0x1207('0xe'))[_0x1207('0xf')](socket);function respondWithRpcPromise(_0x5ceb02,_0x31e4e6,_0x1c6b7d){return new BPromise(function(_0x77196f,_0x57465e){return client[_0x1207('0x10')](_0x5ceb02,_0x1c6b7d)[_0x1207('0x11')](function(_0x1923fc){logger[_0x1207('0x12')](_0x1207('0x13'),_0x31e4e6,_0x1207('0x14'));logger[_0x1207('0x15')](_0x1207('0x16'),_0x31e4e6,_0x1207('0x14'),JSON[_0x1207('0x17')](_0x1923fc));if(_0x1923fc[_0x1207('0x18')]){if(_0x1923fc[_0x1207('0x18')][_0x1207('0x19')]===0x1f4){logger[_0x1207('0x18')](_0x1207('0x13'),_0x31e4e6,_0x1923fc['error'][_0x1207('0x1a')]);return _0x57465e(_0x1923fc['error'][_0x1207('0x1a')]);}logger['error'](_0x1207('0x13'),_0x31e4e6,_0x1923fc['error'][_0x1207('0x1a')]);return _0x77196f(_0x1923fc['error'][_0x1207('0x1a')]);}else{logger[_0x1207('0x12')]('ChatMessage,\x20%s,\x20%s',_0x31e4e6,_0x1207('0x14'));_0x77196f(_0x1923fc[_0x1207('0x1b')][_0x1207('0x1a')]);}})['catch'](function(_0x307222){logger[_0x1207('0x18')]('ChatMessage,\x20%s,\x20%s',_0x31e4e6,_0x307222);_0x57465e(_0x307222);});});}exports['CreateChatMessage']=function(_0xf18695){var _0x3866fd=this;return new Promise(function(_0x30b32a,_0x4f5fcf){return db[_0x1207('0x1c')][_0x1207('0x1d')](_0xf18695[_0x1207('0x1e')],{'raw':_0xf18695[_0x1207('0x1f')]?_0xf18695[_0x1207('0x1f')][_0x1207('0x20')]===undefined?!![]:![]:!![]})[_0x1207('0x11')](function(_0x372c36){logger[_0x1207('0x12')](_0x1207('0x21'),_0xf18695);logger[_0x1207('0x15')]('CreateChatMessage',_0xf18695,JSON[_0x1207('0x17')](_0x372c36));_0x30b32a(_0x372c36);})[_0x1207('0x22')](function(_0x503f08){logger[_0x1207('0x18')](_0x1207('0x21'),_0x503f08['message'],_0xf18695);_0x4f5fcf(_0x3866fd[_0x1207('0x18')](0x1f4,_0x503f08[_0x1207('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 691651c..4873d2a 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 _0x84e7=['save','remove','emit','removeListener','register'];(function(_0x16f792,_0x27268b){var _0x2d0ec=function(_0x3a5ff5){while(--_0x3a5ff5){_0x16f792['push'](_0x16f792['shift']());}};_0x2d0ec(++_0x27268b);}(_0x84e7,0x122));var _0x784e=function(_0x2babbf,_0x480062){_0x2babbf=_0x2babbf-0x0;var _0x363a62=_0x84e7[_0x2babbf];return _0x363a62;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x784e('0x0'),_0x784e('0x1'),'update'];function createListener(_0x3548d2,_0x2c1d96){return function(_0x50f44d){_0x2c1d96[_0x784e('0x2')](_0x3548d2,_0x50f44d);};}function removeListener(_0x14cee2,_0x205619){return function(){ChatMessageEvents[_0x784e('0x3')](_0x14cee2,_0x205619);};}exports[_0x784e('0x4')]=function(_0x133296){for(var _0x48ed22=0x0,_0x3cbdd1=events['length'];_0x48ed22<_0x3cbdd1;_0x48ed22++){var _0xfaa170=events[_0x48ed22];var _0x24654d=createListener('chatMessage:'+_0xfaa170,_0x133296);ChatMessageEvents['on'](_0xfaa170,_0x24654d);}}; \ No newline at end of file +var _0x26d1=['update','removeListener','register','chatMessage:','./chatMessage.events','remove'];(function(_0x2cdd2f,_0xbd47c1){var _0x42c66b=function(_0x722080){while(--_0x722080){_0x2cdd2f['push'](_0x2cdd2f['shift']());}};_0x42c66b(++_0xbd47c1);}(_0x26d1,0x8e));var _0x126d=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x26d1[_0x3e5086];return _0xfeb102;};'use strict';var ChatMessageEvents=require(_0x126d('0x0'));var events=['save',_0x126d('0x1'),_0x126d('0x2')];function createListener(_0x37ff4c,_0x2a20fc){return function(_0x59d0a0){_0x2a20fc['emit'](_0x37ff4c,_0x59d0a0);};}function removeListener(_0x3a3fb4,_0x48016e){return function(){ChatMessageEvents[_0x126d('0x3')](_0x3a3fb4,_0x48016e);};}exports[_0x126d('0x4')]=function(_0x442e04){for(var _0x449ed0=0x0,_0x2b4dfc=events['length'];_0x449ed0<_0x2b4dfc;_0x449ed0++){var _0x2e668c=events[_0x449ed0];var _0x25ccc2=createListener(_0x126d('0x5')+_0x2e668c,_0x442e04);ChatMessageEvents['on'](_0x2e668c,_0x25ccc2);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index c7c7017..990413d 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 _0x2267=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy'];(function(_0x469ac7,_0x38e416){var _0x22f3b0=function(_0x1a1447){while(--_0x1a1447){_0x469ac7['push'](_0x469ac7['shift']());}};_0x22f3b0(++_0x38e416);}(_0x2267,0x150));var _0x7226=function(_0x2d2ac4,_0x48c2d0){_0x2d2ac4=_0x2d2ac4-0x0;var _0x19f63b=_0x2267[_0x2d2ac4];return _0x19f63b;};'use strict';var multer=require(_0x7226('0x0'));var util=require(_0x7226('0x1'));var path=require(_0x7226('0x2'));var timeout=require('connect-timeout');var express=require(_0x7226('0x3'));var router=express[_0x7226('0x4')]();var fs_extra=require(_0x7226('0x5'));var auth=require(_0x7226('0x6'));var interaction=require(_0x7226('0x7'));var config=require(_0x7226('0x8'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0x7226('0x9')](),controller[_0x7226('0xa')]);router[_0x7226('0xb')](_0x7226('0xc'),auth[_0x7226('0x9')](),controller[_0x7226('0xd')]);router[_0x7226('0xb')](_0x7226('0xe'),auth[_0x7226('0x9')](),controller[_0x7226('0xf')]);router[_0x7226('0x10')]('/',auth[_0x7226('0x9')](),interaction[_0x7226('0x11')](_0x7226('0x12'),_0x7226('0x13')),controller[_0x7226('0x14')]);router[_0x7226('0x15')](_0x7226('0xe'),controller[_0x7226('0x16')]);router[_0x7226('0x15')](_0x7226('0x17'),auth[_0x7226('0x9')](),controller['accept']);router[_0x7226('0x15')](_0x7226('0x18'),auth[_0x7226('0x9')](),controller[_0x7226('0x19')]);router[_0x7226('0x1a')](_0x7226('0xe'),auth[_0x7226('0x9')](),controller[_0x7226('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x1f7c=['show','post','chat','chatmessage:create','create','put','accept','/:id/reject','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id'];(function(_0x48adc5,_0x248aa0){var _0x4e758d=function(_0x4f7075){while(--_0x4f7075){_0x48adc5['push'](_0x48adc5['shift']());}};_0x4e758d(++_0x248aa0);}(_0x1f7c,0x94));var _0xc1f7=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x1f7c[_0x4eafed];return _0x159c85;};'use strict';var multer=require(_0xc1f7('0x0'));var util=require(_0xc1f7('0x1'));var path=require(_0xc1f7('0x2'));var timeout=require(_0xc1f7('0x3'));var express=require('express');var router=express[_0xc1f7('0x4')]();var fs_extra=require(_0xc1f7('0x5'));var auth=require(_0xc1f7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc1f7('0x7'));var controller=require('./chatMessage.controller');router[_0xc1f7('0x8')]('/',auth[_0xc1f7('0x9')](),controller[_0xc1f7('0xa')]);router[_0xc1f7('0x8')](_0xc1f7('0xb'),auth[_0xc1f7('0x9')](),controller['describe']);router[_0xc1f7('0x8')](_0xc1f7('0xc'),auth[_0xc1f7('0x9')](),controller[_0xc1f7('0xd')]);router[_0xc1f7('0xe')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xc1f7('0xf'),_0xc1f7('0x10')),controller[_0xc1f7('0x11')]);router[_0xc1f7('0x12')](_0xc1f7('0xc'),controller['update']);router[_0xc1f7('0x12')]('/:id/accept',auth[_0xc1f7('0x9')](),controller[_0xc1f7('0x13')]);router[_0xc1f7('0x12')](_0xc1f7('0x14'),auth[_0xc1f7('0x9')](),controller['reject']);router[_0xc1f7('0x15')](_0xc1f7('0xc'),auth[_0xc1f7('0x9')](),controller[_0xc1f7('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 628939c..95f3829 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(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x45313f,_0x46caf4){_0x45313f=_0x45313f-0x0;var _0x402910=_0x0b0e[_0x45313f];return _0x402910;};'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 _0x5f66=['medium','TEXT','exports'];(function(_0x2dbb34,_0x242ce4){var _0x27af07=function(_0x4f2d42){while(--_0x4f2d42){_0x2dbb34['push'](_0x2dbb34['shift']());}};_0x27af07(++_0x242ce4);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 3e8a593..ce76243 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x443f3a,_0x1495a4){var _0x745941=function(_0x137521){while(--_0x137521){_0x443f3a['push'](_0x443f3a['shift']());}};_0x745941(++_0x1495a4);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _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(_0x5020e5,_0x2a7658){var _0x531ea0=function(_0x43890d){while(--_0x43890d){_0x5020e5['push'](_0x5020e5['shift']());}};_0x531ea0(++_0x2a7658);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index c67b8b7..2db56fa 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 _0x6093=['emit','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove'];(function(_0x5e7d01,_0x9d5f52){var _0x113ca9=function(_0x1f165e){while(--_0x1f165e){_0x5e7d01['push'](_0x5e7d01['shift']());}};_0x113ca9(++_0x9d5f52);}(_0x6093,0x107));var _0x3609=function(_0x480e46,_0x56217c){_0x480e46=_0x480e46-0x0;var _0x59c422=_0x6093[_0x480e46];return _0x59c422;};'use strict';var EventEmitter=require(_0x3609('0x0'));var ChatOfflineMessage=require(_0x3609('0x1'))['db'][_0x3609('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x3609('0x3')](0x0);var events={'afterCreate':_0x3609('0x4'),'afterUpdate':_0x3609('0x5'),'afterDestroy':_0x3609('0x6')};function emitEvent(_0x58fa47){return function(_0x50b83d,_0x3b97f7,_0x464521){ChatOfflineMessageEvents[_0x3609('0x7')](_0x58fa47+':'+_0x50b83d['id'],_0x50b83d);ChatOfflineMessageEvents[_0x3609('0x7')](_0x58fa47,_0x50b83d);_0x464521(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x3609('0x8')](e,emitEvent(event));}}module[_0x3609('0x9')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x7484=['save','remove','emit','hasOwnProperty','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x4e4af2,_0x2ba40f){var _0x138886=function(_0x1b7c9c){while(--_0x1b7c9c){_0x4e4af2['push'](_0x4e4af2['shift']());}};_0x138886(++_0x2ba40f);}(_0x7484,0x90));var _0x4748=function(_0x30fc71,_0x4ecc37){_0x30fc71=_0x30fc71-0x0;var _0x343efa=_0x7484[_0x30fc71];return _0x343efa;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x4748('0x0'))['db'][_0x4748('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x4748('0x2')](0x0);var events={'afterCreate':_0x4748('0x3'),'afterUpdate':'update','afterDestroy':_0x4748('0x4')};function emitEvent(_0x20966b){return function(_0x2014d9,_0x2da04d,_0x2aecae){ChatOfflineMessageEvents[_0x4748('0x5')](_0x20966b+':'+_0x2014d9['id'],_0x2014d9);ChatOfflineMessageEvents['emit'](_0x20966b,_0x2014d9);_0x2aecae(null);};}for(var e in events){if(events[_0x4748('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index aec4318..1f78278 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 _0x3820=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports'];(function(_0x2f0323,_0xdf46f5){var _0x1ff23b=function(_0x300771){while(--_0x300771){_0x2f0323['push'](_0x2f0323['shift']());}};_0x1ff23b(++_0xdf46f5);}(_0x3820,0x1cf));var _0x0382=function(_0x3b1e04,_0x1b7b69){_0x3b1e04=_0x3b1e04-0x0;var _0x4b6fa0=_0x3820[_0x3b1e04];return _0x4b6fa0;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x0382('0x0')]=function(_0x5be3d0){return _0x5be3d0['define']('ChatOfflineMessage',attributes,{'tableName':_0x0382('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0382('0x2'),'collate':_0x0382('0x3')});}; \ No newline at end of file +var _0xd954=['ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports','define'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xd954,0x1e3));var _0x4d95=function(_0x482913,_0x38462a){_0x482913=_0x482913-0x0;var _0x49f170=_0xd954[_0x482913];return _0x49f170;};'use strict';var attributes=require(_0x4d95('0x0'));module[_0x4d95('0x1')]=function(_0x1efc99){return _0x1efc99[_0x4d95('0x2')](_0x4d95('0x3'),attributes,{'tableName':_0x4d95('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4d95('0x5'),'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 cb214f5..31e77b4 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 _0x5127=['client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x5127,0x64));var _0x7512=function(_0x378d18,_0x17362b){_0x378d18=_0x378d18-0x0;var _0x52d233=_0x5127[_0x378d18];return _0x52d233;};'use strict';var _=require(_0x7512('0x0'));var util=require(_0x7512('0x1'));var moment=require(_0x7512('0x2'));var BPromise=require(_0x7512('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7512('0x4'));var db=require(_0x7512('0x5'))['db'];var utils=require(_0x7512('0x6'));var logger=require('../../config/logger')(_0x7512('0x7'));var config=require(_0x7512('0x8'));var jayson=require(_0x7512('0x9'));var client=jayson[_0x7512('0xa')][_0x7512('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d08ae,_0x40eee2,_0x208711){return new BPromise(function(_0x1be9e3,_0x4c3df7){return client[_0x7512('0xc')](_0x5d08ae,_0x208711)[_0x7512('0xd')](function(_0x16d3d0){logger['info'](_0x7512('0xe'),_0x40eee2,_0x7512('0xf'));logger[_0x7512('0x10')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x40eee2,'request\x20sent',JSON[_0x7512('0x11')](_0x16d3d0));if(_0x16d3d0[_0x7512('0x12')]){if(_0x16d3d0[_0x7512('0x12')]['code']===0x1f4){logger[_0x7512('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x40eee2,_0x16d3d0[_0x7512('0x12')]['message']);return _0x4c3df7(_0x16d3d0[_0x7512('0x12')][_0x7512('0x13')]);}logger[_0x7512('0x12')](_0x7512('0xe'),_0x40eee2,_0x16d3d0[_0x7512('0x12')][_0x7512('0x13')]);return _0x1be9e3(_0x16d3d0[_0x7512('0x12')]['message']);}else{logger[_0x7512('0x14')](_0x7512('0xe'),_0x40eee2,_0x7512('0xf'));_0x1be9e3(_0x16d3d0[_0x7512('0x15')][_0x7512('0x13')]);}})['catch'](function(_0x523fa0){logger['error'](_0x7512('0xe'),_0x40eee2,_0x523fa0);_0x4c3df7(_0x523fa0);});});} \ No newline at end of file +var _0xcd1b=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then','request\x20sent','debug','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x1a2552,_0xc7af2b){var _0x3304d7=function(_0x56a48b){while(--_0x56a48b){_0x1a2552['push'](_0x1a2552['shift']());}};_0x3304d7(++_0xc7af2b);}(_0xcd1b,0x18e));var _0xbcd1=function(_0x374563,_0x37ac1f){_0x374563=_0x374563-0x0;var _0x7b151b=_0xcd1b[_0x374563];return _0x7b151b;};'use strict';var _=require(_0xbcd1('0x0'));var util=require(_0xbcd1('0x1'));var moment=require('moment');var BPromise=require(_0xbcd1('0x2'));var rs=require(_0xbcd1('0x3'));var fs=require('fs');var Redis=require(_0xbcd1('0x4'));var db=require(_0xbcd1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbcd1('0x6'))(_0xbcd1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbcd1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x187ec1,_0x46d5f8,_0x26f7e5){return new BPromise(function(_0x19d0da,_0x76c75c){return client[_0xbcd1('0x9')](_0x187ec1,_0x26f7e5)[_0xbcd1('0xa')](function(_0x579920){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x46d5f8,_0xbcd1('0xb'));logger[_0xbcd1('0xc')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x46d5f8,_0xbcd1('0xb'),JSON[_0xbcd1('0xd')](_0x579920));if(_0x579920[_0xbcd1('0xe')]){if(_0x579920[_0xbcd1('0xe')][_0xbcd1('0xf')]===0x1f4){logger['error'](_0xbcd1('0x10'),_0x46d5f8,_0x579920[_0xbcd1('0xe')][_0xbcd1('0x11')]);return _0x76c75c(_0x579920[_0xbcd1('0xe')]['message']);}logger[_0xbcd1('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x46d5f8,_0x579920[_0xbcd1('0xe')][_0xbcd1('0x11')]);return _0x19d0da(_0x579920[_0xbcd1('0xe')]['message']);}else{logger[_0xbcd1('0x12')](_0xbcd1('0x10'),_0x46d5f8,'request\x20sent');_0x19d0da(_0x579920[_0xbcd1('0x13')][_0xbcd1('0x11')]);}})[_0xbcd1('0x14')](function(_0x5411c2){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x46d5f8,_0x5411c2);_0x76c75c(_0x5411c2);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index f55137e..525dc5f 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 _0x1978=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x20713e,_0x44f710){var _0x7d998b=function(_0x5d98ab){while(--_0x5d98ab){_0x20713e['push'](_0x20713e['shift']());}};_0x7d998b(++_0x44f710);}(_0x1978,0xe8));var _0x8197=function(_0xb2a752,_0x270535){_0xb2a752=_0xb2a752-0x0;var _0x5acaa6=_0x1978[_0xb2a752];return _0x5acaa6;};'use strict';var multer=require(_0x8197('0x0'));var util=require('util');var path=require(_0x8197('0x1'));var timeout=require(_0x8197('0x2'));var express=require(_0x8197('0x3'));var router=express[_0x8197('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8197('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8197('0x6'));router[_0x8197('0x7')]('/',auth['isAuthenticated'](),controller[_0x8197('0x8')]);router[_0x8197('0x7')](_0x8197('0x9'),auth[_0x8197('0xa')](),controller[_0x8197('0xb')]);router[_0x8197('0x7')](_0x8197('0xc'),auth[_0x8197('0xa')](),controller[_0x8197('0xd')]);router[_0x8197('0xe')]('/',auth[_0x8197('0xa')](),controller[_0x8197('0xf')]);router[_0x8197('0x10')]('/:id',auth[_0x8197('0xa')](),controller[_0x8197('0x11')]);router[_0x8197('0x12')](_0x8197('0xc'),auth['isAuthenticated'](),controller[_0x8197('0x13')]);module[_0x8197('0x14')]=router; \ No newline at end of file +var _0xc634=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get'];(function(_0xecdc9,_0x1bd008){var _0x2a91c1=function(_0x3036dd){while(--_0x3036dd){_0xecdc9['push'](_0xecdc9['shift']());}};_0x2a91c1(++_0x1bd008);}(_0xc634,0x171));var _0x4c63=function(_0x14022a,_0x4ca101){_0x14022a=_0x14022a-0x0;var _0x12b439=_0xc634[_0x14022a];return _0x12b439;};'use strict';var multer=require(_0x4c63('0x0'));var util=require(_0x4c63('0x1'));var path=require(_0x4c63('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x4c63('0x3'));var auth=require(_0x4c63('0x4'));var interaction=require(_0x4c63('0x5'));var config=require(_0x4c63('0x6'));var controller=require(_0x4c63('0x7'));router[_0x4c63('0x8')]('/',auth[_0x4c63('0x9')](),controller[_0x4c63('0xa')]);router[_0x4c63('0x8')](_0x4c63('0xb'),auth[_0x4c63('0x9')](),controller[_0x4c63('0xc')]);router[_0x4c63('0x8')](_0x4c63('0xd'),auth[_0x4c63('0x9')](),controller[_0x4c63('0xe')]);router[_0x4c63('0xf')]('/',auth[_0x4c63('0x9')](),controller[_0x4c63('0x10')]);router[_0x4c63('0x11')](_0x4c63('0xd'),auth[_0x4c63('0x9')](),controller[_0x4c63('0x12')]);router[_0x4c63('0x13')](_0x4c63('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x4c63('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 70ff43d..c4a5461 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 _0x3fb1=['sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x36ac17,_0x5bca12){var _0x288dd8=function(_0x2592a8){while(--_0x2592a8){_0x36ac17['push'](_0x36ac17['shift']());}};_0x288dd8(++_0x5bca12);}(_0x3fb1,0x195));var _0x13fb=function(_0x5dbe75,_0x5d23e0){_0x5dbe75=_0x5dbe75-0x0;var _0x528bd3=_0x3fb1[_0x5dbe75];return _0x528bd3;};'use strict';var Sequelize=require(_0x13fb('0x0'));module[_0x13fb('0x1')]={'name':{'type':Sequelize[_0x13fb('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x13fb('0x3')](_0x13fb('0x4'),'timeout'),'defaultValue':_0x13fb('0x4')},'selector':{'type':Sequelize[_0x13fb('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x5848=['exports','STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x5848,0x1cd));var _0x8584=function(_0x59010d,_0x2ef76a){_0x59010d=_0x59010d-0x0;var _0x5b9bf8=_0x5848[_0x59010d];return _0x5b9bf8;};'use strict';var Sequelize=require(_0x8584('0x0'));module[_0x8584('0x1')]={'name':{'type':Sequelize[_0x8584('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8584('0x3')](_0x8584('0x4'),_0x8584('0x5')),'defaultValue':_0x8584('0x4')},'selector':{'type':Sequelize[_0x8584('0x2')]},'timeout':{'type':Sequelize[_0x8584('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 1d0fd3d..74f9fce 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 _0x75a2=['find','catch','create','body','update','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','reject','save','then','sendStatus','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','options'];(function(_0x440482,_0x15c21b){var _0xb89329=function(_0x55c4cb){while(--_0x55c4cb){_0x440482['push'](_0x440482['shift']());}};_0xb89329(++_0x15c21b);}(_0x75a2,0x187));var _0x275a=function(_0x5ae897,_0x52a6f8){_0x5ae897=_0x5ae897-0x0;var _0x34e4a6=_0x75a2[_0x5ae897];return _0x34e4a6;};'use strict';var emlformat=require(_0x275a('0x0'));var rimraf=require(_0x275a('0x1'));var zipdir=require(_0x275a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x275a('0x3'));var moment=require(_0x275a('0x4'));var BPromise=require(_0x275a('0x5'));var Mustache=require(_0x275a('0x6'));var util=require('util');var path=require(_0x275a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x275a('0x8'));var squel=require(_0x275a('0x9'));var crypto=require(_0x275a('0xa'));var jsforce=require(_0x275a('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x275a('0xc'));var Papa=require(_0x275a('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x275a('0xe'));var hardwareService=require(_0x275a('0xf'));var logger=require(_0x275a('0x10'))(_0x275a('0x11'));var utils=require(_0x275a('0x12'));var config=require(_0x275a('0x13'));var licenseUtil=require(_0x275a('0x14'));var db=require(_0x275a('0x15'))['db'];function respondWithStatusCode(_0x2b5204,_0x991cd0){_0x991cd0=_0x991cd0||0xcc;return function(_0x263f8f){if(_0x263f8f){return _0x2b5204['sendStatus'](_0x991cd0);}return _0x2b5204[_0x275a('0x16')](_0x991cd0)[_0x275a('0x17')]();};}function respondWithResult(_0x480be0,_0x541c80){_0x541c80=_0x541c80||0xc8;return function(_0x2baa83){if(_0x2baa83){return _0x480be0[_0x275a('0x16')](_0x541c80)[_0x275a('0x18')](_0x2baa83);}};}function respondWithFilteredResult(_0x2560ae,_0x227cee){return function(_0x125348){if(_0x125348){var _0x283865=typeof _0x227cee[_0x275a('0x19')]===_0x275a('0x1a')&&typeof _0x227cee['limit']==='undefined';var _0x21cf70=_0x125348[_0x275a('0x1b')];var _0x50374a=_0x283865?0x0:_0x227cee[_0x275a('0x19')];var _0x59d755=_0x283865?_0x125348[_0x275a('0x1b')]:_0x227cee[_0x275a('0x19')]+_0x227cee['limit'];var _0xe59012;if(_0x59d755>=_0x21cf70){_0x59d755=_0x21cf70;_0xe59012=0xc8;}else{_0xe59012=0xce;}_0x2560ae[_0x275a('0x16')](_0xe59012);return _0x2560ae['set']('Content-Range',_0x50374a+'-'+_0x59d755+'/'+_0x21cf70)[_0x275a('0x18')](_0x125348);}return null;};}function patchUpdates(_0x456c61){return function(_0x4864c2){try{jsonpatch['apply'](_0x4864c2,_0x456c61,!![]);}catch(_0x4afb5e){return BPromise[_0x275a('0x1c')](_0x4afb5e);}return _0x4864c2[_0x275a('0x1d')]();};}function saveUpdates(_0x453bab,_0x7d58d2){return function(_0xbb91e7){if(_0xbb91e7){return _0xbb91e7['update'](_0x453bab)[_0x275a('0x1e')](function(_0x19ef1f){return _0x19ef1f;});}return null;};}function removeEntity(_0x2f9232,_0x21a0ee){return function(_0x32eb4b){if(_0x32eb4b){return _0x32eb4b['destroy']()[_0x275a('0x1e')](function(){_0x2f9232[_0x275a('0x16')](0xcc)[_0x275a('0x17')]();});}};}function handleEntityNotFound(_0x1441c3,_0x263fde){return function(_0x2bfe4d){if(!_0x2bfe4d){_0x1441c3[_0x275a('0x1f')](0x194);}return _0x2bfe4d;};}function handleError(_0x366002,_0x204f05){_0x204f05=_0x204f05||0x1f4;return function(_0x3ad063){logger['error'](_0x3ad063[_0x275a('0x20')]);if(_0x3ad063[_0x275a('0x21')]){delete _0x3ad063['name'];}_0x366002[_0x275a('0x16')](_0x204f05)[_0x275a('0x22')](_0x3ad063);};}exports[_0x275a('0x23')]=function(_0xa5048b,_0x5be632){var _0x265b1f={'raw':!![],'where':{'id':_0xa5048b[_0x275a('0x24')]['id']}},_0x440157={};_0x440157[_0x275a('0x25')]=_[_0x275a('0x26')](db[_0x275a('0x27')][_0x275a('0x28')]);_0x440157[_0x275a('0x29')]=_[_0x275a('0x26')](_0xa5048b[_0x275a('0x29')]);_0x440157['filters']=_[_0x275a('0x2a')](_0x440157[_0x275a('0x25')],_0x440157['query']);_0x265b1f[_0x275a('0x2b')]=_[_0x275a('0x2a')](_0x440157[_0x275a('0x25')],qs[_0x275a('0x2c')](_0xa5048b['query'][_0x275a('0x2c')]));_0x265b1f[_0x275a('0x2b')]=_0x265b1f[_0x275a('0x2b')][_0x275a('0x2d')]?_0x265b1f[_0x275a('0x2b')]:_0x440157['model'];if(_0xa5048b[_0x275a('0x29')][_0x275a('0x2e')]){_0x265b1f[_0x275a('0x2f')]=[{'all':!![]}];}_0x265b1f=_['merge']({},_0x265b1f,_0xa5048b[_0x275a('0x30')]);return db['ChatProactiveAction'][_0x275a('0x31')](_0x265b1f)['then'](handleEntityNotFound(_0x5be632,null))['then'](respondWithResult(_0x5be632,null))[_0x275a('0x32')](handleError(_0x5be632,null));};exports[_0x275a('0x33')]=function(_0x946a67,_0x4c098a){return db[_0x275a('0x27')][_0x275a('0x33')](_0x946a67[_0x275a('0x34')],{})[_0x275a('0x1e')](respondWithResult(_0x4c098a,0xc9))[_0x275a('0x32')](handleError(_0x4c098a,null));};exports[_0x275a('0x35')]=function(_0x232e32,_0x18a03f){if(_0x232e32['body']['id']){delete _0x232e32[_0x275a('0x34')]['id'];}return db[_0x275a('0x27')][_0x275a('0x31')]({'where':{'id':_0x232e32['params']['id']}})[_0x275a('0x1e')](handleEntityNotFound(_0x18a03f,null))[_0x275a('0x1e')](saveUpdates(_0x232e32[_0x275a('0x34')],null))['then'](respondWithResult(_0x18a03f,null))[_0x275a('0x32')](handleError(_0x18a03f,null));};exports[_0x275a('0x36')]=function(_0x593b3d,_0x315e7d){return db[_0x275a('0x27')]['find']({'where':{'id':_0x593b3d[_0x275a('0x24')]['id']}})['then'](handleEntityNotFound(_0x315e7d,null))[_0x275a('0x1e')](removeEntity(_0x315e7d,null))[_0x275a('0x32')](handleError(_0x315e7d,null));}; \ No newline at end of file +var _0x8bc3=['model','rawAttributes','query','filters','intersection','fields','length','attributes','includeAll','include','merge','ChatProactiveAction','find','catch','create','update','body','destroy','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','end','status','json','offset','undefined','count','Content-Range','apply','reject','then','sendStatus','error','stack','name','params'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x8bc3,0x82));var _0x38bc=function(_0x5aef75,_0x39228e){_0x5aef75=_0x5aef75-0x0;var _0x1bb942=_0x8bc3[_0x5aef75];return _0x1bb942;};'use strict';var emlformat=require(_0x38bc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x38bc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x38bc('0x2'));var moment=require(_0x38bc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x38bc('0x4'));var util=require(_0x38bc('0x5'));var path=require(_0x38bc('0x6'));var sox=require(_0x38bc('0x7'));var csv=require('to-csv');var ejs=require(_0x38bc('0x8'));var fs=require('fs');var fs_extra=require(_0x38bc('0x9'));var _=require(_0x38bc('0xa'));var squel=require(_0x38bc('0xb'));var crypto=require(_0x38bc('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x38bc('0xd'));var querystring=require(_0x38bc('0xe'));var Papa=require(_0x38bc('0xf'));var Redis=require(_0x38bc('0x10'));var authService=require(_0x38bc('0x11'));var qs=require(_0x38bc('0x12'));var as=require(_0x38bc('0x13'));var hardwareService=require(_0x38bc('0x14'));var logger=require(_0x38bc('0x15'))(_0x38bc('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5f4b,_0x56fdcf){_0x56fdcf=_0x56fdcf||0xcc;return function(_0x486c59){if(_0x486c59){return _0x1a5f4b['sendStatus'](_0x56fdcf);}return _0x1a5f4b['status'](_0x56fdcf)[_0x38bc('0x17')]();};}function respondWithResult(_0x1a7903,_0x454eac){_0x454eac=_0x454eac||0xc8;return function(_0x5d4997){if(_0x5d4997){return _0x1a7903[_0x38bc('0x18')](_0x454eac)[_0x38bc('0x19')](_0x5d4997);}};}function respondWithFilteredResult(_0x1ff95d,_0x322c4e){return function(_0x2c223e){if(_0x2c223e){var _0x1c0cd2=typeof _0x322c4e[_0x38bc('0x1a')]===_0x38bc('0x1b')&&typeof _0x322c4e['limit']===_0x38bc('0x1b');var _0x55940b=_0x2c223e[_0x38bc('0x1c')];var _0x1f0e08=_0x1c0cd2?0x0:_0x322c4e[_0x38bc('0x1a')];var _0x30b309=_0x1c0cd2?_0x2c223e[_0x38bc('0x1c')]:_0x322c4e[_0x38bc('0x1a')]+_0x322c4e['limit'];var _0x36ccda;if(_0x30b309>=_0x55940b){_0x30b309=_0x55940b;_0x36ccda=0xc8;}else{_0x36ccda=0xce;}_0x1ff95d['status'](_0x36ccda);return _0x1ff95d['set'](_0x38bc('0x1d'),_0x1f0e08+'-'+_0x30b309+'/'+_0x55940b)[_0x38bc('0x19')](_0x2c223e);}return null;};}function patchUpdates(_0x325b14){return function(_0x19f3af){try{jsonpatch[_0x38bc('0x1e')](_0x19f3af,_0x325b14,!![]);}catch(_0x40e3b6){return BPromise[_0x38bc('0x1f')](_0x40e3b6);}return _0x19f3af['save']();};}function saveUpdates(_0x4a43c7,_0x2999b0){return function(_0x46b863){if(_0x46b863){return _0x46b863['update'](_0x4a43c7)[_0x38bc('0x20')](function(_0x5f4026){return _0x5f4026;});}return null;};}function removeEntity(_0x897a6b,_0x4251ee){return function(_0x434007){if(_0x434007){return _0x434007['destroy']()[_0x38bc('0x20')](function(){_0x897a6b[_0x38bc('0x18')](0xcc)[_0x38bc('0x17')]();});}};}function handleEntityNotFound(_0x49c92d,_0x349731){return function(_0x3daed5){if(!_0x3daed5){_0x49c92d[_0x38bc('0x21')](0x194);}return _0x3daed5;};}function handleError(_0x3a5b7f,_0x53cb1a){_0x53cb1a=_0x53cb1a||0x1f4;return function(_0x487679){logger[_0x38bc('0x22')](_0x487679[_0x38bc('0x23')]);if(_0x487679[_0x38bc('0x24')]){delete _0x487679[_0x38bc('0x24')];}_0x3a5b7f['status'](_0x53cb1a)['send'](_0x487679);};}exports['show']=function(_0x456a78,_0x43ab9f){var _0x404759={'raw':!![],'where':{'id':_0x456a78[_0x38bc('0x25')]['id']}},_0x539b3b={};_0x539b3b[_0x38bc('0x26')]=_['keys'](db['ChatProactiveAction'][_0x38bc('0x27')]);_0x539b3b['query']=_['keys'](_0x456a78[_0x38bc('0x28')]);_0x539b3b[_0x38bc('0x29')]=_[_0x38bc('0x2a')](_0x539b3b[_0x38bc('0x26')],_0x539b3b[_0x38bc('0x28')]);_0x404759['attributes']=_[_0x38bc('0x2a')](_0x539b3b[_0x38bc('0x26')],qs[_0x38bc('0x2b')](_0x456a78[_0x38bc('0x28')][_0x38bc('0x2b')]));_0x404759['attributes']=_0x404759['attributes'][_0x38bc('0x2c')]?_0x404759[_0x38bc('0x2d')]:_0x539b3b[_0x38bc('0x26')];if(_0x456a78[_0x38bc('0x28')][_0x38bc('0x2e')]){_0x404759[_0x38bc('0x2f')]=[{'all':!![]}];}_0x404759=_[_0x38bc('0x30')]({},_0x404759,_0x456a78['options']);return db[_0x38bc('0x31')][_0x38bc('0x32')](_0x404759)['then'](handleEntityNotFound(_0x43ab9f,null))[_0x38bc('0x20')](respondWithResult(_0x43ab9f,null))[_0x38bc('0x33')](handleError(_0x43ab9f,null));};exports[_0x38bc('0x34')]=function(_0x17031c,_0x477411){return db['ChatProactiveAction'][_0x38bc('0x34')](_0x17031c['body'],{})[_0x38bc('0x20')](respondWithResult(_0x477411,0xc9))[_0x38bc('0x33')](handleError(_0x477411,null));};exports[_0x38bc('0x35')]=function(_0x14d8cf,_0x109af1){if(_0x14d8cf[_0x38bc('0x36')]['id']){delete _0x14d8cf[_0x38bc('0x36')]['id'];}return db[_0x38bc('0x31')]['find']({'where':{'id':_0x14d8cf[_0x38bc('0x25')]['id']}})[_0x38bc('0x20')](handleEntityNotFound(_0x109af1,null))[_0x38bc('0x20')](saveUpdates(_0x14d8cf['body'],null))['then'](respondWithResult(_0x109af1,null))[_0x38bc('0x33')](handleError(_0x109af1,null));};exports[_0x38bc('0x37')]=function(_0xdba6c5,_0x43cfbf){return db[_0x38bc('0x31')][_0x38bc('0x32')]({'where':{'id':_0xdba6c5[_0x38bc('0x25')]['id']}})[_0x38bc('0x20')](handleEntityNotFound(_0x43cfbf,null))['then'](removeEntity(_0x43cfbf,null))[_0x38bc('0x33')](handleError(_0x43cfbf,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 549f781..e64faca 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 _0x5836=['chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction'];(function(_0x5c38a2,_0x40e4e4){var _0x22869c=function(_0x4601ce){while(--_0x4601ce){_0x5c38a2['push'](_0x5c38a2['shift']());}};_0x22869c(++_0x40e4e4);}(_0x5836,0x11f));var _0x6583=function(_0x515ae8,_0x2a964f){_0x515ae8=_0x515ae8-0x0;var _0x4cf66a=_0x5836[_0x515ae8];return _0x4cf66a;};'use strict';var _=require(_0x6583('0x0'));var util=require(_0x6583('0x1'));var logger=require(_0x6583('0x2'))('api');var moment=require(_0x6583('0x3'));var BPromise=require(_0x6583('0x4'));var rp=require(_0x6583('0x5'));var fs=require('fs');var path=require(_0x6583('0x6'));var rimraf=require(_0x6583('0x7'));var config=require(_0x6583('0x8'));var attributes=require(_0x6583('0x9'));module[_0x6583('0xa')]=function(_0x59abda,_0x219964){return _0x59abda['define'](_0x6583('0xb'),attributes,{'tableName':_0x6583('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7839=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','define','chat_proactive_actions'];(function(_0x198e29,_0x3b8474){var _0x10ccb3=function(_0xef1127){while(--_0xef1127){_0x198e29['push'](_0x198e29['shift']());}};_0x10ccb3(++_0x3b8474);}(_0x7839,0x118));var _0x9783=function(_0x4f9318,_0x18bde6){_0x4f9318=_0x4f9318-0x0;var _0x2f093a=_0x7839[_0x4f9318];return _0x2f093a;};'use strict';var _=require('lodash');var util=require(_0x9783('0x0'));var logger=require(_0x9783('0x1'))(_0x9783('0x2'));var moment=require(_0x9783('0x3'));var BPromise=require('bluebird');var rp=require(_0x9783('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9783('0x5'));var config=require(_0x9783('0x6'));var attributes=require(_0x9783('0x7'));module['exports']=function(_0x5493f9,_0x1270e3){return _0x5493f9[_0x9783('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x9783('0x9'),'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 6d154dc..d5dce6f 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 _0x5ab2=['then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','request'];(function(_0x120694,_0x44dba4){var _0x56360c=function(_0x52ad2d){while(--_0x52ad2d){_0x120694['push'](_0x120694['shift']());}};_0x56360c(++_0x44dba4);}(_0x5ab2,0x89));var _0x25ab=function(_0x50934c,_0x111721){_0x50934c=_0x50934c-0x0;var _0x508297=_0x5ab2[_0x50934c];return _0x508297;};'use strict';var _=require(_0x25ab('0x0'));var util=require(_0x25ab('0x1'));var moment=require(_0x25ab('0x2'));var BPromise=require(_0x25ab('0x3'));var rs=require(_0x25ab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x25ab('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x25ab('0x6'));var jayson=require(_0x25ab('0x7'));var client=jayson[_0x25ab('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57123a,_0x2352ee,_0x174b6b){return new BPromise(function(_0x37bb98,_0x35a8a5){return client[_0x25ab('0x9')](_0x57123a,_0x174b6b)[_0x25ab('0xa')](function(_0xd8bdc2){logger[_0x25ab('0xb')](_0x25ab('0xc'),_0x2352ee,_0x25ab('0xd'));logger[_0x25ab('0xe')](_0x25ab('0xf'),_0x2352ee,_0x25ab('0xd'),JSON[_0x25ab('0x10')](_0xd8bdc2));if(_0xd8bdc2['error']){if(_0xd8bdc2[_0x25ab('0x11')][_0x25ab('0x12')]===0x1f4){logger[_0x25ab('0x11')](_0x25ab('0xc'),_0x2352ee,_0xd8bdc2[_0x25ab('0x11')]['message']);return _0x35a8a5(_0xd8bdc2[_0x25ab('0x11')][_0x25ab('0x13')]);}logger[_0x25ab('0x11')](_0x25ab('0xc'),_0x2352ee,_0xd8bdc2[_0x25ab('0x11')]['message']);return _0x37bb98(_0xd8bdc2[_0x25ab('0x11')][_0x25ab('0x13')]);}else{logger[_0x25ab('0xb')](_0x25ab('0xc'),_0x2352ee,'request\x20sent');_0x37bb98(_0xd8bdc2[_0x25ab('0x14')][_0x25ab('0x13')]);}})['catch'](function(_0xac2227){logger[_0x25ab('0x11')](_0x25ab('0xc'),_0x2352ee,_0xac2227);_0x35a8a5(_0xac2227);});});} \ No newline at end of file +var _0x21f4=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1d9956,_0x3cfad7){var _0xaa6dc=function(_0x4530eb){while(--_0x4530eb){_0x1d9956['push'](_0x1d9956['shift']());}};_0xaa6dc(++_0x3cfad7);}(_0x21f4,0x1ee));var _0x421f=function(_0x49cf5f,_0x182bd9){_0x49cf5f=_0x49cf5f-0x0;var _0x16deb8=_0x21f4[_0x49cf5f];return _0x16deb8;};'use strict';var _=require(_0x421f('0x0'));var util=require(_0x421f('0x1'));var moment=require(_0x421f('0x2'));var BPromise=require(_0x421f('0x3'));var rs=require(_0x421f('0x4'));var fs=require('fs');var Redis=require(_0x421f('0x5'));var db=require(_0x421f('0x6'))['db'];var utils=require(_0x421f('0x7'));var logger=require(_0x421f('0x8'))(_0x421f('0x9'));var config=require(_0x421f('0xa'));var jayson=require(_0x421f('0xb'));var client=jayson[_0x421f('0xc')][_0x421f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x53a84a,_0x1bbb14,_0x237cfe){return new BPromise(function(_0x5c475a,_0x5cf822){return client[_0x421f('0xe')](_0x53a84a,_0x237cfe)['then'](function(_0x417061){logger['info'](_0x421f('0xf'),_0x1bbb14,_0x421f('0x10'));logger[_0x421f('0x11')](_0x421f('0x12'),_0x1bbb14,_0x421f('0x10'),JSON['stringify'](_0x417061));if(_0x417061['error']){if(_0x417061[_0x421f('0x13')][_0x421f('0x14')]===0x1f4){logger[_0x421f('0x13')](_0x421f('0xf'),_0x1bbb14,_0x417061[_0x421f('0x13')]['message']);return _0x5cf822(_0x417061[_0x421f('0x13')][_0x421f('0x15')]);}logger['error'](_0x421f('0xf'),_0x1bbb14,_0x417061['error'][_0x421f('0x15')]);return _0x5c475a(_0x417061[_0x421f('0x13')][_0x421f('0x15')]);}else{logger[_0x421f('0x16')](_0x421f('0xf'),_0x1bbb14,'request\x20sent');_0x5c475a(_0x417061[_0x421f('0x17')]['message']);}})[_0x421f('0x18')](function(_0xd76c8d){logger['error'](_0x421f('0xf'),_0x1bbb14,_0xd76c8d);_0x5cf822(_0xd76c8d);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 1679498..44766f4 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 _0xdc97=['get','/:id','show','create','put','isAuthenticated','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x321837,_0x28f070){var _0x4a614e=function(_0xb8bfa2){while(--_0xb8bfa2){_0x321837['push'](_0x321837['shift']());}};_0x4a614e(++_0x28f070);}(_0xdc97,0x13b));var _0x7dc9=function(_0x2d6d79,_0x1d83f2){_0x2d6d79=_0x2d6d79-0x0;var _0x5a91c3=_0xdc97[_0x2d6d79];return _0x5a91c3;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var fs_extra=require(_0x7dc9('0x4'));var auth=require(_0x7dc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')](_0x7dc9('0x9'),auth['isAuthenticated'](),controller[_0x7dc9('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7dc9('0xb')]);router[_0x7dc9('0xc')](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xe')]);router['delete'](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xf')]);module[_0x7dc9('0x10')]=router; \ No newline at end of file +var _0x7dfd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x42aa91,_0x551526){var _0x5f3938=function(_0x33ff4a){while(--_0x33ff4a){_0x42aa91['push'](_0x42aa91['shift']());}};_0x5f3938(++_0x551526);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var fs_extra=require(_0xd7df('0x6'));var auth=require(_0xd7df('0x7'));var interaction=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var controller=require(_0xd7df('0xa'));router[_0xd7df('0xb')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0xe')]);router[_0xd7df('0xf')]('/',auth[_0xd7df('0xd')](),controller['create']);router[_0xd7df('0x10')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0x11')]);router['delete'](_0xd7df('0xc'),auth['isAuthenticated'](),controller[_0xd7df('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index a799715..7b39913 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 _0x94ca=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','beepall'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94ca,0x16d));var _0xa94c=function(_0x3c3b01,_0xbaa847){_0x3c3b01=_0x3c3b01-0x0;var _0xda6617=_0x94ca[_0x3c3b01];return _0xda6617;};'use strict';var Sequelize=require(_0xa94c('0x0'));module[_0xa94c('0x1')]={'name':{'type':Sequelize[_0xa94c('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa94c('0x2')]},'timeout':{'type':Sequelize[_0xa94c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa94c('0x4')]('rrmemory',_0xa94c('0x5'),_0xa94c('0x6'))}}; \ No newline at end of file +var _0x2c6b=['name','STRING','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0x27d6d4,_0x2f7449){var _0x25e6cc=function(_0x1f039b){while(--_0x1f039b){_0x27d6d4['push'](_0x27d6d4['shift']());}};_0x25e6cc(++_0x2f7449);}(_0x2c6b,0x1aa));var _0xb2c6=function(_0x227831,_0x1036ab){_0x227831=_0x227831-0x0;var _0x58dc93=_0x2c6b[_0x227831];return _0x58dc93;};'use strict';var Sequelize=require('sequelize');module[_0xb2c6('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xb2c6('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb2c6('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb2c6('0x3')](_0xb2c6('0x4'),_0xb2c6('0x5'),_0xb2c6('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 7421655..95b30bf 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 _0x5584=['tq.TeamId','from','team_has_chat_queues','join','user_has_teams','SELECT','TeamId','includes','all','union','compact','isEmpty','removeAgents','addAgents','isArray','userChatQueue:remove','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','status','end','offset','limit','count','set','Content-Range','json','update','then','destroy','get','ChatQueues','error','stack','name','send','index','map','fieldName','type','key','getOptions','where','ChatQueue','include','query','rows','show','model','intersection','attributes','fields','length','merge','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','body','params','getMembers','findOne','UserChatQueue','rawAttributes','keys','filters','hasOwnProperty','nolimit','order','pick','ChatQueueId','filter','findAndCountAll','UserId','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','sort','addTeams','findAll','User','Agents','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','field'];(function(_0x3f2720,_0x39be17){var _0xe90c23=function(_0x5bcc8a){while(--_0x5bcc8a){_0x3f2720['push'](_0x3f2720['shift']());}};_0xe90c23(++_0x39be17);}(_0x5584,0x167));var _0x4558=function(_0x28acfb,_0x4b7725){_0x28acfb=_0x28acfb-0x0;var _0x5bd89c=_0x5584[_0x28acfb];return _0x5bd89c;};'use strict';var BPromise=require('bluebird');var util=require(_0x4558('0x0'));var _=require(_0x4558('0x1'));var squel=require(_0x4558('0x2'));var Redis=require(_0x4558('0x3'));var qs=require(_0x4558('0x4'));var logger=require(_0x4558('0x5'))(_0x4558('0x6'));var config=require('../../config/environment');var db=require(_0x4558('0x7'))['db'];config[_0x4558('0x8')]=_['defaults'](config[_0x4558('0x8')],{'host':_0x4558('0x9'),'port':0x18eb});var socket=require(_0x4558('0xa'))(new Redis(config['redis']));require(_0x4558('0xb'))[_0x4558('0xc')](socket);function respondWithStatusCode(_0x20b1e9,_0x14c99f){_0x14c99f=_0x14c99f||0xcc;return function(_0x44933c){if(_0x44933c){return _0x20b1e9['sendStatus'](_0x14c99f);}return _0x20b1e9[_0x4558('0xd')](_0x14c99f)[_0x4558('0xe')]();};}function respondWithResult(_0xe02604,_0x4d841d){_0x4d841d=_0x4d841d||0xc8;return function(_0x52e0df){if(_0x52e0df){return _0xe02604[_0x4558('0xd')](_0x4d841d)['json'](_0x52e0df);}};}function respondWithFilteredResult(_0x43fcc3,_0x188278){return function(_0x599493){if(_0x599493){var _0x1e33a8=typeof _0x188278[_0x4558('0xf')]==='undefined'&&typeof _0x188278[_0x4558('0x10')]==='undefined';var _0x24040b=_0x599493[_0x4558('0x11')];var _0x40b5ca=_0x1e33a8?0x0:_0x188278[_0x4558('0xf')];var _0x4ae5f1=_0x1e33a8?_0x599493['count']:_0x188278[_0x4558('0xf')]+_0x188278[_0x4558('0x10')];var _0x5ea2aa;if(_0x4ae5f1>=_0x24040b){_0x4ae5f1=_0x24040b;_0x5ea2aa=0xc8;}else{_0x5ea2aa=0xce;}_0x43fcc3['status'](_0x5ea2aa);return _0x43fcc3[_0x4558('0x12')](_0x4558('0x13'),_0x40b5ca+'-'+_0x4ae5f1+'/'+_0x24040b)[_0x4558('0x14')](_0x599493);}return null;};}function saveUpdates(_0x5036c0){return function(_0x40dd70){if(_0x40dd70){return _0x40dd70[_0x4558('0x15')](_0x5036c0)[_0x4558('0x16')](function(_0x46fbc3){return _0x46fbc3;});}return null;};}function removeEntity(_0x4e2f4e){return function(_0x1bed08){if(_0x1bed08){return _0x1bed08[_0x4558('0x17')]()[_0x4558('0x16')](function(){var _0x145e5b=_0x1bed08[_0x4558('0x18')]({'plain':!![]});var _0x1db222=_0x4558('0x19');return db['UserProfileResource'][_0x4558('0x17')]({'where':{'type':_0x1db222,'resourceId':_0x145e5b['id']}})[_0x4558('0x16')](function(){return _0x1bed08;});})[_0x4558('0x16')](function(){_0x4e2f4e[_0x4558('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dc8ba){return function(_0x32fa2a){if(!_0x32fa2a){_0x3dc8ba['sendStatus'](0x194);}return _0x32fa2a;};}function handleError(_0x3a8256,_0x38af8b){_0x38af8b=_0x38af8b||0x1f4;return function(_0x14e632){logger[_0x4558('0x1a')](_0x14e632[_0x4558('0x1b')]);if(_0x14e632[_0x4558('0x1c')]){delete _0x14e632[_0x4558('0x1c')];}_0x3a8256[_0x4558('0xd')](_0x38af8b)[_0x4558('0x1d')](_0x14e632);};}exports[_0x4558('0x1e')]=function(_0x128e1f,_0x30a4cd){var _0x544686={};var _0x5459f9={'count':0x0,'rows':[]};var _0x217955=_[_0x4558('0x1f')](db['ChatQueue']['rawAttributes'],function(_0x3b463e){return{'name':_0x3b463e[_0x4558('0x20')],'type':_0x3b463e[_0x4558('0x21')][_0x4558('0x22')]};});_0x544686=qs[_0x4558('0x23')](_0x217955,_0x128e1f);var _0x31302f={'where':_0x544686[_0x4558('0x24')]};return db[_0x4558('0x25')]['count'](_0x31302f)[_0x4558('0x16')](function(_0x158a40){_0x5459f9['count']=_0x158a40;_0x544686[_0x4558('0x26')]=qs[_0x4558('0x26')](_0x128e1f[_0x4558('0x27')]);return db[_0x4558('0x25')]['findAll'](_0x544686);})[_0x4558('0x16')](function(_0x1db30b){_0x5459f9[_0x4558('0x28')]=_0x1db30b;return _0x5459f9;})[_0x4558('0x16')](respondWithFilteredResult(_0x30a4cd,_0x544686))['catch'](handleError(_0x30a4cd,null));};exports[_0x4558('0x29')]=function(_0x4c6447,_0x381f9c){var _0x25fcaf={'raw':!![],'where':{'id':_0x4c6447['params']['id']}},_0xdde4f7={};_0xdde4f7[_0x4558('0x2a')]=_['keys'](db[_0x4558('0x25')]['rawAttributes']);_0xdde4f7['query']=_['keys'](_0x4c6447[_0x4558('0x27')]);_0xdde4f7['filters']=_[_0x4558('0x2b')](_0xdde4f7[_0x4558('0x2a')],_0xdde4f7['query']);_0x25fcaf[_0x4558('0x2c')]=_['intersection'](_0xdde4f7['model'],qs['fields'](_0x4c6447[_0x4558('0x27')][_0x4558('0x2d')]));_0x25fcaf['attributes']=_0x25fcaf['attributes'][_0x4558('0x2e')]?_0x25fcaf['attributes']:_0xdde4f7[_0x4558('0x2a')];if(_0x4c6447[_0x4558('0x27')]['includeAll']){_0x25fcaf[_0x4558('0x26')]=[{'all':!![]}];}_0x25fcaf=_[_0x4558('0x2f')]({},_0x25fcaf,_0x4c6447[_0x4558('0x30')]);return db[_0x4558('0x25')][_0x4558('0x31')](_0x25fcaf)[_0x4558('0x16')](handleEntityNotFound(_0x381f9c,null))[_0x4558('0x16')](respondWithResult(_0x381f9c,null))[_0x4558('0x32')](handleError(_0x381f9c,null));};exports[_0x4558('0x33')]=function(_0x1c11dc,_0x4e8594){return db[_0x4558('0x25')]['create'](_0x1c11dc['body'],{})[_0x4558('0x16')](function(_0x46897c){var _0x5a8bd9=_0x1c11dc['user']['get']({'plain':!![]});if(!_0x5a8bd9)throw new Error(_0x4558('0x34'));if(_0x5a8bd9[_0x4558('0x35')]==='user'){var _0x48fdf4=_0x46897c['get']({'plain':!![]});var _0x869fb1=_0x4558('0x19');return db[_0x4558('0x36')][_0x4558('0x31')]({'where':{'name':_0x869fb1,'userProfileId':_0x5a8bd9['userProfileId']},'raw':!![]})[_0x4558('0x16')](function(_0x13277d){if(_0x13277d&&_0x13277d[_0x4558('0x37')]===0x0){return db['UserProfileResource'][_0x4558('0x33')]({'name':_0x48fdf4[_0x4558('0x1c')],'resourceId':_0x48fdf4['id'],'type':_0x13277d[_0x4558('0x1c')],'sectionId':_0x13277d['id']},{})[_0x4558('0x16')](function(){return _0x46897c;});}else{return _0x46897c;}})['catch'](function(_0xf5f454){logger[_0x4558('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf5f454);throw _0xf5f454;});}return _0x46897c;})[_0x4558('0x16')](respondWithResult(_0x4e8594,0xc9))[_0x4558('0x32')](handleError(_0x4e8594,null));};exports[_0x4558('0x15')]=function(_0x23cfe1,_0x4b0970){if(_0x23cfe1['body']['id']){delete _0x23cfe1[_0x4558('0x38')]['id'];}return db[_0x4558('0x25')]['find']({'where':{'id':_0x23cfe1[_0x4558('0x39')]['id']}})['then'](handleEntityNotFound(_0x4b0970,null))[_0x4558('0x16')](saveUpdates(_0x23cfe1[_0x4558('0x38')],null))[_0x4558('0x16')](respondWithResult(_0x4b0970,null))[_0x4558('0x32')](handleError(_0x4b0970,null));};exports[_0x4558('0x17')]=function(_0x55edfa,_0x44bfcf){return db['ChatQueue']['find']({'where':{'id':_0x55edfa[_0x4558('0x39')]['id']}})[_0x4558('0x16')](handleEntityNotFound(_0x44bfcf,null))[_0x4558('0x16')](removeEntity(_0x44bfcf,null))[_0x4558('0x32')](handleError(_0x44bfcf,null));};exports['describe']=function(_0x5a3f42,_0x497307){return db['ChatQueue']['describe']()[_0x4558('0x16')](respondWithResult(_0x497307,null))[_0x4558('0x32')](handleError(_0x497307,null));};exports[_0x4558('0x3a')]=function(_0x2b4ee4,_0x3aab3c){var _0x59711f={'raw':!![],'where':{}},_0xc39fd0={},_0x27a3dd;return db['ChatQueue'][_0x4558('0x3b')]({'where':{'id':_0x2b4ee4['params']['id']}})['then'](handleEntityNotFound(_0x3aab3c,null))['then'](function(_0x2224d1){if(_0x2224d1){_0x27a3dd=_0x2224d1[_0x4558('0x18')]({'plain':!![]});_0xc39fd0[_0x4558('0x2a')]=_['keys'](db[_0x4558('0x3c')][_0x4558('0x3d')]);_0xc39fd0[_0x4558('0x27')]=_[_0x4558('0x3e')](_0x2b4ee4['query']);_0xc39fd0[_0x4558('0x3f')]=_[_0x4558('0x2b')](_0xc39fd0[_0x4558('0x2a')],_0xc39fd0['query']);_0x59711f[_0x4558('0x2c')]=_['intersection'](_0xc39fd0['model'],qs['fields'](_0x2b4ee4['query'][_0x4558('0x2d')]));_0x59711f[_0x4558('0x2c')]=_0x59711f[_0x4558('0x2c')][_0x4558('0x2e')]?_0x59711f['attributes']:_0xc39fd0['model'];if(!_0x2b4ee4[_0x4558('0x27')][_0x4558('0x40')](_0x4558('0x41'))){_0x59711f[_0x4558('0x10')]=qs[_0x4558('0x10')](_0x2b4ee4[_0x4558('0x27')][_0x4558('0x10')]);_0x59711f[_0x4558('0xf')]=qs[_0x4558('0xf')](_0x2b4ee4[_0x4558('0x27')][_0x4558('0xf')]);}_0x59711f[_0x4558('0x42')]=qs['sort'](_0x2b4ee4[_0x4558('0x27')]['sort']);_0x59711f['where']=qs[_0x4558('0x3f')](_[_0x4558('0x43')](_0x2b4ee4[_0x4558('0x27')],_0xc39fd0[_0x4558('0x3f')]));_0x59711f[_0x4558('0x24')][_0x4558('0x44')]=_0x2224d1['id'];if(_0x2b4ee4[_0x4558('0x27')][_0x4558('0x45')]){_0x59711f[_0x4558('0x24')]=_[_0x4558('0x2f')](_0x59711f['where'],{'$or':_[_0x4558('0x1f')](_0x59711f['attributes'],function(_0x3f09f4){var _0x3b2a58={};_0x3b2a58[_0x3f09f4]={'$like':'%'+_0x2b4ee4[_0x4558('0x27')][_0x4558('0x45')]+'%'};return _0x3b2a58;})});}_0x59711f=_[_0x4558('0x2f')]({},_0x59711f,_0x2b4ee4[_0x4558('0x30')]);return db['UserChatQueue']['findAll'](_0x59711f);}})[_0x4558('0x16')](function(_0x4e30a4){if(_0x4e30a4){return db['User'][_0x4558('0x46')]({'where':{'id':_[_0x4558('0x1f')](_0x4e30a4,_0x4558('0x47')),'role':'agent'},'attributes':['id',_0x4558('0x1c'),_0x4558('0x48'),_0x4558('0x49'),_0x4558('0x4a')]});}})[_0x4558('0x16')](function(_0x130069){if(_0x130069){return{'count':_0x130069['count'],'rows':_[_0x4558('0x1f')](_0x130069[_0x4558('0x28')],function(_0x328af2){return{'membername':_0x328af2['name'],'UserId':_0x328af2['id'],'queue_name':_0x27a3dd[_0x4558('0x1c')],'ChatQueueId':_0x27a3dd['id'],'interface':util[_0x4558('0x4b')](_0x4558('0x4c'),_0x4558('0x4d'),_0x328af2[_0x4558('0x1c')]),'penalty':0x0,'paused':_0x328af2[_0x4558('0x48')],'createdAt':_0x328af2[_0x4558('0x4a')],'updatedAt':_0x328af2[_0x4558('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4558('0x16')](respondWithFilteredResult(_0x3aab3c,_0x59711f))[_0x4558('0x32')](handleError(_0x3aab3c,null));};exports[_0x4558('0x4e')]=function(_0x1eee6a,_0x311c10){var _0x524699={};var _0x541b08={};var _0x3f684f;var _0x1743f2;return db[_0x4558('0x25')][_0x4558('0x3b')]({'where':{'id':_0x1eee6a['params']['id']}})[_0x4558('0x16')](handleEntityNotFound(_0x311c10,null))[_0x4558('0x16')](function(_0x3acfcc){if(_0x3acfcc){_0x3f684f=_0x3acfcc;_0x541b08[_0x4558('0x2a')]=_[_0x4558('0x3e')](db[_0x4558('0x4f')]['rawAttributes']);_0x541b08[_0x4558('0x27')]=_[_0x4558('0x3e')](_0x1eee6a[_0x4558('0x27')]);_0x541b08[_0x4558('0x3f')]=_[_0x4558('0x2b')](_0x541b08[_0x4558('0x2a')],_0x541b08[_0x4558('0x27')]);_0x524699[_0x4558('0x2c')]=_[_0x4558('0x2b')](_0x541b08[_0x4558('0x2a')],qs[_0x4558('0x2d')](_0x1eee6a[_0x4558('0x27')][_0x4558('0x2d')]));_0x524699[_0x4558('0x2c')]=_0x524699[_0x4558('0x2c')]['length']?_0x524699['attributes']:_0x541b08['model'];_0x524699['order']=qs[_0x4558('0x50')](_0x1eee6a['query']['sort']);_0x524699[_0x4558('0x24')]=qs[_0x4558('0x3f')](_[_0x4558('0x43')](_0x1eee6a[_0x4558('0x27')],_0x541b08[_0x4558('0x3f')]));if(_0x1eee6a[_0x4558('0x27')][_0x4558('0x45')]){_0x524699[_0x4558('0x24')]=_['merge'](_0x524699['where'],{'$or':_[_0x4558('0x1f')](_0x524699[_0x4558('0x2c')],function(_0x12dfb7){var _0x45f7f4={};_0x45f7f4[_0x12dfb7]={'$like':'%'+_0x1eee6a[_0x4558('0x27')][_0x4558('0x45')]+'%'};return _0x45f7f4;})});}_0x524699=_[_0x4558('0x2f')]({},_0x524699,_0x1eee6a[_0x4558('0x30')]);return _0x3f684f[_0x4558('0x4e')](_0x524699);}})[_0x4558('0x16')](function(_0x57ada8){if(_0x57ada8){_0x1743f2=_0x57ada8[_0x4558('0x2e')];if(!_0x1eee6a[_0x4558('0x27')][_0x4558('0x40')](_0x4558('0x41'))){_0x524699[_0x4558('0x10')]=qs[_0x4558('0x10')](_0x1eee6a[_0x4558('0x27')][_0x4558('0x10')]);_0x524699[_0x4558('0xf')]=qs['offset'](_0x1eee6a['query']['offset']);}return _0x3f684f[_0x4558('0x4e')](_0x524699);}})[_0x4558('0x16')](function(_0x120624){if(_0x120624){return _0x120624?{'count':_0x1743f2,'rows':_0x120624}:null;}})[_0x4558('0x16')](respondWithResult(_0x311c10,null))[_0x4558('0x32')](handleError(_0x311c10,null));};exports[_0x4558('0x51')]=function(_0x483651,_0x1b0081){var _0x23251c=_0x483651[_0x4558('0x38')]['ids'];return db['Team'][_0x4558('0x52')]({'where':{'id':_0x23251c},'attributes':['id'],'include':[{'model':db[_0x4558('0x53')],'as':_0x4558('0x54'),'attributes':['id',_0x4558('0x1c'),'online',_0x4558('0x55'),'interface'],'raw':!![]}]})[_0x4558('0x16')](function(_0x1c7a73){if(_0x1c7a73){var _0xf0122=_[_0x4558('0x56')](_0x1c7a73,function(_0x25321b){var _0x4cb8ea=_0x25321b[_0x4558('0x18')]({'plain':!![]});return _0x4cb8ea[_0x4558('0x54')];});return db['ChatQueue']['find']({'where':{'id':_0x483651[_0x4558('0x39')]['id']}})[_0x4558('0x16')](function(_0x1a866a){return db[_0x4558('0x57')][_0x4558('0x58')](function(_0x50d2bd){return _0x1a866a['addTeams'](_0x23251c,{'transaction':_0x50d2bd})['then'](function(){return BPromise[_0x4558('0x59')](_0xf0122,function(_0x54ad08){return db[_0x4558('0x3c')][_0x4558('0x5a')]({'where':{'UserId':_0x54ad08['id'],'ChatQueueId':_0x483651[_0x4558('0x39')]['id']},'transaction':_0x50d2bd});});})[_0x4558('0x16')](function(){_0xf0122[_0x4558('0x5b')](function(_0x4a92f4){socket[_0x4558('0x5c')](_0x4558('0x5d'),{'UserId':_0x4a92f4['id'],'ChatQueueId':_0x1a866a['id']});});});});});}})['then'](respondWithStatusCode(_0x1b0081,null))['catch'](handleError(_0x1b0081,null));};exports[_0x4558('0x5e')]=function(_0x365c10,_0x1433d4){return db['Team']['findAll']({'where':{'id':_0x365c10[_0x4558('0x27')][_0x4558('0x5f')]},'attributes':['id'],'include':[{'model':db[_0x4558('0x53')],'as':_0x4558('0x54'),'attributes':['id'],'raw':!![]}]})[_0x4558('0x16')](handleEntityNotFound(_0x1433d4,null))[_0x4558('0x16')](function(_0x910abc){var _0x5d4e30=_[_0x4558('0x1f')](_0x910abc,'id');var _0x13dc70=[];var _0x2b6c4f=[];var _0x45460c=squel['select']();_0x45460c[_0x4558('0x60')](_0x4558('0x61'))[_0x4558('0x62')](_0x4558('0x63'),'tq')[_0x4558('0x64')](_0x4558('0x65'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x4558('0x24')]('ChatQueueId\x20=\x20?',_0x365c10[_0x4558('0x39')]['id']);for(var _0x46fd0a=0x0;_0x46fd0a<_0x910abc[_0x4558('0x2e')];_0x46fd0a+=0x1){let _0x217a3a=_0x910abc[_0x46fd0a];for(var _0x59f274=0x0;_0x59f274<_0x217a3a[_0x4558('0x54')][_0x4558('0x2e')];_0x59f274+=0x1){let _0x157d01=_0x217a3a['Agents'][_0x59f274];var _0x105aea=_0x45460c['clone']();_0x105aea[_0x4558('0x24')]('ut.UserId\x20=\x20?',_0x157d01['id']);_0x2b6c4f['push'](db[_0x4558('0x57')][_0x4558('0x27')](_0x105aea['toString'](),{'type':db[_0x4558('0x57')]['QueryTypes'][_0x4558('0x66')]})[_0x4558('0x16')](function(_0x21d2b8){if(_0x21d2b8['length']===0x1){return _0x157d01['id'];}else{var _0x1264e5=_['every'](_[_0x4558('0x1f')](_0x21d2b8,_0x4558('0x67')),function(_0x573bb4){return _[_0x4558('0x68')](_0x5d4e30,_0x573bb4);});if(_0x1264e5){return _0x157d01['id'];}}}));}}return BPromise[_0x4558('0x69')](_0x2b6c4f)[_0x4558('0x16')](function(_0x86c145){_0x13dc70=_(_0x13dc70)[_0x4558('0x6a')](_0x86c145)[_0x4558('0x6b')]()['value']();return db[_0x4558('0x25')][_0x4558('0x31')]({'where':{'id':_0x365c10[_0x4558('0x39')]['id']}})[_0x4558('0x16')](function(_0x70d459){return db['sequelize']['transaction'](function(_0x3da657){return _0x70d459['removeTeams'](_0x365c10[_0x4558('0x27')][_0x4558('0x5f')],{'transaction':_0x3da657})['then'](function(){if(!_[_0x4558('0x6c')](_0x13dc70)){return _0x70d459[_0x4558('0x6d')](_0x13dc70,{'transaction':_0x3da657});}})['then'](function(){_0x13dc70[_0x4558('0x5b')](function(_0xc5ca8a){socket['emit']('userChatQueue:remove',{'UserId':_0xc5ca8a,'ChatQueueId':_0x70d459['id']});});});});});});})['then'](respondWithStatusCode(_0x1433d4,null))[_0x4558('0x32')](handleError(_0x1433d4,null));};exports[_0x4558('0x6e')]=function(_0x3aec48,_0x55c7dd){return db[_0x4558('0x25')]['find']({'where':{'id':_0x3aec48[_0x4558('0x39')]['id']}})[_0x4558('0x16')](handleEntityNotFound(_0x55c7dd,null))[_0x4558('0x16')](function(_0x4402e4){if(_0x4402e4){return _0x4402e4[_0x4558('0x6e')](_0x3aec48[_0x4558('0x38')]['ids'],_['omit'](_0x3aec48[_0x4558('0x38')],[_0x4558('0x5f'),'id'])||{})['spread'](function(_0x3c0370){for(var _0x108d77=0x0;_0x108d77<_0x3aec48[_0x4558('0x38')]['ids'][_0x4558('0x2e')];_0x108d77+=0x1){socket['emit'](_0x4558('0x5d'),{'UserId':Number(_0x3aec48[_0x4558('0x38')][_0x4558('0x5f')][_0x108d77]),'ChatQueueId':Number(_0x3aec48[_0x4558('0x39')]['id'])});}return _0x3c0370;});}})['then'](respondWithResult(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x4558('0x6d')]=function(_0x59cb38,_0x1851ee){return db['ChatQueue'][_0x4558('0x31')]({'where':{'id':_0x59cb38['params']['id']}})['then'](handleEntityNotFound(_0x1851ee,null))[_0x4558('0x16')](function(_0x4a474b){if(_0x4a474b){return _0x4a474b[_0x4558('0x6d')](_0x59cb38[_0x4558('0x27')]['ids'])[_0x4558('0x16')](function(){if(_[_0x4558('0x6f')](_0x59cb38['query']['ids'])){for(var _0x5d2e54=0x0;_0x5d2e54<_0x59cb38['query'][_0x4558('0x5f')][_0x4558('0x2e')];_0x5d2e54+=0x1){socket[_0x4558('0x5c')](_0x4558('0x70'),{'UserId':Number(_0x59cb38['query']['ids'][_0x5d2e54]),'ChatQueueId':Number(_0x59cb38[_0x4558('0x39')]['id'])});}}else{socket['emit'](_0x4558('0x70'),{'UserId':Number(_0x59cb38[_0x4558('0x27')][_0x4558('0x5f')]),'ChatQueueId':Number(_0x59cb38[_0x4558('0x39')]['id'])});}});}})[_0x4558('0x16')](respondWithStatusCode(_0x1851ee,null))['catch'](handleError(_0x1851ee,null));};exports[_0x4558('0x71')]=function(_0xffeca,_0x52420f){var _0xa9f42a={};var _0x316595={};var _0x5545a3;var _0x34d2cc;return db['ChatQueue'][_0x4558('0x3b')]({'where':{'id':_0xffeca[_0x4558('0x39')]['id']}})[_0x4558('0x16')](handleEntityNotFound(_0x52420f,null))[_0x4558('0x16')](function(_0x19f6b0){if(_0x19f6b0){_0x5545a3=_0x19f6b0;_0x316595[_0x4558('0x2a')]=_[_0x4558('0x3e')](db[_0x4558('0x53')][_0x4558('0x3d')]);_0x316595[_0x4558('0x27')]=_[_0x4558('0x3e')](_0xffeca['query']);_0x316595[_0x4558('0x3f')]=_[_0x4558('0x2b')](_0x316595[_0x4558('0x2a')],_0x316595[_0x4558('0x27')]);_0xa9f42a[_0x4558('0x2c')]=_['intersection'](_0x316595[_0x4558('0x2a')],qs['fields'](_0xffeca[_0x4558('0x27')]['fields']));_0xa9f42a[_0x4558('0x2c')]=_0xa9f42a[_0x4558('0x2c')][_0x4558('0x2e')]?_0xa9f42a['attributes']:_0x316595['model'];_0xa9f42a[_0x4558('0x42')]=qs[_0x4558('0x50')](_0xffeca[_0x4558('0x27')][_0x4558('0x50')]);_0xa9f42a[_0x4558('0x24')]=qs[_0x4558('0x3f')](_[_0x4558('0x43')](_0xffeca[_0x4558('0x27')],_0x316595['filters']));if(_0xffeca[_0x4558('0x27')][_0x4558('0x45')]){_0xa9f42a[_0x4558('0x24')]=_['merge'](_0xa9f42a['where'],{'$or':_[_0x4558('0x1f')](_0xa9f42a[_0x4558('0x2c')],function(_0x2f38cc){var _0x21dddd={};_0x21dddd[_0x2f38cc]={'$like':'%'+_0xffeca[_0x4558('0x27')][_0x4558('0x45')]+'%'};return _0x21dddd;})});}_0xa9f42a=_[_0x4558('0x2f')]({},_0xa9f42a,_0xffeca[_0x4558('0x30')]);return _0x5545a3[_0x4558('0x71')](_0xa9f42a);}})[_0x4558('0x16')](function(_0x456341){if(_0x456341){_0x34d2cc=_0x456341[_0x4558('0x2e')];if(!_0xffeca['query'][_0x4558('0x40')](_0x4558('0x41'))){_0xa9f42a[_0x4558('0x10')]=qs[_0x4558('0x10')](_0xffeca[_0x4558('0x27')]['limit']);_0xa9f42a[_0x4558('0xf')]=qs[_0x4558('0xf')](_0xffeca[_0x4558('0x27')][_0x4558('0xf')]);}return _0x5545a3['getAgents'](_0xa9f42a);}})['then'](function(_0x1eaea9){if(_0x1eaea9){return _0x1eaea9?{'count':_0x34d2cc,'rows':_0x1eaea9}:null;}})[_0x4558('0x16')](respondWithResult(_0x52420f,null))['catch'](handleError(_0x52420f,null));}; \ No newline at end of file +var _0x9a67=['filters','attributes','intersection','fields','length','merge','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','order','sort','where','pick','ChatQueueId','filter','User','findAndCountAll','UserId','agent','chatPause','rows','format','%s/%s','createdAt','updatedAt','getTeams','Team','nolimit','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','emit','userChatQueue:save','ids','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','forEach','addAgents','spread','isArray','userChatQueue:remove','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','UserProfileResource','sendStatus','error','name','send','index','map','ChatQueue','rawAttributes','type','key','getOptions','include','findAll','catch','params','model','keys','query'];(function(_0x3145e0,_0x3263d8){var _0x40692f=function(_0x8d437){while(--_0x8d437){_0x3145e0['push'](_0x3145e0['shift']());}};_0x40692f(++_0x3263d8);}(_0x9a67,0x1c0));var _0x79a6=function(_0x3fafb9,_0x5d6612){_0x3fafb9=_0x3fafb9-0x0;var _0xada4d4=_0x9a67[_0x3fafb9];return _0xada4d4;};'use strict';var BPromise=require(_0x79a6('0x0'));var util=require(_0x79a6('0x1'));var _=require('lodash');var squel=require(_0x79a6('0x2'));var Redis=require(_0x79a6('0x3'));var qs=require(_0x79a6('0x4'));var logger=require(_0x79a6('0x5'))('api');var config=require(_0x79a6('0x6'));var db=require(_0x79a6('0x7'))['db'];config[_0x79a6('0x8')]=_[_0x79a6('0x9')](config[_0x79a6('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x79a6('0xa'))(new Redis(config[_0x79a6('0x8')]));require(_0x79a6('0xb'))[_0x79a6('0xc')](socket);function respondWithStatusCode(_0x200811,_0x47588b){_0x47588b=_0x47588b||0xcc;return function(_0x1f7b46){if(_0x1f7b46){return _0x200811['sendStatus'](_0x47588b);}return _0x200811[_0x79a6('0xd')](_0x47588b)[_0x79a6('0xe')]();};}function respondWithResult(_0x4d40ed,_0x2aa1c6){_0x2aa1c6=_0x2aa1c6||0xc8;return function(_0x2264a0){if(_0x2264a0){return _0x4d40ed[_0x79a6('0xd')](_0x2aa1c6)[_0x79a6('0xf')](_0x2264a0);}};}function respondWithFilteredResult(_0x556fd6,_0x34cdf5){return function(_0x215a9c){if(_0x215a9c){var _0x3e91a1=typeof _0x34cdf5['offset']===_0x79a6('0x10')&&typeof _0x34cdf5[_0x79a6('0x11')]===_0x79a6('0x10');var _0x2ec810=_0x215a9c['count'];var _0x37fc6b=_0x3e91a1?0x0:_0x34cdf5['offset'];var _0x2575eb=_0x3e91a1?_0x215a9c[_0x79a6('0x12')]:_0x34cdf5[_0x79a6('0x13')]+_0x34cdf5[_0x79a6('0x11')];var _0xd0e8cc;if(_0x2575eb>=_0x2ec810){_0x2575eb=_0x2ec810;_0xd0e8cc=0xc8;}else{_0xd0e8cc=0xce;}_0x556fd6[_0x79a6('0xd')](_0xd0e8cc);return _0x556fd6[_0x79a6('0x14')](_0x79a6('0x15'),_0x37fc6b+'-'+_0x2575eb+'/'+_0x2ec810)[_0x79a6('0xf')](_0x215a9c);}return null;};}function saveUpdates(_0x473013){return function(_0x5384da){if(_0x5384da){return _0x5384da[_0x79a6('0x16')](_0x473013)[_0x79a6('0x17')](function(_0x27688c){return _0x27688c;});}return null;};}function removeEntity(_0x3ca1e6){return function(_0x998388){if(_0x998388){return _0x998388[_0x79a6('0x18')]()[_0x79a6('0x17')](function(){var _0xca4e5=_0x998388['get']({'plain':!![]});var _0x348d57='ChatQueues';return db[_0x79a6('0x19')][_0x79a6('0x18')]({'where':{'type':_0x348d57,'resourceId':_0xca4e5['id']}})[_0x79a6('0x17')](function(){return _0x998388;});})['then'](function(){_0x3ca1e6[_0x79a6('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x319f0c){return function(_0x24942e){if(!_0x24942e){_0x319f0c[_0x79a6('0x1a')](0x194);}return _0x24942e;};}function handleError(_0x40e424,_0x126198){_0x126198=_0x126198||0x1f4;return function(_0x104f94){logger[_0x79a6('0x1b')](_0x104f94['stack']);if(_0x104f94[_0x79a6('0x1c')]){delete _0x104f94[_0x79a6('0x1c')];}_0x40e424[_0x79a6('0xd')](_0x126198)[_0x79a6('0x1d')](_0x104f94);};}exports[_0x79a6('0x1e')]=function(_0x2352fe,_0x4051ca){var _0x424a40={};var _0x31e3d7={'count':0x0,'rows':[]};var _0x3e1573=_[_0x79a6('0x1f')](db[_0x79a6('0x20')][_0x79a6('0x21')],function(_0x80ffc9){return{'name':_0x80ffc9['fieldName'],'type':_0x80ffc9[_0x79a6('0x22')][_0x79a6('0x23')]};});_0x424a40=qs[_0x79a6('0x24')](_0x3e1573,_0x2352fe);var _0x55e715={'where':_0x424a40['where']};return db[_0x79a6('0x20')][_0x79a6('0x12')](_0x55e715)[_0x79a6('0x17')](function(_0x160db5){_0x31e3d7[_0x79a6('0x12')]=_0x160db5;_0x424a40[_0x79a6('0x25')]=qs[_0x79a6('0x25')](_0x2352fe['query']);return db[_0x79a6('0x20')][_0x79a6('0x26')](_0x424a40);})[_0x79a6('0x17')](function(_0x2672d8){_0x31e3d7['rows']=_0x2672d8;return _0x31e3d7;})[_0x79a6('0x17')](respondWithFilteredResult(_0x4051ca,_0x424a40))[_0x79a6('0x27')](handleError(_0x4051ca,null));};exports['show']=function(_0x3e0572,_0x7c753){var _0x309119={'raw':!![],'where':{'id':_0x3e0572[_0x79a6('0x28')]['id']}},_0x44330e={};_0x44330e[_0x79a6('0x29')]=_[_0x79a6('0x2a')](db[_0x79a6('0x20')][_0x79a6('0x21')]);_0x44330e[_0x79a6('0x2b')]=_[_0x79a6('0x2a')](_0x3e0572['query']);_0x44330e[_0x79a6('0x2c')]=_['intersection'](_0x44330e[_0x79a6('0x29')],_0x44330e[_0x79a6('0x2b')]);_0x309119[_0x79a6('0x2d')]=_[_0x79a6('0x2e')](_0x44330e[_0x79a6('0x29')],qs['fields'](_0x3e0572[_0x79a6('0x2b')][_0x79a6('0x2f')]));_0x309119[_0x79a6('0x2d')]=_0x309119[_0x79a6('0x2d')][_0x79a6('0x30')]?_0x309119[_0x79a6('0x2d')]:_0x44330e[_0x79a6('0x29')];if(_0x3e0572[_0x79a6('0x2b')]['includeAll']){_0x309119[_0x79a6('0x25')]=[{'all':!![]}];}_0x309119=_[_0x79a6('0x31')]({},_0x309119,_0x3e0572[_0x79a6('0x32')]);return db['ChatQueue'][_0x79a6('0x33')](_0x309119)[_0x79a6('0x17')](handleEntityNotFound(_0x7c753,null))[_0x79a6('0x17')](respondWithResult(_0x7c753,null))[_0x79a6('0x27')](handleError(_0x7c753,null));};exports[_0x79a6('0x34')]=function(_0x2ef734,_0x8acca2){return db['ChatQueue'][_0x79a6('0x34')](_0x2ef734[_0x79a6('0x35')],{})[_0x79a6('0x17')](function(_0x18e7e5){var _0x2e237a=_0x2ef734['user'][_0x79a6('0x36')]({'plain':!![]});if(!_0x2e237a)throw new Error(_0x79a6('0x37'));if(_0x2e237a['role']==='user'){var _0x1351be=_0x18e7e5[_0x79a6('0x36')]({'plain':!![]});var _0x32981b=_0x79a6('0x38');return db['UserProfileSection'][_0x79a6('0x33')]({'where':{'name':_0x32981b,'userProfileId':_0x2e237a[_0x79a6('0x39')]},'raw':!![]})[_0x79a6('0x17')](function(_0xacc5ea){if(_0xacc5ea&&_0xacc5ea[_0x79a6('0x3a')]===0x0){return db['UserProfileResource'][_0x79a6('0x34')]({'name':_0x1351be['name'],'resourceId':_0x1351be['id'],'type':_0xacc5ea[_0x79a6('0x1c')],'sectionId':_0xacc5ea['id']},{})[_0x79a6('0x17')](function(){return _0x18e7e5;});}else{return _0x18e7e5;}})['catch'](function(_0x1c97d8){logger[_0x79a6('0x1b')](_0x79a6('0x3b'),_0x1c97d8);throw _0x1c97d8;});}return _0x18e7e5;})[_0x79a6('0x17')](respondWithResult(_0x8acca2,0xc9))['catch'](handleError(_0x8acca2,null));};exports[_0x79a6('0x16')]=function(_0x21f025,_0x5464ac){if(_0x21f025['body']['id']){delete _0x21f025[_0x79a6('0x35')]['id'];}return db[_0x79a6('0x20')][_0x79a6('0x33')]({'where':{'id':_0x21f025[_0x79a6('0x28')]['id']}})[_0x79a6('0x17')](handleEntityNotFound(_0x5464ac,null))[_0x79a6('0x17')](saveUpdates(_0x21f025[_0x79a6('0x35')],null))[_0x79a6('0x17')](respondWithResult(_0x5464ac,null))[_0x79a6('0x27')](handleError(_0x5464ac,null));};exports['destroy']=function(_0x52803d,_0x4e7792){return db[_0x79a6('0x20')][_0x79a6('0x33')]({'where':{'id':_0x52803d[_0x79a6('0x28')]['id']}})['then'](handleEntityNotFound(_0x4e7792,null))['then'](removeEntity(_0x4e7792,null))[_0x79a6('0x27')](handleError(_0x4e7792,null));};exports[_0x79a6('0x3c')]=function(_0x42fdf3,_0x3a5b13){return db['ChatQueue'][_0x79a6('0x3c')]()['then'](respondWithResult(_0x3a5b13,null))['catch'](handleError(_0x3a5b13,null));};exports[_0x79a6('0x3d')]=function(_0x437e9f,_0x1240c9){var _0x54ac6e={'raw':!![],'where':{}},_0x572fb1={},_0x18aada;return db[_0x79a6('0x20')][_0x79a6('0x3e')]({'where':{'id':_0x437e9f[_0x79a6('0x28')]['id']}})[_0x79a6('0x17')](handleEntityNotFound(_0x1240c9,null))[_0x79a6('0x17')](function(_0x1424a4){if(_0x1424a4){_0x18aada=_0x1424a4[_0x79a6('0x36')]({'plain':!![]});_0x572fb1[_0x79a6('0x29')]=_[_0x79a6('0x2a')](db[_0x79a6('0x3f')][_0x79a6('0x21')]);_0x572fb1[_0x79a6('0x2b')]=_['keys'](_0x437e9f[_0x79a6('0x2b')]);_0x572fb1[_0x79a6('0x2c')]=_[_0x79a6('0x2e')](_0x572fb1[_0x79a6('0x29')],_0x572fb1['query']);_0x54ac6e[_0x79a6('0x2d')]=_['intersection'](_0x572fb1[_0x79a6('0x29')],qs[_0x79a6('0x2f')](_0x437e9f['query'][_0x79a6('0x2f')]));_0x54ac6e[_0x79a6('0x2d')]=_0x54ac6e[_0x79a6('0x2d')][_0x79a6('0x30')]?_0x54ac6e[_0x79a6('0x2d')]:_0x572fb1['model'];if(!_0x437e9f['query'][_0x79a6('0x40')]('nolimit')){_0x54ac6e[_0x79a6('0x11')]=qs[_0x79a6('0x11')](_0x437e9f[_0x79a6('0x2b')][_0x79a6('0x11')]);_0x54ac6e[_0x79a6('0x13')]=qs[_0x79a6('0x13')](_0x437e9f[_0x79a6('0x2b')][_0x79a6('0x13')]);}_0x54ac6e[_0x79a6('0x41')]=qs[_0x79a6('0x42')](_0x437e9f[_0x79a6('0x2b')][_0x79a6('0x42')]);_0x54ac6e[_0x79a6('0x43')]=qs[_0x79a6('0x2c')](_[_0x79a6('0x44')](_0x437e9f[_0x79a6('0x2b')],_0x572fb1[_0x79a6('0x2c')]));_0x54ac6e[_0x79a6('0x43')][_0x79a6('0x45')]=_0x1424a4['id'];if(_0x437e9f[_0x79a6('0x2b')][_0x79a6('0x46')]){_0x54ac6e[_0x79a6('0x43')]=_[_0x79a6('0x31')](_0x54ac6e[_0x79a6('0x43')],{'$or':_[_0x79a6('0x1f')](_0x54ac6e['attributes'],function(_0x5be4f7){var _0x41dea5={};_0x41dea5[_0x5be4f7]={'$like':'%'+_0x437e9f['query']['filter']+'%'};return _0x41dea5;})});}_0x54ac6e=_[_0x79a6('0x31')]({},_0x54ac6e,_0x437e9f['options']);return db[_0x79a6('0x3f')][_0x79a6('0x26')](_0x54ac6e);}})[_0x79a6('0x17')](function(_0x309513){if(_0x309513){return db[_0x79a6('0x47')][_0x79a6('0x48')]({'where':{'id':_[_0x79a6('0x1f')](_0x309513,_0x79a6('0x49')),'role':_0x79a6('0x4a')},'attributes':['id','name',_0x79a6('0x4b'),'updatedAt','createdAt']});}})[_0x79a6('0x17')](function(_0x8ee49f){if(_0x8ee49f){return{'count':_0x8ee49f[_0x79a6('0x12')],'rows':_['map'](_0x8ee49f[_0x79a6('0x4c')],function(_0xee1bca){return{'membername':_0xee1bca[_0x79a6('0x1c')],'UserId':_0xee1bca['id'],'queue_name':_0x18aada[_0x79a6('0x1c')],'ChatQueueId':_0x18aada['id'],'interface':util[_0x79a6('0x4d')](_0x79a6('0x4e'),'SIP',_0xee1bca[_0x79a6('0x1c')]),'penalty':0x0,'paused':_0xee1bca[_0x79a6('0x4b')],'createdAt':_0xee1bca[_0x79a6('0x4f')],'updatedAt':_0xee1bca[_0x79a6('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x79a6('0x17')](respondWithFilteredResult(_0x1240c9,_0x54ac6e))[_0x79a6('0x27')](handleError(_0x1240c9,null));};exports[_0x79a6('0x51')]=function(_0x25155a,_0x324ee2){var _0x16855e={};var _0x347080={};var _0x557246;var _0xdb1e65;return db['ChatQueue'][_0x79a6('0x3e')]({'where':{'id':_0x25155a[_0x79a6('0x28')]['id']}})['then'](handleEntityNotFound(_0x324ee2,null))[_0x79a6('0x17')](function(_0x1fffc0){if(_0x1fffc0){_0x557246=_0x1fffc0;_0x347080[_0x79a6('0x29')]=_[_0x79a6('0x2a')](db[_0x79a6('0x52')][_0x79a6('0x21')]);_0x347080[_0x79a6('0x2b')]=_[_0x79a6('0x2a')](_0x25155a[_0x79a6('0x2b')]);_0x347080[_0x79a6('0x2c')]=_[_0x79a6('0x2e')](_0x347080['model'],_0x347080[_0x79a6('0x2b')]);_0x16855e[_0x79a6('0x2d')]=_['intersection'](_0x347080[_0x79a6('0x29')],qs['fields'](_0x25155a[_0x79a6('0x2b')][_0x79a6('0x2f')]));_0x16855e['attributes']=_0x16855e[_0x79a6('0x2d')]['length']?_0x16855e[_0x79a6('0x2d')]:_0x347080[_0x79a6('0x29')];_0x16855e['order']=qs[_0x79a6('0x42')](_0x25155a[_0x79a6('0x2b')][_0x79a6('0x42')]);_0x16855e[_0x79a6('0x43')]=qs[_0x79a6('0x2c')](_[_0x79a6('0x44')](_0x25155a[_0x79a6('0x2b')],_0x347080[_0x79a6('0x2c')]));if(_0x25155a[_0x79a6('0x2b')][_0x79a6('0x46')]){_0x16855e[_0x79a6('0x43')]=_[_0x79a6('0x31')](_0x16855e[_0x79a6('0x43')],{'$or':_[_0x79a6('0x1f')](_0x16855e[_0x79a6('0x2d')],function(_0x3b8202){var _0x35136a={};_0x35136a[_0x3b8202]={'$like':'%'+_0x25155a[_0x79a6('0x2b')][_0x79a6('0x46')]+'%'};return _0x35136a;})});}_0x16855e=_[_0x79a6('0x31')]({},_0x16855e,_0x25155a[_0x79a6('0x32')]);return _0x557246[_0x79a6('0x51')](_0x16855e);}})[_0x79a6('0x17')](function(_0x481103){if(_0x481103){_0xdb1e65=_0x481103[_0x79a6('0x30')];if(!_0x25155a['query']['hasOwnProperty'](_0x79a6('0x53'))){_0x16855e[_0x79a6('0x11')]=qs[_0x79a6('0x11')](_0x25155a['query'][_0x79a6('0x11')]);_0x16855e['offset']=qs[_0x79a6('0x13')](_0x25155a[_0x79a6('0x2b')][_0x79a6('0x13')]);}return _0x557246[_0x79a6('0x51')](_0x16855e);}})[_0x79a6('0x17')](function(_0x2c314e){if(_0x2c314e){return _0x2c314e?{'count':_0xdb1e65,'rows':_0x2c314e}:null;}})[_0x79a6('0x17')](respondWithResult(_0x324ee2,null))['catch'](handleError(_0x324ee2,null));};exports[_0x79a6('0x54')]=function(_0xc4418f,_0x270420){var _0x10a665=_0xc4418f['body']['ids'];return db[_0x79a6('0x52')]['findAll']({'where':{'id':_0x10a665},'attributes':['id'],'include':[{'model':db[_0x79a6('0x47')],'as':_0x79a6('0x55'),'attributes':['id',_0x79a6('0x1c'),_0x79a6('0x56'),_0x79a6('0x57'),_0x79a6('0x58')],'raw':!![]}]})[_0x79a6('0x17')](function(_0x171f85){if(_0x171f85){var _0x1cc9b2=_[_0x79a6('0x59')](_0x171f85,function(_0x3e570a){var _0x5cc6b2=_0x3e570a[_0x79a6('0x36')]({'plain':!![]});return _0x5cc6b2[_0x79a6('0x55')];});return db[_0x79a6('0x20')]['find']({'where':{'id':_0xc4418f[_0x79a6('0x28')]['id']}})[_0x79a6('0x17')](function(_0x39fc81){return db[_0x79a6('0x5a')][_0x79a6('0x5b')](function(_0x1b67f3){return _0x39fc81[_0x79a6('0x54')](_0x10a665,{'transaction':_0x1b67f3})[_0x79a6('0x17')](function(){return BPromise[_0x79a6('0x5c')](_0x1cc9b2,function(_0x48d1cf){return db[_0x79a6('0x3f')]['findOrCreate']({'where':{'UserId':_0x48d1cf['id'],'ChatQueueId':_0xc4418f[_0x79a6('0x28')]['id']},'transaction':_0x1b67f3});});})[_0x79a6('0x17')](function(){_0x1cc9b2['forEach'](function(_0x3d0d85){socket[_0x79a6('0x5d')](_0x79a6('0x5e'),{'UserId':_0x3d0d85['id'],'ChatQueueId':_0x39fc81['id']});});});});});}})[_0x79a6('0x17')](respondWithStatusCode(_0x270420,null))[_0x79a6('0x27')](handleError(_0x270420,null));};exports['removeTeams']=function(_0x457553,_0x120a37){return db[_0x79a6('0x52')][_0x79a6('0x26')]({'where':{'id':_0x457553['query'][_0x79a6('0x5f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x79a6('0x55'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x120a37,null))[_0x79a6('0x17')](function(_0x56b02d){var _0x563d6c=_['map'](_0x56b02d,'id');var _0x234cd5=[];var _0x440898=[];var _0x4314dc=squel[_0x79a6('0x60')]();_0x4314dc[_0x79a6('0x61')]('tq.TeamId')[_0x79a6('0x62')](_0x79a6('0x63'),'tq')[_0x79a6('0x64')](_0x79a6('0x65'),'ut',_0x79a6('0x66'))[_0x79a6('0x43')]('ChatQueueId\x20=\x20?',_0x457553['params']['id']);for(var _0x1b41a5=0x0;_0x1b41a5<_0x56b02d['length'];_0x1b41a5+=0x1){let _0x333cf6=_0x56b02d[_0x1b41a5];for(var _0xdddea2=0x0;_0xdddea2<_0x333cf6[_0x79a6('0x55')][_0x79a6('0x30')];_0xdddea2+=0x1){let _0xf3ef3b=_0x333cf6[_0x79a6('0x55')][_0xdddea2];var _0x480a3f=_0x4314dc[_0x79a6('0x67')]();_0x480a3f[_0x79a6('0x43')](_0x79a6('0x68'),_0xf3ef3b['id']);_0x440898[_0x79a6('0x69')](db['sequelize'][_0x79a6('0x2b')](_0x480a3f[_0x79a6('0x6a')](),{'type':db[_0x79a6('0x5a')][_0x79a6('0x6b')]['SELECT']})[_0x79a6('0x17')](function(_0x2a7244){if(_0x2a7244[_0x79a6('0x30')]===0x1){return _0xf3ef3b['id'];}else{var _0x3f06e9=_[_0x79a6('0x6c')](_[_0x79a6('0x1f')](_0x2a7244,'TeamId'),function(_0x5ad0a8){return _[_0x79a6('0x6d')](_0x563d6c,_0x5ad0a8);});if(_0x3f06e9){return _0xf3ef3b['id'];}}}));}}return BPromise[_0x79a6('0x6e')](_0x440898)[_0x79a6('0x17')](function(_0x281815){_0x234cd5=_(_0x234cd5)[_0x79a6('0x6f')](_0x281815)[_0x79a6('0x70')]()[_0x79a6('0x71')]();return db[_0x79a6('0x20')][_0x79a6('0x33')]({'where':{'id':_0x457553['params']['id']}})[_0x79a6('0x17')](function(_0x1cb013){return db['sequelize'][_0x79a6('0x5b')](function(_0x2b143c){return _0x1cb013[_0x79a6('0x72')](_0x457553[_0x79a6('0x2b')][_0x79a6('0x5f')],{'transaction':_0x2b143c})[_0x79a6('0x17')](function(){if(!_[_0x79a6('0x73')](_0x234cd5)){return _0x1cb013[_0x79a6('0x74')](_0x234cd5,{'transaction':_0x2b143c});}})[_0x79a6('0x17')](function(){_0x234cd5[_0x79a6('0x75')](function(_0x7fcb2b){socket[_0x79a6('0x5d')]('userChatQueue:remove',{'UserId':_0x7fcb2b,'ChatQueueId':_0x1cb013['id']});});});});});});})[_0x79a6('0x17')](respondWithStatusCode(_0x120a37,null))[_0x79a6('0x27')](handleError(_0x120a37,null));};exports[_0x79a6('0x76')]=function(_0x59e324,_0x5e3fcd){return db[_0x79a6('0x20')][_0x79a6('0x33')]({'where':{'id':_0x59e324['params']['id']}})[_0x79a6('0x17')](handleEntityNotFound(_0x5e3fcd,null))[_0x79a6('0x17')](function(_0x307113){if(_0x307113){return _0x307113['addAgents'](_0x59e324[_0x79a6('0x35')]['ids'],_['omit'](_0x59e324[_0x79a6('0x35')],[_0x79a6('0x5f'),'id'])||{})[_0x79a6('0x77')](function(_0x200dc0){for(var _0x4298ae=0x0;_0x4298ae<_0x59e324[_0x79a6('0x35')]['ids'][_0x79a6('0x30')];_0x4298ae+=0x1){socket[_0x79a6('0x5d')](_0x79a6('0x5e'),{'UserId':Number(_0x59e324[_0x79a6('0x35')][_0x79a6('0x5f')][_0x4298ae]),'ChatQueueId':Number(_0x59e324[_0x79a6('0x28')]['id'])});}return _0x200dc0;});}})[_0x79a6('0x17')](respondWithResult(_0x5e3fcd,null))[_0x79a6('0x27')](handleError(_0x5e3fcd,null));};exports[_0x79a6('0x74')]=function(_0x46e00c,_0x44a5e9){return db['ChatQueue'][_0x79a6('0x33')]({'where':{'id':_0x46e00c['params']['id']}})[_0x79a6('0x17')](handleEntityNotFound(_0x44a5e9,null))[_0x79a6('0x17')](function(_0x1a867e){if(_0x1a867e){return _0x1a867e[_0x79a6('0x74')](_0x46e00c[_0x79a6('0x2b')][_0x79a6('0x5f')])[_0x79a6('0x17')](function(){if(_[_0x79a6('0x78')](_0x46e00c[_0x79a6('0x2b')]['ids'])){for(var _0x27424a=0x0;_0x27424a<_0x46e00c['query']['ids'][_0x79a6('0x30')];_0x27424a+=0x1){socket[_0x79a6('0x5d')](_0x79a6('0x79'),{'UserId':Number(_0x46e00c[_0x79a6('0x2b')]['ids'][_0x27424a]),'ChatQueueId':Number(_0x46e00c[_0x79a6('0x28')]['id'])});}}else{socket['emit'](_0x79a6('0x79'),{'UserId':Number(_0x46e00c[_0x79a6('0x2b')][_0x79a6('0x5f')]),'ChatQueueId':Number(_0x46e00c[_0x79a6('0x28')]['id'])});}});}})['then'](respondWithStatusCode(_0x44a5e9,null))[_0x79a6('0x27')](handleError(_0x44a5e9,null));};exports[_0x79a6('0x7a')]=function(_0x4e2ba5,_0x503434){var _0xfd8168={};var _0x39519f={};var _0x3f4dc1;var _0x21dda0;return db[_0x79a6('0x20')][_0x79a6('0x3e')]({'where':{'id':_0x4e2ba5[_0x79a6('0x28')]['id']}})['then'](handleEntityNotFound(_0x503434,null))['then'](function(_0x3847dc){if(_0x3847dc){_0x3f4dc1=_0x3847dc;_0x39519f[_0x79a6('0x29')]=_[_0x79a6('0x2a')](db[_0x79a6('0x47')][_0x79a6('0x21')]);_0x39519f[_0x79a6('0x2b')]=_[_0x79a6('0x2a')](_0x4e2ba5[_0x79a6('0x2b')]);_0x39519f[_0x79a6('0x2c')]=_['intersection'](_0x39519f[_0x79a6('0x29')],_0x39519f['query']);_0xfd8168['attributes']=_[_0x79a6('0x2e')](_0x39519f[_0x79a6('0x29')],qs[_0x79a6('0x2f')](_0x4e2ba5['query'][_0x79a6('0x2f')]));_0xfd8168[_0x79a6('0x2d')]=_0xfd8168[_0x79a6('0x2d')][_0x79a6('0x30')]?_0xfd8168[_0x79a6('0x2d')]:_0x39519f[_0x79a6('0x29')];_0xfd8168['order']=qs[_0x79a6('0x42')](_0x4e2ba5['query'][_0x79a6('0x42')]);_0xfd8168['where']=qs[_0x79a6('0x2c')](_[_0x79a6('0x44')](_0x4e2ba5['query'],_0x39519f[_0x79a6('0x2c')]));if(_0x4e2ba5[_0x79a6('0x2b')]['filter']){_0xfd8168[_0x79a6('0x43')]=_['merge'](_0xfd8168[_0x79a6('0x43')],{'$or':_[_0x79a6('0x1f')](_0xfd8168[_0x79a6('0x2d')],function(_0x44c7a4){var _0x46f10c={};_0x46f10c[_0x44c7a4]={'$like':'%'+_0x4e2ba5[_0x79a6('0x2b')][_0x79a6('0x46')]+'%'};return _0x46f10c;})});}_0xfd8168=_[_0x79a6('0x31')]({},_0xfd8168,_0x4e2ba5['options']);return _0x3f4dc1['getAgents'](_0xfd8168);}})['then'](function(_0x9f699c){if(_0x9f699c){_0x21dda0=_0x9f699c[_0x79a6('0x30')];if(!_0x4e2ba5[_0x79a6('0x2b')][_0x79a6('0x40')](_0x79a6('0x53'))){_0xfd8168[_0x79a6('0x11')]=qs[_0x79a6('0x11')](_0x4e2ba5[_0x79a6('0x2b')][_0x79a6('0x11')]);_0xfd8168['offset']=qs['offset'](_0x4e2ba5[_0x79a6('0x2b')][_0x79a6('0x13')]);}return _0x3f4dc1['getAgents'](_0xfd8168);}})['then'](function(_0x548b5b){if(_0x548b5b){return _0x548b5b?{'count':_0x21dda0,'rows':_0x548b5b}:null;}})[_0x79a6('0x17')](respondWithResult(_0x503434,null))[_0x79a6('0x27')](handleError(_0x503434,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 2994873..4b45edc 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 _0xfd01=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','ChatQueue'];(function(_0x11c090,_0x7d8e4e){var _0x444c13=function(_0x2fd312){while(--_0x2fd312){_0x11c090['push'](_0x11c090['shift']());}};_0x444c13(++_0x7d8e4e);}(_0xfd01,0x86));var _0x1fd0=function(_0x2de483,_0x12d5f3){_0x2de483=_0x2de483-0x0;var _0x2162c3=_0xfd01[_0x2de483];return _0x2162c3;};'use strict';var EventEmitter=require(_0x1fd0('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x1fd0('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1fd0('0x2')](0x0);var events={'afterCreate':_0x1fd0('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x270397){return function(_0x57eab1,_0x111210,_0x80e821){ChatQueueEvents[_0x1fd0('0x4')](_0x270397+':'+_0x57eab1['id'],_0x57eab1);ChatQueueEvents['emit'](_0x270397,_0x57eab1);_0x80e821(null);};}for(var e in events){if(events[_0x1fd0('0x5')](e)){var event=events[e];ChatQueue[_0x1fd0('0x6')](e,emitEvent(event));}}module[_0x1fd0('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x2eff=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','remove'];(function(_0x323006,_0x5b327b){var _0x460838=function(_0x2637bb){while(--_0x2637bb){_0x323006['push'](_0x323006['shift']());}};_0x460838(++_0x5b327b);}(_0x2eff,0x176));var _0xf2ef=function(_0x1aca73,_0x446f01){_0x1aca73=_0x1aca73-0x0;var _0x3f06d8=_0x2eff[_0x1aca73];return _0x3f06d8;};'use strict';var EventEmitter=require(_0xf2ef('0x0'));var ChatQueue=require(_0xf2ef('0x1'))['db'][_0xf2ef('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf2ef('0x3')](0x0);var events={'afterCreate':_0xf2ef('0x4'),'afterUpdate':'update','afterDestroy':_0xf2ef('0x5')};function emitEvent(_0x54ad49){return function(_0x45c70d,_0x2ee193,_0x4b7b8a){ChatQueueEvents[_0xf2ef('0x6')](_0x54ad49+':'+_0x45c70d['id'],_0x45c70d);ChatQueueEvents[_0xf2ef('0x6')](_0x54ad49,_0x45c70d);_0x4b7b8a(null);};}for(var e in events){if(events[_0xf2ef('0x7')](e)){var event=events[e];ChatQueue[_0xf2ef('0x8')](e,emitEvent(event));}}module[_0xf2ef('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index a9786bc..a8a40c5 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 _0x95f1=['ChatQueue','chat_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','define'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x95f1,0xfe));var _0x195f=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x95f1[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x195f('0x0'));var util=require(_0x195f('0x1'));var logger=require(_0x195f('0x2'))('api');var moment=require(_0x195f('0x3'));var BPromise=require(_0x195f('0x4'));var rp=require(_0x195f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x195f('0x6'));var config=require(_0x195f('0x7'));var attributes=require(_0x195f('0x8'));module['exports']=function(_0x115677,_0x404cd4){return _0x115677[_0x195f('0x9')](_0x195f('0xa'),attributes,{'tableName':_0x195f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10a4=['bluebird','request-promise','../../config/environment','./chatQueue.attributes','exports','define','chat_queues','lodash','util','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x10a4,0x1e7));var _0x410a=function(_0x384dfd,_0x54bc76){_0x384dfd=_0x384dfd-0x0;var _0x5e232c=_0x10a4[_0x384dfd];return _0x5e232c;};'use strict';var _=require(_0x410a('0x0'));var util=require(_0x410a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x410a('0x2'));var BPromise=require(_0x410a('0x3'));var rp=require(_0x410a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x410a('0x5'));var attributes=require(_0x410a('0x6'));module[_0x410a('0x7')]=function(_0x4edfa3,_0x394ad0){return _0x4edfa3[_0x410a('0x8')]('ChatQueue',attributes,{'tableName':_0x410a('0x9'),'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 7f9844d..bfb1d8f 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 _0x01b5=['limit','map','include','model','ChatQueue','catch','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','GetChatQueue','raw','options','where','attributes'];(function(_0x5d0ab0,_0x38fe7d){var _0x1b97ca=function(_0x4f2036){while(--_0x4f2036){_0x5d0ab0['push'](_0x5d0ab0['shift']());}};_0x1b97ca(++_0x38fe7d);}(_0x01b5,0xca));var _0x501b=function(_0x31a020,_0x5e5359){_0x31a020=_0x31a020-0x0;var _0x302c0c=_0x01b5[_0x31a020];return _0x302c0c;};'use strict';var _=require(_0x501b('0x0'));var util=require(_0x501b('0x1'));var moment=require(_0x501b('0x2'));var BPromise=require(_0x501b('0x3'));var rs=require(_0x501b('0x4'));var fs=require('fs');var Redis=require(_0x501b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x501b('0x6'));var logger=require(_0x501b('0x7'))(_0x501b('0x8'));var config=require(_0x501b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x501b('0xa')][_0x501b('0xb')]({'port':0x232a});config[_0x501b('0xc')]=_['defaults'](config[_0x501b('0xc')],{'host':_0x501b('0xd'),'port':0x18eb});var socket=require(_0x501b('0xe'))(new Redis(config['redis']));require(_0x501b('0xf'))[_0x501b('0x10')](socket);function respondWithRpcPromise(_0x87c30d,_0x1017fd,_0xea61c4){return new BPromise(function(_0x37a128,_0xf7dba8){return client[_0x501b('0x11')](_0x87c30d,_0xea61c4)[_0x501b('0x12')](function(_0x58ac0c){logger['info'](_0x501b('0x13'),_0x1017fd,_0x501b('0x14'));logger[_0x501b('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1017fd,_0x501b('0x14'),JSON[_0x501b('0x16')](_0x58ac0c));if(_0x58ac0c[_0x501b('0x17')]){if(_0x58ac0c[_0x501b('0x17')][_0x501b('0x18')]===0x1f4){logger[_0x501b('0x17')](_0x501b('0x13'),_0x1017fd,_0x58ac0c[_0x501b('0x17')][_0x501b('0x19')]);return _0xf7dba8(_0x58ac0c[_0x501b('0x17')][_0x501b('0x19')]);}logger[_0x501b('0x17')](_0x501b('0x13'),_0x1017fd,_0x58ac0c[_0x501b('0x17')]['message']);return _0x37a128(_0x58ac0c['error'][_0x501b('0x19')]);}else{logger[_0x501b('0x1a')]('ChatQueue,\x20%s,\x20%s',_0x1017fd,_0x501b('0x14'));_0x37a128(_0x58ac0c['result'][_0x501b('0x19')]);}})['catch'](function(_0x4152d0){logger[_0x501b('0x17')](_0x501b('0x13'),_0x1017fd,_0x4152d0);_0xf7dba8(_0x4152d0);});});}exports[_0x501b('0x1b')]=function(_0x447cec){var _0x3d146b=this;return new Promise(function(_0x3f6fd5,_0x1b6e06){return db['ChatQueue']['findAll']({'raw':_0x447cec['options']?_0x447cec['options'][_0x501b('0x1c')]===undefined?!![]:![]:!![],'where':_0x447cec['options']?_0x447cec[_0x501b('0x1d')][_0x501b('0x1e')]||null:null,'attributes':_0x447cec[_0x501b('0x1d')]?_0x447cec['options'][_0x501b('0x1f')]||null:null,'limit':_0x447cec[_0x501b('0x1d')]?_0x447cec[_0x501b('0x1d')][_0x501b('0x20')]||null:null,'include':_0x447cec['options']?_0x447cec[_0x501b('0x1d')]['include']?_[_0x501b('0x21')](_0x447cec[_0x501b('0x1d')][_0x501b('0x22')],function(_0x4acf74){return{'model':db[_0x4acf74[_0x501b('0x23')]],'as':_0x4acf74['as'],'attributes':_0x4acf74[_0x501b('0x1f')],'include':_0x4acf74['include']?_[_0x501b('0x21')](_0x4acf74[_0x501b('0x22')],function(_0xd84732){return{'model':db[_0xd84732[_0x501b('0x23')]],'as':_0xd84732['as'],'attributes':_0xd84732['attributes'],'include':_0xd84732[_0x501b('0x22')]?_[_0x501b('0x21')](_0xd84732[_0x501b('0x22')],function(_0x4fb61c){return{'model':db[_0x4fb61c[_0x501b('0x23')]],'as':_0x4fb61c['as'],'attributes':_0x4fb61c[_0x501b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x501b('0x12')](function(_0x46db0d){logger[_0x501b('0x1a')]('GetChatQueue',_0x447cec);logger[_0x501b('0x15')](_0x501b('0x1b'),_0x447cec,JSON[_0x501b('0x16')](_0x46db0d));_0x3f6fd5(_0x46db0d);})['catch'](function(_0x2ea740){logger[_0x501b('0x17')](_0x501b('0x1b'),_0x2ea740[_0x501b('0x19')],_0x447cec);_0x1b6e06(_0x3d146b[_0x501b('0x17')](0x1f4,_0x2ea740['message']));});});};exports['ShowChatQueue']=function(_0x154902){var _0x2dbf9b=this;return new Promise(function(_0x4372fa,_0x1623d6){return db[_0x501b('0x24')]['find']({'raw':_0x154902[_0x501b('0x1d')]?_0x154902[_0x501b('0x1d')][_0x501b('0x1c')]===undefined?!![]:![]:!![],'where':_0x154902['options']?_0x154902[_0x501b('0x1d')][_0x501b('0x1e')]||null:null,'attributes':_0x154902[_0x501b('0x1d')]?_0x154902['options'][_0x501b('0x1f')]||null:null,'include':_0x154902[_0x501b('0x1d')]?_0x154902[_0x501b('0x1d')][_0x501b('0x22')]?_[_0x501b('0x21')](_0x154902['options']['include'],function(_0xadebcd){return{'model':db[_0xadebcd[_0x501b('0x23')]],'as':_0xadebcd['as'],'attributes':_0xadebcd[_0x501b('0x1f')],'include':_0xadebcd['include']?_[_0x501b('0x21')](_0xadebcd[_0x501b('0x22')],function(_0x152908){return{'model':db[_0x152908['model']],'as':_0x152908['as'],'attributes':_0x152908[_0x501b('0x1f')],'include':_0x152908[_0x501b('0x22')]?_[_0x501b('0x21')](_0x152908[_0x501b('0x22')],function(_0x816597){return{'model':db[_0x816597[_0x501b('0x23')]],'as':_0x816597['as'],'attributes':_0x816597[_0x501b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x501b('0x12')](function(_0x507a06){logger[_0x501b('0x1a')]('ShowChatQueue',_0x154902);logger[_0x501b('0x15')]('ShowChatQueue',_0x154902,JSON['stringify'](_0x507a06));_0x4372fa(_0x507a06);})[_0x501b('0x25')](function(_0x3b6bdd){logger[_0x501b('0x17')](_0x501b('0x26'),_0x3b6bdd[_0x501b('0x19')],_0x154902);_0x1623d6(_0x2dbf9b[_0x501b('0x17')](0x1f4,_0x3b6bdd[_0x501b('0x19')]));});});}; \ No newline at end of file +var _0x5464=['localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','error','message','catch','GetChatQueue','ChatQueue','options','where','attributes','limit','include','map','model','find','raw','then','debug','ShowChatQueue','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis'];(function(_0xd95342,_0xb75bf6){var _0x54d694=function(_0x1190c1){while(--_0x1190c1){_0xd95342['push'](_0xd95342['shift']());}};_0x54d694(++_0xb75bf6);}(_0x5464,0x15d));var _0x4546=function(_0x14d554,_0xa46ace){_0x14d554=_0x14d554-0x0;var _0x93b623=_0x5464[_0x14d554];return _0x93b623;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var BPromise=require('bluebird');var rs=require(_0x4546('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4546('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4546('0x5'))(_0x4546('0x6'));var config=require(_0x4546('0x7'));var jayson=require(_0x4546('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x4546('0x9')](config[_0x4546('0xa')],{'host':_0x4546('0xb'),'port':0x18eb});var socket=require(_0x4546('0xc'))(new Redis(config[_0x4546('0xa')]));require(_0x4546('0xd'))[_0x4546('0xe')](socket);function respondWithRpcPromise(_0x430b2e,_0x383bf2,_0x4ac723){return new BPromise(function(_0x1dd3f5,_0x8a15e2){return client[_0x4546('0xf')](_0x430b2e,_0x4ac723)['then'](function(_0x1f82c9){logger[_0x4546('0x10')](_0x4546('0x11'),_0x383bf2,_0x4546('0x12'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x383bf2,_0x4546('0x12'),JSON['stringify'](_0x1f82c9));if(_0x1f82c9['error']){if(_0x1f82c9['error']['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x383bf2,_0x1f82c9[_0x4546('0x13')]['message']);return _0x8a15e2(_0x1f82c9[_0x4546('0x13')]['message']);}logger[_0x4546('0x13')]('ChatQueue,\x20%s,\x20%s',_0x383bf2,_0x1f82c9[_0x4546('0x13')][_0x4546('0x14')]);return _0x1dd3f5(_0x1f82c9[_0x4546('0x13')][_0x4546('0x14')]);}else{logger[_0x4546('0x10')](_0x4546('0x11'),_0x383bf2,'request\x20sent');_0x1dd3f5(_0x1f82c9['result']['message']);}})[_0x4546('0x15')](function(_0x39f552){logger[_0x4546('0x13')](_0x4546('0x11'),_0x383bf2,_0x39f552);_0x8a15e2(_0x39f552);});});}exports[_0x4546('0x16')]=function(_0x337a44){var _0x3ec009=this;return new Promise(function(_0x2f6329,_0x4034a5){return db[_0x4546('0x17')]['findAll']({'raw':_0x337a44[_0x4546('0x18')]?_0x337a44[_0x4546('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x337a44[_0x4546('0x18')]?_0x337a44[_0x4546('0x18')][_0x4546('0x19')]||null:null,'attributes':_0x337a44[_0x4546('0x18')]?_0x337a44[_0x4546('0x18')][_0x4546('0x1a')]||null:null,'limit':_0x337a44['options']?_0x337a44[_0x4546('0x18')][_0x4546('0x1b')]||null:null,'include':_0x337a44['options']?_0x337a44[_0x4546('0x18')][_0x4546('0x1c')]?_[_0x4546('0x1d')](_0x337a44[_0x4546('0x18')][_0x4546('0x1c')],function(_0x53ae5e){return{'model':db[_0x53ae5e[_0x4546('0x1e')]],'as':_0x53ae5e['as'],'attributes':_0x53ae5e[_0x4546('0x1a')],'include':_0x53ae5e[_0x4546('0x1c')]?_['map'](_0x53ae5e['include'],function(_0x43740e){return{'model':db[_0x43740e[_0x4546('0x1e')]],'as':_0x43740e['as'],'attributes':_0x43740e[_0x4546('0x1a')],'include':_0x43740e[_0x4546('0x1c')]?_[_0x4546('0x1d')](_0x43740e[_0x4546('0x1c')],function(_0xcea7da){return{'model':db[_0xcea7da['model']],'as':_0xcea7da['as'],'attributes':_0xcea7da[_0x4546('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a2d12){logger[_0x4546('0x10')]('GetChatQueue',_0x337a44);logger['debug'](_0x4546('0x16'),_0x337a44,JSON['stringify'](_0x3a2d12));_0x2f6329(_0x3a2d12);})[_0x4546('0x15')](function(_0x58b69){logger['error']('GetChatQueue',_0x58b69[_0x4546('0x14')],_0x337a44);_0x4034a5(_0x3ec009[_0x4546('0x13')](0x1f4,_0x58b69[_0x4546('0x14')]));});});};exports['ShowChatQueue']=function(_0x10db2e){var _0x2c8e44=this;return new Promise(function(_0x540983,_0xad1b9c){return db['ChatQueue'][_0x4546('0x1f')]({'raw':_0x10db2e[_0x4546('0x18')]?_0x10db2e[_0x4546('0x18')][_0x4546('0x20')]===undefined?!![]:![]:!![],'where':_0x10db2e['options']?_0x10db2e[_0x4546('0x18')][_0x4546('0x19')]||null:null,'attributes':_0x10db2e[_0x4546('0x18')]?_0x10db2e[_0x4546('0x18')][_0x4546('0x1a')]||null:null,'include':_0x10db2e[_0x4546('0x18')]?_0x10db2e['options'][_0x4546('0x1c')]?_[_0x4546('0x1d')](_0x10db2e['options']['include'],function(_0x3eb8e8){return{'model':db[_0x3eb8e8[_0x4546('0x1e')]],'as':_0x3eb8e8['as'],'attributes':_0x3eb8e8['attributes'],'include':_0x3eb8e8[_0x4546('0x1c')]?_[_0x4546('0x1d')](_0x3eb8e8['include'],function(_0x5acdc0){return{'model':db[_0x5acdc0[_0x4546('0x1e')]],'as':_0x5acdc0['as'],'attributes':_0x5acdc0[_0x4546('0x1a')],'include':_0x5acdc0[_0x4546('0x1c')]?_[_0x4546('0x1d')](_0x5acdc0[_0x4546('0x1c')],function(_0x24ae41){return{'model':db[_0x24ae41['model']],'as':_0x24ae41['as'],'attributes':_0x24ae41[_0x4546('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4546('0x21')](function(_0x4a70f5){logger[_0x4546('0x10')]('ShowChatQueue',_0x10db2e);logger[_0x4546('0x22')](_0x4546('0x23'),_0x10db2e,JSON['stringify'](_0x4a70f5));_0x540983(_0x4a70f5);})['catch'](function(_0x104d56){logger[_0x4546('0x13')](_0x4546('0x23'),_0x104d56['message'],_0x10db2e);_0xad1b9c(_0x2c8e44[_0x4546('0x13')](0x1f4,_0x104d56[_0x4546('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 26146bb..a158c01 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 _0xa41a=['emit','removeListener','./chatQueue.events','save','update'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xa41a,0x6b));var _0xaa41=function(_0x5c85c8,_0x16110b){_0x5c85c8=_0x5c85c8-0x0;var _0x42d66f=_0xa41a[_0x5c85c8];return _0x42d66f;};'use strict';var ChatQueueEvents=require(_0xaa41('0x0'));var events=[_0xaa41('0x1'),'remove',_0xaa41('0x2')];function createListener(_0x2a96ba,_0x43654a){return function(_0xc5ce74){_0x43654a[_0xaa41('0x3')](_0x2a96ba,_0xc5ce74);};}function removeListener(_0x3168be,_0x42896b){return function(){ChatQueueEvents[_0xaa41('0x4')](_0x3168be,_0x42896b);};}exports['register']=function(_0x2122a0){for(var _0x1ec9d4=0x0,_0x54bc5a=events['length'];_0x1ec9d4<_0x54bc5a;_0x1ec9d4++){var _0x179545=events[_0x1ec9d4];var _0x202cce=createListener('chatQueue:'+_0x179545,_0x2122a0);ChatQueueEvents['on'](_0x179545,_0x202cce);}}; \ No newline at end of file +var _0x0faf=['update','emit','removeListener','length','chatQueue:','./chatQueue.events','remove'];(function(_0x4ffa64,_0x271035){var _0x5da001=function(_0x7d1940){while(--_0x7d1940){_0x4ffa64['push'](_0x4ffa64['shift']());}};_0x5da001(++_0x271035);}(_0x0faf,0x132));var _0xf0fa=function(_0x16e0f5,_0x4ec0f3){_0x16e0f5=_0x16e0f5-0x0;var _0x4839d5=_0x0faf[_0x16e0f5];return _0x4839d5;};'use strict';var ChatQueueEvents=require(_0xf0fa('0x0'));var events=['save',_0xf0fa('0x1'),_0xf0fa('0x2')];function createListener(_0x2c6207,_0x35a260){return function(_0xccb93e){_0x35a260[_0xf0fa('0x3')](_0x2c6207,_0xccb93e);};}function removeListener(_0x515b12,_0xc83253){return function(){ChatQueueEvents[_0xf0fa('0x4')](_0x515b12,_0xc83253);};}exports['register']=function(_0x3637a3){for(var _0x44ffa0=0x0,_0x25b5c4=events[_0xf0fa('0x5')];_0x44ffa0<_0x25b5c4;_0x44ffa0++){var _0x2db1d9=events[_0x44ffa0];var _0x587865=createListener(_0xf0fa('0x6')+_0x2db1d9,_0x3637a3);ChatQueueEvents['on'](_0x2db1d9,_0x587865);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 0617e6a..ebaa03f 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x51a6e8,_0x3e754a){var _0xda6ca=function(_0x2bc0e4){while(--_0x2bc0e4){_0x51a6e8['push'](_0x51a6e8['shift']());}};_0xda6ca(++_0x3e754a);}(_0x55ca,0x126));var _0xa55c=function(_0x5d76cc,_0x195736){_0x5d76cc=_0x5d76cc-0x0;var _0x4acce4=_0x55ca[_0x5d76cc];return _0x4acce4;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file +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(_0x3097ee,_0x5d0bc8){var _0x40e045=function(_0x5d7fd4){while(--_0x5d7fd4){_0x3097ee['push'](_0x3097ee['shift']());}};_0x40e045(++_0x5d0bc8);}(_0x7217,0x19e));var _0x7721=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7217[_0x1facfa];return _0x9ec701;};'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 9a688d0..81a0280 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 _0x3092=['sequelize','STRING','DATE'];(function(_0x421f73,_0x5c398f){var _0x141573=function(_0xf4aeff){while(--_0xf4aeff){_0x421f73['push'](_0x421f73['shift']());}};_0x141573(++_0x5c398f);}(_0x3092,0x165));var _0x2309=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0x3092[_0x271060];return _0x40540b;};'use strict';var moment=require('moment');var Sequelize=require(_0x2309('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x2309('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x2309('0x2')]},'leaveAt':{'type':Sequelize[_0x2309('0x2')]},'acceptAt':{'type':Sequelize[_0x2309('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x2309('0x1')]}}; \ No newline at end of file +var _0xb083=['STRING','DATE','moment','exports'];(function(_0x415c03,_0x3c87b0){var _0x3d51f9=function(_0x282598){while(--_0x282598){_0x415c03['push'](_0x415c03['shift']());}};_0x3d51f9(++_0x3c87b0);}(_0xb083,0xf6));var _0x3b08=function(_0x10e638,_0x3f3263){_0x10e638=_0x10e638-0x0;var _0xb67520=_0xb083[_0x10e638];return _0xb67520;};'use strict';var moment=require(_0x3b08('0x0'));var Sequelize=require('sequelize');module[_0x3b08('0x1')]={'uniqueid':{'type':Sequelize[_0x3b08('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3b08('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3b08('0x3')]},'exitAt':{'type':Sequelize[_0x3b08('0x3')]},'reason':{'type':Sequelize[_0x3b08('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index f6440c3..c196006 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 _0xa899=['../../config/environment','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','end','sendStatus','error','name','index','map','ChatQueueReport','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x570496,_0x26a150){var _0x1d4204=function(_0x4176cd){while(--_0x4176cd){_0x570496['push'](_0x570496['shift']());}};_0x1d4204(++_0x26a150);}(_0xa899,0x155));var _0x9a89=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xa899[_0x4c445a];return _0x2f611c;};'use strict';var emlformat=require(_0x9a89('0x0'));var rimraf=require(_0x9a89('0x1'));var zipdir=require(_0x9a89('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a89('0x3'));var moment=require(_0x9a89('0x4'));var BPromise=require(_0x9a89('0x5'));var Mustache=require(_0x9a89('0x6'));var util=require(_0x9a89('0x7'));var path=require(_0x9a89('0x8'));var sox=require(_0x9a89('0x9'));var csv=require(_0x9a89('0xa'));var ejs=require(_0x9a89('0xb'));var fs=require('fs');var fs_extra=require(_0x9a89('0xc'));var _=require(_0x9a89('0xd'));var squel=require(_0x9a89('0xe'));var crypto=require(_0x9a89('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9a89('0xa'));var querystring=require(_0x9a89('0x10'));var Papa=require('papaparse');var Redis=require(_0x9a89('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9a89('0x12'));var as=require(_0x9a89('0x13'));var hardwareService=require(_0x9a89('0x14'));var logger=require(_0x9a89('0x15'))(_0x9a89('0x16'));var utils=require(_0x9a89('0x17'));var config=require(_0x9a89('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4342c8,_0x8b7403){_0x8b7403=_0x8b7403||0xcc;return function(_0x2bdb0d){if(_0x2bdb0d){return _0x4342c8['sendStatus'](_0x8b7403);}return _0x4342c8['status'](_0x8b7403)['end']();};}function respondWithResult(_0x1c66a3,_0xf08a5a){_0xf08a5a=_0xf08a5a||0xc8;return function(_0x5720a2){if(_0x5720a2){return _0x1c66a3[_0x9a89('0x19')](_0xf08a5a)[_0x9a89('0x1a')](_0x5720a2);}};}function respondWithFilteredResult(_0x33a08f,_0x203ee9){return function(_0x597e58){if(_0x597e58){var _0x11a933=typeof _0x203ee9[_0x9a89('0x1b')]==='undefined'&&typeof _0x203ee9['limit']===_0x9a89('0x1c');var _0x4a15f1=_0x597e58[_0x9a89('0x1d')];var _0x334725=_0x11a933?0x0:_0x203ee9['offset'];var _0xdbb337=_0x11a933?_0x597e58['count']:_0x203ee9[_0x9a89('0x1b')]+_0x203ee9[_0x9a89('0x1e')];var _0x54c45d;if(_0xdbb337>=_0x4a15f1){_0xdbb337=_0x4a15f1;_0x54c45d=0xc8;}else{_0x54c45d=0xce;}_0x33a08f[_0x9a89('0x19')](_0x54c45d);return _0x33a08f[_0x9a89('0x1f')](_0x9a89('0x20'),_0x334725+'-'+_0xdbb337+'/'+_0x4a15f1)[_0x9a89('0x1a')](_0x597e58);}return null;};}function patchUpdates(_0x66f8c7){return function(_0x146ec0){try{jsonpatch[_0x9a89('0x21')](_0x146ec0,_0x66f8c7,!![]);}catch(_0x1548db){return BPromise['reject'](_0x1548db);}return _0x146ec0['save']();};}function saveUpdates(_0x1ef5ef,_0x330121){return function(_0xea8910){if(_0xea8910){return _0xea8910[_0x9a89('0x22')](_0x1ef5ef)[_0x9a89('0x23')](function(_0x3cc288){return _0x3cc288;});}return null;};}function removeEntity(_0x4ac234,_0x50adcf){return function(_0x42c5ee){if(_0x42c5ee){return _0x42c5ee['destroy']()[_0x9a89('0x23')](function(){_0x4ac234[_0x9a89('0x19')](0xcc)[_0x9a89('0x24')]();});}};}function handleEntityNotFound(_0x3b1807,_0x423a1d){return function(_0x35032a){if(!_0x35032a){_0x3b1807[_0x9a89('0x25')](0x194);}return _0x35032a;};}function handleError(_0x4d7876,_0x1a5005){_0x1a5005=_0x1a5005||0x1f4;return function(_0x5002a2){logger[_0x9a89('0x26')](_0x5002a2['stack']);if(_0x5002a2['name']){delete _0x5002a2[_0x9a89('0x27')];}_0x4d7876[_0x9a89('0x19')](_0x1a5005)['send'](_0x5002a2);};}exports[_0x9a89('0x28')]=function(_0x5abe70,_0x27f442){var _0x365e34={},_0x267512={},_0x2d019e={'count':0x0,'rows':[]};var _0x2324c0=_[_0x9a89('0x29')](db[_0x9a89('0x2a')]['rawAttributes'],function(_0x4df9f2){return{'name':_0x4df9f2['fieldName'],'type':_0x4df9f2[_0x9a89('0x2b')]['key']};});_0x267512[_0x9a89('0x2c')]=_[_0x9a89('0x29')](_0x2324c0,_0x9a89('0x27'));_0x267512['query']=_[_0x9a89('0x2d')](_0x5abe70['query']);_0x267512[_0x9a89('0x2e')]=_[_0x9a89('0x2f')](_0x267512[_0x9a89('0x2c')],_0x267512[_0x9a89('0x30')]);_0x365e34[_0x9a89('0x31')]=_['intersection'](_0x267512[_0x9a89('0x2c')],qs[_0x9a89('0x32')](_0x5abe70[_0x9a89('0x30')][_0x9a89('0x32')]));_0x365e34[_0x9a89('0x31')]=_0x365e34[_0x9a89('0x31')][_0x9a89('0x33')]?_0x365e34[_0x9a89('0x31')]:_0x267512[_0x9a89('0x2c')];if(!_0x5abe70['query'][_0x9a89('0x34')](_0x9a89('0x35'))){_0x365e34[_0x9a89('0x1e')]=qs[_0x9a89('0x1e')](_0x5abe70[_0x9a89('0x30')][_0x9a89('0x1e')]);_0x365e34[_0x9a89('0x1b')]=qs[_0x9a89('0x1b')](_0x5abe70[_0x9a89('0x30')][_0x9a89('0x1b')]);}_0x365e34['order']=qs[_0x9a89('0x36')](_0x5abe70[_0x9a89('0x30')][_0x9a89('0x36')]);_0x365e34[_0x9a89('0x37')]=qs[_0x9a89('0x2e')](_[_0x9a89('0x38')](_0x5abe70[_0x9a89('0x30')],_0x267512[_0x9a89('0x2e')]),_0x2324c0);if(_0x5abe70[_0x9a89('0x30')][_0x9a89('0x39')]){_0x365e34[_0x9a89('0x37')]=_[_0x9a89('0x3a')](_0x365e34['where'],{'$or':_[_0x9a89('0x29')](_0x2324c0,function(_0x4a26e7){if(_0x4a26e7[_0x9a89('0x2b')]!==_0x9a89('0x3b')){var _0x26112d={};_0x26112d[_0x4a26e7[_0x9a89('0x27')]]={'$like':'%'+_0x5abe70[_0x9a89('0x30')][_0x9a89('0x39')]+'%'};return _0x26112d;}})});}_0x365e34=_[_0x9a89('0x3a')]({},_0x365e34,_0x5abe70[_0x9a89('0x3c')]);var _0x192138={'where':_0x365e34['where']};return db[_0x9a89('0x2a')][_0x9a89('0x1d')](_0x192138)[_0x9a89('0x23')](function(_0x20c53b){_0x2d019e['count']=_0x20c53b;if(_0x5abe70['query'][_0x9a89('0x3d')]){_0x365e34['include']=[{'all':!![]}];}return db[_0x9a89('0x2a')][_0x9a89('0x3e')](_0x365e34);})[_0x9a89('0x23')](function(_0x34885f){_0x2d019e[_0x9a89('0x3f')]=_0x34885f;return _0x2d019e;})[_0x9a89('0x23')](respondWithFilteredResult(_0x27f442,_0x365e34))[_0x9a89('0x40')](handleError(_0x27f442,null));};exports[_0x9a89('0x41')]=function(_0x5e592b,_0x4c4f2c){var _0x4fe28a={'raw':!![],'where':{'id':_0x5e592b['params']['id']}},_0x1d3545={};_0x1d3545['model']=_[_0x9a89('0x2d')](db[_0x9a89('0x2a')][_0x9a89('0x42')]);_0x1d3545['query']=_[_0x9a89('0x2d')](_0x5e592b['query']);_0x1d3545[_0x9a89('0x2e')]=_['intersection'](_0x1d3545[_0x9a89('0x2c')],_0x1d3545[_0x9a89('0x30')]);_0x4fe28a[_0x9a89('0x31')]=_['intersection'](_0x1d3545[_0x9a89('0x2c')],qs[_0x9a89('0x32')](_0x5e592b[_0x9a89('0x30')]['fields']));_0x4fe28a['attributes']=_0x4fe28a[_0x9a89('0x31')]['length']?_0x4fe28a[_0x9a89('0x31')]:_0x1d3545[_0x9a89('0x2c')];if(_0x5e592b['query'][_0x9a89('0x3d')]){_0x4fe28a[_0x9a89('0x43')]=[{'all':!![]}];}_0x4fe28a=_['merge']({},_0x4fe28a,_0x5e592b['options']);return db[_0x9a89('0x2a')][_0x9a89('0x44')](_0x4fe28a)['then'](handleEntityNotFound(_0x4c4f2c,null))[_0x9a89('0x23')](respondWithResult(_0x4c4f2c,null))['catch'](handleError(_0x4c4f2c,null));};exports[_0x9a89('0x45')]=function(_0x2d58d4,_0x31f48){return db[_0x9a89('0x2a')][_0x9a89('0x45')](_0x2d58d4['body'],{})[_0x9a89('0x23')](respondWithResult(_0x31f48,0xc9))['catch'](handleError(_0x31f48,null));};exports[_0x9a89('0x22')]=function(_0xc007aa,_0x58196c){if(_0xc007aa[_0x9a89('0x46')]['id']){delete _0xc007aa[_0x9a89('0x46')]['id'];}return db[_0x9a89('0x2a')][_0x9a89('0x44')]({'where':{'id':_0xc007aa[_0x9a89('0x47')]['id']}})[_0x9a89('0x23')](handleEntityNotFound(_0x58196c,null))[_0x9a89('0x23')](saveUpdates(_0xc007aa[_0x9a89('0x46')],null))[_0x9a89('0x23')](respondWithResult(_0x58196c,null))[_0x9a89('0x40')](handleError(_0x58196c,null));};exports[_0x9a89('0x48')]=function(_0x5abc42,_0x3546ba){return db[_0x9a89('0x2a')][_0x9a89('0x44')]({'where':{'id':_0x5abc42['params']['id']}})[_0x9a89('0x23')](handleEntityNotFound(_0x3546ba,null))[_0x9a89('0x23')](removeEntity(_0x3546ba,null))['catch'](handleError(_0x3546ba,null));};exports['describe']=function(_0xc3653d,_0x4410ca){return db[_0x9a89('0x2a')]['describe']()[_0x9a89('0x23')](respondWithResult(_0x4410ca,null))[_0x9a89('0x40')](handleError(_0x4410ca,null));}; \ No newline at end of file +var _0xf2e3=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','error','stack','name','send','index','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','then','includeAll','include','rows','catch','show','params','create','body','update','destroy','find','describe','eml-format'];(function(_0x15cece,_0x19147f){var _0x182734=function(_0x12c3c1){while(--_0x12c3c1){_0x15cece['push'](_0x15cece['shift']());}};_0x182734(++_0x19147f);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xf2e3[_0x3740fe];return _0x55492b;};'use strict';var emlformat=require(_0x3f2e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f2e('0x1'));var jsonpatch=require(_0x3f2e('0x2'));var rp=require(_0x3f2e('0x3'));var moment=require(_0x3f2e('0x4'));var BPromise=require(_0x3f2e('0x5'));var Mustache=require(_0x3f2e('0x6'));var util=require(_0x3f2e('0x7'));var path=require(_0x3f2e('0x8'));var sox=require(_0x3f2e('0x9'));var csv=require('to-csv');var ejs=require(_0x3f2e('0xa'));var fs=require('fs');var fs_extra=require(_0x3f2e('0xb'));var _=require(_0x3f2e('0xc'));var squel=require(_0x3f2e('0xd'));var crypto=require(_0x3f2e('0xe'));var jsforce=require(_0x3f2e('0xf'));var deskjs=require(_0x3f2e('0x10'));var toCsv=require(_0x3f2e('0x11'));var querystring=require(_0x3f2e('0x12'));var Papa=require(_0x3f2e('0x13'));var Redis=require(_0x3f2e('0x14'));var authService=require(_0x3f2e('0x15'));var qs=require(_0x3f2e('0x16'));var as=require(_0x3f2e('0x17'));var hardwareService=require(_0x3f2e('0x18'));var logger=require(_0x3f2e('0x19'))(_0x3f2e('0x1a'));var utils=require(_0x3f2e('0x1b'));var config=require(_0x3f2e('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f2e('0x1d'))['db'];function respondWithStatusCode(_0xaa6ef5,_0x5471f9){_0x5471f9=_0x5471f9||0xcc;return function(_0xe83663){if(_0xe83663){return _0xaa6ef5[_0x3f2e('0x1e')](_0x5471f9);}return _0xaa6ef5[_0x3f2e('0x1f')](_0x5471f9)[_0x3f2e('0x20')]();};}function respondWithResult(_0x3d20d1,_0x57cba7){_0x57cba7=_0x57cba7||0xc8;return function(_0x298080){if(_0x298080){return _0x3d20d1[_0x3f2e('0x1f')](_0x57cba7)[_0x3f2e('0x21')](_0x298080);}};}function respondWithFilteredResult(_0x4f2e38,_0x43f69e){return function(_0x218b44){if(_0x218b44){var _0x17ef58=typeof _0x43f69e[_0x3f2e('0x22')]===_0x3f2e('0x23')&&typeof _0x43f69e[_0x3f2e('0x24')]===_0x3f2e('0x23');var _0x155411=_0x218b44[_0x3f2e('0x25')];var _0xc00add=_0x17ef58?0x0:_0x43f69e[_0x3f2e('0x22')];var _0x5b9989=_0x17ef58?_0x218b44[_0x3f2e('0x25')]:_0x43f69e[_0x3f2e('0x22')]+_0x43f69e[_0x3f2e('0x24')];var _0xbe899c;if(_0x5b9989>=_0x155411){_0x5b9989=_0x155411;_0xbe899c=0xc8;}else{_0xbe899c=0xce;}_0x4f2e38[_0x3f2e('0x1f')](_0xbe899c);return _0x4f2e38['set']('Content-Range',_0xc00add+'-'+_0x5b9989+'/'+_0x155411)[_0x3f2e('0x21')](_0x218b44);}return null;};}function patchUpdates(_0x11f84c){return function(_0x38bbae){try{jsonpatch[_0x3f2e('0x26')](_0x38bbae,_0x11f84c,!![]);}catch(_0x4381e5){return BPromise[_0x3f2e('0x27')](_0x4381e5);}return _0x38bbae['save']();};}function saveUpdates(_0x5a7047,_0xf81165){return function(_0x37dab2){if(_0x37dab2){return _0x37dab2['update'](_0x5a7047)['then'](function(_0x46bb1c){return _0x46bb1c;});}return null;};}function removeEntity(_0x5646f5,_0x1b8c67){return function(_0x401ed9){if(_0x401ed9){return _0x401ed9['destroy']()['then'](function(){_0x5646f5['status'](0xcc)[_0x3f2e('0x20')]();});}};}function handleEntityNotFound(_0x3d7631,_0x4c61d9){return function(_0x11a7cc){if(!_0x11a7cc){_0x3d7631['sendStatus'](0x194);}return _0x11a7cc;};}function handleError(_0x1ad875,_0x598541){_0x598541=_0x598541||0x1f4;return function(_0x2806d0){logger[_0x3f2e('0x28')](_0x2806d0[_0x3f2e('0x29')]);if(_0x2806d0[_0x3f2e('0x2a')]){delete _0x2806d0[_0x3f2e('0x2a')];}_0x1ad875['status'](_0x598541)[_0x3f2e('0x2b')](_0x2806d0);};}exports[_0x3f2e('0x2c')]=function(_0x5eab38,_0x528063){var _0x2b9fda={},_0x1e5db4={},_0x35f421={'count':0x0,'rows':[]};var _0x22e6ad=_['map'](db[_0x3f2e('0x2d')][_0x3f2e('0x2e')],function(_0x37ddfe){return{'name':_0x37ddfe['fieldName'],'type':_0x37ddfe[_0x3f2e('0x2f')][_0x3f2e('0x30')]};});_0x1e5db4[_0x3f2e('0x31')]=_['map'](_0x22e6ad,_0x3f2e('0x2a'));_0x1e5db4[_0x3f2e('0x32')]=_[_0x3f2e('0x33')](_0x5eab38[_0x3f2e('0x32')]);_0x1e5db4[_0x3f2e('0x34')]=_[_0x3f2e('0x35')](_0x1e5db4['model'],_0x1e5db4[_0x3f2e('0x32')]);_0x2b9fda[_0x3f2e('0x36')]=_[_0x3f2e('0x35')](_0x1e5db4[_0x3f2e('0x31')],qs[_0x3f2e('0x37')](_0x5eab38[_0x3f2e('0x32')][_0x3f2e('0x37')]));_0x2b9fda['attributes']=_0x2b9fda[_0x3f2e('0x36')][_0x3f2e('0x38')]?_0x2b9fda[_0x3f2e('0x36')]:_0x1e5db4[_0x3f2e('0x31')];if(!_0x5eab38['query']['hasOwnProperty'](_0x3f2e('0x39'))){_0x2b9fda[_0x3f2e('0x24')]=qs[_0x3f2e('0x24')](_0x5eab38[_0x3f2e('0x32')][_0x3f2e('0x24')]);_0x2b9fda[_0x3f2e('0x22')]=qs[_0x3f2e('0x22')](_0x5eab38[_0x3f2e('0x32')][_0x3f2e('0x22')]);}_0x2b9fda[_0x3f2e('0x3a')]=qs['sort'](_0x5eab38[_0x3f2e('0x32')][_0x3f2e('0x3b')]);_0x2b9fda[_0x3f2e('0x3c')]=qs[_0x3f2e('0x34')](_['pick'](_0x5eab38[_0x3f2e('0x32')],_0x1e5db4[_0x3f2e('0x34')]),_0x22e6ad);if(_0x5eab38[_0x3f2e('0x32')][_0x3f2e('0x3d')]){_0x2b9fda[_0x3f2e('0x3c')]=_[_0x3f2e('0x3e')](_0x2b9fda[_0x3f2e('0x3c')],{'$or':_[_0x3f2e('0x3f')](_0x22e6ad,function(_0x4c5ac2){if(_0x4c5ac2[_0x3f2e('0x2f')]!==_0x3f2e('0x40')){var _0x238b6b={};_0x238b6b[_0x4c5ac2[_0x3f2e('0x2a')]]={'$like':'%'+_0x5eab38['query'][_0x3f2e('0x3d')]+'%'};return _0x238b6b;}})});}_0x2b9fda=_[_0x3f2e('0x3e')]({},_0x2b9fda,_0x5eab38['options']);var _0x3fc694={'where':_0x2b9fda[_0x3f2e('0x3c')]};return db['ChatQueueReport'][_0x3f2e('0x25')](_0x3fc694)[_0x3f2e('0x41')](function(_0x849236){_0x35f421[_0x3f2e('0x25')]=_0x849236;if(_0x5eab38['query'][_0x3f2e('0x42')]){_0x2b9fda[_0x3f2e('0x43')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x2b9fda);})[_0x3f2e('0x41')](function(_0x23de01){_0x35f421[_0x3f2e('0x44')]=_0x23de01;return _0x35f421;})['then'](respondWithFilteredResult(_0x528063,_0x2b9fda))[_0x3f2e('0x45')](handleError(_0x528063,null));};exports[_0x3f2e('0x46')]=function(_0x43b35a,_0xe9000a){var _0x24df56={'raw':!![],'where':{'id':_0x43b35a[_0x3f2e('0x47')]['id']}},_0x3668dc={};_0x3668dc[_0x3f2e('0x31')]=_[_0x3f2e('0x33')](db[_0x3f2e('0x2d')]['rawAttributes']);_0x3668dc['query']=_[_0x3f2e('0x33')](_0x43b35a[_0x3f2e('0x32')]);_0x3668dc['filters']=_['intersection'](_0x3668dc[_0x3f2e('0x31')],_0x3668dc[_0x3f2e('0x32')]);_0x24df56[_0x3f2e('0x36')]=_['intersection'](_0x3668dc[_0x3f2e('0x31')],qs[_0x3f2e('0x37')](_0x43b35a[_0x3f2e('0x32')]['fields']));_0x24df56[_0x3f2e('0x36')]=_0x24df56[_0x3f2e('0x36')][_0x3f2e('0x38')]?_0x24df56['attributes']:_0x3668dc[_0x3f2e('0x31')];if(_0x43b35a[_0x3f2e('0x32')][_0x3f2e('0x42')]){_0x24df56['include']=[{'all':!![]}];}_0x24df56=_[_0x3f2e('0x3e')]({},_0x24df56,_0x43b35a['options']);return db[_0x3f2e('0x2d')]['find'](_0x24df56)['then'](handleEntityNotFound(_0xe9000a,null))[_0x3f2e('0x41')](respondWithResult(_0xe9000a,null))[_0x3f2e('0x45')](handleError(_0xe9000a,null));};exports[_0x3f2e('0x48')]=function(_0x3d6fd2,_0x3e7fac){return db['ChatQueueReport']['create'](_0x3d6fd2[_0x3f2e('0x49')],{})[_0x3f2e('0x41')](respondWithResult(_0x3e7fac,0xc9))[_0x3f2e('0x45')](handleError(_0x3e7fac,null));};exports[_0x3f2e('0x4a')]=function(_0x39dbd1,_0xb891b2){if(_0x39dbd1[_0x3f2e('0x49')]['id']){delete _0x39dbd1[_0x3f2e('0x49')]['id'];}return db[_0x3f2e('0x2d')]['find']({'where':{'id':_0x39dbd1['params']['id']}})[_0x3f2e('0x41')](handleEntityNotFound(_0xb891b2,null))['then'](saveUpdates(_0x39dbd1[_0x3f2e('0x49')],null))[_0x3f2e('0x41')](respondWithResult(_0xb891b2,null))[_0x3f2e('0x45')](handleError(_0xb891b2,null));};exports[_0x3f2e('0x4b')]=function(_0x4b6950,_0xd871da){return db['ChatQueueReport'][_0x3f2e('0x4c')]({'where':{'id':_0x4b6950[_0x3f2e('0x47')]['id']}})['then'](handleEntityNotFound(_0xd871da,null))[_0x3f2e('0x41')](removeEntity(_0xd871da,null))['catch'](handleError(_0xd871da,null));};exports[_0x3f2e('0x4d')]=function(_0x336003,_0x9ccf3b){return db['ChatQueueReport'][_0x3f2e('0x4d')]()[_0x3f2e('0x41')](respondWithResult(_0x9ccf3b,null))[_0x3f2e('0x45')](handleError(_0x9ccf3b,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index e28a055..de108e5 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x5b2809,_0x48b226){var _0x572dee=function(_0x4b3e82){while(--_0x4b3e82){_0x5b2809['push'](_0x5b2809['shift']());}};_0x572dee(++_0x48b226);}(_0xb10b,0x12a));var _0xbb10=function(_0x56e60b,_0x3c1bdc){_0x56e60b=_0x56e60b-0x0;var _0x305ce1=_0xb10b[_0x56e60b];return _0x305ce1;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0xf37717,_0x5afacc){var _0x992835=function(_0x1d9e55){while(--_0x1d9e55){_0xf37717['push'](_0xf37717['shift']());}};_0x992835(++_0x5afacc);}(_0xe706,0xa3));var _0x6e70=function(_0xc23380,_0x18e158){_0xc23380=_0xc23380-0x0;var _0x4b1b26=_0xe706[_0xc23380];return _0x4b1b26;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index d316205..57d5eb7 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 _0x6743=['../../config/logger','../../config/environment','jayson/promise','client','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateChatQueueReport','ChatQueueReport','create','body','raw','catch','UpdateChatQueueReport','update','options','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x76be53,_0xc56b0f){var _0x20b7b7=function(_0x5847fd){while(--_0x5847fd){_0x76be53['push'](_0x76be53['shift']());}};_0x20b7b7(++_0xc56b0f);}(_0x6743,0xd0));var _0x3674=function(_0x1c2051,_0x4cb6b9){_0x1c2051=_0x1c2051-0x0;var _0x2b58a0=_0x6743[_0x1c2051];return _0x2b58a0;};'use strict';var _=require(_0x3674('0x0'));var util=require(_0x3674('0x1'));var moment=require(_0x3674('0x2'));var BPromise=require(_0x3674('0x3'));var rs=require(_0x3674('0x4'));var fs=require('fs');var Redis=require(_0x3674('0x5'));var db=require(_0x3674('0x6'))['db'];var utils=require(_0x3674('0x7'));var logger=require(_0x3674('0x8'))('rpc');var config=require(_0x3674('0x9'));var jayson=require(_0x3674('0xa'));var client=jayson[_0x3674('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3673b5,_0xe063ab,_0x46628){return new BPromise(function(_0xa634b2,_0x3382af){return client[_0x3674('0xc')](_0x3673b5,_0x46628)[_0x3674('0xd')](function(_0x2926d5){logger['info'](_0x3674('0xe'),_0xe063ab,_0x3674('0xf'));logger[_0x3674('0x10')](_0x3674('0x11'),_0xe063ab,_0x3674('0xf'),JSON[_0x3674('0x12')](_0x2926d5));if(_0x2926d5[_0x3674('0x13')]){if(_0x2926d5[_0x3674('0x13')][_0x3674('0x14')]===0x1f4){logger[_0x3674('0x13')](_0x3674('0xe'),_0xe063ab,_0x2926d5[_0x3674('0x13')][_0x3674('0x15')]);return _0x3382af(_0x2926d5[_0x3674('0x13')][_0x3674('0x15')]);}logger[_0x3674('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0xe063ab,_0x2926d5[_0x3674('0x13')][_0x3674('0x15')]);return _0xa634b2(_0x2926d5[_0x3674('0x13')][_0x3674('0x15')]);}else{logger[_0x3674('0x16')](_0x3674('0xe'),_0xe063ab,_0x3674('0xf'));_0xa634b2(_0x2926d5[_0x3674('0x17')][_0x3674('0x15')]);}})['catch'](function(_0x419649){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0xe063ab,_0x419649);_0x3382af(_0x419649);});});}exports[_0x3674('0x18')]=function(_0x633a88){var _0x1927b7=this;return new Promise(function(_0x58fe59,_0x37bcaa){return db[_0x3674('0x19')][_0x3674('0x1a')](_0x633a88[_0x3674('0x1b')],{'raw':_0x633a88['options']?_0x633a88['options'][_0x3674('0x1c')]===undefined?!![]:![]:!![]})[_0x3674('0xd')](function(_0x120b17){logger[_0x3674('0x16')](_0x3674('0x18'),_0x633a88);logger[_0x3674('0x10')](_0x3674('0x18'),_0x633a88,JSON[_0x3674('0x12')](_0x120b17));_0x58fe59(_0x120b17);})[_0x3674('0x1d')](function(_0x13c503){logger[_0x3674('0x13')](_0x3674('0x18'),_0x13c503[_0x3674('0x15')],_0x633a88);_0x37bcaa(_0x1927b7['error'](0x1f4,_0x13c503['message']));});});};exports[_0x3674('0x1e')]=function(_0x17b3c6){var _0x2f1da1=this;return new Promise(function(_0x2b63b4,_0x8eec8d){return db[_0x3674('0x19')][_0x3674('0x1f')](_0x17b3c6[_0x3674('0x1b')],{'raw':_0x17b3c6[_0x3674('0x20')]?_0x17b3c6[_0x3674('0x20')][_0x3674('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17b3c6['options']?_0x17b3c6[_0x3674('0x20')][_0x3674('0x21')]||null:null,'attributes':_0x17b3c6[_0x3674('0x20')]?_0x17b3c6[_0x3674('0x20')][_0x3674('0x22')]||null:null,'limit':_0x17b3c6[_0x3674('0x20')]?_0x17b3c6['options'][_0x3674('0x23')]||null:null})[_0x3674('0xd')](function(_0x544972){logger['info'](_0x3674('0x1e'),_0x17b3c6);logger[_0x3674('0x10')](_0x3674('0x1e'),_0x17b3c6,JSON[_0x3674('0x12')](_0x544972));_0x2b63b4(_0x544972);})[_0x3674('0x1d')](function(_0x408083){logger[_0x3674('0x13')](_0x3674('0x1e'),_0x408083[_0x3674('0x15')],_0x17b3c6);_0x8eec8d(_0x2f1da1[_0x3674('0x13')](0x1f4,_0x408083['message']));});});}; \ No newline at end of file +var _0xac11=['jayson/promise','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','options','CreateChatQueueReport','UpdateChatQueueReport','ChatQueueReport','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3a92ea,_0x2e84d2){var _0xfe2066=function(_0xc7c02f){while(--_0xc7c02f){_0x3a92ea['push'](_0x3a92ea['shift']());}};_0xfe2066(++_0x2e84d2);}(_0xac11,0x195));var _0x1ac1=function(_0x207736,_0x45c025){_0x207736=_0x207736-0x0;var _0x8784ce=_0xac11[_0x207736];return _0x8784ce;};'use strict';var _=require(_0x1ac1('0x0'));var util=require(_0x1ac1('0x1'));var moment=require(_0x1ac1('0x2'));var BPromise=require(_0x1ac1('0x3'));var rs=require(_0x1ac1('0x4'));var fs=require('fs');var Redis=require(_0x1ac1('0x5'));var db=require(_0x1ac1('0x6'))['db'];var utils=require(_0x1ac1('0x7'));var logger=require(_0x1ac1('0x8'))(_0x1ac1('0x9'));var config=require(_0x1ac1('0xa'));var jayson=require(_0x1ac1('0xb'));var client=jayson['client'][_0x1ac1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xeec73c,_0x3e922b,_0x5d114e){return new BPromise(function(_0x4a0369,_0x45320c){return client['request'](_0xeec73c,_0x5d114e)[_0x1ac1('0xd')](function(_0x30960b){logger[_0x1ac1('0xe')](_0x1ac1('0xf'),_0x3e922b,_0x1ac1('0x10'));logger[_0x1ac1('0x11')](_0x1ac1('0x12'),_0x3e922b,_0x1ac1('0x10'),JSON[_0x1ac1('0x13')](_0x30960b));if(_0x30960b['error']){if(_0x30960b[_0x1ac1('0x14')][_0x1ac1('0x15')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3e922b,_0x30960b[_0x1ac1('0x14')][_0x1ac1('0x16')]);return _0x45320c(_0x30960b['error'][_0x1ac1('0x16')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3e922b,_0x30960b[_0x1ac1('0x14')][_0x1ac1('0x16')]);return _0x4a0369(_0x30960b[_0x1ac1('0x14')]['message']);}else{logger[_0x1ac1('0xe')](_0x1ac1('0xf'),_0x3e922b,_0x1ac1('0x10'));_0x4a0369(_0x30960b[_0x1ac1('0x17')][_0x1ac1('0x16')]);}})[_0x1ac1('0x18')](function(_0x2b3128){logger[_0x1ac1('0x14')](_0x1ac1('0xf'),_0x3e922b,_0x2b3128);_0x45320c(_0x2b3128);});});}exports['CreateChatQueueReport']=function(_0x4f0126){var _0x2c6975=this;return new Promise(function(_0x2361c0,_0x3fe008){return db['ChatQueueReport'][_0x1ac1('0x19')](_0x4f0126['body'],{'raw':_0x4f0126[_0x1ac1('0x1a')]?_0x4f0126['options']['raw']===undefined?!![]:![]:!![]})[_0x1ac1('0xd')](function(_0x1dc3c3){logger['info']('CreateChatQueueReport',_0x4f0126);logger[_0x1ac1('0x11')](_0x1ac1('0x1b'),_0x4f0126,JSON[_0x1ac1('0x13')](_0x1dc3c3));_0x2361c0(_0x1dc3c3);})[_0x1ac1('0x18')](function(_0x154e6c){logger[_0x1ac1('0x14')]('CreateChatQueueReport',_0x154e6c['message'],_0x4f0126);_0x3fe008(_0x2c6975['error'](0x1f4,_0x154e6c[_0x1ac1('0x16')]));});});};exports[_0x1ac1('0x1c')]=function(_0x2c2bd0){var _0x28b387=this;return new Promise(function(_0x2568d5,_0x42cbc8){return db[_0x1ac1('0x1d')]['update'](_0x2c2bd0['body'],{'raw':_0x2c2bd0[_0x1ac1('0x1a')]?_0x2c2bd0['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c2bd0['options']?_0x2c2bd0[_0x1ac1('0x1a')][_0x1ac1('0x1e')]||null:null,'attributes':_0x2c2bd0['options']?_0x2c2bd0[_0x1ac1('0x1a')][_0x1ac1('0x1f')]||null:null,'limit':_0x2c2bd0[_0x1ac1('0x1a')]?_0x2c2bd0[_0x1ac1('0x1a')]['limit']||null:null})[_0x1ac1('0xd')](function(_0x30d5dc){logger['info'](_0x1ac1('0x1c'),_0x2c2bd0);logger['debug']('UpdateChatQueueReport',_0x2c2bd0,JSON[_0x1ac1('0x13')](_0x30d5dc));_0x2568d5(_0x30d5dc);})[_0x1ac1('0x18')](function(_0x58a930){logger[_0x1ac1('0x14')](_0x1ac1('0x1c'),_0x58a930[_0x1ac1('0x16')],_0x2c2bd0);_0x42cbc8(_0x28b387[_0x1ac1('0x14')](0x1f4,_0x58a930[_0x1ac1('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 1ea58f3..42c2e30 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 _0xf634=['/:id','show','post','create','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x72895a,_0x433607){var _0x5226d5=function(_0x5b7d21){while(--_0x5b7d21){_0x72895a['push'](_0x72895a['shift']());}};_0x5226d5(++_0x433607);}(_0xf634,0xaa));var _0x4f63=function(_0x54baf2,_0x55634f){_0x54baf2=_0x54baf2-0x0;var _0x444410=_0xf634[_0x54baf2];return _0x444410;};'use strict';var multer=require(_0x4f63('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f63('0x1'));var express=require(_0x4f63('0x2'));var router=express[_0x4f63('0x3')]();var fs_extra=require(_0x4f63('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4f63('0x5'));var config=require(_0x4f63('0x6'));var controller=require('./chatQueueReport.controller');router[_0x4f63('0x7')]('/',auth[_0x4f63('0x8')](),controller[_0x4f63('0x9')]);router['get']('/describe',auth[_0x4f63('0x8')](),controller['describe']);router[_0x4f63('0x7')](_0x4f63('0xa'),auth['isAuthenticated'](),controller[_0x4f63('0xb')]);router[_0x4f63('0xc')]('/',auth[_0x4f63('0x8')](),controller[_0x4f63('0xd')]);router['put'](_0x4f63('0xa'),auth[_0x4f63('0x8')](),controller[_0x4f63('0xe')]);router[_0x4f63('0xf')](_0x4f63('0xa'),auth['isAuthenticated'](),controller[_0x4f63('0x10')]);module[_0x4f63('0x11')]=router; \ No newline at end of file +var _0x2a5d=['./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','destroy','multer','util','path','express','Router','../../components/auth/service'];(function(_0x3ee005,_0x3f332c){var _0x52c52b=function(_0xf3169c){while(--_0xf3169c){_0x3ee005['push'](_0x3ee005['shift']());}};_0x52c52b(++_0x3f332c);}(_0x2a5d,0x19a));var _0xd2a5=function(_0x4c2f17,_0x5c6821){_0x4c2f17=_0x4c2f17-0x0;var _0x20919e=_0x2a5d[_0x4c2f17];return _0x20919e;};'use strict';var multer=require(_0xd2a5('0x0'));var util=require(_0xd2a5('0x1'));var path=require(_0xd2a5('0x2'));var timeout=require('connect-timeout');var express=require(_0xd2a5('0x3'));var router=express[_0xd2a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd2a5('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd2a5('0x6'));router[_0xd2a5('0x7')]('/',auth[_0xd2a5('0x8')](),controller[_0xd2a5('0x9')]);router[_0xd2a5('0x7')](_0xd2a5('0xa'),auth[_0xd2a5('0x8')](),controller[_0xd2a5('0xb')]);router['get'](_0xd2a5('0xc'),auth[_0xd2a5('0x8')](),controller[_0xd2a5('0xd')]);router['post']('/',auth[_0xd2a5('0x8')](),controller['create']);router[_0xd2a5('0xe')]('/:id',auth[_0xd2a5('0x8')](),controller['update']);router['delete']('/:id',auth[_0xd2a5('0x8')](),controller[_0xd2a5('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index b60e560..a8c950c 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x116574,_0x1bab27){var _0x232612=function(_0xeaca39){while(--_0xeaca39){_0x116574['push'](_0x116574['shift']());}};_0x232612(++_0x1bab27);}(_0xedd9,0xfc));var _0x9edd=function(_0x3e646e,_0x1e30a8){_0x3e646e=_0x3e646e-0x0;var _0xd997cc=_0xedd9[_0x3e646e];return _0xd997cc;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x26adda,_0x215619){var _0x72f884=function(_0x16c706){while(--_0x16c706){_0x26adda['push'](_0x26adda['shift']());}};_0x72f884(++_0x215619);}(_0x70e0,0x17b));var _0x070e=function(_0x358ff9,_0x56724b){_0x358ff9=_0x358ff9-0x0;var _0x2a9165=_0x70e0[_0x358ff9];return _0x2a9165;};'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 7dc189a..dbacac7 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 _0x5446=['options','findAll','rows','catch','show','length','includeAll','include','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','destroy','then','end','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','pick','where','VIRTUAL','merge'];(function(_0x1d128e,_0x2c87de){var _0x3d5236=function(_0x2374ff){while(--_0x2374ff){_0x1d128e['push'](_0x1d128e['shift']());}};_0x3d5236(++_0x2c87de);}(_0x5446,0xfa));var _0x6544=function(_0x57c0a6,_0x7f1ca2){_0x57c0a6=_0x57c0a6-0x0;var _0xf821cd=_0x5446[_0x57c0a6];return _0xf821cd;};'use strict';var emlformat=require(_0x6544('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6544('0x1'));var jsonpatch=require(_0x6544('0x2'));var rp=require(_0x6544('0x3'));var moment=require('moment');var BPromise=require(_0x6544('0x4'));var Mustache=require(_0x6544('0x5'));var util=require(_0x6544('0x6'));var path=require(_0x6544('0x7'));var sox=require(_0x6544('0x8'));var csv=require(_0x6544('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6544('0xa'));var _=require(_0x6544('0xb'));var squel=require(_0x6544('0xc'));var crypto=require('crypto');var jsforce=require(_0x6544('0xd'));var deskjs=require(_0x6544('0xe'));var toCsv=require(_0x6544('0x9'));var querystring=require(_0x6544('0xf'));var Papa=require(_0x6544('0x10'));var Redis=require(_0x6544('0x11'));var authService=require(_0x6544('0x12'));var qs=require(_0x6544('0x13'));var as=require(_0x6544('0x14'));var hardwareService=require(_0x6544('0x15'));var logger=require(_0x6544('0x16'))(_0x6544('0x17'));var utils=require(_0x6544('0x18'));var config=require(_0x6544('0x19'));var licenseUtil=require(_0x6544('0x1a'));var db=require(_0x6544('0x1b'))['db'];function respondWithStatusCode(_0x15d71f,_0x37ea6d){_0x37ea6d=_0x37ea6d||0xcc;return function(_0x48494a){if(_0x48494a){return _0x15d71f[_0x6544('0x1c')](_0x37ea6d);}return _0x15d71f[_0x6544('0x1d')](_0x37ea6d)['end']();};}function respondWithResult(_0x175774,_0x4f9b5f){_0x4f9b5f=_0x4f9b5f||0xc8;return function(_0x192425){if(_0x192425){return _0x175774[_0x6544('0x1d')](_0x4f9b5f)[_0x6544('0x1e')](_0x192425);}};}function respondWithFilteredResult(_0x3fe4c7,_0x4ba734){return function(_0x113a0e){if(_0x113a0e){var _0x36ae42=typeof _0x4ba734['offset']==='undefined'&&typeof _0x4ba734[_0x6544('0x1f')]===_0x6544('0x20');var _0x49a287=_0x113a0e[_0x6544('0x21')];var _0x3f0903=_0x36ae42?0x0:_0x4ba734[_0x6544('0x22')];var _0x56c7d1=_0x36ae42?_0x113a0e['count']:_0x4ba734[_0x6544('0x22')]+_0x4ba734[_0x6544('0x1f')];var _0x660ea3;if(_0x56c7d1>=_0x49a287){_0x56c7d1=_0x49a287;_0x660ea3=0xc8;}else{_0x660ea3=0xce;}_0x3fe4c7['status'](_0x660ea3);return _0x3fe4c7[_0x6544('0x23')](_0x6544('0x24'),_0x3f0903+'-'+_0x56c7d1+'/'+_0x49a287)[_0x6544('0x1e')](_0x113a0e);}return null;};}function patchUpdates(_0x36e207){return function(_0x29b1a0){try{jsonpatch[_0x6544('0x25')](_0x29b1a0,_0x36e207,!![]);}catch(_0x2bc1e1){return BPromise['reject'](_0x2bc1e1);}return _0x29b1a0[_0x6544('0x26')]();};}function saveUpdates(_0x4b3d92,_0x567bc4){return function(_0x22ebfd){if(_0x22ebfd){return _0x22ebfd[_0x6544('0x27')](_0x4b3d92)['then'](function(_0xc72b81){return _0xc72b81;});}return null;};}function removeEntity(_0x9dd795,_0x29b73f){return function(_0x5f3cce){if(_0x5f3cce){return _0x5f3cce[_0x6544('0x28')]()[_0x6544('0x29')](function(){_0x9dd795['status'](0xcc)[_0x6544('0x2a')]();});}};}function handleEntityNotFound(_0x1968e8,_0x540711){return function(_0x33b2be){if(!_0x33b2be){_0x1968e8[_0x6544('0x1c')](0x194);}return _0x33b2be;};}function handleError(_0x31d0b4,_0x411cc7){_0x411cc7=_0x411cc7||0x1f4;return function(_0x1ad036){logger['error'](_0x1ad036[_0x6544('0x2b')]);if(_0x1ad036[_0x6544('0x2c')]){delete _0x1ad036[_0x6544('0x2c')];}_0x31d0b4[_0x6544('0x1d')](_0x411cc7)[_0x6544('0x2d')](_0x1ad036);};}exports[_0x6544('0x2e')]=function(_0xf46f07,_0x4707cc){var _0x4bbdcc={},_0x4dad47={},_0x209ee0={'count':0x0,'rows':[]};var _0x3ba0bb=_[_0x6544('0x2f')](db[_0x6544('0x30')][_0x6544('0x31')],function(_0x48deae){return{'name':_0x48deae[_0x6544('0x32')],'type':_0x48deae[_0x6544('0x33')][_0x6544('0x34')]};});_0x4dad47[_0x6544('0x35')]=_[_0x6544('0x2f')](_0x3ba0bb,_0x6544('0x2c'));_0x4dad47[_0x6544('0x36')]=_[_0x6544('0x37')](_0xf46f07[_0x6544('0x36')]);_0x4dad47[_0x6544('0x38')]=_['intersection'](_0x4dad47[_0x6544('0x35')],_0x4dad47[_0x6544('0x36')]);_0x4bbdcc[_0x6544('0x39')]=_[_0x6544('0x3a')](_0x4dad47[_0x6544('0x35')],qs['fields'](_0xf46f07['query'][_0x6544('0x3b')]));_0x4bbdcc[_0x6544('0x39')]=_0x4bbdcc['attributes']['length']?_0x4bbdcc[_0x6544('0x39')]:_0x4dad47[_0x6544('0x35')];if(!_0xf46f07[_0x6544('0x36')]['hasOwnProperty'](_0x6544('0x3c'))){_0x4bbdcc[_0x6544('0x1f')]=qs[_0x6544('0x1f')](_0xf46f07[_0x6544('0x36')]['limit']);_0x4bbdcc[_0x6544('0x22')]=qs[_0x6544('0x22')](_0xf46f07[_0x6544('0x36')]['offset']);}_0x4bbdcc['order']=qs[_0x6544('0x3d')](_0xf46f07[_0x6544('0x36')]['sort']);_0x4bbdcc['where']=qs[_0x6544('0x38')](_[_0x6544('0x3e')](_0xf46f07['query'],_0x4dad47[_0x6544('0x38')]),_0x3ba0bb);if(_0xf46f07[_0x6544('0x36')]['filter']){_0x4bbdcc[_0x6544('0x3f')]=_['merge'](_0x4bbdcc[_0x6544('0x3f')],{'$or':_[_0x6544('0x2f')](_0x3ba0bb,function(_0x122ce1){if(_0x122ce1[_0x6544('0x33')]!==_0x6544('0x40')){var _0x1983c9={};_0x1983c9[_0x122ce1[_0x6544('0x2c')]]={'$like':'%'+_0xf46f07[_0x6544('0x36')]['filter']+'%'};return _0x1983c9;}})});}_0x4bbdcc=_[_0x6544('0x41')]({},_0x4bbdcc,_0xf46f07[_0x6544('0x42')]);var _0x3a62b3={'where':_0x4bbdcc[_0x6544('0x3f')]};return db[_0x6544('0x30')][_0x6544('0x21')](_0x3a62b3)[_0x6544('0x29')](function(_0x1beccc){_0x209ee0['count']=_0x1beccc;if(_0xf46f07['query']['includeAll']){_0x4bbdcc['include']=[{'all':!![]}];}return db[_0x6544('0x30')][_0x6544('0x43')](_0x4bbdcc);})['then'](function(_0x352db4){_0x209ee0[_0x6544('0x44')]=_0x352db4;return _0x209ee0;})[_0x6544('0x29')](respondWithFilteredResult(_0x4707cc,_0x4bbdcc))[_0x6544('0x45')](handleError(_0x4707cc,null));};exports[_0x6544('0x46')]=function(_0x2563f1,_0x6662eb){var _0x6cd30d={'raw':!![],'where':{'id':_0x2563f1['params']['id']}},_0x33d9fe={};_0x33d9fe[_0x6544('0x35')]=_[_0x6544('0x37')](db[_0x6544('0x30')]['rawAttributes']);_0x33d9fe[_0x6544('0x36')]=_[_0x6544('0x37')](_0x2563f1[_0x6544('0x36')]);_0x33d9fe['filters']=_[_0x6544('0x3a')](_0x33d9fe[_0x6544('0x35')],_0x33d9fe['query']);_0x6cd30d[_0x6544('0x39')]=_[_0x6544('0x3a')](_0x33d9fe[_0x6544('0x35')],qs[_0x6544('0x3b')](_0x2563f1[_0x6544('0x36')]['fields']));_0x6cd30d[_0x6544('0x39')]=_0x6cd30d[_0x6544('0x39')][_0x6544('0x47')]?_0x6cd30d[_0x6544('0x39')]:_0x33d9fe[_0x6544('0x35')];if(_0x2563f1['query'][_0x6544('0x48')]){_0x6cd30d[_0x6544('0x49')]=[{'all':!![]}];}_0x6cd30d=_[_0x6544('0x41')]({},_0x6cd30d,_0x2563f1['options']);return db[_0x6544('0x30')][_0x6544('0x4a')](_0x6cd30d)[_0x6544('0x29')](handleEntityNotFound(_0x6662eb,null))[_0x6544('0x29')](respondWithResult(_0x6662eb,null))['catch'](handleError(_0x6662eb,null));};exports[_0x6544('0x4b')]=function(_0x31050b,_0x10dab1){return db[_0x6544('0x30')]['create'](_0x31050b[_0x6544('0x4c')],{})[_0x6544('0x29')](respondWithResult(_0x10dab1,0xc9))[_0x6544('0x45')](handleError(_0x10dab1,null));};exports[_0x6544('0x27')]=function(_0x3d39b2,_0x1565dc){if(_0x3d39b2[_0x6544('0x4c')]['id']){delete _0x3d39b2[_0x6544('0x4c')]['id'];}return db[_0x6544('0x30')]['find']({'where':{'id':_0x3d39b2['params']['id']}})['then'](handleEntityNotFound(_0x1565dc,null))[_0x6544('0x29')](saveUpdates(_0x3d39b2[_0x6544('0x4c')],null))['then'](respondWithResult(_0x1565dc,null))[_0x6544('0x45')](handleError(_0x1565dc,null));};exports['destroy']=function(_0xbaf611,_0x231f00){return db[_0x6544('0x30')][_0x6544('0x4a')]({'where':{'id':_0xbaf611[_0x6544('0x4d')]['id']}})[_0x6544('0x29')](handleEntityNotFound(_0x231f00,null))[_0x6544('0x29')](removeEntity(_0x231f00,null))[_0x6544('0x45')](handleError(_0x231f00,null));};exports[_0x6544('0x4e')]=function(_0x2d0ea8,_0x4f3043){return db[_0x6544('0x30')][_0x6544('0x4e')]()[_0x6544('0x29')](respondWithResult(_0x4f3043,null))[_0x6544('0x45')](handleError(_0x4f3043,null));}; \ No newline at end of file +var _0xcede=['ChatTransferReport','fieldName','type','key','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','options','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','end','error','name','send'];(function(_0x2aec07,_0xe18447){var _0x59ffb0=function(_0x31fb02){while(--_0x31fb02){_0x2aec07['push'](_0x2aec07['shift']());}};_0x59ffb0(++_0xe18447);}(_0xcede,0x1dc));var _0xeced=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xcede[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeced('0x0'));var zipdir=require(_0xeced('0x1'));var jsonpatch=require(_0xeced('0x2'));var rp=require(_0xeced('0x3'));var moment=require(_0xeced('0x4'));var BPromise=require(_0xeced('0x5'));var Mustache=require('mustache');var util=require(_0xeced('0x6'));var path=require('path');var sox=require(_0xeced('0x7'));var csv=require(_0xeced('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeced('0x9'));var _=require(_0xeced('0xa'));var squel=require(_0xeced('0xb'));var crypto=require(_0xeced('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xeced('0xd'));var toCsv=require('to-csv');var querystring=require(_0xeced('0xe'));var Papa=require(_0xeced('0xf'));var Redis=require(_0xeced('0x10'));var authService=require(_0xeced('0x11'));var qs=require(_0xeced('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xeced('0x13'))(_0xeced('0x14'));var utils=require(_0xeced('0x15'));var config=require(_0xeced('0x16'));var licenseUtil=require(_0xeced('0x17'));var db=require(_0xeced('0x18'))['db'];function respondWithStatusCode(_0x5bdc2c,_0x2df9a2){_0x2df9a2=_0x2df9a2||0xcc;return function(_0x474174){if(_0x474174){return _0x5bdc2c[_0xeced('0x19')](_0x2df9a2);}return _0x5bdc2c['status'](_0x2df9a2)['end']();};}function respondWithResult(_0x44ae16,_0x1a14ff){_0x1a14ff=_0x1a14ff||0xc8;return function(_0x2ecb52){if(_0x2ecb52){return _0x44ae16[_0xeced('0x1a')](_0x1a14ff)['json'](_0x2ecb52);}};}function respondWithFilteredResult(_0x33e5fa,_0x45a0b9){return function(_0x31c1d3){if(_0x31c1d3){var _0x1d3b1e=typeof _0x45a0b9[_0xeced('0x1b')]===_0xeced('0x1c')&&typeof _0x45a0b9[_0xeced('0x1d')]==='undefined';var _0x59f852=_0x31c1d3[_0xeced('0x1e')];var _0x10dadb=_0x1d3b1e?0x0:_0x45a0b9[_0xeced('0x1b')];var _0x2f989b=_0x1d3b1e?_0x31c1d3[_0xeced('0x1e')]:_0x45a0b9[_0xeced('0x1b')]+_0x45a0b9[_0xeced('0x1d')];var _0x480749;if(_0x2f989b>=_0x59f852){_0x2f989b=_0x59f852;_0x480749=0xc8;}else{_0x480749=0xce;}_0x33e5fa[_0xeced('0x1a')](_0x480749);return _0x33e5fa['set'](_0xeced('0x1f'),_0x10dadb+'-'+_0x2f989b+'/'+_0x59f852)[_0xeced('0x20')](_0x31c1d3);}return null;};}function patchUpdates(_0x1293ec){return function(_0x40a9e8){try{jsonpatch[_0xeced('0x21')](_0x40a9e8,_0x1293ec,!![]);}catch(_0x3b1e7c){return BPromise['reject'](_0x3b1e7c);}return _0x40a9e8[_0xeced('0x22')]();};}function saveUpdates(_0xb24f8d,_0x8fa108){return function(_0x20a6b5){if(_0x20a6b5){return _0x20a6b5[_0xeced('0x23')](_0xb24f8d)[_0xeced('0x24')](function(_0x27187a){return _0x27187a;});}return null;};}function removeEntity(_0x281e3a,_0x3000e8){return function(_0x64d68e){if(_0x64d68e){return _0x64d68e[_0xeced('0x25')]()[_0xeced('0x24')](function(){_0x281e3a[_0xeced('0x1a')](0xcc)[_0xeced('0x26')]();});}};}function handleEntityNotFound(_0x5b5e6e,_0x1a2884){return function(_0x27972c){if(!_0x27972c){_0x5b5e6e[_0xeced('0x19')](0x194);}return _0x27972c;};}function handleError(_0x34a0db,_0x190d24){_0x190d24=_0x190d24||0x1f4;return function(_0x17e536){logger[_0xeced('0x27')](_0x17e536['stack']);if(_0x17e536[_0xeced('0x28')]){delete _0x17e536[_0xeced('0x28')];}_0x34a0db[_0xeced('0x1a')](_0x190d24)[_0xeced('0x29')](_0x17e536);};}exports['index']=function(_0x55ec84,_0xaf6810){var _0x2cefcd={},_0xc74cdf={},_0x177eb1={'count':0x0,'rows':[]};var _0x1961e9=_['map'](db[_0xeced('0x2a')]['rawAttributes'],function(_0x341b82){return{'name':_0x341b82[_0xeced('0x2b')],'type':_0x341b82[_0xeced('0x2c')][_0xeced('0x2d')]};});_0xc74cdf[_0xeced('0x2e')]=_[_0xeced('0x2f')](_0x1961e9,_0xeced('0x28'));_0xc74cdf[_0xeced('0x30')]=_[_0xeced('0x31')](_0x55ec84[_0xeced('0x30')]);_0xc74cdf[_0xeced('0x32')]=_['intersection'](_0xc74cdf[_0xeced('0x2e')],_0xc74cdf[_0xeced('0x30')]);_0x2cefcd['attributes']=_['intersection'](_0xc74cdf['model'],qs[_0xeced('0x33')](_0x55ec84[_0xeced('0x30')][_0xeced('0x33')]));_0x2cefcd[_0xeced('0x34')]=_0x2cefcd[_0xeced('0x34')][_0xeced('0x35')]?_0x2cefcd[_0xeced('0x34')]:_0xc74cdf[_0xeced('0x2e')];if(!_0x55ec84['query'][_0xeced('0x36')]('nolimit')){_0x2cefcd[_0xeced('0x1d')]=qs[_0xeced('0x1d')](_0x55ec84[_0xeced('0x30')]['limit']);_0x2cefcd[_0xeced('0x1b')]=qs[_0xeced('0x1b')](_0x55ec84[_0xeced('0x30')][_0xeced('0x1b')]);}_0x2cefcd['order']=qs[_0xeced('0x37')](_0x55ec84[_0xeced('0x30')][_0xeced('0x37')]);_0x2cefcd[_0xeced('0x38')]=qs[_0xeced('0x32')](_[_0xeced('0x39')](_0x55ec84[_0xeced('0x30')],_0xc74cdf[_0xeced('0x32')]),_0x1961e9);if(_0x55ec84[_0xeced('0x30')][_0xeced('0x3a')]){_0x2cefcd['where']=_[_0xeced('0x3b')](_0x2cefcd[_0xeced('0x38')],{'$or':_[_0xeced('0x2f')](_0x1961e9,function(_0x2de84f){if(_0x2de84f['type']!=='VIRTUAL'){var _0x171c39={};_0x171c39[_0x2de84f['name']]={'$like':'%'+_0x55ec84['query'][_0xeced('0x3a')]+'%'};return _0x171c39;}})});}_0x2cefcd=_['merge']({},_0x2cefcd,_0x55ec84['options']);var _0x112909={'where':_0x2cefcd['where']};return db['ChatTransferReport'][_0xeced('0x1e')](_0x112909)['then'](function(_0x550bcd){_0x177eb1[_0xeced('0x1e')]=_0x550bcd;if(_0x55ec84['query'][_0xeced('0x3c')]){_0x2cefcd[_0xeced('0x3d')]=[{'all':!![]}];}return db[_0xeced('0x2a')][_0xeced('0x3e')](_0x2cefcd);})['then'](function(_0x189a8a){_0x177eb1[_0xeced('0x3f')]=_0x189a8a;return _0x177eb1;})['then'](respondWithFilteredResult(_0xaf6810,_0x2cefcd))[_0xeced('0x40')](handleError(_0xaf6810,null));};exports[_0xeced('0x41')]=function(_0x110fc8,_0xc9cbbf){var _0x446ec1={'raw':!![],'where':{'id':_0x110fc8[_0xeced('0x42')]['id']}},_0x1675a0={};_0x1675a0[_0xeced('0x2e')]=_[_0xeced('0x31')](db['ChatTransferReport'][_0xeced('0x43')]);_0x1675a0[_0xeced('0x30')]=_[_0xeced('0x31')](_0x110fc8[_0xeced('0x30')]);_0x1675a0[_0xeced('0x32')]=_[_0xeced('0x44')](_0x1675a0[_0xeced('0x2e')],_0x1675a0[_0xeced('0x30')]);_0x446ec1[_0xeced('0x34')]=_['intersection'](_0x1675a0[_0xeced('0x2e')],qs[_0xeced('0x33')](_0x110fc8['query'][_0xeced('0x33')]));_0x446ec1[_0xeced('0x34')]=_0x446ec1[_0xeced('0x34')][_0xeced('0x35')]?_0x446ec1[_0xeced('0x34')]:_0x1675a0[_0xeced('0x2e')];if(_0x110fc8[_0xeced('0x30')][_0xeced('0x3c')]){_0x446ec1[_0xeced('0x3d')]=[{'all':!![]}];}_0x446ec1=_[_0xeced('0x3b')]({},_0x446ec1,_0x110fc8[_0xeced('0x45')]);return db['ChatTransferReport']['find'](_0x446ec1)[_0xeced('0x24')](handleEntityNotFound(_0xc9cbbf,null))[_0xeced('0x24')](respondWithResult(_0xc9cbbf,null))['catch'](handleError(_0xc9cbbf,null));};exports[_0xeced('0x46')]=function(_0x385781,_0xc2747f){return db[_0xeced('0x2a')]['create'](_0x385781[_0xeced('0x47')],{})[_0xeced('0x24')](respondWithResult(_0xc2747f,0xc9))[_0xeced('0x40')](handleError(_0xc2747f,null));};exports['update']=function(_0x4f13a8,_0x426622){if(_0x4f13a8[_0xeced('0x47')]['id']){delete _0x4f13a8[_0xeced('0x47')]['id'];}return db[_0xeced('0x2a')]['find']({'where':{'id':_0x4f13a8[_0xeced('0x42')]['id']}})[_0xeced('0x24')](handleEntityNotFound(_0x426622,null))[_0xeced('0x24')](saveUpdates(_0x4f13a8['body'],null))[_0xeced('0x24')](respondWithResult(_0x426622,null))[_0xeced('0x40')](handleError(_0x426622,null));};exports[_0xeced('0x25')]=function(_0x49d788,_0x140717){return db[_0xeced('0x2a')][_0xeced('0x48')]({'where':{'id':_0x49d788[_0xeced('0x42')]['id']}})[_0xeced('0x24')](handleEntityNotFound(_0x140717,null))[_0xeced('0x24')](removeEntity(_0x140717,null))[_0xeced('0x40')](handleError(_0x140717,null));};exports[_0xeced('0x49')]=function(_0x51367e,_0x310317){return db[_0xeced('0x2a')]['describe']()['then'](respondWithResult(_0x310317,null))['catch'](handleError(_0x310317,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index a6a1e9c..c87da25 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 _0x6310=['../../config/environment','./chatTransferReport.attributes','define','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6310,0xc7));var _0x0631=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x6310[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0x0631('0x0'));var util=require(_0x0631('0x1'));var logger=require(_0x0631('0x2'))(_0x0631('0x3'));var moment=require(_0x0631('0x4'));var BPromise=require(_0x0631('0x5'));var rp=require(_0x0631('0x6'));var fs=require('fs');var path=require(_0x0631('0x7'));var rimraf=require(_0x0631('0x8'));var config=require(_0x0631('0x9'));var attributes=require(_0x0631('0xa'));module['exports']=function(_0x18532e,_0xd45d63){return _0x18532e[_0x0631('0xb')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x0631('0xc'),'fields':[_0x0631('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc1fd=['bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x4bbc69,_0x296386){var _0x5cdb40=function(_0x25e087){while(--_0x25e087){_0x4bbc69['push'](_0x4bbc69['shift']());}};_0x5cdb40(++_0x296386);}(_0xc1fd,0x173));var _0xdc1f=function(_0x144830,_0x4c1671){_0x144830=_0x144830-0x0;var _0x5f378d=_0xc1fd[_0x144830];return _0x5f378d;};'use strict';var _=require(_0xdc1f('0x0'));var util=require(_0xdc1f('0x1'));var logger=require(_0xdc1f('0x2'))(_0xdc1f('0x3'));var moment=require('moment');var BPromise=require(_0xdc1f('0x4'));var rp=require(_0xdc1f('0x5'));var fs=require('fs');var path=require(_0xdc1f('0x6'));var rimraf=require(_0xdc1f('0x7'));var config=require(_0xdc1f('0x8'));var attributes=require(_0xdc1f('0x9'));module[_0xdc1f('0xa')]=function(_0x508c60,_0x1878ce){return _0x508c60[_0xdc1f('0xb')](_0xdc1f('0xc'),attributes,{'tableName':_0xdc1f('0xd'),'paranoid':![],'indexes':[{'name':_0xdc1f('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index b51c399..a4d6dbd 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 _0x13c2=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0xdfdffa,_0x142945){var _0x23891b=function(_0x4b37f6){while(--_0x4b37f6){_0xdfdffa['push'](_0xdfdffa['shift']());}};_0x23891b(++_0x142945);}(_0x13c2,0x1f3));var _0x213c=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x13c2[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0x213c('0x0'));var util=require(_0x213c('0x1'));var moment=require(_0x213c('0x2'));var BPromise=require(_0x213c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x213c('0x4'));var db=require(_0x213c('0x5'))['db'];var utils=require(_0x213c('0x6'));var logger=require(_0x213c('0x7'))('rpc');var config=require(_0x213c('0x8'));var jayson=require(_0x213c('0x9'));var client=jayson['client'][_0x213c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc3d9ae,_0x5b5ae6,_0x1e794d){return new BPromise(function(_0x3ad548,_0x28e5d8){return client[_0x213c('0xb')](_0xc3d9ae,_0x1e794d)[_0x213c('0xc')](function(_0x52a747){logger[_0x213c('0xd')](_0x213c('0xe'),_0x5b5ae6,_0x213c('0xf'));logger[_0x213c('0x10')](_0x213c('0x11'),_0x5b5ae6,_0x213c('0xf'),JSON[_0x213c('0x12')](_0x52a747));if(_0x52a747[_0x213c('0x13')]){if(_0x52a747[_0x213c('0x13')][_0x213c('0x14')]===0x1f4){logger['error'](_0x213c('0xe'),_0x5b5ae6,_0x52a747['error'][_0x213c('0x15')]);return _0x28e5d8(_0x52a747[_0x213c('0x13')]['message']);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x5b5ae6,_0x52a747['error'][_0x213c('0x15')]);return _0x3ad548(_0x52a747[_0x213c('0x13')][_0x213c('0x15')]);}else{logger[_0x213c('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x5b5ae6,_0x213c('0xf'));_0x3ad548(_0x52a747[_0x213c('0x16')]['message']);}})[_0x213c('0x17')](function(_0x13ac82){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x5b5ae6,_0x13ac82);_0x28e5d8(_0x13ac82);});});} \ No newline at end of file +var _0xba8b=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash'];(function(_0x340c40,_0x1aaf30){var _0x1ecba3=function(_0x398fa6){while(--_0x398fa6){_0x340c40['push'](_0x340c40['shift']());}};_0x1ecba3(++_0x1aaf30);}(_0xba8b,0xc5));var _0xbba8=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xba8b[_0x45783c];return _0x1161da;};'use strict';var _=require(_0xbba8('0x0'));var util=require(_0xbba8('0x1'));var moment=require('moment');var BPromise=require(_0xbba8('0x2'));var rs=require(_0xbba8('0x3'));var fs=require('fs');var Redis=require(_0xbba8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbba8('0x5'));var logger=require(_0xbba8('0x6'))(_0xbba8('0x7'));var config=require(_0xbba8('0x8'));var jayson=require(_0xbba8('0x9'));var client=jayson['client'][_0xbba8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12a03a,_0x556190,_0x5a763e){return new BPromise(function(_0xae0a41,_0x22c607){return client['request'](_0x12a03a,_0x5a763e)[_0xbba8('0xb')](function(_0x100f76){logger['info'](_0xbba8('0xc'),_0x556190,'request\x20sent');logger[_0xbba8('0xd')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x556190,_0xbba8('0xe'),JSON[_0xbba8('0xf')](_0x100f76));if(_0x100f76[_0xbba8('0x10')]){if(_0x100f76[_0xbba8('0x10')][_0xbba8('0x11')]===0x1f4){logger['error'](_0xbba8('0xc'),_0x556190,_0x100f76[_0xbba8('0x10')][_0xbba8('0x12')]);return _0x22c607(_0x100f76['error'][_0xbba8('0x12')]);}logger[_0xbba8('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x556190,_0x100f76[_0xbba8('0x10')]['message']);return _0xae0a41(_0x100f76['error']['message']);}else{logger[_0xbba8('0x13')](_0xbba8('0xc'),_0x556190,_0xbba8('0xe'));_0xae0a41(_0x100f76[_0xbba8('0x14')][_0xbba8('0x12')]);}})[_0xbba8('0x15')](function(_0x4a2929){logger[_0xbba8('0x10')](_0xbba8('0xc'),_0x556190,_0x4a2929);_0x22c607(_0x4a2929);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 908c35c..34eac12 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 _0xf70c=['isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','/describe'];(function(_0x564fe0,_0x1dbc51){var _0x26ab2c=function(_0x2eb084){while(--_0x2eb084){_0x564fe0['push'](_0x564fe0['shift']());}};_0x26ab2c(++_0x1dbc51);}(_0xf70c,0x185));var _0xcf70=function(_0x58903e,_0x32e661){_0x58903e=_0x58903e-0x0;var _0x20da24=_0xf70c[_0x58903e];return _0x20da24;};'use strict';var multer=require(_0xcf70('0x0'));var util=require('util');var path=require(_0xcf70('0x1'));var timeout=require(_0xcf70('0x2'));var express=require(_0xcf70('0x3'));var router=express[_0xcf70('0x4')]();var fs_extra=require(_0xcf70('0x5'));var auth=require(_0xcf70('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcf70('0x7'));var controller=require(_0xcf70('0x8'));router[_0xcf70('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xcf70('0xa'),auth[_0xcf70('0xb')](),controller[_0xcf70('0xc')]);router['get'](_0xcf70('0xd'),auth['isAuthenticated'](),controller[_0xcf70('0xe')]);router[_0xcf70('0xf')]('/',auth[_0xcf70('0xb')](),controller[_0xcf70('0x10')]);router['put'](_0xcf70('0xd'),auth[_0xcf70('0xb')](),controller[_0xcf70('0x11')]);router[_0xcf70('0x12')](_0xcf70('0xd'),auth[_0xcf70('0xb')](),controller[_0xcf70('0x13')]);module['exports']=router; \ No newline at end of file +var _0xa77d=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','/:id','create','put','update','delete','destroy','exports'];(function(_0x573205,_0x30586a){var _0x51fb13=function(_0x153dd8){while(--_0x153dd8){_0x573205['push'](_0x573205['shift']());}};_0x51fb13(++_0x30586a);}(_0xa77d,0x78));var _0xda77=function(_0xc51f6e,_0x34c0f4){_0xc51f6e=_0xc51f6e-0x0;var _0x1e3d83=_0xa77d[_0xc51f6e];return _0x1e3d83;};'use strict';var multer=require(_0xda77('0x0'));var util=require(_0xda77('0x1'));var path=require('path');var timeout=require(_0xda77('0x2'));var express=require(_0xda77('0x3'));var router=express[_0xda77('0x4')]();var fs_extra=require(_0xda77('0x5'));var auth=require(_0xda77('0x6'));var interaction=require(_0xda77('0x7'));var config=require(_0xda77('0x8'));var controller=require(_0xda77('0x9'));router[_0xda77('0xa')]('/',auth[_0xda77('0xb')](),controller['index']);router['get'](_0xda77('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xda77('0xd'),auth[_0xda77('0xb')](),controller['show']);router['post']('/',auth[_0xda77('0xb')](),controller[_0xda77('0xe')]);router[_0xda77('0xf')](_0xda77('0xd'),auth[_0xda77('0xb')](),controller[_0xda77('0x10')]);router[_0xda77('0x11')](_0xda77('0xd'),auth['isAuthenticated'](),controller[_0xda77('0x12')]);module[_0xda77('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 0847ad4..3574ade 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 _0x2616=['mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','star','thumb','TEXT','stringify','input','name','text','getDataValue','parse','setDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','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'];(function(_0xa72cf,_0x24a05c){var _0x263735=function(_0x21b2ae){while(--_0x21b2ae){_0xa72cf['push'](_0xa72cf['shift']());}};_0x263735(++_0x24a05c);}(_0x2616,0xda));var _0x6261=function(_0x28edda,_0xbd447a){_0x28edda=_0x28edda-0x0;var _0x21f4a4=_0x2616[_0x28edda];return _0x21f4a4;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x6261('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x6261('0x1')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0x2')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x6261('0x2')},'key':{'type':Sequelize[_0x6261('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6261('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6261('0x3'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6261('0x1')],'allowNull':![],'defaultValue':_0x6261('0x3'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6261('0x1')],'allowNull':![],'defaultValue':_0x6261('0x4'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x6261('0x1')],'allowNull':![],'defaultValue':_0x6261('0x4'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6261('0x5')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6261('0x1')]},'animation':{'type':Sequelize[_0x6261('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6261('0x7')](_0x6261('0x8'),_0x6261('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0xa')},'start_chat_button':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0xb')},'offline_chat_button':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0xc')},'header_offline':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0xd')},'download_transcript':{'type':Sequelize[_0x6261('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6261('0x5')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x6261('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x6261('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6261('0x11')},'noteTitle':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0x12')},'placeholderMessage':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0x13')},'closingMessage':{'type':Sequelize[_0x6261('0x1')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x6261('0xc')},'skipMessageButton':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0x14')},'conditionAgreement':{'type':Sequelize[_0x6261('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6261('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0x15')},'ratingType':{'type':Sequelize['ENUM'](_0x6261('0x16'),_0x6261('0x17')),'defaultValue':_0x6261('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x6261('0x5')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6261('0x18')],'defaultValue':function(){return JSON[_0x6261('0x19')]({'items':[{'type':_0x6261('0x1a'),'variable':null,'config':{'placeholder':_0x6261('0x1b'),'type':_0x6261('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x6261('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x6261('0x2')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6261('0x1d')]('onlineForm')?JSON[_0x6261('0x1e')](this[_0x6261('0x1d')]('onlineForm')):{};},'set':function(_0x36a246){return this[_0x6261('0x1f')](_0x6261('0x20'),JSON[_0x6261('0x19')](_0x36a246));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x6261('0x1a'),'props':{'title':_0x6261('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0x6261('0x2'),'type':_0x6261('0x2')},'variable':null},{'type':_0x6261('0x21'),'config':{'placeholder':_0x6261('0x22')},'props':{'title':'Comments','helpText':_0x6261('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x6261('0x1d')](_0x6261('0x24'))?JSON['parse'](this[_0x6261('0x1d')](_0x6261('0x24'))):{};},'set':function(_0x4a1fdd){return this[_0x6261('0x1f')](_0x6261('0x24'),JSON['stringify'](_0x4a1fdd));}},'token':{'type':Sequelize[_0x6261('0x1')],'defaultValue':function(){return rs[_0x6261('0x25')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6261('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6261('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6261('0x1')]},'forwardOffline':{'type':Sequelize[_0x6261('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6261('0x1')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6261('0x26')},'waitingMessage':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0x28')},'offlineMessageBody':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x6261('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0x14')},'sendUnmanaged':{'type':Sequelize[_0x6261('0x1')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x6261('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6261('0x18')]},'showAgentAvatar':{'type':Sequelize[_0x6261('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x6261('0x1')]},'notificationTemplate':{'type':Sequelize[_0x6261('0x18')],'defaultValue':function(){return _0x6261('0x2b');}},'notificationSound':{'type':Sequelize[_0x6261('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6261('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6261('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6261('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0x2d')},'verticalAlignment':{'type':Sequelize[_0x6261('0x5')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0x2e')},'messagesAlignment':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0x2f')},'defaultTitle':{'type':Sequelize[_0x6261('0x1')]},'customerAvatar':{'type':Sequelize[_0x6261('0x18')]},'showCustomerAvatar':{'type':Sequelize[_0x6261('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6261('0x1')],'allowNull':![],'defaultValue':_0x6261('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6261('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6261('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6261('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6261('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6261('0x1')],'defaultValue':_0x6261('0x31')},'systemAvatar':{'type':Sequelize[_0x6261('0x18')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6261('0x5')],'comment':_0x6261('0x32')},'mandatoryDisposition':{'type':Sequelize[_0x6261('0x6')],'defaultValue':![],'comment':_0x6261('0x33'),'set':function(_0x36053e){if(!_0x36053e)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0x6261('0x34'),_0x36053e);}},'vidaooEscalation':{'type':Sequelize[_0x6261('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6261('0x1')]},'vidaooTopic':{'type':Sequelize[_0x6261('0x1')],'allowNull':![],'defaultValue':_0x6261('0x35')},'vidaooNote':{'type':Sequelize[_0x6261('0x1')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6261('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x24af=['Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','ENUM','star','thumb','TEXT','stringify','input','name','text','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','squared','rounded','We\x20are\x20here!','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note'];(function(_0x262bf7,_0x5b9989){var _0xe2d32b=function(_0x250335){while(--_0x250335){_0x262bf7['push'](_0x262bf7['shift']());}};_0xe2d32b(++_0x5b9989);}(_0x24af,0x132));var _0xf24a=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x24af[_0x1a8f86];return _0x20d876;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xf24a('0x0'));module[_0xf24a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xf24a('0x2')],'allowNull':![],'unique':_0xf24a('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xf24a('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xf24a('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x5')},'customerAlias':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf24a('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf24a('0x2')],'allowNull':![],'defaultValue':_0xf24a('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xf24a('0x2')],'allowNull':![],'defaultValue':_0xf24a('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf24a('0x2')]},'animation':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xf24a('0x9')),'defaultValue':_0xf24a('0xa')},'header_online':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0xb')},'start_chat_button':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf24a('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf24a('0x12')},'closingMessage':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x13')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xf24a('0x14')},'skipMessageButton':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x15')},'conditionAgreement':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf24a('0x16')},'ratingType':{'type':Sequelize[_0xf24a('0x17')](_0xf24a('0x18'),_0xf24a('0x19')),'defaultValue':_0xf24a('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xf24a('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf24a('0x1a')],'defaultValue':function(){return JSON[_0xf24a('0x1b')]({'items':[{'type':_0xf24a('0x1c'),'variable':null,'config':{'placeholder':_0xf24a('0x1d'),'type':_0xf24a('0x1e'),'required':!![]},'props':{'title':_0xf24a('0x1d'),'helpText':''}},{'type':'input','props':{'title':_0xf24a('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xf24a('0x4'),'type':_0xf24a('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xf24a('0x1f'))?JSON[_0xf24a('0x20')](this[_0xf24a('0x21')](_0xf24a('0x1f'))):{};},'set':function(_0xd65654){return this[_0xf24a('0x22')](_0xf24a('0x1f'),JSON[_0xf24a('0x1b')](_0xd65654));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf24a('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xf24a('0x4')},'variable':null},{'type':_0xf24a('0x23'),'config':{'placeholder':'Comments'},'props':{'title':_0xf24a('0x24'),'helpText':_0xf24a('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0xf24a('0x21')](_0xf24a('0x26'))?JSON[_0xf24a('0x20')](this[_0xf24a('0x21')](_0xf24a('0x26'))):{};},'set':function(_0x3b97af){return this['setDataValue'](_0xf24a('0x26'),JSON[_0xf24a('0x1b')](_0x3b97af));}},'token':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':function(){return rs[_0xf24a('0x27')]();}},'autoclose':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf24a('0x2')]},'waitingTitle':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x28')},'waitingMessage':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x29')},'offlineMessageBody':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf24a('0x2b')},'skipUnmanaged':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x15')},'sendUnmanaged':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x14')},'enableCustomerAttachment':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf24a('0x1a')]},'showAgentAvatar':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf24a('0x1a')],'defaultValue':function(){return _0xf24a('0x2c');}},'notificationSound':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xf24a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf24a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x2d')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x2e')},'defaultTitle':{'type':Sequelize[_0xf24a('0x2')]},'customerAvatar':{'type':Sequelize[_0xf24a('0x1a')]},'showCustomerAvatar':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf24a('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf24a('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf24a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf24a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xf24a('0x30')},'systemAvatar':{'type':Sequelize[_0xf24a('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xf24a('0x31')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5253d5){if(!_0x5253d5)this[_0xf24a('0x22')](_0xf24a('0x32'),null);this[_0xf24a('0x22')](_0xf24a('0x33'),_0x5253d5);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf24a('0x2')]},'vidaooTopic':{'type':Sequelize[_0xf24a('0x2')],'allowNull':![],'defaultValue':_0xf24a('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xf24a('0x35');}},'vidaooMetadata':{'type':Sequelize[_0xf24a('0x1a')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf24a('0x1a')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 3d7e023..d35a1bb 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 _0xb10b=['url','../../components/parsers/qs','api','../../config/environment','APIOutOfIntervalError','../../errors/api','APINotFoundError','handleError','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','send','Command','getSnippet','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','all','some','user-agent-parser','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','unknown','%s\x20%s','model','device','vendor','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','params','rawAttributes','includeAll','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','addDisposition','ChatWebsiteId','Disposition','getDispositions','findAll','removeDispositions','addAnswer','CannedAnswer','findOne','removeAnswers','addLogo','file','filename','addAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','CmList','List','Contacts','DESC','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','list','applications','orderBy','priority','asc','CmContact','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','unmanaged','ChatMessage','UserId','User','unshift','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','notify','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','attachments','openNewInteraction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getProactiveActions','virtual','increment','server/files/chat/iframe.ejs','URL','address','3.8.0','remote','x-real-ip','connection','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','READ_COMMITTED','ChatApplication','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','spread','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','querystring','html-to-text','ioredis','jayson/promise'];(function(_0x27ddf5,_0x5a3e18){var _0x26e74a=function(_0x5f24ac){while(--_0x5f24ac){_0x27ddf5['push'](_0x27ddf5['shift']());}};_0x26e74a(++_0x5a3e18);}(_0xb10b,0x12a));var _0xbb10=function(_0x2e9556,_0x5d18fb){_0x2e9556=_0x2e9556-0x0;var _0x1d4a1f=_0xb10b[_0x2e9556];return _0x1d4a1f;};'use strict';var Mustache=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var ejs=require(_0xbb10('0x2'));var fs=require('fs');var fs_extra=require(_0xbb10('0x3'));var _=require('lodash');var querystring=require(_0xbb10('0x4'));var htmlToText=require(_0xbb10('0x5'));var Redis=require(_0xbb10('0x6'));var jayson=require(_0xbb10('0x7'));var url=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var logger=require('../../config/logger')(_0xbb10('0xa'));var config=require(_0xbb10('0xb'));var APIOutOfIntervalError=require('../../errors/api')[_0xbb10('0xc')];var APINotFoundError=require(_0xbb10('0xd'))[_0xbb10('0xe')];var APIHandleError=require(_0xbb10('0xd'))[_0xbb10('0xf')];var db=require(_0xbb10('0x10'))['db'];config[_0xbb10('0x11')]=_[_0xbb10('0x12')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbb10('0x13'))(new Redis(config[_0xbb10('0x11')]));require(_0xbb10('0x14'))['register'](socket);var client=jayson[_0xbb10('0x15')]['http']({'port':0x232c});var client9002=jayson[_0xbb10('0x15')][_0xbb10('0x16')]({'port':0x232a});var client9003=jayson[_0xbb10('0x15')][_0xbb10('0x16')]({'port':0x232b});var client9001=jayson[_0xbb10('0x15')][_0xbb10('0x16')]({'port':0x2329});function respondWithRpcPromise(_0x58a612,_0x26e021,_0x42d7e4,_0x45b9d6){return new Promise(function(_0x17fd46,_0x3df17b){var _0x2f2ebf=_0x45b9d6||client;return _0x2f2ebf[_0xbb10('0x17')](_0x58a612,_0x42d7e4)[_0xbb10('0x18')](function(_0x3e26f4){logger[_0xbb10('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x26e021,_0xbb10('0x1a'));logger[_0xbb10('0x1b')](_0xbb10('0x1c'),_0x26e021,_0xbb10('0x1a'),JSON[_0xbb10('0x1d')](_0x3e26f4));if(_0x3e26f4[_0xbb10('0x1e')]){if(_0x3e26f4[_0xbb10('0x1e')][_0xbb10('0x1f')]===0x1f4){logger[_0xbb10('0x1e')](_0xbb10('0x20'),_0x26e021,_0x3e26f4['error'][_0xbb10('0x21')]);return _0x3df17b(_0x3e26f4[_0xbb10('0x1e')][_0xbb10('0x21')]);}logger[_0xbb10('0x1e')](_0xbb10('0x20'),_0x26e021,_0x3e26f4[_0xbb10('0x1e')]['message']);return _0x17fd46(_0x3e26f4[_0xbb10('0x1e')][_0xbb10('0x21')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x26e021,_0xbb10('0x1a'));_0x17fd46(_0x3e26f4[_0xbb10('0x22')][_0xbb10('0x21')]);}})[_0xbb10('0x23')](function(_0x445761){logger[_0xbb10('0x1e')](_0xbb10('0x20'),_0x26e021,_0x445761);_0x3df17b(_0x445761);});});}function respondWithStatusCode(_0x436104,_0x7f2377){_0x7f2377=_0x7f2377||0xcc;return function(_0x395404){if(_0x395404){return _0x436104[_0xbb10('0x24')](_0x7f2377);}return _0x436104[_0xbb10('0x25')](_0x7f2377)['end']();};}function respondWithResult(_0x4fedac,_0x4fb5e0){_0x4fb5e0=_0x4fb5e0||0xc8;return function(_0xc93a04){if(_0xc93a04){return _0x4fedac[_0xbb10('0x25')](_0x4fb5e0)[_0xbb10('0x26')](_0xc93a04);}};}function respondWithFilteredResult(_0x4e25ff,_0x2fdde9){return function(_0x24d586){if(_0x24d586){var _0x6ed43b=typeof _0x2fdde9[_0xbb10('0x27')]===_0xbb10('0x28')&&typeof _0x2fdde9[_0xbb10('0x29')]===_0xbb10('0x28');var _0x4aabb9=_0x24d586[_0xbb10('0x2a')];var _0x21ac54=_0x6ed43b?0x0:_0x2fdde9[_0xbb10('0x27')];var _0x2e0249=_0x6ed43b?_0x24d586[_0xbb10('0x2a')]:_0x2fdde9[_0xbb10('0x27')]+_0x2fdde9['limit'];var _0x221624;if(_0x2e0249>=_0x4aabb9){_0x2e0249=_0x4aabb9;_0x221624=0xc8;}else{_0x221624=0xce;}_0x4e25ff['status'](_0x221624);return _0x4e25ff[_0xbb10('0x2b')]('Content-Range',_0x21ac54+'-'+_0x2e0249+'/'+_0x4aabb9)[_0xbb10('0x26')](_0x24d586);}return null;};}function saveUpdates(_0x1dcc9c){return function(_0x1b59f9){if(_0x1b59f9){return _0x1b59f9['update'](_0x1dcc9c)['then'](function(_0x4c3744){return _0x4c3744;});}return null;};}function removeEntity(_0x34f65e){return function(_0x4f590d){if(_0x4f590d){return _0x4f590d[_0xbb10('0x2c')]()[_0xbb10('0x18')](function(){var _0x2f653f=_0x4f590d[_0xbb10('0x2d')]({'plain':!![]});var _0x37a83f=_0xbb10('0x2e');return db[_0xbb10('0x2f')]['destroy']({'where':{'type':_0x37a83f,'resourceId':_0x2f653f['id']}})[_0xbb10('0x18')](function(){return _0x4f590d;});})[_0xbb10('0x18')](function(){_0x34f65e[_0xbb10('0x25')](0xcc)[_0xbb10('0x30')]();});}};}function handleEntityNotFound(_0xfb2c5e){return function(_0x9de708){if(!_0x9de708){_0xfb2c5e[_0xbb10('0x24')](0x194);}return _0x9de708;};}function handleError(_0x10202c,_0x3c8d7d){_0x3c8d7d=_0x3c8d7d||0x1f4;return function(_0x56943c){logger[_0xbb10('0x1e')](_0x56943c[_0xbb10('0x31')]);if(_0x56943c[_0xbb10('0x32')]){delete _0x56943c[_0xbb10('0x32')];}_0x10202c['status'](_0x3c8d7d)[_0xbb10('0x33')](_0x56943c);};}function iftimePromise(_0x5de37b,_0x4e2754){return respondWithRpcPromise(_0xbb10('0x34'),_0xbb10('0x35'),{'command':_0x4e2754[_0xbb10('0x36')]?util[_0xbb10('0x37')](_0xbb10('0x38'),_0x5de37b[_0xbb10('0x39')],_0x4e2754['timezone']):util[_0xbb10('0x37')](_0xbb10('0x3a'),_0x5de37b['interval'])},client9002)['then'](function(_0x5cd55f){var _0x31bee3=_0x5cd55f&&_0x5cd55f[_0xbb10('0x3b')](_0xbb10('0x3c'))>=0x0?!![]:![];logger['info'](_0xbb10('0x3d'),_0x4e2754['id'],_0x5de37b['id'],_0x5de37b[_0xbb10('0x39')],_0x31bee3?_0xbb10('0x3e'):'OFFLINE',_0x4e2754[_0xbb10('0x36')]?_0x4e2754[_0xbb10('0x36')]:_0xbb10('0x3f'));return _0x31bee3;})[_0xbb10('0x23')](function(_0x4f1cdd){logger[_0xbb10('0x1e')](_0xbb10('0x3d'),_0x4e2754['id'],_0x5de37b['id'],_0x5de37b['interval'],util[_0xbb10('0x40')](_0x4f1cdd,{'showHidden':![],'depth':null}),_0x4e2754[_0xbb10('0x36')]?_0x4e2754[_0xbb10('0x36')]:_0xbb10('0x3f'));return![];});}function checkWebsiteIntervals(_0x2dd35a){var _0x185a52=_['map'](_0x2dd35a[_0xbb10('0x41')][_0xbb10('0x42')],function(_0x3e7b4c){var _0x3d3c41=_0x3e7b4c['get']({'plain':!![]});return iftimePromise(_0x3d3c41,_0x2dd35a);});return Promise[_0xbb10('0x43')](_0x185a52)[_0xbb10('0x18')](function(_0x23dc18){return _[_0xbb10('0x44')](_0x23dc18);});}function createInteractionObject(_0x5e2cfa,_0x351484,_0x202c60,_0x54ac18){var _0x5d9a4f=require(_0xbb10('0x45'));var _0x4a3ddf=new _0x5d9a4f();var _0x318984=_0x4a3ddf[_0xbb10('0x46')](_0x202c60['user-agent'])[_0xbb10('0x47')]();var _0x1d82bf=_0x351484[_0xbb10('0x48')];if(_0x202c60['cf-connecting-ip']){_0x1d82bf=_0x202c60[_0xbb10('0x49')];}else if(_0x202c60[_0xbb10('0x4a')]){_0x1d82bf=_[_0xbb10('0x4b')](_0x202c60[_0xbb10('0x4a')][_0xbb10('0x4c')](','));}return{'ContactId':_0x54ac18['id'],'ChatWebsiteId':_0x5e2cfa,'from':(_0x54ac18[_0xbb10('0x4d')]||'')+'\x20'+(_0x54ac18[_0xbb10('0x4e')]||''),'customerIp':_0x1d82bf,'customerPort':_0x202c60[_0xbb10('0x4f')]?_0x202c60[_0xbb10('0x4f')]:null,'referer':_0x351484[_0xbb10('0x50')],'browserName':_0x318984[_0xbb10('0x51')][_0xbb10('0x32')]&&_0x318984['browser'][_0xbb10('0x52')]?util[_0xbb10('0x37')]('%s\x20%s',_0x318984[_0xbb10('0x51')][_0xbb10('0x32')],_0x318984[_0xbb10('0x51')][_0xbb10('0x52')]):_0xbb10('0x53'),'browserVersion':_0x318984[_0xbb10('0x51')][_0xbb10('0x52')]||'unknown','osName':util['format'](_0xbb10('0x54'),_0x318984['os'][_0xbb10('0x32')],_0x318984['os'][_0xbb10('0x52')]),'osVersion':_0x318984['os']['version'],'deviceModel':_0x318984['device'][_0xbb10('0x55')]&&_0x318984[_0xbb10('0x56')][_0xbb10('0x57')]?util[_0xbb10('0x37')](_0xbb10('0x58'),_0x318984[_0xbb10('0x56')][_0xbb10('0x55')],_0x318984[_0xbb10('0x56')][_0xbb10('0x57')],_0x318984[_0xbb10('0x56')]['type']):null,'deviceVendor':_0x318984['device'][_0xbb10('0x57')],'deviceType':_0x318984[_0xbb10('0x56')][_0xbb10('0x59')],'formData':JSON[_0xbb10('0x1d')](_0x351484)};}exports[_0xbb10('0x5a')]=function(_0x440f9e,_0x358e7e){var _0x445870={'include':[{'model':db[_0xbb10('0x5b')],'as':_0xbb10('0x5c')}]},_0x1c0d8f={},_0x1214f7={'count':0x0,'rows':[]};var _0x61e689=_[_0xbb10('0x5d')](db[_0xbb10('0x5e')]['rawAttributes'],function(_0x124052){return{'name':_0x124052['fieldName'],'type':_0x124052[_0xbb10('0x59')][_0xbb10('0x5f')]};});_0x1c0d8f[_0xbb10('0x55')]=_[_0xbb10('0x5d')](_0x61e689,_0xbb10('0x32'));_0x1c0d8f[_0xbb10('0x60')]=_[_0xbb10('0x61')](_0x440f9e[_0xbb10('0x60')]);_0x1c0d8f[_0xbb10('0x62')]=_[_0xbb10('0x63')](_0x1c0d8f[_0xbb10('0x55')],_0x1c0d8f[_0xbb10('0x60')]);_0x445870[_0xbb10('0x64')]=_[_0xbb10('0x63')](_0x1c0d8f[_0xbb10('0x55')],qs['fields'](_0x440f9e[_0xbb10('0x60')][_0xbb10('0x65')]));_0x445870[_0xbb10('0x64')]=_0x445870[_0xbb10('0x64')][_0xbb10('0x66')]?_0x445870[_0xbb10('0x64')]:_0x1c0d8f['model'];if(!_0x440f9e[_0xbb10('0x60')][_0xbb10('0x67')](_0xbb10('0x68'))){_0x445870[_0xbb10('0x29')]=qs[_0xbb10('0x29')](_0x440f9e[_0xbb10('0x60')][_0xbb10('0x29')]);_0x445870[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x440f9e[_0xbb10('0x60')][_0xbb10('0x27')]);}_0x445870[_0xbb10('0x69')]=qs[_0xbb10('0x6a')](_0x440f9e['query']['sort']);_0x445870[_0xbb10('0x6b')]=qs[_0xbb10('0x62')](_[_0xbb10('0x6c')](_0x440f9e[_0xbb10('0x60')],_0x1c0d8f['filters']),_0x61e689);if(_0x440f9e['query'][_0xbb10('0x6d')]){_0x445870[_0xbb10('0x6b')]=_[_0xbb10('0x6e')](_0x445870[_0xbb10('0x6b')],{'$or':_[_0xbb10('0x5d')](_0x61e689,function(_0x3e9753){if(_0x3e9753[_0xbb10('0x59')]!=='VIRTUAL'){var _0x117e84={};_0x117e84[_0x3e9753[_0xbb10('0x32')]]={'$like':'%'+_0x440f9e['query']['filter']+'%'};return _0x117e84;}})});}_0x445870=_['merge']({},_0x445870,_0x440f9e[_0xbb10('0x6f')]);var _0x31c727={'where':_0x445870[_0xbb10('0x6b')]};return db['ChatWebsite']['count'](_0x31c727)['then'](function(_0x3ebc5f){_0x1214f7[_0xbb10('0x2a')]=_0x3ebc5f;if(_0x440f9e[_0xbb10('0x60')]['includeAll']){_0x445870[_0xbb10('0x70')]=[{'all':!![]}];}return db[_0xbb10('0x5e')]['findAll'](_0x445870);})['then'](function(_0x27d7b9){_0x1214f7[_0xbb10('0x71')]=_0x27d7b9;return _0x1214f7;})[_0xbb10('0x18')](respondWithFilteredResult(_0x358e7e,_0x445870))[_0xbb10('0x23')](handleError(_0x358e7e,null));};exports['show']=function(_0x43eaec,_0xec48ac){var _0xa7179d={'raw':![],'where':{'id':_0x43eaec[_0xbb10('0x72')]['id']},'include':[{'model':db[_0xbb10('0x5b')],'as':_0xbb10('0x5c')}]},_0x5202d7={};_0x5202d7['model']=_[_0xbb10('0x61')](db[_0xbb10('0x5e')][_0xbb10('0x73')]);_0x5202d7[_0xbb10('0x60')]=_['keys'](_0x43eaec[_0xbb10('0x60')]);_0x5202d7[_0xbb10('0x62')]=_[_0xbb10('0x63')](_0x5202d7[_0xbb10('0x55')],_0x5202d7['query']);_0xa7179d[_0xbb10('0x64')]=_[_0xbb10('0x63')](_0x5202d7[_0xbb10('0x55')],qs[_0xbb10('0x65')](_0x43eaec[_0xbb10('0x60')][_0xbb10('0x65')]));_0xa7179d[_0xbb10('0x64')]=_0xa7179d['attributes']['length']?_0xa7179d['attributes']:_0x5202d7[_0xbb10('0x55')];if(_0x43eaec[_0xbb10('0x60')][_0xbb10('0x74')]){_0xa7179d['include']=[{'all':!![]}];}_0xa7179d=_['merge']({},_0xa7179d,_0x43eaec[_0xbb10('0x6f')]);return db[_0xbb10('0x5e')][_0xbb10('0x75')](_0xa7179d)[_0xbb10('0x18')](handleEntityNotFound(_0xec48ac,null))[_0xbb10('0x18')](respondWithResult(_0xec48ac,null))[_0xbb10('0x23')](handleError(_0xec48ac,null));};exports['create']=function(_0x1a5ca5,_0x15fae2){return db[_0xbb10('0x5e')][_0xbb10('0x76')](_0x1a5ca5[_0xbb10('0x77')],{})['then'](function(_0x56094a){var _0x5ad6ad=_0x1a5ca5[_0xbb10('0x78')][_0xbb10('0x2d')]({'plain':!![]});if(!_0x5ad6ad)throw new Error(_0xbb10('0x79'));if(_0x5ad6ad[_0xbb10('0x7a')]===_0xbb10('0x78')){var _0x1d40b8=_0x56094a['get']({'plain':!![]});var _0x93f3c4='ChatWebsites';return db['UserProfileSection']['find']({'where':{'name':_0x93f3c4,'userProfileId':_0x5ad6ad[_0xbb10('0x7b')]},'raw':!![]})[_0xbb10('0x18')](function(_0x23b1d5){if(_0x23b1d5&&_0x23b1d5[_0xbb10('0x7c')]===0x0){return db['UserProfileResource'][_0xbb10('0x76')]({'name':_0x1d40b8['name'],'resourceId':_0x1d40b8['id'],'type':_0x23b1d5['name'],'sectionId':_0x23b1d5['id']},{})[_0xbb10('0x18')](function(){return _0x56094a;});}else{return _0x56094a;}})[_0xbb10('0x23')](function(_0x29529c){logger[_0xbb10('0x1e')](_0xbb10('0x7d'),_0x29529c);throw _0x29529c;});}return _0x56094a;})['then'](respondWithResult(_0x15fae2,0xc9))[_0xbb10('0x23')](handleError(_0x15fae2,null));};exports[_0xbb10('0x7e')]=function(_0x2c6429,_0x3f3d38){if(_0x2c6429[_0xbb10('0x77')]['id']){delete _0x2c6429[_0xbb10('0x77')]['id'];}return db[_0xbb10('0x5e')]['find']({'where':{'id':_0x2c6429[_0xbb10('0x72')]['id']},'include':[{'model':db[_0xbb10('0x5b')],'as':_0xbb10('0x5c')}]})[_0xbb10('0x18')](handleEntityNotFound(_0x3f3d38,null))[_0xbb10('0x18')](saveUpdates(_0x2c6429[_0xbb10('0x77')],null))[_0xbb10('0x18')](respondWithResult(_0x3f3d38,null))[_0xbb10('0x23')](handleError(_0x3f3d38,null));};exports['destroy']=function(_0x428146,_0x218690){return db[_0xbb10('0x5e')]['find']({'where':{'id':_0x428146['params']['id']}})['then'](handleEntityNotFound(_0x218690,null))[_0xbb10('0x18')](removeEntity(_0x218690,null))['catch'](handleError(_0x218690,null));};exports['describe']=function(_0x1701c5,_0x3ee56b){return db[_0xbb10('0x5e')][_0xbb10('0x7f')]()[_0xbb10('0x18')](respondWithResult(_0x3ee56b,null))[_0xbb10('0x23')](handleError(_0x3ee56b,null));};exports[_0xbb10('0x80')]=function(_0x417304,_0x188b97){if(_0x417304['body']['id']){delete _0x417304[_0xbb10('0x77')]['id'];}return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0x417304[_0xbb10('0x72')]['id']}})['then'](handleEntityNotFound(_0x188b97,null))['then'](function(_0x3547a3){if(_0x3547a3){_0x417304[_0xbb10('0x77')][_0xbb10('0x81')]=_0x3547a3['id'];return db[_0xbb10('0x82')]['create'](_0x417304[_0xbb10('0x77')]);}})[_0xbb10('0x18')](respondWithResult(_0x188b97,null))[_0xbb10('0x23')](handleError(_0x188b97,null));};exports[_0xbb10('0x83')]=function(_0x35c1e8,_0x517185){var _0x5f0691={'raw':![],'where':{}};var _0x372636={};var _0x53c698={'count':0x0,'rows':[]};return db[_0xbb10('0x5e')]['findOne']({'where':{'id':_0x35c1e8[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x517185,null))['then'](function(_0x5caa06){if(_0x5caa06){_0x372636[_0xbb10('0x55')]=_[_0xbb10('0x61')](db[_0xbb10('0x82')]['rawAttributes']);_0x372636[_0xbb10('0x60')]=_[_0xbb10('0x61')](_0x35c1e8[_0xbb10('0x60')]);_0x372636[_0xbb10('0x62')]=_[_0xbb10('0x63')](_0x372636[_0xbb10('0x55')],_0x372636[_0xbb10('0x60')]);_0x5f0691[_0xbb10('0x64')]=_[_0xbb10('0x63')](_0x372636['model'],qs[_0xbb10('0x65')](_0x35c1e8[_0xbb10('0x60')][_0xbb10('0x65')]));_0x5f0691[_0xbb10('0x64')]=_0x5f0691[_0xbb10('0x64')][_0xbb10('0x66')]?_0x5f0691[_0xbb10('0x64')]:_0x372636[_0xbb10('0x55')];if(!_0x35c1e8[_0xbb10('0x60')][_0xbb10('0x67')](_0xbb10('0x68'))){_0x5f0691[_0xbb10('0x29')]=qs['limit'](_0x35c1e8['query'][_0xbb10('0x29')]);_0x5f0691[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x35c1e8[_0xbb10('0x60')][_0xbb10('0x27')]);}_0x5f0691['order']=qs[_0xbb10('0x6a')](_0x35c1e8[_0xbb10('0x60')][_0xbb10('0x6a')]);_0x5f0691[_0xbb10('0x6b')]=qs[_0xbb10('0x62')](_[_0xbb10('0x6c')](_0x35c1e8['query'],_0x372636[_0xbb10('0x62')]));_0x5f0691[_0xbb10('0x6b')]['ChatWebsiteId']=_0x5caa06['id'];if(_0x35c1e8[_0xbb10('0x60')]['filter']){_0x5f0691[_0xbb10('0x6b')]=_[_0xbb10('0x6e')](_0x5f0691[_0xbb10('0x6b')],{'$or':_[_0xbb10('0x5d')](_0x5f0691[_0xbb10('0x64')],function(_0x556d7b){var _0x10d91d={};_0x10d91d[_0x556d7b]={'$like':'%'+_0x35c1e8['query'][_0xbb10('0x6d')]+'%'};return _0x10d91d;})});}_0x5f0691=_[_0xbb10('0x6e')]({},_0x5f0691,_0x35c1e8['options']);return db['Disposition'][_0xbb10('0x2a')]({'where':_0x5f0691[_0xbb10('0x6b')]})[_0xbb10('0x18')](function(_0x283bab){_0x53c698[_0xbb10('0x2a')]=_0x283bab;if(_0x35c1e8[_0xbb10('0x60')][_0xbb10('0x74')]){_0x5f0691[_0xbb10('0x70')]=[{'all':!![]}];}return db[_0xbb10('0x82')][_0xbb10('0x84')](_0x5f0691);})[_0xbb10('0x18')](function(_0x4c0b83){_0x53c698[_0xbb10('0x71')]=_0x4c0b83;return _0x53c698;});}})[_0xbb10('0x18')](respondWithFilteredResult(_0x517185,_0x5f0691))[_0xbb10('0x23')](handleError(_0x517185,null));};exports[_0xbb10('0x85')]=function(_0xfe02f5,_0x86a6ff){return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0xfe02f5[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x86a6ff,null))[_0xbb10('0x18')](function(_0x2d3e98){if(_0x2d3e98){return _0x2d3e98['removeDispositions'](_0xfe02f5[_0xbb10('0x60')]['ids']);}})[_0xbb10('0x18')](respondWithStatusCode(_0x86a6ff,null))[_0xbb10('0x23')](handleError(_0x86a6ff,null));};exports[_0xbb10('0x86')]=function(_0x40236c,_0x38d369){if(_0x40236c['body']['id']){delete _0x40236c[_0xbb10('0x77')]['id'];}return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0x40236c[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x38d369,null))[_0xbb10('0x18')](function(_0x4970fe){if(_0x4970fe){_0x40236c['body'][_0xbb10('0x81')]=_0x4970fe['id'];return db[_0xbb10('0x87')][_0xbb10('0x76')](_0x40236c['body']);}})[_0xbb10('0x18')](respondWithResult(_0x38d369,null))[_0xbb10('0x23')](handleError(_0x38d369,null));};exports['getAnswers']=function(_0x2831de,_0xaede56){var _0x5642c3={'raw':![],'where':{}};var _0xdd3c7e={};var _0x4d7bca={'count':0x0,'rows':[]};return db[_0xbb10('0x5e')][_0xbb10('0x88')]({'where':{'id':_0x2831de['params']['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0xaede56,null))[_0xbb10('0x18')](function(_0x4bac29){if(_0x4bac29){_0xdd3c7e['model']=_[_0xbb10('0x61')](db[_0xbb10('0x87')][_0xbb10('0x73')]);_0xdd3c7e[_0xbb10('0x60')]=_[_0xbb10('0x61')](_0x2831de['query']);_0xdd3c7e[_0xbb10('0x62')]=_[_0xbb10('0x63')](_0xdd3c7e[_0xbb10('0x55')],_0xdd3c7e['query']);_0x5642c3[_0xbb10('0x64')]=_[_0xbb10('0x63')](_0xdd3c7e[_0xbb10('0x55')],qs[_0xbb10('0x65')](_0x2831de[_0xbb10('0x60')][_0xbb10('0x65')]));_0x5642c3[_0xbb10('0x64')]=_0x5642c3[_0xbb10('0x64')][_0xbb10('0x66')]?_0x5642c3['attributes']:_0xdd3c7e['model'];if(!_0x2831de[_0xbb10('0x60')][_0xbb10('0x67')](_0xbb10('0x68'))){_0x5642c3[_0xbb10('0x29')]=qs[_0xbb10('0x29')](_0x2831de[_0xbb10('0x60')][_0xbb10('0x29')]);_0x5642c3[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x2831de[_0xbb10('0x60')][_0xbb10('0x27')]);}_0x5642c3[_0xbb10('0x69')]=qs[_0xbb10('0x6a')](_0x2831de['query'][_0xbb10('0x6a')]);_0x5642c3[_0xbb10('0x6b')]=qs[_0xbb10('0x62')](_[_0xbb10('0x6c')](_0x2831de[_0xbb10('0x60')],_0xdd3c7e[_0xbb10('0x62')]));_0x5642c3[_0xbb10('0x6b')][_0xbb10('0x81')]=_0x4bac29['id'];if(_0x2831de[_0xbb10('0x60')][_0xbb10('0x6d')]){_0x5642c3[_0xbb10('0x6b')]=_['merge'](_0x5642c3[_0xbb10('0x6b')],{'$or':_['map'](_0x5642c3[_0xbb10('0x64')],function(_0x22ae3c){var _0x25b1b3={};_0x25b1b3[_0x22ae3c]={'$like':'%'+_0x2831de[_0xbb10('0x60')][_0xbb10('0x6d')]+'%'};return _0x25b1b3;})});}_0x5642c3=_[_0xbb10('0x6e')]({},_0x5642c3,_0x2831de['options']);return db[_0xbb10('0x87')]['count']({'where':_0x5642c3[_0xbb10('0x6b')]})[_0xbb10('0x18')](function(_0xda122){_0x4d7bca[_0xbb10('0x2a')]=_0xda122;if(_0x2831de[_0xbb10('0x60')][_0xbb10('0x74')]){_0x5642c3[_0xbb10('0x70')]=[{'all':!![]}];}return db[_0xbb10('0x87')][_0xbb10('0x84')](_0x5642c3);})[_0xbb10('0x18')](function(_0x13efa1){_0x4d7bca[_0xbb10('0x71')]=_0x13efa1;return _0x4d7bca;});}})['then'](respondWithFilteredResult(_0xaede56,_0x5642c3))[_0xbb10('0x23')](handleError(_0xaede56,null));};exports['removeAnswers']=function(_0xe70161,_0x36e9b0){return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0xe70161[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x36e9b0,null))[_0xbb10('0x18')](function(_0x5e9888){if(_0x5e9888){return _0x5e9888[_0xbb10('0x89')](_0xe70161['query']['ids']);}})[_0xbb10('0x18')](respondWithStatusCode(_0x36e9b0,null))[_0xbb10('0x23')](handleError(_0x36e9b0,null));};exports[_0xbb10('0x8a')]=function(_0x1fd88a,_0x1fc4ec){_0x1fd88a[_0xbb10('0x77')]['sitepic']=_0x1fd88a[_0xbb10('0x8b')][_0xbb10('0x8c')];return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0x1fd88a[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x1fc4ec,null))['then'](saveUpdates(_0x1fd88a[_0xbb10('0x77')],null))[_0xbb10('0x18')](respondWithResult(_0x1fc4ec,null))[_0xbb10('0x23')](handleError(_0x1fc4ec,null));};exports[_0xbb10('0x8d')]=function(_0x31718f,_0x5ecb87){_0x31718f[_0xbb10('0x77')]['agentAvatar']=_0x31718f[_0xbb10('0x8b')]['filename'];return db[_0xbb10('0x5e')]['find']({'where':{'id':_0x31718f['params']['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x5ecb87,null))[_0xbb10('0x18')](saveUpdates(_0x31718f[_0xbb10('0x77')],null))[_0xbb10('0x18')](respondWithResult(_0x5ecb87,null))[_0xbb10('0x23')](handleError(_0x5ecb87,null));};exports['addCustomerAvatar']=function(_0xa42b80,_0x565ddf){_0xa42b80['body']['customerAvatar']=_0xa42b80[_0xbb10('0x8b')][_0xbb10('0x8c')];return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0xa42b80[_0xbb10('0x72')]['id']}})['then'](handleEntityNotFound(_0x565ddf,null))[_0xbb10('0x18')](saveUpdates(_0xa42b80[_0xbb10('0x77')],null))[_0xbb10('0x18')](respondWithResult(_0x565ddf,null))[_0xbb10('0x23')](handleError(_0x565ddf,null));};exports[_0xbb10('0x8e')]=function(_0x37ff15,_0x2ef6ee){_0x37ff15['body']['systemAvatar']=_0x37ff15['file'][_0xbb10('0x8c')];return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0x37ff15[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x2ef6ee,null))[_0xbb10('0x18')](saveUpdates(_0x37ff15[_0xbb10('0x77')],null))[_0xbb10('0x18')](respondWithResult(_0x2ef6ee,null))[_0xbb10('0x23')](handleError(_0x2ef6ee,null));};exports[_0xbb10('0x8f')]=function(_0x4cc8d4,_0x58295f){var _0x4dce53=path[_0xbb10('0x90')](config[_0xbb10('0x91')],_0xbb10('0x92'));var _0x47c820={'where':{'id':_0x4cc8d4[_0xbb10('0x72')]['id']},'attributes':['id',_0xbb10('0x93')],'raw':!![]};var _0x2c638d=![];return require(_0xbb10('0x94'))[_0xbb10('0x95')]()[_0xbb10('0x18')](function(_0x485f46){if(_0x485f46){_0x2c638d=_0x485f46['custom'];}})[_0xbb10('0x18')](function(){return db['ChatWebsite'][_0xbb10('0x75')](_0x47c820);})[_0xbb10('0x18')](handleEntityNotFound(_0x58295f,null))[_0xbb10('0x18')](function(_0x15dcde){if(_0x15dcde){if(!_[_0xbb10('0x96')](_0x15dcde[_0xbb10('0x93')])){if(fs[_0xbb10('0x97')](path[_0xbb10('0x90')](config[_0xbb10('0x91')],_0xbb10('0x98'),_0x15dcde['sitepic']))&&_0x2c638d){_0x4dce53=path[_0xbb10('0x90')](config['root'],_0xbb10('0x98'),_0x15dcde['sitepic']);}}return _0x58295f[_0xbb10('0x99')](_0x4dce53);}})[_0xbb10('0x23')](handleError(_0x58295f,null));};exports[_0xbb10('0x9a')]=function(_0x373c0e,_0x5ee229){var _0xcc246f=path['join'](config[_0xbb10('0x91')],_0xbb10('0x9b'));var _0xcdaf04={'where':{'id':_0x373c0e['params']['id']},'attributes':['id',_0xbb10('0x9c')],'raw':!![]};return db[_0xbb10('0x5e')][_0xbb10('0x75')](_0xcdaf04)[_0xbb10('0x18')](handleEntityNotFound(_0x5ee229,null))[_0xbb10('0x18')](function(_0x309ec1){if(_0x309ec1){if(!_['isNil'](_0x309ec1['agentAvatar'])){if(fs['existsSync'](path[_0xbb10('0x90')](config['root'],_0xbb10('0x9d'),_0x309ec1['agentAvatar']))){_0xcc246f=path[_0xbb10('0x90')](config[_0xbb10('0x91')],_0xbb10('0x9d'),_0x309ec1['agentAvatar']);}}return _0x5ee229['download'](_0xcc246f);}})[_0xbb10('0x23')](handleError(_0x5ee229,null));};exports[_0xbb10('0x9e')]=function(_0x443e56,_0x59b20f){var _0x440108=path[_0xbb10('0x90')](config[_0xbb10('0x91')],'server/files/images/avatars/customer_avatar.png');var _0x47d144={'where':{'id':_0x443e56['params']['id']},'attributes':['id',_0xbb10('0x9f'),'showCustomerAvatar'],'raw':!![]};return db[_0xbb10('0x5e')][_0xbb10('0x75')](_0x47d144)[_0xbb10('0x18')](handleEntityNotFound(_0x59b20f,null))[_0xbb10('0x18')](function(_0x365238){if(_0x365238){if(!_[_0xbb10('0x96')](_0x365238[_0xbb10('0x9f')])){if(fs[_0xbb10('0x97')](path[_0xbb10('0x90')](config[_0xbb10('0x91')],_0xbb10('0x9d'),_0x365238['customerAvatar']))&&_0x365238[_0xbb10('0xa0')]){_0x440108=path[_0xbb10('0x90')](config['root'],_0xbb10('0x9d'),_0x365238['customerAvatar']);}}return _0x59b20f['download'](_0x440108);}})[_0xbb10('0x23')](handleError(_0x59b20f,null));};exports[_0xbb10('0xa1')]=function(_0x35a78e,_0x2fa574){var _0x99c4=path['join'](config[_0xbb10('0x91')],_0xbb10('0xa2'));var _0x4f17c1={'where':{'id':_0x35a78e[_0xbb10('0x72')]['id']},'attributes':['id',_0xbb10('0xa3')],'raw':!![]};return db['ChatWebsite'][_0xbb10('0x75')](_0x4f17c1)['then'](handleEntityNotFound(_0x2fa574,null))[_0xbb10('0x18')](function(_0x8e8049){if(_0x8e8049){if(!_[_0xbb10('0x96')](_0x8e8049[_0xbb10('0xa3')])){if(fs[_0xbb10('0x97')](path[_0xbb10('0x90')](config[_0xbb10('0x91')],'server/files/images/avatars/',_0x8e8049[_0xbb10('0xa3')]))){_0x99c4=path[_0xbb10('0x90')](config[_0xbb10('0x91')],_0xbb10('0x9d'),_0x8e8049[_0xbb10('0xa3')]);}}return _0x2fa574[_0xbb10('0x99')](_0x99c4);}})['catch'](handleError(_0x2fa574,null));};exports['notify']=function(_0x5a40e8,_0x23849e){var _0x377e6a={'body':_0x5a40e8[_0xbb10('0x77')],'channel':_0xbb10('0xa4')};var _0x57700b=[];var _0x3b01a3=[];var _0x3d7b4d={};var _0x468e26=![];return db['CmContact']['describe']()[_0xbb10('0x18')](function(_0x4b5b66){if(!_0x4b5b66){throw new db[(_0xbb10('0xa5'))][(_0xbb10('0xa6'))](_0xbb10('0xa7'));}_0x57700b=_[_0xbb10('0xa8')](_[_0xbb10('0x61')](_0x4b5b66),[_0xbb10('0xa9'),_0xbb10('0xaa')]);_0x3b01a3=_['difference'](_[_0xbb10('0x61')](_0x4b5b66),[_0xbb10('0xa9'),'updatedAt',_0xbb10('0xab'),_0xbb10('0xac')]);if(_0x5a40e8[_0xbb10('0x77')]['id']){delete _0x5a40e8['body']['id'];}if(_['isNil'](_0x5a40e8['body'][_0xbb10('0xad')])){throw new db[(_0xbb10('0xa5'))]['ValidationError'](_0xbb10('0xae'));}if(_[_0xbb10('0x96')](_0x5a40e8[_0xbb10('0x77')][_0xbb10('0x77')])||_0x5a40e8[_0xbb10('0x77')][_0xbb10('0x77')]===''){throw new db[(_0xbb10('0xa5'))]['ValidationError'](_0xbb10('0xaf'));}if(_['isNil'](_0x5a40e8['body']['mapKey'])){throw new db[(_0xbb10('0xa5'))][(_0xbb10('0xa6'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3b01a3);}if(!_[_0xbb10('0xb0')](_0x3b01a3,_0x5a40e8['body'][_0xbb10('0xb1')])){throw new db[(_0xbb10('0xa5'))][(_0xbb10('0xa6'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3b01a3);}_0x3d7b4d[_0x5a40e8['body'][_0xbb10('0xb1')]]=_0x5a40e8['body'][_0xbb10('0xad')];})[_0xbb10('0x18')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x5a40e8[_0xbb10('0x72')]['id']},'include':[{'model':db[_0xbb10('0xb2')],'as':_0xbb10('0xb3'),'include':[{'model':db['CmContact'],'as':_0xbb10('0xb4'),'where':_0x3d7b4d,'limit':0x1,'order':[[_0xbb10('0xaa'),_0xbb10('0xb5')]]}]},{'model':db['ChatApplication'],'as':_0xbb10('0xb6')},{'model':db[_0xbb10('0x41')],'as':_0xbb10('0x41'),'include':[{'model':db[_0xbb10('0x41')],'as':_0xbb10('0x42'),'attributes':['id',_0xbb10('0x39')],'raw':!![]}]}]});})[_0xbb10('0x18')](function(_0x1583cb){if(!_0x1583cb)throw new APINotFoundError(util[_0xbb10('0x37')](_0xbb10('0xb7'),_0x5a40e8[_0xbb10('0x72')]['id']));if(!_0x1583cb[_0xbb10('0x41')]||!_0x1583cb[_0xbb10('0x41')]['Intervals'])return[_0x1583cb,!![]];return[_0x1583cb,checkWebsiteIntervals(_0x1583cb)];})['spread'](function(_0x196be4,_0x52767a){if(!_0x52767a)throw new APIOutOfIntervalError();if(!_0x196be4[_0xbb10('0xb3')])return;_0x377e6a[_0xbb10('0xb8')]=_0x196be4;_0x377e6a[_0xbb10('0xb9')]=_0x196be4['List'];_0x377e6a[_0xbb10('0xba')]=_[_0xbb10('0xbb')](_0x196be4[_0xbb10('0xb6')],[_0xbb10('0xbc')],[_0xbb10('0xbd')]);if(_0x377e6a['account'][_0xbb10('0xb6')]){delete _0x377e6a[_0xbb10('0xb8')][_0xbb10('0xb6')];}if(_0x377e6a[_0xbb10('0xb8')][_0xbb10('0xb3')]&&_0x377e6a[_0xbb10('0xb8')]['List'][_0xbb10('0xb4')][_0xbb10('0x66')]){return _0x377e6a['account'][_0xbb10('0xb3')][_0xbb10('0xb4')][0x0];}var _0x2d0de5=_[_0xbb10('0x12')](_0x5a40e8[_0xbb10('0x77')],{'firstName':_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xad')],'ListId':_0x196be4[_0xbb10('0xac')]});_0x2d0de5[_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xb1')]]=_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xad')];return db[_0xbb10('0xbe')][_0xbb10('0x76')](_0x2d0de5,{'fields':_0x57700b,'raw':!![]});})[_0xbb10('0x18')](function(_0x4dff47){_0x377e6a[_0xbb10('0xbf')]=_0x4dff47;var _0x6b5fb3=createInteractionObject(_0x5a40e8['params']['id'],_0x5a40e8['body'],_0x5a40e8[_0xbb10('0xc0')],_0x4dff47);var _0x230dd8={'ChatWebsiteId':_0x5a40e8[_0xbb10('0x72')]['id'],'closed':![]};if(_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xc1')]){_0x230dd8[_0xbb10('0xc1')]=_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xc1')];return db[_0xbb10('0xc2')]['find']({'where':_0x230dd8})['then'](function(_0x4e0cfb){if(_0x4e0cfb){_0x468e26=!![];return _0x4e0cfb;}_0x6b5fb3['threadId']=_0x5a40e8['body']['threadId'];_0x6b5fb3[_0xbb10('0xc3')]=_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xc3')];return db[_0xbb10('0xc2')]['create'](_0x6b5fb3);});}_0x230dd8[_0xbb10('0xc4')]=_0x4dff47['id'];if(_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xc5')]&&_0x5a40e8[_0xbb10('0x77')]['interaction']['id']){_0x230dd8['id']=_0x5a40e8['body'][_0xbb10('0xc5')]['id'];return db[_0xbb10('0xc2')]['find']({'where':_0x230dd8})['then'](function(_0x154a91){if(_0x154a91){_0x468e26=!![];return _0x154a91;}return db[_0xbb10('0xc2')][_0xbb10('0x76')](_0x6b5fb3);});}return db[_0xbb10('0xc2')][_0xbb10('0x76')](_0x6b5fb3);})['then'](function(_0x4744f4){if(!_0x468e26)return _0x4744f4;var _0x5382e9={'from':(_0x377e6a['contact'][_0xbb10('0x4d')]||'')+'\x20'+(_0x377e6a[_0xbb10('0xbf')][_0xbb10('0x4e')]||'')};if(_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xc1')]&&_0x5a40e8[_0xbb10('0x77')]['messageId']&&_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xc1')]!=_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xc6')]){_0x5382e9[_0xbb10('0xc1')]=_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xc6')];}return _0x4744f4[_0xbb10('0x7e')](_0x5382e9);})[_0xbb10('0x18')](function(_0x16f3ce){_0x377e6a[_0xbb10('0xc5')]=_0x16f3ce[_0xbb10('0x2d')]({'plain':!![]});_0x377e6a[_0xbb10('0xc5')][_0xbb10('0xc7')]=!_0x468e26;if(_0x377e6a[_0xbb10('0xc5')][_0xbb10('0xc7')]){if(_0x377e6a[_0xbb10('0xb8')][_0xbb10('0xc8')]){_0x377e6a[_0xbb10('0xba')][_0xbb10('0xc9')]({'id':0x0,'priority':_0x377e6a[_0xbb10('0xba')][_0xbb10('0x66')]+0x1,'app':'close','appdata':_0xbb10('0xca'),'interval':'*,*,*,*'});}}return db[_0xbb10('0xcb')][_0xbb10('0x76')]({'body':_0x5a40e8[_0xbb10('0x77')][_0xbb10('0x77')],'ChatWebsiteId':_0x5a40e8[_0xbb10('0x72')]['id'],'ChatInteractionId':_0x16f3ce['id'],'direction':'in','ContactId':_0x377e6a['contact']['id'],'AttachmentId':_0x5a40e8['body']['AttachmentId']});})[_0xbb10('0x18')](function(_0x2fac6c){_0x377e6a['message']=_0x2fac6c;if(!_0x377e6a[_0xbb10('0xc5')][_0xbb10('0xcc')]){return;}return db[_0xbb10('0xcd')]['find']({'attributes':['id',_0xbb10('0x32')],'where':{'id':_0x377e6a[_0xbb10('0xc5')][_0xbb10('0xcc')]}});})['then'](function(_0x46de6a){if(_0x46de6a){_0x377e6a['applications'][_0xbb10('0xce')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x46de6a['name']+','+(_0x377e6a['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x377e6a['forcedOwnership']=!![];}if(!_0x377e6a[_0xbb10('0xc5')][_0xbb10('0xcf')]){return;}return db[_0xbb10('0xd0')][_0xbb10('0x75')]({'attributes':['id','name'],'where':{'id':_0x377e6a[_0xbb10('0xc5')][_0xbb10('0xcf')]}});})[_0xbb10('0x18')](function(_0x37bc34){if(_0x37bc34){_0x377e6a[_0xbb10('0xba')][_0xbb10('0xce')]({'id':0x0,'priority':0x1,'app':_0xbb10('0xd1'),'appdata':_0x37bc34[_0xbb10('0x32')]+','+(_0x377e6a[_0xbb10('0xb8')][_0xbb10('0xd2')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xbb10('0xd3'),_0xbb10('0xd4'),_0x377e6a);})[_0xbb10('0x18')](function(_0x5c5ecc){respondWithRpcPromise(_0xbb10('0xd5'),_0xbb10('0xd5'),{'event':_0xbb10('0xd6'),'message':_0x5c5ecc},client9002);return _0x5c5ecc;})[_0xbb10('0x18')](respondWithResult(_0x23849e,null))['catch'](APIHandleError(_0x23849e));};exports[_0xbb10('0xd7')]=function(_0xddfe35,_0x604d55){var _0x22ec50,_0x40eb16,_0x3ff3fe;var _0x38eb3d=[];var _0x1c0529={};var _0x3522cd=_0xddfe35[_0xbb10('0xd8')]||[];var _0x3c01ff=[];var _0x4d65e7;return db[_0xbb10('0xbe')][_0xbb10('0x7f')]()['then'](function(_0x5eb1fb){if(!_0x5eb1fb){throw new db[(_0xbb10('0xa5'))][(_0xbb10('0xa6'))]('no\x20available\x20attributes');}_0x38eb3d=_[_0xbb10('0xa8')](_[_0xbb10('0x61')](_0x5eb1fb),['createdAt',_0xbb10('0xaa'),_0xbb10('0xab'),_0xbb10('0xac')]);if(_0xddfe35[_0xbb10('0x77')]['id']){delete _0xddfe35[_0xbb10('0x77')]['id'];}if(_['isNil'](_0xddfe35['body']['from'])){throw _0x604d55[_0xbb10('0x25')](0x1f4)['send'](new db[(_0xbb10('0xa5'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xbb10('0x96')](_0xddfe35[_0xbb10('0x77')][_0xbb10('0x77')])||_0xddfe35[_0xbb10('0x77')][_0xbb10('0x77')]===''){throw _0x604d55[_0xbb10('0x25')](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0xbb10('0xaf')));}if(_[_0xbb10('0x96')](_0xddfe35[_0xbb10('0x77')][_0xbb10('0xd9')])){throw _0x604d55[_0xbb10('0x25')](0x1f4)[_0xbb10('0x33')](new db[(_0xbb10('0xa5'))]['ValidationError'](_0xbb10('0xda')+_0x38eb3d));}if(!_[_0xbb10('0xb0')](_0x38eb3d,_0xddfe35[_0xbb10('0x77')][_0xbb10('0xd9')])){throw _0x604d55['status'](0x1f4)[_0xbb10('0x33')](new db['Sequelize']['ValidationError'](_0xbb10('0xdb')+_0x38eb3d));}_0x1c0529[_0xddfe35[_0xbb10('0x77')][_0xbb10('0xd9')]]=_0xddfe35[_0xbb10('0x77')][_0xbb10('0xad')];})[_0xbb10('0x18')](function(){return db['ChatWebsite'][_0xbb10('0x75')]({'where':{'id':_0xddfe35[_0xbb10('0x72')]['id']},'include':[{'model':db[_0xbb10('0xb2')],'as':_0xbb10('0xb3')},{'model':db[_0xbb10('0xdc')],'as':_0xbb10('0xdc')}]});})[_0xbb10('0x18')](handleEntityNotFound(_0x604d55,null))['then'](function(_0x2cbbb6){if(_0x2cbbb6&&_0x2cbbb6[_0xbb10('0xb3')]){_0x40eb16=_0x2cbbb6;var _0x391bce=_['defaults'](_0xddfe35['body'],{'firstName':_0xddfe35[_0xbb10('0x77')][_0xbb10('0xad')],'phone':_0xddfe35[_0xbb10('0x77')][_0xbb10('0xad')],'ListId':_0x2cbbb6[_0xbb10('0xac')]});_0x391bce[_0xddfe35[_0xbb10('0x77')][_0xbb10('0xd9')]]=_0xddfe35['body'][_0xbb10('0xad')];return db[_0xbb10('0xbe')][_0xbb10('0xdd')]({'where':_0x1c0529,'defaults':_0x391bce});}})['spread'](function(_0x5e195a){if(_0x5e195a){_0x3ff3fe=_0x5e195a;var _0x55efcf=fs['readFileSync'](path[_0xbb10('0x90')](config[_0xbb10('0x91')],_0xbb10('0xde')),_0xbb10('0xdf'));var _0x59cc7b=ejs[_0xbb10('0xe0')](_0x55efcf,{'body':_['toPairs'](_0xddfe35[_0xbb10('0x77')][_0xbb10('0x77')]),'bodyTitle':_0x40eb16[_0xbb10('0xe1')]});return db[_0xbb10('0xe2')][_0xbb10('0x76')]({'body':_0x59cc7b,'plainBody':htmlToText[_0xbb10('0xe3')](_0x59cc7b),'ContactId':_0x5e195a['id'],'ChatWebsiteId':_0x40eb16['id']});}})[_0xbb10('0x18')](function(_0x4541f2){_0x4d65e7=_0x4541f2;if(_0x3522cd[_0xbb10('0x66')]){var _0x71d5a4=_0x3522cd[_0xbb10('0x5d')](function(_0x471042){return{'name':_0x471042['originalname'],'basename':_0x471042[_0xbb10('0x8c')],'type':_0x471042[_0xbb10('0xe4')],'ChatOfflineMessageId':_0x4541f2['id']};});_0x3c01ff=_0x71d5a4[_0xbb10('0x5d')](_0x4d0f0b=>{var _0x204ebf={'filename':_0x4d0f0b['name'],'path':path[_0xbb10('0x90')](config[_0xbb10('0x91')],_0xbb10('0xe5'),_0xbb10('0xd8'),_0xbb10('0xe6'),'offline-chat',_0x4d0f0b['basename'])};return _0x204ebf;});if(!_0x40eb16[_0xbb10('0xe7')]){return db['sequelize']['transaction'](function(_0x2ff72a){return db['Attachment'][_0xbb10('0xe8')](_0x71d5a4,{'transaction':_0x2ff72a});});}}})[_0xbb10('0x18')](function(){if(_0x4d65e7){_0x22ec50=_0x4d65e7;return db[_0xbb10('0xdc')][_0xbb10('0x88')]({'where':{'service':!![]},'include':[{'model':db[_0xbb10('0xe9')],'as':_0xbb10('0xea'),'raw':!![],'include':[{'model':db[_0xbb10('0xeb')],'as':_0xbb10('0xeb'),'raw':!![]}]}]});}})['then'](function(_0x2aa734){if(_0x2aa734&&_0x2aa734['Smtp']&&_0x40eb16[_0xbb10('0xec')]&&_0x40eb16['forwardOfflineAddress']){var _0x24c018=_0x2aa734[_0xbb10('0xed')]();return respondWithRpcPromise('SendMail',_0xbb10('0xee'),{'account':_0x24c018,'message':{'from':util[_0xbb10('0x37')](_0xbb10('0xef'),_0x2aa734['name'],_0x2aa734[_0xbb10('0xf0')]||_0x2aa734[_0xbb10('0xea')][_0xbb10('0x78')]),'to':_0x40eb16['forwardOfflineAddress'],'subject':_0x40eb16[_0xbb10('0xf1')],'html':_0x22ec50[_0xbb10('0x77')],'attachments':_0x3c01ff}},client9003)[_0xbb10('0x18')](function(){return _0x22ec50;})['catch'](function(_0x3e6756){logger['error'](_0x3e6756);});}})[_0xbb10('0x18')](function(){if(_0x40eb16&&_0x40eb16[_0xbb10('0xe7')]&&_0x40eb16[_0xbb10('0xf2')]){var _0xd94118=[];if(_0x3522cd[_0xbb10('0x66')]){_0xd94118=_0x3522cd[_0xbb10('0x5d')](function(_0x23e592){return{'name':_0x23e592[_0xbb10('0xf3')],'basename':_0x23e592[_0xbb10('0x8c')],'type':_0x23e592[_0xbb10('0xe4')],'ChatOfflineMessageId':_0x4d65e7['id']};});}var _0x49982e;if(!_['isNil'](_0x40eb16[_0xbb10('0xf4')])){var _0x4739a6=_[_0xbb10('0x5d')](_0xddfe35['body'],function(_0x3d5870){return _0x3d5870;});var _0x1067f2=_[_0xbb10('0xf5')](_0x4739a6)[0x0];var _0x108ec7=_[_0xbb10('0xf6')](_0x1067f2,function(_0x431673){return _0x431673;});_0x49982e=_0x108ec7[0x1][_0x40eb16[_0xbb10('0xf4')]];}var _0x2035e1={'from':_0x3ff3fe[_0xbb10('0xf0')],'firstName':_0x3ff3fe['firstName'],'lastName':_0x3ff3fe[_0xbb10('0x4e')],'mapKey':_0xbb10('0xf0'),'message':{'from':_0x3ff3fe[_0xbb10('0xf0')],'to':_0x40eb16[_0xbb10('0xdc')]['email'],'cc':'','subject':_[_0xbb10('0x96')](_0x49982e)?_0x40eb16[_0xbb10('0xf1')]:_0x49982e,'messageId':'','sentAt':new Date(),'attach':_0xd94118[_0xbb10('0x66')],'attachments':_0xd94118,'originChannel':'Chat','ChatWebsiteId':_0x40eb16['id'],'ChatOfflineMessageId':_0x22ec50['id'],'originTo':_0x40eb16['MailAccount'][_0xbb10('0xf0')]},'body':_0x22ec50['body']};var _0x37c688={'account':{'id':_0x40eb16['MailAccountId']},'body':_0x2035e1,'log':_0xbb10('0xf7')};return respondWithRpcPromise(_0xbb10('0xf7'),_0xbb10('0xf8'),_0x37c688,client9001)[_0xbb10('0x18')](function(){return _0x22ec50;})[_0xbb10('0x23')](function(_0x3c5a97){logger[_0xbb10('0x1e')](_0x3c5a97);});}return;})['then'](function(){if(_0x22ec50){return _0x22ec50;}})[_0xbb10('0x18')](respondWithResult(_0x604d55,null))[_0xbb10('0x23')](function(){for(var _0x28271e of _0x3522cd){var _0x2807d2=path[_0xbb10('0x90')](config[_0xbb10('0x91')],'server',_0xbb10('0xd8'),_0xbb10('0xe6'),_0xbb10('0xf9'),_0x28271e[_0xbb10('0x8c')]);fs_extra[_0xbb10('0xfa')](_0x2807d2)[_0xbb10('0x23')](function(_0x16c041){logger['error'](_0xbb10('0xfb'),_0x2807d2,_0x16c041);});}});};exports[_0xbb10('0xfc')]=function(_0x1e8713,_0x53c293){return db[_0xbb10('0xc2')]['find']({'where':{'id':_0x1e8713[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x53c293,null))[_0xbb10('0x18')](function(_0x58a447){if(_0x58a447){return _0x58a447['addInteraction'](_0x1e8713[_0xbb10('0x77')][_0xbb10('0xfd')],_[_0xbb10('0xfe')](_0x1e8713[_0xbb10('0x77')],[_0xbb10('0xfd'),'id'])||{});}})[_0xbb10('0x18')](respondWithResult(_0x53c293,null))[_0xbb10('0x23')](handleError(_0x53c293,null));};exports[_0xbb10('0xff')]=function(_0x2ba569,_0x8700e6){var _0x1e6509={'raw':![],'where':{}};var _0x5d8005={};var _0x4e3b32={'count':0x0,'rows':[]};return db[_0xbb10('0x5e')][_0xbb10('0x88')]({'where':{'id':_0x2ba569['params']['id']}})['then'](handleEntityNotFound(_0x8700e6,null))[_0xbb10('0x18')](function(_0x160c01){if(_0x160c01){_0x5d8005[_0xbb10('0x55')]=_['keys'](db[_0xbb10('0xc2')][_0xbb10('0x73')]);_0x5d8005['query']=_[_0xbb10('0x61')](_0x2ba569[_0xbb10('0x60')]);_0x5d8005['filters']=_['intersection'](_0x5d8005[_0xbb10('0x55')],_0x5d8005[_0xbb10('0x60')]);_0x1e6509[_0xbb10('0x64')]=_['intersection'](_0x5d8005['model'],qs[_0xbb10('0x65')](_0x2ba569[_0xbb10('0x60')]['fields']));_0x1e6509[_0xbb10('0x64')]=_0x1e6509[_0xbb10('0x64')]['length']?_0x1e6509[_0xbb10('0x64')]:_0x5d8005[_0xbb10('0x55')];if(!_0x2ba569[_0xbb10('0x60')][_0xbb10('0x67')]('nolimit')){_0x1e6509[_0xbb10('0x29')]=qs['limit'](_0x2ba569[_0xbb10('0x60')][_0xbb10('0x29')]);_0x1e6509[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x2ba569[_0xbb10('0x60')][_0xbb10('0x27')]);}_0x1e6509[_0xbb10('0x69')]=qs[_0xbb10('0x6a')](_0x2ba569['query'][_0xbb10('0x6a')]);_0x1e6509[_0xbb10('0x6b')]=qs[_0xbb10('0x62')](_[_0xbb10('0x6c')](_0x2ba569['query'],_0x5d8005['filters']));_0x1e6509[_0xbb10('0x6b')][_0xbb10('0x81')]=_0x160c01['id'];if(_0x2ba569[_0xbb10('0x60')][_0xbb10('0x6d')]){_0x1e6509['where']=_[_0xbb10('0x6e')](_0x1e6509[_0xbb10('0x6b')],{'$or':_['map'](_0x1e6509[_0xbb10('0x64')],function(_0x4f71fd){var _0x59d6a7={};_0x59d6a7[_0x4f71fd]={'$like':'%'+_0x2ba569[_0xbb10('0x60')][_0xbb10('0x6d')]+'%'};return _0x59d6a7;})});}_0x1e6509=_[_0xbb10('0x6e')]({},_0x1e6509,_0x2ba569[_0xbb10('0x6f')]);return db[_0xbb10('0xc2')]['count']({'where':_0x1e6509[_0xbb10('0x6b')]})[_0xbb10('0x18')](function(_0x356601){_0x4e3b32[_0xbb10('0x2a')]=_0x356601;if(_0x2ba569[_0xbb10('0x60')][_0xbb10('0x74')]){_0x1e6509[_0xbb10('0x70')]=[{'model':db[_0xbb10('0xbe')],'as':_0xbb10('0x100'),'required':![]},{'model':db[_0xbb10('0xcd')],'as':_0xbb10('0x101'),'attributes':[_0xbb10('0x32'),_0xbb10('0x102'),_0xbb10('0x103')],'required':![]},{'model':db[_0xbb10('0x104')],'as':_0xbb10('0x105'),'attributes':['id',_0xbb10('0x32'),_0xbb10('0x106')],'where':_0x2ba569[_0xbb10('0x60')][_0xbb10('0x107')]?{'id':_0x2ba569[_0xbb10('0x60')][_0xbb10('0x107')]}:undefined,'required':_0x2ba569[_0xbb10('0x60')][_0xbb10('0x107')]?!![]:![]}];}return db[_0xbb10('0xc2')][_0xbb10('0x84')](_0x1e6509);})[_0xbb10('0x18')](function(_0x57b891){_0x4e3b32[_0xbb10('0x71')]=_0x57b891;return _0x4e3b32;});}})[_0xbb10('0x18')](respondWithFilteredResult(_0x8700e6,_0x1e6509))['catch'](handleError(_0x8700e6,null));};exports[_0xbb10('0x35')]=function(_0x1ebd41,_0x4d2ada){var _0x3a20c0=0x0;var _0x3b96dd=0x0;var _0x4e97fd=![];var _0x21a460;var _0x3ff9bc;return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0x1ebd41['params']['id']},'include':[{'model':db[_0xbb10('0x41')],'as':_0xbb10('0x41'),'include':[{'model':db[_0xbb10('0x41')],'as':_0xbb10('0x42'),'attributes':['id','interval']}]}]})[_0xbb10('0x18')](handleEntityNotFound(_0x4d2ada,null))[_0xbb10('0x18')](function(_0x327749){if(_0x327749){_0x21a460=_0x327749;return _0x327749[_0xbb10('0x108')]({'raw':!![]});}})[_0xbb10('0x18')](function(_0x3045ff){if(_0x21a460){if(_0x3045ff){_0x3ff9bc=_0x3045ff;}}return require(_0xbb10('0x94'))[_0xbb10('0x95')]();})[_0xbb10('0x18')](function(_0x22900c){if(_0x22900c){_0x3b96dd=_0x22900c[_0xbb10('0x109')];_0x4e97fd=_0x22900c['custom'];}})[_0xbb10('0x18')](function(){return db[_0xbb10('0xc2')][_0xbb10('0x2a')]({'where':{'closed':![]}});})[_0xbb10('0x18')](function(_0x57d03c){_0x3a20c0=_0x57d03c;if(_0x3b96dd&&_0x57d03c>_0x3b96dd){return db['License'][_0xbb10('0x88')]({'where':{'id':0x1}})[_0xbb10('0x18')](function(_0x4785fb){if(_0x4785fb){_0x4785fb[_0xbb10('0x10a')]('chatLicenseExceeded');}});}})[_0xbb10('0x18')](function(){if(!_0x21a460[_0xbb10('0x41')]||!_0x21a460[_0xbb10('0x41')]['Intervals'])return!![];return checkWebsiteIntervals(_0x21a460);})['then'](function(_0x4206bf){var _0xd6b33=fs['readFileSync'](path['join'](config[_0xbb10('0x91')],_0xbb10('0x10b')),_0xbb10('0xdf'));var _0x45cd03=new url[(_0xbb10('0x10c'))](_0x21a460[_0xbb10('0x10d')])['origin'];var _0x408544=_0xbb10('0x10e');var _0x1bb753=![];var _0x235367={'chatVersion':_0x408544,'chatWebsiteAddressOrigin':_0x45cd03,'remote':_0x21a460[_0xbb10('0x10f')],'query':querystring[_0xbb10('0x1d')](_[_0xbb10('0x6e')](_0x21a460[_0xbb10('0x2d')]({'plain':!![]}),{'customerIp':_0x1ebd41[_0xbb10('0xc0')][_0xbb10('0x4a')]||_0x1ebd41['headers'][_0xbb10('0x110')]||_0x1ebd41[_0xbb10('0x111')]['remoteAddress']||_0x1ebd41['ip'],'referer':_0x1ebd41['headers']['referer'],'openedInteractions':_0x3a20c0,'maxInteractions':_0x3b96dd,'virtual':_0x4e97fd['virtual'],'online':_0x4206bf,'custom':_0x4e97fd}))['replace'](/'/g,'\x5c\x27')};_0x4d2ada['send'](ejs['render'](Mustache['render'](_0xd6b33,_0x235367),{'proactiveActions':_0x3ff9bc,'alignment':_0x21a460[_0xbb10('0x112')],'verticalAlignment':_0x21a460[_0xbb10('0x113')],'div_color':_0x21a460['color'],'labelText':_0x21a460[_0xbb10('0x114')],'text_color':_0x21a460[_0xbb10('0x115')],'text_button_color':_0x21a460[_0xbb10('0x116')],'button_color':_0x21a460[_0xbb10('0x117')],'background_color':_0x21a460[_0xbb10('0x118')],'hideWhenOffline':_0x21a460[_0xbb10('0x119')],'intervalId':_0x21a460[_0xbb10('0x11a')],'isDevelopment':_0x1bb753,'chatVersion':_0x408544}));})[_0xbb10('0x23')](handleError(_0x4d2ada,null));};exports[_0xbb10('0x11b')]=function(_0x14d9e7,_0x19dfef){var _0x13df4e=_0x14d9e7['params']['id'];var _0x44c373=_0x14d9e7[_0xbb10('0x77')];var _0x2e72e2=0xc8;var _0x3a6298=null;return db[_0xbb10('0x11c')]['transaction']({'isolationLevel':db[_0xbb10('0x11c')]['Transaction']['ISOLATION_LEVELS'][_0xbb10('0x11d')]},function(_0xf4ebf8){return db['ChatWebsite'][_0xbb10('0x88')]({'where':{'id':_0x13df4e},'transaction':_0xf4ebf8})[_0xbb10('0x18')](function(_0x201e05){if(_0x201e05){return db[_0xbb10('0x11e')][_0xbb10('0x2c')]({'where':{'ChatWebsiteId':_0x13df4e},'transaction':_0xf4ebf8})['then'](function(){var _0x486a2f=_[_0xbb10('0x5d')](_0x44c373,function(_0x118b63){_0x118b63['ChatWebsiteId']=_0x13df4e;return _0x118b63;});return db[_0xbb10('0x11e')][_0xbb10('0xe8')](_0x486a2f,{'transaction':_0xf4ebf8});});}else{_0x2e72e2=0x194;_0x3a6298=[];}});})[_0xbb10('0x18')](function(){if(_0x2e72e2!==0x194){return db[_0xbb10('0x11e')][_0xbb10('0x11f')]({'where':{'ChatWebsiteId':_0x13df4e},'order':_0xbb10('0xbc')})[_0xbb10('0x18')](function(_0x3be6ec){_0x3a6298=_0x3be6ec;});}})[_0xbb10('0x23')](function(_0x514c07){_0x2e72e2=0x1f4;logger[_0xbb10('0x1e')](_0x514c07[_0xbb10('0x31')]);if(_0x514c07[_0xbb10('0x32')]){delete _0x514c07[_0xbb10('0x32')];}_0x3a6298=_0x514c07;})['finally'](function(){if(_0x3a6298===null){_0x19dfef[_0xbb10('0x24')](_0x2e72e2);}else{if(_0x2e72e2===0x1f4){_0x19dfef[_0xbb10('0x25')](_0x2e72e2)['send'](_0x3a6298);}else{_0x19dfef['status'](_0x2e72e2)[_0xbb10('0x26')](_0x3a6298);}}});};exports['getApplications']=function(_0x40ff8e,_0x30ffca){var _0x214dcb={};var _0x3e19f4={};var _0x56e3d0;var _0x90ab9f;return db['ChatWebsite'][_0xbb10('0x88')]({'where':{'id':_0x40ff8e[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x30ffca,null))[_0xbb10('0x18')](function(_0xa5cb35){if(_0xa5cb35){_0x56e3d0=_0xa5cb35;_0x3e19f4[_0xbb10('0x55')]=_[_0xbb10('0x61')](db[_0xbb10('0x11e')][_0xbb10('0x73')]);_0x3e19f4['query']=_[_0xbb10('0x61')](_0x40ff8e[_0xbb10('0x60')]);_0x3e19f4[_0xbb10('0x62')]=_[_0xbb10('0x63')](_0x3e19f4[_0xbb10('0x55')],_0x3e19f4['query']);_0x214dcb[_0xbb10('0x64')]=_[_0xbb10('0x63')](_0x3e19f4[_0xbb10('0x55')],qs[_0xbb10('0x65')](_0x40ff8e[_0xbb10('0x60')]['fields']));_0x214dcb['attributes']=_0x214dcb['attributes'][_0xbb10('0x66')]?_0x214dcb['attributes']:_0x3e19f4['model'];_0x214dcb[_0xbb10('0x69')]=qs['sort'](_0x40ff8e[_0xbb10('0x60')][_0xbb10('0x6a')]);_0x214dcb['where']=qs[_0xbb10('0x62')](_[_0xbb10('0x6c')](_0x40ff8e[_0xbb10('0x60')],_0x3e19f4[_0xbb10('0x62')]));if(_0x40ff8e['query']['filter']){_0x214dcb['where']=_[_0xbb10('0x6e')](_0x214dcb[_0xbb10('0x6b')],{'$or':_['map'](_0x214dcb[_0xbb10('0x64')],function(_0x3fd91c){var _0x3d2e5f={};_0x3d2e5f[_0x3fd91c]={'$like':'%'+_0x40ff8e[_0xbb10('0x60')][_0xbb10('0x6d')]+'%'};return _0x3d2e5f;})});}_0x214dcb=_['merge']({},_0x214dcb,_0x40ff8e[_0xbb10('0x6f')]);return _0x56e3d0[_0xbb10('0x120')](_0x214dcb);}})[_0xbb10('0x18')](function(_0x4aa311){if(_0x4aa311){_0x90ab9f=_0x4aa311[_0xbb10('0x66')];if(!_0x40ff8e['query'][_0xbb10('0x67')](_0xbb10('0x68'))){_0x214dcb[_0xbb10('0x29')]=qs['limit'](_0x40ff8e[_0xbb10('0x60')][_0xbb10('0x29')]);_0x214dcb['offset']=qs[_0xbb10('0x27')](_0x40ff8e[_0xbb10('0x60')][_0xbb10('0x27')]);}return _0x56e3d0[_0xbb10('0x120')](_0x214dcb);}})[_0xbb10('0x18')](function(_0x589c18){if(_0x589c18){return _0x589c18?{'count':_0x90ab9f,'rows':_0x589c18}:null;}})['then'](respondWithResult(_0x30ffca,null))[_0xbb10('0x23')](handleError(_0x30ffca,null));};exports[_0xbb10('0x121')]=function(_0x22dd3d,_0x1b0734){return db[_0xbb10('0x122')]['find']({'where':{'id':_0x22dd3d[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x1b0734,null))[_0xbb10('0x18')](function(_0x13d77a){if(_0x13d77a){return _0x13d77a[_0xbb10('0x121')](_0x22dd3d['body']['ids'],_[_0xbb10('0xfe')](_0x22dd3d[_0xbb10('0x77')],[_0xbb10('0xfd'),'id'])||{});}})[_0xbb10('0x18')](respondWithResult(_0x1b0734,null))['catch'](handleError(_0x1b0734,null));};exports['getProactiveActions']=function(_0x1da101,_0x4d7ea2){var _0x4840ac={};var _0x4e2dbb={};var _0x5ce8f5;var _0x3758dd;return db[_0xbb10('0x5e')][_0xbb10('0x88')]({'where':{'id':_0x1da101[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x4d7ea2,null))['then'](function(_0x12829c){if(_0x12829c){_0x5ce8f5=_0x12829c;_0x4e2dbb[_0xbb10('0x55')]=_[_0xbb10('0x61')](db['ChatProactiveAction'][_0xbb10('0x73')]);_0x4e2dbb[_0xbb10('0x60')]=_[_0xbb10('0x61')](_0x1da101[_0xbb10('0x60')]);_0x4e2dbb[_0xbb10('0x62')]=_[_0xbb10('0x63')](_0x4e2dbb[_0xbb10('0x55')],_0x4e2dbb[_0xbb10('0x60')]);_0x4840ac[_0xbb10('0x64')]=_[_0xbb10('0x63')](_0x4e2dbb[_0xbb10('0x55')],qs[_0xbb10('0x65')](_0x1da101[_0xbb10('0x60')][_0xbb10('0x65')]));_0x4840ac[_0xbb10('0x64')]=_0x4840ac['attributes']['length']?_0x4840ac['attributes']:_0x4e2dbb[_0xbb10('0x55')];_0x4840ac['order']=qs[_0xbb10('0x6a')](_0x1da101['query'][_0xbb10('0x6a')]);_0x4840ac['where']=qs['filters'](_[_0xbb10('0x6c')](_0x1da101[_0xbb10('0x60')],_0x4e2dbb['filters']));if(_0x1da101[_0xbb10('0x60')][_0xbb10('0x6d')]){_0x4840ac[_0xbb10('0x6b')]=_[_0xbb10('0x6e')](_0x4840ac['where'],{'$or':_['map'](_0x4840ac[_0xbb10('0x64')],function(_0x18c663){var _0x2c3bc0={};_0x2c3bc0[_0x18c663]={'$like':'%'+_0x1da101[_0xbb10('0x60')][_0xbb10('0x6d')]+'%'};return _0x2c3bc0;})});}_0x4840ac=_[_0xbb10('0x6e')]({},_0x4840ac,_0x1da101[_0xbb10('0x6f')]);return _0x5ce8f5['getProactiveActions'](_0x4840ac);}})[_0xbb10('0x18')](function(_0x51cdbd){if(_0x51cdbd){_0x3758dd=_0x51cdbd['length'];if(!_0x1da101[_0xbb10('0x60')]['hasOwnProperty'](_0xbb10('0x68'))){_0x4840ac[_0xbb10('0x29')]=qs[_0xbb10('0x29')](_0x1da101[_0xbb10('0x60')][_0xbb10('0x29')]);_0x4840ac['offset']=qs[_0xbb10('0x27')](_0x1da101[_0xbb10('0x60')][_0xbb10('0x27')]);}return _0x5ce8f5[_0xbb10('0x108')](_0x4840ac);}})[_0xbb10('0x18')](function(_0x1c387b){if(_0x1c387b){return _0x1c387b?{'count':_0x3758dd,'rows':_0x1c387b}:null;}})['then'](respondWithResult(_0x4d7ea2,null))['catch'](handleError(_0x4d7ea2,null));};exports[_0xbb10('0x123')]=function(_0x2f42cc,_0x22fa73){var _0x35971b=_0x2f42cc[_0xbb10('0x60')]['online']==='false'?_0xbb10('0x124'):_0xbb10('0x125');return db['ChatWebsite']['find']({'attributes':['id',_0x35971b],'where':{'id':_0x2f42cc[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x22fa73,null))[_0xbb10('0x18')](function(_0x450772){if(_0x450772){var _0x170e2a=_0x450772[_0x35971b];var _0x19b8cc=_0x170e2a&&_0x170e2a['items']?_0x170e2a[_0xbb10('0x126')]:[];_0x22fa73[_0xbb10('0x33')]({'fromKey':_[_0xbb10('0x96')](_0x170e2a[_0xbb10('0x127')])?undefined:_0x170e2a[_0xbb10('0x127')],'count':_0x19b8cc[_0xbb10('0x66')],'rows':_0x19b8cc});}})[_0xbb10('0x23')](handleError(_0x22fa73,null));};exports[_0xbb10('0x128')]=function(_0x1b5bb8,_0x4d054b){var _0x54bf10={'raw':![],'where':{}};var _0x518ec0={};var _0x111c15={'count':0x0,'rows':[]};return db[_0xbb10('0x5e')][_0xbb10('0x88')]({'where':{'id':_0x1b5bb8[_0xbb10('0x72')]['id']}})['then'](handleEntityNotFound(_0x4d054b,null))['then'](function(_0x595ac6){if(_0x595ac6){_0x518ec0[_0xbb10('0x55')]=_[_0xbb10('0x61')](db[_0xbb10('0xe2')][_0xbb10('0x73')]);_0x518ec0[_0xbb10('0x60')]=_[_0xbb10('0x61')](_0x1b5bb8[_0xbb10('0x60')]);_0x518ec0[_0xbb10('0x62')]=_[_0xbb10('0x63')](_0x518ec0[_0xbb10('0x55')],_0x518ec0[_0xbb10('0x60')]);_0x54bf10[_0xbb10('0x64')]=_[_0xbb10('0x63')](_0x518ec0[_0xbb10('0x55')],qs['fields'](_0x1b5bb8[_0xbb10('0x60')][_0xbb10('0x65')]));_0x54bf10[_0xbb10('0x64')]=_0x54bf10[_0xbb10('0x64')][_0xbb10('0x66')]?_0x54bf10[_0xbb10('0x64')]:_0x518ec0['model'];if(!_0x1b5bb8[_0xbb10('0x60')][_0xbb10('0x67')](_0xbb10('0x68'))){_0x54bf10[_0xbb10('0x29')]=qs[_0xbb10('0x29')](_0x1b5bb8[_0xbb10('0x60')][_0xbb10('0x29')]);_0x54bf10[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x1b5bb8['query'][_0xbb10('0x27')]);}_0x54bf10[_0xbb10('0x69')]=qs[_0xbb10('0x6a')](_0x1b5bb8[_0xbb10('0x60')][_0xbb10('0x6a')]);_0x54bf10[_0xbb10('0x6b')]=qs[_0xbb10('0x62')](_[_0xbb10('0x6c')](_0x1b5bb8[_0xbb10('0x60')],_0x518ec0['filters']));_0x54bf10[_0xbb10('0x6b')]['ChatWebsiteId']=_0x595ac6['id'];if(_0x1b5bb8[_0xbb10('0x60')][_0xbb10('0x6d')]){_0x54bf10['where']=_['merge'](_0x54bf10[_0xbb10('0x6b')],{'$or':_[_0xbb10('0x5d')](_0x54bf10[_0xbb10('0x64')],function(_0x245219){var _0x13c10a={};_0x13c10a[_0x245219]={'$like':'%'+_0x1b5bb8[_0xbb10('0x60')][_0xbb10('0x6d')]+'%'};return _0x13c10a;})});}_0x54bf10=_[_0xbb10('0x6e')]({},_0x54bf10,_0x1b5bb8[_0xbb10('0x6f')]);return db[_0xbb10('0xe2')][_0xbb10('0x2a')]({'where':_0x54bf10[_0xbb10('0x6b')]})[_0xbb10('0x18')](function(_0x2f76){_0x111c15[_0xbb10('0x2a')]=_0x2f76;if(_0x1b5bb8['query'][_0xbb10('0x74')]){_0x54bf10['include']=[{'all':!![]}];}else{_0x54bf10[_0xbb10('0x70')]=[{'model':db[_0xbb10('0xbe')],'as':_0xbb10('0x100'),'required':![]},{'model':db[_0xbb10('0x129')],'as':_0xbb10('0x12a'),'required':![]}];}return db[_0xbb10('0xe2')][_0xbb10('0x84')](_0x54bf10);})[_0xbb10('0x18')](function(_0x5c88bd){_0x111c15['rows']=_0x5c88bd;return _0x111c15;});}})['then'](respondWithFilteredResult(_0x4d054b,_0x54bf10))[_0xbb10('0x23')](handleError(_0x4d054b,null));};exports[_0xbb10('0x12b')]=function(_0xdeed5b,_0x54c61c){return db[_0xbb10('0x5e')]['find']({'where':{'id':_0xdeed5b[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x54c61c,null))['then'](function(_0x11154d){if(_0x11154d){return _0x11154d[_0xbb10('0x12b')](_0xdeed5b[_0xbb10('0x77')][_0xbb10('0xfd')],_[_0xbb10('0xfe')](_0xdeed5b['body'],[_0xbb10('0xfd'),'id'])||{})[_0xbb10('0x12c')](function(_0x54700f){for(var _0x358e1c=0x0;_0x358e1c<_0xdeed5b[_0xbb10('0x77')]['ids'][_0xbb10('0x66')];_0x358e1c+=0x1){socket[_0xbb10('0x12d')](_0xbb10('0x12e'),{'UserId':Number(_0xdeed5b[_0xbb10('0x77')]['ids'][_0x358e1c]),'ChatWebsiteId':Number(_0xdeed5b[_0xbb10('0x72')]['id'])});}return _0x54700f;});}})[_0xbb10('0x18')](respondWithResult(_0x54c61c,null))[_0xbb10('0x23')](handleError(_0x54c61c,null));};exports['removeAgents']=function(_0x593de5,_0x284b77){return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0x593de5[_0xbb10('0x72')]['id']}})['then'](handleEntityNotFound(_0x284b77,null))[_0xbb10('0x18')](function(_0x2b6353){if(_0x2b6353){return _0x2b6353[_0xbb10('0x12f')](_0x593de5[_0xbb10('0x60')][_0xbb10('0xfd')])['then'](function(){if(_['isArray'](_0x593de5[_0xbb10('0x60')][_0xbb10('0xfd')])){for(var _0x556983=0x0;_0x556983<_0x593de5['query'][_0xbb10('0xfd')][_0xbb10('0x66')];_0x556983+=0x1){socket[_0xbb10('0x12d')](_0xbb10('0x130'),{'UserId':Number(_0x593de5[_0xbb10('0x60')][_0xbb10('0xfd')][_0x556983]),'ChatWebsiteId':Number(_0x593de5['params']['id'])});}}else{socket['emit'](_0xbb10('0x130'),{'UserId':Number(_0x593de5[_0xbb10('0x60')][_0xbb10('0xfd')]),'ChatWebsiteId':Number(_0x593de5[_0xbb10('0x72')]['id'])});}});}})[_0xbb10('0x18')](respondWithStatusCode(_0x284b77,null))[_0xbb10('0x23')](handleError(_0x284b77,null));};exports['getAgents']=function(_0x477d10,_0x19686c){var _0xb88335={};var _0x218f91={};var _0x492605;var _0x21ad98;return db[_0xbb10('0x5e')][_0xbb10('0x88')]({'where':{'id':_0x477d10[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x19686c,null))[_0xbb10('0x18')](function(_0x245818){if(_0x245818){_0x492605=_0x245818;_0x218f91[_0xbb10('0x55')]=_[_0xbb10('0x61')](db[_0xbb10('0xcd')][_0xbb10('0x73')]);_0x218f91[_0xbb10('0x60')]=_['keys'](_0x477d10[_0xbb10('0x60')]);_0x218f91[_0xbb10('0x62')]=_['intersection'](_0x218f91[_0xbb10('0x55')],_0x218f91[_0xbb10('0x60')]);_0xb88335[_0xbb10('0x64')]=_['intersection'](_0x218f91[_0xbb10('0x55')],qs[_0xbb10('0x65')](_0x477d10[_0xbb10('0x60')][_0xbb10('0x65')]));_0xb88335[_0xbb10('0x64')]=_0xb88335[_0xbb10('0x64')]['length']?_0xb88335[_0xbb10('0x64')]:_0x218f91['model'];_0xb88335[_0xbb10('0x69')]=qs[_0xbb10('0x6a')](_0x477d10[_0xbb10('0x60')][_0xbb10('0x6a')]);_0xb88335['where']=qs[_0xbb10('0x62')](_[_0xbb10('0x6c')](_0x477d10['query'],_0x218f91[_0xbb10('0x62')]));if(_0x477d10['query'][_0xbb10('0x6d')]){_0xb88335[_0xbb10('0x6b')]=_[_0xbb10('0x6e')](_0xb88335[_0xbb10('0x6b')],{'$or':_[_0xbb10('0x5d')](_0xb88335[_0xbb10('0x64')],function(_0x130268){var _0x44050c={};_0x44050c[_0x130268]={'$like':'%'+_0x477d10['query']['filter']+'%'};return _0x44050c;})});}_0xb88335=_[_0xbb10('0x6e')]({},_0xb88335,_0x477d10[_0xbb10('0x6f')]);return _0x492605[_0xbb10('0x131')](_0xb88335);}})[_0xbb10('0x18')](function(_0x6f428e){if(_0x6f428e){_0x21ad98=_0x6f428e[_0xbb10('0x66')];if(!_0x477d10[_0xbb10('0x60')][_0xbb10('0x67')](_0xbb10('0x68'))){_0xb88335['limit']=qs[_0xbb10('0x29')](_0x477d10['query'][_0xbb10('0x29')]);_0xb88335[_0xbb10('0x27')]=qs['offset'](_0x477d10[_0xbb10('0x60')][_0xbb10('0x27')]);}return _0x492605[_0xbb10('0x131')](_0xb88335);}})[_0xbb10('0x18')](function(_0x14c314){if(_0x14c314){return _0x14c314?{'count':_0x21ad98,'rows':_0x14c314}:null;}})[_0xbb10('0x18')](respondWithResult(_0x19686c,null))[_0xbb10('0x23')](handleError(_0x19686c,null));}; \ No newline at end of file +var _0x7a54=['set','Content-Range','update','destroy','get','UserProfileResource','name','send','Command','getSnippet','timezone','format','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','inspect','No\x20timezone','map','Interval','Intervals','all','some','setUA','user-agent','getResult','customerIp','cf-connecting-ip','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','device','%s\x20%s\x20%s','model','vendor','type','stringify','index','Pause','ChatWebsite','rawAttributes','fieldName','key','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','findAll','rows','params','mandatoryDispositionPause','includeAll','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','pick','Disposition','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','isNil','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','asc','contact','threadId','ChatInteraction','interaction','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','ChatQueue','queue','waitForTheAssignedQueue','startRouting','EventManager','notify','offline','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','fromString','originalname','mimetype','attachments','offline-chat','openNewInteraction','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','email','user','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','hasOwnProperty','options','Contact','Owner','fullname','internal','Tags','tag','getProactiveActions','../../config/license/util','virtual','License','increment','server/files/chat/iframe.ejs','URL','origin','remote','headers','x-forwarded-for','connection','remoteAddress','alignment','verticalAlignment','color','labelText','color_button','sequelize','Transaction','ISOLATION_LEVELS','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','fs-extra','lodash','html-to-text','ioredis','jayson/promise','url','../../components/parsers/qs','api','../../errors/api','APIOutOfIntervalError','APINotFoundError','redis','defaults','localhost','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x560586,_0x35996b){var _0x3c09da=function(_0x56d3c7){while(--_0x56d3c7){_0x560586['push'](_0x560586['shift']());}};_0x3c09da(++_0x35996b);}(_0x7a54,0x106));var _0x47a5=function(_0x5a1b1b,_0xddeabf){_0x5a1b1b=_0x5a1b1b-0x0;var _0x1ae9e9=_0x7a54[_0x5a1b1b];return _0x1ae9e9;};'use strict';var Mustache=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0x3'));var _=require(_0x47a5('0x4'));var querystring=require('querystring');var htmlToText=require(_0x47a5('0x5'));var Redis=require(_0x47a5('0x6'));var jayson=require(_0x47a5('0x7'));var url=require(_0x47a5('0x8'));var qs=require(_0x47a5('0x9'));var logger=require('../../config/logger')(_0x47a5('0xa'));var config=require('../../config/environment');var APIOutOfIntervalError=require(_0x47a5('0xb'))[_0x47a5('0xc')];var APINotFoundError=require('../../errors/api')[_0x47a5('0xd')];var APIHandleError=require('../../errors/api')['handleError'];var db=require('../../mysqldb')['db'];config[_0x47a5('0xe')]=_[_0x47a5('0xf')](config['redis'],{'host':_0x47a5('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x47a5('0x11'))[_0x47a5('0x12')](socket);var client=jayson[_0x47a5('0x13')][_0x47a5('0x14')]({'port':0x232c});var client9002=jayson[_0x47a5('0x13')][_0x47a5('0x14')]({'port':0x232a});var client9003=jayson[_0x47a5('0x13')]['http']({'port':0x232b});var client9001=jayson[_0x47a5('0x13')][_0x47a5('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x1cf309,_0x711793,_0x139f25,_0x620ee9){return new Promise(function(_0x3c6c46,_0x190faa){var _0x4e99a8=_0x620ee9||client;return _0x4e99a8[_0x47a5('0x15')](_0x1cf309,_0x139f25)[_0x47a5('0x16')](function(_0x3b001e){logger[_0x47a5('0x17')](_0x47a5('0x18'),_0x711793,'request\x20sent');logger['debug'](_0x47a5('0x19'),_0x711793,'request\x20sent',JSON['stringify'](_0x3b001e));if(_0x3b001e[_0x47a5('0x1a')]){if(_0x3b001e[_0x47a5('0x1a')][_0x47a5('0x1b')]===0x1f4){logger[_0x47a5('0x1a')](_0x47a5('0x18'),_0x711793,_0x3b001e[_0x47a5('0x1a')][_0x47a5('0x1c')]);return _0x190faa(_0x3b001e[_0x47a5('0x1a')][_0x47a5('0x1c')]);}logger['error'](_0x47a5('0x18'),_0x711793,_0x3b001e[_0x47a5('0x1a')]['message']);return _0x3c6c46(_0x3b001e[_0x47a5('0x1a')][_0x47a5('0x1c')]);}else{logger[_0x47a5('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x711793,_0x47a5('0x1d'));_0x3c6c46(_0x3b001e[_0x47a5('0x1e')][_0x47a5('0x1c')]);}})[_0x47a5('0x1f')](function(_0x5ef1b1){logger[_0x47a5('0x1a')](_0x47a5('0x18'),_0x711793,_0x5ef1b1);_0x190faa(_0x5ef1b1);});});}function respondWithStatusCode(_0x513981,_0x28747d){_0x28747d=_0x28747d||0xcc;return function(_0xc4cd63){if(_0xc4cd63){return _0x513981[_0x47a5('0x20')](_0x28747d);}return _0x513981[_0x47a5('0x21')](_0x28747d)[_0x47a5('0x22')]();};}function respondWithResult(_0x50bf17,_0x53078a){_0x53078a=_0x53078a||0xc8;return function(_0x136745){if(_0x136745){return _0x50bf17['status'](_0x53078a)[_0x47a5('0x23')](_0x136745);}};}function respondWithFilteredResult(_0x5b6c4e,_0x23cb77){return function(_0x378208){if(_0x378208){var _0x36ad34=typeof _0x23cb77[_0x47a5('0x24')]===_0x47a5('0x25')&&typeof _0x23cb77[_0x47a5('0x26')]===_0x47a5('0x25');var _0x136b14=_0x378208[_0x47a5('0x27')];var _0x361bfa=_0x36ad34?0x0:_0x23cb77[_0x47a5('0x24')];var _0x11a4fa=_0x36ad34?_0x378208[_0x47a5('0x27')]:_0x23cb77['offset']+_0x23cb77[_0x47a5('0x26')];var _0x51833b;if(_0x11a4fa>=_0x136b14){_0x11a4fa=_0x136b14;_0x51833b=0xc8;}else{_0x51833b=0xce;}_0x5b6c4e[_0x47a5('0x21')](_0x51833b);return _0x5b6c4e[_0x47a5('0x28')](_0x47a5('0x29'),_0x361bfa+'-'+_0x11a4fa+'/'+_0x136b14)['json'](_0x378208);}return null;};}function saveUpdates(_0x256650){return function(_0x625952){if(_0x625952){return _0x625952[_0x47a5('0x2a')](_0x256650)[_0x47a5('0x16')](function(_0x51cc81){return _0x51cc81;});}return null;};}function removeEntity(_0x50d875){return function(_0x6f9a12){if(_0x6f9a12){return _0x6f9a12[_0x47a5('0x2b')]()['then'](function(){var _0x4e1006=_0x6f9a12[_0x47a5('0x2c')]({'plain':!![]});var _0x51544e='ChatWebsites';return db[_0x47a5('0x2d')]['destroy']({'where':{'type':_0x51544e,'resourceId':_0x4e1006['id']}})[_0x47a5('0x16')](function(){return _0x6f9a12;});})[_0x47a5('0x16')](function(){_0x50d875['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x274e34){return function(_0x5910bb){if(!_0x5910bb){_0x274e34[_0x47a5('0x20')](0x194);}return _0x5910bb;};}function handleError(_0x87e4c9,_0xf269a8){_0xf269a8=_0xf269a8||0x1f4;return function(_0x52749b){logger[_0x47a5('0x1a')](_0x52749b['stack']);if(_0x52749b['name']){delete _0x52749b[_0x47a5('0x2e')];}_0x87e4c9['status'](_0xf269a8)[_0x47a5('0x2f')](_0x52749b);};}function iftimePromise(_0x5ef577,_0x21ad34){return respondWithRpcPromise(_0x47a5('0x30'),_0x47a5('0x31'),{'command':_0x21ad34[_0x47a5('0x32')]?util[_0x47a5('0x33')](_0x47a5('0x34'),_0x5ef577[_0x47a5('0x35')],_0x21ad34[_0x47a5('0x32')]):util[_0x47a5('0x33')]('iftime\x20%s',_0x5ef577[_0x47a5('0x35')])},client9002)[_0x47a5('0x16')](function(_0x511c06){var _0x2c50d6=_0x511c06&&_0x511c06[_0x47a5('0x36')](_0x47a5('0x37'))>=0x0?!![]:![];logger['info'](_0x47a5('0x38'),_0x21ad34['id'],_0x5ef577['id'],_0x5ef577[_0x47a5('0x35')],_0x2c50d6?'ONLINE':_0x47a5('0x39'),_0x21ad34[_0x47a5('0x32')]?_0x21ad34['timezone']:'No\x20timezone');return _0x2c50d6;})['catch'](function(_0x12d9f2){logger['error'](_0x47a5('0x38'),_0x21ad34['id'],_0x5ef577['id'],_0x5ef577[_0x47a5('0x35')],util[_0x47a5('0x3a')](_0x12d9f2,{'showHidden':![],'depth':null}),_0x21ad34[_0x47a5('0x32')]?_0x21ad34[_0x47a5('0x32')]:_0x47a5('0x3b'));return![];});}function checkWebsiteIntervals(_0x2003b0){var _0x1f3d01=_[_0x47a5('0x3c')](_0x2003b0[_0x47a5('0x3d')][_0x47a5('0x3e')],function(_0x1658e8){var _0x23d6d8=_0x1658e8['get']({'plain':!![]});return iftimePromise(_0x23d6d8,_0x2003b0);});return Promise[_0x47a5('0x3f')](_0x1f3d01)[_0x47a5('0x16')](function(_0x331474){return _[_0x47a5('0x40')](_0x331474);});}function createInteractionObject(_0x586f4f,_0x7de536,_0x528ef3,_0x47c7a2){var _0x55c43d=require('user-agent-parser');var _0x27dd5d=new _0x55c43d();var _0x5ec4e5=_0x27dd5d[_0x47a5('0x41')](_0x528ef3[_0x47a5('0x42')])[_0x47a5('0x43')]();var _0x494526=_0x7de536[_0x47a5('0x44')];if(_0x528ef3[_0x47a5('0x45')]){_0x494526=_0x528ef3['cf-connecting-ip'];}else if(_0x528ef3['x-forwarded-for']){_0x494526=_[_0x47a5('0x46')](_0x528ef3['x-forwarded-for'][_0x47a5('0x47')](','));}return{'ContactId':_0x47c7a2['id'],'ChatWebsiteId':_0x586f4f,'from':(_0x47c7a2[_0x47a5('0x48')]||'')+'\x20'+(_0x47c7a2[_0x47a5('0x49')]||''),'customerIp':_0x494526,'customerPort':_0x528ef3[_0x47a5('0x4a')]?_0x528ef3[_0x47a5('0x4a')]:null,'referer':_0x7de536[_0x47a5('0x4b')],'browserName':_0x5ec4e5[_0x47a5('0x4c')][_0x47a5('0x2e')]&&_0x5ec4e5[_0x47a5('0x4c')][_0x47a5('0x4d')]?util[_0x47a5('0x33')](_0x47a5('0x4e'),_0x5ec4e5[_0x47a5('0x4c')][_0x47a5('0x2e')],_0x5ec4e5[_0x47a5('0x4c')][_0x47a5('0x4d')]):'unknown','browserVersion':_0x5ec4e5[_0x47a5('0x4c')][_0x47a5('0x4d')]||'unknown','osName':util['format'](_0x47a5('0x4e'),_0x5ec4e5['os']['name'],_0x5ec4e5['os'][_0x47a5('0x4d')]),'osVersion':_0x5ec4e5['os'][_0x47a5('0x4d')],'deviceModel':_0x5ec4e5['device']['model']&&_0x5ec4e5[_0x47a5('0x4f')]['vendor']?util[_0x47a5('0x33')](_0x47a5('0x50'),_0x5ec4e5[_0x47a5('0x4f')][_0x47a5('0x51')],_0x5ec4e5[_0x47a5('0x4f')][_0x47a5('0x52')],_0x5ec4e5[_0x47a5('0x4f')]['type']):null,'deviceVendor':_0x5ec4e5['device'][_0x47a5('0x52')],'deviceType':_0x5ec4e5[_0x47a5('0x4f')][_0x47a5('0x53')],'formData':JSON[_0x47a5('0x54')](_0x7de536)};}exports[_0x47a5('0x55')]=function(_0x2c0c86,_0x249de5){var _0x492cf7={'include':[{'model':db[_0x47a5('0x56')],'as':'mandatoryDispositionPause'}]},_0x45cca5={},_0x1c9a62={'count':0x0,'rows':[]};var _0x12ca40=_['map'](db[_0x47a5('0x57')][_0x47a5('0x58')],function(_0x46e90b){return{'name':_0x46e90b[_0x47a5('0x59')],'type':_0x46e90b['type'][_0x47a5('0x5a')]};});_0x45cca5[_0x47a5('0x51')]=_[_0x47a5('0x3c')](_0x12ca40,_0x47a5('0x2e'));_0x45cca5[_0x47a5('0x5b')]=_[_0x47a5('0x5c')](_0x2c0c86[_0x47a5('0x5b')]);_0x45cca5['filters']=_[_0x47a5('0x5d')](_0x45cca5[_0x47a5('0x51')],_0x45cca5[_0x47a5('0x5b')]);_0x492cf7[_0x47a5('0x5e')]=_[_0x47a5('0x5d')](_0x45cca5[_0x47a5('0x51')],qs['fields'](_0x2c0c86[_0x47a5('0x5b')][_0x47a5('0x5f')]));_0x492cf7[_0x47a5('0x5e')]=_0x492cf7['attributes'][_0x47a5('0x60')]?_0x492cf7[_0x47a5('0x5e')]:_0x45cca5[_0x47a5('0x51')];if(!_0x2c0c86['query']['hasOwnProperty'](_0x47a5('0x61'))){_0x492cf7[_0x47a5('0x26')]=qs['limit'](_0x2c0c86['query'][_0x47a5('0x26')]);_0x492cf7['offset']=qs[_0x47a5('0x24')](_0x2c0c86['query']['offset']);}_0x492cf7[_0x47a5('0x62')]=qs[_0x47a5('0x63')](_0x2c0c86['query'][_0x47a5('0x63')]);_0x492cf7[_0x47a5('0x64')]=qs['filters'](_['pick'](_0x2c0c86[_0x47a5('0x5b')],_0x45cca5[_0x47a5('0x65')]),_0x12ca40);if(_0x2c0c86[_0x47a5('0x5b')][_0x47a5('0x66')]){_0x492cf7['where']=_[_0x47a5('0x67')](_0x492cf7[_0x47a5('0x64')],{'$or':_[_0x47a5('0x3c')](_0x12ca40,function(_0x5a33b8){if(_0x5a33b8[_0x47a5('0x53')]!=='VIRTUAL'){var _0x485e3c={};_0x485e3c[_0x5a33b8[_0x47a5('0x2e')]]={'$like':'%'+_0x2c0c86[_0x47a5('0x5b')][_0x47a5('0x66')]+'%'};return _0x485e3c;}})});}_0x492cf7=_[_0x47a5('0x67')]({},_0x492cf7,_0x2c0c86['options']);var _0x144af9={'where':_0x492cf7['where']};return db['ChatWebsite']['count'](_0x144af9)['then'](function(_0x212d92){_0x1c9a62[_0x47a5('0x27')]=_0x212d92;if(_0x2c0c86[_0x47a5('0x5b')]['includeAll']){_0x492cf7['include']=[{'all':!![]}];}return db[_0x47a5('0x57')][_0x47a5('0x68')](_0x492cf7);})[_0x47a5('0x16')](function(_0x3c2b46){_0x1c9a62[_0x47a5('0x69')]=_0x3c2b46;return _0x1c9a62;})['then'](respondWithFilteredResult(_0x249de5,_0x492cf7))[_0x47a5('0x1f')](handleError(_0x249de5,null));};exports['show']=function(_0x22c886,_0x274d31){var _0x4d545f={'raw':![],'where':{'id':_0x22c886[_0x47a5('0x6a')]['id']},'include':[{'model':db[_0x47a5('0x56')],'as':_0x47a5('0x6b')}]},_0x32b4de={};_0x32b4de[_0x47a5('0x51')]=_[_0x47a5('0x5c')](db[_0x47a5('0x57')][_0x47a5('0x58')]);_0x32b4de['query']=_[_0x47a5('0x5c')](_0x22c886[_0x47a5('0x5b')]);_0x32b4de[_0x47a5('0x65')]=_[_0x47a5('0x5d')](_0x32b4de[_0x47a5('0x51')],_0x32b4de['query']);_0x4d545f[_0x47a5('0x5e')]=_[_0x47a5('0x5d')](_0x32b4de[_0x47a5('0x51')],qs[_0x47a5('0x5f')](_0x22c886[_0x47a5('0x5b')][_0x47a5('0x5f')]));_0x4d545f[_0x47a5('0x5e')]=_0x4d545f[_0x47a5('0x5e')][_0x47a5('0x60')]?_0x4d545f[_0x47a5('0x5e')]:_0x32b4de[_0x47a5('0x51')];if(_0x22c886[_0x47a5('0x5b')][_0x47a5('0x6c')]){_0x4d545f[_0x47a5('0x6d')]=[{'all':!![]}];}_0x4d545f=_[_0x47a5('0x67')]({},_0x4d545f,_0x22c886['options']);return db[_0x47a5('0x57')][_0x47a5('0x6e')](_0x4d545f)[_0x47a5('0x16')](handleEntityNotFound(_0x274d31,null))['then'](respondWithResult(_0x274d31,null))[_0x47a5('0x1f')](handleError(_0x274d31,null));};exports[_0x47a5('0x6f')]=function(_0x36c67,_0x26f1ac){return db['ChatWebsite'][_0x47a5('0x6f')](_0x36c67['body'],{})[_0x47a5('0x16')](function(_0x487e21){var _0x43f649=_0x36c67['user'][_0x47a5('0x2c')]({'plain':!![]});if(!_0x43f649)throw new Error(_0x47a5('0x70'));if(_0x43f649[_0x47a5('0x71')]==='user'){var _0x4af557=_0x487e21['get']({'plain':!![]});var _0x4164a3=_0x47a5('0x72');return db[_0x47a5('0x73')][_0x47a5('0x6e')]({'where':{'name':_0x4164a3,'userProfileId':_0x43f649['userProfileId']},'raw':!![]})[_0x47a5('0x16')](function(_0xc12a6a){if(_0xc12a6a&&_0xc12a6a[_0x47a5('0x74')]===0x0){return db[_0x47a5('0x2d')][_0x47a5('0x6f')]({'name':_0x4af557[_0x47a5('0x2e')],'resourceId':_0x4af557['id'],'type':_0xc12a6a[_0x47a5('0x2e')],'sectionId':_0xc12a6a['id']},{})[_0x47a5('0x16')](function(){return _0x487e21;});}else{return _0x487e21;}})[_0x47a5('0x1f')](function(_0xc69a68){logger[_0x47a5('0x1a')](_0x47a5('0x75'),_0xc69a68);throw _0xc69a68;});}return _0x487e21;})['then'](respondWithResult(_0x26f1ac,0xc9))[_0x47a5('0x1f')](handleError(_0x26f1ac,null));};exports['update']=function(_0x2ad00a,_0x2ac30f){if(_0x2ad00a[_0x47a5('0x76')]['id']){delete _0x2ad00a[_0x47a5('0x76')]['id'];}return db[_0x47a5('0x57')][_0x47a5('0x6e')]({'where':{'id':_0x2ad00a[_0x47a5('0x6a')]['id']},'include':[{'model':db[_0x47a5('0x56')],'as':_0x47a5('0x6b')}]})[_0x47a5('0x16')](handleEntityNotFound(_0x2ac30f,null))[_0x47a5('0x16')](saveUpdates(_0x2ad00a[_0x47a5('0x76')],null))[_0x47a5('0x16')](respondWithResult(_0x2ac30f,null))[_0x47a5('0x1f')](handleError(_0x2ac30f,null));};exports[_0x47a5('0x2b')]=function(_0x4de126,_0x48eb77){return db['ChatWebsite']['find']({'where':{'id':_0x4de126[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x48eb77,null))['then'](removeEntity(_0x48eb77,null))[_0x47a5('0x1f')](handleError(_0x48eb77,null));};exports[_0x47a5('0x77')]=function(_0x1baa5a,_0x396102){return db[_0x47a5('0x57')][_0x47a5('0x77')]()[_0x47a5('0x16')](respondWithResult(_0x396102,null))[_0x47a5('0x1f')](handleError(_0x396102,null));};exports[_0x47a5('0x78')]=function(_0x1ffe3c,_0x24a6c1){if(_0x1ffe3c['body']['id']){delete _0x1ffe3c[_0x47a5('0x76')]['id'];}return db[_0x47a5('0x57')][_0x47a5('0x6e')]({'where':{'id':_0x1ffe3c['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x24a6c1,null))[_0x47a5('0x16')](function(_0x17b61d){if(_0x17b61d){_0x1ffe3c['body'][_0x47a5('0x79')]=_0x17b61d['id'];return db['Disposition']['create'](_0x1ffe3c[_0x47a5('0x76')]);}})[_0x47a5('0x16')](respondWithResult(_0x24a6c1,null))[_0x47a5('0x1f')](handleError(_0x24a6c1,null));};exports[_0x47a5('0x7a')]=function(_0x164d42,_0xea50f3){var _0x479a82={'raw':![],'where':{}};var _0x592322={};var _0x3e0dbd={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x47a5('0x7b')]({'where':{'id':_0x164d42[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0xea50f3,null))[_0x47a5('0x16')](function(_0x53ea2b){if(_0x53ea2b){_0x592322[_0x47a5('0x51')]=_['keys'](db['Disposition'][_0x47a5('0x58')]);_0x592322[_0x47a5('0x5b')]=_['keys'](_0x164d42[_0x47a5('0x5b')]);_0x592322[_0x47a5('0x65')]=_[_0x47a5('0x5d')](_0x592322['model'],_0x592322[_0x47a5('0x5b')]);_0x479a82['attributes']=_[_0x47a5('0x5d')](_0x592322[_0x47a5('0x51')],qs[_0x47a5('0x5f')](_0x164d42['query'][_0x47a5('0x5f')]));_0x479a82[_0x47a5('0x5e')]=_0x479a82[_0x47a5('0x5e')]['length']?_0x479a82[_0x47a5('0x5e')]:_0x592322['model'];if(!_0x164d42[_0x47a5('0x5b')]['hasOwnProperty'](_0x47a5('0x61'))){_0x479a82[_0x47a5('0x26')]=qs[_0x47a5('0x26')](_0x164d42[_0x47a5('0x5b')]['limit']);_0x479a82[_0x47a5('0x24')]=qs[_0x47a5('0x24')](_0x164d42[_0x47a5('0x5b')][_0x47a5('0x24')]);}_0x479a82[_0x47a5('0x62')]=qs['sort'](_0x164d42['query'][_0x47a5('0x63')]);_0x479a82['where']=qs[_0x47a5('0x65')](_[_0x47a5('0x7c')](_0x164d42[_0x47a5('0x5b')],_0x592322['filters']));_0x479a82[_0x47a5('0x64')][_0x47a5('0x79')]=_0x53ea2b['id'];if(_0x164d42['query'][_0x47a5('0x66')]){_0x479a82[_0x47a5('0x64')]=_[_0x47a5('0x67')](_0x479a82[_0x47a5('0x64')],{'$or':_['map'](_0x479a82['attributes'],function(_0x132742){var _0x263046={};_0x263046[_0x132742]={'$like':'%'+_0x164d42['query'][_0x47a5('0x66')]+'%'};return _0x263046;})});}_0x479a82=_[_0x47a5('0x67')]({},_0x479a82,_0x164d42['options']);return db[_0x47a5('0x7d')][_0x47a5('0x27')]({'where':_0x479a82[_0x47a5('0x64')]})['then'](function(_0x3f2ad9){_0x3e0dbd['count']=_0x3f2ad9;if(_0x164d42[_0x47a5('0x5b')]['includeAll']){_0x479a82[_0x47a5('0x6d')]=[{'all':!![]}];}return db[_0x47a5('0x7d')]['findAll'](_0x479a82);})[_0x47a5('0x16')](function(_0x597cb2){_0x3e0dbd[_0x47a5('0x69')]=_0x597cb2;return _0x3e0dbd;});}})[_0x47a5('0x16')](respondWithFilteredResult(_0xea50f3,_0x479a82))[_0x47a5('0x1f')](handleError(_0xea50f3,null));};exports[_0x47a5('0x7e')]=function(_0x49b76a,_0x3eb5c1){return db['ChatWebsite']['find']({'where':{'id':_0x49b76a[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3eb5c1,null))[_0x47a5('0x16')](function(_0x96fb22){if(_0x96fb22){return _0x96fb22[_0x47a5('0x7e')](_0x49b76a['query'][_0x47a5('0x7f')]);}})[_0x47a5('0x16')](respondWithStatusCode(_0x3eb5c1,null))[_0x47a5('0x1f')](handleError(_0x3eb5c1,null));};exports[_0x47a5('0x80')]=function(_0x50b98e,_0x240db9){if(_0x50b98e['body']['id']){delete _0x50b98e[_0x47a5('0x76')]['id'];}return db[_0x47a5('0x57')][_0x47a5('0x6e')]({'where':{'id':_0x50b98e[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x240db9,null))[_0x47a5('0x16')](function(_0x92bfd7){if(_0x92bfd7){_0x50b98e[_0x47a5('0x76')][_0x47a5('0x79')]=_0x92bfd7['id'];return db['CannedAnswer'][_0x47a5('0x6f')](_0x50b98e[_0x47a5('0x76')]);}})['then'](respondWithResult(_0x240db9,null))[_0x47a5('0x1f')](handleError(_0x240db9,null));};exports[_0x47a5('0x81')]=function(_0x6d6a5,_0x5b85cd){var _0x4bf1f5={'raw':![],'where':{}};var _0x126bb1={};var _0x3d7371={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x6d6a5[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x5b85cd,null))['then'](function(_0x29e384){if(_0x29e384){_0x126bb1[_0x47a5('0x51')]=_['keys'](db[_0x47a5('0x82')][_0x47a5('0x58')]);_0x126bb1[_0x47a5('0x5b')]=_[_0x47a5('0x5c')](_0x6d6a5[_0x47a5('0x5b')]);_0x126bb1[_0x47a5('0x65')]=_['intersection'](_0x126bb1['model'],_0x126bb1['query']);_0x4bf1f5[_0x47a5('0x5e')]=_[_0x47a5('0x5d')](_0x126bb1['model'],qs[_0x47a5('0x5f')](_0x6d6a5[_0x47a5('0x5b')][_0x47a5('0x5f')]));_0x4bf1f5[_0x47a5('0x5e')]=_0x4bf1f5[_0x47a5('0x5e')]['length']?_0x4bf1f5[_0x47a5('0x5e')]:_0x126bb1['model'];if(!_0x6d6a5['query']['hasOwnProperty'](_0x47a5('0x61'))){_0x4bf1f5['limit']=qs[_0x47a5('0x26')](_0x6d6a5[_0x47a5('0x5b')][_0x47a5('0x26')]);_0x4bf1f5['offset']=qs[_0x47a5('0x24')](_0x6d6a5[_0x47a5('0x5b')][_0x47a5('0x24')]);}_0x4bf1f5[_0x47a5('0x62')]=qs[_0x47a5('0x63')](_0x6d6a5['query'][_0x47a5('0x63')]);_0x4bf1f5[_0x47a5('0x64')]=qs['filters'](_[_0x47a5('0x7c')](_0x6d6a5[_0x47a5('0x5b')],_0x126bb1[_0x47a5('0x65')]));_0x4bf1f5[_0x47a5('0x64')][_0x47a5('0x79')]=_0x29e384['id'];if(_0x6d6a5[_0x47a5('0x5b')]['filter']){_0x4bf1f5[_0x47a5('0x64')]=_[_0x47a5('0x67')](_0x4bf1f5['where'],{'$or':_[_0x47a5('0x3c')](_0x4bf1f5[_0x47a5('0x5e')],function(_0x52a1b5){var _0x12a1de={};_0x12a1de[_0x52a1b5]={'$like':'%'+_0x6d6a5['query']['filter']+'%'};return _0x12a1de;})});}_0x4bf1f5=_['merge']({},_0x4bf1f5,_0x6d6a5['options']);return db[_0x47a5('0x82')][_0x47a5('0x27')]({'where':_0x4bf1f5[_0x47a5('0x64')]})[_0x47a5('0x16')](function(_0x31f896){_0x3d7371[_0x47a5('0x27')]=_0x31f896;if(_0x6d6a5[_0x47a5('0x5b')][_0x47a5('0x6c')]){_0x4bf1f5['include']=[{'all':!![]}];}return db[_0x47a5('0x82')][_0x47a5('0x68')](_0x4bf1f5);})[_0x47a5('0x16')](function(_0x399528){_0x3d7371['rows']=_0x399528;return _0x3d7371;});}})['then'](respondWithFilteredResult(_0x5b85cd,_0x4bf1f5))[_0x47a5('0x1f')](handleError(_0x5b85cd,null));};exports['removeAnswers']=function(_0x4cb8e4,_0x1b6a5c){return db[_0x47a5('0x57')]['find']({'where':{'id':_0x4cb8e4[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x1b6a5c,null))[_0x47a5('0x16')](function(_0x48835f){if(_0x48835f){return _0x48835f[_0x47a5('0x83')](_0x4cb8e4[_0x47a5('0x5b')]['ids']);}})[_0x47a5('0x16')](respondWithStatusCode(_0x1b6a5c,null))[_0x47a5('0x1f')](handleError(_0x1b6a5c,null));};exports[_0x47a5('0x84')]=function(_0x311109,_0x12a56a){_0x311109[_0x47a5('0x76')]['sitepic']=_0x311109[_0x47a5('0x85')]['filename'];return db[_0x47a5('0x57')][_0x47a5('0x6e')]({'where':{'id':_0x311109[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x12a56a,null))['then'](saveUpdates(_0x311109[_0x47a5('0x76')],null))[_0x47a5('0x16')](respondWithResult(_0x12a56a,null))[_0x47a5('0x1f')](handleError(_0x12a56a,null));};exports[_0x47a5('0x86')]=function(_0x34b7c9,_0x30df79){_0x34b7c9[_0x47a5('0x76')][_0x47a5('0x87')]=_0x34b7c9[_0x47a5('0x85')][_0x47a5('0x88')];return db[_0x47a5('0x57')][_0x47a5('0x6e')]({'where':{'id':_0x34b7c9['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x30df79,null))[_0x47a5('0x16')](saveUpdates(_0x34b7c9['body'],null))[_0x47a5('0x16')](respondWithResult(_0x30df79,null))[_0x47a5('0x1f')](handleError(_0x30df79,null));};exports[_0x47a5('0x89')]=function(_0x2ccf21,_0x2ff467){_0x2ccf21['body'][_0x47a5('0x8a')]=_0x2ccf21[_0x47a5('0x85')][_0x47a5('0x88')];return db[_0x47a5('0x57')][_0x47a5('0x6e')]({'where':{'id':_0x2ccf21[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x2ff467,null))['then'](saveUpdates(_0x2ccf21['body'],null))[_0x47a5('0x16')](respondWithResult(_0x2ff467,null))['catch'](handleError(_0x2ff467,null));};exports[_0x47a5('0x8b')]=function(_0x5544a2,_0x12572f){_0x5544a2[_0x47a5('0x76')][_0x47a5('0x8c')]=_0x5544a2[_0x47a5('0x85')]['filename'];return db[_0x47a5('0x57')][_0x47a5('0x6e')]({'where':{'id':_0x5544a2[_0x47a5('0x6a')]['id']}})['then'](handleEntityNotFound(_0x12572f,null))['then'](saveUpdates(_0x5544a2[_0x47a5('0x76')],null))[_0x47a5('0x16')](respondWithResult(_0x12572f,null))[_0x47a5('0x1f')](handleError(_0x12572f,null));};exports[_0x47a5('0x8d')]=function(_0x11f2f9,_0x402bba){var _0x1c0323=path[_0x47a5('0x8e')](config['root'],_0x47a5('0x8f'));var _0x4d333b={'where':{'id':_0x11f2f9[_0x47a5('0x6a')]['id']},'attributes':['id',_0x47a5('0x90')],'raw':!![]};var _0x5b0b0b=![];return require('../../config/license/util')[_0x47a5('0x91')]()[_0x47a5('0x16')](function(_0x530387){if(_0x530387){_0x5b0b0b=_0x530387[_0x47a5('0x92')];}})[_0x47a5('0x16')](function(){return db[_0x47a5('0x57')][_0x47a5('0x6e')](_0x4d333b);})['then'](handleEntityNotFound(_0x402bba,null))[_0x47a5('0x16')](function(_0x490947){if(_0x490947){if(!_['isNil'](_0x490947['sitepic'])){if(fs[_0x47a5('0x93')](path['join'](config[_0x47a5('0x94')],_0x47a5('0x95'),_0x490947[_0x47a5('0x90')]))&&_0x5b0b0b){_0x1c0323=path[_0x47a5('0x8e')](config[_0x47a5('0x94')],_0x47a5('0x95'),_0x490947[_0x47a5('0x90')]);}}return _0x402bba[_0x47a5('0x96')](_0x1c0323);}})[_0x47a5('0x1f')](handleError(_0x402bba,null));};exports[_0x47a5('0x97')]=function(_0x42b7ef,_0xf05c39){var _0x328faa=path[_0x47a5('0x8e')](config[_0x47a5('0x94')],'server/files/images/avatars/default_avatar.png');var _0xdd95c8={'where':{'id':_0x42b7ef[_0x47a5('0x6a')]['id']},'attributes':['id',_0x47a5('0x87')],'raw':!![]};return db[_0x47a5('0x57')]['find'](_0xdd95c8)[_0x47a5('0x16')](handleEntityNotFound(_0xf05c39,null))['then'](function(_0x4476b5){if(_0x4476b5){if(!_['isNil'](_0x4476b5[_0x47a5('0x87')])){if(fs[_0x47a5('0x93')](path[_0x47a5('0x8e')](config['root'],_0x47a5('0x98'),_0x4476b5[_0x47a5('0x87')]))){_0x328faa=path[_0x47a5('0x8e')](config['root'],'server/files/images/avatars/',_0x4476b5[_0x47a5('0x87')]);}}return _0xf05c39[_0x47a5('0x96')](_0x328faa);}})[_0x47a5('0x1f')](handleError(_0xf05c39,null));};exports[_0x47a5('0x99')]=function(_0x204bd6,_0x579e5c){var _0x1196a0=path['join'](config[_0x47a5('0x94')],_0x47a5('0x9a'));var _0x46647f={'where':{'id':_0x204bd6[_0x47a5('0x6a')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0x47a5('0x57')][_0x47a5('0x6e')](_0x46647f)[_0x47a5('0x16')](handleEntityNotFound(_0x579e5c,null))[_0x47a5('0x16')](function(_0x259088){if(_0x259088){if(!_[_0x47a5('0x9b')](_0x259088[_0x47a5('0x8a')])){if(fs[_0x47a5('0x93')](path[_0x47a5('0x8e')](config['root'],'server/files/images/avatars/',_0x259088[_0x47a5('0x8a')]))&&_0x259088['showCustomerAvatar']){_0x1196a0=path[_0x47a5('0x8e')](config[_0x47a5('0x94')],_0x47a5('0x98'),_0x259088['customerAvatar']);}}return _0x579e5c[_0x47a5('0x96')](_0x1196a0);}})[_0x47a5('0x1f')](handleError(_0x579e5c,null));};exports['getSystemAvatar']=function(_0xcb6714,_0x51f6cf){var _0x277255=path[_0x47a5('0x8e')](config[_0x47a5('0x94')],'server/files/images/avatars/system_avatar.png');var _0x55b454={'where':{'id':_0xcb6714['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0x47a5('0x6e')](_0x55b454)['then'](handleEntityNotFound(_0x51f6cf,null))[_0x47a5('0x16')](function(_0x2287b0){if(_0x2287b0){if(!_['isNil'](_0x2287b0['systemAvatar'])){if(fs['existsSync'](path[_0x47a5('0x8e')](config['root'],'server/files/images/avatars/',_0x2287b0['systemAvatar']))){_0x277255=path[_0x47a5('0x8e')](config[_0x47a5('0x94')],_0x47a5('0x98'),_0x2287b0[_0x47a5('0x8c')]);}}return _0x51f6cf['download'](_0x277255);}})[_0x47a5('0x1f')](handleError(_0x51f6cf,null));};exports['notify']=function(_0x2b6f9e,_0x53a710){var _0x2de924={'body':_0x2b6f9e[_0x47a5('0x76')],'channel':_0x47a5('0x9c')};var _0x4f8171=[];var _0x106bbe=[];var _0x427c02={};var _0xc1c968=![];return db[_0x47a5('0x9d')]['describe']()[_0x47a5('0x16')](function(_0x9a7edc){if(!_0x9a7edc){throw new db[(_0x47a5('0x9e'))][(_0x47a5('0x9f'))](_0x47a5('0xa0'));}_0x4f8171=_[_0x47a5('0xa1')](_['keys'](_0x9a7edc),[_0x47a5('0xa2'),_0x47a5('0xa3')]);_0x106bbe=_[_0x47a5('0xa1')](_[_0x47a5('0x5c')](_0x9a7edc),[_0x47a5('0xa2'),_0x47a5('0xa3'),_0x47a5('0xa4'),_0x47a5('0xa5')]);if(_0x2b6f9e[_0x47a5('0x76')]['id']){delete _0x2b6f9e[_0x47a5('0x76')]['id'];}if(_[_0x47a5('0x9b')](_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xa6')])){throw new db[(_0x47a5('0x9e'))][(_0x47a5('0x9f'))](_0x47a5('0xa7'));}if(_[_0x47a5('0x9b')](_0x2b6f9e['body'][_0x47a5('0x76')])||_0x2b6f9e['body']['body']===''){throw new db[(_0x47a5('0x9e'))][(_0x47a5('0x9f'))](_0x47a5('0xa8'));}if(_['isNil'](_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xa9')])){throw new db[(_0x47a5('0x9e'))][(_0x47a5('0x9f'))](_0x47a5('0xaa')+_0x106bbe);}if(!_[_0x47a5('0xab')](_0x106bbe,_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xa9')])){throw new db[(_0x47a5('0x9e'))][(_0x47a5('0x9f'))](_0x47a5('0xac')+_0x106bbe);}_0x427c02[_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xa9')]]=_0x2b6f9e['body']['from'];})[_0x47a5('0x16')](function(){return db['ChatWebsite'][_0x47a5('0x6e')]({'where':{'id':_0x2b6f9e[_0x47a5('0x6a')]['id']},'include':[{'model':db[_0x47a5('0xad')],'as':_0x47a5('0xae'),'include':[{'model':db[_0x47a5('0x9d')],'as':_0x47a5('0xaf'),'where':_0x427c02,'limit':0x1,'order':[['updatedAt',_0x47a5('0xb0')]]}]},{'model':db[_0x47a5('0xb1')],'as':_0x47a5('0xb2')},{'model':db['Interval'],'as':_0x47a5('0x3d'),'include':[{'model':db[_0x47a5('0x3d')],'as':_0x47a5('0x3e'),'attributes':['id',_0x47a5('0x35')],'raw':!![]}]}]});})[_0x47a5('0x16')](function(_0x23e649){if(!_0x23e649)throw new APINotFoundError(util[_0x47a5('0x33')](_0x47a5('0xb3'),_0x2b6f9e[_0x47a5('0x6a')]['id']));if(!_0x23e649[_0x47a5('0x3d')]||!_0x23e649[_0x47a5('0x3d')][_0x47a5('0x3e')])return[_0x23e649,!![]];return[_0x23e649,checkWebsiteIntervals(_0x23e649)];})[_0x47a5('0xb4')](function(_0x2ac386,_0x578983){if(!_0x578983)throw new APIOutOfIntervalError();if(!_0x2ac386[_0x47a5('0xae')])return;_0x2de924[_0x47a5('0xb5')]=_0x2ac386;_0x2de924[_0x47a5('0xb6')]=_0x2ac386[_0x47a5('0xae')];_0x2de924[_0x47a5('0xb7')]=_[_0x47a5('0xb8')](_0x2ac386[_0x47a5('0xb2')],['priority'],[_0x47a5('0xb9')]);if(_0x2de924['account'][_0x47a5('0xb2')]){delete _0x2de924[_0x47a5('0xb5')][_0x47a5('0xb2')];}if(_0x2de924[_0x47a5('0xb5')][_0x47a5('0xae')]&&_0x2de924[_0x47a5('0xb5')][_0x47a5('0xae')][_0x47a5('0xaf')]['length']){return _0x2de924[_0x47a5('0xb5')][_0x47a5('0xae')][_0x47a5('0xaf')][0x0];}var _0x598ecb=_[_0x47a5('0xf')](_0x2b6f9e[_0x47a5('0x76')],{'firstName':_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xa6')],'ListId':_0x2ac386['ListId']});_0x598ecb[_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xa9')]]=_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xa6')];return db['CmContact'][_0x47a5('0x6f')](_0x598ecb,{'fields':_0x4f8171,'raw':!![]});})['then'](function(_0x5be91a){_0x2de924[_0x47a5('0xba')]=_0x5be91a;var _0x1efae8=createInteractionObject(_0x2b6f9e[_0x47a5('0x6a')]['id'],_0x2b6f9e[_0x47a5('0x76')],_0x2b6f9e['headers'],_0x5be91a);var _0x26ad0e={'ChatWebsiteId':_0x2b6f9e[_0x47a5('0x6a')]['id'],'closed':![]};if(_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xbb')]){_0x26ad0e[_0x47a5('0xbb')]=_0x2b6f9e[_0x47a5('0x76')]['threadId'];return db[_0x47a5('0xbc')][_0x47a5('0x6e')]({'where':_0x26ad0e})[_0x47a5('0x16')](function(_0x3f18a2){if(_0x3f18a2){_0xc1c968=!![];return _0x3f18a2;}_0x1efae8[_0x47a5('0xbb')]=_0x2b6f9e['body'][_0x47a5('0xbb')];_0x1efae8['externalUrl']=_0x2b6f9e[_0x47a5('0x76')]['externalUrl'];return db[_0x47a5('0xbc')]['create'](_0x1efae8);});}_0x26ad0e['ContactId']=_0x5be91a['id'];if(_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xbd')]&&_0x2b6f9e['body'][_0x47a5('0xbd')]['id']){_0x26ad0e['id']=_0x2b6f9e[_0x47a5('0x76')]['interaction']['id'];return db[_0x47a5('0xbc')][_0x47a5('0x6e')]({'where':_0x26ad0e})[_0x47a5('0x16')](function(_0x508622){if(_0x508622){_0xc1c968=!![];return _0x508622;}return db[_0x47a5('0xbc')][_0x47a5('0x6f')](_0x1efae8);});}return db[_0x47a5('0xbc')][_0x47a5('0x6f')](_0x1efae8);})[_0x47a5('0x16')](function(_0x53cc9e){if(!_0xc1c968)return _0x53cc9e;var _0x5973d4={'from':(_0x2de924[_0x47a5('0xba')]['firstName']||'')+'\x20'+(_0x2de924[_0x47a5('0xba')][_0x47a5('0x49')]||'')};if(_0x2b6f9e['body']['threadId']&&_0x2b6f9e[_0x47a5('0x76')]['messageId']&&_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xbb')]!=_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xbe')]){_0x5973d4[_0x47a5('0xbb')]=_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xbe')];}return _0x53cc9e['update'](_0x5973d4);})[_0x47a5('0x16')](function(_0x5d507f){_0x2de924[_0x47a5('0xbd')]=_0x5d507f[_0x47a5('0x2c')]({'plain':!![]});_0x2de924[_0x47a5('0xbd')][_0x47a5('0xbf')]=!_0xc1c968;if(_0x2de924[_0x47a5('0xbd')][_0x47a5('0xbf')]){if(_0x2de924[_0x47a5('0xb5')][_0x47a5('0xc0')]){_0x2de924[_0x47a5('0xb7')][_0x47a5('0xc1')]({'id':0x0,'priority':_0x2de924[_0x47a5('0xb7')][_0x47a5('0x60')]+0x1,'app':'close','appdata':_0x47a5('0xc2'),'interval':_0x47a5('0xc3')});}}return db[_0x47a5('0xc4')]['create']({'body':_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0x76')],'ChatWebsiteId':_0x2b6f9e[_0x47a5('0x6a')]['id'],'ChatInteractionId':_0x5d507f['id'],'direction':'in','ContactId':_0x2de924[_0x47a5('0xba')]['id'],'AttachmentId':_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xc5')]});})['then'](function(_0x142af8){_0x2de924[_0x47a5('0x1c')]=_0x142af8;if(!_0x2de924[_0x47a5('0xbd')][_0x47a5('0xc6')]){return;}return db[_0x47a5('0xc7')][_0x47a5('0x6e')]({'attributes':['id',_0x47a5('0x2e')],'where':{'id':_0x2de924[_0x47a5('0xbd')][_0x47a5('0xc6')]}});})[_0x47a5('0x16')](function(_0x4817f8){if(_0x4817f8){_0x2de924['applications'][_0x47a5('0xc8')]({'id':0x0,'priority':0x0,'app':_0x47a5('0xc9'),'appdata':_0x4817f8[_0x47a5('0x2e')]+','+(_0x2de924['account'][_0x47a5('0xca')]||0xa),'interval':'*,*,*,*'});_0x2de924['forcedOwnership']=!![];}if(!_0x2de924[_0x47a5('0xbd')][_0x47a5('0xcb')]){return;}return db[_0x47a5('0xcc')][_0x47a5('0x6e')]({'attributes':['id','name'],'where':{'id':_0x2de924[_0x47a5('0xbd')][_0x47a5('0xcb')]}});})['then'](function(_0x59ba59){if(_0x59ba59){_0x2de924['applications'][_0x47a5('0xc8')]({'id':0x0,'priority':0x1,'app':_0x47a5('0xcd'),'appdata':_0x59ba59[_0x47a5('0x2e')]+','+(_0x2de924[_0x47a5('0xb5')][_0x47a5('0xce')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x47a5('0xcf'),_0x2de924);})[_0x47a5('0x16')](function(_0x3a0c7b){respondWithRpcPromise(_0x47a5('0xd0'),'EventManager',{'event':_0x47a5('0xd1'),'message':_0x3a0c7b},client9002);return _0x3a0c7b;})[_0x47a5('0x16')](respondWithResult(_0x53a710,null))[_0x47a5('0x1f')](APIHandleError(_0x53a710));};exports[_0x47a5('0xd2')]=function(_0x5e7fac,_0x528402){var _0x4e43d8,_0x74893a,_0x15ddfc;var _0x156ceb=[];var _0x3c6142={};var _0x242006=_0x5e7fac[_0x47a5('0xd3')]||[];var _0x3bcdbc=[];var _0x21a58e;return db[_0x47a5('0x9d')]['describe']()[_0x47a5('0x16')](function(_0x7b5348){if(!_0x7b5348){throw new db['Sequelize'][(_0x47a5('0x9f'))](_0x47a5('0xa0'));}_0x156ceb=_[_0x47a5('0xa1')](_[_0x47a5('0x5c')](_0x7b5348),['createdAt',_0x47a5('0xa3'),_0x47a5('0xa4'),_0x47a5('0xa5')]);if(_0x5e7fac['body']['id']){delete _0x5e7fac['body']['id'];}if(_[_0x47a5('0x9b')](_0x5e7fac['body'][_0x47a5('0xa6')])){throw _0x528402['status'](0x1f4)[_0x47a5('0x2f')](new db[(_0x47a5('0x9e'))][(_0x47a5('0x9f'))](_0x47a5('0xa7')));}if(_[_0x47a5('0x9b')](_0x5e7fac['body']['body'])||_0x5e7fac[_0x47a5('0x76')][_0x47a5('0x76')]===''){throw _0x528402[_0x47a5('0x21')](0x1f4)[_0x47a5('0x2f')](new db['Sequelize']['ValidationError'](_0x47a5('0xa8')));}if(_['isNil'](_0x5e7fac[_0x47a5('0x76')]['mapKeyOffline'])){throw _0x528402[_0x47a5('0x21')](0x1f4)['send'](new db[(_0x47a5('0x9e'))][(_0x47a5('0x9f'))](_0x47a5('0xd4')+_0x156ceb));}if(!_[_0x47a5('0xab')](_0x156ceb,_0x5e7fac[_0x47a5('0x76')][_0x47a5('0xd5')])){throw _0x528402[_0x47a5('0x21')](0x1f4)[_0x47a5('0x2f')](new db['Sequelize'][(_0x47a5('0x9f'))](_0x47a5('0xd6')+_0x156ceb));}_0x3c6142[_0x5e7fac['body'][_0x47a5('0xd5')]]=_0x5e7fac[_0x47a5('0x76')]['from'];})['then'](function(){return db[_0x47a5('0x57')]['find']({'where':{'id':_0x5e7fac[_0x47a5('0x6a')]['id']},'include':[{'model':db[_0x47a5('0xad')],'as':_0x47a5('0xae')},{'model':db['MailAccount'],'as':_0x47a5('0xd7')}]});})[_0x47a5('0x16')](handleEntityNotFound(_0x528402,null))[_0x47a5('0x16')](function(_0x45dd6b){if(_0x45dd6b&&_0x45dd6b[_0x47a5('0xae')]){_0x74893a=_0x45dd6b;var _0x454609=_[_0x47a5('0xf')](_0x5e7fac['body'],{'firstName':_0x5e7fac[_0x47a5('0x76')][_0x47a5('0xa6')],'phone':_0x5e7fac[_0x47a5('0x76')][_0x47a5('0xa6')],'ListId':_0x45dd6b[_0x47a5('0xa5')]});_0x454609[_0x5e7fac[_0x47a5('0x76')][_0x47a5('0xd5')]]=_0x5e7fac['body']['from'];return db[_0x47a5('0x9d')][_0x47a5('0xd8')]({'where':_0x3c6142,'defaults':_0x454609});}})[_0x47a5('0xb4')](function(_0x4bbc94){if(_0x4bbc94){_0x15ddfc=_0x4bbc94;var _0x5d2a10=fs[_0x47a5('0xd9')](path[_0x47a5('0x8e')](config[_0x47a5('0x94')],_0x47a5('0xda')),_0x47a5('0xdb'));var _0x4121c1=ejs[_0x47a5('0xdc')](_0x5d2a10,{'body':_['toPairs'](_0x5e7fac[_0x47a5('0x76')][_0x47a5('0x76')]),'bodyTitle':_0x74893a[_0x47a5('0xdd')]});return db['ChatOfflineMessage'][_0x47a5('0x6f')]({'body':_0x4121c1,'plainBody':htmlToText[_0x47a5('0xde')](_0x4121c1),'ContactId':_0x4bbc94['id'],'ChatWebsiteId':_0x74893a['id']});}})[_0x47a5('0x16')](function(_0x278b42){_0x21a58e=_0x278b42;if(_0x242006[_0x47a5('0x60')]){var _0x20eff3=_0x242006[_0x47a5('0x3c')](function(_0x3a52cf){return{'name':_0x3a52cf[_0x47a5('0xdf')],'basename':_0x3a52cf[_0x47a5('0x88')],'type':_0x3a52cf[_0x47a5('0xe0')],'ChatOfflineMessageId':_0x278b42['id']};});_0x3bcdbc=_0x20eff3[_0x47a5('0x3c')](_0x3bd9cf=>{var _0x5a3741={'filename':_0x3bd9cf[_0x47a5('0x2e')],'path':path['join'](config[_0x47a5('0x94')],'server',_0x47a5('0xd3'),_0x47a5('0xe1'),_0x47a5('0xe2'),_0x3bd9cf['basename'])};return _0x5a3741;});if(!_0x74893a[_0x47a5('0xe3')]){return db['sequelize'][_0x47a5('0xe4')](function(_0x1e5883){return db[_0x47a5('0xe5')][_0x47a5('0xe6')](_0x20eff3,{'transaction':_0x1e5883});});}}})['then'](function(){if(_0x21a58e){_0x4e43d8=_0x21a58e;return db[_0x47a5('0xd7')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x47a5('0xe7'),'raw':!![],'include':[{'model':db[_0x47a5('0xe8')],'as':_0x47a5('0xe8'),'raw':!![]}]}]});}})[_0x47a5('0x16')](function(_0x184a18){if(_0x184a18&&_0x184a18[_0x47a5('0xe7')]&&_0x74893a[_0x47a5('0xe9')]&&_0x74893a[_0x47a5('0xea')]){var _0x3d8c62=_0x184a18['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x47a5('0xeb'),{'account':_0x3d8c62,'message':{'from':util[_0x47a5('0x33')](_0x47a5('0xec'),_0x184a18[_0x47a5('0x2e')],_0x184a18[_0x47a5('0xed')]||_0x184a18['Smtp'][_0x47a5('0xee')]),'to':_0x74893a[_0x47a5('0xea')],'subject':_0x74893a[_0x47a5('0xef')],'html':_0x4e43d8['body'],'attachments':_0x3bcdbc}},client9003)['then'](function(){return _0x4e43d8;})[_0x47a5('0x1f')](function(_0x3e8697){logger['error'](_0x3e8697);});}})[_0x47a5('0x16')](function(){if(_0x74893a&&_0x74893a[_0x47a5('0xe3')]&&_0x74893a[_0x47a5('0xf0')]){var _0x5952bd=[];if(_0x242006[_0x47a5('0x60')]){_0x5952bd=_0x242006[_0x47a5('0x3c')](function(_0x28193a){return{'name':_0x28193a[_0x47a5('0xdf')],'basename':_0x28193a[_0x47a5('0x88')],'type':_0x28193a['mimetype'],'ChatOfflineMessageId':_0x21a58e['id']};});}var _0x219f86;if(!_[_0x47a5('0x9b')](_0x74893a[_0x47a5('0xf1')])){var _0x9b617b=_['map'](_0x5e7fac['body'],function(_0x425daf){return _0x425daf;});var _0x5054f5=_[_0x47a5('0xf2')](_0x9b617b)[0x0];var _0xe66584=_[_0x47a5('0xf3')](_0x5054f5,function(_0x96adcc){return _0x96adcc;});_0x219f86=_0xe66584[0x1][_0x74893a[_0x47a5('0xf1')]];}var _0x5b8d81={'from':_0x15ddfc['email'],'firstName':_0x15ddfc[_0x47a5('0x48')],'lastName':_0x15ddfc[_0x47a5('0x49')],'mapKey':_0x47a5('0xed'),'message':{'from':_0x15ddfc['email'],'to':_0x74893a['MailAccount'][_0x47a5('0xed')],'cc':'','subject':_['isNil'](_0x219f86)?_0x74893a[_0x47a5('0xef')]:_0x219f86,'messageId':'','sentAt':new Date(),'attach':_0x5952bd[_0x47a5('0x60')],'attachments':_0x5952bd,'originChannel':_0x47a5('0xf4'),'ChatWebsiteId':_0x74893a['id'],'ChatOfflineMessageId':_0x4e43d8['id'],'originTo':_0x74893a[_0x47a5('0xd7')][_0x47a5('0xed')]},'body':_0x4e43d8['body']};var _0x56263c={'account':{'id':_0x74893a[_0x47a5('0xf0')]},'body':_0x5b8d81,'log':_0x47a5('0xf5')};return respondWithRpcPromise(_0x47a5('0xf5'),_0x47a5('0xf6'),_0x56263c,client9001)[_0x47a5('0x16')](function(){return _0x4e43d8;})['catch'](function(_0x56fc6){logger[_0x47a5('0x1a')](_0x56fc6);});}return;})[_0x47a5('0x16')](function(){if(_0x4e43d8){return _0x4e43d8;}})[_0x47a5('0x16')](respondWithResult(_0x528402,null))[_0x47a5('0x1f')](function(){for(var _0x4df71d of _0x242006){var _0x28a5f3=path[_0x47a5('0x8e')](config[_0x47a5('0x94')],_0x47a5('0xf7'),_0x47a5('0xd3'),_0x47a5('0xe1'),_0x47a5('0xe2'),_0x4df71d[_0x47a5('0x88')]);fs_extra[_0x47a5('0xf8')](_0x28a5f3)[_0x47a5('0x1f')](function(_0x2cc493){logger['error'](_0x47a5('0xf9'),_0x28a5f3,_0x2cc493);});}});};exports[_0x47a5('0xfa')]=function(_0x19f0da,_0x4233f4){return db['ChatInteraction']['find']({'where':{'id':_0x19f0da['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x4233f4,null))['then'](function(_0x5af4f7){if(_0x5af4f7){return _0x5af4f7[_0x47a5('0xfa')](_0x19f0da['body'][_0x47a5('0x7f')],_[_0x47a5('0xfb')](_0x19f0da[_0x47a5('0x76')],['ids','id'])||{});}})[_0x47a5('0x16')](respondWithResult(_0x4233f4,null))['catch'](handleError(_0x4233f4,null));};exports[_0x47a5('0xfc')]=function(_0x18c0b6,_0x460d52){var _0x3c4c48={'raw':![],'where':{}};var _0x428b9e={};var _0x302f14={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x18c0b6['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x460d52,null))[_0x47a5('0x16')](function(_0x1d6349){if(_0x1d6349){_0x428b9e[_0x47a5('0x51')]=_[_0x47a5('0x5c')](db[_0x47a5('0xbc')][_0x47a5('0x58')]);_0x428b9e[_0x47a5('0x5b')]=_[_0x47a5('0x5c')](_0x18c0b6[_0x47a5('0x5b')]);_0x428b9e[_0x47a5('0x65')]=_[_0x47a5('0x5d')](_0x428b9e[_0x47a5('0x51')],_0x428b9e[_0x47a5('0x5b')]);_0x3c4c48[_0x47a5('0x5e')]=_[_0x47a5('0x5d')](_0x428b9e['model'],qs[_0x47a5('0x5f')](_0x18c0b6[_0x47a5('0x5b')][_0x47a5('0x5f')]));_0x3c4c48[_0x47a5('0x5e')]=_0x3c4c48[_0x47a5('0x5e')][_0x47a5('0x60')]?_0x3c4c48[_0x47a5('0x5e')]:_0x428b9e[_0x47a5('0x51')];if(!_0x18c0b6['query'][_0x47a5('0xfd')]('nolimit')){_0x3c4c48[_0x47a5('0x26')]=qs[_0x47a5('0x26')](_0x18c0b6['query'][_0x47a5('0x26')]);_0x3c4c48['offset']=qs[_0x47a5('0x24')](_0x18c0b6[_0x47a5('0x5b')][_0x47a5('0x24')]);}_0x3c4c48[_0x47a5('0x62')]=qs[_0x47a5('0x63')](_0x18c0b6['query'][_0x47a5('0x63')]);_0x3c4c48[_0x47a5('0x64')]=qs[_0x47a5('0x65')](_['pick'](_0x18c0b6['query'],_0x428b9e[_0x47a5('0x65')]));_0x3c4c48[_0x47a5('0x64')][_0x47a5('0x79')]=_0x1d6349['id'];if(_0x18c0b6['query'][_0x47a5('0x66')]){_0x3c4c48[_0x47a5('0x64')]=_[_0x47a5('0x67')](_0x3c4c48['where'],{'$or':_[_0x47a5('0x3c')](_0x3c4c48[_0x47a5('0x5e')],function(_0x3ecc43){var _0xf4b1df={};_0xf4b1df[_0x3ecc43]={'$like':'%'+_0x18c0b6['query'][_0x47a5('0x66')]+'%'};return _0xf4b1df;})});}_0x3c4c48=_['merge']({},_0x3c4c48,_0x18c0b6[_0x47a5('0xfe')]);return db[_0x47a5('0xbc')][_0x47a5('0x27')]({'where':_0x3c4c48[_0x47a5('0x64')]})['then'](function(_0x1203f9){_0x302f14[_0x47a5('0x27')]=_0x1203f9;if(_0x18c0b6[_0x47a5('0x5b')][_0x47a5('0x6c')]){_0x3c4c48[_0x47a5('0x6d')]=[{'model':db['CmContact'],'as':_0x47a5('0xff'),'required':![]},{'model':db[_0x47a5('0xc7')],'as':_0x47a5('0x100'),'attributes':[_0x47a5('0x2e'),_0x47a5('0x101'),_0x47a5('0x102')],'required':![]},{'model':db['Tag'],'as':_0x47a5('0x103'),'attributes':['id',_0x47a5('0x2e'),'color'],'where':_0x18c0b6['query'][_0x47a5('0x104')]?{'id':_0x18c0b6[_0x47a5('0x5b')][_0x47a5('0x104')]}:undefined,'required':_0x18c0b6[_0x47a5('0x5b')][_0x47a5('0x104')]?!![]:![]}];}return db[_0x47a5('0xbc')]['findAll'](_0x3c4c48);})['then'](function(_0x2e5096){_0x302f14[_0x47a5('0x69')]=_0x2e5096;return _0x302f14;});}})['then'](respondWithFilteredResult(_0x460d52,_0x3c4c48))[_0x47a5('0x1f')](handleError(_0x460d52,null));};exports[_0x47a5('0x31')]=function(_0x5592f4,_0x269a37){var _0x5ed2b3=0x0;var _0x5c72e7=0x0;var _0x4aeaff=![];var _0x41ee78;var _0x385bfa;return db[_0x47a5('0x57')]['find']({'where':{'id':_0x5592f4[_0x47a5('0x6a')]['id']},'include':[{'model':db['Interval'],'as':_0x47a5('0x3d'),'include':[{'model':db['Interval'],'as':_0x47a5('0x3e'),'attributes':['id',_0x47a5('0x35')]}]}]})[_0x47a5('0x16')](handleEntityNotFound(_0x269a37,null))[_0x47a5('0x16')](function(_0x9095a4){if(_0x9095a4){_0x41ee78=_0x9095a4;return _0x9095a4[_0x47a5('0x105')]({'raw':!![]});}})[_0x47a5('0x16')](function(_0x15d573){if(_0x41ee78){if(_0x15d573){_0x385bfa=_0x15d573;}}return require(_0x47a5('0x106'))['getLicense']();})[_0x47a5('0x16')](function(_0x24c88e){if(_0x24c88e){_0x5c72e7=_0x24c88e[_0x47a5('0x107')];_0x4aeaff=_0x24c88e['custom'];}})[_0x47a5('0x16')](function(){return db[_0x47a5('0xbc')][_0x47a5('0x27')]({'where':{'closed':![]}});})[_0x47a5('0x16')](function(_0x24e241){_0x5ed2b3=_0x24e241;if(_0x5c72e7&&_0x24e241>_0x5c72e7){return db[_0x47a5('0x108')][_0x47a5('0x7b')]({'where':{'id':0x1}})[_0x47a5('0x16')](function(_0x33a9c5){if(_0x33a9c5){_0x33a9c5[_0x47a5('0x109')]('chatLicenseExceeded');}});}})['then'](function(){if(!_0x41ee78['Interval']||!_0x41ee78['Interval'][_0x47a5('0x3e')])return!![];return checkWebsiteIntervals(_0x41ee78);})['then'](function(_0x2330ae){var _0x1261ff=fs['readFileSync'](path[_0x47a5('0x8e')](config[_0x47a5('0x94')],_0x47a5('0x10a')),_0x47a5('0xdb'));var _0x2cbf08=new url[(_0x47a5('0x10b'))](_0x41ee78['address'])[_0x47a5('0x10c')];var _0x259e37='3.8.0';var _0x188ba1=![];var _0x5e41c8={'chatVersion':_0x259e37,'chatWebsiteAddressOrigin':_0x2cbf08,'remote':_0x41ee78[_0x47a5('0x10d')],'query':querystring[_0x47a5('0x54')](_[_0x47a5('0x67')](_0x41ee78[_0x47a5('0x2c')]({'plain':!![]}),{'customerIp':_0x5592f4[_0x47a5('0x10e')][_0x47a5('0x10f')]||_0x5592f4[_0x47a5('0x10e')]['x-real-ip']||_0x5592f4[_0x47a5('0x110')][_0x47a5('0x111')]||_0x5592f4['ip'],'referer':_0x5592f4['headers'][_0x47a5('0x4b')],'openedInteractions':_0x5ed2b3,'maxInteractions':_0x5c72e7,'virtual':_0x4aeaff[_0x47a5('0x107')],'online':_0x2330ae,'custom':_0x4aeaff}))['replace'](/'/g,'\x5c\x27')};_0x269a37[_0x47a5('0x2f')](ejs['render'](Mustache[_0x47a5('0xdc')](_0x1261ff,_0x5e41c8),{'proactiveActions':_0x385bfa,'alignment':_0x41ee78[_0x47a5('0x112')],'verticalAlignment':_0x41ee78[_0x47a5('0x113')],'div_color':_0x41ee78[_0x47a5('0x114')],'labelText':_0x41ee78[_0x47a5('0x115')],'text_color':_0x41ee78['textColor'],'text_button_color':_0x41ee78['textButtonColor'],'button_color':_0x41ee78[_0x47a5('0x116')],'background_color':_0x41ee78['backgroundColor'],'hideWhenOffline':_0x41ee78['hideWhenOffline'],'intervalId':_0x41ee78['IntervalId'],'isDevelopment':_0x188ba1,'chatVersion':_0x259e37}));})[_0x47a5('0x1f')](handleError(_0x269a37,null));};exports['addApplications']=function(_0x36752b,_0x1bcafd){var _0x1d4267=_0x36752b['params']['id'];var _0x4ffa91=_0x36752b[_0x47a5('0x76')];var _0x55fca6=0xc8;var _0x56f79f=null;return db[_0x47a5('0x117')]['transaction']({'isolationLevel':db['sequelize'][_0x47a5('0x118')][_0x47a5('0x119')]['READ_COMMITTED']},function(_0x48c3ed){return db[_0x47a5('0x57')][_0x47a5('0x7b')]({'where':{'id':_0x1d4267},'transaction':_0x48c3ed})[_0x47a5('0x16')](function(_0x1aa05c){if(_0x1aa05c){return db[_0x47a5('0xb1')]['destroy']({'where':{'ChatWebsiteId':_0x1d4267},'transaction':_0x48c3ed})[_0x47a5('0x16')](function(){var _0x2091c9=_[_0x47a5('0x3c')](_0x4ffa91,function(_0x26a3ad){_0x26a3ad['ChatWebsiteId']=_0x1d4267;return _0x26a3ad;});return db[_0x47a5('0xb1')][_0x47a5('0xe6')](_0x2091c9,{'transaction':_0x48c3ed});});}else{_0x55fca6=0x194;_0x56f79f=[];}});})[_0x47a5('0x16')](function(){if(_0x55fca6!==0x194){return db['ChatApplication'][_0x47a5('0x11a')]({'where':{'ChatWebsiteId':_0x1d4267},'order':'priority'})['then'](function(_0x187de4){_0x56f79f=_0x187de4;});}})[_0x47a5('0x1f')](function(_0x52ad1f){_0x55fca6=0x1f4;logger['error'](_0x52ad1f['stack']);if(_0x52ad1f[_0x47a5('0x2e')]){delete _0x52ad1f[_0x47a5('0x2e')];}_0x56f79f=_0x52ad1f;})['finally'](function(){if(_0x56f79f===null){_0x1bcafd[_0x47a5('0x20')](_0x55fca6);}else{if(_0x55fca6===0x1f4){_0x1bcafd['status'](_0x55fca6)[_0x47a5('0x2f')](_0x56f79f);}else{_0x1bcafd[_0x47a5('0x21')](_0x55fca6)['json'](_0x56f79f);}}});};exports[_0x47a5('0x11b')]=function(_0x307d7f,_0x5f2507){var _0x3fbd67={};var _0x5bca81={};var _0x447c32;var _0x46ae21;return db[_0x47a5('0x57')][_0x47a5('0x7b')]({'where':{'id':_0x307d7f[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x5f2507,null))[_0x47a5('0x16')](function(_0x1ebfcd){if(_0x1ebfcd){_0x447c32=_0x1ebfcd;_0x5bca81['model']=_[_0x47a5('0x5c')](db[_0x47a5('0xb1')][_0x47a5('0x58')]);_0x5bca81[_0x47a5('0x5b')]=_[_0x47a5('0x5c')](_0x307d7f['query']);_0x5bca81[_0x47a5('0x65')]=_[_0x47a5('0x5d')](_0x5bca81['model'],_0x5bca81[_0x47a5('0x5b')]);_0x3fbd67[_0x47a5('0x5e')]=_[_0x47a5('0x5d')](_0x5bca81[_0x47a5('0x51')],qs[_0x47a5('0x5f')](_0x307d7f['query'][_0x47a5('0x5f')]));_0x3fbd67['attributes']=_0x3fbd67['attributes'][_0x47a5('0x60')]?_0x3fbd67['attributes']:_0x5bca81[_0x47a5('0x51')];_0x3fbd67[_0x47a5('0x62')]=qs['sort'](_0x307d7f[_0x47a5('0x5b')]['sort']);_0x3fbd67[_0x47a5('0x64')]=qs[_0x47a5('0x65')](_[_0x47a5('0x7c')](_0x307d7f[_0x47a5('0x5b')],_0x5bca81[_0x47a5('0x65')]));if(_0x307d7f[_0x47a5('0x5b')]['filter']){_0x3fbd67[_0x47a5('0x64')]=_[_0x47a5('0x67')](_0x3fbd67[_0x47a5('0x64')],{'$or':_[_0x47a5('0x3c')](_0x3fbd67[_0x47a5('0x5e')],function(_0x1c0230){var _0x69b145={};_0x69b145[_0x1c0230]={'$like':'%'+_0x307d7f[_0x47a5('0x5b')][_0x47a5('0x66')]+'%'};return _0x69b145;})});}_0x3fbd67=_[_0x47a5('0x67')]({},_0x3fbd67,_0x307d7f[_0x47a5('0xfe')]);return _0x447c32[_0x47a5('0x11b')](_0x3fbd67);}})[_0x47a5('0x16')](function(_0x3f5f4c){if(_0x3f5f4c){_0x46ae21=_0x3f5f4c[_0x47a5('0x60')];if(!_0x307d7f[_0x47a5('0x5b')][_0x47a5('0xfd')]('nolimit')){_0x3fbd67['limit']=qs[_0x47a5('0x26')](_0x307d7f[_0x47a5('0x5b')][_0x47a5('0x26')]);_0x3fbd67[_0x47a5('0x24')]=qs[_0x47a5('0x24')](_0x307d7f[_0x47a5('0x5b')][_0x47a5('0x24')]);}return _0x447c32[_0x47a5('0x11b')](_0x3fbd67);}})['then'](function(_0x247099){if(_0x247099){return _0x247099?{'count':_0x46ae21,'rows':_0x247099}:null;}})['then'](respondWithResult(_0x5f2507,null))[_0x47a5('0x1f')](handleError(_0x5f2507,null));};exports[_0x47a5('0x11c')]=function(_0x22bc01,_0x15245f){return db[_0x47a5('0x11d')]['find']({'where':{'id':_0x22bc01[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x15245f,null))[_0x47a5('0x16')](function(_0x1d2039){if(_0x1d2039){return _0x1d2039[_0x47a5('0x11c')](_0x22bc01[_0x47a5('0x76')][_0x47a5('0x7f')],_[_0x47a5('0xfb')](_0x22bc01[_0x47a5('0x76')],[_0x47a5('0x7f'),'id'])||{});}})['then'](respondWithResult(_0x15245f,null))[_0x47a5('0x1f')](handleError(_0x15245f,null));};exports[_0x47a5('0x105')]=function(_0x59801d,_0x422249){var _0x4a9d0d={};var _0x1cd305={};var _0x54574a;var _0x5b8b2e;return db[_0x47a5('0x57')][_0x47a5('0x7b')]({'where':{'id':_0x59801d['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x422249,null))[_0x47a5('0x16')](function(_0xbfa21b){if(_0xbfa21b){_0x54574a=_0xbfa21b;_0x1cd305[_0x47a5('0x51')]=_[_0x47a5('0x5c')](db[_0x47a5('0x11e')]['rawAttributes']);_0x1cd305[_0x47a5('0x5b')]=_['keys'](_0x59801d[_0x47a5('0x5b')]);_0x1cd305[_0x47a5('0x65')]=_[_0x47a5('0x5d')](_0x1cd305[_0x47a5('0x51')],_0x1cd305[_0x47a5('0x5b')]);_0x4a9d0d[_0x47a5('0x5e')]=_[_0x47a5('0x5d')](_0x1cd305[_0x47a5('0x51')],qs['fields'](_0x59801d[_0x47a5('0x5b')]['fields']));_0x4a9d0d[_0x47a5('0x5e')]=_0x4a9d0d[_0x47a5('0x5e')][_0x47a5('0x60')]?_0x4a9d0d[_0x47a5('0x5e')]:_0x1cd305[_0x47a5('0x51')];_0x4a9d0d[_0x47a5('0x62')]=qs[_0x47a5('0x63')](_0x59801d['query'][_0x47a5('0x63')]);_0x4a9d0d[_0x47a5('0x64')]=qs[_0x47a5('0x65')](_[_0x47a5('0x7c')](_0x59801d[_0x47a5('0x5b')],_0x1cd305[_0x47a5('0x65')]));if(_0x59801d[_0x47a5('0x5b')]['filter']){_0x4a9d0d[_0x47a5('0x64')]=_[_0x47a5('0x67')](_0x4a9d0d[_0x47a5('0x64')],{'$or':_[_0x47a5('0x3c')](_0x4a9d0d['attributes'],function(_0x4c107a){var _0x3eb972={};_0x3eb972[_0x4c107a]={'$like':'%'+_0x59801d[_0x47a5('0x5b')][_0x47a5('0x66')]+'%'};return _0x3eb972;})});}_0x4a9d0d=_['merge']({},_0x4a9d0d,_0x59801d[_0x47a5('0xfe')]);return _0x54574a[_0x47a5('0x105')](_0x4a9d0d);}})['then'](function(_0x5847f3){if(_0x5847f3){_0x5b8b2e=_0x5847f3[_0x47a5('0x60')];if(!_0x59801d[_0x47a5('0x5b')][_0x47a5('0xfd')]('nolimit')){_0x4a9d0d['limit']=qs[_0x47a5('0x26')](_0x59801d[_0x47a5('0x5b')][_0x47a5('0x26')]);_0x4a9d0d[_0x47a5('0x24')]=qs[_0x47a5('0x24')](_0x59801d[_0x47a5('0x5b')][_0x47a5('0x24')]);}return _0x54574a['getProactiveActions'](_0x4a9d0d);}})[_0x47a5('0x16')](function(_0x59a791){if(_0x59a791){return _0x59a791?{'count':_0x5b8b2e,'rows':_0x59a791}:null;}})[_0x47a5('0x16')](respondWithResult(_0x422249,null))['catch'](handleError(_0x422249,null));};exports[_0x47a5('0x11f')]=function(_0x1da9a6,_0x3051c4){var _0x103478=_0x1da9a6[_0x47a5('0x5b')][_0x47a5('0x120')]===_0x47a5('0x121')?_0x47a5('0x122'):_0x47a5('0x123');return db[_0x47a5('0x57')]['find']({'attributes':['id',_0x103478],'where':{'id':_0x1da9a6[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3051c4,null))[_0x47a5('0x16')](function(_0x300ccb){if(_0x300ccb){var _0x23c9b8=_0x300ccb[_0x103478];var _0x1ca2c1=_0x23c9b8&&_0x23c9b8[_0x47a5('0x124')]?_0x23c9b8[_0x47a5('0x124')]:[];_0x3051c4[_0x47a5('0x2f')]({'fromKey':_['isNil'](_0x23c9b8[_0x47a5('0x125')])?undefined:_0x23c9b8['fromKey'],'count':_0x1ca2c1[_0x47a5('0x60')],'rows':_0x1ca2c1});}})['catch'](handleError(_0x3051c4,null));};exports[_0x47a5('0x126')]=function(_0x596091,_0x4f04bb){var _0x251b9e={'raw':![],'where':{}};var _0x5669c7={};var _0x53a0c3={'count':0x0,'rows':[]};return db[_0x47a5('0x57')][_0x47a5('0x7b')]({'where':{'id':_0x596091[_0x47a5('0x6a')]['id']}})['then'](handleEntityNotFound(_0x4f04bb,null))[_0x47a5('0x16')](function(_0x48a71f){if(_0x48a71f){_0x5669c7[_0x47a5('0x51')]=_['keys'](db[_0x47a5('0x127')][_0x47a5('0x58')]);_0x5669c7['query']=_[_0x47a5('0x5c')](_0x596091[_0x47a5('0x5b')]);_0x5669c7['filters']=_[_0x47a5('0x5d')](_0x5669c7[_0x47a5('0x51')],_0x5669c7['query']);_0x251b9e['attributes']=_[_0x47a5('0x5d')](_0x5669c7[_0x47a5('0x51')],qs[_0x47a5('0x5f')](_0x596091[_0x47a5('0x5b')][_0x47a5('0x5f')]));_0x251b9e['attributes']=_0x251b9e[_0x47a5('0x5e')][_0x47a5('0x60')]?_0x251b9e[_0x47a5('0x5e')]:_0x5669c7[_0x47a5('0x51')];if(!_0x596091[_0x47a5('0x5b')][_0x47a5('0xfd')](_0x47a5('0x61'))){_0x251b9e[_0x47a5('0x26')]=qs['limit'](_0x596091['query'][_0x47a5('0x26')]);_0x251b9e[_0x47a5('0x24')]=qs['offset'](_0x596091[_0x47a5('0x5b')]['offset']);}_0x251b9e[_0x47a5('0x62')]=qs['sort'](_0x596091[_0x47a5('0x5b')]['sort']);_0x251b9e['where']=qs[_0x47a5('0x65')](_[_0x47a5('0x7c')](_0x596091[_0x47a5('0x5b')],_0x5669c7['filters']));_0x251b9e[_0x47a5('0x64')][_0x47a5('0x79')]=_0x48a71f['id'];if(_0x596091[_0x47a5('0x5b')][_0x47a5('0x66')]){_0x251b9e[_0x47a5('0x64')]=_[_0x47a5('0x67')](_0x251b9e[_0x47a5('0x64')],{'$or':_['map'](_0x251b9e[_0x47a5('0x5e')],function(_0x5c58c9){var _0x344fbe={};_0x344fbe[_0x5c58c9]={'$like':'%'+_0x596091['query'][_0x47a5('0x66')]+'%'};return _0x344fbe;})});}_0x251b9e=_[_0x47a5('0x67')]({},_0x251b9e,_0x596091[_0x47a5('0xfe')]);return db['ChatOfflineMessage'][_0x47a5('0x27')]({'where':_0x251b9e[_0x47a5('0x64')]})[_0x47a5('0x16')](function(_0x54c030){_0x53a0c3[_0x47a5('0x27')]=_0x54c030;if(_0x596091[_0x47a5('0x5b')][_0x47a5('0x6c')]){_0x251b9e[_0x47a5('0x6d')]=[{'all':!![]}];}else{_0x251b9e['include']=[{'model':db['CmContact'],'as':_0x47a5('0xff'),'required':![]},{'model':db[_0x47a5('0xe5')],'as':'Attachments','required':![]}];}return db[_0x47a5('0x127')]['findAll'](_0x251b9e);})[_0x47a5('0x16')](function(_0x196f41){_0x53a0c3[_0x47a5('0x69')]=_0x196f41;return _0x53a0c3;});}})[_0x47a5('0x16')](respondWithFilteredResult(_0x4f04bb,_0x251b9e))[_0x47a5('0x1f')](handleError(_0x4f04bb,null));};exports[_0x47a5('0x128')]=function(_0x549a8a,_0x1acf09){return db[_0x47a5('0x57')][_0x47a5('0x6e')]({'where':{'id':_0x549a8a['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x1acf09,null))[_0x47a5('0x16')](function(_0xe3ba91){if(_0xe3ba91){return _0xe3ba91[_0x47a5('0x128')](_0x549a8a[_0x47a5('0x76')][_0x47a5('0x7f')],_[_0x47a5('0xfb')](_0x549a8a['body'],[_0x47a5('0x7f'),'id'])||{})['spread'](function(_0x4d1060){for(var _0xa288ca=0x0;_0xa288ca<_0x549a8a['body']['ids']['length'];_0xa288ca+=0x1){socket[_0x47a5('0x129')](_0x47a5('0x12a'),{'UserId':Number(_0x549a8a[_0x47a5('0x76')]['ids'][_0xa288ca]),'ChatWebsiteId':Number(_0x549a8a['params']['id'])});}return _0x4d1060;});}})[_0x47a5('0x16')](respondWithResult(_0x1acf09,null))[_0x47a5('0x1f')](handleError(_0x1acf09,null));};exports[_0x47a5('0x12b')]=function(_0x13ed08,_0x2f2eb7){return db['ChatWebsite'][_0x47a5('0x6e')]({'where':{'id':_0x13ed08[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x2f2eb7,null))[_0x47a5('0x16')](function(_0x22cd5c){if(_0x22cd5c){return _0x22cd5c[_0x47a5('0x12b')](_0x13ed08[_0x47a5('0x5b')][_0x47a5('0x7f')])[_0x47a5('0x16')](function(){if(_['isArray'](_0x13ed08[_0x47a5('0x5b')][_0x47a5('0x7f')])){for(var _0x97a1a7=0x0;_0x97a1a7<_0x13ed08[_0x47a5('0x5b')][_0x47a5('0x7f')]['length'];_0x97a1a7+=0x1){socket[_0x47a5('0x129')](_0x47a5('0x12c'),{'UserId':Number(_0x13ed08[_0x47a5('0x5b')][_0x47a5('0x7f')][_0x97a1a7]),'ChatWebsiteId':Number(_0x13ed08['params']['id'])});}}else{socket[_0x47a5('0x129')](_0x47a5('0x12c'),{'UserId':Number(_0x13ed08['query'][_0x47a5('0x7f')]),'ChatWebsiteId':Number(_0x13ed08[_0x47a5('0x6a')]['id'])});}});}})[_0x47a5('0x16')](respondWithStatusCode(_0x2f2eb7,null))[_0x47a5('0x1f')](handleError(_0x2f2eb7,null));};exports[_0x47a5('0x12d')]=function(_0x25d495,_0x575ed3){var _0x81df5c={};var _0x7a562d={};var _0x592c32;var _0x5e0938;return db['ChatWebsite'][_0x47a5('0x7b')]({'where':{'id':_0x25d495[_0x47a5('0x6a')]['id']}})['then'](handleEntityNotFound(_0x575ed3,null))[_0x47a5('0x16')](function(_0x1deb82){if(_0x1deb82){_0x592c32=_0x1deb82;_0x7a562d['model']=_[_0x47a5('0x5c')](db[_0x47a5('0xc7')][_0x47a5('0x58')]);_0x7a562d[_0x47a5('0x5b')]=_[_0x47a5('0x5c')](_0x25d495['query']);_0x7a562d[_0x47a5('0x65')]=_['intersection'](_0x7a562d[_0x47a5('0x51')],_0x7a562d['query']);_0x81df5c[_0x47a5('0x5e')]=_[_0x47a5('0x5d')](_0x7a562d['model'],qs['fields'](_0x25d495['query'][_0x47a5('0x5f')]));_0x81df5c[_0x47a5('0x5e')]=_0x81df5c[_0x47a5('0x5e')]['length']?_0x81df5c[_0x47a5('0x5e')]:_0x7a562d[_0x47a5('0x51')];_0x81df5c[_0x47a5('0x62')]=qs[_0x47a5('0x63')](_0x25d495[_0x47a5('0x5b')][_0x47a5('0x63')]);_0x81df5c['where']=qs[_0x47a5('0x65')](_['pick'](_0x25d495[_0x47a5('0x5b')],_0x7a562d[_0x47a5('0x65')]));if(_0x25d495[_0x47a5('0x5b')]['filter']){_0x81df5c[_0x47a5('0x64')]=_[_0x47a5('0x67')](_0x81df5c[_0x47a5('0x64')],{'$or':_[_0x47a5('0x3c')](_0x81df5c['attributes'],function(_0x4e1fca){var _0xa5f6f1={};_0xa5f6f1[_0x4e1fca]={'$like':'%'+_0x25d495[_0x47a5('0x5b')][_0x47a5('0x66')]+'%'};return _0xa5f6f1;})});}_0x81df5c=_[_0x47a5('0x67')]({},_0x81df5c,_0x25d495['options']);return _0x592c32[_0x47a5('0x12d')](_0x81df5c);}})[_0x47a5('0x16')](function(_0x1b8fe1){if(_0x1b8fe1){_0x5e0938=_0x1b8fe1[_0x47a5('0x60')];if(!_0x25d495[_0x47a5('0x5b')][_0x47a5('0xfd')](_0x47a5('0x61'))){_0x81df5c[_0x47a5('0x26')]=qs['limit'](_0x25d495[_0x47a5('0x5b')]['limit']);_0x81df5c[_0x47a5('0x24')]=qs['offset'](_0x25d495[_0x47a5('0x5b')][_0x47a5('0x24')]);}return _0x592c32[_0x47a5('0x12d')](_0x81df5c);}})[_0x47a5('0x16')](function(_0x28b8aa){if(_0x28b8aa){return _0x28b8aa?{'count':_0x5e0938,'rows':_0x28b8aa}:null;}})[_0x47a5('0x16')](respondWithResult(_0x575ed3,null))[_0x47a5('0x1f')](handleError(_0x575ed3,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 8c746f1..4b7000d 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 _0xc090=['update','remove','emit','hook','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x4cf4e5,_0x2e533b){var _0x4d7ab3=function(_0x513452){while(--_0x513452){_0x4cf4e5['push'](_0x4cf4e5['shift']());}};_0x4d7ab3(++_0x2e533b);}(_0xc090,0x112));var _0x0c09=function(_0x543942,_0x1f84f2){_0x543942=_0x543942-0x0;var _0x3f9978=_0xc090[_0x543942];return _0x3f9978;};'use strict';var EventEmitter=require(_0x0c09('0x0'));var ChatWebsite=require(_0x0c09('0x1'))['db'][_0x0c09('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0c09('0x3')](0x0);var events={'afterCreate':_0x0c09('0x4'),'afterUpdate':_0x0c09('0x5'),'afterDestroy':_0x0c09('0x6')};function emitEvent(_0x260c36){return function(_0x11984f,_0x487f03,_0x2e968b){ChatWebsiteEvents[_0x0c09('0x7')](_0x260c36+':'+_0x11984f['id'],_0x11984f);ChatWebsiteEvents['emit'](_0x260c36,_0x11984f);_0x2e968b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x0c09('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update','remove'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x34e8,0x12c));var _0x834e=function(_0x3038c0,_0x33d136){_0x3038c0=_0x3038c0-0x0;var _0xe0a1ca=_0x34e8[_0x3038c0];return _0xe0a1ca;};'use strict';var EventEmitter=require(_0x834e('0x0'));var ChatWebsite=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x834e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x834e('0x4'),'afterDestroy':_0x834e('0x5')};function emitEvent(_0x472111){return function(_0x31bf20,_0x289ef2,_0x19a3e0){ChatWebsiteEvents[_0x834e('0x6')](_0x472111+':'+_0x31bf20['id'],_0x31bf20);ChatWebsiteEvents['emit'](_0x472111,_0x31bf20);_0x19a3e0(null);};}for(var e in events){if(events[_0x834e('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x834e('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 0d3d5dc..4cc3fcb 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 _0x2240=['util','../../config/logger','moment','bluebird','path','../../config/environment','exports','ChatWebsite','lodash'];(function(_0x241811,_0x35ca5f){var _0x1d1e76=function(_0x5c024e){while(--_0x5c024e){_0x241811['push'](_0x241811['shift']());}};_0x1d1e76(++_0x35ca5f);}(_0x2240,0xd7));var _0x0224=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x2240[_0x24061a];return _0x82054e;};'use strict';var _=require(_0x0224('0x0'));var util=require(_0x0224('0x1'));var logger=require(_0x0224('0x2'))('api');var moment=require(_0x0224('0x3'));var BPromise=require(_0x0224('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0224('0x5'));var rimraf=require('rimraf');var config=require(_0x0224('0x6'));var attributes=require('./chatWebsite.attributes');module[_0x0224('0x7')]=function(_0x10da2f,_0x4e6da1){return _0x10da2f['define'](_0x0224('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd715=['moment','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger'];(function(_0x288c41,_0x30e76c){var _0x1ca76e=function(_0x1f8bfa){while(--_0x1f8bfa){_0x288c41['push'](_0x288c41['shift']());}};_0x1ca76e(++_0x30e76c);}(_0xd715,0x1a2));var _0x5d71=function(_0x12697b,_0x549341){_0x12697b=_0x12697b-0x0;var _0x45770a=_0xd715[_0x12697b];return _0x45770a;};'use strict';var _=require(_0x5d71('0x0'));var util=require('util');var logger=require(_0x5d71('0x1'))('api');var moment=require(_0x5d71('0x2'));var BPromise=require(_0x5d71('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d71('0x4'));var rimraf=require(_0x5d71('0x5'));var config=require(_0x5d71('0x6'));var attributes=require(_0x5d71('0x7'));module[_0x5d71('0x8')]=function(_0x31605f,_0x4e9f01){return _0x31605f[_0x5d71('0x9')](_0x5d71('0xa'),attributes,{'tableName':_0x5d71('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 329c131..3a12b49 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 _0x1926=['message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x24d05e,_0x45a908){var _0x390237=function(_0x188232){while(--_0x188232){_0x24d05e['push'](_0x24d05e['shift']());}};_0x390237(++_0x45a908);}(_0x1926,0xe4));var _0x6192=function(_0x42f611,_0x32b69a){_0x42f611=_0x42f611-0x0;var _0x44caaf=_0x1926[_0x42f611];return _0x44caaf;};'use strict';var _=require(_0x6192('0x0'));var util=require(_0x6192('0x1'));var moment=require(_0x6192('0x2'));var BPromise=require(_0x6192('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6192('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6192('0x5'));var logger=require(_0x6192('0x6'))(_0x6192('0x7'));var config=require(_0x6192('0x8'));var jayson=require(_0x6192('0x9'));var client=jayson[_0x6192('0xa')]['http']({'port':0x232a});config['redis']=_[_0x6192('0xb')](config[_0x6192('0xc')],{'host':_0x6192('0xd'),'port':0x18eb});var socket=require(_0x6192('0xe'))(new Redis(config[_0x6192('0xc')]));require(_0x6192('0xf'))[_0x6192('0x10')](socket);function respondWithRpcPromise(_0x294538,_0x9b916b,_0x21bf41){return new BPromise(function(_0x59a69c,_0x4b49ac){return client['request'](_0x294538,_0x21bf41)[_0x6192('0x11')](function(_0x338502){logger['info'](_0x6192('0x12'),_0x9b916b,_0x6192('0x13'));logger[_0x6192('0x14')](_0x6192('0x15'),_0x9b916b,_0x6192('0x13'),JSON[_0x6192('0x16')](_0x338502));if(_0x338502[_0x6192('0x17')]){if(_0x338502[_0x6192('0x17')]['code']===0x1f4){logger[_0x6192('0x17')](_0x6192('0x12'),_0x9b916b,_0x338502[_0x6192('0x17')]['message']);return _0x4b49ac(_0x338502[_0x6192('0x17')]['message']);}logger[_0x6192('0x17')](_0x6192('0x12'),_0x9b916b,_0x338502[_0x6192('0x17')]['message']);return _0x59a69c(_0x338502[_0x6192('0x17')][_0x6192('0x18')]);}else{logger[_0x6192('0x19')](_0x6192('0x12'),_0x9b916b,_0x6192('0x13'));_0x59a69c(_0x338502[_0x6192('0x1a')]['message']);}})[_0x6192('0x1b')](function(_0xcfb4c5){logger[_0x6192('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x9b916b,_0xcfb4c5);_0x4b49ac(_0xcfb4c5);});});} \ No newline at end of file +var _0x6a01=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','debug','error','code','message','info','request\x20sent','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3a9503,_0x40e60c){var _0x538251=function(_0x25c755){while(--_0x25c755){_0x3a9503['push'](_0x3a9503['shift']());}};_0x538251(++_0x40e60c);}(_0x6a01,0x19a));var _0x16a0=function(_0xdca4a6,_0x4965f6){_0xdca4a6=_0xdca4a6-0x0;var _0x5c5b95=_0x6a01[_0xdca4a6];return _0x5c5b95;};'use strict';var _=require(_0x16a0('0x0'));var util=require(_0x16a0('0x1'));var moment=require('moment');var BPromise=require(_0x16a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16a0('0x3'));var db=require(_0x16a0('0x4'))['db'];var utils=require(_0x16a0('0x5'));var logger=require('../../config/logger')(_0x16a0('0x6'));var config=require(_0x16a0('0x7'));var jayson=require(_0x16a0('0x8'));var client=jayson[_0x16a0('0x9')][_0x16a0('0xa')]({'port':0x232a});config[_0x16a0('0xb')]=_[_0x16a0('0xc')](config[_0x16a0('0xb')],{'host':_0x16a0('0xd'),'port':0x18eb});var socket=require(_0x16a0('0xe'))(new Redis(config[_0x16a0('0xb')]));require('./chatWebsite.socket')[_0x16a0('0xf')](socket);function respondWithRpcPromise(_0x4e32a5,_0x2e16d3,_0x12d671){return new BPromise(function(_0xf107d2,_0x2693f9){return client[_0x16a0('0x10')](_0x4e32a5,_0x12d671)[_0x16a0('0x11')](function(_0x2a19e2){logger['info'](_0x16a0('0x12'),_0x2e16d3,'request\x20sent');logger[_0x16a0('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2e16d3,'request\x20sent',JSON['stringify'](_0x2a19e2));if(_0x2a19e2[_0x16a0('0x14')]){if(_0x2a19e2[_0x16a0('0x14')][_0x16a0('0x15')]===0x1f4){logger[_0x16a0('0x14')](_0x16a0('0x12'),_0x2e16d3,_0x2a19e2['error']['message']);return _0x2693f9(_0x2a19e2[_0x16a0('0x14')]['message']);}logger[_0x16a0('0x14')](_0x16a0('0x12'),_0x2e16d3,_0x2a19e2[_0x16a0('0x14')]['message']);return _0xf107d2(_0x2a19e2[_0x16a0('0x14')][_0x16a0('0x16')]);}else{logger[_0x16a0('0x17')](_0x16a0('0x12'),_0x2e16d3,_0x16a0('0x18'));_0xf107d2(_0x2a19e2[_0x16a0('0x19')][_0x16a0('0x16')]);}})['catch'](function(_0x74dd60){logger[_0x16a0('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x2e16d3,_0x74dd60);_0x2693f9(_0x74dd60);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 9034333..b49f87b 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 _0xb9b7=['length','chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener','register'];(function(_0x3db791,_0xc96e9b){var _0x4d4eb0=function(_0x1e3dcf){while(--_0x1e3dcf){_0x3db791['push'](_0x3db791['shift']());}};_0x4d4eb0(++_0xc96e9b);}(_0xb9b7,0x112));var _0x7b9b=function(_0x5862ae,_0x2162ce){_0x5862ae=_0x5862ae-0x0;var _0x49ec17=_0xb9b7[_0x5862ae];return _0x49ec17;};'use strict';var ChatWebsiteEvents=require(_0x7b9b('0x0'));var events=[_0x7b9b('0x1'),_0x7b9b('0x2'),'update'];function createListener(_0x2a1553,_0x18428a){return function(_0x289cfa){_0x18428a[_0x7b9b('0x3')](_0x2a1553,_0x289cfa);};}function removeListener(_0x5ed1fa,_0x6263de){return function(){ChatWebsiteEvents[_0x7b9b('0x4')](_0x5ed1fa,_0x6263de);};}exports[_0x7b9b('0x5')]=function(_0x26db08){for(var _0x4cafc0=0x0,_0x27f95d=events[_0x7b9b('0x6')];_0x4cafc0<_0x27f95d;_0x4cafc0++){var _0x43b772=events[_0x4cafc0];var _0x1fbb19=createListener(_0x7b9b('0x7')+_0x43b772,_0x26db08);ChatWebsiteEvents['on'](_0x43b772,_0x1fbb19);}}; \ No newline at end of file +var _0x513c=['save','remove','removeListener','chatWebsite:','./chatWebsite.events'];(function(_0x40d1ba,_0x3cb77c){var _0x565261=function(_0x1a5b54){while(--_0x1a5b54){_0x40d1ba['push'](_0x40d1ba['shift']());}};_0x565261(++_0x3cb77c);}(_0x513c,0x135));var _0xc513=function(_0x44caf2,_0x8ffb16){_0x44caf2=_0x44caf2-0x0;var _0x25978d=_0x513c[_0x44caf2];return _0x25978d;};'use strict';var ChatWebsiteEvents=require(_0xc513('0x0'));var events=[_0xc513('0x1'),_0xc513('0x2'),'update'];function createListener(_0x2ab350,_0x21ef01){return function(_0x2f0cd6){_0x21ef01['emit'](_0x2ab350,_0x2f0cd6);};}function removeListener(_0x536f9c,_0x413598){return function(){ChatWebsiteEvents[_0xc513('0x3')](_0x536f9c,_0x413598);};}exports['register']=function(_0x25549e){for(var _0x58cc54=0x0,_0x141f1b=events['length'];_0x58cc54<_0x141f1b;_0x58cc54++){var _0x1c2097=events[_0x58cc54];var _0x41c266=createListener(_0xc513('0x4')+_0x1c2097,_0x25549e);ChatWebsiteEvents['on'](_0x1c2097,_0x41c266);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 4a43b1b..2735a8c 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 _0x7a44=['/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','now','format','originalname','addAvatar','server/files/images/avatars/','addCustomerAvatar','single','file','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers'];(function(_0x4beea8,_0x1afaa0){var _0x13ef65=function(_0x4a8f4e){while(--_0x4a8f4e){_0x4beea8['push'](_0x4beea8['shift']());}};_0x13ef65(++_0x1afaa0);}(_0x7a44,0x1bb));var _0x47a4=function(_0x3adee5,_0x23655c){_0x3adee5=_0x3adee5-0x0;var _0x2a5178=_0x7a44[_0x3adee5];return _0x2a5178;};'use strict';var multer=require(_0x47a4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x47a4('0x1'));var express=require(_0x47a4('0x2'));var router=express[_0x47a4('0x3')]();var fs_extra=require(_0x47a4('0x4'));var auth=require(_0x47a4('0x5'));var interaction=require(_0x47a4('0x6'));var config=require(_0x47a4('0x7'));var controller=require(_0x47a4('0x8'));router[_0x47a4('0x9')]('/',auth[_0x47a4('0xa')](),controller[_0x47a4('0xb')]);router[_0x47a4('0x9')](_0x47a4('0xc'),auth[_0x47a4('0xa')](),controller[_0x47a4('0xd')]);router['get'](_0x47a4('0xe'),auth['isAuthenticated'](),controller[_0x47a4('0xf')]);router['get'](_0x47a4('0x10'),auth[_0x47a4('0xa')](),controller['getDispositions']);router[_0x47a4('0x9')](_0x47a4('0x11'),auth[_0x47a4('0xa')](),controller[_0x47a4('0x12')]);router[_0x47a4('0x9')](_0x47a4('0x13'),controller[_0x47a4('0x14')]);router['get'](_0x47a4('0x15'),controller[_0x47a4('0x16')]);router['get'](_0x47a4('0x17'),controller['getCustomerAvatar']);router[_0x47a4('0x9')](_0x47a4('0x18'),controller[_0x47a4('0x19')]);router[_0x47a4('0x9')](_0x47a4('0x1a'),auth[_0x47a4('0xa')](),controller['getInteractions']);router[_0x47a4('0x9')](_0x47a4('0x1b'),controller[_0x47a4('0x1c')]);router[_0x47a4('0x9')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router['get'](_0x47a4('0x1d'),auth['isAuthenticated'](),controller[_0x47a4('0x1e')]);router[_0x47a4('0x9')](_0x47a4('0x1f'),controller[_0x47a4('0x20')]);router[_0x47a4('0x9')](_0x47a4('0x21'),auth['isAuthenticated'](),controller[_0x47a4('0x22')]);router[_0x47a4('0x9')](_0x47a4('0x23'),auth['isAuthenticated'](),controller[_0x47a4('0x24')]);router[_0x47a4('0x25')]('/',auth['isAuthenticated'](),controller[_0x47a4('0x26')]);router[_0x47a4('0x25')](_0x47a4('0x10'),auth[_0x47a4('0xa')](),controller[_0x47a4('0x27')]);router[_0x47a4('0x25')]('/:id/canned_answers',auth[_0x47a4('0xa')](),controller[_0x47a4('0x28')]);var upload=multer({'storage':multer[_0x47a4('0x29')]({'destination':function(_0x2328ce,_0x336842,_0x18cea1){_0x18cea1(null,path[_0x47a4('0x2a')](config[_0x47a4('0x2b')],_0x47a4('0x2c')));},'filename':function(_0x2765e2,_0x11df06,_0x2d93a3){_0x2d93a3(null,util['format'](_0x47a4('0x2d'),Date[_0x47a4('0x2e')](),_0x11df06['originalname']));}})});router[_0x47a4('0x25')](_0x47a4('0x13'),upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x189c28,_0x3708f8,_0x345fd3){_0x345fd3(null,path[_0x47a4('0x2a')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x2f81f2,_0x414da8,_0x153e19){_0x153e19(null,util[_0x47a4('0x2f')](_0x47a4('0x2d'),Date[_0x47a4('0x2e')](),_0x414da8[_0x47a4('0x30')]));}})});router[_0x47a4('0x25')](_0x47a4('0x15'),upload['single']('file'),controller[_0x47a4('0x31')]);var upload=multer({'storage':multer[_0x47a4('0x29')]({'destination':function(_0x4d2703,_0x128b76,_0x1aca3f){_0x1aca3f(null,path[_0x47a4('0x2a')](config[_0x47a4('0x2b')],_0x47a4('0x32')));},'filename':function(_0x21e3bc,_0x5e30d8,_0x4aabd2){_0x4aabd2(null,util['format']('%s-%s',Date[_0x47a4('0x2e')](),_0x5e30d8['originalname']));}})});router[_0x47a4('0x25')](_0x47a4('0x17'),upload['single']('file'),controller[_0x47a4('0x33')]);var upload=multer({'storage':multer[_0x47a4('0x29')]({'destination':function(_0x2ec014,_0x29d200,_0xb85f85){_0xb85f85(null,path[_0x47a4('0x2a')](config[_0x47a4('0x2b')],_0x47a4('0x32')));},'filename':function(_0xd8c34c,_0x7de120,_0xc3d741){_0xc3d741(null,util[_0x47a4('0x2f')](_0x47a4('0x2d'),Date[_0x47a4('0x2e')](),_0x7de120['originalname']));}})});router[_0x47a4('0x25')](_0x47a4('0x18'),upload[_0x47a4('0x34')](_0x47a4('0x35')),controller['addSystemAvatar']);router['post'](_0x47a4('0x36'),controller[_0x47a4('0x37')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x494dda,_0x4fc1cf,_0xc9514){const _0x38de20=path['join'](config[_0x47a4('0x2b')],_0x47a4('0x38'),_0x47a4('0x39'),_0x47a4('0x3a'));fs_extra['ensureDir'](_0x38de20,function(){_0xc9514(null,_0x38de20);});},'filename':function(_0x2094db,_0x5db9e7,_0x363860){const _0x116459=_0x5db9e7['originalname'][_0x47a4('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x275a8e=path[_0x47a4('0x3c')](_0x116459);const _0x449b8c=Date[_0x47a4('0x2e')]()+'-'+_0x116459[_0x47a4('0x3b')](_0x275a8e,'')+_0x275a8e;_0x363860(null,_0x449b8c);}})});router[_0x47a4('0x25')](_0x47a4('0x3d'),offlineUploadMulter[_0x47a4('0x3e')](),controller[_0x47a4('0x3f')]);router[_0x47a4('0x25')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x47a4('0x40')]);router[_0x47a4('0x25')](_0x47a4('0x41'),auth['isAuthenticated'](),controller[_0x47a4('0x42')]);router[_0x47a4('0x25')](_0x47a4('0x1d'),auth['isAuthenticated'](),controller[_0x47a4('0x43')]);router['post'](_0x47a4('0x23'),auth[_0x47a4('0xa')](),controller[_0x47a4('0x44')]);router[_0x47a4('0x45')](_0x47a4('0xe'),auth[_0x47a4('0xa')](),controller[_0x47a4('0x46')]);router[_0x47a4('0x47')]('/:id',auth[_0x47a4('0xa')](),controller[_0x47a4('0x48')]);router['delete']('/:id/dispositions',auth[_0x47a4('0xa')](),controller[_0x47a4('0x49')]);router[_0x47a4('0x47')](_0x47a4('0x11'),auth[_0x47a4('0xa')](),controller[_0x47a4('0x4a')]);router['delete'](_0x47a4('0x23'),auth[_0x47a4('0xa')](),controller[_0x47a4('0x4b')]);module[_0x47a4('0x4c')]=router; \ No newline at end of file +var _0x15f6=['addCustomerAvatar','notify','server/files','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','/:id/interactions','addInteraction','addProactiveActions','/:id/users','addAgents','put','update','delete','removeDispositions','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','now','originalname','/:id/logo','single','file','server/files/images/avatars/','format','%s-%s'];(function(_0x3b8eb3,_0x4ad20f){var _0x2b2d38=function(_0xed090){while(--_0xed090){_0x3b8eb3['push'](_0x3b8eb3['shift']());}};_0x2b2d38(++_0x4ad20f);}(_0x15f6,0x9c));var _0x615f=function(_0x1d3c50,_0x4aa0b8){_0x1d3c50=_0x1d3c50-0x0;var _0x272d50=_0x15f6[_0x1d3c50];return _0x272d50;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x615f('0x0'));var timeout=require(_0x615f('0x1'));var express=require(_0x615f('0x2'));var router=express[_0x615f('0x3')]();var fs_extra=require(_0x615f('0x4'));var auth=require(_0x615f('0x5'));var interaction=require(_0x615f('0x6'));var config=require(_0x615f('0x7'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x615f('0x8')](),controller['index']);router[_0x615f('0x9')](_0x615f('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x615f('0x9')](_0x615f('0xb'),auth['isAuthenticated'](),controller[_0x615f('0xc')]);router['get'](_0x615f('0xd'),auth[_0x615f('0x8')](),controller[_0x615f('0xe')]);router['get'](_0x615f('0xf'),auth[_0x615f('0x8')](),controller['getAnswers']);router[_0x615f('0x9')]('/:id/logo',controller[_0x615f('0x10')]);router[_0x615f('0x9')](_0x615f('0x11'),controller[_0x615f('0x12')]);router['get'](_0x615f('0x13'),controller[_0x615f('0x14')]);router['get'](_0x615f('0x15'),controller[_0x615f('0x16')]);router[_0x615f('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x615f('0x17')]);router[_0x615f('0x9')](_0x615f('0x18'),controller[_0x615f('0x19')]);router['get'](_0x615f('0x1a'),auth[_0x615f('0x8')](),controller['getApplications']);router['get'](_0x615f('0x1b'),auth[_0x615f('0x8')](),controller[_0x615f('0x1c')]);router[_0x615f('0x9')](_0x615f('0x1d'),controller[_0x615f('0x1e')]);router['get'](_0x615f('0x1f'),auth['isAuthenticated'](),controller[_0x615f('0x20')]);router[_0x615f('0x9')]('/:id/users',auth[_0x615f('0x8')](),controller['getAgents']);router[_0x615f('0x21')]('/',auth['isAuthenticated'](),controller[_0x615f('0x22')]);router['post'](_0x615f('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x615f('0x21')](_0x615f('0xf'),auth[_0x615f('0x8')](),controller[_0x615f('0x23')]);var upload=multer({'storage':multer[_0x615f('0x24')]({'destination':function(_0x5699b1,_0x5dbc3c,_0x245be3){_0x245be3(null,path[_0x615f('0x25')](config[_0x615f('0x26')],_0x615f('0x27')));},'filename':function(_0x5b5542,_0x309b01,_0x44fcf8){_0x44fcf8(null,util['format']('%s-%s',Date[_0x615f('0x28')](),_0x309b01[_0x615f('0x29')]));}})});router[_0x615f('0x21')](_0x615f('0x2a'),upload[_0x615f('0x2b')](_0x615f('0x2c')),controller['addLogo']);var upload=multer({'storage':multer[_0x615f('0x24')]({'destination':function(_0x48f95e,_0x47b3d7,_0x2b6f43){_0x2b6f43(null,path[_0x615f('0x25')](config[_0x615f('0x26')],_0x615f('0x2d')));},'filename':function(_0x541ce9,_0x2958e9,_0xcd1566){_0xcd1566(null,util[_0x615f('0x2e')](_0x615f('0x2f'),Date['now'](),_0x2958e9['originalname']));}})});router[_0x615f('0x21')]('/:id/avatar',upload[_0x615f('0x2b')]('file'),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x539e45,_0x1c8c07,_0x164786){_0x164786(null,path[_0x615f('0x25')](config['root'],_0x615f('0x2d')));},'filename':function(_0x356fdb,_0x11b488,_0x5db464){_0x5db464(null,util[_0x615f('0x2e')](_0x615f('0x2f'),Date[_0x615f('0x28')](),_0x11b488['originalname']));}})});router[_0x615f('0x21')](_0x615f('0x13'),upload[_0x615f('0x2b')](_0x615f('0x2c')),controller[_0x615f('0x30')]);var upload=multer({'storage':multer[_0x615f('0x24')]({'destination':function(_0x337b13,_0x2fe753,_0x4bffb2){_0x4bffb2(null,path['join'](config[_0x615f('0x26')],_0x615f('0x2d')));},'filename':function(_0x1740ee,_0xcae42f,_0x55648a){_0x55648a(null,util[_0x615f('0x2e')](_0x615f('0x2f'),Date[_0x615f('0x28')](),_0xcae42f[_0x615f('0x29')]));}})});router[_0x615f('0x21')](_0x615f('0x15'),upload[_0x615f('0x2b')](_0x615f('0x2c')),controller['addSystemAvatar']);router[_0x615f('0x21')]('/:id/notify',controller[_0x615f('0x31')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x1c1390,_0x39e6f7,_0x2cda91){const _0x18849e=path['join'](config['root'],_0x615f('0x32'),'attachments',_0x615f('0x33'));fs_extra[_0x615f('0x34')](_0x18849e,function(){_0x2cda91(null,_0x18849e);});},'filename':function(_0x1500d6,_0x4739d3,_0x27cb5e){const _0x4cdca0=_0x4739d3['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2bcdec=path[_0x615f('0x35')](_0x4cdca0);const _0x1a8e08=Date['now']()+'-'+_0x4cdca0[_0x615f('0x36')](_0x2bcdec,'')+_0x2bcdec;_0x27cb5e(null,_0x1a8e08);}})});router['post'](_0x615f('0x37'),offlineUploadMulter[_0x615f('0x38')](),controller[_0x615f('0x39')]);router[_0x615f('0x21')](_0x615f('0x3a'),auth[_0x615f('0x8')](),controller[_0x615f('0x3b')]);router[_0x615f('0x21')]('/:id/applications',auth[_0x615f('0x8')](),controller['addApplications']);router['post'](_0x615f('0x1b'),auth[_0x615f('0x8')](),controller[_0x615f('0x3c')]);router['post'](_0x615f('0x3d'),auth[_0x615f('0x8')](),controller[_0x615f('0x3e')]);router[_0x615f('0x3f')](_0x615f('0xb'),auth['isAuthenticated'](),controller[_0x615f('0x40')]);router['delete'](_0x615f('0xb'),auth[_0x615f('0x8')](),controller['destroy']);router[_0x615f('0x41')](_0x615f('0xd'),auth[_0x615f('0x8')](),controller[_0x615f('0x42')]);router['delete'](_0x615f('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x615f('0x41')](_0x615f('0x3d'),auth[_0x615f('0x8')](),controller['removeAgents']);module[_0x615f('0x43')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 778fadc..70b32d1 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 _0x5c34=['exports','beaver-logger/server','../components/auth/service','../config/environment','Router','env','production','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c34,0x79));var _0x45c3=function(_0x1434d7,_0x50cf27){_0x1434d7=_0x1434d7-0x0;var _0x192d42=_0x5c34[_0x1434d7];return _0x192d42;};var beaverLogger=require(_0x45c3('0x0'));var express=require('express');var auth=require(_0x45c3('0x1'));var config=require(_0x45c3('0x2'));var router=express[_0x45c3('0x3')]();var isProduction=config[_0x45c3('0x4')]===_0x45c3('0x5')||![];function clientSideLogs(_0x114922,_0x1e5c5a,_0x32c631){var _0x1b65e0=_0x114922[_0x45c3('0x6')][_0x45c3('0x7')]('client-side-logger');if(!_0x1b65e0){throw new Error(_0x45c3('0x8'));}return beaverLogger[_0x45c3('0x9')]({'uri':'/client-logs','logger':_0x1b65e0,'enableCors':!isProduction})(_0x114922,_0x1e5c5a,_0x32c631);}router['use'](auth[_0x45c3('0xa')](),clientSideLogs);module[_0x45c3('0xb')]=router; \ No newline at end of file +var _0x1ae5=['../components/auth/service','../config/environment','Router','env','production','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','beaver-logger/server','express'];(function(_0x6a3dee,_0x43c2a4){var _0x28b6bf=function(_0x3e98dd){while(--_0x3e98dd){_0x6a3dee['push'](_0x6a3dee['shift']());}};_0x28b6bf(++_0x43c2a4);}(_0x1ae5,0xc1));var _0x51ae=function(_0x4363c9,_0x456292){_0x4363c9=_0x4363c9-0x0;var _0x5c1b6a=_0x1ae5[_0x4363c9];return _0x5c1b6a;};var beaverLogger=require(_0x51ae('0x0'));var express=require(_0x51ae('0x1'));var auth=require(_0x51ae('0x2'));var config=require(_0x51ae('0x3'));var router=express[_0x51ae('0x4')]();var isProduction=config[_0x51ae('0x5')]===_0x51ae('0x6')||![];function clientSideLogs(_0x3ba714,_0x9094b,_0x2df504){var _0x26384a=_0x3ba714['app']['get'](_0x51ae('0x7'));if(!_0x26384a){throw new Error(_0x51ae('0x8'));}return beaverLogger[_0x51ae('0x9')]({'uri':_0x51ae('0xa'),'logger':_0x26384a,'enableCors':!isProduction})(_0x3ba714,_0x9094b,_0x2df504);}router[_0x51ae('0xb')](auth[_0x51ae('0xc')](),clientSideLogs);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 8dcc46c..392a114 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 _0xb6e3=['TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x3c04ab,_0x18929c){var _0x3bd2aa=function(_0x596c36){while(--_0x596c36){_0x3c04ab['push'](_0x3c04ab['shift']());}};_0x3bd2aa(++_0x18929c);}(_0xb6e3,0x10d));var _0x3b6e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb6e3[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module[_0x3b6e('0x0')]={'name':{'type':Sequelize[_0x3b6e('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3b6e('0x2')](_0x3b6e('0x3'),_0x3b6e('0x4'),_0x3b6e('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x3b6e('0x2')](_0x3b6e('0x6'),_0x3b6e('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':_0x3b6e('0x8')},'data2':{'type':Sequelize[_0x3b6e('0x1')],'comment':_0x3b6e('0x9')},'data3':{'type':Sequelize[_0x3b6e('0x1')],'comment':_0x3b6e('0xa')},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x3b6e('0xb')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x3b6e('0xb')],'comment':_0x3b6e('0xc')},'data7':{'type':Sequelize[_0x3b6e('0xb')],'comment':_0x3b6e('0xd')}}; \ No newline at end of file +var _0x0457=['ENUM','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','Google','MicrosoftAzure'];(function(_0x6bd4e3,_0x377cd6){var _0x2cc770=function(_0x7cad59){while(--_0x7cad59){_0x6bd4e3['push'](_0x6bd4e3['shift']());}};_0x2cc770(++_0x377cd6);}(_0x0457,0x78));var _0x7045=function(_0x43d701,_0x4bb2e9){_0x43d701=_0x43d701-0x0;var _0x2ec4c6=_0x0457[_0x43d701];return _0x2ec4c6;};'use strict';var Sequelize=require(_0x7045('0x0'));module[_0x7045('0x1')]={'name':{'type':Sequelize[_0x7045('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x7045('0x3'),_0x7045('0x4'),_0x7045('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x7045('0x6')]('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0x7045('0x2')],'comment':_0x7045('0x7')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x7045('0x2')],'comment':_0x7045('0x8')},'data4':{'type':Sequelize[_0x7045('0x2')],'comment':_0x7045('0x9')},'data5':{'type':Sequelize[_0x7045('0xa')],'comment':_0x7045('0xb')},'data6':{'type':Sequelize[_0x7045('0xa')],'comment':_0x7045('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':_0x7045('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 7de0ebe..24da60f 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 _0x56ec=['catch','show','params','keys','includeAll','include','options','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','redis','defaults','localhost','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','findAll','service','MicrosoftAzure','decryptString','data3'];(function(_0x36ec07,_0x2349c9){var _0x2d5ae6=function(_0x479886){while(--_0x479886){_0x36ec07['push'](_0x36ec07['shift']());}};_0x2d5ae6(++_0x2349c9);}(_0x56ec,0x8c));var _0xc56e=function(_0x55db4b,_0x51c376){_0x55db4b=_0x55db4b-0x0;var _0xcc8a3a=_0x56ec[_0x55db4b];return _0xcc8a3a;};'use strict';var _=require(_0xc56e('0x0'));var Redis=require(_0xc56e('0x1'));var qs=require(_0xc56e('0x2'));var encryptor=require(_0xc56e('0x3'));var config=require(_0xc56e('0x4'));var logger=require(_0xc56e('0x5'))(_0xc56e('0x6'));var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config[_0xc56e('0x7')]=_[_0xc56e('0x8')](config['redis'],{'host':_0xc56e('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0xc56e('0x7')]);function respondWithStatusCode(_0x314c4e,_0x410ce9){_0x410ce9=_0x410ce9||0xcc;return function(_0x425b75){if(_0x425b75){return _0x314c4e[_0xc56e('0xa')](_0x410ce9);}return _0x314c4e[_0xc56e('0xb')](_0x410ce9)['end']();};}function respondWithResult(_0xb07f4e,_0x5bb054){_0x5bb054=_0x5bb054||0xc8;return function(_0x30d438){if(_0x30d438){return _0xb07f4e[_0xc56e('0xb')](_0x5bb054)[_0xc56e('0xc')](_0x30d438);}};}function respondWithFilteredResult(_0x36e278,_0x4a6280){return function(_0x17dd4c){if(_0x17dd4c){var _0x44db1b=typeof _0x4a6280[_0xc56e('0xd')]===_0xc56e('0xe')&&typeof _0x4a6280[_0xc56e('0xf')]===_0xc56e('0xe');var _0x1213cd=_0x17dd4c[_0xc56e('0x10')];var _0x1a496a=_0x44db1b?0x0:_0x4a6280['offset'];var _0x4eaed7=_0x44db1b?_0x17dd4c[_0xc56e('0x10')]:_0x4a6280[_0xc56e('0xd')]+_0x4a6280[_0xc56e('0xf')];var _0x47c9c9;if(_0x4eaed7>=_0x1213cd){_0x4eaed7=_0x1213cd;_0x47c9c9=0xc8;}else{_0x47c9c9=0xce;}_0x36e278[_0xc56e('0xb')](_0x47c9c9);return _0x36e278[_0xc56e('0x11')](_0xc56e('0x12'),_0x1a496a+'-'+_0x4eaed7+'/'+_0x1213cd)['json'](_0x17dd4c);}return null;};}function saveUpdates(_0x2dd078){return function(_0x380270){if(_0x380270){return _0x380270[_0xc56e('0x13')](_0x2dd078)[_0xc56e('0x14')](function(_0x2ff306){return _0x2ff306;});}return null;};}function removeEntity(_0x2dd193){return function(_0x55970c){if(_0x55970c){return _0x55970c[_0xc56e('0x15')]()['then'](function(){_0x2dd193[_0xc56e('0xb')](0xcc)[_0xc56e('0x16')]();});}};}function handleEntityNotFound(_0x18add9){return function(_0x54a539){if(!_0x54a539){_0x18add9['sendStatus'](0x194);}return _0x54a539;};}function handleError(_0xd35a95,_0x20ca54){_0x20ca54=_0x20ca54||0x1f4;return function(_0x230a5a){logger[_0xc56e('0x17')](_0x230a5a['stack']);if(_0x230a5a[_0xc56e('0x18')]){delete _0x230a5a['name'];}_0xd35a95['status'](_0x20ca54)[_0xc56e('0x19')](_0x230a5a);};}function maskClientSecret(_0x3f58a7){return _[_0xc56e('0x1a')](_0x3f58a7[_0xc56e('0x1b')](0x0,0x3),0x14,'*');}exports[_0xc56e('0x1c')]=function(_0xff13e6,_0x488ab9){var _0x3dda2d={},_0x2e3d98={},_0x47d6ec={'count':0x0,'rows':[]};var _0x4aab7c=_[_0xc56e('0x1d')](db[_0xc56e('0x1e')][_0xc56e('0x1f')],function(_0xf7bb40){return{'name':_0xf7bb40[_0xc56e('0x20')],'type':_0xf7bb40[_0xc56e('0x21')][_0xc56e('0x22')]};});_0x2e3d98[_0xc56e('0x23')]=_['map'](_0x4aab7c,_0xc56e('0x18'));_0x2e3d98[_0xc56e('0x24')]=_['keys'](_0xff13e6[_0xc56e('0x24')]);_0x2e3d98['filters']=_['intersection'](_0x2e3d98['model'],_0x2e3d98[_0xc56e('0x24')]);_0x3dda2d[_0xc56e('0x25')]=_[_0xc56e('0x26')](_0x2e3d98[_0xc56e('0x23')],qs[_0xc56e('0x27')](_0xff13e6[_0xc56e('0x24')][_0xc56e('0x27')]));_0x3dda2d[_0xc56e('0x25')]=_0x3dda2d[_0xc56e('0x25')][_0xc56e('0x28')]?_0x3dda2d[_0xc56e('0x25')]:_0x2e3d98[_0xc56e('0x23')];if(!_0xff13e6[_0xc56e('0x24')]['hasOwnProperty'](_0xc56e('0x29'))){_0x3dda2d['limit']=qs[_0xc56e('0xf')](_0xff13e6[_0xc56e('0x24')]['limit']);_0x3dda2d[_0xc56e('0xd')]=qs[_0xc56e('0xd')](_0xff13e6[_0xc56e('0x24')][_0xc56e('0xd')]);}_0x3dda2d[_0xc56e('0x2a')]=qs[_0xc56e('0x2b')](_0xff13e6['query'][_0xc56e('0x2b')]);_0x3dda2d[_0xc56e('0x2c')]=qs[_0xc56e('0x2d')](_[_0xc56e('0x2e')](_0xff13e6[_0xc56e('0x24')],_0x2e3d98['filters']),_0x4aab7c);if(_0xff13e6['query'][_0xc56e('0x2f')]){_0x3dda2d[_0xc56e('0x2c')]=_[_0xc56e('0x30')](_0x3dda2d[_0xc56e('0x2c')],{'$or':_[_0xc56e('0x1d')](_0x4aab7c,function(_0x35a175){if(_0x35a175['type']!=='VIRTUAL'){var _0x1542e3={};_0x1542e3[_0x35a175[_0xc56e('0x18')]]={'$like':'%'+_0xff13e6[_0xc56e('0x24')][_0xc56e('0x2f')]+'%'};return _0x1542e3;}})});}_0x3dda2d=_[_0xc56e('0x30')]({},_0x3dda2d,_0xff13e6['options']);var _0x5b0c03={'where':_0x3dda2d[_0xc56e('0x2c')]};return db[_0xc56e('0x1e')]['count'](_0x5b0c03)[_0xc56e('0x14')](function(_0x4099d7){_0x47d6ec[_0xc56e('0x10')]=_0x4099d7;if(_0xff13e6['query']['includeAll']){_0x3dda2d['include']=[{'all':!![]}];}return db[_0xc56e('0x1e')][_0xc56e('0x31')](_0x3dda2d);})[_0xc56e('0x14')](function(_0x557fe3){_0x47d6ec['rows']=_[_0xc56e('0x1d')](_0x557fe3,function(_0x58e025){if(_0x58e025[_0xc56e('0x32')]===_0xc56e('0x33')){var _0x50dd4c=encryptor[_0xc56e('0x34')](_0x58e025[_0xc56e('0x35')]);_0x58e025[_0xc56e('0x35')]=maskClientSecret(_0x50dd4c);}return _0x58e025;});return _0x47d6ec;})['then'](respondWithFilteredResult(_0x488ab9,_0x3dda2d))[_0xc56e('0x36')](handleError(_0x488ab9,null));};exports[_0xc56e('0x37')]=function(_0x37b06f,_0x5e45f5){var _0x285f06={'raw':!![],'where':{'id':_0x37b06f[_0xc56e('0x38')]['id']}},_0x518bf5={};_0x518bf5[_0xc56e('0x23')]=_[_0xc56e('0x39')](db[_0xc56e('0x1e')][_0xc56e('0x1f')]);_0x518bf5[_0xc56e('0x24')]=_[_0xc56e('0x39')](_0x37b06f[_0xc56e('0x24')]);_0x518bf5[_0xc56e('0x2d')]=_[_0xc56e('0x26')](_0x518bf5[_0xc56e('0x23')],_0x518bf5[_0xc56e('0x24')]);_0x285f06[_0xc56e('0x25')]=_[_0xc56e('0x26')](_0x518bf5['model'],qs[_0xc56e('0x27')](_0x37b06f[_0xc56e('0x24')][_0xc56e('0x27')]));_0x285f06[_0xc56e('0x25')]=_0x285f06['attributes'][_0xc56e('0x28')]?_0x285f06[_0xc56e('0x25')]:_0x518bf5[_0xc56e('0x23')];if(_0x37b06f[_0xc56e('0x24')][_0xc56e('0x3a')]){_0x285f06[_0xc56e('0x3b')]=[{'all':!![]}];}_0x285f06=_[_0xc56e('0x30')]({},_0x285f06,_0x37b06f[_0xc56e('0x3c')]);return db['CloudProvider']['find'](_0x285f06)['then'](handleEntityNotFound(_0x5e45f5,null))[_0xc56e('0x14')](function(_0x5c9911){if(_0x5c9911[_0xc56e('0x32')]==='MicrosoftAzure'){var _0x2a992c=encryptor[_0xc56e('0x34')](_0x5c9911[_0xc56e('0x35')]);_0x5c9911[_0xc56e('0x35')]=maskClientSecret(_0x2a992c);}return _0x5c9911;})[_0xc56e('0x14')](respondWithResult(_0x5e45f5,null))[_0xc56e('0x36')](handleError(_0x5e45f5,null));};exports[_0xc56e('0x3d')]=function(_0x59c3cb,_0x332027){if(!_0x59c3cb[_0xc56e('0x3e')][_0xc56e('0x18')])throw new Error(_0xc56e('0x3f'));if(!_0x59c3cb[_0xc56e('0x3e')]['service'])throw new Error(_0xc56e('0x40'));var _0xa720d9=db[_0xc56e('0x1e')][_0xc56e('0x1f')]['service']['values'];if(!_0xa720d9[_0xc56e('0x41')](_0x59c3cb['body']['service']))throw new Error(_0xc56e('0x42')+_0xa720d9[_0xc56e('0x43')](',\x20'));if(_0x59c3cb['body'][_0xc56e('0x32')]===_0xc56e('0x33')&&_0x59c3cb[_0xc56e('0x3e')][_0xc56e('0x35')]){_0x59c3cb['body']['data3']=encryptor[_0xc56e('0x44')](_0x59c3cb['body'][_0xc56e('0x35')]);}return db[_0xc56e('0x1e')][_0xc56e('0x3d')](_0x59c3cb[_0xc56e('0x3e')],{})[_0xc56e('0x14')](respondWithResult(_0x332027,0xc9))[_0xc56e('0x36')](handleError(_0x332027,null));};exports[_0xc56e('0x13')]=function(_0x2665fc,_0x47c337){if(_0x2665fc['body']['id']){delete _0x2665fc[_0xc56e('0x3e')]['id'];}return db[_0xc56e('0x1e')]['find']({'where':{'id':_0x2665fc[_0xc56e('0x38')]['id']}})['then'](handleEntityNotFound(_0x47c337,null))[_0xc56e('0x14')](function(_0x1a0f15){if(_0x1a0f15[_0xc56e('0x32')]==='MicrosoftAzure'&&_0x2665fc[_0xc56e('0x3e')][_0xc56e('0x35')]){_0x2665fc['body'][_0xc56e('0x35')]=encryptor['encryptString'](_0x2665fc[_0xc56e('0x3e')]['data3']);}return _0x1a0f15;})[_0xc56e('0x14')](saveUpdates(_0x2665fc[_0xc56e('0x3e')],null))[_0xc56e('0x14')](respondWithResult(_0x47c337,null))[_0xc56e('0x36')](handleError(_0x47c337,null));};exports[_0xc56e('0x15')]=function(_0x2834e2,_0x1bd738){return db[_0xc56e('0x1e')][_0xc56e('0x45')]({'where':{'id':_0x2834e2[_0xc56e('0x38')]['id']}})[_0xc56e('0x14')](handleEntityNotFound(_0x1bd738,null))[_0xc56e('0x14')](removeEntity(_0x1bd738,null))[_0xc56e('0x36')](handleError(_0x1bd738,null));};exports['oauth2MicrosoftAuthorize']=function(_0x2f7c42,_0x448645){return db[_0xc56e('0x1e')][_0xc56e('0x46')]({'where':{'id':_0x2f7c42[_0xc56e('0x38')]['id']},'raw':!![]})[_0xc56e('0x14')](function(_0x3703a2){if(!_0x3703a2)return _0x448645['sendStatus'](0x194);return{'url':oauth[_0xc56e('0x47')](_0x3703a2,_0x2f7c42[_0xc56e('0x48')]['id'])};})[_0xc56e('0x14')](respondWithResult(_0x448645,null))['catch'](handleError(_0x448645,null));};exports[_0xc56e('0x49')]=function(_0x154bd2,_0x2592e2){var _0x299810=_0x154bd2['body'];var _0x488296;var _0x2119ad;if(_0x299810['error'])throw _0x299810;redis[_0xc56e('0x4a')](_0x299810[_0xc56e('0x4b')])[_0xc56e('0x14')](function(_0x28287f){if(!_0x28287f)throw new Error(_0xc56e('0x4c'));_0x488296=JSON[_0xc56e('0x4d')](_0x28287f);var _0x3fd30d=Buffer[_0xc56e('0x4e')](_0x299810[_0xc56e('0x4b')],'base64')[_0xc56e('0x4f')](_0xc56e('0x50'));_0x2119ad=JSON[_0xc56e('0x4d')](_0x3fd30d);if(!oauth[_0xc56e('0x51')](_0x299810[_0xc56e('0x52')],_0x488296[_0xc56e('0x53')]))throw new Error(_0xc56e('0x54'));redis['del'](_0x299810[_0xc56e('0x4b')]);return oauth[_0xc56e('0x55')](_0x299810[_0xc56e('0x56')],_0x488296);})['then'](function(_0x3e1624){_0x488296[_0xc56e('0x57')]=_0x3e1624['access_token'];_0x488296[_0xc56e('0x58')]=_0x3e1624[_0xc56e('0x59')];return db['CloudProvider']['update']({'data5':_0x488296[_0xc56e('0x57')],'data6':_0x488296[_0xc56e('0x58')]},{'where':{'id':_0x488296['id']}});})[_0xc56e('0x14')](function(){oauth[_0xc56e('0x5a')](_0x488296);socket[_0xc56e('0x5b')](_0xc56e('0x5c'),{'id':_0x2119ad['id']});return;})[_0xc56e('0x14')](respondWithStatusCode(_0x2592e2,null))['catch'](function(_0x5bcda7){if(_0x2119ad){socket[_0xc56e('0x5b')]('microsoftAuthorization:error',{'id':_0x2119ad['id']});}if(!_0x488296){logger[_0xc56e('0x17')](_0xc56e('0x5d'),_0x5bcda7);return _0x2592e2['status'](0x1f4)[_0xc56e('0x19')](_0x5bcda7[_0xc56e('0x5e')]);}logger[_0xc56e('0x17')](_0xc56e('0x5f'),_0x488296['id'],JSON[_0xc56e('0x60')](_0x5bcda7));});}; \ No newline at end of file +var _0xfb06=['model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','include','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','params','keys','length','includeAll','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','parse','from','base64','ascii','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','sendStatus','status','end','json','offset','undefined','limit','set','update','then','destroy','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key'];(function(_0x40ce4f,_0x3cf557){var _0xb9b23d=function(_0x1a5d17){while(--_0x1a5d17){_0x40ce4f['push'](_0x40ce4f['shift']());}};_0xb9b23d(++_0x3cf557);}(_0xfb06,0x1c3));var _0x6fb0=function(_0x2649e2,_0x3e73be){_0x2649e2=_0x2649e2-0x0;var _0x4797d4=_0xfb06[_0x2649e2];return _0x4797d4;};'use strict';var _=require('lodash');var Redis=require(_0x6fb0('0x0'));var qs=require(_0x6fb0('0x1'));var encryptor=require(_0x6fb0('0x2'));var config=require(_0x6fb0('0x3'));var logger=require('../../config/logger')(_0x6fb0('0x4'));var db=require(_0x6fb0('0x5'))['db'];var oauth=require(_0x6fb0('0x6'));config['redis']=_[_0x6fb0('0x7')](config[_0x6fb0('0x8')],{'host':_0x6fb0('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0x6fb0('0x8')]);function respondWithStatusCode(_0x4d674e,_0x41f98c){_0x41f98c=_0x41f98c||0xcc;return function(_0x584ad7){if(_0x584ad7){return _0x4d674e[_0x6fb0('0xa')](_0x41f98c);}return _0x4d674e[_0x6fb0('0xb')](_0x41f98c)[_0x6fb0('0xc')]();};}function respondWithResult(_0x57d227,_0x2587d6){_0x2587d6=_0x2587d6||0xc8;return function(_0x12b0ac){if(_0x12b0ac){return _0x57d227[_0x6fb0('0xb')](_0x2587d6)[_0x6fb0('0xd')](_0x12b0ac);}};}function respondWithFilteredResult(_0x55c3c3,_0x2cfce6){return function(_0x5a5113){if(_0x5a5113){var _0x307f7a=typeof _0x2cfce6[_0x6fb0('0xe')]===_0x6fb0('0xf')&&typeof _0x2cfce6[_0x6fb0('0x10')]===_0x6fb0('0xf');var _0x4998a5=_0x5a5113['count'];var _0x4a2305=_0x307f7a?0x0:_0x2cfce6[_0x6fb0('0xe')];var _0x3440dc=_0x307f7a?_0x5a5113['count']:_0x2cfce6['offset']+_0x2cfce6[_0x6fb0('0x10')];var _0x1a0e1a;if(_0x3440dc>=_0x4998a5){_0x3440dc=_0x4998a5;_0x1a0e1a=0xc8;}else{_0x1a0e1a=0xce;}_0x55c3c3[_0x6fb0('0xb')](_0x1a0e1a);return _0x55c3c3[_0x6fb0('0x11')]('Content-Range',_0x4a2305+'-'+_0x3440dc+'/'+_0x4998a5)[_0x6fb0('0xd')](_0x5a5113);}return null;};}function saveUpdates(_0x57fd4){return function(_0x176e62){if(_0x176e62){return _0x176e62[_0x6fb0('0x12')](_0x57fd4)[_0x6fb0('0x13')](function(_0xe36d30){return _0xe36d30;});}return null;};}function removeEntity(_0x341174){return function(_0x1a76f9){if(_0x1a76f9){return _0x1a76f9[_0x6fb0('0x14')]()[_0x6fb0('0x13')](function(){_0x341174[_0x6fb0('0xb')](0xcc)[_0x6fb0('0xc')]();});}};}function handleEntityNotFound(_0x261096){return function(_0x5dda04){if(!_0x5dda04){_0x261096[_0x6fb0('0xa')](0x194);}return _0x5dda04;};}function handleError(_0x2807a8,_0xb93d4f){_0xb93d4f=_0xb93d4f||0x1f4;return function(_0xaf236d){logger[_0x6fb0('0x15')](_0xaf236d[_0x6fb0('0x16')]);if(_0xaf236d[_0x6fb0('0x17')]){delete _0xaf236d[_0x6fb0('0x17')];}_0x2807a8[_0x6fb0('0xb')](_0xb93d4f)[_0x6fb0('0x18')](_0xaf236d);};}function maskClientSecret(_0x12a792){return _[_0x6fb0('0x19')](_0x12a792[_0x6fb0('0x1a')](0x0,0x3),0x14,'*');}exports[_0x6fb0('0x1b')]=function(_0x3890eb,_0x2536c7){var _0x58d939={},_0x211ec2={},_0x59a684={'count':0x0,'rows':[]};var _0x365ca9=_[_0x6fb0('0x1c')](db[_0x6fb0('0x1d')][_0x6fb0('0x1e')],function(_0x7ae3b2){return{'name':_0x7ae3b2[_0x6fb0('0x1f')],'type':_0x7ae3b2[_0x6fb0('0x20')][_0x6fb0('0x21')]};});_0x211ec2[_0x6fb0('0x22')]=_[_0x6fb0('0x1c')](_0x365ca9,'name');_0x211ec2['query']=_['keys'](_0x3890eb[_0x6fb0('0x23')]);_0x211ec2[_0x6fb0('0x24')]=_[_0x6fb0('0x25')](_0x211ec2[_0x6fb0('0x22')],_0x211ec2['query']);_0x58d939['attributes']=_[_0x6fb0('0x25')](_0x211ec2[_0x6fb0('0x22')],qs[_0x6fb0('0x26')](_0x3890eb[_0x6fb0('0x23')][_0x6fb0('0x26')]));_0x58d939[_0x6fb0('0x27')]=_0x58d939[_0x6fb0('0x27')]['length']?_0x58d939[_0x6fb0('0x27')]:_0x211ec2[_0x6fb0('0x22')];if(!_0x3890eb[_0x6fb0('0x23')][_0x6fb0('0x28')](_0x6fb0('0x29'))){_0x58d939[_0x6fb0('0x10')]=qs[_0x6fb0('0x10')](_0x3890eb[_0x6fb0('0x23')]['limit']);_0x58d939[_0x6fb0('0xe')]=qs['offset'](_0x3890eb[_0x6fb0('0x23')][_0x6fb0('0xe')]);}_0x58d939[_0x6fb0('0x2a')]=qs[_0x6fb0('0x2b')](_0x3890eb[_0x6fb0('0x23')][_0x6fb0('0x2b')]);_0x58d939[_0x6fb0('0x2c')]=qs[_0x6fb0('0x24')](_[_0x6fb0('0x2d')](_0x3890eb[_0x6fb0('0x23')],_0x211ec2['filters']),_0x365ca9);if(_0x3890eb[_0x6fb0('0x23')]['filter']){_0x58d939[_0x6fb0('0x2c')]=_[_0x6fb0('0x2e')](_0x58d939[_0x6fb0('0x2c')],{'$or':_[_0x6fb0('0x1c')](_0x365ca9,function(_0x46c392){if(_0x46c392[_0x6fb0('0x20')]!==_0x6fb0('0x2f')){var _0x44a122={};_0x44a122[_0x46c392[_0x6fb0('0x17')]]={'$like':'%'+_0x3890eb[_0x6fb0('0x23')][_0x6fb0('0x30')]+'%'};return _0x44a122;}})});}_0x58d939=_[_0x6fb0('0x2e')]({},_0x58d939,_0x3890eb[_0x6fb0('0x31')]);var _0x32701d={'where':_0x58d939['where']};return db[_0x6fb0('0x1d')][_0x6fb0('0x32')](_0x32701d)[_0x6fb0('0x13')](function(_0xaf1f7a){_0x59a684[_0x6fb0('0x32')]=_0xaf1f7a;if(_0x3890eb[_0x6fb0('0x23')]['includeAll']){_0x58d939[_0x6fb0('0x33')]=[{'all':!![]}];}return db[_0x6fb0('0x1d')][_0x6fb0('0x34')](_0x58d939);})[_0x6fb0('0x13')](function(_0x47fc3b){_0x59a684['rows']=_[_0x6fb0('0x1c')](_0x47fc3b,function(_0x132851){if(_0x132851[_0x6fb0('0x35')]===_0x6fb0('0x36')){var _0x7c112f=encryptor[_0x6fb0('0x37')](_0x132851[_0x6fb0('0x38')]);_0x132851['data3']=maskClientSecret(_0x7c112f);}return _0x132851;});return _0x59a684;})[_0x6fb0('0x13')](respondWithFilteredResult(_0x2536c7,_0x58d939))[_0x6fb0('0x39')](handleError(_0x2536c7,null));};exports[_0x6fb0('0x3a')]=function(_0x23a3de,_0x430bad){var _0x92e3b6={'raw':!![],'where':{'id':_0x23a3de[_0x6fb0('0x3b')]['id']}},_0x45c562={};_0x45c562['model']=_[_0x6fb0('0x3c')](db[_0x6fb0('0x1d')][_0x6fb0('0x1e')]);_0x45c562[_0x6fb0('0x23')]=_['keys'](_0x23a3de[_0x6fb0('0x23')]);_0x45c562[_0x6fb0('0x24')]=_[_0x6fb0('0x25')](_0x45c562[_0x6fb0('0x22')],_0x45c562[_0x6fb0('0x23')]);_0x92e3b6[_0x6fb0('0x27')]=_[_0x6fb0('0x25')](_0x45c562[_0x6fb0('0x22')],qs[_0x6fb0('0x26')](_0x23a3de[_0x6fb0('0x23')][_0x6fb0('0x26')]));_0x92e3b6[_0x6fb0('0x27')]=_0x92e3b6['attributes'][_0x6fb0('0x3d')]?_0x92e3b6['attributes']:_0x45c562[_0x6fb0('0x22')];if(_0x23a3de[_0x6fb0('0x23')][_0x6fb0('0x3e')]){_0x92e3b6[_0x6fb0('0x33')]=[{'all':!![]}];}_0x92e3b6=_[_0x6fb0('0x2e')]({},_0x92e3b6,_0x23a3de[_0x6fb0('0x31')]);return db[_0x6fb0('0x1d')][_0x6fb0('0x3f')](_0x92e3b6)[_0x6fb0('0x13')](handleEntityNotFound(_0x430bad,null))[_0x6fb0('0x13')](function(_0x5e6366){if(_0x5e6366[_0x6fb0('0x35')]===_0x6fb0('0x36')){var _0x4ed9ad=encryptor[_0x6fb0('0x37')](_0x5e6366[_0x6fb0('0x38')]);_0x5e6366['data3']=maskClientSecret(_0x4ed9ad);}return _0x5e6366;})[_0x6fb0('0x13')](respondWithResult(_0x430bad,null))['catch'](handleError(_0x430bad,null));};exports[_0x6fb0('0x40')]=function(_0x17267e,_0x540738){if(!_0x17267e[_0x6fb0('0x41')][_0x6fb0('0x17')])throw new Error(_0x6fb0('0x42'));if(!_0x17267e[_0x6fb0('0x41')][_0x6fb0('0x35')])throw new Error(_0x6fb0('0x43'));var _0x522dc8=db[_0x6fb0('0x1d')][_0x6fb0('0x1e')][_0x6fb0('0x35')][_0x6fb0('0x44')];if(!_0x522dc8[_0x6fb0('0x45')](_0x17267e[_0x6fb0('0x41')][_0x6fb0('0x35')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x522dc8[_0x6fb0('0x46')](',\x20'));if(_0x17267e[_0x6fb0('0x41')][_0x6fb0('0x35')]==='MicrosoftAzure'&&_0x17267e[_0x6fb0('0x41')][_0x6fb0('0x38')]){_0x17267e[_0x6fb0('0x41')][_0x6fb0('0x38')]=encryptor[_0x6fb0('0x47')](_0x17267e[_0x6fb0('0x41')]['data3']);}return db['CloudProvider']['create'](_0x17267e[_0x6fb0('0x41')],{})[_0x6fb0('0x13')](respondWithResult(_0x540738,0xc9))[_0x6fb0('0x39')](handleError(_0x540738,null));};exports[_0x6fb0('0x12')]=function(_0x1f0501,_0x1869ae){if(_0x1f0501[_0x6fb0('0x41')]['id']){delete _0x1f0501[_0x6fb0('0x41')]['id'];}return db[_0x6fb0('0x1d')]['find']({'where':{'id':_0x1f0501[_0x6fb0('0x3b')]['id']}})[_0x6fb0('0x13')](handleEntityNotFound(_0x1869ae,null))['then'](function(_0x473697){if(_0x473697[_0x6fb0('0x35')]==='MicrosoftAzure'&&_0x1f0501[_0x6fb0('0x41')]['data3']){_0x1f0501['body'][_0x6fb0('0x38')]=encryptor[_0x6fb0('0x47')](_0x1f0501['body'][_0x6fb0('0x38')]);}return _0x473697;})[_0x6fb0('0x13')](saveUpdates(_0x1f0501[_0x6fb0('0x41')],null))['then'](respondWithResult(_0x1869ae,null))[_0x6fb0('0x39')](handleError(_0x1869ae,null));};exports[_0x6fb0('0x14')]=function(_0x5af706,_0x1fa972){return db[_0x6fb0('0x1d')][_0x6fb0('0x3f')]({'where':{'id':_0x5af706['params']['id']}})['then'](handleEntityNotFound(_0x1fa972,null))['then'](removeEntity(_0x1fa972,null))[_0x6fb0('0x39')](handleError(_0x1fa972,null));};exports[_0x6fb0('0x48')]=function(_0x3e5d64,_0x164606){return db['CloudProvider'][_0x6fb0('0x49')]({'where':{'id':_0x3e5d64[_0x6fb0('0x3b')]['id']},'raw':!![]})[_0x6fb0('0x13')](function(_0x50f427){if(!_0x50f427)return _0x164606[_0x6fb0('0xa')](0x194);return{'url':oauth[_0x6fb0('0x4a')](_0x50f427,_0x3e5d64[_0x6fb0('0x4b')]['id'])};})[_0x6fb0('0x13')](respondWithResult(_0x164606,null))[_0x6fb0('0x39')](handleError(_0x164606,null));};exports['oauth2MicrosoftCallback']=function(_0x2bc6c9,_0x562fe7){var _0x1f0982=_0x2bc6c9[_0x6fb0('0x41')];var _0x263885;var _0xa6975d;if(_0x1f0982[_0x6fb0('0x15')])throw _0x1f0982;redis[_0x6fb0('0x4c')](_0x1f0982[_0x6fb0('0x4d')])[_0x6fb0('0x13')](function(_0x3dd3ad){if(!_0x3dd3ad)throw new Error(_0x6fb0('0x4e'));_0x263885=JSON[_0x6fb0('0x4f')](_0x3dd3ad);var _0x34fe54=Buffer[_0x6fb0('0x50')](_0x1f0982[_0x6fb0('0x4d')],_0x6fb0('0x51'))['toString'](_0x6fb0('0x52'));_0xa6975d=JSON[_0x6fb0('0x4f')](_0x34fe54);if(!oauth['isValidIdToken'](_0x1f0982['id_token'],_0x263885[_0x6fb0('0x53')]))throw new Error(_0x6fb0('0x54'));redis[_0x6fb0('0x55')](_0x1f0982[_0x6fb0('0x4d')]);return oauth[_0x6fb0('0x56')](_0x1f0982['code'],_0x263885);})[_0x6fb0('0x13')](function(_0x14ef23){_0x263885[_0x6fb0('0x57')]=_0x14ef23[_0x6fb0('0x58')];_0x263885[_0x6fb0('0x59')]=_0x14ef23[_0x6fb0('0x5a')];return db['CloudProvider']['update']({'data5':_0x263885[_0x6fb0('0x57')],'data6':_0x263885[_0x6fb0('0x59')]},{'where':{'id':_0x263885['id']}});})[_0x6fb0('0x13')](function(){oauth[_0x6fb0('0x5b')](_0x263885);socket[_0x6fb0('0x5c')]('microsoftAuthorization:success',{'id':_0xa6975d['id']});return;})[_0x6fb0('0x13')](respondWithStatusCode(_0x562fe7,null))['catch'](function(_0x51f844){if(_0xa6975d){socket[_0x6fb0('0x5c')](_0x6fb0('0x5d'),{'id':_0xa6975d['id']});}if(!_0x263885){logger['error'](_0x6fb0('0x5e'),_0x51f844);return _0x562fe7[_0x6fb0('0xb')](0x1f4)[_0x6fb0('0x18')](_0x51f844[_0x6fb0('0x5f')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x263885['id'],JSON[_0x6fb0('0x60')](_0x51f844));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index e770bf7..89611d2 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 _0xc1bd=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CloudProvider','cloud_providers','util','../../config/logger','moment'];(function(_0x223c0d,_0x3ec04d){var _0x207827=function(_0x39d240){while(--_0x39d240){_0x223c0d['push'](_0x223c0d['shift']());}};_0x207827(++_0x3ec04d);}(_0xc1bd,0x1d1));var _0xdc1b=function(_0x4f5659,_0x2e4ec0){_0x4f5659=_0x4f5659-0x0;var _0x3d8556=_0xc1bd[_0x4f5659];return _0x3d8556;};'use strict';var _=require('lodash');var util=require(_0xdc1b('0x0'));var logger=require(_0xdc1b('0x1'))('api');var moment=require(_0xdc1b('0x2'));var BPromise=require(_0xdc1b('0x3'));var rp=require(_0xdc1b('0x4'));var fs=require('fs');var path=require(_0xdc1b('0x5'));var rimraf=require(_0xdc1b('0x6'));var config=require(_0xdc1b('0x7'));var attributes=require('./cloudProvider.attributes');module[_0xdc1b('0x8')]=function(_0x1b51bb,_0x5c33cb){return _0x1b51bb[_0xdc1b('0x9')](_0xdc1b('0xa'),attributes,{'tableName':_0xdc1b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06f0=['exports','define','CloudProvider','cloud_providers','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes'];(function(_0x16f8c6,_0x351149){var _0x1dcd00=function(_0xf763fb){while(--_0xf763fb){_0x16f8c6['push'](_0x16f8c6['shift']());}};_0x1dcd00(++_0x351149);}(_0x06f0,0x164));var _0x006f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x06f0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x006f('0x0'))(_0x006f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x006f('0x2'));var fs=require('fs');var path=require(_0x006f('0x3'));var rimraf=require(_0x006f('0x4'));var config=require(_0x006f('0x5'));var attributes=require(_0x006f('0x6'));module[_0x006f('0x7')]=function(_0x6ce500,_0x1c4123){return _0x6ce500[_0x006f('0x8')](_0x006f('0x9'),attributes,{'tableName':_0x006f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 5ecb0ba..4258acc 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 _0x4678=['login','map','key','value','oauth2Claims','replace','oauth2/','set','decode','payload','audience','isAfter','unix','exp','resolve','then','CloudProvider','findOne','refresh_token','POST','data5','update','data6','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data3','{TENANT_ID}','intervals','bind','findAll','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','../../components/encryptor','../../config/logger','api','defaults','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','type','Dynamics365','push','join','/.default','data2','stringify','toString','hex','client_id','data1','redirect_uri','data4','form_post','scope','state','nonce','prompt'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x4678,0xb7));var _0x8467=function(_0x1e9cdc,_0xe2a0f6){_0x1e9cdc=_0x1e9cdc-0x0;var _0x376fb9=_0x4678[_0x1e9cdc];return _0x376fb9;};'use strict';var _=require(_0x8467('0x0'));var crypto=require(_0x8467('0x1'));var jwt=require(_0x8467('0x2'));var moment=require(_0x8467('0x3'));var Redis=require(_0x8467('0x4'));var rp=require(_0x8467('0x5'));var util=require('util');var encryptor=require(_0x8467('0x6'));var config=require('../../config/environment');var logger=require(_0x8467('0x7'))(_0x8467('0x8'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config['redis']=_[_0x8467('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x8467('0xa')]);var MICROSOFT_AUTH_URL=_0x8467('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0x8467('0xc'),_0x8467('0xd'),_0x8467('0xe'),'offline_access',_0x8467('0xf'),_0x8467('0x10'),_0x8467('0x11')],'Dynamics365':[_0x8467('0xc'),_0x8467('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0x8467('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x8467('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x197512){var _0xb71093=_['map'](AZURE_AUTH_SCOPES[_0x197512[_0x8467('0x15')]]);if(_0x197512[_0x8467('0x15')]===_0x8467('0x16'))_0xb71093[_0x8467('0x17')](_0x197512['data7']+'/.default');return _0xb71093[_0x8467('0x18')]('\x20');}function getAccessTokenScope(_0xdf5d2e){if(_0xdf5d2e[_0x8467('0x15')]==='Outlook365')return _0x8467('0xf');if(_0xdf5d2e[_0x8467('0x15')]===_0x8467('0x16'))return _0xdf5d2e['data7']+_0x8467('0x19');}function generateMicrosoftAuthorizationUrl(_0x27ce80,_0x5cf416){var _0x25c5c2=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x27ce80[_0x8467('0x1a')]);var _0x1b0bed=['code','id_token'];var _0x19749d=Buffer['from'](JSON[_0x8467('0x1b')]({'id':_0x5cf416}))[_0x8467('0x1c')]('base64');var _0x78b6c5=crypto['randomBytes'](0x10)[_0x8467('0x1c')](_0x8467('0x1d'));var _0x5d8625=getAuthorizationScopes(_0x27ce80);var _0x222389=[{'key':_0x8467('0x1e'),'value':_0x27ce80[_0x8467('0x1f')]},{'key':'response_type','value':encodeURIComponent(_0x1b0bed['join']('\x20'))},{'key':_0x8467('0x20'),'value':_0x27ce80[_0x8467('0x21')]},{'key':'response_mode','value':_0x8467('0x22')},{'key':_0x8467('0x23'),'value':encodeURIComponent(_0x5d8625)},{'key':_0x8467('0x24'),'value':_0x19749d},{'key':_0x8467('0x25'),'value':_0x78b6c5},{'key':_0x8467('0x26'),'value':_0x8467('0x27')}];var _0x4ad2d6=_0x25c5c2+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x8467('0x28')](_0x222389,function(_0x193c7d){return _0x193c7d[_0x8467('0x29')]+'='+_0x193c7d[_0x8467('0x2a')];})[_0x8467('0x18')]('&');_0x27ce80[_0x8467('0x2b')]={'issuer':_0x25c5c2[_0x8467('0x2c')](_0x8467('0x2d'),''),'audience':_0x27ce80[_0x8467('0x1f')],'state':_0x19749d,'nonce':_0x78b6c5};redis[_0x8467('0x2e')](_0x19749d,JSON[_0x8467('0x1b')](_0x27ce80));return _0x4ad2d6;}function isValidIdToken(_0x3a95c4,_0x3b06a3){try{var _0xdfe23=jwt[_0x8467('0x2f')](_0x3a95c4,{'complete':!![]});var _0x39097d=_0xdfe23[_0x8467('0x30')];if(_0x39097d['iss']!==_0x3b06a3['issuer'])return![];if(_0x39097d['aud']!==_0x3b06a3[_0x8467('0x31')])return![];if(_0x39097d[_0x8467('0x25')]!==_0x3b06a3[_0x8467('0x25')])return![];if(moment()[_0x8467('0x32')](moment[_0x8467('0x33')](_0x39097d[_0x8467('0x34')])))return![];return!![];}catch(_0x5b310e){throw _0x5b310e;}}function refreshOauth2MicrosoftAccessToken(_0x1a3888){return Promise[_0x8467('0x35')]()[_0x8467('0x36')](function(){if(_0x1a3888['data3'])return _0x1a3888;return db[_0x8467('0x37')][_0x8467('0x38')]({'where':{'id':_0x1a3888['id']},'raw':!![]});})[_0x8467('0x36')](function(_0x18d0e3){var _0x50d783={'grant_type':_0x8467('0x39'),'refresh_token':_0x18d0e3['data6'],'scope':getAccessTokenScope(_0x18d0e3),'redirect_uri':_0x18d0e3['data4'],'client_id':_0x18d0e3[_0x8467('0x1f')],'client_secret':encryptor['decryptString'](_0x18d0e3['data3'])};var _0xef3a9b={'method':_0x8467('0x3a'),'uri':MICROSOFT_AUTH_URL[_0x8467('0x2c')]('{TENANT_ID}',_0x18d0e3[_0x8467('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x50d783,'json':!![]};return rp(_0xef3a9b);})[_0x8467('0x36')](function(_0x5bea0f){_0x1a3888[_0x8467('0x3b')]=_0x5bea0f['access_token'];_0x1a3888['data6']=_0x5bea0f[_0x8467('0x39')];return db[_0x8467('0x37')][_0x8467('0x3c')]({'data5':_0x1a3888[_0x8467('0x3b')],'data6':_0x1a3888[_0x8467('0x3d')]},{'where':{'id':_0x1a3888['id']}});})[_0x8467('0x36')](function(){return _0x1a3888;})['catch'](function(_0x2e650e){logger[_0x8467('0x3e')](_0x8467('0x3f'),_0x1a3888['id'],_0x2e650e);});}function getOauth2MicrosoftAccessToken(_0x1d0400,_0x3add90){var _0x3b3ad3={'grant_type':_0x8467('0x40'),'code':_0x1d0400,'scope':getAccessTokenScope(_0x3add90),'redirect_uri':_0x3add90['data4'],'client_id':_0x3add90[_0x8467('0x1f')],'client_secret':encryptor['decryptString'](_0x3add90[_0x8467('0x41')])};var _0x1ddd33={'method':_0x8467('0x3a'),'uri':MICROSOFT_AUTH_URL[_0x8467('0x2c')](_0x8467('0x42'),_0x3add90[_0x8467('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3b3ad3,'json':!![]};return rp(_0x1ddd33);}function startRefreshInterval(_0x1b32b9){var _0x18b098=schedule[_0x8467('0x43')];if(_0x18b098[_0x1b32b9['id']])clearInterval(_0x18b098[_0x1b32b9['id']]);_0x18b098[_0x1b32b9['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x8467('0x44')](this,{'id':_0x1b32b9['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x8467('0x43')]=_0x18b098;}function startAllRefreshIntervals(){return db[_0x8467('0x37')][_0x8467('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8467('0x36')](function(_0x3c855c){var _0x35c99d=_0x3c855c[_0x8467('0x28')](function(_0x1c2f2d){return refreshOauth2MicrosoftAccessToken(_0x1c2f2d)[_0x8467('0x36')](function(_0x2d4c8b){startRefreshInterval(_0x2d4c8b);});});return Promise['all'](_0x35c99d);})[_0x8467('0x46')](function(_0x37a53a){var _0x5765c3=_0x37a53a?util[_0x8467('0x47')](_0x37a53a,{'showHidden':![],'depth':null}):'';logger[_0x8467('0x3e')](_0x8467('0x48'),_0x5765c3);});}module[_0x8467('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x40da=['bind','findAll','all','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/logger','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','code','id_token','from','stringify','toString','randomBytes','data1','response_type','data4','response_mode','form_post','scope','state','nonce','prompt','login','value','oauth2Claims','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','refresh_token','data6','POST','data2','data5','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals'];(function(_0x4adbb0,_0x5f5a74){var _0x5e235c=function(_0x3e84e7){while(--_0x3e84e7){_0x4adbb0['push'](_0x4adbb0['shift']());}};_0x5e235c(++_0x5f5a74);}(_0x40da,0x1da));var _0xa40d=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x40da[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0xa40d('0x0'));var crypto=require(_0xa40d('0x1'));var jwt=require(_0xa40d('0x2'));var moment=require(_0xa40d('0x3'));var Redis=require(_0xa40d('0x4'));var rp=require(_0xa40d('0x5'));var util=require('util');var encryptor=require(_0xa40d('0x6'));var config=require(_0xa40d('0x7'));var logger=require(_0xa40d('0x8'))('api');var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0xa40d('0x9')]=_[_0xa40d('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xa40d('0x9')]);var MICROSOFT_AUTH_URL=_0xa40d('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xa40d('0xc'),'profile','email',_0xa40d('0xd'),_0xa40d('0xe'),_0xa40d('0xf'),_0xa40d('0x10')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xa40d('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0xa40d('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x18f7e9){var _0x419d6b=_[_0xa40d('0x13')](AZURE_AUTH_SCOPES[_0x18f7e9[_0xa40d('0x14')]]);if(_0x18f7e9[_0xa40d('0x14')]===_0xa40d('0x15'))_0x419d6b[_0xa40d('0x16')](_0x18f7e9[_0xa40d('0x17')]+_0xa40d('0x18'));return _0x419d6b[_0xa40d('0x19')]('\x20');}function getAccessTokenScope(_0x4ac112){if(_0x4ac112[_0xa40d('0x14')]===_0xa40d('0x1a'))return _0xa40d('0xe');if(_0x4ac112[_0xa40d('0x14')]===_0xa40d('0x15'))return _0x4ac112[_0xa40d('0x17')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x28cc20,_0x32a59b){var _0x53e993=MICROSOFT_AUTH_URL[_0xa40d('0x1b')](_0xa40d('0x1c'),_0x28cc20['data2']);var _0x16b5e5=[_0xa40d('0x1d'),_0xa40d('0x1e')];var _0x89de0b=Buffer[_0xa40d('0x1f')](JSON[_0xa40d('0x20')]({'id':_0x32a59b}))[_0xa40d('0x21')]('base64');var _0x50db05=crypto[_0xa40d('0x22')](0x10)['toString']('hex');var _0x5a63dd=getAuthorizationScopes(_0x28cc20);var _0x275460=[{'key':'client_id','value':_0x28cc20[_0xa40d('0x23')]},{'key':_0xa40d('0x24'),'value':encodeURIComponent(_0x16b5e5[_0xa40d('0x19')]('\x20'))},{'key':'redirect_uri','value':_0x28cc20[_0xa40d('0x25')]},{'key':_0xa40d('0x26'),'value':_0xa40d('0x27')},{'key':_0xa40d('0x28'),'value':encodeURIComponent(_0x5a63dd)},{'key':_0xa40d('0x29'),'value':_0x89de0b},{'key':_0xa40d('0x2a'),'value':_0x50db05},{'key':_0xa40d('0x2b'),'value':_0xa40d('0x2c')}];var _0x16bc4f=_0x53e993+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa40d('0x13')](_0x275460,function(_0x511b6d){return _0x511b6d['key']+'='+_0x511b6d[_0xa40d('0x2d')];})['join']('&');_0x28cc20[_0xa40d('0x2e')]={'issuer':_0x53e993['replace']('oauth2/',''),'audience':_0x28cc20[_0xa40d('0x23')],'state':_0x89de0b,'nonce':_0x50db05};redis[_0xa40d('0x2f')](_0x89de0b,JSON[_0xa40d('0x20')](_0x28cc20));return _0x16bc4f;}function isValidIdToken(_0x3ef15f,_0x1a5248){try{var _0x44f4e9=jwt[_0xa40d('0x30')](_0x3ef15f,{'complete':!![]});var _0x4b60e3=_0x44f4e9[_0xa40d('0x31')];if(_0x4b60e3[_0xa40d('0x32')]!==_0x1a5248[_0xa40d('0x33')])return![];if(_0x4b60e3[_0xa40d('0x34')]!==_0x1a5248[_0xa40d('0x35')])return![];if(_0x4b60e3['nonce']!==_0x1a5248[_0xa40d('0x2a')])return![];if(moment()[_0xa40d('0x36')](moment[_0xa40d('0x37')](_0x4b60e3[_0xa40d('0x38')])))return![];return!![];}catch(_0x433a35){throw _0x433a35;}}function refreshOauth2MicrosoftAccessToken(_0x4b7381){return Promise[_0xa40d('0x39')]()[_0xa40d('0x3a')](function(){if(_0x4b7381[_0xa40d('0x3b')])return _0x4b7381;return db[_0xa40d('0x3c')]['findOne']({'where':{'id':_0x4b7381['id']},'raw':!![]});})[_0xa40d('0x3a')](function(_0xa96189){var _0x43eaad={'grant_type':_0xa40d('0x3d'),'refresh_token':_0xa96189[_0xa40d('0x3e')],'scope':getAccessTokenScope(_0xa96189),'redirect_uri':_0xa96189[_0xa40d('0x25')],'client_id':_0xa96189['data1'],'client_secret':encryptor['decryptString'](_0xa96189['data3'])};var _0x4c6aa5={'method':_0xa40d('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0xa40d('0x1c'),_0xa96189[_0xa40d('0x40')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x43eaad,'json':!![]};return rp(_0x4c6aa5);})[_0xa40d('0x3a')](function(_0x14477a){_0x4b7381[_0xa40d('0x41')]=_0x14477a['access_token'];_0x4b7381[_0xa40d('0x3e')]=_0x14477a['refresh_token'];return db[_0xa40d('0x3c')][_0xa40d('0x42')]({'data5':_0x4b7381[_0xa40d('0x41')],'data6':_0x4b7381[_0xa40d('0x3e')]},{'where':{'id':_0x4b7381['id']}});})[_0xa40d('0x3a')](function(){return _0x4b7381;})[_0xa40d('0x43')](function(_0x4e5f6c){logger['error'](_0xa40d('0x44'),_0x4b7381['id'],_0x4e5f6c);});}function getOauth2MicrosoftAccessToken(_0x2a435f,_0x332abb){var _0x1af73d={'grant_type':_0xa40d('0x45'),'code':_0x2a435f,'scope':getAccessTokenScope(_0x332abb),'redirect_uri':_0x332abb[_0xa40d('0x25')],'client_id':_0x332abb['data1'],'client_secret':encryptor[_0xa40d('0x46')](_0x332abb[_0xa40d('0x3b')])};var _0x4bb788={'method':_0xa40d('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0xa40d('0x1c'),_0x332abb[_0xa40d('0x40')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1af73d,'json':!![]};return rp(_0x4bb788);}function startRefreshInterval(_0x622e00){var _0x2d8026=schedule[_0xa40d('0x47')];if(_0x2d8026[_0x622e00['id']])clearInterval(_0x2d8026[_0x622e00['id']]);_0x2d8026[_0x622e00['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa40d('0x48')](this,{'id':_0x622e00['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x2d8026;}function startAllRefreshIntervals(){return db[_0xa40d('0x3c')][_0xa40d('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x1e7ac5){var _0x488fec=_0x1e7ac5[_0xa40d('0x13')](function(_0x3fc45c){return refreshOauth2MicrosoftAccessToken(_0x3fc45c)[_0xa40d('0x3a')](function(_0xc03c2a){startRefreshInterval(_0xc03c2a);});});return Promise[_0xa40d('0x4a')](_0x488fec);})['catch'](function(_0x679c94){var _0x16bc57=_0x679c94?util['inspect'](_0x679c94,{'showHidden':![],'depth':null}):'';logger[_0xa40d('0x4b')](_0xa40d('0x4c'),_0x16bc57);});}module[_0xa40d('0x4d')]={'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 4d07317..1c6f2fb 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 _0x173d=['../../config/environment','client','http','info','request\x20sent','debug','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x173d,0x108));var _0xd173=function(_0xd4f814,_0x2ce95f){_0xd4f814=_0xd4f814-0x0;var _0x3834e2=_0x173d[_0xd4f814];return _0x3834e2;};'use strict';var _=require('lodash');var util=require(_0xd173('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd173('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd173('0x2'))['db'];var utils=require(_0xd173('0x3'));var logger=require(_0xd173('0x4'))(_0xd173('0x5'));var config=require(_0xd173('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd173('0x7')][_0xd173('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x454bfa,_0x5dc244,_0x239a90){return new BPromise(function(_0x5229ad,_0x3a1529){return client['request'](_0x454bfa,_0x239a90)['then'](function(_0x2e5ecc){logger[_0xd173('0x9')]('CloudProvider,\x20%s,\x20%s',_0x5dc244,_0xd173('0xa'));logger[_0xd173('0xb')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5dc244,_0xd173('0xa'),JSON[_0xd173('0xc')](_0x2e5ecc));if(_0x2e5ecc[_0xd173('0xd')]){if(_0x2e5ecc[_0xd173('0xd')][_0xd173('0xe')]===0x1f4){logger[_0xd173('0xd')](_0xd173('0xf'),_0x5dc244,_0x2e5ecc[_0xd173('0xd')][_0xd173('0x10')]);return _0x3a1529(_0x2e5ecc[_0xd173('0xd')][_0xd173('0x10')]);}logger[_0xd173('0xd')]('CloudProvider,\x20%s,\x20%s',_0x5dc244,_0x2e5ecc[_0xd173('0xd')]['message']);return _0x5229ad(_0x2e5ecc[_0xd173('0xd')][_0xd173('0x10')]);}else{logger['info'](_0xd173('0xf'),_0x5dc244,_0xd173('0xa'));_0x5229ad(_0x2e5ecc[_0xd173('0x11')][_0xd173('0x10')]);}})['catch'](function(_0x5b96e1){logger[_0xd173('0xd')](_0xd173('0xf'),_0x5dc244,_0x5b96e1);_0x3a1529(_0x5b96e1);});});} \ No newline at end of file +var _0xb96d=['then','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x483d2a,_0x1873a3){var _0x2284fa=function(_0xadde77){while(--_0xadde77){_0x483d2a['push'](_0x483d2a['shift']());}};_0x2284fa(++_0x1873a3);}(_0xb96d,0x9e));var _0xdb96=function(_0x1b4002,_0x5b4094){_0x1b4002=_0x1b4002-0x0;var _0x1716f3=_0xb96d[_0x1b4002];return _0x1716f3;};'use strict';var _=require('lodash');var util=require(_0xdb96('0x0'));var moment=require(_0xdb96('0x1'));var BPromise=require(_0xdb96('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb96('0x3'));var db=require(_0xdb96('0x4'))['db'];var utils=require(_0xdb96('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xdb96('0x6'));var jayson=require(_0xdb96('0x7'));var client=jayson[_0xdb96('0x8')][_0xdb96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f5e6f,_0x294084,_0x571e0e){return new BPromise(function(_0x5e2e95,_0x3384b4){return client['request'](_0x4f5e6f,_0x571e0e)[_0xdb96('0xa')](function(_0xaea492){logger['info'](_0xdb96('0xb'),_0x294084,_0xdb96('0xc'));logger['debug'](_0xdb96('0xd'),_0x294084,_0xdb96('0xc'),JSON[_0xdb96('0xe')](_0xaea492));if(_0xaea492[_0xdb96('0xf')]){if(_0xaea492['error'][_0xdb96('0x10')]===0x1f4){logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0xaea492['error'][_0xdb96('0x11')]);return _0x3384b4(_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);}logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);return _0x5e2e95(_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);}else{logger[_0xdb96('0x12')](_0xdb96('0xb'),_0x294084,_0xdb96('0xc'));_0x5e2e95(_0xaea492[_0xdb96('0x13')]['message']);}})[_0xdb96('0x14')](function(_0x2a766e){logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0x2a766e);_0x3384b4(_0x2a766e);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index afa3435..626e9f2 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(_0x15ea09,_0x2f30ab){var _0x3e9c78=function(_0x15f8ba){while(--_0x15f8ba){_0x15ea09['push'](_0x15ea09['shift']());}};_0x3e9c78(++_0x2f30ab);}(_0x1261,0x144));var _0x1126=function(_0x4f153b,_0x39818f){_0x4f153b=_0x4f153b-0x0;var _0x4e0cf8=_0x1261[_0x4f153b];return _0x4e0cf8;};'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 _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0xbb6adf,_0x35ba93){var _0x1a3cf2=function(_0x46fe15){while(--_0x46fe15){_0xbb6adf['push'](_0xbb6adf['shift']());}};_0x1a3cf2(++_0x35ba93);}(_0xadb5,0xad));var _0x5adb=function(_0x487146,_0x7d3283){_0x487146=_0x487146-0x0;var _0x4e7a15=_0xadb5[_0x487146];return _0x4e7a15;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 051f92b..0b81bf0 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 _0x93aa=['name','sequelize','exports','STRING'];(function(_0x4f841d,_0x386029){var _0x237d5b=function(_0xca21b0){while(--_0xca21b0){_0x4f841d['push'](_0x4f841d['shift']());}};_0x237d5b(++_0x386029);}(_0x93aa,0xe1));var _0xa93a=function(_0x1bca3f,_0x4a4fd0){_0x1bca3f=_0x1bca3f-0x0;var _0x254346=_0x93aa[_0x1bca3f];return _0x254346;};'use strict';var Sequelize=require(_0xa93a('0x0'));module[_0xa93a('0x1')]={'name':{'type':Sequelize[_0xa93a('0x2')],'unique':_0xa93a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa93a('0x2')]},'companyId':{'type':Sequelize[_0xa93a('0x2')]},'website':{'type':Sequelize[_0xa93a('0x2')]},'phone':{'type':Sequelize[_0xa93a('0x2')]},'fax':{'type':Sequelize[_0xa93a('0x2')]},'type':{'type':Sequelize[_0xa93a('0x2')]},'street':{'type':Sequelize[_0xa93a('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa93a('0x2')]},'country':{'type':Sequelize[_0xa93a('0x2')]},'email':{'type':Sequelize[_0xa93a('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa93a('0x2')]},'sStreet':{'type':Sequelize[_0xa93a('0x2')]},'sPostalCode':{'type':Sequelize[_0xa93a('0x2')]},'sCity':{'type':Sequelize[_0xa93a('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa93a('0x2')]}}; \ No newline at end of file +var _0x7859=['exports','STRING','name','sequelize'];(function(_0x29e3b6,_0x40b0b4){var _0x55d4b0=function(_0x55c58e){while(--_0x55c58e){_0x29e3b6['push'](_0x29e3b6['shift']());}};_0x55d4b0(++_0x40b0b4);}(_0x7859,0x1ef));var _0x9785=function(_0xca7e5b,_0x10f5f2){_0xca7e5b=_0xca7e5b-0x0;var _0x712872=_0x7859[_0xca7e5b];return _0x712872;};'use strict';var Sequelize=require(_0x9785('0x0'));module[_0x9785('0x1')]={'name':{'type':Sequelize[_0x9785('0x2')],'unique':_0x9785('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9785('0x2')]},'companyId':{'type':Sequelize[_0x9785('0x2')]},'website':{'type':Sequelize[_0x9785('0x2')]},'phone':{'type':Sequelize[_0x9785('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9785('0x2')]},'street':{'type':Sequelize[_0x9785('0x2')]},'postalCode':{'type':Sequelize[_0x9785('0x2')]},'city':{'type':Sequelize[_0x9785('0x2')]},'country':{'type':Sequelize[_0x9785('0x2')]},'email':{'type':Sequelize[_0x9785('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x9785('0x2')]},'sPostalCode':{'type':Sequelize[_0x9785('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x9785('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 31113cf..d2f8d51 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 _0xd19c=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','error','name','index','CmCompany','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','findOne','order','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd19c,0xec));var _0xcd19=function(_0x3c0e98,_0x25abfe){_0x3c0e98=_0x3c0e98-0x0;var _0x1d6dcb=_0xd19c[_0x3c0e98];return _0x1d6dcb;};'use strict';var emlformat=require(_0xcd19('0x0'));var rimraf=require(_0xcd19('0x1'));var zipdir=require(_0xcd19('0x2'));var jsonpatch=require(_0xcd19('0x3'));var rp=require(_0xcd19('0x4'));var moment=require('moment');var BPromise=require(_0xcd19('0x5'));var Mustache=require(_0xcd19('0x6'));var util=require(_0xcd19('0x7'));var path=require(_0xcd19('0x8'));var sox=require(_0xcd19('0x9'));var csv=require('to-csv');var ejs=require(_0xcd19('0xa'));var fs=require('fs');var fs_extra=require(_0xcd19('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcd19('0xc'));var jsforce=require(_0xcd19('0xd'));var deskjs=require(_0xcd19('0xe'));var toCsv=require(_0xcd19('0xf'));var querystring=require('querystring');var Papa=require(_0xcd19('0x10'));var Redis=require('ioredis');var authService=require(_0xcd19('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xcd19('0x12'));var hardwareService=require(_0xcd19('0x13'));var logger=require(_0xcd19('0x14'))(_0xcd19('0x15'));var utils=require(_0xcd19('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4efa26,_0x31158e){_0x31158e=_0x31158e||0xcc;return function(_0xdef449){if(_0xdef449){return _0x4efa26[_0xcd19('0x17')](_0x31158e);}return _0x4efa26[_0xcd19('0x18')](_0x31158e)[_0xcd19('0x19')]();};}function respondWithResult(_0x5180b6,_0x306190){_0x306190=_0x306190||0xc8;return function(_0x1d83c8){if(_0x1d83c8){return _0x5180b6[_0xcd19('0x18')](_0x306190)[_0xcd19('0x1a')](_0x1d83c8);}};}function respondWithFilteredResult(_0x1bcb45,_0x5b417e){return function(_0x22a695){if(_0x22a695){var _0x588a29=typeof _0x5b417e[_0xcd19('0x1b')]==='undefined'&&typeof _0x5b417e[_0xcd19('0x1c')]===_0xcd19('0x1d');var _0x605a7d=_0x22a695[_0xcd19('0x1e')];var _0x5c6bfb=_0x588a29?0x0:_0x5b417e[_0xcd19('0x1b')];var _0x236048=_0x588a29?_0x22a695['count']:_0x5b417e[_0xcd19('0x1b')]+_0x5b417e[_0xcd19('0x1c')];var _0x40eed2;if(_0x236048>=_0x605a7d){_0x236048=_0x605a7d;_0x40eed2=0xc8;}else{_0x40eed2=0xce;}_0x1bcb45[_0xcd19('0x18')](_0x40eed2);return _0x1bcb45[_0xcd19('0x1f')](_0xcd19('0x20'),_0x5c6bfb+'-'+_0x236048+'/'+_0x605a7d)[_0xcd19('0x1a')](_0x22a695);}return null;};}function patchUpdates(_0x2cda03){return function(_0x1e2c9c){try{jsonpatch[_0xcd19('0x21')](_0x1e2c9c,_0x2cda03,!![]);}catch(_0x1e44aa){return BPromise[_0xcd19('0x22')](_0x1e44aa);}return _0x1e2c9c[_0xcd19('0x23')]();};}function saveUpdates(_0x108102,_0x5480b3){return function(_0xd498d1){if(_0xd498d1){return _0xd498d1[_0xcd19('0x24')](_0x108102)[_0xcd19('0x25')](function(_0x1763cb){return _0x1763cb;});}return null;};}function removeEntity(_0x54b489,_0x5ec22b){return function(_0x2de156){if(_0x2de156){return _0x2de156[_0xcd19('0x26')]()[_0xcd19('0x25')](function(){var _0x23e327=_0x2de156[_0xcd19('0x27')]({'plain':!![]});var _0x25cd54=_0xcd19('0x28');return db['UserProfileResource'][_0xcd19('0x26')]({'where':{'type':_0x25cd54,'resourceId':_0x23e327['id']}})[_0xcd19('0x25')](function(){return _0x2de156;});})[_0xcd19('0x25')](function(){_0x54b489['status'](0xcc)[_0xcd19('0x19')]();});}};}function handleEntityNotFound(_0x28afdf,_0x59bd36){return function(_0x17fc11){if(!_0x17fc11){_0x28afdf[_0xcd19('0x17')](0x194);}return _0x17fc11;};}function handleError(_0x4a09e5,_0x504e96){_0x504e96=_0x504e96||0x1f4;return function(_0x484e5a){logger[_0xcd19('0x29')](_0x484e5a['stack']);if(_0x484e5a['name']){delete _0x484e5a[_0xcd19('0x2a')];}_0x4a09e5[_0xcd19('0x18')](_0x504e96)['send'](_0x484e5a);};}exports[_0xcd19('0x2b')]=function(_0x54f878,_0x163668){var _0x3d12b5={},_0x4f9f29={},_0x4d92d0={'count':0x0,'rows':[]};return db[_0xcd19('0x2c')]['describe']()[_0xcd19('0x25')](function(_0x2e8e07){_0x4f9f29['model']=_[_0xcd19('0x2d')](_0x2e8e07);_0x4f9f29[_0xcd19('0x2e')]=_[_0xcd19('0x2d')](_0x54f878[_0xcd19('0x2e')]);_0x4f9f29['filters']=_[_0xcd19('0x2f')](_0x4f9f29[_0xcd19('0x30')],_0x4f9f29[_0xcd19('0x2e')]);_0x3d12b5[_0xcd19('0x31')]=_['intersection'](_0x4f9f29['model'],qs[_0xcd19('0x32')](_0x54f878[_0xcd19('0x2e')]['fields']));_0x3d12b5[_0xcd19('0x31')]=_0x3d12b5[_0xcd19('0x31')][_0xcd19('0x33')]?_0x3d12b5[_0xcd19('0x31')]:_0x4f9f29[_0xcd19('0x30')];if(!_0x54f878[_0xcd19('0x2e')][_0xcd19('0x34')](_0xcd19('0x35'))){_0x3d12b5[_0xcd19('0x1c')]=qs[_0xcd19('0x1c')](_0x54f878[_0xcd19('0x2e')][_0xcd19('0x1c')]);_0x3d12b5[_0xcd19('0x1b')]=qs[_0xcd19('0x1b')](_0x54f878[_0xcd19('0x2e')]['offset']);}_0x3d12b5['order']=qs[_0xcd19('0x36')](_0x54f878[_0xcd19('0x2e')][_0xcd19('0x36')]);_0x3d12b5[_0xcd19('0x37')]=qs[_0xcd19('0x38')](_[_0xcd19('0x39')](_0x54f878[_0xcd19('0x2e')],_0x4f9f29[_0xcd19('0x38')]),_0x2e8e07);if(_0x54f878[_0xcd19('0x2e')][_0xcd19('0x3a')]){_0x3d12b5['where']=_[_0xcd19('0x3b')](_0x3d12b5[_0xcd19('0x37')],{'$or':_['map'](_0x3d12b5[_0xcd19('0x31')],function(_0x1b67a7){var _0x308048={};_0x308048[_0x1b67a7]={'$like':'%'+_0x54f878[_0xcd19('0x2e')][_0xcd19('0x3a')]+'%'};return _0x308048;})});}_0x3d12b5=_['merge']({},_0x3d12b5,_0x54f878['options']);var _0x8753f6={'where':_0x3d12b5[_0xcd19('0x37')]};return db[_0xcd19('0x2c')][_0xcd19('0x1e')](_0x8753f6)[_0xcd19('0x25')](function(_0x347e04){_0x4d92d0['count']=_0x347e04;if(_0x54f878[_0xcd19('0x2e')]['includeAll']){_0x3d12b5[_0xcd19('0x3c')]=[{'all':!![]}];}return db[_0xcd19('0x2c')][_0xcd19('0x3d')](_0x3d12b5);})[_0xcd19('0x25')](function(_0x9b52fc){_0x4d92d0[_0xcd19('0x3e')]=_0x9b52fc;return _0x4d92d0;})[_0xcd19('0x25')](respondWithFilteredResult(_0x163668,_0x3d12b5))['catch'](handleError(_0x163668,null));})[_0xcd19('0x3f')](handleError(_0x163668,null));};exports[_0xcd19('0x40')]=function(_0x279c55,_0x29a10c){var _0x55b87a={'raw':![],'where':{'id':_0x279c55[_0xcd19('0x41')]['id']}},_0x5a5274={};_0x5a5274[_0xcd19('0x30')]=_[_0xcd19('0x2d')](db[_0xcd19('0x2c')][_0xcd19('0x42')]);_0x5a5274[_0xcd19('0x2e')]=_['keys'](_0x279c55[_0xcd19('0x2e')]);_0x5a5274[_0xcd19('0x38')]=_[_0xcd19('0x2f')](_0x5a5274[_0xcd19('0x30')],_0x5a5274[_0xcd19('0x2e')]);_0x55b87a[_0xcd19('0x31')]=_[_0xcd19('0x2f')](_0x5a5274[_0xcd19('0x30')],qs[_0xcd19('0x32')](_0x279c55[_0xcd19('0x2e')][_0xcd19('0x32')]));_0x55b87a['attributes']=_0x55b87a[_0xcd19('0x31')][_0xcd19('0x33')]?_0x55b87a[_0xcd19('0x31')]:_0x5a5274[_0xcd19('0x30')];if(_0x279c55[_0xcd19('0x2e')][_0xcd19('0x43')]){_0x55b87a[_0xcd19('0x3c')]=[{'all':!![]}];}_0x55b87a=_[_0xcd19('0x3b')]({},_0x55b87a,_0x279c55[_0xcd19('0x44')]);return db['CmCompany'][_0xcd19('0x45')](_0x55b87a)[_0xcd19('0x25')](handleEntityNotFound(_0x29a10c,null))[_0xcd19('0x25')](respondWithResult(_0x29a10c,null))[_0xcd19('0x3f')](handleError(_0x29a10c,null));};exports[_0xcd19('0x46')]=function(_0x3f5920,_0x286e75){return db['CmCompany'][_0xcd19('0x46')](_0x3f5920[_0xcd19('0x47')],{})[_0xcd19('0x25')](function(_0x509a9d){var _0x10ef14=_0x3f5920['user'][_0xcd19('0x27')]({'plain':!![]});if(!_0x10ef14)throw new Error(_0xcd19('0x48'));if(_0x10ef14[_0xcd19('0x49')]===_0xcd19('0x4a')){var _0x3660e3=_0x509a9d[_0xcd19('0x27')]({'plain':!![]});var _0x3742d4=_0xcd19('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x3742d4,'userProfileId':_0x10ef14['userProfileId']},'raw':!![]})[_0xcd19('0x25')](function(_0x420506){if(_0x420506&&_0x420506['autoAssociation']===0x0){return db[_0xcd19('0x4b')][_0xcd19('0x46')]({'name':_0x3660e3[_0xcd19('0x2a')],'resourceId':_0x3660e3['id'],'type':_0x420506[_0xcd19('0x2a')],'sectionId':_0x420506['id']},{})['then'](function(){return _0x509a9d;});}else{return _0x509a9d;}})[_0xcd19('0x3f')](function(_0x3d66b7){logger[_0xcd19('0x29')](_0xcd19('0x4c'),_0x3d66b7);throw _0x3d66b7;});}return _0x509a9d;})['then'](respondWithResult(_0x286e75,0xc9))[_0xcd19('0x3f')](handleError(_0x286e75,null));};exports[_0xcd19('0x24')]=function(_0x19d5e6,_0x4b6e5b){if(_0x19d5e6[_0xcd19('0x47')]['id']){delete _0x19d5e6[_0xcd19('0x47')]['id'];}return db[_0xcd19('0x2c')][_0xcd19('0x45')]({'where':{'id':_0x19d5e6[_0xcd19('0x41')]['id']}})['then'](handleEntityNotFound(_0x4b6e5b,null))['then'](saveUpdates(_0x19d5e6[_0xcd19('0x47')],null))[_0xcd19('0x25')](respondWithResult(_0x4b6e5b,null))['catch'](handleError(_0x4b6e5b,null));};exports['destroy']=function(_0x47605b,_0x427aae){return db[_0xcd19('0x2c')][_0xcd19('0x45')]({'where':{'id':_0x47605b[_0xcd19('0x41')]['id']}})[_0xcd19('0x25')](handleEntityNotFound(_0x427aae,null))['then'](removeEntity(_0x427aae,null))[_0xcd19('0x3f')](handleError(_0x427aae,null));};exports[_0xcd19('0x4d')]=function(_0x56089a,_0x29e41a){return db[_0xcd19('0x2c')][_0xcd19('0x4d')]()[_0xcd19('0x25')](respondWithResult(_0x29e41a,null))[_0xcd19('0x3f')](handleError(_0x29e41a,null));};exports[_0xcd19('0x4e')]=function(_0x32a7a5,_0x10e466,_0x488639){return db[_0xcd19('0x4f')][_0xcd19('0x45')]({'where':{'id':_0x32a7a5['params']['id']}})[_0xcd19('0x25')](handleEntityNotFound(_0x10e466,null))[_0xcd19('0x25')](function(_0x522cab){if(_0x522cab){return _0x522cab[_0xcd19('0x4e')](_0x32a7a5[_0xcd19('0x47')][_0xcd19('0x50')],_['omit'](_0x32a7a5[_0xcd19('0x47')],[_0xcd19('0x50'),'id'])||{});}})[_0xcd19('0x25')](respondWithResult(_0x10e466,null))[_0xcd19('0x3f')](handleError(_0x10e466,null));};exports['getContacts']=function(_0x36ec1c,_0x281de8,_0x32a191){var _0x6f44b9={};var _0x1ec9b5={};var _0x1fa261;var _0x2dfb59;return db[_0xcd19('0x2c')][_0xcd19('0x51')]({'where':{'id':_0x36ec1c['params']['id']}})['then'](handleEntityNotFound(_0x281de8,null))[_0xcd19('0x25')](function(_0x5babf0){if(_0x5babf0){_0x1fa261=_0x5babf0;_0x1ec9b5[_0xcd19('0x30')]=_[_0xcd19('0x2d')](db['CmContact']['rawAttributes']);_0x1ec9b5[_0xcd19('0x2e')]=_[_0xcd19('0x2d')](_0x36ec1c[_0xcd19('0x2e')]);_0x1ec9b5[_0xcd19('0x38')]=_['intersection'](_0x1ec9b5['model'],_0x1ec9b5[_0xcd19('0x2e')]);_0x6f44b9[_0xcd19('0x31')]=_[_0xcd19('0x2f')](_0x1ec9b5[_0xcd19('0x30')],qs[_0xcd19('0x32')](_0x36ec1c[_0xcd19('0x2e')][_0xcd19('0x32')]));_0x6f44b9[_0xcd19('0x31')]=_0x6f44b9['attributes'][_0xcd19('0x33')]?_0x6f44b9[_0xcd19('0x31')]:_0x1ec9b5[_0xcd19('0x30')];_0x6f44b9[_0xcd19('0x52')]=qs[_0xcd19('0x36')](_0x36ec1c[_0xcd19('0x2e')][_0xcd19('0x36')]);_0x6f44b9[_0xcd19('0x37')]=qs['filters'](_['pick'](_0x36ec1c[_0xcd19('0x2e')],_0x1ec9b5[_0xcd19('0x38')]));if(_0x36ec1c[_0xcd19('0x2e')][_0xcd19('0x3a')]){_0x6f44b9[_0xcd19('0x37')]=_[_0xcd19('0x3b')](_0x6f44b9[_0xcd19('0x37')],{'$or':_['map'](_0x6f44b9[_0xcd19('0x31')],function(_0xc3b8b){var _0x13f839={};_0x13f839[_0xc3b8b]={'$like':'%'+_0x36ec1c[_0xcd19('0x2e')]['filter']+'%'};return _0x13f839;})});}_0x6f44b9=_[_0xcd19('0x3b')]({},_0x6f44b9,_0x36ec1c[_0xcd19('0x44')]);return _0x1fa261[_0xcd19('0x53')](_0x6f44b9);}})[_0xcd19('0x25')](function(_0x96e69a){if(_0x96e69a){_0x2dfb59=_0x96e69a['length'];if(!_0x36ec1c[_0xcd19('0x2e')][_0xcd19('0x34')](_0xcd19('0x35'))){_0x6f44b9[_0xcd19('0x1c')]=qs[_0xcd19('0x1c')](_0x36ec1c[_0xcd19('0x2e')][_0xcd19('0x1c')]);_0x6f44b9[_0xcd19('0x1b')]=qs[_0xcd19('0x1b')](_0x36ec1c[_0xcd19('0x2e')][_0xcd19('0x1b')]);}return _0x1fa261[_0xcd19('0x53')](_0x6f44b9);}})[_0xcd19('0x25')](function(_0x134b51){if(_0x134b51){return _0x134b51?{'count':_0x2dfb59,'rows':_0x134b51}:null;}})[_0xcd19('0x25')](respondWithResult(_0x281de8,null))[_0xcd19('0x3f')](handleError(_0x281de8,null));}; \ No newline at end of file +var _0xc0b9=['then','destroy','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','body','find','CmContact','addContacts','ids','omit','getContacts','findOne','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','save','update'];(function(_0x5d3db8,_0xed2937){var _0x12944f=function(_0x4c5dcd){while(--_0x4c5dcd){_0x5d3db8['push'](_0x5d3db8['shift']());}};_0x12944f(++_0xed2937);}(_0xc0b9,0x18f));var _0x9c0b=function(_0xae834e,_0x51ffb4){_0xae834e=_0xae834e-0x0;var _0x2a6d46=_0xc0b9[_0xae834e];return _0x2a6d46;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9c0b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c0b('0x1'));var moment=require(_0x9c0b('0x2'));var BPromise=require(_0x9c0b('0x3'));var Mustache=require(_0x9c0b('0x4'));var util=require(_0x9c0b('0x5'));var path=require(_0x9c0b('0x6'));var sox=require(_0x9c0b('0x7'));var csv=require(_0x9c0b('0x8'));var ejs=require(_0x9c0b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9c0b('0xa'));var crypto=require(_0x9c0b('0xb'));var jsforce=require(_0x9c0b('0xc'));var deskjs=require(_0x9c0b('0xd'));var toCsv=require(_0x9c0b('0x8'));var querystring=require('querystring');var Papa=require(_0x9c0b('0xe'));var Redis=require(_0x9c0b('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9c0b('0x10'));var hardwareService=require(_0x9c0b('0x11'));var logger=require(_0x9c0b('0x12'))(_0x9c0b('0x13'));var utils=require(_0x9c0b('0x14'));var config=require(_0x9c0b('0x15'));var licenseUtil=require(_0x9c0b('0x16'));var db=require(_0x9c0b('0x17'))['db'];function respondWithStatusCode(_0x32535a,_0x442e9d){_0x442e9d=_0x442e9d||0xcc;return function(_0x2531a1){if(_0x2531a1){return _0x32535a[_0x9c0b('0x18')](_0x442e9d);}return _0x32535a['status'](_0x442e9d)[_0x9c0b('0x19')]();};}function respondWithResult(_0x40d8e9,_0x34a4b9){_0x34a4b9=_0x34a4b9||0xc8;return function(_0x431e37){if(_0x431e37){return _0x40d8e9[_0x9c0b('0x1a')](_0x34a4b9)[_0x9c0b('0x1b')](_0x431e37);}};}function respondWithFilteredResult(_0x481bcd,_0x4f0bbb){return function(_0x49edbc){if(_0x49edbc){var _0x66d514=typeof _0x4f0bbb[_0x9c0b('0x1c')]===_0x9c0b('0x1d')&&typeof _0x4f0bbb['limit']==='undefined';var _0x2b6a5d=_0x49edbc[_0x9c0b('0x1e')];var _0x287946=_0x66d514?0x0:_0x4f0bbb[_0x9c0b('0x1c')];var _0x1081e4=_0x66d514?_0x49edbc[_0x9c0b('0x1e')]:_0x4f0bbb['offset']+_0x4f0bbb[_0x9c0b('0x1f')];var _0x4c9d18;if(_0x1081e4>=_0x2b6a5d){_0x1081e4=_0x2b6a5d;_0x4c9d18=0xc8;}else{_0x4c9d18=0xce;}_0x481bcd[_0x9c0b('0x1a')](_0x4c9d18);return _0x481bcd[_0x9c0b('0x20')](_0x9c0b('0x21'),_0x287946+'-'+_0x1081e4+'/'+_0x2b6a5d)['json'](_0x49edbc);}return null;};}function patchUpdates(_0x41a80d){return function(_0x367f71){try{jsonpatch['apply'](_0x367f71,_0x41a80d,!![]);}catch(_0x17e4fb){return BPromise['reject'](_0x17e4fb);}return _0x367f71[_0x9c0b('0x22')]();};}function saveUpdates(_0x2b8075,_0x36b4ee){return function(_0x842fe4){if(_0x842fe4){return _0x842fe4[_0x9c0b('0x23')](_0x2b8075)[_0x9c0b('0x24')](function(_0x39a382){return _0x39a382;});}return null;};}function removeEntity(_0x1702a2,_0x3fd047){return function(_0x2ea9c5){if(_0x2ea9c5){return _0x2ea9c5[_0x9c0b('0x25')]()[_0x9c0b('0x24')](function(){var _0x449da7=_0x2ea9c5[_0x9c0b('0x26')]({'plain':!![]});var _0x9612eb=_0x9c0b('0x27');return db[_0x9c0b('0x28')][_0x9c0b('0x25')]({'where':{'type':_0x9612eb,'resourceId':_0x449da7['id']}})['then'](function(){return _0x2ea9c5;});})[_0x9c0b('0x24')](function(){_0x1702a2[_0x9c0b('0x1a')](0xcc)[_0x9c0b('0x19')]();});}};}function handleEntityNotFound(_0x303e31,_0x259099){return function(_0x39bc21){if(!_0x39bc21){_0x303e31[_0x9c0b('0x18')](0x194);}return _0x39bc21;};}function handleError(_0x493848,_0x16845a){_0x16845a=_0x16845a||0x1f4;return function(_0x49050b){logger['error'](_0x49050b[_0x9c0b('0x29')]);if(_0x49050b[_0x9c0b('0x2a')]){delete _0x49050b[_0x9c0b('0x2a')];}_0x493848[_0x9c0b('0x1a')](_0x16845a)[_0x9c0b('0x2b')](_0x49050b);};}exports[_0x9c0b('0x2c')]=function(_0xa5445a,_0x2e9836){var _0x4ceeba={},_0x4b3378={},_0x51455a={'count':0x0,'rows':[]};return db[_0x9c0b('0x2d')][_0x9c0b('0x2e')]()[_0x9c0b('0x24')](function(_0x2ec8cd){_0x4b3378[_0x9c0b('0x2f')]=_['keys'](_0x2ec8cd);_0x4b3378[_0x9c0b('0x30')]=_[_0x9c0b('0x31')](_0xa5445a[_0x9c0b('0x30')]);_0x4b3378[_0x9c0b('0x32')]=_[_0x9c0b('0x33')](_0x4b3378[_0x9c0b('0x2f')],_0x4b3378[_0x9c0b('0x30')]);_0x4ceeba[_0x9c0b('0x34')]=_[_0x9c0b('0x33')](_0x4b3378[_0x9c0b('0x2f')],qs[_0x9c0b('0x35')](_0xa5445a[_0x9c0b('0x30')][_0x9c0b('0x35')]));_0x4ceeba['attributes']=_0x4ceeba['attributes'][_0x9c0b('0x36')]?_0x4ceeba[_0x9c0b('0x34')]:_0x4b3378[_0x9c0b('0x2f')];if(!_0xa5445a[_0x9c0b('0x30')][_0x9c0b('0x37')](_0x9c0b('0x38'))){_0x4ceeba[_0x9c0b('0x1f')]=qs['limit'](_0xa5445a[_0x9c0b('0x30')][_0x9c0b('0x1f')]);_0x4ceeba[_0x9c0b('0x1c')]=qs[_0x9c0b('0x1c')](_0xa5445a[_0x9c0b('0x30')][_0x9c0b('0x1c')]);}_0x4ceeba[_0x9c0b('0x39')]=qs[_0x9c0b('0x3a')](_0xa5445a[_0x9c0b('0x30')]['sort']);_0x4ceeba[_0x9c0b('0x3b')]=qs[_0x9c0b('0x32')](_[_0x9c0b('0x3c')](_0xa5445a[_0x9c0b('0x30')],_0x4b3378['filters']),_0x2ec8cd);if(_0xa5445a[_0x9c0b('0x30')][_0x9c0b('0x3d')]){_0x4ceeba['where']=_[_0x9c0b('0x3e')](_0x4ceeba['where'],{'$or':_['map'](_0x4ceeba[_0x9c0b('0x34')],function(_0x10675e){var _0x1fe16e={};_0x1fe16e[_0x10675e]={'$like':'%'+_0xa5445a[_0x9c0b('0x30')][_0x9c0b('0x3d')]+'%'};return _0x1fe16e;})});}_0x4ceeba=_[_0x9c0b('0x3e')]({},_0x4ceeba,_0xa5445a[_0x9c0b('0x3f')]);var _0x4e7826={'where':_0x4ceeba[_0x9c0b('0x3b')]};return db[_0x9c0b('0x2d')][_0x9c0b('0x1e')](_0x4e7826)[_0x9c0b('0x24')](function(_0x3c1f71){_0x51455a[_0x9c0b('0x1e')]=_0x3c1f71;if(_0xa5445a['query']['includeAll']){_0x4ceeba[_0x9c0b('0x40')]=[{'all':!![]}];}return db['CmCompany'][_0x9c0b('0x41')](_0x4ceeba);})[_0x9c0b('0x24')](function(_0x575ccf){_0x51455a[_0x9c0b('0x42')]=_0x575ccf;return _0x51455a;})[_0x9c0b('0x24')](respondWithFilteredResult(_0x2e9836,_0x4ceeba))[_0x9c0b('0x43')](handleError(_0x2e9836,null));})[_0x9c0b('0x43')](handleError(_0x2e9836,null));};exports[_0x9c0b('0x44')]=function(_0x4cbcc6,_0x13b86b){var _0x429380={'raw':![],'where':{'id':_0x4cbcc6[_0x9c0b('0x45')]['id']}},_0x2bf3fb={};_0x2bf3fb[_0x9c0b('0x2f')]=_[_0x9c0b('0x31')](db['CmCompany'][_0x9c0b('0x46')]);_0x2bf3fb[_0x9c0b('0x30')]=_['keys'](_0x4cbcc6[_0x9c0b('0x30')]);_0x2bf3fb[_0x9c0b('0x32')]=_[_0x9c0b('0x33')](_0x2bf3fb[_0x9c0b('0x2f')],_0x2bf3fb[_0x9c0b('0x30')]);_0x429380['attributes']=_[_0x9c0b('0x33')](_0x2bf3fb[_0x9c0b('0x2f')],qs['fields'](_0x4cbcc6[_0x9c0b('0x30')][_0x9c0b('0x35')]));_0x429380[_0x9c0b('0x34')]=_0x429380[_0x9c0b('0x34')][_0x9c0b('0x36')]?_0x429380['attributes']:_0x2bf3fb[_0x9c0b('0x2f')];if(_0x4cbcc6[_0x9c0b('0x30')][_0x9c0b('0x47')]){_0x429380[_0x9c0b('0x40')]=[{'all':!![]}];}_0x429380=_[_0x9c0b('0x3e')]({},_0x429380,_0x4cbcc6['options']);return db[_0x9c0b('0x2d')]['find'](_0x429380)[_0x9c0b('0x24')](handleEntityNotFound(_0x13b86b,null))['then'](respondWithResult(_0x13b86b,null))['catch'](handleError(_0x13b86b,null));};exports[_0x9c0b('0x48')]=function(_0x3a28c0,_0x408d3a){return db[_0x9c0b('0x2d')][_0x9c0b('0x48')](_0x3a28c0['body'],{})[_0x9c0b('0x24')](function(_0x2e63b5){var _0x34ce3f=_0x3a28c0['user'][_0x9c0b('0x26')]({'plain':!![]});if(!_0x34ce3f)throw new Error(_0x9c0b('0x49'));if(_0x34ce3f[_0x9c0b('0x4a')]===_0x9c0b('0x4b')){var _0x1cd2b6=_0x2e63b5[_0x9c0b('0x26')]({'plain':!![]});var _0x443935='Companies';return db[_0x9c0b('0x4c')]['find']({'where':{'name':_0x443935,'userProfileId':_0x34ce3f[_0x9c0b('0x4d')]},'raw':!![]})[_0x9c0b('0x24')](function(_0x555c6e){if(_0x555c6e&&_0x555c6e['autoAssociation']===0x0){return db[_0x9c0b('0x28')]['create']({'name':_0x1cd2b6['name'],'resourceId':_0x1cd2b6['id'],'type':_0x555c6e['name'],'sectionId':_0x555c6e['id']},{})[_0x9c0b('0x24')](function(){return _0x2e63b5;});}else{return _0x2e63b5;}})[_0x9c0b('0x43')](function(_0x41b484){logger[_0x9c0b('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41b484);throw _0x41b484;});}return _0x2e63b5;})['then'](respondWithResult(_0x408d3a,0xc9))['catch'](handleError(_0x408d3a,null));};exports[_0x9c0b('0x23')]=function(_0xe3d8a6,_0x37197b){if(_0xe3d8a6[_0x9c0b('0x4f')]['id']){delete _0xe3d8a6[_0x9c0b('0x4f')]['id'];}return db[_0x9c0b('0x2d')][_0x9c0b('0x50')]({'where':{'id':_0xe3d8a6[_0x9c0b('0x45')]['id']}})[_0x9c0b('0x24')](handleEntityNotFound(_0x37197b,null))[_0x9c0b('0x24')](saveUpdates(_0xe3d8a6['body'],null))[_0x9c0b('0x24')](respondWithResult(_0x37197b,null))[_0x9c0b('0x43')](handleError(_0x37197b,null));};exports[_0x9c0b('0x25')]=function(_0x538982,_0x1a30d2){return db[_0x9c0b('0x2d')]['find']({'where':{'id':_0x538982[_0x9c0b('0x45')]['id']}})[_0x9c0b('0x24')](handleEntityNotFound(_0x1a30d2,null))[_0x9c0b('0x24')](removeEntity(_0x1a30d2,null))[_0x9c0b('0x43')](handleError(_0x1a30d2,null));};exports['describe']=function(_0x23b564,_0x3537bc){return db['CmCompany']['describe']()['then'](respondWithResult(_0x3537bc,null))['catch'](handleError(_0x3537bc,null));};exports['addContacts']=function(_0x12613e,_0x571f0e,_0x286e0b){return db[_0x9c0b('0x51')][_0x9c0b('0x50')]({'where':{'id':_0x12613e[_0x9c0b('0x45')]['id']}})[_0x9c0b('0x24')](handleEntityNotFound(_0x571f0e,null))['then'](function(_0x3f7eb3){if(_0x3f7eb3){return _0x3f7eb3[_0x9c0b('0x52')](_0x12613e[_0x9c0b('0x4f')][_0x9c0b('0x53')],_[_0x9c0b('0x54')](_0x12613e['body'],[_0x9c0b('0x53'),'id'])||{});}})[_0x9c0b('0x24')](respondWithResult(_0x571f0e,null))[_0x9c0b('0x43')](handleError(_0x571f0e,null));};exports[_0x9c0b('0x55')]=function(_0x526968,_0x32aaa6,_0x596c4a){var _0xeaca6e={};var _0x3d1a09={};var _0x5e8631;var _0x577482;return db[_0x9c0b('0x2d')][_0x9c0b('0x56')]({'where':{'id':_0x526968[_0x9c0b('0x45')]['id']}})[_0x9c0b('0x24')](handleEntityNotFound(_0x32aaa6,null))[_0x9c0b('0x24')](function(_0x4ade09){if(_0x4ade09){_0x5e8631=_0x4ade09;_0x3d1a09[_0x9c0b('0x2f')]=_[_0x9c0b('0x31')](db[_0x9c0b('0x51')][_0x9c0b('0x46')]);_0x3d1a09[_0x9c0b('0x30')]=_[_0x9c0b('0x31')](_0x526968[_0x9c0b('0x30')]);_0x3d1a09[_0x9c0b('0x32')]=_[_0x9c0b('0x33')](_0x3d1a09['model'],_0x3d1a09[_0x9c0b('0x30')]);_0xeaca6e[_0x9c0b('0x34')]=_[_0x9c0b('0x33')](_0x3d1a09['model'],qs[_0x9c0b('0x35')](_0x526968[_0x9c0b('0x30')][_0x9c0b('0x35')]));_0xeaca6e[_0x9c0b('0x34')]=_0xeaca6e[_0x9c0b('0x34')][_0x9c0b('0x36')]?_0xeaca6e[_0x9c0b('0x34')]:_0x3d1a09[_0x9c0b('0x2f')];_0xeaca6e['order']=qs[_0x9c0b('0x3a')](_0x526968[_0x9c0b('0x30')]['sort']);_0xeaca6e[_0x9c0b('0x3b')]=qs[_0x9c0b('0x32')](_['pick'](_0x526968[_0x9c0b('0x30')],_0x3d1a09[_0x9c0b('0x32')]));if(_0x526968[_0x9c0b('0x30')][_0x9c0b('0x3d')]){_0xeaca6e['where']=_[_0x9c0b('0x3e')](_0xeaca6e['where'],{'$or':_['map'](_0xeaca6e['attributes'],function(_0x4a2e75){var _0x17ad30={};_0x17ad30[_0x4a2e75]={'$like':'%'+_0x526968[_0x9c0b('0x30')][_0x9c0b('0x3d')]+'%'};return _0x17ad30;})});}_0xeaca6e=_['merge']({},_0xeaca6e,_0x526968[_0x9c0b('0x3f')]);return _0x5e8631['getContacts'](_0xeaca6e);}})[_0x9c0b('0x24')](function(_0x35a9d0){if(_0x35a9d0){_0x577482=_0x35a9d0[_0x9c0b('0x36')];if(!_0x526968[_0x9c0b('0x30')][_0x9c0b('0x37')](_0x9c0b('0x38'))){_0xeaca6e[_0x9c0b('0x1f')]=qs[_0x9c0b('0x1f')](_0x526968[_0x9c0b('0x30')][_0x9c0b('0x1f')]);_0xeaca6e['offset']=qs[_0x9c0b('0x1c')](_0x526968[_0x9c0b('0x30')][_0x9c0b('0x1c')]);}return _0x5e8631[_0x9c0b('0x55')](_0xeaca6e);}})[_0x9c0b('0x24')](function(_0xddf4a2){if(_0xddf4a2){return _0xddf4a2?{'count':_0x577482,'rows':_0xddf4a2}:null;}})[_0x9c0b('0x24')](respondWithResult(_0x32aaa6,null))[_0x9c0b('0x43')](handleError(_0x32aaa6,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 152fe94..91d4ae0 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 _0x5d21=['rimraf','../../config/environment','define','cm_companies','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x15a2d8,_0x595392){var _0x5d1373=function(_0xfae8eb){while(--_0xfae8eb){_0x15a2d8['push'](_0x15a2d8['shift']());}};_0x5d1373(++_0x595392);}(_0x5d21,0xeb));var _0x15d2=function(_0x4df42c,_0x47bd58){_0x4df42c=_0x4df42c-0x0;var _0x49b958=_0x5d21[_0x4df42c];return _0x49b958;};'use strict';var _=require(_0x15d2('0x0'));var util=require(_0x15d2('0x1'));var logger=require('../../config/logger')(_0x15d2('0x2'));var moment=require(_0x15d2('0x3'));var BPromise=require(_0x15d2('0x4'));var rp=require(_0x15d2('0x5'));var fs=require('fs');var path=require(_0x15d2('0x6'));var rimraf=require(_0x15d2('0x7'));var config=require(_0x15d2('0x8'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x184478,_0x2b2291){return _0x184478[_0x15d2('0x9')]('CmCompany',attributes,{'tableName':_0x15d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc874=['request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','api','moment','bluebird'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc874,0x1a8));var _0x4c87=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0xc874[_0x296897];return _0x2b44ab;};'use strict';var _=require(_0x4c87('0x0'));var util=require(_0x4c87('0x1'));var logger=require('../../config/logger')(_0x4c87('0x2'));var moment=require(_0x4c87('0x3'));var BPromise=require(_0x4c87('0x4'));var rp=require(_0x4c87('0x5'));var fs=require('fs');var path=require(_0x4c87('0x6'));var rimraf=require(_0x4c87('0x7'));var config=require(_0x4c87('0x8'));var attributes=require(_0x4c87('0x9'));module['exports']=function(_0x4fdce2,_0x14f81d){return _0x4fdce2[_0x4c87('0xa')](_0x4c87('0xb'),attributes,{'tableName':_0x4c87('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 073022c..a64be36 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 _0x6d4d=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird'];(function(_0x38894d,_0x1883d8){var _0x5614fe=function(_0x181989){while(--_0x181989){_0x38894d['push'](_0x38894d['shift']());}};_0x5614fe(++_0x1883d8);}(_0x6d4d,0x13f));var _0xd6d4=function(_0x11c3cb,_0x5231a5){_0x11c3cb=_0x11c3cb-0x0;var _0x1d5d08=_0x6d4d[_0x11c3cb];return _0x1d5d08;};'use strict';var _=require('lodash');var util=require(_0xd6d4('0x0'));var moment=require(_0xd6d4('0x1'));var BPromise=require(_0xd6d4('0x2'));var rs=require(_0xd6d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6d4('0x4'))['db'];var utils=require(_0xd6d4('0x5'));var logger=require(_0xd6d4('0x6'))(_0xd6d4('0x7'));var config=require(_0xd6d4('0x8'));var jayson=require(_0xd6d4('0x9'));var client=jayson[_0xd6d4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1197db,_0x4e522a,_0x211829){return new BPromise(function(_0x2d9aa5,_0x5793ac){return client[_0xd6d4('0xb')](_0x1197db,_0x211829)[_0xd6d4('0xc')](function(_0x2db59e){logger[_0xd6d4('0xd')](_0xd6d4('0xe'),_0x4e522a,_0xd6d4('0xf'));logger[_0xd6d4('0x10')](_0xd6d4('0x11'),_0x4e522a,_0xd6d4('0xf'),JSON[_0xd6d4('0x12')](_0x2db59e));if(_0x2db59e[_0xd6d4('0x13')]){if(_0x2db59e[_0xd6d4('0x13')][_0xd6d4('0x14')]===0x1f4){logger[_0xd6d4('0x13')]('CmCompany,\x20%s,\x20%s',_0x4e522a,_0x2db59e[_0xd6d4('0x13')][_0xd6d4('0x15')]);return _0x5793ac(_0x2db59e[_0xd6d4('0x13')][_0xd6d4('0x15')]);}logger[_0xd6d4('0x13')](_0xd6d4('0xe'),_0x4e522a,_0x2db59e[_0xd6d4('0x13')][_0xd6d4('0x15')]);return _0x2d9aa5(_0x2db59e[_0xd6d4('0x13')][_0xd6d4('0x15')]);}else{logger['info'](_0xd6d4('0xe'),_0x4e522a,_0xd6d4('0xf'));_0x2d9aa5(_0x2db59e[_0xd6d4('0x16')]['message']);}})['catch'](function(_0x1c8bc1){logger[_0xd6d4('0x13')](_0xd6d4('0xe'),_0x4e522a,_0x1c8bc1);_0x5793ac(_0x1c8bc1);});});} \ No newline at end of file +var _0x48a9=['info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x22e4d3,_0x26a815){var _0x354f75=function(_0x533091){while(--_0x533091){_0x22e4d3['push'](_0x22e4d3['shift']());}};_0x354f75(++_0x26a815);}(_0x48a9,0xe6));var _0x948a=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0x48a9[_0x5e6ea3];return _0x4048b5;};'use strict';var _=require('lodash');var util=require(_0x948a('0x0'));var moment=require(_0x948a('0x1'));var BPromise=require(_0x948a('0x2'));var rs=require(_0x948a('0x3'));var fs=require('fs');var Redis=require(_0x948a('0x4'));var db=require(_0x948a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x948a('0x6'))(_0x948a('0x7'));var config=require('../../config/environment');var jayson=require(_0x948a('0x8'));var client=jayson[_0x948a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34a47c,_0x1a7c21,_0x5299a6){return new BPromise(function(_0x2f3faf,_0x16df55){return client[_0x948a('0xa')](_0x34a47c,_0x5299a6)[_0x948a('0xb')](function(_0x4c2e91){logger[_0x948a('0xc')]('CmCompany,\x20%s,\x20%s',_0x1a7c21,_0x948a('0xd'));logger[_0x948a('0xe')](_0x948a('0xf'),_0x1a7c21,_0x948a('0xd'),JSON[_0x948a('0x10')](_0x4c2e91));if(_0x4c2e91['error']){if(_0x4c2e91[_0x948a('0x11')]['code']===0x1f4){logger[_0x948a('0x11')](_0x948a('0x12'),_0x1a7c21,_0x4c2e91[_0x948a('0x11')]['message']);return _0x16df55(_0x4c2e91[_0x948a('0x11')]['message']);}logger[_0x948a('0x11')]('CmCompany,\x20%s,\x20%s',_0x1a7c21,_0x4c2e91['error'][_0x948a('0x13')]);return _0x2f3faf(_0x4c2e91[_0x948a('0x11')]['message']);}else{logger[_0x948a('0xc')](_0x948a('0x12'),_0x1a7c21,_0x948a('0xd'));_0x2f3faf(_0x4c2e91[_0x948a('0x14')][_0x948a('0x13')]);}})[_0x948a('0x15')](function(_0x45b3d8){logger[_0x948a('0x11')]('CmCompany,\x20%s,\x20%s',_0x1a7c21,_0x45b3d8);_0x16df55(_0x45b3d8);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 78f0bc0..d6b8823 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 _0xe25f=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','post','create','addContacts','put','/:id','update','delete','destroy','exports'];(function(_0x104e21,_0x2ea86f){var _0x605b37=function(_0x580fce){while(--_0x580fce){_0x104e21['push'](_0x104e21['shift']());}};_0x605b37(++_0x2ea86f);}(_0xe25f,0x64));var _0xfe25=function(_0x45de04,_0x558d9e){_0x45de04=_0x45de04-0x0;var _0x189d9d=_0xe25f[_0x45de04];return _0x189d9d;};'use strict';var multer=require(_0xfe25('0x0'));var util=require(_0xfe25('0x1'));var path=require(_0xfe25('0x2'));var timeout=require(_0xfe25('0x3'));var express=require(_0xfe25('0x4'));var router=express[_0xfe25('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfe25('0x6'));var config=require(_0xfe25('0x7'));var controller=require(_0xfe25('0x8'));router[_0xfe25('0x9')]('/',auth[_0xfe25('0xa')](),controller[_0xfe25('0xb')]);router[_0xfe25('0x9')](_0xfe25('0xc'),auth[_0xfe25('0xa')](),controller[_0xfe25('0xd')]);router[_0xfe25('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xfe25('0xe')]);router[_0xfe25('0x9')](_0xfe25('0xf'),auth[_0xfe25('0xa')](),controller['getContacts']);router[_0xfe25('0x10')]('/',auth[_0xfe25('0xa')](),controller[_0xfe25('0x11')]);router[_0xfe25('0x10')]('/:id/contacts',auth[_0xfe25('0xa')](),controller[_0xfe25('0x12')]);router[_0xfe25('0x13')](_0xfe25('0x14'),auth[_0xfe25('0xa')](),controller[_0xfe25('0x15')]);router[_0xfe25('0x16')]('/:id',auth[_0xfe25('0xa')](),controller[_0xfe25('0x17')]);module[_0xfe25('0x18')]=router; \ No newline at end of file +var _0x61b3=['create','addContacts','put','update','delete','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','index','get','/describe','isAuthenticated','/:id','show','/:id/contacts','post'];(function(_0x468777,_0x81b92){var _0x4eba33=function(_0x4e1471){while(--_0x4e1471){_0x468777['push'](_0x468777['shift']());}};_0x4eba33(++_0x81b92);}(_0x61b3,0x1be));var _0x361b=function(_0x244dd2,_0x1b0955){_0x244dd2=_0x244dd2-0x0;var _0x1faa57=_0x61b3[_0x244dd2];return _0x1faa57;};'use strict';var multer=require(_0x361b('0x0'));var util=require('util');var path=require(_0x361b('0x1'));var timeout=require(_0x361b('0x2'));var express=require(_0x361b('0x3'));var router=express['Router']();var fs_extra=require(_0x361b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x361b('0x5'));var config=require(_0x361b('0x6'));var controller=require(_0x361b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x361b('0x8')]);router[_0x361b('0x9')](_0x361b('0xa'),auth[_0x361b('0xb')](),controller['describe']);router[_0x361b('0x9')](_0x361b('0xc'),auth[_0x361b('0xb')](),controller[_0x361b('0xd')]);router[_0x361b('0x9')](_0x361b('0xe'),auth[_0x361b('0xb')](),controller['getContacts']);router[_0x361b('0xf')]('/',auth['isAuthenticated'](),controller[_0x361b('0x10')]);router['post'](_0x361b('0xe'),auth[_0x361b('0xb')](),controller[_0x361b('0x11')]);router[_0x361b('0x12')](_0x361b('0xc'),auth[_0x361b('0xb')](),controller[_0x361b('0x13')]);router[_0x361b('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 9bf62a7..cd707eb 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 _0x35ed=['sequelize','STRING','INTEGER','lodash'];(function(_0x477dc7,_0x471354){var _0x573a6a=function(_0x3e23b6){while(--_0x3e23b6){_0x477dc7['push'](_0x477dc7['shift']());}};_0x573a6a(++_0x471354);}(_0x35ed,0x15b));var _0xd35e=function(_0x2cff18,_0x18fa3a){_0x2cff18=_0x2cff18-0x0;var _0x58b527=_0x35ed[_0x2cff18];return _0x58b527;};'use strict';var _=require(_0xd35e('0x0'));var Sequelize=require(_0xd35e('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xd35e('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xd35e('0x2')]},'street':{'type':Sequelize[_0xd35e('0x2')]},'postalCode':{'type':Sequelize[_0xd35e('0x2')]},'city':{'type':Sequelize[_0xd35e('0x2')]},'country':{'type':Sequelize[_0xd35e('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xd35e('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd35e('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xd35e('0x2')]},'fb_data':{'type':Sequelize[_0xd35e('0x2')]},'twitter':{'type':Sequelize[_0xd35e('0x2')]},'skype':{'type':Sequelize[_0xd35e('0x2')]},'teams':{'type':Sequelize[_0xd35e('0x2')]},'viber':{'type':Sequelize[_0xd35e('0x2')]},'line':{'type':Sequelize[_0xd35e('0x2')]},'wechat':{'type':Sequelize[_0xd35e('0x2')]},'telegram':{'type':Sequelize[_0xd35e('0x2')]},'UserId':{'type':Sequelize[_0xd35e('0x3')]},'AdditionalPhones':{'type':Sequelize[_0xd35e('0x2')]},'priority':{'type':Sequelize[_0xd35e('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xd35e('0x2')]},'utcOffset':{'type':Sequelize[_0xd35e('0x3')]}}; \ No newline at end of file +var _0x12d3=['NOW','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0xa5c157,_0x5c6652){var _0xe625db=function(_0x3989bf){while(--_0x3989bf){_0xa5c157['push'](_0xa5c157['shift']());}};_0xe625db(++_0x5c6652);}(_0x12d3,0xa9));var _0x312d=function(_0xdf5f14,_0x48aa29){_0xdf5f14=_0xdf5f14-0x0;var _0x39e98a=_0x12d3[_0xdf5f14];return _0x39e98a;};'use strict';var _=require('lodash');var Sequelize=require(_0x312d('0x0'));module[_0x312d('0x1')]={'firstName':{'type':Sequelize[_0x312d('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x312d('0x2')]},'street':{'type':Sequelize[_0x312d('0x2')]},'postalCode':{'type':Sequelize[_0x312d('0x2')]},'city':{'type':Sequelize[_0x312d('0x2')]},'country':{'type':Sequelize[_0x312d('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x312d('0x3')]},'phone':{'type':Sequelize[_0x312d('0x2')]},'mobile':{'type':Sequelize[_0x312d('0x2')]},'fax':{'type':Sequelize[_0x312d('0x2')]},'email':{'type':Sequelize[_0x312d('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x312d('0x2')]},'fb_data':{'type':Sequelize[_0x312d('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x312d('0x2')]},'viber':{'type':Sequelize[_0x312d('0x2')]},'line':{'type':Sequelize[_0x312d('0x2')]},'wechat':{'type':Sequelize[_0x312d('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x312d('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x312d('0x4')](0x2)[_0x312d('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x312d('0x6')],'defaultValue':Sequelize[_0x312d('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x312d('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 49ea807..e54c0a5 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 _0xd76e=['start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','message','getJourney','mail','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','endtime','duration','note','createdAt','userSecondDisposition','userThirdDisposition','fullname','alias','DESC','findAndCountAll','chat','Website','Account','closed','disposition','secondDisposition','thirdDisposition','UserId','color','browserName','customerPort','deviceModel','ratingType','ratingValue','referer','substatus','externalUrl','threadId','Interaction','Owner','flatten','sortBy','reverse','value','slice','bluebird','path','lodash','squel','../../components/contacts','../../components/parsers/qs','../../config/logger','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','stack','name','send','describe','query','user','catch','destroy','find','params','CmContact','tags','keys','length','startsWith','cf_','columnName','displayName','CmCustomField','findAll','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','info','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','CmContactHasItem','ReportAgentPreview','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','create','join','isNil','dialTimezone','timezones','utcOffset','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','additionalPhones','show','Tag','Tags','Phones','ContactItemType','ItemType','literal','omit','$and','pickBy','map','format','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','toParam','sequelize','text','phone','CmHopper','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','options','getTags','nolimit','setTags','ids','setAdditionalPhones','all','OrderBy','items','item_types','ItemTypeId','description','PHONE','CmHopperAdditionalPhone','item','CmHopperId','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','toContactId','hopperId','findOne','include','getHopperHistories','CmHopperHistory','includeAll','rows','getHopperFinals','CmHopperFinal','ContactId','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!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','upload','parse','meta','User','binding','No\x20phone\x20column\x20specified','../../components/import/cm/csv2','stringify'];(function(_0x198035,_0x2ba2c7){var _0x1b86c6=function(_0x4d9b2c){while(--_0x4d9b2c){_0x198035['push'](_0x198035['shift']());}};_0x1b86c6(++_0x2ba2c7);}(_0xd76e,0x137));var _0xed76=function(_0xc49c4d,_0x2fe7a6){_0xc49c4d=_0xc49c4d-0x0;var _0x2a697d=_0xd76e[_0xc49c4d];return _0x2a697d;};'use strict';var moment=require('moment');var BPromise=require(_0xed76('0x0'));var util=require('util');var path=require(_0xed76('0x1'));var fs=require('fs');var _=require(_0xed76('0x2'));var squel=require(_0xed76('0x3'));var Papa=require('papaparse');var Redis=require('ioredis');var contacts=require(_0xed76('0x4'));var qs=require(_0xed76('0x5'));var logger=require(_0xed76('0x6'))('api');var config=require('../../config/environment');var shared=require(_0xed76('0x7'));var db=require('../../mysqldb')['db'];config[_0xed76('0x8')]=_[_0xed76('0x9')](config[_0xed76('0x8')],{'host':_0xed76('0xa'),'port':0x18eb});var socket=require(_0xed76('0xb'))(new Redis(config[_0xed76('0x8')]));require(_0xed76('0xc'))[_0xed76('0xd')](socket);function respondWithResult(_0x3805c2,_0x5b54ac){_0x5b54ac=_0x5b54ac||0xc8;return function(_0x36411d){if(_0x36411d){return _0x3805c2[_0xed76('0xe')](_0x5b54ac)[_0xed76('0xf')](_0x36411d);}};}function respondWithFilteredResult(_0x3b1b86,_0x934ef7){return function(_0x1b1ce2){if(_0x1b1ce2){var _0x14f463=typeof _0x934ef7[_0xed76('0x10')]===_0xed76('0x11')&&typeof _0x934ef7[_0xed76('0x12')]===_0xed76('0x11');var _0xd303af=_0x1b1ce2['count'];var _0x3d250d=_0x14f463?0x0:_0x934ef7[_0xed76('0x10')];var _0x17d2b2=_0x14f463?_0x1b1ce2[_0xed76('0x13')]:_0x934ef7[_0xed76('0x10')]+_0x934ef7[_0xed76('0x12')];var _0x5b11cf;if(_0x17d2b2>=_0xd303af){_0x17d2b2=_0xd303af;_0x5b11cf=0xc8;}else{_0x5b11cf=0xce;}_0x3b1b86[_0xed76('0xe')](_0x5b11cf);return _0x3b1b86[_0xed76('0x14')](_0xed76('0x15'),_0x3d250d+'-'+_0x17d2b2+'/'+_0xd303af)[_0xed76('0xf')](_0x1b1ce2);}return null;};}function saveUpdates(_0x2fc4b1){return function(_0x45a542){if(_0x45a542){return _0x45a542[_0xed76('0x16')](_0x2fc4b1)[_0xed76('0x17')](function(_0x46fe8c){return _0x46fe8c;});}return null;};}function removeEntity(_0x5ecb40){return function(_0x44d7a8){if(_0x44d7a8){return _0x44d7a8['destroy']()[_0xed76('0x17')](function(){_0x5ecb40['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x49a5af){return function(_0x4f6e29){if(!_0x4f6e29){_0x49a5af[_0xed76('0x18')](0x194);}return _0x4f6e29;};}function handleError(_0x37c6d8,_0x5ebfef){_0x5ebfef=_0x5ebfef||0x1f4;return function(_0x3ab93c){logger[_0xed76('0x19')](_0x3ab93c[_0xed76('0x1a')]);if(_0x3ab93c[_0xed76('0x1b')]){delete _0x3ab93c['name'];}_0x37c6d8[_0xed76('0xe')](_0x5ebfef)[_0xed76('0x1c')](_0x3ab93c);};}exports['index']=function(_0x16b15f,_0xeaeee6){var _0x2bc1d4={};return contacts[_0xed76('0x1d')]()['then'](function(_0x420d31){_0x2bc1d4=qs['getOptions'](_0x420d31,_0x16b15f);return contacts['findAll'](_0x16b15f[_0xed76('0x1e')],_0x16b15f[_0xed76('0x1f')],_0x2bc1d4,_0x420d31);})[_0xed76('0x17')](respondWithFilteredResult(_0xeaeee6,_0x2bc1d4))[_0xed76('0x20')](handleError(_0xeaeee6,null));};exports[_0xed76('0x21')]=function(_0x297dd3,_0x555cf8){return db['CmContact'][_0xed76('0x22')]({'where':{'id':_0x297dd3[_0xed76('0x23')]['id']}})['then'](handleEntityNotFound(_0x555cf8,null))[_0xed76('0x17')](removeEntity(_0x555cf8,null))[_0xed76('0x20')](handleError(_0x555cf8,null));};exports[_0xed76('0x1d')]=function(_0x3bc8ad,_0x84e4f5){return db[_0xed76('0x24')]['describe']()[_0xed76('0x17')](function(_0x2393cd){delete _0x2393cd[_0xed76('0x25')];for(var _0x63881=0x0;_0x638810x0){return new Promise(function(_0x144c59){var _0x38eb47=[];for(var _0x5a0fad=0x0;_0x5a0fad<_0xb94927[_0xed76('0x27')];_0x5a0fad++){_0x38eb47[_0xed76('0x56')](insertAdditionalPhones(_0xb94927[_0x5a0fad]['contact'],_0xb94927[_0x5a0fad][_0xed76('0x59')]));}Promise['all'](_0x38eb47)[_0xed76('0x17')](function(){_0x144c59(0x1);});})[_0xed76('0x17')](function(){return{'success':_0x58544d,'failure':_0x36dd99,'duplicates':_0x1a7814};});}else{return{'success':_0x58544d,'failure':_0x36dd99,'duplicates':_0x1a7814};}}})[_0xed76('0x17')](respondWithResult(_0x7e8d26,0xc9))['catch'](handleError(_0x7e8d26,null));};exports[_0xed76('0x5a')]=function(_0x1a2d57,_0x6c81b4){var _0x1d9e16;return db[_0xed76('0x24')][_0xed76('0x1d')]()['then'](function(_0x538544){return db[_0xed76('0x24')][_0xed76('0x22')]({'where':{'id':_0x1a2d57[_0xed76('0x23')]['id']},'include':[{'model':db[_0xed76('0x5b')],'as':_0xed76('0x5c'),'attributes':['id',_0xed76('0x1b'),'color'],'required':_0x1a2d57[_0xed76('0x1e')]['tag']?!![]:![]},{'model':db[_0xed76('0x41')],'as':_0xed76('0x5d'),'where':{'CmContactId':_0x1a2d57[_0xed76('0x23')]['id']},'required':![],'include':[{'model':db[_0xed76('0x5e')],'as':_0xed76('0x5f')}]}],'order':[db['sequelize'][_0xed76('0x60')]('Phones.OrderBy')],'attributes':_[_0xed76('0x26')](_0x538544)});})[_0xed76('0x17')](function(_0x208101){if(!_['isNil'](_0x208101)){_0x1d9e16=_0x208101[_0xed76('0x35')]({'plain':!![]});var _0x215f4d={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x208101&&_0x208101[_0xed76('0x57')]){if(_0x208101[_0xed76('0x57')]){_0x215f4d[_0xed76('0x54')]['$and']['push']({'ListId':{'$ne':_0x208101[_0xed76('0x57')]}});}}return db[_0xed76('0x2c')][_0xed76('0x2d')](_0x215f4d);}})[_0xed76('0x17')](function(_0x41a567){if(!_['isNil'](_0x41a567)){return _[_0xed76('0x61')](_0x1d9e16,_['map'](_0x41a567,function(_0x56ced0){return util['format']('cf_%d',_0x56ced0['id']);}));}})[_0xed76('0x17')](handleEntityNotFound(_0x6c81b4,null))[_0xed76('0x17')](respondWithResult(_0x6c81b4,null))[_0xed76('0x20')](handleError(_0x6c81b4,null));};exports[_0xed76('0x16')]=function(_0x30dcd8,_0x13278c){var _0x2bc00f;if(_0x30dcd8[_0xed76('0x33')]['id']){delete _0x30dcd8[_0xed76('0x33')]['id'];}if(!_[_0xed76('0x4d')](_0x30dcd8[_0xed76('0x33')][_0xed76('0x4e')])){var _0x542cf8=_0x30dcd8[_0xed76('0x33')][_0xed76('0x4e')];if(!_[_0xed76('0x4d')](shared[_0xed76('0x4f')][_0x542cf8]))_0x30dcd8[_0xed76('0x33')][_0xed76('0x50')]=shared['timezones'][_0x542cf8]['utcOffset'];}return db['CmContact'][_0xed76('0x22')]({'where':{'id':_0x30dcd8[_0xed76('0x23')]['id']}})[_0xed76('0x17')](handleEntityNotFound(_0x13278c,null))[_0xed76('0x17')](saveUpdates(_0x30dcd8[_0xed76('0x33')],null))[_0xed76('0x17')](function(_0x51fdd3){_0x2bc00f=_0x51fdd3;var _0x1d87c5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x51fdd3&&_0x51fdd3['ListId']){if(_0x51fdd3[_0xed76('0x57')]){_0x1d87c5[_0xed76('0x54')][_0xed76('0x62')][_0xed76('0x56')]({'ListId':{'$ne':_0x51fdd3[_0xed76('0x57')]}});}}return db[_0xed76('0x2c')][_0xed76('0x2d')](_0x1d87c5);})[_0xed76('0x17')](function(_0x37c260){if(_0x37c260){return _[_0xed76('0x61')](_[_0xed76('0x63')](_0x30dcd8[_0xed76('0x33')],function(_0x592896,_0x4bccbe){return _[_0xed76('0x28')](_0x4bccbe,'cf_');}),_[_0xed76('0x64')](_0x37c260,function(_0x53261f){return util[_0xed76('0x65')]('cf_%d',_0x53261f['id']);}));}})[_0xed76('0x17')](function(_0x4a87c2){if(_0x4a87c2&&!_[_0xed76('0x66')](_0x4a87c2)){var _0x95e366=squel[_0xed76('0x16')]()[_0xed76('0x67')](_0xed76('0x68'))[_0xed76('0x69')](_0x4a87c2)[_0xed76('0x54')](_0xed76('0x6a'),_0x30dcd8['params']['id'])[_0xed76('0x6b')]();return db[_0xed76('0x6c')][_0xed76('0x1e')](_0x95e366[_0xed76('0x6d')],{'replacements':_0x95e366['values']});}})[_0xed76('0x17')](function(){if(_0x30dcd8[_0xed76('0x33')][_0xed76('0x6e')]&&_0x2bc00f){return db[_0xed76('0x6f')][_0xed76('0x16')]({'phone':_0x30dcd8[_0xed76('0x33')][_0xed76('0x6e')],'OrderBy':0x0},{'where':{'ContactId':_0x2bc00f['id']}});}})['then'](function(){return _0x2bc00f;})[_0xed76('0x17')](respondWithResult(_0x13278c,null))[_0xed76('0x20')](handleError(_0x13278c,null));};exports['getTags']=function(_0x210e09,_0x1ab04a){var _0x4003ac={};var _0x4870b2={};var _0x58dec7;var _0x319fb7;return db[_0xed76('0x24')]['findOne']({'where':{'id':_0x210e09[_0xed76('0x23')]['id']}})[_0xed76('0x17')](handleEntityNotFound(_0x1ab04a,null))[_0xed76('0x17')](function(_0x59156c){if(_0x59156c){_0x58dec7=_0x59156c;_0x4870b2[_0xed76('0x70')]=_[_0xed76('0x26')](db['Tag'][_0xed76('0x71')]);_0x4870b2[_0xed76('0x1e')]=_['keys'](_0x210e09[_0xed76('0x1e')]);_0x4870b2[_0xed76('0x72')]=_[_0xed76('0x73')](_0x4870b2[_0xed76('0x70')],_0x4870b2['query']);_0x4003ac[_0xed76('0x74')]=_[_0xed76('0x73')](_0x4870b2['model'],qs['fields'](_0x210e09[_0xed76('0x1e')][_0xed76('0x75')]));_0x4003ac['attributes']=_0x4003ac[_0xed76('0x74')][_0xed76('0x27')]?_0x4003ac[_0xed76('0x74')]:_0x4870b2[_0xed76('0x70')];_0x4003ac[_0xed76('0x76')]=qs['sort'](_0x210e09[_0xed76('0x1e')][_0xed76('0x77')]);_0x4003ac[_0xed76('0x54')]=qs[_0xed76('0x72')](_[_0xed76('0x78')](_0x210e09[_0xed76('0x1e')],_0x4870b2[_0xed76('0x72')]));if(_0x210e09['query'][_0xed76('0x79')]){_0x4003ac['where']=_[_0xed76('0x7a')](_0x4003ac['where'],{'$or':_['map'](_0x4003ac[_0xed76('0x74')],function(_0x385c77){var _0x1e78c2={};_0x1e78c2[_0x385c77]={'$like':'%'+_0x210e09['query'][_0xed76('0x79')]+'%'};return _0x1e78c2;})});}_0x4003ac=_[_0xed76('0x7a')]({},_0x4003ac,_0x210e09[_0xed76('0x7b')]);return _0x58dec7[_0xed76('0x7c')](_0x4003ac);}})[_0xed76('0x17')](function(_0x1ce436){if(_0x1ce436){_0x319fb7=_0x1ce436[_0xed76('0x27')];if(!_0x210e09['query']['hasOwnProperty'](_0xed76('0x7d'))){_0x4003ac[_0xed76('0x12')]=qs[_0xed76('0x12')](_0x210e09['query'][_0xed76('0x12')]);_0x4003ac[_0xed76('0x10')]=qs[_0xed76('0x10')](_0x210e09['query'][_0xed76('0x10')]);}return _0x58dec7['getTags'](_0x4003ac);}})['then'](function(_0x39e56b){if(_0x39e56b){return _0x39e56b?{'count':_0x319fb7,'rows':_0x39e56b}:null;}})[_0xed76('0x17')](respondWithResult(_0x1ab04a,null))['catch'](handleError(_0x1ab04a,null));};exports['setTags']=function(_0x4c6d95,_0x1e30fd){if(_0x4c6d95['body']['id']){delete _0x4c6d95[_0xed76('0x33')]['id'];}return db[_0xed76('0x24')]['findOne']({'where':{'id':_0x4c6d95[_0xed76('0x23')]['id']}})[_0xed76('0x17')](handleEntityNotFound(_0x1e30fd,null))['then'](function(_0x5f0d10){if(_0x5f0d10){return _0x5f0d10[_0xed76('0x7e')](_0x4c6d95[_0xed76('0x33')][_0xed76('0x7f')]||[]);}return null;})['then'](respondWithResult(_0x1e30fd,null))[_0xed76('0x20')](handleError(_0x1e30fd,null));};exports[_0xed76('0x80')]=function(_0x431496,_0x442f4c){var _0x4f44d1=[];_0x4f44d1['push'](addAdditionalPhones(_0x431496[_0xed76('0x33')]));Promise[_0xed76('0x81')](_0x4f44d1)[_0xed76('0x17')](function(){_0x4f44d1=[];_0x4f44d1[_0xed76('0x56')](deleteCmHopperPhones(_0x431496['body']['id']));_0x4f44d1['push'](addCmHopperPhones(_0x431496[_0xed76('0x33')]['id']));Promise[_0xed76('0x81')](_0x4f44d1)[_0xed76('0x17')](function(){return[0x1];})[_0xed76('0x17')](respondWithResult(_0x442f4c,null));});};function addAdditionalPhones(_0x4ee02e){var _0x49ce00;return new Promise(function(_0x16fc54){return db[_0xed76('0x41')][_0xed76('0x21')]({'where':{'CmContactId':_0x4ee02e['id']}})[_0xed76('0x17')](function(){db[_0xed76('0x5e')]['findAll']({'raw':!![],'attributes':['id',_0xed76('0x82')]})[_0xed76('0x17')](function(_0x2cb3df){var _0x1f2081=[];for(var _0x236b79=0x0;_0x236b79<_0x4ee02e[_0xed76('0x83')][_0xed76('0x27')];_0x236b79++){var _0x1daf6b=_0x4ee02e[_0xed76('0x84')]?_[_0xed76('0x4d')](_0x4ee02e['item_types'][_0x236b79])?'':_0x4ee02e[_0xed76('0x84')][_0x236b79]:_0x4ee02e[_0xed76('0x83')][_0x236b79][_0xed76('0x85')]?_0x4ee02e[_0xed76('0x83')][_0x236b79][_0xed76('0x85')]:'';var _0x893d76=_[_0xed76('0x4d')](_0x4ee02e[_0xed76('0x83')][_0x236b79][_0xed76('0x86')])?'':_0x4ee02e[_0xed76('0x83')][_0x236b79][_0xed76('0x86')];var _0x544ffb=_0x1daf6b+':'+_0x4ee02e['items'][_0x236b79][_0xed76('0x6e')]+'§'+_0x893d76;if(_[_0xed76('0x4d')](_0x49ce00))_0x49ce00=_0x544ffb;else _0x49ce00+=';'+_0x544ffb;var _0x12b481=null;var _0x217f81=null;if(_0x4ee02e['item_types']){if(!_[_0xed76('0x4d')](_0x4ee02e[_0xed76('0x84')][_0x236b79])){_0x217f81=_['find'](_0x2cb3df,function(_0x166e4c){return _0x166e4c['id']===_0x4ee02e[_0xed76('0x84')][_0x236b79];});if(!_['isNil'](_0x217f81)){_0x12b481=_0x217f81[_0xed76('0x82')];}}}else{if(!_[_0xed76('0x4d')](_0x4ee02e[_0xed76('0x83')][_0x236b79])){_0x217f81=_[_0xed76('0x22')](_0x2cb3df,function(_0x43453f){return _0x43453f['id']===_0x4ee02e['items'][_0x236b79][_0xed76('0x85')];});if(!_[_0xed76('0x4d')](_0x217f81)){_0x12b481=_0x236b79;}}}if(_['isNil'](_0x12b481)){_0x12b481=0x64;}_0x1f2081['push'](addAdditionalPhone(_0x4ee02e['id'],_0x4ee02e[_0xed76('0x83')][_0x236b79][_0xed76('0x6e')],_0x4ee02e['item_types']?_[_0xed76('0x4d')](_0x4ee02e[_0xed76('0x84')][_0x236b79])?null:_0x4ee02e['item_types'][_0x236b79]:_0x4ee02e['items'][_0x236b79][_0xed76('0x85')]?_0x4ee02e['items'][_0x236b79][_0xed76('0x85')]:null,_0x12b481,_0x893d76));}Promise['all'](_0x1f2081)[_0xed76('0x17')](function(){db[_0xed76('0x24')][_0xed76('0x16')]({'AdditionalPhones':_0x49ce00},{'where':{'id':_0x4ee02e['id']}})[_0xed76('0x17')](function(){_0x16fc54(0x1);});});});});});}function addAdditionalPhone(_0xc119f9,_0x4530fd,_0x3bf1f1,_0x715fc3,_0x12b52b){return db[_0xed76('0x41')][_0xed76('0x22')]({'where':{'CmContactId':_0xc119f9,'item':_0x4530fd}})['then'](function(_0x5f524d){if(_0x5f524d)logger[_0xed76('0x3a')]('contact\x20phone\x20exists',_0x5f524d);else{db[_0xed76('0x41')][_0xed76('0x4b')]({'CmContactId':_0xc119f9,'item':_0x4530fd,'ItemTypeId':_0x3bf1f1,'OrderBy':_0x715fc3,'ItemClass':_0xed76('0x87'),'description':_0x12b52b});}});}function deleteCmHopperPhones(_0xf771ba){return new Promise(function(_0x195a63){return db['CmHopper'][_0xed76('0x2d')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xf771ba}})['then'](function(_0x3fbe61){db[_0xed76('0x88')][_0xed76('0x21')]({'where':{'CmHopperId':{'$in':_[_0xed76('0x64')](_0x3fbe61,'id')}}});})[_0xed76('0x17')](function(){_0x195a63(0x1);});});}function addCmHopperPhones(_0x47a4fb){return new Promise(function(_0x5dc4a0){return db['CmHopper'][_0xed76('0x2d')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x47a4fb}})['then'](function(_0x3692c8){var _0x42a1cf=[];_[_0xed76('0x64')](_0x3692c8,function(_0x1e33f8){_0x42a1cf[_0xed76('0x56')](createCmHopperPhone(_0x47a4fb,_0x1e33f8['id']));});Promise[_0xed76('0x81')](_0x42a1cf)[_0xed76('0x17')](function(){_0x5dc4a0(0x1);});});});}function createCmHopperPhone(_0x5068d9,_0x10b0bb){return new Promise(function(_0x5c99f1){db[_0xed76('0x41')]['findAll']({'raw':!![],'attributes':[_0xed76('0x89'),_0xed76('0x82')],'where':{'CmContactId':_0x5068d9,'ItemClass':'PHONE'},'include':[{'model':db[_0xed76('0x5e')],'attributes':[_0xed76('0x82')],'as':_0xed76('0x5f')}],'order':[_0xed76('0x82'),db['sequelize'][_0xed76('0x60')]('`ItemType`.OrderBy')]})[_0xed76('0x17')](function(_0x4885c6){var _0x3fac27=0x1;var _0x4baccf=_[_0xed76('0x64')](_0x4885c6,function(_0x55eb98){_0x55eb98[_0xed76('0x8a')]=_0x10b0bb;_0x55eb98[_0xed76('0x6e')]=_0x55eb98[_0xed76('0x89')];_0x55eb98[_0xed76('0x82')]=_0x3fac27;delete _0x55eb98['ItemType.OrderBy'];_0x3fac27=_0x3fac27+0x1;return _0x55eb98;});return db[_0xed76('0x88')][_0xed76('0x51')](_0x4baccf,{});})[_0xed76('0x17')](function(){_0x5c99f1(0x1);});});}function insertAdditionalPhones(_0x2a5390,_0x56b84d){return new Promise(function(_0x199f67){var _0x50cf9d=[];for(var _0xaf61ed=0x0;_0xaf61ed<_0x56b84d[_0xed76('0x27')];_0xaf61ed++){var _0x3c00a6=_0x56b84d[_0xaf61ed];_0x50cf9d['push'](parseContactItemType(_0x3c00a6));}Promise[_0xed76('0x81')](_0x50cf9d)[_0xed76('0x17')](function(){var _0x5bc4cb={'id':_0x2a5390['id'],'items':_0x56b84d};return addAdditionalPhones(_0x5bc4cb)['then'](function(){return addCmHopperPhones(_0x2a5390['id']);});})[_0xed76('0x17')](function(){_0x199f67(_0x2a5390);});});}function parseContactItemType(_0x52f156){return new Promise(function(_0x2a1601){if(_0x52f156[_0xed76('0x32')](_0xed76('0x85'))){_0x2a1601(_0x52f156);}else{return db['ContactItemType']['find']({'where':{'name':_0x52f156[_0xed76('0x5f')]}})[_0xed76('0x17')](function(_0x189d4f){if(_[_0xed76('0x4d')](_0x189d4f))_0x52f156[_0xed76('0x85')]=null;else _0x52f156[_0xed76('0x85')]=_0x189d4f['id'];_0x2a1601(_0x52f156);});}});}exports[_0xed76('0x8b')]=function(_0x1e5e08,_0x240a45){return db[_0xed76('0x41')][_0xed76('0x2d')]({'raw':!![],'where':{'CmContactId':_0x1e5e08[_0xed76('0x23')]['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0xed76('0x5e')],'as':_0xed76('0x5f')}],'order':[[_0xed76('0x82')],[db['sequelize'][_0xed76('0x60')]('`ItemType`.OrderBy')]]})[_0xed76('0x17')](function(_0x1f2dcf){return _0x1f2dcf;})[_0xed76('0x17')](respondWithResult(_0x240a45,null))['catch'](handleError(_0x240a45,null));};exports[_0xed76('0x8c')]=function(_0x40dfaf,_0x4d0e64){return db[_0xed76('0x41')][_0xed76('0x2d')]({'raw':!![],'where':{'CmContactId':_0x40dfaf[_0xed76('0x33')][_0xed76('0x8d')]}})[_0xed76('0x17')](function(_0x3257ce){var _0x535531=_[_0xed76('0x64')](_0x3257ce,function(_0x3ed01a){_0x3ed01a['CmContactId']=_0x40dfaf[_0xed76('0x33')][_0xed76('0x8e')];return _0x3ed01a;});return db[_0xed76('0x41')]['bulkCreate'](_0x535531,{});})[_0xed76('0x17')](function(){return addCmHopperPhones(_0x40dfaf[_0xed76('0x33')][_0xed76('0x8e')]);})['then'](function(){return['ok'];})[_0xed76('0x17')](respondWithResult(_0x4d0e64,null))[_0xed76('0x20')](handleError(_0x4d0e64,null));};exports['rescheduleAdditionalPhones']=function(_0x49fd3d,_0xbeac50){var _0x1ad72a=[];_0x1ad72a[_0xed76('0x56')](createCmHopperPhone(_0x49fd3d[_0xed76('0x33')]['id'],_0x49fd3d[_0xed76('0x33')][_0xed76('0x8f')]));Promise[_0xed76('0x81')](_0x1ad72a)['then'](function(){return[0x1];})['then'](respondWithResult(_0xbeac50,null));};exports['getHoppers']=function(_0x461049,_0x1b94e5){var _0x303425={'raw':![],'where':{}};var _0x2b192e={};var _0x57cc72={'count':0x0,'rows':[]};return db['CmContact'][_0xed76('0x90')]({'where':{'id':_0x461049[_0xed76('0x23')]['id']}})[_0xed76('0x17')](handleEntityNotFound(_0x1b94e5,null))[_0xed76('0x17')](function(_0x4bf117){if(_0x4bf117){_0x2b192e[_0xed76('0x70')]=_[_0xed76('0x26')](db[_0xed76('0x6f')][_0xed76('0x71')]);_0x2b192e[_0xed76('0x1e')]=_[_0xed76('0x26')](_0x461049[_0xed76('0x1e')]);_0x2b192e[_0xed76('0x72')]=_[_0xed76('0x73')](_0x2b192e[_0xed76('0x70')],_0x2b192e['query']);_0x303425[_0xed76('0x74')]=_[_0xed76('0x73')](_0x2b192e['model'],qs[_0xed76('0x75')](_0x461049[_0xed76('0x1e')][_0xed76('0x75')]));_0x303425[_0xed76('0x74')]=_0x303425['attributes'][_0xed76('0x27')]?_0x303425['attributes']:_0x2b192e[_0xed76('0x70')];if(!_0x461049['query'][_0xed76('0x32')](_0xed76('0x7d'))){_0x303425[_0xed76('0x12')]=qs[_0xed76('0x12')](_0x461049[_0xed76('0x1e')][_0xed76('0x12')]);_0x303425[_0xed76('0x10')]=qs[_0xed76('0x10')](_0x461049['query'][_0xed76('0x10')]);}_0x303425['order']=qs[_0xed76('0x77')](_0x461049[_0xed76('0x1e')][_0xed76('0x77')]);_0x303425[_0xed76('0x54')]=qs[_0xed76('0x72')](_[_0xed76('0x78')](_0x461049[_0xed76('0x1e')],_0x2b192e[_0xed76('0x72')]));_0x303425[_0xed76('0x54')]['ContactId']=_0x4bf117['id'];if(_0x461049[_0xed76('0x1e')][_0xed76('0x79')]){_0x303425['where']=_[_0xed76('0x7a')](_0x303425[_0xed76('0x54')],{'$or':_[_0xed76('0x64')](_0x303425[_0xed76('0x74')],function(_0x5803ab){var _0x49b58e={};_0x49b58e[_0x5803ab]={'$like':'%'+_0x461049[_0xed76('0x1e')][_0xed76('0x79')]+'%'};return _0x49b58e;})});}_0x303425=_['merge']({},_0x303425,_0x461049[_0xed76('0x7b')]);return db[_0xed76('0x6f')][_0xed76('0x13')]({'where':_0x303425[_0xed76('0x54')]})[_0xed76('0x17')](function(_0x4b78f3){_0x57cc72['count']=_0x4b78f3;if(_0x461049[_0xed76('0x1e')]['includeAll']){_0x303425[_0xed76('0x91')]=[{'all':!![]}];}return db[_0xed76('0x6f')][_0xed76('0x2d')](_0x303425);})[_0xed76('0x17')](function(_0x155bf4){_0x57cc72['rows']=_0x155bf4;return _0x57cc72;});}})['then'](respondWithFilteredResult(_0x1b94e5,_0x303425))[_0xed76('0x20')](handleError(_0x1b94e5,null));};exports[_0xed76('0x92')]=function(_0x39c226,_0x323c92){var _0x3ae106={'raw':!![],'where':{}};var _0x16cf97={};var _0x51d669={'count':0x0,'rows':[]};return db[_0xed76('0x24')][_0xed76('0x90')]({'where':{'id':_0x39c226['params']['id']}})['then'](handleEntityNotFound(_0x323c92,null))[_0xed76('0x17')](function(_0x383b1e){if(_0x383b1e){_0x16cf97[_0xed76('0x70')]=_[_0xed76('0x26')](db[_0xed76('0x93')][_0xed76('0x71')]);_0x16cf97['query']=_[_0xed76('0x26')](_0x39c226[_0xed76('0x1e')]);_0x16cf97['filters']=_['intersection'](_0x16cf97[_0xed76('0x70')],_0x16cf97[_0xed76('0x1e')]);_0x3ae106[_0xed76('0x74')]=_['intersection'](_0x16cf97[_0xed76('0x70')],qs[_0xed76('0x75')](_0x39c226[_0xed76('0x1e')][_0xed76('0x75')]));_0x3ae106[_0xed76('0x74')]=_0x3ae106['attributes']['length']?_0x3ae106['attributes']:_0x16cf97[_0xed76('0x70')];if(!_0x39c226[_0xed76('0x1e')][_0xed76('0x32')]('nolimit')){_0x3ae106['limit']=qs[_0xed76('0x12')](_0x39c226[_0xed76('0x1e')][_0xed76('0x12')]);_0x3ae106[_0xed76('0x10')]=qs[_0xed76('0x10')](_0x39c226[_0xed76('0x1e')][_0xed76('0x10')]);}_0x3ae106[_0xed76('0x76')]=qs[_0xed76('0x77')](_0x39c226['query'][_0xed76('0x77')]);_0x3ae106['where']=qs[_0xed76('0x72')](_[_0xed76('0x78')](_0x39c226[_0xed76('0x1e')],_0x16cf97[_0xed76('0x72')]));_0x3ae106[_0xed76('0x54')]['ContactId']=_0x383b1e['id'];if(_0x39c226[_0xed76('0x1e')]['filter']){_0x3ae106[_0xed76('0x54')]=_[_0xed76('0x7a')](_0x3ae106[_0xed76('0x54')],{'$or':_[_0xed76('0x64')](_0x3ae106[_0xed76('0x74')],function(_0x3fd675){var _0x22c5b4={};_0x22c5b4[_0x3fd675]={'$like':'%'+_0x39c226['query'][_0xed76('0x79')]+'%'};return _0x22c5b4;})});}_0x3ae106=_['merge']({},_0x3ae106,_0x39c226[_0xed76('0x7b')]);return db['CmHopperHistory'][_0xed76('0x13')]({'where':_0x3ae106[_0xed76('0x54')]})['then'](function(_0x581ded){_0x51d669[_0xed76('0x13')]=_0x581ded;if(_0x39c226[_0xed76('0x1e')][_0xed76('0x94')]){_0x3ae106[_0xed76('0x91')]=[{'all':!![]}];}return db[_0xed76('0x93')][_0xed76('0x2d')](_0x3ae106);})['then'](function(_0x34aed9){_0x51d669[_0xed76('0x95')]=_0x34aed9;return _0x51d669;});}})[_0xed76('0x17')](respondWithFilteredResult(_0x323c92,_0x3ae106))[_0xed76('0x20')](handleError(_0x323c92,null));};exports[_0xed76('0x96')]=function(_0x3b39a2,_0x54c901){var _0x155377={'raw':!![],'where':{}};var _0x493bfa={};var _0x20b5c6={'count':0x0,'rows':[]};return db[_0xed76('0x24')][_0xed76('0x90')]({'where':{'id':_0x3b39a2[_0xed76('0x23')]['id']}})[_0xed76('0x17')](handleEntityNotFound(_0x54c901,null))[_0xed76('0x17')](function(_0x1b1492){if(_0x1b1492){_0x493bfa[_0xed76('0x70')]=_[_0xed76('0x26')](db[_0xed76('0x97')]['rawAttributes']);_0x493bfa[_0xed76('0x1e')]=_[_0xed76('0x26')](_0x3b39a2['query']);_0x493bfa[_0xed76('0x72')]=_['intersection'](_0x493bfa['model'],_0x493bfa[_0xed76('0x1e')]);_0x155377[_0xed76('0x74')]=_[_0xed76('0x73')](_0x493bfa[_0xed76('0x70')],qs[_0xed76('0x75')](_0x3b39a2[_0xed76('0x1e')]['fields']));_0x155377[_0xed76('0x74')]=_0x155377['attributes'][_0xed76('0x27')]?_0x155377[_0xed76('0x74')]:_0x493bfa[_0xed76('0x70')];if(!_0x3b39a2['query']['hasOwnProperty'](_0xed76('0x7d'))){_0x155377[_0xed76('0x12')]=qs['limit'](_0x3b39a2[_0xed76('0x1e')]['limit']);_0x155377[_0xed76('0x10')]=qs[_0xed76('0x10')](_0x3b39a2[_0xed76('0x1e')]['offset']);}_0x155377[_0xed76('0x76')]=qs[_0xed76('0x77')](_0x3b39a2[_0xed76('0x1e')][_0xed76('0x77')]);_0x155377['where']=qs[_0xed76('0x72')](_[_0xed76('0x78')](_0x3b39a2[_0xed76('0x1e')],_0x493bfa[_0xed76('0x72')]));_0x155377[_0xed76('0x54')][_0xed76('0x98')]=_0x1b1492['id'];if(_0x3b39a2[_0xed76('0x1e')][_0xed76('0x79')]){_0x155377[_0xed76('0x54')]=_[_0xed76('0x7a')](_0x155377[_0xed76('0x54')],{'$or':_[_0xed76('0x64')](_0x155377[_0xed76('0x74')],function(_0x15d5a0){var _0x45c014={};_0x45c014[_0x15d5a0]={'$like':'%'+_0x3b39a2[_0xed76('0x1e')][_0xed76('0x79')]+'%'};return _0x45c014;})});}_0x155377=_[_0xed76('0x7a')]({},_0x155377,_0x3b39a2[_0xed76('0x7b')]);return db['CmHopperFinal'][_0xed76('0x13')]({'where':_0x155377[_0xed76('0x54')]})[_0xed76('0x17')](function(_0x3ff211){_0x20b5c6['count']=_0x3ff211;if(_0x3b39a2[_0xed76('0x1e')][_0xed76('0x94')]){_0x155377[_0xed76('0x91')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xed76('0x2d')](_0x155377);})['then'](function(_0x3f3f29){_0x20b5c6[_0xed76('0x95')]=_0x3f3f29;return _0x20b5c6;});}})[_0xed76('0x17')](respondWithFilteredResult(_0x54c901,_0x155377))[_0xed76('0x20')](handleError(_0x54c901,null));};exports['getJscriptySessions']=function(_0x20e079,_0x22dc13){var _0x2abf35={'raw':!![],'where':{}};var _0x3f8ec4={};var _0x469e3f={'count':0x0,'rows':[]};return db[_0xed76('0x24')]['findOne']({'where':{'id':_0x20e079[_0xed76('0x23')]['id']}})[_0xed76('0x17')](handleEntityNotFound(_0x22dc13,null))[_0xed76('0x17')](function(_0x2da1ee){if(_0x2da1ee){_0x3f8ec4[_0xed76('0x70')]=_[_0xed76('0x26')](db[_0xed76('0x48')][_0xed76('0x71')]);_0x3f8ec4[_0xed76('0x1e')]=_['keys'](_0x20e079['query']);_0x3f8ec4[_0xed76('0x72')]=_[_0xed76('0x73')](_0x3f8ec4[_0xed76('0x70')],_0x3f8ec4[_0xed76('0x1e')]);_0x2abf35[_0xed76('0x74')]=_['intersection'](_0x3f8ec4[_0xed76('0x70')],qs[_0xed76('0x75')](_0x20e079[_0xed76('0x1e')][_0xed76('0x75')]));_0x2abf35[_0xed76('0x74')]=_0x2abf35['attributes'][_0xed76('0x27')]?_0x2abf35['attributes']:_0x3f8ec4[_0xed76('0x70')];if(!_0x20e079[_0xed76('0x1e')][_0xed76('0x32')](_0xed76('0x7d'))){_0x2abf35['limit']=qs[_0xed76('0x12')](_0x20e079[_0xed76('0x1e')]['limit']);_0x2abf35[_0xed76('0x10')]=qs['offset'](_0x20e079[_0xed76('0x1e')][_0xed76('0x10')]);}_0x2abf35['order']=qs[_0xed76('0x77')](_0x20e079[_0xed76('0x1e')][_0xed76('0x77')]);_0x2abf35['where']=qs[_0xed76('0x72')](_[_0xed76('0x78')](_0x20e079[_0xed76('0x1e')],_0x3f8ec4[_0xed76('0x72')]));_0x2abf35['where'][_0xed76('0x98')]=_0x2da1ee['id'];if(_0x20e079[_0xed76('0x1e')][_0xed76('0x79')]){_0x2abf35[_0xed76('0x54')]=_[_0xed76('0x7a')](_0x2abf35[_0xed76('0x54')],{'$or':_['map'](_0x2abf35[_0xed76('0x74')],function(_0x310a38){var _0x20ae32={};_0x20ae32[_0x310a38]={'$like':'%'+_0x20e079['query'][_0xed76('0x79')]+'%'};return _0x20ae32;})});}_0x2abf35=_[_0xed76('0x7a')]({},_0x2abf35,_0x20e079[_0xed76('0x7b')]);return db['JscriptySessionReport'][_0xed76('0x13')]({'where':_0x2abf35[_0xed76('0x54')]})['then'](function(_0x51d640){_0x469e3f[_0xed76('0x13')]=_0x51d640;if(_0x20e079[_0xed76('0x1e')][_0xed76('0x94')]){_0x2abf35['include']=[{'all':!![]}];}return db[_0xed76('0x48')][_0xed76('0x2d')](_0x2abf35);})[_0xed76('0x17')](function(_0x4a22d3){_0x469e3f[_0xed76('0x95')]=_0x4a22d3;return _0x469e3f;});}})[_0xed76('0x17')](respondWithFilteredResult(_0x22dc13,_0x2abf35))['catch'](handleError(_0x22dc13,null));};exports[_0xed76('0x99')]=function(_0x4471b5,_0x31e91a){try{if(!_0x4471b5['body'][_0xed76('0x57')]){throw new Error(_0xed76('0x9a'));}if(!_0x4471b5['body'][_0xed76('0x9b')]){throw new Error(_0xed76('0x9c'));}if(!_0x4471b5['body'][_0xed76('0x9d')]){throw new Error(_0xed76('0x9e'));}if(!_0x4471b5['body'][_0xed76('0x9f')]){throw new Error(_0xed76('0xa0'));}var _0x3d6b20=_0x4471b5['body'][_0xed76('0x9b')]['split'](',');var _0x513b62=_0x4471b5[_0xed76('0x33')][_0xed76('0x9d')][_0xed76('0xa1')](',');if(!_0x3d6b20[_0xed76('0x27')]||!_0x513b62[_0xed76('0x27')]||_0x3d6b20[_0xed76('0x27')]!==_0x513b62[_0xed76('0x27')]){throw new Error(_0xed76('0xa2'));}_0x4471b5[_0xed76('0x33')][_0xed76('0x75')]=_[_0xed76('0xa3')](_0x3d6b20,_0x513b62);if(!_0x4471b5[_0xed76('0x33')]['fields'][_0xed76('0x6e')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x4471b5[_0xed76('0x33')][_0xed76('0x75')][_0xed76('0xa4')]){throw new Error(_0xed76('0xa5'));}var _0x21c4cf=path[_0xed76('0x4c')](config[_0xed76('0xa6')],'server/files/tmp',_0x4471b5[_0xed76('0xa7')]['filename']);fs[_0xed76('0xa8')](_0x21c4cf,parseInt(_0xed76('0xa9'),0x8));var _0x3dbfb4=require(_0xed76('0xaa'))[_0xed76('0xab')](path[_0xed76('0x4c')](__dirname,_0xed76('0xac')),[_0x21c4cf,_0x4471b5[_0xed76('0x33')]['binding_keys'],_0x4471b5[_0xed76('0x33')][_0xed76('0x9d')],_0x4471b5[_0xed76('0x33')][_0xed76('0x57')],_0x4471b5[_0xed76('0x33')][_0xed76('0xad')],_0x4471b5[_0xed76('0x33')][_0xed76('0x53')],_0x4471b5[_0xed76('0x33')][_0xed76('0x9f')]]);return _0x31e91a[_0xed76('0xe')](0xc8)[_0xed76('0xf')]({'message':_0xed76('0xae'),'pid':_0x3dbfb4['pid']});}catch(_0x4f9126){return _0x31e91a[_0xed76('0xe')](0x1f4)['send'](_0x4f9126);}};exports[_0xed76('0xaf')]=function(_0x46088d,_0x42e529){var _0xd69a96=fs['createReadStream'](_0x46088d[_0xed76('0xa7')]['path']);Papa[_0xed76('0xb0')](_0xd69a96,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x2e7143){return _0x42e529[_0xed76('0xe')](0xc8)['json']({'file':_0x46088d['file'],'fields':_0x2e7143[_0xed76('0xb1')][_0xed76('0x75')]});}});};exports['import']=function(_0x5a16e0,_0x343a8a){return db[_0xed76('0xb2')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0xed76('0x17')](function(_0x196874){var _0x58bfa7=![];if(!_0x5a16e0[_0xed76('0x33')][_0xed76('0x57')]){throw new Error(_0xed76('0x9a'));}if(!_0x5a16e0['body'][_0xed76('0xb3')][_0xed76('0x6e')]){throw new Error(_0xed76('0xb4'));}if(!_0x5a16e0[_0xed76('0x33')][_0xed76('0xb3')][_0xed76('0xa4')]){throw new Error(_0xed76('0xa5'));}if(!_0x5a16e0[_0xed76('0x33')][_0xed76('0x9f')]){throw new Error(_0xed76('0xa0'));}var _0x5c2c16=require(_0xed76('0xaa'))[_0xed76('0xab')](path[_0xed76('0x4c')](__dirname,_0xed76('0xb5')),[_0x5a16e0[_0xed76('0x23')]['id'],JSON[_0xed76('0xb6')](_0x5a16e0[_0xed76('0x33')]),JSON[_0xed76('0xb6')](_0x196874)]);_0x5c2c16['on']('message',function(){_0x58bfa7=!![];return _0x343a8a[_0xed76('0xe')](0xc8)['json']({'message':_0xed76('0xb7'),'pid':_0x5c2c16[_0xed76('0xb8')]});});_0x5c2c16['on'](_0xed76('0xb9'),function(_0x5ef57a){if(_0x5ef57a&&!_0x58bfa7){return _0x343a8a[_0xed76('0xe')](0x1f4)[_0xed76('0xf')]({'message':_0xed76('0xba'),'pid':_0x5c2c16['pid']});}});})[_0xed76('0x20')](handleError(_0x343a8a,null));};exports[_0xed76('0xbb')]=function(_0x466947,_0x385130){return db['User'][_0xed76('0x2d')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0xed76('0x17')](function(_0x42fa12){var _0x194704=![];if(!_0x466947['body']['ListId']){throw new Error(_0xed76('0x9a'));}if(!_0x466947[_0xed76('0x33')][_0xed76('0xb3')][_0xed76('0x6e')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x466947[_0xed76('0x33')]['binding'][_0xed76('0xa4')]){throw new Error(_0xed76('0xa5'));}if(!_0x466947[_0xed76('0x33')][_0xed76('0x9f')]){throw new Error(_0xed76('0xa0'));}var _0x16b506=require(_0xed76('0xaa'))[_0xed76('0xab')](path['join'](__dirname,_0xed76('0xbc')),[_0x466947['params']['id'],JSON['stringify'](_0x466947[_0xed76('0x33')]),JSON['stringify'](_0x42fa12)]);_0x16b506['on'](_0xed76('0xbd'),function(){_0x194704=!![];return _0x385130[_0xed76('0xe')](0xc8)[_0xed76('0xf')]({'message':_0xed76('0xb7'),'pid':_0x16b506[_0xed76('0xb8')]});});_0x16b506['on'](_0xed76('0xb9'),function(_0x26e118){if(_0x26e118&&!_0x194704){return _0x385130['status'](0x1f4)[_0xed76('0xf')]({'message':_0xed76('0xba'),'pid':_0x16b506['pid']});}});})[_0xed76('0x20')](handleError(_0x385130,null));};exports[_0xed76('0xbe')]=function(_0x442908,_0x55245f){var _0x2e3c97=[_0xed76('0xbf'),'chat',_0xed76('0xc0'),_0xed76('0xc1'),_0xed76('0xc2'),_0xed76('0xc3'),_0xed76('0xc4')];var _0x1c2ec6={'offset':0x0,'order':qs[_0xed76('0x77')](_0xed76('0xc5'))},_0x3e4aa1={'count':0x0,'rows':[]};Promise[_0xed76('0xc6')]()[_0xed76('0x17')](function(){if(_0x442908[_0xed76('0x1e')][_0xed76('0xc7')]){if(!_[_0xed76('0xc8')](_0x2e3c97,_0x442908['query']['channel'][_0xed76('0xc9')]())){throw new Error(_0xed76('0xca'));}_0x2e3c97=[_0x442908['query'][_0xed76('0xc7')]['toLowerCase']()];}if(_0x442908[_0xed76('0x1e')][_0xed76('0xcb')]){try{var _0x39348b=JSON[_0xed76('0xb0')](_0x442908[_0xed76('0x1e')][_0xed76('0xcb')]);if(!moment(_0x39348b[_0xed76('0x34')])[_0xed76('0xcc')]()){throw new Error(_0xed76('0xcd'));}if(!moment(_0x39348b['to'])[_0xed76('0xcc')]()){throw new Error(_0xed76('0xce'));}}catch(_0x166786){throw new Error(_0xed76('0xcf'));}}if(!_0x442908[_0xed76('0x1e')]['hasOwnProperty'](_0xed76('0x7d'))){_0x1c2ec6[_0xed76('0x12')]=qs['limit'](_0x442908[_0xed76('0x1e')][_0xed76('0x12')]||0xa);_0x1c2ec6[_0xed76('0x10')]=qs[_0xed76('0x10')](_0x442908['query'][_0xed76('0x10')]);}var _0x59ea37=_0x2e3c97[_0xed76('0x64')](function(_0x4f5808){if(_0x4f5808===_0xed76('0xc4')){var _0xbbc94f={'attributes':['id','uniqueid',_0xed76('0x2f'),_0xed76('0xd0'),_0xed76('0xd1'),_0xed76('0xd2'),_0xed76('0xd3'),_0xed76('0xd4'),_0xed76('0xd5'),_0xed76('0xd6'),_0xed76('0xd7'),'userDisposition',_0xed76('0xd8'),_0xed76('0xd9'),'UserId'],'where':{'ContactId':_0x442908[_0xed76('0x23')]['id']},'include':[{'model':db[_0xed76('0xb2')],'as':'User','attributes':['id',_0xed76('0x1b'),_0xed76('0xda'),_0xed76('0xdb')]}],'order':[[_0xed76('0xd7'),_0xed76('0xdc')]]};if(_0x442908[_0xed76('0x1e')][_0xed76('0xcb')]){_0xbbc94f['where'][_0xed76('0xd7')]={'$gte':_0x39348b['from'],'$lte':_0x39348b['to']};}return db['VoiceCallReport'][_0xed76('0xdd')](_0xbbc94f)[_0xed76('0x17')](function(_0x1c6205){_0x3e4aa1[_0xed76('0x13')]+=_0x1c6205[_0xed76('0x13')];return _[_0xed76('0x64')](_0x1c6205[_0xed76('0x95')],function(_0x1b9d5b){var _0x5d18d9=_0x1b9d5b['get']({'plain':!![]});_0x5d18d9['channel']=_0x4f5808;if(_0x5d18d9[_0xed76('0xb2')]){_0x5d18d9[_0xed76('0xb2')]={'id':_0x5d18d9[_0xed76('0xb2')]['id'],'name':_0x5d18d9[_0xed76('0xb2')]['name'],'fullname':_0x5d18d9[_0xed76('0xb2')][_0xed76('0xda')],'alias':_0x5d18d9[_0xed76('0xb2')][_0xed76('0xdb')]};}return _0x5d18d9;});});}else{var _0x27569a=_['startCase'](_0x4f5808)+(_0x4f5808===_0xed76('0xde')?_0xed76('0xdf'):_0xed76('0xe0'));var _0x52d84f={'attributes':['id',_0xed76('0xe1'),'closedAt',_0xed76('0xd7'),'note',_0xed76('0xe2'),_0xed76('0xe3'),_0xed76('0xe4'),_0xed76('0xe5'),_0x27569a+'Id'],'where':{'ContactId':_0x442908[_0xed76('0x23')]['id']},'include':[{'model':db[_0x27569a],'as':_0xed76('0xe0'),'attributes':['id','name','key']},{'model':db['User'],'as':'Owner','attributes':['id',_0xed76('0x1b'),_0xed76('0xda')]},{'model':db[_0xed76('0x5b')],'as':_0xed76('0x5c'),'attributes':['id',_0xed76('0x1b'),_0xed76('0xe6')],'through':{'attributes':[]}}],'order':[[_0xed76('0xd7'),_0xed76('0xdc')]]};if(_0x442908[_0xed76('0x1e')][_0xed76('0xcb')]){_0x52d84f['where'][_0xed76('0xd7')]={'$gte':_0x39348b[_0xed76('0x34')],'$lte':_0x39348b['to']};}switch(_0x4f5808){case'chat':_0x52d84f['attributes']['push'](_0xed76('0xe7'),'customerIp',_0xed76('0xe8'),_0xed76('0xe9'),'osName','ratingMessage',_0xed76('0xea'),_0xed76('0xeb'),_0xed76('0xec'));break;case'mail':_0x52d84f['attributes'][_0xed76('0x56')]('subject',_0xed76('0xed'));break;case _0xed76('0xc1'):_0x52d84f[_0xed76('0x74')][_0xed76('0x56')](_0xed76('0xee'),_0xed76('0xef'));break;}return db[_['startCase'](_0x4f5808)+_0xed76('0xf0')][_0xed76('0xdd')](_0x52d84f)[_0xed76('0x17')](function(_0x134d26){_0x3e4aa1[_0xed76('0x13')]+=_0x134d26[_0xed76('0x13')];return _[_0xed76('0x64')](_0x134d26[_0xed76('0x95')],function(_0x242ca9){var _0x196cc7=_0x242ca9[_0xed76('0x35')]({'plain':!![]});_0x196cc7[_0xed76('0xc7')]=_0x4f5808;if(_0x196cc7['Owner']){_0x196cc7[_0xed76('0xf1')]={'id':_0x196cc7[_0xed76('0xf1')]['id'],'name':_0x196cc7[_0xed76('0xf1')][_0xed76('0x1b')],'fullname':_0x196cc7[_0xed76('0xf1')][_0xed76('0xda')]};}return _0x196cc7;});});}});return Promise[_0xed76('0x81')](_0x59ea37);})['then'](function(_0x48fd94){return _(_0x48fd94)[_0xed76('0xf2')]()[_0xed76('0xf3')](_0xed76('0xd7'))[_0xed76('0xf4')]()[_0xed76('0xf5')]();})[_0xed76('0x17')](function(_0x40b645){_0x3e4aa1[_0xed76('0x95')]=_0x1c2ec6['limit']?_0x40b645[_0xed76('0xf6')](_0x1c2ec6[_0xed76('0x10')],_0x1c2ec6[_0xed76('0x10')]+_0x1c2ec6[_0xed76('0x12')]):_0x40b645;return _0x3e4aa1;})['then'](respondWithFilteredResult(_0x55245f,_0x1c2ec6))[_0xed76('0x20')](handleError(_0x55245f,null));}; \ No newline at end of file +var _0x79e8=['cm_contacts','setFields','id\x20=\x20?','values','findOne','model','rawAttributes','intersection','attributes','fields','order','sort','filters','pick','options','getTags','nolimit','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','phone','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','PHONE','`ItemType`.OrderBy','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','ContactId','filter','includeAll','include','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','file','filename','chmodSync','0777','child_process','../../components/import/cm/csv','CompanyId','socket_timestamp','pid','upload','parse','meta','User','agent','No\x20ListId\x20specified','binding','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','mail','sms','fax','whatsapp','voice','-createdAt','resolve','includes','channel','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','uniqueid','source','destination','callerid','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','findAndCountAll','fullname','startCase','chat','Website','closed','disposition','secondDisposition','thirdDisposition','Account','DESC','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','Interaction','Owner','sortBy','reverse','value','slice','moment','bluebird','path','lodash','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/environment/shared','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','json','offset','undefined','limit','count','status','set','Content-Range','update','then','destroy','end','sendStatus','name','send','describe','getOptions','findAll','user','catch','CmContact','find','params','tags','keys','startsWith','columnName','displayName','query','CmCustomField','length','cf_','alias','type','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','ListId','findOrCreate','spread','push','contact','all','Tag','Tags','color','tag','ContactItemType','ItemType','sequelize','literal','isNil','$and','omit','format','cf_%d','pickBy','map','isEmpty'];(function(_0x58fd8a,_0x471cf6){var _0x5f566=function(_0xe751a){while(--_0xe751a){_0x58fd8a['push'](_0x58fd8a['shift']());}};_0x5f566(++_0x471cf6);}(_0x79e8,0x184));var _0x879e=function(_0x27a331,_0x5ee322){_0x27a331=_0x27a331-0x0;var _0x2cf773=_0x79e8[_0x27a331];return _0x2cf773;};'use strict';var moment=require(_0x879e('0x0'));var BPromise=require(_0x879e('0x1'));var util=require('util');var path=require(_0x879e('0x2'));var fs=require('fs');var _=require(_0x879e('0x3'));var squel=require('squel');var Papa=require(_0x879e('0x4'));var Redis=require(_0x879e('0x5'));var contacts=require(_0x879e('0x6'));var qs=require(_0x879e('0x7'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var shared=require(_0x879e('0x8'));var db=require(_0x879e('0x9'))['db'];config[_0x879e('0xa')]=_['defaults'](config[_0x879e('0xa')],{'host':_0x879e('0xb'),'port':0x18eb});var socket=require(_0x879e('0xc'))(new Redis(config['redis']));require(_0x879e('0xd'))[_0x879e('0xe')](socket);function respondWithResult(_0x501863,_0x5248e2){_0x5248e2=_0x5248e2||0xc8;return function(_0x3e25d2){if(_0x3e25d2){return _0x501863['status'](_0x5248e2)[_0x879e('0xf')](_0x3e25d2);}};}function respondWithFilteredResult(_0x410c4a,_0x3e1bca){return function(_0x1a9917){if(_0x1a9917){var _0x267d03=typeof _0x3e1bca[_0x879e('0x10')]===_0x879e('0x11')&&typeof _0x3e1bca[_0x879e('0x12')]===_0x879e('0x11');var _0x2f9d14=_0x1a9917[_0x879e('0x13')];var _0x4df5e1=_0x267d03?0x0:_0x3e1bca['offset'];var _0x1577f3=_0x267d03?_0x1a9917[_0x879e('0x13')]:_0x3e1bca[_0x879e('0x10')]+_0x3e1bca[_0x879e('0x12')];var _0x2a757c;if(_0x1577f3>=_0x2f9d14){_0x1577f3=_0x2f9d14;_0x2a757c=0xc8;}else{_0x2a757c=0xce;}_0x410c4a[_0x879e('0x14')](_0x2a757c);return _0x410c4a[_0x879e('0x15')](_0x879e('0x16'),_0x4df5e1+'-'+_0x1577f3+'/'+_0x2f9d14)[_0x879e('0xf')](_0x1a9917);}return null;};}function saveUpdates(_0x1a9110){return function(_0x275744){if(_0x275744){return _0x275744[_0x879e('0x17')](_0x1a9110)[_0x879e('0x18')](function(_0x2eff56){return _0x2eff56;});}return null;};}function removeEntity(_0x2dbb93){return function(_0x7e7926){if(_0x7e7926){return _0x7e7926[_0x879e('0x19')]()[_0x879e('0x18')](function(){_0x2dbb93[_0x879e('0x14')](0xcc)[_0x879e('0x1a')]();});}};}function handleEntityNotFound(_0x983675){return function(_0x3b3be2){if(!_0x3b3be2){_0x983675[_0x879e('0x1b')](0x194);}return _0x3b3be2;};}function handleError(_0x84e371,_0x502934){_0x502934=_0x502934||0x1f4;return function(_0x59d1bb){logger['error'](_0x59d1bb['stack']);if(_0x59d1bb[_0x879e('0x1c')]){delete _0x59d1bb[_0x879e('0x1c')];}_0x84e371['status'](_0x502934)[_0x879e('0x1d')](_0x59d1bb);};}exports['index']=function(_0x196011,_0x441d87){var _0x27563a={};return contacts[_0x879e('0x1e')]()[_0x879e('0x18')](function(_0x3d775a){_0x27563a=qs[_0x879e('0x1f')](_0x3d775a,_0x196011);return contacts[_0x879e('0x20')](_0x196011['query'],_0x196011[_0x879e('0x21')],_0x27563a,_0x3d775a);})[_0x879e('0x18')](respondWithFilteredResult(_0x441d87,_0x27563a))[_0x879e('0x22')](handleError(_0x441d87,null));};exports[_0x879e('0x19')]=function(_0x224e71,_0x2b8720){return db[_0x879e('0x23')][_0x879e('0x24')]({'where':{'id':_0x224e71[_0x879e('0x25')]['id']}})[_0x879e('0x18')](handleEntityNotFound(_0x2b8720,null))[_0x879e('0x18')](removeEntity(_0x2b8720,null))['catch'](handleError(_0x2b8720,null));};exports['describe']=function(_0x3faf38,_0x1ad852){return db[_0x879e('0x23')][_0x879e('0x1e')]()[_0x879e('0x18')](function(_0x3ac393){delete _0x3ac393[_0x879e('0x26')];for(var _0x32440f=0x0;_0x32440f0x0){return new Promise(function(_0x25938d){var _0x2c9010=[];for(var _0x47de3e=0x0;_0x47de3e<_0xdf265d['length'];_0x47de3e++){_0x2c9010[_0x879e('0x5f')](insertAdditionalPhones(_0xdf265d[_0x47de3e][_0x879e('0x60')],_0xdf265d[_0x47de3e][_0x879e('0x56')]));}Promise[_0x879e('0x61')](_0x2c9010)['then'](function(){_0x25938d(0x1);});})[_0x879e('0x18')](function(){return{'success':_0x3bb67e,'failure':_0x26564a,'duplicates':_0x2d7ee8};});}else{return{'success':_0x3bb67e,'failure':_0x26564a,'duplicates':_0x2d7ee8};}}})[_0x879e('0x18')](respondWithResult(_0x101b51,0xc9))[_0x879e('0x22')](handleError(_0x101b51,null));};exports['show']=function(_0x1069e2,_0x451b30){var _0x3cca77;return db['CmContact'][_0x879e('0x1e')]()[_0x879e('0x18')](function(_0x5bb571){return db[_0x879e('0x23')][_0x879e('0x24')]({'where':{'id':_0x1069e2[_0x879e('0x25')]['id']},'include':[{'model':db[_0x879e('0x62')],'as':_0x879e('0x63'),'attributes':['id','name',_0x879e('0x64')],'required':_0x1069e2[_0x879e('0x2b')][_0x879e('0x65')]?!![]:![]},{'model':db['CmContactHasItem'],'as':'Phones','where':{'CmContactId':_0x1069e2[_0x879e('0x25')]['id']},'required':![],'include':[{'model':db[_0x879e('0x66')],'as':_0x879e('0x67')}]}],'order':[db[_0x879e('0x68')][_0x879e('0x69')]('Phones.OrderBy')],'attributes':_['keys'](_0x5bb571)});})[_0x879e('0x18')](function(_0xf25639){if(!_[_0x879e('0x6a')](_0xf25639)){_0x3cca77=_0xf25639[_0x879e('0x38')]({'plain':!![]});var _0x49464e={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf25639&&_0xf25639[_0x879e('0x5c')]){if(_0xf25639['ListId']){_0x49464e[_0x879e('0x5a')][_0x879e('0x6b')][_0x879e('0x5f')]({'ListId':{'$ne':_0xf25639[_0x879e('0x5c')]}});}}return db['CmCustomField'][_0x879e('0x20')](_0x49464e);}})['then'](function(_0x36b2d2){if(!_[_0x879e('0x6a')](_0x36b2d2)){return _[_0x879e('0x6c')](_0x3cca77,_['map'](_0x36b2d2,function(_0x29c59d){return util[_0x879e('0x6d')](_0x879e('0x6e'),_0x29c59d['id']);}));}})[_0x879e('0x18')](handleEntityNotFound(_0x451b30,null))['then'](respondWithResult(_0x451b30,null))[_0x879e('0x22')](handleError(_0x451b30,null));};exports['update']=function(_0x3bcc16,_0x57bd86){var _0x14351c;if(_0x3bcc16['body']['id']){delete _0x3bcc16[_0x879e('0x36')]['id'];}if(!_[_0x879e('0x6a')](_0x3bcc16[_0x879e('0x36')][_0x879e('0x53')])){var _0x24f8cf=_0x3bcc16[_0x879e('0x36')]['dialTimezone'];if(!_[_0x879e('0x6a')](shared[_0x879e('0x54')][_0x24f8cf]))_0x3bcc16['body']['utcOffset']=shared[_0x879e('0x54')][_0x24f8cf][_0x879e('0x55')];}return db['CmContact'][_0x879e('0x24')]({'where':{'id':_0x3bcc16[_0x879e('0x25')]['id']}})[_0x879e('0x18')](handleEntityNotFound(_0x57bd86,null))[_0x879e('0x18')](saveUpdates(_0x3bcc16[_0x879e('0x36')],null))['then'](function(_0x19d320){_0x14351c=_0x19d320;var _0x250ea6={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x19d320&&_0x19d320[_0x879e('0x5c')]){if(_0x19d320[_0x879e('0x5c')]){_0x250ea6['where'][_0x879e('0x6b')][_0x879e('0x5f')]({'ListId':{'$ne':_0x19d320[_0x879e('0x5c')]}});}}return db[_0x879e('0x2c')][_0x879e('0x20')](_0x250ea6);})[_0x879e('0x18')](function(_0x46f22f){if(_0x46f22f){return _[_0x879e('0x6c')](_[_0x879e('0x6f')](_0x3bcc16[_0x879e('0x36')],function(_0x448ca4,_0x168923){return _['startsWith'](_0x168923,_0x879e('0x2e'));}),_[_0x879e('0x70')](_0x46f22f,function(_0x1bbb3a){return util[_0x879e('0x6d')](_0x879e('0x6e'),_0x1bbb3a['id']);}));}})['then'](function(_0x6419a0){if(_0x6419a0&&!_[_0x879e('0x71')](_0x6419a0)){var _0x2aea85=squel[_0x879e('0x17')]()['table'](_0x879e('0x72'))[_0x879e('0x73')](_0x6419a0)['where'](_0x879e('0x74'),_0x3bcc16[_0x879e('0x25')]['id'])['toParam']();return db['sequelize'][_0x879e('0x2b')](_0x2aea85['text'],{'replacements':_0x2aea85[_0x879e('0x75')]});}})[_0x879e('0x18')](function(){if(_0x3bcc16[_0x879e('0x36')]['phone']&&_0x14351c){return db[_0x879e('0x3d')][_0x879e('0x17')]({'phone':_0x3bcc16[_0x879e('0x36')]['phone'],'OrderBy':0x0},{'where':{'ContactId':_0x14351c['id']}});}})[_0x879e('0x18')](function(){return _0x14351c;})[_0x879e('0x18')](respondWithResult(_0x57bd86,null))['catch'](handleError(_0x57bd86,null));};exports['getTags']=function(_0x430145,_0x5351c1){var _0x55e199={};var _0x262b8d={};var _0x403d24;var _0xd7147b;return db[_0x879e('0x23')][_0x879e('0x76')]({'where':{'id':_0x430145[_0x879e('0x25')]['id']}})[_0x879e('0x18')](handleEntityNotFound(_0x5351c1,null))[_0x879e('0x18')](function(_0xf5b4df){if(_0xf5b4df){_0x403d24=_0xf5b4df;_0x262b8d[_0x879e('0x77')]=_[_0x879e('0x27')](db[_0x879e('0x62')][_0x879e('0x78')]);_0x262b8d[_0x879e('0x2b')]=_['keys'](_0x430145[_0x879e('0x2b')]);_0x262b8d['filters']=_[_0x879e('0x79')](_0x262b8d[_0x879e('0x77')],_0x262b8d['query']);_0x55e199[_0x879e('0x7a')]=_[_0x879e('0x79')](_0x262b8d[_0x879e('0x77')],qs[_0x879e('0x7b')](_0x430145[_0x879e('0x2b')][_0x879e('0x7b')]));_0x55e199['attributes']=_0x55e199[_0x879e('0x7a')][_0x879e('0x2d')]?_0x55e199[_0x879e('0x7a')]:_0x262b8d[_0x879e('0x77')];_0x55e199[_0x879e('0x7c')]=qs[_0x879e('0x7d')](_0x430145[_0x879e('0x2b')][_0x879e('0x7d')]);_0x55e199[_0x879e('0x5a')]=qs[_0x879e('0x7e')](_[_0x879e('0x7f')](_0x430145[_0x879e('0x2b')],_0x262b8d[_0x879e('0x7e')]));if(_0x430145[_0x879e('0x2b')]['filter']){_0x55e199[_0x879e('0x5a')]=_[_0x879e('0x35')](_0x55e199[_0x879e('0x5a')],{'$or':_['map'](_0x55e199[_0x879e('0x7a')],function(_0x1b6530){var _0x5d98f1={};_0x5d98f1[_0x1b6530]={'$like':'%'+_0x430145[_0x879e('0x2b')]['filter']+'%'};return _0x5d98f1;})});}_0x55e199=_[_0x879e('0x35')]({},_0x55e199,_0x430145[_0x879e('0x80')]);return _0x403d24[_0x879e('0x81')](_0x55e199);}})[_0x879e('0x18')](function(_0x545c45){if(_0x545c45){_0xd7147b=_0x545c45[_0x879e('0x2d')];if(!_0x430145[_0x879e('0x2b')][_0x879e('0x34')](_0x879e('0x82'))){_0x55e199[_0x879e('0x12')]=qs[_0x879e('0x12')](_0x430145[_0x879e('0x2b')][_0x879e('0x12')]);_0x55e199[_0x879e('0x10')]=qs[_0x879e('0x10')](_0x430145[_0x879e('0x2b')][_0x879e('0x10')]);}return _0x403d24[_0x879e('0x81')](_0x55e199);}})[_0x879e('0x18')](function(_0x918e94){if(_0x918e94){return _0x918e94?{'count':_0xd7147b,'rows':_0x918e94}:null;}})[_0x879e('0x18')](respondWithResult(_0x5351c1,null))[_0x879e('0x22')](handleError(_0x5351c1,null));};exports['setTags']=function(_0x4b13fe,_0x131eb6){if(_0x4b13fe[_0x879e('0x36')]['id']){delete _0x4b13fe[_0x879e('0x36')]['id'];}return db[_0x879e('0x23')][_0x879e('0x76')]({'where':{'id':_0x4b13fe[_0x879e('0x25')]['id']}})[_0x879e('0x18')](handleEntityNotFound(_0x131eb6,null))['then'](function(_0x546a00){if(_0x546a00){return _0x546a00['setTags'](_0x4b13fe[_0x879e('0x36')]['ids']||[]);}return null;})[_0x879e('0x18')](respondWithResult(_0x131eb6,null))[_0x879e('0x22')](handleError(_0x131eb6,null));};exports[_0x879e('0x83')]=function(_0x1c4e00,_0x45caf1){var _0x1ca9b0=[];_0x1ca9b0['push'](addAdditionalPhones(_0x1c4e00[_0x879e('0x36')]));Promise[_0x879e('0x61')](_0x1ca9b0)['then'](function(){_0x1ca9b0=[];_0x1ca9b0[_0x879e('0x5f')](deleteCmHopperPhones(_0x1c4e00['body']['id']));_0x1ca9b0['push'](addCmHopperPhones(_0x1c4e00[_0x879e('0x36')]['id']));Promise['all'](_0x1ca9b0)[_0x879e('0x18')](function(){return[0x1];})[_0x879e('0x18')](respondWithResult(_0x45caf1,null));});};function addAdditionalPhones(_0x54987c){var _0x471c56;return new Promise(function(_0x516b83){return db[_0x879e('0x4b')][_0x879e('0x19')]({'where':{'CmContactId':_0x54987c['id']}})[_0x879e('0x18')](function(){db['ContactItemType'][_0x879e('0x20')]({'raw':!![],'attributes':['id',_0x879e('0x84')]})['then'](function(_0x19e78a){var _0x5c0410=[];for(var _0x359a10=0x0;_0x359a10<_0x54987c[_0x879e('0x85')][_0x879e('0x2d')];_0x359a10++){var _0x37a2e8=_0x54987c[_0x879e('0x86')]?_[_0x879e('0x6a')](_0x54987c[_0x879e('0x86')][_0x359a10])?'':_0x54987c[_0x879e('0x86')][_0x359a10]:_0x54987c['items'][_0x359a10][_0x879e('0x87')]?_0x54987c[_0x879e('0x85')][_0x359a10]['ItemTypeId']:'';var _0x2cc696=_[_0x879e('0x6a')](_0x54987c[_0x879e('0x85')][_0x359a10]['description'])?'':_0x54987c[_0x879e('0x85')][_0x359a10][_0x879e('0x88')];var _0x3773ea=_0x37a2e8+':'+_0x54987c['items'][_0x359a10][_0x879e('0x89')]+'§'+_0x2cc696;if(_[_0x879e('0x6a')](_0x471c56))_0x471c56=_0x3773ea;else _0x471c56+=';'+_0x3773ea;var _0xb753bd=null;var _0x316b95=null;if(_0x54987c['item_types']){if(!_[_0x879e('0x6a')](_0x54987c['item_types'][_0x359a10])){_0x316b95=_[_0x879e('0x24')](_0x19e78a,function(_0x40b817){return _0x40b817['id']===_0x54987c['item_types'][_0x359a10];});if(!_[_0x879e('0x6a')](_0x316b95)){_0xb753bd=_0x316b95[_0x879e('0x84')];}}}else{if(!_[_0x879e('0x6a')](_0x54987c['items'][_0x359a10])){_0x316b95=_['find'](_0x19e78a,function(_0x573b1c){return _0x573b1c['id']===_0x54987c[_0x879e('0x85')][_0x359a10][_0x879e('0x87')];});if(!_[_0x879e('0x6a')](_0x316b95)){_0xb753bd=_0x359a10;}}}if(_[_0x879e('0x6a')](_0xb753bd)){_0xb753bd=0x64;}_0x5c0410[_0x879e('0x5f')](addAdditionalPhone(_0x54987c['id'],_0x54987c['items'][_0x359a10]['phone'],_0x54987c[_0x879e('0x86')]?_['isNil'](_0x54987c['item_types'][_0x359a10])?null:_0x54987c[_0x879e('0x86')][_0x359a10]:_0x54987c['items'][_0x359a10]['ItemTypeId']?_0x54987c[_0x879e('0x85')][_0x359a10]['ItemTypeId']:null,_0xb753bd,_0x2cc696));}Promise[_0x879e('0x61')](_0x5c0410)[_0x879e('0x18')](function(){db[_0x879e('0x23')][_0x879e('0x17')]({'AdditionalPhones':_0x471c56},{'where':{'id':_0x54987c['id']}})[_0x879e('0x18')](function(){_0x516b83(0x1);});});});});});}function addAdditionalPhone(_0x72739f,_0x54981d,_0xba2b12,_0x2af2ba,_0x400a0b){return db[_0x879e('0x4b')][_0x879e('0x24')]({'where':{'CmContactId':_0x72739f,'item':_0x54981d}})[_0x879e('0x18')](function(_0x2df207){if(_0x2df207)logger[_0x879e('0x31')](_0x879e('0x8a'),_0x2df207);else{db[_0x879e('0x4b')][_0x879e('0x40')]({'CmContactId':_0x72739f,'item':_0x54981d,'ItemTypeId':_0xba2b12,'OrderBy':_0x2af2ba,'ItemClass':'PHONE','description':_0x400a0b});}});}function deleteCmHopperPhones(_0x56dd5a){return new Promise(function(_0x3de6d2){return db[_0x879e('0x3d')][_0x879e('0x20')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x56dd5a}})['then'](function(_0x3b53df){db[_0x879e('0x8b')][_0x879e('0x19')]({'where':{'CmHopperId':{'$in':_['map'](_0x3b53df,'id')}}});})[_0x879e('0x18')](function(){_0x3de6d2(0x1);});});}function addCmHopperPhones(_0x4a74d3){return new Promise(function(_0x4539af){return db[_0x879e('0x3d')][_0x879e('0x20')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4a74d3}})[_0x879e('0x18')](function(_0x4cdb9e){var _0x2c0dbb=[];_['map'](_0x4cdb9e,function(_0x3d886a){_0x2c0dbb['push'](createCmHopperPhone(_0x4a74d3,_0x3d886a['id']));});Promise['all'](_0x2c0dbb)[_0x879e('0x18')](function(){_0x4539af(0x1);});});});}function createCmHopperPhone(_0x381819,_0x3fbef0){return new Promise(function(_0x5ad679){db[_0x879e('0x4b')]['findAll']({'raw':!![],'attributes':[_0x879e('0x8c'),_0x879e('0x84')],'where':{'CmContactId':_0x381819,'ItemClass':_0x879e('0x8d')},'include':[{'model':db[_0x879e('0x66')],'attributes':[_0x879e('0x84')],'as':_0x879e('0x67')}],'order':['OrderBy',db[_0x879e('0x68')][_0x879e('0x69')](_0x879e('0x8e'))]})[_0x879e('0x18')](function(_0x51ec1b){var _0x42c7a5=0x1;var _0x58678e=_['map'](_0x51ec1b,function(_0x2c3647){_0x2c3647['CmHopperId']=_0x3fbef0;_0x2c3647[_0x879e('0x89')]=_0x2c3647[_0x879e('0x8c')];_0x2c3647[_0x879e('0x84')]=_0x42c7a5;delete _0x2c3647[_0x879e('0x8f')];_0x42c7a5=_0x42c7a5+0x1;return _0x2c3647;});return db[_0x879e('0x8b')][_0x879e('0x57')](_0x58678e,{});})[_0x879e('0x18')](function(){_0x5ad679(0x1);});});}function insertAdditionalPhones(_0x16119b,_0x1a18c2){return new Promise(function(_0x1d80d9){var _0x190081=[];for(var _0x38d15b=0x0;_0x38d15b<_0x1a18c2[_0x879e('0x2d')];_0x38d15b++){var _0x47c552=_0x1a18c2[_0x38d15b];_0x190081[_0x879e('0x5f')](parseContactItemType(_0x47c552));}Promise[_0x879e('0x61')](_0x190081)[_0x879e('0x18')](function(){var _0x4c7d59={'id':_0x16119b['id'],'items':_0x1a18c2};return addAdditionalPhones(_0x4c7d59)[_0x879e('0x18')](function(){return addCmHopperPhones(_0x16119b['id']);});})[_0x879e('0x18')](function(){_0x1d80d9(_0x16119b);});});}function parseContactItemType(_0xc6a76d){return new Promise(function(_0x3bfd41){if(_0xc6a76d['hasOwnProperty'](_0x879e('0x87'))){_0x3bfd41(_0xc6a76d);}else{return db[_0x879e('0x66')]['find']({'where':{'name':_0xc6a76d[_0x879e('0x67')]}})[_0x879e('0x18')](function(_0x3fa65f){if(_[_0x879e('0x6a')](_0x3fa65f))_0xc6a76d[_0x879e('0x87')]=null;else _0xc6a76d[_0x879e('0x87')]=_0x3fa65f['id'];_0x3bfd41(_0xc6a76d);});}});}exports[_0x879e('0x90')]=function(_0x56bf26,_0x4c5325){return db[_0x879e('0x4b')][_0x879e('0x20')]({'raw':!![],'where':{'CmContactId':_0x56bf26[_0x879e('0x25')]['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0x879e('0x66')],'as':_0x879e('0x67')}],'order':[[_0x879e('0x84')],[db[_0x879e('0x68')][_0x879e('0x69')](_0x879e('0x8e'))]]})[_0x879e('0x18')](function(_0x36a9af){return _0x36a9af;})[_0x879e('0x18')](respondWithResult(_0x4c5325,null))[_0x879e('0x22')](handleError(_0x4c5325,null));};exports[_0x879e('0x91')]=function(_0x5a5e89,_0x25bb75){return db['CmContactHasItem']['findAll']({'raw':!![],'where':{'CmContactId':_0x5a5e89[_0x879e('0x36')][_0x879e('0x92')]}})['then'](function(_0x1bc4d0){var _0x2514e1=_[_0x879e('0x70')](_0x1bc4d0,function(_0x1b086f){_0x1b086f[_0x879e('0x93')]=_0x5a5e89['body'][_0x879e('0x94')];return _0x1b086f;});return db['CmContactHasItem'][_0x879e('0x57')](_0x2514e1,{});})['then'](function(){return addCmHopperPhones(_0x5a5e89[_0x879e('0x36')]['toContactId']);})[_0x879e('0x18')](function(){return['ok'];})[_0x879e('0x18')](respondWithResult(_0x25bb75,null))[_0x879e('0x22')](handleError(_0x25bb75,null));};exports[_0x879e('0x95')]=function(_0x48eb6f,_0x122ea3){var _0x1f28e7=[];_0x1f28e7[_0x879e('0x5f')](createCmHopperPhone(_0x48eb6f['body']['id'],_0x48eb6f[_0x879e('0x36')]['hopperId']));Promise[_0x879e('0x61')](_0x1f28e7)[_0x879e('0x18')](function(){return[0x1];})[_0x879e('0x18')](respondWithResult(_0x122ea3,null));};exports[_0x879e('0x96')]=function(_0x239ace,_0x36e479){var _0x195880={'raw':![],'where':{}};var _0x3e9854={};var _0x7a7ae2={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x239ace[_0x879e('0x25')]['id']}})[_0x879e('0x18')](handleEntityNotFound(_0x36e479,null))['then'](function(_0x5bbfc3){if(_0x5bbfc3){_0x3e9854['model']=_[_0x879e('0x27')](db[_0x879e('0x3d')]['rawAttributes']);_0x3e9854['query']=_[_0x879e('0x27')](_0x239ace[_0x879e('0x2b')]);_0x3e9854[_0x879e('0x7e')]=_['intersection'](_0x3e9854['model'],_0x3e9854[_0x879e('0x2b')]);_0x195880['attributes']=_[_0x879e('0x79')](_0x3e9854[_0x879e('0x77')],qs['fields'](_0x239ace[_0x879e('0x2b')][_0x879e('0x7b')]));_0x195880[_0x879e('0x7a')]=_0x195880[_0x879e('0x7a')][_0x879e('0x2d')]?_0x195880['attributes']:_0x3e9854[_0x879e('0x77')];if(!_0x239ace['query']['hasOwnProperty'](_0x879e('0x82'))){_0x195880[_0x879e('0x12')]=qs[_0x879e('0x12')](_0x239ace[_0x879e('0x2b')][_0x879e('0x12')]);_0x195880[_0x879e('0x10')]=qs[_0x879e('0x10')](_0x239ace[_0x879e('0x2b')][_0x879e('0x10')]);}_0x195880[_0x879e('0x7c')]=qs[_0x879e('0x7d')](_0x239ace[_0x879e('0x2b')]['sort']);_0x195880[_0x879e('0x5a')]=qs[_0x879e('0x7e')](_[_0x879e('0x7f')](_0x239ace[_0x879e('0x2b')],_0x3e9854[_0x879e('0x7e')]));_0x195880[_0x879e('0x5a')][_0x879e('0x97')]=_0x5bbfc3['id'];if(_0x239ace[_0x879e('0x2b')][_0x879e('0x98')]){_0x195880[_0x879e('0x5a')]=_['merge'](_0x195880['where'],{'$or':_[_0x879e('0x70')](_0x195880[_0x879e('0x7a')],function(_0xa8c610){var _0x307714={};_0x307714[_0xa8c610]={'$like':'%'+_0x239ace[_0x879e('0x2b')][_0x879e('0x98')]+'%'};return _0x307714;})});}_0x195880=_['merge']({},_0x195880,_0x239ace[_0x879e('0x80')]);return db[_0x879e('0x3d')][_0x879e('0x13')]({'where':_0x195880[_0x879e('0x5a')]})[_0x879e('0x18')](function(_0x9c0ea6){_0x7a7ae2[_0x879e('0x13')]=_0x9c0ea6;if(_0x239ace['query'][_0x879e('0x99')]){_0x195880[_0x879e('0x9a')]=[{'all':!![]}];}return db[_0x879e('0x3d')][_0x879e('0x20')](_0x195880);})['then'](function(_0x2fcc1b){_0x7a7ae2[_0x879e('0x9b')]=_0x2fcc1b;return _0x7a7ae2;});}})['then'](respondWithFilteredResult(_0x36e479,_0x195880))[_0x879e('0x22')](handleError(_0x36e479,null));};exports[_0x879e('0x9c')]=function(_0x104ac8,_0x336b69){var _0x1b7114={'raw':!![],'where':{}};var _0x1ffbaa={};var _0x2e253b={'count':0x0,'rows':[]};return db[_0x879e('0x23')][_0x879e('0x76')]({'where':{'id':_0x104ac8[_0x879e('0x25')]['id']}})[_0x879e('0x18')](handleEntityNotFound(_0x336b69,null))[_0x879e('0x18')](function(_0x53364f){if(_0x53364f){_0x1ffbaa[_0x879e('0x77')]=_['keys'](db[_0x879e('0x9d')][_0x879e('0x78')]);_0x1ffbaa['query']=_['keys'](_0x104ac8['query']);_0x1ffbaa[_0x879e('0x7e')]=_['intersection'](_0x1ffbaa[_0x879e('0x77')],_0x1ffbaa['query']);_0x1b7114[_0x879e('0x7a')]=_[_0x879e('0x79')](_0x1ffbaa[_0x879e('0x77')],qs[_0x879e('0x7b')](_0x104ac8['query']['fields']));_0x1b7114['attributes']=_0x1b7114[_0x879e('0x7a')][_0x879e('0x2d')]?_0x1b7114[_0x879e('0x7a')]:_0x1ffbaa[_0x879e('0x77')];if(!_0x104ac8[_0x879e('0x2b')][_0x879e('0x34')]('nolimit')){_0x1b7114[_0x879e('0x12')]=qs[_0x879e('0x12')](_0x104ac8['query'][_0x879e('0x12')]);_0x1b7114[_0x879e('0x10')]=qs['offset'](_0x104ac8[_0x879e('0x2b')]['offset']);}_0x1b7114[_0x879e('0x7c')]=qs[_0x879e('0x7d')](_0x104ac8[_0x879e('0x2b')][_0x879e('0x7d')]);_0x1b7114['where']=qs[_0x879e('0x7e')](_[_0x879e('0x7f')](_0x104ac8[_0x879e('0x2b')],_0x1ffbaa[_0x879e('0x7e')]));_0x1b7114['where']['ContactId']=_0x53364f['id'];if(_0x104ac8[_0x879e('0x2b')][_0x879e('0x98')]){_0x1b7114[_0x879e('0x5a')]=_[_0x879e('0x35')](_0x1b7114[_0x879e('0x5a')],{'$or':_['map'](_0x1b7114[_0x879e('0x7a')],function(_0x4cc8d4){var _0x5a1fa2={};_0x5a1fa2[_0x4cc8d4]={'$like':'%'+_0x104ac8[_0x879e('0x2b')][_0x879e('0x98')]+'%'};return _0x5a1fa2;})});}_0x1b7114=_['merge']({},_0x1b7114,_0x104ac8[_0x879e('0x80')]);return db[_0x879e('0x9d')][_0x879e('0x13')]({'where':_0x1b7114[_0x879e('0x5a')]})[_0x879e('0x18')](function(_0x19c33c){_0x2e253b['count']=_0x19c33c;if(_0x104ac8[_0x879e('0x2b')][_0x879e('0x99')]){_0x1b7114[_0x879e('0x9a')]=[{'all':!![]}];}return db[_0x879e('0x9d')][_0x879e('0x20')](_0x1b7114);})[_0x879e('0x18')](function(_0x1c8f0c){_0x2e253b[_0x879e('0x9b')]=_0x1c8f0c;return _0x2e253b;});}})[_0x879e('0x18')](respondWithFilteredResult(_0x336b69,_0x1b7114))['catch'](handleError(_0x336b69,null));};exports[_0x879e('0x9e')]=function(_0x3085d4,_0x389c1d){var _0x48d77a={'raw':!![],'where':{}};var _0x54581c={};var _0x3601e2={'count':0x0,'rows':[]};return db[_0x879e('0x23')][_0x879e('0x76')]({'where':{'id':_0x3085d4[_0x879e('0x25')]['id']}})[_0x879e('0x18')](handleEntityNotFound(_0x389c1d,null))[_0x879e('0x18')](function(_0x2d22cc){if(_0x2d22cc){_0x54581c[_0x879e('0x77')]=_['keys'](db[_0x879e('0x9f')][_0x879e('0x78')]);_0x54581c[_0x879e('0x2b')]=_[_0x879e('0x27')](_0x3085d4[_0x879e('0x2b')]);_0x54581c[_0x879e('0x7e')]=_[_0x879e('0x79')](_0x54581c[_0x879e('0x77')],_0x54581c[_0x879e('0x2b')]);_0x48d77a[_0x879e('0x7a')]=_[_0x879e('0x79')](_0x54581c[_0x879e('0x77')],qs[_0x879e('0x7b')](_0x3085d4['query'][_0x879e('0x7b')]));_0x48d77a['attributes']=_0x48d77a[_0x879e('0x7a')][_0x879e('0x2d')]?_0x48d77a[_0x879e('0x7a')]:_0x54581c[_0x879e('0x77')];if(!_0x3085d4[_0x879e('0x2b')][_0x879e('0x34')]('nolimit')){_0x48d77a[_0x879e('0x12')]=qs[_0x879e('0x12')](_0x3085d4[_0x879e('0x2b')][_0x879e('0x12')]);_0x48d77a[_0x879e('0x10')]=qs[_0x879e('0x10')](_0x3085d4[_0x879e('0x2b')][_0x879e('0x10')]);}_0x48d77a[_0x879e('0x7c')]=qs['sort'](_0x3085d4['query']['sort']);_0x48d77a[_0x879e('0x5a')]=qs[_0x879e('0x7e')](_[_0x879e('0x7f')](_0x3085d4[_0x879e('0x2b')],_0x54581c[_0x879e('0x7e')]));_0x48d77a[_0x879e('0x5a')][_0x879e('0x97')]=_0x2d22cc['id'];if(_0x3085d4[_0x879e('0x2b')][_0x879e('0x98')]){_0x48d77a[_0x879e('0x5a')]=_[_0x879e('0x35')](_0x48d77a[_0x879e('0x5a')],{'$or':_['map'](_0x48d77a[_0x879e('0x7a')],function(_0xc6a7){var _0x53b935={};_0x53b935[_0xc6a7]={'$like':'%'+_0x3085d4[_0x879e('0x2b')][_0x879e('0x98')]+'%'};return _0x53b935;})});}_0x48d77a=_[_0x879e('0x35')]({},_0x48d77a,_0x3085d4[_0x879e('0x80')]);return db['CmHopperFinal'][_0x879e('0x13')]({'where':_0x48d77a[_0x879e('0x5a')]})[_0x879e('0x18')](function(_0x5a1c53){_0x3601e2[_0x879e('0x13')]=_0x5a1c53;if(_0x3085d4[_0x879e('0x2b')][_0x879e('0x99')]){_0x48d77a[_0x879e('0x9a')]=[{'all':!![]}];}return db[_0x879e('0x9f')][_0x879e('0x20')](_0x48d77a);})[_0x879e('0x18')](function(_0x122c89){_0x3601e2[_0x879e('0x9b')]=_0x122c89;return _0x3601e2;});}})['then'](respondWithFilteredResult(_0x389c1d,_0x48d77a))[_0x879e('0x22')](handleError(_0x389c1d,null));};exports[_0x879e('0xa0')]=function(_0x3e291d,_0x19962e){var _0x4442eb={'raw':!![],'where':{}};var _0x10445a={};var _0xe6a4f7={'count':0x0,'rows':[]};return db['CmContact'][_0x879e('0x76')]({'where':{'id':_0x3e291d[_0x879e('0x25')]['id']}})[_0x879e('0x18')](handleEntityNotFound(_0x19962e,null))[_0x879e('0x18')](function(_0x37ffe2){if(_0x37ffe2){_0x10445a[_0x879e('0x77')]=_[_0x879e('0x27')](db[_0x879e('0x50')][_0x879e('0x78')]);_0x10445a[_0x879e('0x2b')]=_[_0x879e('0x27')](_0x3e291d[_0x879e('0x2b')]);_0x10445a['filters']=_['intersection'](_0x10445a[_0x879e('0x77')],_0x10445a[_0x879e('0x2b')]);_0x4442eb[_0x879e('0x7a')]=_[_0x879e('0x79')](_0x10445a['model'],qs['fields'](_0x3e291d['query']['fields']));_0x4442eb[_0x879e('0x7a')]=_0x4442eb['attributes'][_0x879e('0x2d')]?_0x4442eb[_0x879e('0x7a')]:_0x10445a[_0x879e('0x77')];if(!_0x3e291d[_0x879e('0x2b')][_0x879e('0x34')](_0x879e('0x82'))){_0x4442eb[_0x879e('0x12')]=qs[_0x879e('0x12')](_0x3e291d['query'][_0x879e('0x12')]);_0x4442eb[_0x879e('0x10')]=qs[_0x879e('0x10')](_0x3e291d[_0x879e('0x2b')][_0x879e('0x10')]);}_0x4442eb[_0x879e('0x7c')]=qs[_0x879e('0x7d')](_0x3e291d['query'][_0x879e('0x7d')]);_0x4442eb[_0x879e('0x5a')]=qs['filters'](_['pick'](_0x3e291d['query'],_0x10445a['filters']));_0x4442eb[_0x879e('0x5a')][_0x879e('0x97')]=_0x37ffe2['id'];if(_0x3e291d['query'][_0x879e('0x98')]){_0x4442eb[_0x879e('0x5a')]=_['merge'](_0x4442eb['where'],{'$or':_[_0x879e('0x70')](_0x4442eb[_0x879e('0x7a')],function(_0x4c1d3c){var _0x26a39c={};_0x26a39c[_0x4c1d3c]={'$like':'%'+_0x3e291d[_0x879e('0x2b')][_0x879e('0x98')]+'%'};return _0x26a39c;})});}_0x4442eb=_[_0x879e('0x35')]({},_0x4442eb,_0x3e291d[_0x879e('0x80')]);return db['JscriptySessionReport'][_0x879e('0x13')]({'where':_0x4442eb[_0x879e('0x5a')]})[_0x879e('0x18')](function(_0x3dcfb8){_0xe6a4f7[_0x879e('0x13')]=_0x3dcfb8;if(_0x3e291d[_0x879e('0x2b')][_0x879e('0x99')]){_0x4442eb[_0x879e('0x9a')]=[{'all':!![]}];}return db[_0x879e('0x50')][_0x879e('0x20')](_0x4442eb);})[_0x879e('0x18')](function(_0x30c83f){_0xe6a4f7[_0x879e('0x9b')]=_0x30c83f;return _0xe6a4f7;});}})['then'](respondWithFilteredResult(_0x19962e,_0x4442eb))['catch'](handleError(_0x19962e,null));};exports[_0x879e('0xa1')]=function(_0x5dd373,_0x278bc1){try{if(!_0x5dd373[_0x879e('0x36')][_0x879e('0x5c')]){throw new Error('No\x20ListId\x20specified');}if(!_0x5dd373[_0x879e('0x36')]['binding_keys']){throw new Error(_0x879e('0xa2'));}if(!_0x5dd373['body'][_0x879e('0xa3')]){throw new Error(_0x879e('0xa4'));}if(!_0x5dd373[_0x879e('0x36')]['socket_timestamp']){throw new Error(_0x879e('0xa5'));}var _0x4cef46=_0x5dd373[_0x879e('0x36')][_0x879e('0xa6')][_0x879e('0xa7')](',');var _0x418ebf=_0x5dd373[_0x879e('0x36')][_0x879e('0xa3')][_0x879e('0xa7')](',');if(!_0x4cef46[_0x879e('0x2d')]||!_0x418ebf['length']||_0x4cef46[_0x879e('0x2d')]!==_0x418ebf[_0x879e('0x2d')]){throw new Error(_0x879e('0xa8'));}_0x5dd373['body'][_0x879e('0x7b')]=_['zipObject'](_0x4cef46,_0x418ebf);if(!_0x5dd373['body'][_0x879e('0x7b')][_0x879e('0x89')]){throw new Error(_0x879e('0xa9'));}if(!_0x5dd373[_0x879e('0x36')][_0x879e('0x7b')][_0x879e('0xaa')]){throw new Error(_0x879e('0xab'));}var _0xc64d8e=path[_0x879e('0x3b')](config['root'],'server/files/tmp',_0x5dd373[_0x879e('0xac')][_0x879e('0xad')]);fs[_0x879e('0xae')](_0xc64d8e,parseInt(_0x879e('0xaf'),0x8));var _0x1d56dc=require(_0x879e('0xb0'))['fork'](path[_0x879e('0x3b')](__dirname,_0x879e('0xb1')),[_0xc64d8e,_0x5dd373[_0x879e('0x36')][_0x879e('0xa6')],_0x5dd373['body'][_0x879e('0xa3')],_0x5dd373[_0x879e('0x36')]['ListId'],_0x5dd373[_0x879e('0x36')][_0x879e('0xb2')],_0x5dd373[_0x879e('0x36')][_0x879e('0x59')],_0x5dd373['body'][_0x879e('0xb3')]]);return _0x278bc1['status'](0xc8)[_0x879e('0xf')]({'message':'File\x20uploaded\x20correctly!','pid':_0x1d56dc[_0x879e('0xb4')]});}catch(_0x3e6c97){return _0x278bc1['status'](0x1f4)['send'](_0x3e6c97);}};exports[_0x879e('0xb5')]=function(_0x3c208d,_0x3aa87a){var _0xf793f7=fs['createReadStream'](_0x3c208d[_0x879e('0xac')]['path']);Papa[_0x879e('0xb6')](_0xf793f7,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4c44a2){return _0x3aa87a['status'](0xc8)['json']({'file':_0x3c208d[_0x879e('0xac')],'fields':_0x4c44a2[_0x879e('0xb7')][_0x879e('0x7b')]});}});};exports['import']=function(_0x3f8556,_0x38e16f){return db[_0x879e('0xb8')][_0x879e('0x20')]({'raw':!![],'attributes':['id'],'where':{'role':_0x879e('0xb9')}})[_0x879e('0x18')](function(_0x560688){var _0x131c8f=![];if(!_0x3f8556['body'][_0x879e('0x5c')]){throw new Error(_0x879e('0xba'));}if(!_0x3f8556['body'][_0x879e('0xbb')]['phone']){throw new Error(_0x879e('0xa9'));}if(!_0x3f8556[_0x879e('0x36')][_0x879e('0xbb')][_0x879e('0xaa')]){throw new Error(_0x879e('0xab'));}if(!_0x3f8556[_0x879e('0x36')][_0x879e('0xb3')]){throw new Error(_0x879e('0xa5'));}var _0x1960cf=require(_0x879e('0xb0'))[_0x879e('0xbc')](path[_0x879e('0x3b')](__dirname,_0x879e('0xbd')),[_0x3f8556[_0x879e('0x25')]['id'],JSON[_0x879e('0xbe')](_0x3f8556[_0x879e('0x36')]),JSON[_0x879e('0xbe')](_0x560688)]);_0x1960cf['on'](_0x879e('0xbf'),function(){_0x131c8f=!![];return _0x38e16f['status'](0xc8)[_0x879e('0xf')]({'message':_0x879e('0xc0'),'pid':_0x1960cf[_0x879e('0xb4')]});});_0x1960cf['on'](_0x879e('0xc1'),function(_0x1d2d28){if(_0x1d2d28&&!_0x131c8f){return _0x38e16f[_0x879e('0x14')](0x1f4)['json']({'message':_0x879e('0xc2'),'pid':_0x1960cf[_0x879e('0xb4')]});}});})[_0x879e('0x22')](handleError(_0x38e16f,null));};exports[_0x879e('0xc3')]=function(_0x39477c,_0x1b413e){return db[_0x879e('0xb8')][_0x879e('0x20')]({'raw':!![],'attributes':['id'],'where':{'role':_0x879e('0xb9')}})[_0x879e('0x18')](function(_0x156226){var _0x1ab83e=![];if(!_0x39477c[_0x879e('0x36')][_0x879e('0x5c')]){throw new Error('No\x20ListId\x20specified');}if(!_0x39477c[_0x879e('0x36')][_0x879e('0xbb')]['phone']){throw new Error(_0x879e('0xa9'));}if(!_0x39477c[_0x879e('0x36')]['binding'][_0x879e('0xaa')]){throw new Error(_0x879e('0xab'));}if(!_0x39477c['body']['socket_timestamp']){throw new Error(_0x879e('0xa5'));}var _0x39ff9a=require(_0x879e('0xb0'))['fork'](path['join'](__dirname,'../../components/import/cm/csvUpdates'),[_0x39477c[_0x879e('0x25')]['id'],JSON[_0x879e('0xbe')](_0x39477c[_0x879e('0x36')]),JSON[_0x879e('0xbe')](_0x156226)]);_0x39ff9a['on'](_0x879e('0xbf'),function(){_0x1ab83e=!![];return _0x1b413e['status'](0xc8)[_0x879e('0xf')]({'message':_0x879e('0xc0'),'pid':_0x39ff9a[_0x879e('0xb4')]});});_0x39ff9a['on'](_0x879e('0xc1'),function(_0x54b9dd){if(_0x54b9dd&&!_0x1ab83e){return _0x1b413e[_0x879e('0x14')](0x1f4)[_0x879e('0xf')]({'message':'error\x20child\x20process','pid':_0x39ff9a[_0x879e('0xb4')]});}});})[_0x879e('0x22')](handleError(_0x1b413e,null));};exports['getJourney']=function(_0x1b399a,_0xd2e8d9){var _0x3ac739=[_0x879e('0xc4'),'chat',_0x879e('0xc5'),'openchannel',_0x879e('0xc6'),_0x879e('0xc7'),_0x879e('0xc8')];var _0x38b00e={'offset':0x0,'order':qs[_0x879e('0x7d')](_0x879e('0xc9'))},_0x4c92e3={'count':0x0,'rows':[]};Promise[_0x879e('0xca')]()[_0x879e('0x18')](function(){if(_0x1b399a[_0x879e('0x2b')]['channel']){if(!_[_0x879e('0xcb')](_0x3ac739,_0x1b399a['query'][_0x879e('0xcc')][_0x879e('0xcd')]())){throw new Error(_0x879e('0xce'));}_0x3ac739=[_0x1b399a[_0x879e('0x2b')][_0x879e('0xcc')][_0x879e('0xcd')]()];}if(_0x1b399a[_0x879e('0x2b')][_0x879e('0xcf')]){try{var _0x4adeca=JSON[_0x879e('0xb6')](_0x1b399a[_0x879e('0x2b')][_0x879e('0xcf')]);if(!moment(_0x4adeca[_0x879e('0x37')])['isValid']()){throw new Error(_0x879e('0xd0'));}if(!moment(_0x4adeca['to'])[_0x879e('0xd1')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0xded164){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x1b399a['query'][_0x879e('0x34')]('nolimit')){_0x38b00e[_0x879e('0x12')]=qs[_0x879e('0x12')](_0x1b399a['query'][_0x879e('0x12')]||0xa);_0x38b00e[_0x879e('0x10')]=qs['offset'](_0x1b399a['query'][_0x879e('0x10')]);}var _0x21c407=_0x3ac739[_0x879e('0x70')](function(_0x4722c4){if(_0x4722c4===_0x879e('0xc8')){var _0x1434ef={'attributes':['id',_0x879e('0xd2'),_0x879e('0x30'),_0x879e('0xd3'),_0x879e('0xd4'),_0x879e('0xd5'),'starttime',_0x879e('0xd6'),'duration',_0x879e('0xd7'),_0x879e('0xd8'),_0x879e('0xd9'),_0x879e('0xda'),_0x879e('0xdb'),_0x879e('0xdc')],'where':{'ContactId':_0x1b399a[_0x879e('0x25')]['id']},'include':[{'model':db[_0x879e('0xb8')],'as':_0x879e('0xb8'),'attributes':['id',_0x879e('0x1c'),'fullname',_0x879e('0x2f')]}],'order':[[_0x879e('0xd8'),'DESC']]};if(_0x1b399a[_0x879e('0x2b')][_0x879e('0xcf')]){_0x1434ef[_0x879e('0x5a')][_0x879e('0xd8')]={'$gte':_0x4adeca[_0x879e('0x37')],'$lte':_0x4adeca['to']};}return db[_0x879e('0x4c')][_0x879e('0xdd')](_0x1434ef)[_0x879e('0x18')](function(_0x464486){_0x4c92e3['count']+=_0x464486['count'];return _['map'](_0x464486['rows'],function(_0x15b588){var _0x3b6304=_0x15b588[_0x879e('0x38')]({'plain':!![]});_0x3b6304[_0x879e('0xcc')]=_0x4722c4;if(_0x3b6304[_0x879e('0xb8')]){_0x3b6304['User']={'id':_0x3b6304[_0x879e('0xb8')]['id'],'name':_0x3b6304['User']['name'],'fullname':_0x3b6304[_0x879e('0xb8')][_0x879e('0xde')],'alias':_0x3b6304[_0x879e('0xb8')]['alias']};}return _0x3b6304;});});}else{var _0x1e4103=_[_0x879e('0xdf')](_0x4722c4)+(_0x4722c4===_0x879e('0xe0')?_0x879e('0xe1'):'Account');var _0x40d41a={'attributes':['id',_0x879e('0xe2'),'closedAt',_0x879e('0xd8'),_0x879e('0xd7'),_0x879e('0xe3'),_0x879e('0xe4'),_0x879e('0xe5'),_0x879e('0xdc'),_0x1e4103+'Id'],'where':{'ContactId':_0x1b399a[_0x879e('0x25')]['id']},'include':[{'model':db[_0x1e4103],'as':_0x879e('0xe6'),'attributes':['id','name','key']},{'model':db[_0x879e('0xb8')],'as':'Owner','attributes':['id',_0x879e('0x1c'),_0x879e('0xde')]},{'model':db['Tag'],'as':_0x879e('0x63'),'attributes':['id',_0x879e('0x1c'),_0x879e('0x64')],'through':{'attributes':[]}}],'order':[['createdAt',_0x879e('0xe7')]]};if(_0x1b399a[_0x879e('0x2b')][_0x879e('0xcf')]){_0x40d41a[_0x879e('0x5a')][_0x879e('0xd8')]={'$gte':_0x4adeca[_0x879e('0x37')],'$lte':_0x4adeca['to']};}switch(_0x4722c4){case _0x879e('0xe0'):_0x40d41a[_0x879e('0x7a')][_0x879e('0x5f')](_0x879e('0xe8'),_0x879e('0xe9'),_0x879e('0xea'),_0x879e('0xeb'),'osName',_0x879e('0xec'),_0x879e('0xed'),_0x879e('0xee'),_0x879e('0xef'));break;case _0x879e('0xc4'):_0x40d41a[_0x879e('0x7a')][_0x879e('0x5f')](_0x879e('0xf0'),_0x879e('0xf1'));break;case _0x879e('0xf2'):_0x40d41a[_0x879e('0x7a')][_0x879e('0x5f')](_0x879e('0xf3'),_0x879e('0xf4'));break;}return db[_[_0x879e('0xdf')](_0x4722c4)+_0x879e('0xf5')][_0x879e('0xdd')](_0x40d41a)['then'](function(_0x5cc2fe){_0x4c92e3[_0x879e('0x13')]+=_0x5cc2fe[_0x879e('0x13')];return _[_0x879e('0x70')](_0x5cc2fe[_0x879e('0x9b')],function(_0x24f6b0){var _0x546244=_0x24f6b0[_0x879e('0x38')]({'plain':!![]});_0x546244[_0x879e('0xcc')]=_0x4722c4;if(_0x546244[_0x879e('0xf6')]){_0x546244[_0x879e('0xf6')]={'id':_0x546244[_0x879e('0xf6')]['id'],'name':_0x546244[_0x879e('0xf6')]['name'],'fullname':_0x546244['Owner'][_0x879e('0xde')]};}return _0x546244;});});}});return Promise[_0x879e('0x61')](_0x21c407);})['then'](function(_0x4255d8){return _(_0x4255d8)['flatten']()[_0x879e('0xf7')](_0x879e('0xd8'))[_0x879e('0xf8')]()[_0x879e('0xf9')]();})[_0x879e('0x18')](function(_0x51120e){_0x4c92e3[_0x879e('0x9b')]=_0x38b00e[_0x879e('0x12')]?_0x51120e[_0x879e('0xfa')](_0x38b00e[_0x879e('0x10')],_0x38b00e[_0x879e('0x10')]+_0x38b00e[_0x879e('0x12')]):_0x51120e;return _0x4c92e3;})[_0x879e('0x18')](respondWithFilteredResult(_0xd2e8d9,_0x38b00e))[_0x879e('0x22')](handleError(_0xd2e8d9,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 1e2aeaf..fccdd4f 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 _0x81de=['exports','events','../../mysqldb','CmContact','save','remove','emit','hasOwnProperty','hook'];(function(_0x1476fb,_0x467d01){var _0x44f57e=function(_0x4d7771){while(--_0x4d7771){_0x1476fb['push'](_0x1476fb['shift']());}};_0x44f57e(++_0x467d01);}(_0x81de,0xeb));var _0xe81d=function(_0x1bcc76,_0xaf0323){_0x1bcc76=_0x1bcc76-0x0;var _0x427496=_0x81de[_0x1bcc76];return _0x427496;};'use strict';var EventEmitter=require(_0xe81d('0x0'));var CmContact=require(_0xe81d('0x1'))['db'][_0xe81d('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe81d('0x3'),'afterUpdate':'update','afterDestroy':_0xe81d('0x4')};function emitEvent(_0x458e70){return function(_0x3c6d58,_0x4e3977,_0x38112c){CmContactEvents[_0xe81d('0x5')](_0x458e70+':'+_0x3c6d58['id'],_0x3c6d58);CmContactEvents[_0xe81d('0x5')](_0x458e70,_0x3c6d58);_0x38112c(null);};}for(var e in events){if(events[_0xe81d('0x6')](e)){var event=events[e];CmContact[_0xe81d('0x7')](e,emitEvent(event));}}module[_0xe81d('0x8')]=CmContactEvents; \ No newline at end of file +var _0x81cb=['events','CmContact','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x506f15,_0x3ec34a){var _0x4ca786=function(_0x37d5d4){while(--_0x37d5d4){_0x506f15['push'](_0x506f15['shift']());}};_0x4ca786(++_0x3ec34a);}(_0x81cb,0xe8));var _0xb81c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x81cb[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xb81c('0x0'));var CmContact=require('../../mysqldb')['db'][_0xb81c('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xb81c('0x2')](0x0);var events={'afterCreate':_0xb81c('0x3'),'afterUpdate':_0xb81c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5a5d9f){return function(_0x13682f,_0x1a5141,_0x3bb24a){CmContactEvents['emit'](_0x5a5d9f+':'+_0x13682f['id'],_0x13682f);CmContactEvents[_0xb81c('0x5')](_0x5a5d9f,_0x13682f);_0x3bb24a(null);};}for(var e in events){if(events[_0xb81c('0x6')](e)){var event=events[e];CmContact[_0xb81c('0x7')](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 2c941ec..187d925 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 _0x6a7f=['lastName','mobile','email','utf8mb4_unicode_ci','models','get','error','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','minutes','ret','cmContact,\x20afterCreate\x20','CmHopper','create','ListId','priority','callbackUniqueid','catch','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','\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','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','outbound','dialCheckDuplicateType','CmList','Lists','always','onlyIfOpen','BlackLists','length','CmHopperBlack','message','Campaign','findAll','cmContact,\x20%s,\x20%s','isEmpty','destroy','ContactId','CampaignId','push','all','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','firstName'];(function(_0x43a6cd,_0x503d1a){var _0x5acb36=function(_0x2dd95e){while(--_0x2dd95e){_0x43a6cd['push'](_0x43a6cd['shift']());}};_0x5acb36(++_0x503d1a);}(_0x6a7f,0x18f));var _0xf6a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a7f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf6a7('0x0'));var util=require(_0xf6a7('0x1'));var logger=require(_0xf6a7('0x2'))(_0xf6a7('0x3'));var moment=require(_0xf6a7('0x4'));var BPromise=require(_0xf6a7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf6a7('0x6'));var config=require('../../config/environment');var shared=require(_0xf6a7('0x7'));var attributes=require(_0xf6a7('0x8'));module[_0xf6a7('0x9')]=function(_0x49debe,_0x13cf88){return _0x49debe[_0xf6a7('0xa')](_0xf6a7('0xb'),attributes,{'tableName':_0xf6a7('0xc'),'paranoid':!![],'indexes':[{'name':_0xf6a7('0xd'),'fields':['phone']},{'name':'fti_cm_contacts','fields':[_0xf6a7('0xe'),_0xf6a7('0xf'),_0xf6a7('0xd'),_0xf6a7('0x10'),'fax',_0xf6a7('0x11')],'type':'FULLTEXT'}],'timestamps':!![],'charset':'utf8mb4','collate':_0xf6a7('0x12'),'hooks':{'afterCreate':function(_0x48735,_0x2fa283,_0xdede45){var _0x402f0e=_0x49debe[_0xf6a7('0x13')];var _0x1b6e4f=_0x48735[_0xf6a7('0x14')]({'plain':!![]});function _0x1175f0(){return function(_0x1d1749){logger[_0xf6a7('0x15')]('cmContact',_0xf6a7('0x16'),util[_0xf6a7('0x17')](_0x1d1749,{'showHidden':![],'depth':null}));};}function _0x44beb6(_0x114bbf,_0x5ce987){var _0x48b418=_0x5ce987[_0xf6a7('0x18')]?_0x5ce987[_0xf6a7('0x18')]:moment()[_0xf6a7('0x19')](_0xf6a7('0x1a'));return new BPromise(function(_0x332fb9,_0x539532){if(_[_0xf6a7('0x1b')](_0x5ce987[_0xf6a7('0x1c')])){_0x332fb9({'ret':_0x48b418});}else{_0x402f0e[_0xf6a7('0x1d')][_0xf6a7('0x1e')]({'where':{'id':_0x114bbf['id']}})[_0xf6a7('0x1f')](function(_0x5ad3a6){if(!_['isNil'](_0x5ad3a6)){var _0x13bfe9=_0x5ad3a6[_0xf6a7('0x1c')];if(!_[_0xf6a7('0x1b')](_0x13bfe9)){var _0x5d7a2b=shared[_0xf6a7('0x20')];var _0x85a55f=_0x5d7a2b[_0x13bfe9];var _0x21101e=_0x5d7a2b[_0x5ce987[_0xf6a7('0x1c')]];if(!_[_0xf6a7('0x1b')](_0x85a55f)&&!_[_0xf6a7('0x1b')](_0x21101e)){var _0x1d47d7=_0x85a55f[_0xf6a7('0x21')]-_0x21101e['utcOffset'];_0x48b418=_0x5ce987[_0xf6a7('0x18')]?_0x5ce987[_0xf6a7('0x18')]:moment();var _0x49e0ba=moment(_0x48b418)[_0xf6a7('0x22')](_0x1d47d7,_0xf6a7('0x23'));_0x332fb9({'ret':_0x49e0ba[_0xf6a7('0x19')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x332fb9({'ret':_0x48b418});}else _0x332fb9({'ret':_0x48b418});}else{_0x332fb9({'ret':_0x48b418});}});}});return 0xa;}var _0x312cb4=function(_0x27d573){return new BPromise(function(_0x32974d,_0x2db6a1){_0x44beb6(_0x27d573,_0x1b6e4f)['then'](function(_0x2036f8){_0x1b6e4f['scheduledat']=_0x2036f8[_0xf6a7('0x24')];_0x402f0e['CmHopper']['findOne']({'where':{'phone':_0x1b6e4f['phone'],'VoiceQueueId':_0x27d573['id']}})[_0xf6a7('0x1f')](function(_0xcbbdd1){if(!_['isNil'](_0xcbbdd1)){throw new Error(_0xf6a7('0x25')+_0x1b6e4f[_0xf6a7('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x27d573['id']);}return _0x402f0e[_0xf6a7('0x26')][_0xf6a7('0x27')]({'phone':_0x1b6e4f['phone'],'ContactId':_0x1b6e4f['id'],'ListId':_0x1b6e4f[_0xf6a7('0x28')],'priority':_0x1b6e4f[_0xf6a7('0x29')]?_0x1b6e4f['priority']:0x2,'scheduledat':_0x1b6e4f[_0xf6a7('0x18')]?_0x1b6e4f[_0xf6a7('0x18')]:moment()['format'](_0xf6a7('0x1a')),'callback':_0x1b6e4f[_0xf6a7('0x2a')]?!![]:![],'callbackuniqueid':_0x1b6e4f[_0xf6a7('0x2a')]?_0x1b6e4f[_0xf6a7('0x2a')]:undefined,'callbackat':_0x1b6e4f['callbackUniqueid']?moment()[_0xf6a7('0x19')](_0xf6a7('0x1a')):undefined,'VoiceQueueId':_0x27d573['id']});})[_0xf6a7('0x2b')](function(_0x226d49){_0x2db6a1(_0x226d49);});});});};var _0x458994=function(_0x1faf82){return new BPromise(function(_0x13567a,_0x3d7239){_0x44beb6(_0x1faf82,_0x1b6e4f)[_0xf6a7('0x1f')](function(_0x9d74aa){_0x1b6e4f[_0xf6a7('0x18')]=_0x9d74aa[_0xf6a7('0x24')];_0x402f0e['CmHopper'][_0xf6a7('0x1e')]({'where':{'phone':_0x1b6e4f[_0xf6a7('0xd')],'VoiceQueueId':_0x1faf82['id']}})[_0xf6a7('0x1f')](function(_0x570775){if(!_[_0xf6a7('0x1b')](_0x570775)){throw new Error(_0xf6a7('0x25')+_0x1b6e4f['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x1faf82['id']);}return _0x402f0e[_0xf6a7('0x2c')][_0xf6a7('0x1e')]({'where':{'calleridnum':_0x1b6e4f[_0xf6a7('0xd')],'VoiceQueueId':_0x1faf82['id']}});})[_0xf6a7('0x1f')](function(_0x247759){if(!_[_0xf6a7('0x1b')](_0x247759)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x1b6e4f['phone']+_0xf6a7('0x2d')+_0x1faf82['id']);}return _0x402f0e[_0xf6a7('0x26')]['create']({'phone':_0x1b6e4f['phone'],'ContactId':_0x1b6e4f['id'],'ListId':_0x1b6e4f[_0xf6a7('0x28')],'priority':_0x1b6e4f[_0xf6a7('0x29')]?_0x1b6e4f[_0xf6a7('0x29')]:0x2,'scheduledat':_0x1b6e4f[_0xf6a7('0x18')]?_0x1b6e4f[_0xf6a7('0x18')]:moment()[_0xf6a7('0x19')](_0xf6a7('0x1a')),'callback':_0x1b6e4f[_0xf6a7('0x2a')]?!![]:![],'callbackuniqueid':_0x1b6e4f[_0xf6a7('0x2a')]?_0x1b6e4f[_0xf6a7('0x2a')]:undefined,'callbackat':_0x1b6e4f[_0xf6a7('0x2a')]?moment()[_0xf6a7('0x19')](_0xf6a7('0x1a')):undefined,'VoiceQueueId':_0x1faf82['id']});})['catch'](function(_0x545b2a){_0x3d7239(_0x545b2a);});});});};function _0x4eae03(){return function(_0xfcca7c){logger[_0xf6a7('0x15')]('cmContact',_0xf6a7('0x16'),util['inspect'](_0xfcca7c,{'showHidden':![],'depth':null}));};}function _0x3cd378(_0x574cfc,_0x1a1ed0){var _0x1897b5=_0x1a1ed0[_0xf6a7('0x18')]?_0x1a1ed0[_0xf6a7('0x18')]:moment()[_0xf6a7('0x19')](_0xf6a7('0x1a'));return new BPromise(function(_0x22db64,_0x57beae){if(_[_0xf6a7('0x1b')](_0x1a1ed0[_0xf6a7('0x1c')])){_0x22db64({'ret':_0x1897b5});}else{_0x402f0e['Campaign'][_0xf6a7('0x1e')]({'where':{'id':_0x574cfc['id']}})['then'](function(_0x3590af){if(!_[_0xf6a7('0x1b')](_0x3590af)){var _0x407336=_0x3590af[_0xf6a7('0x1c')];if(!_[_0xf6a7('0x1b')](_0x407336)){var _0x5e663c=shared['timezones'];var _0x42a49f=_0x5e663c[_0x407336];var _0x3f8797=_0x5e663c[_0x1a1ed0['dialTimezone']];if(!_['isNil'](_0x42a49f)&&!_['isNil'](_0x3f8797)){var _0x4dbd38=_0x42a49f[_0xf6a7('0x21')]-_0x3f8797['utcOffset'];_0x1897b5=_0x1a1ed0['scheduledat']?_0x1a1ed0[_0xf6a7('0x18')]:moment();var _0x2094ba=moment(_0x1897b5)[_0xf6a7('0x22')](_0x4dbd38,'minutes');_0x22db64({'ret':_0x2094ba['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x22db64({'ret':_0x1897b5});}else _0x22db64({'ret':_0x1897b5});}else{_0x22db64({'ret':_0x1897b5});}});}});return 0xa;}var _0x3ed6c4=function(_0x1381cd){return new BPromise(function(_0x20fb57,_0x226d4d){_0x3cd378(_0x1381cd,_0x1b6e4f)['then'](function(_0x291e74){_0x1b6e4f['scheduledat']=_0x291e74[_0xf6a7('0x24')];_0x402f0e['CmHopper'][_0xf6a7('0x1e')]({'where':{'phone':_0x1b6e4f[_0xf6a7('0xd')],'CampaignId':_0x1381cd['id']}})[_0xf6a7('0x1f')](function(_0x30e0c3){if(!_[_0xf6a7('0x1b')](_0x30e0c3)){throw new Error(_0xf6a7('0x25')+_0x1b6e4f['phone']+_0xf6a7('0x2e')+_0x1381cd['id']);}return _0x402f0e[_0xf6a7('0x26')][_0xf6a7('0x27')]({'phone':_0x1b6e4f[_0xf6a7('0xd')],'ContactId':_0x1b6e4f['id'],'ListId':_0x1b6e4f[_0xf6a7('0x28')],'priority':_0x1b6e4f[_0xf6a7('0x29')]?_0x1b6e4f['priority']:0x2,'scheduledat':_0x1b6e4f[_0xf6a7('0x18')]?_0x1b6e4f['scheduledat']:moment()[_0xf6a7('0x19')](_0xf6a7('0x1a')),'callback':_0x1b6e4f[_0xf6a7('0x2a')]?!![]:![],'callbackuniqueid':_0x1b6e4f[_0xf6a7('0x2a')]?_0x1b6e4f['callbackUniqueid']:undefined,'callbackat':_0x1b6e4f[_0xf6a7('0x2a')]?moment()['format'](_0xf6a7('0x1a')):undefined,'CampaignId':_0x1381cd['id']});})[_0xf6a7('0x2b')](function(_0x29bffa){_0x226d4d(_0x29bffa);});});});};var _0x40c0f9=function(_0x4e3b55){return new BPromise(function(_0x37c891,_0x22ed80){_0x3cd378(_0x4e3b55,_0x1b6e4f)[_0xf6a7('0x1f')](function(_0x3edf6d){_0x1b6e4f[_0xf6a7('0x18')]=_0x3edf6d[_0xf6a7('0x24')];_0x402f0e['CmHopper'][_0xf6a7('0x1e')]({'where':{'phone':_0x1b6e4f['phone'],'CampaignId':_0x4e3b55['id']}})[_0xf6a7('0x1f')](function(_0x4a2b09){if(!_[_0xf6a7('0x1b')](_0x4a2b09)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1b6e4f[_0xf6a7('0xd')]+_0xf6a7('0x2f')+_0x4e3b55['id']);}return _0x402f0e[_0xf6a7('0x2c')][_0xf6a7('0x1e')]({'where':{'calleridnum':_0x1b6e4f[_0xf6a7('0xd')],'CampaignId':_0x4e3b55['id']}});})[_0xf6a7('0x1f')](function(_0x2bf98e){if(!_[_0xf6a7('0x1b')](_0x2bf98e)){throw new Error(_0xf6a7('0x30')+_0x1b6e4f[_0xf6a7('0xd')]+_0xf6a7('0x31')+_0x4e3b55['id']);}return _0x402f0e[_0xf6a7('0x26')][_0xf6a7('0x27')]({'phone':_0x1b6e4f[_0xf6a7('0xd')],'ContactId':_0x1b6e4f['id'],'ListId':_0x1b6e4f['ListId'],'priority':_0x1b6e4f[_0xf6a7('0x29')]?_0x1b6e4f[_0xf6a7('0x29')]:0x2,'scheduledat':_0x1b6e4f[_0xf6a7('0x18')]?_0x1b6e4f[_0xf6a7('0x18')]:moment()[_0xf6a7('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1b6e4f[_0xf6a7('0x2a')]?!![]:![],'callbackuniqueid':_0x1b6e4f[_0xf6a7('0x2a')]?_0x1b6e4f[_0xf6a7('0x2a')]:undefined,'callbackat':_0x1b6e4f['callbackUniqueid']?moment()[_0xf6a7('0x19')](_0xf6a7('0x1a')):undefined,'CampaignId':_0x4e3b55['id']});})[_0xf6a7('0x2b')](function(_0x4fcb7b){_0x22ed80(_0x4fcb7b);});});});};if(_0x1b6e4f[_0xf6a7('0x28')]){_0x402f0e[_0xf6a7('0x1d')]['findAll']({'where':{'type':_0xf6a7('0x32')},'attributes':['id',_0xf6a7('0x33'),'dialTimezone'],'include':[{'model':_0x402f0e[_0xf6a7('0x34')],'as':_0xf6a7('0x35'),'where':{'id':_0x1b6e4f[_0xf6a7('0x28')]}}]})[_0xf6a7('0x1f')](function(_0x16be51){if(_0x16be51){var _0x19ba7c=[];for(var _0x4c2675=0x0,_0x27e79a;_0x4c2675<_0x16be51['length'];_0x4c2675+=0x1){_0x27e79a=_0x16be51[_0x4c2675][_0xf6a7('0x14')]({'plain':!![]});switch(_0x27e79a[_0xf6a7('0x33')]){case _0xf6a7('0x36'):_0x458994(_0x27e79a)[_0xf6a7('0x2b')](_0x1175f0());break;case _0xf6a7('0x37'):_0x312cb4(_0x27e79a)[_0xf6a7('0x2b')](_0x1175f0());break;default:_0x3cd378(_0x27e79a,_0x1b6e4f)[_0xf6a7('0x1f')](function(_0x86543c){_0x1b6e4f[_0xf6a7('0x18')]=_0x86543c['ret'];_0x402f0e[_0xf6a7('0x26')][_0xf6a7('0x27')]({'phone':_0x1b6e4f['phone'],'ContactId':_0x1b6e4f['id'],'ListId':_0x1b6e4f[_0xf6a7('0x28')],'scheduledat':_0x1b6e4f[_0xf6a7('0x18')]?_0x1b6e4f[_0xf6a7('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x1b6e4f[_0xf6a7('0x29')]?_0x1b6e4f[_0xf6a7('0x29')]:0x2,'callback':_0x1b6e4f[_0xf6a7('0x2a')]?!![]:![],'callbackuniqueid':_0x1b6e4f[_0xf6a7('0x2a')]?_0x1b6e4f[_0xf6a7('0x2a')]:undefined,'callbackat':_0x1b6e4f[_0xf6a7('0x2a')]?moment()[_0xf6a7('0x19')](_0xf6a7('0x1a')):undefined,'VoiceQueueId':_0x27e79a['id']})['catch'](_0x1175f0());});}}}})[_0xf6a7('0x1f')](function(){return _0x402f0e[_0xf6a7('0x1d')]['findAll']({'where':{'type':_0xf6a7('0x32')},'attributes':['id'],'include':[{'model':_0x402f0e[_0xf6a7('0x34')],'as':_0xf6a7('0x38'),'where':{'id':_0x1b6e4f['ListId']}}]})[_0xf6a7('0x1f')](function(_0x45d6ae){if(_0x45d6ae){var _0x23e860=[];for(var _0x5b9869=0x0,_0x31648f;_0x5b9869<_0x45d6ae[_0xf6a7('0x39')];_0x5b9869+=0x1){_0x31648f=_0x45d6ae[_0x5b9869]['get']({'plain':!![]});_0x402f0e[_0xf6a7('0x3a')]['create']({'phone':_0x1b6e4f[_0xf6a7('0xd')],'ContactId':_0x1b6e4f['id'],'ListId':_0x1b6e4f[_0xf6a7('0x28')],'VoiceQueueId':_0x31648f['id']})['catch'](function(_0x372786){logger[_0xf6a7('0x15')]('cmContact,\x20%s,\x20%s',_0xf6a7('0x16'),_0x372786[_0xf6a7('0x3b')]);});}}});})['then'](function(){return _0x402f0e[_0xf6a7('0x3c')]['findAll']({'attributes':['id',_0xf6a7('0x33'),'dialTimezone'],'include':[{'model':_0x402f0e[_0xf6a7('0x34')],'as':_0xf6a7('0x35'),'where':{'id':_0x1b6e4f[_0xf6a7('0x28')]}}]})['then'](function(_0x3c12e6){if(_0x3c12e6){var _0x5bc435=[];for(var _0xc89261=0x0,_0x3adf64;_0xc89261<_0x3c12e6[_0xf6a7('0x39')];_0xc89261+=0x1){_0x3adf64=_0x3c12e6[_0xc89261][_0xf6a7('0x14')]({'plain':!![]});switch(_0x3adf64[_0xf6a7('0x33')]){case _0xf6a7('0x36'):_0x40c0f9(_0x3adf64)[_0xf6a7('0x2b')](_0x4eae03());break;case'onlyIfOpen':_0x3ed6c4(_0x3adf64)['catch'](_0x4eae03());break;default:_0x402f0e[_0xf6a7('0x26')][_0xf6a7('0x27')]({'phone':_0x1b6e4f[_0xf6a7('0xd')],'ContactId':_0x1b6e4f['id'],'ListId':_0x1b6e4f[_0xf6a7('0x28')],'scheduledat':_0x1b6e4f[_0xf6a7('0x18')]?_0x1b6e4f['scheduledat']:moment()['format'](_0xf6a7('0x1a')),'priority':_0x1b6e4f[_0xf6a7('0x29')]?_0x1b6e4f[_0xf6a7('0x29')]:0x2,'callback':_0x1b6e4f[_0xf6a7('0x2a')]?!![]:![],'callbackuniqueid':_0x1b6e4f['callbackUniqueid']?_0x1b6e4f[_0xf6a7('0x2a')]:undefined,'callbackat':_0x1b6e4f['callbackUniqueid']?moment()[_0xf6a7('0x19')](_0xf6a7('0x1a')):undefined,'CampaignId':_0x3adf64['id']})[_0xf6a7('0x2b')](_0x4eae03());}}}});})[_0xf6a7('0x1f')](function(){return _0x402f0e['Campaign'][_0xf6a7('0x3d')]({'attributes':['id'],'include':[{'model':_0x402f0e[_0xf6a7('0x34')],'as':_0xf6a7('0x38'),'where':{'id':_0x1b6e4f[_0xf6a7('0x28')]}}]})[_0xf6a7('0x1f')](function(_0x31b8d9){if(_0x31b8d9){var _0x340bc7=[];for(var _0x7244fa=0x0,_0x2b274e;_0x7244fa<_0x31b8d9[_0xf6a7('0x39')];_0x7244fa+=0x1){_0x2b274e=_0x31b8d9[_0x7244fa]['get']({'plain':!![]});_0x402f0e['CmHopperBlack']['create']({'phone':_0x1b6e4f[_0xf6a7('0xd')],'ContactId':_0x1b6e4f['id'],'ListId':_0x1b6e4f['ListId'],'CampaignId':_0x2b274e['id']})['catch'](function(_0x2484aa){logger[_0xf6a7('0x15')]('cmContact,\x20%s,\x20%s',_0xf6a7('0x16'),_0x2484aa[_0xf6a7('0x3b')]);});}}});})['then'](function(){_0xdede45();})[_0xf6a7('0x2b')](function(_0x2055f5){logger['error'](_0xf6a7('0x3e'),_0xf6a7('0x16'),_0x2055f5[_0xf6a7('0x3b')]);_0xdede45(_0x2055f5);});}else{_0xdede45(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x498ba8,_0x13d092,_0x28a1f6){var _0x7bdc68=_0x49debe['models'];var _0x43b982=_0x498ba8[_0xf6a7('0x14')]({'plain':!![]});return _0x7bdc68[_0xf6a7('0x26')]['findAll']({'raw':!![],'where':{'ListId':_0x43b982[_0xf6a7('0x28')],'ContactId':_0x43b982['id']}})[_0xf6a7('0x1f')](function(_0x2fba48){if(!_[_0xf6a7('0x3f')](_0x2fba48)){var _0x5d5c2c=[];for(var _0x3cd119=0x0;_0x3cd119<_0x2fba48[_0xf6a7('0x39')];_0x3cd119+=0x1){var _0xfd4a25=_0x7bdc68[_0xf6a7('0x26')][_0xf6a7('0x40')]({'where':{'ListId':_0x2fba48[_0x3cd119][_0xf6a7('0x28')],'ContactId':_0x2fba48[_0x3cd119][_0xf6a7('0x41')],'VoiceQueueId':_0x2fba48[_0x3cd119]['VoiceQueueId'],'CampaignId':_0x2fba48[_0x3cd119][_0xf6a7('0x42')]}});_0x5d5c2c[_0xf6a7('0x43')](_0xfd4a25);}return BPromise[_0xf6a7('0x44')](_0x5d5c2c);}})[_0xf6a7('0x1f')](function(_0x4cd094){logger['info']('[CmContact][afterDestroy][Succesfull]',util[_0xf6a7('0x17')](_0x4cd094,{'showHidden':![],'depth':null}));_0x28a1f6();})[_0xf6a7('0x2b')](function(_0x3542ae){logger[_0xf6a7('0x15')]('[CmContact][afterDestroy][Error]',util[_0xf6a7('0x17')](_0x3542ae,{'showHidden':![],'depth':null}));_0x28a1f6(_0x3542ae);});}}});}; \ No newline at end of file +var _0x52d9=['FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','VoiceQueue','timezones','dialTimezone','utcOffset','add','minutes','then','ret','findOne','cmContact,\x20afterCreate\x20','CmHopper','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','error','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','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','length','always','BlackLists','cmContact,\x20%s,\x20%s','message','Lists','onlyIfOpen','CmHopperBlack','List\x20not\x20found','destroy','VoiceQueueId','CampaignId','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','CmContact','phone','fti_cm_contacts','firstName','email'];(function(_0x4ff41c,_0x483c21){var _0x275644=function(_0xcaef54){while(--_0xcaef54){_0x4ff41c['push'](_0x4ff41c['shift']());}};_0x275644(++_0x483c21);}(_0x52d9,0x82));var _0x952d=function(_0x4574d9,_0x224f1a){_0x4574d9=_0x4574d9-0x0;var _0x30cea4=_0x52d9[_0x4574d9];return _0x30cea4;};'use strict';var _=require(_0x952d('0x0'));var util=require('util');var logger=require(_0x952d('0x1'))(_0x952d('0x2'));var moment=require(_0x952d('0x3'));var BPromise=require('bluebird');var rp=require(_0x952d('0x4'));var fs=require('fs');var path=require(_0x952d('0x5'));var rimraf=require(_0x952d('0x6'));var config=require(_0x952d('0x7'));var shared=require(_0x952d('0x8'));var attributes=require(_0x952d('0x9'));module[_0x952d('0xa')]=function(_0xd5cef3,_0x558477){return _0xd5cef3['define'](_0x952d('0xb'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x952d('0xc'),'fields':['phone']},{'name':_0x952d('0xd'),'fields':[_0x952d('0xe'),'lastName',_0x952d('0xc'),'mobile','fax',_0x952d('0xf')],'type':_0x952d('0x10')}],'timestamps':!![],'charset':_0x952d('0x11'),'collate':_0x952d('0x12'),'hooks':{'afterCreate':function(_0x23ab73,_0x2ea802,_0x1b8ea0){var _0x2012a4=_0xd5cef3[_0x952d('0x13')];var _0x169598=_0x23ab73[_0x952d('0x14')]({'plain':!![]});function _0x58c757(){return function(_0x566f27){logger['error'](_0x952d('0x15'),_0x952d('0x16'),util[_0x952d('0x17')](_0x566f27,{'showHidden':![],'depth':null}));};}function _0x29acaf(_0x3b0758,_0x461d56){var _0x3fbdd9=_0x461d56[_0x952d('0x18')]?_0x461d56[_0x952d('0x18')]:moment()[_0x952d('0x19')](_0x952d('0x1a'));return new BPromise(function(_0x349080,_0xd6aa75){if(_[_0x952d('0x1b')](_0x461d56['dialTimezone'])){_0x349080({'ret':_0x3fbdd9});}else{_0x2012a4[_0x952d('0x1c')]['findOne']({'where':{'id':_0x3b0758['id']}})['then'](function(_0x4d3d50){if(!_[_0x952d('0x1b')](_0x4d3d50)){var _0xcef9fe=_0x4d3d50['dialTimezone'];if(!_['isNil'](_0xcef9fe)){var _0x4acf82=shared[_0x952d('0x1d')];var _0x480922=_0x4acf82[_0xcef9fe];var _0x6b592d=_0x4acf82[_0x461d56[_0x952d('0x1e')]];if(!_['isNil'](_0x480922)&&!_[_0x952d('0x1b')](_0x6b592d)){var _0x104b82=_0x480922[_0x952d('0x1f')]-_0x6b592d[_0x952d('0x1f')];_0x3fbdd9=_0x461d56[_0x952d('0x18')]?_0x461d56[_0x952d('0x18')]:moment();var _0x1ef3d0=moment(_0x3fbdd9)[_0x952d('0x20')](_0x104b82,_0x952d('0x21'));_0x349080({'ret':_0x1ef3d0[_0x952d('0x19')](_0x952d('0x1a'))});}else _0x349080({'ret':_0x3fbdd9});}else _0x349080({'ret':_0x3fbdd9});}else{_0x349080({'ret':_0x3fbdd9});}});}});return 0xa;}var _0x390cac=function(_0x20d5b4){return new BPromise(function(_0x29fc41,_0x5a5b3d){_0x29acaf(_0x20d5b4,_0x169598)[_0x952d('0x22')](function(_0x229bfe){_0x169598['scheduledat']=_0x229bfe[_0x952d('0x23')];_0x2012a4['CmHopper'][_0x952d('0x24')]({'where':{'phone':_0x169598[_0x952d('0xc')],'VoiceQueueId':_0x20d5b4['id']}})[_0x952d('0x22')](function(_0x24db2a){if(!_[_0x952d('0x1b')](_0x24db2a)){throw new Error(_0x952d('0x25')+_0x169598[_0x952d('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x20d5b4['id']);}return _0x2012a4[_0x952d('0x26')][_0x952d('0x27')]({'phone':_0x169598[_0x952d('0xc')],'ContactId':_0x169598['id'],'ListId':_0x169598[_0x952d('0x28')],'priority':_0x169598[_0x952d('0x29')]?_0x169598[_0x952d('0x29')]:0x2,'scheduledat':_0x169598['scheduledat']?_0x169598[_0x952d('0x18')]:moment()[_0x952d('0x19')](_0x952d('0x1a')),'callback':_0x169598[_0x952d('0x2a')]?!![]:![],'callbackuniqueid':_0x169598['callbackUniqueid']?_0x169598[_0x952d('0x2a')]:undefined,'callbackat':_0x169598[_0x952d('0x2a')]?moment()[_0x952d('0x19')](_0x952d('0x1a')):undefined,'VoiceQueueId':_0x20d5b4['id']});})[_0x952d('0x2b')](function(_0x4e04ca){_0x5a5b3d(_0x4e04ca);});});});};var _0x1fa229=function(_0x145458){return new BPromise(function(_0x3b378f,_0x49dc13){_0x29acaf(_0x145458,_0x169598)[_0x952d('0x22')](function(_0x22ccfd){_0x169598[_0x952d('0x18')]=_0x22ccfd[_0x952d('0x23')];_0x2012a4[_0x952d('0x26')][_0x952d('0x24')]({'where':{'phone':_0x169598[_0x952d('0xc')],'VoiceQueueId':_0x145458['id']}})[_0x952d('0x22')](function(_0x41c418){if(!_[_0x952d('0x1b')](_0x41c418)){throw new Error(_0x952d('0x25')+_0x169598[_0x952d('0xc')]+_0x952d('0x2c')+_0x145458['id']);}return _0x2012a4['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x169598[_0x952d('0xc')],'VoiceQueueId':_0x145458['id']}});})[_0x952d('0x22')](function(_0x11bd47){if(!_[_0x952d('0x1b')](_0x11bd47)){throw new Error(_0x952d('0x2d')+_0x169598[_0x952d('0xc')]+_0x952d('0x2e')+_0x145458['id']);}return _0x2012a4['CmHopper'][_0x952d('0x27')]({'phone':_0x169598[_0x952d('0xc')],'ContactId':_0x169598['id'],'ListId':_0x169598[_0x952d('0x28')],'priority':_0x169598['priority']?_0x169598['priority']:0x2,'scheduledat':_0x169598[_0x952d('0x18')]?_0x169598[_0x952d('0x18')]:moment()[_0x952d('0x19')](_0x952d('0x1a')),'callback':_0x169598[_0x952d('0x2a')]?!![]:![],'callbackuniqueid':_0x169598[_0x952d('0x2a')]?_0x169598['callbackUniqueid']:undefined,'callbackat':_0x169598[_0x952d('0x2a')]?moment()[_0x952d('0x19')](_0x952d('0x1a')):undefined,'VoiceQueueId':_0x145458['id']});})['catch'](function(_0x1bda34){_0x49dc13(_0x1bda34);});});});};function _0x498e25(){return function(_0x2ac976){logger[_0x952d('0x2f')](_0x952d('0x15'),_0x952d('0x16'),util[_0x952d('0x17')](_0x2ac976,{'showHidden':![],'depth':null}));};}function _0x5a5dca(_0x1a565a,_0x34d499){var _0x35d9db=_0x34d499[_0x952d('0x18')]?_0x34d499[_0x952d('0x18')]:moment()[_0x952d('0x19')](_0x952d('0x1a'));return new BPromise(function(_0x15206a,_0x518231){if(_[_0x952d('0x1b')](_0x34d499[_0x952d('0x1e')])){_0x15206a({'ret':_0x35d9db});}else{_0x2012a4[_0x952d('0x30')][_0x952d('0x24')]({'where':{'id':_0x1a565a['id']}})[_0x952d('0x22')](function(_0x7540bd){if(!_[_0x952d('0x1b')](_0x7540bd)){var _0x50a886=_0x7540bd[_0x952d('0x1e')];if(!_[_0x952d('0x1b')](_0x50a886)){var _0x5afdb2=shared['timezones'];var _0x46e99c=_0x5afdb2[_0x50a886];var _0x4aa2c2=_0x5afdb2[_0x34d499['dialTimezone']];if(!_[_0x952d('0x1b')](_0x46e99c)&&!_[_0x952d('0x1b')](_0x4aa2c2)){var _0x2b6de0=_0x46e99c[_0x952d('0x1f')]-_0x4aa2c2[_0x952d('0x1f')];_0x35d9db=_0x34d499[_0x952d('0x18')]?_0x34d499[_0x952d('0x18')]:moment();var _0x4f95bd=moment(_0x35d9db)[_0x952d('0x20')](_0x2b6de0,_0x952d('0x21'));_0x15206a({'ret':_0x4f95bd['format'](_0x952d('0x1a'))});}else _0x15206a({'ret':_0x35d9db});}else _0x15206a({'ret':_0x35d9db});}else{_0x15206a({'ret':_0x35d9db});}});}});return 0xa;}var _0x5176e8=function(_0xb61a8f){return new BPromise(function(_0x26a4ce,_0x4e1a8d){_0x5a5dca(_0xb61a8f,_0x169598)[_0x952d('0x22')](function(_0x1b3bd8){_0x169598[_0x952d('0x18')]=_0x1b3bd8[_0x952d('0x23')];_0x2012a4[_0x952d('0x26')][_0x952d('0x24')]({'where':{'phone':_0x169598['phone'],'CampaignId':_0xb61a8f['id']}})[_0x952d('0x22')](function(_0x4647ed){if(!_[_0x952d('0x1b')](_0x4647ed)){throw new Error(_0x952d('0x25')+_0x169598[_0x952d('0xc')]+_0x952d('0x31')+_0xb61a8f['id']);}return _0x2012a4[_0x952d('0x26')]['create']({'phone':_0x169598[_0x952d('0xc')],'ContactId':_0x169598['id'],'ListId':_0x169598['ListId'],'priority':_0x169598[_0x952d('0x29')]?_0x169598[_0x952d('0x29')]:0x2,'scheduledat':_0x169598['scheduledat']?_0x169598[_0x952d('0x18')]:moment()[_0x952d('0x19')](_0x952d('0x1a')),'callback':_0x169598['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x169598[_0x952d('0x2a')]?_0x169598[_0x952d('0x2a')]:undefined,'callbackat':_0x169598[_0x952d('0x2a')]?moment()['format'](_0x952d('0x1a')):undefined,'CampaignId':_0xb61a8f['id']});})[_0x952d('0x2b')](function(_0x17bcb0){_0x4e1a8d(_0x17bcb0);});});});};var _0x108594=function(_0x15c169){return new BPromise(function(_0x3f12ea,_0xd931b6){_0x5a5dca(_0x15c169,_0x169598)['then'](function(_0x56bba6){_0x169598['scheduledat']=_0x56bba6[_0x952d('0x23')];_0x2012a4['CmHopper'][_0x952d('0x24')]({'where':{'phone':_0x169598[_0x952d('0xc')],'CampaignId':_0x15c169['id']}})[_0x952d('0x22')](function(_0x1cd428){if(!_[_0x952d('0x1b')](_0x1cd428)){throw new Error(_0x952d('0x25')+_0x169598[_0x952d('0xc')]+_0x952d('0x32')+_0x15c169['id']);}return _0x2012a4[_0x952d('0x33')][_0x952d('0x24')]({'where':{'calleridnum':_0x169598[_0x952d('0xc')],'CampaignId':_0x15c169['id']}});})[_0x952d('0x22')](function(_0x452776){if(!_[_0x952d('0x1b')](_0x452776)){throw new Error(_0x952d('0x2d')+_0x169598['phone']+_0x952d('0x34')+_0x15c169['id']);}return _0x2012a4[_0x952d('0x26')][_0x952d('0x27')]({'phone':_0x169598[_0x952d('0xc')],'ContactId':_0x169598['id'],'ListId':_0x169598['ListId'],'priority':_0x169598[_0x952d('0x29')]?_0x169598[_0x952d('0x29')]:0x2,'scheduledat':_0x169598['scheduledat']?_0x169598[_0x952d('0x18')]:moment()[_0x952d('0x19')](_0x952d('0x1a')),'callback':_0x169598['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x169598[_0x952d('0x2a')]?_0x169598['callbackUniqueid']:undefined,'callbackat':_0x169598[_0x952d('0x2a')]?moment()[_0x952d('0x19')](_0x952d('0x1a')):undefined,'CampaignId':_0x15c169['id']});})['catch'](function(_0x356523){_0xd931b6(_0x356523);});});});};if(_0x169598[_0x952d('0x28')]){_0x2012a4['VoiceQueue'][_0x952d('0x35')]({'where':{'type':_0x952d('0x36')},'attributes':['id',_0x952d('0x37'),_0x952d('0x1e')],'include':[{'model':_0x2012a4[_0x952d('0x38')],'as':'Lists','where':{'id':_0x169598[_0x952d('0x28')]}}]})['then'](function(_0x20885c){if(_0x20885c){var _0x2d582a=[];for(var _0x218865=0x0,_0x5241e7;_0x218865<_0x20885c[_0x952d('0x39')];_0x218865+=0x1){_0x5241e7=_0x20885c[_0x218865][_0x952d('0x14')]({'plain':!![]});switch(_0x5241e7[_0x952d('0x37')]){case _0x952d('0x3a'):_0x1fa229(_0x5241e7)['catch'](_0x58c757());break;case'onlyIfOpen':_0x390cac(_0x5241e7)[_0x952d('0x2b')](_0x58c757());break;default:_0x5a5dca(_0x5241e7,_0x169598)[_0x952d('0x22')](function(_0x37a24c){_0x169598[_0x952d('0x18')]=_0x37a24c[_0x952d('0x23')];_0x2012a4[_0x952d('0x26')][_0x952d('0x27')]({'phone':_0x169598[_0x952d('0xc')],'ContactId':_0x169598['id'],'ListId':_0x169598[_0x952d('0x28')],'scheduledat':_0x169598[_0x952d('0x18')]?_0x169598[_0x952d('0x18')]:moment()[_0x952d('0x19')](_0x952d('0x1a')),'priority':_0x169598[_0x952d('0x29')]?_0x169598[_0x952d('0x29')]:0x2,'callback':_0x169598[_0x952d('0x2a')]?!![]:![],'callbackuniqueid':_0x169598['callbackUniqueid']?_0x169598[_0x952d('0x2a')]:undefined,'callbackat':_0x169598[_0x952d('0x2a')]?moment()[_0x952d('0x19')](_0x952d('0x1a')):undefined,'VoiceQueueId':_0x5241e7['id']})[_0x952d('0x2b')](_0x58c757());});}}}})[_0x952d('0x22')](function(){return _0x2012a4[_0x952d('0x1c')][_0x952d('0x35')]({'where':{'type':_0x952d('0x36')},'attributes':['id'],'include':[{'model':_0x2012a4['CmList'],'as':_0x952d('0x3b'),'where':{'id':_0x169598[_0x952d('0x28')]}}]})[_0x952d('0x22')](function(_0x2a01ba){if(_0x2a01ba){var _0x1fb42f=[];for(var _0x1ffa16=0x0,_0x55a509;_0x1ffa16<_0x2a01ba[_0x952d('0x39')];_0x1ffa16+=0x1){_0x55a509=_0x2a01ba[_0x1ffa16][_0x952d('0x14')]({'plain':!![]});_0x2012a4['CmHopperBlack']['create']({'phone':_0x169598[_0x952d('0xc')],'ContactId':_0x169598['id'],'ListId':_0x169598[_0x952d('0x28')],'VoiceQueueId':_0x55a509['id']})[_0x952d('0x2b')](function(_0x4b808d){logger['error'](_0x952d('0x3c'),_0x952d('0x16'),_0x4b808d[_0x952d('0x3d')]);});}}});})[_0x952d('0x22')](function(){return _0x2012a4[_0x952d('0x30')][_0x952d('0x35')]({'attributes':['id',_0x952d('0x37'),'dialTimezone'],'include':[{'model':_0x2012a4[_0x952d('0x38')],'as':_0x952d('0x3e'),'where':{'id':_0x169598[_0x952d('0x28')]}}]})[_0x952d('0x22')](function(_0x4c521a){if(_0x4c521a){var _0x10c489=[];for(var _0x2d65a7=0x0,_0x26b49d;_0x2d65a7<_0x4c521a[_0x952d('0x39')];_0x2d65a7+=0x1){_0x26b49d=_0x4c521a[_0x2d65a7]['get']({'plain':!![]});switch(_0x26b49d[_0x952d('0x37')]){case _0x952d('0x3a'):_0x108594(_0x26b49d)[_0x952d('0x2b')](_0x498e25());break;case _0x952d('0x3f'):_0x5176e8(_0x26b49d)[_0x952d('0x2b')](_0x498e25());break;default:_0x2012a4[_0x952d('0x26')][_0x952d('0x27')]({'phone':_0x169598[_0x952d('0xc')],'ContactId':_0x169598['id'],'ListId':_0x169598['ListId'],'scheduledat':_0x169598['scheduledat']?_0x169598[_0x952d('0x18')]:moment()['format'](_0x952d('0x1a')),'priority':_0x169598[_0x952d('0x29')]?_0x169598['priority']:0x2,'callback':_0x169598[_0x952d('0x2a')]?!![]:![],'callbackuniqueid':_0x169598[_0x952d('0x2a')]?_0x169598[_0x952d('0x2a')]:undefined,'callbackat':_0x169598[_0x952d('0x2a')]?moment()['format'](_0x952d('0x1a')):undefined,'CampaignId':_0x26b49d['id']})[_0x952d('0x2b')](_0x498e25());}}}});})[_0x952d('0x22')](function(){return _0x2012a4[_0x952d('0x30')][_0x952d('0x35')]({'attributes':['id'],'include':[{'model':_0x2012a4[_0x952d('0x38')],'as':_0x952d('0x3b'),'where':{'id':_0x169598[_0x952d('0x28')]}}]})[_0x952d('0x22')](function(_0x44ce03){if(_0x44ce03){var _0x384d02=[];for(var _0xe130ff=0x0,_0x32cf4d;_0xe130ff<_0x44ce03[_0x952d('0x39')];_0xe130ff+=0x1){_0x32cf4d=_0x44ce03[_0xe130ff][_0x952d('0x14')]({'plain':!![]});_0x2012a4[_0x952d('0x40')][_0x952d('0x27')]({'phone':_0x169598[_0x952d('0xc')],'ContactId':_0x169598['id'],'ListId':_0x169598['ListId'],'CampaignId':_0x32cf4d['id']})[_0x952d('0x2b')](function(_0xb1b5af){logger[_0x952d('0x2f')](_0x952d('0x3c'),_0x952d('0x16'),_0xb1b5af[_0x952d('0x3d')]);});}}});})[_0x952d('0x22')](function(){_0x1b8ea0();})[_0x952d('0x2b')](function(_0x57a5f9){logger[_0x952d('0x2f')]('cmContact,\x20%s,\x20%s',_0x952d('0x16'),_0x57a5f9[_0x952d('0x3d')]);_0x1b8ea0(_0x57a5f9);});}else{_0x1b8ea0(new Error(_0x952d('0x41')));}},'afterDestroy':function(_0x4a61cd,_0x38860c,_0x217e04){var _0x4fff08=_0xd5cef3['models'];var _0x4b4e80=_0x4a61cd[_0x952d('0x14')]({'plain':!![]});return _0x4fff08[_0x952d('0x26')][_0x952d('0x35')]({'raw':!![],'where':{'ListId':_0x4b4e80[_0x952d('0x28')],'ContactId':_0x4b4e80['id']}})[_0x952d('0x22')](function(_0x4cbf98){if(!_['isEmpty'](_0x4cbf98)){var _0x4662a7=[];for(var _0x594a4b=0x0;_0x594a4b<_0x4cbf98[_0x952d('0x39')];_0x594a4b+=0x1){var _0x538060=_0x4fff08[_0x952d('0x26')][_0x952d('0x42')]({'where':{'ListId':_0x4cbf98[_0x594a4b][_0x952d('0x28')],'ContactId':_0x4cbf98[_0x594a4b]['ContactId'],'VoiceQueueId':_0x4cbf98[_0x594a4b][_0x952d('0x43')],'CampaignId':_0x4cbf98[_0x594a4b][_0x952d('0x44')]}});_0x4662a7['push'](_0x538060);}return BPromise[_0x952d('0x45')](_0x4662a7);}})[_0x952d('0x22')](function(_0x3821dd){logger[_0x952d('0x46')](_0x952d('0x47'),util[_0x952d('0x17')](_0x3821dd,{'showHidden':![],'depth':null}));_0x217e04();})[_0x952d('0x2b')](function(_0x47b68f){logger[_0x952d('0x2f')](_0x952d('0x48'),util[_0x952d('0x17')](_0x47b68f,{'showHidden':![],'depth':null}));_0x217e04(_0x47b68f);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 53e9143..b6acade 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x944484,_0x52965a){var _0x3b5a0a=function(_0x50c9e2){while(--_0x50c9e2){_0x944484['push'](_0x944484['shift']());}};_0x3b5a0a(++_0x52965a);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x8e9117,_0x1ff686){var _0x23b7f3=function(_0x224b9b){while(--_0x224b9b){_0x8e9117['push'](_0x8e9117['shift']());}};_0x23b7f3(++_0x1ff686);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 537391a..fe2536a 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 _0xe43c=['sequelize','exports','INTEGER','STRING'];(function(_0xfc406a,_0x4479e1){var _0x395473=function(_0x1fe8b6){while(--_0x1fe8b6){_0xfc406a['push'](_0xfc406a['shift']());}};_0x395473(++_0x4479e1);}(_0xe43c,0x180));var _0xce43=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xe43c[_0x209941];return _0x1e8729;};'use strict';var Sequelize=require(_0xce43('0x0'));module[_0xce43('0x1')]={'CmContactId':{'type':Sequelize[_0xce43('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xce43('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xce43('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xce43('0x3')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xce43('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0xe79a=['PHONE','INTEGER','STRING'];(function(_0x5af05d,_0x4b0006){var _0x56fd1c=function(_0x3ec1c5){while(--_0x3ec1c5){_0x5af05d['push'](_0x5af05d['shift']());}};_0x56fd1c(++_0x4b0006);}(_0xe79a,0x70));var _0xae79=function(_0x1bcb2c,_0xf85d2a){_0x1bcb2c=_0x1bcb2c-0x0;var _0x843eab=_0xe79a[_0x1bcb2c];return _0x843eab;};'use strict';var Sequelize=require('sequelize');module['exports']={'CmContactId':{'type':Sequelize[_0xae79('0x0')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xae79('0x0')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xae79('0x1')],'defaultValue':_0xae79('0x2')},'OrderBy':{'type':Sequelize[_0xae79('0x0')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'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 bab595e..02a651e 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 _0x4555=['count','offset','set','Content-Range','apply','reject','save','update','then','get','destroy','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4555,0x192));var _0x5455=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4555[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5455('0x0'));var jsonpatch=require(_0x5455('0x1'));var rp=require(_0x5455('0x2'));var moment=require(_0x5455('0x3'));var BPromise=require(_0x5455('0x4'));var Mustache=require(_0x5455('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5455('0x6'));var csv=require(_0x5455('0x7'));var ejs=require(_0x5455('0x8'));var fs=require('fs');var fs_extra=require(_0x5455('0x9'));var _=require(_0x5455('0xa'));var squel=require(_0x5455('0xb'));var crypto=require(_0x5455('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5455('0xd'));var toCsv=require(_0x5455('0x7'));var querystring=require('querystring');var Papa=require(_0x5455('0xe'));var Redis=require(_0x5455('0xf'));var authService=require(_0x5455('0x10'));var qs=require(_0x5455('0x11'));var as=require(_0x5455('0x12'));var hardwareService=require(_0x5455('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5455('0x14'));var config=require(_0x5455('0x15'));var licenseUtil=require(_0x5455('0x16'));var db=require(_0x5455('0x17'))['db'];function respondWithStatusCode(_0x2819e0,_0x17e34d){_0x17e34d=_0x17e34d||0xcc;return function(_0x206cf5){if(_0x206cf5){return _0x2819e0['sendStatus'](_0x17e34d);}return _0x2819e0[_0x5455('0x18')](_0x17e34d)[_0x5455('0x19')]();};}function respondWithResult(_0x251b01,_0x2501f1){_0x2501f1=_0x2501f1||0xc8;return function(_0x430d7b){if(_0x430d7b){return _0x251b01[_0x5455('0x18')](_0x2501f1)[_0x5455('0x1a')](_0x430d7b);}};}function respondWithFilteredResult(_0xd013b,_0x238e7a){return function(_0xdcabb5){if(_0xdcabb5){var _0x182d1d=typeof _0x238e7a['offset']===_0x5455('0x1b')&&typeof _0x238e7a['limit']==='undefined';var _0x553fd9=_0xdcabb5[_0x5455('0x1c')];var _0x122d36=_0x182d1d?0x0:_0x238e7a[_0x5455('0x1d')];var _0xc2be8e=_0x182d1d?_0xdcabb5['count']:_0x238e7a[_0x5455('0x1d')]+_0x238e7a['limit'];var _0x3dedbb;if(_0xc2be8e>=_0x553fd9){_0xc2be8e=_0x553fd9;_0x3dedbb=0xc8;}else{_0x3dedbb=0xce;}_0xd013b[_0x5455('0x18')](_0x3dedbb);return _0xd013b[_0x5455('0x1e')](_0x5455('0x1f'),_0x122d36+'-'+_0xc2be8e+'/'+_0x553fd9)['json'](_0xdcabb5);}return null;};}function patchUpdates(_0x2b0680){return function(_0x2ac473){try{jsonpatch[_0x5455('0x20')](_0x2ac473,_0x2b0680,!![]);}catch(_0x21b8f8){return BPromise[_0x5455('0x21')](_0x21b8f8);}return _0x2ac473[_0x5455('0x22')]();};}function saveUpdates(_0x4062ff,_0x120c37){return function(_0x30f916){if(_0x30f916){return _0x30f916[_0x5455('0x23')](_0x4062ff)[_0x5455('0x24')](function(_0x57cec8){return _0x57cec8;});}return null;};}function removeEntity(_0x717bc9,_0x9f2211){return function(_0x5436ba){if(_0x5436ba){return _0x5436ba['destroy']()[_0x5455('0x24')](function(){var _0x180a12=_0x5436ba[_0x5455('0x25')]({'plain':!![]});var _0x276823='CmContactHasItems';return db['UserProfileResource'][_0x5455('0x26')]({'where':{'type':_0x276823,'resourceId':_0x180a12['id']}})['then'](function(){return _0x5436ba;});})[_0x5455('0x24')](function(){_0x717bc9[_0x5455('0x18')](0xcc)[_0x5455('0x19')]();});}};}function handleEntityNotFound(_0x35e24d,_0x46896d){return function(_0x2827d6){if(!_0x2827d6){_0x35e24d['sendStatus'](0x194);}return _0x2827d6;};}function handleError(_0x2c627e,_0xfc4d35){_0xfc4d35=_0xfc4d35||0x1f4;return function(_0x3f8be8){logger[_0x5455('0x27')](_0x3f8be8[_0x5455('0x28')]);if(_0x3f8be8['name']){delete _0x3f8be8[_0x5455('0x29')];}_0x2c627e[_0x5455('0x18')](_0xfc4d35)[_0x5455('0x2a')](_0x3f8be8);};}exports[_0x5455('0x2b')]=function(_0x5a048a,_0x361da0){var _0x36c83c={},_0x454bc3={},_0x5ad266={'count':0x0,'rows':[]};var _0x37e760=_[_0x5455('0x2c')](db[_0x5455('0x2d')][_0x5455('0x2e')],function(_0x420e97){return{'name':_0x420e97[_0x5455('0x2f')],'type':_0x420e97[_0x5455('0x30')][_0x5455('0x31')]};});_0x454bc3[_0x5455('0x32')]=_[_0x5455('0x2c')](_0x37e760,_0x5455('0x29'));_0x454bc3[_0x5455('0x33')]=_[_0x5455('0x34')](_0x5a048a[_0x5455('0x33')]);_0x454bc3[_0x5455('0x35')]=_['intersection'](_0x454bc3[_0x5455('0x32')],_0x454bc3[_0x5455('0x33')]);_0x36c83c[_0x5455('0x36')]=_[_0x5455('0x37')](_0x454bc3[_0x5455('0x32')],qs['fields'](_0x5a048a['query'][_0x5455('0x38')]));_0x36c83c[_0x5455('0x36')]=_0x36c83c[_0x5455('0x36')][_0x5455('0x39')]?_0x36c83c['attributes']:_0x454bc3['model'];if(!_0x5a048a[_0x5455('0x33')][_0x5455('0x3a')](_0x5455('0x3b'))){_0x36c83c[_0x5455('0x3c')]=qs[_0x5455('0x3c')](_0x5a048a[_0x5455('0x33')]['limit']);_0x36c83c[_0x5455('0x1d')]=qs[_0x5455('0x1d')](_0x5a048a[_0x5455('0x33')][_0x5455('0x1d')]);}_0x36c83c[_0x5455('0x3d')]=qs[_0x5455('0x3e')](_0x5a048a[_0x5455('0x33')][_0x5455('0x3e')]);_0x36c83c[_0x5455('0x3f')]=qs[_0x5455('0x35')](_[_0x5455('0x40')](_0x5a048a[_0x5455('0x33')],_0x454bc3[_0x5455('0x35')]),_0x37e760);if(_0x5a048a[_0x5455('0x33')][_0x5455('0x41')]){_0x36c83c[_0x5455('0x3f')]=_[_0x5455('0x42')](_0x36c83c['where'],{'$or':_[_0x5455('0x2c')](_0x37e760,function(_0x163737){if(_0x163737[_0x5455('0x30')]!==_0x5455('0x43')){var _0x9632a={};_0x9632a[_0x163737[_0x5455('0x29')]]={'$like':'%'+_0x5a048a[_0x5455('0x33')]['filter']+'%'};return _0x9632a;}})});}_0x36c83c=_['merge']({},_0x36c83c,_0x5a048a['options']);var _0x5200b9={'where':_0x36c83c[_0x5455('0x3f')]};return db['CmContactHasItem']['count'](_0x5200b9)[_0x5455('0x24')](function(_0x36ac99){_0x5ad266[_0x5455('0x1c')]=_0x36ac99;if(_0x5a048a[_0x5455('0x33')]['includeAll']){_0x36c83c[_0x5455('0x44')]=[{'all':!![]}];}return db[_0x5455('0x2d')][_0x5455('0x45')](_0x36c83c);})[_0x5455('0x24')](function(_0x4d0a4d){_0x5ad266[_0x5455('0x46')]=_0x4d0a4d;return _0x5ad266;})[_0x5455('0x24')](respondWithFilteredResult(_0x361da0,_0x36c83c))[_0x5455('0x47')](handleError(_0x361da0,null));};exports[_0x5455('0x48')]=function(_0x38c08a,_0xdfefc5){var _0xa920c4={'raw':!![],'where':{'id':_0x38c08a[_0x5455('0x49')]['id']}},_0xd6fd29={};_0xd6fd29[_0x5455('0x32')]=_[_0x5455('0x34')](db[_0x5455('0x2d')][_0x5455('0x2e')]);_0xd6fd29[_0x5455('0x33')]=_[_0x5455('0x34')](_0x38c08a[_0x5455('0x33')]);_0xd6fd29[_0x5455('0x35')]=_[_0x5455('0x37')](_0xd6fd29[_0x5455('0x32')],_0xd6fd29[_0x5455('0x33')]);_0xa920c4['attributes']=_[_0x5455('0x37')](_0xd6fd29[_0x5455('0x32')],qs[_0x5455('0x38')](_0x38c08a['query'][_0x5455('0x38')]));_0xa920c4['attributes']=_0xa920c4['attributes'][_0x5455('0x39')]?_0xa920c4['attributes']:_0xd6fd29['model'];if(_0x38c08a[_0x5455('0x33')]['includeAll']){_0xa920c4[_0x5455('0x44')]=[{'all':!![]}];}_0xa920c4=_[_0x5455('0x42')]({},_0xa920c4,_0x38c08a[_0x5455('0x4a')]);return db[_0x5455('0x2d')]['find'](_0xa920c4)[_0x5455('0x24')](handleEntityNotFound(_0xdfefc5,null))[_0x5455('0x24')](respondWithResult(_0xdfefc5,null))[_0x5455('0x47')](handleError(_0xdfefc5,null));};exports[_0x5455('0x4b')]=function(_0x2aaaea,_0x5d139c){return db[_0x5455('0x2d')][_0x5455('0x4b')](_0x2aaaea['body'],{})[_0x5455('0x24')](function(_0x1b97fd){var _0x442d62=_0x2aaaea[_0x5455('0x4c')][_0x5455('0x25')]({'plain':!![]});if(!_0x442d62)throw new Error(_0x5455('0x4d'));if(_0x442d62[_0x5455('0x4e')]===_0x5455('0x4c')){var _0x3296a7=_0x1b97fd['get']({'plain':!![]});var _0x1f8061=_0x5455('0x4f');return db[_0x5455('0x50')][_0x5455('0x51')]({'where':{'name':_0x1f8061,'userProfileId':_0x442d62[_0x5455('0x52')]},'raw':!![]})[_0x5455('0x24')](function(_0x116652){if(_0x116652&&_0x116652[_0x5455('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x3296a7[_0x5455('0x29')],'resourceId':_0x3296a7['id'],'type':_0x116652['name'],'sectionId':_0x116652['id']},{})[_0x5455('0x24')](function(){return _0x1b97fd;});}else{return _0x1b97fd;}})['catch'](function(_0x5b0b37){logger['error'](_0x5455('0x54'),_0x5b0b37);throw _0x5b0b37;});}return _0x1b97fd;})['then'](respondWithResult(_0x5d139c,0xc9))[_0x5455('0x47')](handleError(_0x5d139c,null));};exports['update']=function(_0x3c86c7,_0x45f87f){if(_0x3c86c7[_0x5455('0x55')]['id']){delete _0x3c86c7[_0x5455('0x55')]['id'];}return db[_0x5455('0x2d')]['find']({'where':{'id':_0x3c86c7[_0x5455('0x49')]['id']}})[_0x5455('0x24')](handleEntityNotFound(_0x45f87f,null))[_0x5455('0x24')](saveUpdates(_0x3c86c7['body'],null))[_0x5455('0x24')](respondWithResult(_0x45f87f,null))[_0x5455('0x47')](handleError(_0x45f87f,null));};exports[_0x5455('0x26')]=function(_0x20baf1,_0x499088){return db['CmContactHasItem'][_0x5455('0x51')]({'where':{'id':_0x20baf1[_0x5455('0x49')]['id']}})['then'](handleEntityNotFound(_0x499088,null))[_0x5455('0x24')](removeEntity(_0x499088,null))[_0x5455('0x47')](handleError(_0x499088,null));}; \ No newline at end of file +var _0x9898=['nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','catch','body','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','reject','save','update','destroy','then','get','CmContactHasItems','end','error','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0xdb185d,_0x30b7e1){var _0x4e49d9=function(_0x4a5b83){while(--_0x4a5b83){_0xdb185d['push'](_0xdb185d['shift']());}};_0x4e49d9(++_0x30b7e1);}(_0x9898,0xb8));var _0x8989=function(_0x423097,_0x8a09f4){_0x423097=_0x423097-0x0;var _0x3a73f1=_0x9898[_0x423097];return _0x3a73f1;};'use strict';var emlformat=require(_0x8989('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8989('0x1'));var rp=require(_0x8989('0x2'));var moment=require(_0x8989('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8989('0x4'));var util=require(_0x8989('0x5'));var path=require(_0x8989('0x6'));var sox=require(_0x8989('0x7'));var csv=require(_0x8989('0x8'));var ejs=require(_0x8989('0x9'));var fs=require('fs');var fs_extra=require(_0x8989('0xa'));var _=require(_0x8989('0xb'));var squel=require(_0x8989('0xc'));var crypto=require('crypto');var jsforce=require(_0x8989('0xd'));var deskjs=require(_0x8989('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8989('0xf'));var Redis=require(_0x8989('0x10'));var authService=require(_0x8989('0x11'));var qs=require(_0x8989('0x12'));var as=require(_0x8989('0x13'));var hardwareService=require(_0x8989('0x14'));var logger=require('../../config/logger')(_0x8989('0x15'));var utils=require('../../config/utils');var config=require(_0x8989('0x16'));var licenseUtil=require(_0x8989('0x17'));var db=require(_0x8989('0x18'))['db'];function respondWithStatusCode(_0x2f6b3e,_0x1214e5){_0x1214e5=_0x1214e5||0xcc;return function(_0x3a20e1){if(_0x3a20e1){return _0x2f6b3e[_0x8989('0x19')](_0x1214e5);}return _0x2f6b3e[_0x8989('0x1a')](_0x1214e5)['end']();};}function respondWithResult(_0x477f05,_0x507aa2){_0x507aa2=_0x507aa2||0xc8;return function(_0x2ad48a){if(_0x2ad48a){return _0x477f05['status'](_0x507aa2)[_0x8989('0x1b')](_0x2ad48a);}};}function respondWithFilteredResult(_0x49413e,_0x19d86d){return function(_0x5e0705){if(_0x5e0705){var _0x1e3374=typeof _0x19d86d[_0x8989('0x1c')]==='undefined'&&typeof _0x19d86d[_0x8989('0x1d')]==='undefined';var _0x3e42ed=_0x5e0705[_0x8989('0x1e')];var _0x4c9693=_0x1e3374?0x0:_0x19d86d['offset'];var _0x47fe62=_0x1e3374?_0x5e0705[_0x8989('0x1e')]:_0x19d86d[_0x8989('0x1c')]+_0x19d86d[_0x8989('0x1d')];var _0x468a96;if(_0x47fe62>=_0x3e42ed){_0x47fe62=_0x3e42ed;_0x468a96=0xc8;}else{_0x468a96=0xce;}_0x49413e[_0x8989('0x1a')](_0x468a96);return _0x49413e['set']('Content-Range',_0x4c9693+'-'+_0x47fe62+'/'+_0x3e42ed)[_0x8989('0x1b')](_0x5e0705);}return null;};}function patchUpdates(_0x5f4ef2){return function(_0x336a76){try{jsonpatch['apply'](_0x336a76,_0x5f4ef2,!![]);}catch(_0x46c05e){return BPromise[_0x8989('0x1f')](_0x46c05e);}return _0x336a76[_0x8989('0x20')]();};}function saveUpdates(_0x5da36d,_0x511079){return function(_0x292974){if(_0x292974){return _0x292974[_0x8989('0x21')](_0x5da36d)['then'](function(_0x296dee){return _0x296dee;});}return null;};}function removeEntity(_0x574ba9,_0x30708b){return function(_0x13da6a){if(_0x13da6a){return _0x13da6a[_0x8989('0x22')]()[_0x8989('0x23')](function(){var _0x1dfe0f=_0x13da6a[_0x8989('0x24')]({'plain':!![]});var _0x22620b=_0x8989('0x25');return db['UserProfileResource'][_0x8989('0x22')]({'where':{'type':_0x22620b,'resourceId':_0x1dfe0f['id']}})[_0x8989('0x23')](function(){return _0x13da6a;});})[_0x8989('0x23')](function(){_0x574ba9[_0x8989('0x1a')](0xcc)[_0x8989('0x26')]();});}};}function handleEntityNotFound(_0x12a971,_0x5a6c71){return function(_0x50ef65){if(!_0x50ef65){_0x12a971[_0x8989('0x19')](0x194);}return _0x50ef65;};}function handleError(_0x36f96d,_0x3c1ae3){_0x3c1ae3=_0x3c1ae3||0x1f4;return function(_0x2244db){logger[_0x8989('0x27')](_0x2244db['stack']);if(_0x2244db[_0x8989('0x28')]){delete _0x2244db[_0x8989('0x28')];}_0x36f96d[_0x8989('0x1a')](_0x3c1ae3)[_0x8989('0x29')](_0x2244db);};}exports[_0x8989('0x2a')]=function(_0x4b6fb4,_0xff6a0f){var _0x2cc073={},_0x9fab11={},_0x1f4f31={'count':0x0,'rows':[]};var _0xf70f8e=_[_0x8989('0x2b')](db[_0x8989('0x2c')][_0x8989('0x2d')],function(_0x4ee1d5){return{'name':_0x4ee1d5[_0x8989('0x2e')],'type':_0x4ee1d5['type']['key']};});_0x9fab11[_0x8989('0x2f')]=_[_0x8989('0x2b')](_0xf70f8e,_0x8989('0x28'));_0x9fab11['query']=_[_0x8989('0x30')](_0x4b6fb4[_0x8989('0x31')]);_0x9fab11[_0x8989('0x32')]=_[_0x8989('0x33')](_0x9fab11[_0x8989('0x2f')],_0x9fab11[_0x8989('0x31')]);_0x2cc073[_0x8989('0x34')]=_[_0x8989('0x33')](_0x9fab11[_0x8989('0x2f')],qs[_0x8989('0x35')](_0x4b6fb4[_0x8989('0x31')]['fields']));_0x2cc073[_0x8989('0x34')]=_0x2cc073[_0x8989('0x34')][_0x8989('0x36')]?_0x2cc073[_0x8989('0x34')]:_0x9fab11[_0x8989('0x2f')];if(!_0x4b6fb4[_0x8989('0x31')][_0x8989('0x37')](_0x8989('0x38'))){_0x2cc073[_0x8989('0x1d')]=qs[_0x8989('0x1d')](_0x4b6fb4[_0x8989('0x31')][_0x8989('0x1d')]);_0x2cc073[_0x8989('0x1c')]=qs[_0x8989('0x1c')](_0x4b6fb4[_0x8989('0x31')][_0x8989('0x1c')]);}_0x2cc073[_0x8989('0x39')]=qs['sort'](_0x4b6fb4[_0x8989('0x31')][_0x8989('0x3a')]);_0x2cc073[_0x8989('0x3b')]=qs[_0x8989('0x32')](_[_0x8989('0x3c')](_0x4b6fb4[_0x8989('0x31')],_0x9fab11[_0x8989('0x32')]),_0xf70f8e);if(_0x4b6fb4[_0x8989('0x31')][_0x8989('0x3d')]){_0x2cc073[_0x8989('0x3b')]=_[_0x8989('0x3e')](_0x2cc073[_0x8989('0x3b')],{'$or':_[_0x8989('0x2b')](_0xf70f8e,function(_0x405398){if(_0x405398[_0x8989('0x3f')]!=='VIRTUAL'){var _0x26f643={};_0x26f643[_0x405398[_0x8989('0x28')]]={'$like':'%'+_0x4b6fb4[_0x8989('0x31')][_0x8989('0x3d')]+'%'};return _0x26f643;}})});}_0x2cc073=_[_0x8989('0x3e')]({},_0x2cc073,_0x4b6fb4[_0x8989('0x40')]);var _0x2dd876={'where':_0x2cc073[_0x8989('0x3b')]};return db[_0x8989('0x2c')][_0x8989('0x1e')](_0x2dd876)[_0x8989('0x23')](function(_0x35d682){_0x1f4f31[_0x8989('0x1e')]=_0x35d682;if(_0x4b6fb4[_0x8989('0x31')][_0x8989('0x41')]){_0x2cc073['include']=[{'all':!![]}];}return db[_0x8989('0x2c')][_0x8989('0x42')](_0x2cc073);})[_0x8989('0x23')](function(_0x55b322){_0x1f4f31[_0x8989('0x43')]=_0x55b322;return _0x1f4f31;})[_0x8989('0x23')](respondWithFilteredResult(_0xff6a0f,_0x2cc073))['catch'](handleError(_0xff6a0f,null));};exports[_0x8989('0x44')]=function(_0x38fa38,_0xf5c07){var _0x5e2df0={'raw':!![],'where':{'id':_0x38fa38[_0x8989('0x45')]['id']}},_0x14ae11={};_0x14ae11[_0x8989('0x2f')]=_[_0x8989('0x30')](db[_0x8989('0x2c')]['rawAttributes']);_0x14ae11['query']=_['keys'](_0x38fa38[_0x8989('0x31')]);_0x14ae11[_0x8989('0x32')]=_[_0x8989('0x33')](_0x14ae11[_0x8989('0x2f')],_0x14ae11[_0x8989('0x31')]);_0x5e2df0['attributes']=_[_0x8989('0x33')](_0x14ae11['model'],qs[_0x8989('0x35')](_0x38fa38[_0x8989('0x31')][_0x8989('0x35')]));_0x5e2df0[_0x8989('0x34')]=_0x5e2df0['attributes']['length']?_0x5e2df0[_0x8989('0x34')]:_0x14ae11[_0x8989('0x2f')];if(_0x38fa38['query'][_0x8989('0x41')]){_0x5e2df0[_0x8989('0x46')]=[{'all':!![]}];}_0x5e2df0=_[_0x8989('0x3e')]({},_0x5e2df0,_0x38fa38[_0x8989('0x40')]);return db[_0x8989('0x2c')][_0x8989('0x47')](_0x5e2df0)[_0x8989('0x23')](handleEntityNotFound(_0xf5c07,null))[_0x8989('0x23')](respondWithResult(_0xf5c07,null))['catch'](handleError(_0xf5c07,null));};exports[_0x8989('0x48')]=function(_0xf5a782,_0x2751f7){return db[_0x8989('0x2c')]['create'](_0xf5a782['body'],{})[_0x8989('0x23')](function(_0x3b4e53){var _0x42c2d7=_0xf5a782[_0x8989('0x49')][_0x8989('0x24')]({'plain':!![]});if(!_0x42c2d7)throw new Error(_0x8989('0x4a'));if(_0x42c2d7[_0x8989('0x4b')]===_0x8989('0x49')){var _0x34d066=_0x3b4e53['get']({'plain':!![]});var _0x1830fa=_0x8989('0x25');return db[_0x8989('0x4c')][_0x8989('0x47')]({'where':{'name':_0x1830fa,'userProfileId':_0x42c2d7['userProfileId']},'raw':!![]})[_0x8989('0x23')](function(_0x124eb8){if(_0x124eb8&&_0x124eb8['autoAssociation']===0x0){return db[_0x8989('0x4d')][_0x8989('0x48')]({'name':_0x34d066[_0x8989('0x28')],'resourceId':_0x34d066['id'],'type':_0x124eb8[_0x8989('0x28')],'sectionId':_0x124eb8['id']},{})[_0x8989('0x23')](function(){return _0x3b4e53;});}else{return _0x3b4e53;}})[_0x8989('0x4e')](function(_0x41684c){logger[_0x8989('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41684c);throw _0x41684c;});}return _0x3b4e53;})[_0x8989('0x23')](respondWithResult(_0x2751f7,0xc9))[_0x8989('0x4e')](handleError(_0x2751f7,null));};exports[_0x8989('0x21')]=function(_0xe4e8d3,_0x4f337c){if(_0xe4e8d3[_0x8989('0x4f')]['id']){delete _0xe4e8d3['body']['id'];}return db['CmContactHasItem'][_0x8989('0x47')]({'where':{'id':_0xe4e8d3[_0x8989('0x45')]['id']}})[_0x8989('0x23')](handleEntityNotFound(_0x4f337c,null))['then'](saveUpdates(_0xe4e8d3[_0x8989('0x4f')],null))['then'](respondWithResult(_0x4f337c,null))[_0x8989('0x4e')](handleError(_0x4f337c,null));};exports['destroy']=function(_0x4e16f4,_0x5bd13b){return db[_0x8989('0x2c')]['find']({'where':{'id':_0x4e16f4[_0x8989('0x45')]['id']}})[_0x8989('0x23')](handleEntityNotFound(_0x5bd13b,null))[_0x8989('0x23')](removeEntity(_0x5bd13b,null))['catch'](handleError(_0x5bd13b,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 30ad063..9167f45 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 _0xcaa9=['request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','bluebird'];(function(_0x19a14c,_0x5f06ca){var _0xa8e64d=function(_0x53a0ff){while(--_0x53a0ff){_0x19a14c['push'](_0x19a14c['shift']());}};_0xa8e64d(++_0x5f06ca);}(_0xcaa9,0x1d0));var _0x9caa=function(_0xd934d0,_0x41d73d){_0xd934d0=_0xd934d0-0x0;var _0x4a122c=_0xcaa9[_0xd934d0];return _0x4a122c;};'use strict';var _=require(_0x9caa('0x0'));var util=require(_0x9caa('0x1'));var logger=require(_0x9caa('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9caa('0x3'));var rp=require(_0x9caa('0x4'));var fs=require('fs');var path=require(_0x9caa('0x5'));var rimraf=require(_0x9caa('0x6'));var config=require(_0x9caa('0x7'));var attributes=require(_0x9caa('0x8'));module['exports']=function(_0x438e04,_0x252c1c){return _0x438e04[_0x9caa('0x9')](_0x9caa('0xa'),attributes,{'tableName':_0x9caa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef23=['bluebird','request-promise','rimraf','exports','define','CmContactHasItem','util','../../config/logger','api','moment'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0xef23,0x74));var _0x3ef2=function(_0x38b5d6,_0x40d489){_0x38b5d6=_0x38b5d6-0x0;var _0x5b929b=_0xef23[_0x38b5d6];return _0x5b929b;};'use strict';var _=require('lodash');var util=require(_0x3ef2('0x0'));var logger=require(_0x3ef2('0x1'))(_0x3ef2('0x2'));var moment=require(_0x3ef2('0x3'));var BPromise=require(_0x3ef2('0x4'));var rp=require(_0x3ef2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ef2('0x6'));var config=require('../../config/environment');var attributes=require('./cmContactHasItem.attributes');module[_0x3ef2('0x7')]=function(_0x4ab86e,_0x314ec4){return _0x4ab86e[_0x3ef2('0x8')](_0x3ef2('0x9'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 6301557..409fb40 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 _0x977e=['CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','CmContactHasItem,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','then','request\x20sent','debug'];(function(_0x571cb6,_0x105a03){var _0x4b7882=function(_0x178f74){while(--_0x178f74){_0x571cb6['push'](_0x571cb6['shift']());}};_0x4b7882(++_0x105a03);}(_0x977e,0xcd));var _0xe977=function(_0xe0dc0,_0x1ff66a){_0xe0dc0=_0xe0dc0-0x0;var _0x1c0efd=_0x977e[_0xe0dc0];return _0x1c0efd;};'use strict';var _=require(_0xe977('0x0'));var util=require(_0xe977('0x1'));var moment=require('moment');var BPromise=require(_0xe977('0x2'));var rs=require(_0xe977('0x3'));var fs=require('fs');var Redis=require(_0xe977('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe977('0x5'));var logger=require(_0xe977('0x6'))(_0xe977('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8c3e,_0x374ad9,_0x24b807){return new BPromise(function(_0x45b0f5,_0x4a5e76){return client['request'](_0x5a8c3e,_0x24b807)[_0xe977('0x8')](function(_0x6d401c){logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x374ad9,_0xe977('0x9'));logger[_0xe977('0xa')](_0xe977('0xb'),_0x374ad9,_0xe977('0x9'),JSON['stringify'](_0x6d401c));if(_0x6d401c[_0xe977('0xc')]){if(_0x6d401c['error'][_0xe977('0xd')]===0x1f4){logger[_0xe977('0xc')](_0xe977('0xe'),_0x374ad9,_0x6d401c[_0xe977('0xc')][_0xe977('0xf')]);return _0x4a5e76(_0x6d401c[_0xe977('0xc')][_0xe977('0xf')]);}logger['error'](_0xe977('0xe'),_0x374ad9,_0x6d401c[_0xe977('0xc')]['message']);return _0x45b0f5(_0x6d401c[_0xe977('0xc')][_0xe977('0xf')]);}else{logger['info'](_0xe977('0xe'),_0x374ad9,_0xe977('0x9'));_0x45b0f5(_0x6d401c[_0xe977('0x10')][_0xe977('0xf')]);}})[_0xe977('0x11')](function(_0x57444b){logger[_0xe977('0xc')](_0xe977('0xe'),_0x374ad9,_0x57444b);_0x4a5e76(_0x57444b);});});} \ No newline at end of file +var _0x5809=['CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info'];(function(_0x53c6e8,_0x4f8c8e){var _0xf5b3c4=function(_0x2ff033){while(--_0x2ff033){_0x53c6e8['push'](_0x53c6e8['shift']());}};_0xf5b3c4(++_0x4f8c8e);}(_0x5809,0x170));var _0x9580=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5809[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x9580('0x0'));var moment=require(_0x9580('0x1'));var BPromise=require('bluebird');var rs=require(_0x9580('0x2'));var fs=require('fs');var Redis=require(_0x9580('0x3'));var db=require(_0x9580('0x4'))['db'];var utils=require(_0x9580('0x5'));var logger=require(_0x9580('0x6'))(_0x9580('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9580('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x60bef4,_0x3cda37,_0x1fa155){return new BPromise(function(_0x57c482,_0x5ee546){return client[_0x9580('0x9')](_0x60bef4,_0x1fa155)[_0x9580('0xa')](function(_0x16488b){logger[_0x9580('0xb')](_0x9580('0xc'),_0x3cda37,_0x9580('0xd'));logger[_0x9580('0xe')](_0x9580('0xf'),_0x3cda37,'request\x20sent',JSON[_0x9580('0x10')](_0x16488b));if(_0x16488b['error']){if(_0x16488b[_0x9580('0x11')]['code']===0x1f4){logger[_0x9580('0x11')](_0x9580('0xc'),_0x3cda37,_0x16488b['error']['message']);return _0x5ee546(_0x16488b[_0x9580('0x11')][_0x9580('0x12')]);}logger[_0x9580('0x11')](_0x9580('0xc'),_0x3cda37,_0x16488b[_0x9580('0x11')][_0x9580('0x12')]);return _0x57c482(_0x16488b['error'][_0x9580('0x12')]);}else{logger[_0x9580('0xb')](_0x9580('0xc'),_0x3cda37,_0x9580('0xd'));_0x57c482(_0x16488b[_0x9580('0x13')][_0x9580('0x12')]);}})['catch'](function(_0x29af54){logger[_0x9580('0x11')](_0x9580('0xc'),_0x3cda37,_0x29af54);_0x5ee546(_0x29af54);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index e951fff..76a9e12 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 _0xb9c1=['../../config/environment','index','get','isAuthenticated','show','post','create','put','update','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x53fad1,_0xba394f){var _0x16c6d2=function(_0xb64e73){while(--_0xb64e73){_0x53fad1['push'](_0x53fad1['shift']());}};_0x16c6d2(++_0xba394f);}(_0xb9c1,0x10f));var _0x1b9c=function(_0x2d7182,_0x51d7b5){_0x2d7182=_0x2d7182-0x0;var _0x1017cc=_0xb9c1[_0x2d7182];return _0x1017cc;};'use strict';var multer=require(_0x1b9c('0x0'));var util=require(_0x1b9c('0x1'));var path=require(_0x1b9c('0x2'));var timeout=require(_0x1b9c('0x3'));var express=require(_0x1b9c('0x4'));var router=express[_0x1b9c('0x5')]();var fs_extra=require(_0x1b9c('0x6'));var auth=require(_0x1b9c('0x7'));var interaction=require(_0x1b9c('0x8'));var config=require(_0x1b9c('0x9'));var controller=require('./cmContactHasItem.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1b9c('0xa')]);router[_0x1b9c('0xb')]('/:id',auth[_0x1b9c('0xc')](),controller[_0x1b9c('0xd')]);router[_0x1b9c('0xe')]('/',auth[_0x1b9c('0xc')](),controller[_0x1b9c('0xf')]);router[_0x1b9c('0x10')]('/:id',auth[_0x1b9c('0xc')](),controller[_0x1b9c('0x11')]);router['delete'](_0x1b9c('0x12'),auth[_0x1b9c('0xc')](),controller['destroy']);module[_0x1b9c('0x13')]=router; \ No newline at end of file +var _0x0ffc=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','show','post','create','put','/:id','destroy','exports','util','path','express','fs-extra'];(function(_0x5c3514,_0x18e281){var _0x56e259=function(_0x4914e3){while(--_0x4914e3){_0x5c3514['push'](_0x5c3514['shift']());}};_0x56e259(++_0x18e281);}(_0x0ffc,0x9e));var _0xc0ff=function(_0x4fb452,_0x32f7b3){_0x4fb452=_0x4fb452-0x0;var _0x35b1bd=_0x0ffc[_0x4fb452];return _0x35b1bd;};'use strict';var multer=require('multer');var util=require(_0xc0ff('0x0'));var path=require(_0xc0ff('0x1'));var timeout=require('connect-timeout');var express=require(_0xc0ff('0x2'));var router=express['Router']();var fs_extra=require(_0xc0ff('0x3'));var auth=require(_0xc0ff('0x4'));var interaction=require(_0xc0ff('0x5'));var config=require(_0xc0ff('0x6'));var controller=require(_0xc0ff('0x7'));router[_0xc0ff('0x8')]('/',auth[_0xc0ff('0x9')](),controller[_0xc0ff('0xa')]);router[_0xc0ff('0x8')]('/:id',auth[_0xc0ff('0x9')](),controller[_0xc0ff('0xb')]);router[_0xc0ff('0xc')]('/',auth[_0xc0ff('0x9')](),controller[_0xc0ff('0xd')]);router[_0xc0ff('0xe')](_0xc0ff('0xf'),auth[_0xc0ff('0x9')](),controller['update']);router['delete'](_0xc0ff('0xf'),auth['isAuthenticated'](),controller[_0xc0ff('0x10')]);module[_0xc0ff('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 2e91bfe..063da35 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 _0xa077=['ENUM','voice','sequelize','exports','VIRTUAL','getDataValue','STRING','setDataValue','alias','name','TEXT','long','select','values','isArray','stringify','BOOLEAN'];(function(_0x25da99,_0x313ec6){var _0x3afc52=function(_0x18170b){while(--_0x18170b){_0x25da99['push'](_0x25da99['shift']());}};_0x3afc52(++_0x313ec6);}(_0xa077,0x79));var _0x7a07=function(_0x2dc805,_0x7e5b06){_0x2dc805=_0x2dc805-0x0;var _0xa3a815=_0xa077[_0x2dc805];return _0xa3a815;};'use strict';var Sequelize=require(_0x7a07('0x0'));var _=require('lodash');module[_0x7a07('0x1')]={'name':{'type':Sequelize[_0x7a07('0x2')],'get':function(_0x4ab7e1){return this[_0x7a07('0x3')]('alias');}},'alias':{'type':Sequelize[_0x7a07('0x4')],'allowNull':![],'set':function(_0x84606f){this[_0x7a07('0x5')](_0x7a07('0x6'),_0x84606f?_0x84606f:this[_0x7a07('0x3')](_0x7a07('0x7')));}},'type':{'type':Sequelize[_0x7a07('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x7a07('0x8')](_0x7a07('0x9')),'get':function(){if(this['getDataValue']('type')===_0x7a07('0xa')){return JSON['parse'](this[_0x7a07('0x3')](_0x7a07('0xb')));}else{return this['getDataValue'](_0x7a07('0xb'));}},'set':function(_0x2e83a3){if(Array[_0x7a07('0xc')](_0x2e83a3)){this[_0x7a07('0x5')](_0x7a07('0xb'),JSON[_0x7a07('0xd')](_0x2e83a3));}else{this[_0x7a07('0x5')](_0x7a07('0xb'),_0x2e83a3);}}},'required':{'type':Sequelize[_0x7a07('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x7a07('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x7a07('0xf')](_0x7a07('0x10'))}}; \ No newline at end of file +var _0xa5d0=['stringify','ENUM','voice','sequelize','lodash','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','type','select','parse','values'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xa5d0,0x183));var _0x0a5d=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa5d0[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0x0a5d('0x0'));var _=require(_0x0a5d('0x1'));module['exports']={'name':{'type':Sequelize[_0x0a5d('0x2')],'get':function(_0x1b8a79){return this[_0x0a5d('0x3')](_0x0a5d('0x4'));}},'alias':{'type':Sequelize[_0x0a5d('0x5')],'allowNull':![],'set':function(_0x23f748){this[_0x0a5d('0x6')]('alias',_0x23f748?_0x23f748:this[_0x0a5d('0x3')](_0x0a5d('0x7')));}},'type':{'type':Sequelize[_0x0a5d('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x0a5d('0x8')]('long'),'get':function(){if(this['getDataValue'](_0x0a5d('0x9'))===_0x0a5d('0xa')){return JSON[_0x0a5d('0xb')](this[_0x0a5d('0x3')](_0x0a5d('0xc')));}else{return this[_0x0a5d('0x3')](_0x0a5d('0xc'));}},'set':function(_0x306559){if(Array['isArray'](_0x306559)){this['setDataValue'](_0x0a5d('0xc'),JSON[_0x0a5d('0xd')](_0x306559));}else{this[_0x0a5d('0x6')](_0x0a5d('0xc'),_0x306559);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x0a5d('0xe')](_0x0a5d('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 708e3e6..d1d8e35 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 _0xcda4=['BOOLEAN','queryInterface','format','cf_%d','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','params','find','body','destroy','create','sequelize','transaction','Sequelize','text','TEXT','INTEGER','switch'];(function(_0x2684cc,_0x909c0c){var _0x23996d=function(_0x1a3b7d){while(--_0x1a3b7d){_0x2684cc['push'](_0x2684cc['shift']());}};_0x23996d(++_0x909c0c);}(_0xcda4,0xac));var _0x4cda=function(_0x3487af,_0x42005c){_0x3487af=_0x3487af-0x0;var _0x5d07ef=_0xcda4[_0x3487af];return _0x5d07ef;};'use strict';var emlformat=require(_0x4cda('0x0'));var rimraf=require(_0x4cda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4cda('0x2'));var BPromise=require(_0x4cda('0x3'));var Mustache=require(_0x4cda('0x4'));var util=require(_0x4cda('0x5'));var path=require(_0x4cda('0x6'));var sox=require(_0x4cda('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4cda('0x8'));var squel=require(_0x4cda('0x9'));var crypto=require(_0x4cda('0xa'));var jsforce=require(_0x4cda('0xb'));var deskjs=require(_0x4cda('0xc'));var toCsv=require(_0x4cda('0xd'));var querystring=require(_0x4cda('0xe'));var Papa=require(_0x4cda('0xf'));var Redis=require('ioredis');var authService=require(_0x4cda('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4cda('0x11'))(_0x4cda('0x12'));var utils=require(_0x4cda('0x13'));var config=require(_0x4cda('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4cda('0x15'))['db'];function respondWithStatusCode(_0xea3b44,_0x48c6cb){_0x48c6cb=_0x48c6cb||0xcc;return function(_0x18a33a){if(_0x18a33a){return _0xea3b44[_0x4cda('0x16')](_0x48c6cb);}return _0xea3b44[_0x4cda('0x17')](_0x48c6cb)[_0x4cda('0x18')]();};}function respondWithResult(_0x2857ce,_0x250205){_0x250205=_0x250205||0xc8;return function(_0x33ee13){if(_0x33ee13){return _0x2857ce['status'](_0x250205)[_0x4cda('0x19')](_0x33ee13);}};}function respondWithFilteredResult(_0x4cf8c9,_0x4113e9){return function(_0x2d771a){if(_0x2d771a){var _0x2a57cf=typeof _0x4113e9[_0x4cda('0x1a')]===_0x4cda('0x1b')&&typeof _0x4113e9[_0x4cda('0x1c')]===_0x4cda('0x1b');var _0x277aa2=_0x2d771a[_0x4cda('0x1d')];var _0x5dac78=_0x2a57cf?0x0:_0x4113e9[_0x4cda('0x1a')];var _0x5d8b51=_0x2a57cf?_0x2d771a[_0x4cda('0x1d')]:_0x4113e9[_0x4cda('0x1a')]+_0x4113e9[_0x4cda('0x1c')];var _0x37e533;if(_0x5d8b51>=_0x277aa2){_0x5d8b51=_0x277aa2;_0x37e533=0xc8;}else{_0x37e533=0xce;}_0x4cf8c9[_0x4cda('0x17')](_0x37e533);return _0x4cf8c9[_0x4cda('0x1e')](_0x4cda('0x1f'),_0x5dac78+'-'+_0x5d8b51+'/'+_0x277aa2)[_0x4cda('0x19')](_0x2d771a);}return null;};}function patchUpdates(_0x1f4f37){return function(_0x13548c){try{jsonpatch[_0x4cda('0x20')](_0x13548c,_0x1f4f37,!![]);}catch(_0x15d189){return BPromise['reject'](_0x15d189);}return _0x13548c[_0x4cda('0x21')]();};}function saveUpdates(_0x49cf20,_0x223b6f){return function(_0x3414b1){if(_0x3414b1){return _0x3414b1[_0x4cda('0x22')](_0x49cf20)[_0x4cda('0x23')](function(_0x1ee230){return _0x1ee230;});}return null;};}function removeEntity(_0x1e48a0,_0x531a68){return function(_0x48d499){if(_0x48d499){return _0x48d499['destroy']()['then'](function(){_0x1e48a0[_0x4cda('0x17')](0xcc)[_0x4cda('0x18')]();});}};}function handleEntityNotFound(_0x66b6aa,_0x4e59fe){return function(_0xd4db53){if(!_0xd4db53){_0x66b6aa[_0x4cda('0x16')](0x194);}return _0xd4db53;};}function handleError(_0x3ae2f5,_0x179db0){_0x179db0=_0x179db0||0x1f4;return function(_0x111270){logger['error'](_0x111270[_0x4cda('0x24')]);if(_0x111270[_0x4cda('0x25')]){delete _0x111270['name'];}_0x3ae2f5[_0x4cda('0x17')](_0x179db0)[_0x4cda('0x26')](_0x111270);};}exports[_0x4cda('0x27')]=function(_0x14fd91,_0x1543ac){var _0x28bad0={},_0x38dc3d={},_0x2d9335={'count':0x0,'rows':[]};var _0x109667=_[_0x4cda('0x28')](db[_0x4cda('0x29')][_0x4cda('0x2a')],function(_0x518549){return{'name':_0x518549[_0x4cda('0x2b')],'type':_0x518549[_0x4cda('0x2c')][_0x4cda('0x2d')]};});_0x38dc3d[_0x4cda('0x2e')]=_[_0x4cda('0x2f')](_[_0x4cda('0x28')](_0x109667,_0x4cda('0x25')),[_0x4cda('0x25')]);_0x38dc3d[_0x4cda('0x30')]=_[_0x4cda('0x31')](_0x14fd91[_0x4cda('0x30')]);_0x38dc3d[_0x4cda('0x32')]=_['intersection'](_0x38dc3d[_0x4cda('0x2e')],_0x38dc3d['query']);_0x28bad0[_0x4cda('0x33')]=_[_0x4cda('0x34')](_0x38dc3d[_0x4cda('0x2e')],qs[_0x4cda('0x35')](_0x14fd91[_0x4cda('0x30')][_0x4cda('0x35')]));_0x28bad0['attributes']=_0x28bad0[_0x4cda('0x33')][_0x4cda('0x36')]?_0x28bad0[_0x4cda('0x33')]:_0x38dc3d[_0x4cda('0x2e')];if(!_0x14fd91[_0x4cda('0x30')][_0x4cda('0x37')](_0x4cda('0x38'))){_0x28bad0[_0x4cda('0x1c')]=qs[_0x4cda('0x1c')](_0x14fd91[_0x4cda('0x30')][_0x4cda('0x1c')]);_0x28bad0[_0x4cda('0x1a')]=qs[_0x4cda('0x1a')](_0x14fd91[_0x4cda('0x30')]['offset']);}_0x28bad0[_0x4cda('0x39')]=qs['sort'](_0x14fd91['query'][_0x4cda('0x3a')]);_0x28bad0[_0x4cda('0x3b')]=qs[_0x4cda('0x32')](_[_0x4cda('0x3c')](_0x14fd91[_0x4cda('0x30')],_0x38dc3d['filters']),_0x109667);if(_0x14fd91[_0x4cda('0x30')][_0x4cda('0x3d')]){_0x28bad0[_0x4cda('0x3b')]=_[_0x4cda('0x3e')](_0x28bad0[_0x4cda('0x3b')],{'$or':_[_0x4cda('0x28')](_0x109667,function(_0x43e3b8){if(_0x43e3b8['type']!=='VIRTUAL'){var _0xdc7f91={};_0xdc7f91[_0x43e3b8['name']]={'$like':'%'+_0x14fd91['query'][_0x4cda('0x3d')]+'%'};return _0xdc7f91;}})});}_0x28bad0=_[_0x4cda('0x3e')]({},_0x28bad0,_0x14fd91[_0x4cda('0x3f')]);var _0x45414a={'where':_0x28bad0[_0x4cda('0x3b')]};return db[_0x4cda('0x29')]['count'](_0x45414a)[_0x4cda('0x23')](function(_0x29a265){_0x2d9335[_0x4cda('0x1d')]=_0x29a265;if(_0x14fd91[_0x4cda('0x30')][_0x4cda('0x40')]){_0x28bad0['include']=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x28bad0);})[_0x4cda('0x23')](function(_0x4d0cb3){_0x2d9335[_0x4cda('0x41')]=_0x4d0cb3;return _0x2d9335;})[_0x4cda('0x23')](respondWithFilteredResult(_0x1543ac,_0x28bad0))[_0x4cda('0x42')](handleError(_0x1543ac,null));};exports[_0x4cda('0x43')]=function(_0x2d96b9,_0x1ad7e7){var _0x3e45ad={'raw':!![],'where':{'id':_0x2d96b9[_0x4cda('0x44')]['id']}},_0x28117e={};_0x28117e['model']=_['keys'](db[_0x4cda('0x29')]['rawAttributes']);_0x28117e['query']=_['keys'](_0x2d96b9[_0x4cda('0x30')]);_0x28117e[_0x4cda('0x32')]=_[_0x4cda('0x34')](_0x28117e[_0x4cda('0x2e')],_0x28117e[_0x4cda('0x30')]);_0x3e45ad[_0x4cda('0x33')]=_['intersection'](_0x28117e[_0x4cda('0x2e')],qs['fields'](_0x2d96b9[_0x4cda('0x30')][_0x4cda('0x35')]));_0x3e45ad['attributes']=_0x3e45ad[_0x4cda('0x33')][_0x4cda('0x36')]?_0x3e45ad[_0x4cda('0x33')]:_0x28117e[_0x4cda('0x2e')];if(_0x2d96b9[_0x4cda('0x30')]['includeAll']){_0x3e45ad['include']=[{'all':!![]}];}_0x3e45ad=_[_0x4cda('0x3e')]({},_0x3e45ad,_0x2d96b9['options']);return db[_0x4cda('0x29')][_0x4cda('0x45')](_0x3e45ad)[_0x4cda('0x23')](handleEntityNotFound(_0x1ad7e7,null))[_0x4cda('0x23')](respondWithResult(_0x1ad7e7,null))[_0x4cda('0x42')](handleError(_0x1ad7e7,null));};exports[_0x4cda('0x22')]=function(_0x46ad14,_0x5be568){if(_0x46ad14['body']['id']){delete _0x46ad14['body']['id'];}return db[_0x4cda('0x29')][_0x4cda('0x45')]({'where':{'id':_0x46ad14[_0x4cda('0x44')]['id']}})[_0x4cda('0x23')](handleEntityNotFound(_0x5be568,null))['then'](saveUpdates(_0x46ad14[_0x4cda('0x46')],null))['then'](respondWithResult(_0x5be568,null))[_0x4cda('0x42')](handleError(_0x5be568,null));};exports[_0x4cda('0x47')]=function(_0x35ae40,_0x5a0a6d){return db[_0x4cda('0x29')][_0x4cda('0x45')]({'where':{'id':_0x35ae40['params']['id']}})[_0x4cda('0x23')](handleEntityNotFound(_0x5a0a6d,null))[_0x4cda('0x23')](removeEntity(_0x5a0a6d,null))[_0x4cda('0x42')](handleError(_0x5a0a6d,null));};exports[_0x4cda('0x48')]=function(_0x50ed91,_0x52cf4b){var _0x23d68b;return db[_0x4cda('0x49')][_0x4cda('0x4a')](function(_0x249c92){return db[_0x4cda('0x29')][_0x4cda('0x48')](_0x50ed91[_0x4cda('0x46')],{'transaction':_0x249c92})['then'](function(_0xf1482f){_0x23d68b=_0xf1482f;var _0x5a25b3={'type':db[_0x4cda('0x4b')]['TEXT'],'transaction':_0x249c92};switch(_0x50ed91[_0x4cda('0x46')][_0x4cda('0x2c')]){case _0x4cda('0x4c'):_0x5a25b3['type']=db[_0x4cda('0x4b')][_0x4cda('0x4d')];break;case'number':_0x5a25b3[_0x4cda('0x2c')]=db[_0x4cda('0x4b')][_0x4cda('0x4e')];break;case _0x4cda('0x4f'):_0x5a25b3['type']=db[_0x4cda('0x4b')][_0x4cda('0x50')];_0x5a25b3['defaultValue']=![];break;default:}return db['sequelize'][_0x4cda('0x51')]['addColumn']('cm_contacts',util[_0x4cda('0x52')](_0x4cda('0x53'),_0x23d68b['id']),_0x5a25b3);})[_0x4cda('0x23')](function(){return _0x23d68b;});})['then'](respondWithResult(_0x52cf4b,0xc9))[_0x4cda('0x42')](handleError(_0x52cf4b,null));}; \ No newline at end of file +var _0x4f09=['create','Sequelize','TEXT','text','number','BOOLEAN','defaultValue','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','options','find','update','body','params','sequelize','transaction'];(function(_0x4ff20d,_0x117f72){var _0x1e5adf=function(_0x2a3e59){while(--_0x2a3e59){_0x4ff20d['push'](_0x4ff20d['shift']());}};_0x1e5adf(++_0x117f72);}(_0x4f09,0xc1));var _0x94f0=function(_0x73986,_0x250a6e){_0x73986=_0x73986-0x0;var _0x2e90ea=_0x4f09[_0x73986];return _0x2e90ea;};'use strict';var emlformat=require(_0x94f0('0x0'));var rimraf=require(_0x94f0('0x1'));var zipdir=require(_0x94f0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x94f0('0x3'));var BPromise=require(_0x94f0('0x4'));var Mustache=require(_0x94f0('0x5'));var util=require(_0x94f0('0x6'));var path=require(_0x94f0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x94f0('0x8'));var fs=require('fs');var fs_extra=require(_0x94f0('0x9'));var _=require('lodash');var squel=require(_0x94f0('0xa'));var crypto=require(_0x94f0('0xb'));var jsforce=require(_0x94f0('0xc'));var deskjs=require(_0x94f0('0xd'));var toCsv=require(_0x94f0('0xe'));var querystring=require(_0x94f0('0xf'));var Papa=require(_0x94f0('0x10'));var Redis=require(_0x94f0('0x11'));var authService=require(_0x94f0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x94f0('0x13'));var hardwareService=require(_0x94f0('0x14'));var logger=require(_0x94f0('0x15'))(_0x94f0('0x16'));var utils=require(_0x94f0('0x17'));var config=require(_0x94f0('0x18'));var licenseUtil=require(_0x94f0('0x19'));var db=require(_0x94f0('0x1a'))['db'];function respondWithStatusCode(_0xe498a9,_0x2616eb){_0x2616eb=_0x2616eb||0xcc;return function(_0x513a61){if(_0x513a61){return _0xe498a9[_0x94f0('0x1b')](_0x2616eb);}return _0xe498a9[_0x94f0('0x1c')](_0x2616eb)[_0x94f0('0x1d')]();};}function respondWithResult(_0x24629b,_0x54bc6c){_0x54bc6c=_0x54bc6c||0xc8;return function(_0xa278bf){if(_0xa278bf){return _0x24629b['status'](_0x54bc6c)[_0x94f0('0x1e')](_0xa278bf);}};}function respondWithFilteredResult(_0x5af0c1,_0x58cdf7){return function(_0x548b86){if(_0x548b86){var _0x46a486=typeof _0x58cdf7[_0x94f0('0x1f')]===_0x94f0('0x20')&&typeof _0x58cdf7[_0x94f0('0x21')]===_0x94f0('0x20');var _0x1de64e=_0x548b86[_0x94f0('0x22')];var _0x16792d=_0x46a486?0x0:_0x58cdf7[_0x94f0('0x1f')];var _0x260e09=_0x46a486?_0x548b86['count']:_0x58cdf7[_0x94f0('0x1f')]+_0x58cdf7[_0x94f0('0x21')];var _0x5d0495;if(_0x260e09>=_0x1de64e){_0x260e09=_0x1de64e;_0x5d0495=0xc8;}else{_0x5d0495=0xce;}_0x5af0c1['status'](_0x5d0495);return _0x5af0c1[_0x94f0('0x23')](_0x94f0('0x24'),_0x16792d+'-'+_0x260e09+'/'+_0x1de64e)[_0x94f0('0x1e')](_0x548b86);}return null;};}function patchUpdates(_0x45ed6b){return function(_0x1735f9){try{jsonpatch[_0x94f0('0x25')](_0x1735f9,_0x45ed6b,!![]);}catch(_0x352b0f){return BPromise[_0x94f0('0x26')](_0x352b0f);}return _0x1735f9['save']();};}function saveUpdates(_0x3d1874,_0x5731ae){return function(_0x2c747b){if(_0x2c747b){return _0x2c747b['update'](_0x3d1874)[_0x94f0('0x27')](function(_0x31f8a7){return _0x31f8a7;});}return null;};}function removeEntity(_0x2b0abc,_0x3bd6f9){return function(_0x3dfe50){if(_0x3dfe50){return _0x3dfe50[_0x94f0('0x28')]()[_0x94f0('0x27')](function(){_0x2b0abc[_0x94f0('0x1c')](0xcc)[_0x94f0('0x1d')]();});}};}function handleEntityNotFound(_0x2f268a,_0x574961){return function(_0x288d9f){if(!_0x288d9f){_0x2f268a[_0x94f0('0x1b')](0x194);}return _0x288d9f;};}function handleError(_0x2c4c98,_0x30da4d){_0x30da4d=_0x30da4d||0x1f4;return function(_0x52dd90){logger[_0x94f0('0x29')](_0x52dd90[_0x94f0('0x2a')]);if(_0x52dd90[_0x94f0('0x2b')]){delete _0x52dd90['name'];}_0x2c4c98[_0x94f0('0x1c')](_0x30da4d)[_0x94f0('0x2c')](_0x52dd90);};}exports[_0x94f0('0x2d')]=function(_0x3a6142,_0x29c6df){var _0x28ecc9={},_0x1ac12d={},_0xc57d8b={'count':0x0,'rows':[]};var _0x395a12=_[_0x94f0('0x2e')](db[_0x94f0('0x2f')][_0x94f0('0x30')],function(_0xde7674){return{'name':_0xde7674[_0x94f0('0x31')],'type':_0xde7674['type'][_0x94f0('0x32')]};});_0x1ac12d[_0x94f0('0x33')]=_[_0x94f0('0x34')](_['map'](_0x395a12,_0x94f0('0x2b')),[_0x94f0('0x2b')]);_0x1ac12d[_0x94f0('0x35')]=_[_0x94f0('0x36')](_0x3a6142[_0x94f0('0x35')]);_0x1ac12d[_0x94f0('0x37')]=_['intersection'](_0x1ac12d[_0x94f0('0x33')],_0x1ac12d[_0x94f0('0x35')]);_0x28ecc9['attributes']=_[_0x94f0('0x38')](_0x1ac12d[_0x94f0('0x33')],qs[_0x94f0('0x39')](_0x3a6142[_0x94f0('0x35')][_0x94f0('0x39')]));_0x28ecc9['attributes']=_0x28ecc9[_0x94f0('0x3a')][_0x94f0('0x3b')]?_0x28ecc9[_0x94f0('0x3a')]:_0x1ac12d[_0x94f0('0x33')];if(!_0x3a6142[_0x94f0('0x35')][_0x94f0('0x3c')]('nolimit')){_0x28ecc9[_0x94f0('0x21')]=qs[_0x94f0('0x21')](_0x3a6142[_0x94f0('0x35')][_0x94f0('0x21')]);_0x28ecc9[_0x94f0('0x1f')]=qs[_0x94f0('0x1f')](_0x3a6142['query'][_0x94f0('0x1f')]);}_0x28ecc9[_0x94f0('0x3d')]=qs['sort'](_0x3a6142['query'][_0x94f0('0x3e')]);_0x28ecc9[_0x94f0('0x3f')]=qs['filters'](_['pick'](_0x3a6142[_0x94f0('0x35')],_0x1ac12d['filters']),_0x395a12);if(_0x3a6142['query'][_0x94f0('0x40')]){_0x28ecc9[_0x94f0('0x3f')]=_[_0x94f0('0x41')](_0x28ecc9[_0x94f0('0x3f')],{'$or':_['map'](_0x395a12,function(_0x939343){if(_0x939343[_0x94f0('0x42')]!==_0x94f0('0x43')){var _0x330a06={};_0x330a06[_0x939343['name']]={'$like':'%'+_0x3a6142[_0x94f0('0x35')]['filter']+'%'};return _0x330a06;}})});}_0x28ecc9=_[_0x94f0('0x41')]({},_0x28ecc9,_0x3a6142['options']);var _0x2066ed={'where':_0x28ecc9[_0x94f0('0x3f')]};return db[_0x94f0('0x2f')][_0x94f0('0x22')](_0x2066ed)[_0x94f0('0x27')](function(_0x4c3b13){_0xc57d8b[_0x94f0('0x22')]=_0x4c3b13;if(_0x3a6142[_0x94f0('0x35')][_0x94f0('0x44')]){_0x28ecc9[_0x94f0('0x45')]=[{'all':!![]}];}return db[_0x94f0('0x2f')][_0x94f0('0x46')](_0x28ecc9);})[_0x94f0('0x27')](function(_0x233669){_0xc57d8b['rows']=_0x233669;return _0xc57d8b;})[_0x94f0('0x27')](respondWithFilteredResult(_0x29c6df,_0x28ecc9))[_0x94f0('0x47')](handleError(_0x29c6df,null));};exports[_0x94f0('0x48')]=function(_0x2325d1,_0x39b30b){var _0x35ec25={'raw':!![],'where':{'id':_0x2325d1['params']['id']}},_0x57c1cf={};_0x57c1cf[_0x94f0('0x33')]=_[_0x94f0('0x36')](db['CmCustomField'][_0x94f0('0x30')]);_0x57c1cf[_0x94f0('0x35')]=_[_0x94f0('0x36')](_0x2325d1[_0x94f0('0x35')]);_0x57c1cf['filters']=_[_0x94f0('0x38')](_0x57c1cf[_0x94f0('0x33')],_0x57c1cf[_0x94f0('0x35')]);_0x35ec25[_0x94f0('0x3a')]=_['intersection'](_0x57c1cf[_0x94f0('0x33')],qs['fields'](_0x2325d1[_0x94f0('0x35')]['fields']));_0x35ec25['attributes']=_0x35ec25['attributes']['length']?_0x35ec25['attributes']:_0x57c1cf[_0x94f0('0x33')];if(_0x2325d1[_0x94f0('0x35')][_0x94f0('0x44')]){_0x35ec25[_0x94f0('0x45')]=[{'all':!![]}];}_0x35ec25=_[_0x94f0('0x41')]({},_0x35ec25,_0x2325d1[_0x94f0('0x49')]);return db[_0x94f0('0x2f')][_0x94f0('0x4a')](_0x35ec25)[_0x94f0('0x27')](handleEntityNotFound(_0x39b30b,null))[_0x94f0('0x27')](respondWithResult(_0x39b30b,null))['catch'](handleError(_0x39b30b,null));};exports[_0x94f0('0x4b')]=function(_0x2f90c0,_0x5e66ba){if(_0x2f90c0[_0x94f0('0x4c')]['id']){delete _0x2f90c0[_0x94f0('0x4c')]['id'];}return db[_0x94f0('0x2f')][_0x94f0('0x4a')]({'where':{'id':_0x2f90c0['params']['id']}})[_0x94f0('0x27')](handleEntityNotFound(_0x5e66ba,null))['then'](saveUpdates(_0x2f90c0[_0x94f0('0x4c')],null))[_0x94f0('0x27')](respondWithResult(_0x5e66ba,null))['catch'](handleError(_0x5e66ba,null));};exports[_0x94f0('0x28')]=function(_0x1e49c1,_0x506a8c){return db['CmCustomField'][_0x94f0('0x4a')]({'where':{'id':_0x1e49c1[_0x94f0('0x4d')]['id']}})[_0x94f0('0x27')](handleEntityNotFound(_0x506a8c,null))['then'](removeEntity(_0x506a8c,null))[_0x94f0('0x47')](handleError(_0x506a8c,null));};exports['create']=function(_0x7daa83,_0x27500a){var _0x39bc67;return db[_0x94f0('0x4e')][_0x94f0('0x4f')](function(_0x2a607a){return db[_0x94f0('0x2f')][_0x94f0('0x50')](_0x7daa83[_0x94f0('0x4c')],{'transaction':_0x2a607a})[_0x94f0('0x27')](function(_0x4f46cb){_0x39bc67=_0x4f46cb;var _0x252990={'type':db[_0x94f0('0x51')][_0x94f0('0x52')],'transaction':_0x2a607a};switch(_0x7daa83[_0x94f0('0x4c')][_0x94f0('0x42')]){case _0x94f0('0x53'):_0x252990['type']=db[_0x94f0('0x51')]['TEXT'];break;case _0x94f0('0x54'):_0x252990[_0x94f0('0x42')]=db[_0x94f0('0x51')]['INTEGER'];break;case'switch':_0x252990['type']=db[_0x94f0('0x51')][_0x94f0('0x55')];_0x252990[_0x94f0('0x56')]=![];break;default:}return db[_0x94f0('0x4e')]['queryInterface'][_0x94f0('0x57')](_0x94f0('0x58'),util[_0x94f0('0x59')](_0x94f0('0x5a'),_0x39bc67['id']),_0x252990);})[_0x94f0('0x27')](function(){return _0x39bc67;});})['then'](respondWithResult(_0x27500a,0xc9))[_0x94f0('0x47')](handleError(_0x27500a,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 64fcbb1..01549d2 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 _0xc172=['../../config/logger','api','moment','request-promise','exports','define','CmCustomField','lodash','util'];(function(_0x539533,_0x59b89b){var _0x3942f3=function(_0x3b386c){while(--_0x3b386c){_0x539533['push'](_0x539533['shift']());}};_0x3942f3(++_0x59b89b);}(_0xc172,0x1ae));var _0x2c17=function(_0x409964,_0xd87711){_0x409964=_0x409964-0x0;var _0x12af93=_0xc172[_0x409964];return _0x12af93;};'use strict';var _=require(_0x2c17('0x0'));var util=require(_0x2c17('0x1'));var logger=require(_0x2c17('0x2'))(_0x2c17('0x3'));var moment=require(_0x2c17('0x4'));var BPromise=require('bluebird');var rp=require(_0x2c17('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0x2c17('0x6')]=function(_0xe08d38,_0xf1be09){return _0xe08d38[_0x2c17('0x7')](_0x2c17('0x8'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15bd=['../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1bd3ab,_0x352c42){var _0x37e394=function(_0x2f581d){while(--_0x2f581d){_0x1bd3ab['push'](_0x1bd3ab['shift']());}};_0x37e394(++_0x352c42);}(_0x15bd,0x172));var _0xd15b=function(_0x117713,_0x1b3f0c){_0x117713=_0x117713-0x0;var _0x310d68=_0x15bd[_0x117713];return _0x310d68;};'use strict';var _=require('lodash');var util=require(_0xd15b('0x0'));var logger=require(_0xd15b('0x1'))(_0xd15b('0x2'));var moment=require(_0xd15b('0x3'));var BPromise=require(_0xd15b('0x4'));var rp=require(_0xd15b('0x5'));var fs=require('fs');var path=require(_0xd15b('0x6'));var rimraf=require('rimraf');var config=require(_0xd15b('0x7'));var attributes=require(_0xd15b('0x8'));module[_0xd15b('0x9')]=function(_0x5db91c,_0x357539){return _0x5db91c[_0xd15b('0xa')](_0xd15b('0xb'),attributes,{'tableName':_0xd15b('0xc'),'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 34b057b..90ec020 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 _0x158e=['jayson/promise','client','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','error','message','result','catch','moment','randomstring','../../mysqldb','../../config/logger'];(function(_0x5b73d4,_0x3e6be9){var _0x27f85c=function(_0x19df54){while(--_0x19df54){_0x5b73d4['push'](_0x5b73d4['shift']());}};_0x27f85c(++_0x3e6be9);}(_0x158e,0xdd));var _0xe158=function(_0x4fe254,_0x1f221c){_0x4fe254=_0x4fe254-0x0;var _0x2b7687=_0x158e[_0x4fe254];return _0x2b7687;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe158('0x0'));var BPromise=require('bluebird');var rs=require(_0xe158('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe158('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xe158('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe158('0x4'));var client=jayson[_0xe158('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45355b,_0x28611d,_0x407484){return new BPromise(function(_0x1b748c,_0x4e68a9){return client[_0xe158('0x6')](_0x45355b,_0x407484)[_0xe158('0x7')](function(_0x1b0fc0){logger['info'](_0xe158('0x8'),_0x28611d,_0xe158('0x9'));logger['debug'](_0xe158('0xa'),_0x28611d,_0xe158('0x9'),JSON['stringify'](_0x1b0fc0));if(_0x1b0fc0['error']){if(_0x1b0fc0[_0xe158('0xb')]['code']===0x1f4){logger[_0xe158('0xb')](_0xe158('0x8'),_0x28611d,_0x1b0fc0[_0xe158('0xb')][_0xe158('0xc')]);return _0x4e68a9(_0x1b0fc0[_0xe158('0xb')][_0xe158('0xc')]);}logger[_0xe158('0xb')]('CmCustomField,\x20%s,\x20%s',_0x28611d,_0x1b0fc0[_0xe158('0xb')][_0xe158('0xc')]);return _0x1b748c(_0x1b0fc0[_0xe158('0xb')]['message']);}else{logger['info'](_0xe158('0x8'),_0x28611d,'request\x20sent');_0x1b748c(_0x1b0fc0[_0xe158('0xd')][_0xe158('0xc')]);}})[_0xe158('0xe')](function(_0x5bdb07){logger['error'](_0xe158('0x8'),_0x28611d,_0x5bdb07);_0x4e68a9(_0x5bdb07);});});} \ No newline at end of file +var _0x0ec3=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x233dbc,_0x1a5c23){var _0x5c2804=function(_0x2e5d0c){while(--_0x2e5d0c){_0x233dbc['push'](_0x233dbc['shift']());}};_0x5c2804(++_0x1a5c23);}(_0x0ec3,0x1c5));var _0x30ec=function(_0x3eb522,_0x1149f7){_0x3eb522=_0x3eb522-0x0;var _0x376925=_0x0ec3[_0x3eb522];return _0x376925;};'use strict';var _=require('lodash');var util=require(_0x30ec('0x0'));var moment=require(_0x30ec('0x1'));var BPromise=require(_0x30ec('0x2'));var rs=require(_0x30ec('0x3'));var fs=require('fs');var Redis=require(_0x30ec('0x4'));var db=require(_0x30ec('0x5'))['db'];var utils=require(_0x30ec('0x6'));var logger=require(_0x30ec('0x7'))(_0x30ec('0x8'));var config=require('../../config/environment');var jayson=require(_0x30ec('0x9'));var client=jayson[_0x30ec('0xa')][_0x30ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33d85a,_0x163440,_0x24294a){return new BPromise(function(_0x32a166,_0xb4e9c5){return client[_0x30ec('0xc')](_0x33d85a,_0x24294a)[_0x30ec('0xd')](function(_0xa6d591){logger[_0x30ec('0xe')](_0x30ec('0xf'),_0x163440,_0x30ec('0x10'));logger[_0x30ec('0x11')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x163440,_0x30ec('0x10'),JSON[_0x30ec('0x12')](_0xa6d591));if(_0xa6d591[_0x30ec('0x13')]){if(_0xa6d591['error']['code']===0x1f4){logger[_0x30ec('0x13')](_0x30ec('0xf'),_0x163440,_0xa6d591['error'][_0x30ec('0x14')]);return _0xb4e9c5(_0xa6d591['error']['message']);}logger[_0x30ec('0x13')](_0x30ec('0xf'),_0x163440,_0xa6d591[_0x30ec('0x13')][_0x30ec('0x14')]);return _0x32a166(_0xa6d591['error'][_0x30ec('0x14')]);}else{logger[_0x30ec('0xe')](_0x30ec('0xf'),_0x163440,'request\x20sent');_0x32a166(_0xa6d591[_0x30ec('0x15')][_0x30ec('0x14')]);}})[_0x30ec('0x16')](function(_0x5c2a28){logger['error']('CmCustomField,\x20%s,\x20%s',_0x163440,_0x5c2a28);_0xb4e9c5(_0x5c2a28);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 6653179..926ad7f 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 _0x2e79=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2e79,0xeb));var _0x92e7=function(_0x454fcf,_0x128b88){_0x454fcf=_0x454fcf-0x0;var _0x571f68=_0x2e79[_0x454fcf];return _0x571f68;};'use strict';var multer=require(_0x92e7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x92e7('0x1'));var express=require(_0x92e7('0x2'));var router=express[_0x92e7('0x3')]();var fs_extra=require(_0x92e7('0x4'));var auth=require(_0x92e7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x92e7('0x6'));var controller=require(_0x92e7('0x7'));router[_0x92e7('0x8')]('/',auth[_0x92e7('0x9')](),controller[_0x92e7('0xa')]);router[_0x92e7('0x8')](_0x92e7('0xb'),auth[_0x92e7('0x9')](),controller['show']);router[_0x92e7('0xc')]('/',auth[_0x92e7('0x9')](),controller[_0x92e7('0xd')]);router[_0x92e7('0xe')]('/:id',auth[_0x92e7('0x9')](),controller[_0x92e7('0xf')]);router['delete'](_0x92e7('0xb'),auth[_0x92e7('0x9')](),controller[_0x92e7('0x10')]);module[_0x92e7('0x11')]=router; \ No newline at end of file +var _0x6bb4=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','create','put','update','delete','destroy','multer','util'];(function(_0x439439,_0x26dcf9){var _0x235dac=function(_0x230ee7){while(--_0x230ee7){_0x439439['push'](_0x439439['shift']());}};_0x235dac(++_0x26dcf9);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x42c6b9,_0x1ba1b1){_0x42c6b9=_0x42c6b9-0x0;var _0x53b461=_0x6bb4[_0x42c6b9];return _0x53b461;};'use strict';var multer=require(_0x46bb('0x0'));var util=require(_0x46bb('0x1'));var path=require(_0x46bb('0x2'));var timeout=require('connect-timeout');var express=require(_0x46bb('0x3'));var router=express[_0x46bb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x46bb('0x5'));var interaction=require(_0x46bb('0x6'));var config=require(_0x46bb('0x7'));var controller=require(_0x46bb('0x8'));router[_0x46bb('0x9')]('/',auth[_0x46bb('0xa')](),controller['index']);router['get'](_0x46bb('0xb'),auth[_0x46bb('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x46bb('0xc')]);router[_0x46bb('0xd')]('/:id',auth[_0x46bb('0xa')](),controller[_0x46bb('0xe')]);router[_0x46bb('0xf')]('/:id',auth[_0x46bb('0xa')](),controller[_0x46bb('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index bb7daec..0b7dcf5 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 _0xede2=['STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports'];(function(_0x19ac97,_0x413ecd){var _0x2776d5=function(_0x3ae788){while(--_0x3ae788){_0x19ac97['push'](_0x19ac97['shift']());}};_0x2776d5(++_0x413ecd);}(_0xede2,0x168));var _0x2ede=function(_0x2d4b50,_0x1d7ee3){_0x2d4b50=_0x2d4b50-0x0;var _0xac3b9e=_0xede2[_0x2d4b50];return _0xac3b9e;};'use strict';var moment=require(_0x2ede('0x0'));var Sequelize=require(_0x2ede('0x1'));module[_0x2ede('0x2')]={'phone':{'type':Sequelize[_0x2ede('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x2ede('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x2ede('0x5')],'defaultValue':moment()[_0x2ede('0x6')](_0x2ede('0x7'))},'countbusyretry':{'type':Sequelize[_0x2ede('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2ede('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2ede('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2ede('0x5')]},'priority':{'type':Sequelize[_0x2ede('0x8')](0x2)[_0x2ede('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x2ede('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x2ede('0xa')},'ListId':{'type':Sequelize[_0x2ede('0x8')],'unique':_0x2ede('0xa')},'UserId':{'type':Sequelize[_0x2ede('0x8')]},'VoiceQueueId':{'type':Sequelize[_0x2ede('0x8')],'unique':_0x2ede('0xa')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x2ede('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2ede('0x8')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x2ede('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x2ede('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x2ede('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xb941=['STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports'];(function(_0x424357,_0x9ebe3e){var _0x29c68e=function(_0x663b5d){while(--_0x663b5d){_0x424357['push'](_0x424357['shift']());}};_0x29c68e(++_0x9ebe3e);}(_0xb941,0x17e));var _0x1b94=function(_0x489d4c,_0x3e07fb){_0x489d4c=_0x489d4c-0x0;var _0x34555c=_0xb941[_0x489d4c];return _0x34555c;};'use strict';var moment=require(_0x1b94('0x0'));var Sequelize=require(_0x1b94('0x1'));module[_0x1b94('0x2')]={'phone':{'type':Sequelize[_0x1b94('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x1b94('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x1b94('0x5')],'defaultValue':moment()[_0x1b94('0x6')](_0x1b94('0x7'))},'countbusyretry':{'type':Sequelize[_0x1b94('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1b94('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1b94('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x1b94('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1b94('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1b94('0x5')]},'priority':{'type':Sequelize[_0x1b94('0x8')](0x2)[_0x1b94('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x1b94('0x8')],'unique':_0x1b94('0xa')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x1b94('0xa')},'UserId':{'type':Sequelize[_0x1b94('0x8')]},'VoiceQueueId':{'type':Sequelize[_0x1b94('0x8')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x1b94('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1b94('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1b94('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1b94('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1b94('0x8')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x1b94('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x1b94('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x1b94('0x5')],'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 20358df..8e95b33 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 _0xca9e=['isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','sequelize','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','recallme','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','update','sendStatus','name','send','index','CmHopper','fieldName','key','model','query','intersection','concat','filters','$or','$gt','$gte','$lt','$ne','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','length','nolimit','order','where','pick','merge','map','type','VIRTUAL','filter','options','then','include','findAll','catch','params','keys','rawAttributes','fields','includeAll','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','createdAt','updatedAt','deleted','campaign','membername','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','value','direction'];(function(_0x47d7ec,_0x17f197){var _0x98674a=function(_0x4f7db3){while(--_0x4f7db3){_0x47d7ec['push'](_0x47d7ec['shift']());}};_0x98674a(++_0x17f197);}(_0xca9e,0x136));var _0xeca9=function(_0x38deff,_0xc7c5f4){_0x38deff=_0x38deff-0x0;var _0x527ded=_0xca9e[_0x38deff];return _0x527ded;};'use strict';var moment=require(_0xeca9('0x0'));var _=require(_0xeca9('0x1'));var qs=require(_0xeca9('0x2'));var logger=require(_0xeca9('0x3'))(_0xeca9('0x4'));var shared=require(_0xeca9('0x5'));var db=require(_0xeca9('0x6'))['db'];function respondWithResult(_0x2c6185,_0x1b2864){_0x1b2864=_0x1b2864||0xc8;return function(_0x1e0a18){if(_0x1e0a18){return _0x2c6185[_0xeca9('0x7')](_0x1b2864)[_0xeca9('0x8')](_0x1e0a18);}};}function respondWithFilteredResult(_0x186a47,_0x305dc5){return function(_0x483e41){if(_0x483e41){var _0x369f5e=typeof _0x305dc5[_0xeca9('0x9')]==='undefined'&&typeof _0x305dc5['limit']===_0xeca9('0xa');var _0x239e92=_0x483e41[_0xeca9('0xb')];var _0x5305ce=_0x369f5e?0x0:_0x305dc5[_0xeca9('0x9')];var _0x364eb2=_0x369f5e?_0x483e41[_0xeca9('0xb')]:_0x305dc5[_0xeca9('0x9')]+_0x305dc5[_0xeca9('0xc')];var _0x3d06fe;if(_0x364eb2>=_0x239e92){_0x364eb2=_0x239e92;_0x3d06fe=0xc8;}else{_0x3d06fe=0xce;}_0x186a47['status'](_0x3d06fe);return _0x186a47[_0xeca9('0xd')](_0xeca9('0xe'),_0x5305ce+'-'+_0x364eb2+'/'+_0x239e92)['json'](_0x483e41);}return null;};}function saveUpdates(_0x27ca6f,_0x4b2ae1){return function(_0x3c6cc7){if(_0x3c6cc7){return _0x3c6cc7[_0xeca9('0xf')](_0x27ca6f)['then'](function(_0x3e9377){return _0x3e9377;});}return null;};}function handleEntityNotFound(_0x384ae2,_0x1ba9e9){return function(_0x4d65ee){if(!_0x4d65ee){_0x384ae2[_0xeca9('0x10')](0x194);}return _0x4d65ee;};}function handleError(_0x4422a6,_0x910814){_0x910814=_0x910814||0x1f4;return function(_0x6e9fd4){logger['error'](_0x6e9fd4['stack']);if(_0x6e9fd4[_0xeca9('0x11')]){delete _0x6e9fd4[_0xeca9('0x11')];}_0x4422a6['status'](_0x910814)[_0xeca9('0x12')](_0x6e9fd4);};}exports[_0xeca9('0x13')]=function(_0x4fbe8a,_0x517060){var _0x579421={},_0x132008={},_0x304f8f={'count':0x0,'rows':[]};var _0x3525ee=_['map'](db[_0xeca9('0x14')]['rawAttributes'],function(_0x5bbdce){return{'name':_0x5bbdce[_0xeca9('0x15')],'type':_0x5bbdce['type'][_0xeca9('0x16')]};});_0x132008[_0xeca9('0x17')]=_['map'](_0x3525ee,_0xeca9('0x11'));_0x132008[_0xeca9('0x18')]=_['keys'](_0x4fbe8a[_0xeca9('0x18')]);_0x132008['filters']=_[_0xeca9('0x19')](_0x132008[_0xeca9('0x17')],_0x132008[_0xeca9('0x18')]);_0x132008['filters']=_[_0xeca9('0x1a')](_0x132008[_0xeca9('0x1b')],['$and',_0xeca9('0x1c'),_0xeca9('0x1d'),_0xeca9('0x1e'),_0xeca9('0x1f'),'$lte',_0xeca9('0x20'),'$eq',_0xeca9('0x21'),_0xeca9('0x22'),_0xeca9('0x23'),_0xeca9('0x24'),_0xeca9('0x25'),_0xeca9('0x26'),_0xeca9('0x27'),_0xeca9('0x28'),_0xeca9('0x29'),_0xeca9('0x26'),_0xeca9('0x2a'),_0xeca9('0x2b'),_0xeca9('0x2c'),_0xeca9('0x2d')]);_0x579421[_0xeca9('0x2e')]=_['intersection'](_0x132008['model'],qs['fields'](_0x4fbe8a[_0xeca9('0x18')]['fields']));_0x579421[_0xeca9('0x2e')]=_0x579421[_0xeca9('0x2e')][_0xeca9('0x2f')]?_0x579421[_0xeca9('0x2e')]:_0x132008[_0xeca9('0x17')];if(!_0x4fbe8a[_0xeca9('0x18')]['hasOwnProperty'](_0xeca9('0x30'))){_0x579421['limit']=qs[_0xeca9('0xc')](_0x4fbe8a[_0xeca9('0x18')][_0xeca9('0xc')]);_0x579421['offset']=qs[_0xeca9('0x9')](_0x4fbe8a[_0xeca9('0x18')][_0xeca9('0x9')]);}_0x579421[_0xeca9('0x31')]=qs['sort'](_0x4fbe8a[_0xeca9('0x18')]['sort']);_0x579421[_0xeca9('0x32')]=qs[_0xeca9('0x1b')](_[_0xeca9('0x33')](_0x4fbe8a[_0xeca9('0x18')],_0x132008[_0xeca9('0x1b')]),_0x3525ee);if(_0x4fbe8a[_0xeca9('0x18')]['filter']){_0x579421[_0xeca9('0x32')]=_[_0xeca9('0x34')](_0x579421[_0xeca9('0x32')],{'$or':_[_0xeca9('0x35')](_0x3525ee,function(_0x1b318e){if(_0x1b318e[_0xeca9('0x36')]!==_0xeca9('0x37')){var _0x54d9cf={};_0x54d9cf[_0x1b318e[_0xeca9('0x11')]]={'$like':'%'+_0x4fbe8a[_0xeca9('0x18')][_0xeca9('0x38')]+'%'};return _0x54d9cf;}})});}_0x579421=_[_0xeca9('0x34')]({},_0x579421,_0x4fbe8a[_0xeca9('0x39')]);var _0x1eeb0a={'where':_0x579421['where']};return db[_0xeca9('0x14')]['count'](_0x1eeb0a)[_0xeca9('0x3a')](function(_0x4f7f25){_0x304f8f[_0xeca9('0xb')]=_0x4f7f25;if(_0x4fbe8a[_0xeca9('0x18')]['includeAll']){_0x579421[_0xeca9('0x3b')]=[{'all':!![]}];}return db['CmHopper'][_0xeca9('0x3c')](_0x579421);})['then'](function(_0x3c11fa){_0x304f8f['rows']=_0x3c11fa;return _0x304f8f;})[_0xeca9('0x3a')](respondWithFilteredResult(_0x517060,_0x579421))[_0xeca9('0x3d')](handleError(_0x517060,null));};exports['show']=function(_0x3572a1,_0xe8a1a2){var _0x4e8080={'raw':!![],'where':{'id':_0x3572a1[_0xeca9('0x3e')]['id']}},_0x2e2496={};_0x2e2496[_0xeca9('0x17')]=_[_0xeca9('0x3f')](db[_0xeca9('0x14')][_0xeca9('0x40')]);_0x2e2496[_0xeca9('0x18')]=_[_0xeca9('0x3f')](_0x3572a1[_0xeca9('0x18')]);_0x2e2496['filters']=_[_0xeca9('0x19')](_0x2e2496[_0xeca9('0x17')],_0x2e2496[_0xeca9('0x18')]);_0x4e8080[_0xeca9('0x2e')]=_[_0xeca9('0x19')](_0x2e2496[_0xeca9('0x17')],qs[_0xeca9('0x41')](_0x3572a1['query'][_0xeca9('0x41')]));_0x4e8080[_0xeca9('0x2e')]=_0x4e8080[_0xeca9('0x2e')][_0xeca9('0x2f')]?_0x4e8080[_0xeca9('0x2e')]:_0x2e2496['model'];if(_0x3572a1[_0xeca9('0x18')][_0xeca9('0x42')]){_0x4e8080[_0xeca9('0x3b')]=[{'all':!![]}];}_0x4e8080=_[_0xeca9('0x34')]({},_0x4e8080,_0x3572a1['options']);return db[_0xeca9('0x14')][_0xeca9('0x43')](_0x4e8080)['then'](handleEntityNotFound(_0xe8a1a2,null))[_0xeca9('0x3a')](respondWithResult(_0xe8a1a2,null))[_0xeca9('0x3d')](handleError(_0xe8a1a2,null));};exports[_0xeca9('0x44')]=function(_0x11c0fe,_0x1643cd){return db[_0xeca9('0x14')][_0xeca9('0x44')](_0x11c0fe[_0xeca9('0x45')],{})[_0xeca9('0x3a')](respondWithResult(_0x1643cd,0xc9))[_0xeca9('0x3d')](handleError(_0x1643cd,null));};exports[_0xeca9('0xf')]=function(_0x22599e,_0x14ba18){if(_0x22599e[_0xeca9('0x45')]['id']){delete _0x22599e[_0xeca9('0x45')]['id'];}return db['CmHopper'][_0xeca9('0x43')]({'where':{'id':_0x22599e[_0xeca9('0x3e')]['id']}})[_0xeca9('0x3a')](handleEntityNotFound(_0x14ba18,null))[_0xeca9('0x3a')](saveUpdates(_0x22599e['body'],null))[_0xeca9('0x3a')](respondWithResult(_0x14ba18,null))[_0xeca9('0x3d')](handleError(_0x14ba18,null));};exports['describe']=function(_0x5e6dc2,_0x3edca5){return db[_0xeca9('0x14')][_0xeca9('0x46')]()[_0xeca9('0x3a')](respondWithResult(_0x3edca5,null))['catch'](handleError(_0x3edca5,null));};exports[_0xeca9('0x47')]=function(_0xa4faf9,_0x346c62){var _0x454837;var _0x2b024b=_0xa4faf9[_0xeca9('0x3e')]['id'];return db[_0xeca9('0x14')][_0xeca9('0x43')]({'where':{'id':_0xa4faf9[_0xeca9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x346c62,null))['then'](function(_0x305ba4){if(_0x305ba4){return _0x305ba4[_0xeca9('0x47')]()['then'](function(_0x283d2d){return _0x283d2d;});}})[_0xeca9('0x3a')](function(_0x2ed3c0){_0x454837=_0x2ed3c0;if(_0x2ed3c0){if(_0x2ed3c0[_0xeca9('0x48')]||_0x2ed3c0[_0xeca9('0x49')]){return db[_0x2ed3c0[_0xeca9('0x48')]?_0xeca9('0x4a'):_0xeca9('0x4b')][_0xeca9('0x43')]({'where':{'id':_0x2ed3c0['VoiceQueueId']?_0x2ed3c0['VoiceQueueId']:_0x2ed3c0['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0xeca9('0x3a')](function(_0x5cc6de){var _0x940aaf={};if(_0x5cc6de){_[_0xeca9('0x34')](_0x940aaf,_['omit'](_0x454837[_0xeca9('0x4c')],[_0xeca9('0x4d'),_0xeca9('0x4e'),'id']));_0x940aaf['state']=0x15;_0x940aaf['statedesc']=_0xeca9('0x4f');_0x940aaf[_0xeca9('0x50')]=_0x5cc6de[_0xeca9('0x11')];_0x940aaf[_0xeca9('0x51')]=_0xa4faf9['user'][_0xeca9('0x11')];_0x940aaf[_0xeca9('0x52')]=_0xa4faf9[_0xeca9('0x53')]['id'];_0x940aaf[_0xeca9('0x4f')]=!![];_0x940aaf[_0xeca9('0x54')]=moment()[_0xeca9('0x55')](_0xeca9('0x56'));_0x940aaf[_0xeca9('0x57')]=_0x454837[_0xeca9('0x58')];_0x940aaf[_0xeca9('0x59')]=_0x454837[_0xeca9('0x48')]?_0xeca9('0x5a'):_0xeca9('0x5b');return db[_0xeca9('0x5c')][_0xeca9('0x43')]({'where':{'id':_0x940aaf[_0xeca9('0x5d')]},'attributes':['firstName',_0xeca9('0x5e')]})[_0xeca9('0x3a')](function(_0x2e1ff1){if(!_[_0xeca9('0x5f')](_0x346c62)&&!_['isNil'](_0x2e1ff1[_0xeca9('0x60')])){_0x940aaf[_0xeca9('0x61')]=_0x2e1ff1['firstName'];if(!_[_0xeca9('0x5f')](_0x2e1ff1[_0xeca9('0x5e')])){_0x940aaf[_0xeca9('0x61')]+='\x20'+_0x2e1ff1[_0xeca9('0x5e')];}}})[_0xeca9('0x62')](function(){return db['CmHopperFinal'][_0xeca9('0x44')](_0x940aaf);});}})[_0xeca9('0x3a')](function(_0x5b8222){return db[_0xeca9('0x63')][_0xeca9('0x47')]({'where':{'CmHopperId':_0x2b024b}});})[_0xeca9('0x3a')](function(){return _0x346c62[_0xeca9('0x7')](0xcc)[_0xeca9('0x64')]();})[_0xeca9('0x3d')](handleError(_0x346c62,null));};exports[_0xeca9('0x65')]=function(_0x2ade57,_0x51bdab){var _0x4cd314=[];return db['CmContact'][_0xeca9('0x46')]()[_0xeca9('0x3a')](function(_0xce6cfd){_0x4cd314=_['keys'](_0xce6cfd);return _0x2ade57[_0xeca9('0x53')][_0xeca9('0x66')]({'where':{'type':_0xeca9('0x67'),'dialActive':!![],'dialMethod':_0xeca9('0x68')},'attributes':['id',_0xeca9('0x69'),_0xeca9('0x6a')],'raw':!![]});})[_0xeca9('0x3a')](function(_0x502f33){if(_0x502f33&&_0x502f33['length']){return db['sequelize'][_0xeca9('0x6b')](function(_0xd7ccc8){var _0x5be034={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xeca9('0x55')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xeca9('0x35')](_0x502f33,'id')},'$or':[{'UserId':null},{'UserId':_0x2ade57[_0xeca9('0x53')]['id']}]};var _0x475af3={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x502f33)[_0xeca9('0x38')]([_0xeca9('0x6a'),0x0])['map']('id')[_0xeca9('0x6c')]()},'$or':[{'UserId':null},{'UserId':_0x2ade57[_0xeca9('0x53')]['id']}]};var _0x20bc02={'$or':[_0x5be034,_0x475af3]};var _0x1cd614=[];if(_0x2ade57[_0xeca9('0x45')][_0xeca9('0x6d')]&&_0x2ade57[_0xeca9('0x45')][_0xeca9('0x6d')]==='prev'){if(!_[_0xeca9('0x6e')](_0x2ade57['body'][_0xeca9('0x6f')])){_0x20bc02['id']={'$in':_0x2ade57[_0xeca9('0x45')][_0xeca9('0x6f')]};}_0x1cd614=[[_0xeca9('0x70'),_0xeca9('0x71')],[_0xeca9('0x72'),_0x502f33[0x0]['dialOrderByScheduledAt']===_0xeca9('0x71')?_0xeca9('0x73'):_0xeca9('0x71')],db['sequelize'][_0xeca9('0x74')](_0xeca9('0x75')),['id',_0xeca9('0x73')]];}else{if(!_[_0xeca9('0x6e')](_0x2ade57[_0xeca9('0x45')][_0xeca9('0x6f')])){_0x20bc02['id']={'$notIn':_0x2ade57[_0xeca9('0x45')][_0xeca9('0x6f')]};}_0x1cd614=[['priority',_0xeca9('0x73')],[_0xeca9('0x72'),_0x502f33[0x0][_0xeca9('0x69')]],db[_0xeca9('0x76')][_0xeca9('0x74')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0xeca9('0x14')][_0xeca9('0x77')]({'attributes':['id',_0xeca9('0x78'),_0xeca9('0x58'),'recallme'],'where':_0x20bc02,'order':_0x1cd614,'transaction':_0xd7ccc8,'lock':_0xd7ccc8[_0xeca9('0x79')][_0xeca9('0x7a')],'include':[{'model':db[_0xeca9('0x5c')],'as':_0xeca9('0x7b'),'attributes':_0x4cd314,'include':[{'model':db[_0xeca9('0x7c')],'as':_0xeca9('0x7d'),'attributes':['id',_0xeca9('0x11')]}]},{'model':db[_0xeca9('0x7e')],'as':_0xeca9('0x7f'),'attributes':['id',_0xeca9('0x11')]},{'model':db['VoiceQueue'],'as':_0xeca9('0x80'),'attributes':['id',_0xeca9('0x11'),_0xeca9('0x81')]}]})['then'](function(_0x4d7070){if(_0x4d7070){return _0x4d7070['update']({'UserId':_0x2ade57[_0xeca9('0x53')]['id']},{'transaction':_0xd7ccc8});}});});}})[_0xeca9('0x3a')](handleEntityNotFound(_0x51bdab,null))['then'](respondWithResult(_0x51bdab,null))[_0xeca9('0x3d')](handleError(_0x51bdab,null));};exports[_0xeca9('0x82')]=function(_0x28675e,_0x3bf823,_0x53aceb){var _0x17e50d=[];var _0xfb9250=_0x28675e['params']['id'];var _0x494bfb=_0x28675e['user']['id'];return db[_0xeca9('0x5c')][_0xeca9('0x46')]()[_0xeca9('0x3a')](function(_0x4b5029){_0x17e50d=_[_0xeca9('0x3f')](_0x4b5029);return db['sequelize'][_0xeca9('0x6b')](function(_0xbc11b7){const _0x3bd3d9={'id':_0xfb9250};return db[_0xeca9('0x14')][_0xeca9('0x77')]({'attributes':['id','scheduledat',_0xeca9('0x83')],'where':_0x3bd3d9,'transaction':_0xbc11b7,'lock':_0xbc11b7['LOCK'][_0xeca9('0x7a')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x17e50d,'include':[{'model':db['CmCompany'],'as':_0xeca9('0x7d'),'attributes':['id','name']}]},{'model':db[_0xeca9('0x7e')],'as':_0xeca9('0x7f'),'attributes':['id',_0xeca9('0x11')]},{'model':db[_0xeca9('0x4a')],'as':_0xeca9('0x80'),'attributes':['id',_0xeca9('0x11'),'dialActive']}]})[_0xeca9('0x3a')](function(_0xd0c575){if(_0xd0c575){return _0xd0c575[_0xeca9('0xf')]({'UserId':_0x494bfb},{'transaction':_0xbc11b7});}});});})[_0xeca9('0x3a')](handleEntityNotFound(_0x3bf823,null))[_0xeca9('0x3a')](respondWithResult(_0x3bf823,null))[_0xeca9('0x3d')](handleError(_0x3bf823,null));};exports[_0xeca9('0x84')]=function(_0x368128,_0x5f14df){return _0x368128[_0xeca9('0x53')][_0xeca9('0x66')]({'where':{'type':_0xeca9('0x67'),'dialActive':!![],'dialMethod':_0xeca9('0x68')},'attributes':['id'],'raw':!![]})[_0xeca9('0x3a')](function(_0x53d8a5){if(_0x53d8a5&&_0x53d8a5[_0xeca9('0x2f')]){return db[_0xeca9('0x14')][_0xeca9('0xb')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xeca9('0x55')](_0xeca9('0x56'))},'VoiceQueueId':{'$in':_['map'](_0x53d8a5,'id')},'$or':[{'UserId':null},{'UserId':_0x368128[_0xeca9('0x53')]['id']}]}});}return 0x0;})[_0xeca9('0x3a')](function(_0x275845){if(!_[_0xeca9('0x5f')](_0x275845)&&_[_0xeca9('0x85')](_0x275845)){return _0x5f14df[_0xeca9('0x7')](0xc8)[_0xeca9('0x8')]({'contacts':_0x275845});}else{logger['error'](_0xeca9('0x86'),_0xeca9('0x84'),0x194,_0xeca9('0x87'));_0x5f14df[_0xeca9('0x10')](0x194);}})[_0xeca9('0x3d')](handleError(_0x5f14df,null));};exports[_0xeca9('0x88')]=function(_0x271f09,_0x3c4c5f){var _0x563230=shared[_0xeca9('0x89')];var _0x54f9aa=[];_[_0xeca9('0x35')](_0x563230,function(_0x3cb07b){_0x54f9aa[_0xeca9('0x8a')]({'id':_0x3cb07b[_0xeca9('0x11')],'name':_0x3cb07b['name'],'utcOffset':_0x3cb07b['utcOffset']});});return _0x3c4c5f['status'](0xc8)[_0xeca9('0x8')]({'tz':_0x54f9aa});};exports[_0xeca9('0x8b')]=function(_0x473fa6,_0x77cbec){var _0x470b03=shared[_0xeca9('0x89')];var _0xb4c392={};if(!_['isNil'](_0x470b03[_0x473fa6[_0xeca9('0x45')]['id']]))_0xb4c392=_0x470b03[_0x473fa6[_0xeca9('0x45')]['id']];return _0x77cbec['status'](0xc8)[_0xeca9('0x8')](_0xb4c392);}; \ No newline at end of file +var _0x6334=['getTimezones','timezones','push','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','status','json','undefined','limit','count','set','sendStatus','error','stack','name','send','map','CmHopper','fieldName','key','query','keys','filters','intersection','concat','$and','$or','$gt','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','type','VIRTUAL','options','then','includeAll','findAll','rows','catch','show','params','find','create','body','update','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','createdAt','updatedAt','state','statedesc','campaign','membername','user','UserId','deleted','deletedat','format','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','end','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','value','direction','isEmpty','hopperIds','priority','scheduledAt','DESC','ASC','literal','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','getPreviewRecall','findOne','recallme','dialActive','getOpenContacts','preview','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found'];(function(_0x10775a,_0x278cfc){var _0x4f682d=function(_0x32069d){while(--_0x32069d){_0x10775a['push'](_0x10775a['shift']());}};_0x4f682d(++_0x278cfc);}(_0x6334,0x119));var _0x4633=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0x6334[_0x30d87a];return _0x48f64b;};'use strict';var moment=require(_0x4633('0x0'));var _=require(_0x4633('0x1'));var qs=require(_0x4633('0x2'));var logger=require(_0x4633('0x3'))(_0x4633('0x4'));var shared=require(_0x4633('0x5'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x1099be,_0x205442){_0x205442=_0x205442||0xc8;return function(_0x2a2b3c){if(_0x2a2b3c){return _0x1099be[_0x4633('0x6')](_0x205442)[_0x4633('0x7')](_0x2a2b3c);}};}function respondWithFilteredResult(_0x6493dc,_0x175e14){return function(_0x4a8997){if(_0x4a8997){var _0x5647f1=typeof _0x175e14['offset']===_0x4633('0x8')&&typeof _0x175e14[_0x4633('0x9')]==='undefined';var _0x3c202f=_0x4a8997[_0x4633('0xa')];var _0x4018ba=_0x5647f1?0x0:_0x175e14['offset'];var _0x45a590=_0x5647f1?_0x4a8997[_0x4633('0xa')]:_0x175e14['offset']+_0x175e14[_0x4633('0x9')];var _0x3d5182;if(_0x45a590>=_0x3c202f){_0x45a590=_0x3c202f;_0x3d5182=0xc8;}else{_0x3d5182=0xce;}_0x6493dc[_0x4633('0x6')](_0x3d5182);return _0x6493dc[_0x4633('0xb')]('Content-Range',_0x4018ba+'-'+_0x45a590+'/'+_0x3c202f)[_0x4633('0x7')](_0x4a8997);}return null;};}function saveUpdates(_0xad405,_0x438e87){return function(_0x48e92c){if(_0x48e92c){return _0x48e92c['update'](_0xad405)['then'](function(_0x28e2bc){return _0x28e2bc;});}return null;};}function handleEntityNotFound(_0x1fd00c,_0x579229){return function(_0x52955e){if(!_0x52955e){_0x1fd00c[_0x4633('0xc')](0x194);}return _0x52955e;};}function handleError(_0x4813c5,_0xcdffcc){_0xcdffcc=_0xcdffcc||0x1f4;return function(_0x33b6e7){logger[_0x4633('0xd')](_0x33b6e7[_0x4633('0xe')]);if(_0x33b6e7['name']){delete _0x33b6e7[_0x4633('0xf')];}_0x4813c5[_0x4633('0x6')](_0xcdffcc)[_0x4633('0x10')](_0x33b6e7);};}exports['index']=function(_0xa8a6c1,_0x37e536){var _0x1c7186={},_0x2ad562={},_0xbab957={'count':0x0,'rows':[]};var _0x5953b8=_[_0x4633('0x11')](db[_0x4633('0x12')]['rawAttributes'],function(_0x57e61c){return{'name':_0x57e61c[_0x4633('0x13')],'type':_0x57e61c['type'][_0x4633('0x14')]};});_0x2ad562['model']=_['map'](_0x5953b8,_0x4633('0xf'));_0x2ad562[_0x4633('0x15')]=_[_0x4633('0x16')](_0xa8a6c1[_0x4633('0x15')]);_0x2ad562[_0x4633('0x17')]=_[_0x4633('0x18')](_0x2ad562['model'],_0x2ad562[_0x4633('0x15')]);_0x2ad562['filters']=_[_0x4633('0x19')](_0x2ad562[_0x4633('0x17')],[_0x4633('0x1a'),_0x4633('0x1b'),_0x4633('0x1c'),'$gte',_0x4633('0x1d'),_0x4633('0x1e'),_0x4633('0x1f'),_0x4633('0x20'),_0x4633('0x21'),_0x4633('0x22'),_0x4633('0x23'),_0x4633('0x24'),_0x4633('0x25'),_0x4633('0x26'),_0x4633('0x27'),_0x4633('0x28'),_0x4633('0x29'),_0x4633('0x26'),_0x4633('0x2a'),_0x4633('0x2b'),_0x4633('0x2c'),_0x4633('0x2d')]);_0x1c7186['attributes']=_[_0x4633('0x18')](_0x2ad562[_0x4633('0x2e')],qs[_0x4633('0x2f')](_0xa8a6c1[_0x4633('0x15')][_0x4633('0x2f')]));_0x1c7186[_0x4633('0x30')]=_0x1c7186['attributes'][_0x4633('0x31')]?_0x1c7186['attributes']:_0x2ad562[_0x4633('0x2e')];if(!_0xa8a6c1[_0x4633('0x15')][_0x4633('0x32')](_0x4633('0x33'))){_0x1c7186[_0x4633('0x9')]=qs[_0x4633('0x9')](_0xa8a6c1[_0x4633('0x15')][_0x4633('0x9')]);_0x1c7186[_0x4633('0x34')]=qs[_0x4633('0x34')](_0xa8a6c1[_0x4633('0x15')][_0x4633('0x34')]);}_0x1c7186[_0x4633('0x35')]=qs[_0x4633('0x36')](_0xa8a6c1['query']['sort']);_0x1c7186[_0x4633('0x37')]=qs[_0x4633('0x17')](_['pick'](_0xa8a6c1[_0x4633('0x15')],_0x2ad562[_0x4633('0x17')]),_0x5953b8);if(_0xa8a6c1[_0x4633('0x15')][_0x4633('0x38')]){_0x1c7186['where']=_[_0x4633('0x39')](_0x1c7186['where'],{'$or':_[_0x4633('0x11')](_0x5953b8,function(_0x15868f){if(_0x15868f[_0x4633('0x3a')]!==_0x4633('0x3b')){var _0x213768={};_0x213768[_0x15868f[_0x4633('0xf')]]={'$like':'%'+_0xa8a6c1[_0x4633('0x15')][_0x4633('0x38')]+'%'};return _0x213768;}})});}_0x1c7186=_['merge']({},_0x1c7186,_0xa8a6c1[_0x4633('0x3c')]);var _0x107616={'where':_0x1c7186['where']};return db[_0x4633('0x12')][_0x4633('0xa')](_0x107616)[_0x4633('0x3d')](function(_0x468648){_0xbab957['count']=_0x468648;if(_0xa8a6c1['query'][_0x4633('0x3e')]){_0x1c7186['include']=[{'all':!![]}];}return db['CmHopper'][_0x4633('0x3f')](_0x1c7186);})['then'](function(_0x4c83b8){_0xbab957[_0x4633('0x40')]=_0x4c83b8;return _0xbab957;})[_0x4633('0x3d')](respondWithFilteredResult(_0x37e536,_0x1c7186))[_0x4633('0x41')](handleError(_0x37e536,null));};exports[_0x4633('0x42')]=function(_0x2cdb28,_0x582404){var _0x6873d0={'raw':!![],'where':{'id':_0x2cdb28[_0x4633('0x43')]['id']}},_0x530ced={};_0x530ced[_0x4633('0x2e')]=_[_0x4633('0x16')](db[_0x4633('0x12')]['rawAttributes']);_0x530ced[_0x4633('0x15')]=_['keys'](_0x2cdb28[_0x4633('0x15')]);_0x530ced[_0x4633('0x17')]=_[_0x4633('0x18')](_0x530ced[_0x4633('0x2e')],_0x530ced[_0x4633('0x15')]);_0x6873d0['attributes']=_['intersection'](_0x530ced[_0x4633('0x2e')],qs[_0x4633('0x2f')](_0x2cdb28[_0x4633('0x15')][_0x4633('0x2f')]));_0x6873d0[_0x4633('0x30')]=_0x6873d0['attributes'][_0x4633('0x31')]?_0x6873d0['attributes']:_0x530ced[_0x4633('0x2e')];if(_0x2cdb28['query'][_0x4633('0x3e')]){_0x6873d0['include']=[{'all':!![]}];}_0x6873d0=_[_0x4633('0x39')]({},_0x6873d0,_0x2cdb28[_0x4633('0x3c')]);return db[_0x4633('0x12')][_0x4633('0x44')](_0x6873d0)[_0x4633('0x3d')](handleEntityNotFound(_0x582404,null))[_0x4633('0x3d')](respondWithResult(_0x582404,null))[_0x4633('0x41')](handleError(_0x582404,null));};exports[_0x4633('0x45')]=function(_0x18f3fd,_0x2e1cf2){return db[_0x4633('0x12')][_0x4633('0x45')](_0x18f3fd[_0x4633('0x46')],{})[_0x4633('0x3d')](respondWithResult(_0x2e1cf2,0xc9))[_0x4633('0x41')](handleError(_0x2e1cf2,null));};exports[_0x4633('0x47')]=function(_0x13ffa5,_0x1e533d){if(_0x13ffa5[_0x4633('0x46')]['id']){delete _0x13ffa5[_0x4633('0x46')]['id'];}return db[_0x4633('0x12')]['find']({'where':{'id':_0x13ffa5['params']['id']}})[_0x4633('0x3d')](handleEntityNotFound(_0x1e533d,null))['then'](saveUpdates(_0x13ffa5['body'],null))['then'](respondWithResult(_0x1e533d,null))[_0x4633('0x41')](handleError(_0x1e533d,null));};exports[_0x4633('0x48')]=function(_0x5cb4cc,_0x35b82a){return db[_0x4633('0x12')][_0x4633('0x48')]()[_0x4633('0x3d')](respondWithResult(_0x35b82a,null))[_0x4633('0x41')](handleError(_0x35b82a,null));};exports[_0x4633('0x49')]=function(_0x4d3cf4,_0x4ca3d6){var _0x4fb731;var _0x99c493=_0x4d3cf4[_0x4633('0x43')]['id'];return db[_0x4633('0x12')]['find']({'where':{'id':_0x4d3cf4[_0x4633('0x43')]['id']}})[_0x4633('0x3d')](handleEntityNotFound(_0x4ca3d6,null))['then'](function(_0x2d18f6){if(_0x2d18f6){return _0x2d18f6[_0x4633('0x49')]()[_0x4633('0x3d')](function(_0x4c5367){return _0x4c5367;});}})['then'](function(_0x12e416){_0x4fb731=_0x12e416;if(_0x12e416){if(_0x12e416[_0x4633('0x4a')]||_0x12e416[_0x4633('0x4b')]){return db[_0x12e416[_0x4633('0x4a')]?_0x4633('0x4c'):'Campaign'][_0x4633('0x44')]({'where':{'id':_0x12e416[_0x4633('0x4a')]?_0x12e416[_0x4633('0x4a')]:_0x12e416[_0x4633('0x4b')]},'attributes':['id',_0x4633('0xf')],'raw':!![]});}}})[_0x4633('0x3d')](function(_0x5659ed){var _0xeec38a={};if(_0x5659ed){_['merge'](_0xeec38a,_['omit'](_0x4fb731['dataValues'],[_0x4633('0x4d'),_0x4633('0x4e'),'id']));_0xeec38a[_0x4633('0x4f')]=0x15;_0xeec38a[_0x4633('0x50')]='deleted';_0xeec38a[_0x4633('0x51')]=_0x5659ed['name'];_0xeec38a[_0x4633('0x52')]=_0x4d3cf4[_0x4633('0x53')][_0x4633('0xf')];_0xeec38a[_0x4633('0x54')]=_0x4d3cf4[_0x4633('0x53')]['id'];_0xeec38a[_0x4633('0x55')]=!![];_0xeec38a[_0x4633('0x56')]=moment()[_0x4633('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0xeec38a[_0x4633('0x58')]=_0x4fb731['phone'];_0xeec38a[_0x4633('0x59')]=_0x4fb731[_0x4633('0x4a')]?_0x4633('0x5a'):_0x4633('0x5b');return db[_0x4633('0x5c')][_0x4633('0x44')]({'where':{'id':_0xeec38a[_0x4633('0x5d')]},'attributes':[_0x4633('0x5e'),_0x4633('0x5f')]})[_0x4633('0x3d')](function(_0x27608f){if(!_[_0x4633('0x60')](_0x4ca3d6)&&!_[_0x4633('0x60')](_0x27608f['firstName'])){_0xeec38a[_0x4633('0x61')]=_0x27608f[_0x4633('0x5e')];if(!_[_0x4633('0x60')](_0x27608f[_0x4633('0x5f')])){_0xeec38a[_0x4633('0x61')]+='\x20'+_0x27608f[_0x4633('0x5f')];}}})[_0x4633('0x62')](function(){return db[_0x4633('0x63')][_0x4633('0x45')](_0xeec38a);});}})[_0x4633('0x3d')](function(_0x3669a1){return db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':_0x99c493}});})[_0x4633('0x3d')](function(){return _0x4ca3d6['status'](0xcc)[_0x4633('0x64')]();})[_0x4633('0x41')](handleError(_0x4ca3d6,null));};exports['getPreview']=function(_0x3fb667,_0x344536){var _0x327103=[];return db[_0x4633('0x5c')][_0x4633('0x48')]()['then'](function(_0x22271a){_0x327103=_[_0x4633('0x16')](_0x22271a);return _0x3fb667[_0x4633('0x53')][_0x4633('0x65')]({'where':{'type':_0x4633('0x66'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x4633('0x67'),_0x4633('0x68')],'raw':!![]});})[_0x4633('0x3d')](function(_0x493d6c){if(_0x493d6c&&_0x493d6c[_0x4633('0x31')]){return db[_0x4633('0x69')][_0x4633('0x6a')](function(_0x2efee0){var _0x1eb81f={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x4633('0x57')](_0x4633('0x6b'))},'VoiceQueueId':{'$in':_[_0x4633('0x11')](_0x493d6c,'id')},'$or':[{'UserId':null},{'UserId':_0x3fb667[_0x4633('0x53')]['id']}]};var _0xea95b5={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x493d6c)[_0x4633('0x38')](['dialPreviewAutoRecallMe',0x0])['map']('id')[_0x4633('0x6c')]()},'$or':[{'UserId':null},{'UserId':_0x3fb667[_0x4633('0x53')]['id']}]};var _0x474a50={'$or':[_0x1eb81f,_0xea95b5]};var _0x4a5478=[];if(_0x3fb667['body'][_0x4633('0x6d')]&&_0x3fb667[_0x4633('0x46')][_0x4633('0x6d')]==='prev'){if(!_[_0x4633('0x6e')](_0x3fb667[_0x4633('0x46')][_0x4633('0x6f')])){_0x474a50['id']={'$in':_0x3fb667['body']['hopperIds']};}_0x4a5478=[[_0x4633('0x70'),'ASC'],[_0x4633('0x71'),_0x493d6c[0x0][_0x4633('0x67')]==='ASC'?_0x4633('0x72'):_0x4633('0x73')],db[_0x4633('0x69')][_0x4633('0x74')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x4633('0x72')]];}else{if(!_[_0x4633('0x6e')](_0x3fb667[_0x4633('0x46')][_0x4633('0x6f')])){_0x474a50['id']={'$notIn':_0x3fb667[_0x4633('0x46')][_0x4633('0x6f')]};}_0x4a5478=[[_0x4633('0x70'),'DESC'],[_0x4633('0x71'),_0x493d6c[0x0][_0x4633('0x67')]],db[_0x4633('0x69')][_0x4633('0x74')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x4633('0x12')]['findOne']({'attributes':['id',_0x4633('0x75'),'phone','recallme'],'where':_0x474a50,'order':_0x4a5478,'transaction':_0x2efee0,'lock':_0x2efee0[_0x4633('0x76')][_0x4633('0x77')],'include':[{'model':db['CmContact'],'as':_0x4633('0x78'),'attributes':_0x327103,'include':[{'model':db[_0x4633('0x79')],'as':_0x4633('0x7a'),'attributes':['id',_0x4633('0xf')]}]},{'model':db[_0x4633('0x7b')],'as':_0x4633('0x7c'),'attributes':['id',_0x4633('0xf')]},{'model':db[_0x4633('0x4c')],'as':'Queue','attributes':['id',_0x4633('0xf'),'dialActive']}]})[_0x4633('0x3d')](function(_0x5706cd){if(_0x5706cd){return _0x5706cd[_0x4633('0x47')]({'UserId':_0x3fb667[_0x4633('0x53')]['id']},{'transaction':_0x2efee0});}});});}})[_0x4633('0x3d')](handleEntityNotFound(_0x344536,null))[_0x4633('0x3d')](respondWithResult(_0x344536,null))[_0x4633('0x41')](handleError(_0x344536,null));};exports[_0x4633('0x7d')]=function(_0x53b890,_0x194c9a,_0x2f3405){var _0x27ab67=[];var _0x5ce875=_0x53b890[_0x4633('0x43')]['id'];var _0x200fcc=_0x53b890[_0x4633('0x53')]['id'];return db[_0x4633('0x5c')][_0x4633('0x48')]()[_0x4633('0x3d')](function(_0x5a8b1c){_0x27ab67=_['keys'](_0x5a8b1c);return db[_0x4633('0x69')]['transaction'](function(_0x4d5b84){const _0x47aec6={'id':_0x5ce875};return db['CmHopper'][_0x4633('0x7e')]({'attributes':['id',_0x4633('0x75'),_0x4633('0x7f')],'where':_0x47aec6,'transaction':_0x4d5b84,'lock':_0x4d5b84[_0x4633('0x76')][_0x4633('0x77')],'include':[{'model':db['CmContact'],'as':_0x4633('0x78'),'attributes':_0x27ab67,'include':[{'model':db[_0x4633('0x79')],'as':_0x4633('0x7a'),'attributes':['id',_0x4633('0xf')]}]},{'model':db[_0x4633('0x7b')],'as':_0x4633('0x7c'),'attributes':['id','name']},{'model':db[_0x4633('0x4c')],'as':'Queue','attributes':['id',_0x4633('0xf'),_0x4633('0x80')]}]})['then'](function(_0x2ee435){if(_0x2ee435){return _0x2ee435[_0x4633('0x47')]({'UserId':_0x200fcc},{'transaction':_0x4d5b84});}});});})['then'](handleEntityNotFound(_0x194c9a,null))[_0x4633('0x3d')](respondWithResult(_0x194c9a,null))[_0x4633('0x41')](handleError(_0x194c9a,null));};exports[_0x4633('0x81')]=function(_0x4a8cca,_0x5c2c93){return _0x4a8cca['user'][_0x4633('0x65')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x4633('0x82')},'attributes':['id'],'raw':!![]})['then'](function(_0x109a23){if(_0x109a23&&_0x109a23[_0x4633('0x31')]){return db[_0x4633('0x12')][_0x4633('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x4633('0x57')](_0x4633('0x6b'))},'VoiceQueueId':{'$in':_[_0x4633('0x11')](_0x109a23,'id')},'$or':[{'UserId':null},{'UserId':_0x4a8cca[_0x4633('0x53')]['id']}]}});}return 0x0;})[_0x4633('0x3d')](function(_0x89261b){if(!_[_0x4633('0x60')](_0x89261b)&&_['isNumber'](_0x89261b)){return _0x5c2c93[_0x4633('0x6')](0xc8)[_0x4633('0x7')]({'contacts':_0x89261b});}else{logger[_0x4633('0xd')](_0x4633('0x83'),_0x4633('0x81'),0x194,_0x4633('0x84'));_0x5c2c93['sendStatus'](0x194);}})[_0x4633('0x41')](handleError(_0x5c2c93,null));};exports[_0x4633('0x85')]=function(_0x3a9832,_0x46195b){var _0x4d1d30=shared[_0x4633('0x86')];var _0x3f064c=[];_['map'](_0x4d1d30,function(_0x4e820a){_0x3f064c[_0x4633('0x87')]({'id':_0x4e820a['name'],'name':_0x4e820a['name'],'utcOffset':_0x4e820a[_0x4633('0x88')]});});return _0x46195b['status'](0xc8)['json']({'tz':_0x3f064c});};exports[_0x4633('0x89')]=function(_0x47875e,_0x20a6c5){var _0xdc710f=shared[_0x4633('0x86')];var _0x37bb9a={};if(!_['isNil'](_0xdc710f[_0x47875e[_0x4633('0x46')]['id']]))_0x37bb9a=_0xdc710f[_0x47875e[_0x4633('0x46')]['id']];return _0x20a6c5['status'](0xc8)[_0x4633('0x7')](_0x37bb9a);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 7f5d2a8..59da090 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 _0xeff8=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','scheduledat','phone'];(function(_0x493e30,_0x15ad9e){var _0x1b4915=function(_0x1159e6){while(--_0x1159e6){_0x493e30['push'](_0x493e30['shift']());}};_0x1b4915(++_0x15ad9e);}(_0xeff8,0x186));var _0x8eff=function(_0x17406e,_0x1049fd){_0x17406e=_0x17406e-0x0;var _0x2bfc5a=_0xeff8[_0x17406e];return _0x2bfc5a;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));module['exports']=function(_0x469641,_0xb54063){return _0x469641[_0x8eff('0x9')](_0x8eff('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x8eff('0xb'),'fields':[_0x8eff('0xb')]},{'name':_0x8eff('0xc'),'fields':[_0x8eff('0xc')]},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xfcf0=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','api'];(function(_0x16fb55,_0x29fe8a){var _0xf71a7f=function(_0x47be34){while(--_0x47be34){_0x16fb55['push'](_0x16fb55['shift']());}};_0xf71a7f(++_0x29fe8a);}(_0xfcf0,0x138));var _0x0fcf=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0xfcf0[_0x45b034];return _0x509cb0;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x0fcf('0xc'),'fields':[_0x0fcf('0xc')]},{'name':_0x0fcf('0xd'),'fields':['phone']},{'name':_0x0fcf('0xe'),'fields':[_0x0fcf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index d3e3627..e409aff 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 _0xcdf6=['DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','literal','NOW()','Agent','CmList','List','lodash','util','moment','../../mysqldb','../../config/logger','rpc','GetCmHopper','findAll','options','where','attributes','limit','map','include','model','then','info','debug','stringify','catch','error','message','ShowCmHopper','find','raw','CreateCmHopper','CmHopper','body','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','describe','sequelize','order','LOCK','UPDATE','CmContact','Contact','User','name','voicePause','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','MoveContactManagedDialer','CountReScheduled','COUNT','format','\x22%s\x22','\x20,\x201,\x20null','GetContactRecallMe','transaction','length','update','GetCmHopperPreview','keys','GetContactByPhone','findOne','phone','dialTimezone'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xcdf6,0xb3));var _0x6cdf=function(_0x4ee6dc,_0x389e56){_0x4ee6dc=_0x4ee6dc-0x0;var _0x1940d2=_0xcdf6[_0x4ee6dc];return _0x1940d2;};'use strict';var _=require(_0x6cdf('0x0'));var util=require(_0x6cdf('0x1'));var moment=require(_0x6cdf('0x2'));var BPromise=require('bluebird');var db=require(_0x6cdf('0x3'))['db'];var logger=require(_0x6cdf('0x4'))(_0x6cdf('0x5'));exports[_0x6cdf('0x6')]=function(_0x1feb02){var _0x36ec65=this;return new Promise(function(_0xa3372b,_0x3493e1){return db['CmHopper'][_0x6cdf('0x7')]({'raw':_0x1feb02[_0x6cdf('0x8')]?_0x1feb02[_0x6cdf('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x1feb02[_0x6cdf('0x8')]?_0x1feb02[_0x6cdf('0x8')][_0x6cdf('0x9')]||null:null,'attributes':_0x1feb02['options']?_0x1feb02[_0x6cdf('0x8')][_0x6cdf('0xa')]||null:null,'limit':_0x1feb02['options']?_0x1feb02[_0x6cdf('0x8')][_0x6cdf('0xb')]||null:null,'include':_0x1feb02[_0x6cdf('0x8')]?_0x1feb02['options']['include']?_[_0x6cdf('0xc')](_0x1feb02['options'][_0x6cdf('0xd')],function(_0x21eddd){return{'model':db[_0x21eddd[_0x6cdf('0xe')]],'as':_0x21eddd['as'],'attributes':_0x21eddd[_0x6cdf('0xa')],'include':_0x21eddd[_0x6cdf('0xd')]?_[_0x6cdf('0xc')](_0x21eddd['include'],function(_0x230866){return{'model':db[_0x230866[_0x6cdf('0xe')]],'as':_0x230866['as'],'attributes':_0x230866[_0x6cdf('0xa')],'include':_0x230866[_0x6cdf('0xd')]?_['map'](_0x230866[_0x6cdf('0xd')],function(_0x12eb41){return{'model':db[_0x12eb41['model']],'as':_0x12eb41['as'],'attributes':_0x12eb41[_0x6cdf('0xa')]};}):[]};}):[]};}):[]:[]})[_0x6cdf('0xf')](function(_0x5da5fa){logger[_0x6cdf('0x10')](_0x6cdf('0x6'),_0x1feb02);logger[_0x6cdf('0x11')](_0x6cdf('0x6'),_0x1feb02,JSON[_0x6cdf('0x12')](_0x5da5fa));_0xa3372b(_0x5da5fa);})[_0x6cdf('0x13')](function(_0x2227f9){logger[_0x6cdf('0x14')](_0x6cdf('0x6'),_0x2227f9[_0x6cdf('0x15')],_0x1feb02);_0x3493e1(_0x36ec65['error'](0x1f4,_0x2227f9[_0x6cdf('0x15')]));});});};exports[_0x6cdf('0x16')]=function(_0x119952){var _0x140628=this;return new Promise(function(_0x349fe6,_0x3c2fc5){return db['CmHopper'][_0x6cdf('0x17')]({'raw':_0x119952[_0x6cdf('0x8')]?_0x119952[_0x6cdf('0x8')][_0x6cdf('0x18')]===undefined?!![]:![]:!![],'where':_0x119952[_0x6cdf('0x8')]?_0x119952['options'][_0x6cdf('0x9')]||null:null,'attributes':_0x119952['options']?_0x119952[_0x6cdf('0x8')][_0x6cdf('0xa')]||null:null,'include':_0x119952['options']?_0x119952[_0x6cdf('0x8')]['include']?_['map'](_0x119952[_0x6cdf('0x8')][_0x6cdf('0xd')],function(_0x56c2f9){return{'model':db[_0x56c2f9['model']],'as':_0x56c2f9['as'],'attributes':_0x56c2f9[_0x6cdf('0xa')],'include':_0x56c2f9[_0x6cdf('0xd')]?_[_0x6cdf('0xc')](_0x56c2f9[_0x6cdf('0xd')],function(_0x4b296a){return{'model':db[_0x4b296a['model']],'as':_0x4b296a['as'],'attributes':_0x4b296a[_0x6cdf('0xa')],'include':_0x4b296a['include']?_[_0x6cdf('0xc')](_0x4b296a[_0x6cdf('0xd')],function(_0x25a08e){return{'model':db[_0x25a08e[_0x6cdf('0xe')]],'as':_0x25a08e['as'],'attributes':_0x25a08e[_0x6cdf('0xa')]};}):[]};}):[]};}):[]:[]})[_0x6cdf('0xf')](function(_0x466100){logger[_0x6cdf('0x10')](_0x6cdf('0x16'),_0x119952);logger[_0x6cdf('0x11')](_0x6cdf('0x16'),_0x119952,JSON[_0x6cdf('0x12')](_0x466100));_0x349fe6(_0x466100);})[_0x6cdf('0x13')](function(_0x386b81){logger[_0x6cdf('0x14')](_0x6cdf('0x16'),_0x386b81['message'],_0x119952);_0x3c2fc5(_0x140628[_0x6cdf('0x14')](0x1f4,_0x386b81[_0x6cdf('0x15')]));});});};exports[_0x6cdf('0x19')]=function(_0x5ca044){var _0x39dde2=this;return new Promise(function(_0x720fca,_0x267664){return db[_0x6cdf('0x1a')]['create'](_0x5ca044[_0x6cdf('0x1b')],{'raw':_0x5ca044[_0x6cdf('0x8')]?_0x5ca044[_0x6cdf('0x8')][_0x6cdf('0x18')]===undefined?!![]:![]:!![]})[_0x6cdf('0xf')](function(_0x12aef0){logger[_0x6cdf('0x10')](_0x6cdf('0x19'),_0x5ca044);logger[_0x6cdf('0x11')](_0x6cdf('0x19'),_0x5ca044,JSON['stringify'](_0x12aef0));_0x720fca(_0x12aef0);})[_0x6cdf('0x13')](function(_0xe0834f){logger[_0x6cdf('0x14')](_0x6cdf('0x19'),_0xe0834f['message'],_0x5ca044);_0x267664(_0x39dde2[_0x6cdf('0x14')](0x1f4,_0xe0834f['message']));});});};exports[_0x6cdf('0x1c')]=function(_0x57527f){var _0x429665=this;return new Promise(function(_0x3bd580,_0x1adced){return db['CmHopper']['update'](_0x57527f['body'],{'raw':_0x57527f['options']?_0x57527f['options'][_0x6cdf('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57527f[_0x6cdf('0x8')]?_0x57527f[_0x6cdf('0x8')][_0x6cdf('0x9')]||null:null,'attributes':_0x57527f[_0x6cdf('0x8')]?_0x57527f['options'][_0x6cdf('0xa')]||null:null,'limit':_0x57527f[_0x6cdf('0x8')]?_0x57527f[_0x6cdf('0x8')][_0x6cdf('0xb')]||null:null})[_0x6cdf('0xf')](function(_0x2e5b84){logger[_0x6cdf('0x10')](_0x6cdf('0x1c'),_0x57527f);logger[_0x6cdf('0x10')](_0x6cdf('0x1d'),JSON[_0x6cdf('0x12')](_0x57527f['options'][_0x6cdf('0x9')]),_0x57527f[_0x6cdf('0x1b')][_0x6cdf('0x1e')]);logger[_0x6cdf('0x11')]('UpdateCmHopper',_0x57527f,JSON[_0x6cdf('0x12')](_0x2e5b84));_0x3bd580(_0x2e5b84);})[_0x6cdf('0x13')](function(_0x261443){logger[_0x6cdf('0x14')](_0x6cdf('0x1c'),_0x261443[_0x6cdf('0x15')],_0x57527f);_0x1adced(_0x429665[_0x6cdf('0x14')](0x1f4,_0x261443[_0x6cdf('0x15')]));});});};exports[_0x6cdf('0x1f')]=function(_0x196050){var _0x252df0=this;return new Promise(function(_0x6d3c48,_0x25db92){return db[_0x6cdf('0x1a')]['destroy']({'where':_0x196050[_0x6cdf('0x8')]?_0x196050[_0x6cdf('0x8')][_0x6cdf('0x9')]||null:null})[_0x6cdf('0xf')](function(_0x1d491c){logger[_0x6cdf('0x10')]('DestroyCmHopper',_0x196050);logger[_0x6cdf('0x11')](_0x6cdf('0x1f'),_0x196050,JSON[_0x6cdf('0x12')](_0x1d491c));_0x6d3c48(_0x1d491c);})['catch'](function(_0x3499a8){logger[_0x6cdf('0x14')](_0x6cdf('0x1f'),_0x3499a8[_0x6cdf('0x15')],_0x196050);_0x25db92(_0x252df0[_0x6cdf('0x14')](0x1f4,_0x3499a8[_0x6cdf('0x15')]));});});};exports[_0x6cdf('0x20')]=function(_0x1a4f82){var _0x3055ce=this;return new Promise(function(_0x5a24bc,_0x1bc867){return db['CmContact'][_0x6cdf('0x21')]()['then'](function(_0x5949f2){return db[_0x6cdf('0x22')]['transaction'](function(_0x500ad0){return db['CmHopper'][_0x6cdf('0x7')]({'where':_0x1a4f82[_0x6cdf('0x8')]?_0x1a4f82[_0x6cdf('0x8')][_0x6cdf('0x9')]||null:null,'attributes':_0x1a4f82['options']?_0x1a4f82['options'][_0x6cdf('0xa')]||null:null,'limit':_0x1a4f82[_0x6cdf('0x8')]?_0x1a4f82[_0x6cdf('0x8')][_0x6cdf('0xb')]||null:null,'order':_0x1a4f82[_0x6cdf('0x8')]?_0x1a4f82[_0x6cdf('0x8')][_0x6cdf('0x23')]||null:null,'transaction':_0x500ad0,'lock':_0x500ad0[_0x6cdf('0x24')][_0x6cdf('0x25')],'include':[{'model':db[_0x6cdf('0x26')],'as':_0x6cdf('0x27'),'attributes':_['keys'](_0x5949f2)},{'model':db[_0x6cdf('0x28')],'as':'Agent','attributes':['id',_0x6cdf('0x29'),_0x6cdf('0x2a')]}]})[_0x6cdf('0xf')](function(_0x31f338){var _0x30f4dd=[];var _0x11adf8=[];for(var _0x16778d=0x0;_0x16778d<_0x31f338['length'];_0x16778d+=0x1){var _0x4a8898=_0x31f338[_0x16778d][_0x6cdf('0x2b')];if(_0x4a8898===null){_0x30f4dd[_0x6cdf('0x2c')](_0x31f338[_0x16778d]['update'](_0x1a4f82[_0x6cdf('0x1b')],{'transaction':_0x500ad0}));}else if(!_0x11adf8[_0x6cdf('0x2d')](_0x4a8898)){_0x11adf8[_0x6cdf('0x2c')](_0x4a8898);_0x30f4dd[_0x6cdf('0x2c')](_0x31f338[_0x16778d]['update'](_0x1a4f82[_0x6cdf('0x1b')],{'transaction':_0x500ad0}));}}return BPromise[_0x6cdf('0x2e')](_0x30f4dd);});})[_0x6cdf('0xf')](function(_0x37103f){logger[_0x6cdf('0x10')]('GetContactDialer',_0x1a4f82);if(_0x37103f['length']>0x0){logger['info'](_0x6cdf('0x2f'),_0x37103f[0x0][_0x6cdf('0x30')]['id'],_0x37103f[0x0][_0x6cdf('0x30')][_0x6cdf('0x31')],_0x37103f[0x0][_0x6cdf('0x30')]['active']);}logger[_0x6cdf('0x11')](_0x6cdf('0x20'),_0x1a4f82,JSON[_0x6cdf('0x12')](_0x37103f));_0x5a24bc(_0x37103f);})['catch'](function(_0x52b905){logger[_0x6cdf('0x14')](_0x6cdf('0x20'),_0x52b905[_0x6cdf('0x15')],_0x1a4f82);_0x1bc867(_0x3055ce[_0x6cdf('0x14')](0x1f4,_0x52b905[_0x6cdf('0x15')]));});});});};exports['MoveContactManagedDialer']=function(_0x5dc512){var _0x44cc2b=this;return new Promise(function(_0x488d96,_0x9b015){return db[_0x6cdf('0x22')]['transaction'](function(_0x363fad){return db[_0x6cdf('0x32')][_0x6cdf('0x33')](_0x5dc512[_0x6cdf('0x1b')],{'raw':_0x5dc512['options']?_0x5dc512[_0x6cdf('0x8')][_0x6cdf('0x18')]===undefined?!![]:![]:!![],'transaction':_0x363fad})[_0x6cdf('0xf')](function(){logger[_0x6cdf('0x10')](_0x6cdf('0x34'),JSON[_0x6cdf('0x12')](_0x5dc512[_0x6cdf('0x8')][_0x6cdf('0x9')]),_0x5dc512[_0x6cdf('0x8')][_0x6cdf('0x9')][_0x6cdf('0x1e')]);return db[_0x6cdf('0x1a')][_0x6cdf('0x35')]({'where':_0x5dc512['options']?_0x5dc512[_0x6cdf('0x8')][_0x6cdf('0x9')]||null:null,'transaction':_0x363fad});});})[_0x6cdf('0xf')](function(_0x44e927){logger[_0x6cdf('0x10')](_0x6cdf('0x36'),_0x5dc512);logger[_0x6cdf('0x11')](_0x6cdf('0x36'),_0x5dc512,JSON[_0x6cdf('0x12')](_0x44e927));_0x488d96(_0x44e927);})[_0x6cdf('0x13')](function(_0xc8f7b9){logger[_0x6cdf('0x14')](_0x6cdf('0x36'),_0xc8f7b9['message'],_0x5dc512);_0x9b015(_0x44cc2b[_0x6cdf('0x14')](0x1f4,_0xc8f7b9['message']));});});};exports[_0x6cdf('0x37')]=function(_0x1f04ee){var _0x55a743=this;return new Promise(function(_0x5bea99,_0x14526a){return db[_0x6cdf('0x1a')][_0x6cdf('0x7')]({'raw':_0x1f04ee[_0x6cdf('0x8')]?_0x1f04ee[_0x6cdf('0x8')][_0x6cdf('0x18')]===undefined?!![]:![]:!![],'where':_0x1f04ee[_0x6cdf('0x8')]?_0x1f04ee['options']['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x6cdf('0x38'),db['sequelize']['fn']('IF',db[_0x6cdf('0x22')]['literal']('`scheduledat`\x20>=\x20'+util[_0x6cdf('0x39')](_0x6cdf('0x3a'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+_0x6cdf('0x3b')))),'contactsRescheduled']]})[_0x6cdf('0xf')](function(_0x2c0a1a){logger[_0x6cdf('0x10')](_0x6cdf('0x37'),_0x1f04ee);logger[_0x6cdf('0x11')]('CountReScheduled',_0x1f04ee,JSON[_0x6cdf('0x12')](_0x2c0a1a));_0x5bea99(_0x2c0a1a);})[_0x6cdf('0x13')](function(_0xbbaa97){logger[_0x6cdf('0x14')](_0x6cdf('0x37'),_0xbbaa97[_0x6cdf('0x15')],_0x1f04ee);_0x14526a(_0x55a743[_0x6cdf('0x14')](0x1f4,_0xbbaa97['message']));});});};exports[_0x6cdf('0x3c')]=function(_0x263646){var _0x249444=this;return new Promise(function(_0x470e52,_0x315efe){return db[_0x6cdf('0x26')][_0x6cdf('0x21')]()[_0x6cdf('0xf')](function(){return db[_0x6cdf('0x22')][_0x6cdf('0x3d')](function(_0x3b8a0d){return db[_0x6cdf('0x1a')][_0x6cdf('0x7')]({'where':_0x263646['options']?_0x263646[_0x6cdf('0x8')]['where']||null:null,'attributes':_0x263646[_0x6cdf('0x8')]?_0x263646['options'][_0x6cdf('0xa')]||null:null,'limit':0x1,'order':_0x263646['options']?_0x263646['options'][_0x6cdf('0x23')]||null:null,'group':db['CmHopper'][_0x6cdf('0x2b')],'transaction':_0x3b8a0d,'lock':_0x3b8a0d['LOCK'][_0x6cdf('0x25')],'include':_0x263646['options']?_0x263646[_0x6cdf('0x8')][_0x6cdf('0xd')]?_[_0x6cdf('0xc')](_0x263646['options'][_0x6cdf('0xd')],function(_0x36b3c1){return{'model':db[_0x36b3c1[_0x6cdf('0xe')]],'as':_0x36b3c1['as'],'attributes':_0x36b3c1[_0x6cdf('0xa')],'include':_0x36b3c1[_0x6cdf('0xd')]?_[_0x6cdf('0xc')](_0x36b3c1['include'],function(_0x551618){return{'model':db[_0x551618[_0x6cdf('0xe')]],'as':_0x551618['as'],'attributes':_0x551618['attributes'],'include':_0x551618[_0x6cdf('0xd')]?_[_0x6cdf('0xc')](_0x551618[_0x6cdf('0xd')],function(_0x4f7101){return{'model':db[_0x4f7101[_0x6cdf('0xe')]],'as':_0x4f7101['as'],'attributes':_0x4f7101['attributes']};}):[]};}):[]};}):[]:[]})[_0x6cdf('0xf')](function(_0xcd2ec2){var _0x116232=[];for(var _0x2b1145=0x0;_0x2b1145<_0xcd2ec2[_0x6cdf('0x3e')];_0x2b1145+=0x1){_0x116232['push'](_0xcd2ec2[_0x2b1145][_0x6cdf('0x3f')](_0x263646['body'],{'transaction':_0x3b8a0d}));}return BPromise[_0x6cdf('0x2e')](_0x116232);});})['then'](function(_0x9d908e){logger[_0x6cdf('0x10')]('GetContactRecallMe',_0x263646);logger[_0x6cdf('0x11')](_0x6cdf('0x3c'),_0x263646,JSON[_0x6cdf('0x12')](_0x9d908e));_0x470e52(_0x9d908e);})[_0x6cdf('0x13')](function(_0x371ce0){logger[_0x6cdf('0x14')](_0x6cdf('0x3c'),_0x371ce0[_0x6cdf('0x15')],_0x263646);_0x315efe(_0x249444[_0x6cdf('0x14')](0x1f4,_0x371ce0['message']));});});});};exports[_0x6cdf('0x40')]=function(_0xe04e97){var _0x455865=this;return new Promise(function(_0x1989cc,_0x33d5e8){db[_0x6cdf('0x26')][_0x6cdf('0x21')]()[_0x6cdf('0xf')](function(_0x1909e1){return db[_0x6cdf('0x1a')][_0x6cdf('0x7')]({'raw':_0xe04e97[_0x6cdf('0x8')]?_0xe04e97[_0x6cdf('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0xe04e97[_0x6cdf('0x8')]?_0xe04e97[_0x6cdf('0x8')]['where']||null:null,'attributes':_0xe04e97['options']?_0xe04e97['options'][_0x6cdf('0xa')]||null:null,'limit':_0xe04e97['options']?_0xe04e97[_0x6cdf('0x8')]['limit']||null:null,'include':_0xe04e97[_0x6cdf('0x8')]?_0xe04e97['options']['include']?_[_0x6cdf('0xc')](_0xe04e97['options'][_0x6cdf('0xd')],function(_0xaf7845){return{'model':db[_0xaf7845[_0x6cdf('0xe')]],'as':_0xaf7845['as'],'attributes':_0xaf7845['as']===_0x6cdf('0x27')?_[_0x6cdf('0x41')](_0x1909e1):_0xaf7845[_0x6cdf('0xa')],'include':_0xaf7845['include']?_[_0x6cdf('0xc')](_0xaf7845[_0x6cdf('0xd')],function(_0x383109){return{'model':db[_0x383109[_0x6cdf('0xe')]],'as':_0x383109['as'],'attributes':_0x383109[_0x6cdf('0xa')],'include':_0x383109[_0x6cdf('0xd')]?_[_0x6cdf('0xc')](_0x383109[_0x6cdf('0xd')],function(_0x22fd7e){return{'model':db[_0x22fd7e[_0x6cdf('0xe')]],'as':_0x22fd7e['as'],'attributes':_0x22fd7e[_0x6cdf('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4dca4d){logger[_0x6cdf('0x10')](_0x6cdf('0x6'),_0xe04e97);logger[_0x6cdf('0x11')](_0x6cdf('0x6'),_0xe04e97,JSON[_0x6cdf('0x12')](_0x4dca4d));_0x1989cc(_0x4dca4d);})[_0x6cdf('0x13')](function(_0x42f249){logger['error'](_0x6cdf('0x6'),_0x42f249[_0x6cdf('0x15')],_0xe04e97);_0x33d5e8(_0x455865[_0x6cdf('0x14')](0x1f4,_0x42f249[_0x6cdf('0x15')]));});});});};exports[_0x6cdf('0x42')]=function(_0x3bf6fa){var _0x583692=this;return new Promise(function(_0x48958c,_0x441696){return db['CmContact'][_0x6cdf('0x43')]({'raw':!![],'where':{'phone':_0x3bf6fa[_0x6cdf('0x8')]['where'][_0x6cdf('0x44')]},'attributes':['id',_0x6cdf('0x45')],'order':[['id',_0x6cdf('0x46')]]})[_0x6cdf('0xf')](function(_0x3df03e){logger[_0x6cdf('0x10')]('getContactByPhone',_0x3bf6fa);logger[_0x6cdf('0x11')]('getContactByPhone',_0x3bf6fa,JSON[_0x6cdf('0x12')](_0x3df03e));_0x48958c(_0x3df03e);})[_0x6cdf('0x13')](function(_0xf71273){logger[_0x6cdf('0x14')](_0x6cdf('0x47'),_0xf71273['message'],_0x3bf6fa);_0x441696(_0x583692[_0x6cdf('0x14')](0x1f4,_0xf71273['message']));});});};exports[_0x6cdf('0x48')]=function(_0x502e95){var _0x13c476=this;return new Promise(function(_0x55a0ff,_0x4f2f95){return db[_0x6cdf('0x22')][_0x6cdf('0x3d')](function(_0x398b15){var _0x462bf0=_0x502e95[_0x6cdf('0x8')]&&_0x502e95[_0x6cdf('0x8')]['where']?_0x502e95[_0x6cdf('0x8')][_0x6cdf('0x9')]:{};return db[_0x6cdf('0x1a')]['update'](_0x502e95[_0x6cdf('0x1b')],{'where':_0x462bf0,'transaction':_0x398b15})['then'](function(_0x2561c5){logger['info'](_0x6cdf('0x48'),_0x502e95);logger[_0x6cdf('0x11')](_0x6cdf('0x48'),_0x502e95,JSON[_0x6cdf('0x12')](_0x2561c5));_0x55a0ff(_0x2561c5);})[_0x6cdf('0x13')](function(_0xb07c73){logger[_0x6cdf('0x14')](_0x6cdf('0x48'),_0xb07c73[_0x6cdf('0x15')],_0x502e95);_0x4f2f95(_0x13c476[_0x6cdf('0x14')](0x1f4,_0xb07c73[_0x6cdf('0x15')]));});});});};exports[_0x6cdf('0x49')]=function(_0x5047c3){var _0x5f181e=this;var _0x114437=_0x5047c3[_0x6cdf('0x1b')][_0x6cdf('0x9')]['voiceQueueIds'];var _0x4ab02f=_0x5047c3['body'][_0x6cdf('0x9')][_0x6cdf('0x4a')];var _0x3d355c=_0x5047c3['body']['where'][_0x6cdf('0x4b')];return new Promise(function(_0x4449b0,_0x3007ac){return db['CmHopper'][_0x6cdf('0x7')]({'where':{'voiceQueueId':{'$in':_0x114437},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x6cdf('0x22')]['literal'](_0x6cdf('0x4c')+_0x4ab02f+_0x6cdf('0x4d')),'$gt':db[_0x6cdf('0x22')][_0x6cdf('0x4e')](_0x6cdf('0x4f'))}},'UserId':{'$in':_0x3d355c}},'include':[{'model':db['CmContact'],'as':_0x6cdf('0x27')},{'model':db[_0x6cdf('0x28')],'as':_0x6cdf('0x50'),'attributes':['id','name',_0x6cdf('0x2a')]},{'model':db[_0x6cdf('0x51')],'as':_0x6cdf('0x52')}]})[_0x6cdf('0xf')](function(_0x537827){if(_0x537827[_0x6cdf('0x3e')]>0x0){return db['sequelize']['transaction'](function(_0x4f675b){return db['CmHopper'][_0x6cdf('0x3f')]({'recallmeNotifiedDate':db[_0x6cdf('0x22')][_0x6cdf('0x4e')](_0x6cdf('0x4f'))},{'where':{'id':{'$in':_['map'](_0x537827,'id')}},'transaction':_0x4f675b})[_0x6cdf('0xf')](function(){_0x4449b0(_0x537827);})[_0x6cdf('0x13')](function(_0x367789){logger[_0x6cdf('0x14')](_0x6cdf('0x49'),_0x367789[_0x6cdf('0x15')],_0x5047c3);_0x3007ac(_0x5f181e[_0x6cdf('0x14')](0x1f4,_0x367789[_0x6cdf('0x15')]));});})[_0x6cdf('0x13')](function(_0x266dcf){logger[_0x6cdf('0x14')](_0x6cdf('0x49'),_0x266dcf[_0x6cdf('0x15')],_0x5047c3);_0x3007ac(_0x5f181e['error'](0x1f4,_0x266dcf[_0x6cdf('0x15')]));});}else{_0x4449b0(_0x537827);}});});}; \ No newline at end of file +var _0x6262=['sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','push','update','includes','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','GetContactDialer','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','\x20MINUTE','List','util','bluebird','../../mysqldb','../../config/logger','findAll','raw','options','where','limit','attributes','map','include','model','then','GetCmHopper','stringify','message','ShowCmHopper','CmHopper','find','info','debug','catch','error','CreateCmHopper','create','body','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','CmContact','describe'];(function(_0x54b7e7,_0x4ad441){var _0x549f02=function(_0x2fe548){while(--_0x2fe548){_0x54b7e7['push'](_0x54b7e7['shift']());}};_0x549f02(++_0x4ad441);}(_0x6262,0x72));var _0x2626=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x6262[_0xbb091];return _0x467a04;};'use strict';var _=require('lodash');var util=require(_0x2626('0x0'));var moment=require('moment');var BPromise=require(_0x2626('0x1'));var db=require(_0x2626('0x2'))['db'];var logger=require(_0x2626('0x3'))('rpc');exports['GetCmHopper']=function(_0x4bd6e0){var _0x2761c9=this;return new Promise(function(_0x5d9a37,_0x2e8c48){return db['CmHopper'][_0x2626('0x4')]({'raw':_0x4bd6e0['options']?_0x4bd6e0['options'][_0x2626('0x5')]===undefined?!![]:![]:!![],'where':_0x4bd6e0[_0x2626('0x6')]?_0x4bd6e0[_0x2626('0x6')][_0x2626('0x7')]||null:null,'attributes':_0x4bd6e0[_0x2626('0x6')]?_0x4bd6e0['options']['attributes']||null:null,'limit':_0x4bd6e0[_0x2626('0x6')]?_0x4bd6e0[_0x2626('0x6')][_0x2626('0x8')]||null:null,'include':_0x4bd6e0[_0x2626('0x6')]?_0x4bd6e0[_0x2626('0x6')]['include']?_['map'](_0x4bd6e0[_0x2626('0x6')]['include'],function(_0x51bd80){return{'model':db[_0x51bd80['model']],'as':_0x51bd80['as'],'attributes':_0x51bd80[_0x2626('0x9')],'include':_0x51bd80['include']?_[_0x2626('0xa')](_0x51bd80[_0x2626('0xb')],function(_0x524a4a){return{'model':db[_0x524a4a[_0x2626('0xc')]],'as':_0x524a4a['as'],'attributes':_0x524a4a[_0x2626('0x9')],'include':_0x524a4a[_0x2626('0xb')]?_[_0x2626('0xa')](_0x524a4a['include'],function(_0x2f68a4){return{'model':db[_0x2f68a4[_0x2626('0xc')]],'as':_0x2f68a4['as'],'attributes':_0x2f68a4[_0x2626('0x9')]};}):[]};}):[]};}):[]:[]})[_0x2626('0xd')](function(_0x221d6f){logger['info'](_0x2626('0xe'),_0x4bd6e0);logger['debug'](_0x2626('0xe'),_0x4bd6e0,JSON[_0x2626('0xf')](_0x221d6f));_0x5d9a37(_0x221d6f);})['catch'](function(_0x2fa98b){logger['error']('GetCmHopper',_0x2fa98b[_0x2626('0x10')],_0x4bd6e0);_0x2e8c48(_0x2761c9['error'](0x1f4,_0x2fa98b[_0x2626('0x10')]));});});};exports[_0x2626('0x11')]=function(_0xb6493f){var _0x36e183=this;return new Promise(function(_0x1c58e6,_0xe4085){return db[_0x2626('0x12')][_0x2626('0x13')]({'raw':_0xb6493f[_0x2626('0x6')]?_0xb6493f[_0x2626('0x6')]['raw']===undefined?!![]:![]:!![],'where':_0xb6493f[_0x2626('0x6')]?_0xb6493f[_0x2626('0x6')][_0x2626('0x7')]||null:null,'attributes':_0xb6493f[_0x2626('0x6')]?_0xb6493f[_0x2626('0x6')][_0x2626('0x9')]||null:null,'include':_0xb6493f[_0x2626('0x6')]?_0xb6493f[_0x2626('0x6')][_0x2626('0xb')]?_['map'](_0xb6493f[_0x2626('0x6')][_0x2626('0xb')],function(_0x27bbf1){return{'model':db[_0x27bbf1['model']],'as':_0x27bbf1['as'],'attributes':_0x27bbf1[_0x2626('0x9')],'include':_0x27bbf1[_0x2626('0xb')]?_['map'](_0x27bbf1[_0x2626('0xb')],function(_0x3b6781){return{'model':db[_0x3b6781[_0x2626('0xc')]],'as':_0x3b6781['as'],'attributes':_0x3b6781[_0x2626('0x9')],'include':_0x3b6781[_0x2626('0xb')]?_[_0x2626('0xa')](_0x3b6781['include'],function(_0x516588){return{'model':db[_0x516588['model']],'as':_0x516588['as'],'attributes':_0x516588[_0x2626('0x9')]};}):[]};}):[]};}):[]:[]})[_0x2626('0xd')](function(_0x1d64d9){logger[_0x2626('0x14')](_0x2626('0x11'),_0xb6493f);logger[_0x2626('0x15')](_0x2626('0x11'),_0xb6493f,JSON[_0x2626('0xf')](_0x1d64d9));_0x1c58e6(_0x1d64d9);})[_0x2626('0x16')](function(_0x46fd80){logger[_0x2626('0x17')]('ShowCmHopper',_0x46fd80['message'],_0xb6493f);_0xe4085(_0x36e183[_0x2626('0x17')](0x1f4,_0x46fd80[_0x2626('0x10')]));});});};exports[_0x2626('0x18')]=function(_0x5b1231){var _0x2a4694=this;return new Promise(function(_0x28d4ca,_0x4b2c1a){return db[_0x2626('0x12')][_0x2626('0x19')](_0x5b1231[_0x2626('0x1a')],{'raw':_0x5b1231['options']?_0x5b1231[_0x2626('0x6')][_0x2626('0x5')]===undefined?!![]:![]:!![]})[_0x2626('0xd')](function(_0x2c6f9d){logger[_0x2626('0x14')](_0x2626('0x18'),_0x5b1231);logger[_0x2626('0x15')](_0x2626('0x18'),_0x5b1231,JSON[_0x2626('0xf')](_0x2c6f9d));_0x28d4ca(_0x2c6f9d);})['catch'](function(_0x320eb4){logger[_0x2626('0x17')](_0x2626('0x18'),_0x320eb4[_0x2626('0x10')],_0x5b1231);_0x4b2c1a(_0x2a4694[_0x2626('0x17')](0x1f4,_0x320eb4['message']));});});};exports[_0x2626('0x1b')]=function(_0x2b1d2f){var _0x1e6c14=this;return new Promise(function(_0x3340d0,_0x2f93eb){return db['CmHopper']['update'](_0x2b1d2f[_0x2626('0x1a')],{'raw':_0x2b1d2f[_0x2626('0x6')]?_0x2b1d2f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b1d2f[_0x2626('0x6')]?_0x2b1d2f[_0x2626('0x6')][_0x2626('0x7')]||null:null,'attributes':_0x2b1d2f[_0x2626('0x6')]?_0x2b1d2f[_0x2626('0x6')][_0x2626('0x9')]||null:null,'limit':_0x2b1d2f[_0x2626('0x6')]?_0x2b1d2f['options'][_0x2626('0x8')]||null:null})[_0x2626('0xd')](function(_0x300ac9){logger[_0x2626('0x14')](_0x2626('0x1b'),_0x2b1d2f);logger[_0x2626('0x14')](_0x2626('0x1c'),JSON['stringify'](_0x2b1d2f[_0x2626('0x6')]['where']),_0x2b1d2f[_0x2626('0x1a')][_0x2626('0x1d')]);logger[_0x2626('0x15')]('UpdateCmHopper',_0x2b1d2f,JSON[_0x2626('0xf')](_0x300ac9));_0x3340d0(_0x300ac9);})['catch'](function(_0x2725c4){logger[_0x2626('0x17')](_0x2626('0x1b'),_0x2725c4['message'],_0x2b1d2f);_0x2f93eb(_0x1e6c14[_0x2626('0x17')](0x1f4,_0x2725c4[_0x2626('0x10')]));});});};exports[_0x2626('0x1e')]=function(_0x4b01dd){var _0x552972=this;return new Promise(function(_0x2a092b,_0x1e9c1d){return db['CmHopper'][_0x2626('0x1f')]({'where':_0x4b01dd[_0x2626('0x6')]?_0x4b01dd[_0x2626('0x6')]['where']||null:null})[_0x2626('0xd')](function(_0xa2641f){logger[_0x2626('0x14')](_0x2626('0x1e'),_0x4b01dd);logger[_0x2626('0x15')](_0x2626('0x1e'),_0x4b01dd,JSON[_0x2626('0xf')](_0xa2641f));_0x2a092b(_0xa2641f);})[_0x2626('0x16')](function(_0xb27663){logger['error'](_0x2626('0x1e'),_0xb27663['message'],_0x4b01dd);_0x1e9c1d(_0x552972[_0x2626('0x17')](0x1f4,_0xb27663[_0x2626('0x10')]));});});};exports['GetContactDialer']=function(_0x59df91){var _0x4c6dec=this;return new Promise(function(_0x434f19,_0x483a22){return db[_0x2626('0x20')][_0x2626('0x21')]()[_0x2626('0xd')](function(_0x10359e){return db[_0x2626('0x22')][_0x2626('0x23')](function(_0x398f5c){return db[_0x2626('0x12')][_0x2626('0x4')]({'where':_0x59df91['options']?_0x59df91[_0x2626('0x6')][_0x2626('0x7')]||null:null,'attributes':_0x59df91[_0x2626('0x6')]?_0x59df91[_0x2626('0x6')]['attributes']||null:null,'limit':_0x59df91[_0x2626('0x6')]?_0x59df91['options'][_0x2626('0x8')]||null:null,'order':_0x59df91['options']?_0x59df91[_0x2626('0x6')][_0x2626('0x24')]||null:null,'transaction':_0x398f5c,'lock':_0x398f5c[_0x2626('0x25')][_0x2626('0x26')],'include':[{'model':db['CmContact'],'as':_0x2626('0x27'),'attributes':_[_0x2626('0x28')](_0x10359e)},{'model':db[_0x2626('0x29')],'as':_0x2626('0x2a'),'attributes':['id',_0x2626('0x2b'),_0x2626('0x2c')]}]})['then'](function(_0x543bc7){var _0x439fbb=[];var _0x51bf9f=[];for(var _0x159dcd=0x0;_0x159dcd<_0x543bc7['length'];_0x159dcd+=0x1){var _0xe17c4c=_0x543bc7[_0x159dcd]['UserId'];if(_0xe17c4c===null){_0x439fbb[_0x2626('0x2d')](_0x543bc7[_0x159dcd][_0x2626('0x2e')](_0x59df91['body'],{'transaction':_0x398f5c}));}else if(!_0x51bf9f[_0x2626('0x2f')](_0xe17c4c)){_0x51bf9f[_0x2626('0x2d')](_0xe17c4c);_0x439fbb[_0x2626('0x2d')](_0x543bc7[_0x159dcd]['update'](_0x59df91['body'],{'transaction':_0x398f5c}));}}return BPromise[_0x2626('0x30')](_0x439fbb);});})[_0x2626('0xd')](function(_0x3e1389){logger[_0x2626('0x14')]('GetContactDialer',_0x59df91);if(_0x3e1389[_0x2626('0x31')]>0x0){logger[_0x2626('0x14')](_0x2626('0x32'),_0x3e1389[0x0][_0x2626('0x33')]['id'],_0x3e1389[0x0][_0x2626('0x33')][_0x2626('0x34')],_0x3e1389[0x0][_0x2626('0x33')][_0x2626('0x1d')]);}logger[_0x2626('0x15')](_0x2626('0x35'),_0x59df91,JSON[_0x2626('0xf')](_0x3e1389));_0x434f19(_0x3e1389);})[_0x2626('0x16')](function(_0x36d199){logger[_0x2626('0x17')](_0x2626('0x35'),_0x36d199[_0x2626('0x10')],_0x59df91);_0x483a22(_0x4c6dec[_0x2626('0x17')](0x1f4,_0x36d199['message']));});});});};exports[_0x2626('0x36')]=function(_0x2b0e3e){var _0x148b7a=this;return new Promise(function(_0x1d9028,_0x3d0a42){return db[_0x2626('0x22')][_0x2626('0x23')](function(_0x1e3706){return db[_0x2626('0x37')][_0x2626('0x19')](_0x2b0e3e[_0x2626('0x1a')],{'raw':_0x2b0e3e[_0x2626('0x6')]?_0x2b0e3e[_0x2626('0x6')][_0x2626('0x5')]===undefined?!![]:![]:!![],'transaction':_0x1e3706})['then'](function(){logger[_0x2626('0x14')](_0x2626('0x38'),JSON[_0x2626('0xf')](_0x2b0e3e[_0x2626('0x6')][_0x2626('0x7')]),_0x2b0e3e[_0x2626('0x6')][_0x2626('0x7')][_0x2626('0x1d')]);return db['CmHopper']['destroy']({'where':_0x2b0e3e[_0x2626('0x6')]?_0x2b0e3e[_0x2626('0x6')]['where']||null:null,'transaction':_0x1e3706});});})['then'](function(_0x2a3ee1){logger[_0x2626('0x14')](_0x2626('0x36'),_0x2b0e3e);logger[_0x2626('0x15')](_0x2626('0x36'),_0x2b0e3e,JSON[_0x2626('0xf')](_0x2a3ee1));_0x1d9028(_0x2a3ee1);})['catch'](function(_0xad6e17){logger[_0x2626('0x17')](_0x2626('0x36'),_0xad6e17[_0x2626('0x10')],_0x2b0e3e);_0x3d0a42(_0x148b7a['error'](0x1f4,_0xad6e17[_0x2626('0x10')]));});});};exports[_0x2626('0x39')]=function(_0x25889b){var _0x14f338=this;return new Promise(function(_0x5afe0d,_0x31944f){return db[_0x2626('0x12')][_0x2626('0x4')]({'raw':_0x25889b[_0x2626('0x6')]?_0x25889b[_0x2626('0x6')][_0x2626('0x5')]===undefined?!![]:![]:!![],'where':_0x25889b[_0x2626('0x6')]?_0x25889b[_0x2626('0x6')][_0x2626('0x7')]||null:null,'attributes':[[db['sequelize']['fn'](_0x2626('0x3a'),db[_0x2626('0x22')]['fn']('IF',db[_0x2626('0x22')][_0x2626('0x3b')](_0x2626('0x3c')+util[_0x2626('0x3d')]('\x22%s\x22',moment()[_0x2626('0x3d')](_0x2626('0x3e')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})['then'](function(_0xb759df){logger[_0x2626('0x14')](_0x2626('0x39'),_0x25889b);logger[_0x2626('0x15')](_0x2626('0x39'),_0x25889b,JSON[_0x2626('0xf')](_0xb759df));_0x5afe0d(_0xb759df);})['catch'](function(_0x34ef54){logger[_0x2626('0x17')](_0x2626('0x39'),_0x34ef54[_0x2626('0x10')],_0x25889b);_0x31944f(_0x14f338['error'](0x1f4,_0x34ef54[_0x2626('0x10')]));});});};exports[_0x2626('0x3f')]=function(_0xc207de){var _0x1f0618=this;return new Promise(function(_0x310d31,_0x5aa73e){return db[_0x2626('0x20')]['describe']()[_0x2626('0xd')](function(){return db[_0x2626('0x22')][_0x2626('0x23')](function(_0x35b790){return db[_0x2626('0x12')][_0x2626('0x4')]({'where':_0xc207de[_0x2626('0x6')]?_0xc207de['options'][_0x2626('0x7')]||null:null,'attributes':_0xc207de[_0x2626('0x6')]?_0xc207de['options'][_0x2626('0x9')]||null:null,'limit':0x1,'order':_0xc207de[_0x2626('0x6')]?_0xc207de[_0x2626('0x6')][_0x2626('0x24')]||null:null,'group':db[_0x2626('0x12')]['UserId'],'transaction':_0x35b790,'lock':_0x35b790[_0x2626('0x25')][_0x2626('0x26')],'include':_0xc207de['options']?_0xc207de['options'][_0x2626('0xb')]?_[_0x2626('0xa')](_0xc207de[_0x2626('0x6')][_0x2626('0xb')],function(_0x36f4c0){return{'model':db[_0x36f4c0[_0x2626('0xc')]],'as':_0x36f4c0['as'],'attributes':_0x36f4c0[_0x2626('0x9')],'include':_0x36f4c0['include']?_['map'](_0x36f4c0[_0x2626('0xb')],function(_0x1610b6){return{'model':db[_0x1610b6[_0x2626('0xc')]],'as':_0x1610b6['as'],'attributes':_0x1610b6['attributes'],'include':_0x1610b6['include']?_[_0x2626('0xa')](_0x1610b6[_0x2626('0xb')],function(_0x1ec59b){return{'model':db[_0x1ec59b[_0x2626('0xc')]],'as':_0x1ec59b['as'],'attributes':_0x1ec59b[_0x2626('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x696806){var _0x598b0b=[];for(var _0x46df94=0x0;_0x46df94<_0x696806[_0x2626('0x31')];_0x46df94+=0x1){_0x598b0b[_0x2626('0x2d')](_0x696806[_0x46df94][_0x2626('0x2e')](_0xc207de[_0x2626('0x1a')],{'transaction':_0x35b790}));}return BPromise[_0x2626('0x30')](_0x598b0b);});})[_0x2626('0xd')](function(_0x284767){logger[_0x2626('0x14')](_0x2626('0x3f'),_0xc207de);logger['debug'](_0x2626('0x3f'),_0xc207de,JSON[_0x2626('0xf')](_0x284767));_0x310d31(_0x284767);})['catch'](function(_0xb1f1b9){logger[_0x2626('0x17')](_0x2626('0x3f'),_0xb1f1b9['message'],_0xc207de);_0x5aa73e(_0x1f0618['error'](0x1f4,_0xb1f1b9[_0x2626('0x10')]));});});});};exports['GetCmHopperPreview']=function(_0x3fff47){var _0x496f9e=this;return new Promise(function(_0x34a053,_0x1c4d98){db[_0x2626('0x20')][_0x2626('0x21')]()['then'](function(_0x55b522){return db[_0x2626('0x12')]['findAll']({'raw':_0x3fff47[_0x2626('0x6')]?_0x3fff47[_0x2626('0x6')][_0x2626('0x5')]===undefined?!![]:![]:!![],'where':_0x3fff47[_0x2626('0x6')]?_0x3fff47[_0x2626('0x6')][_0x2626('0x7')]||null:null,'attributes':_0x3fff47[_0x2626('0x6')]?_0x3fff47[_0x2626('0x6')][_0x2626('0x9')]||null:null,'limit':_0x3fff47['options']?_0x3fff47[_0x2626('0x6')][_0x2626('0x8')]||null:null,'include':_0x3fff47[_0x2626('0x6')]?_0x3fff47[_0x2626('0x6')][_0x2626('0xb')]?_['map'](_0x3fff47[_0x2626('0x6')][_0x2626('0xb')],function(_0x19a466){return{'model':db[_0x19a466[_0x2626('0xc')]],'as':_0x19a466['as'],'attributes':_0x19a466['as']===_0x2626('0x27')?_[_0x2626('0x28')](_0x55b522):_0x19a466[_0x2626('0x9')],'include':_0x19a466[_0x2626('0xb')]?_[_0x2626('0xa')](_0x19a466[_0x2626('0xb')],function(_0x581ba2){return{'model':db[_0x581ba2['model']],'as':_0x581ba2['as'],'attributes':_0x581ba2[_0x2626('0x9')],'include':_0x581ba2[_0x2626('0xb')]?_[_0x2626('0xa')](_0x581ba2[_0x2626('0xb')],function(_0x1b1732){return{'model':db[_0x1b1732[_0x2626('0xc')]],'as':_0x1b1732['as'],'attributes':_0x1b1732[_0x2626('0x9')]};}):[]};}):[]};}):[]:[]})[_0x2626('0xd')](function(_0xc14b25){logger['info'](_0x2626('0xe'),_0x3fff47);logger[_0x2626('0x15')](_0x2626('0xe'),_0x3fff47,JSON[_0x2626('0xf')](_0xc14b25));_0x34a053(_0xc14b25);})[_0x2626('0x16')](function(_0x2ae3b4){logger[_0x2626('0x17')](_0x2626('0xe'),_0x2ae3b4['message'],_0x3fff47);_0x1c4d98(_0x496f9e[_0x2626('0x17')](0x1f4,_0x2ae3b4[_0x2626('0x10')]));});});});};exports['GetContactByPhone']=function(_0x1fb7c4){var _0x44f88d=this;return new Promise(function(_0x3652bb,_0x4f7b2b){return db[_0x2626('0x20')][_0x2626('0x40')]({'raw':!![],'where':{'phone':_0x1fb7c4['options'][_0x2626('0x7')][_0x2626('0x41')]},'attributes':['id',_0x2626('0x42')],'order':[['id',_0x2626('0x43')]]})[_0x2626('0xd')](function(_0x53a76c){logger[_0x2626('0x14')](_0x2626('0x44'),_0x1fb7c4);logger[_0x2626('0x15')]('getContactByPhone',_0x1fb7c4,JSON[_0x2626('0xf')](_0x53a76c));_0x3652bb(_0x53a76c);})[_0x2626('0x16')](function(_0x43591a){logger[_0x2626('0x17')]('getContactByPhone',_0x43591a[_0x2626('0x10')],_0x1fb7c4);_0x4f7b2b(_0x44f88d[_0x2626('0x17')](0x1f4,_0x43591a['message']));});});};exports[_0x2626('0x45')]=function(_0x3877cd){var _0x1a68fa=this;return new Promise(function(_0x502b2f,_0x4000b9){return db['sequelize'][_0x2626('0x23')](function(_0x6937a6){var _0x9f2994=_0x3877cd['options']&&_0x3877cd[_0x2626('0x6')][_0x2626('0x7')]?_0x3877cd[_0x2626('0x6')][_0x2626('0x7')]:{};return db[_0x2626('0x12')][_0x2626('0x2e')](_0x3877cd[_0x2626('0x1a')],{'where':_0x9f2994,'transaction':_0x6937a6})['then'](function(_0x5e02de){logger[_0x2626('0x14')]('ResetActiveCalls',_0x3877cd);logger[_0x2626('0x15')]('ResetActiveCalls',_0x3877cd,JSON['stringify'](_0x5e02de));_0x502b2f(_0x5e02de);})[_0x2626('0x16')](function(_0x601a25){logger[_0x2626('0x17')](_0x2626('0x45'),_0x601a25[_0x2626('0x10')],_0x3877cd);_0x4000b9(_0x1a68fa[_0x2626('0x17')](0x1f4,_0x601a25[_0x2626('0x10')]));});});});};exports[_0x2626('0x46')]=function(_0x152973){var _0x2f5b50=this;var _0x50fb18=_0x152973['body'][_0x2626('0x7')]['voiceQueueIds'];var _0x2c479c=_0x152973[_0x2626('0x1a')][_0x2626('0x7')][_0x2626('0x47')];var _0x405ff8=_0x152973[_0x2626('0x1a')][_0x2626('0x7')]['availableAgentsIds'];return new Promise(function(_0xc6242e,_0x2afe5f){return db[_0x2626('0x12')][_0x2626('0x4')]({'where':{'voiceQueueId':{'$in':_0x50fb18},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize']['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x2c479c+_0x2626('0x48')),'$gt':db[_0x2626('0x22')]['literal']('NOW()')}},'UserId':{'$in':_0x405ff8}},'include':[{'model':db[_0x2626('0x20')],'as':_0x2626('0x27')},{'model':db[_0x2626('0x29')],'as':'Agent','attributes':['id',_0x2626('0x2b'),_0x2626('0x2c')]},{'model':db['CmList'],'as':_0x2626('0x49')}]})['then'](function(_0x243e3d){if(_0x243e3d[_0x2626('0x31')]>0x0){return db[_0x2626('0x22')][_0x2626('0x23')](function(_0x525b5a){return db[_0x2626('0x12')][_0x2626('0x2e')]({'recallmeNotifiedDate':db[_0x2626('0x22')][_0x2626('0x3b')]('NOW()')},{'where':{'id':{'$in':_[_0x2626('0xa')](_0x243e3d,'id')}},'transaction':_0x525b5a})['then'](function(){_0xc6242e(_0x243e3d);})[_0x2626('0x16')](function(_0x2a18c2){logger['error'](_0x2626('0x46'),_0x2a18c2[_0x2626('0x10')],_0x152973);_0x2afe5f(_0x2f5b50[_0x2626('0x17')](0x1f4,_0x2a18c2['message']));});})[_0x2626('0x16')](function(_0xff772a){logger['error'](_0x2626('0x46'),_0xff772a[_0x2626('0x10')],_0x152973);_0x2afe5f(_0x2f5b50[_0x2626('0x17')](0x1f4,_0xff772a[_0x2626('0x10')]));});}else{_0xc6242e(_0x243e3d);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index dbaf4ba..a02cb8e 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 _0x3a09=['../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','getPreview','/timezone','put','update','delete','destroy','exports','Router'];(function(_0x277af0,_0x1f0361){var _0x43bd7c=function(_0x3ad480){while(--_0x3ad480){_0x277af0['push'](_0x277af0['shift']());}};_0x43bd7c(++_0x1f0361);}(_0x3a09,0x1da));var _0x93a0=function(_0x259d71,_0x1e15f4){_0x259d71=_0x259d71-0x0;var _0x473d20=_0x3a09[_0x259d71];return _0x473d20;};'use strict';var express=require('express');var router=express[_0x93a0('0x0')]();var auth=require(_0x93a0('0x1'));var controller=require(_0x93a0('0x2'));router[_0x93a0('0x3')]('/',auth[_0x93a0('0x4')](),controller[_0x93a0('0x5')]);router[_0x93a0('0x3')](_0x93a0('0x6'),auth['isAuthenticated'](),controller[_0x93a0('0x7')]);router[_0x93a0('0x3')](_0x93a0('0x8'),auth['isAuthenticated'](),controller[_0x93a0('0x9')]);router[_0x93a0('0x3')](_0x93a0('0xa'),auth[_0x93a0('0x4')](),controller[_0x93a0('0xb')]);router[_0x93a0('0x3')](_0x93a0('0xc'),auth[_0x93a0('0x4')](),controller[_0x93a0('0xd')]);router[_0x93a0('0x3')](_0x93a0('0xe'),auth[_0x93a0('0x4')](),controller[_0x93a0('0xf')]);router[_0x93a0('0x10')]('/',auth[_0x93a0('0x4')](),controller[_0x93a0('0x11')]);router[_0x93a0('0x10')]('/preview',auth[_0x93a0('0x4')](),controller[_0x93a0('0x12')]);router[_0x93a0('0x10')](_0x93a0('0x13'),auth[_0x93a0('0x4')](),controller['getTimezone']);router[_0x93a0('0x14')](_0x93a0('0xc'),auth[_0x93a0('0x4')](),controller[_0x93a0('0x15')]);router[_0x93a0('0x16')](_0x93a0('0xc'),auth['isAuthenticated'](),controller[_0x93a0('0x17')]);module[_0x93a0('0x18')]=router; \ No newline at end of file +var _0x5853=['/preview','getPreview','/timezone','put','/:id','update','delete','exports','express','Router','./cmHopper.controller','get','index','/describe','isAuthenticated','/opencontacts','getOpenContacts','/timezones','/:id/previewrecall','getPreviewRecall','create','post'];(function(_0x562911,_0x5be4ae){var _0x2003e2=function(_0xe8069b){while(--_0xe8069b){_0x562911['push'](_0x562911['shift']());}};_0x2003e2(++_0x5be4ae);}(_0x5853,0x8c));var _0x3585=function(_0x1b16ba,_0xe1a8dc){_0x1b16ba=_0x1b16ba-0x0;var _0x30d703=_0x5853[_0x1b16ba];return _0x30d703;};'use strict';var express=require(_0x3585('0x0'));var router=express[_0x3585('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x3585('0x2'));router[_0x3585('0x3')]('/',auth['isAuthenticated'](),controller[_0x3585('0x4')]);router[_0x3585('0x3')](_0x3585('0x5'),auth[_0x3585('0x6')](),controller['describe']);router[_0x3585('0x3')](_0x3585('0x7'),auth[_0x3585('0x6')](),controller[_0x3585('0x8')]);router[_0x3585('0x3')](_0x3585('0x9'),auth['isAuthenticated'](),controller['getTimezones']);router[_0x3585('0x3')]('/:id',auth[_0x3585('0x6')](),controller['show']);router[_0x3585('0x3')](_0x3585('0xa'),auth['isAuthenticated'](),controller[_0x3585('0xb')]);router['post']('/',auth[_0x3585('0x6')](),controller[_0x3585('0xc')]);router[_0x3585('0xd')](_0x3585('0xe'),auth[_0x3585('0x6')](),controller[_0x3585('0xf')]);router['post'](_0x3585('0x10'),auth['isAuthenticated'](),controller['getTimezone']);router[_0x3585('0x11')](_0x3585('0x12'),auth[_0x3585('0x6')](),controller[_0x3585('0x13')]);router[_0x3585('0x14')](_0x3585('0x12'),auth[_0x3585('0x6')](),controller['destroy']);module[_0x3585('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 7c577ac..0ccb7f7 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 _0x4428=['YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','INTEGER','STRING','DATE','format'];(function(_0x27d2bf,_0x27ec74){var _0x5498a=function(_0x128d58){while(--_0x128d58){_0x27d2bf['push'](_0x27d2bf['shift']());}};_0x5498a(++_0x27ec74);}(_0x4428,0x174));var _0x8442=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4428[_0x1cc8fe];return _0x230054;};'use strict';var moment=require('moment');var Sequelize=require(_0x8442('0x0'));module[_0x8442('0x1')]={'CmHopperId':{'type':Sequelize[_0x8442('0x2')]},'phone':{'type':Sequelize[_0x8442('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x8442('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x8442('0x4')],'defaultValue':moment()[_0x8442('0x5')](_0x8442('0x6'))},'countbusyretry':{'type':Sequelize[_0x8442('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8442('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x8442('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8442('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8442('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8442('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8442('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x299f=['sequelize','INTEGER','DATE','format','moment'];(function(_0x50032c,_0x2102eb){var _0x30fa3a=function(_0xbcff18){while(--_0xbcff18){_0x50032c['push'](_0x50032c['shift']());}};_0x30fa3a(++_0x2102eb);}(_0x299f,0x171));var _0xf299=function(_0x3ab408,_0x414649){_0x3ab408=_0x3ab408-0x0;var _0x29b2d7=_0x299f[_0x3ab408];return _0x29b2d7;};'use strict';var moment=require(_0xf299('0x0'));var Sequelize=require(_0xf299('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0xf299('0x2')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xf299('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xf299('0x3')],'defaultValue':moment()[_0xf299('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf299('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xf299('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf299('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf299('0x2')],'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 e326cf8..b4c8fa4 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 _0xbc7f=['show','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','limit','set','json','apply','reject','save','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','send','index','map','CmHopperAdditionalPhone','rawAttributes','type','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc7f,0x1a8));var _0xfbc7=function(_0x6eccf7,_0x209c77){_0x6eccf7=_0x6eccf7-0x0;var _0x1fca60=_0xbc7f[_0x6eccf7];return _0x1fca60;};'use strict';var emlformat=require(_0xfbc7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfbc7('0x1'));var jsonpatch=require(_0xfbc7('0x2'));var rp=require('request-promise');var moment=require(_0xfbc7('0x3'));var BPromise=require(_0xfbc7('0x4'));var Mustache=require(_0xfbc7('0x5'));var util=require(_0xfbc7('0x6'));var path=require(_0xfbc7('0x7'));var sox=require(_0xfbc7('0x8'));var csv=require(_0xfbc7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfbc7('0xa'));var _=require(_0xfbc7('0xb'));var squel=require(_0xfbc7('0xc'));var crypto=require(_0xfbc7('0xd'));var jsforce=require(_0xfbc7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfbc7('0x9'));var querystring=require(_0xfbc7('0xf'));var Papa=require(_0xfbc7('0x10'));var Redis=require(_0xfbc7('0x11'));var authService=require(_0xfbc7('0x12'));var qs=require(_0xfbc7('0x13'));var as=require(_0xfbc7('0x14'));var hardwareService=require(_0xfbc7('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xfbc7('0x16'));var config=require(_0xfbc7('0x17'));var licenseUtil=require(_0xfbc7('0x18'));var db=require(_0xfbc7('0x19'))['db'];function respondWithStatusCode(_0x13cc83,_0x479897){_0x479897=_0x479897||0xcc;return function(_0x5eefc9){if(_0x5eefc9){return _0x13cc83[_0xfbc7('0x1a')](_0x479897);}return _0x13cc83[_0xfbc7('0x1b')](_0x479897)[_0xfbc7('0x1c')]();};}function respondWithResult(_0x518f8d,_0x33d9d8){_0x33d9d8=_0x33d9d8||0xc8;return function(_0x3642d9){if(_0x3642d9){return _0x518f8d['status'](_0x33d9d8)['json'](_0x3642d9);}};}function respondWithFilteredResult(_0x120467,_0xebf2d0){return function(_0x30941d){if(_0x30941d){var _0x52cfa9=typeof _0xebf2d0['offset']==='undefined'&&typeof _0xebf2d0['limit']===_0xfbc7('0x1d');var _0x264df1=_0x30941d['count'];var _0x26c573=_0x52cfa9?0x0:_0xebf2d0['offset'];var _0x3bc1e6=_0x52cfa9?_0x30941d[_0xfbc7('0x1e')]:_0xebf2d0['offset']+_0xebf2d0[_0xfbc7('0x1f')];var _0x2baa2a;if(_0x3bc1e6>=_0x264df1){_0x3bc1e6=_0x264df1;_0x2baa2a=0xc8;}else{_0x2baa2a=0xce;}_0x120467['status'](_0x2baa2a);return _0x120467[_0xfbc7('0x20')]('Content-Range',_0x26c573+'-'+_0x3bc1e6+'/'+_0x264df1)[_0xfbc7('0x21')](_0x30941d);}return null;};}function patchUpdates(_0x2073f2){return function(_0x2ed0b7){try{jsonpatch[_0xfbc7('0x22')](_0x2ed0b7,_0x2073f2,!![]);}catch(_0x2ac5a8){return BPromise[_0xfbc7('0x23')](_0x2ac5a8);}return _0x2ed0b7[_0xfbc7('0x24')]();};}function saveUpdates(_0x5f4619,_0x57b6df){return function(_0x1c17d9){if(_0x1c17d9){return _0x1c17d9['update'](_0x5f4619)[_0xfbc7('0x25')](function(_0x48f834){return _0x48f834;});}return null;};}function removeEntity(_0x3da85f,_0x4b9b33){return function(_0x3813c0){if(_0x3813c0){return _0x3813c0[_0xfbc7('0x26')]()[_0xfbc7('0x25')](function(){var _0xd1dcf4=_0x3813c0[_0xfbc7('0x27')]({'plain':!![]});var _0x3c7abf=_0xfbc7('0x28');return db[_0xfbc7('0x29')][_0xfbc7('0x26')]({'where':{'type':_0x3c7abf,'resourceId':_0xd1dcf4['id']}})[_0xfbc7('0x25')](function(){return _0x3813c0;});})['then'](function(){_0x3da85f[_0xfbc7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12cccb,_0x459c5a){return function(_0x2c2d7d){if(!_0x2c2d7d){_0x12cccb[_0xfbc7('0x1a')](0x194);}return _0x2c2d7d;};}function handleError(_0x5a8c68,_0x3fa82b){_0x3fa82b=_0x3fa82b||0x1f4;return function(_0x58b28b){logger[_0xfbc7('0x2a')](_0x58b28b['stack']);if(_0x58b28b['name']){delete _0x58b28b['name'];}_0x5a8c68[_0xfbc7('0x1b')](_0x3fa82b)[_0xfbc7('0x2b')](_0x58b28b);};}exports[_0xfbc7('0x2c')]=function(_0x4f4646,_0x54a307){var _0x2cdb14={},_0x391b27={},_0x48c62c={'count':0x0,'rows':[]};var _0x3aeeba=_[_0xfbc7('0x2d')](db[_0xfbc7('0x2e')][_0xfbc7('0x2f')],function(_0x482660){return{'name':_0x482660['fieldName'],'type':_0x482660[_0xfbc7('0x30')]['key']};});_0x391b27[_0xfbc7('0x31')]=_[_0xfbc7('0x2d')](_0x3aeeba,_0xfbc7('0x32'));_0x391b27[_0xfbc7('0x33')]=_['keys'](_0x4f4646[_0xfbc7('0x33')]);_0x391b27[_0xfbc7('0x34')]=_['intersection'](_0x391b27['model'],_0x391b27[_0xfbc7('0x33')]);_0x2cdb14['attributes']=_[_0xfbc7('0x35')](_0x391b27['model'],qs[_0xfbc7('0x36')](_0x4f4646[_0xfbc7('0x33')][_0xfbc7('0x36')]));_0x2cdb14[_0xfbc7('0x37')]=_0x2cdb14[_0xfbc7('0x37')][_0xfbc7('0x38')]?_0x2cdb14[_0xfbc7('0x37')]:_0x391b27[_0xfbc7('0x31')];if(!_0x4f4646[_0xfbc7('0x33')][_0xfbc7('0x39')]('nolimit')){_0x2cdb14[_0xfbc7('0x1f')]=qs['limit'](_0x4f4646[_0xfbc7('0x33')][_0xfbc7('0x1f')]);_0x2cdb14[_0xfbc7('0x3a')]=qs[_0xfbc7('0x3a')](_0x4f4646[_0xfbc7('0x33')][_0xfbc7('0x3a')]);}_0x2cdb14[_0xfbc7('0x3b')]=qs[_0xfbc7('0x3c')](_0x4f4646['query'][_0xfbc7('0x3c')]);_0x2cdb14[_0xfbc7('0x3d')]=qs[_0xfbc7('0x34')](_['pick'](_0x4f4646[_0xfbc7('0x33')],_0x391b27[_0xfbc7('0x34')]),_0x3aeeba);if(_0x4f4646[_0xfbc7('0x33')][_0xfbc7('0x3e')]){_0x2cdb14[_0xfbc7('0x3d')]=_[_0xfbc7('0x3f')](_0x2cdb14[_0xfbc7('0x3d')],{'$or':_[_0xfbc7('0x2d')](_0x3aeeba,function(_0x1f2c8f){if(_0x1f2c8f[_0xfbc7('0x30')]!==_0xfbc7('0x40')){var _0x349c02={};_0x349c02[_0x1f2c8f['name']]={'$like':'%'+_0x4f4646[_0xfbc7('0x33')][_0xfbc7('0x3e')]+'%'};return _0x349c02;}})});}_0x2cdb14=_['merge']({},_0x2cdb14,_0x4f4646[_0xfbc7('0x41')]);var _0x2275ab={'where':_0x2cdb14[_0xfbc7('0x3d')]};return db[_0xfbc7('0x2e')][_0xfbc7('0x1e')](_0x2275ab)[_0xfbc7('0x25')](function(_0x1ba186){_0x48c62c[_0xfbc7('0x1e')]=_0x1ba186;if(_0x4f4646[_0xfbc7('0x33')][_0xfbc7('0x42')]){_0x2cdb14[_0xfbc7('0x43')]=[{'all':!![]}];}return db[_0xfbc7('0x2e')]['findAll'](_0x2cdb14);})[_0xfbc7('0x25')](function(_0x1e7cc5){_0x48c62c['rows']=_0x1e7cc5;return _0x48c62c;})['then'](respondWithFilteredResult(_0x54a307,_0x2cdb14))['catch'](handleError(_0x54a307,null));};exports[_0xfbc7('0x44')]=function(_0x15e66c,_0x40a34a){var _0x134e57={'raw':!![],'where':{'id':_0x15e66c['params']['id']}},_0x39e73a={};_0x39e73a['model']=_['keys'](db[_0xfbc7('0x2e')][_0xfbc7('0x2f')]);_0x39e73a[_0xfbc7('0x33')]=_[_0xfbc7('0x45')](_0x15e66c[_0xfbc7('0x33')]);_0x39e73a[_0xfbc7('0x34')]=_[_0xfbc7('0x35')](_0x39e73a['model'],_0x39e73a['query']);_0x134e57['attributes']=_['intersection'](_0x39e73a[_0xfbc7('0x31')],qs[_0xfbc7('0x36')](_0x15e66c[_0xfbc7('0x33')]['fields']));_0x134e57[_0xfbc7('0x37')]=_0x134e57[_0xfbc7('0x37')][_0xfbc7('0x38')]?_0x134e57[_0xfbc7('0x37')]:_0x39e73a['model'];if(_0x15e66c[_0xfbc7('0x33')]['includeAll']){_0x134e57[_0xfbc7('0x43')]=[{'all':!![]}];}_0x134e57=_['merge']({},_0x134e57,_0x15e66c[_0xfbc7('0x41')]);return db[_0xfbc7('0x2e')][_0xfbc7('0x46')](_0x134e57)[_0xfbc7('0x25')](handleEntityNotFound(_0x40a34a,null))[_0xfbc7('0x25')](respondWithResult(_0x40a34a,null))[_0xfbc7('0x47')](handleError(_0x40a34a,null));};exports[_0xfbc7('0x48')]=function(_0x3b4357,_0x2f478b){return db[_0xfbc7('0x2e')]['create'](_0x3b4357[_0xfbc7('0x49')],{})[_0xfbc7('0x25')](function(_0x977be8){var _0x3af51f=_0x3b4357[_0xfbc7('0x4a')][_0xfbc7('0x27')]({'plain':!![]});if(!_0x3af51f)throw new Error(_0xfbc7('0x4b'));if(_0x3af51f[_0xfbc7('0x4c')]===_0xfbc7('0x4a')){var _0x24122b=_0x977be8[_0xfbc7('0x27')]({'plain':!![]});var _0x170a47='CmHopperAdditionalPhones';return db['UserProfileSection']['find']({'where':{'name':_0x170a47,'userProfileId':_0x3af51f[_0xfbc7('0x4d')]},'raw':!![]})[_0xfbc7('0x25')](function(_0x36c2a2){if(_0x36c2a2&&_0x36c2a2[_0xfbc7('0x4e')]===0x0){return db[_0xfbc7('0x29')][_0xfbc7('0x48')]({'name':_0x24122b['name'],'resourceId':_0x24122b['id'],'type':_0x36c2a2['name'],'sectionId':_0x36c2a2['id']},{})[_0xfbc7('0x25')](function(){return _0x977be8;});}else{return _0x977be8;}})['catch'](function(_0x3b9598){logger[_0xfbc7('0x2a')](_0xfbc7('0x4f'),_0x3b9598);throw _0x3b9598;});}return _0x977be8;})[_0xfbc7('0x25')](respondWithResult(_0x2f478b,0xc9))[_0xfbc7('0x47')](handleError(_0x2f478b,null));};exports[_0xfbc7('0x50')]=function(_0x307635,_0x3759a4){if(_0x307635['body']['id']){delete _0x307635[_0xfbc7('0x49')]['id'];}return db[_0xfbc7('0x2e')][_0xfbc7('0x46')]({'where':{'id':_0x307635[_0xfbc7('0x51')]['id']}})[_0xfbc7('0x25')](handleEntityNotFound(_0x3759a4,null))[_0xfbc7('0x25')](saveUpdates(_0x307635['body'],null))[_0xfbc7('0x25')](respondWithResult(_0x3759a4,null))[_0xfbc7('0x47')](handleError(_0x3759a4,null));};exports[_0xfbc7('0x26')]=function(_0x309d58,_0x53f6e4){return db[_0xfbc7('0x2e')][_0xfbc7('0x46')]({'where':{'id':_0x309d58['params']['id']}})[_0xfbc7('0x25')](handleEntityNotFound(_0x53f6e4,null))[_0xfbc7('0x25')](removeEntity(_0x53f6e4,null))[_0xfbc7('0x47')](handleError(_0x53f6e4,null));}; \ No newline at end of file +var _0x7755=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','then','destroy','UserProfileResource','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','keys','include','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','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7755,0x8e));var _0x5775=function(_0x2e008b,_0x5844b1){_0x2e008b=_0x2e008b-0x0;var _0x2f32e5=_0x7755[_0x2e008b];return _0x2f32e5;};'use strict';var emlformat=require(_0x5775('0x0'));var rimraf=require(_0x5775('0x1'));var zipdir=require(_0x5775('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5775('0x3'));var BPromise=require(_0x5775('0x4'));var Mustache=require(_0x5775('0x5'));var util=require(_0x5775('0x6'));var path=require(_0x5775('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5775('0x8'));var _=require(_0x5775('0x9'));var squel=require(_0x5775('0xa'));var crypto=require(_0x5775('0xb'));var jsforce=require(_0x5775('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5775('0xd'));var querystring=require(_0x5775('0xe'));var Papa=require('papaparse');var Redis=require(_0x5775('0xf'));var authService=require(_0x5775('0x10'));var qs=require(_0x5775('0x11'));var as=require(_0x5775('0x12'));var hardwareService=require(_0x5775('0x13'));var logger=require(_0x5775('0x14'))('api');var utils=require(_0x5775('0x15'));var config=require(_0x5775('0x16'));var licenseUtil=require(_0x5775('0x17'));var db=require(_0x5775('0x18'))['db'];function respondWithStatusCode(_0x1160f4,_0x37cd87){_0x37cd87=_0x37cd87||0xcc;return function(_0x3c5812){if(_0x3c5812){return _0x1160f4[_0x5775('0x19')](_0x37cd87);}return _0x1160f4[_0x5775('0x1a')](_0x37cd87)[_0x5775('0x1b')]();};}function respondWithResult(_0x5c9fa0,_0x5a85a0){_0x5a85a0=_0x5a85a0||0xc8;return function(_0xf67f8e){if(_0xf67f8e){return _0x5c9fa0[_0x5775('0x1a')](_0x5a85a0)[_0x5775('0x1c')](_0xf67f8e);}};}function respondWithFilteredResult(_0x402aa6,_0x1323e7){return function(_0x13f622){if(_0x13f622){var _0x3fac68=typeof _0x1323e7[_0x5775('0x1d')]===_0x5775('0x1e')&&typeof _0x1323e7['limit']===_0x5775('0x1e');var _0x388bc9=_0x13f622['count'];var _0x154e12=_0x3fac68?0x0:_0x1323e7[_0x5775('0x1d')];var _0x42e448=_0x3fac68?_0x13f622[_0x5775('0x1f')]:_0x1323e7[_0x5775('0x1d')]+_0x1323e7['limit'];var _0x3639c0;if(_0x42e448>=_0x388bc9){_0x42e448=_0x388bc9;_0x3639c0=0xc8;}else{_0x3639c0=0xce;}_0x402aa6[_0x5775('0x1a')](_0x3639c0);return _0x402aa6['set'](_0x5775('0x20'),_0x154e12+'-'+_0x42e448+'/'+_0x388bc9)[_0x5775('0x1c')](_0x13f622);}return null;};}function patchUpdates(_0x3b4da9){return function(_0x5b5da9){try{jsonpatch[_0x5775('0x21')](_0x5b5da9,_0x3b4da9,!![]);}catch(_0x1d73ed){return BPromise['reject'](_0x1d73ed);}return _0x5b5da9[_0x5775('0x22')]();};}function saveUpdates(_0x443477,_0x3ba79a){return function(_0x5468e7){if(_0x5468e7){return _0x5468e7['update'](_0x443477)[_0x5775('0x23')](function(_0x49729d){return _0x49729d;});}return null;};}function removeEntity(_0x31807a,_0x475c50){return function(_0x154723){if(_0x154723){return _0x154723[_0x5775('0x24')]()[_0x5775('0x23')](function(){var _0x1e6557=_0x154723['get']({'plain':!![]});var _0x57740e='CmHopperAdditionalPhones';return db[_0x5775('0x25')][_0x5775('0x24')]({'where':{'type':_0x57740e,'resourceId':_0x1e6557['id']}})[_0x5775('0x23')](function(){return _0x154723;});})[_0x5775('0x23')](function(){_0x31807a[_0x5775('0x1a')](0xcc)[_0x5775('0x1b')]();});}};}function handleEntityNotFound(_0x5222aa,_0x3d91dc){return function(_0x463b57){if(!_0x463b57){_0x5222aa[_0x5775('0x19')](0x194);}return _0x463b57;};}function handleError(_0x5556cd,_0x4abc12){_0x4abc12=_0x4abc12||0x1f4;return function(_0x197774){logger[_0x5775('0x26')](_0x197774[_0x5775('0x27')]);if(_0x197774['name']){delete _0x197774[_0x5775('0x28')];}_0x5556cd[_0x5775('0x1a')](_0x4abc12)[_0x5775('0x29')](_0x197774);};}exports[_0x5775('0x2a')]=function(_0x21d376,_0x338a4c){var _0x4a6a0e={},_0xdedf06={},_0x2d2e67={'count':0x0,'rows':[]};var _0x460abd=_[_0x5775('0x2b')](db[_0x5775('0x2c')][_0x5775('0x2d')],function(_0x159d6d){return{'name':_0x159d6d[_0x5775('0x2e')],'type':_0x159d6d[_0x5775('0x2f')]['key']};});_0xdedf06[_0x5775('0x30')]=_['map'](_0x460abd,'name');_0xdedf06[_0x5775('0x31')]=_['keys'](_0x21d376[_0x5775('0x31')]);_0xdedf06[_0x5775('0x32')]=_[_0x5775('0x33')](_0xdedf06['model'],_0xdedf06[_0x5775('0x31')]);_0x4a6a0e[_0x5775('0x34')]=_['intersection'](_0xdedf06[_0x5775('0x30')],qs[_0x5775('0x35')](_0x21d376['query']['fields']));_0x4a6a0e[_0x5775('0x34')]=_0x4a6a0e[_0x5775('0x34')][_0x5775('0x36')]?_0x4a6a0e[_0x5775('0x34')]:_0xdedf06['model'];if(!_0x21d376[_0x5775('0x31')][_0x5775('0x37')](_0x5775('0x38'))){_0x4a6a0e['limit']=qs[_0x5775('0x39')](_0x21d376[_0x5775('0x31')][_0x5775('0x39')]);_0x4a6a0e[_0x5775('0x1d')]=qs['offset'](_0x21d376['query']['offset']);}_0x4a6a0e['order']=qs[_0x5775('0x3a')](_0x21d376[_0x5775('0x31')][_0x5775('0x3a')]);_0x4a6a0e[_0x5775('0x3b')]=qs['filters'](_[_0x5775('0x3c')](_0x21d376[_0x5775('0x31')],_0xdedf06[_0x5775('0x32')]),_0x460abd);if(_0x21d376['query'][_0x5775('0x3d')]){_0x4a6a0e['where']=_[_0x5775('0x3e')](_0x4a6a0e[_0x5775('0x3b')],{'$or':_[_0x5775('0x2b')](_0x460abd,function(_0x2e01cc){if(_0x2e01cc[_0x5775('0x2f')]!==_0x5775('0x3f')){var _0xff3950={};_0xff3950[_0x2e01cc[_0x5775('0x28')]]={'$like':'%'+_0x21d376['query'][_0x5775('0x3d')]+'%'};return _0xff3950;}})});}_0x4a6a0e=_[_0x5775('0x3e')]({},_0x4a6a0e,_0x21d376[_0x5775('0x40')]);var _0x1e36bd={'where':_0x4a6a0e['where']};return db[_0x5775('0x2c')][_0x5775('0x1f')](_0x1e36bd)[_0x5775('0x23')](function(_0x447fcb){_0x2d2e67[_0x5775('0x1f')]=_0x447fcb;if(_0x21d376[_0x5775('0x31')][_0x5775('0x41')]){_0x4a6a0e['include']=[{'all':!![]}];}return db[_0x5775('0x2c')][_0x5775('0x42')](_0x4a6a0e);})[_0x5775('0x23')](function(_0x29ae7c){_0x2d2e67['rows']=_0x29ae7c;return _0x2d2e67;})[_0x5775('0x23')](respondWithFilteredResult(_0x338a4c,_0x4a6a0e))['catch'](handleError(_0x338a4c,null));};exports[_0x5775('0x43')]=function(_0x413993,_0x2f2467){var _0x471cdb={'raw':!![],'where':{'id':_0x413993[_0x5775('0x44')]['id']}},_0x34a514={};_0x34a514[_0x5775('0x30')]=_[_0x5775('0x45')](db[_0x5775('0x2c')]['rawAttributes']);_0x34a514['query']=_[_0x5775('0x45')](_0x413993[_0x5775('0x31')]);_0x34a514[_0x5775('0x32')]=_[_0x5775('0x33')](_0x34a514[_0x5775('0x30')],_0x34a514['query']);_0x471cdb[_0x5775('0x34')]=_[_0x5775('0x33')](_0x34a514[_0x5775('0x30')],qs['fields'](_0x413993[_0x5775('0x31')][_0x5775('0x35')]));_0x471cdb[_0x5775('0x34')]=_0x471cdb[_0x5775('0x34')][_0x5775('0x36')]?_0x471cdb['attributes']:_0x34a514[_0x5775('0x30')];if(_0x413993[_0x5775('0x31')]['includeAll']){_0x471cdb[_0x5775('0x46')]=[{'all':!![]}];}_0x471cdb=_[_0x5775('0x3e')]({},_0x471cdb,_0x413993[_0x5775('0x40')]);return db[_0x5775('0x2c')][_0x5775('0x47')](_0x471cdb)['then'](handleEntityNotFound(_0x2f2467,null))['then'](respondWithResult(_0x2f2467,null))[_0x5775('0x48')](handleError(_0x2f2467,null));};exports[_0x5775('0x49')]=function(_0x25f15a,_0x480c1c){return db[_0x5775('0x2c')][_0x5775('0x49')](_0x25f15a['body'],{})[_0x5775('0x23')](function(_0x403e12){var _0x3a8e68=_0x25f15a[_0x5775('0x4a')][_0x5775('0x4b')]({'plain':!![]});if(!_0x3a8e68)throw new Error(_0x5775('0x4c'));if(_0x3a8e68[_0x5775('0x4d')]===_0x5775('0x4a')){var _0x2bab43=_0x403e12[_0x5775('0x4b')]({'plain':!![]});var _0x773608='CmHopperAdditionalPhones';return db[_0x5775('0x4e')]['find']({'where':{'name':_0x773608,'userProfileId':_0x3a8e68[_0x5775('0x4f')]},'raw':!![]})['then'](function(_0x116153){if(_0x116153&&_0x116153[_0x5775('0x50')]===0x0){return db[_0x5775('0x25')][_0x5775('0x49')]({'name':_0x2bab43[_0x5775('0x28')],'resourceId':_0x2bab43['id'],'type':_0x116153[_0x5775('0x28')],'sectionId':_0x116153['id']},{})[_0x5775('0x23')](function(){return _0x403e12;});}else{return _0x403e12;}})['catch'](function(_0x16e277){logger[_0x5775('0x26')](_0x5775('0x51'),_0x16e277);throw _0x16e277;});}return _0x403e12;})[_0x5775('0x23')](respondWithResult(_0x480c1c,0xc9))['catch'](handleError(_0x480c1c,null));};exports[_0x5775('0x52')]=function(_0x37bab2,_0x1eeda1){if(_0x37bab2['body']['id']){delete _0x37bab2['body']['id'];}return db[_0x5775('0x2c')]['find']({'where':{'id':_0x37bab2['params']['id']}})[_0x5775('0x23')](handleEntityNotFound(_0x1eeda1,null))[_0x5775('0x23')](saveUpdates(_0x37bab2['body'],null))['then'](respondWithResult(_0x1eeda1,null))['catch'](handleError(_0x1eeda1,null));};exports[_0x5775('0x24')]=function(_0x54abf7,_0x1187c9){return db[_0x5775('0x2c')]['find']({'where':{'id':_0x54abf7['params']['id']}})[_0x5775('0x23')](handleEntityNotFound(_0x1187c9,null))[_0x5775('0x23')](removeEntity(_0x1187c9,null))[_0x5775('0x48')](handleError(_0x1187c9,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index b056b0b..9398ddb 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 _0xf169=['bluebird','../../config/environment','./cmHopperAdditionalPhone.attributes','define','cm_hopper_additional_phones','lodash','util','api','moment'];(function(_0x32072d,_0xddff61){var _0x38dcb1=function(_0x57f264){while(--_0x57f264){_0x32072d['push'](_0x32072d['shift']());}};_0x38dcb1(++_0xddff61);}(_0xf169,0x19a));var _0x9f16=function(_0x1c53f3,_0x1cfe95){_0x1c53f3=_0x1c53f3-0x0;var _0x5dbb72=_0xf169[_0x1c53f3];return _0x5dbb72;};'use strict';var _=require(_0x9f16('0x0'));var util=require(_0x9f16('0x1'));var logger=require('../../config/logger')(_0x9f16('0x2'));var moment=require(_0x9f16('0x3'));var BPromise=require(_0x9f16('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9f16('0x5'));var attributes=require(_0x9f16('0x6'));module['exports']=function(_0x5038b0,_0x33ad03){return _0x5038b0[_0x9f16('0x7')]('CmHopperAdditionalPhone',attributes,{'tableName':_0x9f16('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x239e=['./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2f8679,_0x5e09f5){var _0x7c9bb2=function(_0x1769ab){while(--_0x1769ab){_0x2f8679['push'](_0x2f8679['shift']());}};_0x7c9bb2(++_0x5e09f5);}(_0x239e,0x179));var _0xe239=function(_0x5f584a,_0x47f064){_0x5f584a=_0x5f584a-0x0;var _0x3788d9=_0x239e[_0x5f584a];return _0x3788d9;};'use strict';var _=require('lodash');var util=require(_0xe239('0x0'));var logger=require('../../config/logger')(_0xe239('0x1'));var moment=require(_0xe239('0x2'));var BPromise=require(_0xe239('0x3'));var rp=require(_0xe239('0x4'));var fs=require('fs');var path=require(_0xe239('0x5'));var rimraf=require(_0xe239('0x6'));var config=require('../../config/environment');var attributes=require(_0xe239('0x7'));module[_0xe239('0x8')]=function(_0x5e89dc,_0x41bb4d){return _0x5e89dc[_0xe239('0x9')](_0xe239('0xa'),attributes,{'tableName':_0xe239('0xb'),'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 17a3282..3064fd8 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 _0xd696=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VerifyAdditionalPhones','CmHopper','body','VoiceQueueId','CampaignId','findOne','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','catch','SwapAdditionalPhones','ListId','duration','waitTime','isNil','scheduledat','add','minutes','createdAt','updatedAt','phone','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util'];(function(_0x47f2c5,_0x40c84b){var _0x38b405=function(_0x22c2aa){while(--_0x22c2aa){_0x47f2c5['push'](_0x47f2c5['shift']());}};_0x38b405(++_0x40c84b);}(_0xd696,0xea));var _0x6d69=function(_0x16d3f8,_0x3f5dd3){_0x16d3f8=_0x16d3f8-0x0;var _0x49a172=_0xd696[_0x16d3f8];return _0x49a172;};'use strict';var _=require(_0x6d69('0x0'));var util=require(_0x6d69('0x1'));var moment=require(_0x6d69('0x2'));var BPromise=require(_0x6d69('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d69('0x4'));var db=require(_0x6d69('0x5'))['db'];var utils=require(_0x6d69('0x6'));var logger=require(_0x6d69('0x7'))(_0x6d69('0x8'));var config=require(_0x6d69('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6d69('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x549b24,_0x2a7faf,_0x2e2521){return new BPromise(function(_0x4422c7,_0x48def1){return client[_0x6d69('0xb')](_0x549b24,_0x2e2521)[_0x6d69('0xc')](function(_0x12dd2a){logger[_0x6d69('0xd')](_0x6d69('0xe'),_0x2a7faf,_0x6d69('0xf'));logger[_0x6d69('0x10')](_0x6d69('0x11'),_0x2a7faf,'request\x20sent',JSON[_0x6d69('0x12')](_0x12dd2a));if(_0x12dd2a[_0x6d69('0x13')]){if(_0x12dd2a['error'][_0x6d69('0x14')]===0x1f4){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2a7faf,_0x12dd2a[_0x6d69('0x13')]['message']);return _0x48def1(_0x12dd2a[_0x6d69('0x13')]['message']);}logger[_0x6d69('0x13')](_0x6d69('0xe'),_0x2a7faf,_0x12dd2a[_0x6d69('0x13')][_0x6d69('0x15')]);return _0x4422c7(_0x12dd2a[_0x6d69('0x13')]['message']);}else{logger[_0x6d69('0xd')](_0x6d69('0xe'),_0x2a7faf,_0x6d69('0xf'));_0x4422c7(_0x12dd2a['result']['message']);}})['catch'](function(_0x3454e1){logger['error'](_0x6d69('0xe'),_0x2a7faf,_0x3454e1);_0x48def1(_0x3454e1);});});}exports[_0x6d69('0x16')]=function(_0x138f8f){var _0x5c341a=this;return new Promise(function(_0x38985c,_0x179190){return db[_0x6d69('0x17')]['findOne']({'raw':!![],'where':{'ContactId':_0x138f8f[_0x6d69('0x18')]['ContactId'],'ListId':_0x138f8f[_0x6d69('0x18')]['ListId'],'VoiceQueueId':_0x138f8f[_0x6d69('0x18')][_0x6d69('0x19')]===undefined?null:_0x138f8f['body'][_0x6d69('0x19')],'CampaignId':_0x138f8f['body'][_0x6d69('0x1a')]===undefined?null:_0x138f8f[_0x6d69('0x18')]['CampaignId']}})[_0x6d69('0xc')](function(_0x530cf8){if(_0x530cf8!=null){return db['CmHopperAdditionalPhone'][_0x6d69('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x530cf8['id'],'OrderBy':{'$gt':_0x530cf8[_0x6d69('0x1c')]}},'order':[[_0x6d69('0x1c'),_0x6d69('0x1d')]]})[_0x6d69('0xc')](function(_0x259e45){var _0x340fa9=0x0;if(_0x259e45){if(_0x259e45[_0x6d69('0x1e')]+_0x259e45[_0x6d69('0x1f')]+_0x259e45[_0x6d69('0x20')]+_0x259e45[_0x6d69('0x21')]+_0x259e45[_0x6d69('0x22')]+_0x259e45[_0x6d69('0x23')]+_0x259e45[_0x6d69('0x24')]+_0x259e45[_0x6d69('0x25')]<_0x138f8f[_0x6d69('0x26')][_0x6d69('0x27')])_0x340fa9=0x1;_0x38985c({'additional':_0x340fa9});}else{return db[_0x6d69('0x28')][_0x6d69('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x530cf8['id']},'order':[[_0x6d69('0x1c'),_0x6d69('0x1d')]]})['then'](function(_0x468024){var _0x362df8=0x0;if(_0x468024){if(_0x468024[_0x6d69('0x1e')]+_0x468024[_0x6d69('0x1f')]+_0x468024[_0x6d69('0x20')]+_0x468024[_0x6d69('0x21')]+_0x468024[_0x6d69('0x22')]+_0x468024[_0x6d69('0x23')]+_0x468024[_0x6d69('0x24')]+_0x468024['countagentrejectretry']<_0x138f8f['entity'][_0x6d69('0x27')])_0x362df8=0x1;_0x38985c({'additional':_0x362df8});}else{_0x38985c({'additional':0x0});}})[_0x6d69('0x29')](function(_0x256465){logger[_0x6d69('0x13')](_0x6d69('0x16'),_0x256465[_0x6d69('0x15')]);_0x179190(_0x5c341a[_0x6d69('0x13')](0x1f4,_0x256465[_0x6d69('0x15')]));});}})[_0x6d69('0x29')](function(_0x4b7e48){logger[_0x6d69('0x13')](_0x6d69('0x16'),_0x4b7e48[_0x6d69('0x15')]);_0x179190(_0x5c341a['error'](0x1f4,_0x4b7e48[_0x6d69('0x15')]));});}else _0x38985c({'additional':0x0});});});};exports[_0x6d69('0x2a')]=function(_0x4b9830){var _0x3940d8=this;return new Promise(function(_0x4d833c,_0x2cd2ee){return db['CmHopper'][_0x6d69('0x1b')]({'raw':!![],'where':{'ContactId':_0x4b9830[_0x6d69('0x18')]['ContactId'],'ListId':_0x4b9830['body'][_0x6d69('0x2b')],'VoiceQueueId':_0x4b9830[_0x6d69('0x18')]['VoiceQueueId']===undefined?null:_0x4b9830['body'][_0x6d69('0x19')],'CampaignId':_0x4b9830[_0x6d69('0x18')][_0x6d69('0x1a')]===undefined?null:_0x4b9830['body'][_0x6d69('0x1a')]}})[_0x6d69('0xc')](function(_0x37c57b){if(_0x37c57b!=null){return db['CmHopperAdditionalPhone'][_0x6d69('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x37c57b['id'],'OrderBy':{'$gte':_0x37c57b[_0x6d69('0x1c')]}},'order':[[_0x6d69('0x1c'),_0x6d69('0x1d')]]})[_0x6d69('0xc')](function(_0x2f6a87){if(_0x2f6a87)return activateAdditionalPhone(_0x37c57b,_0x4b9830[_0x6d69('0x18')],_0x2f6a87,_0x4b9830[_0x6d69('0x2c')],_0x4b9830['waitTime'])[_0x6d69('0xc')](function(_0x3b8061){_0x4d833c(_0x3b8061);});else{return db[_0x6d69('0x28')][_0x6d69('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x37c57b['id']},'order':[[_0x6d69('0x1c'),_0x6d69('0x1d')]]})[_0x6d69('0xc')](function(_0x1f65a1){if(_0x1f65a1)return activateAdditionalPhone(_0x37c57b,_0x4b9830[_0x6d69('0x18')],_0x1f65a1,_0x4b9830[_0x6d69('0x2c')],_0x4b9830[_0x6d69('0x2d')])[_0x6d69('0xc')](function(_0x18b2f2){_0x4d833c(_0x18b2f2);});else{_0x4d833c({'id':_0x37c57b['id'],'phone':''});}})['catch'](function(_0x37856e){logger['error']('VerifyAdditionalPhones',_0x37856e['message']);_0x2cd2ee(_0x3940d8[_0x6d69('0x13')](0x1f4,_0x37856e['message']));});}})[_0x6d69('0x29')](function(_0x32df15){logger[_0x6d69('0x13')]('VerifyAdditionalPhones',_0x32df15['message']);_0x2cd2ee(_0x3940d8[_0x6d69('0x13')](0x1f4,_0x32df15[_0x6d69('0x15')]));});}else _0x4d833c(0x1);});});};function activateAdditionalPhone(_0x41859f,_0x1e156d,_0x36a6e9,_0x2b0993,_0x1f17e7){return new Promise(function(_0xb38575,_0x3224c7){var _0x4ccbb3;if(_[_0x6d69('0x2e')](_0x36a6e9[_0x6d69('0x2f')])){_0x36a6e9[_0x6d69('0x2f')]=moment();}if(moment()>moment(_0x36a6e9[_0x6d69('0x2f')])){_0x4ccbb3=moment()[_0x6d69('0x30')](_0x1f17e7||0x3,'minutes');}else{if(_0x36a6e9[_0x6d69('0x1c')]==0x0){_0x4ccbb3=moment(_0x36a6e9[_0x6d69('0x2f')]);}else{_0x4ccbb3=moment()[_0x6d69('0x30')](_0x1f17e7||0x3,_0x6d69('0x31'));}}if(_[_0x6d69('0x2e')](_0x4ccbb3)){_0x4ccbb3=moment()[_0x6d69('0x30')](_0x1f17e7||0x3,'minutes');}var _0x4ffb93={'phone':_0x41859f['phone'],'active':0x0,'OrderBy':_['isNil'](_0x41859f[_0x6d69('0x1c')])?0x0:_0x41859f[_0x6d69('0x1c')],'scheduledat':moment()[_0x6d69('0x30')](_0x2b0993||0x1,_0x6d69('0x31')),'countbusyretry':_0x1e156d[_0x6d69('0x1e')],'countcongestionretry':_0x1e156d['countcongestionretry'],'countnoanswerretry':_0x1e156d['countnoanswerretry'],'countnosuchnumberretry':_0x1e156d['countnosuchnumberretry'],'countdropretry':_0x1e156d[_0x6d69('0x22')],'countabandonedretry':_0x1e156d[_0x6d69('0x23')],'countmachineretry':_0x1e156d[_0x6d69('0x24')],'countagentrejectretry':_0x1e156d[_0x6d69('0x25')],'createdAt':_0x1e156d[_0x6d69('0x32')],'updatedAt':_0x1e156d[_0x6d69('0x33')]};var _0xf1dab4={'CmHopperId':_0x41859f['id'],'phone':_0x36a6e9[_0x6d69('0x34')],'active':0x0,'OrderBy':_[_0x6d69('0x2e')](_0x36a6e9['OrderBy'])?0x0:_0x36a6e9[_0x6d69('0x1c')],'scheduledat':_0x4ccbb3,'countbusyretry':_0x36a6e9['countbusyretry'],'countcongestionretry':_0x36a6e9[_0x6d69('0x1f')],'countnoanswerretry':_0x36a6e9[_0x6d69('0x20')],'countnosuchnumberretry':_0x36a6e9['countnosuchnumberretry'],'countdropretry':_0x36a6e9[_0x6d69('0x22')],'countabandonedretry':_0x36a6e9[_0x6d69('0x23')],'countmachineretry':_0x36a6e9[_0x6d69('0x24')],'countagentrejectretry':_0x36a6e9[_0x6d69('0x25')],'createdAt':_0x36a6e9[_0x6d69('0x32')],'updatedAt':_0x36a6e9[_0x6d69('0x33')]};return db[_0x6d69('0x35')][_0x6d69('0x36')](function(_0x562e1c){return db[_0x6d69('0x28')][_0x6d69('0x37')](_0x4ffb93,{'where':{'id':_0x36a6e9['id']}},{'transaction':_0x562e1c})[_0x6d69('0xc')](function(){return db['CmHopper'][_0x6d69('0x37')](_0xf1dab4,{'where':{'id':_0x41859f['id']}},{'transaction':_0x562e1c});});})['then'](function(_0x3bcfc0){_0xb38575({'id':_0x41859f['id'],'phone':_0x36a6e9[_0x6d69('0x34')]});})[_0x6d69('0x29')](function(_0x2422fd){logger[_0x6d69('0x13')](_0x6d69('0x38'),_0x2422fd[_0x6d69('0x15')]);_0x3224c7({'error':_0x2422fd[_0x6d69('0x15')]});});});}exports[_0x6d69('0x39')]=function(_0x53ccf2){var _0x3f823e=this;return new Promise(function(_0x875237,_0x36d367){return db[_0x6d69('0x17')]['update'](_0x53ccf2[_0x6d69('0x18')][_0x6d69('0x3a')],{'where':{'id':_0x53ccf2['body']['id']}})[_0x6d69('0xc')](function(_0x18c3a9){_0x875237(_0x18c3a9);})[_0x6d69('0x29')](function(_0x4f114f){logger[_0x6d69('0x13')](_0x6d69('0x39'),_0x4f114f['message']);_0x36d367(_0x3f823e[_0x6d69('0x13')](0x1f4,_0x4f114f[_0x6d69('0x15')]));});});}; \ No newline at end of file +var _0x710c=['info','result','VerifyAdditionalPhones','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','entity','dialGlobalMaxRetry','countnoanswerretry','catch','waitTime','duration','scheduledat','minutes','add','isNil','phone','countdropretry','updatedAt','countmachineretry','createdAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','../../mysqldb','rpc','jayson/promise','client','http','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x44edb0,_0x7a1d21){var _0x38dbd0=function(_0xcc1e93){while(--_0xcc1e93){_0x44edb0['push'](_0x44edb0['shift']());}};_0x38dbd0(++_0x7a1d21);}(_0x710c,0x1a9));var _0xc710=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x710c[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0xc710('0x0'));var util=require(_0xc710('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc710('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc710('0x3'));var config=require('../../config/environment');var jayson=require(_0xc710('0x4'));var client=jayson[_0xc710('0x5')][_0xc710('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x523c54,_0x320d3e,_0x249084){return new BPromise(function(_0x133a37,_0x592266){return client['request'](_0x523c54,_0x249084)['then'](function(_0x3539aa){logger['info'](_0xc710('0x7'),_0x320d3e,_0xc710('0x8'));logger[_0xc710('0x9')](_0xc710('0xa'),_0x320d3e,'request\x20sent',JSON[_0xc710('0xb')](_0x3539aa));if(_0x3539aa[_0xc710('0xc')]){if(_0x3539aa[_0xc710('0xc')][_0xc710('0xd')]===0x1f4){logger[_0xc710('0xc')](_0xc710('0x7'),_0x320d3e,_0x3539aa['error'][_0xc710('0xe')]);return _0x592266(_0x3539aa[_0xc710('0xc')]['message']);}logger[_0xc710('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x320d3e,_0x3539aa[_0xc710('0xc')][_0xc710('0xe')]);return _0x133a37(_0x3539aa[_0xc710('0xc')][_0xc710('0xe')]);}else{logger[_0xc710('0xf')](_0xc710('0x7'),_0x320d3e,_0xc710('0x8'));_0x133a37(_0x3539aa[_0xc710('0x10')]['message']);}})['catch'](function(_0x4f8fbf){logger['error'](_0xc710('0x7'),_0x320d3e,_0x4f8fbf);_0x592266(_0x4f8fbf);});});}exports[_0xc710('0x11')]=function(_0x7ed675){var _0x361be1=this;return new Promise(function(_0x3f9afa,_0x2e8a79){return db[_0xc710('0x12')]['findOne']({'raw':!![],'where':{'ContactId':_0x7ed675[_0xc710('0x13')][_0xc710('0x14')],'ListId':_0x7ed675[_0xc710('0x13')][_0xc710('0x15')],'VoiceQueueId':_0x7ed675[_0xc710('0x13')]['VoiceQueueId']===undefined?null:_0x7ed675['body'][_0xc710('0x16')],'CampaignId':_0x7ed675[_0xc710('0x13')][_0xc710('0x17')]===undefined?null:_0x7ed675[_0xc710('0x13')][_0xc710('0x17')]}})[_0xc710('0x18')](function(_0x38725a){if(_0x38725a!=null){return db[_0xc710('0x19')][_0xc710('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x38725a['id'],'OrderBy':{'$gt':_0x38725a['OrderBy']}},'order':[[_0xc710('0x1b'),_0xc710('0x1c')]]})[_0xc710('0x18')](function(_0x754864){var _0x5ee601=0x0;if(_0x754864){if(_0x754864[_0xc710('0x1d')]+_0x754864[_0xc710('0x1e')]+_0x754864['countnoanswerretry']+_0x754864[_0xc710('0x1f')]+_0x754864['countdropretry']+_0x754864[_0xc710('0x20')]+_0x754864['countmachineretry']+_0x754864[_0xc710('0x21')]<_0x7ed675[_0xc710('0x22')][_0xc710('0x23')])_0x5ee601=0x1;_0x3f9afa({'additional':_0x5ee601});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x38725a['id']},'order':[[_0xc710('0x1b'),_0xc710('0x1c')]]})[_0xc710('0x18')](function(_0x5760d1){var _0xcc80e1=0x0;if(_0x5760d1){if(_0x5760d1['countbusyretry']+_0x5760d1['countcongestionretry']+_0x5760d1[_0xc710('0x24')]+_0x5760d1['countnosuchnumberretry']+_0x5760d1['countdropretry']+_0x5760d1[_0xc710('0x20')]+_0x5760d1['countmachineretry']+_0x5760d1['countagentrejectretry']<_0x7ed675[_0xc710('0x22')]['dialGlobalMaxRetry'])_0xcc80e1=0x1;_0x3f9afa({'additional':_0xcc80e1});}else{_0x3f9afa({'additional':0x0});}})['catch'](function(_0x4fdaa2){logger['error'](_0xc710('0x11'),_0x4fdaa2['message']);_0x2e8a79(_0x361be1['error'](0x1f4,_0x4fdaa2['message']));});}})[_0xc710('0x25')](function(_0x5d801b){logger['error']('VerifyAdditionalPhones',_0x5d801b[_0xc710('0xe')]);_0x2e8a79(_0x361be1[_0xc710('0xc')](0x1f4,_0x5d801b[_0xc710('0xe')]));});}else _0x3f9afa({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x179dc1){var _0x465e8a=this;return new Promise(function(_0x15bf99,_0x51c327){return db[_0xc710('0x12')]['findOne']({'raw':!![],'where':{'ContactId':_0x179dc1['body'][_0xc710('0x14')],'ListId':_0x179dc1[_0xc710('0x13')][_0xc710('0x15')],'VoiceQueueId':_0x179dc1['body']['VoiceQueueId']===undefined?null:_0x179dc1[_0xc710('0x13')][_0xc710('0x16')],'CampaignId':_0x179dc1[_0xc710('0x13')]['CampaignId']===undefined?null:_0x179dc1['body'][_0xc710('0x17')]}})[_0xc710('0x18')](function(_0x2860d2){if(_0x2860d2!=null){return db[_0xc710('0x19')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x2860d2['id'],'OrderBy':{'$gte':_0x2860d2[_0xc710('0x1b')]}},'order':[[_0xc710('0x1b'),_0xc710('0x1c')]]})[_0xc710('0x18')](function(_0xd69d13){if(_0xd69d13)return activateAdditionalPhone(_0x2860d2,_0x179dc1[_0xc710('0x13')],_0xd69d13,_0x179dc1['duration'],_0x179dc1[_0xc710('0x26')])[_0xc710('0x18')](function(_0x2ca12a){_0x15bf99(_0x2ca12a);});else{return db['CmHopperAdditionalPhone'][_0xc710('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x2860d2['id']},'order':[[_0xc710('0x1b'),_0xc710('0x1c')]]})[_0xc710('0x18')](function(_0x2fbb8d){if(_0x2fbb8d)return activateAdditionalPhone(_0x2860d2,_0x179dc1[_0xc710('0x13')],_0x2fbb8d,_0x179dc1[_0xc710('0x27')],_0x179dc1['waitTime'])[_0xc710('0x18')](function(_0x49f7e2){_0x15bf99(_0x49f7e2);});else{_0x15bf99({'id':_0x2860d2['id'],'phone':''});}})[_0xc710('0x25')](function(_0x221e38){logger[_0xc710('0xc')](_0xc710('0x11'),_0x221e38[_0xc710('0xe')]);_0x51c327(_0x465e8a[_0xc710('0xc')](0x1f4,_0x221e38['message']));});}})[_0xc710('0x25')](function(_0x368806){logger[_0xc710('0xc')](_0xc710('0x11'),_0x368806[_0xc710('0xe')]);_0x51c327(_0x465e8a[_0xc710('0xc')](0x1f4,_0x368806[_0xc710('0xe')]));});}else _0x15bf99(0x1);});});};function activateAdditionalPhone(_0x5b6327,_0x46730f,_0x19b0af,_0x4912ac,_0x14692c){return new Promise(function(_0x56136b,_0x55a8ce){var _0x1c3da3;if(_['isNil'](_0x19b0af[_0xc710('0x28')])){_0x19b0af[_0xc710('0x28')]=moment();}if(moment()>moment(_0x19b0af[_0xc710('0x28')])){_0x1c3da3=moment()['add'](_0x14692c||0x3,_0xc710('0x29'));}else{if(_0x19b0af[_0xc710('0x1b')]==0x0){_0x1c3da3=moment(_0x19b0af['scheduledat']);}else{_0x1c3da3=moment()[_0xc710('0x2a')](_0x14692c||0x3,_0xc710('0x29'));}}if(_[_0xc710('0x2b')](_0x1c3da3)){_0x1c3da3=moment()['add'](_0x14692c||0x3,_0xc710('0x29'));}var _0x1957b2={'phone':_0x5b6327[_0xc710('0x2c')],'active':0x0,'OrderBy':_['isNil'](_0x5b6327[_0xc710('0x1b')])?0x0:_0x5b6327[_0xc710('0x1b')],'scheduledat':moment()[_0xc710('0x2a')](_0x4912ac||0x1,_0xc710('0x29')),'countbusyretry':_0x46730f[_0xc710('0x1d')],'countcongestionretry':_0x46730f[_0xc710('0x1e')],'countnoanswerretry':_0x46730f[_0xc710('0x24')],'countnosuchnumberretry':_0x46730f[_0xc710('0x1f')],'countdropretry':_0x46730f[_0xc710('0x2d')],'countabandonedretry':_0x46730f[_0xc710('0x20')],'countmachineretry':_0x46730f['countmachineretry'],'countagentrejectretry':_0x46730f['countagentrejectretry'],'createdAt':_0x46730f['createdAt'],'updatedAt':_0x46730f[_0xc710('0x2e')]};var _0x2655a6={'CmHopperId':_0x5b6327['id'],'phone':_0x19b0af[_0xc710('0x2c')],'active':0x0,'OrderBy':_[_0xc710('0x2b')](_0x19b0af[_0xc710('0x1b')])?0x0:_0x19b0af[_0xc710('0x1b')],'scheduledat':_0x1c3da3,'countbusyretry':_0x19b0af[_0xc710('0x1d')],'countcongestionretry':_0x19b0af[_0xc710('0x1e')],'countnoanswerretry':_0x19b0af[_0xc710('0x24')],'countnosuchnumberretry':_0x19b0af[_0xc710('0x1f')],'countdropretry':_0x19b0af['countdropretry'],'countabandonedretry':_0x19b0af[_0xc710('0x20')],'countmachineretry':_0x19b0af[_0xc710('0x2f')],'countagentrejectretry':_0x19b0af[_0xc710('0x21')],'createdAt':_0x19b0af[_0xc710('0x30')],'updatedAt':_0x19b0af[_0xc710('0x2e')]};return db[_0xc710('0x31')][_0xc710('0x32')](function(_0x32a681){return db[_0xc710('0x19')][_0xc710('0x33')](_0x1957b2,{'where':{'id':_0x19b0af['id']}},{'transaction':_0x32a681})[_0xc710('0x18')](function(){return db[_0xc710('0x12')]['update'](_0x2655a6,{'where':{'id':_0x5b6327['id']}},{'transaction':_0x32a681});});})[_0xc710('0x18')](function(_0x1a690a){_0x56136b({'id':_0x5b6327['id'],'phone':_0x19b0af['phone']});})[_0xc710('0x25')](function(_0x2da8d2){logger[_0xc710('0xc')](_0xc710('0x34'),_0x2da8d2['message']);_0x55a8ce({'error':_0x2da8d2[_0xc710('0xe')]});});});}exports[_0xc710('0x35')]=function(_0x286973){var _0x76a776=this;return new Promise(function(_0xadd1c1,_0x1565fd){return db[_0xc710('0x12')][_0xc710('0x33')](_0x286973[_0xc710('0x13')][_0xc710('0x36')],{'where':{'id':_0x286973[_0xc710('0x13')]['id']}})[_0xc710('0x18')](function(_0x596588){_0xadd1c1(_0x596588);})[_0xc710('0x25')](function(_0x68a063){logger[_0xc710('0xc')]('IncrementPreviewCounters',_0x68a063[_0xc710('0xe')]);_0x1565fd(_0x76a776[_0xc710('0xc')](0x1f4,_0x68a063[_0xc710('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 7cd0ed7..02b290b 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 _0xd015=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1ed86e,_0x37472a){var _0x7b4b7a=function(_0x219786){while(--_0x219786){_0x1ed86e['push'](_0x1ed86e['shift']());}};_0x7b4b7a(++_0x37472a);}(_0xd015,0x18c));var _0x5d01=function(_0x24cc6f,_0x197c5e){_0x24cc6f=_0x24cc6f-0x0;var _0xcd0f56=_0xd015[_0x24cc6f];return _0xcd0f56;};'use strict';var multer=require(_0x5d01('0x0'));var util=require(_0x5d01('0x1'));var path=require(_0x5d01('0x2'));var timeout=require(_0x5d01('0x3'));var express=require(_0x5d01('0x4'));var router=express[_0x5d01('0x5')]();var fs_extra=require(_0x5d01('0x6'));var auth=require(_0x5d01('0x7'));var interaction=require(_0x5d01('0x8'));var config=require(_0x5d01('0x9'));var controller=require(_0x5d01('0xa'));router[_0x5d01('0xb')]('/',auth[_0x5d01('0xc')](),controller['index']);router[_0x5d01('0xb')](_0x5d01('0xd'),auth[_0x5d01('0xc')](),controller['show']);router[_0x5d01('0xe')]('/',auth['isAuthenticated'](),controller[_0x5d01('0xf')]);router[_0x5d01('0x10')](_0x5d01('0xd'),auth[_0x5d01('0xc')](),controller[_0x5d01('0x11')]);router[_0x5d01('0x12')](_0x5d01('0xd'),auth[_0x5d01('0xc')](),controller[_0x5d01('0x13')]);module[_0x5d01('0x14')]=router; \ No newline at end of file +var _0x012b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','index','/:id','isAuthenticated','show','update','destroy','exports','path','express','Router','fs-extra'];(function(_0x5c1fd6,_0x1a8388){var _0x281461=function(_0x7d9e5d){while(--_0x7d9e5d){_0x5c1fd6['push'](_0x5c1fd6['shift']());}};_0x281461(++_0x1a8388);}(_0x012b,0x11c));var _0xb012=function(_0x137466,_0x325555){_0x137466=_0x137466-0x0;var _0x299225=_0x012b[_0x137466];return _0x299225;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb012('0x0'));var timeout=require('connect-timeout');var express=require(_0xb012('0x1'));var router=express[_0xb012('0x2')]();var fs_extra=require(_0xb012('0x3'));var auth=require(_0xb012('0x4'));var interaction=require(_0xb012('0x5'));var config=require(_0xb012('0x6'));var controller=require(_0xb012('0x7'));router[_0xb012('0x8')]('/',auth['isAuthenticated'](),controller[_0xb012('0x9')]);router['get'](_0xb012('0xa'),auth[_0xb012('0xb')](),controller[_0xb012('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xb012('0xa'),auth[_0xb012('0xb')](),controller[_0xb012('0xd')]);router['delete'](_0xb012('0xa'),auth[_0xb012('0xb')](),controller[_0xb012('0xe')]);module[_0xb012('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 51de23c..d399faf 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 _0x2cd0=['INTEGER','contactListQueue','moment','sequelize'];(function(_0x366628,_0xdd8460){var _0x512d64=function(_0x4103e4){while(--_0x4103e4){_0x366628['push'](_0x366628['shift']());}};_0x512d64(++_0xdd8460);}(_0x2cd0,0x8a));var _0x02cd=function(_0x45cf76,_0x5789fa){_0x45cf76=_0x45cf76-0x0;var _0x57d6ce=_0x2cd0[_0x45cf76];return _0x57d6ce;};'use strict';var moment=require(_0x02cd('0x0'));var Sequelize=require(_0x02cd('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x02cd('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x02cd('0x3')},'VoiceQueueId':{'type':Sequelize[_0x02cd('0x2')],'unique':_0x02cd('0x3')}}; \ No newline at end of file +var _0xa676=['sequelize','exports','STRING','contactListQueue','INTEGER','moment'];(function(_0x23746a,_0x3f83d0){var _0x4abfed=function(_0x3e9505){while(--_0x3e9505){_0x23746a['push'](_0x23746a['shift']());}};_0x4abfed(++_0x3f83d0);}(_0xa676,0x15b));var _0x6a67=function(_0x4710e6,_0x112dab){_0x4710e6=_0x4710e6-0x0;var _0x32b775=_0xa676[_0x4710e6];return _0x32b775;};'use strict';var moment=require(_0x6a67('0x0'));var Sequelize=require(_0x6a67('0x1'));module[_0x6a67('0x2')]={'phone':{'type':Sequelize[_0x6a67('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x6a67('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x6a67('0x4')},'VoiceQueueId':{'type':Sequelize[_0x6a67('0x5')],'unique':_0x6a67('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index d2075ea..8432565 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 _0x8d5b=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','include','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x5a18fc,_0xb1a4aa){var _0x57b441=function(_0x14e663){while(--_0x14e663){_0x5a18fc['push'](_0x5a18fc['shift']());}};_0x57b441(++_0xb1a4aa);}(_0x8d5b,0x1a2));var _0xb8d5=function(_0x4dcecc,_0x3865b9){_0x4dcecc=_0x4dcecc-0x0;var _0x2aa658=_0x8d5b[_0x4dcecc];return _0x2aa658;};'use strict';var emlformat=require(_0xb8d5('0x0'));var rimraf=require(_0xb8d5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb8d5('0x2'));var rp=require(_0xb8d5('0x3'));var moment=require(_0xb8d5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb8d5('0x5'));var util=require(_0xb8d5('0x6'));var path=require(_0xb8d5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb8d5('0x8'));var fs=require('fs');var fs_extra=require(_0xb8d5('0x9'));var _=require(_0xb8d5('0xa'));var squel=require('squel');var crypto=require(_0xb8d5('0xb'));var jsforce=require(_0xb8d5('0xc'));var deskjs=require(_0xb8d5('0xd'));var toCsv=require(_0xb8d5('0xe'));var querystring=require(_0xb8d5('0xf'));var Papa=require('papaparse');var Redis=require(_0xb8d5('0x10'));var authService=require(_0xb8d5('0x11'));var qs=require(_0xb8d5('0x12'));var as=require(_0xb8d5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8d5('0x14'))(_0xb8d5('0x15'));var utils=require(_0xb8d5('0x16'));var config=require(_0xb8d5('0x17'));var licenseUtil=require(_0xb8d5('0x18'));var db=require(_0xb8d5('0x19'))['db'];function respondWithStatusCode(_0x38941e,_0x4cc0d6){_0x4cc0d6=_0x4cc0d6||0xcc;return function(_0xa5182c){if(_0xa5182c){return _0x38941e[_0xb8d5('0x1a')](_0x4cc0d6);}return _0x38941e[_0xb8d5('0x1b')](_0x4cc0d6)[_0xb8d5('0x1c')]();};}function respondWithResult(_0x372c5d,_0x4fe427){_0x4fe427=_0x4fe427||0xc8;return function(_0x53b348){if(_0x53b348){return _0x372c5d[_0xb8d5('0x1b')](_0x4fe427)['json'](_0x53b348);}};}function respondWithFilteredResult(_0x407590,_0x507b45){return function(_0x840a8c){if(_0x840a8c){var _0x3e772e=typeof _0x507b45[_0xb8d5('0x1d')]===_0xb8d5('0x1e')&&typeof _0x507b45[_0xb8d5('0x1f')]===_0xb8d5('0x1e');var _0x5a23ac=_0x840a8c[_0xb8d5('0x20')];var _0x759e93=_0x3e772e?0x0:_0x507b45[_0xb8d5('0x1d')];var _0x1d28e8=_0x3e772e?_0x840a8c['count']:_0x507b45[_0xb8d5('0x1d')]+_0x507b45[_0xb8d5('0x1f')];var _0x42ec1a;if(_0x1d28e8>=_0x5a23ac){_0x1d28e8=_0x5a23ac;_0x42ec1a=0xc8;}else{_0x42ec1a=0xce;}_0x407590[_0xb8d5('0x1b')](_0x42ec1a);return _0x407590[_0xb8d5('0x21')](_0xb8d5('0x22'),_0x759e93+'-'+_0x1d28e8+'/'+_0x5a23ac)['json'](_0x840a8c);}return null;};}function patchUpdates(_0x3df9ad){return function(_0xa38daf){try{jsonpatch[_0xb8d5('0x23')](_0xa38daf,_0x3df9ad,!![]);}catch(_0x57c438){return BPromise[_0xb8d5('0x24')](_0x57c438);}return _0xa38daf[_0xb8d5('0x25')]();};}function saveUpdates(_0xd978ee,_0x2bbdb5){return function(_0x3c956d){if(_0x3c956d){return _0x3c956d[_0xb8d5('0x26')](_0xd978ee)['then'](function(_0x5dacc1){return _0x5dacc1;});}return null;};}function removeEntity(_0x31f20b,_0xd065e){return function(_0x5d01e0){if(_0x5d01e0){return _0x5d01e0[_0xb8d5('0x27')]()[_0xb8d5('0x28')](function(){_0x31f20b[_0xb8d5('0x1b')](0xcc)[_0xb8d5('0x1c')]();});}};}function handleEntityNotFound(_0x523416,_0x1f4e5f){return function(_0x4a9df2){if(!_0x4a9df2){_0x523416['sendStatus'](0x194);}return _0x4a9df2;};}function handleError(_0x3818cb,_0x13eabb){_0x13eabb=_0x13eabb||0x1f4;return function(_0x56b327){logger[_0xb8d5('0x29')](_0x56b327[_0xb8d5('0x2a')]);if(_0x56b327[_0xb8d5('0x2b')]){delete _0x56b327[_0xb8d5('0x2b')];}_0x3818cb['status'](_0x13eabb)['send'](_0x56b327);};}exports['index']=function(_0x23d65d,_0x1f29f9){var _0x6409ef={},_0x42302f={},_0x550848={'count':0x0,'rows':[]};var _0x71ba88=_[_0xb8d5('0x2c')](db[_0xb8d5('0x2d')][_0xb8d5('0x2e')],function(_0x50446d){return{'name':_0x50446d[_0xb8d5('0x2f')],'type':_0x50446d[_0xb8d5('0x30')][_0xb8d5('0x31')]};});_0x42302f[_0xb8d5('0x32')]=_[_0xb8d5('0x2c')](_0x71ba88,'name');_0x42302f[_0xb8d5('0x33')]=_[_0xb8d5('0x34')](_0x23d65d['query']);_0x42302f[_0xb8d5('0x35')]=_['intersection'](_0x42302f[_0xb8d5('0x32')],_0x42302f[_0xb8d5('0x33')]);_0x6409ef[_0xb8d5('0x36')]=_[_0xb8d5('0x37')](_0x42302f[_0xb8d5('0x32')],qs[_0xb8d5('0x38')](_0x23d65d[_0xb8d5('0x33')][_0xb8d5('0x38')]));_0x6409ef[_0xb8d5('0x36')]=_0x6409ef[_0xb8d5('0x36')][_0xb8d5('0x39')]?_0x6409ef[_0xb8d5('0x36')]:_0x42302f['model'];if(!_0x23d65d['query']['hasOwnProperty'](_0xb8d5('0x3a'))){_0x6409ef['limit']=qs[_0xb8d5('0x1f')](_0x23d65d[_0xb8d5('0x33')][_0xb8d5('0x1f')]);_0x6409ef[_0xb8d5('0x1d')]=qs[_0xb8d5('0x1d')](_0x23d65d[_0xb8d5('0x33')][_0xb8d5('0x1d')]);}_0x6409ef['order']=qs[_0xb8d5('0x3b')](_0x23d65d[_0xb8d5('0x33')][_0xb8d5('0x3b')]);_0x6409ef[_0xb8d5('0x3c')]=qs['filters'](_[_0xb8d5('0x3d')](_0x23d65d[_0xb8d5('0x33')],_0x42302f[_0xb8d5('0x35')]),_0x71ba88);if(_0x23d65d[_0xb8d5('0x33')][_0xb8d5('0x3e')]){_0x6409ef[_0xb8d5('0x3c')]=_[_0xb8d5('0x3f')](_0x6409ef[_0xb8d5('0x3c')],{'$or':_[_0xb8d5('0x2c')](_0x71ba88,function(_0x24dfc5){if(_0x24dfc5[_0xb8d5('0x30')]!==_0xb8d5('0x40')){var _0x14b894={};_0x14b894[_0x24dfc5[_0xb8d5('0x2b')]]={'$like':'%'+_0x23d65d['query']['filter']+'%'};return _0x14b894;}})});}_0x6409ef=_[_0xb8d5('0x3f')]({},_0x6409ef,_0x23d65d[_0xb8d5('0x41')]);var _0x3ec7fa={'where':_0x6409ef['where']};return db['CmHopperBlack'][_0xb8d5('0x20')](_0x3ec7fa)[_0xb8d5('0x28')](function(_0x50a37d){_0x550848['count']=_0x50a37d;if(_0x23d65d[_0xb8d5('0x33')][_0xb8d5('0x42')]){_0x6409ef['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xb8d5('0x43')](_0x6409ef);})[_0xb8d5('0x28')](function(_0xa6d587){_0x550848['rows']=_0xa6d587;return _0x550848;})[_0xb8d5('0x28')](respondWithFilteredResult(_0x1f29f9,_0x6409ef))[_0xb8d5('0x44')](handleError(_0x1f29f9,null));};exports['show']=function(_0x347b2f,_0x3a61ce){var _0x4d80de={'raw':!![],'where':{'id':_0x347b2f[_0xb8d5('0x45')]['id']}},_0x46d815={};_0x46d815[_0xb8d5('0x32')]=_[_0xb8d5('0x34')](db['CmHopperBlack'][_0xb8d5('0x2e')]);_0x46d815[_0xb8d5('0x33')]=_[_0xb8d5('0x34')](_0x347b2f[_0xb8d5('0x33')]);_0x46d815[_0xb8d5('0x35')]=_[_0xb8d5('0x37')](_0x46d815[_0xb8d5('0x32')],_0x46d815['query']);_0x4d80de[_0xb8d5('0x36')]=_['intersection'](_0x46d815[_0xb8d5('0x32')],qs['fields'](_0x347b2f[_0xb8d5('0x33')][_0xb8d5('0x38')]));_0x4d80de['attributes']=_0x4d80de['attributes']['length']?_0x4d80de[_0xb8d5('0x36')]:_0x46d815[_0xb8d5('0x32')];if(_0x347b2f[_0xb8d5('0x33')]['includeAll']){_0x4d80de[_0xb8d5('0x46')]=[{'all':!![]}];}_0x4d80de=_[_0xb8d5('0x3f')]({},_0x4d80de,_0x347b2f[_0xb8d5('0x41')]);return db[_0xb8d5('0x2d')][_0xb8d5('0x47')](_0x4d80de)[_0xb8d5('0x28')](handleEntityNotFound(_0x3a61ce,null))[_0xb8d5('0x28')](respondWithResult(_0x3a61ce,null))[_0xb8d5('0x44')](handleError(_0x3a61ce,null));};exports['update']=function(_0x462a2e,_0x3d2677){if(_0x462a2e['body']['id']){delete _0x462a2e['body']['id'];}return db[_0xb8d5('0x2d')]['find']({'where':{'id':_0x462a2e[_0xb8d5('0x45')]['id']}})[_0xb8d5('0x28')](handleEntityNotFound(_0x3d2677,null))[_0xb8d5('0x28')](saveUpdates(_0x462a2e[_0xb8d5('0x48')],null))['then'](respondWithResult(_0x3d2677,null))[_0xb8d5('0x44')](handleError(_0x3d2677,null));};exports['destroy']=function(_0x170849,_0x44599a){return db[_0xb8d5('0x2d')][_0xb8d5('0x47')]({'where':{'id':_0x170849['params']['id']}})['then'](handleEntityNotFound(_0x44599a,null))[_0xb8d5('0x28')](removeEntity(_0x44599a,null))[_0xb8d5('0x44')](handleError(_0x44599a,null));};exports[_0xb8d5('0x49')]=function(_0x30548e,_0x502591){return db['CmHopperBlack'][_0xb8d5('0x49')]()['then'](respondWithResult(_0x502591,null))['catch'](handleError(_0x502591,null));}; \ No newline at end of file +var _0xced7=['end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','name','index','rawAttributes','fieldName','type','key','map','query','intersection','model','fields','attributes','length','nolimit','order','sort','filters','where','filter','options','CmHopperBlack','include','rows','catch','show','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xced7,0xf2));var _0x7ced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xced7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7ced('0x0'));var rimraf=require(_0x7ced('0x1'));var zipdir=require(_0x7ced('0x2'));var jsonpatch=require(_0x7ced('0x3'));var rp=require(_0x7ced('0x4'));var moment=require('moment');var BPromise=require(_0x7ced('0x5'));var Mustache=require('mustache');var util=require(_0x7ced('0x6'));var path=require(_0x7ced('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7ced('0x8'));var fs=require('fs');var fs_extra=require(_0x7ced('0x9'));var _=require('lodash');var squel=require(_0x7ced('0xa'));var crypto=require(_0x7ced('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7ced('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7ced('0xd'));var Papa=require(_0x7ced('0xe'));var Redis=require('ioredis');var authService=require(_0x7ced('0xf'));var qs=require(_0x7ced('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ced('0x11'));var logger=require(_0x7ced('0x12'))(_0x7ced('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7ced('0x14'));var db=require(_0x7ced('0x15'))['db'];function respondWithStatusCode(_0x47ffa9,_0x17f696){_0x17f696=_0x17f696||0xcc;return function(_0x5a88c8){if(_0x5a88c8){return _0x47ffa9['sendStatus'](_0x17f696);}return _0x47ffa9['status'](_0x17f696)[_0x7ced('0x16')]();};}function respondWithResult(_0x4bb98b,_0x24b8b7){_0x24b8b7=_0x24b8b7||0xc8;return function(_0x749d33){if(_0x749d33){return _0x4bb98b[_0x7ced('0x17')](_0x24b8b7)[_0x7ced('0x18')](_0x749d33);}};}function respondWithFilteredResult(_0x407b19,_0x229920){return function(_0x2e6ebe){if(_0x2e6ebe){var _0x17f6a5=typeof _0x229920[_0x7ced('0x19')]===_0x7ced('0x1a')&&typeof _0x229920[_0x7ced('0x1b')]===_0x7ced('0x1a');var _0x3a05c8=_0x2e6ebe['count'];var _0x3ee432=_0x17f6a5?0x0:_0x229920[_0x7ced('0x19')];var _0x38949d=_0x17f6a5?_0x2e6ebe[_0x7ced('0x1c')]:_0x229920[_0x7ced('0x19')]+_0x229920[_0x7ced('0x1b')];var _0x589d5f;if(_0x38949d>=_0x3a05c8){_0x38949d=_0x3a05c8;_0x589d5f=0xc8;}else{_0x589d5f=0xce;}_0x407b19['status'](_0x589d5f);return _0x407b19['set'](_0x7ced('0x1d'),_0x3ee432+'-'+_0x38949d+'/'+_0x3a05c8)[_0x7ced('0x18')](_0x2e6ebe);}return null;};}function patchUpdates(_0x393165){return function(_0x11b022){try{jsonpatch[_0x7ced('0x1e')](_0x11b022,_0x393165,!![]);}catch(_0x5c11d0){return BPromise[_0x7ced('0x1f')](_0x5c11d0);}return _0x11b022[_0x7ced('0x20')]();};}function saveUpdates(_0x270351,_0xfc328c){return function(_0x111526){if(_0x111526){return _0x111526[_0x7ced('0x21')](_0x270351)[_0x7ced('0x22')](function(_0x13ffaf){return _0x13ffaf;});}return null;};}function removeEntity(_0x3dba54,_0x1adc14){return function(_0x1b8b9e){if(_0x1b8b9e){return _0x1b8b9e['destroy']()['then'](function(){_0x3dba54[_0x7ced('0x17')](0xcc)[_0x7ced('0x16')]();});}};}function handleEntityNotFound(_0x1b1e67,_0x39d237){return function(_0x1d46d){if(!_0x1d46d){_0x1b1e67[_0x7ced('0x23')](0x194);}return _0x1d46d;};}function handleError(_0x232e98,_0x12865d){_0x12865d=_0x12865d||0x1f4;return function(_0x5756ca){logger[_0x7ced('0x24')](_0x5756ca['stack']);if(_0x5756ca['name']){delete _0x5756ca[_0x7ced('0x25')];}_0x232e98[_0x7ced('0x17')](_0x12865d)['send'](_0x5756ca);};}exports[_0x7ced('0x26')]=function(_0x936f69,_0x340a29){var _0x4d387e={},_0x2213b6={},_0x4570eb={'count':0x0,'rows':[]};var _0x29be29=_['map'](db['CmHopperBlack'][_0x7ced('0x27')],function(_0x18452b){return{'name':_0x18452b[_0x7ced('0x28')],'type':_0x18452b[_0x7ced('0x29')][_0x7ced('0x2a')]};});_0x2213b6['model']=_[_0x7ced('0x2b')](_0x29be29,_0x7ced('0x25'));_0x2213b6[_0x7ced('0x2c')]=_['keys'](_0x936f69[_0x7ced('0x2c')]);_0x2213b6['filters']=_[_0x7ced('0x2d')](_0x2213b6[_0x7ced('0x2e')],_0x2213b6[_0x7ced('0x2c')]);_0x4d387e['attributes']=_['intersection'](_0x2213b6[_0x7ced('0x2e')],qs['fields'](_0x936f69[_0x7ced('0x2c')][_0x7ced('0x2f')]));_0x4d387e['attributes']=_0x4d387e[_0x7ced('0x30')][_0x7ced('0x31')]?_0x4d387e[_0x7ced('0x30')]:_0x2213b6['model'];if(!_0x936f69[_0x7ced('0x2c')]['hasOwnProperty'](_0x7ced('0x32'))){_0x4d387e[_0x7ced('0x1b')]=qs[_0x7ced('0x1b')](_0x936f69[_0x7ced('0x2c')][_0x7ced('0x1b')]);_0x4d387e[_0x7ced('0x19')]=qs[_0x7ced('0x19')](_0x936f69[_0x7ced('0x2c')][_0x7ced('0x19')]);}_0x4d387e[_0x7ced('0x33')]=qs[_0x7ced('0x34')](_0x936f69[_0x7ced('0x2c')]['sort']);_0x4d387e['where']=qs['filters'](_['pick'](_0x936f69[_0x7ced('0x2c')],_0x2213b6[_0x7ced('0x35')]),_0x29be29);if(_0x936f69[_0x7ced('0x2c')]['filter']){_0x4d387e[_0x7ced('0x36')]=_['merge'](_0x4d387e[_0x7ced('0x36')],{'$or':_['map'](_0x29be29,function(_0x329c83){if(_0x329c83['type']!=='VIRTUAL'){var _0x2dc7a6={};_0x2dc7a6[_0x329c83[_0x7ced('0x25')]]={'$like':'%'+_0x936f69[_0x7ced('0x2c')][_0x7ced('0x37')]+'%'};return _0x2dc7a6;}})});}_0x4d387e=_['merge']({},_0x4d387e,_0x936f69[_0x7ced('0x38')]);var _0xe633bd={'where':_0x4d387e[_0x7ced('0x36')]};return db[_0x7ced('0x39')][_0x7ced('0x1c')](_0xe633bd)[_0x7ced('0x22')](function(_0x4dac5e){_0x4570eb[_0x7ced('0x1c')]=_0x4dac5e;if(_0x936f69[_0x7ced('0x2c')]['includeAll']){_0x4d387e[_0x7ced('0x3a')]=[{'all':!![]}];}return db[_0x7ced('0x39')]['findAll'](_0x4d387e);})[_0x7ced('0x22')](function(_0x1e9715){_0x4570eb[_0x7ced('0x3b')]=_0x1e9715;return _0x4570eb;})[_0x7ced('0x22')](respondWithFilteredResult(_0x340a29,_0x4d387e))[_0x7ced('0x3c')](handleError(_0x340a29,null));};exports[_0x7ced('0x3d')]=function(_0xf852da,_0x3d297c){var _0x48af78={'raw':!![],'where':{'id':_0xf852da['params']['id']}},_0x1a2f4c={};_0x1a2f4c[_0x7ced('0x2e')]=_['keys'](db[_0x7ced('0x39')][_0x7ced('0x27')]);_0x1a2f4c[_0x7ced('0x2c')]=_['keys'](_0xf852da[_0x7ced('0x2c')]);_0x1a2f4c[_0x7ced('0x35')]=_[_0x7ced('0x2d')](_0x1a2f4c[_0x7ced('0x2e')],_0x1a2f4c['query']);_0x48af78['attributes']=_[_0x7ced('0x2d')](_0x1a2f4c[_0x7ced('0x2e')],qs['fields'](_0xf852da[_0x7ced('0x2c')][_0x7ced('0x2f')]));_0x48af78['attributes']=_0x48af78[_0x7ced('0x30')][_0x7ced('0x31')]?_0x48af78[_0x7ced('0x30')]:_0x1a2f4c[_0x7ced('0x2e')];if(_0xf852da[_0x7ced('0x2c')]['includeAll']){_0x48af78[_0x7ced('0x3a')]=[{'all':!![]}];}_0x48af78=_['merge']({},_0x48af78,_0xf852da[_0x7ced('0x38')]);return db[_0x7ced('0x39')][_0x7ced('0x3e')](_0x48af78)[_0x7ced('0x22')](handleEntityNotFound(_0x3d297c,null))['then'](respondWithResult(_0x3d297c,null))[_0x7ced('0x3c')](handleError(_0x3d297c,null));};exports[_0x7ced('0x21')]=function(_0x139876,_0x52dbfa){if(_0x139876[_0x7ced('0x3f')]['id']){delete _0x139876['body']['id'];}return db[_0x7ced('0x39')][_0x7ced('0x3e')]({'where':{'id':_0x139876[_0x7ced('0x40')]['id']}})[_0x7ced('0x22')](handleEntityNotFound(_0x52dbfa,null))[_0x7ced('0x22')](saveUpdates(_0x139876[_0x7ced('0x3f')],null))[_0x7ced('0x22')](respondWithResult(_0x52dbfa,null))['catch'](handleError(_0x52dbfa,null));};exports['destroy']=function(_0x3d0147,_0x594723){return db[_0x7ced('0x39')][_0x7ced('0x3e')]({'where':{'id':_0x3d0147[_0x7ced('0x40')]['id']}})[_0x7ced('0x22')](handleEntityNotFound(_0x594723,null))[_0x7ced('0x22')](removeEntity(_0x594723,null))['catch'](handleError(_0x594723,null));};exports[_0x7ced('0x41')]=function(_0x2bd569,_0x1ffcbb){return db[_0x7ced('0x39')][_0x7ced('0x41')]()[_0x7ced('0x22')](respondWithResult(_0x1ffcbb,null))[_0x7ced('0x3c')](handleError(_0x1ffcbb,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 36d0a1f..2a04ac5 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 _0x41b3=['CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define'];(function(_0x2e8d7d,_0x53dcc3){var _0x2f3d36=function(_0x472cbd){while(--_0x472cbd){_0x2e8d7d['push'](_0x2e8d7d['shift']());}};_0x2f3d36(++_0x53dcc3);}(_0x41b3,0xd4));var _0x341b=function(_0x5eeb8f,_0x1b4766){_0x5eeb8f=_0x5eeb8f-0x0;var _0x4ed928=_0x41b3[_0x5eeb8f];return _0x4ed928;};'use strict';var _=require(_0x341b('0x0'));var util=require(_0x341b('0x1'));var logger=require(_0x341b('0x2'))(_0x341b('0x3'));var moment=require(_0x341b('0x4'));var BPromise=require('bluebird');var rp=require(_0x341b('0x5'));var fs=require('fs');var path=require(_0x341b('0x6'));var rimraf=require(_0x341b('0x7'));var config=require(_0x341b('0x8'));var attributes=require(_0x341b('0x9'));module[_0x341b('0xa')]=function(_0x3ac11c,_0x336a94){return _0x3ac11c[_0x341b('0xb')](_0x341b('0xc'),attributes,{'tableName':_0x341b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ff0=['exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2d0c44,_0x263332){var _0x129acd=function(_0xa693e3){while(--_0xa693e3){_0x2d0c44['push'](_0x2d0c44['shift']());}};_0x129acd(++_0x263332);}(_0x2ff0,0x159));var _0x02ff=function(_0x168864,_0x14d642){_0x168864=_0x168864-0x0;var _0x14efba=_0x2ff0[_0x168864];return _0x14efba;};'use strict';var _=require(_0x02ff('0x0'));var util=require(_0x02ff('0x1'));var logger=require(_0x02ff('0x2'))(_0x02ff('0x3'));var moment=require(_0x02ff('0x4'));var BPromise=require(_0x02ff('0x5'));var rp=require(_0x02ff('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0x02ff('0x7')]=function(_0x19e49c,_0x93462f){return _0x19e49c[_0x02ff('0x8')](_0x02ff('0x9'),attributes,{'tableName':_0x02ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index d31688d..7c4f294 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 _0x985f=['DestroyCmHopperBlack','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','catch','GetCmHopperBlack','findAll','options','where','attributes','limit','include','map','model','then','UpdateCmHopperBlack','CmHopperBlack','update','body','raw','destroy'];(function(_0x2fbbaf,_0x52ab60){var _0x2b340b=function(_0x1c8cb0){while(--_0x1c8cb0){_0x2fbbaf['push'](_0x2fbbaf['shift']());}};_0x2b340b(++_0x52ab60);}(_0x985f,0x119));var _0xf985=function(_0x4d94db,_0x5a2d71){_0x4d94db=_0x4d94db-0x0;var _0x41d157=_0x985f[_0x4d94db];return _0x41d157;};'use strict';var _=require('lodash');var util=require(_0xf985('0x0'));var moment=require(_0xf985('0x1'));var BPromise=require(_0xf985('0x2'));var rs=require(_0xf985('0x3'));var fs=require('fs');var Redis=require(_0xf985('0x4'));var db=require(_0xf985('0x5'))['db'];var utils=require(_0xf985('0x6'));var logger=require(_0xf985('0x7'))(_0xf985('0x8'));var config=require(_0xf985('0x9'));var jayson=require(_0xf985('0xa'));var client=jayson['client'][_0xf985('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d50b1,_0x2c4571,_0x3b26f7){return new BPromise(function(_0x3783f9,_0x424d57){return client[_0xf985('0xc')](_0x4d50b1,_0x3b26f7)['then'](function(_0x4b02b4){logger[_0xf985('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x2c4571,_0xf985('0xe'));logger[_0xf985('0xf')](_0xf985('0x10'),_0x2c4571,'request\x20sent',JSON[_0xf985('0x11')](_0x4b02b4));if(_0x4b02b4['error']){if(_0x4b02b4[_0xf985('0x12')][_0xf985('0x13')]===0x1f4){logger[_0xf985('0x12')](_0xf985('0x14'),_0x2c4571,_0x4b02b4[_0xf985('0x12')][_0xf985('0x15')]);return _0x424d57(_0x4b02b4[_0xf985('0x12')][_0xf985('0x15')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x2c4571,_0x4b02b4['error']['message']);return _0x3783f9(_0x4b02b4['error'][_0xf985('0x15')]);}else{logger[_0xf985('0xd')](_0xf985('0x14'),_0x2c4571,'request\x20sent');_0x3783f9(_0x4b02b4['result'][_0xf985('0x15')]);}})[_0xf985('0x16')](function(_0x496c74){logger[_0xf985('0x12')](_0xf985('0x14'),_0x2c4571,_0x496c74);_0x424d57(_0x496c74);});});}exports[_0xf985('0x17')]=function(_0x4bc8b5){var _0x4c1086=this;return new Promise(function(_0xb92a0d,_0x399f58){return db['CmHopperBlack'][_0xf985('0x18')]({'raw':_0x4bc8b5['options']?_0x4bc8b5[_0xf985('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4bc8b5[_0xf985('0x19')]?_0x4bc8b5[_0xf985('0x19')][_0xf985('0x1a')]||null:null,'attributes':_0x4bc8b5[_0xf985('0x19')]?_0x4bc8b5[_0xf985('0x19')][_0xf985('0x1b')]||null:null,'limit':_0x4bc8b5[_0xf985('0x19')]?_0x4bc8b5[_0xf985('0x19')][_0xf985('0x1c')]||null:null,'include':_0x4bc8b5[_0xf985('0x19')]?_0x4bc8b5['options'][_0xf985('0x1d')]?_[_0xf985('0x1e')](_0x4bc8b5[_0xf985('0x19')][_0xf985('0x1d')],function(_0x17d69f){return{'model':db[_0x17d69f[_0xf985('0x1f')]],'as':_0x17d69f['as'],'attributes':_0x17d69f[_0xf985('0x1b')],'include':_0x17d69f[_0xf985('0x1d')]?_[_0xf985('0x1e')](_0x17d69f[_0xf985('0x1d')],function(_0x6ff971){return{'model':db[_0x6ff971[_0xf985('0x1f')]],'as':_0x6ff971['as'],'attributes':_0x6ff971[_0xf985('0x1b')],'include':_0x6ff971[_0xf985('0x1d')]?_[_0xf985('0x1e')](_0x6ff971['include'],function(_0x27f426){return{'model':db[_0x27f426[_0xf985('0x1f')]],'as':_0x27f426['as'],'attributes':_0x27f426[_0xf985('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf985('0x20')](function(_0x1c280a){logger[_0xf985('0xd')](_0xf985('0x17'),_0x4bc8b5);logger['debug']('GetCmHopperBlack',_0x4bc8b5,JSON[_0xf985('0x11')](_0x1c280a));_0xb92a0d(_0x1c280a);})['catch'](function(_0x325984){logger['error'](_0xf985('0x17'),_0x325984[_0xf985('0x15')],_0x4bc8b5);_0x399f58(_0x4c1086[_0xf985('0x12')](0x1f4,_0x325984[_0xf985('0x15')]));});});};exports[_0xf985('0x21')]=function(_0x2d1c1d){var _0x36302b=this;return new Promise(function(_0x541fd4,_0x578f32){return db[_0xf985('0x22')][_0xf985('0x23')](_0x2d1c1d[_0xf985('0x24')],{'raw':_0x2d1c1d[_0xf985('0x19')]?_0x2d1c1d[_0xf985('0x19')][_0xf985('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d1c1d[_0xf985('0x19')]?_0x2d1c1d[_0xf985('0x19')][_0xf985('0x1a')]||null:null,'attributes':_0x2d1c1d[_0xf985('0x19')]?_0x2d1c1d[_0xf985('0x19')][_0xf985('0x1b')]||null:null,'limit':_0x2d1c1d[_0xf985('0x19')]?_0x2d1c1d[_0xf985('0x19')][_0xf985('0x1c')]||null:null})[_0xf985('0x20')](function(_0x3e97f0){logger[_0xf985('0xd')](_0xf985('0x21'),_0x2d1c1d);logger['debug']('UpdateCmHopperBlack',_0x2d1c1d,JSON['stringify'](_0x3e97f0));_0x541fd4(_0x3e97f0);})[_0xf985('0x16')](function(_0x4b7ca1){logger[_0xf985('0x12')]('UpdateCmHopperBlack',_0x4b7ca1['message'],_0x2d1c1d);_0x578f32(_0x36302b[_0xf985('0x12')](0x1f4,_0x4b7ca1[_0xf985('0x15')]));});});};exports['DestroyCmHopperBlack']=function(_0x44a1a1){var _0x3619db=this;return new Promise(function(_0x4ce67e,_0x1df97e){return db[_0xf985('0x22')][_0xf985('0x26')]({'where':_0x44a1a1['options']?_0x44a1a1[_0xf985('0x19')][_0xf985('0x1a')]||null:null})[_0xf985('0x20')](function(_0xf9cdd2){logger[_0xf985('0xd')](_0xf985('0x27'),_0x44a1a1);logger['debug']('DestroyCmHopperBlack',_0x44a1a1,JSON[_0xf985('0x11')](_0xf9cdd2));_0x4ce67e(_0xf9cdd2);})[_0xf985('0x16')](function(_0x36a3d9){logger[_0xf985('0x12')]('DestroyCmHopperBlack',_0x36a3d9[_0xf985('0x15')],_0x44a1a1);_0x1df97e(_0x3619db[_0xf985('0x12')](0x1f4,_0x36a3d9['message']));});});}; \ No newline at end of file +var _0x4e77=['CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','limit','map','include','model','attributes','update','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3a3bf4,_0x3992d7){var _0x40eed1=function(_0x4d2c40){while(--_0x4d2c40){_0x3a3bf4['push'](_0x3a3bf4['shift']());}};_0x40eed1(++_0x3992d7);}(_0x4e77,0x181));var _0x74e7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4e77[_0x432682];return _0x463d05;};'use strict';var _=require(_0x74e7('0x0'));var util=require(_0x74e7('0x1'));var moment=require(_0x74e7('0x2'));var BPromise=require(_0x74e7('0x3'));var rs=require(_0x74e7('0x4'));var fs=require('fs');var Redis=require(_0x74e7('0x5'));var db=require(_0x74e7('0x6'))['db'];var utils=require(_0x74e7('0x7'));var logger=require(_0x74e7('0x8'))('rpc');var config=require(_0x74e7('0x9'));var jayson=require(_0x74e7('0xa'));var client=jayson[_0x74e7('0xb')][_0x74e7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32b3c5,_0x280c45,_0x19db2c){return new BPromise(function(_0x28437b,_0x119f13){return client[_0x74e7('0xd')](_0x32b3c5,_0x19db2c)[_0x74e7('0xe')](function(_0x173f8e){logger['info'](_0x74e7('0xf'),_0x280c45,_0x74e7('0x10'));logger[_0x74e7('0x11')](_0x74e7('0x12'),_0x280c45,_0x74e7('0x10'),JSON[_0x74e7('0x13')](_0x173f8e));if(_0x173f8e[_0x74e7('0x14')]){if(_0x173f8e[_0x74e7('0x14')][_0x74e7('0x15')]===0x1f4){logger['error'](_0x74e7('0xf'),_0x280c45,_0x173f8e[_0x74e7('0x14')]['message']);return _0x119f13(_0x173f8e[_0x74e7('0x14')][_0x74e7('0x16')]);}logger[_0x74e7('0x14')](_0x74e7('0xf'),_0x280c45,_0x173f8e['error']['message']);return _0x28437b(_0x173f8e[_0x74e7('0x14')][_0x74e7('0x16')]);}else{logger[_0x74e7('0x17')](_0x74e7('0xf'),_0x280c45,_0x74e7('0x10'));_0x28437b(_0x173f8e[_0x74e7('0x18')]['message']);}})[_0x74e7('0x19')](function(_0x258c26){logger[_0x74e7('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x280c45,_0x258c26);_0x119f13(_0x258c26);});});}exports[_0x74e7('0x1a')]=function(_0x46d63d){var _0x158dac=this;return new Promise(function(_0x301408,_0x1d532b){return db[_0x74e7('0x1b')][_0x74e7('0x1c')]({'raw':_0x46d63d[_0x74e7('0x1d')]?_0x46d63d[_0x74e7('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x46d63d[_0x74e7('0x1d')]?_0x46d63d[_0x74e7('0x1d')]['where']||null:null,'attributes':_0x46d63d[_0x74e7('0x1d')]?_0x46d63d[_0x74e7('0x1d')]['attributes']||null:null,'limit':_0x46d63d[_0x74e7('0x1d')]?_0x46d63d['options'][_0x74e7('0x1e')]||null:null,'include':_0x46d63d[_0x74e7('0x1d')]?_0x46d63d[_0x74e7('0x1d')]['include']?_[_0x74e7('0x1f')](_0x46d63d['options'][_0x74e7('0x20')],function(_0x11f675){return{'model':db[_0x11f675[_0x74e7('0x21')]],'as':_0x11f675['as'],'attributes':_0x11f675[_0x74e7('0x22')],'include':_0x11f675[_0x74e7('0x20')]?_[_0x74e7('0x1f')](_0x11f675[_0x74e7('0x20')],function(_0x18f1c1){return{'model':db[_0x18f1c1[_0x74e7('0x21')]],'as':_0x18f1c1['as'],'attributes':_0x18f1c1[_0x74e7('0x22')],'include':_0x18f1c1[_0x74e7('0x20')]?_['map'](_0x18f1c1[_0x74e7('0x20')],function(_0x34ea29){return{'model':db[_0x34ea29[_0x74e7('0x21')]],'as':_0x34ea29['as'],'attributes':_0x34ea29[_0x74e7('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30d9b9){logger[_0x74e7('0x17')](_0x74e7('0x1a'),_0x46d63d);logger[_0x74e7('0x11')](_0x74e7('0x1a'),_0x46d63d,JSON['stringify'](_0x30d9b9));_0x301408(_0x30d9b9);})['catch'](function(_0x219df7){logger['error'](_0x74e7('0x1a'),_0x219df7[_0x74e7('0x16')],_0x46d63d);_0x1d532b(_0x158dac[_0x74e7('0x14')](0x1f4,_0x219df7[_0x74e7('0x16')]));});});};exports['UpdateCmHopperBlack']=function(_0x38fa2c){var _0x1ae4ee=this;return new Promise(function(_0xa9a351,_0x10f634){return db[_0x74e7('0x1b')][_0x74e7('0x23')](_0x38fa2c['body'],{'raw':_0x38fa2c[_0x74e7('0x1d')]?_0x38fa2c[_0x74e7('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38fa2c[_0x74e7('0x1d')]?_0x38fa2c[_0x74e7('0x1d')]['where']||null:null,'attributes':_0x38fa2c[_0x74e7('0x1d')]?_0x38fa2c[_0x74e7('0x1d')][_0x74e7('0x22')]||null:null,'limit':_0x38fa2c[_0x74e7('0x1d')]?_0x38fa2c[_0x74e7('0x1d')][_0x74e7('0x1e')]||null:null})['then'](function(_0x23fb9c){logger[_0x74e7('0x17')](_0x74e7('0x24'),_0x38fa2c);logger[_0x74e7('0x11')](_0x74e7('0x24'),_0x38fa2c,JSON[_0x74e7('0x13')](_0x23fb9c));_0xa9a351(_0x23fb9c);})[_0x74e7('0x19')](function(_0x550198){logger[_0x74e7('0x14')](_0x74e7('0x24'),_0x550198[_0x74e7('0x16')],_0x38fa2c);_0x10f634(_0x1ae4ee[_0x74e7('0x14')](0x1f4,_0x550198[_0x74e7('0x16')]));});});};exports[_0x74e7('0x25')]=function(_0x3724d9){var _0x2325ff=this;return new Promise(function(_0xd5b3de,_0x5118f1){return db['CmHopperBlack'][_0x74e7('0x26')]({'where':_0x3724d9[_0x74e7('0x1d')]?_0x3724d9[_0x74e7('0x1d')][_0x74e7('0x27')]||null:null})['then'](function(_0x5ad2f5){logger['info'](_0x74e7('0x25'),_0x3724d9);logger[_0x74e7('0x11')](_0x74e7('0x25'),_0x3724d9,JSON['stringify'](_0x5ad2f5));_0xd5b3de(_0x5ad2f5);})[_0x74e7('0x19')](function(_0x4d6817){logger[_0x74e7('0x14')](_0x74e7('0x25'),_0x4d6817[_0x74e7('0x16')],_0x3724d9);_0x5118f1(_0x2325ff[_0x74e7('0x14')](0x1f4,_0x4d6817[_0x74e7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index cbb6498..827ab4f 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 _0x3a6d=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','describe','/:id','show','put','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a6d,0x143));var _0xd3a6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x3a6d[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var path=require('path');var timeout=require(_0xd3a6('0x2'));var express=require(_0xd3a6('0x3'));var router=express[_0xd3a6('0x4')]();var fs_extra=require(_0xd3a6('0x5'));var auth=require(_0xd3a6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd3a6('0x7'));var controller=require(_0xd3a6('0x8'));router[_0xd3a6('0x9')]('/',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xb')]);router[_0xd3a6('0x9')]('/describe',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xc')]);router[_0xd3a6('0x9')](_0xd3a6('0xd'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xe')]);router[_0xd3a6('0xf')](_0xd3a6('0xd'),auth[_0xd3a6('0xa')](),controller['update']);router[_0xd3a6('0x10')](_0xd3a6('0xd'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x11')]);module[_0xd3a6('0x12')]=router; \ No newline at end of file +var _0xe2fe=['/describe','describe','/:id','put','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x29771f,_0x1189ae){var _0x279baf=function(_0xd66325){while(--_0xd66325){_0x29771f['push'](_0x29771f['shift']());}};_0x279baf(++_0x1189ae);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./cmHopperBlack.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0xc')](_0xee2f('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xee2f('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 1942107..32f0c29 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 _0xe9c5=['moment','exports','STRING','DATE','INTEGER','getDataValue','endtime','setDataValue','diff','seconds','BOOLEAN','sequelize'];(function(_0x3d55a9,_0x542513){var _0x25d946=function(_0x3380af){while(--_0x3380af){_0x3d55a9['push'](_0x3d55a9['shift']());}};_0x25d946(++_0x542513);}(_0xe9c5,0x8f));var _0x5e9c=function(_0xa54d06,_0x1a6fc5){_0xa54d06=_0xa54d06-0x0;var _0x38a4f7=_0xe9c5[_0xa54d06];return _0x38a4f7;};'use strict';var Sequelize=require(_0x5e9c('0x0'));var moment=require(_0x5e9c('0x1'));module[_0x5e9c('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x5e9c('0x3')]},'scheduledat':{'type':Sequelize[_0x5e9c('0x4')]},'countbusyretry':{'type':Sequelize[_0x5e9c('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5e9c('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5e9c('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5e9c('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5e9c('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x5e9c('0x3')]},'originatecalleridname':{'type':Sequelize[_0x5e9c('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5e9c('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x5e9c('0x4')]},'answertime':{'type':Sequelize[_0x5e9c('0x4')]},'droptime':{'type':Sequelize[_0x5e9c('0x4')]},'endtime':{'type':Sequelize[_0x5e9c('0x4')]},'ringtime':{'type':Sequelize[_0x5e9c('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5e9c('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5e9c('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5e9c('0x3')]},'campaign':{'type':Sequelize[_0x5e9c('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5e9c('0x3')]},'reason':{'type':Sequelize[_0x5e9c('0x3')]},'disposition':{'type':Sequelize[_0x5e9c('0x3')]},'secondDisposition':{'type':Sequelize[_0x5e9c('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5e9c('0x3')]},'dispositionat':{'type':Sequelize[_0x5e9c('0x4')],'set':function(_0xd45d97){var _0x79c62c=this[_0x5e9c('0x6')](_0x5e9c('0x7'));if(_0x79c62c&&_0xd45d97){this[_0x5e9c('0x8')]('followuptime',moment(_0xd45d97)[_0x5e9c('0x9')](moment(_0x79c62c),_0x5e9c('0xa')));}}},'amd':{'type':Sequelize[_0x5e9c('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5e9c('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x5e9c('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5e9c('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5e9c('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5e9c('0x4')]},'deleted':{'type':Sequelize[_0x5e9c('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x5e9c('0x4')]},'recallme':{'type':Sequelize[_0x5e9c('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x5e9c('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5e9c('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5e9c('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5e9c('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5e9c('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc0e3=['seconds','BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER','endtime','diff'];(function(_0xee3051,_0xbe4f18){var _0x139e81=function(_0xac81c3){while(--_0xac81c3){_0xee3051['push'](_0xee3051['shift']());}};_0x139e81(++_0xbe4f18);}(_0xc0e3,0x16a));var _0x3c0e=function(_0x26a84c,_0x5724a7){_0x26a84c=_0x26a84c-0x0;var _0xa7793f=_0xc0e3[_0x26a84c];return _0xa7793f;};'use strict';var Sequelize=require(_0x3c0e('0x0'));var moment=require(_0x3c0e('0x1'));module[_0x3c0e('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x3c0e('0x3')]},'scheduledat':{'type':Sequelize[_0x3c0e('0x4')]},'countbusyretry':{'type':Sequelize[_0x3c0e('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3c0e('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3c0e('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x3c0e('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3c0e('0x3')]},'calleridname':{'type':Sequelize[_0x3c0e('0x3')]},'starttime':{'type':Sequelize[_0x3c0e('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x3c0e('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x3c0e('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3c0e('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3c0e('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3c0e('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3c0e('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x3c0e('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x3c0e('0x3')]},'disposition':{'type':Sequelize[_0x3c0e('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3c0e('0x3')]},'dispositionat':{'type':Sequelize[_0x3c0e('0x4')],'set':function(_0x12d3ac){var _0x12bf63=this['getDataValue'](_0x3c0e('0x6'));if(_0x12bf63&&_0x12d3ac){this['setDataValue']('followuptime',moment(_0x12d3ac)[_0x3c0e('0x7')](moment(_0x12bf63),_0x3c0e('0x8')));}}},'amd':{'type':Sequelize[_0x3c0e('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3c0e('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x3c0e('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3c0e('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x3c0e('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x3c0e('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x3c0e('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3c0e('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3c0e('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3c0e('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index ddc1f05..347b37e 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 _0x781d=['length','nolimit','order','where','filters','filter','merge','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','findAll','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','fromQuery','CampaignId','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','CmHopperFinal','fieldName','type','key','query','keys','intersection','model','attributes','fields'];(function(_0x328b1c,_0xec0b4f){var _0x4dbeaa=function(_0x432519){while(--_0x432519){_0x328b1c['push'](_0x328b1c['shift']());}};_0x4dbeaa(++_0xec0b4f);}(_0x781d,0x14a));var _0xd781=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x781d[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){_0x101480[_0xd781('0x1a')](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x10940b,_0x5662db){return function(_0x529ca1){if(!_0x529ca1){_0x10940b[_0xd781('0x19')](0x194);}return _0x529ca1;};}function handleError(_0x849587,_0xdad0b1){_0xdad0b1=_0xdad0b1||0x1f4;return function(_0x57b41e){logger[_0xd781('0x27')](_0x57b41e['stack']);if(_0x57b41e['name']){delete _0x57b41e[_0xd781('0x28')];}_0x849587['status'](_0xdad0b1)[_0xd781('0x29')](_0x57b41e);};}exports[_0xd781('0x2a')]=function(_0x5c3848,_0x5b6b9d){var _0x43cc74={},_0x5b0464={},_0x296a0b={'count':0x0,'rows':[]};var _0x4a3bd3=_[_0xd781('0x2b')](db[_0xd781('0x2c')]['rawAttributes'],function(_0x54521e){return{'name':_0x54521e[_0xd781('0x2d')],'type':_0x54521e[_0xd781('0x2e')][_0xd781('0x2f')]};});_0x5b0464['model']=_['map'](_0x4a3bd3,_0xd781('0x28'));_0x5b0464[_0xd781('0x30')]=_[_0xd781('0x31')](_0x5c3848['query']);_0x5b0464['filters']=_[_0xd781('0x32')](_0x5b0464[_0xd781('0x33')],_0x5b0464['query']);_0x43cc74[_0xd781('0x34')]=_[_0xd781('0x32')](_0x5b0464['model'],qs[_0xd781('0x35')](_0x5c3848[_0xd781('0x30')][_0xd781('0x35')]));_0x43cc74[_0xd781('0x34')]=_0x43cc74['attributes'][_0xd781('0x36')]?_0x43cc74[_0xd781('0x34')]:_0x5b0464[_0xd781('0x33')];if(!_0x5c3848[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x37'))){_0x43cc74[_0xd781('0x1e')]=qs['limit'](_0x5c3848[_0xd781('0x30')]['limit']);_0x43cc74[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x5c3848['query'][_0xd781('0x1c')]);}_0x43cc74[_0xd781('0x38')]=qs['sort'](_0x5c3848[_0xd781('0x30')]['sort']);_0x43cc74[_0xd781('0x39')]=qs[_0xd781('0x3a')](_['pick'](_0x5c3848[_0xd781('0x30')],_0x5b0464[_0xd781('0x3a')]),_0x4a3bd3);if(_0x5c3848['query'][_0xd781('0x3b')]){_0x43cc74[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x43cc74['where'],{'$or':_[_0xd781('0x2b')](_0x4a3bd3,function(_0x22b94e){if(_0x22b94e[_0xd781('0x2e')]!==_0xd781('0x3d')){var _0x2e8218={};_0x2e8218[_0x22b94e[_0xd781('0x28')]]={'$like':'%'+_0x5c3848[_0xd781('0x30')][_0xd781('0x3b')]+'%'};return _0x2e8218;}})});}_0x43cc74=_[_0xd781('0x3c')]({},_0x43cc74,_0x5c3848['options']);var _0x2a60d6={'where':_0x43cc74['where']};return db[_0xd781('0x2c')][_0xd781('0x1f')](_0x2a60d6)['then'](function(_0x1a5833){_0x296a0b[_0xd781('0x1f')]=_0x1a5833;if(_0x5c3848[_0xd781('0x30')][_0xd781('0x3e')]){_0x43cc74['include']=[{'all':!![]}];}return db[_0xd781('0x2c')]['findAll'](_0x43cc74);})[_0xd781('0x26')](function(_0xcdaacf){_0x296a0b['rows']=_0xcdaacf;return _0x296a0b;})['then'](respondWithFilteredResult(_0x5b6b9d,_0x43cc74))[_0xd781('0x3f')](handleError(_0x5b6b9d,null));};exports[_0xd781('0x40')]=function(_0x15b49d,_0x23bbab){var _0x53aba6={'raw':!![],'where':{'id':_0x15b49d[_0xd781('0x41')]['id']}},_0x46e7f6={};_0x46e7f6['model']=_['keys'](db[_0xd781('0x2c')][_0xd781('0x42')]);_0x46e7f6[_0xd781('0x30')]=_['keys'](_0x15b49d['query']);_0x46e7f6[_0xd781('0x3a')]=_[_0xd781('0x32')](_0x46e7f6[_0xd781('0x33')],_0x46e7f6[_0xd781('0x30')]);_0x53aba6[_0xd781('0x34')]=_[_0xd781('0x32')](_0x46e7f6['model'],qs['fields'](_0x15b49d[_0xd781('0x30')][_0xd781('0x35')]));_0x53aba6[_0xd781('0x34')]=_0x53aba6[_0xd781('0x34')][_0xd781('0x36')]?_0x53aba6['attributes']:_0x46e7f6[_0xd781('0x33')];if(_0x15b49d[_0xd781('0x30')][_0xd781('0x3e')]){_0x53aba6['include']=[{'all':!![]}];}_0x53aba6=_[_0xd781('0x3c')]({},_0x53aba6,_0x15b49d[_0xd781('0x43')]);return db[_0xd781('0x2c')]['find'](_0x53aba6)[_0xd781('0x26')](handleEntityNotFound(_0x23bbab,null))[_0xd781('0x26')](respondWithResult(_0x23bbab,null))['catch'](handleError(_0x23bbab,null));};exports['describe']=function(_0x13a907,_0x16d16e){return db[_0xd781('0x2c')]['describe']()[_0xd781('0x26')](respondWithResult(_0x16d16e,null))[_0xd781('0x3f')](handleError(_0x16d16e,null));};exports[_0xd781('0x24')]=function(_0x39ecdb,_0x336d30){if(_0x39ecdb[_0xd781('0x44')][_0xd781('0x45')]){delete _0x39ecdb['body'][_0xd781('0x45')];}return db[_0xd781('0x2c')][_0xd781('0x46')]({'where':{'uniqueid':_0x39ecdb['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x336d30,null))[_0xd781('0x26')](saveUpdates(_0x39ecdb['body'],null))[_0xd781('0x26')](respondWithResult(_0x336d30,null))[_0xd781('0x3f')](handleError(_0x336d30,null));};exports[_0xd781('0x47')]=function(_0x207546,_0x42a2f9,_0x599915){return db[_0xd781('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x207546[_0xd781('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xd781('0x4b')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xd781('0x4c')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal'](_0xd781('0x4f')))),_0xd781('0x50')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd781('0x53')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x54')))),_0xd781('0x55')]]})['then'](handleEntityNotFound(_0x42a2f9,null))[_0xd781('0x26')](respondWithResult(_0x42a2f9,null))[_0xd781('0x3f')](handleError(_0x42a2f9,null));};exports[_0xd781('0x56')]=function(_0x2c4874,_0x2e8bab,_0x38bd3e){return db[_0xd781('0x2c')][_0xd781('0x57')]({'raw':![],'where':{'CampaignId':_0x2c4874[_0xd781('0x41')]['id']},'attributes':[[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x58')))),_0xd781('0x59')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5a')))),_0xd781('0x4b')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4f')))),_0xd781('0x50')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5b')))),_0xd781('0x53')],[db['sequelize']['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xd781('0x26')](handleEntityNotFound(_0x2e8bab,null))[_0xd781('0x26')](respondWithResult(_0x2e8bab,null))[_0xd781('0x3f')](handleError(_0x2e8bab,null));};exports[_0xd781('0x5c')]=function(_0x26a0a9,_0x172a05,_0x2e0401){return db[_0xd781('0x5d')][_0xd781('0x46')]({'where':{'id':_0x26a0a9['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x172a05,null))[_0xd781('0x26')](function(_0x4c712f){var _0x24e3f5;if(_0x4c712f){_0x24e3f5=squel['insert']()[_0xd781('0x5e')](_0xd781('0x5f'))['fromQuery'](['phone',_0xd781('0x60'),_0xd781('0x61'),_0xd781('0x62'),_0xd781('0x63'),_0xd781('0x64'),_0xd781('0x65')],squel['select']()[_0xd781('0x66')](_0xd781('0x67'),_0xd781('0x68'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),'ListId')[_0xd781('0x66')]('ANY_VALUE(VoiceQueueId)',_0xd781('0x63'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x65'))[_0xd781('0x6c')](_0xd781('0x6d'))[_0xd781('0x39')]('VoiceQueueId\x20=\x20?',_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]())['where'](_0xd781('0x6f'),_0x26a0a9[_0xd781('0x44')][_0xd781('0x70')]['toString']())['where'](_0xd781('0x71'))['where'](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x68'))[_0xd781('0x6c')]('cm_hopper')[_0xd781('0x39')](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))[_0xd781('0x6c')](_0xd781('0x6d'))['where'](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id']['toString']())[_0xd781('0x39')](_0xd781('0x76')))[_0xd781('0x77')]('ContactId'))[_0xd781('0x6e')]();return db[_0xd781('0x49')]['query'](_0x24e3f5);}return[];})[_0xd781('0x26')](respondWithResult(_0x172a05,null))['catch'](handleError(_0x172a05,null));};exports[_0xd781('0x78')]=function(_0x23dba5,_0x3e0749,_0x192c95){return db[_0xd781('0x79')]['find']({'where':{'id':_0x23dba5[_0xd781('0x41')]['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x3e0749,null))[_0xd781('0x26')](function(_0x3897bf){var _0xaa945b;if(_0x3897bf){_0xaa945b=squel[_0xd781('0x7a')]()['into'](_0xd781('0x5f'))[_0xd781('0x7b')](['phone',_0xd781('0x60'),_0xd781('0x61'),'ListId',_0xd781('0x7c'),_0xd781('0x64'),_0xd781('0x65')],squel[_0xd781('0x73')]()[_0xd781('0x66')]('ANY_VALUE(calleridnum)','phone')['field'](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),_0xd781('0x62'))[_0xd781('0x66')]('ANY_VALUE(CampaignId)',_0xd781('0x7c'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')]('NOW()','updatedAt')['from'](_0xd781('0x6d'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id']['toString']())['where'](_0xd781('0x6f'),_0x23dba5[_0xd781('0x44')][_0xd781('0x70')][_0xd781('0x6e')]())['where'](_0xd781('0x71'))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')]('phone')[_0xd781('0x6c')](_0xd781('0x5f'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))['from']('cm_hopper_final')[_0xd781('0x39')](_0xd781('0x7d'),_0x23dba5['params']['id'][_0xd781('0x6e')]())[_0xd781('0x39')]('state\x20=\x204'))[_0xd781('0x77')](_0xd781('0x61')))['toString']();return db[_0xd781('0x49')]['query'](_0xaa945b);}return[];})[_0xd781('0x26')](respondWithResult(_0x3e0749,null))[_0xd781('0x3f')](handleError(_0x3e0749,null));};exports[_0xd781('0x7e')]=function(_0x52b9c6,_0x5a2252,_0x356c56){return db[_0xd781('0x7f')]['findOne']({'where':{'VoiceQueueId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x63')],'CampaignId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x7c')],'ContactId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x61')]}})[_0xd781('0x26')](handleEntityNotFound(_0x5a2252,null))[_0xd781('0x26')](function(_0x532fd8){if(_0x532fd8){return _0x532fd8;}return null;})[_0xd781('0x26')](respondWithResult(_0x5a2252,null))[_0xd781('0x3f')](handleError(_0x5a2252,null));}; \ No newline at end of file +var _0x71ab=['json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','map','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','CmHopperFinal','findAll','rows','catch','show','params','rawAttributes','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x203,\x201,\x20null','dropContacts','VoiceQueue','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','VoiceQueueId','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','state','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x2f1214,_0x467ad0){var _0x14f9ba=function(_0x2bcacd){while(--_0x2bcacd){_0x2f1214['push'](_0x2f1214['shift']());}};_0x14f9ba(++_0x467ad0);}(_0x71ab,0x64));var _0xb71a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x71ab[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];function respondWithStatusCode(_0x50030d,_0x50b43b){_0x50b43b=_0x50b43b||0xcc;return function(_0x3346a5){if(_0x3346a5){return _0x50030d[_0xb71a('0x19')](_0x50b43b);}return _0x50030d[_0xb71a('0x1a')](_0x50b43b)[_0xb71a('0x1b')]();};}function respondWithResult(_0x483d77,_0x47ee48){_0x47ee48=_0x47ee48||0xc8;return function(_0x5364e3){if(_0x5364e3){return _0x483d77[_0xb71a('0x1a')](_0x47ee48)[_0xb71a('0x1c')](_0x5364e3);}};}function respondWithFilteredResult(_0x15252a,_0x42fc55){return function(_0x3cd0f0){if(_0x3cd0f0){var _0x1e9363=typeof _0x42fc55[_0xb71a('0x1d')]===_0xb71a('0x1e')&&typeof _0x42fc55[_0xb71a('0x1f')]==='undefined';var _0x1ca65e=_0x3cd0f0[_0xb71a('0x20')];var _0x374c8c=_0x1e9363?0x0:_0x42fc55[_0xb71a('0x1d')];var _0x2bdb61=_0x1e9363?_0x3cd0f0[_0xb71a('0x20')]:_0x42fc55[_0xb71a('0x1d')]+_0x42fc55[_0xb71a('0x1f')];var _0x20bdfe;if(_0x2bdb61>=_0x1ca65e){_0x2bdb61=_0x1ca65e;_0x20bdfe=0xc8;}else{_0x20bdfe=0xce;}_0x15252a[_0xb71a('0x1a')](_0x20bdfe);return _0x15252a[_0xb71a('0x21')]('Content-Range',_0x374c8c+'-'+_0x2bdb61+'/'+_0x1ca65e)['json'](_0x3cd0f0);}return null;};}function patchUpdates(_0x1358f2){return function(_0x578fe4){try{jsonpatch['apply'](_0x578fe4,_0x1358f2,!![]);}catch(_0x4d8871){return BPromise[_0xb71a('0x22')](_0x4d8871);}return _0x578fe4['save']();};}function saveUpdates(_0x76d6dc,_0x4227c7){return function(_0x3ac77b){if(_0x3ac77b){return _0x3ac77b[_0xb71a('0x23')](_0x76d6dc)[_0xb71a('0x24')](function(_0x14b2a1){return _0x14b2a1;});}return null;};}function removeEntity(_0x2f4fac,_0x14aac7){return function(_0x5f3f19){if(_0x5f3f19){return _0x5f3f19[_0xb71a('0x25')]()[_0xb71a('0x24')](function(){_0x2f4fac[_0xb71a('0x1a')](0xcc)[_0xb71a('0x1b')]();});}};}function handleEntityNotFound(_0x3401f7,_0x1a010d){return function(_0x20ed75){if(!_0x20ed75){_0x3401f7[_0xb71a('0x19')](0x194);}return _0x20ed75;};}function handleError(_0x31085b,_0x2a847a){_0x2a847a=_0x2a847a||0x1f4;return function(_0x45b849){logger[_0xb71a('0x26')](_0x45b849[_0xb71a('0x27')]);if(_0x45b849['name']){delete _0x45b849[_0xb71a('0x28')];}_0x31085b[_0xb71a('0x1a')](_0x2a847a)[_0xb71a('0x29')](_0x45b849);};}exports[_0xb71a('0x2a')]=function(_0x2fbd73,_0x38178c){var _0x44826e={},_0x25364c={},_0x42c086={'count':0x0,'rows':[]};var _0x421fcf=_[_0xb71a('0x2b')](db['CmHopperFinal']['rawAttributes'],function(_0x3112d3){return{'name':_0x3112d3['fieldName'],'type':_0x3112d3[_0xb71a('0x2c')][_0xb71a('0x2d')]};});_0x25364c['model']=_[_0xb71a('0x2b')](_0x421fcf,_0xb71a('0x28'));_0x25364c[_0xb71a('0x2e')]=_[_0xb71a('0x2f')](_0x2fbd73[_0xb71a('0x2e')]);_0x25364c[_0xb71a('0x30')]=_['intersection'](_0x25364c[_0xb71a('0x31')],_0x25364c[_0xb71a('0x2e')]);_0x44826e[_0xb71a('0x32')]=_[_0xb71a('0x33')](_0x25364c['model'],qs[_0xb71a('0x34')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x34')]));_0x44826e[_0xb71a('0x32')]=_0x44826e[_0xb71a('0x32')][_0xb71a('0x35')]?_0x44826e[_0xb71a('0x32')]:_0x25364c[_0xb71a('0x31')];if(!_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x36')]('nolimit')){_0x44826e['limit']=qs[_0xb71a('0x1f')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1f')]);_0x44826e[_0xb71a('0x1d')]=qs[_0xb71a('0x1d')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1d')]);}_0x44826e['order']=qs[_0xb71a('0x37')](_0x2fbd73['query'][_0xb71a('0x37')]);_0x44826e[_0xb71a('0x38')]=qs[_0xb71a('0x30')](_[_0xb71a('0x39')](_0x2fbd73['query'],_0x25364c[_0xb71a('0x30')]),_0x421fcf);if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]){_0x44826e[_0xb71a('0x38')]=_[_0xb71a('0x3b')](_0x44826e[_0xb71a('0x38')],{'$or':_[_0xb71a('0x2b')](_0x421fcf,function(_0x2756b9){if(_0x2756b9[_0xb71a('0x2c')]!=='VIRTUAL'){var _0x24a3af={};_0x24a3af[_0x2756b9['name']]={'$like':'%'+_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]+'%'};return _0x24a3af;}})});}_0x44826e=_[_0xb71a('0x3b')]({},_0x44826e,_0x2fbd73[_0xb71a('0x3c')]);var _0xce7b8a={'where':_0x44826e[_0xb71a('0x38')]};return db['CmHopperFinal']['count'](_0xce7b8a)['then'](function(_0x35fea9){_0x42c086['count']=_0x35fea9;if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x44826e[_0xb71a('0x3e')]=[{'all':!![]}];}return db[_0xb71a('0x3f')][_0xb71a('0x40')](_0x44826e);})[_0xb71a('0x24')](function(_0x59530a){_0x42c086[_0xb71a('0x41')]=_0x59530a;return _0x42c086;})[_0xb71a('0x24')](respondWithFilteredResult(_0x38178c,_0x44826e))[_0xb71a('0x42')](handleError(_0x38178c,null));};exports[_0xb71a('0x43')]=function(_0x7d305,_0x2f08d2){var _0x55cbca={'raw':!![],'where':{'id':_0x7d305[_0xb71a('0x44')]['id']}},_0x2afff3={};_0x2afff3[_0xb71a('0x31')]=_[_0xb71a('0x2f')](db[_0xb71a('0x3f')][_0xb71a('0x45')]);_0x2afff3[_0xb71a('0x2e')]=_['keys'](_0x7d305['query']);_0x2afff3[_0xb71a('0x30')]=_[_0xb71a('0x33')](_0x2afff3[_0xb71a('0x31')],_0x2afff3[_0xb71a('0x2e')]);_0x55cbca['attributes']=_[_0xb71a('0x33')](_0x2afff3['model'],qs[_0xb71a('0x34')](_0x7d305[_0xb71a('0x2e')]['fields']));_0x55cbca[_0xb71a('0x32')]=_0x55cbca[_0xb71a('0x32')][_0xb71a('0x35')]?_0x55cbca[_0xb71a('0x32')]:_0x2afff3['model'];if(_0x7d305[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x55cbca[_0xb71a('0x3e')]=[{'all':!![]}];}_0x55cbca=_['merge']({},_0x55cbca,_0x7d305[_0xb71a('0x3c')]);return db[_0xb71a('0x3f')][_0xb71a('0x46')](_0x55cbca)['then'](handleEntityNotFound(_0x2f08d2,null))[_0xb71a('0x24')](respondWithResult(_0x2f08d2,null))[_0xb71a('0x42')](handleError(_0x2f08d2,null));};exports[_0xb71a('0x47')]=function(_0x1f29b7,_0x365bed){return db['CmHopperFinal'][_0xb71a('0x47')]()[_0xb71a('0x24')](respondWithResult(_0x365bed,null))[_0xb71a('0x42')](handleError(_0x365bed,null));};exports[_0xb71a('0x23')]=function(_0x489c1f,_0x48fbde){if(_0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')]){delete _0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')];}return db[_0xb71a('0x3f')][_0xb71a('0x46')]({'where':{'uniqueid':_0x489c1f[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x48fbde,null))[_0xb71a('0x24')](saveUpdates(_0x489c1f[_0xb71a('0x48')],null))['then'](respondWithResult(_0x48fbde,null))[_0xb71a('0x42')](handleError(_0x48fbde,null));};exports[_0xb71a('0x4a')]=function(_0x500196,_0x1c0536,_0x58116c){return db[_0xb71a('0x3f')][_0xb71a('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x500196[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x54')))),'dropContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x55')))),_0xb71a('0x56')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x59')))),_0xb71a('0x5a')]]})['then'](handleEntityNotFound(_0x1c0536,null))[_0xb71a('0x24')](respondWithResult(_0x1c0536,null))[_0xb71a('0x42')](handleError(_0x1c0536,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x181a9f,_0xe55672,_0x38de3a){return db[_0xb71a('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x181a9f[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x5b')))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb71a('0x5c')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x55')))),'abandonedContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x59')))),_0xb71a('0x5a')]]})[_0xb71a('0x24')](handleEntityNotFound(_0xe55672,null))[_0xb71a('0x24')](respondWithResult(_0xe55672,null))['catch'](handleError(_0xe55672,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x15b8be,_0x2dd470,_0x38a8a1){return db[_0xb71a('0x5d')][_0xb71a('0x46')]({'where':{'id':_0x15b8be[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x2dd470,null))['then'](function(_0x45f4b2){var _0x27c15e;if(_0x45f4b2){_0x27c15e=squel['insert']()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),_0xb71a('0x63'),'VoiceQueueId',_0xb71a('0x64'),_0xb71a('0x65')],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),_0xb71a('0x69'))[_0xb71a('0x67')](_0xb71a('0x6a'),'scheduledAt')[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))[_0xb71a('0x67')]('ANY_VALUE(VoiceQueueId)',_0xb71a('0x6d'))['field'](_0xb71a('0x6a'),_0xb71a('0x64'))['field'](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x15b8be[_0xb71a('0x48')]['state'][_0xb71a('0x70')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')]('VoiceQueueId\x20=\x20?',_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel[_0xb71a('0x66')]()[_0xb71a('0x67')]('calleridnum')[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))[_0xb71a('0x70')]();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x27c15e);}return[];})['then'](respondWithResult(_0x2dd470,null))[_0xb71a('0x42')](handleError(_0x2dd470,null));};exports[_0xb71a('0x76')]=function(_0x28bc74,_0x575a0a,_0x1a658e){return db[_0xb71a('0x77')]['find']({'where':{'id':_0x28bc74[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x575a0a,null))[_0xb71a('0x24')](function(_0x21b9b5){var _0x4abfd6;if(_0x21b9b5){_0x4abfd6=squel[_0xb71a('0x78')]()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),'ListId',_0xb71a('0x79'),_0xb71a('0x64'),'updatedAt'],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),'phone')[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x61'))[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))['field']('ANY_VALUE(CampaignId)',_0xb71a('0x79'))[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x64'))[_0xb71a('0x67')](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x28bc74[_0xb71a('0x48')][_0xb71a('0x7a')][_0xb71a('0x70')]())[_0xb71a('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')](_0xb71a('0x7b'),_0x28bc74['params']['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x7c'))[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id']['toString']())[_0xb71a('0x38')](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))['toString']();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x4abfd6);}return[];})[_0xb71a('0x24')](respondWithResult(_0x575a0a,null))[_0xb71a('0x42')](handleError(_0x575a0a,null));};exports[_0xb71a('0x7d')]=function(_0x18dfb3,_0x38ffc1,_0x442ec0){return db[_0xb71a('0x7e')][_0xb71a('0x7f')]({'where':{'VoiceQueueId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x6d')],'CampaignId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x79')],'ContactId':_0x18dfb3[_0xb71a('0x48')]['ContactId']}})[_0xb71a('0x24')](handleEntityNotFound(_0x38ffc1,null))[_0xb71a('0x24')](function(_0x243c90){if(_0x243c90){return _0x243c90;}return null;})['then'](respondWithResult(_0x38ffc1,null))['catch'](handleError(_0x38ffc1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index a48252d..c208141 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 _0x1a75=['moment','bluebird','request-promise','rimraf','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1a75,0x191));var _0x51a7=function(_0x1221b2,_0x5f3e66){_0x1221b2=_0x1221b2-0x0;var _0x17aec4=_0x1a75[_0x1221b2];return _0x17aec4;};'use strict';var _=require(_0x51a7('0x0'));var util=require(_0x51a7('0x1'));var logger=require(_0x51a7('0x2'))(_0x51a7('0x3'));var moment=require(_0x51a7('0x4'));var BPromise=require(_0x51a7('0x5'));var rp=require(_0x51a7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x51a7('0x7'));var config=require('../../config/environment');var attributes=require(_0x51a7('0x8'));module[_0x51a7('0x9')]=function(_0x3891f4,_0x2551e5){return _0x3891f4[_0x51a7('0xa')](_0x51a7('0xb'),attributes,{'tableName':_0x51a7('0xc'),'paranoid':![],'indexes':[{'name':_0x51a7('0xd'),'fields':[_0x51a7('0xd')]},{'name':'uniqueid','fields':[_0x51a7('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2423=['calleridnum','uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final'];(function(_0x31a210,_0x517a46){var _0x1d19d4=function(_0x503c26){while(--_0x503c26){_0x31a210['push'](_0x31a210['shift']());}};_0x1d19d4(++_0x517a46);}(_0x2423,0x161));var _0x3242=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2423[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x3242('0x0'));var logger=require(_0x3242('0x1'))(_0x3242('0x2'));var moment=require(_0x3242('0x3'));var BPromise=require(_0x3242('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3242('0x5'));var rimraf=require(_0x3242('0x6'));var config=require('../../config/environment');var attributes=require(_0x3242('0x7'));module['exports']=function(_0x4c3b6f,_0x53578c){return _0x4c3b6f[_0x3242('0x8')](_0x3242('0x9'),attributes,{'tableName':_0x3242('0xa'),'paranoid':![],'indexes':[{'name':_0x3242('0xb'),'fields':['calleridnum']},{'name':_0x3242('0xc'),'fields':[_0x3242('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index f708499..eaf46bd 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(_0x3dbd94,_0x37cbbb){var _0x48a759=function(_0x3c6ea7){while(--_0x3c6ea7){_0x3dbd94['push'](_0x3dbd94['shift']());}};_0x48a759(++_0x37cbbb);}(_0xb10b,0x12a));var _0xbb10=function(_0x4fa66c,_0x51f9a3){_0x4fa66c=_0x4fa66c-0x0;var _0x9b192b=_0xb10b[_0x4fa66c];return _0x9b192b;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x362cfc,_0x573d26){var _0x4cbb3a=function(_0x41726a){while(--_0x41726a){_0x362cfc['push'](_0x362cfc['shift']());}};_0x4cbb3a(++_0x573d26);}(_0x7a54,0x106));var _0x47a5=function(_0xed0bc2,_0x59da36){_0xed0bc2=_0xed0bc2-0x0;var _0xc6763a=_0x7a54[_0xed0bc2];return _0xc6763a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 71e0f26..19a15e3 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 _0xe413=['/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0xa96306,_0x27a129){var _0x1286f5=function(_0x138f7c){while(--_0x138f7c){_0xa96306['push'](_0xa96306['shift']());}};_0x1286f5(++_0x27a129);}(_0xe413,0xa3));var _0x3e41=function(_0x468d7a,_0x479a12){_0x468d7a=_0x468d7a-0x0;var _0x3c802d=_0xe413[_0x468d7a];return _0x3c802d;};'use strict';var multer=require('multer');var util=require(_0x3e41('0x0'));var path=require('path');var timeout=require(_0x3e41('0x1'));var express=require(_0x3e41('0x2'));var router=express[_0x3e41('0x3')]();var fs_extra=require(_0x3e41('0x4'));var auth=require(_0x3e41('0x5'));var interaction=require(_0x3e41('0x6'));var config=require(_0x3e41('0x7'));var controller=require('./cmHopperFinal.controller');router[_0x3e41('0x8')]('/',auth[_0x3e41('0x9')](),controller[_0x3e41('0xa')]);router['get']('/describe',auth[_0x3e41('0x9')](),controller[_0x3e41('0xb')]);router[_0x3e41('0x8')](_0x3e41('0xc'),auth['isAuthenticated'](),controller[_0x3e41('0xd')]);router[_0x3e41('0x8')](_0x3e41('0xe'),auth[_0x3e41('0x9')](),controller[_0x3e41('0xf')]);router[_0x3e41('0x8')]('/campaign/countAttributes/:id',auth[_0x3e41('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router['post'](_0x3e41('0x10'),auth[_0x3e41('0x9')](),controller[_0x3e41('0x11')]);router[_0x3e41('0x12')](_0x3e41('0x13'),auth[_0x3e41('0x9')](),controller[_0x3e41('0x14')]);router[_0x3e41('0x12')](_0x3e41('0x15'),auth[_0x3e41('0x9')](),controller['checkContactHopper']);router[_0x3e41('0x16')]('/:id',auth[_0x3e41('0x9')](),controller[_0x3e41('0x17')]);module[_0x3e41('0x18')]=router; \ No newline at end of file +var _0x60ee=['/describe','describe','/:id','isAuthenticated','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','put','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index'];(function(_0x3f3571,_0x216802){var _0xa45351=function(_0x39dd47){while(--_0x39dd47){_0x3f3571['push'](_0x3f3571['shift']());}};_0xa45351(++_0x216802);}(_0x60ee,0x113));var _0xe60e=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0x60ee[_0x479160];return _0x47ac6d;};'use strict';var multer=require(_0xe60e('0x0'));var util=require('util');var path=require(_0xe60e('0x1'));var timeout=require(_0xe60e('0x2'));var express=require(_0xe60e('0x3'));var router=express[_0xe60e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe60e('0x5'));var interaction=require(_0xe60e('0x6'));var config=require(_0xe60e('0x7'));var controller=require(_0xe60e('0x8'));router[_0xe60e('0x9')]('/',auth['isAuthenticated'](),controller[_0xe60e('0xa')]);router[_0xe60e('0x9')](_0xe60e('0xb'),auth['isAuthenticated'](),controller[_0xe60e('0xc')]);router[_0xe60e('0x9')](_0xe60e('0xd'),auth[_0xe60e('0xe')](),controller[_0xe60e('0xf')]);router[_0xe60e('0x9')](_0xe60e('0x10'),auth['isAuthenticated'](),controller[_0xe60e('0x11')]);router[_0xe60e('0x9')](_0xe60e('0x12'),auth[_0xe60e('0xe')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xe60e('0x13')](_0xe60e('0x14'),auth[_0xe60e('0xe')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xe60e('0x13')](_0xe60e('0x15'),auth['isAuthenticated'](),controller[_0xe60e('0x16')]);router[_0xe60e('0x13')]('/checkContactHopper',auth[_0xe60e('0xe')](),controller['checkContactHopper']);router[_0xe60e('0x17')](_0xe60e('0xd'),auth['isAuthenticated'](),controller[_0xe60e('0x18')]);module[_0xe60e('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 16bbd65..1b8f79c 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 _0x6de2=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x12a3d5,_0x2d44c5){var _0x425fdd=function(_0x3c0f08){while(--_0x3c0f08){_0x12a3d5['push'](_0x12a3d5['shift']());}};_0x425fdd(++_0x2d44c5);}(_0x6de2,0x152));var _0x26de=function(_0xa077a6,_0x1f0040){_0xa077a6=_0xa077a6-0x0;var _0x5b8330=_0x6de2[_0xa077a6];return _0x5b8330;};'use strict';var Sequelize=require(_0x26de('0x0'));module[_0x26de('0x1')]={'state':{'type':Sequelize[_0x26de('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x26de('0x3')]},'scheduledat':{'type':Sequelize[_0x26de('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x26de('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x26de('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x26de('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x26de('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x26de('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x26de('0x3')]},'calleridname':{'type':Sequelize[_0x26de('0x3')]},'starttime':{'type':Sequelize[_0x26de('0x4')]},'responsetime':{'type':Sequelize[_0x26de('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x26de('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x26de('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x26de('0x3')]},'campaigntype':{'type':Sequelize[_0x26de('0x3')]},'membername':{'type':Sequelize[_0x26de('0x3')]},'reason':{'type':Sequelize[_0x26de('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x26de('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x26de('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x26de('0x4')]},'recallme':{'type':Sequelize[_0x26de('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x26de('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x26de('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x26de('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 +var _0x2e5d=['INTEGER','STRING','DATE','BOOLEAN','exports'];(function(_0x34998f,_0x3296d8){var _0x18534d=function(_0x47f3b7){while(--_0x47f3b7){_0x34998f['push'](_0x34998f['shift']());}};_0x18534d(++_0x3296d8);}(_0x2e5d,0x1c1));var _0xd2e5=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x2e5d[_0x341e0f];return _0x59555a;};'use strict';var Sequelize=require('sequelize');module[_0xd2e5('0x0')]={'state':{'type':Sequelize[_0xd2e5('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xd2e5('0x2')]},'scheduledat':{'type':Sequelize[_0xd2e5('0x3')]},'countbusyretry':{'type':Sequelize[_0xd2e5('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd2e5('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd2e5('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd2e5('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd2e5('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xd2e5('0x2')]},'originatecalleridname':{'type':Sequelize[_0xd2e5('0x2')]},'calleridnum':{'type':Sequelize[_0xd2e5('0x2')]},'calleridname':{'type':Sequelize[_0xd2e5('0x2')]},'starttime':{'type':Sequelize[_0xd2e5('0x3')]},'responsetime':{'type':Sequelize[_0xd2e5('0x3')]},'answertime':{'type':Sequelize[_0xd2e5('0x3')]},'droptime':{'type':Sequelize[_0xd2e5('0x3')]},'endtime':{'type':Sequelize[_0xd2e5('0x3')]},'ringtime':{'type':Sequelize[_0xd2e5('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd2e5('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xd2e5('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd2e5('0x2')]},'campaign':{'type':Sequelize[_0xd2e5('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xd2e5('0x2')]},'reason':{'type':Sequelize[_0xd2e5('0x2')]},'amd':{'type':Sequelize[_0xd2e5('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xd2e5('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd2e5('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd2e5('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xd2e5('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xd2e5('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd2e5('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd2e5('0x1')],'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 b0f9de4..8a0c76c 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 _0x9aa4=['fields','include','find','catch','create','body','describe','uniqueid','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','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','offset','undefined','limit','count','json','apply','destroy','then','error','stack','name','send','index','map','CmHopperHistory','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','rawAttributes'];(function(_0xab39a,_0x9d1016){var _0x17bbe2=function(_0x5b4881){while(--_0x5b4881){_0xab39a['push'](_0xab39a['shift']());}};_0x17bbe2(++_0x9d1016);}(_0x9aa4,0x1c4));var _0x49aa=function(_0x48f3ec,_0x5bb1cb){_0x48f3ec=_0x48f3ec-0x0;var _0x11585f=_0x9aa4[_0x48f3ec];return _0x11585f;};'use strict';var emlformat=require(_0x49aa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x49aa('0x1'));var moment=require(_0x49aa('0x2'));var BPromise=require(_0x49aa('0x3'));var Mustache=require('mustache');var util=require(_0x49aa('0x4'));var path=require(_0x49aa('0x5'));var sox=require(_0x49aa('0x6'));var csv=require(_0x49aa('0x7'));var ejs=require(_0x49aa('0x8'));var fs=require('fs');var fs_extra=require(_0x49aa('0x9'));var _=require(_0x49aa('0xa'));var squel=require(_0x49aa('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x49aa('0xc'));var toCsv=require(_0x49aa('0x7'));var querystring=require(_0x49aa('0xd'));var Papa=require(_0x49aa('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49aa('0xf'));var as=require(_0x49aa('0x10'));var hardwareService=require(_0x49aa('0x11'));var logger=require(_0x49aa('0x12'))(_0x49aa('0x13'));var utils=require(_0x49aa('0x14'));var config=require(_0x49aa('0x15'));var licenseUtil=require(_0x49aa('0x16'));var db=require(_0x49aa('0x17'))['db'];function respondWithStatusCode(_0x3c8caf,_0x23753f){_0x23753f=_0x23753f||0xcc;return function(_0x5ed5be){if(_0x5ed5be){return _0x3c8caf[_0x49aa('0x18')](_0x23753f);}return _0x3c8caf[_0x49aa('0x19')](_0x23753f)[_0x49aa('0x1a')]();};}function respondWithResult(_0x227063,_0x4a61c1){_0x4a61c1=_0x4a61c1||0xc8;return function(_0x288139){if(_0x288139){return _0x227063[_0x49aa('0x19')](_0x4a61c1)['json'](_0x288139);}};}function respondWithFilteredResult(_0x449303,_0x3db3bc){return function(_0x3cc2c9){if(_0x3cc2c9){var _0x7d70a2=typeof _0x3db3bc[_0x49aa('0x1b')]===_0x49aa('0x1c')&&typeof _0x3db3bc[_0x49aa('0x1d')]===_0x49aa('0x1c');var _0x477c50=_0x3cc2c9[_0x49aa('0x1e')];var _0x3c1c1f=_0x7d70a2?0x0:_0x3db3bc[_0x49aa('0x1b')];var _0x280c5e=_0x7d70a2?_0x3cc2c9[_0x49aa('0x1e')]:_0x3db3bc[_0x49aa('0x1b')]+_0x3db3bc[_0x49aa('0x1d')];var _0x19397d;if(_0x280c5e>=_0x477c50){_0x280c5e=_0x477c50;_0x19397d=0xc8;}else{_0x19397d=0xce;}_0x449303[_0x49aa('0x19')](_0x19397d);return _0x449303['set']('Content-Range',_0x3c1c1f+'-'+_0x280c5e+'/'+_0x477c50)[_0x49aa('0x1f')](_0x3cc2c9);}return null;};}function patchUpdates(_0x28ede5){return function(_0x2cf335){try{jsonpatch[_0x49aa('0x20')](_0x2cf335,_0x28ede5,!![]);}catch(_0x2af324){return BPromise['reject'](_0x2af324);}return _0x2cf335['save']();};}function saveUpdates(_0x118488,_0x351dcd){return function(_0x27adf4){if(_0x27adf4){return _0x27adf4['update'](_0x118488)['then'](function(_0x2a5865){return _0x2a5865;});}return null;};}function removeEntity(_0x299b53,_0x7383cc){return function(_0x389a83){if(_0x389a83){return _0x389a83[_0x49aa('0x21')]()[_0x49aa('0x22')](function(){_0x299b53['status'](0xcc)[_0x49aa('0x1a')]();});}};}function handleEntityNotFound(_0xc7d408,_0x618518){return function(_0x48de55){if(!_0x48de55){_0xc7d408[_0x49aa('0x18')](0x194);}return _0x48de55;};}function handleError(_0x41531d,_0x348870){_0x348870=_0x348870||0x1f4;return function(_0x11e164){logger[_0x49aa('0x23')](_0x11e164[_0x49aa('0x24')]);if(_0x11e164[_0x49aa('0x25')]){delete _0x11e164[_0x49aa('0x25')];}_0x41531d[_0x49aa('0x19')](_0x348870)[_0x49aa('0x26')](_0x11e164);};}exports[_0x49aa('0x27')]=function(_0x2b5151,_0x4a96c5){var _0x1804cf={},_0x5e9b77={},_0x43dc07={'count':0x0,'rows':[]};var _0x55e570=_[_0x49aa('0x28')](db[_0x49aa('0x29')]['rawAttributes'],function(_0x131acd){return{'name':_0x131acd[_0x49aa('0x2a')],'type':_0x131acd[_0x49aa('0x2b')][_0x49aa('0x2c')]};});_0x5e9b77[_0x49aa('0x2d')]=_[_0x49aa('0x28')](_0x55e570,_0x49aa('0x25'));_0x5e9b77[_0x49aa('0x2e')]=_[_0x49aa('0x2f')](_0x2b5151[_0x49aa('0x2e')]);_0x5e9b77[_0x49aa('0x30')]=_[_0x49aa('0x31')](_0x5e9b77['model'],_0x5e9b77[_0x49aa('0x2e')]);_0x1804cf['attributes']=_[_0x49aa('0x31')](_0x5e9b77[_0x49aa('0x2d')],qs['fields'](_0x2b5151['query']['fields']));_0x1804cf[_0x49aa('0x32')]=_0x1804cf[_0x49aa('0x32')][_0x49aa('0x33')]?_0x1804cf[_0x49aa('0x32')]:_0x5e9b77[_0x49aa('0x2d')];if(!_0x2b5151[_0x49aa('0x2e')]['hasOwnProperty'](_0x49aa('0x34'))){_0x1804cf[_0x49aa('0x1d')]=qs[_0x49aa('0x1d')](_0x2b5151[_0x49aa('0x2e')][_0x49aa('0x1d')]);_0x1804cf[_0x49aa('0x1b')]=qs[_0x49aa('0x1b')](_0x2b5151[_0x49aa('0x2e')][_0x49aa('0x1b')]);}_0x1804cf[_0x49aa('0x35')]=qs[_0x49aa('0x36')](_0x2b5151[_0x49aa('0x2e')][_0x49aa('0x36')]);_0x1804cf[_0x49aa('0x37')]=qs[_0x49aa('0x30')](_[_0x49aa('0x38')](_0x2b5151['query'],_0x5e9b77[_0x49aa('0x30')]),_0x55e570);if(_0x2b5151[_0x49aa('0x2e')][_0x49aa('0x39')]){_0x1804cf[_0x49aa('0x37')]=_[_0x49aa('0x3a')](_0x1804cf[_0x49aa('0x37')],{'$or':_[_0x49aa('0x28')](_0x55e570,function(_0x300dcd){if(_0x300dcd[_0x49aa('0x2b')]!==_0x49aa('0x3b')){var _0x18867d={};_0x18867d[_0x300dcd['name']]={'$like':'%'+_0x2b5151[_0x49aa('0x2e')][_0x49aa('0x39')]+'%'};return _0x18867d;}})});}_0x1804cf=_[_0x49aa('0x3a')]({},_0x1804cf,_0x2b5151[_0x49aa('0x3c')]);var _0x1b7747={'where':_0x1804cf[_0x49aa('0x37')]};return db[_0x49aa('0x29')][_0x49aa('0x1e')](_0x1b7747)[_0x49aa('0x22')](function(_0x8331b4){_0x43dc07[_0x49aa('0x1e')]=_0x8331b4;if(_0x2b5151[_0x49aa('0x2e')]['includeAll']){_0x1804cf['include']=[{'all':!![]}];}return db[_0x49aa('0x29')][_0x49aa('0x3d')](_0x1804cf);})[_0x49aa('0x22')](function(_0x1c54e3){_0x43dc07[_0x49aa('0x3e')]=_0x1c54e3;return _0x43dc07;})[_0x49aa('0x22')](respondWithFilteredResult(_0x4a96c5,_0x1804cf))['catch'](handleError(_0x4a96c5,null));};exports[_0x49aa('0x3f')]=function(_0x2941d0,_0x972f14){var _0x278fff={'raw':!![],'where':{'id':_0x2941d0[_0x49aa('0x40')]['id']}},_0x55f6a6={};_0x55f6a6[_0x49aa('0x2d')]=_[_0x49aa('0x2f')](db[_0x49aa('0x29')][_0x49aa('0x41')]);_0x55f6a6[_0x49aa('0x2e')]=_[_0x49aa('0x2f')](_0x2941d0[_0x49aa('0x2e')]);_0x55f6a6[_0x49aa('0x30')]=_['intersection'](_0x55f6a6['model'],_0x55f6a6[_0x49aa('0x2e')]);_0x278fff[_0x49aa('0x32')]=_[_0x49aa('0x31')](_0x55f6a6[_0x49aa('0x2d')],qs[_0x49aa('0x42')](_0x2941d0[_0x49aa('0x2e')][_0x49aa('0x42')]));_0x278fff[_0x49aa('0x32')]=_0x278fff[_0x49aa('0x32')][_0x49aa('0x33')]?_0x278fff[_0x49aa('0x32')]:_0x55f6a6['model'];if(_0x2941d0[_0x49aa('0x2e')]['includeAll']){_0x278fff[_0x49aa('0x43')]=[{'all':!![]}];}_0x278fff=_[_0x49aa('0x3a')]({},_0x278fff,_0x2941d0[_0x49aa('0x3c')]);return db[_0x49aa('0x29')][_0x49aa('0x44')](_0x278fff)[_0x49aa('0x22')](handleEntityNotFound(_0x972f14,null))[_0x49aa('0x22')](respondWithResult(_0x972f14,null))[_0x49aa('0x45')](handleError(_0x972f14,null));};exports[_0x49aa('0x46')]=function(_0x2fe9b0,_0x2ba5ab){return db[_0x49aa('0x29')]['create'](_0x2fe9b0[_0x49aa('0x47')],{})[_0x49aa('0x22')](respondWithResult(_0x2ba5ab,0xc9))[_0x49aa('0x45')](handleError(_0x2ba5ab,null));};exports[_0x49aa('0x48')]=function(_0x151f04,_0x1a5b72){return db[_0x49aa('0x29')][_0x49aa('0x48')]()[_0x49aa('0x22')](respondWithResult(_0x1a5b72,null))['catch'](handleError(_0x1a5b72,null));};exports['update']=function(_0x2f5e94,_0x1df937){if(_0x2f5e94[_0x49aa('0x47')][_0x49aa('0x49')]){delete _0x2f5e94[_0x49aa('0x47')][_0x49aa('0x49')];}return db['CmHopperHistory'][_0x49aa('0x44')]({'where':{'uniqueid':_0x2f5e94[_0x49aa('0x40')]['id']}})[_0x49aa('0x22')](handleEntityNotFound(_0x1df937,null))['then'](saveUpdates(_0x2f5e94[_0x49aa('0x47')],null))[_0x49aa('0x22')](respondWithResult(_0x1df937,null))[_0x49aa('0x45')](handleError(_0x1df937,null));}; \ No newline at end of file +var _0xd50d=['attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','includeAll','include','findAll','rows','catch','params','keys','options','find','create','describe','update','uniqueid','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','error','stack','send','index','CmHopperHistory','fieldName','type','model','map','query','fields'];(function(_0x4138f1,_0xfbcb0e){var _0x2e7002=function(_0x2192c6){while(--_0x2192c6){_0x4138f1['push'](_0x4138f1['shift']());}};_0x2e7002(++_0xfbcb0e);}(_0xd50d,0x154));var _0xdd50=function(_0x16d02b,_0x4a81e9){_0x16d02b=_0x16d02b-0x0;var _0x50646a=_0xd50d[_0x16d02b];return _0x50646a;};'use strict';var emlformat=require(_0xdd50('0x0'));var rimraf=require(_0xdd50('0x1'));var zipdir=require(_0xdd50('0x2'));var jsonpatch=require(_0xdd50('0x3'));var rp=require(_0xdd50('0x4'));var moment=require(_0xdd50('0x5'));var BPromise=require(_0xdd50('0x6'));var Mustache=require(_0xdd50('0x7'));var util=require('util');var path=require(_0xdd50('0x8'));var sox=require(_0xdd50('0x9'));var csv=require(_0xdd50('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd50('0xb'));var _=require(_0xdd50('0xc'));var squel=require(_0xdd50('0xd'));var crypto=require(_0xdd50('0xe'));var jsforce=require(_0xdd50('0xf'));var deskjs=require(_0xdd50('0x10'));var toCsv=require(_0xdd50('0xa'));var querystring=require(_0xdd50('0x11'));var Papa=require(_0xdd50('0x12'));var Redis=require(_0xdd50('0x13'));var authService=require(_0xdd50('0x14'));var qs=require(_0xdd50('0x15'));var as=require(_0xdd50('0x16'));var hardwareService=require(_0xdd50('0x17'));var logger=require(_0xdd50('0x18'))(_0xdd50('0x19'));var utils=require(_0xdd50('0x1a'));var config=require(_0xdd50('0x1b'));var licenseUtil=require(_0xdd50('0x1c'));var db=require(_0xdd50('0x1d'))['db'];function respondWithStatusCode(_0x438b01,_0x1583ff){_0x1583ff=_0x1583ff||0xcc;return function(_0x3c7f0e){if(_0x3c7f0e){return _0x438b01[_0xdd50('0x1e')](_0x1583ff);}return _0x438b01[_0xdd50('0x1f')](_0x1583ff)[_0xdd50('0x20')]();};}function respondWithResult(_0x39b7cb,_0x5e7720){_0x5e7720=_0x5e7720||0xc8;return function(_0x1edfb2){if(_0x1edfb2){return _0x39b7cb[_0xdd50('0x1f')](_0x5e7720)[_0xdd50('0x21')](_0x1edfb2);}};}function respondWithFilteredResult(_0x4035ee,_0x4ff0bd){return function(_0x5d9115){if(_0x5d9115){var _0x3b534=typeof _0x4ff0bd['offset']===_0xdd50('0x22')&&typeof _0x4ff0bd[_0xdd50('0x23')]==='undefined';var _0x1c8616=_0x5d9115[_0xdd50('0x24')];var _0x51d35e=_0x3b534?0x0:_0x4ff0bd[_0xdd50('0x25')];var _0x23d548=_0x3b534?_0x5d9115[_0xdd50('0x24')]:_0x4ff0bd[_0xdd50('0x25')]+_0x4ff0bd[_0xdd50('0x23')];var _0x346ab6;if(_0x23d548>=_0x1c8616){_0x23d548=_0x1c8616;_0x346ab6=0xc8;}else{_0x346ab6=0xce;}_0x4035ee[_0xdd50('0x1f')](_0x346ab6);return _0x4035ee[_0xdd50('0x26')](_0xdd50('0x27'),_0x51d35e+'-'+_0x23d548+'/'+_0x1c8616)[_0xdd50('0x21')](_0x5d9115);}return null;};}function patchUpdates(_0x3633c1){return function(_0x38ea14){try{jsonpatch[_0xdd50('0x28')](_0x38ea14,_0x3633c1,!![]);}catch(_0x49142a){return BPromise[_0xdd50('0x29')](_0x49142a);}return _0x38ea14[_0xdd50('0x2a')]();};}function saveUpdates(_0x34a07a,_0xb0ff){return function(_0x30fdf6){if(_0x30fdf6){return _0x30fdf6['update'](_0x34a07a)[_0xdd50('0x2b')](function(_0x4ea845){return _0x4ea845;});}return null;};}function removeEntity(_0x160ac2,_0x173dc8){return function(_0x56c86f){if(_0x56c86f){return _0x56c86f['destroy']()['then'](function(){_0x160ac2[_0xdd50('0x1f')](0xcc)[_0xdd50('0x20')]();});}};}function handleEntityNotFound(_0x496874,_0x4cdfb2){return function(_0x3819e3){if(!_0x3819e3){_0x496874[_0xdd50('0x1e')](0x194);}return _0x3819e3;};}function handleError(_0x140899,_0xdd2b54){_0xdd2b54=_0xdd2b54||0x1f4;return function(_0x25e91a){logger[_0xdd50('0x2c')](_0x25e91a[_0xdd50('0x2d')]);if(_0x25e91a['name']){delete _0x25e91a['name'];}_0x140899[_0xdd50('0x1f')](_0xdd2b54)[_0xdd50('0x2e')](_0x25e91a);};}exports[_0xdd50('0x2f')]=function(_0x8eef4e,_0x7c604b){var _0x5d558a={},_0x594ab5={},_0x1d93d5={'count':0x0,'rows':[]};var _0x9e3cb4=_['map'](db[_0xdd50('0x30')]['rawAttributes'],function(_0x57d31a){return{'name':_0x57d31a[_0xdd50('0x31')],'type':_0x57d31a[_0xdd50('0x32')]['key']};});_0x594ab5[_0xdd50('0x33')]=_[_0xdd50('0x34')](_0x9e3cb4,'name');_0x594ab5[_0xdd50('0x35')]=_['keys'](_0x8eef4e['query']);_0x594ab5['filters']=_['intersection'](_0x594ab5[_0xdd50('0x33')],_0x594ab5[_0xdd50('0x35')]);_0x5d558a['attributes']=_['intersection'](_0x594ab5[_0xdd50('0x33')],qs[_0xdd50('0x36')](_0x8eef4e['query'][_0xdd50('0x36')]));_0x5d558a[_0xdd50('0x37')]=_0x5d558a['attributes'][_0xdd50('0x38')]?_0x5d558a[_0xdd50('0x37')]:_0x594ab5[_0xdd50('0x33')];if(!_0x8eef4e[_0xdd50('0x35')]['hasOwnProperty'](_0xdd50('0x39'))){_0x5d558a[_0xdd50('0x23')]=qs[_0xdd50('0x23')](_0x8eef4e['query'][_0xdd50('0x23')]);_0x5d558a[_0xdd50('0x25')]=qs[_0xdd50('0x25')](_0x8eef4e[_0xdd50('0x35')][_0xdd50('0x25')]);}_0x5d558a[_0xdd50('0x3a')]=qs['sort'](_0x8eef4e[_0xdd50('0x35')][_0xdd50('0x3b')]);_0x5d558a['where']=qs[_0xdd50('0x3c')](_[_0xdd50('0x3d')](_0x8eef4e[_0xdd50('0x35')],_0x594ab5[_0xdd50('0x3c')]),_0x9e3cb4);if(_0x8eef4e[_0xdd50('0x35')][_0xdd50('0x3e')]){_0x5d558a[_0xdd50('0x3f')]=_[_0xdd50('0x40')](_0x5d558a['where'],{'$or':_['map'](_0x9e3cb4,function(_0x1ab989){if(_0x1ab989[_0xdd50('0x32')]!=='VIRTUAL'){var _0x81d2={};_0x81d2[_0x1ab989['name']]={'$like':'%'+_0x8eef4e[_0xdd50('0x35')][_0xdd50('0x3e')]+'%'};return _0x81d2;}})});}_0x5d558a=_[_0xdd50('0x40')]({},_0x5d558a,_0x8eef4e['options']);var _0x22eca9={'where':_0x5d558a[_0xdd50('0x3f')]};return db[_0xdd50('0x30')][_0xdd50('0x24')](_0x22eca9)[_0xdd50('0x2b')](function(_0x532aaa){_0x1d93d5[_0xdd50('0x24')]=_0x532aaa;if(_0x8eef4e[_0xdd50('0x35')][_0xdd50('0x41')]){_0x5d558a[_0xdd50('0x42')]=[{'all':!![]}];}return db[_0xdd50('0x30')][_0xdd50('0x43')](_0x5d558a);})[_0xdd50('0x2b')](function(_0x15ef47){_0x1d93d5[_0xdd50('0x44')]=_0x15ef47;return _0x1d93d5;})[_0xdd50('0x2b')](respondWithFilteredResult(_0x7c604b,_0x5d558a))[_0xdd50('0x45')](handleError(_0x7c604b,null));};exports['show']=function(_0x157f54,_0x58723d){var _0x3a8312={'raw':!![],'where':{'id':_0x157f54[_0xdd50('0x46')]['id']}},_0x10b334={};_0x10b334[_0xdd50('0x33')]=_[_0xdd50('0x47')](db[_0xdd50('0x30')]['rawAttributes']);_0x10b334[_0xdd50('0x35')]=_[_0xdd50('0x47')](_0x157f54[_0xdd50('0x35')]);_0x10b334[_0xdd50('0x3c')]=_['intersection'](_0x10b334[_0xdd50('0x33')],_0x10b334[_0xdd50('0x35')]);_0x3a8312[_0xdd50('0x37')]=_['intersection'](_0x10b334['model'],qs[_0xdd50('0x36')](_0x157f54['query'][_0xdd50('0x36')]));_0x3a8312[_0xdd50('0x37')]=_0x3a8312['attributes']['length']?_0x3a8312[_0xdd50('0x37')]:_0x10b334[_0xdd50('0x33')];if(_0x157f54[_0xdd50('0x35')][_0xdd50('0x41')]){_0x3a8312[_0xdd50('0x42')]=[{'all':!![]}];}_0x3a8312=_[_0xdd50('0x40')]({},_0x3a8312,_0x157f54[_0xdd50('0x48')]);return db[_0xdd50('0x30')][_0xdd50('0x49')](_0x3a8312)['then'](handleEntityNotFound(_0x58723d,null))[_0xdd50('0x2b')](respondWithResult(_0x58723d,null))[_0xdd50('0x45')](handleError(_0x58723d,null));};exports[_0xdd50('0x4a')]=function(_0x730921,_0x57c066){return db[_0xdd50('0x30')][_0xdd50('0x4a')](_0x730921['body'],{})[_0xdd50('0x2b')](respondWithResult(_0x57c066,0xc9))[_0xdd50('0x45')](handleError(_0x57c066,null));};exports[_0xdd50('0x4b')]=function(_0x2fa43e,_0x642841){return db[_0xdd50('0x30')][_0xdd50('0x4b')]()[_0xdd50('0x2b')](respondWithResult(_0x642841,null))['catch'](handleError(_0x642841,null));};exports[_0xdd50('0x4c')]=function(_0xe77d40,_0x578408){if(_0xe77d40['body'][_0xdd50('0x4d')]){delete _0xe77d40[_0xdd50('0x4e')][_0xdd50('0x4d')];}return db[_0xdd50('0x30')]['find']({'where':{'uniqueid':_0xe77d40[_0xdd50('0x46')]['id']}})[_0xdd50('0x2b')](handleEntityNotFound(_0x578408,null))[_0xdd50('0x2b')](saveUpdates(_0xe77d40[_0xdd50('0x4e')],null))[_0xdd50('0x2b')](respondWithResult(_0x578408,null))[_0xdd50('0x45')](handleError(_0x578408,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 390d1b5..bd3e99f 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 _0x69d4=['uniqueid','lodash','util','api','moment','bluebird','path','../../config/environment','./cmHopperHistory.attributes','exports','define','cm_hopper_history','endtime'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x69d4,0x83));var _0x469d=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0x69d4[_0x16db8b];return _0x5ba017;};'use strict';var _=require(_0x469d('0x0'));var util=require(_0x469d('0x1'));var logger=require('../../config/logger')(_0x469d('0x2'));var moment=require(_0x469d('0x3'));var BPromise=require(_0x469d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x469d('0x5'));var rimraf=require('rimraf');var config=require(_0x469d('0x6'));var attributes=require(_0x469d('0x7'));module[_0x469d('0x8')]=function(_0x336101,_0x3d0ec8){return _0x336101[_0x469d('0x9')]('CmHopperHistory',attributes,{'tableName':_0x469d('0xa'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x469d('0xb')]},{'name':_0x469d('0xc'),'fields':[_0x469d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6822=['request-promise','path','rimraf','./cmHopperHistory.attributes','define','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xd0cd0b,_0x490956){var _0x59cced=function(_0x567251){while(--_0x567251){_0xd0cd0b['push'](_0xd0cd0b['shift']());}};_0x59cced(++_0x490956);}(_0x6822,0xca));var _0x2682=function(_0x5b8b8d,_0x3d01b8){_0x5b8b8d=_0x5b8b8d-0x0;var _0x6c584b=_0x6822[_0x5b8b8d];return _0x6c584b;};'use strict';var _=require(_0x2682('0x0'));var util=require(_0x2682('0x1'));var logger=require(_0x2682('0x2'))(_0x2682('0x3'));var moment=require(_0x2682('0x4'));var BPromise=require(_0x2682('0x5'));var rp=require(_0x2682('0x6'));var fs=require('fs');var path=require(_0x2682('0x7'));var rimraf=require(_0x2682('0x8'));var config=require('../../config/environment');var attributes=require(_0x2682('0x9'));module['exports']=function(_0x30fcd9,_0x39d4f7){return _0x30fcd9[_0x2682('0xa')]('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x2682('0xb')]},{'name':_0x2682('0xc'),'fields':[_0x2682('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index aa1a0c9..6391698 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 _0x4bd1=['`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','create','body','options','info','CreateCmHopperHistory','stringify','AvgHandleTime','CmHopperHistory','findAll','raw','where','COUNT','sequelize','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\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'];(function(_0x2498b5,_0x514ddb){var _0x5c48d8=function(_0xee9bb5){while(--_0xee9bb5){_0x2498b5['push'](_0x2498b5['shift']());}};_0x5c48d8(++_0x514ddb);}(_0x4bd1,0x90));var _0x14bd=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x4bd1[_0x75f869];return _0x10af8b;};'use strict';var _=require('lodash');var util=require(_0x14bd('0x0'));var moment=require('moment');var BPromise=require(_0x14bd('0x1'));var rs=require(_0x14bd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14bd('0x3'))['db'];var utils=require(_0x14bd('0x4'));var logger=require('../../config/logger')(_0x14bd('0x5'));var config=require(_0x14bd('0x6'));var jayson=require(_0x14bd('0x7'));var client=jayson[_0x14bd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35806e,_0x2cec06,_0xb06dbf){return new BPromise(function(_0x2e9a2f,_0x302ffa){return client[_0x14bd('0x9')](_0x35806e,_0xb06dbf)[_0x14bd('0xa')](function(_0x4193ff){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x2cec06,'request\x20sent');logger[_0x14bd('0xb')](_0x14bd('0xc'),_0x2cec06,_0x14bd('0xd'),JSON['stringify'](_0x4193ff));if(_0x4193ff[_0x14bd('0xe')]){if(_0x4193ff[_0x14bd('0xe')][_0x14bd('0xf')]===0x1f4){logger[_0x14bd('0xe')](_0x14bd('0x10'),_0x2cec06,_0x4193ff[_0x14bd('0xe')][_0x14bd('0x11')]);return _0x302ffa(_0x4193ff[_0x14bd('0xe')]['message']);}logger[_0x14bd('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x2cec06,_0x4193ff[_0x14bd('0xe')]['message']);return _0x2e9a2f(_0x4193ff[_0x14bd('0xe')][_0x14bd('0x11')]);}else{logger['info'](_0x14bd('0x10'),_0x2cec06,'request\x20sent');_0x2e9a2f(_0x4193ff[_0x14bd('0x12')][_0x14bd('0x11')]);}})[_0x14bd('0x13')](function(_0x1853ba){logger[_0x14bd('0xe')](_0x14bd('0x10'),_0x2cec06,_0x1853ba);_0x302ffa(_0x1853ba);});});}exports['CreateCmHopperHistory']=function(_0x5c8064){var _0x1f1349=this;return new Promise(function(_0x18c473,_0x582543){return db['CmHopperHistory'][_0x14bd('0x14')](_0x5c8064[_0x14bd('0x15')],{'raw':_0x5c8064['options']?_0x5c8064[_0x14bd('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x14bd('0xa')](function(_0x568a21){logger[_0x14bd('0x17')]('CreateCmHopperHistory',_0x5c8064);logger[_0x14bd('0xb')](_0x14bd('0x18'),_0x5c8064,JSON[_0x14bd('0x19')](_0x568a21));_0x18c473(_0x568a21);})['catch'](function(_0x253e93){logger[_0x14bd('0xe')](_0x14bd('0x18'),_0x253e93['message'],_0x5c8064);_0x582543(_0x1f1349[_0x14bd('0xe')](0x1f4,_0x253e93[_0x14bd('0x11')]));});});};exports[_0x14bd('0x1a')]=function(_0x4afb0e){var _0x58a44c=this;return new Promise(function(_0x57f123,_0x2495d2){return db[_0x14bd('0x1b')][_0x14bd('0x1c')]({'raw':_0x4afb0e[_0x14bd('0x16')]?_0x4afb0e[_0x14bd('0x16')][_0x14bd('0x1d')]===undefined?!![]:![]:!![],'where':_0x4afb0e[_0x14bd('0x16')]?_0x4afb0e[_0x14bd('0x16')][_0x14bd('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0x14bd('0x1f'),db[_0x14bd('0x20')]['col']('id')),_0x14bd('0x21')],[db['sequelize']['fn']('COUNT',db[_0x14bd('0x20')]['fn']('IF',db[_0x14bd('0x20')][_0x14bd('0x22')](_0x14bd('0x23')))),'predictiveIntervalAnsweredCalls'],[db[_0x14bd('0x20')]['fn'](_0x14bd('0x1f'),db[_0x14bd('0x20')]['fn']('IF',db[_0x14bd('0x20')][_0x14bd('0x22')](_0x14bd('0x24')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x14bd('0x20')]['fn']('COUNT',db[_0x14bd('0x20')]['fn']('IF',db[_0x14bd('0x20')][_0x14bd('0x22')](_0x14bd('0x25')))),_0x14bd('0x26')],[db[_0x14bd('0x20')]['fn'](_0x14bd('0x27'),db[_0x14bd('0x20')]['fn']('IF',db[_0x14bd('0x20')][_0x14bd('0x22')](_0x14bd('0x28')))),_0x14bd('0x29')],[db[_0x14bd('0x20')]['fn'](_0x14bd('0x27'),db[_0x14bd('0x20')]['fn']('IF',db['sequelize'][_0x14bd('0x22')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x14bd('0x2a')]]})[_0x14bd('0xa')](function(_0x5f09ae){logger[_0x14bd('0x17')](_0x14bd('0x1a'),_0x4afb0e);logger[_0x14bd('0xb')](_0x14bd('0x1a'),_0x4afb0e,JSON['stringify'](_0x5f09ae));_0x57f123(_0x5f09ae);})[_0x14bd('0x13')](function(_0x1d928d){logger['error'](_0x14bd('0x1a'),_0x1d928d[_0x14bd('0x11')],_0x4afb0e);_0x2495d2(_0x58a44c['error'](0x1f4,_0x1d928d['message']));});});};exports[_0x14bd('0x2b')]=function(_0x579e98){var _0x1920d0=this;return new Promise(function(_0x2e3012,_0x3d33dd){return db[_0x14bd('0x1b')][_0x14bd('0x1c')]({'raw':_0x579e98['options']?_0x579e98[_0x14bd('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x579e98[_0x14bd('0x16')]?_0x579e98['options'][_0x14bd('0x1e')]||null:null,'attributes':[['campaign',_0x14bd('0x2c')],[db['sequelize']['fn'](_0x14bd('0x1f'),db[_0x14bd('0x20')]['fn']('IF',db[_0x14bd('0x20')][_0x14bd('0x22')](_0x14bd('0x2d')))),_0x14bd('0x2e')],[db[_0x14bd('0x20')]['fn'](_0x14bd('0x1f'),db[_0x14bd('0x20')]['fn']('IF',db[_0x14bd('0x20')][_0x14bd('0x22')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x14bd('0x20')]['fn']('IF',db[_0x14bd('0x20')]['literal'](_0x14bd('0x23')))),_0x14bd('0x2f')],[db['sequelize']['fn'](_0x14bd('0x1f'),db[_0x14bd('0x20')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x14bd('0x30')],[db[_0x14bd('0x20')]['fn']('COUNT',db[_0x14bd('0x20')]['fn']('IF',db['sequelize']['literal'](_0x14bd('0x31')))),_0x14bd('0x32')],[db[_0x14bd('0x20')]['fn']('COUNT',db[_0x14bd('0x20')]['fn']('IF',db[_0x14bd('0x20')]['literal'](_0x14bd('0x33')))),_0x14bd('0x34')],[db[_0x14bd('0x20')]['fn']('COUNT',db[_0x14bd('0x20')]['fn']('IF',db[_0x14bd('0x20')][_0x14bd('0x22')](_0x14bd('0x35')))),'outboundDropCallsDayCallersExit'],[db[_0x14bd('0x20')]['fn'](_0x14bd('0x1f'),db[_0x14bd('0x20')]['fn']('IF',db['sequelize'][_0x14bd('0x22')](_0x14bd('0x36')))),_0x14bd('0x37')],[db[_0x14bd('0x20')]['fn'](_0x14bd('0x1f'),db[_0x14bd('0x20')]['fn']('IF',db[_0x14bd('0x20')][_0x14bd('0x22')](_0x14bd('0x38')))),_0x14bd('0x39')],[db[_0x14bd('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x14bd('0x22')](_0x14bd('0x3a')))),_0x14bd('0x3b')],[db['sequelize']['fn'](_0x14bd('0x1f'),db[_0x14bd('0x20')]['fn']('IF',db['sequelize']['literal'](_0x14bd('0x3c')))),_0x14bd('0x3d')],[db['sequelize']['fn']('COUNT',db[_0x14bd('0x20')]['fn']('IF',db[_0x14bd('0x20')][_0x14bd('0x22')](_0x14bd('0x3e')))),'outboundAnswerAgiCallsDay'],[db[_0x14bd('0x20')]['fn']('COUNT',db[_0x14bd('0x20')]['fn']('IF',db[_0x14bd('0x20')][_0x14bd('0x22')](_0x14bd('0x3f')))),_0x14bd('0x3d')],[db[_0x14bd('0x20')]['fn'](_0x14bd('0x1f'),db[_0x14bd('0x20')]['fn']('IF',db['sequelize'][_0x14bd('0x22')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x14bd('0x40')]],'group':[_0x14bd('0x41')]})[_0x14bd('0xa')](function(_0x4a89af){logger[_0x14bd('0x17')](_0x14bd('0x2b'),_0x579e98);logger[_0x14bd('0xb')](_0x14bd('0x2b'),_0x579e98,JSON['stringify'](_0x4a89af));_0x2e3012(_0x4a89af);})[_0x14bd('0x13')](function(_0x405756){logger[_0x14bd('0xe')](_0x14bd('0x2b'),_0x405756['message'],_0x579e98);_0x3d33dd(_0x1920d0['error'](0x1f4,_0x405756['message']));});});};exports[_0x14bd('0x42')]=function(_0xdac73a){var _0x424e49=this;return new Promise(function(_0x268e38,_0x354acd){return db[_0x14bd('0x1b')][_0x14bd('0x1c')]({'raw':_0xdac73a[_0x14bd('0x16')]?_0xdac73a[_0x14bd('0x16')][_0x14bd('0x1d')]===undefined?!![]:![]:!![],'where':_0xdac73a[_0x14bd('0x16')]?_0xdac73a[_0x14bd('0x16')][_0x14bd('0x1e')]||null:null,'attributes':[[_0x14bd('0x41'),_0x14bd('0x2c')],[db['sequelize']['fn'](_0x14bd('0x1f'),db[_0x14bd('0x20')]['col']('id')),_0x14bd('0x43')],[db[_0x14bd('0x20')]['fn'](_0x14bd('0x1f'),db[_0x14bd('0x20')]['fn']('IF',db[_0x14bd('0x20')][_0x14bd('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0x14bd('0x44')]],'group':[_0x14bd('0x41')]})[_0x14bd('0xa')](function(_0x1bb961){logger[_0x14bd('0x17')](_0x14bd('0x42'),_0xdac73a);logger[_0x14bd('0xb')]('GetCampaignHopperHistory',_0xdac73a,JSON[_0x14bd('0x19')](_0x1bb961));_0x268e38(_0x1bb961);})[_0x14bd('0x13')](function(_0x5d6331){logger[_0x14bd('0xe')](_0x14bd('0x42'),_0x5d6331[_0x14bd('0x11')],_0xdac73a);_0x354acd(_0x424e49[_0x14bd('0xe')](0x1f4,_0x5d6331[_0x14bd('0x11')]));});});}; \ No newline at end of file +var _0x544a=['result','CreateCmHopperHistory','CmHopperHistory','create','options','raw','then','stringify','catch','AvgHandleTime','findAll','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','where','col','ivrTotalCallsDays','ivrAnswerCallsDay','debug','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5b1c06,_0x21f26e){var _0x4d527=function(_0x34d778){while(--_0x34d778){_0x5b1c06['push'](_0x5b1c06['shift']());}};_0x4d527(++_0x21f26e);}(_0x544a,0xbd));var _0xa544=function(_0x2ff28a,_0x4222d5){_0x2ff28a=_0x2ff28a-0x0;var _0x57f43c=_0x544a[_0x2ff28a];return _0x57f43c;};'use strict';var _=require(_0xa544('0x0'));var util=require(_0xa544('0x1'));var moment=require(_0xa544('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa544('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa544('0x4'));var logger=require(_0xa544('0x5'))('rpc');var config=require(_0xa544('0x6'));var jayson=require(_0xa544('0x7'));var client=jayson[_0xa544('0x8')][_0xa544('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39caac,_0x543cd1,_0x407443){return new BPromise(function(_0x495819,_0x39bcd7){return client[_0xa544('0xa')](_0x39caac,_0x407443)['then'](function(_0x2e9a6a){logger[_0xa544('0xb')](_0xa544('0xc'),_0x543cd1,_0xa544('0xd'));logger['debug'](_0xa544('0xe'),_0x543cd1,_0xa544('0xd'),JSON['stringify'](_0x2e9a6a));if(_0x2e9a6a[_0xa544('0xf')]){if(_0x2e9a6a['error'][_0xa544('0x10')]===0x1f4){logger[_0xa544('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x543cd1,_0x2e9a6a[_0xa544('0xf')][_0xa544('0x11')]);return _0x39bcd7(_0x2e9a6a[_0xa544('0xf')][_0xa544('0x11')]);}logger[_0xa544('0xf')](_0xa544('0xc'),_0x543cd1,_0x2e9a6a[_0xa544('0xf')][_0xa544('0x11')]);return _0x495819(_0x2e9a6a[_0xa544('0xf')][_0xa544('0x11')]);}else{logger[_0xa544('0xb')](_0xa544('0xc'),_0x543cd1,'request\x20sent');_0x495819(_0x2e9a6a[_0xa544('0x12')][_0xa544('0x11')]);}})['catch'](function(_0x9093bd){logger[_0xa544('0xf')](_0xa544('0xc'),_0x543cd1,_0x9093bd);_0x39bcd7(_0x9093bd);});});}exports[_0xa544('0x13')]=function(_0x2c5ae8){var _0x297298=this;return new Promise(function(_0x1f3fcc,_0x44ccd3){return db[_0xa544('0x14')][_0xa544('0x15')](_0x2c5ae8['body'],{'raw':_0x2c5ae8['options']?_0x2c5ae8[_0xa544('0x16')][_0xa544('0x17')]===undefined?!![]:![]:!![]})[_0xa544('0x18')](function(_0x57a154){logger[_0xa544('0xb')](_0xa544('0x13'),_0x2c5ae8);logger['debug'](_0xa544('0x13'),_0x2c5ae8,JSON[_0xa544('0x19')](_0x57a154));_0x1f3fcc(_0x57a154);})[_0xa544('0x1a')](function(_0xb7df3d){logger[_0xa544('0xf')]('CreateCmHopperHistory',_0xb7df3d['message'],_0x2c5ae8);_0x44ccd3(_0x297298[_0xa544('0xf')](0x1f4,_0xb7df3d['message']));});});};exports[_0xa544('0x1b')]=function(_0x3794e3){var _0x11a6db=this;return new Promise(function(_0x45e4b7,_0x14a587){return db[_0xa544('0x14')][_0xa544('0x1c')]({'raw':_0x3794e3[_0xa544('0x16')]?_0x3794e3[_0xa544('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3794e3[_0xa544('0x16')]?_0x3794e3[_0xa544('0x16')]['where']||null:null,'attributes':[[db[_0xa544('0x1d')]['fn'](_0xa544('0x1e'),db[_0xa544('0x1d')]['col']('id')),_0xa544('0x1f')],[db[_0xa544('0x1d')]['fn'](_0xa544('0x1e'),db[_0xa544('0x1d')]['fn']('IF',db['sequelize'][_0xa544('0x20')](_0xa544('0x21')))),_0xa544('0x22')],[db['sequelize']['fn'](_0xa544('0x1e'),db[_0xa544('0x1d')]['fn']('IF',db['sequelize']['literal'](_0xa544('0x23')))),_0xa544('0x24')],[db[_0xa544('0x1d')]['fn']('COUNT',db[_0xa544('0x1d')]['fn']('IF',db[_0xa544('0x1d')][_0xa544('0x20')]('`state`\x20=\x2011,\x201,\x20null'))),_0xa544('0x25')],[db[_0xa544('0x1d')]['fn']('AVG',db[_0xa544('0x1d')]['fn']('IF',db['sequelize'][_0xa544('0x20')](_0xa544('0x26')))),_0xa544('0x27')],[db['sequelize']['fn']('AVG',db[_0xa544('0x1d')]['fn']('IF',db[_0xa544('0x1d')][_0xa544('0x20')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})[_0xa544('0x18')](function(_0x1165e2){logger[_0xa544('0xb')]('AvgHandleTime',_0x3794e3);logger['debug'](_0xa544('0x1b'),_0x3794e3,JSON[_0xa544('0x19')](_0x1165e2));_0x45e4b7(_0x1165e2);})[_0xa544('0x1a')](function(_0x2c3032){logger[_0xa544('0xf')](_0xa544('0x1b'),_0x2c3032[_0xa544('0x11')],_0x3794e3);_0x14a587(_0x11a6db['error'](0x1f4,_0x2c3032[_0xa544('0x11')]));});});};exports[_0xa544('0x28')]=function(_0x204b12){var _0x26f658=this;return new Promise(function(_0x555ec0,_0xd5e63f){return db[_0xa544('0x14')][_0xa544('0x1c')]({'raw':_0x204b12[_0xa544('0x16')]?_0x204b12['options'][_0xa544('0x17')]===undefined?!![]:![]:!![],'where':_0x204b12[_0xa544('0x16')]?_0x204b12[_0xa544('0x16')]['where']||null:null,'attributes':[[_0xa544('0x29'),_0xa544('0x2a')],[db[_0xa544('0x1d')]['fn'](_0xa544('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0xa544('0x20')](_0xa544('0x2b')))),'outboundNoSuchCallsDay'],[db[_0xa544('0x1d')]['fn'](_0xa544('0x1e'),db[_0xa544('0x1d')]['fn']('IF',db[_0xa544('0x1d')]['literal'](_0xa544('0x2c')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0xa544('0x1e'),db[_0xa544('0x1d')]['fn']('IF',db[_0xa544('0x1d')][_0xa544('0x20')](_0xa544('0x21')))),_0xa544('0x2d')],[db[_0xa544('0x1d')]['fn'](_0xa544('0x1e'),db[_0xa544('0x1d')]['fn']('IF',db[_0xa544('0x1d')]['literal'](_0xa544('0x2e')))),_0xa544('0x2f')],[db['sequelize']['fn']('COUNT',db[_0xa544('0x1d')]['fn']('IF',db[_0xa544('0x1d')]['literal'](_0xa544('0x30')))),'outboundCongestionCallsDay'],[db[_0xa544('0x1d')]['fn'](_0xa544('0x1e'),db[_0xa544('0x1d')]['fn']('IF',db[_0xa544('0x1d')][_0xa544('0x20')](_0xa544('0x31')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0xa544('0x1e'),db[_0xa544('0x1d')]['fn']('IF',db[_0xa544('0x1d')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xa544('0x32')],[db[_0xa544('0x1d')]['fn'](_0xa544('0x1e'),db[_0xa544('0x1d')]['fn']('IF',db[_0xa544('0x1d')][_0xa544('0x20')](_0xa544('0x33')))),_0xa544('0x34')],[db[_0xa544('0x1d')]['fn'](_0xa544('0x1e'),db['sequelize']['fn']('IF',db[_0xa544('0x1d')][_0xa544('0x20')](_0xa544('0x35')))),_0xa544('0x36')],[db[_0xa544('0x1d')]['fn'](_0xa544('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0xa544('0x20')](_0xa544('0x37')))),_0xa544('0x38')],[db[_0xa544('0x1d')]['fn'](_0xa544('0x1e'),db[_0xa544('0x1d')]['fn']('IF',db[_0xa544('0x1d')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),_0xa544('0x39')],[db[_0xa544('0x1d')]['fn'](_0xa544('0x1e'),db[_0xa544('0x1d')]['fn']('IF',db[_0xa544('0x1d')]['literal'](_0xa544('0x3a')))),_0xa544('0x3b')],[db[_0xa544('0x1d')]['fn'](_0xa544('0x1e'),db['sequelize']['fn']('IF',db[_0xa544('0x1d')][_0xa544('0x20')](_0xa544('0x3c')))),'outboundRejectCallsDay'],[db[_0xa544('0x1d')]['fn'](_0xa544('0x1e'),db[_0xa544('0x1d')]['fn']('IF',db[_0xa544('0x1d')][_0xa544('0x20')](_0xa544('0x3d')))),_0xa544('0x3e')]],'group':['campaign']})[_0xa544('0x18')](function(_0x34dba1){logger[_0xa544('0xb')](_0xa544('0x28'),_0x204b12);logger['debug']('GetVoiceQueueHopperHistory',_0x204b12,JSON['stringify'](_0x34dba1));_0x555ec0(_0x34dba1);})[_0xa544('0x1a')](function(_0x171db8){logger[_0xa544('0xf')](_0xa544('0x28'),_0x171db8[_0xa544('0x11')],_0x204b12);_0xd5e63f(_0x26f658[_0xa544('0xf')](0x1f4,_0x171db8[_0xa544('0x11')]));});});};exports[_0xa544('0x3f')]=function(_0x50bbf2){var _0x428c62=this;return new Promise(function(_0x13c05f,_0x689236){return db[_0xa544('0x14')][_0xa544('0x1c')]({'raw':_0x50bbf2['options']?_0x50bbf2[_0xa544('0x16')][_0xa544('0x17')]===undefined?!![]:![]:!![],'where':_0x50bbf2[_0xa544('0x16')]?_0x50bbf2['options'][_0xa544('0x40')]||null:null,'attributes':[[_0xa544('0x29'),_0xa544('0x2a')],[db[_0xa544('0x1d')]['fn'](_0xa544('0x1e'),db[_0xa544('0x1d')][_0xa544('0x41')]('id')),_0xa544('0x42')],[db[_0xa544('0x1d')]['fn'](_0xa544('0x1e'),db[_0xa544('0x1d')]['fn']('IF',db[_0xa544('0x1d')][_0xa544('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0xa544('0x43')]],'group':['campaign']})[_0xa544('0x18')](function(_0x28c7ff){logger[_0xa544('0xb')](_0xa544('0x3f'),_0x50bbf2);logger[_0xa544('0x44')](_0xa544('0x3f'),_0x50bbf2,JSON['stringify'](_0x28c7ff));_0x13c05f(_0x28c7ff);})['catch'](function(_0x4f732e){logger[_0xa544('0xf')](_0xa544('0x3f'),_0x4f732e[_0xa544('0x11')],_0x50bbf2);_0x689236(_0x428c62[_0xa544('0xf')](0x1f4,_0x4f732e[_0xa544('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index b25f03b..5cbd0eb 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 _0x8627=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','post','put','update','exports','multer','path','connect-timeout','express'];(function(_0x1f867b,_0x3513d3){var _0x13972e=function(_0x58746c){while(--_0x58746c){_0x1f867b['push'](_0x1f867b['shift']());}};_0x13972e(++_0x3513d3);}(_0x8627,0xc2));var _0x7862=function(_0x48e5e9,_0xec26ad){_0x48e5e9=_0x48e5e9-0x0;var _0x5ca1b6=_0x8627[_0x48e5e9];return _0x5ca1b6;};'use strict';var multer=require(_0x7862('0x0'));var util=require('util');var path=require(_0x7862('0x1'));var timeout=require(_0x7862('0x2'));var express=require(_0x7862('0x3'));var router=express[_0x7862('0x4')]();var fs_extra=require(_0x7862('0x5'));var auth=require(_0x7862('0x6'));var interaction=require(_0x7862('0x7'));var config=require(_0x7862('0x8'));var controller=require(_0x7862('0x9'));router[_0x7862('0xa')]('/',auth[_0x7862('0xb')](),controller['index']);router[_0x7862('0xa')](_0x7862('0xc'),auth[_0x7862('0xb')](),controller[_0x7862('0xd')]);router['get']('/:id',auth[_0x7862('0xb')](),controller['show']);router[_0x7862('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7862('0xf')]('/:id',auth[_0x7862('0xb')](),controller[_0x7862('0x10')]);module[_0x7862('0x11')]=router; \ No newline at end of file +var _0x0fa8=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','update','exports','multer','connect-timeout','express','Router','fs-extra'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0fa8,0x1eb));var _0x80fa=function(_0x38b100,_0x177901){_0x38b100=_0x38b100-0x0;var _0x2bece2=_0x0fa8[_0x38b100];return _0x2bece2;};'use strict';var multer=require(_0x80fa('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x80fa('0x1'));var express=require(_0x80fa('0x2'));var router=express[_0x80fa('0x3')]();var fs_extra=require(_0x80fa('0x4'));var auth=require(_0x80fa('0x5'));var interaction=require(_0x80fa('0x6'));var config=require(_0x80fa('0x7'));var controller=require('./cmHopperHistory.controller');router[_0x80fa('0x8')]('/',auth[_0x80fa('0x9')](),controller[_0x80fa('0xa')]);router[_0x80fa('0x8')]('/describe',auth[_0x80fa('0x9')](),controller['describe']);router[_0x80fa('0x8')](_0x80fa('0xb'),auth[_0x80fa('0x9')](),controller[_0x80fa('0xc')]);router['post']('/',auth[_0x80fa('0x9')](),controller[_0x80fa('0xd')]);router['put'](_0x80fa('0xb'),auth[_0x80fa('0x9')](),controller[_0x80fa('0xe')]);module[_0x80fa('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 812ca31..6fc7d08 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 _0x864a=['STRING','name','sequelize','exports'];(function(_0x383627,_0x5be16e){var _0x2c16a0=function(_0x569b72){while(--_0x569b72){_0x383627['push'](_0x383627['shift']());}};_0x2c16a0(++_0x5be16e);}(_0x864a,0x8a));var _0xa864=function(_0x3346a4,_0x395cde){_0x3346a4=_0x3346a4-0x0;var _0x30b500=_0x864a[_0x3346a4];return _0x30b500;};'use strict';var Sequelize=require(_0xa864('0x0'));module[_0xa864('0x1')]={'name':{'type':Sequelize[_0xa864('0x2')],'unique':_0xa864('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7f42=['sequelize','STRING','name'];(function(_0x477ed5,_0x1e316b){var _0x3a6648=function(_0x13b146){while(--_0x13b146){_0x477ed5['push'](_0x477ed5['shift']());}};_0x3a6648(++_0x1e316b);}(_0x7f42,0x1dd));var _0x27f4=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7f42[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x27f4('0x0'));module['exports']={'name':{'type':Sequelize[_0x27f4('0x1')],'unique':_0x27f4('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x27f4('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index b68b276..16f171e 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 _0x7e97=['INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','emit','removeAgents','userCmList:remove','getAgents','User','spread','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./cmList.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','json','update','then','destroy','get','Lists','error','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','Disposition','getDispositions','findOne','includeAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','ContactItemType','alias','select','from','c.deletedAt\x20is\x20null','distinct','field','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description_additionalPhone_','toString','isEmpty','now','writeFileSync','format','setHeader','Content-disposition','list_%d_%s.csv','Content-type','/tmp/list_%d_%s.csv','addCustomField','addCustomFields','Sequelize','TEXT','number'];(function(_0xd8ec51,_0x5c7bb5){var _0x382896=function(_0x2149dc){while(--_0x2149dc){_0xd8ec51['push'](_0xd8ec51['shift']());}};_0x382896(++_0x5c7bb5);}(_0x7e97,0xac));var _0x77e9=function(_0x386ae1,_0x39b337){_0x386ae1=_0x386ae1-0x0;var _0x52629b=_0x7e97[_0x386ae1];return _0x52629b;};'use strict';var emlformat=require(_0x77e9('0x0'));var rimraf=require(_0x77e9('0x1'));var zipdir=require(_0x77e9('0x2'));var jsonpatch=require(_0x77e9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x77e9('0x4'));var Mustache=require(_0x77e9('0x5'));var util=require(_0x77e9('0x6'));var path=require('path');var sox=require(_0x77e9('0x7'));var csv=require(_0x77e9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x77e9('0x9'));var _=require(_0x77e9('0xa'));var squel=require(_0x77e9('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x77e9('0xc'));var toCsv=require(_0x77e9('0x8'));var querystring=require('querystring');var Papa=require(_0x77e9('0xd'));var Redis=require(_0x77e9('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x77e9('0xf'));var hardwareService=require(_0x77e9('0x10'));var logger=require(_0x77e9('0x11'))(_0x77e9('0x12'));var utils=require('../../config/utils');var config=require(_0x77e9('0x13'));var licenseUtil=require(_0x77e9('0x14'));var db=require(_0x77e9('0x15'))['db'];var csv_results;config['redis']=_['defaults'](config[_0x77e9('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x77e9('0x17'))(new Redis(config['redis']));require(_0x77e9('0x18'))[_0x77e9('0x19')](socket);function respondWithStatusCode(_0x581c0e,_0x16af58){_0x16af58=_0x16af58||0xcc;return function(_0x8d8c7c){if(_0x8d8c7c){return _0x581c0e[_0x77e9('0x1a')](_0x16af58);}return _0x581c0e['status'](_0x16af58)[_0x77e9('0x1b')]();};}function respondWithResult(_0x240ae6,_0x12de2b){_0x12de2b=_0x12de2b||0xc8;return function(_0x25a0a7){if(_0x25a0a7){return _0x240ae6[_0x77e9('0x1c')](_0x12de2b)['json'](_0x25a0a7);}};}function respondWithFilteredResult(_0xc902cd,_0x11f7dd){return function(_0x5abdb2){if(_0x5abdb2){var _0x43c87c=typeof _0x11f7dd[_0x77e9('0x1d')]===_0x77e9('0x1e')&&typeof _0x11f7dd[_0x77e9('0x1f')]===_0x77e9('0x1e');var _0x15824c=_0x5abdb2[_0x77e9('0x20')];var _0x3a9632=_0x43c87c?0x0:_0x11f7dd[_0x77e9('0x1d')];var _0x51b464=_0x43c87c?_0x5abdb2[_0x77e9('0x20')]:_0x11f7dd['offset']+_0x11f7dd[_0x77e9('0x1f')];var _0x21be3f;if(_0x51b464>=_0x15824c){_0x51b464=_0x15824c;_0x21be3f=0xc8;}else{_0x21be3f=0xce;}_0xc902cd[_0x77e9('0x1c')](_0x21be3f);return _0xc902cd[_0x77e9('0x21')]('Content-Range',_0x3a9632+'-'+_0x51b464+'/'+_0x15824c)[_0x77e9('0x22')](_0x5abdb2);}return null;};}function patchUpdates(_0x416959){return function(_0x38d670){try{jsonpatch['apply'](_0x38d670,_0x416959,!![]);}catch(_0x3499fd){return BPromise['reject'](_0x3499fd);}return _0x38d670['save']();};}function saveUpdates(_0x4bc64f,_0x42bfa7){return function(_0x1cb323){if(_0x1cb323){return _0x1cb323[_0x77e9('0x23')](_0x4bc64f)[_0x77e9('0x24')](function(_0x31fab7){return _0x31fab7;});}return null;};}function removeEntity(_0x3d57c6,_0x553b67){return function(_0x11e499){if(_0x11e499){return _0x11e499[_0x77e9('0x25')]()['then'](function(){var _0x4c63a2=_0x11e499[_0x77e9('0x26')]({'plain':!![]});var _0x5dfacc=_0x77e9('0x27');return db['UserProfileResource'][_0x77e9('0x25')]({'where':{'type':_0x5dfacc,'resourceId':_0x4c63a2['id']}})[_0x77e9('0x24')](function(){return _0x11e499;});})[_0x77e9('0x24')](function(){_0x3d57c6[_0x77e9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x596ea7,_0xce2efa){return function(_0x548e4f){if(!_0x548e4f){_0x596ea7[_0x77e9('0x1a')](0x194);}return _0x548e4f;};}function handleError(_0x4456c,_0x310c88){_0x310c88=_0x310c88||0x1f4;return function(_0xb69fbf){logger[_0x77e9('0x28')](_0xb69fbf['stack']);if(_0xb69fbf['name']){delete _0xb69fbf['name'];}_0x4456c['status'](_0x310c88)[_0x77e9('0x29')](_0xb69fbf);};}exports[_0x77e9('0x2a')]=function(_0x3c18a5,_0x59b8b2){var _0x3a4e8f={},_0x4a0ae8={},_0x358129={'count':0x0,'rows':[]};var _0x2c69cb=_[_0x77e9('0x2b')](db[_0x77e9('0x2c')][_0x77e9('0x2d')],function(_0x267a00){return{'name':_0x267a00[_0x77e9('0x2e')],'type':_0x267a00[_0x77e9('0x2f')][_0x77e9('0x30')]};});_0x4a0ae8[_0x77e9('0x31')]=_[_0x77e9('0x2b')](_0x2c69cb,'name');_0x4a0ae8['query']=_['keys'](_0x3c18a5[_0x77e9('0x32')]);_0x4a0ae8[_0x77e9('0x33')]=_['intersection'](_0x4a0ae8[_0x77e9('0x31')],_0x4a0ae8[_0x77e9('0x32')]);_0x3a4e8f[_0x77e9('0x34')]=_[_0x77e9('0x35')](_0x4a0ae8['model'],qs[_0x77e9('0x36')](_0x3c18a5[_0x77e9('0x32')][_0x77e9('0x36')]));_0x3a4e8f[_0x77e9('0x34')]=_0x3a4e8f['attributes'][_0x77e9('0x37')]?_0x3a4e8f[_0x77e9('0x34')]:_0x4a0ae8[_0x77e9('0x31')];if(!_0x3c18a5[_0x77e9('0x32')][_0x77e9('0x38')](_0x77e9('0x39'))){_0x3a4e8f['limit']=qs[_0x77e9('0x1f')](_0x3c18a5[_0x77e9('0x32')][_0x77e9('0x1f')]);_0x3a4e8f['offset']=qs['offset'](_0x3c18a5[_0x77e9('0x32')][_0x77e9('0x1d')]);}_0x3a4e8f[_0x77e9('0x3a')]=qs['sort'](_0x3c18a5['query'][_0x77e9('0x3b')]);_0x3a4e8f[_0x77e9('0x3c')]=qs[_0x77e9('0x33')](_[_0x77e9('0x3d')](_0x3c18a5['query'],_0x4a0ae8[_0x77e9('0x33')]),_0x2c69cb);if(_0x3c18a5[_0x77e9('0x32')][_0x77e9('0x3e')]){_0x3a4e8f[_0x77e9('0x3c')]=_[_0x77e9('0x3f')](_0x3a4e8f[_0x77e9('0x3c')],{'$or':_[_0x77e9('0x2b')](_0x2c69cb,function(_0x275e3d){if(_0x275e3d[_0x77e9('0x2f')]!==_0x77e9('0x40')){var _0x4b64cd={};_0x4b64cd[_0x275e3d[_0x77e9('0x41')]]={'$like':'%'+_0x3c18a5[_0x77e9('0x32')][_0x77e9('0x3e')]+'%'};return _0x4b64cd;}})});}_0x3a4e8f=_[_0x77e9('0x3f')]({},_0x3a4e8f,_0x3c18a5[_0x77e9('0x42')]);var _0x40f294={'where':_0x3a4e8f[_0x77e9('0x3c')]};return db[_0x77e9('0x2c')][_0x77e9('0x20')](_0x40f294)[_0x77e9('0x24')](function(_0x22ea6c){_0x358129['count']=_0x22ea6c;if(_0x3c18a5[_0x77e9('0x32')]['includeAll']){_0x3a4e8f[_0x77e9('0x43')]=[{'all':!![]}];}return db[_0x77e9('0x2c')][_0x77e9('0x44')](_0x3a4e8f);})[_0x77e9('0x24')](function(_0x2a3964){_0x358129[_0x77e9('0x45')]=_0x2a3964;return _0x358129;})[_0x77e9('0x24')](respondWithFilteredResult(_0x59b8b2,_0x3a4e8f))[_0x77e9('0x46')](handleError(_0x59b8b2,null));};exports[_0x77e9('0x47')]=function(_0x3ed4b5,_0xf30fe4){var _0x2b36b8={'raw':![],'where':{'id':_0x3ed4b5[_0x77e9('0x48')]['id']}},_0x14b5af={};_0x14b5af[_0x77e9('0x31')]=_[_0x77e9('0x49')](db['CmList'][_0x77e9('0x2d')]);_0x14b5af[_0x77e9('0x32')]=_[_0x77e9('0x49')](_0x3ed4b5[_0x77e9('0x32')]);_0x14b5af[_0x77e9('0x33')]=_[_0x77e9('0x35')](_0x14b5af[_0x77e9('0x31')],_0x14b5af[_0x77e9('0x32')]);_0x2b36b8[_0x77e9('0x34')]=_[_0x77e9('0x35')](_0x14b5af[_0x77e9('0x31')],qs['fields'](_0x3ed4b5[_0x77e9('0x32')][_0x77e9('0x36')]));_0x2b36b8[_0x77e9('0x34')]=_0x2b36b8[_0x77e9('0x34')][_0x77e9('0x37')]?_0x2b36b8[_0x77e9('0x34')]:_0x14b5af[_0x77e9('0x31')];if(_0x3ed4b5[_0x77e9('0x32')]['includeAll']){_0x2b36b8[_0x77e9('0x43')]=[{'all':!![]}];}_0x2b36b8=_[_0x77e9('0x3f')]({},_0x2b36b8,_0x3ed4b5[_0x77e9('0x42')]);return db['CmList']['find'](_0x2b36b8)[_0x77e9('0x24')](handleEntityNotFound(_0xf30fe4,null))[_0x77e9('0x24')](respondWithResult(_0xf30fe4,null))['catch'](handleError(_0xf30fe4,null));};exports['create']=function(_0x473945,_0xa22f85){return db[_0x77e9('0x2c')][_0x77e9('0x4a')](_0x473945[_0x77e9('0x4b')],{})[_0x77e9('0x24')](function(_0x8a0ed6){var _0x128123=_0x473945[_0x77e9('0x4c')]['get']({'plain':!![]});if(!_0x128123)throw new Error(_0x77e9('0x4d'));if(_0x128123[_0x77e9('0x4e')]==='user'){var _0xc28660=_0x8a0ed6['get']({'plain':!![]});var _0xd830a4='Lists';return db['UserProfileSection'][_0x77e9('0x4f')]({'where':{'name':_0xd830a4,'userProfileId':_0x128123['userProfileId']},'raw':!![]})[_0x77e9('0x24')](function(_0x4c4b8d){if(_0x4c4b8d&&_0x4c4b8d['autoAssociation']===0x0){return db['UserProfileResource'][_0x77e9('0x4a')]({'name':_0xc28660[_0x77e9('0x41')],'resourceId':_0xc28660['id'],'type':_0x4c4b8d[_0x77e9('0x41')],'sectionId':_0x4c4b8d['id']},{})[_0x77e9('0x24')](function(){return _0x8a0ed6;});}else{return _0x8a0ed6;}})[_0x77e9('0x46')](function(_0xfcc8f8){logger[_0x77e9('0x28')](_0x77e9('0x50'),_0xfcc8f8);throw _0xfcc8f8;});}return _0x8a0ed6;})[_0x77e9('0x24')](respondWithResult(_0xa22f85,0xc9))['catch'](handleError(_0xa22f85,null));};exports[_0x77e9('0x23')]=function(_0x428c09,_0x47cd80){if(_0x428c09[_0x77e9('0x4b')]['id']){delete _0x428c09[_0x77e9('0x4b')]['id'];}return db[_0x77e9('0x2c')][_0x77e9('0x4f')]({'where':{'id':_0x428c09['params']['id']}})[_0x77e9('0x24')](handleEntityNotFound(_0x47cd80,null))[_0x77e9('0x24')](saveUpdates(_0x428c09['body'],null))['then'](respondWithResult(_0x47cd80,null))[_0x77e9('0x46')](handleError(_0x47cd80,null));};exports[_0x77e9('0x25')]=function(_0x42d814,_0x31cb16){return db[_0x77e9('0x2c')][_0x77e9('0x4f')]({'where':{'id':_0x42d814[_0x77e9('0x48')]['id']}})[_0x77e9('0x24')](handleEntityNotFound(_0x31cb16,null))['then'](removeEntity(_0x31cb16,null))['catch'](handleError(_0x31cb16,null));};exports[_0x77e9('0x51')]=function(_0x191525,_0x5de44c){return db[_0x77e9('0x2c')][_0x77e9('0x51')]()[_0x77e9('0x24')](respondWithResult(_0x5de44c,null))['catch'](handleError(_0x5de44c,null));};exports['addDisposition']=function(_0x275de9,_0x1a3bca,_0x5acd51){if(_0x275de9[_0x77e9('0x4b')]['id']){delete _0x275de9[_0x77e9('0x4b')]['id'];}return db['CmList'][_0x77e9('0x4f')]({'where':{'id':_0x275de9[_0x77e9('0x48')]['id']}})[_0x77e9('0x24')](handleEntityNotFound(_0x1a3bca,null))['then'](function(_0x1aea46){if(_0x1aea46){_0x275de9['body'][_0x77e9('0x52')]=_0x1aea46['id'];return db[_0x77e9('0x53')][_0x77e9('0x4a')](_0x275de9[_0x77e9('0x4b')]);}})['then'](respondWithResult(_0x1a3bca,null))[_0x77e9('0x46')](handleError(_0x1a3bca,null));};exports[_0x77e9('0x54')]=function(_0x51a7dc,_0x331e92,_0x3cdedd){var _0x4b2cba={'raw':![],'where':{}};var _0x5a68b7={};var _0x56b632={'count':0x0,'rows':[]};return db['CmList'][_0x77e9('0x55')]({'where':{'id':_0x51a7dc[_0x77e9('0x48')]['id']}})[_0x77e9('0x24')](handleEntityNotFound(_0x331e92,null))[_0x77e9('0x24')](function(_0x1da733){if(_0x1da733){_0x5a68b7[_0x77e9('0x31')]=_[_0x77e9('0x49')](db[_0x77e9('0x53')][_0x77e9('0x2d')]);_0x5a68b7[_0x77e9('0x32')]=_[_0x77e9('0x49')](_0x51a7dc[_0x77e9('0x32')]);_0x5a68b7['filters']=_[_0x77e9('0x35')](_0x5a68b7[_0x77e9('0x31')],_0x5a68b7[_0x77e9('0x32')]);_0x4b2cba[_0x77e9('0x34')]=_['intersection'](_0x5a68b7[_0x77e9('0x31')],qs[_0x77e9('0x36')](_0x51a7dc['query'][_0x77e9('0x36')]));_0x4b2cba[_0x77e9('0x34')]=_0x4b2cba[_0x77e9('0x34')]['length']?_0x4b2cba[_0x77e9('0x34')]:_0x5a68b7[_0x77e9('0x31')];if(!_0x51a7dc['query']['hasOwnProperty']('nolimit')){_0x4b2cba[_0x77e9('0x1f')]=qs[_0x77e9('0x1f')](_0x51a7dc['query'][_0x77e9('0x1f')]);_0x4b2cba[_0x77e9('0x1d')]=qs[_0x77e9('0x1d')](_0x51a7dc['query'][_0x77e9('0x1d')]);}_0x4b2cba[_0x77e9('0x3a')]=qs['sort'](_0x51a7dc[_0x77e9('0x32')][_0x77e9('0x3b')]);_0x4b2cba[_0x77e9('0x3c')]=qs[_0x77e9('0x33')](_[_0x77e9('0x3d')](_0x51a7dc[_0x77e9('0x32')],_0x5a68b7['filters']));_0x4b2cba['where']['ListId']=_0x1da733['id'];if(_0x51a7dc[_0x77e9('0x32')][_0x77e9('0x3e')]){_0x4b2cba['where']=_[_0x77e9('0x3f')](_0x4b2cba[_0x77e9('0x3c')],{'$or':_['map'](_0x4b2cba[_0x77e9('0x34')],function(_0x7ac64a){var _0x542bcb={};_0x542bcb[_0x7ac64a]={'$like':'%'+_0x51a7dc[_0x77e9('0x32')][_0x77e9('0x3e')]+'%'};return _0x542bcb;})});}_0x4b2cba=_[_0x77e9('0x3f')]({},_0x4b2cba,_0x51a7dc[_0x77e9('0x42')]);return db[_0x77e9('0x53')][_0x77e9('0x20')]({'where':_0x4b2cba[_0x77e9('0x3c')]})['then'](function(_0x33b32c){_0x56b632[_0x77e9('0x20')]=_0x33b32c;if(_0x51a7dc[_0x77e9('0x32')][_0x77e9('0x56')]){_0x4b2cba[_0x77e9('0x43')]=[{'all':!![]}];}return db[_0x77e9('0x53')]['findAll'](_0x4b2cba);})['then'](function(_0x29cef0){_0x56b632[_0x77e9('0x45')]=_0x29cef0;return _0x56b632;});}})[_0x77e9('0x24')](respondWithFilteredResult(_0x331e92,_0x4b2cba))[_0x77e9('0x46')](handleError(_0x331e92,null));};exports[_0x77e9('0x57')]=function(_0x4a6825,_0x21723b,_0x48df4e){return db[_0x77e9('0x2c')][_0x77e9('0x4f')]({'where':{'id':_0x4a6825[_0x77e9('0x48')]['id']}})[_0x77e9('0x24')](handleEntityNotFound(_0x21723b,null))[_0x77e9('0x24')](function(_0x4a0be0){if(_0x4a0be0){return _0x4a0be0[_0x77e9('0x57')](_0x4a6825[_0x77e9('0x32')][_0x77e9('0x58')]);}})['then'](respondWithStatusCode(_0x21723b,null))[_0x77e9('0x46')](handleError(_0x21723b,null));};exports[_0x77e9('0x59')]=function(_0x1d2c18,_0xbc1c92,_0x4c8a26){return db['CmList'][_0x77e9('0x4f')]({'where':{'id':_0x1d2c18[_0x77e9('0x48')]['id']}})[_0x77e9('0x24')](handleEntityNotFound(_0xbc1c92,null))[_0x77e9('0x24')](function(_0x2d3ac6){if(_0x2d3ac6){var _0x307c4c=[];var _0x69101b={'success':[],'errors':[]};return db[_0x77e9('0x5a')][_0x77e9('0x51')]()[_0x77e9('0x24')](function(_0x849c2){if(_0x1d2c18[_0x77e9('0x4b')][_0x77e9('0x5b')]&&_[_0x77e9('0x5c')](_0x1d2c18[_0x77e9('0x4b')][_0x77e9('0x5b')])){if(_0x1d2c18[_0x77e9('0x4b')][_0x77e9('0x5b')][_0x77e9('0x37')]){_0x1d2c18['body'][_0x77e9('0x5b')]=_0x1d2c18[_0x77e9('0x4b')][_0x77e9('0x5b')][_0x77e9('0x5d')](';')+';';}else{_0x1d2c18['body'][_0x77e9('0x5b')]=null;}}else{_0x1d2c18[_0x77e9('0x4b')][_0x77e9('0x5b')]=null;}if(_0x1d2c18['body']&&_['isArray'](_0x1d2c18[_0x77e9('0x4b')])){for(var _0x53a2de=0x0;_0x53a2de<_0x1d2c18[_0x77e9('0x4b')][_0x77e9('0x37')];_0x53a2de+=0x1){_0x1d2c18[_0x77e9('0x4b')][_0x53a2de][_0x77e9('0x52')]=_0x1d2c18[_0x77e9('0x48')]['id'];_0x307c4c[_0x77e9('0x5e')](_0x1d2c18[_0x77e9('0x4b')][_0x53a2de]);}return BPromise[_0x77e9('0x5f')](_0x307c4c,function(_0x3f6e05){return db[_0x77e9('0x5a')]['create'](_[_0x77e9('0x60')](_0x3f6e05,[_0x77e9('0x58'),'id'])||{},{'fields':_[_0x77e9('0x49')](_0x849c2),'raw':!![]})[_0x77e9('0x24')](function(_0x294177){_0x69101b['success']['push'](_0x294177[_0x77e9('0x61')]);})[_0x77e9('0x46')](function(_0x502c0e){_0x69101b[_0x77e9('0x62')][_0x77e9('0x5e')]({'data':_0x3f6e05,'error':_0x502c0e[_0x77e9('0x63')]});});})[_0x77e9('0x24')](function(_0x5db089){return _0x69101b;})['catch'](function(_0x3b6d16){return _0x3b6d16;});}else{_0xbc1c92[_0x77e9('0x1c')](0x190)[_0x77e9('0x22')]({'message':_0x77e9('0x64')});}});}})['then'](respondWithResult(_0xbc1c92,null))['catch'](handleError(_0xbc1c92,null));};exports[_0x77e9('0x65')]=function(_0x4d88fa,_0x294ef3,_0x39fef7){var _0xb8e1b;return db['CmList'][_0x77e9('0x4f')]({'where':{'id':_0x4d88fa[_0x77e9('0x48')]['id']},'include':[{'model':db[_0x77e9('0x66')],'as':_0x77e9('0x67')}]})[_0x77e9('0x24')](handleEntityNotFound(_0x294ef3,null))[_0x77e9('0x24')](function(_0x251374){if(_0x251374){_0xb8e1b=_0x251374;return db[_0x77e9('0x5a')]['rawAttributes'];}})[_0x77e9('0x24')](function(_0x1403e5){if(_0x1403e5){var _0x480cd7={};var _0x41ca1b={};_0x41ca1b[_0x77e9('0x31')]=_[_0x77e9('0x68')](_[_0x77e9('0x49')](_0x1403e5),_[_0x77e9('0x2b')](_0xb8e1b[_0x77e9('0x67')],function(_0x3c3d09){return util['format'](_0x77e9('0x69'),_0x3c3d09['id']);}));_0x41ca1b[_0x77e9('0x32')]=_[_0x77e9('0x49')](_0x4d88fa[_0x77e9('0x32')]);_0x41ca1b[_0x77e9('0x33')]=_[_0x77e9('0x35')](_0x41ca1b[_0x77e9('0x31')],_0x41ca1b['query']);_0x480cd7[_0x77e9('0x34')]=_['intersection'](_0x41ca1b[_0x77e9('0x31')],qs[_0x77e9('0x36')](_0x4d88fa['query'][_0x77e9('0x36')]));_0x480cd7[_0x77e9('0x34')]=_0x480cd7[_0x77e9('0x34')][_0x77e9('0x37')]?_0x480cd7[_0x77e9('0x34')]:_0x41ca1b[_0x77e9('0x31')];if(!_0x4d88fa[_0x77e9('0x32')][_0x77e9('0x38')](_0x77e9('0x39'))){_0x480cd7['limit']=qs[_0x77e9('0x1f')](_0x4d88fa[_0x77e9('0x32')][_0x77e9('0x1f')]);_0x480cd7['offset']=qs[_0x77e9('0x1d')](_0x4d88fa['query'][_0x77e9('0x1d')]);}_0x480cd7['order']=qs[_0x77e9('0x3b')](_0x4d88fa[_0x77e9('0x32')][_0x77e9('0x3b')]);_0x480cd7[_0x77e9('0x3c')]=qs[_0x77e9('0x33')](_[_0x77e9('0x3d')](_0x4d88fa[_0x77e9('0x32')],_0x41ca1b[_0x77e9('0x33')]));_0x480cd7[_0x77e9('0x6a')]=!![];if(_0x4d88fa[_0x77e9('0x32')]['filter']){_0x480cd7[_0x77e9('0x3c')]=_['merge'](_0x480cd7[_0x77e9('0x3c')],{'$or':_[_0x77e9('0x2b')](_0x480cd7['attributes'],function(_0x1dd248){var _0x39e7bc={};_0x39e7bc[_0x1dd248]={'$like':'%'+_0x4d88fa[_0x77e9('0x32')][_0x77e9('0x3e')]+'%'};return _0x39e7bc;})});}_0x480cd7=_[_0x77e9('0x3f')]({},_0x480cd7,_0x4d88fa[_0x77e9('0x42')]);return _0xb8e1b[_0x77e9('0x65')](_0x480cd7);}})[_0x77e9('0x24')](respondWithResult(_0x294ef3,null))[_0x77e9('0x46')](handleError(_0x294ef3,null));};exports['getContactsCsv']=function(_0x148365,_0x7b3660,_0x440bea){var _0xfc74be;var _0x35790b;var _0x5c21d0;var _0x348b34=_0x148365['params']['id'];csv_results=[];return db[_0x77e9('0x6b')][_0x77e9('0x44')]({'attributes':['id',_0x77e9('0x41')],'raw':!![],'order':['OrderBy']})[_0x77e9('0x24')](function(_0x52614a){_0xfc74be=_0x52614a;var _0x5a6b5d=_[_0x77e9('0x49')](db[_0x77e9('0x5a')][_0x77e9('0x2d')]);return db[_0x77e9('0x66')]['findAll']({'raw':!![],'attributes':['id',_0x77e9('0x6c')]})[_0x77e9('0x24')](function(_0x52cdc2){_0x35790b=_0x52cdc2;var _0x2106a1=squel[_0x77e9('0x6d')]()['fields'](_0x5a6b5d)[_0x77e9('0x6e')]('cm_contacts','c')[_0x77e9('0x3c')]('c.ListId\x20=\x20?',_0x348b34)[_0x77e9('0x3c')](_0x77e9('0x6f'))[_0x77e9('0x70')]();for(var _0x3d0729=0x0;_0x3d0729<_0x35790b[_0x77e9('0x37')];_0x3d0729++){_0x2106a1[_0x77e9('0x71')]('c.cf_'+_0x35790b[_0x3d0729]['id'],'customField_'+_0x35790b[_0x3d0729]['alias']);}for(var _0x3d0729=0x0;_0x3d0729<_0xfc74be[_0x77e9('0x37')];_0x3d0729++){_0x2106a1[_0x77e9('0x71')](squel[_0x77e9('0x6d')]()['field']('item')['from'](_0x77e9('0x72'))[_0x77e9('0x3c')](_0x77e9('0x73'),_0xfc74be[_0x3d0729]['id'])[_0x77e9('0x3c')](_0x77e9('0x74')),_0x77e9('0x75')+_0xfc74be[_0x3d0729][_0x77e9('0x41')]);_0x2106a1[_0x77e9('0x71')](squel[_0x77e9('0x6d')]()[_0x77e9('0x71')]('description')[_0x77e9('0x6e')](_0x77e9('0x72'))['where'](_0x77e9('0x73'),_0xfc74be[_0x3d0729]['id'])[_0x77e9('0x3c')]('CmContactId\x20=\x20c.id'),_0x77e9('0x76')+_0xfc74be[_0x3d0729][_0x77e9('0x41')]);}var _0x5dd489=[];_0x5dd489[_0x77e9('0x5e')](_0x2106a1[_0x77e9('0x77')]());BPromise[_0x77e9('0x5f')](_0x5dd489,handleQuery)[_0x77e9('0x24')](function(_0x5836ce){handleQuery(_0x2106a1[_0x77e9('0x77')]());var _0x30d798=csv_results[0x0];if(!_[_0x77e9('0x78')](_0x30d798)){var _0x3f55f0=toCsv(_0x30d798);var _0x4b2206=Date[_0x77e9('0x79')]();fs[_0x77e9('0x7a')](util[_0x77e9('0x7b')]('/tmp/list_%d_%s.csv',_0x348b34,_0x4b2206),_0x3f55f0);_0x7b3660[_0x77e9('0x7c')](_0x77e9('0x7d'),'attachment;\x20filename='+util[_0x77e9('0x7b')](_0x77e9('0x7e'),_0x348b34,_0x4b2206));_0x7b3660[_0x77e9('0x7c')](_0x77e9('0x7f'),'text/csv');return _0x7b3660['download'](util[_0x77e9('0x7b')](_0x77e9('0x80'),_0x348b34,_0x4b2206));}else{return _0x7b3660[_0x77e9('0x1a')](0xcc);}});});});};exports[_0x77e9('0x81')]=function(_0xb47d90,_0x177b7f,_0x536744){var _0x2ea93a;delete _0xb47d90[_0x77e9('0x4b')]['id'];return db['CmList'][_0x77e9('0x55')]({'where':{'id':_0xb47d90['params']['id']}})['then'](handleEntityNotFound(_0x177b7f,null))[_0x77e9('0x24')](function(_0x4ba149){if(_0x4ba149){return db['sequelize']['transaction'](function(_0x237a7b){return db[_0x77e9('0x66')][_0x77e9('0x4a')](_0xb47d90[_0x77e9('0x4b')],{'transaction':_0x237a7b})[_0x77e9('0x24')](function(_0x56d385){_0x2ea93a=_0x56d385;return _0x4ba149[_0x77e9('0x82')](_0x56d385,{'transaction':_0x237a7b});})['then'](function(){var _0x5b6280={'type':db[_0x77e9('0x83')][_0x77e9('0x84')],'transaction':_0x237a7b};switch(_0xb47d90[_0x77e9('0x4b')][_0x77e9('0x2f')]){case'text':_0x5b6280[_0x77e9('0x2f')]=db[_0x77e9('0x83')][_0x77e9('0x84')];break;case _0x77e9('0x85'):_0x5b6280[_0x77e9('0x2f')]=db[_0x77e9('0x83')][_0x77e9('0x86')];break;case _0x77e9('0x87'):_0x5b6280['type']=db[_0x77e9('0x83')][_0x77e9('0x88')];_0x5b6280[_0x77e9('0x89')]=![];break;default:}return db[_0x77e9('0x8a')][_0x77e9('0x8b')][_0x77e9('0x8c')](_0x77e9('0x8d'),util[_0x77e9('0x7b')](_0x77e9('0x8e'),_0x2ea93a['id']),_0x5b6280);})[_0x77e9('0x24')](function(){return _0x2ea93a;});});}})['then'](respondWithResult(_0x177b7f,null))[_0x77e9('0x46')](handleError(_0x177b7f,null));};exports[_0x77e9('0x8f')]=function(_0x2df3d3,_0x117a64,_0x17e2dc){var _0x3edbbc={};var _0x572b28={};var _0x35d51d;var _0x72e9e5;return db['CmList'][_0x77e9('0x55')]({'where':{'id':_0x2df3d3[_0x77e9('0x48')]['id']}})[_0x77e9('0x24')](handleEntityNotFound(_0x117a64,null))[_0x77e9('0x24')](function(_0x4c45af){if(_0x4c45af){_0x35d51d=_0x4c45af;_0x572b28[_0x77e9('0x31')]=_['keys'](db[_0x77e9('0x66')][_0x77e9('0x2d')]);_0x572b28[_0x77e9('0x32')]=_[_0x77e9('0x49')](_0x2df3d3[_0x77e9('0x32')]);_0x572b28[_0x77e9('0x33')]=_[_0x77e9('0x35')](_0x572b28['model'],_0x572b28[_0x77e9('0x32')]);_0x3edbbc[_0x77e9('0x34')]=_[_0x77e9('0x35')](_0x572b28[_0x77e9('0x31')],qs[_0x77e9('0x36')](_0x2df3d3[_0x77e9('0x32')]['fields']));_0x3edbbc[_0x77e9('0x34')]=_0x3edbbc[_0x77e9('0x34')]['length']?_0x3edbbc[_0x77e9('0x34')]:_0x572b28[_0x77e9('0x31')];_0x3edbbc[_0x77e9('0x3a')]=qs[_0x77e9('0x3b')](_0x2df3d3[_0x77e9('0x32')][_0x77e9('0x3b')]);_0x3edbbc['where']=qs['filters'](_[_0x77e9('0x3d')](_0x2df3d3[_0x77e9('0x32')],_0x572b28[_0x77e9('0x33')]));_0x3edbbc['where']=_[_0x77e9('0x3f')](_0x3edbbc[_0x77e9('0x3c')],{'$or':[{'ListId':_0x4c45af['id']},{'ListId':null}]});if(_0x2df3d3['query'][_0x77e9('0x3e')]){_0x3edbbc[_0x77e9('0x3c')]=_[_0x77e9('0x3f')](_0x3edbbc[_0x77e9('0x3c')],{'$or':_[_0x77e9('0x2b')](_0x3edbbc[_0x77e9('0x34')],function(_0x4b612b){var _0x23699d={};_0x23699d[_0x4b612b]={'$like':'%'+_0x2df3d3[_0x77e9('0x32')][_0x77e9('0x3e')]+'%'};return _0x23699d;})});}_0x3edbbc=_[_0x77e9('0x3f')]({},_0x3edbbc,_0x2df3d3['options']);return db['CmCustomField'][_0x77e9('0x90')](_0x3edbbc);}})['then'](respondWithResult(_0x117a64,null))[_0x77e9('0x46')](handleError(_0x117a64,null));};exports[_0x77e9('0x91')]=function(_0x3dc808,_0x4a318c){return db[_0x77e9('0x66')][_0x77e9('0x90')]({'where':{'ListId':null}})[_0x77e9('0x24')](handleEntityNotFound(_0x4a318c,null))['then'](function(_0x55a344){return _0x55a344;})[_0x77e9('0x24')](respondWithResult(_0x4a318c,null))[_0x77e9('0x46')](handleError(_0x4a318c,null));};exports[_0x77e9('0x92')]=function(_0x21761d,_0x50fa1a,_0x33afb1){return db['CmList'][_0x77e9('0x4f')]({'where':{'id':_0x21761d[_0x77e9('0x48')]['id']}})[_0x77e9('0x24')](handleEntityNotFound(_0x50fa1a,null))[_0x77e9('0x24')](function(_0x255033){if(_0x255033){return _0x255033['addAgents'](_0x21761d[_0x77e9('0x4b')][_0x77e9('0x58')],_[_0x77e9('0x60')](_0x21761d[_0x77e9('0x4b')],[_0x77e9('0x58'),'id'])||{})['spread'](function(_0x545bcc){for(var _0x5616cf=0x0;_0x5616cf<_0x21761d[_0x77e9('0x4b')][_0x77e9('0x58')][_0x77e9('0x37')];_0x5616cf+=0x1){socket[_0x77e9('0x93')]('userCmList:save',{'UserId':Number(_0x21761d[_0x77e9('0x4b')]['ids'][_0x5616cf]),'CmListId':Number(_0x21761d[_0x77e9('0x48')]['id'])});}return _0x545bcc;});}})[_0x77e9('0x24')](respondWithResult(_0x50fa1a,null))['catch'](handleError(_0x50fa1a,null));};exports['removeAgents']=function(_0x27e2ec,_0xef0cc8,_0x5a5727){return db[_0x77e9('0x2c')][_0x77e9('0x4f')]({'where':{'id':_0x27e2ec[_0x77e9('0x48')]['id']}})[_0x77e9('0x24')](handleEntityNotFound(_0xef0cc8,null))[_0x77e9('0x24')](function(_0x39026a){if(_0x39026a){return _0x39026a[_0x77e9('0x94')](_0x27e2ec[_0x77e9('0x32')][_0x77e9('0x58')])[_0x77e9('0x24')](function(){if(_[_0x77e9('0x5c')](_0x27e2ec[_0x77e9('0x32')][_0x77e9('0x58')])){for(var _0x27cbc6=0x0;_0x27cbc6<_0x27e2ec['query'][_0x77e9('0x58')][_0x77e9('0x37')];_0x27cbc6+=0x1){socket[_0x77e9('0x93')](_0x77e9('0x95'),{'UserId':Number(_0x27e2ec[_0x77e9('0x32')]['ids'][_0x27cbc6]),'CmListId':Number(_0x27e2ec[_0x77e9('0x48')]['id'])});}}else{socket[_0x77e9('0x93')]('userCmList:remove',{'UserId':Number(_0x27e2ec[_0x77e9('0x32')][_0x77e9('0x58')]),'CmListId':Number(_0x27e2ec[_0x77e9('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0xef0cc8,null))['catch'](handleError(_0xef0cc8,null));};exports[_0x77e9('0x96')]=function(_0x39408e,_0x3649a8,_0xf4c42c){var _0x3c7962={};var _0x5d91cb={};var _0x2c87a1;var _0x2b5d37;return db[_0x77e9('0x2c')]['findOne']({'where':{'id':_0x39408e[_0x77e9('0x48')]['id']}})[_0x77e9('0x24')](handleEntityNotFound(_0x3649a8,null))[_0x77e9('0x24')](function(_0x437745){if(_0x437745){_0x2c87a1=_0x437745;_0x5d91cb['model']=_[_0x77e9('0x49')](db[_0x77e9('0x97')][_0x77e9('0x2d')]);_0x5d91cb[_0x77e9('0x32')]=_['keys'](_0x39408e[_0x77e9('0x32')]);_0x5d91cb[_0x77e9('0x33')]=_[_0x77e9('0x35')](_0x5d91cb[_0x77e9('0x31')],_0x5d91cb[_0x77e9('0x32')]);_0x3c7962[_0x77e9('0x34')]=_[_0x77e9('0x35')](_0x5d91cb[_0x77e9('0x31')],qs[_0x77e9('0x36')](_0x39408e[_0x77e9('0x32')][_0x77e9('0x36')]));_0x3c7962[_0x77e9('0x34')]=_0x3c7962[_0x77e9('0x34')][_0x77e9('0x37')]?_0x3c7962[_0x77e9('0x34')]:_0x5d91cb[_0x77e9('0x31')];_0x3c7962[_0x77e9('0x3a')]=qs[_0x77e9('0x3b')](_0x39408e['query']['sort']);_0x3c7962['where']=qs[_0x77e9('0x33')](_['pick'](_0x39408e[_0x77e9('0x32')],_0x5d91cb[_0x77e9('0x33')]));if(_0x39408e[_0x77e9('0x32')][_0x77e9('0x3e')]){_0x3c7962[_0x77e9('0x3c')]=_[_0x77e9('0x3f')](_0x3c7962[_0x77e9('0x3c')],{'$or':_[_0x77e9('0x2b')](_0x3c7962[_0x77e9('0x34')],function(_0x28db15){var _0x2740db={};_0x2740db[_0x28db15]={'$like':'%'+_0x39408e[_0x77e9('0x32')]['filter']+'%'};return _0x2740db;})});}_0x3c7962=_['merge']({},_0x3c7962,_0x39408e['options']);return _0x2c87a1[_0x77e9('0x96')](_0x3c7962);}})['then'](function(_0x1c606f){if(_0x1c606f){_0x2b5d37=_0x1c606f[_0x77e9('0x37')];if(!_0x39408e[_0x77e9('0x32')][_0x77e9('0x38')](_0x77e9('0x39'))){_0x3c7962[_0x77e9('0x1f')]=qs[_0x77e9('0x1f')](_0x39408e[_0x77e9('0x32')][_0x77e9('0x1f')]);_0x3c7962[_0x77e9('0x1d')]=qs[_0x77e9('0x1d')](_0x39408e[_0x77e9('0x32')][_0x77e9('0x1d')]);}return _0x2c87a1[_0x77e9('0x96')](_0x3c7962);}})[_0x77e9('0x24')](function(_0x37e71a){if(_0x37e71a){return _0x37e71a?{'count':_0x2b5d37,'rows':_0x37e71a}:null;}})[_0x77e9('0x24')](respondWithResult(_0x3649a8,null))[_0x77e9('0x46')](handleError(_0x3649a8,null));};function handleQuery(_0x2da80b){logger['info'](_0x2da80b);return db[_0x77e9('0x8a')][_0x77e9('0x32')](_0x2da80b)[_0x77e9('0x98')](function(_0x4470db){csv_results[_0x77e9('0x5e')](_0x4470db);})[_0x77e9('0x46')](function(_0xef3cd7){logger['error'](_0xef3cd7[_0x77e9('0x63')]);});} \ No newline at end of file +var _0x95fb=['getDispositions','findOne','order','pick','rows','removeDispositions','addContacts','CmContact','isArray','tags','join','push','each','omit','ids','success','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','getContactsCsv','ContactItemType','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','isEmpty','now','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','sequelize','transaction','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','getCustomFields','getGlobalCustomFields','findAndCountAll','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','info','eml-format','zip-dir','request-promise','bluebird','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','get','destroy','end','error','name','send','index','CmList','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','map','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0x95fb,0x175));var _0xb95f=function(_0x5b19f9,_0x1b0d27){_0x5b19f9=_0x5b19f9-0x0;var _0x19a71b=_0x95fb[_0x5b19f9];return _0x19a71b;};'use strict';var emlformat=require(_0xb95f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb95f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb95f('0x2'));var moment=require('moment');var BPromise=require(_0xb95f('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb95f('0x4'));var sox=require(_0xb95f('0x5'));var csv=require(_0xb95f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb95f('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb95f('0x8'));var jsforce=require(_0xb95f('0x9'));var deskjs=require(_0xb95f('0xa'));var toCsv=require(_0xb95f('0x6'));var querystring=require(_0xb95f('0xb'));var Papa=require(_0xb95f('0xc'));var Redis=require('ioredis');var authService=require(_0xb95f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xb95f('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb95f('0xf'));var config=require(_0xb95f('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xb95f('0x11'))['db'];var csv_results;config[_0xb95f('0x12')]=_[_0xb95f('0x13')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb95f('0x14'))(new Redis(config['redis']));require('./cmList.socket')[_0xb95f('0x15')](socket);function respondWithStatusCode(_0x3a1a07,_0x493c00){_0x493c00=_0x493c00||0xcc;return function(_0x490fd8){if(_0x490fd8){return _0x3a1a07[_0xb95f('0x16')](_0x493c00);}return _0x3a1a07[_0xb95f('0x17')](_0x493c00)['end']();};}function respondWithResult(_0x4b928a,_0x390115){_0x390115=_0x390115||0xc8;return function(_0x40d326){if(_0x40d326){return _0x4b928a[_0xb95f('0x17')](_0x390115)[_0xb95f('0x18')](_0x40d326);}};}function respondWithFilteredResult(_0xdcd618,_0x7853ec){return function(_0x43676c){if(_0x43676c){var _0x36aec1=typeof _0x7853ec[_0xb95f('0x19')]==='undefined'&&typeof _0x7853ec[_0xb95f('0x1a')]===_0xb95f('0x1b');var _0xb466d8=_0x43676c[_0xb95f('0x1c')];var _0x517333=_0x36aec1?0x0:_0x7853ec[_0xb95f('0x19')];var _0x4c64f5=_0x36aec1?_0x43676c['count']:_0x7853ec[_0xb95f('0x19')]+_0x7853ec[_0xb95f('0x1a')];var _0x5821cf;if(_0x4c64f5>=_0xb466d8){_0x4c64f5=_0xb466d8;_0x5821cf=0xc8;}else{_0x5821cf=0xce;}_0xdcd618[_0xb95f('0x17')](_0x5821cf);return _0xdcd618['set'](_0xb95f('0x1d'),_0x517333+'-'+_0x4c64f5+'/'+_0xb466d8)[_0xb95f('0x18')](_0x43676c);}return null;};}function patchUpdates(_0x21f54f){return function(_0x2a7b5f){try{jsonpatch[_0xb95f('0x1e')](_0x2a7b5f,_0x21f54f,!![]);}catch(_0x5464ce){return BPromise[_0xb95f('0x1f')](_0x5464ce);}return _0x2a7b5f[_0xb95f('0x20')]();};}function saveUpdates(_0x4d0433,_0x26d575){return function(_0x22b1f0){if(_0x22b1f0){return _0x22b1f0[_0xb95f('0x21')](_0x4d0433)[_0xb95f('0x22')](function(_0x328534){return _0x328534;});}return null;};}function removeEntity(_0x46e7fe,_0x33cf5d){return function(_0xe0d0c){if(_0xe0d0c){return _0xe0d0c['destroy']()[_0xb95f('0x22')](function(){var _0x48eb76=_0xe0d0c[_0xb95f('0x23')]({'plain':!![]});var _0x404304='Lists';return db['UserProfileResource'][_0xb95f('0x24')]({'where':{'type':_0x404304,'resourceId':_0x48eb76['id']}})[_0xb95f('0x22')](function(){return _0xe0d0c;});})[_0xb95f('0x22')](function(){_0x46e7fe[_0xb95f('0x17')](0xcc)[_0xb95f('0x25')]();});}};}function handleEntityNotFound(_0x197262,_0x2f6538){return function(_0x14332a){if(!_0x14332a){_0x197262[_0xb95f('0x16')](0x194);}return _0x14332a;};}function handleError(_0x560f31,_0x2765b3){_0x2765b3=_0x2765b3||0x1f4;return function(_0x1c7164){logger[_0xb95f('0x26')](_0x1c7164['stack']);if(_0x1c7164['name']){delete _0x1c7164[_0xb95f('0x27')];}_0x560f31[_0xb95f('0x17')](_0x2765b3)[_0xb95f('0x28')](_0x1c7164);};}exports[_0xb95f('0x29')]=function(_0xe7e309,_0x447b43){var _0x47bc2e={},_0x428c14={},_0x55039e={'count':0x0,'rows':[]};var _0xa67219=_['map'](db[_0xb95f('0x2a')]['rawAttributes'],function(_0x5e61a4){return{'name':_0x5e61a4[_0xb95f('0x2b')],'type':_0x5e61a4['type']['key']};});_0x428c14[_0xb95f('0x2c')]=_['map'](_0xa67219,_0xb95f('0x27'));_0x428c14[_0xb95f('0x2d')]=_[_0xb95f('0x2e')](_0xe7e309[_0xb95f('0x2d')]);_0x428c14[_0xb95f('0x2f')]=_[_0xb95f('0x30')](_0x428c14[_0xb95f('0x2c')],_0x428c14[_0xb95f('0x2d')]);_0x47bc2e[_0xb95f('0x31')]=_['intersection'](_0x428c14[_0xb95f('0x2c')],qs[_0xb95f('0x32')](_0xe7e309[_0xb95f('0x2d')][_0xb95f('0x32')]));_0x47bc2e[_0xb95f('0x31')]=_0x47bc2e[_0xb95f('0x31')][_0xb95f('0x33')]?_0x47bc2e[_0xb95f('0x31')]:_0x428c14[_0xb95f('0x2c')];if(!_0xe7e309[_0xb95f('0x2d')][_0xb95f('0x34')](_0xb95f('0x35'))){_0x47bc2e[_0xb95f('0x1a')]=qs[_0xb95f('0x1a')](_0xe7e309[_0xb95f('0x2d')][_0xb95f('0x1a')]);_0x47bc2e[_0xb95f('0x19')]=qs[_0xb95f('0x19')](_0xe7e309['query'][_0xb95f('0x19')]);}_0x47bc2e['order']=qs[_0xb95f('0x36')](_0xe7e309[_0xb95f('0x2d')][_0xb95f('0x36')]);_0x47bc2e[_0xb95f('0x37')]=qs[_0xb95f('0x2f')](_['pick'](_0xe7e309[_0xb95f('0x2d')],_0x428c14[_0xb95f('0x2f')]),_0xa67219);if(_0xe7e309[_0xb95f('0x2d')][_0xb95f('0x38')]){_0x47bc2e[_0xb95f('0x37')]=_['merge'](_0x47bc2e['where'],{'$or':_[_0xb95f('0x39')](_0xa67219,function(_0x5b22e6){if(_0x5b22e6[_0xb95f('0x3a')]!==_0xb95f('0x3b')){var _0x562dab={};_0x562dab[_0x5b22e6['name']]={'$like':'%'+_0xe7e309[_0xb95f('0x2d')]['filter']+'%'};return _0x562dab;}})});}_0x47bc2e=_[_0xb95f('0x3c')]({},_0x47bc2e,_0xe7e309[_0xb95f('0x3d')]);var _0x5d9cd3={'where':_0x47bc2e[_0xb95f('0x37')]};return db[_0xb95f('0x2a')]['count'](_0x5d9cd3)[_0xb95f('0x22')](function(_0x53f6ca){_0x55039e[_0xb95f('0x1c')]=_0x53f6ca;if(_0xe7e309[_0xb95f('0x2d')][_0xb95f('0x3e')]){_0x47bc2e[_0xb95f('0x3f')]=[{'all':!![]}];}return db[_0xb95f('0x2a')][_0xb95f('0x40')](_0x47bc2e);})[_0xb95f('0x22')](function(_0x360013){_0x55039e['rows']=_0x360013;return _0x55039e;})[_0xb95f('0x22')](respondWithFilteredResult(_0x447b43,_0x47bc2e))[_0xb95f('0x41')](handleError(_0x447b43,null));};exports[_0xb95f('0x42')]=function(_0x5a34e8,_0x50e326){var _0x5bf4ca={'raw':![],'where':{'id':_0x5a34e8[_0xb95f('0x43')]['id']}},_0x4a507b={};_0x4a507b['model']=_[_0xb95f('0x2e')](db['CmList'][_0xb95f('0x44')]);_0x4a507b[_0xb95f('0x2d')]=_[_0xb95f('0x2e')](_0x5a34e8[_0xb95f('0x2d')]);_0x4a507b[_0xb95f('0x2f')]=_[_0xb95f('0x30')](_0x4a507b[_0xb95f('0x2c')],_0x4a507b[_0xb95f('0x2d')]);_0x5bf4ca[_0xb95f('0x31')]=_[_0xb95f('0x30')](_0x4a507b[_0xb95f('0x2c')],qs[_0xb95f('0x32')](_0x5a34e8[_0xb95f('0x2d')][_0xb95f('0x32')]));_0x5bf4ca[_0xb95f('0x31')]=_0x5bf4ca['attributes'][_0xb95f('0x33')]?_0x5bf4ca[_0xb95f('0x31')]:_0x4a507b['model'];if(_0x5a34e8[_0xb95f('0x2d')][_0xb95f('0x3e')]){_0x5bf4ca[_0xb95f('0x3f')]=[{'all':!![]}];}_0x5bf4ca=_[_0xb95f('0x3c')]({},_0x5bf4ca,_0x5a34e8[_0xb95f('0x3d')]);return db['CmList'][_0xb95f('0x45')](_0x5bf4ca)[_0xb95f('0x22')](handleEntityNotFound(_0x50e326,null))[_0xb95f('0x22')](respondWithResult(_0x50e326,null))[_0xb95f('0x41')](handleError(_0x50e326,null));};exports[_0xb95f('0x46')]=function(_0x4d04ed,_0x1f233b){return db[_0xb95f('0x2a')][_0xb95f('0x46')](_0x4d04ed[_0xb95f('0x47')],{})[_0xb95f('0x22')](function(_0x225086){var _0x2bc928=_0x4d04ed['user'][_0xb95f('0x23')]({'plain':!![]});if(!_0x2bc928)throw new Error(_0xb95f('0x48'));if(_0x2bc928[_0xb95f('0x49')]===_0xb95f('0x4a')){var _0xbff100=_0x225086[_0xb95f('0x23')]({'plain':!![]});var _0x26af01='Lists';return db[_0xb95f('0x4b')][_0xb95f('0x45')]({'where':{'name':_0x26af01,'userProfileId':_0x2bc928[_0xb95f('0x4c')]},'raw':!![]})[_0xb95f('0x22')](function(_0x1129af){if(_0x1129af&&_0x1129af['autoAssociation']===0x0){return db[_0xb95f('0x4d')][_0xb95f('0x46')]({'name':_0xbff100[_0xb95f('0x27')],'resourceId':_0xbff100['id'],'type':_0x1129af[_0xb95f('0x27')],'sectionId':_0x1129af['id']},{})[_0xb95f('0x22')](function(){return _0x225086;});}else{return _0x225086;}})[_0xb95f('0x41')](function(_0x46fb53){logger[_0xb95f('0x26')](_0xb95f('0x4e'),_0x46fb53);throw _0x46fb53;});}return _0x225086;})[_0xb95f('0x22')](respondWithResult(_0x1f233b,0xc9))[_0xb95f('0x41')](handleError(_0x1f233b,null));};exports[_0xb95f('0x21')]=function(_0x28bc2e,_0x5e1b80){if(_0x28bc2e['body']['id']){delete _0x28bc2e[_0xb95f('0x47')]['id'];}return db[_0xb95f('0x2a')][_0xb95f('0x45')]({'where':{'id':_0x28bc2e['params']['id']}})[_0xb95f('0x22')](handleEntityNotFound(_0x5e1b80,null))['then'](saveUpdates(_0x28bc2e[_0xb95f('0x47')],null))['then'](respondWithResult(_0x5e1b80,null))[_0xb95f('0x41')](handleError(_0x5e1b80,null));};exports[_0xb95f('0x24')]=function(_0x3ade19,_0x1f009a){return db[_0xb95f('0x2a')][_0xb95f('0x45')]({'where':{'id':_0x3ade19['params']['id']}})[_0xb95f('0x22')](handleEntityNotFound(_0x1f009a,null))['then'](removeEntity(_0x1f009a,null))['catch'](handleError(_0x1f009a,null));};exports[_0xb95f('0x4f')]=function(_0x3a707f,_0x7a2aa6){return db[_0xb95f('0x2a')][_0xb95f('0x4f')]()[_0xb95f('0x22')](respondWithResult(_0x7a2aa6,null))[_0xb95f('0x41')](handleError(_0x7a2aa6,null));};exports[_0xb95f('0x50')]=function(_0x1ef516,_0x11e101,_0xce3304){if(_0x1ef516['body']['id']){delete _0x1ef516[_0xb95f('0x47')]['id'];}return db[_0xb95f('0x2a')][_0xb95f('0x45')]({'where':{'id':_0x1ef516['params']['id']}})[_0xb95f('0x22')](handleEntityNotFound(_0x11e101,null))[_0xb95f('0x22')](function(_0x186078){if(_0x186078){_0x1ef516[_0xb95f('0x47')][_0xb95f('0x51')]=_0x186078['id'];return db[_0xb95f('0x52')][_0xb95f('0x46')](_0x1ef516[_0xb95f('0x47')]);}})[_0xb95f('0x22')](respondWithResult(_0x11e101,null))[_0xb95f('0x41')](handleError(_0x11e101,null));};exports[_0xb95f('0x53')]=function(_0x46b04d,_0xb0eade,_0x4aac5f){var _0x544dca={'raw':![],'where':{}};var _0x3aec79={};var _0x12ca22={'count':0x0,'rows':[]};return db[_0xb95f('0x2a')][_0xb95f('0x54')]({'where':{'id':_0x46b04d[_0xb95f('0x43')]['id']}})['then'](handleEntityNotFound(_0xb0eade,null))[_0xb95f('0x22')](function(_0x55a458){if(_0x55a458){_0x3aec79[_0xb95f('0x2c')]=_[_0xb95f('0x2e')](db[_0xb95f('0x52')][_0xb95f('0x44')]);_0x3aec79[_0xb95f('0x2d')]=_[_0xb95f('0x2e')](_0x46b04d[_0xb95f('0x2d')]);_0x3aec79[_0xb95f('0x2f')]=_['intersection'](_0x3aec79[_0xb95f('0x2c')],_0x3aec79[_0xb95f('0x2d')]);_0x544dca[_0xb95f('0x31')]=_['intersection'](_0x3aec79[_0xb95f('0x2c')],qs[_0xb95f('0x32')](_0x46b04d[_0xb95f('0x2d')][_0xb95f('0x32')]));_0x544dca['attributes']=_0x544dca[_0xb95f('0x31')]['length']?_0x544dca[_0xb95f('0x31')]:_0x3aec79[_0xb95f('0x2c')];if(!_0x46b04d[_0xb95f('0x2d')][_0xb95f('0x34')](_0xb95f('0x35'))){_0x544dca['limit']=qs[_0xb95f('0x1a')](_0x46b04d[_0xb95f('0x2d')][_0xb95f('0x1a')]);_0x544dca[_0xb95f('0x19')]=qs['offset'](_0x46b04d[_0xb95f('0x2d')]['offset']);}_0x544dca[_0xb95f('0x55')]=qs[_0xb95f('0x36')](_0x46b04d[_0xb95f('0x2d')][_0xb95f('0x36')]);_0x544dca['where']=qs[_0xb95f('0x2f')](_[_0xb95f('0x56')](_0x46b04d[_0xb95f('0x2d')],_0x3aec79['filters']));_0x544dca[_0xb95f('0x37')][_0xb95f('0x51')]=_0x55a458['id'];if(_0x46b04d[_0xb95f('0x2d')][_0xb95f('0x38')]){_0x544dca[_0xb95f('0x37')]=_['merge'](_0x544dca[_0xb95f('0x37')],{'$or':_[_0xb95f('0x39')](_0x544dca[_0xb95f('0x31')],function(_0x122f53){var _0x303703={};_0x303703[_0x122f53]={'$like':'%'+_0x46b04d[_0xb95f('0x2d')][_0xb95f('0x38')]+'%'};return _0x303703;})});}_0x544dca=_[_0xb95f('0x3c')]({},_0x544dca,_0x46b04d['options']);return db[_0xb95f('0x52')]['count']({'where':_0x544dca[_0xb95f('0x37')]})[_0xb95f('0x22')](function(_0x5014e6){_0x12ca22[_0xb95f('0x1c')]=_0x5014e6;if(_0x46b04d[_0xb95f('0x2d')]['includeAll']){_0x544dca['include']=[{'all':!![]}];}return db[_0xb95f('0x52')][_0xb95f('0x40')](_0x544dca);})[_0xb95f('0x22')](function(_0x210cd5){_0x12ca22[_0xb95f('0x57')]=_0x210cd5;return _0x12ca22;});}})[_0xb95f('0x22')](respondWithFilteredResult(_0xb0eade,_0x544dca))[_0xb95f('0x41')](handleError(_0xb0eade,null));};exports[_0xb95f('0x58')]=function(_0x54276d,_0x2ff534,_0x5e4121){return db[_0xb95f('0x2a')][_0xb95f('0x45')]({'where':{'id':_0x54276d[_0xb95f('0x43')]['id']}})['then'](handleEntityNotFound(_0x2ff534,null))['then'](function(_0x53503c){if(_0x53503c){return _0x53503c[_0xb95f('0x58')](_0x54276d[_0xb95f('0x2d')]['ids']);}})[_0xb95f('0x22')](respondWithStatusCode(_0x2ff534,null))['catch'](handleError(_0x2ff534,null));};exports[_0xb95f('0x59')]=function(_0x1559dd,_0x8c5a6d,_0x32f333){return db[_0xb95f('0x2a')][_0xb95f('0x45')]({'where':{'id':_0x1559dd[_0xb95f('0x43')]['id']}})[_0xb95f('0x22')](handleEntityNotFound(_0x8c5a6d,null))[_0xb95f('0x22')](function(_0x5b1b32){if(_0x5b1b32){var _0x332b1b=[];var _0x38be37={'success':[],'errors':[]};return db[_0xb95f('0x5a')]['describe']()['then'](function(_0x40cb63){if(_0x1559dd[_0xb95f('0x47')]['tags']&&_[_0xb95f('0x5b')](_0x1559dd[_0xb95f('0x47')][_0xb95f('0x5c')])){if(_0x1559dd[_0xb95f('0x47')][_0xb95f('0x5c')][_0xb95f('0x33')]){_0x1559dd[_0xb95f('0x47')][_0xb95f('0x5c')]=_0x1559dd[_0xb95f('0x47')][_0xb95f('0x5c')][_0xb95f('0x5d')](';')+';';}else{_0x1559dd['body'][_0xb95f('0x5c')]=null;}}else{_0x1559dd[_0xb95f('0x47')][_0xb95f('0x5c')]=null;}if(_0x1559dd[_0xb95f('0x47')]&&_[_0xb95f('0x5b')](_0x1559dd['body'])){for(var _0x27bebf=0x0;_0x27bebf<_0x1559dd[_0xb95f('0x47')][_0xb95f('0x33')];_0x27bebf+=0x1){_0x1559dd[_0xb95f('0x47')][_0x27bebf]['ListId']=_0x1559dd[_0xb95f('0x43')]['id'];_0x332b1b[_0xb95f('0x5e')](_0x1559dd[_0xb95f('0x47')][_0x27bebf]);}return BPromise[_0xb95f('0x5f')](_0x332b1b,function(_0xf37df1){return db[_0xb95f('0x5a')]['create'](_[_0xb95f('0x60')](_0xf37df1,[_0xb95f('0x61'),'id'])||{},{'fields':_[_0xb95f('0x2e')](_0x40cb63),'raw':!![]})[_0xb95f('0x22')](function(_0x50671b){_0x38be37[_0xb95f('0x62')]['push'](_0x50671b[_0xb95f('0x63')]);})[_0xb95f('0x41')](function(_0x4b3e5a){_0x38be37['errors'][_0xb95f('0x5e')]({'data':_0xf37df1,'error':_0x4b3e5a[_0xb95f('0x64')]});});})[_0xb95f('0x22')](function(_0x354ca3){return _0x38be37;})[_0xb95f('0x41')](function(_0x15f6dc){return _0x15f6dc;});}else{_0x8c5a6d[_0xb95f('0x17')](0x190)['json']({'message':_0xb95f('0x65')});}});}})[_0xb95f('0x22')](respondWithResult(_0x8c5a6d,null))[_0xb95f('0x41')](handleError(_0x8c5a6d,null));};exports[_0xb95f('0x66')]=function(_0x33886a,_0x8226c9,_0x89a3cf){var _0x25bd99;return db[_0xb95f('0x2a')][_0xb95f('0x45')]({'where':{'id':_0x33886a[_0xb95f('0x43')]['id']},'include':[{'model':db[_0xb95f('0x67')],'as':'CustomFields'}]})[_0xb95f('0x22')](handleEntityNotFound(_0x8226c9,null))[_0xb95f('0x22')](function(_0x5db152){if(_0x5db152){_0x25bd99=_0x5db152;return db[_0xb95f('0x5a')][_0xb95f('0x44')];}})['then'](function(_0x1b8e14){if(_0x1b8e14){var _0x39d8b6={};var _0x3e0cea={};_0x3e0cea[_0xb95f('0x2c')]=_[_0xb95f('0x68')](_['keys'](_0x1b8e14),_[_0xb95f('0x39')](_0x25bd99[_0xb95f('0x69')],function(_0x24b91a){return util['format']('cf_%d',_0x24b91a['id']);}));_0x3e0cea['query']=_[_0xb95f('0x2e')](_0x33886a[_0xb95f('0x2d')]);_0x3e0cea[_0xb95f('0x2f')]=_[_0xb95f('0x30')](_0x3e0cea[_0xb95f('0x2c')],_0x3e0cea['query']);_0x39d8b6[_0xb95f('0x31')]=_['intersection'](_0x3e0cea[_0xb95f('0x2c')],qs[_0xb95f('0x32')](_0x33886a[_0xb95f('0x2d')][_0xb95f('0x32')]));_0x39d8b6[_0xb95f('0x31')]=_0x39d8b6[_0xb95f('0x31')][_0xb95f('0x33')]?_0x39d8b6[_0xb95f('0x31')]:_0x3e0cea['model'];if(!_0x33886a[_0xb95f('0x2d')][_0xb95f('0x34')]('nolimit')){_0x39d8b6['limit']=qs['limit'](_0x33886a[_0xb95f('0x2d')][_0xb95f('0x1a')]);_0x39d8b6['offset']=qs['offset'](_0x33886a[_0xb95f('0x2d')][_0xb95f('0x19')]);}_0x39d8b6['order']=qs[_0xb95f('0x36')](_0x33886a[_0xb95f('0x2d')][_0xb95f('0x36')]);_0x39d8b6[_0xb95f('0x37')]=qs['filters'](_['pick'](_0x33886a[_0xb95f('0x2d')],_0x3e0cea['filters']));_0x39d8b6['raw']=!![];if(_0x33886a['query']['filter']){_0x39d8b6[_0xb95f('0x37')]=_[_0xb95f('0x3c')](_0x39d8b6[_0xb95f('0x37')],{'$or':_[_0xb95f('0x39')](_0x39d8b6[_0xb95f('0x31')],function(_0x182d56){var _0x5774a1={};_0x5774a1[_0x182d56]={'$like':'%'+_0x33886a[_0xb95f('0x2d')][_0xb95f('0x38')]+'%'};return _0x5774a1;})});}_0x39d8b6=_[_0xb95f('0x3c')]({},_0x39d8b6,_0x33886a[_0xb95f('0x3d')]);return _0x25bd99[_0xb95f('0x66')](_0x39d8b6);}})[_0xb95f('0x22')](respondWithResult(_0x8226c9,null))[_0xb95f('0x41')](handleError(_0x8226c9,null));};exports[_0xb95f('0x6a')]=function(_0x55a0a8,_0x324161,_0x125a04){var _0x1698b8;var _0x404ed6;var _0x37085c;var _0x4126a9=_0x55a0a8[_0xb95f('0x43')]['id'];csv_results=[];return db[_0xb95f('0x6b')][_0xb95f('0x40')]({'attributes':['id',_0xb95f('0x27')],'raw':!![],'order':['OrderBy']})[_0xb95f('0x22')](function(_0x3af074){_0x1698b8=_0x3af074;var _0x5d285f=_[_0xb95f('0x2e')](db[_0xb95f('0x5a')][_0xb95f('0x44')]);return db['CmCustomField']['findAll']({'raw':!![],'attributes':['id',_0xb95f('0x6c')]})[_0xb95f('0x22')](function(_0x18fd37){_0x404ed6=_0x18fd37;var _0x144ad2=squel[_0xb95f('0x6d')]()['fields'](_0x5d285f)[_0xb95f('0x6e')](_0xb95f('0x6f'),'c')[_0xb95f('0x37')](_0xb95f('0x70'),_0x4126a9)[_0xb95f('0x37')](_0xb95f('0x71'))['distinct']();for(var _0x2818fc=0x0;_0x2818fc<_0x404ed6[_0xb95f('0x33')];_0x2818fc++){_0x144ad2[_0xb95f('0x72')](_0xb95f('0x73')+_0x404ed6[_0x2818fc]['id'],_0xb95f('0x74')+_0x404ed6[_0x2818fc][_0xb95f('0x6c')]);}for(var _0x2818fc=0x0;_0x2818fc<_0x1698b8[_0xb95f('0x33')];_0x2818fc++){_0x144ad2[_0xb95f('0x72')](squel[_0xb95f('0x6d')]()[_0xb95f('0x72')](_0xb95f('0x75'))[_0xb95f('0x6e')](_0xb95f('0x76'))[_0xb95f('0x37')](_0xb95f('0x77'),_0x1698b8[_0x2818fc]['id'])[_0xb95f('0x37')](_0xb95f('0x78')),'additionalPhone_'+_0x1698b8[_0x2818fc][_0xb95f('0x27')]);_0x144ad2[_0xb95f('0x72')](squel[_0xb95f('0x6d')]()[_0xb95f('0x72')]('description')[_0xb95f('0x6e')](_0xb95f('0x76'))[_0xb95f('0x37')]('ItemTypeId\x20=\x20?',_0x1698b8[_0x2818fc]['id'])['where']('CmContactId\x20=\x20c.id'),_0xb95f('0x79')+_0x1698b8[_0x2818fc][_0xb95f('0x27')]);}var _0x34b6b7=[];_0x34b6b7[_0xb95f('0x5e')](_0x144ad2['toString']());BPromise[_0xb95f('0x5f')](_0x34b6b7,handleQuery)[_0xb95f('0x22')](function(_0xa4d811){handleQuery(_0x144ad2[_0xb95f('0x7a')]());var _0x42e378=csv_results[0x0];if(!_[_0xb95f('0x7b')](_0x42e378)){var _0x2c4aa5=toCsv(_0x42e378);var _0x41a741=Date[_0xb95f('0x7c')]();fs[_0xb95f('0x7d')](util[_0xb95f('0x7e')](_0xb95f('0x7f'),_0x4126a9,_0x41a741),_0x2c4aa5);_0x324161[_0xb95f('0x80')](_0xb95f('0x81'),_0xb95f('0x82')+util[_0xb95f('0x7e')](_0xb95f('0x83'),_0x4126a9,_0x41a741));_0x324161[_0xb95f('0x80')]('Content-type',_0xb95f('0x84'));return _0x324161['download'](util['format']('/tmp/list_%d_%s.csv',_0x4126a9,_0x41a741));}else{return _0x324161['sendStatus'](0xcc);}});});});};exports['addCustomField']=function(_0xb44b65,_0x4f3b68,_0x5445e1){var _0x335b6a;delete _0xb44b65[_0xb95f('0x47')]['id'];return db[_0xb95f('0x2a')][_0xb95f('0x54')]({'where':{'id':_0xb44b65[_0xb95f('0x43')]['id']}})[_0xb95f('0x22')](handleEntityNotFound(_0x4f3b68,null))['then'](function(_0x2b3a05){if(_0x2b3a05){return db[_0xb95f('0x85')][_0xb95f('0x86')](function(_0x3724c8){return db[_0xb95f('0x67')][_0xb95f('0x46')](_0xb44b65[_0xb95f('0x47')],{'transaction':_0x3724c8})[_0xb95f('0x22')](function(_0x3db97d){_0x335b6a=_0x3db97d;return _0x2b3a05['addCustomFields'](_0x3db97d,{'transaction':_0x3724c8});})[_0xb95f('0x22')](function(){var _0x329a22={'type':db['Sequelize']['TEXT'],'transaction':_0x3724c8};switch(_0xb44b65[_0xb95f('0x47')][_0xb95f('0x3a')]){case _0xb95f('0x87'):_0x329a22[_0xb95f('0x3a')]=db[_0xb95f('0x88')]['TEXT'];break;case _0xb95f('0x89'):_0x329a22[_0xb95f('0x3a')]=db[_0xb95f('0x88')][_0xb95f('0x8a')];break;case _0xb95f('0x8b'):_0x329a22[_0xb95f('0x3a')]=db['Sequelize'][_0xb95f('0x8c')];_0x329a22[_0xb95f('0x8d')]=![];break;default:}return db[_0xb95f('0x85')]['queryInterface']['addColumn'](_0xb95f('0x6f'),util[_0xb95f('0x7e')]('cf_%s',_0x335b6a['id']),_0x329a22);})[_0xb95f('0x22')](function(){return _0x335b6a;});});}})[_0xb95f('0x22')](respondWithResult(_0x4f3b68,null))['catch'](handleError(_0x4f3b68,null));};exports[_0xb95f('0x8e')]=function(_0x3a7f03,_0x4e2d2a,_0x57ae10){var _0x50607b={};var _0x4ca783={};var _0x459dce;var _0x23d1c7;return db[_0xb95f('0x2a')][_0xb95f('0x54')]({'where':{'id':_0x3a7f03[_0xb95f('0x43')]['id']}})[_0xb95f('0x22')](handleEntityNotFound(_0x4e2d2a,null))[_0xb95f('0x22')](function(_0x433a4f){if(_0x433a4f){_0x459dce=_0x433a4f;_0x4ca783[_0xb95f('0x2c')]=_[_0xb95f('0x2e')](db[_0xb95f('0x67')]['rawAttributes']);_0x4ca783[_0xb95f('0x2d')]=_[_0xb95f('0x2e')](_0x3a7f03[_0xb95f('0x2d')]);_0x4ca783['filters']=_['intersection'](_0x4ca783[_0xb95f('0x2c')],_0x4ca783[_0xb95f('0x2d')]);_0x50607b[_0xb95f('0x31')]=_[_0xb95f('0x30')](_0x4ca783[_0xb95f('0x2c')],qs[_0xb95f('0x32')](_0x3a7f03[_0xb95f('0x2d')]['fields']));_0x50607b[_0xb95f('0x31')]=_0x50607b[_0xb95f('0x31')][_0xb95f('0x33')]?_0x50607b['attributes']:_0x4ca783[_0xb95f('0x2c')];_0x50607b[_0xb95f('0x55')]=qs[_0xb95f('0x36')](_0x3a7f03[_0xb95f('0x2d')]['sort']);_0x50607b[_0xb95f('0x37')]=qs[_0xb95f('0x2f')](_[_0xb95f('0x56')](_0x3a7f03[_0xb95f('0x2d')],_0x4ca783[_0xb95f('0x2f')]));_0x50607b[_0xb95f('0x37')]=_[_0xb95f('0x3c')](_0x50607b[_0xb95f('0x37')],{'$or':[{'ListId':_0x433a4f['id']},{'ListId':null}]});if(_0x3a7f03[_0xb95f('0x2d')][_0xb95f('0x38')]){_0x50607b[_0xb95f('0x37')]=_[_0xb95f('0x3c')](_0x50607b[_0xb95f('0x37')],{'$or':_[_0xb95f('0x39')](_0x50607b[_0xb95f('0x31')],function(_0x285b75){var _0x508b6c={};_0x508b6c[_0x285b75]={'$like':'%'+_0x3a7f03['query']['filter']+'%'};return _0x508b6c;})});}_0x50607b=_[_0xb95f('0x3c')]({},_0x50607b,_0x3a7f03[_0xb95f('0x3d')]);return db[_0xb95f('0x67')]['findAndCountAll'](_0x50607b);}})[_0xb95f('0x22')](respondWithResult(_0x4e2d2a,null))[_0xb95f('0x41')](handleError(_0x4e2d2a,null));};exports[_0xb95f('0x8f')]=function(_0x2aff23,_0x5c2fd5){return db[_0xb95f('0x67')][_0xb95f('0x90')]({'where':{'ListId':null}})[_0xb95f('0x22')](handleEntityNotFound(_0x5c2fd5,null))['then'](function(_0xc0b551){return _0xc0b551;})[_0xb95f('0x22')](respondWithResult(_0x5c2fd5,null))[_0xb95f('0x41')](handleError(_0x5c2fd5,null));};exports[_0xb95f('0x91')]=function(_0x1ea43d,_0x5d5b11,_0xdf7409){return db['CmList']['find']({'where':{'id':_0x1ea43d[_0xb95f('0x43')]['id']}})[_0xb95f('0x22')](handleEntityNotFound(_0x5d5b11,null))[_0xb95f('0x22')](function(_0x7317d8){if(_0x7317d8){return _0x7317d8[_0xb95f('0x91')](_0x1ea43d[_0xb95f('0x47')][_0xb95f('0x61')],_['omit'](_0x1ea43d['body'],['ids','id'])||{})[_0xb95f('0x92')](function(_0x6c40e5){for(var _0x5d2c74=0x0;_0x5d2c74<_0x1ea43d['body']['ids'][_0xb95f('0x33')];_0x5d2c74+=0x1){socket[_0xb95f('0x93')]('userCmList:save',{'UserId':Number(_0x1ea43d[_0xb95f('0x47')][_0xb95f('0x61')][_0x5d2c74]),'CmListId':Number(_0x1ea43d[_0xb95f('0x43')]['id'])});}return _0x6c40e5;});}})[_0xb95f('0x22')](respondWithResult(_0x5d5b11,null))[_0xb95f('0x41')](handleError(_0x5d5b11,null));};exports['removeAgents']=function(_0x169a16,_0x462c01,_0x4d72dc){return db[_0xb95f('0x2a')][_0xb95f('0x45')]({'where':{'id':_0x169a16[_0xb95f('0x43')]['id']}})[_0xb95f('0x22')](handleEntityNotFound(_0x462c01,null))[_0xb95f('0x22')](function(_0x46c4e2){if(_0x46c4e2){return _0x46c4e2[_0xb95f('0x94')](_0x169a16[_0xb95f('0x2d')]['ids'])[_0xb95f('0x22')](function(){if(_[_0xb95f('0x5b')](_0x169a16[_0xb95f('0x2d')]['ids'])){for(var _0x3eeb41=0x0;_0x3eeb41<_0x169a16['query'][_0xb95f('0x61')][_0xb95f('0x33')];_0x3eeb41+=0x1){socket[_0xb95f('0x93')]('userCmList:remove',{'UserId':Number(_0x169a16['query'][_0xb95f('0x61')][_0x3eeb41]),'CmListId':Number(_0x169a16[_0xb95f('0x43')]['id'])});}}else{socket[_0xb95f('0x93')](_0xb95f('0x95'),{'UserId':Number(_0x169a16[_0xb95f('0x2d')][_0xb95f('0x61')]),'CmListId':Number(_0x169a16[_0xb95f('0x43')]['id'])});}});}})[_0xb95f('0x22')](respondWithStatusCode(_0x462c01,null))[_0xb95f('0x41')](handleError(_0x462c01,null));};exports[_0xb95f('0x96')]=function(_0x5a09b4,_0xf10b58,_0x2da087){var _0x2cfbab={};var _0x447984={};var _0x308156;var _0x9f3134;return db[_0xb95f('0x2a')][_0xb95f('0x54')]({'where':{'id':_0x5a09b4['params']['id']}})[_0xb95f('0x22')](handleEntityNotFound(_0xf10b58,null))['then'](function(_0x5d53c6){if(_0x5d53c6){_0x308156=_0x5d53c6;_0x447984[_0xb95f('0x2c')]=_['keys'](db['User'][_0xb95f('0x44')]);_0x447984[_0xb95f('0x2d')]=_['keys'](_0x5a09b4[_0xb95f('0x2d')]);_0x447984[_0xb95f('0x2f')]=_[_0xb95f('0x30')](_0x447984['model'],_0x447984[_0xb95f('0x2d')]);_0x2cfbab[_0xb95f('0x31')]=_['intersection'](_0x447984[_0xb95f('0x2c')],qs[_0xb95f('0x32')](_0x5a09b4[_0xb95f('0x2d')][_0xb95f('0x32')]));_0x2cfbab['attributes']=_0x2cfbab[_0xb95f('0x31')][_0xb95f('0x33')]?_0x2cfbab[_0xb95f('0x31')]:_0x447984[_0xb95f('0x2c')];_0x2cfbab['order']=qs[_0xb95f('0x36')](_0x5a09b4[_0xb95f('0x2d')][_0xb95f('0x36')]);_0x2cfbab[_0xb95f('0x37')]=qs[_0xb95f('0x2f')](_['pick'](_0x5a09b4[_0xb95f('0x2d')],_0x447984[_0xb95f('0x2f')]));if(_0x5a09b4[_0xb95f('0x2d')][_0xb95f('0x38')]){_0x2cfbab[_0xb95f('0x37')]=_[_0xb95f('0x3c')](_0x2cfbab[_0xb95f('0x37')],{'$or':_[_0xb95f('0x39')](_0x2cfbab['attributes'],function(_0x69643a){var _0x95d6f5={};_0x95d6f5[_0x69643a]={'$like':'%'+_0x5a09b4[_0xb95f('0x2d')][_0xb95f('0x38')]+'%'};return _0x95d6f5;})});}_0x2cfbab=_[_0xb95f('0x3c')]({},_0x2cfbab,_0x5a09b4[_0xb95f('0x3d')]);return _0x308156[_0xb95f('0x96')](_0x2cfbab);}})['then'](function(_0x131d95){if(_0x131d95){_0x9f3134=_0x131d95[_0xb95f('0x33')];if(!_0x5a09b4[_0xb95f('0x2d')][_0xb95f('0x34')](_0xb95f('0x35'))){_0x2cfbab[_0xb95f('0x1a')]=qs[_0xb95f('0x1a')](_0x5a09b4[_0xb95f('0x2d')][_0xb95f('0x1a')]);_0x2cfbab[_0xb95f('0x19')]=qs[_0xb95f('0x19')](_0x5a09b4[_0xb95f('0x2d')][_0xb95f('0x19')]);}return _0x308156[_0xb95f('0x96')](_0x2cfbab);}})[_0xb95f('0x22')](function(_0x34dbf7){if(_0x34dbf7){return _0x34dbf7?{'count':_0x9f3134,'rows':_0x34dbf7}:null;}})['then'](respondWithResult(_0xf10b58,null))[_0xb95f('0x41')](handleError(_0xf10b58,null));};function handleQuery(_0x5f3321){logger[_0xb95f('0x97')](_0x5f3321);return db[_0xb95f('0x85')]['query'](_0x5f3321)[_0xb95f('0x92')](function(_0x2035bd){csv_results[_0xb95f('0x5e')](_0x2035bd);})[_0xb95f('0x41')](function(_0x3958a6){logger['error'](_0x3958a6[_0xb95f('0x64')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 4d68348..b970ff1 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(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0x5fc3,0xa8));var _0x35fc=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x5fc3[_0x422905];return _0x33dc6c;};'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 _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0x5fc3[_0x2fee96];return _0x2e6ad1;};'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 diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index fd12de3..9f845d7 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 _0xaa88=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','CmList','cm_lists','lodash'];(function(_0x2ac926,_0x355542){var _0x1e36b2=function(_0x2b9872){while(--_0x2b9872){_0x2ac926['push'](_0x2ac926['shift']());}};_0x1e36b2(++_0x355542);}(_0xaa88,0x137));var _0x8aa8=function(_0x58ceb9,_0x5601df){_0x58ceb9=_0x58ceb9-0x0;var _0x3d0ff5=_0xaa88[_0x58ceb9];return _0x3d0ff5;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var moment=require('moment');var BPromise=require(_0x8aa8('0x4'));var rp=require(_0x8aa8('0x5'));var fs=require('fs');var path=require(_0x8aa8('0x6'));var rimraf=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var attributes=require(_0x8aa8('0x9'));module['exports']=function(_0x5bda0d,_0x460042){return _0x5bda0d['define'](_0x8aa8('0xa'),attributes,{'tableName':_0x8aa8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa74f=['cm_lists','../../config/logger','bluebird','request-promise','path','rimraf','./cmList.attributes','define','CmList'];(function(_0x2ad2d1,_0x5886a5){var _0x235ef0=function(_0x2a8b1a){while(--_0x2a8b1a){_0x2ad2d1['push'](_0x2ad2d1['shift']());}};_0x235ef0(++_0x5886a5);}(_0xa74f,0x9a));var _0xfa74=function(_0x533528,_0x409d05){_0x533528=_0x533528-0x0;var _0x3189f1=_0xa74f[_0x533528];return _0x3189f1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfa74('0x0'))('api');var moment=require('moment');var BPromise=require(_0xfa74('0x1'));var rp=require(_0xfa74('0x2'));var fs=require('fs');var path=require(_0xfa74('0x3'));var rimraf=require(_0xfa74('0x4'));var config=require('../../config/environment');var attributes=require(_0xfa74('0x5'));module['exports']=function(_0x543cfe,_0x43dd2f){return _0x543cfe[_0xfa74('0x6')](_0xfa74('0x7'),attributes,{'tableName':_0xfa74('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 d425ea9..9894cf8 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 _0xb030=['debug','request\x20sent','stringify','error','code','message','result','catch','lodash','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s'];(function(_0x56491d,_0x3315b4){var _0x18118e=function(_0x2e6bf9){while(--_0x2e6bf9){_0x56491d['push'](_0x56491d['shift']());}};_0x18118e(++_0x3315b4);}(_0xb030,0x102));var _0x0b03=function(_0x4d554d,_0x4e7503){_0x4d554d=_0x4d554d-0x0;var _0x3cf518=_0xb030[_0x4d554d];return _0x3cf518;};'use strict';var _=require(_0x0b03('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0b03('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b03('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x0b03('0x3'))(_0x0b03('0x4'));var config=require(_0x0b03('0x5'));var jayson=require(_0x0b03('0x6'));var client=jayson[_0x0b03('0x7')][_0x0b03('0x8')]({'port':0x232a});config[_0x0b03('0x9')]=_[_0x0b03('0xa')](config[_0x0b03('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0b03('0xb'))[_0x0b03('0xc')](socket);function respondWithRpcPromise(_0x5759e4,_0x40a0f1,_0x12839c){return new BPromise(function(_0x120c9d,_0x32aa0e){return client[_0x0b03('0xd')](_0x5759e4,_0x12839c)[_0x0b03('0xe')](function(_0x1d44d2){logger[_0x0b03('0xf')](_0x0b03('0x10'),_0x40a0f1,'request\x20sent');logger[_0x0b03('0x11')]('CmList,\x20%s,\x20%s,\x20%s',_0x40a0f1,_0x0b03('0x12'),JSON[_0x0b03('0x13')](_0x1d44d2));if(_0x1d44d2['error']){if(_0x1d44d2[_0x0b03('0x14')][_0x0b03('0x15')]===0x1f4){logger['error'](_0x0b03('0x10'),_0x40a0f1,_0x1d44d2['error']['message']);return _0x32aa0e(_0x1d44d2[_0x0b03('0x14')][_0x0b03('0x16')]);}logger[_0x0b03('0x14')](_0x0b03('0x10'),_0x40a0f1,_0x1d44d2[_0x0b03('0x14')][_0x0b03('0x16')]);return _0x120c9d(_0x1d44d2[_0x0b03('0x14')][_0x0b03('0x16')]);}else{logger[_0x0b03('0xf')](_0x0b03('0x10'),_0x40a0f1,_0x0b03('0x12'));_0x120c9d(_0x1d44d2[_0x0b03('0x17')]['message']);}})[_0x0b03('0x18')](function(_0x45888a){logger[_0x0b03('0x14')](_0x0b03('0x10'),_0x40a0f1,_0x45888a);_0x32aa0e(_0x45888a);});});} \ No newline at end of file +var _0x6fae=['debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmList,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./cmList.socket','register','request','info','request\x20sent'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6fae,0xb1));var _0xe6fa=function(_0x46a6a4,_0xa108f4){_0x46a6a4=_0x46a6a4-0x0;var _0x301868=_0x6fae[_0x46a6a4];return _0x301868;};'use strict';var _=require(_0xe6fa('0x0'));var util=require(_0xe6fa('0x1'));var moment=require(_0xe6fa('0x2'));var BPromise=require(_0xe6fa('0x3'));var rs=require(_0xe6fa('0x4'));var fs=require('fs');var Redis=require(_0xe6fa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe6fa('0x6'));var logger=require(_0xe6fa('0x7'))(_0xe6fa('0x8'));var config=require(_0xe6fa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe6fa('0xa')]['http']({'port':0x232a});config[_0xe6fa('0xb')]=_['defaults'](config[_0xe6fa('0xb')],{'host':_0xe6fa('0xc'),'port':0x18eb});var socket=require(_0xe6fa('0xd'))(new Redis(config[_0xe6fa('0xb')]));require(_0xe6fa('0xe'))[_0xe6fa('0xf')](socket);function respondWithRpcPromise(_0xd96732,_0x1565a1,_0x3d3b7c){return new BPromise(function(_0x292cb1,_0x26ef44){return client[_0xe6fa('0x10')](_0xd96732,_0x3d3b7c)['then'](function(_0x1ae1cf){logger[_0xe6fa('0x11')]('CmList,\x20%s,\x20%s',_0x1565a1,_0xe6fa('0x12'));logger[_0xe6fa('0x13')](_0xe6fa('0x14'),_0x1565a1,_0xe6fa('0x12'),JSON[_0xe6fa('0x15')](_0x1ae1cf));if(_0x1ae1cf[_0xe6fa('0x16')]){if(_0x1ae1cf[_0xe6fa('0x16')][_0xe6fa('0x17')]===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x1565a1,_0x1ae1cf[_0xe6fa('0x16')][_0xe6fa('0x18')]);return _0x26ef44(_0x1ae1cf[_0xe6fa('0x16')][_0xe6fa('0x18')]);}logger['error'](_0xe6fa('0x19'),_0x1565a1,_0x1ae1cf[_0xe6fa('0x16')][_0xe6fa('0x18')]);return _0x292cb1(_0x1ae1cf[_0xe6fa('0x16')][_0xe6fa('0x18')]);}else{logger['info'](_0xe6fa('0x19'),_0x1565a1,_0xe6fa('0x12'));_0x292cb1(_0x1ae1cf[_0xe6fa('0x1a')]['message']);}})[_0xe6fa('0x1b')](function(_0xff3fa9){logger['error'](_0xe6fa('0x19'),_0x1565a1,_0xff3fa9);_0x26ef44(_0xff3fa9);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index e8c0a4b..7cd9cd4 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 _0x048c=['remove','update','emit','length','./cmList.events','save'];(function(_0x1c641f,_0x53f97c){var _0x2f195c=function(_0x159bd0){while(--_0x159bd0){_0x1c641f['push'](_0x1c641f['shift']());}};_0x2f195c(++_0x53f97c);}(_0x048c,0xc4));var _0xc048=function(_0x30142c,_0xce7c43){_0x30142c=_0x30142c-0x0;var _0x3f8924=_0x048c[_0x30142c];return _0x3f8924;};'use strict';var CmListEvents=require(_0xc048('0x0'));var events=[_0xc048('0x1'),_0xc048('0x2'),_0xc048('0x3')];function createListener(_0x3e4608,_0x585457){return function(_0x40d8fc){_0x585457[_0xc048('0x4')](_0x3e4608,_0x40d8fc);};}function removeListener(_0x1b54fd,_0x409c15){return function(){CmListEvents['removeListener'](_0x1b54fd,_0x409c15);};}exports['register']=function(_0x2a1e09){for(var _0x2a4a93=0x0,_0x55d6e5=events[_0xc048('0x5')];_0x2a4a93<_0x55d6e5;_0x2a4a93++){var _0x400714=events[_0x2a4a93];var _0x46eed0=createListener('cmList:'+_0x400714,_0x2a1e09);CmListEvents['on'](_0x400714,_0x46eed0);}}; \ No newline at end of file +var _0x0535=['length','cmList:','./cmList.events','save','update','emit','removeListener','register'];(function(_0x508338,_0xcf1f4d){var _0x1ccd1b=function(_0x3b4525){while(--_0x3b4525){_0x508338['push'](_0x508338['shift']());}};_0x1ccd1b(++_0xcf1f4d);}(_0x0535,0x132));var _0x5053=function(_0x4e3b13,_0xdde621){_0x4e3b13=_0x4e3b13-0x0;var _0x30dbfa=_0x0535[_0x4e3b13];return _0x30dbfa;};'use strict';var CmListEvents=require(_0x5053('0x0'));var events=[_0x5053('0x1'),'remove',_0x5053('0x2')];function createListener(_0x809a46,_0x4537ff){return function(_0x33e76d){_0x4537ff[_0x5053('0x3')](_0x809a46,_0x33e76d);};}function removeListener(_0x5a703c,_0x466981){return function(){CmListEvents[_0x5053('0x4')](_0x5a703c,_0x466981);};}exports[_0x5053('0x5')]=function(_0x468100){for(var _0x482d2a=0x0,_0x3232e9=events[_0x5053('0x6')];_0x482d2a<_0x3232e9;_0x482d2a++){var _0x8cc518=events[_0x482d2a];var _0xdcebeb=createListener(_0x5053('0x7')+_0x8cc518,_0x468100);CmListEvents['on'](_0x8cc518,_0xdcebeb);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 67077da..ceeeae5 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 _0xa57a=['create','post','addCustomField','put','delete','destroy','removeDispositions','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','getGlobalCustomFields','/:id','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents'];(function(_0x1fb660,_0x2af604){var _0x2d9e94=function(_0x400826){while(--_0x400826){_0x1fb660['push'](_0x1fb660['shift']());}};_0x2d9e94(++_0x2af604);}(_0xa57a,0x173));var _0xaa57=function(_0x289311,_0x4f5720){_0x289311=_0x289311-0x0;var _0x4a3720=_0xa57a[_0x289311];return _0x4a3720;};'use strict';var multer=require('multer');var util=require(_0xaa57('0x0'));var path=require(_0xaa57('0x1'));var timeout=require(_0xaa57('0x2'));var express=require(_0xaa57('0x3'));var router=express[_0xaa57('0x4')]();var fs_extra=require(_0xaa57('0x5'));var auth=require(_0xaa57('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xaa57('0x7'));var controller=require(_0xaa57('0x8'));router[_0xaa57('0x9')]('/',auth[_0xaa57('0xa')](),controller[_0xaa57('0xb')]);router[_0xaa57('0x9')](_0xaa57('0xc'),auth[_0xaa57('0xa')](),controller[_0xaa57('0xd')]);router['get']('/global_fields',auth[_0xaa57('0xa')](),controller[_0xaa57('0xe')]);router[_0xaa57('0x9')](_0xaa57('0xf'),auth[_0xaa57('0xa')](),controller[_0xaa57('0x10')]);router[_0xaa57('0x9')]('/:id/dispositions',auth[_0xaa57('0xa')](),controller[_0xaa57('0x11')]);router[_0xaa57('0x9')](_0xaa57('0x12'),auth[_0xaa57('0xa')](),controller[_0xaa57('0x13')]);router[_0xaa57('0x9')](_0xaa57('0x14'),auth[_0xaa57('0xa')](),controller['getContactsCsv']);router[_0xaa57('0x9')](_0xaa57('0x15'),auth[_0xaa57('0xa')](),controller[_0xaa57('0x16')]);router['get'](_0xaa57('0x17'),auth[_0xaa57('0xa')](),controller[_0xaa57('0x18')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaa57('0x19')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0xaa57('0x1a')](_0xaa57('0x12'),auth['isAuthenticated'](),controller['addContacts']);router[_0xaa57('0x1a')](_0xaa57('0x15'),auth[_0xaa57('0xa')](),controller[_0xaa57('0x1b')]);router[_0xaa57('0x1a')](_0xaa57('0x17'),auth[_0xaa57('0xa')](),controller['addAgents']);router[_0xaa57('0x1c')](_0xaa57('0xf'),auth[_0xaa57('0xa')](),controller['update']);router[_0xaa57('0x1d')](_0xaa57('0xf'),auth[_0xaa57('0xa')](),controller[_0xaa57('0x1e')]);router[_0xaa57('0x1d')]('/:id/dispositions',auth[_0xaa57('0xa')](),controller[_0xaa57('0x1f')]);router[_0xaa57('0x1d')](_0xaa57('0x17'),auth[_0xaa57('0xa')](),controller[_0xaa57('0x20')]);module['exports']=router; \ No newline at end of file +var _0xeb1e=['index','/describe','isAuthenticated','describe','/global_fields','/:id','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/users','getAgents','post','create','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0xeb1e,0x115));var _0xeeb1=function(_0x30daaa,_0x3d3678){_0x30daaa=_0x30daaa-0x0;var _0x4c6b0a=_0xeb1e[_0x30daaa];return _0x4c6b0a;};'use strict';var multer=require(_0xeeb1('0x0'));var util=require(_0xeeb1('0x1'));var path=require(_0xeeb1('0x2'));var timeout=require(_0xeeb1('0x3'));var express=require('express');var router=express[_0xeeb1('0x4')]();var fs_extra=require(_0xeeb1('0x5'));var auth=require(_0xeeb1('0x6'));var interaction=require(_0xeeb1('0x7'));var config=require(_0xeeb1('0x8'));var controller=require(_0xeeb1('0x9'));router[_0xeeb1('0xa')]('/',auth['isAuthenticated'](),controller[_0xeeb1('0xb')]);router['get'](_0xeeb1('0xc'),auth[_0xeeb1('0xd')](),controller[_0xeeb1('0xe')]);router[_0xeeb1('0xa')](_0xeeb1('0xf'),auth['isAuthenticated'](),controller['getGlobalCustomFields']);router['get'](_0xeeb1('0x10'),auth[_0xeeb1('0xd')](),controller['show']);router['get'](_0xeeb1('0x11'),auth['isAuthenticated'](),controller[_0xeeb1('0x12')]);router[_0xeeb1('0xa')]('/:id/contacts',auth[_0xeeb1('0xd')](),controller[_0xeeb1('0x13')]);router['get'](_0xeeb1('0x14'),auth[_0xeeb1('0xd')](),controller[_0xeeb1('0x15')]);router[_0xeeb1('0xa')]('/:id/fields',auth[_0xeeb1('0xd')](),controller['getCustomFields']);router[_0xeeb1('0xa')](_0xeeb1('0x16'),auth[_0xeeb1('0xd')](),controller[_0xeeb1('0x17')]);router[_0xeeb1('0x18')]('/',auth[_0xeeb1('0xd')](),controller[_0xeeb1('0x19')]);router[_0xeeb1('0x18')]('/:id/dispositions',auth[_0xeeb1('0xd')](),controller[_0xeeb1('0x1a')]);router['post']('/:id/contacts',auth['isAuthenticated'](),controller[_0xeeb1('0x1b')]);router[_0xeeb1('0x18')](_0xeeb1('0x1c'),auth['isAuthenticated'](),controller[_0xeeb1('0x1d')]);router[_0xeeb1('0x18')](_0xeeb1('0x16'),auth[_0xeeb1('0xd')](),controller[_0xeeb1('0x1e')]);router[_0xeeb1('0x1f')](_0xeeb1('0x10'),auth[_0xeeb1('0xd')](),controller[_0xeeb1('0x20')]);router[_0xeeb1('0x21')](_0xeeb1('0x10'),auth['isAuthenticated'](),controller[_0xeeb1('0x22')]);router[_0xeeb1('0x21')](_0xeeb1('0x11'),auth[_0xeeb1('0xd')](),controller[_0xeeb1('0x23')]);router['delete'](_0xeeb1('0x16'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 37ffcc7..3b8dba1 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 _0x6272=['STRING','sequelize','exports','VIRTUAL','getDataValue','field'];(function(_0x119705,_0xba9427){var _0x2affc2=function(_0x16f7e2){while(--_0x16f7e2){_0x119705['push'](_0x119705['shift']());}};_0x2affc2(++_0xba9427);}(_0x6272,0x1ed));var _0x2627=function(_0x494f47,_0x24d532){_0x494f47=_0x494f47-0x0;var _0x700a44=_0x6272[_0x494f47];return _0x700a44;};'use strict';var Sequelize=require(_0x2627('0x0'));module[_0x2627('0x1')]={'name':{'type':Sequelize[_0x2627('0x2')],'get':function(_0x562cd7){return this[_0x2627('0x3')](_0x2627('0x4'));}},'field':{'type':Sequelize[_0x2627('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x2627('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0x2627('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0x89fe=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x5a2674,_0x1c7e75){var _0x48c89c=function(_0x528eff){while(--_0x528eff){_0x5a2674['push'](_0x5a2674['shift']());}};_0x48c89c(++_0x1c7e75);}(_0x89fe,0x188));var _0xe89f=function(_0x3aebdd,_0x1ad66f){_0x3aebdd=_0x3aebdd-0x0;var _0x1e8879=_0x89fe[_0x3aebdd];return _0x1e8879;};'use strict';var Sequelize=require(_0xe89f('0x0'));module[_0xe89f('0x1')]={'name':{'type':Sequelize[_0xe89f('0x2')],'get':function(_0x4bda19){return this['getDataValue'](_0xe89f('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xe89f('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xe89f('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index f4da4ae..2a62ca6 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(_0x3ab129,_0x561edc){var _0x1143ac=function(_0xf9a04a){while(--_0xf9a04a){_0x3ab129['push'](_0x3ab129['shift']());}};_0x1143ac(++_0x561edc);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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(_0x5b3993,_0x3a0b60){var _0x246a9a=function(_0x250965){while(--_0x250965){_0x5b3993['push'](_0x5b3993['shift']());}};_0x246a9a(++_0x3a0b60);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 aa7b2e1..cc3b345 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 _0x8fa5=['lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./condition.attributes','define','Condition'];(function(_0xb833b1,_0x1c3d3f){var _0x1ab87a=function(_0x1c9f6c){while(--_0x1c9f6c){_0xb833b1['push'](_0xb833b1['shift']());}};_0x1ab87a(++_0x1c3d3f);}(_0x8fa5,0x1cc));var _0x58fa=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8fa5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x58fa('0x0'));var util=require('util');var logger=require(_0x58fa('0x1'))(_0x58fa('0x2'));var moment=require('moment');var BPromise=require(_0x58fa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x58fa('0x4'));var rimraf=require(_0x58fa('0x5'));var config=require(_0x58fa('0x6'));var attributes=require(_0x58fa('0x7'));module['exports']=function(_0x405609,_0x1f492){return _0x405609[_0x58fa('0x8')](_0x58fa('0x9'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3a9=['exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','request-promise','rimraf'];(function(_0x12b8ec,_0x1655be){var _0x21af77=function(_0xe59f){while(--_0xe59f){_0x12b8ec['push'](_0x12b8ec['shift']());}};_0x21af77(++_0x1655be);}(_0xe3a9,0xea));var _0x9e3a=function(_0x13606d,_0x30f265){_0x13606d=_0x13606d-0x0;var _0x1b85b0=_0xe3a9[_0x13606d];return _0x1b85b0;};'use strict';var _=require(_0x9e3a('0x0'));var util=require(_0x9e3a('0x1'));var logger=require(_0x9e3a('0x2'))(_0x9e3a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9e3a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9e3a('0x5'));var config=require('../../config/environment');var attributes=require('./condition.attributes');module[_0x9e3a('0x6')]=function(_0x1f39b0,_0x1984ad){return _0x1f39b0[_0x9e3a('0x7')](_0x9e3a('0x8'),attributes,{'tableName':_0x9e3a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 984d3c0..ffee127 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 _0x8613=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Condition,\x20%s,\x20%s','message','info'];(function(_0x1d4de6,_0x299a81){var _0x1f8188=function(_0x340b33){while(--_0x340b33){_0x1d4de6['push'](_0x1d4de6['shift']());}};_0x1f8188(++_0x299a81);}(_0x8613,0x1e5));var _0x3861=function(_0x364048,_0x34dea3){_0x364048=_0x364048-0x0;var _0x591678=_0x8613[_0x364048];return _0x591678;};'use strict';var _=require(_0x3861('0x0'));var util=require('util');var moment=require(_0x3861('0x1'));var BPromise=require(_0x3861('0x2'));var rs=require(_0x3861('0x3'));var fs=require('fs');var Redis=require(_0x3861('0x4'));var db=require(_0x3861('0x5'))['db'];var utils=require(_0x3861('0x6'));var logger=require(_0x3861('0x7'))(_0x3861('0x8'));var config=require(_0x3861('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3861('0xa')][_0x3861('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39dea8,_0x1286e7,_0xf70944){return new BPromise(function(_0x3f421f,_0x5a27b1){return client['request'](_0x39dea8,_0xf70944)[_0x3861('0xc')](function(_0x2c20df){logger['info']('Condition,\x20%s,\x20%s',_0x1286e7,'request\x20sent');logger['debug'](_0x3861('0xd'),_0x1286e7,_0x3861('0xe'),JSON[_0x3861('0xf')](_0x2c20df));if(_0x2c20df[_0x3861('0x10')]){if(_0x2c20df['error'][_0x3861('0x11')]===0x1f4){logger[_0x3861('0x10')](_0x3861('0x12'),_0x1286e7,_0x2c20df[_0x3861('0x10')][_0x3861('0x13')]);return _0x5a27b1(_0x2c20df['error']['message']);}logger[_0x3861('0x10')]('Condition,\x20%s,\x20%s',_0x1286e7,_0x2c20df[_0x3861('0x10')]['message']);return _0x3f421f(_0x2c20df['error'][_0x3861('0x13')]);}else{logger[_0x3861('0x14')](_0x3861('0x12'),_0x1286e7,_0x3861('0xe'));_0x3f421f(_0x2c20df[_0x3861('0x15')][_0x3861('0x13')]);}})[_0x3861('0x16')](function(_0x51f883){logger[_0x3861('0x10')](_0x3861('0x12'),_0x1286e7,_0x51f883);_0x5a27b1(_0x51f883);});});} \ No newline at end of file +var _0x8b3b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','code','error','message','Condition,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4768b6,_0x4eb7af){var _0x578d77=function(_0x3d190d){while(--_0x3d190d){_0x4768b6['push'](_0x4768b6['shift']());}};_0x578d77(++_0x4eb7af);}(_0x8b3b,0x8a));var _0xb8b3=function(_0x31c27f,_0x40294c){_0x31c27f=_0x31c27f-0x0;var _0x28f9c6=_0x8b3b[_0x31c27f];return _0x28f9c6;};'use strict';var _=require(_0xb8b3('0x0'));var util=require(_0xb8b3('0x1'));var moment=require('moment');var BPromise=require(_0xb8b3('0x2'));var rs=require(_0xb8b3('0x3'));var fs=require('fs');var Redis=require(_0xb8b3('0x4'));var db=require(_0xb8b3('0x5'))['db'];var utils=require(_0xb8b3('0x6'));var logger=require(_0xb8b3('0x7'))(_0xb8b3('0x8'));var config=require(_0xb8b3('0x9'));var jayson=require(_0xb8b3('0xa'));var client=jayson[_0xb8b3('0xb')][_0xb8b3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc13e68,_0x28b450,_0x3f75ad){return new BPromise(function(_0x3d1121,_0xfa5fe0){return client[_0xb8b3('0xd')](_0xc13e68,_0x3f75ad)[_0xb8b3('0xe')](function(_0x527f37){logger[_0xb8b3('0xf')]('Condition,\x20%s,\x20%s',_0x28b450,_0xb8b3('0x10'));logger[_0xb8b3('0x11')](_0xb8b3('0x12'),_0x28b450,_0xb8b3('0x10'),JSON['stringify'](_0x527f37));if(_0x527f37['error']){if(_0x527f37['error'][_0xb8b3('0x13')]===0x1f4){logger[_0xb8b3('0x14')]('Condition,\x20%s,\x20%s',_0x28b450,_0x527f37['error'][_0xb8b3('0x15')]);return _0xfa5fe0(_0x527f37['error'][_0xb8b3('0x15')]);}logger[_0xb8b3('0x14')](_0xb8b3('0x16'),_0x28b450,_0x527f37[_0xb8b3('0x14')]['message']);return _0x3d1121(_0x527f37['error']['message']);}else{logger[_0xb8b3('0xf')]('Condition,\x20%s,\x20%s',_0x28b450,_0xb8b3('0x10'));_0x3d1121(_0x527f37[_0xb8b3('0x17')][_0xb8b3('0x15')]);}})['catch'](function(_0x5f1862){logger[_0xb8b3('0x14')](_0xb8b3('0x16'),_0x28b450,_0x5f1862);_0xfa5fe0(_0x5f1862);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 941de8f..6276d35 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 _0xbc8d=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./condition.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','multer','util'];(function(_0x704b2a,_0x6acd82){var _0x56913e=function(_0x21acea){while(--_0x21acea){_0x704b2a['push'](_0x704b2a['shift']());}};_0x56913e(++_0x6acd82);}(_0xbc8d,0xde));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xdbc8('0x0'));var util=require(_0xdbc8('0x1'));var path=require(_0xdbc8('0x2'));var timeout=require('connect-timeout');var express=require(_0xdbc8('0x3'));var router=express[_0xdbc8('0x4')]();var fs_extra=require(_0xdbc8('0x5'));var auth=require(_0xdbc8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdbc8('0x7'));var controller=require(_0xdbc8('0x8'));router[_0xdbc8('0x9')](_0xdbc8('0xa'),auth['isAuthenticated'](),controller[_0xdbc8('0xb')]);router[_0xdbc8('0xc')](_0xdbc8('0xa'),auth[_0xdbc8('0xd')](),controller[_0xdbc8('0xe')]);module[_0xdbc8('0xf')]=router; \ No newline at end of file +var _0xc78c=['../../components/interaction/service','../../config/environment','./condition.controller','update','delete','/:id','isAuthenticated','destroy','exports','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x5762cc,_0xffa080){var _0x1d66b5=function(_0x13fef0){while(--_0x13fef0){_0x5762cc['push'](_0x5762cc['shift']());}};_0x1d66b5(++_0xffa080);}(_0xc78c,0x6b));var _0xcc78=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xc78c[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require('multer');var util=require(_0xcc78('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc78('0x1'));var router=express[_0xcc78('0x2')]();var fs_extra=require(_0xcc78('0x3'));var auth=require(_0xcc78('0x4'));var interaction=require(_0xcc78('0x5'));var config=require(_0xcc78('0x6'));var controller=require(_0xcc78('0x7'));router['put']('/:id',auth['isAuthenticated'](),controller[_0xcc78('0x8')]);router[_0xcc78('0x9')](_0xcc78('0xa'),auth[_0xcc78('0xb')](),controller[_0xcc78('0xc')]);module[_0xcc78('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 7fc3454..25c16d9 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 _0x67d0=['name','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x67d0,0x1c7));var _0x067d=function(_0x26fc96,_0x51168f){_0x26fc96=_0x26fc96-0x0;var _0x57e913=_0x67d0[_0x26fc96];return _0x57e913;};'use strict';var Sequelize=require(_0x067d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x067d('0x1')},'OrderBy':{'type':Sequelize[_0x067d('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x252f=['sequelize','exports','INTEGER','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x252f,0xd0));var _0xf252=function(_0x5eb4bb,_0xbd4598){_0x5eb4bb=_0x5eb4bb-0x0;var _0x12d25b=_0x252f[_0x5eb4bb];return _0x12d25b;};'use strict';var Sequelize=require(_0xf252('0x0'));module[_0xf252('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0xf252('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xf252('0x3')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 26e3f71..4645ca5 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 _0x6a95=['get','ContactItemTypes','error','name','send','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','show','keys','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy'];(function(_0x316245,_0x55e17d){var _0xbce48b=function(_0x4c0a47){while(--_0x4c0a47){_0x316245['push'](_0x316245['shift']());}};_0xbce48b(++_0x55e17d);}(_0x6a95,0x1db));var _0x56a9=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x6a95[_0x34021d];return _0x16597b;};'use strict';var emlformat=require(_0x56a9('0x0'));var rimraf=require(_0x56a9('0x1'));var zipdir=require(_0x56a9('0x2'));var jsonpatch=require(_0x56a9('0x3'));var rp=require(_0x56a9('0x4'));var moment=require(_0x56a9('0x5'));var BPromise=require(_0x56a9('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x56a9('0x7'));var sox=require(_0x56a9('0x8'));var csv=require(_0x56a9('0x9'));var ejs=require(_0x56a9('0xa'));var fs=require('fs');var fs_extra=require(_0x56a9('0xb'));var _=require(_0x56a9('0xc'));var squel=require(_0x56a9('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x56a9('0xe'));var toCsv=require(_0x56a9('0x9'));var querystring=require('querystring');var Papa=require(_0x56a9('0xf'));var Redis=require(_0x56a9('0x10'));var authService=require(_0x56a9('0x11'));var qs=require(_0x56a9('0x12'));var as=require(_0x56a9('0x13'));var hardwareService=require(_0x56a9('0x14'));var logger=require(_0x56a9('0x15'))(_0x56a9('0x16'));var utils=require(_0x56a9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x56a9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b2c7f,_0x4552ce){_0x4552ce=_0x4552ce||0xcc;return function(_0x420667){if(_0x420667){return _0x2b2c7f[_0x56a9('0x19')](_0x4552ce);}return _0x2b2c7f[_0x56a9('0x1a')](_0x4552ce)[_0x56a9('0x1b')]();};}function respondWithResult(_0x124ab8,_0x1a2eb4){_0x1a2eb4=_0x1a2eb4||0xc8;return function(_0x40b2cb){if(_0x40b2cb){return _0x124ab8['status'](_0x1a2eb4)['json'](_0x40b2cb);}};}function respondWithFilteredResult(_0x2e0dfd,_0x2a0714){return function(_0x42007b){if(_0x42007b){var _0x46f854=typeof _0x2a0714['offset']===_0x56a9('0x1c')&&typeof _0x2a0714['limit']==='undefined';var _0x4e292f=_0x42007b[_0x56a9('0x1d')];var _0x576bdf=_0x46f854?0x0:_0x2a0714[_0x56a9('0x1e')];var _0x105fe5=_0x46f854?_0x42007b[_0x56a9('0x1d')]:_0x2a0714[_0x56a9('0x1e')]+_0x2a0714[_0x56a9('0x1f')];var _0xbfeb1a;if(_0x105fe5>=_0x4e292f){_0x105fe5=_0x4e292f;_0xbfeb1a=0xc8;}else{_0xbfeb1a=0xce;}_0x2e0dfd[_0x56a9('0x1a')](_0xbfeb1a);return _0x2e0dfd[_0x56a9('0x20')](_0x56a9('0x21'),_0x576bdf+'-'+_0x105fe5+'/'+_0x4e292f)[_0x56a9('0x22')](_0x42007b);}return null;};}function patchUpdates(_0x5f145f){return function(_0x5bc03a){try{jsonpatch[_0x56a9('0x23')](_0x5bc03a,_0x5f145f,!![]);}catch(_0x16f9de){return BPromise[_0x56a9('0x24')](_0x16f9de);}return _0x5bc03a[_0x56a9('0x25')]();};}function saveUpdates(_0x4a09e5,_0x6100fe){return function(_0x3355c4){if(_0x3355c4){return _0x3355c4[_0x56a9('0x26')](_0x4a09e5)[_0x56a9('0x27')](function(_0x5a82e0){return _0x5a82e0;});}return null;};}function removeEntity(_0x44762e,_0x32839b){return function(_0x21ab38){if(_0x21ab38){return _0x21ab38[_0x56a9('0x28')]()[_0x56a9('0x27')](function(){var _0x52016c=_0x21ab38[_0x56a9('0x29')]({'plain':!![]});var _0x217bda=_0x56a9('0x2a');return db['UserProfileResource'][_0x56a9('0x28')]({'where':{'type':_0x217bda,'resourceId':_0x52016c['id']}})['then'](function(){return _0x21ab38;});})[_0x56a9('0x27')](function(){_0x44762e[_0x56a9('0x1a')](0xcc)[_0x56a9('0x1b')]();});}};}function handleEntityNotFound(_0x20432a,_0x45f38c){return function(_0x1afe8a){if(!_0x1afe8a){_0x20432a[_0x56a9('0x19')](0x194);}return _0x1afe8a;};}function handleError(_0xff5f55,_0x51fd64){_0x51fd64=_0x51fd64||0x1f4;return function(_0x437ccf){logger[_0x56a9('0x2b')](_0x437ccf['stack']);if(_0x437ccf[_0x56a9('0x2c')]){delete _0x437ccf['name'];}_0xff5f55['status'](_0x51fd64)[_0x56a9('0x2d')](_0x437ccf);};}exports['index']=function(_0x2f933a,_0x11002a){var _0x2fbd5d={},_0x2c1c3d={},_0x5879db={'count':0x0,'rows':[]};var _0x332707=_[_0x56a9('0x2e')](db[_0x56a9('0x2f')][_0x56a9('0x30')],function(_0xbbb47d){return{'name':_0xbbb47d[_0x56a9('0x31')],'type':_0xbbb47d[_0x56a9('0x32')][_0x56a9('0x33')]};});_0x2c1c3d[_0x56a9('0x34')]=_[_0x56a9('0x2e')](_0x332707,_0x56a9('0x2c'));_0x2c1c3d[_0x56a9('0x35')]=_['keys'](_0x2f933a[_0x56a9('0x35')]);_0x2c1c3d[_0x56a9('0x36')]=_[_0x56a9('0x37')](_0x2c1c3d['model'],_0x2c1c3d[_0x56a9('0x35')]);_0x2fbd5d['attributes']=_['intersection'](_0x2c1c3d['model'],qs[_0x56a9('0x38')](_0x2f933a[_0x56a9('0x35')]['fields']));_0x2fbd5d['attributes']=_0x2fbd5d[_0x56a9('0x39')][_0x56a9('0x3a')]?_0x2fbd5d[_0x56a9('0x39')]:_0x2c1c3d[_0x56a9('0x34')];if(!_0x2f933a[_0x56a9('0x35')][_0x56a9('0x3b')](_0x56a9('0x3c'))){_0x2fbd5d[_0x56a9('0x1f')]=qs[_0x56a9('0x1f')](_0x2f933a[_0x56a9('0x35')]['limit']);_0x2fbd5d['offset']=qs['offset'](_0x2f933a['query'][_0x56a9('0x1e')]);}_0x2fbd5d[_0x56a9('0x3d')]=qs['sort'](_0x2f933a[_0x56a9('0x35')][_0x56a9('0x3e')]);_0x2fbd5d[_0x56a9('0x3f')]=qs[_0x56a9('0x36')](_[_0x56a9('0x40')](_0x2f933a[_0x56a9('0x35')],_0x2c1c3d[_0x56a9('0x36')]),_0x332707);if(_0x2f933a['query'][_0x56a9('0x41')]){_0x2fbd5d[_0x56a9('0x3f')]=_['merge'](_0x2fbd5d['where'],{'$or':_[_0x56a9('0x2e')](_0x332707,function(_0x1180c6){if(_0x1180c6[_0x56a9('0x32')]!==_0x56a9('0x42')){var _0x158504={};_0x158504[_0x1180c6[_0x56a9('0x2c')]]={'$like':'%'+_0x2f933a[_0x56a9('0x35')][_0x56a9('0x41')]+'%'};return _0x158504;}})});}_0x2fbd5d=_[_0x56a9('0x43')]({},_0x2fbd5d,_0x2f933a[_0x56a9('0x44')]);var _0x9f24ea={'where':_0x2fbd5d[_0x56a9('0x3f')]};return db[_0x56a9('0x2f')][_0x56a9('0x1d')](_0x9f24ea)[_0x56a9('0x27')](function(_0xe57cfb){_0x5879db[_0x56a9('0x1d')]=_0xe57cfb;if(_0x2f933a[_0x56a9('0x35')]['includeAll']){_0x2fbd5d[_0x56a9('0x45')]=[{'all':!![]}];}return db[_0x56a9('0x2f')][_0x56a9('0x46')](_0x2fbd5d);})['then'](function(_0x1f8b30){_0x5879db['rows']=_0x1f8b30;return _0x5879db;})[_0x56a9('0x27')](respondWithFilteredResult(_0x11002a,_0x2fbd5d))['catch'](handleError(_0x11002a,null));};exports[_0x56a9('0x47')]=function(_0x39c445,_0x3998f1){var _0x49286b={'raw':!![],'where':{'id':_0x39c445['params']['id']}},_0x5192d8={};_0x5192d8['model']=_[_0x56a9('0x48')](db[_0x56a9('0x2f')][_0x56a9('0x30')]);_0x5192d8[_0x56a9('0x35')]=_[_0x56a9('0x48')](_0x39c445[_0x56a9('0x35')]);_0x5192d8[_0x56a9('0x36')]=_[_0x56a9('0x37')](_0x5192d8[_0x56a9('0x34')],_0x5192d8[_0x56a9('0x35')]);_0x49286b[_0x56a9('0x39')]=_[_0x56a9('0x37')](_0x5192d8[_0x56a9('0x34')],qs[_0x56a9('0x38')](_0x39c445['query'][_0x56a9('0x38')]));_0x49286b[_0x56a9('0x39')]=_0x49286b[_0x56a9('0x39')]['length']?_0x49286b[_0x56a9('0x39')]:_0x5192d8[_0x56a9('0x34')];if(_0x39c445['query'][_0x56a9('0x49')]){_0x49286b[_0x56a9('0x45')]=[{'all':!![]}];}_0x49286b=_[_0x56a9('0x43')]({},_0x49286b,_0x39c445[_0x56a9('0x44')]);return db['ContactItemType'][_0x56a9('0x4a')](_0x49286b)[_0x56a9('0x27')](handleEntityNotFound(_0x3998f1,null))[_0x56a9('0x27')](respondWithResult(_0x3998f1,null))[_0x56a9('0x4b')](handleError(_0x3998f1,null));};exports[_0x56a9('0x4c')]=function(_0x3942d8,_0x31aaf5){return db[_0x56a9('0x2f')][_0x56a9('0x4c')](_0x3942d8[_0x56a9('0x4d')],{})[_0x56a9('0x27')](function(_0x500656){var _0x58d370=_0x3942d8[_0x56a9('0x4e')][_0x56a9('0x29')]({'plain':!![]});if(!_0x58d370)throw new Error(_0x56a9('0x4f'));if(_0x58d370[_0x56a9('0x50')]==='user'){var _0x1986f2=_0x500656[_0x56a9('0x29')]({'plain':!![]});var _0x26ad3e=_0x56a9('0x2a');return db['UserProfileSection'][_0x56a9('0x4a')]({'where':{'name':_0x26ad3e,'userProfileId':_0x58d370[_0x56a9('0x51')]},'raw':!![]})['then'](function(_0x1ff42f){if(_0x1ff42f&&_0x1ff42f[_0x56a9('0x52')]===0x0){return db['UserProfileResource'][_0x56a9('0x4c')]({'name':_0x1986f2[_0x56a9('0x2c')],'resourceId':_0x1986f2['id'],'type':_0x1ff42f[_0x56a9('0x2c')],'sectionId':_0x1ff42f['id']},{})[_0x56a9('0x27')](function(){return _0x500656;});}else{return _0x500656;}})['catch'](function(_0x4938d6){logger[_0x56a9('0x2b')](_0x56a9('0x53'),_0x4938d6);throw _0x4938d6;});}return _0x500656;})[_0x56a9('0x27')](respondWithResult(_0x31aaf5,0xc9))[_0x56a9('0x4b')](handleError(_0x31aaf5,null));};exports[_0x56a9('0x26')]=function(_0xce9dc0,_0x798b4e){if(_0xce9dc0[_0x56a9('0x4d')]['id']){delete _0xce9dc0[_0x56a9('0x4d')]['id'];}return db[_0x56a9('0x2f')]['find']({'where':{'id':_0xce9dc0[_0x56a9('0x54')]['id']}})[_0x56a9('0x27')](handleEntityNotFound(_0x798b4e,null))[_0x56a9('0x27')](saveUpdates(_0xce9dc0[_0x56a9('0x4d')],null))[_0x56a9('0x27')](respondWithResult(_0x798b4e,null))[_0x56a9('0x4b')](handleError(_0x798b4e,null));};exports[_0x56a9('0x28')]=function(_0x488577,_0x870aa5){return db[_0x56a9('0x2f')][_0x56a9('0x4a')]({'where':{'id':_0x488577[_0x56a9('0x54')]['id']}})[_0x56a9('0x27')](handleEntityNotFound(_0x870aa5,null))[_0x56a9('0x27')](db[_0x56a9('0x55')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x488577[_0x56a9('0x54')]['id']}}))['then'](removeEntity(_0x870aa5,null))['catch'](handleError(_0x870aa5,null));}; \ No newline at end of file +var _0xb016=['findAll','rows','show','keys','length','catch','create','role','user','UserProfileSection','find','userProfileId','autoAssociation','error','update','body','params','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','ContactItemTypes','UserProfileResource','end','stack','name','send','index','map','ContactItemType','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0xb016,0x159));var _0x6b01=function(_0x38ab67,_0x658877){_0x38ab67=_0x38ab67-0x0;var _0x2af9df=_0xb016[_0x38ab67];return _0x2af9df;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){var _0x2ae85e=_0x399808[_0x6b01('0x23')]({'plain':!![]});var _0x2456e9=_0x6b01('0x24');return db[_0x6b01('0x25')][_0x6b01('0x22')]({'where':{'type':_0x2456e9,'resourceId':_0x2ae85e['id']}})[_0x6b01('0x21')](function(){return _0x399808;});})[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x26')]();});}};}function handleEntityNotFound(_0x55ca4b,_0x33d95d){return function(_0x220efb){if(!_0x220efb){_0x55ca4b[_0x6b01('0x15')](0x194);}return _0x220efb;};}function handleError(_0x21f165,_0x68491){_0x68491=_0x68491||0x1f4;return function(_0x528cbd){logger['error'](_0x528cbd[_0x6b01('0x27')]);if(_0x528cbd[_0x6b01('0x28')]){delete _0x528cbd[_0x6b01('0x28')];}_0x21f165[_0x6b01('0x16')](_0x68491)[_0x6b01('0x29')](_0x528cbd);};}exports[_0x6b01('0x2a')]=function(_0x542ca0,_0x39f193){var _0x5482a8={},_0x3942d7={},_0x4e7e32={'count':0x0,'rows':[]};var _0x6920cf=_[_0x6b01('0x2b')](db[_0x6b01('0x2c')][_0x6b01('0x2d')],function(_0x3c8009){return{'name':_0x3c8009['fieldName'],'type':_0x3c8009[_0x6b01('0x2e')][_0x6b01('0x2f')]};});_0x3942d7[_0x6b01('0x30')]=_['map'](_0x6920cf,'name');_0x3942d7[_0x6b01('0x31')]=_['keys'](_0x542ca0[_0x6b01('0x31')]);_0x3942d7[_0x6b01('0x32')]=_[_0x6b01('0x33')](_0x3942d7['model'],_0x3942d7[_0x6b01('0x31')]);_0x5482a8[_0x6b01('0x34')]=_[_0x6b01('0x33')](_0x3942d7['model'],qs[_0x6b01('0x35')](_0x542ca0[_0x6b01('0x31')][_0x6b01('0x35')]));_0x5482a8[_0x6b01('0x34')]=_0x5482a8[_0x6b01('0x34')]['length']?_0x5482a8[_0x6b01('0x34')]:_0x3942d7[_0x6b01('0x30')];if(!_0x542ca0[_0x6b01('0x31')][_0x6b01('0x36')](_0x6b01('0x37'))){_0x5482a8[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x542ca0[_0x6b01('0x31')]['limit']);_0x5482a8[_0x6b01('0x18')]=qs['offset'](_0x542ca0[_0x6b01('0x31')][_0x6b01('0x18')]);}_0x5482a8[_0x6b01('0x38')]=qs[_0x6b01('0x39')](_0x542ca0[_0x6b01('0x31')][_0x6b01('0x39')]);_0x5482a8[_0x6b01('0x3a')]=qs['filters'](_[_0x6b01('0x3b')](_0x542ca0[_0x6b01('0x31')],_0x3942d7[_0x6b01('0x32')]),_0x6920cf);if(_0x542ca0[_0x6b01('0x31')][_0x6b01('0x3c')]){_0x5482a8[_0x6b01('0x3a')]=_[_0x6b01('0x3d')](_0x5482a8[_0x6b01('0x3a')],{'$or':_['map'](_0x6920cf,function(_0x2c42c3){if(_0x2c42c3['type']!==_0x6b01('0x3e')){var _0x422c38={};_0x422c38[_0x2c42c3['name']]={'$like':'%'+_0x542ca0[_0x6b01('0x31')][_0x6b01('0x3c')]+'%'};return _0x422c38;}})});}_0x5482a8=_[_0x6b01('0x3d')]({},_0x5482a8,_0x542ca0[_0x6b01('0x3f')]);var _0x2d4125={'where':_0x5482a8[_0x6b01('0x3a')]};return db[_0x6b01('0x2c')][_0x6b01('0x1b')](_0x2d4125)[_0x6b01('0x21')](function(_0x17f335){_0x4e7e32['count']=_0x17f335;if(_0x542ca0[_0x6b01('0x31')][_0x6b01('0x40')]){_0x5482a8['include']=[{'all':!![]}];}return db['ContactItemType'][_0x6b01('0x41')](_0x5482a8);})[_0x6b01('0x21')](function(_0x558ec1){_0x4e7e32[_0x6b01('0x42')]=_0x558ec1;return _0x4e7e32;})[_0x6b01('0x21')](respondWithFilteredResult(_0x39f193,_0x5482a8))['catch'](handleError(_0x39f193,null));};exports[_0x6b01('0x43')]=function(_0x5e6f28,_0x2ab117){var _0x1c6eba={'raw':!![],'where':{'id':_0x5e6f28['params']['id']}},_0xf52992={};_0xf52992[_0x6b01('0x30')]=_[_0x6b01('0x44')](db['ContactItemType']['rawAttributes']);_0xf52992['query']=_[_0x6b01('0x44')](_0x5e6f28[_0x6b01('0x31')]);_0xf52992[_0x6b01('0x32')]=_[_0x6b01('0x33')](_0xf52992[_0x6b01('0x30')],_0xf52992[_0x6b01('0x31')]);_0x1c6eba['attributes']=_[_0x6b01('0x33')](_0xf52992[_0x6b01('0x30')],qs[_0x6b01('0x35')](_0x5e6f28[_0x6b01('0x31')][_0x6b01('0x35')]));_0x1c6eba[_0x6b01('0x34')]=_0x1c6eba['attributes'][_0x6b01('0x45')]?_0x1c6eba['attributes']:_0xf52992['model'];if(_0x5e6f28[_0x6b01('0x31')][_0x6b01('0x40')]){_0x1c6eba['include']=[{'all':!![]}];}_0x1c6eba=_[_0x6b01('0x3d')]({},_0x1c6eba,_0x5e6f28[_0x6b01('0x3f')]);return db[_0x6b01('0x2c')]['find'](_0x1c6eba)['then'](handleEntityNotFound(_0x2ab117,null))['then'](respondWithResult(_0x2ab117,null))[_0x6b01('0x46')](handleError(_0x2ab117,null));};exports[_0x6b01('0x47')]=function(_0x518d94,_0x34cef6){return db['ContactItemType']['create'](_0x518d94['body'],{})[_0x6b01('0x21')](function(_0x45288a){var _0x4baef8=_0x518d94['user'][_0x6b01('0x23')]({'plain':!![]});if(!_0x4baef8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4baef8[_0x6b01('0x48')]===_0x6b01('0x49')){var _0x32d446=_0x45288a[_0x6b01('0x23')]({'plain':!![]});var _0x13f6d7='ContactItemTypes';return db[_0x6b01('0x4a')][_0x6b01('0x4b')]({'where':{'name':_0x13f6d7,'userProfileId':_0x4baef8[_0x6b01('0x4c')]},'raw':!![]})['then'](function(_0x3884e){if(_0x3884e&&_0x3884e[_0x6b01('0x4d')]===0x0){return db['UserProfileResource'][_0x6b01('0x47')]({'name':_0x32d446[_0x6b01('0x28')],'resourceId':_0x32d446['id'],'type':_0x3884e[_0x6b01('0x28')],'sectionId':_0x3884e['id']},{})[_0x6b01('0x21')](function(){return _0x45288a;});}else{return _0x45288a;}})['catch'](function(_0x5d46e7){logger[_0x6b01('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d46e7);throw _0x5d46e7;});}return _0x45288a;})['then'](respondWithResult(_0x34cef6,0xc9))[_0x6b01('0x46')](handleError(_0x34cef6,null));};exports[_0x6b01('0x4f')]=function(_0x5b5c0c,_0x2bf4b5){if(_0x5b5c0c[_0x6b01('0x50')]['id']){delete _0x5b5c0c['body']['id'];}return db[_0x6b01('0x2c')][_0x6b01('0x4b')]({'where':{'id':_0x5b5c0c[_0x6b01('0x51')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x2bf4b5,null))[_0x6b01('0x21')](saveUpdates(_0x5b5c0c['body'],null))[_0x6b01('0x21')](respondWithResult(_0x2bf4b5,null))['catch'](handleError(_0x2bf4b5,null));};exports[_0x6b01('0x22')]=function(_0x331815,_0x415fdd){return db['ContactItemType'][_0x6b01('0x4b')]({'where':{'id':_0x331815[_0x6b01('0x51')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x415fdd,null))[_0x6b01('0x21')](db['CmContactHasItem'][_0x6b01('0x4f')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x331815[_0x6b01('0x51')]['id']}}))[_0x6b01('0x21')](removeEntity(_0x415fdd,null))['catch'](handleError(_0x415fdd,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index caa93a7..ae57b3a 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 _0x6ce2=['path','rimraf','../../config/environment','exports','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','moment','request-promise'];(function(_0x121c84,_0x129ac5){var _0x566d04=function(_0x442111){while(--_0x442111){_0x121c84['push'](_0x121c84['shift']());}};_0x566d04(++_0x129ac5);}(_0x6ce2,0xa3));var _0x26ce=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x6ce2[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x26ce('0x0'));var util=require(_0x26ce('0x1'));var logger=require(_0x26ce('0x2'))('api');var moment=require(_0x26ce('0x3'));var BPromise=require('bluebird');var rp=require(_0x26ce('0x4'));var fs=require('fs');var path=require(_0x26ce('0x5'));var rimraf=require(_0x26ce('0x6'));var config=require(_0x26ce('0x7'));var attributes=require('./contactItemType.attributes');module[_0x26ce('0x8')]=function(_0x2c6db9,_0x4fe103){return _0x2c6db9[_0x26ce('0x9')](_0x26ce('0xa'),attributes,{'tableName':_0x26ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c93=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','ContactItemType','lodash','util'];(function(_0x1de389,_0x1fd154){var _0x1469e7=function(_0x1d5836){while(--_0x1d5836){_0x1de389['push'](_0x1de389['shift']());}};_0x1469e7(++_0x1fd154);}(_0x9c93,0xb9));var _0x39c9=function(_0x5c1353,_0x328298){_0x5c1353=_0x5c1353-0x0;var _0x31e2e6=_0x9c93[_0x5c1353];return _0x31e2e6;};'use strict';var _=require(_0x39c9('0x0'));var util=require(_0x39c9('0x1'));var logger=require(_0x39c9('0x2'))(_0x39c9('0x3'));var moment=require(_0x39c9('0x4'));var BPromise=require(_0x39c9('0x5'));var rp=require(_0x39c9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x39c9('0x7'));var attributes=require('./contactItemType.attributes');module[_0x39c9('0x8')]=function(_0x67c1b4,_0x50ab0a){return _0x67c1b4[_0x39c9('0x9')](_0x39c9('0xa'),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 35665e9..5c7f08d 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 _0x0ad6=['ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x0ad6,0x7e));var _0x60ad=function(_0x1e7faa,_0x37a4e3){_0x1e7faa=_0x1e7faa-0x0;var _0x2ad137=_0x0ad6[_0x1e7faa];return _0x2ad137;};'use strict';var _=require(_0x60ad('0x0'));var util=require(_0x60ad('0x1'));var moment=require(_0x60ad('0x2'));var BPromise=require('bluebird');var rs=require(_0x60ad('0x3'));var fs=require('fs');var Redis=require(_0x60ad('0x4'));var db=require(_0x60ad('0x5'))['db'];var utils=require(_0x60ad('0x6'));var logger=require(_0x60ad('0x7'))(_0x60ad('0x8'));var config=require(_0x60ad('0x9'));var jayson=require(_0x60ad('0xa'));var client=jayson['client'][_0x60ad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x485b22,_0x30b655,_0x519383){return new BPromise(function(_0x24e1e5,_0x507663){return client[_0x60ad('0xc')](_0x485b22,_0x519383)[_0x60ad('0xd')](function(_0x2598d4){logger[_0x60ad('0xe')](_0x60ad('0xf'),_0x30b655,_0x60ad('0x10'));logger[_0x60ad('0x11')](_0x60ad('0x12'),_0x30b655,'request\x20sent',JSON[_0x60ad('0x13')](_0x2598d4));if(_0x2598d4['error']){if(_0x2598d4[_0x60ad('0x14')][_0x60ad('0x15')]===0x1f4){logger['error']('ContactItemType,\x20%s,\x20%s',_0x30b655,_0x2598d4[_0x60ad('0x14')][_0x60ad('0x16')]);return _0x507663(_0x2598d4[_0x60ad('0x14')]['message']);}logger[_0x60ad('0x14')](_0x60ad('0xf'),_0x30b655,_0x2598d4['error'][_0x60ad('0x16')]);return _0x24e1e5(_0x2598d4[_0x60ad('0x14')][_0x60ad('0x16')]);}else{logger['info'](_0x60ad('0xf'),_0x30b655,_0x60ad('0x10'));_0x24e1e5(_0x2598d4['result'][_0x60ad('0x16')]);}})[_0x60ad('0x17')](function(_0x3dcb34){logger['error']('ContactItemType,\x20%s,\x20%s',_0x30b655,_0x3dcb34);_0x507663(_0x3dcb34);});});} \ No newline at end of file +var _0xbccf=['error','message','request\x20sent','result','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x3b08de,_0x63ddd0){var _0x53fbe4=function(_0x16eea2){while(--_0x16eea2){_0x3b08de['push'](_0x3b08de['shift']());}};_0x53fbe4(++_0x63ddd0);}(_0xbccf,0x1d2));var _0xfbcc=function(_0x29bf80,_0x4af855){_0x29bf80=_0x29bf80-0x0;var _0x932096=_0xbccf[_0x29bf80];return _0x932096;};'use strict';var _=require(_0xfbcc('0x0'));var util=require('util');var moment=require(_0xfbcc('0x1'));var BPromise=require('bluebird');var rs=require(_0xfbcc('0x2'));var fs=require('fs');var Redis=require(_0xfbcc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfbcc('0x4'))(_0xfbcc('0x5'));var config=require(_0xfbcc('0x6'));var jayson=require(_0xfbcc('0x7'));var client=jayson[_0xfbcc('0x8')][_0xfbcc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c07f6,_0x9b993f,_0x28bda7){return new BPromise(function(_0x312c50,_0x142a2c){return client[_0xfbcc('0xa')](_0x1c07f6,_0x28bda7)[_0xfbcc('0xb')](function(_0x3c3f72){logger[_0xfbcc('0xc')](_0xfbcc('0xd'),_0x9b993f,'request\x20sent');logger[_0xfbcc('0xe')](_0xfbcc('0xf'),_0x9b993f,'request\x20sent',JSON[_0xfbcc('0x10')](_0x3c3f72));if(_0x3c3f72['error']){if(_0x3c3f72['error'][_0xfbcc('0x11')]===0x1f4){logger[_0xfbcc('0x12')](_0xfbcc('0xd'),_0x9b993f,_0x3c3f72['error'][_0xfbcc('0x13')]);return _0x142a2c(_0x3c3f72[_0xfbcc('0x12')]['message']);}logger[_0xfbcc('0x12')](_0xfbcc('0xd'),_0x9b993f,_0x3c3f72[_0xfbcc('0x12')][_0xfbcc('0x13')]);return _0x312c50(_0x3c3f72['error'][_0xfbcc('0x13')]);}else{logger['info'](_0xfbcc('0xd'),_0x9b993f,_0xfbcc('0x14'));_0x312c50(_0x3c3f72[_0xfbcc('0x15')]['message']);}})['catch'](function(_0x189c02){logger[_0xfbcc('0x12')](_0xfbcc('0xd'),_0x9b993f,_0x189c02);_0x142a2c(_0x189c02);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index b40ecf2..f44d12a 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 _0x82fb=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','/:id','show','post'];(function(_0x4477f6,_0x786920){var _0x2de580=function(_0x4f95b1){while(--_0x4f95b1){_0x4477f6['push'](_0x4477f6['shift']());}};_0x2de580(++_0x786920);}(_0x82fb,0x15a));var _0xb82f=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x82fb[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xb82f('0x0'));var util=require(_0xb82f('0x1'));var path=require(_0xb82f('0x2'));var timeout=require(_0xb82f('0x3'));var express=require(_0xb82f('0x4'));var router=express[_0xb82f('0x5')]();var fs_extra=require(_0xb82f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb82f('0x7'));var config=require(_0xb82f('0x8'));var controller=require(_0xb82f('0x9'));router[_0xb82f('0xa')]('/',auth[_0xb82f('0xb')](),controller['index']);router[_0xb82f('0xa')](_0xb82f('0xc'),auth[_0xb82f('0xb')](),controller[_0xb82f('0xd')]);router[_0xb82f('0xe')]('/',auth[_0xb82f('0xb')](),controller['create']);router[_0xb82f('0xf')]('/:id',auth[_0xb82f('0xb')](),controller['update']);router[_0xb82f('0x10')](_0xb82f('0xc'),auth[_0xb82f('0xb')](),controller[_0xb82f('0x11')]);module[_0xb82f('0x12')]=router; \ No newline at end of file +var _0x34e0=['get','isAuthenticated','index','/:id','post','put','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./contactItemType.controller'];(function(_0x4014ce,_0x52c228){var _0x3ac146=function(_0xbe3d77){while(--_0xbe3d77){_0x4014ce['push'](_0x4014ce['shift']());}};_0x3ac146(++_0x52c228);}(_0x34e0,0xf8));var _0x034e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x34e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require(_0x034e('0x0'));var path=require(_0x034e('0x1'));var timeout=require(_0x034e('0x2'));var express=require(_0x034e('0x3'));var router=express['Router']();var fs_extra=require(_0x034e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x034e('0x5'));var config=require(_0x034e('0x6'));var controller=require(_0x034e('0x7'));router[_0x034e('0x8')]('/',auth[_0x034e('0x9')](),controller[_0x034e('0xa')]);router[_0x034e('0x8')](_0x034e('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x034e('0xc')]('/',auth[_0x034e('0x9')](),controller['create']);router[_0x034e('0xd')](_0x034e('0xb'),auth[_0x034e('0x9')](),controller['update']);router[_0x034e('0xe')](_0x034e('0xb'),auth[_0x034e('0x9')](),controller[_0x034e('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 975f01f..5936de1 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 _0xb7e7=['STRING','sequelize'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xb7e7,0x121));var _0x7b7e=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xb7e7[_0x710815];return _0x5b3b89;};'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 +var _0xe706=['STRING','sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe706,0xa3));var _0x6e70=function(_0x590381,_0x5c3948){_0x590381=_0x590381-0x0;var _0xe300df=_0xe706[_0x590381];return _0xe300df;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 42b2760..44e1326 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 _0x655d=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./dashboard.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','createdAt','updatedAt','omit','userProfileId','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','getItems','findOne','DashboardItem','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x655d,0x189));var _0xd655=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x655d[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0xd655('0x0'));var rimraf=require(_0xd655('0x1'));var zipdir=require(_0xd655('0x2'));var jsonpatch=require(_0xd655('0x3'));var rp=require('request-promise');var moment=require(_0xd655('0x4'));var BPromise=require(_0xd655('0x5'));var Mustache=require(_0xd655('0x6'));var util=require(_0xd655('0x7'));var path=require(_0xd655('0x8'));var sox=require('sox');var csv=require(_0xd655('0x9'));var ejs=require(_0xd655('0xa'));var fs=require('fs');var fs_extra=require(_0xd655('0xb'));var _=require(_0xd655('0xc'));var squel=require(_0xd655('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd655('0xe'));var toCsv=require(_0xd655('0x9'));var querystring=require(_0xd655('0xf'));var Papa=require(_0xd655('0x10'));var Redis=require(_0xd655('0x11'));var authService=require(_0xd655('0x12'));var qs=require(_0xd655('0x13'));var as=require(_0xd655('0x14'));var hardwareService=require(_0xd655('0x15'));var logger=require(_0xd655('0x16'))(_0xd655('0x17'));var utils=require('../../config/utils');var config=require(_0xd655('0x18'));var licenseUtil=require(_0xd655('0x19'));var db=require(_0xd655('0x1a'))['db'];config['redis']=_[_0xd655('0x1b')](config[_0xd655('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd655('0x1d'))['register'](socket);function respondWithStatusCode(_0x49dc88,_0x13ac87){_0x13ac87=_0x13ac87||0xcc;return function(_0x4c5588){if(_0x4c5588){return _0x49dc88[_0xd655('0x1e')](_0x13ac87);}return _0x49dc88[_0xd655('0x1f')](_0x13ac87)[_0xd655('0x20')]();};}function respondWithResult(_0x43efa0,_0x835093){_0x835093=_0x835093||0xc8;return function(_0x10df32){if(_0x10df32){return _0x43efa0['status'](_0x835093)[_0xd655('0x21')](_0x10df32);}};}function respondWithFilteredResult(_0x2ffac2,_0x32c2a2){return function(_0x5d5bef){if(_0x5d5bef){var _0x4c4e64=typeof _0x32c2a2[_0xd655('0x22')]==='undefined'&&typeof _0x32c2a2[_0xd655('0x23')]===_0xd655('0x24');var _0x805952=_0x5d5bef[_0xd655('0x25')];var _0x32383a=_0x4c4e64?0x0:_0x32c2a2[_0xd655('0x22')];var _0x536718=_0x4c4e64?_0x5d5bef[_0xd655('0x25')]:_0x32c2a2[_0xd655('0x22')]+_0x32c2a2[_0xd655('0x23')];var _0xcd679e;if(_0x536718>=_0x805952){_0x536718=_0x805952;_0xcd679e=0xc8;}else{_0xcd679e=0xce;}_0x2ffac2[_0xd655('0x1f')](_0xcd679e);return _0x2ffac2[_0xd655('0x26')]('Content-Range',_0x32383a+'-'+_0x536718+'/'+_0x805952)[_0xd655('0x21')](_0x5d5bef);}return null;};}function patchUpdates(_0x313eef){return function(_0x14491b){try{jsonpatch[_0xd655('0x27')](_0x14491b,_0x313eef,!![]);}catch(_0x4deee0){return BPromise[_0xd655('0x28')](_0x4deee0);}return _0x14491b[_0xd655('0x29')]();};}function saveUpdates(_0xf0810d,_0x5000e6){return function(_0x385729){if(_0x385729){return _0x385729[_0xd655('0x2a')](_0xf0810d)[_0xd655('0x2b')](function(_0x43ef19){return _0x43ef19;});}return null;};}function removeEntity(_0x206c4b,_0x49c0f1){return function(_0x386998){if(_0x386998){return _0x386998[_0xd655('0x2c')]()[_0xd655('0x2b')](function(){var _0x2083f9=_0x386998[_0xd655('0x2d')]({'plain':!![]});var _0x470090='CustomDashboards';return db[_0xd655('0x2e')]['destroy']({'where':{'type':_0x470090,'resourceId':_0x2083f9['id']}})[_0xd655('0x2b')](function(){return _0x386998;});})['then'](function(){_0x206c4b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x579c21,_0x10da95){return function(_0x1b6f10){if(!_0x1b6f10){_0x579c21['sendStatus'](0x194);}return _0x1b6f10;};}function handleError(_0x4702e7,_0x5a63db){_0x5a63db=_0x5a63db||0x1f4;return function(_0x22c7f8){logger[_0xd655('0x2f')](_0x22c7f8[_0xd655('0x30')]);if(_0x22c7f8[_0xd655('0x31')]){delete _0x22c7f8[_0xd655('0x31')];}_0x4702e7['status'](_0x5a63db)[_0xd655('0x32')](_0x22c7f8);};}exports[_0xd655('0x33')]=function(_0x31a28e,_0xe3ba6){var _0x17c0bc={},_0x3dec24={},_0x567137={'count':0x0,'rows':[]};var _0x23ef0e=_[_0xd655('0x34')](db[_0xd655('0x35')][_0xd655('0x36')],function(_0x5268d7){return{'name':_0x5268d7[_0xd655('0x37')],'type':_0x5268d7[_0xd655('0x38')][_0xd655('0x39')]};});_0x3dec24['model']=_[_0xd655('0x34')](_0x23ef0e,_0xd655('0x31'));_0x3dec24[_0xd655('0x3a')]=_['keys'](_0x31a28e['query']);_0x3dec24[_0xd655('0x3b')]=_[_0xd655('0x3c')](_0x3dec24[_0xd655('0x3d')],_0x3dec24[_0xd655('0x3a')]);_0x17c0bc['attributes']=_['intersection'](_0x3dec24['model'],qs[_0xd655('0x3e')](_0x31a28e[_0xd655('0x3a')][_0xd655('0x3e')]));_0x17c0bc['attributes']=_0x17c0bc[_0xd655('0x3f')][_0xd655('0x40')]?_0x17c0bc[_0xd655('0x3f')]:_0x3dec24['model'];if(!_0x31a28e[_0xd655('0x3a')][_0xd655('0x41')](_0xd655('0x42'))){_0x17c0bc['limit']=qs['limit'](_0x31a28e[_0xd655('0x3a')][_0xd655('0x23')]);_0x17c0bc['offset']=qs[_0xd655('0x22')](_0x31a28e[_0xd655('0x3a')][_0xd655('0x22')]);}_0x17c0bc[_0xd655('0x43')]=qs[_0xd655('0x44')](_0x31a28e[_0xd655('0x3a')][_0xd655('0x44')]);_0x17c0bc['where']=qs['filters'](_[_0xd655('0x45')](_0x31a28e['query'],_0x3dec24[_0xd655('0x3b')]),_0x23ef0e);if(_0x31a28e[_0xd655('0x3a')][_0xd655('0x46')]){_0x17c0bc[_0xd655('0x47')]=_['merge'](_0x17c0bc[_0xd655('0x47')],{'$or':_['map'](_0x23ef0e,function(_0x42b3c6){if(_0x42b3c6[_0xd655('0x38')]!==_0xd655('0x48')){var _0x968036={};_0x968036[_0x42b3c6['name']]={'$like':'%'+_0x31a28e['query'][_0xd655('0x46')]+'%'};return _0x968036;}})});}_0x17c0bc=_['merge']({},_0x17c0bc,_0x31a28e[_0xd655('0x49')]);var _0x54b928={'where':_0x17c0bc[_0xd655('0x47')]};return db[_0xd655('0x35')]['count'](_0x54b928)[_0xd655('0x2b')](function(_0x126981){_0x567137[_0xd655('0x25')]=_0x126981;if(_0x31a28e['query']['includeAll']){_0x17c0bc[_0xd655('0x4a')]=[{'all':!![]}];}return db[_0xd655('0x35')][_0xd655('0x4b')](_0x17c0bc);})['then'](function(_0x180f8b){_0x567137[_0xd655('0x4c')]=_0x180f8b;return _0x567137;})[_0xd655('0x2b')](respondWithFilteredResult(_0xe3ba6,_0x17c0bc))[_0xd655('0x4d')](handleError(_0xe3ba6,null));};exports[_0xd655('0x4e')]=function(_0x14da74,_0x2b15c3){var _0x70017b={'raw':![],'where':{'id':_0x14da74[_0xd655('0x4f')]['id']}},_0x33dab4={};_0x33dab4[_0xd655('0x3d')]=_[_0xd655('0x50')](db['Dashboard'][_0xd655('0x36')]);_0x33dab4[_0xd655('0x3a')]=_[_0xd655('0x50')](_0x14da74[_0xd655('0x3a')]);_0x33dab4[_0xd655('0x3b')]=_['intersection'](_0x33dab4[_0xd655('0x3d')],_0x33dab4['query']);_0x70017b[_0xd655('0x3f')]=_[_0xd655('0x3c')](_0x33dab4[_0xd655('0x3d')],qs['fields'](_0x14da74[_0xd655('0x3a')][_0xd655('0x3e')]));_0x70017b[_0xd655('0x3f')]=_0x70017b[_0xd655('0x3f')]['length']?_0x70017b[_0xd655('0x3f')]:_0x33dab4['model'];if(_0x14da74[_0xd655('0x3a')]['includeAll']){_0x70017b[_0xd655('0x4a')]=[{'all':!![]}];}_0x70017b=_[_0xd655('0x51')]({},_0x70017b,_0x14da74[_0xd655('0x49')]);return db[_0xd655('0x35')][_0xd655('0x52')](_0x70017b)['then'](handleEntityNotFound(_0x2b15c3,null))['then'](respondWithResult(_0x2b15c3,null))[_0xd655('0x4d')](handleError(_0x2b15c3,null));};exports[_0xd655('0x53')]=function(_0x404a3f,_0x464145){return db[_0xd655('0x35')][_0xd655('0x53')](_0x404a3f[_0xd655('0x54')],{})['then'](function(_0x296a50){var _0x212c82=_0x404a3f[_0xd655('0x55')][_0xd655('0x2d')]({'plain':!![]});if(!_0x212c82)throw new Error(_0xd655('0x56'));if(_0x212c82[_0xd655('0x57')]===_0xd655('0x55')){var _0x5930b1=_0x296a50[_0xd655('0x2d')]({'plain':!![]});var _0x476d5a=_0xd655('0x58');return db[_0xd655('0x59')]['find']({'where':{'name':_0x476d5a,'userProfileId':_0x212c82['userProfileId']},'raw':!![]})['then'](function(_0x36e0ea){if(_0x36e0ea&&_0x36e0ea[_0xd655('0x5a')]===0x0){return db[_0xd655('0x2e')]['create']({'name':_0x5930b1[_0xd655('0x31')],'resourceId':_0x5930b1['id'],'type':_0x36e0ea['name'],'sectionId':_0x36e0ea['id']},{})[_0xd655('0x2b')](function(){return _0x296a50;});}else{return _0x296a50;}})[_0xd655('0x4d')](function(_0xa8c3cf){logger[_0xd655('0x2f')](_0xd655('0x5b'),_0xa8c3cf);throw _0xa8c3cf;});}return _0x296a50;})[_0xd655('0x2b')](respondWithResult(_0x464145,0xc9))[_0xd655('0x4d')](handleError(_0x464145,null));};exports[_0xd655('0x5c')]=function(_0x9d9b00,_0x1bb8c1){var _0x426472={'where':{'id':_0x9d9b00[_0xd655('0x4f')]['id']}},_0x142e83={};_0x142e83[_0xd655('0x3d')]=_['keys'](db[_0xd655('0x35')][_0xd655('0x36')]);_0x426472[_0xd655('0x3f')]=_['intersection'](_0x142e83[_0xd655('0x3d')],qs[_0xd655('0x3e')](_0x9d9b00[_0xd655('0x3a')][_0xd655('0x3e')]));_0x426472[_0xd655('0x3f')]=_0x426472[_0xd655('0x3f')]['length']?_0x426472[_0xd655('0x3f')]:_0x142e83[_0xd655('0x3d')];if(_0x9d9b00['query'][_0xd655('0x5d')]){_0x426472[_0xd655('0x4a')]=[{'all':!![]}];}_0x426472=_[_0xd655('0x51')]({},_0x426472,_0x9d9b00[_0xd655('0x49')]);return db[_0xd655('0x35')]['find'](_0x426472)[_0xd655('0x2b')](handleEntityNotFound(_0x1bb8c1,null))[_0xd655('0x2b')](function(_0x164907){if(_0x164907){var _0xaf31cd=_0x164907[_0xd655('0x2d')]({'plain':!![]});_0xaf31cd=qs['omit'](_0xaf31cd,['id',_0xd655('0x5e'),_0xd655('0x5f')]);_0x9d9b00['body']=_[_0xd655('0x60')](_0x9d9b00['body'],['id','createdAt','updatedAt']);return db[_0xd655('0x35')]['create'](_[_0xd655('0x51')](_0xaf31cd,_0x9d9b00[_0xd655('0x54')]),{'include':_0x9d9b00[_0xd655('0x3a')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0xc0b8b6){var _0x37a63b=_0x9d9b00[_0xd655('0x55')][_0xd655('0x2d')]({'plain':!![]});if(!_0x37a63b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x37a63b[_0xd655('0x57')]===_0xd655('0x55')){var _0x3626ca=_0xc0b8b6[_0xd655('0x2d')]({'plain':!![]});var _0x2cb1d1=_0xd655('0x58');return db['UserProfileSection'][_0xd655('0x52')]({'where':{'name':_0x2cb1d1,'userProfileId':_0x37a63b[_0xd655('0x61')]},'raw':!![]})[_0xd655('0x2b')](function(_0x1daf12){if(_0x1daf12&&_0x1daf12[_0xd655('0x5a')]===0x0){return db['UserProfileResource'][_0xd655('0x53')]({'name':_0x3626ca['name'],'resourceId':_0x3626ca['id'],'type':_0x1daf12[_0xd655('0x31')],'sectionId':_0x1daf12['id']},{})[_0xd655('0x2b')](function(){return _0xc0b8b6;});}else{return _0xc0b8b6;}})[_0xd655('0x4d')](function(_0x1900ea){logger[_0xd655('0x2f')](_0xd655('0x5b'),_0x1900ea);throw _0x1900ea;});}return _0xc0b8b6;});}})[_0xd655('0x2b')](respondWithResult(_0x1bb8c1,0xc9))['catch'](handleError(_0x1bb8c1,null));};exports[_0xd655('0x2a')]=function(_0x218b8f,_0xb9ab0){if(_0x218b8f[_0xd655('0x54')]['id']){delete _0x218b8f[_0xd655('0x54')]['id'];}return db['Dashboard'][_0xd655('0x52')]({'where':{'id':_0x218b8f[_0xd655('0x4f')]['id']}})[_0xd655('0x2b')](handleEntityNotFound(_0xb9ab0,null))[_0xd655('0x2b')](saveUpdates(_0x218b8f[_0xd655('0x54')],null))[_0xd655('0x2b')](respondWithResult(_0xb9ab0,null))['catch'](handleError(_0xb9ab0,null));};exports[_0xd655('0x2c')]=function(_0x126881,_0x14974d){return db[_0xd655('0x35')][_0xd655('0x52')]({'where':{'id':_0x126881[_0xd655('0x4f')]['id']}})[_0xd655('0x2b')](handleEntityNotFound(_0x14974d,null))[_0xd655('0x2b')](removeEntity(_0x14974d,null))[_0xd655('0x4d')](handleError(_0x14974d,null));};function widgetAttributes(_0xa5ead7){try{switch(_0xa5ead7[_0xd655('0x38')]){case _0xd655('0x62'):return[{'name':_0xd655('0x63'),'value':_0xa5ead7[_0xd655('0x63')]||(_0xa5ead7['attrs']&&_0xa5ead7[_0xd655('0x64')][0x0]?_0xa5ead7[_0xd655('0x64')][0x0][_0xd655('0x65')]:undefined)||_0xd655('0x66')}];case _0xd655('0x67'):return[{'name':'attrPath','value':_0xa5ead7[_0xd655('0x68')]||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7['attrs'][0x0]?_0xa5ead7[_0xd655('0x64')][0x0][_0xd655('0x65')]:undefined)||''}];case _0xd655('0x69'):return[{'name':_0xd655('0x6a'),'value':_0xa5ead7[_0xd655('0x6a')]||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7[_0xd655('0x64')][0x0]?_0xa5ead7[_0xd655('0x64')][0x0][_0xd655('0x65')]:undefined)||_0xd655('0x6b')},{'name':_0xd655('0x6c'),'value':_0xa5ead7['attrTimezone']||(_0xa5ead7['attrs']&&_0xa5ead7['attrs'][0x1]?_0xa5ead7[_0xd655('0x64')][0x1]['value']:undefined)||_0xd655('0x6d')},{'name':_0xd655('0x6e'),'value':_0xa5ead7['attrFontSize']||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7[_0xd655('0x64')][0x2]?_0xa5ead7[_0xd655('0x64')][0x2][_0xd655('0x65')]:undefined)||0xc}];case _0xd655('0x6f'):return[{'name':_0xd655('0x70'),'value':_0xa5ead7[_0xd655('0x70')]||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7[_0xd655('0x64')][0x0]?_0xa5ead7[_0xd655('0x64')][0x0][_0xd655('0x65')]:undefined)||_0xd655('0x71')},{'name':_0xd655('0x72'),'value':_0xa5ead7['attrVoiceQueues']||(_0xa5ead7['attrs']&&_0xa5ead7[_0xd655('0x64')][0x1]?_0xa5ead7[_0xd655('0x64')][0x1][_0xd655('0x65')]:undefined)||[]},{'name':_0xd655('0x6e'),'value':_0xa5ead7['attrFontSize']||(_0xa5ead7['attrs']&&_0xa5ead7[_0xd655('0x64')][0x2]?_0xa5ead7[_0xd655('0x64')][0x2][_0xd655('0x65')]:undefined)||0x14},{'name':_0xd655('0x73'),'value':_0xa5ead7[_0xd655('0x73')]||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7['attrs'][0x3]?_0xa5ead7[_0xd655('0x64')][0x3]['value']:undefined)||_0xd655('0x74')},{'name':_0xd655('0x75'),'value':_0xa5ead7[_0xd655('0x75')]||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7[_0xd655('0x64')][0x4]?_0xa5ead7[_0xd655('0x64')][0x4][_0xd655('0x65')]:undefined)||''},{'name':'attrFaxAccounts','value':_0xa5ead7[_0xd655('0x76')]||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7['attrs'][0x5]?_0xa5ead7[_0xd655('0x64')][0x5][_0xd655('0x65')]:undefined)||''},{'name':_0xd655('0x77'),'value':_0xa5ead7[_0xd655('0x77')]||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7['attrs'][0x6]?_0xa5ead7[_0xd655('0x64')][0x6][_0xd655('0x65')]:undefined)||''},{'name':_0xd655('0x78'),'value':_0xa5ead7[_0xd655('0x78')]||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7[_0xd655('0x64')][0x7]?_0xa5ead7['attrs'][0x7][_0xd655('0x65')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0xa5ead7[_0xd655('0x79')]||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7[_0xd655('0x64')][0x8]?_0xa5ead7[_0xd655('0x64')][0x8][_0xd655('0x65')]:undefined)||''},{'name':_0xd655('0x7a'),'value':_0xa5ead7[_0xd655('0x7a')]||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7[_0xd655('0x64')][0x9]?_0xa5ead7['attrs'][0x9][_0xd655('0x65')]:undefined)||''}];case _0xd655('0x7b'):case'pie-chart':return[{'name':_0xd655('0x7c'),'value':_0xa5ead7[_0xd655('0x7c')]||(_0xa5ead7['attrs']&&_0xa5ead7[_0xd655('0x64')][0x0]?_0xa5ead7[_0xd655('0x64')][0x0][_0xd655('0x65')]:undefined)||_0xd655('0x71')},{'name':_0xd655('0x7d'),'value':_0xa5ead7[_0xd655('0x7d')]||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7[_0xd655('0x64')][0x1]?_0xa5ead7[_0xd655('0x64')][0x1][_0xd655('0x65')]:undefined)||null},{'name':_0xd655('0x7e'),'value':_0xa5ead7[_0xd655('0x7e')]||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7[_0xd655('0x64')][0x2]?_0xa5ead7[_0xd655('0x64')][0x2][_0xd655('0x65')]:undefined)||null},{'name':'attrVoiceQueues','value':_0xa5ead7['attrVoiceQueues']||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7[_0xd655('0x64')][0x3]?_0xa5ead7[_0xd655('0x64')][0x3]['value']:undefined)||[]},{'name':_0xd655('0x73'),'value':_0xa5ead7[_0xd655('0x73')]||(_0xa5ead7['attrs']&&_0xa5ead7[_0xd655('0x64')][0x4]?_0xa5ead7[_0xd655('0x64')][0x4][_0xd655('0x65')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0xa5ead7[_0xd655('0x75')]||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7['attrs'][0x5]?_0xa5ead7['attrs'][0x5][_0xd655('0x65')]:undefined)||''},{'name':_0xd655('0x76'),'value':_0xa5ead7['attrFaxAccounts']||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7[_0xd655('0x64')][0x6]?_0xa5ead7[_0xd655('0x64')][0x6]['value']:undefined)||''},{'name':_0xd655('0x77'),'value':_0xa5ead7['attrSmsAccounts']||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7[_0xd655('0x64')][0x7]?_0xa5ead7['attrs'][0x7][_0xd655('0x65')]:undefined)||''},{'name':_0xd655('0x78'),'value':_0xa5ead7['attrOpenchannelAccounts']||(_0xa5ead7['attrs']&&_0xa5ead7['attrs'][0x8]?_0xa5ead7[_0xd655('0x64')][0x8][_0xd655('0x65')]:undefined)||''},{'name':_0xd655('0x79'),'value':_0xa5ead7[_0xd655('0x79')]||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7[_0xd655('0x64')][0x9]?_0xa5ead7['attrs'][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0xa5ead7[_0xd655('0x7a')]||(_0xa5ead7['attrs']&&_0xa5ead7[_0xd655('0x64')][0xa]?_0xa5ead7[_0xd655('0x64')][0xa][_0xd655('0x65')]:undefined)||''}];case _0xd655('0x7f'):return[{'name':_0xd655('0x80'),'type':_0xa5ead7['reportType']||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7['attrs'][0x0]?_0xa5ead7[_0xd655('0x64')][0x0][_0xd655('0x38')]:undefined)||null,'value':_0xa5ead7[_0xd655('0x80')]||(_0xa5ead7['attrs']&&_0xa5ead7[_0xd655('0x64')][0x0]?_0xa5ead7[_0xd655('0x64')][0x0][_0xd655('0x65')]:undefined)||null},{'name':_0xd655('0x81'),'value':_0xa5ead7['attrRefresh']||(_0xa5ead7[_0xd655('0x64')]&&_0xa5ead7[_0xd655('0x64')][0x1]?_0xa5ead7[_0xd655('0x64')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5af6bc){logger[_0xd655('0x2f')](_0xd655('0x82'),JSON['stringify'](_0x5af6bc));return[];}}exports[_0xd655('0x83')]=function(_0xd5bf28,_0x30692a,_0x114ec5){if(_0xd5bf28['body']['id']){delete _0xd5bf28[_0xd655('0x54')]['id'];}return db[_0xd655('0x35')]['find']({'where':{'id':_0xd5bf28[_0xd655('0x4f')]['id']}})[_0xd655('0x2b')](handleEntityNotFound(_0x30692a,null))[_0xd655('0x2b')](function(_0xee7c64){if(_0xee7c64){_0xd5bf28[_0xd655('0x54')][_0xd655('0x84')]=_0xee7c64['id'];_0xd5bf28[_0xd655('0x54')][_0xd655('0x64')]=widgetAttributes(_0xd5bf28[_0xd655('0x54')]);return db['DashboardItem'][_0xd655('0x53')](_0xd5bf28['body']);}})[_0xd655('0x2b')](respondWithResult(_0x30692a,null))[_0xd655('0x4d')](handleError(_0x30692a,null));};exports[_0xd655('0x85')]=function(_0xece985,_0x32eec9,_0x442322){var _0x5784ec={};var _0x23e3d4={};var _0x5404c6;var _0x46c656;return db[_0xd655('0x35')][_0xd655('0x86')]({'where':{'id':_0xece985[_0xd655('0x4f')]['id']}})[_0xd655('0x2b')](handleEntityNotFound(_0x32eec9,null))[_0xd655('0x2b')](function(_0x320122){if(_0x320122){_0x5404c6=_0x320122;_0x23e3d4['model']=_[_0xd655('0x50')](db[_0xd655('0x87')][_0xd655('0x36')]);_0x23e3d4[_0xd655('0x3a')]=_[_0xd655('0x50')](_0xece985[_0xd655('0x3a')]);_0x23e3d4[_0xd655('0x3b')]=_['intersection'](_0x23e3d4[_0xd655('0x3d')],_0x23e3d4[_0xd655('0x3a')]);_0x5784ec[_0xd655('0x3f')]=_[_0xd655('0x3c')](_0x23e3d4[_0xd655('0x3d')],qs['fields'](_0xece985['query'][_0xd655('0x3e')]));_0x5784ec[_0xd655('0x3f')]=_0x5784ec[_0xd655('0x3f')][_0xd655('0x40')]?_0x5784ec[_0xd655('0x3f')]:_0x23e3d4[_0xd655('0x3d')];_0x5784ec[_0xd655('0x43')]=qs['sort'](_0xece985[_0xd655('0x3a')][_0xd655('0x44')]);_0x5784ec['where']=qs['filters'](_[_0xd655('0x45')](_0xece985[_0xd655('0x3a')],_0x23e3d4['filters']));if(_0xece985[_0xd655('0x3a')]['filter']){_0x5784ec['where']=_[_0xd655('0x51')](_0x5784ec[_0xd655('0x47')],{'$or':_[_0xd655('0x34')](_0x5784ec['attributes'],function(_0x5b0670){var _0x4ad4e5={};_0x4ad4e5[_0x5b0670]={'$like':'%'+_0xece985[_0xd655('0x3a')][_0xd655('0x46')]+'%'};return _0x4ad4e5;})});}_0x5784ec=_[_0xd655('0x51')]({},_0x5784ec,_0xece985[_0xd655('0x49')]);return _0x5404c6[_0xd655('0x85')](_0x5784ec);}})[_0xd655('0x2b')](function(_0x4ecd89){if(_0x4ecd89){_0x46c656=_0x4ecd89[_0xd655('0x40')];if(!_0xece985['query'][_0xd655('0x41')]('nolimit')){_0x5784ec[_0xd655('0x23')]=qs[_0xd655('0x23')](_0xece985[_0xd655('0x3a')][_0xd655('0x23')]);_0x5784ec['offset']=qs['offset'](_0xece985[_0xd655('0x3a')][_0xd655('0x22')]);}return _0x5404c6['getItems'](_0x5784ec);}})['then'](function(_0x9fdd0a){if(_0x9fdd0a){return _0x9fdd0a?{'count':_0x46c656,'rows':_0x9fdd0a}:null;}})[_0xd655('0x2b')](respondWithResult(_0x32eec9,null))[_0xd655('0x4d')](handleError(_0x32eec9,null));}; \ No newline at end of file +var _0x7bbe=['crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboard.socket','sendStatus','status','end','json','limit','count','offset','set','apply','save','update','destroy','then','get','error','stack','name','send','map','Dashboard','rawAttributes','fieldName','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','find','create','body','user','role','CustomDashboards','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','options','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','iframe','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrSmsAccounts','web-report','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','intersection','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x52799c,_0x3d006f){var _0x23f37b=function(_0x31995b){while(--_0x31995b){_0x52799c['push'](_0x52799c['shift']());}};_0x23f37b(++_0x3d006f);}(_0x7bbe,0x1e5));var _0xe7bb=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x7bbe[_0x2faddb];return _0x273c05;};'use strict';var emlformat=require(_0xe7bb('0x0'));var rimraf=require(_0xe7bb('0x1'));var zipdir=require(_0xe7bb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe7bb('0x3'));var BPromise=require(_0xe7bb('0x4'));var Mustache=require(_0xe7bb('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe7bb('0x6'));var csv=require(_0xe7bb('0x7'));var ejs=require(_0xe7bb('0x8'));var fs=require('fs');var fs_extra=require(_0xe7bb('0x9'));var _=require(_0xe7bb('0xa'));var squel=require('squel');var crypto=require(_0xe7bb('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe7bb('0x7'));var querystring=require(_0xe7bb('0xc'));var Papa=require(_0xe7bb('0xd'));var Redis=require(_0xe7bb('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe7bb('0xf'));var as=require(_0xe7bb('0x10'));var hardwareService=require(_0xe7bb('0x11'));var logger=require(_0xe7bb('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe7bb('0x13'));var db=require(_0xe7bb('0x14'))['db'];config[_0xe7bb('0x15')]=_[_0xe7bb('0x16')](config[_0xe7bb('0x15')],{'host':_0xe7bb('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe7bb('0x18'))['register'](socket);function respondWithStatusCode(_0x5a6347,_0x5877d2){_0x5877d2=_0x5877d2||0xcc;return function(_0x5ab377){if(_0x5ab377){return _0x5a6347[_0xe7bb('0x19')](_0x5877d2);}return _0x5a6347[_0xe7bb('0x1a')](_0x5877d2)[_0xe7bb('0x1b')]();};}function respondWithResult(_0x1e6126,_0x44b2ea){_0x44b2ea=_0x44b2ea||0xc8;return function(_0x901ebe){if(_0x901ebe){return _0x1e6126[_0xe7bb('0x1a')](_0x44b2ea)[_0xe7bb('0x1c')](_0x901ebe);}};}function respondWithFilteredResult(_0x469e9c,_0x27245e){return function(_0x4a79b5){if(_0x4a79b5){var _0xab0692=typeof _0x27245e['offset']==='undefined'&&typeof _0x27245e[_0xe7bb('0x1d')]==='undefined';var _0x371da9=_0x4a79b5[_0xe7bb('0x1e')];var _0x24660c=_0xab0692?0x0:_0x27245e['offset'];var _0x522b9e=_0xab0692?_0x4a79b5[_0xe7bb('0x1e')]:_0x27245e[_0xe7bb('0x1f')]+_0x27245e['limit'];var _0x4fd416;if(_0x522b9e>=_0x371da9){_0x522b9e=_0x371da9;_0x4fd416=0xc8;}else{_0x4fd416=0xce;}_0x469e9c[_0xe7bb('0x1a')](_0x4fd416);return _0x469e9c[_0xe7bb('0x20')]('Content-Range',_0x24660c+'-'+_0x522b9e+'/'+_0x371da9)['json'](_0x4a79b5);}return null;};}function patchUpdates(_0x224df9){return function(_0x5a0344){try{jsonpatch[_0xe7bb('0x21')](_0x5a0344,_0x224df9,!![]);}catch(_0x38b502){return BPromise['reject'](_0x38b502);}return _0x5a0344[_0xe7bb('0x22')]();};}function saveUpdates(_0x131168,_0x3ced3f){return function(_0x571320){if(_0x571320){return _0x571320[_0xe7bb('0x23')](_0x131168)['then'](function(_0x49f623){return _0x49f623;});}return null;};}function removeEntity(_0xb901d,_0x9146cf){return function(_0x2d412e){if(_0x2d412e){return _0x2d412e[_0xe7bb('0x24')]()[_0xe7bb('0x25')](function(){var _0x4a120e=_0x2d412e[_0xe7bb('0x26')]({'plain':!![]});var _0x1fac82='CustomDashboards';return db['UserProfileResource'][_0xe7bb('0x24')]({'where':{'type':_0x1fac82,'resourceId':_0x4a120e['id']}})[_0xe7bb('0x25')](function(){return _0x2d412e;});})[_0xe7bb('0x25')](function(){_0xb901d['status'](0xcc)[_0xe7bb('0x1b')]();});}};}function handleEntityNotFound(_0x401632,_0x2081f9){return function(_0x1de12f){if(!_0x1de12f){_0x401632[_0xe7bb('0x19')](0x194);}return _0x1de12f;};}function handleError(_0x2a54f6,_0x590b4f){_0x590b4f=_0x590b4f||0x1f4;return function(_0xcf746e){logger[_0xe7bb('0x27')](_0xcf746e[_0xe7bb('0x28')]);if(_0xcf746e[_0xe7bb('0x29')]){delete _0xcf746e[_0xe7bb('0x29')];}_0x2a54f6['status'](_0x590b4f)[_0xe7bb('0x2a')](_0xcf746e);};}exports['index']=function(_0x2b90e3,_0x32d23c){var _0x4e1d5b={},_0xfd9dbf={},_0x465d29={'count':0x0,'rows':[]};var _0x191025=_[_0xe7bb('0x2b')](db[_0xe7bb('0x2c')][_0xe7bb('0x2d')],function(_0x121c4d){return{'name':_0x121c4d[_0xe7bb('0x2e')],'type':_0x121c4d[_0xe7bb('0x2f')]['key']};});_0xfd9dbf[_0xe7bb('0x30')]=_[_0xe7bb('0x2b')](_0x191025,_0xe7bb('0x29'));_0xfd9dbf[_0xe7bb('0x31')]=_['keys'](_0x2b90e3[_0xe7bb('0x31')]);_0xfd9dbf[_0xe7bb('0x32')]=_['intersection'](_0xfd9dbf['model'],_0xfd9dbf[_0xe7bb('0x31')]);_0x4e1d5b[_0xe7bb('0x33')]=_['intersection'](_0xfd9dbf[_0xe7bb('0x30')],qs[_0xe7bb('0x34')](_0x2b90e3['query'][_0xe7bb('0x34')]));_0x4e1d5b['attributes']=_0x4e1d5b[_0xe7bb('0x33')][_0xe7bb('0x35')]?_0x4e1d5b[_0xe7bb('0x33')]:_0xfd9dbf[_0xe7bb('0x30')];if(!_0x2b90e3[_0xe7bb('0x31')][_0xe7bb('0x36')](_0xe7bb('0x37'))){_0x4e1d5b[_0xe7bb('0x1d')]=qs[_0xe7bb('0x1d')](_0x2b90e3[_0xe7bb('0x31')][_0xe7bb('0x1d')]);_0x4e1d5b['offset']=qs[_0xe7bb('0x1f')](_0x2b90e3[_0xe7bb('0x31')][_0xe7bb('0x1f')]);}_0x4e1d5b[_0xe7bb('0x38')]=qs['sort'](_0x2b90e3[_0xe7bb('0x31')][_0xe7bb('0x39')]);_0x4e1d5b[_0xe7bb('0x3a')]=qs[_0xe7bb('0x32')](_[_0xe7bb('0x3b')](_0x2b90e3['query'],_0xfd9dbf[_0xe7bb('0x32')]),_0x191025);if(_0x2b90e3['query'][_0xe7bb('0x3c')]){_0x4e1d5b[_0xe7bb('0x3a')]=_[_0xe7bb('0x3d')](_0x4e1d5b[_0xe7bb('0x3a')],{'$or':_[_0xe7bb('0x2b')](_0x191025,function(_0x2d2496){if(_0x2d2496[_0xe7bb('0x2f')]!==_0xe7bb('0x3e')){var _0x28ca2d={};_0x28ca2d[_0x2d2496[_0xe7bb('0x29')]]={'$like':'%'+_0x2b90e3[_0xe7bb('0x31')][_0xe7bb('0x3c')]+'%'};return _0x28ca2d;}})});}_0x4e1d5b=_['merge']({},_0x4e1d5b,_0x2b90e3['options']);var _0x311552={'where':_0x4e1d5b[_0xe7bb('0x3a')]};return db[_0xe7bb('0x2c')][_0xe7bb('0x1e')](_0x311552)[_0xe7bb('0x25')](function(_0x1451b2){_0x465d29[_0xe7bb('0x1e')]=_0x1451b2;if(_0x2b90e3[_0xe7bb('0x31')][_0xe7bb('0x3f')]){_0x4e1d5b[_0xe7bb('0x40')]=[{'all':!![]}];}return db['Dashboard'][_0xe7bb('0x41')](_0x4e1d5b);})[_0xe7bb('0x25')](function(_0x2dc707){_0x465d29['rows']=_0x2dc707;return _0x465d29;})[_0xe7bb('0x25')](respondWithFilteredResult(_0x32d23c,_0x4e1d5b))[_0xe7bb('0x42')](handleError(_0x32d23c,null));};exports[_0xe7bb('0x43')]=function(_0x3a202c,_0x433a93){var _0x5e396a={'raw':![],'where':{'id':_0x3a202c['params']['id']}},_0x5b5de1={};_0x5b5de1[_0xe7bb('0x30')]=_[_0xe7bb('0x44')](db['Dashboard'][_0xe7bb('0x2d')]);_0x5b5de1[_0xe7bb('0x31')]=_[_0xe7bb('0x44')](_0x3a202c[_0xe7bb('0x31')]);_0x5b5de1[_0xe7bb('0x32')]=_['intersection'](_0x5b5de1['model'],_0x5b5de1[_0xe7bb('0x31')]);_0x5e396a[_0xe7bb('0x33')]=_['intersection'](_0x5b5de1[_0xe7bb('0x30')],qs[_0xe7bb('0x34')](_0x3a202c['query'][_0xe7bb('0x34')]));_0x5e396a[_0xe7bb('0x33')]=_0x5e396a[_0xe7bb('0x33')][_0xe7bb('0x35')]?_0x5e396a[_0xe7bb('0x33')]:_0x5b5de1['model'];if(_0x3a202c[_0xe7bb('0x31')][_0xe7bb('0x3f')]){_0x5e396a[_0xe7bb('0x40')]=[{'all':!![]}];}_0x5e396a=_[_0xe7bb('0x3d')]({},_0x5e396a,_0x3a202c['options']);return db[_0xe7bb('0x2c')][_0xe7bb('0x45')](_0x5e396a)[_0xe7bb('0x25')](handleEntityNotFound(_0x433a93,null))['then'](respondWithResult(_0x433a93,null))[_0xe7bb('0x42')](handleError(_0x433a93,null));};exports['create']=function(_0x41d018,_0x3c8157){return db[_0xe7bb('0x2c')][_0xe7bb('0x46')](_0x41d018[_0xe7bb('0x47')],{})[_0xe7bb('0x25')](function(_0x16e944){var _0x28690c=_0x41d018[_0xe7bb('0x48')][_0xe7bb('0x26')]({'plain':!![]});if(!_0x28690c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28690c[_0xe7bb('0x49')]===_0xe7bb('0x48')){var _0x464250=_0x16e944[_0xe7bb('0x26')]({'plain':!![]});var _0x269d9f=_0xe7bb('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x269d9f,'userProfileId':_0x28690c[_0xe7bb('0x4b')]},'raw':!![]})['then'](function(_0x434fe1){if(_0x434fe1&&_0x434fe1[_0xe7bb('0x4c')]===0x0){return db[_0xe7bb('0x4d')][_0xe7bb('0x46')]({'name':_0x464250['name'],'resourceId':_0x464250['id'],'type':_0x434fe1[_0xe7bb('0x29')],'sectionId':_0x434fe1['id']},{})[_0xe7bb('0x25')](function(){return _0x16e944;});}else{return _0x16e944;}})[_0xe7bb('0x42')](function(_0x24437d){logger[_0xe7bb('0x27')](_0xe7bb('0x4e'),_0x24437d);throw _0x24437d;});}return _0x16e944;})[_0xe7bb('0x25')](respondWithResult(_0x3c8157,0xc9))['catch'](handleError(_0x3c8157,null));};exports[_0xe7bb('0x4f')]=function(_0x28125a,_0x50bc26){var _0x387180={'where':{'id':_0x28125a[_0xe7bb('0x50')]['id']}},_0x4fa40a={};_0x4fa40a[_0xe7bb('0x30')]=_[_0xe7bb('0x44')](db['Dashboard'][_0xe7bb('0x2d')]);_0x387180[_0xe7bb('0x33')]=_['intersection'](_0x4fa40a[_0xe7bb('0x30')],qs[_0xe7bb('0x34')](_0x28125a[_0xe7bb('0x31')]['fields']));_0x387180[_0xe7bb('0x33')]=_0x387180[_0xe7bb('0x33')]['length']?_0x387180[_0xe7bb('0x33')]:_0x4fa40a[_0xe7bb('0x30')];if(_0x28125a[_0xe7bb('0x31')][_0xe7bb('0x3f')]){_0x387180[_0xe7bb('0x40')]=[{'all':!![]}];}_0x387180=_[_0xe7bb('0x3d')]({},_0x387180,_0x28125a[_0xe7bb('0x51')]);return db[_0xe7bb('0x2c')][_0xe7bb('0x45')](_0x387180)[_0xe7bb('0x25')](handleEntityNotFound(_0x50bc26,null))[_0xe7bb('0x25')](function(_0x367f37){if(_0x367f37){var _0x27813b=_0x367f37['get']({'plain':!![]});_0x27813b=qs[_0xe7bb('0x52')](_0x27813b,['id',_0xe7bb('0x53'),_0xe7bb('0x54')]);_0x28125a[_0xe7bb('0x47')]=_['omit'](_0x28125a[_0xe7bb('0x47')],['id',_0xe7bb('0x53'),_0xe7bb('0x54')]);return db['Dashboard'][_0xe7bb('0x46')](_[_0xe7bb('0x3d')](_0x27813b,_0x28125a[_0xe7bb('0x47')]),{'include':_0x28125a[_0xe7bb('0x31')]['includeAll']?[{'all':!![]}]:undefined})[_0xe7bb('0x25')](function(_0x29268d){var _0x1d1914=_0x28125a[_0xe7bb('0x48')]['get']({'plain':!![]});if(!_0x1d1914)throw new Error(_0xe7bb('0x55'));if(_0x1d1914[_0xe7bb('0x49')]===_0xe7bb('0x48')){var _0x5b99f7=_0x29268d[_0xe7bb('0x26')]({'plain':!![]});var _0x50f2ca=_0xe7bb('0x4a');return db[_0xe7bb('0x56')][_0xe7bb('0x45')]({'where':{'name':_0x50f2ca,'userProfileId':_0x1d1914['userProfileId']},'raw':!![]})[_0xe7bb('0x25')](function(_0xc467d4){if(_0xc467d4&&_0xc467d4[_0xe7bb('0x4c')]===0x0){return db[_0xe7bb('0x4d')][_0xe7bb('0x46')]({'name':_0x5b99f7[_0xe7bb('0x29')],'resourceId':_0x5b99f7['id'],'type':_0xc467d4['name'],'sectionId':_0xc467d4['id']},{})[_0xe7bb('0x25')](function(){return _0x29268d;});}else{return _0x29268d;}})[_0xe7bb('0x42')](function(_0x1b2673){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b2673);throw _0x1b2673;});}return _0x29268d;});}})['then'](respondWithResult(_0x50bc26,0xc9))[_0xe7bb('0x42')](handleError(_0x50bc26,null));};exports[_0xe7bb('0x23')]=function(_0x3f49be,_0x5a5112){if(_0x3f49be['body']['id']){delete _0x3f49be[_0xe7bb('0x47')]['id'];}return db[_0xe7bb('0x2c')][_0xe7bb('0x45')]({'where':{'id':_0x3f49be[_0xe7bb('0x50')]['id']}})[_0xe7bb('0x25')](handleEntityNotFound(_0x5a5112,null))[_0xe7bb('0x25')](saveUpdates(_0x3f49be[_0xe7bb('0x47')],null))[_0xe7bb('0x25')](respondWithResult(_0x5a5112,null))[_0xe7bb('0x42')](handleError(_0x5a5112,null));};exports['destroy']=function(_0x2c7183,_0x4d3b50){return db[_0xe7bb('0x2c')][_0xe7bb('0x45')]({'where':{'id':_0x2c7183['params']['id']}})[_0xe7bb('0x25')](handleEntityNotFound(_0x4d3b50,null))[_0xe7bb('0x25')](removeEntity(_0x4d3b50,null))[_0xe7bb('0x42')](handleError(_0x4d3b50,null));};function widgetAttributes(_0x348c32){try{switch(_0x348c32[_0xe7bb('0x2f')]){case _0xe7bb('0x57'):return[{'name':_0xe7bb('0x58'),'value':_0x348c32['attrUrl']||(_0x348c32[_0xe7bb('0x59')]&&_0x348c32[_0xe7bb('0x59')][0x0]?_0x348c32[_0xe7bb('0x59')][0x0]['value']:undefined)||_0xe7bb('0x5a')}];case'custom':return[{'name':_0xe7bb('0x5b'),'value':_0x348c32['attrPath']||(_0x348c32[_0xe7bb('0x59')]&&_0x348c32[_0xe7bb('0x59')][0x0]?_0x348c32[_0xe7bb('0x59')][0x0][_0xe7bb('0x5c')]:undefined)||''}];case _0xe7bb('0x5d'):return[{'name':_0xe7bb('0x5e'),'value':_0x348c32[_0xe7bb('0x5e')]||(_0x348c32[_0xe7bb('0x59')]&&_0x348c32[_0xe7bb('0x59')][0x0]?_0x348c32[_0xe7bb('0x59')][0x0][_0xe7bb('0x5c')]:undefined)||_0xe7bb('0x5f')},{'name':_0xe7bb('0x60'),'value':_0x348c32[_0xe7bb('0x60')]||(_0x348c32[_0xe7bb('0x59')]&&_0x348c32[_0xe7bb('0x59')][0x1]?_0x348c32[_0xe7bb('0x59')][0x1][_0xe7bb('0x5c')]:undefined)||_0xe7bb('0x61')},{'name':_0xe7bb('0x62'),'value':_0x348c32[_0xe7bb('0x62')]||(_0x348c32['attrs']&&_0x348c32[_0xe7bb('0x59')][0x2]?_0x348c32['attrs'][0x2][_0xe7bb('0x5c')]:undefined)||0xc}];case _0xe7bb('0x63'):return[{'name':_0xe7bb('0x64'),'value':_0x348c32['attrMetric']||(_0x348c32['attrs']&&_0x348c32[_0xe7bb('0x59')][0x0]?_0x348c32[_0xe7bb('0x59')][0x0][_0xe7bb('0x5c')]:undefined)||_0xe7bb('0x65')},{'name':_0xe7bb('0x66'),'value':_0x348c32[_0xe7bb('0x66')]||(_0x348c32[_0xe7bb('0x59')]&&_0x348c32[_0xe7bb('0x59')][0x1]?_0x348c32[_0xe7bb('0x59')][0x1][_0xe7bb('0x5c')]:undefined)||[]},{'name':_0xe7bb('0x62'),'value':_0x348c32[_0xe7bb('0x62')]||(_0x348c32['attrs']&&_0x348c32[_0xe7bb('0x59')][0x2]?_0x348c32['attrs'][0x2][_0xe7bb('0x5c')]:undefined)||0x14},{'name':_0xe7bb('0x67'),'value':_0x348c32[_0xe7bb('0x67')]||(_0x348c32[_0xe7bb('0x59')]&&_0x348c32[_0xe7bb('0x59')][0x3]?_0x348c32[_0xe7bb('0x59')][0x3][_0xe7bb('0x5c')]:undefined)||_0xe7bb('0x68')},{'name':_0xe7bb('0x69'),'value':_0x348c32[_0xe7bb('0x69')]||(_0x348c32['attrs']&&_0x348c32['attrs'][0x4]?_0x348c32[_0xe7bb('0x59')][0x4][_0xe7bb('0x5c')]:undefined)||''},{'name':_0xe7bb('0x6a'),'value':_0x348c32[_0xe7bb('0x6a')]||(_0x348c32['attrs']&&_0x348c32['attrs'][0x5]?_0x348c32[_0xe7bb('0x59')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x348c32['attrSmsAccounts']||(_0x348c32['attrs']&&_0x348c32[_0xe7bb('0x59')][0x6]?_0x348c32[_0xe7bb('0x59')][0x6]['value']:undefined)||''},{'name':_0xe7bb('0x6b'),'value':_0x348c32['attrOpenchannelAccounts']||(_0x348c32['attrs']&&_0x348c32['attrs'][0x7]?_0x348c32[_0xe7bb('0x59')][0x7][_0xe7bb('0x5c')]:undefined)||''},{'name':_0xe7bb('0x6c'),'value':_0x348c32[_0xe7bb('0x6c')]||(_0x348c32[_0xe7bb('0x59')]&&_0x348c32['attrs'][0x8]?_0x348c32[_0xe7bb('0x59')][0x8][_0xe7bb('0x5c')]:undefined)||''},{'name':_0xe7bb('0x6d'),'value':_0x348c32[_0xe7bb('0x6d')]||(_0x348c32[_0xe7bb('0x59')]&&_0x348c32[_0xe7bb('0x59')][0x9]?_0x348c32['attrs'][0x9][_0xe7bb('0x5c')]:undefined)||''}];case _0xe7bb('0x6e'):case _0xe7bb('0x6f'):return[{'name':_0xe7bb('0x70'),'value':_0x348c32[_0xe7bb('0x70')]||(_0x348c32['attrs']&&_0x348c32[_0xe7bb('0x59')][0x0]?_0x348c32[_0xe7bb('0x59')][0x0][_0xe7bb('0x5c')]:undefined)||_0xe7bb('0x65')},{'name':'attrSerie2','value':_0x348c32[_0xe7bb('0x71')]||(_0x348c32[_0xe7bb('0x59')]&&_0x348c32[_0xe7bb('0x59')][0x1]?_0x348c32['attrs'][0x1]['value']:undefined)||null},{'name':_0xe7bb('0x72'),'value':_0x348c32[_0xe7bb('0x72')]||(_0x348c32[_0xe7bb('0x59')]&&_0x348c32[_0xe7bb('0x59')][0x2]?_0x348c32[_0xe7bb('0x59')][0x2][_0xe7bb('0x5c')]:undefined)||null},{'name':_0xe7bb('0x66'),'value':_0x348c32[_0xe7bb('0x66')]||(_0x348c32['attrs']&&_0x348c32[_0xe7bb('0x59')][0x3]?_0x348c32['attrs'][0x3][_0xe7bb('0x5c')]:undefined)||[]},{'name':'attrChannel','value':_0x348c32[_0xe7bb('0x67')]||(_0x348c32[_0xe7bb('0x59')]&&_0x348c32['attrs'][0x4]?_0x348c32[_0xe7bb('0x59')][0x4]['value']:undefined)||_0xe7bb('0x68')},{'name':_0xe7bb('0x69'),'value':_0x348c32[_0xe7bb('0x69')]||(_0x348c32[_0xe7bb('0x59')]&&_0x348c32[_0xe7bb('0x59')][0x5]?_0x348c32[_0xe7bb('0x59')][0x5][_0xe7bb('0x5c')]:undefined)||''},{'name':_0xe7bb('0x6a'),'value':_0x348c32['attrFaxAccounts']||(_0x348c32['attrs']&&_0x348c32['attrs'][0x6]?_0x348c32[_0xe7bb('0x59')][0x6][_0xe7bb('0x5c')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x348c32[_0xe7bb('0x73')]||(_0x348c32['attrs']&&_0x348c32[_0xe7bb('0x59')][0x7]?_0x348c32['attrs'][0x7][_0xe7bb('0x5c')]:undefined)||''},{'name':_0xe7bb('0x6b'),'value':_0x348c32[_0xe7bb('0x6b')]||(_0x348c32[_0xe7bb('0x59')]&&_0x348c32[_0xe7bb('0x59')][0x8]?_0x348c32['attrs'][0x8][_0xe7bb('0x5c')]:undefined)||''},{'name':_0xe7bb('0x6c'),'value':_0x348c32[_0xe7bb('0x6c')]||(_0x348c32[_0xe7bb('0x59')]&&_0x348c32[_0xe7bb('0x59')][0x9]?_0x348c32[_0xe7bb('0x59')][0x9][_0xe7bb('0x5c')]:undefined)||''},{'name':_0xe7bb('0x6d'),'value':_0x348c32[_0xe7bb('0x6d')]||(_0x348c32[_0xe7bb('0x59')]&&_0x348c32[_0xe7bb('0x59')][0xa]?_0x348c32['attrs'][0xa][_0xe7bb('0x5c')]:undefined)||''}];case _0xe7bb('0x74'):return[{'name':'attrReport','type':_0x348c32['reportType']||(_0x348c32['attrs']&&_0x348c32[_0xe7bb('0x59')][0x0]?_0x348c32[_0xe7bb('0x59')][0x0][_0xe7bb('0x2f')]:undefined)||null,'value':_0x348c32['attrReport']||(_0x348c32[_0xe7bb('0x59')]&&_0x348c32[_0xe7bb('0x59')][0x0]?_0x348c32['attrs'][0x0][_0xe7bb('0x5c')]:undefined)||null},{'name':'attrRefresh','value':_0x348c32['attrRefresh']||(_0x348c32['attrs']&&_0x348c32['attrs'][0x1]?_0x348c32[_0xe7bb('0x59')][0x1][_0xe7bb('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x5110a2){logger[_0xe7bb('0x27')]('widgetAttributes:\x20%s',JSON[_0xe7bb('0x75')](_0x5110a2));return[];}}exports[_0xe7bb('0x76')]=function(_0x7961b,_0x16b068,_0x10d7b2){if(_0x7961b[_0xe7bb('0x47')]['id']){delete _0x7961b[_0xe7bb('0x47')]['id'];}return db['Dashboard'][_0xe7bb('0x45')]({'where':{'id':_0x7961b[_0xe7bb('0x50')]['id']}})[_0xe7bb('0x25')](handleEntityNotFound(_0x16b068,null))['then'](function(_0x5ee0bd){if(_0x5ee0bd){_0x7961b[_0xe7bb('0x47')][_0xe7bb('0x77')]=_0x5ee0bd['id'];_0x7961b[_0xe7bb('0x47')][_0xe7bb('0x59')]=widgetAttributes(_0x7961b[_0xe7bb('0x47')]);return db[_0xe7bb('0x78')]['create'](_0x7961b[_0xe7bb('0x47')]);}})[_0xe7bb('0x25')](respondWithResult(_0x16b068,null))[_0xe7bb('0x42')](handleError(_0x16b068,null));};exports[_0xe7bb('0x79')]=function(_0x59e74f,_0x2e46fb,_0x2ae3ec){var _0xf98e52={};var _0x3d7200={};var _0x3f891e;var _0x1b3d81;return db[_0xe7bb('0x2c')][_0xe7bb('0x7a')]({'where':{'id':_0x59e74f[_0xe7bb('0x50')]['id']}})[_0xe7bb('0x25')](handleEntityNotFound(_0x2e46fb,null))[_0xe7bb('0x25')](function(_0x4e3440){if(_0x4e3440){_0x3f891e=_0x4e3440;_0x3d7200[_0xe7bb('0x30')]=_[_0xe7bb('0x44')](db['DashboardItem']['rawAttributes']);_0x3d7200[_0xe7bb('0x31')]=_[_0xe7bb('0x44')](_0x59e74f['query']);_0x3d7200['filters']=_[_0xe7bb('0x7b')](_0x3d7200[_0xe7bb('0x30')],_0x3d7200[_0xe7bb('0x31')]);_0xf98e52[_0xe7bb('0x33')]=_[_0xe7bb('0x7b')](_0x3d7200[_0xe7bb('0x30')],qs[_0xe7bb('0x34')](_0x59e74f['query'][_0xe7bb('0x34')]));_0xf98e52[_0xe7bb('0x33')]=_0xf98e52['attributes']['length']?_0xf98e52[_0xe7bb('0x33')]:_0x3d7200[_0xe7bb('0x30')];_0xf98e52[_0xe7bb('0x38')]=qs[_0xe7bb('0x39')](_0x59e74f[_0xe7bb('0x31')][_0xe7bb('0x39')]);_0xf98e52[_0xe7bb('0x3a')]=qs[_0xe7bb('0x32')](_[_0xe7bb('0x3b')](_0x59e74f[_0xe7bb('0x31')],_0x3d7200[_0xe7bb('0x32')]));if(_0x59e74f[_0xe7bb('0x31')][_0xe7bb('0x3c')]){_0xf98e52[_0xe7bb('0x3a')]=_[_0xe7bb('0x3d')](_0xf98e52[_0xe7bb('0x3a')],{'$or':_[_0xe7bb('0x2b')](_0xf98e52[_0xe7bb('0x33')],function(_0x53df7d){var _0x259379={};_0x259379[_0x53df7d]={'$like':'%'+_0x59e74f[_0xe7bb('0x31')][_0xe7bb('0x3c')]+'%'};return _0x259379;})});}_0xf98e52=_[_0xe7bb('0x3d')]({},_0xf98e52,_0x59e74f[_0xe7bb('0x51')]);return _0x3f891e[_0xe7bb('0x79')](_0xf98e52);}})[_0xe7bb('0x25')](function(_0x2c6219){if(_0x2c6219){_0x1b3d81=_0x2c6219[_0xe7bb('0x35')];if(!_0x59e74f[_0xe7bb('0x31')][_0xe7bb('0x36')](_0xe7bb('0x37'))){_0xf98e52[_0xe7bb('0x1d')]=qs[_0xe7bb('0x1d')](_0x59e74f['query'][_0xe7bb('0x1d')]);_0xf98e52[_0xe7bb('0x1f')]=qs[_0xe7bb('0x1f')](_0x59e74f[_0xe7bb('0x31')][_0xe7bb('0x1f')]);}return _0x3f891e[_0xe7bb('0x79')](_0xf98e52);}})[_0xe7bb('0x25')](function(_0x58ab5a){if(_0x58ab5a){return _0x58ab5a?{'count':_0x1b3d81,'rows':_0x58ab5a}:null;}})['then'](respondWithResult(_0x2e46fb,null))['catch'](handleError(_0x2e46fb,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 66f5c90..c55a012 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 _0x2d1d=['remove','emit','hook','exports','Dashboard','setMaxListeners','save'];(function(_0x3cfa56,_0x21fdfe){var _0x4cca36=function(_0x33d592){while(--_0x33d592){_0x3cfa56['push'](_0x3cfa56['shift']());}};_0x4cca36(++_0x21fdfe);}(_0x2d1d,0x10e));var _0xd2d1=function(_0x4cf3ed,_0x6993df){_0x4cf3ed=_0x4cf3ed-0x0;var _0x7c6045=_0x2d1d[_0x4cf3ed];return _0x7c6045;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0xd2d1('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xd2d1('0x1')](0x0);var events={'afterCreate':_0xd2d1('0x2'),'afterUpdate':'update','afterDestroy':_0xd2d1('0x3')};function emitEvent(_0x3438a5){return function(_0x30c0f0,_0x40b9d5,_0x5979f9){DashboardEvents['emit'](_0x3438a5+':'+_0x30c0f0['id'],_0x30c0f0);DashboardEvents[_0xd2d1('0x4')](_0x3438a5,_0x30c0f0);_0x5979f9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xd2d1('0x5')](e,emitEvent(event));}}module[_0xd2d1('0x6')]=DashboardEvents; \ No newline at end of file +var _0x1328=['setMaxListeners','save','update','remove','hasOwnProperty','events','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1328,0x11d));var _0x8132=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0x1328[_0x5ecadc];return _0x565037;};'use strict';var EventEmitter=require(_0x8132('0x0'));var Dashboard=require(_0x8132('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8132('0x2')](0x0);var events={'afterCreate':_0x8132('0x3'),'afterUpdate':_0x8132('0x4'),'afterDestroy':_0x8132('0x5')};function emitEvent(_0x20b1d7){return function(_0x438566,_0x52c498,_0x1b9957){DashboardEvents['emit'](_0x20b1d7+':'+_0x438566['id'],_0x438566);DashboardEvents['emit'](_0x20b1d7,_0x438566);_0x1b9957(null);};}for(var e in events){if(events[_0x8132('0x6')](e)){var event=events[e];Dashboard['hook'](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 4257e3f..5caed5b 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 _0x6ea8=['request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','lodash','api','moment','bluebird'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0x6ea8,0x128));var _0x86ea=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x6ea8[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x86ea('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x86ea('0x1'));var moment=require(_0x86ea('0x2'));var BPromise=require(_0x86ea('0x3'));var rp=require(_0x86ea('0x4'));var fs=require('fs');var path=require(_0x86ea('0x5'));var rimraf=require(_0x86ea('0x6'));var config=require(_0x86ea('0x7'));var attributes=require(_0x86ea('0x8'));module[_0x86ea('0x9')]=function(_0x4c0d31,_0x1a7386){return _0x4c0d31[_0x86ea('0xa')](_0x86ea('0xb'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35b3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Dashboard','dashboards','lodash','../../config/logger','api'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x35b3,0xb1));var _0x335b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x35b3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x335b('0x0'));var util=require('util');var logger=require(_0x335b('0x1'))(_0x335b('0x2'));var moment=require(_0x335b('0x3'));var BPromise=require(_0x335b('0x4'));var rp=require(_0x335b('0x5'));var fs=require('fs');var path=require(_0x335b('0x6'));var rimraf=require(_0x335b('0x7'));var config=require(_0x335b('0x8'));var attributes=require('./dashboard.attributes');module[_0x335b('0x9')]=function(_0x4a69ec,_0x508ae5){return _0x4a69ec['define'](_0x335b('0xa'),attributes,{'tableName':_0x335b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 1d34f0c..bc055de 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 _0x216c=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','Dashboard,\x20%s,\x20%s','debug','request\x20sent','code','error','message','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x14c684,_0x22c35c){var _0x20e76b=function(_0x2251dd){while(--_0x2251dd){_0x14c684['push'](_0x14c684['shift']());}};_0x20e76b(++_0x22c35c);}(_0x216c,0xb1));var _0xc216=function(_0xd91d7e,_0x56fe36){_0xd91d7e=_0xd91d7e-0x0;var _0x148a2e=_0x216c[_0xd91d7e];return _0x148a2e;};'use strict';var _=require('lodash');var util=require(_0xc216('0x0'));var moment=require(_0xc216('0x1'));var BPromise=require(_0xc216('0x2'));var rs=require(_0xc216('0x3'));var fs=require('fs');var Redis=require(_0xc216('0x4'));var db=require(_0xc216('0x5'))['db'];var utils=require(_0xc216('0x6'));var logger=require(_0xc216('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc216('0x8'));var client=jayson[_0xc216('0x9')][_0xc216('0xa')]({'port':0x232a});config['redis']=_[_0xc216('0xb')](config[_0xc216('0xc')],{'host':_0xc216('0xd'),'port':0x18eb});var socket=require(_0xc216('0xe'))(new Redis(config['redis']));require('./dashboard.socket')[_0xc216('0xf')](socket);function respondWithRpcPromise(_0x5dd580,_0xb3714e,_0x2788dd){return new BPromise(function(_0x37b75a,_0x24b497){return client[_0xc216('0x10')](_0x5dd580,_0x2788dd)[_0xc216('0x11')](function(_0x5ec195){logger[_0xc216('0x12')](_0xc216('0x13'),_0xb3714e,'request\x20sent');logger[_0xc216('0x14')]('Dashboard,\x20%s,\x20%s,\x20%s',_0xb3714e,_0xc216('0x15'),JSON['stringify'](_0x5ec195));if(_0x5ec195['error']){if(_0x5ec195['error'][_0xc216('0x16')]===0x1f4){logger[_0xc216('0x17')](_0xc216('0x13'),_0xb3714e,_0x5ec195[_0xc216('0x17')][_0xc216('0x18')]);return _0x24b497(_0x5ec195['error'][_0xc216('0x18')]);}logger[_0xc216('0x17')](_0xc216('0x13'),_0xb3714e,_0x5ec195[_0xc216('0x17')][_0xc216('0x18')]);return _0x37b75a(_0x5ec195[_0xc216('0x17')][_0xc216('0x18')]);}else{logger[_0xc216('0x12')](_0xc216('0x13'),_0xb3714e,_0xc216('0x15'));_0x37b75a(_0x5ec195[_0xc216('0x19')][_0xc216('0x18')]);}})['catch'](function(_0x1659f2){logger[_0xc216('0x17')]('Dashboard,\x20%s,\x20%s',_0xb3714e,_0x1659f2);_0x24b497(_0x1659f2);});});} \ No newline at end of file +var _0x3bc3=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','redis','defaults','localhost','./dashboard.socket','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dashboard,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x366e4e,_0x87847b){var _0x221d52=function(_0x4d7cbc){while(--_0x4d7cbc){_0x366e4e['push'](_0x366e4e['shift']());}};_0x221d52(++_0x87847b);}(_0x3bc3,0x80));var _0x33bc=function(_0x31963c,_0x5101f4){_0x31963c=_0x31963c-0x0;var _0x48e9c2=_0x3bc3[_0x31963c];return _0x48e9c2;};'use strict';var _=require(_0x33bc('0x0'));var util=require(_0x33bc('0x1'));var moment=require(_0x33bc('0x2'));var BPromise=require(_0x33bc('0x3'));var rs=require(_0x33bc('0x4'));var fs=require('fs');var Redis=require(_0x33bc('0x5'));var db=require(_0x33bc('0x6'))['db'];var utils=require(_0x33bc('0x7'));var logger=require(_0x33bc('0x8'))('rpc');var config=require(_0x33bc('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x33bc('0xa')]=_[_0x33bc('0xb')](config[_0x33bc('0xa')],{'host':_0x33bc('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x33bc('0xa')]));require(_0x33bc('0xd'))['register'](socket);function respondWithRpcPromise(_0x460fde,_0x4cda5c,_0x2d128b){return new BPromise(function(_0xe9835d,_0x3c7211){return client['request'](_0x460fde,_0x2d128b)[_0x33bc('0xe')](function(_0x757ed){logger[_0x33bc('0xf')]('Dashboard,\x20%s,\x20%s',_0x4cda5c,_0x33bc('0x10'));logger[_0x33bc('0x11')](_0x33bc('0x12'),_0x4cda5c,_0x33bc('0x10'),JSON[_0x33bc('0x13')](_0x757ed));if(_0x757ed[_0x33bc('0x14')]){if(_0x757ed[_0x33bc('0x14')][_0x33bc('0x15')]===0x1f4){logger[_0x33bc('0x14')]('Dashboard,\x20%s,\x20%s',_0x4cda5c,_0x757ed[_0x33bc('0x14')][_0x33bc('0x16')]);return _0x3c7211(_0x757ed['error'][_0x33bc('0x16')]);}logger[_0x33bc('0x14')](_0x33bc('0x17'),_0x4cda5c,_0x757ed[_0x33bc('0x14')][_0x33bc('0x16')]);return _0xe9835d(_0x757ed['error']['message']);}else{logger[_0x33bc('0xf')](_0x33bc('0x17'),_0x4cda5c,_0x33bc('0x10'));_0xe9835d(_0x757ed[_0x33bc('0x18')][_0x33bc('0x16')]);}})[_0x33bc('0x19')](function(_0x3758f2){logger[_0x33bc('0x14')](_0x33bc('0x17'),_0x4cda5c,_0x3758f2);_0x3c7211(_0x3758f2);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index a273ca4..d8c8657 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 _0x1621=['dashboard:','./dashboard.events','save','remove','update','emit','removeListener'];(function(_0x283d08,_0x1f6e3a){var _0x45b5fb=function(_0x215713){while(--_0x215713){_0x283d08['push'](_0x283d08['shift']());}};_0x45b5fb(++_0x1f6e3a);}(_0x1621,0xbe));var _0x1162=function(_0x2730da,_0x1098bd){_0x2730da=_0x2730da-0x0;var _0xfe9991=_0x1621[_0x2730da];return _0xfe9991;};'use strict';var DashboardEvents=require(_0x1162('0x0'));var events=[_0x1162('0x1'),_0x1162('0x2'),_0x1162('0x3')];function createListener(_0x5ddb0b,_0x1fc631){return function(_0xe2916b){_0x1fc631[_0x1162('0x4')](_0x5ddb0b,_0xe2916b);};}function removeListener(_0x5153f7,_0xb24bf0){return function(){DashboardEvents[_0x1162('0x5')](_0x5153f7,_0xb24bf0);};}exports['register']=function(_0x566987){for(var _0x267154=0x0,_0x5943ad=events['length'];_0x267154<_0x5943ad;_0x267154++){var _0x7bd5fb=events[_0x267154];var _0x276be5=createListener(_0x1162('0x6')+_0x7bd5fb,_0x566987);DashboardEvents['on'](_0x7bd5fb,_0x276be5);}}; \ No newline at end of file +var _0x16d2=['register','dashboard:','./dashboard.events','save','remove','emit'];(function(_0x106e60,_0xb95cb6){var _0x44a7a1=function(_0x14ed41){while(--_0x14ed41){_0x106e60['push'](_0x106e60['shift']());}};_0x44a7a1(++_0xb95cb6);}(_0x16d2,0x158));var _0x216d=function(_0x35f8cd,_0x1c7756){_0x35f8cd=_0x35f8cd-0x0;var _0x560291=_0x16d2[_0x35f8cd];return _0x560291;};'use strict';var DashboardEvents=require(_0x216d('0x0'));var events=[_0x216d('0x1'),_0x216d('0x2'),'update'];function createListener(_0x3c3efe,_0x146dc7){return function(_0x3e7b9b){_0x146dc7[_0x216d('0x3')](_0x3c3efe,_0x3e7b9b);};}function removeListener(_0x365510,_0xed9a32){return function(){DashboardEvents['removeListener'](_0x365510,_0xed9a32);};}exports[_0x216d('0x4')]=function(_0x2f5153){for(var _0x2719d5=0x0,_0x4566c4=events['length'];_0x2719d5<_0x4566c4;_0x2719d5++){var _0x5ac846=events[_0x2719d5];var _0x25db0e=createListener(_0x216d('0x5')+_0x5ac846,_0x2f5153);DashboardEvents['on'](_0x5ac846,_0x25db0e);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index b44ef03..36ab8b7 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 _0xb96b=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated','getItems','post','create','/:id/clone','clone','addItem','put'];(function(_0x57eaa0,_0x32aae5){var _0x9d53d2=function(_0x3c6ccd){while(--_0x3c6ccd){_0x57eaa0['push'](_0x57eaa0['shift']());}};_0x9d53d2(++_0x32aae5);}(_0xb96b,0x1a1));var _0xbb96=function(_0x28be72,_0x2b83af){_0x28be72=_0x28be72-0x0;var _0x46c5da=_0xb96b[_0x28be72];return _0x46c5da;};'use strict';var multer=require(_0xbb96('0x0'));var util=require(_0xbb96('0x1'));var path=require(_0xbb96('0x2'));var timeout=require('connect-timeout');var express=require(_0xbb96('0x3'));var router=express[_0xbb96('0x4')]();var fs_extra=require(_0xbb96('0x5'));var auth=require(_0xbb96('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbb96('0x7'));var controller=require(_0xbb96('0x8'));router[_0xbb96('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb96('0xa')]);router['get'](_0xbb96('0xb'),auth[_0xbb96('0xc')](),controller['show']);router[_0xbb96('0x9')]('/:id/items',auth[_0xbb96('0xc')](),controller[_0xbb96('0xd')]);router[_0xbb96('0xe')]('/',auth[_0xbb96('0xc')](),controller[_0xbb96('0xf')]);router[_0xbb96('0xe')](_0xbb96('0x10'),auth[_0xbb96('0xc')](),controller[_0xbb96('0x11')]);router[_0xbb96('0xe')]('/:id/items',auth[_0xbb96('0xc')](),controller[_0xbb96('0x12')]);router[_0xbb96('0x13')](_0xbb96('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xbb96('0x14')](_0xbb96('0xb'),auth[_0xbb96('0xc')](),controller[_0xbb96('0x15')]);module[_0xbb96('0x16')]=router; \ No newline at end of file +var _0x2564=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/items','getItems','post','create','clone','addItem','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xbcbb29,_0x5d420d){var _0x1b11de=function(_0x439212){while(--_0x439212){_0xbcbb29['push'](_0xbcbb29['shift']());}};_0x1b11de(++_0x5d420d);}(_0x2564,0xd1));var _0x4256=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2564[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x4256('0x0'));var util=require(_0x4256('0x1'));var path=require(_0x4256('0x2'));var timeout=require(_0x4256('0x3'));var express=require(_0x4256('0x4'));var router=express[_0x4256('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4256('0x6'));var interaction=require(_0x4256('0x7'));var config=require(_0x4256('0x8'));var controller=require('./dashboard.controller');router[_0x4256('0x9')]('/',auth[_0x4256('0xa')](),controller[_0x4256('0xb')]);router['get'](_0x4256('0xc'),auth[_0x4256('0xa')](),controller['show']);router[_0x4256('0x9')](_0x4256('0xd'),auth[_0x4256('0xa')](),controller[_0x4256('0xe')]);router[_0x4256('0xf')]('/',auth[_0x4256('0xa')](),controller[_0x4256('0x10')]);router[_0x4256('0xf')]('/:id/clone',auth[_0x4256('0xa')](),controller[_0x4256('0x11')]);router[_0x4256('0xf')](_0x4256('0xd'),auth[_0x4256('0xa')](),controller[_0x4256('0x12')]);router[_0x4256('0x13')]('/:id',auth[_0x4256('0xa')](),controller[_0x4256('0x14')]);router[_0x4256('0x15')]('/:id',auth[_0x4256('0xa')](),controller[_0x4256('0x16')]);module[_0x4256('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 28004c9..865fd24 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 _0x687b=['sequelize','squel','lodash','exports','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','STRING','#ffffff','#2196f3'];(function(_0x186814,_0x4f51e1){var _0x2e7d34=function(_0x1f997f){while(--_0x1f997f){_0x186814['push'](_0x186814['shift']());}};_0x2e7d34(++_0x4f51e1);}(_0x687b,0x14a));var _0xb687=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x687b[_0x6a0266];return _0x309e00;};'use strict';var Sequelize=require(_0xb687('0x0'));var squel=require(_0xb687('0x1'));var _=require(_0xb687('0x2'));module[_0xb687('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb687('0x4')](_0xb687('0x5')),'get':function(){try{return JSON[_0xb687('0x6')](this[_0xb687('0x7')](_0xb687('0x8')));}catch(_0x194c55){return[];}},'set':function(_0x16ccf3){try{this[_0xb687('0x9')](_0xb687('0x8'),JSON[_0xb687('0xa')](_0x16ccf3));}catch(_0x48942b){this[_0xb687('0x9')](_0xb687('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xb687('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb687('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb687('0xb')]},'col':{'type':Sequelize[_0xb687('0xb')]},'background':{'type':Sequelize[_0xb687('0xc')],'allowNull':![],'defaultValue':_0xb687('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb687('0xc')],'allowNull':![],'defaultValue':_0xb687('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb687('0xc')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x53ec=['getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','long'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0x53ec,0x192));var _0xc53e=function(_0x269ac2,_0x139b30){_0x269ac2=_0x269ac2-0x0;var _0x288e11=_0x53ec[_0x269ac2];return _0x288e11;};'use strict';var Sequelize=require(_0xc53e('0x0'));var squel=require(_0xc53e('0x1'));var _=require(_0xc53e('0x2'));module[_0xc53e('0x3')]={'title':{'type':Sequelize[_0xc53e('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xc53e('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xc53e('0x5')),'get':function(){try{return JSON['parse'](this[_0xc53e('0x6')](_0xc53e('0x7')));}catch(_0x4a9c59){return[];}},'set':function(_0x2f1414){try{this['setDataValue'](_0xc53e('0x7'),JSON[_0xc53e('0x8')](_0x2f1414));}catch(_0x5d3b28){this[_0xc53e('0x9')](_0xc53e('0x7'),JSON[_0xc53e('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xc53e('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xc53e('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xc53e('0xa')]},'col':{'type':Sequelize[_0xc53e('0xa')]},'background':{'type':Sequelize[_0xc53e('0x4')],'allowNull':![],'defaultValue':_0xc53e('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xc53e('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 1dd6266..b87ed47 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 _0xbacd=['merge','options','find','catch','type','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrChatWebsites','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','end','error','name','send','params','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','model','fields','length','includeAll','include'];(function(_0x10f32e,_0x459797){var _0x3c5d1e=function(_0x4300cb){while(--_0x4300cb){_0x10f32e['push'](_0x10f32e['shift']());}};_0x3c5d1e(++_0x459797);}(_0xbacd,0x1c5));var _0xdbac=function(_0xf7018f,_0x134da9){_0xf7018f=_0xf7018f-0x0;var _0x4da467=_0xbacd[_0xf7018f];return _0x4da467;};'use strict';var emlformat=require(_0xdbac('0x0'));var rimraf=require(_0xdbac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdbac('0x2'));var rp=require(_0xdbac('0x3'));var moment=require(_0xdbac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdbac('0x5'));var util=require(_0xdbac('0x6'));var path=require(_0xdbac('0x7'));var sox=require(_0xdbac('0x8'));var csv=require(_0xdbac('0x9'));var ejs=require(_0xdbac('0xa'));var fs=require('fs');var fs_extra=require(_0xdbac('0xb'));var _=require(_0xdbac('0xc'));var squel=require(_0xdbac('0xd'));var crypto=require(_0xdbac('0xe'));var jsforce=require(_0xdbac('0xf'));var deskjs=require(_0xdbac('0x10'));var toCsv=require(_0xdbac('0x9'));var querystring=require(_0xdbac('0x11'));var Papa=require(_0xdbac('0x12'));var Redis=require('ioredis');var authService=require(_0xdbac('0x13'));var qs=require(_0xdbac('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdbac('0x15'));var logger=require('../../config/logger')(_0xdbac('0x16'));var utils=require(_0xdbac('0x17'));var config=require(_0xdbac('0x18'));var licenseUtil=require(_0xdbac('0x19'));var db=require(_0xdbac('0x1a'))['db'];config[_0xdbac('0x1b')]=_[_0xdbac('0x1c')](config[_0xdbac('0x1b')],{'host':_0xdbac('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdbac('0x1b')]));require(_0xdbac('0x1e'))[_0xdbac('0x1f')](socket);function respondWithStatusCode(_0x14ebaa,_0x3c6740){_0x3c6740=_0x3c6740||0xcc;return function(_0x1fc4ba){if(_0x1fc4ba){return _0x14ebaa[_0xdbac('0x20')](_0x3c6740);}return _0x14ebaa[_0xdbac('0x21')](_0x3c6740)['end']();};}function respondWithResult(_0x2694ef,_0x1c1f30){_0x1c1f30=_0x1c1f30||0xc8;return function(_0x1a2b18){if(_0x1a2b18){return _0x2694ef['status'](_0x1c1f30)[_0xdbac('0x22')](_0x1a2b18);}};}function respondWithFilteredResult(_0x36e0de,_0x3d1dbb){return function(_0x252fc1){if(_0x252fc1){var _0x50206a=typeof _0x3d1dbb[_0xdbac('0x23')]===_0xdbac('0x24')&&typeof _0x3d1dbb[_0xdbac('0x25')]===_0xdbac('0x24');var _0x1301d2=_0x252fc1[_0xdbac('0x26')];var _0x9c74a5=_0x50206a?0x0:_0x3d1dbb['offset'];var _0x3de274=_0x50206a?_0x252fc1[_0xdbac('0x26')]:_0x3d1dbb['offset']+_0x3d1dbb[_0xdbac('0x25')];var _0x582c0b;if(_0x3de274>=_0x1301d2){_0x3de274=_0x1301d2;_0x582c0b=0xc8;}else{_0x582c0b=0xce;}_0x36e0de[_0xdbac('0x21')](_0x582c0b);return _0x36e0de['set'](_0xdbac('0x27'),_0x9c74a5+'-'+_0x3de274+'/'+_0x1301d2)[_0xdbac('0x22')](_0x252fc1);}return null;};}function patchUpdates(_0x20642c){return function(_0x4263c4){try{jsonpatch[_0xdbac('0x28')](_0x4263c4,_0x20642c,!![]);}catch(_0x4148fc){return BPromise[_0xdbac('0x29')](_0x4148fc);}return _0x4263c4['save']();};}function saveUpdates(_0x361930,_0x822567){return function(_0x2e0cc1){if(_0x2e0cc1){return _0x2e0cc1[_0xdbac('0x2a')](_0x361930)[_0xdbac('0x2b')](function(_0x2b4cda){return _0x2b4cda;});}return null;};}function removeEntity(_0x3a0f3f,_0x15653d){return function(_0x1a8e46){if(_0x1a8e46){return _0x1a8e46[_0xdbac('0x2c')]()[_0xdbac('0x2b')](function(){_0x3a0f3f[_0xdbac('0x21')](0xcc)[_0xdbac('0x2d')]();});}};}function handleEntityNotFound(_0x3c8bfc,_0x35a7f0){return function(_0x31361d){if(!_0x31361d){_0x3c8bfc[_0xdbac('0x20')](0x194);}return _0x31361d;};}function handleError(_0x2bdb01,_0x31223b){_0x31223b=_0x31223b||0x1f4;return function(_0xe744cc){logger[_0xdbac('0x2e')](_0xe744cc['stack']);if(_0xe744cc[_0xdbac('0x2f')]){delete _0xe744cc[_0xdbac('0x2f')];}_0x2bdb01[_0xdbac('0x21')](_0x31223b)[_0xdbac('0x30')](_0xe744cc);};}exports['show']=function(_0x505321,_0x10c3c8){var _0x267d70={'raw':![],'where':{'id':_0x505321[_0xdbac('0x31')]['id']}},_0x40dccc={};_0x40dccc['model']=_[_0xdbac('0x32')](db[_0xdbac('0x33')][_0xdbac('0x34')]);_0x40dccc[_0xdbac('0x35')]=_[_0xdbac('0x32')](_0x505321[_0xdbac('0x35')]);_0x40dccc[_0xdbac('0x36')]=_[_0xdbac('0x37')](_0x40dccc['model'],_0x40dccc['query']);_0x267d70[_0xdbac('0x38')]=_[_0xdbac('0x37')](_0x40dccc[_0xdbac('0x39')],qs[_0xdbac('0x3a')](_0x505321['query']['fields']));_0x267d70[_0xdbac('0x38')]=_0x267d70[_0xdbac('0x38')][_0xdbac('0x3b')]?_0x267d70[_0xdbac('0x38')]:_0x40dccc[_0xdbac('0x39')];if(_0x505321[_0xdbac('0x35')][_0xdbac('0x3c')]){_0x267d70[_0xdbac('0x3d')]=[{'all':!![]}];}_0x267d70=_[_0xdbac('0x3e')]({},_0x267d70,_0x505321[_0xdbac('0x3f')]);return db[_0xdbac('0x33')][_0xdbac('0x40')](_0x267d70)[_0xdbac('0x2b')](handleEntityNotFound(_0x10c3c8,null))['then'](respondWithResult(_0x10c3c8,null))[_0xdbac('0x41')](handleError(_0x10c3c8,null));};exports['destroy']=function(_0x2d8c71,_0x11d697){return db[_0xdbac('0x33')][_0xdbac('0x40')]({'where':{'id':_0x2d8c71['params']['id']}})[_0xdbac('0x2b')](handleEntityNotFound(_0x11d697,null))[_0xdbac('0x2b')](removeEntity(_0x11d697,null))['catch'](handleError(_0x11d697,null));};function widgetAttributes(_0x5bb1bc){try{switch(_0x5bb1bc[_0xdbac('0x42')]){case'iframe':return[{'name':'attrUrl','value':_0x5bb1bc[_0xdbac('0x43')]||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc[_0xdbac('0x44')][0x0]?_0x5bb1bc['attrs'][0x0][_0xdbac('0x45')]:undefined)||_0xdbac('0x46')}];case _0xdbac('0x47'):return[{'name':_0xdbac('0x48'),'value':_0x5bb1bc['attrPath']||(_0x5bb1bc['attrs']&&_0x5bb1bc[_0xdbac('0x44')][0x0]?_0x5bb1bc[_0xdbac('0x44')][0x0][_0xdbac('0x45')]:undefined)||''}];case _0xdbac('0x49'):return[{'name':_0xdbac('0x4a'),'value':_0x5bb1bc['attrHourFormat']||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc[_0xdbac('0x44')][0x0]?_0x5bb1bc['attrs'][0x0][_0xdbac('0x45')]:undefined)||_0xdbac('0x4b')},{'name':_0xdbac('0x4c'),'value':_0x5bb1bc[_0xdbac('0x4c')]||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc['attrs'][0x1]?_0x5bb1bc[_0xdbac('0x44')][0x1][_0xdbac('0x45')]:undefined)||_0xdbac('0x4d')},{'name':_0xdbac('0x4e'),'value':_0x5bb1bc[_0xdbac('0x4e')]||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc[_0xdbac('0x44')][0x2]?_0x5bb1bc[_0xdbac('0x44')][0x2][_0xdbac('0x45')]:undefined)||0xc}];case _0xdbac('0x4f'):return[{'name':_0xdbac('0x50'),'value':_0x5bb1bc[_0xdbac('0x50')]||(_0x5bb1bc['attrs']&&_0x5bb1bc['attrs'][0x0]?_0x5bb1bc['attrs'][0x0]['value']:undefined)||_0xdbac('0x51')},{'name':_0xdbac('0x52'),'value':_0x5bb1bc[_0xdbac('0x52')]||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc[_0xdbac('0x44')][0x1]?_0x5bb1bc[_0xdbac('0x44')][0x1][_0xdbac('0x45')]:undefined)||[]},{'name':_0xdbac('0x4e'),'value':_0x5bb1bc[_0xdbac('0x4e')]||(_0x5bb1bc['attrs']&&_0x5bb1bc['attrs'][0x2]?_0x5bb1bc['attrs'][0x2][_0xdbac('0x45')]:undefined)||0x14},{'name':_0xdbac('0x53'),'value':_0x5bb1bc['attrChannel']||(_0x5bb1bc['attrs']&&_0x5bb1bc['attrs'][0x3]?_0x5bb1bc[_0xdbac('0x44')][0x3][_0xdbac('0x45')]:undefined)||_0xdbac('0x54')},{'name':'attrEmailAccounts','value':_0x5bb1bc[_0xdbac('0x55')]||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc[_0xdbac('0x44')][0x4]?_0x5bb1bc[_0xdbac('0x44')][0x4][_0xdbac('0x45')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x5bb1bc[_0xdbac('0x56')]||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc[_0xdbac('0x44')][0x5]?_0x5bb1bc[_0xdbac('0x44')][0x5]['value']:undefined)||''},{'name':_0xdbac('0x57'),'value':_0x5bb1bc[_0xdbac('0x57')]||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc['attrs'][0x6]?_0x5bb1bc[_0xdbac('0x44')][0x6][_0xdbac('0x45')]:undefined)||''},{'name':_0xdbac('0x58'),'value':_0x5bb1bc[_0xdbac('0x58')]||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc[_0xdbac('0x44')][0x7]?_0x5bb1bc['attrs'][0x7][_0xdbac('0x45')]:undefined)||''},{'name':_0xdbac('0x59'),'value':_0x5bb1bc['attrWhatsappAccounts']||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc[_0xdbac('0x44')][0x8]?_0x5bb1bc[_0xdbac('0x44')][0x8][_0xdbac('0x45')]:undefined)||''},{'name':'attrChatWebsites','value':_0x5bb1bc['attrChatWebsites']||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc[_0xdbac('0x44')][0x9]?_0x5bb1bc['attrs'][0x9]['value']:undefined)||''}];case _0xdbac('0x5a'):case'pie-chart':return[{'name':_0xdbac('0x5b'),'value':_0x5bb1bc[_0xdbac('0x5b')]||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc['attrs'][0x0]?_0x5bb1bc['attrs'][0x0][_0xdbac('0x45')]:undefined)||_0xdbac('0x51')},{'name':_0xdbac('0x5c'),'value':_0x5bb1bc[_0xdbac('0x5c')]||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc[_0xdbac('0x44')][0x1]?_0x5bb1bc[_0xdbac('0x44')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x5bb1bc[_0xdbac('0x5d')]||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc[_0xdbac('0x44')][0x2]?_0x5bb1bc[_0xdbac('0x44')][0x2][_0xdbac('0x45')]:undefined)||null},{'name':_0xdbac('0x52'),'value':_0x5bb1bc['attrVoiceQueues']||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc[_0xdbac('0x44')][0x3]?_0x5bb1bc[_0xdbac('0x44')][0x3][_0xdbac('0x45')]:undefined)||[]},{'name':_0xdbac('0x53'),'value':_0x5bb1bc['attrChannel']||(_0x5bb1bc['attrs']&&_0x5bb1bc[_0xdbac('0x44')][0x4]?_0x5bb1bc['attrs'][0x4][_0xdbac('0x45')]:undefined)||_0xdbac('0x54')},{'name':'attrEmailAccounts','value':_0x5bb1bc[_0xdbac('0x55')]||(_0x5bb1bc['attrs']&&_0x5bb1bc['attrs'][0x5]?_0x5bb1bc[_0xdbac('0x44')][0x5][_0xdbac('0x45')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x5bb1bc['attrFaxAccounts']||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc['attrs'][0x6]?_0x5bb1bc[_0xdbac('0x44')][0x6][_0xdbac('0x45')]:undefined)||''},{'name':_0xdbac('0x57'),'value':_0x5bb1bc['attrSmsAccounts']||(_0x5bb1bc['attrs']&&_0x5bb1bc[_0xdbac('0x44')][0x7]?_0x5bb1bc[_0xdbac('0x44')][0x7][_0xdbac('0x45')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x5bb1bc[_0xdbac('0x58')]||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc['attrs'][0x8]?_0x5bb1bc[_0xdbac('0x44')][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x5bb1bc[_0xdbac('0x59')]||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc[_0xdbac('0x44')][0x9]?_0x5bb1bc[_0xdbac('0x44')][0x9][_0xdbac('0x45')]:undefined)||''},{'name':_0xdbac('0x5e'),'value':_0x5bb1bc[_0xdbac('0x5e')]||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc[_0xdbac('0x44')][0xa]?_0x5bb1bc['attrs'][0xa][_0xdbac('0x45')]:undefined)||''}];case _0xdbac('0x5f'):return[{'name':_0xdbac('0x60'),'type':_0x5bb1bc[_0xdbac('0x61')]||(_0x5bb1bc['attrs']&&_0x5bb1bc['attrs'][0x0]?_0x5bb1bc['attrs'][0x0]['type']:undefined)||null,'value':_0x5bb1bc[_0xdbac('0x60')]||(_0x5bb1bc['attrs']&&_0x5bb1bc[_0xdbac('0x44')][0x0]?_0x5bb1bc[_0xdbac('0x44')][0x0][_0xdbac('0x45')]:undefined)||null},{'name':_0xdbac('0x62'),'value':_0x5bb1bc[_0xdbac('0x62')]||(_0x5bb1bc[_0xdbac('0x44')]&&_0x5bb1bc[_0xdbac('0x44')][0x1]?_0x5bb1bc[_0xdbac('0x44')][0x1][_0xdbac('0x45')]:undefined)||0x0}];default:return[];}}catch(_0x53202a){logger[_0xdbac('0x2e')](_0xdbac('0x63'),JSON[_0xdbac('0x64')](_0x53202a));return[];}}exports[_0xdbac('0x65')]=function(_0x10d292,_0x5981d7){if(_0x10d292[_0xdbac('0x66')]){_0x10d292[_0xdbac('0x66')][_0xdbac('0x44')]=widgetAttributes(_0x10d292[_0xdbac('0x66')]);}return db[_0xdbac('0x33')][_0xdbac('0x65')](_0x10d292[_0xdbac('0x66')],{})[_0xdbac('0x2b')](respondWithResult(_0x5981d7,0xc9))[_0xdbac('0x41')](handleError(_0x5981d7,null));};exports['update']=function(_0x105825,_0x5a0fc5){if(_0x105825['body']['id']){delete _0x105825['body']['id'];}_0x105825['body'][_0xdbac('0x44')]=widgetAttributes(_0x105825[_0xdbac('0x66')]);return db[_0xdbac('0x33')][_0xdbac('0x40')]({'where':{'id':_0x105825[_0xdbac('0x31')]['id']}})[_0xdbac('0x2b')](handleEntityNotFound(_0x5a0fc5,null))[_0xdbac('0x2b')](saveUpdates(_0x105825[_0xdbac('0x66')],null))[_0xdbac('0x2b')](respondWithResult(_0x5a0fc5,null))[_0xdbac('0x41')](handleError(_0x5a0fc5,null));}; \ No newline at end of file +var _0x0755=['attrUrl','attrs','custom','attrPath','value','clock','attrHourFormat','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrChatWebsites','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','name','send','show','params','model','DashboardItem','rawAttributes','query','keys','filters','intersection','attributes','fields','include','merge','options','find','catch','type','iframe'];(function(_0x28d8da,_0x10e299){var _0x321e8b=function(_0x2a7b8b){while(--_0x2a7b8b){_0x28d8da['push'](_0x28d8da['shift']());}};_0x321e8b(++_0x10e299);}(_0x0755,0x7c));var _0x5075=function(_0x4572ec,_0x4942f0){_0x4572ec=_0x4572ec-0x0;var _0x24eea2=_0x0755[_0x4572ec];return _0x24eea2;};'use strict';var emlformat=require(_0x5075('0x0'));var rimraf=require(_0x5075('0x1'));var zipdir=require(_0x5075('0x2'));var jsonpatch=require(_0x5075('0x3'));var rp=require(_0x5075('0x4'));var moment=require(_0x5075('0x5'));var BPromise=require(_0x5075('0x6'));var Mustache=require(_0x5075('0x7'));var util=require(_0x5075('0x8'));var path=require(_0x5075('0x9'));var sox=require('sox');var csv=require(_0x5075('0xa'));var ejs=require(_0x5075('0xb'));var fs=require('fs');var fs_extra=require(_0x5075('0xc'));var _=require(_0x5075('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5075('0xe'));var toCsv=require(_0x5075('0xa'));var querystring=require('querystring');var Papa=require(_0x5075('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5075('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5075('0x11'))(_0x5075('0x12'));var utils=require(_0x5075('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5075('0x14'));var db=require('../../mysqldb')['db'];config[_0x5075('0x15')]=_[_0x5075('0x16')](config[_0x5075('0x15')],{'host':_0x5075('0x17'),'port':0x18eb});var socket=require(_0x5075('0x18'))(new Redis(config[_0x5075('0x15')]));require(_0x5075('0x19'))[_0x5075('0x1a')](socket);function respondWithStatusCode(_0x339420,_0x5ac5cc){_0x5ac5cc=_0x5ac5cc||0xcc;return function(_0x2354c8){if(_0x2354c8){return _0x339420[_0x5075('0x1b')](_0x5ac5cc);}return _0x339420[_0x5075('0x1c')](_0x5ac5cc)['end']();};}function respondWithResult(_0x128a1b,_0x36c0d7){_0x36c0d7=_0x36c0d7||0xc8;return function(_0xc0c5ab){if(_0xc0c5ab){return _0x128a1b[_0x5075('0x1c')](_0x36c0d7)[_0x5075('0x1d')](_0xc0c5ab);}};}function respondWithFilteredResult(_0x57fedb,_0x2ca054){return function(_0xc8b69a){if(_0xc8b69a){var _0x4dbe45=typeof _0x2ca054[_0x5075('0x1e')]===_0x5075('0x1f')&&typeof _0x2ca054[_0x5075('0x20')]===_0x5075('0x1f');var _0x53232c=_0xc8b69a[_0x5075('0x21')];var _0x5e4f40=_0x4dbe45?0x0:_0x2ca054[_0x5075('0x1e')];var _0x55f829=_0x4dbe45?_0xc8b69a[_0x5075('0x21')]:_0x2ca054['offset']+_0x2ca054[_0x5075('0x20')];var _0x4c65c7;if(_0x55f829>=_0x53232c){_0x55f829=_0x53232c;_0x4c65c7=0xc8;}else{_0x4c65c7=0xce;}_0x57fedb[_0x5075('0x1c')](_0x4c65c7);return _0x57fedb[_0x5075('0x22')]('Content-Range',_0x5e4f40+'-'+_0x55f829+'/'+_0x53232c)['json'](_0xc8b69a);}return null;};}function patchUpdates(_0x510d4e){return function(_0x28678b){try{jsonpatch[_0x5075('0x23')](_0x28678b,_0x510d4e,!![]);}catch(_0xd48fad){return BPromise[_0x5075('0x24')](_0xd48fad);}return _0x28678b[_0x5075('0x25')]();};}function saveUpdates(_0x4e2c16,_0x27df0b){return function(_0x1a962b){if(_0x1a962b){return _0x1a962b[_0x5075('0x26')](_0x4e2c16)['then'](function(_0x1f16cc){return _0x1f16cc;});}return null;};}function removeEntity(_0x212438,_0x57fcb5){return function(_0xab5afe){if(_0xab5afe){return _0xab5afe[_0x5075('0x27')]()[_0x5075('0x28')](function(){_0x212438[_0x5075('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5efc7c,_0x58063c){return function(_0x3b3d0b){if(!_0x3b3d0b){_0x5efc7c[_0x5075('0x1b')](0x194);}return _0x3b3d0b;};}function handleError(_0x5652db,_0x1ddccd){_0x1ddccd=_0x1ddccd||0x1f4;return function(_0x36dbf7){logger[_0x5075('0x29')](_0x36dbf7['stack']);if(_0x36dbf7[_0x5075('0x2a')]){delete _0x36dbf7['name'];}_0x5652db['status'](_0x1ddccd)[_0x5075('0x2b')](_0x36dbf7);};}exports[_0x5075('0x2c')]=function(_0x2249d4,_0x1102cc){var _0x5e87b0={'raw':![],'where':{'id':_0x2249d4[_0x5075('0x2d')]['id']}},_0x362711={};_0x362711[_0x5075('0x2e')]=_['keys'](db[_0x5075('0x2f')][_0x5075('0x30')]);_0x362711[_0x5075('0x31')]=_[_0x5075('0x32')](_0x2249d4['query']);_0x362711[_0x5075('0x33')]=_[_0x5075('0x34')](_0x362711[_0x5075('0x2e')],_0x362711['query']);_0x5e87b0[_0x5075('0x35')]=_[_0x5075('0x34')](_0x362711[_0x5075('0x2e')],qs[_0x5075('0x36')](_0x2249d4[_0x5075('0x31')]['fields']));_0x5e87b0[_0x5075('0x35')]=_0x5e87b0[_0x5075('0x35')]['length']?_0x5e87b0[_0x5075('0x35')]:_0x362711['model'];if(_0x2249d4['query']['includeAll']){_0x5e87b0[_0x5075('0x37')]=[{'all':!![]}];}_0x5e87b0=_[_0x5075('0x38')]({},_0x5e87b0,_0x2249d4[_0x5075('0x39')]);return db['DashboardItem'][_0x5075('0x3a')](_0x5e87b0)['then'](handleEntityNotFound(_0x1102cc,null))['then'](respondWithResult(_0x1102cc,null))[_0x5075('0x3b')](handleError(_0x1102cc,null));};exports['destroy']=function(_0xa99b46,_0x1e0435){return db['DashboardItem'][_0x5075('0x3a')]({'where':{'id':_0xa99b46[_0x5075('0x2d')]['id']}})[_0x5075('0x28')](handleEntityNotFound(_0x1e0435,null))['then'](removeEntity(_0x1e0435,null))[_0x5075('0x3b')](handleError(_0x1e0435,null));};function widgetAttributes(_0x32af7f){try{switch(_0x32af7f[_0x5075('0x3c')]){case _0x5075('0x3d'):return[{'name':_0x5075('0x3e'),'value':_0x32af7f[_0x5075('0x3e')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x0]?_0x32af7f[_0x5075('0x3f')][0x0]['value']:undefined)||'https://'}];case _0x5075('0x40'):return[{'name':_0x5075('0x41'),'value':_0x32af7f[_0x5075('0x41')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f['attrs'][0x0]?_0x32af7f[_0x5075('0x3f')][0x0][_0x5075('0x42')]:undefined)||''}];case _0x5075('0x43'):return[{'name':_0x5075('0x44'),'value':_0x32af7f[_0x5075('0x44')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x0]?_0x32af7f['attrs'][0x0]['value']:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x32af7f[_0x5075('0x45')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x1]?_0x32af7f['attrs'][0x1][_0x5075('0x42')]:undefined)||'0.00'},{'name':_0x5075('0x46'),'value':_0x32af7f[_0x5075('0x46')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x2]?_0x32af7f[_0x5075('0x3f')][0x2][_0x5075('0x42')]:undefined)||0xc}];case'counter':return[{'name':_0x5075('0x47'),'value':_0x32af7f[_0x5075('0x47')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x0]?_0x32af7f[_0x5075('0x3f')][0x0]['value']:undefined)||_0x5075('0x48')},{'name':_0x5075('0x49'),'value':_0x32af7f[_0x5075('0x49')]||(_0x32af7f['attrs']&&_0x32af7f[_0x5075('0x3f')][0x1]?_0x32af7f[_0x5075('0x3f')][0x1][_0x5075('0x42')]:undefined)||[]},{'name':_0x5075('0x46'),'value':_0x32af7f[_0x5075('0x46')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x2]?_0x32af7f[_0x5075('0x3f')][0x2][_0x5075('0x42')]:undefined)||0x14},{'name':_0x5075('0x4a'),'value':_0x32af7f[_0x5075('0x4a')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x3]?_0x32af7f['attrs'][0x3]['value']:undefined)||_0x5075('0x4b')},{'name':'attrEmailAccounts','value':_0x32af7f['attrEmailAccounts']||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x4]?_0x32af7f[_0x5075('0x3f')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x32af7f[_0x5075('0x4c')]||(_0x32af7f['attrs']&&_0x32af7f[_0x5075('0x3f')][0x5]?_0x32af7f['attrs'][0x5]['value']:undefined)||''},{'name':_0x5075('0x4d'),'value':_0x32af7f[_0x5075('0x4d')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x6]?_0x32af7f['attrs'][0x6][_0x5075('0x42')]:undefined)||''},{'name':_0x5075('0x4e'),'value':_0x32af7f[_0x5075('0x4e')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x7]?_0x32af7f[_0x5075('0x3f')][0x7][_0x5075('0x42')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x32af7f[_0x5075('0x4f')]||(_0x32af7f['attrs']&&_0x32af7f[_0x5075('0x3f')][0x8]?_0x32af7f[_0x5075('0x3f')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x32af7f['attrChatWebsites']||(_0x32af7f['attrs']&&_0x32af7f[_0x5075('0x3f')][0x9]?_0x32af7f[_0x5075('0x3f')][0x9][_0x5075('0x42')]:undefined)||''}];case _0x5075('0x50'):case _0x5075('0x51'):return[{'name':_0x5075('0x52'),'value':_0x32af7f['attrSerie1']||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x0]?_0x32af7f[_0x5075('0x3f')][0x0][_0x5075('0x42')]:undefined)||'total'},{'name':_0x5075('0x53'),'value':_0x32af7f[_0x5075('0x53')]||(_0x32af7f['attrs']&&_0x32af7f[_0x5075('0x3f')][0x1]?_0x32af7f[_0x5075('0x3f')][0x1][_0x5075('0x42')]:undefined)||null},{'name':'attrSerie3','value':_0x32af7f[_0x5075('0x54')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x2]?_0x32af7f[_0x5075('0x3f')][0x2][_0x5075('0x42')]:undefined)||null},{'name':_0x5075('0x49'),'value':_0x32af7f[_0x5075('0x49')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x3]?_0x32af7f[_0x5075('0x3f')][0x3]['value']:undefined)||[]},{'name':_0x5075('0x4a'),'value':_0x32af7f[_0x5075('0x4a')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x4]?_0x32af7f[_0x5075('0x3f')][0x4]['value']:undefined)||_0x5075('0x4b')},{'name':'attrEmailAccounts','value':_0x32af7f['attrEmailAccounts']||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x5]?_0x32af7f['attrs'][0x5][_0x5075('0x42')]:undefined)||''},{'name':_0x5075('0x4c'),'value':_0x32af7f[_0x5075('0x4c')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x6]?_0x32af7f['attrs'][0x6][_0x5075('0x42')]:undefined)||''},{'name':_0x5075('0x4d'),'value':_0x32af7f[_0x5075('0x4d')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x7]?_0x32af7f[_0x5075('0x3f')][0x7][_0x5075('0x42')]:undefined)||''},{'name':_0x5075('0x4e'),'value':_0x32af7f[_0x5075('0x4e')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x8]?_0x32af7f[_0x5075('0x3f')][0x8][_0x5075('0x42')]:undefined)||''},{'name':_0x5075('0x4f'),'value':_0x32af7f[_0x5075('0x4f')]||(_0x32af7f['attrs']&&_0x32af7f[_0x5075('0x3f')][0x9]?_0x32af7f[_0x5075('0x3f')][0x9][_0x5075('0x42')]:undefined)||''},{'name':_0x5075('0x55'),'value':_0x32af7f[_0x5075('0x55')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f['attrs'][0xa]?_0x32af7f[_0x5075('0x3f')][0xa][_0x5075('0x42')]:undefined)||''}];case _0x5075('0x56'):return[{'name':_0x5075('0x57'),'type':_0x32af7f['reportType']||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x0]?_0x32af7f['attrs'][0x0]['type']:undefined)||null,'value':_0x32af7f['attrReport']||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x0]?_0x32af7f['attrs'][0x0][_0x5075('0x42')]:undefined)||null},{'name':_0x5075('0x58'),'value':_0x32af7f[_0x5075('0x58')]||(_0x32af7f[_0x5075('0x3f')]&&_0x32af7f[_0x5075('0x3f')][0x1]?_0x32af7f[_0x5075('0x3f')][0x1][_0x5075('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x1d50b5){logger[_0x5075('0x29')](_0x5075('0x59'),JSON[_0x5075('0x5a')](_0x1d50b5));return[];}}exports[_0x5075('0x5b')]=function(_0x5dcbbf,_0x48dc83){if(_0x5dcbbf[_0x5075('0x5c')]){_0x5dcbbf[_0x5075('0x5c')]['attrs']=widgetAttributes(_0x5dcbbf[_0x5075('0x5c')]);}return db[_0x5075('0x2f')][_0x5075('0x5b')](_0x5dcbbf[_0x5075('0x5c')],{})[_0x5075('0x28')](respondWithResult(_0x48dc83,0xc9))[_0x5075('0x3b')](handleError(_0x48dc83,null));};exports['update']=function(_0x4d2c49,_0x43be4d){if(_0x4d2c49[_0x5075('0x5c')]['id']){delete _0x4d2c49['body']['id'];}_0x4d2c49[_0x5075('0x5c')][_0x5075('0x3f')]=widgetAttributes(_0x4d2c49[_0x5075('0x5c')]);return db['DashboardItem'][_0x5075('0x3a')]({'where':{'id':_0x4d2c49[_0x5075('0x2d')]['id']}})['then'](handleEntityNotFound(_0x43be4d,null))[_0x5075('0x28')](saveUpdates(_0x4d2c49['body'],null))[_0x5075('0x28')](respondWithResult(_0x43be4d,null))[_0x5075('0x3b')](handleError(_0x43be4d,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 41ced41..5096a27 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 _0x37d9=['DashboardItem','setMaxListeners','update','remove','hasOwnProperty','exports','../../mysqldb'];(function(_0x110a09,_0x54c822){var _0x1d3993=function(_0x7df808){while(--_0x7df808){_0x110a09['push'](_0x110a09['shift']());}};_0x1d3993(++_0x54c822);}(_0x37d9,0xdf));var _0x937d=function(_0x9401b1,_0xce9bc3){_0x9401b1=_0x9401b1-0x0;var _0x38ce1e=_0x37d9[_0x9401b1];return _0x38ce1e;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x937d('0x0'))['db'][_0x937d('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x937d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x937d('0x3'),'afterDestroy':_0x937d('0x4')};function emitEvent(_0x2a3b9){return function(_0x6a5cb3,_0x241a9a,_0x39be89){DashboardItemEvents['emit'](_0x2a3b9+':'+_0x6a5cb3['id'],_0x6a5cb3);DashboardItemEvents['emit'](_0x2a3b9,_0x6a5cb3);_0x39be89(null);};}for(var e in events){if(events[_0x937d('0x5')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x937d('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0x4012=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem'];(function(_0x47b0d9,_0x41b561){var _0x599df3=function(_0x4c0c30){while(--_0x4c0c30){_0x47b0d9['push'](_0x47b0d9['shift']());}};_0x599df3(++_0x41b561);}(_0x4012,0x1bf));var _0x2401=function(_0x1a2624,_0x5cf832){_0x1a2624=_0x1a2624-0x0;var _0x449318=_0x4012[_0x1a2624];return _0x449318;};'use strict';var EventEmitter=require(_0x2401('0x0'));var DashboardItem=require(_0x2401('0x1'))['db'][_0x2401('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x2401('0x3')](0x0);var events={'afterCreate':_0x2401('0x4'),'afterUpdate':'update','afterDestroy':_0x2401('0x5')};function emitEvent(_0x3ca8b9){return function(_0x2b1a4d,_0xbc66e8,_0x2913d4){DashboardItemEvents[_0x2401('0x6')](_0x3ca8b9+':'+_0x2b1a4d['id'],_0x2b1a4d);DashboardItemEvents[_0x2401('0x6')](_0x3ca8b9,_0x2b1a4d);_0x2913d4(null);};}for(var e in events){if(events[_0x2401('0x7')](e)){var event=events[e];DashboardItem[_0x2401('0x8')](e,emitEvent(event));}}module[_0x2401('0x9')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index b839493..c4edf17 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 _0xb555=['./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0xb555,0xe5));var _0x5b55=function(_0x1ec8c6,_0x241f21){_0x1ec8c6=_0x1ec8c6-0x0;var _0x2b98b5=_0xb555[_0x1ec8c6];return _0x2b98b5;};'use strict';var _=require(_0x5b55('0x0'));var util=require(_0x5b55('0x1'));var logger=require(_0x5b55('0x2'))(_0x5b55('0x3'));var moment=require('moment');var BPromise=require(_0x5b55('0x4'));var rp=require(_0x5b55('0x5'));var fs=require('fs');var path=require(_0x5b55('0x6'));var rimraf=require(_0x5b55('0x7'));var config=require(_0x5b55('0x8'));var attributes=require(_0x5b55('0x9'));module[_0x5b55('0xa')]=function(_0x4f5e7e,_0xd91c38){return _0x4f5e7e[_0x5b55('0xb')](_0x5b55('0xc'),attributes,{'tableName':_0x5b55('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fd1=['DashboardItem','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define'];(function(_0x3f3519,_0xd53cae){var _0x23b6bf=function(_0x3b3e52){while(--_0x3b3e52){_0x3f3519['push'](_0x3f3519['shift']());}};_0x23b6bf(++_0xd53cae);}(_0x5fd1,0x155));var _0x15fd=function(_0x5bfb00,_0x52ffc4){_0x5bfb00=_0x5bfb00-0x0;var _0x24885f=_0x5fd1[_0x5bfb00];return _0x24885f;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var logger=require(_0x15fd('0x1'))(_0x15fd('0x2'));var moment=require(_0x15fd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x15fd('0x4'));var rimraf=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var attributes=require('./dashboardItem.attributes');module[_0x15fd('0x7')]=function(_0x386441,_0x18450c){return _0x386441[_0x15fd('0x8')](_0x15fd('0x9'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 3626d52..112736a 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 _0xeeab=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x33e550,_0x1700a0){var _0x33cd37=function(_0x5d8a3d){while(--_0x5d8a3d){_0x33e550['push'](_0x33e550['shift']());}};_0x33cd37(++_0x1700a0);}(_0xeeab,0x113));var _0xbeea=function(_0x5b22ab,_0x10c218){_0x5b22ab=_0x5b22ab-0x0;var _0x52d6cd=_0xeeab[_0x5b22ab];return _0x52d6cd;};'use strict';var _=require(_0xbeea('0x0'));var util=require('util');var moment=require(_0xbeea('0x1'));var BPromise=require(_0xbeea('0x2'));var rs=require(_0xbeea('0x3'));var fs=require('fs');var Redis=require(_0xbeea('0x4'));var db=require(_0xbeea('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbeea('0x6'));var config=require(_0xbeea('0x7'));var jayson=require(_0xbeea('0x8'));var client=jayson[_0xbeea('0x9')]['http']({'port':0x232a});config[_0xbeea('0xa')]=_[_0xbeea('0xb')](config[_0xbeea('0xa')],{'host':_0xbeea('0xc'),'port':0x18eb});var socket=require(_0xbeea('0xd'))(new Redis(config[_0xbeea('0xa')]));require('./dashboardItem.socket')[_0xbeea('0xe')](socket);function respondWithRpcPromise(_0x538205,_0x523e79,_0x11f73b){return new BPromise(function(_0x586c70,_0x2eacfe){return client[_0xbeea('0xf')](_0x538205,_0x11f73b)[_0xbeea('0x10')](function(_0x57ce94){logger[_0xbeea('0x11')](_0xbeea('0x12'),_0x523e79,_0xbeea('0x13'));logger['debug'](_0xbeea('0x14'),_0x523e79,_0xbeea('0x13'),JSON['stringify'](_0x57ce94));if(_0x57ce94[_0xbeea('0x15')]){if(_0x57ce94[_0xbeea('0x15')]['code']===0x1f4){logger[_0xbeea('0x15')](_0xbeea('0x12'),_0x523e79,_0x57ce94[_0xbeea('0x15')]['message']);return _0x2eacfe(_0x57ce94['error']['message']);}logger['error'](_0xbeea('0x12'),_0x523e79,_0x57ce94['error'][_0xbeea('0x16')]);return _0x586c70(_0x57ce94[_0xbeea('0x15')]['message']);}else{logger[_0xbeea('0x11')](_0xbeea('0x12'),_0x523e79,_0xbeea('0x13'));_0x586c70(_0x57ce94[_0xbeea('0x17')][_0xbeea('0x16')]);}})[_0xbeea('0x18')](function(_0x3541f1){logger[_0xbeea('0x15')](_0xbeea('0x12'),_0x523e79,_0x3541f1);_0x2eacfe(_0x3541f1);});});} \ No newline at end of file +var _0x5297=['register','request','then','info','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket'];(function(_0x315aaa,_0xefe5d6){var _0x5257b4=function(_0x14a3d3){while(--_0x14a3d3){_0x315aaa['push'](_0x315aaa['shift']());}};_0x5257b4(++_0xefe5d6);}(_0x5297,0x16c));var _0x7529=function(_0x12e6f9,_0x5c4f03){_0x12e6f9=_0x12e6f9-0x0;var _0x1afd27=_0x5297[_0x12e6f9];return _0x1afd27;};'use strict';var _=require('lodash');var util=require(_0x7529('0x0'));var moment=require(_0x7529('0x1'));var BPromise=require(_0x7529('0x2'));var rs=require(_0x7529('0x3'));var fs=require('fs');var Redis=require(_0x7529('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7529('0x5'));var logger=require(_0x7529('0x6'))('rpc');var config=require(_0x7529('0x7'));var jayson=require(_0x7529('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x7529('0x9')]=_[_0x7529('0xa')](config[_0x7529('0x9')],{'host':_0x7529('0xb'),'port':0x18eb});var socket=require(_0x7529('0xc'))(new Redis(config[_0x7529('0x9')]));require(_0x7529('0xd'))[_0x7529('0xe')](socket);function respondWithRpcPromise(_0x1e3425,_0x3be215,_0x111438){return new BPromise(function(_0x521041,_0x5a8a88){return client[_0x7529('0xf')](_0x1e3425,_0x111438)[_0x7529('0x10')](function(_0x518faf){logger[_0x7529('0x11')]('DashboardItem,\x20%s,\x20%s',_0x3be215,'request\x20sent');logger['debug'](_0x7529('0x12'),_0x3be215,'request\x20sent',JSON[_0x7529('0x13')](_0x518faf));if(_0x518faf[_0x7529('0x14')]){if(_0x518faf[_0x7529('0x14')][_0x7529('0x15')]===0x1f4){logger['error'](_0x7529('0x16'),_0x3be215,_0x518faf[_0x7529('0x14')][_0x7529('0x17')]);return _0x5a8a88(_0x518faf[_0x7529('0x14')][_0x7529('0x17')]);}logger[_0x7529('0x14')](_0x7529('0x16'),_0x3be215,_0x518faf[_0x7529('0x14')]['message']);return _0x521041(_0x518faf['error'][_0x7529('0x17')]);}else{logger['info'](_0x7529('0x16'),_0x3be215,_0x7529('0x18'));_0x521041(_0x518faf[_0x7529('0x19')][_0x7529('0x17')]);}})[_0x7529('0x1a')](function(_0x258d79){logger[_0x7529('0x14')](_0x7529('0x16'),_0x3be215,_0x258d79);_0x5a8a88(_0x258d79);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 4b29ff3..d0feaf5 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 _0x5623=['register','length','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x5f3775,_0x6f9ce){var _0x5a81df=function(_0x4b7943){while(--_0x4b7943){_0x5f3775['push'](_0x5f3775['shift']());}};_0x5a81df(++_0x6f9ce);}(_0x5623,0x19a));var _0x3562=function(_0x359a54,_0x1efcd2){_0x359a54=_0x359a54-0x0;var _0x521bd2=_0x5623[_0x359a54];return _0x521bd2;};'use strict';var DashboardItemEvents=require(_0x3562('0x0'));var events=[_0x3562('0x1'),_0x3562('0x2'),_0x3562('0x3')];function createListener(_0x4e7d34,_0x1ebc83){return function(_0x5cf880){_0x1ebc83[_0x3562('0x4')](_0x4e7d34,_0x5cf880);};}function removeListener(_0x1651d7,_0x25936b){return function(){DashboardItemEvents[_0x3562('0x5')](_0x1651d7,_0x25936b);};}exports[_0x3562('0x6')]=function(_0x1e7a80){for(var _0x58fff2=0x0,_0x3b3dcd=events[_0x3562('0x7')];_0x58fff2<_0x3b3dcd;_0x58fff2++){var _0x4b7fc3=events[_0x58fff2];var _0x163e53=createListener('dashboardItem:'+_0x4b7fc3,_0x1e7a80);DashboardItemEvents['on'](_0x4b7fc3,_0x163e53);}}; \ No newline at end of file +var _0x2a41=['./dashboardItem.events','remove','update','emit','removeListener','length','dashboardItem:'];(function(_0x340dc0,_0x2a3031){var _0x48fd67=function(_0x1a4280){while(--_0x1a4280){_0x340dc0['push'](_0x340dc0['shift']());}};_0x48fd67(++_0x2a3031);}(_0x2a41,0x19d));var _0x12a4=function(_0x32ad52,_0x3867b7){_0x32ad52=_0x32ad52-0x0;var _0xd4d3d3=_0x2a41[_0x32ad52];return _0xd4d3d3;};'use strict';var DashboardItemEvents=require(_0x12a4('0x0'));var events=['save',_0x12a4('0x1'),_0x12a4('0x2')];function createListener(_0x38a7ae,_0x53b2a6){return function(_0xd45e66){_0x53b2a6[_0x12a4('0x3')](_0x38a7ae,_0xd45e66);};}function removeListener(_0xec95a6,_0xdd59e0){return function(){DashboardItemEvents[_0x12a4('0x4')](_0xec95a6,_0xdd59e0);};}exports['register']=function(_0x25b463){for(var _0x58903c=0x0,_0x4633d1=events[_0x12a4('0x5')];_0x58903c<_0x4633d1;_0x58903c++){var _0x142c69=events[_0x58903c];var _0x5bc475=createListener(_0x12a4('0x6')+_0x142c69,_0x25b463);DashboardItemEvents['on'](_0x142c69,_0x5bc475);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index aec886a..4515039 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 _0xfcef=['put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','post','create'];(function(_0x18dfea,_0x43d571){var _0x5222e3=function(_0x3484ae){while(--_0x3484ae){_0x18dfea['push'](_0x18dfea['shift']());}};_0x5222e3(++_0x43d571);}(_0xfcef,0x104));var _0xffce=function(_0x556625,_0x353dd6){_0x556625=_0x556625-0x0;var _0x543927=_0xfcef[_0x556625];return _0x543927;};'use strict';var multer=require(_0xffce('0x0'));var util=require(_0xffce('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xffce('0x2'));var router=express[_0xffce('0x3')]();var fs_extra=require(_0xffce('0x4'));var auth=require(_0xffce('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xffce('0x6'));var controller=require(_0xffce('0x7'));router[_0xffce('0x8')]('/:id',auth[_0xffce('0x9')](),controller['show']);router[_0xffce('0xa')]('/',auth[_0xffce('0x9')](),controller[_0xffce('0xb')]);router[_0xffce('0xc')]('/:id',auth[_0xffce('0x9')](),controller[_0xffce('0xd')]);router[_0xffce('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xffce('0xf')]);module[_0xffce('0x10')]=router; \ No newline at end of file +var _0xd348=['put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create'];(function(_0x2f1caf,_0x3bbb1e){var _0x271062=function(_0x370c09){while(--_0x370c09){_0x2f1caf['push'](_0x2f1caf['shift']());}};_0x271062(++_0x3bbb1e);}(_0xd348,0x180));var _0x8d34=function(_0x10616f,_0x5e1d7a){_0x10616f=_0x10616f-0x0;var _0xac627a=_0xd348[_0x10616f];return _0xac627a;};'use strict';var multer=require(_0x8d34('0x0'));var util=require(_0x8d34('0x1'));var path=require(_0x8d34('0x2'));var timeout=require('connect-timeout');var express=require(_0x8d34('0x3'));var router=express[_0x8d34('0x4')]();var fs_extra=require(_0x8d34('0x5'));var auth=require(_0x8d34('0x6'));var interaction=require(_0x8d34('0x7'));var config=require(_0x8d34('0x8'));var controller=require('./dashboardItem.controller');router[_0x8d34('0x9')](_0x8d34('0xa'),auth[_0x8d34('0xb')](),controller[_0x8d34('0xc')]);router[_0x8d34('0xd')]('/',auth[_0x8d34('0xb')](),controller[_0x8d34('0xe')]);router[_0x8d34('0xf')](_0x8d34('0xa'),auth['isAuthenticated'](),controller[_0x8d34('0x10')]);router['delete'](_0x8d34('0xa'),auth[_0x8d34('0xb')](),controller[_0x8d34('0x11')]);module[_0x8d34('0x12')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 2143d68..608a148 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 _0x1f91=['STRING','ENUM','first','second','third'];(function(_0x5529c2,_0x4f6029){var _0x26c6b3=function(_0x35f7b9){while(--_0x35f7b9){_0x5529c2['push'](_0x5529c2['shift']());}};_0x26c6b3(++_0x4f6029);}(_0x1f91,0xcd));var _0x11f9=function(_0x11e94e,_0x21a483){_0x11e94e=_0x11e94e-0x0;var _0x1e781a=_0x1f91[_0x11e94e];return _0x1e781a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x11f9('0x0')],'allowNull':![]},'level':{'type':Sequelize[_0x11f9('0x1')](_0x11f9('0x2'),_0x11f9('0x3'),_0x11f9('0x4')),'allowNull':![],'defaultValue':_0x11f9('0x2')},'description':{'type':Sequelize[_0x11f9('0x0')]}}; \ No newline at end of file +var _0xa27b=['first','third','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa27b,0x1b5));var _0xba27=function(_0x11e29c,_0x1e14a0){_0x11e29c=_0x11e29c-0x0;var _0x496195=_0xa27b[_0x11e29c];return _0x496195;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xba27('0x0')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xba27('0x1'),'second',_0xba27('0x2')),'allowNull':![],'defaultValue':_0xba27('0x1')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index d6ae0a4..8cbce52 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 _0x7604=['offset','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','map','Disposition','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count'];(function(_0x2113d2,_0x833103){var _0x520eb4=function(_0x3cdbab){while(--_0x3cdbab){_0x2113d2['push'](_0x2113d2['shift']());}};_0x520eb4(++_0x833103);}(_0x7604,0xd2));var _0x4760=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7604[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x4760('0x0'));var rimraf=require(_0x4760('0x1'));var zipdir=require(_0x4760('0x2'));var jsonpatch=require(_0x4760('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4760('0x4'));var Mustache=require(_0x4760('0x5'));var util=require(_0x4760('0x6'));var path=require('path');var sox=require(_0x4760('0x7'));var csv=require(_0x4760('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4760('0x9'));var _=require(_0x4760('0xa'));var squel=require('squel');var crypto=require(_0x4760('0xb'));var jsforce=require(_0x4760('0xc'));var deskjs=require(_0x4760('0xd'));var toCsv=require(_0x4760('0x8'));var querystring=require(_0x4760('0xe'));var Papa=require(_0x4760('0xf'));var Redis=require('ioredis');var authService=require(_0x4760('0x10'));var qs=require(_0x4760('0x11'));var as=require(_0x4760('0x12'));var hardwareService=require(_0x4760('0x13'));var logger=require(_0x4760('0x14'))(_0x4760('0x15'));var utils=require(_0x4760('0x16'));var config=require(_0x4760('0x17'));var licenseUtil=require(_0x4760('0x18'));var db=require(_0x4760('0x19'))['db'];function respondWithStatusCode(_0x2dacc1,_0x3b36a3){_0x3b36a3=_0x3b36a3||0xcc;return function(_0x5b3871){if(_0x5b3871){return _0x2dacc1[_0x4760('0x1a')](_0x3b36a3);}return _0x2dacc1[_0x4760('0x1b')](_0x3b36a3)[_0x4760('0x1c')]();};}function respondWithResult(_0x3073a7,_0xd1b06a){_0xd1b06a=_0xd1b06a||0xc8;return function(_0x22eb9a){if(_0x22eb9a){return _0x3073a7[_0x4760('0x1b')](_0xd1b06a)[_0x4760('0x1d')](_0x22eb9a);}};}function respondWithFilteredResult(_0x33b509,_0x507cfa){return function(_0x2f2c63){if(_0x2f2c63){var _0x5a0b08=typeof _0x507cfa['offset']===_0x4760('0x1e')&&typeof _0x507cfa[_0x4760('0x1f')]===_0x4760('0x1e');var _0x28235e=_0x2f2c63[_0x4760('0x20')];var _0x4907fa=_0x5a0b08?0x0:_0x507cfa['offset'];var _0x4e0f5d=_0x5a0b08?_0x2f2c63[_0x4760('0x20')]:_0x507cfa[_0x4760('0x21')]+_0x507cfa[_0x4760('0x1f')];var _0x36b257;if(_0x4e0f5d>=_0x28235e){_0x4e0f5d=_0x28235e;_0x36b257=0xc8;}else{_0x36b257=0xce;}_0x33b509['status'](_0x36b257);return _0x33b509[_0x4760('0x22')](_0x4760('0x23'),_0x4907fa+'-'+_0x4e0f5d+'/'+_0x28235e)[_0x4760('0x1d')](_0x2f2c63);}return null;};}function patchUpdates(_0x3f5739){return function(_0x454ee0){try{jsonpatch[_0x4760('0x24')](_0x454ee0,_0x3f5739,!![]);}catch(_0x2f0a14){return BPromise[_0x4760('0x25')](_0x2f0a14);}return _0x454ee0[_0x4760('0x26')]();};}function saveUpdates(_0x348c6d,_0x274c2d){return function(_0x4d0ea3){if(_0x4d0ea3){return _0x4d0ea3[_0x4760('0x27')](_0x348c6d)['then'](function(_0x3b9821){return _0x3b9821;});}return null;};}function removeEntity(_0x2f08c5,_0x55fc50){return function(_0x1dfe77){if(_0x1dfe77){return _0x1dfe77['destroy']()[_0x4760('0x28')](function(){var _0x2d221c=_0x1dfe77[_0x4760('0x29')]({'plain':!![]});var _0xface4f='Dispositions';return db[_0x4760('0x2a')][_0x4760('0x2b')]({'where':{'type':_0xface4f,'resourceId':_0x2d221c['id']}})[_0x4760('0x28')](function(){return _0x1dfe77;});})[_0x4760('0x28')](function(){_0x2f08c5[_0x4760('0x1b')](0xcc)[_0x4760('0x1c')]();});}};}function handleEntityNotFound(_0x44f5de,_0x3dae62){return function(_0x5caae7){if(!_0x5caae7){_0x44f5de['sendStatus'](0x194);}return _0x5caae7;};}function handleError(_0x1f6942,_0x25dd1a){_0x25dd1a=_0x25dd1a||0x1f4;return function(_0x120bfe){logger[_0x4760('0x2c')](_0x120bfe[_0x4760('0x2d')]);if(_0x120bfe[_0x4760('0x2e')]){delete _0x120bfe['name'];}_0x1f6942['status'](_0x25dd1a)[_0x4760('0x2f')](_0x120bfe);};}exports['index']=function(_0xd70d45,_0x35b132){var _0x3cc198={},_0x40f2f8={},_0x55c1a6={'count':0x0,'rows':[]};var _0x42df78=_[_0x4760('0x30')](db[_0x4760('0x31')][_0x4760('0x32')],function(_0x5710d9){return{'name':_0x5710d9[_0x4760('0x33')],'type':_0x5710d9['type']['key']};});_0x40f2f8[_0x4760('0x34')]=_[_0x4760('0x30')](_0x42df78,'name');_0x40f2f8[_0x4760('0x35')]=_[_0x4760('0x36')](_0xd70d45[_0x4760('0x35')]);_0x40f2f8[_0x4760('0x37')]=_[_0x4760('0x38')](_0x40f2f8[_0x4760('0x34')],_0x40f2f8[_0x4760('0x35')]);_0x3cc198[_0x4760('0x39')]=_[_0x4760('0x38')](_0x40f2f8[_0x4760('0x34')],qs[_0x4760('0x3a')](_0xd70d45[_0x4760('0x35')]['fields']));_0x3cc198[_0x4760('0x39')]=_0x3cc198[_0x4760('0x39')][_0x4760('0x3b')]?_0x3cc198[_0x4760('0x39')]:_0x40f2f8[_0x4760('0x34')];if(!_0xd70d45[_0x4760('0x35')][_0x4760('0x3c')](_0x4760('0x3d'))){_0x3cc198[_0x4760('0x1f')]=qs[_0x4760('0x1f')](_0xd70d45['query'][_0x4760('0x1f')]);_0x3cc198[_0x4760('0x21')]=qs[_0x4760('0x21')](_0xd70d45[_0x4760('0x35')][_0x4760('0x21')]);}_0x3cc198['order']=qs[_0x4760('0x3e')](_0xd70d45[_0x4760('0x35')][_0x4760('0x3e')]);_0x3cc198[_0x4760('0x3f')]=qs[_0x4760('0x37')](_[_0x4760('0x40')](_0xd70d45[_0x4760('0x35')],_0x40f2f8[_0x4760('0x37')]),_0x42df78);if(_0xd70d45[_0x4760('0x35')][_0x4760('0x41')]){_0x3cc198[_0x4760('0x3f')]=_['merge'](_0x3cc198[_0x4760('0x3f')],{'$or':_['map'](_0x42df78,function(_0x1ddbd5){if(_0x1ddbd5['type']!==_0x4760('0x42')){var _0x1a3e0f={};_0x1a3e0f[_0x1ddbd5[_0x4760('0x2e')]]={'$like':'%'+_0xd70d45[_0x4760('0x35')][_0x4760('0x41')]+'%'};return _0x1a3e0f;}})});}_0x3cc198=_[_0x4760('0x43')]({},_0x3cc198,_0xd70d45[_0x4760('0x44')]);var _0x58616c={'where':_0x3cc198[_0x4760('0x3f')]};return db[_0x4760('0x31')][_0x4760('0x20')](_0x58616c)[_0x4760('0x28')](function(_0x336ac1){_0x55c1a6[_0x4760('0x20')]=_0x336ac1;if(_0xd70d45[_0x4760('0x35')]['includeAll']){_0x3cc198[_0x4760('0x45')]=[{'all':!![]}];}return db[_0x4760('0x31')][_0x4760('0x46')](_0x3cc198);})[_0x4760('0x28')](function(_0xd8e960){_0x55c1a6['rows']=_0xd8e960;return _0x55c1a6;})[_0x4760('0x28')](respondWithFilteredResult(_0x35b132,_0x3cc198))[_0x4760('0x47')](handleError(_0x35b132,null));};exports['show']=function(_0x391024,_0x5bb78c){var _0x357fb8={'raw':!![],'where':{'id':_0x391024[_0x4760('0x48')]['id']}},_0x1914cc={};_0x1914cc[_0x4760('0x34')]=_[_0x4760('0x36')](db[_0x4760('0x31')]['rawAttributes']);_0x1914cc[_0x4760('0x35')]=_[_0x4760('0x36')](_0x391024[_0x4760('0x35')]);_0x1914cc[_0x4760('0x37')]=_[_0x4760('0x38')](_0x1914cc['model'],_0x1914cc[_0x4760('0x35')]);_0x357fb8[_0x4760('0x39')]=_[_0x4760('0x38')](_0x1914cc[_0x4760('0x34')],qs[_0x4760('0x3a')](_0x391024['query'][_0x4760('0x3a')]));_0x357fb8['attributes']=_0x357fb8[_0x4760('0x39')][_0x4760('0x3b')]?_0x357fb8[_0x4760('0x39')]:_0x1914cc[_0x4760('0x34')];if(_0x391024[_0x4760('0x35')][_0x4760('0x49')]){_0x357fb8[_0x4760('0x45')]=[{'all':!![]}];}_0x357fb8=_['merge']({},_0x357fb8,_0x391024[_0x4760('0x44')]);return db['Disposition'][_0x4760('0x4a')](_0x357fb8)[_0x4760('0x28')](handleEntityNotFound(_0x5bb78c,null))[_0x4760('0x28')](respondWithResult(_0x5bb78c,null))[_0x4760('0x47')](handleError(_0x5bb78c,null));};exports[_0x4760('0x4b')]=function(_0x52c2e9,_0x320a16){return db[_0x4760('0x31')][_0x4760('0x4b')](_0x52c2e9[_0x4760('0x4c')],{})[_0x4760('0x28')](function(_0x28572c){var _0x4356f2=_0x52c2e9[_0x4760('0x4d')][_0x4760('0x29')]({'plain':!![]});if(!_0x4356f2)throw new Error(_0x4760('0x4e'));if(_0x4356f2[_0x4760('0x4f')]===_0x4760('0x4d')){var _0x4ce106=_0x28572c[_0x4760('0x29')]({'plain':!![]});var _0x326cdf='Dispositions';return db['UserProfileSection'][_0x4760('0x4a')]({'where':{'name':_0x326cdf,'userProfileId':_0x4356f2['userProfileId']},'raw':!![]})['then'](function(_0x4cb379){if(_0x4cb379&&_0x4cb379['autoAssociation']===0x0){return db[_0x4760('0x2a')][_0x4760('0x4b')]({'name':_0x4ce106[_0x4760('0x2e')],'resourceId':_0x4ce106['id'],'type':_0x4cb379[_0x4760('0x2e')],'sectionId':_0x4cb379['id']},{})[_0x4760('0x28')](function(){return _0x28572c;});}else{return _0x28572c;}})[_0x4760('0x47')](function(_0x13a25c){logger[_0x4760('0x2c')](_0x4760('0x50'),_0x13a25c);throw _0x13a25c;});}return _0x28572c;})['then'](respondWithResult(_0x320a16,0xc9))[_0x4760('0x47')](handleError(_0x320a16,null));};exports['update']=function(_0x2f03f0,_0x50a421){if(_0x2f03f0[_0x4760('0x4c')]['id']){delete _0x2f03f0[_0x4760('0x4c')]['id'];}return db['Disposition'][_0x4760('0x4a')]({'where':{'id':_0x2f03f0[_0x4760('0x48')]['id']}})[_0x4760('0x28')](handleEntityNotFound(_0x50a421,null))[_0x4760('0x28')](saveUpdates(_0x2f03f0[_0x4760('0x4c')],null))[_0x4760('0x28')](respondWithResult(_0x50a421,null))[_0x4760('0x47')](handleError(_0x50a421,null));};exports['destroy']=function(_0x38a6d2,_0x3edeff){return db[_0x4760('0x31')][_0x4760('0x4a')]({'where':{'id':_0x38a6d2[_0x4760('0x48')]['id']}})[_0x4760('0x28')](handleEntityNotFound(_0x3edeff,null))['then'](removeEntity(_0x3edeff,null))['catch'](handleError(_0x3edeff,null));}; \ No newline at end of file +var _0x9802=['UserProfileResource','update','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','Dispositions','error','stack','name','send','index','map','Disposition','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation'];(function(_0xe74d4e,_0x4e3300){var _0x2f77dd=function(_0x5adf64){while(--_0x5adf64){_0xe74d4e['push'](_0xe74d4e['shift']());}};_0x2f77dd(++_0x4e3300);}(_0x9802,0xf6));var _0x2980=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9802[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x2980('0x0'));var rimraf=require(_0x2980('0x1'));var zipdir=require(_0x2980('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2980('0x3'));var moment=require(_0x2980('0x4'));var BPromise=require(_0x2980('0x5'));var Mustache=require(_0x2980('0x6'));var util=require(_0x2980('0x7'));var path=require('path');var sox=require(_0x2980('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2980('0x9'));var squel=require(_0x2980('0xa'));var crypto=require(_0x2980('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2980('0xc'));var toCsv=require(_0x2980('0xd'));var querystring=require(_0x2980('0xe'));var Papa=require(_0x2980('0xf'));var Redis=require(_0x2980('0x10'));var authService=require(_0x2980('0x11'));var qs=require(_0x2980('0x12'));var as=require(_0x2980('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2980('0x14'));var config=require(_0x2980('0x15'));var licenseUtil=require(_0x2980('0x16'));var db=require(_0x2980('0x17'))['db'];function respondWithStatusCode(_0x34a13c,_0xa259f9){_0xa259f9=_0xa259f9||0xcc;return function(_0x4f5f2d){if(_0x4f5f2d){return _0x34a13c[_0x2980('0x18')](_0xa259f9);}return _0x34a13c['status'](_0xa259f9)[_0x2980('0x19')]();};}function respondWithResult(_0x3da46c,_0x22323e){_0x22323e=_0x22323e||0xc8;return function(_0xe9a2f3){if(_0xe9a2f3){return _0x3da46c[_0x2980('0x1a')](_0x22323e)[_0x2980('0x1b')](_0xe9a2f3);}};}function respondWithFilteredResult(_0x4a9709,_0x3266e8){return function(_0x1e9a57){if(_0x1e9a57){var _0x422b99=typeof _0x3266e8['offset']===_0x2980('0x1c')&&typeof _0x3266e8['limit']===_0x2980('0x1c');var _0x15a58a=_0x1e9a57[_0x2980('0x1d')];var _0x1ec2e9=_0x422b99?0x0:_0x3266e8[_0x2980('0x1e')];var _0x177408=_0x422b99?_0x1e9a57[_0x2980('0x1d')]:_0x3266e8['offset']+_0x3266e8['limit'];var _0x46c09c;if(_0x177408>=_0x15a58a){_0x177408=_0x15a58a;_0x46c09c=0xc8;}else{_0x46c09c=0xce;}_0x4a9709[_0x2980('0x1a')](_0x46c09c);return _0x4a9709[_0x2980('0x1f')](_0x2980('0x20'),_0x1ec2e9+'-'+_0x177408+'/'+_0x15a58a)[_0x2980('0x1b')](_0x1e9a57);}return null;};}function patchUpdates(_0x7f719f){return function(_0x2444ef){try{jsonpatch[_0x2980('0x21')](_0x2444ef,_0x7f719f,!![]);}catch(_0x183e66){return BPromise[_0x2980('0x22')](_0x183e66);}return _0x2444ef[_0x2980('0x23')]();};}function saveUpdates(_0x1a37eb,_0x479ad4){return function(_0x4213cf){if(_0x4213cf){return _0x4213cf['update'](_0x1a37eb)[_0x2980('0x24')](function(_0x5e6610){return _0x5e6610;});}return null;};}function removeEntity(_0x2242e1,_0x483bd8){return function(_0x4e6f87){if(_0x4e6f87){return _0x4e6f87[_0x2980('0x25')]()[_0x2980('0x24')](function(){var _0x1bc4a2=_0x4e6f87['get']({'plain':!![]});var _0x17ce7b=_0x2980('0x26');return db['UserProfileResource'][_0x2980('0x25')]({'where':{'type':_0x17ce7b,'resourceId':_0x1bc4a2['id']}})[_0x2980('0x24')](function(){return _0x4e6f87;});})[_0x2980('0x24')](function(){_0x2242e1[_0x2980('0x1a')](0xcc)[_0x2980('0x19')]();});}};}function handleEntityNotFound(_0x1e785e,_0x27cb68){return function(_0x33409e){if(!_0x33409e){_0x1e785e[_0x2980('0x18')](0x194);}return _0x33409e;};}function handleError(_0x51de87,_0x43e092){_0x43e092=_0x43e092||0x1f4;return function(_0x2e0f4d){logger[_0x2980('0x27')](_0x2e0f4d[_0x2980('0x28')]);if(_0x2e0f4d[_0x2980('0x29')]){delete _0x2e0f4d[_0x2980('0x29')];}_0x51de87[_0x2980('0x1a')](_0x43e092)[_0x2980('0x2a')](_0x2e0f4d);};}exports[_0x2980('0x2b')]=function(_0x12806d,_0x67f072){var _0x164eea={},_0x17abe6={},_0x4a3eee={'count':0x0,'rows':[]};var _0x39f8d5=_[_0x2980('0x2c')](db[_0x2980('0x2d')]['rawAttributes'],function(_0x5a346b){return{'name':_0x5a346b['fieldName'],'type':_0x5a346b[_0x2980('0x2e')][_0x2980('0x2f')]};});_0x17abe6[_0x2980('0x30')]=_[_0x2980('0x2c')](_0x39f8d5,'name');_0x17abe6[_0x2980('0x31')]=_[_0x2980('0x32')](_0x12806d[_0x2980('0x31')]);_0x17abe6['filters']=_[_0x2980('0x33')](_0x17abe6[_0x2980('0x30')],_0x17abe6[_0x2980('0x31')]);_0x164eea['attributes']=_['intersection'](_0x17abe6[_0x2980('0x30')],qs['fields'](_0x12806d[_0x2980('0x31')][_0x2980('0x34')]));_0x164eea[_0x2980('0x35')]=_0x164eea[_0x2980('0x35')][_0x2980('0x36')]?_0x164eea[_0x2980('0x35')]:_0x17abe6[_0x2980('0x30')];if(!_0x12806d[_0x2980('0x31')][_0x2980('0x37')]('nolimit')){_0x164eea['limit']=qs[_0x2980('0x38')](_0x12806d[_0x2980('0x31')]['limit']);_0x164eea['offset']=qs[_0x2980('0x1e')](_0x12806d[_0x2980('0x31')][_0x2980('0x1e')]);}_0x164eea['order']=qs[_0x2980('0x39')](_0x12806d[_0x2980('0x31')][_0x2980('0x39')]);_0x164eea[_0x2980('0x3a')]=qs['filters'](_['pick'](_0x12806d['query'],_0x17abe6[_0x2980('0x3b')]),_0x39f8d5);if(_0x12806d['query'][_0x2980('0x3c')]){_0x164eea[_0x2980('0x3a')]=_[_0x2980('0x3d')](_0x164eea[_0x2980('0x3a')],{'$or':_['map'](_0x39f8d5,function(_0xf2d857){if(_0xf2d857[_0x2980('0x2e')]!==_0x2980('0x3e')){var _0xacd8f1={};_0xacd8f1[_0xf2d857['name']]={'$like':'%'+_0x12806d[_0x2980('0x31')][_0x2980('0x3c')]+'%'};return _0xacd8f1;}})});}_0x164eea=_[_0x2980('0x3d')]({},_0x164eea,_0x12806d[_0x2980('0x3f')]);var _0x1e24c8={'where':_0x164eea[_0x2980('0x3a')]};return db[_0x2980('0x2d')][_0x2980('0x1d')](_0x1e24c8)[_0x2980('0x24')](function(_0x244d4b){_0x4a3eee['count']=_0x244d4b;if(_0x12806d[_0x2980('0x31')][_0x2980('0x40')]){_0x164eea[_0x2980('0x41')]=[{'all':!![]}];}return db[_0x2980('0x2d')][_0x2980('0x42')](_0x164eea);})[_0x2980('0x24')](function(_0x1ee059){_0x4a3eee[_0x2980('0x43')]=_0x1ee059;return _0x4a3eee;})['then'](respondWithFilteredResult(_0x67f072,_0x164eea))[_0x2980('0x44')](handleError(_0x67f072,null));};exports[_0x2980('0x45')]=function(_0x55337d,_0x1d766f){var _0x907823={'raw':!![],'where':{'id':_0x55337d['params']['id']}},_0x55ba0f={};_0x55ba0f['model']=_[_0x2980('0x32')](db['Disposition']['rawAttributes']);_0x55ba0f['query']=_['keys'](_0x55337d[_0x2980('0x31')]);_0x55ba0f[_0x2980('0x3b')]=_['intersection'](_0x55ba0f[_0x2980('0x30')],_0x55ba0f[_0x2980('0x31')]);_0x907823[_0x2980('0x35')]=_[_0x2980('0x33')](_0x55ba0f['model'],qs[_0x2980('0x34')](_0x55337d[_0x2980('0x31')]['fields']));_0x907823[_0x2980('0x35')]=_0x907823[_0x2980('0x35')][_0x2980('0x36')]?_0x907823[_0x2980('0x35')]:_0x55ba0f[_0x2980('0x30')];if(_0x55337d['query'][_0x2980('0x40')]){_0x907823[_0x2980('0x41')]=[{'all':!![]}];}_0x907823=_['merge']({},_0x907823,_0x55337d[_0x2980('0x3f')]);return db[_0x2980('0x2d')][_0x2980('0x46')](_0x907823)[_0x2980('0x24')](handleEntityNotFound(_0x1d766f,null))['then'](respondWithResult(_0x1d766f,null))[_0x2980('0x44')](handleError(_0x1d766f,null));};exports[_0x2980('0x47')]=function(_0x7ef9aa,_0x1db1dd){return db['Disposition']['create'](_0x7ef9aa[_0x2980('0x48')],{})[_0x2980('0x24')](function(_0x261ef5){var _0x47052d=_0x7ef9aa['user'][_0x2980('0x49')]({'plain':!![]});if(!_0x47052d)throw new Error(_0x2980('0x4a'));if(_0x47052d['role']==='user'){var _0x587904=_0x261ef5['get']({'plain':!![]});var _0x3f5918=_0x2980('0x26');return db[_0x2980('0x4b')]['find']({'where':{'name':_0x3f5918,'userProfileId':_0x47052d[_0x2980('0x4c')]},'raw':!![]})['then'](function(_0x43ccec){if(_0x43ccec&&_0x43ccec[_0x2980('0x4d')]===0x0){return db[_0x2980('0x4e')]['create']({'name':_0x587904['name'],'resourceId':_0x587904['id'],'type':_0x43ccec[_0x2980('0x29')],'sectionId':_0x43ccec['id']},{})[_0x2980('0x24')](function(){return _0x261ef5;});}else{return _0x261ef5;}})[_0x2980('0x44')](function(_0xe98271){logger[_0x2980('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe98271);throw _0xe98271;});}return _0x261ef5;})[_0x2980('0x24')](respondWithResult(_0x1db1dd,0xc9))[_0x2980('0x44')](handleError(_0x1db1dd,null));};exports[_0x2980('0x4f')]=function(_0x5e9c08,_0x22e76c){if(_0x5e9c08['body']['id']){delete _0x5e9c08[_0x2980('0x48')]['id'];}return db[_0x2980('0x2d')]['find']({'where':{'id':_0x5e9c08['params']['id']}})['then'](handleEntityNotFound(_0x22e76c,null))[_0x2980('0x24')](saveUpdates(_0x5e9c08[_0x2980('0x48')],null))[_0x2980('0x24')](respondWithResult(_0x22e76c,null))[_0x2980('0x44')](handleError(_0x22e76c,null));};exports['destroy']=function(_0x3bd696,_0x59fc82){return db[_0x2980('0x2d')]['find']({'where':{'id':_0x3bd696[_0x2980('0x50')]['id']}})[_0x2980('0x24')](handleEntityNotFound(_0x59fc82,null))[_0x2980('0x24')](removeEntity(_0x59fc82,null))['catch'](handleError(_0x59fc82,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 269db5b..0a109ae 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 _0xddc5=['SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','api','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail'];(function(_0x523316,_0x18caa3){var _0x5621e9=function(_0x425db2){while(--_0x425db2){_0x523316['push'](_0x523316['shift']());}};_0x5621e9(++_0x18caa3);}(_0xddc5,0x79));var _0x5ddc=function(_0x3dc492,_0x5c25b2){_0x3dc492=_0x3dc492-0x0;var _0x23f627=_0xddc5[_0x3dc492];return _0x23f627;};'use strict';var _=require('lodash');var util=require(_0x5ddc('0x0'));var logger=require('../../config/logger')(_0x5ddc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5ddc('0x2'));var fs=require('fs');var path=require(_0x5ddc('0x3'));var rimraf=require(_0x5ddc('0x4'));var config=require(_0x5ddc('0x5'));var attributes=require(_0x5ddc('0x6'));module[_0x5ddc('0x7')]=function(_0x52a46e,_0x58234b){return _0x52a46e[_0x5ddc('0x8')](_0x5ddc('0x9'),attributes,{'tableName':_0x5ddc('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x5ddc('0xb'),'fields':[_0x5ddc('0xc'),_0x5ddc('0xd')]},{'unique':!![],'name':_0x5ddc('0xe'),'fields':['name',_0x5ddc('0xf')]},{'unique':!![],'name':_0x5ddc('0x10'),'fields':[_0x5ddc('0xc'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0x5ddc('0xc'),_0x5ddc('0x11')]},{'unique':!![],'name':_0x5ddc('0x12'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0x5ddc('0x13'),'fields':['name',_0x5ddc('0x14')]},{'unique':!![],'name':_0x5ddc('0x15'),'fields':[_0x5ddc('0xc'),_0x5ddc('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0323=['rimraf','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','name','ListId','ChatWebsiteId','name_mail','name_sms','name_fax','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xa927ac,_0x1929fc){var _0x31781a=function(_0xb47fb2){while(--_0xb47fb2){_0xa927ac['push'](_0xa927ac['shift']());}};_0x31781a(++_0x1929fc);}(_0x0323,0x102));var _0x3032=function(_0x580607,_0x3d2c7d){_0x580607=_0x580607-0x0;var _0x3adb02=_0x0323[_0x580607];return _0x3adb02;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3032('0x0'))(_0x3032('0x1'));var moment=require(_0x3032('0x2'));var BPromise=require(_0x3032('0x3'));var rp=require(_0x3032('0x4'));var fs=require('fs');var path=require(_0x3032('0x5'));var rimraf=require(_0x3032('0x6'));var config=require('../../config/environment');var attributes=require(_0x3032('0x7'));module[_0x3032('0x8')]=function(_0x24f8d7,_0xa52641){return _0x24f8d7['define'](_0x3032('0x9'),attributes,{'tableName':_0x3032('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x3032('0xb'),'fields':[_0x3032('0xc'),_0x3032('0xd')]},{'unique':!![],'name':'name_chat','fields':['name',_0x3032('0xe')]},{'unique':!![],'name':_0x3032('0xf'),'fields':[_0x3032('0xc'),'MailAccountId']},{'unique':!![],'name':_0x3032('0x10'),'fields':[_0x3032('0xc'),'SmsAccountId']},{'unique':!![],'name':_0x3032('0x11'),'fields':[_0x3032('0xc'),_0x3032('0x12')]},{'unique':!![],'name':_0x3032('0x13'),'fields':[_0x3032('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':_0x3032('0x14'),'fields':[_0x3032('0xc'),_0x3032('0x15')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index d4e4cc2..4f68d0b 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(_0x18f662,_0x2c399b){var _0x255ff4=function(_0x22f37){while(--_0x22f37){_0x18f662['push'](_0x18f662['shift']());}};_0x255ff4(++_0x2c399b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var 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(_0x36310d,_0x513273){var _0x48ecb4=function(_0x439314){while(--_0x439314){_0x36310d['push'](_0x36310d['shift']());}};_0x48ecb4(++_0x513273);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 1fc6e58..a589d3c 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 _0x88f1=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./disposition.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x88f1,0x1a4));var _0x188f=function(_0x311918,_0x506230){_0x311918=_0x311918-0x0;var _0xf9013=_0x88f1[_0x311918];return _0xf9013;};'use strict';var multer=require(_0x188f('0x0'));var util=require(_0x188f('0x1'));var path=require(_0x188f('0x2'));var timeout=require(_0x188f('0x3'));var express=require(_0x188f('0x4'));var router=express[_0x188f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x188f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x188f('0x7'));var controller=require(_0x188f('0x8'));router[_0x188f('0x9')]('/',auth['isAuthenticated'](),controller[_0x188f('0xa')]);router[_0x188f('0x9')](_0x188f('0xb'),auth['isAuthenticated'](),controller[_0x188f('0xc')]);router[_0x188f('0xd')]('/',auth[_0x188f('0xe')](),controller[_0x188f('0xf')]);router[_0x188f('0x10')](_0x188f('0xb'),auth[_0x188f('0xe')](),controller[_0x188f('0x11')]);router[_0x188f('0x12')]('/:id',auth[_0x188f('0xe')](),controller[_0x188f('0x13')]);module[_0x188f('0x14')]=router; \ No newline at end of file +var _0xc556=['post','put','update','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','get','index','/:id','isAuthenticated','show'];(function(_0x5a74c0,_0x3177b4){var _0x5b35e3=function(_0x4ae3e2){while(--_0x4ae3e2){_0x5a74c0['push'](_0x5a74c0['shift']());}};_0x5b35e3(++_0x3177b4);}(_0xc556,0x1d4));var _0x6c55=function(_0x312f37,_0x2d11de){_0x312f37=_0x312f37-0x0;var _0x1d89d1=_0xc556[_0x312f37];return _0x1d89d1;};'use strict';var multer=require(_0x6c55('0x0'));var util=require(_0x6c55('0x1'));var path=require(_0x6c55('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c55('0x3'));var router=express[_0x6c55('0x4')]();var fs_extra=require(_0x6c55('0x5'));var auth=require(_0x6c55('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0x6c55('0x7')]('/',auth['isAuthenticated'](),controller[_0x6c55('0x8')]);router['get'](_0x6c55('0x9'),auth[_0x6c55('0xa')](),controller[_0x6c55('0xb')]);router[_0x6c55('0xc')]('/',auth[_0x6c55('0xa')](),controller['create']);router[_0x6c55('0xd')](_0x6c55('0x9'),auth['isAuthenticated'](),controller[_0x6c55('0xe')]);router[_0x6c55('0xf')]('/:id',auth[_0x6c55('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index db2bbdd..48829d8 100644 --- a/server/api/faxAccount/faxAccount.attributes.js +++ b/server/api/faxAccount/faxAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c60=['4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','yes','localstationid','ENUM','2400'];(function(_0x563eed,_0x34b19d){var _0x2a26b1=function(_0x3445c2){while(--_0x3445c2){_0x563eed['push'](_0x563eed['shift']());}};_0x2a26b1(++_0x34b19d);}(_0x4c60,0xc1));var _0x04c6=function(_0x3773fb,_0x24ddff){_0x3773fb=_0x3773fb-0x0;var _0x50b509=_0x4c60[_0x3773fb];return _0x50b509;};'use strict';var Sequelize=require(_0x04c6('0x0'));module[_0x04c6('0x1')]={'name':{'type':Sequelize[_0x04c6('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x04c6('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x04c6('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0x04c6('0x4')},'minrate':{'type':Sequelize[_0x04c6('0x5')](_0x04c6('0x6'),_0x04c6('0x7'),_0x04c6('0x8'),_0x04c6('0x9'),_0x04c6('0xa'),'14400'),'defaultValue':_0x04c6('0x7')},'maxrate':{'type':Sequelize[_0x04c6('0x5')](_0x04c6('0x6'),_0x04c6('0x7'),'7200','9600','12000',_0x04c6('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x04c6('0x2')],'defaultValue':_0x04c6('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x04c6('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x04c6('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x04c6('0x5')](_0x04c6('0xe'),'IAX',_0x04c6('0xf'),_0x04c6('0x10')),'defaultValue':_0x04c6('0xe')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x04c6('0x11')],'defaultValue':function(){return _0x04c6('0x12');}},'notificationSound':{'type':Sequelize[_0x04c6('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x04c6('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x04c6('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x04c6('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x04c6('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x04c6('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x04c6('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x04c6('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x04c6('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x04c6('0x13')],'defaultValue':![],'comment':_0x04c6('0x15'),'set':function(_0xfb4db5){if(!_0xfb4db5)this[_0x04c6('0x16')](_0x04c6('0x17'),null);this['setDataValue'](_0x04c6('0x18'),_0xfb4db5);}}}; \ No newline at end of file +var _0x4351=['ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','12000','9600','14400','INTEGER','SIP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4351,0x1b5));var _0x1435=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x4351[_0x50a0c2];return _0x5ebadd;};'use strict';var Sequelize=require(_0x1435('0x0'));module[_0x1435('0x1')]={'name':{'type':Sequelize[_0x1435('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1435('0x2')]},'ecm':{'type':Sequelize[_0x1435('0x3')](_0x1435('0x4'),'no'),'defaultValue':_0x1435('0x4')},'headerinfo':{'type':Sequelize[_0x1435('0x2')],'defaultValue':_0x1435('0x5')},'localstationid':{'type':Sequelize[_0x1435('0x2')],'unique':_0x1435('0x6')},'minrate':{'type':Sequelize[_0x1435('0x3')](_0x1435('0x7'),_0x1435('0x8'),_0x1435('0x9'),'9600',_0x1435('0xa'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x1435('0x3')](_0x1435('0x7'),_0x1435('0x8'),_0x1435('0x9'),_0x1435('0xb'),'12000',_0x1435('0xc')),'defaultValue':_0x1435('0xc')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x1435('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x1435('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x1435('0xe'),'IAX','DADHI','KHOMP'),'defaultValue':_0x1435('0xe')},'key':{'type':Sequelize[_0x1435('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1435('0xf')],'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[_0x1435('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x1435('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1435('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1435('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1435('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1435('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1435('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x1435('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x1435('0x10')],'defaultValue':![],'comment':_0x1435('0x12'),'set':function(_0x189f4a){if(!_0x189f4a)this[_0x1435('0x13')](_0x1435('0x14'),null);this[_0x1435('0x13')](_0x1435('0x15'),_0x189f4a);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 8d720eb..f1a4872 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 _0x0408=['filename','Contact\x20not\x20found','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','User','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','sendStatus','status','end','undefined','offset','json','apply','reject','save','update','destroy','get','FaxAccounts','stack','send','mandatoryDispositionPause','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','VIRTUAL','name','options','FaxAccount','count','includeAll','show','params','Pause','keys','merge','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','FaxAccountId','include','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','omit','CmContact','Contact','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','createdAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','updatedAt','DESC','attachments','join','root','CheckAfterSend','isNil','from','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out'];(function(_0x59ad89,_0x41cdbd){var _0x463e97=function(_0x4bc593){while(--_0x4bc593){_0x59ad89['push'](_0x59ad89['shift']());}};_0x463e97(++_0x41cdbd);}(_0x0408,0x19a));var _0x8040=function(_0x2fc9a4,_0x555ba7){_0x2fc9a4=_0x2fc9a4-0x0;var _0x352411=_0x0408[_0x2fc9a4];return _0x352411;};'use strict';var emlformat=require(_0x8040('0x0'));var rimraf=require(_0x8040('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8040('0x2'));var rp=require(_0x8040('0x3'));var moment=require('moment');var BPromise=require(_0x8040('0x4'));var Mustache=require(_0x8040('0x5'));var util=require(_0x8040('0x6'));var path=require(_0x8040('0x7'));var sox=require('sox');var csv=require(_0x8040('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8040('0x9'));var _=require(_0x8040('0xa'));var squel=require(_0x8040('0xb'));var crypto=require(_0x8040('0xc'));var jsforce=require(_0x8040('0xd'));var deskjs=require(_0x8040('0xe'));var toCsv=require(_0x8040('0x8'));var querystring=require('querystring');var Papa=require(_0x8040('0xf'));var Redis=require(_0x8040('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8040('0x11'));var logger=require('../../config/logger')(_0x8040('0x12'));var utils=require(_0x8040('0x13'));var config=require(_0x8040('0x14'));var licenseUtil=require(_0x8040('0x15'));var db=require(_0x8040('0x16'))['db'];config[_0x8040('0x17')]=_['defaults'](config[_0x8040('0x17')],{'host':_0x8040('0x18'),'port':0x18eb});var socket=require(_0x8040('0x19'))(new Redis(config[_0x8040('0x17')]));require(_0x8040('0x1a'))[_0x8040('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8040('0x1c')][_0x8040('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x8040('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3f3f6b,_0x19b0ad,_0x31d0b5,_0x158b9a){return new BPromise(function(_0x1fa5db,_0x2a3699){var _0x19db37=_0x158b9a||client;return _0x19db37[_0x8040('0x1e')](_0x3f3f6b,_0x31d0b5)[_0x8040('0x1f')](function(_0x2b06a4){logger[_0x8040('0x20')](_0x8040('0x21'),_0x19b0ad,'request\x20sent');logger[_0x8040('0x22')](_0x8040('0x23'),_0x19b0ad,'request\x20sent',JSON['stringify'](_0x2b06a4));if(_0x2b06a4[_0x8040('0x24')]){if(_0x2b06a4[_0x8040('0x24')]['code']===0x1f4){logger[_0x8040('0x24')]('FaxAccount,\x20%s,\x20%s',_0x19b0ad,_0x2b06a4['error']['message']);return _0x2a3699(_0x2b06a4[_0x8040('0x24')][_0x8040('0x25')]);}logger['error'](_0x8040('0x21'),_0x19b0ad,_0x2b06a4[_0x8040('0x24')]['message']);return _0x1fa5db(_0x2b06a4[_0x8040('0x24')][_0x8040('0x25')]);}else{logger[_0x8040('0x20')](_0x8040('0x21'),_0x19b0ad,_0x8040('0x26'));_0x1fa5db(_0x2b06a4[_0x8040('0x27')][_0x8040('0x25')]);}})[_0x8040('0x28')](function(_0x3409ed){logger[_0x8040('0x24')](_0x8040('0x21'),_0x19b0ad,_0x3409ed);_0x2a3699(_0x3409ed);});});}function respondWithStatusCode(_0x39adf2,_0x564a7e){_0x564a7e=_0x564a7e||0xcc;return function(_0x3fc79b){if(_0x3fc79b){return _0x39adf2[_0x8040('0x29')](_0x564a7e);}return _0x39adf2[_0x8040('0x2a')](_0x564a7e)[_0x8040('0x2b')]();};}function respondWithResult(_0x5b0a46,_0x4eb4c8){_0x4eb4c8=_0x4eb4c8||0xc8;return function(_0x2b4982){if(_0x2b4982){return _0x5b0a46[_0x8040('0x2a')](_0x4eb4c8)['json'](_0x2b4982);}};}function respondWithFilteredResult(_0x4be2ed,_0x3f833e){return function(_0x1d043f){if(_0x1d043f){var _0x2182e8=typeof _0x3f833e['offset']===_0x8040('0x2c')&&typeof _0x3f833e['limit']==='undefined';var _0x21eb2a=_0x1d043f['count'];var _0x1f8774=_0x2182e8?0x0:_0x3f833e[_0x8040('0x2d')];var _0xbb7480=_0x2182e8?_0x1d043f['count']:_0x3f833e['offset']+_0x3f833e['limit'];var _0x5a629c;if(_0xbb7480>=_0x21eb2a){_0xbb7480=_0x21eb2a;_0x5a629c=0xc8;}else{_0x5a629c=0xce;}_0x4be2ed[_0x8040('0x2a')](_0x5a629c);return _0x4be2ed['set']('Content-Range',_0x1f8774+'-'+_0xbb7480+'/'+_0x21eb2a)[_0x8040('0x2e')](_0x1d043f);}return null;};}function patchUpdates(_0x1c579c){return function(_0x6f168f){try{jsonpatch[_0x8040('0x2f')](_0x6f168f,_0x1c579c,!![]);}catch(_0x7f385a){return BPromise[_0x8040('0x30')](_0x7f385a);}return _0x6f168f[_0x8040('0x31')]();};}function saveUpdates(_0x47acc5,_0x5bae43){return function(_0x16cbbd){if(_0x16cbbd){return _0x16cbbd[_0x8040('0x32')](_0x47acc5)[_0x8040('0x1f')](function(_0x208c19){return _0x208c19;});}return null;};}function removeEntity(_0x32a16e,_0x23bf4a){return function(_0x3fe607){if(_0x3fe607){return _0x3fe607[_0x8040('0x33')]()['then'](function(){var _0x234b79=_0x3fe607[_0x8040('0x34')]({'plain':!![]});var _0xbbbc84=_0x8040('0x35');return db['UserProfileResource'][_0x8040('0x33')]({'where':{'type':_0xbbbc84,'resourceId':_0x234b79['id']}})[_0x8040('0x1f')](function(){return _0x3fe607;});})[_0x8040('0x1f')](function(){_0x32a16e[_0x8040('0x2a')](0xcc)[_0x8040('0x2b')]();});}};}function handleEntityNotFound(_0x34b3c9,_0x761251){return function(_0x308eca){if(!_0x308eca){_0x34b3c9[_0x8040('0x29')](0x194);}return _0x308eca;};}function handleError(_0x37c081,_0x19dd3f){_0x19dd3f=_0x19dd3f||0x1f4;return function(_0x306037){logger[_0x8040('0x24')](_0x306037[_0x8040('0x36')]);if(_0x306037['name']){delete _0x306037['name'];}_0x37c081[_0x8040('0x2a')](_0x19dd3f)[_0x8040('0x37')](_0x306037);};}exports['index']=function(_0x1dc419,_0x56dc52){var _0x335dc1={'include':[{'model':db['Pause'],'as':_0x8040('0x38')}]},_0x599833={},_0x425c76={'count':0x0,'rows':[]};var _0x354499=_[_0x8040('0x39')](db['FaxAccount'][_0x8040('0x3a')],function(_0xf86e1e){return{'name':_0xf86e1e['fieldName'],'type':_0xf86e1e[_0x8040('0x3b')][_0x8040('0x3c')]};});_0x599833[_0x8040('0x3d')]=_[_0x8040('0x39')](_0x354499,'name');_0x599833[_0x8040('0x3e')]=_['keys'](_0x1dc419['query']);_0x599833[_0x8040('0x3f')]=_[_0x8040('0x40')](_0x599833[_0x8040('0x3d')],_0x599833['query']);_0x335dc1[_0x8040('0x41')]=_[_0x8040('0x40')](_0x599833['model'],qs[_0x8040('0x42')](_0x1dc419['query'][_0x8040('0x42')]));_0x335dc1[_0x8040('0x41')]=_0x335dc1[_0x8040('0x41')][_0x8040('0x43')]?_0x335dc1[_0x8040('0x41')]:_0x599833[_0x8040('0x3d')];if(!_0x1dc419[_0x8040('0x3e')][_0x8040('0x44')]('nolimit')){_0x335dc1[_0x8040('0x45')]=qs[_0x8040('0x45')](_0x1dc419[_0x8040('0x3e')]['limit']);_0x335dc1[_0x8040('0x2d')]=qs[_0x8040('0x2d')](_0x1dc419[_0x8040('0x3e')][_0x8040('0x2d')]);}_0x335dc1[_0x8040('0x46')]=qs[_0x8040('0x47')](_0x1dc419[_0x8040('0x3e')][_0x8040('0x47')]);_0x335dc1['where']=qs['filters'](_[_0x8040('0x48')](_0x1dc419[_0x8040('0x3e')],_0x599833[_0x8040('0x3f')]),_0x354499);if(_0x1dc419['query'][_0x8040('0x49')]){_0x335dc1[_0x8040('0x4a')]=_['merge'](_0x335dc1[_0x8040('0x4a')],{'$or':_[_0x8040('0x39')](_0x354499,function(_0x3695c1){if(_0x3695c1[_0x8040('0x3b')]!==_0x8040('0x4b')){var _0x15ed19={};_0x15ed19[_0x3695c1[_0x8040('0x4c')]]={'$like':'%'+_0x1dc419[_0x8040('0x3e')][_0x8040('0x49')]+'%'};return _0x15ed19;}})});}_0x335dc1=_['merge']({},_0x335dc1,_0x1dc419[_0x8040('0x4d')]);var _0x39f791={'where':_0x335dc1[_0x8040('0x4a')]};return db[_0x8040('0x4e')]['count'](_0x39f791)[_0x8040('0x1f')](function(_0x4c05e7){_0x425c76[_0x8040('0x4f')]=_0x4c05e7;if(_0x1dc419['query'][_0x8040('0x50')]){_0x335dc1['include']=[{'all':!![]}];}return db[_0x8040('0x4e')]['findAll'](_0x335dc1);})['then'](function(_0x573666){_0x425c76['rows']=_0x573666;return _0x425c76;})[_0x8040('0x1f')](respondWithFilteredResult(_0x56dc52,_0x335dc1))[_0x8040('0x28')](handleError(_0x56dc52,null));};exports[_0x8040('0x51')]=function(_0x552675,_0x416a57){var _0x3aca07={'raw':![],'where':{'id':_0x552675[_0x8040('0x52')]['id']},'include':[{'model':db[_0x8040('0x53')],'as':_0x8040('0x38')}]},_0x5ef793={};_0x5ef793[_0x8040('0x3d')]=_['keys'](db[_0x8040('0x4e')][_0x8040('0x3a')]);_0x5ef793[_0x8040('0x3e')]=_[_0x8040('0x54')](_0x552675[_0x8040('0x3e')]);_0x5ef793[_0x8040('0x3f')]=_[_0x8040('0x40')](_0x5ef793[_0x8040('0x3d')],_0x5ef793[_0x8040('0x3e')]);_0x3aca07[_0x8040('0x41')]=_['intersection'](_0x5ef793[_0x8040('0x3d')],qs[_0x8040('0x42')](_0x552675[_0x8040('0x3e')][_0x8040('0x42')]));_0x3aca07[_0x8040('0x41')]=_0x3aca07[_0x8040('0x41')][_0x8040('0x43')]?_0x3aca07[_0x8040('0x41')]:_0x5ef793[_0x8040('0x3d')];if(_0x552675[_0x8040('0x3e')][_0x8040('0x50')]){_0x3aca07['include']=[{'all':!![]}];}_0x3aca07=_[_0x8040('0x55')]({},_0x3aca07,_0x552675['options']);return db[_0x8040('0x4e')][_0x8040('0x56')](_0x3aca07)['then'](handleEntityNotFound(_0x416a57,null))['then'](respondWithResult(_0x416a57,null))['catch'](handleError(_0x416a57,null));};exports[_0x8040('0x57')]=function(_0x51fadc,_0x28d6c4){return db['FaxAccount'][_0x8040('0x57')](_0x51fadc['body'],{})[_0x8040('0x1f')](function(_0x1d329e){var _0x245dcb=_0x51fadc[_0x8040('0x58')][_0x8040('0x34')]({'plain':!![]});if(!_0x245dcb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x245dcb[_0x8040('0x59')]===_0x8040('0x58')){var _0x1df2d8=_0x1d329e['get']({'plain':!![]});var _0x1a0adb=_0x8040('0x35');return db[_0x8040('0x5a')]['find']({'where':{'name':_0x1a0adb,'userProfileId':_0x245dcb[_0x8040('0x5b')]},'raw':!![]})[_0x8040('0x1f')](function(_0x2eb0bb){if(_0x2eb0bb&&_0x2eb0bb[_0x8040('0x5c')]===0x0){return db[_0x8040('0x5d')]['create']({'name':_0x1df2d8['name'],'resourceId':_0x1df2d8['id'],'type':_0x2eb0bb['name'],'sectionId':_0x2eb0bb['id']},{})[_0x8040('0x1f')](function(){return _0x1d329e;});}else{return _0x1d329e;}})[_0x8040('0x28')](function(_0xaa1b9e){logger['error'](_0x8040('0x5e'),_0xaa1b9e);throw _0xaa1b9e;});}return _0x1d329e;})['then'](respondWithResult(_0x28d6c4,0xc9))[_0x8040('0x28')](handleError(_0x28d6c4,null));};exports[_0x8040('0x32')]=function(_0x2bafc2,_0x3367ab){if(_0x2bafc2[_0x8040('0x5f')]['id']){delete _0x2bafc2[_0x8040('0x5f')]['id'];}return db[_0x8040('0x4e')]['find']({'where':{'id':_0x2bafc2[_0x8040('0x52')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x8040('0x1f')](handleEntityNotFound(_0x3367ab,null))[_0x8040('0x1f')](saveUpdates(_0x2bafc2[_0x8040('0x5f')],null))[_0x8040('0x1f')](respondWithResult(_0x3367ab,null))[_0x8040('0x28')](handleError(_0x3367ab,null));};exports[_0x8040('0x33')]=function(_0x28626c,_0x419006){return db['FaxAccount'][_0x8040('0x56')]({'where':{'id':_0x28626c[_0x8040('0x52')]['id']}})[_0x8040('0x1f')](handleEntityNotFound(_0x419006,null))[_0x8040('0x1f')](removeEntity(_0x419006,null))[_0x8040('0x28')](handleError(_0x419006,null));};exports[_0x8040('0x60')]=function(_0x1949a2,_0x8b4e7b){return db['FaxAccount'][_0x8040('0x60')]()[_0x8040('0x1f')](respondWithResult(_0x8b4e7b,null))['catch'](handleError(_0x8b4e7b,null));};exports[_0x8040('0x61')]=function(_0x13ef8b,_0x41a442,_0x2f5cf9){if(_0x13ef8b[_0x8040('0x5f')]['id']){delete _0x13ef8b[_0x8040('0x5f')]['id'];}return db['FaxAccount'][_0x8040('0x56')]({'where':{'id':_0x13ef8b[_0x8040('0x52')]['id']}})[_0x8040('0x1f')](handleEntityNotFound(_0x41a442,null))[_0x8040('0x1f')](function(_0x50530e){if(_0x50530e){_0x13ef8b[_0x8040('0x5f')]['FaxAccountId']=_0x50530e['id'];return db[_0x8040('0x62')][_0x8040('0x57')](_0x13ef8b['body']);}})[_0x8040('0x1f')](respondWithResult(_0x41a442,null))[_0x8040('0x28')](handleError(_0x41a442,null));};exports[_0x8040('0x63')]=function(_0x41b545,_0x5aa93e,_0x5d3e70){var _0x2978f4={'raw':![],'where':{}};var _0x2fb391={};var _0x3ad5d4={'count':0x0,'rows':[]};return db['FaxAccount'][_0x8040('0x64')]({'where':{'id':_0x41b545[_0x8040('0x52')]['id']}})[_0x8040('0x1f')](handleEntityNotFound(_0x5aa93e,null))[_0x8040('0x1f')](function(_0x9aac8b){if(_0x9aac8b){_0x2fb391[_0x8040('0x3d')]=_[_0x8040('0x54')](db[_0x8040('0x62')][_0x8040('0x3a')]);_0x2fb391[_0x8040('0x3e')]=_[_0x8040('0x54')](_0x41b545[_0x8040('0x3e')]);_0x2fb391[_0x8040('0x3f')]=_['intersection'](_0x2fb391[_0x8040('0x3d')],_0x2fb391[_0x8040('0x3e')]);_0x2978f4[_0x8040('0x41')]=_[_0x8040('0x40')](_0x2fb391[_0x8040('0x3d')],qs[_0x8040('0x42')](_0x41b545[_0x8040('0x3e')][_0x8040('0x42')]));_0x2978f4[_0x8040('0x41')]=_0x2978f4['attributes'][_0x8040('0x43')]?_0x2978f4[_0x8040('0x41')]:_0x2fb391['model'];if(!_0x41b545[_0x8040('0x3e')][_0x8040('0x44')](_0x8040('0x65'))){_0x2978f4[_0x8040('0x45')]=qs['limit'](_0x41b545[_0x8040('0x3e')]['limit']);_0x2978f4['offset']=qs['offset'](_0x41b545[_0x8040('0x3e')][_0x8040('0x2d')]);}_0x2978f4[_0x8040('0x46')]=qs[_0x8040('0x47')](_0x41b545[_0x8040('0x3e')][_0x8040('0x47')]);_0x2978f4[_0x8040('0x4a')]=qs['filters'](_[_0x8040('0x48')](_0x41b545['query'],_0x2fb391['filters']));_0x2978f4[_0x8040('0x4a')][_0x8040('0x66')]=_0x9aac8b['id'];if(_0x41b545['query'][_0x8040('0x49')]){_0x2978f4[_0x8040('0x4a')]=_[_0x8040('0x55')](_0x2978f4[_0x8040('0x4a')],{'$or':_[_0x8040('0x39')](_0x2978f4[_0x8040('0x41')],function(_0x5037ab){var _0x3355d7={};_0x3355d7[_0x5037ab]={'$like':'%'+_0x41b545['query'][_0x8040('0x49')]+'%'};return _0x3355d7;})});}_0x2978f4=_['merge']({},_0x2978f4,_0x41b545['options']);return db[_0x8040('0x62')][_0x8040('0x4f')]({'where':_0x2978f4[_0x8040('0x4a')]})['then'](function(_0xc4b7d1){_0x3ad5d4[_0x8040('0x4f')]=_0xc4b7d1;if(_0x41b545['query']['includeAll']){_0x2978f4[_0x8040('0x67')]=[{'all':!![]}];}return db['Disposition'][_0x8040('0x68')](_0x2978f4);})[_0x8040('0x1f')](function(_0x25530f){_0x3ad5d4[_0x8040('0x69')]=_0x25530f;return _0x3ad5d4;});}})[_0x8040('0x1f')](respondWithFilteredResult(_0x5aa93e,_0x2978f4))[_0x8040('0x28')](handleError(_0x5aa93e,null));};exports['removeDispositions']=function(_0x45bca3,_0x2c898c,_0x5d4dad){return db[_0x8040('0x4e')][_0x8040('0x56')]({'where':{'id':_0x45bca3[_0x8040('0x52')]['id']}})['then'](handleEntityNotFound(_0x2c898c,null))[_0x8040('0x1f')](function(_0x321ec6){if(_0x321ec6){return _0x321ec6[_0x8040('0x6a')](_0x45bca3[_0x8040('0x3e')][_0x8040('0x6b')]);}})[_0x8040('0x1f')](respondWithStatusCode(_0x2c898c,null))['catch'](handleError(_0x2c898c,null));};exports[_0x8040('0x6c')]=function(_0x5c52ff,_0x44c6f8,_0xfb4a26){if(_0x5c52ff[_0x8040('0x5f')]['id']){delete _0x5c52ff['body']['id'];}return db['FaxAccount']['find']({'where':{'id':_0x5c52ff['params']['id']}})['then'](handleEntityNotFound(_0x44c6f8,null))['then'](function(_0x364ee9){if(_0x364ee9){_0x5c52ff[_0x8040('0x5f')]['FaxAccountId']=_0x364ee9['id'];return db[_0x8040('0x6d')][_0x8040('0x57')](_0x5c52ff[_0x8040('0x5f')]);}})[_0x8040('0x1f')](respondWithResult(_0x44c6f8,null))[_0x8040('0x28')](handleError(_0x44c6f8,null));};exports[_0x8040('0x6e')]=function(_0x5f2f81,_0x5734b3,_0x1844f0){var _0x146b9a={'raw':![],'where':{}};var _0x451fc4={};var _0x175c2a={'count':0x0,'rows':[]};return db['FaxAccount'][_0x8040('0x64')]({'where':{'id':_0x5f2f81['params']['id']}})[_0x8040('0x1f')](handleEntityNotFound(_0x5734b3,null))['then'](function(_0x39e665){if(_0x39e665){_0x451fc4['model']=_[_0x8040('0x54')](db[_0x8040('0x6d')][_0x8040('0x3a')]);_0x451fc4[_0x8040('0x3e')]=_['keys'](_0x5f2f81[_0x8040('0x3e')]);_0x451fc4['filters']=_[_0x8040('0x40')](_0x451fc4['model'],_0x451fc4[_0x8040('0x3e')]);_0x146b9a['attributes']=_[_0x8040('0x40')](_0x451fc4[_0x8040('0x3d')],qs[_0x8040('0x42')](_0x5f2f81['query'][_0x8040('0x42')]));_0x146b9a['attributes']=_0x146b9a['attributes'][_0x8040('0x43')]?_0x146b9a[_0x8040('0x41')]:_0x451fc4[_0x8040('0x3d')];if(!_0x5f2f81[_0x8040('0x3e')][_0x8040('0x44')](_0x8040('0x65'))){_0x146b9a[_0x8040('0x45')]=qs[_0x8040('0x45')](_0x5f2f81[_0x8040('0x3e')][_0x8040('0x45')]);_0x146b9a[_0x8040('0x2d')]=qs[_0x8040('0x2d')](_0x5f2f81[_0x8040('0x3e')][_0x8040('0x2d')]);}_0x146b9a[_0x8040('0x46')]=qs[_0x8040('0x47')](_0x5f2f81['query']['sort']);_0x146b9a[_0x8040('0x4a')]=qs['filters'](_[_0x8040('0x48')](_0x5f2f81[_0x8040('0x3e')],_0x451fc4[_0x8040('0x3f')]));_0x146b9a[_0x8040('0x4a')][_0x8040('0x66')]=_0x39e665['id'];if(_0x5f2f81[_0x8040('0x3e')][_0x8040('0x49')]){_0x146b9a['where']=_[_0x8040('0x55')](_0x146b9a['where'],{'$or':_[_0x8040('0x39')](_0x146b9a[_0x8040('0x41')],function(_0x14d0c4){var _0x319a96={};_0x319a96[_0x14d0c4]={'$like':'%'+_0x5f2f81[_0x8040('0x3e')][_0x8040('0x49')]+'%'};return _0x319a96;})});}_0x146b9a=_[_0x8040('0x55')]({},_0x146b9a,_0x5f2f81[_0x8040('0x4d')]);return db[_0x8040('0x6d')][_0x8040('0x4f')]({'where':_0x146b9a[_0x8040('0x4a')]})[_0x8040('0x1f')](function(_0x140770){_0x175c2a[_0x8040('0x4f')]=_0x140770;if(_0x5f2f81[_0x8040('0x3e')]['includeAll']){_0x146b9a[_0x8040('0x67')]=[{'all':!![]}];}return db[_0x8040('0x6d')][_0x8040('0x68')](_0x146b9a);})[_0x8040('0x1f')](function(_0x30b932){_0x175c2a[_0x8040('0x69')]=_0x30b932;return _0x175c2a;});}})[_0x8040('0x1f')](respondWithFilteredResult(_0x5734b3,_0x146b9a))['catch'](handleError(_0x5734b3,null));};exports[_0x8040('0x6f')]=function(_0xa1dd3a,_0x3c0750,_0x11ddf3){return db[_0x8040('0x4e')][_0x8040('0x56')]({'where':{'id':_0xa1dd3a['params']['id']}})[_0x8040('0x1f')](handleEntityNotFound(_0x3c0750,null))[_0x8040('0x1f')](function(_0x51b8e6){if(_0x51b8e6){return _0x51b8e6[_0x8040('0x6f')](_0xa1dd3a[_0x8040('0x3e')][_0x8040('0x6b')]);}})[_0x8040('0x1f')](respondWithStatusCode(_0x3c0750,null))['catch'](handleError(_0x3c0750,null));};exports['addInteraction']=function(_0x1f345f,_0xc7b665,_0x2198bf){return db[_0x8040('0x70')][_0x8040('0x56')]({'where':{'id':_0x1f345f[_0x8040('0x52')]['id']}})[_0x8040('0x1f')](handleEntityNotFound(_0xc7b665,null))[_0x8040('0x1f')](function(_0x446562){if(_0x446562){return _0x446562[_0x8040('0x71')](_0x1f345f[_0x8040('0x5f')][_0x8040('0x6b')],_[_0x8040('0x72')](_0x1f345f[_0x8040('0x5f')],['ids','id'])||{});}})[_0x8040('0x1f')](respondWithResult(_0xc7b665,null))['catch'](handleError(_0xc7b665,null));};exports['getInteractions']=function(_0x110cdd,_0x196e45,_0x32827a){var _0x54a255={'raw':![],'where':{}};var _0x57b502={};var _0x21fef7={'count':0x0,'rows':[]};return db[_0x8040('0x4e')][_0x8040('0x64')]({'where':{'id':_0x110cdd[_0x8040('0x52')]['id']}})[_0x8040('0x1f')](handleEntityNotFound(_0x196e45,null))[_0x8040('0x1f')](function(_0x39c72b){if(_0x39c72b){_0x57b502[_0x8040('0x3d')]=_[_0x8040('0x54')](db[_0x8040('0x70')][_0x8040('0x3a')]);_0x57b502[_0x8040('0x3e')]=_[_0x8040('0x54')](_0x110cdd['query']);_0x57b502[_0x8040('0x3f')]=_['intersection'](_0x57b502['model'],_0x57b502['query']);_0x54a255[_0x8040('0x41')]=_['intersection'](_0x57b502[_0x8040('0x3d')],qs[_0x8040('0x42')](_0x110cdd['query']['fields']));_0x54a255['attributes']=_0x54a255[_0x8040('0x41')][_0x8040('0x43')]?_0x54a255[_0x8040('0x41')]:_0x57b502['model'];if(!_0x110cdd[_0x8040('0x3e')][_0x8040('0x44')](_0x8040('0x65'))){_0x54a255['limit']=qs[_0x8040('0x45')](_0x110cdd[_0x8040('0x3e')][_0x8040('0x45')]);_0x54a255[_0x8040('0x2d')]=qs[_0x8040('0x2d')](_0x110cdd[_0x8040('0x3e')][_0x8040('0x2d')]);}_0x54a255[_0x8040('0x46')]=qs[_0x8040('0x47')](_0x110cdd[_0x8040('0x3e')][_0x8040('0x47')]);_0x54a255[_0x8040('0x4a')]=qs[_0x8040('0x3f')](_['pick'](_0x110cdd[_0x8040('0x3e')],_0x57b502[_0x8040('0x3f')]));_0x54a255[_0x8040('0x4a')][_0x8040('0x66')]=_0x39c72b['id'];if(_0x110cdd[_0x8040('0x3e')][_0x8040('0x49')]){_0x54a255['where']=_[_0x8040('0x55')](_0x54a255[_0x8040('0x4a')],{'$or':_[_0x8040('0x39')](_0x54a255[_0x8040('0x41')],function(_0x3b17dc){var _0x4f892e={};_0x4f892e[_0x3b17dc]={'$like':'%'+_0x110cdd['query'][_0x8040('0x49')]+'%'};return _0x4f892e;})});}_0x54a255=_['merge']({},_0x54a255,_0x110cdd[_0x8040('0x4d')]);return db[_0x8040('0x70')][_0x8040('0x4f')]({'where':_0x54a255[_0x8040('0x4a')]})['then'](function(_0x31d7fa){_0x21fef7[_0x8040('0x4f')]=_0x31d7fa;if(_0x110cdd[_0x8040('0x3e')]['includeAll']){_0x54a255['include']=[{'model':db[_0x8040('0x73')],'as':_0x8040('0x74'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x8040('0x75'),_0x8040('0x76')],'required':![]},{'model':db[_0x8040('0x77')],'as':_0x8040('0x78'),'attributes':['id',_0x8040('0x4c'),_0x8040('0x79')],'where':_0x110cdd[_0x8040('0x3e')][_0x8040('0x7a')]?{'id':_0x110cdd[_0x8040('0x3e')][_0x8040('0x7a')]}:undefined,'required':_0x110cdd[_0x8040('0x3e')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0x8040('0x68')](_0x54a255);})['then'](function(_0x1f5b7c){_0x21fef7[_0x8040('0x69')]=_0x1f5b7c;return _0x21fef7;});}})[_0x8040('0x1f')](respondWithFilteredResult(_0x196e45,_0x54a255))[_0x8040('0x28')](handleError(_0x196e45,null));};exports[_0x8040('0x7b')]=function(_0x142963,_0x43db76){var _0xf64808=_0x142963[_0x8040('0x52')]['id'];var _0x43471a=_0x142963[_0x8040('0x5f')];var _0x4003c4=0xc8;var _0x3b151e=null;return db[_0x8040('0x7c')][_0x8040('0x7d')]({'isolationLevel':db[_0x8040('0x7c')][_0x8040('0x7e')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x2db72a){return db[_0x8040('0x4e')][_0x8040('0x64')]({'where':{'id':_0xf64808},'transaction':_0x2db72a})[_0x8040('0x1f')](function(_0x42e0e6){if(_0x42e0e6){return db[_0x8040('0x7f')]['destroy']({'where':{'FaxAccountId':_0xf64808},'transaction':_0x2db72a})['then'](function(){var _0x981d35=_[_0x8040('0x39')](_0x43471a,function(_0xcdcd07){_0xcdcd07[_0x8040('0x66')]=_0xf64808;return _0xcdcd07;});return db[_0x8040('0x7f')][_0x8040('0x80')](_0x981d35,{'transaction':_0x2db72a});});}else{_0x4003c4=0x194;_0x3b151e=[];}});})['then'](function(){if(_0x4003c4!==0x194){return db[_0x8040('0x7f')][_0x8040('0x81')]({'where':{'FaxAccountId':_0xf64808},'order':_0x8040('0x82')})['then'](function(_0x4030ae){_0x3b151e=_0x4030ae;});}})['catch'](function(_0x20640f){_0x4003c4=0x1f4;logger['error'](_0x20640f[_0x8040('0x36')]);if(_0x20640f[_0x8040('0x4c')]){delete _0x20640f[_0x8040('0x4c')];}_0x3b151e=_0x20640f;})[_0x8040('0x83')](function(){if(_0x3b151e===null){_0x43db76[_0x8040('0x29')](_0x4003c4);}else{if(_0x4003c4===0x1f4){_0x43db76[_0x8040('0x2a')](_0x4003c4)[_0x8040('0x37')](_0x3b151e);}else{_0x43db76[_0x8040('0x2a')](_0x4003c4)['json'](_0x3b151e);}}});};exports['getApplications']=function(_0x3b083a,_0x5f8107,_0x432f89){var _0x476164={};var _0x445284={};var _0x28bb37;var _0x3c833a;return db[_0x8040('0x4e')]['findOne']({'where':{'id':_0x3b083a['params']['id']}})[_0x8040('0x1f')](handleEntityNotFound(_0x5f8107,null))[_0x8040('0x1f')](function(_0x57eb5f){if(_0x57eb5f){_0x28bb37=_0x57eb5f;_0x445284[_0x8040('0x3d')]=_[_0x8040('0x54')](db[_0x8040('0x7f')][_0x8040('0x3a')]);_0x445284[_0x8040('0x3e')]=_[_0x8040('0x54')](_0x3b083a[_0x8040('0x3e')]);_0x445284[_0x8040('0x3f')]=_[_0x8040('0x40')](_0x445284[_0x8040('0x3d')],_0x445284['query']);_0x476164[_0x8040('0x41')]=_['intersection'](_0x445284[_0x8040('0x3d')],qs[_0x8040('0x42')](_0x3b083a[_0x8040('0x3e')]['fields']));_0x476164[_0x8040('0x41')]=_0x476164[_0x8040('0x41')][_0x8040('0x43')]?_0x476164[_0x8040('0x41')]:_0x445284['model'];_0x476164['order']=qs[_0x8040('0x47')](_0x3b083a[_0x8040('0x3e')][_0x8040('0x47')]);_0x476164[_0x8040('0x4a')]=qs['filters'](_['pick'](_0x3b083a[_0x8040('0x3e')],_0x445284[_0x8040('0x3f')]));if(_0x3b083a[_0x8040('0x3e')][_0x8040('0x49')]){_0x476164[_0x8040('0x4a')]=_[_0x8040('0x55')](_0x476164[_0x8040('0x4a')],{'$or':_[_0x8040('0x39')](_0x476164[_0x8040('0x41')],function(_0x33f11c){var _0x3ded76={};_0x3ded76[_0x33f11c]={'$like':'%'+_0x3b083a[_0x8040('0x3e')][_0x8040('0x49')]+'%'};return _0x3ded76;})});}_0x476164=_['merge']({},_0x476164,_0x3b083a[_0x8040('0x4d')]);return _0x28bb37['getApplications'](_0x476164);}})[_0x8040('0x1f')](function(_0x177a86){if(_0x177a86){_0x3c833a=_0x177a86[_0x8040('0x43')];if(!_0x3b083a[_0x8040('0x3e')][_0x8040('0x44')](_0x8040('0x65'))){_0x476164[_0x8040('0x45')]=qs[_0x8040('0x45')](_0x3b083a[_0x8040('0x3e')]['limit']);_0x476164[_0x8040('0x2d')]=qs[_0x8040('0x2d')](_0x3b083a[_0x8040('0x3e')]['offset']);}return _0x28bb37[_0x8040('0x84')](_0x476164);}})[_0x8040('0x1f')](function(_0x285934){if(_0x285934){return _0x285934?{'count':_0x3c833a,'rows':_0x285934}:null;}})[_0x8040('0x1f')](respondWithResult(_0x5f8107,null))[_0x8040('0x28')](handleError(_0x5f8107,null));};function Extension(_0x1034b6,_0x5bc200,_0x75820d,_0x37d5e0){this[_0x8040('0x85')]=_0x8040('0x86');this[_0x8040('0x87')]=_0x1034b6[_0x8040('0x88')];this[_0x8040('0x89')]=_0x37d5e0;this['type']=_0x8040('0x8a');this['description']=_0x8040('0x8b');this[_0x8040('0x66')]=_0x1034b6['id'];this[_0x8040('0x82')]=_0x5bc200;this[_0x8040('0x8c')]=_0x75820d;}function createExtensionsReciveFax(_0x5d9bc9){var _0x56c236=0x1;var _0x2f1d1a=[];_0x2f1d1a[_0x8040('0x8d')](new Extension(_0x5d9bc9,_0x56c236,'','Answer'));_0x56c236+=0x1;_0x2f1d1a[_0x8040('0x8d')](new Extension(_0x5d9bc9,_0x56c236,_0x8040('0x8e'),_0x8040('0x8f')));_0x56c236+=0x1;for(var _0x4636a8 in _0x5d9bc9){if(_0x5d9bc9[_0x8040('0x44')](_0x4636a8)&&(_0x4636a8===_0x8040('0x90')||_0x4636a8===_0x8040('0x88')||_0x4636a8===_0x8040('0x91')||_0x4636a8==='faxdetect'||_0x4636a8===_0x8040('0x92')||_0x4636a8===_0x8040('0x93')||_0x4636a8===_0x8040('0x94')||_0x4636a8===_0x8040('0x95')||_0x4636a8===_0x8040('0x96'))){_0x2f1d1a[_0x8040('0x8d')](new Extension(_0x5d9bc9,_0x56c236,_0x8040('0x97')+_0x4636a8+')='+_0x5d9bc9[_0x4636a8],'Set'));_0x56c236+=0x1;}}_0x2f1d1a[_0x8040('0x8d')](new Extension(_0x5d9bc9,_0x56c236,'6','Wait'));_0x56c236+=0x1;_0x2f1d1a[_0x8040('0x8d')](new Extension(_0x5d9bc9,_0x56c236,_0x8040('0x98'),_0x8040('0x99')));_0x56c236=0x0;return _0x2f1d1a;}exports[_0x8040('0x9a')]=function(_0x580dd4,_0x1690e1,_0x1ac8d5){var _0x3ff920;return db[_0x8040('0x7c')][_0x8040('0x7d')](function(_0x45dd0f){return db[_0x8040('0x4e')][_0x8040('0x57')](_0x580dd4[_0x8040('0x5f')],{'transaction':_0x45dd0f})[_0x8040('0x1f')](function(_0x4f9244){_0x3ff920=_0x4f9244[_0x8040('0x34')]({'plain':!![]});return db[_0x8040('0x9b')][_0x8040('0x80')](createExtensionsReciveFax(_0x3ff920),{'transaction':_0x45dd0f});});})['then'](function(){return _0x3ff920;})[_0x8040('0x1f')](respondWithResult(_0x1690e1,null))['catch'](handleError(_0x1690e1,null));};exports[_0x8040('0x9c')]=function(_0x4b4298,_0x5c2e84,_0x36506f){var _0x1774a7;return db[_0x8040('0x7c')][_0x8040('0x7d')](function(_0x5cd7fd){return db[_0x8040('0x4e')]['update'](_0x4b4298[_0x8040('0x5f')],{'where':{'id':_0x4b4298[_0x8040('0x5f')]['id']},'transaction':_0x5cd7fd})[_0x8040('0x1f')](function(_0x42ff64){return db[_0x8040('0x9b')][_0x8040('0x33')]({'where':{'FaxAccountId':_0x4b4298[_0x8040('0x5f')]['id']},'transaction':_0x5cd7fd})[_0x8040('0x1f')](function(_0x5a2b3b){return db[_0x8040('0x9b')][_0x8040('0x80')](createExtensionsReciveFax(_[_0x8040('0x72')](_0x4b4298[_0x8040('0x5f')],['tech',_0x8040('0x3c'),_0x8040('0x9d'),'updatedAt',_0x8040('0x9e'),'ListId'])),{'transaction':_0x5cd7fd});});});})[_0x8040('0x1f')](function(){return db['FaxAccount'][_0x8040('0x9f')](_0x4b4298['body']['id']);})['then'](respondWithResult(_0x5c2e84,null))['catch'](handleError(_0x5c2e84,null));};exports[_0x8040('0xa0')]=function(_0x281d09,_0x10db32,_0x2388e3){var _0x2566d0={'raw':!![],'where':{}};var _0x47e810={};var _0x565fd7={'count':0x0,'rows':[]};return db[_0x8040('0x4e')]['findOne']({'where':{'id':_0x281d09[_0x8040('0x52')]['id']}})[_0x8040('0x1f')](handleEntityNotFound(_0x10db32,null))[_0x8040('0x1f')](function(_0x248905){if(_0x248905){_0x47e810[_0x8040('0x3d')]=_[_0x8040('0x54')](db[_0x8040('0xa1')][_0x8040('0x3a')]);_0x47e810[_0x8040('0x3e')]=_['keys'](_0x281d09[_0x8040('0x3e')]);_0x47e810['filters']=_[_0x8040('0x40')](_0x47e810['model'],_0x47e810['query']);_0x2566d0[_0x8040('0x41')]=_[_0x8040('0x40')](_0x47e810[_0x8040('0x3d')],qs[_0x8040('0x42')](_0x281d09[_0x8040('0x3e')]['fields']));_0x2566d0[_0x8040('0x41')]=_0x2566d0[_0x8040('0x41')][_0x8040('0x43')]?_0x2566d0[_0x8040('0x41')]:_0x47e810[_0x8040('0x3d')];if(!_0x281d09[_0x8040('0x3e')][_0x8040('0x44')](_0x8040('0x65'))){_0x2566d0[_0x8040('0x45')]=qs['limit'](_0x281d09[_0x8040('0x3e')][_0x8040('0x45')]);_0x2566d0[_0x8040('0x2d')]=qs['offset'](_0x281d09[_0x8040('0x3e')][_0x8040('0x2d')]);}_0x2566d0[_0x8040('0x46')]=qs[_0x8040('0x47')](_0x281d09['query']['sort']);_0x2566d0[_0x8040('0x4a')]=qs[_0x8040('0x3f')](_[_0x8040('0x48')](_0x281d09[_0x8040('0x3e')],_0x47e810['filters']));_0x2566d0[_0x8040('0x4a')][_0x8040('0x66')]=_0x248905['id'];if(_0x281d09[_0x8040('0x3e')][_0x8040('0x49')]){_0x2566d0[_0x8040('0x4a')]=_[_0x8040('0x55')](_0x2566d0[_0x8040('0x4a')],{'$or':_[_0x8040('0x39')](_0x2566d0['attributes'],function(_0x17a217){var _0x315f09={};_0x315f09[_0x17a217]={'$like':'%'+_0x281d09['query'][_0x8040('0x49')]+'%'};return _0x315f09;})});}if(_0x281d09[_0x8040('0x3e')]['$gte']){var _0x121466=_0x281d09[_0x8040('0x3e')][_0x8040('0xa2')][_0x8040('0xa3')](',');var _0x53253f={};_0x53253f[_0x121466[0x0]]={'$gte':moment(_0x121466[0x1])[_0x8040('0xa4')](_0x8040('0xa5'))};_0x2566d0[_0x8040('0x4a')]=_[_0x8040('0x55')](_0x2566d0[_0x8040('0x4a')],_0x53253f);}_0x2566d0=_[_0x8040('0x55')]({},_0x2566d0,_0x281d09[_0x8040('0x4d')]);return db[_0x8040('0xa1')]['count']({'where':_0x2566d0[_0x8040('0x4a')]})['then'](function(_0x323347){_0x565fd7[_0x8040('0x4f')]=_0x323347;if(_0x281d09[_0x8040('0x3e')][_0x8040('0x50')]){_0x2566d0[_0x8040('0x67')]=[{'all':!![]}];}return db[_0x8040('0xa1')][_0x8040('0x68')](_0x2566d0);})[_0x8040('0x1f')](function(_0x538a9a){_0x565fd7[_0x8040('0x69')]=_0x538a9a;return _0x565fd7;});}})[_0x8040('0x1f')](respondWithFilteredResult(_0x10db32,_0x2566d0))['catch'](handleError(_0x10db32,null));};exports[_0x8040('0x37')]=function(_0x4279bb,_0x400986,_0x40b853){var _0x2ca584,_0x222fbe={},_0x168272;if(_0x4279bb[_0x8040('0x5f')]['to']){_0x168272=_0x4279bb[_0x8040('0x5f')]['to'][0x0];}return db[_0x8040('0x4e')][_0x8040('0x56')]({'where':{'id':_0x4279bb['params']['id']},'include':[{'model':db['CmList'],'as':_0x8040('0xa6'),'include':[{'model':db[_0x8040('0x73')],'as':_0x8040('0xa7'),'where':{'fax':_0x168272},'limit':0x1,'order':[[_0x8040('0xa8'),_0x8040('0xa9')]]}]}]})[_0x8040('0x1f')](handleEntityNotFound(_0x400986,null))['then'](function(_0xfc1ce9){_0x2ca584=_0xfc1ce9;if(_0x4279bb[_0x8040('0x5f')][_0x8040('0xaa')]&&_0x4279bb[_0x8040('0x5f')][_0x8040('0xaa')]['length']){for(var _0x49fd5b=0x0;_0x49fd5b<_0x4279bb['body'][_0x8040('0xaa')][_0x8040('0x43')];_0x49fd5b+=0x1){_0x4279bb[_0x8040('0x5f')]['attachments'][_0x49fd5b]={'filename':_0x4279bb['body'][_0x8040('0xaa')][_0x49fd5b]['name'],'id':_0x4279bb[_0x8040('0x5f')][_0x8040('0xaa')][_0x49fd5b]['id'],'path':path[_0x8040('0xab')](config[_0x8040('0xac')],'server/files/attachments',_0x4279bb[_0x8040('0x5f')][_0x8040('0xaa')][_0x49fd5b]['basename'])};}}return respondWithRpcPromise(_0x8040('0xad'),_0x8040('0xad'),{'FaxAccountId':_['isNil'](_0x4279bb[_0x8040('0x52')]['id'])?undefined:_0x4279bb[_0x8040('0x52')]['id'],'path':_[_0x8040('0xae')](_0x4279bb[_0x8040('0x5f')][_0x8040('0xaa')][0x0][_0x8040('0x7')])?undefined:_0x4279bb[_0x8040('0x5f')][_0x8040('0xaa')][0x0][_0x8040('0x7')],'fax':_[_0x8040('0xae')](_0x4279bb[_0x8040('0x5f')]['to'][0x0])?undefined:_0x4279bb[_0x8040('0x5f')]['to'][0x0]},client9002);})[_0x8040('0x1f')](function(){if(_0x2ca584){if(_['isNil'](_0x4279bb['body']['from'])){_0x4279bb[_0x8040('0x5f')][_0x8040('0xaf')]=util[_0x8040('0xa4')]('\x22%s\x22\x20<%s>',_0x2ca584[_0x8040('0x4c')],_0x2ca584[_0x8040('0xb0')]);}if(_0x2ca584[_0x8040('0xa6')]){if(_0x2ca584[_0x8040('0xa6')][_0x8040('0xa7')]['length']){return _0x2ca584[_0x8040('0xa6')][_0x8040('0xa7')][0x0];}else{return db[_0x8040('0x73')]['create'](_['defaults'](_0x4279bb['body'],{'firstName':_0x4279bb[_0x8040('0x5f')]['to'][0x0],'phone':_0x4279bb[_0x8040('0x5f')]['to'][0x0],'fax':_0x4279bb['body']['to'][0x0],'ListId':_0x2ca584[_0x8040('0xb1')]}));}}else{throw new Error(_0x8040('0xb2'));}}else{throw new Error(_0x8040('0xb3'));}})['then'](function(_0x191e35){if(_0x191e35){return db[_0x8040('0x70')][_0x8040('0x56')]({'where':{'ContactId':_0x191e35['id'],'closed':![],'FaxAccountId':_0x2ca584['id']}})[_0x8040('0x1f')](function(_0x55024a){if(_0x55024a){return[_0x55024a,![]];}return db['FaxInteraction'][_0x8040('0x57')]({'UserId':_0x4279bb[_0x8040('0x58')]['id'],'ContactId':_0x191e35['id'],'FaxAccountId':_0x2ca584['id'],'fax':_0x4279bb[_0x8040('0x5f')]['to'][0x0],'firstMsgDirection':_0x8040('0xb4'),'Messages':[_[_0x8040('0x55')](_0x4279bb[_0x8040('0x5f')],{'read':![],'body':_0x4279bb['body'][_0x8040('0xaa')][0x0][_0x8040('0xb5')],'FaxAccountId':_0x2ca584['id'],'UserId':_0x4279bb[_0x8040('0x58')]['id'],'ContactId':_0x191e35['id'],'AttachmentId':_0x4279bb[_0x8040('0x5f')][_0x8040('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0x8040('0xa1')],'as':'Messages'}]})[_0x8040('0x1f')](function(_0x58c77e){return[_0x58c77e,!![]];});});}else{throw new Error(_0x8040('0xb6'));}})['spread'](function(_0xb6c09e,_0x83327e){if(_0x83327e){return _0xb6c09e;}return db[_0x8040('0xa1')]['create']({'direction':_0x8040('0xb4'),'read':![],'body':_0x4279bb[_0x8040('0x5f')][_0x8040('0xaa')][0x0][_0x8040('0xb5')],'FaxAccountId':_0x2ca584['id'],'FaxInteractionId':_0xb6c09e['id'],'UserId':_0x4279bb[_0x8040('0x58')]['id'],'ContactId':_0xb6c09e[_0x8040('0xb7')],'AttachmentId':_0x4279bb[_0x8040('0x5f')][_0x8040('0xaa')][0x0]['id']})[_0x8040('0x1f')](function(_0x2f1411){_0xb6c09e[_0x8040('0xb8')][_0x8040('0xb9')]=[];_0xb6c09e[_0x8040('0xb8')][_0x8040('0xb9')]['push'](_0x2f1411[_0x8040('0xb8')]);return _0xb6c09e;});})[_0x8040('0x1f')](function(_0x1efd10){respondWithRpcPromise(_0x8040('0xba'),'SendFax',{'FaxAccountId':_[_0x8040('0xae')](_0x4279bb['params']['id'])?undefined:_0x4279bb['params']['id'],'path':_[_0x8040('0xae')](_0x4279bb[_0x8040('0x5f')][_0x8040('0xaa')][0x0]['path'])?undefined:_0x4279bb[_0x8040('0x5f')][_0x8040('0xaa')][0x0][_0x8040('0x7')],'fax':_[_0x8040('0xae')](_0x4279bb[_0x8040('0x5f')]['to'][0x0])?undefined:_0x4279bb[_0x8040('0x5f')]['to'][0x0],'AttachmentId':_0x4279bb['body'][_0x8040('0xaa')][0x0]['id']},client9002)[_0x8040('0x1f')](function(_0x1d4734){logger[_0x8040('0x20')](_0x8040('0xbb'),_0x1d4734);})[_0x8040('0x28')](function(_0x5e8ea1){logger[_0x8040('0x20')](_0x8040('0xbb'),_0x5e8ea1);});return _0x1efd10;})[_0x8040('0x1f')](respondWithResult(_0x400986,null))[_0x8040('0x28')](handleError(_0x400986,null));};exports['addAgents']=function(_0x2ebe0c,_0xbeb07,_0x2eeafa){return db[_0x8040('0x4e')][_0x8040('0x56')]({'where':{'id':_0x2ebe0c[_0x8040('0x52')]['id']}})[_0x8040('0x1f')](handleEntityNotFound(_0xbeb07,null))[_0x8040('0x1f')](function(_0x9329f5){if(_0x9329f5){return _0x9329f5[_0x8040('0xbc')](_0x2ebe0c[_0x8040('0x5f')][_0x8040('0x6b')],_[_0x8040('0x72')](_0x2ebe0c[_0x8040('0x5f')],[_0x8040('0x6b'),'id'])||{})[_0x8040('0xbd')](function(_0x428937){for(var _0x286824=0x0;_0x286824<_0x2ebe0c[_0x8040('0x5f')]['ids'][_0x8040('0x43')];_0x286824+=0x1){socket[_0x8040('0xbe')](_0x8040('0xbf'),{'UserId':Number(_0x2ebe0c[_0x8040('0x5f')][_0x8040('0x6b')][_0x286824]),'FaxAccountId':Number(_0x2ebe0c[_0x8040('0x52')]['id'])});}return _0x428937;});}})['then'](respondWithResult(_0xbeb07,null))[_0x8040('0x28')](handleError(_0xbeb07,null));};exports['removeAgents']=function(_0x5232bc,_0x10613b,_0x105fb4){return db[_0x8040('0x4e')][_0x8040('0x56')]({'where':{'id':_0x5232bc['params']['id']}})[_0x8040('0x1f')](handleEntityNotFound(_0x10613b,null))['then'](function(_0x343866){if(_0x343866){return _0x343866[_0x8040('0xc0')](_0x5232bc[_0x8040('0x3e')][_0x8040('0x6b')])[_0x8040('0x1f')](function(){if(_[_0x8040('0xc1')](_0x5232bc['query']['ids'])){for(var _0x23decf=0x0;_0x23decf<_0x5232bc[_0x8040('0x3e')][_0x8040('0x6b')][_0x8040('0x43')];_0x23decf+=0x1){socket[_0x8040('0xbe')](_0x8040('0xc2'),{'UserId':Number(_0x5232bc[_0x8040('0x3e')][_0x8040('0x6b')][_0x23decf]),'FaxAccountId':Number(_0x5232bc[_0x8040('0x52')]['id'])});}}else{socket[_0x8040('0xbe')](_0x8040('0xc2'),{'UserId':Number(_0x5232bc[_0x8040('0x3e')]['ids']),'FaxAccountId':Number(_0x5232bc[_0x8040('0x52')]['id'])});}});}})[_0x8040('0x1f')](respondWithStatusCode(_0x10613b,null))['catch'](handleError(_0x10613b,null));};exports['getAgents']=function(_0x5bfb4f,_0x48e3b3,_0x3328c3){var _0x1b5427={};var _0x1603df={};var _0x4b80aa;var _0x2fd109;return db['FaxAccount'][_0x8040('0x64')]({'where':{'id':_0x5bfb4f[_0x8040('0x52')]['id']}})[_0x8040('0x1f')](handleEntityNotFound(_0x48e3b3,null))['then'](function(_0x642ff7){if(_0x642ff7){_0x4b80aa=_0x642ff7;_0x1603df[_0x8040('0x3d')]=_[_0x8040('0x54')](db[_0x8040('0xc3')][_0x8040('0x3a')]);_0x1603df[_0x8040('0x3e')]=_['keys'](_0x5bfb4f[_0x8040('0x3e')]);_0x1603df[_0x8040('0x3f')]=_['intersection'](_0x1603df[_0x8040('0x3d')],_0x1603df[_0x8040('0x3e')]);_0x1b5427[_0x8040('0x41')]=_['intersection'](_0x1603df[_0x8040('0x3d')],qs[_0x8040('0x42')](_0x5bfb4f[_0x8040('0x3e')][_0x8040('0x42')]));_0x1b5427[_0x8040('0x41')]=_0x1b5427['attributes']['length']?_0x1b5427[_0x8040('0x41')]:_0x1603df['model'];_0x1b5427[_0x8040('0x46')]=qs['sort'](_0x5bfb4f[_0x8040('0x3e')][_0x8040('0x47')]);_0x1b5427[_0x8040('0x4a')]=qs[_0x8040('0x3f')](_[_0x8040('0x48')](_0x5bfb4f[_0x8040('0x3e')],_0x1603df[_0x8040('0x3f')]));if(_0x5bfb4f[_0x8040('0x3e')][_0x8040('0x49')]){_0x1b5427[_0x8040('0x4a')]=_['merge'](_0x1b5427[_0x8040('0x4a')],{'$or':_[_0x8040('0x39')](_0x1b5427['attributes'],function(_0x339d18){var _0x177bd5={};_0x177bd5[_0x339d18]={'$like':'%'+_0x5bfb4f[_0x8040('0x3e')]['filter']+'%'};return _0x177bd5;})});}_0x1b5427=_[_0x8040('0x55')]({},_0x1b5427,_0x5bfb4f[_0x8040('0x4d')]);return _0x4b80aa[_0x8040('0xc4')](_0x1b5427);}})['then'](function(_0x42da3b){if(_0x42da3b){_0x2fd109=_0x42da3b['length'];if(!_0x5bfb4f['query']['hasOwnProperty'](_0x8040('0x65'))){_0x1b5427[_0x8040('0x45')]=qs[_0x8040('0x45')](_0x5bfb4f[_0x8040('0x3e')][_0x8040('0x45')]);_0x1b5427['offset']=qs[_0x8040('0x2d')](_0x5bfb4f[_0x8040('0x3e')][_0x8040('0x2d')]);}return _0x4b80aa['getAgents'](_0x1b5427);}})['then'](function(_0x3779e8){if(_0x3779e8){return _0x3779e8?{'count':_0x2fd109,'rows':_0x3779e8}:null;}})['then'](respondWithResult(_0x48e3b3,null))[_0x8040('0x28')](handleError(_0x48e3b3,null));}; \ No newline at end of file +var _0x0952=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','register','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','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','get','FaxAccounts','destroy','stack','name','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','Pause','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','length','FaxAccountId','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','Contact','User','Owner','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','ecm','gateway','faxdetect','maxrate','minrate','modem','t38timeout','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','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','send','List','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','CmContact','List\x20not\x20found','Send\x20Fax\x20failed','user','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','rimraf','fast-json-patch','moment','util','path'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x0952,0x189));var _0x2095=function(_0x1268e1,_0x45dcf9){_0x1268e1=_0x1268e1-0x0;var _0x2d0a4a=_0x0952[_0x1268e1];return _0x2d0a4a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2095('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2095('0x1'));var rp=require('request-promise');var moment=require(_0x2095('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2095('0x3'));var path=require(_0x2095('0x4'));var sox=require(_0x2095('0x5'));var csv=require(_0x2095('0x6'));var ejs=require(_0x2095('0x7'));var fs=require('fs');var fs_extra=require(_0x2095('0x8'));var _=require(_0x2095('0x9'));var squel=require(_0x2095('0xa'));var crypto=require(_0x2095('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2095('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2095('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2095('0xe'));var qs=require(_0x2095('0xf'));var as=require(_0x2095('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2095('0x11'))(_0x2095('0x12'));var utils=require(_0x2095('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2095('0x14'));var db=require(_0x2095('0x15'))['db'];config[_0x2095('0x16')]=_[_0x2095('0x17')](config['redis'],{'host':_0x2095('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2095('0x16')]));require(_0x2095('0x19'))[_0x2095('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2095('0x1b')][_0x2095('0x1c')]({'port':0x232c});var client9002=jayson[_0x2095('0x1b')][_0x2095('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1ed907,_0x6cdac2,_0x3400e2,_0x4487bd){return new BPromise(function(_0x2bbe8f,_0x172668){var _0x15dc7c=_0x4487bd||client;return _0x15dc7c[_0x2095('0x1d')](_0x1ed907,_0x3400e2)[_0x2095('0x1e')](function(_0x295638){logger[_0x2095('0x1f')](_0x2095('0x20'),_0x6cdac2,_0x2095('0x21'));logger[_0x2095('0x22')](_0x2095('0x23'),_0x6cdac2,_0x2095('0x21'),JSON[_0x2095('0x24')](_0x295638));if(_0x295638[_0x2095('0x25')]){if(_0x295638[_0x2095('0x25')][_0x2095('0x26')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x6cdac2,_0x295638[_0x2095('0x25')][_0x2095('0x27')]);return _0x172668(_0x295638[_0x2095('0x25')][_0x2095('0x27')]);}logger['error'](_0x2095('0x20'),_0x6cdac2,_0x295638[_0x2095('0x25')][_0x2095('0x27')]);return _0x2bbe8f(_0x295638['error']['message']);}else{logger[_0x2095('0x1f')](_0x2095('0x20'),_0x6cdac2,_0x2095('0x21'));_0x2bbe8f(_0x295638[_0x2095('0x28')]['message']);}})[_0x2095('0x29')](function(_0x554a05){logger[_0x2095('0x25')](_0x2095('0x20'),_0x6cdac2,_0x554a05);_0x172668(_0x554a05);});});}function respondWithStatusCode(_0x32bd99,_0x8f65b4){_0x8f65b4=_0x8f65b4||0xcc;return function(_0x39c579){if(_0x39c579){return _0x32bd99[_0x2095('0x2a')](_0x8f65b4);}return _0x32bd99[_0x2095('0x2b')](_0x8f65b4)[_0x2095('0x2c')]();};}function respondWithResult(_0x3a5dc8,_0x46690c){_0x46690c=_0x46690c||0xc8;return function(_0x374a90){if(_0x374a90){return _0x3a5dc8['status'](_0x46690c)[_0x2095('0x2d')](_0x374a90);}};}function respondWithFilteredResult(_0x1209f6,_0x4837ca){return function(_0x59bc26){if(_0x59bc26){var _0x314818=typeof _0x4837ca[_0x2095('0x2e')]===_0x2095('0x2f')&&typeof _0x4837ca['limit']===_0x2095('0x2f');var _0x24e7b7=_0x59bc26[_0x2095('0x30')];var _0x594fa4=_0x314818?0x0:_0x4837ca[_0x2095('0x2e')];var _0x39ed1e=_0x314818?_0x59bc26[_0x2095('0x30')]:_0x4837ca[_0x2095('0x2e')]+_0x4837ca[_0x2095('0x31')];var _0x47c5d9;if(_0x39ed1e>=_0x24e7b7){_0x39ed1e=_0x24e7b7;_0x47c5d9=0xc8;}else{_0x47c5d9=0xce;}_0x1209f6[_0x2095('0x2b')](_0x47c5d9);return _0x1209f6[_0x2095('0x32')](_0x2095('0x33'),_0x594fa4+'-'+_0x39ed1e+'/'+_0x24e7b7)['json'](_0x59bc26);}return null;};}function patchUpdates(_0x19aa8b){return function(_0x328021){try{jsonpatch[_0x2095('0x34')](_0x328021,_0x19aa8b,!![]);}catch(_0x420286){return BPromise[_0x2095('0x35')](_0x420286);}return _0x328021['save']();};}function saveUpdates(_0x70ec6c,_0xd6e87b){return function(_0x4736dd){if(_0x4736dd){return _0x4736dd[_0x2095('0x36')](_0x70ec6c)[_0x2095('0x1e')](function(_0x1bb52b){return _0x1bb52b;});}return null;};}function removeEntity(_0x534412,_0x5b43e9){return function(_0x4fb32f){if(_0x4fb32f){return _0x4fb32f['destroy']()['then'](function(){var _0x1c9360=_0x4fb32f[_0x2095('0x37')]({'plain':!![]});var _0x5af75c=_0x2095('0x38');return db['UserProfileResource'][_0x2095('0x39')]({'where':{'type':_0x5af75c,'resourceId':_0x1c9360['id']}})[_0x2095('0x1e')](function(){return _0x4fb32f;});})['then'](function(){_0x534412[_0x2095('0x2b')](0xcc)[_0x2095('0x2c')]();});}};}function handleEntityNotFound(_0x1152aa,_0xa31714){return function(_0x23a491){if(!_0x23a491){_0x1152aa[_0x2095('0x2a')](0x194);}return _0x23a491;};}function handleError(_0x2b3a15,_0xad3fca){_0xad3fca=_0xad3fca||0x1f4;return function(_0x5becc8){logger[_0x2095('0x25')](_0x5becc8[_0x2095('0x3a')]);if(_0x5becc8[_0x2095('0x3b')]){delete _0x5becc8['name'];}_0x2b3a15[_0x2095('0x2b')](_0xad3fca)['send'](_0x5becc8);};}exports[_0x2095('0x3c')]=function(_0xa0b7d6,_0x2ad5be){var _0x2fc614={'include':[{'model':db['Pause'],'as':_0x2095('0x3d')}]},_0x246f0a={},_0x3a029a={'count':0x0,'rows':[]};var _0x13ce16=_[_0x2095('0x3e')](db[_0x2095('0x3f')][_0x2095('0x40')],function(_0x205355){return{'name':_0x205355[_0x2095('0x41')],'type':_0x205355[_0x2095('0x42')][_0x2095('0x43')]};});_0x246f0a['model']=_['map'](_0x13ce16,_0x2095('0x3b'));_0x246f0a[_0x2095('0x44')]=_[_0x2095('0x45')](_0xa0b7d6[_0x2095('0x44')]);_0x246f0a[_0x2095('0x46')]=_['intersection'](_0x246f0a[_0x2095('0x47')],_0x246f0a[_0x2095('0x44')]);_0x2fc614[_0x2095('0x48')]=_[_0x2095('0x49')](_0x246f0a['model'],qs[_0x2095('0x4a')](_0xa0b7d6['query'][_0x2095('0x4a')]));_0x2fc614[_0x2095('0x48')]=_0x2fc614['attributes']['length']?_0x2fc614[_0x2095('0x48')]:_0x246f0a[_0x2095('0x47')];if(!_0xa0b7d6[_0x2095('0x44')][_0x2095('0x4b')](_0x2095('0x4c'))){_0x2fc614['limit']=qs[_0x2095('0x31')](_0xa0b7d6[_0x2095('0x44')][_0x2095('0x31')]);_0x2fc614[_0x2095('0x2e')]=qs[_0x2095('0x2e')](_0xa0b7d6[_0x2095('0x44')][_0x2095('0x2e')]);}_0x2fc614[_0x2095('0x4d')]=qs['sort'](_0xa0b7d6[_0x2095('0x44')][_0x2095('0x4e')]);_0x2fc614[_0x2095('0x4f')]=qs[_0x2095('0x46')](_[_0x2095('0x50')](_0xa0b7d6[_0x2095('0x44')],_0x246f0a[_0x2095('0x46')]),_0x13ce16);if(_0xa0b7d6[_0x2095('0x44')]['filter']){_0x2fc614[_0x2095('0x4f')]=_['merge'](_0x2fc614[_0x2095('0x4f')],{'$or':_['map'](_0x13ce16,function(_0x2d7173){if(_0x2d7173['type']!=='VIRTUAL'){var _0x43bfe5={};_0x43bfe5[_0x2d7173['name']]={'$like':'%'+_0xa0b7d6['query'][_0x2095('0x51')]+'%'};return _0x43bfe5;}})});}_0x2fc614=_[_0x2095('0x52')]({},_0x2fc614,_0xa0b7d6[_0x2095('0x53')]);var _0x5f26fe={'where':_0x2fc614[_0x2095('0x4f')]};return db[_0x2095('0x3f')][_0x2095('0x30')](_0x5f26fe)[_0x2095('0x1e')](function(_0x2d6b6e){_0x3a029a['count']=_0x2d6b6e;if(_0xa0b7d6[_0x2095('0x44')][_0x2095('0x54')]){_0x2fc614[_0x2095('0x55')]=[{'all':!![]}];}return db[_0x2095('0x3f')][_0x2095('0x56')](_0x2fc614);})['then'](function(_0x10c7b9){_0x3a029a[_0x2095('0x57')]=_0x10c7b9;return _0x3a029a;})[_0x2095('0x1e')](respondWithFilteredResult(_0x2ad5be,_0x2fc614))[_0x2095('0x29')](handleError(_0x2ad5be,null));};exports[_0x2095('0x58')]=function(_0x577273,_0x3b8aed){var _0x324ace={'raw':![],'where':{'id':_0x577273[_0x2095('0x59')]['id']},'include':[{'model':db[_0x2095('0x5a')],'as':_0x2095('0x3d')}]},_0x5d90de={};_0x5d90de[_0x2095('0x47')]=_[_0x2095('0x45')](db[_0x2095('0x3f')][_0x2095('0x40')]);_0x5d90de[_0x2095('0x44')]=_[_0x2095('0x45')](_0x577273[_0x2095('0x44')]);_0x5d90de[_0x2095('0x46')]=_['intersection'](_0x5d90de['model'],_0x5d90de[_0x2095('0x44')]);_0x324ace[_0x2095('0x48')]=_[_0x2095('0x49')](_0x5d90de[_0x2095('0x47')],qs[_0x2095('0x4a')](_0x577273[_0x2095('0x44')]['fields']));_0x324ace[_0x2095('0x48')]=_0x324ace[_0x2095('0x48')]['length']?_0x324ace['attributes']:_0x5d90de[_0x2095('0x47')];if(_0x577273['query'][_0x2095('0x54')]){_0x324ace[_0x2095('0x55')]=[{'all':!![]}];}_0x324ace=_['merge']({},_0x324ace,_0x577273['options']);return db[_0x2095('0x3f')][_0x2095('0x5b')](_0x324ace)['then'](handleEntityNotFound(_0x3b8aed,null))['then'](respondWithResult(_0x3b8aed,null))['catch'](handleError(_0x3b8aed,null));};exports['create']=function(_0xcf7734,_0x32abbb){return db[_0x2095('0x3f')]['create'](_0xcf7734[_0x2095('0x5c')],{})[_0x2095('0x1e')](function(_0x57762d){var _0x1127bc=_0xcf7734['user'][_0x2095('0x37')]({'plain':!![]});if(!_0x1127bc)throw new Error(_0x2095('0x5d'));if(_0x1127bc[_0x2095('0x5e')]==='user'){var _0x60ca5d=_0x57762d[_0x2095('0x37')]({'plain':!![]});var _0x119d03=_0x2095('0x38');return db['UserProfileSection'][_0x2095('0x5b')]({'where':{'name':_0x119d03,'userProfileId':_0x1127bc[_0x2095('0x5f')]},'raw':!![]})[_0x2095('0x1e')](function(_0x326ee6){if(_0x326ee6&&_0x326ee6[_0x2095('0x60')]===0x0){return db[_0x2095('0x61')][_0x2095('0x62')]({'name':_0x60ca5d['name'],'resourceId':_0x60ca5d['id'],'type':_0x326ee6[_0x2095('0x3b')],'sectionId':_0x326ee6['id']},{})[_0x2095('0x1e')](function(){return _0x57762d;});}else{return _0x57762d;}})['catch'](function(_0x2a23aa){logger[_0x2095('0x25')](_0x2095('0x63'),_0x2a23aa);throw _0x2a23aa;});}return _0x57762d;})[_0x2095('0x1e')](respondWithResult(_0x32abbb,0xc9))[_0x2095('0x29')](handleError(_0x32abbb,null));};exports['update']=function(_0x421bc7,_0x4be34e){if(_0x421bc7[_0x2095('0x5c')]['id']){delete _0x421bc7[_0x2095('0x5c')]['id'];}return db[_0x2095('0x3f')][_0x2095('0x5b')]({'where':{'id':_0x421bc7[_0x2095('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x2095('0x3d')}]})[_0x2095('0x1e')](handleEntityNotFound(_0x4be34e,null))[_0x2095('0x1e')](saveUpdates(_0x421bc7[_0x2095('0x5c')],null))[_0x2095('0x1e')](respondWithResult(_0x4be34e,null))['catch'](handleError(_0x4be34e,null));};exports['destroy']=function(_0x10f77c,_0x3d6e97){return db[_0x2095('0x3f')][_0x2095('0x5b')]({'where':{'id':_0x10f77c[_0x2095('0x59')]['id']}})[_0x2095('0x1e')](handleEntityNotFound(_0x3d6e97,null))[_0x2095('0x1e')](removeEntity(_0x3d6e97,null))[_0x2095('0x29')](handleError(_0x3d6e97,null));};exports[_0x2095('0x64')]=function(_0x1f6316,_0x841ea5){return db[_0x2095('0x3f')][_0x2095('0x64')]()['then'](respondWithResult(_0x841ea5,null))[_0x2095('0x29')](handleError(_0x841ea5,null));};exports['addDisposition']=function(_0xab6ace,_0x1c64dc,_0x3e6684){if(_0xab6ace[_0x2095('0x5c')]['id']){delete _0xab6ace[_0x2095('0x5c')]['id'];}return db[_0x2095('0x3f')][_0x2095('0x5b')]({'where':{'id':_0xab6ace[_0x2095('0x59')]['id']}})['then'](handleEntityNotFound(_0x1c64dc,null))[_0x2095('0x1e')](function(_0x3625cd){if(_0x3625cd){_0xab6ace[_0x2095('0x5c')]['FaxAccountId']=_0x3625cd['id'];return db[_0x2095('0x65')][_0x2095('0x62')](_0xab6ace[_0x2095('0x5c')]);}})[_0x2095('0x1e')](respondWithResult(_0x1c64dc,null))[_0x2095('0x29')](handleError(_0x1c64dc,null));};exports[_0x2095('0x66')]=function(_0x38f165,_0x1298d8,_0x14fcc0){var _0x41fef6={'raw':![],'where':{}};var _0x1636dc={};var _0x28cba8={'count':0x0,'rows':[]};return db[_0x2095('0x3f')][_0x2095('0x67')]({'where':{'id':_0x38f165[_0x2095('0x59')]['id']}})[_0x2095('0x1e')](handleEntityNotFound(_0x1298d8,null))[_0x2095('0x1e')](function(_0x1bbe94){if(_0x1bbe94){_0x1636dc['model']=_[_0x2095('0x45')](db['Disposition'][_0x2095('0x40')]);_0x1636dc['query']=_[_0x2095('0x45')](_0x38f165[_0x2095('0x44')]);_0x1636dc[_0x2095('0x46')]=_[_0x2095('0x49')](_0x1636dc[_0x2095('0x47')],_0x1636dc['query']);_0x41fef6[_0x2095('0x48')]=_['intersection'](_0x1636dc[_0x2095('0x47')],qs[_0x2095('0x4a')](_0x38f165[_0x2095('0x44')][_0x2095('0x4a')]));_0x41fef6['attributes']=_0x41fef6[_0x2095('0x48')]['length']?_0x41fef6[_0x2095('0x48')]:_0x1636dc[_0x2095('0x47')];if(!_0x38f165[_0x2095('0x44')][_0x2095('0x4b')]('nolimit')){_0x41fef6['limit']=qs['limit'](_0x38f165['query'][_0x2095('0x31')]);_0x41fef6['offset']=qs['offset'](_0x38f165[_0x2095('0x44')]['offset']);}_0x41fef6[_0x2095('0x4d')]=qs[_0x2095('0x4e')](_0x38f165[_0x2095('0x44')][_0x2095('0x4e')]);_0x41fef6[_0x2095('0x4f')]=qs[_0x2095('0x46')](_['pick'](_0x38f165[_0x2095('0x44')],_0x1636dc[_0x2095('0x46')]));_0x41fef6['where']['FaxAccountId']=_0x1bbe94['id'];if(_0x38f165[_0x2095('0x44')][_0x2095('0x51')]){_0x41fef6[_0x2095('0x4f')]=_['merge'](_0x41fef6[_0x2095('0x4f')],{'$or':_[_0x2095('0x3e')](_0x41fef6[_0x2095('0x48')],function(_0x183537){var _0x262f7c={};_0x262f7c[_0x183537]={'$like':'%'+_0x38f165[_0x2095('0x44')][_0x2095('0x51')]+'%'};return _0x262f7c;})});}_0x41fef6=_[_0x2095('0x52')]({},_0x41fef6,_0x38f165[_0x2095('0x53')]);return db[_0x2095('0x65')][_0x2095('0x30')]({'where':_0x41fef6[_0x2095('0x4f')]})[_0x2095('0x1e')](function(_0x541125){_0x28cba8[_0x2095('0x30')]=_0x541125;if(_0x38f165['query'][_0x2095('0x54')]){_0x41fef6['include']=[{'all':!![]}];}return db[_0x2095('0x65')][_0x2095('0x56')](_0x41fef6);})[_0x2095('0x1e')](function(_0x5bd018){_0x28cba8[_0x2095('0x57')]=_0x5bd018;return _0x28cba8;});}})[_0x2095('0x1e')](respondWithFilteredResult(_0x1298d8,_0x41fef6))[_0x2095('0x29')](handleError(_0x1298d8,null));};exports[_0x2095('0x68')]=function(_0x242e4b,_0x765239,_0x134254){return db[_0x2095('0x3f')][_0x2095('0x5b')]({'where':{'id':_0x242e4b['params']['id']}})[_0x2095('0x1e')](handleEntityNotFound(_0x765239,null))[_0x2095('0x1e')](function(_0x1568db){if(_0x1568db){return _0x1568db['removeDispositions'](_0x242e4b['query']['ids']);}})[_0x2095('0x1e')](respondWithStatusCode(_0x765239,null))[_0x2095('0x29')](handleError(_0x765239,null));};exports[_0x2095('0x69')]=function(_0x5cbc69,_0x3b02ea,_0x10cdf8){if(_0x5cbc69['body']['id']){delete _0x5cbc69[_0x2095('0x5c')]['id'];}return db[_0x2095('0x3f')][_0x2095('0x5b')]({'where':{'id':_0x5cbc69[_0x2095('0x59')]['id']}})[_0x2095('0x1e')](handleEntityNotFound(_0x3b02ea,null))[_0x2095('0x1e')](function(_0x5cfbee){if(_0x5cfbee){_0x5cbc69[_0x2095('0x5c')]['FaxAccountId']=_0x5cfbee['id'];return db[_0x2095('0x6a')][_0x2095('0x62')](_0x5cbc69[_0x2095('0x5c')]);}})[_0x2095('0x1e')](respondWithResult(_0x3b02ea,null))[_0x2095('0x29')](handleError(_0x3b02ea,null));};exports[_0x2095('0x6b')]=function(_0x3d5e67,_0x26031f,_0x5a55b1){var _0x336a4e={'raw':![],'where':{}};var _0x2a6eea={};var _0x1c7d5e={'count':0x0,'rows':[]};return db[_0x2095('0x3f')][_0x2095('0x67')]({'where':{'id':_0x3d5e67[_0x2095('0x59')]['id']}})[_0x2095('0x1e')](handleEntityNotFound(_0x26031f,null))[_0x2095('0x1e')](function(_0x5c7f07){if(_0x5c7f07){_0x2a6eea[_0x2095('0x47')]=_[_0x2095('0x45')](db[_0x2095('0x6a')]['rawAttributes']);_0x2a6eea['query']=_[_0x2095('0x45')](_0x3d5e67['query']);_0x2a6eea[_0x2095('0x46')]=_[_0x2095('0x49')](_0x2a6eea[_0x2095('0x47')],_0x2a6eea[_0x2095('0x44')]);_0x336a4e[_0x2095('0x48')]=_[_0x2095('0x49')](_0x2a6eea['model'],qs[_0x2095('0x4a')](_0x3d5e67[_0x2095('0x44')][_0x2095('0x4a')]));_0x336a4e[_0x2095('0x48')]=_0x336a4e['attributes'][_0x2095('0x6c')]?_0x336a4e['attributes']:_0x2a6eea[_0x2095('0x47')];if(!_0x3d5e67['query'][_0x2095('0x4b')](_0x2095('0x4c'))){_0x336a4e[_0x2095('0x31')]=qs[_0x2095('0x31')](_0x3d5e67[_0x2095('0x44')][_0x2095('0x31')]);_0x336a4e[_0x2095('0x2e')]=qs['offset'](_0x3d5e67[_0x2095('0x44')][_0x2095('0x2e')]);}_0x336a4e[_0x2095('0x4d')]=qs[_0x2095('0x4e')](_0x3d5e67[_0x2095('0x44')]['sort']);_0x336a4e[_0x2095('0x4f')]=qs[_0x2095('0x46')](_[_0x2095('0x50')](_0x3d5e67['query'],_0x2a6eea[_0x2095('0x46')]));_0x336a4e[_0x2095('0x4f')][_0x2095('0x6d')]=_0x5c7f07['id'];if(_0x3d5e67[_0x2095('0x44')]['filter']){_0x336a4e[_0x2095('0x4f')]=_[_0x2095('0x52')](_0x336a4e[_0x2095('0x4f')],{'$or':_['map'](_0x336a4e['attributes'],function(_0xca437e){var _0x1e99d1={};_0x1e99d1[_0xca437e]={'$like':'%'+_0x3d5e67[_0x2095('0x44')]['filter']+'%'};return _0x1e99d1;})});}_0x336a4e=_[_0x2095('0x52')]({},_0x336a4e,_0x3d5e67['options']);return db[_0x2095('0x6a')][_0x2095('0x30')]({'where':_0x336a4e[_0x2095('0x4f')]})['then'](function(_0x35e0ae){_0x1c7d5e['count']=_0x35e0ae;if(_0x3d5e67[_0x2095('0x44')][_0x2095('0x54')]){_0x336a4e[_0x2095('0x55')]=[{'all':!![]}];}return db[_0x2095('0x6a')][_0x2095('0x56')](_0x336a4e);})[_0x2095('0x1e')](function(_0x410538){_0x1c7d5e['rows']=_0x410538;return _0x1c7d5e;});}})[_0x2095('0x1e')](respondWithFilteredResult(_0x26031f,_0x336a4e))[_0x2095('0x29')](handleError(_0x26031f,null));};exports[_0x2095('0x6e')]=function(_0x37a76b,_0x521080,_0x43928f){return db[_0x2095('0x3f')][_0x2095('0x5b')]({'where':{'id':_0x37a76b['params']['id']}})[_0x2095('0x1e')](handleEntityNotFound(_0x521080,null))[_0x2095('0x1e')](function(_0xc84865){if(_0xc84865){return _0xc84865[_0x2095('0x6e')](_0x37a76b[_0x2095('0x44')][_0x2095('0x6f')]);}})['then'](respondWithStatusCode(_0x521080,null))[_0x2095('0x29')](handleError(_0x521080,null));};exports[_0x2095('0x70')]=function(_0x1f434d,_0x6883c2,_0x433ff0){return db[_0x2095('0x71')][_0x2095('0x5b')]({'where':{'id':_0x1f434d[_0x2095('0x59')]['id']}})[_0x2095('0x1e')](handleEntityNotFound(_0x6883c2,null))[_0x2095('0x1e')](function(_0x2a8a6e){if(_0x2a8a6e){return _0x2a8a6e[_0x2095('0x70')](_0x1f434d[_0x2095('0x5c')][_0x2095('0x6f')],_[_0x2095('0x72')](_0x1f434d[_0x2095('0x5c')],[_0x2095('0x6f'),'id'])||{});}})[_0x2095('0x1e')](respondWithResult(_0x6883c2,null))[_0x2095('0x29')](handleError(_0x6883c2,null));};exports[_0x2095('0x73')]=function(_0x56868c,_0x357133,_0x34ae8f){var _0x538048={'raw':![],'where':{}};var _0x48fd30={};var _0x17d87b={'count':0x0,'rows':[]};return db[_0x2095('0x3f')][_0x2095('0x67')]({'where':{'id':_0x56868c['params']['id']}})[_0x2095('0x1e')](handleEntityNotFound(_0x357133,null))[_0x2095('0x1e')](function(_0x3c0ba0){if(_0x3c0ba0){_0x48fd30[_0x2095('0x47')]=_['keys'](db['FaxInteraction'][_0x2095('0x40')]);_0x48fd30[_0x2095('0x44')]=_['keys'](_0x56868c[_0x2095('0x44')]);_0x48fd30[_0x2095('0x46')]=_[_0x2095('0x49')](_0x48fd30['model'],_0x48fd30['query']);_0x538048['attributes']=_[_0x2095('0x49')](_0x48fd30['model'],qs['fields'](_0x56868c[_0x2095('0x44')][_0x2095('0x4a')]));_0x538048[_0x2095('0x48')]=_0x538048[_0x2095('0x48')][_0x2095('0x6c')]?_0x538048[_0x2095('0x48')]:_0x48fd30[_0x2095('0x47')];if(!_0x56868c[_0x2095('0x44')][_0x2095('0x4b')](_0x2095('0x4c'))){_0x538048[_0x2095('0x31')]=qs['limit'](_0x56868c[_0x2095('0x44')]['limit']);_0x538048[_0x2095('0x2e')]=qs[_0x2095('0x2e')](_0x56868c[_0x2095('0x44')][_0x2095('0x2e')]);}_0x538048[_0x2095('0x4d')]=qs['sort'](_0x56868c[_0x2095('0x44')]['sort']);_0x538048[_0x2095('0x4f')]=qs[_0x2095('0x46')](_[_0x2095('0x50')](_0x56868c['query'],_0x48fd30[_0x2095('0x46')]));_0x538048[_0x2095('0x4f')][_0x2095('0x6d')]=_0x3c0ba0['id'];if(_0x56868c[_0x2095('0x44')][_0x2095('0x51')]){_0x538048[_0x2095('0x4f')]=_[_0x2095('0x52')](_0x538048[_0x2095('0x4f')],{'$or':_[_0x2095('0x3e')](_0x538048[_0x2095('0x48')],function(_0x3f3fea){var _0x3af6f2={};_0x3af6f2[_0x3f3fea]={'$like':'%'+_0x56868c['query'][_0x2095('0x51')]+'%'};return _0x3af6f2;})});}_0x538048=_[_0x2095('0x52')]({},_0x538048,_0x56868c[_0x2095('0x53')]);return db[_0x2095('0x71')][_0x2095('0x30')]({'where':_0x538048[_0x2095('0x4f')]})[_0x2095('0x1e')](function(_0x153fb0){_0x17d87b[_0x2095('0x30')]=_0x153fb0;if(_0x56868c[_0x2095('0x44')][_0x2095('0x54')]){_0x538048[_0x2095('0x55')]=[{'model':db['CmContact'],'as':_0x2095('0x74'),'required':![]},{'model':db[_0x2095('0x75')],'as':_0x2095('0x76'),'attributes':['name','fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0x2095('0x77'),'attributes':['id',_0x2095('0x3b'),_0x2095('0x78')],'where':_0x56868c[_0x2095('0x44')][_0x2095('0x79')]?{'id':_0x56868c['query'][_0x2095('0x79')]}:undefined,'required':_0x56868c[_0x2095('0x44')]['tag']?!![]:![]}];}return db[_0x2095('0x71')]['findAll'](_0x538048);})['then'](function(_0x23c465){_0x17d87b[_0x2095('0x57')]=_0x23c465;return _0x17d87b;});}})[_0x2095('0x1e')](respondWithFilteredResult(_0x357133,_0x538048))[_0x2095('0x29')](handleError(_0x357133,null));};exports[_0x2095('0x7a')]=function(_0x379bc5,_0x41825c){var _0x29fd9b=_0x379bc5['params']['id'];var _0x444f79=_0x379bc5['body'];var _0x4bc129=0xc8;var _0x1cfa75=null;return db[_0x2095('0x7b')][_0x2095('0x7c')]({'isolationLevel':db[_0x2095('0x7b')]['Transaction'][_0x2095('0x7d')][_0x2095('0x7e')]},function(_0x359f87){return db[_0x2095('0x3f')][_0x2095('0x67')]({'where':{'id':_0x29fd9b},'transaction':_0x359f87})[_0x2095('0x1e')](function(_0x559800){if(_0x559800){return db[_0x2095('0x7f')]['destroy']({'where':{'FaxAccountId':_0x29fd9b},'transaction':_0x359f87})['then'](function(){var _0x12b4d2=_[_0x2095('0x3e')](_0x444f79,function(_0x200b0e){_0x200b0e[_0x2095('0x6d')]=_0x29fd9b;return _0x200b0e;});return db[_0x2095('0x7f')][_0x2095('0x80')](_0x12b4d2,{'transaction':_0x359f87});});}else{_0x4bc129=0x194;_0x1cfa75=[];}});})[_0x2095('0x1e')](function(){if(_0x4bc129!==0x194){return db['FaxApplication'][_0x2095('0x81')]({'where':{'FaxAccountId':_0x29fd9b},'order':_0x2095('0x82')})[_0x2095('0x1e')](function(_0x9fe5c6){_0x1cfa75=_0x9fe5c6;});}})[_0x2095('0x29')](function(_0x593de3){_0x4bc129=0x1f4;logger['error'](_0x593de3[_0x2095('0x3a')]);if(_0x593de3['name']){delete _0x593de3[_0x2095('0x3b')];}_0x1cfa75=_0x593de3;})['finally'](function(){if(_0x1cfa75===null){_0x41825c[_0x2095('0x2a')](_0x4bc129);}else{if(_0x4bc129===0x1f4){_0x41825c['status'](_0x4bc129)['send'](_0x1cfa75);}else{_0x41825c['status'](_0x4bc129)['json'](_0x1cfa75);}}});};exports[_0x2095('0x83')]=function(_0xe2630b,_0x46b9dd,_0x1dfc9e){var _0x4302a4={};var _0x20f4c1={};var _0x53dde8;var _0x5007fb;return db[_0x2095('0x3f')]['findOne']({'where':{'id':_0xe2630b[_0x2095('0x59')]['id']}})['then'](handleEntityNotFound(_0x46b9dd,null))[_0x2095('0x1e')](function(_0x2fe47c){if(_0x2fe47c){_0x53dde8=_0x2fe47c;_0x20f4c1[_0x2095('0x47')]=_['keys'](db[_0x2095('0x7f')][_0x2095('0x40')]);_0x20f4c1['query']=_[_0x2095('0x45')](_0xe2630b[_0x2095('0x44')]);_0x20f4c1['filters']=_[_0x2095('0x49')](_0x20f4c1[_0x2095('0x47')],_0x20f4c1[_0x2095('0x44')]);_0x4302a4[_0x2095('0x48')]=_['intersection'](_0x20f4c1[_0x2095('0x47')],qs['fields'](_0xe2630b[_0x2095('0x44')]['fields']));_0x4302a4[_0x2095('0x48')]=_0x4302a4[_0x2095('0x48')][_0x2095('0x6c')]?_0x4302a4['attributes']:_0x20f4c1[_0x2095('0x47')];_0x4302a4['order']=qs[_0x2095('0x4e')](_0xe2630b[_0x2095('0x44')][_0x2095('0x4e')]);_0x4302a4[_0x2095('0x4f')]=qs[_0x2095('0x46')](_['pick'](_0xe2630b[_0x2095('0x44')],_0x20f4c1[_0x2095('0x46')]));if(_0xe2630b[_0x2095('0x44')]['filter']){_0x4302a4[_0x2095('0x4f')]=_[_0x2095('0x52')](_0x4302a4[_0x2095('0x4f')],{'$or':_[_0x2095('0x3e')](_0x4302a4[_0x2095('0x48')],function(_0x590414){var _0x3447fe={};_0x3447fe[_0x590414]={'$like':'%'+_0xe2630b['query'][_0x2095('0x51')]+'%'};return _0x3447fe;})});}_0x4302a4=_[_0x2095('0x52')]({},_0x4302a4,_0xe2630b[_0x2095('0x53')]);return _0x53dde8[_0x2095('0x83')](_0x4302a4);}})[_0x2095('0x1e')](function(_0x1345ee){if(_0x1345ee){_0x5007fb=_0x1345ee[_0x2095('0x6c')];if(!_0xe2630b['query'][_0x2095('0x4b')](_0x2095('0x4c'))){_0x4302a4[_0x2095('0x31')]=qs[_0x2095('0x31')](_0xe2630b[_0x2095('0x44')][_0x2095('0x31')]);_0x4302a4[_0x2095('0x2e')]=qs['offset'](_0xe2630b[_0x2095('0x44')][_0x2095('0x2e')]);}return _0x53dde8['getApplications'](_0x4302a4);}})[_0x2095('0x1e')](function(_0x456270){if(_0x456270){return _0x456270?{'count':_0x5007fb,'rows':_0x456270}:null;}})[_0x2095('0x1e')](respondWithResult(_0x46b9dd,null))[_0x2095('0x29')](handleError(_0x46b9dd,null));};function Extension(_0x5150b6,_0x4b48bf,_0x52b80d,_0x42a015){this['context']=_0x2095('0x84');this[_0x2095('0x85')]=_0x5150b6[_0x2095('0x86')];this[_0x2095('0x87')]=_0x42a015;this[_0x2095('0x42')]=_0x2095('0x88');this['description']=_0x2095('0x89');this[_0x2095('0x6d')]=_0x5150b6['id'];this[_0x2095('0x82')]=_0x4b48bf;this[_0x2095('0x8a')]=_0x52b80d;}function createExtensionsReciveFax(_0x2c3eb1){var _0xedb780=0x1;var _0x16c072=[];_0x16c072[_0x2095('0x8b')](new Extension(_0x2c3eb1,_0xedb780,'',_0x2095('0x8c')));_0xedb780+=0x1;_0x16c072['push'](new Extension(_0x2c3eb1,_0xedb780,_0x2095('0x8d'),'Set'));_0xedb780+=0x1;for(var _0xaf3f6a in _0x2c3eb1){if(_0x2c3eb1['hasOwnProperty'](_0xaf3f6a)&&(_0xaf3f6a===_0x2095('0x8e')||_0xaf3f6a===_0x2095('0x86')||_0xaf3f6a===_0x2095('0x8f')||_0xaf3f6a===_0x2095('0x90')||_0xaf3f6a==='headerinfo'||_0xaf3f6a===_0x2095('0x91')||_0xaf3f6a===_0x2095('0x92')||_0xaf3f6a===_0x2095('0x93')||_0xaf3f6a===_0x2095('0x94'))){_0x16c072['push'](new Extension(_0x2c3eb1,_0xedb780,_0x2095('0x95')+_0xaf3f6a+')='+_0x2c3eb1[_0xaf3f6a],_0x2095('0x96')));_0xedb780+=0x1;}}_0x16c072[_0x2095('0x8b')](new Extension(_0x2c3eb1,_0xedb780,'6',_0x2095('0x97')));_0xedb780+=0x1;_0x16c072[_0x2095('0x8b')](new Extension(_0x2c3eb1,_0xedb780,_0x2095('0x98'),_0x2095('0x99')));_0xedb780=0x0;return _0x16c072;}exports['addAccountApplications']=function(_0xdc98b4,_0x5a9ab2,_0x3d4eef){var _0x4f84cf;return db[_0x2095('0x7b')][_0x2095('0x7c')](function(_0x332032){return db[_0x2095('0x3f')][_0x2095('0x62')](_0xdc98b4['body'],{'transaction':_0x332032})[_0x2095('0x1e')](function(_0xd888c7){_0x4f84cf=_0xd888c7[_0x2095('0x37')]({'plain':!![]});return db[_0x2095('0x9a')][_0x2095('0x80')](createExtensionsReciveFax(_0x4f84cf),{'transaction':_0x332032});});})['then'](function(){return _0x4f84cf;})[_0x2095('0x1e')](respondWithResult(_0x5a9ab2,null))[_0x2095('0x29')](handleError(_0x5a9ab2,null));};exports[_0x2095('0x9b')]=function(_0x15a254,_0x5c0533,_0xeb007c){var _0x420767;return db[_0x2095('0x7b')][_0x2095('0x7c')](function(_0x308262){return db[_0x2095('0x3f')][_0x2095('0x36')](_0x15a254[_0x2095('0x5c')],{'where':{'id':_0x15a254[_0x2095('0x5c')]['id']},'transaction':_0x308262})['then'](function(_0x3fe611){return db[_0x2095('0x9a')][_0x2095('0x39')]({'where':{'FaxAccountId':_0x15a254[_0x2095('0x5c')]['id']},'transaction':_0x308262})[_0x2095('0x1e')](function(_0x4ec373){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0x2095('0x72')](_0x15a254[_0x2095('0x5c')],[_0x2095('0x9c'),'key',_0x2095('0x9d'),_0x2095('0x9e'),'TrunkId',_0x2095('0x9f')])),{'transaction':_0x308262});});});})[_0x2095('0x1e')](function(){return db[_0x2095('0x3f')][_0x2095('0xa0')](_0x15a254['body']['id']);})[_0x2095('0x1e')](respondWithResult(_0x5c0533,null))[_0x2095('0x29')](handleError(_0x5c0533,null));};exports[_0x2095('0xa1')]=function(_0x482b8c,_0x50b4d7,_0x1105ce){var _0x39dc00={'raw':!![],'where':{}};var _0xa4384a={};var _0x1dc88b={'count':0x0,'rows':[]};return db[_0x2095('0x3f')][_0x2095('0x67')]({'where':{'id':_0x482b8c[_0x2095('0x59')]['id']}})[_0x2095('0x1e')](handleEntityNotFound(_0x50b4d7,null))[_0x2095('0x1e')](function(_0x48b005){if(_0x48b005){_0xa4384a['model']=_['keys'](db[_0x2095('0xa2')][_0x2095('0x40')]);_0xa4384a[_0x2095('0x44')]=_[_0x2095('0x45')](_0x482b8c[_0x2095('0x44')]);_0xa4384a[_0x2095('0x46')]=_['intersection'](_0xa4384a[_0x2095('0x47')],_0xa4384a[_0x2095('0x44')]);_0x39dc00[_0x2095('0x48')]=_[_0x2095('0x49')](_0xa4384a[_0x2095('0x47')],qs[_0x2095('0x4a')](_0x482b8c['query'][_0x2095('0x4a')]));_0x39dc00[_0x2095('0x48')]=_0x39dc00[_0x2095('0x48')][_0x2095('0x6c')]?_0x39dc00[_0x2095('0x48')]:_0xa4384a[_0x2095('0x47')];if(!_0x482b8c['query'][_0x2095('0x4b')]('nolimit')){_0x39dc00[_0x2095('0x31')]=qs[_0x2095('0x31')](_0x482b8c[_0x2095('0x44')][_0x2095('0x31')]);_0x39dc00['offset']=qs[_0x2095('0x2e')](_0x482b8c[_0x2095('0x44')][_0x2095('0x2e')]);}_0x39dc00['order']=qs['sort'](_0x482b8c[_0x2095('0x44')][_0x2095('0x4e')]);_0x39dc00[_0x2095('0x4f')]=qs[_0x2095('0x46')](_[_0x2095('0x50')](_0x482b8c[_0x2095('0x44')],_0xa4384a[_0x2095('0x46')]));_0x39dc00[_0x2095('0x4f')]['FaxAccountId']=_0x48b005['id'];if(_0x482b8c[_0x2095('0x44')][_0x2095('0x51')]){_0x39dc00[_0x2095('0x4f')]=_[_0x2095('0x52')](_0x39dc00['where'],{'$or':_[_0x2095('0x3e')](_0x39dc00[_0x2095('0x48')],function(_0x3aa590){var _0x24323d={};_0x24323d[_0x3aa590]={'$like':'%'+_0x482b8c['query'][_0x2095('0x51')]+'%'};return _0x24323d;})});}if(_0x482b8c['query'][_0x2095('0xa3')]){var _0xe071f8=_0x482b8c[_0x2095('0x44')][_0x2095('0xa3')]['split'](',');var _0x35580e={};_0x35580e[_0xe071f8[0x0]]={'$gte':moment(_0xe071f8[0x1])['format'](_0x2095('0xa4'))};_0x39dc00[_0x2095('0x4f')]=_[_0x2095('0x52')](_0x39dc00['where'],_0x35580e);}_0x39dc00=_[_0x2095('0x52')]({},_0x39dc00,_0x482b8c[_0x2095('0x53')]);return db[_0x2095('0xa2')][_0x2095('0x30')]({'where':_0x39dc00[_0x2095('0x4f')]})[_0x2095('0x1e')](function(_0x2719ba){_0x1dc88b[_0x2095('0x30')]=_0x2719ba;if(_0x482b8c[_0x2095('0x44')]['includeAll']){_0x39dc00[_0x2095('0x55')]=[{'all':!![]}];}return db['FaxMessage'][_0x2095('0x56')](_0x39dc00);})[_0x2095('0x1e')](function(_0x2224dd){_0x1dc88b['rows']=_0x2224dd;return _0x1dc88b;});}})['then'](respondWithFilteredResult(_0x50b4d7,_0x39dc00))['catch'](handleError(_0x50b4d7,null));};exports[_0x2095('0xa5')]=function(_0x3b3899,_0x277b7f,_0x58d01){var _0x3b04a5,_0x302d76={},_0x3c3685;if(_0x3b3899[_0x2095('0x5c')]['to']){_0x3c3685=_0x3b3899[_0x2095('0x5c')]['to'][0x0];}return db[_0x2095('0x3f')][_0x2095('0x5b')]({'where':{'id':_0x3b3899['params']['id']},'include':[{'model':db['CmList'],'as':_0x2095('0xa6'),'include':[{'model':db['CmContact'],'as':_0x2095('0xa7'),'where':{'fax':_0x3c3685},'limit':0x1,'order':[[_0x2095('0x9e'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x277b7f,null))['then'](function(_0xd68f2c){_0x3b04a5=_0xd68f2c;if(_0x3b3899['body'][_0x2095('0xa8')]&&_0x3b3899['body'][_0x2095('0xa8')][_0x2095('0x6c')]){for(var _0x24a21=0x0;_0x24a21<_0x3b3899[_0x2095('0x5c')]['attachments']['length'];_0x24a21+=0x1){_0x3b3899[_0x2095('0x5c')]['attachments'][_0x24a21]={'filename':_0x3b3899[_0x2095('0x5c')][_0x2095('0xa8')][_0x24a21][_0x2095('0x3b')],'id':_0x3b3899['body']['attachments'][_0x24a21]['id'],'path':path[_0x2095('0xa9')](config[_0x2095('0xaa')],_0x2095('0xab'),_0x3b3899[_0x2095('0x5c')][_0x2095('0xa8')][_0x24a21][_0x2095('0xac')])};}}return respondWithRpcPromise(_0x2095('0xad'),_0x2095('0xad'),{'FaxAccountId':_[_0x2095('0xae')](_0x3b3899['params']['id'])?undefined:_0x3b3899['params']['id'],'path':_[_0x2095('0xae')](_0x3b3899['body'][_0x2095('0xa8')][0x0][_0x2095('0x4')])?undefined:_0x3b3899[_0x2095('0x5c')][_0x2095('0xa8')][0x0]['path'],'fax':_[_0x2095('0xae')](_0x3b3899[_0x2095('0x5c')]['to'][0x0])?undefined:_0x3b3899[_0x2095('0x5c')]['to'][0x0]},client9002);})['then'](function(){if(_0x3b04a5){if(_['isNil'](_0x3b3899[_0x2095('0x5c')][_0x2095('0xaf')])){_0x3b3899[_0x2095('0x5c')][_0x2095('0xaf')]=util[_0x2095('0xb0')](_0x2095('0xb1'),_0x3b04a5[_0x2095('0x3b')],_0x3b04a5[_0x2095('0xb2')]);}if(_0x3b04a5[_0x2095('0xa6')]){if(_0x3b04a5[_0x2095('0xa6')]['Contacts'][_0x2095('0x6c')]){return _0x3b04a5[_0x2095('0xa6')]['Contacts'][0x0];}else{return db[_0x2095('0xb3')][_0x2095('0x62')](_[_0x2095('0x17')](_0x3b3899[_0x2095('0x5c')],{'firstName':_0x3b3899[_0x2095('0x5c')]['to'][0x0],'phone':_0x3b3899['body']['to'][0x0],'fax':_0x3b3899[_0x2095('0x5c')]['to'][0x0],'ListId':_0x3b04a5[_0x2095('0x9f')]}));}}else{throw new Error(_0x2095('0xb4'));}}else{throw new Error(_0x2095('0xb5'));}})['then'](function(_0x289c8a){if(_0x289c8a){return db[_0x2095('0x71')][_0x2095('0x5b')]({'where':{'ContactId':_0x289c8a['id'],'closed':![],'FaxAccountId':_0x3b04a5['id']}})[_0x2095('0x1e')](function(_0x5244c0){if(_0x5244c0){return[_0x5244c0,![]];}return db['FaxInteraction'][_0x2095('0x62')]({'UserId':_0x3b3899[_0x2095('0xb6')]['id'],'ContactId':_0x289c8a['id'],'FaxAccountId':_0x3b04a5['id'],'fax':_0x3b3899[_0x2095('0x5c')]['to'][0x0],'firstMsgDirection':_0x2095('0xb7'),'Messages':[_[_0x2095('0x52')](_0x3b3899[_0x2095('0x5c')],{'read':![],'body':_0x3b3899[_0x2095('0x5c')][_0x2095('0xa8')][0x0]['filename'],'FaxAccountId':_0x3b04a5['id'],'UserId':_0x3b3899['user']['id'],'ContactId':_0x289c8a['id'],'AttachmentId':_0x3b3899['body'][_0x2095('0xa8')][0x0]['id']})]},{'include':[{'model':db[_0x2095('0xa2')],'as':_0x2095('0xb8')}]})[_0x2095('0x1e')](function(_0x4d2b13){return[_0x4d2b13,!![]];});});}else{throw new Error(_0x2095('0xb9'));}})[_0x2095('0xba')](function(_0x50b682,_0x2810e6){if(_0x2810e6){return _0x50b682;}return db[_0x2095('0xa2')][_0x2095('0x62')]({'direction':'out','read':![],'body':_0x3b3899[_0x2095('0x5c')][_0x2095('0xa8')][0x0][_0x2095('0xbb')],'FaxAccountId':_0x3b04a5['id'],'FaxInteractionId':_0x50b682['id'],'UserId':_0x3b3899[_0x2095('0xb6')]['id'],'ContactId':_0x50b682[_0x2095('0xbc')],'AttachmentId':_0x3b3899[_0x2095('0x5c')][_0x2095('0xa8')][0x0]['id']})['then'](function(_0x45ad93){_0x50b682['dataValues'][_0x2095('0xb8')]=[];_0x50b682[_0x2095('0xbd')]['Messages'][_0x2095('0x8b')](_0x45ad93[_0x2095('0xbd')]);return _0x50b682;});})[_0x2095('0x1e')](function(_0x37a02d){respondWithRpcPromise(_0x2095('0xbe'),'SendFax',{'FaxAccountId':_[_0x2095('0xae')](_0x3b3899[_0x2095('0x59')]['id'])?undefined:_0x3b3899[_0x2095('0x59')]['id'],'path':_['isNil'](_0x3b3899[_0x2095('0x5c')][_0x2095('0xa8')][0x0][_0x2095('0x4')])?undefined:_0x3b3899[_0x2095('0x5c')]['attachments'][0x0][_0x2095('0x4')],'fax':_['isNil'](_0x3b3899[_0x2095('0x5c')]['to'][0x0])?undefined:_0x3b3899['body']['to'][0x0],'AttachmentId':_0x3b3899[_0x2095('0x5c')]['attachments'][0x0]['id']},client9002)[_0x2095('0x1e')](function(_0x5646b6){logger[_0x2095('0x1f')](_0x2095('0xbf'),_0x5646b6);})[_0x2095('0x29')](function(_0x4dc788){logger[_0x2095('0x1f')](_0x2095('0xbf'),_0x4dc788);});return _0x37a02d;})[_0x2095('0x1e')](respondWithResult(_0x277b7f,null))[_0x2095('0x29')](handleError(_0x277b7f,null));};exports['addAgents']=function(_0x5f11e9,_0x91125f,_0x552472){return db[_0x2095('0x3f')][_0x2095('0x5b')]({'where':{'id':_0x5f11e9[_0x2095('0x59')]['id']}})[_0x2095('0x1e')](handleEntityNotFound(_0x91125f,null))[_0x2095('0x1e')](function(_0x1f7cc5){if(_0x1f7cc5){return _0x1f7cc5[_0x2095('0xc0')](_0x5f11e9['body'][_0x2095('0x6f')],_[_0x2095('0x72')](_0x5f11e9[_0x2095('0x5c')],[_0x2095('0x6f'),'id'])||{})['spread'](function(_0x36bfab){for(var _0x3ae08a=0x0;_0x3ae08a<_0x5f11e9[_0x2095('0x5c')][_0x2095('0x6f')][_0x2095('0x6c')];_0x3ae08a+=0x1){socket['emit'](_0x2095('0xc1'),{'UserId':Number(_0x5f11e9[_0x2095('0x5c')][_0x2095('0x6f')][_0x3ae08a]),'FaxAccountId':Number(_0x5f11e9['params']['id'])});}return _0x36bfab;});}})[_0x2095('0x1e')](respondWithResult(_0x91125f,null))[_0x2095('0x29')](handleError(_0x91125f,null));};exports[_0x2095('0xc2')]=function(_0x5c927c,_0x359be1,_0x3262c8){return db[_0x2095('0x3f')]['find']({'where':{'id':_0x5c927c[_0x2095('0x59')]['id']}})[_0x2095('0x1e')](handleEntityNotFound(_0x359be1,null))[_0x2095('0x1e')](function(_0x59bdd9){if(_0x59bdd9){return _0x59bdd9[_0x2095('0xc2')](_0x5c927c['query'][_0x2095('0x6f')])[_0x2095('0x1e')](function(){if(_[_0x2095('0xc3')](_0x5c927c['query']['ids'])){for(var _0x2d9955=0x0;_0x2d9955<_0x5c927c[_0x2095('0x44')][_0x2095('0x6f')]['length'];_0x2d9955+=0x1){socket[_0x2095('0xc4')](_0x2095('0xc5'),{'UserId':Number(_0x5c927c['query'][_0x2095('0x6f')][_0x2d9955]),'FaxAccountId':Number(_0x5c927c[_0x2095('0x59')]['id'])});}}else{socket[_0x2095('0xc4')](_0x2095('0xc5'),{'UserId':Number(_0x5c927c['query']['ids']),'FaxAccountId':Number(_0x5c927c[_0x2095('0x59')]['id'])});}});}})[_0x2095('0x1e')](respondWithStatusCode(_0x359be1,null))[_0x2095('0x29')](handleError(_0x359be1,null));};exports[_0x2095('0xc6')]=function(_0xadddea,_0x4b1eba,_0x14d3fa){var _0xd248d5={};var _0x48ffab={};var _0x11f480;var _0x13d595;return db['FaxAccount'][_0x2095('0x67')]({'where':{'id':_0xadddea[_0x2095('0x59')]['id']}})['then'](handleEntityNotFound(_0x4b1eba,null))['then'](function(_0x452039){if(_0x452039){_0x11f480=_0x452039;_0x48ffab[_0x2095('0x47')]=_[_0x2095('0x45')](db[_0x2095('0x75')][_0x2095('0x40')]);_0x48ffab['query']=_[_0x2095('0x45')](_0xadddea[_0x2095('0x44')]);_0x48ffab[_0x2095('0x46')]=_[_0x2095('0x49')](_0x48ffab[_0x2095('0x47')],_0x48ffab[_0x2095('0x44')]);_0xd248d5['attributes']=_[_0x2095('0x49')](_0x48ffab[_0x2095('0x47')],qs[_0x2095('0x4a')](_0xadddea[_0x2095('0x44')][_0x2095('0x4a')]));_0xd248d5[_0x2095('0x48')]=_0xd248d5[_0x2095('0x48')][_0x2095('0x6c')]?_0xd248d5[_0x2095('0x48')]:_0x48ffab[_0x2095('0x47')];_0xd248d5[_0x2095('0x4d')]=qs[_0x2095('0x4e')](_0xadddea[_0x2095('0x44')][_0x2095('0x4e')]);_0xd248d5[_0x2095('0x4f')]=qs[_0x2095('0x46')](_[_0x2095('0x50')](_0xadddea[_0x2095('0x44')],_0x48ffab['filters']));if(_0xadddea['query'][_0x2095('0x51')]){_0xd248d5[_0x2095('0x4f')]=_[_0x2095('0x52')](_0xd248d5['where'],{'$or':_[_0x2095('0x3e')](_0xd248d5[_0x2095('0x48')],function(_0x5b4693){var _0x11f98a={};_0x11f98a[_0x5b4693]={'$like':'%'+_0xadddea[_0x2095('0x44')][_0x2095('0x51')]+'%'};return _0x11f98a;})});}_0xd248d5=_[_0x2095('0x52')]({},_0xd248d5,_0xadddea['options']);return _0x11f480[_0x2095('0xc6')](_0xd248d5);}})[_0x2095('0x1e')](function(_0x27eb28){if(_0x27eb28){_0x13d595=_0x27eb28[_0x2095('0x6c')];if(!_0xadddea[_0x2095('0x44')][_0x2095('0x4b')]('nolimit')){_0xd248d5[_0x2095('0x31')]=qs['limit'](_0xadddea[_0x2095('0x44')][_0x2095('0x31')]);_0xd248d5[_0x2095('0x2e')]=qs[_0x2095('0x2e')](_0xadddea['query']['offset']);}return _0x11f480[_0x2095('0xc6')](_0xd248d5);}})[_0x2095('0x1e')](function(_0x54e7d0){if(_0x54e7d0){return _0x54e7d0?{'count':_0x13d595,'rows':_0x54e7d0}:null;}})[_0x2095('0x1e')](respondWithResult(_0x4b1eba,null))[_0x2095('0x29')](handleError(_0x4b1eba,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 0649ebb..bf89284 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 _0xbf10=['update','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x178690,_0x20be65){var _0x4b4ca8=function(_0x121aeb){while(--_0x121aeb){_0x178690['push'](_0x178690['shift']());}};_0x4b4ca8(++_0x20be65);}(_0xbf10,0x114));var _0x0bf1=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xbf10[_0x47e7cb];return _0x2a8874;};'use strict';var EventEmitter=require(_0x0bf1('0x0'));var FaxAccount=require(_0x0bf1('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0bf1('0x2')](0x0);var events={'afterCreate':_0x0bf1('0x3'),'afterUpdate':_0x0bf1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3a76c8){return function(_0x42f709,_0x27b12c,_0x565dd6){FaxAccountEvents[_0x0bf1('0x5')](_0x3a76c8+':'+_0x42f709['id'],_0x42f709);FaxAccountEvents[_0x0bf1('0x5')](_0x3a76c8,_0x42f709);_0x565dd6(null);};}for(var e in events){if(events[_0x0bf1('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x0bf1('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x9478=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount'];(function(_0x4d9403,_0x33c5f0){var _0x5eef11=function(_0x50bb5c){while(--_0x50bb5c){_0x4d9403['push'](_0x4d9403['shift']());}};_0x5eef11(++_0x33c5f0);}(_0x9478,0x15b));var _0x8947=function(_0x3fd885,_0x47925b){_0x3fd885=_0x3fd885-0x0;var _0x2489ca=_0x9478[_0x3fd885];return _0x2489ca;};'use strict';var EventEmitter=require(_0x8947('0x0'));var FaxAccount=require(_0x8947('0x1'))['db'][_0x8947('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x8947('0x3')](0x0);var events={'afterCreate':_0x8947('0x4'),'afterUpdate':_0x8947('0x5'),'afterDestroy':'remove'};function emitEvent(_0x45510b){return function(_0x535070,_0x2db57c,_0x189f26){FaxAccountEvents[_0x8947('0x6')](_0x45510b+':'+_0x535070['id'],_0x535070);FaxAccountEvents[_0x8947('0x6')](_0x45510b,_0x535070);_0x189f26(null);};}for(var e in events){if(events[_0x8947('0x7')](e)){var event=events[e];FaxAccount[_0x8947('0x8')](e,emitEvent(event));}}module[_0x8947('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 00ff885..90bc944 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 _0x86c0=['api','moment','bluebird','request-promise','../../config/environment','exports','define','FaxAccount','fax_accounts','../../config/logger'];(function(_0x4a09c6,_0x54ce5e){var _0x25d834=function(_0x272ccc){while(--_0x272ccc){_0x4a09c6['push'](_0x4a09c6['shift']());}};_0x25d834(++_0x54ce5e);}(_0x86c0,0xe5));var _0x086c=function(_0x1c288b,_0x377b72){_0x1c288b=_0x1c288b-0x0;var _0x5d9225=_0x86c0[_0x1c288b];return _0x5d9225;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x086c('0x0'))(_0x086c('0x1'));var moment=require(_0x086c('0x2'));var BPromise=require(_0x086c('0x3'));var rp=require(_0x086c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x086c('0x5'));var attributes=require('./faxAccount.attributes');module[_0x086c('0x6')]=function(_0x56c3c9,_0x347586){return _0x56c3c9[_0x086c('0x7')](_0x086c('0x8'),attributes,{'tableName':_0x086c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1734=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','moment'];(function(_0x1dcdc1,_0x2fdd77){var _0x24a48c=function(_0x165b28){while(--_0x165b28){_0x1dcdc1['push'](_0x1dcdc1['shift']());}};_0x24a48c(++_0x2fdd77);}(_0x1734,0x64));var _0x4173=function(_0x3afa9f,_0x52b854){_0x3afa9f=_0x3afa9f-0x0;var _0x4ff5e0=_0x1734[_0x3afa9f];return _0x4ff5e0;};'use strict';var _=require(_0x4173('0x0'));var util=require(_0x4173('0x1'));var logger=require(_0x4173('0x2'))('api');var moment=require(_0x4173('0x3'));var BPromise=require(_0x4173('0x4'));var rp=require(_0x4173('0x5'));var fs=require('fs');var path=require(_0x4173('0x6'));var rimraf=require(_0x4173('0x7'));var config=require(_0x4173('0x8'));var attributes=require('./faxAccount.attributes');module[_0x4173('0x9')]=function(_0x2c39b6,_0x2f759d){return _0x2c39b6[_0x4173('0xa')](_0x4173('0xb'),attributes,{'tableName':_0x4173('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 1483657..c409604 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 _0xd4a4=['waitForTheAssignedQueue','Start','startRouting','util','bluebird','ioredis','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./faxAccount.socket','request','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','FaxAccount','options','raw','where','limit','include','map','model','attributes','info','GetFaxAccount','stringify','NotifyFaxAccount','body','fax','CmContact','then','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','orderBy','priority','asc','length','create','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','queueId','FaxQueue','name','unshift','queue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4a4,0xbb));var _0x4d4a=function(_0x58572c,_0x386076){_0x58572c=_0x58572c-0x0;var _0x1ce1e2=_0xd4a4[_0x58572c];return _0x1ce1e2;};'use strict';var _=require('lodash');var util=require(_0x4d4a('0x0'));var moment=require('moment');var BPromise=require(_0x4d4a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d4a('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4d4a('0x3'));var jayson=require(_0x4d4a('0x4'));var client=jayson['client'][_0x4d4a('0x5')]({'port':0x232c});config[_0x4d4a('0x6')]=_[_0x4d4a('0x7')](config[_0x4d4a('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x4d4a('0x8'))(new Redis(config[_0x4d4a('0x6')]));require(_0x4d4a('0x9'))['register'](socket);function respondWithRpcPromise(_0x168550,_0x52a4bb,_0x57c8bb){return new BPromise(function(_0x180d05,_0x56baf9){return client[_0x4d4a('0xa')](_0x168550,_0x57c8bb)['then'](function(_0x518006){logger['info'](_0x4d4a('0xb'),_0x52a4bb,'request\x20sent');logger[_0x4d4a('0xc')](_0x4d4a('0xd'),_0x52a4bb,'request\x20sent',JSON['stringify'](_0x518006));if(_0x518006[_0x4d4a('0xe')]){if(_0x518006[_0x4d4a('0xe')][_0x4d4a('0xf')]===0x1f4){logger[_0x4d4a('0xe')](_0x4d4a('0xb'),_0x52a4bb,_0x518006[_0x4d4a('0xe')][_0x4d4a('0x10')]);return _0x56baf9(_0x518006[_0x4d4a('0xe')][_0x4d4a('0x10')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x52a4bb,_0x518006[_0x4d4a('0xe')]['message']);return _0x180d05(_0x518006[_0x4d4a('0xe')][_0x4d4a('0x10')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x52a4bb,_0x4d4a('0x11'));_0x180d05(_0x518006[_0x4d4a('0x12')][_0x4d4a('0x10')]);}})[_0x4d4a('0x13')](function(_0x55b0c8){logger['error']('FaxAccount,\x20%s,\x20%s',_0x52a4bb,_0x55b0c8);_0x56baf9(_0x55b0c8);});});}exports['GetFaxAccount']=function(_0x38284c){var _0xca97c3=this;return new Promise(function(_0x27f580,_0x59586b){return db[_0x4d4a('0x14')]['findAll']({'raw':_0x38284c['options']?_0x38284c[_0x4d4a('0x15')][_0x4d4a('0x16')]===undefined?!![]:![]:!![],'where':_0x38284c[_0x4d4a('0x15')]?_0x38284c['options'][_0x4d4a('0x17')]||null:null,'attributes':_0x38284c['options']?_0x38284c[_0x4d4a('0x15')]['attributes']||null:null,'limit':_0x38284c[_0x4d4a('0x15')]?_0x38284c[_0x4d4a('0x15')][_0x4d4a('0x18')]||null:null,'include':_0x38284c[_0x4d4a('0x15')]?_0x38284c['options'][_0x4d4a('0x19')]?_[_0x4d4a('0x1a')](_0x38284c[_0x4d4a('0x15')][_0x4d4a('0x19')],function(_0x4d9a6a){return{'model':db[_0x4d9a6a[_0x4d4a('0x1b')]],'as':_0x4d9a6a['as'],'attributes':_0x4d9a6a[_0x4d4a('0x1c')],'include':_0x4d9a6a[_0x4d4a('0x19')]?_[_0x4d4a('0x1a')](_0x4d9a6a[_0x4d4a('0x19')],function(_0xacd8d8){return{'model':db[_0xacd8d8['model']],'as':_0xacd8d8['as'],'attributes':_0xacd8d8['attributes'],'include':_0xacd8d8['include']?_['map'](_0xacd8d8[_0x4d4a('0x19')],function(_0x15fc46){return{'model':db[_0x15fc46[_0x4d4a('0x1b')]],'as':_0x15fc46['as'],'attributes':_0x15fc46[_0x4d4a('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20a69f){logger[_0x4d4a('0x1d')](_0x4d4a('0x1e'),_0x38284c);logger['debug'](_0x4d4a('0x1e'),_0x38284c,JSON[_0x4d4a('0x1f')](_0x20a69f));_0x27f580(_0x20a69f);})['catch'](function(_0x5de018){logger[_0x4d4a('0xe')]('GetFaxAccount',_0x5de018[_0x4d4a('0x10')],_0x38284c);_0x59586b(_0xca97c3[_0x4d4a('0xe')](0x1f4,_0x5de018[_0x4d4a('0x10')]));});});};exports[_0x4d4a('0x20')]=function(_0x366fea,_0x525b1f,_0x395b0c){var _0x5ad522=this;return new Promise(function(_0x229974,_0x1afe34){var _0x2caf67={'body':_0x366fea[_0x4d4a('0x21')],'channel':_0x4d4a('0x22')};var _0x8e14b3=[];var _0x4f9707=[];var _0x162356={};return db[_0x4d4a('0x23')]['describe']()[_0x4d4a('0x24')](function(_0x46ad0e){if(!_0x46ad0e){throw new db[(_0x4d4a('0x25'))][(_0x4d4a('0x26'))](_0x4d4a('0x27'));}_0x8e14b3=_[_0x4d4a('0x28')](_[_0x4d4a('0x29')](_0x46ad0e),['createdAt',_0x4d4a('0x2a')]);_0x4f9707=_[_0x4d4a('0x28')](_[_0x4d4a('0x29')](_0x46ad0e),[_0x4d4a('0x2b'),'updatedAt',_0x4d4a('0x2c'),_0x4d4a('0x2d')]);if(_0x366fea['body']['id']){delete _0x366fea[_0x4d4a('0x21')]['id'];}if(_[_0x4d4a('0x2e')](_0x366fea[_0x4d4a('0x21')][_0x4d4a('0x2f')])){throw new db[(_0x4d4a('0x25'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x4d4a('0x2e')](_0x366fea['body'][_0x4d4a('0x21')])||_0x366fea[_0x4d4a('0x21')]['body']===''){throw new db[(_0x4d4a('0x25'))][(_0x4d4a('0x26'))](_0x4d4a('0x30'));}if(_[_0x4d4a('0x2e')](_0x366fea[_0x4d4a('0x21')][_0x4d4a('0x31')])){throw new db[(_0x4d4a('0x25'))][(_0x4d4a('0x26'))](_0x4d4a('0x32')+_0x4f9707);}if(!_[_0x4d4a('0x33')](_0x4f9707,_0x366fea[_0x4d4a('0x21')]['mapKey'])){throw new db[(_0x4d4a('0x25'))][(_0x4d4a('0x26'))](_0x4d4a('0x34')+_0x4f9707);}_0x162356[_0x366fea['body']['mapKey']]=_0x366fea[_0x4d4a('0x21')][_0x4d4a('0x2f')];})['then'](function(){return db[_0x4d4a('0x14')][_0x4d4a('0x35')]({'where':{'id':_0x366fea[_0x4d4a('0x36')]['id']},'include':[{'model':db[_0x4d4a('0x37')],'as':_0x4d4a('0x38'),'include':[{'model':db[_0x4d4a('0x23')],'as':_0x4d4a('0x39'),'where':_0x162356,'limit':0x1,'order':[[_0x4d4a('0x2a'),_0x4d4a('0x3a')]]}]},{'model':db[_0x4d4a('0x3b')],'as':_0x4d4a('0x3c')}]});})[_0x4d4a('0x24')](function(_0x2b3754){if(_0x2b3754&&_0x2b3754[_0x4d4a('0x38')]){var _0x458a0b=_0x2b3754[_0x4d4a('0x3d')]({'plain':!![]});_0x2caf67[_0x4d4a('0x36')]=_0x458a0b;_0x2caf67[_0x4d4a('0x3e')]=_0x458a0b[_0x4d4a('0x3c')];_0x2caf67['list']=_0x458a0b[_0x4d4a('0x38')];_0x2caf67[_0x4d4a('0x3e')]=_[_0x4d4a('0x3f')](_0x2caf67[_0x4d4a('0x3e')],[_0x4d4a('0x40')],[_0x4d4a('0x41')]);if(_0x2caf67[_0x4d4a('0x36')][_0x4d4a('0x3c')]){delete _0x2caf67[_0x4d4a('0x36')][_0x4d4a('0x3c')];}if(_0x2caf67[_0x4d4a('0x36')]['List']&&_0x2caf67['account'][_0x4d4a('0x38')]['Contacts'][_0x4d4a('0x42')]){return _0x2caf67[_0x4d4a('0x36')][_0x4d4a('0x38')]['Contacts'][0x0];}var _0x283625=_[_0x4d4a('0x7')](_0x366fea[_0x4d4a('0x21')],{'firstName':_0x366fea[_0x4d4a('0x21')]['from'],'ListId':_0x458a0b[_0x4d4a('0x2d')]});_0x283625[_0x366fea[_0x4d4a('0x21')][_0x4d4a('0x31')]]=_0x366fea['body']['from'];return db[_0x4d4a('0x23')][_0x4d4a('0x43')](_0x283625,{'fields':_0x8e14b3,'raw':!![]});}})[_0x4d4a('0x24')](function(_0x3a6f0d){_0x2caf67['contact']=_0x3a6f0d;if(_0x3a6f0d){var _0x1c7532={'ContactId':_0x3a6f0d['id'],'FaxAccountId':_0x366fea[_0x4d4a('0x36')]['id'],'fax':_0x3a6f0d[_0x4d4a('0x22')]};return db['FaxInteraction'][_0x4d4a('0x35')]({'where':{'ContactId':_0x3a6f0d['id'],'closed':![],'FaxAccountId':_0x366fea[_0x4d4a('0x36')]['id']}})[_0x4d4a('0x24')](function(_0x3f0e61){if(_0x3f0e61){return[_0x3f0e61,![]];}return db[_0x4d4a('0x44')]['create'](_0x1c7532)[_0x4d4a('0x24')](function(_0x12a57e){return[_0x12a57e,!![]];});});}else{throw new Error(_0x4d4a('0x45'));}})[_0x4d4a('0x46')](function(_0xbe27ef,_0x2b1b52){var _0x52bc18=_0xbe27ef[_0x4d4a('0x3d')]({'plain':!![]});if(_0x2b1b52){if(_0x2caf67[_0x4d4a('0x36')][_0x4d4a('0x47')]){_0x2caf67[_0x4d4a('0x3e')][_0x4d4a('0x48')]({'id':0x0,'priority':_0x2caf67[_0x4d4a('0x3e')][_0x4d4a('0x42')]+0x1,'app':_0x4d4a('0x49'),'appdata':_0x4d4a('0x4a'),'interval':_0x4d4a('0x4b')});}_0x52bc18['created']=!![];}else{_0x52bc18[_0x4d4a('0x4c')]=![];}_0x2caf67[_0x4d4a('0x4d')]=_0x52bc18;return db[_0x4d4a('0x4e')]['create']({'body':_0x366fea[_0x4d4a('0x21')][_0x4d4a('0x21')],'FaxAccountId':_0x366fea[_0x4d4a('0x36')]['id'],'FaxInteractionId':_0xbe27ef['id'],'direction':'in','ContactId':_0xbe27ef[_0x4d4a('0x4f')],'AttachmentId':_0x366fea['body'][_0x4d4a('0x50')]});})['then'](function(_0x356976){_0x2caf67[_0x4d4a('0x10')]=_0x356976;if(!_0x2caf67['interaction']['UserId'])return;return db['User'][_0x4d4a('0x35')]({'attributes':['id','name'],'where':{'id':_0x2caf67['interaction'][_0x4d4a('0x51')]}});})[_0x4d4a('0x24')](function(_0x4e531e){if(_0x4e531e){_0x2caf67[_0x4d4a('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4d4a('0x52'),'appdata':_0x4e531e['name']+','+(_0x2caf67['account'][_0x4d4a('0x53')]||0xa),'interval':_0x4d4a('0x4b')});}if(!_0x2caf67['interaction'][_0x4d4a('0x54')])return;return db[_0x4d4a('0x55')]['find']({'attributes':['id',_0x4d4a('0x56')],'where':{'id':_0x2caf67['interaction'][_0x4d4a('0x54')]}});})[_0x4d4a('0x24')](function(_0x582555){if(_0x582555){_0x2caf67[_0x4d4a('0x3e')][_0x4d4a('0x57')]({'id':0x0,'priority':0x1,'app':_0x4d4a('0x58'),'appdata':_0x582555['name']+','+(_0x2caf67[_0x4d4a('0x36')][_0x4d4a('0x59')]||0x12c),'interval':_0x4d4a('0x4b')});}return respondWithRpcPromise(_0x4d4a('0x5a'),_0x4d4a('0x5b'),_0x2caf67);})[_0x4d4a('0x24')](function(_0x15defe){_0x229974(_0x15defe);})[_0x4d4a('0x13')](function(_0x4a43e3){_0x1afe34(_0x5ad522[_0x4d4a('0xe')](0x1f4,_0x4a43e3['message']));});});}; \ No newline at end of file +var _0xf417=['client','http','defaults','redis','localhost','./faxAccount.socket','request','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetFaxAccount','FaxAccount','options','where','attributes','limit','include','map','model','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','CmList','Contacts','updatedAt','FaxApplication','Applications','then','List','get','account','applications','orderBy','priority','contact','FaxInteraction','create','spread','autoclose','push','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','agent','queueId','FaxQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2728fc,_0x2ce482){var _0x33039b=function(_0x2d1b02){while(--_0x2d1b02){_0x2728fc['push'](_0x2728fc['shift']());}};_0x33039b(++_0x2ce482);}(_0xf417,0x10d));var _0x7f41=function(_0x15d60e,_0x4e846d){_0x15d60e=_0x15d60e-0x0;var _0x5c6452=_0xf417[_0x15d60e];return _0x5c6452;};'use strict';var _=require(_0x7f41('0x0'));var util=require(_0x7f41('0x1'));var moment=require('moment');var BPromise=require(_0x7f41('0x2'));var rs=require(_0x7f41('0x3'));var fs=require('fs');var Redis=require(_0x7f41('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f41('0x5'));var logger=require(_0x7f41('0x6'))(_0x7f41('0x7'));var config=require(_0x7f41('0x8'));var jayson=require(_0x7f41('0x9'));var client=jayson[_0x7f41('0xa')][_0x7f41('0xb')]({'port':0x232c});config['redis']=_[_0x7f41('0xc')](config[_0x7f41('0xd')],{'host':_0x7f41('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7f41('0xf'))['register'](socket);function respondWithRpcPromise(_0x3ace60,_0x40a59d,_0x2dfb03){return new BPromise(function(_0x66317a,_0x53df04){return client[_0x7f41('0x10')](_0x3ace60,_0x2dfb03)['then'](function(_0x26f623){logger['info'](_0x7f41('0x11'),_0x40a59d,'request\x20sent');logger[_0x7f41('0x12')](_0x7f41('0x13'),_0x40a59d,_0x7f41('0x14'),JSON[_0x7f41('0x15')](_0x26f623));if(_0x26f623[_0x7f41('0x16')]){if(_0x26f623[_0x7f41('0x16')][_0x7f41('0x17')]===0x1f4){logger[_0x7f41('0x16')](_0x7f41('0x11'),_0x40a59d,_0x26f623['error'][_0x7f41('0x18')]);return _0x53df04(_0x26f623[_0x7f41('0x16')][_0x7f41('0x18')]);}logger[_0x7f41('0x16')]('FaxAccount,\x20%s,\x20%s',_0x40a59d,_0x26f623[_0x7f41('0x16')][_0x7f41('0x18')]);return _0x66317a(_0x26f623[_0x7f41('0x16')]['message']);}else{logger[_0x7f41('0x19')]('FaxAccount,\x20%s,\x20%s',_0x40a59d,'request\x20sent');_0x66317a(_0x26f623[_0x7f41('0x1a')][_0x7f41('0x18')]);}})[_0x7f41('0x1b')](function(_0x598064){logger[_0x7f41('0x16')](_0x7f41('0x11'),_0x40a59d,_0x598064);_0x53df04(_0x598064);});});}exports[_0x7f41('0x1c')]=function(_0x3e4bc1){var _0x21cc12=this;return new Promise(function(_0x46d1d4,_0x7a67c){return db[_0x7f41('0x1d')]['findAll']({'raw':_0x3e4bc1[_0x7f41('0x1e')]?_0x3e4bc1[_0x7f41('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3e4bc1[_0x7f41('0x1e')]?_0x3e4bc1[_0x7f41('0x1e')][_0x7f41('0x1f')]||null:null,'attributes':_0x3e4bc1[_0x7f41('0x1e')]?_0x3e4bc1[_0x7f41('0x1e')][_0x7f41('0x20')]||null:null,'limit':_0x3e4bc1[_0x7f41('0x1e')]?_0x3e4bc1['options'][_0x7f41('0x21')]||null:null,'include':_0x3e4bc1[_0x7f41('0x1e')]?_0x3e4bc1['options'][_0x7f41('0x22')]?_[_0x7f41('0x23')](_0x3e4bc1[_0x7f41('0x1e')]['include'],function(_0x157c73){return{'model':db[_0x157c73[_0x7f41('0x24')]],'as':_0x157c73['as'],'attributes':_0x157c73[_0x7f41('0x20')],'include':_0x157c73[_0x7f41('0x22')]?_[_0x7f41('0x23')](_0x157c73[_0x7f41('0x22')],function(_0x9ba838){return{'model':db[_0x9ba838['model']],'as':_0x9ba838['as'],'attributes':_0x9ba838[_0x7f41('0x20')],'include':_0x9ba838[_0x7f41('0x22')]?_['map'](_0x9ba838[_0x7f41('0x22')],function(_0x473ae0){return{'model':db[_0x473ae0[_0x7f41('0x24')]],'as':_0x473ae0['as'],'attributes':_0x473ae0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x40702d){logger[_0x7f41('0x19')](_0x7f41('0x1c'),_0x3e4bc1);logger[_0x7f41('0x12')](_0x7f41('0x1c'),_0x3e4bc1,JSON[_0x7f41('0x15')](_0x40702d));_0x46d1d4(_0x40702d);})[_0x7f41('0x1b')](function(_0x14daf6){logger[_0x7f41('0x16')]('GetFaxAccount',_0x14daf6[_0x7f41('0x18')],_0x3e4bc1);_0x7a67c(_0x21cc12['error'](0x1f4,_0x14daf6[_0x7f41('0x18')]));});});};exports[_0x7f41('0x25')]=function(_0x227c3d,_0x57b8c4,_0x2ead70){var _0x3314b0=this;return new Promise(function(_0x383e36,_0x347b02){var _0x4ca206={'body':_0x227c3d[_0x7f41('0x26')],'channel':_0x7f41('0x27')};var _0x164108=[];var _0x4b5d09=[];var _0x36cc1a={};return db[_0x7f41('0x28')][_0x7f41('0x29')]()['then'](function(_0x1476d2){if(!_0x1476d2){throw new db[(_0x7f41('0x2a'))][(_0x7f41('0x2b'))](_0x7f41('0x2c'));}_0x164108=_['difference'](_[_0x7f41('0x2d')](_0x1476d2),[_0x7f41('0x2e'),'updatedAt']);_0x4b5d09=_[_0x7f41('0x2f')](_[_0x7f41('0x2d')](_0x1476d2),[_0x7f41('0x2e'),'updatedAt',_0x7f41('0x30'),_0x7f41('0x31')]);if(_0x227c3d[_0x7f41('0x26')]['id']){delete _0x227c3d[_0x7f41('0x26')]['id'];}if(_['isNil'](_0x227c3d['body'][_0x7f41('0x32')])){throw new db['Sequelize'][(_0x7f41('0x2b'))](_0x7f41('0x33'));}if(_['isNil'](_0x227c3d[_0x7f41('0x26')][_0x7f41('0x26')])||_0x227c3d['body']['body']===''){throw new db['Sequelize'][(_0x7f41('0x2b'))](_0x7f41('0x34'));}if(_['isNil'](_0x227c3d[_0x7f41('0x26')][_0x7f41('0x35')])){throw new db[(_0x7f41('0x2a'))][(_0x7f41('0x2b'))](_0x7f41('0x36')+_0x4b5d09);}if(!_[_0x7f41('0x37')](_0x4b5d09,_0x227c3d[_0x7f41('0x26')][_0x7f41('0x35')])){throw new db[(_0x7f41('0x2a'))][(_0x7f41('0x2b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4b5d09);}_0x36cc1a[_0x227c3d[_0x7f41('0x26')][_0x7f41('0x35')]]=_0x227c3d[_0x7f41('0x26')][_0x7f41('0x32')];})['then'](function(){return db[_0x7f41('0x1d')][_0x7f41('0x38')]({'where':{'id':_0x227c3d['account']['id']},'include':[{'model':db[_0x7f41('0x39')],'as':'List','include':[{'model':db[_0x7f41('0x28')],'as':_0x7f41('0x3a'),'where':_0x36cc1a,'limit':0x1,'order':[[_0x7f41('0x3b'),'DESC']]}]},{'model':db[_0x7f41('0x3c')],'as':_0x7f41('0x3d')}]});})[_0x7f41('0x3e')](function(_0xb8abc6){if(_0xb8abc6&&_0xb8abc6[_0x7f41('0x3f')]){var _0xffe99b=_0xb8abc6[_0x7f41('0x40')]({'plain':!![]});_0x4ca206[_0x7f41('0x41')]=_0xffe99b;_0x4ca206[_0x7f41('0x42')]=_0xffe99b[_0x7f41('0x3d')];_0x4ca206['list']=_0xffe99b[_0x7f41('0x3f')];_0x4ca206['applications']=_[_0x7f41('0x43')](_0x4ca206[_0x7f41('0x42')],[_0x7f41('0x44')],['asc']);if(_0x4ca206[_0x7f41('0x41')][_0x7f41('0x3d')]){delete _0x4ca206['account'][_0x7f41('0x3d')];}if(_0x4ca206[_0x7f41('0x41')]['List']&&_0x4ca206['account']['List'][_0x7f41('0x3a')]['length']){return _0x4ca206['account'][_0x7f41('0x3f')][_0x7f41('0x3a')][0x0];}var _0x6fb18d=_['defaults'](_0x227c3d[_0x7f41('0x26')],{'firstName':_0x227c3d['body']['from'],'ListId':_0xffe99b[_0x7f41('0x31')]});_0x6fb18d[_0x227c3d[_0x7f41('0x26')][_0x7f41('0x35')]]=_0x227c3d[_0x7f41('0x26')][_0x7f41('0x32')];return db[_0x7f41('0x28')]['create'](_0x6fb18d,{'fields':_0x164108,'raw':!![]});}})[_0x7f41('0x3e')](function(_0x34b636){_0x4ca206[_0x7f41('0x45')]=_0x34b636;if(_0x34b636){var _0x4f8871={'ContactId':_0x34b636['id'],'FaxAccountId':_0x227c3d[_0x7f41('0x41')]['id'],'fax':_0x34b636['fax']};return db[_0x7f41('0x46')][_0x7f41('0x38')]({'where':{'ContactId':_0x34b636['id'],'closed':![],'FaxAccountId':_0x227c3d['account']['id']}})['then'](function(_0x1a6bbd){if(_0x1a6bbd){return[_0x1a6bbd,![]];}return db[_0x7f41('0x46')][_0x7f41('0x47')](_0x4f8871)[_0x7f41('0x3e')](function(_0x37d7cc){return[_0x37d7cc,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x7f41('0x48')](function(_0x235342,_0x49e8c7){var _0x1b5c5f=_0x235342[_0x7f41('0x40')]({'plain':!![]});if(_0x49e8c7){if(_0x4ca206['account'][_0x7f41('0x49')]){_0x4ca206[_0x7f41('0x42')][_0x7f41('0x4a')]({'id':0x0,'priority':_0x4ca206['applications']['length']+0x1,'app':'close','appdata':_0x7f41('0x4b'),'interval':_0x7f41('0x4c')});}_0x1b5c5f['created']=!![];}else{_0x1b5c5f[_0x7f41('0x4d')]=![];}_0x4ca206[_0x7f41('0x4e')]=_0x1b5c5f;return db[_0x7f41('0x4f')]['create']({'body':_0x227c3d['body'][_0x7f41('0x26')],'FaxAccountId':_0x227c3d[_0x7f41('0x41')]['id'],'FaxInteractionId':_0x235342['id'],'direction':'in','ContactId':_0x235342[_0x7f41('0x50')],'AttachmentId':_0x227c3d[_0x7f41('0x26')][_0x7f41('0x51')]});})['then'](function(_0x39b9a9){_0x4ca206[_0x7f41('0x18')]=_0x39b9a9;if(!_0x4ca206[_0x7f41('0x4e')][_0x7f41('0x52')])return;return db[_0x7f41('0x53')][_0x7f41('0x38')]({'attributes':['id',_0x7f41('0x54')],'where':{'id':_0x4ca206[_0x7f41('0x4e')][_0x7f41('0x52')]}});})[_0x7f41('0x3e')](function(_0x5ed9c0){if(_0x5ed9c0){_0x4ca206[_0x7f41('0x42')]['unshift']({'id':0x0,'priority':0x0,'app':_0x7f41('0x55'),'appdata':_0x5ed9c0[_0x7f41('0x54')]+','+(_0x4ca206[_0x7f41('0x41')]['waitForTheAssignedAgent']||0xa),'interval':_0x7f41('0x4c')});}if(!_0x4ca206[_0x7f41('0x4e')][_0x7f41('0x56')])return;return db[_0x7f41('0x57')][_0x7f41('0x38')]({'attributes':['id',_0x7f41('0x54')],'where':{'id':_0x4ca206[_0x7f41('0x4e')][_0x7f41('0x56')]}});})[_0x7f41('0x3e')](function(_0x38592b){if(_0x38592b){_0x4ca206['applications'][_0x7f41('0x58')]({'id':0x0,'priority':0x1,'app':_0x7f41('0x59'),'appdata':_0x38592b[_0x7f41('0x54')]+','+(_0x4ca206[_0x7f41('0x41')][_0x7f41('0x5a')]||0x12c),'interval':_0x7f41('0x4c')});}return respondWithRpcPromise(_0x7f41('0x5b'),_0x7f41('0x5c'),_0x4ca206);})['then'](function(_0x1cd612){_0x383e36(_0x1cd612);})[_0x7f41('0x1b')](function(_0x54a709){_0x347b02(_0x3314b0[_0x7f41('0x16')](0x1f4,_0x54a709[_0x7f41('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index c09f959..77da482 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 _0xcc03=['removeListener','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x3b50e6,_0x57b96a){var _0x5edc2e=function(_0x54c244){while(--_0x54c244){_0x3b50e6['push'](_0x3b50e6['shift']());}};_0x5edc2e(++_0x57b96a);}(_0xcc03,0xaa));var _0x3cc0=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0xcc03[_0x2e2681];return _0x368a64;};'use strict';var FaxAccountEvents=require(_0x3cc0('0x0'));var events=[_0x3cc0('0x1'),_0x3cc0('0x2'),_0x3cc0('0x3')];function createListener(_0x1a80ba,_0x231f8d){return function(_0x4809dd){_0x231f8d['emit'](_0x1a80ba,_0x4809dd);};}function removeListener(_0x30d4e9,_0x1e3d17){return function(){FaxAccountEvents[_0x3cc0('0x4')](_0x30d4e9,_0x1e3d17);};}exports['register']=function(_0x3156fe){for(var _0x34dda6=0x0,_0xb302d4=events['length'];_0x34dda6<_0xb302d4;_0x34dda6++){var _0x1752c5=events[_0x34dda6];var _0x127b67=createListener(_0x3cc0('0x5')+_0x1752c5,_0x3156fe);FaxAccountEvents['on'](_0x1752c5,_0x127b67);}}; \ No newline at end of file +var _0x1fd7=['remove','update','length','faxAccount:','./faxAccount.events','save'];(function(_0x37a7ce,_0xeb36f9){var _0x3890c0=function(_0x170312){while(--_0x170312){_0x37a7ce['push'](_0x37a7ce['shift']());}};_0x3890c0(++_0xeb36f9);}(_0x1fd7,0xb8));var _0x71fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1fd7[_0x3dd15e];return _0x231fd0;};'use strict';var FaxAccountEvents=require(_0x71fd('0x0'));var events=[_0x71fd('0x1'),_0x71fd('0x2'),_0x71fd('0x3')];function createListener(_0x10d3d5,_0x296c6e){return function(_0x24bd73){_0x296c6e['emit'](_0x10d3d5,_0x24bd73);};}function removeListener(_0x2a372d,_0x44d2a8){return function(){FaxAccountEvents['removeListener'](_0x2a372d,_0x44d2a8);};}exports['register']=function(_0x2e15e4){for(var _0x48aac2=0x0,_0x22d8da=events[_0x71fd('0x4')];_0x48aac2<_0x22d8da;_0x48aac2++){var _0x243860=events[_0x48aac2];var _0x170b41=createListener(_0x71fd('0x5')+_0x243860,_0x2e15e4);FaxAccountEvents['on'](_0x243860,_0x170b41);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 531aad2..17a7139 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 _0xc7f9=['addInteraction','/:id/applications','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','/:id/messages','getMessages','/:id/users','post','create','addDisposition','addAnswer'];(function(_0x2bba3d,_0x2833d6){var _0x4447a8=function(_0x6486a5){while(--_0x6486a5){_0x2bba3d['push'](_0x2bba3d['shift']());}};_0x4447a8(++_0x2833d6);}(_0xc7f9,0x13c));var _0x9c7f=function(_0x16ce42,_0x2cc86f){_0x16ce42=_0x16ce42-0x0;var _0x393188=_0xc7f9[_0x16ce42];return _0x393188;};'use strict';var multer=require(_0x9c7f('0x0'));var util=require(_0x9c7f('0x1'));var path=require(_0x9c7f('0x2'));var timeout=require(_0x9c7f('0x3'));var express=require(_0x9c7f('0x4'));var router=express[_0x9c7f('0x5')]();var fs_extra=require(_0x9c7f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9c7f('0x7'));var config=require(_0x9c7f('0x8'));var controller=require('./faxAccount.controller');router[_0x9c7f('0x9')]('/',auth[_0x9c7f('0xa')](),controller[_0x9c7f('0xb')]);router[_0x9c7f('0x9')](_0x9c7f('0xc'),auth[_0x9c7f('0xa')](),controller[_0x9c7f('0xd')]);router[_0x9c7f('0x9')](_0x9c7f('0xe'),auth[_0x9c7f('0xa')](),controller[_0x9c7f('0xf')]);router[_0x9c7f('0x9')](_0x9c7f('0x10'),auth[_0x9c7f('0xa')](),controller[_0x9c7f('0x11')]);router[_0x9c7f('0x9')](_0x9c7f('0x12'),auth[_0x9c7f('0xa')](),controller[_0x9c7f('0x13')]);router[_0x9c7f('0x9')](_0x9c7f('0x14'),auth[_0x9c7f('0xa')](),controller['getInteractions']);router[_0x9c7f('0x9')]('/:id/applications',auth[_0x9c7f('0xa')](),controller['getApplications']);router[_0x9c7f('0x9')](_0x9c7f('0x15'),auth[_0x9c7f('0xa')](),controller[_0x9c7f('0x16')]);router[_0x9c7f('0x9')](_0x9c7f('0x17'),auth[_0x9c7f('0xa')](),controller['getAgents']);router[_0x9c7f('0x18')]('/',auth[_0x9c7f('0xa')](),controller[_0x9c7f('0x19')]);router[_0x9c7f('0x18')](_0x9c7f('0x10'),auth[_0x9c7f('0xa')](),controller[_0x9c7f('0x1a')]);router[_0x9c7f('0x18')](_0x9c7f('0x12'),auth[_0x9c7f('0xa')](),controller[_0x9c7f('0x1b')]);router[_0x9c7f('0x18')](_0x9c7f('0x14'),auth['isAuthenticated'](),controller[_0x9c7f('0x1c')]);router[_0x9c7f('0x18')](_0x9c7f('0x1d'),auth['isAuthenticated'](),controller[_0x9c7f('0x1e')]);router['post'](_0x9c7f('0x1f'),auth['isAuthenticated'](),controller[_0x9c7f('0x20')]);router['post'](_0x9c7f('0x21'),auth['isAuthenticated'](),controller[_0x9c7f('0x22')]);router['post']('/:id/send',auth[_0x9c7f('0xa')](),controller[_0x9c7f('0x23')]);router[_0x9c7f('0x18')](_0x9c7f('0x17'),auth[_0x9c7f('0xa')](),controller[_0x9c7f('0x24')]);router[_0x9c7f('0x25')]('/:id',auth[_0x9c7f('0xa')](),controller[_0x9c7f('0x26')]);router[_0x9c7f('0x27')](_0x9c7f('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x9c7f('0x27')](_0x9c7f('0x10'),auth[_0x9c7f('0xa')](),controller[_0x9c7f('0x28')]);router['delete'](_0x9c7f('0x12'),auth[_0x9c7f('0xa')](),controller[_0x9c7f('0x29')]);router[_0x9c7f('0x27')](_0x9c7f('0x17'),auth[_0x9c7f('0xa')](),controller[_0x9c7f('0x2a')]);module['exports']=router; \ No newline at end of file +var _0x5d0d=['getAnswers','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','post','create','/:id/dispositions','/:id/canned_answers','addInteraction','addApplications','/addaccountapplications','addAccountApplications','updateAccountApplications','send','update','delete','removeDispositions','removeAnswers','removeAgents','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x1b906b,_0x256e70){var _0x51521c=function(_0x3c7d8d){while(--_0x3c7d8d){_0x1b906b['push'](_0x1b906b['shift']());}};_0x51521c(++_0x256e70);}(_0x5d0d,0x11a));var _0xd5d0=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x5d0d[_0x1a9204];return _0x17ca68;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd5d0('0x0'));var timeout=require('connect-timeout');var express=require(_0xd5d0('0x1'));var router=express[_0xd5d0('0x2')]();var fs_extra=require(_0xd5d0('0x3'));var auth=require(_0xd5d0('0x4'));var interaction=require(_0xd5d0('0x5'));var config=require(_0xd5d0('0x6'));var controller=require('./faxAccount.controller');router[_0xd5d0('0x7')]('/',auth['isAuthenticated'](),controller[_0xd5d0('0x8')]);router[_0xd5d0('0x7')](_0xd5d0('0x9'),auth[_0xd5d0('0xa')](),controller[_0xd5d0('0xb')]);router[_0xd5d0('0x7')](_0xd5d0('0xc'),auth[_0xd5d0('0xa')](),controller[_0xd5d0('0xd')]);router['get']('/:id/dispositions',auth[_0xd5d0('0xa')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd5d0('0xe')]);router[_0xd5d0('0x7')](_0xd5d0('0xf'),auth[_0xd5d0('0xa')](),controller['getInteractions']);router[_0xd5d0('0x7')](_0xd5d0('0x10'),auth[_0xd5d0('0xa')](),controller[_0xd5d0('0x11')]);router['get'](_0xd5d0('0x12'),auth['isAuthenticated'](),controller[_0xd5d0('0x13')]);router['get'](_0xd5d0('0x14'),auth['isAuthenticated'](),controller['getAgents']);router[_0xd5d0('0x15')]('/',auth[_0xd5d0('0xa')](),controller[_0xd5d0('0x16')]);router[_0xd5d0('0x15')](_0xd5d0('0x17'),auth[_0xd5d0('0xa')](),controller['addDisposition']);router[_0xd5d0('0x15')](_0xd5d0('0x18'),auth[_0xd5d0('0xa')](),controller['addAnswer']);router[_0xd5d0('0x15')](_0xd5d0('0xf'),auth[_0xd5d0('0xa')](),controller[_0xd5d0('0x19')]);router[_0xd5d0('0x15')](_0xd5d0('0x10'),auth[_0xd5d0('0xa')](),controller[_0xd5d0('0x1a')]);router[_0xd5d0('0x15')](_0xd5d0('0x1b'),auth[_0xd5d0('0xa')](),controller[_0xd5d0('0x1c')]);router[_0xd5d0('0x15')]('/updateaccountapplications',auth['isAuthenticated'](),controller[_0xd5d0('0x1d')]);router[_0xd5d0('0x15')]('/:id/send',auth['isAuthenticated'](),controller[_0xd5d0('0x1e')]);router[_0xd5d0('0x15')](_0xd5d0('0x14'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xd5d0('0xc'),auth[_0xd5d0('0xa')](),controller[_0xd5d0('0x1f')]);router[_0xd5d0('0x20')](_0xd5d0('0xc'),auth[_0xd5d0('0xa')](),controller['destroy']);router[_0xd5d0('0x20')](_0xd5d0('0x17'),auth[_0xd5d0('0xa')](),controller[_0xd5d0('0x21')]);router['delete'](_0xd5d0('0x18'),auth[_0xd5d0('0xa')](),controller[_0xd5d0('0x22')]);router[_0xd5d0('0x20')]('/:id/users',auth[_0xd5d0('0xa')](),controller[_0xd5d0('0x23')]);module[_0xd5d0('0x24')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index db8f3a9..ea9093a 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 _0x743b=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x7106ae,_0x2ec0f1){var _0xac86c1=function(_0x144e57){while(--_0x144e57){_0x7106ae['push'](_0x7106ae['shift']());}};_0xac86c1(++_0x2ec0f1);}(_0x743b,0x1c9));var _0xb743=function(_0x266a82,_0xa2dc64){_0x266a82=_0x266a82-0x0;var _0x422908=_0x743b[_0x266a82];return _0x422908;};'use strict';var Sequelize=require(_0xb743('0x0'));module[_0xb743('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb743('0x2')],'allowNull':![],'defaultValue':_0xb743('0x3')},'appdata':{'type':Sequelize[_0xb743('0x4')]()},'description':{'type':Sequelize[_0xb743('0x2')]},'interval':{'type':Sequelize[_0xb743('0x2')],'defaultValue':_0xb743('0x5')}}; \ No newline at end of file +var _0xad65=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x2091ff,_0x4f15e9){var _0x3bf8e8=function(_0x4b8368){while(--_0x4b8368){_0x2091ff['push'](_0x2091ff['shift']());}};_0x3bf8e8(++_0x4f15e9);}(_0xad65,0x16f));var _0x5ad6=function(_0x60f803,_0x2a2561){_0x60f803=_0x60f803-0x0;var _0x5a030c=_0xad65[_0x60f803];return _0x5a030c;};'use strict';var Sequelize=require(_0x5ad6('0x0'));module[_0x5ad6('0x1')]={'priority':{'type':Sequelize[_0x5ad6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5ad6('0x3')],'allowNull':![],'defaultValue':_0x5ad6('0x4')},'appdata':{'type':Sequelize[_0x5ad6('0x5')]()},'description':{'type':Sequelize[_0x5ad6('0x3')]},'interval':{'type':Sequelize[_0x5ad6('0x3')],'defaultValue':_0x5ad6('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index bd3a423..d5f53c0 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 _0x473d=['merge','VIRTUAL','options','FaxApplication','include','rows','catch','params','keys','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','error','stack','name','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x473d,0x9f));var _0xd473=function(_0x4a856c,_0x3870e4){_0x4a856c=_0x4a856c-0x0;var _0x2df13f=_0x473d[_0x4a856c];return _0x2df13f;};'use strict';var emlformat=require(_0xd473('0x0'));var rimraf=require(_0xd473('0x1'));var zipdir=require(_0xd473('0x2'));var jsonpatch=require(_0xd473('0x3'));var rp=require(_0xd473('0x4'));var moment=require('moment');var BPromise=require(_0xd473('0x5'));var Mustache=require(_0xd473('0x6'));var util=require(_0xd473('0x7'));var path=require(_0xd473('0x8'));var sox=require(_0xd473('0x9'));var csv=require(_0xd473('0xa'));var ejs=require(_0xd473('0xb'));var fs=require('fs');var fs_extra=require(_0xd473('0xc'));var _=require(_0xd473('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd473('0xa'));var querystring=require(_0xd473('0xe'));var Papa=require('papaparse');var Redis=require(_0xd473('0xf'));var authService=require(_0xd473('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd473('0x11'));var hardwareService=require(_0xd473('0x12'));var logger=require(_0xd473('0x13'))(_0xd473('0x14'));var utils=require(_0xd473('0x15'));var config=require(_0xd473('0x16'));var licenseUtil=require(_0xd473('0x17'));var db=require(_0xd473('0x18'))['db'];function respondWithStatusCode(_0x2440ad,_0x5ae0c4){_0x5ae0c4=_0x5ae0c4||0xcc;return function(_0x5a0947){if(_0x5a0947){return _0x2440ad[_0xd473('0x19')](_0x5ae0c4);}return _0x2440ad['status'](_0x5ae0c4)[_0xd473('0x1a')]();};}function respondWithResult(_0x2453f6,_0x341f8a){_0x341f8a=_0x341f8a||0xc8;return function(_0x9632fe){if(_0x9632fe){return _0x2453f6[_0xd473('0x1b')](_0x341f8a)[_0xd473('0x1c')](_0x9632fe);}};}function respondWithFilteredResult(_0x5a890f,_0x22392d){return function(_0x505fd4){if(_0x505fd4){var _0x405f23=typeof _0x22392d[_0xd473('0x1d')]===_0xd473('0x1e')&&typeof _0x22392d[_0xd473('0x1f')]===_0xd473('0x1e');var _0x228ebf=_0x505fd4[_0xd473('0x20')];var _0x941f4f=_0x405f23?0x0:_0x22392d[_0xd473('0x1d')];var _0x51175f=_0x405f23?_0x505fd4[_0xd473('0x20')]:_0x22392d[_0xd473('0x1d')]+_0x22392d['limit'];var _0x3d11b0;if(_0x51175f>=_0x228ebf){_0x51175f=_0x228ebf;_0x3d11b0=0xc8;}else{_0x3d11b0=0xce;}_0x5a890f[_0xd473('0x1b')](_0x3d11b0);return _0x5a890f['set'](_0xd473('0x21'),_0x941f4f+'-'+_0x51175f+'/'+_0x228ebf)[_0xd473('0x1c')](_0x505fd4);}return null;};}function patchUpdates(_0x175258){return function(_0xaaca5){try{jsonpatch[_0xd473('0x22')](_0xaaca5,_0x175258,!![]);}catch(_0x1a913c){return BPromise[_0xd473('0x23')](_0x1a913c);}return _0xaaca5['save']();};}function saveUpdates(_0x122cf6,_0x413385){return function(_0x327b1a){if(_0x327b1a){return _0x327b1a[_0xd473('0x24')](_0x122cf6)['then'](function(_0x4673e3){return _0x4673e3;});}return null;};}function removeEntity(_0x52096b,_0x59db07){return function(_0x325edc){if(_0x325edc){return _0x325edc[_0xd473('0x25')]()[_0xd473('0x26')](function(){_0x52096b[_0xd473('0x1b')](0xcc)[_0xd473('0x1a')]();});}};}function handleEntityNotFound(_0x4f997a,_0x33417f){return function(_0x17868f){if(!_0x17868f){_0x4f997a['sendStatus'](0x194);}return _0x17868f;};}function handleError(_0x471154,_0x3631a6){_0x3631a6=_0x3631a6||0x1f4;return function(_0x324143){logger[_0xd473('0x27')](_0x324143[_0xd473('0x28')]);if(_0x324143[_0xd473('0x29')]){delete _0x324143['name'];}_0x471154[_0xd473('0x1b')](_0x3631a6)['send'](_0x324143);};}exports['index']=function(_0x2fe83c,_0x2c0e2b){var _0x4859de={},_0x3128b1={},_0x2776d2={'count':0x0,'rows':[]};var _0x4f7df8=_['map'](db['FaxApplication'][_0xd473('0x2a')],function(_0x321f6a){return{'name':_0x321f6a[_0xd473('0x2b')],'type':_0x321f6a[_0xd473('0x2c')][_0xd473('0x2d')]};});_0x3128b1['model']=_[_0xd473('0x2e')](_0x4f7df8,_0xd473('0x29'));_0x3128b1[_0xd473('0x2f')]=_['keys'](_0x2fe83c[_0xd473('0x2f')]);_0x3128b1[_0xd473('0x30')]=_[_0xd473('0x31')](_0x3128b1[_0xd473('0x32')],_0x3128b1[_0xd473('0x2f')]);_0x4859de[_0xd473('0x33')]=_[_0xd473('0x31')](_0x3128b1[_0xd473('0x32')],qs[_0xd473('0x34')](_0x2fe83c[_0xd473('0x2f')]['fields']));_0x4859de[_0xd473('0x33')]=_0x4859de[_0xd473('0x33')][_0xd473('0x35')]?_0x4859de[_0xd473('0x33')]:_0x3128b1[_0xd473('0x32')];if(!_0x2fe83c[_0xd473('0x2f')][_0xd473('0x36')](_0xd473('0x37'))){_0x4859de[_0xd473('0x1f')]=qs[_0xd473('0x1f')](_0x2fe83c[_0xd473('0x2f')][_0xd473('0x1f')]);_0x4859de[_0xd473('0x1d')]=qs[_0xd473('0x1d')](_0x2fe83c[_0xd473('0x2f')][_0xd473('0x1d')]);}_0x4859de[_0xd473('0x38')]=qs[_0xd473('0x39')](_0x2fe83c[_0xd473('0x2f')][_0xd473('0x39')]);_0x4859de[_0xd473('0x3a')]=qs[_0xd473('0x30')](_['pick'](_0x2fe83c[_0xd473('0x2f')],_0x3128b1[_0xd473('0x30')]),_0x4f7df8);if(_0x2fe83c['query'][_0xd473('0x3b')]){_0x4859de[_0xd473('0x3a')]=_[_0xd473('0x3c')](_0x4859de[_0xd473('0x3a')],{'$or':_[_0xd473('0x2e')](_0x4f7df8,function(_0x784fd5){if(_0x784fd5[_0xd473('0x2c')]!==_0xd473('0x3d')){var _0x1fea93={};_0x1fea93[_0x784fd5['name']]={'$like':'%'+_0x2fe83c[_0xd473('0x2f')][_0xd473('0x3b')]+'%'};return _0x1fea93;}})});}_0x4859de=_[_0xd473('0x3c')]({},_0x4859de,_0x2fe83c[_0xd473('0x3e')]);var _0x4693e8={'where':_0x4859de[_0xd473('0x3a')]};return db[_0xd473('0x3f')][_0xd473('0x20')](_0x4693e8)[_0xd473('0x26')](function(_0x338c51){_0x2776d2[_0xd473('0x20')]=_0x338c51;if(_0x2fe83c[_0xd473('0x2f')]['includeAll']){_0x4859de[_0xd473('0x40')]=[{'all':!![]}];}return db[_0xd473('0x3f')]['findAll'](_0x4859de);})[_0xd473('0x26')](function(_0x5eff25){_0x2776d2[_0xd473('0x41')]=_0x5eff25;return _0x2776d2;})[_0xd473('0x26')](respondWithFilteredResult(_0x2c0e2b,_0x4859de))[_0xd473('0x42')](handleError(_0x2c0e2b,null));};exports['show']=function(_0x4b9d27,_0x2ca52b){var _0x4403f2={'raw':!![],'where':{'id':_0x4b9d27[_0xd473('0x43')]['id']}},_0xa7acb0={};_0xa7acb0[_0xd473('0x32')]=_[_0xd473('0x44')](db['FaxApplication']['rawAttributes']);_0xa7acb0[_0xd473('0x2f')]=_['keys'](_0x4b9d27[_0xd473('0x2f')]);_0xa7acb0[_0xd473('0x30')]=_[_0xd473('0x31')](_0xa7acb0[_0xd473('0x32')],_0xa7acb0[_0xd473('0x2f')]);_0x4403f2[_0xd473('0x33')]=_[_0xd473('0x31')](_0xa7acb0[_0xd473('0x32')],qs[_0xd473('0x34')](_0x4b9d27['query'][_0xd473('0x34')]));_0x4403f2[_0xd473('0x33')]=_0x4403f2['attributes']['length']?_0x4403f2[_0xd473('0x33')]:_0xa7acb0[_0xd473('0x32')];if(_0x4b9d27['query'][_0xd473('0x45')]){_0x4403f2[_0xd473('0x40')]=[{'all':!![]}];}_0x4403f2=_[_0xd473('0x3c')]({},_0x4403f2,_0x4b9d27[_0xd473('0x3e')]);return db[_0xd473('0x3f')][_0xd473('0x46')](_0x4403f2)['then'](handleEntityNotFound(_0x2ca52b,null))['then'](respondWithResult(_0x2ca52b,null))['catch'](handleError(_0x2ca52b,null));};exports[_0xd473('0x47')]=function(_0x24a053,_0x410733){return db[_0xd473('0x3f')][_0xd473('0x47')](_0x24a053[_0xd473('0x48')],{})[_0xd473('0x26')](respondWithResult(_0x410733,0xc9))[_0xd473('0x42')](handleError(_0x410733,null));};exports[_0xd473('0x24')]=function(_0x334cf3,_0xbee66e){if(_0x334cf3['body']['id']){delete _0x334cf3[_0xd473('0x48')]['id'];}return db[_0xd473('0x3f')][_0xd473('0x46')]({'where':{'id':_0x334cf3[_0xd473('0x43')]['id']}})[_0xd473('0x26')](handleEntityNotFound(_0xbee66e,null))['then'](saveUpdates(_0x334cf3[_0xd473('0x48')],null))[_0xd473('0x26')](respondWithResult(_0xbee66e,null))[_0xd473('0x42')](handleError(_0xbee66e,null));};exports[_0xd473('0x25')]=function(_0x1e984c,_0x397a65){return db['FaxApplication'][_0xd473('0x46')]({'where':{'id':_0x1e984c[_0xd473('0x43')]['id']}})['then'](handleEntityNotFound(_0x397a65,null))[_0xd473('0x26')](removeEntity(_0x397a65,null))[_0xd473('0x42')](handleError(_0x397a65,null));}; \ No newline at end of file +var _0x3c02=['crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','FaxApplication','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','update','body','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x557bef,_0x35ca22){var _0x1d8382=function(_0x543586){while(--_0x543586){_0x557bef['push'](_0x557bef['shift']());}};_0x1d8382(++_0x35ca22);}(_0x3c02,0x1ac));var _0x23c0=function(_0x1ebdc4,_0x4966e0){_0x1ebdc4=_0x1ebdc4-0x0;var _0x42d363=_0x3c02[_0x1ebdc4];return _0x42d363;};'use strict';var emlformat=require(_0x23c0('0x0'));var rimraf=require(_0x23c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x23c0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x23c0('0x3'));var Mustache=require(_0x23c0('0x4'));var util=require(_0x23c0('0x5'));var path=require(_0x23c0('0x6'));var sox=require(_0x23c0('0x7'));var csv=require(_0x23c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x23c0('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x23c0('0xa'));var jsforce=require(_0x23c0('0xb'));var deskjs=require(_0x23c0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x23c0('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x23c0('0xe'));var qs=require(_0x23c0('0xf'));var as=require(_0x23c0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x23c0('0x11'))(_0x23c0('0x12'));var utils=require(_0x23c0('0x13'));var config=require(_0x23c0('0x14'));var licenseUtil=require(_0x23c0('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55530d,_0x59bb42){_0x59bb42=_0x59bb42||0xcc;return function(_0x3aea94){if(_0x3aea94){return _0x55530d['sendStatus'](_0x59bb42);}return _0x55530d['status'](_0x59bb42)[_0x23c0('0x16')]();};}function respondWithResult(_0x4a4131,_0x1016b5){_0x1016b5=_0x1016b5||0xc8;return function(_0x52e645){if(_0x52e645){return _0x4a4131[_0x23c0('0x17')](_0x1016b5)[_0x23c0('0x18')](_0x52e645);}};}function respondWithFilteredResult(_0x2001bd,_0x120e2b){return function(_0xb4f1c9){if(_0xb4f1c9){var _0x283195=typeof _0x120e2b[_0x23c0('0x19')]===_0x23c0('0x1a')&&typeof _0x120e2b[_0x23c0('0x1b')]===_0x23c0('0x1a');var _0x2dde16=_0xb4f1c9[_0x23c0('0x1c')];var _0x1c4d62=_0x283195?0x0:_0x120e2b[_0x23c0('0x19')];var _0x497d29=_0x283195?_0xb4f1c9[_0x23c0('0x1c')]:_0x120e2b[_0x23c0('0x19')]+_0x120e2b[_0x23c0('0x1b')];var _0x5dea82;if(_0x497d29>=_0x2dde16){_0x497d29=_0x2dde16;_0x5dea82=0xc8;}else{_0x5dea82=0xce;}_0x2001bd[_0x23c0('0x17')](_0x5dea82);return _0x2001bd[_0x23c0('0x1d')](_0x23c0('0x1e'),_0x1c4d62+'-'+_0x497d29+'/'+_0x2dde16)[_0x23c0('0x18')](_0xb4f1c9);}return null;};}function patchUpdates(_0x47943b){return function(_0x48fbe8){try{jsonpatch['apply'](_0x48fbe8,_0x47943b,!![]);}catch(_0x16997e){return BPromise[_0x23c0('0x1f')](_0x16997e);}return _0x48fbe8[_0x23c0('0x20')]();};}function saveUpdates(_0x50c7a7,_0x499111){return function(_0x49f876){if(_0x49f876){return _0x49f876['update'](_0x50c7a7)[_0x23c0('0x21')](function(_0x1f6330){return _0x1f6330;});}return null;};}function removeEntity(_0x415544,_0x372cb8){return function(_0x22b10d){if(_0x22b10d){return _0x22b10d[_0x23c0('0x22')]()[_0x23c0('0x21')](function(){_0x415544['status'](0xcc)[_0x23c0('0x16')]();});}};}function handleEntityNotFound(_0xb27100,_0x439c68){return function(_0x1cbc24){if(!_0x1cbc24){_0xb27100[_0x23c0('0x23')](0x194);}return _0x1cbc24;};}function handleError(_0x2a4c2d,_0x4bef46){_0x4bef46=_0x4bef46||0x1f4;return function(_0xe89fb4){logger[_0x23c0('0x24')](_0xe89fb4[_0x23c0('0x25')]);if(_0xe89fb4[_0x23c0('0x26')]){delete _0xe89fb4[_0x23c0('0x26')];}_0x2a4c2d[_0x23c0('0x17')](_0x4bef46)[_0x23c0('0x27')](_0xe89fb4);};}exports[_0x23c0('0x28')]=function(_0x8e3702,_0x544e24){var _0x193249={},_0x5b067a={},_0x1b8a3d={'count':0x0,'rows':[]};var _0xe96222=_[_0x23c0('0x29')](db[_0x23c0('0x2a')][_0x23c0('0x2b')],function(_0x5b2f5b){return{'name':_0x5b2f5b['fieldName'],'type':_0x5b2f5b[_0x23c0('0x2c')]['key']};});_0x5b067a[_0x23c0('0x2d')]=_[_0x23c0('0x29')](_0xe96222,_0x23c0('0x26'));_0x5b067a[_0x23c0('0x2e')]=_['keys'](_0x8e3702[_0x23c0('0x2e')]);_0x5b067a['filters']=_[_0x23c0('0x2f')](_0x5b067a[_0x23c0('0x2d')],_0x5b067a[_0x23c0('0x2e')]);_0x193249[_0x23c0('0x30')]=_[_0x23c0('0x2f')](_0x5b067a['model'],qs[_0x23c0('0x31')](_0x8e3702[_0x23c0('0x2e')][_0x23c0('0x31')]));_0x193249[_0x23c0('0x30')]=_0x193249[_0x23c0('0x30')][_0x23c0('0x32')]?_0x193249[_0x23c0('0x30')]:_0x5b067a['model'];if(!_0x8e3702[_0x23c0('0x2e')][_0x23c0('0x33')](_0x23c0('0x34'))){_0x193249['limit']=qs[_0x23c0('0x1b')](_0x8e3702['query'][_0x23c0('0x1b')]);_0x193249[_0x23c0('0x19')]=qs[_0x23c0('0x19')](_0x8e3702[_0x23c0('0x2e')][_0x23c0('0x19')]);}_0x193249[_0x23c0('0x35')]=qs[_0x23c0('0x36')](_0x8e3702[_0x23c0('0x2e')][_0x23c0('0x36')]);_0x193249[_0x23c0('0x37')]=qs[_0x23c0('0x38')](_[_0x23c0('0x39')](_0x8e3702[_0x23c0('0x2e')],_0x5b067a[_0x23c0('0x38')]),_0xe96222);if(_0x8e3702[_0x23c0('0x2e')][_0x23c0('0x3a')]){_0x193249[_0x23c0('0x37')]=_[_0x23c0('0x3b')](_0x193249[_0x23c0('0x37')],{'$or':_[_0x23c0('0x29')](_0xe96222,function(_0x2f929f){if(_0x2f929f[_0x23c0('0x2c')]!==_0x23c0('0x3c')){var _0x823fb={};_0x823fb[_0x2f929f[_0x23c0('0x26')]]={'$like':'%'+_0x8e3702[_0x23c0('0x2e')][_0x23c0('0x3a')]+'%'};return _0x823fb;}})});}_0x193249=_['merge']({},_0x193249,_0x8e3702[_0x23c0('0x3d')]);var _0x30574f={'where':_0x193249[_0x23c0('0x37')]};return db[_0x23c0('0x2a')][_0x23c0('0x1c')](_0x30574f)[_0x23c0('0x21')](function(_0x5729b2){_0x1b8a3d[_0x23c0('0x1c')]=_0x5729b2;if(_0x8e3702['query'][_0x23c0('0x3e')]){_0x193249[_0x23c0('0x3f')]=[{'all':!![]}];}return db[_0x23c0('0x2a')]['findAll'](_0x193249);})[_0x23c0('0x21')](function(_0x1f5f56){_0x1b8a3d[_0x23c0('0x40')]=_0x1f5f56;return _0x1b8a3d;})['then'](respondWithFilteredResult(_0x544e24,_0x193249))[_0x23c0('0x41')](handleError(_0x544e24,null));};exports[_0x23c0('0x42')]=function(_0x165a51,_0x42df17){var _0x957d52={'raw':!![],'where':{'id':_0x165a51[_0x23c0('0x43')]['id']}},_0x247ec8={};_0x247ec8[_0x23c0('0x2d')]=_['keys'](db[_0x23c0('0x2a')][_0x23c0('0x2b')]);_0x247ec8['query']=_[_0x23c0('0x44')](_0x165a51[_0x23c0('0x2e')]);_0x247ec8[_0x23c0('0x38')]=_[_0x23c0('0x2f')](_0x247ec8[_0x23c0('0x2d')],_0x247ec8[_0x23c0('0x2e')]);_0x957d52[_0x23c0('0x30')]=_[_0x23c0('0x2f')](_0x247ec8[_0x23c0('0x2d')],qs[_0x23c0('0x31')](_0x165a51['query']['fields']));_0x957d52[_0x23c0('0x30')]=_0x957d52[_0x23c0('0x30')][_0x23c0('0x32')]?_0x957d52[_0x23c0('0x30')]:_0x247ec8[_0x23c0('0x2d')];if(_0x165a51[_0x23c0('0x2e')][_0x23c0('0x3e')]){_0x957d52[_0x23c0('0x3f')]=[{'all':!![]}];}_0x957d52=_[_0x23c0('0x3b')]({},_0x957d52,_0x165a51[_0x23c0('0x3d')]);return db['FaxApplication'][_0x23c0('0x45')](_0x957d52)['then'](handleEntityNotFound(_0x42df17,null))[_0x23c0('0x21')](respondWithResult(_0x42df17,null))[_0x23c0('0x41')](handleError(_0x42df17,null));};exports[_0x23c0('0x46')]=function(_0x2bb062,_0x13d5e5){return db[_0x23c0('0x2a')]['create'](_0x2bb062['body'],{})[_0x23c0('0x21')](respondWithResult(_0x13d5e5,0xc9))[_0x23c0('0x41')](handleError(_0x13d5e5,null));};exports[_0x23c0('0x47')]=function(_0x5d974d,_0x440d32){if(_0x5d974d[_0x23c0('0x48')]['id']){delete _0x5d974d[_0x23c0('0x48')]['id'];}return db[_0x23c0('0x2a')][_0x23c0('0x45')]({'where':{'id':_0x5d974d[_0x23c0('0x43')]['id']}})[_0x23c0('0x21')](handleEntityNotFound(_0x440d32,null))['then'](saveUpdates(_0x5d974d['body'],null))[_0x23c0('0x21')](respondWithResult(_0x440d32,null))['catch'](handleError(_0x440d32,null));};exports[_0x23c0('0x22')]=function(_0x308959,_0x287cb5){return db[_0x23c0('0x2a')][_0x23c0('0x45')]({'where':{'id':_0x308959[_0x23c0('0x43')]['id']}})[_0x23c0('0x21')](handleEntityNotFound(_0x287cb5,null))[_0x23c0('0x21')](removeEntity(_0x287cb5,null))['catch'](handleError(_0x287cb5,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 9cef8ba..2b751e7 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 _0x0099=['utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','./faxApplication.attributes','define','FaxApplication','utf8mb4'];(function(_0x1de309,_0x2f9461){var _0x236b12=function(_0x105bdf){while(--_0x105bdf){_0x1de309['push'](_0x1de309['shift']());}};_0x236b12(++_0x2f9461);}(_0x0099,0x12a));var _0x9009=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0x0099[_0x2f3ecd];return _0xffdc44;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9009('0x0'))(_0x9009('0x1'));var moment=require(_0x9009('0x2'));var BPromise=require(_0x9009('0x3'));var rp=require(_0x9009('0x4'));var fs=require('fs');var path=require(_0x9009('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9009('0x6'));module['exports']=function(_0x351785,_0xa560a7){return _0x351785[_0x9009('0x7')](_0x9009('0x8'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9009('0x9'),'collate':_0x9009('0xa')});}; \ No newline at end of file +var _0x3289=['./faxApplication.attributes','exports','define','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x890600,_0x5e8f48){var _0x56ff6d=function(_0x3e1db0){while(--_0x3e1db0){_0x890600['push'](_0x890600['shift']());}};_0x56ff6d(++_0x5e8f48);}(_0x3289,0xad));var _0x9328=function(_0x42c9f0,_0x1ac906){_0x42c9f0=_0x42c9f0-0x0;var _0x27ffe5=_0x3289[_0x42c9f0];return _0x27ffe5;};'use strict';var _=require(_0x9328('0x0'));var util=require(_0x9328('0x1'));var logger=require(_0x9328('0x2'))(_0x9328('0x3'));var moment=require(_0x9328('0x4'));var BPromise=require(_0x9328('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9328('0x6'));var rimraf=require(_0x9328('0x7'));var config=require(_0x9328('0x8'));var attributes=require(_0x9328('0x9'));module[_0x9328('0xa')]=function(_0x204945,_0x59e45b){return _0x204945[_0x9328('0xb')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9328('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index d713b48..d7c1652 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 _0x9589=['message','catch','UpdateFaxApplication','update','options','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x20ca21,_0x1a5dd9){var _0x1fc347=function(_0xc07fcc){while(--_0xc07fcc){_0x20ca21['push'](_0x20ca21['shift']());}};_0x1fc347(++_0x1a5dd9);}(_0x9589,0xbc));var _0x9958=function(_0x4da6f8,_0x3d3fd6){_0x4da6f8=_0x4da6f8-0x0;var _0x43f641=_0x9589[_0x4da6f8];return _0x43f641;};'use strict';var _=require(_0x9958('0x0'));var util=require(_0x9958('0x1'));var moment=require(_0x9958('0x2'));var BPromise=require(_0x9958('0x3'));var rs=require(_0x9958('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9958('0x5'))['db'];var utils=require(_0x9958('0x6'));var logger=require(_0x9958('0x7'))('rpc');var config=require(_0x9958('0x8'));var jayson=require(_0x9958('0x9'));var client=jayson[_0x9958('0xa')][_0x9958('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4225da,_0x2c3eaf,_0x5750c5){return new BPromise(function(_0x2ac795,_0x19f3b3){return client[_0x9958('0xc')](_0x4225da,_0x5750c5)[_0x9958('0xd')](function(_0x21f35c){logger[_0x9958('0xe')](_0x9958('0xf'),_0x2c3eaf,_0x9958('0x10'));logger[_0x9958('0x11')](_0x9958('0x12'),_0x2c3eaf,_0x9958('0x10'),JSON[_0x9958('0x13')](_0x21f35c));if(_0x21f35c[_0x9958('0x14')]){if(_0x21f35c[_0x9958('0x14')][_0x9958('0x15')]===0x1f4){logger[_0x9958('0x14')](_0x9958('0xf'),_0x2c3eaf,_0x21f35c[_0x9958('0x14')]['message']);return _0x19f3b3(_0x21f35c[_0x9958('0x14')]['message']);}logger[_0x9958('0x14')]('FaxApplication,\x20%s,\x20%s',_0x2c3eaf,_0x21f35c[_0x9958('0x14')][_0x9958('0x16')]);return _0x2ac795(_0x21f35c[_0x9958('0x14')][_0x9958('0x16')]);}else{logger['info'](_0x9958('0xf'),_0x2c3eaf,_0x9958('0x10'));_0x2ac795(_0x21f35c['result']['message']);}})[_0x9958('0x17')](function(_0x4a27cf){logger[_0x9958('0x14')](_0x9958('0xf'),_0x2c3eaf,_0x4a27cf);_0x19f3b3(_0x4a27cf);});});}exports[_0x9958('0x18')]=function(_0x33b903){var _0x1cd821=this;return new Promise(function(_0x3d6cb2,_0x5800ca){return db['FaxApplication'][_0x9958('0x19')](_0x33b903['body'],{'raw':_0x33b903['options']?_0x33b903[_0x9958('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33b903['options']?_0x33b903[_0x9958('0x1a')][_0x9958('0x1b')]||null:null,'attributes':_0x33b903[_0x9958('0x1a')]?_0x33b903['options'][_0x9958('0x1c')]||null:null,'limit':_0x33b903[_0x9958('0x1a')]?_0x33b903[_0x9958('0x1a')][_0x9958('0x1d')]||null:null})[_0x9958('0xd')](function(_0x396913){logger[_0x9958('0xe')](_0x9958('0x18'),_0x33b903);logger[_0x9958('0x11')](_0x9958('0x18'),_0x33b903,JSON[_0x9958('0x13')](_0x396913));_0x3d6cb2(_0x396913);})[_0x9958('0x17')](function(_0x2eae22){logger['error'](_0x9958('0x18'),_0x2eae22[_0x9958('0x16')],_0x33b903);_0x5800ca(_0x1cd821[_0x9958('0x14')](0x1f4,_0x2eae22['message']));});});}; \ No newline at end of file +var _0x29a3=['jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','update','body','options','limit','debug','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xa9031,_0x12627f){var _0x3abbfe=function(_0x46f483){while(--_0x46f483){_0xa9031['push'](_0xa9031['shift']());}};_0x3abbfe(++_0x12627f);}(_0x29a3,0x141));var _0x329a=function(_0x262323,_0x4a81f1){_0x262323=_0x262323-0x0;var _0xa963c3=_0x29a3[_0x262323];return _0xa963c3;};'use strict';var _=require(_0x329a('0x0'));var util=require(_0x329a('0x1'));var moment=require('moment');var BPromise=require(_0x329a('0x2'));var rs=require(_0x329a('0x3'));var fs=require('fs');var Redis=require(_0x329a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x329a('0x5'));var logger=require(_0x329a('0x6'))(_0x329a('0x7'));var config=require(_0x329a('0x8'));var jayson=require(_0x329a('0x9'));var client=jayson[_0x329a('0xa')][_0x329a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26047b,_0x183885,_0x4d008d){return new BPromise(function(_0x585371,_0xa50cb9){return client[_0x329a('0xc')](_0x26047b,_0x4d008d)[_0x329a('0xd')](function(_0x3d9c0e){logger[_0x329a('0xe')](_0x329a('0xf'),_0x183885,_0x329a('0x10'));logger['debug'](_0x329a('0x11'),_0x183885,_0x329a('0x10'),JSON[_0x329a('0x12')](_0x3d9c0e));if(_0x3d9c0e[_0x329a('0x13')]){if(_0x3d9c0e[_0x329a('0x13')][_0x329a('0x14')]===0x1f4){logger[_0x329a('0x13')](_0x329a('0xf'),_0x183885,_0x3d9c0e[_0x329a('0x13')][_0x329a('0x15')]);return _0xa50cb9(_0x3d9c0e[_0x329a('0x13')][_0x329a('0x15')]);}logger[_0x329a('0x13')](_0x329a('0xf'),_0x183885,_0x3d9c0e[_0x329a('0x13')][_0x329a('0x15')]);return _0x585371(_0x3d9c0e['error']['message']);}else{logger['info'](_0x329a('0xf'),_0x183885,_0x329a('0x10'));_0x585371(_0x3d9c0e[_0x329a('0x16')][_0x329a('0x15')]);}})[_0x329a('0x17')](function(_0x1c5981){logger[_0x329a('0x13')](_0x329a('0xf'),_0x183885,_0x1c5981);_0xa50cb9(_0x1c5981);});});}exports[_0x329a('0x18')]=function(_0x285545){var _0x1e717a=this;return new Promise(function(_0x2a9be2,_0x30bd89){return db['FaxApplication'][_0x329a('0x19')](_0x285545[_0x329a('0x1a')],{'raw':_0x285545['options']?_0x285545['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x285545[_0x329a('0x1b')]?_0x285545[_0x329a('0x1b')]['where']||null:null,'attributes':_0x285545['options']?_0x285545[_0x329a('0x1b')]['attributes']||null:null,'limit':_0x285545[_0x329a('0x1b')]?_0x285545['options'][_0x329a('0x1c')]||null:null})[_0x329a('0xd')](function(_0x1fa051){logger[_0x329a('0xe')](_0x329a('0x18'),_0x285545);logger[_0x329a('0x1d')](_0x329a('0x18'),_0x285545,JSON[_0x329a('0x12')](_0x1fa051));_0x2a9be2(_0x1fa051);})[_0x329a('0x17')](function(_0x1d301d){logger['error']('UpdateFaxApplication',_0x1d301d[_0x329a('0x15')],_0x285545);_0x30bd89(_0x1e717a[_0x329a('0x13')](0x1f4,_0x1d301d[_0x329a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 7e4e603..8dcae6b 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 _0x2547=['delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show','update'];(function(_0x5ec09b,_0x12d654){var _0x5a8482=function(_0x3e250f){while(--_0x3e250f){_0x5ec09b['push'](_0x5ec09b['shift']());}};_0x5a8482(++_0x12d654);}(_0x2547,0x1cd));var _0x7254=function(_0x8bc9a8,_0x38706a){_0x8bc9a8=_0x8bc9a8-0x0;var _0x2175e1=_0x2547[_0x8bc9a8];return _0x2175e1;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['post']('/',auth[_0x7254('0xa')](),controller['create']);router['put']('/:id',auth[_0x7254('0xa')](),controller[_0x7254('0xe')]);router[_0x7254('0xf')](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);module['exports']=router; \ No newline at end of file +var _0x1775=['../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1e8afb,_0x478986){var _0x905a06=function(_0x52afac){while(--_0x52afac){_0x1e8afb['push'](_0x1e8afb['shift']());}};_0x905a06(++_0x478986);}(_0x1775,0x1db));var _0x5177=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1775[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x5177('0x0'));var path=require(_0x5177('0x1'));var timeout=require(_0x5177('0x2'));var express=require(_0x5177('0x3'));var router=express[_0x5177('0x4')]();var fs_extra=require(_0x5177('0x5'));var auth=require(_0x5177('0x6'));var interaction=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var controller=require(_0x5177('0x9'));router[_0x5177('0xa')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0xc')]);router[_0x5177('0xa')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0xe')]);router[_0x5177('0xf')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0x10')]);router[_0x5177('0x11')](_0x5177('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x5177('0x12')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0x13')]);module[_0x5177('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index daa993b..1f4b509 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 _0x6343=['BOOLEAN','DATE','STRING','out','INTEGER'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6343,0x168));var _0x3634=function(_0xc29210,_0x320db7){_0xc29210=_0xc29210-0x0;var _0x3407bf=_0x6343[_0xc29210];return _0x3407bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x3634('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3634('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3634('0x1')]},'fax':{'type':Sequelize[_0x3634('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x3634('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3634('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3634('0x3')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x3634('0x4')]}}; \ No newline at end of file +var _0x1c9a=['STRING','DATE','ENUM','out','INTEGER','sequelize','BOOLEAN'];(function(_0x4c1d62,_0x5bb898){var _0x216680=function(_0xce4d5c){while(--_0xce4d5c){_0x4c1d62['push'](_0x4c1d62['shift']());}};_0x216680(++_0x5bb898);}(_0x1c9a,0x98));var _0xa1c9=function(_0x147d12,_0x141ea5){_0x147d12=_0x147d12-0x0;var _0x91b2=_0x1c9a[_0x147d12];return _0x91b2;};'use strict';var Sequelize=require(_0xa1c9('0x0'));module['exports']={'closed':{'type':Sequelize[_0xa1c9('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xa1c9('0x2')]},'secondDisposition':{'type':Sequelize[_0xa1c9('0x2')]},'thirdDisposition':{'type':Sequelize[_0xa1c9('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xa1c9('0x3')]},'fax':{'type':Sequelize[_0xa1c9('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xa1c9('0x4')]('in',_0xa1c9('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xa1c9('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xa1c9('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index a74842e..9f667b5 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 _0x2532=['json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','stack','name','send','index','map','FaxInteraction','fieldName','type','key','getOptions','findAll','query','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','include','merge','find','catch','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','rows','addTags','spread','Tag','faxInteractionTags:save','removeTags','unix','toString','root','files','tmp','join','Attachment','createdAt','get','mkdirSync','Messages','basename','existsSync','createReadStream','resolve','download','log','rimraf','zip-dir','moment','bluebird','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','api','../../mysqldb','defaults','redis','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end'];(function(_0x30c5af,_0x9bab42){var _0xffc917=function(_0x3717b9){while(--_0x3717b9){_0x30c5af['push'](_0x30c5af['shift']());}};_0xffc917(++_0x9bab42);}(_0x2532,0xb3));var _0x2253=function(_0x2d2f17,_0x2bd8a9){_0x2d2f17=_0x2d2f17-0x0;var _0x5a49ae=_0x2532[_0x2d2f17];return _0x5a49ae;};'use strict';var rimraf=require(_0x2253('0x0'));var zipdir=require(_0x2253('0x1'));var moment=require(_0x2253('0x2'));var BPromise=require(_0x2253('0x3'));var util=require(_0x2253('0x4'));var path=require(_0x2253('0x5'));var fs=require('fs');var _=require(_0x2253('0x6'));var Redis=require('ioredis');var interaction=require(_0x2253('0x7'));var qs=require(_0x2253('0x8'));var logger=require('../../config/logger')(_0x2253('0x9'));var config=require('../../config/environment');var db=require(_0x2253('0xa'))['db'];config['redis']=_[_0x2253('0xb')](config[_0x2253('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x2253('0xd'))(new Redis(config[_0x2253('0xc')]));require(_0x2253('0xe'))[_0x2253('0xf')](socket);function respondWithStatusCode(_0x44bd24,_0x316578){_0x316578=_0x316578||0xcc;return function(_0x5a026a){if(_0x5a026a){return _0x44bd24[_0x2253('0x10')](_0x316578);}return _0x44bd24[_0x2253('0x11')](_0x316578)[_0x2253('0x12')]();};}function respondWithResult(_0x1589f3,_0x4a53ec){_0x4a53ec=_0x4a53ec||0xc8;return function(_0x58cfd7){if(_0x58cfd7){return _0x1589f3[_0x2253('0x11')](_0x4a53ec)[_0x2253('0x13')](_0x58cfd7);}};}function respondWithFilteredResult(_0x11e26e,_0x35f38b){return function(_0xf2f3d9){if(_0xf2f3d9){var _0x125903=typeof _0x35f38b[_0x2253('0x14')]===_0x2253('0x15')&&typeof _0x35f38b['limit']===_0x2253('0x15');var _0x5b366b=_0xf2f3d9[_0x2253('0x16')];var _0x49d239=_0x125903?0x0:_0x35f38b[_0x2253('0x14')];var _0x31e3bd=_0x125903?_0xf2f3d9[_0x2253('0x16')]:_0x35f38b[_0x2253('0x14')]+_0x35f38b[_0x2253('0x17')];var _0x59bebe;if(_0x31e3bd>=_0x5b366b){_0x31e3bd=_0x5b366b;_0x59bebe=0xc8;}else{_0x59bebe=0xce;}_0x11e26e[_0x2253('0x11')](_0x59bebe);return _0x11e26e[_0x2253('0x18')](_0x2253('0x19'),_0x49d239+'-'+_0x31e3bd+'/'+_0x5b366b)['json'](_0xf2f3d9);}return null;};}function saveUpdates(_0x52c624){return function(_0xc6379f){if(_0xc6379f){return _0xc6379f[_0x2253('0x1a')](_0x52c624)[_0x2253('0x1b')](function(_0x4c1a39){return _0x4c1a39;});}return null;};}function removeEntity(_0xcba674){return function(_0x1ec369){if(_0x1ec369){return _0x1ec369[_0x2253('0x1c')]()[_0x2253('0x1b')](function(){_0xcba674[_0x2253('0x11')](0xcc)[_0x2253('0x12')]();});}};}function handleEntityNotFound(_0x5150df){return function(_0x4c7d65){if(!_0x4c7d65){_0x5150df['sendStatus'](0x194);}return _0x4c7d65;};}function handleError(_0x292eb3,_0x33e547){_0x33e547=_0x33e547||0x1f4;return function(_0x49e58f){logger['error'](_0x49e58f[_0x2253('0x1d')]);if(_0x49e58f['name']){delete _0x49e58f[_0x2253('0x1e')];}_0x292eb3[_0x2253('0x11')](_0x33e547)[_0x2253('0x1f')](_0x49e58f);};}exports[_0x2253('0x20')]=function(_0x2123e4,_0x455eec){var _0x53131f={};var _0x51848b=_[_0x2253('0x21')](db[_0x2253('0x22')]['rawAttributes'],function(_0x3edad7){return{'name':_0x3edad7[_0x2253('0x23')],'type':_0x3edad7[_0x2253('0x24')][_0x2253('0x25')]};});_0x53131f=qs[_0x2253('0x26')](_0x51848b,_0x2123e4);return interaction[_0x2253('0x27')]('fax',_0x2123e4[_0x2253('0x28')],_0x2123e4['user'],_0x53131f,_0x51848b)[_0x2253('0x1b')](respondWithFilteredResult(_0x455eec,_0x53131f))['catch'](handleError(_0x455eec,null));};exports['show']=function(_0x5046c2,_0x44a91b){var _0x509a8b={'raw':![],'where':{'id':_0x5046c2[_0x2253('0x29')]['id']}},_0x143ff5={};_0x143ff5[_0x2253('0x2a')]=_[_0x2253('0x2b')](db[_0x2253('0x22')][_0x2253('0x2c')]);_0x143ff5[_0x2253('0x28')]=_[_0x2253('0x2b')](_0x5046c2['query']);_0x143ff5[_0x2253('0x2d')]=_[_0x2253('0x2e')](_0x143ff5[_0x2253('0x2a')],_0x143ff5[_0x2253('0x28')]);_0x509a8b[_0x2253('0x2f')]=_[_0x2253('0x2e')](_0x143ff5[_0x2253('0x2a')],qs[_0x2253('0x30')](_0x5046c2[_0x2253('0x28')][_0x2253('0x30')]));_0x509a8b[_0x2253('0x2f')]=_0x509a8b[_0x2253('0x2f')][_0x2253('0x31')]?_0x509a8b[_0x2253('0x2f')]:_0x143ff5['model'];if(_0x5046c2[_0x2253('0x28')]['includeAll']){_0x509a8b[_0x2253('0x32')]=[{'all':!![]}];}_0x509a8b=_[_0x2253('0x33')]({},_0x509a8b,_0x5046c2['options']);return db[_0x2253('0x22')][_0x2253('0x34')](_0x509a8b)['then'](handleEntityNotFound(_0x44a91b,null))[_0x2253('0x1b')](respondWithResult(_0x44a91b,null))[_0x2253('0x35')](handleError(_0x44a91b,null));};exports[_0x2253('0x36')]=function(_0x5b4897,_0x29ad67){return db['FaxInteraction'][_0x2253('0x36')](_0x5b4897[_0x2253('0x37')],{})[_0x2253('0x1b')](respondWithResult(_0x29ad67,0xc9))[_0x2253('0x35')](handleError(_0x29ad67,null));};exports[_0x2253('0x1a')]=function(_0x241eee,_0x46954b){if(_0x241eee[_0x2253('0x37')]['id']){delete _0x241eee[_0x2253('0x37')]['id'];}return db['FaxInteraction'][_0x2253('0x34')]({'where':{'id':_0x241eee[_0x2253('0x29')]['id']}})[_0x2253('0x1b')](handleEntityNotFound(_0x46954b,null))[_0x2253('0x1b')](saveUpdates(_0x241eee['body'],null))[_0x2253('0x1b')](respondWithResult(_0x46954b,null))[_0x2253('0x35')](handleError(_0x46954b,null));};exports[_0x2253('0x1c')]=function(_0x28233c,_0x4af4e3){return db['FaxInteraction'][_0x2253('0x34')]({'where':{'id':_0x28233c[_0x2253('0x29')]['id']}})[_0x2253('0x1b')](handleEntityNotFound(_0x4af4e3,null))[_0x2253('0x1b')](removeEntity(_0x4af4e3,null))['catch'](handleError(_0x4af4e3,null));};exports[_0x2253('0x38')]=function(_0x149f1d,_0x22b7b1){return db[_0x2253('0x22')]['describe']()[_0x2253('0x1b')](respondWithResult(_0x22b7b1,null))[_0x2253('0x35')](handleError(_0x22b7b1,null));};exports[_0x2253('0x39')]=function(_0x2ee8e7,_0x90ff82){return db[_0x2253('0x3a')]['find']({'where':{'id':_0x2ee8e7[_0x2253('0x29')]['id']}})[_0x2253('0x1b')](handleEntityNotFound(_0x90ff82,null))['then'](function(_0x517df0){if(_0x517df0){return _0x517df0[_0x2253('0x39')](_0x2ee8e7[_0x2253('0x37')][_0x2253('0x3b')],_[_0x2253('0x3c')](_0x2ee8e7[_0x2253('0x37')],[_0x2253('0x3b'),'id'])||{});}})[_0x2253('0x1b')](respondWithResult(_0x90ff82,null))[_0x2253('0x35')](handleError(_0x90ff82,null));};exports[_0x2253('0x3d')]=function(_0x2470fe,_0x2c8a2e){var _0x26da6e={'raw':![],'where':{}};var _0x30b857={};var _0x4a54c7={'count':0x0,'rows':[]};return db[_0x2253('0x22')][_0x2253('0x3e')]({'where':{'id':_0x2470fe[_0x2253('0x29')]['id']}})[_0x2253('0x1b')](handleEntityNotFound(_0x2c8a2e,null))[_0x2253('0x1b')](function(_0x1c5b91){if(_0x1c5b91){_0x30b857[_0x2253('0x2a')]=_[_0x2253('0x2b')](db['FaxMessage'][_0x2253('0x2c')]);_0x30b857[_0x2253('0x28')]=_[_0x2253('0x2b')](_0x2470fe[_0x2253('0x28')]);_0x30b857[_0x2253('0x2d')]=_[_0x2253('0x2e')](_0x30b857[_0x2253('0x2a')],_0x30b857[_0x2253('0x28')]);_0x26da6e[_0x2253('0x2f')]=_[_0x2253('0x2e')](_0x30b857['model'],qs['fields'](_0x2470fe[_0x2253('0x28')]['fields']));_0x26da6e[_0x2253('0x2f')]=_0x26da6e[_0x2253('0x2f')][_0x2253('0x31')]?_0x26da6e[_0x2253('0x2f')]:_0x30b857[_0x2253('0x2a')];if(!_0x2470fe[_0x2253('0x28')][_0x2253('0x3f')](_0x2253('0x40'))){_0x26da6e[_0x2253('0x17')]=qs[_0x2253('0x17')](_0x2470fe[_0x2253('0x28')][_0x2253('0x17')]);_0x26da6e[_0x2253('0x14')]=qs[_0x2253('0x14')](_0x2470fe['query'][_0x2253('0x14')]);}_0x26da6e[_0x2253('0x41')]=qs[_0x2253('0x42')](_0x2470fe['query'][_0x2253('0x42')]);_0x26da6e[_0x2253('0x43')]=qs[_0x2253('0x2d')](_['pick'](_0x2470fe[_0x2253('0x28')],_0x30b857[_0x2253('0x2d')]));_0x26da6e[_0x2253('0x43')][_0x2253('0x44')]=_0x1c5b91['id'];if(_0x2470fe[_0x2253('0x28')][_0x2253('0x45')]){_0x26da6e[_0x2253('0x43')]=_[_0x2253('0x33')](_0x26da6e[_0x2253('0x43')],{'$or':_[_0x2253('0x21')](_0x26da6e[_0x2253('0x2f')],function(_0x1131a0){var _0x2d7cd2={};_0x2d7cd2[_0x1131a0]={'$like':'%'+_0x2470fe[_0x2253('0x28')]['filter']+'%'};return _0x2d7cd2;})});}if(_0x2470fe[_0x2253('0x28')]['$gte']){var _0x1effcb=_0x2470fe['query'][_0x2253('0x46')][_0x2253('0x47')](',');var _0x4dd150={};_0x4dd150[_0x1effcb[0x0]]={'$gte':moment(_0x1effcb[0x1])[_0x2253('0x48')](_0x2253('0x49'))};_0x26da6e['where']=_[_0x2253('0x33')](_0x26da6e['where'],_0x4dd150);}_0x26da6e=_[_0x2253('0x33')]({},_0x26da6e,_0x2470fe[_0x2253('0x4a')]);return db['FaxMessage'][_0x2253('0x16')]({'where':_0x26da6e['where']})[_0x2253('0x1b')](function(_0x124045){_0x4a54c7[_0x2253('0x16')]=_0x124045;if(_0x2470fe[_0x2253('0x28')][_0x2253('0x4b')]){_0x26da6e[_0x2253('0x32')]=[{'all':!![]}];}return db['FaxMessage'][_0x2253('0x27')](_0x26da6e);})[_0x2253('0x1b')](function(_0x298b10){_0x4a54c7[_0x2253('0x4c')]=_0x298b10;return _0x4a54c7;});}})[_0x2253('0x1b')](respondWithFilteredResult(_0x2c8a2e,_0x26da6e))[_0x2253('0x35')](handleError(_0x2c8a2e,null));};exports[_0x2253('0x4d')]=function(_0x4acf60,_0x5b4755){return db[_0x2253('0x22')]['find']({'where':{'id':_0x4acf60[_0x2253('0x29')]['id']}})[_0x2253('0x1b')](handleEntityNotFound(_0x5b4755,null))[_0x2253('0x1b')](function(_0x3a072){if(_0x3a072){return _0x3a072['setTags'](_0x4acf60['body'][_0x2253('0x3b')],_[_0x2253('0x3c')](_0x4acf60[_0x2253('0x37')],[_0x2253('0x3b'),'id'])||{})[_0x2253('0x4e')](function(){return db[_0x2253('0x4f')][_0x2253('0x27')]({'attributes':['id',_0x2253('0x1e'),'color'],'where':{'id':_0x4acf60[_0x2253('0x37')]['ids']}});})[_0x2253('0x1b')](function(_0x2247c3){socket['emit'](_0x2253('0x50'),{'id':Number(_0x4acf60[_0x2253('0x29')]['id']),'tags':_0x2247c3||[]});return{'id':Number(_0x4acf60[_0x2253('0x29')]['id']),'tags':_0x2247c3||[]};});}})[_0x2253('0x1b')](respondWithResult(_0x5b4755,null))['catch'](handleError(_0x5b4755,null));};exports[_0x2253('0x51')]=function(_0x230eba,_0x34dee8){return db[_0x2253('0x22')][_0x2253('0x34')]({'where':{'id':_0x230eba['params']['id']}})['then'](handleEntityNotFound(_0x34dee8,null))[_0x2253('0x1b')](function(_0x4cb3e3){if(_0x4cb3e3){return _0x4cb3e3[_0x2253('0x51')](_0x230eba[_0x2253('0x28')][_0x2253('0x3b')]);}})[_0x2253('0x1b')](respondWithStatusCode(_0x34dee8,null))[_0x2253('0x35')](handleError(_0x34dee8,null));};exports['download']=function(_0x15c14f,_0x33aa44){var _0x276e90=moment()[_0x2253('0x52')]()[_0x2253('0x53')]();var _0x147e28=path['join'](config[_0x2253('0x54')],'server',_0x2253('0x55'),_0x2253('0x56'));var _0x1b1d04=path[_0x2253('0x57')](config[_0x2253('0x54')],'server','files','attachments');var _0x113fa4=path[_0x2253('0x57')](_0x147e28,_0x276e90);var _0x4d04ae=util[_0x2253('0x48')]('transcript-%d-%s.zip',_0x15c14f[_0x2253('0x29')]['id'],_0x276e90);var _0x1e19db=path[_0x2253('0x57')](_0x147e28,_0x4d04ae);var _0x25d7ef=[];_0x25d7ef['push']({'model':db['Attachment'],'as':_0x2253('0x58'),'raw':!![]});var _0x6b3036=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0x2253('0x37'),_0x2253('0x59')],'include':_0x25d7ef}];return db[_0x2253('0x22')][_0x2253('0x34')]({'where':{'id':_0x15c14f[_0x2253('0x29')]['id']},'include':_0x6b3036})[_0x2253('0x1b')](handleEntityNotFound(_0x33aa44,null))[_0x2253('0x1b')](function(_0x4c1a93){if(_0x4c1a93&&_0x4c1a93['Messages']){var _0x3b4aa1=_0x4c1a93[_0x2253('0x5a')]({'plain':!![]});fs[_0x2253('0x5b')](_0x113fa4);for(var _0x5bc0c4=0x0;_0x5bc0c4<_0x3b4aa1[_0x2253('0x5c')][_0x2253('0x31')];_0x5bc0c4++){var _0x16948c=_0x3b4aa1[_0x2253('0x5c')][_0x5bc0c4][_0x2253('0x58')];if(_0x16948c){var _0x3fc8ef=path['join'](_0x1b1d04,_0x16948c[_0x2253('0x5d')]);if(fs[_0x2253('0x5e')](_0x3fc8ef)){fs[_0x2253('0x5f')](_0x3fc8ef)['pipe'](fs['createWriteStream'](path['join'](_0x113fa4,_0x16948c['basename'])));}}}return BPromise[_0x2253('0x60')]()[_0x2253('0x1b')](function(){return new BPromise(function(_0x3b7c98,_0x240d5c){zipdir(_0x113fa4,{'saveTo':_0x1e19db},function(_0x27fe69,_0x5ec882){if(_0x27fe69)return _0x240d5c(_0x27fe69);return _0x3b7c98(_0x5ec882);});})[_0x2253('0x1b')](function(){return new BPromise(function(_0x24c381,_0xef0731){rimraf(_0x113fa4,function(_0x24ed0e){if(_0x24ed0e)_0xef0731(_0x24ed0e);return _0x24c381();});});})['then'](function(){return _0x33aa44[_0x2253('0x61')](_0x1e19db,_0x4d04ae,function(_0x19025e){if(_0x19025e){console[_0x2253('0x62')]('err',_0x19025e);}else{fs['unlinkSync'](_0x1e19db);}});});});}else{return _0x33aa44[_0x2253('0x10')](0xc8);}})[_0x2253('0x35')](handleError(_0x33aa44,null));}; \ No newline at end of file +var _0x84db=['split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createWriteStream','resolve','log','err','unlinkSync','zip-dir','moment','bluebird','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','status','end','json','offset','undefined','limit','count','then','destroy','sendStatus','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','fax','query','user','catch','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','update','body','describe','addMessage','FaxMessage','omit','ids','hasOwnProperty','nolimit','sort','where','FaxInteractionId','$gte'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x84db,0x88));var _0xb84d=function(_0x207a6b,_0x153928){_0x207a6b=_0x207a6b-0x0;var _0x53ad5c=_0x84db[_0x207a6b];return _0x53ad5c;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xb84d('0x0'));var moment=require(_0xb84d('0x1'));var BPromise=require(_0xb84d('0x2'));var util=require('util');var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0xb84d('0x3'));var interaction=require(_0xb84d('0x4'));var qs=require(_0xb84d('0x5'));var logger=require(_0xb84d('0x6'))(_0xb84d('0x7'));var config=require(_0xb84d('0x8'));var db=require(_0xb84d('0x9'))['db'];config[_0xb84d('0xa')]=_[_0xb84d('0xb')](config['redis'],{'host':_0xb84d('0xc'),'port':0x18eb});var socket=require(_0xb84d('0xd'))(new Redis(config[_0xb84d('0xa')]));require(_0xb84d('0xe'))[_0xb84d('0xf')](socket);function respondWithStatusCode(_0x253c82,_0x45d28d){_0x45d28d=_0x45d28d||0xcc;return function(_0x30b5d6){if(_0x30b5d6){return _0x253c82['sendStatus'](_0x45d28d);}return _0x253c82[_0xb84d('0x10')](_0x45d28d)[_0xb84d('0x11')]();};}function respondWithResult(_0x595bd5,_0xec89e6){_0xec89e6=_0xec89e6||0xc8;return function(_0x53a15f){if(_0x53a15f){return _0x595bd5[_0xb84d('0x10')](_0xec89e6)[_0xb84d('0x12')](_0x53a15f);}};}function respondWithFilteredResult(_0xdd7378,_0xb28ad9){return function(_0x3350ec){if(_0x3350ec){var _0x38ec70=typeof _0xb28ad9[_0xb84d('0x13')]===_0xb84d('0x14')&&typeof _0xb28ad9[_0xb84d('0x15')]==='undefined';var _0x718df4=_0x3350ec[_0xb84d('0x16')];var _0x1301f1=_0x38ec70?0x0:_0xb28ad9[_0xb84d('0x13')];var _0x5b1e36=_0x38ec70?_0x3350ec[_0xb84d('0x16')]:_0xb28ad9[_0xb84d('0x13')]+_0xb28ad9[_0xb84d('0x15')];var _0x41290f;if(_0x5b1e36>=_0x718df4){_0x5b1e36=_0x718df4;_0x41290f=0xc8;}else{_0x41290f=0xce;}_0xdd7378['status'](_0x41290f);return _0xdd7378['set']('Content-Range',_0x1301f1+'-'+_0x5b1e36+'/'+_0x718df4)[_0xb84d('0x12')](_0x3350ec);}return null;};}function saveUpdates(_0x3a20d7){return function(_0x2e20de){if(_0x2e20de){return _0x2e20de['update'](_0x3a20d7)[_0xb84d('0x17')](function(_0x4e8d6c){return _0x4e8d6c;});}return null;};}function removeEntity(_0x30cc77){return function(_0x3af4e0){if(_0x3af4e0){return _0x3af4e0[_0xb84d('0x18')]()[_0xb84d('0x17')](function(){_0x30cc77[_0xb84d('0x10')](0xcc)[_0xb84d('0x11')]();});}};}function handleEntityNotFound(_0x3003b9){return function(_0xccd4cf){if(!_0xccd4cf){_0x3003b9[_0xb84d('0x19')](0x194);}return _0xccd4cf;};}function handleError(_0x14d676,_0x1d28eb){_0x1d28eb=_0x1d28eb||0x1f4;return function(_0x375d7d){logger[_0xb84d('0x1a')](_0x375d7d[_0xb84d('0x1b')]);if(_0x375d7d['name']){delete _0x375d7d[_0xb84d('0x1c')];}_0x14d676[_0xb84d('0x10')](_0x1d28eb)[_0xb84d('0x1d')](_0x375d7d);};}exports[_0xb84d('0x1e')]=function(_0x55fb16,_0x161895){var _0x1c3ad0={};var _0x3ed3c4=_[_0xb84d('0x1f')](db[_0xb84d('0x20')][_0xb84d('0x21')],function(_0x539c25){return{'name':_0x539c25[_0xb84d('0x22')],'type':_0x539c25[_0xb84d('0x23')][_0xb84d('0x24')]};});_0x1c3ad0=qs[_0xb84d('0x25')](_0x3ed3c4,_0x55fb16);return interaction[_0xb84d('0x26')](_0xb84d('0x27'),_0x55fb16[_0xb84d('0x28')],_0x55fb16[_0xb84d('0x29')],_0x1c3ad0,_0x3ed3c4)[_0xb84d('0x17')](respondWithFilteredResult(_0x161895,_0x1c3ad0))[_0xb84d('0x2a')](handleError(_0x161895,null));};exports['show']=function(_0x2ab351,_0xdab156){var _0x16e309={'raw':![],'where':{'id':_0x2ab351[_0xb84d('0x2b')]['id']}},_0xa21ce5={};_0xa21ce5[_0xb84d('0x2c')]=_[_0xb84d('0x2d')](db['FaxInteraction'][_0xb84d('0x21')]);_0xa21ce5['query']=_[_0xb84d('0x2d')](_0x2ab351[_0xb84d('0x28')]);_0xa21ce5[_0xb84d('0x2e')]=_[_0xb84d('0x2f')](_0xa21ce5['model'],_0xa21ce5[_0xb84d('0x28')]);_0x16e309[_0xb84d('0x30')]=_['intersection'](_0xa21ce5['model'],qs[_0xb84d('0x31')](_0x2ab351[_0xb84d('0x28')][_0xb84d('0x31')]));_0x16e309['attributes']=_0x16e309[_0xb84d('0x30')][_0xb84d('0x32')]?_0x16e309['attributes']:_0xa21ce5['model'];if(_0x2ab351['query'][_0xb84d('0x33')]){_0x16e309[_0xb84d('0x34')]=[{'all':!![]}];}_0x16e309=_[_0xb84d('0x35')]({},_0x16e309,_0x2ab351[_0xb84d('0x36')]);return db[_0xb84d('0x20')][_0xb84d('0x37')](_0x16e309)['then'](handleEntityNotFound(_0xdab156,null))[_0xb84d('0x17')](respondWithResult(_0xdab156,null))['catch'](handleError(_0xdab156,null));};exports[_0xb84d('0x38')]=function(_0x552449,_0x5cb575){return db['FaxInteraction'][_0xb84d('0x38')](_0x552449['body'],{})[_0xb84d('0x17')](respondWithResult(_0x5cb575,0xc9))[_0xb84d('0x2a')](handleError(_0x5cb575,null));};exports[_0xb84d('0x39')]=function(_0x2d259f,_0x4075d7){if(_0x2d259f[_0xb84d('0x3a')]['id']){delete _0x2d259f['body']['id'];}return db[_0xb84d('0x20')][_0xb84d('0x37')]({'where':{'id':_0x2d259f[_0xb84d('0x2b')]['id']}})[_0xb84d('0x17')](handleEntityNotFound(_0x4075d7,null))[_0xb84d('0x17')](saveUpdates(_0x2d259f['body'],null))[_0xb84d('0x17')](respondWithResult(_0x4075d7,null))[_0xb84d('0x2a')](handleError(_0x4075d7,null));};exports['destroy']=function(_0x203471,_0x5602c7){return db[_0xb84d('0x20')][_0xb84d('0x37')]({'where':{'id':_0x203471[_0xb84d('0x2b')]['id']}})[_0xb84d('0x17')](handleEntityNotFound(_0x5602c7,null))[_0xb84d('0x17')](removeEntity(_0x5602c7,null))[_0xb84d('0x2a')](handleError(_0x5602c7,null));};exports['describe']=function(_0xfed7a6,_0x57057e){return db['FaxInteraction'][_0xb84d('0x3b')]()[_0xb84d('0x17')](respondWithResult(_0x57057e,null))[_0xb84d('0x2a')](handleError(_0x57057e,null));};exports[_0xb84d('0x3c')]=function(_0x4c61e1,_0x592c06){return db[_0xb84d('0x3d')]['find']({'where':{'id':_0x4c61e1[_0xb84d('0x2b')]['id']}})[_0xb84d('0x17')](handleEntityNotFound(_0x592c06,null))['then'](function(_0x288525){if(_0x288525){return _0x288525['addMessage'](_0x4c61e1[_0xb84d('0x3a')]['ids'],_[_0xb84d('0x3e')](_0x4c61e1['body'],[_0xb84d('0x3f'),'id'])||{});}})[_0xb84d('0x17')](respondWithResult(_0x592c06,null))['catch'](handleError(_0x592c06,null));};exports['getMessages']=function(_0x414117,_0x493272){var _0x8b65ec={'raw':![],'where':{}};var _0x13c3af={};var _0x20199c={'count':0x0,'rows':[]};return db[_0xb84d('0x20')]['findOne']({'where':{'id':_0x414117[_0xb84d('0x2b')]['id']}})['then'](handleEntityNotFound(_0x493272,null))[_0xb84d('0x17')](function(_0xdddabd){if(_0xdddabd){_0x13c3af[_0xb84d('0x2c')]=_[_0xb84d('0x2d')](db[_0xb84d('0x3d')]['rawAttributes']);_0x13c3af[_0xb84d('0x28')]=_[_0xb84d('0x2d')](_0x414117['query']);_0x13c3af[_0xb84d('0x2e')]=_['intersection'](_0x13c3af[_0xb84d('0x2c')],_0x13c3af[_0xb84d('0x28')]);_0x8b65ec['attributes']=_[_0xb84d('0x2f')](_0x13c3af['model'],qs[_0xb84d('0x31')](_0x414117[_0xb84d('0x28')]['fields']));_0x8b65ec[_0xb84d('0x30')]=_0x8b65ec[_0xb84d('0x30')]['length']?_0x8b65ec['attributes']:_0x13c3af['model'];if(!_0x414117['query'][_0xb84d('0x40')](_0xb84d('0x41'))){_0x8b65ec[_0xb84d('0x15')]=qs[_0xb84d('0x15')](_0x414117[_0xb84d('0x28')]['limit']);_0x8b65ec[_0xb84d('0x13')]=qs[_0xb84d('0x13')](_0x414117[_0xb84d('0x28')][_0xb84d('0x13')]);}_0x8b65ec['order']=qs[_0xb84d('0x42')](_0x414117[_0xb84d('0x28')][_0xb84d('0x42')]);_0x8b65ec[_0xb84d('0x43')]=qs[_0xb84d('0x2e')](_['pick'](_0x414117['query'],_0x13c3af[_0xb84d('0x2e')]));_0x8b65ec[_0xb84d('0x43')][_0xb84d('0x44')]=_0xdddabd['id'];if(_0x414117['query']['filter']){_0x8b65ec[_0xb84d('0x43')]=_[_0xb84d('0x35')](_0x8b65ec[_0xb84d('0x43')],{'$or':_['map'](_0x8b65ec['attributes'],function(_0x3dc5d5){var _0x372960={};_0x372960[_0x3dc5d5]={'$like':'%'+_0x414117[_0xb84d('0x28')]['filter']+'%'};return _0x372960;})});}if(_0x414117[_0xb84d('0x28')][_0xb84d('0x45')]){var _0x1a98f4=_0x414117['query'][_0xb84d('0x45')][_0xb84d('0x46')](',');var _0x8da2fc={};_0x8da2fc[_0x1a98f4[0x0]]={'$gte':moment(_0x1a98f4[0x1])[_0xb84d('0x47')](_0xb84d('0x48'))};_0x8b65ec[_0xb84d('0x43')]=_[_0xb84d('0x35')](_0x8b65ec['where'],_0x8da2fc);}_0x8b65ec=_[_0xb84d('0x35')]({},_0x8b65ec,_0x414117['options']);return db[_0xb84d('0x3d')][_0xb84d('0x16')]({'where':_0x8b65ec[_0xb84d('0x43')]})[_0xb84d('0x17')](function(_0x3b8f47){_0x20199c[_0xb84d('0x16')]=_0x3b8f47;if(_0x414117['query'][_0xb84d('0x33')]){_0x8b65ec[_0xb84d('0x34')]=[{'all':!![]}];}return db[_0xb84d('0x3d')][_0xb84d('0x26')](_0x8b65ec);})[_0xb84d('0x17')](function(_0x52f474){_0x20199c[_0xb84d('0x49')]=_0x52f474;return _0x20199c;});}})[_0xb84d('0x17')](respondWithFilteredResult(_0x493272,_0x8b65ec))[_0xb84d('0x2a')](handleError(_0x493272,null));};exports[_0xb84d('0x4a')]=function(_0x4bc12d,_0x3fc045){return db[_0xb84d('0x20')][_0xb84d('0x37')]({'where':{'id':_0x4bc12d[_0xb84d('0x2b')]['id']}})[_0xb84d('0x17')](handleEntityNotFound(_0x3fc045,null))[_0xb84d('0x17')](function(_0x5914fa){if(_0x5914fa){return _0x5914fa[_0xb84d('0x4b')](_0x4bc12d[_0xb84d('0x3a')]['ids'],_[_0xb84d('0x3e')](_0x4bc12d[_0xb84d('0x3a')],['ids','id'])||{})[_0xb84d('0x4c')](function(){return db[_0xb84d('0x4d')][_0xb84d('0x26')]({'attributes':['id',_0xb84d('0x1c'),_0xb84d('0x4e')],'where':{'id':_0x4bc12d[_0xb84d('0x3a')][_0xb84d('0x3f')]}});})[_0xb84d('0x17')](function(_0x314bfd){socket[_0xb84d('0x4f')](_0xb84d('0x50'),{'id':Number(_0x4bc12d[_0xb84d('0x2b')]['id']),'tags':_0x314bfd||[]});return{'id':Number(_0x4bc12d[_0xb84d('0x2b')]['id']),'tags':_0x314bfd||[]};});}})[_0xb84d('0x17')](respondWithResult(_0x3fc045,null))[_0xb84d('0x2a')](handleError(_0x3fc045,null));};exports[_0xb84d('0x51')]=function(_0x8b410e,_0x412a3f){return db[_0xb84d('0x20')]['find']({'where':{'id':_0x8b410e[_0xb84d('0x2b')]['id']}})['then'](handleEntityNotFound(_0x412a3f,null))[_0xb84d('0x17')](function(_0x36c6e4){if(_0x36c6e4){return _0x36c6e4[_0xb84d('0x51')](_0x8b410e[_0xb84d('0x28')][_0xb84d('0x3f')]);}})[_0xb84d('0x17')](respondWithStatusCode(_0x412a3f,null))[_0xb84d('0x2a')](handleError(_0x412a3f,null));};exports[_0xb84d('0x52')]=function(_0x2b5db5,_0x3fb815){var _0x43ace9=moment()[_0xb84d('0x53')]()['toString']();var _0x23af4d=path[_0xb84d('0x54')](config[_0xb84d('0x55')],_0xb84d('0x56'),_0xb84d('0x57'),_0xb84d('0x58'));var _0x40d990=path['join'](config[_0xb84d('0x55')],_0xb84d('0x56'),_0xb84d('0x57'),_0xb84d('0x59'));var _0x1a878f=path[_0xb84d('0x54')](_0x23af4d,_0x43ace9);var _0x2bd763=util[_0xb84d('0x47')]('transcript-%d-%s.zip',_0x2b5db5[_0xb84d('0x2b')]['id'],_0x43ace9);var _0x2faa6e=path[_0xb84d('0x54')](_0x23af4d,_0x2bd763);var _0x21c167=[];_0x21c167[_0xb84d('0x5a')]({'model':db[_0xb84d('0x5b')],'as':'Attachment','raw':!![]});var _0x2761c7=[{'model':db['FaxMessage'],'as':_0xb84d('0x5c'),'attributes':['id',_0xb84d('0x3a'),_0xb84d('0x5d')],'include':_0x21c167}];return db[_0xb84d('0x20')][_0xb84d('0x37')]({'where':{'id':_0x2b5db5['params']['id']},'include':_0x2761c7})['then'](handleEntityNotFound(_0x3fb815,null))[_0xb84d('0x17')](function(_0x443a83){if(_0x443a83&&_0x443a83[_0xb84d('0x5c')]){var _0x35e451=_0x443a83[_0xb84d('0x5e')]({'plain':!![]});fs[_0xb84d('0x5f')](_0x1a878f);for(var _0x32a244=0x0;_0x32a244<_0x35e451[_0xb84d('0x5c')]['length'];_0x32a244++){var _0x3d67ba=_0x35e451['Messages'][_0x32a244]['Attachment'];if(_0x3d67ba){var _0xa64453=path['join'](_0x40d990,_0x3d67ba[_0xb84d('0x60')]);if(fs[_0xb84d('0x61')](_0xa64453)){fs['createReadStream'](_0xa64453)['pipe'](fs[_0xb84d('0x62')](path[_0xb84d('0x54')](_0x1a878f,_0x3d67ba['basename'])));}}}return BPromise[_0xb84d('0x63')]()['then'](function(){return new BPromise(function(_0x432d36,_0x57959b){zipdir(_0x1a878f,{'saveTo':_0x2faa6e},function(_0x3d788b,_0x6bd5cc){if(_0x3d788b)return _0x57959b(_0x3d788b);return _0x432d36(_0x6bd5cc);});})['then'](function(){return new BPromise(function(_0x38a6d8,_0x59aed6){rimraf(_0x1a878f,function(_0x3fe31f){if(_0x3fe31f)_0x59aed6(_0x3fe31f);return _0x38a6d8();});});})[_0xb84d('0x17')](function(){return _0x3fb815[_0xb84d('0x52')](_0x2faa6e,_0x2bd763,function(_0x113dda){if(_0x113dda){console[_0xb84d('0x64')](_0xb84d('0x65'),_0x113dda);}else{fs[_0xb84d('0x66')](_0x2faa6e);}});});});}else{return _0x3fb815[_0xb84d('0x19')](0xc8);}})[_0xb84d('0x2a')](handleError(_0x3fb815,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 4d4305e..bc6a040 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 _0x3a0e=['remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update'];(function(_0x4833bd,_0x2a88a1){var _0x267bfe=function(_0x1c7cb9){while(--_0x1c7cb9){_0x4833bd['push'](_0x4833bd['shift']());}};_0x267bfe(++_0x2a88a1);}(_0x3a0e,0x78));var _0xe3a0=function(_0x454697,_0x2e5871){_0x454697=_0x454697-0x0;var _0x4ef0aa=_0x3a0e[_0x454697];return _0x4ef0aa;};'use strict';var EventEmitter=require(_0xe3a0('0x0'));var FaxInteraction=require(_0xe3a0('0x1'))['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db'][_0xe3a0('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xe3a0('0x3')](0x0);var events={'afterCreate':_0xe3a0('0x4'),'afterUpdate':_0xe3a0('0x5'),'afterDestroy':_0xe3a0('0x6')};function emitEvent(_0x474987){return function(_0x5bb6bc,_0x3ef753,_0x35dd63){_0x5bb6bc[_0xe3a0('0x7')]({'attributes':['id'],'raw':!![]})[_0xe3a0('0x8')](function(_0x2ffac2){_0x5bb6bc[_0xe3a0('0x9')](_0xe3a0('0xa'),_0x2ffac2['map'](function(_0x1288b9){return{'id':_0x1288b9['id']};}));return FaxMessage[_0xe3a0('0xb')]({'where':{'FaxInteractionId':_0x5bb6bc['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x22f80d){_0x5bb6bc['setDataValue'](_0xe3a0('0xc'),_0x22f80d[_0xe3a0('0xd')]);FaxInteractionEvents[_0xe3a0('0xe')](_0x474987+':'+_0x5bb6bc['id'],_0x5bb6bc);FaxInteractionEvents['emit'](_0x474987,_0x5bb6bc);_0x35dd63(null);})[_0xe3a0('0xf')](_0x35dd63(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xe3a0('0x10')](e,emitEvent(event));}}module[_0xe3a0('0x11')]=FaxInteractionEvents; \ No newline at end of file +var _0xeb7d=['update','remove','getUsers','setDataValue','Users','map','unreadMessages','length','emit','catch','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save'];(function(_0x2bcd1f,_0x4f1972){var _0x2381ca=function(_0x51f935){while(--_0x51f935){_0x2bcd1f['push'](_0x2bcd1f['shift']());}};_0x2381ca(++_0x4f1972);}(_0xeb7d,0xeb));var _0xdeb7=function(_0x1cae00,_0x4589e4){_0x1cae00=_0x1cae00-0x0;var _0x391291=_0xeb7d[_0x1cae00];return _0x391291;};'use strict';var EventEmitter=require(_0xdeb7('0x0'));var FaxInteraction=require(_0xdeb7('0x1'))['db'][_0xdeb7('0x2')];var FaxMessage=require(_0xdeb7('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xdeb7('0x3')](0x0);var events={'afterCreate':_0xdeb7('0x4'),'afterUpdate':_0xdeb7('0x5'),'afterDestroy':_0xdeb7('0x6')};function emitEvent(_0x54f6eb){return function(_0x2655a7,_0x2906b6,_0x51a3ca){_0x2655a7[_0xdeb7('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x442853){_0x2655a7[_0xdeb7('0x8')](_0xdeb7('0x9'),_0x442853[_0xdeb7('0xa')](function(_0x43b2b6){return{'id':_0x43b2b6['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x2655a7['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x185fab){_0x2655a7[_0xdeb7('0x8')](_0xdeb7('0xb'),_0x185fab[_0xdeb7('0xc')]);FaxInteractionEvents['emit'](_0x54f6eb+':'+_0x2655a7['id'],_0x2655a7);FaxInteractionEvents[_0xdeb7('0xd')](_0x54f6eb,_0x2655a7);_0x51a3ca(null);})[_0xdeb7('0xe')](_0x51a3ca(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xdeb7('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index c26aeca..feab972 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 _0x041e=['FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x32df25,_0x1f992a){var _0x7dffd8=function(_0x15d12c){while(--_0x15d12c){_0x32df25['push'](_0x32df25['shift']());}};_0x7dffd8(++_0x1f992a);}(_0x041e,0x73));var _0xe041=function(_0x1fb0b9,_0x41a7d3){_0x1fb0b9=_0x1fb0b9-0x0;var _0x36ed20=_0x041e[_0x1fb0b9];return _0x36ed20;};'use strict';var _=require(_0xe041('0x0'));var util=require(_0xe041('0x1'));var logger=require(_0xe041('0x2'))(_0xe041('0x3'));var moment=require(_0xe041('0x4'));var BPromise=require(_0xe041('0x5'));var rp=require(_0xe041('0x6'));var fs=require('fs');var path=require(_0xe041('0x7'));var rimraf=require(_0xe041('0x8'));var config=require(_0xe041('0x9'));var attributes=require('./faxInteraction.attributes');module[_0xe041('0xa')]=function(_0x268ac8,_0x44af5f){return _0x268ac8['define'](_0xe041('0xb'),attributes,{'tableName':_0xe041('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xf24258,_0x576e38,_0x23a7b1){if(_0xf24258[_0xe041('0xd')](_0xe041('0xe'))){_0xf24258[_0xe041('0xf')]=moment()[_0xe041('0x10')](_0xe041('0x11'));}_0x23a7b1(null,_0xf24258);}}});}; \ No newline at end of file +var _0xe67c=['FaxInteraction','fax_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./faxInteraction.attributes','define'];(function(_0x42692c,_0x602ebc){var _0xc6c7b8=function(_0x2a3b64){while(--_0x2a3b64){_0x42692c['push'](_0x42692c['shift']());}};_0xc6c7b8(++_0x602ebc);}(_0xe67c,0x1a9));var _0xce67=function(_0x4a8823,_0x414c39){_0x4a8823=_0x4a8823-0x0;var _0x5b8b32=_0xe67c[_0x4a8823];return _0x5b8b32;};'use strict';var _=require(_0xce67('0x0'));var util=require(_0xce67('0x1'));var logger=require('../../config/logger')(_0xce67('0x2'));var moment=require(_0xce67('0x3'));var BPromise=require(_0xce67('0x4'));var rp=require(_0xce67('0x5'));var fs=require('fs');var path=require(_0xce67('0x6'));var rimraf=require(_0xce67('0x7'));var config=require('../../config/environment');var attributes=require(_0xce67('0x8'));module['exports']=function(_0x4db2d0,_0x1e7e72){return _0x4db2d0[_0xce67('0x9')](_0xce67('0xa'),attributes,{'tableName':_0xce67('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x190d01,_0x439d01,_0x1667ac){if(_0x190d01[_0xce67('0xc')](_0xce67('0xd'))){_0x190d01['closedAt']=moment()['format'](_0xce67('0xe'));}_0x1667ac(null,_0x190d01);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 8c7f15d..1d90752 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 _0x6504=['addTags','ids','omit','spread','AddTags','bluebird','randomstring','../../config/logger','rpc','jayson/promise','http','redis','defaults','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxInteraction','body','options','where','UpdateFaxInteraction','AddTagsToFaxInteraction','find'];(function(_0x49fffd,_0x534844){var _0x4c90ed=function(_0x3c997a){while(--_0x3c997a){_0x49fffd['push'](_0x49fffd['shift']());}};_0x4c90ed(++_0x534844);}(_0x6504,0x91));var _0x4650=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6504[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4650('0x0'));var rs=require(_0x4650('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4650('0x2'))(_0x4650('0x3'));var config=require('../../config/environment');var jayson=require(_0x4650('0x4'));var client=jayson['client'][_0x4650('0x5')]({'port':0x232a});config[_0x4650('0x6')]=_[_0x4650('0x7')](config[_0x4650('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4650('0x6')]));require(_0x4650('0x8'))[_0x4650('0x9')](socket);function respondWithRpcPromise(_0x5df888,_0x2efd98,_0x425a83){return new BPromise(function(_0x41ea7d,_0x54c2ed){return client[_0x4650('0xa')](_0x5df888,_0x425a83)[_0x4650('0xb')](function(_0x457bba){logger[_0x4650('0xc')](_0x4650('0xd'),_0x2efd98,_0x4650('0xe'));logger[_0x4650('0xf')](_0x4650('0x10'),_0x2efd98,_0x4650('0xe'),JSON[_0x4650('0x11')](_0x457bba));if(_0x457bba[_0x4650('0x12')]){if(_0x457bba[_0x4650('0x12')][_0x4650('0x13')]===0x1f4){logger['error'](_0x4650('0xd'),_0x2efd98,_0x457bba[_0x4650('0x12')][_0x4650('0x14')]);return _0x54c2ed(_0x457bba[_0x4650('0x12')]['message']);}logger[_0x4650('0x12')](_0x4650('0xd'),_0x2efd98,_0x457bba['error'][_0x4650('0x14')]);return _0x41ea7d(_0x457bba[_0x4650('0x12')][_0x4650('0x14')]);}else{logger[_0x4650('0xc')]('FaxInteraction,\x20%s,\x20%s',_0x2efd98,'request\x20sent');_0x41ea7d(_0x457bba[_0x4650('0x15')]['message']);}})[_0x4650('0x16')](function(_0x49612f){logger['error'](_0x4650('0xd'),_0x2efd98,_0x49612f);_0x54c2ed(_0x49612f);});});}exports['UpdateFaxInteraction']=function(_0x9280f5){var _0x5afe60=this;return new Promise(function(_0xc12465,_0x2b6c30){return db[_0x4650('0x17')]['update'](_0x9280f5[_0x4650('0x18')],{'raw':_0x9280f5[_0x4650('0x19')]?_0x9280f5[_0x4650('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9280f5[_0x4650('0x19')]?_0x9280f5[_0x4650('0x19')][_0x4650('0x1a')]||null:null,'attributes':_0x9280f5[_0x4650('0x19')]?_0x9280f5['options']['attributes']||null:null,'limit':_0x9280f5[_0x4650('0x19')]?_0x9280f5[_0x4650('0x19')]['limit']||null:null})[_0x4650('0xb')](function(_0x16c778){logger[_0x4650('0xc')](_0x4650('0x1b'),_0x9280f5);logger['debug'](_0x4650('0x1b'),_0x9280f5,JSON['stringify'](_0x16c778));_0xc12465(_0x16c778);})[_0x4650('0x16')](function(_0x2088d4){logger[_0x4650('0x12')]('UpdateFaxInteraction',_0x2088d4[_0x4650('0x14')],_0x9280f5);_0x2b6c30(_0x5afe60[_0x4650('0x12')](0x1f4,_0x2088d4[_0x4650('0x14')]));});});};exports[_0x4650('0x1c')]=function(_0x3a0e8d){return new Promise(function(_0x1a8f44,_0x2f2654){return db[_0x4650('0x17')][_0x4650('0x1d')]({'where':_0x3a0e8d[_0x4650('0x19')]?_0x3a0e8d[_0x4650('0x19')]['where']||null:null})[_0x4650('0xb')](function(_0x4df696){if(_0x4df696){return _0x4df696[_0x4650('0x1e')](_0x3a0e8d[_0x4650('0x18')][_0x4650('0x1f')],_[_0x4650('0x20')](_0x3a0e8d[_0x4650('0x18')],['ids','id'])||{});}})[_0x4650('0x21')](function(_0x370e7b){logger[_0x4650('0xc')]('AddTags',_0x3a0e8d);logger[_0x4650('0xf')](_0x4650('0x22'),_0x3a0e8d,JSON['stringify'](_0x370e7b));_0x1a8f44(_0x370e7b);})[_0x4650('0x16')](function(_0x1cc105){logger[_0x4650('0x12')](_0x4650('0x22'),_0x1cc105[_0x4650('0x14')],_0x3a0e8d);_0x2f2654(_this[_0x4650('0x12')](0x1f4,_0x1cc105[_0x4650('0x14')]));});});}; \ No newline at end of file +var _0x32a8=['update','body','options','raw','where','find','ids','AddTags','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','UpdateFaxInteraction'];(function(_0xa8b5c9,_0x3a410b){var _0x5dd0f0=function(_0x31015b){while(--_0x31015b){_0xa8b5c9['push'](_0xa8b5c9['shift']());}};_0x5dd0f0(++_0x3a410b);}(_0x32a8,0x10c));var _0x832a=function(_0x4595ec,_0x2def3d){_0x4595ec=_0x4595ec-0x0;var _0x463e1a=_0x32a8[_0x4595ec];return _0x463e1a;};'use strict';var _=require(_0x832a('0x0'));var util=require(_0x832a('0x1'));var moment=require(_0x832a('0x2'));var BPromise=require(_0x832a('0x3'));var rs=require(_0x832a('0x4'));var fs=require('fs');var Redis=require(_0x832a('0x5'));var db=require(_0x832a('0x6'))['db'];var utils=require(_0x832a('0x7'));var logger=require(_0x832a('0x8'))(_0x832a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x832a('0xa')][_0x832a('0xb')]({'port':0x232a});config[_0x832a('0xc')]=_[_0x832a('0xd')](config['redis'],{'host':_0x832a('0xe'),'port':0x18eb});var socket=require(_0x832a('0xf'))(new Redis(config[_0x832a('0xc')]));require(_0x832a('0x10'))['register'](socket);function respondWithRpcPromise(_0x2693f3,_0x3b0416,_0x53c49e){return new BPromise(function(_0x400dee,_0x46624e){return client[_0x832a('0x11')](_0x2693f3,_0x53c49e)[_0x832a('0x12')](function(_0x55d14e){logger[_0x832a('0x13')](_0x832a('0x14'),_0x3b0416,_0x832a('0x15'));logger[_0x832a('0x16')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x3b0416,_0x832a('0x15'),JSON['stringify'](_0x55d14e));if(_0x55d14e[_0x832a('0x17')]){if(_0x55d14e[_0x832a('0x17')]['code']===0x1f4){logger[_0x832a('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x3b0416,_0x55d14e[_0x832a('0x17')][_0x832a('0x18')]);return _0x46624e(_0x55d14e['error'][_0x832a('0x18')]);}logger[_0x832a('0x17')](_0x832a('0x14'),_0x3b0416,_0x55d14e[_0x832a('0x17')]['message']);return _0x400dee(_0x55d14e[_0x832a('0x17')][_0x832a('0x18')]);}else{logger[_0x832a('0x13')](_0x832a('0x14'),_0x3b0416,'request\x20sent');_0x400dee(_0x55d14e[_0x832a('0x19')][_0x832a('0x18')]);}})[_0x832a('0x1a')](function(_0x1bc10b){logger[_0x832a('0x17')](_0x832a('0x14'),_0x3b0416,_0x1bc10b);_0x46624e(_0x1bc10b);});});}exports[_0x832a('0x1b')]=function(_0x38e90b){var _0x324a0d=this;return new Promise(function(_0x5614b5,_0x5df958){return db['FaxInteraction'][_0x832a('0x1c')](_0x38e90b[_0x832a('0x1d')],{'raw':_0x38e90b[_0x832a('0x1e')]?_0x38e90b[_0x832a('0x1e')][_0x832a('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38e90b[_0x832a('0x1e')]?_0x38e90b[_0x832a('0x1e')][_0x832a('0x20')]||null:null,'attributes':_0x38e90b['options']?_0x38e90b[_0x832a('0x1e')]['attributes']||null:null,'limit':_0x38e90b[_0x832a('0x1e')]?_0x38e90b[_0x832a('0x1e')]['limit']||null:null})[_0x832a('0x12')](function(_0x8bb22d){logger['info'](_0x832a('0x1b'),_0x38e90b);logger['debug'](_0x832a('0x1b'),_0x38e90b,JSON['stringify'](_0x8bb22d));_0x5614b5(_0x8bb22d);})['catch'](function(_0x460340){logger[_0x832a('0x17')](_0x832a('0x1b'),_0x460340[_0x832a('0x18')],_0x38e90b);_0x5df958(_0x324a0d[_0x832a('0x17')](0x1f4,_0x460340[_0x832a('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x2b84d1){return new Promise(function(_0x23119a,_0x11b1c5){return db['FaxInteraction'][_0x832a('0x21')]({'where':_0x2b84d1[_0x832a('0x1e')]?_0x2b84d1['options'][_0x832a('0x20')]||null:null})[_0x832a('0x12')](function(_0x2982ec){if(_0x2982ec){return _0x2982ec['addTags'](_0x2b84d1[_0x832a('0x1d')][_0x832a('0x22')],_['omit'](_0x2b84d1['body'],[_0x832a('0x22'),'id'])||{});}})['spread'](function(_0x22aa03){logger[_0x832a('0x13')](_0x832a('0x23'),_0x2b84d1);logger[_0x832a('0x16')](_0x832a('0x23'),_0x2b84d1,JSON[_0x832a('0x24')](_0x22aa03));_0x23119a(_0x22aa03);})[_0x832a('0x1a')](function(_0x7d5701){logger[_0x832a('0x17')](_0x832a('0x23'),_0x7d5701['message'],_0x2b84d1);_0x11b1c5(_this[_0x832a('0x17')](0x1f4,_0x7d5701['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index ea1654c..ced9b3c 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 _0x1faf=['save','remove','update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events'];(function(_0x133ff7,_0x17c804){var _0x2be41a=function(_0x4a2017){while(--_0x4a2017){_0x133ff7['push'](_0x133ff7['shift']());}};_0x2be41a(++_0x17c804);}(_0x1faf,0x104));var _0xf1fa=function(_0x83ff64,_0x31ddf9){_0x83ff64=_0x83ff64-0x0;var _0x456f6d=_0x1faf[_0x83ff64];return _0x456f6d;};'use strict';var FaxInteractionEvents=require(_0xf1fa('0x0'));var events=[_0xf1fa('0x1'),_0xf1fa('0x2'),_0xf1fa('0x3')];function createListener(_0x273abc,_0x337aee){return function(_0x115594){_0x337aee[_0xf1fa('0x4')](_0x273abc,_0x115594);};}function removeListener(_0x4ef4ef,_0x3c90ec){return function(){FaxInteractionEvents[_0xf1fa('0x5')](_0x4ef4ef,_0x3c90ec);};}exports[_0xf1fa('0x6')]=function(_0x54a471){for(var _0x431bd2=0x0,_0x49dbc7=events[_0xf1fa('0x7')];_0x431bd2<_0x49dbc7;_0x431bd2++){var _0x1505a7=events[_0x431bd2];var _0x2b1181=createListener(_0xf1fa('0x8')+_0x1505a7,_0x54a471);FaxInteractionEvents['on'](_0x1505a7,_0x2b1181);}}; \ No newline at end of file +var _0x59e4=['./faxInteraction.events','save','remove','update','emit','removeListener','register','length','faxInteraction:'];(function(_0x22cbcc,_0x2d5e14){var _0x471385=function(_0x59c08b){while(--_0x59c08b){_0x22cbcc['push'](_0x22cbcc['shift']());}};_0x471385(++_0x2d5e14);}(_0x59e4,0xb4));var _0x459e=function(_0x349b5c,_0x55e5fa){_0x349b5c=_0x349b5c-0x0;var _0x3efcac=_0x59e4[_0x349b5c];return _0x3efcac;};'use strict';var FaxInteractionEvents=require(_0x459e('0x0'));var events=[_0x459e('0x1'),_0x459e('0x2'),_0x459e('0x3')];function createListener(_0x3d265c,_0x2764f8){return function(_0x10f4b4){_0x2764f8[_0x459e('0x4')](_0x3d265c,_0x10f4b4);};}function removeListener(_0x4c0154,_0x16849f){return function(){FaxInteractionEvents[_0x459e('0x5')](_0x4c0154,_0x16849f);};}exports[_0x459e('0x6')]=function(_0x19921a){for(var _0x21aec5=0x0,_0x34b94b=events[_0x459e('0x7')];_0x21aec5<_0x34b94b;_0x21aec5++){var _0x4dcf8a=events[_0x21aec5];var _0xf111d7=createListener(_0x459e('0x8')+_0x4dcf8a,_0x19921a);FaxInteractionEvents['on'](_0x4dcf8a,_0xf111d7);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index af4692f..868eb13 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 _0xe57f=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags','tracked','addTags','put','faxinteraction:update','update','fax','faxinteraction:destroy','delete','removeTags','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller'];(function(_0x274e07,_0x3a7532){var _0x42ef0c=function(_0x2995dd){while(--_0x2995dd){_0x274e07['push'](_0x274e07['shift']());}};_0x42ef0c(++_0x3a7532);}(_0xe57f,0x1c8));var _0xfe57=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe57f[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xfe57('0x0'));var path=require(_0xfe57('0x1'));var timeout=require(_0xfe57('0x2'));var express=require(_0xfe57('0x3'));var router=express[_0xfe57('0x4')]();var fs_extra=require(_0xfe57('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfe57('0x6'));var config=require(_0xfe57('0x7'));var controller=require(_0xfe57('0x8'));router[_0xfe57('0x9')]('/',auth[_0xfe57('0xa')](),controller[_0xfe57('0xb')]);router['get'](_0xfe57('0xc'),auth[_0xfe57('0xa')](),controller[_0xfe57('0xd')]);router[_0xfe57('0x9')](_0xfe57('0xe'),auth[_0xfe57('0xa')](),controller[_0xfe57('0xf')]);router[_0xfe57('0x9')](_0xfe57('0x10'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0xfe57('0x11'),auth[_0xfe57('0xa')](),controller['download']);router[_0xfe57('0x12')]('/',auth[_0xfe57('0xa')](),controller[_0xfe57('0x13')]);router[_0xfe57('0x12')](_0xfe57('0x10'),auth[_0xfe57('0xa')](),controller[_0xfe57('0x14')]);router[_0xfe57('0x12')](_0xfe57('0x15'),auth['isAuthenticated'](),interaction[_0xfe57('0x16')]('fax','faxinteraction:addtags'),controller[_0xfe57('0x17')]);router[_0xfe57('0x18')]('/:id',auth[_0xfe57('0xa')](),interaction[_0xfe57('0x16')]('fax',_0xfe57('0x19')),controller[_0xfe57('0x1a')]);router['delete']('/:id',auth[_0xfe57('0xa')](),interaction[_0xfe57('0x16')](_0xfe57('0x1b'),_0xfe57('0x1c')),controller['destroy']);router[_0xfe57('0x1d')](_0xfe57('0x15'),auth[_0xfe57('0xa')](),controller[_0xfe57('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x2d0c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','put','fax','faxinteraction:update','delete','faxinteraction:destroy','destroy','/:id/tags','exports','multer','util','path'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2d0c,0x9d));var _0xc2d0=function(_0x4f0f9b,_0x4e963e){_0x4f0f9b=_0x4f0f9b-0x0;var _0x970f94=_0x2d0c[_0x4f0f9b];return _0x970f94;};'use strict';var multer=require(_0xc2d0('0x0'));var util=require(_0xc2d0('0x1'));var path=require(_0xc2d0('0x2'));var timeout=require(_0xc2d0('0x3'));var express=require(_0xc2d0('0x4'));var router=express[_0xc2d0('0x5')]();var fs_extra=require(_0xc2d0('0x6'));var auth=require(_0xc2d0('0x7'));var interaction=require(_0xc2d0('0x8'));var config=require(_0xc2d0('0x9'));var controller=require(_0xc2d0('0xa'));router[_0xc2d0('0xb')]('/',auth['isAuthenticated'](),controller[_0xc2d0('0xc')]);router[_0xc2d0('0xb')](_0xc2d0('0xd'),auth[_0xc2d0('0xe')](),controller[_0xc2d0('0xf')]);router[_0xc2d0('0xb')](_0xc2d0('0x10'),auth[_0xc2d0('0xe')](),controller[_0xc2d0('0x11')]);router[_0xc2d0('0xb')](_0xc2d0('0x12'),auth[_0xc2d0('0xe')](),controller['getMessages']);router['get'](_0xc2d0('0x13'),auth['isAuthenticated'](),controller[_0xc2d0('0x14')]);router[_0xc2d0('0x15')]('/',auth[_0xc2d0('0xe')](),controller[_0xc2d0('0x16')]);router[_0xc2d0('0x15')](_0xc2d0('0x12'),auth['isAuthenticated'](),controller[_0xc2d0('0x17')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction['tracked']('fax','faxinteraction:addtags'),controller['addTags']);router[_0xc2d0('0x18')](_0xc2d0('0x10'),auth[_0xc2d0('0xe')](),interaction['tracked'](_0xc2d0('0x19'),_0xc2d0('0x1a')),controller['update']);router[_0xc2d0('0x1b')](_0xc2d0('0x10'),auth[_0xc2d0('0xe')](),interaction['tracked'](_0xc2d0('0x19'),_0xc2d0('0x1c')),controller[_0xc2d0('0x1d')]);router['delete'](_0xc2d0('0x1e'),auth[_0xc2d0('0xe')](),controller['removeTags']);module[_0xc2d0('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 691b6cb..b40d993 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 _0x0f69=['BOOLEAN','ENUM','out','TEXT'];(function(_0x804574,_0x4e64d0){var _0x3d171d=function(_0x5b21f0){while(--_0x5b21f0){_0x804574['push'](_0x804574['shift']());}};_0x3d171d(++_0x4e64d0);}(_0x0f69,0x173));var _0x90f6=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x0f69[_0xa148b7];return _0x51efd3;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x90f6('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x90f6('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x90f6('0x2')]('in','out'),'defaultValue':_0x90f6('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x90f6('0x0')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xb821=['TEXT','ENUM','DATE','exports'];(function(_0x5b849e,_0x51c313){var _0x5fd6ea=function(_0x368e14){while(--_0x368e14){_0x5b849e['push'](_0x5b849e['shift']());}};_0x5fd6ea(++_0x51c313);}(_0xb821,0xa7));var _0x1b82=function(_0x599c49,_0x500eca){_0x599c49=_0x599c49-0x0;var _0x278bf2=_0xb821[_0x599c49];return _0x278bf2;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'body':{'type':Sequelize[_0x1b82('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x1b82('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x1b82('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x1b82('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 8339485..9130d6a 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 _0xab5b=['where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','keys','update','body','find','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','fullname','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','Sequelize','User','email','motionChannel','rejectmessage','create','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','stack','name','send','index','map','FaxMessage','rawAttributes','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x170600,_0x12b4a8){var _0x157c1e=function(_0x36462f){while(--_0x36462f){_0x170600['push'](_0x170600['shift']());}};_0x157c1e(++_0x12b4a8);}(_0xab5b,0xd5));var _0xbab5=function(_0x38fe07,_0x27921f){_0x38fe07=_0x38fe07-0x0;var _0x74fbd2=_0xab5b[_0x38fe07];return _0x74fbd2;};'use strict';var emlformat=require(_0xbab5('0x0'));var rimraf=require(_0xbab5('0x1'));var zipdir=require(_0xbab5('0x2'));var jsonpatch=require(_0xbab5('0x3'));var rp=require('request-promise');var moment=require(_0xbab5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbab5('0x5'));var util=require(_0xbab5('0x6'));var path=require('path');var sox=require(_0xbab5('0x7'));var csv=require('to-csv');var ejs=require(_0xbab5('0x8'));var fs=require('fs');var fs_extra=require(_0xbab5('0x9'));var _=require(_0xbab5('0xa'));var squel=require(_0xbab5('0xb'));var crypto=require(_0xbab5('0xc'));var jsforce=require(_0xbab5('0xd'));var deskjs=require(_0xbab5('0xe'));var toCsv=require(_0xbab5('0xf'));var querystring=require('querystring');var Papa=require(_0xbab5('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbab5('0x11'));var as=require(_0xbab5('0x12'));var hardwareService=require(_0xbab5('0x13'));var logger=require(_0xbab5('0x14'))(_0xbab5('0x15'));var utils=require(_0xbab5('0x16'));var config=require(_0xbab5('0x17'));var licenseUtil=require(_0xbab5('0x18'));var db=require(_0xbab5('0x19'))['db'];config[_0xbab5('0x1a')]=_[_0xbab5('0x1b')](config[_0xbab5('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xbab5('0x1c'))(new Redis(config[_0xbab5('0x1a')]));require(_0xbab5('0x1d'))[_0xbab5('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xbab5('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0xbab5('0x1f')][_0xbab5('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x542976,_0x4ab839,_0x56a699,_0x241ba4){return new BPromise(function(_0x1de04b,_0x2e1d96){var _0x41e7ec=_0x241ba4||client;return _0x41e7ec[_0xbab5('0x21')](_0x542976,_0x56a699)['then'](function(_0x3a5235){logger[_0xbab5('0x22')](_0xbab5('0x23'),_0x4ab839,_0xbab5('0x24'));logger[_0xbab5('0x25')](_0xbab5('0x26'),_0x4ab839,_0xbab5('0x24'),JSON[_0xbab5('0x27')](_0x3a5235));if(_0x3a5235[_0xbab5('0x28')]){if(_0x3a5235['error'][_0xbab5('0x29')]===0x1f4){logger[_0xbab5('0x28')]('FaxMessage,\x20%s,\x20%s',_0x4ab839,_0x3a5235['error'][_0xbab5('0x2a')]);return _0x2e1d96(_0x3a5235[_0xbab5('0x28')][_0xbab5('0x2a')]);}logger[_0xbab5('0x28')](_0xbab5('0x23'),_0x4ab839,_0x3a5235[_0xbab5('0x28')][_0xbab5('0x2a')]);return _0x1de04b(_0x3a5235[_0xbab5('0x28')]['message']);}else{logger[_0xbab5('0x22')](_0xbab5('0x23'),_0x4ab839,_0xbab5('0x24'));_0x1de04b(_0x3a5235[_0xbab5('0x2b')][_0xbab5('0x2a')]);}})['catch'](function(_0x5c48a9){logger[_0xbab5('0x28')]('FaxMessage,\x20%s,\x20%s',_0x4ab839,_0x5c48a9);_0x2e1d96(_0x5c48a9);});});}function respondWithStatusCode(_0x1a034d,_0x3cce28){_0x3cce28=_0x3cce28||0xcc;return function(_0x922dca){if(_0x922dca){return _0x1a034d[_0xbab5('0x2c')](_0x3cce28);}return _0x1a034d[_0xbab5('0x2d')](_0x3cce28)[_0xbab5('0x2e')]();};}function respondWithResult(_0x26154d,_0x172642){_0x172642=_0x172642||0xc8;return function(_0x2922d0){if(_0x2922d0){return _0x26154d[_0xbab5('0x2d')](_0x172642)[_0xbab5('0x2f')](_0x2922d0);}};}function respondWithFilteredResult(_0x3e120d,_0x5d81e5){return function(_0x206237){if(_0x206237){var _0x322bbf=typeof _0x5d81e5[_0xbab5('0x30')]===_0xbab5('0x31')&&typeof _0x5d81e5['limit']===_0xbab5('0x31');var _0x3ee4e0=_0x206237[_0xbab5('0x32')];var _0x5418b9=_0x322bbf?0x0:_0x5d81e5[_0xbab5('0x30')];var _0x5b8350=_0x322bbf?_0x206237[_0xbab5('0x32')]:_0x5d81e5[_0xbab5('0x30')]+_0x5d81e5[_0xbab5('0x33')];var _0x2ff191;if(_0x5b8350>=_0x3ee4e0){_0x5b8350=_0x3ee4e0;_0x2ff191=0xc8;}else{_0x2ff191=0xce;}_0x3e120d[_0xbab5('0x2d')](_0x2ff191);return _0x3e120d[_0xbab5('0x34')](_0xbab5('0x35'),_0x5418b9+'-'+_0x5b8350+'/'+_0x3ee4e0)[_0xbab5('0x2f')](_0x206237);}return null;};}function patchUpdates(_0x4181f0){return function(_0x5d1499){try{jsonpatch[_0xbab5('0x36')](_0x5d1499,_0x4181f0,!![]);}catch(_0x1a52d4){return BPromise[_0xbab5('0x37')](_0x1a52d4);}return _0x5d1499[_0xbab5('0x38')]();};}function saveUpdates(_0x3c17b1,_0x58bb9b){return function(_0x312af6){if(_0x312af6){return _0x312af6['update'](_0x3c17b1)[_0xbab5('0x39')](function(_0x4e9f5c){return _0x4e9f5c;});}return null;};}function removeEntity(_0x10639f,_0x5d2e77){return function(_0x2791fd){if(_0x2791fd){return _0x2791fd['destroy']()[_0xbab5('0x39')](function(){_0x10639f[_0xbab5('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56a213,_0x3d7343){return function(_0x543bc){if(!_0x543bc){_0x56a213[_0xbab5('0x2c')](0x194);}return _0x543bc;};}function handleError(_0x4353ac,_0x517d8a){_0x517d8a=_0x517d8a||0x1f4;return function(_0x3ecba6){logger[_0xbab5('0x28')](_0x3ecba6[_0xbab5('0x3a')]);if(_0x3ecba6[_0xbab5('0x3b')]){delete _0x3ecba6['name'];}_0x4353ac[_0xbab5('0x2d')](_0x517d8a)[_0xbab5('0x3c')](_0x3ecba6);};}exports[_0xbab5('0x3d')]=function(_0x16e07a,_0x43a2d8){var _0x35191b={},_0x3c20a5={},_0x24d747={'count':0x0,'rows':[]};var _0x1c029f=_[_0xbab5('0x3e')](db[_0xbab5('0x3f')][_0xbab5('0x40')],function(_0x1cff5b){return{'name':_0x1cff5b['fieldName'],'type':_0x1cff5b['type']['key']};});_0x3c20a5[_0xbab5('0x41')]=_[_0xbab5('0x3e')](_0x1c029f,_0xbab5('0x3b'));_0x3c20a5[_0xbab5('0x42')]=_['keys'](_0x16e07a[_0xbab5('0x42')]);_0x3c20a5[_0xbab5('0x43')]=_[_0xbab5('0x44')](_0x3c20a5['model'],_0x3c20a5[_0xbab5('0x42')]);_0x35191b[_0xbab5('0x45')]=_[_0xbab5('0x44')](_0x3c20a5[_0xbab5('0x41')],qs[_0xbab5('0x46')](_0x16e07a['query'][_0xbab5('0x46')]));_0x35191b[_0xbab5('0x45')]=_0x35191b[_0xbab5('0x45')]['length']?_0x35191b['attributes']:_0x3c20a5[_0xbab5('0x41')];if(!_0x16e07a[_0xbab5('0x42')][_0xbab5('0x47')](_0xbab5('0x48'))){_0x35191b[_0xbab5('0x33')]=qs[_0xbab5('0x33')](_0x16e07a['query'][_0xbab5('0x33')]);_0x35191b[_0xbab5('0x30')]=qs['offset'](_0x16e07a[_0xbab5('0x42')][_0xbab5('0x30')]);}_0x35191b[_0xbab5('0x49')]=qs[_0xbab5('0x4a')](_0x16e07a[_0xbab5('0x42')][_0xbab5('0x4a')]);_0x35191b[_0xbab5('0x4b')]=qs[_0xbab5('0x43')](_[_0xbab5('0x4c')](_0x16e07a[_0xbab5('0x42')],_0x3c20a5[_0xbab5('0x43')]),_0x1c029f);if(_0x16e07a[_0xbab5('0x42')][_0xbab5('0x4d')]){_0x35191b[_0xbab5('0x4b')]=_['merge'](_0x35191b[_0xbab5('0x4b')],{'$or':_[_0xbab5('0x3e')](_0x1c029f,function(_0x5e00c3){if(_0x5e00c3[_0xbab5('0x4e')]!==_0xbab5('0x4f')){var _0x108d78={};_0x108d78[_0x5e00c3[_0xbab5('0x3b')]]={'$like':'%'+_0x16e07a[_0xbab5('0x42')][_0xbab5('0x4d')]+'%'};return _0x108d78;}})});}_0x35191b=_[_0xbab5('0x50')]({},_0x35191b,_0x16e07a[_0xbab5('0x51')]);var _0x58b1c8={'where':_0x35191b[_0xbab5('0x4b')]};return db['FaxMessage'][_0xbab5('0x32')](_0x58b1c8)[_0xbab5('0x39')](function(_0xb04587){_0x24d747['count']=_0xb04587;if(_0x16e07a[_0xbab5('0x42')][_0xbab5('0x52')]){_0x35191b['include']=[{'all':!![]}];}return db[_0xbab5('0x3f')][_0xbab5('0x53')](_0x35191b);})[_0xbab5('0x39')](function(_0xc373f){_0x24d747[_0xbab5('0x54')]=_0xc373f;return _0x24d747;})[_0xbab5('0x39')](respondWithFilteredResult(_0x43a2d8,_0x35191b))[_0xbab5('0x55')](handleError(_0x43a2d8,null));};exports[_0xbab5('0x56')]=function(_0x9ef2da,_0x47dd40){var _0x2c606c={'raw':!![],'where':{'id':_0x9ef2da[_0xbab5('0x57')]['id']}},_0x4da913={};_0x4da913[_0xbab5('0x41')]=_[_0xbab5('0x58')](db[_0xbab5('0x3f')]['rawAttributes']);_0x4da913[_0xbab5('0x42')]=_[_0xbab5('0x58')](_0x9ef2da['query']);_0x4da913[_0xbab5('0x43')]=_['intersection'](_0x4da913['model'],_0x4da913['query']);_0x2c606c['attributes']=_[_0xbab5('0x44')](_0x4da913[_0xbab5('0x41')],qs[_0xbab5('0x46')](_0x9ef2da[_0xbab5('0x42')][_0xbab5('0x46')]));_0x2c606c[_0xbab5('0x45')]=_0x2c606c['attributes']['length']?_0x2c606c['attributes']:_0x4da913['model'];if(_0x9ef2da['query'][_0xbab5('0x52')]){_0x2c606c['include']=[{'all':!![]}];}_0x2c606c=_[_0xbab5('0x50')]({},_0x2c606c,_0x9ef2da[_0xbab5('0x51')]);return db[_0xbab5('0x3f')]['find'](_0x2c606c)[_0xbab5('0x39')](handleEntityNotFound(_0x47dd40,null))[_0xbab5('0x39')](respondWithResult(_0x47dd40,null))['catch'](handleError(_0x47dd40,null));};exports[_0xbab5('0x59')]=function(_0x408ab4,_0x9bc997){if(_0x408ab4[_0xbab5('0x5a')]['id']){delete _0x408ab4['body']['id'];}return db[_0xbab5('0x3f')][_0xbab5('0x5b')]({'where':{'id':_0x408ab4['params']['id']}})['then'](handleEntityNotFound(_0x9bc997,null))['then'](saveUpdates(_0x408ab4['body'],null))[_0xbab5('0x39')](respondWithResult(_0x9bc997,null))[_0xbab5('0x55')](handleError(_0x9bc997,null));};exports['destroy']=function(_0x489834,_0x16d073){return db['FaxMessage'][_0xbab5('0x5b')]({'where':{'id':_0x489834['params']['id']}})[_0xbab5('0x39')](handleEntityNotFound(_0x16d073,null))[_0xbab5('0x39')](removeEntity(_0x16d073,null))[_0xbab5('0x55')](handleError(_0x16d073,null));};exports['describe']=function(_0x113909,_0x2644ed){return db[_0xbab5('0x3f')]['describe']()[_0xbab5('0x39')](respondWithResult(_0x2644ed,null))[_0xbab5('0x55')](handleError(_0x2644ed,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xbab5('0x5c')]=function(_0x5badba,_0x88cd45,_0x2bbb94){var _0x572103={'agent':{},'channel':_0xbab5('0x5d')};if(_0x5badba[_0xbab5('0x5a')]['id']){delete _0x5badba[_0xbab5('0x5a')]['id'];}_0x5badba[_0xbab5('0x5a')]['read']=!![];_0x5badba[_0xbab5('0x5a')][_0xbab5('0x5e')]=moment()['format'](_0xbab5('0x5f'));_0x5badba['body'][_0xbab5('0x60')]=_0x5badba['body'][_0xbab5('0x60')]||_0x5badba[_0xbab5('0x61')]['id'];_0x572103[_0xbab5('0x62')]['id']=_0x5badba['body'][_0xbab5('0x60')];return db[_0xbab5('0x3f')][_0xbab5('0x5b')]({'where':{'id':_0x5badba[_0xbab5('0x57')]['id'],'UserId':null}})[_0xbab5('0x39')](handleEntityNotFound(_0x88cd45,null))['then'](saveUpdates(_0x5badba['body'],null))[_0xbab5('0x39')](function(_0x570228){if(_0x570228){_0x572103[_0xbab5('0x2a')]=_0x570228[_0xbab5('0x63')]({'plain':!![]});return db[_0xbab5('0x64')][_0xbab5('0x5b')]({'where':{'id':_0x570228[_0xbab5('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x88cd45,null))[_0xbab5('0x39')](function(_0x4e290d){if(_0x4e290d){return _0x4e290d[_0xbab5('0x59')]({'UserId':_0x5badba[_0xbab5('0x5a')][_0xbab5('0x60')],'read1stAt':_[_0xbab5('0x66')](_0x4e290d[_0xbab5('0x67')])?moment()[_0xbab5('0x68')](_0xbab5('0x5f')):undefined});}return null;})['then'](function(_0x1e93fb){if(_0x1e93fb){_0x572103[_0xbab5('0x69')]=_0x1e93fb[_0xbab5('0x63')]({'plain':!![]});interaction_log[_0xbab5('0x22')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5badba[_0xbab5('0x61')]['id'],_0x5badba[_0xbab5('0x61')][_0xbab5('0x3b')],_0x5badba['user'][_0xbab5('0x6a')],_0x572103[_0xbab5('0x69')]['id'],_0x5badba[_0xbab5('0x5a')]?JSON['stringify'](_0x5badba[_0xbab5('0x5a')]):_0xbab5('0x6b'));return respondWithRpcPromise(_0xbab5('0x6c'),_0xbab5('0x6d'),_0x572103);}return null;})[_0xbab5('0x39')](function(_0x18360d){var _0x52a2eb=_0xbab5('0x6e')+_0x18360d[_0xbab5('0x2a')]['ContactId'];return db[_0xbab5('0x6f')][_0xbab5('0x42')](_0x52a2eb,{'type':db['Sequelize'][_0xbab5('0x70')][_0xbab5('0x71')],'raw':!![]})['then'](function(_0x2c364a){return _0x2c364a;});})['then'](function(_0x1159c5){if(_0x1159c5){_0x572103[_0xbab5('0x2a')]['contact']=_0x1159c5[0x0];if(!_0x5badba['body'][_0xbab5('0x60')])return;return db['User'][_0xbab5('0x5b')]({'where':{'id':_0x5badba['body']['UserId'],'role':_0xbab5('0x62')},'attributes':['id',_0xbab5('0x3b'),_0xbab5('0x72'),'email',_0xbab5('0x73')],'raw':!![]});}return null;})['then'](function(_0x118476){if(!_0x118476)return null;_0x572103[_0xbab5('0x2a')][_0xbab5('0x62')]=_0x118476;return _0x572103;})[_0xbab5('0x39')](function(_0x37e520){if(_0x37e520){if(_0x5badba['body'][_0xbab5('0x74')]){_0x572103[_0xbab5('0x2a')][_0xbab5('0x75')]=util['format'](_0xbab5('0x76'),_0x5badba[_0xbab5('0x61')][_0xbab5('0x3b')]);_0x572103[_0xbab5('0x2a')]['channel']=_0x572103['channel'];_0x572103[_0xbab5('0x2a')]['motionChannel']=_0x572103[_0xbab5('0x77')];_0x572103[_0xbab5('0x2a')][_0xbab5('0x78')]=_0xbab5('0x5c');return respondWithRpcPromise('EventManager',_0xbab5('0x79'),{'event':_0xbab5('0x7a'),'message':_0x572103['message']},client9002)[_0xbab5('0x39')](function(){return _0x572103;});}return _0x572103;}return null;})['then'](respondWithResult(_0x88cd45,null))[_0xbab5('0x55')](handleError(_0x88cd45,null));};var interaction_log=require(_0xbab5('0x14'))(_0xbab5('0x7b'));exports[_0xbab5('0x37')]=function(_0x1d1f1e,_0xb2f6a8,_0x460682){var _0x30cbc4={'agent':{},'channel':_0xbab5('0x5d')};if(_0x1d1f1e[_0xbab5('0x5a')]['id']){delete _0x1d1f1e['body']['id'];}_0x1d1f1e[_0xbab5('0x5a')][_0xbab5('0x60')]=_0x1d1f1e[_0xbab5('0x5a')]['UserId']||_0x1d1f1e[_0xbab5('0x61')]['id'];_0x30cbc4['agent']['id']=_0x1d1f1e[_0xbab5('0x5a')][_0xbab5('0x60')];return db[_0xbab5('0x3f')][_0xbab5('0x5b')]({'where':{'id':_0x1d1f1e[_0xbab5('0x57')]['id'],'UserId':null}})[_0xbab5('0x39')](handleEntityNotFound(_0xb2f6a8,null))['then'](function(_0x5a0e01){if(_0x5a0e01){_0x30cbc4[_0xbab5('0x2a')]=_0x5a0e01[_0xbab5('0x63')]({'plain':!![]});return db[_0xbab5('0x64')][_0xbab5('0x5b')]({'where':{'id':_0x5a0e01['FaxInteractionId']}});}return null;})[_0xbab5('0x39')](handleEntityNotFound(_0xb2f6a8,null))['then'](function(_0x593b0a){if(_0x593b0a){_0x30cbc4[_0xbab5('0x69')]=_0x593b0a[_0xbab5('0x63')]({'plain':!![]});interaction_log[_0xbab5('0x22')](_0xbab5('0x7c'),_0x1d1f1e['user']['id'],_0x1d1f1e[_0xbab5('0x61')]['name'],_0x1d1f1e[_0xbab5('0x61')][_0xbab5('0x6a')],_0x30cbc4['interaction']['id'],_0x1d1f1e[_0xbab5('0x5a')]?JSON[_0xbab5('0x27')](_0x1d1f1e['body']):_0xbab5('0x6b'));return respondWithRpcPromise(_0xbab5('0x7d'),'rejectMessage',_0x30cbc4);}return null;})[_0xbab5('0x39')](function(_0x49497e){var _0x250366=_0xbab5('0x6e')+_0x49497e[_0xbab5('0x2a')][_0xbab5('0x7e')];return db[_0xbab5('0x6f')][_0xbab5('0x42')](_0x250366,{'type':db[_0xbab5('0x7f')][_0xbab5('0x70')][_0xbab5('0x71')],'raw':!![]})[_0xbab5('0x39')](function(_0x35c595){return _0x35c595;});})['then'](function(_0x3f3733){if(_0x3f3733){_0x30cbc4[_0xbab5('0x2a')]['contact']=_0x3f3733[0x0];if(!_0x1d1f1e[_0xbab5('0x5a')]['UserId'])return;return db[_0xbab5('0x80')]['find']({'where':{'id':_0x1d1f1e[_0xbab5('0x5a')][_0xbab5('0x60')],'role':_0xbab5('0x62')},'attributes':['id',_0xbab5('0x3b'),_0xbab5('0x72'),_0xbab5('0x81'),_0xbab5('0x73')],'raw':!![]});}return null;})[_0xbab5('0x39')](function(_0x4c90ba){if(!_0x4c90ba)return null;_0x30cbc4[_0xbab5('0x2a')][_0xbab5('0x62')]=_0x4c90ba;return _0x30cbc4;})[_0xbab5('0x39')](function(_0xbe7e2b){if(_0xbe7e2b){_0xbe7e2b['message']['interface']=util['format'](_0xbab5('0x76'),_0x1d1f1e[_0xbab5('0x61')][_0xbab5('0x3b')]);_0xbe7e2b[_0xbab5('0x2a')][_0xbab5('0x77')]=_0x30cbc4[_0xbab5('0x77')];_0xbe7e2b[_0xbab5('0x2a')][_0xbab5('0x82')]=_0x30cbc4[_0xbab5('0x77')];_0xbe7e2b[_0xbab5('0x2a')]['event']=_0xbab5('0x37');respondWithRpcPromise(_0xbab5('0x79'),'EventManager',{'event':_0xbab5('0x83'),'message':_0xbe7e2b[_0xbab5('0x2a')]},client9002);return _0x30cbc4;}return null;})[_0xbab5('0x39')](respondWithResult(_0xb2f6a8,null))['catch'](handleError(_0xb2f6a8,null));};exports['create']=function(_0x2bbba1,_0x372acb){var _0x3f87d0;return db[_0xbab5('0x3f')][_0xbab5('0x84')](_0x2bbba1[_0xbab5('0x5a')],{})[_0xbab5('0x39')](function(_0x520ccc){_0x3f87d0=_0x520ccc;return db['CmContact']['findOne']({'where':{'id':_0x3f87d0[_0xbab5('0x7e')]}});})[_0xbab5('0x39')](function(_0xeed1d5){if(_['isNil'](_0xeed1d5)){return;}else{_0x3f87d0['fax']=_0xeed1d5['fax'];return db[_0xbab5('0x85')]['findOne']({'where':{'id':_0x3f87d0[_0xbab5('0x86')]}});}})['then'](function(_0x7df652){return respondWithRpcPromise(_0xbab5('0x87'),_0xbab5('0x87'),{'FaxAccountId':_[_0xbab5('0x66')](_0x2bbba1['body'])?undefined:_0x2bbba1[_0xbab5('0x5a')][_0xbab5('0x88')],'path':_[_0xbab5('0x66')](_0x7df652)?undefined:util['format'](_0xbab5('0x89'),_0x7df652[_0xbab5('0x8a')]),'fax':_[_0xbab5('0x66')](_0x3f87d0[_0xbab5('0x5d')])?undefined:_0x3f87d0[_0xbab5('0x5d')],'AttachmentId':_0x3f87d0[_0xbab5('0x86')]},client9002);})[_0xbab5('0x39')](respondWithResult(_0x372acb,0xc9))[_0xbab5('0x55')](handleError(_0x372acb,null));};exports[_0xbab5('0x8b')]=function(_0x1b0768,_0x343925){var _0x20fcd3=path[_0xbab5('0x8c')](config[_0xbab5('0x8d')],_0xbab5('0x8e'),_0xbab5('0x8f'),'attachments');return db[_0xbab5('0x3f')][_0xbab5('0x5b')]({'where':{'id':_0x1b0768[_0xbab5('0x57')]['id']},'include':[{'model':db[_0xbab5('0x85')],'as':_0xbab5('0x85')}]})[_0xbab5('0x39')](handleEntityNotFound(_0x343925,null))[_0xbab5('0x39')](function(_0x5102e3){if(_0x5102e3){return _0x343925[_0xbab5('0x8b')](path[_0xbab5('0x8c')](_0x20fcd3,_0x5102e3[_0xbab5('0x85')][_0xbab5('0x8a')]));}})[_0xbab5('0x55')](handleError(_0x343925,null));}; \ No newline at end of file +var _0x1b0e=['get','FaxInteractionId','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','interaction','AcceptMessage','acceptMessage','ContactId','sequelize','SELECT','User','fullname','manual','SIP/%s','motionChannel','event','accept','EventManager','acceptmessage','fax','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','contact','email','internal','interface','channel','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','basename','download','root','server','files','attachments','join','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','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','redis','defaults','localhost','./faxMessage.socket','register','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','limit','count','offset','set','Content-Range','reject','save','update','destroy','stack','send','index','map','FaxMessage','fieldName','type','key','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','body','find','describe','fax-interactions','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent'];(function(_0x1ce595,_0x1069cb){var _0x525dfe=function(_0xeee00a){while(--_0xeee00a){_0x1ce595['push'](_0x1ce595['shift']());}};_0x525dfe(++_0x1069cb);}(_0x1b0e,0x14c));var _0xe1b0=function(_0x595124,_0x53f28e){_0x595124=_0x595124-0x0;var _0x3158d4=_0x1b0e[_0x595124];return _0x3158d4;};'use strict';var emlformat=require(_0xe1b0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe1b0('0x1'));var rp=require(_0xe1b0('0x2'));var moment=require(_0xe1b0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe1b0('0x4'));var util=require(_0xe1b0('0x5'));var path=require(_0xe1b0('0x6'));var sox=require('sox');var csv=require(_0xe1b0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe1b0('0x8'));var crypto=require(_0xe1b0('0x9'));var jsforce=require(_0xe1b0('0xa'));var deskjs=require(_0xe1b0('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe1b0('0xc'));var authService=require(_0xe1b0('0xd'));var qs=require(_0xe1b0('0xe'));var as=require(_0xe1b0('0xf'));var hardwareService=require(_0xe1b0('0x10'));var logger=require(_0xe1b0('0x11'))(_0xe1b0('0x12'));var utils=require(_0xe1b0('0x13'));var config=require(_0xe1b0('0x14'));var licenseUtil=require(_0xe1b0('0x15'));var db=require(_0xe1b0('0x16'))['db'];config[_0xe1b0('0x17')]=_[_0xe1b0('0x18')](config['redis'],{'host':_0xe1b0('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe1b0('0x1a'))[_0xe1b0('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe1b0('0x1c')][_0xe1b0('0x1d')]({'port':0x232c});var client9002=jayson[_0xe1b0('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18a8e4,_0x186aea,_0x5f4adf,_0x8f8841){return new BPromise(function(_0x3b04c8,_0x87bd37){var _0x5b8478=_0x8f8841||client;return _0x5b8478[_0xe1b0('0x1e')](_0x18a8e4,_0x5f4adf)[_0xe1b0('0x1f')](function(_0x22194a){logger[_0xe1b0('0x20')](_0xe1b0('0x21'),_0x186aea,_0xe1b0('0x22'));logger[_0xe1b0('0x23')](_0xe1b0('0x24'),_0x186aea,_0xe1b0('0x22'),JSON[_0xe1b0('0x25')](_0x22194a));if(_0x22194a[_0xe1b0('0x26')]){if(_0x22194a[_0xe1b0('0x26')]['code']===0x1f4){logger[_0xe1b0('0x26')]('FaxMessage,\x20%s,\x20%s',_0x186aea,_0x22194a[_0xe1b0('0x26')][_0xe1b0('0x27')]);return _0x87bd37(_0x22194a[_0xe1b0('0x26')]['message']);}logger[_0xe1b0('0x26')]('FaxMessage,\x20%s,\x20%s',_0x186aea,_0x22194a[_0xe1b0('0x26')][_0xe1b0('0x27')]);return _0x3b04c8(_0x22194a[_0xe1b0('0x26')][_0xe1b0('0x27')]);}else{logger[_0xe1b0('0x20')](_0xe1b0('0x21'),_0x186aea,'request\x20sent');_0x3b04c8(_0x22194a[_0xe1b0('0x28')][_0xe1b0('0x27')]);}})[_0xe1b0('0x29')](function(_0x51bd5c){logger[_0xe1b0('0x26')](_0xe1b0('0x21'),_0x186aea,_0x51bd5c);_0x87bd37(_0x51bd5c);});});}function respondWithStatusCode(_0x1efd1a,_0x1a3fae){_0x1a3fae=_0x1a3fae||0xcc;return function(_0x262ff2){if(_0x262ff2){return _0x1efd1a[_0xe1b0('0x2a')](_0x1a3fae);}return _0x1efd1a['status'](_0x1a3fae)[_0xe1b0('0x2b')]();};}function respondWithResult(_0x6aa851,_0x32a008){_0x32a008=_0x32a008||0xc8;return function(_0x4a21c2){if(_0x4a21c2){return _0x6aa851[_0xe1b0('0x2c')](_0x32a008)[_0xe1b0('0x2d')](_0x4a21c2);}};}function respondWithFilteredResult(_0x5ce721,_0x9c00ec){return function(_0x11b845){if(_0x11b845){var _0x1558ed=typeof _0x9c00ec['offset']==='undefined'&&typeof _0x9c00ec[_0xe1b0('0x2e')]==='undefined';var _0x22fb2d=_0x11b845[_0xe1b0('0x2f')];var _0x990da2=_0x1558ed?0x0:_0x9c00ec[_0xe1b0('0x30')];var _0x59c76f=_0x1558ed?_0x11b845[_0xe1b0('0x2f')]:_0x9c00ec['offset']+_0x9c00ec['limit'];var _0x37c571;if(_0x59c76f>=_0x22fb2d){_0x59c76f=_0x22fb2d;_0x37c571=0xc8;}else{_0x37c571=0xce;}_0x5ce721[_0xe1b0('0x2c')](_0x37c571);return _0x5ce721[_0xe1b0('0x31')](_0xe1b0('0x32'),_0x990da2+'-'+_0x59c76f+'/'+_0x22fb2d)[_0xe1b0('0x2d')](_0x11b845);}return null;};}function patchUpdates(_0x598231){return function(_0x30d7ed){try{jsonpatch['apply'](_0x30d7ed,_0x598231,!![]);}catch(_0x4fd6b1){return BPromise[_0xe1b0('0x33')](_0x4fd6b1);}return _0x30d7ed[_0xe1b0('0x34')]();};}function saveUpdates(_0x4b60ef,_0x8ad38b){return function(_0x203882){if(_0x203882){return _0x203882[_0xe1b0('0x35')](_0x4b60ef)[_0xe1b0('0x1f')](function(_0x419138){return _0x419138;});}return null;};}function removeEntity(_0x27f944,_0x2b1d70){return function(_0x373e66){if(_0x373e66){return _0x373e66[_0xe1b0('0x36')]()[_0xe1b0('0x1f')](function(){_0x27f944[_0xe1b0('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x305350,_0x1dae0e){return function(_0x49a5e5){if(!_0x49a5e5){_0x305350[_0xe1b0('0x2a')](0x194);}return _0x49a5e5;};}function handleError(_0x53bde3,_0x9542a5){_0x9542a5=_0x9542a5||0x1f4;return function(_0x283578){logger[_0xe1b0('0x26')](_0x283578[_0xe1b0('0x37')]);if(_0x283578['name']){delete _0x283578['name'];}_0x53bde3[_0xe1b0('0x2c')](_0x9542a5)[_0xe1b0('0x38')](_0x283578);};}exports[_0xe1b0('0x39')]=function(_0xd2b64c,_0x253856){var _0x5eafec={},_0x10b4b1={},_0x4076a2={'count':0x0,'rows':[]};var _0x449d63=_[_0xe1b0('0x3a')](db[_0xe1b0('0x3b')]['rawAttributes'],function(_0x52b1b1){return{'name':_0x52b1b1[_0xe1b0('0x3c')],'type':_0x52b1b1[_0xe1b0('0x3d')][_0xe1b0('0x3e')]};});_0x10b4b1[_0xe1b0('0x3f')]=_[_0xe1b0('0x3a')](_0x449d63,'name');_0x10b4b1['query']=_['keys'](_0xd2b64c['query']);_0x10b4b1['filters']=_['intersection'](_0x10b4b1['model'],_0x10b4b1[_0xe1b0('0x40')]);_0x5eafec[_0xe1b0('0x41')]=_[_0xe1b0('0x42')](_0x10b4b1[_0xe1b0('0x3f')],qs[_0xe1b0('0x43')](_0xd2b64c[_0xe1b0('0x40')]['fields']));_0x5eafec['attributes']=_0x5eafec[_0xe1b0('0x41')][_0xe1b0('0x44')]?_0x5eafec[_0xe1b0('0x41')]:_0x10b4b1['model'];if(!_0xd2b64c[_0xe1b0('0x40')]['hasOwnProperty'](_0xe1b0('0x45'))){_0x5eafec[_0xe1b0('0x2e')]=qs['limit'](_0xd2b64c[_0xe1b0('0x40')][_0xe1b0('0x2e')]);_0x5eafec[_0xe1b0('0x30')]=qs['offset'](_0xd2b64c['query'][_0xe1b0('0x30')]);}_0x5eafec[_0xe1b0('0x46')]=qs['sort'](_0xd2b64c[_0xe1b0('0x40')][_0xe1b0('0x47')]);_0x5eafec[_0xe1b0('0x48')]=qs['filters'](_[_0xe1b0('0x49')](_0xd2b64c['query'],_0x10b4b1['filters']),_0x449d63);if(_0xd2b64c[_0xe1b0('0x40')][_0xe1b0('0x4a')]){_0x5eafec[_0xe1b0('0x48')]=_['merge'](_0x5eafec[_0xe1b0('0x48')],{'$or':_[_0xe1b0('0x3a')](_0x449d63,function(_0x180808){if(_0x180808[_0xe1b0('0x3d')]!==_0xe1b0('0x4b')){var _0x1a1a18={};_0x1a1a18[_0x180808['name']]={'$like':'%'+_0xd2b64c[_0xe1b0('0x40')]['filter']+'%'};return _0x1a1a18;}})});}_0x5eafec=_[_0xe1b0('0x4c')]({},_0x5eafec,_0xd2b64c[_0xe1b0('0x4d')]);var _0x314854={'where':_0x5eafec[_0xe1b0('0x48')]};return db['FaxMessage'][_0xe1b0('0x2f')](_0x314854)[_0xe1b0('0x1f')](function(_0x37bd71){_0x4076a2['count']=_0x37bd71;if(_0xd2b64c[_0xe1b0('0x40')][_0xe1b0('0x4e')]){_0x5eafec[_0xe1b0('0x4f')]=[{'all':!![]}];}return db['FaxMessage'][_0xe1b0('0x50')](_0x5eafec);})[_0xe1b0('0x1f')](function(_0x4f9bee){_0x4076a2[_0xe1b0('0x51')]=_0x4f9bee;return _0x4076a2;})[_0xe1b0('0x1f')](respondWithFilteredResult(_0x253856,_0x5eafec))[_0xe1b0('0x29')](handleError(_0x253856,null));};exports[_0xe1b0('0x52')]=function(_0xcf5573,_0x54ce30){var _0x26cd4f={'raw':!![],'where':{'id':_0xcf5573[_0xe1b0('0x53')]['id']}},_0x4d2135={};_0x4d2135['model']=_['keys'](db['FaxMessage'][_0xe1b0('0x54')]);_0x4d2135['query']=_['keys'](_0xcf5573['query']);_0x4d2135['filters']=_[_0xe1b0('0x42')](_0x4d2135[_0xe1b0('0x3f')],_0x4d2135[_0xe1b0('0x40')]);_0x26cd4f[_0xe1b0('0x41')]=_['intersection'](_0x4d2135['model'],qs['fields'](_0xcf5573[_0xe1b0('0x40')][_0xe1b0('0x43')]));_0x26cd4f[_0xe1b0('0x41')]=_0x26cd4f[_0xe1b0('0x41')][_0xe1b0('0x44')]?_0x26cd4f[_0xe1b0('0x41')]:_0x4d2135['model'];if(_0xcf5573[_0xe1b0('0x40')][_0xe1b0('0x4e')]){_0x26cd4f[_0xe1b0('0x4f')]=[{'all':!![]}];}_0x26cd4f=_[_0xe1b0('0x4c')]({},_0x26cd4f,_0xcf5573[_0xe1b0('0x4d')]);return db[_0xe1b0('0x3b')]['find'](_0x26cd4f)[_0xe1b0('0x1f')](handleEntityNotFound(_0x54ce30,null))['then'](respondWithResult(_0x54ce30,null))[_0xe1b0('0x29')](handleError(_0x54ce30,null));};exports[_0xe1b0('0x35')]=function(_0x15eb65,_0x18db81){if(_0x15eb65[_0xe1b0('0x55')]['id']){delete _0x15eb65[_0xe1b0('0x55')]['id'];}return db[_0xe1b0('0x3b')]['find']({'where':{'id':_0x15eb65[_0xe1b0('0x53')]['id']}})[_0xe1b0('0x1f')](handleEntityNotFound(_0x18db81,null))[_0xe1b0('0x1f')](saveUpdates(_0x15eb65[_0xe1b0('0x55')],null))['then'](respondWithResult(_0x18db81,null))[_0xe1b0('0x29')](handleError(_0x18db81,null));};exports['destroy']=function(_0x51069d,_0x490579){return db[_0xe1b0('0x3b')][_0xe1b0('0x56')]({'where':{'id':_0x51069d[_0xe1b0('0x53')]['id']}})[_0xe1b0('0x1f')](handleEntityNotFound(_0x490579,null))[_0xe1b0('0x1f')](removeEntity(_0x490579,null))[_0xe1b0('0x29')](handleError(_0x490579,null));};exports['describe']=function(_0x117cec,_0xb0491e){return db['FaxMessage'][_0xe1b0('0x57')]()['then'](respondWithResult(_0xb0491e,null))[_0xe1b0('0x29')](handleError(_0xb0491e,null));};var interaction_log=require(_0xe1b0('0x11'))(_0xe1b0('0x58'));exports['accept']=function(_0x45ab44,_0x2ac41b,_0x369186){var _0x5eecb8={'agent':{},'channel':'fax'};if(_0x45ab44['body']['id']){delete _0x45ab44[_0xe1b0('0x55')]['id'];}_0x45ab44[_0xe1b0('0x55')]['read']=!![];_0x45ab44[_0xe1b0('0x55')]['readAt']=moment()[_0xe1b0('0x59')](_0xe1b0('0x5a'));_0x45ab44['body']['UserId']=_0x45ab44[_0xe1b0('0x55')][_0xe1b0('0x5b')]||_0x45ab44[_0xe1b0('0x5c')]['id'];_0x5eecb8[_0xe1b0('0x5d')]['id']=_0x45ab44[_0xe1b0('0x55')][_0xe1b0('0x5b')];return db[_0xe1b0('0x3b')][_0xe1b0('0x56')]({'where':{'id':_0x45ab44[_0xe1b0('0x53')]['id'],'UserId':null}})[_0xe1b0('0x1f')](handleEntityNotFound(_0x2ac41b,null))[_0xe1b0('0x1f')](saveUpdates(_0x45ab44[_0xe1b0('0x55')],null))[_0xe1b0('0x1f')](function(_0xebd1b1){if(_0xebd1b1){_0x5eecb8['message']=_0xebd1b1[_0xe1b0('0x5e')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0xebd1b1[_0xe1b0('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x2ac41b,null))[_0xe1b0('0x1f')](function(_0x5d0231){if(_0x5d0231){return _0x5d0231[_0xe1b0('0x35')]({'UserId':_0x45ab44[_0xe1b0('0x55')][_0xe1b0('0x5b')],'read1stAt':_[_0xe1b0('0x60')](_0x5d0231[_0xe1b0('0x61')])?moment()[_0xe1b0('0x59')](_0xe1b0('0x5a')):undefined});}return null;})[_0xe1b0('0x1f')](function(_0x1afef9){if(_0x1afef9){_0x5eecb8['interaction']=_0x1afef9['get']({'plain':!![]});interaction_log['info'](_0xe1b0('0x62'),_0x45ab44[_0xe1b0('0x5c')]['id'],_0x45ab44[_0xe1b0('0x5c')][_0xe1b0('0x63')],_0x45ab44[_0xe1b0('0x5c')]['role'],_0x5eecb8[_0xe1b0('0x64')]['id'],_0x45ab44[_0xe1b0('0x55')]?JSON[_0xe1b0('0x25')](_0x45ab44['body']):'null');return respondWithRpcPromise(_0xe1b0('0x65'),_0xe1b0('0x66'),_0x5eecb8);}return null;})[_0xe1b0('0x1f')](function(_0x1e0c3c){var _0x4355e5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1e0c3c['message'][_0xe1b0('0x67')];return db[_0xe1b0('0x68')]['query'](_0x4355e5,{'type':db['Sequelize']['QueryTypes'][_0xe1b0('0x69')],'raw':!![]})[_0xe1b0('0x1f')](function(_0x5d532b){return _0x5d532b;});})[_0xe1b0('0x1f')](function(_0x224122){if(_0x224122){_0x5eecb8[_0xe1b0('0x27')]['contact']=_0x224122[0x0];if(!_0x45ab44['body'][_0xe1b0('0x5b')])return;return db[_0xe1b0('0x6a')]['find']({'where':{'id':_0x45ab44[_0xe1b0('0x55')][_0xe1b0('0x5b')],'role':_0xe1b0('0x5d')},'attributes':['id',_0xe1b0('0x63'),_0xe1b0('0x6b'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x3990f4){if(!_0x3990f4)return null;_0x5eecb8[_0xe1b0('0x27')]['agent']=_0x3990f4;return _0x5eecb8;})[_0xe1b0('0x1f')](function(_0x2bd18f){if(_0x2bd18f){if(_0x45ab44[_0xe1b0('0x55')][_0xe1b0('0x6c')]){_0x5eecb8[_0xe1b0('0x27')]['interface']=util['format'](_0xe1b0('0x6d'),_0x45ab44[_0xe1b0('0x5c')]['name']);_0x5eecb8['message']['channel']=_0x5eecb8['channel'];_0x5eecb8[_0xe1b0('0x27')][_0xe1b0('0x6e')]=_0x5eecb8['channel'];_0x5eecb8['message'][_0xe1b0('0x6f')]=_0xe1b0('0x70');return respondWithRpcPromise(_0xe1b0('0x71'),_0xe1b0('0x71'),{'event':_0xe1b0('0x72'),'message':_0x5eecb8[_0xe1b0('0x27')]},client9002)[_0xe1b0('0x1f')](function(){return _0x5eecb8;});}return _0x5eecb8;}return null;})[_0xe1b0('0x1f')](respondWithResult(_0x2ac41b,null))['catch'](handleError(_0x2ac41b,null));};var interaction_log=require(_0xe1b0('0x11'))(_0xe1b0('0x58'));exports[_0xe1b0('0x33')]=function(_0x2c748b,_0x6468ff,_0x1a8149){var _0x4deb8e={'agent':{},'channel':_0xe1b0('0x73')};if(_0x2c748b[_0xe1b0('0x55')]['id']){delete _0x2c748b[_0xe1b0('0x55')]['id'];}_0x2c748b[_0xe1b0('0x55')][_0xe1b0('0x5b')]=_0x2c748b[_0xe1b0('0x55')][_0xe1b0('0x5b')]||_0x2c748b[_0xe1b0('0x5c')]['id'];_0x4deb8e[_0xe1b0('0x5d')]['id']=_0x2c748b[_0xe1b0('0x55')][_0xe1b0('0x5b')];return db[_0xe1b0('0x3b')]['find']({'where':{'id':_0x2c748b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x6468ff,null))[_0xe1b0('0x1f')](function(_0x3e6faa){if(_0x3e6faa){_0x4deb8e[_0xe1b0('0x27')]=_0x3e6faa['get']({'plain':!![]});return db[_0xe1b0('0x74')]['find']({'where':{'id':_0x3e6faa[_0xe1b0('0x5f')]}});}return null;})[_0xe1b0('0x1f')](handleEntityNotFound(_0x6468ff,null))[_0xe1b0('0x1f')](function(_0xdbddea){if(_0xdbddea){_0x4deb8e['interaction']=_0xdbddea[_0xe1b0('0x5e')]({'plain':!![]});interaction_log[_0xe1b0('0x20')](_0xe1b0('0x75'),_0x2c748b[_0xe1b0('0x5c')]['id'],_0x2c748b['user'][_0xe1b0('0x63')],_0x2c748b[_0xe1b0('0x5c')]['role'],_0x4deb8e[_0xe1b0('0x64')]['id'],_0x2c748b['body']?JSON[_0xe1b0('0x25')](_0x2c748b[_0xe1b0('0x55')]):_0xe1b0('0x76'));return respondWithRpcPromise('RejectMessage',_0xe1b0('0x77'),_0x4deb8e);}return null;})[_0xe1b0('0x1f')](function(_0x17801d){var _0x1773de=_0xe1b0('0x78')+_0x17801d['message'][_0xe1b0('0x67')];return db['sequelize'][_0xe1b0('0x40')](_0x1773de,{'type':db[_0xe1b0('0x79')][_0xe1b0('0x7a')]['SELECT'],'raw':!![]})['then'](function(_0x571d13){return _0x571d13;});})[_0xe1b0('0x1f')](function(_0x25707e){if(_0x25707e){_0x4deb8e[_0xe1b0('0x27')][_0xe1b0('0x7b')]=_0x25707e[0x0];if(!_0x2c748b[_0xe1b0('0x55')][_0xe1b0('0x5b')])return;return db[_0xe1b0('0x6a')]['find']({'where':{'id':_0x2c748b[_0xe1b0('0x55')][_0xe1b0('0x5b')],'role':_0xe1b0('0x5d')},'attributes':['id',_0xe1b0('0x63'),'fullname',_0xe1b0('0x7c'),_0xe1b0('0x7d')],'raw':!![]});}return null;})[_0xe1b0('0x1f')](function(_0x16d31c){if(!_0x16d31c)return null;_0x4deb8e[_0xe1b0('0x27')]['agent']=_0x16d31c;return _0x4deb8e;})[_0xe1b0('0x1f')](function(_0x1a15de){if(_0x1a15de){_0x1a15de[_0xe1b0('0x27')][_0xe1b0('0x7e')]=util[_0xe1b0('0x59')](_0xe1b0('0x6d'),_0x2c748b[_0xe1b0('0x5c')][_0xe1b0('0x63')]);_0x1a15de[_0xe1b0('0x27')][_0xe1b0('0x7f')]=_0x4deb8e[_0xe1b0('0x7f')];_0x1a15de['message'][_0xe1b0('0x6e')]=_0x4deb8e[_0xe1b0('0x7f')];_0x1a15de[_0xe1b0('0x27')][_0xe1b0('0x6f')]=_0xe1b0('0x33');respondWithRpcPromise('EventManager',_0xe1b0('0x71'),{'event':_0xe1b0('0x80'),'message':_0x1a15de[_0xe1b0('0x27')]},client9002);return _0x4deb8e;}return null;})[_0xe1b0('0x1f')](respondWithResult(_0x6468ff,null))[_0xe1b0('0x29')](handleError(_0x6468ff,null));};exports[_0xe1b0('0x81')]=function(_0x5dd481,_0x508658){var _0x5c34a6;return db[_0xe1b0('0x3b')][_0xe1b0('0x81')](_0x5dd481[_0xe1b0('0x55')],{})['then'](function(_0x2d9f3c){_0x5c34a6=_0x2d9f3c;return db[_0xe1b0('0x82')][_0xe1b0('0x83')]({'where':{'id':_0x5c34a6[_0xe1b0('0x67')]}});})[_0xe1b0('0x1f')](function(_0x2960d1){if(_[_0xe1b0('0x60')](_0x2960d1)){return;}else{_0x5c34a6[_0xe1b0('0x73')]=_0x2960d1['fax'];return db[_0xe1b0('0x84')][_0xe1b0('0x83')]({'where':{'id':_0x5c34a6[_0xe1b0('0x85')]}});}})[_0xe1b0('0x1f')](function(_0x373f54){return respondWithRpcPromise('SendFax',_0xe1b0('0x86'),{'FaxAccountId':_[_0xe1b0('0x60')](_0x5dd481[_0xe1b0('0x55')])?undefined:_0x5dd481[_0xe1b0('0x55')]['FaxAccountId'],'path':_[_0xe1b0('0x60')](_0x373f54)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x373f54[_0xe1b0('0x87')]),'fax':_[_0xe1b0('0x60')](_0x5c34a6[_0xe1b0('0x73')])?undefined:_0x5c34a6[_0xe1b0('0x73')],'AttachmentId':_0x5c34a6['AttachmentId']},client9002);})[_0xe1b0('0x1f')](respondWithResult(_0x508658,0xc9))[_0xe1b0('0x29')](handleError(_0x508658,null));};exports[_0xe1b0('0x88')]=function(_0x4f898b,_0x10c60d){var _0x44532f=path['join'](config[_0xe1b0('0x89')],_0xe1b0('0x8a'),_0xe1b0('0x8b'),_0xe1b0('0x8c'));return db[_0xe1b0('0x3b')][_0xe1b0('0x56')]({'where':{'id':_0x4f898b['params']['id']},'include':[{'model':db['Attachment'],'as':_0xe1b0('0x84')}]})[_0xe1b0('0x1f')](handleEntityNotFound(_0x10c60d,null))[_0xe1b0('0x1f')](function(_0x5f7853){if(_0x5f7853){return _0x10c60d[_0xe1b0('0x88')](path[_0xe1b0('0x8d')](_0x44532f,_0x5f7853[_0xe1b0('0x84')][_0xe1b0('0x87')]));}})['catch'](handleError(_0x10c60d,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 12bda84..8b3e25b 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 _0xb1ad=['FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x47c038,_0x1f7096){var _0x1e0f88=function(_0x6dd838){while(--_0x6dd838){_0x47c038['push'](_0x47c038['shift']());}};_0x1e0f88(++_0x1f7096);}(_0xb1ad,0x184));var _0xdb1a=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xb1ad[_0x3c4737];return _0x2bb926;};'use strict';var EventEmitter=require(_0xdb1a('0x0'));var FaxMessage=require(_0xdb1a('0x1'))['db'][_0xdb1a('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xdb1a('0x3')](0x0);var events={'afterCreate':_0xdb1a('0x4'),'afterUpdate':_0xdb1a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1a0d04){return function(_0x15cb4f,_0x24b01f,_0x10b9c1){FaxMessageEvents[_0xdb1a('0x6')](_0x1a0d04+':'+_0x15cb4f['id'],_0x15cb4f);FaxMessageEvents[_0xdb1a('0x6')](_0x1a0d04,_0x15cb4f);_0x10b9c1(null);};}for(var e in events){if(events[_0xdb1a('0x7')](e)){var event=events[e];FaxMessage[_0xdb1a('0x8')](e,emitEvent(event));}}module[_0xdb1a('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x0650=['update','emit','exports','events','FaxMessage','setMaxListeners'];(function(_0x33dea6,_0x360557){var _0x222e64=function(_0x13ef9f){while(--_0x13ef9f){_0x33dea6['push'](_0x33dea6['shift']());}};_0x222e64(++_0x360557);}(_0x0650,0xed));var _0x0065=function(_0xfdd6b6,_0x19497a){_0xfdd6b6=_0xfdd6b6-0x0;var _0x464439=_0x0650[_0xfdd6b6];return _0x464439;};'use strict';var EventEmitter=require(_0x0065('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x0065('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x0065('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0065('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2e05a4){return function(_0x8260ba,_0x3dd8c6,_0x4b15b1){FaxMessageEvents[_0x0065('0x4')](_0x2e05a4+':'+_0x8260ba['id'],_0x8260ba);FaxMessageEvents['emit'](_0x2e05a4,_0x8260ba);_0x4b15b1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x0065('0x5')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index b18ef5a..08aba00 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 _0xaef4=['rimraf','./faxMessage.attributes','exports','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0xaef4,0x19a));var _0x4aef=function(_0x3fe353,_0x326284){_0x3fe353=_0x3fe353-0x0;var _0x4c6d1f=_0xaef4[_0x3fe353];return _0x4c6d1f;};'use strict';var _=require('lodash');var util=require(_0x4aef('0x0'));var logger=require(_0x4aef('0x1'))(_0x4aef('0x2'));var moment=require(_0x4aef('0x3'));var BPromise=require(_0x4aef('0x4'));var rp=require(_0x4aef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4aef('0x6'));var config=require('../../config/environment');var attributes=require(_0x4aef('0x7'));module[_0x4aef('0x8')]=function(_0x1dac67,_0x205cc8){return _0x1dac67['define']('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x4aef('0x9')],'type':_0x4aef('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e9ad1,_0x368934,_0x4f6bdc){var _0x198b8b=_0x1dac67['models'];var _0x1699c2=_0x4e9ad1[_0x4aef('0xb')]({'plain':!![]});if(_0x1699c2[_0x4aef('0xc')][_0x4aef('0xd')]()==='in'||_0x1699c2['direction'][_0x4aef('0xd')]()===_0x4aef('0xe')&&!_0x1699c2[_0x4aef('0xf')]&&!_['isNil'](_0x1699c2[_0x4aef('0x10')])){_0x198b8b[_0x4aef('0x11')][_0x4aef('0x12')]({'where':{'id':_0x1699c2[_0x4aef('0x13')]}})[_0x4aef('0x14')](function(_0x5755aa){if(_0x5755aa){_0x5755aa[_0x4aef('0x15')]({'lastMsgAt':_0x1699c2[_0x4aef('0x16')],'lastMsgDirection':_0x1699c2[_0x4aef('0xc')][_0x4aef('0xd')]()});}})[_0x4aef('0x17')](function(_0x40ab31){console[_0x4aef('0x18')](_0x40ab31);});}_0x4f6bdc();}},'charset':'utf8mb4','collate':_0x4aef('0x19')});}; \ No newline at end of file +var _0xfa82=['utf8mb4','lodash','moment','bluebird','request-promise','../../config/environment','./faxMessage.attributes','define','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','error'];(function(_0x56ec61,_0x45ecf8){var _0x5aab6a=function(_0x42909b){while(--_0x42909b){_0x56ec61['push'](_0x56ec61['shift']());}};_0x5aab6a(++_0x45ecf8);}(_0xfa82,0x146));var _0x2fa8=function(_0x469b6b,_0x301166){_0x469b6b=_0x469b6b-0x0;var _0x14bc89=_0xfa82[_0x469b6b];return _0x14bc89;};'use strict';var _=require(_0x2fa8('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2fa8('0x1'));var BPromise=require(_0x2fa8('0x2'));var rp=require(_0x2fa8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2fa8('0x4'));var attributes=require(_0x2fa8('0x5'));module['exports']=function(_0x53ebb2,_0xafb3ae){return _0x53ebb2[_0x2fa8('0x6')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x2fa8('0x7'),'fields':[_0x2fa8('0x8')],'type':_0x2fa8('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x22fe83,_0x24e381,_0x168d16){var _0x3dd3af=_0x53ebb2[_0x2fa8('0xa')];var _0x37e6e1=_0x22fe83[_0x2fa8('0xb')]({'plain':!![]});if(_0x37e6e1[_0x2fa8('0xc')]['toLowerCase']()==='in'||_0x37e6e1['direction'][_0x2fa8('0xd')]()===_0x2fa8('0xe')&&!_0x37e6e1['secret']&&!_[_0x2fa8('0xf')](_0x37e6e1[_0x2fa8('0x10')])){_0x3dd3af[_0x2fa8('0x11')][_0x2fa8('0x12')]({'where':{'id':_0x37e6e1[_0x2fa8('0x13')]}})[_0x2fa8('0x14')](function(_0x4e9140){if(_0x4e9140){_0x4e9140[_0x2fa8('0x15')]({'lastMsgAt':_0x37e6e1[_0x2fa8('0x16')],'lastMsgDirection':_0x37e6e1[_0x2fa8('0xc')][_0x2fa8('0xd')]()});}})['catch'](function(_0x5a4634){console[_0x2fa8('0x17')](_0x5a4634);});}_0x168d16();}},'charset':_0x2fa8('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 4fbaba6..6efea91 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 _0x7bae=['request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FaxMessage,\x20%s,\x20%s','create','body','options','raw','CreateFaxMessage','debug','FaxMessage','update','where','limit','UpdateFaxMessage','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','request','then','info'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7bae,0x13b));var _0xe7ba=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x7bae[_0x31cb5f];return _0x586042;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7ba('0x0'));var BPromise=require(_0xe7ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ba('0x3'));var logger=require(_0xe7ba('0x4'))(_0xe7ba('0x5'));var config=require(_0xe7ba('0x6'));var jayson=require(_0xe7ba('0x7'));var client=jayson[_0xe7ba('0x8')][_0xe7ba('0x9')]({'port':0x232a});config[_0xe7ba('0xa')]=_[_0xe7ba('0xb')](config[_0xe7ba('0xa')],{'host':_0xe7ba('0xc'),'port':0x18eb});var socket=require(_0xe7ba('0xd'))(new Redis(config[_0xe7ba('0xa')]));require(_0xe7ba('0xe'))['register'](socket);function respondWithRpcPromise(_0x3df8bf,_0xe57e33,_0x375ebb){return new BPromise(function(_0x276bc3,_0x15083a){return client[_0xe7ba('0xf')](_0x3df8bf,_0x375ebb)[_0xe7ba('0x10')](function(_0x448bcc){logger[_0xe7ba('0x11')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0xe7ba('0x12'));logger['debug'](_0xe7ba('0x13'),_0xe57e33,_0xe7ba('0x12'),JSON[_0xe7ba('0x14')](_0x448bcc));if(_0x448bcc[_0xe7ba('0x15')]){if(_0x448bcc[_0xe7ba('0x15')][_0xe7ba('0x16')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0x448bcc[_0xe7ba('0x15')][_0xe7ba('0x17')]);return _0x15083a(_0x448bcc[_0xe7ba('0x15')]['message']);}logger[_0xe7ba('0x15')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0x448bcc['error']['message']);return _0x276bc3(_0x448bcc[_0xe7ba('0x15')]['message']);}else{logger[_0xe7ba('0x11')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,'request\x20sent');_0x276bc3(_0x448bcc['result'][_0xe7ba('0x17')]);}})[_0xe7ba('0x18')](function(_0x39ca38){logger[_0xe7ba('0x15')](_0xe7ba('0x19'),_0xe57e33,_0x39ca38);_0x15083a(_0x39ca38);});});}exports['CreateFaxMessage']=function(_0x149c62){var _0x20c653=this;return new Promise(function(_0x3b40fb,_0x136ec6){return db['FaxMessage'][_0xe7ba('0x1a')](_0x149c62[_0xe7ba('0x1b')],{'raw':_0x149c62['options']?_0x149c62[_0xe7ba('0x1c')][_0xe7ba('0x1d')]===undefined?!![]:![]:!![]})[_0xe7ba('0x10')](function(_0x7ab9e4){logger[_0xe7ba('0x11')](_0xe7ba('0x1e'),_0x149c62);logger[_0xe7ba('0x1f')](_0xe7ba('0x1e'),_0x149c62,JSON[_0xe7ba('0x14')](_0x7ab9e4));_0x3b40fb(_0x7ab9e4);})[_0xe7ba('0x18')](function(_0x58cf43){logger['error']('CreateFaxMessage',_0x58cf43['message'],_0x149c62);_0x136ec6(_0x20c653[_0xe7ba('0x15')](0x1f4,_0x58cf43['message']));});});};exports['UpdateFaxMessage']=function(_0x5ece11){var _0x255def=this;return new Promise(function(_0x32cc00,_0xe32862){return db[_0xe7ba('0x20')][_0xe7ba('0x21')](_0x5ece11[_0xe7ba('0x1b')],{'raw':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11[_0xe7ba('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11['options'][_0xe7ba('0x22')]||null:null,'attributes':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11[_0xe7ba('0x1c')]['attributes']||null:null,'limit':_0x5ece11['options']?_0x5ece11[_0xe7ba('0x1c')][_0xe7ba('0x23')]||null:null})[_0xe7ba('0x10')](function(_0x20b6cd){logger[_0xe7ba('0x11')]('UpdateFaxMessage',_0x5ece11);logger[_0xe7ba('0x1f')](_0xe7ba('0x24'),_0x5ece11,JSON['stringify'](_0x20b6cd));_0x32cc00(_0x20b6cd);})[_0xe7ba('0x18')](function(_0x530227){logger['error'](_0xe7ba('0x24'),_0x530227[_0xe7ba('0x17')],_0x5ece11);_0xe32862(_0x255def[_0xe7ba('0x15')](0x1f4,_0x530227['message']));});});}; \ No newline at end of file +var _0x24ca=['redis','defaults','socket.io-emitter','./faxMessage.socket','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage','create','body','options','stringify','UpdateFaxMessage','FaxMessage','update','where','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x24ca,0x1bc));var _0xa24c=function(_0xe39824,_0xbdf61f){_0xe39824=_0xe39824-0x0;var _0x4bc31e=_0x24ca[_0xe39824];return _0x4bc31e;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require(_0xa24c('0x1'));var BPromise=require(_0xa24c('0x2'));var rs=require(_0xa24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24c('0x4'))['db'];var utils=require(_0xa24c('0x5'));var logger=require(_0xa24c('0x6'))(_0xa24c('0x7'));var config=require(_0xa24c('0x8'));var jayson=require(_0xa24c('0x9'));var client=jayson[_0xa24c('0xa')][_0xa24c('0xb')]({'port':0x232a});config[_0xa24c('0xc')]=_[_0xa24c('0xd')](config[_0xa24c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa24c('0xe'))(new Redis(config[_0xa24c('0xc')]));require(_0xa24c('0xf'))['register'](socket);function respondWithRpcPromise(_0x399f32,_0x325c6d,_0x288f76){return new BPromise(function(_0x211003,_0x169632){return client[_0xa24c('0x10')](_0x399f32,_0x288f76)[_0xa24c('0x11')](function(_0xc82af0){logger[_0xa24c('0x12')]('FaxMessage,\x20%s,\x20%s',_0x325c6d,_0xa24c('0x13'));logger[_0xa24c('0x14')](_0xa24c('0x15'),_0x325c6d,_0xa24c('0x13'),JSON['stringify'](_0xc82af0));if(_0xc82af0[_0xa24c('0x16')]){if(_0xc82af0[_0xa24c('0x16')][_0xa24c('0x17')]===0x1f4){logger[_0xa24c('0x16')](_0xa24c('0x18'),_0x325c6d,_0xc82af0[_0xa24c('0x16')][_0xa24c('0x19')]);return _0x169632(_0xc82af0['error']['message']);}logger[_0xa24c('0x16')](_0xa24c('0x18'),_0x325c6d,_0xc82af0['error']['message']);return _0x211003(_0xc82af0[_0xa24c('0x16')][_0xa24c('0x19')]);}else{logger['info'](_0xa24c('0x18'),_0x325c6d,'request\x20sent');_0x211003(_0xc82af0[_0xa24c('0x1a')][_0xa24c('0x19')]);}})[_0xa24c('0x1b')](function(_0xefdbd9){logger['error'](_0xa24c('0x18'),_0x325c6d,_0xefdbd9);_0x169632(_0xefdbd9);});});}exports[_0xa24c('0x1c')]=function(_0x773f70){var _0x4d4bab=this;return new Promise(function(_0x48a768,_0x506424){return db['FaxMessage'][_0xa24c('0x1d')](_0x773f70[_0xa24c('0x1e')],{'raw':_0x773f70[_0xa24c('0x1f')]?_0x773f70[_0xa24c('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xa24c('0x11')](function(_0x5f299e){logger[_0xa24c('0x12')](_0xa24c('0x1c'),_0x773f70);logger['debug'](_0xa24c('0x1c'),_0x773f70,JSON[_0xa24c('0x20')](_0x5f299e));_0x48a768(_0x5f299e);})[_0xa24c('0x1b')](function(_0x188ee2){logger[_0xa24c('0x16')]('CreateFaxMessage',_0x188ee2[_0xa24c('0x19')],_0x773f70);_0x506424(_0x4d4bab['error'](0x1f4,_0x188ee2[_0xa24c('0x19')]));});});};exports[_0xa24c('0x21')]=function(_0x294685){var _0x51dc3f=this;return new Promise(function(_0x1beb55,_0x31c4d9){return db[_0xa24c('0x22')][_0xa24c('0x23')](_0x294685[_0xa24c('0x1e')],{'raw':_0x294685[_0xa24c('0x1f')]?_0x294685[_0xa24c('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x294685[_0xa24c('0x1f')]?_0x294685[_0xa24c('0x1f')][_0xa24c('0x24')]||null:null,'attributes':_0x294685[_0xa24c('0x1f')]?_0x294685['options'][_0xa24c('0x25')]||null:null,'limit':_0x294685[_0xa24c('0x1f')]?_0x294685[_0xa24c('0x1f')]['limit']||null:null})[_0xa24c('0x11')](function(_0x3dcb1b){logger[_0xa24c('0x12')]('UpdateFaxMessage',_0x294685);logger[_0xa24c('0x14')]('UpdateFaxMessage',_0x294685,JSON[_0xa24c('0x20')](_0x3dcb1b));_0x1beb55(_0x3dcb1b);})[_0xa24c('0x1b')](function(_0x1a247b){logger['error'](_0xa24c('0x21'),_0x1a247b[_0xa24c('0x19')],_0x294685);_0x31c4d9(_0x51dc3f[_0xa24c('0x16')](0x1f4,_0x1a247b['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 02bb830..abdaf35 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 _0xeb6f=['length','faxMessage:','./faxMessage.events','save','remove','removeListener'];(function(_0xc7049a,_0x149388){var _0xe3b47e=function(_0x445f26){while(--_0x445f26){_0xc7049a['push'](_0xc7049a['shift']());}};_0xe3b47e(++_0x149388);}(_0xeb6f,0x6e));var _0xfeb6=function(_0x5a26f5,_0x196300){_0x5a26f5=_0x5a26f5-0x0;var _0x2e9ef7=_0xeb6f[_0x5a26f5];return _0x2e9ef7;};'use strict';var FaxMessageEvents=require(_0xfeb6('0x0'));var events=[_0xfeb6('0x1'),_0xfeb6('0x2'),'update'];function createListener(_0x1ebc30,_0x40be6d){return function(_0x3c3735){_0x40be6d['emit'](_0x1ebc30,_0x3c3735);};}function removeListener(_0x2ccb40,_0x3a2db6){return function(){FaxMessageEvents[_0xfeb6('0x3')](_0x2ccb40,_0x3a2db6);};}exports['register']=function(_0x3c6818){for(var _0x1c0e5f=0x0,_0x119f7d=events[_0xfeb6('0x4')];_0x1c0e5f<_0x119f7d;_0x1c0e5f++){var _0x2e9f77=events[_0x1c0e5f];var _0x4f04bf=createListener(_0xfeb6('0x5')+_0x2e9f77,_0x3c6818);FaxMessageEvents['on'](_0x2e9f77,_0x4f04bf);}}; \ No newline at end of file +var _0x2099=['register','length','./faxMessage.events','save','remove','update','removeListener'];(function(_0x56e349,_0xb6bc4c){var _0x34894e=function(_0x34dbad){while(--_0x34dbad){_0x56e349['push'](_0x56e349['shift']());}};_0x34894e(++_0xb6bc4c);}(_0x2099,0x64));var _0x9209=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2099[_0x122ef9];return _0x42fba0;};'use strict';var FaxMessageEvents=require(_0x9209('0x0'));var events=[_0x9209('0x1'),_0x9209('0x2'),_0x9209('0x3')];function createListener(_0x2d8195,_0x5d0f54){return function(_0x186132){_0x5d0f54['emit'](_0x2d8195,_0x186132);};}function removeListener(_0x54d7f9,_0x370f77){return function(){FaxMessageEvents[_0x9209('0x4')](_0x54d7f9,_0x370f77);};}exports[_0x9209('0x5')]=function(_0x117403){for(var _0x8fd390=0x0,_0x1aa2d8=events[_0x9209('0x6')];_0x8fd390<_0x1aa2d8;_0x8fd390++){var _0x4cebb0=events[_0x8fd390];var _0x16ca33=createListener('faxMessage:'+_0x4cebb0,_0x117403);FaxMessageEvents['on'](_0x4cebb0,_0x16ca33);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index fafaa6a..6ff3b05 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 _0x13f6=['isAuthenticated','index','get','/:id','show','/:id/download','download','tracked','fax','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller'];(function(_0x133f85,_0x2d1ce0){var _0x400bd7=function(_0x3b9040){while(--_0x3b9040){_0x133f85['push'](_0x133f85['shift']());}};_0x400bd7(++_0x2d1ce0);}(_0x13f6,0x124));var _0x613f=function(_0xa060e7,_0x15768f){_0xa060e7=_0xa060e7-0x0;var _0x15b6c5=_0x13f6[_0xa060e7];return _0x15b6c5;};'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['post']('/',auth[_0x613f('0x8')](),interaction[_0x613f('0xf')](_0x613f('0x10'),'faxmessage:create'),controller[_0x613f('0x11')]);router[_0x613f('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x613f('0x12')](_0x613f('0x13'),auth[_0x613f('0x8')](),controller[_0x613f('0x14')]);router[_0x613f('0x12')](_0x613f('0x15'),auth[_0x613f('0x8')](),controller[_0x613f('0x16')]);router[_0x613f('0x17')](_0x613f('0xb'),auth['isAuthenticated'](),controller[_0x613f('0x18')]);module['exports']=router; \ No newline at end of file +var _0xb7e7=['get','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/reject','reject','delete','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','index'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb7e7[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')]('/',auth[_0x7b7e('0xc')](),interaction[_0x7b7e('0x11')](_0x7b7e('0x12'),_0x7b7e('0x13')),controller[_0x7b7e('0x14')]);router[_0x7b7e('0x15')](_0x7b7e('0xb'),auth['isAuthenticated'](),controller[_0x7b7e('0x16')]);router[_0x7b7e('0x15')]('/:id/accept',auth[_0x7b7e('0xc')](),controller['accept']);router['put'](_0x7b7e('0x17'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x18')]);router[_0x7b7e('0x19')](_0x7b7e('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7b7e('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 1e5e677..08e7219 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 _0x4e6e=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x710883,_0x2f8fce){var _0x2fbd9b=function(_0x1808a0){while(--_0x1808a0){_0x710883['push'](_0x710883['shift']());}};_0x2fbd9b(++_0x2f8fce);}(_0x4e6e,0x143));var _0xe4e6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4e6e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xe4e6('0x0'));module[_0xe4e6('0x1')]={'name':{'type':Sequelize[_0xe4e6('0x2')],'unique':_0xe4e6('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe4e6('0x2')]},'timeout':{'type':Sequelize[_0xe4e6('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe4e6('0x5')](_0xe4e6('0x6'),'beepall',_0xe4e6('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xe4e6('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0942=['rrmemory','beepall','exports','STRING','name','INTEGER','ENUM'];(function(_0x2b1ed6,_0x287163){var _0x3be760=function(_0x219a39){while(--_0x219a39){_0x2b1ed6['push'](_0x2b1ed6['shift']());}};_0x3be760(++_0x287163);}(_0x0942,0x11a));var _0x2094=function(_0x4519ad,_0x54d205){_0x4519ad=_0x4519ad-0x0;var _0x5bbcaf=_0x0942[_0x4519ad];return _0x5bbcaf;};'use strict';var Sequelize=require('sequelize');module[_0x2094('0x0')]={'name':{'type':Sequelize[_0x2094('0x1')],'unique':_0x2094('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2094('0x1')]},'timeout':{'type':Sequelize[_0x2094('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2094('0x4')](_0x2094('0x5'),_0x2094('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x2094('0x3')],'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 963962a..61fb308 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 _0xd9ef=['emit','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userFaxQueue:remove','ids','omit','spread','userFaxQueue:save','isArray','getAgents','bluebird','util','squel','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','Content-Range','update','then','destroy','get','FaxQueues','UserProfileResource','end','error','name','index','map','FaxQueue','rawAttributes','fieldName','include','query','rows','show','params','model','keys','intersection','attributes','fields','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMembers','findOne','UserFaxQueue','filters','length','nolimit','order','sort','where','pick','FaxQueueId','merge','filter','options','findAll','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','hasOwnProperty','Agents','voicePause','flatMap','sequelize','transaction','findOrCreate','forEach'];(function(_0x20385e,_0x463a07){var _0x491a62=function(_0x5d046a){while(--_0x5d046a){_0x20385e['push'](_0x20385e['shift']());}};_0x491a62(++_0x463a07);}(_0xd9ef,0x95));var _0xfd9e=function(_0x277bac,_0x54b92){_0x277bac=_0x277bac-0x0;var _0x2ad49c=_0xd9ef[_0x277bac];return _0x2ad49c;};'use strict';var BPromise=require(_0xfd9e('0x0'));var util=require(_0xfd9e('0x1'));var _=require('lodash');var squel=require(_0xfd9e('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xfd9e('0x3'));var config=require(_0xfd9e('0x4'));var db=require(_0xfd9e('0x5'))['db'];config[_0xfd9e('0x6')]=_[_0xfd9e('0x7')](config[_0xfd9e('0x6')],{'host':_0xfd9e('0x8'),'port':0x18eb});var socket=require(_0xfd9e('0x9'))(new Redis(config[_0xfd9e('0x6')]));require(_0xfd9e('0xa'))[_0xfd9e('0xb')](socket);function respondWithStatusCode(_0x1f35c7,_0x1f7e1e){_0x1f7e1e=_0x1f7e1e||0xcc;return function(_0x49457a){if(_0x49457a){return _0x1f35c7[_0xfd9e('0xc')](_0x1f7e1e);}return _0x1f35c7[_0xfd9e('0xd')](_0x1f7e1e)['end']();};}function respondWithResult(_0x49130f,_0x3d6859){_0x3d6859=_0x3d6859||0xc8;return function(_0x260793){if(_0x260793){return _0x49130f['status'](_0x3d6859)[_0xfd9e('0xe')](_0x260793);}};}function respondWithFilteredResult(_0x188629,_0x339901){return function(_0x44a97a){if(_0x44a97a){var _0x36dab3=typeof _0x339901['offset']===_0xfd9e('0xf')&&typeof _0x339901[_0xfd9e('0x10')]===_0xfd9e('0xf');var _0x9a3da1=_0x44a97a[_0xfd9e('0x11')];var _0x5087b8=_0x36dab3?0x0:_0x339901[_0xfd9e('0x12')];var _0x3df6fa=_0x36dab3?_0x44a97a[_0xfd9e('0x11')]:_0x339901[_0xfd9e('0x12')]+_0x339901['limit'];var _0x1577ba;if(_0x3df6fa>=_0x9a3da1){_0x3df6fa=_0x9a3da1;_0x1577ba=0xc8;}else{_0x1577ba=0xce;}_0x188629['status'](_0x1577ba);return _0x188629['set'](_0xfd9e('0x13'),_0x5087b8+'-'+_0x3df6fa+'/'+_0x9a3da1)[_0xfd9e('0xe')](_0x44a97a);}return null;};}function saveUpdates(_0x144372){return function(_0x4d605a){if(_0x4d605a){return _0x4d605a[_0xfd9e('0x14')](_0x144372)[_0xfd9e('0x15')](function(_0x64c8f6){return _0x64c8f6;});}return null;};}function removeEntity(_0x20279d){return function(_0x3de235){if(_0x3de235){return _0x3de235[_0xfd9e('0x16')]()[_0xfd9e('0x15')](function(){var _0x5e3ecf=_0x3de235[_0xfd9e('0x17')]({'plain':!![]});var _0x32e48f=_0xfd9e('0x18');return db[_0xfd9e('0x19')][_0xfd9e('0x16')]({'where':{'type':_0x32e48f,'resourceId':_0x5e3ecf['id']}})[_0xfd9e('0x15')](function(){return _0x3de235;});})[_0xfd9e('0x15')](function(){_0x20279d[_0xfd9e('0xd')](0xcc)[_0xfd9e('0x1a')]();});}};}function handleEntityNotFound(_0x1649a6){return function(_0x5d47cb){if(!_0x5d47cb){_0x1649a6[_0xfd9e('0xc')](0x194);}return _0x5d47cb;};}function handleError(_0x24bc2c,_0x140992){_0x140992=_0x140992||0x1f4;return function(_0x19a21c){logger[_0xfd9e('0x1b')](_0x19a21c['stack']);if(_0x19a21c[_0xfd9e('0x1c')]){delete _0x19a21c[_0xfd9e('0x1c')];}_0x24bc2c['status'](_0x140992)['send'](_0x19a21c);};}exports[_0xfd9e('0x1d')]=function(_0x341f24,_0xde3dd){var _0x16768a={};var _0x14fd94={'count':0x0,'rows':[]};var _0x4b83e0=_[_0xfd9e('0x1e')](db[_0xfd9e('0x1f')][_0xfd9e('0x20')],function(_0x33b57a){return{'name':_0x33b57a[_0xfd9e('0x21')],'type':_0x33b57a['type']['key']};});_0x16768a=qs['getOptions'](_0x4b83e0,_0x341f24);var _0x359fb8={'where':_0x16768a['where']};return db['FaxQueue'][_0xfd9e('0x11')](_0x359fb8)[_0xfd9e('0x15')](function(_0x53272f){_0x14fd94[_0xfd9e('0x11')]=_0x53272f;_0x16768a[_0xfd9e('0x22')]=qs[_0xfd9e('0x22')](_0x341f24[_0xfd9e('0x23')]);return db['FaxQueue']['findAll'](_0x16768a);})[_0xfd9e('0x15')](function(_0x27ac22){_0x14fd94[_0xfd9e('0x24')]=_0x27ac22;return _0x14fd94;})[_0xfd9e('0x15')](respondWithFilteredResult(_0xde3dd,_0x16768a))['catch'](handleError(_0xde3dd,null));};exports[_0xfd9e('0x25')]=function(_0x346ea0,_0x5abc21){var _0x5ef955={'raw':!![],'where':{'id':_0x346ea0[_0xfd9e('0x26')]['id']}},_0x3187c4={};_0x3187c4[_0xfd9e('0x27')]=_[_0xfd9e('0x28')](db[_0xfd9e('0x1f')][_0xfd9e('0x20')]);_0x3187c4[_0xfd9e('0x23')]=_[_0xfd9e('0x28')](_0x346ea0[_0xfd9e('0x23')]);_0x3187c4['filters']=_[_0xfd9e('0x29')](_0x3187c4[_0xfd9e('0x27')],_0x3187c4[_0xfd9e('0x23')]);_0x5ef955[_0xfd9e('0x2a')]=_[_0xfd9e('0x29')](_0x3187c4[_0xfd9e('0x27')],qs[_0xfd9e('0x2b')](_0x346ea0[_0xfd9e('0x23')][_0xfd9e('0x2b')]));_0x5ef955[_0xfd9e('0x2a')]=_0x5ef955[_0xfd9e('0x2a')]['length']?_0x5ef955['attributes']:_0x3187c4['model'];if(_0x346ea0[_0xfd9e('0x23')][_0xfd9e('0x2c')]){_0x5ef955['include']=[{'all':!![]}];}_0x5ef955=_['merge']({},_0x5ef955,_0x346ea0['options']);return db[_0xfd9e('0x1f')][_0xfd9e('0x2d')](_0x5ef955)[_0xfd9e('0x15')](handleEntityNotFound(_0x5abc21,null))[_0xfd9e('0x15')](respondWithResult(_0x5abc21,null))[_0xfd9e('0x2e')](handleError(_0x5abc21,null));};exports[_0xfd9e('0x2f')]=function(_0xd2d506,_0x573868){return db['FaxQueue'][_0xfd9e('0x2f')](_0xd2d506['body'],{})[_0xfd9e('0x15')](function(_0x2c4c8a){var _0x1d2f1e=_0xd2d506[_0xfd9e('0x30')][_0xfd9e('0x17')]({'plain':!![]});if(!_0x1d2f1e)throw new Error(_0xfd9e('0x31'));if(_0x1d2f1e['role']==='user'){var _0x289e88=_0x2c4c8a['get']({'plain':!![]});var _0x120bf7=_0xfd9e('0x18');return db[_0xfd9e('0x32')][_0xfd9e('0x2d')]({'where':{'name':_0x120bf7,'userProfileId':_0x1d2f1e[_0xfd9e('0x33')]},'raw':!![]})[_0xfd9e('0x15')](function(_0x182cc8){if(_0x182cc8&&_0x182cc8[_0xfd9e('0x34')]===0x0){return db[_0xfd9e('0x19')][_0xfd9e('0x2f')]({'name':_0x289e88[_0xfd9e('0x1c')],'resourceId':_0x289e88['id'],'type':_0x182cc8['name'],'sectionId':_0x182cc8['id']},{})[_0xfd9e('0x15')](function(){return _0x2c4c8a;});}else{return _0x2c4c8a;}})[_0xfd9e('0x2e')](function(_0x29e2a2){logger[_0xfd9e('0x1b')](_0xfd9e('0x35'),_0x29e2a2);throw _0x29e2a2;});}return _0x2c4c8a;})[_0xfd9e('0x15')](respondWithResult(_0x573868,0xc9))[_0xfd9e('0x2e')](handleError(_0x573868,null));};exports[_0xfd9e('0x14')]=function(_0x4272d9,_0x101d8e){if(_0x4272d9[_0xfd9e('0x36')]['id']){delete _0x4272d9[_0xfd9e('0x36')]['id'];}return db[_0xfd9e('0x1f')][_0xfd9e('0x2d')]({'where':{'id':_0x4272d9[_0xfd9e('0x26')]['id']}})[_0xfd9e('0x15')](handleEntityNotFound(_0x101d8e,null))[_0xfd9e('0x15')](saveUpdates(_0x4272d9[_0xfd9e('0x36')],null))[_0xfd9e('0x15')](respondWithResult(_0x101d8e,null))[_0xfd9e('0x2e')](handleError(_0x101d8e,null));};exports[_0xfd9e('0x16')]=function(_0x340f2b,_0x53c640){return db['FaxQueue']['find']({'where':{'id':_0x340f2b[_0xfd9e('0x26')]['id']}})[_0xfd9e('0x15')](handleEntityNotFound(_0x53c640,null))[_0xfd9e('0x15')](removeEntity(_0x53c640,null))[_0xfd9e('0x2e')](handleError(_0x53c640,null));};exports['describe']=function(_0x5965fb,_0x225036){return db[_0xfd9e('0x1f')]['describe']()['then'](respondWithResult(_0x225036,null))['catch'](handleError(_0x225036,null));};exports[_0xfd9e('0x37')]=function(_0x52ac57,_0x5a2d3){var _0x57b485={'raw':!![],'where':{}},_0x18e5ad={},_0x36bd82;return db[_0xfd9e('0x1f')][_0xfd9e('0x38')]({'where':{'id':_0x52ac57['params']['id']}})[_0xfd9e('0x15')](handleEntityNotFound(_0x5a2d3,null))[_0xfd9e('0x15')](function(_0x11a6b6){if(_0x11a6b6){_0x36bd82=_0x11a6b6['get']({'plain':!![]});_0x18e5ad[_0xfd9e('0x27')]=_[_0xfd9e('0x28')](db[_0xfd9e('0x39')][_0xfd9e('0x20')]);_0x18e5ad[_0xfd9e('0x23')]=_[_0xfd9e('0x28')](_0x52ac57[_0xfd9e('0x23')]);_0x18e5ad[_0xfd9e('0x3a')]=_[_0xfd9e('0x29')](_0x18e5ad[_0xfd9e('0x27')],_0x18e5ad[_0xfd9e('0x23')]);_0x57b485[_0xfd9e('0x2a')]=_[_0xfd9e('0x29')](_0x18e5ad[_0xfd9e('0x27')],qs[_0xfd9e('0x2b')](_0x52ac57[_0xfd9e('0x23')][_0xfd9e('0x2b')]));_0x57b485[_0xfd9e('0x2a')]=_0x57b485[_0xfd9e('0x2a')][_0xfd9e('0x3b')]?_0x57b485['attributes']:_0x18e5ad[_0xfd9e('0x27')];if(!_0x52ac57[_0xfd9e('0x23')]['hasOwnProperty'](_0xfd9e('0x3c'))){_0x57b485['limit']=qs[_0xfd9e('0x10')](_0x52ac57[_0xfd9e('0x23')][_0xfd9e('0x10')]);_0x57b485[_0xfd9e('0x12')]=qs[_0xfd9e('0x12')](_0x52ac57['query'][_0xfd9e('0x12')]);}_0x57b485[_0xfd9e('0x3d')]=qs['sort'](_0x52ac57['query'][_0xfd9e('0x3e')]);_0x57b485[_0xfd9e('0x3f')]=qs[_0xfd9e('0x3a')](_[_0xfd9e('0x40')](_0x52ac57['query'],_0x18e5ad[_0xfd9e('0x3a')]));_0x57b485[_0xfd9e('0x3f')][_0xfd9e('0x41')]=_0x11a6b6['id'];if(_0x52ac57[_0xfd9e('0x23')]['filter']){_0x57b485[_0xfd9e('0x3f')]=_[_0xfd9e('0x42')](_0x57b485[_0xfd9e('0x3f')],{'$or':_['map'](_0x57b485[_0xfd9e('0x2a')],function(_0x3a78c5){var _0x54ab5c={};_0x54ab5c[_0x3a78c5]={'$like':'%'+_0x52ac57[_0xfd9e('0x23')][_0xfd9e('0x43')]+'%'};return _0x54ab5c;})});}_0x57b485=_[_0xfd9e('0x42')]({},_0x57b485,_0x52ac57[_0xfd9e('0x44')]);return db[_0xfd9e('0x39')][_0xfd9e('0x45')](_0x57b485);}})[_0xfd9e('0x15')](function(_0xe5479b){if(_0xe5479b){return db[_0xfd9e('0x46')][_0xfd9e('0x47')]({'where':{'id':_[_0xfd9e('0x1e')](_0xe5479b,_0xfd9e('0x48')),'role':'agent'},'attributes':['id','name',_0xfd9e('0x49'),_0xfd9e('0x4a'),_0xfd9e('0x4b')]});}})[_0xfd9e('0x15')](function(_0x2d8bd4){if(_0x2d8bd4){return{'count':_0x2d8bd4['count'],'rows':_['map'](_0x2d8bd4['rows'],function(_0x524207){return{'membername':_0x524207[_0xfd9e('0x1c')],'UserId':_0x524207['id'],'queue_name':_0x36bd82[_0xfd9e('0x1c')],'FaxQueueId':_0x36bd82['id'],'interface':util[_0xfd9e('0x4c')](_0xfd9e('0x4d'),_0xfd9e('0x4e'),_0x524207['name']),'penalty':0x0,'paused':_0x524207[_0xfd9e('0x49')],'createdAt':_0x524207['createdAt'],'updatedAt':_0x524207[_0xfd9e('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfd9e('0x15')](respondWithFilteredResult(_0x5a2d3,_0x57b485))[_0xfd9e('0x2e')](handleError(_0x5a2d3,null));};exports[_0xfd9e('0x4f')]=function(_0x3e3a16,_0x40dac2){var _0x117d8c={};var _0x5c153c={};var _0x327c9d;var _0x4a8356;return db['FaxQueue'][_0xfd9e('0x38')]({'where':{'id':_0x3e3a16[_0xfd9e('0x26')]['id']}})[_0xfd9e('0x15')](handleEntityNotFound(_0x40dac2,null))[_0xfd9e('0x15')](function(_0x2e4b8b){if(_0x2e4b8b){_0x327c9d=_0x2e4b8b;_0x5c153c[_0xfd9e('0x27')]=_[_0xfd9e('0x28')](db[_0xfd9e('0x50')][_0xfd9e('0x20')]);_0x5c153c['query']=_[_0xfd9e('0x28')](_0x3e3a16[_0xfd9e('0x23')]);_0x5c153c[_0xfd9e('0x3a')]=_[_0xfd9e('0x29')](_0x5c153c['model'],_0x5c153c[_0xfd9e('0x23')]);_0x117d8c[_0xfd9e('0x2a')]=_[_0xfd9e('0x29')](_0x5c153c[_0xfd9e('0x27')],qs[_0xfd9e('0x2b')](_0x3e3a16[_0xfd9e('0x23')][_0xfd9e('0x2b')]));_0x117d8c[_0xfd9e('0x2a')]=_0x117d8c[_0xfd9e('0x2a')][_0xfd9e('0x3b')]?_0x117d8c[_0xfd9e('0x2a')]:_0x5c153c[_0xfd9e('0x27')];_0x117d8c['order']=qs['sort'](_0x3e3a16[_0xfd9e('0x23')][_0xfd9e('0x3e')]);_0x117d8c[_0xfd9e('0x3f')]=qs[_0xfd9e('0x3a')](_[_0xfd9e('0x40')](_0x3e3a16['query'],_0x5c153c[_0xfd9e('0x3a')]));if(_0x3e3a16['query'][_0xfd9e('0x43')]){_0x117d8c[_0xfd9e('0x3f')]=_['merge'](_0x117d8c[_0xfd9e('0x3f')],{'$or':_['map'](_0x117d8c['attributes'],function(_0x12e4b7){var _0x9abf36={};_0x9abf36[_0x12e4b7]={'$like':'%'+_0x3e3a16['query'][_0xfd9e('0x43')]+'%'};return _0x9abf36;})});}_0x117d8c=_[_0xfd9e('0x42')]({},_0x117d8c,_0x3e3a16[_0xfd9e('0x44')]);return _0x327c9d[_0xfd9e('0x4f')](_0x117d8c);}})[_0xfd9e('0x15')](function(_0x372310){if(_0x372310){_0x4a8356=_0x372310[_0xfd9e('0x3b')];if(!_0x3e3a16[_0xfd9e('0x23')][_0xfd9e('0x51')](_0xfd9e('0x3c'))){_0x117d8c[_0xfd9e('0x10')]=qs[_0xfd9e('0x10')](_0x3e3a16[_0xfd9e('0x23')][_0xfd9e('0x10')]);_0x117d8c[_0xfd9e('0x12')]=qs[_0xfd9e('0x12')](_0x3e3a16['query']['offset']);}return _0x327c9d[_0xfd9e('0x4f')](_0x117d8c);}})[_0xfd9e('0x15')](function(_0x1d4306){if(_0x1d4306){return _0x1d4306?{'count':_0x4a8356,'rows':_0x1d4306}:null;}})['then'](respondWithResult(_0x40dac2,null))[_0xfd9e('0x2e')](handleError(_0x40dac2,null));};exports['addTeams']=function(_0x58db1b,_0x4b574b){var _0x2ac67a=_0x58db1b[_0xfd9e('0x36')]['ids'];return db['Team'][_0xfd9e('0x45')]({'where':{'id':_0x2ac67a},'attributes':['id'],'include':[{'model':db[_0xfd9e('0x46')],'as':_0xfd9e('0x52'),'attributes':['id',_0xfd9e('0x1c'),'online',_0xfd9e('0x53'),'interface'],'raw':!![]}]})[_0xfd9e('0x15')](function(_0x84a9f5){if(_0x84a9f5){var _0x13dcf4=_[_0xfd9e('0x54')](_0x84a9f5,function(_0x15fb84){var _0x1d248c=_0x15fb84[_0xfd9e('0x17')]({'plain':!![]});return _0x1d248c['Agents'];});return db[_0xfd9e('0x1f')]['find']({'where':{'id':_0x58db1b['params']['id']}})[_0xfd9e('0x15')](function(_0x22756a){return db[_0xfd9e('0x55')][_0xfd9e('0x56')](function(_0x52c192){return _0x22756a['addTeams'](_0x2ac67a,{'transaction':_0x52c192})[_0xfd9e('0x15')](function(){return BPromise['each'](_0x13dcf4,function(_0x5242dc){return db['UserFaxQueue'][_0xfd9e('0x57')]({'where':{'UserId':_0x5242dc['id'],'FaxQueueId':_0x58db1b['params']['id']},'transaction':_0x52c192});});})[_0xfd9e('0x15')](function(){_0x13dcf4[_0xfd9e('0x58')](function(_0x562bc4){socket[_0xfd9e('0x59')]('userFaxQueue:save',{'UserId':_0x562bc4['id'],'FaxQueueId':_0x22756a['id']});});});});});}})[_0xfd9e('0x15')](respondWithStatusCode(_0x4b574b,null))[_0xfd9e('0x2e')](handleError(_0x4b574b,null));};exports[_0xfd9e('0x5a')]=function(_0x360bc9,_0x581fab){return db['Team'][_0xfd9e('0x45')]({'where':{'id':_0x360bc9[_0xfd9e('0x23')]['ids']},'attributes':['id'],'include':[{'model':db[_0xfd9e('0x46')],'as':_0xfd9e('0x52'),'attributes':['id'],'raw':!![]}]})[_0xfd9e('0x15')](handleEntityNotFound(_0x581fab,null))['then'](function(_0x4e2813){var _0x416ac7=_[_0xfd9e('0x1e')](_0x4e2813,'id');var _0x229435=[];var _0x52638f=[];var _0x26d105=squel[_0xfd9e('0x5b')]();_0x26d105[_0xfd9e('0x5c')](_0xfd9e('0x5d'))[_0xfd9e('0x5e')](_0xfd9e('0x5f'),'tq')['join'](_0xfd9e('0x60'),'ut',_0xfd9e('0x61'))[_0xfd9e('0x3f')](_0xfd9e('0x62'),_0x360bc9[_0xfd9e('0x26')]['id']);for(var _0xe7664d=0x0;_0xe7664d<_0x4e2813[_0xfd9e('0x3b')];_0xe7664d+=0x1){let _0x19bfba=_0x4e2813[_0xe7664d];for(var _0x11f497=0x0;_0x11f497<_0x19bfba['Agents'][_0xfd9e('0x3b')];_0x11f497+=0x1){let _0x11b4f7=_0x19bfba[_0xfd9e('0x52')][_0x11f497];var _0x19e49c=_0x26d105[_0xfd9e('0x63')]();_0x19e49c[_0xfd9e('0x3f')](_0xfd9e('0x64'),_0x11b4f7['id']);_0x52638f[_0xfd9e('0x65')](db['sequelize'][_0xfd9e('0x23')](_0x19e49c[_0xfd9e('0x66')](),{'type':db[_0xfd9e('0x55')]['QueryTypes'][_0xfd9e('0x67')]})[_0xfd9e('0x15')](function(_0xd82bb4){if(_0xd82bb4[_0xfd9e('0x3b')]===0x1){return _0x11b4f7['id'];}else{var _0x2d0e6f=_[_0xfd9e('0x68')](_[_0xfd9e('0x1e')](_0xd82bb4,_0xfd9e('0x69')),function(_0x4c368c){return _[_0xfd9e('0x6a')](_0x416ac7,_0x4c368c);});if(_0x2d0e6f){return _0x11b4f7['id'];}}}));}}return BPromise[_0xfd9e('0x6b')](_0x52638f)[_0xfd9e('0x15')](function(_0x4e95e4){_0x229435=_(_0x229435)['union'](_0x4e95e4)[_0xfd9e('0x6c')]()[_0xfd9e('0x6d')]();return db[_0xfd9e('0x1f')][_0xfd9e('0x2d')]({'where':{'id':_0x360bc9[_0xfd9e('0x26')]['id']}})[_0xfd9e('0x15')](function(_0x1a51b6){return db[_0xfd9e('0x55')]['transaction'](function(_0x51f36e){return _0x1a51b6[_0xfd9e('0x5a')](_0x360bc9[_0xfd9e('0x23')]['ids'],{'transaction':_0x51f36e})[_0xfd9e('0x15')](function(){if(!_[_0xfd9e('0x6e')](_0x229435)){return _0x1a51b6[_0xfd9e('0x6f')](_0x229435,{'transaction':_0x51f36e});}})['then'](function(){_0x229435['forEach'](function(_0x9b0057){socket['emit'](_0xfd9e('0x70'),{'UserId':_0x9b0057,'FaxQueueId':_0x1a51b6['id']});});});});});});})['then'](respondWithStatusCode(_0x581fab,null))[_0xfd9e('0x2e')](handleError(_0x581fab,null));};exports['addAgents']=function(_0x45cdc3,_0x25d6fe){return db[_0xfd9e('0x1f')][_0xfd9e('0x2d')]({'where':{'id':_0x45cdc3[_0xfd9e('0x26')]['id']}})[_0xfd9e('0x15')](handleEntityNotFound(_0x25d6fe,null))[_0xfd9e('0x15')](function(_0x51bb95){if(_0x51bb95){return _0x51bb95['addAgents'](_0x45cdc3[_0xfd9e('0x36')][_0xfd9e('0x71')],_[_0xfd9e('0x72')](_0x45cdc3[_0xfd9e('0x36')],[_0xfd9e('0x71'),'id'])||{})[_0xfd9e('0x73')](function(_0x54a153){for(var _0x2a3f10=0x0;_0x2a3f10<_0x45cdc3[_0xfd9e('0x36')][_0xfd9e('0x71')][_0xfd9e('0x3b')];_0x2a3f10+=0x1){socket[_0xfd9e('0x59')](_0xfd9e('0x74'),{'UserId':Number(_0x45cdc3[_0xfd9e('0x36')][_0xfd9e('0x71')][_0x2a3f10]),'FaxQueueId':Number(_0x45cdc3[_0xfd9e('0x26')]['id'])});}return _0x54a153;});}})[_0xfd9e('0x15')](respondWithResult(_0x25d6fe,null))[_0xfd9e('0x2e')](handleError(_0x25d6fe,null));};exports[_0xfd9e('0x6f')]=function(_0x6c911c,_0x1a421e){return db[_0xfd9e('0x1f')][_0xfd9e('0x2d')]({'where':{'id':_0x6c911c[_0xfd9e('0x26')]['id']}})[_0xfd9e('0x15')](handleEntityNotFound(_0x1a421e,null))[_0xfd9e('0x15')](function(_0x1a1684){if(_0x1a1684){return _0x1a1684[_0xfd9e('0x6f')](_0x6c911c[_0xfd9e('0x23')][_0xfd9e('0x71')])[_0xfd9e('0x15')](function(){if(_[_0xfd9e('0x75')](_0x6c911c[_0xfd9e('0x23')][_0xfd9e('0x71')])){for(var _0x425e17=0x0;_0x425e17<_0x6c911c[_0xfd9e('0x23')][_0xfd9e('0x71')][_0xfd9e('0x3b')];_0x425e17+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x6c911c[_0xfd9e('0x23')][_0xfd9e('0x71')][_0x425e17]),'FaxQueueId':Number(_0x6c911c[_0xfd9e('0x26')]['id'])});}}else{socket[_0xfd9e('0x59')](_0xfd9e('0x70'),{'UserId':Number(_0x6c911c[_0xfd9e('0x23')]['ids']),'FaxQueueId':Number(_0x6c911c[_0xfd9e('0x26')]['id'])});}});}})[_0xfd9e('0x15')](respondWithStatusCode(_0x1a421e,null))[_0xfd9e('0x2e')](handleError(_0x1a421e,null));};exports['getAgents']=function(_0x123a78,_0x2ff82e){var _0x47c1bd={};var _0x313aa6={};var _0x3c865a;var _0x81de0a;return db[_0xfd9e('0x1f')][_0xfd9e('0x38')]({'where':{'id':_0x123a78['params']['id']}})[_0xfd9e('0x15')](handleEntityNotFound(_0x2ff82e,null))['then'](function(_0x4db60f){if(_0x4db60f){_0x3c865a=_0x4db60f;_0x313aa6[_0xfd9e('0x27')]=_[_0xfd9e('0x28')](db[_0xfd9e('0x46')][_0xfd9e('0x20')]);_0x313aa6['query']=_[_0xfd9e('0x28')](_0x123a78[_0xfd9e('0x23')]);_0x313aa6[_0xfd9e('0x3a')]=_[_0xfd9e('0x29')](_0x313aa6[_0xfd9e('0x27')],_0x313aa6[_0xfd9e('0x23')]);_0x47c1bd[_0xfd9e('0x2a')]=_[_0xfd9e('0x29')](_0x313aa6[_0xfd9e('0x27')],qs[_0xfd9e('0x2b')](_0x123a78[_0xfd9e('0x23')]['fields']));_0x47c1bd['attributes']=_0x47c1bd[_0xfd9e('0x2a')]['length']?_0x47c1bd[_0xfd9e('0x2a')]:_0x313aa6[_0xfd9e('0x27')];_0x47c1bd[_0xfd9e('0x3d')]=qs[_0xfd9e('0x3e')](_0x123a78['query'][_0xfd9e('0x3e')]);_0x47c1bd[_0xfd9e('0x3f')]=qs['filters'](_[_0xfd9e('0x40')](_0x123a78[_0xfd9e('0x23')],_0x313aa6['filters']));if(_0x123a78['query'][_0xfd9e('0x43')]){_0x47c1bd[_0xfd9e('0x3f')]=_[_0xfd9e('0x42')](_0x47c1bd[_0xfd9e('0x3f')],{'$or':_[_0xfd9e('0x1e')](_0x47c1bd['attributes'],function(_0x3611b6){var _0xa1088c={};_0xa1088c[_0x3611b6]={'$like':'%'+_0x123a78[_0xfd9e('0x23')][_0xfd9e('0x43')]+'%'};return _0xa1088c;})});}_0x47c1bd=_[_0xfd9e('0x42')]({},_0x47c1bd,_0x123a78[_0xfd9e('0x44')]);return _0x3c865a[_0xfd9e('0x76')](_0x47c1bd);}})[_0xfd9e('0x15')](function(_0x476def){if(_0x476def){_0x81de0a=_0x476def['length'];if(!_0x123a78['query'][_0xfd9e('0x51')]('nolimit')){_0x47c1bd[_0xfd9e('0x10')]=qs[_0xfd9e('0x10')](_0x123a78[_0xfd9e('0x23')]['limit']);_0x47c1bd[_0xfd9e('0x12')]=qs[_0xfd9e('0x12')](_0x123a78['query'][_0xfd9e('0x12')]);}return _0x3c865a[_0xfd9e('0x76')](_0x47c1bd);}})[_0xfd9e('0x15')](function(_0x224066){if(_0x224066){return _0x224066?{'count':_0x81de0a,'rows':_0x224066}:null;}})[_0xfd9e('0x15')](respondWithResult(_0x2ff82e,null))['catch'](handleError(_0x2ff82e,null));}; \ No newline at end of file +var _0xcd05=['getAgents','bluebird','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','./faxQueue.socket','register','status','end','json','offset','undefined','limit','set','update','destroy','get','FaxQueues','UserProfileResource','then','sendStatus','error','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','where','count','include','query','rows','catch','show','model','keys','intersection','attributes','fields','length','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','order','sort','filters','pick','filter','merge','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','SIP','Team','getTeams','nolimit','addTeams','ids','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','Agents','select','field','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','QueryTypes','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','emit'];(function(_0x825d19,_0x4fe030){var _0x2e7502=function(_0x2f23d6){while(--_0x2f23d6){_0x825d19['push'](_0x825d19['shift']());}};_0x2e7502(++_0x4fe030);}(_0xcd05,0x163));var _0x5cd0=function(_0x4c2dfc,_0x4814c0){_0x4c2dfc=_0x4c2dfc-0x0;var _0xfd728d=_0xcd05[_0x4c2dfc];return _0xfd728d;};'use strict';var BPromise=require(_0x5cd0('0x0'));var util=require('util');var _=require('lodash');var squel=require('squel');var Redis=require(_0x5cd0('0x1'));var qs=require(_0x5cd0('0x2'));var logger=require(_0x5cd0('0x3'))(_0x5cd0('0x4'));var config=require('../../config/environment');var db=require(_0x5cd0('0x5'))['db'];config[_0x5cd0('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5cd0('0x7'))(new Redis(config[_0x5cd0('0x6')]));require(_0x5cd0('0x8'))[_0x5cd0('0x9')](socket);function respondWithStatusCode(_0x3c0593,_0x1036fa){_0x1036fa=_0x1036fa||0xcc;return function(_0x715c5c){if(_0x715c5c){return _0x3c0593['sendStatus'](_0x1036fa);}return _0x3c0593[_0x5cd0('0xa')](_0x1036fa)[_0x5cd0('0xb')]();};}function respondWithResult(_0x22f769,_0x368f0c){_0x368f0c=_0x368f0c||0xc8;return function(_0x512903){if(_0x512903){return _0x22f769[_0x5cd0('0xa')](_0x368f0c)[_0x5cd0('0xc')](_0x512903);}};}function respondWithFilteredResult(_0x447b29,_0x6d7fbe){return function(_0x601ac0){if(_0x601ac0){var _0x137948=typeof _0x6d7fbe[_0x5cd0('0xd')]===_0x5cd0('0xe')&&typeof _0x6d7fbe[_0x5cd0('0xf')]===_0x5cd0('0xe');var _0x504fc5=_0x601ac0['count'];var _0x51ec30=_0x137948?0x0:_0x6d7fbe[_0x5cd0('0xd')];var _0x426a68=_0x137948?_0x601ac0['count']:_0x6d7fbe[_0x5cd0('0xd')]+_0x6d7fbe['limit'];var _0x2991d2;if(_0x426a68>=_0x504fc5){_0x426a68=_0x504fc5;_0x2991d2=0xc8;}else{_0x2991d2=0xce;}_0x447b29[_0x5cd0('0xa')](_0x2991d2);return _0x447b29[_0x5cd0('0x10')]('Content-Range',_0x51ec30+'-'+_0x426a68+'/'+_0x504fc5)['json'](_0x601ac0);}return null;};}function saveUpdates(_0x489f62){return function(_0x1f84ef){if(_0x1f84ef){return _0x1f84ef[_0x5cd0('0x11')](_0x489f62)['then'](function(_0x57d81d){return _0x57d81d;});}return null;};}function removeEntity(_0x4b7dac){return function(_0x1847dd){if(_0x1847dd){return _0x1847dd[_0x5cd0('0x12')]()['then'](function(){var _0xe72db4=_0x1847dd[_0x5cd0('0x13')]({'plain':!![]});var _0x2b906d=_0x5cd0('0x14');return db[_0x5cd0('0x15')][_0x5cd0('0x12')]({'where':{'type':_0x2b906d,'resourceId':_0xe72db4['id']}})[_0x5cd0('0x16')](function(){return _0x1847dd;});})[_0x5cd0('0x16')](function(){_0x4b7dac[_0x5cd0('0xa')](0xcc)[_0x5cd0('0xb')]();});}};}function handleEntityNotFound(_0x3dd520){return function(_0x3fe03a){if(!_0x3fe03a){_0x3dd520[_0x5cd0('0x17')](0x194);}return _0x3fe03a;};}function handleError(_0x1fe052,_0x5c2bd9){_0x5c2bd9=_0x5c2bd9||0x1f4;return function(_0x4d111f){logger[_0x5cd0('0x18')](_0x4d111f['stack']);if(_0x4d111f[_0x5cd0('0x19')]){delete _0x4d111f[_0x5cd0('0x19')];}_0x1fe052[_0x5cd0('0xa')](_0x5c2bd9)[_0x5cd0('0x1a')](_0x4d111f);};}exports[_0x5cd0('0x1b')]=function(_0x2b8516,_0x1a4d1c){var _0x5385db={};var _0x4a1fa4={'count':0x0,'rows':[]};var _0x2cd387=_[_0x5cd0('0x1c')](db[_0x5cd0('0x1d')][_0x5cd0('0x1e')],function(_0x5bff8a){return{'name':_0x5bff8a[_0x5cd0('0x1f')],'type':_0x5bff8a[_0x5cd0('0x20')][_0x5cd0('0x21')]};});_0x5385db=qs['getOptions'](_0x2cd387,_0x2b8516);var _0x56d59a={'where':_0x5385db[_0x5cd0('0x22')]};return db[_0x5cd0('0x1d')]['count'](_0x56d59a)[_0x5cd0('0x16')](function(_0x4020d1){_0x4a1fa4[_0x5cd0('0x23')]=_0x4020d1;_0x5385db[_0x5cd0('0x24')]=qs[_0x5cd0('0x24')](_0x2b8516[_0x5cd0('0x25')]);return db[_0x5cd0('0x1d')]['findAll'](_0x5385db);})[_0x5cd0('0x16')](function(_0x1621f9){_0x4a1fa4[_0x5cd0('0x26')]=_0x1621f9;return _0x4a1fa4;})[_0x5cd0('0x16')](respondWithFilteredResult(_0x1a4d1c,_0x5385db))[_0x5cd0('0x27')](handleError(_0x1a4d1c,null));};exports[_0x5cd0('0x28')]=function(_0x190901,_0x2ed6c5){var _0x2e16b1={'raw':!![],'where':{'id':_0x190901['params']['id']}},_0x19b50e={};_0x19b50e[_0x5cd0('0x29')]=_[_0x5cd0('0x2a')](db['FaxQueue'][_0x5cd0('0x1e')]);_0x19b50e['query']=_[_0x5cd0('0x2a')](_0x190901[_0x5cd0('0x25')]);_0x19b50e['filters']=_[_0x5cd0('0x2b')](_0x19b50e['model'],_0x19b50e[_0x5cd0('0x25')]);_0x2e16b1[_0x5cd0('0x2c')]=_[_0x5cd0('0x2b')](_0x19b50e['model'],qs[_0x5cd0('0x2d')](_0x190901['query'][_0x5cd0('0x2d')]));_0x2e16b1[_0x5cd0('0x2c')]=_0x2e16b1['attributes'][_0x5cd0('0x2e')]?_0x2e16b1[_0x5cd0('0x2c')]:_0x19b50e[_0x5cd0('0x29')];if(_0x190901[_0x5cd0('0x25')][_0x5cd0('0x2f')]){_0x2e16b1['include']=[{'all':!![]}];}_0x2e16b1=_['merge']({},_0x2e16b1,_0x190901[_0x5cd0('0x30')]);return db[_0x5cd0('0x1d')]['find'](_0x2e16b1)[_0x5cd0('0x16')](handleEntityNotFound(_0x2ed6c5,null))[_0x5cd0('0x16')](respondWithResult(_0x2ed6c5,null))[_0x5cd0('0x27')](handleError(_0x2ed6c5,null));};exports[_0x5cd0('0x31')]=function(_0xcc93d2,_0x5f4d6b){return db[_0x5cd0('0x1d')][_0x5cd0('0x31')](_0xcc93d2[_0x5cd0('0x32')],{})[_0x5cd0('0x16')](function(_0x2cfe2e){var _0x144101=_0xcc93d2[_0x5cd0('0x33')][_0x5cd0('0x13')]({'plain':!![]});if(!_0x144101)throw new Error(_0x5cd0('0x34'));if(_0x144101[_0x5cd0('0x35')]===_0x5cd0('0x33')){var _0xd84453=_0x2cfe2e[_0x5cd0('0x13')]({'plain':!![]});var _0x271ebf='FaxQueues';return db['UserProfileSection'][_0x5cd0('0x36')]({'where':{'name':_0x271ebf,'userProfileId':_0x144101['userProfileId']},'raw':!![]})[_0x5cd0('0x16')](function(_0x55d99a){if(_0x55d99a&&_0x55d99a[_0x5cd0('0x37')]===0x0){return db[_0x5cd0('0x15')][_0x5cd0('0x31')]({'name':_0xd84453[_0x5cd0('0x19')],'resourceId':_0xd84453['id'],'type':_0x55d99a[_0x5cd0('0x19')],'sectionId':_0x55d99a['id']},{})['then'](function(){return _0x2cfe2e;});}else{return _0x2cfe2e;}})[_0x5cd0('0x27')](function(_0x5c7468){logger['error'](_0x5cd0('0x38'),_0x5c7468);throw _0x5c7468;});}return _0x2cfe2e;})[_0x5cd0('0x16')](respondWithResult(_0x5f4d6b,0xc9))[_0x5cd0('0x27')](handleError(_0x5f4d6b,null));};exports['update']=function(_0x31ca10,_0x5920c3){if(_0x31ca10[_0x5cd0('0x32')]['id']){delete _0x31ca10['body']['id'];}return db['FaxQueue'][_0x5cd0('0x36')]({'where':{'id':_0x31ca10[_0x5cd0('0x39')]['id']}})[_0x5cd0('0x16')](handleEntityNotFound(_0x5920c3,null))[_0x5cd0('0x16')](saveUpdates(_0x31ca10[_0x5cd0('0x32')],null))['then'](respondWithResult(_0x5920c3,null))[_0x5cd0('0x27')](handleError(_0x5920c3,null));};exports[_0x5cd0('0x12')]=function(_0x39b07c,_0x3eba22){return db['FaxQueue'][_0x5cd0('0x36')]({'where':{'id':_0x39b07c[_0x5cd0('0x39')]['id']}})[_0x5cd0('0x16')](handleEntityNotFound(_0x3eba22,null))[_0x5cd0('0x16')](removeEntity(_0x3eba22,null))[_0x5cd0('0x27')](handleError(_0x3eba22,null));};exports['describe']=function(_0x3a77c2,_0x12a678){return db[_0x5cd0('0x1d')][_0x5cd0('0x3a')]()[_0x5cd0('0x16')](respondWithResult(_0x12a678,null))['catch'](handleError(_0x12a678,null));};exports[_0x5cd0('0x3b')]=function(_0x199972,_0x585244){var _0x53b77a={'raw':!![],'where':{}},_0x7894b5={},_0x455792;return db[_0x5cd0('0x1d')][_0x5cd0('0x3c')]({'where':{'id':_0x199972[_0x5cd0('0x39')]['id']}})['then'](handleEntityNotFound(_0x585244,null))['then'](function(_0x46a90d){if(_0x46a90d){_0x455792=_0x46a90d[_0x5cd0('0x13')]({'plain':!![]});_0x7894b5[_0x5cd0('0x29')]=_['keys'](db[_0x5cd0('0x3d')]['rawAttributes']);_0x7894b5[_0x5cd0('0x25')]=_[_0x5cd0('0x2a')](_0x199972[_0x5cd0('0x25')]);_0x7894b5['filters']=_[_0x5cd0('0x2b')](_0x7894b5['model'],_0x7894b5[_0x5cd0('0x25')]);_0x53b77a[_0x5cd0('0x2c')]=_[_0x5cd0('0x2b')](_0x7894b5[_0x5cd0('0x29')],qs['fields'](_0x199972[_0x5cd0('0x25')]['fields']));_0x53b77a[_0x5cd0('0x2c')]=_0x53b77a[_0x5cd0('0x2c')][_0x5cd0('0x2e')]?_0x53b77a[_0x5cd0('0x2c')]:_0x7894b5['model'];if(!_0x199972[_0x5cd0('0x25')][_0x5cd0('0x3e')]('nolimit')){_0x53b77a['limit']=qs[_0x5cd0('0xf')](_0x199972[_0x5cd0('0x25')][_0x5cd0('0xf')]);_0x53b77a[_0x5cd0('0xd')]=qs['offset'](_0x199972[_0x5cd0('0x25')][_0x5cd0('0xd')]);}_0x53b77a[_0x5cd0('0x3f')]=qs[_0x5cd0('0x40')](_0x199972[_0x5cd0('0x25')][_0x5cd0('0x40')]);_0x53b77a[_0x5cd0('0x22')]=qs[_0x5cd0('0x41')](_[_0x5cd0('0x42')](_0x199972[_0x5cd0('0x25')],_0x7894b5['filters']));_0x53b77a[_0x5cd0('0x22')]['FaxQueueId']=_0x46a90d['id'];if(_0x199972[_0x5cd0('0x25')][_0x5cd0('0x43')]){_0x53b77a[_0x5cd0('0x22')]=_[_0x5cd0('0x44')](_0x53b77a[_0x5cd0('0x22')],{'$or':_['map'](_0x53b77a[_0x5cd0('0x2c')],function(_0x38fd14){var _0x4d4746={};_0x4d4746[_0x38fd14]={'$like':'%'+_0x199972[_0x5cd0('0x25')]['filter']+'%'};return _0x4d4746;})});}_0x53b77a=_[_0x5cd0('0x44')]({},_0x53b77a,_0x199972['options']);return db[_0x5cd0('0x3d')]['findAll'](_0x53b77a);}})[_0x5cd0('0x16')](function(_0xeb7597){if(_0xeb7597){return db[_0x5cd0('0x45')][_0x5cd0('0x46')]({'where':{'id':_['map'](_0xeb7597,_0x5cd0('0x47')),'role':_0x5cd0('0x48')},'attributes':['id',_0x5cd0('0x19'),_0x5cd0('0x49'),_0x5cd0('0x4a'),_0x5cd0('0x4b')]});}})[_0x5cd0('0x16')](function(_0x5c1e90){if(_0x5c1e90){return{'count':_0x5c1e90[_0x5cd0('0x23')],'rows':_[_0x5cd0('0x1c')](_0x5c1e90[_0x5cd0('0x26')],function(_0x211614){return{'membername':_0x211614[_0x5cd0('0x19')],'UserId':_0x211614['id'],'queue_name':_0x455792[_0x5cd0('0x19')],'FaxQueueId':_0x455792['id'],'interface':util[_0x5cd0('0x4c')]('%s/%s',_0x5cd0('0x4d'),_0x211614[_0x5cd0('0x19')]),'penalty':0x0,'paused':_0x211614[_0x5cd0('0x49')],'createdAt':_0x211614[_0x5cd0('0x4b')],'updatedAt':_0x211614[_0x5cd0('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5cd0('0x16')](respondWithFilteredResult(_0x585244,_0x53b77a))['catch'](handleError(_0x585244,null));};exports['getTeams']=function(_0x41ad33,_0x5d76da){var _0x422284={};var _0x56cdee={};var _0x460a9b;var _0x13f0cd;return db['FaxQueue'][_0x5cd0('0x3c')]({'where':{'id':_0x41ad33[_0x5cd0('0x39')]['id']}})[_0x5cd0('0x16')](handleEntityNotFound(_0x5d76da,null))['then'](function(_0x32ec47){if(_0x32ec47){_0x460a9b=_0x32ec47;_0x56cdee[_0x5cd0('0x29')]=_['keys'](db[_0x5cd0('0x4e')][_0x5cd0('0x1e')]);_0x56cdee[_0x5cd0('0x25')]=_[_0x5cd0('0x2a')](_0x41ad33[_0x5cd0('0x25')]);_0x56cdee[_0x5cd0('0x41')]=_[_0x5cd0('0x2b')](_0x56cdee[_0x5cd0('0x29')],_0x56cdee['query']);_0x422284[_0x5cd0('0x2c')]=_[_0x5cd0('0x2b')](_0x56cdee['model'],qs['fields'](_0x41ad33[_0x5cd0('0x25')][_0x5cd0('0x2d')]));_0x422284['attributes']=_0x422284[_0x5cd0('0x2c')][_0x5cd0('0x2e')]?_0x422284[_0x5cd0('0x2c')]:_0x56cdee[_0x5cd0('0x29')];_0x422284[_0x5cd0('0x3f')]=qs[_0x5cd0('0x40')](_0x41ad33[_0x5cd0('0x25')]['sort']);_0x422284[_0x5cd0('0x22')]=qs[_0x5cd0('0x41')](_[_0x5cd0('0x42')](_0x41ad33['query'],_0x56cdee[_0x5cd0('0x41')]));if(_0x41ad33[_0x5cd0('0x25')][_0x5cd0('0x43')]){_0x422284[_0x5cd0('0x22')]=_[_0x5cd0('0x44')](_0x422284[_0x5cd0('0x22')],{'$or':_[_0x5cd0('0x1c')](_0x422284[_0x5cd0('0x2c')],function(_0x69880a){var _0x471f51={};_0x471f51[_0x69880a]={'$like':'%'+_0x41ad33[_0x5cd0('0x25')][_0x5cd0('0x43')]+'%'};return _0x471f51;})});}_0x422284=_[_0x5cd0('0x44')]({},_0x422284,_0x41ad33[_0x5cd0('0x30')]);return _0x460a9b[_0x5cd0('0x4f')](_0x422284);}})[_0x5cd0('0x16')](function(_0x16cda6){if(_0x16cda6){_0x13f0cd=_0x16cda6[_0x5cd0('0x2e')];if(!_0x41ad33[_0x5cd0('0x25')]['hasOwnProperty'](_0x5cd0('0x50'))){_0x422284['limit']=qs[_0x5cd0('0xf')](_0x41ad33[_0x5cd0('0x25')][_0x5cd0('0xf')]);_0x422284[_0x5cd0('0xd')]=qs['offset'](_0x41ad33['query']['offset']);}return _0x460a9b[_0x5cd0('0x4f')](_0x422284);}})[_0x5cd0('0x16')](function(_0x5bd974){if(_0x5bd974){return _0x5bd974?{'count':_0x13f0cd,'rows':_0x5bd974}:null;}})['then'](respondWithResult(_0x5d76da,null))[_0x5cd0('0x27')](handleError(_0x5d76da,null));};exports[_0x5cd0('0x51')]=function(_0x192d3f,_0x2a9c40){var _0x53ffa6=_0x192d3f[_0x5cd0('0x32')][_0x5cd0('0x52')];return db[_0x5cd0('0x4e')]['findAll']({'where':{'id':_0x53ffa6},'attributes':['id'],'include':[{'model':db[_0x5cd0('0x45')],'as':'Agents','attributes':['id','name',_0x5cd0('0x53'),_0x5cd0('0x54'),_0x5cd0('0x55')],'raw':!![]}]})['then'](function(_0x29644b){if(_0x29644b){var _0xa94b48=_[_0x5cd0('0x56')](_0x29644b,function(_0x156b8e){var _0x271b6c=_0x156b8e[_0x5cd0('0x13')]({'plain':!![]});return _0x271b6c['Agents'];});return db[_0x5cd0('0x1d')][_0x5cd0('0x36')]({'where':{'id':_0x192d3f[_0x5cd0('0x39')]['id']}})[_0x5cd0('0x16')](function(_0x43f971){return db[_0x5cd0('0x57')][_0x5cd0('0x58')](function(_0x47e6fb){return _0x43f971[_0x5cd0('0x51')](_0x53ffa6,{'transaction':_0x47e6fb})['then'](function(){return BPromise[_0x5cd0('0x59')](_0xa94b48,function(_0x3f9944){return db[_0x5cd0('0x3d')][_0x5cd0('0x5a')]({'where':{'UserId':_0x3f9944['id'],'FaxQueueId':_0x192d3f[_0x5cd0('0x39')]['id']},'transaction':_0x47e6fb});});})[_0x5cd0('0x16')](function(){_0xa94b48[_0x5cd0('0x5b')](function(_0x2a9b69){socket['emit'](_0x5cd0('0x5c'),{'UserId':_0x2a9b69['id'],'FaxQueueId':_0x43f971['id']});});});});});}})[_0x5cd0('0x16')](respondWithStatusCode(_0x2a9c40,null))['catch'](handleError(_0x2a9c40,null));};exports['removeTeams']=function(_0x56a67e,_0x16550d){return db[_0x5cd0('0x4e')]['findAll']({'where':{'id':_0x56a67e['query'][_0x5cd0('0x52')]},'attributes':['id'],'include':[{'model':db[_0x5cd0('0x45')],'as':_0x5cd0('0x5d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x16550d,null))[_0x5cd0('0x16')](function(_0x5a0b84){var _0x3ba892=_['map'](_0x5a0b84,'id');var _0x4416c9=[];var _0x1f1ee5=[];var _0x1955b2=squel[_0x5cd0('0x5e')]();_0x1955b2[_0x5cd0('0x5f')]('tq.TeamId')[_0x5cd0('0x60')](_0x5cd0('0x61'),'tq')[_0x5cd0('0x62')]('user_has_teams','ut',_0x5cd0('0x63'))[_0x5cd0('0x22')](_0x5cd0('0x64'),_0x56a67e[_0x5cd0('0x39')]['id']);for(var _0x458c52=0x0;_0x458c52<_0x5a0b84['length'];_0x458c52+=0x1){let _0x4b1b41=_0x5a0b84[_0x458c52];for(var _0x4b516e=0x0;_0x4b516e<_0x4b1b41[_0x5cd0('0x5d')][_0x5cd0('0x2e')];_0x4b516e+=0x1){let _0x4d8701=_0x4b1b41['Agents'][_0x4b516e];var _0x3c798d=_0x1955b2[_0x5cd0('0x65')]();_0x3c798d['where']('ut.UserId\x20=\x20?',_0x4d8701['id']);_0x1f1ee5[_0x5cd0('0x66')](db[_0x5cd0('0x57')]['query'](_0x3c798d['toString'](),{'type':db[_0x5cd0('0x57')][_0x5cd0('0x67')]['SELECT']})[_0x5cd0('0x16')](function(_0x322551){if(_0x322551[_0x5cd0('0x2e')]===0x1){return _0x4d8701['id'];}else{var _0x4b6be8=_['every'](_[_0x5cd0('0x1c')](_0x322551,'TeamId'),function(_0x26d740){return _[_0x5cd0('0x68')](_0x3ba892,_0x26d740);});if(_0x4b6be8){return _0x4d8701['id'];}}}));}}return BPromise[_0x5cd0('0x69')](_0x1f1ee5)[_0x5cd0('0x16')](function(_0x12973b){_0x4416c9=_(_0x4416c9)[_0x5cd0('0x6a')](_0x12973b)[_0x5cd0('0x6b')]()[_0x5cd0('0x6c')]();return db['FaxQueue'][_0x5cd0('0x36')]({'where':{'id':_0x56a67e[_0x5cd0('0x39')]['id']}})[_0x5cd0('0x16')](function(_0x5c8674){return db[_0x5cd0('0x57')][_0x5cd0('0x58')](function(_0x1c10c6){return _0x5c8674[_0x5cd0('0x6d')](_0x56a67e[_0x5cd0('0x25')]['ids'],{'transaction':_0x1c10c6})[_0x5cd0('0x16')](function(){if(!_[_0x5cd0('0x6e')](_0x4416c9)){return _0x5c8674[_0x5cd0('0x6f')](_0x4416c9,{'transaction':_0x1c10c6});}})['then'](function(){_0x4416c9[_0x5cd0('0x5b')](function(_0x3b899c){socket['emit'](_0x5cd0('0x70'),{'UserId':_0x3b899c,'FaxQueueId':_0x5c8674['id']});});});});});});})['then'](respondWithStatusCode(_0x16550d,null))['catch'](handleError(_0x16550d,null));};exports[_0x5cd0('0x71')]=function(_0x3419b4,_0x10b506){return db['FaxQueue'][_0x5cd0('0x36')]({'where':{'id':_0x3419b4[_0x5cd0('0x39')]['id']}})['then'](handleEntityNotFound(_0x10b506,null))[_0x5cd0('0x16')](function(_0x174d68){if(_0x174d68){return _0x174d68[_0x5cd0('0x71')](_0x3419b4[_0x5cd0('0x32')]['ids'],_[_0x5cd0('0x72')](_0x3419b4[_0x5cd0('0x32')],[_0x5cd0('0x52'),'id'])||{})[_0x5cd0('0x73')](function(_0x4dc62d){for(var _0x45ddb6=0x0;_0x45ddb6<_0x3419b4[_0x5cd0('0x32')]['ids'][_0x5cd0('0x2e')];_0x45ddb6+=0x1){socket[_0x5cd0('0x74')](_0x5cd0('0x5c'),{'UserId':Number(_0x3419b4[_0x5cd0('0x32')]['ids'][_0x45ddb6]),'FaxQueueId':Number(_0x3419b4[_0x5cd0('0x39')]['id'])});}return _0x4dc62d;});}})[_0x5cd0('0x16')](respondWithResult(_0x10b506,null))[_0x5cd0('0x27')](handleError(_0x10b506,null));};exports[_0x5cd0('0x6f')]=function(_0x3126bb,_0x36ca4d){return db['FaxQueue'][_0x5cd0('0x36')]({'where':{'id':_0x3126bb['params']['id']}})['then'](handleEntityNotFound(_0x36ca4d,null))[_0x5cd0('0x16')](function(_0x5a5353){if(_0x5a5353){return _0x5a5353[_0x5cd0('0x6f')](_0x3126bb[_0x5cd0('0x25')][_0x5cd0('0x52')])[_0x5cd0('0x16')](function(){if(_['isArray'](_0x3126bb[_0x5cd0('0x25')][_0x5cd0('0x52')])){for(var _0x38dc20=0x0;_0x38dc20<_0x3126bb[_0x5cd0('0x25')][_0x5cd0('0x52')][_0x5cd0('0x2e')];_0x38dc20+=0x1){socket[_0x5cd0('0x74')](_0x5cd0('0x70'),{'UserId':Number(_0x3126bb['query'][_0x5cd0('0x52')][_0x38dc20]),'FaxQueueId':Number(_0x3126bb['params']['id'])});}}else{socket[_0x5cd0('0x74')]('userFaxQueue:remove',{'UserId':Number(_0x3126bb[_0x5cd0('0x25')][_0x5cd0('0x52')]),'FaxQueueId':Number(_0x3126bb[_0x5cd0('0x39')]['id'])});}});}})[_0x5cd0('0x16')](respondWithStatusCode(_0x36ca4d,null))['catch'](handleError(_0x36ca4d,null));};exports['getAgents']=function(_0x590650,_0xaabd19){var _0x1bf94c={};var _0x252dfa={};var _0x1fe1ae;var _0x2e76dc;return db[_0x5cd0('0x1d')][_0x5cd0('0x3c')]({'where':{'id':_0x590650[_0x5cd0('0x39')]['id']}})['then'](handleEntityNotFound(_0xaabd19,null))[_0x5cd0('0x16')](function(_0x5dbaf1){if(_0x5dbaf1){_0x1fe1ae=_0x5dbaf1;_0x252dfa[_0x5cd0('0x29')]=_['keys'](db[_0x5cd0('0x45')][_0x5cd0('0x1e')]);_0x252dfa[_0x5cd0('0x25')]=_[_0x5cd0('0x2a')](_0x590650[_0x5cd0('0x25')]);_0x252dfa[_0x5cd0('0x41')]=_[_0x5cd0('0x2b')](_0x252dfa[_0x5cd0('0x29')],_0x252dfa[_0x5cd0('0x25')]);_0x1bf94c['attributes']=_[_0x5cd0('0x2b')](_0x252dfa[_0x5cd0('0x29')],qs[_0x5cd0('0x2d')](_0x590650[_0x5cd0('0x25')][_0x5cd0('0x2d')]));_0x1bf94c[_0x5cd0('0x2c')]=_0x1bf94c[_0x5cd0('0x2c')]['length']?_0x1bf94c[_0x5cd0('0x2c')]:_0x252dfa[_0x5cd0('0x29')];_0x1bf94c[_0x5cd0('0x3f')]=qs[_0x5cd0('0x40')](_0x590650[_0x5cd0('0x25')]['sort']);_0x1bf94c['where']=qs[_0x5cd0('0x41')](_['pick'](_0x590650[_0x5cd0('0x25')],_0x252dfa['filters']));if(_0x590650[_0x5cd0('0x25')][_0x5cd0('0x43')]){_0x1bf94c[_0x5cd0('0x22')]=_[_0x5cd0('0x44')](_0x1bf94c[_0x5cd0('0x22')],{'$or':_['map'](_0x1bf94c[_0x5cd0('0x2c')],function(_0x1e2877){var _0x4b7ea8={};_0x4b7ea8[_0x1e2877]={'$like':'%'+_0x590650[_0x5cd0('0x25')]['filter']+'%'};return _0x4b7ea8;})});}_0x1bf94c=_[_0x5cd0('0x44')]({},_0x1bf94c,_0x590650['options']);return _0x1fe1ae[_0x5cd0('0x75')](_0x1bf94c);}})['then'](function(_0x5bddac){if(_0x5bddac){_0x2e76dc=_0x5bddac[_0x5cd0('0x2e')];if(!_0x590650[_0x5cd0('0x25')][_0x5cd0('0x3e')](_0x5cd0('0x50'))){_0x1bf94c[_0x5cd0('0xf')]=qs[_0x5cd0('0xf')](_0x590650[_0x5cd0('0x25')][_0x5cd0('0xf')]);_0x1bf94c[_0x5cd0('0xd')]=qs['offset'](_0x590650[_0x5cd0('0x25')]['offset']);}return _0x1fe1ae[_0x5cd0('0x75')](_0x1bf94c);}})[_0x5cd0('0x16')](function(_0x48d914){if(_0x48d914){return _0x48d914?{'count':_0x2e76dc,'rows':_0x48d914}:null;}})[_0x5cd0('0x16')](respondWithResult(_0xaabd19,null))[_0x5cd0('0x27')](handleError(_0xaabd19,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 408da3e..62c34d0 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 _0x4b29=['remove','emit','FaxQueue','save','update'];(function(_0x303c30,_0x16edcb){var _0x43161b=function(_0x3330ff){while(--_0x3330ff){_0x303c30['push'](_0x303c30['shift']());}};_0x43161b(++_0x16edcb);}(_0x4b29,0x1a6));var _0x94b2=function(_0x1cc613,_0x5ac93d){_0x1cc613=_0x1cc613-0x0;var _0x898088=_0x4b29[_0x1cc613];return _0x898088;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db'][_0x94b2('0x0')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x94b2('0x1'),'afterUpdate':_0x94b2('0x2'),'afterDestroy':_0x94b2('0x3')};function emitEvent(_0x3d2c36){return function(_0x550a58,_0xcb0097,_0x5f2339){FaxQueueEvents[_0x94b2('0x4')](_0x3d2c36+':'+_0x550a58['id'],_0x550a58);FaxQueueEvents[_0x94b2('0x4')](_0x3d2c36,_0x550a58);_0x5f2339(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x690e=['../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x690e,0x18f));var _0xe690=function(_0x2a326d,_0x232538){_0x2a326d=_0x2a326d-0x0;var _0x1d8ba4=_0x690e[_0x2a326d];return _0x1d8ba4;};'use strict';var EventEmitter=require(_0xe690('0x0'));var FaxQueue=require(_0xe690('0x1'))['db'][_0xe690('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe690('0x3')](0x0);var events={'afterCreate':_0xe690('0x4'),'afterUpdate':_0xe690('0x5'),'afterDestroy':_0xe690('0x6')};function emitEvent(_0x55ee14){return function(_0x38396d,_0x756d83,_0x23ebc3){FaxQueueEvents['emit'](_0x55ee14+':'+_0x38396d['id'],_0x38396d);FaxQueueEvents[_0xe690('0x7')](_0x55ee14,_0x38396d);_0x23ebc3(null);};}for(var e in events){if(events[_0xe690('0x8')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xe690('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 e3e35cc..eaf28d0 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 _0xe283=['path','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1e4bcf,_0x1f6c25){var _0x5016ef=function(_0x4adcff){while(--_0x4adcff){_0x1e4bcf['push'](_0x1e4bcf['shift']());}};_0x5016ef(++_0x1f6c25);}(_0xe283,0x1c2));var _0x3e28=function(_0x5756f8,_0x22b6d5){_0x5756f8=_0x5756f8-0x0;var _0x3bb749=_0xe283[_0x5756f8];return _0x3bb749;};'use strict';var _=require(_0x3e28('0x0'));var util=require('util');var logger=require(_0x3e28('0x1'))(_0x3e28('0x2'));var moment=require(_0x3e28('0x3'));var BPromise=require(_0x3e28('0x4'));var rp=require(_0x3e28('0x5'));var fs=require('fs');var path=require(_0x3e28('0x6'));var rimraf=require('rimraf');var config=require(_0x3e28('0x7'));var attributes=require(_0x3e28('0x8'));module[_0x3e28('0x9')]=function(_0x15e7e3,_0x2bba0a){return _0x15e7e3[_0x3e28('0xa')]('FaxQueue',attributes,{'tableName':_0x3e28('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce4f=['FaxQueue','fax_queues','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./faxQueue.attributes','define'];(function(_0x25e905,_0x42f080){var _0x4d1f16=function(_0x575f79){while(--_0x575f79){_0x25e905['push'](_0x25e905['shift']());}};_0x4d1f16(++_0x42f080);}(_0xce4f,0xbd));var _0xfce4=function(_0x3ccab7,_0x4a9120){_0x3ccab7=_0x3ccab7-0x0;var _0x405bb5=_0xce4f[_0x3ccab7];return _0x405bb5;};'use strict';var _=require(_0xfce4('0x0'));var util=require('util');var logger=require(_0xfce4('0x1'))('api');var moment=require(_0xfce4('0x2'));var BPromise=require(_0xfce4('0x3'));var rp=require(_0xfce4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfce4('0x5'));var config=require(_0xfce4('0x6'));var attributes=require(_0xfce4('0x7'));module['exports']=function(_0x4d25ad,_0x49a431){return _0x4d25ad[_0xfce4('0x8')](_0xfce4('0x9'),attributes,{'tableName':_0xfce4('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 3b256d4..a67541f 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 _0xbe51=['findAll','options','raw','where','attributes','limit','include','map','model','then','GetFaxQueue','ShowFaxQueue','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','defaults','redis','socket.io-emitter','register','request','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','info','request\x20sent','result','catch','FaxQueue'];(function(_0x9d192d,_0x2536da){var _0x3ef08b=function(_0x3ee3fc){while(--_0x3ee3fc){_0x9d192d['push'](_0x9d192d['shift']());}};_0x3ef08b(++_0x2536da);}(_0xbe51,0x162));var _0x1be5=function(_0x324c09,_0x4654bc){_0x324c09=_0x324c09-0x0;var _0xb2d51d=_0xbe51[_0x324c09];return _0xb2d51d;};'use strict';var _=require(_0x1be5('0x0'));var util=require(_0x1be5('0x1'));var moment=require('moment');var BPromise=require(_0x1be5('0x2'));var rs=require(_0x1be5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1be5('0x4'))['db'];var utils=require(_0x1be5('0x5'));var logger=require(_0x1be5('0x6'))(_0x1be5('0x7'));var config=require(_0x1be5('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x1be5('0x9')](config[_0x1be5('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1be5('0xb'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x1be5('0xc')](socket);function respondWithRpcPromise(_0x504bed,_0x6b59a7,_0x7f0a27){return new BPromise(function(_0x3aba4a,_0x3ff28c){return client[_0x1be5('0xd')](_0x504bed,_0x7f0a27)['then'](function(_0x32d1bf){logger['info']('FaxQueue,\x20%s,\x20%s',_0x6b59a7,'request\x20sent');logger[_0x1be5('0xe')](_0x1be5('0xf'),_0x6b59a7,'request\x20sent',JSON[_0x1be5('0x10')](_0x32d1bf));if(_0x32d1bf[_0x1be5('0x11')]){if(_0x32d1bf[_0x1be5('0x11')][_0x1be5('0x12')]===0x1f4){logger[_0x1be5('0x11')](_0x1be5('0x13'),_0x6b59a7,_0x32d1bf['error'][_0x1be5('0x14')]);return _0x3ff28c(_0x32d1bf[_0x1be5('0x11')][_0x1be5('0x14')]);}logger['error'](_0x1be5('0x13'),_0x6b59a7,_0x32d1bf[_0x1be5('0x11')]['message']);return _0x3aba4a(_0x32d1bf['error']['message']);}else{logger[_0x1be5('0x15')](_0x1be5('0x13'),_0x6b59a7,_0x1be5('0x16'));_0x3aba4a(_0x32d1bf[_0x1be5('0x17')][_0x1be5('0x14')]);}})[_0x1be5('0x18')](function(_0x3b96be){logger[_0x1be5('0x11')](_0x1be5('0x13'),_0x6b59a7,_0x3b96be);_0x3ff28c(_0x3b96be);});});}exports['GetFaxQueue']=function(_0x33b81b){var _0x16581d=this;return new Promise(function(_0x43c029,_0x5407c0){return db[_0x1be5('0x19')][_0x1be5('0x1a')]({'raw':_0x33b81b[_0x1be5('0x1b')]?_0x33b81b[_0x1be5('0x1b')][_0x1be5('0x1c')]===undefined?!![]:![]:!![],'where':_0x33b81b[_0x1be5('0x1b')]?_0x33b81b[_0x1be5('0x1b')][_0x1be5('0x1d')]||null:null,'attributes':_0x33b81b[_0x1be5('0x1b')]?_0x33b81b['options'][_0x1be5('0x1e')]||null:null,'limit':_0x33b81b['options']?_0x33b81b[_0x1be5('0x1b')][_0x1be5('0x1f')]||null:null,'include':_0x33b81b[_0x1be5('0x1b')]?_0x33b81b['options'][_0x1be5('0x20')]?_[_0x1be5('0x21')](_0x33b81b['options']['include'],function(_0x1870b7){return{'model':db[_0x1870b7[_0x1be5('0x22')]],'as':_0x1870b7['as'],'attributes':_0x1870b7[_0x1be5('0x1e')],'include':_0x1870b7[_0x1be5('0x20')]?_['map'](_0x1870b7['include'],function(_0x54c18e){return{'model':db[_0x54c18e['model']],'as':_0x54c18e['as'],'attributes':_0x54c18e['attributes'],'include':_0x54c18e[_0x1be5('0x20')]?_['map'](_0x54c18e[_0x1be5('0x20')],function(_0x1a8b4){return{'model':db[_0x1a8b4[_0x1be5('0x22')]],'as':_0x1a8b4['as'],'attributes':_0x1a8b4[_0x1be5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1be5('0x23')](function(_0x2574e9){logger[_0x1be5('0x15')](_0x1be5('0x24'),_0x33b81b);logger['debug'](_0x1be5('0x24'),_0x33b81b,JSON[_0x1be5('0x10')](_0x2574e9));_0x43c029(_0x2574e9);})[_0x1be5('0x18')](function(_0x2ffa28){logger[_0x1be5('0x11')](_0x1be5('0x24'),_0x2ffa28['message'],_0x33b81b);_0x5407c0(_0x16581d[_0x1be5('0x11')](0x1f4,_0x2ffa28[_0x1be5('0x14')]));});});};exports[_0x1be5('0x25')]=function(_0x2e291e){var _0x16369a=this;return new Promise(function(_0x2a6b78,_0x2d2c77){return db['FaxQueue']['find']({'raw':_0x2e291e[_0x1be5('0x1b')]?_0x2e291e['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e291e[_0x1be5('0x1b')]?_0x2e291e[_0x1be5('0x1b')]['where']||null:null,'attributes':_0x2e291e[_0x1be5('0x1b')]?_0x2e291e['options'][_0x1be5('0x1e')]||null:null,'include':_0x2e291e[_0x1be5('0x1b')]?_0x2e291e[_0x1be5('0x1b')][_0x1be5('0x20')]?_[_0x1be5('0x21')](_0x2e291e[_0x1be5('0x1b')]['include'],function(_0x45367c){return{'model':db[_0x45367c[_0x1be5('0x22')]],'as':_0x45367c['as'],'attributes':_0x45367c[_0x1be5('0x1e')],'include':_0x45367c[_0x1be5('0x20')]?_[_0x1be5('0x21')](_0x45367c['include'],function(_0x979386){return{'model':db[_0x979386[_0x1be5('0x22')]],'as':_0x979386['as'],'attributes':_0x979386['attributes'],'include':_0x979386[_0x1be5('0x20')]?_[_0x1be5('0x21')](_0x979386[_0x1be5('0x20')],function(_0x270fbf){return{'model':db[_0x270fbf[_0x1be5('0x22')]],'as':_0x270fbf['as'],'attributes':_0x270fbf['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x27e2c5){logger[_0x1be5('0x15')]('ShowFaxQueue',_0x2e291e);logger['debug'](_0x1be5('0x25'),_0x2e291e,JSON[_0x1be5('0x10')](_0x27e2c5));_0x2a6b78(_0x27e2c5);})[_0x1be5('0x18')](function(_0x4d6ef2){logger['error']('ShowFaxQueue',_0x4d6ef2['message'],_0x2e291e);_0x2d2c77(_0x16369a[_0x1be5('0x11')](0x1f4,_0x4d6ef2[_0x1be5('0x14')]));});});}; \ No newline at end of file +var _0xa2b4=['message','request\x20sent','catch','GetFaxQueue','options','raw','where','attributes','limit','map','include','model','ShowFaxQueue','FaxQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./faxQueue.socket','register','then','info','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','FaxQueue,\x20%s,\x20%s'];(function(_0x30e3d7,_0xd64140){var _0x427871=function(_0x55fa2c){while(--_0x55fa2c){_0x30e3d7['push'](_0x30e3d7['shift']());}};_0x427871(++_0xd64140);}(_0xa2b4,0xab));var _0x4a2b=function(_0x4c33ad,_0x24947d){_0x4c33ad=_0x4c33ad-0x0;var _0x220cba=_0xa2b4[_0x4c33ad];return _0x220cba;};'use strict';var _=require(_0x4a2b('0x0'));var util=require(_0x4a2b('0x1'));var moment=require(_0x4a2b('0x2'));var BPromise=require(_0x4a2b('0x3'));var rs=require(_0x4a2b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a2b('0x5'))['db'];var utils=require(_0x4a2b('0x6'));var logger=require(_0x4a2b('0x7'))('rpc');var config=require(_0x4a2b('0x8'));var jayson=require(_0x4a2b('0x9'));var client=jayson[_0x4a2b('0xa')][_0x4a2b('0xb')]({'port':0x232a});config['redis']=_[_0x4a2b('0xc')](config[_0x4a2b('0xd')],{'host':_0x4a2b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4a2b('0xf'))[_0x4a2b('0x10')](socket);function respondWithRpcPromise(_0x38e0ee,_0x4428e8,_0x326f71){return new BPromise(function(_0x1e81cf,_0x5f5946){return client['request'](_0x38e0ee,_0x326f71)[_0x4a2b('0x11')](function(_0x3c5171){logger[_0x4a2b('0x12')]('FaxQueue,\x20%s,\x20%s',_0x4428e8,'request\x20sent');logger[_0x4a2b('0x13')](_0x4a2b('0x14'),_0x4428e8,'request\x20sent',JSON[_0x4a2b('0x15')](_0x3c5171));if(_0x3c5171[_0x4a2b('0x16')]){if(_0x3c5171[_0x4a2b('0x16')]['code']===0x1f4){logger[_0x4a2b('0x16')](_0x4a2b('0x17'),_0x4428e8,_0x3c5171['error'][_0x4a2b('0x18')]);return _0x5f5946(_0x3c5171[_0x4a2b('0x16')][_0x4a2b('0x18')]);}logger['error'](_0x4a2b('0x17'),_0x4428e8,_0x3c5171[_0x4a2b('0x16')][_0x4a2b('0x18')]);return _0x1e81cf(_0x3c5171['error']['message']);}else{logger[_0x4a2b('0x12')](_0x4a2b('0x17'),_0x4428e8,_0x4a2b('0x19'));_0x1e81cf(_0x3c5171['result'][_0x4a2b('0x18')]);}})[_0x4a2b('0x1a')](function(_0x5cc8c0){logger[_0x4a2b('0x16')](_0x4a2b('0x17'),_0x4428e8,_0x5cc8c0);_0x5f5946(_0x5cc8c0);});});}exports[_0x4a2b('0x1b')]=function(_0x5758f4){var _0x27b633=this;return new Promise(function(_0x21f143,_0x3adcbe){return db['FaxQueue']['findAll']({'raw':_0x5758f4[_0x4a2b('0x1c')]?_0x5758f4['options'][_0x4a2b('0x1d')]===undefined?!![]:![]:!![],'where':_0x5758f4[_0x4a2b('0x1c')]?_0x5758f4[_0x4a2b('0x1c')][_0x4a2b('0x1e')]||null:null,'attributes':_0x5758f4[_0x4a2b('0x1c')]?_0x5758f4[_0x4a2b('0x1c')][_0x4a2b('0x1f')]||null:null,'limit':_0x5758f4[_0x4a2b('0x1c')]?_0x5758f4['options'][_0x4a2b('0x20')]||null:null,'include':_0x5758f4[_0x4a2b('0x1c')]?_0x5758f4['options']['include']?_[_0x4a2b('0x21')](_0x5758f4[_0x4a2b('0x1c')][_0x4a2b('0x22')],function(_0x24f275){return{'model':db[_0x24f275[_0x4a2b('0x23')]],'as':_0x24f275['as'],'attributes':_0x24f275[_0x4a2b('0x1f')],'include':_0x24f275[_0x4a2b('0x22')]?_[_0x4a2b('0x21')](_0x24f275['include'],function(_0x17f0bc){return{'model':db[_0x17f0bc[_0x4a2b('0x23')]],'as':_0x17f0bc['as'],'attributes':_0x17f0bc[_0x4a2b('0x1f')],'include':_0x17f0bc[_0x4a2b('0x22')]?_[_0x4a2b('0x21')](_0x17f0bc[_0x4a2b('0x22')],function(_0x125654){return{'model':db[_0x125654[_0x4a2b('0x23')]],'as':_0x125654['as'],'attributes':_0x125654[_0x4a2b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4a2b('0x11')](function(_0x39690a){logger[_0x4a2b('0x12')]('GetFaxQueue',_0x5758f4);logger[_0x4a2b('0x13')](_0x4a2b('0x1b'),_0x5758f4,JSON[_0x4a2b('0x15')](_0x39690a));_0x21f143(_0x39690a);})[_0x4a2b('0x1a')](function(_0x3d7fa7){logger['error'](_0x4a2b('0x1b'),_0x3d7fa7[_0x4a2b('0x18')],_0x5758f4);_0x3adcbe(_0x27b633['error'](0x1f4,_0x3d7fa7['message']));});});};exports[_0x4a2b('0x24')]=function(_0xf49a5){var _0x5bec2b=this;return new Promise(function(_0x549990,_0xde73cd){return db[_0x4a2b('0x25')][_0x4a2b('0x26')]({'raw':_0xf49a5[_0x4a2b('0x1c')]?_0xf49a5[_0x4a2b('0x1c')][_0x4a2b('0x1d')]===undefined?!![]:![]:!![],'where':_0xf49a5['options']?_0xf49a5[_0x4a2b('0x1c')][_0x4a2b('0x1e')]||null:null,'attributes':_0xf49a5['options']?_0xf49a5[_0x4a2b('0x1c')][_0x4a2b('0x1f')]||null:null,'include':_0xf49a5['options']?_0xf49a5['options'][_0x4a2b('0x22')]?_[_0x4a2b('0x21')](_0xf49a5[_0x4a2b('0x1c')][_0x4a2b('0x22')],function(_0x20ee09){return{'model':db[_0x20ee09[_0x4a2b('0x23')]],'as':_0x20ee09['as'],'attributes':_0x20ee09['attributes'],'include':_0x20ee09[_0x4a2b('0x22')]?_['map'](_0x20ee09[_0x4a2b('0x22')],function(_0x51fa7e){return{'model':db[_0x51fa7e['model']],'as':_0x51fa7e['as'],'attributes':_0x51fa7e[_0x4a2b('0x1f')],'include':_0x51fa7e[_0x4a2b('0x22')]?_[_0x4a2b('0x21')](_0x51fa7e[_0x4a2b('0x22')],function(_0x5f09c5){return{'model':db[_0x5f09c5[_0x4a2b('0x23')]],'as':_0x5f09c5['as'],'attributes':_0x5f09c5[_0x4a2b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4a2b('0x11')](function(_0x41848e){logger[_0x4a2b('0x12')](_0x4a2b('0x24'),_0xf49a5);logger[_0x4a2b('0x13')](_0x4a2b('0x24'),_0xf49a5,JSON[_0x4a2b('0x15')](_0x41848e));_0x549990(_0x41848e);})['catch'](function(_0x2391db){logger[_0x4a2b('0x16')](_0x4a2b('0x24'),_0x2391db[_0x4a2b('0x18')],_0xf49a5);_0xde73cd(_0x5bec2b[_0x4a2b('0x16')](0x1f4,_0x2391db[_0x4a2b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index d3263ef..bf86cc9 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 _0x9815=['emit','removeListener','register','length','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0xe3150,_0x455968){var _0x672d57=function(_0x4d8bb8){while(--_0x4d8bb8){_0xe3150['push'](_0xe3150['shift']());}};_0x672d57(++_0x455968);}(_0x9815,0x1d0));var _0x5981=function(_0x1786b8,_0x1d2882){_0x1786b8=_0x1786b8-0x0;var _0x520de6=_0x9815[_0x1786b8];return _0x520de6;};'use strict';var FaxQueueEvents=require(_0x5981('0x0'));var events=[_0x5981('0x1'),_0x5981('0x2'),_0x5981('0x3')];function createListener(_0x8f9c3f,_0x516973){return function(_0x388b14){_0x516973[_0x5981('0x4')](_0x8f9c3f,_0x388b14);};}function removeListener(_0x165748,_0x2f20ed){return function(){FaxQueueEvents[_0x5981('0x5')](_0x165748,_0x2f20ed);};}exports[_0x5981('0x6')]=function(_0x4281e8){for(var _0x3d2e0b=0x0,_0x3d4692=events[_0x5981('0x7')];_0x3d2e0b<_0x3d4692;_0x3d2e0b++){var _0x57b316=events[_0x3d2e0b];var _0x2af462=createListener(_0x5981('0x8')+_0x57b316,_0x4281e8);FaxQueueEvents['on'](_0x57b316,_0x2af462);}}; \ No newline at end of file +var _0xb8b2=['removeListener','length','faxQueue:','save','update','emit'];(function(_0x20830a,_0x501161){var _0x40d9a7=function(_0x208cdf){while(--_0x208cdf){_0x20830a['push'](_0x20830a['shift']());}};_0x40d9a7(++_0x501161);}(_0xb8b2,0x9f));var _0x2b8b=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xb8b2[_0x37c22c];return _0x119d79;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x2b8b('0x0'),'remove',_0x2b8b('0x1')];function createListener(_0x4d0426,_0x9202e3){return function(_0x2ab10b){_0x9202e3[_0x2b8b('0x2')](_0x4d0426,_0x2ab10b);};}function removeListener(_0x1ae5b8,_0x403536){return function(){FaxQueueEvents[_0x2b8b('0x3')](_0x1ae5b8,_0x403536);};}exports['register']=function(_0x5e5d1f){for(var _0x5a8eb3=0x0,_0x4f9c97=events[_0x2b8b('0x4')];_0x5a8eb3<_0x4f9c97;_0x5a8eb3++){var _0x2eea9b=events[_0x5a8eb3];var _0x1a7fd5=createListener(_0x2b8b('0x5')+_0x2eea9b,_0x5e5d1f);FaxQueueEvents['on'](_0x2eea9b,_0x1a7fd5);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 2f49b4d..50c6164 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 _0xfc46=['destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','/:id','update','delete'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xfc46,0x9a));var _0x6fc4=function(_0x5ebf44,_0x4e543e){_0x5ebf44=_0x5ebf44-0x0;var _0x2fef12=_0xfc46[_0x5ebf44];return _0x2fef12;};'use strict';var multer=require(_0x6fc4('0x0'));var util=require('util');var path=require(_0x6fc4('0x1'));var timeout=require(_0x6fc4('0x2'));var express=require(_0x6fc4('0x3'));var router=express['Router']();var fs_extra=require(_0x6fc4('0x4'));var auth=require(_0x6fc4('0x5'));var interaction=require(_0x6fc4('0x6'));var config=require(_0x6fc4('0x7'));var controller=require('./faxQueue.controller');router[_0x6fc4('0x8')]('/',auth[_0x6fc4('0x9')](),controller[_0x6fc4('0xa')]);router[_0x6fc4('0x8')](_0x6fc4('0xb'),auth[_0x6fc4('0x9')](),controller['describe']);router[_0x6fc4('0x8')]('/:id',auth[_0x6fc4('0x9')](),controller[_0x6fc4('0xc')]);router['get'](_0x6fc4('0xd'),auth[_0x6fc4('0x9')](),controller[_0x6fc4('0xe')]);router[_0x6fc4('0x8')](_0x6fc4('0xf'),auth[_0x6fc4('0x9')](),controller[_0x6fc4('0x10')]);router[_0x6fc4('0x8')](_0x6fc4('0x11'),auth[_0x6fc4('0x9')](),controller[_0x6fc4('0x12')]);router[_0x6fc4('0x13')]('/',auth[_0x6fc4('0x9')](),controller[_0x6fc4('0x14')]);router[_0x6fc4('0x13')](_0x6fc4('0xf'),auth[_0x6fc4('0x9')](),controller['addTeams']);router['post'](_0x6fc4('0x11'),auth[_0x6fc4('0x9')](),controller[_0x6fc4('0x15')]);router[_0x6fc4('0x16')](_0x6fc4('0x17'),auth[_0x6fc4('0x9')](),controller[_0x6fc4('0x18')]);router[_0x6fc4('0x19')](_0x6fc4('0x17'),auth['isAuthenticated'](),controller[_0x6fc4('0x1a')]);router[_0x6fc4('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0x6fc4('0x1b')]);router[_0x6fc4('0x19')]('/:id/users',auth[_0x6fc4('0x9')](),controller[_0x6fc4('0x1c')]);module[_0x6fc4('0x1d')]=router; \ No newline at end of file +var _0xaa3f=['getMembers','/:id/teams','getTeams','post','create','addTeams','/:id/users','addAgents','put','update','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x4ec26c,_0x486039){_0x4ec26c=_0x4ec26c-0x0;var _0x161637=_0xaa3f[_0x4ec26c];return _0x161637;};'use strict';var multer=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var path=require(_0xfaa3('0x2'));var timeout=require(_0xfaa3('0x3'));var express=require(_0xfaa3('0x4'));var router=express[_0xfaa3('0x5')]();var fs_extra=require(_0xfaa3('0x6'));var auth=require(_0xfaa3('0x7'));var interaction=require(_0xfaa3('0x8'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0xfaa3('0x9')]('/',auth['isAuthenticated'](),controller[_0xfaa3('0xa')]);router[_0xfaa3('0x9')](_0xfaa3('0xb'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0xd')]);router[_0xfaa3('0x9')](_0xfaa3('0xe'),auth['isAuthenticated'](),controller[_0xfaa3('0xf')]);router[_0xfaa3('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0xfaa3('0x10')]);router[_0xfaa3('0x9')](_0xfaa3('0x11'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x12')]);router[_0xfaa3('0x9')]('/:id/users',auth[_0xfaa3('0xc')](),controller['getAgents']);router[_0xfaa3('0x13')]('/',auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x14')]);router['post'](_0xfaa3('0x11'),auth['isAuthenticated'](),controller[_0xfaa3('0x15')]);router[_0xfaa3('0x13')](_0xfaa3('0x16'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x17')]);router[_0xfaa3('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xfaa3('0x19')]);router[_0xfaa3('0x1a')](_0xfaa3('0xe'),auth[_0xfaa3('0xc')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0xfaa3('0x1a')]('/:id/users',auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x1b')]);module[_0xfaa3('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 404669b..5ee94f6 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 _0xc497=['STRING','DATE','moment','exports'];(function(_0x43f620,_0x31d3d6){var _0x22c79b=function(_0x5f2781){while(--_0x5f2781){_0x43f620['push'](_0x43f620['shift']());}};_0x22c79b(++_0x31d3d6);}(_0xc497,0x7a));var _0x7c49=function(_0x5d4e04,_0x210313){_0x5d4e04=_0x5d4e04-0x0;var _0x95085b=_0xc497[_0x5d4e04];return _0x95085b;};'use strict';var moment=require(_0x7c49('0x0'));var Sequelize=require('sequelize');module[_0x7c49('0x1')]={'uniqueid':{'type':Sequelize[_0x7c49('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7c49('0x2')]},'joinAt':{'type':Sequelize[_0x7c49('0x3')]},'leaveAt':{'type':Sequelize[_0x7c49('0x3')]},'acceptAt':{'type':Sequelize[_0x7c49('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x33d8=['exports','STRING','DATE','sequelize'];(function(_0x3e45df,_0x45b5e7){var _0x5499de=function(_0x1bdff0){while(--_0x1bdff0){_0x3e45df['push'](_0x3e45df['shift']());}};_0x5499de(++_0x45b5e7);}(_0x33d8,0x1a7));var _0x833d=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x33d8[_0x68c979];return _0x4f0001;};'use strict';var moment=require('moment');var Sequelize=require(_0x833d('0x0'));module[_0x833d('0x1')]={'uniqueid':{'type':Sequelize[_0x833d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x833d('0x2')]},'joinAt':{'type':Sequelize[_0x833d('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x833d('0x3')]},'exitAt':{'type':Sequelize[_0x833d('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 27e8764..09e6864 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 _0xfc03=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FaxQueueReport','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','keys','rawAttributes','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x1be478,_0x2d5e05){var _0x5b43af=function(_0x55ab33){while(--_0x55ab33){_0x1be478['push'](_0x1be478['shift']());}};_0x5b43af(++_0x2d5e05);}(_0xfc03,0x16f));var _0x3fc0=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xfc03[_0x36884e];return _0x1cc367;};'use strict';var emlformat=require(_0x3fc0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fc0('0x1'));var jsonpatch=require(_0x3fc0('0x2'));var rp=require('request-promise');var moment=require(_0x3fc0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3fc0('0x4'));var util=require(_0x3fc0('0x5'));var path=require(_0x3fc0('0x6'));var sox=require(_0x3fc0('0x7'));var csv=require(_0x3fc0('0x8'));var ejs=require(_0x3fc0('0x9'));var fs=require('fs');var fs_extra=require(_0x3fc0('0xa'));var _=require(_0x3fc0('0xb'));var squel=require('squel');var crypto=require(_0x3fc0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3fc0('0xd'));var toCsv=require(_0x3fc0('0x8'));var querystring=require(_0x3fc0('0xe'));var Papa=require(_0x3fc0('0xf'));var Redis=require('ioredis');var authService=require(_0x3fc0('0x10'));var qs=require(_0x3fc0('0x11'));var as=require(_0x3fc0('0x12'));var hardwareService=require(_0x3fc0('0x13'));var logger=require(_0x3fc0('0x14'))('api');var utils=require(_0x3fc0('0x15'));var config=require(_0x3fc0('0x16'));var licenseUtil=require(_0x3fc0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1011b7,_0x582e22){_0x582e22=_0x582e22||0xcc;return function(_0x3a4cc0){if(_0x3a4cc0){return _0x1011b7[_0x3fc0('0x18')](_0x582e22);}return _0x1011b7['status'](_0x582e22)[_0x3fc0('0x19')]();};}function respondWithResult(_0x422926,_0x392c46){_0x392c46=_0x392c46||0xc8;return function(_0x4eb69a){if(_0x4eb69a){return _0x422926[_0x3fc0('0x1a')](_0x392c46)[_0x3fc0('0x1b')](_0x4eb69a);}};}function respondWithFilteredResult(_0x367ce1,_0x27619a){return function(_0x562ecc){if(_0x562ecc){var _0x277dbf=typeof _0x27619a[_0x3fc0('0x1c')]===_0x3fc0('0x1d')&&typeof _0x27619a['limit']===_0x3fc0('0x1d');var _0x491446=_0x562ecc[_0x3fc0('0x1e')];var _0x3c5026=_0x277dbf?0x0:_0x27619a['offset'];var _0x3bb388=_0x277dbf?_0x562ecc[_0x3fc0('0x1e')]:_0x27619a[_0x3fc0('0x1c')]+_0x27619a[_0x3fc0('0x1f')];var _0x1bd575;if(_0x3bb388>=_0x491446){_0x3bb388=_0x491446;_0x1bd575=0xc8;}else{_0x1bd575=0xce;}_0x367ce1[_0x3fc0('0x1a')](_0x1bd575);return _0x367ce1[_0x3fc0('0x20')](_0x3fc0('0x21'),_0x3c5026+'-'+_0x3bb388+'/'+_0x491446)[_0x3fc0('0x1b')](_0x562ecc);}return null;};}function patchUpdates(_0x5c859e){return function(_0xf13744){try{jsonpatch[_0x3fc0('0x22')](_0xf13744,_0x5c859e,!![]);}catch(_0x34ffa7){return BPromise[_0x3fc0('0x23')](_0x34ffa7);}return _0xf13744[_0x3fc0('0x24')]();};}function saveUpdates(_0x448293,_0x47c770){return function(_0x477674){if(_0x477674){return _0x477674[_0x3fc0('0x25')](_0x448293)[_0x3fc0('0x26')](function(_0x28fc65){return _0x28fc65;});}return null;};}function removeEntity(_0x46c213,_0x303dd2){return function(_0x2f423e){if(_0x2f423e){return _0x2f423e[_0x3fc0('0x27')]()[_0x3fc0('0x26')](function(){_0x46c213[_0x3fc0('0x1a')](0xcc)[_0x3fc0('0x19')]();});}};}function handleEntityNotFound(_0x1abe10,_0x784765){return function(_0xba1a23){if(!_0xba1a23){_0x1abe10[_0x3fc0('0x18')](0x194);}return _0xba1a23;};}function handleError(_0xbec5b5,_0x4f5111){_0x4f5111=_0x4f5111||0x1f4;return function(_0x365c8e){logger[_0x3fc0('0x28')](_0x365c8e[_0x3fc0('0x29')]);if(_0x365c8e[_0x3fc0('0x2a')]){delete _0x365c8e['name'];}_0xbec5b5[_0x3fc0('0x1a')](_0x4f5111)[_0x3fc0('0x2b')](_0x365c8e);};}exports[_0x3fc0('0x2c')]=function(_0x2645b4,_0x559fcc){var _0x1e4d99={},_0x1a2261={},_0x1960a4={'count':0x0,'rows':[]};var _0xac736c=_[_0x3fc0('0x2d')](db[_0x3fc0('0x2e')]['rawAttributes'],function(_0xd9ecae){return{'name':_0xd9ecae[_0x3fc0('0x2f')],'type':_0xd9ecae[_0x3fc0('0x30')][_0x3fc0('0x31')]};});_0x1a2261[_0x3fc0('0x32')]=_[_0x3fc0('0x2d')](_0xac736c,_0x3fc0('0x2a'));_0x1a2261[_0x3fc0('0x33')]=_['keys'](_0x2645b4['query']);_0x1a2261[_0x3fc0('0x34')]=_['intersection'](_0x1a2261[_0x3fc0('0x32')],_0x1a2261[_0x3fc0('0x33')]);_0x1e4d99[_0x3fc0('0x35')]=_[_0x3fc0('0x36')](_0x1a2261[_0x3fc0('0x32')],qs['fields'](_0x2645b4['query'][_0x3fc0('0x37')]));_0x1e4d99[_0x3fc0('0x35')]=_0x1e4d99[_0x3fc0('0x35')][_0x3fc0('0x38')]?_0x1e4d99[_0x3fc0('0x35')]:_0x1a2261['model'];if(!_0x2645b4[_0x3fc0('0x33')][_0x3fc0('0x39')](_0x3fc0('0x3a'))){_0x1e4d99['limit']=qs[_0x3fc0('0x1f')](_0x2645b4[_0x3fc0('0x33')][_0x3fc0('0x1f')]);_0x1e4d99[_0x3fc0('0x1c')]=qs['offset'](_0x2645b4[_0x3fc0('0x33')][_0x3fc0('0x1c')]);}_0x1e4d99['order']=qs[_0x3fc0('0x3b')](_0x2645b4['query'][_0x3fc0('0x3b')]);_0x1e4d99[_0x3fc0('0x3c')]=qs[_0x3fc0('0x34')](_[_0x3fc0('0x3d')](_0x2645b4[_0x3fc0('0x33')],_0x1a2261[_0x3fc0('0x34')]),_0xac736c);if(_0x2645b4[_0x3fc0('0x33')][_0x3fc0('0x3e')]){_0x1e4d99[_0x3fc0('0x3c')]=_[_0x3fc0('0x3f')](_0x1e4d99[_0x3fc0('0x3c')],{'$or':_['map'](_0xac736c,function(_0x6bbe04){if(_0x6bbe04[_0x3fc0('0x30')]!==_0x3fc0('0x40')){var _0x28b4d5={};_0x28b4d5[_0x6bbe04[_0x3fc0('0x2a')]]={'$like':'%'+_0x2645b4[_0x3fc0('0x33')]['filter']+'%'};return _0x28b4d5;}})});}_0x1e4d99=_['merge']({},_0x1e4d99,_0x2645b4[_0x3fc0('0x41')]);var _0x3386d2={'where':_0x1e4d99[_0x3fc0('0x3c')]};return db[_0x3fc0('0x2e')][_0x3fc0('0x1e')](_0x3386d2)['then'](function(_0x53b45e){_0x1960a4['count']=_0x53b45e;if(_0x2645b4[_0x3fc0('0x33')][_0x3fc0('0x42')]){_0x1e4d99[_0x3fc0('0x43')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0x1e4d99);})[_0x3fc0('0x26')](function(_0x239dc5){_0x1960a4[_0x3fc0('0x44')]=_0x239dc5;return _0x1960a4;})[_0x3fc0('0x26')](respondWithFilteredResult(_0x559fcc,_0x1e4d99))['catch'](handleError(_0x559fcc,null));};exports['show']=function(_0x17510a,_0x2a45dc){var _0x547670={'raw':!![],'where':{'id':_0x17510a['params']['id']}},_0x32768f={};_0x32768f[_0x3fc0('0x32')]=_[_0x3fc0('0x45')](db[_0x3fc0('0x2e')][_0x3fc0('0x46')]);_0x32768f[_0x3fc0('0x33')]=_[_0x3fc0('0x45')](_0x17510a[_0x3fc0('0x33')]);_0x32768f[_0x3fc0('0x34')]=_['intersection'](_0x32768f[_0x3fc0('0x32')],_0x32768f['query']);_0x547670[_0x3fc0('0x35')]=_[_0x3fc0('0x36')](_0x32768f[_0x3fc0('0x32')],qs[_0x3fc0('0x37')](_0x17510a[_0x3fc0('0x33')]['fields']));_0x547670[_0x3fc0('0x35')]=_0x547670[_0x3fc0('0x35')][_0x3fc0('0x38')]?_0x547670[_0x3fc0('0x35')]:_0x32768f['model'];if(_0x17510a[_0x3fc0('0x33')]['includeAll']){_0x547670[_0x3fc0('0x43')]=[{'all':!![]}];}_0x547670=_[_0x3fc0('0x3f')]({},_0x547670,_0x17510a[_0x3fc0('0x41')]);return db[_0x3fc0('0x2e')][_0x3fc0('0x47')](_0x547670)['then'](handleEntityNotFound(_0x2a45dc,null))[_0x3fc0('0x26')](respondWithResult(_0x2a45dc,null))[_0x3fc0('0x48')](handleError(_0x2a45dc,null));};exports[_0x3fc0('0x49')]=function(_0x4c4aed,_0x3df404){return db[_0x3fc0('0x2e')]['create'](_0x4c4aed[_0x3fc0('0x4a')],{})[_0x3fc0('0x26')](respondWithResult(_0x3df404,0xc9))[_0x3fc0('0x48')](handleError(_0x3df404,null));};exports['update']=function(_0x5e5c73,_0x3a35ac){if(_0x5e5c73[_0x3fc0('0x4a')]['id']){delete _0x5e5c73[_0x3fc0('0x4a')]['id'];}return db['FaxQueueReport'][_0x3fc0('0x47')]({'where':{'id':_0x5e5c73['params']['id']}})[_0x3fc0('0x26')](handleEntityNotFound(_0x3a35ac,null))['then'](saveUpdates(_0x5e5c73['body'],null))['then'](respondWithResult(_0x3a35ac,null))[_0x3fc0('0x48')](handleError(_0x3a35ac,null));};exports[_0x3fc0('0x27')]=function(_0x141b4c,_0x3730f5){return db[_0x3fc0('0x2e')][_0x3fc0('0x47')]({'where':{'id':_0x141b4c['params']['id']}})[_0x3fc0('0x26')](handleEntityNotFound(_0x3730f5,null))[_0x3fc0('0x26')](removeEntity(_0x3730f5,null))['catch'](handleError(_0x3730f5,null));};exports['describe']=function(_0x74ae6a,_0x12f93a){return db[_0x3fc0('0x2e')][_0x3fc0('0x4b')]()[_0x3fc0('0x26')](respondWithResult(_0x12f93a,null))[_0x3fc0('0x48')](handleError(_0x12f93a,null));}; \ No newline at end of file +var _0xd3d1=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','FaxQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x1bdfc1,_0x582e13){var _0x280501=function(_0x212e80){while(--_0x212e80){_0x1bdfc1['push'](_0x1bdfc1['shift']());}};_0x280501(++_0x582e13);}(_0xd3d1,0x172));var _0x1d3d=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xd3d1[_0x40220a];return _0x3903cc;};'use strict';var emlformat=require(_0x1d3d('0x0'));var rimraf=require(_0x1d3d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1d3d('0x2'));var moment=require(_0x1d3d('0x3'));var BPromise=require(_0x1d3d('0x4'));var Mustache=require(_0x1d3d('0x5'));var util=require(_0x1d3d('0x6'));var path=require(_0x1d3d('0x7'));var sox=require(_0x1d3d('0x8'));var csv=require(_0x1d3d('0x9'));var ejs=require(_0x1d3d('0xa'));var fs=require('fs');var fs_extra=require(_0x1d3d('0xb'));var _=require(_0x1d3d('0xc'));var squel=require(_0x1d3d('0xd'));var crypto=require(_0x1d3d('0xe'));var jsforce=require(_0x1d3d('0xf'));var deskjs=require(_0x1d3d('0x10'));var toCsv=require(_0x1d3d('0x9'));var querystring=require(_0x1d3d('0x11'));var Papa=require('papaparse');var Redis=require(_0x1d3d('0x12'));var authService=require(_0x1d3d('0x13'));var qs=require(_0x1d3d('0x14'));var as=require(_0x1d3d('0x15'));var hardwareService=require(_0x1d3d('0x16'));var logger=require(_0x1d3d('0x17'))(_0x1d3d('0x18'));var utils=require(_0x1d3d('0x19'));var config=require(_0x1d3d('0x1a'));var licenseUtil=require(_0x1d3d('0x1b'));var db=require(_0x1d3d('0x1c'))['db'];function respondWithStatusCode(_0x479216,_0xb587d){_0xb587d=_0xb587d||0xcc;return function(_0x2e375f){if(_0x2e375f){return _0x479216['sendStatus'](_0xb587d);}return _0x479216['status'](_0xb587d)[_0x1d3d('0x1d')]();};}function respondWithResult(_0x2f5b7f,_0x1a8035){_0x1a8035=_0x1a8035||0xc8;return function(_0x59b907){if(_0x59b907){return _0x2f5b7f[_0x1d3d('0x1e')](_0x1a8035)['json'](_0x59b907);}};}function respondWithFilteredResult(_0x1d54f3,_0x33e7d9){return function(_0x3491e4){if(_0x3491e4){var _0x24bb8c=typeof _0x33e7d9[_0x1d3d('0x1f')]===_0x1d3d('0x20')&&typeof _0x33e7d9[_0x1d3d('0x21')]==='undefined';var _0x5d3ac9=_0x3491e4[_0x1d3d('0x22')];var _0xe0a583=_0x24bb8c?0x0:_0x33e7d9['offset'];var _0x3b9174=_0x24bb8c?_0x3491e4['count']:_0x33e7d9[_0x1d3d('0x1f')]+_0x33e7d9[_0x1d3d('0x21')];var _0x2cd430;if(_0x3b9174>=_0x5d3ac9){_0x3b9174=_0x5d3ac9;_0x2cd430=0xc8;}else{_0x2cd430=0xce;}_0x1d54f3[_0x1d3d('0x1e')](_0x2cd430);return _0x1d54f3['set'](_0x1d3d('0x23'),_0xe0a583+'-'+_0x3b9174+'/'+_0x5d3ac9)['json'](_0x3491e4);}return null;};}function patchUpdates(_0x56c424){return function(_0x108005){try{jsonpatch[_0x1d3d('0x24')](_0x108005,_0x56c424,!![]);}catch(_0x43b14b){return BPromise[_0x1d3d('0x25')](_0x43b14b);}return _0x108005[_0x1d3d('0x26')]();};}function saveUpdates(_0xe4afa2,_0x471df5){return function(_0xa55c43){if(_0xa55c43){return _0xa55c43[_0x1d3d('0x27')](_0xe4afa2)[_0x1d3d('0x28')](function(_0x1610a6){return _0x1610a6;});}return null;};}function removeEntity(_0x502921,_0xfc3606){return function(_0x72868d){if(_0x72868d){return _0x72868d['destroy']()[_0x1d3d('0x28')](function(){_0x502921['status'](0xcc)[_0x1d3d('0x1d')]();});}};}function handleEntityNotFound(_0x20ae6d,_0x2bd023){return function(_0x4235fd){if(!_0x4235fd){_0x20ae6d[_0x1d3d('0x29')](0x194);}return _0x4235fd;};}function handleError(_0x16d032,_0x2b8074){_0x2b8074=_0x2b8074||0x1f4;return function(_0x298fd3){logger[_0x1d3d('0x2a')](_0x298fd3[_0x1d3d('0x2b')]);if(_0x298fd3[_0x1d3d('0x2c')]){delete _0x298fd3['name'];}_0x16d032[_0x1d3d('0x1e')](_0x2b8074)['send'](_0x298fd3);};}exports[_0x1d3d('0x2d')]=function(_0x2bcc2,_0x55c935){var _0x185913={},_0x16b7b3={},_0x3cb011={'count':0x0,'rows':[]};var _0x2a3812=_['map'](db[_0x1d3d('0x2e')][_0x1d3d('0x2f')],function(_0x5d1b6c){return{'name':_0x5d1b6c[_0x1d3d('0x30')],'type':_0x5d1b6c['type'][_0x1d3d('0x31')]};});_0x16b7b3[_0x1d3d('0x32')]=_['map'](_0x2a3812,_0x1d3d('0x2c'));_0x16b7b3[_0x1d3d('0x33')]=_[_0x1d3d('0x34')](_0x2bcc2[_0x1d3d('0x33')]);_0x16b7b3[_0x1d3d('0x35')]=_[_0x1d3d('0x36')](_0x16b7b3[_0x1d3d('0x32')],_0x16b7b3[_0x1d3d('0x33')]);_0x185913[_0x1d3d('0x37')]=_['intersection'](_0x16b7b3[_0x1d3d('0x32')],qs[_0x1d3d('0x38')](_0x2bcc2[_0x1d3d('0x33')][_0x1d3d('0x38')]));_0x185913['attributes']=_0x185913['attributes'][_0x1d3d('0x39')]?_0x185913[_0x1d3d('0x37')]:_0x16b7b3['model'];if(!_0x2bcc2[_0x1d3d('0x33')][_0x1d3d('0x3a')](_0x1d3d('0x3b'))){_0x185913[_0x1d3d('0x21')]=qs['limit'](_0x2bcc2['query'][_0x1d3d('0x21')]);_0x185913['offset']=qs[_0x1d3d('0x1f')](_0x2bcc2[_0x1d3d('0x33')][_0x1d3d('0x1f')]);}_0x185913[_0x1d3d('0x3c')]=qs[_0x1d3d('0x3d')](_0x2bcc2[_0x1d3d('0x33')][_0x1d3d('0x3d')]);_0x185913[_0x1d3d('0x3e')]=qs['filters'](_[_0x1d3d('0x3f')](_0x2bcc2['query'],_0x16b7b3[_0x1d3d('0x35')]),_0x2a3812);if(_0x2bcc2[_0x1d3d('0x33')]['filter']){_0x185913[_0x1d3d('0x3e')]=_[_0x1d3d('0x40')](_0x185913[_0x1d3d('0x3e')],{'$or':_[_0x1d3d('0x41')](_0x2a3812,function(_0x5c53c3){if(_0x5c53c3['type']!==_0x1d3d('0x42')){var _0x59502c={};_0x59502c[_0x5c53c3[_0x1d3d('0x2c')]]={'$like':'%'+_0x2bcc2[_0x1d3d('0x33')]['filter']+'%'};return _0x59502c;}})});}_0x185913=_[_0x1d3d('0x40')]({},_0x185913,_0x2bcc2[_0x1d3d('0x43')]);var _0x51be79={'where':_0x185913[_0x1d3d('0x3e')]};return db[_0x1d3d('0x2e')][_0x1d3d('0x22')](_0x51be79)[_0x1d3d('0x28')](function(_0x1fec46){_0x3cb011[_0x1d3d('0x22')]=_0x1fec46;if(_0x2bcc2['query'][_0x1d3d('0x44')]){_0x185913[_0x1d3d('0x45')]=[{'all':!![]}];}return db[_0x1d3d('0x2e')][_0x1d3d('0x46')](_0x185913);})[_0x1d3d('0x28')](function(_0x5f007e){_0x3cb011[_0x1d3d('0x47')]=_0x5f007e;return _0x3cb011;})[_0x1d3d('0x28')](respondWithFilteredResult(_0x55c935,_0x185913))[_0x1d3d('0x48')](handleError(_0x55c935,null));};exports[_0x1d3d('0x49')]=function(_0x5d0ab0,_0x3d1c0c){var _0x977ea8={'raw':!![],'where':{'id':_0x5d0ab0[_0x1d3d('0x4a')]['id']}},_0x1597fa={};_0x1597fa[_0x1d3d('0x32')]=_['keys'](db['FaxQueueReport'][_0x1d3d('0x2f')]);_0x1597fa[_0x1d3d('0x33')]=_[_0x1d3d('0x34')](_0x5d0ab0[_0x1d3d('0x33')]);_0x1597fa[_0x1d3d('0x35')]=_['intersection'](_0x1597fa[_0x1d3d('0x32')],_0x1597fa['query']);_0x977ea8[_0x1d3d('0x37')]=_[_0x1d3d('0x36')](_0x1597fa[_0x1d3d('0x32')],qs[_0x1d3d('0x38')](_0x5d0ab0['query'][_0x1d3d('0x38')]));_0x977ea8[_0x1d3d('0x37')]=_0x977ea8[_0x1d3d('0x37')][_0x1d3d('0x39')]?_0x977ea8[_0x1d3d('0x37')]:_0x1597fa[_0x1d3d('0x32')];if(_0x5d0ab0[_0x1d3d('0x33')]['includeAll']){_0x977ea8[_0x1d3d('0x45')]=[{'all':!![]}];}_0x977ea8=_['merge']({},_0x977ea8,_0x5d0ab0[_0x1d3d('0x43')]);return db[_0x1d3d('0x2e')]['find'](_0x977ea8)[_0x1d3d('0x28')](handleEntityNotFound(_0x3d1c0c,null))['then'](respondWithResult(_0x3d1c0c,null))[_0x1d3d('0x48')](handleError(_0x3d1c0c,null));};exports['create']=function(_0x17eded,_0xebd1f4){return db[_0x1d3d('0x2e')][_0x1d3d('0x4b')](_0x17eded[_0x1d3d('0x4c')],{})[_0x1d3d('0x28')](respondWithResult(_0xebd1f4,0xc9))[_0x1d3d('0x48')](handleError(_0xebd1f4,null));};exports[_0x1d3d('0x27')]=function(_0x59e88a,_0x5899cc){if(_0x59e88a['body']['id']){delete _0x59e88a[_0x1d3d('0x4c')]['id'];}return db[_0x1d3d('0x2e')][_0x1d3d('0x4d')]({'where':{'id':_0x59e88a[_0x1d3d('0x4a')]['id']}})[_0x1d3d('0x28')](handleEntityNotFound(_0x5899cc,null))[_0x1d3d('0x28')](saveUpdates(_0x59e88a['body'],null))['then'](respondWithResult(_0x5899cc,null))['catch'](handleError(_0x5899cc,null));};exports['destroy']=function(_0x3dc5ca,_0x21620d){return db[_0x1d3d('0x2e')][_0x1d3d('0x4d')]({'where':{'id':_0x3dc5ca[_0x1d3d('0x4a')]['id']}})[_0x1d3d('0x28')](handleEntityNotFound(_0x21620d,null))[_0x1d3d('0x28')](removeEntity(_0x21620d,null))[_0x1d3d('0x48')](handleError(_0x21620d,null));};exports[_0x1d3d('0x4e')]=function(_0x445cb0,_0xefc84c){return db[_0x1d3d('0x2e')][_0x1d3d('0x4e')]()[_0x1d3d('0x28')](respondWithResult(_0xefc84c,null))[_0x1d3d('0x48')](handleError(_0xefc84c,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 44f7b38..37a7d63 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 _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x3c26b9,_0x497e5b){var _0x237a7c=function(_0x253385){while(--_0x253385){_0x3c26b9['push'](_0x3c26b9['shift']());}};_0x237a7c(++_0x497e5b);}(_0x326f,0xd1));var _0xf326=function(_0xa33a4e,_0x29874f){_0xa33a4e=_0xa33a4e-0x0;var _0x37ebe9=_0x326f[_0xa33a4e];return _0x37ebe9;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0x36da4b,_0x295d13){var _0x17e26d=function(_0x2996a2){while(--_0x2996a2){_0x36da4b['push'](_0x36da4b['shift']());}};_0x17e26d(++_0x295d13);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x57645b,_0x25f73a){_0x57645b=_0x57645b-0x0;var _0xe82f00=_0x7fbe[_0x57645b];return _0xe82f00;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 19b363b..a31bde5 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 _0x07c9=['attributes','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateFaxQueueReport','create','options','raw','stringify','FaxQueueReport','update','body','where'];(function(_0x3ccdd9,_0x1be0c7){var _0x1dac23=function(_0xeddcc1){while(--_0xeddcc1){_0x3ccdd9['push'](_0x3ccdd9['shift']());}};_0x1dac23(++_0x1be0c7);}(_0x07c9,0x1b3));var _0x907c=function(_0x4317bb,_0x492787){_0x4317bb=_0x4317bb-0x0;var _0x4ecc57=_0x07c9[_0x4317bb];return _0x4ecc57;};'use strict';var _=require(_0x907c('0x0'));var util=require(_0x907c('0x1'));var moment=require(_0x907c('0x2'));var BPromise=require(_0x907c('0x3'));var rs=require(_0x907c('0x4'));var fs=require('fs');var Redis=require(_0x907c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x907c('0x6'));var logger=require(_0x907c('0x7'))(_0x907c('0x8'));var config=require(_0x907c('0x9'));var jayson=require(_0x907c('0xa'));var client=jayson[_0x907c('0xb')][_0x907c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40cde0,_0xf435b3,_0x4b4953){return new BPromise(function(_0x25540d,_0x48a9bb){return client[_0x907c('0xd')](_0x40cde0,_0x4b4953)[_0x907c('0xe')](function(_0x566558){logger[_0x907c('0xf')](_0x907c('0x10'),_0xf435b3,_0x907c('0x11'));logger[_0x907c('0x12')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0xf435b3,_0x907c('0x11'),JSON['stringify'](_0x566558));if(_0x566558[_0x907c('0x13')]){if(_0x566558['error'][_0x907c('0x14')]===0x1f4){logger[_0x907c('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0xf435b3,_0x566558[_0x907c('0x13')][_0x907c('0x15')]);return _0x48a9bb(_0x566558[_0x907c('0x13')][_0x907c('0x15')]);}logger[_0x907c('0x13')](_0x907c('0x10'),_0xf435b3,_0x566558[_0x907c('0x13')][_0x907c('0x15')]);return _0x25540d(_0x566558['error'][_0x907c('0x15')]);}else{logger[_0x907c('0xf')](_0x907c('0x10'),_0xf435b3,_0x907c('0x11'));_0x25540d(_0x566558[_0x907c('0x16')]['message']);}})[_0x907c('0x17')](function(_0x2debe0){logger[_0x907c('0x13')](_0x907c('0x10'),_0xf435b3,_0x2debe0);_0x48a9bb(_0x2debe0);});});}exports[_0x907c('0x18')]=function(_0x1779b1){var _0x8c583d=this;return new Promise(function(_0x4f03ee,_0x56ffbb){return db['FaxQueueReport'][_0x907c('0x19')](_0x1779b1['body'],{'raw':_0x1779b1[_0x907c('0x1a')]?_0x1779b1['options'][_0x907c('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0xdaf2fe){logger[_0x907c('0xf')](_0x907c('0x18'),_0x1779b1);logger[_0x907c('0x12')](_0x907c('0x18'),_0x1779b1,JSON[_0x907c('0x1c')](_0xdaf2fe));_0x4f03ee(_0xdaf2fe);})[_0x907c('0x17')](function(_0x5aae6b){logger[_0x907c('0x13')](_0x907c('0x18'),_0x5aae6b[_0x907c('0x15')],_0x1779b1);_0x56ffbb(_0x8c583d[_0x907c('0x13')](0x1f4,_0x5aae6b[_0x907c('0x15')]));});});};exports['UpdateFaxQueueReport']=function(_0x1eef9b){var _0x820d47=this;return new Promise(function(_0x20d913,_0x494909){return db[_0x907c('0x1d')][_0x907c('0x1e')](_0x1eef9b[_0x907c('0x1f')],{'raw':_0x1eef9b[_0x907c('0x1a')]?_0x1eef9b['options'][_0x907c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eef9b[_0x907c('0x1a')]?_0x1eef9b[_0x907c('0x1a')][_0x907c('0x20')]||null:null,'attributes':_0x1eef9b[_0x907c('0x1a')]?_0x1eef9b[_0x907c('0x1a')][_0x907c('0x21')]||null:null,'limit':_0x1eef9b[_0x907c('0x1a')]?_0x1eef9b[_0x907c('0x1a')][_0x907c('0x22')]||null:null})['then'](function(_0x328948){logger[_0x907c('0xf')]('UpdateFaxQueueReport',_0x1eef9b);logger[_0x907c('0x12')](_0x907c('0x23'),_0x1eef9b,JSON[_0x907c('0x1c')](_0x328948));_0x20d913(_0x328948);})[_0x907c('0x17')](function(_0x421fb7){logger[_0x907c('0x13')](_0x907c('0x23'),_0x421fb7['message'],_0x1eef9b);_0x494909(_0x820d47[_0x907c('0x13')](0x1f4,_0x421fb7[_0x907c('0x15')]));});});}; \ No newline at end of file +var _0x6295=['http','request','then','FaxQueueReport,\x20%s,\x20%s','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','create','body','options','raw','CreateFaxQueueReport','debug','stringify','update','attributes','limit','UpdateFaxQueueReport','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x38d736,_0x285075){var _0x4df813=function(_0x2ddf71){while(--_0x2ddf71){_0x38d736['push'](_0x38d736['shift']());}};_0x4df813(++_0x285075);}(_0x6295,0x1ba));var _0x5629=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x6295[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x5629('0x0'));var util=require(_0x5629('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5629('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5629('0x3'))['db'];var utils=require(_0x5629('0x4'));var logger=require(_0x5629('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5629('0x6'));var client=jayson[_0x5629('0x7')][_0x5629('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39bba4,_0x116185,_0x4b0768){return new BPromise(function(_0x527b84,_0xc2bbf9){return client[_0x5629('0x9')](_0x39bba4,_0x4b0768)[_0x5629('0xa')](function(_0x1dd481){logger['info'](_0x5629('0xb'),_0x116185,'request\x20sent');logger['debug'](_0x5629('0xc'),_0x116185,_0x5629('0xd'),JSON['stringify'](_0x1dd481));if(_0x1dd481[_0x5629('0xe')]){if(_0x1dd481[_0x5629('0xe')][_0x5629('0xf')]===0x1f4){logger[_0x5629('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x116185,_0x1dd481[_0x5629('0xe')][_0x5629('0x10')]);return _0xc2bbf9(_0x1dd481['error']['message']);}logger[_0x5629('0xe')](_0x5629('0xb'),_0x116185,_0x1dd481['error'][_0x5629('0x10')]);return _0x527b84(_0x1dd481['error']['message']);}else{logger[_0x5629('0x11')](_0x5629('0xb'),_0x116185,_0x5629('0xd'));_0x527b84(_0x1dd481['result'][_0x5629('0x10')]);}})[_0x5629('0x12')](function(_0x1786db){logger[_0x5629('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x116185,_0x1786db);_0xc2bbf9(_0x1786db);});});}exports['CreateFaxQueueReport']=function(_0x7d9561){var _0x2d6072=this;return new Promise(function(_0x461a44,_0x54bd10){return db['FaxQueueReport'][_0x5629('0x13')](_0x7d9561[_0x5629('0x14')],{'raw':_0x7d9561[_0x5629('0x15')]?_0x7d9561['options'][_0x5629('0x16')]===undefined?!![]:![]:!![]})[_0x5629('0xa')](function(_0x20e4cd){logger[_0x5629('0x11')](_0x5629('0x17'),_0x7d9561);logger[_0x5629('0x18')](_0x5629('0x17'),_0x7d9561,JSON[_0x5629('0x19')](_0x20e4cd));_0x461a44(_0x20e4cd);})[_0x5629('0x12')](function(_0xcbf019){logger[_0x5629('0xe')](_0x5629('0x17'),_0xcbf019[_0x5629('0x10')],_0x7d9561);_0x54bd10(_0x2d6072[_0x5629('0xe')](0x1f4,_0xcbf019[_0x5629('0x10')]));});});};exports['UpdateFaxQueueReport']=function(_0x36c458){var _0x4618d0=this;return new Promise(function(_0x15088c,_0x1d4365){return db['FaxQueueReport'][_0x5629('0x1a')](_0x36c458[_0x5629('0x14')],{'raw':_0x36c458['options']?_0x36c458[_0x5629('0x15')][_0x5629('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36c458[_0x5629('0x15')]?_0x36c458[_0x5629('0x15')]['where']||null:null,'attributes':_0x36c458[_0x5629('0x15')]?_0x36c458[_0x5629('0x15')][_0x5629('0x1b')]||null:null,'limit':_0x36c458[_0x5629('0x15')]?_0x36c458[_0x5629('0x15')][_0x5629('0x1c')]||null:null})[_0x5629('0xa')](function(_0x29efdb){logger[_0x5629('0x11')](_0x5629('0x1d'),_0x36c458);logger['debug'](_0x5629('0x1d'),_0x36c458,JSON['stringify'](_0x29efdb));_0x15088c(_0x29efdb);})[_0x5629('0x12')](function(_0x474bff){logger['error'](_0x5629('0x1d'),_0x474bff['message'],_0x36c458);_0x1d4365(_0x4618d0[_0x5629('0xe')](0x1f4,_0x474bff[_0x5629('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 42e23a4..1c5c235 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 _0x45db=['delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update'];(function(_0x314b5f,_0x3f835f){var _0x44cfe5=function(_0x282627){while(--_0x282627){_0x314b5f['push'](_0x314b5f['shift']());}};_0x44cfe5(++_0x3f835f);}(_0x45db,0x191));var _0xb45d=function(_0x461e83,_0x53a0b1){_0x461e83=_0x461e83-0x0;var _0x108b69=_0x45db[_0x461e83];return _0x108b69;};'use strict';var multer=require('multer');var util=require(_0xb45d('0x0'));var path=require(_0xb45d('0x1'));var timeout=require(_0xb45d('0x2'));var express=require(_0xb45d('0x3'));var router=express[_0xb45d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb45d('0x5'));var interaction=require(_0xb45d('0x6'));var config=require(_0xb45d('0x7'));var controller=require(_0xb45d('0x8'));router[_0xb45d('0x9')]('/',auth[_0xb45d('0xa')](),controller['index']);router[_0xb45d('0x9')](_0xb45d('0xb'),auth[_0xb45d('0xa')](),controller[_0xb45d('0xc')]);router[_0xb45d('0x9')](_0xb45d('0xd'),auth['isAuthenticated'](),controller[_0xb45d('0xe')]);router[_0xb45d('0xf')]('/',auth[_0xb45d('0xa')](),controller[_0xb45d('0x10')]);router[_0xb45d('0x11')](_0xb45d('0xd'),auth[_0xb45d('0xa')](),controller[_0xb45d('0x12')]);router[_0xb45d('0x13')](_0xb45d('0xd'),auth[_0xb45d('0xa')](),controller[_0xb45d('0x14')]);module['exports']=router; \ No newline at end of file +var _0x3fb9=['exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete'];(function(_0x3c7b02,_0xee1db8){var _0x3e37d1=function(_0x35fc5e){while(--_0x35fc5e){_0x3c7b02['push'](_0x3c7b02['shift']());}};_0x3e37d1(++_0xee1db8);}(_0x3fb9,0xab));var _0x93fb=function(_0x3fc9c9,_0x341a62){_0x3fc9c9=_0x3fc9c9-0x0;var _0x3e1df2=_0x3fb9[_0x3fc9c9];return _0x3e1df2;};'use strict';var multer=require(_0x93fb('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x93fb('0x1'));var router=express[_0x93fb('0x2')]();var fs_extra=require(_0x93fb('0x3'));var auth=require(_0x93fb('0x4'));var interaction=require(_0x93fb('0x5'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0x93fb('0x6')]('/',auth[_0x93fb('0x7')](),controller['index']);router[_0x93fb('0x6')](_0x93fb('0x8'),auth['isAuthenticated'](),controller[_0x93fb('0x9')]);router[_0x93fb('0x6')](_0x93fb('0xa'),auth[_0x93fb('0x7')](),controller[_0x93fb('0xb')]);router['post']('/',auth[_0x93fb('0x7')](),controller[_0x93fb('0xc')]);router[_0x93fb('0xd')]('/:id',auth[_0x93fb('0x7')](),controller[_0x93fb('0xe')]);router[_0x93fb('0xf')]('/:id',auth[_0x93fb('0x7')](),controller['destroy']);module[_0x93fb('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 6818e5f..13f2b20 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x19940e,_0x2f8a34){var _0x2d9880=function(_0x1437ea){while(--_0x1437ea){_0x19940e['push'](_0x19940e['shift']());}};_0x2d9880(++_0x2f8a34);}(_0x70e0,0x17b));var _0x070e=function(_0x137b99,_0x5d850a){_0x137b99=_0x137b99-0x0;var _0x5a3749=_0x70e0[_0x137b99];return _0x5a3749;};'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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0xd76d30,_0x17aefb){var _0x41fa86=function(_0x4bc76f){while(--_0x4bc76f){_0xd76d30['push'](_0xd76d30['shift']());}};_0x41fa86(++_0x17aefb);}(_0xe706,0xa3));var _0x6e70=function(_0x160cbc,_0x3025a6){_0x160cbc=_0x160cbc-0x0;var _0x4ac8c6=_0xe706[_0x160cbc];return _0x4ac8c6;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 5b126f1..e39c139 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 _0xf59a=['merge','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf59a,0x180));var _0xaf59=function(_0x5cd8cc,_0x26b007){_0x5cd8cc=_0x5cd8cc-0x0;var _0x1e8607=_0xf59a[_0x5cd8cc];return _0x1e8607;};'use strict';var emlformat=require(_0xaf59('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaf59('0x1'));var jsonpatch=require(_0xaf59('0x2'));var rp=require(_0xaf59('0x3'));var moment=require(_0xaf59('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaf59('0x5'));var util=require(_0xaf59('0x6'));var path=require(_0xaf59('0x7'));var sox=require(_0xaf59('0x8'));var csv=require('to-csv');var ejs=require(_0xaf59('0x9'));var fs=require('fs');var fs_extra=require(_0xaf59('0xa'));var _=require(_0xaf59('0xb'));var squel=require('squel');var crypto=require(_0xaf59('0xc'));var jsforce=require(_0xaf59('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaf59('0xe'));var querystring=require(_0xaf59('0xf'));var Papa=require('papaparse');var Redis=require(_0xaf59('0x10'));var authService=require(_0xaf59('0x11'));var qs=require(_0xaf59('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf59('0x13'));var logger=require(_0xaf59('0x14'))('api');var utils=require(_0xaf59('0x15'));var config=require(_0xaf59('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x124bc5,_0x40335b){_0x40335b=_0x40335b||0xcc;return function(_0x44d7d4){if(_0x44d7d4){return _0x124bc5[_0xaf59('0x17')](_0x40335b);}return _0x124bc5['status'](_0x40335b)[_0xaf59('0x18')]();};}function respondWithResult(_0x20b531,_0x3a3870){_0x3a3870=_0x3a3870||0xc8;return function(_0xf8f263){if(_0xf8f263){return _0x20b531[_0xaf59('0x19')](_0x3a3870)['json'](_0xf8f263);}};}function respondWithFilteredResult(_0x2d6556,_0x288f6d){return function(_0x1487d9){if(_0x1487d9){var _0xa474a3=typeof _0x288f6d[_0xaf59('0x1a')]===_0xaf59('0x1b')&&typeof _0x288f6d[_0xaf59('0x1c')]==='undefined';var _0x20d761=_0x1487d9[_0xaf59('0x1d')];var _0x4fc8a8=_0xa474a3?0x0:_0x288f6d['offset'];var _0x5b7838=_0xa474a3?_0x1487d9[_0xaf59('0x1d')]:_0x288f6d['offset']+_0x288f6d['limit'];var _0x349cc5;if(_0x5b7838>=_0x20d761){_0x5b7838=_0x20d761;_0x349cc5=0xc8;}else{_0x349cc5=0xce;}_0x2d6556['status'](_0x349cc5);return _0x2d6556[_0xaf59('0x1e')](_0xaf59('0x1f'),_0x4fc8a8+'-'+_0x5b7838+'/'+_0x20d761)['json'](_0x1487d9);}return null;};}function patchUpdates(_0x1b78d7){return function(_0x13a81d){try{jsonpatch[_0xaf59('0x20')](_0x13a81d,_0x1b78d7,!![]);}catch(_0x5b9f4b){return BPromise[_0xaf59('0x21')](_0x5b9f4b);}return _0x13a81d['save']();};}function saveUpdates(_0x4837d7,_0x972359){return function(_0x35236a){if(_0x35236a){return _0x35236a[_0xaf59('0x22')](_0x4837d7)[_0xaf59('0x23')](function(_0x2f746e){return _0x2f746e;});}return null;};}function removeEntity(_0x41afe,_0x27a768){return function(_0x40909a){if(_0x40909a){return _0x40909a[_0xaf59('0x24')]()[_0xaf59('0x23')](function(){_0x41afe[_0xaf59('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e1bb5,_0x50ccc5){return function(_0x4694ec){if(!_0x4694ec){_0x4e1bb5['sendStatus'](0x194);}return _0x4694ec;};}function handleError(_0x2df535,_0x34f5ef){_0x34f5ef=_0x34f5ef||0x1f4;return function(_0x4b07bd){logger[_0xaf59('0x25')](_0x4b07bd[_0xaf59('0x26')]);if(_0x4b07bd['name']){delete _0x4b07bd[_0xaf59('0x27')];}_0x2df535['status'](_0x34f5ef)[_0xaf59('0x28')](_0x4b07bd);};}exports[_0xaf59('0x29')]=function(_0x305be0,_0x362077){var _0x1ff66d={},_0x4646d5={},_0x3c7930={'count':0x0,'rows':[]};var _0x1bd6da=_[_0xaf59('0x2a')](db[_0xaf59('0x2b')][_0xaf59('0x2c')],function(_0x31202a){return{'name':_0x31202a[_0xaf59('0x2d')],'type':_0x31202a[_0xaf59('0x2e')][_0xaf59('0x2f')]};});_0x4646d5[_0xaf59('0x30')]=_[_0xaf59('0x2a')](_0x1bd6da,_0xaf59('0x27'));_0x4646d5['query']=_[_0xaf59('0x31')](_0x305be0[_0xaf59('0x32')]);_0x4646d5[_0xaf59('0x33')]=_[_0xaf59('0x34')](_0x4646d5[_0xaf59('0x30')],_0x4646d5['query']);_0x1ff66d['attributes']=_[_0xaf59('0x34')](_0x4646d5[_0xaf59('0x30')],qs[_0xaf59('0x35')](_0x305be0[_0xaf59('0x32')][_0xaf59('0x35')]));_0x1ff66d['attributes']=_0x1ff66d[_0xaf59('0x36')][_0xaf59('0x37')]?_0x1ff66d[_0xaf59('0x36')]:_0x4646d5['model'];if(!_0x305be0[_0xaf59('0x32')]['hasOwnProperty'](_0xaf59('0x38'))){_0x1ff66d['limit']=qs[_0xaf59('0x1c')](_0x305be0[_0xaf59('0x32')][_0xaf59('0x1c')]);_0x1ff66d[_0xaf59('0x1a')]=qs[_0xaf59('0x1a')](_0x305be0[_0xaf59('0x32')][_0xaf59('0x1a')]);}_0x1ff66d[_0xaf59('0x39')]=qs[_0xaf59('0x3a')](_0x305be0[_0xaf59('0x32')][_0xaf59('0x3a')]);_0x1ff66d[_0xaf59('0x3b')]=qs['filters'](_['pick'](_0x305be0[_0xaf59('0x32')],_0x4646d5[_0xaf59('0x33')]),_0x1bd6da);if(_0x305be0[_0xaf59('0x32')]['filter']){_0x1ff66d[_0xaf59('0x3b')]=_[_0xaf59('0x3c')](_0x1ff66d[_0xaf59('0x3b')],{'$or':_[_0xaf59('0x2a')](_0x1bd6da,function(_0x2eddcf){if(_0x2eddcf[_0xaf59('0x2e')]!=='VIRTUAL'){var _0x25d483={};_0x25d483[_0x2eddcf[_0xaf59('0x27')]]={'$like':'%'+_0x305be0[_0xaf59('0x32')][_0xaf59('0x3d')]+'%'};return _0x25d483;}})});}_0x1ff66d=_['merge']({},_0x1ff66d,_0x305be0['options']);var _0x3301ba={'where':_0x1ff66d['where']};return db[_0xaf59('0x2b')][_0xaf59('0x1d')](_0x3301ba)['then'](function(_0x215eb0){_0x3c7930[_0xaf59('0x1d')]=_0x215eb0;if(_0x305be0[_0xaf59('0x32')][_0xaf59('0x3e')]){_0x1ff66d[_0xaf59('0x3f')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xaf59('0x40')](_0x1ff66d);})[_0xaf59('0x23')](function(_0x28d657){_0x3c7930[_0xaf59('0x41')]=_0x28d657;return _0x3c7930;})['then'](respondWithFilteredResult(_0x362077,_0x1ff66d))[_0xaf59('0x42')](handleError(_0x362077,null));};exports[_0xaf59('0x43')]=function(_0x36af0d,_0x228c16){var _0x22aa55={'raw':!![],'where':{'id':_0x36af0d[_0xaf59('0x44')]['id']}},_0xcb462={};_0xcb462[_0xaf59('0x30')]=_[_0xaf59('0x31')](db[_0xaf59('0x2b')]['rawAttributes']);_0xcb462[_0xaf59('0x32')]=_[_0xaf59('0x31')](_0x36af0d[_0xaf59('0x32')]);_0xcb462[_0xaf59('0x33')]=_[_0xaf59('0x34')](_0xcb462[_0xaf59('0x30')],_0xcb462[_0xaf59('0x32')]);_0x22aa55[_0xaf59('0x36')]=_['intersection'](_0xcb462[_0xaf59('0x30')],qs[_0xaf59('0x35')](_0x36af0d['query'][_0xaf59('0x35')]));_0x22aa55['attributes']=_0x22aa55[_0xaf59('0x36')][_0xaf59('0x37')]?_0x22aa55[_0xaf59('0x36')]:_0xcb462[_0xaf59('0x30')];if(_0x36af0d['query']['includeAll']){_0x22aa55[_0xaf59('0x3f')]=[{'all':!![]}];}_0x22aa55=_[_0xaf59('0x3c')]({},_0x22aa55,_0x36af0d[_0xaf59('0x45')]);return db[_0xaf59('0x2b')][_0xaf59('0x46')](_0x22aa55)['then'](handleEntityNotFound(_0x228c16,null))['then'](respondWithResult(_0x228c16,null))[_0xaf59('0x42')](handleError(_0x228c16,null));};exports[_0xaf59('0x47')]=function(_0x3794c8,_0x1ede12){return db[_0xaf59('0x2b')][_0xaf59('0x47')](_0x3794c8['body'],{})[_0xaf59('0x23')](respondWithResult(_0x1ede12,0xc9))['catch'](handleError(_0x1ede12,null));};exports[_0xaf59('0x22')]=function(_0x289466,_0x1a2b04){if(_0x289466[_0xaf59('0x48')]['id']){delete _0x289466[_0xaf59('0x48')]['id'];}return db[_0xaf59('0x2b')]['find']({'where':{'id':_0x289466[_0xaf59('0x44')]['id']}})[_0xaf59('0x23')](handleEntityNotFound(_0x1a2b04,null))[_0xaf59('0x23')](saveUpdates(_0x289466[_0xaf59('0x48')],null))[_0xaf59('0x23')](respondWithResult(_0x1a2b04,null))[_0xaf59('0x42')](handleError(_0x1a2b04,null));};exports[_0xaf59('0x24')]=function(_0x4df2da,_0x236d82){return db[_0xaf59('0x2b')][_0xaf59('0x46')]({'where':{'id':_0x4df2da['params']['id']}})[_0xaf59('0x23')](handleEntityNotFound(_0x236d82,null))[_0xaf59('0x23')](removeEntity(_0x236d82,null))[_0xaf59('0x42')](handleError(_0x236d82,null));};exports['describe']=function(_0x4d51eb,_0x34c542){return db[_0xaf59('0x2b')][_0xaf59('0x49')]()[_0xaf59('0x23')](respondWithResult(_0x34c542,null))[_0xaf59('0x42')](handleError(_0x34c542,null));}; \ No newline at end of file +var _0x5eaf=['describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','name','index','map','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','FaxTransferReport','include','findAll','rows','catch','show','params','rawAttributes','find','create','body'];(function(_0x5036dc,_0x4b1e45){var _0x1b6306=function(_0x5bec81){while(--_0x5bec81){_0x5036dc['push'](_0x5036dc['shift']());}};_0x1b6306(++_0x4b1e45);}(_0x5eaf,0x16e));var _0xf5ea=function(_0x1ab620,_0x494947){_0x1ab620=_0x1ab620-0x0;var _0x12561d=_0x5eaf[_0x1ab620];return _0x12561d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf5ea('0x0'));var zipdir=require(_0xf5ea('0x1'));var jsonpatch=require(_0xf5ea('0x2'));var rp=require(_0xf5ea('0x3'));var moment=require(_0xf5ea('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf5ea('0x5'));var path=require(_0xf5ea('0x6'));var sox=require(_0xf5ea('0x7'));var csv=require(_0xf5ea('0x8'));var ejs=require(_0xf5ea('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf5ea('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf5ea('0xb'));var deskjs=require(_0xf5ea('0xc'));var toCsv=require(_0xf5ea('0x8'));var querystring=require(_0xf5ea('0xd'));var Papa=require(_0xf5ea('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf5ea('0xf'));var as=require(_0xf5ea('0x10'));var hardwareService=require(_0xf5ea('0x11'));var logger=require(_0xf5ea('0x12'))(_0xf5ea('0x13'));var utils=require(_0xf5ea('0x14'));var config=require(_0xf5ea('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf5ea('0x16'))['db'];function respondWithStatusCode(_0x49ec03,_0x4656a9){_0x4656a9=_0x4656a9||0xcc;return function(_0x19eaa2){if(_0x19eaa2){return _0x49ec03['sendStatus'](_0x4656a9);}return _0x49ec03['status'](_0x4656a9)['end']();};}function respondWithResult(_0x323bf7,_0x188842){_0x188842=_0x188842||0xc8;return function(_0x1cba95){if(_0x1cba95){return _0x323bf7['status'](_0x188842)[_0xf5ea('0x17')](_0x1cba95);}};}function respondWithFilteredResult(_0x8b1977,_0x4e037d){return function(_0x587069){if(_0x587069){var _0x345611=typeof _0x4e037d[_0xf5ea('0x18')]===_0xf5ea('0x19')&&typeof _0x4e037d[_0xf5ea('0x1a')]==='undefined';var _0x3259dd=_0x587069[_0xf5ea('0x1b')];var _0x1d36db=_0x345611?0x0:_0x4e037d[_0xf5ea('0x18')];var _0x17e2bb=_0x345611?_0x587069[_0xf5ea('0x1b')]:_0x4e037d[_0xf5ea('0x18')]+_0x4e037d[_0xf5ea('0x1a')];var _0x32ba2a;if(_0x17e2bb>=_0x3259dd){_0x17e2bb=_0x3259dd;_0x32ba2a=0xc8;}else{_0x32ba2a=0xce;}_0x8b1977[_0xf5ea('0x1c')](_0x32ba2a);return _0x8b1977[_0xf5ea('0x1d')](_0xf5ea('0x1e'),_0x1d36db+'-'+_0x17e2bb+'/'+_0x3259dd)[_0xf5ea('0x17')](_0x587069);}return null;};}function patchUpdates(_0x45e200){return function(_0x583ed2){try{jsonpatch['apply'](_0x583ed2,_0x45e200,!![]);}catch(_0x3e1d44){return BPromise[_0xf5ea('0x1f')](_0x3e1d44);}return _0x583ed2[_0xf5ea('0x20')]();};}function saveUpdates(_0x5d1ee5,_0x5e5417){return function(_0x1cfdec){if(_0x1cfdec){return _0x1cfdec[_0xf5ea('0x21')](_0x5d1ee5)['then'](function(_0x2553d9){return _0x2553d9;});}return null;};}function removeEntity(_0x2f8e1b,_0x759916){return function(_0x1e9060){if(_0x1e9060){return _0x1e9060[_0xf5ea('0x22')]()[_0xf5ea('0x23')](function(){_0x2f8e1b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f22ce,_0x51740d){return function(_0xb5cc49){if(!_0xb5cc49){_0x2f22ce[_0xf5ea('0x24')](0x194);}return _0xb5cc49;};}function handleError(_0x3a5a1a,_0x33d20b){_0x33d20b=_0x33d20b||0x1f4;return function(_0x4e1a12){logger[_0xf5ea('0x25')](_0x4e1a12['stack']);if(_0x4e1a12[_0xf5ea('0x26')]){delete _0x4e1a12[_0xf5ea('0x26')];}_0x3a5a1a[_0xf5ea('0x1c')](_0x33d20b)['send'](_0x4e1a12);};}exports[_0xf5ea('0x27')]=function(_0x54a119,_0x337f7c){var _0x2bdad7={},_0x4a1496={},_0x1d30b9={'count':0x0,'rows':[]};var _0x5d7f3c=_[_0xf5ea('0x28')](db['FaxTransferReport']['rawAttributes'],function(_0x128db9){return{'name':_0x128db9[_0xf5ea('0x29')],'type':_0x128db9['type'][_0xf5ea('0x2a')]};});_0x4a1496[_0xf5ea('0x2b')]=_['map'](_0x5d7f3c,_0xf5ea('0x26'));_0x4a1496[_0xf5ea('0x2c')]=_[_0xf5ea('0x2d')](_0x54a119[_0xf5ea('0x2c')]);_0x4a1496[_0xf5ea('0x2e')]=_[_0xf5ea('0x2f')](_0x4a1496['model'],_0x4a1496[_0xf5ea('0x2c')]);_0x2bdad7['attributes']=_[_0xf5ea('0x2f')](_0x4a1496[_0xf5ea('0x2b')],qs[_0xf5ea('0x30')](_0x54a119[_0xf5ea('0x2c')][_0xf5ea('0x30')]));_0x2bdad7[_0xf5ea('0x31')]=_0x2bdad7[_0xf5ea('0x31')][_0xf5ea('0x32')]?_0x2bdad7[_0xf5ea('0x31')]:_0x4a1496[_0xf5ea('0x2b')];if(!_0x54a119[_0xf5ea('0x2c')][_0xf5ea('0x33')](_0xf5ea('0x34'))){_0x2bdad7[_0xf5ea('0x1a')]=qs[_0xf5ea('0x1a')](_0x54a119[_0xf5ea('0x2c')][_0xf5ea('0x1a')]);_0x2bdad7['offset']=qs[_0xf5ea('0x18')](_0x54a119[_0xf5ea('0x2c')][_0xf5ea('0x18')]);}_0x2bdad7[_0xf5ea('0x35')]=qs[_0xf5ea('0x36')](_0x54a119[_0xf5ea('0x2c')][_0xf5ea('0x36')]);_0x2bdad7['where']=qs[_0xf5ea('0x2e')](_['pick'](_0x54a119[_0xf5ea('0x2c')],_0x4a1496['filters']),_0x5d7f3c);if(_0x54a119[_0xf5ea('0x2c')][_0xf5ea('0x37')]){_0x2bdad7[_0xf5ea('0x38')]=_[_0xf5ea('0x39')](_0x2bdad7[_0xf5ea('0x38')],{'$or':_[_0xf5ea('0x28')](_0x5d7f3c,function(_0x403ecb){if(_0x403ecb[_0xf5ea('0x3a')]!==_0xf5ea('0x3b')){var _0x91d924={};_0x91d924[_0x403ecb['name']]={'$like':'%'+_0x54a119[_0xf5ea('0x2c')][_0xf5ea('0x37')]+'%'};return _0x91d924;}})});}_0x2bdad7=_['merge']({},_0x2bdad7,_0x54a119[_0xf5ea('0x3c')]);var _0x4cf340={'where':_0x2bdad7[_0xf5ea('0x38')]};return db[_0xf5ea('0x3d')][_0xf5ea('0x1b')](_0x4cf340)[_0xf5ea('0x23')](function(_0x1f9697){_0x1d30b9['count']=_0x1f9697;if(_0x54a119[_0xf5ea('0x2c')]['includeAll']){_0x2bdad7[_0xf5ea('0x3e')]=[{'all':!![]}];}return db[_0xf5ea('0x3d')][_0xf5ea('0x3f')](_0x2bdad7);})[_0xf5ea('0x23')](function(_0x5d6220){_0x1d30b9[_0xf5ea('0x40')]=_0x5d6220;return _0x1d30b9;})['then'](respondWithFilteredResult(_0x337f7c,_0x2bdad7))[_0xf5ea('0x41')](handleError(_0x337f7c,null));};exports[_0xf5ea('0x42')]=function(_0x1b414b,_0x408102){var _0x1f68b1={'raw':!![],'where':{'id':_0x1b414b[_0xf5ea('0x43')]['id']}},_0x55e8bd={};_0x55e8bd[_0xf5ea('0x2b')]=_[_0xf5ea('0x2d')](db[_0xf5ea('0x3d')][_0xf5ea('0x44')]);_0x55e8bd[_0xf5ea('0x2c')]=_[_0xf5ea('0x2d')](_0x1b414b[_0xf5ea('0x2c')]);_0x55e8bd[_0xf5ea('0x2e')]=_[_0xf5ea('0x2f')](_0x55e8bd['model'],_0x55e8bd[_0xf5ea('0x2c')]);_0x1f68b1['attributes']=_['intersection'](_0x55e8bd[_0xf5ea('0x2b')],qs['fields'](_0x1b414b['query'][_0xf5ea('0x30')]));_0x1f68b1['attributes']=_0x1f68b1[_0xf5ea('0x31')][_0xf5ea('0x32')]?_0x1f68b1['attributes']:_0x55e8bd[_0xf5ea('0x2b')];if(_0x1b414b[_0xf5ea('0x2c')]['includeAll']){_0x1f68b1[_0xf5ea('0x3e')]=[{'all':!![]}];}_0x1f68b1=_[_0xf5ea('0x39')]({},_0x1f68b1,_0x1b414b['options']);return db[_0xf5ea('0x3d')][_0xf5ea('0x45')](_0x1f68b1)['then'](handleEntityNotFound(_0x408102,null))[_0xf5ea('0x23')](respondWithResult(_0x408102,null))[_0xf5ea('0x41')](handleError(_0x408102,null));};exports['create']=function(_0x52fb23,_0x21f8c0){return db['FaxTransferReport'][_0xf5ea('0x46')](_0x52fb23[_0xf5ea('0x47')],{})['then'](respondWithResult(_0x21f8c0,0xc9))[_0xf5ea('0x41')](handleError(_0x21f8c0,null));};exports['update']=function(_0xb76ae4,_0x5f12a0){if(_0xb76ae4['body']['id']){delete _0xb76ae4['body']['id'];}return db['FaxTransferReport'][_0xf5ea('0x45')]({'where':{'id':_0xb76ae4[_0xf5ea('0x43')]['id']}})[_0xf5ea('0x23')](handleEntityNotFound(_0x5f12a0,null))[_0xf5ea('0x23')](saveUpdates(_0xb76ae4[_0xf5ea('0x47')],null))['then'](respondWithResult(_0x5f12a0,null))[_0xf5ea('0x41')](handleError(_0x5f12a0,null));};exports['destroy']=function(_0xe3bc8c,_0x420c95){return db[_0xf5ea('0x3d')]['find']({'where':{'id':_0xe3bc8c[_0xf5ea('0x43')]['id']}})[_0xf5ea('0x23')](handleEntityNotFound(_0x420c95,null))['then'](removeEntity(_0x420c95,null))[_0xf5ea('0x41')](handleError(_0x420c95,null));};exports[_0xf5ea('0x48')]=function(_0x503105,_0x56bfc7){return db[_0xf5ea('0x3d')]['describe']()[_0xf5ea('0x23')](respondWithResult(_0x56bfc7,null))[_0xf5ea('0x41')](handleError(_0x56bfc7,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index d5ede88..16466b3 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 _0x67a6=['FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0x67a6,0x137));var _0x667a=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x67a6[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x667a('0x0'));var util=require(_0x667a('0x1'));var logger=require(_0x667a('0x2'))(_0x667a('0x3'));var moment=require(_0x667a('0x4'));var BPromise=require(_0x667a('0x5'));var rp=require(_0x667a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x667a('0x7'));var attributes=require(_0x667a('0x8'));module[_0x667a('0x9')]=function(_0x13c304,_0x2dfbba){return _0x13c304[_0x667a('0xa')](_0x667a('0xb'),attributes,{'tableName':_0x667a('0xc'),'paranoid':![],'indexes':[{'name':_0x667a('0xd'),'fields':[_0x667a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd914=['rimraf','./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xd914,0x17f));var _0x4d91=function(_0x3f2228,_0x3b27d5){_0x3f2228=_0x3f2228-0x0;var _0x285ae4=_0xd914[_0x3f2228];return _0x285ae4;};'use strict';var _=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var logger=require('../../config/logger')(_0x4d91('0x2'));var moment=require(_0x4d91('0x3'));var BPromise=require(_0x4d91('0x4'));var rp=require(_0x4d91('0x5'));var fs=require('fs');var path=require(_0x4d91('0x6'));var rimraf=require(_0x4d91('0x7'));var config=require('../../config/environment');var attributes=require(_0x4d91('0x8'));module['exports']=function(_0x3ab6f8,_0x42d7ae){return _0x3ab6f8[_0x4d91('0x9')](_0x4d91('0xa'),attributes,{'tableName':_0x4d91('0xb'),'paranoid':![],'indexes':[{'name':_0x4d91('0xc'),'fields':[_0x4d91('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 4ebb63b..60c936f 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 _0x5e56=['jayson/promise','then','debug','request\x20sent','error','code','FaxTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x26a65e,_0x3ef918){var _0x31d61f=function(_0xe888f){while(--_0xe888f){_0x26a65e['push'](_0x26a65e['shift']());}};_0x31d61f(++_0x3ef918);}(_0x5e56,0x6a));var _0x65e5=function(_0x356589,_0x30d81e){_0x356589=_0x356589-0x0;var _0x2b85e4=_0x5e56[_0x356589];return _0x2b85e4;};'use strict';var _=require(_0x65e5('0x0'));var util=require(_0x65e5('0x1'));var moment=require('moment');var BPromise=require(_0x65e5('0x2'));var rs=require(_0x65e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65e5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65e5('0x5'))(_0x65e5('0x6'));var config=require(_0x65e5('0x7'));var jayson=require(_0x65e5('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3cd209,_0x1e0270,_0x21ffa5){return new BPromise(function(_0xe89318,_0x52edf9){return client['request'](_0x3cd209,_0x21ffa5)[_0x65e5('0x9')](function(_0x51d9a2){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x1e0270,'request\x20sent');logger[_0x65e5('0xa')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x1e0270,_0x65e5('0xb'),JSON['stringify'](_0x51d9a2));if(_0x51d9a2[_0x65e5('0xc')]){if(_0x51d9a2[_0x65e5('0xc')][_0x65e5('0xd')]===0x1f4){logger[_0x65e5('0xc')](_0x65e5('0xe'),_0x1e0270,_0x51d9a2[_0x65e5('0xc')][_0x65e5('0xf')]);return _0x52edf9(_0x51d9a2[_0x65e5('0xc')]['message']);}logger['error'](_0x65e5('0xe'),_0x1e0270,_0x51d9a2[_0x65e5('0xc')][_0x65e5('0xf')]);return _0xe89318(_0x51d9a2['error'][_0x65e5('0xf')]);}else{logger[_0x65e5('0x10')](_0x65e5('0xe'),_0x1e0270,_0x65e5('0xb'));_0xe89318(_0x51d9a2[_0x65e5('0x11')][_0x65e5('0xf')]);}})[_0x65e5('0x12')](function(_0x1d4d34){logger[_0x65e5('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x1e0270,_0x1d4d34);_0x52edf9(_0x1d4d34);});});} \ No newline at end of file +var _0x74de=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis'];(function(_0xd6305a,_0x2df988){var _0x373543=function(_0x539509){while(--_0x539509){_0xd6305a['push'](_0xd6305a['shift']());}};_0x373543(++_0x2df988);}(_0x74de,0xe3));var _0xe74d=function(_0x376981,_0x4c338c){_0x376981=_0x376981-0x0;var _0x4ab265=_0x74de[_0x376981];return _0x4ab265;};'use strict';var _=require(_0xe74d('0x0'));var util=require(_0xe74d('0x1'));var moment=require('moment');var BPromise=require(_0xe74d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe74d('0x3'));var db=require(_0xe74d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe74d('0x5'))(_0xe74d('0x6'));var config=require(_0xe74d('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe74d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x388303,_0x38a0b5,_0x1cc0f2){return new BPromise(function(_0x386154,_0x43d65b){return client[_0xe74d('0x9')](_0x388303,_0x1cc0f2)[_0xe74d('0xa')](function(_0x5cc8a9){logger[_0xe74d('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x38a0b5,'request\x20sent');logger[_0xe74d('0xc')](_0xe74d('0xd'),_0x38a0b5,_0xe74d('0xe'),JSON['stringify'](_0x5cc8a9));if(_0x5cc8a9[_0xe74d('0xf')]){if(_0x5cc8a9[_0xe74d('0xf')][_0xe74d('0x10')]===0x1f4){logger['error'](_0xe74d('0x11'),_0x38a0b5,_0x5cc8a9[_0xe74d('0xf')][_0xe74d('0x12')]);return _0x43d65b(_0x5cc8a9[_0xe74d('0xf')][_0xe74d('0x12')]);}logger[_0xe74d('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x38a0b5,_0x5cc8a9[_0xe74d('0xf')][_0xe74d('0x12')]);return _0x386154(_0x5cc8a9[_0xe74d('0xf')][_0xe74d('0x12')]);}else{logger[_0xe74d('0xb')](_0xe74d('0x11'),_0x38a0b5,_0xe74d('0xe'));_0x386154(_0x5cc8a9[_0xe74d('0x13')][_0xe74d('0x12')]);}})[_0xe74d('0x14')](function(_0x1b1ff4){logger[_0xe74d('0xf')](_0xe74d('0x11'),_0x38a0b5,_0x1b1ff4);_0x43d65b(_0x1b1ff4);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index d32d23b..c7c407c 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 _0x7a47=['../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x7a47,0x19d));var _0x77a4=function(_0x3b619d,_0x56266d){_0x3b619d=_0x3b619d-0x0;var _0x308297=_0x7a47[_0x3b619d];return _0x308297;};'use strict';var multer=require('multer');var util=require(_0x77a4('0x0'));var path=require(_0x77a4('0x1'));var timeout=require(_0x77a4('0x2'));var express=require('express');var router=express[_0x77a4('0x3')]();var fs_extra=require(_0x77a4('0x4'));var auth=require(_0x77a4('0x5'));var interaction=require(_0x77a4('0x6'));var config=require(_0x77a4('0x7'));var controller=require('./faxTransferReport.controller');router[_0x77a4('0x8')]('/',auth[_0x77a4('0x9')](),controller['index']);router[_0x77a4('0x8')]('/describe',auth[_0x77a4('0x9')](),controller[_0x77a4('0xa')]);router[_0x77a4('0x8')](_0x77a4('0xb'),auth[_0x77a4('0x9')](),controller[_0x77a4('0xc')]);router[_0x77a4('0xd')]('/',auth[_0x77a4('0x9')](),controller[_0x77a4('0xe')]);router[_0x77a4('0xf')](_0x77a4('0xb'),auth[_0x77a4('0x9')](),controller[_0x77a4('0x10')]);router[_0x77a4('0x11')](_0x77a4('0xb'),auth['isAuthenticated'](),controller[_0x77a4('0x12')]);module[_0x77a4('0x13')]=router; \ No newline at end of file +var _0xea60=['../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5b38a1,_0x4a1d01){var _0x770bc0=function(_0x5cbfe1){while(--_0x5cbfe1){_0x5b38a1['push'](_0x5b38a1['shift']());}};_0x770bc0(++_0x4a1d01);}(_0xea60,0xb6));var _0x0ea6=function(_0x2ce87f,_0x2386fe){_0x2ce87f=_0x2ce87f-0x0;var _0x370d79=_0xea60[_0x2ce87f];return _0x370d79;};'use strict';var multer=require(_0x0ea6('0x0'));var util=require(_0x0ea6('0x1'));var path=require(_0x0ea6('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ea6('0x3'));var router=express['Router']();var fs_extra=require(_0x0ea6('0x4'));var auth=require(_0x0ea6('0x5'));var interaction=require(_0x0ea6('0x6'));var config=require(_0x0ea6('0x7'));var controller=require(_0x0ea6('0x8'));router[_0x0ea6('0x9')]('/',auth[_0x0ea6('0xa')](),controller[_0x0ea6('0xb')]);router[_0x0ea6('0x9')](_0x0ea6('0xc'),auth[_0x0ea6('0xa')](),controller[_0x0ea6('0xd')]);router[_0x0ea6('0x9')](_0x0ea6('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x0ea6('0xf')]('/',auth[_0x0ea6('0xa')](),controller['create']);router[_0x0ea6('0x10')](_0x0ea6('0xe'),auth[_0x0ea6('0xa')](),controller[_0x0ea6('0x11')]);router[_0x0ea6('0x12')]('/:id',auth[_0x0ea6('0xa')](),controller[_0x0ea6('0x13')]);module[_0x0ea6('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index e76f079..f287aeb 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 _0x838e=['./intDeskAccount.controller','get','isAuthenticated','/:id','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x54b283,_0x5eb8a6){var _0x2462b3=function(_0x13fca7){while(--_0x13fca7){_0x54b283['push'](_0x54b283['shift']());}};_0x2462b3(++_0x5eb8a6);}(_0x838e,0x65));var _0xe838=function(_0x227c97,_0x4bbca4){_0x227c97=_0x227c97-0x0;var _0x5ab215=_0x838e[_0x227c97];return _0x5ab215;};'use strict';var multer=require(_0xe838('0x0'));var util=require('util');var path=require(_0xe838('0x1'));var timeout=require(_0xe838('0x2'));var express=require(_0xe838('0x3'));var router=express[_0xe838('0x4')]();var fs_extra=require(_0xe838('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe838('0x6'));var config=require('../../config/environment');var controller=require(_0xe838('0x7'));router[_0xe838('0x8')]('/',auth[_0xe838('0x9')](),controller['index']);router[_0xe838('0x8')](_0xe838('0xa'),auth[_0xe838('0x9')](),controller['show']);router[_0xe838('0x8')]('/:id/configurations',auth[_0xe838('0x9')](),controller['getConfigurations']);router[_0xe838('0x8')](_0xe838('0xb'),auth['isAuthenticated'](),controller[_0xe838('0xc')]);router[_0xe838('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe838('0xd')](_0xe838('0xe'),auth[_0xe838('0x9')](),controller[_0xe838('0xf')]);router[_0xe838('0x10')]('/:id',auth[_0xe838('0x9')](),controller['update']);router['delete'](_0xe838('0xa'),auth[_0xe838('0x9')](),controller['destroy']);module[_0xe838('0x11')]=router; \ No newline at end of file +var _0x8e3d=['getFields','post','create','/:id/configurations','addConfiguration','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','show','getConfigurations','/:id/fields'];(function(_0x343dab,_0x134185){var _0xa7e52d=function(_0x37a2b8){while(--_0x37a2b8){_0x343dab['push'](_0x343dab['shift']());}};_0xa7e52d(++_0x134185);}(_0x8e3d,0xc0));var _0xd8e3=function(_0x4d9ab2,_0x447a08){_0x4d9ab2=_0x4d9ab2-0x0;var _0x1c6fbe=_0x8e3d[_0x4d9ab2];return _0x1c6fbe;};'use strict';var multer=require(_0xd8e3('0x0'));var util=require(_0xd8e3('0x1'));var path=require(_0xd8e3('0x2'));var timeout=require(_0xd8e3('0x3'));var express=require(_0xd8e3('0x4'));var router=express[_0xd8e3('0x5')]();var fs_extra=require(_0xd8e3('0x6'));var auth=require(_0xd8e3('0x7'));var interaction=require(_0xd8e3('0x8'));var config=require(_0xd8e3('0x9'));var controller=require(_0xd8e3('0xa'));router[_0xd8e3('0xb')]('/',auth[_0xd8e3('0xc')](),controller['index']);router[_0xd8e3('0xb')]('/:id',auth[_0xd8e3('0xc')](),controller[_0xd8e3('0xd')]);router[_0xd8e3('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xd8e3('0xe')]);router[_0xd8e3('0xb')](_0xd8e3('0xf'),auth[_0xd8e3('0xc')](),controller[_0xd8e3('0x10')]);router[_0xd8e3('0x11')]('/',auth[_0xd8e3('0xc')](),controller[_0xd8e3('0x12')]);router[_0xd8e3('0x11')](_0xd8e3('0x13'),auth['isAuthenticated'](),controller[_0xd8e3('0x14')]);router[_0xd8e3('0x15')](_0xd8e3('0x16'),auth['isAuthenticated'](),controller[_0xd8e3('0x17')]);router[_0xd8e3('0x18')](_0xd8e3('0x16'),auth['isAuthenticated'](),controller['destroy']);module[_0xd8e3('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 61134b2..1d10a3a 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 _0xfaac=['ENUM','basic','integrationTab','sequelize','exports','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xfaac,0x1dd));var _0xcfaa=function(_0x363978,_0x57b649){_0x363978=_0x363978-0x0;var _0x1b713b=_0xfaac[_0x363978];return _0x1b713b;};'use strict';var Sequelize=require(_0xcfaa('0x0'));module[_0xcfaa('0x1')]={'name':{'type':Sequelize[_0xcfaa('0x2')]},'description':{'type':Sequelize[_0xcfaa('0x2')]},'username':{'type':Sequelize[_0xcfaa('0x2')]},'remoteUri':{'type':Sequelize[_0xcfaa('0x2')]},'authType':{'type':Sequelize[_0xcfaa('0x3')](_0xcfaa('0x4')),'defaultValue':_0xcfaa('0x4')},'password':{'type':Sequelize[_0xcfaa('0x2')]},'consumerKey':{'type':Sequelize[_0xcfaa('0x2')]},'consumerSecret':{'type':Sequelize[_0xcfaa('0x2')]},'token':{'type':Sequelize[_0xcfaa('0x2')]},'tokenSecret':{'type':Sequelize[_0xcfaa('0x2')]},'serverUrl':{'type':Sequelize[_0xcfaa('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xcfaa('0x3')](_0xcfaa('0x5'),'newTab'),'defaultValue':_0xcfaa('0x5')}}; \ No newline at end of file +var _0xcec6=['ENUM','newTab','integrationTab','sequelize','STRING','basic'];(function(_0xcb8a7,_0x20193a){var _0x49bbf6=function(_0x2c991a){while(--_0x2c991a){_0xcb8a7['push'](_0xcb8a7['shift']());}};_0x49bbf6(++_0x20193a);}(_0xcec6,0xa5));var _0x6cec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcec6[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x6cec('0x0'));module['exports']={'name':{'type':Sequelize[_0x6cec('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0x6cec('0x2')),'defaultValue':_0x6cec('0x2')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x6cec('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x6cec('0x1')]},'serverUrl':{'type':Sequelize[_0x6cec('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x6cec('0x3')]('integrationTab',_0x6cec('0x4')),'defaultValue':_0x6cec('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 1796f00..a2ca199 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 _0xfc28=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','DeskAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','keys','find','create','body','update','getConfigurations','findOne','sort','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','priority','remoteUri','authType','username','password','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse'];(function(_0x38fb20,_0x22492e){var _0x4ddc44=function(_0x50224c){while(--_0x50224c){_0x38fb20['push'](_0x38fb20['shift']());}};_0x4ddc44(++_0x22492e);}(_0xfc28,0xd2));var _0x8fc2=function(_0x5d15e4,_0x121aba){_0x5d15e4=_0x5d15e4-0x0;var _0x428593=_0xfc28[_0x5d15e4];return _0x428593;};'use strict';var emlformat=require(_0x8fc2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8fc2('0x1'));var jsonpatch=require(_0x8fc2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8fc2('0x3'));var Mustache=require(_0x8fc2('0x4'));var util=require(_0x8fc2('0x5'));var path=require('path');var sox=require(_0x8fc2('0x6'));var csv=require(_0x8fc2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8fc2('0x8'));var _=require(_0x8fc2('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8fc2('0xa'));var deskjs=require(_0x8fc2('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8fc2('0xc'));var Papa=require(_0x8fc2('0xd'));var Redis=require(_0x8fc2('0xe'));var authService=require(_0x8fc2('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8fc2('0x10'));var hardwareService=require(_0x8fc2('0x11'));var logger=require(_0x8fc2('0x12'))(_0x8fc2('0x13'));var utils=require(_0x8fc2('0x14'));var config=require(_0x8fc2('0x15'));var licenseUtil=require(_0x8fc2('0x16'));var db=require(_0x8fc2('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x49f745,_0x15a589){_0x15a589=_0x15a589||0xcc;return function(_0x17e4f0){if(_0x17e4f0){return _0x49f745[_0x8fc2('0x18')](_0x15a589);}return _0x49f745[_0x8fc2('0x19')](_0x15a589)['end']();};}function respondWithResult(_0x231bdd,_0x396feb){_0x396feb=_0x396feb||0xc8;return function(_0xfd119c){if(_0xfd119c){return _0x231bdd[_0x8fc2('0x19')](_0x396feb)['json'](_0xfd119c);}};}function respondWithFilteredResult(_0x5bc268,_0x3aa715){return function(_0x518c0e){if(_0x518c0e){var _0x994875=typeof _0x3aa715['offset']===_0x8fc2('0x1a')&&typeof _0x3aa715[_0x8fc2('0x1b')]===_0x8fc2('0x1a');var _0x360702=_0x518c0e['count'];var _0xa126a8=_0x994875?0x0:_0x3aa715['offset'];var _0x9cc210=_0x994875?_0x518c0e['count']:_0x3aa715[_0x8fc2('0x1c')]+_0x3aa715[_0x8fc2('0x1b')];var _0x57ba0f;if(_0x9cc210>=_0x360702){_0x9cc210=_0x360702;_0x57ba0f=0xc8;}else{_0x57ba0f=0xce;}_0x5bc268[_0x8fc2('0x19')](_0x57ba0f);return _0x5bc268[_0x8fc2('0x1d')](_0x8fc2('0x1e'),_0xa126a8+'-'+_0x9cc210+'/'+_0x360702)['json'](_0x518c0e);}return null;};}function patchUpdates(_0x109135){return function(_0x370c4e){try{jsonpatch['apply'](_0x370c4e,_0x109135,!![]);}catch(_0x7c6d8f){return BPromise[_0x8fc2('0x1f')](_0x7c6d8f);}return _0x370c4e[_0x8fc2('0x20')]();};}function saveUpdates(_0x833039,_0x471396){return function(_0x3fbd1b){if(_0x3fbd1b){return _0x3fbd1b['update'](_0x833039)[_0x8fc2('0x21')](function(_0x195317){return _0x195317;});}return null;};}function removeEntity(_0x638d06,_0x2917f4){return function(_0x5aaf8e){if(_0x5aaf8e){return _0x5aaf8e[_0x8fc2('0x22')]()[_0x8fc2('0x21')](function(){_0x638d06['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x156961,_0x51ed47){return function(_0x483add){if(!_0x483add){_0x156961['sendStatus'](0x194);}return _0x483add;};}function handleError(_0x44e721,_0xd425aa){_0xd425aa=_0xd425aa||0x1f4;return function(_0x4efee8){logger[_0x8fc2('0x23')](_0x4efee8[_0x8fc2('0x24')]);if(_0x4efee8[_0x8fc2('0x25')]){delete _0x4efee8[_0x8fc2('0x25')];}_0x44e721[_0x8fc2('0x19')](_0xd425aa)[_0x8fc2('0x26')](_0x4efee8);};}exports[_0x8fc2('0x27')]=function(_0xa720b2,_0x138771){var _0xf98e74={},_0x7a1b78={},_0x5b4491={'count':0x0,'rows':[]};var _0x2b09d6=_['map'](db[_0x8fc2('0x28')][_0x8fc2('0x29')],function(_0x5a85fe){return{'name':_0x5a85fe[_0x8fc2('0x2a')],'type':_0x5a85fe[_0x8fc2('0x2b')][_0x8fc2('0x2c')]};});_0x7a1b78[_0x8fc2('0x2d')]=_[_0x8fc2('0x2e')](_0x2b09d6,_0x8fc2('0x25'));_0x7a1b78[_0x8fc2('0x2f')]=_['keys'](_0xa720b2['query']);_0x7a1b78[_0x8fc2('0x30')]=_[_0x8fc2('0x31')](_0x7a1b78[_0x8fc2('0x2d')],_0x7a1b78['query']);_0xf98e74[_0x8fc2('0x32')]=_[_0x8fc2('0x31')](_0x7a1b78[_0x8fc2('0x2d')],qs['fields'](_0xa720b2['query'][_0x8fc2('0x33')]));_0xf98e74[_0x8fc2('0x32')]=_0xf98e74[_0x8fc2('0x32')][_0x8fc2('0x34')]?_0xf98e74[_0x8fc2('0x32')]:_0x7a1b78[_0x8fc2('0x2d')];if(!_0xa720b2['query'][_0x8fc2('0x35')]('nolimit')){_0xf98e74[_0x8fc2('0x1b')]=qs['limit'](_0xa720b2[_0x8fc2('0x2f')][_0x8fc2('0x1b')]);_0xf98e74[_0x8fc2('0x1c')]=qs['offset'](_0xa720b2[_0x8fc2('0x2f')][_0x8fc2('0x1c')]);}_0xf98e74['order']=qs['sort'](_0xa720b2[_0x8fc2('0x2f')]['sort']);_0xf98e74['where']=qs[_0x8fc2('0x30')](_[_0x8fc2('0x36')](_0xa720b2['query'],_0x7a1b78[_0x8fc2('0x30')]),_0x2b09d6);if(_0xa720b2[_0x8fc2('0x2f')][_0x8fc2('0x37')]){_0xf98e74[_0x8fc2('0x38')]=_[_0x8fc2('0x39')](_0xf98e74['where'],{'$or':_[_0x8fc2('0x2e')](_0x2b09d6,function(_0x3631db){if(_0x3631db[_0x8fc2('0x2b')]!==_0x8fc2('0x3a')){var _0x1705e0={};_0x1705e0[_0x3631db[_0x8fc2('0x25')]]={'$like':'%'+_0xa720b2[_0x8fc2('0x2f')][_0x8fc2('0x37')]+'%'};return _0x1705e0;}})});}_0xf98e74=_[_0x8fc2('0x39')]({},_0xf98e74,_0xa720b2[_0x8fc2('0x3b')]);var _0x553754={'where':_0xf98e74[_0x8fc2('0x38')]};return db[_0x8fc2('0x28')][_0x8fc2('0x3c')](_0x553754)[_0x8fc2('0x21')](function(_0x59fe49){_0x5b4491[_0x8fc2('0x3c')]=_0x59fe49;if(_0xa720b2['query'][_0x8fc2('0x3d')]){_0xf98e74[_0x8fc2('0x3e')]=[{'all':!![]}];}return db[_0x8fc2('0x28')][_0x8fc2('0x3f')](_0xf98e74);})['then'](function(_0x400f03){_0x5b4491['rows']=_0x400f03;return _0x5b4491;})[_0x8fc2('0x21')](respondWithFilteredResult(_0x138771,_0xf98e74))[_0x8fc2('0x40')](handleError(_0x138771,null));};exports[_0x8fc2('0x41')]=function(_0x11d730,_0x390ae4){var _0x4e631b={'raw':![],'where':{'id':_0x11d730[_0x8fc2('0x42')]['id']}},_0x3f4c81={};_0x3f4c81[_0x8fc2('0x2d')]=_[_0x8fc2('0x43')](db[_0x8fc2('0x28')][_0x8fc2('0x29')]);_0x3f4c81[_0x8fc2('0x2f')]=_[_0x8fc2('0x43')](_0x11d730[_0x8fc2('0x2f')]);_0x3f4c81['filters']=_[_0x8fc2('0x31')](_0x3f4c81['model'],_0x3f4c81[_0x8fc2('0x2f')]);_0x4e631b[_0x8fc2('0x32')]=_[_0x8fc2('0x31')](_0x3f4c81[_0x8fc2('0x2d')],qs[_0x8fc2('0x33')](_0x11d730[_0x8fc2('0x2f')][_0x8fc2('0x33')]));_0x4e631b['attributes']=_0x4e631b[_0x8fc2('0x32')]['length']?_0x4e631b['attributes']:_0x3f4c81['model'];if(_0x11d730['query'][_0x8fc2('0x3d')]){_0x4e631b[_0x8fc2('0x3e')]=[{'all':!![]}];}_0x4e631b=_[_0x8fc2('0x39')]({},_0x4e631b,_0x11d730['options']);return db[_0x8fc2('0x28')][_0x8fc2('0x44')](_0x4e631b)['then'](handleEntityNotFound(_0x390ae4,null))[_0x8fc2('0x21')](respondWithResult(_0x390ae4,null))[_0x8fc2('0x40')](handleError(_0x390ae4,null));};exports[_0x8fc2('0x45')]=function(_0x10ce05,_0x3268fd){return db[_0x8fc2('0x28')][_0x8fc2('0x45')](_0x10ce05[_0x8fc2('0x46')],{})['then'](respondWithResult(_0x3268fd,0xc9))['catch'](handleError(_0x3268fd,null));};exports[_0x8fc2('0x47')]=function(_0xe8b48a,_0x454a65){if(_0xe8b48a[_0x8fc2('0x46')]['id']){delete _0xe8b48a[_0x8fc2('0x46')]['id'];}return db[_0x8fc2('0x28')][_0x8fc2('0x44')]({'where':{'id':_0xe8b48a['params']['id']}})['then'](handleEntityNotFound(_0x454a65,null))[_0x8fc2('0x21')](saveUpdates(_0xe8b48a[_0x8fc2('0x46')],null))['then'](respondWithResult(_0x454a65,null))['catch'](handleError(_0x454a65,null));};exports[_0x8fc2('0x22')]=function(_0x41ba87,_0x2f6771){return db[_0x8fc2('0x28')]['find']({'where':{'id':_0x41ba87[_0x8fc2('0x42')]['id']}})[_0x8fc2('0x21')](handleEntityNotFound(_0x2f6771,null))['then'](removeEntity(_0x2f6771,null))['catch'](handleError(_0x2f6771,null));};exports[_0x8fc2('0x48')]=function(_0x10b8c,_0x4e8fff,_0x103d1a){var _0x52d436={};var _0x43c63d={};var _0x1e6f4c;var _0x239d88;return db[_0x8fc2('0x28')][_0x8fc2('0x49')]({'where':{'id':_0x10b8c[_0x8fc2('0x42')]['id']}})[_0x8fc2('0x21')](handleEntityNotFound(_0x4e8fff,null))[_0x8fc2('0x21')](function(_0x1d05d7){if(_0x1d05d7){_0x1e6f4c=_0x1d05d7;_0x43c63d[_0x8fc2('0x2d')]=_['keys'](db['DeskConfiguration']['rawAttributes']);_0x43c63d[_0x8fc2('0x2f')]=_[_0x8fc2('0x43')](_0x10b8c[_0x8fc2('0x2f')]);_0x43c63d[_0x8fc2('0x30')]=_[_0x8fc2('0x31')](_0x43c63d['model'],_0x43c63d['query']);_0x52d436['attributes']=_[_0x8fc2('0x31')](_0x43c63d[_0x8fc2('0x2d')],qs[_0x8fc2('0x33')](_0x10b8c[_0x8fc2('0x2f')][_0x8fc2('0x33')]));_0x52d436[_0x8fc2('0x32')]=_0x52d436['attributes'][_0x8fc2('0x34')]?_0x52d436[_0x8fc2('0x32')]:_0x43c63d[_0x8fc2('0x2d')];_0x52d436['order']=qs[_0x8fc2('0x4a')](_0x10b8c[_0x8fc2('0x2f')]['sort']);_0x52d436[_0x8fc2('0x38')]=qs[_0x8fc2('0x30')](_[_0x8fc2('0x36')](_0x10b8c[_0x8fc2('0x2f')],_0x43c63d[_0x8fc2('0x30')]));if(_0x10b8c[_0x8fc2('0x2f')][_0x8fc2('0x37')]){_0x52d436[_0x8fc2('0x38')]=_[_0x8fc2('0x39')](_0x52d436['where'],{'$or':_['map'](_0x52d436[_0x8fc2('0x32')],function(_0x4b4970){var _0x2aabea={};_0x2aabea[_0x4b4970]={'$like':'%'+_0x10b8c[_0x8fc2('0x2f')][_0x8fc2('0x37')]+'%'};return _0x2aabea;})});}_0x52d436=_[_0x8fc2('0x39')]({},_0x52d436,_0x10b8c[_0x8fc2('0x3b')]);return _0x1e6f4c['getConfigurations'](_0x52d436);}})[_0x8fc2('0x21')](function(_0x26e66e){if(_0x26e66e){_0x239d88=_0x26e66e['length'];if(!_0x10b8c['query'][_0x8fc2('0x35')]('nolimit')){_0x52d436[_0x8fc2('0x1b')]=qs['limit'](_0x10b8c[_0x8fc2('0x2f')][_0x8fc2('0x1b')]);_0x52d436[_0x8fc2('0x1c')]=qs[_0x8fc2('0x1c')](_0x10b8c[_0x8fc2('0x2f')][_0x8fc2('0x1c')]);}return _0x1e6f4c[_0x8fc2('0x48')](_0x52d436);}})[_0x8fc2('0x21')](function(_0x29be06){if(_0x29be06){return _0x29be06?{'count':_0x239d88,'rows':_0x29be06}:null;}})['then'](respondWithResult(_0x4e8fff,null))['catch'](handleError(_0x4e8fff,null));};exports[_0x8fc2('0x4b')]=function(_0x4ac04b,_0x4ec632,_0x8ae769){if(_0x4ac04b[_0x8fc2('0x46')]['id']){delete _0x4ac04b[_0x8fc2('0x46')]['id'];}return db[_0x8fc2('0x28')][_0x8fc2('0x49')]({'where':{'id':_0x4ac04b[_0x8fc2('0x42')]['id']}})[_0x8fc2('0x21')](handleEntityNotFound(_0x4ec632,null))[_0x8fc2('0x21')](function(_0x11ed86){if(_0x11ed86){_0x4ac04b[_0x8fc2('0x46')][_0x8fc2('0x4c')]=_0x11ed86['id'];_0x4ac04b[_0x8fc2('0x46')][_0x8fc2('0x4d')]=integrations[_0x8fc2('0x4e')](_0x4ac04b[_0x8fc2('0x46')][_0x8fc2('0x4f')],_0x4ac04b[_0x8fc2('0x46')]['type']);_0x4ac04b['body'][_0x8fc2('0x50')]=integrations['getDescriptions'](_0x4ac04b[_0x8fc2('0x46')][_0x8fc2('0x4f')],_0x4ac04b[_0x8fc2('0x46')][_0x8fc2('0x2b')]);return db['DeskConfiguration'][_0x8fc2('0x45')](_0x4ac04b[_0x8fc2('0x46')],{'include':[{'model':db['DeskField'],'as':_0x8fc2('0x4d')},{'model':db[_0x8fc2('0x51')],'as':_0x8fc2('0x50')}]});}return null;})[_0x8fc2('0x21')](respondWithResult(_0x4ec632,null))['catch'](handleError(_0x4ec632,null));};exports['getFields']=function(_0x2f5adc,_0x310c33,_0x34bce1){var _0x1533cb=[{'name':_0x8fc2('0x52'),'label':_0x8fc2('0x52'),'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 _0x149e25='';return db[_0x8fc2('0x28')]['findOne']({'where':{'id':_0x2f5adc[_0x8fc2('0x42')]['id']},'attributes':['id',_0x8fc2('0x53'),_0x8fc2('0x54'),_0x8fc2('0x55'),_0x8fc2('0x56'),'consumerKey','consumerSecret',_0x8fc2('0x57'),_0x8fc2('0x58')]})['then'](handleEntityNotFound(_0x310c33,null))[_0x8fc2('0x21')](function(_0x410199){if(_0x410199){_0x149e25=_0x410199[_0x8fc2('0x53')];var _0x4095e4=_0x149e25[_0x8fc2('0x59')](-0x1);if(_0x4095e4==='/'){_0x149e25=_0x149e25[_0x8fc2('0x5a')](0x0,_0x149e25[_0x8fc2('0x5b')](_0x4095e4));}var _0x1916e5={'method':_0x8fc2('0x5c'),'uri':util[_0x8fc2('0x5d')](_0x8fc2('0x5e'),_0x149e25),'headers':{'Content-Type':'application/json','Accept':_0x8fc2('0x5f')},'json':!![]};if(_0x410199['authType']===_0x8fc2('0x60')){_0x1916e5[_0x8fc2('0x61')][_0x8fc2('0x62')]=util[_0x8fc2('0x5d')](_0x8fc2('0x63'),new Buffer(util[_0x8fc2('0x5d')](_0x8fc2('0x64'),_0x410199['username'],_0x410199[_0x8fc2('0x56')]))[_0x8fc2('0x65')](_0x8fc2('0x66')));}return rp(_0x1916e5)['then'](function(_0x4d2d89){return _0x1533cb[_0x8fc2('0x67')](_[_0x8fc2('0x2e')](_0x4d2d89[_0x8fc2('0x68')][_0x8fc2('0x69')],function(_0x126b37){return{'id':_0x126b37[_0x8fc2('0x25')],'name':_0x126b37[_0x8fc2('0x25')],'type':_0x126b37['type'],'active':_0x126b37[_0x8fc2('0x6a')],'label':_0x126b37[_0x8fc2('0x6b')],'custom':!![]};}));});}})['then'](function(_0x326f0f){return{'count':_0x326f0f[_0x8fc2('0x34')],'rows':_0x326f0f};})[_0x8fc2('0x21')](respondWithResult(_0x310c33,null))[_0x8fc2('0x40')](function(_0x2a30f2){var _0x49381a=_0x2f5adc['query'][_0x8fc2('0x6c')]?0x1f4:_0x2a30f2['statusCode']||0x1f4;logger[_0x8fc2('0x23')](_0x8fc2('0x6d'),'getFields',_0x49381a,JSON[_0x8fc2('0x6e')](_0x2a30f2));delete _0x2a30f2[_0x8fc2('0x25')];if(_0x49381a===0x191){_0x49381a=0x190;}_0x310c33['status'](_0x49381a)[_0x8fc2('0x26')](_0x2f5adc[_0x8fc2('0x2f')][_0x8fc2('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x2a30f2[_0x8fc2('0x6f')]}:_0x2a30f2);});}; \ No newline at end of file +var _0xe36c=['Content-Range','update','then','destroy','end','error','stack','name','send','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','options','includeAll','include','catch','show','params','find','create','body','getConfigurations','findOne','order','filter','Subjects','channel','Descriptions','getDescriptions','DeskField','priority','authType','password','consumerKey','consumerSecret','tokenSecret','remoteUri','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','toString','concat','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set'];(function(_0x2434aa,_0x54c84c){var _0x14465f=function(_0x48e7f){while(--_0x48e7f){_0x2434aa['push'](_0x2434aa['shift']());}};_0x14465f(++_0x54c84c);}(_0xe36c,0xaf));var _0xce36=function(_0x2bd3ea,_0x320a44){_0x2bd3ea=_0x2bd3ea-0x0;var _0x3f60de=_0xe36c[_0x2bd3ea];return _0x3f60de;};'use strict';var emlformat=require(_0xce36('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xce36('0x1'));var jsonpatch=require(_0xce36('0x2'));var rp=require('request-promise');var moment=require(_0xce36('0x3'));var BPromise=require(_0xce36('0x4'));var Mustache=require(_0xce36('0x5'));var util=require('util');var path=require(_0xce36('0x6'));var sox=require(_0xce36('0x7'));var csv=require(_0xce36('0x8'));var ejs=require(_0xce36('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce36('0xa'));var squel=require('squel');var crypto=require(_0xce36('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xce36('0x8'));var querystring=require('querystring');var Papa=require(_0xce36('0xc'));var Redis=require('ioredis');var authService=require(_0xce36('0xd'));var qs=require(_0xce36('0xe'));var as=require(_0xce36('0xf'));var hardwareService=require(_0xce36('0x10'));var logger=require(_0xce36('0x11'))(_0xce36('0x12'));var utils=require(_0xce36('0x13'));var config=require(_0xce36('0x14'));var licenseUtil=require(_0xce36('0x15'));var db=require(_0xce36('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x370b72,_0x59ccee){_0x59ccee=_0x59ccee||0xcc;return function(_0x4effa1){if(_0x4effa1){return _0x370b72[_0xce36('0x17')](_0x59ccee);}return _0x370b72[_0xce36('0x18')](_0x59ccee)['end']();};}function respondWithResult(_0x384a86,_0x2528f3){_0x2528f3=_0x2528f3||0xc8;return function(_0x3990fa){if(_0x3990fa){return _0x384a86[_0xce36('0x18')](_0x2528f3)[_0xce36('0x19')](_0x3990fa);}};}function respondWithFilteredResult(_0x10ca14,_0x298f7d){return function(_0x48c3ed){if(_0x48c3ed){var _0x15bd0d=typeof _0x298f7d['offset']==='undefined'&&typeof _0x298f7d[_0xce36('0x1a')]===_0xce36('0x1b');var _0x3e09eb=_0x48c3ed[_0xce36('0x1c')];var _0x3facc8=_0x15bd0d?0x0:_0x298f7d[_0xce36('0x1d')];var _0x2df75c=_0x15bd0d?_0x48c3ed[_0xce36('0x1c')]:_0x298f7d['offset']+_0x298f7d[_0xce36('0x1a')];var _0x2bf061;if(_0x2df75c>=_0x3e09eb){_0x2df75c=_0x3e09eb;_0x2bf061=0xc8;}else{_0x2bf061=0xce;}_0x10ca14[_0xce36('0x18')](_0x2bf061);return _0x10ca14[_0xce36('0x1e')](_0xce36('0x1f'),_0x3facc8+'-'+_0x2df75c+'/'+_0x3e09eb)[_0xce36('0x19')](_0x48c3ed);}return null;};}function patchUpdates(_0x3d4584){return function(_0x2a1580){try{jsonpatch['apply'](_0x2a1580,_0x3d4584,!![]);}catch(_0x27f2da){return BPromise['reject'](_0x27f2da);}return _0x2a1580['save']();};}function saveUpdates(_0x468c07,_0xa3db2){return function(_0x5b7a17){if(_0x5b7a17){return _0x5b7a17[_0xce36('0x20')](_0x468c07)[_0xce36('0x21')](function(_0x246028){return _0x246028;});}return null;};}function removeEntity(_0xff96ec,_0x14bdaa){return function(_0x29794c){if(_0x29794c){return _0x29794c[_0xce36('0x22')]()[_0xce36('0x21')](function(){_0xff96ec[_0xce36('0x18')](0xcc)[_0xce36('0x23')]();});}};}function handleEntityNotFound(_0x2523cc,_0x38732d){return function(_0x491fd4){if(!_0x491fd4){_0x2523cc[_0xce36('0x17')](0x194);}return _0x491fd4;};}function handleError(_0x5d0e76,_0x1e2ea1){_0x1e2ea1=_0x1e2ea1||0x1f4;return function(_0x39c425){logger[_0xce36('0x24')](_0x39c425[_0xce36('0x25')]);if(_0x39c425[_0xce36('0x26')]){delete _0x39c425[_0xce36('0x26')];}_0x5d0e76[_0xce36('0x18')](_0x1e2ea1)[_0xce36('0x27')](_0x39c425);};}exports['index']=function(_0x3582ce,_0x57940e){var _0x2fb9e7={},_0x5318eb={},_0x196c37={'count':0x0,'rows':[]};var _0x5a7329=_[_0xce36('0x28')](db[_0xce36('0x29')][_0xce36('0x2a')],function(_0x1129d5){return{'name':_0x1129d5[_0xce36('0x2b')],'type':_0x1129d5[_0xce36('0x2c')][_0xce36('0x2d')]};});_0x5318eb[_0xce36('0x2e')]=_[_0xce36('0x28')](_0x5a7329,_0xce36('0x26'));_0x5318eb[_0xce36('0x2f')]=_[_0xce36('0x30')](_0x3582ce[_0xce36('0x2f')]);_0x5318eb[_0xce36('0x31')]=_[_0xce36('0x32')](_0x5318eb[_0xce36('0x2e')],_0x5318eb['query']);_0x2fb9e7[_0xce36('0x33')]=_[_0xce36('0x32')](_0x5318eb[_0xce36('0x2e')],qs['fields'](_0x3582ce['query'][_0xce36('0x34')]));_0x2fb9e7['attributes']=_0x2fb9e7[_0xce36('0x33')][_0xce36('0x35')]?_0x2fb9e7[_0xce36('0x33')]:_0x5318eb[_0xce36('0x2e')];if(!_0x3582ce[_0xce36('0x2f')][_0xce36('0x36')](_0xce36('0x37'))){_0x2fb9e7[_0xce36('0x1a')]=qs['limit'](_0x3582ce['query'][_0xce36('0x1a')]);_0x2fb9e7[_0xce36('0x1d')]=qs[_0xce36('0x1d')](_0x3582ce['query'][_0xce36('0x1d')]);}_0x2fb9e7['order']=qs[_0xce36('0x38')](_0x3582ce[_0xce36('0x2f')][_0xce36('0x38')]);_0x2fb9e7[_0xce36('0x39')]=qs[_0xce36('0x31')](_[_0xce36('0x3a')](_0x3582ce[_0xce36('0x2f')],_0x5318eb[_0xce36('0x31')]),_0x5a7329);if(_0x3582ce[_0xce36('0x2f')]['filter']){_0x2fb9e7[_0xce36('0x39')]=_['merge'](_0x2fb9e7[_0xce36('0x39')],{'$or':_[_0xce36('0x28')](_0x5a7329,function(_0x363fdf){if(_0x363fdf['type']!=='VIRTUAL'){var _0x1d90af={};_0x1d90af[_0x363fdf[_0xce36('0x26')]]={'$like':'%'+_0x3582ce[_0xce36('0x2f')]['filter']+'%'};return _0x1d90af;}})});}_0x2fb9e7=_[_0xce36('0x3b')]({},_0x2fb9e7,_0x3582ce[_0xce36('0x3c')]);var _0x44541e={'where':_0x2fb9e7[_0xce36('0x39')]};return db['DeskAccount'][_0xce36('0x1c')](_0x44541e)[_0xce36('0x21')](function(_0xb823d6){_0x196c37['count']=_0xb823d6;if(_0x3582ce[_0xce36('0x2f')][_0xce36('0x3d')]){_0x2fb9e7[_0xce36('0x3e')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x2fb9e7);})[_0xce36('0x21')](function(_0xcad58e){_0x196c37['rows']=_0xcad58e;return _0x196c37;})[_0xce36('0x21')](respondWithFilteredResult(_0x57940e,_0x2fb9e7))[_0xce36('0x3f')](handleError(_0x57940e,null));};exports[_0xce36('0x40')]=function(_0x9bb7e0,_0x116eca){var _0x5d66cd={'raw':![],'where':{'id':_0x9bb7e0[_0xce36('0x41')]['id']}},_0x48b21a={};_0x48b21a['model']=_[_0xce36('0x30')](db['DeskAccount'][_0xce36('0x2a')]);_0x48b21a[_0xce36('0x2f')]=_[_0xce36('0x30')](_0x9bb7e0[_0xce36('0x2f')]);_0x48b21a[_0xce36('0x31')]=_[_0xce36('0x32')](_0x48b21a[_0xce36('0x2e')],_0x48b21a['query']);_0x5d66cd[_0xce36('0x33')]=_[_0xce36('0x32')](_0x48b21a['model'],qs[_0xce36('0x34')](_0x9bb7e0['query'][_0xce36('0x34')]));_0x5d66cd[_0xce36('0x33')]=_0x5d66cd[_0xce36('0x33')][_0xce36('0x35')]?_0x5d66cd[_0xce36('0x33')]:_0x48b21a['model'];if(_0x9bb7e0[_0xce36('0x2f')][_0xce36('0x3d')]){_0x5d66cd['include']=[{'all':!![]}];}_0x5d66cd=_[_0xce36('0x3b')]({},_0x5d66cd,_0x9bb7e0[_0xce36('0x3c')]);return db[_0xce36('0x29')][_0xce36('0x42')](_0x5d66cd)[_0xce36('0x21')](handleEntityNotFound(_0x116eca,null))[_0xce36('0x21')](respondWithResult(_0x116eca,null))[_0xce36('0x3f')](handleError(_0x116eca,null));};exports[_0xce36('0x43')]=function(_0x4dff27,_0x1019cf){return db['DeskAccount'][_0xce36('0x43')](_0x4dff27[_0xce36('0x44')],{})['then'](respondWithResult(_0x1019cf,0xc9))[_0xce36('0x3f')](handleError(_0x1019cf,null));};exports[_0xce36('0x20')]=function(_0x2c6610,_0x44033a){if(_0x2c6610[_0xce36('0x44')]['id']){delete _0x2c6610[_0xce36('0x44')]['id'];}return db['DeskAccount'][_0xce36('0x42')]({'where':{'id':_0x2c6610[_0xce36('0x41')]['id']}})[_0xce36('0x21')](handleEntityNotFound(_0x44033a,null))[_0xce36('0x21')](saveUpdates(_0x2c6610[_0xce36('0x44')],null))[_0xce36('0x21')](respondWithResult(_0x44033a,null))[_0xce36('0x3f')](handleError(_0x44033a,null));};exports[_0xce36('0x22')]=function(_0x461be0,_0x539409){return db[_0xce36('0x29')]['find']({'where':{'id':_0x461be0['params']['id']}})[_0xce36('0x21')](handleEntityNotFound(_0x539409,null))[_0xce36('0x21')](removeEntity(_0x539409,null))[_0xce36('0x3f')](handleError(_0x539409,null));};exports[_0xce36('0x45')]=function(_0x74c36,_0x47fdeb,_0x43d5da){var _0x331a1b={};var _0xe72291={};var _0x34fe64;var _0x89465;return db[_0xce36('0x29')][_0xce36('0x46')]({'where':{'id':_0x74c36[_0xce36('0x41')]['id']}})['then'](handleEntityNotFound(_0x47fdeb,null))[_0xce36('0x21')](function(_0x3c7939){if(_0x3c7939){_0x34fe64=_0x3c7939;_0xe72291['model']=_[_0xce36('0x30')](db['DeskConfiguration'][_0xce36('0x2a')]);_0xe72291['query']=_[_0xce36('0x30')](_0x74c36[_0xce36('0x2f')]);_0xe72291['filters']=_[_0xce36('0x32')](_0xe72291['model'],_0xe72291[_0xce36('0x2f')]);_0x331a1b[_0xce36('0x33')]=_[_0xce36('0x32')](_0xe72291[_0xce36('0x2e')],qs['fields'](_0x74c36[_0xce36('0x2f')][_0xce36('0x34')]));_0x331a1b[_0xce36('0x33')]=_0x331a1b['attributes'][_0xce36('0x35')]?_0x331a1b[_0xce36('0x33')]:_0xe72291[_0xce36('0x2e')];_0x331a1b[_0xce36('0x47')]=qs[_0xce36('0x38')](_0x74c36[_0xce36('0x2f')]['sort']);_0x331a1b[_0xce36('0x39')]=qs[_0xce36('0x31')](_[_0xce36('0x3a')](_0x74c36[_0xce36('0x2f')],_0xe72291['filters']));if(_0x74c36['query'][_0xce36('0x48')]){_0x331a1b[_0xce36('0x39')]=_[_0xce36('0x3b')](_0x331a1b['where'],{'$or':_[_0xce36('0x28')](_0x331a1b[_0xce36('0x33')],function(_0x389f5e){var _0x961d3e={};_0x961d3e[_0x389f5e]={'$like':'%'+_0x74c36['query'][_0xce36('0x48')]+'%'};return _0x961d3e;})});}_0x331a1b=_['merge']({},_0x331a1b,_0x74c36[_0xce36('0x3c')]);return _0x34fe64[_0xce36('0x45')](_0x331a1b);}})[_0xce36('0x21')](function(_0x28b2e2){if(_0x28b2e2){_0x89465=_0x28b2e2[_0xce36('0x35')];if(!_0x74c36[_0xce36('0x2f')][_0xce36('0x36')](_0xce36('0x37'))){_0x331a1b[_0xce36('0x1a')]=qs[_0xce36('0x1a')](_0x74c36['query'][_0xce36('0x1a')]);_0x331a1b[_0xce36('0x1d')]=qs[_0xce36('0x1d')](_0x74c36[_0xce36('0x2f')]['offset']);}return _0x34fe64[_0xce36('0x45')](_0x331a1b);}})[_0xce36('0x21')](function(_0x5b0b99){if(_0x5b0b99){return _0x5b0b99?{'count':_0x89465,'rows':_0x5b0b99}:null;}})[_0xce36('0x21')](respondWithResult(_0x47fdeb,null))[_0xce36('0x3f')](handleError(_0x47fdeb,null));};exports['addConfiguration']=function(_0x3b5e25,_0x1184ba,_0xee7dc5){if(_0x3b5e25['body']['id']){delete _0x3b5e25[_0xce36('0x44')]['id'];}return db[_0xce36('0x29')]['findOne']({'where':{'id':_0x3b5e25[_0xce36('0x41')]['id']}})[_0xce36('0x21')](handleEntityNotFound(_0x1184ba,null))[_0xce36('0x21')](function(_0x2adf96){if(_0x2adf96){_0x3b5e25[_0xce36('0x44')]['AccountId']=_0x2adf96['id'];_0x3b5e25[_0xce36('0x44')][_0xce36('0x49')]=integrations['getSubjects'](_0x3b5e25['body'][_0xce36('0x4a')],_0x3b5e25[_0xce36('0x44')]['type']);_0x3b5e25[_0xce36('0x44')][_0xce36('0x4b')]=integrations[_0xce36('0x4c')](_0x3b5e25['body'][_0xce36('0x4a')],_0x3b5e25[_0xce36('0x44')]['type']);return db['DeskConfiguration'][_0xce36('0x43')](_0x3b5e25[_0xce36('0x44')],{'include':[{'model':db['DeskField'],'as':_0xce36('0x49')},{'model':db[_0xce36('0x4d')],'as':_0xce36('0x4b')}]});}return null;})['then'](respondWithResult(_0x1184ba,null))[_0xce36('0x3f')](handleError(_0x1184ba,null));};exports['getFields']=function(_0x3a9af1,_0x27310f,_0x5e4e54){var _0x5ad93e=[{'name':'priority','label':_0xce36('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 _0x38fa46='';return db[_0xce36('0x29')][_0xce36('0x46')]({'where':{'id':_0x3a9af1[_0xce36('0x41')]['id']},'attributes':['id','remoteUri',_0xce36('0x4f'),'username',_0xce36('0x50'),_0xce36('0x51'),_0xce36('0x52'),'token',_0xce36('0x53')]})[_0xce36('0x21')](handleEntityNotFound(_0x27310f,null))['then'](function(_0x42161c){if(_0x42161c){_0x38fa46=_0x42161c[_0xce36('0x54')];var _0x3f165f=_0x38fa46['slice'](-0x1);if(_0x3f165f==='/'){_0x38fa46=_0x38fa46[_0xce36('0x55')](0x0,_0x38fa46[_0xce36('0x56')](_0x3f165f));}var _0x300e43={'method':'GET','uri':util[_0xce36('0x57')](_0xce36('0x58'),_0x38fa46),'headers':{'Content-Type':_0xce36('0x59'),'Accept':_0xce36('0x59')},'json':!![]};if(_0x42161c[_0xce36('0x4f')]===_0xce36('0x5a')){_0x300e43[_0xce36('0x5b')]['Authorization']=util['format'](_0xce36('0x5c'),new Buffer(util['format']('%s:%s',_0x42161c['username'],_0x42161c[_0xce36('0x50')]))[_0xce36('0x5d')]('base64'));}return rp(_0x300e43)['then'](function(_0x589178){return _0x5ad93e[_0xce36('0x5e')](_[_0xce36('0x28')](_0x589178['_embedded'][_0xce36('0x5f')],function(_0x556520){return{'id':_0x556520[_0xce36('0x26')],'name':_0x556520['name'],'type':_0x556520[_0xce36('0x2c')],'active':_0x556520[_0xce36('0x60')],'label':_0x556520[_0xce36('0x61')],'custom':!![]};}));});}})[_0xce36('0x21')](function(_0x5103af){return{'count':_0x5103af[_0xce36('0x35')],'rows':_0x5103af};})[_0xce36('0x21')](respondWithResult(_0x27310f,null))[_0xce36('0x3f')](function(_0x1d0afb){var _0x266115=_0x3a9af1[_0xce36('0x2f')]['test']?0x1f4:_0x1d0afb[_0xce36('0x62')]||0x1f4;logger['error'](_0xce36('0x63'),_0xce36('0x64'),_0x266115,JSON['stringify'](_0x1d0afb));delete _0x1d0afb[_0xce36('0x26')];if(_0x266115===0x191){_0x266115=0x190;}_0x27310f[_0xce36('0x18')](_0x266115)[_0xce36('0x27')](_0x3a9af1[_0xce36('0x2f')][_0xce36('0x65')]?{'message':_0xce36('0x66'),'statusCode':_0x1d0afb[_0xce36('0x62')]}:_0x1d0afb);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 7542566..b4431ac 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 _0xfd43=['../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xfd43,0x1f1));var _0x3fd4=function(_0x326843,_0xaf93e3){_0x326843=_0x326843-0x0;var _0x5b0dd3=_0xfd43[_0x326843];return _0x5b0dd3;};'use strict';var _=require(_0x3fd4('0x0'));var util=require(_0x3fd4('0x1'));var logger=require(_0x3fd4('0x2'))(_0x3fd4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3fd4('0x4'));var fs=require('fs');var path=require(_0x3fd4('0x5'));var rimraf=require(_0x3fd4('0x6'));var config=require(_0x3fd4('0x7'));var attributes=require(_0x3fd4('0x8'));var integrations=require(_0x3fd4('0x9'));module[_0x3fd4('0xa')]=function(_0x127e31,_0x31fb53){return _0x127e31[_0x3fd4('0xb')](_0x3fd4('0xc'),attributes,{'tableName':_0x3fd4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ced=['int_desk_accounts','lodash','util','../../config/logger','bluebird','rimraf','./intDeskAccount.attributes','exports','define','DeskAccount'];(function(_0x111772,_0x1c4c6f){var _0x5bb616=function(_0x3d7276){while(--_0x3d7276){_0x111772['push'](_0x111772['shift']());}};_0x5bb616(++_0x1c4c6f);}(_0x0ced,0x155));var _0xd0ce=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x0ced[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0xd0ce('0x0'));var util=require(_0xd0ce('0x1'));var logger=require(_0xd0ce('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd0ce('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd0ce('0x4'));var config=require('../../config/environment');var attributes=require(_0xd0ce('0x5'));var integrations=require('../../components/integrations/configuration');module[_0xd0ce('0x6')]=function(_0x41f70a,_0xb6f9df){return _0x41f70a[_0xd0ce('0x7')](_0xd0ce('0x8'),attributes,{'tableName':_0xd0ce('0x9'),'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 999d2f7..2ac0945 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 _0xda35=['limit','include','map','model','GetDeskAccount','ShowDeskAccount','DeskAccount','find','raw','where','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','findAll','options','attributes'];(function(_0x4254b2,_0xb2764e){var _0x27678d=function(_0x34e900){while(--_0x34e900){_0x4254b2['push'](_0x4254b2['shift']());}};_0x27678d(++_0xb2764e);}(_0xda35,0xdc));var _0x5da3=function(_0x2d4a54,_0x1f759f){_0x2d4a54=_0x2d4a54-0x0;var _0x489a0f=_0xda35[_0x2d4a54];return _0x489a0f;};'use strict';var _=require(_0x5da3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5da3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5da3('0x2'));var db=require(_0x5da3('0x3'))['db'];var utils=require(_0x5da3('0x4'));var logger=require(_0x5da3('0x5'))(_0x5da3('0x6'));var config=require('../../config/environment');var jayson=require(_0x5da3('0x7'));var client=jayson[_0x5da3('0x8')][_0x5da3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f375d,_0x592715,_0x6eb0bb){return new BPromise(function(_0x486f0d,_0x52b8d8){return client[_0x5da3('0xa')](_0x5f375d,_0x6eb0bb)[_0x5da3('0xb')](function(_0x42c152){logger[_0x5da3('0xc')](_0x5da3('0xd'),_0x592715,'request\x20sent');logger[_0x5da3('0xe')](_0x5da3('0xf'),_0x592715,'request\x20sent',JSON[_0x5da3('0x10')](_0x42c152));if(_0x42c152[_0x5da3('0x11')]){if(_0x42c152[_0x5da3('0x11')]['code']===0x1f4){logger[_0x5da3('0x11')](_0x5da3('0xd'),_0x592715,_0x42c152['error'][_0x5da3('0x12')]);return _0x52b8d8(_0x42c152['error'][_0x5da3('0x12')]);}logger[_0x5da3('0x11')](_0x5da3('0xd'),_0x592715,_0x42c152[_0x5da3('0x11')]['message']);return _0x486f0d(_0x42c152[_0x5da3('0x11')][_0x5da3('0x12')]);}else{logger['info'](_0x5da3('0xd'),_0x592715,_0x5da3('0x13'));_0x486f0d(_0x42c152[_0x5da3('0x14')][_0x5da3('0x12')]);}})[_0x5da3('0x15')](function(_0x393377){logger[_0x5da3('0x11')]('DeskAccount,\x20%s,\x20%s',_0x592715,_0x393377);_0x52b8d8(_0x393377);});});}exports['GetDeskAccount']=function(_0x4dbf2c){var _0x5968c2=this;return new Promise(function(_0x175c18,_0x19af22){return db['DeskAccount'][_0x5da3('0x16')]({'raw':_0x4dbf2c['options']?_0x4dbf2c['options']['raw']===undefined?!![]:![]:!![],'where':_0x4dbf2c[_0x5da3('0x17')]?_0x4dbf2c['options']['where']||null:null,'attributes':_0x4dbf2c[_0x5da3('0x17')]?_0x4dbf2c[_0x5da3('0x17')][_0x5da3('0x18')]||null:null,'limit':_0x4dbf2c[_0x5da3('0x17')]?_0x4dbf2c[_0x5da3('0x17')][_0x5da3('0x19')]||null:null,'include':_0x4dbf2c[_0x5da3('0x17')]?_0x4dbf2c[_0x5da3('0x17')][_0x5da3('0x1a')]?_[_0x5da3('0x1b')](_0x4dbf2c[_0x5da3('0x17')][_0x5da3('0x1a')],function(_0x4edbbb){return{'model':db[_0x4edbbb[_0x5da3('0x1c')]],'as':_0x4edbbb['as'],'attributes':_0x4edbbb[_0x5da3('0x18')],'include':_0x4edbbb[_0x5da3('0x1a')]?_[_0x5da3('0x1b')](_0x4edbbb['include'],function(_0x52f0db){return{'model':db[_0x52f0db[_0x5da3('0x1c')]],'as':_0x52f0db['as'],'attributes':_0x52f0db[_0x5da3('0x18')],'include':_0x52f0db[_0x5da3('0x1a')]?_[_0x5da3('0x1b')](_0x52f0db[_0x5da3('0x1a')],function(_0x195447){return{'model':db[_0x195447['model']],'as':_0x195447['as'],'attributes':_0x195447[_0x5da3('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5da3('0xb')](function(_0x92c36d){logger[_0x5da3('0xc')]('GetDeskAccount',_0x4dbf2c);logger[_0x5da3('0xe')]('GetDeskAccount',_0x4dbf2c,JSON[_0x5da3('0x10')](_0x92c36d));_0x175c18(_0x92c36d);})[_0x5da3('0x15')](function(_0x4a8418){logger[_0x5da3('0x11')](_0x5da3('0x1d'),_0x4a8418['message'],_0x4dbf2c);_0x19af22(_0x5968c2[_0x5da3('0x11')](0x1f4,_0x4a8418[_0x5da3('0x12')]));});});};exports[_0x5da3('0x1e')]=function(_0x2296f1){var _0x30c9fd=this;return new Promise(function(_0x118ba7,_0x433d69){return db[_0x5da3('0x1f')][_0x5da3('0x20')]({'raw':_0x2296f1[_0x5da3('0x17')]?_0x2296f1[_0x5da3('0x17')][_0x5da3('0x21')]===undefined?!![]:![]:!![],'where':_0x2296f1['options']?_0x2296f1[_0x5da3('0x17')][_0x5da3('0x22')]||null:null,'attributes':_0x2296f1[_0x5da3('0x17')]?_0x2296f1['options'][_0x5da3('0x18')]||null:null,'include':_0x2296f1['options']?_0x2296f1[_0x5da3('0x17')][_0x5da3('0x1a')]?_[_0x5da3('0x1b')](_0x2296f1[_0x5da3('0x17')][_0x5da3('0x1a')],function(_0x4ac442){return{'model':db[_0x4ac442[_0x5da3('0x1c')]],'as':_0x4ac442['as'],'attributes':_0x4ac442[_0x5da3('0x18')],'include':_0x4ac442['include']?_[_0x5da3('0x1b')](_0x4ac442[_0x5da3('0x1a')],function(_0x2d991c){return{'model':db[_0x2d991c[_0x5da3('0x1c')]],'as':_0x2d991c['as'],'attributes':_0x2d991c[_0x5da3('0x18')],'include':_0x2d991c[_0x5da3('0x1a')]?_[_0x5da3('0x1b')](_0x2d991c[_0x5da3('0x1a')],function(_0x4a6265){return{'model':db[_0x4a6265[_0x5da3('0x1c')]],'as':_0x4a6265['as'],'attributes':_0x4a6265[_0x5da3('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5da3('0xb')](function(_0x5a071a){logger[_0x5da3('0xc')](_0x5da3('0x1e'),_0x2296f1);logger['debug'](_0x5da3('0x1e'),_0x2296f1,JSON[_0x5da3('0x10')](_0x5a071a));_0x118ba7(_0x5a071a);})[_0x5da3('0x15')](function(_0xeec179){logger[_0x5da3('0x11')](_0x5da3('0x1e'),_0xeec179[_0x5da3('0x12')],_0x2296f1);_0x433d69(_0x30c9fd[_0x5da3('0x11')](0x1f4,_0xeec179[_0x5da3('0x12')]));});});}; \ No newline at end of file +var _0xd28d=['request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDeskAccount','DeskAccount','findAll','options','limit','include','map','model','attributes','ShowDeskAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','DeskAccount,\x20%s,\x20%s'];(function(_0x2ac7f5,_0x50de11){var _0x55b44e=function(_0x37de21){while(--_0x37de21){_0x2ac7f5['push'](_0x2ac7f5['shift']());}};_0x55b44e(++_0x50de11);}(_0xd28d,0x75));var _0xdd28=function(_0x4c2a73,_0x2835cd){_0x4c2a73=_0x4c2a73-0x0;var _0x121267=_0xd28d[_0x4c2a73];return _0x121267;};'use strict';var _=require(_0xdd28('0x0'));var util=require(_0xdd28('0x1'));var moment=require(_0xdd28('0x2'));var BPromise=require('bluebird');var rs=require(_0xdd28('0x3'));var fs=require('fs');var Redis=require(_0xdd28('0x4'));var db=require(_0xdd28('0x5'))['db'];var utils=require(_0xdd28('0x6'));var logger=require(_0xdd28('0x7'))(_0xdd28('0x8'));var config=require('../../config/environment');var jayson=require(_0xdd28('0x9'));var client=jayson[_0xdd28('0xa')][_0xdd28('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x111494,_0x4c1a98,_0x549b4c){return new BPromise(function(_0x2b4ddf,_0x35ecd6){return client['request'](_0x111494,_0x549b4c)[_0xdd28('0xc')](function(_0x4826dc){logger[_0xdd28('0xd')](_0xdd28('0xe'),_0x4c1a98,_0xdd28('0xf'));logger[_0xdd28('0x10')](_0xdd28('0x11'),_0x4c1a98,_0xdd28('0xf'),JSON[_0xdd28('0x12')](_0x4826dc));if(_0x4826dc['error']){if(_0x4826dc[_0xdd28('0x13')][_0xdd28('0x14')]===0x1f4){logger[_0xdd28('0x13')](_0xdd28('0xe'),_0x4c1a98,_0x4826dc[_0xdd28('0x13')][_0xdd28('0x15')]);return _0x35ecd6(_0x4826dc[_0xdd28('0x13')]['message']);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x4c1a98,_0x4826dc[_0xdd28('0x13')][_0xdd28('0x15')]);return _0x2b4ddf(_0x4826dc['error'][_0xdd28('0x15')]);}else{logger[_0xdd28('0xd')]('DeskAccount,\x20%s,\x20%s',_0x4c1a98,_0xdd28('0xf'));_0x2b4ddf(_0x4826dc['result'][_0xdd28('0x15')]);}})[_0xdd28('0x16')](function(_0x5d5f22){logger[_0xdd28('0x13')](_0xdd28('0xe'),_0x4c1a98,_0x5d5f22);_0x35ecd6(_0x5d5f22);});});}exports[_0xdd28('0x17')]=function(_0xf38975){var _0x5cba7a=this;return new Promise(function(_0x392cd3,_0x4ba718){return db[_0xdd28('0x18')][_0xdd28('0x19')]({'raw':_0xf38975[_0xdd28('0x1a')]?_0xf38975['options']['raw']===undefined?!![]:![]:!![],'where':_0xf38975[_0xdd28('0x1a')]?_0xf38975[_0xdd28('0x1a')]['where']||null:null,'attributes':_0xf38975[_0xdd28('0x1a')]?_0xf38975[_0xdd28('0x1a')]['attributes']||null:null,'limit':_0xf38975[_0xdd28('0x1a')]?_0xf38975[_0xdd28('0x1a')][_0xdd28('0x1b')]||null:null,'include':_0xf38975[_0xdd28('0x1a')]?_0xf38975[_0xdd28('0x1a')][_0xdd28('0x1c')]?_[_0xdd28('0x1d')](_0xf38975['options']['include'],function(_0x2df64e){return{'model':db[_0x2df64e[_0xdd28('0x1e')]],'as':_0x2df64e['as'],'attributes':_0x2df64e[_0xdd28('0x1f')],'include':_0x2df64e[_0xdd28('0x1c')]?_['map'](_0x2df64e[_0xdd28('0x1c')],function(_0x322c0b){return{'model':db[_0x322c0b['model']],'as':_0x322c0b['as'],'attributes':_0x322c0b[_0xdd28('0x1f')],'include':_0x322c0b[_0xdd28('0x1c')]?_['map'](_0x322c0b['include'],function(_0x12efed){return{'model':db[_0x12efed[_0xdd28('0x1e')]],'as':_0x12efed['as'],'attributes':_0x12efed[_0xdd28('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdd28('0xc')](function(_0x6f5248){logger[_0xdd28('0xd')](_0xdd28('0x17'),_0xf38975);logger[_0xdd28('0x10')](_0xdd28('0x17'),_0xf38975,JSON['stringify'](_0x6f5248));_0x392cd3(_0x6f5248);})[_0xdd28('0x16')](function(_0x4dc384){logger['error']('GetDeskAccount',_0x4dc384[_0xdd28('0x15')],_0xf38975);_0x4ba718(_0x5cba7a[_0xdd28('0x13')](0x1f4,_0x4dc384[_0xdd28('0x15')]));});});};exports['ShowDeskAccount']=function(_0x31d612){var _0x4bbb62=this;return new Promise(function(_0x2c886b,_0x233e3e){return db[_0xdd28('0x18')]['find']({'raw':_0x31d612[_0xdd28('0x1a')]?_0x31d612[_0xdd28('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x31d612[_0xdd28('0x1a')]?_0x31d612[_0xdd28('0x1a')]['where']||null:null,'attributes':_0x31d612[_0xdd28('0x1a')]?_0x31d612[_0xdd28('0x1a')]['attributes']||null:null,'include':_0x31d612[_0xdd28('0x1a')]?_0x31d612[_0xdd28('0x1a')][_0xdd28('0x1c')]?_['map'](_0x31d612[_0xdd28('0x1a')][_0xdd28('0x1c')],function(_0x475f8e){return{'model':db[_0x475f8e[_0xdd28('0x1e')]],'as':_0x475f8e['as'],'attributes':_0x475f8e[_0xdd28('0x1f')],'include':_0x475f8e[_0xdd28('0x1c')]?_[_0xdd28('0x1d')](_0x475f8e[_0xdd28('0x1c')],function(_0x8d513a){return{'model':db[_0x8d513a['model']],'as':_0x8d513a['as'],'attributes':_0x8d513a[_0xdd28('0x1f')],'include':_0x8d513a[_0xdd28('0x1c')]?_['map'](_0x8d513a[_0xdd28('0x1c')],function(_0x1bb443){return{'model':db[_0x1bb443[_0xdd28('0x1e')]],'as':_0x1bb443['as'],'attributes':_0x1bb443['attributes']};}):[]};}):[]};}):[]:[]})[_0xdd28('0xc')](function(_0x2cb11c){logger[_0xdd28('0xd')]('ShowDeskAccount',_0x31d612);logger['debug'](_0xdd28('0x20'),_0x31d612,JSON['stringify'](_0x2cb11c));_0x2c886b(_0x2cb11c);})[_0xdd28('0x16')](function(_0x333c3b){logger[_0xdd28('0x13')](_0xdd28('0x20'),_0x333c3b['message'],_0x31d612);_0x233e3e(_0x4bbb62[_0xdd28('0x13')](0x1f4,_0x333c3b[_0xdd28('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index b8fd5aa..d7a524a 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x594515,_0x4fe3af){var _0x4b2779=function(_0x227086){while(--_0x227086){_0x594515['push'](_0x594515['shift']());}};_0x4b2779(++_0x4fe3af);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file +var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x301ae2,_0x4de8bd){var _0x5f2990=function(_0x344343){while(--_0x344343){_0x301ae2['push'](_0x301ae2['shift']());}};_0x5f2990(++_0x4de8bd);}(_0xedd9,0xfc));var _0x9edd=function(_0x1ac7ef,_0x7677d7){_0x1ac7ef=_0x1ac7ef-0x0;var _0x447d70=_0xedd9[_0x1ac7ef];return _0x447d70;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index e1b4582..240f09e 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 _0x6661=['sequelize','STRING'];(function(_0x26c0ca,_0x20155a){var _0x641d55=function(_0x1e4577){while(--_0x1e4577){_0x26c0ca['push'](_0x26c0ca['shift']());}};_0x641d55(++_0x20155a);}(_0x6661,0xb0));var _0x1666=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x6661[_0x3ea913];return _0x2b4f28;};'use strict';var Sequelize=require(_0x1666('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1666('0x1')]}}; \ No newline at end of file +var _0x28fe=['STRING','exports'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x28fe,0x185));var _0xe28f=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x28fe[_0x45b034];return _0x509cb0;};'use strict';var Sequelize=require('sequelize');module[_0xe28f('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe28f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 8d15d67..1372932 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 _0x0e8e=['json','offset','undefined','count','limit','set','Content-Range','save','update','then','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','catch','create','body','find','destroy','getFields','findOne','DeskField','filter','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x34e200,_0x3d454b){var _0x21f3da=function(_0x5a624d){while(--_0x5a624d){_0x34e200['push'](_0x34e200['shift']());}};_0x21f3da(++_0x3d454b);}(_0x0e8e,0x181));var _0xe0e8=function(_0x172551,_0x1799fb){_0x172551=_0x172551-0x0;var _0x895032=_0x0e8e[_0x172551];return _0x895032;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe0e8('0x0'));var zipdir=require(_0xe0e8('0x1'));var jsonpatch=require(_0xe0e8('0x2'));var rp=require(_0xe0e8('0x3'));var moment=require(_0xe0e8('0x4'));var BPromise=require(_0xe0e8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe0e8('0x6'));var sox=require('sox');var csv=require(_0xe0e8('0x7'));var ejs=require(_0xe0e8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe0e8('0x9'));var squel=require(_0xe0e8('0xa'));var crypto=require(_0xe0e8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe0e8('0xc'));var toCsv=require(_0xe0e8('0x7'));var querystring=require('querystring');var Papa=require(_0xe0e8('0xd'));var Redis=require(_0xe0e8('0xe'));var authService=require(_0xe0e8('0xf'));var qs=require(_0xe0e8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0e8('0x11'))(_0xe0e8('0x12'));var utils=require(_0xe0e8('0x13'));var config=require(_0xe0e8('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0e8('0x15'))['db'];function respondWithStatusCode(_0x363044,_0x480d1a){_0x480d1a=_0x480d1a||0xcc;return function(_0x46f685){if(_0x46f685){return _0x363044[_0xe0e8('0x16')](_0x480d1a);}return _0x363044[_0xe0e8('0x17')](_0x480d1a)[_0xe0e8('0x18')]();};}function respondWithResult(_0x54b58c,_0x48f274){_0x48f274=_0x48f274||0xc8;return function(_0x4faf10){if(_0x4faf10){return _0x54b58c[_0xe0e8('0x17')](_0x48f274)[_0xe0e8('0x19')](_0x4faf10);}};}function respondWithFilteredResult(_0x15b0ce,_0x389ace){return function(_0x2f3ef9){if(_0x2f3ef9){var _0x280108=typeof _0x389ace[_0xe0e8('0x1a')]===_0xe0e8('0x1b')&&typeof _0x389ace['limit']===_0xe0e8('0x1b');var _0x27e112=_0x2f3ef9['count'];var _0x13deae=_0x280108?0x0:_0x389ace['offset'];var _0x5cd1ea=_0x280108?_0x2f3ef9[_0xe0e8('0x1c')]:_0x389ace[_0xe0e8('0x1a')]+_0x389ace[_0xe0e8('0x1d')];var _0x46d6aa;if(_0x5cd1ea>=_0x27e112){_0x5cd1ea=_0x27e112;_0x46d6aa=0xc8;}else{_0x46d6aa=0xce;}_0x15b0ce[_0xe0e8('0x17')](_0x46d6aa);return _0x15b0ce[_0xe0e8('0x1e')](_0xe0e8('0x1f'),_0x13deae+'-'+_0x5cd1ea+'/'+_0x27e112)[_0xe0e8('0x19')](_0x2f3ef9);}return null;};}function patchUpdates(_0x1563fd){return function(_0x16c0ee){try{jsonpatch['apply'](_0x16c0ee,_0x1563fd,!![]);}catch(_0x2b4a01){return BPromise['reject'](_0x2b4a01);}return _0x16c0ee[_0xe0e8('0x20')]();};}function saveUpdates(_0x1d87d3,_0x1f2da7){return function(_0xa446fb){if(_0xa446fb){return _0xa446fb[_0xe0e8('0x21')](_0x1d87d3)[_0xe0e8('0x22')](function(_0x365c7){return _0x365c7;});}return null;};}function removeEntity(_0x544cac,_0x5b359c){return function(_0x263144){if(_0x263144){return _0x263144['destroy']()[_0xe0e8('0x22')](function(){_0x544cac[_0xe0e8('0x17')](0xcc)[_0xe0e8('0x18')]();});}};}function handleEntityNotFound(_0x4579f2,_0x16deed){return function(_0x2d3eac){if(!_0x2d3eac){_0x4579f2['sendStatus'](0x194);}return _0x2d3eac;};}function handleError(_0x2e8097,_0x13a47a){_0x13a47a=_0x13a47a||0x1f4;return function(_0x1319b3){logger[_0xe0e8('0x23')](_0x1319b3[_0xe0e8('0x24')]);if(_0x1319b3[_0xe0e8('0x25')]){delete _0x1319b3[_0xe0e8('0x25')];}_0x2e8097[_0xe0e8('0x17')](_0x13a47a)[_0xe0e8('0x26')](_0x1319b3);};}exports[_0xe0e8('0x27')]=function(_0x32ca38,_0x30382b){var _0x1c7365={},_0x52cc7c={},_0x1a735e={'count':0x0,'rows':[]};var _0x20993b=_[_0xe0e8('0x28')](db[_0xe0e8('0x29')][_0xe0e8('0x2a')],function(_0x8839bf){return{'name':_0x8839bf['fieldName'],'type':_0x8839bf[_0xe0e8('0x2b')]['key']};});_0x52cc7c[_0xe0e8('0x2c')]=_[_0xe0e8('0x28')](_0x20993b,_0xe0e8('0x25'));_0x52cc7c['query']=_[_0xe0e8('0x2d')](_0x32ca38[_0xe0e8('0x2e')]);_0x52cc7c[_0xe0e8('0x2f')]=_[_0xe0e8('0x30')](_0x52cc7c[_0xe0e8('0x2c')],_0x52cc7c[_0xe0e8('0x2e')]);_0x1c7365['attributes']=_[_0xe0e8('0x30')](_0x52cc7c['model'],qs[_0xe0e8('0x31')](_0x32ca38[_0xe0e8('0x2e')][_0xe0e8('0x31')]));_0x1c7365[_0xe0e8('0x32')]=_0x1c7365[_0xe0e8('0x32')]['length']?_0x1c7365['attributes']:_0x52cc7c[_0xe0e8('0x2c')];if(!_0x32ca38['query'][_0xe0e8('0x33')](_0xe0e8('0x34'))){_0x1c7365['limit']=qs[_0xe0e8('0x1d')](_0x32ca38[_0xe0e8('0x2e')]['limit']);_0x1c7365['offset']=qs[_0xe0e8('0x1a')](_0x32ca38[_0xe0e8('0x2e')][_0xe0e8('0x1a')]);}_0x1c7365[_0xe0e8('0x35')]=qs[_0xe0e8('0x36')](_0x32ca38[_0xe0e8('0x2e')][_0xe0e8('0x36')]);_0x1c7365['where']=qs[_0xe0e8('0x2f')](_[_0xe0e8('0x37')](_0x32ca38[_0xe0e8('0x2e')],_0x52cc7c[_0xe0e8('0x2f')]),_0x20993b);if(_0x32ca38[_0xe0e8('0x2e')]['filter']){_0x1c7365['where']=_[_0xe0e8('0x38')](_0x1c7365[_0xe0e8('0x39')],{'$or':_[_0xe0e8('0x28')](_0x20993b,function(_0x6c392e){if(_0x6c392e[_0xe0e8('0x2b')]!==_0xe0e8('0x3a')){var _0x275d31={};_0x275d31[_0x6c392e[_0xe0e8('0x25')]]={'$like':'%'+_0x32ca38['query']['filter']+'%'};return _0x275d31;}})});}_0x1c7365=_[_0xe0e8('0x38')]({},_0x1c7365,_0x32ca38[_0xe0e8('0x3b')]);var _0x3ebe74={'where':_0x1c7365['where']};return db[_0xe0e8('0x29')][_0xe0e8('0x1c')](_0x3ebe74)[_0xe0e8('0x22')](function(_0x2a653a){_0x1a735e[_0xe0e8('0x1c')]=_0x2a653a;if(_0x32ca38['query'][_0xe0e8('0x3c')]){_0x1c7365[_0xe0e8('0x3d')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xe0e8('0x3e')](_0x1c7365);})[_0xe0e8('0x22')](function(_0x389ba9){_0x1a735e[_0xe0e8('0x3f')]=_0x389ba9;return _0x1a735e;})[_0xe0e8('0x22')](respondWithFilteredResult(_0x30382b,_0x1c7365))['catch'](handleError(_0x30382b,null));};exports[_0xe0e8('0x40')]=function(_0x5ea29a,_0x52d2e2){var _0x3d704b={'raw':![],'where':{'id':_0x5ea29a[_0xe0e8('0x41')]['id']}},_0x2c6620={};_0x2c6620[_0xe0e8('0x2c')]=_[_0xe0e8('0x2d')](db['DeskConfiguration'][_0xe0e8('0x2a')]);_0x2c6620['query']=_[_0xe0e8('0x2d')](_0x5ea29a[_0xe0e8('0x2e')]);_0x2c6620[_0xe0e8('0x2f')]=_[_0xe0e8('0x30')](_0x2c6620[_0xe0e8('0x2c')],_0x2c6620[_0xe0e8('0x2e')]);_0x3d704b[_0xe0e8('0x32')]=_['intersection'](_0x2c6620[_0xe0e8('0x2c')],qs[_0xe0e8('0x31')](_0x5ea29a['query'][_0xe0e8('0x31')]));_0x3d704b['attributes']=_0x3d704b[_0xe0e8('0x32')][_0xe0e8('0x42')]?_0x3d704b[_0xe0e8('0x32')]:_0x2c6620[_0xe0e8('0x2c')];if(_0x5ea29a[_0xe0e8('0x2e')][_0xe0e8('0x3c')]){_0x3d704b[_0xe0e8('0x3d')]=[{'all':!![]}];}_0x3d704b=_[_0xe0e8('0x38')]({},_0x3d704b,_0x5ea29a[_0xe0e8('0x3b')]);return db[_0xe0e8('0x29')]['find'](_0x3d704b)[_0xe0e8('0x22')](handleEntityNotFound(_0x52d2e2,null))[_0xe0e8('0x22')](respondWithResult(_0x52d2e2,null))[_0xe0e8('0x43')](handleError(_0x52d2e2,null));};exports[_0xe0e8('0x44')]=function(_0xe0c2cd,_0x1ec054){return db[_0xe0e8('0x29')][_0xe0e8('0x44')](_0xe0c2cd[_0xe0e8('0x45')],{})[_0xe0e8('0x22')](respondWithResult(_0x1ec054,0xc9))[_0xe0e8('0x43')](handleError(_0x1ec054,null));};exports['update']=function(_0x1fdfcf,_0x4c6f2b){if(_0x1fdfcf['body']['id']){delete _0x1fdfcf[_0xe0e8('0x45')]['id'];}return db[_0xe0e8('0x29')][_0xe0e8('0x46')]({'where':{'id':_0x1fdfcf[_0xe0e8('0x41')]['id']}})[_0xe0e8('0x22')](handleEntityNotFound(_0x4c6f2b,null))['then'](saveUpdates(_0x1fdfcf[_0xe0e8('0x45')],null))[_0xe0e8('0x22')](respondWithResult(_0x4c6f2b,null))[_0xe0e8('0x43')](handleError(_0x4c6f2b,null));};exports[_0xe0e8('0x47')]=function(_0x5efe93,_0x35bc2d){return db['DeskConfiguration'][_0xe0e8('0x46')]({'where':{'id':_0x5efe93[_0xe0e8('0x41')]['id']}})[_0xe0e8('0x22')](handleEntityNotFound(_0x35bc2d,null))[_0xe0e8('0x22')](removeEntity(_0x35bc2d,null))[_0xe0e8('0x43')](handleError(_0x35bc2d,null));};exports[_0xe0e8('0x48')]=function(_0x1ec684,_0x54655a,_0x2ed773){var _0x494f9a={};var _0xa89a5f={};var _0x4abf2a;var _0x2ab0e6;return db['DeskConfiguration'][_0xe0e8('0x49')]({'where':{'id':_0x1ec684[_0xe0e8('0x41')]['id']}})['then'](handleEntityNotFound(_0x54655a,null))[_0xe0e8('0x22')](function(_0x12d62e){if(_0x12d62e){_0x4abf2a=_0x12d62e;_0xa89a5f[_0xe0e8('0x2c')]=_[_0xe0e8('0x2d')](db[_0xe0e8('0x4a')][_0xe0e8('0x2a')]);_0xa89a5f['query']=_[_0xe0e8('0x2d')](_0x1ec684[_0xe0e8('0x2e')]);_0xa89a5f['filters']=_[_0xe0e8('0x30')](_0xa89a5f[_0xe0e8('0x2c')],_0xa89a5f[_0xe0e8('0x2e')]);_0x494f9a[_0xe0e8('0x32')]=_[_0xe0e8('0x30')](_0xa89a5f['model'],qs['fields'](_0x1ec684['query'][_0xe0e8('0x31')]));_0x494f9a['attributes']=_0x494f9a[_0xe0e8('0x32')][_0xe0e8('0x42')]?_0x494f9a[_0xe0e8('0x32')]:_0xa89a5f[_0xe0e8('0x2c')];_0x494f9a[_0xe0e8('0x35')]=qs[_0xe0e8('0x36')](_0x1ec684[_0xe0e8('0x2e')][_0xe0e8('0x36')]);_0x494f9a['where']=qs[_0xe0e8('0x2f')](_['pick'](_0x1ec684[_0xe0e8('0x2e')],_0xa89a5f[_0xe0e8('0x2f')]));if(_0x1ec684['query'][_0xe0e8('0x4b')]){_0x494f9a[_0xe0e8('0x39')]=_[_0xe0e8('0x38')](_0x494f9a['where'],{'$or':_[_0xe0e8('0x28')](_0x494f9a[_0xe0e8('0x32')],function(_0x1a617a){var _0x9c3582={};_0x9c3582[_0x1a617a]={'$like':'%'+_0x1ec684[_0xe0e8('0x2e')]['filter']+'%'};return _0x9c3582;})});}_0x494f9a=_[_0xe0e8('0x38')]({},_0x494f9a,_0x1ec684[_0xe0e8('0x3b')]);return _0x4abf2a[_0xe0e8('0x48')](_0x494f9a);}})[_0xe0e8('0x22')](function(_0x451e08){if(_0x451e08){_0x2ab0e6=_0x451e08[_0xe0e8('0x42')];if(!_0x1ec684[_0xe0e8('0x2e')][_0xe0e8('0x33')](_0xe0e8('0x34'))){_0x494f9a[_0xe0e8('0x1d')]=qs['limit'](_0x1ec684[_0xe0e8('0x2e')]['limit']);_0x494f9a[_0xe0e8('0x1a')]=qs[_0xe0e8('0x1a')](_0x1ec684['query'][_0xe0e8('0x1a')]);}return _0x4abf2a[_0xe0e8('0x48')](_0x494f9a);}})[_0xe0e8('0x22')](function(_0x18669b){if(_0x18669b){return _0x18669b?{'count':_0x2ab0e6,'rows':_0x18669b}:null;}})['then'](respondWithResult(_0x54655a,null))[_0xe0e8('0x43')](handleError(_0x54655a,null));};exports[_0xe0e8('0x4c')]=function(_0x4fb502,_0x590472,_0xde4db8){var _0x28df2b={};var _0x2c7985={};var _0x2db5a9;var _0x4354dc;return db[_0xe0e8('0x29')][_0xe0e8('0x49')]({'where':{'id':_0x4fb502['params']['id']}})[_0xe0e8('0x22')](handleEntityNotFound(_0x590472,null))[_0xe0e8('0x22')](function(_0x43e3a7){if(_0x43e3a7){_0x2db5a9=_0x43e3a7;_0x2c7985[_0xe0e8('0x2c')]=_['keys'](db[_0xe0e8('0x4a')][_0xe0e8('0x2a')]);_0x2c7985[_0xe0e8('0x2e')]=_[_0xe0e8('0x2d')](_0x4fb502['query']);_0x2c7985[_0xe0e8('0x2f')]=_[_0xe0e8('0x30')](_0x2c7985[_0xe0e8('0x2c')],_0x2c7985[_0xe0e8('0x2e')]);_0x28df2b[_0xe0e8('0x32')]=_[_0xe0e8('0x30')](_0x2c7985['model'],qs[_0xe0e8('0x31')](_0x4fb502[_0xe0e8('0x2e')]['fields']));_0x28df2b[_0xe0e8('0x32')]=_0x28df2b[_0xe0e8('0x32')][_0xe0e8('0x42')]?_0x28df2b[_0xe0e8('0x32')]:_0x2c7985[_0xe0e8('0x2c')];_0x28df2b[_0xe0e8('0x35')]=qs[_0xe0e8('0x36')](_0x4fb502[_0xe0e8('0x2e')][_0xe0e8('0x36')]);_0x28df2b[_0xe0e8('0x39')]=qs[_0xe0e8('0x2f')](_[_0xe0e8('0x37')](_0x4fb502[_0xe0e8('0x2e')],_0x2c7985['filters']));if(_0x4fb502['query']['filter']){_0x28df2b[_0xe0e8('0x39')]=_[_0xe0e8('0x38')](_0x28df2b[_0xe0e8('0x39')],{'$or':_[_0xe0e8('0x28')](_0x28df2b[_0xe0e8('0x32')],function(_0x427275){var _0x1abc08={};_0x1abc08[_0x427275]={'$like':'%'+_0x4fb502[_0xe0e8('0x2e')]['filter']+'%'};return _0x1abc08;})});}_0x28df2b=_['merge']({},_0x28df2b,_0x4fb502[_0xe0e8('0x3b')]);return _0x2db5a9[_0xe0e8('0x4c')](_0x28df2b);}})[_0xe0e8('0x22')](function(_0x20146a){if(_0x20146a){_0x4354dc=_0x20146a[_0xe0e8('0x42')];if(!_0x4fb502['query'][_0xe0e8('0x33')](_0xe0e8('0x34'))){_0x28df2b[_0xe0e8('0x1d')]=qs[_0xe0e8('0x1d')](_0x4fb502['query'][_0xe0e8('0x1d')]);_0x28df2b['offset']=qs[_0xe0e8('0x1a')](_0x4fb502[_0xe0e8('0x2e')][_0xe0e8('0x1a')]);}return _0x2db5a9[_0xe0e8('0x4c')](_0x28df2b);}})[_0xe0e8('0x22')](function(_0x3e6d86){if(_0x3e6d86){return _0x3e6d86?{'count':_0x4354dc,'rows':_0x3e6d86}:null;}})['then'](respondWithResult(_0x590472,null))[_0xe0e8('0x43')](handleError(_0x590472,null));};exports[_0xe0e8('0x4d')]=function(_0x49e990,_0x56671c,_0x327c92){var _0x9acdf2={};var _0x3ea60c={};var _0x164545;var _0xb6ab3b;return db[_0xe0e8('0x29')][_0xe0e8('0x49')]({'where':{'id':_0x49e990['params']['id']}})['then'](handleEntityNotFound(_0x56671c,null))[_0xe0e8('0x22')](function(_0x556614){if(_0x556614){_0x164545=_0x556614;_0x3ea60c[_0xe0e8('0x2c')]=_[_0xe0e8('0x2d')](db[_0xe0e8('0x4a')][_0xe0e8('0x2a')]);_0x3ea60c[_0xe0e8('0x2e')]=_[_0xe0e8('0x2d')](_0x49e990['query']);_0x3ea60c[_0xe0e8('0x2f')]=_[_0xe0e8('0x30')](_0x3ea60c[_0xe0e8('0x2c')],_0x3ea60c[_0xe0e8('0x2e')]);_0x9acdf2['attributes']=_[_0xe0e8('0x30')](_0x3ea60c[_0xe0e8('0x2c')],qs[_0xe0e8('0x31')](_0x49e990[_0xe0e8('0x2e')]['fields']));_0x9acdf2[_0xe0e8('0x32')]=_0x9acdf2['attributes'][_0xe0e8('0x42')]?_0x9acdf2[_0xe0e8('0x32')]:_0x3ea60c[_0xe0e8('0x2c')];_0x9acdf2[_0xe0e8('0x35')]=qs['sort'](_0x49e990[_0xe0e8('0x2e')][_0xe0e8('0x36')]);_0x9acdf2[_0xe0e8('0x39')]=qs[_0xe0e8('0x2f')](_[_0xe0e8('0x37')](_0x49e990[_0xe0e8('0x2e')],_0x3ea60c[_0xe0e8('0x2f')]));if(_0x49e990[_0xe0e8('0x2e')][_0xe0e8('0x4b')]){_0x9acdf2['where']=_[_0xe0e8('0x38')](_0x9acdf2[_0xe0e8('0x39')],{'$or':_[_0xe0e8('0x28')](_0x9acdf2['attributes'],function(_0x1b21f9){var _0x18cb04={};_0x18cb04[_0x1b21f9]={'$like':'%'+_0x49e990['query'][_0xe0e8('0x4b')]+'%'};return _0x18cb04;})});}_0x9acdf2=_[_0xe0e8('0x38')]({},_0x9acdf2,_0x49e990[_0xe0e8('0x3b')]);return _0x164545['getDescriptions'](_0x9acdf2);}})[_0xe0e8('0x22')](function(_0x85e532){if(_0x85e532){_0xb6ab3b=_0x85e532[_0xe0e8('0x42')];if(!_0x49e990[_0xe0e8('0x2e')][_0xe0e8('0x33')](_0xe0e8('0x34'))){_0x9acdf2['limit']=qs[_0xe0e8('0x1d')](_0x49e990[_0xe0e8('0x2e')][_0xe0e8('0x1d')]);_0x9acdf2[_0xe0e8('0x1a')]=qs['offset'](_0x49e990[_0xe0e8('0x2e')][_0xe0e8('0x1a')]);}return _0x164545[_0xe0e8('0x4d')](_0x9acdf2);}})['then'](function(_0x319850){if(_0x319850){return _0x319850?{'count':_0xb6ab3b,'rows':_0x319850}:null;}})['then'](respondWithResult(_0x56671c,null))[_0xe0e8('0x43')](handleError(_0x56671c,null));};exports[_0xe0e8('0x4e')]=function(_0x281e82,_0x36afed,_0x406c69){var _0x3f1fcd={};var _0x5b602f={};var _0x4d9559;var _0x40ffe5;return db[_0xe0e8('0x29')][_0xe0e8('0x49')]({'where':{'id':_0x281e82[_0xe0e8('0x41')]['id']}})[_0xe0e8('0x22')](handleEntityNotFound(_0x36afed,null))[_0xe0e8('0x22')](function(_0x133e59){if(_0x133e59){_0x4d9559=_0x133e59;_0x5b602f[_0xe0e8('0x2c')]=_[_0xe0e8('0x2d')](db[_0xe0e8('0x4f')][_0xe0e8('0x2a')]);_0x5b602f[_0xe0e8('0x2e')]=_[_0xe0e8('0x2d')](_0x281e82['query']);_0x5b602f[_0xe0e8('0x2f')]=_[_0xe0e8('0x30')](_0x5b602f['model'],_0x5b602f[_0xe0e8('0x2e')]);_0x3f1fcd[_0xe0e8('0x32')]=_[_0xe0e8('0x30')](_0x5b602f['model'],qs[_0xe0e8('0x31')](_0x281e82[_0xe0e8('0x2e')][_0xe0e8('0x31')]));_0x3f1fcd[_0xe0e8('0x32')]=_0x3f1fcd['attributes']['length']?_0x3f1fcd[_0xe0e8('0x32')]:_0x5b602f[_0xe0e8('0x2c')];_0x3f1fcd[_0xe0e8('0x35')]=qs[_0xe0e8('0x36')](_0x281e82[_0xe0e8('0x2e')][_0xe0e8('0x36')]);_0x3f1fcd[_0xe0e8('0x39')]=qs['filters'](_[_0xe0e8('0x37')](_0x281e82[_0xe0e8('0x2e')],_0x5b602f[_0xe0e8('0x2f')]));if(_0x281e82[_0xe0e8('0x2e')][_0xe0e8('0x4b')]){_0x3f1fcd[_0xe0e8('0x39')]=_['merge'](_0x3f1fcd['where'],{'$or':_[_0xe0e8('0x28')](_0x3f1fcd['attributes'],function(_0x4a2ddb){var _0x3d37bc={};_0x3d37bc[_0x4a2ddb]={'$like':'%'+_0x281e82[_0xe0e8('0x2e')]['filter']+'%'};return _0x3d37bc;})});}_0x3f1fcd=_[_0xe0e8('0x38')]({},_0x3f1fcd,_0x281e82[_0xe0e8('0x3b')]);return _0x4d9559[_0xe0e8('0x4e')](_0x3f1fcd);}})['then'](function(_0x1fe6fc){if(_0x1fe6fc){_0x40ffe5=_0x1fe6fc[_0xe0e8('0x42')];if(!_0x281e82[_0xe0e8('0x2e')][_0xe0e8('0x33')](_0xe0e8('0x34'))){_0x3f1fcd[_0xe0e8('0x1d')]=qs['limit'](_0x281e82['query'][_0xe0e8('0x1d')]);_0x3f1fcd[_0xe0e8('0x1a')]=qs[_0xe0e8('0x1a')](_0x281e82[_0xe0e8('0x2e')]['offset']);}return _0x4d9559[_0xe0e8('0x4e')](_0x3f1fcd);}})[_0xe0e8('0x22')](function(_0x52ff07){if(_0x52ff07){return _0x52ff07?{'count':_0x40ffe5,'rows':_0x52ff07}:null;}})[_0xe0e8('0x22')](respondWithResult(_0x36afed,null))[_0xe0e8('0x43')](handleError(_0x36afed,null));};exports[_0xe0e8('0x50')]=function(_0x278949,_0x29c3f4,_0xcc031d){if(_0x278949['body']['id']){delete _0x278949['body']['id'];}return db[_0xe0e8('0x29')][_0xe0e8('0x49')]({'where':{'id':_0x278949[_0xe0e8('0x41')]['id']}})[_0xe0e8('0x22')](handleEntityNotFound(_0x29c3f4,null))[_0xe0e8('0x22')](function(_0x2c2c12){if(_0x2c2c12){return _0x2c2c12[_0xe0e8('0x50')](_0x278949[_0xe0e8('0x45')][_0xe0e8('0x51')]||[]);}return null;})[_0xe0e8('0x22')](respondWithResult(_0x29c3f4,null))[_0xe0e8('0x43')](handleError(_0x29c3f4,null));}; \ No newline at end of file +var _0xcbc4=['error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','includeAll','include','catch','show','params','options','find','create','body','getFields','findOne','pick','getSubjects','DeskField','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xcbc4,0x12b));var _0x4cbc=function(_0x5d8afb,_0x1ba566){_0x5d8afb=_0x5d8afb-0x0;var _0x3dcf6e=_0xcbc4[_0x5d8afb];return _0x3dcf6e;};'use strict';var emlformat=require(_0x4cbc('0x0'));var rimraf=require(_0x4cbc('0x1'));var zipdir=require(_0x4cbc('0x2'));var jsonpatch=require(_0x4cbc('0x3'));var rp=require(_0x4cbc('0x4'));var moment=require(_0x4cbc('0x5'));var BPromise=require(_0x4cbc('0x6'));var Mustache=require(_0x4cbc('0x7'));var util=require(_0x4cbc('0x8'));var path=require(_0x4cbc('0x9'));var sox=require(_0x4cbc('0xa'));var csv=require(_0x4cbc('0xb'));var ejs=require(_0x4cbc('0xc'));var fs=require('fs');var fs_extra=require(_0x4cbc('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4cbc('0xe'));var deskjs=require(_0x4cbc('0xf'));var toCsv=require(_0x4cbc('0xb'));var querystring=require(_0x4cbc('0x10'));var Papa=require('papaparse');var Redis=require(_0x4cbc('0x11'));var authService=require(_0x4cbc('0x12'));var qs=require(_0x4cbc('0x13'));var as=require(_0x4cbc('0x14'));var hardwareService=require(_0x4cbc('0x15'));var logger=require(_0x4cbc('0x16'))(_0x4cbc('0x17'));var utils=require(_0x4cbc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4cbc('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x220db8,_0x4a4268){_0x4a4268=_0x4a4268||0xcc;return function(_0x197287){if(_0x197287){return _0x220db8[_0x4cbc('0x1a')](_0x4a4268);}return _0x220db8[_0x4cbc('0x1b')](_0x4a4268)[_0x4cbc('0x1c')]();};}function respondWithResult(_0x41e6db,_0x1e1a22){_0x1e1a22=_0x1e1a22||0xc8;return function(_0x496ceb){if(_0x496ceb){return _0x41e6db['status'](_0x1e1a22)[_0x4cbc('0x1d')](_0x496ceb);}};}function respondWithFilteredResult(_0x198ac1,_0x160231){return function(_0x52cfff){if(_0x52cfff){var _0x5c371b=typeof _0x160231[_0x4cbc('0x1e')]===_0x4cbc('0x1f')&&typeof _0x160231[_0x4cbc('0x20')]===_0x4cbc('0x1f');var _0x472d66=_0x52cfff['count'];var _0x433ecd=_0x5c371b?0x0:_0x160231[_0x4cbc('0x1e')];var _0x17d89a=_0x5c371b?_0x52cfff[_0x4cbc('0x21')]:_0x160231[_0x4cbc('0x1e')]+_0x160231['limit'];var _0x32899c;if(_0x17d89a>=_0x472d66){_0x17d89a=_0x472d66;_0x32899c=0xc8;}else{_0x32899c=0xce;}_0x198ac1[_0x4cbc('0x1b')](_0x32899c);return _0x198ac1[_0x4cbc('0x22')](_0x4cbc('0x23'),_0x433ecd+'-'+_0x17d89a+'/'+_0x472d66)[_0x4cbc('0x1d')](_0x52cfff);}return null;};}function patchUpdates(_0x23ada8){return function(_0x321bcd){try{jsonpatch[_0x4cbc('0x24')](_0x321bcd,_0x23ada8,!![]);}catch(_0x354dd6){return BPromise['reject'](_0x354dd6);}return _0x321bcd[_0x4cbc('0x25')]();};}function saveUpdates(_0x5edcbf,_0x1f5e45){return function(_0x5771ee){if(_0x5771ee){return _0x5771ee[_0x4cbc('0x26')](_0x5edcbf)[_0x4cbc('0x27')](function(_0x1358b3){return _0x1358b3;});}return null;};}function removeEntity(_0x1076bf,_0x1bced6){return function(_0x24bb07){if(_0x24bb07){return _0x24bb07[_0x4cbc('0x28')]()[_0x4cbc('0x27')](function(){_0x1076bf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x418be2,_0x451cc6){return function(_0x9027fe){if(!_0x9027fe){_0x418be2[_0x4cbc('0x1a')](0x194);}return _0x9027fe;};}function handleError(_0x110f49,_0x402a76){_0x402a76=_0x402a76||0x1f4;return function(_0x460eed){logger[_0x4cbc('0x29')](_0x460eed[_0x4cbc('0x2a')]);if(_0x460eed[_0x4cbc('0x2b')]){delete _0x460eed[_0x4cbc('0x2b')];}_0x110f49[_0x4cbc('0x1b')](_0x402a76)[_0x4cbc('0x2c')](_0x460eed);};}exports[_0x4cbc('0x2d')]=function(_0x2626b8,_0x1c2118){var _0x41ff43={},_0x3e3eb6={},_0x4c946f={'count':0x0,'rows':[]};var _0x3ddcc4=_[_0x4cbc('0x2e')](db[_0x4cbc('0x2f')][_0x4cbc('0x30')],function(_0x4ef477){return{'name':_0x4ef477[_0x4cbc('0x31')],'type':_0x4ef477['type'][_0x4cbc('0x32')]};});_0x3e3eb6[_0x4cbc('0x33')]=_[_0x4cbc('0x2e')](_0x3ddcc4,_0x4cbc('0x2b'));_0x3e3eb6['query']=_[_0x4cbc('0x34')](_0x2626b8['query']);_0x3e3eb6['filters']=_[_0x4cbc('0x35')](_0x3e3eb6['model'],_0x3e3eb6[_0x4cbc('0x36')]);_0x41ff43['attributes']=_[_0x4cbc('0x35')](_0x3e3eb6[_0x4cbc('0x33')],qs[_0x4cbc('0x37')](_0x2626b8['query'][_0x4cbc('0x37')]));_0x41ff43[_0x4cbc('0x38')]=_0x41ff43[_0x4cbc('0x38')][_0x4cbc('0x39')]?_0x41ff43[_0x4cbc('0x38')]:_0x3e3eb6['model'];if(!_0x2626b8[_0x4cbc('0x36')][_0x4cbc('0x3a')](_0x4cbc('0x3b'))){_0x41ff43['limit']=qs['limit'](_0x2626b8[_0x4cbc('0x36')][_0x4cbc('0x20')]);_0x41ff43['offset']=qs[_0x4cbc('0x1e')](_0x2626b8[_0x4cbc('0x36')][_0x4cbc('0x1e')]);}_0x41ff43[_0x4cbc('0x3c')]=qs[_0x4cbc('0x3d')](_0x2626b8[_0x4cbc('0x36')][_0x4cbc('0x3d')]);_0x41ff43[_0x4cbc('0x3e')]=qs[_0x4cbc('0x3f')](_['pick'](_0x2626b8['query'],_0x3e3eb6[_0x4cbc('0x3f')]),_0x3ddcc4);if(_0x2626b8[_0x4cbc('0x36')][_0x4cbc('0x40')]){_0x41ff43[_0x4cbc('0x3e')]=_[_0x4cbc('0x41')](_0x41ff43[_0x4cbc('0x3e')],{'$or':_[_0x4cbc('0x2e')](_0x3ddcc4,function(_0x4d5d7f){if(_0x4d5d7f[_0x4cbc('0x42')]!==_0x4cbc('0x43')){var _0x183556={};_0x183556[_0x4d5d7f[_0x4cbc('0x2b')]]={'$like':'%'+_0x2626b8[_0x4cbc('0x36')]['filter']+'%'};return _0x183556;}})});}_0x41ff43=_[_0x4cbc('0x41')]({},_0x41ff43,_0x2626b8['options']);var _0x4836de={'where':_0x41ff43['where']};return db[_0x4cbc('0x2f')][_0x4cbc('0x21')](_0x4836de)[_0x4cbc('0x27')](function(_0x141f25){_0x4c946f['count']=_0x141f25;if(_0x2626b8[_0x4cbc('0x36')][_0x4cbc('0x44')]){_0x41ff43[_0x4cbc('0x45')]=[{'all':!![]}];}return db[_0x4cbc('0x2f')]['findAll'](_0x41ff43);})['then'](function(_0x35dc8b){_0x4c946f['rows']=_0x35dc8b;return _0x4c946f;})[_0x4cbc('0x27')](respondWithFilteredResult(_0x1c2118,_0x41ff43))[_0x4cbc('0x46')](handleError(_0x1c2118,null));};exports[_0x4cbc('0x47')]=function(_0x141398,_0x17df29){var _0xd70047={'raw':![],'where':{'id':_0x141398[_0x4cbc('0x48')]['id']}},_0x5edcab={};_0x5edcab[_0x4cbc('0x33')]=_[_0x4cbc('0x34')](db[_0x4cbc('0x2f')][_0x4cbc('0x30')]);_0x5edcab['query']=_[_0x4cbc('0x34')](_0x141398[_0x4cbc('0x36')]);_0x5edcab[_0x4cbc('0x3f')]=_[_0x4cbc('0x35')](_0x5edcab[_0x4cbc('0x33')],_0x5edcab[_0x4cbc('0x36')]);_0xd70047['attributes']=_[_0x4cbc('0x35')](_0x5edcab[_0x4cbc('0x33')],qs[_0x4cbc('0x37')](_0x141398[_0x4cbc('0x36')]['fields']));_0xd70047['attributes']=_0xd70047[_0x4cbc('0x38')]['length']?_0xd70047['attributes']:_0x5edcab[_0x4cbc('0x33')];if(_0x141398[_0x4cbc('0x36')][_0x4cbc('0x44')]){_0xd70047[_0x4cbc('0x45')]=[{'all':!![]}];}_0xd70047=_[_0x4cbc('0x41')]({},_0xd70047,_0x141398[_0x4cbc('0x49')]);return db[_0x4cbc('0x2f')][_0x4cbc('0x4a')](_0xd70047)[_0x4cbc('0x27')](handleEntityNotFound(_0x17df29,null))['then'](respondWithResult(_0x17df29,null))[_0x4cbc('0x46')](handleError(_0x17df29,null));};exports[_0x4cbc('0x4b')]=function(_0x4491a2,_0x23521f){return db[_0x4cbc('0x2f')][_0x4cbc('0x4b')](_0x4491a2[_0x4cbc('0x4c')],{})['then'](respondWithResult(_0x23521f,0xc9))[_0x4cbc('0x46')](handleError(_0x23521f,null));};exports['update']=function(_0x333010,_0x4269cb){if(_0x333010[_0x4cbc('0x4c')]['id']){delete _0x333010[_0x4cbc('0x4c')]['id'];}return db[_0x4cbc('0x2f')][_0x4cbc('0x4a')]({'where':{'id':_0x333010[_0x4cbc('0x48')]['id']}})[_0x4cbc('0x27')](handleEntityNotFound(_0x4269cb,null))['then'](saveUpdates(_0x333010[_0x4cbc('0x4c')],null))['then'](respondWithResult(_0x4269cb,null))[_0x4cbc('0x46')](handleError(_0x4269cb,null));};exports[_0x4cbc('0x28')]=function(_0x1a740d,_0x3df848){return db[_0x4cbc('0x2f')][_0x4cbc('0x4a')]({'where':{'id':_0x1a740d[_0x4cbc('0x48')]['id']}})['then'](handleEntityNotFound(_0x3df848,null))[_0x4cbc('0x27')](removeEntity(_0x3df848,null))[_0x4cbc('0x46')](handleError(_0x3df848,null));};exports[_0x4cbc('0x4d')]=function(_0x459368,_0x563612,_0x1b026f){var _0xa053e3={};var _0x3d8886={};var _0x3c8bfe;var _0x154d6f;return db[_0x4cbc('0x2f')][_0x4cbc('0x4e')]({'where':{'id':_0x459368[_0x4cbc('0x48')]['id']}})['then'](handleEntityNotFound(_0x563612,null))['then'](function(_0x2199ef){if(_0x2199ef){_0x3c8bfe=_0x2199ef;_0x3d8886[_0x4cbc('0x33')]=_[_0x4cbc('0x34')](db['DeskField'][_0x4cbc('0x30')]);_0x3d8886['query']=_['keys'](_0x459368[_0x4cbc('0x36')]);_0x3d8886['filters']=_[_0x4cbc('0x35')](_0x3d8886['model'],_0x3d8886[_0x4cbc('0x36')]);_0xa053e3[_0x4cbc('0x38')]=_[_0x4cbc('0x35')](_0x3d8886[_0x4cbc('0x33')],qs[_0x4cbc('0x37')](_0x459368[_0x4cbc('0x36')][_0x4cbc('0x37')]));_0xa053e3['attributes']=_0xa053e3[_0x4cbc('0x38')][_0x4cbc('0x39')]?_0xa053e3[_0x4cbc('0x38')]:_0x3d8886['model'];_0xa053e3[_0x4cbc('0x3c')]=qs[_0x4cbc('0x3d')](_0x459368[_0x4cbc('0x36')][_0x4cbc('0x3d')]);_0xa053e3[_0x4cbc('0x3e')]=qs['filters'](_[_0x4cbc('0x4f')](_0x459368['query'],_0x3d8886[_0x4cbc('0x3f')]));if(_0x459368[_0x4cbc('0x36')][_0x4cbc('0x40')]){_0xa053e3['where']=_['merge'](_0xa053e3[_0x4cbc('0x3e')],{'$or':_[_0x4cbc('0x2e')](_0xa053e3[_0x4cbc('0x38')],function(_0x2bcb53){var _0x300730={};_0x300730[_0x2bcb53]={'$like':'%'+_0x459368[_0x4cbc('0x36')][_0x4cbc('0x40')]+'%'};return _0x300730;})});}_0xa053e3=_[_0x4cbc('0x41')]({},_0xa053e3,_0x459368[_0x4cbc('0x49')]);return _0x3c8bfe[_0x4cbc('0x4d')](_0xa053e3);}})[_0x4cbc('0x27')](function(_0x52f8a6){if(_0x52f8a6){_0x154d6f=_0x52f8a6[_0x4cbc('0x39')];if(!_0x459368[_0x4cbc('0x36')][_0x4cbc('0x3a')](_0x4cbc('0x3b'))){_0xa053e3[_0x4cbc('0x20')]=qs[_0x4cbc('0x20')](_0x459368[_0x4cbc('0x36')][_0x4cbc('0x20')]);_0xa053e3['offset']=qs[_0x4cbc('0x1e')](_0x459368[_0x4cbc('0x36')][_0x4cbc('0x1e')]);}return _0x3c8bfe[_0x4cbc('0x4d')](_0xa053e3);}})[_0x4cbc('0x27')](function(_0x26b0cb){if(_0x26b0cb){return _0x26b0cb?{'count':_0x154d6f,'rows':_0x26b0cb}:null;}})[_0x4cbc('0x27')](respondWithResult(_0x563612,null))[_0x4cbc('0x46')](handleError(_0x563612,null));};exports[_0x4cbc('0x50')]=function(_0xba99ff,_0x2d9232,_0x82fe81){var _0x5bc0bc={};var _0x4faf00={};var _0x50bf7c;var _0x23337d;return db[_0x4cbc('0x2f')][_0x4cbc('0x4e')]({'where':{'id':_0xba99ff[_0x4cbc('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d9232,null))['then'](function(_0x29c6b4){if(_0x29c6b4){_0x50bf7c=_0x29c6b4;_0x4faf00[_0x4cbc('0x33')]=_['keys'](db[_0x4cbc('0x51')][_0x4cbc('0x30')]);_0x4faf00['query']=_[_0x4cbc('0x34')](_0xba99ff[_0x4cbc('0x36')]);_0x4faf00[_0x4cbc('0x3f')]=_[_0x4cbc('0x35')](_0x4faf00['model'],_0x4faf00[_0x4cbc('0x36')]);_0x5bc0bc['attributes']=_[_0x4cbc('0x35')](_0x4faf00[_0x4cbc('0x33')],qs[_0x4cbc('0x37')](_0xba99ff[_0x4cbc('0x36')][_0x4cbc('0x37')]));_0x5bc0bc[_0x4cbc('0x38')]=_0x5bc0bc[_0x4cbc('0x38')][_0x4cbc('0x39')]?_0x5bc0bc[_0x4cbc('0x38')]:_0x4faf00[_0x4cbc('0x33')];_0x5bc0bc[_0x4cbc('0x3c')]=qs[_0x4cbc('0x3d')](_0xba99ff[_0x4cbc('0x36')]['sort']);_0x5bc0bc[_0x4cbc('0x3e')]=qs[_0x4cbc('0x3f')](_['pick'](_0xba99ff[_0x4cbc('0x36')],_0x4faf00[_0x4cbc('0x3f')]));if(_0xba99ff[_0x4cbc('0x36')][_0x4cbc('0x40')]){_0x5bc0bc['where']=_['merge'](_0x5bc0bc[_0x4cbc('0x3e')],{'$or':_[_0x4cbc('0x2e')](_0x5bc0bc['attributes'],function(_0x37ef9e){var _0x189c41={};_0x189c41[_0x37ef9e]={'$like':'%'+_0xba99ff[_0x4cbc('0x36')][_0x4cbc('0x40')]+'%'};return _0x189c41;})});}_0x5bc0bc=_[_0x4cbc('0x41')]({},_0x5bc0bc,_0xba99ff[_0x4cbc('0x49')]);return _0x50bf7c[_0x4cbc('0x50')](_0x5bc0bc);}})[_0x4cbc('0x27')](function(_0x26154d){if(_0x26154d){_0x23337d=_0x26154d[_0x4cbc('0x39')];if(!_0xba99ff[_0x4cbc('0x36')][_0x4cbc('0x3a')](_0x4cbc('0x3b'))){_0x5bc0bc[_0x4cbc('0x20')]=qs[_0x4cbc('0x20')](_0xba99ff[_0x4cbc('0x36')][_0x4cbc('0x20')]);_0x5bc0bc[_0x4cbc('0x1e')]=qs[_0x4cbc('0x1e')](_0xba99ff[_0x4cbc('0x36')]['offset']);}return _0x50bf7c[_0x4cbc('0x50')](_0x5bc0bc);}})[_0x4cbc('0x27')](function(_0x460107){if(_0x460107){return _0x460107?{'count':_0x23337d,'rows':_0x460107}:null;}})['then'](respondWithResult(_0x2d9232,null))['catch'](handleError(_0x2d9232,null));};exports[_0x4cbc('0x52')]=function(_0x29c273,_0x425984,_0x29cfc0){var _0x4dbb72={};var _0x465cfd={};var _0x2db045;var _0x5bc263;return db['DeskConfiguration'][_0x4cbc('0x4e')]({'where':{'id':_0x29c273[_0x4cbc('0x48')]['id']}})['then'](handleEntityNotFound(_0x425984,null))[_0x4cbc('0x27')](function(_0x105627){if(_0x105627){_0x2db045=_0x105627;_0x465cfd['model']=_[_0x4cbc('0x34')](db['DeskField'][_0x4cbc('0x30')]);_0x465cfd[_0x4cbc('0x36')]=_[_0x4cbc('0x34')](_0x29c273[_0x4cbc('0x36')]);_0x465cfd[_0x4cbc('0x3f')]=_[_0x4cbc('0x35')](_0x465cfd[_0x4cbc('0x33')],_0x465cfd[_0x4cbc('0x36')]);_0x4dbb72[_0x4cbc('0x38')]=_['intersection'](_0x465cfd[_0x4cbc('0x33')],qs['fields'](_0x29c273[_0x4cbc('0x36')][_0x4cbc('0x37')]));_0x4dbb72[_0x4cbc('0x38')]=_0x4dbb72[_0x4cbc('0x38')][_0x4cbc('0x39')]?_0x4dbb72[_0x4cbc('0x38')]:_0x465cfd[_0x4cbc('0x33')];_0x4dbb72[_0x4cbc('0x3c')]=qs[_0x4cbc('0x3d')](_0x29c273[_0x4cbc('0x36')][_0x4cbc('0x3d')]);_0x4dbb72[_0x4cbc('0x3e')]=qs[_0x4cbc('0x3f')](_['pick'](_0x29c273[_0x4cbc('0x36')],_0x465cfd[_0x4cbc('0x3f')]));if(_0x29c273[_0x4cbc('0x36')]['filter']){_0x4dbb72[_0x4cbc('0x3e')]=_[_0x4cbc('0x41')](_0x4dbb72[_0x4cbc('0x3e')],{'$or':_['map'](_0x4dbb72['attributes'],function(_0x31e05a){var _0x5c0330={};_0x5c0330[_0x31e05a]={'$like':'%'+_0x29c273['query'][_0x4cbc('0x40')]+'%'};return _0x5c0330;})});}_0x4dbb72=_['merge']({},_0x4dbb72,_0x29c273['options']);return _0x2db045[_0x4cbc('0x52')](_0x4dbb72);}})[_0x4cbc('0x27')](function(_0x2303ab){if(_0x2303ab){_0x5bc263=_0x2303ab[_0x4cbc('0x39')];if(!_0x29c273[_0x4cbc('0x36')][_0x4cbc('0x3a')](_0x4cbc('0x3b'))){_0x4dbb72[_0x4cbc('0x20')]=qs[_0x4cbc('0x20')](_0x29c273['query']['limit']);_0x4dbb72[_0x4cbc('0x1e')]=qs[_0x4cbc('0x1e')](_0x29c273['query'][_0x4cbc('0x1e')]);}return _0x2db045[_0x4cbc('0x52')](_0x4dbb72);}})['then'](function(_0x199ff8){if(_0x199ff8){return _0x199ff8?{'count':_0x5bc263,'rows':_0x199ff8}:null;}})[_0x4cbc('0x27')](respondWithResult(_0x425984,null))[_0x4cbc('0x46')](handleError(_0x425984,null));};exports[_0x4cbc('0x53')]=function(_0x4f47cf,_0x2ff4ba,_0x20e5ae){var _0xdc7a51={};var _0x1e5219={};var _0x1507d3;var _0x3a945a;return db[_0x4cbc('0x2f')][_0x4cbc('0x4e')]({'where':{'id':_0x4f47cf[_0x4cbc('0x48')]['id']}})['then'](handleEntityNotFound(_0x2ff4ba,null))[_0x4cbc('0x27')](function(_0x2cb0af){if(_0x2cb0af){_0x1507d3=_0x2cb0af;_0x1e5219[_0x4cbc('0x33')]=_[_0x4cbc('0x34')](db['Tag'][_0x4cbc('0x30')]);_0x1e5219[_0x4cbc('0x36')]=_['keys'](_0x4f47cf['query']);_0x1e5219[_0x4cbc('0x3f')]=_[_0x4cbc('0x35')](_0x1e5219[_0x4cbc('0x33')],_0x1e5219[_0x4cbc('0x36')]);_0xdc7a51[_0x4cbc('0x38')]=_[_0x4cbc('0x35')](_0x1e5219[_0x4cbc('0x33')],qs[_0x4cbc('0x37')](_0x4f47cf[_0x4cbc('0x36')][_0x4cbc('0x37')]));_0xdc7a51[_0x4cbc('0x38')]=_0xdc7a51[_0x4cbc('0x38')][_0x4cbc('0x39')]?_0xdc7a51[_0x4cbc('0x38')]:_0x1e5219[_0x4cbc('0x33')];_0xdc7a51[_0x4cbc('0x3c')]=qs[_0x4cbc('0x3d')](_0x4f47cf[_0x4cbc('0x36')]['sort']);_0xdc7a51[_0x4cbc('0x3e')]=qs['filters'](_[_0x4cbc('0x4f')](_0x4f47cf[_0x4cbc('0x36')],_0x1e5219[_0x4cbc('0x3f')]));if(_0x4f47cf[_0x4cbc('0x36')]['filter']){_0xdc7a51[_0x4cbc('0x3e')]=_[_0x4cbc('0x41')](_0xdc7a51[_0x4cbc('0x3e')],{'$or':_['map'](_0xdc7a51[_0x4cbc('0x38')],function(_0x551d26){var _0x401325={};_0x401325[_0x551d26]={'$like':'%'+_0x4f47cf[_0x4cbc('0x36')]['filter']+'%'};return _0x401325;})});}_0xdc7a51=_['merge']({},_0xdc7a51,_0x4f47cf[_0x4cbc('0x49')]);return _0x1507d3['getTags'](_0xdc7a51);}})[_0x4cbc('0x27')](function(_0x179781){if(_0x179781){_0x3a945a=_0x179781[_0x4cbc('0x39')];if(!_0x4f47cf[_0x4cbc('0x36')][_0x4cbc('0x3a')](_0x4cbc('0x3b'))){_0xdc7a51[_0x4cbc('0x20')]=qs[_0x4cbc('0x20')](_0x4f47cf['query'][_0x4cbc('0x20')]);_0xdc7a51[_0x4cbc('0x1e')]=qs[_0x4cbc('0x1e')](_0x4f47cf[_0x4cbc('0x36')][_0x4cbc('0x1e')]);}return _0x1507d3[_0x4cbc('0x53')](_0xdc7a51);}})[_0x4cbc('0x27')](function(_0x5ec809){if(_0x5ec809){return _0x5ec809?{'count':_0x3a945a,'rows':_0x5ec809}:null;}})[_0x4cbc('0x27')](respondWithResult(_0x2ff4ba,null))[_0x4cbc('0x46')](handleError(_0x2ff4ba,null));};exports[_0x4cbc('0x54')]=function(_0xe611cb,_0x3ab147,_0x317219){if(_0xe611cb[_0x4cbc('0x4c')]['id']){delete _0xe611cb[_0x4cbc('0x4c')]['id'];}return db['DeskConfiguration'][_0x4cbc('0x4e')]({'where':{'id':_0xe611cb['params']['id']}})[_0x4cbc('0x27')](handleEntityNotFound(_0x3ab147,null))['then'](function(_0x141802){if(_0x141802){return _0x141802[_0x4cbc('0x54')](_0xe611cb['body']['ids']||[]);}return null;})[_0x4cbc('0x27')](respondWithResult(_0x3ab147,null))['catch'](handleError(_0x3ab147,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 997da7b..74bac34 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 _0x2981=['bluebird','rimraf','../../config/environment','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','api','moment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2981,0x11a));var _0x1298=function(_0xde2db1,_0x5c6b28){_0xde2db1=_0xde2db1-0x0;var _0x3680e8=_0x2981[_0xde2db1];return _0x3680e8;};'use strict';var _=require(_0x1298('0x0'));var util=require(_0x1298('0x1'));var logger=require('../../config/logger')(_0x1298('0x2'));var moment=require(_0x1298('0x3'));var BPromise=require(_0x1298('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1298('0x5'));var config=require(_0x1298('0x6'));var attributes=require('./intDeskConfiguration.attributes');module[_0x1298('0x7')]=function(_0x386e38,_0x5a7cfe){return _0x386e38[_0x1298('0x8')](_0x1298('0x9'),attributes,{'tableName':_0x1298('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1395=['path','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x50fda9,_0x5ee44b){var _0x36b92b=function(_0x121877){while(--_0x121877){_0x50fda9['push'](_0x50fda9['shift']());}};_0x36b92b(++_0x5ee44b);}(_0x1395,0xc2));var _0x5139=function(_0x4f3126,_0x1499d7){_0x4f3126=_0x4f3126-0x0;var _0x26bad4=_0x1395[_0x4f3126];return _0x26bad4;};'use strict';var _=require(_0x5139('0x0'));var util=require(_0x5139('0x1'));var logger=require(_0x5139('0x2'))(_0x5139('0x3'));var moment=require('moment');var BPromise=require(_0x5139('0x4'));var rp=require(_0x5139('0x5'));var fs=require('fs');var path=require(_0x5139('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x16ffbc,_0x814fe9){return _0x16ffbc[_0x5139('0x7')](_0x5139('0x8'),attributes,{'tableName':_0x5139('0x9'),'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 1574d6a..601bc2c 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 _0xc3f3=['jayson/promise','client','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xc3f3,0xd2));var _0x3c3f=function(_0xea3b52,_0x700ce){_0xea3b52=_0xea3b52-0x0;var _0x282507=_0xc3f3[_0xea3b52];return _0x282507;};'use strict';var _=require('lodash');var util=require(_0x3c3f('0x0'));var moment=require(_0x3c3f('0x1'));var BPromise=require(_0x3c3f('0x2'));var rs=require(_0x3c3f('0x3'));var fs=require('fs');var Redis=require(_0x3c3f('0x4'));var db=require(_0x3c3f('0x5'))['db'];var utils=require(_0x3c3f('0x6'));var logger=require(_0x3c3f('0x7'))(_0x3c3f('0x8'));var config=require(_0x3c3f('0x9'));var jayson=require(_0x3c3f('0xa'));var client=jayson[_0x3c3f('0xb')][_0x3c3f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6e4104,_0x27ddfa,_0x35e9c7){return new BPromise(function(_0x5ef5f2,_0x252a1b){return client[_0x3c3f('0xd')](_0x6e4104,_0x35e9c7)['then'](function(_0x3e6bbb){logger[_0x3c3f('0xe')](_0x3c3f('0xf'),_0x27ddfa,_0x3c3f('0x10'));logger[_0x3c3f('0x11')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x27ddfa,'request\x20sent',JSON['stringify'](_0x3e6bbb));if(_0x3e6bbb['error']){if(_0x3e6bbb[_0x3c3f('0x12')]['code']===0x1f4){logger[_0x3c3f('0x12')](_0x3c3f('0xf'),_0x27ddfa,_0x3e6bbb['error']['message']);return _0x252a1b(_0x3e6bbb[_0x3c3f('0x12')]['message']);}logger[_0x3c3f('0x12')](_0x3c3f('0xf'),_0x27ddfa,_0x3e6bbb[_0x3c3f('0x12')]['message']);return _0x5ef5f2(_0x3e6bbb[_0x3c3f('0x12')]['message']);}else{logger[_0x3c3f('0xe')](_0x3c3f('0xf'),_0x27ddfa,'request\x20sent');_0x5ef5f2(_0x3e6bbb['result']['message']);}})[_0x3c3f('0x13')](function(_0x106eb0){logger[_0x3c3f('0x12')](_0x3c3f('0xf'),_0x27ddfa,_0x106eb0);_0x252a1b(_0x106eb0);});});} \ No newline at end of file +var _0x49a1=['lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x57ed1c,_0xd33f1b){var _0x222b97=function(_0x156849){while(--_0x156849){_0x57ed1c['push'](_0x57ed1c['shift']());}};_0x222b97(++_0xd33f1b);}(_0x49a1,0x190));var _0x149a=function(_0x1482b0,_0x90da2e){_0x1482b0=_0x1482b0-0x0;var _0x323667=_0x49a1[_0x1482b0];return _0x323667;};'use strict';var _=require(_0x149a('0x0'));var util=require(_0x149a('0x1'));var moment=require(_0x149a('0x2'));var BPromise=require(_0x149a('0x3'));var rs=require(_0x149a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x149a('0x5'))(_0x149a('0x6'));var config=require('../../config/environment');var jayson=require(_0x149a('0x7'));var client=jayson[_0x149a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x872ee2,_0x50a30c,_0x138c81){return new BPromise(function(_0x208de9,_0x49a8c2){return client[_0x149a('0x9')](_0x872ee2,_0x138c81)[_0x149a('0xa')](function(_0x22ebe9){logger[_0x149a('0xb')](_0x149a('0xc'),_0x50a30c,_0x149a('0xd'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x50a30c,_0x149a('0xd'),JSON[_0x149a('0xe')](_0x22ebe9));if(_0x22ebe9[_0x149a('0xf')]){if(_0x22ebe9[_0x149a('0xf')][_0x149a('0x10')]===0x1f4){logger[_0x149a('0xf')](_0x149a('0xc'),_0x50a30c,_0x22ebe9['error']['message']);return _0x49a8c2(_0x22ebe9[_0x149a('0xf')]['message']);}logger[_0x149a('0xf')](_0x149a('0xc'),_0x50a30c,_0x22ebe9[_0x149a('0xf')][_0x149a('0x11')]);return _0x208de9(_0x22ebe9[_0x149a('0xf')][_0x149a('0x11')]);}else{logger[_0x149a('0xb')](_0x149a('0xc'),_0x50a30c,_0x149a('0xd'));_0x208de9(_0x22ebe9[_0x149a('0x12')]['message']);}})[_0x149a('0x13')](function(_0x47ea71){logger[_0x149a('0xf')](_0x149a('0xc'),_0x50a30c,_0x47ea71);_0x49a8c2(_0x47ea71);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 0347531..f02904b 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 _0x65d1=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x65d1,0xd0));var _0x165d=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0x65d1[_0x35ef6b];return _0x3ad145;};'use strict';var multer=require(_0x165d('0x0'));var util=require(_0x165d('0x1'));var path=require(_0x165d('0x2'));var timeout=require(_0x165d('0x3'));var express=require(_0x165d('0x4'));var router=express[_0x165d('0x5')]();var fs_extra=require(_0x165d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x165d('0x7'));var config=require(_0x165d('0x8'));var controller=require(_0x165d('0x9'));router[_0x165d('0xa')]('/',auth[_0x165d('0xb')](),controller[_0x165d('0xc')]);router[_0x165d('0xa')](_0x165d('0xd'),auth[_0x165d('0xb')](),controller[_0x165d('0xe')]);router[_0x165d('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x165d('0x10')](_0x165d('0xd'),auth[_0x165d('0xb')](),controller[_0x165d('0x11')]);router[_0x165d('0x12')](_0x165d('0xd'),auth[_0x165d('0xb')](),controller[_0x165d('0x13')]);module[_0x165d('0x14')]=router; \ No newline at end of file +var _0xf14f=['show','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x5f1df6,_0xeb9b36){var _0x516679=function(_0x16ee3d){while(--_0x16ee3d){_0x5f1df6['push'](_0x5f1df6['shift']());}};_0x516679(++_0xeb9b36);}(_0xf14f,0x1e2));var _0xff14=function(_0x49a57c,_0x2eb02c){_0x49a57c=_0x49a57c-0x0;var _0x4e0316=_0xf14f[_0x49a57c];return _0x4e0316;};'use strict';var multer=require('multer');var util=require(_0xff14('0x0'));var path=require(_0xff14('0x1'));var timeout=require(_0xff14('0x2'));var express=require('express');var router=express[_0xff14('0x3')]();var fs_extra=require(_0xff14('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xff14('0x5'));var config=require(_0xff14('0x6'));var controller=require(_0xff14('0x7'));router[_0xff14('0x8')]('/',auth[_0xff14('0x9')](),controller[_0xff14('0xa')]);router[_0xff14('0x8')](_0xff14('0xb'),auth[_0xff14('0x9')](),controller[_0xff14('0xc')]);router[_0xff14('0xd')]('/',auth['isAuthenticated'](),controller[_0xff14('0xe')]);router[_0xff14('0xf')](_0xff14('0xb'),auth['isAuthenticated'](),controller[_0xff14('0x10')]);router['delete'](_0xff14('0xb'),auth[_0xff14('0x9')](),controller[_0xff14('0x11')]);module[_0xff14('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 762a184..3362da9 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 _0xe151=['customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','ENUM','string'];(function(_0x4047ff,_0x35f66c){var _0x5b05d9=function(_0x54245b){while(--_0x54245b){_0x4047ff['push'](_0x4047ff['shift']());}};_0x5b05d9(++_0x35f66c);}(_0xe151,0x1d1));var _0x1e15=function(_0x1b4b01,_0x43eb55){_0x1b4b01=_0x1b4b01-0x0;var _0x521446=_0xe151[_0x1b4b01];return _0x521446;};'use strict';var Sequelize=require(_0x1e15('0x0'));module['exports']={'type':{'type':Sequelize[_0x1e15('0x1')](_0x1e15('0x2'),'variable',_0x1e15('0x3'),_0x1e15('0x4'),_0x1e15('0x5')),'defaultValue':_0x1e15('0x2')},'content':{'type':Sequelize[_0x1e15('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1e15('0x1')](_0x1e15('0x2'),_0x1e15('0x7'),_0x1e15('0x3'))},'keyContent':{'type':Sequelize[_0x1e15('0x6')]},'idField':{'type':Sequelize[_0x1e15('0x6')]},'nameField':{'type':Sequelize[_0x1e15('0x6')]},'customField':{'type':Sequelize[_0x1e15('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1e15('0x6')]}}; \ No newline at end of file +var _0x7b83=['customVariable','keyValue','string','STRING','variable','sequelize','exports','ENUM'];(function(_0x1e0bf9,_0x5b61ba){var _0x5090e0=function(_0x4481c1){while(--_0x4481c1){_0x1e0bf9['push'](_0x1e0bf9['shift']());}};_0x5090e0(++_0x5b61ba);}(_0x7b83,0xfd));var _0x37b8=function(_0x2d932f,_0x4460ea){_0x2d932f=_0x2d932f-0x0;var _0x1bee20=_0x7b83[_0x2d932f];return _0x1bee20;};'use strict';var Sequelize=require(_0x37b8('0x0'));module[_0x37b8('0x1')]={'type':{'type':Sequelize[_0x37b8('0x2')]('string','variable',_0x37b8('0x3'),_0x37b8('0x4'),'picklist'),'defaultValue':_0x37b8('0x5')},'content':{'type':Sequelize[_0x37b8('0x6')]},'key':{'type':Sequelize[_0x37b8('0x6')]},'keyType':{'type':Sequelize[_0x37b8('0x2')](_0x37b8('0x5'),_0x37b8('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x37b8('0x6')]},'idField':{'type':Sequelize[_0x37b8('0x6')]},'nameField':{'type':Sequelize[_0x37b8('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x37b8('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index f240693..340e560 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 _0xfca0=['bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','index','DeskField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','catch','show','params','length','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1c6752,_0x59cb9d){var _0x3ffb41=function(_0x491203){while(--_0x491203){_0x1c6752['push'](_0x1c6752['shift']());}};_0x3ffb41(++_0x59cb9d);}(_0xfca0,0x171));var _0x0fca=function(_0x4444dc,_0x3751d8){_0x4444dc=_0x4444dc-0x0;var _0x530d38=_0xfca0[_0x4444dc];return _0x530d38;};'use strict';var emlformat=require(_0x0fca('0x0'));var rimraf=require(_0x0fca('0x1'));var zipdir=require(_0x0fca('0x2'));var jsonpatch=require(_0x0fca('0x3'));var rp=require(_0x0fca('0x4'));var moment=require(_0x0fca('0x5'));var BPromise=require(_0x0fca('0x6'));var Mustache=require(_0x0fca('0x7'));var util=require('util');var path=require(_0x0fca('0x8'));var sox=require(_0x0fca('0x9'));var csv=require(_0x0fca('0xa'));var ejs=require(_0x0fca('0xb'));var fs=require('fs');var fs_extra=require(_0x0fca('0xc'));var _=require(_0x0fca('0xd'));var squel=require(_0x0fca('0xe'));var crypto=require(_0x0fca('0xf'));var jsforce=require(_0x0fca('0x10'));var deskjs=require(_0x0fca('0x11'));var toCsv=require(_0x0fca('0xa'));var querystring=require(_0x0fca('0x12'));var Papa=require(_0x0fca('0x13'));var Redis=require(_0x0fca('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0fca('0x15'));var hardwareService=require(_0x0fca('0x16'));var logger=require('../../config/logger')(_0x0fca('0x17'));var utils=require('../../config/utils');var config=require(_0x0fca('0x18'));var licenseUtil=require(_0x0fca('0x19'));var db=require(_0x0fca('0x1a'))['db'];function respondWithStatusCode(_0x1ad9fa,_0x3b8bf2){_0x3b8bf2=_0x3b8bf2||0xcc;return function(_0x56c66f){if(_0x56c66f){return _0x1ad9fa[_0x0fca('0x1b')](_0x3b8bf2);}return _0x1ad9fa[_0x0fca('0x1c')](_0x3b8bf2)[_0x0fca('0x1d')]();};}function respondWithResult(_0x44a894,_0x2fe06c){_0x2fe06c=_0x2fe06c||0xc8;return function(_0x1b8277){if(_0x1b8277){return _0x44a894[_0x0fca('0x1c')](_0x2fe06c)[_0x0fca('0x1e')](_0x1b8277);}};}function respondWithFilteredResult(_0x19526f,_0x11fcfd){return function(_0x3e8387){if(_0x3e8387){var _0xe6c8fd=typeof _0x11fcfd[_0x0fca('0x1f')]===_0x0fca('0x20')&&typeof _0x11fcfd[_0x0fca('0x21')]===_0x0fca('0x20');var _0x5adc55=_0x3e8387[_0x0fca('0x22')];var _0x864681=_0xe6c8fd?0x0:_0x11fcfd[_0x0fca('0x1f')];var _0x387d53=_0xe6c8fd?_0x3e8387['count']:_0x11fcfd['offset']+_0x11fcfd[_0x0fca('0x21')];var _0x35aba9;if(_0x387d53>=_0x5adc55){_0x387d53=_0x5adc55;_0x35aba9=0xc8;}else{_0x35aba9=0xce;}_0x19526f[_0x0fca('0x1c')](_0x35aba9);return _0x19526f[_0x0fca('0x23')](_0x0fca('0x24'),_0x864681+'-'+_0x387d53+'/'+_0x5adc55)['json'](_0x3e8387);}return null;};}function patchUpdates(_0x4b6ff0){return function(_0xd7e72){try{jsonpatch[_0x0fca('0x25')](_0xd7e72,_0x4b6ff0,!![]);}catch(_0xc636a2){return BPromise[_0x0fca('0x26')](_0xc636a2);}return _0xd7e72['save']();};}function saveUpdates(_0x437859,_0x43ac51){return function(_0x401d4b){if(_0x401d4b){return _0x401d4b[_0x0fca('0x27')](_0x437859)[_0x0fca('0x28')](function(_0x395f84){return _0x395f84;});}return null;};}function removeEntity(_0xf20c39,_0x513997){return function(_0x465695){if(_0x465695){return _0x465695['destroy']()[_0x0fca('0x28')](function(){_0xf20c39[_0x0fca('0x1c')](0xcc)[_0x0fca('0x1d')]();});}};}function handleEntityNotFound(_0x1ed9b0,_0x21bd9b){return function(_0x2e5d05){if(!_0x2e5d05){_0x1ed9b0['sendStatus'](0x194);}return _0x2e5d05;};}function handleError(_0xb8bee6,_0x4defbb){_0x4defbb=_0x4defbb||0x1f4;return function(_0x39f02d){logger[_0x0fca('0x29')](_0x39f02d[_0x0fca('0x2a')]);if(_0x39f02d[_0x0fca('0x2b')]){delete _0x39f02d[_0x0fca('0x2b')];}_0xb8bee6[_0x0fca('0x1c')](_0x4defbb)['send'](_0x39f02d);};}exports[_0x0fca('0x2c')]=function(_0x1b7474,_0xd56047){var _0x1bcf6d={},_0x5b98fb={},_0x4313cf={'count':0x0,'rows':[]};var _0x51a464=_['map'](db[_0x0fca('0x2d')][_0x0fca('0x2e')],function(_0x64f0c9){return{'name':_0x64f0c9[_0x0fca('0x2f')],'type':_0x64f0c9[_0x0fca('0x30')][_0x0fca('0x31')]};});_0x5b98fb[_0x0fca('0x32')]=_['map'](_0x51a464,_0x0fca('0x2b'));_0x5b98fb['query']=_[_0x0fca('0x33')](_0x1b7474[_0x0fca('0x34')]);_0x5b98fb[_0x0fca('0x35')]=_[_0x0fca('0x36')](_0x5b98fb[_0x0fca('0x32')],_0x5b98fb['query']);_0x1bcf6d[_0x0fca('0x37')]=_[_0x0fca('0x36')](_0x5b98fb[_0x0fca('0x32')],qs['fields'](_0x1b7474[_0x0fca('0x34')][_0x0fca('0x38')]));_0x1bcf6d[_0x0fca('0x37')]=_0x1bcf6d['attributes']['length']?_0x1bcf6d[_0x0fca('0x37')]:_0x5b98fb['model'];if(!_0x1b7474[_0x0fca('0x34')]['hasOwnProperty'](_0x0fca('0x39'))){_0x1bcf6d[_0x0fca('0x21')]=qs[_0x0fca('0x21')](_0x1b7474[_0x0fca('0x34')]['limit']);_0x1bcf6d[_0x0fca('0x1f')]=qs[_0x0fca('0x1f')](_0x1b7474[_0x0fca('0x34')]['offset']);}_0x1bcf6d['order']=qs['sort'](_0x1b7474['query'][_0x0fca('0x3a')]);_0x1bcf6d['where']=qs['filters'](_[_0x0fca('0x3b')](_0x1b7474[_0x0fca('0x34')],_0x5b98fb[_0x0fca('0x35')]),_0x51a464);if(_0x1b7474[_0x0fca('0x34')][_0x0fca('0x3c')]){_0x1bcf6d[_0x0fca('0x3d')]=_[_0x0fca('0x3e')](_0x1bcf6d['where'],{'$or':_['map'](_0x51a464,function(_0x2bc9a1){if(_0x2bc9a1[_0x0fca('0x30')]!==_0x0fca('0x3f')){var _0x4f2bda={};_0x4f2bda[_0x2bc9a1['name']]={'$like':'%'+_0x1b7474[_0x0fca('0x34')]['filter']+'%'};return _0x4f2bda;}})});}_0x1bcf6d=_[_0x0fca('0x3e')]({},_0x1bcf6d,_0x1b7474[_0x0fca('0x40')]);var _0x318f24={'where':_0x1bcf6d['where']};return db[_0x0fca('0x2d')][_0x0fca('0x22')](_0x318f24)['then'](function(_0x19aa2f){_0x4313cf[_0x0fca('0x22')]=_0x19aa2f;if(_0x1b7474[_0x0fca('0x34')][_0x0fca('0x41')]){_0x1bcf6d['include']=[{'all':!![]}];}return db[_0x0fca('0x2d')]['findAll'](_0x1bcf6d);})['then'](function(_0x37b604){_0x4313cf['rows']=_0x37b604;return _0x4313cf;})['then'](respondWithFilteredResult(_0xd56047,_0x1bcf6d))[_0x0fca('0x42')](handleError(_0xd56047,null));};exports[_0x0fca('0x43')]=function(_0x2c71f2,_0x2efdb6){var _0x3211a6={'raw':!![],'where':{'id':_0x2c71f2[_0x0fca('0x44')]['id']}},_0xa3d3ff={};_0xa3d3ff[_0x0fca('0x32')]=_['keys'](db['DeskField'][_0x0fca('0x2e')]);_0xa3d3ff['query']=_['keys'](_0x2c71f2['query']);_0xa3d3ff[_0x0fca('0x35')]=_[_0x0fca('0x36')](_0xa3d3ff[_0x0fca('0x32')],_0xa3d3ff[_0x0fca('0x34')]);_0x3211a6[_0x0fca('0x37')]=_['intersection'](_0xa3d3ff[_0x0fca('0x32')],qs[_0x0fca('0x38')](_0x2c71f2[_0x0fca('0x34')][_0x0fca('0x38')]));_0x3211a6[_0x0fca('0x37')]=_0x3211a6[_0x0fca('0x37')][_0x0fca('0x45')]?_0x3211a6[_0x0fca('0x37')]:_0xa3d3ff[_0x0fca('0x32')];if(_0x2c71f2['query']['includeAll']){_0x3211a6[_0x0fca('0x46')]=[{'all':!![]}];}_0x3211a6=_[_0x0fca('0x3e')]({},_0x3211a6,_0x2c71f2[_0x0fca('0x40')]);return db[_0x0fca('0x2d')][_0x0fca('0x47')](_0x3211a6)[_0x0fca('0x28')](handleEntityNotFound(_0x2efdb6,null))[_0x0fca('0x28')](respondWithResult(_0x2efdb6,null))[_0x0fca('0x42')](handleError(_0x2efdb6,null));};exports[_0x0fca('0x48')]=function(_0x200496,_0x47971c){return db[_0x0fca('0x2d')][_0x0fca('0x48')](_0x200496[_0x0fca('0x49')],{})['then'](respondWithResult(_0x47971c,0xc9))[_0x0fca('0x42')](handleError(_0x47971c,null));};exports[_0x0fca('0x27')]=function(_0xcccfda,_0x5720ad){if(_0xcccfda[_0x0fca('0x49')]['id']){delete _0xcccfda[_0x0fca('0x49')]['id'];}return db[_0x0fca('0x2d')][_0x0fca('0x47')]({'where':{'id':_0xcccfda[_0x0fca('0x44')]['id']}})[_0x0fca('0x28')](handleEntityNotFound(_0x5720ad,null))[_0x0fca('0x28')](saveUpdates(_0xcccfda[_0x0fca('0x49')],null))[_0x0fca('0x28')](respondWithResult(_0x5720ad,null))[_0x0fca('0x42')](handleError(_0x5720ad,null));};exports[_0x0fca('0x4a')]=function(_0x37285e,_0x81b62f){return db[_0x0fca('0x2d')][_0x0fca('0x47')]({'where':{'id':_0x37285e['params']['id']}})[_0x0fca('0x28')](handleEntityNotFound(_0x81b62f,null))[_0x0fca('0x28')](removeEntity(_0x81b62f,null))[_0x0fca('0x42')](handleError(_0x81b62f,null));}; \ No newline at end of file +var _0xe978=['apply','reject','save','update','then','error','stack','name','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','order','where','pick','filter','merge','options','DeskField','includeAll','include','findAll','rows','catch','find','create','body','params','destroy','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json'];(function(_0x52949d,_0x5750ec){var _0x570250=function(_0xd9636a){while(--_0xd9636a){_0x52949d['push'](_0x52949d['shift']());}};_0x570250(++_0x5750ec);}(_0xe978,0x70));var _0x8e97=function(_0x438f87,_0x24d44a){_0x438f87=_0x438f87-0x0;var _0x4159ad=_0xe978[_0x438f87];return _0x4159ad;};'use strict';var emlformat=require(_0x8e97('0x0'));var rimraf=require(_0x8e97('0x1'));var zipdir=require(_0x8e97('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8e97('0x3'));var BPromise=require(_0x8e97('0x4'));var Mustache=require(_0x8e97('0x5'));var util=require(_0x8e97('0x6'));var path=require(_0x8e97('0x7'));var sox=require('sox');var csv=require(_0x8e97('0x8'));var ejs=require(_0x8e97('0x9'));var fs=require('fs');var fs_extra=require(_0x8e97('0xa'));var _=require(_0x8e97('0xb'));var squel=require(_0x8e97('0xc'));var crypto=require('crypto');var jsforce=require(_0x8e97('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8e97('0x8'));var querystring=require(_0x8e97('0xe'));var Papa=require(_0x8e97('0xf'));var Redis=require('ioredis');var authService=require(_0x8e97('0x10'));var qs=require(_0x8e97('0x11'));var as=require(_0x8e97('0x12'));var hardwareService=require(_0x8e97('0x13'));var logger=require(_0x8e97('0x14'))(_0x8e97('0x15'));var utils=require(_0x8e97('0x16'));var config=require(_0x8e97('0x17'));var licenseUtil=require(_0x8e97('0x18'));var db=require(_0x8e97('0x19'))['db'];function respondWithStatusCode(_0x23215e,_0x4f45ee){_0x4f45ee=_0x4f45ee||0xcc;return function(_0x3d2c93){if(_0x3d2c93){return _0x23215e[_0x8e97('0x1a')](_0x4f45ee);}return _0x23215e[_0x8e97('0x1b')](_0x4f45ee)[_0x8e97('0x1c')]();};}function respondWithResult(_0x4df8d3,_0x5051e8){_0x5051e8=_0x5051e8||0xc8;return function(_0x583c0a){if(_0x583c0a){return _0x4df8d3['status'](_0x5051e8)['json'](_0x583c0a);}};}function respondWithFilteredResult(_0x5e2725,_0x17bc97){return function(_0x4fc685){if(_0x4fc685){var _0x33b6b3=typeof _0x17bc97[_0x8e97('0x1d')]==='undefined'&&typeof _0x17bc97['limit']===_0x8e97('0x1e');var _0x3f3738=_0x4fc685[_0x8e97('0x1f')];var _0x2f475c=_0x33b6b3?0x0:_0x17bc97[_0x8e97('0x1d')];var _0x2b823e=_0x33b6b3?_0x4fc685[_0x8e97('0x1f')]:_0x17bc97[_0x8e97('0x1d')]+_0x17bc97[_0x8e97('0x20')];var _0x596d71;if(_0x2b823e>=_0x3f3738){_0x2b823e=_0x3f3738;_0x596d71=0xc8;}else{_0x596d71=0xce;}_0x5e2725[_0x8e97('0x1b')](_0x596d71);return _0x5e2725[_0x8e97('0x21')](_0x8e97('0x22'),_0x2f475c+'-'+_0x2b823e+'/'+_0x3f3738)[_0x8e97('0x23')](_0x4fc685);}return null;};}function patchUpdates(_0x9bb69f){return function(_0xa2968a){try{jsonpatch[_0x8e97('0x24')](_0xa2968a,_0x9bb69f,!![]);}catch(_0x5a5c99){return BPromise[_0x8e97('0x25')](_0x5a5c99);}return _0xa2968a[_0x8e97('0x26')]();};}function saveUpdates(_0x2b1b01,_0x305686){return function(_0x387748){if(_0x387748){return _0x387748[_0x8e97('0x27')](_0x2b1b01)[_0x8e97('0x28')](function(_0x18fcdb){return _0x18fcdb;});}return null;};}function removeEntity(_0x3c13de,_0x5dde33){return function(_0x517c1e){if(_0x517c1e){return _0x517c1e['destroy']()['then'](function(){_0x3c13de[_0x8e97('0x1b')](0xcc)[_0x8e97('0x1c')]();});}};}function handleEntityNotFound(_0x2be986,_0xcee009){return function(_0x1bae19){if(!_0x1bae19){_0x2be986[_0x8e97('0x1a')](0x194);}return _0x1bae19;};}function handleError(_0x8ffc5b,_0xc48542){_0xc48542=_0xc48542||0x1f4;return function(_0x5cc6fc){logger[_0x8e97('0x29')](_0x5cc6fc[_0x8e97('0x2a')]);if(_0x5cc6fc[_0x8e97('0x2b')]){delete _0x5cc6fc['name'];}_0x8ffc5b[_0x8e97('0x1b')](_0xc48542)['send'](_0x5cc6fc);};}exports[_0x8e97('0x2c')]=function(_0x7f3ea1,_0xa5b3de){var _0x2f7919={},_0xb1ce05={},_0x65a7b5={'count':0x0,'rows':[]};var _0x180b9d=_['map'](db['DeskField'][_0x8e97('0x2d')],function(_0x364296){return{'name':_0x364296[_0x8e97('0x2e')],'type':_0x364296[_0x8e97('0x2f')]['key']};});_0xb1ce05[_0x8e97('0x30')]=_[_0x8e97('0x31')](_0x180b9d,_0x8e97('0x2b'));_0xb1ce05[_0x8e97('0x32')]=_[_0x8e97('0x33')](_0x7f3ea1['query']);_0xb1ce05[_0x8e97('0x34')]=_[_0x8e97('0x35')](_0xb1ce05[_0x8e97('0x30')],_0xb1ce05[_0x8e97('0x32')]);_0x2f7919[_0x8e97('0x36')]=_['intersection'](_0xb1ce05[_0x8e97('0x30')],qs['fields'](_0x7f3ea1[_0x8e97('0x32')][_0x8e97('0x37')]));_0x2f7919[_0x8e97('0x36')]=_0x2f7919[_0x8e97('0x36')][_0x8e97('0x38')]?_0x2f7919['attributes']:_0xb1ce05[_0x8e97('0x30')];if(!_0x7f3ea1[_0x8e97('0x32')]['hasOwnProperty']('nolimit')){_0x2f7919[_0x8e97('0x20')]=qs[_0x8e97('0x20')](_0x7f3ea1[_0x8e97('0x32')]['limit']);_0x2f7919[_0x8e97('0x1d')]=qs[_0x8e97('0x1d')](_0x7f3ea1[_0x8e97('0x32')][_0x8e97('0x1d')]);}_0x2f7919[_0x8e97('0x39')]=qs['sort'](_0x7f3ea1[_0x8e97('0x32')]['sort']);_0x2f7919[_0x8e97('0x3a')]=qs[_0x8e97('0x34')](_[_0x8e97('0x3b')](_0x7f3ea1['query'],_0xb1ce05['filters']),_0x180b9d);if(_0x7f3ea1[_0x8e97('0x32')][_0x8e97('0x3c')]){_0x2f7919[_0x8e97('0x3a')]=_['merge'](_0x2f7919['where'],{'$or':_[_0x8e97('0x31')](_0x180b9d,function(_0x200772){if(_0x200772[_0x8e97('0x2f')]!=='VIRTUAL'){var _0x4b50da={};_0x4b50da[_0x200772[_0x8e97('0x2b')]]={'$like':'%'+_0x7f3ea1['query'][_0x8e97('0x3c')]+'%'};return _0x4b50da;}})});}_0x2f7919=_[_0x8e97('0x3d')]({},_0x2f7919,_0x7f3ea1[_0x8e97('0x3e')]);var _0x5a95c4={'where':_0x2f7919[_0x8e97('0x3a')]};return db[_0x8e97('0x3f')][_0x8e97('0x1f')](_0x5a95c4)['then'](function(_0x305eae){_0x65a7b5[_0x8e97('0x1f')]=_0x305eae;if(_0x7f3ea1[_0x8e97('0x32')][_0x8e97('0x40')]){_0x2f7919[_0x8e97('0x41')]=[{'all':!![]}];}return db[_0x8e97('0x3f')][_0x8e97('0x42')](_0x2f7919);})[_0x8e97('0x28')](function(_0x4c1180){_0x65a7b5[_0x8e97('0x43')]=_0x4c1180;return _0x65a7b5;})[_0x8e97('0x28')](respondWithFilteredResult(_0xa5b3de,_0x2f7919))[_0x8e97('0x44')](handleError(_0xa5b3de,null));};exports['show']=function(_0x8e9af1,_0x4e5355){var _0x267164={'raw':!![],'where':{'id':_0x8e9af1['params']['id']}},_0x60a881={};_0x60a881['model']=_[_0x8e97('0x33')](db[_0x8e97('0x3f')][_0x8e97('0x2d')]);_0x60a881[_0x8e97('0x32')]=_[_0x8e97('0x33')](_0x8e9af1[_0x8e97('0x32')]);_0x60a881[_0x8e97('0x34')]=_['intersection'](_0x60a881[_0x8e97('0x30')],_0x60a881[_0x8e97('0x32')]);_0x267164[_0x8e97('0x36')]=_[_0x8e97('0x35')](_0x60a881[_0x8e97('0x30')],qs[_0x8e97('0x37')](_0x8e9af1['query'][_0x8e97('0x37')]));_0x267164[_0x8e97('0x36')]=_0x267164[_0x8e97('0x36')]['length']?_0x267164['attributes']:_0x60a881[_0x8e97('0x30')];if(_0x8e9af1[_0x8e97('0x32')][_0x8e97('0x40')]){_0x267164[_0x8e97('0x41')]=[{'all':!![]}];}_0x267164=_[_0x8e97('0x3d')]({},_0x267164,_0x8e9af1[_0x8e97('0x3e')]);return db['DeskField'][_0x8e97('0x45')](_0x267164)[_0x8e97('0x28')](handleEntityNotFound(_0x4e5355,null))[_0x8e97('0x28')](respondWithResult(_0x4e5355,null))[_0x8e97('0x44')](handleError(_0x4e5355,null));};exports['create']=function(_0x6f4c34,_0x5dc103){return db['DeskField'][_0x8e97('0x46')](_0x6f4c34[_0x8e97('0x47')],{})[_0x8e97('0x28')](respondWithResult(_0x5dc103,0xc9))[_0x8e97('0x44')](handleError(_0x5dc103,null));};exports[_0x8e97('0x27')]=function(_0x48cc94,_0x2d4243){if(_0x48cc94[_0x8e97('0x47')]['id']){delete _0x48cc94[_0x8e97('0x47')]['id'];}return db[_0x8e97('0x3f')][_0x8e97('0x45')]({'where':{'id':_0x48cc94[_0x8e97('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d4243,null))['then'](saveUpdates(_0x48cc94[_0x8e97('0x47')],null))[_0x8e97('0x28')](respondWithResult(_0x2d4243,null))['catch'](handleError(_0x2d4243,null));};exports[_0x8e97('0x49')]=function(_0x48752d,_0x291ab9){return db['DeskField']['find']({'where':{'id':_0x48752d[_0x8e97('0x48')]['id']}})[_0x8e97('0x28')](handleEntityNotFound(_0x291ab9,null))[_0x8e97('0x28')](removeEntity(_0x291ab9,null))[_0x8e97('0x44')](handleError(_0x291ab9,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 3f627fe..c1dc245 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 _0xf00e=['idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','exports','define','int_desk_fields','desk_unique_index'];(function(_0x1dcd4d,_0x1ae1b0){var _0x6d5c8f=function(_0x1982ef){while(--_0x1982ef){_0x1dcd4d['push'](_0x1dcd4d['shift']());}};_0x6d5c8f(++_0x1ae1b0);}(_0xf00e,0x84));var _0xef00=function(_0x2d8b2a,_0x29c865){_0x2d8b2a=_0x2d8b2a-0x0;var _0x4da796=_0xf00e[_0x2d8b2a];return _0x4da796;};'use strict';var _=require(_0xef00('0x0'));var util=require(_0xef00('0x1'));var logger=require(_0xef00('0x2'))(_0xef00('0x3'));var moment=require(_0xef00('0x4'));var BPromise=require('bluebird');var rp=require(_0xef00('0x5'));var fs=require('fs');var path=require(_0xef00('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0xef00('0x7')]=function(_0x41221d,_0x5e2c8a){return _0x41221d[_0xef00('0x8')]('DeskField',attributes,{'tableName':_0xef00('0x9'),'paranoid':![],'indexes':[{'name':_0xef00('0xa'),'fields':[_0xef00('0xb'),_0xef00('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b7f=['api','moment','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','int_desk_fields','idField','FieldId','lodash','util'];(function(_0x435801,_0x2b1487){var _0x126695=function(_0x325d41){while(--_0x325d41){_0x435801['push'](_0x435801['shift']());}};_0x126695(++_0x2b1487);}(_0x1b7f,0x1e8));var _0xf1b7=function(_0x4307a2,_0x5a058b){_0x4307a2=_0x4307a2-0x0;var _0x14bedb=_0x1b7f[_0x4307a2];return _0x14bedb;};'use strict';var _=require(_0xf1b7('0x0'));var util=require(_0xf1b7('0x1'));var logger=require('../../config/logger')(_0xf1b7('0x2'));var moment=require(_0xf1b7('0x3'));var BPromise=require('bluebird');var rp=require(_0xf1b7('0x4'));var fs=require('fs');var path=require(_0xf1b7('0x5'));var rimraf=require(_0xf1b7('0x6'));var config=require(_0xf1b7('0x7'));var attributes=require(_0xf1b7('0x8'));module[_0xf1b7('0x9')]=function(_0x88ef82,_0xbdfb1f){return _0x88ef82[_0xf1b7('0xa')]('DeskField',attributes,{'tableName':_0xf1b7('0xb'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xf1b7('0xc'),_0xf1b7('0xd')],'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 50fe97a..0488677 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 _0xa0d1=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','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'];(function(_0x1f3e14,_0x2320f6){var _0x5a8fb4=function(_0x5ddb59){while(--_0x5ddb59){_0x1f3e14['push'](_0x1f3e14['shift']());}};_0x5a8fb4(++_0x2320f6);}(_0xa0d1,0x142));var _0x1a0d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa0d1[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x1a0d('0x0'));var moment=require(_0x1a0d('0x1'));var BPromise=require(_0x1a0d('0x2'));var rs=require(_0x1a0d('0x3'));var fs=require('fs');var Redis=require(_0x1a0d('0x4'));var db=require(_0x1a0d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a0d('0x6'))(_0x1a0d('0x7'));var config=require(_0x1a0d('0x8'));var jayson=require(_0x1a0d('0x9'));var client=jayson['client'][_0x1a0d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a2104,_0x49c611,_0x51026b){return new BPromise(function(_0x3a48c0,_0x593642){return client[_0x1a0d('0xb')](_0x4a2104,_0x51026b)[_0x1a0d('0xc')](function(_0x47cf1e){logger[_0x1a0d('0xd')](_0x1a0d('0xe'),_0x49c611,_0x1a0d('0xf'));logger[_0x1a0d('0x10')](_0x1a0d('0x11'),_0x49c611,_0x1a0d('0xf'),JSON[_0x1a0d('0x12')](_0x47cf1e));if(_0x47cf1e[_0x1a0d('0x13')]){if(_0x47cf1e[_0x1a0d('0x13')][_0x1a0d('0x14')]===0x1f4){logger['error'](_0x1a0d('0xe'),_0x49c611,_0x47cf1e['error'][_0x1a0d('0x15')]);return _0x593642(_0x47cf1e[_0x1a0d('0x13')]['message']);}logger[_0x1a0d('0x13')](_0x1a0d('0xe'),_0x49c611,_0x47cf1e[_0x1a0d('0x13')][_0x1a0d('0x15')]);return _0x3a48c0(_0x47cf1e['error'][_0x1a0d('0x15')]);}else{logger[_0x1a0d('0xd')]('DeskField,\x20%s,\x20%s',_0x49c611,_0x1a0d('0xf'));_0x3a48c0(_0x47cf1e[_0x1a0d('0x16')][_0x1a0d('0x15')]);}})['catch'](function(_0x3bdf49){logger['error'](_0x1a0d('0xe'),_0x49c611,_0x3bdf49);_0x593642(_0x3bdf49);});});} \ No newline at end of file +var _0xb0a3=['request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xb0a3,0x132));var _0x3b0a=function(_0xdbd4f7,_0x4e3bdd){_0xdbd4f7=_0xdbd4f7-0x0;var _0x5c3f9d=_0xb0a3[_0xdbd4f7];return _0x5c3f9d;};'use strict';var _=require(_0x3b0a('0x0'));var util=require('util');var moment=require(_0x3b0a('0x1'));var BPromise=require(_0x3b0a('0x2'));var rs=require(_0x3b0a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3b0a('0x4'))(_0x3b0a('0x5'));var config=require(_0x3b0a('0x6'));var jayson=require(_0x3b0a('0x7'));var client=jayson[_0x3b0a('0x8')][_0x3b0a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5de514,_0x350f39,_0x3a30a8){return new BPromise(function(_0x39015a,_0x4a53a5){return client[_0x3b0a('0xa')](_0x5de514,_0x3a30a8)[_0x3b0a('0xb')](function(_0x319e10){logger[_0x3b0a('0xc')](_0x3b0a('0xd'),_0x350f39,_0x3b0a('0xe'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x350f39,'request\x20sent',JSON[_0x3b0a('0xf')](_0x319e10));if(_0x319e10[_0x3b0a('0x10')]){if(_0x319e10[_0x3b0a('0x10')]['code']===0x1f4){logger[_0x3b0a('0x10')]('DeskField,\x20%s,\x20%s',_0x350f39,_0x319e10[_0x3b0a('0x10')][_0x3b0a('0x11')]);return _0x4a53a5(_0x319e10[_0x3b0a('0x10')][_0x3b0a('0x11')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x350f39,_0x319e10['error'][_0x3b0a('0x11')]);return _0x39015a(_0x319e10[_0x3b0a('0x10')][_0x3b0a('0x11')]);}else{logger[_0x3b0a('0xc')]('DeskField,\x20%s,\x20%s',_0x350f39,_0x3b0a('0xe'));_0x39015a(_0x319e10[_0x3b0a('0x12')][_0x3b0a('0x11')]);}})[_0x3b0a('0x13')](function(_0x255d1a){logger['error'](_0x3b0a('0xd'),_0x350f39,_0x255d1a);_0x4a53a5(_0x255d1a);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 8ebf479..7d7a706 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 _0x0470=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','update','delete','destroy','exports','multer','util'];(function(_0x35952d,_0x2e3e02){var _0x52cc84=function(_0x561dde){while(--_0x561dde){_0x35952d['push'](_0x35952d['shift']());}};_0x52cc84(++_0x2e3e02);}(_0x0470,0x18e));var _0x0047=function(_0x20f695,_0x21a170){_0x20f695=_0x20f695-0x0;var _0x418a1f=_0x0470[_0x20f695];return _0x418a1f;};'use strict';var multer=require(_0x0047('0x0'));var util=require(_0x0047('0x1'));var path=require(_0x0047('0x2'));var timeout=require(_0x0047('0x3'));var express=require('express');var router=express[_0x0047('0x4')]();var fs_extra=require(_0x0047('0x5'));var auth=require(_0x0047('0x6'));var interaction=require(_0x0047('0x7'));var config=require(_0x0047('0x8'));var controller=require(_0x0047('0x9'));router[_0x0047('0xa')]('/',auth['isAuthenticated'](),controller[_0x0047('0xb')]);router[_0x0047('0xa')](_0x0047('0xc'),auth[_0x0047('0xd')](),controller[_0x0047('0xe')]);router[_0x0047('0xa')](_0x0047('0xf'),auth[_0x0047('0xd')](),controller[_0x0047('0x10')]);router[_0x0047('0xa')](_0x0047('0x11'),auth['isAuthenticated'](),controller[_0x0047('0x12')]);router[_0x0047('0x13')]('/',auth[_0x0047('0xd')](),controller['create']);router[_0x0047('0x13')](_0x0047('0xf'),auth[_0x0047('0xd')](),controller['addConfiguration']);router[_0x0047('0x14')](_0x0047('0xc'),auth[_0x0047('0xd')](),controller[_0x0047('0x15')]);router[_0x0047('0x16')]('/:id',auth[_0x0047('0xd')](),controller[_0x0047('0x17')]);module[_0x0047('0x18')]=router; \ No newline at end of file +var _0x65cf=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./intDynamics365Account.controller','isAuthenticated','index','get'];(function(_0x14476b,_0xd1a7a4){var _0x24e2e8=function(_0x52ed26){while(--_0x52ed26){_0x14476b['push'](_0x14476b['shift']());}};_0x24e2e8(++_0xd1a7a4);}(_0x65cf,0x181));var _0xf65c=function(_0x5b6966,_0x289c63){_0x5b6966=_0x5b6966-0x0;var _0x1563c1=_0x65cf[_0x5b6966];return _0x1563c1;};'use strict';var multer=require(_0xf65c('0x0'));var util=require(_0xf65c('0x1'));var path=require(_0xf65c('0x2'));var timeout=require('connect-timeout');var express=require(_0xf65c('0x3'));var router=express[_0xf65c('0x4')]();var fs_extra=require(_0xf65c('0x5'));var auth=require(_0xf65c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf65c('0x7'));router['get']('/',auth[_0xf65c('0x8')](),controller[_0xf65c('0x9')]);router[_0xf65c('0xa')](_0xf65c('0xb'),auth[_0xf65c('0x8')](),controller[_0xf65c('0xc')]);router[_0xf65c('0xa')](_0xf65c('0xd'),auth[_0xf65c('0x8')](),controller[_0xf65c('0xe')]);router[_0xf65c('0xa')](_0xf65c('0xf'),auth[_0xf65c('0x8')](),controller['getFields']);router['post']('/',auth[_0xf65c('0x8')](),controller[_0xf65c('0x10')]);router[_0xf65c('0x11')](_0xf65c('0xd'),auth[_0xf65c('0x8')](),controller['addConfiguration']);router[_0xf65c('0x12')](_0xf65c('0xb'),auth[_0xf65c('0x8')](),controller['update']);router[_0xf65c('0x13')](_0xf65c('0xb'),auth[_0xf65c('0x8')](),controller[_0xf65c('0x14')]);module[_0xf65c('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 95fad6a..b2a65ef 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 _0x36bb=['STRING','BOOLEAN','sequelize','exports'];(function(_0x1a7671,_0x4280c6){var _0x352eb8=function(_0x3cc1be){while(--_0x3cc1be){_0x1a7671['push'](_0x1a7671['shift']());}};_0x352eb8(++_0x4280c6);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb36b('0x0'));module[_0xb36b('0x1')]={'name':{'type':Sequelize[_0xb36b('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb36b('0x2')]},'remoteUri':{'type':Sequelize[_0xb36b('0x2')]},'tenantId':{'type':Sequelize[_0xb36b('0x2')]},'clientId':{'type':Sequelize[_0xb36b('0x2')]},'clientSecret':{'type':Sequelize[_0xb36b('0x2')]},'serverUrl':{'type':Sequelize[_0xb36b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb36b('0x2')]},'modernAuthentication':{'type':Sequelize[_0xb36b('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xfd7b=['STRING','BOOLEAN','exports'];(function(_0x414655,_0x79d916){var _0x237884=function(_0x2737d9){while(--_0x2737d9){_0x414655['push'](_0x414655['shift']());}};_0x237884(++_0x79d916);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xfd7b[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require('sequelize');module[_0xbfd7('0x0')]={'name':{'type':Sequelize[_0xbfd7('0x1')]},'username':{'type':Sequelize[_0xbfd7('0x1')]},'password':{'type':Sequelize[_0xbfd7('0x1')]},'remoteUri':{'type':Sequelize[_0xbfd7('0x1')]},'tenantId':{'type':Sequelize[_0xbfd7('0x1')]},'clientId':{'type':Sequelize[_0xbfd7('0x1')]},'clientSecret':{'type':Sequelize[_0xbfd7('0x1')]},'serverUrl':{'type':Sequelize[_0xbfd7('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xbfd7('0x1')]},'modernAuthentication':{'type':Sequelize[_0xbfd7('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 3f66f0c..e4be3e1 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 _0xe82b=['billedserviceunits','contactidyominame','createdbyexternalpartyname','createdbyname','createdon','createdonbehalfbyname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','password','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','https://login.microsoftonline.com/','username','access_token','GET','Bearer\x20','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','@odata.type','substring','PicklistAttributeMetadata','push','all','forEach','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','stack','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','Value','DisplayName',')/Attributes(','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','offset','limit','undefined','count','set','Content-Range','update','then','end','sendStatus','error','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','show','params','length','create','body','catch','find','destroy','getConfigurations','findOne','Dynamics365Configuration','filter','hasOwnProperty','Subjects','channel','type','Descriptions','getDescriptions','Dynamics365Field','slice','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','PhoneCall','title','ownerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits'];(function(_0x1c83c9,_0x2a0efc){var _0x49c840=function(_0x2945e2){while(--_0x2945e2){_0x1c83c9['push'](_0x1c83c9['shift']());}};_0x49c840(++_0x2a0efc);}(_0xe82b,0x11a));var _0xbe82=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xe82b[_0x2b10c6];return _0x3789d2;};'use strict';var rp=require(_0xbe82('0x0'));var util=require(_0xbe82('0x1'));var _=require('lodash');var qs=require(_0xbe82('0x2'));var logger=require(_0xbe82('0x3'))(_0xbe82('0x4'));var db=require(_0xbe82('0x5'))['db'];var integrations=require(_0xbe82('0x6'));function respondWithResult(_0x3230dc,_0x4c28ba){_0x4c28ba=_0x4c28ba||0xc8;return function(_0x4494b7){if(_0x4494b7){return _0x3230dc[_0xbe82('0x7')](_0x4c28ba)['json'](_0x4494b7);}};}function respondWithFilteredResult(_0x1f02d7,_0x8b963e){return function(_0x28066f){if(_0x28066f){var _0x1e3cdc=typeof _0x8b963e[_0xbe82('0x8')]==='undefined'&&typeof _0x8b963e[_0xbe82('0x9')]===_0xbe82('0xa');var _0x442f18=_0x28066f[_0xbe82('0xb')];var _0xc7e0e5=_0x1e3cdc?0x0:_0x8b963e[_0xbe82('0x8')];var _0x27acb6=_0x1e3cdc?_0x28066f[_0xbe82('0xb')]:_0x8b963e[_0xbe82('0x8')]+_0x8b963e[_0xbe82('0x9')];var _0x23c289;if(_0x27acb6>=_0x442f18){_0x27acb6=_0x442f18;_0x23c289=0xc8;}else{_0x23c289=0xce;}_0x1f02d7[_0xbe82('0x7')](_0x23c289);return _0x1f02d7[_0xbe82('0xc')](_0xbe82('0xd'),_0xc7e0e5+'-'+_0x27acb6+'/'+_0x442f18)['json'](_0x28066f);}return null;};}function saveUpdates(_0x13c596){return function(_0x494a50){if(_0x494a50){return _0x494a50[_0xbe82('0xe')](_0x13c596)['then'](function(_0x293047){return _0x293047;});}return null;};}function removeEntity(_0x137592){return function(_0x5485ee){if(_0x5485ee){return _0x5485ee['destroy']()[_0xbe82('0xf')](function(){_0x137592[_0xbe82('0x7')](0xcc)[_0xbe82('0x10')]();});}};}function handleEntityNotFound(_0x57a734){return function(_0x3067a7){if(!_0x3067a7){_0x57a734[_0xbe82('0x11')](0x194);}return _0x3067a7;};}function handleError(_0x553d5d,_0x23e1b4){_0x23e1b4=_0x23e1b4||0x1f4;return function(_0x6684cc){logger[_0xbe82('0x12')](_0x6684cc['stack']);if(_0x6684cc['name']){delete _0x6684cc[_0xbe82('0x13')];}_0x553d5d[_0xbe82('0x7')](_0x23e1b4)[_0xbe82('0x14')](_0x6684cc);};}exports[_0xbe82('0x15')]=function(_0x12c528,_0x3949f9){var _0x302aba={},_0x76503b={},_0x4f5241={'count':0x0,'rows':[]};var _0x3c3e26=_[_0xbe82('0x16')](db[_0xbe82('0x17')][_0xbe82('0x18')],function(_0xb1c433){return{'name':_0xb1c433[_0xbe82('0x19')],'type':_0xb1c433['type'][_0xbe82('0x1a')]};});_0x76503b[_0xbe82('0x1b')]=_[_0xbe82('0x16')](_0x3c3e26,_0xbe82('0x13'));_0x76503b[_0xbe82('0x1c')]=_[_0xbe82('0x1d')](_0x12c528[_0xbe82('0x1c')]);_0x76503b[_0xbe82('0x1e')]=_['intersection'](_0x76503b['model'],_0x76503b[_0xbe82('0x1c')]);_0x302aba['attributes']=_[_0xbe82('0x1f')](_0x76503b[_0xbe82('0x1b')],qs[_0xbe82('0x20')](_0x12c528[_0xbe82('0x1c')][_0xbe82('0x20')]));_0x302aba[_0xbe82('0x21')]=_0x302aba['attributes']['length']?_0x302aba[_0xbe82('0x21')]:_0x76503b[_0xbe82('0x1b')];if(!_0x12c528['query']['hasOwnProperty'](_0xbe82('0x22'))){_0x302aba[_0xbe82('0x9')]=qs['limit'](_0x12c528[_0xbe82('0x1c')][_0xbe82('0x9')]);_0x302aba[_0xbe82('0x8')]=qs[_0xbe82('0x8')](_0x12c528[_0xbe82('0x1c')][_0xbe82('0x8')]);}_0x302aba[_0xbe82('0x23')]=qs[_0xbe82('0x24')](_0x12c528[_0xbe82('0x1c')][_0xbe82('0x24')]);_0x302aba[_0xbe82('0x25')]=qs[_0xbe82('0x1e')](_[_0xbe82('0x26')](_0x12c528['query'],_0x76503b[_0xbe82('0x1e')]),_0x3c3e26);if(_0x12c528[_0xbe82('0x1c')]['filter']){_0x302aba[_0xbe82('0x25')]=_[_0xbe82('0x27')](_0x302aba['where'],{'$or':_[_0xbe82('0x16')](_0x3c3e26,function(_0x237709){if(_0x237709['type']!=='VIRTUAL'){var _0x2c6699={};_0x2c6699[_0x237709[_0xbe82('0x13')]]={'$like':'%'+_0x12c528['query']['filter']+'%'};return _0x2c6699;}})});}_0x302aba=_['merge']({},_0x302aba,_0x12c528[_0xbe82('0x28')]);var _0x3db192={'where':_0x302aba[_0xbe82('0x25')]};return db['Dynamics365Account'][_0xbe82('0xb')](_0x3db192)[_0xbe82('0xf')](function(_0x4ef6c4){_0x4f5241[_0xbe82('0xb')]=_0x4ef6c4;if(_0x12c528['query'][_0xbe82('0x29')]){_0x302aba[_0xbe82('0x2a')]=[{'all':!![]}];}return db[_0xbe82('0x17')][_0xbe82('0x2b')](_0x302aba);})[_0xbe82('0xf')](function(_0x5af31b){_0x4f5241['rows']=_0x5af31b;return _0x4f5241;})[_0xbe82('0xf')](respondWithFilteredResult(_0x3949f9,_0x302aba))['catch'](handleError(_0x3949f9,null));};exports[_0xbe82('0x2c')]=function(_0x3de99c,_0x2e260f){var _0x3abc8c={'raw':![],'where':{'id':_0x3de99c[_0xbe82('0x2d')]['id']}},_0x58850b={};_0x58850b['model']=_[_0xbe82('0x1d')](db[_0xbe82('0x17')][_0xbe82('0x18')]);_0x58850b[_0xbe82('0x1c')]=_[_0xbe82('0x1d')](_0x3de99c[_0xbe82('0x1c')]);_0x58850b[_0xbe82('0x1e')]=_['intersection'](_0x58850b[_0xbe82('0x1b')],_0x58850b[_0xbe82('0x1c')]);_0x3abc8c[_0xbe82('0x21')]=_[_0xbe82('0x1f')](_0x58850b['model'],qs[_0xbe82('0x20')](_0x3de99c[_0xbe82('0x1c')][_0xbe82('0x20')]));_0x3abc8c[_0xbe82('0x21')]=_0x3abc8c[_0xbe82('0x21')][_0xbe82('0x2e')]?_0x3abc8c[_0xbe82('0x21')]:_0x58850b[_0xbe82('0x1b')];if(_0x3de99c[_0xbe82('0x1c')][_0xbe82('0x29')]){_0x3abc8c[_0xbe82('0x2a')]=[{'all':!![]}];}_0x3abc8c=_[_0xbe82('0x27')]({},_0x3abc8c,_0x3de99c['options']);return db[_0xbe82('0x17')]['find'](_0x3abc8c)[_0xbe82('0xf')](handleEntityNotFound(_0x2e260f,null))[_0xbe82('0xf')](respondWithResult(_0x2e260f,null))['catch'](handleError(_0x2e260f,null));};exports[_0xbe82('0x2f')]=function(_0x30e1ae,_0x4c2f5b){return db[_0xbe82('0x17')][_0xbe82('0x2f')](_0x30e1ae[_0xbe82('0x30')],{})[_0xbe82('0xf')](respondWithResult(_0x4c2f5b,0xc9))[_0xbe82('0x31')](handleError(_0x4c2f5b,null));};exports[_0xbe82('0xe')]=function(_0xc1b56d,_0x4627ba){if(_0xc1b56d[_0xbe82('0x30')]['id']){delete _0xc1b56d['body']['id'];}return db[_0xbe82('0x17')][_0xbe82('0x32')]({'where':{'id':_0xc1b56d[_0xbe82('0x2d')]['id']}})[_0xbe82('0xf')](handleEntityNotFound(_0x4627ba,null))[_0xbe82('0xf')](saveUpdates(_0xc1b56d[_0xbe82('0x30')],null))['then'](respondWithResult(_0x4627ba,null))[_0xbe82('0x31')](handleError(_0x4627ba,null));};exports[_0xbe82('0x33')]=function(_0x57881d,_0xa788f4){return db[_0xbe82('0x17')][_0xbe82('0x32')]({'where':{'id':_0x57881d[_0xbe82('0x2d')]['id']}})[_0xbe82('0xf')](handleEntityNotFound(_0xa788f4,null))['then'](removeEntity(_0xa788f4,null))[_0xbe82('0x31')](handleError(_0xa788f4,null));};exports[_0xbe82('0x34')]=function(_0x26988e,_0xd9c719){var _0x1c498f={};var _0x5d2131={};var _0x3e00da;var _0x9941cd;return db[_0xbe82('0x17')][_0xbe82('0x35')]({'where':{'id':_0x26988e[_0xbe82('0x2d')]['id']}})[_0xbe82('0xf')](handleEntityNotFound(_0xd9c719,null))[_0xbe82('0xf')](function(_0x39f08e){if(_0x39f08e){_0x3e00da=_0x39f08e;_0x5d2131['model']=_[_0xbe82('0x1d')](db[_0xbe82('0x36')][_0xbe82('0x18')]);_0x5d2131[_0xbe82('0x1c')]=_[_0xbe82('0x1d')](_0x26988e[_0xbe82('0x1c')]);_0x5d2131['filters']=_['intersection'](_0x5d2131[_0xbe82('0x1b')],_0x5d2131[_0xbe82('0x1c')]);_0x1c498f['attributes']=_['intersection'](_0x5d2131[_0xbe82('0x1b')],qs[_0xbe82('0x20')](_0x26988e[_0xbe82('0x1c')]['fields']));_0x1c498f[_0xbe82('0x21')]=_0x1c498f[_0xbe82('0x21')][_0xbe82('0x2e')]?_0x1c498f[_0xbe82('0x21')]:_0x5d2131[_0xbe82('0x1b')];_0x1c498f[_0xbe82('0x23')]=qs[_0xbe82('0x24')](_0x26988e['query']['sort']);_0x1c498f[_0xbe82('0x25')]=qs[_0xbe82('0x1e')](_['pick'](_0x26988e['query'],_0x5d2131['filters']));if(_0x26988e[_0xbe82('0x1c')]['filter']){_0x1c498f['where']=_[_0xbe82('0x27')](_0x1c498f[_0xbe82('0x25')],{'$or':_[_0xbe82('0x16')](_0x1c498f[_0xbe82('0x21')],function(_0x361815){var _0x24492a={};_0x24492a[_0x361815]={'$like':'%'+_0x26988e[_0xbe82('0x1c')][_0xbe82('0x37')]+'%'};return _0x24492a;})});}_0x1c498f=_[_0xbe82('0x27')]({},_0x1c498f,_0x26988e[_0xbe82('0x28')]);return _0x3e00da[_0xbe82('0x34')](_0x1c498f);}})[_0xbe82('0xf')](function(_0x1f029b){if(_0x1f029b){_0x9941cd=_0x1f029b[_0xbe82('0x2e')];if(!_0x26988e['query'][_0xbe82('0x38')](_0xbe82('0x22'))){_0x1c498f['limit']=qs[_0xbe82('0x9')](_0x26988e[_0xbe82('0x1c')][_0xbe82('0x9')]);_0x1c498f['offset']=qs[_0xbe82('0x8')](_0x26988e[_0xbe82('0x1c')]['offset']);}return _0x3e00da[_0xbe82('0x34')](_0x1c498f);}})[_0xbe82('0xf')](function(_0x194f44){if(_0x194f44){return _0x194f44?{'count':_0x9941cd,'rows':_0x194f44}:null;}})[_0xbe82('0xf')](respondWithResult(_0xd9c719,null))[_0xbe82('0x31')](handleError(_0xd9c719,null));};exports['addConfiguration']=function(_0x30136,_0x4ff916){if(_0x30136['body']['id']){delete _0x30136['body']['id'];}return db[_0xbe82('0x17')]['findOne']({'where':{'id':_0x30136[_0xbe82('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4ff916,null))[_0xbe82('0xf')](function(_0x13426f){if(_0x13426f){_0x30136[_0xbe82('0x30')]['AccountId']=_0x13426f['id'];_0x30136[_0xbe82('0x30')][_0xbe82('0x39')]=integrations['getSubjects'](_0x30136[_0xbe82('0x30')][_0xbe82('0x3a')],_0x30136[_0xbe82('0x30')][_0xbe82('0x3b')]);_0x30136[_0xbe82('0x30')][_0xbe82('0x3c')]=integrations[_0xbe82('0x3d')](_0x30136[_0xbe82('0x30')][_0xbe82('0x3a')],_0x30136[_0xbe82('0x30')]['type']);return db[_0xbe82('0x36')][_0xbe82('0x2f')](_0x30136['body'],{'include':[{'model':db[_0xbe82('0x3e')],'as':_0xbe82('0x39')},{'model':db['Dynamics365Field'],'as':_0xbe82('0x3c')}]});}return null;})[_0xbe82('0xf')](respondWithResult(_0x4ff916,null))[_0xbe82('0x31')](handleError(_0x4ff916,null));};function sanitizeRemoteUri(_0x536a5d){var _0x577d34=_0x536a5d[_0xbe82('0x3f')](-0x1);if(_0x577d34==='/')return _0x536a5d['substring'](0x0,_0x536a5d[_0xbe82('0x40')](_0x577d34));return _0x536a5d;}function getWebApiUrl(_0x2643e5){return util[_0xbe82('0x41')](_0xbe82('0x42'),_0x2643e5);}exports[_0xbe82('0x43')]=function(_0x4bdcf6,_0x843180){var _0x52dafe=_0x4bdcf6[_0xbe82('0x1c')][_0xbe82('0x44')];var _0x460e86=_0x52dafe===_0xbe82('0x45')?'Incident':_0xbe82('0x46');var _0x1fb774='';var _0x450818='';var _0xfea4df='';var _0x108cab='';var _0x30f575='';var _0x2b7118='';var _0x333492='';var _0x499a3c='';var _0x64edd1=[_0xbe82('0x47'),'description','customerid',_0xbe82('0x48'),'caseorigincode',_0xbe82('0x49'),_0xbe82('0x4a'),_0xbe82('0x4b'),_0xbe82('0x4c'),_0xbe82('0x4d')];var _0x16e431=['accountidname',_0xbe82('0x4e'),_0xbe82('0x4f'),_0xbe82('0x50'),'contactidname',_0xbe82('0x51'),'contractdetailidname','contractidname',_0xbe82('0x52'),'createdbyexternalpartyyominame',_0xbe82('0x53'),'createdbyyominame',_0xbe82('0x54'),_0xbe82('0x55'),'createdonbehalfbyyominame','customeridname',_0xbe82('0x56'),_0xbe82('0x57'),_0xbe82('0x58'),'entitlementidname',_0xbe82('0x59'),'entityimage_url','escalatedon',_0xbe82('0x5a'),_0xbe82('0x5b'),_0xbe82('0x5c'),'importsequencenumber',_0xbe82('0x5d'),_0xbe82('0x5e'),_0xbe82('0x5f'),_0xbe82('0x60'),_0xbe82('0x61'),_0xbe82('0x62'),'modifiedbyname',_0xbe82('0x63'),'modifiedon','modifiedonbehalfbyname',_0xbe82('0x64'),_0xbe82('0x65'),_0xbe82('0x66'),_0xbe82('0x67'),_0xbe82('0x68'),'overriddencreatedon',_0xbe82('0x69'),_0xbe82('0x6a'),_0xbe82('0x6b'),_0xbe82('0x6c'),_0xbe82('0x6d'),'primarycontactidyominame','prioritycodename',_0xbe82('0x6e'),_0xbe82('0x6f'),_0xbe82('0x70'),_0xbe82('0x71'),_0xbe82('0x72'),'responsiblecontactidname',_0xbe82('0x73'),_0xbe82('0x74'),_0xbe82('0x75'),_0xbe82('0x76'),_0xbe82('0x77'),'statecode',_0xbe82('0x78'),_0xbe82('0x79'),'ticketnumber',_0xbe82('0x7a'),_0xbe82('0x7b'),'traversedpath',_0xbe82('0x7c'),_0xbe82('0x7d')];var _0x2739b9=_0x64edd1[_0xbe82('0x7e')](_0x16e431);return db[_0xbe82('0x17')][_0xbe82('0x35')]({'where':{'id':_0x4bdcf6[_0xbe82('0x2d')]['id']},'attributes':['id','username',_0xbe82('0x7f'),'remoteUri','tenantId',_0xbe82('0x80'),_0xbe82('0x81'),_0xbe82('0x82')],'include':[{'model':db[_0xbe82('0x83')],'as':_0xbe82('0x83'),'attributes':['id',_0xbe82('0x84'),_0xbe82('0x85')]}]})[_0xbe82('0xf')](handleEntityNotFound(_0x843180,null))[_0xbe82('0xf')](function(_0x490142){if(_0x490142){if(_0x490142[_0xbe82('0x82')]){_0x490142['access_token']=_0x490142[_0xbe82('0x83')]['data5'];_0x499a3c=sanitizeRemoteUri(_0x490142[_0xbe82('0x83')]['data7']);_0x333492=getWebApiUrl(_0x499a3c);return _0x490142;}_0x499a3c=sanitizeRemoteUri(_0x490142['remoteUri']);_0x333492=getWebApiUrl(_0x499a3c);var _0x507848={'method':_0xbe82('0x86'),'uri':_0xbe82('0x87')+_0x490142['tenantId']+'/oauth2/token','form':{'client_id':_0x490142[_0xbe82('0x80')],'resource':_0x499a3c,'username':_0x490142[_0xbe82('0x88')],'password':_0x490142[_0xbe82('0x7f')],'grant_type':_0xbe82('0x7f'),'client_secret':_0x490142[_0xbe82('0x81')]},'json':!![]};return rp(_0x507848);}})['then'](function(_0x11efa4){_0x2b7118=_0x11efa4[_0xbe82('0x89')];var _0x481b56={'method':_0xbe82('0x8a'),'uri':encodeURI(_0x333492+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x460e86+'\x27'),'headers':{'Authorization':_0xbe82('0x8b')+_0x2b7118,'If-None-Match':null,'OData-Version':_0xbe82('0x8c')},'json':!![]};return rp(_0x481b56);})[_0xbe82('0xf')](function(_0x112664){var _0xb7b5bf=_0x112664['value'][0x0];var _0x1216f6=_0xb7b5bf[_0xbe82('0x8d')];var _0x93759e={'method':_0xbe82('0x8a'),'uri':_0x333492+_0xbe82('0x8e')+_0x1216f6+_0xbe82('0x8f'),'headers':{'Authorization':_0xbe82('0x8b')+_0x2b7118,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x93759e);})['then'](function(_0xb8a300){_0x1fb774=_0xb8a300;_0x450818=_0x1fb774[_0xbe82('0x90')];_0x450818=_['remove'](_0x450818,function(_0x226427){return!_0x2739b9[_0xbe82('0x91')](_0x226427[_0xbe82('0x92')]);});var _0xcb2b70=[];var _0x5d32e7=[];_0x450818['forEach'](function(_0x43bf6a){if(_0x43bf6a[_0xbe82('0x93')]){var _0x53fd97=_0x43bf6a['@odata.type'][_0xbe82('0x94')](_0x43bf6a['@odata.type'][_0xbe82('0x40')]('.')+0x1);if(_0x53fd97===_0xbe82('0x95')){_0xcb2b70[_0xbe82('0x96')](getSelectList(_0x333492,_0x52dafe,_0x5d32e7,_0x1fb774[_0xbe82('0x8d')],_0x43bf6a[_0xbe82('0x8d')],_0x2b7118));}}});return Promise[_0xbe82('0x97')](_0xcb2b70);})[_0xbe82('0xf')](function(_0x15e632){_0xfea4df=_0x15e632[0x0];var _0x55c118=[];var _0x57d165=[];_0x450818[_0xbe82('0x98')](function(_0x2a80a6){if(!_[_0xbe82('0x99')](_0x2a80a6[_0xbe82('0x93')])){var _0x9df6d8=_0x2a80a6[_0xbe82('0x93')]['substring'](_0x2a80a6[_0xbe82('0x93')][_0xbe82('0x40')]('.')+0x1);if(_0x9df6d8==='BooleanAttributeMetadata'){_0x55c118[_0xbe82('0x96')](getBooleanList(_0x333492,_0x52dafe,_0x57d165,_0x1fb774['MetadataId'],_0x2a80a6[_0xbe82('0x8d')],_0x2b7118));}}});return Promise[_0xbe82('0x97')](_0x55c118);})[_0xbe82('0xf')](function(_0x47b385){_0x108cab=_0x47b385[0x0];var _0x5bfc10=[];var _0x220f0c=[];_0x450818[_0xbe82('0x98')](function(_0x2026ac){if(_0x2026ac['@odata.type']){var _0x3a8380=_0x2026ac[_0xbe82('0x93')][_0xbe82('0x94')](_0x2026ac['@odata.type'][_0xbe82('0x40')]('.')+0x1);if(_0x3a8380===_0xbe82('0x9a')||_0x3a8380===_0xbe82('0x9b')||_0x3a8380===_0xbe82('0x9c')||_0x3a8380===_0xbe82('0x9d')||_0x3a8380===_0xbe82('0x9e')||_0x3a8380===_0xbe82('0x9f')||_0x3a8380===_0xbe82('0xa0')||_0x3a8380===_0xbe82('0xa1')||_0x3a8380===_0xbe82('0xa2')||_0x3a8380===_0xbe82('0xa3')){_0x5bfc10[_0xbe82('0x96')](getInputList(_0x333492,_0x52dafe,_0x3a8380,_0x220f0c,_0x1fb774[_0xbe82('0x8d')],_0x2026ac[_0xbe82('0x8d')],_0x2b7118));}}});return Promise[_0xbe82('0x97')](_0x5bfc10);})[_0xbe82('0xf')](function(_0x45a367){_0x30f575=_0x45a367[0x0];var _0x19cf78=_0xfea4df[_0xbe82('0x7e')](_0x108cab)[_0xbe82('0x7e')](_0x30f575);var _0xc2751f={'count':_0x19cf78[_0xbe82('0x2e')],'rows':_0x19cf78};return _0xc2751f;})[_0xbe82('0xf')](respondWithResult(_0x843180,null))[_0xbe82('0x31')](function(_0x35ed82){var _0xd2c1f3=_0x4bdcf6[_0xbe82('0x1c')][_0xbe82('0xa4')]?0x1f4:_0x35ed82['statusCode']||0x1f4;logger[_0xbe82('0x12')](_0x35ed82[_0xbe82('0xa5')]);delete _0x35ed82['name'];if(_0xd2c1f3===0x191){_0xd2c1f3=0x190;}_0x843180[_0xbe82('0x7')](_0xd2c1f3)[_0xbe82('0x14')](_0x4bdcf6['query'][_0xbe82('0xa4')]?{'message':_0xbe82('0xa6'),'statusCode':_0x35ed82['statusCode']}:_0x35ed82);});};function getSelectList(_0x50d8a1,_0xe61a2b,_0x2a2340,_0x15b8d7,_0x509509,_0x34bd74){var _0x1ff831={'method':_0xbe82('0x8a'),'uri':_0x50d8a1+_0xbe82('0x8e')+_0x15b8d7+')/Attributes('+_0x509509+_0xbe82('0xa7')+_0xbe82('0xa8'),'headers':{'Authorization':_0xbe82('0x8b')+_0x34bd74,'If-None-Match':null,'OData-Version':_0xbe82('0x8c')},'json':!![]};return rp(_0x1ff831)['then'](function(_0x3fb14c){var _0x2cf92a=[];var _0x4a7eb6=_0x3fb14c[_0xbe82('0xa9')][_0xbe82('0xaa')];_0x4a7eb6['forEach'](function(_0x2e4021){_0x2cf92a['push']({'name':_0x2e4021['Label'][_0xbe82('0xab')][_0xbe82('0xac')],'value':String(_0x2e4021[_0xbe82('0xad')])});});var _0x3f6bfc={'id':_0xe61a2b+'_'+_0x3fb14c[_0xbe82('0x92')],'name':_0x3fb14c[_0xbe82('0xae')][_0xbe82('0xab')][_0xbe82('0xac')],'custom':![],'options':_0x2cf92a};_0x2a2340[_0xbe82('0x96')](_0x3f6bfc);return _0x2a2340;});}function getBooleanList(_0x3cac60,_0x1f61da,_0x16cfaf,_0x34a463,_0xe29ce8,_0x5b13fe){var _0x565d61={'method':_0xbe82('0x8a'),'uri':_0x3cac60+_0xbe82('0x8e')+_0x34a463+_0xbe82('0xaf')+_0xe29ce8+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xbe82('0x8b')+_0x5b13fe,'If-None-Match':null,'OData-Version':_0xbe82('0x8c')},'json':!![]};return rp(_0x565d61)[_0xbe82('0xf')](function(_0x598a77){var _0x12278b=[];_0x12278b[_0xbe82('0x96')]({'name':_0x598a77[_0xbe82('0xa9')][_0xbe82('0xb0')][_0xbe82('0xac')][_0xbe82('0xab')]['Label'],'value':_0xbe82('0xb1')},{'name':_0x598a77[_0xbe82('0xa9')]['FalseOption']['Label'][_0xbe82('0xab')][_0xbe82('0xac')],'value':_0xbe82('0xb2')});var _0x4aacea={'id':_0x1f61da+'_'+_0x598a77[_0xbe82('0x92')],'name':_0x598a77['DisplayName'][_0xbe82('0xab')][_0xbe82('0xac')],'custom':![],'options':_0x12278b};_0x16cfaf['push'](_0x4aacea);return _0x16cfaf;});}function getInputList(_0x311244,_0xe10d75,_0x58c422,_0x7d3f4f,_0x22c1b0,_0x325093,_0xac97d7){var _0x4bd3f4={'method':_0xbe82('0x8a'),'uri':_0x311244+_0xbe82('0x8e')+_0x22c1b0+_0xbe82('0xaf')+_0x325093+_0xbe82('0xb3')+_0x58c422+_0xbe82('0xb4'),'headers':{'Authorization':_0xbe82('0x8b')+_0xac97d7,'If-None-Match':null,'OData-Version':_0xbe82('0x8c')},'json':!![]};return rp(_0x4bd3f4)[_0xbe82('0xf')](function(_0x5950da){var _0x11f80c={'id':_0xe10d75+'_'+_0x5950da[_0xbe82('0x92')],'name':_0x5950da[_0xbe82('0xae')][_0xbe82('0xab')]?_0x5950da[_0xbe82('0xae')][_0xbe82('0xab')][_0xbe82('0xac')]:_0x5950da[_0xbe82('0x92')],'custom':![],'options':[]};_0x7d3f4f[_0xbe82('0x96')](_0x11f80c);return _0x7d3f4f;});} \ No newline at end of file +var _0xa9dc=['actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','POST','https://login.microsoftonline.com/','password','access_token','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','BooleanAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','error','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','sendStatus','stack','name','send','map','Dynamics365Account','rawAttributes','key','query','keys','filters','intersection','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','getConfigurations','findOne','Dynamics365Configuration','length','AccountId','Subjects','channel','Dynamics365Field','Descriptions','substring','lastIndexOf','format','getFields','PhoneCall','title','description','customerid','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame'];(function(_0x341872,_0x470a0f){var _0x37269c=function(_0x1e2fdf){while(--_0x1e2fdf){_0x341872['push'](_0x341872['shift']());}};_0x37269c(++_0x470a0f);}(_0xa9dc,0x71));var _0xca9d=function(_0x35387d,_0x1ba72f){_0x35387d=_0x35387d-0x0;var _0x3aba56=_0xa9dc[_0x35387d];return _0x3aba56;};'use strict';var rp=require(_0xca9d('0x0'));var util=require('util');var _=require(_0xca9d('0x1'));var qs=require(_0xca9d('0x2'));var logger=require(_0xca9d('0x3'))(_0xca9d('0x4'));var db=require(_0xca9d('0x5'))['db'];var integrations=require(_0xca9d('0x6'));function respondWithResult(_0x3b10fa,_0x2fa026){_0x2fa026=_0x2fa026||0xc8;return function(_0x11e151){if(_0x11e151){return _0x3b10fa[_0xca9d('0x7')](_0x2fa026)[_0xca9d('0x8')](_0x11e151);}};}function respondWithFilteredResult(_0x430520,_0x27db3e){return function(_0x3a635c){if(_0x3a635c){var _0x45320b=typeof _0x27db3e['offset']===_0xca9d('0x9')&&typeof _0x27db3e[_0xca9d('0xa')]===_0xca9d('0x9');var _0x2b58e6=_0x3a635c[_0xca9d('0xb')];var _0x9c9cbd=_0x45320b?0x0:_0x27db3e[_0xca9d('0xc')];var _0x2bb4cc=_0x45320b?_0x3a635c['count']:_0x27db3e[_0xca9d('0xc')]+_0x27db3e[_0xca9d('0xa')];var _0x597433;if(_0x2bb4cc>=_0x2b58e6){_0x2bb4cc=_0x2b58e6;_0x597433=0xc8;}else{_0x597433=0xce;}_0x430520[_0xca9d('0x7')](_0x597433);return _0x430520[_0xca9d('0xd')](_0xca9d('0xe'),_0x9c9cbd+'-'+_0x2bb4cc+'/'+_0x2b58e6)[_0xca9d('0x8')](_0x3a635c);}return null;};}function saveUpdates(_0xe004b3){return function(_0x375e2e){if(_0x375e2e){return _0x375e2e[_0xca9d('0xf')](_0xe004b3)['then'](function(_0x5ee64f){return _0x5ee64f;});}return null;};}function removeEntity(_0x3c2a3){return function(_0x55e8f1){if(_0x55e8f1){return _0x55e8f1[_0xca9d('0x10')]()['then'](function(){_0x3c2a3[_0xca9d('0x7')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27fe11){return function(_0x4d63dc){if(!_0x4d63dc){_0x27fe11[_0xca9d('0x11')](0x194);}return _0x4d63dc;};}function handleError(_0x5ac7cc,_0x5a331b){_0x5a331b=_0x5a331b||0x1f4;return function(_0x3383ff){logger['error'](_0x3383ff[_0xca9d('0x12')]);if(_0x3383ff[_0xca9d('0x13')]){delete _0x3383ff['name'];}_0x5ac7cc[_0xca9d('0x7')](_0x5a331b)[_0xca9d('0x14')](_0x3383ff);};}exports['index']=function(_0x2eeab6,_0x3d3bef){var _0x3b0035={},_0x14466d={},_0x3d9cbb={'count':0x0,'rows':[]};var _0x5687f5=_[_0xca9d('0x15')](db[_0xca9d('0x16')][_0xca9d('0x17')],function(_0x43ef67){return{'name':_0x43ef67['fieldName'],'type':_0x43ef67['type'][_0xca9d('0x18')]};});_0x14466d['model']=_[_0xca9d('0x15')](_0x5687f5,_0xca9d('0x13'));_0x14466d[_0xca9d('0x19')]=_[_0xca9d('0x1a')](_0x2eeab6['query']);_0x14466d[_0xca9d('0x1b')]=_[_0xca9d('0x1c')](_0x14466d['model'],_0x14466d[_0xca9d('0x19')]);_0x3b0035[_0xca9d('0x1d')]=_[_0xca9d('0x1c')](_0x14466d[_0xca9d('0x1e')],qs['fields'](_0x2eeab6[_0xca9d('0x19')]['fields']));_0x3b0035['attributes']=_0x3b0035[_0xca9d('0x1d')]['length']?_0x3b0035[_0xca9d('0x1d')]:_0x14466d[_0xca9d('0x1e')];if(!_0x2eeab6['query'][_0xca9d('0x1f')](_0xca9d('0x20'))){_0x3b0035[_0xca9d('0xa')]=qs[_0xca9d('0xa')](_0x2eeab6['query'][_0xca9d('0xa')]);_0x3b0035[_0xca9d('0xc')]=qs[_0xca9d('0xc')](_0x2eeab6[_0xca9d('0x19')][_0xca9d('0xc')]);}_0x3b0035[_0xca9d('0x21')]=qs[_0xca9d('0x22')](_0x2eeab6[_0xca9d('0x19')]['sort']);_0x3b0035[_0xca9d('0x23')]=qs['filters'](_[_0xca9d('0x24')](_0x2eeab6[_0xca9d('0x19')],_0x14466d['filters']),_0x5687f5);if(_0x2eeab6[_0xca9d('0x19')][_0xca9d('0x25')]){_0x3b0035[_0xca9d('0x23')]=_[_0xca9d('0x26')](_0x3b0035[_0xca9d('0x23')],{'$or':_['map'](_0x5687f5,function(_0x11c34d){if(_0x11c34d[_0xca9d('0x27')]!==_0xca9d('0x28')){var _0x1b016d={};_0x1b016d[_0x11c34d[_0xca9d('0x13')]]={'$like':'%'+_0x2eeab6[_0xca9d('0x19')][_0xca9d('0x25')]+'%'};return _0x1b016d;}})});}_0x3b0035=_[_0xca9d('0x26')]({},_0x3b0035,_0x2eeab6[_0xca9d('0x29')]);var _0x53dba5={'where':_0x3b0035['where']};return db['Dynamics365Account'][_0xca9d('0xb')](_0x53dba5)[_0xca9d('0x2a')](function(_0x183d7d){_0x3d9cbb[_0xca9d('0xb')]=_0x183d7d;if(_0x2eeab6[_0xca9d('0x19')][_0xca9d('0x2b')]){_0x3b0035[_0xca9d('0x2c')]=[{'all':!![]}];}return db[_0xca9d('0x16')][_0xca9d('0x2d')](_0x3b0035);})[_0xca9d('0x2a')](function(_0x4f04c9){_0x3d9cbb[_0xca9d('0x2e')]=_0x4f04c9;return _0x3d9cbb;})[_0xca9d('0x2a')](respondWithFilteredResult(_0x3d3bef,_0x3b0035))[_0xca9d('0x2f')](handleError(_0x3d3bef,null));};exports[_0xca9d('0x30')]=function(_0x92b8f4,_0x28c8c2){var _0x5b311b={'raw':![],'where':{'id':_0x92b8f4[_0xca9d('0x31')]['id']}},_0x33cf4b={};_0x33cf4b['model']=_[_0xca9d('0x1a')](db[_0xca9d('0x16')][_0xca9d('0x17')]);_0x33cf4b['query']=_['keys'](_0x92b8f4['query']);_0x33cf4b[_0xca9d('0x1b')]=_['intersection'](_0x33cf4b[_0xca9d('0x1e')],_0x33cf4b[_0xca9d('0x19')]);_0x5b311b[_0xca9d('0x1d')]=_['intersection'](_0x33cf4b['model'],qs[_0xca9d('0x32')](_0x92b8f4[_0xca9d('0x19')]['fields']));_0x5b311b[_0xca9d('0x1d')]=_0x5b311b['attributes']['length']?_0x5b311b[_0xca9d('0x1d')]:_0x33cf4b['model'];if(_0x92b8f4[_0xca9d('0x19')][_0xca9d('0x2b')]){_0x5b311b['include']=[{'all':!![]}];}_0x5b311b=_['merge']({},_0x5b311b,_0x92b8f4[_0xca9d('0x29')]);return db[_0xca9d('0x16')][_0xca9d('0x33')](_0x5b311b)['then'](handleEntityNotFound(_0x28c8c2,null))['then'](respondWithResult(_0x28c8c2,null))['catch'](handleError(_0x28c8c2,null));};exports['create']=function(_0x38e3c3,_0x24a7a1){return db[_0xca9d('0x16')][_0xca9d('0x34')](_0x38e3c3[_0xca9d('0x35')],{})[_0xca9d('0x2a')](respondWithResult(_0x24a7a1,0xc9))[_0xca9d('0x2f')](handleError(_0x24a7a1,null));};exports[_0xca9d('0xf')]=function(_0x40e8a8,_0x41ef96){if(_0x40e8a8[_0xca9d('0x35')]['id']){delete _0x40e8a8[_0xca9d('0x35')]['id'];}return db[_0xca9d('0x16')][_0xca9d('0x33')]({'where':{'id':_0x40e8a8[_0xca9d('0x31')]['id']}})[_0xca9d('0x2a')](handleEntityNotFound(_0x41ef96,null))[_0xca9d('0x2a')](saveUpdates(_0x40e8a8[_0xca9d('0x35')],null))['then'](respondWithResult(_0x41ef96,null))[_0xca9d('0x2f')](handleError(_0x41ef96,null));};exports[_0xca9d('0x10')]=function(_0x5b5dc6,_0x5dbf35){return db[_0xca9d('0x16')][_0xca9d('0x33')]({'where':{'id':_0x5b5dc6['params']['id']}})['then'](handleEntityNotFound(_0x5dbf35,null))[_0xca9d('0x2a')](removeEntity(_0x5dbf35,null))[_0xca9d('0x2f')](handleError(_0x5dbf35,null));};exports[_0xca9d('0x36')]=function(_0x27849a,_0x52a3c4){var _0xa5952e={};var _0x57b255={};var _0x5dd6f2;var _0x50b917;return db[_0xca9d('0x16')][_0xca9d('0x37')]({'where':{'id':_0x27849a['params']['id']}})['then'](handleEntityNotFound(_0x52a3c4,null))['then'](function(_0x1d2225){if(_0x1d2225){_0x5dd6f2=_0x1d2225;_0x57b255['model']=_[_0xca9d('0x1a')](db[_0xca9d('0x38')][_0xca9d('0x17')]);_0x57b255[_0xca9d('0x19')]=_[_0xca9d('0x1a')](_0x27849a['query']);_0x57b255[_0xca9d('0x1b')]=_['intersection'](_0x57b255[_0xca9d('0x1e')],_0x57b255[_0xca9d('0x19')]);_0xa5952e[_0xca9d('0x1d')]=_[_0xca9d('0x1c')](_0x57b255[_0xca9d('0x1e')],qs[_0xca9d('0x32')](_0x27849a[_0xca9d('0x19')][_0xca9d('0x32')]));_0xa5952e[_0xca9d('0x1d')]=_0xa5952e[_0xca9d('0x1d')]['length']?_0xa5952e[_0xca9d('0x1d')]:_0x57b255[_0xca9d('0x1e')];_0xa5952e[_0xca9d('0x21')]=qs['sort'](_0x27849a[_0xca9d('0x19')][_0xca9d('0x22')]);_0xa5952e[_0xca9d('0x23')]=qs[_0xca9d('0x1b')](_[_0xca9d('0x24')](_0x27849a[_0xca9d('0x19')],_0x57b255[_0xca9d('0x1b')]));if(_0x27849a[_0xca9d('0x19')][_0xca9d('0x25')]){_0xa5952e[_0xca9d('0x23')]=_[_0xca9d('0x26')](_0xa5952e[_0xca9d('0x23')],{'$or':_[_0xca9d('0x15')](_0xa5952e[_0xca9d('0x1d')],function(_0x2d07ff){var _0x34a243={};_0x34a243[_0x2d07ff]={'$like':'%'+_0x27849a[_0xca9d('0x19')][_0xca9d('0x25')]+'%'};return _0x34a243;})});}_0xa5952e=_[_0xca9d('0x26')]({},_0xa5952e,_0x27849a[_0xca9d('0x29')]);return _0x5dd6f2[_0xca9d('0x36')](_0xa5952e);}})[_0xca9d('0x2a')](function(_0x5ea55a){if(_0x5ea55a){_0x50b917=_0x5ea55a[_0xca9d('0x39')];if(!_0x27849a[_0xca9d('0x19')][_0xca9d('0x1f')](_0xca9d('0x20'))){_0xa5952e[_0xca9d('0xa')]=qs[_0xca9d('0xa')](_0x27849a[_0xca9d('0x19')][_0xca9d('0xa')]);_0xa5952e[_0xca9d('0xc')]=qs['offset'](_0x27849a[_0xca9d('0x19')][_0xca9d('0xc')]);}return _0x5dd6f2[_0xca9d('0x36')](_0xa5952e);}})['then'](function(_0xf6281c){if(_0xf6281c){return _0xf6281c?{'count':_0x50b917,'rows':_0xf6281c}:null;}})[_0xca9d('0x2a')](respondWithResult(_0x52a3c4,null))[_0xca9d('0x2f')](handleError(_0x52a3c4,null));};exports['addConfiguration']=function(_0x305efc,_0x26ff81){if(_0x305efc[_0xca9d('0x35')]['id']){delete _0x305efc[_0xca9d('0x35')]['id'];}return db[_0xca9d('0x16')][_0xca9d('0x37')]({'where':{'id':_0x305efc[_0xca9d('0x31')]['id']}})['then'](handleEntityNotFound(_0x26ff81,null))[_0xca9d('0x2a')](function(_0xa5202e){if(_0xa5202e){_0x305efc[_0xca9d('0x35')][_0xca9d('0x3a')]=_0xa5202e['id'];_0x305efc[_0xca9d('0x35')][_0xca9d('0x3b')]=integrations['getSubjects'](_0x305efc[_0xca9d('0x35')][_0xca9d('0x3c')],_0x305efc['body'][_0xca9d('0x27')]);_0x305efc[_0xca9d('0x35')]['Descriptions']=integrations['getDescriptions'](_0x305efc[_0xca9d('0x35')]['channel'],_0x305efc[_0xca9d('0x35')][_0xca9d('0x27')]);return db[_0xca9d('0x38')][_0xca9d('0x34')](_0x305efc['body'],{'include':[{'model':db[_0xca9d('0x3d')],'as':_0xca9d('0x3b')},{'model':db[_0xca9d('0x3d')],'as':_0xca9d('0x3e')}]});}return null;})[_0xca9d('0x2a')](respondWithResult(_0x26ff81,null))[_0xca9d('0x2f')](handleError(_0x26ff81,null));};function sanitizeRemoteUri(_0xd99c9e){var _0x1db2fc=_0xd99c9e['slice'](-0x1);if(_0x1db2fc==='/')return _0xd99c9e[_0xca9d('0x3f')](0x0,_0xd99c9e[_0xca9d('0x40')](_0x1db2fc));return _0xd99c9e;}function getWebApiUrl(_0x298e3d){return util[_0xca9d('0x41')]('%s/api/data/v9.0/',_0x298e3d);}exports[_0xca9d('0x42')]=function(_0x32d428,_0x5129ce){var _0x4d7139=_0x32d428['query']['ticketType'];var _0x23d815=_0x4d7139==='incident'?'Incident':_0xca9d('0x43');var _0x5cb94f='';var _0x20459f='';var _0x147fa2='';var _0x4e2c10='';var _0x13a98d='';var _0xd3329b='';var _0x462c3f='';var _0xe4c3c1='';var _0x2aa85c=[_0xca9d('0x44'),_0xca9d('0x45'),_0xca9d('0x46'),'ownerid','caseorigincode','subject','phonenumber',_0xca9d('0x47'),_0xca9d('0x48'),_0xca9d('0x49')];var _0x3dfaef=[_0xca9d('0x4a'),_0xca9d('0x4b'),_0xca9d('0x4c'),_0xca9d('0x4d'),_0xca9d('0x4e'),'contactidyominame',_0xca9d('0x4f'),_0xca9d('0x50'),_0xca9d('0x51'),_0xca9d('0x52'),_0xca9d('0x53'),_0xca9d('0x54'),_0xca9d('0x55'),_0xca9d('0x56'),_0xca9d('0x57'),_0xca9d('0x58'),_0xca9d('0x59'),_0xca9d('0x5a'),_0xca9d('0x5b'),_0xca9d('0x5c'),_0xca9d('0x5d'),'entityimage_url','escalatedon',_0xca9d('0x5e'),_0xca9d('0x5f'),_0xca9d('0x60'),_0xca9d('0x61'),_0xca9d('0x62'),_0xca9d('0x63'),_0xca9d('0x64'),_0xca9d('0x65'),_0xca9d('0x66'),_0xca9d('0x67'),_0xca9d('0x68'),'modifiedbyyominame',_0xca9d('0x69'),_0xca9d('0x6a'),_0xca9d('0x6b'),_0xca9d('0x6c'),_0xca9d('0x6d'),_0xca9d('0x6e'),_0xca9d('0x6f'),_0xca9d('0x70'),'owneridname',_0xca9d('0x71'),_0xca9d('0x72'),'parentcaseidname',_0xca9d('0x73'),_0xca9d('0x74'),_0xca9d('0x75'),_0xca9d('0x76'),_0xca9d('0x77'),_0xca9d('0x78'),_0xca9d('0x79'),'responseby',_0xca9d('0x7a'),_0xca9d('0x7b'),_0xca9d('0x7c'),_0xca9d('0x7d'),_0xca9d('0x7e'),'socialprofileidname',_0xca9d('0x7f'),_0xca9d('0x80'),_0xca9d('0x81'),_0xca9d('0x82'),_0xca9d('0x83'),'transactioncurrencyidname',_0xca9d('0x84'),_0xca9d('0x85'),_0xca9d('0x86')];var _0x199c7e=_0x2aa85c[_0xca9d('0x87')](_0x3dfaef);return db[_0xca9d('0x16')][_0xca9d('0x37')]({'where':{'id':_0x32d428[_0xca9d('0x31')]['id']},'attributes':['id',_0xca9d('0x88'),'password',_0xca9d('0x89'),_0xca9d('0x8a'),_0xca9d('0x8b'),_0xca9d('0x8c'),_0xca9d('0x8d')],'include':[{'model':db['CloudProvider'],'as':_0xca9d('0x8e'),'attributes':['id',_0xca9d('0x8f'),'data7']}]})[_0xca9d('0x2a')](handleEntityNotFound(_0x5129ce,null))['then'](function(_0xbde5be){if(_0xbde5be){if(_0xbde5be[_0xca9d('0x8d')]){_0xbde5be['access_token']=_0xbde5be['CloudProvider'][_0xca9d('0x8f')];_0xe4c3c1=sanitizeRemoteUri(_0xbde5be['CloudProvider']['data7']);_0x462c3f=getWebApiUrl(_0xe4c3c1);return _0xbde5be;}_0xe4c3c1=sanitizeRemoteUri(_0xbde5be[_0xca9d('0x89')]);_0x462c3f=getWebApiUrl(_0xe4c3c1);var _0x48ac00={'method':_0xca9d('0x90'),'uri':_0xca9d('0x91')+_0xbde5be[_0xca9d('0x8a')]+'/oauth2/token','form':{'client_id':_0xbde5be[_0xca9d('0x8b')],'resource':_0xe4c3c1,'username':_0xbde5be['username'],'password':_0xbde5be[_0xca9d('0x92')],'grant_type':_0xca9d('0x92'),'client_secret':_0xbde5be[_0xca9d('0x8c')]},'json':!![]};return rp(_0x48ac00);}})[_0xca9d('0x2a')](function(_0x459cb2){_0xd3329b=_0x459cb2[_0xca9d('0x93')];var _0x355a93={'method':_0xca9d('0x94'),'uri':encodeURI(_0x462c3f+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x23d815+'\x27'),'headers':{'Authorization':_0xca9d('0x95')+_0xd3329b,'If-None-Match':null,'OData-Version':_0xca9d('0x96')},'json':!![]};return rp(_0x355a93);})['then'](function(_0x32d8d7){var _0x48c325=_0x32d8d7[_0xca9d('0x97')][0x0];var _0x5b28ae=_0x48c325[_0xca9d('0x98')];var _0x1de3ea={'method':'GET','uri':_0x462c3f+_0xca9d('0x99')+_0x5b28ae+_0xca9d('0x9a'),'headers':{'Authorization':_0xca9d('0x95')+_0xd3329b,'If-None-Match':null,'OData-Version':_0xca9d('0x96')},'json':!![]};return rp(_0x1de3ea);})['then'](function(_0x43594a){_0x5cb94f=_0x43594a;_0x20459f=_0x5cb94f[_0xca9d('0x9b')];_0x20459f=_[_0xca9d('0x9c')](_0x20459f,function(_0x2d15dd){return!_0x199c7e[_0xca9d('0x9d')](_0x2d15dd[_0xca9d('0x9e')]);});var _0x298177=[];var _0x3779e8=[];_0x20459f[_0xca9d('0x9f')](function(_0x5c0690){if(_0x5c0690[_0xca9d('0xa0')]){var _0x430e2f=_0x5c0690[_0xca9d('0xa0')][_0xca9d('0x3f')](_0x5c0690[_0xca9d('0xa0')][_0xca9d('0x40')]('.')+0x1);if(_0x430e2f===_0xca9d('0xa1')){_0x298177[_0xca9d('0xa2')](getSelectList(_0x462c3f,_0x4d7139,_0x3779e8,_0x5cb94f[_0xca9d('0x98')],_0x5c0690[_0xca9d('0x98')],_0xd3329b));}}});return Promise[_0xca9d('0xa3')](_0x298177);})[_0xca9d('0x2a')](function(_0x47cf9f){_0x147fa2=_0x47cf9f[0x0];var _0x507745=[];var _0x55fd25=[];_0x20459f[_0xca9d('0x9f')](function(_0x59c810){if(!_['isNil'](_0x59c810['@odata.type'])){var _0x4ef450=_0x59c810[_0xca9d('0xa0')][_0xca9d('0x3f')](_0x59c810['@odata.type'][_0xca9d('0x40')]('.')+0x1);if(_0x4ef450===_0xca9d('0xa4')){_0x507745[_0xca9d('0xa2')](getBooleanList(_0x462c3f,_0x4d7139,_0x55fd25,_0x5cb94f[_0xca9d('0x98')],_0x59c810[_0xca9d('0x98')],_0xd3329b));}}});return Promise[_0xca9d('0xa3')](_0x507745);})[_0xca9d('0x2a')](function(_0x495c35){_0x4e2c10=_0x495c35[0x0];var _0x5c53d6=[];var _0x47e9e2=[];_0x20459f[_0xca9d('0x9f')](function(_0x433073){if(_0x433073['@odata.type']){var _0xe5a2eb=_0x433073['@odata.type'][_0xca9d('0x3f')](_0x433073['@odata.type'][_0xca9d('0x40')]('.')+0x1);if(_0xe5a2eb==='StringAttributeMetadata'||_0xe5a2eb===_0xca9d('0xa5')||_0xe5a2eb===_0xca9d('0xa6')||_0xe5a2eb===_0xca9d('0xa7')||_0xe5a2eb===_0xca9d('0xa8')||_0xe5a2eb===_0xca9d('0xa9')||_0xe5a2eb===_0xca9d('0xaa')||_0xe5a2eb==='EntityNameAttributeMetadata'||_0xe5a2eb===_0xca9d('0xab')||_0xe5a2eb===_0xca9d('0xac')){_0x5c53d6[_0xca9d('0xa2')](getInputList(_0x462c3f,_0x4d7139,_0xe5a2eb,_0x47e9e2,_0x5cb94f[_0xca9d('0x98')],_0x433073['MetadataId'],_0xd3329b));}}});return Promise[_0xca9d('0xa3')](_0x5c53d6);})[_0xca9d('0x2a')](function(_0x251a09){_0x13a98d=_0x251a09[0x0];var _0x2df179=_0x147fa2[_0xca9d('0x87')](_0x4e2c10)['concat'](_0x13a98d);var _0x3fbf2f={'count':_0x2df179[_0xca9d('0x39')],'rows':_0x2df179};return _0x3fbf2f;})[_0xca9d('0x2a')](respondWithResult(_0x5129ce,null))[_0xca9d('0x2f')](function(_0x335cac){var _0x2bd539=_0x32d428['query'][_0xca9d('0xad')]?0x1f4:_0x335cac[_0xca9d('0xae')]||0x1f4;logger[_0xca9d('0xaf')](_0x335cac[_0xca9d('0x12')]);delete _0x335cac[_0xca9d('0x13')];if(_0x2bd539===0x191){_0x2bd539=0x190;}_0x5129ce[_0xca9d('0x7')](_0x2bd539)[_0xca9d('0x14')](_0x32d428[_0xca9d('0x19')][_0xca9d('0xad')]?{'message':_0xca9d('0xb0'),'statusCode':_0x335cac['statusCode']}:_0x335cac);});};function getSelectList(_0x40ef2c,_0x1d1cfb,_0x1dcb7b,_0x34822b,_0x48e8d5,_0x4ed408){var _0x2a1813={'method':_0xca9d('0x94'),'uri':_0x40ef2c+_0xca9d('0x99')+_0x34822b+_0xca9d('0xb1')+_0x48e8d5+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xca9d('0xb2'),'headers':{'Authorization':_0xca9d('0x95')+_0x4ed408,'If-None-Match':null,'OData-Version':_0xca9d('0x96')},'json':!![]};return rp(_0x2a1813)['then'](function(_0x11931d){var _0x240353=[];var _0x487f11=_0x11931d[_0xca9d('0xb3')][_0xca9d('0xb4')];_0x487f11[_0xca9d('0x9f')](function(_0x474fd0){_0x240353[_0xca9d('0xa2')]({'name':_0x474fd0[_0xca9d('0xb5')][_0xca9d('0xb6')]['Label'],'value':String(_0x474fd0[_0xca9d('0xb7')])});});var _0x3fdc13={'id':_0x1d1cfb+'_'+_0x11931d[_0xca9d('0x9e')],'name':_0x11931d[_0xca9d('0xb8')][_0xca9d('0xb6')][_0xca9d('0xb5')],'custom':![],'options':_0x240353};_0x1dcb7b[_0xca9d('0xa2')](_0x3fdc13);return _0x1dcb7b;});}function getBooleanList(_0x5122ea,_0x221181,_0x1fd4d7,_0x34c933,_0x1b33fa,_0x2e196d){var _0x2d4d5e={'method':_0xca9d('0x94'),'uri':_0x5122ea+'EntityDefinitions('+_0x34c933+_0xca9d('0xb1')+_0x1b33fa+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xca9d('0x95')+_0x2e196d,'If-None-Match':null,'OData-Version':_0xca9d('0x96')},'json':!![]};return rp(_0x2d4d5e)[_0xca9d('0x2a')](function(_0x3d798f){var _0x10b1b4=[];_0x10b1b4['push']({'name':_0x3d798f[_0xca9d('0xb3')]['TrueOption']['Label']['UserLocalizedLabel'][_0xca9d('0xb5')],'value':_0xca9d('0xb9')},{'name':_0x3d798f[_0xca9d('0xb3')]['FalseOption']['Label'][_0xca9d('0xb6')][_0xca9d('0xb5')],'value':_0xca9d('0xba')});var _0xbc33b8={'id':_0x221181+'_'+_0x3d798f[_0xca9d('0x9e')],'name':_0x3d798f[_0xca9d('0xb8')][_0xca9d('0xb6')][_0xca9d('0xb5')],'custom':![],'options':_0x10b1b4};_0x1fd4d7[_0xca9d('0xa2')](_0xbc33b8);return _0x1fd4d7;});}function getInputList(_0x4461de,_0x5bebd1,_0x560abd,_0x2c6774,_0x1661f7,_0x28e4db,_0x5a41ea){var _0x1ecf45={'method':_0xca9d('0x94'),'uri':_0x4461de+_0xca9d('0x99')+_0x1661f7+_0xca9d('0xb1')+_0x28e4db+_0xca9d('0xbb')+_0x560abd+_0xca9d('0xbc'),'headers':{'Authorization':_0xca9d('0x95')+_0x5a41ea,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1ecf45)[_0xca9d('0x2a')](function(_0x1298c0){var _0x5b5a54={'id':_0x5bebd1+'_'+_0x1298c0[_0xca9d('0x9e')],'name':_0x1298c0[_0xca9d('0xb8')]['UserLocalizedLabel']?_0x1298c0[_0xca9d('0xb8')][_0xca9d('0xb6')]['Label']:_0x1298c0['LogicalName'],'custom':![],'options':[]};_0x2c6774[_0xca9d('0xa2')](_0x5b5a54);return _0x2c6774;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 34fed98..70464eb 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x514b72,_0x231b99){var _0x32e34b=function(_0x2fa5e4){while(--_0x2fa5e4){_0x514b72['push'](_0x514b72['shift']());}};_0x32e34b(++_0x231b99);}(_0xe706,0xa3));var _0x6e70=function(_0x361bb4,_0x411189){_0x361bb4=_0x361bb4-0x0;var _0x3e88c3=_0xe706[_0x361bb4];return _0x3e88c3;};'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'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x4545c9,_0x5596f7){var _0x589653=function(_0x16ea2c){while(--_0x16ea2c){_0x4545c9['push'](_0x4545c9['shift']());}};_0x589653(++_0x5596f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index f49a48a..b540385 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 _0x4cab=['then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','Dynamics365Account','options','where','attributes','limit','include','model','map','GetDynamics365Account','debug','stringify','catch','ShowDynamics365Account','find','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x40b2ed,_0x2b1765){var _0x18397d=function(_0xc6a86f){while(--_0xc6a86f){_0x40b2ed['push'](_0x40b2ed['shift']());}};_0x18397d(++_0x2b1765);}(_0x4cab,0xfe));var _0xb4ca=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x4cab[_0x38a7ac];return _0x53061a;};'use strict';var _=require('lodash');var util=require(_0xb4ca('0x0'));var moment=require(_0xb4ca('0x1'));var BPromise=require(_0xb4ca('0x2'));var rs=require(_0xb4ca('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb4ca('0x4'))['db'];var utils=require(_0xb4ca('0x5'));var logger=require(_0xb4ca('0x6'))(_0xb4ca('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb4ca('0x8')][_0xb4ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bc317,_0x1a64a4,_0x1c739e){return new BPromise(function(_0x405033,_0x1f647f){return client['request'](_0x2bc317,_0x1c739e)[_0xb4ca('0xa')](function(_0x51384e){logger[_0xb4ca('0xb')](_0xb4ca('0xc'),_0x1a64a4,_0xb4ca('0xd'));logger['debug'](_0xb4ca('0xe'),_0x1a64a4,'request\x20sent',JSON['stringify'](_0x51384e));if(_0x51384e[_0xb4ca('0xf')]){if(_0x51384e['error'][_0xb4ca('0x10')]===0x1f4){logger[_0xb4ca('0xf')](_0xb4ca('0xc'),_0x1a64a4,_0x51384e[_0xb4ca('0xf')][_0xb4ca('0x11')]);return _0x1f647f(_0x51384e[_0xb4ca('0xf')]['message']);}logger[_0xb4ca('0xf')](_0xb4ca('0xc'),_0x1a64a4,_0x51384e[_0xb4ca('0xf')]['message']);return _0x405033(_0x51384e[_0xb4ca('0xf')][_0xb4ca('0x11')]);}else{logger[_0xb4ca('0xb')](_0xb4ca('0xc'),_0x1a64a4,'request\x20sent');_0x405033(_0x51384e['result']['message']);}})['catch'](function(_0x456c7c){logger[_0xb4ca('0xf')](_0xb4ca('0xc'),_0x1a64a4,_0x456c7c);_0x1f647f(_0x456c7c);});});}exports['GetDynamics365Account']=function(_0x9e5081){var _0x1b3594=this;return new Promise(function(_0x2ccd18,_0x4a4d49){return db[_0xb4ca('0x12')]['findAll']({'raw':_0x9e5081[_0xb4ca('0x13')]?_0x9e5081['options']['raw']===undefined?!![]:![]:!![],'where':_0x9e5081[_0xb4ca('0x13')]?_0x9e5081[_0xb4ca('0x13')][_0xb4ca('0x14')]||null:null,'attributes':_0x9e5081['options']?_0x9e5081[_0xb4ca('0x13')][_0xb4ca('0x15')]||null:null,'limit':_0x9e5081['options']?_0x9e5081['options'][_0xb4ca('0x16')]||null:null,'include':_0x9e5081[_0xb4ca('0x13')]?_0x9e5081[_0xb4ca('0x13')][_0xb4ca('0x17')]?_['map'](_0x9e5081[_0xb4ca('0x13')][_0xb4ca('0x17')],function(_0x204bf4){return{'model':db[_0x204bf4[_0xb4ca('0x18')]],'as':_0x204bf4['as'],'attributes':_0x204bf4['attributes'],'include':_0x204bf4[_0xb4ca('0x17')]?_[_0xb4ca('0x19')](_0x204bf4[_0xb4ca('0x17')],function(_0x3432c9){return{'model':db[_0x3432c9['model']],'as':_0x3432c9['as'],'attributes':_0x3432c9[_0xb4ca('0x15')],'include':_0x3432c9['include']?_['map'](_0x3432c9[_0xb4ca('0x17')],function(_0x3a491e){return{'model':db[_0x3a491e[_0xb4ca('0x18')]],'as':_0x3a491e['as'],'attributes':_0x3a491e[_0xb4ca('0x15')]};}):[]};}):[]};}):[]:[]})[_0xb4ca('0xa')](function(_0x575d02){logger[_0xb4ca('0xb')](_0xb4ca('0x1a'),_0x9e5081);logger[_0xb4ca('0x1b')](_0xb4ca('0x1a'),_0x9e5081,JSON[_0xb4ca('0x1c')](_0x575d02));_0x2ccd18(_0x575d02);})[_0xb4ca('0x1d')](function(_0x15d0a5){logger[_0xb4ca('0xf')](_0xb4ca('0x1a'),_0x15d0a5[_0xb4ca('0x11')],_0x9e5081);_0x4a4d49(_0x1b3594[_0xb4ca('0xf')](0x1f4,_0x15d0a5[_0xb4ca('0x11')]));});});};exports[_0xb4ca('0x1e')]=function(_0x3d4214){var _0x1a243b=this;return new Promise(function(_0x461ce8,_0x17ed07){return db[_0xb4ca('0x12')][_0xb4ca('0x1f')]({'raw':_0x3d4214[_0xb4ca('0x13')]?_0x3d4214['options'][_0xb4ca('0x20')]===undefined?!![]:![]:!![],'where':_0x3d4214[_0xb4ca('0x13')]?_0x3d4214[_0xb4ca('0x13')]['where']||null:null,'attributes':_0x3d4214['options']?_0x3d4214['options'][_0xb4ca('0x15')]||null:null,'include':_0x3d4214[_0xb4ca('0x13')]?_0x3d4214['options'][_0xb4ca('0x17')]?_['map'](_0x3d4214[_0xb4ca('0x13')][_0xb4ca('0x17')],function(_0x54102d){return{'model':db[_0x54102d[_0xb4ca('0x18')]],'as':_0x54102d['as'],'attributes':_0x54102d[_0xb4ca('0x15')],'include':_0x54102d[_0xb4ca('0x17')]?_['map'](_0x54102d[_0xb4ca('0x17')],function(_0x1ee4de){return{'model':db[_0x1ee4de[_0xb4ca('0x18')]],'as':_0x1ee4de['as'],'attributes':_0x1ee4de[_0xb4ca('0x15')],'include':_0x1ee4de[_0xb4ca('0x17')]?_[_0xb4ca('0x19')](_0x1ee4de[_0xb4ca('0x17')],function(_0x2af250){return{'model':db[_0x2af250['model']],'as':_0x2af250['as'],'attributes':_0x2af250['attributes']};}):[]};}):[]};}):[]:[]})[_0xb4ca('0xa')](function(_0x17ae92){logger[_0xb4ca('0xb')](_0xb4ca('0x1e'),_0x3d4214);logger['debug'](_0xb4ca('0x1e'),_0x3d4214,JSON[_0xb4ca('0x1c')](_0x17ae92));_0x461ce8(_0x17ae92);})['catch'](function(_0x51df02){logger[_0xb4ca('0xf')](_0xb4ca('0x1e'),_0x51df02[_0xb4ca('0x11')],_0x3d4214);_0x17ed07(_0x1a243b[_0xb4ca('0xf')](0x1f4,_0x51df02[_0xb4ca('0x11')]));});});}; \ No newline at end of file +var _0xa5c8=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','info','stringify','ShowDynamics365Account','find','model','lodash','util','moment','bluebird'];(function(_0xed4881,_0x45771c){var _0x7fcbd5=function(_0x36b960){while(--_0x36b960){_0xed4881['push'](_0xed4881['shift']());}};_0x7fcbd5(++_0x45771c);}(_0xa5c8,0x80));var _0x8a5c=function(_0x4af702,_0x415ce3){_0x4af702=_0x4af702-0x0;var _0x1f6951=_0xa5c8[_0x4af702];return _0x1f6951;};'use strict';var _=require(_0x8a5c('0x0'));var util=require(_0x8a5c('0x1'));var moment=require(_0x8a5c('0x2'));var BPromise=require(_0x8a5c('0x3'));var rs=require(_0x8a5c('0x4'));var fs=require('fs');var Redis=require(_0x8a5c('0x5'));var db=require(_0x8a5c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a5c('0x7'))(_0x8a5c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f8eec,_0x4cee52,_0x2a5e0b){return new BPromise(function(_0x3398c5,_0x5550fc){return client[_0x8a5c('0x9')](_0x1f8eec,_0x2a5e0b)[_0x8a5c('0xa')](function(_0x365ca9){logger['info'](_0x8a5c('0xb'),_0x4cee52,_0x8a5c('0xc'));logger['debug'](_0x8a5c('0xd'),_0x4cee52,_0x8a5c('0xc'),JSON['stringify'](_0x365ca9));if(_0x365ca9[_0x8a5c('0xe')]){if(_0x365ca9[_0x8a5c('0xe')][_0x8a5c('0xf')]===0x1f4){logger[_0x8a5c('0xe')](_0x8a5c('0xb'),_0x4cee52,_0x365ca9[_0x8a5c('0xe')]['message']);return _0x5550fc(_0x365ca9[_0x8a5c('0xe')][_0x8a5c('0x10')]);}logger[_0x8a5c('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x4cee52,_0x365ca9['error']['message']);return _0x3398c5(_0x365ca9[_0x8a5c('0xe')][_0x8a5c('0x10')]);}else{logger['info'](_0x8a5c('0xb'),_0x4cee52,_0x8a5c('0xc'));_0x3398c5(_0x365ca9['result'][_0x8a5c('0x10')]);}})[_0x8a5c('0x11')](function(_0x2f46be){logger[_0x8a5c('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x4cee52,_0x2f46be);_0x5550fc(_0x2f46be);});});}exports[_0x8a5c('0x12')]=function(_0x383f17){var _0x491d10=this;return new Promise(function(_0x57d1f9,_0x5332bb){return db[_0x8a5c('0x13')][_0x8a5c('0x14')]({'raw':_0x383f17[_0x8a5c('0x15')]?_0x383f17[_0x8a5c('0x15')][_0x8a5c('0x16')]===undefined?!![]:![]:!![],'where':_0x383f17[_0x8a5c('0x15')]?_0x383f17['options'][_0x8a5c('0x17')]||null:null,'attributes':_0x383f17['options']?_0x383f17['options'][_0x8a5c('0x18')]||null:null,'limit':_0x383f17[_0x8a5c('0x15')]?_0x383f17[_0x8a5c('0x15')][_0x8a5c('0x19')]||null:null,'include':_0x383f17[_0x8a5c('0x15')]?_0x383f17['options']['include']?_['map'](_0x383f17['options'][_0x8a5c('0x1a')],function(_0x13951a){return{'model':db[_0x13951a['model']],'as':_0x13951a['as'],'attributes':_0x13951a[_0x8a5c('0x18')],'include':_0x13951a[_0x8a5c('0x1a')]?_[_0x8a5c('0x1b')](_0x13951a['include'],function(_0x18ea31){return{'model':db[_0x18ea31['model']],'as':_0x18ea31['as'],'attributes':_0x18ea31[_0x8a5c('0x18')],'include':_0x18ea31[_0x8a5c('0x1a')]?_[_0x8a5c('0x1b')](_0x18ea31[_0x8a5c('0x1a')],function(_0x292686){return{'model':db[_0x292686['model']],'as':_0x292686['as'],'attributes':_0x292686[_0x8a5c('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x361ff4){logger[_0x8a5c('0x1c')](_0x8a5c('0x12'),_0x383f17);logger['debug'](_0x8a5c('0x12'),_0x383f17,JSON[_0x8a5c('0x1d')](_0x361ff4));_0x57d1f9(_0x361ff4);})[_0x8a5c('0x11')](function(_0x5b2a26){logger[_0x8a5c('0xe')](_0x8a5c('0x12'),_0x5b2a26[_0x8a5c('0x10')],_0x383f17);_0x5332bb(_0x491d10[_0x8a5c('0xe')](0x1f4,_0x5b2a26[_0x8a5c('0x10')]));});});};exports[_0x8a5c('0x1e')]=function(_0x5daf93){var _0x5e006c=this;return new Promise(function(_0x4c7d84,_0xc5105b){return db[_0x8a5c('0x13')][_0x8a5c('0x1f')]({'raw':_0x5daf93[_0x8a5c('0x15')]?_0x5daf93[_0x8a5c('0x15')][_0x8a5c('0x16')]===undefined?!![]:![]:!![],'where':_0x5daf93[_0x8a5c('0x15')]?_0x5daf93[_0x8a5c('0x15')][_0x8a5c('0x17')]||null:null,'attributes':_0x5daf93[_0x8a5c('0x15')]?_0x5daf93[_0x8a5c('0x15')][_0x8a5c('0x18')]||null:null,'include':_0x5daf93[_0x8a5c('0x15')]?_0x5daf93['options'][_0x8a5c('0x1a')]?_[_0x8a5c('0x1b')](_0x5daf93['options']['include'],function(_0x3fe7f5){return{'model':db[_0x3fe7f5[_0x8a5c('0x20')]],'as':_0x3fe7f5['as'],'attributes':_0x3fe7f5[_0x8a5c('0x18')],'include':_0x3fe7f5[_0x8a5c('0x1a')]?_['map'](_0x3fe7f5['include'],function(_0x2407ca){return{'model':db[_0x2407ca[_0x8a5c('0x20')]],'as':_0x2407ca['as'],'attributes':_0x2407ca[_0x8a5c('0x18')],'include':_0x2407ca[_0x8a5c('0x1a')]?_[_0x8a5c('0x1b')](_0x2407ca['include'],function(_0x6ed6e3){return{'model':db[_0x6ed6e3['model']],'as':_0x6ed6e3['as'],'attributes':_0x6ed6e3['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a5c('0xa')](function(_0x26ff0b){logger['info']('ShowDynamics365Account',_0x5daf93);logger['debug']('ShowDynamics365Account',_0x5daf93,JSON['stringify'](_0x26ff0b));_0x4c7d84(_0x26ff0b);})[_0x8a5c('0x11')](function(_0x18876d){logger['error'](_0x8a5c('0x1e'),_0x18876d[_0x8a5c('0x10')],_0x5daf93);_0xc5105b(_0x5e006c[_0x8a5c('0xe')](0x1f4,_0x18876d[_0x8a5c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 44e0bf3..c9919e9 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 _0x3f4b=['/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x32d78c,_0x25582b){var _0x53b145=function(_0x232350){while(--_0x232350){_0x32d78c['push'](_0x32d78c['shift']());}};_0x53b145(++_0x25582b);}(_0x3f4b,0x1c4));var _0xb3f4=function(_0x4ba5ed,_0x308ff3){_0x4ba5ed=_0x4ba5ed-0x0;var _0x724389=_0x3f4b[_0x4ba5ed];return _0x724389;};'use strict';var multer=require(_0xb3f4('0x0'));var util=require(_0xb3f4('0x1'));var path=require(_0xb3f4('0x2'));var timeout=require('connect-timeout');var express=require(_0xb3f4('0x3'));var router=express[_0xb3f4('0x4')]();var fs_extra=require(_0xb3f4('0x5'));var auth=require(_0xb3f4('0x6'));var interaction=require(_0xb3f4('0x7'));var config=require(_0xb3f4('0x8'));var controller=require('./intDynamics365Configuration.controller');router[_0xb3f4('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb3f4('0x9')](_0xb3f4('0xa'),auth[_0xb3f4('0xb')](),controller[_0xb3f4('0xc')]);router[_0xb3f4('0x9')](_0xb3f4('0xd'),auth['isAuthenticated'](),controller[_0xb3f4('0xe')]);router['get']('/:id/subjects',auth[_0xb3f4('0xb')](),controller[_0xb3f4('0xf')]);router[_0xb3f4('0x9')](_0xb3f4('0x10'),auth[_0xb3f4('0xb')](),controller[_0xb3f4('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb3f4('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb3f4('0x13')]);router['delete']('/:id',auth[_0xb3f4('0xb')](),controller[_0xb3f4('0x14')]);module[_0xb3f4('0x15')]=router; \ No newline at end of file +var _0x7200=['get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller'];(function(_0x285c85,_0x132c21){var _0x2f81cd=function(_0x9b9962){while(--_0x9b9962){_0x285c85['push'](_0x285c85['shift']());}};_0x2f81cd(++_0x132c21);}(_0x7200,0x1a8));var _0x0720=function(_0x469add,_0x50ef21){_0x469add=_0x469add-0x0;var _0x2e8a26=_0x7200[_0x469add];return _0x2e8a26;};'use strict';var multer=require(_0x0720('0x0'));var util=require('util');var path=require(_0x0720('0x1'));var timeout=require('connect-timeout');var express=require(_0x0720('0x2'));var router=express[_0x0720('0x3')]();var fs_extra=require(_0x0720('0x4'));var auth=require(_0x0720('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0720('0x6'));var controller=require(_0x0720('0x7'));router[_0x0720('0x8')]('/',auth[_0x0720('0x9')](),controller[_0x0720('0xa')]);router[_0x0720('0x8')]('/:id',auth[_0x0720('0x9')](),controller[_0x0720('0xb')]);router[_0x0720('0x8')](_0x0720('0xc'),auth[_0x0720('0x9')](),controller[_0x0720('0xd')]);router[_0x0720('0x8')](_0x0720('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x0720('0x8')]('/:id/descriptions',auth[_0x0720('0x9')](),controller[_0x0720('0xf')]);router[_0x0720('0x10')]('/',auth[_0x0720('0x9')](),controller[_0x0720('0x11')]);router[_0x0720('0x12')](_0x0720('0x13'),auth[_0x0720('0x9')](),controller[_0x0720('0x14')]);router[_0x0720('0x15')](_0x0720('0x13'),auth[_0x0720('0x9')](),controller[_0x0720('0x16')]);module[_0x0720('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 70c8f7b..827661f 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 _0x3849=['STRING','ENUM','incident','phonecall','contact','nothing','sequelize'];(function(_0x95203a,_0x1fdd5a){var _0x2fcbbc=function(_0x8f7c06){while(--_0x8f7c06){_0x95203a['push'](_0x95203a['shift']());}};_0x2fcbbc(++_0x1fdd5a);}(_0x3849,0xa0));var _0x9384=function(_0x418361,_0x5816c8){_0x418361=_0x418361-0x0;var _0x3f2c3c=_0x3849[_0x418361];return _0x3f2c3c;};'use strict';var Sequelize=require(_0x9384('0x0'));module['exports']={'name':{'type':Sequelize[_0x9384('0x1')]},'description':{'type':Sequelize[_0x9384('0x1')]},'ticketType':{'type':Sequelize[_0x9384('0x2')](_0x9384('0x3'),_0x9384('0x4')),'defaultValue':_0x9384('0x3')},'moduleCreate':{'type':Sequelize[_0x9384('0x2')](_0x9384('0x5'),_0x9384('0x6')),'defaultValue':_0x9384('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x9384('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xddd3=['incident','phonecall','ENUM','contact','nothing','BOOLEAN','sequelize','exports','STRING'];(function(_0x1ae9ca,_0x4c9c5c){var _0x32d178=function(_0xda3fdd){while(--_0xda3fdd){_0x1ae9ca['push'](_0x1ae9ca['shift']());}};_0x32d178(++_0x4c9c5c);}(_0xddd3,0x72));var _0x3ddd=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xddd3[_0x18a79d];return _0x4f8848;};'use strict';var Sequelize=require(_0x3ddd('0x0'));module[_0x3ddd('0x1')]={'name':{'type':Sequelize[_0x3ddd('0x2')]},'description':{'type':Sequelize[_0x3ddd('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x3ddd('0x3'),_0x3ddd('0x4')),'defaultValue':_0x3ddd('0x3')},'moduleCreate':{'type':Sequelize[_0x3ddd('0x5')](_0x3ddd('0x6'),_0x3ddd('0x7')),'defaultValue':_0x3ddd('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x3ddd('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x3ddd('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 21dccc0..07212b9 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 _0xc2cc=['rows','show','keys','filters','include','create','body','catch','find','params','findOne','getFields','nolimit','getSubjects','Dynamics365Field','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','options','where','includeAll'];(function(_0x4b55be,_0x19eb33){var _0x30a28d=function(_0xd21af8){while(--_0xd21af8){_0x4b55be['push'](_0x4b55be['shift']());}};_0x30a28d(++_0x19eb33);}(_0xc2cc,0x106));var _0xcc2c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc2cc[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0xcc2c('0x0'));var rimraf=require(_0xcc2c('0x1'));var zipdir=require(_0xcc2c('0x2'));var jsonpatch=require(_0xcc2c('0x3'));var rp=require(_0xcc2c('0x4'));var moment=require(_0xcc2c('0x5'));var BPromise=require(_0xcc2c('0x6'));var Mustache=require(_0xcc2c('0x7'));var util=require(_0xcc2c('0x8'));var path=require(_0xcc2c('0x9'));var sox=require(_0xcc2c('0xa'));var csv=require(_0xcc2c('0xb'));var ejs=require(_0xcc2c('0xc'));var fs=require('fs');var fs_extra=require(_0xcc2c('0xd'));var _=require(_0xcc2c('0xe'));var squel=require(_0xcc2c('0xf'));var crypto=require(_0xcc2c('0x10'));var jsforce=require(_0xcc2c('0x11'));var deskjs=require(_0xcc2c('0x12'));var toCsv=require('to-csv');var querystring=require(_0xcc2c('0x13'));var Papa=require(_0xcc2c('0x14'));var Redis=require('ioredis');var authService=require(_0xcc2c('0x15'));var qs=require(_0xcc2c('0x16'));var as=require(_0xcc2c('0x17'));var hardwareService=require(_0xcc2c('0x18'));var logger=require(_0xcc2c('0x19'))('api');var utils=require(_0xcc2c('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xcc2c('0x1b'));var db=require(_0xcc2c('0x1c'))['db'];function respondWithStatusCode(_0x1b029d,_0x48b685){_0x48b685=_0x48b685||0xcc;return function(_0x157c14){if(_0x157c14){return _0x1b029d[_0xcc2c('0x1d')](_0x48b685);}return _0x1b029d[_0xcc2c('0x1e')](_0x48b685)[_0xcc2c('0x1f')]();};}function respondWithResult(_0x31095b,_0x4acbcd){_0x4acbcd=_0x4acbcd||0xc8;return function(_0xd168dc){if(_0xd168dc){return _0x31095b[_0xcc2c('0x1e')](_0x4acbcd)[_0xcc2c('0x20')](_0xd168dc);}};}function respondWithFilteredResult(_0x4ac224,_0x3ac2b1){return function(_0x4ff204){if(_0x4ff204){var _0x5b0d3b=typeof _0x3ac2b1[_0xcc2c('0x21')]==='undefined'&&typeof _0x3ac2b1[_0xcc2c('0x22')]===_0xcc2c('0x23');var _0x10d389=_0x4ff204[_0xcc2c('0x24')];var _0x1babe5=_0x5b0d3b?0x0:_0x3ac2b1[_0xcc2c('0x21')];var _0x49e384=_0x5b0d3b?_0x4ff204[_0xcc2c('0x24')]:_0x3ac2b1[_0xcc2c('0x21')]+_0x3ac2b1[_0xcc2c('0x22')];var _0x87cd97;if(_0x49e384>=_0x10d389){_0x49e384=_0x10d389;_0x87cd97=0xc8;}else{_0x87cd97=0xce;}_0x4ac224[_0xcc2c('0x1e')](_0x87cd97);return _0x4ac224[_0xcc2c('0x25')]('Content-Range',_0x1babe5+'-'+_0x49e384+'/'+_0x10d389)['json'](_0x4ff204);}return null;};}function patchUpdates(_0x5f5212){return function(_0x33428b){try{jsonpatch[_0xcc2c('0x26')](_0x33428b,_0x5f5212,!![]);}catch(_0x40942a){return BPromise[_0xcc2c('0x27')](_0x40942a);}return _0x33428b[_0xcc2c('0x28')]();};}function saveUpdates(_0x4f8ce2,_0x30f3c5){return function(_0x4aeca2){if(_0x4aeca2){return _0x4aeca2[_0xcc2c('0x29')](_0x4f8ce2)[_0xcc2c('0x2a')](function(_0x45d3b4){return _0x45d3b4;});}return null;};}function removeEntity(_0x199dd1,_0x9aedcb){return function(_0x31b307){if(_0x31b307){return _0x31b307['destroy']()[_0xcc2c('0x2a')](function(){_0x199dd1[_0xcc2c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c7415,_0xe6ee60){return function(_0x49eb58){if(!_0x49eb58){_0x2c7415[_0xcc2c('0x1d')](0x194);}return _0x49eb58;};}function handleError(_0x3cf120,_0x4bb971){_0x4bb971=_0x4bb971||0x1f4;return function(_0x196a13){logger['error'](_0x196a13[_0xcc2c('0x2b')]);if(_0x196a13[_0xcc2c('0x2c')]){delete _0x196a13[_0xcc2c('0x2c')];}_0x3cf120[_0xcc2c('0x1e')](_0x4bb971)[_0xcc2c('0x2d')](_0x196a13);};}exports[_0xcc2c('0x2e')]=function(_0x500975,_0x2bae83){var _0x18bf05={},_0xe6c029={},_0x388973={'count':0x0,'rows':[]};var _0x819800=_[_0xcc2c('0x2f')](db[_0xcc2c('0x30')][_0xcc2c('0x31')],function(_0x1d169b){return{'name':_0x1d169b['fieldName'],'type':_0x1d169b[_0xcc2c('0x32')]['key']};});_0xe6c029[_0xcc2c('0x33')]=_[_0xcc2c('0x2f')](_0x819800,'name');_0xe6c029['query']=_['keys'](_0x500975[_0xcc2c('0x34')]);_0xe6c029['filters']=_[_0xcc2c('0x35')](_0xe6c029['model'],_0xe6c029[_0xcc2c('0x34')]);_0x18bf05[_0xcc2c('0x36')]=_[_0xcc2c('0x35')](_0xe6c029[_0xcc2c('0x33')],qs['fields'](_0x500975['query'][_0xcc2c('0x37')]));_0x18bf05['attributes']=_0x18bf05['attributes'][_0xcc2c('0x38')]?_0x18bf05[_0xcc2c('0x36')]:_0xe6c029['model'];if(!_0x500975['query'][_0xcc2c('0x39')]('nolimit')){_0x18bf05['limit']=qs[_0xcc2c('0x22')](_0x500975[_0xcc2c('0x34')][_0xcc2c('0x22')]);_0x18bf05[_0xcc2c('0x21')]=qs['offset'](_0x500975[_0xcc2c('0x34')][_0xcc2c('0x21')]);}_0x18bf05[_0xcc2c('0x3a')]=qs[_0xcc2c('0x3b')](_0x500975[_0xcc2c('0x34')][_0xcc2c('0x3b')]);_0x18bf05['where']=qs['filters'](_[_0xcc2c('0x3c')](_0x500975['query'],_0xe6c029['filters']),_0x819800);if(_0x500975[_0xcc2c('0x34')]['filter']){_0x18bf05['where']=_['merge'](_0x18bf05['where'],{'$or':_[_0xcc2c('0x2f')](_0x819800,function(_0x1c4219){if(_0x1c4219[_0xcc2c('0x32')]!=='VIRTUAL'){var _0x3a1f88={};_0x3a1f88[_0x1c4219[_0xcc2c('0x2c')]]={'$like':'%'+_0x500975[_0xcc2c('0x34')][_0xcc2c('0x3d')]+'%'};return _0x3a1f88;}})});}_0x18bf05=_[_0xcc2c('0x3e')]({},_0x18bf05,_0x500975[_0xcc2c('0x3f')]);var _0x4716c7={'where':_0x18bf05[_0xcc2c('0x40')]};return db[_0xcc2c('0x30')][_0xcc2c('0x24')](_0x4716c7)['then'](function(_0x415785){_0x388973[_0xcc2c('0x24')]=_0x415785;if(_0x500975['query'][_0xcc2c('0x41')]){_0x18bf05['include']=[{'all':!![]}];}return db[_0xcc2c('0x30')]['findAll'](_0x18bf05);})['then'](function(_0x19bae8){_0x388973[_0xcc2c('0x42')]=_0x19bae8;return _0x388973;})[_0xcc2c('0x2a')](respondWithFilteredResult(_0x2bae83,_0x18bf05))['catch'](handleError(_0x2bae83,null));};exports[_0xcc2c('0x43')]=function(_0x4302b2,_0x450e20){var _0x53f005={'raw':![],'where':{'id':_0x4302b2['params']['id']}},_0x2f1618={};_0x2f1618[_0xcc2c('0x33')]=_[_0xcc2c('0x44')](db[_0xcc2c('0x30')][_0xcc2c('0x31')]);_0x2f1618[_0xcc2c('0x34')]=_[_0xcc2c('0x44')](_0x4302b2['query']);_0x2f1618[_0xcc2c('0x45')]=_[_0xcc2c('0x35')](_0x2f1618[_0xcc2c('0x33')],_0x2f1618['query']);_0x53f005[_0xcc2c('0x36')]=_[_0xcc2c('0x35')](_0x2f1618[_0xcc2c('0x33')],qs['fields'](_0x4302b2[_0xcc2c('0x34')][_0xcc2c('0x37')]));_0x53f005['attributes']=_0x53f005[_0xcc2c('0x36')][_0xcc2c('0x38')]?_0x53f005[_0xcc2c('0x36')]:_0x2f1618[_0xcc2c('0x33')];if(_0x4302b2[_0xcc2c('0x34')][_0xcc2c('0x41')]){_0x53f005[_0xcc2c('0x46')]=[{'all':!![]}];}_0x53f005=_[_0xcc2c('0x3e')]({},_0x53f005,_0x4302b2[_0xcc2c('0x3f')]);return db['Dynamics365Configuration']['find'](_0x53f005)['then'](handleEntityNotFound(_0x450e20,null))['then'](respondWithResult(_0x450e20,null))['catch'](handleError(_0x450e20,null));};exports[_0xcc2c('0x47')]=function(_0x38cb03,_0x3ecb73){return db[_0xcc2c('0x30')][_0xcc2c('0x47')](_0x38cb03[_0xcc2c('0x48')],{})[_0xcc2c('0x2a')](respondWithResult(_0x3ecb73,0xc9))[_0xcc2c('0x49')](handleError(_0x3ecb73,null));};exports[_0xcc2c('0x29')]=function(_0x46836d,_0xf4acc9){if(_0x46836d['body']['id']){delete _0x46836d['body']['id'];}return db['Dynamics365Configuration'][_0xcc2c('0x4a')]({'where':{'id':_0x46836d[_0xcc2c('0x4b')]['id']}})[_0xcc2c('0x2a')](handleEntityNotFound(_0xf4acc9,null))['then'](saveUpdates(_0x46836d['body'],null))[_0xcc2c('0x2a')](respondWithResult(_0xf4acc9,null))[_0xcc2c('0x49')](handleError(_0xf4acc9,null));};exports['destroy']=function(_0x26b3af,_0x590abe){return db[_0xcc2c('0x30')][_0xcc2c('0x4a')]({'where':{'id':_0x26b3af['params']['id']}})['then'](handleEntityNotFound(_0x590abe,null))[_0xcc2c('0x2a')](removeEntity(_0x590abe,null))[_0xcc2c('0x49')](handleError(_0x590abe,null));};exports['getFields']=function(_0x65e15f,_0x106998,_0x2feb16){var _0x10cade={};var _0x1ea338={};var _0x30939a;var _0x3b1f4e;return db['Dynamics365Configuration'][_0xcc2c('0x4c')]({'where':{'id':_0x65e15f[_0xcc2c('0x4b')]['id']}})[_0xcc2c('0x2a')](handleEntityNotFound(_0x106998,null))[_0xcc2c('0x2a')](function(_0x842e34){if(_0x842e34){_0x30939a=_0x842e34;_0x1ea338['model']=_[_0xcc2c('0x44')](db['Dynamics365Field'][_0xcc2c('0x31')]);_0x1ea338[_0xcc2c('0x34')]=_[_0xcc2c('0x44')](_0x65e15f[_0xcc2c('0x34')]);_0x1ea338[_0xcc2c('0x45')]=_[_0xcc2c('0x35')](_0x1ea338['model'],_0x1ea338[_0xcc2c('0x34')]);_0x10cade['attributes']=_['intersection'](_0x1ea338[_0xcc2c('0x33')],qs[_0xcc2c('0x37')](_0x65e15f['query']['fields']));_0x10cade['attributes']=_0x10cade[_0xcc2c('0x36')][_0xcc2c('0x38')]?_0x10cade[_0xcc2c('0x36')]:_0x1ea338[_0xcc2c('0x33')];_0x10cade[_0xcc2c('0x3a')]=qs[_0xcc2c('0x3b')](_0x65e15f[_0xcc2c('0x34')][_0xcc2c('0x3b')]);_0x10cade[_0xcc2c('0x40')]=qs[_0xcc2c('0x45')](_['pick'](_0x65e15f[_0xcc2c('0x34')],_0x1ea338[_0xcc2c('0x45')]));if(_0x65e15f[_0xcc2c('0x34')][_0xcc2c('0x3d')]){_0x10cade[_0xcc2c('0x40')]=_[_0xcc2c('0x3e')](_0x10cade['where'],{'$or':_[_0xcc2c('0x2f')](_0x10cade[_0xcc2c('0x36')],function(_0x4186bc){var _0x4e068a={};_0x4e068a[_0x4186bc]={'$like':'%'+_0x65e15f['query'][_0xcc2c('0x3d')]+'%'};return _0x4e068a;})});}_0x10cade=_[_0xcc2c('0x3e')]({},_0x10cade,_0x65e15f[_0xcc2c('0x3f')]);return _0x30939a[_0xcc2c('0x4d')](_0x10cade);}})[_0xcc2c('0x2a')](function(_0x5747f7){if(_0x5747f7){_0x3b1f4e=_0x5747f7['length'];if(!_0x65e15f[_0xcc2c('0x34')][_0xcc2c('0x39')](_0xcc2c('0x4e'))){_0x10cade[_0xcc2c('0x22')]=qs['limit'](_0x65e15f[_0xcc2c('0x34')][_0xcc2c('0x22')]);_0x10cade[_0xcc2c('0x21')]=qs[_0xcc2c('0x21')](_0x65e15f[_0xcc2c('0x34')][_0xcc2c('0x21')]);}return _0x30939a['getFields'](_0x10cade);}})['then'](function(_0xa1d6f1){if(_0xa1d6f1){return _0xa1d6f1?{'count':_0x3b1f4e,'rows':_0xa1d6f1}:null;}})[_0xcc2c('0x2a')](respondWithResult(_0x106998,null))[_0xcc2c('0x49')](handleError(_0x106998,null));};exports[_0xcc2c('0x4f')]=function(_0x499857,_0x57dd16,_0x20368e){var _0x324fd1={};var _0x2da36a={};var _0x29acf8;var _0xb82f91;return db[_0xcc2c('0x30')][_0xcc2c('0x4c')]({'where':{'id':_0x499857[_0xcc2c('0x4b')]['id']}})[_0xcc2c('0x2a')](handleEntityNotFound(_0x57dd16,null))[_0xcc2c('0x2a')](function(_0x2079a8){if(_0x2079a8){_0x29acf8=_0x2079a8;_0x2da36a[_0xcc2c('0x33')]=_[_0xcc2c('0x44')](db[_0xcc2c('0x50')][_0xcc2c('0x31')]);_0x2da36a[_0xcc2c('0x34')]=_[_0xcc2c('0x44')](_0x499857['query']);_0x2da36a[_0xcc2c('0x45')]=_[_0xcc2c('0x35')](_0x2da36a[_0xcc2c('0x33')],_0x2da36a[_0xcc2c('0x34')]);_0x324fd1[_0xcc2c('0x36')]=_[_0xcc2c('0x35')](_0x2da36a[_0xcc2c('0x33')],qs[_0xcc2c('0x37')](_0x499857[_0xcc2c('0x34')][_0xcc2c('0x37')]));_0x324fd1[_0xcc2c('0x36')]=_0x324fd1[_0xcc2c('0x36')]['length']?_0x324fd1[_0xcc2c('0x36')]:_0x2da36a[_0xcc2c('0x33')];_0x324fd1[_0xcc2c('0x3a')]=qs[_0xcc2c('0x3b')](_0x499857['query'][_0xcc2c('0x3b')]);_0x324fd1[_0xcc2c('0x40')]=qs[_0xcc2c('0x45')](_[_0xcc2c('0x3c')](_0x499857[_0xcc2c('0x34')],_0x2da36a[_0xcc2c('0x45')]));if(_0x499857['query'][_0xcc2c('0x3d')]){_0x324fd1[_0xcc2c('0x40')]=_[_0xcc2c('0x3e')](_0x324fd1['where'],{'$or':_['map'](_0x324fd1[_0xcc2c('0x36')],function(_0x22cce0){var _0x391ca6={};_0x391ca6[_0x22cce0]={'$like':'%'+_0x499857[_0xcc2c('0x34')]['filter']+'%'};return _0x391ca6;})});}_0x324fd1=_[_0xcc2c('0x3e')]({},_0x324fd1,_0x499857[_0xcc2c('0x3f')]);return _0x29acf8[_0xcc2c('0x4f')](_0x324fd1);}})[_0xcc2c('0x2a')](function(_0x4f472a){if(_0x4f472a){_0xb82f91=_0x4f472a[_0xcc2c('0x38')];if(!_0x499857[_0xcc2c('0x34')][_0xcc2c('0x39')](_0xcc2c('0x4e'))){_0x324fd1[_0xcc2c('0x22')]=qs[_0xcc2c('0x22')](_0x499857[_0xcc2c('0x34')]['limit']);_0x324fd1[_0xcc2c('0x21')]=qs[_0xcc2c('0x21')](_0x499857[_0xcc2c('0x34')]['offset']);}return _0x29acf8[_0xcc2c('0x4f')](_0x324fd1);}})['then'](function(_0xda1d45){if(_0xda1d45){return _0xda1d45?{'count':_0xb82f91,'rows':_0xda1d45}:null;}})[_0xcc2c('0x2a')](respondWithResult(_0x57dd16,null))[_0xcc2c('0x49')](handleError(_0x57dd16,null));};exports[_0xcc2c('0x51')]=function(_0x1b041e,_0x25aceb,_0x3bdea5){var _0xcf5c39={};var _0x5c311d={};var _0x393c3b;var _0x44de80;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x1b041e[_0xcc2c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x25aceb,null))[_0xcc2c('0x2a')](function(_0x3cbbf4){if(_0x3cbbf4){_0x393c3b=_0x3cbbf4;_0x5c311d['model']=_[_0xcc2c('0x44')](db[_0xcc2c('0x50')]['rawAttributes']);_0x5c311d[_0xcc2c('0x34')]=_[_0xcc2c('0x44')](_0x1b041e[_0xcc2c('0x34')]);_0x5c311d[_0xcc2c('0x45')]=_[_0xcc2c('0x35')](_0x5c311d[_0xcc2c('0x33')],_0x5c311d['query']);_0xcf5c39['attributes']=_['intersection'](_0x5c311d[_0xcc2c('0x33')],qs[_0xcc2c('0x37')](_0x1b041e[_0xcc2c('0x34')][_0xcc2c('0x37')]));_0xcf5c39[_0xcc2c('0x36')]=_0xcf5c39[_0xcc2c('0x36')]['length']?_0xcf5c39[_0xcc2c('0x36')]:_0x5c311d['model'];_0xcf5c39['order']=qs['sort'](_0x1b041e['query'][_0xcc2c('0x3b')]);_0xcf5c39[_0xcc2c('0x40')]=qs[_0xcc2c('0x45')](_[_0xcc2c('0x3c')](_0x1b041e[_0xcc2c('0x34')],_0x5c311d[_0xcc2c('0x45')]));if(_0x1b041e[_0xcc2c('0x34')][_0xcc2c('0x3d')]){_0xcf5c39[_0xcc2c('0x40')]=_[_0xcc2c('0x3e')](_0xcf5c39[_0xcc2c('0x40')],{'$or':_[_0xcc2c('0x2f')](_0xcf5c39[_0xcc2c('0x36')],function(_0x1bd436){var _0x40fd4d={};_0x40fd4d[_0x1bd436]={'$like':'%'+_0x1b041e[_0xcc2c('0x34')][_0xcc2c('0x3d')]+'%'};return _0x40fd4d;})});}_0xcf5c39=_[_0xcc2c('0x3e')]({},_0xcf5c39,_0x1b041e[_0xcc2c('0x3f')]);return _0x393c3b['getDescriptions'](_0xcf5c39);}})['then'](function(_0x2f03a8){if(_0x2f03a8){_0x44de80=_0x2f03a8[_0xcc2c('0x38')];if(!_0x1b041e[_0xcc2c('0x34')][_0xcc2c('0x39')](_0xcc2c('0x4e'))){_0xcf5c39['limit']=qs['limit'](_0x1b041e[_0xcc2c('0x34')][_0xcc2c('0x22')]);_0xcf5c39[_0xcc2c('0x21')]=qs['offset'](_0x1b041e[_0xcc2c('0x34')][_0xcc2c('0x21')]);}return _0x393c3b[_0xcc2c('0x51')](_0xcf5c39);}})[_0xcc2c('0x2a')](function(_0xb3e509){if(_0xb3e509){return _0xb3e509?{'count':_0x44de80,'rows':_0xb3e509}:null;}})[_0xcc2c('0x2a')](respondWithResult(_0x25aceb,null))['catch'](handleError(_0x25aceb,null));}; \ No newline at end of file +var _0x8923=['key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','body','update','findOne','getFields','nolimit','getSubjects','getDescriptions','Dynamics365Field','order','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','reject','then','destroy','end','stack','name','index','map','Dynamics365Configuration','rawAttributes','fieldName','type'];(function(_0x4aeb02,_0x51f18a){var _0xf5d601=function(_0xd8d1e0){while(--_0xd8d1e0){_0x4aeb02['push'](_0x4aeb02['shift']());}};_0xf5d601(++_0x51f18a);}(_0x8923,0x1bc));var _0x3892=function(_0x473f77,_0x2e7e1f){_0x473f77=_0x473f77-0x0;var _0x26c797=_0x8923[_0x473f77];return _0x26c797;};'use strict';var emlformat=require(_0x3892('0x0'));var rimraf=require(_0x3892('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3892('0x2'));var rp=require(_0x3892('0x3'));var moment=require(_0x3892('0x4'));var BPromise=require(_0x3892('0x5'));var Mustache=require(_0x3892('0x6'));var util=require(_0x3892('0x7'));var path=require('path');var sox=require(_0x3892('0x8'));var csv=require(_0x3892('0x9'));var ejs=require(_0x3892('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3892('0xb'));var squel=require(_0x3892('0xc'));var crypto=require(_0x3892('0xd'));var jsforce=require(_0x3892('0xe'));var deskjs=require(_0x3892('0xf'));var toCsv=require(_0x3892('0x9'));var querystring=require('querystring');var Papa=require(_0x3892('0x10'));var Redis=require(_0x3892('0x11'));var authService=require(_0x3892('0x12'));var qs=require(_0x3892('0x13'));var as=require(_0x3892('0x14'));var hardwareService=require(_0x3892('0x15'));var logger=require(_0x3892('0x16'))('api');var utils=require(_0x3892('0x17'));var config=require(_0x3892('0x18'));var licenseUtil=require(_0x3892('0x19'));var db=require(_0x3892('0x1a'))['db'];function respondWithStatusCode(_0x33c70a,_0x317b66){_0x317b66=_0x317b66||0xcc;return function(_0x4713ed){if(_0x4713ed){return _0x33c70a[_0x3892('0x1b')](_0x317b66);}return _0x33c70a[_0x3892('0x1c')](_0x317b66)['end']();};}function respondWithResult(_0x56efa6,_0x5a02af){_0x5a02af=_0x5a02af||0xc8;return function(_0xd6a990){if(_0xd6a990){return _0x56efa6['status'](_0x5a02af)['json'](_0xd6a990);}};}function respondWithFilteredResult(_0x34a95d,_0x3552c5){return function(_0x4489d5){if(_0x4489d5){var _0x5ab9ea=typeof _0x3552c5[_0x3892('0x1d')]==='undefined'&&typeof _0x3552c5[_0x3892('0x1e')]===_0x3892('0x1f');var _0xf31f7e=_0x4489d5[_0x3892('0x20')];var _0x59190b=_0x5ab9ea?0x0:_0x3552c5['offset'];var _0x525366=_0x5ab9ea?_0x4489d5[_0x3892('0x20')]:_0x3552c5[_0x3892('0x1d')]+_0x3552c5[_0x3892('0x1e')];var _0x4329dd;if(_0x525366>=_0xf31f7e){_0x525366=_0xf31f7e;_0x4329dd=0xc8;}else{_0x4329dd=0xce;}_0x34a95d[_0x3892('0x1c')](_0x4329dd);return _0x34a95d['set'](_0x3892('0x21'),_0x59190b+'-'+_0x525366+'/'+_0xf31f7e)[_0x3892('0x22')](_0x4489d5);}return null;};}function patchUpdates(_0x4fc68c){return function(_0x17e111){try{jsonpatch[_0x3892('0x23')](_0x17e111,_0x4fc68c,!![]);}catch(_0x260235){return BPromise[_0x3892('0x24')](_0x260235);}return _0x17e111['save']();};}function saveUpdates(_0xe3527b,_0x395704){return function(_0x186716){if(_0x186716){return _0x186716['update'](_0xe3527b)[_0x3892('0x25')](function(_0x3529b2){return _0x3529b2;});}return null;};}function removeEntity(_0x579994,_0xa65070){return function(_0x11925c){if(_0x11925c){return _0x11925c[_0x3892('0x26')]()[_0x3892('0x25')](function(){_0x579994['status'](0xcc)[_0x3892('0x27')]();});}};}function handleEntityNotFound(_0xc823d1,_0x37318e){return function(_0x2b8e01){if(!_0x2b8e01){_0xc823d1[_0x3892('0x1b')](0x194);}return _0x2b8e01;};}function handleError(_0x34f616,_0x31b66e){_0x31b66e=_0x31b66e||0x1f4;return function(_0x32bdaa){logger['error'](_0x32bdaa[_0x3892('0x28')]);if(_0x32bdaa[_0x3892('0x29')]){delete _0x32bdaa[_0x3892('0x29')];}_0x34f616[_0x3892('0x1c')](_0x31b66e)['send'](_0x32bdaa);};}exports[_0x3892('0x2a')]=function(_0x15f112,_0x409a7d){var _0x3b8eab={},_0x14c504={},_0x3320a0={'count':0x0,'rows':[]};var _0xd3da4a=_[_0x3892('0x2b')](db[_0x3892('0x2c')][_0x3892('0x2d')],function(_0x45bbbb){return{'name':_0x45bbbb[_0x3892('0x2e')],'type':_0x45bbbb[_0x3892('0x2f')][_0x3892('0x30')]};});_0x14c504[_0x3892('0x31')]=_[_0x3892('0x2b')](_0xd3da4a,_0x3892('0x29'));_0x14c504['query']=_[_0x3892('0x32')](_0x15f112[_0x3892('0x33')]);_0x14c504[_0x3892('0x34')]=_[_0x3892('0x35')](_0x14c504[_0x3892('0x31')],_0x14c504[_0x3892('0x33')]);_0x3b8eab[_0x3892('0x36')]=_[_0x3892('0x35')](_0x14c504[_0x3892('0x31')],qs[_0x3892('0x37')](_0x15f112[_0x3892('0x33')][_0x3892('0x37')]));_0x3b8eab[_0x3892('0x36')]=_0x3b8eab[_0x3892('0x36')][_0x3892('0x38')]?_0x3b8eab[_0x3892('0x36')]:_0x14c504[_0x3892('0x31')];if(!_0x15f112['query'][_0x3892('0x39')]('nolimit')){_0x3b8eab[_0x3892('0x1e')]=qs['limit'](_0x15f112[_0x3892('0x33')]['limit']);_0x3b8eab[_0x3892('0x1d')]=qs[_0x3892('0x1d')](_0x15f112[_0x3892('0x33')][_0x3892('0x1d')]);}_0x3b8eab['order']=qs[_0x3892('0x3a')](_0x15f112[_0x3892('0x33')][_0x3892('0x3a')]);_0x3b8eab['where']=qs[_0x3892('0x34')](_[_0x3892('0x3b')](_0x15f112[_0x3892('0x33')],_0x14c504[_0x3892('0x34')]),_0xd3da4a);if(_0x15f112[_0x3892('0x33')][_0x3892('0x3c')]){_0x3b8eab[_0x3892('0x3d')]=_[_0x3892('0x3e')](_0x3b8eab[_0x3892('0x3d')],{'$or':_['map'](_0xd3da4a,function(_0x1e48e3){if(_0x1e48e3[_0x3892('0x2f')]!==_0x3892('0x3f')){var _0x43102b={};_0x43102b[_0x1e48e3[_0x3892('0x29')]]={'$like':'%'+_0x15f112[_0x3892('0x33')][_0x3892('0x3c')]+'%'};return _0x43102b;}})});}_0x3b8eab=_[_0x3892('0x3e')]({},_0x3b8eab,_0x15f112[_0x3892('0x40')]);var _0xc6d8e3={'where':_0x3b8eab['where']};return db[_0x3892('0x2c')]['count'](_0xc6d8e3)['then'](function(_0x134e5c){_0x3320a0[_0x3892('0x20')]=_0x134e5c;if(_0x15f112[_0x3892('0x33')]['includeAll']){_0x3b8eab[_0x3892('0x41')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x3b8eab);})[_0x3892('0x25')](function(_0x51540f){_0x3320a0[_0x3892('0x42')]=_0x51540f;return _0x3320a0;})['then'](respondWithFilteredResult(_0x409a7d,_0x3b8eab))[_0x3892('0x43')](handleError(_0x409a7d,null));};exports[_0x3892('0x44')]=function(_0xfd0b71,_0x5e12f7){var _0x5a499e={'raw':![],'where':{'id':_0xfd0b71[_0x3892('0x45')]['id']}},_0x9df6d2={};_0x9df6d2['model']=_['keys'](db[_0x3892('0x2c')][_0x3892('0x2d')]);_0x9df6d2[_0x3892('0x33')]=_[_0x3892('0x32')](_0xfd0b71[_0x3892('0x33')]);_0x9df6d2['filters']=_[_0x3892('0x35')](_0x9df6d2[_0x3892('0x31')],_0x9df6d2[_0x3892('0x33')]);_0x5a499e[_0x3892('0x36')]=_[_0x3892('0x35')](_0x9df6d2['model'],qs[_0x3892('0x37')](_0xfd0b71[_0x3892('0x33')][_0x3892('0x37')]));_0x5a499e[_0x3892('0x36')]=_0x5a499e['attributes'][_0x3892('0x38')]?_0x5a499e[_0x3892('0x36')]:_0x9df6d2[_0x3892('0x31')];if(_0xfd0b71['query'][_0x3892('0x46')]){_0x5a499e[_0x3892('0x41')]=[{'all':!![]}];}_0x5a499e=_[_0x3892('0x3e')]({},_0x5a499e,_0xfd0b71['options']);return db[_0x3892('0x2c')][_0x3892('0x47')](_0x5a499e)[_0x3892('0x25')](handleEntityNotFound(_0x5e12f7,null))['then'](respondWithResult(_0x5e12f7,null))[_0x3892('0x43')](handleError(_0x5e12f7,null));};exports['create']=function(_0x246129,_0x53a672){return db[_0x3892('0x2c')][_0x3892('0x48')](_0x246129[_0x3892('0x49')],{})[_0x3892('0x25')](respondWithResult(_0x53a672,0xc9))[_0x3892('0x43')](handleError(_0x53a672,null));};exports[_0x3892('0x4a')]=function(_0x2d4ce8,_0x4443f6){if(_0x2d4ce8[_0x3892('0x49')]['id']){delete _0x2d4ce8[_0x3892('0x49')]['id'];}return db[_0x3892('0x2c')]['find']({'where':{'id':_0x2d4ce8[_0x3892('0x45')]['id']}})['then'](handleEntityNotFound(_0x4443f6,null))[_0x3892('0x25')](saveUpdates(_0x2d4ce8['body'],null))[_0x3892('0x25')](respondWithResult(_0x4443f6,null))['catch'](handleError(_0x4443f6,null));};exports['destroy']=function(_0x57b2f7,_0x3476c3){return db[_0x3892('0x2c')][_0x3892('0x47')]({'where':{'id':_0x57b2f7[_0x3892('0x45')]['id']}})[_0x3892('0x25')](handleEntityNotFound(_0x3476c3,null))[_0x3892('0x25')](removeEntity(_0x3476c3,null))['catch'](handleError(_0x3476c3,null));};exports['getFields']=function(_0x4acae8,_0x73d5eb,_0x2af6d9){var _0x64e40={};var _0x561e44={};var _0x261f46;var _0x1cfee4;return db[_0x3892('0x2c')][_0x3892('0x4b')]({'where':{'id':_0x4acae8[_0x3892('0x45')]['id']}})[_0x3892('0x25')](handleEntityNotFound(_0x73d5eb,null))[_0x3892('0x25')](function(_0x3df845){if(_0x3df845){_0x261f46=_0x3df845;_0x561e44['model']=_[_0x3892('0x32')](db['Dynamics365Field'][_0x3892('0x2d')]);_0x561e44[_0x3892('0x33')]=_[_0x3892('0x32')](_0x4acae8['query']);_0x561e44[_0x3892('0x34')]=_[_0x3892('0x35')](_0x561e44[_0x3892('0x31')],_0x561e44[_0x3892('0x33')]);_0x64e40[_0x3892('0x36')]=_[_0x3892('0x35')](_0x561e44['model'],qs[_0x3892('0x37')](_0x4acae8[_0x3892('0x33')][_0x3892('0x37')]));_0x64e40[_0x3892('0x36')]=_0x64e40[_0x3892('0x36')][_0x3892('0x38')]?_0x64e40['attributes']:_0x561e44[_0x3892('0x31')];_0x64e40['order']=qs[_0x3892('0x3a')](_0x4acae8['query'][_0x3892('0x3a')]);_0x64e40[_0x3892('0x3d')]=qs[_0x3892('0x34')](_[_0x3892('0x3b')](_0x4acae8[_0x3892('0x33')],_0x561e44[_0x3892('0x34')]));if(_0x4acae8[_0x3892('0x33')][_0x3892('0x3c')]){_0x64e40[_0x3892('0x3d')]=_[_0x3892('0x3e')](_0x64e40['where'],{'$or':_[_0x3892('0x2b')](_0x64e40[_0x3892('0x36')],function(_0xdc1da3){var _0x2b82b4={};_0x2b82b4[_0xdc1da3]={'$like':'%'+_0x4acae8['query'][_0x3892('0x3c')]+'%'};return _0x2b82b4;})});}_0x64e40=_['merge']({},_0x64e40,_0x4acae8[_0x3892('0x40')]);return _0x261f46[_0x3892('0x4c')](_0x64e40);}})['then'](function(_0x384c32){if(_0x384c32){_0x1cfee4=_0x384c32[_0x3892('0x38')];if(!_0x4acae8[_0x3892('0x33')][_0x3892('0x39')](_0x3892('0x4d'))){_0x64e40[_0x3892('0x1e')]=qs[_0x3892('0x1e')](_0x4acae8['query'][_0x3892('0x1e')]);_0x64e40[_0x3892('0x1d')]=qs[_0x3892('0x1d')](_0x4acae8[_0x3892('0x33')][_0x3892('0x1d')]);}return _0x261f46[_0x3892('0x4c')](_0x64e40);}})['then'](function(_0xc9b392){if(_0xc9b392){return _0xc9b392?{'count':_0x1cfee4,'rows':_0xc9b392}:null;}})[_0x3892('0x25')](respondWithResult(_0x73d5eb,null))['catch'](handleError(_0x73d5eb,null));};exports[_0x3892('0x4e')]=function(_0x243d8a,_0x5aaf54,_0x1c111a){var _0x47670a={};var _0x51f040={};var _0x38e89f;var _0xad944e;return db['Dynamics365Configuration'][_0x3892('0x4b')]({'where':{'id':_0x243d8a[_0x3892('0x45')]['id']}})[_0x3892('0x25')](handleEntityNotFound(_0x5aaf54,null))['then'](function(_0x416f6b){if(_0x416f6b){_0x38e89f=_0x416f6b;_0x51f040['model']=_[_0x3892('0x32')](db['Dynamics365Field'][_0x3892('0x2d')]);_0x51f040[_0x3892('0x33')]=_[_0x3892('0x32')](_0x243d8a[_0x3892('0x33')]);_0x51f040[_0x3892('0x34')]=_[_0x3892('0x35')](_0x51f040[_0x3892('0x31')],_0x51f040[_0x3892('0x33')]);_0x47670a[_0x3892('0x36')]=_[_0x3892('0x35')](_0x51f040[_0x3892('0x31')],qs[_0x3892('0x37')](_0x243d8a[_0x3892('0x33')][_0x3892('0x37')]));_0x47670a[_0x3892('0x36')]=_0x47670a[_0x3892('0x36')][_0x3892('0x38')]?_0x47670a[_0x3892('0x36')]:_0x51f040[_0x3892('0x31')];_0x47670a['order']=qs[_0x3892('0x3a')](_0x243d8a[_0x3892('0x33')][_0x3892('0x3a')]);_0x47670a[_0x3892('0x3d')]=qs['filters'](_['pick'](_0x243d8a[_0x3892('0x33')],_0x51f040[_0x3892('0x34')]));if(_0x243d8a[_0x3892('0x33')][_0x3892('0x3c')]){_0x47670a['where']=_['merge'](_0x47670a[_0x3892('0x3d')],{'$or':_[_0x3892('0x2b')](_0x47670a[_0x3892('0x36')],function(_0x9b2338){var _0x23eaf2={};_0x23eaf2[_0x9b2338]={'$like':'%'+_0x243d8a['query'][_0x3892('0x3c')]+'%'};return _0x23eaf2;})});}_0x47670a=_['merge']({},_0x47670a,_0x243d8a['options']);return _0x38e89f[_0x3892('0x4e')](_0x47670a);}})['then'](function(_0x3b84d6){if(_0x3b84d6){_0xad944e=_0x3b84d6['length'];if(!_0x243d8a[_0x3892('0x33')]['hasOwnProperty']('nolimit')){_0x47670a[_0x3892('0x1e')]=qs[_0x3892('0x1e')](_0x243d8a[_0x3892('0x33')][_0x3892('0x1e')]);_0x47670a[_0x3892('0x1d')]=qs[_0x3892('0x1d')](_0x243d8a[_0x3892('0x33')][_0x3892('0x1d')]);}return _0x38e89f[_0x3892('0x4e')](_0x47670a);}})[_0x3892('0x25')](function(_0x1f334e){if(_0x1f334e){return _0x1f334e?{'count':_0xad944e,'rows':_0x1f334e}:null;}})[_0x3892('0x25')](respondWithResult(_0x5aaf54,null))['catch'](handleError(_0x5aaf54,null));};exports[_0x3892('0x4f')]=function(_0x5bada4,_0x103cfc,_0x404001){var _0x1154d4={};var _0x2d3a97={};var _0x1d6ed8;var _0x10ca61;return db['Dynamics365Configuration'][_0x3892('0x4b')]({'where':{'id':_0x5bada4['params']['id']}})[_0x3892('0x25')](handleEntityNotFound(_0x103cfc,null))['then'](function(_0x13a60f){if(_0x13a60f){_0x1d6ed8=_0x13a60f;_0x2d3a97[_0x3892('0x31')]=_[_0x3892('0x32')](db[_0x3892('0x50')]['rawAttributes']);_0x2d3a97[_0x3892('0x33')]=_[_0x3892('0x32')](_0x5bada4[_0x3892('0x33')]);_0x2d3a97['filters']=_['intersection'](_0x2d3a97[_0x3892('0x31')],_0x2d3a97[_0x3892('0x33')]);_0x1154d4[_0x3892('0x36')]=_[_0x3892('0x35')](_0x2d3a97[_0x3892('0x31')],qs['fields'](_0x5bada4['query'][_0x3892('0x37')]));_0x1154d4['attributes']=_0x1154d4[_0x3892('0x36')][_0x3892('0x38')]?_0x1154d4['attributes']:_0x2d3a97['model'];_0x1154d4[_0x3892('0x51')]=qs[_0x3892('0x3a')](_0x5bada4[_0x3892('0x33')][_0x3892('0x3a')]);_0x1154d4[_0x3892('0x3d')]=qs[_0x3892('0x34')](_[_0x3892('0x3b')](_0x5bada4[_0x3892('0x33')],_0x2d3a97['filters']));if(_0x5bada4[_0x3892('0x33')][_0x3892('0x3c')]){_0x1154d4[_0x3892('0x3d')]=_[_0x3892('0x3e')](_0x1154d4[_0x3892('0x3d')],{'$or':_[_0x3892('0x2b')](_0x1154d4[_0x3892('0x36')],function(_0x4b89e3){var _0x35df3e={};_0x35df3e[_0x4b89e3]={'$like':'%'+_0x5bada4[_0x3892('0x33')][_0x3892('0x3c')]+'%'};return _0x35df3e;})});}_0x1154d4=_[_0x3892('0x3e')]({},_0x1154d4,_0x5bada4[_0x3892('0x40')]);return _0x1d6ed8['getDescriptions'](_0x1154d4);}})['then'](function(_0x406164){if(_0x406164){_0x10ca61=_0x406164[_0x3892('0x38')];if(!_0x5bada4[_0x3892('0x33')]['hasOwnProperty'](_0x3892('0x4d'))){_0x1154d4[_0x3892('0x1e')]=qs['limit'](_0x5bada4[_0x3892('0x33')]['limit']);_0x1154d4[_0x3892('0x1d')]=qs['offset'](_0x5bada4[_0x3892('0x33')][_0x3892('0x1d')]);}return _0x1d6ed8['getDescriptions'](_0x1154d4);}})[_0x3892('0x25')](function(_0x24c43c){if(_0x24c43c){return _0x24c43c?{'count':_0x10ca61,'rows':_0x24c43c}:null;}})[_0x3892('0x25')](respondWithResult(_0x103cfc,null))['catch'](handleError(_0x103cfc,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 1e2d7c6..d36dd39 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 _0xe5b3=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0xae01dd,_0xbd8a3c){var _0x8c26df=function(_0x359827){while(--_0x359827){_0xae01dd['push'](_0xae01dd['shift']());}};_0x8c26df(++_0xbd8a3c);}(_0xe5b3,0x133));var _0x3e5b=function(_0x527a20,_0x347399){_0x527a20=_0x527a20-0x0;var _0x21f5e0=_0xe5b3[_0x527a20];return _0x21f5e0;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var logger=require(_0x3e5b('0x1'))(_0x3e5b('0x2'));var moment=require(_0x3e5b('0x3'));var BPromise=require(_0x3e5b('0x4'));var rp=require(_0x3e5b('0x5'));var fs=require('fs');var path=require(_0x3e5b('0x6'));var rimraf=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var attributes=require(_0x3e5b('0x9'));module[_0x3e5b('0xa')]=function(_0x54e1fb,_0x174923){return _0x54e1fb[_0x3e5b('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0x3e5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4e6=['path','rimraf','./intDynamics365Configuration.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1ca2f0,_0x356d2e){var _0x4bac2d=function(_0x161ec5){while(--_0x161ec5){_0x1ca2f0['push'](_0x1ca2f0['shift']());}};_0x4bac2d(++_0x356d2e);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0xf48cce,_0x3531e4){_0xf48cce=_0xf48cce-0x0;var _0x2a5c38=_0xb4e6[_0xf48cce];return _0x2a5c38;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','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 d93f529..dd57672 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 _0xee47=['../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify','error','code','message','Dynamics365Configuration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0xee47,0x195));var _0x7ee4=function(_0x504c5d,_0x27a75a){_0x504c5d=_0x504c5d-0x0;var _0x4d1821=_0xee47[_0x504c5d];return _0x4d1821;};'use strict';var _=require(_0x7ee4('0x0'));var util=require(_0x7ee4('0x1'));var moment=require(_0x7ee4('0x2'));var BPromise=require(_0x7ee4('0x3'));var rs=require(_0x7ee4('0x4'));var fs=require('fs');var Redis=require(_0x7ee4('0x5'));var db=require(_0x7ee4('0x6'))['db'];var utils=require(_0x7ee4('0x7'));var logger=require('../../config/logger')(_0x7ee4('0x8'));var config=require(_0x7ee4('0x9'));var jayson=require(_0x7ee4('0xa'));var client=jayson[_0x7ee4('0xb')][_0x7ee4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3455cc,_0x1f6836,_0x4ff092){return new BPromise(function(_0x7081b0,_0x2079df){return client[_0x7ee4('0xd')](_0x3455cc,_0x4ff092)['then'](function(_0x1c4069){logger[_0x7ee4('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1f6836,_0x7ee4('0xf'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x1f6836,'request\x20sent',JSON[_0x7ee4('0x10')](_0x1c4069));if(_0x1c4069[_0x7ee4('0x11')]){if(_0x1c4069['error'][_0x7ee4('0x12')]===0x1f4){logger[_0x7ee4('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1f6836,_0x1c4069[_0x7ee4('0x11')][_0x7ee4('0x13')]);return _0x2079df(_0x1c4069[_0x7ee4('0x11')][_0x7ee4('0x13')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x1f6836,_0x1c4069[_0x7ee4('0x11')][_0x7ee4('0x13')]);return _0x7081b0(_0x1c4069['error'][_0x7ee4('0x13')]);}else{logger[_0x7ee4('0xe')](_0x7ee4('0x14'),_0x1f6836,_0x7ee4('0xf'));_0x7081b0(_0x1c4069[_0x7ee4('0x15')][_0x7ee4('0x13')]);}})[_0x7ee4('0x16')](function(_0x1a86c4){logger[_0x7ee4('0x11')](_0x7ee4('0x14'),_0x1f6836,_0x1a86c4);_0x2079df(_0x1a86c4);});});} \ No newline at end of file +var _0xd1f3=['error','Dynamics365Configuration,\x20%s,\x20%s','message','result','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x10b790,_0x423dad){var _0x2b40ff=function(_0x38fd01){while(--_0x38fd01){_0x10b790['push'](_0x10b790['shift']());}};_0x2b40ff(++_0x423dad);}(_0xd1f3,0x7c));var _0x3d1f=function(_0x2a6c96,_0x4ac989){_0x2a6c96=_0x2a6c96-0x0;var _0x576a44=_0xd1f3[_0x2a6c96];return _0x576a44;};'use strict';var _=require(_0x3d1f('0x0'));var util=require(_0x3d1f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d1f('0x2'));var db=require(_0x3d1f('0x3'))['db'];var utils=require(_0x3d1f('0x4'));var logger=require('../../config/logger')(_0x3d1f('0x5'));var config=require(_0x3d1f('0x6'));var jayson=require(_0x3d1f('0x7'));var client=jayson[_0x3d1f('0x8')][_0x3d1f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b5736,_0x376a52,_0x59f86d){return new BPromise(function(_0x28df02,_0x5be15c){return client[_0x3d1f('0xa')](_0x5b5736,_0x59f86d)['then'](function(_0x45c44c){logger[_0x3d1f('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x376a52,'request\x20sent');logger[_0x3d1f('0xc')](_0x3d1f('0xd'),_0x376a52,_0x3d1f('0xe'),JSON[_0x3d1f('0xf')](_0x45c44c));if(_0x45c44c[_0x3d1f('0x10')]){if(_0x45c44c['error']['code']===0x1f4){logger[_0x3d1f('0x10')](_0x3d1f('0x11'),_0x376a52,_0x45c44c[_0x3d1f('0x10')][_0x3d1f('0x12')]);return _0x5be15c(_0x45c44c[_0x3d1f('0x10')][_0x3d1f('0x12')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x376a52,_0x45c44c['error'][_0x3d1f('0x12')]);return _0x28df02(_0x45c44c[_0x3d1f('0x10')][_0x3d1f('0x12')]);}else{logger['info'](_0x3d1f('0x11'),_0x376a52,_0x3d1f('0xe'));_0x28df02(_0x45c44c[_0x3d1f('0x13')][_0x3d1f('0x12')]);}})['catch'](function(_0x4405a9){logger['error'](_0x3d1f('0x11'),_0x376a52,_0x4405a9);_0x5be15c(_0x4405a9);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index c77e67d..84252c0 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 _0xbbed=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x99d92d,_0x2e332f){var _0x5b01e3=function(_0x1184e8){while(--_0x1184e8){_0x99d92d['push'](_0x99d92d['shift']());}};_0x5b01e3(++_0x2e332f);}(_0xbbed,0x1e6));var _0xdbbe=function(_0x5633e6,_0x4e97bd){_0x5633e6=_0x5633e6-0x0;var _0x317e9a=_0xbbed[_0x5633e6];return _0x317e9a;};'use strict';var multer=require(_0xdbbe('0x0'));var util=require(_0xdbbe('0x1'));var path=require('path');var timeout=require(_0xdbbe('0x2'));var express=require(_0xdbbe('0x3'));var router=express[_0xdbbe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdbbe('0x5'));var interaction=require(_0xdbbe('0x6'));var config=require(_0xdbbe('0x7'));var controller=require(_0xdbbe('0x8'));router[_0xdbbe('0x9')]('/',auth[_0xdbbe('0xa')](),controller[_0xdbbe('0xb')]);router[_0xdbbe('0x9')](_0xdbbe('0xc'),auth[_0xdbbe('0xa')](),controller[_0xdbbe('0xd')]);router[_0xdbbe('0xe')]('/',auth[_0xdbbe('0xa')](),controller[_0xdbbe('0xf')]);router[_0xdbbe('0x10')](_0xdbbe('0xc'),auth['isAuthenticated'](),controller[_0xdbbe('0x11')]);router[_0xdbbe('0x12')](_0xdbbe('0xc'),auth[_0xdbbe('0xa')](),controller[_0xdbbe('0x13')]);module[_0xdbbe('0x14')]=router; \ No newline at end of file +var _0x77e4=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x3fbb0e,_0x1c808e){var _0x40206d=function(_0x2d272e){while(--_0x2d272e){_0x3fbb0e['push'](_0x3fbb0e['shift']());}};_0x40206d(++_0x1c808e);}(_0x77e4,0xbf));var _0x477e=function(_0x3ddce5,_0x21a69c){_0x3ddce5=_0x3ddce5-0x0;var _0x4a91a4=_0x77e4[_0x3ddce5];return _0x4a91a4;};'use strict';var multer=require(_0x477e('0x0'));var util=require(_0x477e('0x1'));var path=require('path');var timeout=require(_0x477e('0x2'));var express=require('express');var router=express[_0x477e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x477e('0x4'));var interaction=require(_0x477e('0x5'));var config=require(_0x477e('0x6'));var controller=require('./intDynamics365Field.controller');router[_0x477e('0x7')]('/',auth[_0x477e('0x8')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x477e('0x8')](),controller[_0x477e('0x9')]);router[_0x477e('0xa')](_0x477e('0xb'),auth[_0x477e('0x8')](),controller['update']);router[_0x477e('0xc')](_0x477e('0xb'),auth[_0x477e('0x8')](),controller[_0x477e('0xd')]);module[_0x477e('0xe')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 90810a2..a7a6377 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 _0x4bdb=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','sequelize','exports'];(function(_0xb833b1,_0x1c3d3f){var _0x1ab87a=function(_0x1c9f6c){while(--_0x1c9f6c){_0xb833b1['push'](_0xb833b1['shift']());}};_0x1ab87a(++_0x1c3d3f);}(_0x4bdb,0x130));var _0xb4bd=function(_0x15c8b5,_0x33d929){_0x15c8b5=_0x15c8b5-0x0;var _0x520a00=_0x4bdb[_0x15c8b5];return _0x520a00;};'use strict';var Sequelize=require(_0xb4bd('0x0'));module[_0xb4bd('0x1')]={'type':{'type':Sequelize[_0xb4bd('0x2')](_0xb4bd('0x3'),_0xb4bd('0x4'),'customVariable',_0xb4bd('0x5'),_0xb4bd('0x6')),'defaultValue':_0xb4bd('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb4bd('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xb4bd('0x3'),_0xb4bd('0x4'),_0xb4bd('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb4bd('0x7')]},'nameField':{'type':Sequelize[_0xb4bd('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf17b=['keyValue','picklist','STRING','variable','BOOLEAN','exports','string','customVariable'];(function(_0x9d7b61,_0x2d79de){var _0xbe809f=function(_0x73fcf5){while(--_0x73fcf5){_0x9d7b61['push'](_0x9d7b61['shift']());}};_0xbe809f(++_0x2d79de);}(_0xf17b,0x65));var _0xbf17=function(_0xd03f7d,_0xce6913){_0xd03f7d=_0xd03f7d-0x0;var _0xbc4548=_0xf17b[_0xd03f7d];return _0xbc4548;};'use strict';var Sequelize=require('sequelize');module[_0xbf17('0x0')]={'type':{'type':Sequelize['ENUM'](_0xbf17('0x1'),'variable',_0xbf17('0x2'),_0xbf17('0x3'),_0xbf17('0x4')),'defaultValue':_0xbf17('0x1')},'content':{'type':Sequelize[_0xbf17('0x5')]},'key':{'type':Sequelize[_0xbf17('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xbf17('0x1'),_0xbf17('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xbf17('0x5')]},'idField':{'type':Sequelize[_0xbf17('0x5')]},'nameField':{'type':Sequelize[_0xbf17('0x5')]},'customField':{'type':Sequelize[_0xbf17('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbf17('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 7b12661..11db63e 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 _0xa2c3=['sort','where','pick','filter','merge','VIRTUAL','Dynamics365Field','includeAll','include','findAll','rows','show','params','find','create','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x7bc974,_0x46e845){var _0x3f50d5=function(_0x58f456){while(--_0x58f456){_0x7bc974['push'](_0x7bc974['shift']());}};_0x3f50d5(++_0x46e845);}(_0xa2c3,0x17e));var _0x3a2c=function(_0x48b8ad,_0xe28403){_0x48b8ad=_0x48b8ad-0x0;var _0x4d1bae=_0xa2c3[_0x48b8ad];return _0x4d1bae;};'use strict';var emlformat=require(_0x3a2c('0x0'));var rimraf=require(_0x3a2c('0x1'));var zipdir=require(_0x3a2c('0x2'));var jsonpatch=require(_0x3a2c('0x3'));var rp=require(_0x3a2c('0x4'));var moment=require(_0x3a2c('0x5'));var BPromise=require(_0x3a2c('0x6'));var Mustache=require('mustache');var util=require(_0x3a2c('0x7'));var path=require(_0x3a2c('0x8'));var sox=require(_0x3a2c('0x9'));var csv=require(_0x3a2c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a2c('0xb'));var squel=require(_0x3a2c('0xc'));var crypto=require(_0x3a2c('0xd'));var jsforce=require(_0x3a2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3a2c('0xa'));var querystring=require('querystring');var Papa=require(_0x3a2c('0xf'));var Redis=require(_0x3a2c('0x10'));var authService=require(_0x3a2c('0x11'));var qs=require(_0x3a2c('0x12'));var as=require(_0x3a2c('0x13'));var hardwareService=require(_0x3a2c('0x14'));var logger=require('../../config/logger')(_0x3a2c('0x15'));var utils=require(_0x3a2c('0x16'));var config=require(_0x3a2c('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53dfe1,_0x2a6bf6){_0x2a6bf6=_0x2a6bf6||0xcc;return function(_0x420982){if(_0x420982){return _0x53dfe1[_0x3a2c('0x18')](_0x2a6bf6);}return _0x53dfe1[_0x3a2c('0x19')](_0x2a6bf6)[_0x3a2c('0x1a')]();};}function respondWithResult(_0x1d74bb,_0x1c6320){_0x1c6320=_0x1c6320||0xc8;return function(_0x198ed3){if(_0x198ed3){return _0x1d74bb[_0x3a2c('0x19')](_0x1c6320)[_0x3a2c('0x1b')](_0x198ed3);}};}function respondWithFilteredResult(_0x35971a,_0x128af8){return function(_0x14c9e4){if(_0x14c9e4){var _0x2c9a8e=typeof _0x128af8[_0x3a2c('0x1c')]===_0x3a2c('0x1d')&&typeof _0x128af8[_0x3a2c('0x1e')]===_0x3a2c('0x1d');var _0x27d157=_0x14c9e4[_0x3a2c('0x1f')];var _0x59dbaf=_0x2c9a8e?0x0:_0x128af8[_0x3a2c('0x1c')];var _0x454e59=_0x2c9a8e?_0x14c9e4[_0x3a2c('0x1f')]:_0x128af8[_0x3a2c('0x1c')]+_0x128af8[_0x3a2c('0x1e')];var _0x5e7612;if(_0x454e59>=_0x27d157){_0x454e59=_0x27d157;_0x5e7612=0xc8;}else{_0x5e7612=0xce;}_0x35971a[_0x3a2c('0x19')](_0x5e7612);return _0x35971a['set'](_0x3a2c('0x20'),_0x59dbaf+'-'+_0x454e59+'/'+_0x27d157)[_0x3a2c('0x1b')](_0x14c9e4);}return null;};}function patchUpdates(_0x3903bb){return function(_0x191833){try{jsonpatch['apply'](_0x191833,_0x3903bb,!![]);}catch(_0x2385b5){return BPromise[_0x3a2c('0x21')](_0x2385b5);}return _0x191833[_0x3a2c('0x22')]();};}function saveUpdates(_0x74e1e2,_0x57e260){return function(_0x3064ee){if(_0x3064ee){return _0x3064ee[_0x3a2c('0x23')](_0x74e1e2)['then'](function(_0xaeee59){return _0xaeee59;});}return null;};}function removeEntity(_0x21db70,_0x224553){return function(_0x1587f4){if(_0x1587f4){return _0x1587f4[_0x3a2c('0x24')]()[_0x3a2c('0x25')](function(){_0x21db70[_0x3a2c('0x19')](0xcc)[_0x3a2c('0x1a')]();});}};}function handleEntityNotFound(_0x49975a,_0x6e0d37){return function(_0x188bb2){if(!_0x188bb2){_0x49975a[_0x3a2c('0x18')](0x194);}return _0x188bb2;};}function handleError(_0x5911f8,_0xf5a6c5){_0xf5a6c5=_0xf5a6c5||0x1f4;return function(_0x444c32){logger['error'](_0x444c32[_0x3a2c('0x26')]);if(_0x444c32['name']){delete _0x444c32[_0x3a2c('0x27')];}_0x5911f8[_0x3a2c('0x19')](_0xf5a6c5)[_0x3a2c('0x28')](_0x444c32);};}exports[_0x3a2c('0x29')]=function(_0x1b3af4,_0xca661c){var _0x217a07={},_0x3d41b0={},_0x351a39={'count':0x0,'rows':[]};var _0x32562d=_[_0x3a2c('0x2a')](db['Dynamics365Field'][_0x3a2c('0x2b')],function(_0x21cc2d){return{'name':_0x21cc2d['fieldName'],'type':_0x21cc2d[_0x3a2c('0x2c')][_0x3a2c('0x2d')]};});_0x3d41b0[_0x3a2c('0x2e')]=_[_0x3a2c('0x2a')](_0x32562d,_0x3a2c('0x27'));_0x3d41b0[_0x3a2c('0x2f')]=_[_0x3a2c('0x30')](_0x1b3af4['query']);_0x3d41b0[_0x3a2c('0x31')]=_[_0x3a2c('0x32')](_0x3d41b0[_0x3a2c('0x2e')],_0x3d41b0[_0x3a2c('0x2f')]);_0x217a07[_0x3a2c('0x33')]=_[_0x3a2c('0x32')](_0x3d41b0['model'],qs[_0x3a2c('0x34')](_0x1b3af4[_0x3a2c('0x2f')][_0x3a2c('0x34')]));_0x217a07[_0x3a2c('0x33')]=_0x217a07[_0x3a2c('0x33')][_0x3a2c('0x35')]?_0x217a07[_0x3a2c('0x33')]:_0x3d41b0[_0x3a2c('0x2e')];if(!_0x1b3af4[_0x3a2c('0x2f')]['hasOwnProperty'](_0x3a2c('0x36'))){_0x217a07[_0x3a2c('0x1e')]=qs[_0x3a2c('0x1e')](_0x1b3af4[_0x3a2c('0x2f')][_0x3a2c('0x1e')]);_0x217a07['offset']=qs[_0x3a2c('0x1c')](_0x1b3af4[_0x3a2c('0x2f')]['offset']);}_0x217a07[_0x3a2c('0x37')]=qs[_0x3a2c('0x38')](_0x1b3af4['query']['sort']);_0x217a07[_0x3a2c('0x39')]=qs[_0x3a2c('0x31')](_[_0x3a2c('0x3a')](_0x1b3af4[_0x3a2c('0x2f')],_0x3d41b0['filters']),_0x32562d);if(_0x1b3af4['query'][_0x3a2c('0x3b')]){_0x217a07['where']=_[_0x3a2c('0x3c')](_0x217a07[_0x3a2c('0x39')],{'$or':_[_0x3a2c('0x2a')](_0x32562d,function(_0x118509){if(_0x118509[_0x3a2c('0x2c')]!==_0x3a2c('0x3d')){var _0x5a4c76={};_0x5a4c76[_0x118509[_0x3a2c('0x27')]]={'$like':'%'+_0x1b3af4[_0x3a2c('0x2f')]['filter']+'%'};return _0x5a4c76;}})});}_0x217a07=_[_0x3a2c('0x3c')]({},_0x217a07,_0x1b3af4['options']);var _0x3b1b84={'where':_0x217a07['where']};return db[_0x3a2c('0x3e')][_0x3a2c('0x1f')](_0x3b1b84)['then'](function(_0x267a16){_0x351a39['count']=_0x267a16;if(_0x1b3af4[_0x3a2c('0x2f')][_0x3a2c('0x3f')]){_0x217a07[_0x3a2c('0x40')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x3a2c('0x41')](_0x217a07);})[_0x3a2c('0x25')](function(_0x2a3b25){_0x351a39[_0x3a2c('0x42')]=_0x2a3b25;return _0x351a39;})['then'](respondWithFilteredResult(_0xca661c,_0x217a07))['catch'](handleError(_0xca661c,null));};exports[_0x3a2c('0x43')]=function(_0x24d2b4,_0x460dca){var _0x168b51={'raw':!![],'where':{'id':_0x24d2b4[_0x3a2c('0x44')]['id']}},_0x434825={};_0x434825['model']=_['keys'](db[_0x3a2c('0x3e')][_0x3a2c('0x2b')]);_0x434825[_0x3a2c('0x2f')]=_[_0x3a2c('0x30')](_0x24d2b4['query']);_0x434825[_0x3a2c('0x31')]=_[_0x3a2c('0x32')](_0x434825[_0x3a2c('0x2e')],_0x434825[_0x3a2c('0x2f')]);_0x168b51[_0x3a2c('0x33')]=_['intersection'](_0x434825[_0x3a2c('0x2e')],qs[_0x3a2c('0x34')](_0x24d2b4['query'][_0x3a2c('0x34')]));_0x168b51[_0x3a2c('0x33')]=_0x168b51[_0x3a2c('0x33')]['length']?_0x168b51[_0x3a2c('0x33')]:_0x434825[_0x3a2c('0x2e')];if(_0x24d2b4[_0x3a2c('0x2f')]['includeAll']){_0x168b51[_0x3a2c('0x40')]=[{'all':!![]}];}_0x168b51=_[_0x3a2c('0x3c')]({},_0x168b51,_0x24d2b4['options']);return db[_0x3a2c('0x3e')][_0x3a2c('0x45')](_0x168b51)[_0x3a2c('0x25')](handleEntityNotFound(_0x460dca,null))[_0x3a2c('0x25')](respondWithResult(_0x460dca,null))['catch'](handleError(_0x460dca,null));};exports[_0x3a2c('0x46')]=function(_0x3c66a3,_0x107ded){return db[_0x3a2c('0x3e')][_0x3a2c('0x46')](_0x3c66a3['body'],{})[_0x3a2c('0x25')](respondWithResult(_0x107ded,0xc9))[_0x3a2c('0x47')](handleError(_0x107ded,null));};exports['update']=function(_0x462aa3,_0x2bfc31){if(_0x462aa3[_0x3a2c('0x48')]['id']){delete _0x462aa3[_0x3a2c('0x48')]['id'];}return db[_0x3a2c('0x3e')][_0x3a2c('0x45')]({'where':{'id':_0x462aa3['params']['id']}})['then'](handleEntityNotFound(_0x2bfc31,null))[_0x3a2c('0x25')](saveUpdates(_0x462aa3[_0x3a2c('0x48')],null))[_0x3a2c('0x25')](respondWithResult(_0x2bfc31,null))[_0x3a2c('0x47')](handleError(_0x2bfc31,null));};exports[_0x3a2c('0x24')]=function(_0x3a7f77,_0x4ecd90){return db[_0x3a2c('0x3e')][_0x3a2c('0x45')]({'where':{'id':_0x3a7f77[_0x3a2c('0x44')]['id']}})['then'](handleEntityNotFound(_0x4ecd90,null))[_0x3a2c('0x25')](removeEntity(_0x4ecd90,null))[_0x3a2c('0x47')](handleError(_0x4ecd90,null));}; \ No newline at end of file +var _0x9d45=['create','body','update','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','reject','save','then','destroy','stack','name','send','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','filters','find'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x9d45,0xde));var _0x59d4=function(_0x23f711,_0x25284a){_0x23f711=_0x23f711-0x0;var _0x148fa3=_0x9d45[_0x23f711];return _0x148fa3;};'use strict';var emlformat=require(_0x59d4('0x0'));var rimraf=require(_0x59d4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x59d4('0x2'));var rp=require('request-promise');var moment=require(_0x59d4('0x3'));var BPromise=require(_0x59d4('0x4'));var Mustache=require(_0x59d4('0x5'));var util=require(_0x59d4('0x6'));var path=require(_0x59d4('0x7'));var sox=require(_0x59d4('0x8'));var csv=require(_0x59d4('0x9'));var ejs=require(_0x59d4('0xa'));var fs=require('fs');var fs_extra=require(_0x59d4('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x59d4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x59d4('0xd'));var Papa=require(_0x59d4('0xe'));var Redis=require(_0x59d4('0xf'));var authService=require(_0x59d4('0x10'));var qs=require(_0x59d4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x59d4('0x12'));var logger=require(_0x59d4('0x13'))(_0x59d4('0x14'));var utils=require('../../config/utils');var config=require(_0x59d4('0x15'));var licenseUtil=require(_0x59d4('0x16'));var db=require(_0x59d4('0x17'))['db'];function respondWithStatusCode(_0x1a857f,_0x334075){_0x334075=_0x334075||0xcc;return function(_0x1d3ac6){if(_0x1d3ac6){return _0x1a857f[_0x59d4('0x18')](_0x334075);}return _0x1a857f[_0x59d4('0x19')](_0x334075)[_0x59d4('0x1a')]();};}function respondWithResult(_0x101ef4,_0x51e081){_0x51e081=_0x51e081||0xc8;return function(_0x145c4d){if(_0x145c4d){return _0x101ef4[_0x59d4('0x19')](_0x51e081)[_0x59d4('0x1b')](_0x145c4d);}};}function respondWithFilteredResult(_0x2d6918,_0x33a621){return function(_0x439ea6){if(_0x439ea6){var _0x169079=typeof _0x33a621['offset']==='undefined'&&typeof _0x33a621[_0x59d4('0x1c')]===_0x59d4('0x1d');var _0x5645d4=_0x439ea6['count'];var _0x49e40e=_0x169079?0x0:_0x33a621[_0x59d4('0x1e')];var _0x25a804=_0x169079?_0x439ea6[_0x59d4('0x1f')]:_0x33a621[_0x59d4('0x1e')]+_0x33a621[_0x59d4('0x1c')];var _0x5ea912;if(_0x25a804>=_0x5645d4){_0x25a804=_0x5645d4;_0x5ea912=0xc8;}else{_0x5ea912=0xce;}_0x2d6918[_0x59d4('0x19')](_0x5ea912);return _0x2d6918[_0x59d4('0x20')](_0x59d4('0x21'),_0x49e40e+'-'+_0x25a804+'/'+_0x5645d4)[_0x59d4('0x1b')](_0x439ea6);}return null;};}function patchUpdates(_0x28e99a){return function(_0xa46b3){try{jsonpatch['apply'](_0xa46b3,_0x28e99a,!![]);}catch(_0xc90ee0){return BPromise[_0x59d4('0x22')](_0xc90ee0);}return _0xa46b3[_0x59d4('0x23')]();};}function saveUpdates(_0x308ffa,_0x3f8077){return function(_0x322dc8){if(_0x322dc8){return _0x322dc8['update'](_0x308ffa)[_0x59d4('0x24')](function(_0x34661d){return _0x34661d;});}return null;};}function removeEntity(_0x235453,_0x2e037a){return function(_0x355123){if(_0x355123){return _0x355123[_0x59d4('0x25')]()['then'](function(){_0x235453['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x182d93,_0x1f3752){return function(_0x3eb719){if(!_0x3eb719){_0x182d93['sendStatus'](0x194);}return _0x3eb719;};}function handleError(_0x3feaaa,_0x50ce10){_0x50ce10=_0x50ce10||0x1f4;return function(_0x3fe3e7){logger['error'](_0x3fe3e7[_0x59d4('0x26')]);if(_0x3fe3e7[_0x59d4('0x27')]){delete _0x3fe3e7[_0x59d4('0x27')];}_0x3feaaa[_0x59d4('0x19')](_0x50ce10)[_0x59d4('0x28')](_0x3fe3e7);};}exports['index']=function(_0x3e0c20,_0x114083){var _0x8e59b={},_0x19970a={},_0x2fbabf={'count':0x0,'rows':[]};var _0x36af0c=_[_0x59d4('0x29')](db[_0x59d4('0x2a')][_0x59d4('0x2b')],function(_0x14f261){return{'name':_0x14f261[_0x59d4('0x2c')],'type':_0x14f261[_0x59d4('0x2d')][_0x59d4('0x2e')]};});_0x19970a[_0x59d4('0x2f')]=_[_0x59d4('0x29')](_0x36af0c,'name');_0x19970a[_0x59d4('0x30')]=_[_0x59d4('0x31')](_0x3e0c20['query']);_0x19970a['filters']=_[_0x59d4('0x32')](_0x19970a[_0x59d4('0x2f')],_0x19970a['query']);_0x8e59b['attributes']=_[_0x59d4('0x32')](_0x19970a[_0x59d4('0x2f')],qs['fields'](_0x3e0c20[_0x59d4('0x30')][_0x59d4('0x33')]));_0x8e59b[_0x59d4('0x34')]=_0x8e59b[_0x59d4('0x34')]['length']?_0x8e59b[_0x59d4('0x34')]:_0x19970a[_0x59d4('0x2f')];if(!_0x3e0c20[_0x59d4('0x30')][_0x59d4('0x35')](_0x59d4('0x36'))){_0x8e59b[_0x59d4('0x1c')]=qs[_0x59d4('0x1c')](_0x3e0c20['query'][_0x59d4('0x1c')]);_0x8e59b[_0x59d4('0x1e')]=qs[_0x59d4('0x1e')](_0x3e0c20[_0x59d4('0x30')]['offset']);}_0x8e59b['order']=qs['sort'](_0x3e0c20[_0x59d4('0x30')][_0x59d4('0x37')]);_0x8e59b[_0x59d4('0x38')]=qs['filters'](_[_0x59d4('0x39')](_0x3e0c20['query'],_0x19970a['filters']),_0x36af0c);if(_0x3e0c20['query'][_0x59d4('0x3a')]){_0x8e59b[_0x59d4('0x38')]=_[_0x59d4('0x3b')](_0x8e59b[_0x59d4('0x38')],{'$or':_[_0x59d4('0x29')](_0x36af0c,function(_0x24ad92){if(_0x24ad92['type']!==_0x59d4('0x3c')){var _0x22281a={};_0x22281a[_0x24ad92[_0x59d4('0x27')]]={'$like':'%'+_0x3e0c20[_0x59d4('0x30')][_0x59d4('0x3a')]+'%'};return _0x22281a;}})});}_0x8e59b=_[_0x59d4('0x3b')]({},_0x8e59b,_0x3e0c20[_0x59d4('0x3d')]);var _0x4e5a64={'where':_0x8e59b[_0x59d4('0x38')]};return db[_0x59d4('0x2a')]['count'](_0x4e5a64)[_0x59d4('0x24')](function(_0x334ec0){_0x2fbabf[_0x59d4('0x1f')]=_0x334ec0;if(_0x3e0c20[_0x59d4('0x30')][_0x59d4('0x3e')]){_0x8e59b[_0x59d4('0x3f')]=[{'all':!![]}];}return db[_0x59d4('0x2a')][_0x59d4('0x40')](_0x8e59b);})['then'](function(_0x32e678){_0x2fbabf[_0x59d4('0x41')]=_0x32e678;return _0x2fbabf;})[_0x59d4('0x24')](respondWithFilteredResult(_0x114083,_0x8e59b))[_0x59d4('0x42')](handleError(_0x114083,null));};exports['show']=function(_0x1e6fb1,_0x18f5c2){var _0x240c75={'raw':!![],'where':{'id':_0x1e6fb1[_0x59d4('0x43')]['id']}},_0x4a9b01={};_0x4a9b01['model']=_[_0x59d4('0x31')](db['Dynamics365Field'][_0x59d4('0x2b')]);_0x4a9b01[_0x59d4('0x30')]=_[_0x59d4('0x31')](_0x1e6fb1[_0x59d4('0x30')]);_0x4a9b01[_0x59d4('0x44')]=_[_0x59d4('0x32')](_0x4a9b01[_0x59d4('0x2f')],_0x4a9b01['query']);_0x240c75[_0x59d4('0x34')]=_[_0x59d4('0x32')](_0x4a9b01[_0x59d4('0x2f')],qs['fields'](_0x1e6fb1['query'][_0x59d4('0x33')]));_0x240c75[_0x59d4('0x34')]=_0x240c75[_0x59d4('0x34')]['length']?_0x240c75[_0x59d4('0x34')]:_0x4a9b01[_0x59d4('0x2f')];if(_0x1e6fb1['query'][_0x59d4('0x3e')]){_0x240c75[_0x59d4('0x3f')]=[{'all':!![]}];}_0x240c75=_[_0x59d4('0x3b')]({},_0x240c75,_0x1e6fb1['options']);return db[_0x59d4('0x2a')][_0x59d4('0x45')](_0x240c75)[_0x59d4('0x24')](handleEntityNotFound(_0x18f5c2,null))[_0x59d4('0x24')](respondWithResult(_0x18f5c2,null))['catch'](handleError(_0x18f5c2,null));};exports[_0x59d4('0x46')]=function(_0x5cdb99,_0x27d4a1){return db[_0x59d4('0x2a')][_0x59d4('0x46')](_0x5cdb99[_0x59d4('0x47')],{})[_0x59d4('0x24')](respondWithResult(_0x27d4a1,0xc9))[_0x59d4('0x42')](handleError(_0x27d4a1,null));};exports[_0x59d4('0x48')]=function(_0x25bd23,_0x45b860){if(_0x25bd23['body']['id']){delete _0x25bd23[_0x59d4('0x47')]['id'];}return db[_0x59d4('0x2a')][_0x59d4('0x45')]({'where':{'id':_0x25bd23['params']['id']}})[_0x59d4('0x24')](handleEntityNotFound(_0x45b860,null))[_0x59d4('0x24')](saveUpdates(_0x25bd23[_0x59d4('0x47')],null))[_0x59d4('0x24')](respondWithResult(_0x45b860,null))['catch'](handleError(_0x45b860,null));};exports['destroy']=function(_0x7771a0,_0x35c0a6){return db['Dynamics365Field']['find']({'where':{'id':_0x7771a0[_0x59d4('0x43')]['id']}})[_0x59d4('0x24')](handleEntityNotFound(_0x35c0a6,null))['then'](removeEntity(_0x35c0a6,null))[_0x59d4('0x42')](handleError(_0x35c0a6,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 9c11c84..ea64ab1 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 _0x7f6a=['api','path','rimraf','../../config/environment','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x7f6a,0xd6));var _0xa7f6=function(_0x46f39a,_0x25361f){_0x46f39a=_0x46f39a-0x0;var _0x37da76=_0x7f6a[_0x46f39a];return _0x37da76;};'use strict';var _=require(_0xa7f6('0x0'));var util=require(_0xa7f6('0x1'));var logger=require('../../config/logger')(_0xa7f6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa7f6('0x3'));var rimraf=require(_0xa7f6('0x4'));var config=require(_0xa7f6('0x5'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x14313b,_0x1d8823){return _0x14313b[_0xa7f6('0x6')](_0xa7f6('0x7'),attributes,{'tableName':_0xa7f6('0x8'),'paranoid':![],'indexes':[{'name':_0xa7f6('0x9'),'fields':[_0xa7f6('0xa'),_0xa7f6('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb231=['Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger','bluebird','request-promise','../../config/environment','exports','define'];(function(_0x5c7091,_0x24da7e){var _0x32f5a1=function(_0x1f697e){while(--_0x1f697e){_0x5c7091['push'](_0x5c7091['shift']());}};_0x32f5a1(++_0x24da7e);}(_0xb231,0x88));var _0x1b23=function(_0x580a4b,_0x7c7b21){_0x580a4b=_0x580a4b-0x0;var _0x53311c=_0xb231[_0x580a4b];return _0x53311c;};'use strict';var _=require(_0x1b23('0x0'));var util=require('util');var logger=require(_0x1b23('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b23('0x2'));var rp=require(_0x1b23('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b23('0x4'));var attributes=require('./intDynamics365Field.attributes');module[_0x1b23('0x5')]=function(_0x2e513e,_0x947286){return _0x2e513e[_0x1b23('0x6')](_0x1b23('0x7'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x1b23('0x8'),'fields':[_0x1b23('0x9'),_0x1b23('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 79574ef..1e45646 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 _0xec5a=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x1e5522,_0x6b8484){var _0x588c24=function(_0x3e6f7b){while(--_0x3e6f7b){_0x1e5522['push'](_0x1e5522['shift']());}};_0x588c24(++_0x6b8484);}(_0xec5a,0x154));var _0xaec5=function(_0x1f6162,_0x37dfe1){_0x1f6162=_0x1f6162-0x0;var _0x1f8fdb=_0xec5a[_0x1f6162];return _0x1f8fdb;};'use strict';var _=require(_0xaec5('0x0'));var util=require(_0xaec5('0x1'));var moment=require(_0xaec5('0x2'));var BPromise=require(_0xaec5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaec5('0x4'));var db=require(_0xaec5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaec5('0x6'))(_0xaec5('0x7'));var config=require(_0xaec5('0x8'));var jayson=require(_0xaec5('0x9'));var client=jayson[_0xaec5('0xa')][_0xaec5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x528710,_0x41705e,_0x1357bf){return new BPromise(function(_0x29fd05,_0xc7bde0){return client['request'](_0x528710,_0x1357bf)[_0xaec5('0xc')](function(_0x1e0b6d){logger[_0xaec5('0xd')](_0xaec5('0xe'),_0x41705e,_0xaec5('0xf'));logger[_0xaec5('0x10')](_0xaec5('0x11'),_0x41705e,_0xaec5('0xf'),JSON[_0xaec5('0x12')](_0x1e0b6d));if(_0x1e0b6d[_0xaec5('0x13')]){if(_0x1e0b6d[_0xaec5('0x13')]['code']===0x1f4){logger[_0xaec5('0x13')](_0xaec5('0xe'),_0x41705e,_0x1e0b6d[_0xaec5('0x13')][_0xaec5('0x14')]);return _0xc7bde0(_0x1e0b6d[_0xaec5('0x13')][_0xaec5('0x14')]);}logger[_0xaec5('0x13')](_0xaec5('0xe'),_0x41705e,_0x1e0b6d[_0xaec5('0x13')]['message']);return _0x29fd05(_0x1e0b6d[_0xaec5('0x13')][_0xaec5('0x14')]);}else{logger[_0xaec5('0xd')](_0xaec5('0xe'),_0x41705e,_0xaec5('0xf'));_0x29fd05(_0x1e0b6d[_0xaec5('0x15')][_0xaec5('0x14')]);}})[_0xaec5('0x16')](function(_0x5454bb){logger['error'](_0xaec5('0xe'),_0x41705e,_0x5454bb);_0xc7bde0(_0x5454bb);});});} \ No newline at end of file +var _0x30dc=['Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x30dc,0xc3));var _0xc30d=function(_0x4cdba5,_0x5373a7){_0x4cdba5=_0x4cdba5-0x0;var _0x3be43d=_0x30dc[_0x4cdba5];return _0x3be43d;};'use strict';var _=require(_0xc30d('0x0'));var util=require('util');var moment=require(_0xc30d('0x1'));var BPromise=require(_0xc30d('0x2'));var rs=require(_0xc30d('0x3'));var fs=require('fs');var Redis=require(_0xc30d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc30d('0x5'))(_0xc30d('0x6'));var config=require(_0xc30d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc30d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f1164,_0x3a9793,_0x3842b8){return new BPromise(function(_0x559be8,_0x246299){return client[_0xc30d('0x9')](_0x1f1164,_0x3842b8)[_0xc30d('0xa')](function(_0x1438d0){logger[_0xc30d('0xb')](_0xc30d('0xc'),_0x3a9793,_0xc30d('0xd'));logger['debug'](_0xc30d('0xe'),_0x3a9793,_0xc30d('0xd'),JSON[_0xc30d('0xf')](_0x1438d0));if(_0x1438d0['error']){if(_0x1438d0['error']['code']===0x1f4){logger[_0xc30d('0x10')](_0xc30d('0xc'),_0x3a9793,_0x1438d0[_0xc30d('0x10')][_0xc30d('0x11')]);return _0x246299(_0x1438d0[_0xc30d('0x10')][_0xc30d('0x11')]);}logger[_0xc30d('0x10')](_0xc30d('0xc'),_0x3a9793,_0x1438d0[_0xc30d('0x10')][_0xc30d('0x11')]);return _0x559be8(_0x1438d0[_0xc30d('0x10')][_0xc30d('0x11')]);}else{logger[_0xc30d('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x3a9793,_0xc30d('0xd'));_0x559be8(_0x1438d0[_0xc30d('0x12')][_0xc30d('0x11')]);}})['catch'](function(_0x3d910e){logger[_0xc30d('0x10')](_0xc30d('0xc'),_0x3a9793,_0x3d910e);_0x246299(_0x3d910e);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 56b255e..9a033f2 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 _0xe636=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','delete','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x4cefc3,_0x23f291){var _0x1cc779=function(_0x7cb914){while(--_0x7cb914){_0x4cefc3['push'](_0x4cefc3['shift']());}};_0x1cc779(++_0x23f291);}(_0xe636,0xc1));var _0x6e63=function(_0x4aac5a,_0x15b04c){_0x4aac5a=_0x4aac5a-0x0;var _0x42e7bc=_0xe636[_0x4aac5a];return _0x42e7bc;};'use strict';var multer=require(_0x6e63('0x0'));var util=require(_0x6e63('0x1'));var path=require('path');var timeout=require(_0x6e63('0x2'));var express=require(_0x6e63('0x3'));var router=express['Router']();var fs_extra=require(_0x6e63('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6e63('0x5'));var config=require(_0x6e63('0x6'));var controller=require('./intFreshdeskAccount.controller');router[_0x6e63('0x7')]('/',auth['isAuthenticated'](),controller[_0x6e63('0x8')]);router[_0x6e63('0x7')](_0x6e63('0x9'),auth[_0x6e63('0xa')](),controller[_0x6e63('0xb')]);router['get'](_0x6e63('0xc'),auth['isAuthenticated'](),controller[_0x6e63('0xd')]);router[_0x6e63('0x7')](_0x6e63('0xe'),auth[_0x6e63('0xa')](),controller[_0x6e63('0xf')]);router['post']('/',auth[_0x6e63('0xa')](),controller[_0x6e63('0x10')]);router[_0x6e63('0x11')](_0x6e63('0xc'),auth['isAuthenticated'](),controller[_0x6e63('0x12')]);router[_0x6e63('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6e63('0x14')](_0x6e63('0x9'),auth[_0x6e63('0xa')](),controller['destroy']);module[_0x6e63('0x15')]=router; \ No newline at end of file +var _0x8e35=['/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index'];(function(_0x4fccad,_0x3447af){var _0x9646ea=function(_0xde4e5f){while(--_0xde4e5f){_0x4fccad['push'](_0x4fccad['shift']());}};_0x9646ea(++_0x3447af);}(_0x8e35,0xfb));var _0x58e3=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x8e35[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x58e3('0x0'));var util=require(_0x58e3('0x1'));var path=require('path');var timeout=require(_0x58e3('0x2'));var express=require(_0x58e3('0x3'));var router=express[_0x58e3('0x4')]();var fs_extra=require(_0x58e3('0x5'));var auth=require(_0x58e3('0x6'));var interaction=require(_0x58e3('0x7'));var config=require(_0x58e3('0x8'));var controller=require(_0x58e3('0x9'));router[_0x58e3('0xa')]('/',auth[_0x58e3('0xb')](),controller[_0x58e3('0xc')]);router['get'](_0x58e3('0xd'),auth[_0x58e3('0xb')](),controller['show']);router[_0x58e3('0xa')](_0x58e3('0xe'),auth[_0x58e3('0xb')](),controller[_0x58e3('0xf')]);router[_0x58e3('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x58e3('0x10')]);router[_0x58e3('0x11')]('/',auth[_0x58e3('0xb')](),controller[_0x58e3('0x12')]);router[_0x58e3('0x11')](_0x58e3('0xe'),auth[_0x58e3('0xb')](),controller[_0x58e3('0x13')]);router[_0x58e3('0x14')](_0x58e3('0xd'),auth[_0x58e3('0xb')](),controller[_0x58e3('0x15')]);router[_0x58e3('0x16')](_0x58e3('0xd'),auth[_0x58e3('0xb')](),controller[_0x58e3('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 80952d6..5af11ef 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 _0x4888=['exports','STRING','username'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x4888,0x198));var _0x8488=function(_0x185c5e,_0x1b05f5){_0x185c5e=_0x185c5e-0x0;var _0x14053a=_0x4888[_0x185c5e];return _0x14053a;};'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 +var _0xf61e=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3d17d4,_0x347967){var _0x1545cb=function(_0x5c4b66){while(--_0x5c4b66){_0x3d17d4['push'](_0x3d17d4['shift']());}};_0x1545cb(++_0x347967);}(_0xf61e,0x191));var _0xef61=function(_0x3b2a88,_0x44a774){_0x3b2a88=_0x3b2a88-0x0;var _0x48bc10=_0xf61e[_0x3b2a88];return _0x48bc10;};'use strict';var Sequelize=require(_0xef61('0x0'));module[_0xef61('0x1')]={'name':{'type':Sequelize[_0xef61('0x2')]},'description':{'type':Sequelize[_0xef61('0x2')]},'username':{'type':Sequelize[_0xef61('0x2')],'unique':_0xef61('0x3')},'apiKey':{'type':Sequelize[_0xef61('0x2')]},'remoteUri':{'type':Sequelize[_0xef61('0x2')],'unique':_0xef61('0x4')},'serverUrl':{'type':Sequelize[_0xef61('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 618f9af..81dde30 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 _0x8130=['count','Content-Range','json','apply','reject','save','update','error','stack','name','send','map','FreshdeskAccount','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','include','findAll','rows','then','show','includeAll','options','catch','create','body','params','destroy','find','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskConfiguration','FreshdeskField','getFields','apiKey','remoteUri','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','toString','base64','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit'];(function(_0x3c1861,_0x532642){var _0x4e5a61=function(_0x28e520){while(--_0x28e520){_0x3c1861['push'](_0x3c1861['shift']());}};_0x4e5a61(++_0x532642);}(_0x8130,0x146));var _0x0813=function(_0x4bf23b,_0x1e002b){_0x4bf23b=_0x4bf23b-0x0;var _0x5680eb=_0x8130[_0x4bf23b];return _0x5680eb;};'use strict';var emlformat=require(_0x0813('0x0'));var rimraf=require(_0x0813('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0813('0x2'));var rp=require(_0x0813('0x3'));var moment=require(_0x0813('0x4'));var BPromise=require(_0x0813('0x5'));var Mustache=require(_0x0813('0x6'));var util=require(_0x0813('0x7'));var path=require('path');var sox=require(_0x0813('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0813('0x9'));var _=require(_0x0813('0xa'));var squel=require(_0x0813('0xb'));var crypto=require(_0x0813('0xc'));var jsforce=require(_0x0813('0xd'));var deskjs=require(_0x0813('0xe'));var toCsv=require(_0x0813('0xf'));var querystring=require('querystring');var Papa=require(_0x0813('0x10'));var Redis=require(_0x0813('0x11'));var authService=require(_0x0813('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0813('0x13'));var logger=require('../../config/logger')(_0x0813('0x14'));var utils=require('../../config/utils');var config=require(_0x0813('0x15'));var licenseUtil=require(_0x0813('0x16'));var db=require(_0x0813('0x17'))['db'];var integrations=require(_0x0813('0x18'));function respondWithStatusCode(_0x5b17f2,_0x4dcc3a){_0x4dcc3a=_0x4dcc3a||0xcc;return function(_0x29bdd8){if(_0x29bdd8){return _0x5b17f2[_0x0813('0x19')](_0x4dcc3a);}return _0x5b17f2['status'](_0x4dcc3a)[_0x0813('0x1a')]();};}function respondWithResult(_0x4dae33,_0x58e56c){_0x58e56c=_0x58e56c||0xc8;return function(_0x44b7da){if(_0x44b7da){return _0x4dae33[_0x0813('0x1b')](_0x58e56c)['json'](_0x44b7da);}};}function respondWithFilteredResult(_0x2cf4f1,_0x5793cb){return function(_0x29537f){if(_0x29537f){var _0x2253cc=typeof _0x5793cb[_0x0813('0x1c')]===_0x0813('0x1d')&&typeof _0x5793cb[_0x0813('0x1e')]===_0x0813('0x1d');var _0x161a53=_0x29537f[_0x0813('0x1f')];var _0x507b75=_0x2253cc?0x0:_0x5793cb[_0x0813('0x1c')];var _0x555c32=_0x2253cc?_0x29537f[_0x0813('0x1f')]:_0x5793cb[_0x0813('0x1c')]+_0x5793cb['limit'];var _0x38249d;if(_0x555c32>=_0x161a53){_0x555c32=_0x161a53;_0x38249d=0xc8;}else{_0x38249d=0xce;}_0x2cf4f1[_0x0813('0x1b')](_0x38249d);return _0x2cf4f1['set'](_0x0813('0x20'),_0x507b75+'-'+_0x555c32+'/'+_0x161a53)[_0x0813('0x21')](_0x29537f);}return null;};}function patchUpdates(_0x4d7680){return function(_0x3d1161){try{jsonpatch[_0x0813('0x22')](_0x3d1161,_0x4d7680,!![]);}catch(_0x145926){return BPromise[_0x0813('0x23')](_0x145926);}return _0x3d1161[_0x0813('0x24')]();};}function saveUpdates(_0x5a6cdc,_0x2bb694){return function(_0x3aa1b6){if(_0x3aa1b6){return _0x3aa1b6[_0x0813('0x25')](_0x5a6cdc)['then'](function(_0x35b3d6){return _0x35b3d6;});}return null;};}function removeEntity(_0x5eabe4,_0x56f4b6){return function(_0x2655b6){if(_0x2655b6){return _0x2655b6['destroy']()['then'](function(){_0x5eabe4[_0x0813('0x1b')](0xcc)[_0x0813('0x1a')]();});}};}function handleEntityNotFound(_0x1a8d2a,_0x2f8849){return function(_0x215acb){if(!_0x215acb){_0x1a8d2a[_0x0813('0x19')](0x194);}return _0x215acb;};}function handleError(_0x42627c,_0x3ac129){_0x3ac129=_0x3ac129||0x1f4;return function(_0x59a55e){logger[_0x0813('0x26')](_0x59a55e[_0x0813('0x27')]);if(_0x59a55e[_0x0813('0x28')]){delete _0x59a55e[_0x0813('0x28')];}_0x42627c[_0x0813('0x1b')](_0x3ac129)[_0x0813('0x29')](_0x59a55e);};}exports['index']=function(_0xa36d86,_0x48294b){var _0x54ed64={},_0x54bf5d={},_0x3c3321={'count':0x0,'rows':[]};var _0x2a3e10=_[_0x0813('0x2a')](db[_0x0813('0x2b')][_0x0813('0x2c')],function(_0x369665){return{'name':_0x369665['fieldName'],'type':_0x369665[_0x0813('0x2d')][_0x0813('0x2e')]};});_0x54bf5d['model']=_['map'](_0x2a3e10,_0x0813('0x28'));_0x54bf5d[_0x0813('0x2f')]=_[_0x0813('0x30')](_0xa36d86['query']);_0x54bf5d[_0x0813('0x31')]=_[_0x0813('0x32')](_0x54bf5d['model'],_0x54bf5d['query']);_0x54ed64[_0x0813('0x33')]=_[_0x0813('0x32')](_0x54bf5d[_0x0813('0x34')],qs[_0x0813('0x35')](_0xa36d86['query'][_0x0813('0x35')]));_0x54ed64[_0x0813('0x33')]=_0x54ed64[_0x0813('0x33')][_0x0813('0x36')]?_0x54ed64['attributes']:_0x54bf5d['model'];if(!_0xa36d86[_0x0813('0x2f')][_0x0813('0x37')](_0x0813('0x38'))){_0x54ed64['limit']=qs[_0x0813('0x1e')](_0xa36d86[_0x0813('0x2f')][_0x0813('0x1e')]);_0x54ed64['offset']=qs['offset'](_0xa36d86[_0x0813('0x2f')][_0x0813('0x1c')]);}_0x54ed64[_0x0813('0x39')]=qs[_0x0813('0x3a')](_0xa36d86[_0x0813('0x2f')][_0x0813('0x3a')]);_0x54ed64['where']=qs[_0x0813('0x31')](_['pick'](_0xa36d86['query'],_0x54bf5d['filters']),_0x2a3e10);if(_0xa36d86[_0x0813('0x2f')][_0x0813('0x3b')]){_0x54ed64['where']=_['merge'](_0x54ed64[_0x0813('0x3c')],{'$or':_[_0x0813('0x2a')](_0x2a3e10,function(_0x136b87){if(_0x136b87[_0x0813('0x2d')]!==_0x0813('0x3d')){var _0x1dfcea={};_0x1dfcea[_0x136b87[_0x0813('0x28')]]={'$like':'%'+_0xa36d86[_0x0813('0x2f')][_0x0813('0x3b')]+'%'};return _0x1dfcea;}})});}_0x54ed64=_[_0x0813('0x3e')]({},_0x54ed64,_0xa36d86['options']);var _0x4c4f29={'where':_0x54ed64['where']};return db[_0x0813('0x2b')][_0x0813('0x1f')](_0x4c4f29)['then'](function(_0x25bd04){_0x3c3321[_0x0813('0x1f')]=_0x25bd04;if(_0xa36d86[_0x0813('0x2f')]['includeAll']){_0x54ed64[_0x0813('0x3f')]=[{'all':!![]}];}return db[_0x0813('0x2b')][_0x0813('0x40')](_0x54ed64);})['then'](function(_0x3b7f8){_0x3c3321[_0x0813('0x41')]=_0x3b7f8;return _0x3c3321;})[_0x0813('0x42')](respondWithFilteredResult(_0x48294b,_0x54ed64))['catch'](handleError(_0x48294b,null));};exports[_0x0813('0x43')]=function(_0x38dc22,_0x47da3b){var _0x171a5e={'raw':![],'where':{'id':_0x38dc22['params']['id']}},_0x3c5695={};_0x3c5695[_0x0813('0x34')]=_['keys'](db[_0x0813('0x2b')][_0x0813('0x2c')]);_0x3c5695[_0x0813('0x2f')]=_['keys'](_0x38dc22[_0x0813('0x2f')]);_0x3c5695['filters']=_[_0x0813('0x32')](_0x3c5695[_0x0813('0x34')],_0x3c5695[_0x0813('0x2f')]);_0x171a5e[_0x0813('0x33')]=_[_0x0813('0x32')](_0x3c5695[_0x0813('0x34')],qs['fields'](_0x38dc22[_0x0813('0x2f')]['fields']));_0x171a5e[_0x0813('0x33')]=_0x171a5e['attributes']['length']?_0x171a5e['attributes']:_0x3c5695[_0x0813('0x34')];if(_0x38dc22[_0x0813('0x2f')][_0x0813('0x44')]){_0x171a5e[_0x0813('0x3f')]=[{'all':!![]}];}_0x171a5e=_[_0x0813('0x3e')]({},_0x171a5e,_0x38dc22[_0x0813('0x45')]);return db['FreshdeskAccount']['find'](_0x171a5e)[_0x0813('0x42')](handleEntityNotFound(_0x47da3b,null))[_0x0813('0x42')](respondWithResult(_0x47da3b,null))[_0x0813('0x46')](handleError(_0x47da3b,null));};exports[_0x0813('0x47')]=function(_0xadaead,_0x2e81e9){return db[_0x0813('0x2b')][_0x0813('0x47')](_0xadaead['body'],{})[_0x0813('0x42')](respondWithResult(_0x2e81e9,0xc9))[_0x0813('0x46')](handleError(_0x2e81e9,null));};exports[_0x0813('0x25')]=function(_0x1baf77,_0xfbb51){if(_0x1baf77[_0x0813('0x48')]['id']){delete _0x1baf77['body']['id'];}return db[_0x0813('0x2b')]['find']({'where':{'id':_0x1baf77[_0x0813('0x49')]['id']}})[_0x0813('0x42')](handleEntityNotFound(_0xfbb51,null))[_0x0813('0x42')](saveUpdates(_0x1baf77[_0x0813('0x48')],null))['then'](respondWithResult(_0xfbb51,null))[_0x0813('0x46')](handleError(_0xfbb51,null));};exports[_0x0813('0x4a')]=function(_0x353e25,_0x4226ed){return db['FreshdeskAccount'][_0x0813('0x4b')]({'where':{'id':_0x353e25[_0x0813('0x49')]['id']}})['then'](handleEntityNotFound(_0x4226ed,null))['then'](removeEntity(_0x4226ed,null))[_0x0813('0x46')](handleError(_0x4226ed,null));};exports[_0x0813('0x4c')]=function(_0x2846a7,_0x4afe57,_0x4b713a){var _0x5c596a={};var _0x497aab={};var _0x1daca3;var _0x1691fe;return db[_0x0813('0x2b')][_0x0813('0x4d')]({'where':{'id':_0x2846a7['params']['id']}})[_0x0813('0x42')](handleEntityNotFound(_0x4afe57,null))[_0x0813('0x42')](function(_0x597508){if(_0x597508){_0x1daca3=_0x597508;_0x497aab['model']=_[_0x0813('0x30')](db['FreshdeskConfiguration'][_0x0813('0x2c')]);_0x497aab[_0x0813('0x2f')]=_[_0x0813('0x30')](_0x2846a7['query']);_0x497aab[_0x0813('0x31')]=_[_0x0813('0x32')](_0x497aab[_0x0813('0x34')],_0x497aab[_0x0813('0x2f')]);_0x5c596a[_0x0813('0x33')]=_[_0x0813('0x32')](_0x497aab['model'],qs['fields'](_0x2846a7[_0x0813('0x2f')][_0x0813('0x35')]));_0x5c596a[_0x0813('0x33')]=_0x5c596a[_0x0813('0x33')]['length']?_0x5c596a[_0x0813('0x33')]:_0x497aab['model'];_0x5c596a[_0x0813('0x39')]=qs[_0x0813('0x3a')](_0x2846a7[_0x0813('0x2f')][_0x0813('0x3a')]);_0x5c596a[_0x0813('0x3c')]=qs[_0x0813('0x31')](_[_0x0813('0x4e')](_0x2846a7[_0x0813('0x2f')],_0x497aab['filters']));if(_0x2846a7[_0x0813('0x2f')][_0x0813('0x3b')]){_0x5c596a[_0x0813('0x3c')]=_[_0x0813('0x3e')](_0x5c596a[_0x0813('0x3c')],{'$or':_[_0x0813('0x2a')](_0x5c596a[_0x0813('0x33')],function(_0x5d5e0c){var _0x2a7d2a={};_0x2a7d2a[_0x5d5e0c]={'$like':'%'+_0x2846a7[_0x0813('0x2f')][_0x0813('0x3b')]+'%'};return _0x2a7d2a;})});}_0x5c596a=_['merge']({},_0x5c596a,_0x2846a7[_0x0813('0x45')]);return _0x1daca3[_0x0813('0x4c')](_0x5c596a);}})[_0x0813('0x42')](function(_0x14589a){if(_0x14589a){_0x1691fe=_0x14589a[_0x0813('0x36')];if(!_0x2846a7[_0x0813('0x2f')][_0x0813('0x37')](_0x0813('0x38'))){_0x5c596a[_0x0813('0x1e')]=qs[_0x0813('0x1e')](_0x2846a7[_0x0813('0x2f')]['limit']);_0x5c596a[_0x0813('0x1c')]=qs[_0x0813('0x1c')](_0x2846a7['query'][_0x0813('0x1c')]);}return _0x1daca3['getConfigurations'](_0x5c596a);}})[_0x0813('0x42')](function(_0x47ec39){if(_0x47ec39){return _0x47ec39?{'count':_0x1691fe,'rows':_0x47ec39}:null;}})['then'](respondWithResult(_0x4afe57,null))['catch'](handleError(_0x4afe57,null));};exports[_0x0813('0x4f')]=function(_0x1571a5,_0x1639eb,_0x4de737){if(_0x1571a5[_0x0813('0x48')]['id']){delete _0x1571a5['body']['id'];}return db['FreshdeskAccount'][_0x0813('0x4d')]({'where':{'id':_0x1571a5['params']['id']}})[_0x0813('0x42')](handleEntityNotFound(_0x1639eb,null))[_0x0813('0x42')](function(_0x29c684){if(_0x29c684){_0x1571a5[_0x0813('0x48')][_0x0813('0x50')]=_0x29c684['id'];_0x1571a5[_0x0813('0x48')][_0x0813('0x51')]=integrations[_0x0813('0x52')](_0x1571a5[_0x0813('0x48')]['channel'],_0x1571a5['body']['type']);_0x1571a5[_0x0813('0x48')][_0x0813('0x53')]=integrations[_0x0813('0x54')](_0x1571a5[_0x0813('0x48')][_0x0813('0x55')],_0x1571a5['body']['type']);return db[_0x0813('0x56')]['create'](_0x1571a5[_0x0813('0x48')],{'include':[{'model':db['FreshdeskField'],'as':_0x0813('0x51')},{'model':db[_0x0813('0x57')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1639eb,null))[_0x0813('0x46')](handleError(_0x1639eb,null));};exports[_0x0813('0x58')]=function(_0x17083f,_0x527bfa,_0x315944){var _0xbdf9fd='';return db['FreshdeskAccount'][_0x0813('0x4d')]({'where':{'id':_0x17083f[_0x0813('0x49')]['id']},'attributes':['id','remoteUri',_0x0813('0x59')]})[_0x0813('0x42')](handleEntityNotFound(_0x527bfa,null))[_0x0813('0x42')](function(_0x50d940){if(_0x50d940){_0xbdf9fd=_0x50d940[_0x0813('0x5a')];var _0x10ac34=_0xbdf9fd['slice'](-0x1);if(_0x10ac34==='/'){_0xbdf9fd=_0xbdf9fd[_0x0813('0x5b')](0x0,_0xbdf9fd[_0x0813('0x5c')](_0x10ac34));}return rp({'method':_0x0813('0x5d'),'uri':util[_0x0813('0x5e')](_0x0813('0x5f'),_0xbdf9fd,_0x0813('0x60')),'headers':{'Authorization':util['format'](_0x0813('0x61'),new Buffer(util[_0x0813('0x5e')]('%s:X',_0x50d940['apiKey']))[_0x0813('0x62')](_0x0813('0x63')))},'json':!![]});}})[_0x0813('0x42')](function(_0xbbf167){if(_0xbbf167){var _0x53f74f=['requester',_0x0813('0x64'),_0x0813('0x65'),_0x0813('0x66'),'status',_0x0813('0x67'),_0x0813('0x68'),_0x0813('0x69'),_0x0813('0x6a'),'group',_0x0813('0x6b')];_[_0x0813('0x6c')](_0xbbf167,function(_0x41435e){return _0x53f74f[_0x0813('0x6d')](_0x41435e[_0x0813('0x28')])||!_0x41435e[_0x0813('0x6e')]&&_0x41435e[_0x0813('0x2d')]!==_0x0813('0x6f')&&_0x41435e[_0x0813('0x2d')]!==_0x0813('0x70');});return{'count':_0xbbf167[_0x0813('0x36')],'rows':_[_0x0813('0x2a')](_0xbbf167,function(_0x2b9996){return{'id':_0x2b9996[_0x0813('0x28')],'name':_0x2b9996[_0x0813('0x71')],'custom':!_0x2b9996[_0x0813('0x6e')],'options':_0x2b9996['choices']?_[_0x0813('0x2a')](_0x2b9996[_0x0813('0x72')],function(_0x2d7316){return{'name':_[_0x0813('0x73')](_0x2d7316),'value':_0x2d7316};}):[]};})};}})['then'](respondWithResult(_0x527bfa,null))['catch'](function(_0x5db4b1){var _0x2b3653=_0x17083f[_0x0813('0x2f')]['test']?0x1f4:_0x5db4b1[_0x0813('0x74')]||0x1f4;logger[_0x0813('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x0813('0x58'),_0x2b3653,JSON[_0x0813('0x75')](_0x5db4b1));delete _0x5db4b1[_0x0813('0x28')];if(_0x2b3653===0x191){_0x2b3653=0x190;}_0x527bfa[_0x0813('0x1b')](_0x2b3653)[_0x0813('0x29')](_0x17083f[_0x0813('0x2f')]['test']?{'message':_0x0813('0x76'),'statusCode':_0x5db4b1['statusCode']}:_0x5db4b1);});}; \ No newline at end of file +var _0xa887=['%s:X','apiKey','toString','base64','requester','subject','agent','description','priority','source','company','remove','includes','custom_text','custom_dropdown','label','default','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','then','destroy','error','stack','name','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','fields','find','create','body','update','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','channel','Descriptions','FreshdeskField','remoteUri','slice','lastIndexOf','format','Basic\x20%s'];(function(_0x9f8aaa,_0x33a8a1){var _0x18a3a5=function(_0x5e916d){while(--_0x5e916d){_0x9f8aaa['push'](_0x9f8aaa['shift']());}};_0x18a3a5(++_0x33a8a1);}(_0xa887,0x89));var _0x7a88=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa887[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0x7a88('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7a88('0x1'));var jsonpatch=require(_0x7a88('0x2'));var rp=require('request-promise');var moment=require(_0x7a88('0x3'));var BPromise=require(_0x7a88('0x4'));var Mustache=require(_0x7a88('0x5'));var util=require(_0x7a88('0x6'));var path=require(_0x7a88('0x7'));var sox=require(_0x7a88('0x8'));var csv=require(_0x7a88('0x9'));var ejs=require(_0x7a88('0xa'));var fs=require('fs');var fs_extra=require(_0x7a88('0xb'));var _=require('lodash');var squel=require(_0x7a88('0xc'));var crypto=require(_0x7a88('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7a88('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7a88('0xf'));var Papa=require(_0x7a88('0x10'));var Redis=require(_0x7a88('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7a88('0x12'));var hardwareService=require(_0x7a88('0x13'));var logger=require(_0x7a88('0x14'))(_0x7a88('0x15'));var utils=require(_0x7a88('0x16'));var config=require(_0x7a88('0x17'));var licenseUtil=require(_0x7a88('0x18'));var db=require(_0x7a88('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xd21d2f,_0x53f6f2){_0x53f6f2=_0x53f6f2||0xcc;return function(_0x2af47d){if(_0x2af47d){return _0xd21d2f[_0x7a88('0x1a')](_0x53f6f2);}return _0xd21d2f[_0x7a88('0x1b')](_0x53f6f2)[_0x7a88('0x1c')]();};}function respondWithResult(_0x496ad9,_0x4023f9){_0x4023f9=_0x4023f9||0xc8;return function(_0x52393a){if(_0x52393a){return _0x496ad9[_0x7a88('0x1b')](_0x4023f9)['json'](_0x52393a);}};}function respondWithFilteredResult(_0x5784d5,_0x59b30a){return function(_0x129357){if(_0x129357){var _0x4c3436=typeof _0x59b30a[_0x7a88('0x1d')]===_0x7a88('0x1e')&&typeof _0x59b30a[_0x7a88('0x1f')]===_0x7a88('0x1e');var _0x3d5ce5=_0x129357['count'];var _0x4db2e2=_0x4c3436?0x0:_0x59b30a['offset'];var _0x5d6fce=_0x4c3436?_0x129357[_0x7a88('0x20')]:_0x59b30a[_0x7a88('0x1d')]+_0x59b30a[_0x7a88('0x1f')];var _0x3d684a;if(_0x5d6fce>=_0x3d5ce5){_0x5d6fce=_0x3d5ce5;_0x3d684a=0xc8;}else{_0x3d684a=0xce;}_0x5784d5[_0x7a88('0x1b')](_0x3d684a);return _0x5784d5[_0x7a88('0x21')](_0x7a88('0x22'),_0x4db2e2+'-'+_0x5d6fce+'/'+_0x3d5ce5)[_0x7a88('0x23')](_0x129357);}return null;};}function patchUpdates(_0xdd197f){return function(_0x420172){try{jsonpatch[_0x7a88('0x24')](_0x420172,_0xdd197f,!![]);}catch(_0x135267){return BPromise['reject'](_0x135267);}return _0x420172['save']();};}function saveUpdates(_0x41708d,_0x384a2b){return function(_0x5b9f1b){if(_0x5b9f1b){return _0x5b9f1b['update'](_0x41708d)[_0x7a88('0x25')](function(_0xa17d73){return _0xa17d73;});}return null;};}function removeEntity(_0x618fc,_0x26e424){return function(_0x5eb08f){if(_0x5eb08f){return _0x5eb08f[_0x7a88('0x26')]()[_0x7a88('0x25')](function(){_0x618fc[_0x7a88('0x1b')](0xcc)[_0x7a88('0x1c')]();});}};}function handleEntityNotFound(_0x48183a,_0x4a1d65){return function(_0x30323){if(!_0x30323){_0x48183a['sendStatus'](0x194);}return _0x30323;};}function handleError(_0x2f7378,_0x4a441d){_0x4a441d=_0x4a441d||0x1f4;return function(_0x5efe98){logger[_0x7a88('0x27')](_0x5efe98[_0x7a88('0x28')]);if(_0x5efe98[_0x7a88('0x29')]){delete _0x5efe98[_0x7a88('0x29')];}_0x2f7378[_0x7a88('0x1b')](_0x4a441d)['send'](_0x5efe98);};}exports['index']=function(_0x38ada5,_0x3caa79){var _0x44f401={},_0x217756={},_0x8c91c6={'count':0x0,'rows':[]};var _0x248486=_[_0x7a88('0x2a')](db[_0x7a88('0x2b')][_0x7a88('0x2c')],function(_0x195a5d){return{'name':_0x195a5d[_0x7a88('0x2d')],'type':_0x195a5d[_0x7a88('0x2e')][_0x7a88('0x2f')]};});_0x217756[_0x7a88('0x30')]=_[_0x7a88('0x2a')](_0x248486,_0x7a88('0x29'));_0x217756['query']=_[_0x7a88('0x31')](_0x38ada5[_0x7a88('0x32')]);_0x217756[_0x7a88('0x33')]=_[_0x7a88('0x34')](_0x217756[_0x7a88('0x30')],_0x217756[_0x7a88('0x32')]);_0x44f401[_0x7a88('0x35')]=_[_0x7a88('0x34')](_0x217756['model'],qs['fields'](_0x38ada5[_0x7a88('0x32')]['fields']));_0x44f401[_0x7a88('0x35')]=_0x44f401[_0x7a88('0x35')][_0x7a88('0x36')]?_0x44f401[_0x7a88('0x35')]:_0x217756['model'];if(!_0x38ada5[_0x7a88('0x32')]['hasOwnProperty'](_0x7a88('0x37'))){_0x44f401[_0x7a88('0x1f')]=qs[_0x7a88('0x1f')](_0x38ada5['query'][_0x7a88('0x1f')]);_0x44f401[_0x7a88('0x1d')]=qs[_0x7a88('0x1d')](_0x38ada5['query'][_0x7a88('0x1d')]);}_0x44f401[_0x7a88('0x38')]=qs[_0x7a88('0x39')](_0x38ada5[_0x7a88('0x32')]['sort']);_0x44f401[_0x7a88('0x3a')]=qs[_0x7a88('0x33')](_[_0x7a88('0x3b')](_0x38ada5[_0x7a88('0x32')],_0x217756[_0x7a88('0x33')]),_0x248486);if(_0x38ada5['query']['filter']){_0x44f401['where']=_[_0x7a88('0x3c')](_0x44f401['where'],{'$or':_[_0x7a88('0x2a')](_0x248486,function(_0x2c199c){if(_0x2c199c[_0x7a88('0x2e')]!==_0x7a88('0x3d')){var _0x1fb960={};_0x1fb960[_0x2c199c[_0x7a88('0x29')]]={'$like':'%'+_0x38ada5[_0x7a88('0x32')][_0x7a88('0x3e')]+'%'};return _0x1fb960;}})});}_0x44f401=_['merge']({},_0x44f401,_0x38ada5[_0x7a88('0x3f')]);var _0x3d068c={'where':_0x44f401[_0x7a88('0x3a')]};return db[_0x7a88('0x2b')]['count'](_0x3d068c)[_0x7a88('0x25')](function(_0x4f19b8){_0x8c91c6['count']=_0x4f19b8;if(_0x38ada5['query'][_0x7a88('0x40')]){_0x44f401[_0x7a88('0x41')]=[{'all':!![]}];}return db[_0x7a88('0x2b')]['findAll'](_0x44f401);})[_0x7a88('0x25')](function(_0x102a45){_0x8c91c6[_0x7a88('0x42')]=_0x102a45;return _0x8c91c6;})[_0x7a88('0x25')](respondWithFilteredResult(_0x3caa79,_0x44f401))[_0x7a88('0x43')](handleError(_0x3caa79,null));};exports[_0x7a88('0x44')]=function(_0xe5e816,_0x1367b5){var _0x290a71={'raw':![],'where':{'id':_0xe5e816[_0x7a88('0x45')]['id']}},_0x2aa42a={};_0x2aa42a[_0x7a88('0x30')]=_['keys'](db[_0x7a88('0x2b')][_0x7a88('0x2c')]);_0x2aa42a[_0x7a88('0x32')]=_[_0x7a88('0x31')](_0xe5e816['query']);_0x2aa42a['filters']=_['intersection'](_0x2aa42a[_0x7a88('0x30')],_0x2aa42a[_0x7a88('0x32')]);_0x290a71[_0x7a88('0x35')]=_[_0x7a88('0x34')](_0x2aa42a['model'],qs['fields'](_0xe5e816['query'][_0x7a88('0x46')]));_0x290a71[_0x7a88('0x35')]=_0x290a71[_0x7a88('0x35')][_0x7a88('0x36')]?_0x290a71[_0x7a88('0x35')]:_0x2aa42a[_0x7a88('0x30')];if(_0xe5e816[_0x7a88('0x32')]['includeAll']){_0x290a71['include']=[{'all':!![]}];}_0x290a71=_[_0x7a88('0x3c')]({},_0x290a71,_0xe5e816[_0x7a88('0x3f')]);return db['FreshdeskAccount'][_0x7a88('0x47')](_0x290a71)[_0x7a88('0x25')](handleEntityNotFound(_0x1367b5,null))[_0x7a88('0x25')](respondWithResult(_0x1367b5,null))[_0x7a88('0x43')](handleError(_0x1367b5,null));};exports[_0x7a88('0x48')]=function(_0x1fa7fd,_0x55e5cc){return db[_0x7a88('0x2b')][_0x7a88('0x48')](_0x1fa7fd[_0x7a88('0x49')],{})[_0x7a88('0x25')](respondWithResult(_0x55e5cc,0xc9))['catch'](handleError(_0x55e5cc,null));};exports[_0x7a88('0x4a')]=function(_0x5d667b,_0x1eb249){if(_0x5d667b[_0x7a88('0x49')]['id']){delete _0x5d667b[_0x7a88('0x49')]['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x5d667b[_0x7a88('0x45')]['id']}})[_0x7a88('0x25')](handleEntityNotFound(_0x1eb249,null))['then'](saveUpdates(_0x5d667b[_0x7a88('0x49')],null))[_0x7a88('0x25')](respondWithResult(_0x1eb249,null))['catch'](handleError(_0x1eb249,null));};exports[_0x7a88('0x26')]=function(_0x207839,_0x16ffa7){return db[_0x7a88('0x2b')][_0x7a88('0x47')]({'where':{'id':_0x207839['params']['id']}})[_0x7a88('0x25')](handleEntityNotFound(_0x16ffa7,null))[_0x7a88('0x25')](removeEntity(_0x16ffa7,null))[_0x7a88('0x43')](handleError(_0x16ffa7,null));};exports[_0x7a88('0x4b')]=function(_0x4d99e8,_0x43f355,_0x2285ca){var _0x53a956={};var _0x5ec237={};var _0x5d05fe;var _0x34cdcf;return db['FreshdeskAccount'][_0x7a88('0x4c')]({'where':{'id':_0x4d99e8[_0x7a88('0x45')]['id']}})['then'](handleEntityNotFound(_0x43f355,null))[_0x7a88('0x25')](function(_0x559ef9){if(_0x559ef9){_0x5d05fe=_0x559ef9;_0x5ec237[_0x7a88('0x30')]=_['keys'](db[_0x7a88('0x4d')][_0x7a88('0x2c')]);_0x5ec237['query']=_[_0x7a88('0x31')](_0x4d99e8[_0x7a88('0x32')]);_0x5ec237[_0x7a88('0x33')]=_[_0x7a88('0x34')](_0x5ec237[_0x7a88('0x30')],_0x5ec237['query']);_0x53a956[_0x7a88('0x35')]=_[_0x7a88('0x34')](_0x5ec237[_0x7a88('0x30')],qs['fields'](_0x4d99e8[_0x7a88('0x32')][_0x7a88('0x46')]));_0x53a956[_0x7a88('0x35')]=_0x53a956[_0x7a88('0x35')]['length']?_0x53a956[_0x7a88('0x35')]:_0x5ec237[_0x7a88('0x30')];_0x53a956['order']=qs[_0x7a88('0x39')](_0x4d99e8[_0x7a88('0x32')]['sort']);_0x53a956[_0x7a88('0x3a')]=qs['filters'](_[_0x7a88('0x3b')](_0x4d99e8[_0x7a88('0x32')],_0x5ec237[_0x7a88('0x33')]));if(_0x4d99e8[_0x7a88('0x32')][_0x7a88('0x3e')]){_0x53a956[_0x7a88('0x3a')]=_['merge'](_0x53a956['where'],{'$or':_[_0x7a88('0x2a')](_0x53a956[_0x7a88('0x35')],function(_0x226bac){var _0xc660d7={};_0xc660d7[_0x226bac]={'$like':'%'+_0x4d99e8['query'][_0x7a88('0x3e')]+'%'};return _0xc660d7;})});}_0x53a956=_[_0x7a88('0x3c')]({},_0x53a956,_0x4d99e8[_0x7a88('0x3f')]);return _0x5d05fe[_0x7a88('0x4b')](_0x53a956);}})[_0x7a88('0x25')](function(_0x419199){if(_0x419199){_0x34cdcf=_0x419199[_0x7a88('0x36')];if(!_0x4d99e8[_0x7a88('0x32')]['hasOwnProperty'](_0x7a88('0x37'))){_0x53a956[_0x7a88('0x1f')]=qs[_0x7a88('0x1f')](_0x4d99e8[_0x7a88('0x32')][_0x7a88('0x1f')]);_0x53a956[_0x7a88('0x1d')]=qs[_0x7a88('0x1d')](_0x4d99e8[_0x7a88('0x32')][_0x7a88('0x1d')]);}return _0x5d05fe[_0x7a88('0x4b')](_0x53a956);}})[_0x7a88('0x25')](function(_0x3b0753){if(_0x3b0753){return _0x3b0753?{'count':_0x34cdcf,'rows':_0x3b0753}:null;}})[_0x7a88('0x25')](respondWithResult(_0x43f355,null))[_0x7a88('0x43')](handleError(_0x43f355,null));};exports[_0x7a88('0x4e')]=function(_0x2b7d03,_0xf114ae,_0x596e55){if(_0x2b7d03['body']['id']){delete _0x2b7d03[_0x7a88('0x49')]['id'];}return db[_0x7a88('0x2b')][_0x7a88('0x4c')]({'where':{'id':_0x2b7d03[_0x7a88('0x45')]['id']}})[_0x7a88('0x25')](handleEntityNotFound(_0xf114ae,null))[_0x7a88('0x25')](function(_0x3b8ac7){if(_0x3b8ac7){_0x2b7d03[_0x7a88('0x49')][_0x7a88('0x4f')]=_0x3b8ac7['id'];_0x2b7d03[_0x7a88('0x49')][_0x7a88('0x50')]=integrations['getSubjects'](_0x2b7d03[_0x7a88('0x49')][_0x7a88('0x51')],_0x2b7d03[_0x7a88('0x49')][_0x7a88('0x2e')]);_0x2b7d03['body'][_0x7a88('0x52')]=integrations['getDescriptions'](_0x2b7d03[_0x7a88('0x49')][_0x7a88('0x51')],_0x2b7d03[_0x7a88('0x49')][_0x7a88('0x2e')]);return db[_0x7a88('0x4d')][_0x7a88('0x48')](_0x2b7d03[_0x7a88('0x49')],{'include':[{'model':db['FreshdeskField'],'as':_0x7a88('0x50')},{'model':db[_0x7a88('0x53')],'as':_0x7a88('0x52')}]});}return null;})['then'](respondWithResult(_0xf114ae,null))[_0x7a88('0x43')](handleError(_0xf114ae,null));};exports['getFields']=function(_0xa9c0bb,_0x4a5b8f,_0x8f4378){var _0x1a041f='';return db[_0x7a88('0x2b')][_0x7a88('0x4c')]({'where':{'id':_0xa9c0bb[_0x7a88('0x45')]['id']},'attributes':['id',_0x7a88('0x54'),'apiKey']})['then'](handleEntityNotFound(_0x4a5b8f,null))[_0x7a88('0x25')](function(_0x16b574){if(_0x16b574){_0x1a041f=_0x16b574['remoteUri'];var _0x41a86b=_0x1a041f[_0x7a88('0x55')](-0x1);if(_0x41a86b==='/'){_0x1a041f=_0x1a041f['substring'](0x0,_0x1a041f[_0x7a88('0x56')](_0x41a86b));}return rp({'method':'GET','uri':util[_0x7a88('0x57')]('%s/%s',_0x1a041f,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x7a88('0x57')](_0x7a88('0x58'),new Buffer(util[_0x7a88('0x57')](_0x7a88('0x59'),_0x16b574[_0x7a88('0x5a')]))[_0x7a88('0x5b')](_0x7a88('0x5c')))},'json':!![]});}})['then'](function(_0x27c779){if(_0x27c779){var _0x500461=[_0x7a88('0x5d'),_0x7a88('0x5e'),_0x7a88('0x5f'),_0x7a88('0x60'),_0x7a88('0x1b'),_0x7a88('0x61'),'group',_0x7a88('0x62'),'ticket_type','group',_0x7a88('0x63')];_[_0x7a88('0x64')](_0x27c779,function(_0x5271b4){return _0x500461[_0x7a88('0x65')](_0x5271b4[_0x7a88('0x29')])||!_0x5271b4['default']&&_0x5271b4[_0x7a88('0x2e')]!==_0x7a88('0x66')&&_0x5271b4[_0x7a88('0x2e')]!==_0x7a88('0x67');});return{'count':_0x27c779[_0x7a88('0x36')],'rows':_[_0x7a88('0x2a')](_0x27c779,function(_0x14befc){return{'id':_0x14befc['name'],'name':_0x14befc[_0x7a88('0x68')],'custom':!_0x14befc[_0x7a88('0x69')],'options':_0x14befc[_0x7a88('0x6a')]?_[_0x7a88('0x2a')](_0x14befc[_0x7a88('0x6a')],function(_0x220b95){return{'name':_[_0x7a88('0x6b')](_0x220b95),'value':_0x220b95};}):[]};})};}})[_0x7a88('0x25')](respondWithResult(_0x4a5b8f,null))['catch'](function(_0x53d3a8){var _0x367909=_0xa9c0bb[_0x7a88('0x32')][_0x7a88('0x6c')]?0x1f4:_0x53d3a8['statusCode']||0x1f4;logger[_0x7a88('0x27')](_0x7a88('0x6d'),_0x7a88('0x6e'),_0x367909,JSON['stringify'](_0x53d3a8));delete _0x53d3a8['name'];if(_0x367909===0x191){_0x367909=0x190;}_0x4a5b8f['status'](_0x367909)['send'](_0xa9c0bb[_0x7a88('0x32')][_0x7a88('0x6c')]?{'message':_0x7a88('0x6f'),'statusCode':_0x53d3a8[_0x7a88('0x70')]}:_0x53d3a8);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 0dcef00..4ae7715 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 _0xd2fa=['../../components/integrations/configuration','exports','FreshdeskAccount','../../config/logger','moment','bluebird','request-promise','./intFreshdeskAccount.attributes'];(function(_0x4a7e98,_0x250137){var _0x27d10d=function(_0x378768){while(--_0x378768){_0x4a7e98['push'](_0x4a7e98['shift']());}};_0x27d10d(++_0x250137);}(_0xd2fa,0xab));var _0xad2f=function(_0x5108ec,_0x32e6a8){_0x5108ec=_0x5108ec-0x0;var _0x1bddc1=_0xd2fa[_0x5108ec];return _0x1bddc1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xad2f('0x0'))('api');var moment=require(_0xad2f('0x1'));var BPromise=require(_0xad2f('0x2'));var rp=require(_0xad2f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xad2f('0x4'));var integrations=require(_0xad2f('0x5'));module[_0xad2f('0x6')]=function(_0xf42ef6,_0x44785f){return _0xf42ef6['define'](_0xad2f('0x7'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05c6=['moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api'];(function(_0x31709e,_0x2173ab){var _0x1c918c=function(_0x38e845){while(--_0x38e845){_0x31709e['push'](_0x31709e['shift']());}};_0x1c918c(++_0x2173ab);}(_0x05c6,0xc1));var _0x605c=function(_0xd8a79b,_0x294e90){_0xd8a79b=_0xd8a79b-0x0;var _0x5525ae=_0x05c6[_0xd8a79b];return _0x5525ae;};'use strict';var _=require(_0x605c('0x0'));var util=require(_0x605c('0x1'));var logger=require('../../config/logger')(_0x605c('0x2'));var moment=require(_0x605c('0x3'));var BPromise=require(_0x605c('0x4'));var rp=require(_0x605c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x605c('0x6'));var config=require(_0x605c('0x7'));var attributes=require(_0x605c('0x8'));var integrations=require(_0x605c('0x9'));module[_0x605c('0xa')]=function(_0x112c8f,_0x3b9e7c){return _0x112c8f[_0x605c('0xb')](_0x605c('0xc'),attributes,{'tableName':_0x605c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 066f4dc..aed8370 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 _0x7968=['attributes','limit','include','model','map','GetFreshdeskAccount','ShowFreshdeskAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','FreshdeskAccount','findAll','options','raw'];(function(_0x3d387a,_0x81c3ff){var _0xe3eebd=function(_0x3d90bf){while(--_0x3d90bf){_0x3d387a['push'](_0x3d387a['shift']());}};_0xe3eebd(++_0x81c3ff);}(_0x7968,0x105));var _0x8796=function(_0x24c735,_0xee13cb){_0x24c735=_0x24c735-0x0;var _0x40a4af=_0x7968[_0x24c735];return _0x40a4af;};'use strict';var _=require(_0x8796('0x0'));var util=require(_0x8796('0x1'));var moment=require(_0x8796('0x2'));var BPromise=require(_0x8796('0x3'));var rs=require(_0x8796('0x4'));var fs=require('fs');var Redis=require(_0x8796('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8796('0x6'));var logger=require(_0x8796('0x7'))(_0x8796('0x8'));var config=require(_0x8796('0x9'));var jayson=require(_0x8796('0xa'));var client=jayson[_0x8796('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcb42af,_0x39b100,_0x1b3231){return new BPromise(function(_0x54577f,_0x5c6ff9){return client['request'](_0xcb42af,_0x1b3231)[_0x8796('0xc')](function(_0x52c0a2){logger[_0x8796('0xd')](_0x8796('0xe'),_0x39b100,_0x8796('0xf'));logger[_0x8796('0x10')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x39b100,_0x8796('0xf'),JSON[_0x8796('0x11')](_0x52c0a2));if(_0x52c0a2[_0x8796('0x12')]){if(_0x52c0a2[_0x8796('0x12')][_0x8796('0x13')]===0x1f4){logger['error'](_0x8796('0xe'),_0x39b100,_0x52c0a2[_0x8796('0x12')][_0x8796('0x14')]);return _0x5c6ff9(_0x52c0a2['error'][_0x8796('0x14')]);}logger[_0x8796('0x12')](_0x8796('0xe'),_0x39b100,_0x52c0a2[_0x8796('0x12')][_0x8796('0x14')]);return _0x54577f(_0x52c0a2[_0x8796('0x12')][_0x8796('0x14')]);}else{logger['info'](_0x8796('0xe'),_0x39b100,_0x8796('0xf'));_0x54577f(_0x52c0a2[_0x8796('0x15')]['message']);}})[_0x8796('0x16')](function(_0x41b153){logger['error'](_0x8796('0xe'),_0x39b100,_0x41b153);_0x5c6ff9(_0x41b153);});});}exports['GetFreshdeskAccount']=function(_0x19519e){var _0x2e3e62=this;return new Promise(function(_0x3de195,_0x4754b3){return db[_0x8796('0x17')][_0x8796('0x18')]({'raw':_0x19519e[_0x8796('0x19')]?_0x19519e[_0x8796('0x19')][_0x8796('0x1a')]===undefined?!![]:![]:!![],'where':_0x19519e[_0x8796('0x19')]?_0x19519e[_0x8796('0x19')]['where']||null:null,'attributes':_0x19519e['options']?_0x19519e[_0x8796('0x19')][_0x8796('0x1b')]||null:null,'limit':_0x19519e['options']?_0x19519e[_0x8796('0x19')][_0x8796('0x1c')]||null:null,'include':_0x19519e[_0x8796('0x19')]?_0x19519e[_0x8796('0x19')][_0x8796('0x1d')]?_['map'](_0x19519e[_0x8796('0x19')][_0x8796('0x1d')],function(_0x9c6a38){return{'model':db[_0x9c6a38[_0x8796('0x1e')]],'as':_0x9c6a38['as'],'attributes':_0x9c6a38[_0x8796('0x1b')],'include':_0x9c6a38['include']?_[_0x8796('0x1f')](_0x9c6a38[_0x8796('0x1d')],function(_0x34c5bf){return{'model':db[_0x34c5bf[_0x8796('0x1e')]],'as':_0x34c5bf['as'],'attributes':_0x34c5bf[_0x8796('0x1b')],'include':_0x34c5bf[_0x8796('0x1d')]?_['map'](_0x34c5bf[_0x8796('0x1d')],function(_0x24be5b){return{'model':db[_0x24be5b[_0x8796('0x1e')]],'as':_0x24be5b['as'],'attributes':_0x24be5b[_0x8796('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8796('0xc')](function(_0x8bb36e){logger[_0x8796('0xd')](_0x8796('0x20'),_0x19519e);logger['debug'](_0x8796('0x20'),_0x19519e,JSON[_0x8796('0x11')](_0x8bb36e));_0x3de195(_0x8bb36e);})[_0x8796('0x16')](function(_0x29bbda){logger['error'](_0x8796('0x20'),_0x29bbda[_0x8796('0x14')],_0x19519e);_0x4754b3(_0x2e3e62[_0x8796('0x12')](0x1f4,_0x29bbda[_0x8796('0x14')]));});});};exports[_0x8796('0x21')]=function(_0x21b7b3){var _0x42068b=this;return new Promise(function(_0x2f396f,_0x5368fb){return db[_0x8796('0x17')][_0x8796('0x22')]({'raw':_0x21b7b3[_0x8796('0x19')]?_0x21b7b3[_0x8796('0x19')][_0x8796('0x1a')]===undefined?!![]:![]:!![],'where':_0x21b7b3[_0x8796('0x19')]?_0x21b7b3[_0x8796('0x19')][_0x8796('0x23')]||null:null,'attributes':_0x21b7b3[_0x8796('0x19')]?_0x21b7b3['options']['attributes']||null:null,'include':_0x21b7b3['options']?_0x21b7b3[_0x8796('0x19')]['include']?_[_0x8796('0x1f')](_0x21b7b3['options'][_0x8796('0x1d')],function(_0x352cf5){return{'model':db[_0x352cf5[_0x8796('0x1e')]],'as':_0x352cf5['as'],'attributes':_0x352cf5[_0x8796('0x1b')],'include':_0x352cf5[_0x8796('0x1d')]?_['map'](_0x352cf5[_0x8796('0x1d')],function(_0x4ded33){return{'model':db[_0x4ded33['model']],'as':_0x4ded33['as'],'attributes':_0x4ded33[_0x8796('0x1b')],'include':_0x4ded33[_0x8796('0x1d')]?_['map'](_0x4ded33[_0x8796('0x1d')],function(_0x32c799){return{'model':db[_0x32c799[_0x8796('0x1e')]],'as':_0x32c799['as'],'attributes':_0x32c799[_0x8796('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8796('0xc')](function(_0x27e5bf){logger['info'](_0x8796('0x21'),_0x21b7b3);logger['debug'](_0x8796('0x21'),_0x21b7b3,JSON[_0x8796('0x11')](_0x27e5bf));_0x2f396f(_0x27e5bf);})['catch'](function(_0x21b1e9){logger[_0x8796('0x12')](_0x8796('0x21'),_0x21b1e9['message'],_0x21b7b3);_0x5368fb(_0x42068b[_0x8796('0x12')](0x1f4,_0x21b1e9[_0x8796('0x14')]));});});}; \ No newline at end of file +var _0xf87a=['options','raw','where','include','map','model','attributes','stringify','info','ShowFreshdeskAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll'];(function(_0x1d3024,_0x5c0fdc){var _0x2867ba=function(_0x1a1afa){while(--_0x1a1afa){_0x1d3024['push'](_0x1d3024['shift']());}};_0x2867ba(++_0x5c0fdc);}(_0xf87a,0x133));var _0xaf87=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf87a[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xaf87('0x0'));var util=require(_0xaf87('0x1'));var moment=require(_0xaf87('0x2'));var BPromise=require(_0xaf87('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf87('0x4'));var db=require(_0xaf87('0x5'))['db'];var utils=require(_0xaf87('0x6'));var logger=require('../../config/logger')(_0xaf87('0x7'));var config=require(_0xaf87('0x8'));var jayson=require(_0xaf87('0x9'));var client=jayson['client'][_0xaf87('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f0f0b,_0x454ab6,_0x2b6987){return new BPromise(function(_0x444a17,_0x3dc738){return client['request'](_0x3f0f0b,_0x2b6987)[_0xaf87('0xb')](function(_0x1c5634){logger['info'](_0xaf87('0xc'),_0x454ab6,_0xaf87('0xd'));logger[_0xaf87('0xe')](_0xaf87('0xf'),_0x454ab6,'request\x20sent',JSON['stringify'](_0x1c5634));if(_0x1c5634['error']){if(_0x1c5634['error']['code']===0x1f4){logger[_0xaf87('0x10')](_0xaf87('0xc'),_0x454ab6,_0x1c5634[_0xaf87('0x10')]['message']);return _0x3dc738(_0x1c5634[_0xaf87('0x10')][_0xaf87('0x11')]);}logger['error'](_0xaf87('0xc'),_0x454ab6,_0x1c5634['error'][_0xaf87('0x11')]);return _0x444a17(_0x1c5634[_0xaf87('0x10')][_0xaf87('0x11')]);}else{logger['info'](_0xaf87('0xc'),_0x454ab6,_0xaf87('0xd'));_0x444a17(_0x1c5634[_0xaf87('0x12')]['message']);}})[_0xaf87('0x13')](function(_0x353420){logger[_0xaf87('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x454ab6,_0x353420);_0x3dc738(_0x353420);});});}exports[_0xaf87('0x14')]=function(_0x38ad28){var _0x584a1d=this;return new Promise(function(_0x2b283f,_0x5afd0b){return db[_0xaf87('0x15')][_0xaf87('0x16')]({'raw':_0x38ad28[_0xaf87('0x17')]?_0x38ad28[_0xaf87('0x17')][_0xaf87('0x18')]===undefined?!![]:![]:!![],'where':_0x38ad28[_0xaf87('0x17')]?_0x38ad28[_0xaf87('0x17')][_0xaf87('0x19')]||null:null,'attributes':_0x38ad28['options']?_0x38ad28[_0xaf87('0x17')]['attributes']||null:null,'limit':_0x38ad28[_0xaf87('0x17')]?_0x38ad28[_0xaf87('0x17')]['limit']||null:null,'include':_0x38ad28[_0xaf87('0x17')]?_0x38ad28['options'][_0xaf87('0x1a')]?_[_0xaf87('0x1b')](_0x38ad28[_0xaf87('0x17')][_0xaf87('0x1a')],function(_0x235401){return{'model':db[_0x235401[_0xaf87('0x1c')]],'as':_0x235401['as'],'attributes':_0x235401['attributes'],'include':_0x235401[_0xaf87('0x1a')]?_['map'](_0x235401[_0xaf87('0x1a')],function(_0x399995){return{'model':db[_0x399995[_0xaf87('0x1c')]],'as':_0x399995['as'],'attributes':_0x399995['attributes'],'include':_0x399995[_0xaf87('0x1a')]?_[_0xaf87('0x1b')](_0x399995[_0xaf87('0x1a')],function(_0x2900db){return{'model':db[_0x2900db['model']],'as':_0x2900db['as'],'attributes':_0x2900db[_0xaf87('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xaf87('0xb')](function(_0x599641){logger['info']('GetFreshdeskAccount',_0x38ad28);logger[_0xaf87('0xe')](_0xaf87('0x14'),_0x38ad28,JSON[_0xaf87('0x1e')](_0x599641));_0x2b283f(_0x599641);})['catch'](function(_0x2f8887){logger[_0xaf87('0x10')](_0xaf87('0x14'),_0x2f8887['message'],_0x38ad28);_0x5afd0b(_0x584a1d[_0xaf87('0x10')](0x1f4,_0x2f8887['message']));});});};exports['ShowFreshdeskAccount']=function(_0x3b2193){var _0x233e0b=this;return new Promise(function(_0x582496,_0x828fc6){return db[_0xaf87('0x15')]['find']({'raw':_0x3b2193[_0xaf87('0x17')]?_0x3b2193[_0xaf87('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3b2193[_0xaf87('0x17')]?_0x3b2193[_0xaf87('0x17')][_0xaf87('0x19')]||null:null,'attributes':_0x3b2193[_0xaf87('0x17')]?_0x3b2193[_0xaf87('0x17')][_0xaf87('0x1d')]||null:null,'include':_0x3b2193[_0xaf87('0x17')]?_0x3b2193['options'][_0xaf87('0x1a')]?_[_0xaf87('0x1b')](_0x3b2193['options'][_0xaf87('0x1a')],function(_0x10bd3c){return{'model':db[_0x10bd3c['model']],'as':_0x10bd3c['as'],'attributes':_0x10bd3c['attributes'],'include':_0x10bd3c[_0xaf87('0x1a')]?_[_0xaf87('0x1b')](_0x10bd3c[_0xaf87('0x1a')],function(_0x267c41){return{'model':db[_0x267c41[_0xaf87('0x1c')]],'as':_0x267c41['as'],'attributes':_0x267c41[_0xaf87('0x1d')],'include':_0x267c41[_0xaf87('0x1a')]?_['map'](_0x267c41[_0xaf87('0x1a')],function(_0x3f556a){return{'model':db[_0x3f556a[_0xaf87('0x1c')]],'as':_0x3f556a['as'],'attributes':_0x3f556a[_0xaf87('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xaf87('0xb')](function(_0x35b454){logger[_0xaf87('0x1f')](_0xaf87('0x20'),_0x3b2193);logger[_0xaf87('0xe')](_0xaf87('0x20'),_0x3b2193,JSON['stringify'](_0x35b454));_0x582496(_0x35b454);})[_0xaf87('0x13')](function(_0x6185ae){logger[_0xaf87('0x10')](_0xaf87('0x20'),_0x6185ae[_0xaf87('0x11')],_0x3b2193);_0x828fc6(_0x233e0b[_0xaf87('0x10')](0x1f4,_0x6185ae['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index c9ab246..b784edf 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 _0xac0f=['/:id','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','setTags','update','delete'];(function(_0x146261,_0x308383){var _0xe5fc79=function(_0x4ffd2b){while(--_0x4ffd2b){_0x146261['push'](_0x146261['shift']());}};_0xe5fc79(++_0x308383);}(_0xac0f,0xd9));var _0xfac0=function(_0x3a2dae,_0x4b06dc){_0x3a2dae=_0x3a2dae-0x0;var _0x2e626d=_0xac0f[_0x3a2dae];return _0x2e626d;};'use strict';var multer=require(_0xfac0('0x0'));var util=require(_0xfac0('0x1'));var path=require(_0xfac0('0x2'));var timeout=require('connect-timeout');var express=require(_0xfac0('0x3'));var router=express[_0xfac0('0x4')]();var fs_extra=require(_0xfac0('0x5'));var auth=require(_0xfac0('0x6'));var interaction=require(_0xfac0('0x7'));var config=require(_0xfac0('0x8'));var controller=require('./intFreshdeskConfiguration.controller');router[_0xfac0('0x9')]('/',auth[_0xfac0('0xa')](),controller['index']);router[_0xfac0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xfac0('0xb')]);router[_0xfac0('0x9')](_0xfac0('0xc'),auth['isAuthenticated'](),controller[_0xfac0('0xd')]);router[_0xfac0('0x9')](_0xfac0('0xe'),auth[_0xfac0('0xa')](),controller[_0xfac0('0xf')]);router['get']('/:id/descriptions',auth[_0xfac0('0xa')](),controller['getDescriptions']);router[_0xfac0('0x9')](_0xfac0('0x10'),auth['isAuthenticated'](),controller[_0xfac0('0x11')]);router[_0xfac0('0x12')]('/',auth[_0xfac0('0xa')](),controller[_0xfac0('0x13')]);router['post']('/:id/tags',auth[_0xfac0('0xa')](),controller[_0xfac0('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xfac0('0x15')]);router[_0xfac0('0x16')](_0xfac0('0x17'),auth[_0xfac0('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6994=['destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','/:id/tags','getTags','post','setTags','put','delete'];(function(_0x1eabe2,_0x24666c){var _0x39adc0=function(_0x3149e4){while(--_0x3149e4){_0x1eabe2['push'](_0x1eabe2['shift']());}};_0x39adc0(++_0x24666c);}(_0x6994,0x1a3));var _0x4699=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x6994[_0x35da42];return _0x370035;};'use strict';var multer=require(_0x4699('0x0'));var util=require(_0x4699('0x1'));var path=require(_0x4699('0x2'));var timeout=require(_0x4699('0x3'));var express=require(_0x4699('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4699('0x5'));var interaction=require(_0x4699('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0x4699('0x7')]('/',auth[_0x4699('0x8')](),controller['index']);router[_0x4699('0x7')](_0x4699('0x9'),auth[_0x4699('0x8')](),controller[_0x4699('0xa')]);router[_0x4699('0x7')](_0x4699('0xb'),auth[_0x4699('0x8')](),controller[_0x4699('0xc')]);router[_0x4699('0x7')]('/:id/subjects',auth[_0x4699('0x8')](),controller[_0x4699('0xd')]);router[_0x4699('0x7')]('/:id/descriptions',auth[_0x4699('0x8')](),controller[_0x4699('0xe')]);router[_0x4699('0x7')](_0x4699('0xf'),auth[_0x4699('0x8')](),controller[_0x4699('0x10')]);router[_0x4699('0x11')]('/',auth[_0x4699('0x8')](),controller['create']);router[_0x4699('0x11')](_0x4699('0xf'),auth[_0x4699('0x8')](),controller[_0x4699('0x12')]);router[_0x4699('0x13')]('/:id',auth[_0x4699('0x8')](),controller['update']);router[_0x4699('0x14')](_0x4699('0x9'),auth[_0x4699('0x8')](),controller[_0x4699('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 33f2c49..39b8810 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 _0xe02b=['STRING','sequelize'];(function(_0xf3d3d,_0x18c710){var _0x1e5511=function(_0x2b25e9){while(--_0x2b25e9){_0xf3d3d['push'](_0xf3d3d['shift']());}};_0x1e5511(++_0x18c710);}(_0xe02b,0x1e1));var _0xbe02=function(_0xe46818,_0x5125b5){_0xe46818=_0xe46818-0x0;var _0xd2fb1e=_0xe02b[_0xe46818];return _0xd2fb1e;};'use strict';var Sequelize=require(_0xbe02('0x0'));module['exports']={'name':{'type':Sequelize[_0xbe02('0x1')]},'description':{'type':Sequelize[_0xbe02('0x1')]}}; \ No newline at end of file +var _0x4893=['sequelize','exports','STRING'];(function(_0x31abb0,_0x178870){var _0x1b2268=function(_0x271088){while(--_0x271088){_0x31abb0['push'](_0x31abb0['shift']());}};_0x1b2268(++_0x178870);}(_0x4893,0x1bf));var _0x3489=function(_0x5311a1,_0x304912){_0x5311a1=_0x5311a1-0x0;var _0x2acb9f=_0x4893[_0x5311a1];return _0x2acb9f;};'use strict';var Sequelize=require(_0x3489('0x0'));module[_0x3489('0x1')]={'name':{'type':Sequelize[_0x3489('0x2')]},'description':{'type':Sequelize[_0x3489('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index d05de8e..251d09f 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 _0x6b3b=['VIRTUAL','options','includeAll','rows','catch','params','keys','length','include','find','create','body','getFields','findOne','FreshdeskField','nolimit','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','FreshdeskConfiguration','rawAttributes','type','key','filters','model','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x58f29c,_0x551df2){var _0x5266ed=function(_0x421cbc){while(--_0x421cbc){_0x58f29c['push'](_0x58f29c['shift']());}};_0x5266ed(++_0x551df2);}(_0x6b3b,0x107));var _0xb6b3=function(_0x388fac,_0x51346c){_0x388fac=_0x388fac-0x0;var _0x330c29=_0x6b3b[_0x388fac];return _0x330c29;};'use strict';var emlformat=require(_0xb6b3('0x0'));var rimraf=require(_0xb6b3('0x1'));var zipdir=require(_0xb6b3('0x2'));var jsonpatch=require(_0xb6b3('0x3'));var rp=require(_0xb6b3('0x4'));var moment=require(_0xb6b3('0x5'));var BPromise=require(_0xb6b3('0x6'));var Mustache=require(_0xb6b3('0x7'));var util=require('util');var path=require(_0xb6b3('0x8'));var sox=require(_0xb6b3('0x9'));var csv=require(_0xb6b3('0xa'));var ejs=require(_0xb6b3('0xb'));var fs=require('fs');var fs_extra=require(_0xb6b3('0xc'));var _=require(_0xb6b3('0xd'));var squel=require('squel');var crypto=require(_0xb6b3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb6b3('0xf'));var toCsv=require(_0xb6b3('0xa'));var querystring=require(_0xb6b3('0x10'));var Papa=require(_0xb6b3('0x11'));var Redis=require('ioredis');var authService=require(_0xb6b3('0x12'));var qs=require(_0xb6b3('0x13'));var as=require(_0xb6b3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb6b3('0x15'));var utils=require(_0xb6b3('0x16'));var config=require(_0xb6b3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb6b3('0x18'))['db'];function respondWithStatusCode(_0xd4f3b3,_0x5a6f8a){_0x5a6f8a=_0x5a6f8a||0xcc;return function(_0x232f52){if(_0x232f52){return _0xd4f3b3[_0xb6b3('0x19')](_0x5a6f8a);}return _0xd4f3b3[_0xb6b3('0x1a')](_0x5a6f8a)[_0xb6b3('0x1b')]();};}function respondWithResult(_0x227af5,_0xf329d5){_0xf329d5=_0xf329d5||0xc8;return function(_0x170780){if(_0x170780){return _0x227af5[_0xb6b3('0x1a')](_0xf329d5)[_0xb6b3('0x1c')](_0x170780);}};}function respondWithFilteredResult(_0x315cff,_0x4a138f){return function(_0x3c9b9d){if(_0x3c9b9d){var _0x1238c1=typeof _0x4a138f[_0xb6b3('0x1d')]===_0xb6b3('0x1e')&&typeof _0x4a138f[_0xb6b3('0x1f')]===_0xb6b3('0x1e');var _0x19323e=_0x3c9b9d[_0xb6b3('0x20')];var _0x5eab38=_0x1238c1?0x0:_0x4a138f[_0xb6b3('0x1d')];var _0x4eb19c=_0x1238c1?_0x3c9b9d['count']:_0x4a138f[_0xb6b3('0x1d')]+_0x4a138f[_0xb6b3('0x1f')];var _0x10f9e5;if(_0x4eb19c>=_0x19323e){_0x4eb19c=_0x19323e;_0x10f9e5=0xc8;}else{_0x10f9e5=0xce;}_0x315cff['status'](_0x10f9e5);return _0x315cff[_0xb6b3('0x21')](_0xb6b3('0x22'),_0x5eab38+'-'+_0x4eb19c+'/'+_0x19323e)[_0xb6b3('0x1c')](_0x3c9b9d);}return null;};}function patchUpdates(_0x51cd8a){return function(_0x4c2e92){try{jsonpatch[_0xb6b3('0x23')](_0x4c2e92,_0x51cd8a,!![]);}catch(_0x4d175e){return BPromise[_0xb6b3('0x24')](_0x4d175e);}return _0x4c2e92['save']();};}function saveUpdates(_0x59afae,_0x278e94){return function(_0x203239){if(_0x203239){return _0x203239[_0xb6b3('0x25')](_0x59afae)[_0xb6b3('0x26')](function(_0x3ded7a){return _0x3ded7a;});}return null;};}function removeEntity(_0xeaca40,_0x38e2b5){return function(_0x223a3b){if(_0x223a3b){return _0x223a3b[_0xb6b3('0x27')]()['then'](function(){_0xeaca40['status'](0xcc)[_0xb6b3('0x1b')]();});}};}function handleEntityNotFound(_0x3fec8c,_0x1a7204){return function(_0x41e5a3){if(!_0x41e5a3){_0x3fec8c['sendStatus'](0x194);}return _0x41e5a3;};}function handleError(_0x127f98,_0x1e08d2){_0x1e08d2=_0x1e08d2||0x1f4;return function(_0x5372e3){logger[_0xb6b3('0x28')](_0x5372e3[_0xb6b3('0x29')]);if(_0x5372e3[_0xb6b3('0x2a')]){delete _0x5372e3[_0xb6b3('0x2a')];}_0x127f98[_0xb6b3('0x1a')](_0x1e08d2)['send'](_0x5372e3);};}exports['index']=function(_0x334b90,_0x4ec23b){var _0x2ab55a={},_0x4c357f={},_0x13ffcc={'count':0x0,'rows':[]};var _0xf38a80=_[_0xb6b3('0x2b')](db[_0xb6b3('0x2c')][_0xb6b3('0x2d')],function(_0xa5560){return{'name':_0xa5560['fieldName'],'type':_0xa5560[_0xb6b3('0x2e')][_0xb6b3('0x2f')]};});_0x4c357f['model']=_[_0xb6b3('0x2b')](_0xf38a80,_0xb6b3('0x2a'));_0x4c357f['query']=_['keys'](_0x334b90['query']);_0x4c357f[_0xb6b3('0x30')]=_['intersection'](_0x4c357f[_0xb6b3('0x31')],_0x4c357f[_0xb6b3('0x32')]);_0x2ab55a['attributes']=_[_0xb6b3('0x33')](_0x4c357f[_0xb6b3('0x31')],qs[_0xb6b3('0x34')](_0x334b90['query']['fields']));_0x2ab55a[_0xb6b3('0x35')]=_0x2ab55a[_0xb6b3('0x35')]['length']?_0x2ab55a[_0xb6b3('0x35')]:_0x4c357f[_0xb6b3('0x31')];if(!_0x334b90[_0xb6b3('0x32')][_0xb6b3('0x36')]('nolimit')){_0x2ab55a[_0xb6b3('0x1f')]=qs['limit'](_0x334b90[_0xb6b3('0x32')][_0xb6b3('0x1f')]);_0x2ab55a[_0xb6b3('0x1d')]=qs[_0xb6b3('0x1d')](_0x334b90[_0xb6b3('0x32')][_0xb6b3('0x1d')]);}_0x2ab55a[_0xb6b3('0x37')]=qs[_0xb6b3('0x38')](_0x334b90[_0xb6b3('0x32')][_0xb6b3('0x38')]);_0x2ab55a[_0xb6b3('0x39')]=qs[_0xb6b3('0x30')](_[_0xb6b3('0x3a')](_0x334b90[_0xb6b3('0x32')],_0x4c357f[_0xb6b3('0x30')]),_0xf38a80);if(_0x334b90[_0xb6b3('0x32')][_0xb6b3('0x3b')]){_0x2ab55a['where']=_[_0xb6b3('0x3c')](_0x2ab55a[_0xb6b3('0x39')],{'$or':_[_0xb6b3('0x2b')](_0xf38a80,function(_0x24fc39){if(_0x24fc39['type']!==_0xb6b3('0x3d')){var _0x3523c4={};_0x3523c4[_0x24fc39[_0xb6b3('0x2a')]]={'$like':'%'+_0x334b90[_0xb6b3('0x32')][_0xb6b3('0x3b')]+'%'};return _0x3523c4;}})});}_0x2ab55a=_[_0xb6b3('0x3c')]({},_0x2ab55a,_0x334b90[_0xb6b3('0x3e')]);var _0x1b517e={'where':_0x2ab55a['where']};return db['FreshdeskConfiguration']['count'](_0x1b517e)[_0xb6b3('0x26')](function(_0x4de1dd){_0x13ffcc[_0xb6b3('0x20')]=_0x4de1dd;if(_0x334b90[_0xb6b3('0x32')][_0xb6b3('0x3f')]){_0x2ab55a['include']=[{'all':!![]}];}return db[_0xb6b3('0x2c')]['findAll'](_0x2ab55a);})['then'](function(_0x4e1c66){_0x13ffcc[_0xb6b3('0x40')]=_0x4e1c66;return _0x13ffcc;})['then'](respondWithFilteredResult(_0x4ec23b,_0x2ab55a))[_0xb6b3('0x41')](handleError(_0x4ec23b,null));};exports['show']=function(_0x5d0ecb,_0x502345){var _0x5b5800={'raw':![],'where':{'id':_0x5d0ecb[_0xb6b3('0x42')]['id']}},_0x4ddbd6={};_0x4ddbd6[_0xb6b3('0x31')]=_[_0xb6b3('0x43')](db[_0xb6b3('0x2c')][_0xb6b3('0x2d')]);_0x4ddbd6[_0xb6b3('0x32')]=_[_0xb6b3('0x43')](_0x5d0ecb[_0xb6b3('0x32')]);_0x4ddbd6[_0xb6b3('0x30')]=_[_0xb6b3('0x33')](_0x4ddbd6['model'],_0x4ddbd6[_0xb6b3('0x32')]);_0x5b5800[_0xb6b3('0x35')]=_[_0xb6b3('0x33')](_0x4ddbd6[_0xb6b3('0x31')],qs[_0xb6b3('0x34')](_0x5d0ecb[_0xb6b3('0x32')][_0xb6b3('0x34')]));_0x5b5800[_0xb6b3('0x35')]=_0x5b5800[_0xb6b3('0x35')][_0xb6b3('0x44')]?_0x5b5800['attributes']:_0x4ddbd6[_0xb6b3('0x31')];if(_0x5d0ecb[_0xb6b3('0x32')][_0xb6b3('0x3f')]){_0x5b5800[_0xb6b3('0x45')]=[{'all':!![]}];}_0x5b5800=_[_0xb6b3('0x3c')]({},_0x5b5800,_0x5d0ecb['options']);return db['FreshdeskConfiguration'][_0xb6b3('0x46')](_0x5b5800)['then'](handleEntityNotFound(_0x502345,null))[_0xb6b3('0x26')](respondWithResult(_0x502345,null))[_0xb6b3('0x41')](handleError(_0x502345,null));};exports['create']=function(_0x150bd5,_0x248693){return db[_0xb6b3('0x2c')][_0xb6b3('0x47')](_0x150bd5['body'],{})['then'](respondWithResult(_0x248693,0xc9))[_0xb6b3('0x41')](handleError(_0x248693,null));};exports[_0xb6b3('0x25')]=function(_0x50c34d,_0x4de0e6){if(_0x50c34d[_0xb6b3('0x48')]['id']){delete _0x50c34d[_0xb6b3('0x48')]['id'];}return db[_0xb6b3('0x2c')][_0xb6b3('0x46')]({'where':{'id':_0x50c34d[_0xb6b3('0x42')]['id']}})[_0xb6b3('0x26')](handleEntityNotFound(_0x4de0e6,null))['then'](saveUpdates(_0x50c34d[_0xb6b3('0x48')],null))['then'](respondWithResult(_0x4de0e6,null))['catch'](handleError(_0x4de0e6,null));};exports['destroy']=function(_0x35842c,_0x563826){return db[_0xb6b3('0x2c')][_0xb6b3('0x46')]({'where':{'id':_0x35842c[_0xb6b3('0x42')]['id']}})[_0xb6b3('0x26')](handleEntityNotFound(_0x563826,null))[_0xb6b3('0x26')](removeEntity(_0x563826,null))[_0xb6b3('0x41')](handleError(_0x563826,null));};exports[_0xb6b3('0x49')]=function(_0x17ed17,_0x42f2b1,_0x49d32d){var _0x593b5a={};var _0x3c8763={};var _0x1801e3;var _0x10c277;return db[_0xb6b3('0x2c')][_0xb6b3('0x4a')]({'where':{'id':_0x17ed17['params']['id']}})[_0xb6b3('0x26')](handleEntityNotFound(_0x42f2b1,null))['then'](function(_0x5d1b21){if(_0x5d1b21){_0x1801e3=_0x5d1b21;_0x3c8763[_0xb6b3('0x31')]=_[_0xb6b3('0x43')](db[_0xb6b3('0x4b')]['rawAttributes']);_0x3c8763['query']=_[_0xb6b3('0x43')](_0x17ed17[_0xb6b3('0x32')]);_0x3c8763['filters']=_['intersection'](_0x3c8763[_0xb6b3('0x31')],_0x3c8763[_0xb6b3('0x32')]);_0x593b5a[_0xb6b3('0x35')]=_['intersection'](_0x3c8763[_0xb6b3('0x31')],qs[_0xb6b3('0x34')](_0x17ed17[_0xb6b3('0x32')][_0xb6b3('0x34')]));_0x593b5a[_0xb6b3('0x35')]=_0x593b5a['attributes']['length']?_0x593b5a['attributes']:_0x3c8763['model'];_0x593b5a[_0xb6b3('0x37')]=qs[_0xb6b3('0x38')](_0x17ed17[_0xb6b3('0x32')][_0xb6b3('0x38')]);_0x593b5a[_0xb6b3('0x39')]=qs[_0xb6b3('0x30')](_[_0xb6b3('0x3a')](_0x17ed17[_0xb6b3('0x32')],_0x3c8763[_0xb6b3('0x30')]));if(_0x17ed17['query']['filter']){_0x593b5a[_0xb6b3('0x39')]=_['merge'](_0x593b5a[_0xb6b3('0x39')],{'$or':_[_0xb6b3('0x2b')](_0x593b5a[_0xb6b3('0x35')],function(_0xf0c221){var _0x58da3a={};_0x58da3a[_0xf0c221]={'$like':'%'+_0x17ed17['query'][_0xb6b3('0x3b')]+'%'};return _0x58da3a;})});}_0x593b5a=_[_0xb6b3('0x3c')]({},_0x593b5a,_0x17ed17['options']);return _0x1801e3[_0xb6b3('0x49')](_0x593b5a);}})[_0xb6b3('0x26')](function(_0x523abb){if(_0x523abb){_0x10c277=_0x523abb[_0xb6b3('0x44')];if(!_0x17ed17['query']['hasOwnProperty'](_0xb6b3('0x4c'))){_0x593b5a[_0xb6b3('0x1f')]=qs[_0xb6b3('0x1f')](_0x17ed17[_0xb6b3('0x32')][_0xb6b3('0x1f')]);_0x593b5a[_0xb6b3('0x1d')]=qs[_0xb6b3('0x1d')](_0x17ed17[_0xb6b3('0x32')][_0xb6b3('0x1d')]);}return _0x1801e3['getFields'](_0x593b5a);}})[_0xb6b3('0x26')](function(_0x5b8b81){if(_0x5b8b81){return _0x5b8b81?{'count':_0x10c277,'rows':_0x5b8b81}:null;}})['then'](respondWithResult(_0x42f2b1,null))[_0xb6b3('0x41')](handleError(_0x42f2b1,null));};exports['getSubjects']=function(_0x5d576f,_0x56c81a,_0xa1f553){var _0x5079bb={};var _0x2d714f={};var _0xdf2b71;var _0x454158;return db[_0xb6b3('0x2c')][_0xb6b3('0x4a')]({'where':{'id':_0x5d576f[_0xb6b3('0x42')]['id']}})[_0xb6b3('0x26')](handleEntityNotFound(_0x56c81a,null))[_0xb6b3('0x26')](function(_0x47abc4){if(_0x47abc4){_0xdf2b71=_0x47abc4;_0x2d714f[_0xb6b3('0x31')]=_[_0xb6b3('0x43')](db[_0xb6b3('0x4b')][_0xb6b3('0x2d')]);_0x2d714f[_0xb6b3('0x32')]=_[_0xb6b3('0x43')](_0x5d576f[_0xb6b3('0x32')]);_0x2d714f[_0xb6b3('0x30')]=_[_0xb6b3('0x33')](_0x2d714f[_0xb6b3('0x31')],_0x2d714f[_0xb6b3('0x32')]);_0x5079bb[_0xb6b3('0x35')]=_[_0xb6b3('0x33')](_0x2d714f['model'],qs[_0xb6b3('0x34')](_0x5d576f[_0xb6b3('0x32')]['fields']));_0x5079bb[_0xb6b3('0x35')]=_0x5079bb[_0xb6b3('0x35')][_0xb6b3('0x44')]?_0x5079bb[_0xb6b3('0x35')]:_0x2d714f[_0xb6b3('0x31')];_0x5079bb[_0xb6b3('0x37')]=qs[_0xb6b3('0x38')](_0x5d576f[_0xb6b3('0x32')]['sort']);_0x5079bb[_0xb6b3('0x39')]=qs[_0xb6b3('0x30')](_[_0xb6b3('0x3a')](_0x5d576f[_0xb6b3('0x32')],_0x2d714f[_0xb6b3('0x30')]));if(_0x5d576f[_0xb6b3('0x32')][_0xb6b3('0x3b')]){_0x5079bb['where']=_[_0xb6b3('0x3c')](_0x5079bb[_0xb6b3('0x39')],{'$or':_[_0xb6b3('0x2b')](_0x5079bb[_0xb6b3('0x35')],function(_0x73c6ef){var _0x4fe1bd={};_0x4fe1bd[_0x73c6ef]={'$like':'%'+_0x5d576f['query'][_0xb6b3('0x3b')]+'%'};return _0x4fe1bd;})});}_0x5079bb=_[_0xb6b3('0x3c')]({},_0x5079bb,_0x5d576f[_0xb6b3('0x3e')]);return _0xdf2b71[_0xb6b3('0x4d')](_0x5079bb);}})[_0xb6b3('0x26')](function(_0x34b979){if(_0x34b979){_0x454158=_0x34b979[_0xb6b3('0x44')];if(!_0x5d576f[_0xb6b3('0x32')][_0xb6b3('0x36')](_0xb6b3('0x4c'))){_0x5079bb[_0xb6b3('0x1f')]=qs['limit'](_0x5d576f[_0xb6b3('0x32')][_0xb6b3('0x1f')]);_0x5079bb[_0xb6b3('0x1d')]=qs['offset'](_0x5d576f['query']['offset']);}return _0xdf2b71['getSubjects'](_0x5079bb);}})[_0xb6b3('0x26')](function(_0x3228f8){if(_0x3228f8){return _0x3228f8?{'count':_0x454158,'rows':_0x3228f8}:null;}})['then'](respondWithResult(_0x56c81a,null))['catch'](handleError(_0x56c81a,null));};exports['getDescriptions']=function(_0x23972e,_0x547237,_0x147338){var _0x394bfc={};var _0x3e06dc={};var _0x3305bb;var _0x3a82d6;return db[_0xb6b3('0x2c')][_0xb6b3('0x4a')]({'where':{'id':_0x23972e['params']['id']}})[_0xb6b3('0x26')](handleEntityNotFound(_0x547237,null))[_0xb6b3('0x26')](function(_0x40e26b){if(_0x40e26b){_0x3305bb=_0x40e26b;_0x3e06dc[_0xb6b3('0x31')]=_['keys'](db[_0xb6b3('0x4b')]['rawAttributes']);_0x3e06dc['query']=_[_0xb6b3('0x43')](_0x23972e[_0xb6b3('0x32')]);_0x3e06dc['filters']=_[_0xb6b3('0x33')](_0x3e06dc[_0xb6b3('0x31')],_0x3e06dc[_0xb6b3('0x32')]);_0x394bfc['attributes']=_[_0xb6b3('0x33')](_0x3e06dc[_0xb6b3('0x31')],qs[_0xb6b3('0x34')](_0x23972e['query'][_0xb6b3('0x34')]));_0x394bfc[_0xb6b3('0x35')]=_0x394bfc[_0xb6b3('0x35')]['length']?_0x394bfc[_0xb6b3('0x35')]:_0x3e06dc[_0xb6b3('0x31')];_0x394bfc[_0xb6b3('0x37')]=qs[_0xb6b3('0x38')](_0x23972e[_0xb6b3('0x32')][_0xb6b3('0x38')]);_0x394bfc[_0xb6b3('0x39')]=qs['filters'](_[_0xb6b3('0x3a')](_0x23972e[_0xb6b3('0x32')],_0x3e06dc[_0xb6b3('0x30')]));if(_0x23972e['query']['filter']){_0x394bfc[_0xb6b3('0x39')]=_[_0xb6b3('0x3c')](_0x394bfc[_0xb6b3('0x39')],{'$or':_[_0xb6b3('0x2b')](_0x394bfc[_0xb6b3('0x35')],function(_0x4ce99d){var _0x19bd52={};_0x19bd52[_0x4ce99d]={'$like':'%'+_0x23972e[_0xb6b3('0x32')][_0xb6b3('0x3b')]+'%'};return _0x19bd52;})});}_0x394bfc=_['merge']({},_0x394bfc,_0x23972e['options']);return _0x3305bb[_0xb6b3('0x4e')](_0x394bfc);}})[_0xb6b3('0x26')](function(_0x4affaf){if(_0x4affaf){_0x3a82d6=_0x4affaf[_0xb6b3('0x44')];if(!_0x23972e['query'][_0xb6b3('0x36')](_0xb6b3('0x4c'))){_0x394bfc[_0xb6b3('0x1f')]=qs[_0xb6b3('0x1f')](_0x23972e[_0xb6b3('0x32')][_0xb6b3('0x1f')]);_0x394bfc[_0xb6b3('0x1d')]=qs[_0xb6b3('0x1d')](_0x23972e['query'][_0xb6b3('0x1d')]);}return _0x3305bb[_0xb6b3('0x4e')](_0x394bfc);}})[_0xb6b3('0x26')](function(_0x34ec1f){if(_0x34ec1f){return _0x34ec1f?{'count':_0x3a82d6,'rows':_0x34ec1f}:null;}})['then'](respondWithResult(_0x547237,null))['catch'](handleError(_0x547237,null));};exports[_0xb6b3('0x4f')]=function(_0xbb5d0b,_0x171943,_0x2afcf4){var _0x173a03={};var _0x329401={};var _0x15e2f8;var _0x88369f;return db[_0xb6b3('0x2c')][_0xb6b3('0x4a')]({'where':{'id':_0xbb5d0b[_0xb6b3('0x42')]['id']}})['then'](handleEntityNotFound(_0x171943,null))['then'](function(_0x4d3856){if(_0x4d3856){_0x15e2f8=_0x4d3856;_0x329401[_0xb6b3('0x31')]=_['keys'](db['Tag']['rawAttributes']);_0x329401[_0xb6b3('0x32')]=_[_0xb6b3('0x43')](_0xbb5d0b['query']);_0x329401[_0xb6b3('0x30')]=_['intersection'](_0x329401['model'],_0x329401[_0xb6b3('0x32')]);_0x173a03['attributes']=_[_0xb6b3('0x33')](_0x329401[_0xb6b3('0x31')],qs['fields'](_0xbb5d0b['query']['fields']));_0x173a03['attributes']=_0x173a03[_0xb6b3('0x35')][_0xb6b3('0x44')]?_0x173a03[_0xb6b3('0x35')]:_0x329401[_0xb6b3('0x31')];_0x173a03[_0xb6b3('0x37')]=qs['sort'](_0xbb5d0b[_0xb6b3('0x32')][_0xb6b3('0x38')]);_0x173a03[_0xb6b3('0x39')]=qs[_0xb6b3('0x30')](_['pick'](_0xbb5d0b[_0xb6b3('0x32')],_0x329401[_0xb6b3('0x30')]));if(_0xbb5d0b[_0xb6b3('0x32')][_0xb6b3('0x3b')]){_0x173a03[_0xb6b3('0x39')]=_[_0xb6b3('0x3c')](_0x173a03['where'],{'$or':_[_0xb6b3('0x2b')](_0x173a03['attributes'],function(_0x58ba8d){var _0x1d7931={};_0x1d7931[_0x58ba8d]={'$like':'%'+_0xbb5d0b[_0xb6b3('0x32')][_0xb6b3('0x3b')]+'%'};return _0x1d7931;})});}_0x173a03=_[_0xb6b3('0x3c')]({},_0x173a03,_0xbb5d0b['options']);return _0x15e2f8[_0xb6b3('0x4f')](_0x173a03);}})[_0xb6b3('0x26')](function(_0x437862){if(_0x437862){_0x88369f=_0x437862[_0xb6b3('0x44')];if(!_0xbb5d0b['query'][_0xb6b3('0x36')](_0xb6b3('0x4c'))){_0x173a03[_0xb6b3('0x1f')]=qs[_0xb6b3('0x1f')](_0xbb5d0b[_0xb6b3('0x32')]['limit']);_0x173a03['offset']=qs['offset'](_0xbb5d0b[_0xb6b3('0x32')]['offset']);}return _0x15e2f8[_0xb6b3('0x4f')](_0x173a03);}})[_0xb6b3('0x26')](function(_0x486e0b){if(_0x486e0b){return _0x486e0b?{'count':_0x88369f,'rows':_0x486e0b}:null;}})[_0xb6b3('0x26')](respondWithResult(_0x171943,null))[_0xb6b3('0x41')](handleError(_0x171943,null));};exports[_0xb6b3('0x50')]=function(_0x444143,_0x1731a7,_0x47d027){if(_0x444143['body']['id']){delete _0x444143[_0xb6b3('0x48')]['id'];}return db[_0xb6b3('0x2c')][_0xb6b3('0x4a')]({'where':{'id':_0x444143['params']['id']}})[_0xb6b3('0x26')](handleEntityNotFound(_0x1731a7,null))[_0xb6b3('0x26')](function(_0x1655cc){if(_0x1655cc){return _0x1655cc[_0xb6b3('0x50')](_0x444143['body']['ids']||[]);}return null;})[_0xb6b3('0x26')](respondWithResult(_0x1731a7,null))['catch'](handleError(_0x1731a7,null));}; \ No newline at end of file +var _0xf225=['../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','map','VIRTUAL','merge','options','count','findAll','rows','catch','show','params','includeAll','include','find','create','body','getFields','findOne','FreshdeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api'];(function(_0x312b02,_0x5a4c99){var _0x34a298=function(_0x992e5a){while(--_0x992e5a){_0x312b02['push'](_0x312b02['shift']());}};_0x34a298(++_0x5a4c99);}(_0xf225,0x94));var _0x5f22=function(_0x55516d,_0x9bfcc){_0x55516d=_0x55516d-0x0;var _0x358d17=_0xf225[_0x55516d];return _0x358d17;};'use strict';var emlformat=require(_0x5f22('0x0'));var rimraf=require(_0x5f22('0x1'));var zipdir=require(_0x5f22('0x2'));var jsonpatch=require(_0x5f22('0x3'));var rp=require(_0x5f22('0x4'));var moment=require(_0x5f22('0x5'));var BPromise=require(_0x5f22('0x6'));var Mustache=require(_0x5f22('0x7'));var util=require(_0x5f22('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x5f22('0x9'));var ejs=require(_0x5f22('0xa'));var fs=require('fs');var fs_extra=require(_0x5f22('0xb'));var _=require('lodash');var squel=require(_0x5f22('0xc'));var crypto=require(_0x5f22('0xd'));var jsforce=require(_0x5f22('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5f22('0x9'));var querystring=require(_0x5f22('0xf'));var Papa=require(_0x5f22('0x10'));var Redis=require(_0x5f22('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5f22('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f22('0x13'));var utils=require(_0x5f22('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5f22('0x15'));var db=require(_0x5f22('0x16'))['db'];function respondWithStatusCode(_0x3335d1,_0x167dfc){_0x167dfc=_0x167dfc||0xcc;return function(_0x5463b5){if(_0x5463b5){return _0x3335d1['sendStatus'](_0x167dfc);}return _0x3335d1[_0x5f22('0x17')](_0x167dfc)[_0x5f22('0x18')]();};}function respondWithResult(_0x2331ed,_0x36e167){_0x36e167=_0x36e167||0xc8;return function(_0x5272fb){if(_0x5272fb){return _0x2331ed[_0x5f22('0x17')](_0x36e167)[_0x5f22('0x19')](_0x5272fb);}};}function respondWithFilteredResult(_0x1afd2f,_0x46df86){return function(_0x9163bc){if(_0x9163bc){var _0x3133ab=typeof _0x46df86[_0x5f22('0x1a')]===_0x5f22('0x1b')&&typeof _0x46df86['limit']===_0x5f22('0x1b');var _0xecd9b5=_0x9163bc['count'];var _0x1b3a27=_0x3133ab?0x0:_0x46df86['offset'];var _0x31b0ee=_0x3133ab?_0x9163bc['count']:_0x46df86[_0x5f22('0x1a')]+_0x46df86[_0x5f22('0x1c')];var _0x176f03;if(_0x31b0ee>=_0xecd9b5){_0x31b0ee=_0xecd9b5;_0x176f03=0xc8;}else{_0x176f03=0xce;}_0x1afd2f[_0x5f22('0x17')](_0x176f03);return _0x1afd2f['set'](_0x5f22('0x1d'),_0x1b3a27+'-'+_0x31b0ee+'/'+_0xecd9b5)[_0x5f22('0x19')](_0x9163bc);}return null;};}function patchUpdates(_0x4ffd59){return function(_0x7f822d){try{jsonpatch[_0x5f22('0x1e')](_0x7f822d,_0x4ffd59,!![]);}catch(_0xfc78f7){return BPromise[_0x5f22('0x1f')](_0xfc78f7);}return _0x7f822d[_0x5f22('0x20')]();};}function saveUpdates(_0x4e6f,_0x18159f){return function(_0x2ca4bf){if(_0x2ca4bf){return _0x2ca4bf[_0x5f22('0x21')](_0x4e6f)[_0x5f22('0x22')](function(_0x480bef){return _0x480bef;});}return null;};}function removeEntity(_0x192a6c,_0x5071fb){return function(_0x5431a9){if(_0x5431a9){return _0x5431a9[_0x5f22('0x23')]()[_0x5f22('0x22')](function(){_0x192a6c[_0x5f22('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x422049,_0x5581c7){return function(_0x6f07b7){if(!_0x6f07b7){_0x422049[_0x5f22('0x24')](0x194);}return _0x6f07b7;};}function handleError(_0x4f3094,_0x1c1127){_0x1c1127=_0x1c1127||0x1f4;return function(_0x19032c){logger['error'](_0x19032c['stack']);if(_0x19032c[_0x5f22('0x25')]){delete _0x19032c[_0x5f22('0x25')];}_0x4f3094[_0x5f22('0x17')](_0x1c1127)[_0x5f22('0x26')](_0x19032c);};}exports[_0x5f22('0x27')]=function(_0x37d9ec,_0x4cf583){var _0x1e0be3={},_0x1d12ca={},_0x3e6602={'count':0x0,'rows':[]};var _0xc79912=_['map'](db[_0x5f22('0x28')][_0x5f22('0x29')],function(_0x27b4c1){return{'name':_0x27b4c1[_0x5f22('0x2a')],'type':_0x27b4c1[_0x5f22('0x2b')][_0x5f22('0x2c')]};});_0x1d12ca['model']=_['map'](_0xc79912,_0x5f22('0x25'));_0x1d12ca['query']=_[_0x5f22('0x2d')](_0x37d9ec[_0x5f22('0x2e')]);_0x1d12ca[_0x5f22('0x2f')]=_[_0x5f22('0x30')](_0x1d12ca[_0x5f22('0x31')],_0x1d12ca[_0x5f22('0x2e')]);_0x1e0be3['attributes']=_[_0x5f22('0x30')](_0x1d12ca[_0x5f22('0x31')],qs[_0x5f22('0x32')](_0x37d9ec['query'][_0x5f22('0x32')]));_0x1e0be3['attributes']=_0x1e0be3['attributes'][_0x5f22('0x33')]?_0x1e0be3[_0x5f22('0x34')]:_0x1d12ca[_0x5f22('0x31')];if(!_0x37d9ec[_0x5f22('0x2e')][_0x5f22('0x35')](_0x5f22('0x36'))){_0x1e0be3['limit']=qs[_0x5f22('0x1c')](_0x37d9ec[_0x5f22('0x2e')]['limit']);_0x1e0be3[_0x5f22('0x1a')]=qs[_0x5f22('0x1a')](_0x37d9ec[_0x5f22('0x2e')][_0x5f22('0x1a')]);}_0x1e0be3['order']=qs[_0x5f22('0x37')](_0x37d9ec[_0x5f22('0x2e')][_0x5f22('0x37')]);_0x1e0be3[_0x5f22('0x38')]=qs[_0x5f22('0x2f')](_[_0x5f22('0x39')](_0x37d9ec['query'],_0x1d12ca[_0x5f22('0x2f')]),_0xc79912);if(_0x37d9ec[_0x5f22('0x2e')][_0x5f22('0x3a')]){_0x1e0be3[_0x5f22('0x38')]=_['merge'](_0x1e0be3[_0x5f22('0x38')],{'$or':_[_0x5f22('0x3b')](_0xc79912,function(_0x3797cf){if(_0x3797cf['type']!==_0x5f22('0x3c')){var _0x4740c2={};_0x4740c2[_0x3797cf[_0x5f22('0x25')]]={'$like':'%'+_0x37d9ec[_0x5f22('0x2e')][_0x5f22('0x3a')]+'%'};return _0x4740c2;}})});}_0x1e0be3=_[_0x5f22('0x3d')]({},_0x1e0be3,_0x37d9ec[_0x5f22('0x3e')]);var _0x4b8b68={'where':_0x1e0be3[_0x5f22('0x38')]};return db[_0x5f22('0x28')][_0x5f22('0x3f')](_0x4b8b68)[_0x5f22('0x22')](function(_0x341c58){_0x3e6602[_0x5f22('0x3f')]=_0x341c58;if(_0x37d9ec[_0x5f22('0x2e')]['includeAll']){_0x1e0be3['include']=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x5f22('0x40')](_0x1e0be3);})['then'](function(_0x5dfda1){_0x3e6602[_0x5f22('0x41')]=_0x5dfda1;return _0x3e6602;})['then'](respondWithFilteredResult(_0x4cf583,_0x1e0be3))[_0x5f22('0x42')](handleError(_0x4cf583,null));};exports[_0x5f22('0x43')]=function(_0x45d60c,_0x53f053){var _0x59334c={'raw':![],'where':{'id':_0x45d60c[_0x5f22('0x44')]['id']}},_0x274404={};_0x274404[_0x5f22('0x31')]=_['keys'](db['FreshdeskConfiguration'][_0x5f22('0x29')]);_0x274404[_0x5f22('0x2e')]=_[_0x5f22('0x2d')](_0x45d60c[_0x5f22('0x2e')]);_0x274404['filters']=_[_0x5f22('0x30')](_0x274404['model'],_0x274404[_0x5f22('0x2e')]);_0x59334c[_0x5f22('0x34')]=_[_0x5f22('0x30')](_0x274404[_0x5f22('0x31')],qs['fields'](_0x45d60c[_0x5f22('0x2e')][_0x5f22('0x32')]));_0x59334c['attributes']=_0x59334c['attributes']['length']?_0x59334c['attributes']:_0x274404[_0x5f22('0x31')];if(_0x45d60c[_0x5f22('0x2e')][_0x5f22('0x45')]){_0x59334c[_0x5f22('0x46')]=[{'all':!![]}];}_0x59334c=_[_0x5f22('0x3d')]({},_0x59334c,_0x45d60c['options']);return db[_0x5f22('0x28')][_0x5f22('0x47')](_0x59334c)[_0x5f22('0x22')](handleEntityNotFound(_0x53f053,null))[_0x5f22('0x22')](respondWithResult(_0x53f053,null))[_0x5f22('0x42')](handleError(_0x53f053,null));};exports[_0x5f22('0x48')]=function(_0x3e71d0,_0x1a8b29){return db[_0x5f22('0x28')][_0x5f22('0x48')](_0x3e71d0[_0x5f22('0x49')],{})[_0x5f22('0x22')](respondWithResult(_0x1a8b29,0xc9))['catch'](handleError(_0x1a8b29,null));};exports[_0x5f22('0x21')]=function(_0x220f47,_0x43a855){if(_0x220f47[_0x5f22('0x49')]['id']){delete _0x220f47['body']['id'];}return db[_0x5f22('0x28')][_0x5f22('0x47')]({'where':{'id':_0x220f47[_0x5f22('0x44')]['id']}})[_0x5f22('0x22')](handleEntityNotFound(_0x43a855,null))[_0x5f22('0x22')](saveUpdates(_0x220f47['body'],null))[_0x5f22('0x22')](respondWithResult(_0x43a855,null))['catch'](handleError(_0x43a855,null));};exports['destroy']=function(_0x5ac308,_0x514dd2){return db[_0x5f22('0x28')][_0x5f22('0x47')]({'where':{'id':_0x5ac308[_0x5f22('0x44')]['id']}})[_0x5f22('0x22')](handleEntityNotFound(_0x514dd2,null))['then'](removeEntity(_0x514dd2,null))[_0x5f22('0x42')](handleError(_0x514dd2,null));};exports[_0x5f22('0x4a')]=function(_0x144d45,_0x3fe191,_0x140b53){var _0x516234={};var _0x3dafb8={};var _0x2039c9;var _0x268cf2;return db[_0x5f22('0x28')][_0x5f22('0x4b')]({'where':{'id':_0x144d45[_0x5f22('0x44')]['id']}})[_0x5f22('0x22')](handleEntityNotFound(_0x3fe191,null))[_0x5f22('0x22')](function(_0x3c1f0a){if(_0x3c1f0a){_0x2039c9=_0x3c1f0a;_0x3dafb8[_0x5f22('0x31')]=_[_0x5f22('0x2d')](db[_0x5f22('0x4c')][_0x5f22('0x29')]);_0x3dafb8[_0x5f22('0x2e')]=_[_0x5f22('0x2d')](_0x144d45[_0x5f22('0x2e')]);_0x3dafb8[_0x5f22('0x2f')]=_[_0x5f22('0x30')](_0x3dafb8['model'],_0x3dafb8[_0x5f22('0x2e')]);_0x516234['attributes']=_[_0x5f22('0x30')](_0x3dafb8[_0x5f22('0x31')],qs['fields'](_0x144d45[_0x5f22('0x2e')][_0x5f22('0x32')]));_0x516234[_0x5f22('0x34')]=_0x516234[_0x5f22('0x34')][_0x5f22('0x33')]?_0x516234[_0x5f22('0x34')]:_0x3dafb8[_0x5f22('0x31')];_0x516234[_0x5f22('0x4d')]=qs[_0x5f22('0x37')](_0x144d45['query'][_0x5f22('0x37')]);_0x516234[_0x5f22('0x38')]=qs[_0x5f22('0x2f')](_['pick'](_0x144d45[_0x5f22('0x2e')],_0x3dafb8[_0x5f22('0x2f')]));if(_0x144d45[_0x5f22('0x2e')][_0x5f22('0x3a')]){_0x516234[_0x5f22('0x38')]=_[_0x5f22('0x3d')](_0x516234[_0x5f22('0x38')],{'$or':_['map'](_0x516234[_0x5f22('0x34')],function(_0x214633){var _0xde0406={};_0xde0406[_0x214633]={'$like':'%'+_0x144d45[_0x5f22('0x2e')][_0x5f22('0x3a')]+'%'};return _0xde0406;})});}_0x516234=_['merge']({},_0x516234,_0x144d45[_0x5f22('0x3e')]);return _0x2039c9[_0x5f22('0x4a')](_0x516234);}})[_0x5f22('0x22')](function(_0x4e7742){if(_0x4e7742){_0x268cf2=_0x4e7742[_0x5f22('0x33')];if(!_0x144d45[_0x5f22('0x2e')]['hasOwnProperty']('nolimit')){_0x516234['limit']=qs[_0x5f22('0x1c')](_0x144d45[_0x5f22('0x2e')]['limit']);_0x516234[_0x5f22('0x1a')]=qs['offset'](_0x144d45[_0x5f22('0x2e')]['offset']);}return _0x2039c9[_0x5f22('0x4a')](_0x516234);}})[_0x5f22('0x22')](function(_0x59d4d4){if(_0x59d4d4){return _0x59d4d4?{'count':_0x268cf2,'rows':_0x59d4d4}:null;}})[_0x5f22('0x22')](respondWithResult(_0x3fe191,null))[_0x5f22('0x42')](handleError(_0x3fe191,null));};exports['getSubjects']=function(_0x42efa4,_0x3b58e6,_0x4511e8){var _0x122273={};var _0x566282={};var _0x545492;var _0x2f64e8;return db['FreshdeskConfiguration'][_0x5f22('0x4b')]({'where':{'id':_0x42efa4[_0x5f22('0x44')]['id']}})[_0x5f22('0x22')](handleEntityNotFound(_0x3b58e6,null))[_0x5f22('0x22')](function(_0x40a1e1){if(_0x40a1e1){_0x545492=_0x40a1e1;_0x566282['model']=_['keys'](db[_0x5f22('0x4c')][_0x5f22('0x29')]);_0x566282[_0x5f22('0x2e')]=_[_0x5f22('0x2d')](_0x42efa4[_0x5f22('0x2e')]);_0x566282['filters']=_['intersection'](_0x566282['model'],_0x566282[_0x5f22('0x2e')]);_0x122273[_0x5f22('0x34')]=_['intersection'](_0x566282[_0x5f22('0x31')],qs[_0x5f22('0x32')](_0x42efa4[_0x5f22('0x2e')][_0x5f22('0x32')]));_0x122273[_0x5f22('0x34')]=_0x122273[_0x5f22('0x34')][_0x5f22('0x33')]?_0x122273['attributes']:_0x566282[_0x5f22('0x31')];_0x122273[_0x5f22('0x4d')]=qs[_0x5f22('0x37')](_0x42efa4[_0x5f22('0x2e')]['sort']);_0x122273[_0x5f22('0x38')]=qs[_0x5f22('0x2f')](_[_0x5f22('0x39')](_0x42efa4[_0x5f22('0x2e')],_0x566282['filters']));if(_0x42efa4[_0x5f22('0x2e')][_0x5f22('0x3a')]){_0x122273['where']=_[_0x5f22('0x3d')](_0x122273['where'],{'$or':_[_0x5f22('0x3b')](_0x122273[_0x5f22('0x34')],function(_0x2ace7f){var _0x90e6d9={};_0x90e6d9[_0x2ace7f]={'$like':'%'+_0x42efa4[_0x5f22('0x2e')][_0x5f22('0x3a')]+'%'};return _0x90e6d9;})});}_0x122273=_[_0x5f22('0x3d')]({},_0x122273,_0x42efa4[_0x5f22('0x3e')]);return _0x545492[_0x5f22('0x4e')](_0x122273);}})[_0x5f22('0x22')](function(_0x4d97ab){if(_0x4d97ab){_0x2f64e8=_0x4d97ab['length'];if(!_0x42efa4[_0x5f22('0x2e')][_0x5f22('0x35')](_0x5f22('0x36'))){_0x122273[_0x5f22('0x1c')]=qs[_0x5f22('0x1c')](_0x42efa4[_0x5f22('0x2e')][_0x5f22('0x1c')]);_0x122273['offset']=qs[_0x5f22('0x1a')](_0x42efa4['query']['offset']);}return _0x545492[_0x5f22('0x4e')](_0x122273);}})['then'](function(_0x1572ce){if(_0x1572ce){return _0x1572ce?{'count':_0x2f64e8,'rows':_0x1572ce}:null;}})[_0x5f22('0x22')](respondWithResult(_0x3b58e6,null))['catch'](handleError(_0x3b58e6,null));};exports[_0x5f22('0x4f')]=function(_0x4024eb,_0xb73b53,_0x5d1451){var _0x16a8b9={};var _0x2a3c40={};var _0x1df0f9;var _0x2473e2;return db[_0x5f22('0x28')][_0x5f22('0x4b')]({'where':{'id':_0x4024eb[_0x5f22('0x44')]['id']}})[_0x5f22('0x22')](handleEntityNotFound(_0xb73b53,null))['then'](function(_0x1f048b){if(_0x1f048b){_0x1df0f9=_0x1f048b;_0x2a3c40[_0x5f22('0x31')]=_[_0x5f22('0x2d')](db[_0x5f22('0x4c')][_0x5f22('0x29')]);_0x2a3c40[_0x5f22('0x2e')]=_[_0x5f22('0x2d')](_0x4024eb[_0x5f22('0x2e')]);_0x2a3c40[_0x5f22('0x2f')]=_[_0x5f22('0x30')](_0x2a3c40[_0x5f22('0x31')],_0x2a3c40['query']);_0x16a8b9[_0x5f22('0x34')]=_[_0x5f22('0x30')](_0x2a3c40[_0x5f22('0x31')],qs[_0x5f22('0x32')](_0x4024eb[_0x5f22('0x2e')][_0x5f22('0x32')]));_0x16a8b9['attributes']=_0x16a8b9[_0x5f22('0x34')][_0x5f22('0x33')]?_0x16a8b9[_0x5f22('0x34')]:_0x2a3c40[_0x5f22('0x31')];_0x16a8b9[_0x5f22('0x4d')]=qs['sort'](_0x4024eb[_0x5f22('0x2e')][_0x5f22('0x37')]);_0x16a8b9[_0x5f22('0x38')]=qs[_0x5f22('0x2f')](_[_0x5f22('0x39')](_0x4024eb[_0x5f22('0x2e')],_0x2a3c40[_0x5f22('0x2f')]));if(_0x4024eb[_0x5f22('0x2e')][_0x5f22('0x3a')]){_0x16a8b9['where']=_[_0x5f22('0x3d')](_0x16a8b9[_0x5f22('0x38')],{'$or':_[_0x5f22('0x3b')](_0x16a8b9[_0x5f22('0x34')],function(_0x167c8f){var _0x2d63b1={};_0x2d63b1[_0x167c8f]={'$like':'%'+_0x4024eb['query']['filter']+'%'};return _0x2d63b1;})});}_0x16a8b9=_[_0x5f22('0x3d')]({},_0x16a8b9,_0x4024eb[_0x5f22('0x3e')]);return _0x1df0f9['getDescriptions'](_0x16a8b9);}})[_0x5f22('0x22')](function(_0x2f9113){if(_0x2f9113){_0x2473e2=_0x2f9113[_0x5f22('0x33')];if(!_0x4024eb['query'][_0x5f22('0x35')](_0x5f22('0x36'))){_0x16a8b9[_0x5f22('0x1c')]=qs[_0x5f22('0x1c')](_0x4024eb[_0x5f22('0x2e')][_0x5f22('0x1c')]);_0x16a8b9['offset']=qs[_0x5f22('0x1a')](_0x4024eb[_0x5f22('0x2e')][_0x5f22('0x1a')]);}return _0x1df0f9[_0x5f22('0x4f')](_0x16a8b9);}})[_0x5f22('0x22')](function(_0x28ffc6){if(_0x28ffc6){return _0x28ffc6?{'count':_0x2473e2,'rows':_0x28ffc6}:null;}})[_0x5f22('0x22')](respondWithResult(_0xb73b53,null))[_0x5f22('0x42')](handleError(_0xb73b53,null));};exports[_0x5f22('0x50')]=function(_0x2dd7a8,_0x2f47b0,_0x51575a){var _0x506ed3={};var _0x105495={};var _0xf7359a;var _0x23bc08;return db[_0x5f22('0x28')][_0x5f22('0x4b')]({'where':{'id':_0x2dd7a8[_0x5f22('0x44')]['id']}})[_0x5f22('0x22')](handleEntityNotFound(_0x2f47b0,null))[_0x5f22('0x22')](function(_0x3283be){if(_0x3283be){_0xf7359a=_0x3283be;_0x105495[_0x5f22('0x31')]=_[_0x5f22('0x2d')](db[_0x5f22('0x51')][_0x5f22('0x29')]);_0x105495['query']=_[_0x5f22('0x2d')](_0x2dd7a8['query']);_0x105495[_0x5f22('0x2f')]=_[_0x5f22('0x30')](_0x105495[_0x5f22('0x31')],_0x105495['query']);_0x506ed3[_0x5f22('0x34')]=_[_0x5f22('0x30')](_0x105495[_0x5f22('0x31')],qs[_0x5f22('0x32')](_0x2dd7a8['query']['fields']));_0x506ed3[_0x5f22('0x34')]=_0x506ed3['attributes'][_0x5f22('0x33')]?_0x506ed3[_0x5f22('0x34')]:_0x105495['model'];_0x506ed3[_0x5f22('0x4d')]=qs[_0x5f22('0x37')](_0x2dd7a8['query'][_0x5f22('0x37')]);_0x506ed3['where']=qs[_0x5f22('0x2f')](_[_0x5f22('0x39')](_0x2dd7a8[_0x5f22('0x2e')],_0x105495['filters']));if(_0x2dd7a8['query']['filter']){_0x506ed3[_0x5f22('0x38')]=_[_0x5f22('0x3d')](_0x506ed3['where'],{'$or':_[_0x5f22('0x3b')](_0x506ed3['attributes'],function(_0x3e644b){var _0x304796={};_0x304796[_0x3e644b]={'$like':'%'+_0x2dd7a8[_0x5f22('0x2e')][_0x5f22('0x3a')]+'%'};return _0x304796;})});}_0x506ed3=_['merge']({},_0x506ed3,_0x2dd7a8[_0x5f22('0x3e')]);return _0xf7359a['getTags'](_0x506ed3);}})['then'](function(_0x56ec25){if(_0x56ec25){_0x23bc08=_0x56ec25[_0x5f22('0x33')];if(!_0x2dd7a8[_0x5f22('0x2e')][_0x5f22('0x35')]('nolimit')){_0x506ed3['limit']=qs[_0x5f22('0x1c')](_0x2dd7a8[_0x5f22('0x2e')][_0x5f22('0x1c')]);_0x506ed3[_0x5f22('0x1a')]=qs[_0x5f22('0x1a')](_0x2dd7a8[_0x5f22('0x2e')][_0x5f22('0x1a')]);}return _0xf7359a[_0x5f22('0x50')](_0x506ed3);}})[_0x5f22('0x22')](function(_0x4b8874){if(_0x4b8874){return _0x4b8874?{'count':_0x23bc08,'rows':_0x4b8874}:null;}})[_0x5f22('0x22')](respondWithResult(_0x2f47b0,null))[_0x5f22('0x42')](handleError(_0x2f47b0,null));};exports[_0x5f22('0x52')]=function(_0x5d1bb1,_0x3574a2,_0x19e207){if(_0x5d1bb1[_0x5f22('0x49')]['id']){delete _0x5d1bb1[_0x5f22('0x49')]['id'];}return db[_0x5f22('0x28')][_0x5f22('0x4b')]({'where':{'id':_0x5d1bb1[_0x5f22('0x44')]['id']}})[_0x5f22('0x22')](handleEntityNotFound(_0x3574a2,null))['then'](function(_0x1f86ab){if(_0x1f86ab){return _0x1f86ab[_0x5f22('0x52')](_0x5d1bb1[_0x5f22('0x49')][_0x5f22('0x53')]||[]);}return null;})[_0x5f22('0x22')](respondWithResult(_0x3574a2,null))[_0x5f22('0x42')](handleError(_0x3574a2,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index fa8bad7..07139b9 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 _0x8d27=['int_freshdesk_configurations','lodash','util','api','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration'];(function(_0x9f2448,_0x7fe3a6){var _0xa100d=function(_0x1eb978){while(--_0x1eb978){_0x9f2448['push'](_0x9f2448['shift']());}};_0xa100d(++_0x7fe3a6);}(_0x8d27,0x14b));var _0x78d2=function(_0x565323,_0x4ae4c0){_0x565323=_0x565323-0x0;var _0x47a601=_0x8d27[_0x565323];return _0x47a601;};'use strict';var _=require(_0x78d2('0x0'));var util=require(_0x78d2('0x1'));var logger=require('../../config/logger')(_0x78d2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x78d2('0x3'));var rimraf=require(_0x78d2('0x4'));var config=require(_0x78d2('0x5'));var attributes=require(_0x78d2('0x6'));module['exports']=function(_0x312518,_0xcd565d){return _0x312518[_0x78d2('0x7')](_0x78d2('0x8'),attributes,{'tableName':_0x78d2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81cd=['define','FreshdeskConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x81cd,0x1e6));var _0xd81c=function(_0x5ed06c,_0x1a16e6){_0x5ed06c=_0x5ed06c-0x0;var _0x4087e9=_0x81cd[_0x5ed06c];return _0x4087e9;};'use strict';var _=require(_0xd81c('0x0'));var util=require(_0xd81c('0x1'));var logger=require(_0xd81c('0x2'))(_0xd81c('0x3'));var moment=require(_0xd81c('0x4'));var BPromise=require(_0xd81c('0x5'));var rp=require(_0xd81c('0x6'));var fs=require('fs');var path=require(_0xd81c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xd81c('0x8')]=function(_0xefafc8,_0x51cb42){return _0xefafc8[_0xd81c('0x9')](_0xd81c('0xa'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 4d242f9..302ce8b 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 _0x95fa=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x5ede29,_0x17f443){var _0x1c2f21=function(_0x3ccf04){while(--_0x3ccf04){_0x5ede29['push'](_0x5ede29['shift']());}};_0x1c2f21(++_0x17f443);}(_0x95fa,0x108));var _0xa95f=function(_0x4e124b,_0x118299){_0x4e124b=_0x4e124b-0x0;var _0x1b65c0=_0x95fa[_0x4e124b];return _0x1b65c0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa95f('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa95f('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xa95f('0x2'));var logger=require(_0xa95f('0x3'))(_0xa95f('0x4'));var config=require(_0xa95f('0x5'));var jayson=require(_0xa95f('0x6'));var client=jayson[_0xa95f('0x7')][_0xa95f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x297d84,_0x5cb3cc,_0x5a658b){return new BPromise(function(_0x32119d,_0x1b5d81){return client[_0xa95f('0x9')](_0x297d84,_0x5a658b)[_0xa95f('0xa')](function(_0x41adbf){logger[_0xa95f('0xb')](_0xa95f('0xc'),_0x5cb3cc,_0xa95f('0xd'));logger[_0xa95f('0xe')](_0xa95f('0xf'),_0x5cb3cc,_0xa95f('0xd'),JSON[_0xa95f('0x10')](_0x41adbf));if(_0x41adbf[_0xa95f('0x11')]){if(_0x41adbf[_0xa95f('0x11')][_0xa95f('0x12')]===0x1f4){logger[_0xa95f('0x11')](_0xa95f('0xc'),_0x5cb3cc,_0x41adbf[_0xa95f('0x11')][_0xa95f('0x13')]);return _0x1b5d81(_0x41adbf[_0xa95f('0x11')]['message']);}logger['error'](_0xa95f('0xc'),_0x5cb3cc,_0x41adbf[_0xa95f('0x11')][_0xa95f('0x13')]);return _0x32119d(_0x41adbf[_0xa95f('0x11')]['message']);}else{logger['info'](_0xa95f('0xc'),_0x5cb3cc,'request\x20sent');_0x32119d(_0x41adbf[_0xa95f('0x14')][_0xa95f('0x13')]);}})[_0xa95f('0x15')](function(_0x1ca135){logger[_0xa95f('0x11')](_0xa95f('0xc'),_0x5cb3cc,_0x1ca135);_0x1b5d81(_0x1ca135);});});} \ No newline at end of file +var _0x6abb=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6abb,0x105));var _0xb6ab=function(_0x3146b9,_0x4a6a0f){_0x3146b9=_0x3146b9-0x0;var _0x170dce=_0x6abb[_0x3146b9];return _0x170dce;};'use strict';var _=require('lodash');var util=require(_0xb6ab('0x0'));var moment=require(_0xb6ab('0x1'));var BPromise=require(_0xb6ab('0x2'));var rs=require(_0xb6ab('0x3'));var fs=require('fs');var Redis=require(_0xb6ab('0x4'));var db=require(_0xb6ab('0x5'))['db'];var utils=require(_0xb6ab('0x6'));var logger=require(_0xb6ab('0x7'))(_0xb6ab('0x8'));var config=require(_0xb6ab('0x9'));var jayson=require(_0xb6ab('0xa'));var client=jayson[_0xb6ab('0xb')][_0xb6ab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x29a757,_0x4b49de,_0x57dcd6){return new BPromise(function(_0x426335,_0x289e86){return client[_0xb6ab('0xd')](_0x29a757,_0x57dcd6)[_0xb6ab('0xe')](function(_0x2971bf){logger[_0xb6ab('0xf')](_0xb6ab('0x10'),_0x4b49de,_0xb6ab('0x11'));logger[_0xb6ab('0x12')](_0xb6ab('0x13'),_0x4b49de,'request\x20sent',JSON[_0xb6ab('0x14')](_0x2971bf));if(_0x2971bf[_0xb6ab('0x15')]){if(_0x2971bf['error'][_0xb6ab('0x16')]===0x1f4){logger[_0xb6ab('0x15')](_0xb6ab('0x10'),_0x4b49de,_0x2971bf['error']['message']);return _0x289e86(_0x2971bf[_0xb6ab('0x15')][_0xb6ab('0x17')]);}logger[_0xb6ab('0x15')](_0xb6ab('0x10'),_0x4b49de,_0x2971bf[_0xb6ab('0x15')][_0xb6ab('0x17')]);return _0x426335(_0x2971bf[_0xb6ab('0x15')][_0xb6ab('0x17')]);}else{logger['info'](_0xb6ab('0x10'),_0x4b49de,'request\x20sent');_0x426335(_0x2971bf[_0xb6ab('0x18')]['message']);}})[_0xb6ab('0x19')](function(_0x4d5c6a){logger['error'](_0xb6ab('0x10'),_0x4b49de,_0x4d5c6a);_0x289e86(_0x4d5c6a);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 3113db2..5ef1f87 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 _0x9187=['connect-timeout','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get','/:id','show','post','put','update','delete','multer','util'];(function(_0x53daae,_0x51a400){var _0x12be55=function(_0x312d46){while(--_0x312d46){_0x53daae['push'](_0x53daae['shift']());}};_0x12be55(++_0x51a400);}(_0x9187,0x184));var _0x7918=function(_0x1a286f,_0x374d52){_0x1a286f=_0x1a286f-0x0;var _0x33e8b0=_0x9187[_0x1a286f];return _0x33e8b0;};'use strict';var multer=require(_0x7918('0x0'));var util=require(_0x7918('0x1'));var path=require('path');var timeout=require(_0x7918('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7918('0x3'));var config=require(_0x7918('0x4'));var controller=require(_0x7918('0x5'));router['get']('/',auth[_0x7918('0x6')](),controller[_0x7918('0x7')]);router[_0x7918('0x8')](_0x7918('0x9'),auth['isAuthenticated'](),controller[_0x7918('0xa')]);router[_0x7918('0xb')]('/',auth[_0x7918('0x6')](),controller['create']);router[_0x7918('0xc')]('/:id',auth[_0x7918('0x6')](),controller[_0x7918('0xd')]);router[_0x7918('0xe')](_0x7918('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb5c5=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','/:id','post','put','update','delete'];(function(_0x104dd3,_0x9e170){var _0x476695=function(_0x301c05){while(--_0x301c05){_0x104dd3['push'](_0x104dd3['shift']());}};_0x476695(++_0x9e170);}(_0xb5c5,0x122));var _0x5b5c=function(_0x3e2cd3,_0x83af6f){_0x3e2cd3=_0x3e2cd3-0x0;var _0x4b7499=_0xb5c5[_0x3e2cd3];return _0x4b7499;};'use strict';var multer=require(_0x5b5c('0x0'));var util=require('util');var path=require(_0x5b5c('0x1'));var timeout=require(_0x5b5c('0x2'));var express=require('express');var router=express[_0x5b5c('0x3')]();var fs_extra=require(_0x5b5c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5b5c('0x5'));var controller=require(_0x5b5c('0x6'));router['get']('/',auth[_0x5b5c('0x7')](),controller[_0x5b5c('0x8')]);router['get'](_0x5b5c('0x9'),auth[_0x5b5c('0x7')](),controller['show']);router[_0x5b5c('0xa')]('/',auth[_0x5b5c('0x7')](),controller['create']);router[_0x5b5c('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x5b5c('0xc')]);router[_0x5b5c('0xd')]('/:id',auth[_0x5b5c('0x7')](),controller[_0x5b5c('0xe')]);module[_0x5b5c('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index e25606f..3397368 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 _0x85aa=['string','picklist','STRING','ENUM','variable','customVariable','BOOLEAN','sequelize','exports'];(function(_0x516966,_0x4ce508){var _0x589c40=function(_0x309676){while(--_0x309676){_0x516966['push'](_0x516966['shift']());}};_0x589c40(++_0x4ce508);}(_0x85aa,0x115));var _0xa85a=function(_0x7b5dde,_0x163285){_0x7b5dde=_0x7b5dde-0x0;var _0x4e13ce=_0x85aa[_0x7b5dde];return _0x4e13ce;};'use strict';var Sequelize=require(_0xa85a('0x0'));module[_0xa85a('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa85a('0x2'),'variable','customVariable','keyValue',_0xa85a('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0xa85a('0x4')]},'key':{'type':Sequelize[_0xa85a('0x4')]},'keyType':{'type':Sequelize[_0xa85a('0x5')](_0xa85a('0x2'),_0xa85a('0x6'),_0xa85a('0x7'))},'keyContent':{'type':Sequelize[_0xa85a('0x4')]},'idField':{'type':Sequelize[_0xa85a('0x4')]},'nameField':{'type':Sequelize[_0xa85a('0x4')]},'customField':{'type':Sequelize[_0xa85a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe9c1=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x3018b6,_0x461070){var _0x41c826=function(_0x9e5d9f){while(--_0x9e5d9f){_0x3018b6['push'](_0x3018b6['shift']());}};_0x41c826(++_0x461070);}(_0xe9c1,0x74));var _0x1e9c=function(_0x3e3dcf,_0x5c491c){_0x3e3dcf=_0x3e3dcf-0x0;var _0x377106=_0xe9c1[_0x3e3dcf];return _0x377106;};'use strict';var Sequelize=require(_0x1e9c('0x0'));module['exports']={'type':{'type':Sequelize[_0x1e9c('0x1')](_0x1e9c('0x2'),_0x1e9c('0x3'),'customVariable',_0x1e9c('0x4'),_0x1e9c('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1e9c('0x6')]},'keyType':{'type':Sequelize[_0x1e9c('0x1')](_0x1e9c('0x2'),_0x1e9c('0x3'),_0x1e9c('0x7'))},'keyContent':{'type':Sequelize[_0x1e9c('0x6')]},'idField':{'type':Sequelize[_0x1e9c('0x6')]},'nameField':{'type':Sequelize[_0x1e9c('0x6')]},'customField':{'type':Sequelize[_0x1e9c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1e9c('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index fda5aaa..53e3499 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 _0x2e54=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','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','json','offset','undefined','limit','count','set','apply','reject','save','then','error','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x54b396,_0x3612ee){var _0x532e6d=function(_0xc8286e){while(--_0xc8286e){_0x54b396['push'](_0x54b396['shift']());}};_0x532e6d(++_0x3612ee);}(_0x2e54,0x1dd));var _0x42e5=function(_0x54ebc4,_0x3b6509){_0x54ebc4=_0x54ebc4-0x0;var _0x2e33af=_0x2e54[_0x54ebc4];return _0x2e33af;};'use strict';var emlformat=require(_0x42e5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x42e5('0x1'));var rp=require(_0x42e5('0x2'));var moment=require(_0x42e5('0x3'));var BPromise=require(_0x42e5('0x4'));var Mustache=require(_0x42e5('0x5'));var util=require(_0x42e5('0x6'));var path=require(_0x42e5('0x7'));var sox=require('sox');var csv=require(_0x42e5('0x8'));var ejs=require(_0x42e5('0x9'));var fs=require('fs');var fs_extra=require(_0x42e5('0xa'));var _=require('lodash');var squel=require(_0x42e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x42e5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x42e5('0x8'));var querystring=require(_0x42e5('0xd'));var Papa=require(_0x42e5('0xe'));var Redis=require(_0x42e5('0xf'));var authService=require(_0x42e5('0x10'));var qs=require(_0x42e5('0x11'));var as=require(_0x42e5('0x12'));var hardwareService=require(_0x42e5('0x13'));var logger=require(_0x42e5('0x14'))('api');var utils=require(_0x42e5('0x15'));var config=require(_0x42e5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x42e5('0x17'))['db'];function respondWithStatusCode(_0x12385d,_0x4530ba){_0x4530ba=_0x4530ba||0xcc;return function(_0x41598d){if(_0x41598d){return _0x12385d[_0x42e5('0x18')](_0x4530ba);}return _0x12385d[_0x42e5('0x19')](_0x4530ba)[_0x42e5('0x1a')]();};}function respondWithResult(_0x96fae2,_0x447648){_0x447648=_0x447648||0xc8;return function(_0x23957f){if(_0x23957f){return _0x96fae2['status'](_0x447648)[_0x42e5('0x1b')](_0x23957f);}};}function respondWithFilteredResult(_0x1d8e52,_0x4034bd){return function(_0x388300){if(_0x388300){var _0x2f4999=typeof _0x4034bd[_0x42e5('0x1c')]===_0x42e5('0x1d')&&typeof _0x4034bd[_0x42e5('0x1e')]===_0x42e5('0x1d');var _0x3c7b79=_0x388300[_0x42e5('0x1f')];var _0x38282d=_0x2f4999?0x0:_0x4034bd[_0x42e5('0x1c')];var _0x23fe09=_0x2f4999?_0x388300['count']:_0x4034bd[_0x42e5('0x1c')]+_0x4034bd['limit'];var _0x5f4428;if(_0x23fe09>=_0x3c7b79){_0x23fe09=_0x3c7b79;_0x5f4428=0xc8;}else{_0x5f4428=0xce;}_0x1d8e52[_0x42e5('0x19')](_0x5f4428);return _0x1d8e52[_0x42e5('0x20')]('Content-Range',_0x38282d+'-'+_0x23fe09+'/'+_0x3c7b79)[_0x42e5('0x1b')](_0x388300);}return null;};}function patchUpdates(_0x39a3e2){return function(_0x1c2169){try{jsonpatch[_0x42e5('0x21')](_0x1c2169,_0x39a3e2,!![]);}catch(_0x1150f4){return BPromise[_0x42e5('0x22')](_0x1150f4);}return _0x1c2169[_0x42e5('0x23')]();};}function saveUpdates(_0x58eee5,_0x4da508){return function(_0x283d44){if(_0x283d44){return _0x283d44['update'](_0x58eee5)[_0x42e5('0x24')](function(_0x2e9574){return _0x2e9574;});}return null;};}function removeEntity(_0x37d10e,_0x49490f){return function(_0x32380f){if(_0x32380f){return _0x32380f['destroy']()[_0x42e5('0x24')](function(){_0x37d10e[_0x42e5('0x19')](0xcc)[_0x42e5('0x1a')]();});}};}function handleEntityNotFound(_0x275c80,_0x4638bc){return function(_0x4f52b2){if(!_0x4f52b2){_0x275c80['sendStatus'](0x194);}return _0x4f52b2;};}function handleError(_0x3115e4,_0x534a26){_0x534a26=_0x534a26||0x1f4;return function(_0x56f812){logger[_0x42e5('0x25')](_0x56f812['stack']);if(_0x56f812[_0x42e5('0x26')]){delete _0x56f812[_0x42e5('0x26')];}_0x3115e4[_0x42e5('0x19')](_0x534a26)[_0x42e5('0x27')](_0x56f812);};}exports[_0x42e5('0x28')]=function(_0x2f1edc,_0x59a46b){var _0x3e2ea5={},_0x201d9e={},_0x39f763={'count':0x0,'rows':[]};var _0x2c53d4=_[_0x42e5('0x29')](db[_0x42e5('0x2a')][_0x42e5('0x2b')],function(_0x282cbf){return{'name':_0x282cbf[_0x42e5('0x2c')],'type':_0x282cbf[_0x42e5('0x2d')][_0x42e5('0x2e')]};});_0x201d9e[_0x42e5('0x2f')]=_[_0x42e5('0x29')](_0x2c53d4,'name');_0x201d9e[_0x42e5('0x30')]=_[_0x42e5('0x31')](_0x2f1edc[_0x42e5('0x30')]);_0x201d9e[_0x42e5('0x32')]=_['intersection'](_0x201d9e['model'],_0x201d9e[_0x42e5('0x30')]);_0x3e2ea5['attributes']=_[_0x42e5('0x33')](_0x201d9e['model'],qs[_0x42e5('0x34')](_0x2f1edc[_0x42e5('0x30')][_0x42e5('0x34')]));_0x3e2ea5['attributes']=_0x3e2ea5[_0x42e5('0x35')][_0x42e5('0x36')]?_0x3e2ea5['attributes']:_0x201d9e[_0x42e5('0x2f')];if(!_0x2f1edc['query'][_0x42e5('0x37')](_0x42e5('0x38'))){_0x3e2ea5[_0x42e5('0x1e')]=qs[_0x42e5('0x1e')](_0x2f1edc[_0x42e5('0x30')][_0x42e5('0x1e')]);_0x3e2ea5[_0x42e5('0x1c')]=qs['offset'](_0x2f1edc['query'][_0x42e5('0x1c')]);}_0x3e2ea5[_0x42e5('0x39')]=qs[_0x42e5('0x3a')](_0x2f1edc['query']['sort']);_0x3e2ea5['where']=qs['filters'](_[_0x42e5('0x3b')](_0x2f1edc[_0x42e5('0x30')],_0x201d9e[_0x42e5('0x32')]),_0x2c53d4);if(_0x2f1edc[_0x42e5('0x30')][_0x42e5('0x3c')]){_0x3e2ea5[_0x42e5('0x3d')]=_[_0x42e5('0x3e')](_0x3e2ea5[_0x42e5('0x3d')],{'$or':_['map'](_0x2c53d4,function(_0x260413){if(_0x260413['type']!==_0x42e5('0x3f')){var _0x343363={};_0x343363[_0x260413[_0x42e5('0x26')]]={'$like':'%'+_0x2f1edc[_0x42e5('0x30')][_0x42e5('0x3c')]+'%'};return _0x343363;}})});}_0x3e2ea5=_[_0x42e5('0x3e')]({},_0x3e2ea5,_0x2f1edc[_0x42e5('0x40')]);var _0x5ab9b8={'where':_0x3e2ea5[_0x42e5('0x3d')]};return db[_0x42e5('0x2a')]['count'](_0x5ab9b8)[_0x42e5('0x24')](function(_0x5e8f96){_0x39f763['count']=_0x5e8f96;if(_0x2f1edc['query'][_0x42e5('0x41')]){_0x3e2ea5[_0x42e5('0x42')]=[{'all':!![]}];}return db[_0x42e5('0x2a')][_0x42e5('0x43')](_0x3e2ea5);})[_0x42e5('0x24')](function(_0x77aa22){_0x39f763[_0x42e5('0x44')]=_0x77aa22;return _0x39f763;})['then'](respondWithFilteredResult(_0x59a46b,_0x3e2ea5))[_0x42e5('0x45')](handleError(_0x59a46b,null));};exports[_0x42e5('0x46')]=function(_0x5bec97,_0x398b73){var _0x1c697a={'raw':!![],'where':{'id':_0x5bec97[_0x42e5('0x47')]['id']}},_0x5db771={};_0x5db771[_0x42e5('0x2f')]=_[_0x42e5('0x31')](db[_0x42e5('0x2a')][_0x42e5('0x2b')]);_0x5db771['query']=_[_0x42e5('0x31')](_0x5bec97[_0x42e5('0x30')]);_0x5db771[_0x42e5('0x32')]=_[_0x42e5('0x33')](_0x5db771['model'],_0x5db771[_0x42e5('0x30')]);_0x1c697a[_0x42e5('0x35')]=_[_0x42e5('0x33')](_0x5db771[_0x42e5('0x2f')],qs[_0x42e5('0x34')](_0x5bec97[_0x42e5('0x30')][_0x42e5('0x34')]));_0x1c697a[_0x42e5('0x35')]=_0x1c697a['attributes'][_0x42e5('0x36')]?_0x1c697a['attributes']:_0x5db771['model'];if(_0x5bec97[_0x42e5('0x30')][_0x42e5('0x41')]){_0x1c697a[_0x42e5('0x42')]=[{'all':!![]}];}_0x1c697a=_[_0x42e5('0x3e')]({},_0x1c697a,_0x5bec97[_0x42e5('0x40')]);return db[_0x42e5('0x2a')][_0x42e5('0x48')](_0x1c697a)['then'](handleEntityNotFound(_0x398b73,null))[_0x42e5('0x24')](respondWithResult(_0x398b73,null))[_0x42e5('0x45')](handleError(_0x398b73,null));};exports[_0x42e5('0x49')]=function(_0x21a047,_0x1086b2){return db[_0x42e5('0x2a')][_0x42e5('0x49')](_0x21a047[_0x42e5('0x4a')],{})['then'](respondWithResult(_0x1086b2,0xc9))[_0x42e5('0x45')](handleError(_0x1086b2,null));};exports[_0x42e5('0x4b')]=function(_0x3616f4,_0x48757e){if(_0x3616f4[_0x42e5('0x4a')]['id']){delete _0x3616f4[_0x42e5('0x4a')]['id'];}return db[_0x42e5('0x2a')][_0x42e5('0x48')]({'where':{'id':_0x3616f4[_0x42e5('0x47')]['id']}})['then'](handleEntityNotFound(_0x48757e,null))[_0x42e5('0x24')](saveUpdates(_0x3616f4['body'],null))[_0x42e5('0x24')](respondWithResult(_0x48757e,null))[_0x42e5('0x45')](handleError(_0x48757e,null));};exports[_0x42e5('0x4c')]=function(_0x48b63b,_0x50f59c){return db['FreshdeskField'][_0x42e5('0x48')]({'where':{'id':_0x48b63b[_0x42e5('0x47')]['id']}})[_0x42e5('0x24')](handleEntityNotFound(_0x50f59c,null))[_0x42e5('0x24')](removeEntity(_0x50f59c,null))['catch'](handleError(_0x50f59c,null));}; \ No newline at end of file +var _0x073e=['length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskField','rawAttributes','type','key','keys','query','filters','attributes','model','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection'];(function(_0x40b813,_0x31bf5a){var _0x311b4c=function(_0x2ea636){while(--_0x2ea636){_0x40b813['push'](_0x40b813['shift']());}};_0x311b4c(++_0x31bf5a);}(_0x073e,0x181));var _0xe073=function(_0x5484bf,_0x26fd67){_0x5484bf=_0x5484bf-0x0;var _0x107c4f=_0x073e[_0x5484bf];return _0x107c4f;};'use strict';var emlformat=require(_0xe073('0x0'));var rimraf=require(_0xe073('0x1'));var zipdir=require(_0xe073('0x2'));var jsonpatch=require(_0xe073('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe073('0x4'));var util=require(_0xe073('0x5'));var path=require(_0xe073('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe073('0x7'));var _=require(_0xe073('0x8'));var squel=require(_0xe073('0x9'));var crypto=require(_0xe073('0xa'));var jsforce=require(_0xe073('0xb'));var deskjs=require(_0xe073('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe073('0xd'));var Papa=require(_0xe073('0xe'));var Redis=require(_0xe073('0xf'));var authService=require(_0xe073('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe073('0x11'));var hardwareService=require(_0xe073('0x12'));var logger=require(_0xe073('0x13'))(_0xe073('0x14'));var utils=require(_0xe073('0x15'));var config=require(_0xe073('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe073('0x17'))['db'];function respondWithStatusCode(_0x56e3f5,_0x3dedf7){_0x3dedf7=_0x3dedf7||0xcc;return function(_0x5d2f2f){if(_0x5d2f2f){return _0x56e3f5[_0xe073('0x18')](_0x3dedf7);}return _0x56e3f5['status'](_0x3dedf7)[_0xe073('0x19')]();};}function respondWithResult(_0x27d34,_0x47828d){_0x47828d=_0x47828d||0xc8;return function(_0x2ce92d){if(_0x2ce92d){return _0x27d34[_0xe073('0x1a')](_0x47828d)[_0xe073('0x1b')](_0x2ce92d);}};}function respondWithFilteredResult(_0x2f4b36,_0xfb28f5){return function(_0x208f2e){if(_0x208f2e){var _0x26f3d3=typeof _0xfb28f5[_0xe073('0x1c')]==='undefined'&&typeof _0xfb28f5['limit']==='undefined';var _0x4c578c=_0x208f2e[_0xe073('0x1d')];var _0x10486c=_0x26f3d3?0x0:_0xfb28f5[_0xe073('0x1c')];var _0x4f9c8e=_0x26f3d3?_0x208f2e[_0xe073('0x1d')]:_0xfb28f5[_0xe073('0x1c')]+_0xfb28f5[_0xe073('0x1e')];var _0x54c10e;if(_0x4f9c8e>=_0x4c578c){_0x4f9c8e=_0x4c578c;_0x54c10e=0xc8;}else{_0x54c10e=0xce;}_0x2f4b36[_0xe073('0x1a')](_0x54c10e);return _0x2f4b36[_0xe073('0x1f')](_0xe073('0x20'),_0x10486c+'-'+_0x4f9c8e+'/'+_0x4c578c)[_0xe073('0x1b')](_0x208f2e);}return null;};}function patchUpdates(_0x43668e){return function(_0x17dd4b){try{jsonpatch[_0xe073('0x21')](_0x17dd4b,_0x43668e,!![]);}catch(_0x1d7a13){return BPromise[_0xe073('0x22')](_0x1d7a13);}return _0x17dd4b[_0xe073('0x23')]();};}function saveUpdates(_0x5143fa,_0x4405fd){return function(_0x21f9c2){if(_0x21f9c2){return _0x21f9c2[_0xe073('0x24')](_0x5143fa)[_0xe073('0x25')](function(_0x39bcb4){return _0x39bcb4;});}return null;};}function removeEntity(_0x275aa8,_0x504c26){return function(_0x4c76ef){if(_0x4c76ef){return _0x4c76ef[_0xe073('0x26')]()['then'](function(){_0x275aa8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c4137,_0x54a38b){return function(_0x50795f){if(!_0x50795f){_0x5c4137[_0xe073('0x18')](0x194);}return _0x50795f;};}function handleError(_0xff003,_0x5bd226){_0x5bd226=_0x5bd226||0x1f4;return function(_0x1fca27){logger[_0xe073('0x27')](_0x1fca27[_0xe073('0x28')]);if(_0x1fca27['name']){delete _0x1fca27[_0xe073('0x29')];}_0xff003['status'](_0x5bd226)[_0xe073('0x2a')](_0x1fca27);};}exports[_0xe073('0x2b')]=function(_0x599972,_0x5dfff9){var _0x15adbb={},_0x859ed8={},_0x278fbb={'count':0x0,'rows':[]};var _0x2f1cd2=_[_0xe073('0x2c')](db[_0xe073('0x2d')][_0xe073('0x2e')],function(_0x2a206a){return{'name':_0x2a206a['fieldName'],'type':_0x2a206a[_0xe073('0x2f')][_0xe073('0x30')]};});_0x859ed8['model']=_['map'](_0x2f1cd2,_0xe073('0x29'));_0x859ed8['query']=_[_0xe073('0x31')](_0x599972[_0xe073('0x32')]);_0x859ed8[_0xe073('0x33')]=_['intersection'](_0x859ed8['model'],_0x859ed8[_0xe073('0x32')]);_0x15adbb[_0xe073('0x34')]=_['intersection'](_0x859ed8[_0xe073('0x35')],qs[_0xe073('0x36')](_0x599972[_0xe073('0x32')]['fields']));_0x15adbb[_0xe073('0x34')]=_0x15adbb['attributes']['length']?_0x15adbb[_0xe073('0x34')]:_0x859ed8[_0xe073('0x35')];if(!_0x599972[_0xe073('0x32')]['hasOwnProperty'](_0xe073('0x37'))){_0x15adbb[_0xe073('0x1e')]=qs[_0xe073('0x1e')](_0x599972['query'][_0xe073('0x1e')]);_0x15adbb[_0xe073('0x1c')]=qs[_0xe073('0x1c')](_0x599972[_0xe073('0x32')][_0xe073('0x1c')]);}_0x15adbb[_0xe073('0x38')]=qs['sort'](_0x599972[_0xe073('0x32')][_0xe073('0x39')]);_0x15adbb[_0xe073('0x3a')]=qs['filters'](_[_0xe073('0x3b')](_0x599972[_0xe073('0x32')],_0x859ed8[_0xe073('0x33')]),_0x2f1cd2);if(_0x599972[_0xe073('0x32')][_0xe073('0x3c')]){_0x15adbb['where']=_[_0xe073('0x3d')](_0x15adbb['where'],{'$or':_[_0xe073('0x2c')](_0x2f1cd2,function(_0x22d278){if(_0x22d278[_0xe073('0x2f')]!==_0xe073('0x3e')){var _0x40f991={};_0x40f991[_0x22d278[_0xe073('0x29')]]={'$like':'%'+_0x599972[_0xe073('0x32')][_0xe073('0x3c')]+'%'};return _0x40f991;}})});}_0x15adbb=_[_0xe073('0x3d')]({},_0x15adbb,_0x599972[_0xe073('0x3f')]);var _0x12976c={'where':_0x15adbb[_0xe073('0x3a')]};return db[_0xe073('0x2d')]['count'](_0x12976c)[_0xe073('0x25')](function(_0x577c87){_0x278fbb[_0xe073('0x1d')]=_0x577c87;if(_0x599972[_0xe073('0x32')][_0xe073('0x40')]){_0x15adbb[_0xe073('0x41')]=[{'all':!![]}];}return db['FreshdeskField'][_0xe073('0x42')](_0x15adbb);})[_0xe073('0x25')](function(_0x93852a){_0x278fbb[_0xe073('0x43')]=_0x93852a;return _0x278fbb;})[_0xe073('0x25')](respondWithFilteredResult(_0x5dfff9,_0x15adbb))['catch'](handleError(_0x5dfff9,null));};exports[_0xe073('0x44')]=function(_0x4b2a82,_0x764196){var _0x2a8c57={'raw':!![],'where':{'id':_0x4b2a82[_0xe073('0x45')]['id']}},_0x125d1f={};_0x125d1f[_0xe073('0x35')]=_[_0xe073('0x31')](db[_0xe073('0x2d')][_0xe073('0x2e')]);_0x125d1f[_0xe073('0x32')]=_[_0xe073('0x31')](_0x4b2a82[_0xe073('0x32')]);_0x125d1f['filters']=_['intersection'](_0x125d1f[_0xe073('0x35')],_0x125d1f[_0xe073('0x32')]);_0x2a8c57[_0xe073('0x34')]=_[_0xe073('0x46')](_0x125d1f[_0xe073('0x35')],qs['fields'](_0x4b2a82[_0xe073('0x32')][_0xe073('0x36')]));_0x2a8c57[_0xe073('0x34')]=_0x2a8c57[_0xe073('0x34')][_0xe073('0x47')]?_0x2a8c57['attributes']:_0x125d1f[_0xe073('0x35')];if(_0x4b2a82['query']['includeAll']){_0x2a8c57[_0xe073('0x41')]=[{'all':!![]}];}_0x2a8c57=_[_0xe073('0x3d')]({},_0x2a8c57,_0x4b2a82['options']);return db['FreshdeskField'][_0xe073('0x48')](_0x2a8c57)[_0xe073('0x25')](handleEntityNotFound(_0x764196,null))[_0xe073('0x25')](respondWithResult(_0x764196,null))[_0xe073('0x49')](handleError(_0x764196,null));};exports[_0xe073('0x4a')]=function(_0x1eec23,_0x317159){return db['FreshdeskField'][_0xe073('0x4a')](_0x1eec23['body'],{})[_0xe073('0x25')](respondWithResult(_0x317159,0xc9))[_0xe073('0x49')](handleError(_0x317159,null));};exports[_0xe073('0x24')]=function(_0x4e1f1d,_0x4d5bcd){if(_0x4e1f1d[_0xe073('0x4b')]['id']){delete _0x4e1f1d[_0xe073('0x4b')]['id'];}return db[_0xe073('0x2d')]['find']({'where':{'id':_0x4e1f1d[_0xe073('0x45')]['id']}})[_0xe073('0x25')](handleEntityNotFound(_0x4d5bcd,null))[_0xe073('0x25')](saveUpdates(_0x4e1f1d[_0xe073('0x4b')],null))[_0xe073('0x25')](respondWithResult(_0x4d5bcd,null))[_0xe073('0x49')](handleError(_0x4d5bcd,null));};exports[_0xe073('0x26')]=function(_0x307541,_0x3238eb){return db['FreshdeskField'][_0xe073('0x48')]({'where':{'id':_0x307541['params']['id']}})[_0xe073('0x25')](handleEntityNotFound(_0x3238eb,null))['then'](removeEntity(_0x3238eb,null))[_0xe073('0x49')](handleError(_0x3238eb,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index c14370c..c6bf02d 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 _0xaf92=['util','../../config/logger','api','moment','bluebird','request-promise','path','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash'];(function(_0x2a92f3,_0x357fe2){var _0x49cb03=function(_0x1ad082){while(--_0x1ad082){_0x2a92f3['push'](_0x2a92f3['shift']());}};_0x49cb03(++_0x357fe2);}(_0xaf92,0x185));var _0x2af9=function(_0x585216,_0xe22734){_0x585216=_0x585216-0x0;var _0x3985cd=_0xaf92[_0x585216];return _0x3985cd;};'use strict';var _=require(_0x2af9('0x0'));var util=require(_0x2af9('0x1'));var logger=require(_0x2af9('0x2'))(_0x2af9('0x3'));var moment=require(_0x2af9('0x4'));var BPromise=require(_0x2af9('0x5'));var rp=require(_0x2af9('0x6'));var fs=require('fs');var path=require(_0x2af9('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module[_0x2af9('0x8')]=function(_0x8462a2,_0x415399){return _0x8462a2[_0x2af9('0x9')](_0x2af9('0xa'),attributes,{'tableName':_0x2af9('0xb'),'paranoid':![],'indexes':[{'name':_0x2af9('0xc'),'fields':[_0x2af9('0xd'),_0x2af9('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4262=['lodash','util','../../config/logger','moment','request-promise','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField'];(function(_0x28b6e9,_0x9708c3){var _0x23859c=function(_0x76f5cf){while(--_0x76f5cf){_0x28b6e9['push'](_0x28b6e9['shift']());}};_0x23859c(++_0x9708c3);}(_0x4262,0x15f));var _0x2426=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4262[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2426('0x0'));var util=require(_0x2426('0x1'));var logger=require(_0x2426('0x2'))('api');var moment=require(_0x2426('0x3'));var BPromise=require('bluebird');var rp=require(_0x2426('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2426('0x5'));var attributes=require(_0x2426('0x6'));module[_0x2426('0x7')]=function(_0x127500,_0x4a6553){return _0x127500[_0x2426('0x8')](_0x2426('0x9'),attributes,{'tableName':_0x2426('0xa'),'paranoid':![],'indexes':[{'name':_0x2426('0xb'),'fields':[_0x2426('0xc'),'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 ea939bd..2b7eedb 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 _0x35d3=['error','code','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','client','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s'];(function(_0x575173,_0x561e0b){var _0x541827=function(_0x2f2709){while(--_0x2f2709){_0x575173['push'](_0x575173['shift']());}};_0x541827(++_0x561e0b);}(_0x35d3,0xc0));var _0x335d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x35d3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x335d('0x0'));var util=require(_0x335d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x335d('0x2'));var db=require(_0x335d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x335d('0x4'))(_0x335d('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x335d('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xae1f84,_0x44e169,_0x5a6c33){return new BPromise(function(_0x33b3c0,_0x19c273){return client['request'](_0xae1f84,_0x5a6c33)[_0x335d('0x7')](function(_0x25463d){logger[_0x335d('0x8')](_0x335d('0x9'),_0x44e169,_0x335d('0xa'));logger['debug'](_0x335d('0xb'),_0x44e169,_0x335d('0xa'),JSON['stringify'](_0x25463d));if(_0x25463d[_0x335d('0xc')]){if(_0x25463d['error'][_0x335d('0xd')]===0x1f4){logger[_0x335d('0xc')](_0x335d('0x9'),_0x44e169,_0x25463d['error'][_0x335d('0xe')]);return _0x19c273(_0x25463d[_0x335d('0xc')]['message']);}logger[_0x335d('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x44e169,_0x25463d[_0x335d('0xc')][_0x335d('0xe')]);return _0x33b3c0(_0x25463d[_0x335d('0xc')][_0x335d('0xe')]);}else{logger[_0x335d('0x8')](_0x335d('0x9'),_0x44e169,_0x335d('0xa'));_0x33b3c0(_0x25463d[_0x335d('0xf')][_0x335d('0xe')]);}})[_0x335d('0x10')](function(_0x27676f){logger['error'](_0x335d('0x9'),_0x44e169,_0x27676f);_0x19c273(_0x27676f);});});} \ No newline at end of file +var _0x6080=['client','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x6080,0xd3));var _0x0608=function(_0x5a0fec,_0x15b5a4){_0x5a0fec=_0x5a0fec-0x0;var _0x2b7ed2=_0x6080[_0x5a0fec];return _0x2b7ed2;};'use strict';var _=require(_0x0608('0x0'));var util=require('util');var moment=require(_0x0608('0x1'));var BPromise=require(_0x0608('0x2'));var rs=require(_0x0608('0x3'));var fs=require('fs');var Redis=require(_0x0608('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0608('0x5'));var logger=require('../../config/logger')(_0x0608('0x6'));var config=require(_0x0608('0x7'));var jayson=require(_0x0608('0x8'));var client=jayson[_0x0608('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x341af6,_0x507a1f,_0x447176){return new BPromise(function(_0x2d4eb3,_0x3f990b){return client[_0x0608('0xa')](_0x341af6,_0x447176)[_0x0608('0xb')](function(_0x1b3b21){logger['info'](_0x0608('0xc'),_0x507a1f,_0x0608('0xd'));logger['debug'](_0x0608('0xe'),_0x507a1f,'request\x20sent',JSON[_0x0608('0xf')](_0x1b3b21));if(_0x1b3b21[_0x0608('0x10')]){if(_0x1b3b21[_0x0608('0x10')][_0x0608('0x11')]===0x1f4){logger[_0x0608('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x507a1f,_0x1b3b21['error'][_0x0608('0x12')]);return _0x3f990b(_0x1b3b21[_0x0608('0x10')][_0x0608('0x12')]);}logger['error'](_0x0608('0xc'),_0x507a1f,_0x1b3b21[_0x0608('0x10')]['message']);return _0x2d4eb3(_0x1b3b21[_0x0608('0x10')][_0x0608('0x12')]);}else{logger[_0x0608('0x13')](_0x0608('0xc'),_0x507a1f,_0x0608('0xd'));_0x2d4eb3(_0x1b3b21[_0x0608('0x14')][_0x0608('0x12')]);}})[_0x0608('0x15')](function(_0x27e0ce){logger[_0x0608('0x10')](_0x0608('0xc'),_0x507a1f,_0x27e0ce);_0x3f990b(_0x27e0ce);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 461d79e..22e6540 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 _0x5ec6=['exports','multer','util','path','express','fs-extra','../../components/interaction/service','./intFreshsalesAccount.controller','isAuthenticated','index','/:id','get','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x5ec6,0x7f));var _0x65ec=function(_0x357c64,_0x4183ec){_0x357c64=_0x357c64-0x0;var _0x34e3e4=_0x5ec6[_0x357c64];return _0x34e3e4;};'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['show']);router[_0x65ec('0xa')](_0x65ec('0xb'),auth[_0x65ec('0x7')](),controller['getConfigurations']);router['get'](_0x65ec('0xc'),auth['isAuthenticated'](),controller[_0x65ec('0xd')]);router[_0x65ec('0xe')]('/',auth['isAuthenticated'](),controller[_0x65ec('0xf')]);router[_0x65ec('0xe')]('/:id/configurations',auth[_0x65ec('0x7')](),controller[_0x65ec('0x10')]);router['put'](_0x65ec('0x9'),auth[_0x65ec('0x7')](),controller[_0x65ec('0x11')]);router[_0x65ec('0x12')](_0x65ec('0x9'),auth[_0x65ec('0x7')](),controller[_0x65ec('0x13')]);module[_0x65ec('0x14')]=router; \ No newline at end of file +var _0x6c76=['getConfigurations','/:id/fields','post','create','addConfiguration','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/configurations'];(function(_0x893cc5,_0x264fb4){var _0x5b369e=function(_0x3ce746){while(--_0x3ce746){_0x893cc5['push'](_0x893cc5['shift']());}};_0x5b369e(++_0x264fb4);}(_0x6c76,0x184));var _0x66c7=function(_0x183c71,_0x526d3f){_0x183c71=_0x183c71-0x0;var _0x4d4c0f=_0x6c76[_0x183c71];return _0x4d4c0f;};'use strict';var multer=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var path=require(_0x66c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x66c7('0x3'));var router=express[_0x66c7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var controller=require('./intFreshsalesAccount.controller');router[_0x66c7('0x7')]('/',auth[_0x66c7('0x8')](),controller['index']);router[_0x66c7('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x66c7('0x9')]);router[_0x66c7('0x7')](_0x66c7('0xa'),auth['isAuthenticated'](),controller[_0x66c7('0xb')]);router[_0x66c7('0x7')](_0x66c7('0xc'),auth[_0x66c7('0x8')](),controller['getFields']);router[_0x66c7('0xd')]('/',auth[_0x66c7('0x8')](),controller[_0x66c7('0xe')]);router[_0x66c7('0xd')](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0xf')]);router['put'](_0x66c7('0x10'),auth[_0x66c7('0x8')](),controller[_0x66c7('0x11')]);router[_0x66c7('0x12')](_0x66c7('0x10'),auth[_0x66c7('0x8')](),controller[_0x66c7('0x13')]);module[_0x66c7('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 256d239..96e612a 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 _0x68b3=['sequelize','exports','STRING','remoteUri'];(function(_0x5f191f,_0x5c5033){var _0x41e2c3=function(_0x48f778){while(--_0x48f778){_0x5f191f['push'](_0x5f191f['shift']());}};_0x41e2c3(++_0x5c5033);}(_0x68b3,0x1d8));var _0x368b=function(_0x42b252,_0xad609f){_0x42b252=_0x42b252-0x0;var _0x48e12=_0x68b3[_0x42b252];return _0x48e12;};'use strict';var Sequelize=require(_0x368b('0x0'));module[_0x368b('0x1')]={'name':{'type':Sequelize[_0x368b('0x2')]},'description':{'type':Sequelize[_0x368b('0x2')]},'username':{'type':Sequelize[_0x368b('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x368b('0x2')]},'remoteUri':{'type':Sequelize[_0x368b('0x2')],'unique':_0x368b('0x3')},'serverUrl':{'type':Sequelize[_0x368b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x4e2e=['username','remoteUri','exports','STRING'];(function(_0x40897f,_0x1ee75f){var _0x1ccd9b=function(_0x1bb197){while(--_0x1bb197){_0x40897f['push'](_0x40897f['shift']());}};_0x1ccd9b(++_0x1ee75f);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x421a9c,_0x2cced8){_0x421a9c=_0x421a9c-0x0;var _0x3675b5=_0x4e2e[_0x421a9c];return _0x3675b5;};'use strict';var Sequelize=require('sequelize');module[_0xe4e2('0x0')]={'name':{'type':Sequelize[_0xe4e2('0x1')]},'description':{'type':Sequelize[_0xe4e2('0x1')]},'username':{'type':Sequelize[_0xe4e2('0x1')],'unique':_0xe4e2('0x2')},'apiKey':{'type':Sequelize[_0xe4e2('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xe4e2('0x3')},'serverUrl':{'type':Sequelize[_0xe4e2('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index f79a815..b058123 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 _0xf07a=['substring','lastIndexOf','GET','%s%s','/api/selector/owners','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','FreshsalesAccount','includeAll','include','findAll','rows','catch','params','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice'];(function(_0x178d45,_0x2d52fb){var _0x3591c5=function(_0x422fe2){while(--_0x422fe2){_0x178d45['push'](_0x178d45['shift']());}};_0x3591c5(++_0x2d52fb);}(_0xf07a,0x74));var _0xaf07=function(_0x3f9ac2,_0x1b670b){_0x3f9ac2=_0x3f9ac2-0x0;var _0xe6a436=_0xf07a[_0x3f9ac2];return _0xe6a436;};'use strict';var emlformat=require(_0xaf07('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaf07('0x1'));var jsonpatch=require(_0xaf07('0x2'));var rp=require(_0xaf07('0x3'));var moment=require('moment');var BPromise=require(_0xaf07('0x4'));var Mustache=require(_0xaf07('0x5'));var util=require(_0xaf07('0x6'));var path=require(_0xaf07('0x7'));var sox=require(_0xaf07('0x8'));var csv=require(_0xaf07('0x9'));var ejs=require(_0xaf07('0xa'));var fs=require('fs');var fs_extra=require(_0xaf07('0xb'));var _=require(_0xaf07('0xc'));var squel=require('squel');var crypto=require(_0xaf07('0xd'));var jsforce=require(_0xaf07('0xe'));var deskjs=require(_0xaf07('0xf'));var toCsv=require(_0xaf07('0x9'));var querystring=require('querystring');var Papa=require(_0xaf07('0x10'));var Redis=require('ioredis');var authService=require(_0xaf07('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaf07('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf07('0x13'))(_0xaf07('0x14'));var utils=require(_0xaf07('0x15'));var config=require(_0xaf07('0x16'));var licenseUtil=require(_0xaf07('0x17'));var db=require(_0xaf07('0x18'))['db'];var integrations=require(_0xaf07('0x19'));function respondWithStatusCode(_0x30ed8a,_0x11f42f){_0x11f42f=_0x11f42f||0xcc;return function(_0x80d891){if(_0x80d891){return _0x30ed8a['sendStatus'](_0x11f42f);}return _0x30ed8a['status'](_0x11f42f)[_0xaf07('0x1a')]();};}function respondWithResult(_0x1b8edc,_0x883cc3){_0x883cc3=_0x883cc3||0xc8;return function(_0x4e4562){if(_0x4e4562){return _0x1b8edc[_0xaf07('0x1b')](_0x883cc3)[_0xaf07('0x1c')](_0x4e4562);}};}function respondWithFilteredResult(_0x3e4cbc,_0x1713cd){return function(_0x3c87eb){if(_0x3c87eb){var _0x434853=typeof _0x1713cd[_0xaf07('0x1d')]===_0xaf07('0x1e')&&typeof _0x1713cd[_0xaf07('0x1f')]==='undefined';var _0x5ba431=_0x3c87eb['count'];var _0x2818e3=_0x434853?0x0:_0x1713cd['offset'];var _0x47a48e=_0x434853?_0x3c87eb[_0xaf07('0x20')]:_0x1713cd[_0xaf07('0x1d')]+_0x1713cd[_0xaf07('0x1f')];var _0x476010;if(_0x47a48e>=_0x5ba431){_0x47a48e=_0x5ba431;_0x476010=0xc8;}else{_0x476010=0xce;}_0x3e4cbc['status'](_0x476010);return _0x3e4cbc['set']('Content-Range',_0x2818e3+'-'+_0x47a48e+'/'+_0x5ba431)[_0xaf07('0x1c')](_0x3c87eb);}return null;};}function patchUpdates(_0x288458){return function(_0x1c5b9f){try{jsonpatch[_0xaf07('0x21')](_0x1c5b9f,_0x288458,!![]);}catch(_0x554178){return BPromise['reject'](_0x554178);}return _0x1c5b9f[_0xaf07('0x22')]();};}function saveUpdates(_0x1fa4cf,_0x4e4e7a){return function(_0x2f6a28){if(_0x2f6a28){return _0x2f6a28[_0xaf07('0x23')](_0x1fa4cf)[_0xaf07('0x24')](function(_0x5e1dd4){return _0x5e1dd4;});}return null;};}function removeEntity(_0x481b71,_0x1adaed){return function(_0x29f12f){if(_0x29f12f){return _0x29f12f[_0xaf07('0x25')]()[_0xaf07('0x24')](function(){_0x481b71['status'](0xcc)[_0xaf07('0x1a')]();});}};}function handleEntityNotFound(_0x61c7fd,_0x72e340){return function(_0x4d3558){if(!_0x4d3558){_0x61c7fd[_0xaf07('0x26')](0x194);}return _0x4d3558;};}function handleError(_0x1e9df6,_0x40e252){_0x40e252=_0x40e252||0x1f4;return function(_0x21b924){logger[_0xaf07('0x27')](_0x21b924[_0xaf07('0x28')]);if(_0x21b924[_0xaf07('0x29')]){delete _0x21b924[_0xaf07('0x29')];}_0x1e9df6['status'](_0x40e252)[_0xaf07('0x2a')](_0x21b924);};}exports[_0xaf07('0x2b')]=function(_0x316245,_0xf45431){var _0x1208b6={},_0x217040={},_0x3f77c6={'count':0x0,'rows':[]};var _0x21c760=_['map'](db['FreshsalesAccount'][_0xaf07('0x2c')],function(_0x3b11b0){return{'name':_0x3b11b0[_0xaf07('0x2d')],'type':_0x3b11b0[_0xaf07('0x2e')]['key']};});_0x217040[_0xaf07('0x2f')]=_[_0xaf07('0x30')](_0x21c760,_0xaf07('0x29'));_0x217040[_0xaf07('0x31')]=_[_0xaf07('0x32')](_0x316245[_0xaf07('0x31')]);_0x217040[_0xaf07('0x33')]=_[_0xaf07('0x34')](_0x217040['model'],_0x217040[_0xaf07('0x31')]);_0x1208b6[_0xaf07('0x35')]=_[_0xaf07('0x34')](_0x217040[_0xaf07('0x2f')],qs['fields'](_0x316245['query'][_0xaf07('0x36')]));_0x1208b6['attributes']=_0x1208b6[_0xaf07('0x35')][_0xaf07('0x37')]?_0x1208b6[_0xaf07('0x35')]:_0x217040[_0xaf07('0x2f')];if(!_0x316245[_0xaf07('0x31')][_0xaf07('0x38')](_0xaf07('0x39'))){_0x1208b6[_0xaf07('0x1f')]=qs[_0xaf07('0x1f')](_0x316245[_0xaf07('0x31')][_0xaf07('0x1f')]);_0x1208b6[_0xaf07('0x1d')]=qs['offset'](_0x316245[_0xaf07('0x31')]['offset']);}_0x1208b6[_0xaf07('0x3a')]=qs[_0xaf07('0x3b')](_0x316245['query'][_0xaf07('0x3b')]);_0x1208b6[_0xaf07('0x3c')]=qs[_0xaf07('0x33')](_[_0xaf07('0x3d')](_0x316245[_0xaf07('0x31')],_0x217040[_0xaf07('0x33')]),_0x21c760);if(_0x316245['query'][_0xaf07('0x3e')]){_0x1208b6[_0xaf07('0x3c')]=_['merge'](_0x1208b6[_0xaf07('0x3c')],{'$or':_[_0xaf07('0x30')](_0x21c760,function(_0x5a99ef){if(_0x5a99ef['type']!=='VIRTUAL'){var _0xafd711={};_0xafd711[_0x5a99ef[_0xaf07('0x29')]]={'$like':'%'+_0x316245[_0xaf07('0x31')]['filter']+'%'};return _0xafd711;}})});}_0x1208b6=_[_0xaf07('0x3f')]({},_0x1208b6,_0x316245[_0xaf07('0x40')]);var _0x5d2c4f={'where':_0x1208b6[_0xaf07('0x3c')]};return db[_0xaf07('0x41')][_0xaf07('0x20')](_0x5d2c4f)[_0xaf07('0x24')](function(_0x1842ea){_0x3f77c6['count']=_0x1842ea;if(_0x316245[_0xaf07('0x31')][_0xaf07('0x42')]){_0x1208b6[_0xaf07('0x43')]=[{'all':!![]}];}return db[_0xaf07('0x41')][_0xaf07('0x44')](_0x1208b6);})[_0xaf07('0x24')](function(_0x5ebbd1){_0x3f77c6[_0xaf07('0x45')]=_0x5ebbd1;return _0x3f77c6;})[_0xaf07('0x24')](respondWithFilteredResult(_0xf45431,_0x1208b6))[_0xaf07('0x46')](handleError(_0xf45431,null));};exports['show']=function(_0x2c3c98,_0xb9582f){var _0x4fe543={'raw':![],'where':{'id':_0x2c3c98[_0xaf07('0x47')]['id']}},_0x404023={};_0x404023[_0xaf07('0x2f')]=_['keys'](db[_0xaf07('0x41')][_0xaf07('0x2c')]);_0x404023[_0xaf07('0x31')]=_[_0xaf07('0x32')](_0x2c3c98['query']);_0x404023[_0xaf07('0x33')]=_[_0xaf07('0x34')](_0x404023[_0xaf07('0x2f')],_0x404023[_0xaf07('0x31')]);_0x4fe543[_0xaf07('0x35')]=_[_0xaf07('0x34')](_0x404023[_0xaf07('0x2f')],qs[_0xaf07('0x36')](_0x2c3c98['query'][_0xaf07('0x36')]));_0x4fe543[_0xaf07('0x35')]=_0x4fe543[_0xaf07('0x35')]['length']?_0x4fe543[_0xaf07('0x35')]:_0x404023[_0xaf07('0x2f')];if(_0x2c3c98[_0xaf07('0x31')]['includeAll']){_0x4fe543[_0xaf07('0x43')]=[{'all':!![]}];}_0x4fe543=_[_0xaf07('0x3f')]({},_0x4fe543,_0x2c3c98[_0xaf07('0x40')]);return db[_0xaf07('0x41')][_0xaf07('0x48')](_0x4fe543)[_0xaf07('0x24')](handleEntityNotFound(_0xb9582f,null))[_0xaf07('0x24')](respondWithResult(_0xb9582f,null))[_0xaf07('0x46')](handleError(_0xb9582f,null));};exports[_0xaf07('0x49')]=function(_0x5c72f8,_0xba1d54){return db['FreshsalesAccount'][_0xaf07('0x49')](_0x5c72f8['body'],{})[_0xaf07('0x24')](respondWithResult(_0xba1d54,0xc9))['catch'](handleError(_0xba1d54,null));};exports[_0xaf07('0x23')]=function(_0x45edd2,_0x1d9d8b){if(_0x45edd2[_0xaf07('0x4a')]['id']){delete _0x45edd2[_0xaf07('0x4a')]['id'];}return db[_0xaf07('0x41')][_0xaf07('0x48')]({'where':{'id':_0x45edd2[_0xaf07('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d9d8b,null))['then'](saveUpdates(_0x45edd2['body'],null))[_0xaf07('0x24')](respondWithResult(_0x1d9d8b,null))['catch'](handleError(_0x1d9d8b,null));};exports['destroy']=function(_0x5430bc,_0x544607){return db[_0xaf07('0x41')][_0xaf07('0x48')]({'where':{'id':_0x5430bc[_0xaf07('0x47')]['id']}})[_0xaf07('0x24')](handleEntityNotFound(_0x544607,null))['then'](removeEntity(_0x544607,null))[_0xaf07('0x46')](handleError(_0x544607,null));};exports[_0xaf07('0x4b')]=function(_0x3d331a,_0x3d8309,_0x213180){var _0x3b0709={};var _0x1b436e={};var _0x5ba11f;var _0x16a87e;return db[_0xaf07('0x41')][_0xaf07('0x4c')]({'where':{'id':_0x3d331a[_0xaf07('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d8309,null))[_0xaf07('0x24')](function(_0x38237f){if(_0x38237f){_0x5ba11f=_0x38237f;_0x1b436e[_0xaf07('0x2f')]=_['keys'](db[_0xaf07('0x4d')][_0xaf07('0x2c')]);_0x1b436e[_0xaf07('0x31')]=_[_0xaf07('0x32')](_0x3d331a[_0xaf07('0x31')]);_0x1b436e[_0xaf07('0x33')]=_[_0xaf07('0x34')](_0x1b436e[_0xaf07('0x2f')],_0x1b436e[_0xaf07('0x31')]);_0x3b0709[_0xaf07('0x35')]=_[_0xaf07('0x34')](_0x1b436e[_0xaf07('0x2f')],qs[_0xaf07('0x36')](_0x3d331a[_0xaf07('0x31')][_0xaf07('0x36')]));_0x3b0709['attributes']=_0x3b0709[_0xaf07('0x35')][_0xaf07('0x37')]?_0x3b0709[_0xaf07('0x35')]:_0x1b436e[_0xaf07('0x2f')];_0x3b0709[_0xaf07('0x3a')]=qs['sort'](_0x3d331a[_0xaf07('0x31')]['sort']);_0x3b0709[_0xaf07('0x3c')]=qs[_0xaf07('0x33')](_[_0xaf07('0x3d')](_0x3d331a['query'],_0x1b436e[_0xaf07('0x33')]));if(_0x3d331a[_0xaf07('0x31')][_0xaf07('0x3e')]){_0x3b0709[_0xaf07('0x3c')]=_[_0xaf07('0x3f')](_0x3b0709['where'],{'$or':_[_0xaf07('0x30')](_0x3b0709[_0xaf07('0x35')],function(_0x25a192){var _0x331d2a={};_0x331d2a[_0x25a192]={'$like':'%'+_0x3d331a[_0xaf07('0x31')][_0xaf07('0x3e')]+'%'};return _0x331d2a;})});}_0x3b0709=_[_0xaf07('0x3f')]({},_0x3b0709,_0x3d331a[_0xaf07('0x40')]);return _0x5ba11f['getConfigurations'](_0x3b0709);}})[_0xaf07('0x24')](function(_0x16f2f7){if(_0x16f2f7){_0x16a87e=_0x16f2f7[_0xaf07('0x37')];if(!_0x3d331a[_0xaf07('0x31')][_0xaf07('0x38')](_0xaf07('0x39'))){_0x3b0709[_0xaf07('0x1f')]=qs[_0xaf07('0x1f')](_0x3d331a[_0xaf07('0x31')]['limit']);_0x3b0709[_0xaf07('0x1d')]=qs[_0xaf07('0x1d')](_0x3d331a[_0xaf07('0x31')][_0xaf07('0x1d')]);}return _0x5ba11f[_0xaf07('0x4b')](_0x3b0709);}})[_0xaf07('0x24')](function(_0x5b07dc){if(_0x5b07dc){return _0x5b07dc?{'count':_0x16a87e,'rows':_0x5b07dc}:null;}})[_0xaf07('0x24')](respondWithResult(_0x3d8309,null))[_0xaf07('0x46')](handleError(_0x3d8309,null));};exports[_0xaf07('0x4e')]=function(_0x1c6ccb,_0x3e5279,_0x37d793){if(_0x1c6ccb['body']['id']){delete _0x1c6ccb[_0xaf07('0x4a')]['id'];}return db[_0xaf07('0x41')][_0xaf07('0x4c')]({'where':{'id':_0x1c6ccb[_0xaf07('0x47')]['id']}})[_0xaf07('0x24')](handleEntityNotFound(_0x3e5279,null))[_0xaf07('0x24')](function(_0x41247d){if(_0x41247d){_0x1c6ccb[_0xaf07('0x4a')]['AccountId']=_0x41247d['id'];_0x1c6ccb[_0xaf07('0x4a')][_0xaf07('0x4f')]=integrations[_0xaf07('0x50')](_0x1c6ccb[_0xaf07('0x4a')][_0xaf07('0x51')],_0x1c6ccb['body']['type']);_0x1c6ccb[_0xaf07('0x4a')][_0xaf07('0x52')]=integrations[_0xaf07('0x53')](_0x1c6ccb['body'][_0xaf07('0x51')],_0x1c6ccb[_0xaf07('0x4a')][_0xaf07('0x2e')]);return db[_0xaf07('0x4d')]['create'](_0x1c6ccb[_0xaf07('0x4a')],{'include':[{'model':db[_0xaf07('0x54')],'as':_0xaf07('0x4f')},{'model':db[_0xaf07('0x54')],'as':_0xaf07('0x52')}]});}return null;})[_0xaf07('0x24')](respondWithResult(_0x3e5279,null))[_0xaf07('0x46')](handleError(_0x3e5279,null));};exports[_0xaf07('0x55')]=function(_0x32b9e0,_0x5530aa,_0x8a5b61){var _0x3d8fd0='';var _0x2c3b82='';return db['FreshsalesAccount'][_0xaf07('0x4c')]({'where':{'id':_0x32b9e0['params']['id']},'attributes':['id',_0xaf07('0x56'),_0xaf07('0x57'),_0xaf07('0x58')]})[_0xaf07('0x24')](handleEntityNotFound(_0x5530aa,null))['then'](function(_0x4e540a){if(_0x4e540a){_0x2c3b82=_0x4e540a['username'];_0x3d8fd0=_0x4e540a[_0xaf07('0x57')];var _0x424b86=_0x4e540a[_0xaf07('0x57')][_0xaf07('0x59')](-0x1);if(_0x424b86==='/'){_0x3d8fd0=_0x3d8fd0[_0xaf07('0x5a')](0x0,_0x3d8fd0[_0xaf07('0x5b')](_0x424b86));}return rp({'method':_0xaf07('0x5c'),'uri':util['format'](_0xaf07('0x5d'),_0x3d8fd0,_0xaf07('0x5e')),'headers':{'Authorization':'Token\x20token='+_0x4e540a[_0xaf07('0x58')]},'json':!![]});}})[_0xaf07('0x24')](function(_0x5d73ca){if(_0x5d73ca){var _0xe8b6c2=_0x5d73ca[_0xaf07('0x5f')];var _0x2800f9=![];var _0x2cd1b6=null;for(_0x2cd1b6=0x0;_0x2cd1b6<_0xe8b6c2[_0xaf07('0x37')];_0x2cd1b6++){if(_0xe8b6c2[_0x2cd1b6][_0xaf07('0x60')]===_0x2c3b82){_0x2800f9=!![];}}if(_0x2800f9){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xaf07('0x61')});}}})[_0xaf07('0x24')](respondWithResult(_0x5530aa,null))[_0xaf07('0x46')](function(_0x591315){var _0x3a15ab=_0x32b9e0[_0xaf07('0x31')][_0xaf07('0x62')]?0x1f4:_0x591315[_0xaf07('0x63')]||0x1f4;logger[_0xaf07('0x27')](_0xaf07('0x64'),_0xaf07('0x55'),_0x3a15ab,JSON[_0xaf07('0x65')](_0x591315));delete _0x591315['name'];if(_0x3a15ab===0x191){_0x3a15ab=0x190;}_0x5530aa[_0xaf07('0x1b')](_0x3a15ab)[_0xaf07('0x2a')](_0x32b9e0[_0xaf07('0x31')]['test']?{'message':_0xaf07('0x66'),'statusCode':_0x591315[_0xaf07('0x63')]}:_0x591315);});}; \ No newline at end of file +var _0xd8a6=['querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','FreshsalesAccount','key','model','query','filters','intersection','attributes','fields','order','sort','where','pick','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','merge','find','create','body','findOne','FreshsalesConfiguration','hasOwnProperty','nolimit','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','FreshsalesField','getFields','apiKey','username','slice','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','email','test','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js'];(function(_0x586137,_0x4fb74e){var _0x3febfc=function(_0x574869){while(--_0x574869){_0x586137['push'](_0x586137['shift']());}};_0x3febfc(++_0x4fb74e);}(_0xd8a6,0x1e1));var _0x6d8a=function(_0x5d401c,_0x16b432){_0x5d401c=_0x5d401c-0x0;var _0x1e9c2e=_0xd8a6[_0x5d401c];return _0x1e9c2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6d8a('0x0'));var zipdir=require(_0x6d8a('0x1'));var jsonpatch=require(_0x6d8a('0x2'));var rp=require(_0x6d8a('0x3'));var moment=require(_0x6d8a('0x4'));var BPromise=require(_0x6d8a('0x5'));var Mustache=require(_0x6d8a('0x6'));var util=require('util');var path=require(_0x6d8a('0x7'));var sox=require('sox');var csv=require(_0x6d8a('0x8'));var ejs=require(_0x6d8a('0x9'));var fs=require('fs');var fs_extra=require(_0x6d8a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6d8a('0xb'));var jsforce=require(_0x6d8a('0xc'));var deskjs=require(_0x6d8a('0xd'));var toCsv=require(_0x6d8a('0x8'));var querystring=require(_0x6d8a('0xe'));var Papa=require(_0x6d8a('0xf'));var Redis=require(_0x6d8a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d8a('0x11'));var logger=require('../../config/logger')(_0x6d8a('0x12'));var utils=require('../../config/utils');var config=require(_0x6d8a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d8a('0x14'))['db'];var integrations=require(_0x6d8a('0x15'));function respondWithStatusCode(_0x59d008,_0x15fa32){_0x15fa32=_0x15fa32||0xcc;return function(_0x892d1e){if(_0x892d1e){return _0x59d008[_0x6d8a('0x16')](_0x15fa32);}return _0x59d008['status'](_0x15fa32)[_0x6d8a('0x17')]();};}function respondWithResult(_0x5113bb,_0x2aae54){_0x2aae54=_0x2aae54||0xc8;return function(_0x1f0ef6){if(_0x1f0ef6){return _0x5113bb[_0x6d8a('0x18')](_0x2aae54)[_0x6d8a('0x19')](_0x1f0ef6);}};}function respondWithFilteredResult(_0x42809c,_0x10599b){return function(_0x5e5509){if(_0x5e5509){var _0x1c7b7e=typeof _0x10599b[_0x6d8a('0x1a')]==='undefined'&&typeof _0x10599b[_0x6d8a('0x1b')]===_0x6d8a('0x1c');var _0x32bb51=_0x5e5509[_0x6d8a('0x1d')];var _0xadb4c3=_0x1c7b7e?0x0:_0x10599b[_0x6d8a('0x1a')];var _0x1707ac=_0x1c7b7e?_0x5e5509[_0x6d8a('0x1d')]:_0x10599b[_0x6d8a('0x1a')]+_0x10599b['limit'];var _0x5a57a1;if(_0x1707ac>=_0x32bb51){_0x1707ac=_0x32bb51;_0x5a57a1=0xc8;}else{_0x5a57a1=0xce;}_0x42809c[_0x6d8a('0x18')](_0x5a57a1);return _0x42809c[_0x6d8a('0x1e')](_0x6d8a('0x1f'),_0xadb4c3+'-'+_0x1707ac+'/'+_0x32bb51)[_0x6d8a('0x19')](_0x5e5509);}return null;};}function patchUpdates(_0x401b6a){return function(_0x4118d5){try{jsonpatch['apply'](_0x4118d5,_0x401b6a,!![]);}catch(_0x2ce9dc){return BPromise[_0x6d8a('0x20')](_0x2ce9dc);}return _0x4118d5[_0x6d8a('0x21')]();};}function saveUpdates(_0x20b7a8,_0x29d032){return function(_0x1b194b){if(_0x1b194b){return _0x1b194b[_0x6d8a('0x22')](_0x20b7a8)[_0x6d8a('0x23')](function(_0xca3677){return _0xca3677;});}return null;};}function removeEntity(_0xaaa697,_0x5534ff){return function(_0x1b2eb1){if(_0x1b2eb1){return _0x1b2eb1[_0x6d8a('0x24')]()[_0x6d8a('0x23')](function(){_0xaaa697[_0x6d8a('0x18')](0xcc)[_0x6d8a('0x17')]();});}};}function handleEntityNotFound(_0xf328b6,_0x2907c2){return function(_0x3c8061){if(!_0x3c8061){_0xf328b6[_0x6d8a('0x16')](0x194);}return _0x3c8061;};}function handleError(_0x1c98a5,_0x4221d6){_0x4221d6=_0x4221d6||0x1f4;return function(_0x286c73){logger['error'](_0x286c73[_0x6d8a('0x25')]);if(_0x286c73[_0x6d8a('0x26')]){delete _0x286c73[_0x6d8a('0x26')];}_0x1c98a5[_0x6d8a('0x18')](_0x4221d6)[_0x6d8a('0x27')](_0x286c73);};}exports[_0x6d8a('0x28')]=function(_0x5c55f7,_0x103ff4){var _0x3fc576={},_0x128214={},_0x61a39a={'count':0x0,'rows':[]};var _0x4e47a3=_[_0x6d8a('0x29')](db[_0x6d8a('0x2a')]['rawAttributes'],function(_0x50894e){return{'name':_0x50894e['fieldName'],'type':_0x50894e['type'][_0x6d8a('0x2b')]};});_0x128214[_0x6d8a('0x2c')]=_[_0x6d8a('0x29')](_0x4e47a3,_0x6d8a('0x26'));_0x128214[_0x6d8a('0x2d')]=_['keys'](_0x5c55f7['query']);_0x128214[_0x6d8a('0x2e')]=_[_0x6d8a('0x2f')](_0x128214[_0x6d8a('0x2c')],_0x128214[_0x6d8a('0x2d')]);_0x3fc576[_0x6d8a('0x30')]=_[_0x6d8a('0x2f')](_0x128214[_0x6d8a('0x2c')],qs[_0x6d8a('0x31')](_0x5c55f7[_0x6d8a('0x2d')][_0x6d8a('0x31')]));_0x3fc576[_0x6d8a('0x30')]=_0x3fc576[_0x6d8a('0x30')]['length']?_0x3fc576['attributes']:_0x128214[_0x6d8a('0x2c')];if(!_0x5c55f7[_0x6d8a('0x2d')]['hasOwnProperty']('nolimit')){_0x3fc576['limit']=qs[_0x6d8a('0x1b')](_0x5c55f7[_0x6d8a('0x2d')][_0x6d8a('0x1b')]);_0x3fc576[_0x6d8a('0x1a')]=qs[_0x6d8a('0x1a')](_0x5c55f7[_0x6d8a('0x2d')][_0x6d8a('0x1a')]);}_0x3fc576[_0x6d8a('0x32')]=qs[_0x6d8a('0x33')](_0x5c55f7[_0x6d8a('0x2d')][_0x6d8a('0x33')]);_0x3fc576[_0x6d8a('0x34')]=qs['filters'](_[_0x6d8a('0x35')](_0x5c55f7[_0x6d8a('0x2d')],_0x128214['filters']),_0x4e47a3);if(_0x5c55f7['query']['filter']){_0x3fc576[_0x6d8a('0x34')]=_['merge'](_0x3fc576[_0x6d8a('0x34')],{'$or':_[_0x6d8a('0x29')](_0x4e47a3,function(_0x42842e){if(_0x42842e[_0x6d8a('0x36')]!==_0x6d8a('0x37')){var _0x53e4d4={};_0x53e4d4[_0x42842e[_0x6d8a('0x26')]]={'$like':'%'+_0x5c55f7[_0x6d8a('0x2d')][_0x6d8a('0x38')]+'%'};return _0x53e4d4;}})});}_0x3fc576=_['merge']({},_0x3fc576,_0x5c55f7[_0x6d8a('0x39')]);var _0x1e6b68={'where':_0x3fc576[_0x6d8a('0x34')]};return db[_0x6d8a('0x2a')][_0x6d8a('0x1d')](_0x1e6b68)['then'](function(_0x5d35f0){_0x61a39a[_0x6d8a('0x1d')]=_0x5d35f0;if(_0x5c55f7['query'][_0x6d8a('0x3a')]){_0x3fc576[_0x6d8a('0x3b')]=[{'all':!![]}];}return db[_0x6d8a('0x2a')][_0x6d8a('0x3c')](_0x3fc576);})['then'](function(_0x5525a1){_0x61a39a[_0x6d8a('0x3d')]=_0x5525a1;return _0x61a39a;})[_0x6d8a('0x23')](respondWithFilteredResult(_0x103ff4,_0x3fc576))[_0x6d8a('0x3e')](handleError(_0x103ff4,null));};exports[_0x6d8a('0x3f')]=function(_0x24fa37,_0x2f104c){var _0x180e28={'raw':![],'where':{'id':_0x24fa37[_0x6d8a('0x40')]['id']}},_0x5984b1={};_0x5984b1[_0x6d8a('0x2c')]=_[_0x6d8a('0x41')](db[_0x6d8a('0x2a')][_0x6d8a('0x42')]);_0x5984b1[_0x6d8a('0x2d')]=_['keys'](_0x24fa37[_0x6d8a('0x2d')]);_0x5984b1[_0x6d8a('0x2e')]=_[_0x6d8a('0x2f')](_0x5984b1[_0x6d8a('0x2c')],_0x5984b1[_0x6d8a('0x2d')]);_0x180e28[_0x6d8a('0x30')]=_[_0x6d8a('0x2f')](_0x5984b1['model'],qs[_0x6d8a('0x31')](_0x24fa37[_0x6d8a('0x2d')][_0x6d8a('0x31')]));_0x180e28[_0x6d8a('0x30')]=_0x180e28[_0x6d8a('0x30')][_0x6d8a('0x43')]?_0x180e28[_0x6d8a('0x30')]:_0x5984b1[_0x6d8a('0x2c')];if(_0x24fa37[_0x6d8a('0x2d')][_0x6d8a('0x3a')]){_0x180e28[_0x6d8a('0x3b')]=[{'all':!![]}];}_0x180e28=_[_0x6d8a('0x44')]({},_0x180e28,_0x24fa37['options']);return db[_0x6d8a('0x2a')][_0x6d8a('0x45')](_0x180e28)[_0x6d8a('0x23')](handleEntityNotFound(_0x2f104c,null))['then'](respondWithResult(_0x2f104c,null))['catch'](handleError(_0x2f104c,null));};exports[_0x6d8a('0x46')]=function(_0x479704,_0x29f4a7){return db[_0x6d8a('0x2a')][_0x6d8a('0x46')](_0x479704[_0x6d8a('0x47')],{})[_0x6d8a('0x23')](respondWithResult(_0x29f4a7,0xc9))[_0x6d8a('0x3e')](handleError(_0x29f4a7,null));};exports[_0x6d8a('0x22')]=function(_0x4a5b17,_0x39051b){if(_0x4a5b17[_0x6d8a('0x47')]['id']){delete _0x4a5b17[_0x6d8a('0x47')]['id'];}return db[_0x6d8a('0x2a')][_0x6d8a('0x45')]({'where':{'id':_0x4a5b17[_0x6d8a('0x40')]['id']}})[_0x6d8a('0x23')](handleEntityNotFound(_0x39051b,null))[_0x6d8a('0x23')](saveUpdates(_0x4a5b17[_0x6d8a('0x47')],null))['then'](respondWithResult(_0x39051b,null))[_0x6d8a('0x3e')](handleError(_0x39051b,null));};exports['destroy']=function(_0x641108,_0x554182){return db[_0x6d8a('0x2a')][_0x6d8a('0x45')]({'where':{'id':_0x641108[_0x6d8a('0x40')]['id']}})[_0x6d8a('0x23')](handleEntityNotFound(_0x554182,null))[_0x6d8a('0x23')](removeEntity(_0x554182,null))[_0x6d8a('0x3e')](handleError(_0x554182,null));};exports['getConfigurations']=function(_0x4b0789,_0x2477a8,_0x1c080d){var _0x2ab08a={};var _0x152102={};var _0x3f2838;var _0x4ca57b;return db['FreshsalesAccount'][_0x6d8a('0x48')]({'where':{'id':_0x4b0789[_0x6d8a('0x40')]['id']}})[_0x6d8a('0x23')](handleEntityNotFound(_0x2477a8,null))[_0x6d8a('0x23')](function(_0x564a57){if(_0x564a57){_0x3f2838=_0x564a57;_0x152102[_0x6d8a('0x2c')]=_[_0x6d8a('0x41')](db[_0x6d8a('0x49')][_0x6d8a('0x42')]);_0x152102[_0x6d8a('0x2d')]=_['keys'](_0x4b0789[_0x6d8a('0x2d')]);_0x152102['filters']=_['intersection'](_0x152102[_0x6d8a('0x2c')],_0x152102[_0x6d8a('0x2d')]);_0x2ab08a[_0x6d8a('0x30')]=_[_0x6d8a('0x2f')](_0x152102[_0x6d8a('0x2c')],qs[_0x6d8a('0x31')](_0x4b0789['query'][_0x6d8a('0x31')]));_0x2ab08a[_0x6d8a('0x30')]=_0x2ab08a['attributes'][_0x6d8a('0x43')]?_0x2ab08a[_0x6d8a('0x30')]:_0x152102[_0x6d8a('0x2c')];_0x2ab08a[_0x6d8a('0x32')]=qs[_0x6d8a('0x33')](_0x4b0789[_0x6d8a('0x2d')][_0x6d8a('0x33')]);_0x2ab08a[_0x6d8a('0x34')]=qs['filters'](_[_0x6d8a('0x35')](_0x4b0789['query'],_0x152102[_0x6d8a('0x2e')]));if(_0x4b0789[_0x6d8a('0x2d')]['filter']){_0x2ab08a['where']=_[_0x6d8a('0x44')](_0x2ab08a[_0x6d8a('0x34')],{'$or':_[_0x6d8a('0x29')](_0x2ab08a[_0x6d8a('0x30')],function(_0x51130e){var _0xe22ce0={};_0xe22ce0[_0x51130e]={'$like':'%'+_0x4b0789[_0x6d8a('0x2d')]['filter']+'%'};return _0xe22ce0;})});}_0x2ab08a=_[_0x6d8a('0x44')]({},_0x2ab08a,_0x4b0789[_0x6d8a('0x39')]);return _0x3f2838['getConfigurations'](_0x2ab08a);}})['then'](function(_0x387b6c){if(_0x387b6c){_0x4ca57b=_0x387b6c[_0x6d8a('0x43')];if(!_0x4b0789[_0x6d8a('0x2d')][_0x6d8a('0x4a')](_0x6d8a('0x4b'))){_0x2ab08a[_0x6d8a('0x1b')]=qs[_0x6d8a('0x1b')](_0x4b0789['query'][_0x6d8a('0x1b')]);_0x2ab08a[_0x6d8a('0x1a')]=qs[_0x6d8a('0x1a')](_0x4b0789[_0x6d8a('0x2d')]['offset']);}return _0x3f2838[_0x6d8a('0x4c')](_0x2ab08a);}})['then'](function(_0x5af637){if(_0x5af637){return _0x5af637?{'count':_0x4ca57b,'rows':_0x5af637}:null;}})[_0x6d8a('0x23')](respondWithResult(_0x2477a8,null))[_0x6d8a('0x3e')](handleError(_0x2477a8,null));};exports[_0x6d8a('0x4d')]=function(_0x59631f,_0x11a031,_0xac84de){if(_0x59631f[_0x6d8a('0x47')]['id']){delete _0x59631f['body']['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x59631f[_0x6d8a('0x40')]['id']}})[_0x6d8a('0x23')](handleEntityNotFound(_0x11a031,null))['then'](function(_0x3a64c0){if(_0x3a64c0){_0x59631f[_0x6d8a('0x47')]['AccountId']=_0x3a64c0['id'];_0x59631f['body'][_0x6d8a('0x4e')]=integrations[_0x6d8a('0x4f')](_0x59631f['body'][_0x6d8a('0x50')],_0x59631f['body'][_0x6d8a('0x36')]);_0x59631f[_0x6d8a('0x47')][_0x6d8a('0x51')]=integrations['getDescriptions'](_0x59631f[_0x6d8a('0x47')]['channel'],_0x59631f[_0x6d8a('0x47')][_0x6d8a('0x36')]);return db[_0x6d8a('0x49')][_0x6d8a('0x46')](_0x59631f[_0x6d8a('0x47')],{'include':[{'model':db[_0x6d8a('0x52')],'as':_0x6d8a('0x4e')},{'model':db[_0x6d8a('0x52')],'as':_0x6d8a('0x51')}]});}return null;})[_0x6d8a('0x23')](respondWithResult(_0x11a031,null))['catch'](handleError(_0x11a031,null));};exports[_0x6d8a('0x53')]=function(_0x2e92a2,_0x213923,_0xfca730){var _0x239591='';var _0x19efe1='';return db['FreshsalesAccount'][_0x6d8a('0x48')]({'where':{'id':_0x2e92a2[_0x6d8a('0x40')]['id']},'attributes':['id','username','remoteUri',_0x6d8a('0x54')]})[_0x6d8a('0x23')](handleEntityNotFound(_0x213923,null))[_0x6d8a('0x23')](function(_0xe87b32){if(_0xe87b32){_0x19efe1=_0xe87b32[_0x6d8a('0x55')];_0x239591=_0xe87b32['remoteUri'];var _0x3cb69d=_0xe87b32['remoteUri'][_0x6d8a('0x56')](-0x1);if(_0x3cb69d==='/'){_0x239591=_0x239591[_0x6d8a('0x57')](0x0,_0x239591[_0x6d8a('0x58')](_0x3cb69d));}return rp({'method':'GET','uri':util[_0x6d8a('0x59')](_0x6d8a('0x5a'),_0x239591,_0x6d8a('0x5b')),'headers':{'Authorization':_0x6d8a('0x5c')+_0xe87b32[_0x6d8a('0x54')]},'json':!![]});}})[_0x6d8a('0x23')](function(_0x2b5df5){if(_0x2b5df5){var _0x4c1537=_0x2b5df5['users'];var _0x5ab57f=![];var _0x211568=null;for(_0x211568=0x0;_0x211568<_0x4c1537[_0x6d8a('0x43')];_0x211568++){if(_0x4c1537[_0x211568][_0x6d8a('0x5d')]===_0x19efe1){_0x5ab57f=!![];}}if(_0x5ab57f){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x213923,null))[_0x6d8a('0x3e')](function(_0x406a38){var _0x205f51=_0x2e92a2[_0x6d8a('0x2d')][_0x6d8a('0x5e')]?0x1f4:_0x406a38['statusCode']||0x1f4;logger[_0x6d8a('0x5f')](_0x6d8a('0x60'),_0x6d8a('0x53'),_0x205f51,JSON['stringify'](_0x406a38));delete _0x406a38['name'];if(_0x205f51===0x191){_0x205f51=0x190;}_0x213923[_0x6d8a('0x18')](_0x205f51)[_0x6d8a('0x27')](_0x2e92a2[_0x6d8a('0x2d')][_0x6d8a('0x5e')]?{'message':_0x6d8a('0x61'),'statusCode':_0x406a38[_0x6d8a('0x62')]}:_0x406a38);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index fedb162..949e4f3 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 _0x323f=['exports','define','FreshsalesAccount','int_freshsales_accounts','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x2a49c3,_0x2ba31d){var _0x5cb8c9=function(_0x1e5c29){while(--_0x1e5c29){_0x2a49c3['push'](_0x2a49c3['shift']());}};_0x5cb8c9(++_0x2ba31d);}(_0x323f,0x1ee));var _0xf323=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x323f[_0xbca1b1];return _0x4e1686;};'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 +var _0x4137=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','lodash','util','../../config/logger','api'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4137,0xf8));var _0x7413=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x4137[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var logger=require(_0x7413('0x2'))(_0x7413('0x3'));var moment=require(_0x7413('0x4'));var BPromise=require(_0x7413('0x5'));var rp=require(_0x7413('0x6'));var fs=require('fs');var path=require(_0x7413('0x7'));var rimraf=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var attributes=require(_0x7413('0xa'));var integrations=require(_0x7413('0xb'));module['exports']=function(_0xc808cd,_0x188d89){return _0xc808cd[_0x7413('0xc')](_0x7413('0xd'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index c7ebc97..0ee8ef0 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 _0x32b6=['raw','where','attributes','limit','include','map','model','catch','ShowFreshsalesAccount','find','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','info','GetFreshsalesAccount','FreshsalesAccount','findAll','options'];(function(_0x7a695e,_0x3517c8){var _0x4438a1=function(_0x18f274){while(--_0x18f274){_0x7a695e['push'](_0x7a695e['shift']());}};_0x4438a1(++_0x3517c8);}(_0x32b6,0x1d1));var _0x632b=function(_0x1bc241,_0x592c62){_0x1bc241=_0x1bc241-0x0;var _0x46616d=_0x32b6[_0x1bc241];return _0x46616d;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});}exports[_0x632b('0x15')]=function(_0x3bb27f){var _0x28c472=this;return new Promise(function(_0x51c894,_0x2f3e88){return db[_0x632b('0x16')][_0x632b('0x17')]({'raw':_0x3bb27f[_0x632b('0x18')]?_0x3bb27f['options'][_0x632b('0x19')]===undefined?!![]:![]:!![],'where':_0x3bb27f[_0x632b('0x18')]?_0x3bb27f['options'][_0x632b('0x1a')]||null:null,'attributes':_0x3bb27f['options']?_0x3bb27f['options'][_0x632b('0x1b')]||null:null,'limit':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x18')][_0x632b('0x1c')]||null:null,'include':_0x3bb27f[_0x632b('0x18')]?_0x3bb27f['options'][_0x632b('0x1d')]?_[_0x632b('0x1e')](_0x3bb27f['options'][_0x632b('0x1d')],function(_0x379dc2){return{'model':db[_0x379dc2[_0x632b('0x1f')]],'as':_0x379dc2['as'],'attributes':_0x379dc2[_0x632b('0x1b')],'include':_0x379dc2[_0x632b('0x1d')]?_[_0x632b('0x1e')](_0x379dc2['include'],function(_0x5e7b20){return{'model':db[_0x5e7b20[_0x632b('0x1f')]],'as':_0x5e7b20['as'],'attributes':_0x5e7b20['attributes'],'include':_0x5e7b20[_0x632b('0x1d')]?_[_0x632b('0x1e')](_0x5e7b20['include'],function(_0x273e89){return{'model':db[_0x273e89[_0x632b('0x1f')]],'as':_0x273e89['as'],'attributes':_0x273e89[_0x632b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x632b('0xc')](function(_0x4728a8){logger[_0x632b('0x14')](_0x632b('0x15'),_0x3bb27f);logger[_0x632b('0xd')](_0x632b('0x15'),_0x3bb27f,JSON['stringify'](_0x4728a8));_0x51c894(_0x4728a8);})[_0x632b('0x20')](function(_0x35348e){logger[_0x632b('0x10')](_0x632b('0x15'),_0x35348e[_0x632b('0x13')],_0x3bb27f);_0x2f3e88(_0x28c472[_0x632b('0x10')](0x1f4,_0x35348e[_0x632b('0x13')]));});});};exports[_0x632b('0x21')]=function(_0x1ace1b){var _0x319df3=this;return new Promise(function(_0x417793,_0x35584f){return db[_0x632b('0x16')][_0x632b('0x22')]({'raw':_0x1ace1b[_0x632b('0x18')]?_0x1ace1b[_0x632b('0x18')][_0x632b('0x19')]===undefined?!![]:![]:!![],'where':_0x1ace1b[_0x632b('0x18')]?_0x1ace1b[_0x632b('0x18')][_0x632b('0x1a')]||null:null,'attributes':_0x1ace1b['options']?_0x1ace1b[_0x632b('0x18')][_0x632b('0x1b')]||null:null,'include':_0x1ace1b[_0x632b('0x18')]?_0x1ace1b[_0x632b('0x18')]['include']?_[_0x632b('0x1e')](_0x1ace1b['options'][_0x632b('0x1d')],function(_0x15b22d){return{'model':db[_0x15b22d['model']],'as':_0x15b22d['as'],'attributes':_0x15b22d[_0x632b('0x1b')],'include':_0x15b22d[_0x632b('0x1d')]?_[_0x632b('0x1e')](_0x15b22d[_0x632b('0x1d')],function(_0x27bbf5){return{'model':db[_0x27bbf5[_0x632b('0x1f')]],'as':_0x27bbf5['as'],'attributes':_0x27bbf5[_0x632b('0x1b')],'include':_0x27bbf5[_0x632b('0x1d')]?_['map'](_0x27bbf5['include'],function(_0x22ae6a){return{'model':db[_0x22ae6a[_0x632b('0x1f')]],'as':_0x22ae6a['as'],'attributes':_0x22ae6a[_0x632b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x632b('0xc')](function(_0x384420){logger[_0x632b('0x14')](_0x632b('0x21'),_0x1ace1b);logger[_0x632b('0xd')]('ShowFreshsalesAccount',_0x1ace1b,JSON['stringify'](_0x384420));_0x417793(_0x384420);})[_0x632b('0x20')](function(_0x581b92){logger[_0x632b('0x10')](_0x632b('0x21'),_0x581b92[_0x632b('0x13')],_0x1ace1b);_0x35584f(_0x319df3[_0x632b('0x10')](0x1f4,_0x581b92[_0x632b('0x13')]));});});}; \ No newline at end of file +var _0x5fab=['map','model','info','ShowFreshsalesAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesAccount,\x20%s,\x20%s','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','include','attributes'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5fab,0x177));var _0xb5fa=function(_0xf4d811,_0x11d532){_0xf4d811=_0xf4d811-0x0;var _0x1677f9=_0x5fab[_0xf4d811];return _0x1677f9;};'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']('FreshsalesAccount,\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')]('FreshsalesAccount,\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']('FreshsalesAccount,\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);});});}exports[_0xb5fa('0x18')]=function(_0x32e9e5){var _0x46eef0=this;return new Promise(function(_0x324ba5,_0x13e82b){return db[_0xb5fa('0x19')][_0xb5fa('0x1a')]({'raw':_0x32e9e5[_0xb5fa('0x1b')]?_0x32e9e5[_0xb5fa('0x1b')][_0xb5fa('0x1c')]===undefined?!![]:![]:!![],'where':_0x32e9e5[_0xb5fa('0x1b')]?_0x32e9e5['options'][_0xb5fa('0x1d')]||null:null,'attributes':_0x32e9e5['options']?_0x32e9e5[_0xb5fa('0x1b')]['attributes']||null:null,'limit':_0x32e9e5[_0xb5fa('0x1b')]?_0x32e9e5[_0xb5fa('0x1b')]['limit']||null:null,'include':_0x32e9e5[_0xb5fa('0x1b')]?_0x32e9e5[_0xb5fa('0x1b')][_0xb5fa('0x1e')]?_['map'](_0x32e9e5[_0xb5fa('0x1b')][_0xb5fa('0x1e')],function(_0x444237){return{'model':db[_0x444237['model']],'as':_0x444237['as'],'attributes':_0x444237[_0xb5fa('0x1f')],'include':_0x444237['include']?_[_0xb5fa('0x20')](_0x444237[_0xb5fa('0x1e')],function(_0x11053a){return{'model':db[_0x11053a[_0xb5fa('0x21')]],'as':_0x11053a['as'],'attributes':_0x11053a[_0xb5fa('0x1f')],'include':_0x11053a[_0xb5fa('0x1e')]?_[_0xb5fa('0x20')](_0x11053a[_0xb5fa('0x1e')],function(_0x568870){return{'model':db[_0x568870['model']],'as':_0x568870['as'],'attributes':_0x568870['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x28a350){logger[_0xb5fa('0x22')](_0xb5fa('0x18'),_0x32e9e5);logger[_0xb5fa('0xf')](_0xb5fa('0x18'),_0x32e9e5,JSON[_0xb5fa('0x11')](_0x28a350));_0x324ba5(_0x28a350);})[_0xb5fa('0x17')](function(_0x353314){logger[_0xb5fa('0x12')](_0xb5fa('0x18'),_0x353314[_0xb5fa('0x14')],_0x32e9e5);_0x13e82b(_0x46eef0[_0xb5fa('0x12')](0x1f4,_0x353314[_0xb5fa('0x14')]));});});};exports[_0xb5fa('0x23')]=function(_0xed02e){var _0x116773=this;return new Promise(function(_0x5a0152,_0x3fd1fb){return db[_0xb5fa('0x19')][_0xb5fa('0x24')]({'raw':_0xed02e[_0xb5fa('0x1b')]?_0xed02e[_0xb5fa('0x1b')][_0xb5fa('0x1c')]===undefined?!![]:![]:!![],'where':_0xed02e[_0xb5fa('0x1b')]?_0xed02e['options'][_0xb5fa('0x1d')]||null:null,'attributes':_0xed02e['options']?_0xed02e['options']['attributes']||null:null,'include':_0xed02e[_0xb5fa('0x1b')]?_0xed02e['options'][_0xb5fa('0x1e')]?_['map'](_0xed02e['options'][_0xb5fa('0x1e')],function(_0x934b49){return{'model':db[_0x934b49['model']],'as':_0x934b49['as'],'attributes':_0x934b49['attributes'],'include':_0x934b49[_0xb5fa('0x1e')]?_[_0xb5fa('0x20')](_0x934b49[_0xb5fa('0x1e')],function(_0x560b53){return{'model':db[_0x560b53[_0xb5fa('0x21')]],'as':_0x560b53['as'],'attributes':_0x560b53[_0xb5fa('0x1f')],'include':_0x560b53['include']?_[_0xb5fa('0x20')](_0x560b53[_0xb5fa('0x1e')],function(_0x204d6b){return{'model':db[_0x204d6b['model']],'as':_0x204d6b['as'],'attributes':_0x204d6b[_0xb5fa('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb5fa('0xd')](function(_0x24ef11){logger['info'](_0xb5fa('0x23'),_0xed02e);logger[_0xb5fa('0xf')](_0xb5fa('0x23'),_0xed02e,JSON[_0xb5fa('0x11')](_0x24ef11));_0x5a0152(_0x24ef11);})['catch'](function(_0x4bba91){logger['error']('ShowFreshsalesAccount',_0x4bba91['message'],_0xed02e);_0x3fd1fb(_0x116773['error'](0x1f4,_0x4bba91[_0xb5fa('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 9442ff7..279db26 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 _0x69f2=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','get','show','/:id/subjects','getSubjects','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x32bbca,_0x284c41){var _0x1cf827=function(_0x30790b){while(--_0x30790b){_0x32bbca['push'](_0x32bbca['shift']());}};_0x1cf827(++_0x284c41);}(_0x69f2,0x10e));var _0x269f=function(_0x4f8f7b,_0x1f279a){_0x4f8f7b=_0x4f8f7b-0x0;var _0x1f7f07=_0x69f2[_0x4f8f7b];return _0x1f7f07;};'use strict';var multer=require(_0x269f('0x0'));var util=require(_0x269f('0x1'));var path=require('path');var timeout=require(_0x269f('0x2'));var express=require(_0x269f('0x3'));var router=express[_0x269f('0x4')]();var fs_extra=require(_0x269f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x269f('0x6'));var config=require(_0x269f('0x7'));var controller=require(_0x269f('0x8'));router['get']('/',auth[_0x269f('0x9')](),controller['index']);router[_0x269f('0xa')]('/:id',auth[_0x269f('0x9')](),controller[_0x269f('0xb')]);router[_0x269f('0xa')](_0x269f('0xc'),auth[_0x269f('0x9')](),controller[_0x269f('0xd')]);router[_0x269f('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router['get']('/:id/fields',auth[_0x269f('0x9')](),controller['getFields']);router['post']('/',auth[_0x269f('0x9')](),controller[_0x269f('0xe')]);router[_0x269f('0xf')](_0x269f('0x10'),auth[_0x269f('0x9')](),controller[_0x269f('0x11')]);router[_0x269f('0x12')](_0x269f('0x10'),auth[_0x269f('0x9')](),controller[_0x269f('0x13')]);module[_0x269f('0x14')]=router; \ No newline at end of file +var _0x136f=['index','/:id','show','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getFields','create','put','update','delete','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x310b96,_0x278a87){var _0x3c358=function(_0x1a0790){while(--_0x1a0790){_0x310b96['push'](_0x310b96['shift']());}};_0x3c358(++_0x278a87);}(_0x136f,0x92));var _0xf136=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x136f[_0x35da42];return _0x370035;};'use strict';var multer=require(_0xf136('0x0'));var util=require('util');var path=require(_0xf136('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf136('0x2')]();var fs_extra=require(_0xf136('0x3'));var auth=require(_0xf136('0x4'));var interaction=require(_0xf136('0x5'));var config=require(_0xf136('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth[_0xf136('0x7')](),controller[_0xf136('0x8')]);router['get'](_0xf136('0x9'),auth[_0xf136('0x7')](),controller[_0xf136('0xa')]);router[_0xf136('0xb')](_0xf136('0xc'),auth[_0xf136('0x7')](),controller[_0xf136('0xd')]);router['get'](_0xf136('0xe'),auth['isAuthenticated'](),controller[_0xf136('0xf')]);router[_0xf136('0xb')]('/:id/fields',auth[_0xf136('0x7')](),controller[_0xf136('0x10')]);router['post']('/',auth[_0xf136('0x7')](),controller[_0xf136('0x11')]);router[_0xf136('0x12')](_0xf136('0x9'),auth['isAuthenticated'](),controller[_0xf136('0x13')]);router[_0xf136('0x14')]('/:id',auth[_0xf136('0x7')](),controller['destroy']);module[_0xf136('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 6fb92eb..410bd5a 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 _0x00f5=['exports','STRING'];(function(_0x297034,_0x5a8945){var _0x51c13e=function(_0x566c83){while(--_0x566c83){_0x297034['push'](_0x297034['shift']());}};_0x51c13e(++_0x5a8945);}(_0x00f5,0x94));var _0x500f=function(_0x288485,_0x3671e9){_0x288485=_0x288485-0x0;var _0x392534=_0x00f5[_0x288485];return _0x392534;};'use strict';var Sequelize=require('sequelize');module[_0x500f('0x0')]={'name':{'type':Sequelize[_0x500f('0x1')]},'description':{'type':Sequelize[_0x500f('0x1')]}}; \ No newline at end of file +var _0xf403=['exports','STRING','sequelize'];(function(_0x2d64d2,_0x5a14e4){var _0x3f6fbe=function(_0x797cbd){while(--_0x797cbd){_0x2d64d2['push'](_0x2d64d2['shift']());}};_0x3f6fbe(++_0x5a14e4);}(_0xf403,0x182));var _0x3f40=function(_0x4f2a5b,_0x3eac97){_0x4f2a5b=_0x4f2a5b-0x0;var _0x2df3d2=_0xf403[_0x4f2a5b];return _0x2df3d2;};'use strict';var Sequelize=require(_0x3f40('0x0'));module[_0x3f40('0x1')]={'name':{'type':Sequelize[_0x3f40('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index c993c7a..ef5dbe2 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 _0xe91b=['index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','find','catch','create','body','destroy','findOne','FreshsalesField','getSubjects','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','stack','name','send'];(function(_0x5c7ad7,_0xd0b28f){var _0x5c0717=function(_0x4e36ab){while(--_0x4e36ab){_0x5c7ad7['push'](_0x5c7ad7['shift']());}};_0x5c0717(++_0xd0b28f);}(_0xe91b,0xce));var _0xbe91=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0xe91b[_0x280ae7];return _0x418b9e;};'use strict';var emlformat=require(_0xbe91('0x0'));var rimraf=require(_0xbe91('0x1'));var zipdir=require(_0xbe91('0x2'));var jsonpatch=require(_0xbe91('0x3'));var rp=require(_0xbe91('0x4'));var moment=require(_0xbe91('0x5'));var BPromise=require(_0xbe91('0x6'));var Mustache=require(_0xbe91('0x7'));var util=require('util');var path=require(_0xbe91('0x8'));var sox=require('sox');var csv=require(_0xbe91('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe91('0xa'));var _=require(_0xbe91('0xb'));var squel=require(_0xbe91('0xc'));var crypto=require(_0xbe91('0xd'));var jsforce=require(_0xbe91('0xe'));var deskjs=require(_0xbe91('0xf'));var toCsv=require(_0xbe91('0x9'));var querystring=require(_0xbe91('0x10'));var Papa=require(_0xbe91('0x11'));var Redis=require(_0xbe91('0x12'));var authService=require(_0xbe91('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xbe91('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe91('0x15'))(_0xbe91('0x16'));var utils=require(_0xbe91('0x17'));var config=require(_0xbe91('0x18'));var licenseUtil=require(_0xbe91('0x19'));var db=require(_0xbe91('0x1a'))['db'];function respondWithStatusCode(_0x3727ad,_0x12811a){_0x12811a=_0x12811a||0xcc;return function(_0x192078){if(_0x192078){return _0x3727ad[_0xbe91('0x1b')](_0x12811a);}return _0x3727ad[_0xbe91('0x1c')](_0x12811a)[_0xbe91('0x1d')]();};}function respondWithResult(_0x10da6b,_0x3280b0){_0x3280b0=_0x3280b0||0xc8;return function(_0x98d383){if(_0x98d383){return _0x10da6b[_0xbe91('0x1c')](_0x3280b0)[_0xbe91('0x1e')](_0x98d383);}};}function respondWithFilteredResult(_0x25aa53,_0x170359){return function(_0x2ac109){if(_0x2ac109){var _0x1f14d5=typeof _0x170359[_0xbe91('0x1f')]==='undefined'&&typeof _0x170359[_0xbe91('0x20')]==='undefined';var _0x3e5060=_0x2ac109[_0xbe91('0x21')];var _0x4085e3=_0x1f14d5?0x0:_0x170359['offset'];var _0x4a8f71=_0x1f14d5?_0x2ac109['count']:_0x170359[_0xbe91('0x1f')]+_0x170359[_0xbe91('0x20')];var _0x37b780;if(_0x4a8f71>=_0x3e5060){_0x4a8f71=_0x3e5060;_0x37b780=0xc8;}else{_0x37b780=0xce;}_0x25aa53[_0xbe91('0x1c')](_0x37b780);return _0x25aa53[_0xbe91('0x22')](_0xbe91('0x23'),_0x4085e3+'-'+_0x4a8f71+'/'+_0x3e5060)[_0xbe91('0x1e')](_0x2ac109);}return null;};}function patchUpdates(_0x1c5bbe){return function(_0x2ac32c){try{jsonpatch['apply'](_0x2ac32c,_0x1c5bbe,!![]);}catch(_0x21dc53){return BPromise[_0xbe91('0x24')](_0x21dc53);}return _0x2ac32c[_0xbe91('0x25')]();};}function saveUpdates(_0x4a3110,_0x37666e){return function(_0x412b46){if(_0x412b46){return _0x412b46[_0xbe91('0x26')](_0x4a3110)['then'](function(_0x29b47b){return _0x29b47b;});}return null;};}function removeEntity(_0x565ae6,_0x1ec07b){return function(_0x5c0466){if(_0x5c0466){return _0x5c0466['destroy']()[_0xbe91('0x27')](function(){_0x565ae6[_0xbe91('0x1c')](0xcc)[_0xbe91('0x1d')]();});}};}function handleEntityNotFound(_0x10a299,_0x5ec049){return function(_0x6d46f6){if(!_0x6d46f6){_0x10a299[_0xbe91('0x1b')](0x194);}return _0x6d46f6;};}function handleError(_0x5a1072,_0x297bcf){_0x297bcf=_0x297bcf||0x1f4;return function(_0x152cac){logger['error'](_0x152cac[_0xbe91('0x28')]);if(_0x152cac['name']){delete _0x152cac[_0xbe91('0x29')];}_0x5a1072[_0xbe91('0x1c')](_0x297bcf)[_0xbe91('0x2a')](_0x152cac);};}exports[_0xbe91('0x2b')]=function(_0xe6d372,_0x3ac1ba){var _0x551b11={},_0x3d0757={},_0x4727ce={'count':0x0,'rows':[]};var _0x44db3f=_[_0xbe91('0x2c')](db[_0xbe91('0x2d')][_0xbe91('0x2e')],function(_0x32f1c9){return{'name':_0x32f1c9[_0xbe91('0x2f')],'type':_0x32f1c9[_0xbe91('0x30')][_0xbe91('0x31')]};});_0x3d0757[_0xbe91('0x32')]=_[_0xbe91('0x2c')](_0x44db3f,'name');_0x3d0757[_0xbe91('0x33')]=_['keys'](_0xe6d372['query']);_0x3d0757['filters']=_[_0xbe91('0x34')](_0x3d0757[_0xbe91('0x32')],_0x3d0757[_0xbe91('0x33')]);_0x551b11['attributes']=_[_0xbe91('0x34')](_0x3d0757[_0xbe91('0x32')],qs[_0xbe91('0x35')](_0xe6d372[_0xbe91('0x33')][_0xbe91('0x35')]));_0x551b11['attributes']=_0x551b11['attributes'][_0xbe91('0x36')]?_0x551b11[_0xbe91('0x37')]:_0x3d0757[_0xbe91('0x32')];if(!_0xe6d372[_0xbe91('0x33')][_0xbe91('0x38')](_0xbe91('0x39'))){_0x551b11[_0xbe91('0x20')]=qs[_0xbe91('0x20')](_0xe6d372[_0xbe91('0x33')]['limit']);_0x551b11[_0xbe91('0x1f')]=qs[_0xbe91('0x1f')](_0xe6d372['query'][_0xbe91('0x1f')]);}_0x551b11[_0xbe91('0x3a')]=qs[_0xbe91('0x3b')](_0xe6d372['query'][_0xbe91('0x3b')]);_0x551b11[_0xbe91('0x3c')]=qs['filters'](_[_0xbe91('0x3d')](_0xe6d372['query'],_0x3d0757[_0xbe91('0x3e')]),_0x44db3f);if(_0xe6d372['query'][_0xbe91('0x3f')]){_0x551b11[_0xbe91('0x3c')]=_[_0xbe91('0x40')](_0x551b11[_0xbe91('0x3c')],{'$or':_[_0xbe91('0x2c')](_0x44db3f,function(_0x771003){if(_0x771003[_0xbe91('0x30')]!==_0xbe91('0x41')){var _0x2b407b={};_0x2b407b[_0x771003['name']]={'$like':'%'+_0xe6d372[_0xbe91('0x33')]['filter']+'%'};return _0x2b407b;}})});}_0x551b11=_[_0xbe91('0x40')]({},_0x551b11,_0xe6d372[_0xbe91('0x42')]);var _0x4738e2={'where':_0x551b11[_0xbe91('0x3c')]};return db[_0xbe91('0x2d')][_0xbe91('0x21')](_0x4738e2)[_0xbe91('0x27')](function(_0x3ab60c){_0x4727ce[_0xbe91('0x21')]=_0x3ab60c;if(_0xe6d372[_0xbe91('0x33')][_0xbe91('0x43')]){_0x551b11[_0xbe91('0x44')]=[{'all':!![]}];}return db[_0xbe91('0x2d')]['findAll'](_0x551b11);})[_0xbe91('0x27')](function(_0x4a1c51){_0x4727ce[_0xbe91('0x45')]=_0x4a1c51;return _0x4727ce;})['then'](respondWithFilteredResult(_0x3ac1ba,_0x551b11))['catch'](handleError(_0x3ac1ba,null));};exports[_0xbe91('0x46')]=function(_0x138c70,_0x3a44a7){var _0x295384={'raw':![],'where':{'id':_0x138c70[_0xbe91('0x47')]['id']}},_0x47fb8b={};_0x47fb8b[_0xbe91('0x32')]=_['keys'](db[_0xbe91('0x2d')][_0xbe91('0x2e')]);_0x47fb8b[_0xbe91('0x33')]=_[_0xbe91('0x48')](_0x138c70[_0xbe91('0x33')]);_0x47fb8b['filters']=_['intersection'](_0x47fb8b['model'],_0x47fb8b[_0xbe91('0x33')]);_0x295384[_0xbe91('0x37')]=_[_0xbe91('0x34')](_0x47fb8b[_0xbe91('0x32')],qs[_0xbe91('0x35')](_0x138c70[_0xbe91('0x33')][_0xbe91('0x35')]));_0x295384[_0xbe91('0x37')]=_0x295384[_0xbe91('0x37')][_0xbe91('0x36')]?_0x295384[_0xbe91('0x37')]:_0x47fb8b['model'];if(_0x138c70['query'][_0xbe91('0x43')]){_0x295384['include']=[{'all':!![]}];}_0x295384=_[_0xbe91('0x40')]({},_0x295384,_0x138c70[_0xbe91('0x42')]);return db['FreshsalesConfiguration'][_0xbe91('0x49')](_0x295384)['then'](handleEntityNotFound(_0x3a44a7,null))[_0xbe91('0x27')](respondWithResult(_0x3a44a7,null))[_0xbe91('0x4a')](handleError(_0x3a44a7,null));};exports[_0xbe91('0x4b')]=function(_0x223def,_0xaf6c6d){return db[_0xbe91('0x2d')][_0xbe91('0x4b')](_0x223def[_0xbe91('0x4c')],{})[_0xbe91('0x27')](respondWithResult(_0xaf6c6d,0xc9))[_0xbe91('0x4a')](handleError(_0xaf6c6d,null));};exports[_0xbe91('0x26')]=function(_0x25d466,_0x1ea051){if(_0x25d466[_0xbe91('0x4c')]['id']){delete _0x25d466[_0xbe91('0x4c')]['id'];}return db[_0xbe91('0x2d')]['find']({'where':{'id':_0x25d466[_0xbe91('0x47')]['id']}})[_0xbe91('0x27')](handleEntityNotFound(_0x1ea051,null))[_0xbe91('0x27')](saveUpdates(_0x25d466['body'],null))[_0xbe91('0x27')](respondWithResult(_0x1ea051,null))[_0xbe91('0x4a')](handleError(_0x1ea051,null));};exports[_0xbe91('0x4d')]=function(_0x26a0b2,_0x2ece75){return db['FreshsalesConfiguration'][_0xbe91('0x49')]({'where':{'id':_0x26a0b2[_0xbe91('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ece75,null))[_0xbe91('0x27')](removeEntity(_0x2ece75,null))[_0xbe91('0x4a')](handleError(_0x2ece75,null));};exports['getSubjects']=function(_0x756a44,_0x20e762,_0x1d54f8){var _0x42d685={};var _0x19535d={};var _0x14415b;var _0x63138e;return db[_0xbe91('0x2d')][_0xbe91('0x4e')]({'where':{'id':_0x756a44['params']['id']}})[_0xbe91('0x27')](handleEntityNotFound(_0x20e762,null))[_0xbe91('0x27')](function(_0xf092ad){if(_0xf092ad){_0x14415b=_0xf092ad;_0x19535d[_0xbe91('0x32')]=_[_0xbe91('0x48')](db[_0xbe91('0x4f')][_0xbe91('0x2e')]);_0x19535d['query']=_[_0xbe91('0x48')](_0x756a44['query']);_0x19535d[_0xbe91('0x3e')]=_[_0xbe91('0x34')](_0x19535d[_0xbe91('0x32')],_0x19535d[_0xbe91('0x33')]);_0x42d685[_0xbe91('0x37')]=_[_0xbe91('0x34')](_0x19535d[_0xbe91('0x32')],qs[_0xbe91('0x35')](_0x756a44['query'][_0xbe91('0x35')]));_0x42d685[_0xbe91('0x37')]=_0x42d685[_0xbe91('0x37')][_0xbe91('0x36')]?_0x42d685['attributes']:_0x19535d[_0xbe91('0x32')];_0x42d685[_0xbe91('0x3a')]=qs[_0xbe91('0x3b')](_0x756a44['query']['sort']);_0x42d685[_0xbe91('0x3c')]=qs[_0xbe91('0x3e')](_[_0xbe91('0x3d')](_0x756a44['query'],_0x19535d[_0xbe91('0x3e')]));if(_0x756a44[_0xbe91('0x33')][_0xbe91('0x3f')]){_0x42d685[_0xbe91('0x3c')]=_['merge'](_0x42d685[_0xbe91('0x3c')],{'$or':_['map'](_0x42d685[_0xbe91('0x37')],function(_0x4d1800){var _0x3656c9={};_0x3656c9[_0x4d1800]={'$like':'%'+_0x756a44[_0xbe91('0x33')][_0xbe91('0x3f')]+'%'};return _0x3656c9;})});}_0x42d685=_['merge']({},_0x42d685,_0x756a44[_0xbe91('0x42')]);return _0x14415b[_0xbe91('0x50')](_0x42d685);}})[_0xbe91('0x27')](function(_0xa14d4a){if(_0xa14d4a){_0x63138e=_0xa14d4a[_0xbe91('0x36')];if(!_0x756a44['query'][_0xbe91('0x38')](_0xbe91('0x39'))){_0x42d685[_0xbe91('0x20')]=qs[_0xbe91('0x20')](_0x756a44[_0xbe91('0x33')][_0xbe91('0x20')]);_0x42d685[_0xbe91('0x1f')]=qs[_0xbe91('0x1f')](_0x756a44[_0xbe91('0x33')]['offset']);}return _0x14415b[_0xbe91('0x50')](_0x42d685);}})[_0xbe91('0x27')](function(_0x807912){if(_0x807912){return _0x807912?{'count':_0x63138e,'rows':_0x807912}:null;}})[_0xbe91('0x27')](respondWithResult(_0x20e762,null))[_0xbe91('0x4a')](handleError(_0x20e762,null));};exports[_0xbe91('0x51')]=function(_0x2c0e86,_0x32e6e3,_0x45ce0a){var _0xea53a0={};var _0x40c39d={};var _0x35660f;var _0x3af3d2;return db[_0xbe91('0x2d')][_0xbe91('0x4e')]({'where':{'id':_0x2c0e86[_0xbe91('0x47')]['id']}})[_0xbe91('0x27')](handleEntityNotFound(_0x32e6e3,null))[_0xbe91('0x27')](function(_0x1abecc){if(_0x1abecc){_0x35660f=_0x1abecc;_0x40c39d[_0xbe91('0x32')]=_[_0xbe91('0x48')](db[_0xbe91('0x4f')][_0xbe91('0x2e')]);_0x40c39d[_0xbe91('0x33')]=_[_0xbe91('0x48')](_0x2c0e86[_0xbe91('0x33')]);_0x40c39d[_0xbe91('0x3e')]=_['intersection'](_0x40c39d['model'],_0x40c39d[_0xbe91('0x33')]);_0xea53a0['attributes']=_[_0xbe91('0x34')](_0x40c39d[_0xbe91('0x32')],qs[_0xbe91('0x35')](_0x2c0e86[_0xbe91('0x33')][_0xbe91('0x35')]));_0xea53a0[_0xbe91('0x37')]=_0xea53a0['attributes'][_0xbe91('0x36')]?_0xea53a0[_0xbe91('0x37')]:_0x40c39d[_0xbe91('0x32')];_0xea53a0[_0xbe91('0x3a')]=qs[_0xbe91('0x3b')](_0x2c0e86['query'][_0xbe91('0x3b')]);_0xea53a0['where']=qs[_0xbe91('0x3e')](_[_0xbe91('0x3d')](_0x2c0e86['query'],_0x40c39d[_0xbe91('0x3e')]));if(_0x2c0e86['query'][_0xbe91('0x3f')]){_0xea53a0[_0xbe91('0x3c')]=_[_0xbe91('0x40')](_0xea53a0['where'],{'$or':_[_0xbe91('0x2c')](_0xea53a0[_0xbe91('0x37')],function(_0x3dd63b){var _0x5c4365={};_0x5c4365[_0x3dd63b]={'$like':'%'+_0x2c0e86[_0xbe91('0x33')][_0xbe91('0x3f')]+'%'};return _0x5c4365;})});}_0xea53a0=_[_0xbe91('0x40')]({},_0xea53a0,_0x2c0e86[_0xbe91('0x42')]);return _0x35660f[_0xbe91('0x51')](_0xea53a0);}})['then'](function(_0xe866fb){if(_0xe866fb){_0x3af3d2=_0xe866fb[_0xbe91('0x36')];if(!_0x2c0e86[_0xbe91('0x33')][_0xbe91('0x38')](_0xbe91('0x39'))){_0xea53a0[_0xbe91('0x20')]=qs[_0xbe91('0x20')](_0x2c0e86['query'][_0xbe91('0x20')]);_0xea53a0[_0xbe91('0x1f')]=qs[_0xbe91('0x1f')](_0x2c0e86['query']['offset']);}return _0x35660f[_0xbe91('0x51')](_0xea53a0);}})[_0xbe91('0x27')](function(_0x256708){if(_0x256708){return _0x256708?{'count':_0x3af3d2,'rows':_0x256708}:null;}})[_0xbe91('0x27')](respondWithResult(_0x32e6e3,null))[_0xbe91('0x4a')](handleError(_0x32e6e3,null));};exports['getFields']=function(_0x35f325,_0x22ce03,_0x2b8728){var _0x51cb0b={};var _0xbbb945={};var _0x4f70e0;var _0x5a42fa;return db[_0xbe91('0x2d')][_0xbe91('0x4e')]({'where':{'id':_0x35f325[_0xbe91('0x47')]['id']}})['then'](handleEntityNotFound(_0x22ce03,null))['then'](function(_0x5f12f7){if(_0x5f12f7){_0x4f70e0=_0x5f12f7;_0xbbb945[_0xbe91('0x32')]=_['keys'](db[_0xbe91('0x4f')][_0xbe91('0x2e')]);_0xbbb945[_0xbe91('0x33')]=_['keys'](_0x35f325[_0xbe91('0x33')]);_0xbbb945['filters']=_['intersection'](_0xbbb945[_0xbe91('0x32')],_0xbbb945[_0xbe91('0x33')]);_0x51cb0b['attributes']=_[_0xbe91('0x34')](_0xbbb945[_0xbe91('0x32')],qs['fields'](_0x35f325[_0xbe91('0x33')]['fields']));_0x51cb0b[_0xbe91('0x37')]=_0x51cb0b[_0xbe91('0x37')][_0xbe91('0x36')]?_0x51cb0b[_0xbe91('0x37')]:_0xbbb945[_0xbe91('0x32')];_0x51cb0b['order']=qs[_0xbe91('0x3b')](_0x35f325[_0xbe91('0x33')][_0xbe91('0x3b')]);_0x51cb0b[_0xbe91('0x3c')]=qs['filters'](_[_0xbe91('0x3d')](_0x35f325['query'],_0xbbb945['filters']));if(_0x35f325[_0xbe91('0x33')][_0xbe91('0x3f')]){_0x51cb0b[_0xbe91('0x3c')]=_['merge'](_0x51cb0b['where'],{'$or':_[_0xbe91('0x2c')](_0x51cb0b[_0xbe91('0x37')],function(_0x3726a0){var _0x5ad15f={};_0x5ad15f[_0x3726a0]={'$like':'%'+_0x35f325['query']['filter']+'%'};return _0x5ad15f;})});}_0x51cb0b=_[_0xbe91('0x40')]({},_0x51cb0b,_0x35f325['options']);return _0x4f70e0['getFields'](_0x51cb0b);}})['then'](function(_0x4578f1){if(_0x4578f1){_0x5a42fa=_0x4578f1[_0xbe91('0x36')];if(!_0x35f325[_0xbe91('0x33')][_0xbe91('0x38')](_0xbe91('0x39'))){_0x51cb0b[_0xbe91('0x20')]=qs['limit'](_0x35f325[_0xbe91('0x33')][_0xbe91('0x20')]);_0x51cb0b['offset']=qs[_0xbe91('0x1f')](_0x35f325[_0xbe91('0x33')][_0xbe91('0x1f')]);}return _0x4f70e0[_0xbe91('0x52')](_0x51cb0b);}})[_0xbe91('0x27')](function(_0x4d582f){if(_0x4d582f){return _0x4d582f?{'count':_0x5a42fa,'rows':_0x4d582f}:null;}})[_0xbe91('0x27')](respondWithResult(_0x22ce03,null))['catch'](handleError(_0x22ce03,null));}; \ No newline at end of file +var _0x3c8b=['merge','VIRTUAL','options','then','include','findAll','rows','catch','show','params','length','includeAll','create','body','find','getSubjects','FreshsalesField','getDescriptions','findOne','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','FreshsalesConfiguration','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x542702,_0x1d86e1){var _0xec690b=function(_0x20b876){while(--_0x20b876){_0x542702['push'](_0x542702['shift']());}};_0xec690b(++_0x1d86e1);}(_0x3c8b,0x1ae));var _0xb3c8=function(_0x5f1a22,_0x54a725){_0x5f1a22=_0x5f1a22-0x0;var _0x2e8a43=_0x3c8b[_0x5f1a22];return _0x2e8a43;};'use strict';var emlformat=require(_0xb3c8('0x0'));var rimraf=require(_0xb3c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb3c8('0x2'));var rp=require(_0xb3c8('0x3'));var moment=require(_0xb3c8('0x4'));var BPromise=require(_0xb3c8('0x5'));var Mustache=require(_0xb3c8('0x6'));var util=require(_0xb3c8('0x7'));var path=require('path');var sox=require(_0xb3c8('0x8'));var csv=require(_0xb3c8('0x9'));var ejs=require(_0xb3c8('0xa'));var fs=require('fs');var fs_extra=require(_0xb3c8('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb3c8('0xc'));var jsforce=require(_0xb3c8('0xd'));var deskjs=require(_0xb3c8('0xe'));var toCsv=require(_0xb3c8('0x9'));var querystring=require(_0xb3c8('0xf'));var Papa=require(_0xb3c8('0x10'));var Redis=require(_0xb3c8('0x11'));var authService=require(_0xb3c8('0x12'));var qs=require(_0xb3c8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb3c8('0x14'));var logger=require('../../config/logger')(_0xb3c8('0x15'));var utils=require('../../config/utils');var config=require(_0xb3c8('0x16'));var licenseUtil=require(_0xb3c8('0x17'));var db=require(_0xb3c8('0x18'))['db'];function respondWithStatusCode(_0x42c1db,_0x30bccc){_0x30bccc=_0x30bccc||0xcc;return function(_0x39cb83){if(_0x39cb83){return _0x42c1db[_0xb3c8('0x19')](_0x30bccc);}return _0x42c1db['status'](_0x30bccc)['end']();};}function respondWithResult(_0x3c8ba9,_0xecace0){_0xecace0=_0xecace0||0xc8;return function(_0x202d53){if(_0x202d53){return _0x3c8ba9[_0xb3c8('0x1a')](_0xecace0)[_0xb3c8('0x1b')](_0x202d53);}};}function respondWithFilteredResult(_0x2cd11f,_0xfc95b8){return function(_0x40930c){if(_0x40930c){var _0x49eded=typeof _0xfc95b8[_0xb3c8('0x1c')]===_0xb3c8('0x1d')&&typeof _0xfc95b8[_0xb3c8('0x1e')]===_0xb3c8('0x1d');var _0x1c579a=_0x40930c[_0xb3c8('0x1f')];var _0x352f52=_0x49eded?0x0:_0xfc95b8[_0xb3c8('0x1c')];var _0x3d24b7=_0x49eded?_0x40930c['count']:_0xfc95b8['offset']+_0xfc95b8[_0xb3c8('0x1e')];var _0x4b0578;if(_0x3d24b7>=_0x1c579a){_0x3d24b7=_0x1c579a;_0x4b0578=0xc8;}else{_0x4b0578=0xce;}_0x2cd11f[_0xb3c8('0x1a')](_0x4b0578);return _0x2cd11f[_0xb3c8('0x20')](_0xb3c8('0x21'),_0x352f52+'-'+_0x3d24b7+'/'+_0x1c579a)[_0xb3c8('0x1b')](_0x40930c);}return null;};}function patchUpdates(_0x130e51){return function(_0x2fcf30){try{jsonpatch[_0xb3c8('0x22')](_0x2fcf30,_0x130e51,!![]);}catch(_0x55a9ab){return BPromise[_0xb3c8('0x23')](_0x55a9ab);}return _0x2fcf30[_0xb3c8('0x24')]();};}function saveUpdates(_0x54e710,_0x1ae9ee){return function(_0x2cea66){if(_0x2cea66){return _0x2cea66[_0xb3c8('0x25')](_0x54e710)['then'](function(_0x3c648e){return _0x3c648e;});}return null;};}function removeEntity(_0x250296,_0x56968f){return function(_0x30468f){if(_0x30468f){return _0x30468f[_0xb3c8('0x26')]()['then'](function(){_0x250296['status'](0xcc)[_0xb3c8('0x27')]();});}};}function handleEntityNotFound(_0x456694,_0x4cb3ac){return function(_0x1a0af4){if(!_0x1a0af4){_0x456694[_0xb3c8('0x19')](0x194);}return _0x1a0af4;};}function handleError(_0xc927f9,_0x588e45){_0x588e45=_0x588e45||0x1f4;return function(_0x10a5fb){logger['error'](_0x10a5fb[_0xb3c8('0x28')]);if(_0x10a5fb['name']){delete _0x10a5fb[_0xb3c8('0x29')];}_0xc927f9[_0xb3c8('0x1a')](_0x588e45)[_0xb3c8('0x2a')](_0x10a5fb);};}exports['index']=function(_0x5558d5,_0x3d8e63){var _0x3500d6={},_0x1b09d2={},_0x596f4c={'count':0x0,'rows':[]};var _0x18e20f=_['map'](db[_0xb3c8('0x2b')][_0xb3c8('0x2c')],function(_0x122154){return{'name':_0x122154['fieldName'],'type':_0x122154[_0xb3c8('0x2d')][_0xb3c8('0x2e')]};});_0x1b09d2[_0xb3c8('0x2f')]=_[_0xb3c8('0x30')](_0x18e20f,_0xb3c8('0x29'));_0x1b09d2[_0xb3c8('0x31')]=_[_0xb3c8('0x32')](_0x5558d5[_0xb3c8('0x31')]);_0x1b09d2[_0xb3c8('0x33')]=_['intersection'](_0x1b09d2[_0xb3c8('0x2f')],_0x1b09d2[_0xb3c8('0x31')]);_0x3500d6[_0xb3c8('0x34')]=_[_0xb3c8('0x35')](_0x1b09d2[_0xb3c8('0x2f')],qs[_0xb3c8('0x36')](_0x5558d5[_0xb3c8('0x31')][_0xb3c8('0x36')]));_0x3500d6[_0xb3c8('0x34')]=_0x3500d6[_0xb3c8('0x34')]['length']?_0x3500d6[_0xb3c8('0x34')]:_0x1b09d2[_0xb3c8('0x2f')];if(!_0x5558d5[_0xb3c8('0x31')][_0xb3c8('0x37')](_0xb3c8('0x38'))){_0x3500d6[_0xb3c8('0x1e')]=qs[_0xb3c8('0x1e')](_0x5558d5[_0xb3c8('0x31')][_0xb3c8('0x1e')]);_0x3500d6[_0xb3c8('0x1c')]=qs[_0xb3c8('0x1c')](_0x5558d5[_0xb3c8('0x31')]['offset']);}_0x3500d6[_0xb3c8('0x39')]=qs[_0xb3c8('0x3a')](_0x5558d5[_0xb3c8('0x31')]['sort']);_0x3500d6[_0xb3c8('0x3b')]=qs[_0xb3c8('0x33')](_[_0xb3c8('0x3c')](_0x5558d5['query'],_0x1b09d2['filters']),_0x18e20f);if(_0x5558d5[_0xb3c8('0x31')][_0xb3c8('0x3d')]){_0x3500d6[_0xb3c8('0x3b')]=_[_0xb3c8('0x3e')](_0x3500d6[_0xb3c8('0x3b')],{'$or':_[_0xb3c8('0x30')](_0x18e20f,function(_0x64ab8a){if(_0x64ab8a[_0xb3c8('0x2d')]!==_0xb3c8('0x3f')){var _0x31b0ec={};_0x31b0ec[_0x64ab8a[_0xb3c8('0x29')]]={'$like':'%'+_0x5558d5['query']['filter']+'%'};return _0x31b0ec;}})});}_0x3500d6=_[_0xb3c8('0x3e')]({},_0x3500d6,_0x5558d5[_0xb3c8('0x40')]);var _0x1d4368={'where':_0x3500d6[_0xb3c8('0x3b')]};return db[_0xb3c8('0x2b')][_0xb3c8('0x1f')](_0x1d4368)[_0xb3c8('0x41')](function(_0x91b1b6){_0x596f4c[_0xb3c8('0x1f')]=_0x91b1b6;if(_0x5558d5['query']['includeAll']){_0x3500d6[_0xb3c8('0x42')]=[{'all':!![]}];}return db[_0xb3c8('0x2b')][_0xb3c8('0x43')](_0x3500d6);})[_0xb3c8('0x41')](function(_0x4c8b7f){_0x596f4c[_0xb3c8('0x44')]=_0x4c8b7f;return _0x596f4c;})[_0xb3c8('0x41')](respondWithFilteredResult(_0x3d8e63,_0x3500d6))[_0xb3c8('0x45')](handleError(_0x3d8e63,null));};exports[_0xb3c8('0x46')]=function(_0x3f0c7c,_0xb6423e){var _0x274de3={'raw':![],'where':{'id':_0x3f0c7c[_0xb3c8('0x47')]['id']}},_0x3936ca={};_0x3936ca['model']=_['keys'](db[_0xb3c8('0x2b')]['rawAttributes']);_0x3936ca[_0xb3c8('0x31')]=_[_0xb3c8('0x32')](_0x3f0c7c[_0xb3c8('0x31')]);_0x3936ca[_0xb3c8('0x33')]=_[_0xb3c8('0x35')](_0x3936ca[_0xb3c8('0x2f')],_0x3936ca[_0xb3c8('0x31')]);_0x274de3['attributes']=_[_0xb3c8('0x35')](_0x3936ca['model'],qs[_0xb3c8('0x36')](_0x3f0c7c[_0xb3c8('0x31')][_0xb3c8('0x36')]));_0x274de3[_0xb3c8('0x34')]=_0x274de3[_0xb3c8('0x34')][_0xb3c8('0x48')]?_0x274de3[_0xb3c8('0x34')]:_0x3936ca[_0xb3c8('0x2f')];if(_0x3f0c7c['query'][_0xb3c8('0x49')]){_0x274de3[_0xb3c8('0x42')]=[{'all':!![]}];}_0x274de3=_[_0xb3c8('0x3e')]({},_0x274de3,_0x3f0c7c['options']);return db[_0xb3c8('0x2b')]['find'](_0x274de3)[_0xb3c8('0x41')](handleEntityNotFound(_0xb6423e,null))[_0xb3c8('0x41')](respondWithResult(_0xb6423e,null))[_0xb3c8('0x45')](handleError(_0xb6423e,null));};exports[_0xb3c8('0x4a')]=function(_0x449c93,_0x3f812a){return db[_0xb3c8('0x2b')]['create'](_0x449c93['body'],{})[_0xb3c8('0x41')](respondWithResult(_0x3f812a,0xc9))[_0xb3c8('0x45')](handleError(_0x3f812a,null));};exports[_0xb3c8('0x25')]=function(_0x3b9a32,_0xa7c301){if(_0x3b9a32[_0xb3c8('0x4b')]['id']){delete _0x3b9a32['body']['id'];}return db[_0xb3c8('0x2b')][_0xb3c8('0x4c')]({'where':{'id':_0x3b9a32[_0xb3c8('0x47')]['id']}})['then'](handleEntityNotFound(_0xa7c301,null))[_0xb3c8('0x41')](saveUpdates(_0x3b9a32[_0xb3c8('0x4b')],null))[_0xb3c8('0x41')](respondWithResult(_0xa7c301,null))[_0xb3c8('0x45')](handleError(_0xa7c301,null));};exports['destroy']=function(_0x3b18f6,_0x155d0a){return db[_0xb3c8('0x2b')][_0xb3c8('0x4c')]({'where':{'id':_0x3b18f6[_0xb3c8('0x47')]['id']}})[_0xb3c8('0x41')](handleEntityNotFound(_0x155d0a,null))[_0xb3c8('0x41')](removeEntity(_0x155d0a,null))['catch'](handleError(_0x155d0a,null));};exports[_0xb3c8('0x4d')]=function(_0x2a9427,_0x15c9c1,_0x1914b4){var _0x29a8c0={};var _0x2d36c9={};var _0x230398;var _0x507b63;return db[_0xb3c8('0x2b')]['findOne']({'where':{'id':_0x2a9427[_0xb3c8('0x47')]['id']}})[_0xb3c8('0x41')](handleEntityNotFound(_0x15c9c1,null))[_0xb3c8('0x41')](function(_0x1bcdc6){if(_0x1bcdc6){_0x230398=_0x1bcdc6;_0x2d36c9[_0xb3c8('0x2f')]=_[_0xb3c8('0x32')](db[_0xb3c8('0x4e')][_0xb3c8('0x2c')]);_0x2d36c9['query']=_[_0xb3c8('0x32')](_0x2a9427[_0xb3c8('0x31')]);_0x2d36c9['filters']=_['intersection'](_0x2d36c9[_0xb3c8('0x2f')],_0x2d36c9[_0xb3c8('0x31')]);_0x29a8c0['attributes']=_[_0xb3c8('0x35')](_0x2d36c9[_0xb3c8('0x2f')],qs[_0xb3c8('0x36')](_0x2a9427[_0xb3c8('0x31')]['fields']));_0x29a8c0['attributes']=_0x29a8c0[_0xb3c8('0x34')][_0xb3c8('0x48')]?_0x29a8c0['attributes']:_0x2d36c9[_0xb3c8('0x2f')];_0x29a8c0['order']=qs[_0xb3c8('0x3a')](_0x2a9427[_0xb3c8('0x31')][_0xb3c8('0x3a')]);_0x29a8c0[_0xb3c8('0x3b')]=qs[_0xb3c8('0x33')](_[_0xb3c8('0x3c')](_0x2a9427[_0xb3c8('0x31')],_0x2d36c9[_0xb3c8('0x33')]));if(_0x2a9427[_0xb3c8('0x31')][_0xb3c8('0x3d')]){_0x29a8c0['where']=_[_0xb3c8('0x3e')](_0x29a8c0[_0xb3c8('0x3b')],{'$or':_[_0xb3c8('0x30')](_0x29a8c0[_0xb3c8('0x34')],function(_0x166b81){var _0x2c6a67={};_0x2c6a67[_0x166b81]={'$like':'%'+_0x2a9427['query'][_0xb3c8('0x3d')]+'%'};return _0x2c6a67;})});}_0x29a8c0=_['merge']({},_0x29a8c0,_0x2a9427[_0xb3c8('0x40')]);return _0x230398[_0xb3c8('0x4d')](_0x29a8c0);}})['then'](function(_0x25cf2c){if(_0x25cf2c){_0x507b63=_0x25cf2c[_0xb3c8('0x48')];if(!_0x2a9427['query'][_0xb3c8('0x37')](_0xb3c8('0x38'))){_0x29a8c0[_0xb3c8('0x1e')]=qs[_0xb3c8('0x1e')](_0x2a9427[_0xb3c8('0x31')][_0xb3c8('0x1e')]);_0x29a8c0['offset']=qs[_0xb3c8('0x1c')](_0x2a9427[_0xb3c8('0x31')][_0xb3c8('0x1c')]);}return _0x230398[_0xb3c8('0x4d')](_0x29a8c0);}})[_0xb3c8('0x41')](function(_0x43f8f5){if(_0x43f8f5){return _0x43f8f5?{'count':_0x507b63,'rows':_0x43f8f5}:null;}})[_0xb3c8('0x41')](respondWithResult(_0x15c9c1,null))['catch'](handleError(_0x15c9c1,null));};exports[_0xb3c8('0x4f')]=function(_0x190977,_0x2e35e8,_0x4f484c){var _0x52baf9={};var _0x284288={};var _0x2c9a01;var _0x2121ab;return db[_0xb3c8('0x2b')][_0xb3c8('0x50')]({'where':{'id':_0x190977['params']['id']}})[_0xb3c8('0x41')](handleEntityNotFound(_0x2e35e8,null))[_0xb3c8('0x41')](function(_0x365fd0){if(_0x365fd0){_0x2c9a01=_0x365fd0;_0x284288['model']=_[_0xb3c8('0x32')](db[_0xb3c8('0x4e')][_0xb3c8('0x2c')]);_0x284288[_0xb3c8('0x31')]=_['keys'](_0x190977[_0xb3c8('0x31')]);_0x284288[_0xb3c8('0x33')]=_[_0xb3c8('0x35')](_0x284288[_0xb3c8('0x2f')],_0x284288[_0xb3c8('0x31')]);_0x52baf9[_0xb3c8('0x34')]=_[_0xb3c8('0x35')](_0x284288[_0xb3c8('0x2f')],qs['fields'](_0x190977[_0xb3c8('0x31')][_0xb3c8('0x36')]));_0x52baf9[_0xb3c8('0x34')]=_0x52baf9[_0xb3c8('0x34')][_0xb3c8('0x48')]?_0x52baf9['attributes']:_0x284288[_0xb3c8('0x2f')];_0x52baf9[_0xb3c8('0x39')]=qs['sort'](_0x190977[_0xb3c8('0x31')][_0xb3c8('0x3a')]);_0x52baf9[_0xb3c8('0x3b')]=qs[_0xb3c8('0x33')](_[_0xb3c8('0x3c')](_0x190977[_0xb3c8('0x31')],_0x284288['filters']));if(_0x190977[_0xb3c8('0x31')][_0xb3c8('0x3d')]){_0x52baf9[_0xb3c8('0x3b')]=_['merge'](_0x52baf9[_0xb3c8('0x3b')],{'$or':_[_0xb3c8('0x30')](_0x52baf9[_0xb3c8('0x34')],function(_0x3dc38f){var _0x12ad28={};_0x12ad28[_0x3dc38f]={'$like':'%'+_0x190977['query']['filter']+'%'};return _0x12ad28;})});}_0x52baf9=_[_0xb3c8('0x3e')]({},_0x52baf9,_0x190977[_0xb3c8('0x40')]);return _0x2c9a01[_0xb3c8('0x4f')](_0x52baf9);}})['then'](function(_0x5c3f7b){if(_0x5c3f7b){_0x2121ab=_0x5c3f7b[_0xb3c8('0x48')];if(!_0x190977[_0xb3c8('0x31')][_0xb3c8('0x37')]('nolimit')){_0x52baf9['limit']=qs[_0xb3c8('0x1e')](_0x190977['query'][_0xb3c8('0x1e')]);_0x52baf9[_0xb3c8('0x1c')]=qs[_0xb3c8('0x1c')](_0x190977['query'][_0xb3c8('0x1c')]);}return _0x2c9a01[_0xb3c8('0x4f')](_0x52baf9);}})[_0xb3c8('0x41')](function(_0x193edc){if(_0x193edc){return _0x193edc?{'count':_0x2121ab,'rows':_0x193edc}:null;}})['then'](respondWithResult(_0x2e35e8,null))[_0xb3c8('0x45')](handleError(_0x2e35e8,null));};exports['getFields']=function(_0x321026,_0x4f8406,_0x94ca91){var _0x538baa={};var _0x19f3fc={};var _0x320197;var _0x48231b;return db[_0xb3c8('0x2b')][_0xb3c8('0x50')]({'where':{'id':_0x321026['params']['id']}})['then'](handleEntityNotFound(_0x4f8406,null))[_0xb3c8('0x41')](function(_0xc0b975){if(_0xc0b975){_0x320197=_0xc0b975;_0x19f3fc['model']=_['keys'](db['FreshsalesField'][_0xb3c8('0x2c')]);_0x19f3fc[_0xb3c8('0x31')]=_['keys'](_0x321026['query']);_0x19f3fc[_0xb3c8('0x33')]=_[_0xb3c8('0x35')](_0x19f3fc[_0xb3c8('0x2f')],_0x19f3fc[_0xb3c8('0x31')]);_0x538baa[_0xb3c8('0x34')]=_[_0xb3c8('0x35')](_0x19f3fc[_0xb3c8('0x2f')],qs[_0xb3c8('0x36')](_0x321026['query']['fields']));_0x538baa['attributes']=_0x538baa[_0xb3c8('0x34')][_0xb3c8('0x48')]?_0x538baa[_0xb3c8('0x34')]:_0x19f3fc[_0xb3c8('0x2f')];_0x538baa[_0xb3c8('0x39')]=qs[_0xb3c8('0x3a')](_0x321026[_0xb3c8('0x31')][_0xb3c8('0x3a')]);_0x538baa[_0xb3c8('0x3b')]=qs[_0xb3c8('0x33')](_[_0xb3c8('0x3c')](_0x321026[_0xb3c8('0x31')],_0x19f3fc[_0xb3c8('0x33')]));if(_0x321026[_0xb3c8('0x31')][_0xb3c8('0x3d')]){_0x538baa[_0xb3c8('0x3b')]=_['merge'](_0x538baa[_0xb3c8('0x3b')],{'$or':_[_0xb3c8('0x30')](_0x538baa[_0xb3c8('0x34')],function(_0x3b41f5){var _0x5231f1={};_0x5231f1[_0x3b41f5]={'$like':'%'+_0x321026[_0xb3c8('0x31')]['filter']+'%'};return _0x5231f1;})});}_0x538baa=_['merge']({},_0x538baa,_0x321026[_0xb3c8('0x40')]);return _0x320197['getFields'](_0x538baa);}})[_0xb3c8('0x41')](function(_0x5ade4f){if(_0x5ade4f){_0x48231b=_0x5ade4f[_0xb3c8('0x48')];if(!_0x321026['query'][_0xb3c8('0x37')](_0xb3c8('0x38'))){_0x538baa[_0xb3c8('0x1e')]=qs[_0xb3c8('0x1e')](_0x321026[_0xb3c8('0x31')][_0xb3c8('0x1e')]);_0x538baa[_0xb3c8('0x1c')]=qs['offset'](_0x321026[_0xb3c8('0x31')]['offset']);}return _0x320197[_0xb3c8('0x51')](_0x538baa);}})[_0xb3c8('0x41')](function(_0x550345){if(_0x550345){return _0x550345?{'count':_0x48231b,'rows':_0x550345}:null;}})[_0xb3c8('0x41')](respondWithResult(_0x4f8406,null))[_0xb3c8('0x45')](handleError(_0x4f8406,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index f7b76e1..421a644 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 _0x4653=['request-promise','path','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','util','../../config/logger','moment'];(function(_0x5c939c,_0x346a1a){var _0x4f92e0=function(_0x167688){while(--_0x167688){_0x5c939c['push'](_0x5c939c['shift']());}};_0x4f92e0(++_0x346a1a);}(_0x4653,0x1da));var _0x3465=function(_0x3832a3,_0x2024d9){_0x3832a3=_0x3832a3-0x0;var _0x29b994=_0x4653[_0x3832a3];return _0x29b994;};'use strict';var _=require('lodash');var util=require(_0x3465('0x0'));var logger=require(_0x3465('0x1'))('api');var moment=require(_0x3465('0x2'));var BPromise=require('bluebird');var rp=require(_0x3465('0x3'));var fs=require('fs');var path=require(_0x3465('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3465('0x5'));module[_0x3465('0x6')]=function(_0x228ce2,_0x28204b){return _0x228ce2[_0x3465('0x7')]('FreshsalesConfiguration',attributes,{'tableName':_0x3465('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8cfa=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','int_freshsales_configurations','lodash','util'];(function(_0xb7b16e,_0x578998){var _0x438e81=function(_0x1548f4){while(--_0x1548f4){_0xb7b16e['push'](_0xb7b16e['shift']());}};_0x438e81(++_0x578998);}(_0x8cfa,0x8d));var _0xa8cf=function(_0x21fc96,_0x2df0fe){_0x21fc96=_0x21fc96-0x0;var _0x2e00b0=_0x8cfa[_0x21fc96];return _0x2e00b0;};'use strict';var _=require(_0xa8cf('0x0'));var util=require(_0xa8cf('0x1'));var logger=require('../../config/logger')(_0xa8cf('0x2'));var moment=require(_0xa8cf('0x3'));var BPromise=require(_0xa8cf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa8cf('0x5'));var rimraf=require(_0xa8cf('0x6'));var config=require(_0xa8cf('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xa8cf('0x8')]=function(_0x1cd8b0,_0x50761e){return _0x1cd8b0[_0xa8cf('0x9')]('FreshsalesConfiguration',attributes,{'tableName':_0xa8cf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 96e3377..b05bd9c 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 _0xe2f2=['http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0xe2f2,0xe8));var _0x2e2f=function(_0x2a68ed,_0x3a5f0d){_0x2a68ed=_0x2a68ed-0x0;var _0x363c17=_0xe2f2[_0x2a68ed];return _0x363c17;};'use strict';var _=require('lodash');var util=require(_0x2e2f('0x0'));var moment=require('moment');var BPromise=require(_0x2e2f('0x1'));var rs=require(_0x2e2f('0x2'));var fs=require('fs');var Redis=require(_0x2e2f('0x3'));var db=require(_0x2e2f('0x4'))['db'];var utils=require(_0x2e2f('0x5'));var logger=require(_0x2e2f('0x6'))(_0x2e2f('0x7'));var config=require(_0x2e2f('0x8'));var jayson=require(_0x2e2f('0x9'));var client=jayson['client'][_0x2e2f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cccad,_0xef5ab0,_0x19d1b2){return new BPromise(function(_0x5b35f1,_0x124146){return client[_0x2e2f('0xb')](_0x2cccad,_0x19d1b2)['then'](function(_0x450e05){logger[_0x2e2f('0xc')](_0x2e2f('0xd'),_0xef5ab0,_0x2e2f('0xe'));logger[_0x2e2f('0xf')](_0x2e2f('0x10'),_0xef5ab0,_0x2e2f('0xe'),JSON[_0x2e2f('0x11')](_0x450e05));if(_0x450e05[_0x2e2f('0x12')]){if(_0x450e05[_0x2e2f('0x12')][_0x2e2f('0x13')]===0x1f4){logger[_0x2e2f('0x12')](_0x2e2f('0xd'),_0xef5ab0,_0x450e05[_0x2e2f('0x12')]['message']);return _0x124146(_0x450e05['error'][_0x2e2f('0x14')]);}logger[_0x2e2f('0x12')](_0x2e2f('0xd'),_0xef5ab0,_0x450e05[_0x2e2f('0x12')][_0x2e2f('0x14')]);return _0x5b35f1(_0x450e05[_0x2e2f('0x12')][_0x2e2f('0x14')]);}else{logger[_0x2e2f('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xef5ab0,'request\x20sent');_0x5b35f1(_0x450e05[_0x2e2f('0x15')][_0x2e2f('0x14')]);}})['catch'](function(_0x4295c4){logger[_0x2e2f('0x12')](_0x2e2f('0xd'),_0xef5ab0,_0x4295c4);_0x124146(_0x4295c4);});});} \ No newline at end of file +var _0x3c7e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util'];(function(_0x107d61,_0x1765a4){var _0x3c9ec2=function(_0x546dd5){while(--_0x546dd5){_0x107d61['push'](_0x107d61['shift']());}};_0x3c9ec2(++_0x1765a4);}(_0x3c7e,0x185));var _0xe3c7=function(_0x19688b,_0x5cae76){_0x19688b=_0x19688b-0x0;var _0x196944=_0x3c7e[_0x19688b];return _0x196944;};'use strict';var _=require(_0xe3c7('0x0'));var util=require(_0xe3c7('0x1'));var moment=require(_0xe3c7('0x2'));var BPromise=require(_0xe3c7('0x3'));var rs=require(_0xe3c7('0x4'));var fs=require('fs');var Redis=require(_0xe3c7('0x5'));var db=require(_0xe3c7('0x6'))['db'];var utils=require(_0xe3c7('0x7'));var logger=require(_0xe3c7('0x8'))(_0xe3c7('0x9'));var config=require(_0xe3c7('0xa'));var jayson=require(_0xe3c7('0xb'));var client=jayson['client'][_0xe3c7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x23e474,_0x16c3ed,_0x5364fc){return new BPromise(function(_0x5394f3,_0x418ebf){return client[_0xe3c7('0xd')](_0x23e474,_0x5364fc)[_0xe3c7('0xe')](function(_0x3d7fa8){logger['info'](_0xe3c7('0xf'),_0x16c3ed,_0xe3c7('0x10'));logger[_0xe3c7('0x11')](_0xe3c7('0x12'),_0x16c3ed,_0xe3c7('0x10'),JSON[_0xe3c7('0x13')](_0x3d7fa8));if(_0x3d7fa8[_0xe3c7('0x14')]){if(_0x3d7fa8[_0xe3c7('0x14')][_0xe3c7('0x15')]===0x1f4){logger[_0xe3c7('0x14')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x16c3ed,_0x3d7fa8[_0xe3c7('0x14')][_0xe3c7('0x16')]);return _0x418ebf(_0x3d7fa8[_0xe3c7('0x14')][_0xe3c7('0x16')]);}logger[_0xe3c7('0x14')](_0xe3c7('0xf'),_0x16c3ed,_0x3d7fa8[_0xe3c7('0x14')][_0xe3c7('0x16')]);return _0x5394f3(_0x3d7fa8[_0xe3c7('0x14')][_0xe3c7('0x16')]);}else{logger['info'](_0xe3c7('0xf'),_0x16c3ed,_0xe3c7('0x10'));_0x5394f3(_0x3d7fa8['result'][_0xe3c7('0x16')]);}})['catch'](function(_0x224e8d){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x16c3ed,_0x224e8d);_0x418ebf(_0x224e8d);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index cb0f56f..c9a828b 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 _0x7333=['multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','/:id','show','create','put','update','destroy','exports'];(function(_0x55a51f,_0x2a86df){var _0x25a91b=function(_0x47e00b){while(--_0x47e00b){_0x55a51f['push'](_0x55a51f['shift']());}};_0x25a91b(++_0x2a86df);}(_0x7333,0xfc));var _0x3733=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x7333[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x3733('0x0'));var util=require('util');var path=require(_0x3733('0x1'));var timeout=require('connect-timeout');var express=require(_0x3733('0x2'));var router=express[_0x3733('0x3')]();var fs_extra=require(_0x3733('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3733('0x5'));var config=require(_0x3733('0x6'));var controller=require(_0x3733('0x7'));router['get']('/',auth[_0x3733('0x8')](),controller[_0x3733('0x9')]);router[_0x3733('0xa')](_0x3733('0xb'),auth['isAuthenticated'](),controller[_0x3733('0xc')]);router['post']('/',auth[_0x3733('0x8')](),controller[_0x3733('0xd')]);router[_0x3733('0xe')](_0x3733('0xb'),auth['isAuthenticated'](),controller[_0x3733('0xf')]);router['delete'](_0x3733('0xb'),auth[_0x3733('0x8')](),controller[_0x3733('0x10')]);module[_0x3733('0x11')]=router; \ No newline at end of file +var _0x3cd1=['/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated'];(function(_0x273bb2,_0x319264){var _0x22f932=function(_0x2124ba){while(--_0x2124ba){_0x273bb2['push'](_0x273bb2['shift']());}};_0x22f932(++_0x319264);}(_0x3cd1,0x112));var _0x13cd=function(_0x38c96f,_0x1642f9){_0x38c96f=_0x38c96f-0x0;var _0x5a7c09=_0x3cd1[_0x38c96f];return _0x5a7c09;};'use strict';var multer=require('multer');var util=require(_0x13cd('0x0'));var path=require(_0x13cd('0x1'));var timeout=require(_0x13cd('0x2'));var express=require(_0x13cd('0x3'));var router=express[_0x13cd('0x4')]();var fs_extra=require(_0x13cd('0x5'));var auth=require(_0x13cd('0x6'));var interaction=require(_0x13cd('0x7'));var config=require('../../config/environment');var controller=require(_0x13cd('0x8'));router[_0x13cd('0x9')]('/',auth[_0x13cd('0xa')](),controller['index']);router['get'](_0x13cd('0xb'),auth[_0x13cd('0xa')](),controller[_0x13cd('0xc')]);router[_0x13cd('0xd')]('/',auth['isAuthenticated'](),controller[_0x13cd('0xe')]);router[_0x13cd('0xf')](_0x13cd('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x13cd('0x10')](_0x13cd('0xb'),auth[_0x13cd('0xa')](),controller[_0x13cd('0x11')]);module[_0x13cd('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 521859c..b6e22ad 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 _0x5a01=['exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN'];(function(_0x466b8c,_0x492ed0){var _0x3f461d=function(_0x1bb52c){while(--_0x1bb52c){_0x466b8c['push'](_0x466b8c['shift']());}};_0x3f461d(++_0x492ed0);}(_0x5a01,0x6c));var _0x15a0=function(_0x438fe1,_0x3308d5){_0x438fe1=_0x438fe1-0x0;var _0x3c8e1b=_0x5a01[_0x438fe1];return _0x3c8e1b;};'use strict';var Sequelize=require('sequelize');module[_0x15a0('0x0')]={'type':{'type':Sequelize[_0x15a0('0x1')](_0x15a0('0x2'),'variable',_0x15a0('0x3'),_0x15a0('0x4'),_0x15a0('0x5')),'defaultValue':_0x15a0('0x2')},'content':{'type':Sequelize[_0x15a0('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x15a0('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x15a0('0x6')]},'idField':{'type':Sequelize[_0x15a0('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x15a0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x15a0('0x6')]}}; \ No newline at end of file +var _0xa301=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','exports'];(function(_0xf44e42,_0x3c5abc){var _0x1681b3=function(_0x5008d0){while(--_0x5008d0){_0xf44e42['push'](_0xf44e42['shift']());}};_0x1681b3(++_0x3c5abc);}(_0xa301,0x17f));var _0x1a30=function(_0x530ffb,_0x1c019e){_0x530ffb=_0x530ffb-0x0;var _0x683289=_0xa301[_0x530ffb];return _0x683289;};'use strict';var Sequelize=require('sequelize');module[_0x1a30('0x0')]={'type':{'type':Sequelize['ENUM'](_0x1a30('0x1'),_0x1a30('0x2'),_0x1a30('0x3'),_0x1a30('0x4'),_0x1a30('0x5')),'defaultValue':_0x1a30('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1a30('0x6')]},'keyType':{'type':Sequelize[_0x1a30('0x7')](_0x1a30('0x1'),_0x1a30('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1a30('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1a30('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 9a28f44..7f33529 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 _0x1a8c=['undefined','count','Content-Range','apply','reject','save','then','destroy','index','FreshsalesField','rawAttributes','type','key','model','map','name','query','filters','intersection','fields','attributes','length','nolimit','limit','offset','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','update','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x5b3b17,_0x263d3c){var _0x137955=function(_0x1d12b8){while(--_0x1d12b8){_0x5b3b17['push'](_0x5b3b17['shift']());}};_0x137955(++_0x263d3c);}(_0x1a8c,0x73));var _0xc1a8=function(_0x41c5db,_0x15d82a){_0x41c5db=_0x41c5db-0x0;var _0x57bbb3=_0x1a8c[_0x41c5db];return _0x57bbb3;};'use strict';var emlformat=require(_0xc1a8('0x0'));var rimraf=require(_0xc1a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc1a8('0x2'));var moment=require(_0xc1a8('0x3'));var BPromise=require(_0xc1a8('0x4'));var Mustache=require(_0xc1a8('0x5'));var util=require(_0xc1a8('0x6'));var path=require(_0xc1a8('0x7'));var sox=require(_0xc1a8('0x8'));var csv=require(_0xc1a8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc1a8('0xa'));var _=require(_0xc1a8('0xb'));var squel=require('squel');var crypto=require(_0xc1a8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc1a8('0xd'));var toCsv=require(_0xc1a8('0x9'));var querystring=require(_0xc1a8('0xe'));var Papa=require(_0xc1a8('0xf'));var Redis=require(_0xc1a8('0x10'));var authService=require(_0xc1a8('0x11'));var qs=require(_0xc1a8('0x12'));var as=require(_0xc1a8('0x13'));var hardwareService=require(_0xc1a8('0x14'));var logger=require('../../config/logger')(_0xc1a8('0x15'));var utils=require(_0xc1a8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc1a8('0x17'));var db=require(_0xc1a8('0x18'))['db'];function respondWithStatusCode(_0x383f00,_0x567e37){_0x567e37=_0x567e37||0xcc;return function(_0x48f569){if(_0x48f569){return _0x383f00[_0xc1a8('0x19')](_0x567e37);}return _0x383f00[_0xc1a8('0x1a')](_0x567e37)[_0xc1a8('0x1b')]();};}function respondWithResult(_0x12ad13,_0x4ee36e){_0x4ee36e=_0x4ee36e||0xc8;return function(_0xb8b0fb){if(_0xb8b0fb){return _0x12ad13['status'](_0x4ee36e)[_0xc1a8('0x1c')](_0xb8b0fb);}};}function respondWithFilteredResult(_0x3d44a9,_0x431a5b){return function(_0x49f28f){if(_0x49f28f){var _0x4388f4=typeof _0x431a5b['offset']===_0xc1a8('0x1d')&&typeof _0x431a5b['limit']===_0xc1a8('0x1d');var _0x24562a=_0x49f28f[_0xc1a8('0x1e')];var _0x3613ee=_0x4388f4?0x0:_0x431a5b['offset'];var _0x1a038a=_0x4388f4?_0x49f28f[_0xc1a8('0x1e')]:_0x431a5b['offset']+_0x431a5b['limit'];var _0x359457;if(_0x1a038a>=_0x24562a){_0x1a038a=_0x24562a;_0x359457=0xc8;}else{_0x359457=0xce;}_0x3d44a9[_0xc1a8('0x1a')](_0x359457);return _0x3d44a9['set'](_0xc1a8('0x1f'),_0x3613ee+'-'+_0x1a038a+'/'+_0x24562a)[_0xc1a8('0x1c')](_0x49f28f);}return null;};}function patchUpdates(_0x6d378){return function(_0x518103){try{jsonpatch[_0xc1a8('0x20')](_0x518103,_0x6d378,!![]);}catch(_0x89d52){return BPromise[_0xc1a8('0x21')](_0x89d52);}return _0x518103[_0xc1a8('0x22')]();};}function saveUpdates(_0x52ef14,_0x13c605){return function(_0x19720a){if(_0x19720a){return _0x19720a['update'](_0x52ef14)[_0xc1a8('0x23')](function(_0x25d3fe){return _0x25d3fe;});}return null;};}function removeEntity(_0x5afceb,_0x1c5cd2){return function(_0x34474e){if(_0x34474e){return _0x34474e[_0xc1a8('0x24')]()[_0xc1a8('0x23')](function(){_0x5afceb[_0xc1a8('0x1a')](0xcc)[_0xc1a8('0x1b')]();});}};}function handleEntityNotFound(_0x1fac9d,_0x1d8035){return function(_0xf89150){if(!_0xf89150){_0x1fac9d[_0xc1a8('0x19')](0x194);}return _0xf89150;};}function handleError(_0x83fcca,_0x788efd){_0x788efd=_0x788efd||0x1f4;return function(_0x344559){logger['error'](_0x344559['stack']);if(_0x344559['name']){delete _0x344559['name'];}_0x83fcca[_0xc1a8('0x1a')](_0x788efd)['send'](_0x344559);};}exports[_0xc1a8('0x25')]=function(_0x4b5835,_0x34f760){var _0x4f0401={},_0x31d388={},_0x377956={'count':0x0,'rows':[]};var _0x2821c8=_['map'](db[_0xc1a8('0x26')][_0xc1a8('0x27')],function(_0x436a4e){return{'name':_0x436a4e['fieldName'],'type':_0x436a4e[_0xc1a8('0x28')][_0xc1a8('0x29')]};});_0x31d388[_0xc1a8('0x2a')]=_[_0xc1a8('0x2b')](_0x2821c8,_0xc1a8('0x2c'));_0x31d388[_0xc1a8('0x2d')]=_['keys'](_0x4b5835['query']);_0x31d388[_0xc1a8('0x2e')]=_[_0xc1a8('0x2f')](_0x31d388[_0xc1a8('0x2a')],_0x31d388[_0xc1a8('0x2d')]);_0x4f0401['attributes']=_[_0xc1a8('0x2f')](_0x31d388['model'],qs[_0xc1a8('0x30')](_0x4b5835['query'][_0xc1a8('0x30')]));_0x4f0401['attributes']=_0x4f0401[_0xc1a8('0x31')][_0xc1a8('0x32')]?_0x4f0401[_0xc1a8('0x31')]:_0x31d388[_0xc1a8('0x2a')];if(!_0x4b5835[_0xc1a8('0x2d')]['hasOwnProperty'](_0xc1a8('0x33'))){_0x4f0401['limit']=qs[_0xc1a8('0x34')](_0x4b5835[_0xc1a8('0x2d')][_0xc1a8('0x34')]);_0x4f0401[_0xc1a8('0x35')]=qs['offset'](_0x4b5835[_0xc1a8('0x2d')][_0xc1a8('0x35')]);}_0x4f0401[_0xc1a8('0x36')]=qs[_0xc1a8('0x37')](_0x4b5835[_0xc1a8('0x2d')]['sort']);_0x4f0401['where']=qs[_0xc1a8('0x2e')](_['pick'](_0x4b5835[_0xc1a8('0x2d')],_0x31d388[_0xc1a8('0x2e')]),_0x2821c8);if(_0x4b5835[_0xc1a8('0x2d')][_0xc1a8('0x38')]){_0x4f0401[_0xc1a8('0x39')]=_[_0xc1a8('0x3a')](_0x4f0401[_0xc1a8('0x39')],{'$or':_[_0xc1a8('0x2b')](_0x2821c8,function(_0x14b3f6){if(_0x14b3f6[_0xc1a8('0x28')]!==_0xc1a8('0x3b')){var _0x587842={};_0x587842[_0x14b3f6[_0xc1a8('0x2c')]]={'$like':'%'+_0x4b5835[_0xc1a8('0x2d')]['filter']+'%'};return _0x587842;}})});}_0x4f0401=_[_0xc1a8('0x3a')]({},_0x4f0401,_0x4b5835[_0xc1a8('0x3c')]);var _0x1af92b={'where':_0x4f0401['where']};return db[_0xc1a8('0x26')][_0xc1a8('0x1e')](_0x1af92b)['then'](function(_0x547f62){_0x377956[_0xc1a8('0x1e')]=_0x547f62;if(_0x4b5835[_0xc1a8('0x2d')][_0xc1a8('0x3d')]){_0x4f0401[_0xc1a8('0x3e')]=[{'all':!![]}];}return db[_0xc1a8('0x26')][_0xc1a8('0x3f')](_0x4f0401);})[_0xc1a8('0x23')](function(_0x2d9809){_0x377956['rows']=_0x2d9809;return _0x377956;})['then'](respondWithFilteredResult(_0x34f760,_0x4f0401))['catch'](handleError(_0x34f760,null));};exports[_0xc1a8('0x40')]=function(_0x4c0a90,_0x473863){var _0x5f3377={'raw':!![],'where':{'id':_0x4c0a90[_0xc1a8('0x41')]['id']}},_0x643766={};_0x643766['model']=_[_0xc1a8('0x42')](db['FreshsalesField'][_0xc1a8('0x27')]);_0x643766[_0xc1a8('0x2d')]=_['keys'](_0x4c0a90['query']);_0x643766[_0xc1a8('0x2e')]=_['intersection'](_0x643766[_0xc1a8('0x2a')],_0x643766[_0xc1a8('0x2d')]);_0x5f3377[_0xc1a8('0x31')]=_[_0xc1a8('0x2f')](_0x643766[_0xc1a8('0x2a')],qs[_0xc1a8('0x30')](_0x4c0a90[_0xc1a8('0x2d')][_0xc1a8('0x30')]));_0x5f3377['attributes']=_0x5f3377[_0xc1a8('0x31')][_0xc1a8('0x32')]?_0x5f3377[_0xc1a8('0x31')]:_0x643766[_0xc1a8('0x2a')];if(_0x4c0a90[_0xc1a8('0x2d')][_0xc1a8('0x3d')]){_0x5f3377[_0xc1a8('0x3e')]=[{'all':!![]}];}_0x5f3377=_['merge']({},_0x5f3377,_0x4c0a90[_0xc1a8('0x3c')]);return db[_0xc1a8('0x26')][_0xc1a8('0x43')](_0x5f3377)[_0xc1a8('0x23')](handleEntityNotFound(_0x473863,null))[_0xc1a8('0x23')](respondWithResult(_0x473863,null))[_0xc1a8('0x44')](handleError(_0x473863,null));};exports['create']=function(_0x1c0f4e,_0xeeb756){return db[_0xc1a8('0x26')][_0xc1a8('0x45')](_0x1c0f4e[_0xc1a8('0x46')],{})[_0xc1a8('0x23')](respondWithResult(_0xeeb756,0xc9))[_0xc1a8('0x44')](handleError(_0xeeb756,null));};exports[_0xc1a8('0x47')]=function(_0x3c16fa,_0x22ce04){if(_0x3c16fa['body']['id']){delete _0x3c16fa['body']['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x3c16fa[_0xc1a8('0x41')]['id']}})[_0xc1a8('0x23')](handleEntityNotFound(_0x22ce04,null))['then'](saveUpdates(_0x3c16fa[_0xc1a8('0x46')],null))[_0xc1a8('0x23')](respondWithResult(_0x22ce04,null))[_0xc1a8('0x44')](handleError(_0x22ce04,null));};exports[_0xc1a8('0x24')]=function(_0xbf1769,_0xdbac52){return db[_0xc1a8('0x26')][_0xc1a8('0x43')]({'where':{'id':_0xbf1769[_0xc1a8('0x41')]['id']}})['then'](handleEntityNotFound(_0xdbac52,null))['then'](removeEntity(_0xdbac52,null))['catch'](handleError(_0xdbac52,null));}; \ No newline at end of file +var _0x0519=['create','body','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','error','name','send','map','FreshsalesField','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find'];(function(_0x2755fb,_0x5970f1){var _0x293f12=function(_0x4c629d){while(--_0x4c629d){_0x2755fb['push'](_0x2755fb['shift']());}};_0x293f12(++_0x5970f1);}(_0x0519,0x156));var _0x9051=function(_0x202d24,_0x5e8641){_0x202d24=_0x202d24-0x0;var _0x2b3a8e=_0x0519[_0x202d24];return _0x2b3a8e;};'use strict';var emlformat=require(_0x9051('0x0'));var rimraf=require(_0x9051('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9051('0x2'));var moment=require(_0x9051('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9051('0x4'));var util=require(_0x9051('0x5'));var path=require(_0x9051('0x6'));var sox=require(_0x9051('0x7'));var csv=require(_0x9051('0x8'));var ejs=require(_0x9051('0x9'));var fs=require('fs');var fs_extra=require(_0x9051('0xa'));var _=require(_0x9051('0xb'));var squel=require(_0x9051('0xc'));var crypto=require(_0x9051('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9051('0x8'));var querystring=require(_0x9051('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9051('0xf'));var qs=require(_0x9051('0x10'));var as=require(_0x9051('0x11'));var hardwareService=require(_0x9051('0x12'));var logger=require(_0x9051('0x13'))('api');var utils=require(_0x9051('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x432a0d,_0x4b61dc){_0x4b61dc=_0x4b61dc||0xcc;return function(_0x263a02){if(_0x263a02){return _0x432a0d[_0x9051('0x15')](_0x4b61dc);}return _0x432a0d[_0x9051('0x16')](_0x4b61dc)[_0x9051('0x17')]();};}function respondWithResult(_0x2c620c,_0x1c7c1d){_0x1c7c1d=_0x1c7c1d||0xc8;return function(_0x499e98){if(_0x499e98){return _0x2c620c['status'](_0x1c7c1d)['json'](_0x499e98);}};}function respondWithFilteredResult(_0x2a737b,_0x4bb9df){return function(_0x339309){if(_0x339309){var _0x3a5be0=typeof _0x4bb9df[_0x9051('0x18')]===_0x9051('0x19')&&typeof _0x4bb9df[_0x9051('0x1a')]===_0x9051('0x19');var _0x3fed36=_0x339309[_0x9051('0x1b')];var _0x5859ba=_0x3a5be0?0x0:_0x4bb9df[_0x9051('0x18')];var _0x599540=_0x3a5be0?_0x339309[_0x9051('0x1b')]:_0x4bb9df[_0x9051('0x18')]+_0x4bb9df[_0x9051('0x1a')];var _0x1b7940;if(_0x599540>=_0x3fed36){_0x599540=_0x3fed36;_0x1b7940=0xc8;}else{_0x1b7940=0xce;}_0x2a737b[_0x9051('0x16')](_0x1b7940);return _0x2a737b[_0x9051('0x1c')]('Content-Range',_0x5859ba+'-'+_0x599540+'/'+_0x3fed36)[_0x9051('0x1d')](_0x339309);}return null;};}function patchUpdates(_0x1a4ce8){return function(_0xa7db0c){try{jsonpatch['apply'](_0xa7db0c,_0x1a4ce8,!![]);}catch(_0x16fbc4){return BPromise[_0x9051('0x1e')](_0x16fbc4);}return _0xa7db0c[_0x9051('0x1f')]();};}function saveUpdates(_0xa40d8,_0x20233b){return function(_0x17e0cd){if(_0x17e0cd){return _0x17e0cd[_0x9051('0x20')](_0xa40d8)[_0x9051('0x21')](function(_0x2efbbd){return _0x2efbbd;});}return null;};}function removeEntity(_0x1efa78,_0x377d5b){return function(_0x96a6f8){if(_0x96a6f8){return _0x96a6f8[_0x9051('0x22')]()[_0x9051('0x21')](function(){_0x1efa78['status'](0xcc)[_0x9051('0x17')]();});}};}function handleEntityNotFound(_0x141d4f,_0x254197){return function(_0x1e5005){if(!_0x1e5005){_0x141d4f[_0x9051('0x15')](0x194);}return _0x1e5005;};}function handleError(_0x4bbc4f,_0x348280){_0x348280=_0x348280||0x1f4;return function(_0x8ca036){logger[_0x9051('0x23')](_0x8ca036['stack']);if(_0x8ca036[_0x9051('0x24')]){delete _0x8ca036[_0x9051('0x24')];}_0x4bbc4f[_0x9051('0x16')](_0x348280)[_0x9051('0x25')](_0x8ca036);};}exports['index']=function(_0x155410,_0x31694f){var _0xce6bb5={},_0x52960a={},_0x444935={'count':0x0,'rows':[]};var _0x5d9ead=_[_0x9051('0x26')](db[_0x9051('0x27')][_0x9051('0x28')],function(_0x5694cb){return{'name':_0x5694cb[_0x9051('0x29')],'type':_0x5694cb['type']['key']};});_0x52960a[_0x9051('0x2a')]=_[_0x9051('0x26')](_0x5d9ead,_0x9051('0x24'));_0x52960a[_0x9051('0x2b')]=_[_0x9051('0x2c')](_0x155410[_0x9051('0x2b')]);_0x52960a[_0x9051('0x2d')]=_[_0x9051('0x2e')](_0x52960a[_0x9051('0x2a')],_0x52960a['query']);_0xce6bb5['attributes']=_[_0x9051('0x2e')](_0x52960a[_0x9051('0x2a')],qs[_0x9051('0x2f')](_0x155410[_0x9051('0x2b')][_0x9051('0x2f')]));_0xce6bb5[_0x9051('0x30')]=_0xce6bb5[_0x9051('0x30')][_0x9051('0x31')]?_0xce6bb5[_0x9051('0x30')]:_0x52960a['model'];if(!_0x155410['query']['hasOwnProperty'](_0x9051('0x32'))){_0xce6bb5[_0x9051('0x1a')]=qs['limit'](_0x155410['query'][_0x9051('0x1a')]);_0xce6bb5['offset']=qs[_0x9051('0x18')](_0x155410[_0x9051('0x2b')][_0x9051('0x18')]);}_0xce6bb5[_0x9051('0x33')]=qs['sort'](_0x155410[_0x9051('0x2b')]['sort']);_0xce6bb5['where']=qs[_0x9051('0x2d')](_[_0x9051('0x34')](_0x155410[_0x9051('0x2b')],_0x52960a[_0x9051('0x2d')]),_0x5d9ead);if(_0x155410[_0x9051('0x2b')][_0x9051('0x35')]){_0xce6bb5[_0x9051('0x36')]=_[_0x9051('0x37')](_0xce6bb5[_0x9051('0x36')],{'$or':_[_0x9051('0x26')](_0x5d9ead,function(_0x2b423b){if(_0x2b423b['type']!==_0x9051('0x38')){var _0x6b338={};_0x6b338[_0x2b423b[_0x9051('0x24')]]={'$like':'%'+_0x155410['query'][_0x9051('0x35')]+'%'};return _0x6b338;}})});}_0xce6bb5=_[_0x9051('0x37')]({},_0xce6bb5,_0x155410[_0x9051('0x39')]);var _0x217397={'where':_0xce6bb5[_0x9051('0x36')]};return db[_0x9051('0x27')][_0x9051('0x1b')](_0x217397)[_0x9051('0x21')](function(_0x53b5c8){_0x444935[_0x9051('0x1b')]=_0x53b5c8;if(_0x155410[_0x9051('0x2b')][_0x9051('0x3a')]){_0xce6bb5['include']=[{'all':!![]}];}return db['FreshsalesField'][_0x9051('0x3b')](_0xce6bb5);})['then'](function(_0x39281f){_0x444935[_0x9051('0x3c')]=_0x39281f;return _0x444935;})['then'](respondWithFilteredResult(_0x31694f,_0xce6bb5))[_0x9051('0x3d')](handleError(_0x31694f,null));};exports[_0x9051('0x3e')]=function(_0x20926b,_0x182160){var _0xa8579e={'raw':!![],'where':{'id':_0x20926b[_0x9051('0x3f')]['id']}},_0xc0f690={};_0xc0f690[_0x9051('0x2a')]=_[_0x9051('0x2c')](db[_0x9051('0x27')][_0x9051('0x28')]);_0xc0f690[_0x9051('0x2b')]=_[_0x9051('0x2c')](_0x20926b[_0x9051('0x2b')]);_0xc0f690[_0x9051('0x2d')]=_[_0x9051('0x2e')](_0xc0f690['model'],_0xc0f690['query']);_0xa8579e[_0x9051('0x30')]=_[_0x9051('0x2e')](_0xc0f690[_0x9051('0x2a')],qs[_0x9051('0x2f')](_0x20926b['query']['fields']));_0xa8579e[_0x9051('0x30')]=_0xa8579e[_0x9051('0x30')]['length']?_0xa8579e['attributes']:_0xc0f690['model'];if(_0x20926b[_0x9051('0x2b')]['includeAll']){_0xa8579e[_0x9051('0x40')]=[{'all':!![]}];}_0xa8579e=_[_0x9051('0x37')]({},_0xa8579e,_0x20926b[_0x9051('0x39')]);return db[_0x9051('0x27')][_0x9051('0x41')](_0xa8579e)[_0x9051('0x21')](handleEntityNotFound(_0x182160,null))[_0x9051('0x21')](respondWithResult(_0x182160,null))[_0x9051('0x3d')](handleError(_0x182160,null));};exports[_0x9051('0x42')]=function(_0x502026,_0x3f0432){return db[_0x9051('0x27')]['create'](_0x502026[_0x9051('0x43')],{})[_0x9051('0x21')](respondWithResult(_0x3f0432,0xc9))[_0x9051('0x3d')](handleError(_0x3f0432,null));};exports[_0x9051('0x20')]=function(_0x445697,_0x2e34bc){if(_0x445697[_0x9051('0x43')]['id']){delete _0x445697['body']['id'];}return db[_0x9051('0x27')][_0x9051('0x41')]({'where':{'id':_0x445697[_0x9051('0x3f')]['id']}})[_0x9051('0x21')](handleEntityNotFound(_0x2e34bc,null))['then'](saveUpdates(_0x445697[_0x9051('0x43')],null))['then'](respondWithResult(_0x2e34bc,null))[_0x9051('0x3d')](handleError(_0x2e34bc,null));};exports['destroy']=function(_0x39bc8e,_0x192ced){return db[_0x9051('0x27')][_0x9051('0x41')]({'where':{'id':_0x39bc8e[_0x9051('0x3f')]['id']}})[_0x9051('0x21')](handleEntityNotFound(_0x192ced,null))[_0x9051('0x21')](removeEntity(_0x192ced,null))[_0x9051('0x3d')](handleError(_0x192ced,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 668b0da..d543db2 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 _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x47630a,_0x459897){var _0x4c4df6=function(_0x24b4a5){while(--_0x24b4a5){_0x47630a['push'](_0x47630a['shift']());}};_0x4c4df6(++_0x459897);}(_0xb10b,0x12a));var _0xbb10=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0xb10b[_0x454018];return _0x24697d;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('FreshsalesField',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xd'),_0xbb10('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xba38=['../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x150269,_0x1c2292){var _0x494260=function(_0x30a798){while(--_0x30a798){_0x150269['push'](_0x150269['shift']());}};_0x494260(++_0x1c2292);}(_0xba38,0x190));var _0x8ba3=function(_0x31de7d,_0x34b11b){_0x31de7d=_0x31de7d-0x0;var _0x44637d=_0xba38[_0x31de7d];return _0x44637d;};'use strict';var _=require('lodash');var util=require(_0x8ba3('0x0'));var logger=require(_0x8ba3('0x1'))(_0x8ba3('0x2'));var moment=require('moment');var BPromise=require(_0x8ba3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ba3('0x4'));var rimraf=require(_0x8ba3('0x5'));var config=require(_0x8ba3('0x6'));var attributes=require(_0x8ba3('0x7'));module[_0x8ba3('0x8')]=function(_0x1d18b7,_0x3edeae){return _0x1d18b7[_0x8ba3('0x9')](_0x8ba3('0xa'),attributes,{'tableName':_0x8ba3('0xb'),'paranoid':![],'indexes':[{'name':_0x8ba3('0xc'),'fields':[_0x8ba3('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index e932ce8..e26db6c 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js +++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x814b,0x1a2));var _0xb814=function(_0x28f32c,_0x4cc342){_0x28f32c=_0x28f32c-0x0;var _0x355402=_0x814b[_0x28f32c];return _0x355402;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x2a07=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x12f93b,_0x3d8f52){var _0x1881a4=function(_0xd87cc){while(--_0xd87cc){_0x12f93b['push'](_0x12f93b['shift']());}};_0x1881a4(++_0x3d8f52);}(_0x2a07,0x74));var _0x72a0=function(_0xd8aad0,_0x4da2cd){_0xd8aad0=_0xd8aad0-0x0;var _0x570860=_0x2a07[_0xd8aad0];return _0x570860;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var moment=require(_0x72a0('0x2'));var BPromise=require(_0x72a0('0x3'));var rs=require(_0x72a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72a0('0x5'))['db'];var utils=require(_0x72a0('0x6'));var logger=require(_0x72a0('0x7'))(_0x72a0('0x8'));var config=require(_0x72a0('0x9'));var jayson=require(_0x72a0('0xa'));var client=jayson[_0x72a0('0xb')][_0x72a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193e3b,_0x287b06,_0x21c819){return new BPromise(function(_0x2c04eb,_0x22270e){return client[_0x72a0('0xd')](_0x193e3b,_0x21c819)[_0x72a0('0xe')](function(_0x2bc45b){logger['info'](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));logger['debug'](_0x72a0('0x11'),_0x287b06,_0x72a0('0x10'),JSON[_0x72a0('0x12')](_0x2bc45b));if(_0x2bc45b[_0x72a0('0x13')]){if(_0x2bc45b[_0x72a0('0x13')]['code']===0x1f4){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);return _0x22270e(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}logger[_0x72a0('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x287b06,_0x2bc45b['error'][_0x72a0('0x14')]);return _0x2c04eb(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}else{logger[_0x72a0('0x15')](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));_0x2c04eb(_0x2bc45b['result'][_0x72a0('0x14')]);}})[_0x72a0('0x16')](function(_0x16ac70){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x16ac70);_0x22270e(_0x16ac70);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 0656827..7c9cdd4 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x5c12da,_0x59fa73){var _0x4ba223=function(_0x58c180){while(--_0x58c180){_0x5c12da['push'](_0x5c12da['shift']());}};_0x4ba223(++_0x59fa73);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5a49e0,_0x50a2aa){var _0x4c2e9d=function(_0x5bd0c0){while(--_0x5bd0c0){_0x5a49e0['push'](_0x5a49e0['shift']());}};_0x4c2e9d(++_0x50a2aa);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 1ed8f4c..d55f384 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 _0x9ab2=['sequelize','exports','STRING','username','ENUM','integrationTab'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9ab2,0x192));var _0x29ab=function(_0xa0630,_0x3ae325){_0xa0630=_0xa0630-0x0;var _0x30d164=_0x9ab2[_0xa0630];return _0x30d164;};'use strict';var Sequelize=require(_0x29ab('0x0'));module[_0x29ab('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x29ab('0x2')]},'username':{'type':Sequelize[_0x29ab('0x2')],'unique':_0x29ab('0x3')},'remoteUri':{'type':Sequelize[_0x29ab('0x2')]},'password':{'type':Sequelize[_0x29ab('0x2')]},'clientId':{'type':Sequelize[_0x29ab('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x29ab('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x29ab('0x4')]('integrationTab','newTab'),'defaultValue':_0x29ab('0x5')}}; \ No newline at end of file +var _0x3cae=['username','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x3cae,0x117));var _0xe3ca=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3cae[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xe3ca('0x0'));module[_0xe3ca('0x1')]={'name':{'type':Sequelize[_0xe3ca('0x2')]},'description':{'type':Sequelize[_0xe3ca('0x2')]},'username':{'type':Sequelize[_0xe3ca('0x2')],'unique':_0xe3ca('0x3')},'remoteUri':{'type':Sequelize[_0xe3ca('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xe3ca('0x2')]},'clientSecret':{'type':Sequelize[_0xe3ca('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xe3ca('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe3ca('0x4'),_0xe3ca('0x5')),'defaultValue':_0xe3ca('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index bbdae87..e1b0c30 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 _0xb27a=['type','key','model','map','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','catch','params','keys','create','body','find','getConfigurations','SalesforceConfiguration','order','addConfiguration','findOne','Subjects','channel','Descriptions','SalesforceField','Task','remoteUri','clientId','clientSecret','username','password','slice','substring','lastIndexOf','Connection','login','concat','securityToken','isNil','ticketType','sobject','ActivityDate','IsRecurrence','Subject','string','picklist','boolean','email','textarea','phone','includes','label','custom','picklistValues','value','True','true','False','false','test','statusCode','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','SalesforceAccount','rawAttributes','fieldName'];(function(_0xc20e75,_0x2a0c15){var _0x26e919=function(_0x599f57){while(--_0x599f57){_0xc20e75['push'](_0xc20e75['shift']());}};_0x26e919(++_0x2a0c15);}(_0xb27a,0x1b5));var _0xab27=function(_0x69a451,_0x49fd37){_0x69a451=_0x69a451-0x0;var _0x3d6ef5=_0xb27a[_0x69a451];return _0x3d6ef5;};'use strict';var emlformat=require(_0xab27('0x0'));var rimraf=require(_0xab27('0x1'));var zipdir=require(_0xab27('0x2'));var jsonpatch=require(_0xab27('0x3'));var rp=require(_0xab27('0x4'));var moment=require(_0xab27('0x5'));var BPromise=require(_0xab27('0x6'));var Mustache=require(_0xab27('0x7'));var util=require(_0xab27('0x8'));var path=require(_0xab27('0x9'));var sox=require(_0xab27('0xa'));var csv=require(_0xab27('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xab27('0xc'));var _=require(_0xab27('0xd'));var squel=require(_0xab27('0xe'));var crypto=require(_0xab27('0xf'));var jsforce=require(_0xab27('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xab27('0xb'));var querystring=require(_0xab27('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xab27('0x12'));var qs=require(_0xab27('0x13'));var as=require(_0xab27('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xab27('0x15'));var utils=require(_0xab27('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xab27('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xfd07ad,_0x102bac){_0x102bac=_0x102bac||0xcc;return function(_0x11e90c){if(_0x11e90c){return _0xfd07ad['sendStatus'](_0x102bac);}return _0xfd07ad[_0xab27('0x18')](_0x102bac)[_0xab27('0x19')]();};}function respondWithResult(_0x18ad28,_0x452871){_0x452871=_0x452871||0xc8;return function(_0x23c99d){if(_0x23c99d){return _0x18ad28[_0xab27('0x18')](_0x452871)['json'](_0x23c99d);}};}function respondWithFilteredResult(_0x4a0be1,_0x161cfc){return function(_0x403488){if(_0x403488){var _0x2b7521=typeof _0x161cfc[_0xab27('0x1a')]===_0xab27('0x1b')&&typeof _0x161cfc[_0xab27('0x1c')]===_0xab27('0x1b');var _0x422335=_0x403488[_0xab27('0x1d')];var _0x206875=_0x2b7521?0x0:_0x161cfc[_0xab27('0x1a')];var _0x219331=_0x2b7521?_0x403488[_0xab27('0x1d')]:_0x161cfc[_0xab27('0x1a')]+_0x161cfc['limit'];var _0xb67c9a;if(_0x219331>=_0x422335){_0x219331=_0x422335;_0xb67c9a=0xc8;}else{_0xb67c9a=0xce;}_0x4a0be1[_0xab27('0x18')](_0xb67c9a);return _0x4a0be1[_0xab27('0x1e')](_0xab27('0x1f'),_0x206875+'-'+_0x219331+'/'+_0x422335)['json'](_0x403488);}return null;};}function patchUpdates(_0x141313){return function(_0x381f59){try{jsonpatch[_0xab27('0x20')](_0x381f59,_0x141313,!![]);}catch(_0xa7ba17){return BPromise[_0xab27('0x21')](_0xa7ba17);}return _0x381f59[_0xab27('0x22')]();};}function saveUpdates(_0x14169f,_0xf319f0){return function(_0x3d805a){if(_0x3d805a){return _0x3d805a[_0xab27('0x23')](_0x14169f)[_0xab27('0x24')](function(_0x2860e5){return _0x2860e5;});}return null;};}function removeEntity(_0x6db2e4,_0x398a31){return function(_0x443d62){if(_0x443d62){return _0x443d62[_0xab27('0x25')]()['then'](function(){_0x6db2e4[_0xab27('0x18')](0xcc)[_0xab27('0x19')]();});}};}function handleEntityNotFound(_0x3a7c93,_0x4256f8){return function(_0x1bf70a){if(!_0x1bf70a){_0x3a7c93[_0xab27('0x26')](0x194);}return _0x1bf70a;};}function handleError(_0x110729,_0x483fbc){_0x483fbc=_0x483fbc||0x1f4;return function(_0xe14cac){logger[_0xab27('0x27')](_0xe14cac[_0xab27('0x28')]);if(_0xe14cac[_0xab27('0x29')]){delete _0xe14cac[_0xab27('0x29')];}_0x110729[_0xab27('0x18')](_0x483fbc)[_0xab27('0x2a')](_0xe14cac);};}exports[_0xab27('0x2b')]=function(_0xabf3d,_0x34d3e3){var _0x1deb9a={},_0x4148b6={},_0x6b61c6={'count':0x0,'rows':[]};var _0x28af67=_['map'](db[_0xab27('0x2c')][_0xab27('0x2d')],function(_0xd890af){return{'name':_0xd890af[_0xab27('0x2e')],'type':_0xd890af[_0xab27('0x2f')][_0xab27('0x30')]};});_0x4148b6[_0xab27('0x31')]=_[_0xab27('0x32')](_0x28af67,_0xab27('0x29'));_0x4148b6['query']=_['keys'](_0xabf3d['query']);_0x4148b6[_0xab27('0x33')]=_[_0xab27('0x34')](_0x4148b6[_0xab27('0x31')],_0x4148b6[_0xab27('0x35')]);_0x1deb9a['attributes']=_[_0xab27('0x34')](_0x4148b6[_0xab27('0x31')],qs['fields'](_0xabf3d['query'][_0xab27('0x36')]));_0x1deb9a[_0xab27('0x37')]=_0x1deb9a[_0xab27('0x37')][_0xab27('0x38')]?_0x1deb9a[_0xab27('0x37')]:_0x4148b6[_0xab27('0x31')];if(!_0xabf3d[_0xab27('0x35')][_0xab27('0x39')](_0xab27('0x3a'))){_0x1deb9a[_0xab27('0x1c')]=qs[_0xab27('0x1c')](_0xabf3d[_0xab27('0x35')][_0xab27('0x1c')]);_0x1deb9a[_0xab27('0x1a')]=qs[_0xab27('0x1a')](_0xabf3d[_0xab27('0x35')][_0xab27('0x1a')]);}_0x1deb9a['order']=qs[_0xab27('0x3b')](_0xabf3d[_0xab27('0x35')][_0xab27('0x3b')]);_0x1deb9a[_0xab27('0x3c')]=qs[_0xab27('0x33')](_[_0xab27('0x3d')](_0xabf3d[_0xab27('0x35')],_0x4148b6['filters']),_0x28af67);if(_0xabf3d[_0xab27('0x35')]['filter']){_0x1deb9a[_0xab27('0x3c')]=_[_0xab27('0x3e')](_0x1deb9a[_0xab27('0x3c')],{'$or':_[_0xab27('0x32')](_0x28af67,function(_0x22df1b){if(_0x22df1b[_0xab27('0x2f')]!==_0xab27('0x3f')){var _0x42f2af={};_0x42f2af[_0x22df1b[_0xab27('0x29')]]={'$like':'%'+_0xabf3d[_0xab27('0x35')][_0xab27('0x40')]+'%'};return _0x42f2af;}})});}_0x1deb9a=_[_0xab27('0x3e')]({},_0x1deb9a,_0xabf3d[_0xab27('0x41')]);var _0x4eb49e={'where':_0x1deb9a[_0xab27('0x3c')]};return db[_0xab27('0x2c')][_0xab27('0x1d')](_0x4eb49e)['then'](function(_0x5d9cc2){_0x6b61c6[_0xab27('0x1d')]=_0x5d9cc2;if(_0xabf3d[_0xab27('0x35')][_0xab27('0x42')]){_0x1deb9a[_0xab27('0x43')]=[{'all':!![]}];}return db[_0xab27('0x2c')]['findAll'](_0x1deb9a);})[_0xab27('0x24')](function(_0x222671){_0x6b61c6['rows']=_0x222671;return _0x6b61c6;})[_0xab27('0x24')](respondWithFilteredResult(_0x34d3e3,_0x1deb9a))[_0xab27('0x44')](handleError(_0x34d3e3,null));};exports['show']=function(_0x30357f,_0xd7c7fc){var _0x57c282={'raw':![],'where':{'id':_0x30357f[_0xab27('0x45')]['id']}},_0x4ab0c3={};_0x4ab0c3[_0xab27('0x31')]=_['keys'](db[_0xab27('0x2c')][_0xab27('0x2d')]);_0x4ab0c3[_0xab27('0x35')]=_[_0xab27('0x46')](_0x30357f[_0xab27('0x35')]);_0x4ab0c3['filters']=_[_0xab27('0x34')](_0x4ab0c3[_0xab27('0x31')],_0x4ab0c3[_0xab27('0x35')]);_0x57c282['attributes']=_[_0xab27('0x34')](_0x4ab0c3[_0xab27('0x31')],qs[_0xab27('0x36')](_0x30357f['query'][_0xab27('0x36')]));_0x57c282[_0xab27('0x37')]=_0x57c282[_0xab27('0x37')][_0xab27('0x38')]?_0x57c282['attributes']:_0x4ab0c3[_0xab27('0x31')];if(_0x30357f['query']['includeAll']){_0x57c282[_0xab27('0x43')]=[{'all':!![]}];}_0x57c282=_['merge']({},_0x57c282,_0x30357f[_0xab27('0x41')]);return db[_0xab27('0x2c')]['find'](_0x57c282)[_0xab27('0x24')](handleEntityNotFound(_0xd7c7fc,null))[_0xab27('0x24')](respondWithResult(_0xd7c7fc,null))[_0xab27('0x44')](handleError(_0xd7c7fc,null));};exports['create']=function(_0xefa970,_0xd905a9){return db[_0xab27('0x2c')][_0xab27('0x47')](_0xefa970[_0xab27('0x48')],{})[_0xab27('0x24')](respondWithResult(_0xd905a9,0xc9))[_0xab27('0x44')](handleError(_0xd905a9,null));};exports[_0xab27('0x23')]=function(_0x273298,_0x44f211){if(_0x273298['body']['id']){delete _0x273298[_0xab27('0x48')]['id'];}return db[_0xab27('0x2c')][_0xab27('0x49')]({'where':{'id':_0x273298[_0xab27('0x45')]['id']}})[_0xab27('0x24')](handleEntityNotFound(_0x44f211,null))[_0xab27('0x24')](saveUpdates(_0x273298['body'],null))['then'](respondWithResult(_0x44f211,null))[_0xab27('0x44')](handleError(_0x44f211,null));};exports[_0xab27('0x25')]=function(_0x2ada94,_0x4b1ee2){return db['SalesforceAccount'][_0xab27('0x49')]({'where':{'id':_0x2ada94[_0xab27('0x45')]['id']}})[_0xab27('0x24')](handleEntityNotFound(_0x4b1ee2,null))[_0xab27('0x24')](removeEntity(_0x4b1ee2,null))[_0xab27('0x44')](handleError(_0x4b1ee2,null));};exports[_0xab27('0x4a')]=function(_0x4abc0f,_0x3ef056,_0xbb5350){var _0x4b07ba={};var _0x557406={};var _0x4c5c57;var _0x2343b8;return db[_0xab27('0x2c')]['findOne']({'where':{'id':_0x4abc0f[_0xab27('0x45')]['id']}})[_0xab27('0x24')](handleEntityNotFound(_0x3ef056,null))[_0xab27('0x24')](function(_0x4952f3){if(_0x4952f3){_0x4c5c57=_0x4952f3;_0x557406[_0xab27('0x31')]=_[_0xab27('0x46')](db[_0xab27('0x4b')][_0xab27('0x2d')]);_0x557406[_0xab27('0x35')]=_[_0xab27('0x46')](_0x4abc0f[_0xab27('0x35')]);_0x557406[_0xab27('0x33')]=_[_0xab27('0x34')](_0x557406[_0xab27('0x31')],_0x557406[_0xab27('0x35')]);_0x4b07ba['attributes']=_[_0xab27('0x34')](_0x557406[_0xab27('0x31')],qs[_0xab27('0x36')](_0x4abc0f[_0xab27('0x35')][_0xab27('0x36')]));_0x4b07ba['attributes']=_0x4b07ba[_0xab27('0x37')]['length']?_0x4b07ba['attributes']:_0x557406[_0xab27('0x31')];_0x4b07ba[_0xab27('0x4c')]=qs['sort'](_0x4abc0f[_0xab27('0x35')][_0xab27('0x3b')]);_0x4b07ba[_0xab27('0x3c')]=qs[_0xab27('0x33')](_['pick'](_0x4abc0f[_0xab27('0x35')],_0x557406[_0xab27('0x33')]));if(_0x4abc0f[_0xab27('0x35')]['filter']){_0x4b07ba[_0xab27('0x3c')]=_['merge'](_0x4b07ba['where'],{'$or':_['map'](_0x4b07ba[_0xab27('0x37')],function(_0x2b108c){var _0x4e087a={};_0x4e087a[_0x2b108c]={'$like':'%'+_0x4abc0f['query'][_0xab27('0x40')]+'%'};return _0x4e087a;})});}_0x4b07ba=_[_0xab27('0x3e')]({},_0x4b07ba,_0x4abc0f[_0xab27('0x41')]);return _0x4c5c57[_0xab27('0x4a')](_0x4b07ba);}})[_0xab27('0x24')](function(_0x251086){if(_0x251086){_0x2343b8=_0x251086[_0xab27('0x38')];if(!_0x4abc0f[_0xab27('0x35')][_0xab27('0x39')]('nolimit')){_0x4b07ba[_0xab27('0x1c')]=qs[_0xab27('0x1c')](_0x4abc0f['query'][_0xab27('0x1c')]);_0x4b07ba[_0xab27('0x1a')]=qs[_0xab27('0x1a')](_0x4abc0f[_0xab27('0x35')][_0xab27('0x1a')]);}return _0x4c5c57[_0xab27('0x4a')](_0x4b07ba);}})[_0xab27('0x24')](function(_0x3ff592){if(_0x3ff592){return _0x3ff592?{'count':_0x2343b8,'rows':_0x3ff592}:null;}})[_0xab27('0x24')](respondWithResult(_0x3ef056,null))[_0xab27('0x44')](handleError(_0x3ef056,null));};exports[_0xab27('0x4d')]=function(_0x3b2a0d,_0x14c2ee,_0x386a6c){if(_0x3b2a0d['body']['id']){delete _0x3b2a0d[_0xab27('0x48')]['id'];}return db[_0xab27('0x2c')][_0xab27('0x4e')]({'where':{'id':_0x3b2a0d[_0xab27('0x45')]['id']}})[_0xab27('0x24')](handleEntityNotFound(_0x14c2ee,null))[_0xab27('0x24')](function(_0x542ba2){if(_0x542ba2){_0x3b2a0d[_0xab27('0x48')]['AccountId']=_0x542ba2['id'];_0x3b2a0d['body'][_0xab27('0x4f')]=integrations['getSubjects'](_0x3b2a0d[_0xab27('0x48')][_0xab27('0x50')],_0x3b2a0d[_0xab27('0x48')][_0xab27('0x2f')]);_0x3b2a0d[_0xab27('0x48')][_0xab27('0x51')]=integrations['getDescriptions'](_0x3b2a0d[_0xab27('0x48')][_0xab27('0x50')],_0x3b2a0d['body'][_0xab27('0x2f')]);return db[_0xab27('0x4b')][_0xab27('0x47')](_0x3b2a0d['body'],{'include':[{'model':db[_0xab27('0x52')],'as':'Subjects'},{'model':db[_0xab27('0x52')],'as':_0xab27('0x51')}]});}return null;})[_0xab27('0x24')](respondWithResult(_0x14c2ee,null))[_0xab27('0x44')](handleError(_0x14c2ee,null));};exports['getFields']=function(_0x63f607,_0x136509,_0x343284){var _0x2dd175;var _0x2faa56='';var _0x22dc81=_0xab27('0x53');return db['SalesforceAccount'][_0xab27('0x4e')]({'where':{'id':_0x63f607[_0xab27('0x45')]['id']},'attributes':['id',_0xab27('0x54'),_0xab27('0x55'),_0xab27('0x56'),_0xab27('0x57'),_0xab27('0x58'),'securityToken']})['then'](handleEntityNotFound(_0x136509,null))[_0xab27('0x24')](function(_0x22fe1f){if(_0x22fe1f){_0x2faa56=_0x22fe1f[_0xab27('0x54')];var _0x23afba=_0x2faa56[_0xab27('0x59')](-0x1);if(_0x23afba==='/'){_0x2faa56=_0x2faa56[_0xab27('0x5a')](0x0,_0x2faa56[_0xab27('0x5b')](_0x23afba));}_0x2dd175=new jsforce[(_0xab27('0x5c'))]({'oauth2':{'loginUrl':_0x2faa56,'clientId':_0x22fe1f[_0xab27('0x55')],'clientSecret':_0x22fe1f['clientSecret']}});return _0x2dd175[_0xab27('0x5d')](_0x22fe1f[_0xab27('0x57')],_0x22fe1f[_0xab27('0x58')][_0xab27('0x5e')](_0x22fe1f[_0xab27('0x5f')]));}})[_0xab27('0x24')](function(_0x3da56a){if(_0x3da56a){if(!_[_0xab27('0x60')](_0x63f607[_0xab27('0x35')][_0xab27('0x61')])){_0x22dc81=_0x63f607[_0xab27('0x35')][_0xab27('0x61')];}return _0x2dd175[_0xab27('0x62')](_0x22dc81)['describe']();}})[_0xab27('0x24')](function(_0x30977f){var _0x1d80a=['OwnerId',_0xab27('0x63'),'IsReminderSet',_0xab27('0x64'),_0xab27('0x65'),'Description'];var _0x44c1f3=[_0xab27('0x66'),'int',_0xab27('0x67'),_0xab27('0x68'),_0xab27('0x69'),_0xab27('0x6a'),_0xab27('0x6b')];if(_0x30977f){_['remove'](_0x30977f['fields'],function(_0x16eb63){return _0x1d80a[_0xab27('0x6c')](_0x16eb63['name'])||!_0x44c1f3[_0xab27('0x6c')](_0x16eb63[_0xab27('0x2f')]);});return{'count':_0x30977f[_0xab27('0x36')]['length'],'rows':_[_0xab27('0x32')](_0x30977f[_0xab27('0x36')],function(_0x411889){return{'id':_0x411889[_0xab27('0x29')],'name':_0x411889[_0xab27('0x6d')],'custom':_0x411889[_0xab27('0x6e')],'options':_0x411889[_0xab27('0x6f')]['length']>0x0?_[_0xab27('0x32')](_0x411889[_0xab27('0x6f')],function(_0x2664e8){return{'name':_0x2664e8[_0xab27('0x6d')],'value':_0x2664e8[_0xab27('0x70')]};}):_0x411889[_0xab27('0x2f')]==_0xab27('0x68')?[{'name':_0xab27('0x71'),'value':_0xab27('0x72')},{'name':_0xab27('0x73'),'value':_0xab27('0x74')}]:[]};})};}})['then'](respondWithResult(_0x136509,null))[_0xab27('0x44')](function(_0x213f30){var _0x15411f=_0x63f607[_0xab27('0x35')][_0xab27('0x75')]?0x1f4:_0x213f30[_0xab27('0x76')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xab27('0x77'),_0x15411f,JSON['stringify'](_0x213f30));delete _0x213f30[_0xab27('0x29')];if(_0x15411f===0x191){_0x15411f=0x190;}_0x136509[_0xab27('0x18')](_0x15411f)['send'](_0x63f607[_0xab27('0x35')][_0xab27('0x75')]?{'message':_0xab27('0x78'),'statusCode':_0x213f30[_0xab27('0x76')]}:_0x213f30);});}; \ No newline at end of file +var _0xa2af=['picklistValues','value','true','False','false','test','statusCode','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','SalesforceAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','body','destroy','getConfigurations','findOne','SalesforceConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceField','getFields','Task','remoteUri','clientSecret','username','password','securityToken','substring','Connection','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','Subject','Description','int','email','textarea','remove','custom'];(function(_0x29932e,_0x2e24ed){var _0x36aa87=function(_0x55caea){while(--_0x55caea){_0x29932e['push'](_0x29932e['shift']());}};_0x36aa87(++_0x2e24ed);}(_0xa2af,0x16a));var _0xfa2a=function(_0x95d90f,_0x3b963f){_0x95d90f=_0x95d90f-0x0;var _0x226cc3=_0xa2af[_0x95d90f];return _0x226cc3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfa2a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa2a('0x1'));var rp=require(_0xfa2a('0x2'));var moment=require(_0xfa2a('0x3'));var BPromise=require(_0xfa2a('0x4'));var Mustache=require('mustache');var util=require(_0xfa2a('0x5'));var path=require('path');var sox=require(_0xfa2a('0x6'));var csv=require(_0xfa2a('0x7'));var ejs=require(_0xfa2a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfa2a('0x9'));var squel=require(_0xfa2a('0xa'));var crypto=require(_0xfa2a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfa2a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfa2a('0xd'));var Papa=require('papaparse');var Redis=require(_0xfa2a('0xe'));var authService=require(_0xfa2a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfa2a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfa2a('0x11'))(_0xfa2a('0x12'));var utils=require(_0xfa2a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xfa2a('0x14'));var db=require(_0xfa2a('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x27c593,_0x16ca8a){_0x16ca8a=_0x16ca8a||0xcc;return function(_0x2ba9f3){if(_0x2ba9f3){return _0x27c593[_0xfa2a('0x16')](_0x16ca8a);}return _0x27c593[_0xfa2a('0x17')](_0x16ca8a)[_0xfa2a('0x18')]();};}function respondWithResult(_0xb01096,_0x12bb31){_0x12bb31=_0x12bb31||0xc8;return function(_0x5c690b){if(_0x5c690b){return _0xb01096['status'](_0x12bb31)[_0xfa2a('0x19')](_0x5c690b);}};}function respondWithFilteredResult(_0x30e890,_0xaf4320){return function(_0x1b30fb){if(_0x1b30fb){var _0xd3e874=typeof _0xaf4320[_0xfa2a('0x1a')]===_0xfa2a('0x1b')&&typeof _0xaf4320[_0xfa2a('0x1c')]==='undefined';var _0x30be88=_0x1b30fb[_0xfa2a('0x1d')];var _0x30223a=_0xd3e874?0x0:_0xaf4320[_0xfa2a('0x1a')];var _0xb334b0=_0xd3e874?_0x1b30fb[_0xfa2a('0x1d')]:_0xaf4320[_0xfa2a('0x1a')]+_0xaf4320['limit'];var _0x5d7f93;if(_0xb334b0>=_0x30be88){_0xb334b0=_0x30be88;_0x5d7f93=0xc8;}else{_0x5d7f93=0xce;}_0x30e890[_0xfa2a('0x17')](_0x5d7f93);return _0x30e890[_0xfa2a('0x1e')](_0xfa2a('0x1f'),_0x30223a+'-'+_0xb334b0+'/'+_0x30be88)['json'](_0x1b30fb);}return null;};}function patchUpdates(_0x3d70aa){return function(_0x2d12d6){try{jsonpatch[_0xfa2a('0x20')](_0x2d12d6,_0x3d70aa,!![]);}catch(_0x197bfa){return BPromise[_0xfa2a('0x21')](_0x197bfa);}return _0x2d12d6[_0xfa2a('0x22')]();};}function saveUpdates(_0x33e68b,_0x272a33){return function(_0x3f271b){if(_0x3f271b){return _0x3f271b[_0xfa2a('0x23')](_0x33e68b)[_0xfa2a('0x24')](function(_0x5adddc){return _0x5adddc;});}return null;};}function removeEntity(_0x263e7a,_0x4505c6){return function(_0x2d0269){if(_0x2d0269){return _0x2d0269['destroy']()[_0xfa2a('0x24')](function(){_0x263e7a[_0xfa2a('0x17')](0xcc)[_0xfa2a('0x18')]();});}};}function handleEntityNotFound(_0x138439,_0x4aa36a){return function(_0x2dde38){if(!_0x2dde38){_0x138439[_0xfa2a('0x16')](0x194);}return _0x2dde38;};}function handleError(_0xc85512,_0x5c1890){_0x5c1890=_0x5c1890||0x1f4;return function(_0x45f1cc){logger[_0xfa2a('0x25')](_0x45f1cc[_0xfa2a('0x26')]);if(_0x45f1cc[_0xfa2a('0x27')]){delete _0x45f1cc[_0xfa2a('0x27')];}_0xc85512[_0xfa2a('0x17')](_0x5c1890)[_0xfa2a('0x28')](_0x45f1cc);};}exports[_0xfa2a('0x29')]=function(_0x2fbf47,_0x1c5206){var _0x3a6b31={},_0x1e60bf={},_0x262825={'count':0x0,'rows':[]};var _0x31aee0=_['map'](db[_0xfa2a('0x2a')][_0xfa2a('0x2b')],function(_0x2c5a8c){return{'name':_0x2c5a8c['fieldName'],'type':_0x2c5a8c[_0xfa2a('0x2c')][_0xfa2a('0x2d')]};});_0x1e60bf[_0xfa2a('0x2e')]=_[_0xfa2a('0x2f')](_0x31aee0,_0xfa2a('0x27'));_0x1e60bf[_0xfa2a('0x30')]=_[_0xfa2a('0x31')](_0x2fbf47[_0xfa2a('0x30')]);_0x1e60bf[_0xfa2a('0x32')]=_[_0xfa2a('0x33')](_0x1e60bf[_0xfa2a('0x2e')],_0x1e60bf[_0xfa2a('0x30')]);_0x3a6b31['attributes']=_[_0xfa2a('0x33')](_0x1e60bf[_0xfa2a('0x2e')],qs['fields'](_0x2fbf47['query'][_0xfa2a('0x34')]));_0x3a6b31[_0xfa2a('0x35')]=_0x3a6b31[_0xfa2a('0x35')]['length']?_0x3a6b31[_0xfa2a('0x35')]:_0x1e60bf[_0xfa2a('0x2e')];if(!_0x2fbf47[_0xfa2a('0x30')]['hasOwnProperty']('nolimit')){_0x3a6b31[_0xfa2a('0x1c')]=qs['limit'](_0x2fbf47['query'][_0xfa2a('0x1c')]);_0x3a6b31['offset']=qs['offset'](_0x2fbf47[_0xfa2a('0x30')][_0xfa2a('0x1a')]);}_0x3a6b31[_0xfa2a('0x36')]=qs['sort'](_0x2fbf47[_0xfa2a('0x30')][_0xfa2a('0x37')]);_0x3a6b31[_0xfa2a('0x38')]=qs[_0xfa2a('0x32')](_[_0xfa2a('0x39')](_0x2fbf47['query'],_0x1e60bf[_0xfa2a('0x32')]),_0x31aee0);if(_0x2fbf47['query'][_0xfa2a('0x3a')]){_0x3a6b31['where']=_[_0xfa2a('0x3b')](_0x3a6b31[_0xfa2a('0x38')],{'$or':_[_0xfa2a('0x2f')](_0x31aee0,function(_0x586983){if(_0x586983['type']!==_0xfa2a('0x3c')){var _0x2c49f4={};_0x2c49f4[_0x586983['name']]={'$like':'%'+_0x2fbf47[_0xfa2a('0x30')][_0xfa2a('0x3a')]+'%'};return _0x2c49f4;}})});}_0x3a6b31=_[_0xfa2a('0x3b')]({},_0x3a6b31,_0x2fbf47[_0xfa2a('0x3d')]);var _0xb778ca={'where':_0x3a6b31['where']};return db['SalesforceAccount'][_0xfa2a('0x1d')](_0xb778ca)[_0xfa2a('0x24')](function(_0xfe8bb9){_0x262825[_0xfa2a('0x1d')]=_0xfe8bb9;if(_0x2fbf47[_0xfa2a('0x30')][_0xfa2a('0x3e')]){_0x3a6b31[_0xfa2a('0x3f')]=[{'all':!![]}];}return db[_0xfa2a('0x2a')]['findAll'](_0x3a6b31);})[_0xfa2a('0x24')](function(_0x45fe98){_0x262825[_0xfa2a('0x40')]=_0x45fe98;return _0x262825;})['then'](respondWithFilteredResult(_0x1c5206,_0x3a6b31))[_0xfa2a('0x41')](handleError(_0x1c5206,null));};exports[_0xfa2a('0x42')]=function(_0x4d5509,_0x4c75aa){var _0x20c98c={'raw':![],'where':{'id':_0x4d5509[_0xfa2a('0x43')]['id']}},_0x45003d={};_0x45003d[_0xfa2a('0x2e')]=_[_0xfa2a('0x31')](db[_0xfa2a('0x2a')]['rawAttributes']);_0x45003d[_0xfa2a('0x30')]=_[_0xfa2a('0x31')](_0x4d5509['query']);_0x45003d[_0xfa2a('0x32')]=_[_0xfa2a('0x33')](_0x45003d[_0xfa2a('0x2e')],_0x45003d[_0xfa2a('0x30')]);_0x20c98c[_0xfa2a('0x35')]=_[_0xfa2a('0x33')](_0x45003d['model'],qs[_0xfa2a('0x34')](_0x4d5509['query'][_0xfa2a('0x34')]));_0x20c98c[_0xfa2a('0x35')]=_0x20c98c[_0xfa2a('0x35')][_0xfa2a('0x44')]?_0x20c98c[_0xfa2a('0x35')]:_0x45003d[_0xfa2a('0x2e')];if(_0x4d5509['query'][_0xfa2a('0x3e')]){_0x20c98c[_0xfa2a('0x3f')]=[{'all':!![]}];}_0x20c98c=_['merge']({},_0x20c98c,_0x4d5509['options']);return db[_0xfa2a('0x2a')][_0xfa2a('0x45')](_0x20c98c)[_0xfa2a('0x24')](handleEntityNotFound(_0x4c75aa,null))['then'](respondWithResult(_0x4c75aa,null))[_0xfa2a('0x41')](handleError(_0x4c75aa,null));};exports['create']=function(_0x1cca80,_0x5a2a06){return db[_0xfa2a('0x2a')][_0xfa2a('0x46')](_0x1cca80['body'],{})['then'](respondWithResult(_0x5a2a06,0xc9))[_0xfa2a('0x41')](handleError(_0x5a2a06,null));};exports[_0xfa2a('0x23')]=function(_0x53a228,_0x15696b){if(_0x53a228[_0xfa2a('0x47')]['id']){delete _0x53a228[_0xfa2a('0x47')]['id'];}return db[_0xfa2a('0x2a')][_0xfa2a('0x45')]({'where':{'id':_0x53a228[_0xfa2a('0x43')]['id']}})['then'](handleEntityNotFound(_0x15696b,null))[_0xfa2a('0x24')](saveUpdates(_0x53a228['body'],null))[_0xfa2a('0x24')](respondWithResult(_0x15696b,null))[_0xfa2a('0x41')](handleError(_0x15696b,null));};exports[_0xfa2a('0x48')]=function(_0x191ad5,_0x50aed1){return db['SalesforceAccount']['find']({'where':{'id':_0x191ad5['params']['id']}})[_0xfa2a('0x24')](handleEntityNotFound(_0x50aed1,null))[_0xfa2a('0x24')](removeEntity(_0x50aed1,null))[_0xfa2a('0x41')](handleError(_0x50aed1,null));};exports[_0xfa2a('0x49')]=function(_0x12938e,_0x4b1a7e,_0x34cea8){var _0x546cbe={};var _0x49abc7={};var _0x515f45;var _0x257f31;return db[_0xfa2a('0x2a')][_0xfa2a('0x4a')]({'where':{'id':_0x12938e[_0xfa2a('0x43')]['id']}})[_0xfa2a('0x24')](handleEntityNotFound(_0x4b1a7e,null))['then'](function(_0x1be341){if(_0x1be341){_0x515f45=_0x1be341;_0x49abc7[_0xfa2a('0x2e')]=_[_0xfa2a('0x31')](db[_0xfa2a('0x4b')][_0xfa2a('0x2b')]);_0x49abc7[_0xfa2a('0x30')]=_['keys'](_0x12938e[_0xfa2a('0x30')]);_0x49abc7[_0xfa2a('0x32')]=_[_0xfa2a('0x33')](_0x49abc7[_0xfa2a('0x2e')],_0x49abc7[_0xfa2a('0x30')]);_0x546cbe[_0xfa2a('0x35')]=_[_0xfa2a('0x33')](_0x49abc7[_0xfa2a('0x2e')],qs[_0xfa2a('0x34')](_0x12938e[_0xfa2a('0x30')]['fields']));_0x546cbe[_0xfa2a('0x35')]=_0x546cbe[_0xfa2a('0x35')]['length']?_0x546cbe[_0xfa2a('0x35')]:_0x49abc7[_0xfa2a('0x2e')];_0x546cbe[_0xfa2a('0x36')]=qs[_0xfa2a('0x37')](_0x12938e[_0xfa2a('0x30')][_0xfa2a('0x37')]);_0x546cbe[_0xfa2a('0x38')]=qs['filters'](_[_0xfa2a('0x39')](_0x12938e[_0xfa2a('0x30')],_0x49abc7['filters']));if(_0x12938e[_0xfa2a('0x30')][_0xfa2a('0x3a')]){_0x546cbe[_0xfa2a('0x38')]=_[_0xfa2a('0x3b')](_0x546cbe[_0xfa2a('0x38')],{'$or':_['map'](_0x546cbe[_0xfa2a('0x35')],function(_0x2ca040){var _0x16a050={};_0x16a050[_0x2ca040]={'$like':'%'+_0x12938e[_0xfa2a('0x30')]['filter']+'%'};return _0x16a050;})});}_0x546cbe=_[_0xfa2a('0x3b')]({},_0x546cbe,_0x12938e[_0xfa2a('0x3d')]);return _0x515f45[_0xfa2a('0x49')](_0x546cbe);}})[_0xfa2a('0x24')](function(_0x81d89e){if(_0x81d89e){_0x257f31=_0x81d89e[_0xfa2a('0x44')];if(!_0x12938e[_0xfa2a('0x30')][_0xfa2a('0x4c')](_0xfa2a('0x4d'))){_0x546cbe[_0xfa2a('0x1c')]=qs['limit'](_0x12938e[_0xfa2a('0x30')][_0xfa2a('0x1c')]);_0x546cbe[_0xfa2a('0x1a')]=qs[_0xfa2a('0x1a')](_0x12938e[_0xfa2a('0x30')][_0xfa2a('0x1a')]);}return _0x515f45[_0xfa2a('0x49')](_0x546cbe);}})[_0xfa2a('0x24')](function(_0x18a2b4){if(_0x18a2b4){return _0x18a2b4?{'count':_0x257f31,'rows':_0x18a2b4}:null;}})['then'](respondWithResult(_0x4b1a7e,null))[_0xfa2a('0x41')](handleError(_0x4b1a7e,null));};exports[_0xfa2a('0x4e')]=function(_0x3e7599,_0x12808d,_0x11add6){if(_0x3e7599['body']['id']){delete _0x3e7599[_0xfa2a('0x47')]['id'];}return db[_0xfa2a('0x2a')][_0xfa2a('0x4a')]({'where':{'id':_0x3e7599['params']['id']}})['then'](handleEntityNotFound(_0x12808d,null))[_0xfa2a('0x24')](function(_0xe27fa4){if(_0xe27fa4){_0x3e7599[_0xfa2a('0x47')][_0xfa2a('0x4f')]=_0xe27fa4['id'];_0x3e7599[_0xfa2a('0x47')][_0xfa2a('0x50')]=integrations[_0xfa2a('0x51')](_0x3e7599[_0xfa2a('0x47')][_0xfa2a('0x52')],_0x3e7599[_0xfa2a('0x47')][_0xfa2a('0x2c')]);_0x3e7599[_0xfa2a('0x47')][_0xfa2a('0x53')]=integrations['getDescriptions'](_0x3e7599[_0xfa2a('0x47')][_0xfa2a('0x52')],_0x3e7599['body']['type']);return db['SalesforceConfiguration']['create'](_0x3e7599[_0xfa2a('0x47')],{'include':[{'model':db[_0xfa2a('0x54')],'as':'Subjects'},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0xfa2a('0x24')](respondWithResult(_0x12808d,null))['catch'](handleError(_0x12808d,null));};exports[_0xfa2a('0x55')]=function(_0x3e1d25,_0x2be3d3,_0x5028f4){var _0x5c3ac2;var _0x3a3e15='';var _0x6f92f2=_0xfa2a('0x56');return db[_0xfa2a('0x2a')][_0xfa2a('0x4a')]({'where':{'id':_0x3e1d25[_0xfa2a('0x43')]['id']},'attributes':['id',_0xfa2a('0x57'),'clientId',_0xfa2a('0x58'),_0xfa2a('0x59'),_0xfa2a('0x5a'),_0xfa2a('0x5b')]})['then'](handleEntityNotFound(_0x2be3d3,null))[_0xfa2a('0x24')](function(_0x435140){if(_0x435140){_0x3a3e15=_0x435140[_0xfa2a('0x57')];var _0xf3b196=_0x3a3e15['slice'](-0x1);if(_0xf3b196==='/'){_0x3a3e15=_0x3a3e15[_0xfa2a('0x5c')](0x0,_0x3a3e15['lastIndexOf'](_0xf3b196));}_0x5c3ac2=new jsforce[(_0xfa2a('0x5d'))]({'oauth2':{'loginUrl':_0x3a3e15,'clientId':_0x435140['clientId'],'clientSecret':_0x435140[_0xfa2a('0x58')]}});return _0x5c3ac2[_0xfa2a('0x5e')](_0x435140['username'],_0x435140[_0xfa2a('0x5a')][_0xfa2a('0x5f')](_0x435140['securityToken']));}})[_0xfa2a('0x24')](function(_0x1dba8b){if(_0x1dba8b){if(!_[_0xfa2a('0x60')](_0x3e1d25[_0xfa2a('0x30')][_0xfa2a('0x61')])){_0x6f92f2=_0x3e1d25[_0xfa2a('0x30')][_0xfa2a('0x61')];}return _0x5c3ac2[_0xfa2a('0x62')](_0x6f92f2)[_0xfa2a('0x63')]();}})[_0xfa2a('0x24')](function(_0x28dca4){var _0x499e1b=[_0xfa2a('0x64'),_0xfa2a('0x65'),_0xfa2a('0x66'),'IsRecurrence',_0xfa2a('0x67'),_0xfa2a('0x68')];var _0x5219f9=['string',_0xfa2a('0x69'),'picklist','boolean',_0xfa2a('0x6a'),_0xfa2a('0x6b'),'phone'];if(_0x28dca4){_[_0xfa2a('0x6c')](_0x28dca4[_0xfa2a('0x34')],function(_0x3d120c){return _0x499e1b['includes'](_0x3d120c[_0xfa2a('0x27')])||!_0x5219f9['includes'](_0x3d120c['type']);});return{'count':_0x28dca4[_0xfa2a('0x34')]['length'],'rows':_[_0xfa2a('0x2f')](_0x28dca4[_0xfa2a('0x34')],function(_0x4009c0){return{'id':_0x4009c0['name'],'name':_0x4009c0['label'],'custom':_0x4009c0[_0xfa2a('0x6d')],'options':_0x4009c0[_0xfa2a('0x6e')][_0xfa2a('0x44')]>0x0?_[_0xfa2a('0x2f')](_0x4009c0[_0xfa2a('0x6e')],function(_0x72df3f){return{'name':_0x72df3f['label'],'value':_0x72df3f[_0xfa2a('0x6f')]};}):_0x4009c0[_0xfa2a('0x2c')]=='boolean'?[{'name':'True','value':_0xfa2a('0x70')},{'name':_0xfa2a('0x71'),'value':_0xfa2a('0x72')}]:[]};})};}})[_0xfa2a('0x24')](respondWithResult(_0x2be3d3,null))['catch'](function(_0x7cf645){var _0x10c890=_0x3e1d25[_0xfa2a('0x30')][_0xfa2a('0x73')]?0x1f4:_0x7cf645[_0xfa2a('0x74')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x10c890,JSON['stringify'](_0x7cf645));delete _0x7cf645[_0xfa2a('0x27')];if(_0x10c890===0x191){_0x10c890=0x190;}_0x2be3d3['status'](_0x10c890)['send'](_0x3e1d25['query'][_0xfa2a('0x73')]?{'message':_0xfa2a('0x75'),'statusCode':_0x7cf645[_0xfa2a('0x74')]}:_0x7cf645);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 10a0334..05b3f1c 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 _0x1058=['util','moment','bluebird','../../config/environment','exports','int_salesforce_accounts','lodash'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x1058,0x148));var _0x8105=function(_0x2c9468,_0x32f07a){_0x2c9468=_0x2c9468-0x0;var _0x18b328=_0x1058[_0x2c9468];return _0x18b328;};'use strict';var _=require(_0x8105('0x0'));var util=require(_0x8105('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8105('0x2'));var BPromise=require(_0x8105('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8105('0x4'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x8105('0x5')]=function(_0x4289ea,_0x371e53){return _0x4289ea['define']('SalesforceAccount',attributes,{'tableName':_0x8105('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3148=['moment','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts','util','api'];(function(_0x3ee55a,_0x19aeea){var _0x581800=function(_0x636cb7){while(--_0x636cb7){_0x3ee55a['push'](_0x3ee55a['shift']());}};_0x581800(++_0x19aeea);}(_0x3148,0x172));var _0x8314=function(_0x3b0b07,_0xc927c6){_0x3b0b07=_0x3b0b07-0x0;var _0x198e38=_0x3148[_0x3b0b07];return _0x198e38;};'use strict';var _=require('lodash');var util=require(_0x8314('0x0'));var logger=require('../../config/logger')(_0x8314('0x1'));var moment=require(_0x8314('0x2'));var BPromise=require(_0x8314('0x3'));var rp=require(_0x8314('0x4'));var fs=require('fs');var path=require(_0x8314('0x5'));var rimraf=require(_0x8314('0x6'));var config=require('../../config/environment');var attributes=require(_0x8314('0x7'));var integrations=require(_0x8314('0x8'));module[_0x8314('0x9')]=function(_0x1891f5,_0x3a8d18){return _0x1891f5['define'](_0x8314('0xa'),attributes,{'tableName':_0x8314('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index cf68a32..4220535 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 _0x9af2=['ShowSalesforceAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetSalesforceAccount','options','raw','where','attributes','limit','include','map','model','debug'];(function(_0x92a4c4,_0x54f162){var _0x117075=function(_0x55ad2d){while(--_0x55ad2d){_0x92a4c4['push'](_0x92a4c4['shift']());}};_0x117075(++_0x54f162);}(_0x9af2,0x1d0));var _0x29af=function(_0x479f4e,_0x61f09d){_0x479f4e=_0x479f4e-0x0;var _0x477952=_0x9af2[_0x479f4e];return _0x477952;};'use strict';var _=require(_0x29af('0x0'));var util=require(_0x29af('0x1'));var moment=require('moment');var BPromise=require(_0x29af('0x2'));var rs=require(_0x29af('0x3'));var fs=require('fs');var Redis=require(_0x29af('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29af('0x5'))(_0x29af('0x6'));var config=require(_0x29af('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x29af('0x8')][_0x29af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x175111,_0x18482f,_0xc7ff60){return new BPromise(function(_0x4b5c77,_0x36ac42){return client[_0x29af('0xa')](_0x175111,_0xc7ff60)[_0x29af('0xb')](function(_0x3c9bd4){logger['info'](_0x29af('0xc'),_0x18482f,_0x29af('0xd'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x18482f,_0x29af('0xd'),JSON[_0x29af('0xe')](_0x3c9bd4));if(_0x3c9bd4[_0x29af('0xf')]){if(_0x3c9bd4[_0x29af('0xf')][_0x29af('0x10')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x18482f,_0x3c9bd4[_0x29af('0xf')]['message']);return _0x36ac42(_0x3c9bd4['error'][_0x29af('0x11')]);}logger[_0x29af('0xf')](_0x29af('0xc'),_0x18482f,_0x3c9bd4[_0x29af('0xf')][_0x29af('0x11')]);return _0x4b5c77(_0x3c9bd4['error'][_0x29af('0x11')]);}else{logger[_0x29af('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x18482f,'request\x20sent');_0x4b5c77(_0x3c9bd4[_0x29af('0x13')][_0x29af('0x11')]);}})[_0x29af('0x14')](function(_0x384db2){logger[_0x29af('0xf')](_0x29af('0xc'),_0x18482f,_0x384db2);_0x36ac42(_0x384db2);});});}exports[_0x29af('0x15')]=function(_0x11f9eb){var _0x530e4c=this;return new Promise(function(_0x11f617,_0x3776e7){return db['SalesforceAccount']['findAll']({'raw':_0x11f9eb[_0x29af('0x16')]?_0x11f9eb[_0x29af('0x16')][_0x29af('0x17')]===undefined?!![]:![]:!![],'where':_0x11f9eb['options']?_0x11f9eb[_0x29af('0x16')][_0x29af('0x18')]||null:null,'attributes':_0x11f9eb['options']?_0x11f9eb[_0x29af('0x16')][_0x29af('0x19')]||null:null,'limit':_0x11f9eb[_0x29af('0x16')]?_0x11f9eb['options'][_0x29af('0x1a')]||null:null,'include':_0x11f9eb[_0x29af('0x16')]?_0x11f9eb[_0x29af('0x16')][_0x29af('0x1b')]?_[_0x29af('0x1c')](_0x11f9eb[_0x29af('0x16')][_0x29af('0x1b')],function(_0x76c21e){return{'model':db[_0x76c21e['model']],'as':_0x76c21e['as'],'attributes':_0x76c21e['attributes'],'include':_0x76c21e[_0x29af('0x1b')]?_[_0x29af('0x1c')](_0x76c21e[_0x29af('0x1b')],function(_0x286341){return{'model':db[_0x286341[_0x29af('0x1d')]],'as':_0x286341['as'],'attributes':_0x286341[_0x29af('0x19')],'include':_0x286341[_0x29af('0x1b')]?_[_0x29af('0x1c')](_0x286341[_0x29af('0x1b')],function(_0xe28be3){return{'model':db[_0xe28be3['model']],'as':_0xe28be3['as'],'attributes':_0xe28be3[_0x29af('0x19')]};}):[]};}):[]};}):[]:[]})[_0x29af('0xb')](function(_0x5265d3){logger['info'](_0x29af('0x15'),_0x11f9eb);logger[_0x29af('0x1e')]('GetSalesforceAccount',_0x11f9eb,JSON[_0x29af('0xe')](_0x5265d3));_0x11f617(_0x5265d3);})[_0x29af('0x14')](function(_0x58fe22){logger[_0x29af('0xf')](_0x29af('0x15'),_0x58fe22[_0x29af('0x11')],_0x11f9eb);_0x3776e7(_0x530e4c[_0x29af('0xf')](0x1f4,_0x58fe22['message']));});});};exports[_0x29af('0x1f')]=function(_0x1ccf48){var _0xd7b377=this;return new Promise(function(_0x448dfc,_0x931781){return db['SalesforceAccount'][_0x29af('0x20')]({'raw':_0x1ccf48[_0x29af('0x16')]?_0x1ccf48[_0x29af('0x16')][_0x29af('0x17')]===undefined?!![]:![]:!![],'where':_0x1ccf48[_0x29af('0x16')]?_0x1ccf48[_0x29af('0x16')][_0x29af('0x18')]||null:null,'attributes':_0x1ccf48[_0x29af('0x16')]?_0x1ccf48[_0x29af('0x16')][_0x29af('0x19')]||null:null,'include':_0x1ccf48[_0x29af('0x16')]?_0x1ccf48['options'][_0x29af('0x1b')]?_[_0x29af('0x1c')](_0x1ccf48[_0x29af('0x16')]['include'],function(_0x1694d0){return{'model':db[_0x1694d0[_0x29af('0x1d')]],'as':_0x1694d0['as'],'attributes':_0x1694d0[_0x29af('0x19')],'include':_0x1694d0[_0x29af('0x1b')]?_['map'](_0x1694d0[_0x29af('0x1b')],function(_0x3c4453){return{'model':db[_0x3c4453[_0x29af('0x1d')]],'as':_0x3c4453['as'],'attributes':_0x3c4453[_0x29af('0x19')],'include':_0x3c4453['include']?_['map'](_0x3c4453[_0x29af('0x1b')],function(_0x4bed68){return{'model':db[_0x4bed68[_0x29af('0x1d')]],'as':_0x4bed68['as'],'attributes':_0x4bed68[_0x29af('0x19')]};}):[]};}):[]};}):[]:[]})[_0x29af('0xb')](function(_0x241a66){logger['info'](_0x29af('0x1f'),_0x1ccf48);logger['debug'](_0x29af('0x1f'),_0x1ccf48,JSON[_0x29af('0xe')](_0x241a66));_0x448dfc(_0x241a66);})['catch'](function(_0x5e8cf9){logger['error']('ShowSalesforceAccount',_0x5e8cf9['message'],_0x1ccf48);_0x931781(_0xd7b377['error'](0x1f4,_0x5e8cf9[_0x29af('0x11')]));});});}; \ No newline at end of file +var _0x778c=['attributes','limit','include','map','model','GetSalesforceAccount','ShowSalesforceAccount','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SalesforceAccount','findAll','options','where'];(function(_0x4076e2,_0x1c1dbd){var _0x164813=function(_0x33b304){while(--_0x33b304){_0x4076e2['push'](_0x4076e2['shift']());}};_0x164813(++_0x1c1dbd);}(_0x778c,0x1e4));var _0xc778=function(_0x4b12ae,_0xf2b3b){_0x4b12ae=_0x4b12ae-0x0;var _0x16957b=_0x778c[_0x4b12ae];return _0x16957b;};'use strict';var _=require(_0xc778('0x0'));var util=require('util');var moment=require(_0xc778('0x1'));var BPromise=require(_0xc778('0x2'));var rs=require(_0xc778('0x3'));var fs=require('fs');var Redis=require(_0xc778('0x4'));var db=require(_0xc778('0x5'))['db'];var utils=require(_0xc778('0x6'));var logger=require('../../config/logger')(_0xc778('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc778('0x8')][_0xc778('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e7bec,_0x53490a,_0x51e5f2){return new BPromise(function(_0x311053,_0xbf56a9){return client[_0xc778('0xa')](_0x5e7bec,_0x51e5f2)['then'](function(_0x4f2f52){logger[_0xc778('0xb')](_0xc778('0xc'),_0x53490a,_0xc778('0xd'));logger[_0xc778('0xe')](_0xc778('0xf'),_0x53490a,_0xc778('0xd'),JSON[_0xc778('0x10')](_0x4f2f52));if(_0x4f2f52[_0xc778('0x11')]){if(_0x4f2f52['error'][_0xc778('0x12')]===0x1f4){logger[_0xc778('0x11')](_0xc778('0xc'),_0x53490a,_0x4f2f52[_0xc778('0x11')][_0xc778('0x13')]);return _0xbf56a9(_0x4f2f52[_0xc778('0x11')][_0xc778('0x13')]);}logger[_0xc778('0x11')](_0xc778('0xc'),_0x53490a,_0x4f2f52[_0xc778('0x11')][_0xc778('0x13')]);return _0x311053(_0x4f2f52['error'][_0xc778('0x13')]);}else{logger[_0xc778('0xb')]('SalesforceAccount,\x20%s,\x20%s',_0x53490a,_0xc778('0xd'));_0x311053(_0x4f2f52[_0xc778('0x14')][_0xc778('0x13')]);}})[_0xc778('0x15')](function(_0x2726fc){logger['error'](_0xc778('0xc'),_0x53490a,_0x2726fc);_0xbf56a9(_0x2726fc);});});}exports['GetSalesforceAccount']=function(_0x49a567){var _0x4ab049=this;return new Promise(function(_0x5e0849,_0x72b334){return db[_0xc778('0x16')][_0xc778('0x17')]({'raw':_0x49a567[_0xc778('0x18')]?_0x49a567[_0xc778('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x49a567[_0xc778('0x18')]?_0x49a567[_0xc778('0x18')][_0xc778('0x19')]||null:null,'attributes':_0x49a567['options']?_0x49a567['options'][_0xc778('0x1a')]||null:null,'limit':_0x49a567[_0xc778('0x18')]?_0x49a567[_0xc778('0x18')][_0xc778('0x1b')]||null:null,'include':_0x49a567[_0xc778('0x18')]?_0x49a567[_0xc778('0x18')][_0xc778('0x1c')]?_[_0xc778('0x1d')](_0x49a567[_0xc778('0x18')][_0xc778('0x1c')],function(_0x18e490){return{'model':db[_0x18e490['model']],'as':_0x18e490['as'],'attributes':_0x18e490[_0xc778('0x1a')],'include':_0x18e490[_0xc778('0x1c')]?_[_0xc778('0x1d')](_0x18e490[_0xc778('0x1c')],function(_0x40a93b){return{'model':db[_0x40a93b[_0xc778('0x1e')]],'as':_0x40a93b['as'],'attributes':_0x40a93b[_0xc778('0x1a')],'include':_0x40a93b[_0xc778('0x1c')]?_['map'](_0x40a93b[_0xc778('0x1c')],function(_0x4f4e25){return{'model':db[_0x4f4e25[_0xc778('0x1e')]],'as':_0x4f4e25['as'],'attributes':_0x4f4e25[_0xc778('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x575ac0){logger[_0xc778('0xb')](_0xc778('0x1f'),_0x49a567);logger[_0xc778('0xe')](_0xc778('0x1f'),_0x49a567,JSON[_0xc778('0x10')](_0x575ac0));_0x5e0849(_0x575ac0);})[_0xc778('0x15')](function(_0x2941e1){logger['error'](_0xc778('0x1f'),_0x2941e1['message'],_0x49a567);_0x72b334(_0x4ab049[_0xc778('0x11')](0x1f4,_0x2941e1[_0xc778('0x13')]));});});};exports[_0xc778('0x20')]=function(_0x15a949){var _0xadc0df=this;return new Promise(function(_0x565d8,_0x149c42){return db[_0xc778('0x16')]['find']({'raw':_0x15a949['options']?_0x15a949[_0xc778('0x18')][_0xc778('0x21')]===undefined?!![]:![]:!![],'where':_0x15a949[_0xc778('0x18')]?_0x15a949['options']['where']||null:null,'attributes':_0x15a949[_0xc778('0x18')]?_0x15a949[_0xc778('0x18')]['attributes']||null:null,'include':_0x15a949['options']?_0x15a949[_0xc778('0x18')][_0xc778('0x1c')]?_[_0xc778('0x1d')](_0x15a949['options']['include'],function(_0x37bb6e){return{'model':db[_0x37bb6e[_0xc778('0x1e')]],'as':_0x37bb6e['as'],'attributes':_0x37bb6e['attributes'],'include':_0x37bb6e['include']?_[_0xc778('0x1d')](_0x37bb6e['include'],function(_0x47b907){return{'model':db[_0x47b907[_0xc778('0x1e')]],'as':_0x47b907['as'],'attributes':_0x47b907[_0xc778('0x1a')],'include':_0x47b907[_0xc778('0x1c')]?_[_0xc778('0x1d')](_0x47b907['include'],function(_0x3b4aa5){return{'model':db[_0x3b4aa5[_0xc778('0x1e')]],'as':_0x3b4aa5['as'],'attributes':_0x3b4aa5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c5254){logger[_0xc778('0xb')](_0xc778('0x20'),_0x15a949);logger[_0xc778('0xe')](_0xc778('0x20'),_0x15a949,JSON[_0xc778('0x10')](_0x5c5254));_0x565d8(_0x5c5254);})['catch'](function(_0x30acf3){logger[_0xc778('0x11')](_0xc778('0x20'),_0x30acf3[_0xc778('0x13')],_0x15a949);_0x149c42(_0xadc0df[_0xc778('0x11')](0x1f4,_0x30acf3['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 1720dde..2f4140e 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 _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x195f7b,_0x315dae){var _0x419da8=function(_0x4a77ef){while(--_0x4a77ef){_0x195f7b['push'](_0x195f7b['shift']());}};_0x419da8(++_0x315dae);}(_0x7a54,0x106));var _0x47a5=function(_0x26ca03,_0x3d793c){_0x26ca03=_0x26ca03-0x0;var _0x3955a6=_0x7a54[_0x26ca03];return _0x3955a6;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file +var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x4573b3,_0x48ce53){var _0xb843ff=function(_0x53cc02){while(--_0x53cc02){_0x4573b3['push'](_0x4573b3['shift']());}};_0xb843ff(++_0x48ce53);}(_0x2ef3,0xba));var _0x32ef=function(_0x5dc3bd,_0x55af44){_0x5dc3bd=_0x5dc3bd-0x0;var _0x11dd8a=_0x2ef3[_0x5dc3bd];return _0x11dd8a;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 13240d9..b0f8651 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 _0x4c8b=['Case','contact_lead','contact','lead','account_contact_lead','nothing','account','sequelize','exports','STRING','ENUM','Task'];(function(_0x83a252,_0x583cfd){var _0x55428a=function(_0x4276fe){while(--_0x4276fe){_0x83a252['push'](_0x83a252['shift']());}};_0x55428a(++_0x583cfd);}(_0x4c8b,0x67));var _0xb4c8=function(_0x45e293,_0x3a47d1){_0x45e293=_0x45e293-0x0;var _0x189689=_0x4c8b[_0x45e293];return _0x189689;};'use strict';var Sequelize=require(_0xb4c8('0x0'));module[_0xb4c8('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb4c8('0x2')]},'ticketType':{'type':Sequelize[_0xb4c8('0x3')](_0xb4c8('0x4'),_0xb4c8('0x5')),'defaultValue':_0xb4c8('0x4')},'moduleSearch':{'type':Sequelize[_0xb4c8('0x3')](_0xb4c8('0x6'),_0xb4c8('0x7'),_0xb4c8('0x8'),_0xb4c8('0x9'),'account'),'defaultValue':_0xb4c8('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0xb4c8('0xa'),_0xb4c8('0x7'),_0xb4c8('0x8'),_0xb4c8('0xb')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xb4c8('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xb4c8('0x2')]}}; \ No newline at end of file +var _0x96ca=['exports','STRING','ENUM','Task','Case','contact','account_contact_lead','account','contact_lead','lead','sequelize'];(function(_0x256c49,_0x53f00a){var _0x280282=function(_0x1455c1){while(--_0x1455c1){_0x256c49['push'](_0x256c49['shift']());}};_0x280282(++_0x53f00a);}(_0x96ca,0xf1));var _0xa96c=function(_0x4c71f0,_0x52151f){_0x4c71f0=_0x4c71f0-0x0;var _0x2ceb53=_0x96ca[_0x4c71f0];return _0x2ceb53;};'use strict';var Sequelize=require(_0xa96c('0x0'));module[_0xa96c('0x1')]={'name':{'type':Sequelize[_0xa96c('0x2')]},'description':{'type':Sequelize[_0xa96c('0x2')]},'ticketType':{'type':Sequelize[_0xa96c('0x3')](_0xa96c('0x4'),_0xa96c('0x5')),'defaultValue':_0xa96c('0x4')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0xa96c('0x6'),'lead',_0xa96c('0x7'),_0xa96c('0x8')),'defaultValue':_0xa96c('0x9')},'moduleCreate':{'type':Sequelize[_0xa96c('0x3')]('nothing',_0xa96c('0x6'),_0xa96c('0xa'),_0xa96c('0x8')),'defaultValue':_0xa96c('0xa')},'leadId':{'type':Sequelize[_0xa96c('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xa96c('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xa96c('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xa96c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 4699723..5fb57d1 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 _0x014a=['status','json','offset','undefined','limit','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','order','where','filter','merge','options','SalesforceConfiguration','count','include','findAll','rows','params','includeAll','find','catch','create','body','getFields','findOne','sort','pick','hasOwnProperty','nolimit','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x5e2ab1,_0x10513c){var _0x5160b7=function(_0x1f903f){while(--_0x1f903f){_0x5e2ab1['push'](_0x5e2ab1['shift']());}};_0x5160b7(++_0x10513c);}(_0x014a,0x16e));var _0xa014=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x014a[_0x4709c0];return _0x13348b;};'use strict';var emlformat=require(_0xa014('0x0'));var rimraf=require(_0xa014('0x1'));var zipdir=require(_0xa014('0x2'));var jsonpatch=require(_0xa014('0x3'));var rp=require(_0xa014('0x4'));var moment=require(_0xa014('0x5'));var BPromise=require(_0xa014('0x6'));var Mustache=require(_0xa014('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa014('0x8'));var ejs=require(_0xa014('0x9'));var fs=require('fs');var fs_extra=require(_0xa014('0xa'));var _=require('lodash');var squel=require(_0xa014('0xb'));var crypto=require(_0xa014('0xc'));var jsforce=require(_0xa014('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa014('0x8'));var querystring=require(_0xa014('0xe'));var Papa=require(_0xa014('0xf'));var Redis=require('ioredis');var authService=require(_0xa014('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa014('0x11'));var hardwareService=require(_0xa014('0x12'));var logger=require(_0xa014('0x13'))(_0xa014('0x14'));var utils=require('../../config/utils');var config=require(_0xa014('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa014('0x16'))['db'];function respondWithStatusCode(_0x219bb6,_0x28f5a7){_0x28f5a7=_0x28f5a7||0xcc;return function(_0x4b016d){if(_0x4b016d){return _0x219bb6[_0xa014('0x17')](_0x28f5a7);}return _0x219bb6[_0xa014('0x18')](_0x28f5a7)['end']();};}function respondWithResult(_0x533d74,_0x3d2af9){_0x3d2af9=_0x3d2af9||0xc8;return function(_0x13bc99){if(_0x13bc99){return _0x533d74['status'](_0x3d2af9)[_0xa014('0x19')](_0x13bc99);}};}function respondWithFilteredResult(_0x231a65,_0x3ed540){return function(_0x4299ae){if(_0x4299ae){var _0x27997a=typeof _0x3ed540[_0xa014('0x1a')]===_0xa014('0x1b')&&typeof _0x3ed540[_0xa014('0x1c')]==='undefined';var _0x558eda=_0x4299ae['count'];var _0x192f09=_0x27997a?0x0:_0x3ed540[_0xa014('0x1a')];var _0x3ee3c8=_0x27997a?_0x4299ae['count']:_0x3ed540['offset']+_0x3ed540[_0xa014('0x1c')];var _0x39a5f4;if(_0x3ee3c8>=_0x558eda){_0x3ee3c8=_0x558eda;_0x39a5f4=0xc8;}else{_0x39a5f4=0xce;}_0x231a65[_0xa014('0x18')](_0x39a5f4);return _0x231a65['set'](_0xa014('0x1d'),_0x192f09+'-'+_0x3ee3c8+'/'+_0x558eda)[_0xa014('0x19')](_0x4299ae);}return null;};}function patchUpdates(_0x50ff6a){return function(_0x52f590){try{jsonpatch['apply'](_0x52f590,_0x50ff6a,!![]);}catch(_0x3deece){return BPromise[_0xa014('0x1e')](_0x3deece);}return _0x52f590[_0xa014('0x1f')]();};}function saveUpdates(_0x4c7c8e,_0xd43e8d){return function(_0x258d27){if(_0x258d27){return _0x258d27[_0xa014('0x20')](_0x4c7c8e)[_0xa014('0x21')](function(_0x3cd130){return _0x3cd130;});}return null;};}function removeEntity(_0x5c74a9,_0x72e793){return function(_0x4fabc5){if(_0x4fabc5){return _0x4fabc5[_0xa014('0x22')]()[_0xa014('0x21')](function(){_0x5c74a9['status'](0xcc)[_0xa014('0x23')]();});}};}function handleEntityNotFound(_0x3c9a0a,_0x2eb5e3){return function(_0x3e3773){if(!_0x3e3773){_0x3c9a0a[_0xa014('0x17')](0x194);}return _0x3e3773;};}function handleError(_0x206fb2,_0x5bc7e7){_0x5bc7e7=_0x5bc7e7||0x1f4;return function(_0x56af99){logger[_0xa014('0x24')](_0x56af99[_0xa014('0x25')]);if(_0x56af99[_0xa014('0x26')]){delete _0x56af99['name'];}_0x206fb2[_0xa014('0x18')](_0x5bc7e7)[_0xa014('0x27')](_0x56af99);};}exports[_0xa014('0x28')]=function(_0x4e960e,_0x56e847){var _0x578e2e={},_0x1ff7ab={},_0x3cb1db={'count':0x0,'rows':[]};var _0x1cb365=_[_0xa014('0x29')](db['SalesforceConfiguration'][_0xa014('0x2a')],function(_0x5b31f9){return{'name':_0x5b31f9[_0xa014('0x2b')],'type':_0x5b31f9['type'][_0xa014('0x2c')]};});_0x1ff7ab[_0xa014('0x2d')]=_[_0xa014('0x29')](_0x1cb365,_0xa014('0x26'));_0x1ff7ab[_0xa014('0x2e')]=_[_0xa014('0x2f')](_0x4e960e[_0xa014('0x2e')]);_0x1ff7ab[_0xa014('0x30')]=_[_0xa014('0x31')](_0x1ff7ab[_0xa014('0x2d')],_0x1ff7ab[_0xa014('0x2e')]);_0x578e2e['attributes']=_[_0xa014('0x31')](_0x1ff7ab[_0xa014('0x2d')],qs['fields'](_0x4e960e[_0xa014('0x2e')][_0xa014('0x32')]));_0x578e2e[_0xa014('0x33')]=_0x578e2e[_0xa014('0x33')][_0xa014('0x34')]?_0x578e2e['attributes']:_0x1ff7ab[_0xa014('0x2d')];if(!_0x4e960e[_0xa014('0x2e')]['hasOwnProperty']('nolimit')){_0x578e2e[_0xa014('0x1c')]=qs[_0xa014('0x1c')](_0x4e960e[_0xa014('0x2e')]['limit']);_0x578e2e['offset']=qs[_0xa014('0x1a')](_0x4e960e[_0xa014('0x2e')][_0xa014('0x1a')]);}_0x578e2e[_0xa014('0x35')]=qs['sort'](_0x4e960e[_0xa014('0x2e')]['sort']);_0x578e2e[_0xa014('0x36')]=qs['filters'](_['pick'](_0x4e960e[_0xa014('0x2e')],_0x1ff7ab[_0xa014('0x30')]),_0x1cb365);if(_0x4e960e[_0xa014('0x2e')][_0xa014('0x37')]){_0x578e2e[_0xa014('0x36')]=_[_0xa014('0x38')](_0x578e2e[_0xa014('0x36')],{'$or':_[_0xa014('0x29')](_0x1cb365,function(_0x484d12){if(_0x484d12['type']!=='VIRTUAL'){var _0x54c232={};_0x54c232[_0x484d12[_0xa014('0x26')]]={'$like':'%'+_0x4e960e[_0xa014('0x2e')][_0xa014('0x37')]+'%'};return _0x54c232;}})});}_0x578e2e=_[_0xa014('0x38')]({},_0x578e2e,_0x4e960e[_0xa014('0x39')]);var _0x37cf8e={'where':_0x578e2e[_0xa014('0x36')]};return db[_0xa014('0x3a')]['count'](_0x37cf8e)[_0xa014('0x21')](function(_0x276a68){_0x3cb1db[_0xa014('0x3b')]=_0x276a68;if(_0x4e960e['query']['includeAll']){_0x578e2e[_0xa014('0x3c')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xa014('0x3d')](_0x578e2e);})[_0xa014('0x21')](function(_0x235a07){_0x3cb1db[_0xa014('0x3e')]=_0x235a07;return _0x3cb1db;})['then'](respondWithFilteredResult(_0x56e847,_0x578e2e))['catch'](handleError(_0x56e847,null));};exports['show']=function(_0x2b0406,_0x5979a0){var _0x4c713f={'raw':![],'where':{'id':_0x2b0406[_0xa014('0x3f')]['id']}},_0x5dbc13={};_0x5dbc13['model']=_[_0xa014('0x2f')](db[_0xa014('0x3a')][_0xa014('0x2a')]);_0x5dbc13['query']=_[_0xa014('0x2f')](_0x2b0406[_0xa014('0x2e')]);_0x5dbc13[_0xa014('0x30')]=_[_0xa014('0x31')](_0x5dbc13[_0xa014('0x2d')],_0x5dbc13['query']);_0x4c713f[_0xa014('0x33')]=_[_0xa014('0x31')](_0x5dbc13[_0xa014('0x2d')],qs['fields'](_0x2b0406[_0xa014('0x2e')]['fields']));_0x4c713f[_0xa014('0x33')]=_0x4c713f[_0xa014('0x33')][_0xa014('0x34')]?_0x4c713f['attributes']:_0x5dbc13[_0xa014('0x2d')];if(_0x2b0406[_0xa014('0x2e')][_0xa014('0x40')]){_0x4c713f[_0xa014('0x3c')]=[{'all':!![]}];}_0x4c713f=_[_0xa014('0x38')]({},_0x4c713f,_0x2b0406['options']);return db[_0xa014('0x3a')][_0xa014('0x41')](_0x4c713f)['then'](handleEntityNotFound(_0x5979a0,null))[_0xa014('0x21')](respondWithResult(_0x5979a0,null))[_0xa014('0x42')](handleError(_0x5979a0,null));};exports[_0xa014('0x43')]=function(_0x5e342b,_0x6b1d61){return db[_0xa014('0x3a')]['create'](_0x5e342b[_0xa014('0x44')],{})[_0xa014('0x21')](respondWithResult(_0x6b1d61,0xc9))[_0xa014('0x42')](handleError(_0x6b1d61,null));};exports[_0xa014('0x20')]=function(_0x3fcf98,_0x59e9f0){if(_0x3fcf98[_0xa014('0x44')]['id']){delete _0x3fcf98[_0xa014('0x44')]['id'];}return db[_0xa014('0x3a')][_0xa014('0x41')]({'where':{'id':_0x3fcf98[_0xa014('0x3f')]['id']}})[_0xa014('0x21')](handleEntityNotFound(_0x59e9f0,null))['then'](saveUpdates(_0x3fcf98['body'],null))[_0xa014('0x21')](respondWithResult(_0x59e9f0,null))['catch'](handleError(_0x59e9f0,null));};exports['destroy']=function(_0x116b28,_0x3def9a){return db['SalesforceConfiguration'][_0xa014('0x41')]({'where':{'id':_0x116b28[_0xa014('0x3f')]['id']}})[_0xa014('0x21')](handleEntityNotFound(_0x3def9a,null))[_0xa014('0x21')](removeEntity(_0x3def9a,null))[_0xa014('0x42')](handleError(_0x3def9a,null));};exports[_0xa014('0x45')]=function(_0x5b1d3f,_0x2b3ff9,_0x457af0){var _0x31ad78={};var _0x4e5417={};var _0x48985a;var _0x94fbc8;return db[_0xa014('0x3a')][_0xa014('0x46')]({'where':{'id':_0x5b1d3f['params']['id']}})['then'](handleEntityNotFound(_0x2b3ff9,null))[_0xa014('0x21')](function(_0x23a774){if(_0x23a774){_0x48985a=_0x23a774;_0x4e5417[_0xa014('0x2d')]=_[_0xa014('0x2f')](db['SalesforceField'][_0xa014('0x2a')]);_0x4e5417[_0xa014('0x2e')]=_[_0xa014('0x2f')](_0x5b1d3f[_0xa014('0x2e')]);_0x4e5417[_0xa014('0x30')]=_[_0xa014('0x31')](_0x4e5417[_0xa014('0x2d')],_0x4e5417[_0xa014('0x2e')]);_0x31ad78[_0xa014('0x33')]=_[_0xa014('0x31')](_0x4e5417['model'],qs[_0xa014('0x32')](_0x5b1d3f[_0xa014('0x2e')][_0xa014('0x32')]));_0x31ad78[_0xa014('0x33')]=_0x31ad78[_0xa014('0x33')]['length']?_0x31ad78['attributes']:_0x4e5417[_0xa014('0x2d')];_0x31ad78[_0xa014('0x35')]=qs[_0xa014('0x47')](_0x5b1d3f[_0xa014('0x2e')][_0xa014('0x47')]);_0x31ad78[_0xa014('0x36')]=qs[_0xa014('0x30')](_[_0xa014('0x48')](_0x5b1d3f[_0xa014('0x2e')],_0x4e5417[_0xa014('0x30')]));if(_0x5b1d3f[_0xa014('0x2e')][_0xa014('0x37')]){_0x31ad78[_0xa014('0x36')]=_[_0xa014('0x38')](_0x31ad78[_0xa014('0x36')],{'$or':_[_0xa014('0x29')](_0x31ad78['attributes'],function(_0x506acc){var _0x254f25={};_0x254f25[_0x506acc]={'$like':'%'+_0x5b1d3f[_0xa014('0x2e')][_0xa014('0x37')]+'%'};return _0x254f25;})});}_0x31ad78=_[_0xa014('0x38')]({},_0x31ad78,_0x5b1d3f['options']);return _0x48985a['getFields'](_0x31ad78);}})[_0xa014('0x21')](function(_0x46be06){if(_0x46be06){_0x94fbc8=_0x46be06[_0xa014('0x34')];if(!_0x5b1d3f['query'][_0xa014('0x49')](_0xa014('0x4a'))){_0x31ad78[_0xa014('0x1c')]=qs[_0xa014('0x1c')](_0x5b1d3f[_0xa014('0x2e')][_0xa014('0x1c')]);_0x31ad78['offset']=qs[_0xa014('0x1a')](_0x5b1d3f[_0xa014('0x2e')][_0xa014('0x1a')]);}return _0x48985a[_0xa014('0x45')](_0x31ad78);}})[_0xa014('0x21')](function(_0x179267){if(_0x179267){return _0x179267?{'count':_0x94fbc8,'rows':_0x179267}:null;}})[_0xa014('0x21')](respondWithResult(_0x2b3ff9,null))['catch'](handleError(_0x2b3ff9,null));};exports[_0xa014('0x4b')]=function(_0x346e6b,_0x3a62d9,_0x1b9d07){var _0x1070a9={};var _0x28f536={};var _0x2aacc7;var _0x2795f6;return db[_0xa014('0x3a')][_0xa014('0x46')]({'where':{'id':_0x346e6b[_0xa014('0x3f')]['id']}})[_0xa014('0x21')](handleEntityNotFound(_0x3a62d9,null))[_0xa014('0x21')](function(_0x2db774){if(_0x2db774){_0x2aacc7=_0x2db774;_0x28f536['model']=_[_0xa014('0x2f')](db[_0xa014('0x4c')]['rawAttributes']);_0x28f536[_0xa014('0x2e')]=_[_0xa014('0x2f')](_0x346e6b[_0xa014('0x2e')]);_0x28f536[_0xa014('0x30')]=_['intersection'](_0x28f536[_0xa014('0x2d')],_0x28f536[_0xa014('0x2e')]);_0x1070a9[_0xa014('0x33')]=_[_0xa014('0x31')](_0x28f536[_0xa014('0x2d')],qs[_0xa014('0x32')](_0x346e6b[_0xa014('0x2e')][_0xa014('0x32')]));_0x1070a9[_0xa014('0x33')]=_0x1070a9[_0xa014('0x33')][_0xa014('0x34')]?_0x1070a9[_0xa014('0x33')]:_0x28f536[_0xa014('0x2d')];_0x1070a9['order']=qs['sort'](_0x346e6b['query'][_0xa014('0x47')]);_0x1070a9['where']=qs[_0xa014('0x30')](_[_0xa014('0x48')](_0x346e6b[_0xa014('0x2e')],_0x28f536['filters']));if(_0x346e6b[_0xa014('0x2e')][_0xa014('0x37')]){_0x1070a9[_0xa014('0x36')]=_[_0xa014('0x38')](_0x1070a9['where'],{'$or':_[_0xa014('0x29')](_0x1070a9['attributes'],function(_0x159825){var _0x32a717={};_0x32a717[_0x159825]={'$like':'%'+_0x346e6b[_0xa014('0x2e')][_0xa014('0x37')]+'%'};return _0x32a717;})});}_0x1070a9=_[_0xa014('0x38')]({},_0x1070a9,_0x346e6b[_0xa014('0x39')]);return _0x2aacc7[_0xa014('0x4b')](_0x1070a9);}})[_0xa014('0x21')](function(_0x590c0c){if(_0x590c0c){_0x2795f6=_0x590c0c['length'];if(!_0x346e6b['query'][_0xa014('0x49')]('nolimit')){_0x1070a9[_0xa014('0x1c')]=qs['limit'](_0x346e6b['query'][_0xa014('0x1c')]);_0x1070a9[_0xa014('0x1a')]=qs[_0xa014('0x1a')](_0x346e6b[_0xa014('0x2e')][_0xa014('0x1a')]);}return _0x2aacc7[_0xa014('0x4b')](_0x1070a9);}})['then'](function(_0x174377){if(_0x174377){return _0x174377?{'count':_0x2795f6,'rows':_0x174377}:null;}})[_0xa014('0x21')](respondWithResult(_0x3a62d9,null))[_0xa014('0x42')](handleError(_0x3a62d9,null));};exports[_0xa014('0x4d')]=function(_0x23fa27,_0x2120b1,_0xe51e0){var _0x5b36fa={};var _0x550088={};var _0x53bef4;var _0x3cc048;return db['SalesforceConfiguration'][_0xa014('0x46')]({'where':{'id':_0x23fa27['params']['id']}})['then'](handleEntityNotFound(_0x2120b1,null))[_0xa014('0x21')](function(_0x4fa3c9){if(_0x4fa3c9){_0x53bef4=_0x4fa3c9;_0x550088['model']=_['keys'](db[_0xa014('0x4c')]['rawAttributes']);_0x550088['query']=_[_0xa014('0x2f')](_0x23fa27[_0xa014('0x2e')]);_0x550088[_0xa014('0x30')]=_[_0xa014('0x31')](_0x550088['model'],_0x550088[_0xa014('0x2e')]);_0x5b36fa['attributes']=_[_0xa014('0x31')](_0x550088[_0xa014('0x2d')],qs[_0xa014('0x32')](_0x23fa27[_0xa014('0x2e')][_0xa014('0x32')]));_0x5b36fa[_0xa014('0x33')]=_0x5b36fa[_0xa014('0x33')][_0xa014('0x34')]?_0x5b36fa[_0xa014('0x33')]:_0x550088[_0xa014('0x2d')];_0x5b36fa[_0xa014('0x35')]=qs[_0xa014('0x47')](_0x23fa27['query'][_0xa014('0x47')]);_0x5b36fa[_0xa014('0x36')]=qs[_0xa014('0x30')](_[_0xa014('0x48')](_0x23fa27[_0xa014('0x2e')],_0x550088[_0xa014('0x30')]));if(_0x23fa27[_0xa014('0x2e')]['filter']){_0x5b36fa[_0xa014('0x36')]=_[_0xa014('0x38')](_0x5b36fa[_0xa014('0x36')],{'$or':_[_0xa014('0x29')](_0x5b36fa[_0xa014('0x33')],function(_0x5b8ce6){var _0x4b383e={};_0x4b383e[_0x5b8ce6]={'$like':'%'+_0x23fa27[_0xa014('0x2e')][_0xa014('0x37')]+'%'};return _0x4b383e;})});}_0x5b36fa=_[_0xa014('0x38')]({},_0x5b36fa,_0x23fa27[_0xa014('0x39')]);return _0x53bef4[_0xa014('0x4d')](_0x5b36fa);}})['then'](function(_0x406428){if(_0x406428){_0x3cc048=_0x406428['length'];if(!_0x23fa27[_0xa014('0x2e')][_0xa014('0x49')](_0xa014('0x4a'))){_0x5b36fa[_0xa014('0x1c')]=qs[_0xa014('0x1c')](_0x23fa27[_0xa014('0x2e')][_0xa014('0x1c')]);_0x5b36fa['offset']=qs[_0xa014('0x1a')](_0x23fa27[_0xa014('0x2e')]['offset']);}return _0x53bef4[_0xa014('0x4d')](_0x5b36fa);}})[_0xa014('0x21')](function(_0x26668f){if(_0x26668f){return _0x26668f?{'count':_0x3cc048,'rows':_0x26668f}:null;}})[_0xa014('0x21')](respondWithResult(_0x2120b1,null))[_0xa014('0x42')](handleError(_0x2120b1,null));}; \ No newline at end of file +var _0x7c22=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','getFields','findOne','SalesforceField','pick','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','map','query','filters'];(function(_0x12a612,_0x2a147e){var _0x20eea8=function(_0x1745b3){while(--_0x1745b3){_0x12a612['push'](_0x12a612['shift']());}};_0x20eea8(++_0x2a147e);}(_0x7c22,0x6c));var _0x27c2=function(_0xbaf433,_0x30ea39){_0xbaf433=_0xbaf433-0x0;var _0x24193a=_0x7c22[_0xbaf433];return _0x24193a;};'use strict';var emlformat=require(_0x27c2('0x0'));var rimraf=require(_0x27c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x27c2('0x2'));var rp=require(_0x27c2('0x3'));var moment=require('moment');var BPromise=require(_0x27c2('0x4'));var Mustache=require(_0x27c2('0x5'));var util=require('util');var path=require('path');var sox=require(_0x27c2('0x6'));var csv=require('to-csv');var ejs=require(_0x27c2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x27c2('0x8'));var squel=require(_0x27c2('0x9'));var crypto=require('crypto');var jsforce=require(_0x27c2('0xa'));var deskjs=require(_0x27c2('0xb'));var toCsv=require(_0x27c2('0xc'));var querystring=require(_0x27c2('0xd'));var Papa=require(_0x27c2('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x27c2('0xf'));var as=require(_0x27c2('0x10'));var hardwareService=require(_0x27c2('0x11'));var logger=require(_0x27c2('0x12'))('api');var utils=require(_0x27c2('0x13'));var config=require(_0x27c2('0x14'));var licenseUtil=require(_0x27c2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c654a,_0x23a6ed){_0x23a6ed=_0x23a6ed||0xcc;return function(_0x3a8d1f){if(_0x3a8d1f){return _0x4c654a[_0x27c2('0x16')](_0x23a6ed);}return _0x4c654a[_0x27c2('0x17')](_0x23a6ed)[_0x27c2('0x18')]();};}function respondWithResult(_0x599589,_0xa704c2){_0xa704c2=_0xa704c2||0xc8;return function(_0x4db64a){if(_0x4db64a){return _0x599589[_0x27c2('0x17')](_0xa704c2)[_0x27c2('0x19')](_0x4db64a);}};}function respondWithFilteredResult(_0x333db1,_0x2e2193){return function(_0x49241e){if(_0x49241e){var _0x272038=typeof _0x2e2193[_0x27c2('0x1a')]===_0x27c2('0x1b')&&typeof _0x2e2193[_0x27c2('0x1c')]===_0x27c2('0x1b');var _0x2db0b6=_0x49241e[_0x27c2('0x1d')];var _0x2daee4=_0x272038?0x0:_0x2e2193[_0x27c2('0x1a')];var _0x5f197c=_0x272038?_0x49241e[_0x27c2('0x1d')]:_0x2e2193[_0x27c2('0x1a')]+_0x2e2193[_0x27c2('0x1c')];var _0x824e60;if(_0x5f197c>=_0x2db0b6){_0x5f197c=_0x2db0b6;_0x824e60=0xc8;}else{_0x824e60=0xce;}_0x333db1['status'](_0x824e60);return _0x333db1['set'](_0x27c2('0x1e'),_0x2daee4+'-'+_0x5f197c+'/'+_0x2db0b6)[_0x27c2('0x19')](_0x49241e);}return null;};}function patchUpdates(_0x25136d){return function(_0x282cdb){try{jsonpatch[_0x27c2('0x1f')](_0x282cdb,_0x25136d,!![]);}catch(_0x9f380){return BPromise['reject'](_0x9f380);}return _0x282cdb[_0x27c2('0x20')]();};}function saveUpdates(_0x111287,_0x38e982){return function(_0x136a63){if(_0x136a63){return _0x136a63[_0x27c2('0x21')](_0x111287)[_0x27c2('0x22')](function(_0x311cd2){return _0x311cd2;});}return null;};}function removeEntity(_0xb9af7f,_0x52ecc5){return function(_0x58ffa6){if(_0x58ffa6){return _0x58ffa6[_0x27c2('0x23')]()[_0x27c2('0x22')](function(){_0xb9af7f['status'](0xcc)[_0x27c2('0x18')]();});}};}function handleEntityNotFound(_0x66bf45,_0x21ccb2){return function(_0x1cf775){if(!_0x1cf775){_0x66bf45['sendStatus'](0x194);}return _0x1cf775;};}function handleError(_0x3e7563,_0x2d9974){_0x2d9974=_0x2d9974||0x1f4;return function(_0x3d2338){logger[_0x27c2('0x24')](_0x3d2338[_0x27c2('0x25')]);if(_0x3d2338[_0x27c2('0x26')]){delete _0x3d2338[_0x27c2('0x26')];}_0x3e7563[_0x27c2('0x17')](_0x2d9974)['send'](_0x3d2338);};}exports[_0x27c2('0x27')]=function(_0x3c13a1,_0x54b061){var _0x48ef72={},_0xeeba0b={},_0x34cf90={'count':0x0,'rows':[]};var _0x2b0b3=_['map'](db[_0x27c2('0x28')][_0x27c2('0x29')],function(_0x2768a6){return{'name':_0x2768a6[_0x27c2('0x2a')],'type':_0x2768a6[_0x27c2('0x2b')][_0x27c2('0x2c')]};});_0xeeba0b['model']=_[_0x27c2('0x2d')](_0x2b0b3,_0x27c2('0x26'));_0xeeba0b[_0x27c2('0x2e')]=_['keys'](_0x3c13a1[_0x27c2('0x2e')]);_0xeeba0b[_0x27c2('0x2f')]=_[_0x27c2('0x30')](_0xeeba0b[_0x27c2('0x31')],_0xeeba0b['query']);_0x48ef72[_0x27c2('0x32')]=_[_0x27c2('0x30')](_0xeeba0b[_0x27c2('0x31')],qs[_0x27c2('0x33')](_0x3c13a1[_0x27c2('0x2e')][_0x27c2('0x33')]));_0x48ef72[_0x27c2('0x32')]=_0x48ef72[_0x27c2('0x32')][_0x27c2('0x34')]?_0x48ef72['attributes']:_0xeeba0b[_0x27c2('0x31')];if(!_0x3c13a1[_0x27c2('0x2e')][_0x27c2('0x35')](_0x27c2('0x36'))){_0x48ef72[_0x27c2('0x1c')]=qs['limit'](_0x3c13a1[_0x27c2('0x2e')][_0x27c2('0x1c')]);_0x48ef72[_0x27c2('0x1a')]=qs[_0x27c2('0x1a')](_0x3c13a1['query'][_0x27c2('0x1a')]);}_0x48ef72[_0x27c2('0x37')]=qs[_0x27c2('0x38')](_0x3c13a1[_0x27c2('0x2e')][_0x27c2('0x38')]);_0x48ef72[_0x27c2('0x39')]=qs[_0x27c2('0x2f')](_['pick'](_0x3c13a1[_0x27c2('0x2e')],_0xeeba0b[_0x27c2('0x2f')]),_0x2b0b3);if(_0x3c13a1['query'][_0x27c2('0x3a')]){_0x48ef72[_0x27c2('0x39')]=_[_0x27c2('0x3b')](_0x48ef72['where'],{'$or':_[_0x27c2('0x2d')](_0x2b0b3,function(_0x303ace){if(_0x303ace[_0x27c2('0x2b')]!==_0x27c2('0x3c')){var _0x3075e5={};_0x3075e5[_0x303ace['name']]={'$like':'%'+_0x3c13a1[_0x27c2('0x2e')]['filter']+'%'};return _0x3075e5;}})});}_0x48ef72=_[_0x27c2('0x3b')]({},_0x48ef72,_0x3c13a1[_0x27c2('0x3d')]);var _0x2363df={'where':_0x48ef72[_0x27c2('0x39')]};return db[_0x27c2('0x28')][_0x27c2('0x1d')](_0x2363df)['then'](function(_0x19f1d6){_0x34cf90[_0x27c2('0x1d')]=_0x19f1d6;if(_0x3c13a1['query'][_0x27c2('0x3e')]){_0x48ef72[_0x27c2('0x3f')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x27c2('0x40')](_0x48ef72);})[_0x27c2('0x22')](function(_0x57dcb2){_0x34cf90[_0x27c2('0x41')]=_0x57dcb2;return _0x34cf90;})[_0x27c2('0x22')](respondWithFilteredResult(_0x54b061,_0x48ef72))[_0x27c2('0x42')](handleError(_0x54b061,null));};exports['show']=function(_0x32b088,_0xd44965){var _0x30e13e={'raw':![],'where':{'id':_0x32b088[_0x27c2('0x43')]['id']}},_0x26546c={};_0x26546c[_0x27c2('0x31')]=_['keys'](db['SalesforceConfiguration'][_0x27c2('0x29')]);_0x26546c[_0x27c2('0x2e')]=_[_0x27c2('0x44')](_0x32b088[_0x27c2('0x2e')]);_0x26546c['filters']=_[_0x27c2('0x30')](_0x26546c[_0x27c2('0x31')],_0x26546c[_0x27c2('0x2e')]);_0x30e13e[_0x27c2('0x32')]=_['intersection'](_0x26546c[_0x27c2('0x31')],qs[_0x27c2('0x33')](_0x32b088[_0x27c2('0x2e')]['fields']));_0x30e13e['attributes']=_0x30e13e[_0x27c2('0x32')]['length']?_0x30e13e[_0x27c2('0x32')]:_0x26546c[_0x27c2('0x31')];if(_0x32b088[_0x27c2('0x2e')][_0x27c2('0x3e')]){_0x30e13e[_0x27c2('0x3f')]=[{'all':!![]}];}_0x30e13e=_['merge']({},_0x30e13e,_0x32b088['options']);return db[_0x27c2('0x28')][_0x27c2('0x45')](_0x30e13e)[_0x27c2('0x22')](handleEntityNotFound(_0xd44965,null))[_0x27c2('0x22')](respondWithResult(_0xd44965,null))[_0x27c2('0x42')](handleError(_0xd44965,null));};exports['create']=function(_0x5eae01,_0x31bee2){return db[_0x27c2('0x28')][_0x27c2('0x46')](_0x5eae01[_0x27c2('0x47')],{})[_0x27c2('0x22')](respondWithResult(_0x31bee2,0xc9))['catch'](handleError(_0x31bee2,null));};exports[_0x27c2('0x21')]=function(_0xa6fdea,_0x3bbd25){if(_0xa6fdea[_0x27c2('0x47')]['id']){delete _0xa6fdea[_0x27c2('0x47')]['id'];}return db[_0x27c2('0x28')]['find']({'where':{'id':_0xa6fdea[_0x27c2('0x43')]['id']}})[_0x27c2('0x22')](handleEntityNotFound(_0x3bbd25,null))[_0x27c2('0x22')](saveUpdates(_0xa6fdea['body'],null))[_0x27c2('0x22')](respondWithResult(_0x3bbd25,null))[_0x27c2('0x42')](handleError(_0x3bbd25,null));};exports[_0x27c2('0x23')]=function(_0x5a3c00,_0x11068b){return db[_0x27c2('0x28')][_0x27c2('0x45')]({'where':{'id':_0x5a3c00[_0x27c2('0x43')]['id']}})[_0x27c2('0x22')](handleEntityNotFound(_0x11068b,null))[_0x27c2('0x22')](removeEntity(_0x11068b,null))[_0x27c2('0x42')](handleError(_0x11068b,null));};exports[_0x27c2('0x48')]=function(_0x4a4248,_0x2ffa99,_0x36e705){var _0x5b633d={};var _0x29f1de={};var _0x26057e;var _0x394f75;return db['SalesforceConfiguration'][_0x27c2('0x49')]({'where':{'id':_0x4a4248[_0x27c2('0x43')]['id']}})[_0x27c2('0x22')](handleEntityNotFound(_0x2ffa99,null))[_0x27c2('0x22')](function(_0x17a9d7){if(_0x17a9d7){_0x26057e=_0x17a9d7;_0x29f1de['model']=_['keys'](db[_0x27c2('0x4a')]['rawAttributes']);_0x29f1de[_0x27c2('0x2e')]=_[_0x27c2('0x44')](_0x4a4248[_0x27c2('0x2e')]);_0x29f1de[_0x27c2('0x2f')]=_[_0x27c2('0x30')](_0x29f1de[_0x27c2('0x31')],_0x29f1de[_0x27c2('0x2e')]);_0x5b633d[_0x27c2('0x32')]=_['intersection'](_0x29f1de[_0x27c2('0x31')],qs[_0x27c2('0x33')](_0x4a4248['query']['fields']));_0x5b633d['attributes']=_0x5b633d['attributes'][_0x27c2('0x34')]?_0x5b633d[_0x27c2('0x32')]:_0x29f1de[_0x27c2('0x31')];_0x5b633d['order']=qs[_0x27c2('0x38')](_0x4a4248[_0x27c2('0x2e')]['sort']);_0x5b633d[_0x27c2('0x39')]=qs[_0x27c2('0x2f')](_[_0x27c2('0x4b')](_0x4a4248[_0x27c2('0x2e')],_0x29f1de[_0x27c2('0x2f')]));if(_0x4a4248['query'][_0x27c2('0x3a')]){_0x5b633d['where']=_[_0x27c2('0x3b')](_0x5b633d[_0x27c2('0x39')],{'$or':_[_0x27c2('0x2d')](_0x5b633d[_0x27c2('0x32')],function(_0x205cbc){var _0x471dee={};_0x471dee[_0x205cbc]={'$like':'%'+_0x4a4248[_0x27c2('0x2e')][_0x27c2('0x3a')]+'%'};return _0x471dee;})});}_0x5b633d=_[_0x27c2('0x3b')]({},_0x5b633d,_0x4a4248[_0x27c2('0x3d')]);return _0x26057e['getFields'](_0x5b633d);}})[_0x27c2('0x22')](function(_0x24a59b){if(_0x24a59b){_0x394f75=_0x24a59b[_0x27c2('0x34')];if(!_0x4a4248[_0x27c2('0x2e')][_0x27c2('0x35')](_0x27c2('0x36'))){_0x5b633d[_0x27c2('0x1c')]=qs['limit'](_0x4a4248['query'][_0x27c2('0x1c')]);_0x5b633d[_0x27c2('0x1a')]=qs[_0x27c2('0x1a')](_0x4a4248[_0x27c2('0x2e')][_0x27c2('0x1a')]);}return _0x26057e['getFields'](_0x5b633d);}})['then'](function(_0x20a84e){if(_0x20a84e){return _0x20a84e?{'count':_0x394f75,'rows':_0x20a84e}:null;}})[_0x27c2('0x22')](respondWithResult(_0x2ffa99,null))[_0x27c2('0x42')](handleError(_0x2ffa99,null));};exports[_0x27c2('0x4c')]=function(_0x6fee14,_0x1aa3d3,_0x68a60a){var _0x4a5bb2={};var _0x11eb06={};var _0x4d445e;var _0x8bef8a;return db[_0x27c2('0x28')][_0x27c2('0x49')]({'where':{'id':_0x6fee14['params']['id']}})[_0x27c2('0x22')](handleEntityNotFound(_0x1aa3d3,null))[_0x27c2('0x22')](function(_0x33a918){if(_0x33a918){_0x4d445e=_0x33a918;_0x11eb06[_0x27c2('0x31')]=_['keys'](db[_0x27c2('0x4a')][_0x27c2('0x29')]);_0x11eb06['query']=_[_0x27c2('0x44')](_0x6fee14[_0x27c2('0x2e')]);_0x11eb06[_0x27c2('0x2f')]=_[_0x27c2('0x30')](_0x11eb06[_0x27c2('0x31')],_0x11eb06[_0x27c2('0x2e')]);_0x4a5bb2[_0x27c2('0x32')]=_[_0x27c2('0x30')](_0x11eb06['model'],qs[_0x27c2('0x33')](_0x6fee14[_0x27c2('0x2e')][_0x27c2('0x33')]));_0x4a5bb2[_0x27c2('0x32')]=_0x4a5bb2[_0x27c2('0x32')]['length']?_0x4a5bb2[_0x27c2('0x32')]:_0x11eb06['model'];_0x4a5bb2[_0x27c2('0x37')]=qs[_0x27c2('0x38')](_0x6fee14[_0x27c2('0x2e')][_0x27c2('0x38')]);_0x4a5bb2[_0x27c2('0x39')]=qs[_0x27c2('0x2f')](_['pick'](_0x6fee14[_0x27c2('0x2e')],_0x11eb06[_0x27c2('0x2f')]));if(_0x6fee14[_0x27c2('0x2e')][_0x27c2('0x3a')]){_0x4a5bb2['where']=_[_0x27c2('0x3b')](_0x4a5bb2['where'],{'$or':_[_0x27c2('0x2d')](_0x4a5bb2[_0x27c2('0x32')],function(_0x5283ca){var _0x31343c={};_0x31343c[_0x5283ca]={'$like':'%'+_0x6fee14[_0x27c2('0x2e')][_0x27c2('0x3a')]+'%'};return _0x31343c;})});}_0x4a5bb2=_[_0x27c2('0x3b')]({},_0x4a5bb2,_0x6fee14[_0x27c2('0x3d')]);return _0x4d445e[_0x27c2('0x4c')](_0x4a5bb2);}})[_0x27c2('0x22')](function(_0x235ca7){if(_0x235ca7){_0x8bef8a=_0x235ca7[_0x27c2('0x34')];if(!_0x6fee14['query'][_0x27c2('0x35')]('nolimit')){_0x4a5bb2[_0x27c2('0x1c')]=qs[_0x27c2('0x1c')](_0x6fee14['query'][_0x27c2('0x1c')]);_0x4a5bb2[_0x27c2('0x1a')]=qs[_0x27c2('0x1a')](_0x6fee14['query'][_0x27c2('0x1a')]);}return _0x4d445e['getSubjects'](_0x4a5bb2);}})[_0x27c2('0x22')](function(_0x39721f){if(_0x39721f){return _0x39721f?{'count':_0x8bef8a,'rows':_0x39721f}:null;}})['then'](respondWithResult(_0x1aa3d3,null))[_0x27c2('0x42')](handleError(_0x1aa3d3,null));};exports[_0x27c2('0x4d')]=function(_0x79e594,_0x127a5d,_0x511c1e){var _0x5e2f9c={};var _0x12b6fd={};var _0x3c52fd;var _0x5ec488;return db[_0x27c2('0x28')][_0x27c2('0x49')]({'where':{'id':_0x79e594[_0x27c2('0x43')]['id']}})[_0x27c2('0x22')](handleEntityNotFound(_0x127a5d,null))['then'](function(_0x396ac3){if(_0x396ac3){_0x3c52fd=_0x396ac3;_0x12b6fd[_0x27c2('0x31')]=_['keys'](db['SalesforceField'][_0x27c2('0x29')]);_0x12b6fd[_0x27c2('0x2e')]=_[_0x27c2('0x44')](_0x79e594['query']);_0x12b6fd[_0x27c2('0x2f')]=_[_0x27c2('0x30')](_0x12b6fd[_0x27c2('0x31')],_0x12b6fd['query']);_0x5e2f9c['attributes']=_[_0x27c2('0x30')](_0x12b6fd['model'],qs[_0x27c2('0x33')](_0x79e594[_0x27c2('0x2e')]['fields']));_0x5e2f9c['attributes']=_0x5e2f9c[_0x27c2('0x32')]['length']?_0x5e2f9c[_0x27c2('0x32')]:_0x12b6fd[_0x27c2('0x31')];_0x5e2f9c[_0x27c2('0x37')]=qs[_0x27c2('0x38')](_0x79e594[_0x27c2('0x2e')][_0x27c2('0x38')]);_0x5e2f9c['where']=qs[_0x27c2('0x2f')](_[_0x27c2('0x4b')](_0x79e594[_0x27c2('0x2e')],_0x12b6fd[_0x27c2('0x2f')]));if(_0x79e594[_0x27c2('0x2e')][_0x27c2('0x3a')]){_0x5e2f9c[_0x27c2('0x39')]=_[_0x27c2('0x3b')](_0x5e2f9c[_0x27c2('0x39')],{'$or':_['map'](_0x5e2f9c[_0x27c2('0x32')],function(_0x1a792f){var _0x43592e={};_0x43592e[_0x1a792f]={'$like':'%'+_0x79e594[_0x27c2('0x2e')][_0x27c2('0x3a')]+'%'};return _0x43592e;})});}_0x5e2f9c=_[_0x27c2('0x3b')]({},_0x5e2f9c,_0x79e594[_0x27c2('0x3d')]);return _0x3c52fd[_0x27c2('0x4d')](_0x5e2f9c);}})[_0x27c2('0x22')](function(_0xf7a022){if(_0xf7a022){_0x5ec488=_0xf7a022['length'];if(!_0x79e594[_0x27c2('0x2e')][_0x27c2('0x35')]('nolimit')){_0x5e2f9c[_0x27c2('0x1c')]=qs['limit'](_0x79e594[_0x27c2('0x2e')][_0x27c2('0x1c')]);_0x5e2f9c['offset']=qs[_0x27c2('0x1a')](_0x79e594[_0x27c2('0x2e')][_0x27c2('0x1a')]);}return _0x3c52fd[_0x27c2('0x4d')](_0x5e2f9c);}})['then'](function(_0x3cb698){if(_0x3cb698){return _0x3cb698?{'count':_0x5ec488,'rows':_0x3cb698}:null;}})[_0x27c2('0x22')](respondWithResult(_0x127a5d,null))['catch'](handleError(_0x127a5d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 9a72b29..df736b5 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 _0x0dc3=['request-promise','path','rimraf','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','bluebird'];(function(_0xa4df64,_0x5042bb){var _0x1835d8=function(_0x1f4db7){while(--_0x1f4db7){_0xa4df64['push'](_0xa4df64['shift']());}};_0x1835d8(++_0x5042bb);}(_0x0dc3,0xc7));var _0x30dc=function(_0x113e32,_0x5339f0){_0x113e32=_0x113e32-0x0;var _0x4ff939=_0x0dc3[_0x113e32];return _0x4ff939;};'use strict';var _=require(_0x30dc('0x0'));var util=require(_0x30dc('0x1'));var logger=require(_0x30dc('0x2'))(_0x30dc('0x3'));var moment=require('moment');var BPromise=require(_0x30dc('0x4'));var rp=require(_0x30dc('0x5'));var fs=require('fs');var path=require(_0x30dc('0x6'));var rimraf=require(_0x30dc('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0x30dc('0x8')]=function(_0x141686,_0x44f369){return _0x141686[_0x30dc('0x9')](_0x30dc('0xa'),attributes,{'tableName':_0x30dc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3568=['moment','request-promise','rimraf','../../config/environment','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api'];(function(_0x525b28,_0x5cf5a0){var _0x180178=function(_0x43e066){while(--_0x43e066){_0x525b28['push'](_0x525b28['shift']());}};_0x180178(++_0x5cf5a0);}(_0x3568,0x193));var _0x8356=function(_0xbccbb2,_0x1b0cb4){_0xbccbb2=_0xbccbb2-0x0;var _0x3e0523=_0x3568[_0xbccbb2];return _0x3e0523;};'use strict';var _=require(_0x8356('0x0'));var util=require(_0x8356('0x1'));var logger=require(_0x8356('0x2'))(_0x8356('0x3'));var moment=require(_0x8356('0x4'));var BPromise=require('bluebird');var rp=require(_0x8356('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8356('0x6'));var config=require(_0x8356('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x4bcb9f,_0xa0bbee){return _0x4bcb9f[_0x8356('0x8')](_0x8356('0x9'),attributes,{'tableName':_0x8356('0xa'),'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 4f51ab6..dff6aa1 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 _0x4400=['../../config/environment','client','http','request','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x402c8f,_0x30cc1d){var _0x11e809=function(_0x4ccfa3){while(--_0x4ccfa3){_0x402c8f['push'](_0x402c8f['shift']());}};_0x11e809(++_0x30cc1d);}(_0x4400,0x1af));var _0x0440=function(_0x48c7e1,_0x3d3b10){_0x48c7e1=_0x48c7e1-0x0;var _0x2df6fe=_0x4400[_0x48c7e1];return _0x2df6fe;};'use strict';var _=require(_0x0440('0x0'));var util=require(_0x0440('0x1'));var moment=require(_0x0440('0x2'));var BPromise=require('bluebird');var rs=require(_0x0440('0x3'));var fs=require('fs');var Redis=require(_0x0440('0x4'));var db=require(_0x0440('0x5'))['db'];var utils=require(_0x0440('0x6'));var logger=require(_0x0440('0x7'))(_0x0440('0x8'));var config=require(_0x0440('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0440('0xa')][_0x0440('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6bdcb9,_0x21578a,_0x554b58){return new BPromise(function(_0x187756,_0x5f3b0f){return client[_0x0440('0xc')](_0x6bdcb9,_0x554b58)['then'](function(_0x56e9b5){logger['info'](_0x0440('0xd'),_0x21578a,_0x0440('0xe'));logger[_0x0440('0xf')](_0x0440('0x10'),_0x21578a,_0x0440('0xe'),JSON[_0x0440('0x11')](_0x56e9b5));if(_0x56e9b5[_0x0440('0x12')]){if(_0x56e9b5[_0x0440('0x12')][_0x0440('0x13')]===0x1f4){logger[_0x0440('0x12')](_0x0440('0xd'),_0x21578a,_0x56e9b5['error']['message']);return _0x5f3b0f(_0x56e9b5[_0x0440('0x12')][_0x0440('0x14')]);}logger[_0x0440('0x12')](_0x0440('0xd'),_0x21578a,_0x56e9b5[_0x0440('0x12')][_0x0440('0x14')]);return _0x187756(_0x56e9b5['error'][_0x0440('0x14')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x21578a,_0x0440('0xe'));_0x187756(_0x56e9b5[_0x0440('0x15')][_0x0440('0x14')]);}})['catch'](function(_0x55e5fe){logger[_0x0440('0x12')](_0x0440('0xd'),_0x21578a,_0x55e5fe);_0x5f3b0f(_0x55e5fe);});});} \ No newline at end of file +var _0x04cc=['../../config/logger','../../config/environment','client','request','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5c431e,_0x410cef){var _0xcd3453=function(_0x3fa165){while(--_0x3fa165){_0x5c431e['push'](_0x5c431e['shift']());}};_0xcd3453(++_0x410cef);}(_0x04cc,0x138));var _0xc04c=function(_0x23e346,_0x2ffc96){_0x23e346=_0x23e346-0x0;var _0x58fd5a=_0x04cc[_0x23e346];return _0x58fd5a;};'use strict';var _=require(_0xc04c('0x0'));var util=require(_0xc04c('0x1'));var moment=require(_0xc04c('0x2'));var BPromise=require(_0xc04c('0x3'));var rs=require(_0xc04c('0x4'));var fs=require('fs');var Redis=require(_0xc04c('0x5'));var db=require(_0xc04c('0x6'))['db'];var utils=require(_0xc04c('0x7'));var logger=require(_0xc04c('0x8'))('rpc');var config=require(_0xc04c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc04c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fd9ff,_0x51a2cc,_0x5353b9){return new BPromise(function(_0x8548de,_0x502497){return client[_0xc04c('0xb')](_0x4fd9ff,_0x5353b9)['then'](function(_0xb615ac){logger['info'](_0xc04c('0xc'),_0x51a2cc,_0xc04c('0xd'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x51a2cc,_0xc04c('0xd'),JSON[_0xc04c('0xe')](_0xb615ac));if(_0xb615ac[_0xc04c('0xf')]){if(_0xb615ac[_0xc04c('0xf')]['code']===0x1f4){logger[_0xc04c('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x51a2cc,_0xb615ac[_0xc04c('0xf')][_0xc04c('0x10')]);return _0x502497(_0xb615ac[_0xc04c('0xf')][_0xc04c('0x10')]);}logger['error'](_0xc04c('0xc'),_0x51a2cc,_0xb615ac['error'][_0xc04c('0x10')]);return _0x8548de(_0xb615ac['error'][_0xc04c('0x10')]);}else{logger[_0xc04c('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x51a2cc,_0xc04c('0xd'));_0x8548de(_0xb615ac[_0xc04c('0x12')][_0xc04c('0x10')]);}})[_0xc04c('0x13')](function(_0x2c932e){logger[_0xc04c('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x51a2cc,_0x2c932e);_0x502497(_0x2c932e);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index d8c8961..a8389e7 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 _0x7d31=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intSalesforceField.controller','get','index','/:id','show','isAuthenticated'];(function(_0x3497b5,_0x5775b8){var _0x9c5460=function(_0x29d1e2){while(--_0x29d1e2){_0x3497b5['push'](_0x3497b5['shift']());}};_0x9c5460(++_0x5775b8);}(_0x7d31,0x70));var _0x17d3=function(_0x4e5dd8,_0x38045a){_0x4e5dd8=_0x4e5dd8-0x0;var _0x16f71e=_0x7d31[_0x4e5dd8];return _0x16f71e;};'use strict';var multer=require(_0x17d3('0x0'));var util=require(_0x17d3('0x1'));var path=require(_0x17d3('0x2'));var timeout=require(_0x17d3('0x3'));var express=require(_0x17d3('0x4'));var router=express[_0x17d3('0x5')]();var fs_extra=require(_0x17d3('0x6'));var auth=require(_0x17d3('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x17d3('0x8'));router[_0x17d3('0x9')]('/',auth['isAuthenticated'](),controller[_0x17d3('0xa')]);router[_0x17d3('0x9')](_0x17d3('0xb'),auth['isAuthenticated'](),controller[_0x17d3('0xc')]);router['post']('/',auth[_0x17d3('0xd')](),controller['create']);router[_0x17d3('0xe')](_0x17d3('0xb'),auth[_0x17d3('0xd')](),controller[_0x17d3('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x17d3('0x10')]);module[_0x17d3('0x11')]=router; \ No newline at end of file +var _0x5443=['express','Router','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','index','/:id','isAuthenticated','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5443,0x81));var _0x3544=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5443[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x3544('0x0'));var util=require(_0x3544('0x1'));var path=require(_0x3544('0x2'));var timeout=require(_0x3544('0x3'));var express=require(_0x3544('0x4'));var router=express[_0x3544('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3544('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3544('0x7'));var controller=require(_0x3544('0x8'));router[_0x3544('0x9')]('/',auth['isAuthenticated'](),controller[_0x3544('0xa')]);router['get'](_0x3544('0xb'),auth[_0x3544('0xc')](),controller[_0x3544('0xd')]);router['post']('/',auth[_0x3544('0xc')](),controller[_0x3544('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3544('0xf')]);router[_0x3544('0x10')](_0x3544('0xb'),auth[_0x3544('0xc')](),controller[_0x3544('0x11')]);module[_0x3544('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 8c881fd..d3b22e2 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 _0x2980=['exports','ENUM','string','variable','customVariable','picklist','STRING','sequelize'];(function(_0x3eeb2f,_0x43f410){var _0x330c0f=function(_0x5d6088){while(--_0x5d6088){_0x3eeb2f['push'](_0x3eeb2f['shift']());}};_0x330c0f(++_0x43f410);}(_0x2980,0x9f));var _0x0298=function(_0x450623,_0x4aecf7){_0x450623=_0x450623-0x0;var _0x362b93=_0x2980[_0x450623];return _0x362b93;};'use strict';var Sequelize=require(_0x0298('0x0'));module[_0x0298('0x1')]={'type':{'type':Sequelize[_0x0298('0x2')](_0x0298('0x3'),_0x0298('0x4'),_0x0298('0x5'),'keyValue',_0x0298('0x6')),'defaultValue':_0x0298('0x3')},'content':{'type':Sequelize[_0x0298('0x7')]},'key':{'type':Sequelize[_0x0298('0x7')]},'keyType':{'type':Sequelize[_0x0298('0x2')](_0x0298('0x3'),_0x0298('0x4'),_0x0298('0x5'))},'keyContent':{'type':Sequelize[_0x0298('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x0298('0x7')]}}; \ No newline at end of file +var _0x25a2=['STRING','ENUM','variable','sequelize','exports','customVariable','keyValue','picklist','string'];(function(_0x3fc6b0,_0x1b44fa){var _0x71b2bc=function(_0x329e4c){while(--_0x329e4c){_0x3fc6b0['push'](_0x3fc6b0['shift']());}};_0x71b2bc(++_0x1b44fa);}(_0x25a2,0x1e0));var _0x225a=function(_0x1a7d23,_0x1d8a94){_0x1a7d23=_0x1a7d23-0x0;var _0x91fb2a=_0x25a2[_0x1a7d23];return _0x91fb2a;};'use strict';var Sequelize=require(_0x225a('0x0'));module[_0x225a('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x225a('0x2'),_0x225a('0x3'),_0x225a('0x4')),'defaultValue':_0x225a('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x225a('0x6')]},'keyType':{'type':Sequelize[_0x225a('0x7')](_0x225a('0x5'),_0x225a('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0x225a('0x6')]},'idField':{'type':Sequelize[_0x225a('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 29cfee6..a8da7df 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 _0xfe0e=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','update','then','error','name','send','map','SalesforceField','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','destroy','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api'];(function(_0x2e53e1,_0x12aed1){var _0x3a23de=function(_0xd84699){while(--_0xd84699){_0x2e53e1['push'](_0x2e53e1['shift']());}};_0x3a23de(++_0x12aed1);}(_0xfe0e,0x73));var _0xefe0=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0xfe0e[_0x5c6299];return _0x23b564;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xefe0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xefe0('0x1'));var moment=require(_0xefe0('0x2'));var BPromise=require(_0xefe0('0x3'));var Mustache=require(_0xefe0('0x4'));var util=require('util');var path=require('path');var sox=require(_0xefe0('0x5'));var csv=require(_0xefe0('0x6'));var ejs=require(_0xefe0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xefe0('0x8'));var squel=require(_0xefe0('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xefe0('0xa'));var toCsv=require(_0xefe0('0x6'));var querystring=require(_0xefe0('0xb'));var Papa=require('papaparse');var Redis=require(_0xefe0('0xc'));var authService=require(_0xefe0('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xefe0('0xe'));var logger=require(_0xefe0('0xf'))(_0xefe0('0x10'));var utils=require('../../config/utils');var config=require(_0xefe0('0x11'));var licenseUtil=require(_0xefe0('0x12'));var db=require(_0xefe0('0x13'))['db'];function respondWithStatusCode(_0x1a7fcc,_0x2b03bf){_0x2b03bf=_0x2b03bf||0xcc;return function(_0x285de2){if(_0x285de2){return _0x1a7fcc[_0xefe0('0x14')](_0x2b03bf);}return _0x1a7fcc[_0xefe0('0x15')](_0x2b03bf)[_0xefe0('0x16')]();};}function respondWithResult(_0x1ec31e,_0x20e565){_0x20e565=_0x20e565||0xc8;return function(_0x3185a6){if(_0x3185a6){return _0x1ec31e['status'](_0x20e565)[_0xefe0('0x17')](_0x3185a6);}};}function respondWithFilteredResult(_0x1236c4,_0x4ace63){return function(_0x1e7712){if(_0x1e7712){var _0x37c52d=typeof _0x4ace63['offset']===_0xefe0('0x18')&&typeof _0x4ace63[_0xefe0('0x19')]===_0xefe0('0x18');var _0x151a11=_0x1e7712[_0xefe0('0x1a')];var _0x32daaf=_0x37c52d?0x0:_0x4ace63[_0xefe0('0x1b')];var _0x438e39=_0x37c52d?_0x1e7712[_0xefe0('0x1a')]:_0x4ace63[_0xefe0('0x1b')]+_0x4ace63[_0xefe0('0x19')];var _0x4d4fa8;if(_0x438e39>=_0x151a11){_0x438e39=_0x151a11;_0x4d4fa8=0xc8;}else{_0x4d4fa8=0xce;}_0x1236c4[_0xefe0('0x15')](_0x4d4fa8);return _0x1236c4[_0xefe0('0x1c')]('Content-Range',_0x32daaf+'-'+_0x438e39+'/'+_0x151a11)[_0xefe0('0x17')](_0x1e7712);}return null;};}function patchUpdates(_0x36e4da){return function(_0x6458da){try{jsonpatch[_0xefe0('0x1d')](_0x6458da,_0x36e4da,!![]);}catch(_0xf522d6){return BPromise[_0xefe0('0x1e')](_0xf522d6);}return _0x6458da['save']();};}function saveUpdates(_0x5880f3,_0x1e5432){return function(_0x1d0bd5){if(_0x1d0bd5){return _0x1d0bd5[_0xefe0('0x1f')](_0x5880f3)[_0xefe0('0x20')](function(_0x55cdf4){return _0x55cdf4;});}return null;};}function removeEntity(_0x40e953,_0x30ef44){return function(_0x1e54c2){if(_0x1e54c2){return _0x1e54c2['destroy']()['then'](function(){_0x40e953[_0xefe0('0x15')](0xcc)[_0xefe0('0x16')]();});}};}function handleEntityNotFound(_0x2dc9c8,_0x26d453){return function(_0x341d23){if(!_0x341d23){_0x2dc9c8['sendStatus'](0x194);}return _0x341d23;};}function handleError(_0x337332,_0x55cd34){_0x55cd34=_0x55cd34||0x1f4;return function(_0x593769){logger[_0xefe0('0x21')](_0x593769['stack']);if(_0x593769[_0xefe0('0x22')]){delete _0x593769[_0xefe0('0x22')];}_0x337332[_0xefe0('0x15')](_0x55cd34)[_0xefe0('0x23')](_0x593769);};}exports['index']=function(_0x45ae72,_0x3837f6){var _0x51d9d8={},_0x1ffd9e={},_0x3441be={'count':0x0,'rows':[]};var _0x29ec88=_[_0xefe0('0x24')](db[_0xefe0('0x25')][_0xefe0('0x26')],function(_0x2f2e5a){return{'name':_0x2f2e5a[_0xefe0('0x27')],'type':_0x2f2e5a[_0xefe0('0x28')][_0xefe0('0x29')]};});_0x1ffd9e[_0xefe0('0x2a')]=_[_0xefe0('0x24')](_0x29ec88,'name');_0x1ffd9e['query']=_[_0xefe0('0x2b')](_0x45ae72['query']);_0x1ffd9e['filters']=_['intersection'](_0x1ffd9e[_0xefe0('0x2a')],_0x1ffd9e[_0xefe0('0x2c')]);_0x51d9d8[_0xefe0('0x2d')]=_[_0xefe0('0x2e')](_0x1ffd9e[_0xefe0('0x2a')],qs['fields'](_0x45ae72['query'][_0xefe0('0x2f')]));_0x51d9d8[_0xefe0('0x2d')]=_0x51d9d8[_0xefe0('0x2d')][_0xefe0('0x30')]?_0x51d9d8['attributes']:_0x1ffd9e[_0xefe0('0x2a')];if(!_0x45ae72[_0xefe0('0x2c')]['hasOwnProperty'](_0xefe0('0x31'))){_0x51d9d8[_0xefe0('0x19')]=qs[_0xefe0('0x19')](_0x45ae72[_0xefe0('0x2c')][_0xefe0('0x19')]);_0x51d9d8[_0xefe0('0x1b')]=qs[_0xefe0('0x1b')](_0x45ae72[_0xefe0('0x2c')][_0xefe0('0x1b')]);}_0x51d9d8['order']=qs[_0xefe0('0x32')](_0x45ae72[_0xefe0('0x2c')]['sort']);_0x51d9d8[_0xefe0('0x33')]=qs[_0xefe0('0x34')](_['pick'](_0x45ae72[_0xefe0('0x2c')],_0x1ffd9e['filters']),_0x29ec88);if(_0x45ae72[_0xefe0('0x2c')][_0xefe0('0x35')]){_0x51d9d8['where']=_[_0xefe0('0x36')](_0x51d9d8['where'],{'$or':_['map'](_0x29ec88,function(_0x45e403){if(_0x45e403['type']!==_0xefe0('0x37')){var _0x35e6e3={};_0x35e6e3[_0x45e403[_0xefe0('0x22')]]={'$like':'%'+_0x45ae72[_0xefe0('0x2c')]['filter']+'%'};return _0x35e6e3;}})});}_0x51d9d8=_[_0xefe0('0x36')]({},_0x51d9d8,_0x45ae72[_0xefe0('0x38')]);var _0x5d3eaf={'where':_0x51d9d8[_0xefe0('0x33')]};return db['SalesforceField'][_0xefe0('0x1a')](_0x5d3eaf)[_0xefe0('0x20')](function(_0x4fe2c7){_0x3441be[_0xefe0('0x1a')]=_0x4fe2c7;if(_0x45ae72[_0xefe0('0x2c')][_0xefe0('0x39')]){_0x51d9d8[_0xefe0('0x3a')]=[{'all':!![]}];}return db[_0xefe0('0x25')]['findAll'](_0x51d9d8);})[_0xefe0('0x20')](function(_0x4020a4){_0x3441be['rows']=_0x4020a4;return _0x3441be;})['then'](respondWithFilteredResult(_0x3837f6,_0x51d9d8))[_0xefe0('0x3b')](handleError(_0x3837f6,null));};exports[_0xefe0('0x3c')]=function(_0x160915,_0x1c5d84){var _0x234bdc={'raw':!![],'where':{'id':_0x160915[_0xefe0('0x3d')]['id']}},_0x4a6e2b={};_0x4a6e2b['model']=_[_0xefe0('0x2b')](db[_0xefe0('0x25')][_0xefe0('0x26')]);_0x4a6e2b['query']=_[_0xefe0('0x2b')](_0x160915[_0xefe0('0x2c')]);_0x4a6e2b['filters']=_['intersection'](_0x4a6e2b['model'],_0x4a6e2b['query']);_0x234bdc['attributes']=_['intersection'](_0x4a6e2b[_0xefe0('0x2a')],qs[_0xefe0('0x2f')](_0x160915[_0xefe0('0x2c')]['fields']));_0x234bdc[_0xefe0('0x2d')]=_0x234bdc[_0xefe0('0x2d')][_0xefe0('0x30')]?_0x234bdc['attributes']:_0x4a6e2b[_0xefe0('0x2a')];if(_0x160915[_0xefe0('0x2c')][_0xefe0('0x39')]){_0x234bdc[_0xefe0('0x3a')]=[{'all':!![]}];}_0x234bdc=_['merge']({},_0x234bdc,_0x160915[_0xefe0('0x38')]);return db[_0xefe0('0x25')][_0xefe0('0x3e')](_0x234bdc)['then'](handleEntityNotFound(_0x1c5d84,null))[_0xefe0('0x20')](respondWithResult(_0x1c5d84,null))['catch'](handleError(_0x1c5d84,null));};exports[_0xefe0('0x3f')]=function(_0x1a74ab,_0x241cee){return db[_0xefe0('0x25')][_0xefe0('0x3f')](_0x1a74ab[_0xefe0('0x40')],{})[_0xefe0('0x20')](respondWithResult(_0x241cee,0xc9))[_0xefe0('0x3b')](handleError(_0x241cee,null));};exports['update']=function(_0xa4ce78,_0x18c67b){if(_0xa4ce78[_0xefe0('0x40')]['id']){delete _0xa4ce78[_0xefe0('0x40')]['id'];}return db['SalesforceField'][_0xefe0('0x3e')]({'where':{'id':_0xa4ce78[_0xefe0('0x3d')]['id']}})['then'](handleEntityNotFound(_0x18c67b,null))[_0xefe0('0x20')](saveUpdates(_0xa4ce78[_0xefe0('0x40')],null))[_0xefe0('0x20')](respondWithResult(_0x18c67b,null))[_0xefe0('0x3b')](handleError(_0x18c67b,null));};exports[_0xefe0('0x41')]=function(_0x5c72c9,_0x1e09a3){return db['SalesforceField'][_0xefe0('0x3e')]({'where':{'id':_0x5c72c9[_0xefe0('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1e09a3,null))['then'](removeEntity(_0x1e09a3,null))[_0xefe0('0x3b')](handleError(_0x1e09a3,null));}; \ No newline at end of file +var _0x634e=['rawAttributes','fieldName','key','model','map','keys','filters','intersection','query','attributes','fields','order','sort','pick','filter','where','merge','type','VIRTUAL','rows','catch','show','params','length','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','index','SalesforceField'];(function(_0x4503df,_0xfec122){var _0x3f1b2b=function(_0x32b1de){while(--_0x32b1de){_0x4503df['push'](_0x4503df['shift']());}};_0x3f1b2b(++_0xfec122);}(_0x634e,0x151));var _0xe634=function(_0x25b4a4,_0x2e081b){_0x25b4a4=_0x25b4a4-0x0;var _0x707267=_0x634e[_0x25b4a4];return _0x707267;};'use strict';var emlformat=require(_0xe634('0x0'));var rimraf=require(_0xe634('0x1'));var zipdir=require(_0xe634('0x2'));var jsonpatch=require(_0xe634('0x3'));var rp=require(_0xe634('0x4'));var moment=require('moment');var BPromise=require(_0xe634('0x5'));var Mustache=require(_0xe634('0x6'));var util=require(_0xe634('0x7'));var path=require(_0xe634('0x8'));var sox=require(_0xe634('0x9'));var csv=require(_0xe634('0xa'));var ejs=require(_0xe634('0xb'));var fs=require('fs');var fs_extra=require(_0xe634('0xc'));var _=require(_0xe634('0xd'));var squel=require(_0xe634('0xe'));var crypto=require(_0xe634('0xf'));var jsforce=require(_0xe634('0x10'));var deskjs=require(_0xe634('0x11'));var toCsv=require(_0xe634('0xa'));var querystring=require(_0xe634('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe634('0x13'));var qs=require(_0xe634('0x14'));var as=require(_0xe634('0x15'));var hardwareService=require(_0xe634('0x16'));var logger=require(_0xe634('0x17'))(_0xe634('0x18'));var utils=require(_0xe634('0x19'));var config=require(_0xe634('0x1a'));var licenseUtil=require(_0xe634('0x1b'));var db=require(_0xe634('0x1c'))['db'];function respondWithStatusCode(_0x15b4b4,_0x348f89){_0x348f89=_0x348f89||0xcc;return function(_0x152ec4){if(_0x152ec4){return _0x15b4b4[_0xe634('0x1d')](_0x348f89);}return _0x15b4b4['status'](_0x348f89)[_0xe634('0x1e')]();};}function respondWithResult(_0x10f727,_0x187bac){_0x187bac=_0x187bac||0xc8;return function(_0x5dc2fa){if(_0x5dc2fa){return _0x10f727[_0xe634('0x1f')](_0x187bac)[_0xe634('0x20')](_0x5dc2fa);}};}function respondWithFilteredResult(_0xe7a5d4,_0x5160a8){return function(_0x2a3361){if(_0x2a3361){var _0x71dac6=typeof _0x5160a8[_0xe634('0x21')]===_0xe634('0x22')&&typeof _0x5160a8[_0xe634('0x23')]===_0xe634('0x22');var _0x8e7221=_0x2a3361['count'];var _0x2ec459=_0x71dac6?0x0:_0x5160a8[_0xe634('0x21')];var _0x10c807=_0x71dac6?_0x2a3361[_0xe634('0x24')]:_0x5160a8[_0xe634('0x21')]+_0x5160a8['limit'];var _0x25c889;if(_0x10c807>=_0x8e7221){_0x10c807=_0x8e7221;_0x25c889=0xc8;}else{_0x25c889=0xce;}_0xe7a5d4[_0xe634('0x1f')](_0x25c889);return _0xe7a5d4[_0xe634('0x25')]('Content-Range',_0x2ec459+'-'+_0x10c807+'/'+_0x8e7221)[_0xe634('0x20')](_0x2a3361);}return null;};}function patchUpdates(_0x4ff400){return function(_0x3bbeb7){try{jsonpatch[_0xe634('0x26')](_0x3bbeb7,_0x4ff400,!![]);}catch(_0x3cf8b4){return BPromise[_0xe634('0x27')](_0x3cf8b4);}return _0x3bbeb7[_0xe634('0x28')]();};}function saveUpdates(_0x29ee3c,_0x293964){return function(_0x5e7081){if(_0x5e7081){return _0x5e7081[_0xe634('0x29')](_0x29ee3c)[_0xe634('0x2a')](function(_0x5f3998){return _0x5f3998;});}return null;};}function removeEntity(_0x481b4e,_0x5d6525){return function(_0x1213e3){if(_0x1213e3){return _0x1213e3['destroy']()['then'](function(){_0x481b4e[_0xe634('0x1f')](0xcc)[_0xe634('0x1e')]();});}};}function handleEntityNotFound(_0x33d93f,_0x54c691){return function(_0x34f896){if(!_0x34f896){_0x33d93f[_0xe634('0x1d')](0x194);}return _0x34f896;};}function handleError(_0x15c6ed,_0x37c508){_0x37c508=_0x37c508||0x1f4;return function(_0x3a582f){logger['error'](_0x3a582f[_0xe634('0x2b')]);if(_0x3a582f[_0xe634('0x2c')]){delete _0x3a582f['name'];}_0x15c6ed[_0xe634('0x1f')](_0x37c508)[_0xe634('0x2d')](_0x3a582f);};}exports[_0xe634('0x2e')]=function(_0x10998d,_0x1ef83c){var _0x8da8e5={},_0x12f5df={},_0x500aeb={'count':0x0,'rows':[]};var _0x9867ae=_['map'](db[_0xe634('0x2f')][_0xe634('0x30')],function(_0x412012){return{'name':_0x412012[_0xe634('0x31')],'type':_0x412012['type'][_0xe634('0x32')]};});_0x12f5df[_0xe634('0x33')]=_[_0xe634('0x34')](_0x9867ae,_0xe634('0x2c'));_0x12f5df['query']=_[_0xe634('0x35')](_0x10998d['query']);_0x12f5df[_0xe634('0x36')]=_[_0xe634('0x37')](_0x12f5df[_0xe634('0x33')],_0x12f5df[_0xe634('0x38')]);_0x8da8e5[_0xe634('0x39')]=_[_0xe634('0x37')](_0x12f5df[_0xe634('0x33')],qs['fields'](_0x10998d[_0xe634('0x38')][_0xe634('0x3a')]));_0x8da8e5[_0xe634('0x39')]=_0x8da8e5[_0xe634('0x39')]['length']?_0x8da8e5['attributes']:_0x12f5df[_0xe634('0x33')];if(!_0x10998d['query']['hasOwnProperty']('nolimit')){_0x8da8e5[_0xe634('0x23')]=qs['limit'](_0x10998d['query'][_0xe634('0x23')]);_0x8da8e5[_0xe634('0x21')]=qs[_0xe634('0x21')](_0x10998d['query']['offset']);}_0x8da8e5[_0xe634('0x3b')]=qs[_0xe634('0x3c')](_0x10998d[_0xe634('0x38')]['sort']);_0x8da8e5['where']=qs[_0xe634('0x36')](_[_0xe634('0x3d')](_0x10998d['query'],_0x12f5df[_0xe634('0x36')]),_0x9867ae);if(_0x10998d[_0xe634('0x38')][_0xe634('0x3e')]){_0x8da8e5[_0xe634('0x3f')]=_[_0xe634('0x40')](_0x8da8e5[_0xe634('0x3f')],{'$or':_[_0xe634('0x34')](_0x9867ae,function(_0x56a21d){if(_0x56a21d[_0xe634('0x41')]!==_0xe634('0x42')){var _0x1f1553={};_0x1f1553[_0x56a21d[_0xe634('0x2c')]]={'$like':'%'+_0x10998d['query'][_0xe634('0x3e')]+'%'};return _0x1f1553;}})});}_0x8da8e5=_[_0xe634('0x40')]({},_0x8da8e5,_0x10998d['options']);var _0x3c90ba={'where':_0x8da8e5[_0xe634('0x3f')]};return db[_0xe634('0x2f')][_0xe634('0x24')](_0x3c90ba)['then'](function(_0x2cb94f){_0x500aeb[_0xe634('0x24')]=_0x2cb94f;if(_0x10998d['query']['includeAll']){_0x8da8e5['include']=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x8da8e5);})[_0xe634('0x2a')](function(_0x5ad5c1){_0x500aeb[_0xe634('0x43')]=_0x5ad5c1;return _0x500aeb;})['then'](respondWithFilteredResult(_0x1ef83c,_0x8da8e5))[_0xe634('0x44')](handleError(_0x1ef83c,null));};exports[_0xe634('0x45')]=function(_0x2b03cc,_0x1ca319){var _0x1cd3e8={'raw':!![],'where':{'id':_0x2b03cc[_0xe634('0x46')]['id']}},_0x31090c={};_0x31090c[_0xe634('0x33')]=_[_0xe634('0x35')](db[_0xe634('0x2f')][_0xe634('0x30')]);_0x31090c['query']=_[_0xe634('0x35')](_0x2b03cc[_0xe634('0x38')]);_0x31090c[_0xe634('0x36')]=_[_0xe634('0x37')](_0x31090c[_0xe634('0x33')],_0x31090c[_0xe634('0x38')]);_0x1cd3e8[_0xe634('0x39')]=_[_0xe634('0x37')](_0x31090c[_0xe634('0x33')],qs[_0xe634('0x3a')](_0x2b03cc[_0xe634('0x38')]['fields']));_0x1cd3e8['attributes']=_0x1cd3e8[_0xe634('0x39')][_0xe634('0x47')]?_0x1cd3e8[_0xe634('0x39')]:_0x31090c[_0xe634('0x33')];if(_0x2b03cc['query'][_0xe634('0x48')]){_0x1cd3e8['include']=[{'all':!![]}];}_0x1cd3e8=_['merge']({},_0x1cd3e8,_0x2b03cc['options']);return db[_0xe634('0x2f')][_0xe634('0x49')](_0x1cd3e8)[_0xe634('0x2a')](handleEntityNotFound(_0x1ca319,null))[_0xe634('0x2a')](respondWithResult(_0x1ca319,null))['catch'](handleError(_0x1ca319,null));};exports[_0xe634('0x4a')]=function(_0x4f859e,_0x439606){return db[_0xe634('0x2f')][_0xe634('0x4a')](_0x4f859e[_0xe634('0x4b')],{})[_0xe634('0x2a')](respondWithResult(_0x439606,0xc9))[_0xe634('0x44')](handleError(_0x439606,null));};exports[_0xe634('0x29')]=function(_0x960f26,_0x5d42d4){if(_0x960f26[_0xe634('0x4b')]['id']){delete _0x960f26[_0xe634('0x4b')]['id'];}return db[_0xe634('0x2f')][_0xe634('0x49')]({'where':{'id':_0x960f26[_0xe634('0x46')]['id']}})[_0xe634('0x2a')](handleEntityNotFound(_0x5d42d4,null))[_0xe634('0x2a')](saveUpdates(_0x960f26[_0xe634('0x4b')],null))[_0xe634('0x2a')](respondWithResult(_0x5d42d4,null))['catch'](handleError(_0x5d42d4,null));};exports[_0xe634('0x4c')]=function(_0x31985e,_0x4f2b94){return db['SalesforceField'][_0xe634('0x49')]({'where':{'id':_0x31985e[_0xe634('0x46')]['id']}})[_0xe634('0x2a')](handleEntityNotFound(_0x4f2b94,null))[_0xe634('0x2a')](removeEntity(_0x4f2b94,null))['catch'](handleError(_0x4f2b94,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 0ab2314..4e3403b 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 _0x58cc=['rimraf','../../config/environment','define','SalesforceField','int_salesforce_fields','idField','FieldId','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3c38ea,_0x1a01dd){var _0x35cdb9=function(_0x18184a){while(--_0x18184a){_0x3c38ea['push'](_0x3c38ea['shift']());}};_0x35cdb9(++_0x1a01dd);}(_0x58cc,0xd7));var _0xc58c=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x58cc[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0xc58c('0x0'));var util=require('util');var logger=require(_0xc58c('0x1'))(_0xc58c('0x2'));var moment=require('moment');var BPromise=require(_0xc58c('0x3'));var rp=require(_0xc58c('0x4'));var fs=require('fs');var path=require(_0xc58c('0x5'));var rimraf=require(_0xc58c('0x6'));var config=require(_0xc58c('0x7'));var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x951ddd,_0x5c1480){return _0x951ddd[_0xc58c('0x8')](_0xc58c('0x9'),attributes,{'tableName':_0xc58c('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xc58c('0xb'),_0xc58c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe32b=['./intSalesforceField.attributes','define','SalesforceField','salesforce_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe32b,0x156));var _0xbe32=function(_0x17b3e6,_0x4b6606){_0x17b3e6=_0x17b3e6-0x0;var _0x394794=_0xe32b[_0x17b3e6];return _0x394794;};'use strict';var _=require('lodash');var util=require(_0xbe32('0x0'));var logger=require(_0xbe32('0x1'))(_0xbe32('0x2'));var moment=require(_0xbe32('0x3'));var BPromise=require('bluebird');var rp=require(_0xbe32('0x4'));var fs=require('fs');var path=require(_0xbe32('0x5'));var rimraf=require(_0xbe32('0x6'));var config=require(_0xbe32('0x7'));var attributes=require(_0xbe32('0x8'));module['exports']=function(_0x48dd35,_0x48d43a){return _0x48dd35[_0xbe32('0x9')](_0xbe32('0xa'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xbe32('0xb'),'fields':[_0xbe32('0xc'),_0xbe32('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 3dbd504..1c9f430 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 _0x6738=['then','info','request\x20sent','debug','stringify','error','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6738,0x1ac));var _0x8673=function(_0x2e9cbe,_0x11fda2){_0x2e9cbe=_0x2e9cbe-0x0;var _0x2aa956=_0x6738[_0x2e9cbe];return _0x2aa956;};'use strict';var _=require(_0x8673('0x0'));var util=require(_0x8673('0x1'));var moment=require(_0x8673('0x2'));var BPromise=require(_0x8673('0x3'));var rs=require(_0x8673('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8673('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8673('0x6'));var config=require(_0x8673('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8673('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1567d9,_0x39f116,_0x8036e8){return new BPromise(function(_0xb0fc9,_0x457c90){return client['request'](_0x1567d9,_0x8036e8)[_0x8673('0x9')](function(_0x2f26da){logger[_0x8673('0xa')]('SalesforceField,\x20%s,\x20%s',_0x39f116,_0x8673('0xb'));logger[_0x8673('0xc')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x39f116,_0x8673('0xb'),JSON[_0x8673('0xd')](_0x2f26da));if(_0x2f26da['error']){if(_0x2f26da[_0x8673('0xe')]['code']===0x1f4){logger[_0x8673('0xe')](_0x8673('0xf'),_0x39f116,_0x2f26da[_0x8673('0xe')]['message']);return _0x457c90(_0x2f26da[_0x8673('0xe')][_0x8673('0x10')]);}logger[_0x8673('0xe')](_0x8673('0xf'),_0x39f116,_0x2f26da['error'][_0x8673('0x10')]);return _0xb0fc9(_0x2f26da[_0x8673('0xe')][_0x8673('0x10')]);}else{logger[_0x8673('0xa')](_0x8673('0xf'),_0x39f116,_0x8673('0xb'));_0xb0fc9(_0x2f26da[_0x8673('0x11')][_0x8673('0x10')]);}})[_0x8673('0x12')](function(_0x1fe88a){logger[_0x8673('0xe')](_0x8673('0xf'),_0x39f116,_0x1fe88a);_0x457c90(_0x1fe88a);});});} \ No newline at end of file +var _0x5da8=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x26322d,_0x158191){var _0x370c41=function(_0x188d69){while(--_0x188d69){_0x26322d['push'](_0x26322d['shift']());}};_0x370c41(++_0x158191);}(_0x5da8,0xfe));var _0x85da=function(_0x429cb2,_0x30ada8){_0x429cb2=_0x429cb2-0x0;var _0x1af243=_0x5da8[_0x429cb2];return _0x1af243;};'use strict';var _=require(_0x85da('0x0'));var util=require(_0x85da('0x1'));var moment=require(_0x85da('0x2'));var BPromise=require(_0x85da('0x3'));var rs=require(_0x85da('0x4'));var fs=require('fs');var Redis=require(_0x85da('0x5'));var db=require(_0x85da('0x6'))['db'];var utils=require(_0x85da('0x7'));var logger=require(_0x85da('0x8'))(_0x85da('0x9'));var config=require(_0x85da('0xa'));var jayson=require(_0x85da('0xb'));var client=jayson[_0x85da('0xc')][_0x85da('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5adc8b,_0x5657c3,_0x2da798){return new BPromise(function(_0x2d9f3e,_0x42b457){return client[_0x85da('0xe')](_0x5adc8b,_0x2da798)[_0x85da('0xf')](function(_0x337282){logger[_0x85da('0x10')](_0x85da('0x11'),_0x5657c3,_0x85da('0x12'));logger[_0x85da('0x13')](_0x85da('0x14'),_0x5657c3,_0x85da('0x12'),JSON[_0x85da('0x15')](_0x337282));if(_0x337282[_0x85da('0x16')]){if(_0x337282['error']['code']===0x1f4){logger[_0x85da('0x16')](_0x85da('0x11'),_0x5657c3,_0x337282[_0x85da('0x16')][_0x85da('0x17')]);return _0x42b457(_0x337282[_0x85da('0x16')][_0x85da('0x17')]);}logger[_0x85da('0x16')](_0x85da('0x11'),_0x5657c3,_0x337282[_0x85da('0x16')]['message']);return _0x2d9f3e(_0x337282[_0x85da('0x16')][_0x85da('0x17')]);}else{logger[_0x85da('0x10')](_0x85da('0x11'),_0x5657c3,_0x85da('0x12'));_0x2d9f3e(_0x337282[_0x85da('0x18')][_0x85da('0x17')]);}})[_0x85da('0x19')](function(_0x57f827){logger['error'](_0x85da('0x11'),_0x5657c3,_0x57f827);_0x42b457(_0x57f827);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 677c25a..abe3084 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 _0xb226=['index','/:id','show','/:id/configurations','getFields','post','addConfiguration','put','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x153fc5,_0x127c28){var _0x141154=function(_0x102e0c){while(--_0x102e0c){_0x153fc5['push'](_0x153fc5['shift']());}};_0x141154(++_0x127c28);}(_0xb226,0x11c));var _0x6b22=function(_0x358bf9,_0x4c57a8){_0x358bf9=_0x358bf9-0x0;var _0x5010cc=_0xb226[_0x358bf9];return _0x5010cc;};'use strict';var multer=require(_0x6b22('0x0'));var util=require(_0x6b22('0x1'));var path=require(_0x6b22('0x2'));var timeout=require('connect-timeout');var express=require(_0x6b22('0x3'));var router=express['Router']();var fs_extra=require(_0x6b22('0x4'));var auth=require(_0x6b22('0x5'));var interaction=require(_0x6b22('0x6'));var config=require(_0x6b22('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x6b22('0x8')]('/',auth[_0x6b22('0x9')](),controller[_0x6b22('0xa')]);router[_0x6b22('0x8')](_0x6b22('0xb'),auth[_0x6b22('0x9')](),controller[_0x6b22('0xc')]);router[_0x6b22('0x8')](_0x6b22('0xd'),auth[_0x6b22('0x9')](),controller['getConfigurations']);router[_0x6b22('0x8')]('/:id/fields',auth[_0x6b22('0x9')](),controller[_0x6b22('0xe')]);router['post']('/',auth[_0x6b22('0x9')](),controller['create']);router[_0x6b22('0xf')](_0x6b22('0xd'),auth[_0x6b22('0x9')](),controller[_0x6b22('0x10')]);router[_0x6b22('0x11')](_0x6b22('0xb'),auth[_0x6b22('0x9')](),controller[_0x6b22('0x12')]);router[_0x6b22('0x13')](_0x6b22('0xb'),auth[_0x6b22('0x9')](),controller['destroy']);module[_0x6b22('0x14')]=router; \ No newline at end of file +var _0x8ff4=['fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','update','delete','exports','multer','util','connect-timeout','express','Router'];(function(_0x9f8e0a,_0x28ea63){var _0x19e8fb=function(_0x3b907e){while(--_0x3b907e){_0x9f8e0a['push'](_0x9f8e0a['shift']());}};_0x19e8fb(++_0x28ea63);}(_0x8ff4,0x1b3));var _0x48ff=function(_0x179c4a,_0x10eb06){_0x179c4a=_0x179c4a-0x0;var _0x5d1879=_0x8ff4[_0x179c4a];return _0x5d1879;};'use strict';var multer=require(_0x48ff('0x0'));var util=require(_0x48ff('0x1'));var path=require('path');var timeout=require(_0x48ff('0x2'));var express=require(_0x48ff('0x3'));var router=express[_0x48ff('0x4')]();var fs_extra=require(_0x48ff('0x5'));var auth=require(_0x48ff('0x6'));var interaction=require(_0x48ff('0x7'));var config=require('../../config/environment');var controller=require(_0x48ff('0x8'));router[_0x48ff('0x9')]('/',auth[_0x48ff('0xa')](),controller[_0x48ff('0xb')]);router[_0x48ff('0x9')](_0x48ff('0xc'),auth['isAuthenticated'](),controller[_0x48ff('0xd')]);router[_0x48ff('0x9')](_0x48ff('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x48ff('0xf'),auth[_0x48ff('0xa')](),controller[_0x48ff('0x10')]);router[_0x48ff('0x11')]('/',auth[_0x48ff('0xa')](),controller['create']);router[_0x48ff('0x11')](_0x48ff('0xe'),auth[_0x48ff('0xa')](),controller[_0x48ff('0x12')]);router['put'](_0x48ff('0xc'),auth[_0x48ff('0xa')](),controller[_0x48ff('0x13')]);router[_0x48ff('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x48ff('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index ab67eb8..b77852a 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 _0xfbaf=['exports','STRING','remoteUri','sequelize'];(function(_0x579940,_0x5ba0b5){var _0x150486=function(_0x2b0e6e){while(--_0x2b0e6e){_0x579940['push'](_0x579940['shift']());}};_0x150486(++_0x5ba0b5);}(_0xfbaf,0xcb));var _0xffba=function(_0x10aa59,_0x9e25cd){_0x10aa59=_0x10aa59-0x0;var _0x2f428a=_0xfbaf[_0x10aa59];return _0x2f428a;};'use strict';var Sequelize=require(_0xffba('0x0'));module[_0xffba('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xffba('0x2')]},'username':{'type':Sequelize[_0xffba('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xffba('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xffba('0x2')],'unique':_0xffba('0x3')},'serverUrl':{'type':Sequelize[_0xffba('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x3b39=['STRING','username','remoteUri','sequelize'];(function(_0x452968,_0x31e391){var _0xb6f9ae=function(_0x263987){while(--_0x263987){_0x452968['push'](_0x452968['shift']());}};_0xb6f9ae(++_0x31e391);}(_0x3b39,0x1ab));var _0x93b3=function(_0x4e87ba,_0x2d95f9){_0x4e87ba=_0x4e87ba-0x0;var _0x212b08=_0x3b39[_0x4e87ba];return _0x212b08;};'use strict';var Sequelize=require(_0x93b3('0x0'));module['exports']={'name':{'type':Sequelize[_0x93b3('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x93b3('0x1')],'unique':_0x93b3('0x2')},'password':{'type':Sequelize[_0x93b3('0x1')]},'email':{'type':Sequelize[_0x93b3('0x1')]},'remoteUri':{'type':Sequelize[_0x93b3('0x1')],'unique':_0x93b3('0x3')},'serverUrl':{'type':Sequelize[_0x93b3('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 3cd72e1..a15e592 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 _0x4904=['reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','reopen_count','sys_tags','escalation','correlation_id','location','category','username','password','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','label','push','all','remove','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','ServiceNow\x20error:\x20','statusCode','error','test','Wrong\x20credentials','boolean','true','False','sys_choice?sysparm_query=name=incident^element=','false','value','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','end','json','limit','undefined','count','offset','status','set','Content-Range','apply','reject','update','destroy','then','sendStatus','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','includeAll','create','body','catch','find','getConfigurations','findOne','ServicenowConfiguration','pick','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','parent','caused_by','sys_updated_on','child_incidents','number','resolved_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','time_worked','opened_at','business_duration','group_list','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','company'];(function(_0x12d951,_0x249808){var _0x44de17=function(_0x182fd9){while(--_0x182fd9){_0x12d951['push'](_0x12d951['shift']());}};_0x44de17(++_0x249808);}(_0x4904,0xe3));var _0x4490=function(_0x16f22e,_0x3e8989){_0x16f22e=_0x16f22e-0x0;var _0x175149=_0x4904[_0x16f22e];return _0x175149;};'use strict';var emlformat=require(_0x4490('0x0'));var rimraf=require(_0x4490('0x1'));var zipdir=require(_0x4490('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4490('0x3'));var moment=require(_0x4490('0x4'));var BPromise=require(_0x4490('0x5'));var Mustache=require(_0x4490('0x6'));var util=require(_0x4490('0x7'));var path=require('path');var sox=require(_0x4490('0x8'));var csv=require(_0x4490('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4490('0xa'));var squel=require('squel');var crypto=require(_0x4490('0xb'));var jsforce=require(_0x4490('0xc'));var deskjs=require(_0x4490('0xd'));var toCsv=require(_0x4490('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4490('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4490('0xf'));var as=require(_0x4490('0x10'));var hardwareService=require(_0x4490('0x11'));var logger=require(_0x4490('0x12'))('api');var utils=require(_0x4490('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4490('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3bf7c3,_0x42ef15){_0x42ef15=_0x42ef15||0xcc;return function(_0x37ec77){if(_0x37ec77){return _0x3bf7c3['sendStatus'](_0x42ef15);}return _0x3bf7c3['status'](_0x42ef15)[_0x4490('0x15')]();};}function respondWithResult(_0x5dc82e,_0x93b7e3){_0x93b7e3=_0x93b7e3||0xc8;return function(_0x1d5667){if(_0x1d5667){return _0x5dc82e['status'](_0x93b7e3)[_0x4490('0x16')](_0x1d5667);}};}function respondWithFilteredResult(_0x3ee71b,_0x4d3f6d){return function(_0x5e17c6){if(_0x5e17c6){var _0xda406d=typeof _0x4d3f6d['offset']==='undefined'&&typeof _0x4d3f6d[_0x4490('0x17')]===_0x4490('0x18');var _0x560fa5=_0x5e17c6[_0x4490('0x19')];var _0x556f19=_0xda406d?0x0:_0x4d3f6d[_0x4490('0x1a')];var _0x2cdf7a=_0xda406d?_0x5e17c6[_0x4490('0x19')]:_0x4d3f6d['offset']+_0x4d3f6d[_0x4490('0x17')];var _0x25e312;if(_0x2cdf7a>=_0x560fa5){_0x2cdf7a=_0x560fa5;_0x25e312=0xc8;}else{_0x25e312=0xce;}_0x3ee71b[_0x4490('0x1b')](_0x25e312);return _0x3ee71b[_0x4490('0x1c')](_0x4490('0x1d'),_0x556f19+'-'+_0x2cdf7a+'/'+_0x560fa5)['json'](_0x5e17c6);}return null;};}function patchUpdates(_0x7feff0){return function(_0x3be88d){try{jsonpatch[_0x4490('0x1e')](_0x3be88d,_0x7feff0,!![]);}catch(_0x27086f){return BPromise[_0x4490('0x1f')](_0x27086f);}return _0x3be88d['save']();};}function saveUpdates(_0x3724c6,_0x3a6f1a){return function(_0x2862f9){if(_0x2862f9){return _0x2862f9[_0x4490('0x20')](_0x3724c6)['then'](function(_0xda1ec1){return _0xda1ec1;});}return null;};}function removeEntity(_0xcb0418,_0x4121b7){return function(_0x1b8459){if(_0x1b8459){return _0x1b8459[_0x4490('0x21')]()[_0x4490('0x22')](function(){_0xcb0418[_0x4490('0x1b')](0xcc)[_0x4490('0x15')]();});}};}function handleEntityNotFound(_0x416135,_0x5f3e94){return function(_0x3f0d3c){if(!_0x3f0d3c){_0x416135[_0x4490('0x23')](0x194);}return _0x3f0d3c;};}function handleError(_0x240e14,_0x160686){_0x160686=_0x160686||0x1f4;return function(_0xb8f848){logger['error'](_0xb8f848[_0x4490('0x24')]);if(_0xb8f848[_0x4490('0x25')]){delete _0xb8f848[_0x4490('0x25')];}_0x240e14[_0x4490('0x1b')](_0x160686)[_0x4490('0x26')](_0xb8f848);};}exports[_0x4490('0x27')]=function(_0x3bf1a7,_0x591327){var _0x5025a4={},_0x19a57c={},_0x17a14e={'count':0x0,'rows':[]};var _0x14ef1c=_[_0x4490('0x28')](db[_0x4490('0x29')][_0x4490('0x2a')],function(_0x4d06bb){return{'name':_0x4d06bb[_0x4490('0x2b')],'type':_0x4d06bb[_0x4490('0x2c')]['key']};});_0x19a57c[_0x4490('0x2d')]=_['map'](_0x14ef1c,_0x4490('0x25'));_0x19a57c[_0x4490('0x2e')]=_[_0x4490('0x2f')](_0x3bf1a7[_0x4490('0x2e')]);_0x19a57c[_0x4490('0x30')]=_['intersection'](_0x19a57c['model'],_0x19a57c['query']);_0x5025a4['attributes']=_[_0x4490('0x31')](_0x19a57c[_0x4490('0x2d')],qs[_0x4490('0x32')](_0x3bf1a7[_0x4490('0x2e')][_0x4490('0x32')]));_0x5025a4[_0x4490('0x33')]=_0x5025a4['attributes'][_0x4490('0x34')]?_0x5025a4[_0x4490('0x33')]:_0x19a57c[_0x4490('0x2d')];if(!_0x3bf1a7['query'][_0x4490('0x35')](_0x4490('0x36'))){_0x5025a4[_0x4490('0x17')]=qs[_0x4490('0x17')](_0x3bf1a7[_0x4490('0x2e')][_0x4490('0x17')]);_0x5025a4[_0x4490('0x1a')]=qs[_0x4490('0x1a')](_0x3bf1a7['query'][_0x4490('0x1a')]);}_0x5025a4[_0x4490('0x37')]=qs[_0x4490('0x38')](_0x3bf1a7[_0x4490('0x2e')][_0x4490('0x38')]);_0x5025a4['where']=qs[_0x4490('0x30')](_['pick'](_0x3bf1a7[_0x4490('0x2e')],_0x19a57c[_0x4490('0x30')]),_0x14ef1c);if(_0x3bf1a7[_0x4490('0x2e')]['filter']){_0x5025a4[_0x4490('0x39')]=_[_0x4490('0x3a')](_0x5025a4[_0x4490('0x39')],{'$or':_[_0x4490('0x28')](_0x14ef1c,function(_0x4879f0){if(_0x4879f0['type']!==_0x4490('0x3b')){var _0x23202e={};_0x23202e[_0x4879f0[_0x4490('0x25')]]={'$like':'%'+_0x3bf1a7[_0x4490('0x2e')][_0x4490('0x3c')]+'%'};return _0x23202e;}})});}_0x5025a4=_[_0x4490('0x3a')]({},_0x5025a4,_0x3bf1a7[_0x4490('0x3d')]);var _0x4512a5={'where':_0x5025a4['where']};return db[_0x4490('0x29')][_0x4490('0x19')](_0x4512a5)[_0x4490('0x22')](function(_0x464f0d){_0x17a14e[_0x4490('0x19')]=_0x464f0d;if(_0x3bf1a7['query']['includeAll']){_0x5025a4[_0x4490('0x3e')]=[{'all':!![]}];}return db[_0x4490('0x29')][_0x4490('0x3f')](_0x5025a4);})[_0x4490('0x22')](function(_0x3b253d){_0x17a14e[_0x4490('0x40')]=_0x3b253d;return _0x17a14e;})[_0x4490('0x22')](respondWithFilteredResult(_0x591327,_0x5025a4))['catch'](handleError(_0x591327,null));};exports[_0x4490('0x41')]=function(_0x530219,_0x4e956b){var _0x43c48e={'raw':![],'where':{'id':_0x530219[_0x4490('0x42')]['id']}},_0x584e54={};_0x584e54[_0x4490('0x2d')]=_[_0x4490('0x2f')](db['ServicenowAccount'][_0x4490('0x2a')]);_0x584e54[_0x4490('0x2e')]=_['keys'](_0x530219[_0x4490('0x2e')]);_0x584e54[_0x4490('0x30')]=_['intersection'](_0x584e54[_0x4490('0x2d')],_0x584e54['query']);_0x43c48e[_0x4490('0x33')]=_['intersection'](_0x584e54[_0x4490('0x2d')],qs['fields'](_0x530219[_0x4490('0x2e')][_0x4490('0x32')]));_0x43c48e[_0x4490('0x33')]=_0x43c48e[_0x4490('0x33')]['length']?_0x43c48e[_0x4490('0x33')]:_0x584e54[_0x4490('0x2d')];if(_0x530219['query'][_0x4490('0x43')]){_0x43c48e['include']=[{'all':!![]}];}_0x43c48e=_[_0x4490('0x3a')]({},_0x43c48e,_0x530219[_0x4490('0x3d')]);return db[_0x4490('0x29')]['find'](_0x43c48e)[_0x4490('0x22')](handleEntityNotFound(_0x4e956b,null))[_0x4490('0x22')](respondWithResult(_0x4e956b,null))['catch'](handleError(_0x4e956b,null));};exports[_0x4490('0x44')]=function(_0x2e6abd,_0x5d1ee9){return db[_0x4490('0x29')]['create'](_0x2e6abd[_0x4490('0x45')],{})['then'](respondWithResult(_0x5d1ee9,0xc9))[_0x4490('0x46')](handleError(_0x5d1ee9,null));};exports[_0x4490('0x20')]=function(_0x9dfd8,_0x465dd2){if(_0x9dfd8[_0x4490('0x45')]['id']){delete _0x9dfd8['body']['id'];}return db[_0x4490('0x29')][_0x4490('0x47')]({'where':{'id':_0x9dfd8[_0x4490('0x42')]['id']}})[_0x4490('0x22')](handleEntityNotFound(_0x465dd2,null))[_0x4490('0x22')](saveUpdates(_0x9dfd8[_0x4490('0x45')],null))[_0x4490('0x22')](respondWithResult(_0x465dd2,null))[_0x4490('0x46')](handleError(_0x465dd2,null));};exports[_0x4490('0x21')]=function(_0x50e8f6,_0x460b7a){return db[_0x4490('0x29')][_0x4490('0x47')]({'where':{'id':_0x50e8f6['params']['id']}})[_0x4490('0x22')](handleEntityNotFound(_0x460b7a,null))[_0x4490('0x22')](removeEntity(_0x460b7a,null))[_0x4490('0x46')](handleError(_0x460b7a,null));};exports[_0x4490('0x48')]=function(_0x9d03be,_0x26757f,_0x9a8cb0){var _0x3c1887={};var _0x43162a={};var _0x7cc645;var _0x18c300;return db[_0x4490('0x29')][_0x4490('0x49')]({'where':{'id':_0x9d03be['params']['id']}})['then'](handleEntityNotFound(_0x26757f,null))[_0x4490('0x22')](function(_0x5202ec){if(_0x5202ec){_0x7cc645=_0x5202ec;_0x43162a[_0x4490('0x2d')]=_[_0x4490('0x2f')](db[_0x4490('0x4a')][_0x4490('0x2a')]);_0x43162a['query']=_[_0x4490('0x2f')](_0x9d03be[_0x4490('0x2e')]);_0x43162a['filters']=_[_0x4490('0x31')](_0x43162a[_0x4490('0x2d')],_0x43162a[_0x4490('0x2e')]);_0x3c1887[_0x4490('0x33')]=_[_0x4490('0x31')](_0x43162a[_0x4490('0x2d')],qs['fields'](_0x9d03be[_0x4490('0x2e')]['fields']));_0x3c1887[_0x4490('0x33')]=_0x3c1887['attributes'][_0x4490('0x34')]?_0x3c1887[_0x4490('0x33')]:_0x43162a[_0x4490('0x2d')];_0x3c1887['order']=qs[_0x4490('0x38')](_0x9d03be['query'][_0x4490('0x38')]);_0x3c1887[_0x4490('0x39')]=qs[_0x4490('0x30')](_[_0x4490('0x4b')](_0x9d03be[_0x4490('0x2e')],_0x43162a[_0x4490('0x30')]));if(_0x9d03be['query'][_0x4490('0x3c')]){_0x3c1887['where']=_[_0x4490('0x3a')](_0x3c1887['where'],{'$or':_[_0x4490('0x28')](_0x3c1887[_0x4490('0x33')],function(_0x21d501){var _0x569c5b={};_0x569c5b[_0x21d501]={'$like':'%'+_0x9d03be['query']['filter']+'%'};return _0x569c5b;})});}_0x3c1887=_[_0x4490('0x3a')]({},_0x3c1887,_0x9d03be[_0x4490('0x3d')]);return _0x7cc645[_0x4490('0x48')](_0x3c1887);}})[_0x4490('0x22')](function(_0x45f297){if(_0x45f297){_0x18c300=_0x45f297[_0x4490('0x34')];if(!_0x9d03be['query'][_0x4490('0x35')](_0x4490('0x36'))){_0x3c1887[_0x4490('0x17')]=qs['limit'](_0x9d03be[_0x4490('0x2e')][_0x4490('0x17')]);_0x3c1887[_0x4490('0x1a')]=qs[_0x4490('0x1a')](_0x9d03be[_0x4490('0x2e')][_0x4490('0x1a')]);}return _0x7cc645[_0x4490('0x48')](_0x3c1887);}})[_0x4490('0x22')](function(_0x483fe8){if(_0x483fe8){return _0x483fe8?{'count':_0x18c300,'rows':_0x483fe8}:null;}})[_0x4490('0x22')](respondWithResult(_0x26757f,null))[_0x4490('0x46')](handleError(_0x26757f,null));};exports['addConfiguration']=function(_0x4a21b7,_0x14a4d1,_0x27193d){if(_0x4a21b7[_0x4490('0x45')]['id']){delete _0x4a21b7[_0x4490('0x45')]['id'];}return db[_0x4490('0x29')][_0x4490('0x49')]({'where':{'id':_0x4a21b7['params']['id']}})['then'](handleEntityNotFound(_0x14a4d1,null))['then'](function(_0x323a8a){if(_0x323a8a){_0x4a21b7[_0x4490('0x45')][_0x4490('0x4c')]=_0x323a8a['id'];_0x4a21b7[_0x4490('0x45')][_0x4490('0x4d')]=integrations[_0x4490('0x4e')](_0x4a21b7['body']['channel'],_0x4a21b7[_0x4490('0x45')][_0x4490('0x2c')]);_0x4a21b7[_0x4490('0x45')][_0x4490('0x4f')]=integrations[_0x4490('0x50')](_0x4a21b7[_0x4490('0x45')][_0x4490('0x51')],_0x4a21b7['body'][_0x4490('0x2c')]);return db['ServicenowConfiguration'][_0x4490('0x44')](_0x4a21b7[_0x4490('0x45')],{'include':[{'model':db[_0x4490('0x52')],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0x4490('0x4f')}]});}return null;})['then'](respondWithResult(_0x14a4d1,null))['catch'](handleError(_0x14a4d1,null));};exports[_0x4490('0x53')]=function(_0x3bb5ed,_0x3dc590,_0x2e0ad0){var _0x4db79b=[_0x4490('0x54'),_0x4490('0x55'),_0x4490('0x56'),_0x4490('0x57'),_0x4490('0x58'),_0x4490('0x59'),_0x4490('0x5a'),_0x4490('0x5b'),'category'];var _0x1f2f2b=[_0x4490('0x5c'),_0x4490('0x54'),_0x4490('0x5d'),'watch_list','upon_reject',_0x4490('0x5e'),_0x4490('0x5f'),'hold_reason','approval_history',_0x4490('0x60'),_0x4490('0x61'),'sys_updated_by',_0x4490('0x62'),'user_input',_0x4490('0x63'),_0x4490('0x64'),_0x4490('0x65'),_0x4490('0x66'),_0x4490('0x56'),_0x4490('0x37'),_0x4490('0x67'),'closed_at',_0x4490('0x68'),_0x4490('0x69'),_0x4490('0x6a'),_0x4490('0x6b'),_0x4490('0x6c'),_0x4490('0x6d'),'priority',_0x4490('0x6e'),'rfc',_0x4490('0x6f'),'expected_start',_0x4490('0x70'),_0x4490('0x71'),_0x4490('0x72'),'work_end',_0x4490('0x73'),_0x4490('0x74'),_0x4490('0x75'),_0x4490('0x76'),_0x4490('0x57'),_0x4490('0x77'),_0x4490('0x78'),_0x4490('0x58'),'correlation_display','delivery_task','work_start',_0x4490('0x79'),_0x4490('0x7a'),_0x4490('0x7b'),_0x4490('0x7c'),'calendar_duration',_0x4490('0x59'),_0x4490('0x7d'),_0x4490('0x7e'),_0x4490('0x7f'),_0x4490('0x80'),'parent_incident',_0x4490('0x81'),_0x4490('0x82'),_0x4490('0x83'),'incident_state',_0x4490('0x84'),_0x4490('0x85'),_0x4490('0x86'),_0x4490('0x87'),_0x4490('0x88'),_0x4490('0x89'),'severity',_0x4490('0x8a'),_0x4490('0x8b'),_0x4490('0x8c'),_0x4490('0x8d'),'due_date','sys_mod_count',_0x4490('0x8e'),_0x4490('0x8f'),_0x4490('0x90'),'upon_approval',_0x4490('0x91'),_0x4490('0x92'),_0x4490('0x93')];var _0x5c9f1b='';var _0x33e358='';var _0x1892ee=[];var _0x503ba4='';var _0x13ea45='';var _0x118570=[];var _0x473429='';var _0xa82e22='';var _0x129ce9={};var _0x4b5aec='';return db['ServicenowAccount'][_0x4490('0x49')]({'where':{'id':_0x3bb5ed[_0x4490('0x42')]['id']},'attributes':['id',_0x4490('0x94'),_0x4490('0x95'),_0x4490('0x96'),_0x4490('0x97'),_0x4490('0x98')]})['then'](handleEntityNotFound(_0x3dc590,null))[_0x4490('0x22')](function(_0x2470b2){if(_0x2470b2){_0x4b5aec=_0x2470b2['remoteUri'];var _0x66be7=_0x4b5aec[_0x4490('0x99')](-0x1);if(_0x66be7==='/'){_0x4b5aec=_0x4b5aec['substring'](0x0,_0x4b5aec[_0x4490('0x9a')](_0x66be7));}_0xa82e22=util[_0x4490('0x9b')]('%s/api/now/doc/table/schema/',_0x4b5aec);_0x473429=util[_0x4490('0x9b')](_0x4490('0x9c'),_0x4b5aec);_0x129ce9={'user':_0x2470b2[_0x4490('0x94')],'pass':_0x2470b2[_0x4490('0x95')]};var _0x8b3c98={'method':'GET','uri':_0xa82e22+_0x4490('0x9d'),'auth':_0x129ce9,'json':!![]};return rp(_0x8b3c98);}})[_0x4490('0x22')](function(_0x187971){if(_0x187971[_0x4490('0x9e')][_0x4490('0x34')]>0x0){_0x5c9f1b=_0x187971['result'];}console[_0x4490('0x9f')](_0x4490('0xa0'),_0x5c9f1b);_0x118570=[];_0x33e358=Object[_0x4490('0xa1')]([],_0x5c9f1b);_['remove'](_0x33e358,function(_0x41cfb0){return!_0x4db79b['includes'](_0x41cfb0[_0x4490('0x25')]);});_0x33e358['forEach'](function(_0xbe7dc3){var _0x24b90a=createFieldObject(_0x473429,_0x129ce9,_0xbe7dc3['internalType'],_0xbe7dc3['name'],_0xbe7dc3[_0x4490('0xa2')],![]);_0x118570[_0x4490('0xa3')](_0x24b90a);});return Promise[_0x4490('0xa4')](_0x118570);})[_0x4490('0x22')](function(_0x42ec51){_0x1892ee=_0x42ec51;_0x503ba4=Object[_0x4490('0xa1')]([],_0x5c9f1b);console[_0x4490('0x9f')]('TCL:\x20_object',_0x5c9f1b);_[_0x4490('0xa5')](_0x503ba4,function(_0x189237){return _0x1f2f2b[_0x4490('0xa6')](_0x189237[_0x4490('0x25')]);});console[_0x4490('0x9f')](_0x4490('0xa7'),_0x503ba4);_0x118570=[];_0x503ba4[_0x4490('0xa8')](function(_0x4ffe59){var _0x2bd54d=createFieldObject(_0x473429,_0x129ce9,_0x4ffe59['internalType'],_0x4ffe59[_0x4490('0x25')],_0x4ffe59[_0x4490('0xa2')],!![]);_0x118570[_0x4490('0xa3')](_0x2bd54d);});return Promise[_0x4490('0xa4')](_0x118570);})['then'](function(_0x18a401){_0x13ea45=_0x18a401;var _0x189273=_0x1892ee[_0x4490('0xa9')](_0x13ea45);return{'count':_0x189273['length'],'rows':_0x189273};})[_0x4490('0x22')](respondWithResult(_0x3dc590,null))[_0x4490('0x46')](function(_0x1dbf2d){console['log'](_0x4490('0xaa')+_0x1dbf2d);var _0x1d0760=_0x3bb5ed['query']['test']?0x1f4:_0x1dbf2d[_0x4490('0xab')]||0x1f4;logger[_0x4490('0xac')](_0x1dbf2d['stack']);delete _0x1dbf2d[_0x4490('0x25')];if(_0x1d0760===0x191){_0x1d0760=0x190;}_0x3dc590['status'](_0x1d0760)[_0x4490('0x26')](_0x3bb5ed['query'][_0x4490('0xad')]?{'message':_0x4490('0xae'),'statusCode':_0x1dbf2d[_0x4490('0xab')]}:_0x1dbf2d);});};function createFieldObject(_0x294124,_0x5eeaff,_0x55f082,_0x5104e8,_0x99f191,_0x524728){return new Promise(function(_0x210e24,_0x292b7b){var _0x5d4bca={'id':_0x5104e8,'name':_0x99f191,'custom':_0x524728};if(_0x55f082===_0x4490('0xaf')){_0x5d4bca[_0x4490('0x3d')]=[{'name':'True','value':_0x4490('0xb0')},{'name':_0x4490('0xb1'),'value':'false'}];_0x210e24(_0x5d4bca);}else{var _0x2b180f={'method':'GET','uri':_0x294124+_0x4490('0xb2')+_0x5104e8,'auth':_0x5eeaff,'json':!![]};return rp(_0x2b180f)[_0x4490('0x22')](function(_0x3bd609){var _0x32b98a=[];if(_0x3bd609[_0x4490('0x9e')][_0x4490('0x34')]>0x0){_0x3bd609[_0x4490('0x9e')][_0x4490('0xa8')](function(_0x4eeedc){if(_0x4eeedc['inactive']===_0x4490('0xb3')){var _0x2f8079={'name':_0x4eeedc[_0x4490('0xa2')],'value':_0x4eeedc[_0x4490('0xb4')]};_0x32b98a['push'](_0x2f8079);}});}_0x5d4bca['options']=_0x32b98a;if(_0x5d4bca['options'][_0x4490('0x34')]>0x0){_0x210e24(_0x5d4bca);}else{if(_0x524728==![]){_0x210e24();}else{_0x210e24(_0x5d4bca);}}});}});} \ No newline at end of file +var _0xd9b6=['includeAll','include','findAll','rows','catch','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','incident_state','severity','category','watch_list','upon_reject','child_incidents','number','resolved_by','user_input','sys_domain','state','sys_created_by','cmdb_ci','delivery_plan','impact','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','delivery_task','assignment_group','business_stc','calendar_duration','notify','sys_class_name','close_notes','follow_up','parent_incident','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','due_date','reopen_count','escalation','upon_approval','correlation_id','location','username','password','email','serverUrl','remoteUri','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','label','push','all','TCL:\x20_object','remove','internalType','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','true','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','send','index','ServicenowAccount','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','map','VIRTUAL','options'];(function(_0x2d1be5,_0x117de7){var _0x34a7cc=function(_0x5e910e){while(--_0x5e910e){_0x2d1be5['push'](_0x2d1be5['shift']());}};_0x34a7cc(++_0x117de7);}(_0xd9b6,0x1ed));var _0x6d9b=function(_0x140d2f,_0x2ad576){_0x140d2f=_0x140d2f-0x0;var _0x1a04c6=_0xd9b6[_0x140d2f];return _0x1a04c6;};'use strict';var emlformat=require(_0x6d9b('0x0'));var rimraf=require(_0x6d9b('0x1'));var zipdir=require(_0x6d9b('0x2'));var jsonpatch=require(_0x6d9b('0x3'));var rp=require(_0x6d9b('0x4'));var moment=require(_0x6d9b('0x5'));var BPromise=require(_0x6d9b('0x6'));var Mustache=require('mustache');var util=require(_0x6d9b('0x7'));var path=require(_0x6d9b('0x8'));var sox=require(_0x6d9b('0x9'));var csv=require(_0x6d9b('0xa'));var ejs=require(_0x6d9b('0xb'));var fs=require('fs');var fs_extra=require(_0x6d9b('0xc'));var _=require(_0x6d9b('0xd'));var squel=require('squel');var crypto=require(_0x6d9b('0xe'));var jsforce=require(_0x6d9b('0xf'));var deskjs=require(_0x6d9b('0x10'));var toCsv=require(_0x6d9b('0xa'));var querystring=require('querystring');var Papa=require(_0x6d9b('0x11'));var Redis=require('ioredis');var authService=require(_0x6d9b('0x12'));var qs=require(_0x6d9b('0x13'));var as=require(_0x6d9b('0x14'));var hardwareService=require(_0x6d9b('0x15'));var logger=require(_0x6d9b('0x16'))(_0x6d9b('0x17'));var utils=require(_0x6d9b('0x18'));var config=require(_0x6d9b('0x19'));var licenseUtil=require(_0x6d9b('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6d9b('0x1b'));function respondWithStatusCode(_0x30166a,_0x14e575){_0x14e575=_0x14e575||0xcc;return function(_0x1b8c2d){if(_0x1b8c2d){return _0x30166a[_0x6d9b('0x1c')](_0x14e575);}return _0x30166a[_0x6d9b('0x1d')](_0x14e575)['end']();};}function respondWithResult(_0x32c71b,_0x17cc4a){_0x17cc4a=_0x17cc4a||0xc8;return function(_0x4a79a7){if(_0x4a79a7){return _0x32c71b[_0x6d9b('0x1d')](_0x17cc4a)[_0x6d9b('0x1e')](_0x4a79a7);}};}function respondWithFilteredResult(_0x275004,_0x432b33){return function(_0x593a06){if(_0x593a06){var _0xe4a696=typeof _0x432b33['offset']==='undefined'&&typeof _0x432b33['limit']===_0x6d9b('0x1f');var _0x1ed8f3=_0x593a06[_0x6d9b('0x20')];var _0x571187=_0xe4a696?0x0:_0x432b33['offset'];var _0x3389cd=_0xe4a696?_0x593a06[_0x6d9b('0x20')]:_0x432b33['offset']+_0x432b33[_0x6d9b('0x21')];var _0x341838;if(_0x3389cd>=_0x1ed8f3){_0x3389cd=_0x1ed8f3;_0x341838=0xc8;}else{_0x341838=0xce;}_0x275004['status'](_0x341838);return _0x275004[_0x6d9b('0x22')](_0x6d9b('0x23'),_0x571187+'-'+_0x3389cd+'/'+_0x1ed8f3)[_0x6d9b('0x1e')](_0x593a06);}return null;};}function patchUpdates(_0x5b1e1c){return function(_0x554480){try{jsonpatch['apply'](_0x554480,_0x5b1e1c,!![]);}catch(_0x632e9c){return BPromise[_0x6d9b('0x24')](_0x632e9c);}return _0x554480[_0x6d9b('0x25')]();};}function saveUpdates(_0x87fd85,_0x3a3a94){return function(_0x30dfcd){if(_0x30dfcd){return _0x30dfcd[_0x6d9b('0x26')](_0x87fd85)['then'](function(_0x57d225){return _0x57d225;});}return null;};}function removeEntity(_0x5240df,_0xb0133d){return function(_0x284cfe){if(_0x284cfe){return _0x284cfe[_0x6d9b('0x27')]()[_0x6d9b('0x28')](function(){_0x5240df[_0x6d9b('0x1d')](0xcc)[_0x6d9b('0x29')]();});}};}function handleEntityNotFound(_0xc7865d,_0x5c27e7){return function(_0x3cb54c){if(!_0x3cb54c){_0xc7865d[_0x6d9b('0x1c')](0x194);}return _0x3cb54c;};}function handleError(_0x3130ba,_0x5f1be7){_0x5f1be7=_0x5f1be7||0x1f4;return function(_0x1a8134){logger[_0x6d9b('0x2a')](_0x1a8134[_0x6d9b('0x2b')]);if(_0x1a8134['name']){delete _0x1a8134[_0x6d9b('0x2c')];}_0x3130ba[_0x6d9b('0x1d')](_0x5f1be7)[_0x6d9b('0x2d')](_0x1a8134);};}exports[_0x6d9b('0x2e')]=function(_0x4fabcc,_0x5cbbd5){var _0x4033dd={},_0x290c89={},_0x27e380={'count':0x0,'rows':[]};var _0x3f9ee3=_['map'](db[_0x6d9b('0x2f')][_0x6d9b('0x30')],function(_0x2b16c6){return{'name':_0x2b16c6['fieldName'],'type':_0x2b16c6[_0x6d9b('0x31')][_0x6d9b('0x32')]};});_0x290c89['model']=_['map'](_0x3f9ee3,_0x6d9b('0x2c'));_0x290c89[_0x6d9b('0x33')]=_[_0x6d9b('0x34')](_0x4fabcc[_0x6d9b('0x33')]);_0x290c89[_0x6d9b('0x35')]=_[_0x6d9b('0x36')](_0x290c89[_0x6d9b('0x37')],_0x290c89['query']);_0x4033dd[_0x6d9b('0x38')]=_[_0x6d9b('0x36')](_0x290c89[_0x6d9b('0x37')],qs[_0x6d9b('0x39')](_0x4fabcc[_0x6d9b('0x33')][_0x6d9b('0x39')]));_0x4033dd[_0x6d9b('0x38')]=_0x4033dd['attributes'][_0x6d9b('0x3a')]?_0x4033dd[_0x6d9b('0x38')]:_0x290c89['model'];if(!_0x4fabcc[_0x6d9b('0x33')][_0x6d9b('0x3b')](_0x6d9b('0x3c'))){_0x4033dd[_0x6d9b('0x21')]=qs[_0x6d9b('0x21')](_0x4fabcc[_0x6d9b('0x33')][_0x6d9b('0x21')]);_0x4033dd[_0x6d9b('0x3d')]=qs[_0x6d9b('0x3d')](_0x4fabcc[_0x6d9b('0x33')][_0x6d9b('0x3d')]);}_0x4033dd[_0x6d9b('0x3e')]=qs[_0x6d9b('0x3f')](_0x4fabcc['query']['sort']);_0x4033dd[_0x6d9b('0x40')]=qs['filters'](_[_0x6d9b('0x41')](_0x4fabcc[_0x6d9b('0x33')],_0x290c89[_0x6d9b('0x35')]),_0x3f9ee3);if(_0x4fabcc[_0x6d9b('0x33')][_0x6d9b('0x42')]){_0x4033dd[_0x6d9b('0x40')]=_[_0x6d9b('0x43')](_0x4033dd[_0x6d9b('0x40')],{'$or':_[_0x6d9b('0x44')](_0x3f9ee3,function(_0x22e3c6){if(_0x22e3c6[_0x6d9b('0x31')]!==_0x6d9b('0x45')){var _0x3c79c8={};_0x3c79c8[_0x22e3c6[_0x6d9b('0x2c')]]={'$like':'%'+_0x4fabcc[_0x6d9b('0x33')]['filter']+'%'};return _0x3c79c8;}})});}_0x4033dd=_[_0x6d9b('0x43')]({},_0x4033dd,_0x4fabcc[_0x6d9b('0x46')]);var _0x1fa349={'where':_0x4033dd[_0x6d9b('0x40')]};return db[_0x6d9b('0x2f')][_0x6d9b('0x20')](_0x1fa349)[_0x6d9b('0x28')](function(_0x13c837){_0x27e380[_0x6d9b('0x20')]=_0x13c837;if(_0x4fabcc['query'][_0x6d9b('0x47')]){_0x4033dd[_0x6d9b('0x48')]=[{'all':!![]}];}return db[_0x6d9b('0x2f')][_0x6d9b('0x49')](_0x4033dd);})[_0x6d9b('0x28')](function(_0x2c285e){_0x27e380[_0x6d9b('0x4a')]=_0x2c285e;return _0x27e380;})['then'](respondWithFilteredResult(_0x5cbbd5,_0x4033dd))[_0x6d9b('0x4b')](handleError(_0x5cbbd5,null));};exports['show']=function(_0x5dd5d3,_0x2c0056){var _0x437638={'raw':![],'where':{'id':_0x5dd5d3['params']['id']}},_0x25ea83={};_0x25ea83['model']=_[_0x6d9b('0x34')](db[_0x6d9b('0x2f')][_0x6d9b('0x30')]);_0x25ea83[_0x6d9b('0x33')]=_[_0x6d9b('0x34')](_0x5dd5d3[_0x6d9b('0x33')]);_0x25ea83['filters']=_[_0x6d9b('0x36')](_0x25ea83[_0x6d9b('0x37')],_0x25ea83['query']);_0x437638[_0x6d9b('0x38')]=_[_0x6d9b('0x36')](_0x25ea83['model'],qs[_0x6d9b('0x39')](_0x5dd5d3['query'][_0x6d9b('0x39')]));_0x437638[_0x6d9b('0x38')]=_0x437638[_0x6d9b('0x38')][_0x6d9b('0x3a')]?_0x437638[_0x6d9b('0x38')]:_0x25ea83[_0x6d9b('0x37')];if(_0x5dd5d3[_0x6d9b('0x33')][_0x6d9b('0x47')]){_0x437638[_0x6d9b('0x48')]=[{'all':!![]}];}_0x437638=_['merge']({},_0x437638,_0x5dd5d3[_0x6d9b('0x46')]);return db[_0x6d9b('0x2f')][_0x6d9b('0x4c')](_0x437638)[_0x6d9b('0x28')](handleEntityNotFound(_0x2c0056,null))[_0x6d9b('0x28')](respondWithResult(_0x2c0056,null))[_0x6d9b('0x4b')](handleError(_0x2c0056,null));};exports[_0x6d9b('0x4d')]=function(_0x895c71,_0x3f54ec){return db[_0x6d9b('0x2f')][_0x6d9b('0x4d')](_0x895c71[_0x6d9b('0x4e')],{})['then'](respondWithResult(_0x3f54ec,0xc9))['catch'](handleError(_0x3f54ec,null));};exports[_0x6d9b('0x26')]=function(_0x2252fa,_0x57ebe8){if(_0x2252fa[_0x6d9b('0x4e')]['id']){delete _0x2252fa[_0x6d9b('0x4e')]['id'];}return db[_0x6d9b('0x2f')]['find']({'where':{'id':_0x2252fa['params']['id']}})[_0x6d9b('0x28')](handleEntityNotFound(_0x57ebe8,null))[_0x6d9b('0x28')](saveUpdates(_0x2252fa['body'],null))[_0x6d9b('0x28')](respondWithResult(_0x57ebe8,null))[_0x6d9b('0x4b')](handleError(_0x57ebe8,null));};exports[_0x6d9b('0x27')]=function(_0xc4df9b,_0x178373){return db['ServicenowAccount']['find']({'where':{'id':_0xc4df9b[_0x6d9b('0x4f')]['id']}})[_0x6d9b('0x28')](handleEntityNotFound(_0x178373,null))[_0x6d9b('0x28')](removeEntity(_0x178373,null))[_0x6d9b('0x4b')](handleError(_0x178373,null));};exports[_0x6d9b('0x50')]=function(_0x140491,_0x17ba05,_0x21e08c){var _0x1dd5db={};var _0xd3830c={};var _0x5e3e6c;var _0x291fa0;return db[_0x6d9b('0x2f')][_0x6d9b('0x51')]({'where':{'id':_0x140491[_0x6d9b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x17ba05,null))[_0x6d9b('0x28')](function(_0x5ab1e1){if(_0x5ab1e1){_0x5e3e6c=_0x5ab1e1;_0xd3830c[_0x6d9b('0x37')]=_['keys'](db[_0x6d9b('0x52')][_0x6d9b('0x30')]);_0xd3830c[_0x6d9b('0x33')]=_[_0x6d9b('0x34')](_0x140491[_0x6d9b('0x33')]);_0xd3830c[_0x6d9b('0x35')]=_['intersection'](_0xd3830c[_0x6d9b('0x37')],_0xd3830c[_0x6d9b('0x33')]);_0x1dd5db[_0x6d9b('0x38')]=_[_0x6d9b('0x36')](_0xd3830c[_0x6d9b('0x37')],qs[_0x6d9b('0x39')](_0x140491[_0x6d9b('0x33')][_0x6d9b('0x39')]));_0x1dd5db['attributes']=_0x1dd5db[_0x6d9b('0x38')][_0x6d9b('0x3a')]?_0x1dd5db[_0x6d9b('0x38')]:_0xd3830c[_0x6d9b('0x37')];_0x1dd5db[_0x6d9b('0x3e')]=qs[_0x6d9b('0x3f')](_0x140491[_0x6d9b('0x33')]['sort']);_0x1dd5db[_0x6d9b('0x40')]=qs[_0x6d9b('0x35')](_['pick'](_0x140491[_0x6d9b('0x33')],_0xd3830c[_0x6d9b('0x35')]));if(_0x140491[_0x6d9b('0x33')][_0x6d9b('0x42')]){_0x1dd5db[_0x6d9b('0x40')]=_[_0x6d9b('0x43')](_0x1dd5db[_0x6d9b('0x40')],{'$or':_[_0x6d9b('0x44')](_0x1dd5db[_0x6d9b('0x38')],function(_0x20a5b9){var _0x12d837={};_0x12d837[_0x20a5b9]={'$like':'%'+_0x140491[_0x6d9b('0x33')][_0x6d9b('0x42')]+'%'};return _0x12d837;})});}_0x1dd5db=_[_0x6d9b('0x43')]({},_0x1dd5db,_0x140491[_0x6d9b('0x46')]);return _0x5e3e6c[_0x6d9b('0x50')](_0x1dd5db);}})[_0x6d9b('0x28')](function(_0x141517){if(_0x141517){_0x291fa0=_0x141517['length'];if(!_0x140491[_0x6d9b('0x33')][_0x6d9b('0x3b')](_0x6d9b('0x3c'))){_0x1dd5db[_0x6d9b('0x21')]=qs[_0x6d9b('0x21')](_0x140491[_0x6d9b('0x33')][_0x6d9b('0x21')]);_0x1dd5db['offset']=qs[_0x6d9b('0x3d')](_0x140491[_0x6d9b('0x33')][_0x6d9b('0x3d')]);}return _0x5e3e6c[_0x6d9b('0x50')](_0x1dd5db);}})[_0x6d9b('0x28')](function(_0x510aa4){if(_0x510aa4){return _0x510aa4?{'count':_0x291fa0,'rows':_0x510aa4}:null;}})[_0x6d9b('0x28')](respondWithResult(_0x17ba05,null))[_0x6d9b('0x4b')](handleError(_0x17ba05,null));};exports[_0x6d9b('0x53')]=function(_0x1e9fad,_0x6733ec,_0x36c378){if(_0x1e9fad[_0x6d9b('0x4e')]['id']){delete _0x1e9fad[_0x6d9b('0x4e')]['id'];}return db[_0x6d9b('0x2f')][_0x6d9b('0x51')]({'where':{'id':_0x1e9fad['params']['id']}})[_0x6d9b('0x28')](handleEntityNotFound(_0x6733ec,null))[_0x6d9b('0x28')](function(_0x3ac3a3){if(_0x3ac3a3){_0x1e9fad[_0x6d9b('0x4e')][_0x6d9b('0x54')]=_0x3ac3a3['id'];_0x1e9fad['body'][_0x6d9b('0x55')]=integrations[_0x6d9b('0x56')](_0x1e9fad['body'][_0x6d9b('0x57')],_0x1e9fad[_0x6d9b('0x4e')][_0x6d9b('0x31')]);_0x1e9fad[_0x6d9b('0x4e')][_0x6d9b('0x58')]=integrations[_0x6d9b('0x59')](_0x1e9fad[_0x6d9b('0x4e')][_0x6d9b('0x57')],_0x1e9fad[_0x6d9b('0x4e')][_0x6d9b('0x31')]);return db['ServicenowConfiguration'][_0x6d9b('0x4d')](_0x1e9fad[_0x6d9b('0x4e')],{'include':[{'model':db[_0x6d9b('0x5a')],'as':'Subjects'},{'model':db[_0x6d9b('0x5a')],'as':_0x6d9b('0x58')}]});}return null;})[_0x6d9b('0x28')](respondWithResult(_0x6733ec,null))['catch'](handleError(_0x6733ec,null));};exports[_0x6d9b('0x5b')]=function(_0x44115c,_0x3bb1e2,_0xcfc6fc){var _0x193873=[_0x6d9b('0x5c'),_0x6d9b('0x5d'),_0x6d9b('0x5e'),_0x6d9b('0x5f'),_0x6d9b('0x60'),'notify',_0x6d9b('0x61'),_0x6d9b('0x62'),_0x6d9b('0x63')];var _0x3782c5=['parent','made_sla','caused_by',_0x6d9b('0x64'),_0x6d9b('0x65'),'sys_updated_on',_0x6d9b('0x66'),_0x6d9b('0x5d'),'approval_history',_0x6d9b('0x67'),_0x6d9b('0x68'),'sys_updated_by','opened_by',_0x6d9b('0x69'),'sys_created_on',_0x6d9b('0x6a'),_0x6d9b('0x6b'),_0x6d9b('0x6c'),_0x6d9b('0x5e'),'order','calendar_stc','closed_at',_0x6d9b('0x6d'),_0x6d9b('0x6e'),_0x6d9b('0x6f'),'active',_0x6d9b('0x70'),'business_service',_0x6d9b('0x71'),_0x6d9b('0x72'),_0x6d9b('0x73'),_0x6d9b('0x74'),_0x6d9b('0x75'),_0x6d9b('0x76'),_0x6d9b('0x77'),_0x6d9b('0x78'),'work_end',_0x6d9b('0x79'),_0x6d9b('0x7a'),_0x6d9b('0x7b'),_0x6d9b('0x7c'),_0x6d9b('0x5f'),_0x6d9b('0x7d'),_0x6d9b('0x7e'),_0x6d9b('0x60'),'correlation_display',_0x6d9b('0x7f'),'work_start',_0x6d9b('0x80'),_0x6d9b('0x81'),'additional_assignee_list','description',_0x6d9b('0x82'),_0x6d9b('0x83'),_0x6d9b('0x84'),_0x6d9b('0x85'),'closed_by',_0x6d9b('0x86'),_0x6d9b('0x87'),'sys_id',_0x6d9b('0x88'),_0x6d9b('0x89'),_0x6d9b('0x61'),_0x6d9b('0x8a'),_0x6d9b('0x8b'),_0x6d9b('0x8c'),_0x6d9b('0x8d'),_0x6d9b('0x8e'),'assigned_to',_0x6d9b('0x62'),_0x6d9b('0x8f'),_0x6d9b('0x90'),_0x6d9b('0x91'),_0x6d9b('0x92'),_0x6d9b('0x93'),'sys_mod_count',_0x6d9b('0x94'),'sys_tags',_0x6d9b('0x95'),_0x6d9b('0x96'),_0x6d9b('0x97'),_0x6d9b('0x98'),_0x6d9b('0x63')];var _0x471f9a='';var _0x59cebb='';var _0xa23f7b=[];var _0xbe9db2='';var _0x156bfe='';var _0x11ddad=[];var _0x420afc='';var _0x46cc1b='';var _0xd81d9d={};var _0x3c86e4='';return db[_0x6d9b('0x2f')][_0x6d9b('0x51')]({'where':{'id':_0x44115c['params']['id']},'attributes':['id',_0x6d9b('0x99'),_0x6d9b('0x9a'),_0x6d9b('0x9b'),'remoteUri',_0x6d9b('0x9c')]})[_0x6d9b('0x28')](handleEntityNotFound(_0x3bb1e2,null))['then'](function(_0x500478){if(_0x500478){_0x3c86e4=_0x500478[_0x6d9b('0x9d')];var _0x2d8a04=_0x3c86e4[_0x6d9b('0x9e')](-0x1);if(_0x2d8a04==='/'){_0x3c86e4=_0x3c86e4['substring'](0x0,_0x3c86e4[_0x6d9b('0x9f')](_0x2d8a04));}_0x46cc1b=util[_0x6d9b('0xa0')](_0x6d9b('0xa1'),_0x3c86e4);_0x420afc=util['format'](_0x6d9b('0xa2'),_0x3c86e4);_0xd81d9d={'user':_0x500478[_0x6d9b('0x99')],'pass':_0x500478[_0x6d9b('0x9a')]};var _0x43413c={'method':_0x6d9b('0xa3'),'uri':_0x46cc1b+_0x6d9b('0xa4'),'auth':_0xd81d9d,'json':!![]};return rp(_0x43413c);}})[_0x6d9b('0x28')](function(_0x58f8ab){if(_0x58f8ab[_0x6d9b('0xa5')][_0x6d9b('0x3a')]>0x0){_0x471f9a=_0x58f8ab['result'];}console[_0x6d9b('0xa6')](_0x6d9b('0xa7'),_0x471f9a);_0x11ddad=[];_0x59cebb=Object[_0x6d9b('0xa8')]([],_0x471f9a);_['remove'](_0x59cebb,function(_0x416328){return!_0x193873[_0x6d9b('0xa9')](_0x416328['name']);});_0x59cebb[_0x6d9b('0xaa')](function(_0x5ce04c){var _0x5605b8=createFieldObject(_0x420afc,_0xd81d9d,_0x5ce04c['internalType'],_0x5ce04c[_0x6d9b('0x2c')],_0x5ce04c[_0x6d9b('0xab')],![]);_0x11ddad[_0x6d9b('0xac')](_0x5605b8);});return Promise[_0x6d9b('0xad')](_0x11ddad);})[_0x6d9b('0x28')](function(_0xef8f50){_0xa23f7b=_0xef8f50;_0xbe9db2=Object['assign']([],_0x471f9a);console[_0x6d9b('0xa6')](_0x6d9b('0xae'),_0x471f9a);_[_0x6d9b('0xaf')](_0xbe9db2,function(_0x1e1a8e){return _0x3782c5[_0x6d9b('0xa9')](_0x1e1a8e[_0x6d9b('0x2c')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0xbe9db2);_0x11ddad=[];_0xbe9db2[_0x6d9b('0xaa')](function(_0x16faf3){var _0x50b8df=createFieldObject(_0x420afc,_0xd81d9d,_0x16faf3[_0x6d9b('0xb0')],_0x16faf3[_0x6d9b('0x2c')],_0x16faf3[_0x6d9b('0xab')],!![]);_0x11ddad[_0x6d9b('0xac')](_0x50b8df);});return Promise[_0x6d9b('0xad')](_0x11ddad);})[_0x6d9b('0x28')](function(_0x4f1874){_0x156bfe=_0x4f1874;var _0x506b5f=_0xa23f7b[_0x6d9b('0xb1')](_0x156bfe);return{'count':_0x506b5f[_0x6d9b('0x3a')],'rows':_0x506b5f};})[_0x6d9b('0x28')](respondWithResult(_0x3bb1e2,null))[_0x6d9b('0x4b')](function(_0x4856c9){console[_0x6d9b('0xa6')](_0x6d9b('0xb2')+_0x4856c9);var _0x4ee0c1=_0x44115c[_0x6d9b('0x33')][_0x6d9b('0xb3')]?0x1f4:_0x4856c9[_0x6d9b('0xb4')]||0x1f4;logger[_0x6d9b('0x2a')](_0x4856c9[_0x6d9b('0x2b')]);delete _0x4856c9[_0x6d9b('0x2c')];if(_0x4ee0c1===0x191){_0x4ee0c1=0x190;}_0x3bb1e2['status'](_0x4ee0c1)[_0x6d9b('0x2d')](_0x44115c[_0x6d9b('0x33')]['test']?{'message':_0x6d9b('0xb5'),'statusCode':_0x4856c9['statusCode']}:_0x4856c9);});};function createFieldObject(_0x4a36b5,_0x33c556,_0x487601,_0x539298,_0x1be6d5,_0x359b65){return new Promise(function(_0x261588,_0x382c86){var _0x2111f9={'id':_0x539298,'name':_0x1be6d5,'custom':_0x359b65};if(_0x487601===_0x6d9b('0xb6')){_0x2111f9[_0x6d9b('0x46')]=[{'name':'True','value':_0x6d9b('0xb7')},{'name':'False','value':_0x6d9b('0xb8')}];_0x261588(_0x2111f9);}else{var _0x2613ba={'method':_0x6d9b('0xa3'),'uri':_0x4a36b5+_0x6d9b('0xb9')+_0x539298,'auth':_0x33c556,'json':!![]};return rp(_0x2613ba)[_0x6d9b('0x28')](function(_0x37dede){var _0x5c93f3=[];if(_0x37dede[_0x6d9b('0xa5')][_0x6d9b('0x3a')]>0x0){_0x37dede['result'][_0x6d9b('0xaa')](function(_0x50eb9f){if(_0x50eb9f[_0x6d9b('0xba')]===_0x6d9b('0xb8')){var _0x432fa5={'name':_0x50eb9f['label'],'value':_0x50eb9f[_0x6d9b('0xbb')]};_0x5c93f3['push'](_0x432fa5);}});}_0x2111f9[_0x6d9b('0x46')]=_0x5c93f3;if(_0x2111f9[_0x6d9b('0x46')][_0x6d9b('0x3a')]>0x0){_0x261588(_0x2111f9);}else{if(_0x359b65==![]){_0x261588();}else{_0x261588(_0x2111f9);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 66d37a6..b8edc9d 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 _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts'];(function(_0x4215cf,_0x129099){var _0x9e56f7=function(_0x4cc991){while(--_0x4cc991){_0x4215cf['push'](_0x4215cf['shift']());}};_0x9e56f7(++_0x129099);}(_0x1261,0x144));var _0x1126=function(_0x5cfb75,_0x224a85){_0x5cfb75=_0x5cfb75-0x0;var _0x2613d6=_0x1261[_0x5cfb75];return _0x2613d6;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x40ba58,_0x907180){return _0x40ba58['define'](_0x1126('0xa'),attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['path','rimraf','../../config/environment','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0xabce,0x103));var _0xeabc=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xabce[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xeabc('0x8')]=function(_0x52a4d7,_0x229ba4){return _0x52a4d7['define'](_0xeabc('0x9'),attributes,{'tableName':_0xeabc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 359a8f4..8944c2d 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 _0x549c=['ServicenowAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetServicenowAccount','options','raw','where','attributes','map','include','model','debug','stringify','ShowServicenowAccount'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x549c,0x160));var _0xc549=function(_0x221e52,_0x2c0577){_0x221e52=_0x221e52-0x0;var _0x80f585=_0x549c[_0x221e52];return _0x80f585;};'use strict';var _=require(_0xc549('0x0'));var util=require('util');var moment=require(_0xc549('0x1'));var BPromise=require(_0xc549('0x2'));var rs=require(_0xc549('0x3'));var fs=require('fs');var Redis=require(_0xc549('0x4'));var db=require(_0xc549('0x5'))['db'];var utils=require(_0xc549('0x6'));var logger=require(_0xc549('0x7'))(_0xc549('0x8'));var config=require(_0xc549('0x9'));var jayson=require(_0xc549('0xa'));var client=jayson['client'][_0xc549('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f4151,_0x2017da,_0x9181cd){return new BPromise(function(_0x9be218,_0x5772da){return client['request'](_0x2f4151,_0x9181cd)[_0xc549('0xc')](function(_0x303a8d){logger[_0xc549('0xd')](_0xc549('0xe'),_0x2017da,'request\x20sent');logger['debug'](_0xc549('0xf'),_0x2017da,_0xc549('0x10'),JSON['stringify'](_0x303a8d));if(_0x303a8d[_0xc549('0x11')]){if(_0x303a8d['error'][_0xc549('0x12')]===0x1f4){logger[_0xc549('0x11')](_0xc549('0xe'),_0x2017da,_0x303a8d[_0xc549('0x11')][_0xc549('0x13')]);return _0x5772da(_0x303a8d[_0xc549('0x11')]['message']);}logger[_0xc549('0x11')](_0xc549('0xe'),_0x2017da,_0x303a8d[_0xc549('0x11')][_0xc549('0x13')]);return _0x9be218(_0x303a8d[_0xc549('0x11')][_0xc549('0x13')]);}else{logger[_0xc549('0xd')](_0xc549('0xe'),_0x2017da,_0xc549('0x10'));_0x9be218(_0x303a8d[_0xc549('0x14')][_0xc549('0x13')]);}})[_0xc549('0x15')](function(_0x4ba4c8){logger[_0xc549('0x11')](_0xc549('0xe'),_0x2017da,_0x4ba4c8);_0x5772da(_0x4ba4c8);});});}exports[_0xc549('0x16')]=function(_0x33b771){var _0x3cf20a=this;return new Promise(function(_0x46da23,_0x22625b){return db['ServicenowAccount']['findAll']({'raw':_0x33b771[_0xc549('0x17')]?_0x33b771[_0xc549('0x17')][_0xc549('0x18')]===undefined?!![]:![]:!![],'where':_0x33b771[_0xc549('0x17')]?_0x33b771[_0xc549('0x17')][_0xc549('0x19')]||null:null,'attributes':_0x33b771[_0xc549('0x17')]?_0x33b771[_0xc549('0x17')][_0xc549('0x1a')]||null:null,'limit':_0x33b771[_0xc549('0x17')]?_0x33b771[_0xc549('0x17')]['limit']||null:null,'include':_0x33b771['options']?_0x33b771[_0xc549('0x17')]['include']?_[_0xc549('0x1b')](_0x33b771[_0xc549('0x17')][_0xc549('0x1c')],function(_0x46929f){return{'model':db[_0x46929f[_0xc549('0x1d')]],'as':_0x46929f['as'],'attributes':_0x46929f['attributes'],'include':_0x46929f[_0xc549('0x1c')]?_[_0xc549('0x1b')](_0x46929f[_0xc549('0x1c')],function(_0x2699cd){return{'model':db[_0x2699cd['model']],'as':_0x2699cd['as'],'attributes':_0x2699cd[_0xc549('0x1a')],'include':_0x2699cd[_0xc549('0x1c')]?_['map'](_0x2699cd[_0xc549('0x1c')],function(_0x49c15b){return{'model':db[_0x49c15b[_0xc549('0x1d')]],'as':_0x49c15b['as'],'attributes':_0x49c15b['attributes']};}):[]};}):[]};}):[]:[]})[_0xc549('0xc')](function(_0x5df307){logger[_0xc549('0xd')](_0xc549('0x16'),_0x33b771);logger[_0xc549('0x1e')](_0xc549('0x16'),_0x33b771,JSON[_0xc549('0x1f')](_0x5df307));_0x46da23(_0x5df307);})['catch'](function(_0x5a4931){logger[_0xc549('0x11')](_0xc549('0x16'),_0x5a4931['message'],_0x33b771);_0x22625b(_0x3cf20a['error'](0x1f4,_0x5a4931['message']));});});};exports[_0xc549('0x20')]=function(_0x26118a){var _0x457039=this;return new Promise(function(_0x5319a1,_0x32bbb7){return db[_0xc549('0x21')][_0xc549('0x22')]({'raw':_0x26118a[_0xc549('0x17')]?_0x26118a[_0xc549('0x17')][_0xc549('0x18')]===undefined?!![]:![]:!![],'where':_0x26118a['options']?_0x26118a[_0xc549('0x17')]['where']||null:null,'attributes':_0x26118a[_0xc549('0x17')]?_0x26118a[_0xc549('0x17')]['attributes']||null:null,'include':_0x26118a['options']?_0x26118a['options'][_0xc549('0x1c')]?_[_0xc549('0x1b')](_0x26118a[_0xc549('0x17')][_0xc549('0x1c')],function(_0x5f58ca){return{'model':db[_0x5f58ca['model']],'as':_0x5f58ca['as'],'attributes':_0x5f58ca[_0xc549('0x1a')],'include':_0x5f58ca[_0xc549('0x1c')]?_[_0xc549('0x1b')](_0x5f58ca[_0xc549('0x1c')],function(_0x5d414f){return{'model':db[_0x5d414f[_0xc549('0x1d')]],'as':_0x5d414f['as'],'attributes':_0x5d414f[_0xc549('0x1a')],'include':_0x5d414f[_0xc549('0x1c')]?_[_0xc549('0x1b')](_0x5d414f[_0xc549('0x1c')],function(_0xb7fa91){return{'model':db[_0xb7fa91[_0xc549('0x1d')]],'as':_0xb7fa91['as'],'attributes':_0xb7fa91[_0xc549('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc549('0xc')](function(_0x5ae37e){logger['info'](_0xc549('0x20'),_0x26118a);logger['debug'](_0xc549('0x20'),_0x26118a,JSON['stringify'](_0x5ae37e));_0x5319a1(_0x5ae37e);})[_0xc549('0x15')](function(_0x356206){logger[_0xc549('0x11')]('ShowServicenowAccount',_0x356206[_0xc549('0x13')],_0x26118a);_0x32bbb7(_0x457039[_0xc549('0x11')](0x1f4,_0x356206[_0xc549('0x13')]));});});}; \ No newline at end of file +var _0x63a1=['client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetServicenowAccount','ShowServicenowAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0x63a1,0x11d));var _0x163a=function(_0x1c886e,_0x45c241){_0x1c886e=_0x1c886e-0x0;var _0x296675=_0x63a1[_0x1c886e];return _0x296675;};'use strict';var _=require(_0x163a('0x0'));var util=require(_0x163a('0x1'));var moment=require(_0x163a('0x2'));var BPromise=require(_0x163a('0x3'));var rs=require(_0x163a('0x4'));var fs=require('fs');var Redis=require(_0x163a('0x5'));var db=require(_0x163a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x163a('0x7'))(_0x163a('0x8'));var config=require(_0x163a('0x9'));var jayson=require(_0x163a('0xa'));var client=jayson[_0x163a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27047a,_0x339d9e,_0x12b95d){return new BPromise(function(_0x45215b,_0x1c2b51){return client[_0x163a('0xc')](_0x27047a,_0x12b95d)[_0x163a('0xd')](function(_0x441967){logger[_0x163a('0xe')](_0x163a('0xf'),_0x339d9e,_0x163a('0x10'));logger[_0x163a('0x11')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x339d9e,_0x163a('0x10'),JSON[_0x163a('0x12')](_0x441967));if(_0x441967[_0x163a('0x13')]){if(_0x441967[_0x163a('0x13')][_0x163a('0x14')]===0x1f4){logger[_0x163a('0x13')](_0x163a('0xf'),_0x339d9e,_0x441967[_0x163a('0x13')]['message']);return _0x1c2b51(_0x441967['error']['message']);}logger[_0x163a('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x339d9e,_0x441967['error']['message']);return _0x45215b(_0x441967[_0x163a('0x13')][_0x163a('0x15')]);}else{logger[_0x163a('0xe')](_0x163a('0xf'),_0x339d9e,'request\x20sent');_0x45215b(_0x441967[_0x163a('0x16')][_0x163a('0x15')]);}})[_0x163a('0x17')](function(_0x235ef6){logger[_0x163a('0x13')](_0x163a('0xf'),_0x339d9e,_0x235ef6);_0x1c2b51(_0x235ef6);});});}exports['GetServicenowAccount']=function(_0x2ac5a6){var _0x10f449=this;return new Promise(function(_0x2ad6f4,_0x3e9104){return db[_0x163a('0x18')][_0x163a('0x19')]({'raw':_0x2ac5a6['options']?_0x2ac5a6[_0x163a('0x1a')][_0x163a('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ac5a6[_0x163a('0x1a')]?_0x2ac5a6[_0x163a('0x1a')][_0x163a('0x1c')]||null:null,'attributes':_0x2ac5a6[_0x163a('0x1a')]?_0x2ac5a6['options'][_0x163a('0x1d')]||null:null,'limit':_0x2ac5a6[_0x163a('0x1a')]?_0x2ac5a6[_0x163a('0x1a')][_0x163a('0x1e')]||null:null,'include':_0x2ac5a6['options']?_0x2ac5a6['options'][_0x163a('0x1f')]?_[_0x163a('0x20')](_0x2ac5a6[_0x163a('0x1a')]['include'],function(_0x331c90){return{'model':db[_0x331c90[_0x163a('0x21')]],'as':_0x331c90['as'],'attributes':_0x331c90['attributes'],'include':_0x331c90[_0x163a('0x1f')]?_[_0x163a('0x20')](_0x331c90[_0x163a('0x1f')],function(_0x29b821){return{'model':db[_0x29b821[_0x163a('0x21')]],'as':_0x29b821['as'],'attributes':_0x29b821[_0x163a('0x1d')],'include':_0x29b821[_0x163a('0x1f')]?_['map'](_0x29b821[_0x163a('0x1f')],function(_0x3002d3){return{'model':db[_0x3002d3[_0x163a('0x21')]],'as':_0x3002d3['as'],'attributes':_0x3002d3[_0x163a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x163a('0xd')](function(_0xfa8ba5){logger['info'](_0x163a('0x22'),_0x2ac5a6);logger[_0x163a('0x11')]('GetServicenowAccount',_0x2ac5a6,JSON['stringify'](_0xfa8ba5));_0x2ad6f4(_0xfa8ba5);})[_0x163a('0x17')](function(_0x15126c){logger[_0x163a('0x13')](_0x163a('0x22'),_0x15126c[_0x163a('0x15')],_0x2ac5a6);_0x3e9104(_0x10f449['error'](0x1f4,_0x15126c[_0x163a('0x15')]));});});};exports[_0x163a('0x23')]=function(_0x2663cf){var _0x5c544f=this;return new Promise(function(_0x36a268,_0x40293){return db['ServicenowAccount'][_0x163a('0x24')]({'raw':_0x2663cf[_0x163a('0x1a')]?_0x2663cf[_0x163a('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2663cf[_0x163a('0x1a')]?_0x2663cf[_0x163a('0x1a')][_0x163a('0x1c')]||null:null,'attributes':_0x2663cf['options']?_0x2663cf[_0x163a('0x1a')]['attributes']||null:null,'include':_0x2663cf[_0x163a('0x1a')]?_0x2663cf[_0x163a('0x1a')]['include']?_['map'](_0x2663cf[_0x163a('0x1a')][_0x163a('0x1f')],function(_0x4049f3){return{'model':db[_0x4049f3[_0x163a('0x21')]],'as':_0x4049f3['as'],'attributes':_0x4049f3[_0x163a('0x1d')],'include':_0x4049f3[_0x163a('0x1f')]?_['map'](_0x4049f3['include'],function(_0x4f7858){return{'model':db[_0x4f7858[_0x163a('0x21')]],'as':_0x4f7858['as'],'attributes':_0x4f7858[_0x163a('0x1d')],'include':_0x4f7858['include']?_[_0x163a('0x20')](_0x4f7858[_0x163a('0x1f')],function(_0x496b8a){return{'model':db[_0x496b8a[_0x163a('0x21')]],'as':_0x496b8a['as'],'attributes':_0x496b8a[_0x163a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x163a('0xd')](function(_0x22c524){logger['info'](_0x163a('0x23'),_0x2663cf);logger[_0x163a('0x11')](_0x163a('0x23'),_0x2663cf,JSON[_0x163a('0x12')](_0x22c524));_0x36a268(_0x22c524);})['catch'](function(_0x915fe){logger[_0x163a('0x13')](_0x163a('0x23'),_0x915fe[_0x163a('0x15')],_0x2663cf);_0x40293(_0x5c544f[_0x163a('0x13')](0x1f4,_0x915fe['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index f2b4e2a..43f547a 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 _0x3b5f=['getDescriptions','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x2b0074,_0x42d50b){var _0x25b012=function(_0x53d3b9){while(--_0x53d3b9){_0x2b0074['push'](_0x2b0074['shift']());}};_0x25b012(++_0x42d50b);}(_0x3b5f,0x1b0));var _0xf3b5=function(_0x1b3057,_0x1699f3){_0x1b3057=_0x1b3057-0x0;var _0x4f0102=_0x3b5f[_0x1b3057];return _0x4f0102;};'use strict';var multer=require(_0xf3b5('0x0'));var util=require(_0xf3b5('0x1'));var path=require(_0xf3b5('0x2'));var timeout=require(_0xf3b5('0x3'));var express=require(_0xf3b5('0x4'));var router=express[_0xf3b5('0x5')]();var fs_extra=require(_0xf3b5('0x6'));var auth=require(_0xf3b5('0x7'));var interaction=require(_0xf3b5('0x8'));var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0xf3b5('0x9')]('/',auth[_0xf3b5('0xa')](),controller[_0xf3b5('0xb')]);router[_0xf3b5('0x9')](_0xf3b5('0xc'),auth[_0xf3b5('0xa')](),controller[_0xf3b5('0xd')]);router[_0xf3b5('0x9')]('/:id/fields',auth[_0xf3b5('0xa')](),controller[_0xf3b5('0xe')]);router['get'](_0xf3b5('0xf'),auth[_0xf3b5('0xa')](),controller[_0xf3b5('0x10')]);router[_0xf3b5('0x9')](_0xf3b5('0x11'),auth[_0xf3b5('0xa')](),controller[_0xf3b5('0x12')]);router[_0xf3b5('0x13')]('/',auth[_0xf3b5('0xa')](),controller['create']);router[_0xf3b5('0x14')](_0xf3b5('0xc'),auth['isAuthenticated'](),controller[_0xf3b5('0x15')]);router[_0xf3b5('0x16')]('/:id',auth[_0xf3b5('0xa')](),controller[_0xf3b5('0x17')]);module[_0xf3b5('0x18')]=router; \ No newline at end of file +var _0x5725=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','delete'];(function(_0x1e3207,_0x3ce24a){var _0x5b986e=function(_0xa8a77e){while(--_0xa8a77e){_0x1e3207['push'](_0x1e3207['shift']());}};_0x5b986e(++_0x3ce24a);}(_0x5725,0xdd));var _0x5572=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5725[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x5572('0x0'));var util=require(_0x5572('0x1'));var path=require(_0x5572('0x2'));var timeout=require(_0x5572('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5572('0x4'));var auth=require(_0x5572('0x5'));var interaction=require(_0x5572('0x6'));var config=require(_0x5572('0x7'));var controller=require(_0x5572('0x8'));router[_0x5572('0x9')]('/',auth[_0x5572('0xa')](),controller['index']);router[_0x5572('0x9')](_0x5572('0xb'),auth[_0x5572('0xa')](),controller[_0x5572('0xc')]);router[_0x5572('0x9')](_0x5572('0xd'),auth[_0x5572('0xa')](),controller[_0x5572('0xe')]);router[_0x5572('0x9')](_0x5572('0xf'),auth[_0x5572('0xa')](),controller[_0x5572('0x10')]);router[_0x5572('0x9')](_0x5572('0x11'),auth['isAuthenticated'](),controller[_0x5572('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5572('0x13')](_0x5572('0xb'),auth[_0x5572('0xa')](),controller['update']);router[_0x5572('0x14')]('/:id',auth[_0x5572('0xa')](),controller['destroy']);module[_0x5572('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 411feef..4de811f 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 _0xb0ac=['STRING','sequelize','exports'];(function(_0x14ac65,_0x266f2c){var _0x4907d2=function(_0x2b3dba){while(--_0x2b3dba){_0x14ac65['push'](_0x14ac65['shift']());}};_0x4907d2(++_0x266f2c);}(_0xb0ac,0x148));var _0xcb0a=function(_0x3c385c,_0x3bbf85){_0x3c385c=_0x3c385c-0x0;var _0x2efc4b=_0xb0ac[_0x3c385c];return _0x2efc4b;};'use strict';var Sequelize=require(_0xcb0a('0x0'));module[_0xcb0a('0x1')]={'name':{'type':Sequelize[_0xcb0a('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb116=['STRING','sequelize','exports'];(function(_0x57048e,_0x4058f4){var _0x24d679=function(_0x249379){while(--_0x249379){_0x57048e['push'](_0x57048e['shift']());}};_0x24d679(++_0x4058f4);}(_0xb116,0xdf));var _0x6b11=function(_0x590851,_0x496bee){_0x590851=_0x590851-0x0;var _0x3b0115=_0xb116[_0x590851];return _0x3b0115;};'use strict';var Sequelize=require(_0x6b11('0x0'));module[_0x6b11('0x1')]={'name':{'type':Sequelize[_0x6b11('0x2')]},'description':{'type':Sequelize[_0x6b11('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 6b0ee19..46f19aa 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 _0x0b8c=['ServicenowField','findOne','rawAttributes','getSubjects','getDescriptions','rimraf','request-promise','bluebird','util','path','sox','to-csv','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','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','index','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','merge','ServicenowConfiguration','count','includeAll','include','rows','catch','params','options','create','body','find','getFields'];(function(_0x104c0f,_0x4f04f3){var _0xa96475=function(_0x598ea5){while(--_0x598ea5){_0x104c0f['push'](_0x104c0f['shift']());}};_0xa96475(++_0x4f04f3);}(_0x0b8c,0x186));var _0xc0b8=function(_0x369cbf,_0x2b4302){_0x369cbf=_0x369cbf-0x0;var _0x14667c=_0x0b8c[_0x369cbf];return _0x14667c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc0b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc0b8('0x1'));var moment=require('moment');var BPromise=require(_0xc0b8('0x2'));var Mustache=require('mustache');var util=require(_0xc0b8('0x3'));var path=require(_0xc0b8('0x4'));var sox=require(_0xc0b8('0x5'));var csv=require(_0xc0b8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc0b8('0x7'));var _=require('lodash');var squel=require(_0xc0b8('0x8'));var crypto=require(_0xc0b8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc0b8('0xa'));var toCsv=require(_0xc0b8('0x6'));var querystring=require(_0xc0b8('0xb'));var Papa=require(_0xc0b8('0xc'));var Redis=require(_0xc0b8('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc0b8('0xe'));var as=require(_0xc0b8('0xf'));var hardwareService=require(_0xc0b8('0x10'));var logger=require(_0xc0b8('0x11'))(_0xc0b8('0x12'));var utils=require(_0xc0b8('0x13'));var config=require(_0xc0b8('0x14'));var licenseUtil=require(_0xc0b8('0x15'));var db=require(_0xc0b8('0x16'))['db'];function respondWithStatusCode(_0x4b1b01,_0x2ec7d9){_0x2ec7d9=_0x2ec7d9||0xcc;return function(_0x20e813){if(_0x20e813){return _0x4b1b01['sendStatus'](_0x2ec7d9);}return _0x4b1b01[_0xc0b8('0x17')](_0x2ec7d9)[_0xc0b8('0x18')]();};}function respondWithResult(_0x4fa1b1,_0x2290e8){_0x2290e8=_0x2290e8||0xc8;return function(_0x3f2734){if(_0x3f2734){return _0x4fa1b1[_0xc0b8('0x17')](_0x2290e8)[_0xc0b8('0x19')](_0x3f2734);}};}function respondWithFilteredResult(_0x429065,_0xfc1018){return function(_0x1f303a){if(_0x1f303a){var _0x462c7d=typeof _0xfc1018[_0xc0b8('0x1a')]===_0xc0b8('0x1b')&&typeof _0xfc1018['limit']===_0xc0b8('0x1b');var _0x3ea818=_0x1f303a['count'];var _0x52f4ec=_0x462c7d?0x0:_0xfc1018['offset'];var _0x521069=_0x462c7d?_0x1f303a['count']:_0xfc1018['offset']+_0xfc1018[_0xc0b8('0x1c')];var _0x4cedc1;if(_0x521069>=_0x3ea818){_0x521069=_0x3ea818;_0x4cedc1=0xc8;}else{_0x4cedc1=0xce;}_0x429065[_0xc0b8('0x17')](_0x4cedc1);return _0x429065[_0xc0b8('0x1d')](_0xc0b8('0x1e'),_0x52f4ec+'-'+_0x521069+'/'+_0x3ea818)[_0xc0b8('0x19')](_0x1f303a);}return null;};}function patchUpdates(_0x422f2a){return function(_0x16b32f){try{jsonpatch[_0xc0b8('0x1f')](_0x16b32f,_0x422f2a,!![]);}catch(_0x1e847f){return BPromise['reject'](_0x1e847f);}return _0x16b32f[_0xc0b8('0x20')]();};}function saveUpdates(_0xe8d814,_0x4b1f5d){return function(_0x3d1c0d){if(_0x3d1c0d){return _0x3d1c0d[_0xc0b8('0x21')](_0xe8d814)[_0xc0b8('0x22')](function(_0x24076d){return _0x24076d;});}return null;};}function removeEntity(_0x14bfbc,_0x3f07e4){return function(_0x12d116){if(_0x12d116){return _0x12d116[_0xc0b8('0x23')]()[_0xc0b8('0x22')](function(){_0x14bfbc[_0xc0b8('0x17')](0xcc)[_0xc0b8('0x18')]();});}};}function handleEntityNotFound(_0xc75fb4,_0x15608d){return function(_0x495d2d){if(!_0x495d2d){_0xc75fb4[_0xc0b8('0x24')](0x194);}return _0x495d2d;};}function handleError(_0x5e578c,_0x4e2353){_0x4e2353=_0x4e2353||0x1f4;return function(_0x41a6b1){logger[_0xc0b8('0x25')](_0x41a6b1[_0xc0b8('0x26')]);if(_0x41a6b1[_0xc0b8('0x27')]){delete _0x41a6b1[_0xc0b8('0x27')];}_0x5e578c['status'](_0x4e2353)['send'](_0x41a6b1);};}exports[_0xc0b8('0x28')]=function(_0x12500e,_0x30969a){var _0x35eb41={},_0x8ad4e4={},_0x131e59={'count':0x0,'rows':[]};var _0x475b74=_['map'](db['ServicenowConfiguration']['rawAttributes'],function(_0x2d1b96){return{'name':_0x2d1b96['fieldName'],'type':_0x2d1b96[_0xc0b8('0x29')][_0xc0b8('0x2a')]};});_0x8ad4e4['model']=_['map'](_0x475b74,_0xc0b8('0x27'));_0x8ad4e4[_0xc0b8('0x2b')]=_[_0xc0b8('0x2c')](_0x12500e['query']);_0x8ad4e4['filters']=_[_0xc0b8('0x2d')](_0x8ad4e4[_0xc0b8('0x2e')],_0x8ad4e4[_0xc0b8('0x2b')]);_0x35eb41[_0xc0b8('0x2f')]=_[_0xc0b8('0x2d')](_0x8ad4e4[_0xc0b8('0x2e')],qs['fields'](_0x12500e[_0xc0b8('0x2b')][_0xc0b8('0x30')]));_0x35eb41[_0xc0b8('0x2f')]=_0x35eb41['attributes'][_0xc0b8('0x31')]?_0x35eb41[_0xc0b8('0x2f')]:_0x8ad4e4[_0xc0b8('0x2e')];if(!_0x12500e[_0xc0b8('0x2b')][_0xc0b8('0x32')](_0xc0b8('0x33'))){_0x35eb41['limit']=qs[_0xc0b8('0x1c')](_0x12500e[_0xc0b8('0x2b')][_0xc0b8('0x1c')]);_0x35eb41[_0xc0b8('0x1a')]=qs[_0xc0b8('0x1a')](_0x12500e[_0xc0b8('0x2b')]['offset']);}_0x35eb41[_0xc0b8('0x34')]=qs[_0xc0b8('0x35')](_0x12500e[_0xc0b8('0x2b')][_0xc0b8('0x35')]);_0x35eb41[_0xc0b8('0x36')]=qs[_0xc0b8('0x37')](_[_0xc0b8('0x38')](_0x12500e[_0xc0b8('0x2b')],_0x8ad4e4[_0xc0b8('0x37')]),_0x475b74);if(_0x12500e['query'][_0xc0b8('0x39')]){_0x35eb41[_0xc0b8('0x36')]=_['merge'](_0x35eb41[_0xc0b8('0x36')],{'$or':_[_0xc0b8('0x3a')](_0x475b74,function(_0x2b87a2){if(_0x2b87a2[_0xc0b8('0x29')]!=='VIRTUAL'){var _0x18537a={};_0x18537a[_0x2b87a2['name']]={'$like':'%'+_0x12500e[_0xc0b8('0x2b')][_0xc0b8('0x39')]+'%'};return _0x18537a;}})});}_0x35eb41=_[_0xc0b8('0x3b')]({},_0x35eb41,_0x12500e['options']);var _0x552776={'where':_0x35eb41['where']};return db[_0xc0b8('0x3c')][_0xc0b8('0x3d')](_0x552776)['then'](function(_0x51118e){_0x131e59['count']=_0x51118e;if(_0x12500e[_0xc0b8('0x2b')][_0xc0b8('0x3e')]){_0x35eb41[_0xc0b8('0x3f')]=[{'all':!![]}];}return db[_0xc0b8('0x3c')]['findAll'](_0x35eb41);})[_0xc0b8('0x22')](function(_0x538eb8){_0x131e59[_0xc0b8('0x40')]=_0x538eb8;return _0x131e59;})[_0xc0b8('0x22')](respondWithFilteredResult(_0x30969a,_0x35eb41))[_0xc0b8('0x41')](handleError(_0x30969a,null));};exports['show']=function(_0x266c9b,_0xe0c1b8){var _0x5ce502={'raw':![],'where':{'id':_0x266c9b[_0xc0b8('0x42')]['id']}},_0x2b4875={};_0x2b4875['model']=_[_0xc0b8('0x2c')](db[_0xc0b8('0x3c')]['rawAttributes']);_0x2b4875[_0xc0b8('0x2b')]=_['keys'](_0x266c9b[_0xc0b8('0x2b')]);_0x2b4875[_0xc0b8('0x37')]=_[_0xc0b8('0x2d')](_0x2b4875[_0xc0b8('0x2e')],_0x2b4875['query']);_0x5ce502['attributes']=_['intersection'](_0x2b4875[_0xc0b8('0x2e')],qs[_0xc0b8('0x30')](_0x266c9b[_0xc0b8('0x2b')][_0xc0b8('0x30')]));_0x5ce502['attributes']=_0x5ce502['attributes'][_0xc0b8('0x31')]?_0x5ce502[_0xc0b8('0x2f')]:_0x2b4875[_0xc0b8('0x2e')];if(_0x266c9b['query'][_0xc0b8('0x3e')]){_0x5ce502[_0xc0b8('0x3f')]=[{'all':!![]}];}_0x5ce502=_[_0xc0b8('0x3b')]({},_0x5ce502,_0x266c9b[_0xc0b8('0x43')]);return db['ServicenowConfiguration']['find'](_0x5ce502)[_0xc0b8('0x22')](handleEntityNotFound(_0xe0c1b8,null))[_0xc0b8('0x22')](respondWithResult(_0xe0c1b8,null))[_0xc0b8('0x41')](handleError(_0xe0c1b8,null));};exports[_0xc0b8('0x44')]=function(_0xe29d4b,_0x50dbfe){return db[_0xc0b8('0x3c')][_0xc0b8('0x44')](_0xe29d4b[_0xc0b8('0x45')],{})[_0xc0b8('0x22')](respondWithResult(_0x50dbfe,0xc9))[_0xc0b8('0x41')](handleError(_0x50dbfe,null));};exports[_0xc0b8('0x21')]=function(_0x4614bd,_0x60eddb){if(_0x4614bd[_0xc0b8('0x45')]['id']){delete _0x4614bd[_0xc0b8('0x45')]['id'];}return db[_0xc0b8('0x3c')][_0xc0b8('0x46')]({'where':{'id':_0x4614bd[_0xc0b8('0x42')]['id']}})[_0xc0b8('0x22')](handleEntityNotFound(_0x60eddb,null))[_0xc0b8('0x22')](saveUpdates(_0x4614bd[_0xc0b8('0x45')],null))[_0xc0b8('0x22')](respondWithResult(_0x60eddb,null))[_0xc0b8('0x41')](handleError(_0x60eddb,null));};exports[_0xc0b8('0x23')]=function(_0xcc0182,_0x2715de){return db[_0xc0b8('0x3c')][_0xc0b8('0x46')]({'where':{'id':_0xcc0182[_0xc0b8('0x42')]['id']}})[_0xc0b8('0x22')](handleEntityNotFound(_0x2715de,null))[_0xc0b8('0x22')](removeEntity(_0x2715de,null))['catch'](handleError(_0x2715de,null));};exports[_0xc0b8('0x47')]=function(_0x1cb78d,_0x226865,_0xe3784c){var _0x44996e={};var _0x41380e={};var _0x4bed08;var _0x1648fb;return db[_0xc0b8('0x3c')]['findOne']({'where':{'id':_0x1cb78d[_0xc0b8('0x42')]['id']}})['then'](handleEntityNotFound(_0x226865,null))[_0xc0b8('0x22')](function(_0x3387bb){if(_0x3387bb){_0x4bed08=_0x3387bb;_0x41380e[_0xc0b8('0x2e')]=_[_0xc0b8('0x2c')](db[_0xc0b8('0x48')]['rawAttributes']);_0x41380e[_0xc0b8('0x2b')]=_[_0xc0b8('0x2c')](_0x1cb78d[_0xc0b8('0x2b')]);_0x41380e[_0xc0b8('0x37')]=_['intersection'](_0x41380e[_0xc0b8('0x2e')],_0x41380e[_0xc0b8('0x2b')]);_0x44996e[_0xc0b8('0x2f')]=_[_0xc0b8('0x2d')](_0x41380e[_0xc0b8('0x2e')],qs[_0xc0b8('0x30')](_0x1cb78d[_0xc0b8('0x2b')][_0xc0b8('0x30')]));_0x44996e[_0xc0b8('0x2f')]=_0x44996e[_0xc0b8('0x2f')][_0xc0b8('0x31')]?_0x44996e['attributes']:_0x41380e[_0xc0b8('0x2e')];_0x44996e[_0xc0b8('0x34')]=qs[_0xc0b8('0x35')](_0x1cb78d['query'][_0xc0b8('0x35')]);_0x44996e[_0xc0b8('0x36')]=qs[_0xc0b8('0x37')](_[_0xc0b8('0x38')](_0x1cb78d[_0xc0b8('0x2b')],_0x41380e[_0xc0b8('0x37')]));if(_0x1cb78d[_0xc0b8('0x2b')][_0xc0b8('0x39')]){_0x44996e['where']=_[_0xc0b8('0x3b')](_0x44996e[_0xc0b8('0x36')],{'$or':_['map'](_0x44996e['attributes'],function(_0x25ff9d){var _0x572ea5={};_0x572ea5[_0x25ff9d]={'$like':'%'+_0x1cb78d[_0xc0b8('0x2b')]['filter']+'%'};return _0x572ea5;})});}_0x44996e=_[_0xc0b8('0x3b')]({},_0x44996e,_0x1cb78d[_0xc0b8('0x43')]);return _0x4bed08[_0xc0b8('0x47')](_0x44996e);}})[_0xc0b8('0x22')](function(_0x513823){if(_0x513823){_0x1648fb=_0x513823['length'];if(!_0x1cb78d[_0xc0b8('0x2b')][_0xc0b8('0x32')](_0xc0b8('0x33'))){_0x44996e[_0xc0b8('0x1c')]=qs[_0xc0b8('0x1c')](_0x1cb78d[_0xc0b8('0x2b')][_0xc0b8('0x1c')]);_0x44996e[_0xc0b8('0x1a')]=qs[_0xc0b8('0x1a')](_0x1cb78d[_0xc0b8('0x2b')]['offset']);}return _0x4bed08[_0xc0b8('0x47')](_0x44996e);}})[_0xc0b8('0x22')](function(_0x284aaa){if(_0x284aaa){return _0x284aaa?{'count':_0x1648fb,'rows':_0x284aaa}:null;}})[_0xc0b8('0x22')](respondWithResult(_0x226865,null))[_0xc0b8('0x41')](handleError(_0x226865,null));};exports['getSubjects']=function(_0x457a4c,_0x20a467,_0x2d2ec6){var _0x415561={};var _0x1433c4={};var _0xa97907;var _0x277941;return db[_0xc0b8('0x3c')][_0xc0b8('0x49')]({'where':{'id':_0x457a4c['params']['id']}})[_0xc0b8('0x22')](handleEntityNotFound(_0x20a467,null))[_0xc0b8('0x22')](function(_0x4f93af){if(_0x4f93af){_0xa97907=_0x4f93af;_0x1433c4[_0xc0b8('0x2e')]=_[_0xc0b8('0x2c')](db[_0xc0b8('0x48')][_0xc0b8('0x4a')]);_0x1433c4['query']=_[_0xc0b8('0x2c')](_0x457a4c[_0xc0b8('0x2b')]);_0x1433c4[_0xc0b8('0x37')]=_['intersection'](_0x1433c4[_0xc0b8('0x2e')],_0x1433c4[_0xc0b8('0x2b')]);_0x415561[_0xc0b8('0x2f')]=_[_0xc0b8('0x2d')](_0x1433c4['model'],qs['fields'](_0x457a4c[_0xc0b8('0x2b')][_0xc0b8('0x30')]));_0x415561[_0xc0b8('0x2f')]=_0x415561[_0xc0b8('0x2f')][_0xc0b8('0x31')]?_0x415561[_0xc0b8('0x2f')]:_0x1433c4[_0xc0b8('0x2e')];_0x415561[_0xc0b8('0x34')]=qs[_0xc0b8('0x35')](_0x457a4c['query'][_0xc0b8('0x35')]);_0x415561['where']=qs[_0xc0b8('0x37')](_[_0xc0b8('0x38')](_0x457a4c[_0xc0b8('0x2b')],_0x1433c4[_0xc0b8('0x37')]));if(_0x457a4c['query'][_0xc0b8('0x39')]){_0x415561[_0xc0b8('0x36')]=_[_0xc0b8('0x3b')](_0x415561[_0xc0b8('0x36')],{'$or':_[_0xc0b8('0x3a')](_0x415561[_0xc0b8('0x2f')],function(_0x5681d5){var _0x5d6366={};_0x5d6366[_0x5681d5]={'$like':'%'+_0x457a4c[_0xc0b8('0x2b')]['filter']+'%'};return _0x5d6366;})});}_0x415561=_[_0xc0b8('0x3b')]({},_0x415561,_0x457a4c[_0xc0b8('0x43')]);return _0xa97907[_0xc0b8('0x4b')](_0x415561);}})['then'](function(_0x52b181){if(_0x52b181){_0x277941=_0x52b181[_0xc0b8('0x31')];if(!_0x457a4c[_0xc0b8('0x2b')][_0xc0b8('0x32')](_0xc0b8('0x33'))){_0x415561[_0xc0b8('0x1c')]=qs[_0xc0b8('0x1c')](_0x457a4c[_0xc0b8('0x2b')][_0xc0b8('0x1c')]);_0x415561[_0xc0b8('0x1a')]=qs[_0xc0b8('0x1a')](_0x457a4c['query'][_0xc0b8('0x1a')]);}return _0xa97907[_0xc0b8('0x4b')](_0x415561);}})[_0xc0b8('0x22')](function(_0x1664d3){if(_0x1664d3){return _0x1664d3?{'count':_0x277941,'rows':_0x1664d3}:null;}})['then'](respondWithResult(_0x20a467,null))[_0xc0b8('0x41')](handleError(_0x20a467,null));};exports[_0xc0b8('0x4c')]=function(_0x51b39a,_0x4c1a7e,_0x36c655){var _0x3f4210={};var _0x2e4c01={};var _0x531d1b;var _0x56fa51;return db[_0xc0b8('0x3c')][_0xc0b8('0x49')]({'where':{'id':_0x51b39a[_0xc0b8('0x42')]['id']}})[_0xc0b8('0x22')](handleEntityNotFound(_0x4c1a7e,null))[_0xc0b8('0x22')](function(_0x567bb4){if(_0x567bb4){_0x531d1b=_0x567bb4;_0x2e4c01['model']=_[_0xc0b8('0x2c')](db[_0xc0b8('0x48')]['rawAttributes']);_0x2e4c01[_0xc0b8('0x2b')]=_[_0xc0b8('0x2c')](_0x51b39a[_0xc0b8('0x2b')]);_0x2e4c01[_0xc0b8('0x37')]=_[_0xc0b8('0x2d')](_0x2e4c01[_0xc0b8('0x2e')],_0x2e4c01[_0xc0b8('0x2b')]);_0x3f4210[_0xc0b8('0x2f')]=_[_0xc0b8('0x2d')](_0x2e4c01['model'],qs['fields'](_0x51b39a[_0xc0b8('0x2b')][_0xc0b8('0x30')]));_0x3f4210[_0xc0b8('0x2f')]=_0x3f4210[_0xc0b8('0x2f')][_0xc0b8('0x31')]?_0x3f4210['attributes']:_0x2e4c01[_0xc0b8('0x2e')];_0x3f4210[_0xc0b8('0x34')]=qs[_0xc0b8('0x35')](_0x51b39a[_0xc0b8('0x2b')][_0xc0b8('0x35')]);_0x3f4210[_0xc0b8('0x36')]=qs['filters'](_['pick'](_0x51b39a['query'],_0x2e4c01[_0xc0b8('0x37')]));if(_0x51b39a[_0xc0b8('0x2b')][_0xc0b8('0x39')]){_0x3f4210[_0xc0b8('0x36')]=_[_0xc0b8('0x3b')](_0x3f4210[_0xc0b8('0x36')],{'$or':_['map'](_0x3f4210[_0xc0b8('0x2f')],function(_0x5e3d72){var _0x3cf6fb={};_0x3cf6fb[_0x5e3d72]={'$like':'%'+_0x51b39a[_0xc0b8('0x2b')]['filter']+'%'};return _0x3cf6fb;})});}_0x3f4210=_[_0xc0b8('0x3b')]({},_0x3f4210,_0x51b39a['options']);return _0x531d1b['getDescriptions'](_0x3f4210);}})['then'](function(_0x8baebe){if(_0x8baebe){_0x56fa51=_0x8baebe['length'];if(!_0x51b39a[_0xc0b8('0x2b')]['hasOwnProperty'](_0xc0b8('0x33'))){_0x3f4210[_0xc0b8('0x1c')]=qs['limit'](_0x51b39a[_0xc0b8('0x2b')][_0xc0b8('0x1c')]);_0x3f4210[_0xc0b8('0x1a')]=qs['offset'](_0x51b39a[_0xc0b8('0x2b')][_0xc0b8('0x1a')]);}return _0x531d1b[_0xc0b8('0x4c')](_0x3f4210);}})[_0xc0b8('0x22')](function(_0x58a856){if(_0x58a856){return _0x58a856?{'count':_0x56fa51,'rows':_0x58a856}:null;}})[_0xc0b8('0x22')](respondWithResult(_0x4c1a7e,null))[_0xc0b8('0x41')](handleError(_0x4c1a7e,null));}; \ No newline at end of file +var _0x45b6=['end','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','find','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','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','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x45b6,0xd0));var _0x645b=function(_0x39277f,_0x460842){_0x39277f=_0x39277f-0x0;var _0xfcf21e=_0x45b6[_0x39277f];return _0xfcf21e;};'use strict';var emlformat=require(_0x645b('0x0'));var rimraf=require(_0x645b('0x1'));var zipdir=require(_0x645b('0x2'));var jsonpatch=require(_0x645b('0x3'));var rp=require(_0x645b('0x4'));var moment=require('moment');var BPromise=require(_0x645b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x645b('0x6'));var sox=require(_0x645b('0x7'));var csv=require(_0x645b('0x8'));var ejs=require(_0x645b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x645b('0xa'));var jsforce=require(_0x645b('0xb'));var deskjs=require(_0x645b('0xc'));var toCsv=require(_0x645b('0x8'));var querystring=require(_0x645b('0xd'));var Papa=require('papaparse');var Redis=require(_0x645b('0xe'));var authService=require(_0x645b('0xf'));var qs=require(_0x645b('0x10'));var as=require(_0x645b('0x11'));var hardwareService=require(_0x645b('0x12'));var logger=require(_0x645b('0x13'))(_0x645b('0x14'));var utils=require(_0x645b('0x15'));var config=require(_0x645b('0x16'));var licenseUtil=require(_0x645b('0x17'));var db=require(_0x645b('0x18'))['db'];function respondWithStatusCode(_0x475b55,_0x3e23ac){_0x3e23ac=_0x3e23ac||0xcc;return function(_0x138c67){if(_0x138c67){return _0x475b55[_0x645b('0x19')](_0x3e23ac);}return _0x475b55[_0x645b('0x1a')](_0x3e23ac)['end']();};}function respondWithResult(_0xe0c1fd,_0x2bee47){_0x2bee47=_0x2bee47||0xc8;return function(_0x102656){if(_0x102656){return _0xe0c1fd[_0x645b('0x1a')](_0x2bee47)[_0x645b('0x1b')](_0x102656);}};}function respondWithFilteredResult(_0x5aa2f1,_0x2109d7){return function(_0x35a86f){if(_0x35a86f){var _0x385cfd=typeof _0x2109d7['offset']===_0x645b('0x1c')&&typeof _0x2109d7[_0x645b('0x1d')]===_0x645b('0x1c');var _0x3065bc=_0x35a86f[_0x645b('0x1e')];var _0x58331d=_0x385cfd?0x0:_0x2109d7[_0x645b('0x1f')];var _0x5850ea=_0x385cfd?_0x35a86f[_0x645b('0x1e')]:_0x2109d7[_0x645b('0x1f')]+_0x2109d7[_0x645b('0x1d')];var _0x5763fc;if(_0x5850ea>=_0x3065bc){_0x5850ea=_0x3065bc;_0x5763fc=0xc8;}else{_0x5763fc=0xce;}_0x5aa2f1[_0x645b('0x1a')](_0x5763fc);return _0x5aa2f1[_0x645b('0x20')](_0x645b('0x21'),_0x58331d+'-'+_0x5850ea+'/'+_0x3065bc)['json'](_0x35a86f);}return null;};}function patchUpdates(_0x46e7d8){return function(_0x2219ab){try{jsonpatch['apply'](_0x2219ab,_0x46e7d8,!![]);}catch(_0xb2af85){return BPromise[_0x645b('0x22')](_0xb2af85);}return _0x2219ab['save']();};}function saveUpdates(_0x3bd92a,_0x542a91){return function(_0x3e5589){if(_0x3e5589){return _0x3e5589[_0x645b('0x23')](_0x3bd92a)[_0x645b('0x24')](function(_0x25c0e3){return _0x25c0e3;});}return null;};}function removeEntity(_0x129767,_0x12e376){return function(_0x2828d5){if(_0x2828d5){return _0x2828d5[_0x645b('0x25')]()[_0x645b('0x24')](function(){_0x129767[_0x645b('0x1a')](0xcc)[_0x645b('0x26')]();});}};}function handleEntityNotFound(_0x5f41fb,_0x8d609d){return function(_0x2f5387){if(!_0x2f5387){_0x5f41fb[_0x645b('0x19')](0x194);}return _0x2f5387;};}function handleError(_0x38b095,_0x75346c){_0x75346c=_0x75346c||0x1f4;return function(_0x202827){logger[_0x645b('0x27')](_0x202827[_0x645b('0x28')]);if(_0x202827[_0x645b('0x29')]){delete _0x202827[_0x645b('0x29')];}_0x38b095['status'](_0x75346c)[_0x645b('0x2a')](_0x202827);};}exports[_0x645b('0x2b')]=function(_0x3f69d6,_0x404f0c){var _0x3bd0d5={},_0x36bda5={},_0x21069d={'count':0x0,'rows':[]};var _0x48072b=_[_0x645b('0x2c')](db[_0x645b('0x2d')][_0x645b('0x2e')],function(_0x49c490){return{'name':_0x49c490[_0x645b('0x2f')],'type':_0x49c490['type'][_0x645b('0x30')]};});_0x36bda5[_0x645b('0x31')]=_[_0x645b('0x2c')](_0x48072b,_0x645b('0x29'));_0x36bda5[_0x645b('0x32')]=_['keys'](_0x3f69d6['query']);_0x36bda5[_0x645b('0x33')]=_[_0x645b('0x34')](_0x36bda5['model'],_0x36bda5[_0x645b('0x32')]);_0x3bd0d5[_0x645b('0x35')]=_[_0x645b('0x34')](_0x36bda5[_0x645b('0x31')],qs[_0x645b('0x36')](_0x3f69d6[_0x645b('0x32')][_0x645b('0x36')]));_0x3bd0d5[_0x645b('0x35')]=_0x3bd0d5[_0x645b('0x35')][_0x645b('0x37')]?_0x3bd0d5[_0x645b('0x35')]:_0x36bda5['model'];if(!_0x3f69d6[_0x645b('0x32')][_0x645b('0x38')](_0x645b('0x39'))){_0x3bd0d5[_0x645b('0x1d')]=qs[_0x645b('0x1d')](_0x3f69d6[_0x645b('0x32')][_0x645b('0x1d')]);_0x3bd0d5[_0x645b('0x1f')]=qs['offset'](_0x3f69d6['query'][_0x645b('0x1f')]);}_0x3bd0d5[_0x645b('0x3a')]=qs[_0x645b('0x3b')](_0x3f69d6[_0x645b('0x32')][_0x645b('0x3b')]);_0x3bd0d5[_0x645b('0x3c')]=qs[_0x645b('0x33')](_[_0x645b('0x3d')](_0x3f69d6[_0x645b('0x32')],_0x36bda5[_0x645b('0x33')]),_0x48072b);if(_0x3f69d6[_0x645b('0x32')]['filter']){_0x3bd0d5[_0x645b('0x3c')]=_['merge'](_0x3bd0d5[_0x645b('0x3c')],{'$or':_[_0x645b('0x2c')](_0x48072b,function(_0x3c9886){if(_0x3c9886['type']!==_0x645b('0x3e')){var _0x59cd93={};_0x59cd93[_0x3c9886['name']]={'$like':'%'+_0x3f69d6[_0x645b('0x32')][_0x645b('0x3f')]+'%'};return _0x59cd93;}})});}_0x3bd0d5=_[_0x645b('0x40')]({},_0x3bd0d5,_0x3f69d6['options']);var _0x2c60a9={'where':_0x3bd0d5[_0x645b('0x3c')]};return db[_0x645b('0x2d')][_0x645b('0x1e')](_0x2c60a9)[_0x645b('0x24')](function(_0x181de1){_0x21069d[_0x645b('0x1e')]=_0x181de1;if(_0x3f69d6[_0x645b('0x32')][_0x645b('0x41')]){_0x3bd0d5[_0x645b('0x42')]=[{'all':!![]}];}return db[_0x645b('0x2d')][_0x645b('0x43')](_0x3bd0d5);})['then'](function(_0x2cb56e){_0x21069d[_0x645b('0x44')]=_0x2cb56e;return _0x21069d;})[_0x645b('0x24')](respondWithFilteredResult(_0x404f0c,_0x3bd0d5))[_0x645b('0x45')](handleError(_0x404f0c,null));};exports[_0x645b('0x46')]=function(_0x4803eb,_0x53a1bc){var _0x58f22={'raw':![],'where':{'id':_0x4803eb[_0x645b('0x47')]['id']}},_0xeadd89={};_0xeadd89[_0x645b('0x31')]=_[_0x645b('0x48')](db[_0x645b('0x2d')][_0x645b('0x2e')]);_0xeadd89['query']=_[_0x645b('0x48')](_0x4803eb[_0x645b('0x32')]);_0xeadd89[_0x645b('0x33')]=_[_0x645b('0x34')](_0xeadd89['model'],_0xeadd89[_0x645b('0x32')]);_0x58f22[_0x645b('0x35')]=_[_0x645b('0x34')](_0xeadd89['model'],qs['fields'](_0x4803eb[_0x645b('0x32')][_0x645b('0x36')]));_0x58f22[_0x645b('0x35')]=_0x58f22['attributes']['length']?_0x58f22[_0x645b('0x35')]:_0xeadd89[_0x645b('0x31')];if(_0x4803eb[_0x645b('0x32')][_0x645b('0x41')]){_0x58f22[_0x645b('0x42')]=[{'all':!![]}];}_0x58f22=_[_0x645b('0x40')]({},_0x58f22,_0x4803eb[_0x645b('0x49')]);return db[_0x645b('0x2d')]['find'](_0x58f22)[_0x645b('0x24')](handleEntityNotFound(_0x53a1bc,null))[_0x645b('0x24')](respondWithResult(_0x53a1bc,null))[_0x645b('0x45')](handleError(_0x53a1bc,null));};exports['create']=function(_0x45cef4,_0x599b28){return db[_0x645b('0x2d')][_0x645b('0x4a')](_0x45cef4[_0x645b('0x4b')],{})[_0x645b('0x24')](respondWithResult(_0x599b28,0xc9))[_0x645b('0x45')](handleError(_0x599b28,null));};exports[_0x645b('0x23')]=function(_0x45880f,_0x230da9){if(_0x45880f[_0x645b('0x4b')]['id']){delete _0x45880f[_0x645b('0x4b')]['id'];}return db[_0x645b('0x2d')][_0x645b('0x4c')]({'where':{'id':_0x45880f[_0x645b('0x47')]['id']}})[_0x645b('0x24')](handleEntityNotFound(_0x230da9,null))[_0x645b('0x24')](saveUpdates(_0x45880f[_0x645b('0x4b')],null))[_0x645b('0x24')](respondWithResult(_0x230da9,null))[_0x645b('0x45')](handleError(_0x230da9,null));};exports['destroy']=function(_0x21265c,_0xdafc43){return db['ServicenowConfiguration']['find']({'where':{'id':_0x21265c['params']['id']}})[_0x645b('0x24')](handleEntityNotFound(_0xdafc43,null))[_0x645b('0x24')](removeEntity(_0xdafc43,null))[_0x645b('0x45')](handleError(_0xdafc43,null));};exports[_0x645b('0x4d')]=function(_0x1388d2,_0x529710,_0x92f902){var _0x3fb338={};var _0x370fa3={};var _0x550a8e;var _0x44e1c4;return db['ServicenowConfiguration'][_0x645b('0x4e')]({'where':{'id':_0x1388d2[_0x645b('0x47')]['id']}})[_0x645b('0x24')](handleEntityNotFound(_0x529710,null))[_0x645b('0x24')](function(_0x21463d){if(_0x21463d){_0x550a8e=_0x21463d;_0x370fa3[_0x645b('0x31')]=_[_0x645b('0x48')](db[_0x645b('0x4f')][_0x645b('0x2e')]);_0x370fa3['query']=_['keys'](_0x1388d2['query']);_0x370fa3[_0x645b('0x33')]=_[_0x645b('0x34')](_0x370fa3['model'],_0x370fa3[_0x645b('0x32')]);_0x3fb338[_0x645b('0x35')]=_[_0x645b('0x34')](_0x370fa3['model'],qs['fields'](_0x1388d2[_0x645b('0x32')][_0x645b('0x36')]));_0x3fb338[_0x645b('0x35')]=_0x3fb338[_0x645b('0x35')]['length']?_0x3fb338[_0x645b('0x35')]:_0x370fa3[_0x645b('0x31')];_0x3fb338[_0x645b('0x3a')]=qs[_0x645b('0x3b')](_0x1388d2[_0x645b('0x32')][_0x645b('0x3b')]);_0x3fb338[_0x645b('0x3c')]=qs[_0x645b('0x33')](_['pick'](_0x1388d2['query'],_0x370fa3[_0x645b('0x33')]));if(_0x1388d2['query']['filter']){_0x3fb338['where']=_[_0x645b('0x40')](_0x3fb338['where'],{'$or':_[_0x645b('0x2c')](_0x3fb338[_0x645b('0x35')],function(_0x56ba16){var _0x335d10={};_0x335d10[_0x56ba16]={'$like':'%'+_0x1388d2[_0x645b('0x32')][_0x645b('0x3f')]+'%'};return _0x335d10;})});}_0x3fb338=_['merge']({},_0x3fb338,_0x1388d2['options']);return _0x550a8e[_0x645b('0x4d')](_0x3fb338);}})['then'](function(_0x182a8d){if(_0x182a8d){_0x44e1c4=_0x182a8d[_0x645b('0x37')];if(!_0x1388d2['query'][_0x645b('0x38')]('nolimit')){_0x3fb338[_0x645b('0x1d')]=qs[_0x645b('0x1d')](_0x1388d2[_0x645b('0x32')][_0x645b('0x1d')]);_0x3fb338['offset']=qs[_0x645b('0x1f')](_0x1388d2[_0x645b('0x32')][_0x645b('0x1f')]);}return _0x550a8e[_0x645b('0x4d')](_0x3fb338);}})[_0x645b('0x24')](function(_0x13d564){if(_0x13d564){return _0x13d564?{'count':_0x44e1c4,'rows':_0x13d564}:null;}})['then'](respondWithResult(_0x529710,null))[_0x645b('0x45')](handleError(_0x529710,null));};exports[_0x645b('0x50')]=function(_0x1e5a20,_0x76a279,_0x12f858){var _0x23d24e={};var _0x1a9b12={};var _0x216bb7;var _0x23807b;return db[_0x645b('0x2d')][_0x645b('0x4e')]({'where':{'id':_0x1e5a20[_0x645b('0x47')]['id']}})[_0x645b('0x24')](handleEntityNotFound(_0x76a279,null))[_0x645b('0x24')](function(_0x5498ab){if(_0x5498ab){_0x216bb7=_0x5498ab;_0x1a9b12[_0x645b('0x31')]=_[_0x645b('0x48')](db[_0x645b('0x4f')]['rawAttributes']);_0x1a9b12[_0x645b('0x32')]=_['keys'](_0x1e5a20[_0x645b('0x32')]);_0x1a9b12[_0x645b('0x33')]=_[_0x645b('0x34')](_0x1a9b12['model'],_0x1a9b12[_0x645b('0x32')]);_0x23d24e[_0x645b('0x35')]=_['intersection'](_0x1a9b12['model'],qs[_0x645b('0x36')](_0x1e5a20[_0x645b('0x32')][_0x645b('0x36')]));_0x23d24e[_0x645b('0x35')]=_0x23d24e[_0x645b('0x35')][_0x645b('0x37')]?_0x23d24e[_0x645b('0x35')]:_0x1a9b12[_0x645b('0x31')];_0x23d24e['order']=qs['sort'](_0x1e5a20[_0x645b('0x32')][_0x645b('0x3b')]);_0x23d24e[_0x645b('0x3c')]=qs[_0x645b('0x33')](_[_0x645b('0x3d')](_0x1e5a20[_0x645b('0x32')],_0x1a9b12['filters']));if(_0x1e5a20[_0x645b('0x32')][_0x645b('0x3f')]){_0x23d24e['where']=_[_0x645b('0x40')](_0x23d24e[_0x645b('0x3c')],{'$or':_[_0x645b('0x2c')](_0x23d24e['attributes'],function(_0x1f47f4){var _0x4e7076={};_0x4e7076[_0x1f47f4]={'$like':'%'+_0x1e5a20[_0x645b('0x32')][_0x645b('0x3f')]+'%'};return _0x4e7076;})});}_0x23d24e=_['merge']({},_0x23d24e,_0x1e5a20[_0x645b('0x49')]);return _0x216bb7['getSubjects'](_0x23d24e);}})[_0x645b('0x24')](function(_0x17fc49){if(_0x17fc49){_0x23807b=_0x17fc49['length'];if(!_0x1e5a20[_0x645b('0x32')][_0x645b('0x38')](_0x645b('0x39'))){_0x23d24e['limit']=qs[_0x645b('0x1d')](_0x1e5a20[_0x645b('0x32')]['limit']);_0x23d24e[_0x645b('0x1f')]=qs['offset'](_0x1e5a20[_0x645b('0x32')]['offset']);}return _0x216bb7['getSubjects'](_0x23d24e);}})[_0x645b('0x24')](function(_0x26b5ba){if(_0x26b5ba){return _0x26b5ba?{'count':_0x23807b,'rows':_0x26b5ba}:null;}})[_0x645b('0x24')](respondWithResult(_0x76a279,null))[_0x645b('0x45')](handleError(_0x76a279,null));};exports['getDescriptions']=function(_0x1f89cf,_0x280747,_0x4ff78f){var _0x2abe68={};var _0x21ac2e={};var _0x4820bc;var _0x39da6e;return db[_0x645b('0x2d')][_0x645b('0x4e')]({'where':{'id':_0x1f89cf[_0x645b('0x47')]['id']}})['then'](handleEntityNotFound(_0x280747,null))[_0x645b('0x24')](function(_0x2d7443){if(_0x2d7443){_0x4820bc=_0x2d7443;_0x21ac2e['model']=_[_0x645b('0x48')](db['ServicenowField']['rawAttributes']);_0x21ac2e[_0x645b('0x32')]=_[_0x645b('0x48')](_0x1f89cf[_0x645b('0x32')]);_0x21ac2e['filters']=_[_0x645b('0x34')](_0x21ac2e['model'],_0x21ac2e['query']);_0x2abe68['attributes']=_[_0x645b('0x34')](_0x21ac2e[_0x645b('0x31')],qs[_0x645b('0x36')](_0x1f89cf[_0x645b('0x32')][_0x645b('0x36')]));_0x2abe68['attributes']=_0x2abe68[_0x645b('0x35')]['length']?_0x2abe68[_0x645b('0x35')]:_0x21ac2e['model'];_0x2abe68[_0x645b('0x3a')]=qs[_0x645b('0x3b')](_0x1f89cf[_0x645b('0x32')][_0x645b('0x3b')]);_0x2abe68['where']=qs[_0x645b('0x33')](_['pick'](_0x1f89cf['query'],_0x21ac2e[_0x645b('0x33')]));if(_0x1f89cf[_0x645b('0x32')][_0x645b('0x3f')]){_0x2abe68[_0x645b('0x3c')]=_[_0x645b('0x40')](_0x2abe68[_0x645b('0x3c')],{'$or':_[_0x645b('0x2c')](_0x2abe68[_0x645b('0x35')],function(_0x47fd77){var _0x37205e={};_0x37205e[_0x47fd77]={'$like':'%'+_0x1f89cf['query'][_0x645b('0x3f')]+'%'};return _0x37205e;})});}_0x2abe68=_['merge']({},_0x2abe68,_0x1f89cf[_0x645b('0x49')]);return _0x4820bc[_0x645b('0x51')](_0x2abe68);}})[_0x645b('0x24')](function(_0x2b6e5f){if(_0x2b6e5f){_0x39da6e=_0x2b6e5f['length'];if(!_0x1f89cf[_0x645b('0x32')][_0x645b('0x38')](_0x645b('0x39'))){_0x2abe68['limit']=qs[_0x645b('0x1d')](_0x1f89cf[_0x645b('0x32')][_0x645b('0x1d')]);_0x2abe68[_0x645b('0x1f')]=qs[_0x645b('0x1f')](_0x1f89cf[_0x645b('0x32')][_0x645b('0x1f')]);}return _0x4820bc[_0x645b('0x51')](_0x2abe68);}})['then'](function(_0x38b713){if(_0x38b713){return _0x38b713?{'count':_0x39da6e,'rows':_0x38b713}:null;}})[_0x645b('0x24')](respondWithResult(_0x280747,null))[_0x645b('0x45')](handleError(_0x280747,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 1fc36d6..93e8e8f 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 _0x4e65=['api','moment','bluebird','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','util','../../config/logger'];(function(_0x3774c7,_0x361f2b){var _0x1db61e=function(_0x442a9e){while(--_0x442a9e){_0x3774c7['push'](_0x3774c7['shift']());}};_0x1db61e(++_0x361f2b);}(_0x4e65,0xc4));var _0x54e6=function(_0x1c6023,_0x532a1e){_0x1c6023=_0x1c6023-0x0;var _0x7284f9=_0x4e65[_0x1c6023];return _0x7284f9;};'use strict';var _=require('lodash');var util=require(_0x54e6('0x0'));var logger=require(_0x54e6('0x1'))(_0x54e6('0x2'));var moment=require(_0x54e6('0x3'));var BPromise=require(_0x54e6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x54e6('0x5'));var config=require(_0x54e6('0x6'));var attributes=require(_0x54e6('0x7'));module[_0x54e6('0x8')]=function(_0x23b09a,_0x5d1ffc){return _0x23b09a[_0x54e6('0x9')]('ServicenowConfiguration',attributes,{'tableName':_0x54e6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39c4=['ServicenowConfiguration','int_servicenow_configurations','util','moment','bluebird','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define'];(function(_0x5d0b9c,_0x1d45a8){var _0x7ceeca=function(_0x5ba763){while(--_0x5ba763){_0x5d0b9c['push'](_0x5d0b9c['shift']());}};_0x7ceeca(++_0x1d45a8);}(_0x39c4,0x174));var _0x439c=function(_0x2f4667,_0xb7e42){_0x2f4667=_0x2f4667-0x0;var _0x41ef3e=_0x39c4[_0x2f4667];return _0x41ef3e;};'use strict';var _=require('lodash');var util=require(_0x439c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x439c('0x1'));var BPromise=require(_0x439c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x439c('0x3'));var config=require(_0x439c('0x4'));var attributes=require(_0x439c('0x5'));module[_0x439c('0x6')]=function(_0x105a46,_0x387467){return _0x105a46[_0x439c('0x7')](_0x439c('0x8'),attributes,{'tableName':_0x439c('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 9b0e02f..74d299c 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 _0xc259=['code','ServicenowConfiguration,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x15deed,_0x35001a){var _0x32c869=function(_0x548faa){while(--_0x548faa){_0x15deed['push'](_0x15deed['shift']());}};_0x32c869(++_0x35001a);}(_0xc259,0x193));var _0x9c25=function(_0x971b5b,_0x580c8c){_0x971b5b=_0x971b5b-0x0;var _0x3b09b1=_0xc259[_0x971b5b];return _0x3b09b1;};'use strict';var _=require(_0x9c25('0x0'));var util=require('util');var moment=require(_0x9c25('0x1'));var BPromise=require(_0x9c25('0x2'));var rs=require(_0x9c25('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c25('0x4'))['db'];var utils=require(_0x9c25('0x5'));var logger=require(_0x9c25('0x6'))(_0x9c25('0x7'));var config=require(_0x9c25('0x8'));var jayson=require(_0x9c25('0x9'));var client=jayson[_0x9c25('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f41eb,_0x35ad41,_0x115609){return new BPromise(function(_0x20a77c,_0xbb78fb){return client[_0x9c25('0xb')](_0x2f41eb,_0x115609)[_0x9c25('0xc')](function(_0x34e89e){logger[_0x9c25('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x35ad41,'request\x20sent');logger['debug'](_0x9c25('0xe'),_0x35ad41,_0x9c25('0xf'),JSON['stringify'](_0x34e89e));if(_0x34e89e['error']){if(_0x34e89e[_0x9c25('0x10')][_0x9c25('0x11')]===0x1f4){logger[_0x9c25('0x10')](_0x9c25('0x12'),_0x35ad41,_0x34e89e[_0x9c25('0x10')][_0x9c25('0x13')]);return _0xbb78fb(_0x34e89e[_0x9c25('0x10')][_0x9c25('0x13')]);}logger[_0x9c25('0x10')](_0x9c25('0x12'),_0x35ad41,_0x34e89e[_0x9c25('0x10')][_0x9c25('0x13')]);return _0x20a77c(_0x34e89e['error']['message']);}else{logger['info'](_0x9c25('0x12'),_0x35ad41,_0x9c25('0xf'));_0x20a77c(_0x34e89e[_0x9c25('0x14')][_0x9c25('0x13')]);}})['catch'](function(_0x4d4f3b){logger[_0x9c25('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x35ad41,_0x4d4f3b);_0xbb78fb(_0x4d4f3b);});});} \ No newline at end of file +var _0xc7dd=['ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info'];(function(_0xc1272c,_0x37d921){var _0x247520=function(_0x5223a0){while(--_0x5223a0){_0xc1272c['push'](_0xc1272c['shift']());}};_0x247520(++_0x37d921);}(_0xc7dd,0x15d));var _0xdc7d=function(_0x3774c7,_0x361f2b){_0x3774c7=_0x3774c7-0x0;var _0x1db61e=_0xc7dd[_0x3774c7];return _0x1db61e;};'use strict';var _=require(_0xdc7d('0x0'));var util=require(_0xdc7d('0x1'));var moment=require('moment');var BPromise=require(_0xdc7d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdc7d('0x3'))['db'];var utils=require(_0xdc7d('0x4'));var logger=require('../../config/logger')(_0xdc7d('0x5'));var config=require(_0xdc7d('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdc7d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x563446,_0x35c7f9,_0x2fecb4){return new BPromise(function(_0x213c25,_0x4acc5f){return client[_0xdc7d('0x8')](_0x563446,_0x2fecb4)[_0xdc7d('0x9')](function(_0x531c3e){logger[_0xdc7d('0xa')](_0xdc7d('0xb'),_0x35c7f9,'request\x20sent');logger[_0xdc7d('0xc')](_0xdc7d('0xd'),_0x35c7f9,'request\x20sent',JSON['stringify'](_0x531c3e));if(_0x531c3e[_0xdc7d('0xe')]){if(_0x531c3e[_0xdc7d('0xe')][_0xdc7d('0xf')]===0x1f4){logger[_0xdc7d('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x35c7f9,_0x531c3e[_0xdc7d('0xe')][_0xdc7d('0x10')]);return _0x4acc5f(_0x531c3e[_0xdc7d('0xe')][_0xdc7d('0x10')]);}logger[_0xdc7d('0xe')](_0xdc7d('0xb'),_0x35c7f9,_0x531c3e['error']['message']);return _0x213c25(_0x531c3e[_0xdc7d('0xe')][_0xdc7d('0x10')]);}else{logger[_0xdc7d('0xa')](_0xdc7d('0xb'),_0x35c7f9,_0xdc7d('0x11'));_0x213c25(_0x531c3e[_0xdc7d('0x12')][_0xdc7d('0x10')]);}})[_0xdc7d('0x13')](function(_0x9f8765){logger[_0xdc7d('0xe')](_0xdc7d('0xb'),_0x35c7f9,_0x9f8765);_0x4acc5f(_0x9f8765);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index f3fb645..55934d3 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 _0x6240=['isAuthenticated','/:id','show','post','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get'];(function(_0x4ec4c8,_0x4f1d10){var _0x4c46a8=function(_0x30d67b){while(--_0x30d67b){_0x4ec4c8['push'](_0x4ec4c8['shift']());}};_0x4c46a8(++_0x4f1d10);}(_0x6240,0x74));var _0x0624=function(_0x335435,_0x55bf27){_0x335435=_0x335435-0x0;var _0x4a8717=_0x6240[_0x335435];return _0x4a8717;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0624('0x0'));var timeout=require(_0x0624('0x1'));var express=require(_0x0624('0x2'));var router=express[_0x0624('0x3')]();var fs_extra=require(_0x0624('0x4'));var auth=require(_0x0624('0x5'));var interaction=require(_0x0624('0x6'));var config=require(_0x0624('0x7'));var controller=require(_0x0624('0x8'));router[_0x0624('0x9')]('/',auth[_0x0624('0xa')](),controller['index']);router['get'](_0x0624('0xb'),auth['isAuthenticated'](),controller[_0x0624('0xc')]);router[_0x0624('0xd')]('/',auth[_0x0624('0xa')](),controller['create']);router[_0x0624('0xe')](_0x0624('0xb'),auth[_0x0624('0xa')](),controller[_0x0624('0xf')]);router['delete'](_0x0624('0xb'),auth[_0x0624('0xa')](),controller[_0x0624('0x10')]);module[_0x0624('0x11')]=router; \ No newline at end of file +var _0xd831=['index','show','post','create','put','/:id','isAuthenticated','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller'];(function(_0x5d6455,_0x49bf23){var _0x4330af=function(_0x3136f3){while(--_0x3136f3){_0x5d6455['push'](_0x5d6455['shift']());}};_0x4330af(++_0x49bf23);}(_0xd831,0xd5));var _0x1d83=function(_0xd68a4,_0x5543f0){_0xd68a4=_0xd68a4-0x0;var _0x2f21b6=_0xd831[_0xd68a4];return _0x2f21b6;};'use strict';var multer=require(_0x1d83('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1d83('0x1'));var express=require(_0x1d83('0x2'));var router=express['Router']();var fs_extra=require(_0x1d83('0x3'));var auth=require(_0x1d83('0x4'));var interaction=require(_0x1d83('0x5'));var config=require(_0x1d83('0x6'));var controller=require(_0x1d83('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1d83('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1d83('0x9')]);router[_0x1d83('0xa')]('/',auth['isAuthenticated'](),controller[_0x1d83('0xb')]);router[_0x1d83('0xc')](_0x1d83('0xd'),auth[_0x1d83('0xe')](),controller['update']);router['delete']('/:id',auth[_0x1d83('0xe')](),controller[_0x1d83('0xf')]);module[_0x1d83('0x10')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 2ca8d9b..106a879 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 _0xe4a8=['BOOLEAN','sequelize','exports','ENUM','keyValue','picklist','string','STRING'];(function(_0x2bcc10,_0x53512b){var _0x1d7e2f=function(_0x44a7a6){while(--_0x44a7a6){_0x2bcc10['push'](_0x2bcc10['shift']());}};_0x1d7e2f(++_0x53512b);}(_0xe4a8,0x1d1));var _0x8e4a=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0xe4a8[_0x211fef];return _0x5447bf;};'use strict';var Sequelize=require(_0x8e4a('0x0'));module[_0x8e4a('0x1')]={'type':{'type':Sequelize[_0x8e4a('0x2')]('string','variable','customVariable',_0x8e4a('0x3'),_0x8e4a('0x4')),'defaultValue':_0x8e4a('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8e4a('0x6')]},'keyType':{'type':Sequelize[_0x8e4a('0x2')](_0x8e4a('0x5'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8e4a('0x6')]},'nameField':{'type':Sequelize[_0x8e4a('0x6')]},'customField':{'type':Sequelize[_0x8e4a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8e4a('0x6')]}}; \ No newline at end of file +var _0x1293=['string','STRING','ENUM','BOOLEAN','exports','variable','customVariable','keyValue','picklist'];(function(_0x1781de,_0x5c4b38){var _0x48d7fc=function(_0x7becb5){while(--_0x7becb5){_0x1781de['push'](_0x1781de['shift']());}};_0x48d7fc(++_0x5c4b38);}(_0x1293,0x1bd));var _0x3129=function(_0x37e4c5,_0x278256){_0x37e4c5=_0x37e4c5-0x0;var _0x2a93ea=_0x1293[_0x37e4c5];return _0x2a93ea;};'use strict';var Sequelize=require('sequelize');module[_0x3129('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0x3129('0x1'),_0x3129('0x2'),_0x3129('0x3'),_0x3129('0x4')),'defaultValue':_0x3129('0x5')},'content':{'type':Sequelize[_0x3129('0x6')]},'key':{'type':Sequelize[_0x3129('0x6')]},'keyType':{'type':Sequelize[_0x3129('0x7')](_0x3129('0x5'),_0x3129('0x1'),_0x3129('0x2'))},'keyContent':{'type':Sequelize[_0x3129('0x6')]},'idField':{'type':Sequelize[_0x3129('0x6')]},'nameField':{'type':Sequelize[_0x3129('0x6')]},'customField':{'type':Sequelize[_0x3129('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 7ebc190..12f5f2a 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 _0x0993=['rawAttributes','length','merge','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','status','end','error','stack','name','send','index','map','ServicenowField','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','options','includeAll','include','findAll','rows','then','catch','show','params'];(function(_0x4ae56a,_0x103522){var _0x3399ec=function(_0x54977f){while(--_0x54977f){_0x4ae56a['push'](_0x4ae56a['shift']());}};_0x3399ec(++_0x103522);}(_0x0993,0x9e));var _0x3099=function(_0x3a2beb,_0xe8de96){_0x3a2beb=_0x3a2beb-0x0;var _0x3d363e=_0x0993[_0x3a2beb];return _0x3d363e;};'use strict';var emlformat=require(_0x3099('0x0'));var rimraf=require(_0x3099('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3099('0x2'));var rp=require(_0x3099('0x3'));var moment=require(_0x3099('0x4'));var BPromise=require(_0x3099('0x5'));var Mustache=require(_0x3099('0x6'));var util=require('util');var path=require(_0x3099('0x7'));var sox=require(_0x3099('0x8'));var csv=require(_0x3099('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3099('0xa'));var squel=require(_0x3099('0xb'));var crypto=require(_0x3099('0xc'));var jsforce=require(_0x3099('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3099('0x9'));var querystring=require(_0x3099('0xe'));var Papa=require(_0x3099('0xf'));var Redis=require(_0x3099('0x10'));var authService=require(_0x3099('0x11'));var qs=require(_0x3099('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3099('0x13'));var logger=require(_0x3099('0x14'))('api');var utils=require(_0x3099('0x15'));var config=require(_0x3099('0x16'));var licenseUtil=require(_0x3099('0x17'));var db=require(_0x3099('0x18'))['db'];function respondWithStatusCode(_0x267d76,_0x3e9d4b){_0x3e9d4b=_0x3e9d4b||0xcc;return function(_0x1c5f9f){if(_0x1c5f9f){return _0x267d76[_0x3099('0x19')](_0x3e9d4b);}return _0x267d76['status'](_0x3e9d4b)['end']();};}function respondWithResult(_0x47970c,_0x5053a3){_0x5053a3=_0x5053a3||0xc8;return function(_0x3ca08b){if(_0x3ca08b){return _0x47970c['status'](_0x5053a3)[_0x3099('0x1a')](_0x3ca08b);}};}function respondWithFilteredResult(_0x52a3aa,_0x18f1c4){return function(_0x2d3a6a){if(_0x2d3a6a){var _0x48bb1d=typeof _0x18f1c4[_0x3099('0x1b')]===_0x3099('0x1c')&&typeof _0x18f1c4[_0x3099('0x1d')]===_0x3099('0x1c');var _0x2c8dd9=_0x2d3a6a[_0x3099('0x1e')];var _0x4f2758=_0x48bb1d?0x0:_0x18f1c4['offset'];var _0x2d690e=_0x48bb1d?_0x2d3a6a[_0x3099('0x1e')]:_0x18f1c4[_0x3099('0x1b')]+_0x18f1c4[_0x3099('0x1d')];var _0x1bb3a1;if(_0x2d690e>=_0x2c8dd9){_0x2d690e=_0x2c8dd9;_0x1bb3a1=0xc8;}else{_0x1bb3a1=0xce;}_0x52a3aa['status'](_0x1bb3a1);return _0x52a3aa['set'](_0x3099('0x1f'),_0x4f2758+'-'+_0x2d690e+'/'+_0x2c8dd9)[_0x3099('0x1a')](_0x2d3a6a);}return null;};}function patchUpdates(_0x502a64){return function(_0xc0d5f4){try{jsonpatch['apply'](_0xc0d5f4,_0x502a64,!![]);}catch(_0x32788b){return BPromise[_0x3099('0x20')](_0x32788b);}return _0xc0d5f4[_0x3099('0x21')]();};}function saveUpdates(_0x28ac14,_0x5ccf01){return function(_0x5193db){if(_0x5193db){return _0x5193db[_0x3099('0x22')](_0x28ac14)['then'](function(_0xc6149d){return _0xc6149d;});}return null;};}function removeEntity(_0x9d9924,_0x3f3394){return function(_0x43c863){if(_0x43c863){return _0x43c863[_0x3099('0x23')]()['then'](function(){_0x9d9924[_0x3099('0x24')](0xcc)[_0x3099('0x25')]();});}};}function handleEntityNotFound(_0x34d078,_0x384a98){return function(_0x1d5491){if(!_0x1d5491){_0x34d078['sendStatus'](0x194);}return _0x1d5491;};}function handleError(_0x1731fb,_0x77d3c7){_0x77d3c7=_0x77d3c7||0x1f4;return function(_0x2ae0b4){logger[_0x3099('0x26')](_0x2ae0b4[_0x3099('0x27')]);if(_0x2ae0b4[_0x3099('0x28')]){delete _0x2ae0b4[_0x3099('0x28')];}_0x1731fb['status'](_0x77d3c7)[_0x3099('0x29')](_0x2ae0b4);};}exports[_0x3099('0x2a')]=function(_0xadcfed,_0x3e4502){var _0x16b007={},_0x2e4761={},_0x41bc24={'count':0x0,'rows':[]};var _0x37ad7e=_[_0x3099('0x2b')](db[_0x3099('0x2c')]['rawAttributes'],function(_0x1cabd6){return{'name':_0x1cabd6['fieldName'],'type':_0x1cabd6[_0x3099('0x2d')][_0x3099('0x2e')]};});_0x2e4761[_0x3099('0x2f')]=_[_0x3099('0x2b')](_0x37ad7e,'name');_0x2e4761[_0x3099('0x30')]=_[_0x3099('0x31')](_0xadcfed[_0x3099('0x30')]);_0x2e4761[_0x3099('0x32')]=_[_0x3099('0x33')](_0x2e4761[_0x3099('0x2f')],_0x2e4761[_0x3099('0x30')]);_0x16b007[_0x3099('0x34')]=_[_0x3099('0x33')](_0x2e4761[_0x3099('0x2f')],qs['fields'](_0xadcfed[_0x3099('0x30')][_0x3099('0x35')]));_0x16b007[_0x3099('0x34')]=_0x16b007[_0x3099('0x34')]['length']?_0x16b007[_0x3099('0x34')]:_0x2e4761[_0x3099('0x2f')];if(!_0xadcfed['query'][_0x3099('0x36')](_0x3099('0x37'))){_0x16b007[_0x3099('0x1d')]=qs[_0x3099('0x1d')](_0xadcfed['query'][_0x3099('0x1d')]);_0x16b007['offset']=qs[_0x3099('0x1b')](_0xadcfed[_0x3099('0x30')][_0x3099('0x1b')]);}_0x16b007[_0x3099('0x38')]=qs[_0x3099('0x39')](_0xadcfed['query'][_0x3099('0x39')]);_0x16b007['where']=qs[_0x3099('0x32')](_[_0x3099('0x3a')](_0xadcfed[_0x3099('0x30')],_0x2e4761[_0x3099('0x32')]),_0x37ad7e);if(_0xadcfed['query']['filter']){_0x16b007[_0x3099('0x3b')]=_['merge'](_0x16b007[_0x3099('0x3b')],{'$or':_[_0x3099('0x2b')](_0x37ad7e,function(_0xcf18f3){if(_0xcf18f3[_0x3099('0x2d')]!==_0x3099('0x3c')){var _0x512dd5={};_0x512dd5[_0xcf18f3['name']]={'$like':'%'+_0xadcfed[_0x3099('0x30')]['filter']+'%'};return _0x512dd5;}})});}_0x16b007=_['merge']({},_0x16b007,_0xadcfed[_0x3099('0x3d')]);var _0x4f9cf8={'where':_0x16b007[_0x3099('0x3b')]};return db[_0x3099('0x2c')]['count'](_0x4f9cf8)['then'](function(_0x3f4d8e){_0x41bc24['count']=_0x3f4d8e;if(_0xadcfed[_0x3099('0x30')][_0x3099('0x3e')]){_0x16b007[_0x3099('0x3f')]=[{'all':!![]}];}return db[_0x3099('0x2c')][_0x3099('0x40')](_0x16b007);})['then'](function(_0x14d25f){_0x41bc24[_0x3099('0x41')]=_0x14d25f;return _0x41bc24;})[_0x3099('0x42')](respondWithFilteredResult(_0x3e4502,_0x16b007))[_0x3099('0x43')](handleError(_0x3e4502,null));};exports[_0x3099('0x44')]=function(_0x436200,_0x9bc36f){var _0x5c2811={'raw':!![],'where':{'id':_0x436200[_0x3099('0x45')]['id']}},_0x223d56={};_0x223d56[_0x3099('0x2f')]=_[_0x3099('0x31')](db['ServicenowField'][_0x3099('0x46')]);_0x223d56[_0x3099('0x30')]=_[_0x3099('0x31')](_0x436200[_0x3099('0x30')]);_0x223d56[_0x3099('0x32')]=_[_0x3099('0x33')](_0x223d56['model'],_0x223d56[_0x3099('0x30')]);_0x5c2811[_0x3099('0x34')]=_[_0x3099('0x33')](_0x223d56[_0x3099('0x2f')],qs[_0x3099('0x35')](_0x436200['query'][_0x3099('0x35')]));_0x5c2811[_0x3099('0x34')]=_0x5c2811[_0x3099('0x34')][_0x3099('0x47')]?_0x5c2811[_0x3099('0x34')]:_0x223d56[_0x3099('0x2f')];if(_0x436200[_0x3099('0x30')][_0x3099('0x3e')]){_0x5c2811['include']=[{'all':!![]}];}_0x5c2811=_[_0x3099('0x48')]({},_0x5c2811,_0x436200['options']);return db[_0x3099('0x2c')][_0x3099('0x49')](_0x5c2811)[_0x3099('0x42')](handleEntityNotFound(_0x9bc36f,null))[_0x3099('0x42')](respondWithResult(_0x9bc36f,null))[_0x3099('0x43')](handleError(_0x9bc36f,null));};exports[_0x3099('0x4a')]=function(_0x569c9b,_0x6d1777){return db['ServicenowField']['create'](_0x569c9b['body'],{})[_0x3099('0x42')](respondWithResult(_0x6d1777,0xc9))[_0x3099('0x43')](handleError(_0x6d1777,null));};exports[_0x3099('0x22')]=function(_0x1ec9ff,_0x1e65cf){if(_0x1ec9ff['body']['id']){delete _0x1ec9ff[_0x3099('0x4b')]['id'];}return db[_0x3099('0x2c')][_0x3099('0x49')]({'where':{'id':_0x1ec9ff[_0x3099('0x45')]['id']}})['then'](handleEntityNotFound(_0x1e65cf,null))[_0x3099('0x42')](saveUpdates(_0x1ec9ff[_0x3099('0x4b')],null))[_0x3099('0x42')](respondWithResult(_0x1e65cf,null))['catch'](handleError(_0x1e65cf,null));};exports[_0x3099('0x23')]=function(_0x5bdb50,_0x40a218){return db[_0x3099('0x2c')][_0x3099('0x49')]({'where':{'id':_0x5bdb50[_0x3099('0x45')]['id']}})['then'](handleEntityNotFound(_0x40a218,null))[_0x3099('0x42')](removeEntity(_0x40a218,null))[_0x3099('0x43')](handleError(_0x40a218,null));}; \ No newline at end of file +var _0xfa13=['where','VIRTUAL','options','includeAll','rows','catch','params','include','merge','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','pick','filter'];(function(_0x56c35e,_0x25323c){var _0x1ca65b=function(_0x457946){while(--_0x457946){_0x56c35e['push'](_0x56c35e['shift']());}};_0x1ca65b(++_0x25323c);}(_0xfa13,0x183));var _0x3fa1=function(_0x3119f6,_0x57b8b5){_0x3119f6=_0x3119f6-0x0;var _0x4c5a4a=_0xfa13[_0x3119f6];return _0x4c5a4a;};'use strict';var emlformat=require(_0x3fa1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fa1('0x1'));var jsonpatch=require(_0x3fa1('0x2'));var rp=require(_0x3fa1('0x3'));var moment=require(_0x3fa1('0x4'));var BPromise=require(_0x3fa1('0x5'));var Mustache=require(_0x3fa1('0x6'));var util=require('util');var path=require(_0x3fa1('0x7'));var sox=require(_0x3fa1('0x8'));var csv=require(_0x3fa1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fa1('0xa'));var _=require('lodash');var squel=require(_0x3fa1('0xb'));var crypto=require(_0x3fa1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3fa1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3fa1('0xe'));var Papa=require('papaparse');var Redis=require(_0x3fa1('0xf'));var authService=require(_0x3fa1('0x10'));var qs=require(_0x3fa1('0x11'));var as=require(_0x3fa1('0x12'));var hardwareService=require(_0x3fa1('0x13'));var logger=require(_0x3fa1('0x14'))(_0x3fa1('0x15'));var utils=require(_0x3fa1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3fa1('0x17'));var db=require(_0x3fa1('0x18'))['db'];function respondWithStatusCode(_0x435900,_0x44f0bd){_0x44f0bd=_0x44f0bd||0xcc;return function(_0x607e57){if(_0x607e57){return _0x435900[_0x3fa1('0x19')](_0x44f0bd);}return _0x435900[_0x3fa1('0x1a')](_0x44f0bd)[_0x3fa1('0x1b')]();};}function respondWithResult(_0x2ee03b,_0x42bd6a){_0x42bd6a=_0x42bd6a||0xc8;return function(_0x272159){if(_0x272159){return _0x2ee03b[_0x3fa1('0x1a')](_0x42bd6a)['json'](_0x272159);}};}function respondWithFilteredResult(_0x1c0c6b,_0x14fc95){return function(_0x4c0348){if(_0x4c0348){var _0x2e959c=typeof _0x14fc95[_0x3fa1('0x1c')]===_0x3fa1('0x1d')&&typeof _0x14fc95[_0x3fa1('0x1e')]===_0x3fa1('0x1d');var _0x18fd9e=_0x4c0348[_0x3fa1('0x1f')];var _0x3c7d19=_0x2e959c?0x0:_0x14fc95['offset'];var _0x50ed76=_0x2e959c?_0x4c0348['count']:_0x14fc95[_0x3fa1('0x1c')]+_0x14fc95[_0x3fa1('0x1e')];var _0x150796;if(_0x50ed76>=_0x18fd9e){_0x50ed76=_0x18fd9e;_0x150796=0xc8;}else{_0x150796=0xce;}_0x1c0c6b[_0x3fa1('0x1a')](_0x150796);return _0x1c0c6b[_0x3fa1('0x20')](_0x3fa1('0x21'),_0x3c7d19+'-'+_0x50ed76+'/'+_0x18fd9e)[_0x3fa1('0x22')](_0x4c0348);}return null;};}function patchUpdates(_0x4ea709){return function(_0x43b2d9){try{jsonpatch[_0x3fa1('0x23')](_0x43b2d9,_0x4ea709,!![]);}catch(_0x1c49fe){return BPromise[_0x3fa1('0x24')](_0x1c49fe);}return _0x43b2d9[_0x3fa1('0x25')]();};}function saveUpdates(_0x5dbffa,_0x1b942b){return function(_0x245194){if(_0x245194){return _0x245194[_0x3fa1('0x26')](_0x5dbffa)[_0x3fa1('0x27')](function(_0x143243){return _0x143243;});}return null;};}function removeEntity(_0x6d70b3,_0x1af356){return function(_0x3a9824){if(_0x3a9824){return _0x3a9824[_0x3fa1('0x28')]()[_0x3fa1('0x27')](function(){_0x6d70b3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59783d,_0x4ecc8e){return function(_0x36f0e6){if(!_0x36f0e6){_0x59783d[_0x3fa1('0x19')](0x194);}return _0x36f0e6;};}function handleError(_0xc6be36,_0x131674){_0x131674=_0x131674||0x1f4;return function(_0x494670){logger['error'](_0x494670[_0x3fa1('0x29')]);if(_0x494670[_0x3fa1('0x2a')]){delete _0x494670[_0x3fa1('0x2a')];}_0xc6be36[_0x3fa1('0x1a')](_0x131674)[_0x3fa1('0x2b')](_0x494670);};}exports[_0x3fa1('0x2c')]=function(_0x577bf8,_0x118488){var _0x57955c={},_0x57d064={},_0x1de182={'count':0x0,'rows':[]};var _0x4cc936=_[_0x3fa1('0x2d')](db[_0x3fa1('0x2e')][_0x3fa1('0x2f')],function(_0x2e6f7f){return{'name':_0x2e6f7f[_0x3fa1('0x30')],'type':_0x2e6f7f[_0x3fa1('0x31')][_0x3fa1('0x32')]};});_0x57d064[_0x3fa1('0x33')]=_[_0x3fa1('0x2d')](_0x4cc936,_0x3fa1('0x2a'));_0x57d064['query']=_[_0x3fa1('0x34')](_0x577bf8[_0x3fa1('0x35')]);_0x57d064[_0x3fa1('0x36')]=_[_0x3fa1('0x37')](_0x57d064[_0x3fa1('0x33')],_0x57d064[_0x3fa1('0x35')]);_0x57955c[_0x3fa1('0x38')]=_[_0x3fa1('0x37')](_0x57d064[_0x3fa1('0x33')],qs[_0x3fa1('0x39')](_0x577bf8[_0x3fa1('0x35')][_0x3fa1('0x39')]));_0x57955c['attributes']=_0x57955c[_0x3fa1('0x38')][_0x3fa1('0x3a')]?_0x57955c[_0x3fa1('0x38')]:_0x57d064[_0x3fa1('0x33')];if(!_0x577bf8[_0x3fa1('0x35')][_0x3fa1('0x3b')](_0x3fa1('0x3c'))){_0x57955c[_0x3fa1('0x1e')]=qs[_0x3fa1('0x1e')](_0x577bf8[_0x3fa1('0x35')][_0x3fa1('0x1e')]);_0x57955c[_0x3fa1('0x1c')]=qs['offset'](_0x577bf8[_0x3fa1('0x35')][_0x3fa1('0x1c')]);}_0x57955c['order']=qs['sort'](_0x577bf8['query']['sort']);_0x57955c['where']=qs[_0x3fa1('0x36')](_[_0x3fa1('0x3d')](_0x577bf8[_0x3fa1('0x35')],_0x57d064[_0x3fa1('0x36')]),_0x4cc936);if(_0x577bf8['query'][_0x3fa1('0x3e')]){_0x57955c[_0x3fa1('0x3f')]=_['merge'](_0x57955c[_0x3fa1('0x3f')],{'$or':_[_0x3fa1('0x2d')](_0x4cc936,function(_0x41e1ff){if(_0x41e1ff[_0x3fa1('0x31')]!==_0x3fa1('0x40')){var _0x4a37f5={};_0x4a37f5[_0x41e1ff['name']]={'$like':'%'+_0x577bf8[_0x3fa1('0x35')][_0x3fa1('0x3e')]+'%'};return _0x4a37f5;}})});}_0x57955c=_['merge']({},_0x57955c,_0x577bf8[_0x3fa1('0x41')]);var _0x20bbc1={'where':_0x57955c[_0x3fa1('0x3f')]};return db['ServicenowField'][_0x3fa1('0x1f')](_0x20bbc1)['then'](function(_0x126e8d){_0x1de182[_0x3fa1('0x1f')]=_0x126e8d;if(_0x577bf8[_0x3fa1('0x35')][_0x3fa1('0x42')]){_0x57955c['include']=[{'all':!![]}];}return db[_0x3fa1('0x2e')]['findAll'](_0x57955c);})['then'](function(_0x1be364){_0x1de182[_0x3fa1('0x43')]=_0x1be364;return _0x1de182;})[_0x3fa1('0x27')](respondWithFilteredResult(_0x118488,_0x57955c))[_0x3fa1('0x44')](handleError(_0x118488,null));};exports['show']=function(_0x38b070,_0x4603e2){var _0x52e2a9={'raw':!![],'where':{'id':_0x38b070[_0x3fa1('0x45')]['id']}},_0xabc1ac={};_0xabc1ac[_0x3fa1('0x33')]=_[_0x3fa1('0x34')](db[_0x3fa1('0x2e')][_0x3fa1('0x2f')]);_0xabc1ac[_0x3fa1('0x35')]=_[_0x3fa1('0x34')](_0x38b070['query']);_0xabc1ac['filters']=_[_0x3fa1('0x37')](_0xabc1ac[_0x3fa1('0x33')],_0xabc1ac[_0x3fa1('0x35')]);_0x52e2a9[_0x3fa1('0x38')]=_[_0x3fa1('0x37')](_0xabc1ac['model'],qs[_0x3fa1('0x39')](_0x38b070['query'][_0x3fa1('0x39')]));_0x52e2a9[_0x3fa1('0x38')]=_0x52e2a9[_0x3fa1('0x38')][_0x3fa1('0x3a')]?_0x52e2a9[_0x3fa1('0x38')]:_0xabc1ac[_0x3fa1('0x33')];if(_0x38b070[_0x3fa1('0x35')][_0x3fa1('0x42')]){_0x52e2a9[_0x3fa1('0x46')]=[{'all':!![]}];}_0x52e2a9=_[_0x3fa1('0x47')]({},_0x52e2a9,_0x38b070['options']);return db[_0x3fa1('0x2e')][_0x3fa1('0x48')](_0x52e2a9)['then'](handleEntityNotFound(_0x4603e2,null))[_0x3fa1('0x27')](respondWithResult(_0x4603e2,null))[_0x3fa1('0x44')](handleError(_0x4603e2,null));};exports[_0x3fa1('0x49')]=function(_0x2f234d,_0x54487d){return db[_0x3fa1('0x2e')][_0x3fa1('0x49')](_0x2f234d[_0x3fa1('0x4a')],{})[_0x3fa1('0x27')](respondWithResult(_0x54487d,0xc9))[_0x3fa1('0x44')](handleError(_0x54487d,null));};exports[_0x3fa1('0x26')]=function(_0x4b3366,_0x2ee779){if(_0x4b3366[_0x3fa1('0x4a')]['id']){delete _0x4b3366[_0x3fa1('0x4a')]['id'];}return db['ServicenowField'][_0x3fa1('0x48')]({'where':{'id':_0x4b3366[_0x3fa1('0x45')]['id']}})[_0x3fa1('0x27')](handleEntityNotFound(_0x2ee779,null))[_0x3fa1('0x27')](saveUpdates(_0x4b3366[_0x3fa1('0x4a')],null))['then'](respondWithResult(_0x2ee779,null))[_0x3fa1('0x44')](handleError(_0x2ee779,null));};exports[_0x3fa1('0x28')]=function(_0x573044,_0x346348){return db[_0x3fa1('0x2e')][_0x3fa1('0x48')]({'where':{'id':_0x573044[_0x3fa1('0x45')]['id']}})[_0x3fa1('0x27')](handleEntityNotFound(_0x346348,null))[_0x3fa1('0x27')](removeEntity(_0x346348,null))['catch'](handleError(_0x346348,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 3e80963..636c7d3 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 _0xed4c=['servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ServicenowField','int_servicenow_fields'];(function(_0x3e6eb9,_0x42c999){var _0x256719=function(_0x162b25){while(--_0x162b25){_0x3e6eb9['push'](_0x3e6eb9['shift']());}};_0x256719(++_0x42c999);}(_0xed4c,0x173));var _0xced4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xed4c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xced4('0x0'));var util=require(_0xced4('0x1'));var logger=require(_0xced4('0x2'))(_0xced4('0x3'));var moment=require(_0xced4('0x4'));var BPromise=require(_0xced4('0x5'));var rp=require(_0xced4('0x6'));var fs=require('fs');var path=require(_0xced4('0x7'));var rimraf=require('rimraf');var config=require(_0xced4('0x8'));var attributes=require('./intServicenowField.attributes');module[_0xced4('0x9')]=function(_0x93e8f7,_0x35cb35){return _0x93e8f7[_0xced4('0xa')](_0xced4('0xb'),attributes,{'tableName':_0xced4('0xc'),'paranoid':![],'indexes':[{'name':_0xced4('0xd'),'fields':[_0xced4('0xe'),_0xced4('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7051=['request-promise','../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','idField','FieldId','util','moment','bluebird'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0x7051,0x97));var _0x1705=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x7051[_0x51c819];return _0x15c5d2;};'use strict';var _=require('lodash');var util=require(_0x1705('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x1705('0x1'));var BPromise=require(_0x1705('0x2'));var rp=require(_0x1705('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1705('0x4'));var attributes=require(_0x1705('0x5'));module[_0x1705('0x6')]=function(_0x3bfa6a,_0x2b867b){return _0x3bfa6a[_0x1705('0x7')]('ServicenowField',attributes,{'tableName':_0x1705('0x8'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x1705('0x9'),_0x1705('0xa')],'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 04771fc..2b1402a 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 _0xda3f=['rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0xda3f,0xec));var _0xfda3=function(_0x2931ea,_0x58bfbf){_0x2931ea=_0x2931ea-0x0;var _0x3c527e=_0xda3f[_0x2931ea];return _0x3c527e;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2512a0,_0x4b91a8){var _0x1c11d1=function(_0x22cd0f){while(--_0x22cd0f){_0x2512a0['push'](_0x2512a0['shift']());}};_0x1c11d1(++_0x4b91a8);}(_0xe706,0xa3));var _0x6e70=function(_0x503d48,_0x42e5a9){_0x503d48=_0x503d48-0x0;var _0x59743e=_0xe706[_0x503d48];return _0x59743e;};'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']('ServicenowField,\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']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 3521c69..dc09275 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5e376b,_0x533165){var _0x2369cd=function(_0x3a58be){while(--_0x3a58be){_0x5e376b['push'](_0x5e376b['shift']());}};_0x2369cd(++_0x533165);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x11ee67,_0x1760b5){var _0x3ebfda=function(_0x73db8b){while(--_0x73db8b){_0x11ee67['push'](_0x11ee67['shift']());}};_0x3ebfda(++_0x1760b5);}(_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'));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 a71ebb3..ae7560b 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(_0x41bca8,_0xc98698){var _0x848ded=function(_0x5e1875){while(--_0x5e1875){_0x41bca8['push'](_0x41bca8['shift']());}};_0x848ded(++_0xc98698);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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(_0x15fcb1,_0x3b41e1){var _0x48bcc8=function(_0x5898bc){while(--_0x5898bc){_0x15fcb1['push'](_0x15fcb1['shift']());}};_0x48bcc8(++_0x3b41e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 4d7551f..29ae2c2 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 _0x67a5=['includes','label','endsWith','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SugarcrmAccount','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','body','destroy','getConfigurations','findOne','SugarcrmConfiguration','order','addConfiguration','AccountId','getSubjects','channel','getDescriptions','SugarcrmField','Subjects','Descriptions','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','Password\x20Expired','get_module_fields','Calls','values','remove'];(function(_0x30b34d,_0x3e1b56){var _0x28b204=function(_0x2c8d8a){while(--_0x2c8d8a){_0x30b34d['push'](_0x30b34d['shift']());}};_0x28b204(++_0x3e1b56);}(_0x67a5,0x83));var _0x567a=function(_0x2f1433,_0x1de301){_0x2f1433=_0x2f1433-0x0;var _0x57684d=_0x67a5[_0x2f1433];return _0x57684d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x567a('0x0'));var zipdir=require(_0x567a('0x1'));var jsonpatch=require(_0x567a('0x2'));var rp=require(_0x567a('0x3'));var moment=require(_0x567a('0x4'));var BPromise=require(_0x567a('0x5'));var Mustache=require(_0x567a('0x6'));var util=require(_0x567a('0x7'));var path=require(_0x567a('0x8'));var sox=require(_0x567a('0x9'));var csv=require('to-csv');var ejs=require(_0x567a('0xa'));var fs=require('fs');var fs_extra=require(_0x567a('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x567a('0xc'));var jsforce=require(_0x567a('0xd'));var deskjs=require(_0x567a('0xe'));var toCsv=require(_0x567a('0xf'));var querystring=require(_0x567a('0x10'));var Papa=require(_0x567a('0x11'));var Redis=require(_0x567a('0x12'));var authService=require(_0x567a('0x13'));var qs=require(_0x567a('0x14'));var as=require(_0x567a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x567a('0x16'))(_0x567a('0x17'));var utils=require('../../config/utils');var config=require(_0x567a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x567a('0x19'))['db'];var integrations=require(_0x567a('0x1a'));function respondWithStatusCode(_0x44d68e,_0x21f5eb){_0x21f5eb=_0x21f5eb||0xcc;return function(_0x2061ca){if(_0x2061ca){return _0x44d68e['sendStatus'](_0x21f5eb);}return _0x44d68e['status'](_0x21f5eb)[_0x567a('0x1b')]();};}function respondWithResult(_0x533533,_0x3fec94){_0x3fec94=_0x3fec94||0xc8;return function(_0x59c3ce){if(_0x59c3ce){return _0x533533[_0x567a('0x1c')](_0x3fec94)[_0x567a('0x1d')](_0x59c3ce);}};}function respondWithFilteredResult(_0x209860,_0x347101){return function(_0x4e508e){if(_0x4e508e){var _0x41ec09=typeof _0x347101['offset']===_0x567a('0x1e')&&typeof _0x347101[_0x567a('0x1f')]===_0x567a('0x1e');var _0x57225a=_0x4e508e[_0x567a('0x20')];var _0x7be3bf=_0x41ec09?0x0:_0x347101[_0x567a('0x21')];var _0x50dcd2=_0x41ec09?_0x4e508e[_0x567a('0x20')]:_0x347101[_0x567a('0x21')]+_0x347101[_0x567a('0x1f')];var _0x3512e4;if(_0x50dcd2>=_0x57225a){_0x50dcd2=_0x57225a;_0x3512e4=0xc8;}else{_0x3512e4=0xce;}_0x209860[_0x567a('0x1c')](_0x3512e4);return _0x209860['set'](_0x567a('0x22'),_0x7be3bf+'-'+_0x50dcd2+'/'+_0x57225a)['json'](_0x4e508e);}return null;};}function patchUpdates(_0x37f132){return function(_0x24b9dc){try{jsonpatch[_0x567a('0x23')](_0x24b9dc,_0x37f132,!![]);}catch(_0x866944){return BPromise[_0x567a('0x24')](_0x866944);}return _0x24b9dc[_0x567a('0x25')]();};}function saveUpdates(_0x3889a0,_0x22a42d){return function(_0x2979ec){if(_0x2979ec){return _0x2979ec[_0x567a('0x26')](_0x3889a0)['then'](function(_0x270680){return _0x270680;});}return null;};}function removeEntity(_0x36d83e,_0x355b60){return function(_0x20d713){if(_0x20d713){return _0x20d713['destroy']()[_0x567a('0x27')](function(){_0x36d83e[_0x567a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45939d,_0x1ccd2e){return function(_0x41bb7f){if(!_0x41bb7f){_0x45939d['sendStatus'](0x194);}return _0x41bb7f;};}function handleError(_0x33e203,_0x381a40){_0x381a40=_0x381a40||0x1f4;return function(_0x54a018){logger[_0x567a('0x28')](_0x54a018[_0x567a('0x29')]);if(_0x54a018['name']){delete _0x54a018[_0x567a('0x2a')];}_0x33e203['status'](_0x381a40)[_0x567a('0x2b')](_0x54a018);};}exports[_0x567a('0x2c')]=function(_0x158817,_0xafaec3){var _0x478199={},_0xd732b4={},_0x3e4a55={'count':0x0,'rows':[]};var _0x320d0a=_[_0x567a('0x2d')](db[_0x567a('0x2e')]['rawAttributes'],function(_0x138eb3){return{'name':_0x138eb3[_0x567a('0x2f')],'type':_0x138eb3['type'][_0x567a('0x30')]};});_0xd732b4[_0x567a('0x31')]=_[_0x567a('0x2d')](_0x320d0a,'name');_0xd732b4[_0x567a('0x32')]=_[_0x567a('0x33')](_0x158817['query']);_0xd732b4[_0x567a('0x34')]=_[_0x567a('0x35')](_0xd732b4[_0x567a('0x31')],_0xd732b4['query']);_0x478199['attributes']=_[_0x567a('0x35')](_0xd732b4[_0x567a('0x31')],qs['fields'](_0x158817[_0x567a('0x32')][_0x567a('0x36')]));_0x478199['attributes']=_0x478199[_0x567a('0x37')]['length']?_0x478199[_0x567a('0x37')]:_0xd732b4[_0x567a('0x31')];if(!_0x158817[_0x567a('0x32')][_0x567a('0x38')](_0x567a('0x39'))){_0x478199[_0x567a('0x1f')]=qs[_0x567a('0x1f')](_0x158817['query']['limit']);_0x478199[_0x567a('0x21')]=qs[_0x567a('0x21')](_0x158817[_0x567a('0x32')][_0x567a('0x21')]);}_0x478199['order']=qs[_0x567a('0x3a')](_0x158817[_0x567a('0x32')][_0x567a('0x3a')]);_0x478199['where']=qs['filters'](_['pick'](_0x158817[_0x567a('0x32')],_0xd732b4[_0x567a('0x34')]),_0x320d0a);if(_0x158817['query'][_0x567a('0x3b')]){_0x478199[_0x567a('0x3c')]=_['merge'](_0x478199[_0x567a('0x3c')],{'$or':_['map'](_0x320d0a,function(_0x3993b6){if(_0x3993b6[_0x567a('0x3d')]!==_0x567a('0x3e')){var _0x45e78e={};_0x45e78e[_0x3993b6[_0x567a('0x2a')]]={'$like':'%'+_0x158817[_0x567a('0x32')][_0x567a('0x3b')]+'%'};return _0x45e78e;}})});}_0x478199=_[_0x567a('0x3f')]({},_0x478199,_0x158817[_0x567a('0x40')]);var _0x3e4c6c={'where':_0x478199[_0x567a('0x3c')]};return db[_0x567a('0x2e')]['count'](_0x3e4c6c)['then'](function(_0x522878){_0x3e4a55[_0x567a('0x20')]=_0x522878;if(_0x158817['query'][_0x567a('0x41')]){_0x478199[_0x567a('0x42')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x567a('0x43')](_0x478199);})['then'](function(_0xddaf6e){_0x3e4a55['rows']=_0xddaf6e;return _0x3e4a55;})['then'](respondWithFilteredResult(_0xafaec3,_0x478199))[_0x567a('0x44')](handleError(_0xafaec3,null));};exports[_0x567a('0x45')]=function(_0x2bc3ad,_0x2ac397){var _0x32f2f2={'raw':![],'where':{'id':_0x2bc3ad[_0x567a('0x46')]['id']}},_0x1de6da={};_0x1de6da['model']=_['keys'](db[_0x567a('0x2e')][_0x567a('0x47')]);_0x1de6da[_0x567a('0x32')]=_[_0x567a('0x33')](_0x2bc3ad[_0x567a('0x32')]);_0x1de6da[_0x567a('0x34')]=_['intersection'](_0x1de6da[_0x567a('0x31')],_0x1de6da['query']);_0x32f2f2['attributes']=_[_0x567a('0x35')](_0x1de6da[_0x567a('0x31')],qs[_0x567a('0x36')](_0x2bc3ad[_0x567a('0x32')][_0x567a('0x36')]));_0x32f2f2[_0x567a('0x37')]=_0x32f2f2['attributes'][_0x567a('0x48')]?_0x32f2f2[_0x567a('0x37')]:_0x1de6da['model'];if(_0x2bc3ad[_0x567a('0x32')][_0x567a('0x41')]){_0x32f2f2[_0x567a('0x42')]=[{'all':!![]}];}_0x32f2f2=_[_0x567a('0x3f')]({},_0x32f2f2,_0x2bc3ad[_0x567a('0x40')]);return db['SugarcrmAccount'][_0x567a('0x49')](_0x32f2f2)[_0x567a('0x27')](handleEntityNotFound(_0x2ac397,null))['then'](respondWithResult(_0x2ac397,null))[_0x567a('0x44')](handleError(_0x2ac397,null));};exports[_0x567a('0x4a')]=function(_0x3a923d,_0x226c1b){return db[_0x567a('0x2e')][_0x567a('0x4a')](_0x3a923d[_0x567a('0x4b')],{})[_0x567a('0x27')](respondWithResult(_0x226c1b,0xc9))[_0x567a('0x44')](handleError(_0x226c1b,null));};exports[_0x567a('0x26')]=function(_0x5dd717,_0x3fd59e){if(_0x5dd717[_0x567a('0x4b')]['id']){delete _0x5dd717['body']['id'];}return db[_0x567a('0x2e')][_0x567a('0x49')]({'where':{'id':_0x5dd717[_0x567a('0x46')]['id']}})[_0x567a('0x27')](handleEntityNotFound(_0x3fd59e,null))['then'](saveUpdates(_0x5dd717[_0x567a('0x4b')],null))[_0x567a('0x27')](respondWithResult(_0x3fd59e,null))[_0x567a('0x44')](handleError(_0x3fd59e,null));};exports[_0x567a('0x4c')]=function(_0x50eee3,_0x5ae86f){return db['SugarcrmAccount'][_0x567a('0x49')]({'where':{'id':_0x50eee3[_0x567a('0x46')]['id']}})[_0x567a('0x27')](handleEntityNotFound(_0x5ae86f,null))[_0x567a('0x27')](removeEntity(_0x5ae86f,null))['catch'](handleError(_0x5ae86f,null));};exports[_0x567a('0x4d')]=function(_0x327dda,_0x51069c,_0x27686a){var _0x42211b={};var _0x265a8c={};var _0x1b9128;var _0x32f141;return db[_0x567a('0x2e')][_0x567a('0x4e')]({'where':{'id':_0x327dda[_0x567a('0x46')]['id']}})[_0x567a('0x27')](handleEntityNotFound(_0x51069c,null))[_0x567a('0x27')](function(_0xdb6f36){if(_0xdb6f36){_0x1b9128=_0xdb6f36;_0x265a8c[_0x567a('0x31')]=_[_0x567a('0x33')](db[_0x567a('0x4f')][_0x567a('0x47')]);_0x265a8c[_0x567a('0x32')]=_[_0x567a('0x33')](_0x327dda['query']);_0x265a8c[_0x567a('0x34')]=_[_0x567a('0x35')](_0x265a8c[_0x567a('0x31')],_0x265a8c['query']);_0x42211b[_0x567a('0x37')]=_[_0x567a('0x35')](_0x265a8c[_0x567a('0x31')],qs[_0x567a('0x36')](_0x327dda['query'][_0x567a('0x36')]));_0x42211b[_0x567a('0x37')]=_0x42211b['attributes'][_0x567a('0x48')]?_0x42211b[_0x567a('0x37')]:_0x265a8c[_0x567a('0x31')];_0x42211b[_0x567a('0x50')]=qs['sort'](_0x327dda[_0x567a('0x32')]['sort']);_0x42211b[_0x567a('0x3c')]=qs[_0x567a('0x34')](_['pick'](_0x327dda[_0x567a('0x32')],_0x265a8c['filters']));if(_0x327dda[_0x567a('0x32')][_0x567a('0x3b')]){_0x42211b[_0x567a('0x3c')]=_[_0x567a('0x3f')](_0x42211b[_0x567a('0x3c')],{'$or':_['map'](_0x42211b[_0x567a('0x37')],function(_0x9b990c){var _0x65df39={};_0x65df39[_0x9b990c]={'$like':'%'+_0x327dda[_0x567a('0x32')]['filter']+'%'};return _0x65df39;})});}_0x42211b=_[_0x567a('0x3f')]({},_0x42211b,_0x327dda[_0x567a('0x40')]);return _0x1b9128[_0x567a('0x4d')](_0x42211b);}})['then'](function(_0x4f2aa3){if(_0x4f2aa3){_0x32f141=_0x4f2aa3[_0x567a('0x48')];if(!_0x327dda['query'][_0x567a('0x38')](_0x567a('0x39'))){_0x42211b[_0x567a('0x1f')]=qs[_0x567a('0x1f')](_0x327dda[_0x567a('0x32')][_0x567a('0x1f')]);_0x42211b[_0x567a('0x21')]=qs['offset'](_0x327dda['query'][_0x567a('0x21')]);}return _0x1b9128['getConfigurations'](_0x42211b);}})[_0x567a('0x27')](function(_0x39fa50){if(_0x39fa50){return _0x39fa50?{'count':_0x32f141,'rows':_0x39fa50}:null;}})[_0x567a('0x27')](respondWithResult(_0x51069c,null))[_0x567a('0x44')](handleError(_0x51069c,null));};exports[_0x567a('0x51')]=function(_0x1d74d9,_0x409b36,_0x124ab4){if(_0x1d74d9[_0x567a('0x4b')]['id']){delete _0x1d74d9[_0x567a('0x4b')]['id'];}return db[_0x567a('0x2e')][_0x567a('0x4e')]({'where':{'id':_0x1d74d9[_0x567a('0x46')]['id']}})[_0x567a('0x27')](handleEntityNotFound(_0x409b36,null))[_0x567a('0x27')](function(_0x5ee45d){if(_0x5ee45d){_0x1d74d9['body'][_0x567a('0x52')]=_0x5ee45d['id'];_0x1d74d9['body']['Subjects']=integrations[_0x567a('0x53')](_0x1d74d9[_0x567a('0x4b')][_0x567a('0x54')],_0x1d74d9['body']['type']);_0x1d74d9['body']['Descriptions']=integrations[_0x567a('0x55')](_0x1d74d9[_0x567a('0x4b')][_0x567a('0x54')],_0x1d74d9[_0x567a('0x4b')]['type']);return db[_0x567a('0x4f')][_0x567a('0x4a')](_0x1d74d9[_0x567a('0x4b')],{'include':[{'model':db[_0x567a('0x56')],'as':_0x567a('0x57')},{'model':db[_0x567a('0x56')],'as':_0x567a('0x58')}]});}return null;})[_0x567a('0x27')](respondWithResult(_0x409b36,null))['catch'](handleError(_0x409b36,null));};exports['getFields']=function(_0x2a5fe1,_0xbd177c,_0x4d3305){var _0x5de964='';var _0x274e1e=['id',_0x567a('0x2a'),_0x567a('0x59'),_0x567a('0x5a'),_0x567a('0x5b'),_0x567a('0x5c'),'duration_hours',_0x567a('0x5d'),_0x567a('0x5e'),_0x567a('0x5f'),_0x567a('0x60'),_0x567a('0x61')];return db[_0x567a('0x2e')][_0x567a('0x4e')]({'where':{'id':_0x2a5fe1['params']['id']},'attributes':['id',_0x567a('0x62'),_0x567a('0x63'),_0x567a('0x64')]})['then'](handleEntityNotFound(_0xbd177c,null))[_0x567a('0x27')](function(_0xf0c353){if(_0xf0c353){_0x5de964=_0xf0c353[_0x567a('0x64')];var _0xb0c15d=_0x5de964[_0x567a('0x65')](-0x1);if(_0xb0c15d==='/'){_0x5de964=_0x5de964[_0x567a('0x66')](0x0,_0x5de964[_0x567a('0x67')](_0xb0c15d));}return rp({'method':_0x567a('0x68'),'uri':util[_0x567a('0x69')](_0x567a('0x6a'),_0x5de964,_0x567a('0x6b')),'json':!![],'form':{'method':_0x567a('0x6c'),'input_type':'JSON','response_type':_0x567a('0x6d'),'rest_data':JSON[_0x567a('0x6e')]({'user_auth':{'user_name':_0xf0c353[_0x567a('0x62')],'password':_0xf0c353[_0x567a('0x63')],'encryption':_0x567a('0x6f')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x567a('0x27')](function(_0x1d81f5){if(_0x1d81f5&&_0x1d81f5[_0x567a('0x2a')]!=='Invalid\x20Login'&&_0x1d81f5[_0x567a('0x2a')]!==_0x567a('0x70')){return rp({'method':_0x567a('0x68'),'uri':util['format']('%s%s',_0x5de964,_0x567a('0x6b')),'json':!![],'form':{'method':_0x567a('0x71'),'input_type':'JSON','response_type':_0x567a('0x6d'),'rest_data':JSON['stringify']({'session':_0x1d81f5['id'],'module_name':_0x567a('0x72')})}})[_0x567a('0x27')](function(_0x256f93){if(_0x256f93){var _0x4b399e=_[_0x567a('0x73')](_0x256f93['module_fields']);_[_0x567a('0x74')](_0x4b399e,function(_0x146d88){return _0x274e1e[_0x567a('0x75')](_0x146d88[_0x567a('0x2a')]);});return{'count':_0x4b399e[_0x567a('0x48')],'rows':_['map'](_0x4b399e,function(_0x45302e){return{'id':_0x45302e[_0x567a('0x2a')],'name':_0x45302e[_0x567a('0x76')],'custom':_[_0x567a('0x77')](_0x45302e[_0x567a('0x2a')],'_c')?!![]:![],'options':_0x45302e[_0x567a('0x40')]?_[_0x567a('0x2d')](_[_0x567a('0x73')](_0x45302e[_0x567a('0x40')]),function(_0x3b289d){return{'name':_0x3b289d['value'],'value':_0x3b289d['name']};}):[]};})};}})[_0x567a('0x27')](respondWithResult(_0xbd177c,null))['catch'](function(_0x2f5358){var _0xbf9b81=_0x2a5fe1[_0x567a('0x32')]['test']?0x1f4:_0x2f5358[_0x567a('0x78')]||0x1f4;logger[_0x567a('0x28')](_0x567a('0x79'),_0x567a('0x7a'),_0xbf9b81,JSON[_0x567a('0x6e')](_0x2f5358));delete _0x2f5358['name'];if(_0xbf9b81===0x191){_0xbf9b81=0x190;}_0xbd177c[_0x567a('0x1c')](_0xbf9b81)[_0x567a('0x2b')](_0x2a5fe1['query']['test']?{'message':_0x567a('0x7b'),'statusCode':_0x2f5358[_0x567a('0x78')]}:_0x2f5358);});}else{var _0x57afaf=0x1f4;_0xbd177c[_0x567a('0x1c')](_0x57afaf)[_0x567a('0x2b')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0xa53e=['fields','attributes','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','options','includeAll','rows','catch','show','params','include','create','body','find','getConfigurations','findOne','SugarcrmConfiguration','pick','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','created_by','description','duration_hours','duration_minutes','parent_id','parent_name','direction','username','password','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','Invalid\x20Login','format','get_module_fields','values','includes','endsWith','value','statusCode','test','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','SugarcrmAccount','rawAttributes','fieldName','type','key','map','query','keys','intersection','model'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0xa53e,0x124));var _0xea53=function(_0x174870,_0x482eb3){_0x174870=_0x174870-0x0;var _0x4bfafa=_0xa53e[_0x174870];return _0x4bfafa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xea53('0x0'));var zipdir=require(_0xea53('0x1'));var jsonpatch=require(_0xea53('0x2'));var rp=require(_0xea53('0x3'));var moment=require('moment');var BPromise=require(_0xea53('0x4'));var Mustache=require(_0xea53('0x5'));var util=require(_0xea53('0x6'));var path=require(_0xea53('0x7'));var sox=require(_0xea53('0x8'));var csv=require('to-csv');var ejs=require(_0xea53('0x9'));var fs=require('fs');var fs_extra=require(_0xea53('0xa'));var _=require('lodash');var squel=require(_0xea53('0xb'));var crypto=require('crypto');var jsforce=require(_0xea53('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xea53('0xd'));var Papa=require('papaparse');var Redis=require(_0xea53('0xe'));var authService=require(_0xea53('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xea53('0x10'));var hardwareService=require(_0xea53('0x11'));var logger=require('../../config/logger')(_0xea53('0x12'));var utils=require(_0xea53('0x13'));var config=require(_0xea53('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xea53('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x47da34,_0x4aad28){_0x4aad28=_0x4aad28||0xcc;return function(_0x40ee49){if(_0x40ee49){return _0x47da34['sendStatus'](_0x4aad28);}return _0x47da34[_0xea53('0x16')](_0x4aad28)[_0xea53('0x17')]();};}function respondWithResult(_0x582748,_0x542ada){_0x542ada=_0x542ada||0xc8;return function(_0x54c788){if(_0x54c788){return _0x582748[_0xea53('0x16')](_0x542ada)[_0xea53('0x18')](_0x54c788);}};}function respondWithFilteredResult(_0x1c57a4,_0x4be7f7){return function(_0x5706bf){if(_0x5706bf){var _0xba163a=typeof _0x4be7f7['offset']==='undefined'&&typeof _0x4be7f7['limit']===_0xea53('0x19');var _0x46d84a=_0x5706bf['count'];var _0x42bc80=_0xba163a?0x0:_0x4be7f7[_0xea53('0x1a')];var _0x2ed162=_0xba163a?_0x5706bf[_0xea53('0x1b')]:_0x4be7f7[_0xea53('0x1a')]+_0x4be7f7['limit'];var _0x4b2938;if(_0x2ed162>=_0x46d84a){_0x2ed162=_0x46d84a;_0x4b2938=0xc8;}else{_0x4b2938=0xce;}_0x1c57a4[_0xea53('0x16')](_0x4b2938);return _0x1c57a4[_0xea53('0x1c')](_0xea53('0x1d'),_0x42bc80+'-'+_0x2ed162+'/'+_0x46d84a)[_0xea53('0x18')](_0x5706bf);}return null;};}function patchUpdates(_0x1ca1dc){return function(_0x45bb34){try{jsonpatch[_0xea53('0x1e')](_0x45bb34,_0x1ca1dc,!![]);}catch(_0x3de85b){return BPromise[_0xea53('0x1f')](_0x3de85b);}return _0x45bb34[_0xea53('0x20')]();};}function saveUpdates(_0x5a6a73,_0x133627){return function(_0x18f5b6){if(_0x18f5b6){return _0x18f5b6[_0xea53('0x21')](_0x5a6a73)[_0xea53('0x22')](function(_0x43543){return _0x43543;});}return null;};}function removeEntity(_0x1703a0,_0x4b1519){return function(_0xa5ffc8){if(_0xa5ffc8){return _0xa5ffc8[_0xea53('0x23')]()[_0xea53('0x22')](function(){_0x1703a0[_0xea53('0x16')](0xcc)[_0xea53('0x17')]();});}};}function handleEntityNotFound(_0x46cef6,_0x53dc58){return function(_0x439beb){if(!_0x439beb){_0x46cef6[_0xea53('0x24')](0x194);}return _0x439beb;};}function handleError(_0x31afa9,_0x4f0175){_0x4f0175=_0x4f0175||0x1f4;return function(_0x1227f4){logger[_0xea53('0x25')](_0x1227f4[_0xea53('0x26')]);if(_0x1227f4[_0xea53('0x27')]){delete _0x1227f4[_0xea53('0x27')];}_0x31afa9['status'](_0x4f0175)['send'](_0x1227f4);};}exports['index']=function(_0x44e5ab,_0x10bb83){var _0x2d1112={},_0x278aa3={},_0x321b85={'count':0x0,'rows':[]};var _0x4487af=_['map'](db[_0xea53('0x28')][_0xea53('0x29')],function(_0x2d643d){return{'name':_0x2d643d[_0xea53('0x2a')],'type':_0x2d643d[_0xea53('0x2b')][_0xea53('0x2c')]};});_0x278aa3['model']=_[_0xea53('0x2d')](_0x4487af,_0xea53('0x27'));_0x278aa3[_0xea53('0x2e')]=_[_0xea53('0x2f')](_0x44e5ab[_0xea53('0x2e')]);_0x278aa3['filters']=_['intersection'](_0x278aa3['model'],_0x278aa3[_0xea53('0x2e')]);_0x2d1112['attributes']=_[_0xea53('0x30')](_0x278aa3[_0xea53('0x31')],qs[_0xea53('0x32')](_0x44e5ab['query'][_0xea53('0x32')]));_0x2d1112[_0xea53('0x33')]=_0x2d1112[_0xea53('0x33')][_0xea53('0x34')]?_0x2d1112[_0xea53('0x33')]:_0x278aa3[_0xea53('0x31')];if(!_0x44e5ab[_0xea53('0x2e')][_0xea53('0x35')]('nolimit')){_0x2d1112[_0xea53('0x36')]=qs[_0xea53('0x36')](_0x44e5ab[_0xea53('0x2e')][_0xea53('0x36')]);_0x2d1112['offset']=qs[_0xea53('0x1a')](_0x44e5ab[_0xea53('0x2e')][_0xea53('0x1a')]);}_0x2d1112[_0xea53('0x37')]=qs[_0xea53('0x38')](_0x44e5ab[_0xea53('0x2e')][_0xea53('0x38')]);_0x2d1112[_0xea53('0x39')]=qs['filters'](_['pick'](_0x44e5ab['query'],_0x278aa3[_0xea53('0x3a')]),_0x4487af);if(_0x44e5ab[_0xea53('0x2e')][_0xea53('0x3b')]){_0x2d1112[_0xea53('0x39')]=_[_0xea53('0x3c')](_0x2d1112[_0xea53('0x39')],{'$or':_[_0xea53('0x2d')](_0x4487af,function(_0x4cd088){if(_0x4cd088[_0xea53('0x2b')]!=='VIRTUAL'){var _0x51c5c1={};_0x51c5c1[_0x4cd088[_0xea53('0x27')]]={'$like':'%'+_0x44e5ab[_0xea53('0x2e')][_0xea53('0x3b')]+'%'};return _0x51c5c1;}})});}_0x2d1112=_[_0xea53('0x3c')]({},_0x2d1112,_0x44e5ab[_0xea53('0x3d')]);var _0x17dc0b={'where':_0x2d1112[_0xea53('0x39')]};return db[_0xea53('0x28')][_0xea53('0x1b')](_0x17dc0b)['then'](function(_0x47e1e8){_0x321b85[_0xea53('0x1b')]=_0x47e1e8;if(_0x44e5ab[_0xea53('0x2e')][_0xea53('0x3e')]){_0x2d1112['include']=[{'all':!![]}];}return db[_0xea53('0x28')]['findAll'](_0x2d1112);})[_0xea53('0x22')](function(_0x14635c){_0x321b85[_0xea53('0x3f')]=_0x14635c;return _0x321b85;})[_0xea53('0x22')](respondWithFilteredResult(_0x10bb83,_0x2d1112))[_0xea53('0x40')](handleError(_0x10bb83,null));};exports[_0xea53('0x41')]=function(_0x1c8455,_0x593894){var _0x1ca6a2={'raw':![],'where':{'id':_0x1c8455[_0xea53('0x42')]['id']}},_0xcdda26={};_0xcdda26[_0xea53('0x31')]=_['keys'](db[_0xea53('0x28')]['rawAttributes']);_0xcdda26['query']=_[_0xea53('0x2f')](_0x1c8455[_0xea53('0x2e')]);_0xcdda26[_0xea53('0x3a')]=_['intersection'](_0xcdda26[_0xea53('0x31')],_0xcdda26[_0xea53('0x2e')]);_0x1ca6a2['attributes']=_[_0xea53('0x30')](_0xcdda26[_0xea53('0x31')],qs[_0xea53('0x32')](_0x1c8455[_0xea53('0x2e')]['fields']));_0x1ca6a2[_0xea53('0x33')]=_0x1ca6a2['attributes']['length']?_0x1ca6a2[_0xea53('0x33')]:_0xcdda26[_0xea53('0x31')];if(_0x1c8455[_0xea53('0x2e')][_0xea53('0x3e')]){_0x1ca6a2[_0xea53('0x43')]=[{'all':!![]}];}_0x1ca6a2=_[_0xea53('0x3c')]({},_0x1ca6a2,_0x1c8455[_0xea53('0x3d')]);return db[_0xea53('0x28')]['find'](_0x1ca6a2)['then'](handleEntityNotFound(_0x593894,null))['then'](respondWithResult(_0x593894,null))[_0xea53('0x40')](handleError(_0x593894,null));};exports['create']=function(_0x283a00,_0x28ef1e){return db[_0xea53('0x28')][_0xea53('0x44')](_0x283a00[_0xea53('0x45')],{})[_0xea53('0x22')](respondWithResult(_0x28ef1e,0xc9))[_0xea53('0x40')](handleError(_0x28ef1e,null));};exports[_0xea53('0x21')]=function(_0x3c3da9,_0x1f1a80){if(_0x3c3da9[_0xea53('0x45')]['id']){delete _0x3c3da9['body']['id'];}return db[_0xea53('0x28')][_0xea53('0x46')]({'where':{'id':_0x3c3da9[_0xea53('0x42')]['id']}})[_0xea53('0x22')](handleEntityNotFound(_0x1f1a80,null))[_0xea53('0x22')](saveUpdates(_0x3c3da9[_0xea53('0x45')],null))['then'](respondWithResult(_0x1f1a80,null))['catch'](handleError(_0x1f1a80,null));};exports[_0xea53('0x23')]=function(_0xe66610,_0x76bbff){return db[_0xea53('0x28')][_0xea53('0x46')]({'where':{'id':_0xe66610[_0xea53('0x42')]['id']}})[_0xea53('0x22')](handleEntityNotFound(_0x76bbff,null))[_0xea53('0x22')](removeEntity(_0x76bbff,null))[_0xea53('0x40')](handleError(_0x76bbff,null));};exports[_0xea53('0x47')]=function(_0x2601cf,_0x28d9ba,_0x3d5973){var _0x2437ed={};var _0x8f0bbc={};var _0x59d4a5;var _0x46abcf;return db[_0xea53('0x28')][_0xea53('0x48')]({'where':{'id':_0x2601cf[_0xea53('0x42')]['id']}})[_0xea53('0x22')](handleEntityNotFound(_0x28d9ba,null))[_0xea53('0x22')](function(_0x1315f5){if(_0x1315f5){_0x59d4a5=_0x1315f5;_0x8f0bbc[_0xea53('0x31')]=_[_0xea53('0x2f')](db[_0xea53('0x49')][_0xea53('0x29')]);_0x8f0bbc[_0xea53('0x2e')]=_['keys'](_0x2601cf[_0xea53('0x2e')]);_0x8f0bbc[_0xea53('0x3a')]=_[_0xea53('0x30')](_0x8f0bbc[_0xea53('0x31')],_0x8f0bbc['query']);_0x2437ed[_0xea53('0x33')]=_[_0xea53('0x30')](_0x8f0bbc[_0xea53('0x31')],qs[_0xea53('0x32')](_0x2601cf[_0xea53('0x2e')][_0xea53('0x32')]));_0x2437ed[_0xea53('0x33')]=_0x2437ed['attributes'][_0xea53('0x34')]?_0x2437ed[_0xea53('0x33')]:_0x8f0bbc[_0xea53('0x31')];_0x2437ed[_0xea53('0x37')]=qs['sort'](_0x2601cf[_0xea53('0x2e')][_0xea53('0x38')]);_0x2437ed[_0xea53('0x39')]=qs[_0xea53('0x3a')](_[_0xea53('0x4a')](_0x2601cf[_0xea53('0x2e')],_0x8f0bbc['filters']));if(_0x2601cf[_0xea53('0x2e')]['filter']){_0x2437ed['where']=_[_0xea53('0x3c')](_0x2437ed[_0xea53('0x39')],{'$or':_[_0xea53('0x2d')](_0x2437ed[_0xea53('0x33')],function(_0x235e9d){var _0x352064={};_0x352064[_0x235e9d]={'$like':'%'+_0x2601cf[_0xea53('0x2e')][_0xea53('0x3b')]+'%'};return _0x352064;})});}_0x2437ed=_['merge']({},_0x2437ed,_0x2601cf[_0xea53('0x3d')]);return _0x59d4a5[_0xea53('0x47')](_0x2437ed);}})[_0xea53('0x22')](function(_0x5b21ba){if(_0x5b21ba){_0x46abcf=_0x5b21ba[_0xea53('0x34')];if(!_0x2601cf['query'][_0xea53('0x35')](_0xea53('0x4b'))){_0x2437ed[_0xea53('0x36')]=qs[_0xea53('0x36')](_0x2601cf[_0xea53('0x2e')]['limit']);_0x2437ed[_0xea53('0x1a')]=qs[_0xea53('0x1a')](_0x2601cf[_0xea53('0x2e')]['offset']);}return _0x59d4a5['getConfigurations'](_0x2437ed);}})['then'](function(_0x3b09ee){if(_0x3b09ee){return _0x3b09ee?{'count':_0x46abcf,'rows':_0x3b09ee}:null;}})[_0xea53('0x22')](respondWithResult(_0x28d9ba,null))['catch'](handleError(_0x28d9ba,null));};exports[_0xea53('0x4c')]=function(_0x535191,_0x46c436,_0x1a0127){if(_0x535191[_0xea53('0x45')]['id']){delete _0x535191[_0xea53('0x45')]['id'];}return db[_0xea53('0x28')][_0xea53('0x48')]({'where':{'id':_0x535191[_0xea53('0x42')]['id']}})[_0xea53('0x22')](handleEntityNotFound(_0x46c436,null))[_0xea53('0x22')](function(_0x1691b2){if(_0x1691b2){_0x535191[_0xea53('0x45')][_0xea53('0x4d')]=_0x1691b2['id'];_0x535191[_0xea53('0x45')][_0xea53('0x4e')]=integrations['getSubjects'](_0x535191[_0xea53('0x45')][_0xea53('0x4f')],_0x535191[_0xea53('0x45')][_0xea53('0x2b')]);_0x535191[_0xea53('0x45')][_0xea53('0x50')]=integrations[_0xea53('0x51')](_0x535191[_0xea53('0x45')][_0xea53('0x4f')],_0x535191[_0xea53('0x45')]['type']);return db[_0xea53('0x49')][_0xea53('0x44')](_0x535191['body'],{'include':[{'model':db[_0xea53('0x52')],'as':_0xea53('0x4e')},{'model':db['SugarcrmField'],'as':_0xea53('0x50')}]});}return null;})[_0xea53('0x22')](respondWithResult(_0x46c436,null))[_0xea53('0x40')](handleError(_0x46c436,null));};exports[_0xea53('0x53')]=function(_0xfa627a,_0x464062,_0x3cb6a2){var _0x3d2a6e='';var _0x178111=['id',_0xea53('0x27'),'assigned_user_id',_0xea53('0x54'),_0xea53('0x55'),'date_start',_0xea53('0x56'),_0xea53('0x57'),_0xea53('0x58'),'parent_type',_0xea53('0x59'),_0xea53('0x5a')];return db[_0xea53('0x28')]['findOne']({'where':{'id':_0xfa627a[_0xea53('0x42')]['id']},'attributes':['id',_0xea53('0x5b'),_0xea53('0x5c'),'remoteUri']})[_0xea53('0x22')](handleEntityNotFound(_0x464062,null))[_0xea53('0x22')](function(_0x45dbe9){if(_0x45dbe9){_0x3d2a6e=_0x45dbe9['remoteUri'];var _0x219741=_0x3d2a6e[_0xea53('0x5d')](-0x1);if(_0x219741==='/'){_0x3d2a6e=_0x3d2a6e[_0xea53('0x5e')](0x0,_0x3d2a6e[_0xea53('0x5f')](_0x219741));}return rp({'method':_0xea53('0x60'),'uri':util['format'](_0xea53('0x61'),_0x3d2a6e,_0xea53('0x62')),'json':!![],'form':{'method':_0xea53('0x63'),'input_type':_0xea53('0x64'),'response_type':_0xea53('0x64'),'rest_data':JSON[_0xea53('0x65')]({'user_auth':{'user_name':_0x45dbe9[_0xea53('0x5b')],'password':_0x45dbe9[_0xea53('0x5c')],'encryption':_0xea53('0x66')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xea53('0x22')](function(_0x358193){if(_0x358193&&_0x358193[_0xea53('0x27')]!==_0xea53('0x67')&&_0x358193[_0xea53('0x27')]!=='Password\x20Expired'){return rp({'method':_0xea53('0x60'),'uri':util[_0xea53('0x68')]('%s%s',_0x3d2a6e,_0xea53('0x62')),'json':!![],'form':{'method':_0xea53('0x69'),'input_type':_0xea53('0x64'),'response_type':_0xea53('0x64'),'rest_data':JSON['stringify']({'session':_0x358193['id'],'module_name':'Calls'})}})[_0xea53('0x22')](function(_0x573102){if(_0x573102){var _0x4fecf2=_[_0xea53('0x6a')](_0x573102['module_fields']);_['remove'](_0x4fecf2,function(_0x38f931){return _0x178111[_0xea53('0x6b')](_0x38f931['name']);});return{'count':_0x4fecf2[_0xea53('0x34')],'rows':_[_0xea53('0x2d')](_0x4fecf2,function(_0x3c6ffe){return{'id':_0x3c6ffe['name'],'name':_0x3c6ffe['label'],'custom':_[_0xea53('0x6c')](_0x3c6ffe['name'],'_c')?!![]:![],'options':_0x3c6ffe['options']?_[_0xea53('0x2d')](_[_0xea53('0x6a')](_0x3c6ffe['options']),function(_0x39a0e0){return{'name':_0x39a0e0[_0xea53('0x6d')],'value':_0x39a0e0[_0xea53('0x27')]};}):[]};})};}})[_0xea53('0x22')](respondWithResult(_0x464062,null))[_0xea53('0x40')](function(_0x586d65){var _0x1c4291=_0xfa627a[_0xea53('0x2e')]['test']?0x1f4:_0x586d65[_0xea53('0x6e')]||0x1f4;logger[_0xea53('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0xea53('0x53'),_0x1c4291,JSON[_0xea53('0x65')](_0x586d65));delete _0x586d65[_0xea53('0x27')];if(_0x1c4291===0x191){_0x1c4291=0x190;}_0x464062['status'](_0x1c4291)['send'](_0xfa627a[_0xea53('0x2e')][_0xea53('0x6f')]?{'message':'Wrong\x20credentials','statusCode':_0x586d65[_0xea53('0x6e')]}:_0x586d65);});}else{var _0x36d7dd=0x1f4;_0x464062[_0xea53('0x16')](_0x36d7dd)[_0xea53('0x70')]({'message':_0xea53('0x71'),'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 ef2acce..2825fbc 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 _0x7da6=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','int_sugarcrm_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x49b3ff,_0x239ed0){var _0x153c20=function(_0x4b1b43){while(--_0x4b1b43){_0x49b3ff['push'](_0x49b3ff['shift']());}};_0x153c20(++_0x239ed0);}(_0x7da6,0x124));var _0x67da=function(_0x575783,_0x4f66f6){_0x575783=_0x575783-0x0;var _0x1aeae0=_0x7da6[_0x575783];return _0x1aeae0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x67da('0x0'))(_0x67da('0x1'));var moment=require(_0x67da('0x2'));var BPromise=require(_0x67da('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67da('0x4'));var rimraf=require(_0x67da('0x5'));var config=require(_0x67da('0x6'));var attributes=require(_0x67da('0x7'));var integrations=require(_0x67da('0x8'));module[_0x67da('0x9')]=function(_0x59af9a,_0xb7f52){return _0x59af9a['define']('SugarcrmAccount',attributes,{'tableName':_0x67da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a19=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','../../config/logger'];(function(_0x4320a7,_0x239a92){var _0x3700bf=function(_0x2c3db0){while(--_0x2c3db0){_0x4320a7['push'](_0x4320a7['shift']());}};_0x3700bf(++_0x239a92);}(_0x6a19,0x144));var _0x96a1=function(_0x1d56fd,_0x36c2d4){_0x1d56fd=_0x1d56fd-0x0;var _0x1f9f71=_0x6a19[_0x1d56fd];return _0x1f9f71;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x96a1('0x0'))(_0x96a1('0x1'));var moment=require(_0x96a1('0x2'));var BPromise=require(_0x96a1('0x3'));var rp=require(_0x96a1('0x4'));var fs=require('fs');var path=require(_0x96a1('0x5'));var rimraf=require(_0x96a1('0x6'));var config=require(_0x96a1('0x7'));var attributes=require(_0x96a1('0x8'));var integrations=require(_0x96a1('0x9'));module[_0x96a1('0xa')]=function(_0x5b7d76,_0x4fe712){return _0x5b7d76[_0x96a1('0xb')](_0x96a1('0xc'),attributes,{'tableName':'int_sugarcrm_accounts','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 3588411..ff726b3 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 _0xfa29=['../../config/environment','jayson/promise','client','request','then','info','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SugarcrmAccount,\x20%s,\x20%s','GetSugarcrmAccount','findAll','options','raw','where','attributes','limit','model','include','map','ShowSugarcrmAccount','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0xfa29,0x88));var _0x9fa2=function(_0x2f250e,_0x28e28e){_0x2f250e=_0x2f250e-0x0;var _0x49189c=_0xfa29[_0x2f250e];return _0x49189c;};'use strict';var _=require(_0x9fa2('0x0'));var util=require(_0x9fa2('0x1'));var moment=require(_0x9fa2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9fa2('0x3'));var db=require(_0x9fa2('0x4'))['db'];var utils=require(_0x9fa2('0x5'));var logger=require(_0x9fa2('0x6'))(_0x9fa2('0x7'));var config=require(_0x9fa2('0x8'));var jayson=require(_0x9fa2('0x9'));var client=jayson[_0x9fa2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13a1cc,_0x586c9a,_0x3173ac){return new BPromise(function(_0x2ae6ee,_0x71af5c){return client[_0x9fa2('0xb')](_0x13a1cc,_0x3173ac)[_0x9fa2('0xc')](function(_0x202abb){logger[_0x9fa2('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x586c9a,'request\x20sent');logger[_0x9fa2('0xe')](_0x9fa2('0xf'),_0x586c9a,_0x9fa2('0x10'),JSON[_0x9fa2('0x11')](_0x202abb));if(_0x202abb[_0x9fa2('0x12')]){if(_0x202abb[_0x9fa2('0x12')][_0x9fa2('0x13')]===0x1f4){logger[_0x9fa2('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x586c9a,_0x202abb['error'][_0x9fa2('0x14')]);return _0x71af5c(_0x202abb[_0x9fa2('0x12')]['message']);}logger[_0x9fa2('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x586c9a,_0x202abb['error'][_0x9fa2('0x14')]);return _0x2ae6ee(_0x202abb[_0x9fa2('0x12')][_0x9fa2('0x14')]);}else{logger[_0x9fa2('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x586c9a,_0x9fa2('0x10'));_0x2ae6ee(_0x202abb[_0x9fa2('0x15')][_0x9fa2('0x14')]);}})[_0x9fa2('0x16')](function(_0x1b9302){logger[_0x9fa2('0x12')](_0x9fa2('0x17'),_0x586c9a,_0x1b9302);_0x71af5c(_0x1b9302);});});}exports[_0x9fa2('0x18')]=function(_0x4683dc){var _0x1c48ee=this;return new Promise(function(_0x5a4316,_0x5460ea){return db['SugarcrmAccount'][_0x9fa2('0x19')]({'raw':_0x4683dc[_0x9fa2('0x1a')]?_0x4683dc[_0x9fa2('0x1a')][_0x9fa2('0x1b')]===undefined?!![]:![]:!![],'where':_0x4683dc['options']?_0x4683dc[_0x9fa2('0x1a')][_0x9fa2('0x1c')]||null:null,'attributes':_0x4683dc[_0x9fa2('0x1a')]?_0x4683dc[_0x9fa2('0x1a')][_0x9fa2('0x1d')]||null:null,'limit':_0x4683dc[_0x9fa2('0x1a')]?_0x4683dc[_0x9fa2('0x1a')][_0x9fa2('0x1e')]||null:null,'include':_0x4683dc[_0x9fa2('0x1a')]?_0x4683dc[_0x9fa2('0x1a')]['include']?_['map'](_0x4683dc['options']['include'],function(_0x1a4ab0){return{'model':db[_0x1a4ab0[_0x9fa2('0x1f')]],'as':_0x1a4ab0['as'],'attributes':_0x1a4ab0[_0x9fa2('0x1d')],'include':_0x1a4ab0[_0x9fa2('0x20')]?_[_0x9fa2('0x21')](_0x1a4ab0[_0x9fa2('0x20')],function(_0x4d6026){return{'model':db[_0x4d6026[_0x9fa2('0x1f')]],'as':_0x4d6026['as'],'attributes':_0x4d6026[_0x9fa2('0x1d')],'include':_0x4d6026[_0x9fa2('0x20')]?_[_0x9fa2('0x21')](_0x4d6026[_0x9fa2('0x20')],function(_0x10e04a){return{'model':db[_0x10e04a[_0x9fa2('0x1f')]],'as':_0x10e04a['as'],'attributes':_0x10e04a[_0x9fa2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9fa2('0xc')](function(_0xbaa51d){logger[_0x9fa2('0xd')]('GetSugarcrmAccount',_0x4683dc);logger[_0x9fa2('0xe')](_0x9fa2('0x18'),_0x4683dc,JSON[_0x9fa2('0x11')](_0xbaa51d));_0x5a4316(_0xbaa51d);})[_0x9fa2('0x16')](function(_0x4af7c3){logger[_0x9fa2('0x12')](_0x9fa2('0x18'),_0x4af7c3['message'],_0x4683dc);_0x5460ea(_0x1c48ee['error'](0x1f4,_0x4af7c3['message']));});});};exports[_0x9fa2('0x22')]=function(_0x5a8f1b){var _0x4e7feb=this;return new Promise(function(_0x2614b6,_0x1484af){return db['SugarcrmAccount'][_0x9fa2('0x23')]({'raw':_0x5a8f1b[_0x9fa2('0x1a')]?_0x5a8f1b[_0x9fa2('0x1a')][_0x9fa2('0x1b')]===undefined?!![]:![]:!![],'where':_0x5a8f1b[_0x9fa2('0x1a')]?_0x5a8f1b[_0x9fa2('0x1a')][_0x9fa2('0x1c')]||null:null,'attributes':_0x5a8f1b['options']?_0x5a8f1b['options'][_0x9fa2('0x1d')]||null:null,'include':_0x5a8f1b[_0x9fa2('0x1a')]?_0x5a8f1b[_0x9fa2('0x1a')][_0x9fa2('0x20')]?_[_0x9fa2('0x21')](_0x5a8f1b[_0x9fa2('0x1a')]['include'],function(_0x183adf){return{'model':db[_0x183adf[_0x9fa2('0x1f')]],'as':_0x183adf['as'],'attributes':_0x183adf[_0x9fa2('0x1d')],'include':_0x183adf[_0x9fa2('0x20')]?_[_0x9fa2('0x21')](_0x183adf[_0x9fa2('0x20')],function(_0x4d709d){return{'model':db[_0x4d709d[_0x9fa2('0x1f')]],'as':_0x4d709d['as'],'attributes':_0x4d709d['attributes'],'include':_0x4d709d[_0x9fa2('0x20')]?_[_0x9fa2('0x21')](_0x4d709d[_0x9fa2('0x20')],function(_0x327c7e){return{'model':db[_0x327c7e[_0x9fa2('0x1f')]],'as':_0x327c7e['as'],'attributes':_0x327c7e[_0x9fa2('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2793f8){logger['info']('ShowSugarcrmAccount',_0x5a8f1b);logger['debug'](_0x9fa2('0x22'),_0x5a8f1b,JSON[_0x9fa2('0x11')](_0x2793f8));_0x2614b6(_0x2793f8);})[_0x9fa2('0x16')](function(_0x45fe3d){logger[_0x9fa2('0x12')](_0x9fa2('0x22'),_0x45fe3d[_0x9fa2('0x14')],_0x5a8f1b);_0x1484af(_0x4e7feb[_0x9fa2('0x12')](0x1f4,_0x45fe3d['message']));});});}; \ No newline at end of file +var _0x9c7b=['GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','include','map','model','attributes','ShowSugarcrmAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0xfeb3ff,_0x15b34b){var _0x22a5a7=function(_0x420b8e){while(--_0x420b8e){_0xfeb3ff['push'](_0xfeb3ff['shift']());}};_0x22a5a7(++_0x15b34b);}(_0x9c7b,0xd8));var _0xb9c7=function(_0x58ef9c,_0xe84649){_0x58ef9c=_0x58ef9c-0x0;var _0x2147e=_0x9c7b[_0x58ef9c];return _0x2147e;};'use strict';var _=require(_0xb9c7('0x0'));var util=require('util');var moment=require(_0xb9c7('0x1'));var BPromise=require('bluebird');var rs=require(_0xb9c7('0x2'));var fs=require('fs');var Redis=require(_0xb9c7('0x3'));var db=require(_0xb9c7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb9c7('0x5'))(_0xb9c7('0x6'));var config=require(_0xb9c7('0x7'));var jayson=require(_0xb9c7('0x8'));var client=jayson[_0xb9c7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd0c8d3,_0x24427e,_0x5b2765){return new BPromise(function(_0x2ac9a8,_0x39fe6a){return client[_0xb9c7('0xa')](_0xd0c8d3,_0x5b2765)[_0xb9c7('0xb')](function(_0xed05f1){logger[_0xb9c7('0xc')](_0xb9c7('0xd'),_0x24427e,_0xb9c7('0xe'));logger[_0xb9c7('0xf')](_0xb9c7('0x10'),_0x24427e,_0xb9c7('0xe'),JSON['stringify'](_0xed05f1));if(_0xed05f1[_0xb9c7('0x11')]){if(_0xed05f1['error'][_0xb9c7('0x12')]===0x1f4){logger[_0xb9c7('0x11')](_0xb9c7('0xd'),_0x24427e,_0xed05f1[_0xb9c7('0x11')][_0xb9c7('0x13')]);return _0x39fe6a(_0xed05f1[_0xb9c7('0x11')][_0xb9c7('0x13')]);}logger[_0xb9c7('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x24427e,_0xed05f1[_0xb9c7('0x11')][_0xb9c7('0x13')]);return _0x2ac9a8(_0xed05f1[_0xb9c7('0x11')][_0xb9c7('0x13')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x24427e,_0xb9c7('0xe'));_0x2ac9a8(_0xed05f1[_0xb9c7('0x14')][_0xb9c7('0x13')]);}})[_0xb9c7('0x15')](function(_0x22d171){logger[_0xb9c7('0x11')](_0xb9c7('0xd'),_0x24427e,_0x22d171);_0x39fe6a(_0x22d171);});});}exports[_0xb9c7('0x16')]=function(_0x496387){var _0x471533=this;return new Promise(function(_0x168ad4,_0x1348fc){return db[_0xb9c7('0x17')][_0xb9c7('0x18')]({'raw':_0x496387[_0xb9c7('0x19')]?_0x496387[_0xb9c7('0x19')][_0xb9c7('0x1a')]===undefined?!![]:![]:!![],'where':_0x496387[_0xb9c7('0x19')]?_0x496387['options'][_0xb9c7('0x1b')]||null:null,'attributes':_0x496387[_0xb9c7('0x19')]?_0x496387[_0xb9c7('0x19')]['attributes']||null:null,'limit':_0x496387[_0xb9c7('0x19')]?_0x496387[_0xb9c7('0x19')]['limit']||null:null,'include':_0x496387[_0xb9c7('0x19')]?_0x496387[_0xb9c7('0x19')][_0xb9c7('0x1c')]?_[_0xb9c7('0x1d')](_0x496387['options'][_0xb9c7('0x1c')],function(_0x448b2b){return{'model':db[_0x448b2b[_0xb9c7('0x1e')]],'as':_0x448b2b['as'],'attributes':_0x448b2b[_0xb9c7('0x1f')],'include':_0x448b2b[_0xb9c7('0x1c')]?_[_0xb9c7('0x1d')](_0x448b2b[_0xb9c7('0x1c')],function(_0x31a3e3){return{'model':db[_0x31a3e3['model']],'as':_0x31a3e3['as'],'attributes':_0x31a3e3[_0xb9c7('0x1f')],'include':_0x31a3e3[_0xb9c7('0x1c')]?_[_0xb9c7('0x1d')](_0x31a3e3[_0xb9c7('0x1c')],function(_0x2d3f99){return{'model':db[_0x2d3f99[_0xb9c7('0x1e')]],'as':_0x2d3f99['as'],'attributes':_0x2d3f99[_0xb9c7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb9c7('0xb')](function(_0x4989d5){logger[_0xb9c7('0xc')](_0xb9c7('0x16'),_0x496387);logger[_0xb9c7('0xf')](_0xb9c7('0x16'),_0x496387,JSON['stringify'](_0x4989d5));_0x168ad4(_0x4989d5);})[_0xb9c7('0x15')](function(_0x44101e){logger[_0xb9c7('0x11')]('GetSugarcrmAccount',_0x44101e[_0xb9c7('0x13')],_0x496387);_0x1348fc(_0x471533['error'](0x1f4,_0x44101e[_0xb9c7('0x13')]));});});};exports[_0xb9c7('0x20')]=function(_0x6648ee){var _0x3ec182=this;return new Promise(function(_0x3cad91,_0xb9ac4e){return db[_0xb9c7('0x17')][_0xb9c7('0x21')]({'raw':_0x6648ee['options']?_0x6648ee[_0xb9c7('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x6648ee[_0xb9c7('0x19')]?_0x6648ee[_0xb9c7('0x19')]['where']||null:null,'attributes':_0x6648ee[_0xb9c7('0x19')]?_0x6648ee[_0xb9c7('0x19')][_0xb9c7('0x1f')]||null:null,'include':_0x6648ee[_0xb9c7('0x19')]?_0x6648ee[_0xb9c7('0x19')][_0xb9c7('0x1c')]?_['map'](_0x6648ee[_0xb9c7('0x19')][_0xb9c7('0x1c')],function(_0x4982ef){return{'model':db[_0x4982ef[_0xb9c7('0x1e')]],'as':_0x4982ef['as'],'attributes':_0x4982ef['attributes'],'include':_0x4982ef[_0xb9c7('0x1c')]?_[_0xb9c7('0x1d')](_0x4982ef[_0xb9c7('0x1c')],function(_0x32d532){return{'model':db[_0x32d532[_0xb9c7('0x1e')]],'as':_0x32d532['as'],'attributes':_0x32d532['attributes'],'include':_0x32d532[_0xb9c7('0x1c')]?_['map'](_0x32d532['include'],function(_0x44fe79){return{'model':db[_0x44fe79[_0xb9c7('0x1e')]],'as':_0x44fe79['as'],'attributes':_0x44fe79['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x124c89){logger[_0xb9c7('0xc')](_0xb9c7('0x20'),_0x6648ee);logger[_0xb9c7('0xf')](_0xb9c7('0x20'),_0x6648ee,JSON['stringify'](_0x124c89));_0x3cad91(_0x124c89);})[_0xb9c7('0x15')](function(_0x56994b){logger[_0xb9c7('0x11')](_0xb9c7('0x20'),_0x56994b[_0xb9c7('0x13')],_0x6648ee);_0xb9ac4e(_0x3ec182[_0xb9c7('0x11')](0x1f4,_0x56994b[_0xb9c7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index dbd0b68..09887f3 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 _0x3bda=['/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index'];(function(_0x1196af,_0x580fe4){var _0x5ad961=function(_0x3dbead){while(--_0x3dbead){_0x1196af['push'](_0x1196af['shift']());}};_0x5ad961(++_0x580fe4);}(_0x3bda,0xfb));var _0xa3bd=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x3bda[_0x17406a];return _0x1501ff;};'use strict';var multer=require(_0xa3bd('0x0'));var util=require(_0xa3bd('0x1'));var path=require(_0xa3bd('0x2'));var timeout=require(_0xa3bd('0x3'));var express=require(_0xa3bd('0x4'));var router=express['Router']();var fs_extra=require(_0xa3bd('0x5'));var auth=require(_0xa3bd('0x6'));var interaction=require(_0xa3bd('0x7'));var config=require(_0xa3bd('0x8'));var controller=require(_0xa3bd('0x9'));router[_0xa3bd('0xa')]('/',auth[_0xa3bd('0xb')](),controller[_0xa3bd('0xc')]);router[_0xa3bd('0xa')](_0xa3bd('0xd'),auth[_0xa3bd('0xb')](),controller['show']);router['get'](_0xa3bd('0xe'),auth[_0xa3bd('0xb')](),controller[_0xa3bd('0xf')]);router[_0xa3bd('0xa')](_0xa3bd('0x10'),auth[_0xa3bd('0xb')](),controller['getSubjects']);router[_0xa3bd('0xa')](_0xa3bd('0x11'),auth[_0xa3bd('0xb')](),controller[_0xa3bd('0x12')]);router[_0xa3bd('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa3bd('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xa3bd('0x15')]);router['delete'](_0xa3bd('0xd'),auth[_0xa3bd('0xb')](),controller[_0xa3bd('0x16')]);module[_0xa3bd('0x17')]=router; \ No newline at end of file +var _0x3e2b=['post','create','put','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x314e16,_0x109b3b){var _0x2b76a5=function(_0x34eabe){while(--_0x34eabe){_0x314e16['push'](_0x314e16['shift']());}};_0x2b76a5(++_0x109b3b);}(_0x3e2b,0xd3));var _0xb3e2=function(_0x2ceab6,_0x3cbfb1){_0x2ceab6=_0x2ceab6-0x0;var _0x5aedbb=_0x3e2b[_0x2ceab6];return _0x5aedbb;};'use strict';var multer=require(_0xb3e2('0x0'));var util=require(_0xb3e2('0x1'));var path=require(_0xb3e2('0x2'));var timeout=require(_0xb3e2('0x3'));var express=require('express');var router=express[_0xb3e2('0x4')]();var fs_extra=require(_0xb3e2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb3e2('0x6'));var config=require(_0xb3e2('0x7'));var controller=require(_0xb3e2('0x8'));router[_0xb3e2('0x9')]('/',auth['isAuthenticated'](),controller[_0xb3e2('0xa')]);router[_0xb3e2('0x9')]('/:id',auth[_0xb3e2('0xb')](),controller[_0xb3e2('0xc')]);router[_0xb3e2('0x9')](_0xb3e2('0xd'),auth[_0xb3e2('0xb')](),controller[_0xb3e2('0xe')]);router[_0xb3e2('0x9')](_0xb3e2('0xf'),auth[_0xb3e2('0xb')](),controller[_0xb3e2('0x10')]);router[_0xb3e2('0x9')](_0xb3e2('0x11'),auth['isAuthenticated'](),controller[_0xb3e2('0x12')]);router[_0xb3e2('0x13')]('/',auth['isAuthenticated'](),controller[_0xb3e2('0x14')]);router[_0xb3e2('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xb3e2('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),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 c901aaf..8a7ba29 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 _0x63a4=['STRING','sequelize','exports'];(function(_0x308a50,_0x339c9e){var _0xd6a977=function(_0x538271){while(--_0x538271){_0x308a50['push'](_0x308a50['shift']());}};_0xd6a977(++_0x339c9e);}(_0x63a4,0x187));var _0x463a=function(_0x41c66d,_0x512755){_0x41c66d=_0x41c66d-0x0;var _0x4b3302=_0x63a4[_0x41c66d];return _0x4b3302;};'use strict';var Sequelize=require(_0x463a('0x0'));module[_0x463a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x463a('0x2')]}}; \ No newline at end of file +var _0xf433=['sequelize','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf433,0x196));var _0x3f43=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf433[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x3f43('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3f43('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index b4181e7..0b38ffb 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 _0x6f07=['rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','options','SugarcrmConfiguration','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','findOne','SugarcrmField','order','getFields','getSubjects','getDescriptions','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','set','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map'];(function(_0x13d8f9,_0x1af1a3){var _0x12937=function(_0x1e765a){while(--_0x1e765a){_0x13d8f9['push'](_0x13d8f9['shift']());}};_0x12937(++_0x1af1a3);}(_0x6f07,0x7a));var _0x76f0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6f07[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x76f0('0x0'));var rimraf=require(_0x76f0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x76f0('0x2'));var BPromise=require(_0x76f0('0x3'));var Mustache=require(_0x76f0('0x4'));var util=require(_0x76f0('0x5'));var path=require(_0x76f0('0x6'));var sox=require(_0x76f0('0x7'));var csv=require(_0x76f0('0x8'));var ejs=require(_0x76f0('0x9'));var fs=require('fs');var fs_extra=require(_0x76f0('0xa'));var _=require('lodash');var squel=require(_0x76f0('0xb'));var crypto=require(_0x76f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x76f0('0xd'));var toCsv=require(_0x76f0('0x8'));var querystring=require(_0x76f0('0xe'));var Papa=require(_0x76f0('0xf'));var Redis=require(_0x76f0('0x10'));var authService=require(_0x76f0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x76f0('0x12'));var hardwareService=require(_0x76f0('0x13'));var logger=require(_0x76f0('0x14'))(_0x76f0('0x15'));var utils=require(_0x76f0('0x16'));var config=require(_0x76f0('0x17'));var licenseUtil=require(_0x76f0('0x18'));var db=require(_0x76f0('0x19'))['db'];function respondWithStatusCode(_0x44845e,_0x349151){_0x349151=_0x349151||0xcc;return function(_0x5c9e6e){if(_0x5c9e6e){return _0x44845e['sendStatus'](_0x349151);}return _0x44845e[_0x76f0('0x1a')](_0x349151)[_0x76f0('0x1b')]();};}function respondWithResult(_0x3f5b45,_0x452b8a){_0x452b8a=_0x452b8a||0xc8;return function(_0x1f305b){if(_0x1f305b){return _0x3f5b45['status'](_0x452b8a)['json'](_0x1f305b);}};}function respondWithFilteredResult(_0x10f970,_0x5216c9){return function(_0x47d5bc){if(_0x47d5bc){var _0x455f82=typeof _0x5216c9[_0x76f0('0x1c')]==='undefined'&&typeof _0x5216c9[_0x76f0('0x1d')]==='undefined';var _0x1d0b6c=_0x47d5bc['count'];var _0x1c73f5=_0x455f82?0x0:_0x5216c9[_0x76f0('0x1c')];var _0x3665fb=_0x455f82?_0x47d5bc['count']:_0x5216c9[_0x76f0('0x1c')]+_0x5216c9[_0x76f0('0x1d')];var _0x2566e2;if(_0x3665fb>=_0x1d0b6c){_0x3665fb=_0x1d0b6c;_0x2566e2=0xc8;}else{_0x2566e2=0xce;}_0x10f970['status'](_0x2566e2);return _0x10f970[_0x76f0('0x1e')]('Content-Range',_0x1c73f5+'-'+_0x3665fb+'/'+_0x1d0b6c)[_0x76f0('0x1f')](_0x47d5bc);}return null;};}function patchUpdates(_0x3f89bb){return function(_0x10f125){try{jsonpatch['apply'](_0x10f125,_0x3f89bb,!![]);}catch(_0x19d398){return BPromise[_0x76f0('0x20')](_0x19d398);}return _0x10f125[_0x76f0('0x21')]();};}function saveUpdates(_0x4466c2,_0x4e6c63){return function(_0x2bde93){if(_0x2bde93){return _0x2bde93[_0x76f0('0x22')](_0x4466c2)[_0x76f0('0x23')](function(_0x288040){return _0x288040;});}return null;};}function removeEntity(_0x2df3b0,_0x137588){return function(_0x53c3a7){if(_0x53c3a7){return _0x53c3a7[_0x76f0('0x24')]()[_0x76f0('0x23')](function(){_0x2df3b0[_0x76f0('0x1a')](0xcc)[_0x76f0('0x1b')]();});}};}function handleEntityNotFound(_0x3f938c,_0x47b0e5){return function(_0x4ee46a){if(!_0x4ee46a){_0x3f938c[_0x76f0('0x25')](0x194);}return _0x4ee46a;};}function handleError(_0x1e5c80,_0x2a83f5){_0x2a83f5=_0x2a83f5||0x1f4;return function(_0x2d32e1){logger[_0x76f0('0x26')](_0x2d32e1[_0x76f0('0x27')]);if(_0x2d32e1[_0x76f0('0x28')]){delete _0x2d32e1[_0x76f0('0x28')];}_0x1e5c80[_0x76f0('0x1a')](_0x2a83f5)[_0x76f0('0x29')](_0x2d32e1);};}exports[_0x76f0('0x2a')]=function(_0x24aefe,_0xea59da){var _0x50d752={},_0x163db9={},_0x40a799={'count':0x0,'rows':[]};var _0x4139b9=_[_0x76f0('0x2b')](db['SugarcrmConfiguration'][_0x76f0('0x2c')],function(_0xb3a6fd){return{'name':_0xb3a6fd[_0x76f0('0x2d')],'type':_0xb3a6fd[_0x76f0('0x2e')][_0x76f0('0x2f')]};});_0x163db9[_0x76f0('0x30')]=_[_0x76f0('0x2b')](_0x4139b9,_0x76f0('0x28'));_0x163db9[_0x76f0('0x31')]=_[_0x76f0('0x32')](_0x24aefe[_0x76f0('0x31')]);_0x163db9['filters']=_[_0x76f0('0x33')](_0x163db9[_0x76f0('0x30')],_0x163db9[_0x76f0('0x31')]);_0x50d752[_0x76f0('0x34')]=_[_0x76f0('0x33')](_0x163db9[_0x76f0('0x30')],qs[_0x76f0('0x35')](_0x24aefe['query'][_0x76f0('0x35')]));_0x50d752[_0x76f0('0x34')]=_0x50d752[_0x76f0('0x34')][_0x76f0('0x36')]?_0x50d752[_0x76f0('0x34')]:_0x163db9['model'];if(!_0x24aefe[_0x76f0('0x31')][_0x76f0('0x37')](_0x76f0('0x38'))){_0x50d752[_0x76f0('0x1d')]=qs[_0x76f0('0x1d')](_0x24aefe[_0x76f0('0x31')]['limit']);_0x50d752['offset']=qs[_0x76f0('0x1c')](_0x24aefe[_0x76f0('0x31')]['offset']);}_0x50d752['order']=qs[_0x76f0('0x39')](_0x24aefe[_0x76f0('0x31')][_0x76f0('0x39')]);_0x50d752['where']=qs[_0x76f0('0x3a')](_[_0x76f0('0x3b')](_0x24aefe['query'],_0x163db9['filters']),_0x4139b9);if(_0x24aefe[_0x76f0('0x31')]['filter']){_0x50d752[_0x76f0('0x3c')]=_[_0x76f0('0x3d')](_0x50d752[_0x76f0('0x3c')],{'$or':_[_0x76f0('0x2b')](_0x4139b9,function(_0x206352){if(_0x206352['type']!==_0x76f0('0x3e')){var _0x18e607={};_0x18e607[_0x206352[_0x76f0('0x28')]]={'$like':'%'+_0x24aefe[_0x76f0('0x31')][_0x76f0('0x3f')]+'%'};return _0x18e607;}})});}_0x50d752=_['merge']({},_0x50d752,_0x24aefe[_0x76f0('0x40')]);var _0x13c31d={'where':_0x50d752[_0x76f0('0x3c')]};return db[_0x76f0('0x41')]['count'](_0x13c31d)['then'](function(_0x90aed7){_0x40a799[_0x76f0('0x42')]=_0x90aed7;if(_0x24aefe[_0x76f0('0x31')][_0x76f0('0x43')]){_0x50d752[_0x76f0('0x44')]=[{'all':!![]}];}return db[_0x76f0('0x41')][_0x76f0('0x45')](_0x50d752);})['then'](function(_0x501f17){_0x40a799[_0x76f0('0x46')]=_0x501f17;return _0x40a799;})['then'](respondWithFilteredResult(_0xea59da,_0x50d752))[_0x76f0('0x47')](handleError(_0xea59da,null));};exports[_0x76f0('0x48')]=function(_0x4fb459,_0x585cf3){var _0x5f0020={'raw':![],'where':{'id':_0x4fb459['params']['id']}},_0x39c870={};_0x39c870[_0x76f0('0x30')]=_[_0x76f0('0x32')](db[_0x76f0('0x41')]['rawAttributes']);_0x39c870[_0x76f0('0x31')]=_['keys'](_0x4fb459[_0x76f0('0x31')]);_0x39c870[_0x76f0('0x3a')]=_['intersection'](_0x39c870[_0x76f0('0x30')],_0x39c870['query']);_0x5f0020[_0x76f0('0x34')]=_['intersection'](_0x39c870[_0x76f0('0x30')],qs['fields'](_0x4fb459[_0x76f0('0x31')][_0x76f0('0x35')]));_0x5f0020[_0x76f0('0x34')]=_0x5f0020[_0x76f0('0x34')][_0x76f0('0x36')]?_0x5f0020['attributes']:_0x39c870[_0x76f0('0x30')];if(_0x4fb459[_0x76f0('0x31')][_0x76f0('0x43')]){_0x5f0020[_0x76f0('0x44')]=[{'all':!![]}];}_0x5f0020=_[_0x76f0('0x3d')]({},_0x5f0020,_0x4fb459[_0x76f0('0x40')]);return db[_0x76f0('0x41')][_0x76f0('0x49')](_0x5f0020)[_0x76f0('0x23')](handleEntityNotFound(_0x585cf3,null))['then'](respondWithResult(_0x585cf3,null))[_0x76f0('0x47')](handleError(_0x585cf3,null));};exports[_0x76f0('0x4a')]=function(_0x32a3be,_0x2a801d){return db[_0x76f0('0x41')][_0x76f0('0x4a')](_0x32a3be[_0x76f0('0x4b')],{})[_0x76f0('0x23')](respondWithResult(_0x2a801d,0xc9))[_0x76f0('0x47')](handleError(_0x2a801d,null));};exports['update']=function(_0x1fba6f,_0x3bee07){if(_0x1fba6f[_0x76f0('0x4b')]['id']){delete _0x1fba6f[_0x76f0('0x4b')]['id'];}return db['SugarcrmConfiguration'][_0x76f0('0x49')]({'where':{'id':_0x1fba6f[_0x76f0('0x4c')]['id']}})[_0x76f0('0x23')](handleEntityNotFound(_0x3bee07,null))[_0x76f0('0x23')](saveUpdates(_0x1fba6f[_0x76f0('0x4b')],null))[_0x76f0('0x23')](respondWithResult(_0x3bee07,null))[_0x76f0('0x47')](handleError(_0x3bee07,null));};exports[_0x76f0('0x24')]=function(_0x113101,_0x517534){return db[_0x76f0('0x41')][_0x76f0('0x49')]({'where':{'id':_0x113101['params']['id']}})[_0x76f0('0x23')](handleEntityNotFound(_0x517534,null))[_0x76f0('0x23')](removeEntity(_0x517534,null))['catch'](handleError(_0x517534,null));};exports['getFields']=function(_0x1af300,_0x3cf1ba,_0x252dd7){var _0x4fe690={};var _0x54ed60={};var _0x533c04;var _0x117b2c;return db['SugarcrmConfiguration'][_0x76f0('0x4d')]({'where':{'id':_0x1af300['params']['id']}})[_0x76f0('0x23')](handleEntityNotFound(_0x3cf1ba,null))[_0x76f0('0x23')](function(_0x32ff89){if(_0x32ff89){_0x533c04=_0x32ff89;_0x54ed60[_0x76f0('0x30')]=_[_0x76f0('0x32')](db[_0x76f0('0x4e')][_0x76f0('0x2c')]);_0x54ed60[_0x76f0('0x31')]=_[_0x76f0('0x32')](_0x1af300['query']);_0x54ed60['filters']=_[_0x76f0('0x33')](_0x54ed60[_0x76f0('0x30')],_0x54ed60[_0x76f0('0x31')]);_0x4fe690[_0x76f0('0x34')]=_['intersection'](_0x54ed60[_0x76f0('0x30')],qs[_0x76f0('0x35')](_0x1af300[_0x76f0('0x31')]['fields']));_0x4fe690[_0x76f0('0x34')]=_0x4fe690['attributes'][_0x76f0('0x36')]?_0x4fe690[_0x76f0('0x34')]:_0x54ed60[_0x76f0('0x30')];_0x4fe690[_0x76f0('0x4f')]=qs['sort'](_0x1af300[_0x76f0('0x31')][_0x76f0('0x39')]);_0x4fe690[_0x76f0('0x3c')]=qs[_0x76f0('0x3a')](_[_0x76f0('0x3b')](_0x1af300[_0x76f0('0x31')],_0x54ed60['filters']));if(_0x1af300['query'][_0x76f0('0x3f')]){_0x4fe690[_0x76f0('0x3c')]=_[_0x76f0('0x3d')](_0x4fe690[_0x76f0('0x3c')],{'$or':_[_0x76f0('0x2b')](_0x4fe690['attributes'],function(_0x27a0c0){var _0x339fe7={};_0x339fe7[_0x27a0c0]={'$like':'%'+_0x1af300[_0x76f0('0x31')][_0x76f0('0x3f')]+'%'};return _0x339fe7;})});}_0x4fe690=_['merge']({},_0x4fe690,_0x1af300[_0x76f0('0x40')]);return _0x533c04[_0x76f0('0x50')](_0x4fe690);}})[_0x76f0('0x23')](function(_0x2c9236){if(_0x2c9236){_0x117b2c=_0x2c9236[_0x76f0('0x36')];if(!_0x1af300[_0x76f0('0x31')][_0x76f0('0x37')](_0x76f0('0x38'))){_0x4fe690[_0x76f0('0x1d')]=qs[_0x76f0('0x1d')](_0x1af300['query'][_0x76f0('0x1d')]);_0x4fe690[_0x76f0('0x1c')]=qs['offset'](_0x1af300['query'][_0x76f0('0x1c')]);}return _0x533c04[_0x76f0('0x50')](_0x4fe690);}})[_0x76f0('0x23')](function(_0x18315a){if(_0x18315a){return _0x18315a?{'count':_0x117b2c,'rows':_0x18315a}:null;}})[_0x76f0('0x23')](respondWithResult(_0x3cf1ba,null))['catch'](handleError(_0x3cf1ba,null));};exports[_0x76f0('0x51')]=function(_0x5edbf6,_0x56fcc5,_0x3dadcb){var _0x3ae4aa={};var _0x47df66={};var _0x30db20;var _0x3efc6a;return db['SugarcrmConfiguration'][_0x76f0('0x4d')]({'where':{'id':_0x5edbf6['params']['id']}})[_0x76f0('0x23')](handleEntityNotFound(_0x56fcc5,null))[_0x76f0('0x23')](function(_0x4f301c){if(_0x4f301c){_0x30db20=_0x4f301c;_0x47df66[_0x76f0('0x30')]=_[_0x76f0('0x32')](db[_0x76f0('0x4e')][_0x76f0('0x2c')]);_0x47df66[_0x76f0('0x31')]=_[_0x76f0('0x32')](_0x5edbf6['query']);_0x47df66[_0x76f0('0x3a')]=_[_0x76f0('0x33')](_0x47df66['model'],_0x47df66[_0x76f0('0x31')]);_0x3ae4aa[_0x76f0('0x34')]=_[_0x76f0('0x33')](_0x47df66[_0x76f0('0x30')],qs[_0x76f0('0x35')](_0x5edbf6[_0x76f0('0x31')][_0x76f0('0x35')]));_0x3ae4aa[_0x76f0('0x34')]=_0x3ae4aa[_0x76f0('0x34')][_0x76f0('0x36')]?_0x3ae4aa[_0x76f0('0x34')]:_0x47df66[_0x76f0('0x30')];_0x3ae4aa[_0x76f0('0x4f')]=qs['sort'](_0x5edbf6[_0x76f0('0x31')][_0x76f0('0x39')]);_0x3ae4aa[_0x76f0('0x3c')]=qs[_0x76f0('0x3a')](_[_0x76f0('0x3b')](_0x5edbf6['query'],_0x47df66[_0x76f0('0x3a')]));if(_0x5edbf6[_0x76f0('0x31')][_0x76f0('0x3f')]){_0x3ae4aa['where']=_[_0x76f0('0x3d')](_0x3ae4aa[_0x76f0('0x3c')],{'$or':_[_0x76f0('0x2b')](_0x3ae4aa['attributes'],function(_0x5e238f){var _0x5103b1={};_0x5103b1[_0x5e238f]={'$like':'%'+_0x5edbf6[_0x76f0('0x31')][_0x76f0('0x3f')]+'%'};return _0x5103b1;})});}_0x3ae4aa=_['merge']({},_0x3ae4aa,_0x5edbf6[_0x76f0('0x40')]);return _0x30db20[_0x76f0('0x51')](_0x3ae4aa);}})[_0x76f0('0x23')](function(_0x1f33ec){if(_0x1f33ec){_0x3efc6a=_0x1f33ec[_0x76f0('0x36')];if(!_0x5edbf6[_0x76f0('0x31')]['hasOwnProperty']('nolimit')){_0x3ae4aa[_0x76f0('0x1d')]=qs[_0x76f0('0x1d')](_0x5edbf6[_0x76f0('0x31')][_0x76f0('0x1d')]);_0x3ae4aa['offset']=qs['offset'](_0x5edbf6['query'][_0x76f0('0x1c')]);}return _0x30db20['getSubjects'](_0x3ae4aa);}})['then'](function(_0x1ee628){if(_0x1ee628){return _0x1ee628?{'count':_0x3efc6a,'rows':_0x1ee628}:null;}})[_0x76f0('0x23')](respondWithResult(_0x56fcc5,null))['catch'](handleError(_0x56fcc5,null));};exports[_0x76f0('0x52')]=function(_0x27945c,_0x76bebd,_0x367655){var _0x58549e={};var _0x22ce6c={};var _0x5b041a;var _0xf22e8f;return db['SugarcrmConfiguration'][_0x76f0('0x4d')]({'where':{'id':_0x27945c['params']['id']}})[_0x76f0('0x23')](handleEntityNotFound(_0x76bebd,null))[_0x76f0('0x23')](function(_0x493f15){if(_0x493f15){_0x5b041a=_0x493f15;_0x22ce6c['model']=_[_0x76f0('0x32')](db[_0x76f0('0x4e')][_0x76f0('0x2c')]);_0x22ce6c[_0x76f0('0x31')]=_['keys'](_0x27945c[_0x76f0('0x31')]);_0x22ce6c['filters']=_[_0x76f0('0x33')](_0x22ce6c[_0x76f0('0x30')],_0x22ce6c['query']);_0x58549e[_0x76f0('0x34')]=_[_0x76f0('0x33')](_0x22ce6c[_0x76f0('0x30')],qs['fields'](_0x27945c[_0x76f0('0x31')][_0x76f0('0x35')]));_0x58549e[_0x76f0('0x34')]=_0x58549e[_0x76f0('0x34')][_0x76f0('0x36')]?_0x58549e[_0x76f0('0x34')]:_0x22ce6c['model'];_0x58549e['order']=qs[_0x76f0('0x39')](_0x27945c['query']['sort']);_0x58549e[_0x76f0('0x3c')]=qs[_0x76f0('0x3a')](_[_0x76f0('0x3b')](_0x27945c[_0x76f0('0x31')],_0x22ce6c[_0x76f0('0x3a')]));if(_0x27945c[_0x76f0('0x31')][_0x76f0('0x3f')]){_0x58549e[_0x76f0('0x3c')]=_[_0x76f0('0x3d')](_0x58549e[_0x76f0('0x3c')],{'$or':_[_0x76f0('0x2b')](_0x58549e['attributes'],function(_0x26b036){var _0x6375f4={};_0x6375f4[_0x26b036]={'$like':'%'+_0x27945c[_0x76f0('0x31')][_0x76f0('0x3f')]+'%'};return _0x6375f4;})});}_0x58549e=_['merge']({},_0x58549e,_0x27945c[_0x76f0('0x40')]);return _0x5b041a[_0x76f0('0x52')](_0x58549e);}})[_0x76f0('0x23')](function(_0x438a1a){if(_0x438a1a){_0xf22e8f=_0x438a1a[_0x76f0('0x36')];if(!_0x27945c[_0x76f0('0x31')][_0x76f0('0x37')](_0x76f0('0x38'))){_0x58549e[_0x76f0('0x1d')]=qs[_0x76f0('0x1d')](_0x27945c[_0x76f0('0x31')][_0x76f0('0x1d')]);_0x58549e[_0x76f0('0x1c')]=qs['offset'](_0x27945c[_0x76f0('0x31')][_0x76f0('0x1c')]);}return _0x5b041a[_0x76f0('0x52')](_0x58549e);}})[_0x76f0('0x23')](function(_0x5614eb){if(_0x5614eb){return _0x5614eb?{'count':_0xf22e8f,'rows':_0x5614eb}:null;}})['then'](respondWithResult(_0x76bebd,null))[_0x76f0('0x47')](handleError(_0x76bebd,null));}; \ No newline at end of file +var _0x9442=['getFields','SugarcrmField','getSubjects','findOne','getDescriptions','eml-format','zip-dir','request-promise','moment','util','path','sox','ejs','squel','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body'];(function(_0x1b7e7f,_0x1b3165){var _0x48ba76=function(_0x317f63){while(--_0x317f63){_0x1b7e7f['push'](_0x1b7e7f['shift']());}};_0x48ba76(++_0x1b3165);}(_0x9442,0x139));var _0x2944=function(_0x768e32,_0x4f80f6){_0x768e32=_0x768e32-0x0;var _0x54ee49=_0x9442[_0x768e32];return _0x54ee49;};'use strict';var emlformat=require(_0x2944('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2944('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2944('0x2'));var moment=require(_0x2944('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2944('0x4'));var path=require(_0x2944('0x5'));var sox=require(_0x2944('0x6'));var csv=require('to-csv');var ejs=require(_0x2944('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2944('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2944('0x9'));var toCsv=require(_0x2944('0xa'));var querystring=require('querystring');var Papa=require(_0x2944('0xb'));var Redis=require('ioredis');var authService=require(_0x2944('0xc'));var qs=require(_0x2944('0xd'));var as=require(_0x2944('0xe'));var hardwareService=require(_0x2944('0xf'));var logger=require(_0x2944('0x10'))(_0x2944('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2944('0x12'));var db=require(_0x2944('0x13'))['db'];function respondWithStatusCode(_0xb6921c,_0x355b2b){_0x355b2b=_0x355b2b||0xcc;return function(_0x120856){if(_0x120856){return _0xb6921c[_0x2944('0x14')](_0x355b2b);}return _0xb6921c['status'](_0x355b2b)[_0x2944('0x15')]();};}function respondWithResult(_0x588902,_0x1c6f28){_0x1c6f28=_0x1c6f28||0xc8;return function(_0x2c6ea1){if(_0x2c6ea1){return _0x588902[_0x2944('0x16')](_0x1c6f28)[_0x2944('0x17')](_0x2c6ea1);}};}function respondWithFilteredResult(_0x266af6,_0x1c5749){return function(_0x1bf770){if(_0x1bf770){var _0x49de63=typeof _0x1c5749[_0x2944('0x18')]==='undefined'&&typeof _0x1c5749[_0x2944('0x19')]===_0x2944('0x1a');var _0x5456bf=_0x1bf770[_0x2944('0x1b')];var _0x4a76e4=_0x49de63?0x0:_0x1c5749[_0x2944('0x18')];var _0x57e230=_0x49de63?_0x1bf770[_0x2944('0x1b')]:_0x1c5749[_0x2944('0x18')]+_0x1c5749[_0x2944('0x19')];var _0x458450;if(_0x57e230>=_0x5456bf){_0x57e230=_0x5456bf;_0x458450=0xc8;}else{_0x458450=0xce;}_0x266af6[_0x2944('0x16')](_0x458450);return _0x266af6[_0x2944('0x1c')](_0x2944('0x1d'),_0x4a76e4+'-'+_0x57e230+'/'+_0x5456bf)[_0x2944('0x17')](_0x1bf770);}return null;};}function patchUpdates(_0x4ad73e){return function(_0xf04ff0){try{jsonpatch[_0x2944('0x1e')](_0xf04ff0,_0x4ad73e,!![]);}catch(_0x5e41c7){return BPromise['reject'](_0x5e41c7);}return _0xf04ff0['save']();};}function saveUpdates(_0x54b436,_0x23e670){return function(_0x11cce9){if(_0x11cce9){return _0x11cce9[_0x2944('0x1f')](_0x54b436)[_0x2944('0x20')](function(_0x5c591d){return _0x5c591d;});}return null;};}function removeEntity(_0x448889,_0x28d814){return function(_0x1cc43c){if(_0x1cc43c){return _0x1cc43c[_0x2944('0x21')]()['then'](function(){_0x448889[_0x2944('0x16')](0xcc)[_0x2944('0x15')]();});}};}function handleEntityNotFound(_0x3ab499,_0x25cb88){return function(_0x3075ed){if(!_0x3075ed){_0x3ab499[_0x2944('0x14')](0x194);}return _0x3075ed;};}function handleError(_0x18e0f8,_0x43dd8d){_0x43dd8d=_0x43dd8d||0x1f4;return function(_0x355e06){logger['error'](_0x355e06[_0x2944('0x22')]);if(_0x355e06[_0x2944('0x23')]){delete _0x355e06[_0x2944('0x23')];}_0x18e0f8[_0x2944('0x16')](_0x43dd8d)[_0x2944('0x24')](_0x355e06);};}exports[_0x2944('0x25')]=function(_0x15225e,_0xfe6be5){var _0x5a9931={},_0x5c38f7={},_0x50cef7={'count':0x0,'rows':[]};var _0x575ce6=_[_0x2944('0x26')](db[_0x2944('0x27')][_0x2944('0x28')],function(_0x53e8dd){return{'name':_0x53e8dd[_0x2944('0x29')],'type':_0x53e8dd[_0x2944('0x2a')][_0x2944('0x2b')]};});_0x5c38f7[_0x2944('0x2c')]=_[_0x2944('0x26')](_0x575ce6,_0x2944('0x23'));_0x5c38f7[_0x2944('0x2d')]=_[_0x2944('0x2e')](_0x15225e[_0x2944('0x2d')]);_0x5c38f7[_0x2944('0x2f')]=_[_0x2944('0x30')](_0x5c38f7[_0x2944('0x2c')],_0x5c38f7[_0x2944('0x2d')]);_0x5a9931[_0x2944('0x31')]=_[_0x2944('0x30')](_0x5c38f7[_0x2944('0x2c')],qs[_0x2944('0x32')](_0x15225e[_0x2944('0x2d')][_0x2944('0x32')]));_0x5a9931['attributes']=_0x5a9931[_0x2944('0x31')][_0x2944('0x33')]?_0x5a9931[_0x2944('0x31')]:_0x5c38f7[_0x2944('0x2c')];if(!_0x15225e[_0x2944('0x2d')][_0x2944('0x34')](_0x2944('0x35'))){_0x5a9931[_0x2944('0x19')]=qs[_0x2944('0x19')](_0x15225e[_0x2944('0x2d')][_0x2944('0x19')]);_0x5a9931['offset']=qs['offset'](_0x15225e[_0x2944('0x2d')][_0x2944('0x18')]);}_0x5a9931[_0x2944('0x36')]=qs[_0x2944('0x37')](_0x15225e[_0x2944('0x2d')][_0x2944('0x37')]);_0x5a9931[_0x2944('0x38')]=qs['filters'](_[_0x2944('0x39')](_0x15225e['query'],_0x5c38f7[_0x2944('0x2f')]),_0x575ce6);if(_0x15225e[_0x2944('0x2d')][_0x2944('0x3a')]){_0x5a9931[_0x2944('0x38')]=_[_0x2944('0x3b')](_0x5a9931[_0x2944('0x38')],{'$or':_[_0x2944('0x26')](_0x575ce6,function(_0x30a39c){if(_0x30a39c[_0x2944('0x2a')]!==_0x2944('0x3c')){var _0x4f1efc={};_0x4f1efc[_0x30a39c[_0x2944('0x23')]]={'$like':'%'+_0x15225e[_0x2944('0x2d')]['filter']+'%'};return _0x4f1efc;}})});}_0x5a9931=_[_0x2944('0x3b')]({},_0x5a9931,_0x15225e[_0x2944('0x3d')]);var _0x18b644={'where':_0x5a9931[_0x2944('0x38')]};return db[_0x2944('0x27')][_0x2944('0x1b')](_0x18b644)[_0x2944('0x20')](function(_0x38243a){_0x50cef7[_0x2944('0x1b')]=_0x38243a;if(_0x15225e[_0x2944('0x2d')][_0x2944('0x3e')]){_0x5a9931['include']=[{'all':!![]}];}return db[_0x2944('0x27')][_0x2944('0x3f')](_0x5a9931);})[_0x2944('0x20')](function(_0x513eba){_0x50cef7[_0x2944('0x40')]=_0x513eba;return _0x50cef7;})[_0x2944('0x20')](respondWithFilteredResult(_0xfe6be5,_0x5a9931))[_0x2944('0x41')](handleError(_0xfe6be5,null));};exports[_0x2944('0x42')]=function(_0x38d9d6,_0x3f133e){var _0x142eb9={'raw':![],'where':{'id':_0x38d9d6[_0x2944('0x43')]['id']}},_0x14812b={};_0x14812b['model']=_[_0x2944('0x2e')](db['SugarcrmConfiguration'][_0x2944('0x28')]);_0x14812b[_0x2944('0x2d')]=_['keys'](_0x38d9d6[_0x2944('0x2d')]);_0x14812b[_0x2944('0x2f')]=_['intersection'](_0x14812b[_0x2944('0x2c')],_0x14812b[_0x2944('0x2d')]);_0x142eb9[_0x2944('0x31')]=_[_0x2944('0x30')](_0x14812b[_0x2944('0x2c')],qs[_0x2944('0x32')](_0x38d9d6[_0x2944('0x2d')][_0x2944('0x32')]));_0x142eb9['attributes']=_0x142eb9[_0x2944('0x31')][_0x2944('0x33')]?_0x142eb9[_0x2944('0x31')]:_0x14812b[_0x2944('0x2c')];if(_0x38d9d6[_0x2944('0x2d')][_0x2944('0x3e')]){_0x142eb9[_0x2944('0x44')]=[{'all':!![]}];}_0x142eb9=_[_0x2944('0x3b')]({},_0x142eb9,_0x38d9d6[_0x2944('0x3d')]);return db[_0x2944('0x27')][_0x2944('0x45')](_0x142eb9)[_0x2944('0x20')](handleEntityNotFound(_0x3f133e,null))[_0x2944('0x20')](respondWithResult(_0x3f133e,null))[_0x2944('0x41')](handleError(_0x3f133e,null));};exports[_0x2944('0x46')]=function(_0x2e3b57,_0x5f4857){return db[_0x2944('0x27')][_0x2944('0x46')](_0x2e3b57[_0x2944('0x47')],{})[_0x2944('0x20')](respondWithResult(_0x5f4857,0xc9))[_0x2944('0x41')](handleError(_0x5f4857,null));};exports[_0x2944('0x1f')]=function(_0x4737c1,_0x37ad80){if(_0x4737c1[_0x2944('0x47')]['id']){delete _0x4737c1['body']['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x4737c1[_0x2944('0x43')]['id']}})[_0x2944('0x20')](handleEntityNotFound(_0x37ad80,null))[_0x2944('0x20')](saveUpdates(_0x4737c1[_0x2944('0x47')],null))[_0x2944('0x20')](respondWithResult(_0x37ad80,null))[_0x2944('0x41')](handleError(_0x37ad80,null));};exports[_0x2944('0x21')]=function(_0x4a5a78,_0x520151){return db['SugarcrmConfiguration'][_0x2944('0x45')]({'where':{'id':_0x4a5a78['params']['id']}})['then'](handleEntityNotFound(_0x520151,null))[_0x2944('0x20')](removeEntity(_0x520151,null))['catch'](handleError(_0x520151,null));};exports[_0x2944('0x48')]=function(_0x535266,_0x5497e8,_0x2508af){var _0x423154={};var _0x87f32d={};var _0xd07427;var _0x2a8084;return db[_0x2944('0x27')]['findOne']({'where':{'id':_0x535266[_0x2944('0x43')]['id']}})[_0x2944('0x20')](handleEntityNotFound(_0x5497e8,null))[_0x2944('0x20')](function(_0x4f6bf7){if(_0x4f6bf7){_0xd07427=_0x4f6bf7;_0x87f32d[_0x2944('0x2c')]=_['keys'](db[_0x2944('0x49')][_0x2944('0x28')]);_0x87f32d[_0x2944('0x2d')]=_[_0x2944('0x2e')](_0x535266['query']);_0x87f32d[_0x2944('0x2f')]=_[_0x2944('0x30')](_0x87f32d[_0x2944('0x2c')],_0x87f32d[_0x2944('0x2d')]);_0x423154['attributes']=_[_0x2944('0x30')](_0x87f32d[_0x2944('0x2c')],qs[_0x2944('0x32')](_0x535266[_0x2944('0x2d')][_0x2944('0x32')]));_0x423154[_0x2944('0x31')]=_0x423154[_0x2944('0x31')][_0x2944('0x33')]?_0x423154[_0x2944('0x31')]:_0x87f32d[_0x2944('0x2c')];_0x423154[_0x2944('0x36')]=qs['sort'](_0x535266[_0x2944('0x2d')]['sort']);_0x423154['where']=qs['filters'](_['pick'](_0x535266[_0x2944('0x2d')],_0x87f32d['filters']));if(_0x535266[_0x2944('0x2d')][_0x2944('0x3a')]){_0x423154['where']=_[_0x2944('0x3b')](_0x423154[_0x2944('0x38')],{'$or':_['map'](_0x423154[_0x2944('0x31')],function(_0x30373e){var _0x273e5e={};_0x273e5e[_0x30373e]={'$like':'%'+_0x535266[_0x2944('0x2d')]['filter']+'%'};return _0x273e5e;})});}_0x423154=_['merge']({},_0x423154,_0x535266[_0x2944('0x3d')]);return _0xd07427[_0x2944('0x48')](_0x423154);}})[_0x2944('0x20')](function(_0x54d4b7){if(_0x54d4b7){_0x2a8084=_0x54d4b7[_0x2944('0x33')];if(!_0x535266[_0x2944('0x2d')][_0x2944('0x34')](_0x2944('0x35'))){_0x423154['limit']=qs[_0x2944('0x19')](_0x535266['query'][_0x2944('0x19')]);_0x423154[_0x2944('0x18')]=qs[_0x2944('0x18')](_0x535266[_0x2944('0x2d')][_0x2944('0x18')]);}return _0xd07427[_0x2944('0x48')](_0x423154);}})[_0x2944('0x20')](function(_0x20ded5){if(_0x20ded5){return _0x20ded5?{'count':_0x2a8084,'rows':_0x20ded5}:null;}})[_0x2944('0x20')](respondWithResult(_0x5497e8,null))['catch'](handleError(_0x5497e8,null));};exports[_0x2944('0x4a')]=function(_0x1dfb17,_0x1aa4a9,_0x2beeb6){var _0x259a5c={};var _0x2ad602={};var _0x49865f;var _0x1237fe;return db[_0x2944('0x27')][_0x2944('0x4b')]({'where':{'id':_0x1dfb17['params']['id']}})[_0x2944('0x20')](handleEntityNotFound(_0x1aa4a9,null))['then'](function(_0x67c7cc){if(_0x67c7cc){_0x49865f=_0x67c7cc;_0x2ad602['model']=_[_0x2944('0x2e')](db['SugarcrmField'][_0x2944('0x28')]);_0x2ad602[_0x2944('0x2d')]=_[_0x2944('0x2e')](_0x1dfb17['query']);_0x2ad602[_0x2944('0x2f')]=_['intersection'](_0x2ad602[_0x2944('0x2c')],_0x2ad602['query']);_0x259a5c[_0x2944('0x31')]=_[_0x2944('0x30')](_0x2ad602[_0x2944('0x2c')],qs['fields'](_0x1dfb17['query'][_0x2944('0x32')]));_0x259a5c[_0x2944('0x31')]=_0x259a5c[_0x2944('0x31')][_0x2944('0x33')]?_0x259a5c[_0x2944('0x31')]:_0x2ad602[_0x2944('0x2c')];_0x259a5c[_0x2944('0x36')]=qs[_0x2944('0x37')](_0x1dfb17[_0x2944('0x2d')][_0x2944('0x37')]);_0x259a5c[_0x2944('0x38')]=qs[_0x2944('0x2f')](_[_0x2944('0x39')](_0x1dfb17[_0x2944('0x2d')],_0x2ad602[_0x2944('0x2f')]));if(_0x1dfb17[_0x2944('0x2d')][_0x2944('0x3a')]){_0x259a5c['where']=_[_0x2944('0x3b')](_0x259a5c['where'],{'$or':_[_0x2944('0x26')](_0x259a5c['attributes'],function(_0x299ebd){var _0x3dc317={};_0x3dc317[_0x299ebd]={'$like':'%'+_0x1dfb17['query'][_0x2944('0x3a')]+'%'};return _0x3dc317;})});}_0x259a5c=_[_0x2944('0x3b')]({},_0x259a5c,_0x1dfb17['options']);return _0x49865f['getSubjects'](_0x259a5c);}})[_0x2944('0x20')](function(_0x5af6ab){if(_0x5af6ab){_0x1237fe=_0x5af6ab[_0x2944('0x33')];if(!_0x1dfb17['query'][_0x2944('0x34')]('nolimit')){_0x259a5c[_0x2944('0x19')]=qs[_0x2944('0x19')](_0x1dfb17[_0x2944('0x2d')][_0x2944('0x19')]);_0x259a5c['offset']=qs['offset'](_0x1dfb17[_0x2944('0x2d')][_0x2944('0x18')]);}return _0x49865f[_0x2944('0x4a')](_0x259a5c);}})[_0x2944('0x20')](function(_0x152263){if(_0x152263){return _0x152263?{'count':_0x1237fe,'rows':_0x152263}:null;}})[_0x2944('0x20')](respondWithResult(_0x1aa4a9,null))[_0x2944('0x41')](handleError(_0x1aa4a9,null));};exports['getDescriptions']=function(_0x5eff2c,_0x151330,_0x450086){var _0x1651ff={};var _0x3dfa78={};var _0x38441a;var _0xab3dfc;return db[_0x2944('0x27')]['findOne']({'where':{'id':_0x5eff2c[_0x2944('0x43')]['id']}})[_0x2944('0x20')](handleEntityNotFound(_0x151330,null))[_0x2944('0x20')](function(_0x142df1){if(_0x142df1){_0x38441a=_0x142df1;_0x3dfa78[_0x2944('0x2c')]=_[_0x2944('0x2e')](db[_0x2944('0x49')][_0x2944('0x28')]);_0x3dfa78['query']=_[_0x2944('0x2e')](_0x5eff2c[_0x2944('0x2d')]);_0x3dfa78['filters']=_[_0x2944('0x30')](_0x3dfa78[_0x2944('0x2c')],_0x3dfa78[_0x2944('0x2d')]);_0x1651ff[_0x2944('0x31')]=_[_0x2944('0x30')](_0x3dfa78[_0x2944('0x2c')],qs[_0x2944('0x32')](_0x5eff2c[_0x2944('0x2d')][_0x2944('0x32')]));_0x1651ff[_0x2944('0x31')]=_0x1651ff[_0x2944('0x31')][_0x2944('0x33')]?_0x1651ff['attributes']:_0x3dfa78[_0x2944('0x2c')];_0x1651ff['order']=qs[_0x2944('0x37')](_0x5eff2c[_0x2944('0x2d')][_0x2944('0x37')]);_0x1651ff['where']=qs[_0x2944('0x2f')](_[_0x2944('0x39')](_0x5eff2c[_0x2944('0x2d')],_0x3dfa78[_0x2944('0x2f')]));if(_0x5eff2c['query'][_0x2944('0x3a')]){_0x1651ff[_0x2944('0x38')]=_[_0x2944('0x3b')](_0x1651ff[_0x2944('0x38')],{'$or':_[_0x2944('0x26')](_0x1651ff['attributes'],function(_0x4cf209){var _0x35d359={};_0x35d359[_0x4cf209]={'$like':'%'+_0x5eff2c[_0x2944('0x2d')][_0x2944('0x3a')]+'%'};return _0x35d359;})});}_0x1651ff=_[_0x2944('0x3b')]({},_0x1651ff,_0x5eff2c['options']);return _0x38441a[_0x2944('0x4c')](_0x1651ff);}})['then'](function(_0x321202){if(_0x321202){_0xab3dfc=_0x321202[_0x2944('0x33')];if(!_0x5eff2c['query'][_0x2944('0x34')]('nolimit')){_0x1651ff[_0x2944('0x19')]=qs[_0x2944('0x19')](_0x5eff2c[_0x2944('0x2d')][_0x2944('0x19')]);_0x1651ff[_0x2944('0x18')]=qs[_0x2944('0x18')](_0x5eff2c[_0x2944('0x2d')][_0x2944('0x18')]);}return _0x38441a[_0x2944('0x4c')](_0x1651ff);}})[_0x2944('0x20')](function(_0x22b68f){if(_0x22b68f){return _0x22b68f?{'count':_0xab3dfc,'rows':_0x22b68f}:null;}})[_0x2944('0x20')](respondWithResult(_0x151330,null))[_0x2944('0x41')](handleError(_0x151330,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 8b9c1a2..2a95b7c 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 _0xa61f=['api','moment','bluebird','request-promise','path','./intSugarcrmConfiguration.attributes','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa61f,0x110));var _0xfa61=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xa61f[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xfa61('0x0'));var util=require(_0xfa61('0x1'));var logger=require(_0xfa61('0x2'))(_0xfa61('0x3'));var moment=require(_0xfa61('0x4'));var BPromise=require(_0xfa61('0x5'));var rp=require(_0xfa61('0x6'));var fs=require('fs');var path=require(_0xfa61('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfa61('0x8'));module['exports']=function(_0x5d9409,_0x2bccea){return _0x5d9409['define'](_0xfa61('0x9'),attributes,{'tableName':_0xfa61('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf699=['exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1b2bd2,_0x491f68){var _0x34a271=function(_0x6036d){while(--_0x6036d){_0x1b2bd2['push'](_0x1b2bd2['shift']());}};_0x34a271(++_0x491f68);}(_0xf699,0x14e));var _0x9f69=function(_0xf4fee8,_0x5951ce){_0xf4fee8=_0xf4fee8-0x0;var _0x1303d7=_0xf699[_0xf4fee8];return _0x1303d7;};'use strict';var _=require(_0x9f69('0x0'));var util=require('util');var logger=require(_0x9f69('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9f69('0x2'));var rp=require(_0x9f69('0x3'));var fs=require('fs');var path=require(_0x9f69('0x4'));var rimraf=require(_0x9f69('0x5'));var config=require(_0x9f69('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x9f69('0x7')]=function(_0x2d569a,_0x53cd33){return _0x2d569a[_0x9f69('0x8')](_0x9f69('0x9'),attributes,{'tableName':_0x9f69('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 dfa591b..31598ff 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 _0x6a6a=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x6a6a,0x139));var _0xa6a6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6a6a[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa6a6('0x0'));var moment=require('moment');var BPromise=require(_0xa6a6('0x1'));var rs=require(_0xa6a6('0x2'));var fs=require('fs');var Redis=require(_0xa6a6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa6a6('0x4'))(_0xa6a6('0x5'));var config=require('../../config/environment');var jayson=require(_0xa6a6('0x6'));var client=jayson[_0xa6a6('0x7')][_0xa6a6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5cb0ac,_0xba9d86,_0x312b03){return new BPromise(function(_0x8c9bdf,_0x2fbe2f){return client[_0xa6a6('0x9')](_0x5cb0ac,_0x312b03)[_0xa6a6('0xa')](function(_0x48e652){logger[_0xa6a6('0xb')](_0xa6a6('0xc'),_0xba9d86,_0xa6a6('0xd'));logger[_0xa6a6('0xe')](_0xa6a6('0xf'),_0xba9d86,_0xa6a6('0xd'),JSON[_0xa6a6('0x10')](_0x48e652));if(_0x48e652[_0xa6a6('0x11')]){if(_0x48e652[_0xa6a6('0x11')][_0xa6a6('0x12')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0xba9d86,_0x48e652[_0xa6a6('0x11')][_0xa6a6('0x13')]);return _0x2fbe2f(_0x48e652[_0xa6a6('0x11')]['message']);}logger[_0xa6a6('0x11')](_0xa6a6('0xc'),_0xba9d86,_0x48e652[_0xa6a6('0x11')][_0xa6a6('0x13')]);return _0x8c9bdf(_0x48e652['error'][_0xa6a6('0x13')]);}else{logger[_0xa6a6('0xb')](_0xa6a6('0xc'),_0xba9d86,'request\x20sent');_0x8c9bdf(_0x48e652[_0xa6a6('0x14')][_0xa6a6('0x13')]);}})['catch'](function(_0x369699){logger[_0xa6a6('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xba9d86,_0x369699);_0x2fbe2f(_0x369699);});});} \ No newline at end of file +var _0x2773=['info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0x2773,0x108));var _0x3277=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2773[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x3277('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3277('0x1'))['db'];var utils=require(_0x3277('0x2'));var logger=require(_0x3277('0x3'))(_0x3277('0x4'));var config=require(_0x3277('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3f10b4,_0x5a74ca,_0x1e09cb){return new BPromise(function(_0x3d3941,_0x4ca374){return client[_0x3277('0x6')](_0x3f10b4,_0x1e09cb)[_0x3277('0x7')](function(_0x4560f0){logger[_0x3277('0x8')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5a74ca,'request\x20sent');logger[_0x3277('0x9')](_0x3277('0xa'),_0x5a74ca,_0x3277('0xb'),JSON[_0x3277('0xc')](_0x4560f0));if(_0x4560f0[_0x3277('0xd')]){if(_0x4560f0[_0x3277('0xd')]['code']===0x1f4){logger[_0x3277('0xd')](_0x3277('0xe'),_0x5a74ca,_0x4560f0[_0x3277('0xd')][_0x3277('0xf')]);return _0x4ca374(_0x4560f0[_0x3277('0xd')][_0x3277('0xf')]);}logger[_0x3277('0xd')](_0x3277('0xe'),_0x5a74ca,_0x4560f0[_0x3277('0xd')][_0x3277('0xf')]);return _0x3d3941(_0x4560f0[_0x3277('0xd')][_0x3277('0xf')]);}else{logger[_0x3277('0x8')](_0x3277('0xe'),_0x5a74ca,'request\x20sent');_0x3d3941(_0x4560f0['result'][_0x3277('0xf')]);}})['catch'](function(_0x1c8fa2){logger[_0x3277('0xd')](_0x3277('0xe'),_0x5a74ca,_0x1c8fa2);_0x4ca374(_0x1c8fa2);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 89c0f67..a3a65ab 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 _0x89da=['isAuthenticated','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','index','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x89da,0x18c));var _0xa89d=function(_0x3c7243,_0x79d095){_0x3c7243=_0x3c7243-0x0;var _0x1dcc42=_0x89da[_0x3c7243];return _0x1dcc42;};'use strict';var multer=require('multer');var util=require(_0xa89d('0x0'));var path=require('path');var timeout=require(_0xa89d('0x1'));var express=require(_0xa89d('0x2'));var router=express[_0xa89d('0x3')]();var fs_extra=require(_0xa89d('0x4'));var auth=require(_0xa89d('0x5'));var interaction=require(_0xa89d('0x6'));var config=require('../../config/environment');var controller=require(_0xa89d('0x7'));router[_0xa89d('0x8')]('/',auth['isAuthenticated'](),controller[_0xa89d('0x9')]);router[_0xa89d('0x8')](_0xa89d('0xa'),auth['isAuthenticated'](),controller[_0xa89d('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa89d('0xa'),auth[_0xa89d('0xc')](),controller[_0xa89d('0xd')]);router[_0xa89d('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xa89d('0xf')]);module[_0xa89d('0x10')]=router; \ No newline at end of file +var _0x1c47=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x314a2e,_0x2d4f9d){var _0x3f3fc2=function(_0x1d47c7){while(--_0x1d47c7){_0x314a2e['push'](_0x314a2e['shift']());}};_0x3f3fc2(++_0x2d4f9d);}(_0x1c47,0x1c3));var _0x71c4=function(_0x4cce65,_0x40021e){_0x4cce65=_0x4cce65-0x0;var _0x4d1b45=_0x1c47[_0x4cce65];return _0x4d1b45;};'use strict';var multer=require(_0x71c4('0x0'));var util=require(_0x71c4('0x1'));var path=require(_0x71c4('0x2'));var timeout=require(_0x71c4('0x3'));var express=require(_0x71c4('0x4'));var router=express[_0x71c4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x71c4('0x6'));var interaction=require(_0x71c4('0x7'));var config=require(_0x71c4('0x8'));var controller=require(_0x71c4('0x9'));router['get']('/',auth[_0x71c4('0xa')](),controller[_0x71c4('0xb')]);router['get'](_0x71c4('0xc'),auth[_0x71c4('0xa')](),controller[_0x71c4('0xd')]);router['post']('/',auth[_0x71c4('0xa')](),controller[_0x71c4('0xe')]);router[_0x71c4('0xf')](_0x71c4('0xc'),auth[_0x71c4('0xa')](),controller[_0x71c4('0x10')]);router[_0x71c4('0x11')](_0x71c4('0xc'),auth[_0x71c4('0xa')](),controller[_0x71c4('0x12')]);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 fa1ee35..16dc179 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 _0x831f=['STRING','sequelize','exports','ENUM','string','variable','keyValue','picklist'];(function(_0x2ce6d5,_0x333e0c){var _0x32d272=function(_0x399f0b){while(--_0x399f0b){_0x2ce6d5['push'](_0x2ce6d5['shift']());}};_0x32d272(++_0x333e0c);}(_0x831f,0x109));var _0xf831=function(_0x4fcd21,_0x3b4148){_0x4fcd21=_0x4fcd21-0x0;var _0x3af7b8=_0x831f[_0x4fcd21];return _0x3af7b8;};'use strict';var Sequelize=require(_0xf831('0x0'));module[_0xf831('0x1')]={'type':{'type':Sequelize[_0xf831('0x2')](_0xf831('0x3'),_0xf831('0x4'),'customVariable',_0xf831('0x5'),_0xf831('0x6')),'defaultValue':_0xf831('0x3')},'content':{'type':Sequelize[_0xf831('0x7')]},'key':{'type':Sequelize[_0xf831('0x7')]},'keyType':{'type':Sequelize[_0xf831('0x2')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0xf831('0x7')]},'idField':{'type':Sequelize[_0xf831('0x7')]},'nameField':{'type':Sequelize[_0xf831('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf831('0x7')]}}; \ No newline at end of file +var _0xdaa9=['ENUM','string','variable','customVariable','STRING','BOOLEAN','sequelize','exports'];(function(_0x1f01f8,_0xe249c5){var _0x31ea67=function(_0x5e05b5){while(--_0x5e05b5){_0x1f01f8['push'](_0x1f01f8['shift']());}};_0x31ea67(++_0xe249c5);}(_0xdaa9,0x196));var _0x9daa=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdaa9[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x9daa('0x0'));module[_0x9daa('0x1')]={'type':{'type':Sequelize[_0x9daa('0x2')](_0x9daa('0x3'),_0x9daa('0x4'),_0x9daa('0x5'),'keyValue','picklist'),'defaultValue':_0x9daa('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9daa('0x2')](_0x9daa('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x9daa('0x6')]},'idField':{'type':Sequelize[_0x9daa('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9daa('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9daa('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index aee5212..b5dd26f 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 _0x4b6d=['type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','options','find','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SugarcrmField','rawAttributes'];(function(_0x7752f6,_0x161622){var _0x53883c=function(_0x1be7ab){while(--_0x1be7ab){_0x7752f6['push'](_0x7752f6['shift']());}};_0x53883c(++_0x161622);}(_0x4b6d,0x1c6));var _0xd4b6=function(_0x381064,_0x5503d6){_0x381064=_0x381064-0x0;var _0x26af5e=_0x4b6d[_0x381064];return _0x26af5e;};'use strict';var emlformat=require(_0xd4b6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd4b6('0x1'));var jsonpatch=require(_0xd4b6('0x2'));var rp=require(_0xd4b6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd4b6('0x4'));var util=require(_0xd4b6('0x5'));var path=require(_0xd4b6('0x6'));var sox=require(_0xd4b6('0x7'));var csv=require(_0xd4b6('0x8'));var ejs=require(_0xd4b6('0x9'));var fs=require('fs');var fs_extra=require(_0xd4b6('0xa'));var _=require(_0xd4b6('0xb'));var squel=require('squel');var crypto=require(_0xd4b6('0xc'));var jsforce=require(_0xd4b6('0xd'));var deskjs=require(_0xd4b6('0xe'));var toCsv=require(_0xd4b6('0x8'));var querystring=require('querystring');var Papa=require(_0xd4b6('0xf'));var Redis=require('ioredis');var authService=require(_0xd4b6('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd4b6('0x11'));var logger=require(_0xd4b6('0x12'))(_0xd4b6('0x13'));var utils=require(_0xd4b6('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38a440,_0x274166){_0x274166=_0x274166||0xcc;return function(_0x1cdd50){if(_0x1cdd50){return _0x38a440[_0xd4b6('0x15')](_0x274166);}return _0x38a440[_0xd4b6('0x16')](_0x274166)['end']();};}function respondWithResult(_0xef98b1,_0x4bcb65){_0x4bcb65=_0x4bcb65||0xc8;return function(_0xaff36f){if(_0xaff36f){return _0xef98b1['status'](_0x4bcb65)[_0xd4b6('0x17')](_0xaff36f);}};}function respondWithFilteredResult(_0x2ea8d9,_0x3b3ec0){return function(_0x59b928){if(_0x59b928){var _0x2955ef=typeof _0x3b3ec0[_0xd4b6('0x18')]===_0xd4b6('0x19')&&typeof _0x3b3ec0[_0xd4b6('0x1a')]===_0xd4b6('0x19');var _0x26cbf2=_0x59b928[_0xd4b6('0x1b')];var _0x5cd60a=_0x2955ef?0x0:_0x3b3ec0[_0xd4b6('0x18')];var _0x29c8a3=_0x2955ef?_0x59b928['count']:_0x3b3ec0[_0xd4b6('0x18')]+_0x3b3ec0['limit'];var _0x35663e;if(_0x29c8a3>=_0x26cbf2){_0x29c8a3=_0x26cbf2;_0x35663e=0xc8;}else{_0x35663e=0xce;}_0x2ea8d9[_0xd4b6('0x16')](_0x35663e);return _0x2ea8d9['set'](_0xd4b6('0x1c'),_0x5cd60a+'-'+_0x29c8a3+'/'+_0x26cbf2)['json'](_0x59b928);}return null;};}function patchUpdates(_0x3ae23e){return function(_0x39576f){try{jsonpatch['apply'](_0x39576f,_0x3ae23e,!![]);}catch(_0x6e372f){return BPromise[_0xd4b6('0x1d')](_0x6e372f);}return _0x39576f[_0xd4b6('0x1e')]();};}function saveUpdates(_0x5959a6,_0xeefb30){return function(_0x373583){if(_0x373583){return _0x373583[_0xd4b6('0x1f')](_0x5959a6)[_0xd4b6('0x20')](function(_0x35c63a){return _0x35c63a;});}return null;};}function removeEntity(_0x2a8792,_0x3f26eb){return function(_0x48b473){if(_0x48b473){return _0x48b473[_0xd4b6('0x21')]()['then'](function(){_0x2a8792['status'](0xcc)[_0xd4b6('0x22')]();});}};}function handleEntityNotFound(_0x5436d3,_0x47960){return function(_0x5b52e9){if(!_0x5b52e9){_0x5436d3[_0xd4b6('0x15')](0x194);}return _0x5b52e9;};}function handleError(_0x2fad66,_0x234c1a){_0x234c1a=_0x234c1a||0x1f4;return function(_0x4904e9){logger[_0xd4b6('0x23')](_0x4904e9[_0xd4b6('0x24')]);if(_0x4904e9['name']){delete _0x4904e9[_0xd4b6('0x25')];}_0x2fad66[_0xd4b6('0x16')](_0x234c1a)[_0xd4b6('0x26')](_0x4904e9);};}exports[_0xd4b6('0x27')]=function(_0x2c3e94,_0x52bcf6){var _0x187d1a={},_0x6992d7={},_0x315860={'count':0x0,'rows':[]};var _0x4aa29d=_[_0xd4b6('0x28')](db[_0xd4b6('0x29')][_0xd4b6('0x2a')],function(_0x28a549){return{'name':_0x28a549['fieldName'],'type':_0x28a549[_0xd4b6('0x2b')][_0xd4b6('0x2c')]};});_0x6992d7['model']=_[_0xd4b6('0x28')](_0x4aa29d,_0xd4b6('0x25'));_0x6992d7['query']=_[_0xd4b6('0x2d')](_0x2c3e94[_0xd4b6('0x2e')]);_0x6992d7[_0xd4b6('0x2f')]=_['intersection'](_0x6992d7[_0xd4b6('0x30')],_0x6992d7['query']);_0x187d1a[_0xd4b6('0x31')]=_[_0xd4b6('0x32')](_0x6992d7[_0xd4b6('0x30')],qs[_0xd4b6('0x33')](_0x2c3e94[_0xd4b6('0x2e')]['fields']));_0x187d1a[_0xd4b6('0x31')]=_0x187d1a['attributes'][_0xd4b6('0x34')]?_0x187d1a['attributes']:_0x6992d7[_0xd4b6('0x30')];if(!_0x2c3e94[_0xd4b6('0x2e')][_0xd4b6('0x35')](_0xd4b6('0x36'))){_0x187d1a[_0xd4b6('0x1a')]=qs['limit'](_0x2c3e94[_0xd4b6('0x2e')][_0xd4b6('0x1a')]);_0x187d1a[_0xd4b6('0x18')]=qs[_0xd4b6('0x18')](_0x2c3e94[_0xd4b6('0x2e')]['offset']);}_0x187d1a[_0xd4b6('0x37')]=qs[_0xd4b6('0x38')](_0x2c3e94[_0xd4b6('0x2e')][_0xd4b6('0x38')]);_0x187d1a[_0xd4b6('0x39')]=qs[_0xd4b6('0x2f')](_[_0xd4b6('0x3a')](_0x2c3e94[_0xd4b6('0x2e')],_0x6992d7[_0xd4b6('0x2f')]),_0x4aa29d);if(_0x2c3e94[_0xd4b6('0x2e')][_0xd4b6('0x3b')]){_0x187d1a[_0xd4b6('0x39')]=_[_0xd4b6('0x3c')](_0x187d1a['where'],{'$or':_['map'](_0x4aa29d,function(_0x2dac49){if(_0x2dac49[_0xd4b6('0x2b')]!==_0xd4b6('0x3d')){var _0x112134={};_0x112134[_0x2dac49[_0xd4b6('0x25')]]={'$like':'%'+_0x2c3e94['query'][_0xd4b6('0x3b')]+'%'};return _0x112134;}})});}_0x187d1a=_['merge']({},_0x187d1a,_0x2c3e94['options']);var _0x1bbd5e={'where':_0x187d1a[_0xd4b6('0x39')]};return db[_0xd4b6('0x29')][_0xd4b6('0x1b')](_0x1bbd5e)[_0xd4b6('0x20')](function(_0x224594){_0x315860[_0xd4b6('0x1b')]=_0x224594;if(_0x2c3e94[_0xd4b6('0x2e')][_0xd4b6('0x3e')]){_0x187d1a[_0xd4b6('0x3f')]=[{'all':!![]}];}return db['SugarcrmField'][_0xd4b6('0x40')](_0x187d1a);})[_0xd4b6('0x20')](function(_0x248569){_0x315860['rows']=_0x248569;return _0x315860;})['then'](respondWithFilteredResult(_0x52bcf6,_0x187d1a))['catch'](handleError(_0x52bcf6,null));};exports[_0xd4b6('0x41')]=function(_0x3fc4fb,_0x1ddf3c){var _0x2f6a89={'raw':!![],'where':{'id':_0x3fc4fb[_0xd4b6('0x42')]['id']}},_0x2b9d15={};_0x2b9d15[_0xd4b6('0x30')]=_[_0xd4b6('0x2d')](db[_0xd4b6('0x29')][_0xd4b6('0x2a')]);_0x2b9d15[_0xd4b6('0x2e')]=_[_0xd4b6('0x2d')](_0x3fc4fb['query']);_0x2b9d15[_0xd4b6('0x2f')]=_[_0xd4b6('0x32')](_0x2b9d15[_0xd4b6('0x30')],_0x2b9d15[_0xd4b6('0x2e')]);_0x2f6a89['attributes']=_['intersection'](_0x2b9d15[_0xd4b6('0x30')],qs['fields'](_0x3fc4fb[_0xd4b6('0x2e')]['fields']));_0x2f6a89[_0xd4b6('0x31')]=_0x2f6a89[_0xd4b6('0x31')]['length']?_0x2f6a89[_0xd4b6('0x31')]:_0x2b9d15[_0xd4b6('0x30')];if(_0x3fc4fb[_0xd4b6('0x2e')]['includeAll']){_0x2f6a89[_0xd4b6('0x3f')]=[{'all':!![]}];}_0x2f6a89=_[_0xd4b6('0x3c')]({},_0x2f6a89,_0x3fc4fb[_0xd4b6('0x43')]);return db[_0xd4b6('0x29')][_0xd4b6('0x44')](_0x2f6a89)[_0xd4b6('0x20')](handleEntityNotFound(_0x1ddf3c,null))[_0xd4b6('0x20')](respondWithResult(_0x1ddf3c,null))[_0xd4b6('0x45')](handleError(_0x1ddf3c,null));};exports['create']=function(_0x5e5358,_0x3e9be4){return db['SugarcrmField']['create'](_0x5e5358[_0xd4b6('0x46')],{})[_0xd4b6('0x20')](respondWithResult(_0x3e9be4,0xc9))[_0xd4b6('0x45')](handleError(_0x3e9be4,null));};exports[_0xd4b6('0x1f')]=function(_0x51043a,_0x59cda9){if(_0x51043a[_0xd4b6('0x46')]['id']){delete _0x51043a[_0xd4b6('0x46')]['id'];}return db[_0xd4b6('0x29')][_0xd4b6('0x44')]({'where':{'id':_0x51043a[_0xd4b6('0x42')]['id']}})[_0xd4b6('0x20')](handleEntityNotFound(_0x59cda9,null))['then'](saveUpdates(_0x51043a[_0xd4b6('0x46')],null))['then'](respondWithResult(_0x59cda9,null))[_0xd4b6('0x45')](handleError(_0x59cda9,null));};exports[_0xd4b6('0x21')]=function(_0x1b89f6,_0x17f91e){return db['SugarcrmField'][_0xd4b6('0x44')]({'where':{'id':_0x1b89f6['params']['id']}})[_0xd4b6('0x20')](handleEntityNotFound(_0x17f91e,null))[_0xd4b6('0x20')](removeEntity(_0x17f91e,null))[_0xd4b6('0x45')](handleError(_0x17f91e,null));}; \ No newline at end of file +var _0x8a60=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','SugarcrmField','findAll','rows','catch','show','find','create','body','update','params','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x3c051c,_0x326acd){var _0x4b7daa=function(_0x24592a){while(--_0x24592a){_0x3c051c['push'](_0x3c051c['shift']());}};_0x4b7daa(++_0x326acd);}(_0x8a60,0x137));var _0x08a6=function(_0x2474ac,_0x335d3a){_0x2474ac=_0x2474ac-0x0;var _0x384a8f=_0x8a60[_0x2474ac];return _0x384a8f;};'use strict';var emlformat=require(_0x08a6('0x0'));var rimraf=require(_0x08a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x08a6('0x2'));var rp=require(_0x08a6('0x3'));var moment=require(_0x08a6('0x4'));var BPromise=require(_0x08a6('0x5'));var Mustache=require(_0x08a6('0x6'));var util=require(_0x08a6('0x7'));var path=require(_0x08a6('0x8'));var sox=require(_0x08a6('0x9'));var csv=require(_0x08a6('0xa'));var ejs=require(_0x08a6('0xb'));var fs=require('fs');var fs_extra=require(_0x08a6('0xc'));var _=require(_0x08a6('0xd'));var squel=require(_0x08a6('0xe'));var crypto=require(_0x08a6('0xf'));var jsforce=require(_0x08a6('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x08a6('0xa'));var querystring=require(_0x08a6('0x11'));var Papa=require('papaparse');var Redis=require(_0x08a6('0x12'));var authService=require(_0x08a6('0x13'));var qs=require(_0x08a6('0x14'));var as=require(_0x08a6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x08a6('0x16'))('api');var utils=require(_0x08a6('0x17'));var config=require(_0x08a6('0x18'));var licenseUtil=require(_0x08a6('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x351f3c,_0x21f4e3){_0x21f4e3=_0x21f4e3||0xcc;return function(_0x339c17){if(_0x339c17){return _0x351f3c[_0x08a6('0x1a')](_0x21f4e3);}return _0x351f3c[_0x08a6('0x1b')](_0x21f4e3)[_0x08a6('0x1c')]();};}function respondWithResult(_0x448246,_0x1898c4){_0x1898c4=_0x1898c4||0xc8;return function(_0x18ab2c){if(_0x18ab2c){return _0x448246[_0x08a6('0x1b')](_0x1898c4)[_0x08a6('0x1d')](_0x18ab2c);}};}function respondWithFilteredResult(_0x8cd7fc,_0x16f5bd){return function(_0x145212){if(_0x145212){var _0x356f62=typeof _0x16f5bd['offset']===_0x08a6('0x1e')&&typeof _0x16f5bd[_0x08a6('0x1f')]===_0x08a6('0x1e');var _0x24568b=_0x145212[_0x08a6('0x20')];var _0x2a0d89=_0x356f62?0x0:_0x16f5bd['offset'];var _0x4d3f8d=_0x356f62?_0x145212[_0x08a6('0x20')]:_0x16f5bd[_0x08a6('0x21')]+_0x16f5bd[_0x08a6('0x1f')];var _0x536acb;if(_0x4d3f8d>=_0x24568b){_0x4d3f8d=_0x24568b;_0x536acb=0xc8;}else{_0x536acb=0xce;}_0x8cd7fc[_0x08a6('0x1b')](_0x536acb);return _0x8cd7fc[_0x08a6('0x22')](_0x08a6('0x23'),_0x2a0d89+'-'+_0x4d3f8d+'/'+_0x24568b)[_0x08a6('0x1d')](_0x145212);}return null;};}function patchUpdates(_0x376c26){return function(_0x5f4add){try{jsonpatch[_0x08a6('0x24')](_0x5f4add,_0x376c26,!![]);}catch(_0x45d2ab){return BPromise[_0x08a6('0x25')](_0x45d2ab);}return _0x5f4add[_0x08a6('0x26')]();};}function saveUpdates(_0x1c673c,_0x478753){return function(_0x4d98f3){if(_0x4d98f3){return _0x4d98f3['update'](_0x1c673c)[_0x08a6('0x27')](function(_0x186c26){return _0x186c26;});}return null;};}function removeEntity(_0xf20f90,_0xe7a9d7){return function(_0x3e59e4){if(_0x3e59e4){return _0x3e59e4[_0x08a6('0x28')]()[_0x08a6('0x27')](function(){_0xf20f90[_0x08a6('0x1b')](0xcc)[_0x08a6('0x1c')]();});}};}function handleEntityNotFound(_0x3f4301,_0x1e3b58){return function(_0x1709fe){if(!_0x1709fe){_0x3f4301[_0x08a6('0x1a')](0x194);}return _0x1709fe;};}function handleError(_0x20e7df,_0x257a4a){_0x257a4a=_0x257a4a||0x1f4;return function(_0x3aaafe){logger[_0x08a6('0x29')](_0x3aaafe[_0x08a6('0x2a')]);if(_0x3aaafe[_0x08a6('0x2b')]){delete _0x3aaafe[_0x08a6('0x2b')];}_0x20e7df[_0x08a6('0x1b')](_0x257a4a)[_0x08a6('0x2c')](_0x3aaafe);};}exports[_0x08a6('0x2d')]=function(_0x5eb2b1,_0x1397c2){var _0x8685a9={},_0x4d1484={},_0x4a0785={'count':0x0,'rows':[]};var _0x4c1d45=_[_0x08a6('0x2e')](db['SugarcrmField'][_0x08a6('0x2f')],function(_0x508b50){return{'name':_0x508b50[_0x08a6('0x30')],'type':_0x508b50[_0x08a6('0x31')][_0x08a6('0x32')]};});_0x4d1484[_0x08a6('0x33')]=_['map'](_0x4c1d45,_0x08a6('0x2b'));_0x4d1484[_0x08a6('0x34')]=_[_0x08a6('0x35')](_0x5eb2b1[_0x08a6('0x34')]);_0x4d1484['filters']=_[_0x08a6('0x36')](_0x4d1484['model'],_0x4d1484[_0x08a6('0x34')]);_0x8685a9['attributes']=_[_0x08a6('0x36')](_0x4d1484['model'],qs[_0x08a6('0x37')](_0x5eb2b1['query']['fields']));_0x8685a9['attributes']=_0x8685a9['attributes'][_0x08a6('0x38')]?_0x8685a9[_0x08a6('0x39')]:_0x4d1484[_0x08a6('0x33')];if(!_0x5eb2b1[_0x08a6('0x34')][_0x08a6('0x3a')]('nolimit')){_0x8685a9[_0x08a6('0x1f')]=qs[_0x08a6('0x1f')](_0x5eb2b1[_0x08a6('0x34')][_0x08a6('0x1f')]);_0x8685a9[_0x08a6('0x21')]=qs[_0x08a6('0x21')](_0x5eb2b1[_0x08a6('0x34')][_0x08a6('0x21')]);}_0x8685a9[_0x08a6('0x3b')]=qs[_0x08a6('0x3c')](_0x5eb2b1[_0x08a6('0x34')]['sort']);_0x8685a9[_0x08a6('0x3d')]=qs[_0x08a6('0x3e')](_['pick'](_0x5eb2b1[_0x08a6('0x34')],_0x4d1484['filters']),_0x4c1d45);if(_0x5eb2b1[_0x08a6('0x34')][_0x08a6('0x3f')]){_0x8685a9[_0x08a6('0x3d')]=_[_0x08a6('0x40')](_0x8685a9[_0x08a6('0x3d')],{'$or':_[_0x08a6('0x2e')](_0x4c1d45,function(_0x1ae3bc){if(_0x1ae3bc[_0x08a6('0x31')]!==_0x08a6('0x41')){var _0x1f8edc={};_0x1f8edc[_0x1ae3bc['name']]={'$like':'%'+_0x5eb2b1[_0x08a6('0x34')][_0x08a6('0x3f')]+'%'};return _0x1f8edc;}})});}_0x8685a9=_[_0x08a6('0x40')]({},_0x8685a9,_0x5eb2b1[_0x08a6('0x42')]);var _0x444fa3={'where':_0x8685a9['where']};return db['SugarcrmField']['count'](_0x444fa3)[_0x08a6('0x27')](function(_0x247c5c){_0x4a0785[_0x08a6('0x20')]=_0x247c5c;if(_0x5eb2b1[_0x08a6('0x34')][_0x08a6('0x43')]){_0x8685a9[_0x08a6('0x44')]=[{'all':!![]}];}return db[_0x08a6('0x45')][_0x08a6('0x46')](_0x8685a9);})[_0x08a6('0x27')](function(_0xf9d5a6){_0x4a0785[_0x08a6('0x47')]=_0xf9d5a6;return _0x4a0785;})[_0x08a6('0x27')](respondWithFilteredResult(_0x1397c2,_0x8685a9))[_0x08a6('0x48')](handleError(_0x1397c2,null));};exports[_0x08a6('0x49')]=function(_0x1a71ca,_0x4efc04){var _0x1196b1={'raw':!![],'where':{'id':_0x1a71ca['params']['id']}},_0x56d9ff={};_0x56d9ff['model']=_[_0x08a6('0x35')](db[_0x08a6('0x45')][_0x08a6('0x2f')]);_0x56d9ff[_0x08a6('0x34')]=_[_0x08a6('0x35')](_0x1a71ca[_0x08a6('0x34')]);_0x56d9ff[_0x08a6('0x3e')]=_['intersection'](_0x56d9ff[_0x08a6('0x33')],_0x56d9ff[_0x08a6('0x34')]);_0x1196b1[_0x08a6('0x39')]=_[_0x08a6('0x36')](_0x56d9ff[_0x08a6('0x33')],qs['fields'](_0x1a71ca[_0x08a6('0x34')][_0x08a6('0x37')]));_0x1196b1['attributes']=_0x1196b1[_0x08a6('0x39')][_0x08a6('0x38')]?_0x1196b1[_0x08a6('0x39')]:_0x56d9ff['model'];if(_0x1a71ca['query'][_0x08a6('0x43')]){_0x1196b1[_0x08a6('0x44')]=[{'all':!![]}];}_0x1196b1=_[_0x08a6('0x40')]({},_0x1196b1,_0x1a71ca[_0x08a6('0x42')]);return db[_0x08a6('0x45')][_0x08a6('0x4a')](_0x1196b1)['then'](handleEntityNotFound(_0x4efc04,null))[_0x08a6('0x27')](respondWithResult(_0x4efc04,null))[_0x08a6('0x48')](handleError(_0x4efc04,null));};exports['create']=function(_0x260baf,_0x232218){return db[_0x08a6('0x45')][_0x08a6('0x4b')](_0x260baf[_0x08a6('0x4c')],{})['then'](respondWithResult(_0x232218,0xc9))[_0x08a6('0x48')](handleError(_0x232218,null));};exports[_0x08a6('0x4d')]=function(_0x47dd50,_0x320730){if(_0x47dd50[_0x08a6('0x4c')]['id']){delete _0x47dd50[_0x08a6('0x4c')]['id'];}return db[_0x08a6('0x45')][_0x08a6('0x4a')]({'where':{'id':_0x47dd50[_0x08a6('0x4e')]['id']}})[_0x08a6('0x27')](handleEntityNotFound(_0x320730,null))[_0x08a6('0x27')](saveUpdates(_0x47dd50[_0x08a6('0x4c')],null))[_0x08a6('0x27')](respondWithResult(_0x320730,null))[_0x08a6('0x48')](handleError(_0x320730,null));};exports[_0x08a6('0x28')]=function(_0x300fad,_0x24703b){return db['SugarcrmField'][_0x08a6('0x4a')]({'where':{'id':_0x300fad['params']['id']}})[_0x08a6('0x27')](handleEntityNotFound(_0x24703b,null))[_0x08a6('0x27')](removeEntity(_0x24703b,null))[_0x08a6('0x48')](handleError(_0x24703b,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 43f9ca1..7ecdc64 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 _0xdbcf=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','SugarcrmField','sugarcrm_unique_index'];(function(_0x5b7cf9,_0x2d01ed){var _0x4aa8b7=function(_0x4dce3e){while(--_0x4dce3e){_0x5b7cf9['push'](_0x5b7cf9['shift']());}};_0x4aa8b7(++_0x2d01ed);}(_0xdbcf,0x155));var _0xfdbc=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xdbcf[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xfdbc('0x0'));var util=require(_0xfdbc('0x1'));var logger=require(_0xfdbc('0x2'))(_0xfdbc('0x3'));var moment=require('moment');var BPromise=require(_0xfdbc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdbc('0x5'));var rimraf=require(_0xfdbc('0x6'));var config=require(_0xfdbc('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0xfdbc('0x8')]=function(_0x2417f1,_0x49ce36){return _0x2417f1['define'](_0xfdbc('0x9'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xfdbc('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2c91=['bluebird','request-promise','path','rimraf','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','lodash','util','../../config/logger'];(function(_0x4e8bed,_0x4267b8){var _0x4bf357=function(_0x221c49){while(--_0x221c49){_0x4e8bed['push'](_0x4e8bed['shift']());}};_0x4bf357(++_0x4267b8);}(_0x2c91,0xc9));var _0x12c9=function(_0xb366e2,_0x26a0d6){_0xb366e2=_0xb366e2-0x0;var _0x36486e=_0x2c91[_0xb366e2];return _0x36486e;};'use strict';var _=require(_0x12c9('0x0'));var util=require(_0x12c9('0x1'));var logger=require(_0x12c9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x12c9('0x3'));var rp=require(_0x12c9('0x4'));var fs=require('fs');var path=require(_0x12c9('0x5'));var rimraf=require(_0x12c9('0x6'));var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x92bbc7,_0x3e2315){return _0x92bbc7[_0x12c9('0x7')](_0x12c9('0x8'),attributes,{'tableName':_0x12c9('0x9'),'paranoid':![],'indexes':[{'name':_0x12c9('0xa'),'fields':['idField',_0x12c9('0xb')],'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 0dccb0b..15b6b1b 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 _0xd4e8=['jayson/promise','client','http','then','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x18c4a8,_0x96c52e){var _0x189ff1=function(_0x4a3ea8){while(--_0x4a3ea8){_0x18c4a8['push'](_0x18c4a8['shift']());}};_0x189ff1(++_0x96c52e);}(_0xd4e8,0x117));var _0x8d4e=function(_0x46c59b,_0x5635dd){_0x46c59b=_0x46c59b-0x0;var _0x16dd2d=_0xd4e8[_0x46c59b];return _0x16dd2d;};'use strict';var _=require('lodash');var util=require(_0x8d4e('0x0'));var moment=require(_0x8d4e('0x1'));var BPromise=require(_0x8d4e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d4e('0x3'));var db=require(_0x8d4e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8d4e('0x5'))(_0x8d4e('0x6'));var config=require('../../config/environment');var jayson=require(_0x8d4e('0x7'));var client=jayson[_0x8d4e('0x8')][_0x8d4e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x130e5d,_0x55a259,_0x5901c4){return new BPromise(function(_0x36a7f9,_0x48e6a4){return client['request'](_0x130e5d,_0x5901c4)[_0x8d4e('0xa')](function(_0x1525a8){logger[_0x8d4e('0xb')](_0x8d4e('0xc'),_0x55a259,'request\x20sent');logger[_0x8d4e('0xd')](_0x8d4e('0xe'),_0x55a259,_0x8d4e('0xf'),JSON[_0x8d4e('0x10')](_0x1525a8));if(_0x1525a8['error']){if(_0x1525a8[_0x8d4e('0x11')][_0x8d4e('0x12')]===0x1f4){logger['error'](_0x8d4e('0xc'),_0x55a259,_0x1525a8[_0x8d4e('0x11')][_0x8d4e('0x13')]);return _0x48e6a4(_0x1525a8[_0x8d4e('0x11')]['message']);}logger['error'](_0x8d4e('0xc'),_0x55a259,_0x1525a8['error'][_0x8d4e('0x13')]);return _0x36a7f9(_0x1525a8[_0x8d4e('0x11')][_0x8d4e('0x13')]);}else{logger[_0x8d4e('0xb')](_0x8d4e('0xc'),_0x55a259,_0x8d4e('0xf'));_0x36a7f9(_0x1525a8[_0x8d4e('0x14')][_0x8d4e('0x13')]);}})[_0x8d4e('0x15')](function(_0x214c0d){logger[_0x8d4e('0x11')](_0x8d4e('0xc'),_0x55a259,_0x214c0d);_0x48e6a4(_0x214c0d);});});} \ No newline at end of file +var _0xc80a=['stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../config/environment','http','request','request\x20sent','debug'];(function(_0x45043c,_0x1b378b){var _0x35d455=function(_0x435b87){while(--_0x435b87){_0x45043c['push'](_0x45043c['shift']());}};_0x35d455(++_0x1b378b);}(_0xc80a,0xe5));var _0xac80=function(_0x9b24a5,_0x47c37a){_0x9b24a5=_0x9b24a5-0x0;var _0x3f4434=_0xc80a[_0x9b24a5];return _0x3f4434;};'use strict';var _=require(_0xac80('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xac80('0x1'));var rs=require(_0xac80('0x2'));var fs=require('fs');var Redis=require(_0xac80('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xac80('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0xac80('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x365106,_0x2586bf,_0x3188f7){return new BPromise(function(_0x111a64,_0x2b7ec5){return client[_0xac80('0x6')](_0x365106,_0x3188f7)['then'](function(_0x2be5b3){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x2586bf,_0xac80('0x7'));logger[_0xac80('0x8')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x2586bf,_0xac80('0x7'),JSON[_0xac80('0x9')](_0x2be5b3));if(_0x2be5b3[_0xac80('0xa')]){if(_0x2be5b3['error'][_0xac80('0xb')]===0x1f4){logger[_0xac80('0xa')](_0xac80('0xc'),_0x2586bf,_0x2be5b3[_0xac80('0xa')][_0xac80('0xd')]);return _0x2b7ec5(_0x2be5b3['error'][_0xac80('0xd')]);}logger[_0xac80('0xa')](_0xac80('0xc'),_0x2586bf,_0x2be5b3[_0xac80('0xa')][_0xac80('0xd')]);return _0x111a64(_0x2be5b3[_0xac80('0xa')][_0xac80('0xd')]);}else{logger[_0xac80('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x2586bf,_0xac80('0x7'));_0x111a64(_0x2be5b3[_0xac80('0xf')][_0xac80('0xd')]);}})[_0xac80('0x10')](function(_0x19b822){logger[_0xac80('0xa')](_0xac80('0xc'),_0x2586bf,_0x19b822);_0x2b7ec5(_0x19b822);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index d12d813..8c94934 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 _0x2333=['../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x2333,0x11a));var _0x3233=function(_0x27cf35,_0x48b172){_0x27cf35=_0x27cf35-0x0;var _0x29f7e5=_0x2333[_0x27cf35];return _0x29f7e5;};'use strict';var multer=require(_0x3233('0x0'));var util=require(_0x3233('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3233('0x2'));var router=express[_0x3233('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3233('0x4'));var interaction=require(_0x3233('0x5'));var config=require(_0x3233('0x6'));var controller=require(_0x3233('0x7'));router[_0x3233('0x8')]('/',auth[_0x3233('0x9')](),controller[_0x3233('0xa')]);router[_0x3233('0x8')](_0x3233('0xb'),auth[_0x3233('0x9')](),controller[_0x3233('0xc')]);router[_0x3233('0x8')](_0x3233('0xd'),auth[_0x3233('0x9')](),controller[_0x3233('0xe')]);router[_0x3233('0x8')](_0x3233('0xf'),auth[_0x3233('0x9')](),controller[_0x3233('0x10')]);router[_0x3233('0x11')]('/',auth[_0x3233('0x9')](),controller['create']);router[_0x3233('0x11')](_0x3233('0xd'),auth[_0x3233('0x9')](),controller[_0x3233('0x12')]);router[_0x3233('0x13')](_0x3233('0xb'),auth[_0x3233('0x9')](),controller[_0x3233('0x14')]);router[_0x3233('0x15')](_0x3233('0xb'),auth[_0x3233('0x9')](),controller[_0x3233('0x16')]);module[_0x3233('0x17')]=router; \ No newline at end of file +var _0x0fc2=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x4ee864,_0x501c05){var _0x98627a=function(_0x1d27e2){while(--_0x1d27e2){_0x4ee864['push'](_0x4ee864['shift']());}};_0x98627a(++_0x501c05);}(_0x0fc2,0x6e));var _0x20fc=function(_0x2dd8e9,_0xd45b23){_0x2dd8e9=_0x2dd8e9-0x0;var _0x3b8ccd=_0x0fc2[_0x2dd8e9];return _0x3b8ccd;};'use strict';var multer=require(_0x20fc('0x0'));var util=require(_0x20fc('0x1'));var path=require(_0x20fc('0x2'));var timeout=require(_0x20fc('0x3'));var express=require('express');var router=express[_0x20fc('0x4')]();var fs_extra=require(_0x20fc('0x5'));var auth=require(_0x20fc('0x6'));var interaction=require(_0x20fc('0x7'));var config=require(_0x20fc('0x8'));var controller=require(_0x20fc('0x9'));router[_0x20fc('0xa')]('/',auth[_0x20fc('0xb')](),controller[_0x20fc('0xc')]);router[_0x20fc('0xa')](_0x20fc('0xd'),auth[_0x20fc('0xb')](),controller[_0x20fc('0xe')]);router[_0x20fc('0xa')](_0x20fc('0xf'),auth[_0x20fc('0xb')](),controller['getConfigurations']);router[_0x20fc('0xa')](_0x20fc('0x10'),auth[_0x20fc('0xb')](),controller['getFields']);router[_0x20fc('0x11')]('/',auth[_0x20fc('0xb')](),controller[_0x20fc('0x12')]);router[_0x20fc('0x11')](_0x20fc('0xf'),auth[_0x20fc('0xb')](),controller[_0x20fc('0x13')]);router[_0x20fc('0x14')]('/:id',auth[_0x20fc('0xb')](),controller['update']);router[_0x20fc('0x15')]('/:id',auth[_0x20fc('0xb')](),controller['destroy']);module[_0x20fc('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 30b1f39..c091250 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 _0x4da1=['sequelize','exports','STRING'];(function(_0x42d1e8,_0x4168ac){var _0x16c1ab=function(_0x2c547d){while(--_0x2c547d){_0x42d1e8['push'](_0x42d1e8['shift']());}};_0x16c1ab(++_0x4168ac);}(_0x4da1,0xcf));var _0x14da=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4da1[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x14da('0x0'));module[_0x14da('0x1')]={'name':{'type':Sequelize[_0x14da('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x14da('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x14da('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x14da('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x14da('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x14da('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xc844=['sequelize','exports','STRING','HelpDesk'];(function(_0x2e2738,_0x5def7b){var _0x460f5d=function(_0x390555){while(--_0x390555){_0x2e2738['push'](_0x2e2738['shift']());}};_0x460f5d(++_0x5def7b);}(_0xc844,0x104));var _0x4c84=function(_0x35d2b9,_0x7ef769){_0x35d2b9=_0x35d2b9-0x0;var _0x210456=_0xc844[_0x35d2b9];return _0x210456;};'use strict';var Sequelize=require(_0x4c84('0x0'));module[_0x4c84('0x1')]={'name':{'type':Sequelize[_0x4c84('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4c84('0x2')]},'username':{'type':Sequelize[_0x4c84('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x4c84('0x2')],'allowNull':![],'defaultValue':_0x4c84('0x3')},'remoteUri':{'type':Sequelize[_0x4c84('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x4c84('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x4c84('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index c1ed641..0fdd08f 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 _0x1c31=['vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name','send','map','VtigerAccount','fieldName','type','key','keys','query','intersection','model','fields','attributes','hasOwnProperty','order','sort','filters','pick','filter','merge','where','options','include','findAll','rows','show','params','rawAttributes','length','includeAll','catch','create','body','find','getConfigurations','findOne','VtigerConfiguration','nolimit','addConfiguration','Subjects','getSubjects','Descriptions','channel','VtigerField','md5','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','sessionName','owner','remove','includes','editable','false','cf_','picklist','picklistValues','label','log'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c31,0x78));var _0x11c3=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1c31[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x11c3('0x0'));var rimraf=require(_0x11c3('0x1'));var zipdir=require(_0x11c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11c3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x11c3('0x4'));var util=require(_0x11c3('0x5'));var path=require(_0x11c3('0x6'));var sox=require(_0x11c3('0x7'));var csv=require(_0x11c3('0x8'));var ejs=require(_0x11c3('0x9'));var fs=require('fs');var fs_extra=require(_0x11c3('0xa'));var _=require(_0x11c3('0xb'));var squel=require(_0x11c3('0xc'));var crypto=require('crypto');var jsforce=require(_0x11c3('0xd'));var deskjs=require(_0x11c3('0xe'));var toCsv=require(_0x11c3('0x8'));var querystring=require(_0x11c3('0xf'));var Papa=require('papaparse');var Redis=require(_0x11c3('0x10'));var authService=require(_0x11c3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x11c3('0x12'));var hardwareService=require(_0x11c3('0x13'));var logger=require(_0x11c3('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x11c3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x11c3('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x27d65c,_0x16a2df){_0x16a2df=_0x16a2df||0xcc;return function(_0xd5f6b7){if(_0xd5f6b7){return _0x27d65c['sendStatus'](_0x16a2df);}return _0x27d65c[_0x11c3('0x17')](_0x16a2df)[_0x11c3('0x18')]();};}function respondWithResult(_0xefc25,_0xd6fcc1){_0xd6fcc1=_0xd6fcc1||0xc8;return function(_0x4c9040){if(_0x4c9040){return _0xefc25[_0x11c3('0x17')](_0xd6fcc1)[_0x11c3('0x19')](_0x4c9040);}};}function respondWithFilteredResult(_0x4a9450,_0x585a8f){return function(_0x5574cc){if(_0x5574cc){var _0x357f96=typeof _0x585a8f['offset']===_0x11c3('0x1a')&&typeof _0x585a8f['limit']===_0x11c3('0x1a');var _0x2075b5=_0x5574cc[_0x11c3('0x1b')];var _0x1ea407=_0x357f96?0x0:_0x585a8f[_0x11c3('0x1c')];var _0xa6df19=_0x357f96?_0x5574cc[_0x11c3('0x1b')]:_0x585a8f[_0x11c3('0x1c')]+_0x585a8f[_0x11c3('0x1d')];var _0x268c0f;if(_0xa6df19>=_0x2075b5){_0xa6df19=_0x2075b5;_0x268c0f=0xc8;}else{_0x268c0f=0xce;}_0x4a9450[_0x11c3('0x17')](_0x268c0f);return _0x4a9450[_0x11c3('0x1e')](_0x11c3('0x1f'),_0x1ea407+'-'+_0xa6df19+'/'+_0x2075b5)['json'](_0x5574cc);}return null;};}function patchUpdates(_0x187802){return function(_0x569016){try{jsonpatch[_0x11c3('0x20')](_0x569016,_0x187802,!![]);}catch(_0x5ac6dd){return BPromise['reject'](_0x5ac6dd);}return _0x569016['save']();};}function saveUpdates(_0x4e96df,_0x51c9b1){return function(_0x5c7ee5){if(_0x5c7ee5){return _0x5c7ee5[_0x11c3('0x21')](_0x4e96df)['then'](function(_0x295d9d){return _0x295d9d;});}return null;};}function removeEntity(_0x2e3ab1,_0x5263b4){return function(_0x42f5b5){if(_0x42f5b5){return _0x42f5b5[_0x11c3('0x22')]()[_0x11c3('0x23')](function(){_0x2e3ab1[_0x11c3('0x17')](0xcc)[_0x11c3('0x18')]();});}};}function handleEntityNotFound(_0x4d6d88,_0x5d2530){return function(_0x32215b){if(!_0x32215b){_0x4d6d88[_0x11c3('0x24')](0x194);}return _0x32215b;};}function handleError(_0x5f284d,_0xefdcc2){_0xefdcc2=_0xefdcc2||0x1f4;return function(_0x19f5e9){logger[_0x11c3('0x25')](_0x19f5e9[_0x11c3('0x26')]);if(_0x19f5e9[_0x11c3('0x27')]){delete _0x19f5e9[_0x11c3('0x27')];}_0x5f284d[_0x11c3('0x17')](_0xefdcc2)[_0x11c3('0x28')](_0x19f5e9);};}exports['index']=function(_0x48d4fb,_0x3fe7aa){var _0x13b9b6={},_0x20df97={},_0x448964={'count':0x0,'rows':[]};var _0x58c55c=_[_0x11c3('0x29')](db[_0x11c3('0x2a')]['rawAttributes'],function(_0x335fc6){return{'name':_0x335fc6[_0x11c3('0x2b')],'type':_0x335fc6[_0x11c3('0x2c')][_0x11c3('0x2d')]};});_0x20df97['model']=_[_0x11c3('0x29')](_0x58c55c,_0x11c3('0x27'));_0x20df97['query']=_[_0x11c3('0x2e')](_0x48d4fb[_0x11c3('0x2f')]);_0x20df97['filters']=_[_0x11c3('0x30')](_0x20df97[_0x11c3('0x31')],_0x20df97[_0x11c3('0x2f')]);_0x13b9b6['attributes']=_[_0x11c3('0x30')](_0x20df97[_0x11c3('0x31')],qs[_0x11c3('0x32')](_0x48d4fb[_0x11c3('0x2f')]['fields']));_0x13b9b6[_0x11c3('0x33')]=_0x13b9b6[_0x11c3('0x33')]['length']?_0x13b9b6[_0x11c3('0x33')]:_0x20df97[_0x11c3('0x31')];if(!_0x48d4fb[_0x11c3('0x2f')][_0x11c3('0x34')]('nolimit')){_0x13b9b6[_0x11c3('0x1d')]=qs[_0x11c3('0x1d')](_0x48d4fb[_0x11c3('0x2f')][_0x11c3('0x1d')]);_0x13b9b6['offset']=qs['offset'](_0x48d4fb[_0x11c3('0x2f')][_0x11c3('0x1c')]);}_0x13b9b6[_0x11c3('0x35')]=qs[_0x11c3('0x36')](_0x48d4fb[_0x11c3('0x2f')][_0x11c3('0x36')]);_0x13b9b6['where']=qs[_0x11c3('0x37')](_[_0x11c3('0x38')](_0x48d4fb[_0x11c3('0x2f')],_0x20df97[_0x11c3('0x37')]),_0x58c55c);if(_0x48d4fb[_0x11c3('0x2f')][_0x11c3('0x39')]){_0x13b9b6['where']=_[_0x11c3('0x3a')](_0x13b9b6[_0x11c3('0x3b')],{'$or':_[_0x11c3('0x29')](_0x58c55c,function(_0x274bbc){if(_0x274bbc['type']!=='VIRTUAL'){var _0x5978ca={};_0x5978ca[_0x274bbc['name']]={'$like':'%'+_0x48d4fb[_0x11c3('0x2f')][_0x11c3('0x39')]+'%'};return _0x5978ca;}})});}_0x13b9b6=_[_0x11c3('0x3a')]({},_0x13b9b6,_0x48d4fb[_0x11c3('0x3c')]);var _0x29340d={'where':_0x13b9b6[_0x11c3('0x3b')]};return db[_0x11c3('0x2a')]['count'](_0x29340d)['then'](function(_0x2730a9){_0x448964['count']=_0x2730a9;if(_0x48d4fb['query']['includeAll']){_0x13b9b6[_0x11c3('0x3d')]=[{'all':!![]}];}return db[_0x11c3('0x2a')][_0x11c3('0x3e')](_0x13b9b6);})[_0x11c3('0x23')](function(_0x516b76){_0x448964[_0x11c3('0x3f')]=_0x516b76;return _0x448964;})[_0x11c3('0x23')](respondWithFilteredResult(_0x3fe7aa,_0x13b9b6))['catch'](handleError(_0x3fe7aa,null));};exports[_0x11c3('0x40')]=function(_0x489222,_0x41eef6){var _0x4956c2={'raw':![],'where':{'id':_0x489222[_0x11c3('0x41')]['id']}},_0x2d746f={};_0x2d746f[_0x11c3('0x31')]=_[_0x11c3('0x2e')](db['VtigerAccount'][_0x11c3('0x42')]);_0x2d746f['query']=_[_0x11c3('0x2e')](_0x489222[_0x11c3('0x2f')]);_0x2d746f[_0x11c3('0x37')]=_[_0x11c3('0x30')](_0x2d746f[_0x11c3('0x31')],_0x2d746f[_0x11c3('0x2f')]);_0x4956c2[_0x11c3('0x33')]=_[_0x11c3('0x30')](_0x2d746f[_0x11c3('0x31')],qs[_0x11c3('0x32')](_0x489222[_0x11c3('0x2f')][_0x11c3('0x32')]));_0x4956c2[_0x11c3('0x33')]=_0x4956c2[_0x11c3('0x33')][_0x11c3('0x43')]?_0x4956c2[_0x11c3('0x33')]:_0x2d746f[_0x11c3('0x31')];if(_0x489222[_0x11c3('0x2f')][_0x11c3('0x44')]){_0x4956c2[_0x11c3('0x3d')]=[{'all':!![]}];}_0x4956c2=_[_0x11c3('0x3a')]({},_0x4956c2,_0x489222[_0x11c3('0x3c')]);return db[_0x11c3('0x2a')]['find'](_0x4956c2)[_0x11c3('0x23')](handleEntityNotFound(_0x41eef6,null))[_0x11c3('0x23')](respondWithResult(_0x41eef6,null))[_0x11c3('0x45')](handleError(_0x41eef6,null));};exports[_0x11c3('0x46')]=function(_0x336d59,_0x176a3a){return db[_0x11c3('0x2a')][_0x11c3('0x46')](_0x336d59[_0x11c3('0x47')],{})['then'](respondWithResult(_0x176a3a,0xc9))[_0x11c3('0x45')](handleError(_0x176a3a,null));};exports['update']=function(_0x2fe115,_0x3e40e0){if(_0x2fe115[_0x11c3('0x47')]['id']){delete _0x2fe115['body']['id'];}return db[_0x11c3('0x2a')][_0x11c3('0x48')]({'where':{'id':_0x2fe115['params']['id']}})[_0x11c3('0x23')](handleEntityNotFound(_0x3e40e0,null))[_0x11c3('0x23')](saveUpdates(_0x2fe115[_0x11c3('0x47')],null))[_0x11c3('0x23')](respondWithResult(_0x3e40e0,null))[_0x11c3('0x45')](handleError(_0x3e40e0,null));};exports[_0x11c3('0x22')]=function(_0x5d9680,_0x4da271){return db[_0x11c3('0x2a')][_0x11c3('0x48')]({'where':{'id':_0x5d9680[_0x11c3('0x41')]['id']}})['then'](handleEntityNotFound(_0x4da271,null))['then'](removeEntity(_0x4da271,null))[_0x11c3('0x45')](handleError(_0x4da271,null));};exports[_0x11c3('0x49')]=function(_0x3f9233,_0xda4ccd,_0x372d8f){var _0x53a54f={};var _0x1092a4={};var _0x2758d9;var _0x5864c3;return db[_0x11c3('0x2a')][_0x11c3('0x4a')]({'where':{'id':_0x3f9233[_0x11c3('0x41')]['id']}})[_0x11c3('0x23')](handleEntityNotFound(_0xda4ccd,null))[_0x11c3('0x23')](function(_0x28c70){if(_0x28c70){_0x2758d9=_0x28c70;_0x1092a4['model']=_[_0x11c3('0x2e')](db[_0x11c3('0x4b')][_0x11c3('0x42')]);_0x1092a4[_0x11c3('0x2f')]=_[_0x11c3('0x2e')](_0x3f9233[_0x11c3('0x2f')]);_0x1092a4[_0x11c3('0x37')]=_[_0x11c3('0x30')](_0x1092a4[_0x11c3('0x31')],_0x1092a4[_0x11c3('0x2f')]);_0x53a54f[_0x11c3('0x33')]=_['intersection'](_0x1092a4[_0x11c3('0x31')],qs[_0x11c3('0x32')](_0x3f9233[_0x11c3('0x2f')][_0x11c3('0x32')]));_0x53a54f[_0x11c3('0x33')]=_0x53a54f[_0x11c3('0x33')][_0x11c3('0x43')]?_0x53a54f['attributes']:_0x1092a4['model'];_0x53a54f[_0x11c3('0x35')]=qs['sort'](_0x3f9233[_0x11c3('0x2f')][_0x11c3('0x36')]);_0x53a54f[_0x11c3('0x3b')]=qs[_0x11c3('0x37')](_[_0x11c3('0x38')](_0x3f9233[_0x11c3('0x2f')],_0x1092a4[_0x11c3('0x37')]));if(_0x3f9233['query'][_0x11c3('0x39')]){_0x53a54f['where']=_[_0x11c3('0x3a')](_0x53a54f[_0x11c3('0x3b')],{'$or':_[_0x11c3('0x29')](_0x53a54f[_0x11c3('0x33')],function(_0x153bc8){var _0x3fb8f6={};_0x3fb8f6[_0x153bc8]={'$like':'%'+_0x3f9233[_0x11c3('0x2f')][_0x11c3('0x39')]+'%'};return _0x3fb8f6;})});}_0x53a54f=_[_0x11c3('0x3a')]({},_0x53a54f,_0x3f9233[_0x11c3('0x3c')]);return _0x2758d9[_0x11c3('0x49')](_0x53a54f);}})[_0x11c3('0x23')](function(_0x5e8f83){if(_0x5e8f83){_0x5864c3=_0x5e8f83['length'];if(!_0x3f9233[_0x11c3('0x2f')][_0x11c3('0x34')](_0x11c3('0x4c'))){_0x53a54f['limit']=qs[_0x11c3('0x1d')](_0x3f9233[_0x11c3('0x2f')]['limit']);_0x53a54f[_0x11c3('0x1c')]=qs[_0x11c3('0x1c')](_0x3f9233['query']['offset']);}return _0x2758d9[_0x11c3('0x49')](_0x53a54f);}})['then'](function(_0x15a594){if(_0x15a594){return _0x15a594?{'count':_0x5864c3,'rows':_0x15a594}:null;}})[_0x11c3('0x23')](respondWithResult(_0xda4ccd,null))[_0x11c3('0x45')](handleError(_0xda4ccd,null));};exports[_0x11c3('0x4d')]=function(_0x125d7a,_0x2ec39e,_0x1bc617){if(_0x125d7a[_0x11c3('0x47')]['id']){delete _0x125d7a['body']['id'];}return db['VtigerAccount'][_0x11c3('0x4a')]({'where':{'id':_0x125d7a[_0x11c3('0x41')]['id']}})[_0x11c3('0x23')](handleEntityNotFound(_0x2ec39e,null))[_0x11c3('0x23')](function(_0x543d94){if(_0x543d94){_0x125d7a[_0x11c3('0x47')]['AccountId']=_0x543d94['id'];_0x125d7a['body'][_0x11c3('0x4e')]=integrations[_0x11c3('0x4f')](_0x125d7a[_0x11c3('0x47')]['channel'],_0x125d7a[_0x11c3('0x47')][_0x11c3('0x2c')]);_0x125d7a[_0x11c3('0x47')][_0x11c3('0x50')]=integrations['getDescriptions'](_0x125d7a[_0x11c3('0x47')][_0x11c3('0x51')],_0x125d7a[_0x11c3('0x47')]['type']);return db[_0x11c3('0x4b')][_0x11c3('0x46')](_0x125d7a[_0x11c3('0x47')],{'include':[{'model':db[_0x11c3('0x52')],'as':'Subjects'},{'model':db[_0x11c3('0x52')],'as':_0x11c3('0x50')}]});}return null;})[_0x11c3('0x23')](respondWithResult(_0x2ec39e,null))[_0x11c3('0x45')](handleError(_0x2ec39e,null));};var md5=require(_0x11c3('0x53'));exports['getFields']=function(_0x10d17a,_0x3672ec,_0x4da2a0){var _0x195f61=null;var _0xcdbc66=null;var _0x2b040e=null;var _0x58dc77=null;var _0x322859='';return db[_0x11c3('0x2a')][_0x11c3('0x4a')]({'where':{'id':_0x10d17a[_0x11c3('0x41')]['id']},'attributes':['id','name',_0x11c3('0x54'),'description',_0x11c3('0x55'),_0x11c3('0x56'),_0x11c3('0x57'),_0x11c3('0x58')]})[_0x11c3('0x23')](handleEntityNotFound(_0x3672ec,null))[_0x11c3('0x23')](function(_0x1d4a63){if(_0x1d4a63){_0x195f61=_0x1d4a63[_0x11c3('0x54')];_0xcdbc66=_0x1d4a63[_0x11c3('0x58')];_0x2b040e=_0x1d4a63[_0x11c3('0x55')];_0x322859=_0x1d4a63[_0x11c3('0x56')];var _0x385c7d=_0x322859[_0x11c3('0x59')](-0x1);if(_0x385c7d==='/'){_0x322859=_0x322859[_0x11c3('0x5a')](0x0,_0x322859[_0x11c3('0x5b')](_0x385c7d));}_0x58dc77=util['format'](_0x11c3('0x5c'),_0x322859);var _0x57909b={'method':_0x11c3('0x5d'),'uri':_0x58dc77,'qs':{'operation':_0x11c3('0x5e'),'username':_0x1d4a63[_0x11c3('0x54')]},'json':!![]};return rp(_0x57909b);}})[_0x11c3('0x23')](function(_0x136779){if(_0x136779[_0x11c3('0x5f')]){var _0x3ed975={'method':_0x11c3('0x60'),'uri':_0x58dc77,'form':{'operation':_0x11c3('0x61'),'username':_0x195f61,'accessKey':md5(_0x136779[_0x11c3('0x62')][_0x11c3('0x63')]+_0xcdbc66)},'json':!![]};return rp(_0x3ed975);}})[_0x11c3('0x23')](function(_0x5b9f79){if(_0x5b9f79['success']){var _0x37a59b={'method':_0x11c3('0x5d'),'uri':_0x58dc77,'qs':{'operation':_0x11c3('0x64'),'username':_0x195f61,'sessionName':_0x5b9f79[_0x11c3('0x62')][_0x11c3('0x65')],'elementType':_0x2b040e},'json':!![]};return rp(_0x37a59b);}})[_0x11c3('0x23')](function(_0x149f57){if(_0x149f57[_0x11c3('0x5f')]){var _0x179725=['autogenerated','reference',_0x11c3('0x66')];_[_0x11c3('0x67')](_0x149f57[_0x11c3('0x62')][_0x11c3('0x32')],function(_0x40528d){return _0x179725[_0x11c3('0x68')](_0x40528d['type']['name']);});_[_0x11c3('0x67')](_0x149f57[_0x11c3('0x62')][_0x11c3('0x32')],function(_0x276f3c){return _0x276f3c[_0x11c3('0x69')]===_0x11c3('0x6a');});return{'count':_0x149f57[_0x11c3('0x62')]['fields'][_0x11c3('0x43')],'rows':_[_0x11c3('0x29')](_0x149f57[_0x11c3('0x62')][_0x11c3('0x32')],function(_0x4bb2b3){return{'id':_0x4bb2b3[_0x11c3('0x27')],'name':_0x4bb2b3['label'],'custom':_['startsWith'](_0x4bb2b3[_0x11c3('0x27')],_0x11c3('0x6b'))?!![]:![],'options':_0x4bb2b3[_0x11c3('0x2c')]['name']===_0x11c3('0x6c')&&_0x4bb2b3[_0x11c3('0x2c')][_0x11c3('0x6d')][_0x11c3('0x43')]>0x0?_['map'](_0x4bb2b3['type'][_0x11c3('0x6d')],function(_0x5825f0){return{'name':_0x5825f0[_0x11c3('0x6e')],'value':_0x5825f0['value']};}):[]};})};}})[_0x11c3('0x23')](respondWithResult(_0x3672ec,null))[_0x11c3('0x45')](function(_0x2e9849){console[_0x11c3('0x6f')](_0x11c3('0x70')+_0x2e9849);var _0x1ac23e=_0x10d17a[_0x11c3('0x2f')][_0x11c3('0x71')]?0x1f4:_0x2e9849['statusCode']||0x1f4;logger[_0x11c3('0x25')](_0x11c3('0x72'),'getFields',_0x1ac23e,JSON[_0x11c3('0x73')](_0x2e9849));delete _0x2e9849['name'];if(_0x1ac23e===0x191){_0x1ac23e=0x190;}_0x3672ec[_0x11c3('0x17')](_0x1ac23e)[_0x11c3('0x28')](_0x10d17a[_0x11c3('0x2f')][_0x11c3('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x2e9849['statusCode']}:_0x2e9849);});}; \ No newline at end of file +var _0xdc51=['destroy','status','sendStatus','error','stack','index','map','VtigerAccount','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','name','options','include','rows','params','rawAttributes','length','includeAll','find','catch','create','body','getConfigurations','findOne','VtigerConfiguration','order','hasOwnProperty','addConfiguration','AccountId','Subjects','getDescriptions','channel','VtigerField','Descriptions','md5','username','description','remoteUri','accessKey','moduleName','slice','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','sessionName','autogenerated','reference','owner','remove','result','editable','false','label','startsWith','cf_','picklistValues','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then'];(function(_0x50964f,_0x54fd30){var _0x4fa524=function(_0x314b20){while(--_0x314b20){_0x50964f['push'](_0x50964f['shift']());}};_0x4fa524(++_0x54fd30);}(_0xdc51,0xd1));var _0x1dc5=function(_0x2f8b0f,_0x2654eb){_0x2f8b0f=_0x2f8b0f-0x0;var _0x384196=_0xdc51[_0x2f8b0f];return _0x384196;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1dc5('0x0'));var zipdir=require(_0x1dc5('0x1'));var jsonpatch=require(_0x1dc5('0x2'));var rp=require(_0x1dc5('0x3'));var moment=require(_0x1dc5('0x4'));var BPromise=require(_0x1dc5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1dc5('0x6'));var sox=require(_0x1dc5('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1dc5('0x8'));var squel=require(_0x1dc5('0x9'));var crypto=require(_0x1dc5('0xa'));var jsforce=require(_0x1dc5('0xb'));var deskjs=require(_0x1dc5('0xc'));var toCsv=require(_0x1dc5('0xd'));var querystring=require('querystring');var Papa=require(_0x1dc5('0xe'));var Redis=require(_0x1dc5('0xf'));var authService=require(_0x1dc5('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1dc5('0x11'))(_0x1dc5('0x12'));var utils=require(_0x1dc5('0x13'));var config=require(_0x1dc5('0x14'));var licenseUtil=require(_0x1dc5('0x15'));var db=require(_0x1dc5('0x16'))['db'];var integrations=require(_0x1dc5('0x17'));function respondWithStatusCode(_0x1a5846,_0x5a0e08){_0x5a0e08=_0x5a0e08||0xcc;return function(_0x3b446c){if(_0x3b446c){return _0x1a5846['sendStatus'](_0x5a0e08);}return _0x1a5846['status'](_0x5a0e08)[_0x1dc5('0x18')]();};}function respondWithResult(_0x4059b9,_0x4fb88e){_0x4fb88e=_0x4fb88e||0xc8;return function(_0x5732cc){if(_0x5732cc){return _0x4059b9['status'](_0x4fb88e)[_0x1dc5('0x19')](_0x5732cc);}};}function respondWithFilteredResult(_0x41b55d,_0x4ac9e8){return function(_0x5db013){if(_0x5db013){var _0x30817e=typeof _0x4ac9e8['offset']===_0x1dc5('0x1a')&&typeof _0x4ac9e8[_0x1dc5('0x1b')]==='undefined';var _0x5b1f8c=_0x5db013[_0x1dc5('0x1c')];var _0x1b691c=_0x30817e?0x0:_0x4ac9e8[_0x1dc5('0x1d')];var _0x1123ff=_0x30817e?_0x5db013[_0x1dc5('0x1c')]:_0x4ac9e8['offset']+_0x4ac9e8[_0x1dc5('0x1b')];var _0x6e22a4;if(_0x1123ff>=_0x5b1f8c){_0x1123ff=_0x5b1f8c;_0x6e22a4=0xc8;}else{_0x6e22a4=0xce;}_0x41b55d['status'](_0x6e22a4);return _0x41b55d[_0x1dc5('0x1e')](_0x1dc5('0x1f'),_0x1b691c+'-'+_0x1123ff+'/'+_0x5b1f8c)[_0x1dc5('0x19')](_0x5db013);}return null;};}function patchUpdates(_0x57cfee){return function(_0x2116e6){try{jsonpatch[_0x1dc5('0x20')](_0x2116e6,_0x57cfee,!![]);}catch(_0x1a49e1){return BPromise[_0x1dc5('0x21')](_0x1a49e1);}return _0x2116e6[_0x1dc5('0x22')]();};}function saveUpdates(_0x1ab9d8,_0x581a21){return function(_0x146769){if(_0x146769){return _0x146769[_0x1dc5('0x23')](_0x1ab9d8)[_0x1dc5('0x24')](function(_0x2affed){return _0x2affed;});}return null;};}function removeEntity(_0x3bced5,_0x3edc4c){return function(_0x4bc585){if(_0x4bc585){return _0x4bc585[_0x1dc5('0x25')]()['then'](function(){_0x3bced5[_0x1dc5('0x26')](0xcc)[_0x1dc5('0x18')]();});}};}function handleEntityNotFound(_0x3f43c1,_0x43fed2){return function(_0x3e33e6){if(!_0x3e33e6){_0x3f43c1[_0x1dc5('0x27')](0x194);}return _0x3e33e6;};}function handleError(_0x8b8ba8,_0x24fe3a){_0x24fe3a=_0x24fe3a||0x1f4;return function(_0x11b23b){logger[_0x1dc5('0x28')](_0x11b23b[_0x1dc5('0x29')]);if(_0x11b23b['name']){delete _0x11b23b['name'];}_0x8b8ba8[_0x1dc5('0x26')](_0x24fe3a)['send'](_0x11b23b);};}exports[_0x1dc5('0x2a')]=function(_0x5837a6,_0x1c0e86){var _0x579473={},_0x9ebc11={},_0x11a0a1={'count':0x0,'rows':[]};var _0x348a99=_[_0x1dc5('0x2b')](db[_0x1dc5('0x2c')]['rawAttributes'],function(_0x5cc43a){return{'name':_0x5cc43a[_0x1dc5('0x2d')],'type':_0x5cc43a[_0x1dc5('0x2e')][_0x1dc5('0x2f')]};});_0x9ebc11[_0x1dc5('0x30')]=_[_0x1dc5('0x2b')](_0x348a99,'name');_0x9ebc11['query']=_[_0x1dc5('0x31')](_0x5837a6[_0x1dc5('0x32')]);_0x9ebc11[_0x1dc5('0x33')]=_[_0x1dc5('0x34')](_0x9ebc11[_0x1dc5('0x30')],_0x9ebc11[_0x1dc5('0x32')]);_0x579473[_0x1dc5('0x35')]=_[_0x1dc5('0x34')](_0x9ebc11[_0x1dc5('0x30')],qs['fields'](_0x5837a6[_0x1dc5('0x32')][_0x1dc5('0x36')]));_0x579473['attributes']=_0x579473[_0x1dc5('0x35')]['length']?_0x579473[_0x1dc5('0x35')]:_0x9ebc11['model'];if(!_0x5837a6[_0x1dc5('0x32')]['hasOwnProperty'](_0x1dc5('0x37'))){_0x579473[_0x1dc5('0x1b')]=qs[_0x1dc5('0x1b')](_0x5837a6['query']['limit']);_0x579473[_0x1dc5('0x1d')]=qs[_0x1dc5('0x1d')](_0x5837a6[_0x1dc5('0x32')][_0x1dc5('0x1d')]);}_0x579473['order']=qs[_0x1dc5('0x38')](_0x5837a6[_0x1dc5('0x32')][_0x1dc5('0x38')]);_0x579473[_0x1dc5('0x39')]=qs[_0x1dc5('0x33')](_[_0x1dc5('0x3a')](_0x5837a6['query'],_0x9ebc11[_0x1dc5('0x33')]),_0x348a99);if(_0x5837a6[_0x1dc5('0x32')][_0x1dc5('0x3b')]){_0x579473['where']=_[_0x1dc5('0x3c')](_0x579473[_0x1dc5('0x39')],{'$or':_[_0x1dc5('0x2b')](_0x348a99,function(_0x2d9343){if(_0x2d9343[_0x1dc5('0x2e')]!==_0x1dc5('0x3d')){var _0x4a4f3c={};_0x4a4f3c[_0x2d9343[_0x1dc5('0x3e')]]={'$like':'%'+_0x5837a6['query']['filter']+'%'};return _0x4a4f3c;}})});}_0x579473=_[_0x1dc5('0x3c')]({},_0x579473,_0x5837a6[_0x1dc5('0x3f')]);var _0x1b6e04={'where':_0x579473[_0x1dc5('0x39')]};return db[_0x1dc5('0x2c')][_0x1dc5('0x1c')](_0x1b6e04)['then'](function(_0x4e44cd){_0x11a0a1[_0x1dc5('0x1c')]=_0x4e44cd;if(_0x5837a6['query']['includeAll']){_0x579473[_0x1dc5('0x40')]=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0x579473);})[_0x1dc5('0x24')](function(_0x49a7f5){_0x11a0a1[_0x1dc5('0x41')]=_0x49a7f5;return _0x11a0a1;})[_0x1dc5('0x24')](respondWithFilteredResult(_0x1c0e86,_0x579473))['catch'](handleError(_0x1c0e86,null));};exports['show']=function(_0xba185d,_0x554bd2){var _0x230c0e={'raw':![],'where':{'id':_0xba185d[_0x1dc5('0x42')]['id']}},_0x1a9223={};_0x1a9223[_0x1dc5('0x30')]=_['keys'](db[_0x1dc5('0x2c')][_0x1dc5('0x43')]);_0x1a9223['query']=_[_0x1dc5('0x31')](_0xba185d[_0x1dc5('0x32')]);_0x1a9223['filters']=_[_0x1dc5('0x34')](_0x1a9223['model'],_0x1a9223[_0x1dc5('0x32')]);_0x230c0e[_0x1dc5('0x35')]=_['intersection'](_0x1a9223[_0x1dc5('0x30')],qs[_0x1dc5('0x36')](_0xba185d[_0x1dc5('0x32')][_0x1dc5('0x36')]));_0x230c0e[_0x1dc5('0x35')]=_0x230c0e[_0x1dc5('0x35')][_0x1dc5('0x44')]?_0x230c0e[_0x1dc5('0x35')]:_0x1a9223[_0x1dc5('0x30')];if(_0xba185d[_0x1dc5('0x32')][_0x1dc5('0x45')]){_0x230c0e[_0x1dc5('0x40')]=[{'all':!![]}];}_0x230c0e=_[_0x1dc5('0x3c')]({},_0x230c0e,_0xba185d[_0x1dc5('0x3f')]);return db[_0x1dc5('0x2c')][_0x1dc5('0x46')](_0x230c0e)[_0x1dc5('0x24')](handleEntityNotFound(_0x554bd2,null))[_0x1dc5('0x24')](respondWithResult(_0x554bd2,null))[_0x1dc5('0x47')](handleError(_0x554bd2,null));};exports[_0x1dc5('0x48')]=function(_0x329f2d,_0x26665b){return db['VtigerAccount']['create'](_0x329f2d[_0x1dc5('0x49')],{})[_0x1dc5('0x24')](respondWithResult(_0x26665b,0xc9))[_0x1dc5('0x47')](handleError(_0x26665b,null));};exports['update']=function(_0xec128b,_0x1926d8){if(_0xec128b[_0x1dc5('0x49')]['id']){delete _0xec128b[_0x1dc5('0x49')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0xec128b[_0x1dc5('0x42')]['id']}})[_0x1dc5('0x24')](handleEntityNotFound(_0x1926d8,null))['then'](saveUpdates(_0xec128b[_0x1dc5('0x49')],null))['then'](respondWithResult(_0x1926d8,null))['catch'](handleError(_0x1926d8,null));};exports[_0x1dc5('0x25')]=function(_0x1caa53,_0x3e35fe){return db[_0x1dc5('0x2c')][_0x1dc5('0x46')]({'where':{'id':_0x1caa53['params']['id']}})[_0x1dc5('0x24')](handleEntityNotFound(_0x3e35fe,null))[_0x1dc5('0x24')](removeEntity(_0x3e35fe,null))[_0x1dc5('0x47')](handleError(_0x3e35fe,null));};exports[_0x1dc5('0x4a')]=function(_0x40eb3f,_0xb2032d,_0x2b29f8){var _0x1c7292={};var _0x1460b9={};var _0x5cca14;var _0x17c79b;return db['VtigerAccount'][_0x1dc5('0x4b')]({'where':{'id':_0x40eb3f[_0x1dc5('0x42')]['id']}})[_0x1dc5('0x24')](handleEntityNotFound(_0xb2032d,null))[_0x1dc5('0x24')](function(_0x26c2a8){if(_0x26c2a8){_0x5cca14=_0x26c2a8;_0x1460b9['model']=_['keys'](db[_0x1dc5('0x4c')][_0x1dc5('0x43')]);_0x1460b9[_0x1dc5('0x32')]=_[_0x1dc5('0x31')](_0x40eb3f[_0x1dc5('0x32')]);_0x1460b9['filters']=_[_0x1dc5('0x34')](_0x1460b9[_0x1dc5('0x30')],_0x1460b9[_0x1dc5('0x32')]);_0x1c7292[_0x1dc5('0x35')]=_[_0x1dc5('0x34')](_0x1460b9[_0x1dc5('0x30')],qs['fields'](_0x40eb3f[_0x1dc5('0x32')][_0x1dc5('0x36')]));_0x1c7292['attributes']=_0x1c7292['attributes'][_0x1dc5('0x44')]?_0x1c7292[_0x1dc5('0x35')]:_0x1460b9['model'];_0x1c7292[_0x1dc5('0x4d')]=qs[_0x1dc5('0x38')](_0x40eb3f['query'][_0x1dc5('0x38')]);_0x1c7292[_0x1dc5('0x39')]=qs[_0x1dc5('0x33')](_[_0x1dc5('0x3a')](_0x40eb3f[_0x1dc5('0x32')],_0x1460b9[_0x1dc5('0x33')]));if(_0x40eb3f['query'][_0x1dc5('0x3b')]){_0x1c7292['where']=_[_0x1dc5('0x3c')](_0x1c7292[_0x1dc5('0x39')],{'$or':_['map'](_0x1c7292[_0x1dc5('0x35')],function(_0x1193be){var _0x5ad3c7={};_0x5ad3c7[_0x1193be]={'$like':'%'+_0x40eb3f['query']['filter']+'%'};return _0x5ad3c7;})});}_0x1c7292=_[_0x1dc5('0x3c')]({},_0x1c7292,_0x40eb3f[_0x1dc5('0x3f')]);return _0x5cca14[_0x1dc5('0x4a')](_0x1c7292);}})['then'](function(_0x5a0e41){if(_0x5a0e41){_0x17c79b=_0x5a0e41[_0x1dc5('0x44')];if(!_0x40eb3f[_0x1dc5('0x32')][_0x1dc5('0x4e')](_0x1dc5('0x37'))){_0x1c7292[_0x1dc5('0x1b')]=qs[_0x1dc5('0x1b')](_0x40eb3f['query'][_0x1dc5('0x1b')]);_0x1c7292['offset']=qs[_0x1dc5('0x1d')](_0x40eb3f['query']['offset']);}return _0x5cca14['getConfigurations'](_0x1c7292);}})['then'](function(_0xea4e32){if(_0xea4e32){return _0xea4e32?{'count':_0x17c79b,'rows':_0xea4e32}:null;}})[_0x1dc5('0x24')](respondWithResult(_0xb2032d,null))[_0x1dc5('0x47')](handleError(_0xb2032d,null));};exports[_0x1dc5('0x4f')]=function(_0x2dbaff,_0x507ed3,_0x1e8922){if(_0x2dbaff[_0x1dc5('0x49')]['id']){delete _0x2dbaff[_0x1dc5('0x49')]['id'];}return db[_0x1dc5('0x2c')][_0x1dc5('0x4b')]({'where':{'id':_0x2dbaff[_0x1dc5('0x42')]['id']}})['then'](handleEntityNotFound(_0x507ed3,null))['then'](function(_0x2b5758){if(_0x2b5758){_0x2dbaff['body'][_0x1dc5('0x50')]=_0x2b5758['id'];_0x2dbaff[_0x1dc5('0x49')][_0x1dc5('0x51')]=integrations['getSubjects'](_0x2dbaff[_0x1dc5('0x49')]['channel'],_0x2dbaff[_0x1dc5('0x49')][_0x1dc5('0x2e')]);_0x2dbaff[_0x1dc5('0x49')]['Descriptions']=integrations[_0x1dc5('0x52')](_0x2dbaff[_0x1dc5('0x49')][_0x1dc5('0x53')],_0x2dbaff[_0x1dc5('0x49')]['type']);return db[_0x1dc5('0x4c')][_0x1dc5('0x48')](_0x2dbaff['body'],{'include':[{'model':db['VtigerField'],'as':_0x1dc5('0x51')},{'model':db[_0x1dc5('0x54')],'as':_0x1dc5('0x55')}]});}return null;})[_0x1dc5('0x24')](respondWithResult(_0x507ed3,null))['catch'](handleError(_0x507ed3,null));};var md5=require(_0x1dc5('0x56'));exports['getFields']=function(_0x136e83,_0x46734b,_0x204ea2){var _0x41bdb2=null;var _0x1577c5=null;var _0x27aafd=null;var _0x20c6bd=null;var _0x38d222='';return db[_0x1dc5('0x2c')][_0x1dc5('0x4b')]({'where':{'id':_0x136e83[_0x1dc5('0x42')]['id']},'attributes':['id',_0x1dc5('0x3e'),_0x1dc5('0x57'),_0x1dc5('0x58'),'moduleName',_0x1dc5('0x59'),'serverUrl','accessKey']})['then'](handleEntityNotFound(_0x46734b,null))['then'](function(_0x789b4e){if(_0x789b4e){_0x41bdb2=_0x789b4e[_0x1dc5('0x57')];_0x1577c5=_0x789b4e[_0x1dc5('0x5a')];_0x27aafd=_0x789b4e[_0x1dc5('0x5b')];_0x38d222=_0x789b4e[_0x1dc5('0x59')];var _0x1acaa0=_0x38d222[_0x1dc5('0x5c')](-0x1);if(_0x1acaa0==='/'){_0x38d222=_0x38d222[_0x1dc5('0x5d')](0x0,_0x38d222[_0x1dc5('0x5e')](_0x1acaa0));}_0x20c6bd=util['format'](_0x1dc5('0x5f'),_0x38d222);var _0x958003={'method':_0x1dc5('0x60'),'uri':_0x20c6bd,'qs':{'operation':_0x1dc5('0x61'),'username':_0x789b4e[_0x1dc5('0x57')]},'json':!![]};return rp(_0x958003);}})[_0x1dc5('0x24')](function(_0x4510b5){if(_0x4510b5[_0x1dc5('0x62')]){var _0x70a761={'method':_0x1dc5('0x63'),'uri':_0x20c6bd,'form':{'operation':_0x1dc5('0x64'),'username':_0x41bdb2,'accessKey':md5(_0x4510b5['result'][_0x1dc5('0x65')]+_0x1577c5)},'json':!![]};return rp(_0x70a761);}})[_0x1dc5('0x24')](function(_0x475cb9){if(_0x475cb9[_0x1dc5('0x62')]){var _0x1112b7={'method':_0x1dc5('0x60'),'uri':_0x20c6bd,'qs':{'operation':_0x1dc5('0x66'),'username':_0x41bdb2,'sessionName':_0x475cb9['result'][_0x1dc5('0x67')],'elementType':_0x27aafd},'json':!![]};return rp(_0x1112b7);}})[_0x1dc5('0x24')](function(_0xbaf2d3){if(_0xbaf2d3[_0x1dc5('0x62')]){var _0xc2a376=[_0x1dc5('0x68'),_0x1dc5('0x69'),_0x1dc5('0x6a')];_[_0x1dc5('0x6b')](_0xbaf2d3[_0x1dc5('0x6c')][_0x1dc5('0x36')],function(_0x2d2522){return _0xc2a376['includes'](_0x2d2522[_0x1dc5('0x2e')][_0x1dc5('0x3e')]);});_[_0x1dc5('0x6b')](_0xbaf2d3[_0x1dc5('0x6c')][_0x1dc5('0x36')],function(_0x40cf41){return _0x40cf41[_0x1dc5('0x6d')]===_0x1dc5('0x6e');});return{'count':_0xbaf2d3['result'][_0x1dc5('0x36')][_0x1dc5('0x44')],'rows':_[_0x1dc5('0x2b')](_0xbaf2d3[_0x1dc5('0x6c')][_0x1dc5('0x36')],function(_0xcf5c29){return{'id':_0xcf5c29['name'],'name':_0xcf5c29[_0x1dc5('0x6f')],'custom':_[_0x1dc5('0x70')](_0xcf5c29[_0x1dc5('0x3e')],_0x1dc5('0x71'))?!![]:![],'options':_0xcf5c29['type']['name']==='picklist'&&_0xcf5c29['type'][_0x1dc5('0x72')][_0x1dc5('0x44')]>0x0?_[_0x1dc5('0x2b')](_0xcf5c29['type'][_0x1dc5('0x72')],function(_0x1e4834){return{'name':_0x1e4834[_0x1dc5('0x6f')],'value':_0x1e4834['value']};}):[]};})};}})[_0x1dc5('0x24')](respondWithResult(_0x46734b,null))[_0x1dc5('0x47')](function(_0x89302e){console[_0x1dc5('0x73')](_0x1dc5('0x74')+_0x89302e);var _0x3be04c=_0x136e83[_0x1dc5('0x32')][_0x1dc5('0x75')]?0x1f4:_0x89302e['statusCode']||0x1f4;logger[_0x1dc5('0x28')](_0x1dc5('0x76'),_0x1dc5('0x77'),_0x3be04c,JSON[_0x1dc5('0x78')](_0x89302e));delete _0x89302e[_0x1dc5('0x3e')];if(_0x3be04c===0x191){_0x3be04c=0x190;}_0x46734b[_0x1dc5('0x26')](_0x3be04c)['send'](_0x136e83[_0x1dc5('0x32')]['test']?{'message':_0x1dc5('0x79'),'statusCode':_0x89302e[_0x1dc5('0x7a')]}:_0x89302e);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index ce6e802..3b599d6 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 _0xabba=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util'];(function(_0x140bfc,_0x305073){var _0x4a4e9a=function(_0x1d313e){while(--_0x1d313e){_0x140bfc['push'](_0x140bfc['shift']());}};_0x4a4e9a(++_0x305073);}(_0xabba,0xc2));var _0xaabb=function(_0x27e9c4,_0x2f7b02){_0x27e9c4=_0x27e9c4-0x0;var _0x5273ec=_0xabba[_0x27e9c4];return _0x5273ec;};'use strict';var _=require(_0xaabb('0x0'));var util=require(_0xaabb('0x1'));var logger=require('../../config/logger')(_0xaabb('0x2'));var moment=require(_0xaabb('0x3'));var BPromise=require(_0xaabb('0x4'));var rp=require(_0xaabb('0x5'));var fs=require('fs');var path=require(_0xaabb('0x6'));var rimraf=require(_0xaabb('0x7'));var config=require(_0xaabb('0x8'));var attributes=require(_0xaabb('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xaabb('0xa')]=function(_0x15c687,_0x5add7a){return _0x15c687[_0xaabb('0xb')](_0xaabb('0xc'),attributes,{'tableName':_0xaabb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6c5=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x19c7bf,_0x130f9d){var _0x4c5970=function(_0x4fc7cf){while(--_0x4fc7cf){_0x19c7bf['push'](_0x19c7bf['shift']());}};_0x4c5970(++_0x130f9d);}(_0xb6c5,0x173));var _0x5b6c=function(_0x58bbfd,_0x2554cf){_0x58bbfd=_0x58bbfd-0x0;var _0x31c79c=_0xb6c5[_0x58bbfd];return _0x31c79c;};'use strict';var _=require(_0x5b6c('0x0'));var util=require(_0x5b6c('0x1'));var logger=require(_0x5b6c('0x2'))(_0x5b6c('0x3'));var moment=require('moment');var BPromise=require(_0x5b6c('0x4'));var rp=require(_0x5b6c('0x5'));var fs=require('fs');var path=require(_0x5b6c('0x6'));var rimraf=require('rimraf');var config=require(_0x5b6c('0x7'));var attributes=require(_0x5b6c('0x8'));var integrations=require(_0x5b6c('0x9'));module[_0x5b6c('0xa')]=function(_0x8c1594,_0x5550ed){return _0x8c1594[_0x5b6c('0xb')](_0x5b6c('0xc'),attributes,{'tableName':_0x5b6c('0xd'),'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 df326de..517a01f 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 _0x7334=['code','message','request\x20sent','result','GetVtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','VtigerAccount','find','ShowVtigerAccount','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7334,0x184));var _0x4733=function(_0x49a0b9,_0x8201dd){_0x49a0b9=_0x49a0b9-0x0;var _0x457f3e=_0x7334[_0x49a0b9];return _0x457f3e;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var moment=require(_0x4733('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4733('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var config=require(_0x4733('0x7'));var jayson=require(_0x4733('0x8'));var client=jayson[_0x4733('0x9')][_0x4733('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x283754,_0x12cafa,_0x43d95c){return new BPromise(function(_0x8257cf,_0x3562b7){return client[_0x4733('0xb')](_0x283754,_0x43d95c)[_0x4733('0xc')](function(_0x2d5fde){logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,'request\x20sent');logger[_0x4733('0xf')](_0x4733('0x10'),_0x12cafa,'request\x20sent',JSON[_0x4733('0x11')](_0x2d5fde));if(_0x2d5fde['error']){if(_0x2d5fde[_0x4733('0x12')][_0x4733('0x13')]===0x1f4){logger[_0x4733('0x12')](_0x4733('0xe'),_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x3562b7(_0x2d5fde[_0x4733('0x12')]['message']);}logger[_0x4733('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x8257cf(_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);}else{logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,_0x4733('0x15'));_0x8257cf(_0x2d5fde[_0x4733('0x16')][_0x4733('0x14')]);}})['catch'](function(_0x2c0031){logger[_0x4733('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x12cafa,_0x2c0031);_0x3562b7(_0x2c0031);});});}exports[_0x4733('0x17')]=function(_0x1d2fb6){var _0x2aa223=this;return new Promise(function(_0x384e0c,_0x579f67){return db['VtigerAccount'][_0x4733('0x18')]({'raw':_0x1d2fb6[_0x4733('0x19')]?_0x1d2fb6['options'][_0x4733('0x1a')]===undefined?!![]:![]:!![],'where':_0x1d2fb6[_0x4733('0x19')]?_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1b')]||null:null,'attributes':_0x1d2fb6['options']?_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1c')]||null:null,'limit':_0x1d2fb6['options']?_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1d')]||null:null,'include':_0x1d2fb6['options']?_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1e')]?_[_0x4733('0x1f')](_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1e')],function(_0x24db74){return{'model':db[_0x24db74[_0x4733('0x20')]],'as':_0x24db74['as'],'attributes':_0x24db74[_0x4733('0x1c')],'include':_0x24db74['include']?_[_0x4733('0x1f')](_0x24db74[_0x4733('0x1e')],function(_0x7884e5){return{'model':db[_0x7884e5[_0x4733('0x20')]],'as':_0x7884e5['as'],'attributes':_0x7884e5[_0x4733('0x1c')],'include':_0x7884e5[_0x4733('0x1e')]?_[_0x4733('0x1f')](_0x7884e5[_0x4733('0x1e')],function(_0x13bc12){return{'model':db[_0x13bc12[_0x4733('0x20')]],'as':_0x13bc12['as'],'attributes':_0x13bc12['attributes']};}):[]};}):[]};}):[]:[]})[_0x4733('0xc')](function(_0x4c91bc){logger['info'](_0x4733('0x17'),_0x1d2fb6);logger['debug'](_0x4733('0x17'),_0x1d2fb6,JSON['stringify'](_0x4c91bc));_0x384e0c(_0x4c91bc);})['catch'](function(_0x517c73){logger[_0x4733('0x12')](_0x4733('0x17'),_0x517c73[_0x4733('0x14')],_0x1d2fb6);_0x579f67(_0x2aa223[_0x4733('0x12')](0x1f4,_0x517c73['message']));});});};exports['ShowVtigerAccount']=function(_0x50f67e){var _0x2b2757=this;return new Promise(function(_0x56872b,_0x5a4814){return db[_0x4733('0x21')][_0x4733('0x22')]({'raw':_0x50f67e[_0x4733('0x19')]?_0x50f67e['options']['raw']===undefined?!![]:![]:!![],'where':_0x50f67e[_0x4733('0x19')]?_0x50f67e[_0x4733('0x19')][_0x4733('0x1b')]||null:null,'attributes':_0x50f67e[_0x4733('0x19')]?_0x50f67e[_0x4733('0x19')]['attributes']||null:null,'include':_0x50f67e[_0x4733('0x19')]?_0x50f67e[_0x4733('0x19')][_0x4733('0x1e')]?_[_0x4733('0x1f')](_0x50f67e[_0x4733('0x19')]['include'],function(_0x570bc6){return{'model':db[_0x570bc6[_0x4733('0x20')]],'as':_0x570bc6['as'],'attributes':_0x570bc6[_0x4733('0x1c')],'include':_0x570bc6[_0x4733('0x1e')]?_[_0x4733('0x1f')](_0x570bc6[_0x4733('0x1e')],function(_0x5e31c8){return{'model':db[_0x5e31c8[_0x4733('0x20')]],'as':_0x5e31c8['as'],'attributes':_0x5e31c8[_0x4733('0x1c')],'include':_0x5e31c8[_0x4733('0x1e')]?_['map'](_0x5e31c8[_0x4733('0x1e')],function(_0x10a5e9){return{'model':db[_0x10a5e9[_0x4733('0x20')]],'as':_0x10a5e9['as'],'attributes':_0x10a5e9[_0x4733('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4733('0xc')](function(_0x311c1d){logger[_0x4733('0xd')](_0x4733('0x23'),_0x50f67e);logger['debug'](_0x4733('0x23'),_0x50f67e,JSON['stringify'](_0x311c1d));_0x56872b(_0x311c1d);})[_0x4733('0x24')](function(_0x29db03){logger[_0x4733('0x12')](_0x4733('0x23'),_0x29db03[_0x4733('0x14')],_0x50f67e);_0x5a4814(_0x2b2757[_0x4733('0x12')](0x1f4,_0x29db03[_0x4733('0x14')]));});});}; \ No newline at end of file +var _0x39cb=['request','then','info','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','attributes','limit','map','include','model','debug','ShowVtigerAccount','raw','where','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5353a6,_0x385344){var _0x2e62e1=function(_0x23ce72){while(--_0x23ce72){_0x5353a6['push'](_0x5353a6['shift']());}};_0x2e62e1(++_0x385344);}(_0x39cb,0x1bd));var _0xb39c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x39cb[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var moment=require(_0xb39c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb39c('0x2'));var fs=require('fs');var Redis=require(_0xb39c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb39c('0x4'));var logger=require(_0xb39c('0x5'))(_0xb39c('0x6'));var config=require(_0xb39c('0x7'));var jayson=require(_0xb39c('0x8'));var client=jayson['client'][_0xb39c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fc868,_0x40112f,_0x3f2fbe){return new BPromise(function(_0x47d6d7,_0x5ae14a){return client[_0xb39c('0xa')](_0x2fc868,_0x3f2fbe)[_0xb39c('0xb')](function(_0x3ffb94){logger[_0xb39c('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x40112f,'request\x20sent');logger['debug'](_0xb39c('0xd'),_0x40112f,_0xb39c('0xe'),JSON[_0xb39c('0xf')](_0x3ffb94));if(_0x3ffb94[_0xb39c('0x10')]){if(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x11')]===0x1f4){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x3ffb94['error'][_0xb39c('0x13')]);return _0x5ae14a(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}logger['error'](_0xb39c('0x12'),_0x40112f,_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);return _0x47d6d7(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}else{logger[_0xb39c('0xc')](_0xb39c('0x12'),_0x40112f,'request\x20sent');_0x47d6d7(_0x3ffb94[_0xb39c('0x14')][_0xb39c('0x13')]);}})[_0xb39c('0x15')](function(_0x1c2c5f){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x1c2c5f);_0x5ae14a(_0x1c2c5f);});});}exports[_0xb39c('0x16')]=function(_0x4e02cf){var _0x35dade=this;return new Promise(function(_0x2eeae6,_0x559ad6){return db[_0xb39c('0x17')][_0xb39c('0x18')]({'raw':_0x4e02cf[_0xb39c('0x19')]?_0x4e02cf[_0xb39c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4e02cf[_0xb39c('0x19')]?_0x4e02cf[_0xb39c('0x19')]['where']||null:null,'attributes':_0x4e02cf[_0xb39c('0x19')]?_0x4e02cf[_0xb39c('0x19')][_0xb39c('0x1a')]||null:null,'limit':_0x4e02cf['options']?_0x4e02cf['options'][_0xb39c('0x1b')]||null:null,'include':_0x4e02cf[_0xb39c('0x19')]?_0x4e02cf[_0xb39c('0x19')]['include']?_[_0xb39c('0x1c')](_0x4e02cf[_0xb39c('0x19')][_0xb39c('0x1d')],function(_0x16f3b0){return{'model':db[_0x16f3b0[_0xb39c('0x1e')]],'as':_0x16f3b0['as'],'attributes':_0x16f3b0['attributes'],'include':_0x16f3b0[_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x16f3b0['include'],function(_0x1fd145){return{'model':db[_0x1fd145[_0xb39c('0x1e')]],'as':_0x1fd145['as'],'attributes':_0x1fd145[_0xb39c('0x1a')],'include':_0x1fd145[_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x1fd145['include'],function(_0x23a2f1){return{'model':db[_0x23a2f1[_0xb39c('0x1e')]],'as':_0x23a2f1['as'],'attributes':_0x23a2f1[_0xb39c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41fff2){logger[_0xb39c('0xc')]('GetVtigerAccount',_0x4e02cf);logger[_0xb39c('0x1f')](_0xb39c('0x16'),_0x4e02cf,JSON[_0xb39c('0xf')](_0x41fff2));_0x2eeae6(_0x41fff2);})['catch'](function(_0x714d20){logger[_0xb39c('0x10')]('GetVtigerAccount',_0x714d20[_0xb39c('0x13')],_0x4e02cf);_0x559ad6(_0x35dade['error'](0x1f4,_0x714d20[_0xb39c('0x13')]));});});};exports[_0xb39c('0x20')]=function(_0x309697){var _0x7339b4=this;return new Promise(function(_0x17eb7b,_0x52e642){return db[_0xb39c('0x17')]['find']({'raw':_0x309697[_0xb39c('0x19')]?_0x309697['options'][_0xb39c('0x21')]===undefined?!![]:![]:!![],'where':_0x309697[_0xb39c('0x19')]?_0x309697[_0xb39c('0x19')][_0xb39c('0x22')]||null:null,'attributes':_0x309697['options']?_0x309697['options'][_0xb39c('0x1a')]||null:null,'include':_0x309697[_0xb39c('0x19')]?_0x309697['options'][_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x309697[_0xb39c('0x19')][_0xb39c('0x1d')],function(_0x14a92f){return{'model':db[_0x14a92f[_0xb39c('0x1e')]],'as':_0x14a92f['as'],'attributes':_0x14a92f[_0xb39c('0x1a')],'include':_0x14a92f[_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x14a92f[_0xb39c('0x1d')],function(_0x15882d){return{'model':db[_0x15882d[_0xb39c('0x1e')]],'as':_0x15882d['as'],'attributes':_0x15882d[_0xb39c('0x1a')],'include':_0x15882d[_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x15882d[_0xb39c('0x1d')],function(_0x8e5a74){return{'model':db[_0x8e5a74[_0xb39c('0x1e')]],'as':_0x8e5a74['as'],'attributes':_0x8e5a74[_0xb39c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c2b40){logger[_0xb39c('0xc')]('ShowVtigerAccount',_0x309697);logger['debug']('ShowVtigerAccount',_0x309697,JSON[_0xb39c('0xf')](_0x2c2b40));_0x17eb7b(_0x2c2b40);})[_0xb39c('0x15')](function(_0xe6bc2e){logger['error'](_0xb39c('0x20'),_0xe6bc2e[_0xb39c('0x13')],_0x309697);_0x52e642(_0x7339b4[_0xb39c('0x10')](0x1f4,_0xe6bc2e[_0xb39c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 6e5cae5..9d0ffc6 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 _0xd168=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x29ecbe,_0xcd1751){var _0xab8b51=function(_0x33ea31){while(--_0x33ea31){_0x29ecbe['push'](_0x29ecbe['shift']());}};_0xab8b51(++_0xcd1751);}(_0xd168,0x173));var _0x8d16=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0xd168[_0xd09668];return _0x68726;};'use strict';var multer=require(_0x8d16('0x0'));var util=require(_0x8d16('0x1'));var path=require(_0x8d16('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8d16('0x3'));var auth=require(_0x8d16('0x4'));var interaction=require(_0x8d16('0x5'));var config=require(_0x8d16('0x6'));var controller=require('./intVtigerConfiguration.controller');router[_0x8d16('0x7')]('/',auth['isAuthenticated'](),controller[_0x8d16('0x8')]);router[_0x8d16('0x7')](_0x8d16('0x9'),auth[_0x8d16('0xa')](),controller[_0x8d16('0xb')]);router[_0x8d16('0x7')]('/:id/fields',auth[_0x8d16('0xa')](),controller['getFields']);router[_0x8d16('0x7')](_0x8d16('0xc'),auth['isAuthenticated'](),controller[_0x8d16('0xd')]);router[_0x8d16('0x7')](_0x8d16('0xe'),auth[_0x8d16('0xa')](),controller[_0x8d16('0xf')]);router[_0x8d16('0x10')]('/',auth[_0x8d16('0xa')](),controller[_0x8d16('0x11')]);router[_0x8d16('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8d16('0x13')]('/:id',auth[_0x8d16('0xa')](),controller[_0x8d16('0x14')]);module[_0x8d16('0x15')]=router; \ No newline at end of file +var _0xc6c6=['/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','delete','destroy','exports','path','express','fs-extra','../../components/auth/service','./intVtigerConfiguration.controller','get','isAuthenticated','index'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc6c6,0xb6));var _0x6c6c=function(_0x15106b,_0x4d96f6){_0x15106b=_0x15106b-0x0;var _0x521203=_0xc6c6[_0x15106b];return _0x521203;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6c6c('0x0'));var timeout=require('connect-timeout');var express=require(_0x6c6c('0x1'));var router=express['Router']();var fs_extra=require(_0x6c6c('0x2'));var auth=require(_0x6c6c('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6c6c('0x4'));router[_0x6c6c('0x5')]('/',auth[_0x6c6c('0x6')](),controller[_0x6c6c('0x7')]);router['get'](_0x6c6c('0x8'),auth[_0x6c6c('0x6')](),controller['show']);router[_0x6c6c('0x5')](_0x6c6c('0x9'),auth[_0x6c6c('0x6')](),controller[_0x6c6c('0xa')]);router[_0x6c6c('0x5')](_0x6c6c('0xb'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x6c6c('0x5')](_0x6c6c('0xc'),auth[_0x6c6c('0x6')](),controller[_0x6c6c('0xd')]);router['post']('/',auth[_0x6c6c('0x6')](),controller[_0x6c6c('0xe')]);router[_0x6c6c('0xf')](_0x6c6c('0x8'),auth[_0x6c6c('0x6')](),controller['update']);router[_0x6c6c('0x10')](_0x6c6c('0x8'),auth[_0x6c6c('0x6')](),controller[_0x6c6c('0x11')]);module[_0x6c6c('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index dc35f65..877e2c4 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 _0x9006=['exports','STRING'];(function(_0x4fae14,_0x4ef118){var _0x305e46=function(_0x3f4c4a){while(--_0x3f4c4a){_0x4fae14['push'](_0x4fae14['shift']());}};_0x305e46(++_0x4ef118);}(_0x9006,0x122));var _0x6900=function(_0x18aa5d,_0x2b76c4){_0x18aa5d=_0x18aa5d-0x0;var _0x3df059=_0x9006[_0x18aa5d];return _0x3df059;};'use strict';var Sequelize=require('sequelize');module[_0x6900('0x0')]={'name':{'type':Sequelize[_0x6900('0x1')]},'description':{'type':Sequelize[_0x6900('0x1')]}}; \ No newline at end of file +var _0x50d5=['STRING','sequelize'];(function(_0x5562c5,_0x36071d){var _0x51fcf3=function(_0x2cfe90){while(--_0x2cfe90){_0x5562c5['push'](_0x5562c5['shift']());}};_0x51fcf3(++_0x36071d);}(_0x50d5,0x1e7));var _0x550d=function(_0x479d28,_0x344b0a){_0x479d28=_0x479d28-0x0;var _0x35ba93=_0x50d5[_0x479d28];return _0x35ba93;};'use strict';var Sequelize=require(_0x550d('0x0'));module['exports']={'name':{'type':Sequelize[_0x550d('0x1')]},'description':{'type':Sequelize[_0x550d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 06291eb..976c75d 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 _0xd66c=['merge','options','includeAll','include','findAll','rows','catch','show','fields','create','body','params','find','getFields','findOne','nolimit','VtigerField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','limit','count','status','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd66c,0x106));var _0xcd66=function(_0x1606b2,_0x32eed6){_0x1606b2=_0x1606b2-0x0;var _0x1339ca=_0xd66c[_0x1606b2];return _0x1339ca;};'use strict';var emlformat=require(_0xcd66('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd66('0x1'));var jsonpatch=require(_0xcd66('0x2'));var rp=require(_0xcd66('0x3'));var moment=require(_0xcd66('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcd66('0x5'));var util=require(_0xcd66('0x6'));var path=require(_0xcd66('0x7'));var sox=require(_0xcd66('0x8'));var csv=require(_0xcd66('0x9'));var ejs=require(_0xcd66('0xa'));var fs=require('fs');var fs_extra=require(_0xcd66('0xb'));var _=require(_0xcd66('0xc'));var squel=require('squel');var crypto=require(_0xcd66('0xd'));var jsforce=require(_0xcd66('0xe'));var deskjs=require(_0xcd66('0xf'));var toCsv=require(_0xcd66('0x9'));var querystring=require(_0xcd66('0x10'));var Papa=require(_0xcd66('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcd66('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcd66('0x13'));var logger=require(_0xcd66('0x14'))('api');var utils=require(_0xcd66('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcd66('0x16'));var db=require(_0xcd66('0x17'))['db'];function respondWithStatusCode(_0x1cb4a9,_0x3e4e92){_0x3e4e92=_0x3e4e92||0xcc;return function(_0x35479d){if(_0x35479d){return _0x1cb4a9['sendStatus'](_0x3e4e92);}return _0x1cb4a9['status'](_0x3e4e92)[_0xcd66('0x18')]();};}function respondWithResult(_0x5d9bb4,_0x28ae0c){_0x28ae0c=_0x28ae0c||0xc8;return function(_0x588b46){if(_0x588b46){return _0x5d9bb4['status'](_0x28ae0c)[_0xcd66('0x19')](_0x588b46);}};}function respondWithFilteredResult(_0x1fafad,_0x4df4df){return function(_0x3178a7){if(_0x3178a7){var _0x3ed659=typeof _0x4df4df[_0xcd66('0x1a')]==='undefined'&&typeof _0x4df4df[_0xcd66('0x1b')]==='undefined';var _0x1268db=_0x3178a7[_0xcd66('0x1c')];var _0x191f8e=_0x3ed659?0x0:_0x4df4df[_0xcd66('0x1a')];var _0x35d431=_0x3ed659?_0x3178a7[_0xcd66('0x1c')]:_0x4df4df[_0xcd66('0x1a')]+_0x4df4df[_0xcd66('0x1b')];var _0x417907;if(_0x35d431>=_0x1268db){_0x35d431=_0x1268db;_0x417907=0xc8;}else{_0x417907=0xce;}_0x1fafad[_0xcd66('0x1d')](_0x417907);return _0x1fafad[_0xcd66('0x1e')](_0xcd66('0x1f'),_0x191f8e+'-'+_0x35d431+'/'+_0x1268db)[_0xcd66('0x19')](_0x3178a7);}return null;};}function patchUpdates(_0x2d3819){return function(_0x842033){try{jsonpatch['apply'](_0x842033,_0x2d3819,!![]);}catch(_0x3e3bea){return BPromise[_0xcd66('0x20')](_0x3e3bea);}return _0x842033[_0xcd66('0x21')]();};}function saveUpdates(_0x11c75c,_0x1cc184){return function(_0x1f8a04){if(_0x1f8a04){return _0x1f8a04[_0xcd66('0x22')](_0x11c75c)[_0xcd66('0x23')](function(_0x64424a){return _0x64424a;});}return null;};}function removeEntity(_0x35e19e,_0x5ec2d5){return function(_0x2ab69e){if(_0x2ab69e){return _0x2ab69e[_0xcd66('0x24')]()['then'](function(){_0x35e19e[_0xcd66('0x1d')](0xcc)[_0xcd66('0x18')]();});}};}function handleEntityNotFound(_0xb37e77,_0x526e13){return function(_0x141a64){if(!_0x141a64){_0xb37e77[_0xcd66('0x25')](0x194);}return _0x141a64;};}function handleError(_0x3de898,_0x54ac81){_0x54ac81=_0x54ac81||0x1f4;return function(_0x12891d){logger[_0xcd66('0x26')](_0x12891d[_0xcd66('0x27')]);if(_0x12891d[_0xcd66('0x28')]){delete _0x12891d[_0xcd66('0x28')];}_0x3de898[_0xcd66('0x1d')](_0x54ac81)[_0xcd66('0x29')](_0x12891d);};}exports[_0xcd66('0x2a')]=function(_0x51201f,_0xb6d828){var _0x51a7f6={},_0x2506d3={},_0x851a5c={'count':0x0,'rows':[]};var _0x2dfa40=_[_0xcd66('0x2b')](db[_0xcd66('0x2c')][_0xcd66('0x2d')],function(_0x54597e){return{'name':_0x54597e[_0xcd66('0x2e')],'type':_0x54597e[_0xcd66('0x2f')][_0xcd66('0x30')]};});_0x2506d3[_0xcd66('0x31')]=_['map'](_0x2dfa40,_0xcd66('0x28'));_0x2506d3[_0xcd66('0x32')]=_[_0xcd66('0x33')](_0x51201f[_0xcd66('0x32')]);_0x2506d3[_0xcd66('0x34')]=_['intersection'](_0x2506d3[_0xcd66('0x31')],_0x2506d3[_0xcd66('0x32')]);_0x51a7f6[_0xcd66('0x35')]=_[_0xcd66('0x36')](_0x2506d3['model'],qs['fields'](_0x51201f[_0xcd66('0x32')]['fields']));_0x51a7f6[_0xcd66('0x35')]=_0x51a7f6[_0xcd66('0x35')][_0xcd66('0x37')]?_0x51a7f6[_0xcd66('0x35')]:_0x2506d3[_0xcd66('0x31')];if(!_0x51201f[_0xcd66('0x32')][_0xcd66('0x38')]('nolimit')){_0x51a7f6[_0xcd66('0x1b')]=qs[_0xcd66('0x1b')](_0x51201f[_0xcd66('0x32')][_0xcd66('0x1b')]);_0x51a7f6['offset']=qs[_0xcd66('0x1a')](_0x51201f[_0xcd66('0x32')][_0xcd66('0x1a')]);}_0x51a7f6[_0xcd66('0x39')]=qs[_0xcd66('0x3a')](_0x51201f[_0xcd66('0x32')][_0xcd66('0x3a')]);_0x51a7f6[_0xcd66('0x3b')]=qs[_0xcd66('0x34')](_[_0xcd66('0x3c')](_0x51201f[_0xcd66('0x32')],_0x2506d3[_0xcd66('0x34')]),_0x2dfa40);if(_0x51201f[_0xcd66('0x32')][_0xcd66('0x3d')]){_0x51a7f6[_0xcd66('0x3b')]=_[_0xcd66('0x3e')](_0x51a7f6[_0xcd66('0x3b')],{'$or':_[_0xcd66('0x2b')](_0x2dfa40,function(_0x17a327){if(_0x17a327['type']!=='VIRTUAL'){var _0x8e55c6={};_0x8e55c6[_0x17a327['name']]={'$like':'%'+_0x51201f[_0xcd66('0x32')][_0xcd66('0x3d')]+'%'};return _0x8e55c6;}})});}_0x51a7f6=_[_0xcd66('0x3e')]({},_0x51a7f6,_0x51201f[_0xcd66('0x3f')]);var _0x2bfb26={'where':_0x51a7f6['where']};return db[_0xcd66('0x2c')][_0xcd66('0x1c')](_0x2bfb26)['then'](function(_0xd6bd6f){_0x851a5c[_0xcd66('0x1c')]=_0xd6bd6f;if(_0x51201f['query'][_0xcd66('0x40')]){_0x51a7f6[_0xcd66('0x41')]=[{'all':!![]}];}return db[_0xcd66('0x2c')][_0xcd66('0x42')](_0x51a7f6);})[_0xcd66('0x23')](function(_0x285ef4){_0x851a5c[_0xcd66('0x43')]=_0x285ef4;return _0x851a5c;})['then'](respondWithFilteredResult(_0xb6d828,_0x51a7f6))[_0xcd66('0x44')](handleError(_0xb6d828,null));};exports[_0xcd66('0x45')]=function(_0x2bb778,_0x333ee1){var _0x62802e={'raw':![],'where':{'id':_0x2bb778['params']['id']}},_0x7e904d={};_0x7e904d[_0xcd66('0x31')]=_[_0xcd66('0x33')](db[_0xcd66('0x2c')][_0xcd66('0x2d')]);_0x7e904d['query']=_[_0xcd66('0x33')](_0x2bb778[_0xcd66('0x32')]);_0x7e904d[_0xcd66('0x34')]=_[_0xcd66('0x36')](_0x7e904d[_0xcd66('0x31')],_0x7e904d[_0xcd66('0x32')]);_0x62802e[_0xcd66('0x35')]=_[_0xcd66('0x36')](_0x7e904d[_0xcd66('0x31')],qs[_0xcd66('0x46')](_0x2bb778[_0xcd66('0x32')][_0xcd66('0x46')]));_0x62802e[_0xcd66('0x35')]=_0x62802e[_0xcd66('0x35')][_0xcd66('0x37')]?_0x62802e[_0xcd66('0x35')]:_0x7e904d[_0xcd66('0x31')];if(_0x2bb778['query'][_0xcd66('0x40')]){_0x62802e[_0xcd66('0x41')]=[{'all':!![]}];}_0x62802e=_[_0xcd66('0x3e')]({},_0x62802e,_0x2bb778[_0xcd66('0x3f')]);return db[_0xcd66('0x2c')]['find'](_0x62802e)[_0xcd66('0x23')](handleEntityNotFound(_0x333ee1,null))[_0xcd66('0x23')](respondWithResult(_0x333ee1,null))['catch'](handleError(_0x333ee1,null));};exports['create']=function(_0x533289,_0x11079c){return db[_0xcd66('0x2c')][_0xcd66('0x47')](_0x533289[_0xcd66('0x48')],{})[_0xcd66('0x23')](respondWithResult(_0x11079c,0xc9))[_0xcd66('0x44')](handleError(_0x11079c,null));};exports['update']=function(_0x2efa27,_0x558f09){if(_0x2efa27[_0xcd66('0x48')]['id']){delete _0x2efa27[_0xcd66('0x48')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x2efa27[_0xcd66('0x49')]['id']}})[_0xcd66('0x23')](handleEntityNotFound(_0x558f09,null))['then'](saveUpdates(_0x2efa27[_0xcd66('0x48')],null))['then'](respondWithResult(_0x558f09,null))[_0xcd66('0x44')](handleError(_0x558f09,null));};exports[_0xcd66('0x24')]=function(_0xb9051d,_0x52496f){return db[_0xcd66('0x2c')][_0xcd66('0x4a')]({'where':{'id':_0xb9051d[_0xcd66('0x49')]['id']}})[_0xcd66('0x23')](handleEntityNotFound(_0x52496f,null))[_0xcd66('0x23')](removeEntity(_0x52496f,null))['catch'](handleError(_0x52496f,null));};exports[_0xcd66('0x4b')]=function(_0x5e5da3,_0x5bef71,_0x1df983){var _0x497a51={};var _0x59f4aa={};var _0x3c4b3a;var _0x30fa56;return db[_0xcd66('0x2c')][_0xcd66('0x4c')]({'where':{'id':_0x5e5da3['params']['id']}})[_0xcd66('0x23')](handleEntityNotFound(_0x5bef71,null))[_0xcd66('0x23')](function(_0x1f7299){if(_0x1f7299){_0x3c4b3a=_0x1f7299;_0x59f4aa[_0xcd66('0x31')]=_[_0xcd66('0x33')](db['VtigerField'][_0xcd66('0x2d')]);_0x59f4aa[_0xcd66('0x32')]=_[_0xcd66('0x33')](_0x5e5da3['query']);_0x59f4aa['filters']=_[_0xcd66('0x36')](_0x59f4aa[_0xcd66('0x31')],_0x59f4aa[_0xcd66('0x32')]);_0x497a51[_0xcd66('0x35')]=_['intersection'](_0x59f4aa[_0xcd66('0x31')],qs[_0xcd66('0x46')](_0x5e5da3[_0xcd66('0x32')][_0xcd66('0x46')]));_0x497a51[_0xcd66('0x35')]=_0x497a51[_0xcd66('0x35')][_0xcd66('0x37')]?_0x497a51['attributes']:_0x59f4aa['model'];_0x497a51[_0xcd66('0x39')]=qs[_0xcd66('0x3a')](_0x5e5da3[_0xcd66('0x32')]['sort']);_0x497a51[_0xcd66('0x3b')]=qs[_0xcd66('0x34')](_[_0xcd66('0x3c')](_0x5e5da3[_0xcd66('0x32')],_0x59f4aa[_0xcd66('0x34')]));if(_0x5e5da3[_0xcd66('0x32')][_0xcd66('0x3d')]){_0x497a51['where']=_[_0xcd66('0x3e')](_0x497a51[_0xcd66('0x3b')],{'$or':_[_0xcd66('0x2b')](_0x497a51['attributes'],function(_0x2ca562){var _0x580b17={};_0x580b17[_0x2ca562]={'$like':'%'+_0x5e5da3[_0xcd66('0x32')][_0xcd66('0x3d')]+'%'};return _0x580b17;})});}_0x497a51=_[_0xcd66('0x3e')]({},_0x497a51,_0x5e5da3[_0xcd66('0x3f')]);return _0x3c4b3a[_0xcd66('0x4b')](_0x497a51);}})['then'](function(_0xa1aa02){if(_0xa1aa02){_0x30fa56=_0xa1aa02[_0xcd66('0x37')];if(!_0x5e5da3[_0xcd66('0x32')]['hasOwnProperty'](_0xcd66('0x4d'))){_0x497a51['limit']=qs[_0xcd66('0x1b')](_0x5e5da3[_0xcd66('0x32')][_0xcd66('0x1b')]);_0x497a51[_0xcd66('0x1a')]=qs['offset'](_0x5e5da3[_0xcd66('0x32')]['offset']);}return _0x3c4b3a[_0xcd66('0x4b')](_0x497a51);}})[_0xcd66('0x23')](function(_0x4b54f5){if(_0x4b54f5){return _0x4b54f5?{'count':_0x30fa56,'rows':_0x4b54f5}:null;}})[_0xcd66('0x23')](respondWithResult(_0x5bef71,null))[_0xcd66('0x44')](handleError(_0x5bef71,null));};exports['getSubjects']=function(_0xe41bf7,_0x400b20,_0x3f605c){var _0x5e9d9c={};var _0x2194da={};var _0x2360c3;var _0x5d705f;return db[_0xcd66('0x2c')]['findOne']({'where':{'id':_0xe41bf7['params']['id']}})[_0xcd66('0x23')](handleEntityNotFound(_0x400b20,null))[_0xcd66('0x23')](function(_0x397090){if(_0x397090){_0x2360c3=_0x397090;_0x2194da[_0xcd66('0x31')]=_[_0xcd66('0x33')](db[_0xcd66('0x4e')][_0xcd66('0x2d')]);_0x2194da[_0xcd66('0x32')]=_[_0xcd66('0x33')](_0xe41bf7[_0xcd66('0x32')]);_0x2194da[_0xcd66('0x34')]=_[_0xcd66('0x36')](_0x2194da[_0xcd66('0x31')],_0x2194da[_0xcd66('0x32')]);_0x5e9d9c[_0xcd66('0x35')]=_['intersection'](_0x2194da[_0xcd66('0x31')],qs[_0xcd66('0x46')](_0xe41bf7[_0xcd66('0x32')][_0xcd66('0x46')]));_0x5e9d9c[_0xcd66('0x35')]=_0x5e9d9c[_0xcd66('0x35')][_0xcd66('0x37')]?_0x5e9d9c['attributes']:_0x2194da['model'];_0x5e9d9c[_0xcd66('0x39')]=qs[_0xcd66('0x3a')](_0xe41bf7['query'][_0xcd66('0x3a')]);_0x5e9d9c[_0xcd66('0x3b')]=qs['filters'](_['pick'](_0xe41bf7[_0xcd66('0x32')],_0x2194da['filters']));if(_0xe41bf7[_0xcd66('0x32')][_0xcd66('0x3d')]){_0x5e9d9c[_0xcd66('0x3b')]=_[_0xcd66('0x3e')](_0x5e9d9c[_0xcd66('0x3b')],{'$or':_[_0xcd66('0x2b')](_0x5e9d9c[_0xcd66('0x35')],function(_0x566829){var _0x373b23={};_0x373b23[_0x566829]={'$like':'%'+_0xe41bf7[_0xcd66('0x32')][_0xcd66('0x3d')]+'%'};return _0x373b23;})});}_0x5e9d9c=_[_0xcd66('0x3e')]({},_0x5e9d9c,_0xe41bf7['options']);return _0x2360c3[_0xcd66('0x4f')](_0x5e9d9c);}})[_0xcd66('0x23')](function(_0x69e525){if(_0x69e525){_0x5d705f=_0x69e525[_0xcd66('0x37')];if(!_0xe41bf7[_0xcd66('0x32')][_0xcd66('0x38')](_0xcd66('0x4d'))){_0x5e9d9c[_0xcd66('0x1b')]=qs['limit'](_0xe41bf7[_0xcd66('0x32')][_0xcd66('0x1b')]);_0x5e9d9c['offset']=qs[_0xcd66('0x1a')](_0xe41bf7[_0xcd66('0x32')][_0xcd66('0x1a')]);}return _0x2360c3[_0xcd66('0x4f')](_0x5e9d9c);}})[_0xcd66('0x23')](function(_0x249cf0){if(_0x249cf0){return _0x249cf0?{'count':_0x5d705f,'rows':_0x249cf0}:null;}})[_0xcd66('0x23')](respondWithResult(_0x400b20,null))[_0xcd66('0x44')](handleError(_0x400b20,null));};exports[_0xcd66('0x50')]=function(_0x1094ea,_0xc007df,_0x3a20e4){var _0x545b3b={};var _0x5dbdb0={};var _0x306656;var _0x1dfb54;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x1094ea[_0xcd66('0x49')]['id']}})[_0xcd66('0x23')](handleEntityNotFound(_0xc007df,null))['then'](function(_0x212b82){if(_0x212b82){_0x306656=_0x212b82;_0x5dbdb0[_0xcd66('0x31')]=_[_0xcd66('0x33')](db[_0xcd66('0x4e')]['rawAttributes']);_0x5dbdb0[_0xcd66('0x32')]=_[_0xcd66('0x33')](_0x1094ea[_0xcd66('0x32')]);_0x5dbdb0[_0xcd66('0x34')]=_[_0xcd66('0x36')](_0x5dbdb0['model'],_0x5dbdb0[_0xcd66('0x32')]);_0x545b3b['attributes']=_[_0xcd66('0x36')](_0x5dbdb0[_0xcd66('0x31')],qs[_0xcd66('0x46')](_0x1094ea[_0xcd66('0x32')]['fields']));_0x545b3b[_0xcd66('0x35')]=_0x545b3b[_0xcd66('0x35')][_0xcd66('0x37')]?_0x545b3b['attributes']:_0x5dbdb0[_0xcd66('0x31')];_0x545b3b[_0xcd66('0x39')]=qs['sort'](_0x1094ea[_0xcd66('0x32')][_0xcd66('0x3a')]);_0x545b3b[_0xcd66('0x3b')]=qs[_0xcd66('0x34')](_[_0xcd66('0x3c')](_0x1094ea[_0xcd66('0x32')],_0x5dbdb0['filters']));if(_0x1094ea[_0xcd66('0x32')][_0xcd66('0x3d')]){_0x545b3b[_0xcd66('0x3b')]=_['merge'](_0x545b3b[_0xcd66('0x3b')],{'$or':_['map'](_0x545b3b[_0xcd66('0x35')],function(_0x106629){var _0x3cd45d={};_0x3cd45d[_0x106629]={'$like':'%'+_0x1094ea[_0xcd66('0x32')][_0xcd66('0x3d')]+'%'};return _0x3cd45d;})});}_0x545b3b=_[_0xcd66('0x3e')]({},_0x545b3b,_0x1094ea['options']);return _0x306656[_0xcd66('0x50')](_0x545b3b);}})[_0xcd66('0x23')](function(_0x1abc47){if(_0x1abc47){_0x1dfb54=_0x1abc47[_0xcd66('0x37')];if(!_0x1094ea['query'][_0xcd66('0x38')](_0xcd66('0x4d'))){_0x545b3b['limit']=qs[_0xcd66('0x1b')](_0x1094ea['query']['limit']);_0x545b3b[_0xcd66('0x1a')]=qs[_0xcd66('0x1a')](_0x1094ea[_0xcd66('0x32')][_0xcd66('0x1a')]);}return _0x306656[_0xcd66('0x50')](_0x545b3b);}})[_0xcd66('0x23')](function(_0x5d6d3d){if(_0x5d6d3d){return _0x5d6d3d?{'count':_0x1dfb54,'rows':_0x5d6d3d}:null;}})['then'](respondWithResult(_0xc007df,null))[_0xcd66('0x44')](handleError(_0xc007df,null));}; \ No newline at end of file +var _0xfdc1=['VtigerConfiguration','rawAttributes','fieldName','type','query','filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','then','include','catch','show','keys','find','create','body','params','destroy','getFields','VtigerField','findOne','length','getDescriptions','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','error','stack','name','index','map'];(function(_0x36327e,_0x46fcdc){var _0x32b9ad=function(_0x1a90d2){while(--_0x1a90d2){_0x36327e['push'](_0x36327e['shift']());}};_0x32b9ad(++_0x46fcdc);}(_0xfdc1,0x71));var _0x1fdc=function(_0x28d7b5,_0x1305a4){_0x28d7b5=_0x28d7b5-0x0;var _0x1ed035=_0xfdc1[_0x28d7b5];return _0x1ed035;};'use strict';var emlformat=require(_0x1fdc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1fdc('0x1'));var jsonpatch=require(_0x1fdc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1fdc('0x3'));var Mustache=require(_0x1fdc('0x4'));var util=require(_0x1fdc('0x5'));var path=require(_0x1fdc('0x6'));var sox=require(_0x1fdc('0x7'));var csv=require(_0x1fdc('0x8'));var ejs=require(_0x1fdc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1fdc('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1fdc('0xb'));var deskjs=require(_0x1fdc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1fdc('0xd'));var Papa=require(_0x1fdc('0xe'));var Redis=require('ioredis');var authService=require(_0x1fdc('0xf'));var qs=require(_0x1fdc('0x10'));var as=require(_0x1fdc('0x11'));var hardwareService=require(_0x1fdc('0x12'));var logger=require(_0x1fdc('0x13'))(_0x1fdc('0x14'));var utils=require(_0x1fdc('0x15'));var config=require(_0x1fdc('0x16'));var licenseUtil=require(_0x1fdc('0x17'));var db=require(_0x1fdc('0x18'))['db'];function respondWithStatusCode(_0x2c7a3a,_0x118a2e){_0x118a2e=_0x118a2e||0xcc;return function(_0x2228fd){if(_0x2228fd){return _0x2c7a3a[_0x1fdc('0x19')](_0x118a2e);}return _0x2c7a3a['status'](_0x118a2e)[_0x1fdc('0x1a')]();};}function respondWithResult(_0xd5b977,_0x5e09e9){_0x5e09e9=_0x5e09e9||0xc8;return function(_0x5cfe90){if(_0x5cfe90){return _0xd5b977[_0x1fdc('0x1b')](_0x5e09e9)[_0x1fdc('0x1c')](_0x5cfe90);}};}function respondWithFilteredResult(_0x200700,_0x2b4c5d){return function(_0x199ed3){if(_0x199ed3){var _0x3d783e=typeof _0x2b4c5d[_0x1fdc('0x1d')]===_0x1fdc('0x1e')&&typeof _0x2b4c5d[_0x1fdc('0x1f')]==='undefined';var _0x381707=_0x199ed3[_0x1fdc('0x20')];var _0x2b1b2b=_0x3d783e?0x0:_0x2b4c5d[_0x1fdc('0x1d')];var _0x46ea3e=_0x3d783e?_0x199ed3[_0x1fdc('0x20')]:_0x2b4c5d[_0x1fdc('0x1d')]+_0x2b4c5d[_0x1fdc('0x1f')];var _0x1215d8;if(_0x46ea3e>=_0x381707){_0x46ea3e=_0x381707;_0x1215d8=0xc8;}else{_0x1215d8=0xce;}_0x200700[_0x1fdc('0x1b')](_0x1215d8);return _0x200700[_0x1fdc('0x21')](_0x1fdc('0x22'),_0x2b1b2b+'-'+_0x46ea3e+'/'+_0x381707)[_0x1fdc('0x1c')](_0x199ed3);}return null;};}function patchUpdates(_0x2cf343){return function(_0xd90f0a){try{jsonpatch[_0x1fdc('0x23')](_0xd90f0a,_0x2cf343,!![]);}catch(_0x4e08fd){return BPromise[_0x1fdc('0x24')](_0x4e08fd);}return _0xd90f0a['save']();};}function saveUpdates(_0x25b5c2,_0x3bf72a){return function(_0x2a2a41){if(_0x2a2a41){return _0x2a2a41[_0x1fdc('0x25')](_0x25b5c2)['then'](function(_0x5c13ee){return _0x5c13ee;});}return null;};}function removeEntity(_0x57fcec,_0x3eae26){return function(_0x374762){if(_0x374762){return _0x374762['destroy']()['then'](function(){_0x57fcec['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d8d56,_0x427f85){return function(_0x28c709){if(!_0x28c709){_0x5d8d56[_0x1fdc('0x19')](0x194);}return _0x28c709;};}function handleError(_0x210865,_0x36c8ea){_0x36c8ea=_0x36c8ea||0x1f4;return function(_0x15b197){logger[_0x1fdc('0x26')](_0x15b197[_0x1fdc('0x27')]);if(_0x15b197[_0x1fdc('0x28')]){delete _0x15b197[_0x1fdc('0x28')];}_0x210865[_0x1fdc('0x1b')](_0x36c8ea)['send'](_0x15b197);};}exports[_0x1fdc('0x29')]=function(_0x48fc58,_0x55e7fc){var _0xd99ed2={},_0x4e7f49={},_0x46df80={'count':0x0,'rows':[]};var _0x1544a3=_[_0x1fdc('0x2a')](db[_0x1fdc('0x2b')][_0x1fdc('0x2c')],function(_0x52ab33){return{'name':_0x52ab33[_0x1fdc('0x2d')],'type':_0x52ab33[_0x1fdc('0x2e')]['key']};});_0x4e7f49['model']=_[_0x1fdc('0x2a')](_0x1544a3,'name');_0x4e7f49[_0x1fdc('0x2f')]=_['keys'](_0x48fc58[_0x1fdc('0x2f')]);_0x4e7f49[_0x1fdc('0x30')]=_[_0x1fdc('0x31')](_0x4e7f49['model'],_0x4e7f49[_0x1fdc('0x2f')]);_0xd99ed2['attributes']=_[_0x1fdc('0x31')](_0x4e7f49['model'],qs[_0x1fdc('0x32')](_0x48fc58[_0x1fdc('0x2f')][_0x1fdc('0x32')]));_0xd99ed2[_0x1fdc('0x33')]=_0xd99ed2[_0x1fdc('0x33')]['length']?_0xd99ed2[_0x1fdc('0x33')]:_0x4e7f49[_0x1fdc('0x34')];if(!_0x48fc58[_0x1fdc('0x2f')][_0x1fdc('0x35')](_0x1fdc('0x36'))){_0xd99ed2['limit']=qs['limit'](_0x48fc58['query']['limit']);_0xd99ed2[_0x1fdc('0x1d')]=qs[_0x1fdc('0x1d')](_0x48fc58[_0x1fdc('0x2f')][_0x1fdc('0x1d')]);}_0xd99ed2[_0x1fdc('0x37')]=qs['sort'](_0x48fc58[_0x1fdc('0x2f')][_0x1fdc('0x38')]);_0xd99ed2[_0x1fdc('0x39')]=qs['filters'](_[_0x1fdc('0x3a')](_0x48fc58[_0x1fdc('0x2f')],_0x4e7f49['filters']),_0x1544a3);if(_0x48fc58[_0x1fdc('0x2f')]['filter']){_0xd99ed2[_0x1fdc('0x39')]=_[_0x1fdc('0x3b')](_0xd99ed2[_0x1fdc('0x39')],{'$or':_[_0x1fdc('0x2a')](_0x1544a3,function(_0x54574a){if(_0x54574a[_0x1fdc('0x2e')]!==_0x1fdc('0x3c')){var _0x5702e9={};_0x5702e9[_0x54574a[_0x1fdc('0x28')]]={'$like':'%'+_0x48fc58[_0x1fdc('0x2f')][_0x1fdc('0x3d')]+'%'};return _0x5702e9;}})});}_0xd99ed2=_[_0x1fdc('0x3b')]({},_0xd99ed2,_0x48fc58[_0x1fdc('0x3e')]);var _0x6408c0={'where':_0xd99ed2[_0x1fdc('0x39')]};return db[_0x1fdc('0x2b')][_0x1fdc('0x20')](_0x6408c0)[_0x1fdc('0x3f')](function(_0x1893ea){_0x46df80[_0x1fdc('0x20')]=_0x1893ea;if(_0x48fc58[_0x1fdc('0x2f')]['includeAll']){_0xd99ed2[_0x1fdc('0x40')]=[{'all':!![]}];}return db[_0x1fdc('0x2b')]['findAll'](_0xd99ed2);})[_0x1fdc('0x3f')](function(_0xacac2d){_0x46df80['rows']=_0xacac2d;return _0x46df80;})[_0x1fdc('0x3f')](respondWithFilteredResult(_0x55e7fc,_0xd99ed2))[_0x1fdc('0x41')](handleError(_0x55e7fc,null));};exports[_0x1fdc('0x42')]=function(_0x2cc7b0,_0x36ed1d){var _0x554b3d={'raw':![],'where':{'id':_0x2cc7b0['params']['id']}},_0x3e9bb4={};_0x3e9bb4[_0x1fdc('0x34')]=_[_0x1fdc('0x43')](db[_0x1fdc('0x2b')]['rawAttributes']);_0x3e9bb4[_0x1fdc('0x2f')]=_[_0x1fdc('0x43')](_0x2cc7b0[_0x1fdc('0x2f')]);_0x3e9bb4['filters']=_['intersection'](_0x3e9bb4[_0x1fdc('0x34')],_0x3e9bb4[_0x1fdc('0x2f')]);_0x554b3d[_0x1fdc('0x33')]=_[_0x1fdc('0x31')](_0x3e9bb4[_0x1fdc('0x34')],qs[_0x1fdc('0x32')](_0x2cc7b0[_0x1fdc('0x2f')]['fields']));_0x554b3d[_0x1fdc('0x33')]=_0x554b3d['attributes']['length']?_0x554b3d['attributes']:_0x3e9bb4[_0x1fdc('0x34')];if(_0x2cc7b0[_0x1fdc('0x2f')]['includeAll']){_0x554b3d[_0x1fdc('0x40')]=[{'all':!![]}];}_0x554b3d=_[_0x1fdc('0x3b')]({},_0x554b3d,_0x2cc7b0[_0x1fdc('0x3e')]);return db[_0x1fdc('0x2b')][_0x1fdc('0x44')](_0x554b3d)[_0x1fdc('0x3f')](handleEntityNotFound(_0x36ed1d,null))[_0x1fdc('0x3f')](respondWithResult(_0x36ed1d,null))[_0x1fdc('0x41')](handleError(_0x36ed1d,null));};exports[_0x1fdc('0x45')]=function(_0x19ce87,_0x590f11){return db[_0x1fdc('0x2b')]['create'](_0x19ce87[_0x1fdc('0x46')],{})[_0x1fdc('0x3f')](respondWithResult(_0x590f11,0xc9))[_0x1fdc('0x41')](handleError(_0x590f11,null));};exports[_0x1fdc('0x25')]=function(_0x4bf31a,_0x36a0dc){if(_0x4bf31a['body']['id']){delete _0x4bf31a[_0x1fdc('0x46')]['id'];}return db['VtigerConfiguration'][_0x1fdc('0x44')]({'where':{'id':_0x4bf31a[_0x1fdc('0x47')]['id']}})['then'](handleEntityNotFound(_0x36a0dc,null))[_0x1fdc('0x3f')](saveUpdates(_0x4bf31a[_0x1fdc('0x46')],null))['then'](respondWithResult(_0x36a0dc,null))[_0x1fdc('0x41')](handleError(_0x36a0dc,null));};exports[_0x1fdc('0x48')]=function(_0x2505f0,_0x507288){return db[_0x1fdc('0x2b')][_0x1fdc('0x44')]({'where':{'id':_0x2505f0[_0x1fdc('0x47')]['id']}})[_0x1fdc('0x3f')](handleEntityNotFound(_0x507288,null))['then'](removeEntity(_0x507288,null))[_0x1fdc('0x41')](handleError(_0x507288,null));};exports[_0x1fdc('0x49')]=function(_0x113b92,_0xbc16d4,_0x572a12){var _0x188840={};var _0x36ea2f={};var _0x315ea6;var _0x4f1525;return db[_0x1fdc('0x2b')]['findOne']({'where':{'id':_0x113b92[_0x1fdc('0x47')]['id']}})['then'](handleEntityNotFound(_0xbc16d4,null))[_0x1fdc('0x3f')](function(_0x7ae803){if(_0x7ae803){_0x315ea6=_0x7ae803;_0x36ea2f[_0x1fdc('0x34')]=_[_0x1fdc('0x43')](db[_0x1fdc('0x4a')]['rawAttributes']);_0x36ea2f[_0x1fdc('0x2f')]=_[_0x1fdc('0x43')](_0x113b92[_0x1fdc('0x2f')]);_0x36ea2f[_0x1fdc('0x30')]=_[_0x1fdc('0x31')](_0x36ea2f[_0x1fdc('0x34')],_0x36ea2f[_0x1fdc('0x2f')]);_0x188840[_0x1fdc('0x33')]=_[_0x1fdc('0x31')](_0x36ea2f[_0x1fdc('0x34')],qs['fields'](_0x113b92['query'][_0x1fdc('0x32')]));_0x188840['attributes']=_0x188840[_0x1fdc('0x33')]['length']?_0x188840[_0x1fdc('0x33')]:_0x36ea2f['model'];_0x188840[_0x1fdc('0x37')]=qs[_0x1fdc('0x38')](_0x113b92[_0x1fdc('0x2f')][_0x1fdc('0x38')]);_0x188840[_0x1fdc('0x39')]=qs['filters'](_[_0x1fdc('0x3a')](_0x113b92[_0x1fdc('0x2f')],_0x36ea2f['filters']));if(_0x113b92[_0x1fdc('0x2f')][_0x1fdc('0x3d')]){_0x188840['where']=_[_0x1fdc('0x3b')](_0x188840[_0x1fdc('0x39')],{'$or':_[_0x1fdc('0x2a')](_0x188840[_0x1fdc('0x33')],function(_0x481994){var _0x3f5eef={};_0x3f5eef[_0x481994]={'$like':'%'+_0x113b92[_0x1fdc('0x2f')][_0x1fdc('0x3d')]+'%'};return _0x3f5eef;})});}_0x188840=_[_0x1fdc('0x3b')]({},_0x188840,_0x113b92[_0x1fdc('0x3e')]);return _0x315ea6[_0x1fdc('0x49')](_0x188840);}})['then'](function(_0x1adf82){if(_0x1adf82){_0x4f1525=_0x1adf82['length'];if(!_0x113b92[_0x1fdc('0x2f')][_0x1fdc('0x35')](_0x1fdc('0x36'))){_0x188840[_0x1fdc('0x1f')]=qs[_0x1fdc('0x1f')](_0x113b92['query'][_0x1fdc('0x1f')]);_0x188840[_0x1fdc('0x1d')]=qs[_0x1fdc('0x1d')](_0x113b92[_0x1fdc('0x2f')][_0x1fdc('0x1d')]);}return _0x315ea6[_0x1fdc('0x49')](_0x188840);}})[_0x1fdc('0x3f')](function(_0x364a62){if(_0x364a62){return _0x364a62?{'count':_0x4f1525,'rows':_0x364a62}:null;}})[_0x1fdc('0x3f')](respondWithResult(_0xbc16d4,null))[_0x1fdc('0x41')](handleError(_0xbc16d4,null));};exports['getSubjects']=function(_0x379f54,_0x5931b6,_0x3c397f){var _0x3d5087={};var _0xc63e55={};var _0x43c718;var _0x22422e;return db['VtigerConfiguration'][_0x1fdc('0x4b')]({'where':{'id':_0x379f54[_0x1fdc('0x47')]['id']}})[_0x1fdc('0x3f')](handleEntityNotFound(_0x5931b6,null))['then'](function(_0x40e5bf){if(_0x40e5bf){_0x43c718=_0x40e5bf;_0xc63e55[_0x1fdc('0x34')]=_[_0x1fdc('0x43')](db[_0x1fdc('0x4a')][_0x1fdc('0x2c')]);_0xc63e55[_0x1fdc('0x2f')]=_[_0x1fdc('0x43')](_0x379f54[_0x1fdc('0x2f')]);_0xc63e55['filters']=_[_0x1fdc('0x31')](_0xc63e55[_0x1fdc('0x34')],_0xc63e55['query']);_0x3d5087['attributes']=_[_0x1fdc('0x31')](_0xc63e55[_0x1fdc('0x34')],qs[_0x1fdc('0x32')](_0x379f54[_0x1fdc('0x2f')][_0x1fdc('0x32')]));_0x3d5087[_0x1fdc('0x33')]=_0x3d5087[_0x1fdc('0x33')][_0x1fdc('0x4c')]?_0x3d5087['attributes']:_0xc63e55[_0x1fdc('0x34')];_0x3d5087[_0x1fdc('0x37')]=qs[_0x1fdc('0x38')](_0x379f54[_0x1fdc('0x2f')][_0x1fdc('0x38')]);_0x3d5087[_0x1fdc('0x39')]=qs[_0x1fdc('0x30')](_[_0x1fdc('0x3a')](_0x379f54[_0x1fdc('0x2f')],_0xc63e55['filters']));if(_0x379f54['query'][_0x1fdc('0x3d')]){_0x3d5087[_0x1fdc('0x39')]=_[_0x1fdc('0x3b')](_0x3d5087[_0x1fdc('0x39')],{'$or':_[_0x1fdc('0x2a')](_0x3d5087['attributes'],function(_0x415120){var _0x657f5c={};_0x657f5c[_0x415120]={'$like':'%'+_0x379f54['query'][_0x1fdc('0x3d')]+'%'};return _0x657f5c;})});}_0x3d5087=_[_0x1fdc('0x3b')]({},_0x3d5087,_0x379f54[_0x1fdc('0x3e')]);return _0x43c718['getSubjects'](_0x3d5087);}})[_0x1fdc('0x3f')](function(_0x1d841e){if(_0x1d841e){_0x22422e=_0x1d841e['length'];if(!_0x379f54['query'][_0x1fdc('0x35')](_0x1fdc('0x36'))){_0x3d5087[_0x1fdc('0x1f')]=qs['limit'](_0x379f54['query'][_0x1fdc('0x1f')]);_0x3d5087[_0x1fdc('0x1d')]=qs['offset'](_0x379f54[_0x1fdc('0x2f')]['offset']);}return _0x43c718['getSubjects'](_0x3d5087);}})[_0x1fdc('0x3f')](function(_0x1f7d5b){if(_0x1f7d5b){return _0x1f7d5b?{'count':_0x22422e,'rows':_0x1f7d5b}:null;}})['then'](respondWithResult(_0x5931b6,null))[_0x1fdc('0x41')](handleError(_0x5931b6,null));};exports[_0x1fdc('0x4d')]=function(_0x13194c,_0x288f56,_0x289875){var _0x3d4957={};var _0x253577={};var _0x780a75;var _0x3eff28;return db[_0x1fdc('0x2b')][_0x1fdc('0x4b')]({'where':{'id':_0x13194c[_0x1fdc('0x47')]['id']}})['then'](handleEntityNotFound(_0x288f56,null))[_0x1fdc('0x3f')](function(_0x3ec14c){if(_0x3ec14c){_0x780a75=_0x3ec14c;_0x253577['model']=_['keys'](db[_0x1fdc('0x4a')][_0x1fdc('0x2c')]);_0x253577[_0x1fdc('0x2f')]=_[_0x1fdc('0x43')](_0x13194c[_0x1fdc('0x2f')]);_0x253577[_0x1fdc('0x30')]=_[_0x1fdc('0x31')](_0x253577[_0x1fdc('0x34')],_0x253577[_0x1fdc('0x2f')]);_0x3d4957[_0x1fdc('0x33')]=_[_0x1fdc('0x31')](_0x253577[_0x1fdc('0x34')],qs[_0x1fdc('0x32')](_0x13194c[_0x1fdc('0x2f')][_0x1fdc('0x32')]));_0x3d4957[_0x1fdc('0x33')]=_0x3d4957[_0x1fdc('0x33')][_0x1fdc('0x4c')]?_0x3d4957[_0x1fdc('0x33')]:_0x253577['model'];_0x3d4957[_0x1fdc('0x37')]=qs[_0x1fdc('0x38')](_0x13194c[_0x1fdc('0x2f')][_0x1fdc('0x38')]);_0x3d4957[_0x1fdc('0x39')]=qs[_0x1fdc('0x30')](_[_0x1fdc('0x3a')](_0x13194c[_0x1fdc('0x2f')],_0x253577[_0x1fdc('0x30')]));if(_0x13194c[_0x1fdc('0x2f')][_0x1fdc('0x3d')]){_0x3d4957[_0x1fdc('0x39')]=_[_0x1fdc('0x3b')](_0x3d4957[_0x1fdc('0x39')],{'$or':_[_0x1fdc('0x2a')](_0x3d4957[_0x1fdc('0x33')],function(_0x2a8d82){var _0x409f09={};_0x409f09[_0x2a8d82]={'$like':'%'+_0x13194c[_0x1fdc('0x2f')][_0x1fdc('0x3d')]+'%'};return _0x409f09;})});}_0x3d4957=_[_0x1fdc('0x3b')]({},_0x3d4957,_0x13194c[_0x1fdc('0x3e')]);return _0x780a75[_0x1fdc('0x4d')](_0x3d4957);}})['then'](function(_0xf76321){if(_0xf76321){_0x3eff28=_0xf76321[_0x1fdc('0x4c')];if(!_0x13194c['query'][_0x1fdc('0x35')]('nolimit')){_0x3d4957[_0x1fdc('0x1f')]=qs[_0x1fdc('0x1f')](_0x13194c['query'][_0x1fdc('0x1f')]);_0x3d4957[_0x1fdc('0x1d')]=qs[_0x1fdc('0x1d')](_0x13194c[_0x1fdc('0x2f')][_0x1fdc('0x1d')]);}return _0x780a75['getDescriptions'](_0x3d4957);}})[_0x1fdc('0x3f')](function(_0x1c37f2){if(_0x1c37f2){return _0x1c37f2?{'count':_0x3eff28,'rows':_0x1c37f2}:null;}})[_0x1fdc('0x3f')](respondWithResult(_0x288f56,null))[_0x1fdc('0x41')](handleError(_0x288f56,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index daaf078..08cd4a8 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 _0x1828=['request-promise','path','rimraf','../../config/environment','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','api','bluebird'];(function(_0x3f6162,_0x5808e7){var _0x234cc1=function(_0x4a34ea){while(--_0x4a34ea){_0x3f6162['push'](_0x3f6162['shift']());}};_0x234cc1(++_0x5808e7);}(_0x1828,0x1c4));var _0x8182=function(_0x58232f,_0x16aa45){_0x58232f=_0x58232f-0x0;var _0x595a96=_0x1828[_0x58232f];return _0x595a96;};'use strict';var _=require(_0x8182('0x0'));var util=require('util');var logger=require(_0x8182('0x1'))(_0x8182('0x2'));var moment=require('moment');var BPromise=require(_0x8182('0x3'));var rp=require(_0x8182('0x4'));var fs=require('fs');var path=require(_0x8182('0x5'));var rimraf=require(_0x8182('0x6'));var config=require(_0x8182('0x7'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x8182('0x8')]=function(_0x1eae63,_0x5470b6){return _0x1eae63[_0x8182('0x9')](_0x8182('0xa'),attributes,{'tableName':_0x8182('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32c1=['exports','define','VtigerConfiguration','int_vtiger_configurations','moment','bluebird','path','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x101ccf,_0x37e172){var _0x99b0f1=function(_0x4111c8){while(--_0x4111c8){_0x101ccf['push'](_0x101ccf['shift']());}};_0x99b0f1(++_0x37e172);}(_0x32c1,0x1ab));var _0x132c=function(_0x486f78,_0x2de315){_0x486f78=_0x486f78-0x0;var _0x1fb5ea=_0x32c1[_0x486f78];return _0x1fb5ea;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x132c('0x0'));var BPromise=require(_0x132c('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x132c('0x2'));var rimraf=require('rimraf');var config=require(_0x132c('0x3'));var attributes=require(_0x132c('0x4'));module[_0x132c('0x5')]=function(_0x41663c,_0x6ddca7){return _0x41663c[_0x132c('0x6')](_0x132c('0x7'),attributes,{'tableName':_0x132c('0x8'),'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 dc5b9a4..77839d9 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 _0x05d1=['info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x34103e,_0x575c6c){var _0x2668c4=function(_0x304180){while(--_0x304180){_0x34103e['push'](_0x34103e['shift']());}};_0x2668c4(++_0x575c6c);}(_0x05d1,0x105));var _0x105d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x05d1[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0x105d('0x0'));var moment=require(_0x105d('0x1'));var BPromise=require(_0x105d('0x2'));var rs=require(_0x105d('0x3'));var fs=require('fs');var Redis=require(_0x105d('0x4'));var db=require(_0x105d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x105d('0x6'))(_0x105d('0x7'));var config=require(_0x105d('0x8'));var jayson=require(_0x105d('0x9'));var client=jayson['client'][_0x105d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x396ab8,_0x2e13e3,_0xa06b57){return new BPromise(function(_0x51daab,_0x3e00db){return client[_0x105d('0xb')](_0x396ab8,_0xa06b57)['then'](function(_0x1a2888){logger[_0x105d('0xc')](_0x105d('0xd'),_0x2e13e3,_0x105d('0xe'));logger[_0x105d('0xf')](_0x105d('0x10'),_0x2e13e3,_0x105d('0xe'),JSON['stringify'](_0x1a2888));if(_0x1a2888['error']){if(_0x1a2888[_0x105d('0x11')]['code']===0x1f4){logger[_0x105d('0x11')](_0x105d('0xd'),_0x2e13e3,_0x1a2888[_0x105d('0x11')]['message']);return _0x3e00db(_0x1a2888[_0x105d('0x11')]['message']);}logger['error'](_0x105d('0xd'),_0x2e13e3,_0x1a2888[_0x105d('0x11')][_0x105d('0x12')]);return _0x51daab(_0x1a2888[_0x105d('0x11')][_0x105d('0x12')]);}else{logger['info'](_0x105d('0xd'),_0x2e13e3,'request\x20sent');_0x51daab(_0x1a2888[_0x105d('0x13')][_0x105d('0x12')]);}})[_0x105d('0x14')](function(_0x195ffb){logger[_0x105d('0x11')](_0x105d('0xd'),_0x2e13e3,_0x195ffb);_0x3e00db(_0x195ffb);});});} \ No newline at end of file +var _0xbd45=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x371b29,_0x2d33ed){var _0x434d79=function(_0x3966cf){while(--_0x3966cf){_0x371b29['push'](_0x371b29['shift']());}};_0x434d79(++_0x2d33ed);}(_0xbd45,0x187));var _0x5bd4=function(_0x1235a7,_0x422881){_0x1235a7=_0x1235a7-0x0;var _0x3e7f04=_0xbd45[_0x1235a7];return _0x3e7f04;};'use strict';var _=require(_0x5bd4('0x0'));var util=require(_0x5bd4('0x1'));var moment=require(_0x5bd4('0x2'));var BPromise=require('bluebird');var rs=require(_0x5bd4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5bd4('0x4'))['db'];var utils=require(_0x5bd4('0x5'));var logger=require(_0x5bd4('0x6'))(_0x5bd4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5bd4('0x8')][_0x5bd4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ea1e7,_0x46bc9f,_0x5f52ca){return new BPromise(function(_0x5c1291,_0x2bcb3c){return client[_0x5bd4('0xa')](_0x5ea1e7,_0x5f52ca)[_0x5bd4('0xb')](function(_0x55ff54){logger['info'](_0x5bd4('0xc'),_0x46bc9f,_0x5bd4('0xd'));logger[_0x5bd4('0xe')](_0x5bd4('0xf'),_0x46bc9f,_0x5bd4('0xd'),JSON[_0x5bd4('0x10')](_0x55ff54));if(_0x55ff54[_0x5bd4('0x11')]){if(_0x55ff54[_0x5bd4('0x11')][_0x5bd4('0x12')]===0x1f4){logger[_0x5bd4('0x11')](_0x5bd4('0xc'),_0x46bc9f,_0x55ff54[_0x5bd4('0x11')][_0x5bd4('0x13')]);return _0x2bcb3c(_0x55ff54[_0x5bd4('0x11')][_0x5bd4('0x13')]);}logger[_0x5bd4('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x46bc9f,_0x55ff54[_0x5bd4('0x11')][_0x5bd4('0x13')]);return _0x5c1291(_0x55ff54[_0x5bd4('0x11')]['message']);}else{logger[_0x5bd4('0x14')](_0x5bd4('0xc'),_0x46bc9f,_0x5bd4('0xd'));_0x5c1291(_0x55ff54[_0x5bd4('0x15')][_0x5bd4('0x13')]);}})[_0x5bd4('0x16')](function(_0x14cc0c){logger[_0x5bd4('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x46bc9f,_0x14cc0c);_0x2bcb3c(_0x14cc0c);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 6c0325c..cb3131a 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 _0xcc80=['put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','/:id','show','post','isAuthenticated','create'];(function(_0xa0ed3d,_0x18100a){var _0x302821=function(_0x46c773){while(--_0x46c773){_0xa0ed3d['push'](_0xa0ed3d['shift']());}};_0x302821(++_0x18100a);}(_0xcc80,0x109));var _0x0cc8=function(_0x2b1b6b,_0x38aca9){_0x2b1b6b=_0x2b1b6b-0x0;var _0x2e6630=_0xcc80[_0x2b1b6b];return _0x2e6630;};'use strict';var multer=require(_0x0cc8('0x0'));var util=require(_0x0cc8('0x1'));var path=require(_0x0cc8('0x2'));var timeout=require('connect-timeout');var express=require(_0x0cc8('0x3'));var router=express[_0x0cc8('0x4')]();var fs_extra=require(_0x0cc8('0x5'));var auth=require(_0x0cc8('0x6'));var interaction=require(_0x0cc8('0x7'));var config=require('../../config/environment');var controller=require(_0x0cc8('0x8'));router[_0x0cc8('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0cc8('0x9')](_0x0cc8('0xa'),auth['isAuthenticated'](),controller[_0x0cc8('0xb')]);router[_0x0cc8('0xc')]('/',auth[_0x0cc8('0xd')](),controller[_0x0cc8('0xe')]);router[_0x0cc8('0xf')](_0x0cc8('0xa'),auth[_0x0cc8('0xd')](),controller[_0x0cc8('0x10')]);router[_0x0cc8('0x11')]('/:id',auth[_0x0cc8('0xd')](),controller[_0x0cc8('0x12')]);module[_0x0cc8('0x13')]=router; \ No newline at end of file +var _0x6416=['delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','create','put'];(function(_0x183acf,_0x20a500){var _0x52453c=function(_0x3c36ec){while(--_0x3c36ec){_0x183acf['push'](_0x183acf['shift']());}};_0x52453c(++_0x20a500);}(_0x6416,0x1b1));var _0x6641=function(_0x4a258d,_0x30f281){_0x4a258d=_0x4a258d-0x0;var _0x104963=_0x6416[_0x4a258d];return _0x104963;};'use strict';var multer=require(_0x6641('0x0'));var util=require(_0x6641('0x1'));var path=require(_0x6641('0x2'));var timeout=require(_0x6641('0x3'));var express=require(_0x6641('0x4'));var router=express[_0x6641('0x5')]();var fs_extra=require(_0x6641('0x6'));var auth=require(_0x6641('0x7'));var interaction=require(_0x6641('0x8'));var config=require('../../config/environment');var controller=require(_0x6641('0x9'));router[_0x6641('0xa')]('/',auth[_0x6641('0xb')](),controller[_0x6641('0xc')]);router[_0x6641('0xa')](_0x6641('0xd'),auth[_0x6641('0xb')](),controller[_0x6641('0xe')]);router['post']('/',auth[_0x6641('0xb')](),controller[_0x6641('0xf')]);router[_0x6641('0x10')]('/:id',auth[_0x6641('0xb')](),controller['update']);router[_0x6641('0x11')](_0x6641('0xd'),auth[_0x6641('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index f0d2e82..49e547b 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 _0x3d61=['string','STRING','ENUM','customVariable','exports','variable','picklist'];(function(_0x228029,_0x569b7b){var _0x3222d0=function(_0x25adb2){while(--_0x25adb2){_0x228029['push'](_0x228029['shift']());}};_0x3222d0(++_0x569b7b);}(_0x3d61,0x146));var _0x13d6=function(_0x2f4f4a,_0x1636bb){_0x2f4f4a=_0x2f4f4a-0x0;var _0x3154a0=_0x3d61[_0x2f4f4a];return _0x3154a0;};'use strict';var Sequelize=require('sequelize');module[_0x13d6('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0x13d6('0x1'),'customVariable','keyValue',_0x13d6('0x2')),'defaultValue':_0x13d6('0x3')},'content':{'type':Sequelize[_0x13d6('0x4')]},'key':{'type':Sequelize[_0x13d6('0x4')]},'keyType':{'type':Sequelize[_0x13d6('0x5')]('string',_0x13d6('0x1'),_0x13d6('0x6'))},'keyContent':{'type':Sequelize[_0x13d6('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x13d6('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x13d6('0x4')]}}; \ No newline at end of file +var _0x5a48=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x139c39,_0xc46751){var _0xdb9b55=function(_0x34e0d0){while(--_0x34e0d0){_0x139c39['push'](_0x139c39['shift']());}};_0xdb9b55(++_0xc46751);}(_0x5a48,0x64));var _0x85a4=function(_0x5837b1,_0x54229a){_0x5837b1=_0x5837b1-0x0;var _0x490d8b=_0x5a48[_0x5837b1];return _0x490d8b;};'use strict';var Sequelize=require(_0x85a4('0x0'));module[_0x85a4('0x1')]={'type':{'type':Sequelize[_0x85a4('0x2')](_0x85a4('0x3'),_0x85a4('0x4'),_0x85a4('0x5'),_0x85a4('0x6'),_0x85a4('0x7')),'defaultValue':_0x85a4('0x3')},'content':{'type':Sequelize[_0x85a4('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x85a4('0x2')](_0x85a4('0x3'),_0x85a4('0x4'),_0x85a4('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x85a4('0x8')]},'nameField':{'type':Sequelize[_0x85a4('0x8')]},'customField':{'type':Sequelize[_0x85a4('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x85a4('0x8')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 6af9c0e..19bba87 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 _0xe687=['attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','VtigerField','rawAttributes','fieldName','type','key','model','map','query','keys','filters'];(function(_0x1d03cf,_0x20a198){var _0x1ad990=function(_0x14ec0c){while(--_0x14ec0c){_0x1d03cf['push'](_0x1d03cf['shift']());}};_0x1ad990(++_0x20a198);}(_0xe687,0x13b));var _0x7e68=function(_0x334b5a,_0x1b39ce){_0x334b5a=_0x334b5a-0x0;var _0x5a57aa=_0xe687[_0x334b5a];return _0x5a57aa;};'use strict';var emlformat=require(_0x7e68('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7e68('0x1'));var jsonpatch=require(_0x7e68('0x2'));var rp=require(_0x7e68('0x3'));var moment=require(_0x7e68('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7e68('0x5'));var util=require(_0x7e68('0x6'));var path=require(_0x7e68('0x7'));var sox=require('sox');var csv=require(_0x7e68('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e68('0x9'));var _=require(_0x7e68('0xa'));var squel=require(_0x7e68('0xb'));var crypto=require(_0x7e68('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7e68('0xd'));var toCsv=require(_0x7e68('0x8'));var querystring=require(_0x7e68('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7e68('0xf'));var qs=require(_0x7e68('0x10'));var as=require(_0x7e68('0x11'));var hardwareService=require(_0x7e68('0x12'));var logger=require('../../config/logger')(_0x7e68('0x13'));var utils=require('../../config/utils');var config=require(_0x7e68('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7e68('0x15'))['db'];function respondWithStatusCode(_0x531c1b,_0x32950e){_0x32950e=_0x32950e||0xcc;return function(_0x40869c){if(_0x40869c){return _0x531c1b[_0x7e68('0x16')](_0x32950e);}return _0x531c1b[_0x7e68('0x17')](_0x32950e)[_0x7e68('0x18')]();};}function respondWithResult(_0x589879,_0x17963a){_0x17963a=_0x17963a||0xc8;return function(_0x31cf10){if(_0x31cf10){return _0x589879[_0x7e68('0x17')](_0x17963a)[_0x7e68('0x19')](_0x31cf10);}};}function respondWithFilteredResult(_0x9a8f97,_0x2aa845){return function(_0x5ea9af){if(_0x5ea9af){var _0x166571=typeof _0x2aa845[_0x7e68('0x1a')]===_0x7e68('0x1b')&&typeof _0x2aa845['limit']===_0x7e68('0x1b');var _0x521634=_0x5ea9af[_0x7e68('0x1c')];var _0x18a115=_0x166571?0x0:_0x2aa845[_0x7e68('0x1a')];var _0x4339a4=_0x166571?_0x5ea9af['count']:_0x2aa845['offset']+_0x2aa845[_0x7e68('0x1d')];var _0x4357f3;if(_0x4339a4>=_0x521634){_0x4339a4=_0x521634;_0x4357f3=0xc8;}else{_0x4357f3=0xce;}_0x9a8f97['status'](_0x4357f3);return _0x9a8f97[_0x7e68('0x1e')](_0x7e68('0x1f'),_0x18a115+'-'+_0x4339a4+'/'+_0x521634)[_0x7e68('0x19')](_0x5ea9af);}return null;};}function patchUpdates(_0x348bca){return function(_0x1dfb0d){try{jsonpatch[_0x7e68('0x20')](_0x1dfb0d,_0x348bca,!![]);}catch(_0xee2c1f){return BPromise[_0x7e68('0x21')](_0xee2c1f);}return _0x1dfb0d[_0x7e68('0x22')]();};}function saveUpdates(_0x32d5bb,_0x2dd7bd){return function(_0x3dd035){if(_0x3dd035){return _0x3dd035['update'](_0x32d5bb)[_0x7e68('0x23')](function(_0x1448a3){return _0x1448a3;});}return null;};}function removeEntity(_0x21420d,_0x2df302){return function(_0x3b4480){if(_0x3b4480){return _0x3b4480[_0x7e68('0x24')]()[_0x7e68('0x23')](function(){_0x21420d[_0x7e68('0x17')](0xcc)[_0x7e68('0x18')]();});}};}function handleEntityNotFound(_0x2ab6cf,_0x26c0d7){return function(_0x3ab3ce){if(!_0x3ab3ce){_0x2ab6cf[_0x7e68('0x16')](0x194);}return _0x3ab3ce;};}function handleError(_0x117e18,_0x37b70d){_0x37b70d=_0x37b70d||0x1f4;return function(_0x129d5b){logger['error'](_0x129d5b[_0x7e68('0x25')]);if(_0x129d5b[_0x7e68('0x26')]){delete _0x129d5b[_0x7e68('0x26')];}_0x117e18[_0x7e68('0x17')](_0x37b70d)[_0x7e68('0x27')](_0x129d5b);};}exports['index']=function(_0x3c3f79,_0x3bb963){var _0xfd8e65={},_0x420877={},_0x1863fc={'count':0x0,'rows':[]};var _0x5c95bd=_['map'](db[_0x7e68('0x28')][_0x7e68('0x29')],function(_0x1071dd){return{'name':_0x1071dd[_0x7e68('0x2a')],'type':_0x1071dd[_0x7e68('0x2b')][_0x7e68('0x2c')]};});_0x420877[_0x7e68('0x2d')]=_[_0x7e68('0x2e')](_0x5c95bd,_0x7e68('0x26'));_0x420877[_0x7e68('0x2f')]=_[_0x7e68('0x30')](_0x3c3f79[_0x7e68('0x2f')]);_0x420877[_0x7e68('0x31')]=_['intersection'](_0x420877[_0x7e68('0x2d')],_0x420877[_0x7e68('0x2f')]);_0xfd8e65[_0x7e68('0x32')]=_[_0x7e68('0x33')](_0x420877['model'],qs['fields'](_0x3c3f79['query'][_0x7e68('0x34')]));_0xfd8e65[_0x7e68('0x32')]=_0xfd8e65[_0x7e68('0x32')]['length']?_0xfd8e65['attributes']:_0x420877[_0x7e68('0x2d')];if(!_0x3c3f79['query'][_0x7e68('0x35')](_0x7e68('0x36'))){_0xfd8e65['limit']=qs[_0x7e68('0x1d')](_0x3c3f79[_0x7e68('0x2f')][_0x7e68('0x1d')]);_0xfd8e65[_0x7e68('0x1a')]=qs[_0x7e68('0x1a')](_0x3c3f79[_0x7e68('0x2f')][_0x7e68('0x1a')]);}_0xfd8e65[_0x7e68('0x37')]=qs[_0x7e68('0x38')](_0x3c3f79[_0x7e68('0x2f')][_0x7e68('0x38')]);_0xfd8e65['where']=qs[_0x7e68('0x31')](_[_0x7e68('0x39')](_0x3c3f79[_0x7e68('0x2f')],_0x420877['filters']),_0x5c95bd);if(_0x3c3f79[_0x7e68('0x2f')][_0x7e68('0x3a')]){_0xfd8e65[_0x7e68('0x3b')]=_['merge'](_0xfd8e65[_0x7e68('0x3b')],{'$or':_['map'](_0x5c95bd,function(_0xfc17e9){if(_0xfc17e9[_0x7e68('0x2b')]!==_0x7e68('0x3c')){var _0x1dfd36={};_0x1dfd36[_0xfc17e9[_0x7e68('0x26')]]={'$like':'%'+_0x3c3f79['query'][_0x7e68('0x3a')]+'%'};return _0x1dfd36;}})});}_0xfd8e65=_[_0x7e68('0x3d')]({},_0xfd8e65,_0x3c3f79['options']);var _0x30aacc={'where':_0xfd8e65['where']};return db[_0x7e68('0x28')][_0x7e68('0x1c')](_0x30aacc)[_0x7e68('0x23')](function(_0x528446){_0x1863fc['count']=_0x528446;if(_0x3c3f79['query'][_0x7e68('0x3e')]){_0xfd8e65[_0x7e68('0x3f')]=[{'all':!![]}];}return db['VtigerField'][_0x7e68('0x40')](_0xfd8e65);})[_0x7e68('0x23')](function(_0x123a3a){_0x1863fc[_0x7e68('0x41')]=_0x123a3a;return _0x1863fc;})['then'](respondWithFilteredResult(_0x3bb963,_0xfd8e65))[_0x7e68('0x42')](handleError(_0x3bb963,null));};exports[_0x7e68('0x43')]=function(_0x873605,_0x7f9de8){var _0x2a50b5={'raw':!![],'where':{'id':_0x873605[_0x7e68('0x44')]['id']}},_0x24f85a={};_0x24f85a[_0x7e68('0x2d')]=_['keys'](db[_0x7e68('0x28')]['rawAttributes']);_0x24f85a[_0x7e68('0x2f')]=_['keys'](_0x873605[_0x7e68('0x2f')]);_0x24f85a['filters']=_[_0x7e68('0x33')](_0x24f85a['model'],_0x24f85a['query']);_0x2a50b5['attributes']=_[_0x7e68('0x33')](_0x24f85a[_0x7e68('0x2d')],qs[_0x7e68('0x34')](_0x873605['query'][_0x7e68('0x34')]));_0x2a50b5[_0x7e68('0x32')]=_0x2a50b5[_0x7e68('0x32')][_0x7e68('0x45')]?_0x2a50b5[_0x7e68('0x32')]:_0x24f85a[_0x7e68('0x2d')];if(_0x873605[_0x7e68('0x2f')][_0x7e68('0x3e')]){_0x2a50b5[_0x7e68('0x3f')]=[{'all':!![]}];}_0x2a50b5=_[_0x7e68('0x3d')]({},_0x2a50b5,_0x873605[_0x7e68('0x46')]);return db['VtigerField']['find'](_0x2a50b5)[_0x7e68('0x23')](handleEntityNotFound(_0x7f9de8,null))['then'](respondWithResult(_0x7f9de8,null))['catch'](handleError(_0x7f9de8,null));};exports[_0x7e68('0x47')]=function(_0x2e0c6c,_0x478632){return db['VtigerField'][_0x7e68('0x47')](_0x2e0c6c[_0x7e68('0x48')],{})[_0x7e68('0x23')](respondWithResult(_0x478632,0xc9))['catch'](handleError(_0x478632,null));};exports['update']=function(_0x40d2c3,_0x200d30){if(_0x40d2c3[_0x7e68('0x48')]['id']){delete _0x40d2c3['body']['id'];}return db['VtigerField']['find']({'where':{'id':_0x40d2c3['params']['id']}})[_0x7e68('0x23')](handleEntityNotFound(_0x200d30,null))['then'](saveUpdates(_0x40d2c3[_0x7e68('0x48')],null))[_0x7e68('0x23')](respondWithResult(_0x200d30,null))['catch'](handleError(_0x200d30,null));};exports[_0x7e68('0x24')]=function(_0x56487d,_0xc832c7){return db[_0x7e68('0x28')]['find']({'where':{'id':_0x56487d[_0x7e68('0x44')]['id']}})[_0x7e68('0x23')](handleEntityNotFound(_0xc832c7,null))[_0x7e68('0x23')](removeEntity(_0xc832c7,null))['catch'](handleError(_0xc832c7,null));}; \ No newline at end of file +var _0xa51e=['json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','error','stack','name','send','index','map','VtigerField','rawAttributes','type','key','query','keys','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','then','catch','show','params','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','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','status','end'];(function(_0x389948,_0x579e7d){var _0x127ffa=function(_0x459e1d){while(--_0x459e1d){_0x389948['push'](_0x389948['shift']());}};_0x127ffa(++_0x579e7d);}(_0xa51e,0x1f3));var _0xea51=function(_0x40d722,_0x5ab18c){_0x40d722=_0x40d722-0x0;var _0x232ffa=_0xa51e[_0x40d722];return _0x232ffa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xea51('0x0'));var zipdir=require(_0xea51('0x1'));var jsonpatch=require(_0xea51('0x2'));var rp=require(_0xea51('0x3'));var moment=require(_0xea51('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xea51('0x5'));var util=require('util');var path=require(_0xea51('0x6'));var sox=require('sox');var csv=require(_0xea51('0x7'));var ejs=require(_0xea51('0x8'));var fs=require('fs');var fs_extra=require(_0xea51('0x9'));var _=require(_0xea51('0xa'));var squel=require('squel');var crypto=require(_0xea51('0xb'));var jsforce=require(_0xea51('0xc'));var deskjs=require(_0xea51('0xd'));var toCsv=require(_0xea51('0x7'));var querystring=require(_0xea51('0xe'));var Papa=require(_0xea51('0xf'));var Redis=require(_0xea51('0x10'));var authService=require(_0xea51('0x11'));var qs=require(_0xea51('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea51('0x13'));var logger=require('../../config/logger')(_0xea51('0x14'));var utils=require(_0xea51('0x15'));var config=require(_0xea51('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xea51('0x17'))['db'];function respondWithStatusCode(_0x5f04ae,_0x49405d){_0x49405d=_0x49405d||0xcc;return function(_0x4d6378){if(_0x4d6378){return _0x5f04ae['sendStatus'](_0x49405d);}return _0x5f04ae[_0xea51('0x18')](_0x49405d)[_0xea51('0x19')]();};}function respondWithResult(_0x126b1f,_0x24df7a){_0x24df7a=_0x24df7a||0xc8;return function(_0x2f8c89){if(_0x2f8c89){return _0x126b1f[_0xea51('0x18')](_0x24df7a)[_0xea51('0x1a')](_0x2f8c89);}};}function respondWithFilteredResult(_0x27f631,_0x2ccbd5){return function(_0x1e9934){if(_0x1e9934){var _0x5d9c91=typeof _0x2ccbd5[_0xea51('0x1b')]===_0xea51('0x1c')&&typeof _0x2ccbd5[_0xea51('0x1d')]==='undefined';var _0x4e9f0b=_0x1e9934['count'];var _0x52d5f8=_0x5d9c91?0x0:_0x2ccbd5[_0xea51('0x1b')];var _0x1b3723=_0x5d9c91?_0x1e9934[_0xea51('0x1e')]:_0x2ccbd5[_0xea51('0x1b')]+_0x2ccbd5[_0xea51('0x1d')];var _0xd34971;if(_0x1b3723>=_0x4e9f0b){_0x1b3723=_0x4e9f0b;_0xd34971=0xc8;}else{_0xd34971=0xce;}_0x27f631['status'](_0xd34971);return _0x27f631[_0xea51('0x1f')](_0xea51('0x20'),_0x52d5f8+'-'+_0x1b3723+'/'+_0x4e9f0b)[_0xea51('0x1a')](_0x1e9934);}return null;};}function patchUpdates(_0x21cebe){return function(_0x518f24){try{jsonpatch[_0xea51('0x21')](_0x518f24,_0x21cebe,!![]);}catch(_0x9d3e25){return BPromise['reject'](_0x9d3e25);}return _0x518f24[_0xea51('0x22')]();};}function saveUpdates(_0x28f7f3,_0xb2ddb9){return function(_0x1e63e0){if(_0x1e63e0){return _0x1e63e0[_0xea51('0x23')](_0x28f7f3)['then'](function(_0x88f0cb){return _0x88f0cb;});}return null;};}function removeEntity(_0x31ca56,_0x3416a8){return function(_0x3dc20f){if(_0x3dc20f){return _0x3dc20f[_0xea51('0x24')]()['then'](function(){_0x31ca56[_0xea51('0x18')](0xcc)[_0xea51('0x19')]();});}};}function handleEntityNotFound(_0x593e19,_0x32be68){return function(_0x98cc80){if(!_0x98cc80){_0x593e19['sendStatus'](0x194);}return _0x98cc80;};}function handleError(_0x3ba5ce,_0x21587e){_0x21587e=_0x21587e||0x1f4;return function(_0x1dca11){logger[_0xea51('0x25')](_0x1dca11[_0xea51('0x26')]);if(_0x1dca11['name']){delete _0x1dca11[_0xea51('0x27')];}_0x3ba5ce[_0xea51('0x18')](_0x21587e)[_0xea51('0x28')](_0x1dca11);};}exports[_0xea51('0x29')]=function(_0x53900f,_0xff586a){var _0x4e112b={},_0x24181c={},_0x38d0f4={'count':0x0,'rows':[]};var _0x205f82=_[_0xea51('0x2a')](db[_0xea51('0x2b')][_0xea51('0x2c')],function(_0x517df3){return{'name':_0x517df3['fieldName'],'type':_0x517df3[_0xea51('0x2d')][_0xea51('0x2e')]};});_0x24181c['model']=_[_0xea51('0x2a')](_0x205f82,_0xea51('0x27'));_0x24181c[_0xea51('0x2f')]=_[_0xea51('0x30')](_0x53900f[_0xea51('0x2f')]);_0x24181c[_0xea51('0x31')]=_['intersection'](_0x24181c['model'],_0x24181c[_0xea51('0x2f')]);_0x4e112b[_0xea51('0x32')]=_[_0xea51('0x33')](_0x24181c[_0xea51('0x34')],qs[_0xea51('0x35')](_0x53900f[_0xea51('0x2f')][_0xea51('0x35')]));_0x4e112b[_0xea51('0x32')]=_0x4e112b[_0xea51('0x32')]['length']?_0x4e112b[_0xea51('0x32')]:_0x24181c['model'];if(!_0x53900f[_0xea51('0x2f')][_0xea51('0x36')](_0xea51('0x37'))){_0x4e112b[_0xea51('0x1d')]=qs['limit'](_0x53900f[_0xea51('0x2f')][_0xea51('0x1d')]);_0x4e112b[_0xea51('0x1b')]=qs[_0xea51('0x1b')](_0x53900f[_0xea51('0x2f')][_0xea51('0x1b')]);}_0x4e112b[_0xea51('0x38')]=qs[_0xea51('0x39')](_0x53900f[_0xea51('0x2f')][_0xea51('0x39')]);_0x4e112b[_0xea51('0x3a')]=qs[_0xea51('0x31')](_[_0xea51('0x3b')](_0x53900f[_0xea51('0x2f')],_0x24181c[_0xea51('0x31')]),_0x205f82);if(_0x53900f[_0xea51('0x2f')][_0xea51('0x3c')]){_0x4e112b[_0xea51('0x3a')]=_['merge'](_0x4e112b[_0xea51('0x3a')],{'$or':_[_0xea51('0x2a')](_0x205f82,function(_0x4996d8){if(_0x4996d8[_0xea51('0x2d')]!==_0xea51('0x3d')){var _0x3c9d46={};_0x3c9d46[_0x4996d8[_0xea51('0x27')]]={'$like':'%'+_0x53900f['query'][_0xea51('0x3c')]+'%'};return _0x3c9d46;}})});}_0x4e112b=_[_0xea51('0x3e')]({},_0x4e112b,_0x53900f[_0xea51('0x3f')]);var _0x978d8b={'where':_0x4e112b[_0xea51('0x3a')]};return db[_0xea51('0x2b')][_0xea51('0x1e')](_0x978d8b)['then'](function(_0x176a72){_0x38d0f4[_0xea51('0x1e')]=_0x176a72;if(_0x53900f[_0xea51('0x2f')][_0xea51('0x40')]){_0x4e112b[_0xea51('0x41')]=[{'all':!![]}];}return db[_0xea51('0x2b')][_0xea51('0x42')](_0x4e112b);})['then'](function(_0x290f8d){_0x38d0f4[_0xea51('0x43')]=_0x290f8d;return _0x38d0f4;})[_0xea51('0x44')](respondWithFilteredResult(_0xff586a,_0x4e112b))[_0xea51('0x45')](handleError(_0xff586a,null));};exports[_0xea51('0x46')]=function(_0x272b78,_0x558358){var _0x4967e2={'raw':!![],'where':{'id':_0x272b78[_0xea51('0x47')]['id']}},_0x2354b5={};_0x2354b5[_0xea51('0x34')]=_[_0xea51('0x30')](db['VtigerField']['rawAttributes']);_0x2354b5['query']=_[_0xea51('0x30')](_0x272b78[_0xea51('0x2f')]);_0x2354b5[_0xea51('0x31')]=_['intersection'](_0x2354b5[_0xea51('0x34')],_0x2354b5[_0xea51('0x2f')]);_0x4967e2[_0xea51('0x32')]=_[_0xea51('0x33')](_0x2354b5[_0xea51('0x34')],qs['fields'](_0x272b78[_0xea51('0x2f')][_0xea51('0x35')]));_0x4967e2['attributes']=_0x4967e2[_0xea51('0x32')]['length']?_0x4967e2[_0xea51('0x32')]:_0x2354b5[_0xea51('0x34')];if(_0x272b78[_0xea51('0x2f')]['includeAll']){_0x4967e2[_0xea51('0x41')]=[{'all':!![]}];}_0x4967e2=_[_0xea51('0x3e')]({},_0x4967e2,_0x272b78[_0xea51('0x3f')]);return db[_0xea51('0x2b')]['find'](_0x4967e2)[_0xea51('0x44')](handleEntityNotFound(_0x558358,null))[_0xea51('0x44')](respondWithResult(_0x558358,null))['catch'](handleError(_0x558358,null));};exports['create']=function(_0x900705,_0x201557){return db[_0xea51('0x2b')][_0xea51('0x48')](_0x900705[_0xea51('0x49')],{})[_0xea51('0x44')](respondWithResult(_0x201557,0xc9))[_0xea51('0x45')](handleError(_0x201557,null));};exports[_0xea51('0x23')]=function(_0x10035f,_0x413e66){if(_0x10035f['body']['id']){delete _0x10035f['body']['id'];}return db[_0xea51('0x2b')][_0xea51('0x4a')]({'where':{'id':_0x10035f['params']['id']}})['then'](handleEntityNotFound(_0x413e66,null))[_0xea51('0x44')](saveUpdates(_0x10035f['body'],null))[_0xea51('0x44')](respondWithResult(_0x413e66,null))[_0xea51('0x45')](handleError(_0x413e66,null));};exports['destroy']=function(_0x358d90,_0x5ac151){return db['VtigerField'][_0xea51('0x4a')]({'where':{'id':_0x358d90[_0xea51('0x47')]['id']}})[_0xea51('0x44')](handleEntityNotFound(_0x5ac151,null))[_0xea51('0x44')](removeEntity(_0x5ac151,null))['catch'](handleError(_0x5ac151,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 316c75f..474f768 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 _0x77ea=['moment','bluebird','path','rimraf','exports','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash'];(function(_0x463b9d,_0x256c8e){var _0x245054=function(_0x3bc464){while(--_0x3bc464){_0x463b9d['push'](_0x463b9d['shift']());}};_0x245054(++_0x256c8e);}(_0x77ea,0x1d8));var _0xa77e=function(_0x3961ac,_0x5d1392){_0x3961ac=_0x3961ac-0x0;var _0xf3546=_0x77ea[_0x3961ac];return _0xf3546;};'use strict';var _=require(_0xa77e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa77e('0x1'));var BPromise=require(_0xa77e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa77e('0x3'));var rimraf=require(_0xa77e('0x4'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0xa77e('0x5')]=function(_0x3c997d,_0x49f37d){return _0x3c997d['define'](_0xa77e('0x6'),attributes,{'tableName':_0xa77e('0x7'),'paranoid':![],'indexes':[{'name':_0xa77e('0x8'),'fields':[_0xa77e('0x9'),_0xa77e('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xed92=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x46efd7,_0x43f84d){var _0x5637e4=function(_0x54e078){while(--_0x54e078){_0x46efd7['push'](_0x46efd7['shift']());}};_0x5637e4(++_0x43f84d);}(_0xed92,0xde));var _0x2ed9=function(_0x304482,_0x516d09){_0x304482=_0x304482-0x0;var _0x33bc4a=_0xed92[_0x304482];return _0x33bc4a;};'use strict';var _=require(_0x2ed9('0x0'));var util=require('util');var logger=require(_0x2ed9('0x1'))(_0x2ed9('0x2'));var moment=require(_0x2ed9('0x3'));var BPromise=require(_0x2ed9('0x4'));var rp=require(_0x2ed9('0x5'));var fs=require('fs');var path=require(_0x2ed9('0x6'));var rimraf=require(_0x2ed9('0x7'));var config=require(_0x2ed9('0x8'));var attributes=require(_0x2ed9('0x9'));module[_0x2ed9('0xa')]=function(_0x9ba93a,_0x58d44b){return _0x9ba93a[_0x2ed9('0xb')]('VtigerField',attributes,{'tableName':_0x2ed9('0xc'),'paranoid':![],'indexes':[{'name':_0x2ed9('0xd'),'fields':[_0x2ed9('0xe'),_0x2ed9('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index b731806..1007686 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 _0x2c91=['client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x46226f,_0x1abd11){var _0x15fc73=function(_0x111863){while(--_0x111863){_0x46226f['push'](_0x46226f['shift']());}};_0x15fc73(++_0x1abd11);}(_0x2c91,0x1db));var _0x12c9=function(_0xdff612,_0x4e10ac){_0xdff612=_0xdff612-0x0;var _0x29eebe=_0x2c91[_0xdff612];return _0x29eebe;};'use strict';var _=require(_0x12c9('0x0'));var util=require(_0x12c9('0x1'));var moment=require('moment');var BPromise=require(_0x12c9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12c9('0x3'));var db=require(_0x12c9('0x4'))['db'];var utils=require(_0x12c9('0x5'));var logger=require(_0x12c9('0x6'))(_0x12c9('0x7'));var config=require('../../config/environment');var jayson=require(_0x12c9('0x8'));var client=jayson[_0x12c9('0x9')][_0x12c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5013b3,_0x579e1b,_0x43cadc){return new BPromise(function(_0x3e2306,_0x1d0a17){return client[_0x12c9('0xb')](_0x5013b3,_0x43cadc)[_0x12c9('0xc')](function(_0x346976){logger[_0x12c9('0xd')](_0x12c9('0xe'),_0x579e1b,_0x12c9('0xf'));logger[_0x12c9('0x10')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x579e1b,_0x12c9('0xf'),JSON['stringify'](_0x346976));if(_0x346976['error']){if(_0x346976[_0x12c9('0x11')][_0x12c9('0x12')]===0x1f4){logger[_0x12c9('0x11')](_0x12c9('0xe'),_0x579e1b,_0x346976[_0x12c9('0x11')][_0x12c9('0x13')]);return _0x1d0a17(_0x346976[_0x12c9('0x11')][_0x12c9('0x13')]);}logger[_0x12c9('0x11')](_0x12c9('0xe'),_0x579e1b,_0x346976['error']['message']);return _0x3e2306(_0x346976['error'][_0x12c9('0x13')]);}else{logger[_0x12c9('0xd')](_0x12c9('0xe'),_0x579e1b,'request\x20sent');_0x3e2306(_0x346976[_0x12c9('0x14')][_0x12c9('0x13')]);}})[_0x12c9('0x15')](function(_0x126c32){logger[_0x12c9('0x11')](_0x12c9('0xe'),_0x579e1b,_0x126c32);_0x1d0a17(_0x126c32);});});} \ No newline at end of file +var _0x517a=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','VtigerField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','util'];(function(_0x4e66e2,_0x34899d){var _0x338b70=function(_0x2b6de7){while(--_0x2b6de7){_0x4e66e2['push'](_0x4e66e2['shift']());}};_0x338b70(++_0x34899d);}(_0x517a,0xc5));var _0xa517=function(_0x78bee0,_0x497ec6){_0x78bee0=_0x78bee0-0x0;var _0x3543de=_0x517a[_0x78bee0];return _0x3543de;};'use strict';var _=require('lodash');var util=require(_0xa517('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa517('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa517('0x2'))['db'];var utils=require(_0xa517('0x3'));var logger=require('../../config/logger')(_0xa517('0x4'));var config=require(_0xa517('0x5'));var jayson=require(_0xa517('0x6'));var client=jayson[_0xa517('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20922e,_0x43509d,_0x3a75e6){return new BPromise(function(_0x51d195,_0x544795){return client['request'](_0x20922e,_0x3a75e6)[_0xa517('0x8')](function(_0x10d115){logger['info'](_0xa517('0x9'),_0x43509d,'request\x20sent');logger[_0xa517('0xa')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x43509d,_0xa517('0xb'),JSON[_0xa517('0xc')](_0x10d115));if(_0x10d115[_0xa517('0xd')]){if(_0x10d115['error']['code']===0x1f4){logger[_0xa517('0xd')](_0xa517('0x9'),_0x43509d,_0x10d115[_0xa517('0xd')]['message']);return _0x544795(_0x10d115[_0xa517('0xd')][_0xa517('0xe')]);}logger[_0xa517('0xd')](_0xa517('0x9'),_0x43509d,_0x10d115['error'][_0xa517('0xe')]);return _0x51d195(_0x10d115['error'][_0xa517('0xe')]);}else{logger[_0xa517('0xf')]('VtigerField,\x20%s,\x20%s',_0x43509d,'request\x20sent');_0x51d195(_0x10d115[_0xa517('0x10')][_0xa517('0xe')]);}})[_0xa517('0x11')](function(_0x59ae24){logger[_0xa517('0xd')](_0xa517('0x9'),_0x43509d,_0x59ae24);_0x544795(_0x59ae24);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 1c7c6f0..e9f545c 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 _0x344b=['exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','/:id','delete'];(function(_0x2483a1,_0x5829af){var _0x3806a5=function(_0x2727b9){while(--_0x2727b9){_0x2483a1['push'](_0x2483a1['shift']());}};_0x3806a5(++_0x5829af);}(_0x344b,0x190));var _0xb344=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x344b[_0x16d10f];return _0x50c823;};'use strict';var multer=require(_0xb344('0x0'));var util=require(_0xb344('0x1'));var path=require('path');var timeout=require(_0xb344('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb344('0x3'));var interaction=require(_0xb344('0x4'));var config=require(_0xb344('0x5'));var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0xb344('0x6')](),controller[_0xb344('0x7')]);router[_0xb344('0x8')]('/:id',auth[_0xb344('0x6')](),controller[_0xb344('0x9')]);router[_0xb344('0x8')](_0xb344('0xa'),auth[_0xb344('0x6')](),controller[_0xb344('0xb')]);router[_0xb344('0x8')](_0xb344('0xc'),auth[_0xb344('0x6')](),controller[_0xb344('0xd')]);router[_0xb344('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb344('0xe')](_0xb344('0xa'),auth['isAuthenticated'](),controller[_0xb344('0xf')]);router['put'](_0xb344('0x10'),auth[_0xb344('0x6')](),controller['update']);router[_0xb344('0x11')](_0xb344('0x10'),auth[_0xb344('0x6')](),controller['destroy']);module[_0xb344('0x12')]=router; \ No newline at end of file +var _0x81c9=['update','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put'];(function(_0x52b15d,_0x111cb9){var _0x3f4bce=function(_0x3e528f){while(--_0x3e528f){_0x52b15d['push'](_0x52b15d['shift']());}};_0x3f4bce(++_0x111cb9);}(_0x81c9,0x188));var _0x981c=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x81c9[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x981c('0x0'));var util=require(_0x981c('0x1'));var path=require(_0x981c('0x2'));var timeout=require('connect-timeout');var express=require(_0x981c('0x3'));var router=express[_0x981c('0x4')]();var fs_extra=require(_0x981c('0x5'));var auth=require(_0x981c('0x6'));var interaction=require(_0x981c('0x7'));var config=require(_0x981c('0x8'));var controller=require(_0x981c('0x9'));router[_0x981c('0xa')]('/',auth[_0x981c('0xb')](),controller[_0x981c('0xc')]);router[_0x981c('0xa')](_0x981c('0xd'),auth[_0x981c('0xb')](),controller[_0x981c('0xe')]);router['get']('/:id/configurations',auth[_0x981c('0xb')](),controller[_0x981c('0xf')]);router[_0x981c('0xa')](_0x981c('0x10'),auth[_0x981c('0xb')](),controller[_0x981c('0x11')]);router[_0x981c('0x12')]('/',auth['isAuthenticated'](),controller[_0x981c('0x13')]);router['post'](_0x981c('0x14'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x981c('0x15')](_0x981c('0xd'),auth[_0x981c('0xb')](),controller[_0x981c('0x16')]);router['delete']('/:id',auth[_0x981c('0xb')](),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 f59c0e5..2e1412e 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 _0xc6ac=['username','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x218ecc,_0x455ba8){var _0x54bfe4=function(_0x3e71b9){while(--_0x3e71b9){_0x218ecc['push'](_0x218ecc['shift']());}};_0x54bfe4(++_0x455ba8);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x5aaee3,_0x1428c9){_0x5aaee3=_0x5aaee3-0x0;var _0x3a904d=_0xc6ac[_0x5aaee3];return _0x3a904d;};'use strict';var Sequelize=require(_0xcc6a('0x0'));module[_0xcc6a('0x1')]={'name':{'type':Sequelize[_0xcc6a('0x2')]},'description':{'type':Sequelize[_0xcc6a('0x2')]},'username':{'type':Sequelize[_0xcc6a('0x2')],'unique':_0xcc6a('0x3')},'password':{'type':Sequelize[_0xcc6a('0x2')]},'token':{'type':Sequelize[_0xcc6a('0x2')]},'remoteUri':{'type':Sequelize[_0xcc6a('0x2')],'unique':_0xcc6a('0x4')},'authType':{'type':Sequelize[_0xcc6a('0x5')](_0xcc6a('0x6'),_0xcc6a('0x7')),'defaultValue':_0xcc6a('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xcc6a('0x5')](_0xcc6a('0x8'),_0xcc6a('0x9')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x1122=['newTab','sequelize','STRING','username','remoteUri','password','token','ENUM','integrationTab'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1122,0xac));var _0x2112=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1122[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2112('0x0'));module['exports']={'name':{'type':Sequelize[_0x2112('0x1')]},'description':{'type':Sequelize[_0x2112('0x1')]},'username':{'type':Sequelize[_0x2112('0x1')],'unique':_0x2112('0x2')},'password':{'type':Sequelize[_0x2112('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x2112('0x3')},'authType':{'type':Sequelize['ENUM'](_0x2112('0x4'),_0x2112('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x2112('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x2112('0x6')](_0x2112('0x7'),_0x2112('0x8')),'defaultValue':_0x2112('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index b4a7e81..dbbc48b 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 _0xe5b5=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','getConfigurations','findOne','ZendeskConfiguration','pick','map','addConfiguration','channel','Descriptions','getDescriptions','ZendeskField','Subjects','getFields','username','password','token','authType','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','Basic\x20%s','base64','%s/token:%s','toString','Sequelize','Unknown\x20authentication\x20type','group','assignee','remove','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','model','query','keys','intersection'];(function(_0x234491,_0x303898){var _0x4cac47=function(_0x56e048){while(--_0x56e048){_0x234491['push'](_0x234491['shift']());}};_0x4cac47(++_0x303898);}(_0xe5b5,0x12b));var _0x5e5b=function(_0xdaab62,_0x2728ab){_0xdaab62=_0xdaab62-0x0;var _0x13d767=_0xe5b5[_0xdaab62];return _0x13d767;};'use strict';var emlformat=require(_0x5e5b('0x0'));var rimraf=require(_0x5e5b('0x1'));var zipdir=require(_0x5e5b('0x2'));var jsonpatch=require(_0x5e5b('0x3'));var rp=require(_0x5e5b('0x4'));var moment=require(_0x5e5b('0x5'));var BPromise=require(_0x5e5b('0x6'));var Mustache=require(_0x5e5b('0x7'));var util=require(_0x5e5b('0x8'));var path=require(_0x5e5b('0x9'));var sox=require(_0x5e5b('0xa'));var csv=require(_0x5e5b('0xb'));var ejs=require(_0x5e5b('0xc'));var fs=require('fs');var fs_extra=require(_0x5e5b('0xd'));var _=require(_0x5e5b('0xe'));var squel=require(_0x5e5b('0xf'));var crypto=require(_0x5e5b('0x10'));var jsforce=require(_0x5e5b('0x11'));var deskjs=require(_0x5e5b('0x12'));var toCsv=require(_0x5e5b('0xb'));var querystring=require(_0x5e5b('0x13'));var Papa=require(_0x5e5b('0x14'));var Redis=require(_0x5e5b('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x5e5b('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e5b('0x17'));var logger=require(_0x5e5b('0x18'))(_0x5e5b('0x19'));var utils=require(_0x5e5b('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x5e5b('0x1b'));function respondWithStatusCode(_0x18434e,_0x4559a0){_0x4559a0=_0x4559a0||0xcc;return function(_0x1694ff){if(_0x1694ff){return _0x18434e[_0x5e5b('0x1c')](_0x4559a0);}return _0x18434e[_0x5e5b('0x1d')](_0x4559a0)[_0x5e5b('0x1e')]();};}function respondWithResult(_0x49edd0,_0x2b37fa){_0x2b37fa=_0x2b37fa||0xc8;return function(_0x2e92c3){if(_0x2e92c3){return _0x49edd0['status'](_0x2b37fa)[_0x5e5b('0x1f')](_0x2e92c3);}};}function respondWithFilteredResult(_0x578c14,_0x4e9509){return function(_0x13a1cb){if(_0x13a1cb){var _0x444435=typeof _0x4e9509[_0x5e5b('0x20')]==='undefined'&&typeof _0x4e9509[_0x5e5b('0x21')]==='undefined';var _0x1796af=_0x13a1cb[_0x5e5b('0x22')];var _0x4c5f9a=_0x444435?0x0:_0x4e9509[_0x5e5b('0x20')];var _0x1560e1=_0x444435?_0x13a1cb[_0x5e5b('0x22')]:_0x4e9509['offset']+_0x4e9509[_0x5e5b('0x21')];var _0x3f1103;if(_0x1560e1>=_0x1796af){_0x1560e1=_0x1796af;_0x3f1103=0xc8;}else{_0x3f1103=0xce;}_0x578c14['status'](_0x3f1103);return _0x578c14[_0x5e5b('0x23')](_0x5e5b('0x24'),_0x4c5f9a+'-'+_0x1560e1+'/'+_0x1796af)[_0x5e5b('0x1f')](_0x13a1cb);}return null;};}function patchUpdates(_0x2d8252){return function(_0x2cb0bb){try{jsonpatch[_0x5e5b('0x25')](_0x2cb0bb,_0x2d8252,!![]);}catch(_0x93df5c){return BPromise[_0x5e5b('0x26')](_0x93df5c);}return _0x2cb0bb['save']();};}function saveUpdates(_0x512e46,_0x256a00){return function(_0x3326fb){if(_0x3326fb){return _0x3326fb[_0x5e5b('0x27')](_0x512e46)[_0x5e5b('0x28')](function(_0x2e38ed){return _0x2e38ed;});}return null;};}function removeEntity(_0x28cd95,_0x135c6c){return function(_0x18903e){if(_0x18903e){return _0x18903e[_0x5e5b('0x29')]()[_0x5e5b('0x28')](function(){_0x28cd95[_0x5e5b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ebb11,_0x75800d){return function(_0x3527a8){if(!_0x3527a8){_0x1ebb11['sendStatus'](0x194);}return _0x3527a8;};}function handleError(_0x988e5d,_0xdb2863){_0xdb2863=_0xdb2863||0x1f4;return function(_0x5ee866){logger[_0x5e5b('0x2a')](_0x5ee866[_0x5e5b('0x2b')]);if(_0x5ee866[_0x5e5b('0x2c')]){delete _0x5ee866[_0x5e5b('0x2c')];}_0x988e5d[_0x5e5b('0x1d')](_0xdb2863)[_0x5e5b('0x2d')](_0x5ee866);};}exports[_0x5e5b('0x2e')]=function(_0x2b4351,_0x3f6b25){var _0x42da3b={},_0xcb272c={},_0x28157a={'count':0x0,'rows':[]};var _0x4ed688=_['map'](db[_0x5e5b('0x2f')][_0x5e5b('0x30')],function(_0xb68419){return{'name':_0xb68419[_0x5e5b('0x31')],'type':_0xb68419[_0x5e5b('0x32')]['key']};});_0xcb272c[_0x5e5b('0x33')]=_['map'](_0x4ed688,_0x5e5b('0x2c'));_0xcb272c[_0x5e5b('0x34')]=_[_0x5e5b('0x35')](_0x2b4351[_0x5e5b('0x34')]);_0xcb272c['filters']=_[_0x5e5b('0x36')](_0xcb272c[_0x5e5b('0x33')],_0xcb272c['query']);_0x42da3b[_0x5e5b('0x37')]=_[_0x5e5b('0x36')](_0xcb272c[_0x5e5b('0x33')],qs[_0x5e5b('0x38')](_0x2b4351[_0x5e5b('0x34')][_0x5e5b('0x38')]));_0x42da3b[_0x5e5b('0x37')]=_0x42da3b[_0x5e5b('0x37')]['length']?_0x42da3b[_0x5e5b('0x37')]:_0xcb272c[_0x5e5b('0x33')];if(!_0x2b4351[_0x5e5b('0x34')][_0x5e5b('0x39')](_0x5e5b('0x3a'))){_0x42da3b[_0x5e5b('0x21')]=qs['limit'](_0x2b4351['query'][_0x5e5b('0x21')]);_0x42da3b[_0x5e5b('0x20')]=qs[_0x5e5b('0x20')](_0x2b4351['query'][_0x5e5b('0x20')]);}_0x42da3b[_0x5e5b('0x3b')]=qs[_0x5e5b('0x3c')](_0x2b4351[_0x5e5b('0x34')]['sort']);_0x42da3b[_0x5e5b('0x3d')]=qs[_0x5e5b('0x3e')](_['pick'](_0x2b4351['query'],_0xcb272c[_0x5e5b('0x3e')]),_0x4ed688);if(_0x2b4351[_0x5e5b('0x34')][_0x5e5b('0x3f')]){_0x42da3b['where']=_[_0x5e5b('0x40')](_0x42da3b['where'],{'$or':_['map'](_0x4ed688,function(_0x261057){if(_0x261057[_0x5e5b('0x32')]!==_0x5e5b('0x41')){var _0xc666f7={};_0xc666f7[_0x261057[_0x5e5b('0x2c')]]={'$like':'%'+_0x2b4351[_0x5e5b('0x34')][_0x5e5b('0x3f')]+'%'};return _0xc666f7;}})});}_0x42da3b=_[_0x5e5b('0x40')]({},_0x42da3b,_0x2b4351[_0x5e5b('0x42')]);var _0x53b88f={'where':_0x42da3b[_0x5e5b('0x3d')]};return db[_0x5e5b('0x2f')]['count'](_0x53b88f)[_0x5e5b('0x28')](function(_0x4b54b0){_0x28157a[_0x5e5b('0x22')]=_0x4b54b0;if(_0x2b4351[_0x5e5b('0x34')][_0x5e5b('0x43')]){_0x42da3b[_0x5e5b('0x44')]=[{'all':!![]}];}return db[_0x5e5b('0x2f')][_0x5e5b('0x45')](_0x42da3b);})[_0x5e5b('0x28')](function(_0x24d81f){_0x28157a[_0x5e5b('0x46')]=_0x24d81f;return _0x28157a;})[_0x5e5b('0x28')](respondWithFilteredResult(_0x3f6b25,_0x42da3b))[_0x5e5b('0x47')](handleError(_0x3f6b25,null));};exports['show']=function(_0x2b81dd,_0x40e8ce){var _0x46fec9={'raw':![],'where':{'id':_0x2b81dd[_0x5e5b('0x48')]['id']}},_0x570413={};_0x570413[_0x5e5b('0x33')]=_['keys'](db[_0x5e5b('0x2f')][_0x5e5b('0x30')]);_0x570413['query']=_[_0x5e5b('0x35')](_0x2b81dd['query']);_0x570413['filters']=_['intersection'](_0x570413[_0x5e5b('0x33')],_0x570413['query']);_0x46fec9[_0x5e5b('0x37')]=_['intersection'](_0x570413[_0x5e5b('0x33')],qs[_0x5e5b('0x38')](_0x2b81dd[_0x5e5b('0x34')][_0x5e5b('0x38')]));_0x46fec9[_0x5e5b('0x37')]=_0x46fec9[_0x5e5b('0x37')][_0x5e5b('0x49')]?_0x46fec9['attributes']:_0x570413['model'];if(_0x2b81dd[_0x5e5b('0x34')]['includeAll']){_0x46fec9['include']=[{'all':!![]}];}_0x46fec9=_['merge']({},_0x46fec9,_0x2b81dd[_0x5e5b('0x42')]);return db['ZendeskAccount'][_0x5e5b('0x4a')](_0x46fec9)[_0x5e5b('0x28')](handleEntityNotFound(_0x40e8ce,null))[_0x5e5b('0x28')](respondWithResult(_0x40e8ce,null))[_0x5e5b('0x47')](handleError(_0x40e8ce,null));};exports[_0x5e5b('0x4b')]=function(_0x192445,_0x4fd265){return db[_0x5e5b('0x2f')][_0x5e5b('0x4b')](_0x192445['body'],{})[_0x5e5b('0x28')](respondWithResult(_0x4fd265,0xc9))['catch'](handleError(_0x4fd265,null));};exports[_0x5e5b('0x27')]=function(_0x36d8fa,_0x42ebaf){if(_0x36d8fa[_0x5e5b('0x4c')]['id']){delete _0x36d8fa['body']['id'];}return db[_0x5e5b('0x2f')][_0x5e5b('0x4a')]({'where':{'id':_0x36d8fa['params']['id']}})[_0x5e5b('0x28')](handleEntityNotFound(_0x42ebaf,null))[_0x5e5b('0x28')](saveUpdates(_0x36d8fa[_0x5e5b('0x4c')],null))[_0x5e5b('0x28')](respondWithResult(_0x42ebaf,null))[_0x5e5b('0x47')](handleError(_0x42ebaf,null));};exports[_0x5e5b('0x29')]=function(_0x50fc9c,_0x690f8c){return db[_0x5e5b('0x2f')]['find']({'where':{'id':_0x50fc9c[_0x5e5b('0x48')]['id']}})[_0x5e5b('0x28')](handleEntityNotFound(_0x690f8c,null))[_0x5e5b('0x28')](removeEntity(_0x690f8c,null))['catch'](handleError(_0x690f8c,null));};exports[_0x5e5b('0x4d')]=function(_0x3e0ce5,_0x1f32f2,_0x4844ec){var _0x3877e9={};var _0x2e04d6={};var _0x239804;var _0x4a4e0f;return db['ZendeskAccount'][_0x5e5b('0x4e')]({'where':{'id':_0x3e0ce5['params']['id']}})['then'](handleEntityNotFound(_0x1f32f2,null))[_0x5e5b('0x28')](function(_0x13eee9){if(_0x13eee9){_0x239804=_0x13eee9;_0x2e04d6[_0x5e5b('0x33')]=_['keys'](db[_0x5e5b('0x4f')][_0x5e5b('0x30')]);_0x2e04d6[_0x5e5b('0x34')]=_[_0x5e5b('0x35')](_0x3e0ce5[_0x5e5b('0x34')]);_0x2e04d6[_0x5e5b('0x3e')]=_['intersection'](_0x2e04d6['model'],_0x2e04d6[_0x5e5b('0x34')]);_0x3877e9[_0x5e5b('0x37')]=_[_0x5e5b('0x36')](_0x2e04d6[_0x5e5b('0x33')],qs['fields'](_0x3e0ce5[_0x5e5b('0x34')]['fields']));_0x3877e9[_0x5e5b('0x37')]=_0x3877e9[_0x5e5b('0x37')][_0x5e5b('0x49')]?_0x3877e9[_0x5e5b('0x37')]:_0x2e04d6[_0x5e5b('0x33')];_0x3877e9[_0x5e5b('0x3b')]=qs[_0x5e5b('0x3c')](_0x3e0ce5[_0x5e5b('0x34')]['sort']);_0x3877e9[_0x5e5b('0x3d')]=qs[_0x5e5b('0x3e')](_[_0x5e5b('0x50')](_0x3e0ce5[_0x5e5b('0x34')],_0x2e04d6[_0x5e5b('0x3e')]));if(_0x3e0ce5['query'][_0x5e5b('0x3f')]){_0x3877e9[_0x5e5b('0x3d')]=_[_0x5e5b('0x40')](_0x3877e9[_0x5e5b('0x3d')],{'$or':_[_0x5e5b('0x51')](_0x3877e9['attributes'],function(_0x13fb51){var _0x5d9ff9={};_0x5d9ff9[_0x13fb51]={'$like':'%'+_0x3e0ce5[_0x5e5b('0x34')]['filter']+'%'};return _0x5d9ff9;})});}_0x3877e9=_[_0x5e5b('0x40')]({},_0x3877e9,_0x3e0ce5[_0x5e5b('0x42')]);return _0x239804[_0x5e5b('0x4d')](_0x3877e9);}})[_0x5e5b('0x28')](function(_0x229a2d){if(_0x229a2d){_0x4a4e0f=_0x229a2d[_0x5e5b('0x49')];if(!_0x3e0ce5['query'][_0x5e5b('0x39')](_0x5e5b('0x3a'))){_0x3877e9[_0x5e5b('0x21')]=qs[_0x5e5b('0x21')](_0x3e0ce5['query']['limit']);_0x3877e9[_0x5e5b('0x20')]=qs[_0x5e5b('0x20')](_0x3e0ce5['query'][_0x5e5b('0x20')]);}return _0x239804[_0x5e5b('0x4d')](_0x3877e9);}})[_0x5e5b('0x28')](function(_0x470042){if(_0x470042){return _0x470042?{'count':_0x4a4e0f,'rows':_0x470042}:null;}})[_0x5e5b('0x28')](respondWithResult(_0x1f32f2,null))['catch'](handleError(_0x1f32f2,null));};exports[_0x5e5b('0x52')]=function(_0x61faf2,_0x494b1d,_0x4795a7){if(_0x61faf2['body']['id']){delete _0x61faf2[_0x5e5b('0x4c')]['id'];}return db[_0x5e5b('0x2f')][_0x5e5b('0x4e')]({'where':{'id':_0x61faf2[_0x5e5b('0x48')]['id']}})[_0x5e5b('0x28')](handleEntityNotFound(_0x494b1d,null))['then'](function(_0x28d834){if(_0x28d834){_0x61faf2[_0x5e5b('0x4c')]['AccountId']=_0x28d834['id'];_0x61faf2[_0x5e5b('0x4c')]['Subjects']=integrations['getSubjects'](_0x61faf2[_0x5e5b('0x4c')][_0x5e5b('0x53')],_0x61faf2[_0x5e5b('0x4c')][_0x5e5b('0x32')]);_0x61faf2[_0x5e5b('0x4c')][_0x5e5b('0x54')]=integrations[_0x5e5b('0x55')](_0x61faf2['body'][_0x5e5b('0x53')],_0x61faf2[_0x5e5b('0x4c')][_0x5e5b('0x32')]);return db[_0x5e5b('0x4f')][_0x5e5b('0x4b')](_0x61faf2[_0x5e5b('0x4c')],{'include':[{'model':db[_0x5e5b('0x56')],'as':_0x5e5b('0x57')},{'model':db[_0x5e5b('0x56')],'as':_0x5e5b('0x54')}]});}return null;})[_0x5e5b('0x28')](respondWithResult(_0x494b1d,null))['catch'](handleError(_0x494b1d,null));};exports[_0x5e5b('0x58')]=function(_0x1a3d7b,_0x3c57ad,_0x271af6){var _0xc7171a='';return db['ZendeskAccount'][_0x5e5b('0x4e')]({'where':{'id':_0x1a3d7b[_0x5e5b('0x48')]['id']},'attributes':['id',_0x5e5b('0x59'),_0x5e5b('0x5a'),_0x5e5b('0x5b'),_0x5e5b('0x5c'),'remoteUri']})[_0x5e5b('0x28')](handleEntityNotFound(_0x3c57ad,null))[_0x5e5b('0x28')](function(_0x359c04){if(_0x359c04){_0xc7171a=_0x359c04['remoteUri'];var _0xc8316a=_0xc7171a[_0x5e5b('0x5d')](-0x1);if(_0xc8316a==='/'){_0xc7171a=_0xc7171a[_0x5e5b('0x5e')](0x0,_0xc7171a[_0x5e5b('0x5f')](_0xc8316a));}var _0x344c25={'method':_0x5e5b('0x60'),'uri':util[_0x5e5b('0x61')](_0x5e5b('0x62'),_0xc7171a,_0x5e5b('0x63')),'json':!![]};switch(_0x359c04['authType']){case _0x5e5b('0x5a'):_0x344c25['headers']={'Authorization':util[_0x5e5b('0x61')](_0x5e5b('0x64'),new Buffer(util['format']('%s:%s',_0x359c04[_0x5e5b('0x59')],_0x359c04[_0x5e5b('0x5a')]))['toString'](_0x5e5b('0x65')))};break;case'token':_0x344c25['headers']={'Authorization':util[_0x5e5b('0x61')]('Basic\x20%s',new Buffer(util[_0x5e5b('0x61')](_0x5e5b('0x66'),_0x359c04[_0x5e5b('0x59')],_0x359c04['token']))[_0x5e5b('0x67')](_0x5e5b('0x65')))};break;default:throw new db[(_0x5e5b('0x68'))]['ValidationError'](_0x5e5b('0x69'));}return rp(_0x344c25);}})[_0x5e5b('0x28')](function(_0x58aef4){if(_0x58aef4){var _0x388dbe=['subject','description',_0x5e5b('0x6a'),_0x5e5b('0x6b')];_[_0x5e5b('0x6c')](_0x58aef4[_0x5e5b('0x63')],function(_0x1a7c5c){return _0x388dbe['includes'](_0x1a7c5c[_0x5e5b('0x32')]);});return{'count':_0x58aef4[_0x5e5b('0x63')]['length'],'rows':_['map'](_0x58aef4[_0x5e5b('0x63')],function(_0x467c6b){return{'id':_0x467c6b['id'],'name':_0x467c6b[_0x5e5b('0x6d')]>0x7?_0x467c6b[_0x5e5b('0x6e')]:_0x467c6b[_0x5e5b('0x32')],'custom':_0x467c6b[_0x5e5b('0x6d')]>0x7?!![]:![],'options':_0x467c6b['system_field_options']?_0x467c6b[_0x5e5b('0x6f')]:_0x467c6b[_0x5e5b('0x70')]?_0x467c6b[_0x5e5b('0x70')]:[]};})};}})['then'](respondWithResult(_0x3c57ad,null))['catch'](function(_0x24bcc9){var _0x1eb8cd=_0x1a3d7b[_0x5e5b('0x34')]['test']?0x1f4:_0x24bcc9[_0x5e5b('0x71')]||0x1f4;logger[_0x5e5b('0x2a')](_0x5e5b('0x72'),'getFields',_0x1eb8cd,JSON[_0x5e5b('0x73')](_0x24bcc9));delete _0x24bcc9[_0x5e5b('0x2c')];if(_0x1eb8cd===0x191){_0x1eb8cd=0x190;}_0x3c57ad[_0x5e5b('0x1d')](_0x1eb8cd)['send'](_0x1a3d7b[_0x5e5b('0x34')][_0x5e5b('0x74')]?{'message':_0x5e5b('0x75'),'statusCode':_0x24bcc9[_0x5e5b('0x71')]}:_0x24bcc9);});}; \ No newline at end of file +var _0xd87e=['undefined','count','limit','set','Content-Range','reject','update','destroy','error','stack','name','index','ZendeskAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','include','findAll','then','rows','catch','show','params','includeAll','find','create','body','getConfigurations','findOne','order','pick','filter','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskConfiguration','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','headers','format','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x3c40f4,_0x500b8a){var _0x1209d=function(_0x46b429){while(--_0x46b429){_0x3c40f4['push'](_0x3c40f4['shift']());}};_0x1209d(++_0x500b8a);}(_0xd87e,0x1bf));var _0xed87=function(_0x140327,_0x4ff244){_0x140327=_0x140327-0x0;var _0x46f126=_0xd87e[_0x140327];return _0x46f126;};'use strict';var emlformat=require(_0xed87('0x0'));var rimraf=require(_0xed87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed87('0x2'));var rp=require(_0xed87('0x3'));var moment=require(_0xed87('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed87('0x5'));var util=require('util');var path=require(_0xed87('0x6'));var sox=require(_0xed87('0x7'));var csv=require('to-csv');var ejs=require(_0xed87('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed87('0x9'));var crypto=require(_0xed87('0xa'));var jsforce=require(_0xed87('0xb'));var deskjs=require(_0xed87('0xc'));var toCsv=require('to-csv');var querystring=require(_0xed87('0xd'));var Papa=require(_0xed87('0xe'));var Redis=require(_0xed87('0xf'));var authService=require(_0xed87('0x10'));var qs=require(_0xed87('0x11'));var as=require(_0xed87('0x12'));var hardwareService=require(_0xed87('0x13'));var logger=require('../../config/logger')(_0xed87('0x14'));var utils=require(_0xed87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xed87('0x16'));var db=require(_0xed87('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4ffc2d,_0x466f35){_0x466f35=_0x466f35||0xcc;return function(_0x32276e){if(_0x32276e){return _0x4ffc2d[_0xed87('0x18')](_0x466f35);}return _0x4ffc2d[_0xed87('0x19')](_0x466f35)[_0xed87('0x1a')]();};}function respondWithResult(_0x3865c5,_0x52dfe8){_0x52dfe8=_0x52dfe8||0xc8;return function(_0x4494da){if(_0x4494da){return _0x3865c5[_0xed87('0x19')](_0x52dfe8)[_0xed87('0x1b')](_0x4494da);}};}function respondWithFilteredResult(_0x1e9a3d,_0x2f2fd3){return function(_0xd34e0e){if(_0xd34e0e){var _0x173413=typeof _0x2f2fd3[_0xed87('0x1c')]===_0xed87('0x1d')&&typeof _0x2f2fd3['limit']===_0xed87('0x1d');var _0x18ab7d=_0xd34e0e[_0xed87('0x1e')];var _0xfb8a44=_0x173413?0x0:_0x2f2fd3['offset'];var _0x211085=_0x173413?_0xd34e0e[_0xed87('0x1e')]:_0x2f2fd3[_0xed87('0x1c')]+_0x2f2fd3[_0xed87('0x1f')];var _0x98a2ca;if(_0x211085>=_0x18ab7d){_0x211085=_0x18ab7d;_0x98a2ca=0xc8;}else{_0x98a2ca=0xce;}_0x1e9a3d[_0xed87('0x19')](_0x98a2ca);return _0x1e9a3d[_0xed87('0x20')](_0xed87('0x21'),_0xfb8a44+'-'+_0x211085+'/'+_0x18ab7d)[_0xed87('0x1b')](_0xd34e0e);}return null;};}function patchUpdates(_0x52e81c){return function(_0x5a7329){try{jsonpatch['apply'](_0x5a7329,_0x52e81c,!![]);}catch(_0x47c121){return BPromise[_0xed87('0x22')](_0x47c121);}return _0x5a7329['save']();};}function saveUpdates(_0x4191a7,_0x2b0b98){return function(_0x5b1659){if(_0x5b1659){return _0x5b1659[_0xed87('0x23')](_0x4191a7)['then'](function(_0x3d1641){return _0x3d1641;});}return null;};}function removeEntity(_0x24962e,_0x27799a){return function(_0x2a8733){if(_0x2a8733){return _0x2a8733[_0xed87('0x24')]()['then'](function(){_0x24962e[_0xed87('0x19')](0xcc)[_0xed87('0x1a')]();});}};}function handleEntityNotFound(_0x41e0d4,_0x320bcc){return function(_0x31c600){if(!_0x31c600){_0x41e0d4[_0xed87('0x18')](0x194);}return _0x31c600;};}function handleError(_0x25a6f7,_0x4735b3){_0x4735b3=_0x4735b3||0x1f4;return function(_0x40b2fa){logger[_0xed87('0x25')](_0x40b2fa[_0xed87('0x26')]);if(_0x40b2fa[_0xed87('0x27')]){delete _0x40b2fa[_0xed87('0x27')];}_0x25a6f7[_0xed87('0x19')](_0x4735b3)['send'](_0x40b2fa);};}exports[_0xed87('0x28')]=function(_0x1c4a65,_0x4eaa44){var _0x3dff74={},_0x33c367={},_0x21c93b={'count':0x0,'rows':[]};var _0x4b259e=_['map'](db[_0xed87('0x29')][_0xed87('0x2a')],function(_0x21ab8a){return{'name':_0x21ab8a['fieldName'],'type':_0x21ab8a[_0xed87('0x2b')][_0xed87('0x2c')]};});_0x33c367[_0xed87('0x2d')]=_[_0xed87('0x2e')](_0x4b259e,_0xed87('0x27'));_0x33c367[_0xed87('0x2f')]=_[_0xed87('0x30')](_0x1c4a65[_0xed87('0x2f')]);_0x33c367[_0xed87('0x31')]=_['intersection'](_0x33c367[_0xed87('0x2d')],_0x33c367[_0xed87('0x2f')]);_0x3dff74['attributes']=_[_0xed87('0x32')](_0x33c367['model'],qs[_0xed87('0x33')](_0x1c4a65[_0xed87('0x2f')][_0xed87('0x33')]));_0x3dff74[_0xed87('0x34')]=_0x3dff74[_0xed87('0x34')][_0xed87('0x35')]?_0x3dff74[_0xed87('0x34')]:_0x33c367[_0xed87('0x2d')];if(!_0x1c4a65[_0xed87('0x2f')][_0xed87('0x36')](_0xed87('0x37'))){_0x3dff74['limit']=qs[_0xed87('0x1f')](_0x1c4a65[_0xed87('0x2f')]['limit']);_0x3dff74[_0xed87('0x1c')]=qs['offset'](_0x1c4a65[_0xed87('0x2f')][_0xed87('0x1c')]);}_0x3dff74['order']=qs[_0xed87('0x38')](_0x1c4a65[_0xed87('0x2f')][_0xed87('0x38')]);_0x3dff74[_0xed87('0x39')]=qs[_0xed87('0x31')](_['pick'](_0x1c4a65[_0xed87('0x2f')],_0x33c367['filters']),_0x4b259e);if(_0x1c4a65[_0xed87('0x2f')]['filter']){_0x3dff74[_0xed87('0x39')]=_[_0xed87('0x3a')](_0x3dff74[_0xed87('0x39')],{'$or':_[_0xed87('0x2e')](_0x4b259e,function(_0x319f69){if(_0x319f69[_0xed87('0x2b')]!==_0xed87('0x3b')){var _0x161491={};_0x161491[_0x319f69[_0xed87('0x27')]]={'$like':'%'+_0x1c4a65['query']['filter']+'%'};return _0x161491;}})});}_0x3dff74=_[_0xed87('0x3a')]({},_0x3dff74,_0x1c4a65[_0xed87('0x3c')]);var _0x1f16a8={'where':_0x3dff74[_0xed87('0x39')]};return db[_0xed87('0x29')][_0xed87('0x1e')](_0x1f16a8)['then'](function(_0x4398a0){_0x21c93b[_0xed87('0x1e')]=_0x4398a0;if(_0x1c4a65[_0xed87('0x2f')]['includeAll']){_0x3dff74[_0xed87('0x3d')]=[{'all':!![]}];}return db[_0xed87('0x29')][_0xed87('0x3e')](_0x3dff74);})[_0xed87('0x3f')](function(_0x1d1e99){_0x21c93b[_0xed87('0x40')]=_0x1d1e99;return _0x21c93b;})[_0xed87('0x3f')](respondWithFilteredResult(_0x4eaa44,_0x3dff74))[_0xed87('0x41')](handleError(_0x4eaa44,null));};exports[_0xed87('0x42')]=function(_0x406b73,_0x5c6925){var _0x7e6cbb={'raw':![],'where':{'id':_0x406b73[_0xed87('0x43')]['id']}},_0x3c7fcc={};_0x3c7fcc['model']=_['keys'](db[_0xed87('0x29')][_0xed87('0x2a')]);_0x3c7fcc[_0xed87('0x2f')]=_[_0xed87('0x30')](_0x406b73['query']);_0x3c7fcc[_0xed87('0x31')]=_[_0xed87('0x32')](_0x3c7fcc['model'],_0x3c7fcc[_0xed87('0x2f')]);_0x7e6cbb[_0xed87('0x34')]=_[_0xed87('0x32')](_0x3c7fcc[_0xed87('0x2d')],qs[_0xed87('0x33')](_0x406b73[_0xed87('0x2f')][_0xed87('0x33')]));_0x7e6cbb[_0xed87('0x34')]=_0x7e6cbb[_0xed87('0x34')][_0xed87('0x35')]?_0x7e6cbb[_0xed87('0x34')]:_0x3c7fcc['model'];if(_0x406b73[_0xed87('0x2f')][_0xed87('0x44')]){_0x7e6cbb[_0xed87('0x3d')]=[{'all':!![]}];}_0x7e6cbb=_[_0xed87('0x3a')]({},_0x7e6cbb,_0x406b73[_0xed87('0x3c')]);return db[_0xed87('0x29')][_0xed87('0x45')](_0x7e6cbb)[_0xed87('0x3f')](handleEntityNotFound(_0x5c6925,null))[_0xed87('0x3f')](respondWithResult(_0x5c6925,null))[_0xed87('0x41')](handleError(_0x5c6925,null));};exports[_0xed87('0x46')]=function(_0x26c8f4,_0x27ed22){return db[_0xed87('0x29')][_0xed87('0x46')](_0x26c8f4[_0xed87('0x47')],{})[_0xed87('0x3f')](respondWithResult(_0x27ed22,0xc9))['catch'](handleError(_0x27ed22,null));};exports[_0xed87('0x23')]=function(_0x1a68a7,_0x3a91c5){if(_0x1a68a7['body']['id']){delete _0x1a68a7[_0xed87('0x47')]['id'];}return db[_0xed87('0x29')]['find']({'where':{'id':_0x1a68a7[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x3a91c5,null))[_0xed87('0x3f')](saveUpdates(_0x1a68a7[_0xed87('0x47')],null))['then'](respondWithResult(_0x3a91c5,null))[_0xed87('0x41')](handleError(_0x3a91c5,null));};exports[_0xed87('0x24')]=function(_0x3ca34c,_0x272a07){return db[_0xed87('0x29')][_0xed87('0x45')]({'where':{'id':_0x3ca34c[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x272a07,null))[_0xed87('0x3f')](removeEntity(_0x272a07,null))[_0xed87('0x41')](handleError(_0x272a07,null));};exports[_0xed87('0x48')]=function(_0x18846f,_0x2e5a9f,_0x4df105){var _0x43ffa4={};var _0x4ea4e3={};var _0x17cad7;var _0x329973;return db[_0xed87('0x29')][_0xed87('0x49')]({'where':{'id':_0x18846f[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x2e5a9f,null))[_0xed87('0x3f')](function(_0xccdbb6){if(_0xccdbb6){_0x17cad7=_0xccdbb6;_0x4ea4e3[_0xed87('0x2d')]=_[_0xed87('0x30')](db['ZendeskConfiguration'][_0xed87('0x2a')]);_0x4ea4e3[_0xed87('0x2f')]=_[_0xed87('0x30')](_0x18846f[_0xed87('0x2f')]);_0x4ea4e3[_0xed87('0x31')]=_[_0xed87('0x32')](_0x4ea4e3[_0xed87('0x2d')],_0x4ea4e3[_0xed87('0x2f')]);_0x43ffa4[_0xed87('0x34')]=_[_0xed87('0x32')](_0x4ea4e3[_0xed87('0x2d')],qs['fields'](_0x18846f['query'][_0xed87('0x33')]));_0x43ffa4[_0xed87('0x34')]=_0x43ffa4[_0xed87('0x34')][_0xed87('0x35')]?_0x43ffa4[_0xed87('0x34')]:_0x4ea4e3['model'];_0x43ffa4[_0xed87('0x4a')]=qs[_0xed87('0x38')](_0x18846f[_0xed87('0x2f')][_0xed87('0x38')]);_0x43ffa4[_0xed87('0x39')]=qs[_0xed87('0x31')](_[_0xed87('0x4b')](_0x18846f[_0xed87('0x2f')],_0x4ea4e3[_0xed87('0x31')]));if(_0x18846f[_0xed87('0x2f')][_0xed87('0x4c')]){_0x43ffa4[_0xed87('0x39')]=_[_0xed87('0x3a')](_0x43ffa4[_0xed87('0x39')],{'$or':_['map'](_0x43ffa4[_0xed87('0x34')],function(_0x10a19c){var _0x2f03d4={};_0x2f03d4[_0x10a19c]={'$like':'%'+_0x18846f[_0xed87('0x2f')][_0xed87('0x4c')]+'%'};return _0x2f03d4;})});}_0x43ffa4=_[_0xed87('0x3a')]({},_0x43ffa4,_0x18846f[_0xed87('0x3c')]);return _0x17cad7[_0xed87('0x48')](_0x43ffa4);}})['then'](function(_0x4367c3){if(_0x4367c3){_0x329973=_0x4367c3[_0xed87('0x35')];if(!_0x18846f[_0xed87('0x2f')][_0xed87('0x36')](_0xed87('0x37'))){_0x43ffa4[_0xed87('0x1f')]=qs['limit'](_0x18846f['query'][_0xed87('0x1f')]);_0x43ffa4[_0xed87('0x1c')]=qs[_0xed87('0x1c')](_0x18846f[_0xed87('0x2f')][_0xed87('0x1c')]);}return _0x17cad7[_0xed87('0x48')](_0x43ffa4);}})[_0xed87('0x3f')](function(_0x3bdf7c){if(_0x3bdf7c){return _0x3bdf7c?{'count':_0x329973,'rows':_0x3bdf7c}:null;}})['then'](respondWithResult(_0x2e5a9f,null))[_0xed87('0x41')](handleError(_0x2e5a9f,null));};exports['addConfiguration']=function(_0xd3b300,_0x3c82de,_0x4e5055){if(_0xd3b300[_0xed87('0x47')]['id']){delete _0xd3b300[_0xed87('0x47')]['id'];}return db['ZendeskAccount'][_0xed87('0x49')]({'where':{'id':_0xd3b300[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x3c82de,null))[_0xed87('0x3f')](function(_0x112685){if(_0x112685){_0xd3b300['body'][_0xed87('0x4d')]=_0x112685['id'];_0xd3b300[_0xed87('0x47')][_0xed87('0x4e')]=integrations[_0xed87('0x4f')](_0xd3b300['body']['channel'],_0xd3b300[_0xed87('0x47')][_0xed87('0x2b')]);_0xd3b300['body'][_0xed87('0x50')]=integrations[_0xed87('0x51')](_0xd3b300[_0xed87('0x47')][_0xed87('0x52')],_0xd3b300[_0xed87('0x47')][_0xed87('0x2b')]);return db[_0xed87('0x53')][_0xed87('0x46')](_0xd3b300[_0xed87('0x47')],{'include':[{'model':db[_0xed87('0x54')],'as':_0xed87('0x4e')},{'model':db[_0xed87('0x54')],'as':_0xed87('0x50')}]});}return null;})[_0xed87('0x3f')](respondWithResult(_0x3c82de,null))['catch'](handleError(_0x3c82de,null));};exports[_0xed87('0x55')]=function(_0x2686cd,_0x566ace,_0x4f7b92){var _0x5136c9='';return db[_0xed87('0x29')][_0xed87('0x49')]({'where':{'id':_0x2686cd[_0xed87('0x43')]['id']},'attributes':['id',_0xed87('0x56'),_0xed87('0x57'),_0xed87('0x58'),_0xed87('0x59'),'remoteUri']})[_0xed87('0x3f')](handleEntityNotFound(_0x566ace,null))[_0xed87('0x3f')](function(_0x3b6a9b){if(_0x3b6a9b){_0x5136c9=_0x3b6a9b[_0xed87('0x5a')];var _0xc35cab=_0x5136c9[_0xed87('0x5b')](-0x1);if(_0xc35cab==='/'){_0x5136c9=_0x5136c9[_0xed87('0x5c')](0x0,_0x5136c9[_0xed87('0x5d')](_0xc35cab));}var _0x116198={'method':_0xed87('0x5e'),'uri':util['format']('%s/%s',_0x5136c9,'ticket_fields'),'json':!![]};switch(_0x3b6a9b[_0xed87('0x59')]){case _0xed87('0x57'):_0x116198[_0xed87('0x5f')]={'Authorization':util[_0xed87('0x60')](_0xed87('0x61'),new Buffer(util['format'](_0xed87('0x62'),_0x3b6a9b[_0xed87('0x56')],_0x3b6a9b[_0xed87('0x57')]))[_0xed87('0x63')](_0xed87('0x64')))};break;case _0xed87('0x58'):_0x116198['headers']={'Authorization':util['format'](_0xed87('0x61'),new Buffer(util[_0xed87('0x60')](_0xed87('0x65'),_0x3b6a9b[_0xed87('0x56')],_0x3b6a9b[_0xed87('0x58')]))[_0xed87('0x63')](_0xed87('0x64')))};break;default:throw new db[(_0xed87('0x66'))][(_0xed87('0x67'))](_0xed87('0x68'));}return rp(_0x116198);}})[_0xed87('0x3f')](function(_0x1a1f95){if(_0x1a1f95){var _0x52af5c=[_0xed87('0x69'),_0xed87('0x6a'),_0xed87('0x6b'),_0xed87('0x6c')];_[_0xed87('0x6d')](_0x1a1f95[_0xed87('0x6e')],function(_0x4ae84c){return _0x52af5c[_0xed87('0x6f')](_0x4ae84c[_0xed87('0x2b')]);});return{'count':_0x1a1f95[_0xed87('0x6e')][_0xed87('0x35')],'rows':_['map'](_0x1a1f95['ticket_fields'],function(_0x4bfca0){return{'id':_0x4bfca0['id'],'name':_0x4bfca0['position']>0x7?_0x4bfca0['title']:_0x4bfca0[_0xed87('0x2b')],'custom':_0x4bfca0[_0xed87('0x70')]>0x7?!![]:![],'options':_0x4bfca0[_0xed87('0x71')]?_0x4bfca0[_0xed87('0x71')]:_0x4bfca0[_0xed87('0x72')]?_0x4bfca0[_0xed87('0x72')]:[]};})};}})[_0xed87('0x3f')](respondWithResult(_0x566ace,null))[_0xed87('0x41')](function(_0x1b223b){var _0x510066=_0x2686cd['query'][_0xed87('0x73')]?0x1f4:_0x1b223b[_0xed87('0x74')]||0x1f4;logger[_0xed87('0x25')](_0xed87('0x75'),_0xed87('0x55'),_0x510066,JSON['stringify'](_0x1b223b));delete _0x1b223b['name'];if(_0x510066===0x191){_0x510066=0x190;}_0x566ace[_0xed87('0x19')](_0x510066)[_0xed87('0x76')](_0x2686cd['query'][_0xed87('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x1b223b[_0xed87('0x74')]}:_0x1b223b);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index dcf6d2a..3505a9c 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 _0x7fcb=['../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./intZendeskAccount.attributes'];(function(_0x136a0d,_0x476fe2){var _0x212ea5=function(_0xa288e){while(--_0xa288e){_0x136a0d['push'](_0x136a0d['shift']());}};_0x212ea5(++_0x476fe2);}(_0x7fcb,0xd5));var _0xb7fc=function(_0x5f41f5,_0x52a50e){_0x5f41f5=_0x5f41f5-0x0;var _0x26bf5f=_0x7fcb[_0x5f41f5];return _0x26bf5f;};'use strict';var _=require(_0xb7fc('0x0'));var util=require(_0xb7fc('0x1'));var logger=require(_0xb7fc('0x2'))(_0xb7fc('0x3'));var moment=require(_0xb7fc('0x4'));var BPromise=require(_0xb7fc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb7fc('0x6'));var attributes=require(_0xb7fc('0x7'));var integrations=require(_0xb7fc('0x8'));module[_0xb7fc('0x9')]=function(_0x34c0ee,_0x3fc7d0){return _0x34c0ee[_0xb7fc('0xa')](_0xb7fc('0xb'),attributes,{'tableName':_0xb7fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1227=['exports','define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x81e446,_0x4e5b91){var _0xae6f7d=function(_0x281501){while(--_0x281501){_0x81e446['push'](_0x81e446['shift']());}};_0xae6f7d(++_0x4e5b91);}(_0x1227,0x149));var _0x7122=function(_0x625d33,_0x49620c){_0x625d33=_0x625d33-0x0;var _0x564efe=_0x1227[_0x625d33];return _0x564efe;};'use strict';var _=require('lodash');var util=require(_0x7122('0x0'));var logger=require(_0x7122('0x1'))(_0x7122('0x2'));var moment=require(_0x7122('0x3'));var BPromise=require(_0x7122('0x4'));var rp=require(_0x7122('0x5'));var fs=require('fs');var path=require(_0x7122('0x6'));var rimraf=require(_0x7122('0x7'));var config=require(_0x7122('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x7122('0x9')]=function(_0x2159c1,_0x501892){return _0x2159c1[_0x7122('0xa')](_0x7122('0xb'),attributes,{'tableName':_0x7122('0xc'),'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 afe73c3..5ca7065 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 _0x87d8=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','findAll','options','raw','where','include','map','model','attributes','then','GetZendeskAccount','ShowZendeskAccount','ZendeskAccount','find','stringify','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x81aac4,_0x359122){var _0x72fcfd=function(_0x4e7c82){while(--_0x4e7c82){_0x81aac4['push'](_0x81aac4['shift']());}};_0x72fcfd(++_0x359122);}(_0x87d8,0x1a9));var _0x887d=function(_0x381cd5,_0x1f66dd){_0x381cd5=_0x381cd5-0x0;var _0x14b162=_0x87d8[_0x381cd5];return _0x14b162;};'use strict';var _=require('lodash');var util=require(_0x887d('0x0'));var moment=require(_0x887d('0x1'));var BPromise=require(_0x887d('0x2'));var rs=require(_0x887d('0x3'));var fs=require('fs');var Redis=require(_0x887d('0x4'));var db=require(_0x887d('0x5'))['db'];var utils=require(_0x887d('0x6'));var logger=require(_0x887d('0x7'))(_0x887d('0x8'));var config=require(_0x887d('0x9'));var jayson=require(_0x887d('0xa'));var client=jayson[_0x887d('0xb')][_0x887d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16820a,_0x242f79,_0x479f76){return new BPromise(function(_0x411c20,_0x3788f7){return client['request'](_0x16820a,_0x479f76)['then'](function(_0x583716){logger['info'](_0x887d('0xd'),_0x242f79,_0x887d('0xe'));logger[_0x887d('0xf')](_0x887d('0x10'),_0x242f79,'request\x20sent',JSON['stringify'](_0x583716));if(_0x583716[_0x887d('0x11')]){if(_0x583716[_0x887d('0x11')][_0x887d('0x12')]===0x1f4){logger[_0x887d('0x11')](_0x887d('0xd'),_0x242f79,_0x583716[_0x887d('0x11')][_0x887d('0x13')]);return _0x3788f7(_0x583716[_0x887d('0x11')]['message']);}logger[_0x887d('0x11')](_0x887d('0xd'),_0x242f79,_0x583716[_0x887d('0x11')]['message']);return _0x411c20(_0x583716[_0x887d('0x11')][_0x887d('0x13')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x242f79,'request\x20sent');_0x411c20(_0x583716[_0x887d('0x14')][_0x887d('0x13')]);}})['catch'](function(_0xa5b593){logger[_0x887d('0x11')](_0x887d('0xd'),_0x242f79,_0xa5b593);_0x3788f7(_0xa5b593);});});}exports['GetZendeskAccount']=function(_0xdfadaf){var _0x3f6123=this;return new Promise(function(_0x5e97ec,_0xd02be9){return db['ZendeskAccount'][_0x887d('0x15')]({'raw':_0xdfadaf[_0x887d('0x16')]?_0xdfadaf[_0x887d('0x16')][_0x887d('0x17')]===undefined?!![]:![]:!![],'where':_0xdfadaf[_0x887d('0x16')]?_0xdfadaf[_0x887d('0x16')][_0x887d('0x18')]||null:null,'attributes':_0xdfadaf[_0x887d('0x16')]?_0xdfadaf[_0x887d('0x16')]['attributes']||null:null,'limit':_0xdfadaf['options']?_0xdfadaf[_0x887d('0x16')]['limit']||null:null,'include':_0xdfadaf[_0x887d('0x16')]?_0xdfadaf[_0x887d('0x16')][_0x887d('0x19')]?_[_0x887d('0x1a')](_0xdfadaf[_0x887d('0x16')][_0x887d('0x19')],function(_0x515554){return{'model':db[_0x515554[_0x887d('0x1b')]],'as':_0x515554['as'],'attributes':_0x515554[_0x887d('0x1c')],'include':_0x515554['include']?_['map'](_0x515554[_0x887d('0x19')],function(_0x3e198b){return{'model':db[_0x3e198b[_0x887d('0x1b')]],'as':_0x3e198b['as'],'attributes':_0x3e198b[_0x887d('0x1c')],'include':_0x3e198b['include']?_[_0x887d('0x1a')](_0x3e198b[_0x887d('0x19')],function(_0x2cc7f7){return{'model':db[_0x2cc7f7['model']],'as':_0x2cc7f7['as'],'attributes':_0x2cc7f7[_0x887d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x887d('0x1d')](function(_0x2668a8){logger['info']('GetZendeskAccount',_0xdfadaf);logger[_0x887d('0xf')](_0x887d('0x1e'),_0xdfadaf,JSON['stringify'](_0x2668a8));_0x5e97ec(_0x2668a8);})['catch'](function(_0x329b92){logger['error'](_0x887d('0x1e'),_0x329b92[_0x887d('0x13')],_0xdfadaf);_0xd02be9(_0x3f6123['error'](0x1f4,_0x329b92[_0x887d('0x13')]));});});};exports[_0x887d('0x1f')]=function(_0x4ae14d){var _0x5edbe5=this;return new Promise(function(_0x4c8f92,_0x2891e2){return db[_0x887d('0x20')][_0x887d('0x21')]({'raw':_0x4ae14d[_0x887d('0x16')]?_0x4ae14d[_0x887d('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4ae14d[_0x887d('0x16')]?_0x4ae14d[_0x887d('0x16')][_0x887d('0x18')]||null:null,'attributes':_0x4ae14d['options']?_0x4ae14d['options'][_0x887d('0x1c')]||null:null,'include':_0x4ae14d['options']?_0x4ae14d['options'][_0x887d('0x19')]?_['map'](_0x4ae14d[_0x887d('0x16')][_0x887d('0x19')],function(_0x124bd2){return{'model':db[_0x124bd2[_0x887d('0x1b')]],'as':_0x124bd2['as'],'attributes':_0x124bd2['attributes'],'include':_0x124bd2[_0x887d('0x19')]?_[_0x887d('0x1a')](_0x124bd2[_0x887d('0x19')],function(_0x322657){return{'model':db[_0x322657[_0x887d('0x1b')]],'as':_0x322657['as'],'attributes':_0x322657['attributes'],'include':_0x322657[_0x887d('0x19')]?_[_0x887d('0x1a')](_0x322657['include'],function(_0x24c713){return{'model':db[_0x24c713['model']],'as':_0x24c713['as'],'attributes':_0x24c713[_0x887d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x887d('0x1d')](function(_0x47e796){logger['info']('ShowZendeskAccount',_0x4ae14d);logger[_0x887d('0xf')](_0x887d('0x1f'),_0x4ae14d,JSON[_0x887d('0x22')](_0x47e796));_0x4c8f92(_0x47e796);})[_0x887d('0x23')](function(_0x171253){logger[_0x887d('0x11')](_0x887d('0x1f'),_0x171253['message'],_0x4ae14d);_0x2891e2(_0x5edbe5[_0x887d('0x11')](0x1f4,_0x171253['message']));});});}; \ No newline at end of file +var _0xe2db=['map','model','catch','find','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xe2db,0x149));var _0xbe2d=function(_0x478a5b,_0x1c566f){_0x478a5b=_0x478a5b-0x0;var _0x2da27f=_0xe2db[_0x478a5b];return _0x2da27f;};'use strict';var _=require(_0xbe2d('0x0'));var util=require(_0xbe2d('0x1'));var moment=require(_0xbe2d('0x2'));var BPromise=require(_0xbe2d('0x3'));var rs=require(_0xbe2d('0x4'));var fs=require('fs');var Redis=require(_0xbe2d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbe2d('0x6'))(_0xbe2d('0x7'));var config=require(_0xbe2d('0x8'));var jayson=require(_0xbe2d('0x9'));var client=jayson[_0xbe2d('0xa')][_0xbe2d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x189f5a,_0x5f45b0,_0x56830d){return new BPromise(function(_0x192b86,_0x5d7ffb){return client[_0xbe2d('0xc')](_0x189f5a,_0x56830d)[_0xbe2d('0xd')](function(_0x36aa22){logger[_0xbe2d('0xe')](_0xbe2d('0xf'),_0x5f45b0,_0xbe2d('0x10'));logger[_0xbe2d('0x11')](_0xbe2d('0x12'),_0x5f45b0,'request\x20sent',JSON[_0xbe2d('0x13')](_0x36aa22));if(_0x36aa22[_0xbe2d('0x14')]){if(_0x36aa22[_0xbe2d('0x14')]['code']===0x1f4){logger[_0xbe2d('0x14')](_0xbe2d('0xf'),_0x5f45b0,_0x36aa22[_0xbe2d('0x14')][_0xbe2d('0x15')]);return _0x5d7ffb(_0x36aa22[_0xbe2d('0x14')][_0xbe2d('0x15')]);}logger[_0xbe2d('0x14')](_0xbe2d('0xf'),_0x5f45b0,_0x36aa22['error'][_0xbe2d('0x15')]);return _0x192b86(_0x36aa22['error']['message']);}else{logger[_0xbe2d('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x5f45b0,_0xbe2d('0x10'));_0x192b86(_0x36aa22['result'][_0xbe2d('0x15')]);}})['catch'](function(_0x4995aa){logger[_0xbe2d('0x14')](_0xbe2d('0xf'),_0x5f45b0,_0x4995aa);_0x5d7ffb(_0x4995aa);});});}exports[_0xbe2d('0x16')]=function(_0xd293){var _0x3d9eda=this;return new Promise(function(_0x886461,_0x2ffa9a){return db[_0xbe2d('0x17')][_0xbe2d('0x18')]({'raw':_0xd293['options']?_0xd293[_0xbe2d('0x19')][_0xbe2d('0x1a')]===undefined?!![]:![]:!![],'where':_0xd293[_0xbe2d('0x19')]?_0xd293[_0xbe2d('0x19')][_0xbe2d('0x1b')]||null:null,'attributes':_0xd293[_0xbe2d('0x19')]?_0xd293['options'][_0xbe2d('0x1c')]||null:null,'limit':_0xd293['options']?_0xd293[_0xbe2d('0x19')][_0xbe2d('0x1d')]||null:null,'include':_0xd293[_0xbe2d('0x19')]?_0xd293[_0xbe2d('0x19')][_0xbe2d('0x1e')]?_[_0xbe2d('0x1f')](_0xd293[_0xbe2d('0x19')][_0xbe2d('0x1e')],function(_0x528d12){return{'model':db[_0x528d12[_0xbe2d('0x20')]],'as':_0x528d12['as'],'attributes':_0x528d12[_0xbe2d('0x1c')],'include':_0x528d12[_0xbe2d('0x1e')]?_[_0xbe2d('0x1f')](_0x528d12[_0xbe2d('0x1e')],function(_0x17525a){return{'model':db[_0x17525a['model']],'as':_0x17525a['as'],'attributes':_0x17525a[_0xbe2d('0x1c')],'include':_0x17525a[_0xbe2d('0x1e')]?_[_0xbe2d('0x1f')](_0x17525a['include'],function(_0x1199b7){return{'model':db[_0x1199b7['model']],'as':_0x1199b7['as'],'attributes':_0x1199b7[_0xbe2d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbe2d('0xd')](function(_0x484560){logger['info'](_0xbe2d('0x16'),_0xd293);logger[_0xbe2d('0x11')](_0xbe2d('0x16'),_0xd293,JSON[_0xbe2d('0x13')](_0x484560));_0x886461(_0x484560);})[_0xbe2d('0x21')](function(_0x3563c6){logger['error'](_0xbe2d('0x16'),_0x3563c6['message'],_0xd293);_0x2ffa9a(_0x3d9eda[_0xbe2d('0x14')](0x1f4,_0x3563c6['message']));});});};exports['ShowZendeskAccount']=function(_0x11b114){var _0x4b4c66=this;return new Promise(function(_0x1b88ef,_0x332230){return db[_0xbe2d('0x17')][_0xbe2d('0x22')]({'raw':_0x11b114[_0xbe2d('0x19')]?_0x11b114[_0xbe2d('0x19')][_0xbe2d('0x1a')]===undefined?!![]:![]:!![],'where':_0x11b114[_0xbe2d('0x19')]?_0x11b114[_0xbe2d('0x19')][_0xbe2d('0x1b')]||null:null,'attributes':_0x11b114[_0xbe2d('0x19')]?_0x11b114[_0xbe2d('0x19')]['attributes']||null:null,'include':_0x11b114['options']?_0x11b114[_0xbe2d('0x19')][_0xbe2d('0x1e')]?_[_0xbe2d('0x1f')](_0x11b114[_0xbe2d('0x19')][_0xbe2d('0x1e')],function(_0x3d7416){return{'model':db[_0x3d7416['model']],'as':_0x3d7416['as'],'attributes':_0x3d7416[_0xbe2d('0x1c')],'include':_0x3d7416['include']?_[_0xbe2d('0x1f')](_0x3d7416['include'],function(_0x5163ea){return{'model':db[_0x5163ea[_0xbe2d('0x20')]],'as':_0x5163ea['as'],'attributes':_0x5163ea[_0xbe2d('0x1c')],'include':_0x5163ea[_0xbe2d('0x1e')]?_[_0xbe2d('0x1f')](_0x5163ea[_0xbe2d('0x1e')],function(_0x10a3d8){return{'model':db[_0x10a3d8['model']],'as':_0x10a3d8['as'],'attributes':_0x10a3d8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b09fd){logger[_0xbe2d('0xe')](_0xbe2d('0x23'),_0x11b114);logger[_0xbe2d('0x11')]('ShowZendeskAccount',_0x11b114,JSON[_0xbe2d('0x13')](_0x3b09fd));_0x1b88ef(_0x3b09fd);})[_0xbe2d('0x21')](function(_0x429314){logger[_0xbe2d('0x14')](_0xbe2d('0x23'),_0x429314[_0xbe2d('0x15')],_0x11b114);_0x332230(_0x4b4c66[_0xbe2d('0x14')](0x1f4,_0x429314[_0xbe2d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index d369ce8..90c3f5a 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bb5=['put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags'];(function(_0x30ec0a,_0x390560){var _0x1c5562=function(_0xf152ac){while(--_0xf152ac){_0x30ec0a['push'](_0x30ec0a['shift']());}};_0x1c5562(++_0x390560);}(_0x0bb5,0x148));var _0x50bb=function(_0x51f19e,_0x39454f){_0x51f19e=_0x51f19e-0x0;var _0x4d37c3=_0x0bb5[_0x51f19e];return _0x4d37c3;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id/fields',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0x9')](_0x50bb('0xe'),auth['isAuthenticated'](),controller[_0x50bb('0xf')]);router[_0x50bb('0x9')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x9')](_0x50bb('0x12'),auth['isAuthenticated'](),controller[_0x50bb('0x13')]);router['post']('/',auth[_0x50bb('0xb')](),controller[_0x50bb('0x14')]);router[_0x50bb('0x15')]('/:id/tags',auth[_0x50bb('0xb')](),controller[_0x50bb('0x16')]);router[_0x50bb('0x17')]('/:id',auth[_0x50bb('0xb')](),controller['update']);router[_0x50bb('0x18')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x19')]);module[_0x50bb('0x1a')]=router; \ No newline at end of file +var _0x4fc2=['get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','show'];(function(_0x3eb197,_0xd5493e){var _0x4b53f4=function(_0x327c89){while(--_0x327c89){_0x3eb197['push'](_0x3eb197['shift']());}};_0x4b53f4(++_0xd5493e);}(_0x4fc2,0x111));var _0x24fc=function(_0x446737,_0x411246){_0x446737=_0x446737-0x0;var _0x575b95=_0x4fc2[_0x446737];return _0x575b95;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['getFields']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['get'](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['getTags']);router[_0x24fc('0x14')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x15')]);router[_0x24fc('0x14')](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['setTags']);router[_0x24fc('0x16')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x17')]);router['delete'](_0x24fc('0xb'),auth['isAuthenticated'](),controller[_0x24fc('0x18')]);module[_0x24fc('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index b602117..1e4e1eb 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 _0xc864=['STRING','sequelize','exports'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xc864,0x1ba));var _0x4c86=function(_0x186ee1,_0x2e9460){_0x186ee1=_0x186ee1-0x0;var _0x9c6d5c=_0xc864[_0x186ee1];return _0x9c6d5c;};'use strict';var Sequelize=require(_0x4c86('0x0'));module[_0x4c86('0x1')]={'name':{'type':Sequelize[_0x4c86('0x2')]},'description':{'type':Sequelize[_0x4c86('0x2')]}}; \ No newline at end of file +var _0x01aa=['STRING','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x01aa,0x193));var _0xa01a=function(_0x492387,_0x433bd5){_0x492387=_0x492387-0x0;var _0x347d9a=_0x01aa[_0x492387];return _0x347d9a;};'use strict';var Sequelize=require(_0xa01a('0x0'));module[_0xa01a('0x1')]={'name':{'type':Sequelize[_0xa01a('0x2')]},'description':{'type':Sequelize[_0xa01a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index f2393c9..6742d91 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 _0x7861=['options','findAll','rawAttributes','include','catch','create','body','params','find','findOne','ZendeskField','pick','getFields','getSubjects','getDescriptions','getTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL'];(function(_0x35c12c,_0x378ba0){var _0x2bab3a=function(_0x43eeb2){while(--_0x43eeb2){_0x35c12c['push'](_0x35c12c['shift']());}};_0x2bab3a(++_0x378ba0);}(_0x7861,0xb7));var _0x1786=function(_0xe4da94,_0xeb03e3){_0xe4da94=_0xe4da94-0x0;var _0x582ea7=_0x7861[_0xe4da94];return _0x582ea7;};'use strict';var emlformat=require(_0x1786('0x0'));var rimraf=require(_0x1786('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1786('0x2'));var rp=require(_0x1786('0x3'));var moment=require(_0x1786('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1786('0x5'));var util=require(_0x1786('0x6'));var path=require(_0x1786('0x7'));var sox=require(_0x1786('0x8'));var csv=require(_0x1786('0x9'));var ejs=require(_0x1786('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1786('0xb'));var squel=require(_0x1786('0xc'));var crypto=require('crypto');var jsforce=require(_0x1786('0xd'));var deskjs=require(_0x1786('0xe'));var toCsv=require(_0x1786('0x9'));var querystring=require(_0x1786('0xf'));var Papa=require(_0x1786('0x10'));var Redis=require(_0x1786('0x11'));var authService=require(_0x1786('0x12'));var qs=require(_0x1786('0x13'));var as=require(_0x1786('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1786('0x15'))('api');var utils=require(_0x1786('0x16'));var config=require(_0x1786('0x17'));var licenseUtil=require(_0x1786('0x18'));var db=require(_0x1786('0x19'))['db'];function respondWithStatusCode(_0x5001ef,_0x174f7e){_0x174f7e=_0x174f7e||0xcc;return function(_0x2f160a){if(_0x2f160a){return _0x5001ef[_0x1786('0x1a')](_0x174f7e);}return _0x5001ef[_0x1786('0x1b')](_0x174f7e)[_0x1786('0x1c')]();};}function respondWithResult(_0x2c1f76,_0xcaa24f){_0xcaa24f=_0xcaa24f||0xc8;return function(_0x5a97db){if(_0x5a97db){return _0x2c1f76[_0x1786('0x1b')](_0xcaa24f)['json'](_0x5a97db);}};}function respondWithFilteredResult(_0x7b9843,_0x2ac64e){return function(_0x1704e6){if(_0x1704e6){var _0xf98f3c=typeof _0x2ac64e['offset']===_0x1786('0x1d')&&typeof _0x2ac64e[_0x1786('0x1e')]===_0x1786('0x1d');var _0x2742a2=_0x1704e6['count'];var _0xe9c04d=_0xf98f3c?0x0:_0x2ac64e[_0x1786('0x1f')];var _0x1a9bd6=_0xf98f3c?_0x1704e6[_0x1786('0x20')]:_0x2ac64e['offset']+_0x2ac64e[_0x1786('0x1e')];var _0x5ae079;if(_0x1a9bd6>=_0x2742a2){_0x1a9bd6=_0x2742a2;_0x5ae079=0xc8;}else{_0x5ae079=0xce;}_0x7b9843[_0x1786('0x1b')](_0x5ae079);return _0x7b9843['set']('Content-Range',_0xe9c04d+'-'+_0x1a9bd6+'/'+_0x2742a2)[_0x1786('0x21')](_0x1704e6);}return null;};}function patchUpdates(_0x4b2b57){return function(_0x237b78){try{jsonpatch[_0x1786('0x22')](_0x237b78,_0x4b2b57,!![]);}catch(_0x15dc81){return BPromise[_0x1786('0x23')](_0x15dc81);}return _0x237b78[_0x1786('0x24')]();};}function saveUpdates(_0x4b211b,_0x2096b8){return function(_0x58df98){if(_0x58df98){return _0x58df98[_0x1786('0x25')](_0x4b211b)[_0x1786('0x26')](function(_0x48e22f){return _0x48e22f;});}return null;};}function removeEntity(_0xc0d119,_0x3a2864){return function(_0x1ea122){if(_0x1ea122){return _0x1ea122[_0x1786('0x27')]()[_0x1786('0x26')](function(){_0xc0d119[_0x1786('0x1b')](0xcc)[_0x1786('0x1c')]();});}};}function handleEntityNotFound(_0xd1ddd7,_0x28abb7){return function(_0x55228b){if(!_0x55228b){_0xd1ddd7['sendStatus'](0x194);}return _0x55228b;};}function handleError(_0x54f102,_0x57638e){_0x57638e=_0x57638e||0x1f4;return function(_0x2a3e9b){logger[_0x1786('0x28')](_0x2a3e9b[_0x1786('0x29')]);if(_0x2a3e9b[_0x1786('0x2a')]){delete _0x2a3e9b[_0x1786('0x2a')];}_0x54f102['status'](_0x57638e)[_0x1786('0x2b')](_0x2a3e9b);};}exports[_0x1786('0x2c')]=function(_0xa6a791,_0x349279){var _0x1838d1={},_0x554014={},_0x33d55e={'count':0x0,'rows':[]};var _0x3165ef=_[_0x1786('0x2d')](db[_0x1786('0x2e')]['rawAttributes'],function(_0x28cabd){return{'name':_0x28cabd[_0x1786('0x2f')],'type':_0x28cabd['type'][_0x1786('0x30')]};});_0x554014['model']=_['map'](_0x3165ef,_0x1786('0x2a'));_0x554014[_0x1786('0x31')]=_[_0x1786('0x32')](_0xa6a791[_0x1786('0x31')]);_0x554014[_0x1786('0x33')]=_['intersection'](_0x554014[_0x1786('0x34')],_0x554014[_0x1786('0x31')]);_0x1838d1[_0x1786('0x35')]=_[_0x1786('0x36')](_0x554014[_0x1786('0x34')],qs['fields'](_0xa6a791[_0x1786('0x31')][_0x1786('0x37')]));_0x1838d1[_0x1786('0x35')]=_0x1838d1['attributes'][_0x1786('0x38')]?_0x1838d1[_0x1786('0x35')]:_0x554014[_0x1786('0x34')];if(!_0xa6a791[_0x1786('0x31')][_0x1786('0x39')](_0x1786('0x3a'))){_0x1838d1['limit']=qs['limit'](_0xa6a791[_0x1786('0x31')][_0x1786('0x1e')]);_0x1838d1[_0x1786('0x1f')]=qs[_0x1786('0x1f')](_0xa6a791[_0x1786('0x31')][_0x1786('0x1f')]);}_0x1838d1[_0x1786('0x3b')]=qs[_0x1786('0x3c')](_0xa6a791['query'][_0x1786('0x3c')]);_0x1838d1['where']=qs[_0x1786('0x33')](_['pick'](_0xa6a791[_0x1786('0x31')],_0x554014[_0x1786('0x33')]),_0x3165ef);if(_0xa6a791[_0x1786('0x31')][_0x1786('0x3d')]){_0x1838d1[_0x1786('0x3e')]=_[_0x1786('0x3f')](_0x1838d1[_0x1786('0x3e')],{'$or':_[_0x1786('0x2d')](_0x3165ef,function(_0xfdda7b){if(_0xfdda7b[_0x1786('0x40')]!==_0x1786('0x41')){var _0x29c8ba={};_0x29c8ba[_0xfdda7b[_0x1786('0x2a')]]={'$like':'%'+_0xa6a791[_0x1786('0x31')][_0x1786('0x3d')]+'%'};return _0x29c8ba;}})});}_0x1838d1=_['merge']({},_0x1838d1,_0xa6a791[_0x1786('0x42')]);var _0x448e4f={'where':_0x1838d1[_0x1786('0x3e')]};return db[_0x1786('0x2e')][_0x1786('0x20')](_0x448e4f)[_0x1786('0x26')](function(_0x218603){_0x33d55e['count']=_0x218603;if(_0xa6a791['query']['includeAll']){_0x1838d1['include']=[{'all':!![]}];}return db[_0x1786('0x2e')][_0x1786('0x43')](_0x1838d1);})[_0x1786('0x26')](function(_0x3a480b){_0x33d55e['rows']=_0x3a480b;return _0x33d55e;})[_0x1786('0x26')](respondWithFilteredResult(_0x349279,_0x1838d1))['catch'](handleError(_0x349279,null));};exports['show']=function(_0x2a4c19,_0x1d695a){var _0x2e07f7={'raw':![],'where':{'id':_0x2a4c19['params']['id']}},_0x39ccfc={};_0x39ccfc[_0x1786('0x34')]=_[_0x1786('0x32')](db[_0x1786('0x2e')][_0x1786('0x44')]);_0x39ccfc[_0x1786('0x31')]=_['keys'](_0x2a4c19[_0x1786('0x31')]);_0x39ccfc['filters']=_[_0x1786('0x36')](_0x39ccfc[_0x1786('0x34')],_0x39ccfc['query']);_0x2e07f7[_0x1786('0x35')]=_[_0x1786('0x36')](_0x39ccfc[_0x1786('0x34')],qs['fields'](_0x2a4c19[_0x1786('0x31')][_0x1786('0x37')]));_0x2e07f7[_0x1786('0x35')]=_0x2e07f7[_0x1786('0x35')][_0x1786('0x38')]?_0x2e07f7[_0x1786('0x35')]:_0x39ccfc[_0x1786('0x34')];if(_0x2a4c19[_0x1786('0x31')]['includeAll']){_0x2e07f7[_0x1786('0x45')]=[{'all':!![]}];}_0x2e07f7=_[_0x1786('0x3f')]({},_0x2e07f7,_0x2a4c19[_0x1786('0x42')]);return db[_0x1786('0x2e')]['find'](_0x2e07f7)[_0x1786('0x26')](handleEntityNotFound(_0x1d695a,null))['then'](respondWithResult(_0x1d695a,null))[_0x1786('0x46')](handleError(_0x1d695a,null));};exports[_0x1786('0x47')]=function(_0x59c11b,_0x1a1fc6){return db[_0x1786('0x2e')][_0x1786('0x47')](_0x59c11b['body'],{})[_0x1786('0x26')](respondWithResult(_0x1a1fc6,0xc9))[_0x1786('0x46')](handleError(_0x1a1fc6,null));};exports[_0x1786('0x25')]=function(_0xbea2b3,_0x431849){if(_0xbea2b3[_0x1786('0x48')]['id']){delete _0xbea2b3['body']['id'];}return db[_0x1786('0x2e')]['find']({'where':{'id':_0xbea2b3[_0x1786('0x49')]['id']}})['then'](handleEntityNotFound(_0x431849,null))[_0x1786('0x26')](saveUpdates(_0xbea2b3['body'],null))[_0x1786('0x26')](respondWithResult(_0x431849,null))[_0x1786('0x46')](handleError(_0x431849,null));};exports['destroy']=function(_0x2e9928,_0x20e4a8){return db[_0x1786('0x2e')][_0x1786('0x4a')]({'where':{'id':_0x2e9928[_0x1786('0x49')]['id']}})[_0x1786('0x26')](handleEntityNotFound(_0x20e4a8,null))[_0x1786('0x26')](removeEntity(_0x20e4a8,null))[_0x1786('0x46')](handleError(_0x20e4a8,null));};exports['getFields']=function(_0x509748,_0x49d4bd,_0x159d8e){var _0x31cd06={};var _0x1e8971={};var _0x586a93;var _0x26bc94;return db[_0x1786('0x2e')][_0x1786('0x4b')]({'where':{'id':_0x509748[_0x1786('0x49')]['id']}})[_0x1786('0x26')](handleEntityNotFound(_0x49d4bd,null))['then'](function(_0x18850e){if(_0x18850e){_0x586a93=_0x18850e;_0x1e8971[_0x1786('0x34')]=_['keys'](db[_0x1786('0x4c')][_0x1786('0x44')]);_0x1e8971[_0x1786('0x31')]=_['keys'](_0x509748['query']);_0x1e8971[_0x1786('0x33')]=_[_0x1786('0x36')](_0x1e8971[_0x1786('0x34')],_0x1e8971[_0x1786('0x31')]);_0x31cd06['attributes']=_[_0x1786('0x36')](_0x1e8971['model'],qs['fields'](_0x509748['query'][_0x1786('0x37')]));_0x31cd06['attributes']=_0x31cd06[_0x1786('0x35')][_0x1786('0x38')]?_0x31cd06[_0x1786('0x35')]:_0x1e8971[_0x1786('0x34')];_0x31cd06['order']=qs[_0x1786('0x3c')](_0x509748[_0x1786('0x31')]['sort']);_0x31cd06[_0x1786('0x3e')]=qs['filters'](_[_0x1786('0x4d')](_0x509748[_0x1786('0x31')],_0x1e8971[_0x1786('0x33')]));if(_0x509748[_0x1786('0x31')][_0x1786('0x3d')]){_0x31cd06[_0x1786('0x3e')]=_['merge'](_0x31cd06[_0x1786('0x3e')],{'$or':_[_0x1786('0x2d')](_0x31cd06[_0x1786('0x35')],function(_0x294eb3){var _0x17daab={};_0x17daab[_0x294eb3]={'$like':'%'+_0x509748[_0x1786('0x31')]['filter']+'%'};return _0x17daab;})});}_0x31cd06=_[_0x1786('0x3f')]({},_0x31cd06,_0x509748[_0x1786('0x42')]);return _0x586a93[_0x1786('0x4e')](_0x31cd06);}})[_0x1786('0x26')](function(_0x509a58){if(_0x509a58){_0x26bc94=_0x509a58[_0x1786('0x38')];if(!_0x509748[_0x1786('0x31')][_0x1786('0x39')](_0x1786('0x3a'))){_0x31cd06[_0x1786('0x1e')]=qs[_0x1786('0x1e')](_0x509748[_0x1786('0x31')][_0x1786('0x1e')]);_0x31cd06[_0x1786('0x1f')]=qs[_0x1786('0x1f')](_0x509748[_0x1786('0x31')]['offset']);}return _0x586a93['getFields'](_0x31cd06);}})['then'](function(_0x273fae){if(_0x273fae){return _0x273fae?{'count':_0x26bc94,'rows':_0x273fae}:null;}})[_0x1786('0x26')](respondWithResult(_0x49d4bd,null))['catch'](handleError(_0x49d4bd,null));};exports[_0x1786('0x4f')]=function(_0x28f49f,_0x5e10de,_0x50d1df){var _0x21dcd7={};var _0x1fb1cc={};var _0x5c59fe;var _0x4c6653;return db['ZendeskConfiguration'][_0x1786('0x4b')]({'where':{'id':_0x28f49f['params']['id']}})[_0x1786('0x26')](handleEntityNotFound(_0x5e10de,null))['then'](function(_0x29ace0){if(_0x29ace0){_0x5c59fe=_0x29ace0;_0x1fb1cc[_0x1786('0x34')]=_[_0x1786('0x32')](db[_0x1786('0x4c')][_0x1786('0x44')]);_0x1fb1cc[_0x1786('0x31')]=_[_0x1786('0x32')](_0x28f49f[_0x1786('0x31')]);_0x1fb1cc[_0x1786('0x33')]=_[_0x1786('0x36')](_0x1fb1cc[_0x1786('0x34')],_0x1fb1cc[_0x1786('0x31')]);_0x21dcd7[_0x1786('0x35')]=_[_0x1786('0x36')](_0x1fb1cc[_0x1786('0x34')],qs['fields'](_0x28f49f[_0x1786('0x31')][_0x1786('0x37')]));_0x21dcd7['attributes']=_0x21dcd7['attributes'][_0x1786('0x38')]?_0x21dcd7[_0x1786('0x35')]:_0x1fb1cc[_0x1786('0x34')];_0x21dcd7[_0x1786('0x3b')]=qs[_0x1786('0x3c')](_0x28f49f[_0x1786('0x31')]['sort']);_0x21dcd7['where']=qs['filters'](_[_0x1786('0x4d')](_0x28f49f[_0x1786('0x31')],_0x1fb1cc['filters']));if(_0x28f49f[_0x1786('0x31')][_0x1786('0x3d')]){_0x21dcd7[_0x1786('0x3e')]=_[_0x1786('0x3f')](_0x21dcd7[_0x1786('0x3e')],{'$or':_[_0x1786('0x2d')](_0x21dcd7[_0x1786('0x35')],function(_0x4cfe9d){var _0x1a050a={};_0x1a050a[_0x4cfe9d]={'$like':'%'+_0x28f49f[_0x1786('0x31')][_0x1786('0x3d')]+'%'};return _0x1a050a;})});}_0x21dcd7=_[_0x1786('0x3f')]({},_0x21dcd7,_0x28f49f['options']);return _0x5c59fe[_0x1786('0x4f')](_0x21dcd7);}})['then'](function(_0x1d7b7f){if(_0x1d7b7f){_0x4c6653=_0x1d7b7f[_0x1786('0x38')];if(!_0x28f49f['query'][_0x1786('0x39')](_0x1786('0x3a'))){_0x21dcd7[_0x1786('0x1e')]=qs[_0x1786('0x1e')](_0x28f49f[_0x1786('0x31')]['limit']);_0x21dcd7['offset']=qs['offset'](_0x28f49f['query'][_0x1786('0x1f')]);}return _0x5c59fe['getSubjects'](_0x21dcd7);}})[_0x1786('0x26')](function(_0x510e88){if(_0x510e88){return _0x510e88?{'count':_0x4c6653,'rows':_0x510e88}:null;}})['then'](respondWithResult(_0x5e10de,null))[_0x1786('0x46')](handleError(_0x5e10de,null));};exports['getDescriptions']=function(_0x3c1f0b,_0x370e0d,_0x190e0b){var _0x3a21bc={};var _0x1915d9={};var _0x3e886b;var _0x28a5c8;return db[_0x1786('0x2e')]['findOne']({'where':{'id':_0x3c1f0b[_0x1786('0x49')]['id']}})[_0x1786('0x26')](handleEntityNotFound(_0x370e0d,null))[_0x1786('0x26')](function(_0xf29c52){if(_0xf29c52){_0x3e886b=_0xf29c52;_0x1915d9['model']=_[_0x1786('0x32')](db[_0x1786('0x4c')][_0x1786('0x44')]);_0x1915d9[_0x1786('0x31')]=_[_0x1786('0x32')](_0x3c1f0b['query']);_0x1915d9['filters']=_[_0x1786('0x36')](_0x1915d9['model'],_0x1915d9['query']);_0x3a21bc[_0x1786('0x35')]=_['intersection'](_0x1915d9[_0x1786('0x34')],qs[_0x1786('0x37')](_0x3c1f0b['query'][_0x1786('0x37')]));_0x3a21bc[_0x1786('0x35')]=_0x3a21bc[_0x1786('0x35')][_0x1786('0x38')]?_0x3a21bc[_0x1786('0x35')]:_0x1915d9[_0x1786('0x34')];_0x3a21bc['order']=qs[_0x1786('0x3c')](_0x3c1f0b[_0x1786('0x31')]['sort']);_0x3a21bc[_0x1786('0x3e')]=qs[_0x1786('0x33')](_['pick'](_0x3c1f0b[_0x1786('0x31')],_0x1915d9[_0x1786('0x33')]));if(_0x3c1f0b['query'][_0x1786('0x3d')]){_0x3a21bc[_0x1786('0x3e')]=_[_0x1786('0x3f')](_0x3a21bc['where'],{'$or':_[_0x1786('0x2d')](_0x3a21bc[_0x1786('0x35')],function(_0x11e760){var _0x1193c5={};_0x1193c5[_0x11e760]={'$like':'%'+_0x3c1f0b[_0x1786('0x31')]['filter']+'%'};return _0x1193c5;})});}_0x3a21bc=_[_0x1786('0x3f')]({},_0x3a21bc,_0x3c1f0b[_0x1786('0x42')]);return _0x3e886b[_0x1786('0x50')](_0x3a21bc);}})[_0x1786('0x26')](function(_0x50c67f){if(_0x50c67f){_0x28a5c8=_0x50c67f[_0x1786('0x38')];if(!_0x3c1f0b[_0x1786('0x31')]['hasOwnProperty'](_0x1786('0x3a'))){_0x3a21bc['limit']=qs[_0x1786('0x1e')](_0x3c1f0b['query']['limit']);_0x3a21bc[_0x1786('0x1f')]=qs[_0x1786('0x1f')](_0x3c1f0b[_0x1786('0x31')][_0x1786('0x1f')]);}return _0x3e886b[_0x1786('0x50')](_0x3a21bc);}})['then'](function(_0x5eada5){if(_0x5eada5){return _0x5eada5?{'count':_0x28a5c8,'rows':_0x5eada5}:null;}})[_0x1786('0x26')](respondWithResult(_0x370e0d,null))[_0x1786('0x46')](handleError(_0x370e0d,null));};exports[_0x1786('0x51')]=function(_0x38f53c,_0x23c388,_0x15e33a){var _0x3a2945={};var _0x4cb6d5={};var _0x4d463d;var _0x15ab31;return db['ZendeskConfiguration'][_0x1786('0x4b')]({'where':{'id':_0x38f53c['params']['id']}})['then'](handleEntityNotFound(_0x23c388,null))['then'](function(_0x49f67e){if(_0x49f67e){_0x4d463d=_0x49f67e;_0x4cb6d5[_0x1786('0x34')]=_[_0x1786('0x32')](db['Tag'][_0x1786('0x44')]);_0x4cb6d5[_0x1786('0x31')]=_[_0x1786('0x32')](_0x38f53c['query']);_0x4cb6d5['filters']=_[_0x1786('0x36')](_0x4cb6d5[_0x1786('0x34')],_0x4cb6d5['query']);_0x3a2945['attributes']=_[_0x1786('0x36')](_0x4cb6d5['model'],qs[_0x1786('0x37')](_0x38f53c[_0x1786('0x31')]['fields']));_0x3a2945[_0x1786('0x35')]=_0x3a2945[_0x1786('0x35')]['length']?_0x3a2945[_0x1786('0x35')]:_0x4cb6d5['model'];_0x3a2945[_0x1786('0x3b')]=qs[_0x1786('0x3c')](_0x38f53c['query'][_0x1786('0x3c')]);_0x3a2945['where']=qs['filters'](_[_0x1786('0x4d')](_0x38f53c[_0x1786('0x31')],_0x4cb6d5[_0x1786('0x33')]));if(_0x38f53c['query'][_0x1786('0x3d')]){_0x3a2945[_0x1786('0x3e')]=_[_0x1786('0x3f')](_0x3a2945['where'],{'$or':_['map'](_0x3a2945[_0x1786('0x35')],function(_0x2ca84b){var _0x2c6c37={};_0x2c6c37[_0x2ca84b]={'$like':'%'+_0x38f53c[_0x1786('0x31')]['filter']+'%'};return _0x2c6c37;})});}_0x3a2945=_['merge']({},_0x3a2945,_0x38f53c[_0x1786('0x42')]);return _0x4d463d[_0x1786('0x51')](_0x3a2945);}})[_0x1786('0x26')](function(_0x59ea41){if(_0x59ea41){_0x15ab31=_0x59ea41[_0x1786('0x38')];if(!_0x38f53c[_0x1786('0x31')][_0x1786('0x39')](_0x1786('0x3a'))){_0x3a2945['limit']=qs[_0x1786('0x1e')](_0x38f53c['query'][_0x1786('0x1e')]);_0x3a2945[_0x1786('0x1f')]=qs[_0x1786('0x1f')](_0x38f53c['query']['offset']);}return _0x4d463d[_0x1786('0x51')](_0x3a2945);}})['then'](function(_0x9ac6d2){if(_0x9ac6d2){return _0x9ac6d2?{'count':_0x15ab31,'rows':_0x9ac6d2}:null;}})[_0x1786('0x26')](respondWithResult(_0x23c388,null))[_0x1786('0x46')](handleError(_0x23c388,null));};exports['setTags']=function(_0x4e312c,_0x1bead2,_0x507e86){if(_0x4e312c[_0x1786('0x48')]['id']){delete _0x4e312c[_0x1786('0x48')]['id'];}return db[_0x1786('0x2e')][_0x1786('0x4b')]({'where':{'id':_0x4e312c[_0x1786('0x49')]['id']}})[_0x1786('0x26')](handleEntityNotFound(_0x1bead2,null))[_0x1786('0x26')](function(_0x5a7636){if(_0x5a7636){return _0x5a7636['setTags'](_0x4e312c[_0x1786('0x48')][_0x1786('0x52')]||[]);}return null;})[_0x1786('0x26')](respondWithResult(_0x1bead2,null))[_0x1786('0x46')](handleError(_0x1bead2,null));}; \ No newline at end of file +var _0x2fa9=['type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','fields','options','find','create','body','params','destroy','getFields','findOne','nolimit','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','update','then','name','send','index','map','ZendeskConfiguration','rawAttributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2fa9,0x1ee));var _0x92fa=function(_0x81250f,_0x68727d){_0x81250f=_0x81250f-0x0;var _0x53ec19=_0x2fa9[_0x81250f];return _0x53ec19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x92fa('0x0'));var zipdir=require(_0x92fa('0x1'));var jsonpatch=require(_0x92fa('0x2'));var rp=require(_0x92fa('0x3'));var moment=require(_0x92fa('0x4'));var BPromise=require(_0x92fa('0x5'));var Mustache=require(_0x92fa('0x6'));var util=require('util');var path=require(_0x92fa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x92fa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x92fa('0x9'));var squel=require(_0x92fa('0xa'));var crypto=require(_0x92fa('0xb'));var jsforce=require(_0x92fa('0xc'));var deskjs=require(_0x92fa('0xd'));var toCsv=require(_0x92fa('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x92fa('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x92fa('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x92fa('0x11'));var logger=require('../../config/logger')(_0x92fa('0x12'));var utils=require(_0x92fa('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x92fa('0x14'))['db'];function respondWithStatusCode(_0xdf1d4b,_0x37f9dd){_0x37f9dd=_0x37f9dd||0xcc;return function(_0x5ccaaf){if(_0x5ccaaf){return _0xdf1d4b[_0x92fa('0x15')](_0x37f9dd);}return _0xdf1d4b[_0x92fa('0x16')](_0x37f9dd)[_0x92fa('0x17')]();};}function respondWithResult(_0x135398,_0x59203e){_0x59203e=_0x59203e||0xc8;return function(_0x154cfa){if(_0x154cfa){return _0x135398[_0x92fa('0x16')](_0x59203e)['json'](_0x154cfa);}};}function respondWithFilteredResult(_0x448172,_0x5b46c9){return function(_0x3bbae3){if(_0x3bbae3){var _0x204ee4=typeof _0x5b46c9[_0x92fa('0x18')]===_0x92fa('0x19')&&typeof _0x5b46c9[_0x92fa('0x1a')]===_0x92fa('0x19');var _0x5420a2=_0x3bbae3[_0x92fa('0x1b')];var _0x2aebbf=_0x204ee4?0x0:_0x5b46c9[_0x92fa('0x18')];var _0x3932c6=_0x204ee4?_0x3bbae3[_0x92fa('0x1b')]:_0x5b46c9[_0x92fa('0x18')]+_0x5b46c9['limit'];var _0x508f24;if(_0x3932c6>=_0x5420a2){_0x3932c6=_0x5420a2;_0x508f24=0xc8;}else{_0x508f24=0xce;}_0x448172[_0x92fa('0x16')](_0x508f24);return _0x448172[_0x92fa('0x1c')](_0x92fa('0x1d'),_0x2aebbf+'-'+_0x3932c6+'/'+_0x5420a2)['json'](_0x3bbae3);}return null;};}function patchUpdates(_0x43e2c0){return function(_0x2ec14b){try{jsonpatch['apply'](_0x2ec14b,_0x43e2c0,!![]);}catch(_0x4a716d){return BPromise['reject'](_0x4a716d);}return _0x2ec14b['save']();};}function saveUpdates(_0xc8a9d4,_0x642229){return function(_0x4cd86e){if(_0x4cd86e){return _0x4cd86e[_0x92fa('0x1e')](_0xc8a9d4)[_0x92fa('0x1f')](function(_0x2e42e6){return _0x2e42e6;});}return null;};}function removeEntity(_0x446b63,_0x2893f7){return function(_0xd60088){if(_0xd60088){return _0xd60088['destroy']()[_0x92fa('0x1f')](function(){_0x446b63[_0x92fa('0x16')](0xcc)[_0x92fa('0x17')]();});}};}function handleEntityNotFound(_0x28bbe0,_0xcba3bc){return function(_0x49774c){if(!_0x49774c){_0x28bbe0[_0x92fa('0x15')](0x194);}return _0x49774c;};}function handleError(_0x5f2050,_0x5d90e5){_0x5d90e5=_0x5d90e5||0x1f4;return function(_0x46384d){logger['error'](_0x46384d['stack']);if(_0x46384d[_0x92fa('0x20')]){delete _0x46384d['name'];}_0x5f2050[_0x92fa('0x16')](_0x5d90e5)[_0x92fa('0x21')](_0x46384d);};}exports[_0x92fa('0x22')]=function(_0x3abeff,_0x13e03b){var _0x1f3086={},_0x1403cc={},_0x170b1f={'count':0x0,'rows':[]};var _0xd3b1da=_[_0x92fa('0x23')](db[_0x92fa('0x24')][_0x92fa('0x25')],function(_0x2bfebb){return{'name':_0x2bfebb['fieldName'],'type':_0x2bfebb[_0x92fa('0x26')][_0x92fa('0x27')]};});_0x1403cc['model']=_[_0x92fa('0x23')](_0xd3b1da,_0x92fa('0x20'));_0x1403cc[_0x92fa('0x28')]=_[_0x92fa('0x29')](_0x3abeff[_0x92fa('0x28')]);_0x1403cc[_0x92fa('0x2a')]=_[_0x92fa('0x2b')](_0x1403cc[_0x92fa('0x2c')],_0x1403cc['query']);_0x1f3086[_0x92fa('0x2d')]=_['intersection'](_0x1403cc[_0x92fa('0x2c')],qs['fields'](_0x3abeff[_0x92fa('0x28')]['fields']));_0x1f3086[_0x92fa('0x2d')]=_0x1f3086['attributes'][_0x92fa('0x2e')]?_0x1f3086[_0x92fa('0x2d')]:_0x1403cc[_0x92fa('0x2c')];if(!_0x3abeff[_0x92fa('0x28')][_0x92fa('0x2f')]('nolimit')){_0x1f3086[_0x92fa('0x1a')]=qs['limit'](_0x3abeff['query']['limit']);_0x1f3086[_0x92fa('0x18')]=qs[_0x92fa('0x18')](_0x3abeff[_0x92fa('0x28')][_0x92fa('0x18')]);}_0x1f3086[_0x92fa('0x30')]=qs['sort'](_0x3abeff['query'][_0x92fa('0x31')]);_0x1f3086[_0x92fa('0x32')]=qs['filters'](_[_0x92fa('0x33')](_0x3abeff['query'],_0x1403cc[_0x92fa('0x2a')]),_0xd3b1da);if(_0x3abeff[_0x92fa('0x28')][_0x92fa('0x34')]){_0x1f3086[_0x92fa('0x32')]=_[_0x92fa('0x35')](_0x1f3086[_0x92fa('0x32')],{'$or':_['map'](_0xd3b1da,function(_0x484023){if(_0x484023[_0x92fa('0x26')]!==_0x92fa('0x36')){var _0x561376={};_0x561376[_0x484023[_0x92fa('0x20')]]={'$like':'%'+_0x3abeff['query'][_0x92fa('0x34')]+'%'};return _0x561376;}})});}_0x1f3086=_['merge']({},_0x1f3086,_0x3abeff['options']);var _0x3e844e={'where':_0x1f3086['where']};return db[_0x92fa('0x24')][_0x92fa('0x1b')](_0x3e844e)[_0x92fa('0x1f')](function(_0x15458e){_0x170b1f[_0x92fa('0x1b')]=_0x15458e;if(_0x3abeff[_0x92fa('0x28')][_0x92fa('0x37')]){_0x1f3086[_0x92fa('0x38')]=[{'all':!![]}];}return db[_0x92fa('0x24')][_0x92fa('0x39')](_0x1f3086);})[_0x92fa('0x1f')](function(_0x2f9fce){_0x170b1f['rows']=_0x2f9fce;return _0x170b1f;})['then'](respondWithFilteredResult(_0x13e03b,_0x1f3086))[_0x92fa('0x3a')](handleError(_0x13e03b,null));};exports[_0x92fa('0x3b')]=function(_0x46eba9,_0x2542be){var _0x4f52cc={'raw':![],'where':{'id':_0x46eba9['params']['id']}},_0x46bb23={};_0x46bb23[_0x92fa('0x2c')]=_[_0x92fa('0x29')](db[_0x92fa('0x24')]['rawAttributes']);_0x46bb23[_0x92fa('0x28')]=_['keys'](_0x46eba9[_0x92fa('0x28')]);_0x46bb23[_0x92fa('0x2a')]=_[_0x92fa('0x2b')](_0x46bb23[_0x92fa('0x2c')],_0x46bb23[_0x92fa('0x28')]);_0x4f52cc[_0x92fa('0x2d')]=_['intersection'](_0x46bb23[_0x92fa('0x2c')],qs[_0x92fa('0x3c')](_0x46eba9[_0x92fa('0x28')][_0x92fa('0x3c')]));_0x4f52cc[_0x92fa('0x2d')]=_0x4f52cc[_0x92fa('0x2d')][_0x92fa('0x2e')]?_0x4f52cc[_0x92fa('0x2d')]:_0x46bb23['model'];if(_0x46eba9[_0x92fa('0x28')][_0x92fa('0x37')]){_0x4f52cc[_0x92fa('0x38')]=[{'all':!![]}];}_0x4f52cc=_[_0x92fa('0x35')]({},_0x4f52cc,_0x46eba9[_0x92fa('0x3d')]);return db[_0x92fa('0x24')][_0x92fa('0x3e')](_0x4f52cc)[_0x92fa('0x1f')](handleEntityNotFound(_0x2542be,null))[_0x92fa('0x1f')](respondWithResult(_0x2542be,null))[_0x92fa('0x3a')](handleError(_0x2542be,null));};exports[_0x92fa('0x3f')]=function(_0x3429f7,_0x45ce54){return db[_0x92fa('0x24')][_0x92fa('0x3f')](_0x3429f7[_0x92fa('0x40')],{})[_0x92fa('0x1f')](respondWithResult(_0x45ce54,0xc9))[_0x92fa('0x3a')](handleError(_0x45ce54,null));};exports[_0x92fa('0x1e')]=function(_0x56385f,_0x46ee06){if(_0x56385f['body']['id']){delete _0x56385f[_0x92fa('0x40')]['id'];}return db[_0x92fa('0x24')][_0x92fa('0x3e')]({'where':{'id':_0x56385f[_0x92fa('0x41')]['id']}})[_0x92fa('0x1f')](handleEntityNotFound(_0x46ee06,null))['then'](saveUpdates(_0x56385f['body'],null))[_0x92fa('0x1f')](respondWithResult(_0x46ee06,null))['catch'](handleError(_0x46ee06,null));};exports[_0x92fa('0x42')]=function(_0x51d56e,_0x109441){return db[_0x92fa('0x24')][_0x92fa('0x3e')]({'where':{'id':_0x51d56e['params']['id']}})[_0x92fa('0x1f')](handleEntityNotFound(_0x109441,null))[_0x92fa('0x1f')](removeEntity(_0x109441,null))['catch'](handleError(_0x109441,null));};exports[_0x92fa('0x43')]=function(_0x37544c,_0x2a08b4,_0x3cd46c){var _0x2b2923={};var _0x16a172={};var _0x51f532;var _0x428b98;return db[_0x92fa('0x24')][_0x92fa('0x44')]({'where':{'id':_0x37544c[_0x92fa('0x41')]['id']}})[_0x92fa('0x1f')](handleEntityNotFound(_0x2a08b4,null))[_0x92fa('0x1f')](function(_0x2ae3a2){if(_0x2ae3a2){_0x51f532=_0x2ae3a2;_0x16a172[_0x92fa('0x2c')]=_[_0x92fa('0x29')](db['ZendeskField']['rawAttributes']);_0x16a172[_0x92fa('0x28')]=_[_0x92fa('0x29')](_0x37544c['query']);_0x16a172[_0x92fa('0x2a')]=_[_0x92fa('0x2b')](_0x16a172[_0x92fa('0x2c')],_0x16a172[_0x92fa('0x28')]);_0x2b2923[_0x92fa('0x2d')]=_['intersection'](_0x16a172[_0x92fa('0x2c')],qs['fields'](_0x37544c[_0x92fa('0x28')]['fields']));_0x2b2923['attributes']=_0x2b2923['attributes'][_0x92fa('0x2e')]?_0x2b2923['attributes']:_0x16a172[_0x92fa('0x2c')];_0x2b2923['order']=qs[_0x92fa('0x31')](_0x37544c['query'][_0x92fa('0x31')]);_0x2b2923['where']=qs[_0x92fa('0x2a')](_[_0x92fa('0x33')](_0x37544c[_0x92fa('0x28')],_0x16a172[_0x92fa('0x2a')]));if(_0x37544c[_0x92fa('0x28')]['filter']){_0x2b2923[_0x92fa('0x32')]=_[_0x92fa('0x35')](_0x2b2923[_0x92fa('0x32')],{'$or':_['map'](_0x2b2923['attributes'],function(_0x2e5b75){var _0x551b82={};_0x551b82[_0x2e5b75]={'$like':'%'+_0x37544c['query']['filter']+'%'};return _0x551b82;})});}_0x2b2923=_[_0x92fa('0x35')]({},_0x2b2923,_0x37544c[_0x92fa('0x3d')]);return _0x51f532[_0x92fa('0x43')](_0x2b2923);}})[_0x92fa('0x1f')](function(_0x3c722){if(_0x3c722){_0x428b98=_0x3c722[_0x92fa('0x2e')];if(!_0x37544c[_0x92fa('0x28')][_0x92fa('0x2f')](_0x92fa('0x45'))){_0x2b2923['limit']=qs[_0x92fa('0x1a')](_0x37544c[_0x92fa('0x28')][_0x92fa('0x1a')]);_0x2b2923[_0x92fa('0x18')]=qs[_0x92fa('0x18')](_0x37544c[_0x92fa('0x28')]['offset']);}return _0x51f532[_0x92fa('0x43')](_0x2b2923);}})[_0x92fa('0x1f')](function(_0x2b0166){if(_0x2b0166){return _0x2b0166?{'count':_0x428b98,'rows':_0x2b0166}:null;}})[_0x92fa('0x1f')](respondWithResult(_0x2a08b4,null))[_0x92fa('0x3a')](handleError(_0x2a08b4,null));};exports[_0x92fa('0x46')]=function(_0x18d184,_0x366c24,_0x4e7dab){var _0x49ed52={};var _0xa45965={};var _0x25b350;var _0x5a843f;return db['ZendeskConfiguration'][_0x92fa('0x44')]({'where':{'id':_0x18d184[_0x92fa('0x41')]['id']}})['then'](handleEntityNotFound(_0x366c24,null))[_0x92fa('0x1f')](function(_0xaed28c){if(_0xaed28c){_0x25b350=_0xaed28c;_0xa45965[_0x92fa('0x2c')]=_[_0x92fa('0x29')](db[_0x92fa('0x47')][_0x92fa('0x25')]);_0xa45965[_0x92fa('0x28')]=_[_0x92fa('0x29')](_0x18d184[_0x92fa('0x28')]);_0xa45965['filters']=_['intersection'](_0xa45965[_0x92fa('0x2c')],_0xa45965[_0x92fa('0x28')]);_0x49ed52['attributes']=_[_0x92fa('0x2b')](_0xa45965['model'],qs['fields'](_0x18d184[_0x92fa('0x28')][_0x92fa('0x3c')]));_0x49ed52[_0x92fa('0x2d')]=_0x49ed52[_0x92fa('0x2d')][_0x92fa('0x2e')]?_0x49ed52[_0x92fa('0x2d')]:_0xa45965[_0x92fa('0x2c')];_0x49ed52[_0x92fa('0x30')]=qs[_0x92fa('0x31')](_0x18d184[_0x92fa('0x28')][_0x92fa('0x31')]);_0x49ed52['where']=qs[_0x92fa('0x2a')](_[_0x92fa('0x33')](_0x18d184['query'],_0xa45965[_0x92fa('0x2a')]));if(_0x18d184[_0x92fa('0x28')][_0x92fa('0x34')]){_0x49ed52[_0x92fa('0x32')]=_['merge'](_0x49ed52[_0x92fa('0x32')],{'$or':_[_0x92fa('0x23')](_0x49ed52[_0x92fa('0x2d')],function(_0x496228){var _0x353fa7={};_0x353fa7[_0x496228]={'$like':'%'+_0x18d184[_0x92fa('0x28')][_0x92fa('0x34')]+'%'};return _0x353fa7;})});}_0x49ed52=_[_0x92fa('0x35')]({},_0x49ed52,_0x18d184[_0x92fa('0x3d')]);return _0x25b350[_0x92fa('0x46')](_0x49ed52);}})[_0x92fa('0x1f')](function(_0x4535ba){if(_0x4535ba){_0x5a843f=_0x4535ba[_0x92fa('0x2e')];if(!_0x18d184[_0x92fa('0x28')][_0x92fa('0x2f')](_0x92fa('0x45'))){_0x49ed52['limit']=qs[_0x92fa('0x1a')](_0x18d184[_0x92fa('0x28')]['limit']);_0x49ed52[_0x92fa('0x18')]=qs[_0x92fa('0x18')](_0x18d184[_0x92fa('0x28')][_0x92fa('0x18')]);}return _0x25b350[_0x92fa('0x46')](_0x49ed52);}})[_0x92fa('0x1f')](function(_0x2cfcd0){if(_0x2cfcd0){return _0x2cfcd0?{'count':_0x5a843f,'rows':_0x2cfcd0}:null;}})[_0x92fa('0x1f')](respondWithResult(_0x366c24,null))[_0x92fa('0x3a')](handleError(_0x366c24,null));};exports[_0x92fa('0x48')]=function(_0x38e427,_0x143239,_0x181bb3){var _0x45d0d2={};var _0x24a0fc={};var _0x16e80a;var _0x2521be;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x38e427[_0x92fa('0x41')]['id']}})['then'](handleEntityNotFound(_0x143239,null))['then'](function(_0x19d0a0){if(_0x19d0a0){_0x16e80a=_0x19d0a0;_0x24a0fc[_0x92fa('0x2c')]=_[_0x92fa('0x29')](db[_0x92fa('0x47')][_0x92fa('0x25')]);_0x24a0fc[_0x92fa('0x28')]=_[_0x92fa('0x29')](_0x38e427[_0x92fa('0x28')]);_0x24a0fc[_0x92fa('0x2a')]=_[_0x92fa('0x2b')](_0x24a0fc[_0x92fa('0x2c')],_0x24a0fc[_0x92fa('0x28')]);_0x45d0d2[_0x92fa('0x2d')]=_[_0x92fa('0x2b')](_0x24a0fc[_0x92fa('0x2c')],qs[_0x92fa('0x3c')](_0x38e427[_0x92fa('0x28')][_0x92fa('0x3c')]));_0x45d0d2[_0x92fa('0x2d')]=_0x45d0d2[_0x92fa('0x2d')][_0x92fa('0x2e')]?_0x45d0d2[_0x92fa('0x2d')]:_0x24a0fc['model'];_0x45d0d2['order']=qs['sort'](_0x38e427[_0x92fa('0x28')][_0x92fa('0x31')]);_0x45d0d2['where']=qs['filters'](_[_0x92fa('0x33')](_0x38e427[_0x92fa('0x28')],_0x24a0fc[_0x92fa('0x2a')]));if(_0x38e427[_0x92fa('0x28')][_0x92fa('0x34')]){_0x45d0d2['where']=_[_0x92fa('0x35')](_0x45d0d2[_0x92fa('0x32')],{'$or':_[_0x92fa('0x23')](_0x45d0d2['attributes'],function(_0x2123d8){var _0x5d9d70={};_0x5d9d70[_0x2123d8]={'$like':'%'+_0x38e427[_0x92fa('0x28')][_0x92fa('0x34')]+'%'};return _0x5d9d70;})});}_0x45d0d2=_[_0x92fa('0x35')]({},_0x45d0d2,_0x38e427['options']);return _0x16e80a['getDescriptions'](_0x45d0d2);}})['then'](function(_0x163c46){if(_0x163c46){_0x2521be=_0x163c46[_0x92fa('0x2e')];if(!_0x38e427[_0x92fa('0x28')][_0x92fa('0x2f')]('nolimit')){_0x45d0d2[_0x92fa('0x1a')]=qs['limit'](_0x38e427[_0x92fa('0x28')][_0x92fa('0x1a')]);_0x45d0d2['offset']=qs['offset'](_0x38e427[_0x92fa('0x28')]['offset']);}return _0x16e80a[_0x92fa('0x48')](_0x45d0d2);}})[_0x92fa('0x1f')](function(_0x4bf62b){if(_0x4bf62b){return _0x4bf62b?{'count':_0x2521be,'rows':_0x4bf62b}:null;}})[_0x92fa('0x1f')](respondWithResult(_0x143239,null))[_0x92fa('0x3a')](handleError(_0x143239,null));};exports[_0x92fa('0x49')]=function(_0x1423ea,_0x3d77e3,_0x12f1dd){var _0x23147f={};var _0x29acaa={};var _0x2b942e;var _0x429973;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x1423ea[_0x92fa('0x41')]['id']}})[_0x92fa('0x1f')](handleEntityNotFound(_0x3d77e3,null))['then'](function(_0xe30c9a){if(_0xe30c9a){_0x2b942e=_0xe30c9a;_0x29acaa[_0x92fa('0x2c')]=_[_0x92fa('0x29')](db[_0x92fa('0x4a')]['rawAttributes']);_0x29acaa[_0x92fa('0x28')]=_[_0x92fa('0x29')](_0x1423ea[_0x92fa('0x28')]);_0x29acaa['filters']=_[_0x92fa('0x2b')](_0x29acaa['model'],_0x29acaa[_0x92fa('0x28')]);_0x23147f[_0x92fa('0x2d')]=_['intersection'](_0x29acaa['model'],qs[_0x92fa('0x3c')](_0x1423ea[_0x92fa('0x28')][_0x92fa('0x3c')]));_0x23147f[_0x92fa('0x2d')]=_0x23147f[_0x92fa('0x2d')][_0x92fa('0x2e')]?_0x23147f[_0x92fa('0x2d')]:_0x29acaa[_0x92fa('0x2c')];_0x23147f[_0x92fa('0x30')]=qs[_0x92fa('0x31')](_0x1423ea[_0x92fa('0x28')]['sort']);_0x23147f[_0x92fa('0x32')]=qs[_0x92fa('0x2a')](_[_0x92fa('0x33')](_0x1423ea['query'],_0x29acaa[_0x92fa('0x2a')]));if(_0x1423ea[_0x92fa('0x28')][_0x92fa('0x34')]){_0x23147f[_0x92fa('0x32')]=_[_0x92fa('0x35')](_0x23147f[_0x92fa('0x32')],{'$or':_['map'](_0x23147f['attributes'],function(_0x5b4f3d){var _0x3b5c7a={};_0x3b5c7a[_0x5b4f3d]={'$like':'%'+_0x1423ea[_0x92fa('0x28')][_0x92fa('0x34')]+'%'};return _0x3b5c7a;})});}_0x23147f=_['merge']({},_0x23147f,_0x1423ea[_0x92fa('0x3d')]);return _0x2b942e['getTags'](_0x23147f);}})[_0x92fa('0x1f')](function(_0x34eae3){if(_0x34eae3){_0x429973=_0x34eae3['length'];if(!_0x1423ea['query'][_0x92fa('0x2f')](_0x92fa('0x45'))){_0x23147f[_0x92fa('0x1a')]=qs['limit'](_0x1423ea[_0x92fa('0x28')][_0x92fa('0x1a')]);_0x23147f[_0x92fa('0x18')]=qs[_0x92fa('0x18')](_0x1423ea['query'][_0x92fa('0x18')]);}return _0x2b942e[_0x92fa('0x49')](_0x23147f);}})[_0x92fa('0x1f')](function(_0x483a38){if(_0x483a38){return _0x483a38?{'count':_0x429973,'rows':_0x483a38}:null;}})[_0x92fa('0x1f')](respondWithResult(_0x3d77e3,null))[_0x92fa('0x3a')](handleError(_0x3d77e3,null));};exports[_0x92fa('0x4b')]=function(_0xcce999,_0x237c0e,_0x3f7d86){if(_0xcce999[_0x92fa('0x40')]['id']){delete _0xcce999[_0x92fa('0x40')]['id'];}return db[_0x92fa('0x24')]['findOne']({'where':{'id':_0xcce999[_0x92fa('0x41')]['id']}})[_0x92fa('0x1f')](handleEntityNotFound(_0x237c0e,null))[_0x92fa('0x1f')](function(_0x2a7a07){if(_0x2a7a07){return _0x2a7a07[_0x92fa('0x4b')](_0xcce999[_0x92fa('0x40')]['ids']||[]);}return null;})[_0x92fa('0x1f')](respondWithResult(_0x237c0e,null))[_0x92fa('0x3a')](handleError(_0x237c0e,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 2f71309..26a197c 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 _0x7d25=['api','moment','bluebird','request-promise','path','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger'];(function(_0x13216b,_0x3a99b1){var _0xa27b54=function(_0x4adcfb){while(--_0x4adcfb){_0x13216b['push'](_0x13216b['shift']());}};_0xa27b54(++_0x3a99b1);}(_0x7d25,0x8a));var _0x57d2=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x7d25[_0x49b207];return _0x2dc8fa;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var logger=require(_0x57d2('0x1'))(_0x57d2('0x2'));var moment=require(_0x57d2('0x3'));var BPromise=require(_0x57d2('0x4'));var rp=require(_0x57d2('0x5'));var fs=require('fs');var path=require(_0x57d2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x3c5511,_0x49cc5f){return _0x3c5511[_0x57d2('0x7')](_0x57d2('0x8'),attributes,{'tableName':_0x57d2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8952=['exports','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x40d4b4,_0xecfa1d){var _0x3c6271=function(_0x36ab4f){while(--_0x36ab4f){_0x40d4b4['push'](_0x40d4b4['shift']());}};_0x3c6271(++_0xecfa1d);}(_0x8952,0x17e));var _0x2895=function(_0x152d44,_0x5d7684){_0x152d44=_0x152d44-0x0;var _0x3bef24=_0x8952[_0x152d44];return _0x3bef24;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var logger=require(_0x2895('0x1'))(_0x2895('0x2'));var moment=require(_0x2895('0x3'));var BPromise=require(_0x2895('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2895('0x5'));var rimraf=require(_0x2895('0x6'));var config=require(_0x2895('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x2895('0x8')]=function(_0x73c245,_0x37305b){return _0x73c245['define']('ZendeskConfiguration',attributes,{'tableName':_0x2895('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 0b327d6..00d9e5c 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 _0xc7df=['error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xc7df,0x1ce));var _0xfc7d=function(_0x53bd3f,_0x46a075){_0x53bd3f=_0x53bd3f-0x0;var _0x32e982=_0xc7df[_0x53bd3f];return _0x32e982;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfc7d('0x0'));var BPromise=require(_0xfc7d('0x1'));var rs=require(_0xfc7d('0x2'));var fs=require('fs');var Redis=require(_0xfc7d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc7d('0x4'));var logger=require('../../config/logger')(_0xfc7d('0x5'));var config=require(_0xfc7d('0x6'));var jayson=require(_0xfc7d('0x7'));var client=jayson[_0xfc7d('0x8')][_0xfc7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55a5bd,_0x5d40e6,_0x2bad95){return new BPromise(function(_0x12da39,_0x3300c1){return client['request'](_0x55a5bd,_0x2bad95)['then'](function(_0x1cac5f){logger[_0xfc7d('0xa')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5d40e6,_0xfc7d('0xb'));logger[_0xfc7d('0xc')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5d40e6,_0xfc7d('0xb'),JSON['stringify'](_0x1cac5f));if(_0x1cac5f[_0xfc7d('0xd')]){if(_0x1cac5f[_0xfc7d('0xd')][_0xfc7d('0xe')]===0x1f4){logger[_0xfc7d('0xd')](_0xfc7d('0xf'),_0x5d40e6,_0x1cac5f['error'][_0xfc7d('0x10')]);return _0x3300c1(_0x1cac5f[_0xfc7d('0xd')][_0xfc7d('0x10')]);}logger[_0xfc7d('0xd')](_0xfc7d('0xf'),_0x5d40e6,_0x1cac5f['error'][_0xfc7d('0x10')]);return _0x12da39(_0x1cac5f[_0xfc7d('0xd')][_0xfc7d('0x10')]);}else{logger['info'](_0xfc7d('0xf'),_0x5d40e6,'request\x20sent');_0x12da39(_0x1cac5f[_0xfc7d('0x11')][_0xfc7d('0x10')]);}})[_0xfc7d('0x12')](function(_0x3fea0c){logger[_0xfc7d('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5d40e6,_0x3fea0c);_0x3300c1(_0x3fea0c);});});} \ No newline at end of file +var _0xe01a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x161917,_0x496ce4){var _0x197210=function(_0x46f6ec){while(--_0x46f6ec){_0x161917['push'](_0x161917['shift']());}};_0x197210(++_0x496ce4);}(_0xe01a,0xfa));var _0xae01=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe01a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xae01('0x0'));var util=require(_0xae01('0x1'));var moment=require(_0xae01('0x2'));var BPromise=require(_0xae01('0x3'));var rs=require(_0xae01('0x4'));var fs=require('fs');var Redis=require(_0xae01('0x5'));var db=require(_0xae01('0x6'))['db'];var utils=require(_0xae01('0x7'));var logger=require(_0xae01('0x8'))('rpc');var config=require(_0xae01('0x9'));var jayson=require(_0xae01('0xa'));var client=jayson[_0xae01('0xb')][_0xae01('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1865ea,_0xd4259d,_0x5c97b9){return new BPromise(function(_0x3c189e,_0x4e22a8){return client['request'](_0x1865ea,_0x5c97b9)['then'](function(_0x295110){logger[_0xae01('0xd')](_0xae01('0xe'),_0xd4259d,_0xae01('0xf'));logger[_0xae01('0x10')](_0xae01('0x11'),_0xd4259d,_0xae01('0xf'),JSON['stringify'](_0x295110));if(_0x295110[_0xae01('0x12')]){if(_0x295110['error'][_0xae01('0x13')]===0x1f4){logger['error'](_0xae01('0xe'),_0xd4259d,_0x295110[_0xae01('0x12')]['message']);return _0x4e22a8(_0x295110[_0xae01('0x12')]['message']);}logger['error'](_0xae01('0xe'),_0xd4259d,_0x295110[_0xae01('0x12')][_0xae01('0x14')]);return _0x3c189e(_0x295110['error']['message']);}else{logger[_0xae01('0xd')](_0xae01('0xe'),_0xd4259d,_0xae01('0xf'));_0x3c189e(_0x295110[_0xae01('0x15')]['message']);}})[_0xae01('0x16')](function(_0xba20de){logger[_0xae01('0x12')](_0xae01('0xe'),_0xd4259d,_0xba20de);_0x4e22a8(_0xba20de);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index a4a0bcb..85ffc18 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 _0x00bb=['destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0xdb5439,_0x3dab27){var _0x2bcb33=function(_0x542b45){while(--_0x542b45){_0xdb5439['push'](_0xdb5439['shift']());}};_0x2bcb33(++_0x3dab27);}(_0x00bb,0xb6));var _0xb00b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x00bb[_0x433a86];return _0x23000c;};'use strict';var multer=require('multer');var util=require(_0xb00b('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb00b('0x1'));var router=express[_0xb00b('0x2')]();var fs_extra=require(_0xb00b('0x3'));var auth=require(_0xb00b('0x4'));var interaction=require(_0xb00b('0x5'));var config=require('../../config/environment');var controller=require(_0xb00b('0x6'));router[_0xb00b('0x7')]('/',auth[_0xb00b('0x8')](),controller[_0xb00b('0x9')]);router[_0xb00b('0x7')](_0xb00b('0xa'),auth['isAuthenticated'](),controller[_0xb00b('0xb')]);router[_0xb00b('0xc')]('/',auth[_0xb00b('0x8')](),controller[_0xb00b('0xd')]);router[_0xb00b('0xe')](_0xb00b('0xa'),auth[_0xb00b('0x8')](),controller[_0xb00b('0xf')]);router['delete'](_0xb00b('0xa'),auth[_0xb00b('0x8')](),controller[_0xb00b('0x10')]);module[_0xb00b('0x11')]=router; \ No newline at end of file +var _0x4f01=['util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2a44ca,_0x4b4d73){var _0x4f3122=function(_0x232f36){while(--_0x232f36){_0x2a44ca['push'](_0x2a44ca['shift']());}};_0x4f3122(++_0x4b4d73);}(_0x4f01,0x1cb));var _0x14f0=function(_0x3a8f17,_0x2539d0){_0x3a8f17=_0x3a8f17-0x0;var _0x501bbd=_0x4f01[_0x3a8f17];return _0x501bbd;};'use strict';var multer=require('multer');var util=require(_0x14f0('0x0'));var path=require('path');var timeout=require(_0x14f0('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x14f0('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x14f0('0x3'));var config=require(_0x14f0('0x4'));var controller=require('./intZendeskField.controller');router[_0x14f0('0x5')]('/',auth[_0x14f0('0x6')](),controller[_0x14f0('0x7')]);router['get'](_0x14f0('0x8'),auth[_0x14f0('0x6')](),controller[_0x14f0('0x9')]);router[_0x14f0('0xa')]('/',auth[_0x14f0('0x6')](),controller[_0x14f0('0xb')]);router[_0x14f0('0xc')](_0x14f0('0x8'),auth['isAuthenticated'](),controller[_0x14f0('0xd')]);router[_0x14f0('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x14f0('0xf')]);module[_0x14f0('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index d677a94..75a9a17 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 _0xc723=['customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xc723,0x1d8));var _0x3c72=function(_0xf13ca6,_0x5735ea){_0xf13ca6=_0xf13ca6-0x0;var _0x4a4387=_0xc723[_0xf13ca6];return _0x4a4387;};'use strict';var Sequelize=require(_0x3c72('0x0'));module[_0x3c72('0x1')]={'type':{'type':Sequelize[_0x3c72('0x2')](_0x3c72('0x3'),_0x3c72('0x4'),_0x3c72('0x5'),_0x3c72('0x6'),_0x3c72('0x7')),'defaultValue':_0x3c72('0x3')},'content':{'type':Sequelize[_0x3c72('0x8')]},'key':{'type':Sequelize[_0x3c72('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x3c72('0x3'),_0x3c72('0x4'),_0x3c72('0x5'))},'keyContent':{'type':Sequelize[_0x3c72('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3c72('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3c72('0x8')]}}; \ No newline at end of file +var _0x75ed=['picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue'];(function(_0x14635e,_0x2e764d){var _0x127db4=function(_0x22d8ce){while(--_0x22d8ce){_0x14635e['push'](_0x14635e['shift']());}};_0x127db4(++_0x2e764d);}(_0x75ed,0x1b3));var _0xd75e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x75ed[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xd75e('0x0'));module['exports']={'type':{'type':Sequelize[_0xd75e('0x1')](_0xd75e('0x2'),_0xd75e('0x3'),_0xd75e('0x4'),_0xd75e('0x5'),_0xd75e('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd75e('0x7')]},'keyType':{'type':Sequelize[_0xd75e('0x1')](_0xd75e('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xd75e('0x7')]},'idField':{'type':Sequelize[_0xd75e('0x7')]},'nameField':{'type':Sequelize[_0xd75e('0x7')]},'customField':{'type':Sequelize[_0xd75e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd75e('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index bf09bb8..9188d93 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 _0xd8eb=['key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','merge','map','VIRTUAL','options','ZendeskField','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type'];(function(_0xd95981,_0x234f3c){var _0x3d8b8b=function(_0x424014){while(--_0x424014){_0xd95981['push'](_0xd95981['shift']());}};_0x3d8b8b(++_0x234f3c);}(_0xd8eb,0x66));var _0xbd8e=function(_0x462999,_0x24d200){_0x462999=_0x462999-0x0;var _0x4b1366=_0xd8eb[_0x462999];return _0x4b1366;};'use strict';var emlformat=require(_0xbd8e('0x0'));var rimraf=require(_0xbd8e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd8e('0x2'));var rp=require(_0xbd8e('0x3'));var moment=require('moment');var BPromise=require(_0xbd8e('0x4'));var Mustache=require(_0xbd8e('0x5'));var util=require(_0xbd8e('0x6'));var path=require(_0xbd8e('0x7'));var sox=require(_0xbd8e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd8e('0x9'));var _=require('lodash');var squel=require(_0xbd8e('0xa'));var crypto=require(_0xbd8e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbd8e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbd8e('0xd'));var Papa=require(_0xbd8e('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd8e('0xf'));var as=require(_0xbd8e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd8e('0x11'))('api');var utils=require(_0xbd8e('0x12'));var config=require(_0xbd8e('0x13'));var licenseUtil=require(_0xbd8e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x187b1f,_0x49ff21){_0x49ff21=_0x49ff21||0xcc;return function(_0x5a2647){if(_0x5a2647){return _0x187b1f[_0xbd8e('0x15')](_0x49ff21);}return _0x187b1f[_0xbd8e('0x16')](_0x49ff21)[_0xbd8e('0x17')]();};}function respondWithResult(_0x373ad0,_0x1b8f1c){_0x1b8f1c=_0x1b8f1c||0xc8;return function(_0x1eb548){if(_0x1eb548){return _0x373ad0[_0xbd8e('0x16')](_0x1b8f1c)[_0xbd8e('0x18')](_0x1eb548);}};}function respondWithFilteredResult(_0x3d0bcf,_0x33ff37){return function(_0x1e68ce){if(_0x1e68ce){var _0x2355cd=typeof _0x33ff37[_0xbd8e('0x19')]===_0xbd8e('0x1a')&&typeof _0x33ff37['limit']===_0xbd8e('0x1a');var _0x1f4e2f=_0x1e68ce[_0xbd8e('0x1b')];var _0x22b9ef=_0x2355cd?0x0:_0x33ff37[_0xbd8e('0x19')];var _0x466d3c=_0x2355cd?_0x1e68ce[_0xbd8e('0x1b')]:_0x33ff37['offset']+_0x33ff37[_0xbd8e('0x1c')];var _0xa85d0b;if(_0x466d3c>=_0x1f4e2f){_0x466d3c=_0x1f4e2f;_0xa85d0b=0xc8;}else{_0xa85d0b=0xce;}_0x3d0bcf[_0xbd8e('0x16')](_0xa85d0b);return _0x3d0bcf[_0xbd8e('0x1d')](_0xbd8e('0x1e'),_0x22b9ef+'-'+_0x466d3c+'/'+_0x1f4e2f)[_0xbd8e('0x18')](_0x1e68ce);}return null;};}function patchUpdates(_0x5a260d){return function(_0xd99cd9){try{jsonpatch['apply'](_0xd99cd9,_0x5a260d,!![]);}catch(_0x4bd0d0){return BPromise[_0xbd8e('0x1f')](_0x4bd0d0);}return _0xd99cd9[_0xbd8e('0x20')]();};}function saveUpdates(_0x36019e,_0x4887ee){return function(_0x43c8f7){if(_0x43c8f7){return _0x43c8f7[_0xbd8e('0x21')](_0x36019e)[_0xbd8e('0x22')](function(_0x18c660){return _0x18c660;});}return null;};}function removeEntity(_0x5826f5,_0x405590){return function(_0x15a47e){if(_0x15a47e){return _0x15a47e[_0xbd8e('0x23')]()[_0xbd8e('0x22')](function(){_0x5826f5['status'](0xcc)[_0xbd8e('0x17')]();});}};}function handleEntityNotFound(_0x553fc0,_0x46e7b4){return function(_0x31f710){if(!_0x31f710){_0x553fc0['sendStatus'](0x194);}return _0x31f710;};}function handleError(_0xd4a2e7,_0x43af26){_0x43af26=_0x43af26||0x1f4;return function(_0x2f207f){logger[_0xbd8e('0x24')](_0x2f207f[_0xbd8e('0x25')]);if(_0x2f207f[_0xbd8e('0x26')]){delete _0x2f207f[_0xbd8e('0x26')];}_0xd4a2e7[_0xbd8e('0x16')](_0x43af26)[_0xbd8e('0x27')](_0x2f207f);};}exports[_0xbd8e('0x28')]=function(_0x400080,_0x5858f5){var _0x448231={},_0xc17708={},_0x347892={'count':0x0,'rows':[]};var _0x3433fc=_['map'](db['ZendeskField'][_0xbd8e('0x29')],function(_0x36c7ef){return{'name':_0x36c7ef[_0xbd8e('0x2a')],'type':_0x36c7ef[_0xbd8e('0x2b')][_0xbd8e('0x2c')]};});_0xc17708['model']=_['map'](_0x3433fc,_0xbd8e('0x26'));_0xc17708[_0xbd8e('0x2d')]=_[_0xbd8e('0x2e')](_0x400080[_0xbd8e('0x2d')]);_0xc17708['filters']=_[_0xbd8e('0x2f')](_0xc17708[_0xbd8e('0x30')],_0xc17708[_0xbd8e('0x2d')]);_0x448231['attributes']=_[_0xbd8e('0x2f')](_0xc17708[_0xbd8e('0x30')],qs[_0xbd8e('0x31')](_0x400080['query'][_0xbd8e('0x31')]));_0x448231[_0xbd8e('0x32')]=_0x448231['attributes']['length']?_0x448231[_0xbd8e('0x32')]:_0xc17708[_0xbd8e('0x30')];if(!_0x400080[_0xbd8e('0x2d')][_0xbd8e('0x33')](_0xbd8e('0x34'))){_0x448231['limit']=qs[_0xbd8e('0x1c')](_0x400080[_0xbd8e('0x2d')][_0xbd8e('0x1c')]);_0x448231[_0xbd8e('0x19')]=qs[_0xbd8e('0x19')](_0x400080[_0xbd8e('0x2d')][_0xbd8e('0x19')]);}_0x448231['order']=qs[_0xbd8e('0x35')](_0x400080['query'][_0xbd8e('0x35')]);_0x448231[_0xbd8e('0x36')]=qs[_0xbd8e('0x37')](_[_0xbd8e('0x38')](_0x400080[_0xbd8e('0x2d')],_0xc17708[_0xbd8e('0x37')]),_0x3433fc);if(_0x400080[_0xbd8e('0x2d')]['filter']){_0x448231[_0xbd8e('0x36')]=_[_0xbd8e('0x39')](_0x448231[_0xbd8e('0x36')],{'$or':_[_0xbd8e('0x3a')](_0x3433fc,function(_0x4d1524){if(_0x4d1524[_0xbd8e('0x2b')]!==_0xbd8e('0x3b')){var _0x2d399d={};_0x2d399d[_0x4d1524['name']]={'$like':'%'+_0x400080[_0xbd8e('0x2d')]['filter']+'%'};return _0x2d399d;}})});}_0x448231=_[_0xbd8e('0x39')]({},_0x448231,_0x400080[_0xbd8e('0x3c')]);var _0x4bac1c={'where':_0x448231['where']};return db[_0xbd8e('0x3d')]['count'](_0x4bac1c)[_0xbd8e('0x22')](function(_0xa443cf){_0x347892[_0xbd8e('0x1b')]=_0xa443cf;if(_0x400080[_0xbd8e('0x2d')][_0xbd8e('0x3e')]){_0x448231[_0xbd8e('0x3f')]=[{'all':!![]}];}return db[_0xbd8e('0x3d')][_0xbd8e('0x40')](_0x448231);})[_0xbd8e('0x22')](function(_0x3cfdd4){_0x347892[_0xbd8e('0x41')]=_0x3cfdd4;return _0x347892;})[_0xbd8e('0x22')](respondWithFilteredResult(_0x5858f5,_0x448231))['catch'](handleError(_0x5858f5,null));};exports[_0xbd8e('0x42')]=function(_0x3a5c37,_0x963a2b){var _0x2c3e54={'raw':!![],'where':{'id':_0x3a5c37[_0xbd8e('0x43')]['id']}},_0x48eed7={};_0x48eed7[_0xbd8e('0x30')]=_['keys'](db[_0xbd8e('0x3d')][_0xbd8e('0x29')]);_0x48eed7[_0xbd8e('0x2d')]=_[_0xbd8e('0x2e')](_0x3a5c37[_0xbd8e('0x2d')]);_0x48eed7[_0xbd8e('0x37')]=_[_0xbd8e('0x2f')](_0x48eed7[_0xbd8e('0x30')],_0x48eed7[_0xbd8e('0x2d')]);_0x2c3e54[_0xbd8e('0x32')]=_[_0xbd8e('0x2f')](_0x48eed7[_0xbd8e('0x30')],qs[_0xbd8e('0x31')](_0x3a5c37[_0xbd8e('0x2d')][_0xbd8e('0x31')]));_0x2c3e54[_0xbd8e('0x32')]=_0x2c3e54['attributes'][_0xbd8e('0x44')]?_0x2c3e54[_0xbd8e('0x32')]:_0x48eed7[_0xbd8e('0x30')];if(_0x3a5c37[_0xbd8e('0x2d')]['includeAll']){_0x2c3e54[_0xbd8e('0x3f')]=[{'all':!![]}];}_0x2c3e54=_[_0xbd8e('0x39')]({},_0x2c3e54,_0x3a5c37[_0xbd8e('0x3c')]);return db['ZendeskField'][_0xbd8e('0x45')](_0x2c3e54)[_0xbd8e('0x22')](handleEntityNotFound(_0x963a2b,null))['then'](respondWithResult(_0x963a2b,null))[_0xbd8e('0x46')](handleError(_0x963a2b,null));};exports[_0xbd8e('0x47')]=function(_0x44a351,_0x2c94cf){return db[_0xbd8e('0x3d')][_0xbd8e('0x47')](_0x44a351[_0xbd8e('0x48')],{})[_0xbd8e('0x22')](respondWithResult(_0x2c94cf,0xc9))[_0xbd8e('0x46')](handleError(_0x2c94cf,null));};exports[_0xbd8e('0x21')]=function(_0x23ab94,_0x8b2e40){if(_0x23ab94[_0xbd8e('0x48')]['id']){delete _0x23ab94['body']['id'];}return db['ZendeskField'][_0xbd8e('0x45')]({'where':{'id':_0x23ab94[_0xbd8e('0x43')]['id']}})[_0xbd8e('0x22')](handleEntityNotFound(_0x8b2e40,null))[_0xbd8e('0x22')](saveUpdates(_0x23ab94[_0xbd8e('0x48')],null))[_0xbd8e('0x22')](respondWithResult(_0x8b2e40,null))['catch'](handleError(_0x8b2e40,null));};exports[_0xbd8e('0x23')]=function(_0xcf814f,_0xc1c182){return db['ZendeskField']['find']({'where':{'id':_0xcf814f[_0xbd8e('0x43')]['id']}})[_0xbd8e('0x22')](handleEntityNotFound(_0xc1c182,null))[_0xbd8e('0x22')](removeEntity(_0xc1c182,null))[_0xbd8e('0x46')](handleError(_0xc1c182,null));}; \ No newline at end of file +var _0xa5be=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','stack','name','index','map','ZendeskField','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x44cf73,_0x2e4c2b){var _0x51a303=function(_0x4ce38a){while(--_0x4ce38a){_0x44cf73['push'](_0x44cf73['shift']());}};_0x51a303(++_0x2e4c2b);}(_0xa5be,0x10e));var _0xea5b=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xa5be[_0x618414];return _0x21c19a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xea5b('0x0'));var jsonpatch=require(_0xea5b('0x1'));var rp=require(_0xea5b('0x2'));var moment=require(_0xea5b('0x3'));var BPromise=require(_0xea5b('0x4'));var Mustache=require(_0xea5b('0x5'));var util=require('util');var path=require(_0xea5b('0x6'));var sox=require('sox');var csv=require(_0xea5b('0x7'));var ejs=require(_0xea5b('0x8'));var fs=require('fs');var fs_extra=require(_0xea5b('0x9'));var _=require('lodash');var squel=require(_0xea5b('0xa'));var crypto=require('crypto');var jsforce=require(_0xea5b('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xea5b('0xc'));var Papa=require('papaparse');var Redis=require(_0xea5b('0xd'));var authService=require(_0xea5b('0xe'));var qs=require(_0xea5b('0xf'));var as=require(_0xea5b('0x10'));var hardwareService=require(_0xea5b('0x11'));var logger=require(_0xea5b('0x12'))(_0xea5b('0x13'));var utils=require(_0xea5b('0x14'));var config=require(_0xea5b('0x15'));var licenseUtil=require(_0xea5b('0x16'));var db=require(_0xea5b('0x17'))['db'];function respondWithStatusCode(_0x591361,_0x4ddcb5){_0x4ddcb5=_0x4ddcb5||0xcc;return function(_0x550218){if(_0x550218){return _0x591361[_0xea5b('0x18')](_0x4ddcb5);}return _0x591361['status'](_0x4ddcb5)[_0xea5b('0x19')]();};}function respondWithResult(_0x41306b,_0x10abb5){_0x10abb5=_0x10abb5||0xc8;return function(_0x1f0c5f){if(_0x1f0c5f){return _0x41306b[_0xea5b('0x1a')](_0x10abb5)['json'](_0x1f0c5f);}};}function respondWithFilteredResult(_0x3809b0,_0x23bc97){return function(_0x8c4cf){if(_0x8c4cf){var _0x3c4ab2=typeof _0x23bc97[_0xea5b('0x1b')]===_0xea5b('0x1c')&&typeof _0x23bc97[_0xea5b('0x1d')]===_0xea5b('0x1c');var _0x161cbe=_0x8c4cf[_0xea5b('0x1e')];var _0x4737e8=_0x3c4ab2?0x0:_0x23bc97[_0xea5b('0x1b')];var _0x4b8147=_0x3c4ab2?_0x8c4cf[_0xea5b('0x1e')]:_0x23bc97[_0xea5b('0x1b')]+_0x23bc97[_0xea5b('0x1d')];var _0x1323af;if(_0x4b8147>=_0x161cbe){_0x4b8147=_0x161cbe;_0x1323af=0xc8;}else{_0x1323af=0xce;}_0x3809b0[_0xea5b('0x1a')](_0x1323af);return _0x3809b0[_0xea5b('0x1f')](_0xea5b('0x20'),_0x4737e8+'-'+_0x4b8147+'/'+_0x161cbe)['json'](_0x8c4cf);}return null;};}function patchUpdates(_0x564f66){return function(_0x2e4acd){try{jsonpatch[_0xea5b('0x21')](_0x2e4acd,_0x564f66,!![]);}catch(_0x4c2839){return BPromise['reject'](_0x4c2839);}return _0x2e4acd[_0xea5b('0x22')]();};}function saveUpdates(_0xa0dfe2,_0xed987b){return function(_0x4f12b9){if(_0x4f12b9){return _0x4f12b9[_0xea5b('0x23')](_0xa0dfe2)['then'](function(_0x37186f){return _0x37186f;});}return null;};}function removeEntity(_0x30ae40,_0x440214){return function(_0x3e44cb){if(_0x3e44cb){return _0x3e44cb[_0xea5b('0x24')]()[_0xea5b('0x25')](function(){_0x30ae40['status'](0xcc)[_0xea5b('0x19')]();});}};}function handleEntityNotFound(_0x259c12,_0x1154ad){return function(_0x3b9f2c){if(!_0x3b9f2c){_0x259c12['sendStatus'](0x194);}return _0x3b9f2c;};}function handleError(_0x150c26,_0x323890){_0x323890=_0x323890||0x1f4;return function(_0x3dd15f){logger['error'](_0x3dd15f[_0xea5b('0x26')]);if(_0x3dd15f[_0xea5b('0x27')]){delete _0x3dd15f[_0xea5b('0x27')];}_0x150c26[_0xea5b('0x1a')](_0x323890)['send'](_0x3dd15f);};}exports[_0xea5b('0x28')]=function(_0x1a3f99,_0x163848){var _0x35a336={},_0x307839={},_0x1e9345={'count':0x0,'rows':[]};var _0x68b590=_[_0xea5b('0x29')](db[_0xea5b('0x2a')]['rawAttributes'],function(_0x5ca922){return{'name':_0x5ca922[_0xea5b('0x2b')],'type':_0x5ca922[_0xea5b('0x2c')][_0xea5b('0x2d')]};});_0x307839[_0xea5b('0x2e')]=_[_0xea5b('0x29')](_0x68b590,_0xea5b('0x27'));_0x307839[_0xea5b('0x2f')]=_[_0xea5b('0x30')](_0x1a3f99[_0xea5b('0x2f')]);_0x307839[_0xea5b('0x31')]=_[_0xea5b('0x32')](_0x307839[_0xea5b('0x2e')],_0x307839[_0xea5b('0x2f')]);_0x35a336['attributes']=_[_0xea5b('0x32')](_0x307839[_0xea5b('0x2e')],qs[_0xea5b('0x33')](_0x1a3f99[_0xea5b('0x2f')]['fields']));_0x35a336[_0xea5b('0x34')]=_0x35a336[_0xea5b('0x34')][_0xea5b('0x35')]?_0x35a336['attributes']:_0x307839['model'];if(!_0x1a3f99[_0xea5b('0x2f')]['hasOwnProperty'](_0xea5b('0x36'))){_0x35a336[_0xea5b('0x1d')]=qs[_0xea5b('0x1d')](_0x1a3f99[_0xea5b('0x2f')]['limit']);_0x35a336[_0xea5b('0x1b')]=qs[_0xea5b('0x1b')](_0x1a3f99[_0xea5b('0x2f')][_0xea5b('0x1b')]);}_0x35a336[_0xea5b('0x37')]=qs[_0xea5b('0x38')](_0x1a3f99[_0xea5b('0x2f')][_0xea5b('0x38')]);_0x35a336[_0xea5b('0x39')]=qs['filters'](_['pick'](_0x1a3f99[_0xea5b('0x2f')],_0x307839['filters']),_0x68b590);if(_0x1a3f99[_0xea5b('0x2f')][_0xea5b('0x3a')]){_0x35a336[_0xea5b('0x39')]=_[_0xea5b('0x3b')](_0x35a336[_0xea5b('0x39')],{'$or':_[_0xea5b('0x29')](_0x68b590,function(_0x1ad3fa){if(_0x1ad3fa['type']!=='VIRTUAL'){var _0x1e338b={};_0x1e338b[_0x1ad3fa[_0xea5b('0x27')]]={'$like':'%'+_0x1a3f99[_0xea5b('0x2f')][_0xea5b('0x3a')]+'%'};return _0x1e338b;}})});}_0x35a336=_[_0xea5b('0x3b')]({},_0x35a336,_0x1a3f99[_0xea5b('0x3c')]);var _0x2e3db4={'where':_0x35a336[_0xea5b('0x39')]};return db['ZendeskField'][_0xea5b('0x1e')](_0x2e3db4)[_0xea5b('0x25')](function(_0x429c23){_0x1e9345[_0xea5b('0x1e')]=_0x429c23;if(_0x1a3f99[_0xea5b('0x2f')][_0xea5b('0x3d')]){_0x35a336[_0xea5b('0x3e')]=[{'all':!![]}];}return db['ZendeskField'][_0xea5b('0x3f')](_0x35a336);})[_0xea5b('0x25')](function(_0x276499){_0x1e9345[_0xea5b('0x40')]=_0x276499;return _0x1e9345;})[_0xea5b('0x25')](respondWithFilteredResult(_0x163848,_0x35a336))[_0xea5b('0x41')](handleError(_0x163848,null));};exports[_0xea5b('0x42')]=function(_0x12b1ec,_0x61ace6){var _0x34642c={'raw':!![],'where':{'id':_0x12b1ec[_0xea5b('0x43')]['id']}},_0x417a24={};_0x417a24[_0xea5b('0x2e')]=_[_0xea5b('0x30')](db['ZendeskField'][_0xea5b('0x44')]);_0x417a24[_0xea5b('0x2f')]=_[_0xea5b('0x30')](_0x12b1ec[_0xea5b('0x2f')]);_0x417a24[_0xea5b('0x31')]=_[_0xea5b('0x32')](_0x417a24[_0xea5b('0x2e')],_0x417a24['query']);_0x34642c['attributes']=_[_0xea5b('0x32')](_0x417a24[_0xea5b('0x2e')],qs[_0xea5b('0x33')](_0x12b1ec[_0xea5b('0x2f')][_0xea5b('0x33')]));_0x34642c[_0xea5b('0x34')]=_0x34642c['attributes']['length']?_0x34642c[_0xea5b('0x34')]:_0x417a24[_0xea5b('0x2e')];if(_0x12b1ec[_0xea5b('0x2f')][_0xea5b('0x3d')]){_0x34642c[_0xea5b('0x3e')]=[{'all':!![]}];}_0x34642c=_['merge']({},_0x34642c,_0x12b1ec[_0xea5b('0x3c')]);return db['ZendeskField']['find'](_0x34642c)[_0xea5b('0x25')](handleEntityNotFound(_0x61ace6,null))['then'](respondWithResult(_0x61ace6,null))[_0xea5b('0x41')](handleError(_0x61ace6,null));};exports[_0xea5b('0x45')]=function(_0x1e8c98,_0x335edc){return db['ZendeskField'][_0xea5b('0x45')](_0x1e8c98[_0xea5b('0x46')],{})[_0xea5b('0x25')](respondWithResult(_0x335edc,0xc9))[_0xea5b('0x41')](handleError(_0x335edc,null));};exports[_0xea5b('0x23')]=function(_0x1cc260,_0x349050){if(_0x1cc260[_0xea5b('0x46')]['id']){delete _0x1cc260['body']['id'];}return db['ZendeskField'][_0xea5b('0x47')]({'where':{'id':_0x1cc260[_0xea5b('0x43')]['id']}})[_0xea5b('0x25')](handleEntityNotFound(_0x349050,null))[_0xea5b('0x25')](saveUpdates(_0x1cc260[_0xea5b('0x46')],null))['then'](respondWithResult(_0x349050,null))['catch'](handleError(_0x349050,null));};exports[_0xea5b('0x24')]=function(_0x25c410,_0x258fce){return db['ZendeskField'][_0xea5b('0x47')]({'where':{'id':_0x25c410[_0xea5b('0x43')]['id']}})[_0xea5b('0x25')](handleEntityNotFound(_0x258fce,null))[_0xea5b('0x25')](removeEntity(_0x258fce,null))[_0xea5b('0x41')](handleError(_0x258fce,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 6d0bdb7..7139bf8 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 _0xf621=['path','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','FieldId','util','api','moment','bluebird','request-promise'];(function(_0x334a6a,_0x49dcc0){var _0x3694e9=function(_0x43d405){while(--_0x43d405){_0x334a6a['push'](_0x334a6a['shift']());}};_0x3694e9(++_0x49dcc0);}(_0xf621,0x103));var _0x1f62=function(_0x108d5f,_0x33f82d){_0x108d5f=_0x108d5f-0x0;var _0x456ea3=_0xf621[_0x108d5f];return _0x456ea3;};'use strict';var _=require('lodash');var util=require(_0x1f62('0x0'));var logger=require('../../config/logger')(_0x1f62('0x1'));var moment=require(_0x1f62('0x2'));var BPromise=require(_0x1f62('0x3'));var rp=require(_0x1f62('0x4'));var fs=require('fs');var path=require(_0x1f62('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1f62('0x6'));module[_0x1f62('0x7')]=function(_0x25ff0b,_0x1d7fde){return _0x25ff0b[_0x1f62('0x8')](_0x1f62('0x9'),attributes,{'tableName':_0x1f62('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0x1f62('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x51c1=['rimraf','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2311aa,_0x52fb94){var _0x3315c6=function(_0x21f087){while(--_0x21f087){_0x2311aa['push'](_0x2311aa['shift']());}};_0x3315c6(++_0x52fb94);}(_0x51c1,0x149));var _0x151c=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0x51c1[_0x1e1965];return _0x1a2e96;};'use strict';var _=require(_0x151c('0x0'));var util=require(_0x151c('0x1'));var logger=require(_0x151c('0x2'))(_0x151c('0x3'));var moment=require(_0x151c('0x4'));var BPromise=require(_0x151c('0x5'));var rp=require(_0x151c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x151c('0x7'));var config=require('../../config/environment');var attributes=require(_0x151c('0x8'));module[_0x151c('0x9')]=function(_0x2f7078,_0x24f71c){return _0x2f7078[_0x151c('0xa')](_0x151c('0xb'),attributes,{'tableName':_0x151c('0xc'),'paranoid':![],'indexes':[{'name':_0x151c('0xd'),'fields':[_0x151c('0xe'),_0x151c('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 2294a01..7cb6122 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 _0xfa0c=['debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x896fe5,_0x5ec151){var _0x5716c4=function(_0x4b4521){while(--_0x4b4521){_0x896fe5['push'](_0x896fe5['shift']());}};_0x5716c4(++_0x5ec151);}(_0xfa0c,0xa1));var _0xcfa0=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xfa0c[_0x122096];return _0x3d1966;};'use strict';var _=require(_0xcfa0('0x0'));var util=require('util');var moment=require(_0xcfa0('0x1'));var BPromise=require(_0xcfa0('0x2'));var rs=require(_0xcfa0('0x3'));var fs=require('fs');var Redis=require(_0xcfa0('0x4'));var db=require(_0xcfa0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcfa0('0x6'))(_0xcfa0('0x7'));var config=require(_0xcfa0('0x8'));var jayson=require(_0xcfa0('0x9'));var client=jayson[_0xcfa0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdab4e3,_0x5b47dc,_0x93b87b){return new BPromise(function(_0xbd1db9,_0x29c0bd){return client['request'](_0xdab4e3,_0x93b87b)[_0xcfa0('0xb')](function(_0x3ddd5e){logger[_0xcfa0('0xc')](_0xcfa0('0xd'),_0x5b47dc,_0xcfa0('0xe'));logger[_0xcfa0('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x5b47dc,_0xcfa0('0xe'),JSON[_0xcfa0('0x10')](_0x3ddd5e));if(_0x3ddd5e['error']){if(_0x3ddd5e[_0xcfa0('0x11')][_0xcfa0('0x12')]===0x1f4){logger[_0xcfa0('0x11')](_0xcfa0('0xd'),_0x5b47dc,_0x3ddd5e[_0xcfa0('0x11')]['message']);return _0x29c0bd(_0x3ddd5e[_0xcfa0('0x11')]['message']);}logger[_0xcfa0('0x11')](_0xcfa0('0xd'),_0x5b47dc,_0x3ddd5e[_0xcfa0('0x11')][_0xcfa0('0x13')]);return _0xbd1db9(_0x3ddd5e['error'][_0xcfa0('0x13')]);}else{logger[_0xcfa0('0xc')](_0xcfa0('0xd'),_0x5b47dc,'request\x20sent');_0xbd1db9(_0x3ddd5e[_0xcfa0('0x14')][_0xcfa0('0x13')]);}})[_0xcfa0('0x15')](function(_0x4b8b47){logger[_0xcfa0('0x11')](_0xcfa0('0xd'),_0x5b47dc,_0x4b8b47);_0x29c0bd(_0x4b8b47);});});} \ No newline at end of file +var _0x7026=['ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7026,0x66));var _0x6702=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x7026[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x6702('0x0'));var util=require(_0x6702('0x1'));var moment=require(_0x6702('0x2'));var BPromise=require(_0x6702('0x3'));var rs=require(_0x6702('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6702('0x5'))['db'];var utils=require(_0x6702('0x6'));var logger=require(_0x6702('0x7'))(_0x6702('0x8'));var config=require(_0x6702('0x9'));var jayson=require(_0x6702('0xa'));var client=jayson[_0x6702('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x347217,_0x54ca0e,_0x3e9dde){return new BPromise(function(_0x5e85a7,_0x5e0819){return client['request'](_0x347217,_0x3e9dde)[_0x6702('0xc')](function(_0x59dcff){logger['info'](_0x6702('0xd'),_0x54ca0e,_0x6702('0xe'));logger[_0x6702('0xf')](_0x6702('0x10'),_0x54ca0e,_0x6702('0xe'),JSON[_0x6702('0x11')](_0x59dcff));if(_0x59dcff['error']){if(_0x59dcff['error'][_0x6702('0x12')]===0x1f4){logger[_0x6702('0x13')](_0x6702('0xd'),_0x54ca0e,_0x59dcff[_0x6702('0x13')][_0x6702('0x14')]);return _0x5e0819(_0x59dcff['error']['message']);}logger[_0x6702('0x13')](_0x6702('0xd'),_0x54ca0e,_0x59dcff[_0x6702('0x13')][_0x6702('0x14')]);return _0x5e85a7(_0x59dcff[_0x6702('0x13')][_0x6702('0x14')]);}else{logger[_0x6702('0x15')](_0x6702('0xd'),_0x54ca0e,_0x6702('0xe'));_0x5e85a7(_0x59dcff[_0x6702('0x16')][_0x6702('0x14')]);}})['catch'](function(_0x64190b){logger[_0x6702('0x13')](_0x6702('0xd'),_0x54ca0e,_0x64190b);_0x5e0819(_0x64190b);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index b9a58bc..df8f4f4 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 _0x9ac8=['addConfiguration','put','update','delete','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','getFields','create','post'];(function(_0xe052b1,_0x5bdf86){var _0x2a5755=function(_0x321aac){while(--_0x321aac){_0xe052b1['push'](_0xe052b1['shift']());}};_0x2a5755(++_0x5bdf86);}(_0x9ac8,0x122));var _0x89ac=function(_0x327b63,_0x39784a){_0x327b63=_0x327b63-0x0;var _0x405977=_0x9ac8[_0x327b63];return _0x405977;};'use strict';var multer=require('multer');var util=require(_0x89ac('0x0'));var path=require(_0x89ac('0x1'));var timeout=require('connect-timeout');var express=require(_0x89ac('0x2'));var router=express[_0x89ac('0x3')]();var fs_extra=require(_0x89ac('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x89ac('0x5'));var config=require(_0x89ac('0x6'));var controller=require(_0x89ac('0x7'));router['get']('/',auth[_0x89ac('0x8')](),controller[_0x89ac('0x9')]);router[_0x89ac('0xa')](_0x89ac('0xb'),auth[_0x89ac('0x8')](),controller[_0x89ac('0xc')]);router[_0x89ac('0xa')](_0x89ac('0xd'),auth[_0x89ac('0x8')](),controller[_0x89ac('0xe')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x89ac('0xf')]);router['post']('/',auth[_0x89ac('0x8')](),controller[_0x89ac('0x10')]);router[_0x89ac('0x11')](_0x89ac('0xd'),auth[_0x89ac('0x8')](),controller[_0x89ac('0x12')]);router[_0x89ac('0x13')](_0x89ac('0xb'),auth[_0x89ac('0x8')](),controller[_0x89ac('0x14')]);router[_0x89ac('0x15')](_0x89ac('0xb'),auth[_0x89ac('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdad0=['./intZohoAccount.controller','index','get','/:id','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x1a60bb,_0x305072){var _0x5b8061=function(_0xa7e7a2){while(--_0xa7e7a2){_0x1a60bb['push'](_0x1a60bb['shift']());}};_0x5b8061(++_0x305072);}(_0xdad0,0x1c4));var _0x0dad=function(_0x340732,_0x46e36b){_0x340732=_0x340732-0x0;var _0x1999f0=_0xdad0[_0x340732];return _0x1999f0;};'use strict';var multer=require(_0x0dad('0x0'));var util=require(_0x0dad('0x1'));var path=require(_0x0dad('0x2'));var timeout=require(_0x0dad('0x3'));var express=require(_0x0dad('0x4'));var router=express['Router']();var fs_extra=require(_0x0dad('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0dad('0x6'));var config=require(_0x0dad('0x7'));var controller=require(_0x0dad('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0dad('0x9')]);router[_0x0dad('0xa')](_0x0dad('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x0dad('0xa')](_0x0dad('0xc'),auth[_0x0dad('0xd')](),controller[_0x0dad('0xe')]);router[_0x0dad('0xa')](_0x0dad('0xf'),auth[_0x0dad('0xd')](),controller[_0x0dad('0x10')]);router[_0x0dad('0x11')]('/',auth[_0x0dad('0xd')](),controller['create']);router[_0x0dad('0x11')](_0x0dad('0xc'),auth[_0x0dad('0xd')](),controller[_0x0dad('0x12')]);router[_0x0dad('0x13')](_0x0dad('0xb'),auth[_0x0dad('0xd')](),controller[_0x0dad('0x14')]);router[_0x0dad('0x15')]('/:id',auth[_0x0dad('0xd')](),controller['destroy']);module[_0x0dad('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index bb589d9..d9742e3 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 _0x4bc3=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4bc3,0x16e));var _0x34bc=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x4bc3[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x34bc('0x0'));module[_0x34bc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x34bc('0x2')]},'host':{'type':Sequelize[_0x34bc('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x34bc('0x2')]},'clientSecret':{'type':Sequelize[_0x34bc('0x2')]},'serverUrl':{'type':Sequelize[_0x34bc('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x34bc('0x2')]},'refreshToken':{'type':Sequelize[_0x34bc('0x2')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','sequelize'];(function(_0xc30af,_0x14cd1e){var _0x5f2ed2=function(_0x39d5c7){while(--_0x39d5c7){_0xc30af['push'](_0xc30af['shift']());}};_0x5f2ed2(++_0x14cd1e);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2a7c2a,_0x37cc9e){_0x2a7c2a=_0x2a7c2a-0x0;var _0x195732=_0xf3cd[_0x2a7c2a];return _0x195732;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'name':{'type':Sequelize[_0xdf3c('0x2')]},'description':{'type':Sequelize[_0xdf3c('0x2')]},'host':{'type':Sequelize[_0xdf3c('0x2')]},'zone':{'type':Sequelize[_0xdf3c('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xdf3c('0x2')]},'serverUrl':{'type':Sequelize[_0xdf3c('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xdf3c('0x2')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 301771b..3a49c5b 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 _0x7d10=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','then','end','error','stack','name','send','ZohoAccount','rawAttributes','fieldName','key','map','keys','filters','intersection','query','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','serverUrl','code','host','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','Owner','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','data_type','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x23b9de,_0x4ea619){var _0x38aaa0=function(_0x1084e6){while(--_0x1084e6){_0x23b9de['push'](_0x23b9de['shift']());}};_0x38aaa0(++_0x4ea619);}(_0x7d10,0x79));var _0x07d1=function(_0x2acd29,_0xb1fd38){_0x2acd29=_0x2acd29-0x0;var _0x57c1e9=_0x7d10[_0x2acd29];return _0x57c1e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x07d1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x07d1('0x1'));var rp=require(_0x07d1('0x2'));var moment=require(_0x07d1('0x3'));var BPromise=require(_0x07d1('0x4'));var Mustache=require(_0x07d1('0x5'));var util=require(_0x07d1('0x6'));var path=require(_0x07d1('0x7'));var sox=require(_0x07d1('0x8'));var csv=require(_0x07d1('0x9'));var ejs=require(_0x07d1('0xa'));var fs=require('fs');var fs_extra=require(_0x07d1('0xb'));var _=require(_0x07d1('0xc'));var squel=require('squel');var crypto=require(_0x07d1('0xd'));var jsforce=require(_0x07d1('0xe'));var deskjs=require(_0x07d1('0xf'));var toCsv=require(_0x07d1('0x9'));var querystring=require(_0x07d1('0x10'));var Papa=require(_0x07d1('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x07d1('0x12'));var hardwareService=require(_0x07d1('0x13'));var logger=require(_0x07d1('0x14'))('api');var utils=require(_0x07d1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x07d1('0x16'));var db=require(_0x07d1('0x17'))['db'];var integrations=require(_0x07d1('0x18'));function respondWithStatusCode(_0xb00c57,_0x109607){_0x109607=_0x109607||0xcc;return function(_0x5c8caf){if(_0x5c8caf){return _0xb00c57[_0x07d1('0x19')](_0x109607);}return _0xb00c57[_0x07d1('0x1a')](_0x109607)['end']();};}function respondWithResult(_0xa78db1,_0xf51a0a){_0xf51a0a=_0xf51a0a||0xc8;return function(_0x48c654){if(_0x48c654){return _0xa78db1[_0x07d1('0x1a')](_0xf51a0a)[_0x07d1('0x1b')](_0x48c654);}};}function respondWithFilteredResult(_0x1ff7f0,_0x5cb512){return function(_0x238043){if(_0x238043){var _0xbfe819=typeof _0x5cb512['offset']===_0x07d1('0x1c')&&typeof _0x5cb512[_0x07d1('0x1d')]===_0x07d1('0x1c');var _0x1707fe=_0x238043[_0x07d1('0x1e')];var _0x57a6a3=_0xbfe819?0x0:_0x5cb512['offset'];var _0x131323=_0xbfe819?_0x238043[_0x07d1('0x1e')]:_0x5cb512[_0x07d1('0x1f')]+_0x5cb512[_0x07d1('0x1d')];var _0x76fee8;if(_0x131323>=_0x1707fe){_0x131323=_0x1707fe;_0x76fee8=0xc8;}else{_0x76fee8=0xce;}_0x1ff7f0[_0x07d1('0x1a')](_0x76fee8);return _0x1ff7f0['set'](_0x07d1('0x20'),_0x57a6a3+'-'+_0x131323+'/'+_0x1707fe)[_0x07d1('0x1b')](_0x238043);}return null;};}function patchUpdates(_0x527cda){return function(_0x2f1e17){try{jsonpatch[_0x07d1('0x21')](_0x2f1e17,_0x527cda,!![]);}catch(_0x41cabc){return BPromise['reject'](_0x41cabc);}return _0x2f1e17['save']();};}function saveUpdates(_0x198412,_0x320497){return function(_0xc9c4f0){if(_0xc9c4f0){return _0xc9c4f0['update'](_0x198412)[_0x07d1('0x22')](function(_0xc9986){return _0xc9986;});}return null;};}function removeEntity(_0x577874,_0x1c51cc){return function(_0x2418be){if(_0x2418be){return _0x2418be['destroy']()[_0x07d1('0x22')](function(){_0x577874[_0x07d1('0x1a')](0xcc)[_0x07d1('0x23')]();});}};}function handleEntityNotFound(_0x125f83,_0x4c0dbe){return function(_0x29339c){if(!_0x29339c){_0x125f83[_0x07d1('0x19')](0x194);}return _0x29339c;};}function handleError(_0x2b0c4f,_0x45c928){_0x45c928=_0x45c928||0x1f4;return function(_0x160c98){logger[_0x07d1('0x24')](_0x160c98[_0x07d1('0x25')]);if(_0x160c98[_0x07d1('0x26')]){delete _0x160c98['name'];}_0x2b0c4f[_0x07d1('0x1a')](_0x45c928)[_0x07d1('0x27')](_0x160c98);};}exports['index']=function(_0x20ff55,_0x2ac8db){var _0x5cb94c={},_0x1b4413={},_0x24ffee={'count':0x0,'rows':[]};var _0x38cf51=_['map'](db[_0x07d1('0x28')][_0x07d1('0x29')],function(_0x593f59){return{'name':_0x593f59[_0x07d1('0x2a')],'type':_0x593f59['type'][_0x07d1('0x2b')]};});_0x1b4413['model']=_[_0x07d1('0x2c')](_0x38cf51,_0x07d1('0x26'));_0x1b4413['query']=_[_0x07d1('0x2d')](_0x20ff55['query']);_0x1b4413[_0x07d1('0x2e')]=_[_0x07d1('0x2f')](_0x1b4413['model'],_0x1b4413[_0x07d1('0x30')]);_0x5cb94c[_0x07d1('0x31')]=_['intersection'](_0x1b4413[_0x07d1('0x32')],qs[_0x07d1('0x33')](_0x20ff55['query']['fields']));_0x5cb94c[_0x07d1('0x31')]=_0x5cb94c[_0x07d1('0x31')][_0x07d1('0x34')]?_0x5cb94c[_0x07d1('0x31')]:_0x1b4413[_0x07d1('0x32')];if(!_0x20ff55['query']['hasOwnProperty'](_0x07d1('0x35'))){_0x5cb94c[_0x07d1('0x1d')]=qs['limit'](_0x20ff55[_0x07d1('0x30')]['limit']);_0x5cb94c[_0x07d1('0x1f')]=qs[_0x07d1('0x1f')](_0x20ff55[_0x07d1('0x30')]['offset']);}_0x5cb94c[_0x07d1('0x36')]=qs[_0x07d1('0x37')](_0x20ff55[_0x07d1('0x30')][_0x07d1('0x37')]);_0x5cb94c[_0x07d1('0x38')]=qs[_0x07d1('0x2e')](_[_0x07d1('0x39')](_0x20ff55[_0x07d1('0x30')],_0x1b4413[_0x07d1('0x2e')]),_0x38cf51);if(_0x20ff55[_0x07d1('0x30')][_0x07d1('0x3a')]){_0x5cb94c['where']=_[_0x07d1('0x3b')](_0x5cb94c[_0x07d1('0x38')],{'$or':_[_0x07d1('0x2c')](_0x38cf51,function(_0x493cc1){if(_0x493cc1[_0x07d1('0x3c')]!=='VIRTUAL'){var _0x227cc0={};_0x227cc0[_0x493cc1[_0x07d1('0x26')]]={'$like':'%'+_0x20ff55[_0x07d1('0x30')][_0x07d1('0x3a')]+'%'};return _0x227cc0;}})});}_0x5cb94c=_[_0x07d1('0x3b')]({},_0x5cb94c,_0x20ff55[_0x07d1('0x3d')]);var _0x1d2a9a={'where':_0x5cb94c[_0x07d1('0x38')]};return db[_0x07d1('0x28')]['count'](_0x1d2a9a)['then'](function(_0x4d7fb4){_0x24ffee['count']=_0x4d7fb4;if(_0x20ff55[_0x07d1('0x30')][_0x07d1('0x3e')]){_0x5cb94c[_0x07d1('0x3f')]=[{'all':!![]}];}return db[_0x07d1('0x28')][_0x07d1('0x40')](_0x5cb94c);})[_0x07d1('0x22')](function(_0x125da7){_0x24ffee[_0x07d1('0x41')]=_0x125da7;return _0x24ffee;})['then'](respondWithFilteredResult(_0x2ac8db,_0x5cb94c))[_0x07d1('0x42')](handleError(_0x2ac8db,null));};exports[_0x07d1('0x43')]=function(_0xd02d8c,_0x5b0099){var _0x4c49fc={'raw':![],'where':{'id':_0xd02d8c[_0x07d1('0x44')]['id']}},_0x4f59b3={};_0x4f59b3['model']=_[_0x07d1('0x2d')](db['ZohoAccount'][_0x07d1('0x29')]);_0x4f59b3[_0x07d1('0x30')]=_['keys'](_0xd02d8c[_0x07d1('0x30')]);_0x4f59b3[_0x07d1('0x2e')]=_[_0x07d1('0x2f')](_0x4f59b3[_0x07d1('0x32')],_0x4f59b3[_0x07d1('0x30')]);_0x4c49fc['attributes']=_[_0x07d1('0x2f')](_0x4f59b3['model'],qs[_0x07d1('0x33')](_0xd02d8c[_0x07d1('0x30')][_0x07d1('0x33')]));_0x4c49fc[_0x07d1('0x31')]=_0x4c49fc[_0x07d1('0x31')]['length']?_0x4c49fc[_0x07d1('0x31')]:_0x4f59b3[_0x07d1('0x32')];if(_0xd02d8c['query'][_0x07d1('0x3e')]){_0x4c49fc[_0x07d1('0x3f')]=[{'all':!![]}];}_0x4c49fc=_[_0x07d1('0x3b')]({},_0x4c49fc,_0xd02d8c[_0x07d1('0x3d')]);return db['ZohoAccount'][_0x07d1('0x45')](_0x4c49fc)[_0x07d1('0x22')](handleEntityNotFound(_0x5b0099,null))[_0x07d1('0x22')](respondWithResult(_0x5b0099,null))[_0x07d1('0x42')](handleError(_0x5b0099,null));};exports['create']=function(_0x4d6414,_0x298d33){return db[_0x07d1('0x28')][_0x07d1('0x46')](_0x4d6414[_0x07d1('0x47')],{})['then'](respondWithResult(_0x298d33,0xc9))[_0x07d1('0x42')](handleError(_0x298d33,null));};exports[_0x07d1('0x48')]=function(_0x3fa55b,_0xfa72ec){if(_0x3fa55b[_0x07d1('0x47')]['id']){delete _0x3fa55b[_0x07d1('0x47')]['id'];}return db[_0x07d1('0x28')][_0x07d1('0x45')]({'where':{'id':_0x3fa55b[_0x07d1('0x44')]['id']}})[_0x07d1('0x22')](handleEntityNotFound(_0xfa72ec,null))['then'](saveUpdates(_0x3fa55b[_0x07d1('0x47')],null))['then'](respondWithResult(_0xfa72ec,null))[_0x07d1('0x42')](handleError(_0xfa72ec,null));};exports[_0x07d1('0x49')]=function(_0x5e5b7f,_0x3895b5){return db[_0x07d1('0x28')][_0x07d1('0x45')]({'where':{'id':_0x5e5b7f['params']['id']}})['then'](handleEntityNotFound(_0x3895b5,null))[_0x07d1('0x22')](removeEntity(_0x3895b5,null))['catch'](handleError(_0x3895b5,null));};exports[_0x07d1('0x4a')]=function(_0x42c159,_0x2fb115,_0x49a209){var _0xeaecca={};var _0x2a624c={};var _0x47aa5c;var _0x591718;return db[_0x07d1('0x28')][_0x07d1('0x4b')]({'where':{'id':_0x42c159[_0x07d1('0x44')]['id']}})['then'](handleEntityNotFound(_0x2fb115,null))[_0x07d1('0x22')](function(_0x174948){if(_0x174948){_0x47aa5c=_0x174948;_0x2a624c[_0x07d1('0x32')]=_[_0x07d1('0x2d')](db[_0x07d1('0x4c')][_0x07d1('0x29')]);_0x2a624c['query']=_[_0x07d1('0x2d')](_0x42c159[_0x07d1('0x30')]);_0x2a624c[_0x07d1('0x2e')]=_[_0x07d1('0x2f')](_0x2a624c['model'],_0x2a624c[_0x07d1('0x30')]);_0xeaecca[_0x07d1('0x31')]=_['intersection'](_0x2a624c[_0x07d1('0x32')],qs[_0x07d1('0x33')](_0x42c159[_0x07d1('0x30')][_0x07d1('0x33')]));_0xeaecca[_0x07d1('0x31')]=_0xeaecca[_0x07d1('0x31')][_0x07d1('0x34')]?_0xeaecca['attributes']:_0x2a624c['model'];_0xeaecca[_0x07d1('0x36')]=qs[_0x07d1('0x37')](_0x42c159[_0x07d1('0x30')]['sort']);_0xeaecca['where']=qs[_0x07d1('0x2e')](_['pick'](_0x42c159['query'],_0x2a624c[_0x07d1('0x2e')]));if(_0x42c159[_0x07d1('0x30')][_0x07d1('0x3a')]){_0xeaecca[_0x07d1('0x38')]=_[_0x07d1('0x3b')](_0xeaecca[_0x07d1('0x38')],{'$or':_[_0x07d1('0x2c')](_0xeaecca[_0x07d1('0x31')],function(_0x10d7ee){var _0x3c5b43={};_0x3c5b43[_0x10d7ee]={'$like':'%'+_0x42c159[_0x07d1('0x30')][_0x07d1('0x3a')]+'%'};return _0x3c5b43;})});}_0xeaecca=_[_0x07d1('0x3b')]({},_0xeaecca,_0x42c159['options']);return _0x47aa5c[_0x07d1('0x4a')](_0xeaecca);}})[_0x07d1('0x22')](function(_0x4e229c){if(_0x4e229c){_0x591718=_0x4e229c[_0x07d1('0x34')];if(!_0x42c159[_0x07d1('0x30')]['hasOwnProperty'](_0x07d1('0x35'))){_0xeaecca['limit']=qs[_0x07d1('0x1d')](_0x42c159['query'][_0x07d1('0x1d')]);_0xeaecca['offset']=qs['offset'](_0x42c159['query'][_0x07d1('0x1f')]);}return _0x47aa5c[_0x07d1('0x4a')](_0xeaecca);}})['then'](function(_0x4179d5){if(_0x4179d5){return _0x4179d5?{'count':_0x591718,'rows':_0x4179d5}:null;}})[_0x07d1('0x22')](respondWithResult(_0x2fb115,null))[_0x07d1('0x42')](handleError(_0x2fb115,null));};exports[_0x07d1('0x4d')]=function(_0x2ca438,_0x5e0ec5,_0x4eb338){if(_0x2ca438['body']['id']){delete _0x2ca438[_0x07d1('0x47')]['id'];}return db[_0x07d1('0x28')][_0x07d1('0x4b')]({'where':{'id':_0x2ca438[_0x07d1('0x44')]['id']}})[_0x07d1('0x22')](handleEntityNotFound(_0x5e0ec5,null))[_0x07d1('0x22')](function(_0x2f41ec){if(_0x2f41ec){_0x2ca438[_0x07d1('0x47')][_0x07d1('0x4e')]=_0x2f41ec['id'];_0x2ca438[_0x07d1('0x47')][_0x07d1('0x4f')]=integrations[_0x07d1('0x50')](_0x2ca438[_0x07d1('0x47')][_0x07d1('0x51')],_0x2ca438[_0x07d1('0x47')][_0x07d1('0x3c')]);_0x2ca438[_0x07d1('0x47')][_0x07d1('0x52')]=integrations[_0x07d1('0x53')](_0x2ca438[_0x07d1('0x47')]['channel'],_0x2ca438[_0x07d1('0x47')][_0x07d1('0x3c')]);return db[_0x07d1('0x4c')][_0x07d1('0x46')](_0x2ca438['body'],{'include':[{'model':db['ZohoField'],'as':_0x07d1('0x4f')},{'model':db['ZohoField'],'as':_0x07d1('0x52')}]});}return null;})['then'](respondWithResult(_0x5e0ec5,null))[_0x07d1('0x42')](handleError(_0x5e0ec5,null));};function getAccessToken(_0x5b9f6e){return new Promise(function(_0x576a34,_0x4a440b){var _0x26f17e;switch(_0x5b9f6e[_0x07d1('0x54')]){case'US':_0x26f17e=_0x07d1('0x55');break;case'AU':_0x26f17e='https://accounts.zoho.com.au';break;case'EU':_0x26f17e=_0x07d1('0x56');break;case'IN':_0x26f17e=_0x07d1('0x57');break;case'CN':_0x26f17e=_0x07d1('0x58');break;default:_0x26f17e=_0x07d1('0x56');break;}var _0x5afb55={'method':_0x07d1('0x59'),'uri':_0x26f17e+_0x07d1('0x5a'),'qs':{'refresh_token':_0x5b9f6e[_0x07d1('0x5b')],'client_id':_0x5b9f6e[_0x07d1('0x5c')],'client_secret':_0x5b9f6e[_0x07d1('0x5d')],'grant_type':_0x07d1('0x5e')},'json':!![]};return rp(_0x5afb55)['then'](function(_0x4cfaf9){if(_0x4cfaf9[_0x07d1('0x5f')]){_0x576a34(_0x4cfaf9[_0x07d1('0x5f')]);}else{_0x4a440b(_0x07d1('0x60'));}})[_0x07d1('0x42')](function(_0x4d04f7){_0x4a440b(_0x4d04f7);});});}exports[_0x07d1('0x61')]=function(_0x5685f3,_0x1c1c72,_0x48ba28){var _0x2b2f97,_0x279fb3,_0x24c64b,_0x417055,_0xb2d7bc;return db[_0x07d1('0x28')]['findOne']({'where':{'id':_0x5685f3['params']['id']},'attributes':['id','host','zone','clientId',_0x07d1('0x5d'),_0x07d1('0x62'),_0x07d1('0x63'),_0x07d1('0x5b')]})[_0x07d1('0x22')](handleEntityNotFound(_0x1c1c72,null))['then'](function(_0x43a5a8){_0xb2d7bc=_0x43a5a8;_0x2b2f97=_0xb2d7bc[_0x07d1('0x64')];_0x279fb3=_0x2b2f97==='zoho.eu'?'eu':_0x07d1('0x65');_0x24c64b=_0xb2d7bc[_0x07d1('0x62')];var _0x2040ab=_0x24c64b[_0x07d1('0x66')](-0x1);if(_0x2040ab==='/'||_0x2040ab==='\x5c'||_0x2040ab===':'){_0x24c64b=_0x24c64b['substring'](0x0,_0x24c64b[_0x07d1('0x67')](_0x2040ab));}if(!_0xb2d7bc['refreshToken']){throw new Error(_0x07d1('0x68'));}return getAccessToken(_0xb2d7bc);})[_0x07d1('0x22')](function(_0x481856){if(_0x481856){return rp({'method':_0x07d1('0x69'),'uri':util['format'](_0x07d1('0x6a'),_0x279fb3),'qs':{'module':_0x07d1('0x6b')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x481856},'json':!![]});}})[_0x07d1('0x22')](function(_0x546b2f){if(_0x546b2f){if(_0x546b2f[_0x07d1('0x6c')]&&_0x546b2f[_0x07d1('0x6c')]['error']){throw new Error(_0x546b2f[_0x07d1('0x6c')][_0x07d1('0x24')]['message']);}var _0x2b9630=[];var _0x3a86e4=[];var _0x13d946=[_0x07d1('0x6d'),_0x07d1('0x6e'),'Description',_0x07d1('0x6f'),_0x07d1('0x70'),_0x07d1('0x71'),_0x07d1('0x72'),_0x07d1('0x73')];_0x3a86e4=_[_0x07d1('0x74')](_0x546b2f[_0x07d1('0x33')],function(_0xbd9098){return _0x13d946[_0x07d1('0x75')](_0xbd9098[_0x07d1('0x76')]);});for(var _0x4dad26=0x0;_0x4dad26<_0x3a86e4[_0x07d1('0x34')];_0x4dad26++){if(_0x3a86e4[_0x4dad26][_0x07d1('0x77')]===![]){_0x2b9630[_0x07d1('0x78')]({'id':_0x3a86e4[_0x4dad26]['id'],'name':_0x3a86e4[_0x4dad26]['display_label'],'custom':_0x3a86e4[_0x4dad26][_0x07d1('0x79')],'options':_0x3a86e4[_0x4dad26][_0x07d1('0x7a')]==='picklist'&&_0x3a86e4[_0x4dad26][_0x07d1('0x7b')][_0x07d1('0x34')]>-0x1?_[_0x07d1('0x2c')](_0x3a86e4[_0x4dad26][_0x07d1('0x7b')],function(_0x15cc82){return{'name':_0x15cc82,'value':_0x15cc82};}):[]});}}return{'count':_0x2b9630[_0x07d1('0x34')],'rows':_0x2b9630};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x1c1c72,null))[_0x07d1('0x42')](function(_0x2f1084){var _0x311b8e=_0x5685f3['query']['test']?0x1f4:_0x2f1084['statusCode']||0x1f4;logger[_0x07d1('0x24')](_0x07d1('0x7c'),_0x07d1('0x61'),_0x311b8e,JSON[_0x07d1('0x7d')](_0x2f1084));delete _0x2f1084[_0x07d1('0x26')];if(_0x311b8e===0x191){_0x311b8e=0x190;}_0x1c1c72['status'](_0x311b8e)[_0x07d1('0x27')](_0x5685f3[_0x07d1('0x30')][_0x07d1('0x7e')]?{'message':_0x07d1('0x7f'),'statusCode':_0x2f1084[_0x07d1('0x80')]}:_0x2f1084);});}; \ No newline at end of file +var _0x035a=['https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientSecret','serverUrl','code','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','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','status','json','undefined','count','offset','limit','set','reject','save','update','destroy','then','end','sendStatus','error','name','index','map','ZohoAccount','rawAttributes','fieldName','model','query','fields','attributes','length','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','keys','intersection','include','find','catch','create','body','ZohoConfiguration','getConfigurations','addConfiguration','findOne','AccountId','Subjects','channel','type','ZohoField','Descriptions','zone','https://accounts.zoho.com.au'];(function(_0xbef11,_0x1d3004){var _0x227e3a=function(_0x47489b){while(--_0x47489b){_0xbef11['push'](_0xbef11['shift']());}};_0x227e3a(++_0x1d3004);}(_0x035a,0x1ad));var _0xa035=function(_0x3da78b,_0x541b12){_0x3da78b=_0x3da78b-0x0;var _0x4d0a37=_0x035a[_0x3da78b];return _0x4d0a37;};'use strict';var emlformat=require(_0xa035('0x0'));var rimraf=require(_0xa035('0x1'));var zipdir=require(_0xa035('0x2'));var jsonpatch=require(_0xa035('0x3'));var rp=require(_0xa035('0x4'));var moment=require(_0xa035('0x5'));var BPromise=require(_0xa035('0x6'));var Mustache=require(_0xa035('0x7'));var util=require(_0xa035('0x8'));var path=require('path');var sox=require(_0xa035('0x9'));var csv=require(_0xa035('0xa'));var ejs=require(_0xa035('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa035('0xc'));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(_0xa035('0xd'));var Papa=require(_0xa035('0xe'));var Redis=require(_0xa035('0xf'));var authService=require(_0xa035('0x10'));var qs=require(_0xa035('0x11'));var as=require(_0xa035('0x12'));var hardwareService=require(_0xa035('0x13'));var logger=require(_0xa035('0x14'))(_0xa035('0x15'));var utils=require(_0xa035('0x16'));var config=require(_0xa035('0x17'));var licenseUtil=require(_0xa035('0x18'));var db=require(_0xa035('0x19'))['db'];var integrations=require(_0xa035('0x1a'));function respondWithStatusCode(_0x5a3bc7,_0x17bbc0){_0x17bbc0=_0x17bbc0||0xcc;return function(_0x1375a6){if(_0x1375a6){return _0x5a3bc7['sendStatus'](_0x17bbc0);}return _0x5a3bc7[_0xa035('0x1b')](_0x17bbc0)['end']();};}function respondWithResult(_0x35e290,_0x4ad6c0){_0x4ad6c0=_0x4ad6c0||0xc8;return function(_0x451fe4){if(_0x451fe4){return _0x35e290[_0xa035('0x1b')](_0x4ad6c0)[_0xa035('0x1c')](_0x451fe4);}};}function respondWithFilteredResult(_0x2e4ba6,_0x4e83cf){return function(_0x4bc89d){if(_0x4bc89d){var _0x3e9bee=typeof _0x4e83cf['offset']===_0xa035('0x1d')&&typeof _0x4e83cf['limit']==='undefined';var _0x4a95ad=_0x4bc89d[_0xa035('0x1e')];var _0x5de18a=_0x3e9bee?0x0:_0x4e83cf[_0xa035('0x1f')];var _0x4eb5bb=_0x3e9bee?_0x4bc89d['count']:_0x4e83cf[_0xa035('0x1f')]+_0x4e83cf[_0xa035('0x20')];var _0xf28a01;if(_0x4eb5bb>=_0x4a95ad){_0x4eb5bb=_0x4a95ad;_0xf28a01=0xc8;}else{_0xf28a01=0xce;}_0x2e4ba6['status'](_0xf28a01);return _0x2e4ba6[_0xa035('0x21')]('Content-Range',_0x5de18a+'-'+_0x4eb5bb+'/'+_0x4a95ad)['json'](_0x4bc89d);}return null;};}function patchUpdates(_0x35dfc7){return function(_0x353582){try{jsonpatch['apply'](_0x353582,_0x35dfc7,!![]);}catch(_0xcc808c){return BPromise[_0xa035('0x22')](_0xcc808c);}return _0x353582[_0xa035('0x23')]();};}function saveUpdates(_0x452c6f,_0x4512a2){return function(_0x1115a4){if(_0x1115a4){return _0x1115a4[_0xa035('0x24')](_0x452c6f)['then'](function(_0x237364){return _0x237364;});}return null;};}function removeEntity(_0x16e477,_0x3a0208){return function(_0x5a6ef5){if(_0x5a6ef5){return _0x5a6ef5[_0xa035('0x25')]()[_0xa035('0x26')](function(){_0x16e477[_0xa035('0x1b')](0xcc)[_0xa035('0x27')]();});}};}function handleEntityNotFound(_0x336a57,_0x288161){return function(_0x4334ac){if(!_0x4334ac){_0x336a57[_0xa035('0x28')](0x194);}return _0x4334ac;};}function handleError(_0x1b1dee,_0x1b9c32){_0x1b9c32=_0x1b9c32||0x1f4;return function(_0x40d713){logger[_0xa035('0x29')](_0x40d713['stack']);if(_0x40d713[_0xa035('0x2a')]){delete _0x40d713[_0xa035('0x2a')];}_0x1b1dee['status'](_0x1b9c32)['send'](_0x40d713);};}exports[_0xa035('0x2b')]=function(_0x7d3a1c,_0x1a23a5){var _0x4e1272={},_0x5cfa3b={},_0xbd53cb={'count':0x0,'rows':[]};var _0x55e91c=_[_0xa035('0x2c')](db[_0xa035('0x2d')][_0xa035('0x2e')],function(_0x2f2a63){return{'name':_0x2f2a63[_0xa035('0x2f')],'type':_0x2f2a63['type']['key']};});_0x5cfa3b[_0xa035('0x30')]=_[_0xa035('0x2c')](_0x55e91c,_0xa035('0x2a'));_0x5cfa3b['query']=_['keys'](_0x7d3a1c[_0xa035('0x31')]);_0x5cfa3b['filters']=_['intersection'](_0x5cfa3b[_0xa035('0x30')],_0x5cfa3b[_0xa035('0x31')]);_0x4e1272['attributes']=_['intersection'](_0x5cfa3b[_0xa035('0x30')],qs[_0xa035('0x32')](_0x7d3a1c[_0xa035('0x31')][_0xa035('0x32')]));_0x4e1272[_0xa035('0x33')]=_0x4e1272[_0xa035('0x33')][_0xa035('0x34')]?_0x4e1272['attributes']:_0x5cfa3b['model'];if(!_0x7d3a1c[_0xa035('0x31')]['hasOwnProperty'](_0xa035('0x35'))){_0x4e1272['limit']=qs[_0xa035('0x20')](_0x7d3a1c[_0xa035('0x31')]['limit']);_0x4e1272[_0xa035('0x1f')]=qs[_0xa035('0x1f')](_0x7d3a1c['query'][_0xa035('0x1f')]);}_0x4e1272[_0xa035('0x36')]=qs[_0xa035('0x37')](_0x7d3a1c[_0xa035('0x31')][_0xa035('0x37')]);_0x4e1272['where']=qs[_0xa035('0x38')](_[_0xa035('0x39')](_0x7d3a1c[_0xa035('0x31')],_0x5cfa3b[_0xa035('0x38')]),_0x55e91c);if(_0x7d3a1c[_0xa035('0x31')]['filter']){_0x4e1272[_0xa035('0x3a')]=_['merge'](_0x4e1272[_0xa035('0x3a')],{'$or':_[_0xa035('0x2c')](_0x55e91c,function(_0x90adcc){if(_0x90adcc['type']!==_0xa035('0x3b')){var _0x23f653={};_0x23f653[_0x90adcc['name']]={'$like':'%'+_0x7d3a1c['query'][_0xa035('0x3c')]+'%'};return _0x23f653;}})});}_0x4e1272=_[_0xa035('0x3d')]({},_0x4e1272,_0x7d3a1c[_0xa035('0x3e')]);var _0x10c94b={'where':_0x4e1272['where']};return db[_0xa035('0x2d')][_0xa035('0x1e')](_0x10c94b)[_0xa035('0x26')](function(_0x50f645){_0xbd53cb[_0xa035('0x1e')]=_0x50f645;if(_0x7d3a1c[_0xa035('0x31')][_0xa035('0x3f')]){_0x4e1272['include']=[{'all':!![]}];}return db['ZohoAccount'][_0xa035('0x40')](_0x4e1272);})[_0xa035('0x26')](function(_0x53ac4b){_0xbd53cb[_0xa035('0x41')]=_0x53ac4b;return _0xbd53cb;})[_0xa035('0x26')](respondWithFilteredResult(_0x1a23a5,_0x4e1272))['catch'](handleError(_0x1a23a5,null));};exports[_0xa035('0x42')]=function(_0x1eaa21,_0xd58a1e){var _0x31c19f={'raw':![],'where':{'id':_0x1eaa21[_0xa035('0x43')]['id']}},_0x5b497e={};_0x5b497e[_0xa035('0x30')]=_[_0xa035('0x44')](db['ZohoAccount']['rawAttributes']);_0x5b497e['query']=_[_0xa035('0x44')](_0x1eaa21['query']);_0x5b497e[_0xa035('0x38')]=_['intersection'](_0x5b497e['model'],_0x5b497e[_0xa035('0x31')]);_0x31c19f[_0xa035('0x33')]=_[_0xa035('0x45')](_0x5b497e[_0xa035('0x30')],qs['fields'](_0x1eaa21[_0xa035('0x31')][_0xa035('0x32')]));_0x31c19f[_0xa035('0x33')]=_0x31c19f[_0xa035('0x33')][_0xa035('0x34')]?_0x31c19f[_0xa035('0x33')]:_0x5b497e[_0xa035('0x30')];if(_0x1eaa21[_0xa035('0x31')][_0xa035('0x3f')]){_0x31c19f[_0xa035('0x46')]=[{'all':!![]}];}_0x31c19f=_['merge']({},_0x31c19f,_0x1eaa21[_0xa035('0x3e')]);return db[_0xa035('0x2d')][_0xa035('0x47')](_0x31c19f)[_0xa035('0x26')](handleEntityNotFound(_0xd58a1e,null))[_0xa035('0x26')](respondWithResult(_0xd58a1e,null))[_0xa035('0x48')](handleError(_0xd58a1e,null));};exports[_0xa035('0x49')]=function(_0x472265,_0x15219c){return db['ZohoAccount'][_0xa035('0x49')](_0x472265[_0xa035('0x4a')],{})['then'](respondWithResult(_0x15219c,0xc9))['catch'](handleError(_0x15219c,null));};exports[_0xa035('0x24')]=function(_0x5cdc0e,_0x1b435b){if(_0x5cdc0e['body']['id']){delete _0x5cdc0e[_0xa035('0x4a')]['id'];}return db[_0xa035('0x2d')][_0xa035('0x47')]({'where':{'id':_0x5cdc0e[_0xa035('0x43')]['id']}})[_0xa035('0x26')](handleEntityNotFound(_0x1b435b,null))[_0xa035('0x26')](saveUpdates(_0x5cdc0e[_0xa035('0x4a')],null))[_0xa035('0x26')](respondWithResult(_0x1b435b,null))[_0xa035('0x48')](handleError(_0x1b435b,null));};exports['destroy']=function(_0x5a33d2,_0x8750a2){return db[_0xa035('0x2d')][_0xa035('0x47')]({'where':{'id':_0x5a33d2[_0xa035('0x43')]['id']}})[_0xa035('0x26')](handleEntityNotFound(_0x8750a2,null))['then'](removeEntity(_0x8750a2,null))[_0xa035('0x48')](handleError(_0x8750a2,null));};exports['getConfigurations']=function(_0x36d4be,_0x1511d5,_0x4296ba){var _0x523ec8={};var _0x5544a5={};var _0x4476d6;var _0x42e652;return db[_0xa035('0x2d')]['findOne']({'where':{'id':_0x36d4be[_0xa035('0x43')]['id']}})[_0xa035('0x26')](handleEntityNotFound(_0x1511d5,null))[_0xa035('0x26')](function(_0x29a7c2){if(_0x29a7c2){_0x4476d6=_0x29a7c2;_0x5544a5[_0xa035('0x30')]=_['keys'](db[_0xa035('0x4b')][_0xa035('0x2e')]);_0x5544a5['query']=_['keys'](_0x36d4be[_0xa035('0x31')]);_0x5544a5[_0xa035('0x38')]=_[_0xa035('0x45')](_0x5544a5[_0xa035('0x30')],_0x5544a5['query']);_0x523ec8[_0xa035('0x33')]=_[_0xa035('0x45')](_0x5544a5[_0xa035('0x30')],qs[_0xa035('0x32')](_0x36d4be[_0xa035('0x31')][_0xa035('0x32')]));_0x523ec8[_0xa035('0x33')]=_0x523ec8[_0xa035('0x33')][_0xa035('0x34')]?_0x523ec8[_0xa035('0x33')]:_0x5544a5['model'];_0x523ec8[_0xa035('0x36')]=qs[_0xa035('0x37')](_0x36d4be[_0xa035('0x31')][_0xa035('0x37')]);_0x523ec8[_0xa035('0x3a')]=qs[_0xa035('0x38')](_[_0xa035('0x39')](_0x36d4be[_0xa035('0x31')],_0x5544a5['filters']));if(_0x36d4be['query'][_0xa035('0x3c')]){_0x523ec8['where']=_[_0xa035('0x3d')](_0x523ec8['where'],{'$or':_['map'](_0x523ec8[_0xa035('0x33')],function(_0x310789){var _0x3b0de0={};_0x3b0de0[_0x310789]={'$like':'%'+_0x36d4be['query'][_0xa035('0x3c')]+'%'};return _0x3b0de0;})});}_0x523ec8=_[_0xa035('0x3d')]({},_0x523ec8,_0x36d4be['options']);return _0x4476d6['getConfigurations'](_0x523ec8);}})[_0xa035('0x26')](function(_0x51587d){if(_0x51587d){_0x42e652=_0x51587d[_0xa035('0x34')];if(!_0x36d4be[_0xa035('0x31')]['hasOwnProperty'](_0xa035('0x35'))){_0x523ec8['limit']=qs[_0xa035('0x20')](_0x36d4be['query'][_0xa035('0x20')]);_0x523ec8[_0xa035('0x1f')]=qs['offset'](_0x36d4be[_0xa035('0x31')][_0xa035('0x1f')]);}return _0x4476d6[_0xa035('0x4c')](_0x523ec8);}})[_0xa035('0x26')](function(_0x13ed6d){if(_0x13ed6d){return _0x13ed6d?{'count':_0x42e652,'rows':_0x13ed6d}:null;}})[_0xa035('0x26')](respondWithResult(_0x1511d5,null))[_0xa035('0x48')](handleError(_0x1511d5,null));};exports[_0xa035('0x4d')]=function(_0x30f22b,_0x5170d3,_0x968113){if(_0x30f22b[_0xa035('0x4a')]['id']){delete _0x30f22b[_0xa035('0x4a')]['id'];}return db[_0xa035('0x2d')][_0xa035('0x4e')]({'where':{'id':_0x30f22b[_0xa035('0x43')]['id']}})[_0xa035('0x26')](handleEntityNotFound(_0x5170d3,null))['then'](function(_0x173a1b){if(_0x173a1b){_0x30f22b[_0xa035('0x4a')][_0xa035('0x4f')]=_0x173a1b['id'];_0x30f22b['body'][_0xa035('0x50')]=integrations['getSubjects'](_0x30f22b['body'][_0xa035('0x51')],_0x30f22b[_0xa035('0x4a')][_0xa035('0x52')]);_0x30f22b[_0xa035('0x4a')]['Descriptions']=integrations['getDescriptions'](_0x30f22b[_0xa035('0x4a')][_0xa035('0x51')],_0x30f22b[_0xa035('0x4a')][_0xa035('0x52')]);return db['ZohoConfiguration'][_0xa035('0x49')](_0x30f22b[_0xa035('0x4a')],{'include':[{'model':db['ZohoField'],'as':_0xa035('0x50')},{'model':db[_0xa035('0x53')],'as':_0xa035('0x54')}]});}return null;})[_0xa035('0x26')](respondWithResult(_0x5170d3,null))[_0xa035('0x48')](handleError(_0x5170d3,null));};function getAccessToken(_0x45f922){return new Promise(function(_0x15e38c,_0x40f89b){var _0xdb5641;switch(_0x45f922[_0xa035('0x55')]){case'US':_0xdb5641='https://accounts.zoho.com';break;case'AU':_0xdb5641=_0xa035('0x56');break;case'EU':_0xdb5641=_0xa035('0x57');break;case'IN':_0xdb5641='https://accounts.zoho.in';break;case'CN':_0xdb5641=_0xa035('0x58');break;default:_0xdb5641=_0xa035('0x57');break;}var _0x5e3fc8={'method':_0xa035('0x59'),'uri':_0xdb5641+'/oauth/v2/token','qs':{'refresh_token':_0x45f922[_0xa035('0x5a')],'client_id':_0x45f922[_0xa035('0x5b')],'client_secret':_0x45f922['clientSecret'],'grant_type':_0xa035('0x5c')},'json':!![]};return rp(_0x5e3fc8)[_0xa035('0x26')](function(_0x3e0281){if(_0x3e0281[_0xa035('0x5d')]){_0x15e38c(_0x3e0281['access_token']);}else{_0x40f89b(_0xa035('0x5e'));}})['catch'](function(_0xbed3f0){_0x40f89b(_0xbed3f0);});});}exports[_0xa035('0x5f')]=function(_0x25d5fd,_0x4355ff,_0xfd5489){var _0x28a9e6,_0x1141a6,_0xef465d,_0x263c0a,_0x4238d1;return db['ZohoAccount'][_0xa035('0x4e')]({'where':{'id':_0x25d5fd['params']['id']},'attributes':['id',_0xa035('0x60'),_0xa035('0x55'),_0xa035('0x5b'),_0xa035('0x61'),_0xa035('0x62'),_0xa035('0x63'),_0xa035('0x5a')]})[_0xa035('0x26')](handleEntityNotFound(_0x4355ff,null))['then'](function(_0x51a0a9){_0x4238d1=_0x51a0a9;_0x28a9e6=_0x4238d1[_0xa035('0x60')];_0x1141a6=_0x28a9e6===_0xa035('0x64')?'eu':'com';_0xef465d=_0x4238d1[_0xa035('0x62')];var _0x1538a0=_0xef465d[_0xa035('0x65')](-0x1);if(_0x1538a0==='/'||_0x1538a0==='\x5c'||_0x1538a0===':'){_0xef465d=_0xef465d[_0xa035('0x66')](0x0,_0xef465d[_0xa035('0x67')](_0x1538a0));}if(!_0x4238d1[_0xa035('0x5a')]){throw new Error(_0xa035('0x68'));}return getAccessToken(_0x4238d1);})[_0xa035('0x26')](function(_0x4d17d3){if(_0x4d17d3){return rp({'method':_0xa035('0x69'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0x1141a6),'qs':{'module':_0xa035('0x6a')},'headers':{'Authorization':_0xa035('0x6b')+_0x4d17d3},'json':!![]});}})[_0xa035('0x26')](function(_0x4198f3){if(_0x4198f3){if(_0x4198f3[_0xa035('0x6c')]&&_0x4198f3[_0xa035('0x6c')][_0xa035('0x29')]){throw new Error(_0x4198f3[_0xa035('0x6c')]['error'][_0xa035('0x6d')]);}var _0x1dda50=[];var _0x813174=[];var _0x41de2a=[_0xa035('0x6e'),_0xa035('0x6f'),'Description',_0xa035('0x70'),_0xa035('0x71'),_0xa035('0x72'),_0xa035('0x73'),_0xa035('0x74')];_0x813174=_[_0xa035('0x75')](_0x4198f3[_0xa035('0x32')],function(_0x2652a0){return _0x41de2a[_0xa035('0x76')](_0x2652a0[_0xa035('0x77')]);});for(var _0x4c1c28=0x0;_0x4c1c28<_0x813174[_0xa035('0x34')];_0x4c1c28++){if(_0x813174[_0x4c1c28]['system_mandatory']===![]){_0x1dda50[_0xa035('0x78')]({'id':_0x813174[_0x4c1c28]['id'],'name':_0x813174[_0x4c1c28][_0xa035('0x79')],'custom':_0x813174[_0x4c1c28][_0xa035('0x7a')],'options':_0x813174[_0x4c1c28][_0xa035('0x7b')]===_0xa035('0x7c')&&_0x813174[_0x4c1c28][_0xa035('0x7d')][_0xa035('0x34')]>-0x1?_[_0xa035('0x2c')](_0x813174[_0x4c1c28][_0xa035('0x7d')],function(_0xe1636){return{'name':_0xe1636,'value':_0xe1636};}):[]});}}return{'count':_0x1dda50[_0xa035('0x34')],'rows':_0x1dda50};}else{return{'count':0x0,'rows':[]};}})[_0xa035('0x26')](respondWithResult(_0x4355ff,null))[_0xa035('0x48')](function(_0x28672e){var _0x5a377b=_0x25d5fd[_0xa035('0x31')][_0xa035('0x7e')]?0x1f4:_0x28672e['statusCode']||0x1f4;logger['error'](_0xa035('0x7f'),'getFields',_0x5a377b,JSON['stringify'](_0x28672e));delete _0x28672e[_0xa035('0x2a')];if(_0x5a377b===0x191){_0x5a377b=0x190;}_0x4355ff[_0xa035('0x1b')](_0x5a377b)['send'](_0x25d5fd[_0xa035('0x31')][_0xa035('0x7e')]?{'message':_0xa035('0x80'),'statusCode':_0x28672e['statusCode']}:_0x28672e);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 904dbca..d64dfce 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 _0xd85d=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','lastIndexOf','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','application/x-www-form-urlencoded','parse','refreshToken','info','name','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','error','substring','then','refresh_token','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','catch','lodash'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xd85d,0x1eb));var _0xdd85=function(_0x3fe9f1,_0x5e9e37){_0x3fe9f1=_0x3fe9f1-0x0;var _0x470e40=_0xd85d[_0x3fe9f1];return _0x470e40;};'use strict';var _=require(_0xdd85('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdd85('0x1'));var moment=require('moment');var BPromise=require(_0xdd85('0x2'));var rp=require(_0xdd85('0x3'));var fs=require('fs');var path=require(_0xdd85('0x4'));var rimraf=require(_0xdd85('0x5'));var config=require(_0xdd85('0x6'));var attributes=require(_0xdd85('0x7'));var integrations=require(_0xdd85('0x8'));module['exports']=function(_0xc5b786,_0x3320bc){return _0xc5b786[_0xdd85('0x9')]('ZohoAccount',attributes,{'tableName':_0xdd85('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x666901,_0x13e631,_0x2d4006){if(_0x666901[_0xdd85('0xb')](_0xdd85('0xc'))||_0x666901[_0xdd85('0xb')](_0xdd85('0xd'))||_0x666901[_0xdd85('0xb')](_0xdd85('0xe'))||_0x666901[_0xdd85('0xb')](_0xdd85('0xf'))||_0x666901[_0xdd85('0xb')](_0xdd85('0x10'))||_0x666901[_0xdd85('0xb')](_0xdd85('0x11'))){var _0x51a952,_0x52e3ea;_0x51a952=_0x666901[_0xdd85('0xd')];var _0x144d3b=_0x51a952['slice'](-0x1);if(_0x144d3b==='/'||_0x144d3b==='\x5c'||_0x144d3b===':'){_0x51a952=_0x51a952['substring'](0x0,_0x51a952[_0xdd85('0x12')](_0x144d3b));}switch(_0x666901[_0xdd85('0xc')]){case'US':_0x52e3ea=_0xdd85('0x13');break;case'AU':_0x52e3ea=_0xdd85('0x14');break;case'IN':_0x52e3ea=_0xdd85('0x15');break;case'CN':_0x52e3ea=_0xdd85('0x16');break;default:_0x52e3ea=_0xdd85('0x17');break;}var _0x8e19e0={'method':_0xdd85('0x18'),'uri':_0x52e3ea+_0xdd85('0x19'),'form':{'grant_type':_0xdd85('0x1a'),'client_id':_0x666901[_0xdd85('0xe')],'client_secret':_0x666901[_0xdd85('0xf')],'redirect_uri':_0x666901[_0xdd85('0xd')],'code':_0x666901[_0xdd85('0x10')]},'headers':{'Content-Type':_0xdd85('0x1b')}};return rp(_0x8e19e0)['then'](function(_0x3b5c85){var _0x121cb4=JSON[_0xdd85('0x1c')](_0x3b5c85);if(_0x121cb4['refresh_token']){_0x666901[_0xdd85('0x1d')]=_0x121cb4['refresh_token'];logger[_0xdd85('0x1e')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x666901[_0xdd85('0x1f')],_0x666901['id']));}else{logger['error'](util[_0xdd85('0x20')](_0xdd85('0x21'),_0x666901[_0xdd85('0x1f')],_0x666901['id']),util[_0xdd85('0x22')](_0x121cb4,{'showHidden':![],'depth':null}));}return _0x2d4006(null,_0x13e631);})['catch'](function(_0x38b866){logger[_0xdd85('0x23')](util[_0xdd85('0x20')](_0xdd85('0x21'),_0x666901['name'],_0x666901['id']),util[_0xdd85('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x2d4006(_0x38b866);});}else{return _0x2d4006(null,_0x13e631);}},'beforeUpdate':function(_0x40d188,_0xc48d7,_0x4d7a03){if(_0x40d188[_0xdd85('0xb')]('zone')||_0x40d188[_0xdd85('0xb')](_0xdd85('0xd'))||_0x40d188[_0xdd85('0xb')]('clientId')||_0x40d188[_0xdd85('0xb')](_0xdd85('0xf'))||_0x40d188[_0xdd85('0xb')](_0xdd85('0x10'))||_0x40d188[_0xdd85('0xb')](_0xdd85('0x11'))){var _0x1ab8e1,_0x592e00;_0x1ab8e1=_0x40d188[_0xdd85('0xd')];var _0x4e1b70=_0x1ab8e1['slice'](-0x1);if(_0x4e1b70==='/'||_0x4e1b70==='\x5c'||_0x4e1b70===':'){_0x1ab8e1=_0x1ab8e1[_0xdd85('0x24')](0x0,_0x1ab8e1[_0xdd85('0x12')](_0x4e1b70));}switch(_0x40d188[_0xdd85('0xc')]){case'US':_0x592e00=_0xdd85('0x13');break;case'AU':_0x592e00='https://accounts.zoho.com.au';break;case'IN':_0x592e00='https://accounts.zoho.in';break;case'CN':_0x592e00=_0xdd85('0x16');break;default:_0x592e00='https://accounts.zoho.eu';break;}var _0x411487={'method':_0xdd85('0x18'),'uri':_0x592e00+_0xdd85('0x19'),'form':{'grant_type':_0xdd85('0x1a'),'client_id':_0x40d188[_0xdd85('0xe')],'client_secret':_0x40d188['clientSecret'],'redirect_uri':_0x40d188['serverUrl'],'code':_0x40d188[_0xdd85('0x10')]},'headers':{'Content-Type':_0xdd85('0x1b')}};return rp(_0x411487)[_0xdd85('0x25')](function(_0x3568b7){var _0x5dfbcc=JSON[_0xdd85('0x1c')](_0x3568b7);if(_0x5dfbcc[_0xdd85('0x26')]){_0x40d188[_0xdd85('0x1d')]=_0x5dfbcc[_0xdd85('0x26')];logger[_0xdd85('0x1e')](util['format'](_0xdd85('0x27'),_0x40d188[_0xdd85('0x1f')],_0x40d188['id']));}else{logger[_0xdd85('0x23')](util[_0xdd85('0x20')](_0xdd85('0x21'),_0x40d188[_0xdd85('0x1f')],_0x40d188['id']),util[_0xdd85('0x22')](_0x5dfbcc,{'showHidden':![],'depth':null}));}return _0x4d7a03(null,_0xc48d7);})[_0xdd85('0x28')](function(_0x3bfe16){logger['error'](util[_0xdd85('0x20')](_0xdd85('0x21'),_0x40d188[_0xdd85('0x1f')],_0x40d188['id']),util[_0xdd85('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x4d7a03(_0x3bfe16);});}else{return _0x4d7a03(null,_0xc48d7);}}}});}; \ No newline at end of file +var _0xda6b=['parse','error','inspect','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientId','code','serverUrl','slice','lastIndexOf','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','clientSecret','application/x-www-form-urlencoded','then','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','catch','host','substring'];(function(_0x5180c3,_0x4b35f7){var _0x55c975=function(_0x4746cb){while(--_0x4746cb){_0x5180c3['push'](_0x5180c3['shift']());}};_0x55c975(++_0x4b35f7);}(_0xda6b,0x137));var _0xbda6=function(_0x39dd2b,_0x4e4f78){_0x39dd2b=_0x39dd2b-0x0;var _0x1ffc82=_0xda6b[_0x39dd2b];return _0x1ffc82;};'use strict';var _=require(_0xbda6('0x0'));var util=require(_0xbda6('0x1'));var logger=require(_0xbda6('0x2'))(_0xbda6('0x3'));var moment=require(_0xbda6('0x4'));var BPromise=require(_0xbda6('0x5'));var rp=require(_0xbda6('0x6'));var fs=require('fs');var path=require(_0xbda6('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xbda6('0x8'));module[_0xbda6('0x9')]=function(_0x32e4c1,_0x59715c){return _0x32e4c1[_0xbda6('0xa')](_0xbda6('0xb'),attributes,{'tableName':_0xbda6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x17b1fe,_0x537632,_0x4f9128){if(_0x17b1fe[_0xbda6('0xd')](_0xbda6('0xe'))||_0x17b1fe[_0xbda6('0xd')]('serverUrl')||_0x17b1fe['changed'](_0xbda6('0xf'))||_0x17b1fe['changed']('clientSecret')||_0x17b1fe[_0xbda6('0xd')](_0xbda6('0x10'))||_0x17b1fe[_0xbda6('0xd')]('host')){var _0x3e31a6,_0x17e261;_0x3e31a6=_0x17b1fe[_0xbda6('0x11')];var _0x21412a=_0x3e31a6[_0xbda6('0x12')](-0x1);if(_0x21412a==='/'||_0x21412a==='\x5c'||_0x21412a===':'){_0x3e31a6=_0x3e31a6['substring'](0x0,_0x3e31a6[_0xbda6('0x13')](_0x21412a));}switch(_0x17b1fe[_0xbda6('0xe')]){case'US':_0x17e261=_0xbda6('0x14');break;case'AU':_0x17e261=_0xbda6('0x15');break;case'IN':_0x17e261=_0xbda6('0x16');break;case'CN':_0x17e261=_0xbda6('0x17');break;default:_0x17e261=_0xbda6('0x18');break;}var _0x30bb7a={'method':_0xbda6('0x19'),'uri':_0x17e261+_0xbda6('0x1a'),'form':{'grant_type':_0xbda6('0x1b'),'client_id':_0x17b1fe[_0xbda6('0xf')],'client_secret':_0x17b1fe[_0xbda6('0x1c')],'redirect_uri':_0x17b1fe['serverUrl'],'code':_0x17b1fe['code']},'headers':{'Content-Type':_0xbda6('0x1d')}};return rp(_0x30bb7a)[_0xbda6('0x1e')](function(_0x5eb87c){var _0x234a59=JSON['parse'](_0x5eb87c);if(_0x234a59[_0xbda6('0x1f')]){_0x17b1fe[_0xbda6('0x20')]=_0x234a59[_0xbda6('0x1f')];logger[_0xbda6('0x21')](util[_0xbda6('0x22')](_0xbda6('0x23'),_0x17b1fe[_0xbda6('0x24')],_0x17b1fe['id']));}else{logger['error'](util[_0xbda6('0x22')](_0xbda6('0x25'),_0x17b1fe[_0xbda6('0x24')],_0x17b1fe['id']),util['inspect'](_0x234a59,{'showHidden':![],'depth':null}));}return _0x4f9128(null,_0x537632);})[_0xbda6('0x26')](function(_0x22df13){logger['error'](util[_0xbda6('0x22')](_0xbda6('0x25'),_0x17b1fe[_0xbda6('0x24')],_0x17b1fe['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x4f9128(_0x22df13);});}else{return _0x4f9128(null,_0x537632);}},'beforeUpdate':function(_0x1a0e9b,_0x5d9b95,_0x32b2a1){if(_0x1a0e9b[_0xbda6('0xd')](_0xbda6('0xe'))||_0x1a0e9b[_0xbda6('0xd')](_0xbda6('0x11'))||_0x1a0e9b[_0xbda6('0xd')](_0xbda6('0xf'))||_0x1a0e9b[_0xbda6('0xd')](_0xbda6('0x1c'))||_0x1a0e9b['changed'](_0xbda6('0x10'))||_0x1a0e9b[_0xbda6('0xd')](_0xbda6('0x27'))){var _0x30e57d,_0x119b6a;_0x30e57d=_0x1a0e9b['serverUrl'];var _0x4f68f6=_0x30e57d[_0xbda6('0x12')](-0x1);if(_0x4f68f6==='/'||_0x4f68f6==='\x5c'||_0x4f68f6===':'){_0x30e57d=_0x30e57d[_0xbda6('0x28')](0x0,_0x30e57d['lastIndexOf'](_0x4f68f6));}switch(_0x1a0e9b[_0xbda6('0xe')]){case'US':_0x119b6a=_0xbda6('0x14');break;case'AU':_0x119b6a=_0xbda6('0x15');break;case'IN':_0x119b6a='https://accounts.zoho.in';break;case'CN':_0x119b6a=_0xbda6('0x17');break;default:_0x119b6a=_0xbda6('0x18');break;}var _0x5aa3a5={'method':_0xbda6('0x19'),'uri':_0x119b6a+'/oauth/v2/token','form':{'grant_type':_0xbda6('0x1b'),'client_id':_0x1a0e9b[_0xbda6('0xf')],'client_secret':_0x1a0e9b[_0xbda6('0x1c')],'redirect_uri':_0x1a0e9b['serverUrl'],'code':_0x1a0e9b['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x5aa3a5)[_0xbda6('0x1e')](function(_0x3149c9){var _0x43d8f9=JSON[_0xbda6('0x29')](_0x3149c9);if(_0x43d8f9['refresh_token']){_0x1a0e9b[_0xbda6('0x20')]=_0x43d8f9[_0xbda6('0x1f')];logger['info'](util['format'](_0xbda6('0x23'),_0x1a0e9b[_0xbda6('0x24')],_0x1a0e9b['id']));}else{logger[_0xbda6('0x2a')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1a0e9b['name'],_0x1a0e9b['id']),util['inspect'](_0x43d8f9,{'showHidden':![],'depth':null}));}return _0x32b2a1(null,_0x5d9b95);})[_0xbda6('0x26')](function(_0x19eabf){logger[_0xbda6('0x2a')](util[_0xbda6('0x22')](_0xbda6('0x25'),_0x1a0e9b['name'],_0x1a0e9b['id']),util[_0xbda6('0x2b')](parsedResult,{'showHidden':![],'depth':null}));return _0x32b2a1(_0x19eabf);});}else{return _0x32b2a1(null,_0x5d9b95);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index f0db044..3e92f03 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 _0x1967=['../../config/environment','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','limit','include','map','model','attributes','ShowZohoAccount','find','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x41e2fe,_0x33fee1){var _0x49893d=function(_0x197954){while(--_0x197954){_0x41e2fe['push'](_0x41e2fe['shift']());}};_0x49893d(++_0x33fee1);}(_0x1967,0x173));var _0x7196=function(_0x596e75,_0x4a1e6c){_0x596e75=_0x596e75-0x0;var _0x313de3=_0x1967[_0x596e75];return _0x313de3;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});}exports[_0x7196('0x18')]=function(_0x32fe2b){var _0x385f2d=this;return new Promise(function(_0x5b716a,_0x4c4f91){return db[_0x7196('0x19')][_0x7196('0x1a')]({'raw':_0x32fe2b[_0x7196('0x1b')]?_0x32fe2b['options'][_0x7196('0x1c')]===undefined?!![]:![]:!![],'where':_0x32fe2b['options']?_0x32fe2b['options'][_0x7196('0x1d')]||null:null,'attributes':_0x32fe2b[_0x7196('0x1b')]?_0x32fe2b[_0x7196('0x1b')]['attributes']||null:null,'limit':_0x32fe2b['options']?_0x32fe2b[_0x7196('0x1b')][_0x7196('0x1e')]||null:null,'include':_0x32fe2b['options']?_0x32fe2b[_0x7196('0x1b')][_0x7196('0x1f')]?_[_0x7196('0x20')](_0x32fe2b[_0x7196('0x1b')][_0x7196('0x1f')],function(_0x549f34){return{'model':db[_0x549f34[_0x7196('0x21')]],'as':_0x549f34['as'],'attributes':_0x549f34['attributes'],'include':_0x549f34[_0x7196('0x1f')]?_[_0x7196('0x20')](_0x549f34[_0x7196('0x1f')],function(_0xa69810){return{'model':db[_0xa69810[_0x7196('0x21')]],'as':_0xa69810['as'],'attributes':_0xa69810[_0x7196('0x22')],'include':_0xa69810['include']?_['map'](_0xa69810[_0x7196('0x1f')],function(_0x2d284f){return{'model':db[_0x2d284f[_0x7196('0x21')]],'as':_0x2d284f['as'],'attributes':_0x2d284f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x41cfd2){logger[_0x7196('0xe')](_0x7196('0x18'),_0x32fe2b);logger['debug'](_0x7196('0x18'),_0x32fe2b,JSON['stringify'](_0x41cfd2));_0x5b716a(_0x41cfd2);})[_0x7196('0x17')](function(_0x59d79d){logger[_0x7196('0x13')](_0x7196('0x18'),_0x59d79d[_0x7196('0x15')],_0x32fe2b);_0x4c4f91(_0x385f2d['error'](0x1f4,_0x59d79d[_0x7196('0x15')]));});});};exports[_0x7196('0x23')]=function(_0x2f9583){var _0xf999e9=this;return new Promise(function(_0x50c386,_0x39710d){return db[_0x7196('0x19')][_0x7196('0x24')]({'raw':_0x2f9583[_0x7196('0x1b')]?_0x2f9583[_0x7196('0x1b')][_0x7196('0x1c')]===undefined?!![]:![]:!![],'where':_0x2f9583[_0x7196('0x1b')]?_0x2f9583[_0x7196('0x1b')][_0x7196('0x1d')]||null:null,'attributes':_0x2f9583[_0x7196('0x1b')]?_0x2f9583[_0x7196('0x1b')]['attributes']||null:null,'include':_0x2f9583[_0x7196('0x1b')]?_0x2f9583['options'][_0x7196('0x1f')]?_['map'](_0x2f9583[_0x7196('0x1b')][_0x7196('0x1f')],function(_0x5616ed){return{'model':db[_0x5616ed[_0x7196('0x21')]],'as':_0x5616ed['as'],'attributes':_0x5616ed[_0x7196('0x22')],'include':_0x5616ed[_0x7196('0x1f')]?_[_0x7196('0x20')](_0x5616ed[_0x7196('0x1f')],function(_0x4a8580){return{'model':db[_0x4a8580[_0x7196('0x21')]],'as':_0x4a8580['as'],'attributes':_0x4a8580[_0x7196('0x22')],'include':_0x4a8580[_0x7196('0x1f')]?_[_0x7196('0x20')](_0x4a8580[_0x7196('0x1f')],function(_0x123cad){return{'model':db[_0x123cad['model']],'as':_0x123cad['as'],'attributes':_0x123cad[_0x7196('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7196('0xd')](function(_0x191df2){logger['info'](_0x7196('0x23'),_0x2f9583);logger[_0x7196('0x25')](_0x7196('0x23'),_0x2f9583,JSON[_0x7196('0x12')](_0x191df2));_0x50c386(_0x191df2);})[_0x7196('0x17')](function(_0x31fca7){logger[_0x7196('0x13')](_0x7196('0x23'),_0x31fca7[_0x7196('0x15')],_0x2f9583);_0x39710d(_0xf999e9[_0x7196('0x13')](0x1f4,_0x31fca7['message']));});});}; \ No newline at end of file +var _0xbe51=['result','catch','GetZohoAccount','options','raw','where','limit','include','map','model','attributes','ShowZohoAccount','ZohoAccount','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../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','info'];(function(_0x28e847,_0x37d150){var _0x2ff8e2=function(_0xfef875){while(--_0xfef875){_0x28e847['push'](_0x28e847['shift']());}};_0x2ff8e2(++_0x37d150);}(_0xbe51,0x1e2));var _0x1be5=function(_0x56bd54,_0x14ccad){_0x56bd54=_0x56bd54-0x0;var _0x51de08=_0xbe51[_0x56bd54];return _0x51de08;};'use strict';var _=require(_0x1be5('0x0'));var util=require(_0x1be5('0x1'));var moment=require('moment');var BPromise=require(_0x1be5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1be5('0x3'));var db=require(_0x1be5('0x4'))['db'];var utils=require(_0x1be5('0x5'));var logger=require(_0x1be5('0x6'))(_0x1be5('0x7'));var config=require(_0x1be5('0x8'));var jayson=require(_0x1be5('0x9'));var client=jayson[_0x1be5('0xa')][_0x1be5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13fa3e,_0xf4a39f,_0x49e05a){return new BPromise(function(_0x484d9b,_0x1171b0){return client['request'](_0x13fa3e,_0x49e05a)[_0x1be5('0xc')](function(_0x36c7c2){logger['info'](_0x1be5('0xd'),_0xf4a39f,_0x1be5('0xe'));logger[_0x1be5('0xf')](_0x1be5('0x10'),_0xf4a39f,_0x1be5('0xe'),JSON[_0x1be5('0x11')](_0x36c7c2));if(_0x36c7c2[_0x1be5('0x12')]){if(_0x36c7c2['error'][_0x1be5('0x13')]===0x1f4){logger['error'](_0x1be5('0xd'),_0xf4a39f,_0x36c7c2[_0x1be5('0x12')][_0x1be5('0x14')]);return _0x1171b0(_0x36c7c2['error'][_0x1be5('0x14')]);}logger['error'](_0x1be5('0xd'),_0xf4a39f,_0x36c7c2[_0x1be5('0x12')][_0x1be5('0x14')]);return _0x484d9b(_0x36c7c2[_0x1be5('0x12')][_0x1be5('0x14')]);}else{logger[_0x1be5('0x15')](_0x1be5('0xd'),_0xf4a39f,'request\x20sent');_0x484d9b(_0x36c7c2[_0x1be5('0x16')][_0x1be5('0x14')]);}})[_0x1be5('0x17')](function(_0x3ca2b5){logger[_0x1be5('0x12')](_0x1be5('0xd'),_0xf4a39f,_0x3ca2b5);_0x1171b0(_0x3ca2b5);});});}exports[_0x1be5('0x18')]=function(_0x3a1fe3){var _0x4e777a=this;return new Promise(function(_0x3020fc,_0x33cf5d){return db['ZohoAccount']['findAll']({'raw':_0x3a1fe3['options']?_0x3a1fe3[_0x1be5('0x19')][_0x1be5('0x1a')]===undefined?!![]:![]:!![],'where':_0x3a1fe3[_0x1be5('0x19')]?_0x3a1fe3[_0x1be5('0x19')][_0x1be5('0x1b')]||null:null,'attributes':_0x3a1fe3['options']?_0x3a1fe3[_0x1be5('0x19')]['attributes']||null:null,'limit':_0x3a1fe3['options']?_0x3a1fe3[_0x1be5('0x19')][_0x1be5('0x1c')]||null:null,'include':_0x3a1fe3[_0x1be5('0x19')]?_0x3a1fe3[_0x1be5('0x19')][_0x1be5('0x1d')]?_[_0x1be5('0x1e')](_0x3a1fe3[_0x1be5('0x19')][_0x1be5('0x1d')],function(_0x4f4db0){return{'model':db[_0x4f4db0[_0x1be5('0x1f')]],'as':_0x4f4db0['as'],'attributes':_0x4f4db0[_0x1be5('0x20')],'include':_0x4f4db0[_0x1be5('0x1d')]?_[_0x1be5('0x1e')](_0x4f4db0[_0x1be5('0x1d')],function(_0x162e7c){return{'model':db[_0x162e7c[_0x1be5('0x1f')]],'as':_0x162e7c['as'],'attributes':_0x162e7c[_0x1be5('0x20')],'include':_0x162e7c['include']?_[_0x1be5('0x1e')](_0x162e7c['include'],function(_0x3b9ddb){return{'model':db[_0x3b9ddb[_0x1be5('0x1f')]],'as':_0x3b9ddb['as'],'attributes':_0x3b9ddb[_0x1be5('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1be5('0xc')](function(_0x59beb3){logger[_0x1be5('0x15')](_0x1be5('0x18'),_0x3a1fe3);logger[_0x1be5('0xf')](_0x1be5('0x18'),_0x3a1fe3,JSON[_0x1be5('0x11')](_0x59beb3));_0x3020fc(_0x59beb3);})['catch'](function(_0x39abb8){logger[_0x1be5('0x12')](_0x1be5('0x18'),_0x39abb8[_0x1be5('0x14')],_0x3a1fe3);_0x33cf5d(_0x4e777a[_0x1be5('0x12')](0x1f4,_0x39abb8['message']));});});};exports[_0x1be5('0x21')]=function(_0x303f6f){var _0x9fbfa9=this;return new Promise(function(_0x3ab053,_0x58685b){return db[_0x1be5('0x22')][_0x1be5('0x23')]({'raw':_0x303f6f['options']?_0x303f6f[_0x1be5('0x19')][_0x1be5('0x1a')]===undefined?!![]:![]:!![],'where':_0x303f6f['options']?_0x303f6f['options'][_0x1be5('0x1b')]||null:null,'attributes':_0x303f6f[_0x1be5('0x19')]?_0x303f6f[_0x1be5('0x19')][_0x1be5('0x20')]||null:null,'include':_0x303f6f['options']?_0x303f6f[_0x1be5('0x19')][_0x1be5('0x1d')]?_[_0x1be5('0x1e')](_0x303f6f[_0x1be5('0x19')][_0x1be5('0x1d')],function(_0x5b5f17){return{'model':db[_0x5b5f17[_0x1be5('0x1f')]],'as':_0x5b5f17['as'],'attributes':_0x5b5f17[_0x1be5('0x20')],'include':_0x5b5f17['include']?_[_0x1be5('0x1e')](_0x5b5f17['include'],function(_0x4d5e55){return{'model':db[_0x4d5e55[_0x1be5('0x1f')]],'as':_0x4d5e55['as'],'attributes':_0x4d5e55[_0x1be5('0x20')],'include':_0x4d5e55[_0x1be5('0x1d')]?_['map'](_0x4d5e55[_0x1be5('0x1d')],function(_0x5e030f){return{'model':db[_0x5e030f[_0x1be5('0x1f')]],'as':_0x5e030f['as'],'attributes':_0x5e030f[_0x1be5('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1be5('0xc')](function(_0x783680){logger['info'](_0x1be5('0x21'),_0x303f6f);logger[_0x1be5('0xf')](_0x1be5('0x21'),_0x303f6f,JSON[_0x1be5('0x11')](_0x783680));_0x3ab053(_0x783680);})[_0x1be5('0x17')](function(_0x10eb63){logger[_0x1be5('0x12')](_0x1be5('0x21'),_0x10eb63[_0x1be5('0x14')],_0x303f6f);_0x58685b(_0x9fbfa9['error'](0x1f4,_0x10eb63['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 26ff971..1b4ef4d 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 _0x45e5=['connect-timeout','express','Router','fs-extra','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','create','put','delete','exports','path'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0x45e5,0x12b));var _0x545e=function(_0x357f8e,_0x3ee5bf){_0x357f8e=_0x357f8e-0x0;var _0x53204a=_0x45e5[_0x357f8e];return _0x53204a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x545e('0x0'));var timeout=require(_0x545e('0x1'));var express=require(_0x545e('0x2'));var router=express[_0x545e('0x3')]();var fs_extra=require(_0x545e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x545e('0x5'));var controller=require(_0x545e('0x6'));router[_0x545e('0x7')]('/',auth[_0x545e('0x8')](),controller[_0x545e('0x9')]);router[_0x545e('0x7')](_0x545e('0xa'),auth['isAuthenticated'](),controller[_0x545e('0xb')]);router['get'](_0x545e('0xc'),auth[_0x545e('0x8')](),controller[_0x545e('0xd')]);router[_0x545e('0x7')]('/:id/subjects',auth[_0x545e('0x8')](),controller[_0x545e('0xe')]);router[_0x545e('0x7')](_0x545e('0xf'),auth[_0x545e('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x545e('0x8')](),controller[_0x545e('0x10')]);router[_0x545e('0x11')]('/:id',auth[_0x545e('0x8')](),controller['update']);router[_0x545e('0x12')](_0x545e('0xa'),auth[_0x545e('0x8')](),controller['destroy']);module[_0x545e('0x13')]=router; \ No newline at end of file +var _0xafd5=['update','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0xec2241,_0x453d5c){var _0x201e24=function(_0x3988a5){while(--_0x3988a5){_0xec2241['push'](_0xec2241['shift']());}};_0x201e24(++_0x453d5c);}(_0xafd5,0x116));var _0x5afd=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0xafd5[_0x2dbce7];return _0x3a3ed0;};'use strict';var multer=require(_0x5afd('0x0'));var util=require(_0x5afd('0x1'));var path=require('path');var timeout=require(_0x5afd('0x2'));var express=require(_0x5afd('0x3'));var router=express['Router']();var fs_extra=require(_0x5afd('0x4'));var auth=require(_0x5afd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5afd('0x6'));var controller=require(_0x5afd('0x7'));router[_0x5afd('0x8')]('/',auth[_0x5afd('0x9')](),controller[_0x5afd('0xa')]);router[_0x5afd('0x8')](_0x5afd('0xb'),auth[_0x5afd('0x9')](),controller[_0x5afd('0xc')]);router[_0x5afd('0x8')](_0x5afd('0xd'),auth[_0x5afd('0x9')](),controller['getFields']);router[_0x5afd('0x8')](_0x5afd('0xe'),auth[_0x5afd('0x9')](),controller[_0x5afd('0xf')]);router['get'](_0x5afd('0x10'),auth[_0x5afd('0x9')](),controller[_0x5afd('0x11')]);router[_0x5afd('0x12')]('/',auth[_0x5afd('0x9')](),controller[_0x5afd('0x13')]);router[_0x5afd('0x14')](_0x5afd('0xb'),auth[_0x5afd('0x9')](),controller[_0x5afd('0x15')]);router['delete'](_0x5afd('0xb'),auth['isAuthenticated'](),controller[_0x5afd('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 761fb05..afa878f 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 _0xb358=['lead','ENUM','contact_lead','exports','STRING','contact','nothing'];(function(_0x3a8991,_0x57bab4){var _0x2a1fb3=function(_0x104f74){while(--_0x104f74){_0x3a8991['push'](_0x3a8991['shift']());}};_0x2a1fb3(++_0x57bab4);}(_0xb358,0x1b5));var _0x8b35=function(_0x47d47a,_0x1061fb){_0x47d47a=_0x47d47a-0x0;var _0x1f37ed=_0xb358[_0x47d47a];return _0x1f37ed;};'use strict';var Sequelize=require('sequelize');module[_0x8b35('0x0')]={'name':{'type':Sequelize[_0x8b35('0x1')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0x8b35('0x2'),_0x8b35('0x3')),'defaultValue':_0x8b35('0x4')},'moduleSearch':{'type':Sequelize[_0x8b35('0x5')](_0x8b35('0x6'),_0x8b35('0x2'),_0x8b35('0x4')),'defaultValue':_0x8b35('0x6')},'description':{'type':Sequelize[_0x8b35('0x1')]}}; \ No newline at end of file +var _0xc80f=['STRING','ENUM','lead','contact','nothing','contact_lead','sequelize','exports'];(function(_0x4f0ba8,_0x40294e){var _0x5bc34d=function(_0x564e14){while(--_0x564e14){_0x4f0ba8['push'](_0x4f0ba8['shift']());}};_0x5bc34d(++_0x40294e);}(_0xc80f,0x7e));var _0xfc80=function(_0x443f51,_0x3e2f6d){_0x443f51=_0x443f51-0x0;var _0x2b8695=_0xc80f[_0x443f51];return _0x2b8695;};'use strict';var Sequelize=require(_0xfc80('0x0'));module[_0xfc80('0x1')]={'name':{'type':Sequelize[_0xfc80('0x2')]},'moduleCreate':{'type':Sequelize[_0xfc80('0x3')](_0xfc80('0x4'),_0xfc80('0x5'),_0xfc80('0x6')),'defaultValue':_0xfc80('0x4')},'moduleSearch':{'type':Sequelize[_0xfc80('0x3')](_0xfc80('0x7'),_0xfc80('0x5'),_0xfc80('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xfc80('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index e7a2c70..19a6239 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 _0x12ab=['getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','count','offset','set','Content-Range','reject','update','then','stack','name','send','map','ZohoConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','where','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','rawAttributes','length','include','create','body','find','destroy','getFields','findOne','ZohoField','sort','pick','nolimit'];(function(_0x125287,_0x2cfaeb){var _0x2ac164=function(_0x4c32c1){while(--_0x4c32c1){_0x125287['push'](_0x125287['shift']());}};_0x2ac164(++_0x2cfaeb);}(_0x12ab,0x1d0));var _0xb12a=function(_0x20cb69,_0x4913c4){_0x20cb69=_0x20cb69-0x0;var _0x3b9ef8=_0x12ab[_0x20cb69];return _0x3b9ef8;};'use strict';var emlformat=require(_0xb12a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb12a('0x1'));var jsonpatch=require(_0xb12a('0x2'));var rp=require(_0xb12a('0x3'));var moment=require(_0xb12a('0x4'));var BPromise=require(_0xb12a('0x5'));var Mustache=require(_0xb12a('0x6'));var util=require(_0xb12a('0x7'));var path=require(_0xb12a('0x8'));var sox=require(_0xb12a('0x9'));var csv=require(_0xb12a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb12a('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb12a('0xc'));var deskjs=require(_0xb12a('0xd'));var toCsv=require(_0xb12a('0xa'));var querystring=require(_0xb12a('0xe'));var Papa=require('papaparse');var Redis=require(_0xb12a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb12a('0x10'));var as=require(_0xb12a('0x11'));var hardwareService=require(_0xb12a('0x12'));var logger=require(_0xb12a('0x13'))(_0xb12a('0x14'));var utils=require('../../config/utils');var config=require(_0xb12a('0x15'));var licenseUtil=require(_0xb12a('0x16'));var db=require(_0xb12a('0x17'))['db'];function respondWithStatusCode(_0x2b73ec,_0x5e7771){_0x5e7771=_0x5e7771||0xcc;return function(_0xb7f0d8){if(_0xb7f0d8){return _0x2b73ec[_0xb12a('0x18')](_0x5e7771);}return _0x2b73ec['status'](_0x5e7771)[_0xb12a('0x19')]();};}function respondWithResult(_0x25d3f5,_0x4eac9a){_0x4eac9a=_0x4eac9a||0xc8;return function(_0x5931f9){if(_0x5931f9){return _0x25d3f5[_0xb12a('0x1a')](_0x4eac9a)['json'](_0x5931f9);}};}function respondWithFilteredResult(_0x37060a,_0x17ba93){return function(_0x15277d){if(_0x15277d){var _0x22df99=typeof _0x17ba93['offset']==='undefined'&&typeof _0x17ba93[_0xb12a('0x1b')]==='undefined';var _0x48ea70=_0x15277d[_0xb12a('0x1c')];var _0x4a02ce=_0x22df99?0x0:_0x17ba93[_0xb12a('0x1d')];var _0x1a69b1=_0x22df99?_0x15277d[_0xb12a('0x1c')]:_0x17ba93[_0xb12a('0x1d')]+_0x17ba93['limit'];var _0x350503;if(_0x1a69b1>=_0x48ea70){_0x1a69b1=_0x48ea70;_0x350503=0xc8;}else{_0x350503=0xce;}_0x37060a['status'](_0x350503);return _0x37060a[_0xb12a('0x1e')](_0xb12a('0x1f'),_0x4a02ce+'-'+_0x1a69b1+'/'+_0x48ea70)['json'](_0x15277d);}return null;};}function patchUpdates(_0x34339a){return function(_0x1495aa){try{jsonpatch['apply'](_0x1495aa,_0x34339a,!![]);}catch(_0xb48f57){return BPromise[_0xb12a('0x20')](_0xb48f57);}return _0x1495aa['save']();};}function saveUpdates(_0x28a50b,_0x3d5520){return function(_0xe9f716){if(_0xe9f716){return _0xe9f716[_0xb12a('0x21')](_0x28a50b)[_0xb12a('0x22')](function(_0x27a601){return _0x27a601;});}return null;};}function removeEntity(_0xdfe799,_0x497447){return function(_0x526389){if(_0x526389){return _0x526389['destroy']()['then'](function(){_0xdfe799['status'](0xcc)[_0xb12a('0x19')]();});}};}function handleEntityNotFound(_0x4f2957,_0x20a6fd){return function(_0x501ca3){if(!_0x501ca3){_0x4f2957['sendStatus'](0x194);}return _0x501ca3;};}function handleError(_0x407daf,_0x13c852){_0x13c852=_0x13c852||0x1f4;return function(_0x1e2fb8){logger['error'](_0x1e2fb8[_0xb12a('0x23')]);if(_0x1e2fb8[_0xb12a('0x24')]){delete _0x1e2fb8[_0xb12a('0x24')];}_0x407daf[_0xb12a('0x1a')](_0x13c852)[_0xb12a('0x25')](_0x1e2fb8);};}exports['index']=function(_0x583e57,_0x60bf12){var _0x2d5a65={},_0x926895={},_0xbd9160={'count':0x0,'rows':[]};var _0xb8e549=_[_0xb12a('0x26')](db[_0xb12a('0x27')]['rawAttributes'],function(_0x3545cf){return{'name':_0x3545cf[_0xb12a('0x28')],'type':_0x3545cf[_0xb12a('0x29')][_0xb12a('0x2a')]};});_0x926895[_0xb12a('0x2b')]=_['map'](_0xb8e549,_0xb12a('0x24'));_0x926895[_0xb12a('0x2c')]=_[_0xb12a('0x2d')](_0x583e57[_0xb12a('0x2c')]);_0x926895[_0xb12a('0x2e')]=_[_0xb12a('0x2f')](_0x926895[_0xb12a('0x2b')],_0x926895[_0xb12a('0x2c')]);_0x2d5a65[_0xb12a('0x30')]=_[_0xb12a('0x2f')](_0x926895[_0xb12a('0x2b')],qs['fields'](_0x583e57[_0xb12a('0x2c')][_0xb12a('0x31')]));_0x2d5a65[_0xb12a('0x30')]=_0x2d5a65[_0xb12a('0x30')]['length']?_0x2d5a65['attributes']:_0x926895[_0xb12a('0x2b')];if(!_0x583e57[_0xb12a('0x2c')][_0xb12a('0x32')]('nolimit')){_0x2d5a65['limit']=qs[_0xb12a('0x1b')](_0x583e57['query'][_0xb12a('0x1b')]);_0x2d5a65['offset']=qs['offset'](_0x583e57['query'][_0xb12a('0x1d')]);}_0x2d5a65[_0xb12a('0x33')]=qs['sort'](_0x583e57[_0xb12a('0x2c')]['sort']);_0x2d5a65['where']=qs['filters'](_['pick'](_0x583e57[_0xb12a('0x2c')],_0x926895[_0xb12a('0x2e')]),_0xb8e549);if(_0x583e57[_0xb12a('0x2c')]['filter']){_0x2d5a65[_0xb12a('0x34')]=_[_0xb12a('0x35')](_0x2d5a65['where'],{'$or':_[_0xb12a('0x26')](_0xb8e549,function(_0x561617){if(_0x561617[_0xb12a('0x29')]!==_0xb12a('0x36')){var _0x558016={};_0x558016[_0x561617['name']]={'$like':'%'+_0x583e57[_0xb12a('0x2c')][_0xb12a('0x37')]+'%'};return _0x558016;}})});}_0x2d5a65=_[_0xb12a('0x35')]({},_0x2d5a65,_0x583e57[_0xb12a('0x38')]);var _0x3749cd={'where':_0x2d5a65[_0xb12a('0x34')]};return db['ZohoConfiguration']['count'](_0x3749cd)[_0xb12a('0x22')](function(_0x56a669){_0xbd9160[_0xb12a('0x1c')]=_0x56a669;if(_0x583e57[_0xb12a('0x2c')][_0xb12a('0x39')]){_0x2d5a65['include']=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x2d5a65);})['then'](function(_0x348c18){_0xbd9160[_0xb12a('0x3a')]=_0x348c18;return _0xbd9160;})[_0xb12a('0x22')](respondWithFilteredResult(_0x60bf12,_0x2d5a65))[_0xb12a('0x3b')](handleError(_0x60bf12,null));};exports[_0xb12a('0x3c')]=function(_0x4a4ae0,_0x9a90ce){var _0x1cf690={'raw':![],'where':{'id':_0x4a4ae0[_0xb12a('0x3d')]['id']}},_0x538f54={};_0x538f54[_0xb12a('0x2b')]=_[_0xb12a('0x2d')](db['ZohoConfiguration'][_0xb12a('0x3e')]);_0x538f54[_0xb12a('0x2c')]=_[_0xb12a('0x2d')](_0x4a4ae0[_0xb12a('0x2c')]);_0x538f54['filters']=_[_0xb12a('0x2f')](_0x538f54[_0xb12a('0x2b')],_0x538f54[_0xb12a('0x2c')]);_0x1cf690[_0xb12a('0x30')]=_[_0xb12a('0x2f')](_0x538f54['model'],qs[_0xb12a('0x31')](_0x4a4ae0['query'][_0xb12a('0x31')]));_0x1cf690[_0xb12a('0x30')]=_0x1cf690[_0xb12a('0x30')][_0xb12a('0x3f')]?_0x1cf690['attributes']:_0x538f54[_0xb12a('0x2b')];if(_0x4a4ae0[_0xb12a('0x2c')][_0xb12a('0x39')]){_0x1cf690[_0xb12a('0x40')]=[{'all':!![]}];}_0x1cf690=_[_0xb12a('0x35')]({},_0x1cf690,_0x4a4ae0[_0xb12a('0x38')]);return db['ZohoConfiguration']['find'](_0x1cf690)[_0xb12a('0x22')](handleEntityNotFound(_0x9a90ce,null))['then'](respondWithResult(_0x9a90ce,null))[_0xb12a('0x3b')](handleError(_0x9a90ce,null));};exports['create']=function(_0x453f2d,_0x41a12b){return db['ZohoConfiguration'][_0xb12a('0x41')](_0x453f2d[_0xb12a('0x42')],{})[_0xb12a('0x22')](respondWithResult(_0x41a12b,0xc9))[_0xb12a('0x3b')](handleError(_0x41a12b,null));};exports['update']=function(_0x37d7d2,_0x9dfa59){if(_0x37d7d2[_0xb12a('0x42')]['id']){delete _0x37d7d2[_0xb12a('0x42')]['id'];}return db[_0xb12a('0x27')][_0xb12a('0x43')]({'where':{'id':_0x37d7d2[_0xb12a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x9dfa59,null))[_0xb12a('0x22')](saveUpdates(_0x37d7d2['body'],null))['then'](respondWithResult(_0x9dfa59,null))[_0xb12a('0x3b')](handleError(_0x9dfa59,null));};exports[_0xb12a('0x44')]=function(_0x4910d9,_0x1a48da){return db[_0xb12a('0x27')][_0xb12a('0x43')]({'where':{'id':_0x4910d9[_0xb12a('0x3d')]['id']}})[_0xb12a('0x22')](handleEntityNotFound(_0x1a48da,null))['then'](removeEntity(_0x1a48da,null))[_0xb12a('0x3b')](handleError(_0x1a48da,null));};exports[_0xb12a('0x45')]=function(_0x362a64,_0x380cfe,_0x3e0789){var _0x56d004={};var _0x39c3b8={};var _0x33e7ee;var _0x127711;return db[_0xb12a('0x27')][_0xb12a('0x46')]({'where':{'id':_0x362a64[_0xb12a('0x3d')]['id']}})[_0xb12a('0x22')](handleEntityNotFound(_0x380cfe,null))[_0xb12a('0x22')](function(_0xb60f25){if(_0xb60f25){_0x33e7ee=_0xb60f25;_0x39c3b8[_0xb12a('0x2b')]=_['keys'](db[_0xb12a('0x47')][_0xb12a('0x3e')]);_0x39c3b8['query']=_[_0xb12a('0x2d')](_0x362a64[_0xb12a('0x2c')]);_0x39c3b8[_0xb12a('0x2e')]=_['intersection'](_0x39c3b8[_0xb12a('0x2b')],_0x39c3b8['query']);_0x56d004['attributes']=_[_0xb12a('0x2f')](_0x39c3b8['model'],qs[_0xb12a('0x31')](_0x362a64[_0xb12a('0x2c')][_0xb12a('0x31')]));_0x56d004[_0xb12a('0x30')]=_0x56d004[_0xb12a('0x30')][_0xb12a('0x3f')]?_0x56d004[_0xb12a('0x30')]:_0x39c3b8[_0xb12a('0x2b')];_0x56d004['order']=qs[_0xb12a('0x48')](_0x362a64[_0xb12a('0x2c')][_0xb12a('0x48')]);_0x56d004[_0xb12a('0x34')]=qs[_0xb12a('0x2e')](_[_0xb12a('0x49')](_0x362a64[_0xb12a('0x2c')],_0x39c3b8['filters']));if(_0x362a64[_0xb12a('0x2c')][_0xb12a('0x37')]){_0x56d004[_0xb12a('0x34')]=_[_0xb12a('0x35')](_0x56d004[_0xb12a('0x34')],{'$or':_[_0xb12a('0x26')](_0x56d004[_0xb12a('0x30')],function(_0x23e12e){var _0x5a1917={};_0x5a1917[_0x23e12e]={'$like':'%'+_0x362a64['query']['filter']+'%'};return _0x5a1917;})});}_0x56d004=_[_0xb12a('0x35')]({},_0x56d004,_0x362a64[_0xb12a('0x38')]);return _0x33e7ee[_0xb12a('0x45')](_0x56d004);}})[_0xb12a('0x22')](function(_0x231d46){if(_0x231d46){_0x127711=_0x231d46['length'];if(!_0x362a64['query'][_0xb12a('0x32')](_0xb12a('0x4a'))){_0x56d004[_0xb12a('0x1b')]=qs['limit'](_0x362a64[_0xb12a('0x2c')]['limit']);_0x56d004['offset']=qs[_0xb12a('0x1d')](_0x362a64['query']['offset']);}return _0x33e7ee['getFields'](_0x56d004);}})['then'](function(_0x4a58d7){if(_0x4a58d7){return _0x4a58d7?{'count':_0x127711,'rows':_0x4a58d7}:null;}})['then'](respondWithResult(_0x380cfe,null))[_0xb12a('0x3b')](handleError(_0x380cfe,null));};exports[_0xb12a('0x4b')]=function(_0x5b787c,_0x4655d2,_0x5c815c){var _0x482354={};var _0x3bba70={};var _0x415c88;var _0xe43bca;return db[_0xb12a('0x27')][_0xb12a('0x46')]({'where':{'id':_0x5b787c[_0xb12a('0x3d')]['id']}})[_0xb12a('0x22')](handleEntityNotFound(_0x4655d2,null))['then'](function(_0x22f467){if(_0x22f467){_0x415c88=_0x22f467;_0x3bba70[_0xb12a('0x2b')]=_['keys'](db[_0xb12a('0x47')][_0xb12a('0x3e')]);_0x3bba70[_0xb12a('0x2c')]=_['keys'](_0x5b787c[_0xb12a('0x2c')]);_0x3bba70[_0xb12a('0x2e')]=_[_0xb12a('0x2f')](_0x3bba70[_0xb12a('0x2b')],_0x3bba70['query']);_0x482354[_0xb12a('0x30')]=_['intersection'](_0x3bba70[_0xb12a('0x2b')],qs[_0xb12a('0x31')](_0x5b787c['query']['fields']));_0x482354['attributes']=_0x482354[_0xb12a('0x30')]['length']?_0x482354[_0xb12a('0x30')]:_0x3bba70['model'];_0x482354[_0xb12a('0x33')]=qs[_0xb12a('0x48')](_0x5b787c[_0xb12a('0x2c')][_0xb12a('0x48')]);_0x482354[_0xb12a('0x34')]=qs[_0xb12a('0x2e')](_[_0xb12a('0x49')](_0x5b787c[_0xb12a('0x2c')],_0x3bba70[_0xb12a('0x2e')]));if(_0x5b787c[_0xb12a('0x2c')][_0xb12a('0x37')]){_0x482354[_0xb12a('0x34')]=_['merge'](_0x482354[_0xb12a('0x34')],{'$or':_[_0xb12a('0x26')](_0x482354[_0xb12a('0x30')],function(_0x260122){var _0x4324c8={};_0x4324c8[_0x260122]={'$like':'%'+_0x5b787c[_0xb12a('0x2c')]['filter']+'%'};return _0x4324c8;})});}_0x482354=_[_0xb12a('0x35')]({},_0x482354,_0x5b787c[_0xb12a('0x38')]);return _0x415c88['getSubjects'](_0x482354);}})[_0xb12a('0x22')](function(_0x4a67e5){if(_0x4a67e5){_0xe43bca=_0x4a67e5[_0xb12a('0x3f')];if(!_0x5b787c[_0xb12a('0x2c')]['hasOwnProperty'](_0xb12a('0x4a'))){_0x482354[_0xb12a('0x1b')]=qs[_0xb12a('0x1b')](_0x5b787c[_0xb12a('0x2c')][_0xb12a('0x1b')]);_0x482354[_0xb12a('0x1d')]=qs[_0xb12a('0x1d')](_0x5b787c[_0xb12a('0x2c')]['offset']);}return _0x415c88['getSubjects'](_0x482354);}})['then'](function(_0x1aaefb){if(_0x1aaefb){return _0x1aaefb?{'count':_0xe43bca,'rows':_0x1aaefb}:null;}})[_0xb12a('0x22')](respondWithResult(_0x4655d2,null))['catch'](handleError(_0x4655d2,null));};exports[_0xb12a('0x4c')]=function(_0x2ae714,_0x2bee3d,_0x133ae6){var _0x3b2ad4={};var _0x23c1a6={};var _0xfdb175;var _0xd43499;return db['ZohoConfiguration'][_0xb12a('0x46')]({'where':{'id':_0x2ae714[_0xb12a('0x3d')]['id']}})[_0xb12a('0x22')](handleEntityNotFound(_0x2bee3d,null))[_0xb12a('0x22')](function(_0x173471){if(_0x173471){_0xfdb175=_0x173471;_0x23c1a6[_0xb12a('0x2b')]=_['keys'](db[_0xb12a('0x47')][_0xb12a('0x3e')]);_0x23c1a6['query']=_[_0xb12a('0x2d')](_0x2ae714[_0xb12a('0x2c')]);_0x23c1a6[_0xb12a('0x2e')]=_[_0xb12a('0x2f')](_0x23c1a6['model'],_0x23c1a6[_0xb12a('0x2c')]);_0x3b2ad4[_0xb12a('0x30')]=_['intersection'](_0x23c1a6['model'],qs['fields'](_0x2ae714[_0xb12a('0x2c')][_0xb12a('0x31')]));_0x3b2ad4[_0xb12a('0x30')]=_0x3b2ad4[_0xb12a('0x30')][_0xb12a('0x3f')]?_0x3b2ad4[_0xb12a('0x30')]:_0x23c1a6[_0xb12a('0x2b')];_0x3b2ad4[_0xb12a('0x33')]=qs[_0xb12a('0x48')](_0x2ae714[_0xb12a('0x2c')][_0xb12a('0x48')]);_0x3b2ad4[_0xb12a('0x34')]=qs[_0xb12a('0x2e')](_['pick'](_0x2ae714[_0xb12a('0x2c')],_0x23c1a6['filters']));if(_0x2ae714['query'][_0xb12a('0x37')]){_0x3b2ad4[_0xb12a('0x34')]=_[_0xb12a('0x35')](_0x3b2ad4[_0xb12a('0x34')],{'$or':_[_0xb12a('0x26')](_0x3b2ad4[_0xb12a('0x30')],function(_0x16e0d2){var _0xb8f9ec={};_0xb8f9ec[_0x16e0d2]={'$like':'%'+_0x2ae714[_0xb12a('0x2c')]['filter']+'%'};return _0xb8f9ec;})});}_0x3b2ad4=_[_0xb12a('0x35')]({},_0x3b2ad4,_0x2ae714[_0xb12a('0x38')]);return _0xfdb175[_0xb12a('0x4c')](_0x3b2ad4);}})['then'](function(_0x252b2f){if(_0x252b2f){_0xd43499=_0x252b2f[_0xb12a('0x3f')];if(!_0x2ae714['query']['hasOwnProperty']('nolimit')){_0x3b2ad4[_0xb12a('0x1b')]=qs[_0xb12a('0x1b')](_0x2ae714[_0xb12a('0x2c')][_0xb12a('0x1b')]);_0x3b2ad4[_0xb12a('0x1d')]=qs[_0xb12a('0x1d')](_0x2ae714['query'][_0xb12a('0x1d')]);}return _0xfdb175[_0xb12a('0x4c')](_0x3b2ad4);}})[_0xb12a('0x22')](function(_0x3d0af9){if(_0x3d0af9){return _0x3d0af9?{'count':_0xd43499,'rows':_0x3d0af9}:null;}})[_0xb12a('0x22')](respondWithResult(_0x2bee3d,null))[_0xb12a('0x3b')](handleError(_0x2bee3d,null));}; \ No newline at end of file +var _0x37f1=['moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','stack','map','ZohoConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','sort','filters','pick','where','name','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','getFields','findOne','ZohoField','hasOwnProperty','getSubjects','order','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x528bb5,_0x119c5b){var _0x58e8ca=function(_0x5a8077){while(--_0x5a8077){_0x528bb5['push'](_0x528bb5['shift']());}};_0x58e8ca(++_0x119c5b);}(_0x37f1,0x140));var _0x137f=function(_0x1a60b2,_0x11f540){_0x1a60b2=_0x1a60b2-0x0;var _0x5903c4=_0x37f1[_0x1a60b2];return _0x5903c4;};'use strict';var emlformat=require(_0x137f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x137f('0x1'));var jsonpatch=require(_0x137f('0x2'));var rp=require(_0x137f('0x3'));var moment=require(_0x137f('0x4'));var BPromise=require(_0x137f('0x5'));var Mustache=require(_0x137f('0x6'));var util=require(_0x137f('0x7'));var path=require(_0x137f('0x8'));var sox=require(_0x137f('0x9'));var csv=require('to-csv');var ejs=require(_0x137f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x137f('0xb'));var squel=require(_0x137f('0xc'));var crypto=require(_0x137f('0xd'));var jsforce=require(_0x137f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x137f('0xf'));var querystring=require(_0x137f('0x10'));var Papa=require(_0x137f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x137f('0x12'));var as=require(_0x137f('0x13'));var hardwareService=require(_0x137f('0x14'));var logger=require(_0x137f('0x15'))('api');var utils=require(_0x137f('0x16'));var config=require(_0x137f('0x17'));var licenseUtil=require(_0x137f('0x18'));var db=require(_0x137f('0x19'))['db'];function respondWithStatusCode(_0xc5b44b,_0x3c8b83){_0x3c8b83=_0x3c8b83||0xcc;return function(_0x24208f){if(_0x24208f){return _0xc5b44b[_0x137f('0x1a')](_0x3c8b83);}return _0xc5b44b[_0x137f('0x1b')](_0x3c8b83)[_0x137f('0x1c')]();};}function respondWithResult(_0x779495,_0x50c27d){_0x50c27d=_0x50c27d||0xc8;return function(_0x5d3e71){if(_0x5d3e71){return _0x779495['status'](_0x50c27d)[_0x137f('0x1d')](_0x5d3e71);}};}function respondWithFilteredResult(_0x14b701,_0x63b6ba){return function(_0x48468b){if(_0x48468b){var _0x5e9240=typeof _0x63b6ba[_0x137f('0x1e')]===_0x137f('0x1f')&&typeof _0x63b6ba[_0x137f('0x20')]===_0x137f('0x1f');var _0xac1f1f=_0x48468b[_0x137f('0x21')];var _0x1730d3=_0x5e9240?0x0:_0x63b6ba[_0x137f('0x1e')];var _0x199387=_0x5e9240?_0x48468b['count']:_0x63b6ba[_0x137f('0x1e')]+_0x63b6ba[_0x137f('0x20')];var _0x260bb7;if(_0x199387>=_0xac1f1f){_0x199387=_0xac1f1f;_0x260bb7=0xc8;}else{_0x260bb7=0xce;}_0x14b701['status'](_0x260bb7);return _0x14b701[_0x137f('0x22')](_0x137f('0x23'),_0x1730d3+'-'+_0x199387+'/'+_0xac1f1f)[_0x137f('0x1d')](_0x48468b);}return null;};}function patchUpdates(_0x424b52){return function(_0x19ac70){try{jsonpatch['apply'](_0x19ac70,_0x424b52,!![]);}catch(_0x34898f){return BPromise[_0x137f('0x24')](_0x34898f);}return _0x19ac70[_0x137f('0x25')]();};}function saveUpdates(_0x414fa5,_0x57dc36){return function(_0x31dc82){if(_0x31dc82){return _0x31dc82[_0x137f('0x26')](_0x414fa5)[_0x137f('0x27')](function(_0x20cba4){return _0x20cba4;});}return null;};}function removeEntity(_0x4bd542,_0x58fcb4){return function(_0x25c8a3){if(_0x25c8a3){return _0x25c8a3['destroy']()['then'](function(){_0x4bd542[_0x137f('0x1b')](0xcc)[_0x137f('0x1c')]();});}};}function handleEntityNotFound(_0x4cc4ca,_0x5037a4){return function(_0x1d5a28){if(!_0x1d5a28){_0x4cc4ca[_0x137f('0x1a')](0x194);}return _0x1d5a28;};}function handleError(_0x264cb8,_0x1d68f9){_0x1d68f9=_0x1d68f9||0x1f4;return function(_0x5907f3){logger['error'](_0x5907f3[_0x137f('0x28')]);if(_0x5907f3['name']){delete _0x5907f3['name'];}_0x264cb8['status'](_0x1d68f9)['send'](_0x5907f3);};}exports['index']=function(_0x1334e7,_0x2c6d1b){var _0xd679fa={},_0x5182bf={},_0x194116={'count':0x0,'rows':[]};var _0x3ccb1a=_[_0x137f('0x29')](db[_0x137f('0x2a')][_0x137f('0x2b')],function(_0x5c82e3){return{'name':_0x5c82e3[_0x137f('0x2c')],'type':_0x5c82e3[_0x137f('0x2d')][_0x137f('0x2e')]};});_0x5182bf['model']=_[_0x137f('0x29')](_0x3ccb1a,'name');_0x5182bf[_0x137f('0x2f')]=_[_0x137f('0x30')](_0x1334e7[_0x137f('0x2f')]);_0x5182bf['filters']=_[_0x137f('0x31')](_0x5182bf[_0x137f('0x32')],_0x5182bf[_0x137f('0x2f')]);_0xd679fa[_0x137f('0x33')]=_[_0x137f('0x31')](_0x5182bf[_0x137f('0x32')],qs['fields'](_0x1334e7[_0x137f('0x2f')][_0x137f('0x34')]));_0xd679fa[_0x137f('0x33')]=_0xd679fa[_0x137f('0x33')][_0x137f('0x35')]?_0xd679fa[_0x137f('0x33')]:_0x5182bf[_0x137f('0x32')];if(!_0x1334e7[_0x137f('0x2f')]['hasOwnProperty'](_0x137f('0x36'))){_0xd679fa['limit']=qs[_0x137f('0x20')](_0x1334e7['query']['limit']);_0xd679fa[_0x137f('0x1e')]=qs['offset'](_0x1334e7[_0x137f('0x2f')][_0x137f('0x1e')]);}_0xd679fa['order']=qs[_0x137f('0x37')](_0x1334e7[_0x137f('0x2f')][_0x137f('0x37')]);_0xd679fa['where']=qs[_0x137f('0x38')](_[_0x137f('0x39')](_0x1334e7[_0x137f('0x2f')],_0x5182bf[_0x137f('0x38')]),_0x3ccb1a);if(_0x1334e7[_0x137f('0x2f')]['filter']){_0xd679fa[_0x137f('0x3a')]=_['merge'](_0xd679fa[_0x137f('0x3a')],{'$or':_['map'](_0x3ccb1a,function(_0x4ab186){if(_0x4ab186[_0x137f('0x2d')]!=='VIRTUAL'){var _0x4291b9={};_0x4291b9[_0x4ab186[_0x137f('0x3b')]]={'$like':'%'+_0x1334e7[_0x137f('0x2f')][_0x137f('0x3c')]+'%'};return _0x4291b9;}})});}_0xd679fa=_[_0x137f('0x3d')]({},_0xd679fa,_0x1334e7[_0x137f('0x3e')]);var _0x24af48={'where':_0xd679fa[_0x137f('0x3a')]};return db[_0x137f('0x2a')][_0x137f('0x21')](_0x24af48)['then'](function(_0x5a8a78){_0x194116[_0x137f('0x21')]=_0x5a8a78;if(_0x1334e7[_0x137f('0x2f')][_0x137f('0x3f')]){_0xd679fa[_0x137f('0x40')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x137f('0x41')](_0xd679fa);})[_0x137f('0x27')](function(_0x4a9103){_0x194116[_0x137f('0x42')]=_0x4a9103;return _0x194116;})['then'](respondWithFilteredResult(_0x2c6d1b,_0xd679fa))[_0x137f('0x43')](handleError(_0x2c6d1b,null));};exports[_0x137f('0x44')]=function(_0x2aae38,_0x43a37a){var _0x411d3f={'raw':![],'where':{'id':_0x2aae38['params']['id']}},_0x3f618b={};_0x3f618b[_0x137f('0x32')]=_[_0x137f('0x30')](db['ZohoConfiguration'][_0x137f('0x2b')]);_0x3f618b[_0x137f('0x2f')]=_['keys'](_0x2aae38[_0x137f('0x2f')]);_0x3f618b[_0x137f('0x38')]=_[_0x137f('0x31')](_0x3f618b[_0x137f('0x32')],_0x3f618b[_0x137f('0x2f')]);_0x411d3f[_0x137f('0x33')]=_[_0x137f('0x31')](_0x3f618b[_0x137f('0x32')],qs['fields'](_0x2aae38['query'][_0x137f('0x34')]));_0x411d3f[_0x137f('0x33')]=_0x411d3f[_0x137f('0x33')]['length']?_0x411d3f['attributes']:_0x3f618b[_0x137f('0x32')];if(_0x2aae38[_0x137f('0x2f')][_0x137f('0x3f')]){_0x411d3f[_0x137f('0x40')]=[{'all':!![]}];}_0x411d3f=_['merge']({},_0x411d3f,_0x2aae38[_0x137f('0x3e')]);return db['ZohoConfiguration'][_0x137f('0x45')](_0x411d3f)[_0x137f('0x27')](handleEntityNotFound(_0x43a37a,null))[_0x137f('0x27')](respondWithResult(_0x43a37a,null))[_0x137f('0x43')](handleError(_0x43a37a,null));};exports[_0x137f('0x46')]=function(_0x39ac95,_0x473878){return db[_0x137f('0x2a')]['create'](_0x39ac95['body'],{})[_0x137f('0x27')](respondWithResult(_0x473878,0xc9))['catch'](handleError(_0x473878,null));};exports[_0x137f('0x26')]=function(_0x5a2411,_0x11b5b8){if(_0x5a2411['body']['id']){delete _0x5a2411[_0x137f('0x47')]['id'];}return db['ZohoConfiguration'][_0x137f('0x45')]({'where':{'id':_0x5a2411[_0x137f('0x48')]['id']}})[_0x137f('0x27')](handleEntityNotFound(_0x11b5b8,null))[_0x137f('0x27')](saveUpdates(_0x5a2411[_0x137f('0x47')],null))[_0x137f('0x27')](respondWithResult(_0x11b5b8,null))[_0x137f('0x43')](handleError(_0x11b5b8,null));};exports[_0x137f('0x49')]=function(_0xd499b4,_0x4c1a36){return db[_0x137f('0x2a')]['find']({'where':{'id':_0xd499b4[_0x137f('0x48')]['id']}})[_0x137f('0x27')](handleEntityNotFound(_0x4c1a36,null))[_0x137f('0x27')](removeEntity(_0x4c1a36,null))[_0x137f('0x43')](handleError(_0x4c1a36,null));};exports[_0x137f('0x4a')]=function(_0x5732fc,_0xcce850,_0x490629){var _0x1db496={};var _0x2e51b3={};var _0x16e60a;var _0x34ef9a;return db[_0x137f('0x2a')][_0x137f('0x4b')]({'where':{'id':_0x5732fc[_0x137f('0x48')]['id']}})[_0x137f('0x27')](handleEntityNotFound(_0xcce850,null))[_0x137f('0x27')](function(_0x461a3b){if(_0x461a3b){_0x16e60a=_0x461a3b;_0x2e51b3[_0x137f('0x32')]=_[_0x137f('0x30')](db[_0x137f('0x4c')][_0x137f('0x2b')]);_0x2e51b3[_0x137f('0x2f')]=_['keys'](_0x5732fc[_0x137f('0x2f')]);_0x2e51b3[_0x137f('0x38')]=_[_0x137f('0x31')](_0x2e51b3['model'],_0x2e51b3['query']);_0x1db496['attributes']=_[_0x137f('0x31')](_0x2e51b3[_0x137f('0x32')],qs[_0x137f('0x34')](_0x5732fc[_0x137f('0x2f')][_0x137f('0x34')]));_0x1db496[_0x137f('0x33')]=_0x1db496[_0x137f('0x33')][_0x137f('0x35')]?_0x1db496[_0x137f('0x33')]:_0x2e51b3[_0x137f('0x32')];_0x1db496['order']=qs[_0x137f('0x37')](_0x5732fc[_0x137f('0x2f')][_0x137f('0x37')]);_0x1db496[_0x137f('0x3a')]=qs['filters'](_[_0x137f('0x39')](_0x5732fc[_0x137f('0x2f')],_0x2e51b3[_0x137f('0x38')]));if(_0x5732fc[_0x137f('0x2f')][_0x137f('0x3c')]){_0x1db496[_0x137f('0x3a')]=_['merge'](_0x1db496[_0x137f('0x3a')],{'$or':_[_0x137f('0x29')](_0x1db496[_0x137f('0x33')],function(_0x1149d3){var _0x312459={};_0x312459[_0x1149d3]={'$like':'%'+_0x5732fc[_0x137f('0x2f')][_0x137f('0x3c')]+'%'};return _0x312459;})});}_0x1db496=_[_0x137f('0x3d')]({},_0x1db496,_0x5732fc[_0x137f('0x3e')]);return _0x16e60a['getFields'](_0x1db496);}})[_0x137f('0x27')](function(_0x4d3fc3){if(_0x4d3fc3){_0x34ef9a=_0x4d3fc3[_0x137f('0x35')];if(!_0x5732fc[_0x137f('0x2f')][_0x137f('0x4d')](_0x137f('0x36'))){_0x1db496[_0x137f('0x20')]=qs['limit'](_0x5732fc[_0x137f('0x2f')][_0x137f('0x20')]);_0x1db496[_0x137f('0x1e')]=qs[_0x137f('0x1e')](_0x5732fc[_0x137f('0x2f')][_0x137f('0x1e')]);}return _0x16e60a[_0x137f('0x4a')](_0x1db496);}})[_0x137f('0x27')](function(_0x13ffc5){if(_0x13ffc5){return _0x13ffc5?{'count':_0x34ef9a,'rows':_0x13ffc5}:null;}})[_0x137f('0x27')](respondWithResult(_0xcce850,null))[_0x137f('0x43')](handleError(_0xcce850,null));};exports[_0x137f('0x4e')]=function(_0x306a64,_0x204190,_0x2776e6){var _0x120f87={};var _0x3ce5b8={};var _0x21096e;var _0x20e631;return db[_0x137f('0x2a')]['findOne']({'where':{'id':_0x306a64[_0x137f('0x48')]['id']}})['then'](handleEntityNotFound(_0x204190,null))[_0x137f('0x27')](function(_0x21fff9){if(_0x21fff9){_0x21096e=_0x21fff9;_0x3ce5b8['model']=_[_0x137f('0x30')](db['ZohoField'][_0x137f('0x2b')]);_0x3ce5b8[_0x137f('0x2f')]=_[_0x137f('0x30')](_0x306a64[_0x137f('0x2f')]);_0x3ce5b8[_0x137f('0x38')]=_[_0x137f('0x31')](_0x3ce5b8[_0x137f('0x32')],_0x3ce5b8[_0x137f('0x2f')]);_0x120f87['attributes']=_[_0x137f('0x31')](_0x3ce5b8[_0x137f('0x32')],qs[_0x137f('0x34')](_0x306a64[_0x137f('0x2f')][_0x137f('0x34')]));_0x120f87['attributes']=_0x120f87[_0x137f('0x33')][_0x137f('0x35')]?_0x120f87[_0x137f('0x33')]:_0x3ce5b8[_0x137f('0x32')];_0x120f87[_0x137f('0x4f')]=qs[_0x137f('0x37')](_0x306a64[_0x137f('0x2f')][_0x137f('0x37')]);_0x120f87[_0x137f('0x3a')]=qs[_0x137f('0x38')](_[_0x137f('0x39')](_0x306a64['query'],_0x3ce5b8[_0x137f('0x38')]));if(_0x306a64[_0x137f('0x2f')]['filter']){_0x120f87['where']=_['merge'](_0x120f87['where'],{'$or':_[_0x137f('0x29')](_0x120f87[_0x137f('0x33')],function(_0xdd7166){var _0x3f764d={};_0x3f764d[_0xdd7166]={'$like':'%'+_0x306a64[_0x137f('0x2f')][_0x137f('0x3c')]+'%'};return _0x3f764d;})});}_0x120f87=_[_0x137f('0x3d')]({},_0x120f87,_0x306a64['options']);return _0x21096e[_0x137f('0x4e')](_0x120f87);}})['then'](function(_0x1ebbba){if(_0x1ebbba){_0x20e631=_0x1ebbba['length'];if(!_0x306a64['query'][_0x137f('0x4d')](_0x137f('0x36'))){_0x120f87[_0x137f('0x20')]=qs[_0x137f('0x20')](_0x306a64[_0x137f('0x2f')]['limit']);_0x120f87[_0x137f('0x1e')]=qs[_0x137f('0x1e')](_0x306a64[_0x137f('0x2f')][_0x137f('0x1e')]);}return _0x21096e[_0x137f('0x4e')](_0x120f87);}})['then'](function(_0x5304d3){if(_0x5304d3){return _0x5304d3?{'count':_0x20e631,'rows':_0x5304d3}:null;}})['then'](respondWithResult(_0x204190,null))['catch'](handleError(_0x204190,null));};exports['getDescriptions']=function(_0x39ddec,_0x2f055a,_0x197b4c){var _0x12e589={};var _0x3fc6a5={};var _0x276e53;var _0xf6b879;return db[_0x137f('0x2a')][_0x137f('0x4b')]({'where':{'id':_0x39ddec[_0x137f('0x48')]['id']}})[_0x137f('0x27')](handleEntityNotFound(_0x2f055a,null))['then'](function(_0x31d4b0){if(_0x31d4b0){_0x276e53=_0x31d4b0;_0x3fc6a5['model']=_[_0x137f('0x30')](db['ZohoField'][_0x137f('0x2b')]);_0x3fc6a5[_0x137f('0x2f')]=_['keys'](_0x39ddec[_0x137f('0x2f')]);_0x3fc6a5[_0x137f('0x38')]=_[_0x137f('0x31')](_0x3fc6a5['model'],_0x3fc6a5[_0x137f('0x2f')]);_0x12e589[_0x137f('0x33')]=_[_0x137f('0x31')](_0x3fc6a5[_0x137f('0x32')],qs['fields'](_0x39ddec[_0x137f('0x2f')][_0x137f('0x34')]));_0x12e589[_0x137f('0x33')]=_0x12e589[_0x137f('0x33')]['length']?_0x12e589[_0x137f('0x33')]:_0x3fc6a5[_0x137f('0x32')];_0x12e589[_0x137f('0x4f')]=qs[_0x137f('0x37')](_0x39ddec['query'][_0x137f('0x37')]);_0x12e589['where']=qs[_0x137f('0x38')](_[_0x137f('0x39')](_0x39ddec[_0x137f('0x2f')],_0x3fc6a5[_0x137f('0x38')]));if(_0x39ddec['query']['filter']){_0x12e589[_0x137f('0x3a')]=_[_0x137f('0x3d')](_0x12e589['where'],{'$or':_[_0x137f('0x29')](_0x12e589['attributes'],function(_0x2ae836){var _0x3f2ed1={};_0x3f2ed1[_0x2ae836]={'$like':'%'+_0x39ddec[_0x137f('0x2f')][_0x137f('0x3c')]+'%'};return _0x3f2ed1;})});}_0x12e589=_[_0x137f('0x3d')]({},_0x12e589,_0x39ddec[_0x137f('0x3e')]);return _0x276e53[_0x137f('0x50')](_0x12e589);}})['then'](function(_0x49ea80){if(_0x49ea80){_0xf6b879=_0x49ea80['length'];if(!_0x39ddec[_0x137f('0x2f')][_0x137f('0x4d')](_0x137f('0x36'))){_0x12e589['limit']=qs['limit'](_0x39ddec[_0x137f('0x2f')][_0x137f('0x20')]);_0x12e589[_0x137f('0x1e')]=qs[_0x137f('0x1e')](_0x39ddec[_0x137f('0x2f')][_0x137f('0x1e')]);}return _0x276e53[_0x137f('0x50')](_0x12e589);}})[_0x137f('0x27')](function(_0x7adab){if(_0x7adab){return _0x7adab?{'count':_0xf6b879,'rows':_0x7adab}:null;}})[_0x137f('0x27')](respondWithResult(_0x2f055a,null))[_0x137f('0x43')](handleError(_0x2f055a,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index ef3b644..960d581 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 _0x1841=['int_zoho_configurations','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration'];(function(_0x1d65cc,_0x496a21){var _0x3f312c=function(_0x56e22f){while(--_0x56e22f){_0x1d65cc['push'](_0x1d65cc['shift']());}};_0x3f312c(++_0x496a21);}(_0x1841,0x16c));var _0x1184=function(_0x254fcc,_0x4b335f){_0x254fcc=_0x254fcc-0x0;var _0x145b7b=_0x1841[_0x254fcc];return _0x145b7b;};'use strict';var _=require('lodash');var util=require(_0x1184('0x0'));var logger=require('../../config/logger')(_0x1184('0x1'));var moment=require(_0x1184('0x2'));var BPromise=require(_0x1184('0x3'));var rp=require(_0x1184('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1184('0x5'));var config=require(_0x1184('0x6'));var attributes=require(_0x1184('0x7'));module[_0x1184('0x8')]=function(_0x2a731a,_0x509c9d){return _0x2a731a['define'](_0x1184('0x9'),attributes,{'tableName':_0x1184('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46fc=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','define','ZohoConfiguration','int_zoho_configurations'];(function(_0x52ab62,_0x203d25){var _0x42f499=function(_0x56adfd){while(--_0x56adfd){_0x52ab62['push'](_0x52ab62['shift']());}};_0x42f499(++_0x203d25);}(_0x46fc,0x113));var _0xc46f=function(_0x23e5d6,_0x581445){_0x23e5d6=_0x23e5d6-0x0;var _0x51d225=_0x46fc[_0x23e5d6];return _0x51d225;};'use strict';var _=require(_0xc46f('0x0'));var util=require(_0xc46f('0x1'));var logger=require(_0xc46f('0x2'))(_0xc46f('0x3'));var moment=require('moment');var BPromise=require(_0xc46f('0x4'));var rp=require(_0xc46f('0x5'));var fs=require('fs');var path=require(_0xc46f('0x6'));var rimraf=require(_0xc46f('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x5c6c1f,_0x355f99){return _0x5c6c1f[_0xc46f('0x8')](_0xc46f('0x9'),attributes,{'tableName':_0xc46f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index cd96de3..55bb430 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 _0xeca7=['../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5b1937,_0x553b2a){var _0x30618f=function(_0x1a2927){while(--_0x1a2927){_0x5b1937['push'](_0x5b1937['shift']());}};_0x30618f(++_0x553b2a);}(_0xeca7,0x1d8));var _0x7eca=function(_0x199b64,_0x5d1120){_0x199b64=_0x199b64-0x0;var _0x42b220=_0xeca7[_0x199b64];return _0x42b220;};'use strict';var _=require(_0x7eca('0x0'));var util=require(_0x7eca('0x1'));var moment=require(_0x7eca('0x2'));var BPromise=require('bluebird');var rs=require(_0x7eca('0x3'));var fs=require('fs');var Redis=require(_0x7eca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7eca('0x5'));var logger=require(_0x7eca('0x6'))(_0x7eca('0x7'));var config=require(_0x7eca('0x8'));var jayson=require(_0x7eca('0x9'));var client=jayson[_0x7eca('0xa')][_0x7eca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39ce3e,_0x1283d8,_0x19938e){return new BPromise(function(_0x10f605,_0x556c49){return client[_0x7eca('0xc')](_0x39ce3e,_0x19938e)[_0x7eca('0xd')](function(_0x29b73a){logger[_0x7eca('0xe')](_0x7eca('0xf'),_0x1283d8,'request\x20sent');logger[_0x7eca('0x10')](_0x7eca('0x11'),_0x1283d8,_0x7eca('0x12'),JSON[_0x7eca('0x13')](_0x29b73a));if(_0x29b73a[_0x7eca('0x14')]){if(_0x29b73a[_0x7eca('0x14')][_0x7eca('0x15')]===0x1f4){logger[_0x7eca('0x14')](_0x7eca('0xf'),_0x1283d8,_0x29b73a[_0x7eca('0x14')][_0x7eca('0x16')]);return _0x556c49(_0x29b73a[_0x7eca('0x14')]['message']);}logger[_0x7eca('0x14')](_0x7eca('0xf'),_0x1283d8,_0x29b73a[_0x7eca('0x14')][_0x7eca('0x16')]);return _0x10f605(_0x29b73a[_0x7eca('0x14')]['message']);}else{logger[_0x7eca('0xe')](_0x7eca('0xf'),_0x1283d8,'request\x20sent');_0x10f605(_0x29b73a['result']['message']);}})[_0x7eca('0x17')](function(_0x2c8212){logger['error'](_0x7eca('0xf'),_0x1283d8,_0x2c8212);_0x556c49(_0x2c8212);});});} \ No newline at end of file +var _0xe17a=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','stringify','error','ZohoConfiguration,\x20%s,\x20%s','message','result','lodash'];(function(_0x121d9e,_0x11b966){var _0x5df466=function(_0x519340){while(--_0x519340){_0x121d9e['push'](_0x121d9e['shift']());}};_0x5df466(++_0x11b966);}(_0xe17a,0x1b4));var _0xae17=function(_0x31a566,_0x1a3028){_0x31a566=_0x31a566-0x0;var _0x2fe294=_0xe17a[_0x31a566];return _0x2fe294;};'use strict';var _=require(_0xae17('0x0'));var util=require(_0xae17('0x1'));var moment=require(_0xae17('0x2'));var BPromise=require(_0xae17('0x3'));var rs=require(_0xae17('0x4'));var fs=require('fs');var Redis=require(_0xae17('0x5'));var db=require(_0xae17('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xae17('0x7'));var config=require(_0xae17('0x8'));var jayson=require(_0xae17('0x9'));var client=jayson['client'][_0xae17('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b779f,_0x34089b,_0x14710e){return new BPromise(function(_0x3949a9,_0x21f5e4){return client[_0xae17('0xb')](_0x2b779f,_0x14710e)['then'](function(_0x4b6094){logger[_0xae17('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x34089b,_0xae17('0xd'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x34089b,_0xae17('0xd'),JSON[_0xae17('0xe')](_0x4b6094));if(_0x4b6094[_0xae17('0xf')]){if(_0x4b6094['error']['code']===0x1f4){logger[_0xae17('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x34089b,_0x4b6094[_0xae17('0xf')]['message']);return _0x21f5e4(_0x4b6094[_0xae17('0xf')]['message']);}logger[_0xae17('0xf')](_0xae17('0x10'),_0x34089b,_0x4b6094[_0xae17('0xf')][_0xae17('0x11')]);return _0x3949a9(_0x4b6094['error'][_0xae17('0x11')]);}else{logger[_0xae17('0xc')](_0xae17('0x10'),_0x34089b,_0xae17('0xd'));_0x3949a9(_0x4b6094[_0xae17('0x12')][_0xae17('0x11')]);}})['catch'](function(_0x5c9403){logger[_0xae17('0xf')](_0xae17('0x10'),_0x34089b,_0x5c9403);_0x21f5e4(_0x5c9403);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 0f8cdc8..b3fa334 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 _0xc949=['index','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intZohoField.controller','get','isAuthenticated'];(function(_0x2cb0fe,_0x35aefd){var _0xc2558d=function(_0x59d662){while(--_0x59d662){_0x2cb0fe['push'](_0x2cb0fe['shift']());}};_0xc2558d(++_0x35aefd);}(_0xc949,0x7a));var _0x9c94=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xc949[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x9c94('0x0'));var util=require(_0x9c94('0x1'));var path=require(_0x9c94('0x2'));var timeout=require(_0x9c94('0x3'));var express=require(_0x9c94('0x4'));var router=express[_0x9c94('0x5')]();var fs_extra=require(_0x9c94('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9c94('0x7'));var controller=require(_0x9c94('0x8'));router[_0x9c94('0x9')]('/',auth[_0x9c94('0xa')](),controller[_0x9c94('0xb')]);router[_0x9c94('0x9')](_0x9c94('0xc'),auth[_0x9c94('0xa')](),controller[_0x9c94('0xd')]);router[_0x9c94('0xe')]('/',auth[_0x9c94('0xa')](),controller['create']);router[_0x9c94('0xf')](_0x9c94('0xc'),auth[_0x9c94('0xa')](),controller[_0x9c94('0x10')]);router[_0x9c94('0x11')](_0x9c94('0xc'),auth[_0x9c94('0xa')](),controller['destroy']);module[_0x9c94('0x12')]=router; \ No newline at end of file +var _0x1ef5=['./intZohoField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x1ef5,0x1e6));var _0x51ef=function(_0x2bf8ad,_0x10ba3e){_0x2bf8ad=_0x2bf8ad-0x0;var _0x3aac96=_0x1ef5[_0x2bf8ad];return _0x3aac96;};'use strict';var multer=require('multer');var util=require(_0x51ef('0x0'));var path=require(_0x51ef('0x1'));var timeout=require(_0x51ef('0x2'));var express=require(_0x51ef('0x3'));var router=express[_0x51ef('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x51ef('0x5'));var interaction=require(_0x51ef('0x6'));var config=require(_0x51ef('0x7'));var controller=require(_0x51ef('0x8'));router[_0x51ef('0x9')]('/',auth[_0x51ef('0xa')](),controller['index']);router[_0x51ef('0x9')](_0x51ef('0xb'),auth[_0x51ef('0xa')](),controller[_0x51ef('0xc')]);router[_0x51ef('0xd')]('/',auth[_0x51ef('0xa')](),controller[_0x51ef('0xe')]);router[_0x51ef('0xf')](_0x51ef('0xb'),auth[_0x51ef('0xa')](),controller[_0x51ef('0x10')]);router[_0x51ef('0x11')](_0x51ef('0xb'),auth[_0x51ef('0xa')](),controller['destroy']);module[_0x51ef('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 19b8a9d..8bdf28f 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 _0xca4d=['variable','customVariable','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x1e4d13,_0x41bb82){var _0x9f88eb=function(_0x1a3fd3){while(--_0x1a3fd3){_0x1e4d13['push'](_0x1e4d13['shift']());}};_0x9f88eb(++_0x41bb82);}(_0xca4d,0xc4));var _0xdca4=function(_0x386996,_0x221413){_0x386996=_0x386996-0x0;var _0x1a0065=_0xca4d[_0x386996];return _0x1a0065;};'use strict';var Sequelize=require(_0xdca4('0x0'));module[_0xdca4('0x1')]={'type':{'type':Sequelize[_0xdca4('0x2')](_0xdca4('0x3'),_0xdca4('0x4'),_0xdca4('0x5'),'keyValue',_0xdca4('0x6')),'defaultValue':_0xdca4('0x3')},'content':{'type':Sequelize[_0xdca4('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xdca4('0x2')](_0xdca4('0x3'),_0xdca4('0x4'),_0xdca4('0x5'))},'keyContent':{'type':Sequelize[_0xdca4('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xdca4('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdca4('0x7')]}}; \ No newline at end of file +var _0x81cb=['STRING','variable','sequelize','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x81cb,0xad));var _0xb81c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x81cb[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xb81c('0x0'));module[_0xb81c('0x1')]={'type':{'type':Sequelize[_0xb81c('0x2')](_0xb81c('0x3'),'variable',_0xb81c('0x4'),_0xb81c('0x5'),_0xb81c('0x6')),'defaultValue':_0xb81c('0x3')},'content':{'type':Sequelize[_0xb81c('0x7')]},'key':{'type':Sequelize[_0xb81c('0x7')]},'keyType':{'type':Sequelize[_0xb81c('0x2')](_0xb81c('0x3'),_0xb81c('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0xb81c('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb81c('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb81c('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index dbb77f7..3e5495d 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 _0x9632=['send','index','map','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','ZohoField','includeAll','include','rows','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack'];(function(_0x18dfea,_0x43d571){var _0x5222e3=function(_0x3484ae){while(--_0x3484ae){_0x18dfea['push'](_0x18dfea['shift']());}};_0x5222e3(++_0x43d571);}(_0x9632,0x109));var _0x2963=function(_0xc85b17,_0x2b981f){_0xc85b17=_0xc85b17-0x0;var _0x490ef8=_0x9632[_0xc85b17];return _0x490ef8;};'use strict';var emlformat=require(_0x2963('0x0'));var rimraf=require(_0x2963('0x1'));var zipdir=require(_0x2963('0x2'));var jsonpatch=require(_0x2963('0x3'));var rp=require(_0x2963('0x4'));var moment=require(_0x2963('0x5'));var BPromise=require(_0x2963('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2963('0x7'));var sox=require(_0x2963('0x8'));var csv=require(_0x2963('0x9'));var ejs=require(_0x2963('0xa'));var fs=require('fs');var fs_extra=require(_0x2963('0xb'));var _=require(_0x2963('0xc'));var squel=require(_0x2963('0xd'));var crypto=require(_0x2963('0xe'));var jsforce=require(_0x2963('0xf'));var deskjs=require(_0x2963('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2963('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2963('0x12'));var as=require(_0x2963('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2963('0x14'))(_0x2963('0x15'));var utils=require(_0x2963('0x16'));var config=require(_0x2963('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2963('0x18'))['db'];function respondWithStatusCode(_0x544329,_0x232f72){_0x232f72=_0x232f72||0xcc;return function(_0x400d2f){if(_0x400d2f){return _0x544329['sendStatus'](_0x232f72);}return _0x544329[_0x2963('0x19')](_0x232f72)['end']();};}function respondWithResult(_0x3cb739,_0x3bb048){_0x3bb048=_0x3bb048||0xc8;return function(_0x231f9a){if(_0x231f9a){return _0x3cb739[_0x2963('0x19')](_0x3bb048)[_0x2963('0x1a')](_0x231f9a);}};}function respondWithFilteredResult(_0x264c13,_0xc9db85){return function(_0x1f707f){if(_0x1f707f){var _0x5cb845=typeof _0xc9db85[_0x2963('0x1b')]===_0x2963('0x1c')&&typeof _0xc9db85[_0x2963('0x1d')]==='undefined';var _0x442278=_0x1f707f['count'];var _0x48a8fe=_0x5cb845?0x0:_0xc9db85[_0x2963('0x1b')];var _0x411e0a=_0x5cb845?_0x1f707f[_0x2963('0x1e')]:_0xc9db85[_0x2963('0x1b')]+_0xc9db85[_0x2963('0x1d')];var _0x47142f;if(_0x411e0a>=_0x442278){_0x411e0a=_0x442278;_0x47142f=0xc8;}else{_0x47142f=0xce;}_0x264c13[_0x2963('0x19')](_0x47142f);return _0x264c13[_0x2963('0x1f')](_0x2963('0x20'),_0x48a8fe+'-'+_0x411e0a+'/'+_0x442278)['json'](_0x1f707f);}return null;};}function patchUpdates(_0x4a4c70){return function(_0x5607fd){try{jsonpatch[_0x2963('0x21')](_0x5607fd,_0x4a4c70,!![]);}catch(_0x530300){return BPromise[_0x2963('0x22')](_0x530300);}return _0x5607fd[_0x2963('0x23')]();};}function saveUpdates(_0x503ec0,_0x1b3b5d){return function(_0x1843b3){if(_0x1843b3){return _0x1843b3[_0x2963('0x24')](_0x503ec0)[_0x2963('0x25')](function(_0x23acae){return _0x23acae;});}return null;};}function removeEntity(_0x508b3a,_0x306746){return function(_0x4d9af2){if(_0x4d9af2){return _0x4d9af2[_0x2963('0x26')]()[_0x2963('0x25')](function(){_0x508b3a['status'](0xcc)[_0x2963('0x27')]();});}};}function handleEntityNotFound(_0xaecf9a,_0x2ef286){return function(_0x25aeb5){if(!_0x25aeb5){_0xaecf9a[_0x2963('0x28')](0x194);}return _0x25aeb5;};}function handleError(_0x38aac2,_0x18dfbb){_0x18dfbb=_0x18dfbb||0x1f4;return function(_0x567697){logger[_0x2963('0x29')](_0x567697[_0x2963('0x2a')]);if(_0x567697['name']){delete _0x567697['name'];}_0x38aac2[_0x2963('0x19')](_0x18dfbb)[_0x2963('0x2b')](_0x567697);};}exports[_0x2963('0x2c')]=function(_0x20b63d,_0x45dd38){var _0x40b484={},_0x4b70e6={},_0x1782ff={'count':0x0,'rows':[]};var _0x48bd9c=_[_0x2963('0x2d')](db['ZohoField'][_0x2963('0x2e')],function(_0x2d8ece){return{'name':_0x2d8ece[_0x2963('0x2f')],'type':_0x2d8ece[_0x2963('0x30')][_0x2963('0x31')]};});_0x4b70e6['model']=_[_0x2963('0x2d')](_0x48bd9c,_0x2963('0x32'));_0x4b70e6[_0x2963('0x33')]=_[_0x2963('0x34')](_0x20b63d[_0x2963('0x33')]);_0x4b70e6[_0x2963('0x35')]=_[_0x2963('0x36')](_0x4b70e6[_0x2963('0x37')],_0x4b70e6[_0x2963('0x33')]);_0x40b484[_0x2963('0x38')]=_[_0x2963('0x36')](_0x4b70e6['model'],qs[_0x2963('0x39')](_0x20b63d[_0x2963('0x33')]['fields']));_0x40b484[_0x2963('0x38')]=_0x40b484[_0x2963('0x38')][_0x2963('0x3a')]?_0x40b484[_0x2963('0x38')]:_0x4b70e6[_0x2963('0x37')];if(!_0x20b63d[_0x2963('0x33')][_0x2963('0x3b')]('nolimit')){_0x40b484[_0x2963('0x1d')]=qs['limit'](_0x20b63d[_0x2963('0x33')][_0x2963('0x1d')]);_0x40b484['offset']=qs[_0x2963('0x1b')](_0x20b63d[_0x2963('0x33')][_0x2963('0x1b')]);}_0x40b484[_0x2963('0x3c')]=qs['sort'](_0x20b63d[_0x2963('0x33')][_0x2963('0x3d')]);_0x40b484[_0x2963('0x3e')]=qs[_0x2963('0x35')](_[_0x2963('0x3f')](_0x20b63d[_0x2963('0x33')],_0x4b70e6['filters']),_0x48bd9c);if(_0x20b63d[_0x2963('0x33')][_0x2963('0x40')]){_0x40b484[_0x2963('0x3e')]=_['merge'](_0x40b484[_0x2963('0x3e')],{'$or':_[_0x2963('0x2d')](_0x48bd9c,function(_0x5aa131){if(_0x5aa131[_0x2963('0x30')]!==_0x2963('0x41')){var _0x5554d2={};_0x5554d2[_0x5aa131[_0x2963('0x32')]]={'$like':'%'+_0x20b63d[_0x2963('0x33')][_0x2963('0x40')]+'%'};return _0x5554d2;}})});}_0x40b484=_[_0x2963('0x42')]({},_0x40b484,_0x20b63d[_0x2963('0x43')]);var _0x1386d1={'where':_0x40b484['where']};return db[_0x2963('0x44')]['count'](_0x1386d1)[_0x2963('0x25')](function(_0x319dab){_0x1782ff[_0x2963('0x1e')]=_0x319dab;if(_0x20b63d[_0x2963('0x33')][_0x2963('0x45')]){_0x40b484[_0x2963('0x46')]=[{'all':!![]}];}return db[_0x2963('0x44')]['findAll'](_0x40b484);})[_0x2963('0x25')](function(_0x1cc32e){_0x1782ff[_0x2963('0x47')]=_0x1cc32e;return _0x1782ff;})[_0x2963('0x25')](respondWithFilteredResult(_0x45dd38,_0x40b484))['catch'](handleError(_0x45dd38,null));};exports['show']=function(_0x4ed9bf,_0x1dc099){var _0x34a2ef={'raw':!![],'where':{'id':_0x4ed9bf[_0x2963('0x48')]['id']}},_0x507131={};_0x507131[_0x2963('0x37')]=_[_0x2963('0x34')](db[_0x2963('0x44')][_0x2963('0x2e')]);_0x507131[_0x2963('0x33')]=_['keys'](_0x4ed9bf[_0x2963('0x33')]);_0x507131[_0x2963('0x35')]=_['intersection'](_0x507131[_0x2963('0x37')],_0x507131[_0x2963('0x33')]);_0x34a2ef[_0x2963('0x38')]=_[_0x2963('0x36')](_0x507131['model'],qs[_0x2963('0x39')](_0x4ed9bf[_0x2963('0x33')][_0x2963('0x39')]));_0x34a2ef[_0x2963('0x38')]=_0x34a2ef['attributes'][_0x2963('0x3a')]?_0x34a2ef[_0x2963('0x38')]:_0x507131[_0x2963('0x37')];if(_0x4ed9bf['query'][_0x2963('0x45')]){_0x34a2ef[_0x2963('0x46')]=[{'all':!![]}];}_0x34a2ef=_[_0x2963('0x42')]({},_0x34a2ef,_0x4ed9bf[_0x2963('0x43')]);return db['ZohoField'][_0x2963('0x49')](_0x34a2ef)['then'](handleEntityNotFound(_0x1dc099,null))[_0x2963('0x25')](respondWithResult(_0x1dc099,null))[_0x2963('0x4a')](handleError(_0x1dc099,null));};exports['create']=function(_0x319b81,_0x55452e){return db['ZohoField'][_0x2963('0x4b')](_0x319b81[_0x2963('0x4c')],{})['then'](respondWithResult(_0x55452e,0xc9))['catch'](handleError(_0x55452e,null));};exports[_0x2963('0x24')]=function(_0x1a240d,_0x40267d){if(_0x1a240d[_0x2963('0x4c')]['id']){delete _0x1a240d[_0x2963('0x4c')]['id'];}return db[_0x2963('0x44')][_0x2963('0x49')]({'where':{'id':_0x1a240d[_0x2963('0x48')]['id']}})['then'](handleEntityNotFound(_0x40267d,null))[_0x2963('0x25')](saveUpdates(_0x1a240d['body'],null))[_0x2963('0x25')](respondWithResult(_0x40267d,null))[_0x2963('0x4a')](handleError(_0x40267d,null));};exports[_0x2963('0x26')]=function(_0x4fe8bc,_0x42218c){return db[_0x2963('0x44')][_0x2963('0x49')]({'where':{'id':_0x4fe8bc['params']['id']}})['then'](handleEntityNotFound(_0x42218c,null))[_0x2963('0x25')](removeEntity(_0x42218c,null))[_0x2963('0x4a')](handleError(_0x42218c,null));}; \ No newline at end of file +var _0xc762=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','map','ZohoField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','rows','show','keys','length','options','find','catch','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x26a0e5,_0x23f0e8){var _0x585403=function(_0x490d10){while(--_0x490d10){_0x26a0e5['push'](_0x26a0e5['shift']());}};_0x585403(++_0x23f0e8);}(_0xc762,0x92));var _0x2c76=function(_0x51308d,_0x42cf02){_0x51308d=_0x51308d-0x0;var _0x37cde8=_0xc762[_0x51308d];return _0x37cde8;};'use strict';var emlformat=require(_0x2c76('0x0'));var rimraf=require(_0x2c76('0x1'));var zipdir=require(_0x2c76('0x2'));var jsonpatch=require(_0x2c76('0x3'));var rp=require(_0x2c76('0x4'));var moment=require(_0x2c76('0x5'));var BPromise=require(_0x2c76('0x6'));var Mustache=require(_0x2c76('0x7'));var util=require(_0x2c76('0x8'));var path=require(_0x2c76('0x9'));var sox=require(_0x2c76('0xa'));var csv=require(_0x2c76('0xb'));var ejs=require(_0x2c76('0xc'));var fs=require('fs');var fs_extra=require(_0x2c76('0xd'));var _=require(_0x2c76('0xe'));var squel=require(_0x2c76('0xf'));var crypto=require('crypto');var jsforce=require(_0x2c76('0x10'));var deskjs=require(_0x2c76('0x11'));var toCsv=require(_0x2c76('0xb'));var querystring=require('querystring');var Papa=require(_0x2c76('0x12'));var Redis=require(_0x2c76('0x13'));var authService=require(_0x2c76('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c76('0x15'));var logger=require('../../config/logger')(_0x2c76('0x16'));var utils=require(_0x2c76('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2c76('0x18'))['db'];function respondWithStatusCode(_0x4e49e8,_0x23428d){_0x23428d=_0x23428d||0xcc;return function(_0x5b97b1){if(_0x5b97b1){return _0x4e49e8[_0x2c76('0x19')](_0x23428d);}return _0x4e49e8['status'](_0x23428d)[_0x2c76('0x1a')]();};}function respondWithResult(_0x3664aa,_0x7e730d){_0x7e730d=_0x7e730d||0xc8;return function(_0x1093d4){if(_0x1093d4){return _0x3664aa[_0x2c76('0x1b')](_0x7e730d)[_0x2c76('0x1c')](_0x1093d4);}};}function respondWithFilteredResult(_0x54ec6b,_0x57c8f4){return function(_0x10c65b){if(_0x10c65b){var _0x10078e=typeof _0x57c8f4['offset']===_0x2c76('0x1d')&&typeof _0x57c8f4[_0x2c76('0x1e')]===_0x2c76('0x1d');var _0x37162f=_0x10c65b[_0x2c76('0x1f')];var _0x57461c=_0x10078e?0x0:_0x57c8f4[_0x2c76('0x20')];var _0x176b45=_0x10078e?_0x10c65b['count']:_0x57c8f4['offset']+_0x57c8f4[_0x2c76('0x1e')];var _0x20bf15;if(_0x176b45>=_0x37162f){_0x176b45=_0x37162f;_0x20bf15=0xc8;}else{_0x20bf15=0xce;}_0x54ec6b[_0x2c76('0x1b')](_0x20bf15);return _0x54ec6b[_0x2c76('0x21')](_0x2c76('0x22'),_0x57461c+'-'+_0x176b45+'/'+_0x37162f)[_0x2c76('0x1c')](_0x10c65b);}return null;};}function patchUpdates(_0x45c5f5){return function(_0x1638d3){try{jsonpatch[_0x2c76('0x23')](_0x1638d3,_0x45c5f5,!![]);}catch(_0x26f6ae){return BPromise[_0x2c76('0x24')](_0x26f6ae);}return _0x1638d3[_0x2c76('0x25')]();};}function saveUpdates(_0x46b324,_0x5f24bc){return function(_0x2d2a71){if(_0x2d2a71){return _0x2d2a71['update'](_0x46b324)['then'](function(_0x497cc6){return _0x497cc6;});}return null;};}function removeEntity(_0xed1e6c,_0x22abba){return function(_0x5c794f){if(_0x5c794f){return _0x5c794f[_0x2c76('0x26')]()[_0x2c76('0x27')](function(){_0xed1e6c[_0x2c76('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21f73b,_0x701b34){return function(_0x23b9ee){if(!_0x23b9ee){_0x21f73b[_0x2c76('0x19')](0x194);}return _0x23b9ee;};}function handleError(_0x446bf9,_0x3ef034){_0x3ef034=_0x3ef034||0x1f4;return function(_0x3cd841){logger['error'](_0x3cd841[_0x2c76('0x28')]);if(_0x3cd841[_0x2c76('0x29')]){delete _0x3cd841[_0x2c76('0x29')];}_0x446bf9[_0x2c76('0x1b')](_0x3ef034)[_0x2c76('0x2a')](_0x3cd841);};}exports['index']=function(_0x38f967,_0x92dee0){var _0x28402f={},_0x48a03={},_0x2e6999={'count':0x0,'rows':[]};var _0x5a1c91=_[_0x2c76('0x2b')](db[_0x2c76('0x2c')][_0x2c76('0x2d')],function(_0x480c62){return{'name':_0x480c62[_0x2c76('0x2e')],'type':_0x480c62[_0x2c76('0x2f')][_0x2c76('0x30')]};});_0x48a03[_0x2c76('0x31')]=_[_0x2c76('0x2b')](_0x5a1c91,_0x2c76('0x29'));_0x48a03['query']=_['keys'](_0x38f967[_0x2c76('0x32')]);_0x48a03[_0x2c76('0x33')]=_[_0x2c76('0x34')](_0x48a03[_0x2c76('0x31')],_0x48a03[_0x2c76('0x32')]);_0x28402f[_0x2c76('0x35')]=_['intersection'](_0x48a03[_0x2c76('0x31')],qs[_0x2c76('0x36')](_0x38f967[_0x2c76('0x32')][_0x2c76('0x36')]));_0x28402f['attributes']=_0x28402f['attributes']['length']?_0x28402f[_0x2c76('0x35')]:_0x48a03['model'];if(!_0x38f967[_0x2c76('0x32')][_0x2c76('0x37')](_0x2c76('0x38'))){_0x28402f[_0x2c76('0x1e')]=qs[_0x2c76('0x1e')](_0x38f967[_0x2c76('0x32')]['limit']);_0x28402f[_0x2c76('0x20')]=qs[_0x2c76('0x20')](_0x38f967[_0x2c76('0x32')][_0x2c76('0x20')]);}_0x28402f[_0x2c76('0x39')]=qs[_0x2c76('0x3a')](_0x38f967[_0x2c76('0x32')][_0x2c76('0x3a')]);_0x28402f['where']=qs[_0x2c76('0x33')](_[_0x2c76('0x3b')](_0x38f967['query'],_0x48a03[_0x2c76('0x33')]),_0x5a1c91);if(_0x38f967[_0x2c76('0x32')][_0x2c76('0x3c')]){_0x28402f['where']=_['merge'](_0x28402f[_0x2c76('0x3d')],{'$or':_[_0x2c76('0x2b')](_0x5a1c91,function(_0x4cc7bc){if(_0x4cc7bc[_0x2c76('0x2f')]!=='VIRTUAL'){var _0x57ce22={};_0x57ce22[_0x4cc7bc[_0x2c76('0x29')]]={'$like':'%'+_0x38f967[_0x2c76('0x32')][_0x2c76('0x3c')]+'%'};return _0x57ce22;}})});}_0x28402f=_[_0x2c76('0x3e')]({},_0x28402f,_0x38f967['options']);var _0x5d4e70={'where':_0x28402f[_0x2c76('0x3d')]};return db[_0x2c76('0x2c')][_0x2c76('0x1f')](_0x5d4e70)[_0x2c76('0x27')](function(_0x490027){_0x2e6999[_0x2c76('0x1f')]=_0x490027;if(_0x38f967[_0x2c76('0x32')][_0x2c76('0x3f')]){_0x28402f[_0x2c76('0x40')]=[{'all':!![]}];}return db[_0x2c76('0x2c')]['findAll'](_0x28402f);})['then'](function(_0x5c105c){_0x2e6999[_0x2c76('0x41')]=_0x5c105c;return _0x2e6999;})[_0x2c76('0x27')](respondWithFilteredResult(_0x92dee0,_0x28402f))['catch'](handleError(_0x92dee0,null));};exports[_0x2c76('0x42')]=function(_0x558d04,_0x57714f){var _0x170843={'raw':!![],'where':{'id':_0x558d04['params']['id']}},_0x1eb94b={};_0x1eb94b[_0x2c76('0x31')]=_[_0x2c76('0x43')](db[_0x2c76('0x2c')][_0x2c76('0x2d')]);_0x1eb94b[_0x2c76('0x32')]=_['keys'](_0x558d04['query']);_0x1eb94b[_0x2c76('0x33')]=_[_0x2c76('0x34')](_0x1eb94b['model'],_0x1eb94b[_0x2c76('0x32')]);_0x170843[_0x2c76('0x35')]=_[_0x2c76('0x34')](_0x1eb94b[_0x2c76('0x31')],qs['fields'](_0x558d04[_0x2c76('0x32')][_0x2c76('0x36')]));_0x170843['attributes']=_0x170843['attributes'][_0x2c76('0x44')]?_0x170843[_0x2c76('0x35')]:_0x1eb94b['model'];if(_0x558d04[_0x2c76('0x32')]['includeAll']){_0x170843['include']=[{'all':!![]}];}_0x170843=_[_0x2c76('0x3e')]({},_0x170843,_0x558d04[_0x2c76('0x45')]);return db['ZohoField'][_0x2c76('0x46')](_0x170843)['then'](handleEntityNotFound(_0x57714f,null))['then'](respondWithResult(_0x57714f,null))[_0x2c76('0x47')](handleError(_0x57714f,null));};exports[_0x2c76('0x48')]=function(_0x54549a,_0x527804){return db[_0x2c76('0x2c')][_0x2c76('0x48')](_0x54549a[_0x2c76('0x49')],{})[_0x2c76('0x27')](respondWithResult(_0x527804,0xc9))[_0x2c76('0x47')](handleError(_0x527804,null));};exports[_0x2c76('0x4a')]=function(_0x355e85,_0x5e827f){if(_0x355e85[_0x2c76('0x49')]['id']){delete _0x355e85[_0x2c76('0x49')]['id'];}return db[_0x2c76('0x2c')][_0x2c76('0x46')]({'where':{'id':_0x355e85[_0x2c76('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5e827f,null))[_0x2c76('0x27')](saveUpdates(_0x355e85[_0x2c76('0x49')],null))[_0x2c76('0x27')](respondWithResult(_0x5e827f,null))['catch'](handleError(_0x5e827f,null));};exports[_0x2c76('0x26')]=function(_0x230a49,_0x3f763c){return db[_0x2c76('0x2c')][_0x2c76('0x46')]({'where':{'id':_0x230a49[_0x2c76('0x4b')]['id']}})[_0x2c76('0x27')](handleEntityNotFound(_0x3f763c,null))['then'](removeEntity(_0x3f763c,null))[_0x2c76('0x47')](handleError(_0x3f763c,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 2f437e9..eb1e708 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 _0x2da6=['api','moment','bluebird','request-promise','path','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger'];(function(_0xf17fec,_0x4400dc){var _0x1deabc=function(_0x27e4a5){while(--_0x27e4a5){_0xf17fec['push'](_0xf17fec['shift']());}};_0x1deabc(++_0x4400dc);}(_0x2da6,0x1dd));var _0x62da=function(_0x5dfb3c,_0x475c69){_0x5dfb3c=_0x5dfb3c-0x0;var _0x29edad=_0x2da6[_0x5dfb3c];return _0x29edad;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var logger=require(_0x62da('0x2'))(_0x62da('0x3'));var moment=require(_0x62da('0x4'));var BPromise=require(_0x62da('0x5'));var rp=require(_0x62da('0x6'));var fs=require('fs');var path=require(_0x62da('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x62da('0x8'));module[_0x62da('0x9')]=function(_0x3a59f8,_0x30437f){return _0x3a59f8[_0x62da('0xa')](_0x62da('0xb'),attributes,{'tableName':_0x62da('0xc'),'paranoid':![],'indexes':[{'name':_0x62da('0xd'),'fields':[_0x62da('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x524e=['define','ZohoField','zoho_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports'];(function(_0x45518f,_0x475a6b){var _0x198175=function(_0x40d333){while(--_0x40d333){_0x45518f['push'](_0x45518f['shift']());}};_0x198175(++_0x475a6b);}(_0x524e,0x15e));var _0xe524=function(_0x353798,_0x2f3f1b){_0x353798=_0x353798-0x0;var _0x5d03ef=_0x524e[_0x353798];return _0x5d03ef;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe524('0x0'))(_0xe524('0x1'));var moment=require(_0xe524('0x2'));var BPromise=require(_0xe524('0x3'));var rp=require(_0xe524('0x4'));var fs=require('fs');var path=require(_0xe524('0x5'));var rimraf=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var attributes=require(_0xe524('0x8'));module[_0xe524('0x9')]=function(_0x4f75d6,_0xaaeaa9){return _0x4f75d6[_0xe524('0xa')](_0xe524('0xb'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xe524('0xc'),'fields':[_0xe524('0xd'),_0xe524('0xe')],'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 8980114..2c794d5 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 _0x6e24=['info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x86ae3c,_0x2ad9de){var _0x1127a4=function(_0xa338e1){while(--_0xa338e1){_0x86ae3c['push'](_0x86ae3c['shift']());}};_0x1127a4(++_0x2ad9de);}(_0x6e24,0x106));var _0x46e2=function(_0x5796a6,_0x19dbaf){_0x5796a6=_0x5796a6-0x0;var _0x139e6e=_0x6e24[_0x5796a6];return _0x139e6e;};'use strict';var _=require(_0x46e2('0x0'));var util=require(_0x46e2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x46e2('0x2'));var fs=require('fs');var Redis=require(_0x46e2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x46e2('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x46e2('0x5'));var jayson=require(_0x46e2('0x6'));var client=jayson[_0x46e2('0x7')][_0x46e2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x333265,_0x22250f,_0x108e5e){return new BPromise(function(_0x3f3bf9,_0x438140){return client[_0x46e2('0x9')](_0x333265,_0x108e5e)[_0x46e2('0xa')](function(_0x4c1343){logger[_0x46e2('0xb')](_0x46e2('0xc'),_0x22250f,_0x46e2('0xd'));logger['debug'](_0x46e2('0xe'),_0x22250f,_0x46e2('0xd'),JSON[_0x46e2('0xf')](_0x4c1343));if(_0x4c1343[_0x46e2('0x10')]){if(_0x4c1343[_0x46e2('0x10')][_0x46e2('0x11')]===0x1f4){logger[_0x46e2('0x10')](_0x46e2('0xc'),_0x22250f,_0x4c1343[_0x46e2('0x10')]['message']);return _0x438140(_0x4c1343[_0x46e2('0x10')][_0x46e2('0x12')]);}logger['error'](_0x46e2('0xc'),_0x22250f,_0x4c1343[_0x46e2('0x10')][_0x46e2('0x12')]);return _0x3f3bf9(_0x4c1343[_0x46e2('0x10')][_0x46e2('0x12')]);}else{logger[_0x46e2('0xb')](_0x46e2('0xc'),_0x22250f,_0x46e2('0xd'));_0x3f3bf9(_0x4c1343[_0x46e2('0x13')][_0x46e2('0x12')]);}})[_0x46e2('0x14')](function(_0x25d1b8){logger[_0x46e2('0x10')](_0x46e2('0xc'),_0x22250f,_0x25d1b8);_0x438140(_0x25d1b8);});});} \ No newline at end of file +var _0x381a=['bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x128d4d,_0x319a91){var _0x71dd8e=function(_0xd6f97d){while(--_0xd6f97d){_0x128d4d['push'](_0x128d4d['shift']());}};_0x71dd8e(++_0x319a91);}(_0x381a,0x1a2));var _0xa381=function(_0x8bc1f0,_0x2b6d35){_0x8bc1f0=_0x8bc1f0-0x0;var _0x21634=_0x381a[_0x8bc1f0];return _0x21634;};'use strict';var _=require(_0xa381('0x0'));var util=require(_0xa381('0x1'));var moment=require('moment');var BPromise=require(_0xa381('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa381('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa381('0x4'))(_0xa381('0x5'));var config=require(_0xa381('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa381('0x7')][_0xa381('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x241376,_0x13bbe4,_0x3a9454){return new BPromise(function(_0x34dcf9,_0x4c058e){return client[_0xa381('0x9')](_0x241376,_0x3a9454)[_0xa381('0xa')](function(_0x32c57c){logger[_0xa381('0xb')](_0xa381('0xc'),_0x13bbe4,_0xa381('0xd'));logger[_0xa381('0xe')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x13bbe4,'request\x20sent',JSON[_0xa381('0xf')](_0x32c57c));if(_0x32c57c[_0xa381('0x10')]){if(_0x32c57c[_0xa381('0x10')][_0xa381('0x11')]===0x1f4){logger[_0xa381('0x10')](_0xa381('0xc'),_0x13bbe4,_0x32c57c[_0xa381('0x10')][_0xa381('0x12')]);return _0x4c058e(_0x32c57c[_0xa381('0x10')][_0xa381('0x12')]);}logger[_0xa381('0x10')](_0xa381('0xc'),_0x13bbe4,_0x32c57c[_0xa381('0x10')][_0xa381('0x12')]);return _0x34dcf9(_0x32c57c[_0xa381('0x10')][_0xa381('0x12')]);}else{logger['info'](_0xa381('0xc'),_0x13bbe4,'request\x20sent');_0x34dcf9(_0x32c57c[_0xa381('0x13')][_0xa381('0x12')]);}})[_0xa381('0x14')](function(_0x523dfa){logger[_0xa381('0x10')](_0xa381('0xc'),_0x13bbe4,_0x523dfa);_0x4c058e(_0x523dfa);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 9dddfab..b4a9462 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3f2fea,_0x3c4ea8){var _0x69a4d5=function(_0x223109){while(--_0x223109){_0x3f2fea['push'](_0x3f2fea['shift']());}};_0x69a4d5(++_0x3c4ea8);}(_0x9c44,0x178));var _0x49c4=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x9c44[_0x2d2c16];return _0x53f2fb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4693b8,_0xff4dcc){var _0x117328=function(_0x847a02){while(--_0x847a02){_0x4693b8['push'](_0x4693b8['shift']());}};_0x117328(++_0xff4dcc);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index ec42582..d4efa3e 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 _0x9459=['state','sequelize','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN'];(function(_0x4097fc,_0x340bc1){var _0x5c75b5=function(_0x3b480a){while(--_0x3b480a){_0x4097fc['push'](_0x4097fc['shift']());}};_0x5c75b5(++_0x340bc1);}(_0x9459,0x1f2));var _0x9945=function(_0x1e0e5e,_0x416427){_0x1e0e5e=_0x1e0e5e-0x0;var _0x3707e9=_0x9459[_0x1e0e5e];return _0x3707e9;};'use strict';var Sequelize=require(_0x9945('0x0'));module['exports']={'name':{'type':Sequelize[_0x9945('0x1')],'allowNull':![],'unique':_0x9945('0x2')},'version':{'type':Sequelize[_0x9945('0x1')],'allowNull':![],'unique':_0x9945('0x2')},'main':{'type':Sequelize[_0x9945('0x1')],'defaultValue':_0x9945('0x3')},'filename':{'type':Sequelize[_0x9945('0x1')]},'path':{'type':Sequelize[_0x9945('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x9945('0x4')]},'active':{'type':Sequelize[_0x9945('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x9945('0x1')]},'state':{'type':Sequelize[_0x9945('0x1')],'unique':_0x9945('0x6')},'description':{'type':Sequelize[_0x9945('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x9945('0x1')]},'link':{'type':Sequelize[_0x9945('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0xc15e=['unique_name_and_version','INTEGER','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x401c2a,_0x3aa4bb){var _0x303419=function(_0x4a9f9d){while(--_0x4a9f9d){_0x401c2a['push'](_0x401c2a['shift']());}};_0x303419(++_0x3aa4bb);}(_0xc15e,0x154));var _0xec15=function(_0x475e73,_0x57d609){_0x475e73=_0x475e73-0x0;var _0x622ab7=_0xc15e[_0x475e73];return _0x622ab7;};'use strict';var Sequelize=require(_0xec15('0x0'));module[_0xec15('0x1')]={'name':{'type':Sequelize[_0xec15('0x2')],'allowNull':![],'unique':_0xec15('0x3')},'version':{'type':Sequelize[_0xec15('0x2')],'allowNull':![],'unique':_0xec15('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xec15('0x2')]},'path':{'type':Sequelize[_0xec15('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xec15('0x4')]},'active':{'type':Sequelize[_0xec15('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xec15('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0xec15('0x6')},'description':{'type':Sequelize[_0xec15('0x2')]},'title':{'type':Sequelize[_0xec15('0x2')]},'remoteUri':{'type':Sequelize[_0xec15('0x2')]},'link':{'type':Sequelize[_0xec15('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index b05f726..45484a4 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 _0x9f0e=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js'];(function(_0x549552,_0x1ad961){var _0x3700ef=function(_0x285a0d){while(--_0x285a0d){_0x549552['push'](_0x549552['shift']());}};_0x3700ef(++_0x1ad961);}(_0x9f0e,0x116));var _0xe9f0=function(_0x277927,_0x4e22e3){_0x277927=_0x277927-0x0;var _0x1fcae0=_0x9f0e[_0x277927];return _0x1fcae0;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];function respondWithStatusCode(_0x586763,_0x367545){_0x367545=_0x367545||0xcc;return function(_0xd82420){if(_0xd82420){return _0x586763[_0xe9f0('0x19')](_0x367545);}return _0x586763[_0xe9f0('0x1a')](_0x367545)['end']();};}function respondWithResult(_0x2cf75d,_0x5a10c6){_0x5a10c6=_0x5a10c6||0xc8;return function(_0x1e3ba8){if(_0x1e3ba8){return _0x2cf75d[_0xe9f0('0x1a')](_0x5a10c6)[_0xe9f0('0x1b')](_0x1e3ba8);}};}function respondWithFilteredResult(_0x59320d,_0x28bfac){return function(_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=typeof _0x28bfac['offset']===_0xe9f0('0x1c')&&typeof _0x28bfac[_0xe9f0('0x1d')]===_0xe9f0('0x1c');var _0xd71ac8=_0x33e9e4[_0xe9f0('0x1e')];var _0x2ab12b=_0x2e68ef?0x0:_0x28bfac[_0xe9f0('0x1f')];var _0x59bf5a=_0x2e68ef?_0x33e9e4[_0xe9f0('0x1e')]:_0x28bfac[_0xe9f0('0x1f')]+_0x28bfac[_0xe9f0('0x1d')];var _0x5c4182;if(_0x59bf5a>=_0xd71ac8){_0x59bf5a=_0xd71ac8;_0x5c4182=0xc8;}else{_0x5c4182=0xce;}_0x59320d[_0xe9f0('0x1a')](_0x5c4182);return _0x59320d[_0xe9f0('0x20')](_0xe9f0('0x21'),_0x2ab12b+'-'+_0x59bf5a+'/'+_0xd71ac8)[_0xe9f0('0x1b')](_0x33e9e4);}return null;};}function patchUpdates(_0x5ba788){return function(_0x33f143){try{jsonpatch[_0xe9f0('0x22')](_0x33f143,_0x5ba788,!![]);}catch(_0x583687){return BPromise['reject'](_0x583687);}return _0x33f143['save']();};}function saveUpdates(_0x12fe9f,_0xa1ddc){return function(_0x1211ae){if(_0x1211ae){return _0x1211ae[_0xe9f0('0x23')](_0x12fe9f)[_0xe9f0('0x24')](function(_0x4a5c27){return _0x4a5c27;});}return null;};}function removeEntity(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(_0x437d43){return _0x437d43[_0xe9f0('0x25')]()[_0xe9f0('0x24')](function(){_0x229fe0[_0xe9f0('0x1a')](0xcc)[_0xe9f0('0x26')]();});}};}function handleEntityNotFound(_0x1321bb,_0x3c4ba9){return function(_0x3fce54){if(!_0x3fce54){_0x1321bb['sendStatus'](0x194);}return _0x3fce54;};}function handleError(_0x371095,_0x27541f){_0x27541f=_0x27541f||0x1f4;return function(_0x2ddfba){logger[_0xe9f0('0x27')](_0x2ddfba['stack']);if(_0x2ddfba[_0xe9f0('0x28')]){delete _0x2ddfba[_0xe9f0('0x28')];}_0x371095[_0xe9f0('0x1a')](_0x27541f)[_0xe9f0('0x29')](_0x2ddfba);};}exports[_0xe9f0('0x2a')]=function(_0x5457f6,_0x130f96){var _0xdc16bc={},_0x44fb5b={},_0xab3d81={'count':0x0,'rows':[]};var _0xa27c84=_[_0xe9f0('0x2b')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')],function(_0x2b6503){return{'name':_0x2b6503[_0xe9f0('0x2e')],'type':_0x2b6503[_0xe9f0('0x2f')][_0xe9f0('0x30')]};});_0x44fb5b[_0xe9f0('0x31')]=_[_0xe9f0('0x2b')](_0xa27c84,_0xe9f0('0x28'));_0x44fb5b[_0xe9f0('0x32')]=_[_0xe9f0('0x33')](_0x5457f6[_0xe9f0('0x32')]);_0x44fb5b[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x44fb5b[_0xe9f0('0x31')],_0x44fb5b[_0xe9f0('0x32')]);_0xdc16bc[_0xe9f0('0x36')]=_[_0xe9f0('0x35')](_0x44fb5b['model'],qs['fields'](_0x5457f6['query'][_0xe9f0('0x37')]));_0xdc16bc['attributes']=_0xdc16bc[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0xdc16bc['attributes']:_0x44fb5b[_0xe9f0('0x31')];if(!_0x5457f6['query']['hasOwnProperty']('nolimit')){_0xdc16bc[_0xe9f0('0x1d')]=qs[_0xe9f0('0x1d')](_0x5457f6['query'][_0xe9f0('0x1d')]);_0xdc16bc[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x5457f6['query']['offset']);}_0xdc16bc[_0xe9f0('0x39')]=qs[_0xe9f0('0x3a')](_0x5457f6[_0xe9f0('0x32')]['sort']);_0xdc16bc[_0xe9f0('0x3b')]=qs[_0xe9f0('0x34')](_[_0xe9f0('0x3c')](_0x5457f6[_0xe9f0('0x32')],_0x44fb5b[_0xe9f0('0x34')]),_0xa27c84);if(_0x5457f6['query'][_0xe9f0('0x3d')]){_0xdc16bc[_0xe9f0('0x3b')]=_[_0xe9f0('0x3e')](_0xdc16bc['where'],{'$or':_[_0xe9f0('0x2b')](_0xa27c84,function(_0xbec11f){if(_0xbec11f['type']!==_0xe9f0('0x3f')){var _0x5154c3={};_0x5154c3[_0xbec11f[_0xe9f0('0x28')]]={'$like':'%'+_0x5457f6['query']['filter']+'%'};return _0x5154c3;}})});}_0xdc16bc=_['merge']({},_0xdc16bc,_0x5457f6['options']);var _0x5165f7={'where':_0xdc16bc[_0xe9f0('0x3b')]};return db[_0xe9f0('0x2c')][_0xe9f0('0x1e')](_0x5165f7)[_0xe9f0('0x24')](function(_0x2560c6){_0xab3d81[_0xe9f0('0x1e')]=_0x2560c6;if(_0x5457f6[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0xdc16bc[_0xe9f0('0x41')]=[{'all':!![]}];}return db['Integration'][_0xe9f0('0x42')](_0xdc16bc);})[_0xe9f0('0x24')](function(_0x36b00a){_0xab3d81['rows']=_0x36b00a;return _0xab3d81;})['then'](respondWithFilteredResult(_0x130f96,_0xdc16bc))[_0xe9f0('0x43')](handleError(_0x130f96,null));};exports['show']=function(_0x297689,_0x52613a){var _0x314f0e={'raw':![],'where':{'id':_0x297689['params']['id']}},_0x42d9d2={};_0x42d9d2[_0xe9f0('0x31')]=_[_0xe9f0('0x33')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')]);_0x42d9d2[_0xe9f0('0x32')]=_['keys'](_0x297689[_0xe9f0('0x32')]);_0x42d9d2[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x42d9d2[_0xe9f0('0x31')],_0x42d9d2[_0xe9f0('0x32')]);_0x314f0e['attributes']=_[_0xe9f0('0x35')](_0x42d9d2['model'],qs['fields'](_0x297689[_0xe9f0('0x32')][_0xe9f0('0x37')]));_0x314f0e['attributes']=_0x314f0e[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0x314f0e[_0xe9f0('0x36')]:_0x42d9d2[_0xe9f0('0x31')];if(_0x297689[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0x314f0e[_0xe9f0('0x41')]=[{'all':!![]}];}_0x314f0e=_['merge']({},_0x314f0e,_0x297689[_0xe9f0('0x44')]);return db['Integration'][_0xe9f0('0x45')](_0x314f0e)['then'](handleEntityNotFound(_0x52613a,null))[_0xe9f0('0x24')](respondWithResult(_0x52613a,null))['catch'](handleError(_0x52613a,null));};exports[_0xe9f0('0x46')]=function(_0x2023b4,_0x422324){return db['Integration'][_0xe9f0('0x46')](_0x2023b4[_0xe9f0('0x47')],{})[_0xe9f0('0x24')](respondWithResult(_0x422324,0xc9))[_0xe9f0('0x43')](handleError(_0x422324,null));};exports[_0xe9f0('0x23')]=function(_0x135175,_0x6ece3f){if(_0x135175[_0xe9f0('0x47')]['id']){delete _0x135175[_0xe9f0('0x47')]['id'];}return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x135175[_0xe9f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x6ece3f,null))['then'](saveUpdates(_0x135175[_0xe9f0('0x47')],null))[_0xe9f0('0x24')](respondWithResult(_0x6ece3f,null))[_0xe9f0('0x43')](handleError(_0x6ece3f,null));};exports['destroy']=function(_0x1ac381,_0x4d8b2e){return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x1ac381[_0xe9f0('0x48')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4d8b2e,null))['then'](removeEntity(_0x4d8b2e,null))[_0xe9f0('0x43')](handleError(_0x4d8b2e,null));}; \ No newline at end of file +var _0x187d=['body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','Integration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','create'];(function(_0x5ae7ae,_0x534c34){var _0x5929f7=function(_0xeabd3a){while(--_0xeabd3a){_0x5ae7ae['push'](_0x5ae7ae['shift']());}};_0x5929f7(++_0x534c34);}(_0x187d,0x93));var _0xd187=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x187d[_0x18a79d];return _0x4f8848;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')](_0x3ce4a1[_0xd187('0x48')],{})['then'](respondWithResult(_0x3f5def,0xc9))[_0xd187('0x41')](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x4523c8,_0x1449d7){if(_0x4523c8[_0xd187('0x48')]['id']){delete _0x4523c8['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x4523c8['params']['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x1449d7,null))[_0xd187('0x3f')](saveUpdates(_0x4523c8['body'],null))['then'](respondWithResult(_0x1449d7,null))['catch'](handleError(_0x1449d7,null));};exports['destroy']=function(_0x473bef,_0x22f432){return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x473bef[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x22f432,null))[_0xd187('0x3f')](removeEntity(_0x22f432,null))['catch'](handleError(_0x22f432,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 702a958..781a44b 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 _0xad5b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','define','Integration','integrations','lodash','util','../../config/logger','api'];(function(_0x2225a8,_0x7f709){var _0x424240=function(_0x150f48){while(--_0x150f48){_0x2225a8['push'](_0x2225a8['shift']());}};_0x424240(++_0x7f709);}(_0xad5b,0xce));var _0xbad5=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0xad5b[_0xabfec4];return _0x7bafa2;};'use strict';var _=require(_0xbad5('0x0'));var util=require(_0xbad5('0x1'));var logger=require(_0xbad5('0x2'))(_0xbad5('0x3'));var moment=require(_0xbad5('0x4'));var BPromise=require(_0xbad5('0x5'));var rp=require(_0xbad5('0x6'));var fs=require('fs');var path=require(_0xbad5('0x7'));var rimraf=require(_0xbad5('0x8'));var config=require(_0xbad5('0x9'));var attributes=require(_0xbad5('0xa'));module['exports']=function(_0x3addb7,_0x25744f){return _0x3addb7[_0xbad5('0xb')](_0xbad5('0xc'),attributes,{'tableName':_0xbad5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe808=['../../config/environment','exports','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x187dfb,_0x33bfce){var _0x1116df=function(_0x5b5ae6){while(--_0x5b5ae6){_0x187dfb['push'](_0x187dfb['shift']());}};_0x1116df(++_0x33bfce);}(_0xe808,0xd0));var _0x8e80=function(_0xe58478,_0x20668c){_0xe58478=_0xe58478-0x0;var _0xc326b=_0xe808[_0xe58478];return _0xc326b;};'use strict';var _=require(_0x8e80('0x0'));var util=require(_0x8e80('0x1'));var logger=require(_0x8e80('0x2'))(_0x8e80('0x3'));var moment=require(_0x8e80('0x4'));var BPromise=require(_0x8e80('0x5'));var rp=require(_0x8e80('0x6'));var fs=require('fs');var path=require(_0x8e80('0x7'));var rimraf=require('rimraf');var config=require(_0x8e80('0x8'));var attributes=require('./integration.attributes');module[_0x8e80('0x9')]=function(_0xb363d4,_0x1fdff5){return _0xb363d4['define'](_0x8e80('0xa'),attributes,{'tableName':_0x8e80('0xb'),'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 e8464ba..6e8daed 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 _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x265e0e,_0x38b2bb){var _0x518157=function(_0x1e3eab){while(--_0x1e3eab){_0x265e0e['push'](_0x265e0e['shift']());}};_0x518157(++_0x38b2bb);}(_0x524e,0x15e));var _0xe524=function(_0x5c3951,_0x15252a){_0x5c3951=_0x5c3951-0x0;var _0x588794=_0x524e[_0x5c3951];return _0x588794;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('Integration,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('Integration,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('Integration,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x4975,0x86));var _0x5497=function(_0x34a6de,_0x3e4de7){_0x34a6de=_0x34a6de-0x0;var _0x502c97=_0x4975[_0x34a6de];return _0x502c97;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Integration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index cfc6e30..5077957 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 _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','post','put','update','delete','/:id'];(function(_0xa70160,_0x466281){var _0x452ee6=function(_0xd78c76){while(--_0xd78c76){_0xa70160['push'](_0xa70160['shift']());}};_0x452ee6(++_0x466281);}(_0x7a54,0x106));var _0x47a5=function(_0x42ef04,_0x335e42){_0x42ef04=_0x42ef04-0x0;var _0x120459=_0x7a54[_0x42ef04];return _0x120459;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0x11'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file +var _0xc6ac=['./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1d2e70,_0x144e1f){var _0x4c8a00=function(_0x197ca8){while(--_0x197ca8){_0x1d2e70['push'](_0x1d2e70['shift']());}};_0x4c8a00(++_0x144e1f);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x253f75,_0x21fc1f){_0x253f75=_0x253f75-0x0;var _0x24ddc2=_0xc6ac[_0x253f75];return _0x24ddc2;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0x12')]('/',auth[_0xcc6a('0xc')](),controller['create']);router[_0xcc6a('0x13')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['update']);router[_0xcc6a('0x14')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 1349fbb..830fa51 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 _0x18e1=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','RECEIVED','FAILED','exports'];(function(_0x3aa055,_0x33fcc6){var _0x629941=function(_0x4a179d){while(--_0x4a179d){_0x3aa055['push'](_0x3aa055['shift']());}};_0x629941(++_0x33fcc6);}(_0x18e1,0x11f));var _0x118e=function(_0x332c95,_0x3ba243){_0x332c95=_0x332c95-0x0;var _0x5d0df1=_0x18e1[_0x332c95];return _0x5d0df1;};'use strict';var Sequelize=require('sequelize');module[_0x118e('0x0')]={'integration':{'type':Sequelize[_0x118e('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x118e('0x1')]},'integrationId':{'type':Sequelize[_0x118e('0x2')]},'contacts':{'type':Sequelize[_0x118e('0x1')]},'uniqueid':{'type':Sequelize[_0x118e('0x1')]},'calleridnum':{'type':Sequelize[_0x118e('0x1')]},'calleridname':{'type':Sequelize[_0x118e('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x118e('0x1')]},'agentcalledAt':{'type':Sequelize[_0x118e('0x3')]},'agentconnectAt':{'type':Sequelize[_0x118e('0x3')]},'holdtime':{'type':Sequelize[_0x118e('0x2')]},'agentcomplete':{'type':Sequelize[_0x118e('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x118e('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x118e('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x118e('0x3')]},'lastevent':{'type':Sequelize[_0x118e('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x118e('0x2')]},'channelstatedesc':{'type':Sequelize[_0x118e('0x1')]},'connectedlinenum':{'type':Sequelize[_0x118e('0x1')]},'connectedlinename':{'type':Sequelize[_0x118e('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x118e('0x1')]},'context':{'type':Sequelize[_0x118e('0x1')]},'exten':{'type':Sequelize[_0x118e('0x1')]},'priority':{'type':Sequelize[_0x118e('0x1')]},'destchannel':{'type':Sequelize[_0x118e('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x118e('0x1')]},'destcalleridnum':{'type':Sequelize[_0x118e('0x1')]},'destcalleridname':{'type':Sequelize[_0x118e('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x118e('0x1')]},'destlanguage':{'type':Sequelize[_0x118e('0x1')]},'destaccountcode':{'type':Sequelize[_0x118e('0x1')]},'destcontext':{'type':Sequelize[_0x118e('0x1')]},'destexten':{'type':Sequelize[_0x118e('0x1')]},'destpriority':{'type':Sequelize[_0x118e('0x1')]},'destuniqueid':{'type':Sequelize[_0x118e('0x1')]},'messageId':{'type':Sequelize[_0x118e('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x118e('0x1')]},'from':{'type':Sequelize[_0x118e('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x118e('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x118e('0x5')]},'text':{'type':Sequelize[_0x118e('0x5')]},'status':{'type':Sequelize[_0x118e('0x6')]('SENT','SENDING',_0x118e('0x7'),_0x118e('0x8'))},'url':{'type':Sequelize[_0x118e('0x1')]},'app':{'type':Sequelize[_0x118e('0x1')]},'appdata':{'type':Sequelize[_0x118e('0x1')]},'projectId':{'type':Sequelize[_0x118e('0x2')]}}; \ No newline at end of file +var _0x2ce3=['SENDING','RECEIVED','FAILED','sequelize','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x2ce3,0x125));var _0x32ce=function(_0x9e3f01,_0x54f29b){_0x9e3f01=_0x9e3f01-0x0;var _0x2fb260=_0x2ce3[_0x9e3f01];return _0x2fb260;};'use strict';var Sequelize=require(_0x32ce('0x0'));module['exports']={'integration':{'type':Sequelize[_0x32ce('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x32ce('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x32ce('0x2')]},'contacts':{'type':Sequelize[_0x32ce('0x1')]},'uniqueid':{'type':Sequelize[_0x32ce('0x1')]},'calleridnum':{'type':Sequelize[_0x32ce('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x32ce('0x1')]},'interface':{'type':Sequelize[_0x32ce('0x1')]},'membername':{'type':Sequelize[_0x32ce('0x1')]},'agentcalledAt':{'type':Sequelize[_0x32ce('0x3')]},'agentconnectAt':{'type':Sequelize[_0x32ce('0x3')]},'holdtime':{'type':Sequelize[_0x32ce('0x2')]},'agentcomplete':{'type':Sequelize[_0x32ce('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x32ce('0x2')]},'agentacw':{'type':Sequelize[_0x32ce('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x32ce('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x32ce('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x32ce('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x32ce('0x1')]},'channel':{'type':Sequelize[_0x32ce('0x1')]},'channelstate':{'type':Sequelize[_0x32ce('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x32ce('0x1')]},'connectedlinename':{'type':Sequelize[_0x32ce('0x1')]},'language':{'type':Sequelize[_0x32ce('0x1')]},'accountcode':{'type':Sequelize[_0x32ce('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x32ce('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x32ce('0x1')]},'destchannelstate':{'type':Sequelize[_0x32ce('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x32ce('0x1')]},'destcalleridnum':{'type':Sequelize[_0x32ce('0x1')]},'destcalleridname':{'type':Sequelize[_0x32ce('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x32ce('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x32ce('0x1')]},'destlanguage':{'type':Sequelize[_0x32ce('0x1')]},'destaccountcode':{'type':Sequelize[_0x32ce('0x1')]},'destcontext':{'type':Sequelize[_0x32ce('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x32ce('0x1')]},'destuniqueid':{'type':Sequelize[_0x32ce('0x1')]},'messageId':{'type':Sequelize[_0x32ce('0x1')]},'inReplyTo':{'type':Sequelize[_0x32ce('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x32ce('0x1')]},'to':{'type':Sequelize[_0x32ce('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x32ce('0x5')]},'status':{'type':Sequelize['ENUM'](_0x32ce('0x6'),_0x32ce('0x7'),_0x32ce('0x8'),_0x32ce('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x32ce('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x32ce('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index c391a85..f181e1f 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 _0xc929=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','json','reject','save','update','then','destroy','end','error','stack','name','index','map','IntegrationReport','rawAttributes','type','key','model','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','fields','include','merge','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service'];(function(_0x43dfa5,_0x2a8e57){var _0x45834d=function(_0x409b2b){while(--_0x409b2b){_0x43dfa5['push'](_0x43dfa5['shift']());}};_0x45834d(++_0x2a8e57);}(_0xc929,0x170));var _0x9c92=function(_0x3b8c08,_0x2eed8e){_0x3b8c08=_0x3b8c08-0x0;var _0x4d27ce=_0xc929[_0x3b8c08];return _0x4d27ce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9c92('0x0'));var zipdir=require(_0x9c92('0x1'));var jsonpatch=require(_0x9c92('0x2'));var rp=require(_0x9c92('0x3'));var moment=require(_0x9c92('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c92('0x5'));var util=require(_0x9c92('0x6'));var path=require(_0x9c92('0x7'));var sox=require(_0x9c92('0x8'));var csv=require('to-csv');var ejs=require(_0x9c92('0x9'));var fs=require('fs');var fs_extra=require(_0x9c92('0xa'));var _=require('lodash');var squel=require(_0x9c92('0xb'));var crypto=require(_0x9c92('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9c92('0xd'));var querystring=require('querystring');var Papa=require(_0x9c92('0xe'));var Redis=require(_0x9c92('0xf'));var authService=require(_0x9c92('0x10'));var qs=require(_0x9c92('0x11'));var as=require(_0x9c92('0x12'));var hardwareService=require(_0x9c92('0x13'));var logger=require(_0x9c92('0x14'))(_0x9c92('0x15'));var utils=require(_0x9c92('0x16'));var config=require(_0x9c92('0x17'));var licenseUtil=require(_0x9c92('0x18'));var db=require(_0x9c92('0x19'))['db'];function respondWithStatusCode(_0x43a451,_0x54f4b4){_0x54f4b4=_0x54f4b4||0xcc;return function(_0x205408){if(_0x205408){return _0x43a451[_0x9c92('0x1a')](_0x54f4b4);}return _0x43a451['status'](_0x54f4b4)['end']();};}function respondWithResult(_0x2d5739,_0x504801){_0x504801=_0x504801||0xc8;return function(_0x19b5b2){if(_0x19b5b2){return _0x2d5739[_0x9c92('0x1b')](_0x504801)['json'](_0x19b5b2);}};}function respondWithFilteredResult(_0x2c654d,_0x28b15e){return function(_0xc2abb7){if(_0xc2abb7){var _0x87150=typeof _0x28b15e[_0x9c92('0x1c')]===_0x9c92('0x1d')&&typeof _0x28b15e['limit']===_0x9c92('0x1d');var _0x32c635=_0xc2abb7[_0x9c92('0x1e')];var _0x281755=_0x87150?0x0:_0x28b15e['offset'];var _0x416541=_0x87150?_0xc2abb7[_0x9c92('0x1e')]:_0x28b15e[_0x9c92('0x1c')]+_0x28b15e['limit'];var _0x21d08e;if(_0x416541>=_0x32c635){_0x416541=_0x32c635;_0x21d08e=0xc8;}else{_0x21d08e=0xce;}_0x2c654d[_0x9c92('0x1b')](_0x21d08e);return _0x2c654d['set']('Content-Range',_0x281755+'-'+_0x416541+'/'+_0x32c635)[_0x9c92('0x1f')](_0xc2abb7);}return null;};}function patchUpdates(_0x4657ff){return function(_0x460aac){try{jsonpatch['apply'](_0x460aac,_0x4657ff,!![]);}catch(_0x116c99){return BPromise[_0x9c92('0x20')](_0x116c99);}return _0x460aac[_0x9c92('0x21')]();};}function saveUpdates(_0x2b26ef,_0xf41dc8){return function(_0x14ad31){if(_0x14ad31){return _0x14ad31[_0x9c92('0x22')](_0x2b26ef)[_0x9c92('0x23')](function(_0x498d77){return _0x498d77;});}return null;};}function removeEntity(_0x1d1edb,_0x5a0e9a){return function(_0x2b8a2a){if(_0x2b8a2a){return _0x2b8a2a[_0x9c92('0x24')]()[_0x9c92('0x23')](function(){_0x1d1edb['status'](0xcc)[_0x9c92('0x25')]();});}};}function handleEntityNotFound(_0x4c076a,_0x1abf4e){return function(_0x5d6baa){if(!_0x5d6baa){_0x4c076a[_0x9c92('0x1a')](0x194);}return _0x5d6baa;};}function handleError(_0x3e5779,_0x2700fd){_0x2700fd=_0x2700fd||0x1f4;return function(_0x1805b1){logger[_0x9c92('0x26')](_0x1805b1[_0x9c92('0x27')]);if(_0x1805b1[_0x9c92('0x28')]){delete _0x1805b1[_0x9c92('0x28')];}_0x3e5779[_0x9c92('0x1b')](_0x2700fd)['send'](_0x1805b1);};}exports[_0x9c92('0x29')]=function(_0x5614e7,_0x4c0ba8){var _0x52032e={},_0x2b230d={},_0x3e7e64={'count':0x0,'rows':[]};var _0x295b30=_[_0x9c92('0x2a')](db[_0x9c92('0x2b')][_0x9c92('0x2c')],function(_0x882f56){return{'name':_0x882f56['fieldName'],'type':_0x882f56[_0x9c92('0x2d')][_0x9c92('0x2e')]};});_0x2b230d[_0x9c92('0x2f')]=_[_0x9c92('0x2a')](_0x295b30,'name');_0x2b230d['query']=_['keys'](_0x5614e7['query']);_0x2b230d[_0x9c92('0x30')]=_[_0x9c92('0x31')](_0x2b230d[_0x9c92('0x2f')],_0x2b230d['query']);_0x52032e['attributes']=_[_0x9c92('0x31')](_0x2b230d[_0x9c92('0x2f')],qs['fields'](_0x5614e7[_0x9c92('0x32')]['fields']));_0x52032e[_0x9c92('0x33')]=_0x52032e['attributes'][_0x9c92('0x34')]?_0x52032e[_0x9c92('0x33')]:_0x2b230d[_0x9c92('0x2f')];if(!_0x5614e7['query'][_0x9c92('0x35')](_0x9c92('0x36'))){_0x52032e[_0x9c92('0x37')]=qs[_0x9c92('0x37')](_0x5614e7[_0x9c92('0x32')][_0x9c92('0x37')]);_0x52032e[_0x9c92('0x1c')]=qs[_0x9c92('0x1c')](_0x5614e7[_0x9c92('0x32')]['offset']);}_0x52032e[_0x9c92('0x38')]=qs[_0x9c92('0x39')](_0x5614e7[_0x9c92('0x32')][_0x9c92('0x39')]);_0x52032e[_0x9c92('0x3a')]=qs[_0x9c92('0x30')](_[_0x9c92('0x3b')](_0x5614e7['query'],_0x2b230d[_0x9c92('0x30')]),_0x295b30);if(_0x5614e7[_0x9c92('0x32')][_0x9c92('0x3c')]){_0x52032e[_0x9c92('0x3a')]=_['merge'](_0x52032e[_0x9c92('0x3a')],{'$or':_[_0x9c92('0x2a')](_0x295b30,function(_0x5c3f63){if(_0x5c3f63[_0x9c92('0x2d')]!==_0x9c92('0x3d')){var _0x474f63={};_0x474f63[_0x5c3f63[_0x9c92('0x28')]]={'$like':'%'+_0x5614e7['query'][_0x9c92('0x3c')]+'%'};return _0x474f63;}})});}_0x52032e=_['merge']({},_0x52032e,_0x5614e7[_0x9c92('0x3e')]);var _0x571f75={'where':_0x52032e[_0x9c92('0x3a')]};return db[_0x9c92('0x2b')][_0x9c92('0x1e')](_0x571f75)['then'](function(_0x185caa){_0x3e7e64[_0x9c92('0x1e')]=_0x185caa;if(_0x5614e7[_0x9c92('0x32')][_0x9c92('0x3f')]){_0x52032e['include']=[{'all':!![]}];}return db[_0x9c92('0x2b')][_0x9c92('0x40')](_0x52032e);})[_0x9c92('0x23')](function(_0x2e3a21){_0x3e7e64[_0x9c92('0x41')]=_0x2e3a21;return _0x3e7e64;})[_0x9c92('0x23')](respondWithFilteredResult(_0x4c0ba8,_0x52032e))[_0x9c92('0x42')](handleError(_0x4c0ba8,null));};exports[_0x9c92('0x43')]=function(_0x3c0d80,_0xc012ec){var _0x44596f={'raw':![],'where':{'id':_0x3c0d80[_0x9c92('0x44')]['id']}},_0x2b70d5={};_0x2b70d5[_0x9c92('0x2f')]=_[_0x9c92('0x45')](db[_0x9c92('0x2b')][_0x9c92('0x2c')]);_0x2b70d5[_0x9c92('0x32')]=_[_0x9c92('0x45')](_0x3c0d80['query']);_0x2b70d5[_0x9c92('0x30')]=_[_0x9c92('0x31')](_0x2b70d5[_0x9c92('0x2f')],_0x2b70d5[_0x9c92('0x32')]);_0x44596f[_0x9c92('0x33')]=_[_0x9c92('0x31')](_0x2b70d5['model'],qs['fields'](_0x3c0d80[_0x9c92('0x32')][_0x9c92('0x46')]));_0x44596f[_0x9c92('0x33')]=_0x44596f[_0x9c92('0x33')][_0x9c92('0x34')]?_0x44596f['attributes']:_0x2b70d5[_0x9c92('0x2f')];if(_0x3c0d80[_0x9c92('0x32')]['includeAll']){_0x44596f[_0x9c92('0x47')]=[{'all':!![]}];}_0x44596f=_[_0x9c92('0x48')]({},_0x44596f,_0x3c0d80['options']);return db[_0x9c92('0x2b')][_0x9c92('0x49')](_0x44596f)['then'](handleEntityNotFound(_0xc012ec,null))['then'](respondWithResult(_0xc012ec,null))[_0x9c92('0x42')](handleError(_0xc012ec,null));};exports[_0x9c92('0x4a')]=function(_0x52180b,_0x10fa16){return db['IntegrationReport']['create'](_0x52180b[_0x9c92('0x4b')],{})[_0x9c92('0x23')](respondWithResult(_0x10fa16,0xc9))[_0x9c92('0x42')](handleError(_0x10fa16,null));};exports[_0x9c92('0x22')]=function(_0x227ebb,_0x118a70){if(_0x227ebb[_0x9c92('0x4b')]['id']){delete _0x227ebb[_0x9c92('0x4b')]['id'];}return db[_0x9c92('0x2b')]['find']({'where':{'id':_0x227ebb[_0x9c92('0x44')]['id']}})[_0x9c92('0x23')](handleEntityNotFound(_0x118a70,null))['then'](saveUpdates(_0x227ebb[_0x9c92('0x4b')],null))[_0x9c92('0x23')](respondWithResult(_0x118a70,null))[_0x9c92('0x42')](handleError(_0x118a70,null));};exports['destroy']=function(_0x259c87,_0x221839){return db[_0x9c92('0x2b')][_0x9c92('0x49')]({'where':{'id':_0x259c87[_0x9c92('0x44')]['id']}})[_0x9c92('0x23')](handleEntityNotFound(_0x221839,null))[_0x9c92('0x23')](removeEntity(_0x221839,null))[_0x9c92('0x42')](handleError(_0x221839,null));};exports[_0x9c92('0x4c')]=function(_0xb538b6,_0x4ae3bc){return db[_0x9c92('0x2b')]['describe']()[_0x9c92('0x23')](respondWithResult(_0x4ae3bc,null))[_0x9c92('0x42')](handleError(_0x4ae3bc,null));}; \ No newline at end of file +var _0xf8ee=['describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','status','end','json','offset','undefined','limit','count','set','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','options','includeAll','include','IntegrationReport','findAll','catch','show','params','merge','find','create','body'];(function(_0x1b8d87,_0x4168fb){var _0x182b74=function(_0x12b570){while(--_0x12b570){_0x1b8d87['push'](_0x1b8d87['shift']());}};_0x182b74(++_0x4168fb);}(_0xf8ee,0xd3));var _0xef8e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf8ee[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xef8e('0x0'));var rimraf=require(_0xef8e('0x1'));var zipdir=require(_0xef8e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef8e('0x3'));var moment=require(_0xef8e('0x4'));var BPromise=require(_0xef8e('0x5'));var Mustache=require('mustache');var util=require(_0xef8e('0x6'));var path=require(_0xef8e('0x7'));var sox=require(_0xef8e('0x8'));var csv=require(_0xef8e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef8e('0xa'));var _=require(_0xef8e('0xb'));var squel=require('squel');var crypto=require(_0xef8e('0xc'));var jsforce=require(_0xef8e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xef8e('0x9'));var querystring=require(_0xef8e('0xe'));var Papa=require(_0xef8e('0xf'));var Redis=require('ioredis');var authService=require(_0xef8e('0x10'));var qs=require(_0xef8e('0x11'));var as=require(_0xef8e('0x12'));var hardwareService=require(_0xef8e('0x13'));var logger=require(_0xef8e('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xef8e('0x15'))['db'];function respondWithStatusCode(_0x559f82,_0x34d03d){_0x34d03d=_0x34d03d||0xcc;return function(_0x9472c5){if(_0x9472c5){return _0x559f82['sendStatus'](_0x34d03d);}return _0x559f82[_0xef8e('0x16')](_0x34d03d)[_0xef8e('0x17')]();};}function respondWithResult(_0x32c851,_0x1ec4e0){_0x1ec4e0=_0x1ec4e0||0xc8;return function(_0x248e48){if(_0x248e48){return _0x32c851[_0xef8e('0x16')](_0x1ec4e0)[_0xef8e('0x18')](_0x248e48);}};}function respondWithFilteredResult(_0xc89e15,_0x529558){return function(_0x529c32){if(_0x529c32){var _0x476d93=typeof _0x529558[_0xef8e('0x19')]===_0xef8e('0x1a')&&typeof _0x529558[_0xef8e('0x1b')]===_0xef8e('0x1a');var _0x22f6ed=_0x529c32[_0xef8e('0x1c')];var _0x51b3fe=_0x476d93?0x0:_0x529558['offset'];var _0x3de4ad=_0x476d93?_0x529c32['count']:_0x529558['offset']+_0x529558[_0xef8e('0x1b')];var _0x14b4bc;if(_0x3de4ad>=_0x22f6ed){_0x3de4ad=_0x22f6ed;_0x14b4bc=0xc8;}else{_0x14b4bc=0xce;}_0xc89e15['status'](_0x14b4bc);return _0xc89e15[_0xef8e('0x1d')]('Content-Range',_0x51b3fe+'-'+_0x3de4ad+'/'+_0x22f6ed)[_0xef8e('0x18')](_0x529c32);}return null;};}function patchUpdates(_0x1d68f6){return function(_0x57c575){try{jsonpatch['apply'](_0x57c575,_0x1d68f6,!![]);}catch(_0x1457c3){return BPromise['reject'](_0x1457c3);}return _0x57c575[_0xef8e('0x1e')]();};}function saveUpdates(_0x1f92c3,_0x21abed){return function(_0x30848c){if(_0x30848c){return _0x30848c[_0xef8e('0x1f')](_0x1f92c3)[_0xef8e('0x20')](function(_0xf38eca){return _0xf38eca;});}return null;};}function removeEntity(_0x48ec86,_0x30cfae){return function(_0x3ef651){if(_0x3ef651){return _0x3ef651[_0xef8e('0x21')]()[_0xef8e('0x20')](function(){_0x48ec86[_0xef8e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fffdf,_0x1e388a){return function(_0x4c69f0){if(!_0x4c69f0){_0x4fffdf[_0xef8e('0x22')](0x194);}return _0x4c69f0;};}function handleError(_0xb88a56,_0x17d684){_0x17d684=_0x17d684||0x1f4;return function(_0x249889){logger[_0xef8e('0x23')](_0x249889['stack']);if(_0x249889[_0xef8e('0x24')]){delete _0x249889[_0xef8e('0x24')];}_0xb88a56[_0xef8e('0x16')](_0x17d684)[_0xef8e('0x25')](_0x249889);};}exports[_0xef8e('0x26')]=function(_0x4847ee,_0x5284ff){var _0x4df09d={},_0x5c13c5={},_0x5442e5={'count':0x0,'rows':[]};var _0x220eb8=_[_0xef8e('0x27')](db['IntegrationReport'][_0xef8e('0x28')],function(_0x563e60){return{'name':_0x563e60['fieldName'],'type':_0x563e60['type'][_0xef8e('0x29')]};});_0x5c13c5['model']=_[_0xef8e('0x27')](_0x220eb8,'name');_0x5c13c5[_0xef8e('0x2a')]=_[_0xef8e('0x2b')](_0x4847ee[_0xef8e('0x2a')]);_0x5c13c5[_0xef8e('0x2c')]=_[_0xef8e('0x2d')](_0x5c13c5[_0xef8e('0x2e')],_0x5c13c5[_0xef8e('0x2a')]);_0x4df09d['attributes']=_[_0xef8e('0x2d')](_0x5c13c5['model'],qs[_0xef8e('0x2f')](_0x4847ee[_0xef8e('0x2a')][_0xef8e('0x2f')]));_0x4df09d[_0xef8e('0x30')]=_0x4df09d[_0xef8e('0x30')][_0xef8e('0x31')]?_0x4df09d[_0xef8e('0x30')]:_0x5c13c5[_0xef8e('0x2e')];if(!_0x4847ee[_0xef8e('0x2a')][_0xef8e('0x32')](_0xef8e('0x33'))){_0x4df09d['limit']=qs[_0xef8e('0x1b')](_0x4847ee[_0xef8e('0x2a')][_0xef8e('0x1b')]);_0x4df09d['offset']=qs[_0xef8e('0x19')](_0x4847ee['query'][_0xef8e('0x19')]);}_0x4df09d[_0xef8e('0x34')]=qs['sort'](_0x4847ee[_0xef8e('0x2a')]['sort']);_0x4df09d[_0xef8e('0x35')]=qs[_0xef8e('0x2c')](_[_0xef8e('0x36')](_0x4847ee['query'],_0x5c13c5[_0xef8e('0x2c')]),_0x220eb8);if(_0x4847ee[_0xef8e('0x2a')][_0xef8e('0x37')]){_0x4df09d[_0xef8e('0x35')]=_['merge'](_0x4df09d['where'],{'$or':_[_0xef8e('0x27')](_0x220eb8,function(_0x1f1030){if(_0x1f1030['type']!==_0xef8e('0x38')){var _0x239544={};_0x239544[_0x1f1030[_0xef8e('0x24')]]={'$like':'%'+_0x4847ee['query'][_0xef8e('0x37')]+'%'};return _0x239544;}})});}_0x4df09d=_['merge']({},_0x4df09d,_0x4847ee[_0xef8e('0x39')]);var _0x58590b={'where':_0x4df09d[_0xef8e('0x35')]};return db['IntegrationReport'][_0xef8e('0x1c')](_0x58590b)[_0xef8e('0x20')](function(_0x9a8d73){_0x5442e5[_0xef8e('0x1c')]=_0x9a8d73;if(_0x4847ee[_0xef8e('0x2a')][_0xef8e('0x3a')]){_0x4df09d[_0xef8e('0x3b')]=[{'all':!![]}];}return db[_0xef8e('0x3c')][_0xef8e('0x3d')](_0x4df09d);})[_0xef8e('0x20')](function(_0x35d75f){_0x5442e5['rows']=_0x35d75f;return _0x5442e5;})[_0xef8e('0x20')](respondWithFilteredResult(_0x5284ff,_0x4df09d))[_0xef8e('0x3e')](handleError(_0x5284ff,null));};exports[_0xef8e('0x3f')]=function(_0x551908,_0x40b415){var _0x4a00a6={'raw':![],'where':{'id':_0x551908[_0xef8e('0x40')]['id']}},_0x3fa977={};_0x3fa977[_0xef8e('0x2e')]=_[_0xef8e('0x2b')](db[_0xef8e('0x3c')]['rawAttributes']);_0x3fa977[_0xef8e('0x2a')]=_['keys'](_0x551908[_0xef8e('0x2a')]);_0x3fa977[_0xef8e('0x2c')]=_[_0xef8e('0x2d')](_0x3fa977[_0xef8e('0x2e')],_0x3fa977['query']);_0x4a00a6['attributes']=_['intersection'](_0x3fa977[_0xef8e('0x2e')],qs[_0xef8e('0x2f')](_0x551908[_0xef8e('0x2a')][_0xef8e('0x2f')]));_0x4a00a6[_0xef8e('0x30')]=_0x4a00a6[_0xef8e('0x30')][_0xef8e('0x31')]?_0x4a00a6[_0xef8e('0x30')]:_0x3fa977['model'];if(_0x551908['query'][_0xef8e('0x3a')]){_0x4a00a6[_0xef8e('0x3b')]=[{'all':!![]}];}_0x4a00a6=_[_0xef8e('0x41')]({},_0x4a00a6,_0x551908[_0xef8e('0x39')]);return db[_0xef8e('0x3c')][_0xef8e('0x42')](_0x4a00a6)[_0xef8e('0x20')](handleEntityNotFound(_0x40b415,null))[_0xef8e('0x20')](respondWithResult(_0x40b415,null))[_0xef8e('0x3e')](handleError(_0x40b415,null));};exports['create']=function(_0x17363c,_0x28e616){return db['IntegrationReport'][_0xef8e('0x43')](_0x17363c[_0xef8e('0x44')],{})['then'](respondWithResult(_0x28e616,0xc9))[_0xef8e('0x3e')](handleError(_0x28e616,null));};exports[_0xef8e('0x1f')]=function(_0x22670f,_0x299edf){if(_0x22670f[_0xef8e('0x44')]['id']){delete _0x22670f['body']['id'];}return db['IntegrationReport'][_0xef8e('0x42')]({'where':{'id':_0x22670f[_0xef8e('0x40')]['id']}})[_0xef8e('0x20')](handleEntityNotFound(_0x299edf,null))['then'](saveUpdates(_0x22670f['body'],null))[_0xef8e('0x20')](respondWithResult(_0x299edf,null))[_0xef8e('0x3e')](handleError(_0x299edf,null));};exports[_0xef8e('0x21')]=function(_0x4cac7e,_0x508406){return db[_0xef8e('0x3c')][_0xef8e('0x42')]({'where':{'id':_0x4cac7e[_0xef8e('0x40')]['id']}})[_0xef8e('0x20')](handleEntityNotFound(_0x508406,null))[_0xef8e('0x20')](removeEntity(_0x508406,null))[_0xef8e('0x3e')](handleError(_0x508406,null));};exports[_0xef8e('0x45')]=function(_0x13e720,_0x17271f){return db[_0xef8e('0x3c')]['describe']()[_0xef8e('0x20')](respondWithResult(_0x17271f,null))[_0xef8e('0x3e')](handleError(_0x17271f,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index ab9bdc6..6e734df 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 _0x4af5=['define','IntegrationReport','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./integrationReport.attributes'];(function(_0x394efb,_0x19132c){var _0x202f70=function(_0x3d71ff){while(--_0x3d71ff){_0x394efb['push'](_0x394efb['shift']());}};_0x202f70(++_0x19132c);}(_0x4af5,0x70));var _0x54af=function(_0x16f5b7,_0x289ce8){_0x16f5b7=_0x16f5b7-0x0;var _0x4ae4af=_0x4af5[_0x16f5b7];return _0x4ae4af;};'use strict';var _=require(_0x54af('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x54af('0x1'));var moment=require(_0x54af('0x2'));var BPromise=require(_0x54af('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x54af('0x4'));var rimraf=require(_0x54af('0x5'));var config=require(_0x54af('0x6'));var attributes=require(_0x54af('0x7'));module['exports']=function(_0xbbe262,_0x59ea40){return _0xbbe262[_0x54af('0x8')](_0x54af('0x9'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bcc=['rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','api','request-promise','path'];(function(_0x5e9aa2,_0xd197ca){var _0xc42277=function(_0xbda71a){while(--_0xbda71a){_0x5e9aa2['push'](_0x5e9aa2['shift']());}};_0xc42277(++_0xd197ca);}(_0x9bcc,0xbb));var _0xc9bc=function(_0x44e333,_0x586055){_0x44e333=_0x44e333-0x0;var _0x4c8d19=_0x9bcc[_0x44e333];return _0x4c8d19;};'use strict';var _=require(_0xc9bc('0x0'));var util=require(_0xc9bc('0x1'));var logger=require('../../config/logger')(_0xc9bc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc9bc('0x3'));var fs=require('fs');var path=require(_0xc9bc('0x4'));var rimraf=require(_0xc9bc('0x5'));var config=require(_0xc9bc('0x6'));var attributes=require(_0xc9bc('0x7'));module[_0xc9bc('0x8')]=function(_0x26d311,_0x189bc6){return _0x26d311[_0xc9bc('0x9')](_0xc9bc('0xa'),attributes,{'tableName':_0xc9bc('0xb'),'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 d94dd1f..7618d08 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 _0x31f0=['../../config/environment','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x31f0,0xb7));var _0x031f=function(_0x35a35a,_0x1ded6b){_0x35a35a=_0x35a35a-0x0;var _0xb4c12b=_0x31f0[_0x35a35a];return _0xb4c12b;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){return client[_0x031f('0x8')](_0x3dc98e,_0x365f59)['then'](function(_0x2e5624){logger[_0x031f('0x9')](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));logger[_0x031f('0xc')](_0x031f('0xd'),_0x487e65,_0x031f('0xb'),JSON[_0x031f('0xe')](_0x2e5624));if(_0x2e5624['error']){if(_0x2e5624[_0x031f('0xf')][_0x031f('0x10')]===0x1f4){logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x2569b6(_0x2e5624[_0x031f('0xf')]['message']);}logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x4300b4(_0x2e5624[_0x031f('0xf')]['message']);}else{logger['info'](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));_0x4300b4(_0x2e5624[_0x031f('0x12')][_0x031f('0x11')]);}})['catch'](function(_0x1dc4a7){logger[_0x031f('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x487e65,_0x1dc4a7);_0x2569b6(_0x1dc4a7);});});} \ No newline at end of file +var _0x31f0=['../../config/environment','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xd28119,_0x2a8097){var _0x418b38=function(_0x331d0e){while(--_0x331d0e){_0xd28119['push'](_0xd28119['shift']());}};_0x418b38(++_0x2a8097);}(_0x31f0,0xb7));var _0x031f=function(_0x38d0ae,_0x3fd572){_0x38d0ae=_0x38d0ae-0x0;var _0x470c14=_0x31f0[_0x38d0ae];return _0x470c14;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){return client[_0x031f('0x8')](_0x3dc98e,_0x365f59)['then'](function(_0x2e5624){logger[_0x031f('0x9')](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));logger[_0x031f('0xc')](_0x031f('0xd'),_0x487e65,_0x031f('0xb'),JSON[_0x031f('0xe')](_0x2e5624));if(_0x2e5624['error']){if(_0x2e5624[_0x031f('0xf')][_0x031f('0x10')]===0x1f4){logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x2569b6(_0x2e5624[_0x031f('0xf')]['message']);}logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x4300b4(_0x2e5624[_0x031f('0xf')]['message']);}else{logger['info'](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));_0x4300b4(_0x2e5624[_0x031f('0x12')][_0x031f('0x11')]);}})['catch'](function(_0x1dc4a7){logger[_0x031f('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x487e65,_0x1dc4a7);_0x2569b6(_0x1dc4a7);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index be86e00..9e41627 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 _0x8939=['post','create','addInterval','put','update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals'];(function(_0xff7901,_0xda11e2){var _0x3ad636=function(_0x13744e){while(--_0x13744e){_0xff7901['push'](_0xff7901['shift']());}};_0x3ad636(++_0xda11e2);}(_0x8939,0x12d));var _0x9893=function(_0x2c1883,_0x132b29){_0x2c1883=_0x2c1883-0x0;var _0x4665a4=_0x8939[_0x2c1883];return _0x4665a4;};'use strict';var multer=require('multer');var util=require(_0x9893('0x0'));var path=require(_0x9893('0x1'));var timeout=require(_0x9893('0x2'));var express=require('express');var router=express[_0x9893('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9893('0x4'));var interaction=require(_0x9893('0x5'));var config=require('../../config/environment');var controller=require(_0x9893('0x6'));router[_0x9893('0x7')]('/',auth['isAuthenticated'](),controller[_0x9893('0x8')]);router[_0x9893('0x7')](_0x9893('0x9'),auth[_0x9893('0xa')](),controller[_0x9893('0xb')]);router['get'](_0x9893('0xc'),auth[_0x9893('0xa')](),controller[_0x9893('0xd')]);router[_0x9893('0xe')]('/',auth[_0x9893('0xa')](),controller[_0x9893('0xf')]);router[_0x9893('0xe')](_0x9893('0xc'),auth[_0x9893('0xa')](),controller[_0x9893('0x10')]);router[_0x9893('0xe')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller['addIntervals']);router[_0x9893('0x11')](_0x9893('0x9'),auth[_0x9893('0xa')](),controller[_0x9893('0x12')]);router[_0x9893('0x13')](_0x9893('0x9'),auth[_0x9893('0xa')](),controller[_0x9893('0x14')]);module['exports']=router; \ No newline at end of file +var _0x3f1c=['get','/:id','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','put','update','delete','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated'];(function(_0x16e569,_0x33f836){var _0x22470a=function(_0x4b7c33){while(--_0x4b7c33){_0x16e569['push'](_0x16e569['shift']());}};_0x22470a(++_0x33f836);}(_0x3f1c,0xd4));var _0xc3f1=function(_0x14c077,_0x30af9f){_0x14c077=_0x14c077-0x0;var _0x3c5f46=_0x3f1c[_0x14c077];return _0x3c5f46;};'use strict';var multer=require(_0xc3f1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc3f1('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc3f1('0x2'));var auth=require(_0xc3f1('0x3'));var interaction=require(_0xc3f1('0x4'));var config=require(_0xc3f1('0x5'));var controller=require(_0xc3f1('0x6'));router['get']('/',auth[_0xc3f1('0x7')](),controller['index']);router[_0xc3f1('0x8')](_0xc3f1('0x9'),auth[_0xc3f1('0x7')](),controller['show']);router['get'](_0xc3f1('0xa'),auth['isAuthenticated'](),controller[_0xc3f1('0xb')]);router[_0xc3f1('0xc')]('/',auth[_0xc3f1('0x7')](),controller[_0xc3f1('0xd')]);router['post'](_0xc3f1('0xa'),auth['isAuthenticated'](),controller[_0xc3f1('0xe')]);router['post'](_0xc3f1('0xf'),auth['isAuthenticated'](),controller['addIntervals']);router[_0xc3f1('0x10')](_0xc3f1('0x9'),auth[_0xc3f1('0x7')](),controller[_0xc3f1('0x11')]);router[_0xc3f1('0x12')](_0xc3f1('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xc3f1('0x13')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 9ddbd7c..5f62753 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 _0x250c=['STRING','sequelize','exports'];(function(_0x57299b,_0x24fd26){var _0x21309b=function(_0x26bd85){while(--_0x26bd85){_0x57299b['push'](_0x57299b['shift']());}};_0x21309b(++_0x24fd26);}(_0x250c,0x1a8));var _0xc250=function(_0x4efe50,_0x416714){_0x4efe50=_0x4efe50-0x0;var _0x2f19cc=_0x250c[_0x4efe50];return _0x2f19cc;};'use strict';var Sequelize=require(_0xc250('0x0'));module[_0xc250('0x1')]={'name':{'type':Sequelize[_0xc250('0x2')]},'description':{'type':Sequelize[_0xc250('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xb173=['sequelize','exports','STRING'];(function(_0x204ef2,_0x571b13){var _0x1dd0ca=function(_0x414a51){while(--_0x414a51){_0x204ef2['push'](_0x204ef2['shift']());}};_0x1dd0ca(++_0x571b13);}(_0xb173,0x93));var _0x3b17=function(_0x384047,_0x3ce278){_0x384047=_0x384047-0x0;var _0x43bf57=_0xb173[_0x384047];return _0x43bf57;};'use strict';var Sequelize=require(_0x3b17('0x0'));module[_0x3b17('0x1')]={'name':{'type':Sequelize[_0x3b17('0x2')]},'description':{'type':Sequelize[_0x3b17('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 6702c65..1a6c910 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 _0xf516=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','get','Intervals','destroy','end','error','stack','name','send','index','map','Interval','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','rawAttributes','pick','getIntervals','addIntervals','sequelize','transaction','IntervalId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x307c57,_0x2ff9e5){var _0x232faa=function(_0xef7f){while(--_0xef7f){_0x307c57['push'](_0x307c57['shift']());}};_0x232faa(++_0x2ff9e5);}(_0xf516,0xa1));var _0x6f51=function(_0x5043a1,_0x58ba4a){_0x5043a1=_0x5043a1-0x0;var _0x2cba9e=_0xf516[_0x5043a1];return _0x2cba9e;};'use strict';var emlformat=require(_0x6f51('0x0'));var rimraf=require(_0x6f51('0x1'));var zipdir=require(_0x6f51('0x2'));var jsonpatch=require(_0x6f51('0x3'));var rp=require('request-promise');var moment=require(_0x6f51('0x4'));var BPromise=require(_0x6f51('0x5'));var Mustache=require(_0x6f51('0x6'));var util=require(_0x6f51('0x7'));var path=require(_0x6f51('0x8'));var sox=require('sox');var csv=require(_0x6f51('0x9'));var ejs=require(_0x6f51('0xa'));var fs=require('fs');var fs_extra=require(_0x6f51('0xb'));var _=require(_0x6f51('0xc'));var squel=require(_0x6f51('0xd'));var crypto=require(_0x6f51('0xe'));var jsforce=require(_0x6f51('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6f51('0x10'));var authService=require(_0x6f51('0x11'));var qs=require(_0x6f51('0x12'));var as=require(_0x6f51('0x13'));var hardwareService=require(_0x6f51('0x14'));var logger=require('../../config/logger')(_0x6f51('0x15'));var utils=require('../../config/utils');var config=require(_0x6f51('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f51('0x17'))['db'];var extensions=require(_0x6f51('0x18'));function respondWithStatusCode(_0x14a174,_0x1f0bd7){_0x1f0bd7=_0x1f0bd7||0xcc;return function(_0x3f3c35){if(_0x3f3c35){return _0x14a174[_0x6f51('0x19')](_0x1f0bd7);}return _0x14a174[_0x6f51('0x1a')](_0x1f0bd7)['end']();};}function respondWithResult(_0x236b3d,_0x868b31){_0x868b31=_0x868b31||0xc8;return function(_0x423301){if(_0x423301){return _0x236b3d[_0x6f51('0x1a')](_0x868b31)[_0x6f51('0x1b')](_0x423301);}};}function respondWithFilteredResult(_0x377688,_0x2dc551){return function(_0x1bb52e){if(_0x1bb52e){var _0xef1f01=typeof _0x2dc551['offset']===_0x6f51('0x1c')&&typeof _0x2dc551[_0x6f51('0x1d')]===_0x6f51('0x1c');var _0x2b21f9=_0x1bb52e[_0x6f51('0x1e')];var _0x8be654=_0xef1f01?0x0:_0x2dc551[_0x6f51('0x1f')];var _0x4fbcca=_0xef1f01?_0x1bb52e[_0x6f51('0x1e')]:_0x2dc551[_0x6f51('0x1f')]+_0x2dc551[_0x6f51('0x1d')];var _0x29a6ef;if(_0x4fbcca>=_0x2b21f9){_0x4fbcca=_0x2b21f9;_0x29a6ef=0xc8;}else{_0x29a6ef=0xce;}_0x377688[_0x6f51('0x1a')](_0x29a6ef);return _0x377688[_0x6f51('0x20')](_0x6f51('0x21'),_0x8be654+'-'+_0x4fbcca+'/'+_0x2b21f9)[_0x6f51('0x1b')](_0x1bb52e);}return null;};}function patchUpdates(_0x314657){return function(_0x4b96dd){try{jsonpatch[_0x6f51('0x22')](_0x4b96dd,_0x314657,!![]);}catch(_0x2914aa){return BPromise['reject'](_0x2914aa);}return _0x4b96dd[_0x6f51('0x23')]();};}function saveUpdates(_0x3c8131,_0x199c31){return function(_0x20a580){if(_0x20a580){return _0x20a580[_0x6f51('0x24')](_0x3c8131)[_0x6f51('0x25')](function(_0x2b2ab1){return _0x2b2ab1;});}return null;};}function removeEntity(_0x375443,_0x5bfed1){return function(_0x557f69){if(_0x557f69){return _0x557f69['destroy']()['then'](function(){var _0x968682=_0x557f69[_0x6f51('0x26')]({'plain':!![]});var _0x29cd4d=_0x6f51('0x27');return db['UserProfileResource'][_0x6f51('0x28')]({'where':{'type':_0x29cd4d,'resourceId':_0x968682['id']}})[_0x6f51('0x25')](function(){return _0x557f69;});})[_0x6f51('0x25')](function(){_0x375443[_0x6f51('0x1a')](0xcc)[_0x6f51('0x29')]();});}};}function handleEntityNotFound(_0x4765b6,_0x10d930){return function(_0xb7a517){if(!_0xb7a517){_0x4765b6[_0x6f51('0x19')](0x194);}return _0xb7a517;};}function handleError(_0x34c4b7,_0x56461c){_0x56461c=_0x56461c||0x1f4;return function(_0x4391e0){logger[_0x6f51('0x2a')](_0x4391e0[_0x6f51('0x2b')]);if(_0x4391e0[_0x6f51('0x2c')]){delete _0x4391e0[_0x6f51('0x2c')];}_0x34c4b7['status'](_0x56461c)[_0x6f51('0x2d')](_0x4391e0);};}exports[_0x6f51('0x2e')]=function(_0x25eae9,_0x55ece2){var _0x32fb67={},_0x3e3066={},_0x19422a={'count':0x0,'rows':[]};var _0x457d9f=_[_0x6f51('0x2f')](db[_0x6f51('0x30')]['rawAttributes'],function(_0x154fc3){return{'name':_0x154fc3['fieldName'],'type':_0x154fc3[_0x6f51('0x31')][_0x6f51('0x32')]};});_0x3e3066[_0x6f51('0x33')]=_[_0x6f51('0x2f')](_0x457d9f,'name');_0x3e3066[_0x6f51('0x34')]=_[_0x6f51('0x35')](_0x25eae9[_0x6f51('0x34')]);_0x3e3066[_0x6f51('0x36')]=_[_0x6f51('0x37')](_0x3e3066['model'],_0x3e3066[_0x6f51('0x34')]);_0x32fb67['attributes']=_[_0x6f51('0x37')](_0x3e3066['model'],qs[_0x6f51('0x38')](_0x25eae9[_0x6f51('0x34')]['fields']));_0x32fb67[_0x6f51('0x39')]=_0x32fb67[_0x6f51('0x39')][_0x6f51('0x3a')]?_0x32fb67[_0x6f51('0x39')]:_0x3e3066[_0x6f51('0x33')];if(!_0x25eae9[_0x6f51('0x34')][_0x6f51('0x3b')](_0x6f51('0x3c'))){_0x32fb67[_0x6f51('0x1d')]=qs['limit'](_0x25eae9[_0x6f51('0x34')][_0x6f51('0x1d')]);_0x32fb67[_0x6f51('0x1f')]=qs['offset'](_0x25eae9[_0x6f51('0x34')][_0x6f51('0x1f')]);}_0x32fb67[_0x6f51('0x3d')]=qs['sort'](_0x25eae9[_0x6f51('0x34')][_0x6f51('0x3e')]);_0x32fb67[_0x6f51('0x3f')]=qs[_0x6f51('0x36')](_['pick'](_0x25eae9[_0x6f51('0x34')],_0x3e3066[_0x6f51('0x36')]),_0x457d9f);if(_0x25eae9['query']['filter']){_0x32fb67[_0x6f51('0x3f')]=_[_0x6f51('0x40')](_0x32fb67[_0x6f51('0x3f')],{'$or':_[_0x6f51('0x2f')](_0x457d9f,function(_0x54be2d){if(_0x54be2d[_0x6f51('0x31')]!==_0x6f51('0x41')){var _0x2d13d1={};_0x2d13d1[_0x54be2d[_0x6f51('0x2c')]]={'$like':'%'+_0x25eae9[_0x6f51('0x34')][_0x6f51('0x42')]+'%'};return _0x2d13d1;}})});}_0x32fb67=_[_0x6f51('0x40')]({},_0x32fb67,_0x25eae9[_0x6f51('0x43')]);var _0x218bf9={'where':_0x32fb67[_0x6f51('0x3f')]};return db[_0x6f51('0x30')][_0x6f51('0x1e')](_0x218bf9)[_0x6f51('0x25')](function(_0x4d9809){_0x19422a['count']=_0x4d9809;if(_0x25eae9[_0x6f51('0x34')][_0x6f51('0x44')]){_0x32fb67['include']=[{'all':!![]}];}return db[_0x6f51('0x30')][_0x6f51('0x45')](_0x32fb67);})[_0x6f51('0x25')](function(_0x49b8a3){_0x19422a[_0x6f51('0x46')]=_0x49b8a3;return _0x19422a;})[_0x6f51('0x25')](respondWithFilteredResult(_0x55ece2,_0x32fb67))[_0x6f51('0x47')](handleError(_0x55ece2,null));};exports['show']=function(_0x389558,_0x31571b){var _0x4957e4={'raw':!![],'where':{'id':_0x389558[_0x6f51('0x48')]['id']}},_0x5ee839={};_0x5ee839[_0x6f51('0x33')]=_[_0x6f51('0x35')](db[_0x6f51('0x30')]['rawAttributes']);_0x5ee839[_0x6f51('0x34')]=_[_0x6f51('0x35')](_0x389558[_0x6f51('0x34')]);_0x5ee839['filters']=_['intersection'](_0x5ee839[_0x6f51('0x33')],_0x5ee839[_0x6f51('0x34')]);_0x4957e4[_0x6f51('0x39')]=_[_0x6f51('0x37')](_0x5ee839[_0x6f51('0x33')],qs['fields'](_0x389558['query'][_0x6f51('0x38')]));_0x4957e4['attributes']=_0x4957e4[_0x6f51('0x39')][_0x6f51('0x3a')]?_0x4957e4[_0x6f51('0x39')]:_0x5ee839[_0x6f51('0x33')];if(_0x389558['query'][_0x6f51('0x44')]){_0x4957e4[_0x6f51('0x49')]=[{'all':!![]}];}_0x4957e4=_[_0x6f51('0x40')]({},_0x4957e4,_0x389558[_0x6f51('0x43')]);return db[_0x6f51('0x30')][_0x6f51('0x4a')](_0x4957e4)[_0x6f51('0x25')](handleEntityNotFound(_0x31571b,null))[_0x6f51('0x25')](respondWithResult(_0x31571b,null))[_0x6f51('0x47')](handleError(_0x31571b,null));};exports['create']=function(_0x1818b4,_0x41e12b){return db[_0x6f51('0x30')]['create'](_0x1818b4[_0x6f51('0x4b')],{})[_0x6f51('0x25')](function(_0x245f30){var _0x59f537=_0x1818b4[_0x6f51('0x4c')]['get']({'plain':!![]});if(!_0x59f537)throw new Error(_0x6f51('0x4d'));if(_0x59f537['role']==='user'){var _0xece717=_0x245f30['get']({'plain':!![]});var _0x5bf986=_0x6f51('0x27');return db[_0x6f51('0x4e')][_0x6f51('0x4a')]({'where':{'name':_0x5bf986,'userProfileId':_0x59f537[_0x6f51('0x4f')]},'raw':!![]})[_0x6f51('0x25')](function(_0x1b8194){if(_0x1b8194&&_0x1b8194['autoAssociation']===0x0){return db['UserProfileResource'][_0x6f51('0x50')]({'name':_0xece717['name'],'resourceId':_0xece717['id'],'type':_0x1b8194[_0x6f51('0x2c')],'sectionId':_0x1b8194['id']},{})[_0x6f51('0x25')](function(){return _0x245f30;});}else{return _0x245f30;}})[_0x6f51('0x47')](function(_0x2d6543){logger[_0x6f51('0x2a')](_0x6f51('0x51'),_0x2d6543);throw _0x2d6543;});}return _0x245f30;})['then'](respondWithResult(_0x41e12b,0xc9))[_0x6f51('0x47')](handleError(_0x41e12b,null));};exports[_0x6f51('0x24')]=function(_0x30e3bd,_0x1b1567){if(_0x30e3bd[_0x6f51('0x4b')]['id']){delete _0x30e3bd['body']['id'];}return db[_0x6f51('0x30')][_0x6f51('0x4a')]({'where':{'id':_0x30e3bd[_0x6f51('0x48')]['id']}})[_0x6f51('0x25')](handleEntityNotFound(_0x1b1567,null))[_0x6f51('0x25')](saveUpdates(_0x30e3bd[_0x6f51('0x4b')],null))[_0x6f51('0x25')](respondWithResult(_0x1b1567,null))[_0x6f51('0x47')](handleError(_0x1b1567,null));};exports[_0x6f51('0x28')]=function(_0x397a09,_0x48f5a3){return db[_0x6f51('0x30')][_0x6f51('0x4a')]({'where':{'id':_0x397a09[_0x6f51('0x48')]['id']}})[_0x6f51('0x25')](handleEntityNotFound(_0x48f5a3,null))[_0x6f51('0x25')](removeEntity(_0x48f5a3,null))['catch'](handleError(_0x48f5a3,null));};exports['addInterval']=function(_0x43493e,_0x4b57b8,_0x3c3c80){if(_0x43493e[_0x6f51('0x4b')]['id']){delete _0x43493e[_0x6f51('0x4b')]['id'];}return db[_0x6f51('0x30')][_0x6f51('0x4a')]({'where':{'id':_0x43493e['params']['id']}})['then'](handleEntityNotFound(_0x4b57b8,null))[_0x6f51('0x25')](function(_0x376eb8){if(_0x376eb8){_0x43493e[_0x6f51('0x4b')]['IntervalId']=_0x376eb8['id'];return db[_0x6f51('0x30')][_0x6f51('0x50')](_0x43493e[_0x6f51('0x4b')]);}})[_0x6f51('0x25')](respondWithResult(_0x4b57b8,null))[_0x6f51('0x47')](handleError(_0x4b57b8,null));};exports['getIntervals']=function(_0x6f17af,_0x35ea09,_0x56923b){var _0x3d0a85={};var _0x18fb2a={};var _0x4e46ad;var _0x5cae82;return db[_0x6f51('0x30')][_0x6f51('0x52')]({'where':{'id':_0x6f17af['params']['id']}})['then'](handleEntityNotFound(_0x35ea09,null))[_0x6f51('0x25')](function(_0x178bf9){if(_0x178bf9){_0x4e46ad=_0x178bf9;_0x18fb2a[_0x6f51('0x33')]=_[_0x6f51('0x35')](db[_0x6f51('0x30')][_0x6f51('0x53')]);_0x18fb2a[_0x6f51('0x34')]=_['keys'](_0x6f17af[_0x6f51('0x34')]);_0x18fb2a[_0x6f51('0x36')]=_[_0x6f51('0x37')](_0x18fb2a[_0x6f51('0x33')],_0x18fb2a[_0x6f51('0x34')]);_0x3d0a85[_0x6f51('0x39')]=_[_0x6f51('0x37')](_0x18fb2a[_0x6f51('0x33')],qs[_0x6f51('0x38')](_0x6f17af[_0x6f51('0x34')][_0x6f51('0x38')]));_0x3d0a85[_0x6f51('0x39')]=_0x3d0a85[_0x6f51('0x39')][_0x6f51('0x3a')]?_0x3d0a85[_0x6f51('0x39')]:_0x18fb2a['model'];_0x3d0a85['order']=qs['sort'](_0x6f17af[_0x6f51('0x34')]['sort']);_0x3d0a85[_0x6f51('0x3f')]=qs[_0x6f51('0x36')](_[_0x6f51('0x54')](_0x6f17af['query'],_0x18fb2a[_0x6f51('0x36')]));if(_0x6f17af[_0x6f51('0x34')][_0x6f51('0x42')]){_0x3d0a85['where']=_[_0x6f51('0x40')](_0x3d0a85[_0x6f51('0x3f')],{'$or':_[_0x6f51('0x2f')](_0x3d0a85[_0x6f51('0x39')],function(_0x35d98e){var _0x18d16c={};_0x18d16c[_0x35d98e]={'$like':'%'+_0x6f17af[_0x6f51('0x34')][_0x6f51('0x42')]+'%'};return _0x18d16c;})});}_0x3d0a85=_[_0x6f51('0x40')]({},_0x3d0a85,_0x6f17af[_0x6f51('0x43')]);return _0x4e46ad[_0x6f51('0x55')](_0x3d0a85);}})[_0x6f51('0x25')](function(_0x1533ee){if(_0x1533ee){_0x5cae82=_0x1533ee['length'];if(!_0x6f17af[_0x6f51('0x34')]['hasOwnProperty'](_0x6f51('0x3c'))){_0x3d0a85[_0x6f51('0x1d')]=qs[_0x6f51('0x1d')](_0x6f17af[_0x6f51('0x34')][_0x6f51('0x1d')]);_0x3d0a85[_0x6f51('0x1f')]=qs[_0x6f51('0x1f')](_0x6f17af[_0x6f51('0x34')]['offset']);}return _0x4e46ad[_0x6f51('0x55')](_0x3d0a85);}})[_0x6f51('0x25')](function(_0x483ad1){if(_0x483ad1){return _0x483ad1?{'count':_0x5cae82,'rows':_0x483ad1}:null;}})[_0x6f51('0x25')](respondWithResult(_0x35ea09,null))[_0x6f51('0x47')](handleError(_0x35ea09,null));};exports[_0x6f51('0x56')]=function(_0x539409,_0x456c35,_0x161e3e){return db[_0x6f51('0x30')][_0x6f51('0x52')]({'where':{'id':_0x539409[_0x6f51('0x48')]['id']}})[_0x6f51('0x25')](handleEntityNotFound(_0x456c35,null))[_0x6f51('0x25')](function(_0xefa939){if(_0xefa939){return db[_0x6f51('0x57')][_0x6f51('0x58')](function(_0x211029){return db[_0x6f51('0x30')]['destroy']({'where':{'IntervalId':_0x539409[_0x6f51('0x48')]['id']},'transaction':_0x211029})[_0x6f51('0x25')](function(_0x2b21b7){var _0x21c6c7=_[_0x6f51('0x2f')](_0x539409[_0x6f51('0x4b')],function(_0x215cbb){delete _0x215cbb['id'];_0x215cbb[_0x6f51('0x59')]=_0x539409[_0x6f51('0x48')]['id'];return _0x215cbb;});return db[_0x6f51('0x30')]['bulkCreate'](_0x21c6c7,{'transaction':_0x211029});});})[_0x6f51('0x25')](function(){return db[_0x6f51('0x30')][_0x6f51('0x45')]({'where':{'IntervalId':_0x539409[_0x6f51('0x48')]['id']}});});}})[_0x6f51('0x25')](respondWithResult(_0x456c35,null))[_0x6f51('0x47')](handleError(_0x456c35,null));}; \ No newline at end of file +var _0x042b=['../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','intersection','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','catch','addInterval','IntervalId','getIntervals','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x042b,0xfa));var _0xb042=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x042b[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xb042('0x0'));var rimraf=require(_0xb042('0x1'));var zipdir=require(_0xb042('0x2'));var jsonpatch=require(_0xb042('0x3'));var rp=require(_0xb042('0x4'));var moment=require('moment');var BPromise=require(_0xb042('0x5'));var Mustache=require('mustache');var util=require(_0xb042('0x6'));var path=require(_0xb042('0x7'));var sox=require(_0xb042('0x8'));var csv=require(_0xb042('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb042('0xa'));var _=require(_0xb042('0xb'));var squel=require(_0xb042('0xc'));var crypto=require(_0xb042('0xd'));var jsforce=require(_0xb042('0xe'));var deskjs=require(_0xb042('0xf'));var toCsv=require(_0xb042('0x9'));var querystring=require(_0xb042('0x10'));var Papa=require(_0xb042('0x11'));var Redis=require(_0xb042('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb042('0x13'));var as=require(_0xb042('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb042('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb042('0x16'));var db=require('../../mysqldb')['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x51f2c9,_0x45b67b){_0x45b67b=_0x45b67b||0xcc;return function(_0xb73023){if(_0xb73023){return _0x51f2c9[_0xb042('0x17')](_0x45b67b);}return _0x51f2c9[_0xb042('0x18')](_0x45b67b)[_0xb042('0x19')]();};}function respondWithResult(_0x508ef9,_0x115204){_0x115204=_0x115204||0xc8;return function(_0x2083ad){if(_0x2083ad){return _0x508ef9['status'](_0x115204)[_0xb042('0x1a')](_0x2083ad);}};}function respondWithFilteredResult(_0x367d07,_0x3cf495){return function(_0x6fbf5f){if(_0x6fbf5f){var _0x20c68d=typeof _0x3cf495[_0xb042('0x1b')]===_0xb042('0x1c')&&typeof _0x3cf495[_0xb042('0x1d')]==='undefined';var _0x4541a9=_0x6fbf5f['count'];var _0x26a70b=_0x20c68d?0x0:_0x3cf495[_0xb042('0x1b')];var _0x42ea9f=_0x20c68d?_0x6fbf5f[_0xb042('0x1e')]:_0x3cf495[_0xb042('0x1b')]+_0x3cf495[_0xb042('0x1d')];var _0x4eb2c4;if(_0x42ea9f>=_0x4541a9){_0x42ea9f=_0x4541a9;_0x4eb2c4=0xc8;}else{_0x4eb2c4=0xce;}_0x367d07[_0xb042('0x18')](_0x4eb2c4);return _0x367d07[_0xb042('0x1f')](_0xb042('0x20'),_0x26a70b+'-'+_0x42ea9f+'/'+_0x4541a9)[_0xb042('0x1a')](_0x6fbf5f);}return null;};}function patchUpdates(_0x3fda80){return function(_0xef0446){try{jsonpatch[_0xb042('0x21')](_0xef0446,_0x3fda80,!![]);}catch(_0x28a3ee){return BPromise[_0xb042('0x22')](_0x28a3ee);}return _0xef0446[_0xb042('0x23')]();};}function saveUpdates(_0x3e8d3f,_0x519535){return function(_0x3f7243){if(_0x3f7243){return _0x3f7243['update'](_0x3e8d3f)[_0xb042('0x24')](function(_0x45577b){return _0x45577b;});}return null;};}function removeEntity(_0x599f8e,_0x212ba3){return function(_0xaf11e3){if(_0xaf11e3){return _0xaf11e3[_0xb042('0x25')]()['then'](function(){var _0x176e5f=_0xaf11e3[_0xb042('0x26')]({'plain':!![]});var _0x27ed77=_0xb042('0x27');return db[_0xb042('0x28')][_0xb042('0x25')]({'where':{'type':_0x27ed77,'resourceId':_0x176e5f['id']}})[_0xb042('0x24')](function(){return _0xaf11e3;});})['then'](function(){_0x599f8e[_0xb042('0x18')](0xcc)[_0xb042('0x19')]();});}};}function handleEntityNotFound(_0x57c3d7,_0x21f414){return function(_0x1fda00){if(!_0x1fda00){_0x57c3d7['sendStatus'](0x194);}return _0x1fda00;};}function handleError(_0x4d5e7f,_0xba8d6e){_0xba8d6e=_0xba8d6e||0x1f4;return function(_0x2f0b8e){logger[_0xb042('0x29')](_0x2f0b8e[_0xb042('0x2a')]);if(_0x2f0b8e[_0xb042('0x2b')]){delete _0x2f0b8e[_0xb042('0x2b')];}_0x4d5e7f['status'](_0xba8d6e)[_0xb042('0x2c')](_0x2f0b8e);};}exports[_0xb042('0x2d')]=function(_0x3df4ef,_0x4cbef4){var _0xbcbf4c={},_0x53aed9={},_0x23f70b={'count':0x0,'rows':[]};var _0x251c51=_[_0xb042('0x2e')](db[_0xb042('0x2f')][_0xb042('0x30')],function(_0x318a79){return{'name':_0x318a79[_0xb042('0x31')],'type':_0x318a79[_0xb042('0x32')][_0xb042('0x33')]};});_0x53aed9[_0xb042('0x34')]=_[_0xb042('0x2e')](_0x251c51,'name');_0x53aed9[_0xb042('0x35')]=_[_0xb042('0x36')](_0x3df4ef[_0xb042('0x35')]);_0x53aed9['filters']=_['intersection'](_0x53aed9['model'],_0x53aed9[_0xb042('0x35')]);_0xbcbf4c[_0xb042('0x37')]=_['intersection'](_0x53aed9[_0xb042('0x34')],qs['fields'](_0x3df4ef[_0xb042('0x35')][_0xb042('0x38')]));_0xbcbf4c[_0xb042('0x37')]=_0xbcbf4c[_0xb042('0x37')][_0xb042('0x39')]?_0xbcbf4c[_0xb042('0x37')]:_0x53aed9[_0xb042('0x34')];if(!_0x3df4ef[_0xb042('0x35')][_0xb042('0x3a')](_0xb042('0x3b'))){_0xbcbf4c[_0xb042('0x1d')]=qs[_0xb042('0x1d')](_0x3df4ef['query'][_0xb042('0x1d')]);_0xbcbf4c[_0xb042('0x1b')]=qs[_0xb042('0x1b')](_0x3df4ef['query'][_0xb042('0x1b')]);}_0xbcbf4c[_0xb042('0x3c')]=qs[_0xb042('0x3d')](_0x3df4ef['query'][_0xb042('0x3d')]);_0xbcbf4c[_0xb042('0x3e')]=qs[_0xb042('0x3f')](_[_0xb042('0x40')](_0x3df4ef[_0xb042('0x35')],_0x53aed9[_0xb042('0x3f')]),_0x251c51);if(_0x3df4ef[_0xb042('0x35')][_0xb042('0x41')]){_0xbcbf4c[_0xb042('0x3e')]=_['merge'](_0xbcbf4c[_0xb042('0x3e')],{'$or':_['map'](_0x251c51,function(_0x1859d8){if(_0x1859d8['type']!==_0xb042('0x42')){var _0x62e94c={};_0x62e94c[_0x1859d8['name']]={'$like':'%'+_0x3df4ef['query'][_0xb042('0x41')]+'%'};return _0x62e94c;}})});}_0xbcbf4c=_[_0xb042('0x43')]({},_0xbcbf4c,_0x3df4ef[_0xb042('0x44')]);var _0x4621d8={'where':_0xbcbf4c[_0xb042('0x3e')]};return db[_0xb042('0x2f')][_0xb042('0x1e')](_0x4621d8)[_0xb042('0x24')](function(_0x518947){_0x23f70b[_0xb042('0x1e')]=_0x518947;if(_0x3df4ef[_0xb042('0x35')][_0xb042('0x45')]){_0xbcbf4c[_0xb042('0x46')]=[{'all':!![]}];}return db[_0xb042('0x2f')][_0xb042('0x47')](_0xbcbf4c);})['then'](function(_0x271771){_0x23f70b[_0xb042('0x48')]=_0x271771;return _0x23f70b;})[_0xb042('0x24')](respondWithFilteredResult(_0x4cbef4,_0xbcbf4c))['catch'](handleError(_0x4cbef4,null));};exports[_0xb042('0x49')]=function(_0x406cf8,_0x513e62){var _0x440b41={'raw':!![],'where':{'id':_0x406cf8[_0xb042('0x4a')]['id']}},_0x4f7c60={};_0x4f7c60['model']=_[_0xb042('0x36')](db['Interval'][_0xb042('0x30')]);_0x4f7c60[_0xb042('0x35')]=_[_0xb042('0x36')](_0x406cf8[_0xb042('0x35')]);_0x4f7c60['filters']=_[_0xb042('0x4b')](_0x4f7c60[_0xb042('0x34')],_0x4f7c60['query']);_0x440b41['attributes']=_[_0xb042('0x4b')](_0x4f7c60[_0xb042('0x34')],qs[_0xb042('0x38')](_0x406cf8[_0xb042('0x35')][_0xb042('0x38')]));_0x440b41[_0xb042('0x37')]=_0x440b41[_0xb042('0x37')][_0xb042('0x39')]?_0x440b41['attributes']:_0x4f7c60['model'];if(_0x406cf8[_0xb042('0x35')]['includeAll']){_0x440b41['include']=[{'all':!![]}];}_0x440b41=_[_0xb042('0x43')]({},_0x440b41,_0x406cf8[_0xb042('0x44')]);return db[_0xb042('0x2f')]['find'](_0x440b41)['then'](handleEntityNotFound(_0x513e62,null))[_0xb042('0x24')](respondWithResult(_0x513e62,null))['catch'](handleError(_0x513e62,null));};exports[_0xb042('0x4c')]=function(_0x283164,_0x2b7db5){return db[_0xb042('0x2f')][_0xb042('0x4c')](_0x283164[_0xb042('0x4d')],{})[_0xb042('0x24')](function(_0x5e2e1e){var _0x320a22=_0x283164['user']['get']({'plain':!![]});if(!_0x320a22)throw new Error(_0xb042('0x4e'));if(_0x320a22['role']===_0xb042('0x4f')){var _0x286c1f=_0x5e2e1e['get']({'plain':!![]});var _0x29717d=_0xb042('0x27');return db[_0xb042('0x50')][_0xb042('0x51')]({'where':{'name':_0x29717d,'userProfileId':_0x320a22['userProfileId']},'raw':!![]})[_0xb042('0x24')](function(_0x23555f){if(_0x23555f&&_0x23555f['autoAssociation']===0x0){return db[_0xb042('0x28')][_0xb042('0x4c')]({'name':_0x286c1f[_0xb042('0x2b')],'resourceId':_0x286c1f['id'],'type':_0x23555f[_0xb042('0x2b')],'sectionId':_0x23555f['id']},{})[_0xb042('0x24')](function(){return _0x5e2e1e;});}else{return _0x5e2e1e;}})['catch'](function(_0x5d6932){logger[_0xb042('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d6932);throw _0x5d6932;});}return _0x5e2e1e;})[_0xb042('0x24')](respondWithResult(_0x2b7db5,0xc9))['catch'](handleError(_0x2b7db5,null));};exports['update']=function(_0x2734fe,_0x5c9540){if(_0x2734fe[_0xb042('0x4d')]['id']){delete _0x2734fe['body']['id'];}return db['Interval'][_0xb042('0x51')]({'where':{'id':_0x2734fe['params']['id']}})[_0xb042('0x24')](handleEntityNotFound(_0x5c9540,null))[_0xb042('0x24')](saveUpdates(_0x2734fe[_0xb042('0x4d')],null))[_0xb042('0x24')](respondWithResult(_0x5c9540,null))['catch'](handleError(_0x5c9540,null));};exports[_0xb042('0x25')]=function(_0x5defd7,_0x59c5e0){return db[_0xb042('0x2f')][_0xb042('0x51')]({'where':{'id':_0x5defd7['params']['id']}})[_0xb042('0x24')](handleEntityNotFound(_0x59c5e0,null))[_0xb042('0x24')](removeEntity(_0x59c5e0,null))[_0xb042('0x52')](handleError(_0x59c5e0,null));};exports[_0xb042('0x53')]=function(_0xd8ead6,_0x946b92,_0x37c42b){if(_0xd8ead6[_0xb042('0x4d')]['id']){delete _0xd8ead6['body']['id'];}return db[_0xb042('0x2f')]['find']({'where':{'id':_0xd8ead6[_0xb042('0x4a')]['id']}})[_0xb042('0x24')](handleEntityNotFound(_0x946b92,null))[_0xb042('0x24')](function(_0x5b5f5c){if(_0x5b5f5c){_0xd8ead6[_0xb042('0x4d')][_0xb042('0x54')]=_0x5b5f5c['id'];return db[_0xb042('0x2f')][_0xb042('0x4c')](_0xd8ead6[_0xb042('0x4d')]);}})[_0xb042('0x24')](respondWithResult(_0x946b92,null))[_0xb042('0x52')](handleError(_0x946b92,null));};exports[_0xb042('0x55')]=function(_0x52d9a0,_0x18e7e7,_0x57588f){var _0x4c2744={};var _0x2b29ad={};var _0x355db3;var _0x3648bc;return db['Interval']['findOne']({'where':{'id':_0x52d9a0['params']['id']}})['then'](handleEntityNotFound(_0x18e7e7,null))[_0xb042('0x24')](function(_0x4c6dfd){if(_0x4c6dfd){_0x355db3=_0x4c6dfd;_0x2b29ad[_0xb042('0x34')]=_[_0xb042('0x36')](db[_0xb042('0x2f')][_0xb042('0x30')]);_0x2b29ad['query']=_['keys'](_0x52d9a0['query']);_0x2b29ad['filters']=_[_0xb042('0x4b')](_0x2b29ad[_0xb042('0x34')],_0x2b29ad[_0xb042('0x35')]);_0x4c2744[_0xb042('0x37')]=_[_0xb042('0x4b')](_0x2b29ad[_0xb042('0x34')],qs[_0xb042('0x38')](_0x52d9a0[_0xb042('0x35')]['fields']));_0x4c2744['attributes']=_0x4c2744[_0xb042('0x37')][_0xb042('0x39')]?_0x4c2744['attributes']:_0x2b29ad['model'];_0x4c2744[_0xb042('0x3c')]=qs[_0xb042('0x3d')](_0x52d9a0[_0xb042('0x35')][_0xb042('0x3d')]);_0x4c2744[_0xb042('0x3e')]=qs['filters'](_[_0xb042('0x40')](_0x52d9a0[_0xb042('0x35')],_0x2b29ad[_0xb042('0x3f')]));if(_0x52d9a0['query'][_0xb042('0x41')]){_0x4c2744[_0xb042('0x3e')]=_[_0xb042('0x43')](_0x4c2744[_0xb042('0x3e')],{'$or':_[_0xb042('0x2e')](_0x4c2744['attributes'],function(_0x5cf6de){var _0x54f55a={};_0x54f55a[_0x5cf6de]={'$like':'%'+_0x52d9a0[_0xb042('0x35')][_0xb042('0x41')]+'%'};return _0x54f55a;})});}_0x4c2744=_[_0xb042('0x43')]({},_0x4c2744,_0x52d9a0[_0xb042('0x44')]);return _0x355db3[_0xb042('0x55')](_0x4c2744);}})[_0xb042('0x24')](function(_0x3d562e){if(_0x3d562e){_0x3648bc=_0x3d562e[_0xb042('0x39')];if(!_0x52d9a0['query'][_0xb042('0x3a')](_0xb042('0x3b'))){_0x4c2744[_0xb042('0x1d')]=qs['limit'](_0x52d9a0['query']['limit']);_0x4c2744[_0xb042('0x1b')]=qs['offset'](_0x52d9a0[_0xb042('0x35')][_0xb042('0x1b')]);}return _0x355db3['getIntervals'](_0x4c2744);}})[_0xb042('0x24')](function(_0x11108b){if(_0x11108b){return _0x11108b?{'count':_0x3648bc,'rows':_0x11108b}:null;}})['then'](respondWithResult(_0x18e7e7,null))[_0xb042('0x52')](handleError(_0x18e7e7,null));};exports[_0xb042('0x56')]=function(_0x4eafa7,_0x39adda,_0x29c96b){return db[_0xb042('0x2f')]['findOne']({'where':{'id':_0x4eafa7[_0xb042('0x4a')]['id']}})[_0xb042('0x24')](handleEntityNotFound(_0x39adda,null))[_0xb042('0x24')](function(_0xcf4ab1){if(_0xcf4ab1){return db[_0xb042('0x57')][_0xb042('0x58')](function(_0x4b8664){return db[_0xb042('0x2f')][_0xb042('0x25')]({'where':{'IntervalId':_0x4eafa7['params']['id']},'transaction':_0x4b8664})[_0xb042('0x24')](function(_0x4b3242){var _0x17d99d=_[_0xb042('0x2e')](_0x4eafa7[_0xb042('0x4d')],function(_0x3ba181){delete _0x3ba181['id'];_0x3ba181['IntervalId']=_0x4eafa7['params']['id'];return _0x3ba181;});return db[_0xb042('0x2f')][_0xb042('0x59')](_0x17d99d,{'transaction':_0x4b8664});});})[_0xb042('0x24')](function(){return db[_0xb042('0x2f')][_0xb042('0x47')]({'where':{'IntervalId':_0x4eafa7['params']['id']}});});}})[_0xb042('0x24')](respondWithResult(_0x39adda,null))['catch'](handleError(_0x39adda,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 7d8479b..300093f 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 _0x62b9=['reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','Interval','rewrite','interval','string','getIntervals','then','all','map','ifTime'];(function(_0x7a2696,_0x268b3b){var _0x20bf47=function(_0xccaf91){while(--_0xccaf91){_0x7a2696['push'](_0x7a2696['shift']());}};_0x20bf47(++_0x268b3b);}(_0x62b9,0xe2));var _0x962b=function(_0x59a828,_0x1f6361){_0x59a828=_0x59a828-0x0;var _0x112380=_0x62b9[_0x59a828];return _0x112380;};'use strict';var attributes=require(_0x962b('0x0'));var extensions=require(_0x962b('0x1'));var iftime=require(_0x962b('0x2'))[_0x962b('0x3')];module[_0x962b('0x4')]=function(_0x2423c4){return _0x2423c4['define'](_0x962b('0x5'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x33dfd7){extensions[_0x962b('0x6')](_0x2423c4,_0x33dfd7);},'afterBulkCreate':function(_0x223a8e,_0x4a0d32,_0x31c7ae){_0x31c7ae();extensions[_0x962b('0x6')](_0x2423c4,_0x223a8e[0x0]);},'afterUpdate':function(_0x2cb431){extensions[_0x962b('0x6')](_0x2423c4,_0x2cb431);},'afterDestroy':function(_0x52be2f){extensions['rewrite'](_0x2423c4,_0x52be2f);}},'instanceMethods':{'ifTime':function(_0x3b3cc2=undefined,_0x37f6c6=new Date()){if(typeof this[_0x962b('0x7')]===_0x962b('0x8')){return iftime(this['interval'],_0x3b3cc2,_0x37f6c6);}else{return this[_0x962b('0x9')]()[_0x962b('0xa')](function(_0x3d8ad2){return Promise[_0x962b('0xb')](_0x3d8ad2[_0x962b('0xc')](function(_0x4c7ece){return _0x4c7ece[_0x962b('0xd')](_0x3b3cc2,_0x37f6c6);}));})[_0x962b('0xa')](function(_0x274e8e){return _0x274e8e[_0x962b('0xe')](function(_0x2e8ca2,_0x41d83d){return _0x2e8ca2||_0x41d83d;},![]);});}}}});}; \ No newline at end of file +var _0xa11b=['iftime','exports','define','tools_intervals','rewrite','interval','all','map','ifTime','then','reduce','./interval.attributes','../../components/extensions/rewrite'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa11b,0x66));var _0xba11=function(_0x3ae5d6,_0x906e55){_0x3ae5d6=_0x3ae5d6-0x0;var _0x346177=_0xa11b[_0x3ae5d6];return _0x346177;};'use strict';var attributes=require(_0xba11('0x0'));var extensions=require(_0xba11('0x1'));var iftime=require('../../utils/iftime')[_0xba11('0x2')];module[_0xba11('0x3')]=function(_0x3e66c3){return _0x3e66c3[_0xba11('0x4')]('Interval',attributes,{'tableName':_0xba11('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x29d3d4){extensions[_0xba11('0x6')](_0x3e66c3,_0x29d3d4);},'afterBulkCreate':function(_0x29fba6,_0xa834b7,_0x1661fd){_0x1661fd();extensions[_0xba11('0x6')](_0x3e66c3,_0x29fba6[0x0]);},'afterUpdate':function(_0x3d0584){extensions[_0xba11('0x6')](_0x3e66c3,_0x3d0584);},'afterDestroy':function(_0x238ab1){extensions['rewrite'](_0x3e66c3,_0x238ab1);}},'instanceMethods':{'ifTime':function(_0x40987f=undefined,_0x5e2dad=new Date()){if(typeof this[_0xba11('0x7')]==='string'){return iftime(this['interval'],_0x40987f,_0x5e2dad);}else{return this['getIntervals']()['then'](function(_0x1eab14){return Promise[_0xba11('0x8')](_0x1eab14[_0xba11('0x9')](function(_0x456029){return _0x456029[_0xba11('0xa')](_0x40987f,_0x5e2dad);}));})[_0xba11('0xb')](function(_0x280f11){return _0x280f11[_0xba11('0xc')](function(_0x48a6cd,_0x391aaa){return _0x48a6cd||_0x391aaa;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 4aa7d0c..dc4f0f1 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 _0xfdaf=['all','reduce','name','join','format','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','ifTime','IntervalIftime','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','silly','resolve','lodash','util','../../mysqldb','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','message','ShowInterval','find'];(function(_0x129bee,_0x214d23){var _0x19f45a=function(_0x34ac4d){while(--_0x34ac4d){_0x129bee['push'](_0x129bee['shift']());}};_0x19f45a(++_0x214d23);}(_0xfdaf,0x19e));var _0xffda=function(_0x14c360,_0xeea136){_0x14c360=_0x14c360-0x0;var _0x49e3d7=_0xfdaf[_0x14c360];return _0x49e3d7;};'use strict';var _=require(_0xffda('0x0'));var util=require(_0xffda('0x1'));var db=require(_0xffda('0x2'))['db'];var iftime=require('../../utils/iftime')[_0xffda('0x3')];var logger=require(_0xffda('0x4'))(_0xffda('0x5'));exports[_0xffda('0x6')]=function(_0x144c86){var _0x666350=this;return new Promise(function(_0x19b8dc,_0x234b7e){return db[_0xffda('0x7')][_0xffda('0x8')]({'raw':_0x144c86[_0xffda('0x9')]?_0x144c86[_0xffda('0x9')][_0xffda('0xa')]===undefined?!![]:![]:!![],'where':_0x144c86[_0xffda('0x9')]?_0x144c86[_0xffda('0x9')][_0xffda('0xb')]||null:null,'attributes':_0x144c86[_0xffda('0x9')]?_0x144c86[_0xffda('0x9')][_0xffda('0xc')]||null:null,'limit':_0x144c86[_0xffda('0x9')]?_0x144c86[_0xffda('0x9')][_0xffda('0xd')]||null:null,'include':_0x144c86[_0xffda('0x9')]?_0x144c86[_0xffda('0x9')][_0xffda('0xe')]?_[_0xffda('0xf')](_0x144c86[_0xffda('0x9')][_0xffda('0xe')],function(_0x5d9c8f){return{'model':db[_0x5d9c8f[_0xffda('0x10')]],'as':_0x5d9c8f['as'],'attributes':_0x5d9c8f[_0xffda('0xc')],'include':_0x5d9c8f[_0xffda('0xe')]?_['map'](_0x5d9c8f[_0xffda('0xe')],function(_0x2b8124){return{'model':db[_0x2b8124[_0xffda('0x10')]],'as':_0x2b8124['as'],'attributes':_0x2b8124['attributes'],'include':_0x2b8124[_0xffda('0xe')]?_['map'](_0x2b8124[_0xffda('0xe')],function(_0xa08ec8){return{'model':db[_0xa08ec8[_0xffda('0x10')]],'as':_0xa08ec8['as'],'attributes':_0xa08ec8[_0xffda('0xc')]};}):[]};}):[]};}):[]:[]})[_0xffda('0x11')](function(_0x42989a){logger[_0xffda('0x12')](_0xffda('0x6'),_0x144c86);logger[_0xffda('0x13')]('GetInterval',_0x144c86,JSON[_0xffda('0x14')](_0x42989a));_0x19b8dc(_0x42989a);})[_0xffda('0x15')](function(_0x50b666){logger[_0xffda('0x16')](_0xffda('0x6'),_0x50b666[_0xffda('0x17')],_0x144c86);_0x234b7e(_0x666350[_0xffda('0x16')](0x1f4,_0x50b666['message']));});});};exports[_0xffda('0x18')]=function(_0x2a6581){var _0x263c24=this;return new Promise(function(_0x4804ca,_0x352f87){return db['Interval'][_0xffda('0x19')]({'raw':_0x2a6581['options']?_0x2a6581['options'][_0xffda('0xa')]===undefined?!![]:![]:!![],'where':_0x2a6581[_0xffda('0x9')]?_0x2a6581[_0xffda('0x9')][_0xffda('0xb')]||null:null,'attributes':_0x2a6581[_0xffda('0x9')]?_0x2a6581[_0xffda('0x9')][_0xffda('0xc')]||null:null,'include':_0x2a6581[_0xffda('0x9')]?_0x2a6581[_0xffda('0x9')][_0xffda('0xe')]?_['map'](_0x2a6581[_0xffda('0x9')]['include'],function(_0xd95a50){return{'model':db[_0xd95a50[_0xffda('0x10')]],'as':_0xd95a50['as'],'attributes':_0xd95a50['attributes'],'include':_0xd95a50[_0xffda('0xe')]?_[_0xffda('0xf')](_0xd95a50[_0xffda('0xe')],function(_0x5558f9){return{'model':db[_0x5558f9[_0xffda('0x10')]],'as':_0x5558f9['as'],'attributes':_0x5558f9[_0xffda('0xc')],'include':_0x5558f9[_0xffda('0xe')]?_[_0xffda('0xf')](_0x5558f9[_0xffda('0xe')],function(_0x5c55fc){return{'model':db[_0x5c55fc['model']],'as':_0x5c55fc['as'],'attributes':_0x5c55fc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xebeae5){logger[_0xffda('0x12')](_0xffda('0x18'),_0x2a6581);logger[_0xffda('0x13')](_0xffda('0x18'),_0x2a6581,JSON[_0xffda('0x14')](_0xebeae5));_0x4804ca(_0xebeae5);})[_0xffda('0x15')](function(_0x566b49){logger[_0xffda('0x16')](_0xffda('0x18'),_0x566b49[_0xffda('0x17')],_0x2a6581);_0x352f87(_0x263c24['error'](0x1f4,_0x566b49[_0xffda('0x17')]));});});};function checkArrayOfIntervals(_0x464e63,_0x930c02){var _0x50c5e8=[];return db[_0xffda('0x7')][_0xffda('0x8')]({'where':{'id':_0x464e63}})[_0xffda('0x11')](function(_0x5e854f){_0x50c5e8=_0x5e854f;return Promise[_0xffda('0x1a')](_0x50c5e8[_0xffda('0xf')](function(_0x18c4ce){return _0x18c4ce['ifTime'](_0x930c02);}));})['then'](function(_0x3f9052){var _0x427d1f=_0x3f9052[_0xffda('0x1b')](function(_0x28feca,_0x10c669){return _0x28feca||_0x10c669;},![]);logger[_0xffda('0x12')](util['format']('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x50c5e8[_0xffda('0xf')](function(_0x3969e7){return _0x3969e7[_0xffda('0x1c')];})[_0xffda('0x1d')](',\x20'),_0x50c5e8[_0xffda('0xf')](function(_0x5f5dcf){return _0x5f5dcf['id'];})[_0xffda('0x1d')](',\x20')));return _0x427d1f;});}function checkSingleInterval(_0x8b74b0,_0x5de790){return db[_0xffda('0x7')]['findById'](_0x8b74b0)[_0xffda('0x11')](function(_0x46c07e){if(_0x46c07e){logger[_0xffda('0x12')](util[_0xffda('0x1e')](_0xffda('0x1f'),_0x46c07e[_0xffda('0x1c')],_0x46c07e['id']));return _0x46c07e[_0xffda('0x20')](_0x5de790);}});}exports[_0xffda('0x21')]=function(_0xf5d642){var _0x27d61e=_0xf5d642[_0xffda('0x22')];var _0x1c4e3d=Array[_0xffda('0x23')](_0xf5d642[_0xffda('0x24')])?_0xf5d642[_0xffda('0x24')]:typeof _0xf5d642[_0xffda('0x24')]===_0xffda('0x25')?[_0xf5d642[_0xffda('0x24')]]:[];var _0x3a7a82=_0xf5d642[_0xffda('0x26')]||undefined;var _0x2b5e1b=![];if(_0x1c4e3d[_0xffda('0x27')]){logger[_0xffda('0x12')](util[_0xffda('0x1e')](_0xffda('0x28'),_0x1c4e3d[_0xffda('0x1d')](';\x20')));}if(_0x3a7a82){logger[_0xffda('0x12')](util[_0xffda('0x1e')](_0xffda('0x29'),_0x3a7a82));}logger[_0xffda('0x13')]('Iftime',_0x2b5e1b);logger[_0xffda('0x2a')](_0xffda('0x21'),_0xf5d642);return Promise[_0xffda('0x2b')]()['then'](function(){if(Array['isArray'](_0x27d61e)){return checkArrayOfIntervals(_0x27d61e,_0x3a7a82);}else if(_0x27d61e){return checkSingleInterval(_0x27d61e,_0x3a7a82);}})[_0xffda('0x11')](function(_0xc245c2){var _0x231222=_0x1c4e3d[_0xffda('0x1b')](function(_0x280b7c,_0x4ca27d){return _0x280b7c||iftime(_0x4ca27d,_0x3a7a82);},![]);_0x2b5e1b=_0xc245c2||_0x231222;return _0x2b5e1b;})[_0xffda('0x15')](function(_0x208015){logger[_0xffda('0x16')](_0xffda('0x21'),_0xf5d642,_0x208015);throw this['error'](0x1f4,_0x208015[_0xffda('0x17')]);});}; \ No newline at end of file +var _0xdfe2=['where','limit','include','map','model','attributes','info','GetInterval','debug','stringify','catch','error','message','find','then','ShowInterval','all','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','format','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','ifTime','IntervalIftime','intervals','string','timezone','length','Iftime','silly','resolve','isArray','reduce','lodash','util','../../mysqldb','../../utils/iftime','iftime','Interval','findAll','options','raw'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0xdfe2,0x1a5));var _0x2dfe=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xdfe2[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x2dfe('0x0'));var util=require(_0x2dfe('0x1'));var db=require(_0x2dfe('0x2'))['db'];var iftime=require(_0x2dfe('0x3'))[_0x2dfe('0x4')];var logger=require('../../config/logger')('rpc');exports['GetInterval']=function(_0xcfa292){var _0x356645=this;return new Promise(function(_0xf603a5,_0x257f41){return db[_0x2dfe('0x5')][_0x2dfe('0x6')]({'raw':_0xcfa292[_0x2dfe('0x7')]?_0xcfa292['options'][_0x2dfe('0x8')]===undefined?!![]:![]:!![],'where':_0xcfa292[_0x2dfe('0x7')]?_0xcfa292[_0x2dfe('0x7')][_0x2dfe('0x9')]||null:null,'attributes':_0xcfa292[_0x2dfe('0x7')]?_0xcfa292[_0x2dfe('0x7')]['attributes']||null:null,'limit':_0xcfa292[_0x2dfe('0x7')]?_0xcfa292[_0x2dfe('0x7')][_0x2dfe('0xa')]||null:null,'include':_0xcfa292[_0x2dfe('0x7')]?_0xcfa292[_0x2dfe('0x7')][_0x2dfe('0xb')]?_[_0x2dfe('0xc')](_0xcfa292[_0x2dfe('0x7')][_0x2dfe('0xb')],function(_0x3bdeb5){return{'model':db[_0x3bdeb5[_0x2dfe('0xd')]],'as':_0x3bdeb5['as'],'attributes':_0x3bdeb5['attributes'],'include':_0x3bdeb5[_0x2dfe('0xb')]?_[_0x2dfe('0xc')](_0x3bdeb5['include'],function(_0x5695f5){return{'model':db[_0x5695f5[_0x2dfe('0xd')]],'as':_0x5695f5['as'],'attributes':_0x5695f5[_0x2dfe('0xe')],'include':_0x5695f5[_0x2dfe('0xb')]?_[_0x2dfe('0xc')](_0x5695f5[_0x2dfe('0xb')],function(_0x4adcf5){return{'model':db[_0x4adcf5['model']],'as':_0x4adcf5['as'],'attributes':_0x4adcf5[_0x2dfe('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1841aa){logger[_0x2dfe('0xf')](_0x2dfe('0x10'),_0xcfa292);logger[_0x2dfe('0x11')](_0x2dfe('0x10'),_0xcfa292,JSON[_0x2dfe('0x12')](_0x1841aa));_0xf603a5(_0x1841aa);})[_0x2dfe('0x13')](function(_0x3f4908){logger[_0x2dfe('0x14')]('GetInterval',_0x3f4908[_0x2dfe('0x15')],_0xcfa292);_0x257f41(_0x356645[_0x2dfe('0x14')](0x1f4,_0x3f4908[_0x2dfe('0x15')]));});});};exports['ShowInterval']=function(_0x144388){var _0x9ced6b=this;return new Promise(function(_0x2daf97,_0x3c23b3){return db['Interval'][_0x2dfe('0x16')]({'raw':_0x144388[_0x2dfe('0x7')]?_0x144388[_0x2dfe('0x7')][_0x2dfe('0x8')]===undefined?!![]:![]:!![],'where':_0x144388[_0x2dfe('0x7')]?_0x144388['options'][_0x2dfe('0x9')]||null:null,'attributes':_0x144388[_0x2dfe('0x7')]?_0x144388[_0x2dfe('0x7')][_0x2dfe('0xe')]||null:null,'include':_0x144388[_0x2dfe('0x7')]?_0x144388['options'][_0x2dfe('0xb')]?_[_0x2dfe('0xc')](_0x144388['options'][_0x2dfe('0xb')],function(_0x5765e7){return{'model':db[_0x5765e7['model']],'as':_0x5765e7['as'],'attributes':_0x5765e7[_0x2dfe('0xe')],'include':_0x5765e7[_0x2dfe('0xb')]?_['map'](_0x5765e7['include'],function(_0x3f9e9d){return{'model':db[_0x3f9e9d[_0x2dfe('0xd')]],'as':_0x3f9e9d['as'],'attributes':_0x3f9e9d[_0x2dfe('0xe')],'include':_0x3f9e9d[_0x2dfe('0xb')]?_[_0x2dfe('0xc')](_0x3f9e9d[_0x2dfe('0xb')],function(_0x59212f){return{'model':db[_0x59212f[_0x2dfe('0xd')]],'as':_0x59212f['as'],'attributes':_0x59212f[_0x2dfe('0xe')]};}):[]};}):[]};}):[]:[]})[_0x2dfe('0x17')](function(_0x132f76){logger['info'](_0x2dfe('0x18'),_0x144388);logger[_0x2dfe('0x11')](_0x2dfe('0x18'),_0x144388,JSON[_0x2dfe('0x12')](_0x132f76));_0x2daf97(_0x132f76);})['catch'](function(_0x3f61d4){logger[_0x2dfe('0x14')](_0x2dfe('0x18'),_0x3f61d4[_0x2dfe('0x15')],_0x144388);_0x3c23b3(_0x9ced6b[_0x2dfe('0x14')](0x1f4,_0x3f61d4[_0x2dfe('0x15')]));});});};function checkArrayOfIntervals(_0x321b72,_0x292785){var _0x1c2446=[];return db['Interval'][_0x2dfe('0x6')]({'where':{'id':_0x321b72}})[_0x2dfe('0x17')](function(_0x5a87f9){_0x1c2446=_0x5a87f9;return Promise[_0x2dfe('0x19')](_0x1c2446[_0x2dfe('0xc')](function(_0x5e3a5e){return _0x5e3a5e['ifTime'](_0x292785);}));})[_0x2dfe('0x17')](function(_0x5d76ee){var _0x2e4742=_0x5d76ee['reduce'](function(_0x3769e9,_0x5ef8af){return _0x3769e9||_0x5ef8af;},![]);logger[_0x2dfe('0xf')](util['format'](_0x2dfe('0x1a'),_0x1c2446[_0x2dfe('0xc')](function(_0x4664bb){return _0x4664bb['name'];})[_0x2dfe('0x1b')](',\x20'),_0x1c2446[_0x2dfe('0xc')](function(_0x128456){return _0x128456['id'];})[_0x2dfe('0x1b')](',\x20')));return _0x2e4742;});}function checkSingleInterval(_0x5c917c,_0x989c64){return db[_0x2dfe('0x5')][_0x2dfe('0x1c')](_0x5c917c)[_0x2dfe('0x17')](function(_0x569289){if(_0x569289){logger['info'](util[_0x2dfe('0x1d')](_0x2dfe('0x1e'),_0x569289[_0x2dfe('0x1f')],_0x569289['id']));return _0x569289[_0x2dfe('0x20')](_0x989c64);}});}exports[_0x2dfe('0x21')]=function(_0x45ca6c){var _0x103be3=_0x45ca6c['intervalIds'];var _0x5112c5=Array['isArray'](_0x45ca6c[_0x2dfe('0x22')])?_0x45ca6c[_0x2dfe('0x22')]:typeof _0x45ca6c[_0x2dfe('0x22')]===_0x2dfe('0x23')?[_0x45ca6c['intervals']]:[];var _0x342432=_0x45ca6c[_0x2dfe('0x24')]||undefined;var _0x3f4e35=![];if(_0x5112c5[_0x2dfe('0x25')]){logger['info'](util[_0x2dfe('0x1d')]('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x5112c5['join'](';\x20')));}if(_0x342432){logger['info'](util[_0x2dfe('0x1d')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x342432));}logger['debug'](_0x2dfe('0x26'),_0x3f4e35);logger[_0x2dfe('0x27')]('IntervalIftime',_0x45ca6c);return Promise[_0x2dfe('0x28')]()[_0x2dfe('0x17')](function(){if(Array[_0x2dfe('0x29')](_0x103be3)){return checkArrayOfIntervals(_0x103be3,_0x342432);}else if(_0x103be3){return checkSingleInterval(_0x103be3,_0x342432);}})[_0x2dfe('0x17')](function(_0x3f98cf){var _0x3a5496=_0x5112c5[_0x2dfe('0x2a')](function(_0x292758,_0x1f7687){return _0x292758||iftime(_0x1f7687,_0x342432);},![]);_0x3f4e35=_0x3f98cf||_0x3a5496;return _0x3f4e35;})['catch'](function(_0x37d14a){logger[_0x2dfe('0x14')](_0x2dfe('0x21'),_0x45ca6c,_0x37d14a);throw this[_0x2dfe('0x14')](0x1f4,_0x37d14a[_0x2dfe('0x15')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 23c747d..75d64b5 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(_0x51a6e6,_0x4ca502){var _0x1cb18f=function(_0x5cee29){while(--_0x5cee29){_0x51a6e6['push'](_0x51a6e6['shift']());}};_0x1cb18f(++_0x4ca502);}(_0xdb28,0x106));var _0x8db2=function(_0xc99ef2,_0x2380f4){_0xc99ef2=_0xc99ef2-0x0;var _0x2f25a5=_0xdb28[_0xc99ef2];return _0x2f25a5;};'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 _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1304c6,_0x6bb485){_0x1304c6=_0x1304c6-0x0;var _0x2e6654=_0x0b0e[_0x1304c6];return _0x2e6654;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 0fa83bb..576daa2 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 _0x0fbc=['customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','data','status','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','openIssue','send','headers','x-forwarded-for','connection','socket','remoteAddress','body','bluebird','https','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','description','stringify','issuetype','Bug','email','fields','customfield_11501','customfield_11502','newToken'];(function(_0x52121d,_0x1d1704){var _0x448627=function(_0x495bf0){while(--_0x495bf0){_0x52121d['push'](_0x52121d['shift']());}};_0x448627(++_0x1d1704);}(_0x0fbc,0x1ce));var _0xc0fb=function(_0x51c6c3,_0x3c0726){_0x51c6c3=_0x51c6c3-0x0;var _0x198fd6=_0x0fbc[_0x51c6c3];return _0x198fd6;};'use strict';var BPromise=require(_0xc0fb('0x0'));var https=require(_0xc0fb('0x1'));var logger=require('../../config/logger')(_0xc0fb('0x2'));var USERNAME=_0xc0fb('0x3');var PASSWORD=_0xc0fb('0x4');function openIssue(_0x438aa9,_0x42ec1b){var _0x509e33={'fields':{'project':{'key':_0x438aa9[_0xc0fb('0x5')]||_0xc0fb('0x6')},'summary':(_0x438aa9[_0xc0fb('0x7')]||_0xc0fb('0x8'))+'\x20from\x20'+_0x438aa9['ip'],'description':_0x438aa9[_0xc0fb('0x9')]||JSON[_0xc0fb('0xa')](_0x438aa9),'issuetype':{'name':_0x438aa9[_0xc0fb('0xb')]||_0xc0fb('0xc')}}};_0x509e33['fields']['customfield_11500']=_0x438aa9[_0xc0fb('0xd')];_0x509e33[_0xc0fb('0xe')][_0xc0fb('0xf')]=_0x438aa9['oldToken'];_0x509e33[_0xc0fb('0xe')][_0xc0fb('0x10')]=_0x438aa9[_0xc0fb('0x11')];_0x509e33[_0xc0fb('0xe')][_0xc0fb('0x12')]=_0x438aa9['name'];_0x509e33['fields'][_0xc0fb('0x13')]=_0x438aa9[_0xc0fb('0x14')];_0x509e33[_0xc0fb('0xe')][_0xc0fb('0x15')]=_0x438aa9['ip'];var _0x2449df={'host':_0xc0fb('0x16'),'port':0x1bb,'path':_0xc0fb('0x17'),'method':_0xc0fb('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0xc0fb('0x19'),'Authorization':_0xc0fb('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0xc0fb('0x1b')](_0xc0fb('0x1c'))}};var _0x1237f6=JSON['stringify'](_0x509e33);var _0xb04efa=https[_0xc0fb('0x1d')](_0x2449df,function(_0x2b02de){_0x2b02de[_0xc0fb('0x1e')]('utf8');var _0x37230c='';_0x2b02de['on'](_0xc0fb('0x1f'),function(_0x67b739){_0x37230c+=_0x67b739;});_0x2b02de['on']('end',function(){if(_0x42ec1b){return _0x42ec1b[_0xc0fb('0x20')](_0x2b02de[_0xc0fb('0x21')])[_0xc0fb('0x22')](JSON[_0xc0fb('0x23')](_0x37230c));}});});_0xb04efa['on']('error',function(_0x1d2a29){if(_0x42ec1b){return _0x42ec1b[_0xc0fb('0x20')](0x1f4)['json']({'errors':[{'message':_0xc0fb('0x24'),'type':_0xc0fb('0x25')}]});}});_0xb04efa[_0xc0fb('0x26')](_0x1237f6);_0xb04efa[_0xc0fb('0x27')]();}exports[_0xc0fb('0x28')]=openIssue;exports[_0xc0fb('0x29')]=function(_0x1e622e,_0x257217){_0x1e622e['body']['ip']=_0x1e622e[_0xc0fb('0x2a')][_0xc0fb('0x2b')]||_0x1e622e[_0xc0fb('0x2c')]['remoteAddress']||_0x1e622e['socket']['remoteAddress']||_0x1e622e['connection'][_0xc0fb('0x2d')][_0xc0fb('0x2e')];return openIssue(_0x1e622e[_0xc0fb('0x2f')],_0x257217);}; \ No newline at end of file +var _0xd64c=['Basic\x20','toString','base64','request','setEncoding','utf8','statusCode','json','error','write','end','openIssue','send','x-forwarded-for','connection','remoteAddress','socket','body','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','stringify','issuetype','Bug','fields','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST'];(function(_0x2d5781,_0x375b2f){var _0x1071a6=function(_0x2aba1e){while(--_0x2aba1e){_0x2d5781['push'](_0x2d5781['shift']());}};_0x1071a6(++_0x375b2f);}(_0xd64c,0x1e0));var _0xcd64=function(_0x83322e,_0x2c95da){_0x83322e=_0x83322e-0x0;var _0x1e44e4=_0xd64c[_0x83322e];return _0x1e44e4;};'use strict';var BPromise=require(_0xcd64('0x0'));var https=require(_0xcd64('0x1'));var logger=require(_0xcd64('0x2'))(_0xcd64('0x3'));var USERNAME=_0xcd64('0x4');var PASSWORD=_0xcd64('0x5');function openIssue(_0x383586,_0x3437c1){var _0x1cfab2={'fields':{'project':{'key':_0x383586[_0xcd64('0x6')]||_0xcd64('0x7')},'summary':(_0x383586['summary']||_0xcd64('0x8'))+_0xcd64('0x9')+_0x383586['ip'],'description':_0x383586['description']||JSON[_0xcd64('0xa')](_0x383586),'issuetype':{'name':_0x383586[_0xcd64('0xb')]||_0xcd64('0xc')}}};_0x1cfab2[_0xcd64('0xd')]['customfield_11500']=_0x383586['email'];_0x1cfab2['fields']['customfield_11501']=_0x383586[_0xcd64('0xe')];_0x1cfab2['fields'][_0xcd64('0xf')]=_0x383586[_0xcd64('0x10')];_0x1cfab2[_0xcd64('0xd')][_0xcd64('0x11')]=_0x383586[_0xcd64('0x12')];_0x1cfab2[_0xcd64('0xd')][_0xcd64('0x13')]=_0x383586[_0xcd64('0x14')];_0x1cfab2[_0xcd64('0xd')]['customfield_10102']=_0x383586['ip'];var _0x1f7e45={'host':_0xcd64('0x15'),'port':0x1bb,'path':_0xcd64('0x16'),'method':_0xcd64('0x17'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xcd64('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0xcd64('0x19')](_0xcd64('0x1a'))}};var _0x408ff4=JSON[_0xcd64('0xa')](_0x1cfab2);var _0x19c6cb=https[_0xcd64('0x1b')](_0x1f7e45,function(_0x24c3df){_0x24c3df[_0xcd64('0x1c')](_0xcd64('0x1d'));var _0x4d3777='';_0x24c3df['on']('data',function(_0x264d75){_0x4d3777+=_0x264d75;});_0x24c3df['on']('end',function(){if(_0x3437c1){return _0x3437c1['status'](_0x24c3df[_0xcd64('0x1e')])[_0xcd64('0x1f')](JSON['parse'](_0x4d3777));}});});_0x19c6cb['on'](_0xcd64('0x20'),function(_0x280f8d){if(_0x3437c1){return _0x3437c1['status'](0x1f4)[_0xcd64('0x1f')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x19c6cb[_0xcd64('0x21')](_0x408ff4);_0x19c6cb[_0xcd64('0x22')]();}exports[_0xcd64('0x23')]=openIssue;exports[_0xcd64('0x24')]=function(_0x4eea4a,_0x1fe85e){_0x4eea4a['body']['ip']=_0x4eea4a['headers'][_0xcd64('0x25')]||_0x4eea4a[_0xcd64('0x26')][_0xcd64('0x27')]||_0x4eea4a[_0xcd64('0x28')][_0xcd64('0x27')]||_0x4eea4a[_0xcd64('0x26')][_0xcd64('0x28')][_0xcd64('0x27')];return openIssue(_0x4eea4a[_0xcd64('0x29')],_0x1fe85e);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index a085340..c63dfbf 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 _0x2750=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x2750,0x13b));var _0x0275=function(_0xba942,_0x1aeefc){_0xba942=_0xba942-0x0;var _0x249b70=_0x2750[_0xba942];return _0x249b70;};'use strict';var multer=require(_0x0275('0x0'));var util=require('util');var path=require(_0x0275('0x1'));var timeout=require(_0x0275('0x2'));var express=require(_0x0275('0x3'));var router=express[_0x0275('0x4')]();var fs_extra=require(_0x0275('0x5'));var auth=require(_0x0275('0x6'));var interaction=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var controller=require(_0x0275('0x9'));router[_0x0275('0xa')]('/',auth['isAuthenticated'](),controller[_0x0275('0xb')]);router[_0x0275('0xa')](_0x0275('0xc'),auth[_0x0275('0xd')](),controller['describe']);router[_0x0275('0xa')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller['show']);router['post']('/',auth[_0x0275('0xd')](),controller['create']);router[_0x0275('0xf')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller[_0x0275('0x10')]);router[_0x0275('0x11')]('/:id',auth[_0x0275('0xd')](),controller[_0x0275('0x12')]);module[_0x0275('0x13')]=router; \ No newline at end of file +var _0x668b=['get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','isAuthenticated','index'];(function(_0xb6c53d,_0x1e5eb1){var _0x3537ab=function(_0xd08c58){while(--_0xd08c58){_0xb6c53d['push'](_0xb6c53d['shift']());}};_0x3537ab(++_0x1e5eb1);}(_0x668b,0x140));var _0xb668=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0x668b[_0x12bcf7];return _0x2825a;};'use strict';var multer=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var path=require('path');var timeout=require(_0xb668('0x2'));var express=require(_0xb668('0x3'));var router=express['Router']();var fs_extra=require(_0xb668('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var controller=require(_0xb668('0x7'));router['get']('/',auth[_0xb668('0x8')](),controller[_0xb668('0x9')]);router[_0xb668('0xa')](_0xb668('0xb'),auth[_0xb668('0x8')](),controller[_0xb668('0xc')]);router['get'](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0xe')]);router[_0xb668('0xf')]('/',auth[_0xb668('0x8')](),controller[_0xb668('0x10')]);router[_0xb668('0x11')](_0xb668('0xd'),auth['isAuthenticated'](),controller[_0xb668('0x12')]);router[_0xb668('0x13')](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0x14')]);module[_0xb668('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 86f3cbd..62f8f88 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(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7a54,0x106));var _0x47a5=function(_0x2cb2f8,_0xe6c5e6){_0x2cb2f8=_0x2cb2f8-0x0;var _0x370257=_0x7a54[_0x2cb2f8];return _0x370257;};'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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7a54,0x106));var _0x47a5=function(_0x185be3,_0x5a197a){_0x185be3=_0x185be3-0x0;var _0x44c3c3=_0x7a54[_0x185be3];return _0x44c3c3;};'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 63c3778..7820a49 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 _0xb4c7=['JscriptyAnswerReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','rows','catch','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x57f5ca,_0x7a6f28){var _0x2d81f4=function(_0x2f8215){while(--_0x2f8215){_0x57f5ca['push'](_0x57f5ca['shift']());}};_0x2d81f4(++_0x7a6f28);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x2bd373,_0x1fee03){_0x2bd373=_0x2bd373-0x0;var _0x58172d=_0xb4c7[_0x2bd373];return _0x58172d;};'use strict';var emlformat=require(_0x7b4c('0x0'));var rimraf=require(_0x7b4c('0x1'));var zipdir=require(_0x7b4c('0x2'));var jsonpatch=require(_0x7b4c('0x3'));var rp=require(_0x7b4c('0x4'));var moment=require('moment');var BPromise=require(_0x7b4c('0x5'));var Mustache=require(_0x7b4c('0x6'));var util=require(_0x7b4c('0x7'));var path=require(_0x7b4c('0x8'));var sox=require(_0x7b4c('0x9'));var csv=require('to-csv');var ejs=require(_0x7b4c('0xa'));var fs=require('fs');var fs_extra=require(_0x7b4c('0xb'));var _=require(_0x7b4c('0xc'));var squel=require('squel');var crypto=require(_0x7b4c('0xd'));var jsforce=require(_0x7b4c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7b4c('0xf'));var querystring=require(_0x7b4c('0x10'));var Papa=require(_0x7b4c('0x11'));var Redis=require(_0x7b4c('0x12'));var authService=require(_0x7b4c('0x13'));var qs=require(_0x7b4c('0x14'));var as=require(_0x7b4c('0x15'));var hardwareService=require(_0x7b4c('0x16'));var logger=require(_0x7b4c('0x17'))(_0x7b4c('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b4c('0x19'));var db=require(_0x7b4c('0x1a'))['db'];function respondWithStatusCode(_0x38656b,_0x1722ad){_0x1722ad=_0x1722ad||0xcc;return function(_0x3e1558){if(_0x3e1558){return _0x38656b[_0x7b4c('0x1b')](_0x1722ad);}return _0x38656b[_0x7b4c('0x1c')](_0x1722ad)[_0x7b4c('0x1d')]();};}function respondWithResult(_0x25b90b,_0x387488){_0x387488=_0x387488||0xc8;return function(_0x593a19){if(_0x593a19){return _0x25b90b[_0x7b4c('0x1c')](_0x387488)[_0x7b4c('0x1e')](_0x593a19);}};}function respondWithFilteredResult(_0xdc71cd,_0x2a0e2f){return function(_0xa0a812){if(_0xa0a812){var _0x2471b3=typeof _0x2a0e2f[_0x7b4c('0x1f')]===_0x7b4c('0x20')&&typeof _0x2a0e2f['limit']===_0x7b4c('0x20');var _0xe71d88=_0xa0a812[_0x7b4c('0x21')];var _0x36c02a=_0x2471b3?0x0:_0x2a0e2f['offset'];var _0x3ce10c=_0x2471b3?_0xa0a812[_0x7b4c('0x21')]:_0x2a0e2f[_0x7b4c('0x1f')]+_0x2a0e2f[_0x7b4c('0x22')];var _0x2d4c72;if(_0x3ce10c>=_0xe71d88){_0x3ce10c=_0xe71d88;_0x2d4c72=0xc8;}else{_0x2d4c72=0xce;}_0xdc71cd[_0x7b4c('0x1c')](_0x2d4c72);return _0xdc71cd[_0x7b4c('0x23')](_0x7b4c('0x24'),_0x36c02a+'-'+_0x3ce10c+'/'+_0xe71d88)[_0x7b4c('0x1e')](_0xa0a812);}return null;};}function patchUpdates(_0x55e3df){return function(_0x1f06ec){try{jsonpatch[_0x7b4c('0x25')](_0x1f06ec,_0x55e3df,!![]);}catch(_0x11996d){return BPromise[_0x7b4c('0x26')](_0x11996d);}return _0x1f06ec[_0x7b4c('0x27')]();};}function saveUpdates(_0x168ac9,_0x176704){return function(_0x3d4826){if(_0x3d4826){return _0x3d4826[_0x7b4c('0x28')](_0x168ac9)[_0x7b4c('0x29')](function(_0x5eec1e){return _0x5eec1e;});}return null;};}function removeEntity(_0x45438c,_0x4350c9){return function(_0x276271){if(_0x276271){return _0x276271[_0x7b4c('0x2a')]()[_0x7b4c('0x29')](function(){_0x45438c[_0x7b4c('0x1c')](0xcc)[_0x7b4c('0x1d')]();});}};}function handleEntityNotFound(_0x459eb4,_0x1f311e){return function(_0x1a69db){if(!_0x1a69db){_0x459eb4[_0x7b4c('0x1b')](0x194);}return _0x1a69db;};}function handleError(_0x257da2,_0x316e5f){_0x316e5f=_0x316e5f||0x1f4;return function(_0x501f75){logger[_0x7b4c('0x2b')](_0x501f75[_0x7b4c('0x2c')]);if(_0x501f75[_0x7b4c('0x2d')]){delete _0x501f75[_0x7b4c('0x2d')];}_0x257da2[_0x7b4c('0x1c')](_0x316e5f)[_0x7b4c('0x2e')](_0x501f75);};}exports[_0x7b4c('0x2f')]=function(_0x2552f9,_0x3e4a46){var _0x9a799b={},_0x3585cd={},_0x130ace={'count':0x0,'rows':[]};var _0x3544bc=_[_0x7b4c('0x30')](db[_0x7b4c('0x31')][_0x7b4c('0x32')],function(_0x1d0724){return{'name':_0x1d0724[_0x7b4c('0x33')],'type':_0x1d0724[_0x7b4c('0x34')]['key']};});_0x3585cd['model']=_['map'](_0x3544bc,_0x7b4c('0x2d'));_0x3585cd[_0x7b4c('0x35')]=_[_0x7b4c('0x36')](_0x2552f9[_0x7b4c('0x35')]);_0x3585cd['filters']=_[_0x7b4c('0x37')](_0x3585cd[_0x7b4c('0x38')],_0x3585cd['query']);_0x9a799b[_0x7b4c('0x39')]=_['intersection'](_0x3585cd[_0x7b4c('0x38')],qs[_0x7b4c('0x3a')](_0x2552f9[_0x7b4c('0x35')]['fields']));_0x9a799b[_0x7b4c('0x39')]=_0x9a799b[_0x7b4c('0x39')]['length']?_0x9a799b[_0x7b4c('0x39')]:_0x3585cd[_0x7b4c('0x38')];if(!_0x2552f9[_0x7b4c('0x35')][_0x7b4c('0x3b')]('nolimit')){_0x9a799b['limit']=qs[_0x7b4c('0x22')](_0x2552f9[_0x7b4c('0x35')]['limit']);_0x9a799b[_0x7b4c('0x1f')]=qs['offset'](_0x2552f9['query'][_0x7b4c('0x1f')]);}_0x9a799b[_0x7b4c('0x3c')]=qs[_0x7b4c('0x3d')](_0x2552f9[_0x7b4c('0x35')]['sort']);_0x9a799b[_0x7b4c('0x3e')]=qs[_0x7b4c('0x3f')](_[_0x7b4c('0x40')](_0x2552f9[_0x7b4c('0x35')],_0x3585cd[_0x7b4c('0x3f')]),_0x3544bc);if(_0x2552f9[_0x7b4c('0x35')][_0x7b4c('0x41')]){_0x9a799b['where']=_['merge'](_0x9a799b[_0x7b4c('0x3e')],{'$or':_[_0x7b4c('0x30')](_0x3544bc,function(_0x31ef1e){if(_0x31ef1e[_0x7b4c('0x34')]!==_0x7b4c('0x42')){var _0x592834={};_0x592834[_0x31ef1e[_0x7b4c('0x2d')]]={'$like':'%'+_0x2552f9[_0x7b4c('0x35')][_0x7b4c('0x41')]+'%'};return _0x592834;}})});}_0x9a799b=_[_0x7b4c('0x43')]({},_0x9a799b,_0x2552f9[_0x7b4c('0x44')]);var _0x25659d={'where':_0x9a799b[_0x7b4c('0x3e')]};return db[_0x7b4c('0x31')][_0x7b4c('0x21')](_0x25659d)['then'](function(_0x2a4085){_0x130ace['count']=_0x2a4085;if(_0x2552f9[_0x7b4c('0x35')]['includeAll']){_0x9a799b[_0x7b4c('0x45')]=[{'all':!![]}];}return db[_0x7b4c('0x31')]['findAll'](_0x9a799b);})['then'](function(_0x354578){_0x130ace[_0x7b4c('0x46')]=_0x354578;return _0x130ace;})[_0x7b4c('0x29')](respondWithFilteredResult(_0x3e4a46,_0x9a799b))[_0x7b4c('0x47')](handleError(_0x3e4a46,null));};exports['show']=function(_0x2b1681,_0x2ed731){var _0x100774={'raw':!![],'where':{'id':_0x2b1681[_0x7b4c('0x48')]['id']}},_0x5d4ed8={};_0x5d4ed8['model']=_['keys'](db[_0x7b4c('0x31')]['rawAttributes']);_0x5d4ed8[_0x7b4c('0x35')]=_[_0x7b4c('0x36')](_0x2b1681[_0x7b4c('0x35')]);_0x5d4ed8[_0x7b4c('0x3f')]=_[_0x7b4c('0x37')](_0x5d4ed8[_0x7b4c('0x38')],_0x5d4ed8[_0x7b4c('0x35')]);_0x100774[_0x7b4c('0x39')]=_[_0x7b4c('0x37')](_0x5d4ed8['model'],qs[_0x7b4c('0x3a')](_0x2b1681['query']['fields']));_0x100774[_0x7b4c('0x39')]=_0x100774[_0x7b4c('0x39')]['length']?_0x100774['attributes']:_0x5d4ed8[_0x7b4c('0x38')];if(_0x2b1681[_0x7b4c('0x35')][_0x7b4c('0x49')]){_0x100774[_0x7b4c('0x45')]=[{'all':!![]}];}_0x100774=_[_0x7b4c('0x43')]({},_0x100774,_0x2b1681[_0x7b4c('0x44')]);return db[_0x7b4c('0x31')][_0x7b4c('0x4a')](_0x100774)['then'](handleEntityNotFound(_0x2ed731,null))[_0x7b4c('0x29')](respondWithResult(_0x2ed731,null))[_0x7b4c('0x47')](handleError(_0x2ed731,null));};exports[_0x7b4c('0x4b')]=function(_0x387efd,_0xc76435){return db[_0x7b4c('0x31')][_0x7b4c('0x4b')](_0x387efd[_0x7b4c('0x4c')],{})[_0x7b4c('0x29')](respondWithResult(_0xc76435,0xc9))['catch'](handleError(_0xc76435,null));};exports['update']=function(_0x1884a4,_0x3f6aaa){if(_0x1884a4[_0x7b4c('0x4c')]['id']){delete _0x1884a4['body']['id'];}return db[_0x7b4c('0x31')][_0x7b4c('0x4a')]({'where':{'id':_0x1884a4['params']['id']}})[_0x7b4c('0x29')](handleEntityNotFound(_0x3f6aaa,null))['then'](saveUpdates(_0x1884a4[_0x7b4c('0x4c')],null))['then'](respondWithResult(_0x3f6aaa,null))[_0x7b4c('0x47')](handleError(_0x3f6aaa,null));};exports['destroy']=function(_0x15d7f1,_0x11faed){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x15d7f1[_0x7b4c('0x48')]['id']}})[_0x7b4c('0x29')](handleEntityNotFound(_0x11faed,null))[_0x7b4c('0x29')](removeEntity(_0x11faed,null))['catch'](handleError(_0x11faed,null));};exports['describe']=function(_0x2fc5b5,_0x1c118a){return db['JscriptyAnswerReport']['describe']()[_0x7b4c('0x29')](respondWithResult(_0x1c118a,null))[_0x7b4c('0x47')](handleError(_0x1c118a,null));}; \ No newline at end of file +var _0xfd7b=['stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','key','keys','query','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','json','apply','reject','update','then','destroy','end','error'];(function(_0xda6a82,_0x5f00f0){var _0xbacb19=function(_0x31fe92){while(--_0x31fe92){_0xda6a82['push'](_0xda6a82['shift']());}};_0xbacb19(++_0x5f00f0);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfd7b[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbfd7('0x0'));var zipdir=require(_0xbfd7('0x1'));var jsonpatch=require(_0xbfd7('0x2'));var rp=require(_0xbfd7('0x3'));var moment=require(_0xbfd7('0x4'));var BPromise=require(_0xbfd7('0x5'));var Mustache=require(_0xbfd7('0x6'));var util=require(_0xbfd7('0x7'));var path=require(_0xbfd7('0x8'));var sox=require(_0xbfd7('0x9'));var csv=require(_0xbfd7('0xa'));var ejs=require(_0xbfd7('0xb'));var fs=require('fs');var fs_extra=require(_0xbfd7('0xc'));var _=require('lodash');var squel=require(_0xbfd7('0xd'));var crypto=require('crypto');var jsforce=require(_0xbfd7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbfd7('0xa'));var querystring=require(_0xbfd7('0xf'));var Papa=require(_0xbfd7('0x10'));var Redis=require(_0xbfd7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbfd7('0x12'));var as=require(_0xbfd7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbfd7('0x14'));var utils=require(_0xbfd7('0x15'));var config=require(_0xbfd7('0x16'));var licenseUtil=require(_0xbfd7('0x17'));var db=require(_0xbfd7('0x18'))['db'];function respondWithStatusCode(_0x559eca,_0x46feae){_0x46feae=_0x46feae||0xcc;return function(_0x534d66){if(_0x534d66){return _0x559eca[_0xbfd7('0x19')](_0x46feae);}return _0x559eca['status'](_0x46feae)['end']();};}function respondWithResult(_0x44847e,_0x4fec16){_0x4fec16=_0x4fec16||0xc8;return function(_0x3789b7){if(_0x3789b7){return _0x44847e[_0xbfd7('0x1a')](_0x4fec16)['json'](_0x3789b7);}};}function respondWithFilteredResult(_0x5efd54,_0x48f4a4){return function(_0x37e777){if(_0x37e777){var _0x115a34=typeof _0x48f4a4[_0xbfd7('0x1b')]===_0xbfd7('0x1c')&&typeof _0x48f4a4[_0xbfd7('0x1d')]===_0xbfd7('0x1c');var _0x137d50=_0x37e777[_0xbfd7('0x1e')];var _0x3053f3=_0x115a34?0x0:_0x48f4a4['offset'];var _0x5b718b=_0x115a34?_0x37e777[_0xbfd7('0x1e')]:_0x48f4a4[_0xbfd7('0x1b')]+_0x48f4a4['limit'];var _0x5ea27a;if(_0x5b718b>=_0x137d50){_0x5b718b=_0x137d50;_0x5ea27a=0xc8;}else{_0x5ea27a=0xce;}_0x5efd54[_0xbfd7('0x1a')](_0x5ea27a);return _0x5efd54['set']('Content-Range',_0x3053f3+'-'+_0x5b718b+'/'+_0x137d50)[_0xbfd7('0x1f')](_0x37e777);}return null;};}function patchUpdates(_0x5eab37){return function(_0x594792){try{jsonpatch[_0xbfd7('0x20')](_0x594792,_0x5eab37,!![]);}catch(_0x1db6de){return BPromise[_0xbfd7('0x21')](_0x1db6de);}return _0x594792['save']();};}function saveUpdates(_0xb38f6b,_0x32a489){return function(_0x152893){if(_0x152893){return _0x152893[_0xbfd7('0x22')](_0xb38f6b)[_0xbfd7('0x23')](function(_0x2639b6){return _0x2639b6;});}return null;};}function removeEntity(_0x51b13d,_0x2402fb){return function(_0x1c765b){if(_0x1c765b){return _0x1c765b[_0xbfd7('0x24')]()['then'](function(){_0x51b13d[_0xbfd7('0x1a')](0xcc)[_0xbfd7('0x25')]();});}};}function handleEntityNotFound(_0x18dd74,_0x2d0549){return function(_0x358549){if(!_0x358549){_0x18dd74['sendStatus'](0x194);}return _0x358549;};}function handleError(_0x2a7749,_0x6ef5aa){_0x6ef5aa=_0x6ef5aa||0x1f4;return function(_0x120e39){logger[_0xbfd7('0x26')](_0x120e39[_0xbfd7('0x27')]);if(_0x120e39[_0xbfd7('0x28')]){delete _0x120e39[_0xbfd7('0x28')];}_0x2a7749['status'](_0x6ef5aa)[_0xbfd7('0x29')](_0x120e39);};}exports[_0xbfd7('0x2a')]=function(_0x4d7ef4,_0x2971ea){var _0x33583b={},_0x2ec4a5={},_0x14c55d={'count':0x0,'rows':[]};var _0x510506=_[_0xbfd7('0x2b')](db[_0xbfd7('0x2c')][_0xbfd7('0x2d')],function(_0x489365){return{'name':_0x489365[_0xbfd7('0x2e')],'type':_0x489365['type'][_0xbfd7('0x2f')]};});_0x2ec4a5['model']=_[_0xbfd7('0x2b')](_0x510506,_0xbfd7('0x28'));_0x2ec4a5['query']=_[_0xbfd7('0x30')](_0x4d7ef4[_0xbfd7('0x31')]);_0x2ec4a5['filters']=_[_0xbfd7('0x32')](_0x2ec4a5[_0xbfd7('0x33')],_0x2ec4a5[_0xbfd7('0x31')]);_0x33583b['attributes']=_[_0xbfd7('0x32')](_0x2ec4a5[_0xbfd7('0x33')],qs[_0xbfd7('0x34')](_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x34')]));_0x33583b[_0xbfd7('0x35')]=_0x33583b[_0xbfd7('0x35')][_0xbfd7('0x36')]?_0x33583b[_0xbfd7('0x35')]:_0x2ec4a5[_0xbfd7('0x33')];if(!_0x4d7ef4[_0xbfd7('0x31')]['hasOwnProperty'](_0xbfd7('0x37'))){_0x33583b['limit']=qs['limit'](_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x1d')]);_0x33583b[_0xbfd7('0x1b')]=qs[_0xbfd7('0x1b')](_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x1b')]);}_0x33583b[_0xbfd7('0x38')]=qs[_0xbfd7('0x39')](_0x4d7ef4['query']['sort']);_0x33583b[_0xbfd7('0x3a')]=qs[_0xbfd7('0x3b')](_['pick'](_0x4d7ef4[_0xbfd7('0x31')],_0x2ec4a5[_0xbfd7('0x3b')]),_0x510506);if(_0x4d7ef4['query']['filter']){_0x33583b[_0xbfd7('0x3a')]=_[_0xbfd7('0x3c')](_0x33583b['where'],{'$or':_[_0xbfd7('0x2b')](_0x510506,function(_0xfee712){if(_0xfee712[_0xbfd7('0x3d')]!==_0xbfd7('0x3e')){var _0x68f13={};_0x68f13[_0xfee712['name']]={'$like':'%'+_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x3f')]+'%'};return _0x68f13;}})});}_0x33583b=_[_0xbfd7('0x3c')]({},_0x33583b,_0x4d7ef4[_0xbfd7('0x40')]);var _0x25ac4a={'where':_0x33583b[_0xbfd7('0x3a')]};return db[_0xbfd7('0x2c')][_0xbfd7('0x1e')](_0x25ac4a)['then'](function(_0x32df79){_0x14c55d['count']=_0x32df79;if(_0x4d7ef4['query'][_0xbfd7('0x41')]){_0x33583b[_0xbfd7('0x42')]=[{'all':!![]}];}return db[_0xbfd7('0x2c')][_0xbfd7('0x43')](_0x33583b);})[_0xbfd7('0x23')](function(_0x1236dd){_0x14c55d['rows']=_0x1236dd;return _0x14c55d;})[_0xbfd7('0x23')](respondWithFilteredResult(_0x2971ea,_0x33583b))['catch'](handleError(_0x2971ea,null));};exports[_0xbfd7('0x44')]=function(_0x3b7d7f,_0x12f99b){var _0x159c20={'raw':!![],'where':{'id':_0x3b7d7f[_0xbfd7('0x45')]['id']}},_0x1df6a3={};_0x1df6a3[_0xbfd7('0x33')]=_['keys'](db[_0xbfd7('0x2c')][_0xbfd7('0x2d')]);_0x1df6a3[_0xbfd7('0x31')]=_[_0xbfd7('0x30')](_0x3b7d7f[_0xbfd7('0x31')]);_0x1df6a3[_0xbfd7('0x3b')]=_[_0xbfd7('0x32')](_0x1df6a3['model'],_0x1df6a3[_0xbfd7('0x31')]);_0x159c20[_0xbfd7('0x35')]=_[_0xbfd7('0x32')](_0x1df6a3['model'],qs['fields'](_0x3b7d7f['query'][_0xbfd7('0x34')]));_0x159c20[_0xbfd7('0x35')]=_0x159c20[_0xbfd7('0x35')][_0xbfd7('0x36')]?_0x159c20['attributes']:_0x1df6a3[_0xbfd7('0x33')];if(_0x3b7d7f['query'][_0xbfd7('0x41')]){_0x159c20[_0xbfd7('0x42')]=[{'all':!![]}];}_0x159c20=_['merge']({},_0x159c20,_0x3b7d7f[_0xbfd7('0x40')]);return db['JscriptyAnswerReport'][_0xbfd7('0x46')](_0x159c20)[_0xbfd7('0x23')](handleEntityNotFound(_0x12f99b,null))[_0xbfd7('0x23')](respondWithResult(_0x12f99b,null))['catch'](handleError(_0x12f99b,null));};exports['create']=function(_0x356f58,_0xb8b319){return db['JscriptyAnswerReport']['create'](_0x356f58[_0xbfd7('0x47')],{})[_0xbfd7('0x23')](respondWithResult(_0xb8b319,0xc9))[_0xbfd7('0x48')](handleError(_0xb8b319,null));};exports[_0xbfd7('0x22')]=function(_0x1cea7d,_0x14bc15){if(_0x1cea7d[_0xbfd7('0x47')]['id']){delete _0x1cea7d['body']['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x1cea7d[_0xbfd7('0x45')]['id']}})[_0xbfd7('0x23')](handleEntityNotFound(_0x14bc15,null))[_0xbfd7('0x23')](saveUpdates(_0x1cea7d['body'],null))[_0xbfd7('0x23')](respondWithResult(_0x14bc15,null))[_0xbfd7('0x48')](handleError(_0x14bc15,null));};exports['destroy']=function(_0x4a7a72,_0xc89535){return db[_0xbfd7('0x2c')][_0xbfd7('0x46')]({'where':{'id':_0x4a7a72['params']['id']}})[_0xbfd7('0x23')](handleEntityNotFound(_0xc89535,null))[_0xbfd7('0x23')](removeEntity(_0xc89535,null))[_0xbfd7('0x48')](handleError(_0xc89535,null));};exports['describe']=function(_0x371d01,_0x15c0fe){return db[_0xbfd7('0x2c')][_0xbfd7('0x49')]()['then'](respondWithResult(_0x15c0fe,null))[_0xbfd7('0x48')](handleError(_0x15c0fe,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 22c3243..e4fd3ae 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 _0xeae1=['exports','report_jscripty_answers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x392aaf,_0x4dadd2){var _0x13feed=function(_0x21fcb6){while(--_0x21fcb6){_0x392aaf['push'](_0x392aaf['shift']());}};_0x13feed(++_0x4dadd2);}(_0xeae1,0x1a4));var _0x1eae=function(_0x4131da,_0x124783){_0x4131da=_0x4131da-0x0;var _0x583242=_0xeae1[_0x4131da];return _0x583242;};'use strict';var _=require(_0x1eae('0x0'));var util=require(_0x1eae('0x1'));var logger=require(_0x1eae('0x2'))(_0x1eae('0x3'));var moment=require('moment');var BPromise=require(_0x1eae('0x4'));var rp=require(_0x1eae('0x5'));var fs=require('fs');var path=require(_0x1eae('0x6'));var rimraf=require(_0x1eae('0x7'));var config=require(_0x1eae('0x8'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x1eae('0x9')]=function(_0x2cdcf9,_0x303c32){return _0x2cdcf9['define']('JscriptyAnswerReport',attributes,{'tableName':_0x1eae('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf597=['bluebird','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','moment'];(function(_0x50c4be,_0x449629){var _0x5c2abb=function(_0x41ec01){while(--_0x41ec01){_0x50c4be['push'](_0x50c4be['shift']());}};_0x5c2abb(++_0x449629);}(_0xf597,0x11a));var _0x7f59=function(_0x34e8f7,_0x3c9362){_0x34e8f7=_0x34e8f7-0x0;var _0x499358=_0xf597[_0x34e8f7];return _0x499358;};'use strict';var _=require(_0x7f59('0x0'));var util=require(_0x7f59('0x1'));var logger=require('../../config/logger')(_0x7f59('0x2'));var moment=require(_0x7f59('0x3'));var BPromise=require(_0x7f59('0x4'));var rp=require(_0x7f59('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f59('0x6'));var config=require(_0x7f59('0x7'));var attributes=require(_0x7f59('0x8'));module[_0x7f59('0x9')]=function(_0x50a1b6,_0x46927c){return _0x50a1b6[_0x7f59('0xa')](_0x7f59('0xb'),attributes,{'tableName':_0x7f59('0xc'),'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 0fd91dd..d4e85f8 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 _0xd69d=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd69d,0x108));var _0xdd69=function(_0x33d4fa,_0x1fad1f){_0x33d4fa=_0x33d4fa-0x0;var _0x4dbc15=_0xd69d[_0x33d4fa];return _0x4dbc15;};'use strict';var _=require('lodash');var util=require(_0xdd69('0x0'));var moment=require(_0xdd69('0x1'));var BPromise=require(_0xdd69('0x2'));var rs=require(_0xdd69('0x3'));var fs=require('fs');var Redis=require(_0xdd69('0x4'));var db=require(_0xdd69('0x5'))['db'];var utils=require(_0xdd69('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xdd69('0x7'));var jayson=require(_0xdd69('0x8'));var client=jayson['client'][_0xdd69('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ad160,_0x40b09b,_0x123405){return new BPromise(function(_0x55d9cc,_0x253fdf){return client[_0xdd69('0xa')](_0x5ad160,_0x123405)[_0xdd69('0xb')](function(_0x661c65){logger[_0xdd69('0xc')](_0xdd69('0xd'),_0x40b09b,_0xdd69('0xe'));logger['debug'](_0xdd69('0xf'),_0x40b09b,_0xdd69('0xe'),JSON[_0xdd69('0x10')](_0x661c65));if(_0x661c65[_0xdd69('0x11')]){if(_0x661c65[_0xdd69('0x11')][_0xdd69('0x12')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x40b09b,_0x661c65['error'][_0xdd69('0x13')]);return _0x253fdf(_0x661c65[_0xdd69('0x11')][_0xdd69('0x13')]);}logger[_0xdd69('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x40b09b,_0x661c65['error'][_0xdd69('0x13')]);return _0x55d9cc(_0x661c65['error'][_0xdd69('0x13')]);}else{logger[_0xdd69('0xc')](_0xdd69('0xd'),_0x40b09b,_0xdd69('0xe'));_0x55d9cc(_0x661c65[_0xdd69('0x14')][_0xdd69('0x13')]);}})[_0xdd69('0x15')](function(_0x1c784a){logger['error'](_0xdd69('0xd'),_0x40b09b,_0x1c784a);_0x253fdf(_0x1c784a);});});} \ No newline at end of file +var _0x3da0=['rpc','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x21236a,_0x19e918){var _0xcab860=function(_0x375d90){while(--_0x375d90){_0x21236a['push'](_0x21236a['shift']());}};_0xcab860(++_0x19e918);}(_0x3da0,0x101));var _0x03da=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0x3da0[_0x2f6541];return _0x4d76d8;};'use strict';var _=require(_0x03da('0x0'));var util=require(_0x03da('0x1'));var moment=require(_0x03da('0x2'));var BPromise=require('bluebird');var rs=require(_0x03da('0x3'));var fs=require('fs');var Redis=require(_0x03da('0x4'));var db=require(_0x03da('0x5'))['db'];var utils=require(_0x03da('0x6'));var logger=require('../../config/logger')(_0x03da('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x03da('0x8')][_0x03da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1be589,_0x5a5518,_0x29b16a){return new BPromise(function(_0x4d4a75,_0xc747ed){return client[_0x03da('0xa')](_0x1be589,_0x29b16a)[_0x03da('0xb')](function(_0x281465){logger[_0x03da('0xc')](_0x03da('0xd'),_0x5a5518,'request\x20sent');logger[_0x03da('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x5a5518,_0x03da('0xf'),JSON[_0x03da('0x10')](_0x281465));if(_0x281465[_0x03da('0x11')]){if(_0x281465['error'][_0x03da('0x12')]===0x1f4){logger[_0x03da('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5a5518,_0x281465[_0x03da('0x11')]['message']);return _0xc747ed(_0x281465[_0x03da('0x11')][_0x03da('0x13')]);}logger[_0x03da('0x11')](_0x03da('0xd'),_0x5a5518,_0x281465[_0x03da('0x11')]['message']);return _0x4d4a75(_0x281465[_0x03da('0x11')]['message']);}else{logger[_0x03da('0xc')](_0x03da('0xd'),_0x5a5518,_0x03da('0xf'));_0x4d4a75(_0x281465[_0x03da('0x14')][_0x03da('0x13')]);}})[_0x03da('0x15')](function(_0x1aa650){logger[_0x03da('0x11')](_0x03da('0xd'),_0x5a5518,_0x1aa650);_0xc747ed(_0x1aa650);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 1504632..289f1c9 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 _0x0d0b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','/:id','isAuthenticated','show','/:id/sessions','getSessions','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','put','update','delete','exports','multer','util','express'];(function(_0x3612c5,_0x23593e){var _0x2e6706=function(_0x33dead){while(--_0x33dead){_0x3612c5['push'](_0x3612c5['shift']());}};_0x2e6706(++_0x23593e);}(_0x0d0b,0xf0));var _0xb0d0=function(_0x39050a,_0x582d00){_0x39050a=_0x39050a-0x0;var _0x312bef=_0x0d0b[_0x39050a];return _0x312bef;};'use strict';var multer=require(_0xb0d0('0x0'));var util=require(_0xb0d0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0d0('0x2'));var router=express[_0xb0d0('0x3')]();var fs_extra=require(_0xb0d0('0x4'));var auth=require(_0xb0d0('0x5'));var interaction=require(_0xb0d0('0x6'));var config=require(_0xb0d0('0x7'));var controller=require(_0xb0d0('0x8'));router[_0xb0d0('0x9')]('/',auth['isAuthenticated'](),controller[_0xb0d0('0xa')]);router['get'](_0xb0d0('0xb'),auth[_0xb0d0('0xc')](),controller[_0xb0d0('0xd')]);router[_0xb0d0('0x9')](_0xb0d0('0xe'),auth['isAuthenticated'](),controller[_0xb0d0('0xf')]);router[_0xb0d0('0x9')]('/:id/answers',auth['isAuthenticated'](),controller[_0xb0d0('0x10')]);router[_0xb0d0('0x9')](_0xb0d0('0x11'),auth[_0xb0d0('0xc')](),timeout(_0xb0d0('0x12')),controller[_0xb0d0('0x13')]);router[_0xb0d0('0x14')]('/',auth['isAuthenticated'](),controller[_0xb0d0('0x15')]);router[_0xb0d0('0x14')](_0xb0d0('0x16'),auth[_0xb0d0('0xc')](),controller['clone']);router[_0xb0d0('0x17')](_0xb0d0('0xb'),auth[_0xb0d0('0xc')](),controller[_0xb0d0('0x18')]);router[_0xb0d0('0x19')]('/:id',auth[_0xb0d0('0xc')](),controller['destroy']);module[_0xb0d0('0x1a')]=router; \ No newline at end of file +var _0x846f=['/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','post','/:id/clone','clone','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','show'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x846f,0x174));var _0xf846=function(_0x2c089e,_0x157d0e){_0x2c089e=_0x2c089e-0x0;var _0x4b872c=_0x846f[_0x2c089e];return _0x4b872c;};'use strict';var multer=require(_0xf846('0x0'));var util=require(_0xf846('0x1'));var path=require(_0xf846('0x2'));var timeout=require(_0xf846('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf846('0x4'));var auth=require(_0xf846('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf846('0x6'));var controller=require(_0xf846('0x7'));router[_0xf846('0x8')]('/',auth[_0xf846('0x9')](),controller['index']);router[_0xf846('0x8')](_0xf846('0xa'),auth['isAuthenticated'](),controller[_0xf846('0xb')]);router[_0xf846('0x8')](_0xf846('0xc'),auth[_0xf846('0x9')](),controller[_0xf846('0xd')]);router[_0xf846('0x8')](_0xf846('0xe'),auth[_0xf846('0x9')](),controller[_0xf846('0xf')]);router['get'](_0xf846('0x10'),auth[_0xf846('0x9')](),timeout('30s'),controller[_0xf846('0x11')]);router[_0xf846('0x12')]('/',auth[_0xf846('0x9')](),controller['create']);router[_0xf846('0x12')](_0xf846('0x13'),auth[_0xf846('0x9')](),controller[_0xf846('0x14')]);router['put'](_0xf846('0xa'),auth[_0xf846('0x9')](),controller['update']);router[_0xf846('0x15')](_0xf846('0xa'),auth[_0xf846('0x9')](),controller[_0xf846('0x16')]);module[_0xf846('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 8653427..1210eed 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 _0x6039=['long','setDataValue','formData','stringify','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','sequelize','lodash','util','exports','STRING','TEXT'];(function(_0x45113a,_0x4988f5){var _0x4d071e=function(_0x4c9518){while(--_0x4c9518){_0x45113a['push'](_0x45113a['shift']());}};_0x4d071e(++_0x4988f5);}(_0x6039,0x117));var _0x9603=function(_0x1846ef,_0x1163bf){_0x1846ef=_0x1846ef-0x0;var _0x288cee=_0x6039[_0x1846ef];return _0x288cee;};'use strict';var Sequelize=require(_0x9603('0x0'));var _=require(_0x9603('0x1'));var util=require(_0x9603('0x2'));module[_0x9603('0x3')]={'name':{'type':Sequelize[_0x9603('0x4')],'unique':'name'},'description':{'type':Sequelize[_0x9603('0x4')]},'formData':{'type':Sequelize[_0x9603('0x5')](_0x9603('0x6')),'set':function(_0x4da085){if(_['isObjectLike'](_0x4da085)){this[_0x9603('0x7')](_0x9603('0x8'),JSON[_0x9603('0x9')](_0x4da085));}else if(_['isString'](_0x4da085)){this[_0x9603('0x7')](_0x9603('0x8'),_0x4da085);}else{this[_0x9603('0x7')]('formData',util['format'](_0x9603('0xa'),this[_0x9603('0xb')](_0x9603('0xc'))||'',this[_0x9603('0xb')](_0x9603('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x9603('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x2103=['isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','util','exports','name','TEXT','long','isObjectLike','setDataValue','formData'];(function(_0x131dc5,_0x22be98){var _0xdbd0a2=function(_0x243fd2){while(--_0x243fd2){_0x131dc5['push'](_0x131dc5['shift']());}};_0xdbd0a2(++_0x22be98);}(_0x2103,0x122));var _0x3210=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x2103[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x3210('0x0'));var _=require(_0x3210('0x1'));var util=require(_0x3210('0x2'));module[_0x3210('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0x3210('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x3210('0x5')](_0x3210('0x6')),'set':function(_0x456a51){if(_[_0x3210('0x7')](_0x456a51)){this[_0x3210('0x8')](_0x3210('0x9'),JSON['stringify'](_0x456a51));}else if(_[_0x3210('0xa')](_0x456a51)){this['setDataValue'](_0x3210('0x9'),_0x456a51);}else{this[_0x3210('0x8')](_0x3210('0x9'),util[_0x3210('0xb')](_0x3210('0xc'),this[_0x3210('0xd')](_0x3210('0x4'))||'',this[_0x3210('0xd')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x3210('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index bc4e733..acf8b63 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 _0x7732=['Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','sendStatus','name','send','map','JscriptyProject','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','findOne','JscriptySessionReport','pick','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader'];(function(_0x49f0e3,_0x356a11){var _0x1dced5=function(_0xcf0d98){while(--_0xcf0d98){_0x49f0e3['push'](_0x49f0e3['shift']());}};_0x1dced5(++_0x356a11);}(_0x7732,0x7d));var _0x2773=function(_0x4fb1b8,_0x32d98d){_0x4fb1b8=_0x4fb1b8-0x0;var _0x146c71=_0x7732[_0x4fb1b8];return _0x146c71;};'use strict';var emlformat=require(_0x2773('0x0'));var rimraf=require(_0x2773('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2773('0x2'));var rp=require(_0x2773('0x3'));var moment=require(_0x2773('0x4'));var BPromise=require(_0x2773('0x5'));var Mustache=require(_0x2773('0x6'));var util=require(_0x2773('0x7'));var path=require(_0x2773('0x8'));var sox=require(_0x2773('0x9'));var csv=require('to-csv');var ejs=require(_0x2773('0xa'));var fs=require('fs');var fs_extra=require(_0x2773('0xb'));var _=require('lodash');var squel=require(_0x2773('0xc'));var crypto=require(_0x2773('0xd'));var jsforce=require(_0x2773('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2773('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2773('0x10'));var qs=require(_0x2773('0x11'));var as=require(_0x2773('0x12'));var hardwareService=require(_0x2773('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2773('0x14'));var config=require(_0x2773('0x15'));var licenseUtil=require(_0x2773('0x16'));var db=require(_0x2773('0x17'))['db'];function respondWithStatusCode(_0x48a5fe,_0x2624ed){_0x2624ed=_0x2624ed||0xcc;return function(_0x4d8c06){if(_0x4d8c06){return _0x48a5fe['sendStatus'](_0x2624ed);}return _0x48a5fe[_0x2773('0x18')](_0x2624ed)[_0x2773('0x19')]();};}function respondWithResult(_0x13f322,_0x40a91b){_0x40a91b=_0x40a91b||0xc8;return function(_0x242bda){if(_0x242bda){return _0x13f322[_0x2773('0x18')](_0x40a91b)[_0x2773('0x1a')](_0x242bda);}};}function respondWithFilteredResult(_0x84a0d9,_0x2889b6){return function(_0x421c9b){if(_0x421c9b){var _0x26ce19=typeof _0x2889b6[_0x2773('0x1b')]===_0x2773('0x1c')&&typeof _0x2889b6['limit']==='undefined';var _0xa44f8d=_0x421c9b[_0x2773('0x1d')];var _0x541424=_0x26ce19?0x0:_0x2889b6[_0x2773('0x1b')];var _0x39f152=_0x26ce19?_0x421c9b[_0x2773('0x1d')]:_0x2889b6[_0x2773('0x1b')]+_0x2889b6[_0x2773('0x1e')];var _0x346204;if(_0x39f152>=_0xa44f8d){_0x39f152=_0xa44f8d;_0x346204=0xc8;}else{_0x346204=0xce;}_0x84a0d9[_0x2773('0x18')](_0x346204);return _0x84a0d9['set'](_0x2773('0x1f'),_0x541424+'-'+_0x39f152+'/'+_0xa44f8d)[_0x2773('0x1a')](_0x421c9b);}return null;};}function patchUpdates(_0x3a4130){return function(_0x458c91){try{jsonpatch[_0x2773('0x20')](_0x458c91,_0x3a4130,!![]);}catch(_0x4f7aea){return BPromise[_0x2773('0x21')](_0x4f7aea);}return _0x458c91[_0x2773('0x22')]();};}function saveUpdates(_0x34c956,_0x4a56ff){return function(_0xbf45a8){if(_0xbf45a8){return _0xbf45a8[_0x2773('0x23')](_0x34c956)[_0x2773('0x24')](function(_0x56ecde){return _0x56ecde;});}return null;};}function removeEntity(_0x1e3a80,_0x55dff7){return function(_0xab42c2){if(_0xab42c2){return _0xab42c2[_0x2773('0x25')]()[_0x2773('0x24')](function(){var _0x49b537=_0xab42c2[_0x2773('0x26')]({'plain':!![]});var _0x579b20=_0x2773('0x27');return db[_0x2773('0x28')][_0x2773('0x25')]({'where':{'type':_0x579b20,'resourceId':_0x49b537['id']}})['then'](function(){return _0xab42c2;});})[_0x2773('0x24')](function(){_0x1e3a80['status'](0xcc)[_0x2773('0x19')]();});}};}function handleEntityNotFound(_0x478da4,_0x3aa282){return function(_0x149790){if(!_0x149790){_0x478da4[_0x2773('0x29')](0x194);}return _0x149790;};}function handleError(_0x2cf303,_0x21ad6b){_0x21ad6b=_0x21ad6b||0x1f4;return function(_0xe02608){logger['error'](_0xe02608['stack']);if(_0xe02608['name']){delete _0xe02608[_0x2773('0x2a')];}_0x2cf303[_0x2773('0x18')](_0x21ad6b)[_0x2773('0x2b')](_0xe02608);};}exports['index']=function(_0x428f13,_0x44227c){var _0x286edb={},_0x5d6855={},_0x18c1e6={'count':0x0,'rows':[]};var _0x5a91f1=_[_0x2773('0x2c')](db[_0x2773('0x2d')]['rawAttributes'],function(_0x21ea54){return{'name':_0x21ea54[_0x2773('0x2e')],'type':_0x21ea54[_0x2773('0x2f')][_0x2773('0x30')]};});_0x5d6855[_0x2773('0x31')]=_[_0x2773('0x2c')](_0x5a91f1,_0x2773('0x2a'));_0x5d6855['query']=_['keys'](_0x428f13[_0x2773('0x32')]);_0x5d6855[_0x2773('0x33')]=_[_0x2773('0x34')](_0x5d6855['model'],_0x5d6855[_0x2773('0x32')]);_0x286edb[_0x2773('0x35')]=_[_0x2773('0x34')](_0x5d6855[_0x2773('0x31')],qs[_0x2773('0x36')](_0x428f13[_0x2773('0x32')][_0x2773('0x36')]));_0x286edb['attributes']=_0x286edb[_0x2773('0x35')][_0x2773('0x37')]?_0x286edb['attributes']:_0x5d6855[_0x2773('0x31')];if(!_0x428f13['query'][_0x2773('0x38')](_0x2773('0x39'))){_0x286edb[_0x2773('0x1e')]=qs[_0x2773('0x1e')](_0x428f13['query'][_0x2773('0x1e')]);_0x286edb[_0x2773('0x1b')]=qs[_0x2773('0x1b')](_0x428f13[_0x2773('0x32')][_0x2773('0x1b')]);}_0x286edb[_0x2773('0x3a')]=qs[_0x2773('0x3b')](_0x428f13[_0x2773('0x32')][_0x2773('0x3b')]);_0x286edb[_0x2773('0x3c')]=qs[_0x2773('0x33')](_['pick'](_0x428f13['query'],_0x5d6855['filters']),_0x5a91f1);if(_0x428f13[_0x2773('0x32')][_0x2773('0x3d')]){_0x286edb[_0x2773('0x3c')]=_['merge'](_0x286edb[_0x2773('0x3c')],{'$or':_[_0x2773('0x2c')](_0x5a91f1,function(_0x46aa0b){if(_0x46aa0b[_0x2773('0x2f')]!==_0x2773('0x3e')){var _0x215d39={};_0x215d39[_0x46aa0b[_0x2773('0x2a')]]={'$like':'%'+_0x428f13[_0x2773('0x32')][_0x2773('0x3d')]+'%'};return _0x215d39;}})});}_0x286edb=_[_0x2773('0x3f')]({},_0x286edb,_0x428f13[_0x2773('0x40')]);var _0x5bcfcf={'where':_0x286edb[_0x2773('0x3c')]};return db[_0x2773('0x2d')][_0x2773('0x1d')](_0x5bcfcf)['then'](function(_0x1bd090){_0x18c1e6['count']=_0x1bd090;if(_0x428f13[_0x2773('0x32')][_0x2773('0x41')]){_0x286edb[_0x2773('0x42')]=[{'all':!![]}];}return db[_0x2773('0x2d')][_0x2773('0x43')](_0x286edb);})[_0x2773('0x24')](function(_0x232853){_0x18c1e6[_0x2773('0x44')]=_0x232853;return _0x18c1e6;})[_0x2773('0x24')](respondWithFilteredResult(_0x44227c,_0x286edb))[_0x2773('0x45')](handleError(_0x44227c,null));};exports[_0x2773('0x46')]=function(_0x571f5a,_0x469d9a){var _0x14ca4a={'raw':![],'where':{'id':_0x571f5a[_0x2773('0x47')]['id']}},_0x1848e1={};_0x1848e1[_0x2773('0x31')]=_[_0x2773('0x48')](db['JscriptyProject'][_0x2773('0x49')]);_0x1848e1[_0x2773('0x32')]=_[_0x2773('0x48')](_0x571f5a[_0x2773('0x32')]);_0x1848e1[_0x2773('0x33')]=_['intersection'](_0x1848e1[_0x2773('0x31')],_0x1848e1[_0x2773('0x32')]);_0x14ca4a[_0x2773('0x35')]=_[_0x2773('0x34')](_0x1848e1[_0x2773('0x31')],qs[_0x2773('0x36')](_0x571f5a[_0x2773('0x32')][_0x2773('0x36')]));_0x14ca4a['attributes']=_0x14ca4a[_0x2773('0x35')]['length']?_0x14ca4a[_0x2773('0x35')]:_0x1848e1[_0x2773('0x31')];if(_0x571f5a[_0x2773('0x32')][_0x2773('0x41')]){_0x14ca4a['include']=[{'all':!![]}];}_0x14ca4a=_[_0x2773('0x3f')]({},_0x14ca4a,_0x571f5a['options']);return db[_0x2773('0x2d')][_0x2773('0x4a')](_0x14ca4a)['then'](handleEntityNotFound(_0x469d9a,null))[_0x2773('0x24')](respondWithResult(_0x469d9a,null))[_0x2773('0x45')](handleError(_0x469d9a,null));};exports['create']=function(_0x40f0a3,_0x40a72b){return db[_0x2773('0x2d')][_0x2773('0x4b')](_0x40f0a3[_0x2773('0x4c')],{})['then'](function(_0xed2922){var _0x3716e9=_0x40f0a3[_0x2773('0x4d')][_0x2773('0x26')]({'plain':!![]});if(!_0x3716e9)throw new Error(_0x2773('0x4e'));if(_0x3716e9[_0x2773('0x4f')]===_0x2773('0x4d')){var _0x181d03=_0xed2922[_0x2773('0x26')]({'plain':!![]});var _0x171952=_0x2773('0x27');return db[_0x2773('0x50')]['find']({'where':{'name':_0x171952,'userProfileId':_0x3716e9[_0x2773('0x51')]},'raw':!![]})[_0x2773('0x24')](function(_0x18db9c){if(_0x18db9c&&_0x18db9c[_0x2773('0x52')]===0x0){return db[_0x2773('0x28')][_0x2773('0x4b')]({'name':_0x181d03[_0x2773('0x2a')],'resourceId':_0x181d03['id'],'type':_0x18db9c[_0x2773('0x2a')],'sectionId':_0x18db9c['id']},{})[_0x2773('0x24')](function(){return _0xed2922;});}else{return _0xed2922;}})[_0x2773('0x45')](function(_0x4b3099){logger[_0x2773('0x53')](_0x2773('0x54'),_0x4b3099);throw _0x4b3099;});}return _0xed2922;})[_0x2773('0x24')](respondWithResult(_0x40a72b,0xc9))['catch'](handleError(_0x40a72b,null));};exports[_0x2773('0x55')]=function(_0x505355,_0x474e3a){var _0x51dde5={'where':{'id':_0x505355['params']['id']}},_0x1e1e59={};_0x1e1e59[_0x2773('0x31')]=_[_0x2773('0x48')](db['JscriptyProject'][_0x2773('0x49')]);_0x51dde5[_0x2773('0x35')]=_['intersection'](_0x1e1e59[_0x2773('0x31')],qs['fields'](_0x505355[_0x2773('0x32')]['fields']));_0x51dde5[_0x2773('0x35')]=_0x51dde5[_0x2773('0x35')][_0x2773('0x37')]?_0x51dde5[_0x2773('0x35')]:_0x1e1e59['model'];if(_0x505355[_0x2773('0x32')][_0x2773('0x41')]){_0x51dde5[_0x2773('0x42')]=[{'all':!![]}];}_0x51dde5=_[_0x2773('0x3f')]({},_0x51dde5,_0x505355[_0x2773('0x40')]);return db[_0x2773('0x2d')]['find'](_0x51dde5)[_0x2773('0x24')](handleEntityNotFound(_0x474e3a,null))[_0x2773('0x24')](function(_0x2cfa80){if(_0x2cfa80){var _0x485fd6=_0x2cfa80[_0x2773('0x26')]({'plain':!![]});_0x485fd6=qs[_0x2773('0x56')](_0x485fd6,['id','createdAt',_0x2773('0x57')]);_0x505355['body']=_[_0x2773('0x56')](_0x505355[_0x2773('0x4c')],['id','createdAt',_0x2773('0x57')]);return db[_0x2773('0x2d')][_0x2773('0x4b')](_[_0x2773('0x3f')](_0x485fd6,_0x505355[_0x2773('0x4c')]),{'include':_0x505355['query'][_0x2773('0x41')]?[{'all':!![]}]:undefined})[_0x2773('0x24')](function(_0x4b32b0){var _0x16309d=_0x505355[_0x2773('0x4d')][_0x2773('0x26')]({'plain':!![]});if(!_0x16309d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16309d[_0x2773('0x4f')]==='user'){var _0x209c70=_0x4b32b0[_0x2773('0x26')]({'plain':!![]});var _0xe3e465='Projects';return db['UserProfileSection'][_0x2773('0x4a')]({'where':{'name':_0xe3e465,'userProfileId':_0x16309d[_0x2773('0x51')]},'raw':!![]})['then'](function(_0xa5688c){if(_0xa5688c&&_0xa5688c[_0x2773('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x209c70['name'],'resourceId':_0x209c70['id'],'type':_0xa5688c[_0x2773('0x2a')],'sectionId':_0xa5688c['id']},{})[_0x2773('0x24')](function(){return _0x4b32b0;});}else{return _0x4b32b0;}})['catch'](function(_0x56bba9){logger[_0x2773('0x53')](_0x2773('0x54'),_0x56bba9);throw _0x56bba9;});}return _0x4b32b0;});}})[_0x2773('0x24')](respondWithResult(_0x474e3a,0xc9))[_0x2773('0x45')](handleError(_0x474e3a,null));};exports[_0x2773('0x23')]=function(_0x143cfc,_0x56e04d){if(_0x143cfc[_0x2773('0x4c')]['id']){delete _0x143cfc[_0x2773('0x4c')]['id'];}return db['JscriptyProject'][_0x2773('0x4a')]({'where':{'id':_0x143cfc['params']['id']}})['then'](handleEntityNotFound(_0x56e04d,null))['then'](saveUpdates(_0x143cfc[_0x2773('0x4c')],null))[_0x2773('0x24')](respondWithResult(_0x56e04d,null))[_0x2773('0x45')](handleError(_0x56e04d,null));};exports[_0x2773('0x25')]=function(_0x176b27,_0x133915){return db[_0x2773('0x2d')][_0x2773('0x4a')]({'where':{'id':_0x176b27[_0x2773('0x47')]['id']}})[_0x2773('0x24')](handleEntityNotFound(_0x133915,null))[_0x2773('0x24')](removeEntity(_0x133915,null))['catch'](handleError(_0x133915,null));};exports['getSessions']=function(_0x42f6a7,_0x5d8e1c,_0x358563){var _0x368ff8={'raw':!![],'where':{}};var _0x37e581={};var _0x34acc0={'count':0x0,'rows':[]};return db[_0x2773('0x2d')][_0x2773('0x58')]({'where':{'id':_0x42f6a7[_0x2773('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d8e1c,null))[_0x2773('0x24')](function(_0x3878dc){if(_0x3878dc){_0x37e581[_0x2773('0x31')]=_[_0x2773('0x48')](db[_0x2773('0x59')][_0x2773('0x49')]);_0x37e581[_0x2773('0x32')]=_['keys'](_0x42f6a7[_0x2773('0x32')]);_0x37e581['filters']=_[_0x2773('0x34')](_0x37e581['model'],_0x37e581['query']);_0x368ff8[_0x2773('0x35')]=_[_0x2773('0x34')](_0x37e581[_0x2773('0x31')],qs['fields'](_0x42f6a7[_0x2773('0x32')]['fields']));_0x368ff8[_0x2773('0x35')]=_0x368ff8['attributes'][_0x2773('0x37')]?_0x368ff8[_0x2773('0x35')]:_0x37e581['model'];if(!_0x42f6a7[_0x2773('0x32')][_0x2773('0x38')](_0x2773('0x39'))){_0x368ff8['limit']=qs[_0x2773('0x1e')](_0x42f6a7['query'][_0x2773('0x1e')]);_0x368ff8['offset']=qs[_0x2773('0x1b')](_0x42f6a7[_0x2773('0x32')]['offset']);}_0x368ff8[_0x2773('0x3a')]=qs['sort'](_0x42f6a7['query'][_0x2773('0x3b')]);_0x368ff8[_0x2773('0x3c')]=qs[_0x2773('0x33')](_[_0x2773('0x5a')](_0x42f6a7[_0x2773('0x32')],_0x37e581[_0x2773('0x33')]));_0x368ff8['where'][_0x2773('0x5b')]=_0x3878dc['id'];if(_0x42f6a7[_0x2773('0x32')][_0x2773('0x3d')]){_0x368ff8[_0x2773('0x3c')]=_[_0x2773('0x3f')](_0x368ff8[_0x2773('0x3c')],{'$or':_[_0x2773('0x2c')](_0x368ff8[_0x2773('0x35')],function(_0x1582af){var _0x268d9a={};_0x268d9a[_0x1582af]={'$like':'%'+_0x42f6a7['query'][_0x2773('0x3d')]+'%'};return _0x268d9a;})});}_0x368ff8=_[_0x2773('0x3f')]({},_0x368ff8,_0x42f6a7[_0x2773('0x40')]);return db['JscriptySessionReport'][_0x2773('0x1d')]({'where':_0x368ff8[_0x2773('0x3c')]})[_0x2773('0x24')](function(_0x3ee52b){_0x34acc0[_0x2773('0x1d')]=_0x3ee52b;if(_0x42f6a7[_0x2773('0x32')][_0x2773('0x41')]){_0x368ff8['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x368ff8);})[_0x2773('0x24')](function(_0x47ee3e){_0x34acc0[_0x2773('0x44')]=_0x47ee3e;return _0x34acc0;});}})[_0x2773('0x24')](respondWithFilteredResult(_0x5d8e1c,_0x368ff8))[_0x2773('0x45')](handleError(_0x5d8e1c,null));};exports[_0x2773('0x5c')]=function(_0x23dd30,_0x14dffd,_0x54ba29){var _0x2abb32={'raw':!![],'where':{}};var _0x3cbe44={};var _0x3e71ce={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x2773('0x58')]({'where':{'id':_0x23dd30[_0x2773('0x47')]['id']}})[_0x2773('0x24')](handleEntityNotFound(_0x14dffd,null))[_0x2773('0x24')](function(_0x3b67f8){if(_0x3b67f8){_0x3cbe44[_0x2773('0x31')]=_[_0x2773('0x48')](db[_0x2773('0x5d')][_0x2773('0x49')]);_0x3cbe44[_0x2773('0x32')]=_[_0x2773('0x48')](_0x23dd30['query']);_0x3cbe44['filters']=_[_0x2773('0x34')](_0x3cbe44[_0x2773('0x31')],_0x3cbe44[_0x2773('0x32')]);_0x2abb32[_0x2773('0x35')]=_[_0x2773('0x34')](_0x3cbe44[_0x2773('0x31')],qs[_0x2773('0x36')](_0x23dd30[_0x2773('0x32')][_0x2773('0x36')]));_0x2abb32[_0x2773('0x35')]=_0x2abb32[_0x2773('0x35')][_0x2773('0x37')]?_0x2abb32['attributes']:_0x3cbe44[_0x2773('0x31')];if(!_0x23dd30[_0x2773('0x32')][_0x2773('0x38')](_0x2773('0x39'))){_0x2abb32[_0x2773('0x1e')]=qs[_0x2773('0x1e')](_0x23dd30[_0x2773('0x32')][_0x2773('0x1e')]);_0x2abb32[_0x2773('0x1b')]=qs[_0x2773('0x1b')](_0x23dd30['query'][_0x2773('0x1b')]);}_0x2abb32['order']=qs[_0x2773('0x3b')](_0x23dd30[_0x2773('0x32')][_0x2773('0x3b')]);_0x2abb32[_0x2773('0x3c')]=qs[_0x2773('0x33')](_[_0x2773('0x5a')](_0x23dd30[_0x2773('0x32')],_0x3cbe44[_0x2773('0x33')]));_0x2abb32['where']['ProjectId']=_0x3b67f8['id'];if(_0x23dd30[_0x2773('0x32')][_0x2773('0x3d')]){_0x2abb32['where']=_[_0x2773('0x3f')](_0x2abb32['where'],{'$or':_[_0x2773('0x2c')](_0x2abb32[_0x2773('0x35')],function(_0x962729){var _0x2b89c7={};_0x2b89c7[_0x962729]={'$like':'%'+_0x23dd30[_0x2773('0x32')][_0x2773('0x3d')]+'%'};return _0x2b89c7;})});}_0x2abb32=_[_0x2773('0x3f')]({},_0x2abb32,_0x23dd30['options']);return db[_0x2773('0x5d')][_0x2773('0x1d')]({'where':_0x2abb32[_0x2773('0x3c')]})[_0x2773('0x24')](function(_0x133d6e){_0x3e71ce[_0x2773('0x1d')]=_0x133d6e;if(_0x23dd30[_0x2773('0x32')][_0x2773('0x41')]){_0x2abb32[_0x2773('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x2abb32);})['then'](function(_0x115762){_0x3e71ce['rows']=_0x115762;return _0x3e71ce;});}})[_0x2773('0x24')](respondWithFilteredResult(_0x14dffd,_0x2abb32))['catch'](handleError(_0x14dffd,null));};function char(_0x5f1085){return _0x2773('0x5e')===typeof _0x5f1085?String[_0x2773('0x5f')][_0x2773('0x20')](null,arguments):_0x5f1085;}function needsEncapsulation(_0x1e5fea){return!!_0x1e5fea&&(_0x1e5fea[_0x2773('0x60')]()[_0x2773('0x61')](char(0xd))>=0x0||_0x1e5fea[_0x2773('0x60')]()[_0x2773('0x61')](char(0xa))>=0x0||_0x1e5fea[_0x2773('0x60')]()[_0x2773('0x61')](char(0x2c))>=0x0||_0x1e5fea['toString']()[_0x2773('0x61')](char(0x22))>=0x0);}function encapsulate(_0x3cf49f){var _0x53e08c=char(0x22),_0x51fbf9='\x5c'+char(0x22),_0x3323f1=_0x3cf49f[_0x2773('0x60')]()[_0x2773('0x62')](new RegExp(_0x53e08c,'g'),_0x51fbf9);return _0x53e08c+_0x3323f1+_0x53e08c;}exports[_0x2773('0x63')]=function(_0x2f2ddb,_0xada81d,_0x36d317){var _0x4d0cf5,_0x210da0;var _0x30d8ce={'where':{'ProjectId':_0x2f2ddb[_0x2773('0x47')]['id']}};if(_0x2f2ddb[_0x2773('0x32')][_0x2773('0x64')]){_0x30d8ce[_0x2773('0x3c')][_0x2773('0x65')]=JSON[_0x2773('0x66')](_0x2f2ddb['query'][_0x2773('0x64')]);}return db[_0x2773('0x59')][_0x2773('0x43')](_0x30d8ce)[_0x2773('0x24')](handleEntityNotFound(_0xada81d,null))['then'](function(_0x51e073){if(_0x51e073){_0x4d0cf5=_0x51e073;return db[_0x2773('0x67')][_0x2773('0x43')]({'where':{'SessionId':{'$in':_[_0x2773('0x2c')](_0x4d0cf5,'id')},'ProjectId':_0x2f2ddb['params']['id']},'order':_0x2773('0x68')});}})[_0x2773('0x24')](handleEntityNotFound(_0xada81d,null))[_0x2773('0x24')](function(_0x40588e){if(_0x40588e){_0x210da0=_0x40588e;var _0x261ee9={};for(var _0x8af64d=0x0,_0x4a11db=_0x210da0['length'];_0x8af64d<_0x4a11db;_0x8af64d++){if(!_0x261ee9['hasOwnProperty'](_0x210da0[_0x8af64d][_0x2773('0x69')])){_0x261ee9[_0x210da0[_0x8af64d][_0x2773('0x69')]]=needsEncapsulation(_0x210da0[_0x8af64d][_0x2773('0x6a')])?encapsulate(_0x210da0[_0x8af64d]['question']):_0x210da0[_0x8af64d][_0x2773('0x6a')];}}var _0x315b80=[],_0x3bc3e4={};for(var _0x46491f=0x0,_0x1861ab=_0x4d0cf5[_0x2773('0x37')];_0x46491f<_0x1861ab;_0x46491f++){_0x3bc3e4={'ProjectId':_0x2f2ddb['params']['id'],'SessionId':_0x4d0cf5[_0x46491f]['id'],'StartTime':moment(_0x4d0cf5[_0x46491f][_0x2773('0x65')])['format'](_0x2773('0x6b'))};for(var _0x2ee625=0x0,_0x45faa1=_0x210da0['length'];_0x2ee625<_0x45faa1;_0x2ee625++){if(_0x210da0[_0x2ee625][_0x2773('0x6c')]==_0x4d0cf5[_0x46491f]['id']&&_0x261ee9[_0x2773('0x38')](_0x210da0[_0x2ee625][_0x2773('0x69')])){_0x3bc3e4[_0x261ee9[_0x210da0[_0x2ee625]['questionId']]]=_0x210da0[_0x2ee625][_0x2773('0x6d')];}}for(var _0x41698d in _0x261ee9){if(!_0x3bc3e4[_0x2773('0x38')](_0x261ee9[_0x41698d])){_0x3bc3e4[_0x261ee9[_0x41698d]]=null;}}_0x315b80[_0x2773('0x6e')](_0x3bc3e4);}return _0x315b80;}})[_0x2773('0x24')](function(_0x35622f){if(!_[_0x2773('0x6f')](_0x35622f)){var _0xcca37f=toCsv(_0x35622f);var _0x4c6d9f=Date[_0x2773('0x70')]();fs[_0x2773('0x71')](util[_0x2773('0x72')](_0x2773('0x73'),_0x2f2ddb[_0x2773('0x47')]['id'],_0x4c6d9f),_0xcca37f);_0xada81d[_0x2773('0x74')](_0x2773('0x75'),_0x2773('0x76')+util[_0x2773('0x72')](_0x2773('0x77'),_0x2f2ddb[_0x2773('0x47')]['id'],_0x4c6d9f));_0xada81d[_0x2773('0x74')]('Content-type',_0x2773('0x78'));return _0xada81d['download'](util[_0x2773('0x72')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x2f2ddb['params']['id'],_0x4c6d9f));}else{return _0xada81d[_0x2773('0x29')](0xcc);}})[_0x2773('0x45')](handleError(_0xada81d,null));}; \ No newline at end of file +var _0xc30e=['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','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','index','JscriptyProject','rawAttributes','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','findAll','rows','show','params','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','clone','includeAll','find','omit','createdAt','updatedAt','userProfileId','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','toString','indexOf','replace','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','sendStatus','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x54f820,_0x1024b1){var _0x23ce5b=function(_0x310118){while(--_0x310118){_0x54f820['push'](_0x54f820['shift']());}};_0x23ce5b(++_0x1024b1);}(_0xc30e,0x15a));var _0xec30=function(_0x1e8e6f,_0x3c8242){_0x1e8e6f=_0x1e8e6f-0x0;var _0x2fbc91=_0xc30e[_0x1e8e6f];return _0x2fbc91;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec30('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec30('0x1'));var rp=require(_0xec30('0x2'));var moment=require(_0xec30('0x3'));var BPromise=require(_0xec30('0x4'));var Mustache=require(_0xec30('0x5'));var util=require(_0xec30('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xec30('0x7'));var ejs=require(_0xec30('0x8'));var fs=require('fs');var fs_extra=require(_0xec30('0x9'));var _=require(_0xec30('0xa'));var squel=require(_0xec30('0xb'));var crypto=require(_0xec30('0xc'));var jsforce=require(_0xec30('0xd'));var deskjs=require(_0xec30('0xe'));var toCsv=require(_0xec30('0x7'));var querystring=require(_0xec30('0xf'));var Papa=require(_0xec30('0x10'));var Redis=require(_0xec30('0x11'));var authService=require(_0xec30('0x12'));var qs=require(_0xec30('0x13'));var as=require(_0xec30('0x14'));var hardwareService=require(_0xec30('0x15'));var logger=require(_0xec30('0x16'))('api');var utils=require(_0xec30('0x17'));var config=require(_0xec30('0x18'));var licenseUtil=require(_0xec30('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12a2e5,_0x48929a){_0x48929a=_0x48929a||0xcc;return function(_0x160460){if(_0x160460){return _0x12a2e5['sendStatus'](_0x48929a);}return _0x12a2e5['status'](_0x48929a)[_0xec30('0x1a')]();};}function respondWithResult(_0x3bdad7,_0x17643e){_0x17643e=_0x17643e||0xc8;return function(_0x16bea5){if(_0x16bea5){return _0x3bdad7[_0xec30('0x1b')](_0x17643e)[_0xec30('0x1c')](_0x16bea5);}};}function respondWithFilteredResult(_0x152f8a,_0xa25259){return function(_0x2fa25d){if(_0x2fa25d){var _0x404296=typeof _0xa25259[_0xec30('0x1d')]===_0xec30('0x1e')&&typeof _0xa25259[_0xec30('0x1f')]===_0xec30('0x1e');var _0x1a194c=_0x2fa25d[_0xec30('0x20')];var _0x560ef9=_0x404296?0x0:_0xa25259[_0xec30('0x1d')];var _0xf54119=_0x404296?_0x2fa25d['count']:_0xa25259[_0xec30('0x1d')]+_0xa25259[_0xec30('0x1f')];var _0x3bca8c;if(_0xf54119>=_0x1a194c){_0xf54119=_0x1a194c;_0x3bca8c=0xc8;}else{_0x3bca8c=0xce;}_0x152f8a[_0xec30('0x1b')](_0x3bca8c);return _0x152f8a[_0xec30('0x21')](_0xec30('0x22'),_0x560ef9+'-'+_0xf54119+'/'+_0x1a194c)[_0xec30('0x1c')](_0x2fa25d);}return null;};}function patchUpdates(_0x451bd8){return function(_0x28cd1b){try{jsonpatch[_0xec30('0x23')](_0x28cd1b,_0x451bd8,!![]);}catch(_0x57b9cd){return BPromise[_0xec30('0x24')](_0x57b9cd);}return _0x28cd1b[_0xec30('0x25')]();};}function saveUpdates(_0x118b81,_0x529b7c){return function(_0xf48b58){if(_0xf48b58){return _0xf48b58[_0xec30('0x26')](_0x118b81)[_0xec30('0x27')](function(_0x414157){return _0x414157;});}return null;};}function removeEntity(_0x2120d5,_0x35f2cc){return function(_0x11a53c){if(_0x11a53c){return _0x11a53c[_0xec30('0x28')]()[_0xec30('0x27')](function(){var _0x998a55=_0x11a53c[_0xec30('0x29')]({'plain':!![]});var _0x2ff56c=_0xec30('0x2a');return db[_0xec30('0x2b')][_0xec30('0x28')]({'where':{'type':_0x2ff56c,'resourceId':_0x998a55['id']}})[_0xec30('0x27')](function(){return _0x11a53c;});})[_0xec30('0x27')](function(){_0x2120d5[_0xec30('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x155a84,_0x62b2d4){return function(_0x52c569){if(!_0x52c569){_0x155a84['sendStatus'](0x194);}return _0x52c569;};}function handleError(_0x5ef494,_0x21c7ae){_0x21c7ae=_0x21c7ae||0x1f4;return function(_0x75b95b){logger[_0xec30('0x2c')](_0x75b95b[_0xec30('0x2d')]);if(_0x75b95b[_0xec30('0x2e')]){delete _0x75b95b[_0xec30('0x2e')];}_0x5ef494[_0xec30('0x1b')](_0x21c7ae)['send'](_0x75b95b);};}exports[_0xec30('0x2f')]=function(_0x256fd4,_0x1b2f00){var _0xa78d61={},_0x299c23={},_0x4ebf94={'count':0x0,'rows':[]};var _0x140ab8=_['map'](db[_0xec30('0x30')][_0xec30('0x31')],function(_0x406140){return{'name':_0x406140['fieldName'],'type':_0x406140['type'][_0xec30('0x32')]};});_0x299c23[_0xec30('0x33')]=_[_0xec30('0x34')](_0x140ab8,'name');_0x299c23[_0xec30('0x35')]=_[_0xec30('0x36')](_0x256fd4[_0xec30('0x35')]);_0x299c23['filters']=_[_0xec30('0x37')](_0x299c23['model'],_0x299c23[_0xec30('0x35')]);_0xa78d61[_0xec30('0x38')]=_['intersection'](_0x299c23['model'],qs[_0xec30('0x39')](_0x256fd4[_0xec30('0x35')]['fields']));_0xa78d61['attributes']=_0xa78d61[_0xec30('0x38')][_0xec30('0x3a')]?_0xa78d61[_0xec30('0x38')]:_0x299c23[_0xec30('0x33')];if(!_0x256fd4[_0xec30('0x35')][_0xec30('0x3b')](_0xec30('0x3c'))){_0xa78d61[_0xec30('0x1f')]=qs[_0xec30('0x1f')](_0x256fd4[_0xec30('0x35')][_0xec30('0x1f')]);_0xa78d61['offset']=qs[_0xec30('0x1d')](_0x256fd4['query']['offset']);}_0xa78d61[_0xec30('0x3d')]=qs[_0xec30('0x3e')](_0x256fd4[_0xec30('0x35')][_0xec30('0x3e')]);_0xa78d61[_0xec30('0x3f')]=qs['filters'](_[_0xec30('0x40')](_0x256fd4['query'],_0x299c23[_0xec30('0x41')]),_0x140ab8);if(_0x256fd4[_0xec30('0x35')]['filter']){_0xa78d61[_0xec30('0x3f')]=_[_0xec30('0x42')](_0xa78d61[_0xec30('0x3f')],{'$or':_['map'](_0x140ab8,function(_0x5945c1){if(_0x5945c1['type']!==_0xec30('0x43')){var _0x31d906={};_0x31d906[_0x5945c1[_0xec30('0x2e')]]={'$like':'%'+_0x256fd4[_0xec30('0x35')][_0xec30('0x44')]+'%'};return _0x31d906;}})});}_0xa78d61=_[_0xec30('0x42')]({},_0xa78d61,_0x256fd4[_0xec30('0x45')]);var _0x581424={'where':_0xa78d61[_0xec30('0x3f')]};return db[_0xec30('0x30')][_0xec30('0x20')](_0x581424)[_0xec30('0x27')](function(_0x334c01){_0x4ebf94[_0xec30('0x20')]=_0x334c01;if(_0x256fd4[_0xec30('0x35')]['includeAll']){_0xa78d61['include']=[{'all':!![]}];}return db[_0xec30('0x30')][_0xec30('0x46')](_0xa78d61);})[_0xec30('0x27')](function(_0x56baa4){_0x4ebf94[_0xec30('0x47')]=_0x56baa4;return _0x4ebf94;})[_0xec30('0x27')](respondWithFilteredResult(_0x1b2f00,_0xa78d61))['catch'](handleError(_0x1b2f00,null));};exports[_0xec30('0x48')]=function(_0x58b249,_0x3f8997){var _0x1e25b7={'raw':![],'where':{'id':_0x58b249[_0xec30('0x49')]['id']}},_0x4915df={};_0x4915df['model']=_[_0xec30('0x36')](db[_0xec30('0x30')]['rawAttributes']);_0x4915df[_0xec30('0x35')]=_[_0xec30('0x36')](_0x58b249[_0xec30('0x35')]);_0x4915df[_0xec30('0x41')]=_['intersection'](_0x4915df[_0xec30('0x33')],_0x4915df[_0xec30('0x35')]);_0x1e25b7[_0xec30('0x38')]=_['intersection'](_0x4915df['model'],qs['fields'](_0x58b249[_0xec30('0x35')][_0xec30('0x39')]));_0x1e25b7[_0xec30('0x38')]=_0x1e25b7[_0xec30('0x38')]['length']?_0x1e25b7['attributes']:_0x4915df[_0xec30('0x33')];if(_0x58b249[_0xec30('0x35')]['includeAll']){_0x1e25b7[_0xec30('0x4a')]=[{'all':!![]}];}_0x1e25b7=_[_0xec30('0x42')]({},_0x1e25b7,_0x58b249['options']);return db[_0xec30('0x30')]['find'](_0x1e25b7)[_0xec30('0x27')](handleEntityNotFound(_0x3f8997,null))[_0xec30('0x27')](respondWithResult(_0x3f8997,null))[_0xec30('0x4b')](handleError(_0x3f8997,null));};exports[_0xec30('0x4c')]=function(_0x1194cf,_0x4993c0){return db['JscriptyProject']['create'](_0x1194cf[_0xec30('0x4d')],{})[_0xec30('0x27')](function(_0x20b4d1){var _0x3b6fca=_0x1194cf[_0xec30('0x4e')][_0xec30('0x29')]({'plain':!![]});if(!_0x3b6fca)throw new Error(_0xec30('0x4f'));if(_0x3b6fca[_0xec30('0x50')]===_0xec30('0x4e')){var _0x1151e3=_0x20b4d1[_0xec30('0x29')]({'plain':!![]});var _0x431d55=_0xec30('0x2a');return db[_0xec30('0x51')]['find']({'where':{'name':_0x431d55,'userProfileId':_0x3b6fca['userProfileId']},'raw':!![]})[_0xec30('0x27')](function(_0x34278e){if(_0x34278e&&_0x34278e[_0xec30('0x52')]===0x0){return db[_0xec30('0x2b')]['create']({'name':_0x1151e3['name'],'resourceId':_0x1151e3['id'],'type':_0x34278e[_0xec30('0x2e')],'sectionId':_0x34278e['id']},{})[_0xec30('0x27')](function(){return _0x20b4d1;});}else{return _0x20b4d1;}})[_0xec30('0x4b')](function(_0x4aa618){logger[_0xec30('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4aa618);throw _0x4aa618;});}return _0x20b4d1;})[_0xec30('0x27')](respondWithResult(_0x4993c0,0xc9))[_0xec30('0x4b')](handleError(_0x4993c0,null));};exports[_0xec30('0x53')]=function(_0x3f8340,_0x453cc6){var _0x4b39aa={'where':{'id':_0x3f8340[_0xec30('0x49')]['id']}},_0x1e113d={};_0x1e113d[_0xec30('0x33')]=_[_0xec30('0x36')](db[_0xec30('0x30')][_0xec30('0x31')]);_0x4b39aa[_0xec30('0x38')]=_[_0xec30('0x37')](_0x1e113d['model'],qs[_0xec30('0x39')](_0x3f8340[_0xec30('0x35')][_0xec30('0x39')]));_0x4b39aa['attributes']=_0x4b39aa['attributes']['length']?_0x4b39aa[_0xec30('0x38')]:_0x1e113d[_0xec30('0x33')];if(_0x3f8340[_0xec30('0x35')][_0xec30('0x54')]){_0x4b39aa[_0xec30('0x4a')]=[{'all':!![]}];}_0x4b39aa=_[_0xec30('0x42')]({},_0x4b39aa,_0x3f8340[_0xec30('0x45')]);return db[_0xec30('0x30')][_0xec30('0x55')](_0x4b39aa)[_0xec30('0x27')](handleEntityNotFound(_0x453cc6,null))[_0xec30('0x27')](function(_0x29e072){if(_0x29e072){var _0x21d94c=_0x29e072[_0xec30('0x29')]({'plain':!![]});_0x21d94c=qs[_0xec30('0x56')](_0x21d94c,['id',_0xec30('0x57'),_0xec30('0x58')]);_0x3f8340[_0xec30('0x4d')]=_[_0xec30('0x56')](_0x3f8340[_0xec30('0x4d')],['id',_0xec30('0x57'),_0xec30('0x58')]);return db['JscriptyProject'][_0xec30('0x4c')](_[_0xec30('0x42')](_0x21d94c,_0x3f8340[_0xec30('0x4d')]),{'include':_0x3f8340[_0xec30('0x35')][_0xec30('0x54')]?[{'all':!![]}]:undefined})[_0xec30('0x27')](function(_0x3f51c9){var _0x5c668d=_0x3f8340['user']['get']({'plain':!![]});if(!_0x5c668d)throw new Error(_0xec30('0x4f'));if(_0x5c668d[_0xec30('0x50')]===_0xec30('0x4e')){var _0x542fc3=_0x3f51c9['get']({'plain':!![]});var _0x2068a7=_0xec30('0x2a');return db[_0xec30('0x51')][_0xec30('0x55')]({'where':{'name':_0x2068a7,'userProfileId':_0x5c668d[_0xec30('0x59')]},'raw':!![]})[_0xec30('0x27')](function(_0x395a7a){if(_0x395a7a&&_0x395a7a[_0xec30('0x52')]===0x0){return db[_0xec30('0x2b')][_0xec30('0x4c')]({'name':_0x542fc3['name'],'resourceId':_0x542fc3['id'],'type':_0x395a7a[_0xec30('0x2e')],'sectionId':_0x395a7a['id']},{})[_0xec30('0x27')](function(){return _0x3f51c9;});}else{return _0x3f51c9;}})[_0xec30('0x4b')](function(_0x25bf56){logger[_0xec30('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25bf56);throw _0x25bf56;});}return _0x3f51c9;});}})[_0xec30('0x27')](respondWithResult(_0x453cc6,0xc9))[_0xec30('0x4b')](handleError(_0x453cc6,null));};exports[_0xec30('0x26')]=function(_0x762333,_0x480267){if(_0x762333[_0xec30('0x4d')]['id']){delete _0x762333[_0xec30('0x4d')]['id'];}return db['JscriptyProject'][_0xec30('0x55')]({'where':{'id':_0x762333[_0xec30('0x49')]['id']}})[_0xec30('0x27')](handleEntityNotFound(_0x480267,null))[_0xec30('0x27')](saveUpdates(_0x762333[_0xec30('0x4d')],null))[_0xec30('0x27')](respondWithResult(_0x480267,null))[_0xec30('0x4b')](handleError(_0x480267,null));};exports[_0xec30('0x28')]=function(_0x3fdf2f,_0x124720){return db[_0xec30('0x30')][_0xec30('0x55')]({'where':{'id':_0x3fdf2f['params']['id']}})['then'](handleEntityNotFound(_0x124720,null))['then'](removeEntity(_0x124720,null))['catch'](handleError(_0x124720,null));};exports['getSessions']=function(_0x495639,_0x38623b,_0x2576c1){var _0x3434bb={'raw':!![],'where':{}};var _0x1445bc={};var _0x5bca63={'count':0x0,'rows':[]};return db[_0xec30('0x30')][_0xec30('0x5a')]({'where':{'id':_0x495639[_0xec30('0x49')]['id']}})[_0xec30('0x27')](handleEntityNotFound(_0x38623b,null))['then'](function(_0x954a8f){if(_0x954a8f){_0x1445bc[_0xec30('0x33')]=_[_0xec30('0x36')](db[_0xec30('0x5b')][_0xec30('0x31')]);_0x1445bc[_0xec30('0x35')]=_[_0xec30('0x36')](_0x495639[_0xec30('0x35')]);_0x1445bc[_0xec30('0x41')]=_[_0xec30('0x37')](_0x1445bc[_0xec30('0x33')],_0x1445bc[_0xec30('0x35')]);_0x3434bb[_0xec30('0x38')]=_[_0xec30('0x37')](_0x1445bc[_0xec30('0x33')],qs[_0xec30('0x39')](_0x495639[_0xec30('0x35')][_0xec30('0x39')]));_0x3434bb[_0xec30('0x38')]=_0x3434bb[_0xec30('0x38')]['length']?_0x3434bb[_0xec30('0x38')]:_0x1445bc[_0xec30('0x33')];if(!_0x495639['query'][_0xec30('0x3b')](_0xec30('0x3c'))){_0x3434bb[_0xec30('0x1f')]=qs[_0xec30('0x1f')](_0x495639['query'][_0xec30('0x1f')]);_0x3434bb[_0xec30('0x1d')]=qs[_0xec30('0x1d')](_0x495639['query'][_0xec30('0x1d')]);}_0x3434bb[_0xec30('0x3d')]=qs[_0xec30('0x3e')](_0x495639[_0xec30('0x35')]['sort']);_0x3434bb[_0xec30('0x3f')]=qs['filters'](_['pick'](_0x495639[_0xec30('0x35')],_0x1445bc[_0xec30('0x41')]));_0x3434bb['where'][_0xec30('0x5c')]=_0x954a8f['id'];if(_0x495639[_0xec30('0x35')][_0xec30('0x44')]){_0x3434bb[_0xec30('0x3f')]=_[_0xec30('0x42')](_0x3434bb[_0xec30('0x3f')],{'$or':_[_0xec30('0x34')](_0x3434bb[_0xec30('0x38')],function(_0x4477de){var _0x3fb751={};_0x3fb751[_0x4477de]={'$like':'%'+_0x495639[_0xec30('0x35')][_0xec30('0x44')]+'%'};return _0x3fb751;})});}_0x3434bb=_['merge']({},_0x3434bb,_0x495639[_0xec30('0x45')]);return db[_0xec30('0x5b')][_0xec30('0x20')]({'where':_0x3434bb[_0xec30('0x3f')]})[_0xec30('0x27')](function(_0x2f89b8){_0x5bca63[_0xec30('0x20')]=_0x2f89b8;if(_0x495639[_0xec30('0x35')][_0xec30('0x54')]){_0x3434bb['include']=[{'all':!![]}];}return db[_0xec30('0x5b')][_0xec30('0x46')](_0x3434bb);})[_0xec30('0x27')](function(_0x3531e8){_0x5bca63[_0xec30('0x47')]=_0x3531e8;return _0x5bca63;});}})['then'](respondWithFilteredResult(_0x38623b,_0x3434bb))[_0xec30('0x4b')](handleError(_0x38623b,null));};exports[_0xec30('0x5d')]=function(_0x345a2f,_0x50904b,_0x224098){var _0x524667={'raw':!![],'where':{}};var _0x1b0719={};var _0x20fd86={'count':0x0,'rows':[]};return db[_0xec30('0x30')]['findOne']({'where':{'id':_0x345a2f['params']['id']}})[_0xec30('0x27')](handleEntityNotFound(_0x50904b,null))[_0xec30('0x27')](function(_0x56bfbc){if(_0x56bfbc){_0x1b0719[_0xec30('0x33')]=_['keys'](db[_0xec30('0x5e')][_0xec30('0x31')]);_0x1b0719['query']=_[_0xec30('0x36')](_0x345a2f[_0xec30('0x35')]);_0x1b0719[_0xec30('0x41')]=_[_0xec30('0x37')](_0x1b0719[_0xec30('0x33')],_0x1b0719['query']);_0x524667['attributes']=_[_0xec30('0x37')](_0x1b0719[_0xec30('0x33')],qs[_0xec30('0x39')](_0x345a2f[_0xec30('0x35')][_0xec30('0x39')]));_0x524667[_0xec30('0x38')]=_0x524667[_0xec30('0x38')][_0xec30('0x3a')]?_0x524667[_0xec30('0x38')]:_0x1b0719['model'];if(!_0x345a2f[_0xec30('0x35')][_0xec30('0x3b')]('nolimit')){_0x524667[_0xec30('0x1f')]=qs['limit'](_0x345a2f[_0xec30('0x35')][_0xec30('0x1f')]);_0x524667['offset']=qs[_0xec30('0x1d')](_0x345a2f['query'][_0xec30('0x1d')]);}_0x524667['order']=qs[_0xec30('0x3e')](_0x345a2f[_0xec30('0x35')]['sort']);_0x524667[_0xec30('0x3f')]=qs[_0xec30('0x41')](_[_0xec30('0x40')](_0x345a2f[_0xec30('0x35')],_0x1b0719[_0xec30('0x41')]));_0x524667[_0xec30('0x3f')]['ProjectId']=_0x56bfbc['id'];if(_0x345a2f[_0xec30('0x35')][_0xec30('0x44')]){_0x524667[_0xec30('0x3f')]=_[_0xec30('0x42')](_0x524667[_0xec30('0x3f')],{'$or':_[_0xec30('0x34')](_0x524667[_0xec30('0x38')],function(_0x2cc45f){var _0x44ee08={};_0x44ee08[_0x2cc45f]={'$like':'%'+_0x345a2f[_0xec30('0x35')][_0xec30('0x44')]+'%'};return _0x44ee08;})});}_0x524667=_[_0xec30('0x42')]({},_0x524667,_0x345a2f[_0xec30('0x45')]);return db[_0xec30('0x5e')]['count']({'where':_0x524667[_0xec30('0x3f')]})[_0xec30('0x27')](function(_0x50cc63){_0x20fd86[_0xec30('0x20')]=_0x50cc63;if(_0x345a2f[_0xec30('0x35')]['includeAll']){_0x524667[_0xec30('0x4a')]=[{'all':!![]}];}return db[_0xec30('0x5e')][_0xec30('0x46')](_0x524667);})['then'](function(_0x430ddc){_0x20fd86[_0xec30('0x47')]=_0x430ddc;return _0x20fd86;});}})[_0xec30('0x27')](respondWithFilteredResult(_0x50904b,_0x524667))[_0xec30('0x4b')](handleError(_0x50904b,null));};function char(_0x2152b9){return _0xec30('0x5f')===typeof _0x2152b9?String['fromCharCode'][_0xec30('0x23')](null,arguments):_0x2152b9;}function needsEncapsulation(_0x24ca88){return!!_0x24ca88&&(_0x24ca88[_0xec30('0x60')]()[_0xec30('0x61')](char(0xd))>=0x0||_0x24ca88['toString']()['indexOf'](char(0xa))>=0x0||_0x24ca88[_0xec30('0x60')]()[_0xec30('0x61')](char(0x2c))>=0x0||_0x24ca88[_0xec30('0x60')]()[_0xec30('0x61')](char(0x22))>=0x0);}function encapsulate(_0x3de0c5){var _0x1c18a0=char(0x22),_0x45ac68='\x5c'+char(0x22),_0x2e9dd2=_0x3de0c5[_0xec30('0x60')]()[_0xec30('0x62')](new RegExp(_0x1c18a0,'g'),_0x45ac68);return _0x1c18a0+_0x2e9dd2+_0x1c18a0;}exports['getSummary']=function(_0x4f669c,_0x383583,_0x4b9a7a){var _0x8a213e,_0x24f077;var _0x2d915c={'where':{'ProjectId':_0x4f669c[_0xec30('0x49')]['id']}};if(_0x4f669c[_0xec30('0x35')][_0xec30('0x63')]){_0x2d915c['where']['starttime']=JSON[_0xec30('0x64')](_0x4f669c[_0xec30('0x35')]['startTime']);}return db[_0xec30('0x5b')]['findAll'](_0x2d915c)[_0xec30('0x27')](handleEntityNotFound(_0x383583,null))['then'](function(_0x3db3bb){if(_0x3db3bb){_0x8a213e=_0x3db3bb;return db[_0xec30('0x65')]['findAll']({'where':{'SessionId':{'$in':_[_0xec30('0x34')](_0x8a213e,'id')},'ProjectId':_0x4f669c[_0xec30('0x49')]['id']},'order':_0xec30('0x66')});}})['then'](handleEntityNotFound(_0x383583,null))['then'](function(_0x571693){if(_0x571693){_0x24f077=_0x571693;var _0x1c169e={};for(var _0x204c5d=0x0,_0x29ed7d=_0x24f077[_0xec30('0x3a')];_0x204c5d<_0x29ed7d;_0x204c5d++){if(!_0x1c169e['hasOwnProperty'](_0x24f077[_0x204c5d][_0xec30('0x67')])){_0x1c169e[_0x24f077[_0x204c5d][_0xec30('0x67')]]=needsEncapsulation(_0x24f077[_0x204c5d][_0xec30('0x68')])?encapsulate(_0x24f077[_0x204c5d][_0xec30('0x68')]):_0x24f077[_0x204c5d][_0xec30('0x68')];}}var _0x9f20d8=[],_0x45ad3c={};for(var _0x41180c=0x0,_0x46beb8=_0x8a213e['length'];_0x41180c<_0x46beb8;_0x41180c++){_0x45ad3c={'ProjectId':_0x4f669c[_0xec30('0x49')]['id'],'SessionId':_0x8a213e[_0x41180c]['id'],'StartTime':moment(_0x8a213e[_0x41180c][_0xec30('0x69')])[_0xec30('0x6a')](_0xec30('0x6b'))};for(var _0x519577=0x0,_0x2f358a=_0x24f077['length'];_0x519577<_0x2f358a;_0x519577++){if(_0x24f077[_0x519577]['SessionId']==_0x8a213e[_0x41180c]['id']&&_0x1c169e['hasOwnProperty'](_0x24f077[_0x519577][_0xec30('0x67')])){_0x45ad3c[_0x1c169e[_0x24f077[_0x519577][_0xec30('0x67')]]]=_0x24f077[_0x519577][_0xec30('0x6c')];}}for(var _0x461755 in _0x1c169e){if(!_0x45ad3c['hasOwnProperty'](_0x1c169e[_0x461755])){_0x45ad3c[_0x1c169e[_0x461755]]=null;}}_0x9f20d8[_0xec30('0x6d')](_0x45ad3c);}return _0x9f20d8;}})[_0xec30('0x27')](function(_0x3d950e){if(!_[_0xec30('0x6e')](_0x3d950e)){var _0x44bec5=toCsv(_0x3d950e);var _0x3199c9=Date[_0xec30('0x6f')]();fs[_0xec30('0x70')](util[_0xec30('0x6a')](_0xec30('0x71'),_0x4f669c[_0xec30('0x49')]['id'],_0x3199c9),_0x44bec5);_0x383583[_0xec30('0x72')](_0xec30('0x73'),'attachment;\x20filename='+util[_0xec30('0x6a')](_0xec30('0x74'),_0x4f669c[_0xec30('0x49')]['id'],_0x3199c9));_0x383583[_0xec30('0x72')]('Content-type',_0xec30('0x75'));return _0x383583[_0xec30('0x76')](util['format'](_0xec30('0x71'),_0x4f669c[_0xec30('0x49')]['id'],_0x3199c9));}else{return _0x383583[_0xec30('0x77')](0xcc);}})[_0xec30('0x4b')](handleError(_0x383583,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index f468fd8..a3ac151 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 _0x88d5=['api','moment','request-promise','path','../../config/environment','./jscriptyProject.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x57b096,_0x2d225f){var _0x30a8b6=function(_0x9b65b3){while(--_0x9b65b3){_0x57b096['push'](_0x57b096['shift']());}};_0x30a8b6(++_0x2d225f);}(_0x88d5,0x76));var _0x588d=function(_0x42fa42,_0x5eb51d){_0x42fa42=_0x42fa42-0x0;var _0x3fd390=_0x88d5[_0x42fa42];return _0x3fd390;};'use strict';var _=require(_0x588d('0x0'));var util=require(_0x588d('0x1'));var logger=require(_0x588d('0x2'))(_0x588d('0x3'));var moment=require(_0x588d('0x4'));var BPromise=require('bluebird');var rp=require(_0x588d('0x5'));var fs=require('fs');var path=require(_0x588d('0x6'));var rimraf=require('rimraf');var config=require(_0x588d('0x7'));var attributes=require(_0x588d('0x8'));module[_0x588d('0x9')]=function(_0x1b193f,_0xecfb11){return _0x1b193f[_0x588d('0xa')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe292=['request-promise','path','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','../../config/logger','api'];(function(_0x38c147,_0x27602d){var _0x25f103=function(_0x444e29){while(--_0x444e29){_0x38c147['push'](_0x38c147['shift']());}};_0x25f103(++_0x27602d);}(_0xe292,0x19e));var _0x2e29=function(_0x20b8b6,_0x5be6e0){_0x20b8b6=_0x20b8b6-0x0;var _0x5e0c53=_0xe292[_0x20b8b6];return _0x5e0c53;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2e29('0x0'))(_0x2e29('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2e29('0x2'));var fs=require('fs');var path=require(_0x2e29('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2e29('0x4'));module['exports']=function(_0x5bd6cc,_0xcdccd7){return _0x5bd6cc[_0x2e29('0x5')](_0x2e29('0x6'),attributes,{'tableName':_0x2e29('0x7'),'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 c82a955..3390ceb 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 _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2684d2,_0x519568){var _0x29c5f1=function(_0x446f74){while(--_0x446f74){_0x2684d2['push'](_0x2684d2['shift']());}};_0x29c5f1(++_0x519568);}(_0xe706,0xa3));var _0x6e70=function(_0x1c8c07,_0x2579af){_0x1c8c07=_0x1c8c07-0x0;var _0x4aa88f=_0xe706[_0x1c8c07];return _0x4aa88f;};'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']('JscriptyProject,\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']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xdebb9,_0x6e6caa){var _0x241d91=function(_0x1510b0){while(--_0x1510b0){_0xdebb9['push'](_0xdebb9['shift']());}};_0x241d91(++_0x6e6caa);}(_0x70e0,0x17b));var _0x070e=function(_0x524b92,_0x54ebe5){_0x524b92=_0x524b92-0x0;var _0x170bdc=_0x70e0[_0x524b92];return _0x170bdc;};'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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\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 diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 8802002..a4759b2 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 _0xa596=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x36bd8f,_0x4192f8){var _0x25dec2=function(_0x19d158){while(--_0x19d158){_0x36bd8f['push'](_0x36bd8f['shift']());}};_0x25dec2(++_0x4192f8);}(_0xa596,0x91));var _0x6a59=function(_0x576c0f,_0xee9d9d){_0x576c0f=_0x576c0f-0x0;var _0x125f7c=_0xa596[_0x576c0f];return _0x125f7c;};'use strict';var multer=require(_0x6a59('0x0'));var util=require(_0x6a59('0x1'));var path=require('path');var timeout=require(_0x6a59('0x2'));var express=require(_0x6a59('0x3'));var router=express[_0x6a59('0x4')]();var fs_extra=require(_0x6a59('0x5'));var auth=require(_0x6a59('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6a59('0x7'));var controller=require(_0x6a59('0x8'));router[_0x6a59('0x9')]('/',auth[_0x6a59('0xa')](),controller[_0x6a59('0xb')]);router[_0x6a59('0x9')](_0x6a59('0xc'),auth['isAuthenticated'](),controller[_0x6a59('0xd')]);router['get']('/:id',auth[_0x6a59('0xa')](),controller[_0x6a59('0xe')]);router['post']('/',auth[_0x6a59('0xa')](),controller['create']);router[_0x6a59('0xf')](_0x6a59('0x10'),auth[_0x6a59('0xa')](),controller[_0x6a59('0x11')]);router[_0x6a59('0x12')](_0x6a59('0x10'),auth[_0x6a59('0xa')](),controller[_0x6a59('0x13')]);module[_0x6a59('0x14')]=router; \ No newline at end of file +var _0x1515=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','create','update'];(function(_0x3a7576,_0xabfeb2){var _0x3d13cb=function(_0x341b30){while(--_0x341b30){_0x3a7576['push'](_0x3a7576['shift']());}};_0x3d13cb(++_0xabfeb2);}(_0x1515,0x1d1));var _0x5151=function(_0x5bca20,_0x37e530){_0x5bca20=_0x5bca20-0x0;var _0x40f5f5=_0x1515[_0x5bca20];return _0x40f5f5;};'use strict';var multer=require(_0x5151('0x0'));var util=require(_0x5151('0x1'));var path=require(_0x5151('0x2'));var timeout=require(_0x5151('0x3'));var express=require(_0x5151('0x4'));var router=express[_0x5151('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5151('0x6'));var interaction=require(_0x5151('0x7'));var config=require(_0x5151('0x8'));var controller=require('./jscriptyQuestionReport.controller');router[_0x5151('0x9')]('/',auth['isAuthenticated'](),controller[_0x5151('0xa')]);router[_0x5151('0x9')](_0x5151('0xb'),auth[_0x5151('0xc')](),controller[_0x5151('0xd')]);router[_0x5151('0x9')](_0x5151('0xe'),auth[_0x5151('0xc')](),controller['show']);router[_0x5151('0xf')]('/',auth['isAuthenticated'](),controller[_0x5151('0x10')]);router['put'](_0x5151('0xe'),auth[_0x5151('0xc')](),controller[_0x5151('0x11')]);router[_0x5151('0x12')]('/:id',auth[_0x5151('0xc')](),controller[_0x5151('0x13')]);module[_0x5151('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 1ece76c..c8a6a83 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(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7a54,0x106));var _0x47a5=function(_0x36bb4b,_0x4b31a9){_0x36bb4b=_0x36bb4b-0x0;var _0x55051a=_0x7a54[_0x36bb4b];return _0x55051a;};'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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7a54,0x106));var _0x47a5=function(_0x113b58,_0x23d404){_0x113b58=_0x113b58-0x0;var _0x257db6=_0x7a54[_0x113b58];return _0x257db6;};'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 d27662a..85660fb 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 _0x72db=['fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','JscriptyQuestionReport','findAll','rows','catch','rawAttributes','length','create','find','params','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','update','then','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x72db,0x186));var _0xb72d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72db[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb72d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb72d('0x1'));var jsonpatch=require(_0xb72d('0x2'));var rp=require(_0xb72d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb72d('0x4'));var util=require(_0xb72d('0x5'));var path=require(_0xb72d('0x6'));var sox=require(_0xb72d('0x7'));var csv=require(_0xb72d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb72d('0x9'));var squel=require(_0xb72d('0xa'));var crypto=require('crypto');var jsforce=require(_0xb72d('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb72d('0xc'));var Redis=require(_0xb72d('0xd'));var authService=require(_0xb72d('0xe'));var qs=require(_0xb72d('0xf'));var as=require(_0xb72d('0x10'));var hardwareService=require(_0xb72d('0x11'));var logger=require(_0xb72d('0x12'))(_0xb72d('0x13'));var utils=require('../../config/utils');var config=require(_0xb72d('0x14'));var licenseUtil=require(_0xb72d('0x15'));var db=require(_0xb72d('0x16'))['db'];function respondWithStatusCode(_0x36dac0,_0x14fdd6){_0x14fdd6=_0x14fdd6||0xcc;return function(_0x4ebc17){if(_0x4ebc17){return _0x36dac0[_0xb72d('0x17')](_0x14fdd6);}return _0x36dac0[_0xb72d('0x18')](_0x14fdd6)[_0xb72d('0x19')]();};}function respondWithResult(_0x25b8e2,_0x139a00){_0x139a00=_0x139a00||0xc8;return function(_0x2c2d75){if(_0x2c2d75){return _0x25b8e2[_0xb72d('0x18')](_0x139a00)[_0xb72d('0x1a')](_0x2c2d75);}};}function respondWithFilteredResult(_0x3a4646,_0x4e2c14){return function(_0x4b3825){if(_0x4b3825){var _0x5c006f=typeof _0x4e2c14['offset']===_0xb72d('0x1b')&&typeof _0x4e2c14[_0xb72d('0x1c')]===_0xb72d('0x1b');var _0x22f7d2=_0x4b3825[_0xb72d('0x1d')];var _0x19d199=_0x5c006f?0x0:_0x4e2c14[_0xb72d('0x1e')];var _0x3c74bf=_0x5c006f?_0x4b3825[_0xb72d('0x1d')]:_0x4e2c14['offset']+_0x4e2c14['limit'];var _0x2274aa;if(_0x3c74bf>=_0x22f7d2){_0x3c74bf=_0x22f7d2;_0x2274aa=0xc8;}else{_0x2274aa=0xce;}_0x3a4646[_0xb72d('0x18')](_0x2274aa);return _0x3a4646[_0xb72d('0x1f')]('Content-Range',_0x19d199+'-'+_0x3c74bf+'/'+_0x22f7d2)[_0xb72d('0x1a')](_0x4b3825);}return null;};}function patchUpdates(_0x493724){return function(_0x46587f){try{jsonpatch[_0xb72d('0x20')](_0x46587f,_0x493724,!![]);}catch(_0x3f6506){return BPromise['reject'](_0x3f6506);}return _0x46587f['save']();};}function saveUpdates(_0x2dd238,_0x37f7c6){return function(_0x294d1d){if(_0x294d1d){return _0x294d1d[_0xb72d('0x21')](_0x2dd238)['then'](function(_0x56b404){return _0x56b404;});}return null;};}function removeEntity(_0x4bf3bb,_0x23e6a1){return function(_0x4a49eb){if(_0x4a49eb){return _0x4a49eb['destroy']()[_0xb72d('0x22')](function(){_0x4bf3bb[_0xb72d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56541b,_0x227a86){return function(_0x56e173){if(!_0x56e173){_0x56541b[_0xb72d('0x17')](0x194);}return _0x56e173;};}function handleError(_0x3726ea,_0x1391a1){_0x1391a1=_0x1391a1||0x1f4;return function(_0x1e2ff0){logger['error'](_0x1e2ff0[_0xb72d('0x23')]);if(_0x1e2ff0[_0xb72d('0x24')]){delete _0x1e2ff0[_0xb72d('0x24')];}_0x3726ea[_0xb72d('0x18')](_0x1391a1)[_0xb72d('0x25')](_0x1e2ff0);};}exports[_0xb72d('0x26')]=function(_0xcb9ffd,_0x57174b){var _0x187cb5={},_0x286aba={},_0xfacc2f={'count':0x0,'rows':[]};var _0x2cbf2c=_[_0xb72d('0x27')](db['JscriptyQuestionReport']['rawAttributes'],function(_0xa6bcd8){return{'name':_0xa6bcd8[_0xb72d('0x28')],'type':_0xa6bcd8['type'][_0xb72d('0x29')]};});_0x286aba[_0xb72d('0x2a')]=_[_0xb72d('0x27')](_0x2cbf2c,'name');_0x286aba[_0xb72d('0x2b')]=_[_0xb72d('0x2c')](_0xcb9ffd[_0xb72d('0x2b')]);_0x286aba[_0xb72d('0x2d')]=_[_0xb72d('0x2e')](_0x286aba['model'],_0x286aba[_0xb72d('0x2b')]);_0x187cb5[_0xb72d('0x2f')]=_[_0xb72d('0x2e')](_0x286aba[_0xb72d('0x2a')],qs[_0xb72d('0x30')](_0xcb9ffd[_0xb72d('0x2b')]['fields']));_0x187cb5[_0xb72d('0x2f')]=_0x187cb5[_0xb72d('0x2f')]['length']?_0x187cb5['attributes']:_0x286aba[_0xb72d('0x2a')];if(!_0xcb9ffd[_0xb72d('0x2b')][_0xb72d('0x31')](_0xb72d('0x32'))){_0x187cb5['limit']=qs[_0xb72d('0x1c')](_0xcb9ffd[_0xb72d('0x2b')]['limit']);_0x187cb5[_0xb72d('0x1e')]=qs[_0xb72d('0x1e')](_0xcb9ffd[_0xb72d('0x2b')][_0xb72d('0x1e')]);}_0x187cb5[_0xb72d('0x33')]=qs[_0xb72d('0x34')](_0xcb9ffd['query'][_0xb72d('0x34')]);_0x187cb5['where']=qs[_0xb72d('0x2d')](_['pick'](_0xcb9ffd[_0xb72d('0x2b')],_0x286aba['filters']),_0x2cbf2c);if(_0xcb9ffd['query'][_0xb72d('0x35')]){_0x187cb5[_0xb72d('0x36')]=_[_0xb72d('0x37')](_0x187cb5[_0xb72d('0x36')],{'$or':_['map'](_0x2cbf2c,function(_0x5f3505){if(_0x5f3505[_0xb72d('0x38')]!==_0xb72d('0x39')){var _0x27c2c5={};_0x27c2c5[_0x5f3505[_0xb72d('0x24')]]={'$like':'%'+_0xcb9ffd[_0xb72d('0x2b')][_0xb72d('0x35')]+'%'};return _0x27c2c5;}})});}_0x187cb5=_[_0xb72d('0x37')]({},_0x187cb5,_0xcb9ffd[_0xb72d('0x3a')]);var _0x261226={'where':_0x187cb5[_0xb72d('0x36')]};return db['JscriptyQuestionReport']['count'](_0x261226)[_0xb72d('0x22')](function(_0x2c195a){_0xfacc2f[_0xb72d('0x1d')]=_0x2c195a;if(_0xcb9ffd[_0xb72d('0x2b')][_0xb72d('0x3b')]){_0x187cb5[_0xb72d('0x3c')]=[{'all':!![]}];}return db[_0xb72d('0x3d')][_0xb72d('0x3e')](_0x187cb5);})[_0xb72d('0x22')](function(_0x284505){_0xfacc2f[_0xb72d('0x3f')]=_0x284505;return _0xfacc2f;})[_0xb72d('0x22')](respondWithFilteredResult(_0x57174b,_0x187cb5))[_0xb72d('0x40')](handleError(_0x57174b,null));};exports['show']=function(_0x2d8c9d,_0x5b8112){var _0x3aec7a={'raw':!![],'where':{'id':_0x2d8c9d['params']['id']}},_0x36822e={};_0x36822e[_0xb72d('0x2a')]=_['keys'](db[_0xb72d('0x3d')][_0xb72d('0x41')]);_0x36822e[_0xb72d('0x2b')]=_[_0xb72d('0x2c')](_0x2d8c9d[_0xb72d('0x2b')]);_0x36822e['filters']=_[_0xb72d('0x2e')](_0x36822e[_0xb72d('0x2a')],_0x36822e[_0xb72d('0x2b')]);_0x3aec7a[_0xb72d('0x2f')]=_['intersection'](_0x36822e['model'],qs['fields'](_0x2d8c9d['query']['fields']));_0x3aec7a[_0xb72d('0x2f')]=_0x3aec7a['attributes'][_0xb72d('0x42')]?_0x3aec7a['attributes']:_0x36822e['model'];if(_0x2d8c9d[_0xb72d('0x2b')][_0xb72d('0x3b')]){_0x3aec7a[_0xb72d('0x3c')]=[{'all':!![]}];}_0x3aec7a=_[_0xb72d('0x37')]({},_0x3aec7a,_0x2d8c9d['options']);return db[_0xb72d('0x3d')]['find'](_0x3aec7a)[_0xb72d('0x22')](handleEntityNotFound(_0x5b8112,null))[_0xb72d('0x22')](respondWithResult(_0x5b8112,null))[_0xb72d('0x40')](handleError(_0x5b8112,null));};exports[_0xb72d('0x43')]=function(_0x3ef23e,_0x9ee24d){return db[_0xb72d('0x3d')][_0xb72d('0x43')](_0x3ef23e['body'],{})[_0xb72d('0x22')](respondWithResult(_0x9ee24d,0xc9))['catch'](handleError(_0x9ee24d,null));};exports['update']=function(_0x597bb4,_0x3b590f){if(_0x597bb4['body']['id']){delete _0x597bb4['body']['id'];}return db['JscriptyQuestionReport'][_0xb72d('0x44')]({'where':{'id':_0x597bb4[_0xb72d('0x45')]['id']}})[_0xb72d('0x22')](handleEntityNotFound(_0x3b590f,null))[_0xb72d('0x22')](saveUpdates(_0x597bb4[_0xb72d('0x46')],null))[_0xb72d('0x22')](respondWithResult(_0x3b590f,null))[_0xb72d('0x40')](handleError(_0x3b590f,null));};exports[_0xb72d('0x47')]=function(_0x8aa564,_0x403741){return db[_0xb72d('0x3d')][_0xb72d('0x44')]({'where':{'id':_0x8aa564[_0xb72d('0x45')]['id']}})[_0xb72d('0x22')](handleEntityNotFound(_0x403741,null))[_0xb72d('0x22')](removeEntity(_0x403741,null))[_0xb72d('0x40')](handleError(_0x403741,null));};exports['describe']=function(_0x2bf928,_0x3c9834){return db[_0xb72d('0x3d')][_0xb72d('0x48')]()[_0xb72d('0x22')](respondWithResult(_0x3c9834,null))[_0xb72d('0x40')](handleError(_0x3c9834,null));}; \ No newline at end of file +var _0x7717=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','end','error','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','merge','find','body','update','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x5c1067,_0x571972){var _0x39f5a5=function(_0x83854d){while(--_0x83854d){_0x5c1067['push'](_0x5c1067['shift']());}};_0x39f5a5(++_0x571972);}(_0x7717,0xc9));var _0x7771=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7717[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x7771('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7771('0x1'));var jsonpatch=require(_0x7771('0x2'));var rp=require('request-promise');var moment=require(_0x7771('0x3'));var BPromise=require(_0x7771('0x4'));var Mustache=require(_0x7771('0x5'));var util=require('util');var path=require(_0x7771('0x6'));var sox=require(_0x7771('0x7'));var csv=require(_0x7771('0x8'));var ejs=require(_0x7771('0x9'));var fs=require('fs');var fs_extra=require(_0x7771('0xa'));var _=require(_0x7771('0xb'));var squel=require(_0x7771('0xc'));var crypto=require(_0x7771('0xd'));var jsforce=require(_0x7771('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7771('0xf'));var Redis=require(_0x7771('0x10'));var authService=require(_0x7771('0x11'));var qs=require(_0x7771('0x12'));var as=require(_0x7771('0x13'));var hardwareService=require(_0x7771('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7771('0x15'));var db=require(_0x7771('0x16'))['db'];function respondWithStatusCode(_0x41ea8d,_0x383ab4){_0x383ab4=_0x383ab4||0xcc;return function(_0x52993a){if(_0x52993a){return _0x41ea8d[_0x7771('0x17')](_0x383ab4);}return _0x41ea8d[_0x7771('0x18')](_0x383ab4)['end']();};}function respondWithResult(_0x1cc283,_0x5cf4d4){_0x5cf4d4=_0x5cf4d4||0xc8;return function(_0x4d9e65){if(_0x4d9e65){return _0x1cc283['status'](_0x5cf4d4)[_0x7771('0x19')](_0x4d9e65);}};}function respondWithFilteredResult(_0x25c3b1,_0x23a442){return function(_0x3defd8){if(_0x3defd8){var _0xd9253b=typeof _0x23a442[_0x7771('0x1a')]==='undefined'&&typeof _0x23a442['limit']===_0x7771('0x1b');var _0x587c85=_0x3defd8[_0x7771('0x1c')];var _0x54935d=_0xd9253b?0x0:_0x23a442['offset'];var _0x44e8bc=_0xd9253b?_0x3defd8[_0x7771('0x1c')]:_0x23a442[_0x7771('0x1a')]+_0x23a442[_0x7771('0x1d')];var _0x5f198a;if(_0x44e8bc>=_0x587c85){_0x44e8bc=_0x587c85;_0x5f198a=0xc8;}else{_0x5f198a=0xce;}_0x25c3b1[_0x7771('0x18')](_0x5f198a);return _0x25c3b1[_0x7771('0x1e')](_0x7771('0x1f'),_0x54935d+'-'+_0x44e8bc+'/'+_0x587c85)['json'](_0x3defd8);}return null;};}function patchUpdates(_0x2ecd2e){return function(_0x5ca346){try{jsonpatch[_0x7771('0x20')](_0x5ca346,_0x2ecd2e,!![]);}catch(_0x583d55){return BPromise[_0x7771('0x21')](_0x583d55);}return _0x5ca346['save']();};}function saveUpdates(_0x1d96bd,_0x123a36){return function(_0x2f306a){if(_0x2f306a){return _0x2f306a['update'](_0x1d96bd)[_0x7771('0x22')](function(_0x25df94){return _0x25df94;});}return null;};}function removeEntity(_0x50a93d,_0x37c5b9){return function(_0x1322f7){if(_0x1322f7){return _0x1322f7[_0x7771('0x23')]()['then'](function(){_0x50a93d[_0x7771('0x18')](0xcc)[_0x7771('0x24')]();});}};}function handleEntityNotFound(_0x1e586e,_0x17ee87){return function(_0x5b2340){if(!_0x5b2340){_0x1e586e[_0x7771('0x17')](0x194);}return _0x5b2340;};}function handleError(_0x1497ec,_0x446e98){_0x446e98=_0x446e98||0x1f4;return function(_0x4a62d9){logger[_0x7771('0x25')](_0x4a62d9['stack']);if(_0x4a62d9[_0x7771('0x26')]){delete _0x4a62d9[_0x7771('0x26')];}_0x1497ec['status'](_0x446e98)[_0x7771('0x27')](_0x4a62d9);};}exports[_0x7771('0x28')]=function(_0x4431bf,_0x5577b1){var _0x5708ce={},_0x5b3bbf={},_0x53e4d3={'count':0x0,'rows':[]};var _0x143ac9=_[_0x7771('0x29')](db[_0x7771('0x2a')][_0x7771('0x2b')],function(_0x3beb6a){return{'name':_0x3beb6a[_0x7771('0x2c')],'type':_0x3beb6a[_0x7771('0x2d')]['key']};});_0x5b3bbf[_0x7771('0x2e')]=_[_0x7771('0x29')](_0x143ac9,'name');_0x5b3bbf[_0x7771('0x2f')]=_[_0x7771('0x30')](_0x4431bf['query']);_0x5b3bbf['filters']=_['intersection'](_0x5b3bbf[_0x7771('0x2e')],_0x5b3bbf[_0x7771('0x2f')]);_0x5708ce[_0x7771('0x31')]=_[_0x7771('0x32')](_0x5b3bbf[_0x7771('0x2e')],qs[_0x7771('0x33')](_0x4431bf[_0x7771('0x2f')][_0x7771('0x33')]));_0x5708ce[_0x7771('0x31')]=_0x5708ce['attributes']['length']?_0x5708ce[_0x7771('0x31')]:_0x5b3bbf['model'];if(!_0x4431bf['query'][_0x7771('0x34')](_0x7771('0x35'))){_0x5708ce[_0x7771('0x1d')]=qs[_0x7771('0x1d')](_0x4431bf[_0x7771('0x2f')][_0x7771('0x1d')]);_0x5708ce[_0x7771('0x1a')]=qs[_0x7771('0x1a')](_0x4431bf['query']['offset']);}_0x5708ce['order']=qs[_0x7771('0x36')](_0x4431bf[_0x7771('0x2f')][_0x7771('0x36')]);_0x5708ce[_0x7771('0x37')]=qs[_0x7771('0x38')](_[_0x7771('0x39')](_0x4431bf[_0x7771('0x2f')],_0x5b3bbf['filters']),_0x143ac9);if(_0x4431bf[_0x7771('0x2f')][_0x7771('0x3a')]){_0x5708ce[_0x7771('0x37')]=_['merge'](_0x5708ce[_0x7771('0x37')],{'$or':_[_0x7771('0x29')](_0x143ac9,function(_0x10b946){if(_0x10b946[_0x7771('0x2d')]!==_0x7771('0x3b')){var _0x4c8a33={};_0x4c8a33[_0x10b946[_0x7771('0x26')]]={'$like':'%'+_0x4431bf[_0x7771('0x2f')]['filter']+'%'};return _0x4c8a33;}})});}_0x5708ce=_['merge']({},_0x5708ce,_0x4431bf['options']);var _0x33de69={'where':_0x5708ce[_0x7771('0x37')]};return db[_0x7771('0x2a')][_0x7771('0x1c')](_0x33de69)[_0x7771('0x22')](function(_0x1829f3){_0x53e4d3['count']=_0x1829f3;if(_0x4431bf[_0x7771('0x2f')][_0x7771('0x3c')]){_0x5708ce[_0x7771('0x3d')]=[{'all':!![]}];}return db[_0x7771('0x2a')][_0x7771('0x3e')](_0x5708ce);})[_0x7771('0x22')](function(_0x3e929a){_0x53e4d3[_0x7771('0x3f')]=_0x3e929a;return _0x53e4d3;})['then'](respondWithFilteredResult(_0x5577b1,_0x5708ce))[_0x7771('0x40')](handleError(_0x5577b1,null));};exports[_0x7771('0x41')]=function(_0x2662f7,_0x3beffe){var _0x3335a7={'raw':!![],'where':{'id':_0x2662f7['params']['id']}},_0x5671ad={};_0x5671ad[_0x7771('0x2e')]=_[_0x7771('0x30')](db[_0x7771('0x2a')][_0x7771('0x2b')]);_0x5671ad[_0x7771('0x2f')]=_[_0x7771('0x30')](_0x2662f7[_0x7771('0x2f')]);_0x5671ad['filters']=_[_0x7771('0x32')](_0x5671ad[_0x7771('0x2e')],_0x5671ad['query']);_0x3335a7[_0x7771('0x31')]=_[_0x7771('0x32')](_0x5671ad[_0x7771('0x2e')],qs[_0x7771('0x33')](_0x2662f7[_0x7771('0x2f')][_0x7771('0x33')]));_0x3335a7[_0x7771('0x31')]=_0x3335a7[_0x7771('0x31')][_0x7771('0x42')]?_0x3335a7[_0x7771('0x31')]:_0x5671ad[_0x7771('0x2e')];if(_0x2662f7[_0x7771('0x2f')]['includeAll']){_0x3335a7[_0x7771('0x3d')]=[{'all':!![]}];}_0x3335a7=_[_0x7771('0x43')]({},_0x3335a7,_0x2662f7['options']);return db[_0x7771('0x2a')][_0x7771('0x44')](_0x3335a7)[_0x7771('0x22')](handleEntityNotFound(_0x3beffe,null))[_0x7771('0x22')](respondWithResult(_0x3beffe,null))[_0x7771('0x40')](handleError(_0x3beffe,null));};exports['create']=function(_0xb856ce,_0x5e3c7c){return db[_0x7771('0x2a')]['create'](_0xb856ce[_0x7771('0x45')],{})[_0x7771('0x22')](respondWithResult(_0x5e3c7c,0xc9))['catch'](handleError(_0x5e3c7c,null));};exports[_0x7771('0x46')]=function(_0x2a4288,_0x665f7c){if(_0x2a4288[_0x7771('0x45')]['id']){delete _0x2a4288[_0x7771('0x45')]['id'];}return db[_0x7771('0x2a')][_0x7771('0x44')]({'where':{'id':_0x2a4288['params']['id']}})[_0x7771('0x22')](handleEntityNotFound(_0x665f7c,null))[_0x7771('0x22')](saveUpdates(_0x2a4288['body'],null))[_0x7771('0x22')](respondWithResult(_0x665f7c,null))[_0x7771('0x40')](handleError(_0x665f7c,null));};exports[_0x7771('0x23')]=function(_0x2dd6b3,_0x531018){return db['JscriptyQuestionReport'][_0x7771('0x44')]({'where':{'id':_0x2dd6b3['params']['id']}})[_0x7771('0x22')](handleEntityNotFound(_0x531018,null))[_0x7771('0x22')](removeEntity(_0x531018,null))[_0x7771('0x40')](handleError(_0x531018,null));};exports[_0x7771('0x47')]=function(_0x697089,_0x3a2b9d){return db[_0x7771('0x2a')]['describe']()['then'](respondWithResult(_0x3a2b9d,null))[_0x7771('0x40')](handleError(_0x3a2b9d,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 033bd0d..675f725 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 _0x5ef7=['report_jscripty_questions','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x3af393,_0x3f6ed9){var _0x201105=function(_0x529015){while(--_0x529015){_0x3af393['push'](_0x3af393['shift']());}};_0x201105(++_0x3f6ed9);}(_0x5ef7,0x64));var _0x75ef=function(_0x4cda62,_0x2e4792){_0x4cda62=_0x4cda62-0x0;var _0x26a668=_0x5ef7[_0x4cda62];return _0x26a668;};'use strict';var _=require(_0x75ef('0x0'));var util=require('util');var logger=require(_0x75ef('0x1'))(_0x75ef('0x2'));var moment=require('moment');var BPromise=require(_0x75ef('0x3'));var rp=require(_0x75ef('0x4'));var fs=require('fs');var path=require(_0x75ef('0x5'));var rimraf=require(_0x75ef('0x6'));var config=require(_0x75ef('0x7'));var attributes=require(_0x75ef('0x8'));module[_0x75ef('0x9')]=function(_0x1ed73b,_0x5806b5){return _0x1ed73b['define']('JscriptyQuestionReport',attributes,{'tableName':_0x75ef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46e3=['api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','lodash','util'];(function(_0x5080c4,_0x12918b){var _0x258d02=function(_0x4f895e){while(--_0x4f895e){_0x5080c4['push'](_0x5080c4['shift']());}};_0x258d02(++_0x12918b);}(_0x46e3,0x1de));var _0x346e=function(_0x50d2ed,_0x3d3f57){_0x50d2ed=_0x50d2ed-0x0;var _0x984519=_0x46e3[_0x50d2ed];return _0x984519;};'use strict';var _=require(_0x346e('0x0'));var util=require(_0x346e('0x1'));var logger=require('../../config/logger')(_0x346e('0x2'));var moment=require(_0x346e('0x3'));var BPromise=require(_0x346e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x346e('0x5'));var rimraf=require(_0x346e('0x6'));var config=require(_0x346e('0x7'));var attributes=require(_0x346e('0x8'));module[_0x346e('0x9')]=function(_0x315468,_0x3e16ba){return _0x315468['define']('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','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 b4497b5..940ad6a 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 _0x2e81=['../../config/logger','../../config/environment','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','ioredis','../../mysqldb'];(function(_0x2ef177,_0x959dc4){var _0x3f24a6=function(_0x187307){while(--_0x187307){_0x2ef177['push'](_0x2ef177['shift']());}};_0x3f24a6(++_0x959dc4);}(_0x2e81,0x1b2));var _0x12e8=function(_0x5b080b,_0xe34631){_0x5b080b=_0x5b080b-0x0;var _0x3d724c=_0x2e81[_0x5b080b];return _0x3d724c;};'use strict';var _=require(_0x12e8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12e8('0x1'));var db=require(_0x12e8('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x12e8('0x3'))('rpc');var config=require(_0x12e8('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x12e8('0x5')][_0x12e8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x412565,_0x2f3fd8,_0x4c4162){return new BPromise(function(_0x4efd7b,_0x53234c){return client[_0x12e8('0x7')](_0x412565,_0x4c4162)[_0x12e8('0x8')](function(_0x5b14f5){logger[_0x12e8('0x9')](_0x12e8('0xa'),_0x2f3fd8,_0x12e8('0xb'));logger[_0x12e8('0xc')](_0x12e8('0xd'),_0x2f3fd8,_0x12e8('0xb'),JSON[_0x12e8('0xe')](_0x5b14f5));if(_0x5b14f5[_0x12e8('0xf')]){if(_0x5b14f5[_0x12e8('0xf')][_0x12e8('0x10')]===0x1f4){logger['error'](_0x12e8('0xa'),_0x2f3fd8,_0x5b14f5['error'][_0x12e8('0x11')]);return _0x53234c(_0x5b14f5[_0x12e8('0xf')]['message']);}logger[_0x12e8('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2f3fd8,_0x5b14f5[_0x12e8('0xf')]['message']);return _0x4efd7b(_0x5b14f5[_0x12e8('0xf')]['message']);}else{logger[_0x12e8('0x9')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2f3fd8,_0x12e8('0xb'));_0x4efd7b(_0x5b14f5[_0x12e8('0x12')][_0x12e8('0x11')]);}})['catch'](function(_0x14e305){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x2f3fd8,_0x14e305);_0x53234c(_0x14e305);});});} \ No newline at end of file +var _0x2fc1=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x471d54,_0x4b1107){var _0x3e28f9=function(_0x21e236){while(--_0x21e236){_0x471d54['push'](_0x471d54['shift']());}};_0x3e28f9(++_0x4b1107);}(_0x2fc1,0x156));var _0x12fc=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2fc1[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x12fc('0x0'));var util=require(_0x12fc('0x1'));var moment=require(_0x12fc('0x2'));var BPromise=require(_0x12fc('0x3'));var rs=require(_0x12fc('0x4'));var fs=require('fs');var Redis=require(_0x12fc('0x5'));var db=require(_0x12fc('0x6'))['db'];var utils=require(_0x12fc('0x7'));var logger=require(_0x12fc('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x12fc('0x9'));var client=jayson[_0x12fc('0xa')][_0x12fc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50a350,_0x1bb90e,_0x288b13){return new BPromise(function(_0x212a8e,_0x118d41){return client[_0x12fc('0xc')](_0x50a350,_0x288b13)[_0x12fc('0xd')](function(_0x3b8372){logger[_0x12fc('0xe')](_0x12fc('0xf'),_0x1bb90e,_0x12fc('0x10'));logger[_0x12fc('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x1bb90e,'request\x20sent',JSON[_0x12fc('0x12')](_0x3b8372));if(_0x3b8372['error']){if(_0x3b8372[_0x12fc('0x13')][_0x12fc('0x14')]===0x1f4){logger[_0x12fc('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1bb90e,_0x3b8372['error']['message']);return _0x118d41(_0x3b8372[_0x12fc('0x13')][_0x12fc('0x15')]);}logger[_0x12fc('0x13')](_0x12fc('0xf'),_0x1bb90e,_0x3b8372[_0x12fc('0x13')][_0x12fc('0x15')]);return _0x212a8e(_0x3b8372['error']['message']);}else{logger[_0x12fc('0xe')](_0x12fc('0xf'),_0x1bb90e,'request\x20sent');_0x212a8e(_0x3b8372[_0x12fc('0x16')]['message']);}})[_0x12fc('0x17')](function(_0x2a70d1){logger['error'](_0x12fc('0xf'),_0x1bb90e,_0x2a70d1);_0x118d41(_0x2a70d1);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 8626bd5..0ff9ef3 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 _0x09d2=['connect-timeout','express','Router','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id','/:id/questions','post','create','put','update','delete','destroy','exports','path'];(function(_0x1ddab5,_0x48ff53){var _0x8fa54b=function(_0x59d7a0){while(--_0x59d7a0){_0x1ddab5['push'](_0x1ddab5['shift']());}};_0x8fa54b(++_0x48ff53);}(_0x09d2,0x167));var _0x209d=function(_0x2f9e31,_0x3c62fb){_0x2f9e31=_0x2f9e31-0x0;var _0x414ef2=_0x09d2[_0x2f9e31];return _0x414ef2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x209d('0x0'));var timeout=require(_0x209d('0x1'));var express=require(_0x209d('0x2'));var router=express[_0x209d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x209d('0x4'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x209d('0x5')](),controller['index']);router[_0x209d('0x6')](_0x209d('0x7'),auth[_0x209d('0x5')](),controller[_0x209d('0x8')]);router[_0x209d('0x6')](_0x209d('0x9'),auth[_0x209d('0x5')](),controller['show']);router['get'](_0x209d('0xa'),auth[_0x209d('0x5')](),controller['getQuestions']);router[_0x209d('0xb')]('/',auth[_0x209d('0x5')](),controller[_0x209d('0xc')]);router[_0x209d('0xd')](_0x209d('0x9'),auth[_0x209d('0x5')](),controller[_0x209d('0xe')]);router[_0x209d('0xf')](_0x209d('0x9'),auth[_0x209d('0x5')](),controller[_0x209d('0x10')]);module[_0x209d('0x11')]=router; \ No newline at end of file +var _0x6177=['destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/questions','getQuestions','post','delete'];(function(_0x4dfcd5,_0x2a79e3){var _0x666c05=function(_0x4a87f6){while(--_0x4a87f6){_0x4dfcd5['push'](_0x4dfcd5['shift']());}};_0x666c05(++_0x2a79e3);}(_0x6177,0x192));var _0x7617=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x6177[_0x1b5aea];return _0x15cfc6;};'use strict';var multer=require('multer');var util=require(_0x7617('0x0'));var path=require(_0x7617('0x1'));var timeout=require(_0x7617('0x2'));var express=require(_0x7617('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7617('0x4'));var interaction=require(_0x7617('0x5'));var config=require(_0x7617('0x6'));var controller=require(_0x7617('0x7'));router[_0x7617('0x8')]('/',auth[_0x7617('0x9')](),controller[_0x7617('0xa')]);router[_0x7617('0x8')](_0x7617('0xb'),auth[_0x7617('0x9')](),controller[_0x7617('0xc')]);router[_0x7617('0x8')](_0x7617('0xd'),auth[_0x7617('0x9')](),controller['show']);router[_0x7617('0x8')](_0x7617('0xe'),auth[_0x7617('0x9')](),controller[_0x7617('0xf')]);router[_0x7617('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x7617('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x7617('0x11')](_0x7617('0xd'),auth['isAuthenticated'](),controller[_0x7617('0x12')]);module[_0x7617('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index e10f0c4..51e7e6e 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 _0x3c07=['exports','DATE','setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize'];(function(_0x49faf1,_0x57d1ca){var _0x39b0e1=function(_0x200b2b){while(--_0x200b2b){_0x49faf1['push'](_0x49faf1['shift']());}};_0x39b0e1(++_0x57d1ca);}(_0x3c07,0x17a));var _0x73c0=function(_0x166acc,_0x111e4e){_0x166acc=_0x166acc-0x0;var _0x209f4d=_0x3c07[_0x166acc];return _0x209f4d;};'use strict';var moment=require(_0x73c0('0x0'));var Sequelize=require(_0x73c0('0x1'));module[_0x73c0('0x2')]={'starttime':{'type':Sequelize[_0x73c0('0x3')],'set':function(_0x233397){this[_0x73c0('0x4')](_0x73c0('0x5'),_0x233397);this[_0x73c0('0x4')](_0x73c0('0x6'),moment()['format'](_0x73c0('0x7')));}},'endtime':{'type':Sequelize[_0x73c0('0x3')]},'membername':{'type':Sequelize[_0x73c0('0x8')]},'projectname':{'type':Sequelize[_0x73c0('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x73c0('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x73c0('0x8')]},'completed':{'type':Sequelize[_0x73c0('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xaea2=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','exports','DATE','starttime','endtime'];(function(_0x1ceb40,_0xba13f3){var _0x39e07c=function(_0xc488a3){while(--_0xc488a3){_0x1ceb40['push'](_0x1ceb40['shift']());}};_0x39e07c(++_0xba13f3);}(_0xaea2,0x9d));var _0x2aea=function(_0x2e53e1,_0x12aed1){_0x2e53e1=_0x2e53e1-0x0;var _0x3a23de=_0xaea2[_0x2e53e1];return _0x3a23de;};'use strict';var moment=require(_0x2aea('0x0'));var Sequelize=require('sequelize');module[_0x2aea('0x1')]={'starttime':{'type':Sequelize[_0x2aea('0x2')],'set':function(_0x20ec8c){this['setDataValue'](_0x2aea('0x3'),_0x20ec8c);this['setDataValue'](_0x2aea('0x4'),moment()[_0x2aea('0x5')](_0x2aea('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x2aea('0x7')]},'projectname':{'type':Sequelize[_0x2aea('0x7')]},'queue':{'type':Sequelize[_0x2aea('0x7')]},'uniqueid':{'type':Sequelize[_0x2aea('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x2aea('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 faa19d8..5e6fbe1 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 _0x7a69=['params','includeAll','create','body','find','describe','getQuestions','findOne','keys','JscriptyQuestionReport','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','limit','status','apply','reject','save','update','sendStatus','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','then','rows','catch','show'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7a69,0x1a0));var _0x97a6=function(_0x57b3e8,_0x4c5936){_0x57b3e8=_0x57b3e8-0x0;var _0x1a833a=_0x7a69[_0x57b3e8];return _0x1a833a;};'use strict';var emlformat=require(_0x97a6('0x0'));var rimraf=require(_0x97a6('0x1'));var zipdir=require(_0x97a6('0x2'));var jsonpatch=require(_0x97a6('0x3'));var rp=require('request-promise');var moment=require(_0x97a6('0x4'));var BPromise=require(_0x97a6('0x5'));var Mustache=require(_0x97a6('0x6'));var util=require(_0x97a6('0x7'));var path=require('path');var sox=require(_0x97a6('0x8'));var csv=require(_0x97a6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97a6('0xa'));var _=require('lodash');var squel=require(_0x97a6('0xb'));var crypto=require(_0x97a6('0xc'));var jsforce=require(_0x97a6('0xd'));var deskjs=require(_0x97a6('0xe'));var toCsv=require('to-csv');var querystring=require(_0x97a6('0xf'));var Papa=require('papaparse');var Redis=require(_0x97a6('0x10'));var authService=require(_0x97a6('0x11'));var qs=require(_0x97a6('0x12'));var as=require(_0x97a6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x97a6('0x14'))('api');var utils=require(_0x97a6('0x15'));var config=require(_0x97a6('0x16'));var licenseUtil=require(_0x97a6('0x17'));var db=require(_0x97a6('0x18'))['db'];function respondWithStatusCode(_0x2fe717,_0xa94856){_0xa94856=_0xa94856||0xcc;return function(_0x3078c0){if(_0x3078c0){return _0x2fe717['sendStatus'](_0xa94856);}return _0x2fe717['status'](_0xa94856)[_0x97a6('0x19')]();};}function respondWithResult(_0x4824fe,_0xe2a52b){_0xe2a52b=_0xe2a52b||0xc8;return function(_0x41c93d){if(_0x41c93d){return _0x4824fe['status'](_0xe2a52b)[_0x97a6('0x1a')](_0x41c93d);}};}function respondWithFilteredResult(_0x520f19,_0x52607d){return function(_0x18afca){if(_0x18afca){var _0x30ca23=typeof _0x52607d[_0x97a6('0x1b')]==='undefined'&&typeof _0x52607d['limit']===_0x97a6('0x1c');var _0x324676=_0x18afca[_0x97a6('0x1d')];var _0x171fd1=_0x30ca23?0x0:_0x52607d[_0x97a6('0x1b')];var _0x113d9a=_0x30ca23?_0x18afca[_0x97a6('0x1d')]:_0x52607d[_0x97a6('0x1b')]+_0x52607d[_0x97a6('0x1e')];var _0xe4a0d8;if(_0x113d9a>=_0x324676){_0x113d9a=_0x324676;_0xe4a0d8=0xc8;}else{_0xe4a0d8=0xce;}_0x520f19[_0x97a6('0x1f')](_0xe4a0d8);return _0x520f19['set']('Content-Range',_0x171fd1+'-'+_0x113d9a+'/'+_0x324676)[_0x97a6('0x1a')](_0x18afca);}return null;};}function patchUpdates(_0xe3e957){return function(_0x23a89a){try{jsonpatch[_0x97a6('0x20')](_0x23a89a,_0xe3e957,!![]);}catch(_0x221d44){return BPromise[_0x97a6('0x21')](_0x221d44);}return _0x23a89a[_0x97a6('0x22')]();};}function saveUpdates(_0x4c6be1,_0x3d22b3){return function(_0x164d4d){if(_0x164d4d){return _0x164d4d[_0x97a6('0x23')](_0x4c6be1)['then'](function(_0x58eab1){return _0x58eab1;});}return null;};}function removeEntity(_0x1fb3c6,_0xa08909){return function(_0x57be72){if(_0x57be72){return _0x57be72['destroy']()['then'](function(){_0x1fb3c6[_0x97a6('0x1f')](0xcc)[_0x97a6('0x19')]();});}};}function handleEntityNotFound(_0x290506,_0x4d8dfc){return function(_0x2d119e){if(!_0x2d119e){_0x290506[_0x97a6('0x24')](0x194);}return _0x2d119e;};}function handleError(_0x5be3bf,_0x5210a9){_0x5210a9=_0x5210a9||0x1f4;return function(_0x3f06ee){logger[_0x97a6('0x25')](_0x3f06ee[_0x97a6('0x26')]);if(_0x3f06ee[_0x97a6('0x27')]){delete _0x3f06ee[_0x97a6('0x27')];}_0x5be3bf[_0x97a6('0x1f')](_0x5210a9)[_0x97a6('0x28')](_0x3f06ee);};}exports[_0x97a6('0x29')]=function(_0x5ef132,_0x356c75){var _0x1611cd={},_0x3f1570={},_0x1cd472={'count':0x0,'rows':[]};var _0x39ae78=_[_0x97a6('0x2a')](db[_0x97a6('0x2b')][_0x97a6('0x2c')],function(_0x1c14da){return{'name':_0x1c14da[_0x97a6('0x2d')],'type':_0x1c14da[_0x97a6('0x2e')][_0x97a6('0x2f')]};});_0x3f1570[_0x97a6('0x30')]=_['map'](_0x39ae78,_0x97a6('0x27'));_0x3f1570[_0x97a6('0x31')]=_['keys'](_0x5ef132['query']);_0x3f1570[_0x97a6('0x32')]=_[_0x97a6('0x33')](_0x3f1570['model'],_0x3f1570[_0x97a6('0x31')]);_0x1611cd[_0x97a6('0x34')]=_[_0x97a6('0x33')](_0x3f1570['model'],qs[_0x97a6('0x35')](_0x5ef132[_0x97a6('0x31')]['fields']));_0x1611cd[_0x97a6('0x34')]=_0x1611cd[_0x97a6('0x34')][_0x97a6('0x36')]?_0x1611cd[_0x97a6('0x34')]:_0x3f1570[_0x97a6('0x30')];if(!_0x5ef132[_0x97a6('0x31')][_0x97a6('0x37')](_0x97a6('0x38'))){_0x1611cd[_0x97a6('0x1e')]=qs[_0x97a6('0x1e')](_0x5ef132[_0x97a6('0x31')]['limit']);_0x1611cd[_0x97a6('0x1b')]=qs[_0x97a6('0x1b')](_0x5ef132[_0x97a6('0x31')]['offset']);}_0x1611cd[_0x97a6('0x39')]=qs['sort'](_0x5ef132[_0x97a6('0x31')][_0x97a6('0x3a')]);_0x1611cd['where']=qs[_0x97a6('0x32')](_[_0x97a6('0x3b')](_0x5ef132[_0x97a6('0x31')],_0x3f1570[_0x97a6('0x32')]),_0x39ae78);if(_0x5ef132[_0x97a6('0x31')][_0x97a6('0x3c')]){_0x1611cd[_0x97a6('0x3d')]=_[_0x97a6('0x3e')](_0x1611cd[_0x97a6('0x3d')],{'$or':_[_0x97a6('0x2a')](_0x39ae78,function(_0x1649fc){if(_0x1649fc['type']!==_0x97a6('0x3f')){var _0x1786de={};_0x1786de[_0x1649fc[_0x97a6('0x27')]]={'$like':'%'+_0x5ef132['query'][_0x97a6('0x3c')]+'%'};return _0x1786de;}})});}_0x1611cd=_[_0x97a6('0x3e')]({},_0x1611cd,_0x5ef132['options']);var _0x5aed74={'where':_0x1611cd[_0x97a6('0x3d')]};return db[_0x97a6('0x2b')]['count'](_0x5aed74)['then'](function(_0x560cef){_0x1cd472[_0x97a6('0x1d')]=_0x560cef;if(_0x5ef132[_0x97a6('0x31')]['includeAll']){_0x1611cd[_0x97a6('0x40')]=[{'all':!![]}];}return db[_0x97a6('0x2b')][_0x97a6('0x41')](_0x1611cd);})[_0x97a6('0x42')](function(_0x1a97cc){_0x1cd472[_0x97a6('0x43')]=_0x1a97cc;return _0x1cd472;})[_0x97a6('0x42')](respondWithFilteredResult(_0x356c75,_0x1611cd))[_0x97a6('0x44')](handleError(_0x356c75,null));};exports[_0x97a6('0x45')]=function(_0x71e218,_0x47bf8b){var _0x48c442={'raw':!![],'where':{'id':_0x71e218[_0x97a6('0x46')]['id']}},_0x1488eb={};_0x1488eb['model']=_['keys'](db[_0x97a6('0x2b')]['rawAttributes']);_0x1488eb[_0x97a6('0x31')]=_['keys'](_0x71e218[_0x97a6('0x31')]);_0x1488eb[_0x97a6('0x32')]=_[_0x97a6('0x33')](_0x1488eb[_0x97a6('0x30')],_0x1488eb[_0x97a6('0x31')]);_0x48c442[_0x97a6('0x34')]=_[_0x97a6('0x33')](_0x1488eb[_0x97a6('0x30')],qs[_0x97a6('0x35')](_0x71e218[_0x97a6('0x31')]['fields']));_0x48c442[_0x97a6('0x34')]=_0x48c442[_0x97a6('0x34')][_0x97a6('0x36')]?_0x48c442[_0x97a6('0x34')]:_0x1488eb[_0x97a6('0x30')];if(_0x71e218[_0x97a6('0x31')][_0x97a6('0x47')]){_0x48c442[_0x97a6('0x40')]=[{'all':!![]}];}_0x48c442=_['merge']({},_0x48c442,_0x71e218['options']);return db[_0x97a6('0x2b')]['find'](_0x48c442)['then'](handleEntityNotFound(_0x47bf8b,null))[_0x97a6('0x42')](respondWithResult(_0x47bf8b,null))[_0x97a6('0x44')](handleError(_0x47bf8b,null));};exports[_0x97a6('0x48')]=function(_0x4c16cd,_0x188097){return db[_0x97a6('0x2b')][_0x97a6('0x48')](_0x4c16cd[_0x97a6('0x49')],{})[_0x97a6('0x42')](respondWithResult(_0x188097,0xc9))[_0x97a6('0x44')](handleError(_0x188097,null));};exports[_0x97a6('0x23')]=function(_0x54b44b,_0x339ee0){if(_0x54b44b['body']['id']){delete _0x54b44b['body']['id'];}return db['JscriptySessionReport'][_0x97a6('0x4a')]({'where':{'id':_0x54b44b[_0x97a6('0x46')]['id']}})['then'](handleEntityNotFound(_0x339ee0,null))[_0x97a6('0x42')](saveUpdates(_0x54b44b[_0x97a6('0x49')],null))[_0x97a6('0x42')](respondWithResult(_0x339ee0,null))[_0x97a6('0x44')](handleError(_0x339ee0,null));};exports['destroy']=function(_0xed0319,_0x218473){return db['JscriptySessionReport'][_0x97a6('0x4a')]({'where':{'id':_0xed0319[_0x97a6('0x46')]['id']}})[_0x97a6('0x42')](handleEntityNotFound(_0x218473,null))[_0x97a6('0x42')](removeEntity(_0x218473,null))[_0x97a6('0x44')](handleError(_0x218473,null));};exports[_0x97a6('0x4b')]=function(_0x5b7721,_0x22a4cf){return db['JscriptySessionReport']['describe']()['then'](respondWithResult(_0x22a4cf,null))['catch'](handleError(_0x22a4cf,null));};exports[_0x97a6('0x4c')]=function(_0x2fc5ce,_0x38b645,_0x584835){var _0x2cbdb1={'raw':!![],'where':{}};var _0x2b93dc={};var _0x48484d={'count':0x0,'rows':[]};return db[_0x97a6('0x2b')][_0x97a6('0x4d')]({'where':{'id':_0x2fc5ce[_0x97a6('0x46')]['id']}})[_0x97a6('0x42')](handleEntityNotFound(_0x38b645,null))[_0x97a6('0x42')](function(_0x21e846){if(_0x21e846){_0x2b93dc[_0x97a6('0x30')]=_[_0x97a6('0x4e')](db[_0x97a6('0x4f')][_0x97a6('0x2c')]);_0x2b93dc[_0x97a6('0x31')]=_[_0x97a6('0x4e')](_0x2fc5ce['query']);_0x2b93dc['filters']=_[_0x97a6('0x33')](_0x2b93dc['model'],_0x2b93dc[_0x97a6('0x31')]);_0x2cbdb1[_0x97a6('0x34')]=_[_0x97a6('0x33')](_0x2b93dc[_0x97a6('0x30')],qs[_0x97a6('0x35')](_0x2fc5ce[_0x97a6('0x31')]['fields']));_0x2cbdb1[_0x97a6('0x34')]=_0x2cbdb1[_0x97a6('0x34')][_0x97a6('0x36')]?_0x2cbdb1[_0x97a6('0x34')]:_0x2b93dc['model'];if(!_0x2fc5ce['query'][_0x97a6('0x37')]('nolimit')){_0x2cbdb1[_0x97a6('0x1e')]=qs[_0x97a6('0x1e')](_0x2fc5ce[_0x97a6('0x31')][_0x97a6('0x1e')]);_0x2cbdb1['offset']=qs[_0x97a6('0x1b')](_0x2fc5ce[_0x97a6('0x31')][_0x97a6('0x1b')]);}_0x2cbdb1[_0x97a6('0x39')]=qs[_0x97a6('0x3a')](_0x2fc5ce['query'][_0x97a6('0x3a')]);_0x2cbdb1[_0x97a6('0x3d')]=qs[_0x97a6('0x32')](_[_0x97a6('0x3b')](_0x2fc5ce[_0x97a6('0x31')],_0x2b93dc[_0x97a6('0x32')]));_0x2cbdb1[_0x97a6('0x3d')][_0x97a6('0x50')]=_0x21e846['id'];if(_0x2fc5ce[_0x97a6('0x31')][_0x97a6('0x3c')]){_0x2cbdb1[_0x97a6('0x3d')]=_[_0x97a6('0x3e')](_0x2cbdb1[_0x97a6('0x3d')],{'$or':_[_0x97a6('0x2a')](_0x2cbdb1[_0x97a6('0x34')],function(_0x42f047){var _0x10edd5={};_0x10edd5[_0x42f047]={'$like':'%'+_0x2fc5ce['query'][_0x97a6('0x3c')]+'%'};return _0x10edd5;})});}_0x2cbdb1=_['merge']({},_0x2cbdb1,_0x2fc5ce['options']);return db['JscriptyQuestionReport'][_0x97a6('0x1d')]({'where':_0x2cbdb1[_0x97a6('0x3d')]})[_0x97a6('0x42')](function(_0x45779c){_0x48484d[_0x97a6('0x1d')]=_0x45779c;if(_0x2fc5ce[_0x97a6('0x31')][_0x97a6('0x47')]){_0x2cbdb1['include']=[{'all':!![]}];}return db[_0x97a6('0x4f')][_0x97a6('0x41')](_0x2cbdb1);})[_0x97a6('0x42')](function(_0x45156a){_0x48484d[_0x97a6('0x43')]=_0x45156a;return _0x48484d;});}})['then'](respondWithFilteredResult(_0x38b645,_0x2cbdb1))[_0x97a6('0x44')](handleError(_0x38b645,null));}; \ No newline at end of file +var _0x0f8b=['JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','destroy','describe','getQuestions','SessionId','JscriptyQuestionReport','eml-format','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','error','stack','name','send','map'];(function(_0x14902a,_0x3a5a5e){var _0x5127ed=function(_0xca3f3){while(--_0xca3f3){_0x14902a['push'](_0x14902a['shift']());}};_0x5127ed(++_0x3a5a5e);}(_0x0f8b,0x1e7));var _0xb0f8=function(_0x5433e8,_0x419b0b){_0x5433e8=_0x5433e8-0x0;var _0x43fac2=_0x0f8b[_0x5433e8];return _0x43fac2;};'use strict';var emlformat=require(_0xb0f8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb0f8('0x1'));var rp=require('request-promise');var moment=require(_0xb0f8('0x2'));var BPromise=require(_0xb0f8('0x3'));var Mustache=require('mustache');var util=require(_0xb0f8('0x4'));var path=require('path');var sox=require(_0xb0f8('0x5'));var csv=require(_0xb0f8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb0f8('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb0f8('0x8'));var deskjs=require('desk.js');var toCsv=require(_0xb0f8('0x6'));var querystring=require(_0xb0f8('0x9'));var Papa=require(_0xb0f8('0xa'));var Redis=require(_0xb0f8('0xb'));var authService=require(_0xb0f8('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xb0f8('0xd'));var hardwareService=require(_0xb0f8('0xe'));var logger=require(_0xb0f8('0xf'))(_0xb0f8('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb0f8('0x11'));var db=require(_0xb0f8('0x12'))['db'];function respondWithStatusCode(_0x44ab8f,_0x28dd0d){_0x28dd0d=_0x28dd0d||0xcc;return function(_0x43061d){if(_0x43061d){return _0x44ab8f[_0xb0f8('0x13')](_0x28dd0d);}return _0x44ab8f[_0xb0f8('0x14')](_0x28dd0d)['end']();};}function respondWithResult(_0x188b1c,_0x4eaafc){_0x4eaafc=_0x4eaafc||0xc8;return function(_0x59646a){if(_0x59646a){return _0x188b1c[_0xb0f8('0x14')](_0x4eaafc)[_0xb0f8('0x15')](_0x59646a);}};}function respondWithFilteredResult(_0x4d5eae,_0x3f1b0f){return function(_0x1c4aaf){if(_0x1c4aaf){var _0x47102d=typeof _0x3f1b0f[_0xb0f8('0x16')]===_0xb0f8('0x17')&&typeof _0x3f1b0f[_0xb0f8('0x18')]==='undefined';var _0x3d326d=_0x1c4aaf[_0xb0f8('0x19')];var _0x2600d2=_0x47102d?0x0:_0x3f1b0f[_0xb0f8('0x16')];var _0x21aa70=_0x47102d?_0x1c4aaf['count']:_0x3f1b0f[_0xb0f8('0x16')]+_0x3f1b0f[_0xb0f8('0x18')];var _0x3e7140;if(_0x21aa70>=_0x3d326d){_0x21aa70=_0x3d326d;_0x3e7140=0xc8;}else{_0x3e7140=0xce;}_0x4d5eae[_0xb0f8('0x14')](_0x3e7140);return _0x4d5eae[_0xb0f8('0x1a')](_0xb0f8('0x1b'),_0x2600d2+'-'+_0x21aa70+'/'+_0x3d326d)['json'](_0x1c4aaf);}return null;};}function patchUpdates(_0x301b55){return function(_0x1af635){try{jsonpatch['apply'](_0x1af635,_0x301b55,!![]);}catch(_0x2529c0){return BPromise[_0xb0f8('0x1c')](_0x2529c0);}return _0x1af635[_0xb0f8('0x1d')]();};}function saveUpdates(_0x2bfdda,_0x3f79a8){return function(_0x3176a9){if(_0x3176a9){return _0x3176a9[_0xb0f8('0x1e')](_0x2bfdda)[_0xb0f8('0x1f')](function(_0x2679b0){return _0x2679b0;});}return null;};}function removeEntity(_0x25051d,_0x1976f8){return function(_0x18b91a){if(_0x18b91a){return _0x18b91a['destroy']()[_0xb0f8('0x1f')](function(){_0x25051d[_0xb0f8('0x14')](0xcc)[_0xb0f8('0x20')]();});}};}function handleEntityNotFound(_0x585821,_0x12eeb6){return function(_0x22e51a){if(!_0x22e51a){_0x585821[_0xb0f8('0x13')](0x194);}return _0x22e51a;};}function handleError(_0x4bb887,_0x5ebd04){_0x5ebd04=_0x5ebd04||0x1f4;return function(_0x244dca){logger[_0xb0f8('0x21')](_0x244dca[_0xb0f8('0x22')]);if(_0x244dca[_0xb0f8('0x23')]){delete _0x244dca[_0xb0f8('0x23')];}_0x4bb887[_0xb0f8('0x14')](_0x5ebd04)[_0xb0f8('0x24')](_0x244dca);};}exports['index']=function(_0x2b93e4,_0x1d9086){var _0x438ab5={},_0x3ac77e={},_0xcc02fb={'count':0x0,'rows':[]};var _0x217946=_[_0xb0f8('0x25')](db[_0xb0f8('0x26')][_0xb0f8('0x27')],function(_0x4b8c2e){return{'name':_0x4b8c2e[_0xb0f8('0x28')],'type':_0x4b8c2e[_0xb0f8('0x29')][_0xb0f8('0x2a')]};});_0x3ac77e[_0xb0f8('0x2b')]=_[_0xb0f8('0x25')](_0x217946,_0xb0f8('0x23'));_0x3ac77e[_0xb0f8('0x2c')]=_['keys'](_0x2b93e4['query']);_0x3ac77e[_0xb0f8('0x2d')]=_[_0xb0f8('0x2e')](_0x3ac77e[_0xb0f8('0x2b')],_0x3ac77e[_0xb0f8('0x2c')]);_0x438ab5[_0xb0f8('0x2f')]=_[_0xb0f8('0x2e')](_0x3ac77e['model'],qs['fields'](_0x2b93e4['query'][_0xb0f8('0x30')]));_0x438ab5['attributes']=_0x438ab5[_0xb0f8('0x2f')][_0xb0f8('0x31')]?_0x438ab5['attributes']:_0x3ac77e[_0xb0f8('0x2b')];if(!_0x2b93e4[_0xb0f8('0x2c')][_0xb0f8('0x32')](_0xb0f8('0x33'))){_0x438ab5['limit']=qs[_0xb0f8('0x18')](_0x2b93e4[_0xb0f8('0x2c')]['limit']);_0x438ab5[_0xb0f8('0x16')]=qs[_0xb0f8('0x16')](_0x2b93e4['query']['offset']);}_0x438ab5['order']=qs[_0xb0f8('0x34')](_0x2b93e4['query']['sort']);_0x438ab5[_0xb0f8('0x35')]=qs[_0xb0f8('0x2d')](_[_0xb0f8('0x36')](_0x2b93e4[_0xb0f8('0x2c')],_0x3ac77e[_0xb0f8('0x2d')]),_0x217946);if(_0x2b93e4[_0xb0f8('0x2c')][_0xb0f8('0x37')]){_0x438ab5['where']=_[_0xb0f8('0x38')](_0x438ab5[_0xb0f8('0x35')],{'$or':_[_0xb0f8('0x25')](_0x217946,function(_0x3ad569){if(_0x3ad569['type']!==_0xb0f8('0x39')){var _0x3335e6={};_0x3335e6[_0x3ad569['name']]={'$like':'%'+_0x2b93e4['query'][_0xb0f8('0x37')]+'%'};return _0x3335e6;}})});}_0x438ab5=_[_0xb0f8('0x38')]({},_0x438ab5,_0x2b93e4[_0xb0f8('0x3a')]);var _0x1b7003={'where':_0x438ab5[_0xb0f8('0x35')]};return db[_0xb0f8('0x26')][_0xb0f8('0x19')](_0x1b7003)[_0xb0f8('0x1f')](function(_0x2d2b9c){_0xcc02fb[_0xb0f8('0x19')]=_0x2d2b9c;if(_0x2b93e4['query'][_0xb0f8('0x3b')]){_0x438ab5[_0xb0f8('0x3c')]=[{'all':!![]}];}return db[_0xb0f8('0x26')][_0xb0f8('0x3d')](_0x438ab5);})[_0xb0f8('0x1f')](function(_0x16ddd1){_0xcc02fb[_0xb0f8('0x3e')]=_0x16ddd1;return _0xcc02fb;})['then'](respondWithFilteredResult(_0x1d9086,_0x438ab5))[_0xb0f8('0x3f')](handleError(_0x1d9086,null));};exports[_0xb0f8('0x40')]=function(_0x77eebb,_0xc8e625){var _0x329a2d={'raw':!![],'where':{'id':_0x77eebb['params']['id']}},_0x4f666b={};_0x4f666b[_0xb0f8('0x2b')]=_[_0xb0f8('0x41')](db['JscriptySessionReport']['rawAttributes']);_0x4f666b['query']=_['keys'](_0x77eebb[_0xb0f8('0x2c')]);_0x4f666b[_0xb0f8('0x2d')]=_[_0xb0f8('0x2e')](_0x4f666b['model'],_0x4f666b[_0xb0f8('0x2c')]);_0x329a2d[_0xb0f8('0x2f')]=_['intersection'](_0x4f666b['model'],qs[_0xb0f8('0x30')](_0x77eebb[_0xb0f8('0x2c')]['fields']));_0x329a2d['attributes']=_0x329a2d[_0xb0f8('0x2f')][_0xb0f8('0x31')]?_0x329a2d[_0xb0f8('0x2f')]:_0x4f666b['model'];if(_0x77eebb[_0xb0f8('0x2c')][_0xb0f8('0x3b')]){_0x329a2d['include']=[{'all':!![]}];}_0x329a2d=_[_0xb0f8('0x38')]({},_0x329a2d,_0x77eebb[_0xb0f8('0x3a')]);return db['JscriptySessionReport'][_0xb0f8('0x42')](_0x329a2d)['then'](handleEntityNotFound(_0xc8e625,null))[_0xb0f8('0x1f')](respondWithResult(_0xc8e625,null))[_0xb0f8('0x3f')](handleError(_0xc8e625,null));};exports['create']=function(_0x309a5b,_0xa0adc2){return db['JscriptySessionReport'][_0xb0f8('0x43')](_0x309a5b[_0xb0f8('0x44')],{})[_0xb0f8('0x1f')](respondWithResult(_0xa0adc2,0xc9))['catch'](handleError(_0xa0adc2,null));};exports[_0xb0f8('0x1e')]=function(_0x717704,_0x32c76d){if(_0x717704[_0xb0f8('0x44')]['id']){delete _0x717704['body']['id'];}return db[_0xb0f8('0x26')][_0xb0f8('0x42')]({'where':{'id':_0x717704[_0xb0f8('0x45')]['id']}})[_0xb0f8('0x1f')](handleEntityNotFound(_0x32c76d,null))[_0xb0f8('0x1f')](saveUpdates(_0x717704[_0xb0f8('0x44')],null))[_0xb0f8('0x1f')](respondWithResult(_0x32c76d,null))[_0xb0f8('0x3f')](handleError(_0x32c76d,null));};exports[_0xb0f8('0x46')]=function(_0x172901,_0x51027d){return db['JscriptySessionReport']['find']({'where':{'id':_0x172901[_0xb0f8('0x45')]['id']}})[_0xb0f8('0x1f')](handleEntityNotFound(_0x51027d,null))['then'](removeEntity(_0x51027d,null))[_0xb0f8('0x3f')](handleError(_0x51027d,null));};exports['describe']=function(_0x1894aa,_0x3e8d19){return db[_0xb0f8('0x26')][_0xb0f8('0x47')]()[_0xb0f8('0x1f')](respondWithResult(_0x3e8d19,null))[_0xb0f8('0x3f')](handleError(_0x3e8d19,null));};exports[_0xb0f8('0x48')]=function(_0x4dd012,_0xd00618,_0x127772){var _0x52406e={'raw':!![],'where':{}};var _0x51c4ba={};var _0x3542f6={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x4dd012['params']['id']}})['then'](handleEntityNotFound(_0xd00618,null))[_0xb0f8('0x1f')](function(_0x3abc5a){if(_0x3abc5a){_0x51c4ba['model']=_[_0xb0f8('0x41')](db['JscriptyQuestionReport']['rawAttributes']);_0x51c4ba[_0xb0f8('0x2c')]=_[_0xb0f8('0x41')](_0x4dd012[_0xb0f8('0x2c')]);_0x51c4ba[_0xb0f8('0x2d')]=_[_0xb0f8('0x2e')](_0x51c4ba[_0xb0f8('0x2b')],_0x51c4ba[_0xb0f8('0x2c')]);_0x52406e[_0xb0f8('0x2f')]=_[_0xb0f8('0x2e')](_0x51c4ba['model'],qs['fields'](_0x4dd012[_0xb0f8('0x2c')][_0xb0f8('0x30')]));_0x52406e[_0xb0f8('0x2f')]=_0x52406e['attributes'][_0xb0f8('0x31')]?_0x52406e[_0xb0f8('0x2f')]:_0x51c4ba[_0xb0f8('0x2b')];if(!_0x4dd012[_0xb0f8('0x2c')]['hasOwnProperty'](_0xb0f8('0x33'))){_0x52406e[_0xb0f8('0x18')]=qs[_0xb0f8('0x18')](_0x4dd012['query']['limit']);_0x52406e['offset']=qs[_0xb0f8('0x16')](_0x4dd012[_0xb0f8('0x2c')][_0xb0f8('0x16')]);}_0x52406e['order']=qs[_0xb0f8('0x34')](_0x4dd012[_0xb0f8('0x2c')]['sort']);_0x52406e[_0xb0f8('0x35')]=qs[_0xb0f8('0x2d')](_['pick'](_0x4dd012['query'],_0x51c4ba[_0xb0f8('0x2d')]));_0x52406e[_0xb0f8('0x35')][_0xb0f8('0x49')]=_0x3abc5a['id'];if(_0x4dd012[_0xb0f8('0x2c')]['filter']){_0x52406e[_0xb0f8('0x35')]=_['merge'](_0x52406e[_0xb0f8('0x35')],{'$or':_['map'](_0x52406e[_0xb0f8('0x2f')],function(_0x17bd64){var _0x1e80ea={};_0x1e80ea[_0x17bd64]={'$like':'%'+_0x4dd012[_0xb0f8('0x2c')][_0xb0f8('0x37')]+'%'};return _0x1e80ea;})});}_0x52406e=_[_0xb0f8('0x38')]({},_0x52406e,_0x4dd012[_0xb0f8('0x3a')]);return db[_0xb0f8('0x4a')][_0xb0f8('0x19')]({'where':_0x52406e[_0xb0f8('0x35')]})[_0xb0f8('0x1f')](function(_0x1501b4){_0x3542f6[_0xb0f8('0x19')]=_0x1501b4;if(_0x4dd012[_0xb0f8('0x2c')]['includeAll']){_0x52406e['include']=[{'all':!![]}];}return db[_0xb0f8('0x4a')][_0xb0f8('0x3d')](_0x52406e);})[_0xb0f8('0x1f')](function(_0x2cfd17){_0x3542f6['rows']=_0x2cfd17;return _0x3542f6;});}})[_0xb0f8('0x1f')](respondWithFilteredResult(_0xd00618,_0x52406e))[_0xb0f8('0x3f')](handleError(_0xd00618,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 204deb0..da111fe 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 _0x4819=['report_jscripty_sessions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','JscriptySessionReport'];(function(_0x422ff5,_0x3c1ba5){var _0x5366c6=function(_0x1280a1){while(--_0x1280a1){_0x422ff5['push'](_0x422ff5['shift']());}};_0x5366c6(++_0x3c1ba5);}(_0x4819,0xcd));var _0x9481=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0x4819[_0x420b24];return _0x4da552;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71ab=['exports','define','JscriptySessionReport','report_jscripty_sessions','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x1c88e1,_0x2f92ff){var _0x38c8d8=function(_0x1ed00c){while(--_0x1ed00c){_0x1c88e1['push'](_0x1c88e1['shift']());}};_0x38c8d8(++_0x2f92ff);}(_0x71ab,0x64));var _0xb71a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x71ab[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 00aa9db..74bb32a 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 _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x4ebb3b,_0xf30348){var _0x1bdf2a=function(_0x155fe9){while(--_0x155fe9){_0x4ebb3b['push'](_0x4ebb3b['shift']());}};_0x1bdf2a(++_0xf30348);}(_0x187d,0x93));var _0xd187=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x187d[_0x28d18d];return _0x470640;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file +var _0x896e=['JscriptySessionReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x333ec4,_0x22edd7){var _0x2c87f7=function(_0x541c4f){while(--_0x541c4f){_0x333ec4['push'](_0x333ec4['shift']());}};_0x2c87f7(++_0x22edd7);}(_0x896e,0x1e9));var _0xe896=function(_0x57bb6f,_0x18d90f){_0x57bb6f=_0x57bb6f-0x0;var _0x254ba2=_0x896e[_0x57bb6f];return _0x254ba2;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 6c0c35d..0a29544 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 _0x1118=['path','fs-extra','../../config/environment','./license.controller','get','put','/:id','update','/download_log_file','isAuthenticated','downloadLogFile','exports','util'];(function(_0x54a374,_0x141ce7){var _0xfcf44a=function(_0x3debf8){while(--_0x3debf8){_0x54a374['push'](_0x54a374['shift']());}};_0xfcf44a(++_0x141ce7);}(_0x1118,0x185));var _0x8111=function(_0x8398e,_0x4c4c65){_0x8398e=_0x8398e-0x0;var _0x308305=_0x1118[_0x8398e];return _0x308305;};'use strict';var multer=require('multer');var util=require(_0x8111('0x0'));var path=require(_0x8111('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8111('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8111('0x3'));var controller=require(_0x8111('0x4'));router[_0x8111('0x5')]('/',controller['index']);router[_0x8111('0x6')](_0x8111('0x7'),auth['isAuthenticated'](),controller[_0x8111('0x8')]);router[_0x8111('0x5')](_0x8111('0x9'),auth[_0x8111('0xa')](),controller[_0x8111('0xb')]);module[_0x8111('0xc')]=router; \ No newline at end of file +var _0xe041=['index','put','isAuthenticated','downloadLogFile','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x18a1e8,_0x20ced8){var _0x484ee8=function(_0x245779){while(--_0x245779){_0x18a1e8['push'](_0x18a1e8['shift']());}};_0x484ee8(++_0x20ced8);}(_0xe041,0x1a4));var _0x1e04=function(_0x57e924,_0x2916a5){_0x57e924=_0x57e924-0x0;var _0x262cc2=_0xe041[_0x57e924];return _0x262cc2;};'use strict';var multer=require(_0x1e04('0x0'));var util=require(_0x1e04('0x1'));var path=require(_0x1e04('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1e04('0x3')]();var fs_extra=require(_0x1e04('0x4'));var auth=require(_0x1e04('0x5'));var interaction=require(_0x1e04('0x6'));var config=require(_0x1e04('0x7'));var controller=require('./license.controller');router[_0x1e04('0x8')]('/',controller[_0x1e04('0x9')]);router[_0x1e04('0xa')]('/:id',auth[_0x1e04('0xb')](),controller['update']);router[_0x1e04('0x8')]('/download_log_file',auth['isAuthenticated'](),controller[_0x1e04('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 91071ad..055e570 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 _0x1e5f=['exports','TEXT','STRING','INTEGER'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1e5f,0x1c4));var _0xf1e5=function(_0x1261c2,_0x3ef819){_0x1261c2=_0x1261c2-0x0;var _0x3aabd2=_0x1e5f[_0x1261c2];return _0x3aabd2;};'use strict';var Sequelize=require('sequelize');module[_0xf1e5('0x0')]={'license':{'type':Sequelize[_0xf1e5('0x1')]},'data1':{'type':Sequelize[_0xf1e5('0x2')]},'data2':{'type':Sequelize[_0xf1e5('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xf1e5('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x107f=['exports','TEXT','STRING','sequelize'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x107f,0x1b7));var _0xf107=function(_0x450cfe,_0x349562){_0x450cfe=_0x450cfe-0x0;var _0x3806ad=_0x107f[_0x450cfe];return _0x3806ad;};'use strict';var Sequelize=require(_0xf107('0x0'));module[_0xf107('0x1')]={'license':{'type':Sequelize[_0xf107('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xf107('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'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 a5ab05a..bbb27e5 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 _0xa837=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','set','Content-Range','apply','reject','update','then','error','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','options','getLicense','catch','body','find','params','get','key','demo','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','attachment;\x20filename=','text/plain','download','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xa837,0xbb));var _0x7a83=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa837[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x7a83('0x0'));var rimraf=require(_0x7a83('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7a83('0x2'));var rp=require(_0x7a83('0x3'));var moment=require('moment');var BPromise=require(_0x7a83('0x4'));var Mustache=require('mustache');var util=require(_0x7a83('0x5'));var path=require(_0x7a83('0x6'));var sox=require('sox');var csv=require(_0x7a83('0x7'));var ejs=require(_0x7a83('0x8'));var fs=require('fs');var fs_extra=require(_0x7a83('0x9'));var _=require(_0x7a83('0xa'));var squel=require('squel');var crypto=require(_0x7a83('0xb'));var jsforce=require(_0x7a83('0xc'));var deskjs=require(_0x7a83('0xd'));var toCsv=require(_0x7a83('0x7'));var querystring=require('querystring');var Papa=require(_0x7a83('0xe'));var Redis=require('ioredis');var authService=require(_0x7a83('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7a83('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7a83('0x11'))(_0x7a83('0x12'));var utils=require(_0x7a83('0x13'));var config=require(_0x7a83('0x14'));var licenseUtil=require(_0x7a83('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x424dee,_0x75c78b){_0x75c78b=_0x75c78b||0xcc;return function(_0x4617ab){if(_0x4617ab){return _0x424dee[_0x7a83('0x16')](_0x75c78b);}return _0x424dee['status'](_0x75c78b)[_0x7a83('0x17')]();};}function respondWithResult(_0x226d75,_0x590778){_0x590778=_0x590778||0xc8;return function(_0xc4dad3){if(_0xc4dad3){return _0x226d75[_0x7a83('0x18')](_0x590778)[_0x7a83('0x19')](_0xc4dad3);}};}function respondWithFilteredResult(_0x2128f2,_0x1fced0){return function(_0x434fbd){if(_0x434fbd){var _0x2da283=typeof _0x1fced0[_0x7a83('0x1a')]==='undefined'&&typeof _0x1fced0[_0x7a83('0x1b')]===_0x7a83('0x1c');var _0x583c05=_0x434fbd['count'];var _0x46aa62=_0x2da283?0x0:_0x1fced0[_0x7a83('0x1a')];var _0xaefeda=_0x2da283?_0x434fbd['count']:_0x1fced0[_0x7a83('0x1a')]+_0x1fced0[_0x7a83('0x1b')];var _0x4eff21;if(_0xaefeda>=_0x583c05){_0xaefeda=_0x583c05;_0x4eff21=0xc8;}else{_0x4eff21=0xce;}_0x2128f2[_0x7a83('0x18')](_0x4eff21);return _0x2128f2[_0x7a83('0x1d')](_0x7a83('0x1e'),_0x46aa62+'-'+_0xaefeda+'/'+_0x583c05)[_0x7a83('0x19')](_0x434fbd);}return null;};}function patchUpdates(_0x36d4af){return function(_0x141d2c){try{jsonpatch[_0x7a83('0x1f')](_0x141d2c,_0x36d4af,!![]);}catch(_0x3cc775){return BPromise[_0x7a83('0x20')](_0x3cc775);}return _0x141d2c['save']();};}function saveUpdates(_0x5e90ad,_0x43cccb){return function(_0x481295){if(_0x481295){return _0x481295[_0x7a83('0x21')](_0x5e90ad)[_0x7a83('0x22')](function(_0x3c9c23){return _0x3c9c23;});}return null;};}function removeEntity(_0x54ffbd,_0x177005){return function(_0xadfb8c){if(_0xadfb8c){return _0xadfb8c['destroy']()['then'](function(){_0x54ffbd[_0x7a83('0x18')](0xcc)[_0x7a83('0x17')]();});}};}function handleEntityNotFound(_0x423604,_0x19c29d){return function(_0x4b4a78){if(!_0x4b4a78){_0x423604[_0x7a83('0x16')](0x194);}return _0x4b4a78;};}function handleError(_0xbece4c,_0xd5dbda){_0xd5dbda=_0xd5dbda||0x1f4;return function(_0x299a10){logger[_0x7a83('0x23')](_0x299a10['stack']);if(_0x299a10[_0x7a83('0x24')]){delete _0x299a10[_0x7a83('0x24')];}_0xbece4c[_0x7a83('0x18')](_0xd5dbda)[_0x7a83('0x25')](_0x299a10);};}var utilLicense=require(_0x7a83('0x15'));exports[_0x7a83('0x26')]=function(_0x3cc154,_0x2ce156){var _0x4d5224={'raw':!![],'where':{'id':0x1}},_0x321dbc={};_0x321dbc[_0x7a83('0x27')]=_[_0x7a83('0x28')](db[_0x7a83('0x29')][_0x7a83('0x2a')]);_0x321dbc['query']=_[_0x7a83('0x28')](_0x3cc154[_0x7a83('0x2b')]);_0x321dbc[_0x7a83('0x2c')]=_[_0x7a83('0x2d')](_0x321dbc['model'],_0x321dbc[_0x7a83('0x2b')]);_0x4d5224[_0x7a83('0x2e')]=_[_0x7a83('0x2d')](_0x321dbc['model'],qs['fields'](_0x3cc154['query'][_0x7a83('0x2f')]));_0x4d5224['attributes']=_0x4d5224[_0x7a83('0x2e')][_0x7a83('0x30')]?_0x4d5224[_0x7a83('0x2e')]:_0x321dbc[_0x7a83('0x27')];_0x4d5224=_['merge']({},_0x4d5224,_0x3cc154[_0x7a83('0x31')]);return utilLicense[_0x7a83('0x32')](_0x4d5224)[_0x7a83('0x22')](respondWithResult(_0x2ce156,null))[_0x7a83('0x33')](handleError(_0x2ce156,null));};exports[_0x7a83('0x21')]=function(_0x536b2a,_0x3a52aa){if(_0x536b2a[_0x7a83('0x34')]['id']){delete _0x536b2a[_0x7a83('0x34')]['id'];}return db[_0x7a83('0x29')][_0x7a83('0x35')]({'where':{'id':_0x536b2a[_0x7a83('0x36')]['id']}})[_0x7a83('0x22')](handleEntityNotFound(_0x3a52aa,null))['then'](function(_0x160ee3){var _0x597e20=_0x160ee3[_0x7a83('0x37')]({'plain':!![]});return utilLicense['checkLicense'](_0x597e20,_0x536b2a[_0x7a83('0x34')][_0x7a83('0x38')]);})[_0x7a83('0x22')](function(_0x26d203){if(!_0x26d203[_0x7a83('0x39')]){return saveUpdates(_0x536b2a['body'],null);}return _0x26d203;})[_0x7a83('0x22')](respondWithResult(_0x3a52aa,null))[_0x7a83('0x33')](handleError(_0x3a52aa,null));};exports[_0x7a83('0x3a')]=function(_0x32d27c,_0xd70fa3){var _0x47796a=_0x7a83('0x3b');var _0x22fef8=path[_0x7a83('0x3c')](_0x7a83('0x3d'),_0x7a83('0x3e'),_0x7a83('0x3f'),_0x47796a);_0xd70fa3[_0x7a83('0x40')]('Content-disposition',_0x7a83('0x41')+_0x47796a);_0xd70fa3['set']('Content-Type',_0x7a83('0x42'));_0xd70fa3[_0x7a83('0x43')](_0x22fef8);}; \ No newline at end of file +var _0x7413=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','catch','update','body','params','get','checkLicense','key','demo','join','/var','log','xcally','Content-disposition','attachment;\x20filename=','Content-Type','download','eml-format','moment','bluebird','util','to-csv','fs-extra','lodash','squel','jsforce','papaparse','ioredis'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x7413,0x1dd));var _0x3741=function(_0xed269c,_0x33bdf4){_0xed269c=_0xed269c-0x0;var _0x4b6cf1=_0x7413[_0xed269c];return _0x4b6cf1;};'use strict';var emlformat=require(_0x3741('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3741('0x1'));var BPromise=require(_0x3741('0x2'));var Mustache=require('mustache');var util=require(_0x3741('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x3741('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3741('0x5'));var _=require(_0x3741('0x6'));var squel=require(_0x3741('0x7'));var crypto=require('crypto');var jsforce=require(_0x3741('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x3741('0x4'));var querystring=require('querystring');var Papa=require(_0x3741('0x9'));var Redis=require(_0x3741('0xa'));var authService=require(_0x3741('0xb'));var qs=require(_0x3741('0xc'));var as=require(_0x3741('0xd'));var hardwareService=require(_0x3741('0xe'));var logger=require(_0x3741('0xf'))(_0x3741('0x10'));var utils=require(_0x3741('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x3741('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5aeff8,_0x55cf6f){_0x55cf6f=_0x55cf6f||0xcc;return function(_0x2af8b2){if(_0x2af8b2){return _0x5aeff8[_0x3741('0x13')](_0x55cf6f);}return _0x5aeff8[_0x3741('0x14')](_0x55cf6f)[_0x3741('0x15')]();};}function respondWithResult(_0x47ee04,_0x19ca62){_0x19ca62=_0x19ca62||0xc8;return function(_0x13353f){if(_0x13353f){return _0x47ee04[_0x3741('0x14')](_0x19ca62)[_0x3741('0x16')](_0x13353f);}};}function respondWithFilteredResult(_0x4ebcf6,_0x1ab12d){return function(_0x812d5e){if(_0x812d5e){var _0x28e276=typeof _0x1ab12d[_0x3741('0x17')]===_0x3741('0x18')&&typeof _0x1ab12d[_0x3741('0x19')]==='undefined';var _0x306453=_0x812d5e['count'];var _0x23c862=_0x28e276?0x0:_0x1ab12d['offset'];var _0x3200f5=_0x28e276?_0x812d5e['count']:_0x1ab12d[_0x3741('0x17')]+_0x1ab12d[_0x3741('0x19')];var _0x497bf3;if(_0x3200f5>=_0x306453){_0x3200f5=_0x306453;_0x497bf3=0xc8;}else{_0x497bf3=0xce;}_0x4ebcf6[_0x3741('0x14')](_0x497bf3);return _0x4ebcf6[_0x3741('0x1a')](_0x3741('0x1b'),_0x23c862+'-'+_0x3200f5+'/'+_0x306453)[_0x3741('0x16')](_0x812d5e);}return null;};}function patchUpdates(_0x555b13){return function(_0x11c9b0){try{jsonpatch[_0x3741('0x1c')](_0x11c9b0,_0x555b13,!![]);}catch(_0x2843c3){return BPromise[_0x3741('0x1d')](_0x2843c3);}return _0x11c9b0['save']();};}function saveUpdates(_0x43013c,_0x15510d){return function(_0x2bd9e8){if(_0x2bd9e8){return _0x2bd9e8['update'](_0x43013c)[_0x3741('0x1e')](function(_0x5bb9cf){return _0x5bb9cf;});}return null;};}function removeEntity(_0x451284,_0x246be5){return function(_0x1edda9){if(_0x1edda9){return _0x1edda9[_0x3741('0x1f')]()['then'](function(){_0x451284['status'](0xcc)[_0x3741('0x15')]();});}};}function handleEntityNotFound(_0x507439,_0xbde400){return function(_0x30a8ce){if(!_0x30a8ce){_0x507439[_0x3741('0x13')](0x194);}return _0x30a8ce;};}function handleError(_0x5c4baa,_0x49eba5){_0x49eba5=_0x49eba5||0x1f4;return function(_0xb929b2){logger[_0x3741('0x20')](_0xb929b2['stack']);if(_0xb929b2[_0x3741('0x21')]){delete _0xb929b2['name'];}_0x5c4baa[_0x3741('0x14')](_0x49eba5)[_0x3741('0x22')](_0xb929b2);};}var utilLicense=require(_0x3741('0x12'));exports[_0x3741('0x23')]=function(_0x9e3d8f,_0x20f187){var _0x953a68={'raw':!![],'where':{'id':0x1}},_0x43f8b4={};_0x43f8b4[_0x3741('0x24')]=_[_0x3741('0x25')](db[_0x3741('0x26')][_0x3741('0x27')]);_0x43f8b4[_0x3741('0x28')]=_[_0x3741('0x25')](_0x9e3d8f['query']);_0x43f8b4[_0x3741('0x29')]=_[_0x3741('0x2a')](_0x43f8b4[_0x3741('0x24')],_0x43f8b4[_0x3741('0x28')]);_0x953a68[_0x3741('0x2b')]=_[_0x3741('0x2a')](_0x43f8b4[_0x3741('0x24')],qs[_0x3741('0x2c')](_0x9e3d8f['query']['fields']));_0x953a68['attributes']=_0x953a68[_0x3741('0x2b')]['length']?_0x953a68[_0x3741('0x2b')]:_0x43f8b4[_0x3741('0x24')];_0x953a68=_['merge']({},_0x953a68,_0x9e3d8f['options']);return utilLicense['getLicense'](_0x953a68)[_0x3741('0x1e')](respondWithResult(_0x20f187,null))[_0x3741('0x2d')](handleError(_0x20f187,null));};exports[_0x3741('0x2e')]=function(_0x358cdb,_0x1c87d6){if(_0x358cdb['body']['id']){delete _0x358cdb[_0x3741('0x2f')]['id'];}return db[_0x3741('0x26')]['find']({'where':{'id':_0x358cdb[_0x3741('0x30')]['id']}})['then'](handleEntityNotFound(_0x1c87d6,null))[_0x3741('0x1e')](function(_0x1ec11d){var _0x417e24=_0x1ec11d[_0x3741('0x31')]({'plain':!![]});return utilLicense[_0x3741('0x32')](_0x417e24,_0x358cdb['body'][_0x3741('0x33')]);})['then'](function(_0x49de44){if(!_0x49de44[_0x3741('0x34')]){return saveUpdates(_0x358cdb[_0x3741('0x2f')],null);}return _0x49de44;})[_0x3741('0x1e')](respondWithResult(_0x1c87d6,null))[_0x3741('0x2d')](handleError(_0x1c87d6,null));};exports['downloadLogFile']=function(_0x273173,_0x30a317){var _0x1f8450='license-info.log';var _0x2bc366=path[_0x3741('0x35')](_0x3741('0x36'),_0x3741('0x37'),_0x3741('0x38'),_0x1f8450);_0x30a317['setHeader'](_0x3741('0x39'),_0x3741('0x3a')+_0x1f8450);_0x30a317['set'](_0x3741('0x3b'),'text/plain');_0x30a317[_0x3741('0x3c')](_0x2bc366);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index d6ad399..e1dff32 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 _0x01e8=['exports','License','license','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x11a289,_0x54b41c){var _0x224679=function(_0x4c972c){while(--_0x4c972c){_0x11a289['push'](_0x11a289['shift']());}};_0x224679(++_0x54b41c);}(_0x01e8,0xfd));var _0x801e=function(_0x137ae3,_0x4e93bf){_0x137ae3=_0x137ae3-0x0;var _0x3de34c=_0x01e8[_0x137ae3];return _0x3de34c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x801e('0x0'));var moment=require(_0x801e('0x1'));var BPromise=require(_0x801e('0x2'));var rp=require(_0x801e('0x3'));var fs=require('fs');var path=require(_0x801e('0x4'));var rimraf=require(_0x801e('0x5'));var config=require(_0x801e('0x6'));var attributes=require('./license.attributes');module[_0x801e('0x7')]=function(_0x2a46a7,_0x34df4b){return _0x2a46a7['define'](_0x801e('0x8'),attributes,{'tableName':_0x801e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec36=['api','moment','bluebird','request-promise','./license.attributes','exports','define','License','lodash','../../config/logger'];(function(_0x22de67,_0x3922e9){var _0x4cafed=function(_0x2e9b33){while(--_0x2e9b33){_0x22de67['push'](_0x22de67['shift']());}};_0x4cafed(++_0x3922e9);}(_0xec36,0xda));var _0x6ec3=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xec36[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0x6ec3('0x0'));var util=require('util');var logger=require(_0x6ec3('0x1'))(_0x6ec3('0x2'));var moment=require(_0x6ec3('0x3'));var BPromise=require(_0x6ec3('0x4'));var rp=require(_0x6ec3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6ec3('0x6'));module[_0x6ec3('0x7')]=function(_0x2777f4,_0x3c401f){return _0x2777f4[_0x6ec3('0x8')](_0x6ec3('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index a737083..1a7d4fe 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 _0x2f14=['debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','License,\x20%s,\x20%s'];(function(_0x2db99a,_0x17e133){var _0x125d3f=function(_0x1edf01){while(--_0x1edf01){_0x2db99a['push'](_0x2db99a['shift']());}};_0x125d3f(++_0x17e133);}(_0x2f14,0x1bd));var _0x42f1=function(_0x2823a4,_0x247595){_0x2823a4=_0x2823a4-0x0;var _0x360727=_0x2f14[_0x2823a4];return _0x360727;};'use strict';var _=require('lodash');var util=require(_0x42f1('0x0'));var moment=require(_0x42f1('0x1'));var BPromise=require(_0x42f1('0x2'));var rs=require(_0x42f1('0x3'));var fs=require('fs');var Redis=require(_0x42f1('0x4'));var db=require(_0x42f1('0x5'))['db'];var utils=require(_0x42f1('0x6'));var logger=require(_0x42f1('0x7'))(_0x42f1('0x8'));var config=require(_0x42f1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x42f1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x541b5a,_0x3e6ad8,_0x276124){return new BPromise(function(_0x5375b1,_0x142848){return client[_0x42f1('0xb')](_0x541b5a,_0x276124)[_0x42f1('0xc')](function(_0x291ee0){logger[_0x42f1('0xd')](_0x42f1('0xe'),_0x3e6ad8,'request\x20sent');logger[_0x42f1('0xf')](_0x42f1('0x10'),_0x3e6ad8,_0x42f1('0x11'),JSON['stringify'](_0x291ee0));if(_0x291ee0[_0x42f1('0x12')]){if(_0x291ee0[_0x42f1('0x12')][_0x42f1('0x13')]===0x1f4){logger['error'](_0x42f1('0xe'),_0x3e6ad8,_0x291ee0[_0x42f1('0x12')][_0x42f1('0x14')]);return _0x142848(_0x291ee0[_0x42f1('0x12')][_0x42f1('0x14')]);}logger['error'](_0x42f1('0xe'),_0x3e6ad8,_0x291ee0[_0x42f1('0x12')][_0x42f1('0x14')]);return _0x5375b1(_0x291ee0['error']['message']);}else{logger[_0x42f1('0xd')]('License,\x20%s,\x20%s',_0x3e6ad8,_0x42f1('0x11'));_0x5375b1(_0x291ee0[_0x42f1('0x15')]['message']);}})[_0x42f1('0x16')](function(_0x48b052){logger[_0x42f1('0x12')](_0x42f1('0xe'),_0x3e6ad8,_0x48b052);_0x142848(_0x48b052);});});} \ No newline at end of file +var _0x8206=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','License,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x897cb,_0x56ae0f){var _0x4966c8=function(_0x64f61f){while(--_0x64f61f){_0x897cb['push'](_0x897cb['shift']());}};_0x4966c8(++_0x56ae0f);}(_0x8206,0x158));var _0x6820=function(_0x4e3817,_0x6bcf14){_0x4e3817=_0x4e3817-0x0;var _0x159f8a=_0x8206[_0x4e3817];return _0x159f8a;};'use strict';var _=require(_0x6820('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6820('0x1'));var rs=require(_0x6820('0x2'));var fs=require('fs');var Redis=require(_0x6820('0x3'));var db=require(_0x6820('0x4'))['db'];var utils=require(_0x6820('0x5'));var logger=require(_0x6820('0x6'))(_0x6820('0x7'));var config=require(_0x6820('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6820('0x9')][_0x6820('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x228793,_0x31bdff,_0x427fef){return new BPromise(function(_0x46c075,_0x483a45){return client[_0x6820('0xb')](_0x228793,_0x427fef)[_0x6820('0xc')](function(_0x18d09d){logger[_0x6820('0xd')]('License,\x20%s,\x20%s',_0x31bdff,_0x6820('0xe'));logger[_0x6820('0xf')](_0x6820('0x10'),_0x31bdff,'request\x20sent',JSON[_0x6820('0x11')](_0x18d09d));if(_0x18d09d[_0x6820('0x12')]){if(_0x18d09d[_0x6820('0x12')]['code']===0x1f4){logger[_0x6820('0x12')](_0x6820('0x13'),_0x31bdff,_0x18d09d[_0x6820('0x12')][_0x6820('0x14')]);return _0x483a45(_0x18d09d[_0x6820('0x12')][_0x6820('0x14')]);}logger[_0x6820('0x12')](_0x6820('0x13'),_0x31bdff,_0x18d09d['error'][_0x6820('0x14')]);return _0x46c075(_0x18d09d[_0x6820('0x12')]['message']);}else{logger['info']('License,\x20%s,\x20%s',_0x31bdff,_0x6820('0xe'));_0x46c075(_0x18d09d[_0x6820('0x15')][_0x6820('0x14')]);}})[_0x6820('0x16')](function(_0x2ebc06){logger[_0x6820('0x12')](_0x6820('0x13'),_0x31bdff,_0x2ebc06);_0x483a45(_0x2ebc06);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 8087dd7..0905e6c 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 _0xe138=['verifySmtp','/:id/users','post','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','/:id/applications','addApplications','/:id/send','send','addAgents','put','removeDispositions','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./mailAccount.controller','get','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/messages','/:id/verify'];(function(_0x16c5a1,_0x1e5941){var _0x5eaad6=function(_0x466ada){while(--_0x466ada){_0x16c5a1['push'](_0x16c5a1['shift']());}};_0x5eaad6(++_0x1e5941);}(_0xe138,0x70));var _0x8e13=function(_0x430429,_0x20bd63){_0x430429=_0x430429-0x0;var _0x48f6a3=_0xe138[_0x430429];return _0x48f6a3;};'use strict';var multer=require(_0x8e13('0x0'));var util=require(_0x8e13('0x1'));var path=require('path');var timeout=require(_0x8e13('0x2'));var express=require(_0x8e13('0x3'));var router=express['Router']();var fs_extra=require(_0x8e13('0x4'));var auth=require(_0x8e13('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8e13('0x6'));router[_0x8e13('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x8e13('0x8')](),controller['describe']);router['get'](_0x8e13('0x9'),auth[_0x8e13('0x8')](),controller[_0x8e13('0xa')]);router[_0x8e13('0x7')](_0x8e13('0xb'),auth[_0x8e13('0x8')](),controller[_0x8e13('0xc')]);router['get'](_0x8e13('0xd'),auth[_0x8e13('0x8')](),controller[_0x8e13('0xe')]);router[_0x8e13('0x7')](_0x8e13('0xf'),auth[_0x8e13('0x8')](),controller[_0x8e13('0x10')]);router[_0x8e13('0x7')](_0x8e13('0x11'),auth[_0x8e13('0x8')](),controller[_0x8e13('0x12')]);router[_0x8e13('0x7')](_0x8e13('0x13'),auth[_0x8e13('0x8')](),controller[_0x8e13('0x14')]);router[_0x8e13('0x7')]('/:id/applications',auth[_0x8e13('0x8')](),controller['getApplications']);router[_0x8e13('0x7')](_0x8e13('0x15'),auth['isAuthenticated'](),controller['getMessages']);router[_0x8e13('0x7')](_0x8e13('0x16'),auth['isAuthenticated'](),controller[_0x8e13('0x17')]);router[_0x8e13('0x7')](_0x8e13('0x18'),auth[_0x8e13('0x8')](),controller['getAgents']);router[_0x8e13('0x19')](_0x8e13('0xb'),auth[_0x8e13('0x8')](),controller[_0x8e13('0x1a')]);router[_0x8e13('0x19')]('/:id/canned_answers',auth[_0x8e13('0x8')](),controller[_0x8e13('0x1b')]);router['post']('/',auth[_0x8e13('0x8')](),controller[_0x8e13('0x1c')]);router['post'](_0x8e13('0xf'),auth[_0x8e13('0x8')](),controller[_0x8e13('0x1d')]);router[_0x8e13('0x19')](_0x8e13('0x11'),auth[_0x8e13('0x8')](),controller[_0x8e13('0x1e')]);router[_0x8e13('0x19')](_0x8e13('0x13'),auth[_0x8e13('0x8')](),controller[_0x8e13('0x1f')]);router[_0x8e13('0x19')](_0x8e13('0x20'),auth[_0x8e13('0x8')](),controller[_0x8e13('0x21')]);router[_0x8e13('0x19')](_0x8e13('0x22'),auth[_0x8e13('0x8')](),controller[_0x8e13('0x23')]);router[_0x8e13('0x19')](_0x8e13('0x18'),auth['isAuthenticated'](),controller[_0x8e13('0x24')]);router[_0x8e13('0x25')]('/:id',auth[_0x8e13('0x8')](),controller['update']);router['delete'](_0x8e13('0xb'),auth['isAuthenticated'](),controller[_0x8e13('0x26')]);router[_0x8e13('0x27')](_0x8e13('0xd'),auth[_0x8e13('0x8')](),controller[_0x8e13('0x28')]);router[_0x8e13('0x27')](_0x8e13('0xf'),auth[_0x8e13('0x8')](),controller[_0x8e13('0x29')]);router['delete'](_0x8e13('0x11'),auth[_0x8e13('0x8')](),controller[_0x8e13('0x2a')]);router['delete'](_0x8e13('0x9'),auth[_0x8e13('0x8')](),controller[_0x8e13('0x2b')]);router[_0x8e13('0x27')]('/:id/users',auth[_0x8e13('0x8')](),controller[_0x8e13('0x2c')]);module['exports']=router; \ No newline at end of file +var _0x7019=['Router','fs-extra','../../config/environment','get','index','isAuthenticated','describe','show','/:id/dispositions','/:id/canned_answers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','post','addDisposition','addSmtp','addApplications','addAgents','put','/:id','delete','removeDispositions','removeAnswers','removeImap','/:id/out_servers','removeSmtp','destroy','removeAgents','exports','multer','util','connect-timeout','express'];(function(_0x208224,_0x389732){var _0x5f0b1e=function(_0x3daa25){while(--_0x3daa25){_0x208224['push'](_0x208224['shift']());}};_0x5f0b1e(++_0x389732);}(_0x7019,0x196));var _0x9701=function(_0x190682,_0x398101){_0x190682=_0x190682-0x0;var _0x17e720=_0x7019[_0x190682];return _0x17e720;};'use strict';var multer=require(_0x9701('0x0'));var util=require(_0x9701('0x1'));var path=require('path');var timeout=require(_0x9701('0x2'));var express=require(_0x9701('0x3'));var router=express[_0x9701('0x4')]();var fs_extra=require(_0x9701('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9701('0x6'));var controller=require('./mailAccount.controller');router[_0x9701('0x7')]('/',auth['isAuthenticated'](),controller[_0x9701('0x8')]);router[_0x9701('0x7')]('/describe',auth[_0x9701('0x9')](),controller[_0x9701('0xa')]);router[_0x9701('0x7')]('/:id',auth[_0x9701('0x9')](),controller[_0x9701('0xb')]);router['get'](_0x9701('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x9701('0x7')](_0x9701('0xd'),auth[_0x9701('0x9')](),controller['getAnswers']);router['get'](_0x9701('0xe'),auth[_0x9701('0x9')](),controller[_0x9701('0xf')]);router['get']('/:id/out_servers',auth[_0x9701('0x9')](),controller[_0x9701('0x10')]);router[_0x9701('0x7')](_0x9701('0x11'),auth[_0x9701('0x9')](),controller[_0x9701('0x12')]);router[_0x9701('0x7')](_0x9701('0x13'),auth[_0x9701('0x9')](),controller['getApplications']);router['get'](_0x9701('0x14'),auth[_0x9701('0x9')](),controller[_0x9701('0x15')]);router[_0x9701('0x7')](_0x9701('0x16'),auth[_0x9701('0x9')](),controller['verifySmtp']);router[_0x9701('0x7')](_0x9701('0x17'),auth[_0x9701('0x9')](),controller[_0x9701('0x18')]);router[_0x9701('0x19')](_0x9701('0xc'),auth['isAuthenticated'](),controller[_0x9701('0x1a')]);router['post'](_0x9701('0xd'),auth[_0x9701('0x9')](),controller['addAnswer']);router[_0x9701('0x19')]('/',auth[_0x9701('0x9')](),controller['create']);router['post'](_0x9701('0xe'),auth[_0x9701('0x9')](),controller['addImap']);router[_0x9701('0x19')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x9701('0x1b')]);router[_0x9701('0x19')](_0x9701('0x11'),auth[_0x9701('0x9')](),controller['addInteraction']);router[_0x9701('0x19')](_0x9701('0x13'),auth[_0x9701('0x9')](),controller[_0x9701('0x1c')]);router[_0x9701('0x19')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0x9701('0x19')]('/:id/users',auth['isAuthenticated'](),controller[_0x9701('0x1d')]);router[_0x9701('0x1e')](_0x9701('0x1f'),auth[_0x9701('0x9')](),controller['update']);router[_0x9701('0x20')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x9701('0x21')]);router['delete'](_0x9701('0xd'),auth['isAuthenticated'](),controller[_0x9701('0x22')]);router['delete']('/:id/in_servers',auth[_0x9701('0x9')](),controller[_0x9701('0x23')]);router[_0x9701('0x20')](_0x9701('0x24'),auth[_0x9701('0x9')](),controller[_0x9701('0x25')]);router[_0x9701('0x20')](_0x9701('0x1f'),auth['isAuthenticated'](),controller[_0x9701('0x26')]);router[_0x9701('0x20')](_0x9701('0x17'),auth[_0x9701('0x9')](),controller[_0x9701('0x27')]);module[_0x9701('0x28')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 713ac9c..5b98e5c 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 _0xc39b=['sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','ENUM','yahoo','outlook365','getDataValue','provider'];(function(_0x597c7e,_0x46ad1f){var _0x3ae5fc=function(_0x137d24){while(--_0x137d24){_0x597c7e['push'](_0x597c7e['shift']());}};_0x3ae5fc(++_0x46ad1f);}(_0xc39b,0x88));var _0xbc39=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xc39b[_0x476bf4];return _0x788ffe;};'use strict';var Sequelize=require(_0xbc39('0x0'));module[_0xbc39('0x1')]={'description':{'type':Sequelize[_0xbc39('0x2')]},'name':{'type':Sequelize[_0xbc39('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xbc39('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xbc39('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xbc39('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xbc39('0x4')]},'markAsUnread':{'type':Sequelize[_0xbc39('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xbc39('0x2')],'allowNull':![],'defaultValue':_0xbc39('0x5')},'fontSize':{'type':Sequelize[_0xbc39('0x6')](0x2)[_0xbc39('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xbc39('0x4')],'defaultValue':function(){return _0xbc39('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbc39('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbc39('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbc39('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbc39('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xbc39('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x464985){if(!_0x464985)this[_0xbc39('0xa')](_0xbc39('0xb'),null);this[_0xbc39('0xa')]('mandatoryDisposition',_0x464985);}},'provider':{'type':Sequelize[_0xbc39('0xc')]('gmail','hotmail',_0xbc39('0xd'),_0xbc39('0xe')),'defaultValue':null,'get':function(){var _0x5aa2a9=this[_0xbc39('0xf')](_0xbc39('0x10'));return _0x5aa2a9||'custom';},'set':function(_0x530793){if(_0x530793==='custom'){_0x530793=null;}return this[_0xbc39('0xa')](_0xbc39('0x10'),_0x530793);}}}; \ No newline at end of file +var _0xfec4=['exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','gmail','hotmail','yahoo','getDataValue','provider','custom'];(function(_0x41dd01,_0x3287fe){var _0x1b2a58=function(_0x399d16){while(--_0x399d16){_0x41dd01['push'](_0x41dd01['shift']());}};_0x1b2a58(++_0x3287fe);}(_0xfec4,0x77));var _0x4fec=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0xfec4[_0x292f93];return _0x5a94b1;};'use strict';var Sequelize=require('sequelize');module[_0x4fec('0x0')]={'description':{'type':Sequelize[_0x4fec('0x1')]},'name':{'type':Sequelize[_0x4fec('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x4fec('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x4fec('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x4fec('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x4fec('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x4fec('0x3')]},'markAsUnread':{'type':Sequelize[_0x4fec('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x4fec('0x1')],'allowNull':![],'defaultValue':_0x4fec('0x4')},'fontSize':{'type':Sequelize[_0x4fec('0x5')](0x2)[_0x4fec('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x4fec('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x4fec('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4fec('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4fec('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4fec('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4fec('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4fec('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4fec('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4fec('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4fec('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x4fec('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x4fec('0x2')],'defaultValue':![],'comment':_0x4fec('0x8'),'set':function(_0x5352cb){if(!_0x5352cb)this[_0x4fec('0x9')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x4fec('0xa'),_0x5352cb);}},'provider':{'type':Sequelize['ENUM'](_0x4fec('0xb'),_0x4fec('0xc'),_0x4fec('0xd'),'outlook365'),'defaultValue':null,'get':function(){var _0x303d36=this[_0x4fec('0xe')](_0x4fec('0xf'));return _0x303d36||_0x4fec('0x10');},'set':function(_0x5bb07c){if(_0x5bb07c===_0x4fec('0x10')){_0x5bb07c=null;}return this[_0x4fec('0x9')](_0x4fec('0xf'),_0x5bb07c);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 2326598..c7f2e6b 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 _0x49bc=['removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','Owner','internal','Tags','color','tag','addApplications','sequelize','transaction','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','inlineCss','CmList','List','CmContact','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','sendMail','List\x20not\x20found','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','bluebird','util','lodash','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','then','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MailAccount,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','undefined','limit','count','update','get','MailAccounts','UserProfileResource','destroy','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','user','username','password','pass','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','options','find','body','provider','modernAuthentication','params','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','rows'];(function(_0x293c52,_0x2af2f0){var _0x495c9d=function(_0x570975){while(--_0x570975){_0x293c52['push'](_0x293c52['shift']());}};_0x495c9d(++_0x2af2f0);}(_0x49bc,0x1df));var _0xc49b=function(_0x426dcf,_0x105f82){_0x426dcf=_0x426dcf-0x0;var _0x1d8bf8=_0x49bc[_0x426dcf];return _0x1d8bf8;};'use strict';var moment=require(_0xc49b('0x0'));var BPromise=require(_0xc49b('0x1'));var util=require(_0xc49b('0x2'));var path=require('path');var _=require(_0xc49b('0x3'));var juice=require('juice');var Redis=require(_0xc49b('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0xc49b('0x5'))(_0xc49b('0x6'));var config=require('../../config/environment');var db=require(_0xc49b('0x7'))['db'];config[_0xc49b('0x8')]=_[_0xc49b('0x9')](config[_0xc49b('0x8')],{'host':_0xc49b('0xa'),'port':0x18eb});var socket=require(_0xc49b('0xb'))(new Redis(config['redis']));require(_0xc49b('0xc'))[_0xc49b('0xd')](socket);var jayson=require(_0xc49b('0xe'));var client=jayson[_0xc49b('0xf')][_0xc49b('0x10')]({'port':0x232b});function respondWithRpcPromise(_0xc7ece,_0x1957ca,_0x325a69,_0x552425){return new BPromise(function(_0x4c7a52,_0x584baa){var _0x2343db=_0x552425||client;return _0x2343db['request'](_0xc7ece,_0x325a69)[_0xc49b('0x11')](function(_0x48c153){logger[_0xc49b('0x12')]('MailAccount,\x20%s,\x20%s',_0x1957ca,'request\x20sent');logger[_0xc49b('0x13')](_0xc49b('0x14'),_0x1957ca,_0xc49b('0x15'),JSON[_0xc49b('0x16')](_0x48c153));if(_0x48c153[_0xc49b('0x17')]){if(_0x48c153[_0xc49b('0x17')][_0xc49b('0x18')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x1957ca,_0x48c153['error'][_0xc49b('0x19')]);return _0x584baa(_0x48c153['error'][_0xc49b('0x19')]);}logger[_0xc49b('0x17')](_0xc49b('0x1a'),_0x1957ca,_0x48c153[_0xc49b('0x17')][_0xc49b('0x19')]);return _0x4c7a52(_0x48c153['error'][_0xc49b('0x19')]);}else{logger[_0xc49b('0x12')]('MailAccount,\x20%s,\x20%s',_0x1957ca,_0xc49b('0x15'));_0x4c7a52(_0x48c153['result'][_0xc49b('0x19')]);}})[_0xc49b('0x1b')](function(_0x1a3df3){logger['error'](_0xc49b('0x1a'),_0x1957ca,_0x1a3df3);_0x584baa(_0x1a3df3);});});}function respondWithStatusCode(_0x4104ea,_0x40d6b4){_0x40d6b4=_0x40d6b4||0xcc;return function(_0x482c21){if(_0x482c21){return _0x4104ea[_0xc49b('0x1c')](_0x40d6b4);}return _0x4104ea[_0xc49b('0x1d')](_0x40d6b4)[_0xc49b('0x1e')]();};}function respondWithResult(_0x47324e,_0x1344ba){_0x1344ba=_0x1344ba||0xc8;return function(_0x1bedab){if(_0x1bedab){return _0x47324e[_0xc49b('0x1d')](_0x1344ba)[_0xc49b('0x1f')](_0x1bedab);}};}function respondWithFilteredResult(_0x23b87d,_0x51348f){return function(_0x577eaf){if(_0x577eaf){var _0x58a82e=typeof _0x51348f[_0xc49b('0x20')]===_0xc49b('0x21')&&typeof _0x51348f[_0xc49b('0x22')]==='undefined';var _0x3daa10=_0x577eaf[_0xc49b('0x23')];var _0x33db17=_0x58a82e?0x0:_0x51348f[_0xc49b('0x20')];var _0x12202d=_0x58a82e?_0x577eaf[_0xc49b('0x23')]:_0x51348f[_0xc49b('0x20')]+_0x51348f['limit'];var _0x3991d8;if(_0x12202d>=_0x3daa10){_0x12202d=_0x3daa10;_0x3991d8=0xc8;}else{_0x3991d8=0xce;}_0x23b87d[_0xc49b('0x1d')](_0x3991d8);return _0x23b87d['set']('Content-Range',_0x33db17+'-'+_0x12202d+'/'+_0x3daa10)['json'](_0x577eaf);}return null;};}function saveUpdates(_0x593c66){return function(_0x528bf0){if(_0x528bf0){return _0x528bf0[_0xc49b('0x24')](_0x593c66)['then'](function(_0x3486bf){return _0x3486bf;});}return null;};}function removeEntity(_0x2d174a){return function(_0x58830d){if(_0x58830d){return _0x58830d['destroy']()[_0xc49b('0x11')](function(){var _0x4419bc=_0x58830d[_0xc49b('0x25')]({'plain':!![]});var _0x51416b=_0xc49b('0x26');return db[_0xc49b('0x27')][_0xc49b('0x28')]({'where':{'type':_0x51416b,'resourceId':_0x4419bc['id']}})[_0xc49b('0x11')](function(){return _0x58830d;});})[_0xc49b('0x11')](function(){_0x2d174a[_0xc49b('0x1d')](0xcc)[_0xc49b('0x1e')]();});}};}function handleEntityNotFound(_0x21bd28){return function(_0x525023){if(!_0x525023){_0x21bd28[_0xc49b('0x1c')](0x194);}return _0x525023;};}function handleError(_0x2b69a2,_0x329308){_0x329308=_0x329308||0x1f4;return function(_0x479448){logger[_0xc49b('0x17')](_0x479448[_0xc49b('0x29')]);if(_0x479448[_0xc49b('0x2a')]){delete _0x479448[_0xc49b('0x2a')];}_0x2b69a2['status'](_0x329308)[_0xc49b('0x2b')](_0x479448);};}function getImapHost(_0x282e07){switch(_0x282e07){case _0xc49b('0x2c'):return _0xc49b('0x2d');case _0xc49b('0x2e'):return _0xc49b('0x2f');case _0xc49b('0x30'):return _0xc49b('0x31');case _0xc49b('0x32'):return _0xc49b('0x33');}throw new Error(_0xc49b('0x34'),_0x282e07);}function getSmtpHost(_0x2f8c94){switch(_0x2f8c94){case _0xc49b('0x2c'):return _0xc49b('0x35');case _0xc49b('0x2e'):return _0xc49b('0x36');case _0xc49b('0x30'):return'smtp-mail.outlook.com';case _0xc49b('0x32'):return'smtp.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x2f8c94);}function getAuthenticationOptions(_0x54e0cf,_0x29124c){var _0x1b3d5e={};var _0x10299f={};if(_0x54e0cf){_0x1b3d5e[_0xc49b('0x37')]=_0x10299f[_0xc49b('0x37')]=_0x29124c[_0xc49b('0x38')];_0x1b3d5e[_0xc49b('0x39')]=_0x10299f[_0xc49b('0x3a')]=_0x29124c[_0xc49b('0x39')];if(_0x29124c['modernAuthentication']){_0x1b3d5e['modernAuthentication']=_0x10299f['modernAuthentication']=!![];_0x1b3d5e[_0xc49b('0x3b')]=_0x10299f[_0xc49b('0x3b')]=_0x29124c['CloudProviderId'];_0x1b3d5e[_0xc49b('0x39')]=_0x10299f['pass']=null;}else{_0x1b3d5e['CloudProviderId']=_0x10299f[_0xc49b('0x3b')]=null;}_0x1b3d5e[_0xc49b('0x3c')]=getImapHost(_0x54e0cf);_0x1b3d5e[_0xc49b('0x3d')]=0x3e1;_0x10299f[_0xc49b('0x3c')]=getSmtpHost(_0x54e0cf);_0x10299f['port']=0x24b;_0x10299f[_0xc49b('0x3e')]=![];_0x1b3d5e[_0xc49b('0x3f')]=_0x10299f['service']=null;}else{if(_0x29124c['authentication']){_0x1b3d5e[_0xc49b('0x37')]=_0x10299f[_0xc49b('0x37')]=_0x29124c[_0xc49b('0x38')];_0x1b3d5e[_0xc49b('0x39')]=_0x10299f['pass']=_0x29124c[_0xc49b('0x39')];}else{_0x1b3d5e[_0xc49b('0x40')]=_0x10299f[_0xc49b('0x40')]=![];_0x1b3d5e[_0xc49b('0x37')]=_0x10299f[_0xc49b('0x37')]=null;_0x1b3d5e['password']=_0x10299f[_0xc49b('0x3a')]=null;}_0x1b3d5e['host']=_0x29124c[_0xc49b('0x41')]['host'];_0x1b3d5e[_0xc49b('0x3d')]=_0x29124c[_0xc49b('0x41')][_0xc49b('0x3d')];_0x10299f['host']=_0x29124c[_0xc49b('0x42')][_0xc49b('0x3c')];_0x10299f[_0xc49b('0x3d')]=_0x29124c[_0xc49b('0x42')][_0xc49b('0x3d')];}return{'Imap':_0x1b3d5e,'Smtp':_0x10299f};}exports[_0xc49b('0x43')]=function(_0x1c9917,_0x2f7e5d){var _0x2b2305={'include':[{'model':db[_0xc49b('0x44')],'as':'Imap'},{'model':db[_0xc49b('0x45')],'as':'Smtp'},{'model':db[_0xc49b('0x46')],'as':_0xc49b('0x47')}]},_0x43920a={},_0x55c9fb={'count':0x0,'rows':[]};var _0x1fe76f=_[_0xc49b('0x48')](db[_0xc49b('0x49')][_0xc49b('0x4a')],function(_0x3be13c){return{'name':_0x3be13c[_0xc49b('0x4b')],'type':_0x3be13c[_0xc49b('0x4c')][_0xc49b('0x4d')]};});_0x43920a[_0xc49b('0x4e')]=_[_0xc49b('0x48')](_0x1fe76f,_0xc49b('0x2a'));_0x43920a['query']=_[_0xc49b('0x4f')](_0x1c9917[_0xc49b('0x50')]);_0x43920a[_0xc49b('0x51')]=_[_0xc49b('0x52')](_0x43920a[_0xc49b('0x4e')],_0x43920a[_0xc49b('0x50')]);_0x2b2305[_0xc49b('0x53')]=_[_0xc49b('0x52')](_0x43920a[_0xc49b('0x4e')],qs[_0xc49b('0x54')](_0x1c9917[_0xc49b('0x50')]['fields']));_0x2b2305[_0xc49b('0x53')]=_0x2b2305['attributes'][_0xc49b('0x55')]?_0x2b2305[_0xc49b('0x53')]:_0x43920a['model'];if(!_0x1c9917[_0xc49b('0x50')][_0xc49b('0x56')](_0xc49b('0x57'))){_0x2b2305[_0xc49b('0x22')]=qs[_0xc49b('0x22')](_0x1c9917[_0xc49b('0x50')][_0xc49b('0x22')]);_0x2b2305[_0xc49b('0x20')]=qs[_0xc49b('0x20')](_0x1c9917[_0xc49b('0x50')][_0xc49b('0x20')]);}_0x2b2305[_0xc49b('0x58')]=qs[_0xc49b('0x59')](_0x1c9917[_0xc49b('0x50')][_0xc49b('0x59')]);_0x2b2305['where']=qs['filters'](_[_0xc49b('0x5a')](_0x1c9917[_0xc49b('0x50')],_0x43920a[_0xc49b('0x51')]),_0x1fe76f);if(_0x1c9917[_0xc49b('0x50')][_0xc49b('0x5b')]){_0x2b2305[_0xc49b('0x5c')]=_[_0xc49b('0x5d')](_0x2b2305[_0xc49b('0x5c')],{'$or':_[_0xc49b('0x48')](_0x1fe76f,function(_0x571acb){if(_0x571acb[_0xc49b('0x4c')]!=='VIRTUAL'){var _0x5f49a9={};_0x5f49a9[_0x571acb[_0xc49b('0x2a')]]={'$like':'%'+_0x1c9917[_0xc49b('0x50')][_0xc49b('0x5b')]+'%'};return _0x5f49a9;}})});}_0x2b2305=_['merge']({},_0x2b2305,_0x1c9917['options']);var _0x19dae0={'where':_0x2b2305[_0xc49b('0x5c')]};return db[_0xc49b('0x49')]['count'](_0x19dae0)[_0xc49b('0x11')](function(_0x1213e5){_0x55c9fb[_0xc49b('0x23')]=_0x1213e5;if(_0x1c9917[_0xc49b('0x50')][_0xc49b('0x5e')]){_0x2b2305[_0xc49b('0x5f')]=[{'all':!![]}];}return db[_0xc49b('0x49')][_0xc49b('0x60')](_0x2b2305);})['then'](function(_0x2d1c1a){_0x55c9fb['rows']=_0x2d1c1a;return _0x55c9fb;})[_0xc49b('0x11')](respondWithFilteredResult(_0x2f7e5d,_0x2b2305))[_0xc49b('0x1b')](handleError(_0x2f7e5d,null));};exports['show']=function(_0x5206b2,_0x4f5042){var _0x2d6ba0={'raw':![],'where':{'id':_0x5206b2['params']['id']},'include':[{'model':db[_0xc49b('0x44')],'as':'Imap'},{'model':db[_0xc49b('0x45')],'as':_0xc49b('0x42')},{'model':db[_0xc49b('0x46')],'as':_0xc49b('0x47')}]},_0x110152={};_0x110152[_0xc49b('0x4e')]=_[_0xc49b('0x4f')](db['MailAccount'][_0xc49b('0x4a')]);_0x110152[_0xc49b('0x50')]=_['keys'](_0x5206b2[_0xc49b('0x50')]);_0x110152[_0xc49b('0x51')]=_[_0xc49b('0x52')](_0x110152['model'],_0x110152[_0xc49b('0x50')]);_0x2d6ba0['attributes']=_[_0xc49b('0x52')](_0x110152[_0xc49b('0x4e')],qs[_0xc49b('0x54')](_0x5206b2[_0xc49b('0x50')][_0xc49b('0x54')]));_0x2d6ba0[_0xc49b('0x53')]=_0x2d6ba0[_0xc49b('0x53')]['length']?_0x2d6ba0[_0xc49b('0x53')]:_0x110152[_0xc49b('0x4e')];if(_0x5206b2['query'][_0xc49b('0x5e')]){_0x2d6ba0[_0xc49b('0x5f')]=[{'all':!![]}];}_0x2d6ba0=_[_0xc49b('0x5d')]({},_0x2d6ba0,_0x5206b2[_0xc49b('0x61')]);return db[_0xc49b('0x49')][_0xc49b('0x62')](_0x2d6ba0)[_0xc49b('0x11')](handleEntityNotFound(_0x4f5042,null))[_0xc49b('0x11')](respondWithResult(_0x4f5042,null))[_0xc49b('0x1b')](handleError(_0x4f5042,null));};exports[_0xc49b('0x24')]=function(_0x35ceee,_0x27d851){if(_0x35ceee[_0xc49b('0x63')]['id']){delete _0x35ceee[_0xc49b('0x63')]['id'];}var _0x4f33cf=_0x35ceee[_0xc49b('0x63')][_0xc49b('0x64')]==='custom'?null:_0x35ceee[_0xc49b('0x63')][_0xc49b('0x64')];var _0x225ac3=_0x35ceee[_0xc49b('0x63')][_0xc49b('0x41')]||{};var _0x39e80a=_0x35ceee['body'][_0xc49b('0x42')]||{};if(_0x4f33cf){_0x225ac3[_0xc49b('0x3c')]=getImapHost(_0x4f33cf);_0x225ac3['port']=0x3e1;_0x39e80a[_0xc49b('0x3c')]=getSmtpHost(_0x4f33cf);_0x39e80a[_0xc49b('0x3d')]=0x24b;_0x39e80a[_0xc49b('0x3e')]=![];}if(_0x39e80a[_0xc49b('0x65')]){_0x39e80a[_0xc49b('0x3e')]=![];}else{_0x39e80a[_0xc49b('0x3b')]=null;}if(!_0x225ac3['modernAuthentication'])_0x225ac3[_0xc49b('0x3b')]=null;_0x35ceee['body']['Imap']=_0x225ac3;_0x35ceee['body'][_0xc49b('0x42')]=_0x39e80a;return db['MailAccount'][_0xc49b('0x62')]({'where':{'id':_0x35ceee[_0xc49b('0x66')]['id']},'include':[{'model':db[_0xc49b('0x44')],'as':_0xc49b('0x41')},{'model':db[_0xc49b('0x45')],'as':'Smtp'},{'model':db[_0xc49b('0x46')],'as':_0xc49b('0x47')}]})[_0xc49b('0x11')](handleEntityNotFound(_0x27d851,null))[_0xc49b('0x11')](function(_0x510ee9){if(!_0x510ee9)throw new Error(_0xc49b('0x67'));if(_0x510ee9['service'])delete _0x35ceee[_0xc49b('0x63')][_0xc49b('0x41')];return _0x510ee9;})['then'](saveUpdates(_0x35ceee[_0xc49b('0x63')],null))[_0xc49b('0x11')](function(_0x6101c1){if(!_0x35ceee[_0xc49b('0x63')][_0xc49b('0x41')])return _0x6101c1;return db[_0xc49b('0x44')][_0xc49b('0x24')](_0x35ceee[_0xc49b('0x63')][_0xc49b('0x41')],{'where':{'MailAccountId':_0x6101c1['id']}})[_0xc49b('0x11')](function(){return _0x6101c1;});})[_0xc49b('0x11')](function(_0x15b57d){if(!_0x35ceee[_0xc49b('0x63')]['Smtp'])return _0x15b57d;return db[_0xc49b('0x45')][_0xc49b('0x24')](_0x35ceee[_0xc49b('0x63')]['Smtp'],{'where':{'MailAccountId':_0x15b57d['id']}})[_0xc49b('0x11')](function(){return _0x15b57d;});})[_0xc49b('0x11')](respondWithResult(_0x27d851,null))[_0xc49b('0x1b')](handleError(_0x27d851,null));};exports[_0xc49b('0x68')]=function(_0x3330e5,_0xd661f6){return db[_0xc49b('0x49')][_0xc49b('0x68')]()[_0xc49b('0x11')](respondWithResult(_0xd661f6,null))['catch'](handleError(_0xd661f6,null));};exports[_0xc49b('0x69')]=function(_0x35389f,_0x277c0){if(_0x35389f[_0xc49b('0x63')]['id']){delete _0x35389f[_0xc49b('0x63')]['id'];}return db[_0xc49b('0x49')][_0xc49b('0x62')]({'where':{'id':_0x35389f[_0xc49b('0x66')]['id']}})[_0xc49b('0x11')](handleEntityNotFound(_0x277c0,null))[_0xc49b('0x11')](function(_0x1e3ab6){if(_0x1e3ab6){_0x35389f[_0xc49b('0x63')][_0xc49b('0x6a')]=_0x1e3ab6['id'];return db[_0xc49b('0x6b')][_0xc49b('0x6c')](_0x35389f[_0xc49b('0x63')]);}})['then'](respondWithResult(_0x277c0,null))[_0xc49b('0x1b')](handleError(_0x277c0,null));};exports[_0xc49b('0x6d')]=function(_0x5053b8,_0x450a94){var _0x4bd2b3={'raw':![],'where':{}};var _0x27b777={};var _0x1ca15d={'count':0x0,'rows':[]};return db[_0xc49b('0x49')][_0xc49b('0x6e')]({'where':{'id':_0x5053b8[_0xc49b('0x66')]['id']}})['then'](handleEntityNotFound(_0x450a94,null))['then'](function(_0x44686e){if(_0x44686e){_0x27b777['model']=_[_0xc49b('0x4f')](db['Disposition'][_0xc49b('0x4a')]);_0x27b777[_0xc49b('0x50')]=_[_0xc49b('0x4f')](_0x5053b8['query']);_0x27b777[_0xc49b('0x51')]=_[_0xc49b('0x52')](_0x27b777[_0xc49b('0x4e')],_0x27b777[_0xc49b('0x50')]);_0x4bd2b3[_0xc49b('0x53')]=_[_0xc49b('0x52')](_0x27b777[_0xc49b('0x4e')],qs['fields'](_0x5053b8[_0xc49b('0x50')][_0xc49b('0x54')]));_0x4bd2b3['attributes']=_0x4bd2b3[_0xc49b('0x53')][_0xc49b('0x55')]?_0x4bd2b3[_0xc49b('0x53')]:_0x27b777[_0xc49b('0x4e')];if(!_0x5053b8[_0xc49b('0x50')][_0xc49b('0x56')](_0xc49b('0x57'))){_0x4bd2b3['limit']=qs['limit'](_0x5053b8[_0xc49b('0x50')][_0xc49b('0x22')]);_0x4bd2b3[_0xc49b('0x20')]=qs['offset'](_0x5053b8[_0xc49b('0x50')]['offset']);}_0x4bd2b3[_0xc49b('0x58')]=qs['sort'](_0x5053b8[_0xc49b('0x50')]['sort']);_0x4bd2b3[_0xc49b('0x5c')]=qs[_0xc49b('0x51')](_[_0xc49b('0x5a')](_0x5053b8[_0xc49b('0x50')],_0x27b777[_0xc49b('0x51')]));_0x4bd2b3['where'][_0xc49b('0x6a')]=_0x44686e['id'];if(_0x5053b8[_0xc49b('0x50')][_0xc49b('0x5b')]){_0x4bd2b3[_0xc49b('0x5c')]=_[_0xc49b('0x5d')](_0x4bd2b3['where'],{'$or':_['map'](_0x4bd2b3['attributes'],function(_0x22a85f){var _0x37e213={};_0x37e213[_0x22a85f]={'$like':'%'+_0x5053b8['query'][_0xc49b('0x5b')]+'%'};return _0x37e213;})});}_0x4bd2b3=_[_0xc49b('0x5d')]({},_0x4bd2b3,_0x5053b8['options']);return db[_0xc49b('0x6b')][_0xc49b('0x23')]({'where':_0x4bd2b3[_0xc49b('0x5c')]})[_0xc49b('0x11')](function(_0x31bcd6){_0x1ca15d['count']=_0x31bcd6;if(_0x5053b8[_0xc49b('0x50')]['includeAll']){_0x4bd2b3[_0xc49b('0x5f')]=[{'all':!![]}];}return db[_0xc49b('0x6b')][_0xc49b('0x60')](_0x4bd2b3);})[_0xc49b('0x11')](function(_0x1baaf6){_0x1ca15d[_0xc49b('0x6f')]=_0x1baaf6;return _0x1ca15d;});}})[_0xc49b('0x11')](respondWithFilteredResult(_0x450a94,_0x4bd2b3))[_0xc49b('0x1b')](handleError(_0x450a94,null));};exports['removeDispositions']=function(_0x25b694,_0x46b24c){return db[_0xc49b('0x49')]['find']({'where':{'id':_0x25b694[_0xc49b('0x66')]['id']}})[_0xc49b('0x11')](handleEntityNotFound(_0x46b24c,null))['then'](function(_0x3f4f5a){if(_0x3f4f5a){return _0x3f4f5a[_0xc49b('0x70')](_0x25b694[_0xc49b('0x50')][_0xc49b('0x71')]);}})['then'](respondWithStatusCode(_0x46b24c,null))['catch'](handleError(_0x46b24c,null));};exports[_0xc49b('0x72')]=function(_0x2da4de,_0x4dfa91){if(_0x2da4de[_0xc49b('0x63')]['id']){delete _0x2da4de[_0xc49b('0x63')]['id'];}return db[_0xc49b('0x49')]['find']({'where':{'id':_0x2da4de[_0xc49b('0x66')]['id']}})['then'](handleEntityNotFound(_0x4dfa91,null))['then'](function(_0x5cdc03){if(_0x5cdc03){_0x2da4de[_0xc49b('0x63')][_0xc49b('0x6a')]=_0x5cdc03['id'];return db[_0xc49b('0x73')][_0xc49b('0x6c')](_0x2da4de['body']);}})[_0xc49b('0x11')](respondWithResult(_0x4dfa91,null))['catch'](handleError(_0x4dfa91,null));};exports['getAnswers']=function(_0x297276,_0x1914fb){var _0x499890={'raw':![],'where':{}};var _0x239f58={};var _0x30d643={'count':0x0,'rows':[]};return db[_0xc49b('0x49')]['findOne']({'where':{'id':_0x297276[_0xc49b('0x66')]['id']}})[_0xc49b('0x11')](handleEntityNotFound(_0x1914fb,null))[_0xc49b('0x11')](function(_0x26d3a7){if(_0x26d3a7){_0x239f58[_0xc49b('0x4e')]=_[_0xc49b('0x4f')](db['CannedAnswer'][_0xc49b('0x4a')]);_0x239f58[_0xc49b('0x50')]=_[_0xc49b('0x4f')](_0x297276['query']);_0x239f58[_0xc49b('0x51')]=_['intersection'](_0x239f58[_0xc49b('0x4e')],_0x239f58[_0xc49b('0x50')]);_0x499890['attributes']=_[_0xc49b('0x52')](_0x239f58['model'],qs[_0xc49b('0x54')](_0x297276[_0xc49b('0x50')]['fields']));_0x499890[_0xc49b('0x53')]=_0x499890['attributes'][_0xc49b('0x55')]?_0x499890[_0xc49b('0x53')]:_0x239f58[_0xc49b('0x4e')];if(!_0x297276[_0xc49b('0x50')][_0xc49b('0x56')](_0xc49b('0x57'))){_0x499890[_0xc49b('0x22')]=qs[_0xc49b('0x22')](_0x297276[_0xc49b('0x50')][_0xc49b('0x22')]);_0x499890['offset']=qs[_0xc49b('0x20')](_0x297276[_0xc49b('0x50')][_0xc49b('0x20')]);}_0x499890['order']=qs[_0xc49b('0x59')](_0x297276[_0xc49b('0x50')]['sort']);_0x499890[_0xc49b('0x5c')]=qs[_0xc49b('0x51')](_[_0xc49b('0x5a')](_0x297276['query'],_0x239f58['filters']));_0x499890['where']['MailAccountId']=_0x26d3a7['id'];if(_0x297276[_0xc49b('0x50')][_0xc49b('0x5b')]){_0x499890[_0xc49b('0x5c')]=_[_0xc49b('0x5d')](_0x499890['where'],{'$or':_[_0xc49b('0x48')](_0x499890['attributes'],function(_0x2acb4f){var _0x1424ef={};_0x1424ef[_0x2acb4f]={'$like':'%'+_0x297276[_0xc49b('0x50')]['filter']+'%'};return _0x1424ef;})});}_0x499890=_[_0xc49b('0x5d')]({},_0x499890,_0x297276[_0xc49b('0x61')]);return db[_0xc49b('0x73')]['count']({'where':_0x499890['where']})[_0xc49b('0x11')](function(_0x43319d){_0x30d643[_0xc49b('0x23')]=_0x43319d;if(_0x297276[_0xc49b('0x50')][_0xc49b('0x5e')]){_0x499890[_0xc49b('0x5f')]=[{'all':!![]}];}return db[_0xc49b('0x73')][_0xc49b('0x60')](_0x499890);})[_0xc49b('0x11')](function(_0x15a7d3){_0x30d643[_0xc49b('0x6f')]=_0x15a7d3;return _0x30d643;});}})[_0xc49b('0x11')](respondWithFilteredResult(_0x1914fb,_0x499890))['catch'](handleError(_0x1914fb,null));};exports[_0xc49b('0x74')]=function(_0x1d81df,_0x30d445){return db['MailAccount'][_0xc49b('0x62')]({'where':{'id':_0x1d81df[_0xc49b('0x66')]['id']}})[_0xc49b('0x11')](handleEntityNotFound(_0x30d445,null))['then'](function(_0x441063){if(_0x441063){return _0x441063[_0xc49b('0x74')](_0x1d81df[_0xc49b('0x50')][_0xc49b('0x71')]);}})[_0xc49b('0x11')](respondWithStatusCode(_0x30d445,null))['catch'](handleError(_0x30d445,null));};exports[_0xc49b('0x6c')]=function(_0x84ae6e,_0x5eaa52){var _0x55b261={'name':_0x84ae6e[_0xc49b('0x63')]['name'],'key':_0x84ae6e['body'][_0xc49b('0x4d')],'provider':_0x84ae6e[_0xc49b('0x63')][_0xc49b('0x64')]==='custom'?null:_0x84ae6e[_0xc49b('0x63')][_0xc49b('0x64')],'email':_0x84ae6e['body'][_0xc49b('0x75')],'ListId':_0x84ae6e[_0xc49b('0x63')][_0xc49b('0x76')],'active':!_[_0xc49b('0x77')](_0x84ae6e[_0xc49b('0x63')][_0xc49b('0x78')])?_0x84ae6e['body'][_0xc49b('0x78')]:!![],'description':_0x84ae6e['body'][_0xc49b('0x79')]||null};var _0x2b4a48=getAuthenticationOptions(_0x55b261[_0xc49b('0x64')],_0x84ae6e[_0xc49b('0x63')]);_0x55b261[_0xc49b('0x41')]=_0x2b4a48[_0xc49b('0x41')];_0x55b261[_0xc49b('0x42')]=_0x2b4a48['Smtp'];return db[_0xc49b('0x49')][_0xc49b('0x6c')](_0x55b261,{'include':[{'model':db[_0xc49b('0x45')],'as':'Smtp'},{'model':db[_0xc49b('0x44')],'as':_0xc49b('0x41')}]})[_0xc49b('0x11')](function(_0x463133){var _0xa3c3c7=_0x84ae6e[_0xc49b('0x37')]['get']({'plain':!![]});if(!_0xa3c3c7)throw new Error(_0xc49b('0x7a'));if(_0xa3c3c7[_0xc49b('0x7b')]==='user'){var _0x26cd5c=_0x463133[_0xc49b('0x25')]({'plain':!![]});return db['UserProfileSection'][_0xc49b('0x62')]({'where':{'name':'MailAccounts','userProfileId':_0xa3c3c7[_0xc49b('0x7c')]},'raw':!![]})[_0xc49b('0x11')](function(_0x7b0bb7){if(_0x7b0bb7&&_0x7b0bb7['autoAssociation']===0x0){return db[_0xc49b('0x27')][_0xc49b('0x6c')]({'name':_0x26cd5c[_0xc49b('0x2a')],'resourceId':_0x26cd5c['id'],'type':_0x7b0bb7[_0xc49b('0x2a')],'sectionId':_0x7b0bb7['id']},{})[_0xc49b('0x11')](function(){return _0x463133;});}else{return _0x463133;}})[_0xc49b('0x1b')](function(_0x5f19b2){logger[_0xc49b('0x17')](_0xc49b('0x7d'),_0x5f19b2);throw _0x5f19b2;});}return _0x463133;})[_0xc49b('0x11')](respondWithResult(_0x5eaa52,0xc9))['catch'](handleError(_0x5eaa52,null));};exports[_0xc49b('0x7e')]=function(_0x2d693a,_0x23948c){return db['MailAccount'][_0xc49b('0x6e')]({'where':{'id':_0x2d693a[_0xc49b('0x66')]['id']}})[_0xc49b('0x11')](handleEntityNotFound(_0x23948c,null))[_0xc49b('0x11')](function(_0x48beca){if(_0x48beca){return _0x48beca[_0xc49b('0x7e')]();}return null;})[_0xc49b('0x11')](respondWithResult(_0x23948c,null))[_0xc49b('0x1b')](handleError(_0x23948c,null));};exports[_0xc49b('0x7f')]=function(_0x1c8340,_0xa416d0){if(_0x1c8340[_0xc49b('0x63')]['id']){delete _0x1c8340[_0xc49b('0x63')]['id'];}return db['MailAccount'][_0xc49b('0x62')]({'where':{'id':_0x1c8340[_0xc49b('0x66')]['id']}})[_0xc49b('0x11')](handleEntityNotFound(_0xa416d0,null))['then'](function(_0x2147a8){if(_0x2147a8){_0x1c8340[_0xc49b('0x63')]['MailAccountId']=_0x2147a8['id'];return db[_0xc49b('0x44')][_0xc49b('0x6c')](_0x1c8340[_0xc49b('0x63')]);}})['then'](respondWithResult(_0xa416d0,null))[_0xc49b('0x1b')](handleError(_0xa416d0,null));};exports[_0xc49b('0x80')]=function(_0x4d7722,_0x3ef564){return db[_0xc49b('0x49')][_0xc49b('0x6e')]({'where':{'id':_0x4d7722['params']['id']}})['then'](handleEntityNotFound(_0x3ef564,null))[_0xc49b('0x11')](function(_0x1786a9){if(_0x1786a9){return _0x1786a9[_0xc49b('0x81')](null);}return null;})[_0xc49b('0x11')](respondWithStatusCode(_0x3ef564,null))[_0xc49b('0x1b')](handleError(_0x3ef564,null));};exports['getSmtp']=function(_0x1370de,_0xa1cb2e){return db[_0xc49b('0x49')][_0xc49b('0x6e')]({'where':{'id':_0x1370de[_0xc49b('0x66')]['id']}})[_0xc49b('0x11')](handleEntityNotFound(_0xa1cb2e,null))[_0xc49b('0x11')](function(_0x4f076c){if(_0x4f076c){return _0x4f076c[_0xc49b('0x82')]();}return null;})['then'](respondWithResult(_0xa1cb2e,null))['catch'](handleError(_0xa1cb2e,null));};exports[_0xc49b('0x83')]=function(_0x1bddba,_0x8d8635){if(_0x1bddba[_0xc49b('0x63')]['id']){delete _0x1bddba[_0xc49b('0x63')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x1bddba[_0xc49b('0x66')]['id']}})[_0xc49b('0x11')](handleEntityNotFound(_0x8d8635,null))['then'](function(_0x5bbeeb){if(_0x5bbeeb){_0x1bddba['body']['MailAccountId']=_0x5bbeeb['id'];return db[_0xc49b('0x45')][_0xc49b('0x6c')](_0x1bddba[_0xc49b('0x63')]);}})[_0xc49b('0x11')](respondWithResult(_0x8d8635,null))[_0xc49b('0x1b')](handleError(_0x8d8635,null));};exports[_0xc49b('0x84')]=function(_0x111ae3,_0x61415f){return db[_0xc49b('0x49')][_0xc49b('0x6e')]({'where':{'id':_0x111ae3[_0xc49b('0x66')]['id']}})[_0xc49b('0x11')](handleEntityNotFound(_0x61415f,null))[_0xc49b('0x11')](function(_0x3a17f7){if(_0x3a17f7){return _0x3a17f7[_0xc49b('0x85')](null);}return null;})['then'](respondWithStatusCode(_0x61415f,null))['catch'](handleError(_0x61415f,null));};exports[_0xc49b('0x86')]=function(_0x361043,_0x18dbef){return db[_0xc49b('0x87')][_0xc49b('0x62')]({'where':{'id':_0x361043[_0xc49b('0x66')]['id']}})[_0xc49b('0x11')](handleEntityNotFound(_0x18dbef,null))[_0xc49b('0x11')](function(_0x4297f7){if(_0x4297f7){return _0x4297f7[_0xc49b('0x86')](_0x361043[_0xc49b('0x63')][_0xc49b('0x71')],_[_0xc49b('0x88')](_0x361043[_0xc49b('0x63')],[_0xc49b('0x71'),'id'])||{});}})[_0xc49b('0x11')](respondWithResult(_0x18dbef,null))[_0xc49b('0x1b')](handleError(_0x18dbef,null));};exports[_0xc49b('0x89')]=function(_0xccbd86,_0x33a035){var _0x554f11={'raw':![],'where':{}};var _0x4f9f14={};var _0x217eaf={'count':0x0,'rows':[]};return db['MailAccount'][_0xc49b('0x6e')]({'where':{'id':_0xccbd86['params']['id']}})['then'](handleEntityNotFound(_0x33a035,null))[_0xc49b('0x11')](function(_0x321929){if(_0x321929){_0x4f9f14['model']=_[_0xc49b('0x4f')](db['MailInteraction']['rawAttributes']);_0x4f9f14[_0xc49b('0x50')]=_[_0xc49b('0x4f')](_0xccbd86['query']);_0x4f9f14[_0xc49b('0x51')]=_['intersection'](_0x4f9f14[_0xc49b('0x4e')],_0x4f9f14['query']);_0x554f11[_0xc49b('0x53')]=_[_0xc49b('0x52')](_0x4f9f14['model'],qs[_0xc49b('0x54')](_0xccbd86['query'][_0xc49b('0x54')]));_0x554f11[_0xc49b('0x53')]=_0x554f11['attributes'][_0xc49b('0x55')]?_0x554f11[_0xc49b('0x53')]:_0x4f9f14['model'];if(!_0xccbd86[_0xc49b('0x50')][_0xc49b('0x56')](_0xc49b('0x57'))){_0x554f11[_0xc49b('0x22')]=qs['limit'](_0xccbd86[_0xc49b('0x50')][_0xc49b('0x22')]);_0x554f11['offset']=qs['offset'](_0xccbd86[_0xc49b('0x50')][_0xc49b('0x20')]);}_0x554f11[_0xc49b('0x58')]=qs[_0xc49b('0x59')](_0xccbd86[_0xc49b('0x50')][_0xc49b('0x59')]);_0x554f11['where']=qs[_0xc49b('0x51')](_[_0xc49b('0x5a')](_0xccbd86[_0xc49b('0x50')],_0x4f9f14['filters']));_0x554f11[_0xc49b('0x5c')]['MailAccountId']=_0x321929['id'];if(_0xccbd86['query']['filter']){_0x554f11['where']=_['merge'](_0x554f11['where'],{'$or':_[_0xc49b('0x48')](_0x554f11['attributes'],function(_0x4107fe){var _0xe30314={};_0xe30314[_0x4107fe]={'$like':'%'+_0xccbd86[_0xc49b('0x50')]['filter']+'%'};return _0xe30314;})});}_0x554f11=_['merge']({},_0x554f11,_0xccbd86[_0xc49b('0x61')]);return db[_0xc49b('0x87')][_0xc49b('0x23')]({'where':_0x554f11[_0xc49b('0x5c')]})[_0xc49b('0x11')](function(_0x158143){_0x217eaf[_0xc49b('0x23')]=_0x158143;if(_0xccbd86[_0xc49b('0x50')][_0xc49b('0x5e')]){_0x554f11[_0xc49b('0x5f')]=[{'model':db['CmContact'],'as':_0xc49b('0x8a'),'required':![]},{'model':db[_0xc49b('0x8b')],'as':_0xc49b('0x8c'),'attributes':['name','fullname',_0xc49b('0x8d')],'required':![]},{'model':db['Tag'],'as':_0xc49b('0x8e'),'attributes':['id',_0xc49b('0x2a'),_0xc49b('0x8f')],'where':_0xccbd86['query'][_0xc49b('0x90')]?{'id':_0xccbd86['query']['tag']}:undefined,'required':_0xccbd86[_0xc49b('0x50')][_0xc49b('0x90')]?!![]:![]}];}return db[_0xc49b('0x87')][_0xc49b('0x60')](_0x554f11);})[_0xc49b('0x11')](function(_0x30812a){_0x217eaf[_0xc49b('0x6f')]=_0x30812a;return _0x217eaf;});}})[_0xc49b('0x11')](respondWithFilteredResult(_0x33a035,_0x554f11))['catch'](handleError(_0x33a035,null));};exports[_0xc49b('0x91')]=function addApplications(_0x2b106b,_0x4d068b){var _0x4a3467=_0x2b106b['params']['id'];var _0x5815c3=_0x2b106b[_0xc49b('0x63')];var _0x36c099=0xc8;var _0x30f9e7=null;return db[_0xc49b('0x92')][_0xc49b('0x93')]({'isolationLevel':db[_0xc49b('0x92')]['Transaction']['ISOLATION_LEVELS'][_0xc49b('0x94')]},function(_0x34cc37){return db['MailAccount'][_0xc49b('0x6e')]({'where':{'id':_0x4a3467},'transaction':_0x34cc37})[_0xc49b('0x11')](function(_0xf13522){if(_0xf13522){return db[_0xc49b('0x95')][_0xc49b('0x28')]({'where':{'MailAccountId':_0x4a3467},'transaction':_0x34cc37})[_0xc49b('0x11')](function(){var _0x390207=_[_0xc49b('0x48')](_0x5815c3,function(_0x239440){_0x239440[_0xc49b('0x6a')]=_0x4a3467;return _0x239440;});return db[_0xc49b('0x95')]['bulkCreate'](_0x390207,{'transaction':_0x34cc37});});}else{_0x36c099=0x194;_0x30f9e7=[];}});})[_0xc49b('0x11')](function(){if(_0x36c099!==0x194){return db[_0xc49b('0x95')][_0xc49b('0x96')]({'where':{'MailAccountId':_0x4a3467},'order':_0xc49b('0x97')})['then'](function(_0x82b137){_0x30f9e7=_0x82b137;});}})[_0xc49b('0x1b')](function(_0x2bb94b){_0x36c099=0x1f4;logger[_0xc49b('0x17')](_0x2bb94b['stack']);if(_0x2bb94b[_0xc49b('0x2a')]){delete _0x2bb94b[_0xc49b('0x2a')];}_0x30f9e7=_0x2bb94b;})[_0xc49b('0x98')](function(){if(_0x30f9e7===null){_0x4d068b['sendStatus'](_0x36c099);}else{if(_0x36c099===0x1f4){_0x4d068b[_0xc49b('0x1d')](_0x36c099)[_0xc49b('0x2b')](_0x30f9e7);}else{_0x4d068b[_0xc49b('0x1d')](_0x36c099)[_0xc49b('0x1f')](_0x30f9e7);}}});};exports[_0xc49b('0x99')]=function(_0x2bc273,_0x18365a){var _0x226205={};var _0x5840d4={};var _0x2ffd09;var _0x1974b6;return db['MailAccount'][_0xc49b('0x6e')]({'where':{'id':_0x2bc273[_0xc49b('0x66')]['id']}})[_0xc49b('0x11')](handleEntityNotFound(_0x18365a,null))['then'](function(_0x23e0d3){if(_0x23e0d3){_0x2ffd09=_0x23e0d3;_0x5840d4[_0xc49b('0x4e')]=_['keys'](db[_0xc49b('0x95')][_0xc49b('0x4a')]);_0x5840d4['query']=_[_0xc49b('0x4f')](_0x2bc273[_0xc49b('0x50')]);_0x5840d4['filters']=_[_0xc49b('0x52')](_0x5840d4[_0xc49b('0x4e')],_0x5840d4[_0xc49b('0x50')]);_0x226205[_0xc49b('0x53')]=_['intersection'](_0x5840d4[_0xc49b('0x4e')],qs[_0xc49b('0x54')](_0x2bc273[_0xc49b('0x50')]['fields']));_0x226205[_0xc49b('0x53')]=_0x226205['attributes']['length']?_0x226205[_0xc49b('0x53')]:_0x5840d4[_0xc49b('0x4e')];_0x226205[_0xc49b('0x58')]=qs[_0xc49b('0x59')](_0x2bc273['query'][_0xc49b('0x59')]);_0x226205[_0xc49b('0x5c')]=qs['filters'](_[_0xc49b('0x5a')](_0x2bc273[_0xc49b('0x50')],_0x5840d4[_0xc49b('0x51')]));if(_0x2bc273[_0xc49b('0x50')][_0xc49b('0x5b')]){_0x226205[_0xc49b('0x5c')]=_[_0xc49b('0x5d')](_0x226205['where'],{'$or':_[_0xc49b('0x48')](_0x226205['attributes'],function(_0x1aa685){var _0x458490={};_0x458490[_0x1aa685]={'$like':'%'+_0x2bc273[_0xc49b('0x50')][_0xc49b('0x5b')]+'%'};return _0x458490;})});}_0x226205=_[_0xc49b('0x5d')]({},_0x226205,_0x2bc273[_0xc49b('0x61')]);return _0x2ffd09[_0xc49b('0x99')](_0x226205);}})[_0xc49b('0x11')](function(_0x1ddb13){if(_0x1ddb13){_0x1974b6=_0x1ddb13[_0xc49b('0x55')];if(!_0x2bc273['query'][_0xc49b('0x56')]('nolimit')){_0x226205[_0xc49b('0x22')]=qs[_0xc49b('0x22')](_0x2bc273[_0xc49b('0x50')][_0xc49b('0x22')]);_0x226205[_0xc49b('0x20')]=qs[_0xc49b('0x20')](_0x2bc273[_0xc49b('0x50')][_0xc49b('0x20')]);}return _0x2ffd09['getApplications'](_0x226205);}})[_0xc49b('0x11')](function(_0x35c48c){if(_0x35c48c){return _0x35c48c?{'count':_0x1974b6,'rows':_0x35c48c}:null;}})[_0xc49b('0x11')](respondWithResult(_0x18365a,null))[_0xc49b('0x1b')](handleError(_0x18365a,null));};exports[_0xc49b('0x9a')]=function(_0x24f88f,_0x54975e){var _0x29f01a={'raw':!![],'where':{}};var _0x2895c4={};var _0x43d467={'count':0x0,'rows':[]};return db[_0xc49b('0x49')][_0xc49b('0x6e')]({'where':{'id':_0x24f88f[_0xc49b('0x66')]['id']}})[_0xc49b('0x11')](handleEntityNotFound(_0x54975e,null))['then'](function(_0x599dc1){if(_0x599dc1){_0x2895c4[_0xc49b('0x4e')]=_[_0xc49b('0x4f')](db[_0xc49b('0x9b')][_0xc49b('0x4a')]);_0x2895c4['query']=_[_0xc49b('0x4f')](_0x24f88f[_0xc49b('0x50')]);_0x2895c4[_0xc49b('0x51')]=_[_0xc49b('0x52')](_0x2895c4[_0xc49b('0x4e')],_0x2895c4[_0xc49b('0x50')]);_0x29f01a[_0xc49b('0x53')]=_[_0xc49b('0x52')](_0x2895c4[_0xc49b('0x4e')],qs[_0xc49b('0x54')](_0x24f88f[_0xc49b('0x50')][_0xc49b('0x54')]));_0x29f01a[_0xc49b('0x53')]=_0x29f01a[_0xc49b('0x53')][_0xc49b('0x55')]?_0x29f01a[_0xc49b('0x53')]:_0x2895c4[_0xc49b('0x4e')];if(!_0x24f88f['query'][_0xc49b('0x56')](_0xc49b('0x57'))){_0x29f01a[_0xc49b('0x22')]=qs[_0xc49b('0x22')](_0x24f88f[_0xc49b('0x50')]['limit']);_0x29f01a[_0xc49b('0x20')]=qs[_0xc49b('0x20')](_0x24f88f['query'][_0xc49b('0x20')]);}_0x29f01a['order']=qs[_0xc49b('0x59')](_0x24f88f[_0xc49b('0x50')]['sort']);_0x29f01a['where']=qs[_0xc49b('0x51')](_['pick'](_0x24f88f[_0xc49b('0x50')],_0x2895c4[_0xc49b('0x51')]));_0x29f01a[_0xc49b('0x5c')]['MailAccountId']=_0x599dc1['id'];if(_0x24f88f[_0xc49b('0x50')][_0xc49b('0x5b')]){_0x29f01a[_0xc49b('0x5c')]=_['merge'](_0x29f01a[_0xc49b('0x5c')],{'$or':_['map'](_0x29f01a[_0xc49b('0x53')],function(_0x41c9ed){var _0x4c9b47={};_0x4c9b47[_0x41c9ed]={'$like':'%'+_0x24f88f[_0xc49b('0x50')]['filter']+'%'};return _0x4c9b47;})});}if(_0x24f88f[_0xc49b('0x50')][_0xc49b('0x9c')]){var _0x488e4f=_0x24f88f['query'][_0xc49b('0x9c')][_0xc49b('0x9d')](',');var _0x104d0b={};_0x104d0b[_0x488e4f[0x0]]={'$gte':moment(_0x488e4f[0x1])[_0xc49b('0x9e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x29f01a[_0xc49b('0x5c')]=_['merge'](_0x29f01a[_0xc49b('0x5c')],_0x104d0b);}_0x29f01a=_[_0xc49b('0x5d')]({},_0x29f01a,_0x24f88f[_0xc49b('0x61')]);return db[_0xc49b('0x9b')]['count']({'where':_0x29f01a[_0xc49b('0x5c')]})[_0xc49b('0x11')](function(_0x3241db){_0x43d467['count']=_0x3241db;if(_0x24f88f['query']['includeAll']){_0x29f01a[_0xc49b('0x5f')]=[{'all':!![]}];}return db[_0xc49b('0x9b')]['findAll'](_0x29f01a);})[_0xc49b('0x11')](function(_0x544e2b){if(_0x24f88f['query'][_0xc49b('0x9f')]==='true'){for(var _0x3ba83a=0x0;_0x3ba83a<_0x544e2b[_0xc49b('0x55')];_0x3ba83a++){_0x544e2b[_0x3ba83a]['body']=juice(_0x544e2b[_0x3ba83a][_0xc49b('0x63')]);}}_0x43d467[_0xc49b('0x6f')]=_0x544e2b;return _0x43d467;});}})[_0xc49b('0x11')](respondWithFilteredResult(_0x54975e,_0x29f01a))['catch'](handleError(_0x54975e,null));};exports[_0xc49b('0x2b')]=function(_0x221f26,_0x2f2da2){var _0x22d5d,_0x778848={},_0x1b0bee;if(_0x221f26[_0xc49b('0x63')]['to']){_0x1b0bee=_0x221f26[_0xc49b('0x63')]['to']['split'](',')[0x0];}return db[_0xc49b('0x49')][_0xc49b('0x62')]({'where':{'id':_0x221f26[_0xc49b('0x66')]['id']},'include':[{'model':db[_0xc49b('0xa0')],'as':_0xc49b('0xa1'),'include':[{'model':db[_0xc49b('0xa2')],'as':_0xc49b('0xa3'),'where':{'email':_0x1b0bee},'limit':0x1,'order':[[_0xc49b('0xa4'),_0xc49b('0xa5')]]}]},{'model':db[_0xc49b('0x45')],'as':_0xc49b('0x42'),'raw':!![],'include':[{'model':db[_0xc49b('0xa6')],'as':_0xc49b('0xa6'),'raw':!![]}]}]})[_0xc49b('0x11')](handleEntityNotFound(_0x2f2da2,null))[_0xc49b('0x11')](function(_0x940a0d){if(!_0x940a0d)return;_0x22d5d=_0x940a0d;if(!_0x940a0d['Smtp'])throw new Error(_0xc49b('0xa7'));if(_['isNil'](_0x221f26['body']['from'])){_0x221f26['body'][_0xc49b('0xa8')]=util[_0xc49b('0x9e')](_0xc49b('0xa9'),_0x940a0d['name'],_0x940a0d[_0xc49b('0x75')]||_0x940a0d[_0xc49b('0x42')][_0xc49b('0x37')]);}if(_0x221f26['body'][_0xc49b('0xaa')]&&_0x221f26[_0xc49b('0x63')][_0xc49b('0xaa')][_0xc49b('0x55')]){for(var _0x1afc00=0x0;_0x1afc00<_0x221f26[_0xc49b('0x63')][_0xc49b('0xaa')][_0xc49b('0x55')];_0x1afc00+=0x1){_0x221f26['body']['attachments'][_0x1afc00]={'filename':_0x221f26[_0xc49b('0x63')][_0xc49b('0xaa')][_0x1afc00][_0xc49b('0x2a')],'path':path[_0xc49b('0xab')](config[_0xc49b('0xac')],_0xc49b('0xad'),_0x221f26[_0xc49b('0x63')][_0xc49b('0xaa')][_0x1afc00][_0xc49b('0xae')])};}}var _0x42123d=_0x940a0d[_0xc49b('0xaf')]();return respondWithRpcPromise('SendMail',_0xc49b('0xb0'),{'account':_0x42123d,'message':_0x221f26[_0xc49b('0x63')]});})['then'](function(_0x229249){if(!_0x229249)return;_0x778848=_0x229249;if(!_0x22d5d[_0xc49b('0xa1')])throw new Error(_0xc49b('0xb1'));if(_0x22d5d[_0xc49b('0xa1')][_0xc49b('0xa3')][_0xc49b('0x55')])return _0x22d5d[_0xc49b('0xa1')][_0xc49b('0xa3')][0x0];return db[_0xc49b('0xa2')]['create'](_[_0xc49b('0x9')](_0x221f26[_0xc49b('0x63')],{'firstName':_0x221f26[_0xc49b('0x63')]['to'],'email':_0x221f26['body']['to'],'phone':_0x221f26[_0xc49b('0x63')]['to'],'ListId':_0x22d5d[_0xc49b('0x76')]}));})[_0xc49b('0x11')](function(_0x506447){if(!_0x506447)return;var _0xc058fa={'UserId':_0x221f26[_0xc49b('0x37')]['id'],'ContactId':_0x506447['id'],'MailAccountId':_0x22d5d['id'],'inReplyTo':_0x778848[_0xc49b('0xb2')],'to':_0x221f26[_0xc49b('0x63')][_0xc49b('0xa8')],'cc':_0x221f26['body']['cc'],'subject':_0x221f26[_0xc49b('0x63')][_0xc49b('0xb3')],'attach':_0x221f26['body'][_0xc49b('0xb4')],'firstMsgDirection':_0xc49b('0xb5'),'lastMsgAt':moment()[_0xc49b('0x9e')](_0xc49b('0xb6')),'lastMsgDirection':'out','Messages':[_['merge'](_0x221f26[_0xc49b('0x63')],{'messageId':_0x778848['messageId'],'sentAt':moment()[_0xc49b('0x9e')](_0xc49b('0xb6')),'read':!![],'MailAccountId':_0x22d5d['id'],'UserId':_0x221f26[_0xc49b('0x37')]['id'],'ContactId':_0x506447['id']})]};if(_0x221f26[_0xc49b('0x63')][_0xc49b('0xb7')]){_0xc058fa=_[_0xc49b('0x5d')](_0xc058fa,_0x221f26[_0xc49b('0x63')][_0xc49b('0xb7')]);}return db[_0xc49b('0x87')]['create'](_0xc058fa,{'include':[{'model':db['MailMessage'],'as':_0xc49b('0xb8')}]});})[_0xc49b('0x11')](respondWithResult(_0x2f2da2,null))[_0xc49b('0x1b')](handleError(_0x2f2da2,null));};exports[_0xc49b('0xb9')]=function(_0x1b48ee,_0x2ff56d){return db[_0xc49b('0x49')][_0xc49b('0x62')]({'where':{'id':_0x1b48ee['params']['id']},'include':[{'model':db[_0xc49b('0x45')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xc49b('0xa6')],'as':_0xc49b('0xa6'),'raw':!![]}]}]})[_0xc49b('0x11')](handleEntityNotFound(_0x2ff56d,null))[_0xc49b('0x11')](function(_0x1d1b0e){if(!_0x1d1b0e['Smtp'])return;var _0x425a1e=_0x1d1b0e[_0xc49b('0xaf')]();return respondWithRpcPromise(_0xc49b('0xba'),_0xc49b('0xb9'),{'account':_0x425a1e});})[_0xc49b('0x11')](respondWithResult(_0x2ff56d,null))[_0xc49b('0x1b')](handleError(_0x2ff56d,null));};exports['destroy']=function(_0x1e828e,_0x9c87c1){return db[_0xc49b('0x49')][_0xc49b('0x62')]({'where':{'id':_0x1e828e[_0xc49b('0x66')]['id']}})['then'](handleEntityNotFound(_0x9c87c1,null))[_0xc49b('0x11')](function(_0x34b2a1){if(_0x34b2a1&&_0x34b2a1[_0xc49b('0x3f')]){throw new db[(_0xc49b('0xbb'))][(_0xc49b('0xbc'))](_0xc49b('0xbd'));}return _0x34b2a1;})[_0xc49b('0x11')](removeEntity(_0x9c87c1,null))[_0xc49b('0x1b')](handleError(_0x9c87c1,null));};exports[_0xc49b('0xbe')]=function(_0x187302,_0x4b4afa){return db[_0xc49b('0x49')]['find']({'where':{'id':_0x187302[_0xc49b('0x66')]['id']}})[_0xc49b('0x11')](handleEntityNotFound(_0x4b4afa,null))['then'](function(_0x47a6b0){if(_0x47a6b0){return _0x47a6b0[_0xc49b('0xbe')](_0x187302[_0xc49b('0x63')][_0xc49b('0x71')],_[_0xc49b('0x88')](_0x187302[_0xc49b('0x63')],[_0xc49b('0x71'),'id'])||{})[_0xc49b('0xbf')](function(_0x40f8f6){for(var _0x597164=0x0;_0x597164<_0x187302[_0xc49b('0x63')]['ids'][_0xc49b('0x55')];_0x597164+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x187302[_0xc49b('0x63')][_0xc49b('0x71')][_0x597164]),'MailAccountId':Number(_0x187302[_0xc49b('0x66')]['id'])});}return _0x40f8f6;});}})[_0xc49b('0x11')](respondWithResult(_0x4b4afa,null))['catch'](handleError(_0x4b4afa,null));};exports[_0xc49b('0xc0')]=function(_0x4a6528,_0x3509f7){return db[_0xc49b('0x49')][_0xc49b('0x62')]({'where':{'id':_0x4a6528['params']['id']}})['then'](handleEntityNotFound(_0x3509f7,null))[_0xc49b('0x11')](function(_0x220c54){if(_0x220c54){return _0x220c54['removeAgents'](_0x4a6528['query']['ids'])[_0xc49b('0x11')](function(){if(_[_0xc49b('0xc1')](_0x4a6528[_0xc49b('0x50')][_0xc49b('0x71')])){for(var _0x34714b=0x0;_0x34714b<_0x4a6528[_0xc49b('0x50')][_0xc49b('0x71')][_0xc49b('0x55')];_0x34714b+=0x1){socket[_0xc49b('0xc2')](_0xc49b('0xc3'),{'UserId':Number(_0x4a6528[_0xc49b('0x50')]['ids'][_0x34714b]),'MailAccountId':Number(_0x4a6528[_0xc49b('0x66')]['id'])});}}else{socket[_0xc49b('0xc2')](_0xc49b('0xc3'),{'UserId':Number(_0x4a6528['query'][_0xc49b('0x71')]),'MailAccountId':Number(_0x4a6528[_0xc49b('0x66')]['id'])});}});}})[_0xc49b('0x11')](respondWithStatusCode(_0x3509f7,null))['catch'](handleError(_0x3509f7,null));};exports[_0xc49b('0xc4')]=function(_0x183bde,_0x390f59){var _0x1e75ce={};var _0x4ec350={};var _0x29d48c;var _0x1a1ed4;return db[_0xc49b('0x49')]['findOne']({'where':{'id':_0x183bde[_0xc49b('0x66')]['id']}})['then'](handleEntityNotFound(_0x390f59,null))[_0xc49b('0x11')](function(_0xfed489){if(_0xfed489){_0x29d48c=_0xfed489;_0x4ec350[_0xc49b('0x4e')]=_[_0xc49b('0x4f')](db[_0xc49b('0x8b')][_0xc49b('0x4a')]);_0x4ec350[_0xc49b('0x50')]=_[_0xc49b('0x4f')](_0x183bde['query']);_0x4ec350['filters']=_['intersection'](_0x4ec350[_0xc49b('0x4e')],_0x4ec350[_0xc49b('0x50')]);_0x1e75ce[_0xc49b('0x53')]=_['intersection'](_0x4ec350[_0xc49b('0x4e')],qs['fields'](_0x183bde[_0xc49b('0x50')][_0xc49b('0x54')]));_0x1e75ce[_0xc49b('0x53')]=_0x1e75ce[_0xc49b('0x53')][_0xc49b('0x55')]?_0x1e75ce[_0xc49b('0x53')]:_0x4ec350[_0xc49b('0x4e')];_0x1e75ce['order']=qs['sort'](_0x183bde[_0xc49b('0x50')]['sort']);_0x1e75ce[_0xc49b('0x5c')]=qs['filters'](_[_0xc49b('0x5a')](_0x183bde[_0xc49b('0x50')],_0x4ec350[_0xc49b('0x51')]));if(_0x183bde[_0xc49b('0x50')][_0xc49b('0x5b')]){_0x1e75ce[_0xc49b('0x5c')]=_[_0xc49b('0x5d')](_0x1e75ce[_0xc49b('0x5c')],{'$or':_[_0xc49b('0x48')](_0x1e75ce[_0xc49b('0x53')],function(_0x583edb){var _0x1b50ef={};_0x1b50ef[_0x583edb]={'$like':'%'+_0x183bde[_0xc49b('0x50')][_0xc49b('0x5b')]+'%'};return _0x1b50ef;})});}_0x1e75ce=_[_0xc49b('0x5d')]({},_0x1e75ce,_0x183bde[_0xc49b('0x61')]);return _0x29d48c[_0xc49b('0xc4')](_0x1e75ce);}})[_0xc49b('0x11')](function(_0x5d137a){if(_0x5d137a){_0x1a1ed4=_0x5d137a['length'];if(!_0x183bde['query']['hasOwnProperty'](_0xc49b('0x57'))){_0x1e75ce[_0xc49b('0x22')]=qs[_0xc49b('0x22')](_0x183bde[_0xc49b('0x50')][_0xc49b('0x22')]);_0x1e75ce[_0xc49b('0x20')]=qs[_0xc49b('0x20')](_0x183bde[_0xc49b('0x50')][_0xc49b('0x20')]);}return _0x29d48c['getAgents'](_0x1e75ce);}})[_0xc49b('0x11')](function(_0x241c9b){if(_0x241c9b){return _0x241c9b?{'count':_0x1a1ed4,'rows':_0x241c9b}:null;}})[_0xc49b('0x11')](respondWithResult(_0x390f59,null))[_0xc49b('0x1b')](handleError(_0x390f59,null));}; \ No newline at end of file +var _0x66a4=['findOne','nolimit','Disposition','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','key','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','rows','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','email','attachments','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','subject','out','Interaction','Messages','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','end','json','undefined','count','offset','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','yahoo','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','pass','modernAuthentication','CloudProviderId','password','host','port','secure','service','authentication','username','Imap','index','MailServerIn','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','MailServerOut','length','options','find','body','provider','custom','Mail\x20Account\x20not\x20found','addDisposition','MailAccountId','create','getDispositions'];(function(_0x220979,_0x46cd13){var _0x3787ce=function(_0x43e4f6){while(--_0x43e4f6){_0x220979['push'](_0x220979['shift']());}};_0x3787ce(++_0x46cd13);}(_0x66a4,0x123));var _0x466a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x66a4[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0x466a('0x0'));var BPromise=require(_0x466a('0x1'));var util=require(_0x466a('0x2'));var path=require(_0x466a('0x3'));var _=require('lodash');var juice=require('juice');var Redis=require('ioredis');var qs=require(_0x466a('0x4'));var logger=require(_0x466a('0x5'))(_0x466a('0x6'));var config=require(_0x466a('0x7'));var db=require(_0x466a('0x8'))['db'];config['redis']=_[_0x466a('0x9')](config[_0x466a('0xa')],{'host':_0x466a('0xb'),'port':0x18eb});var socket=require(_0x466a('0xc'))(new Redis(config[_0x466a('0xa')]));require(_0x466a('0xd'))[_0x466a('0xe')](socket);var jayson=require(_0x466a('0xf'));var client=jayson[_0x466a('0x10')]['http']({'port':0x232b});function respondWithRpcPromise(_0x1ceed9,_0x533862,_0x590920,_0x1a0cca){return new BPromise(function(_0x228851,_0x45e16e){var _0x3379d2=_0x1a0cca||client;return _0x3379d2[_0x466a('0x11')](_0x1ceed9,_0x590920)[_0x466a('0x12')](function(_0x3c41b3){logger[_0x466a('0x13')](_0x466a('0x14'),_0x533862,_0x466a('0x15'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x533862,'request\x20sent',JSON[_0x466a('0x16')](_0x3c41b3));if(_0x3c41b3[_0x466a('0x17')]){if(_0x3c41b3['error'][_0x466a('0x18')]===0x1f4){logger[_0x466a('0x17')](_0x466a('0x14'),_0x533862,_0x3c41b3['error'][_0x466a('0x19')]);return _0x45e16e(_0x3c41b3[_0x466a('0x17')]['message']);}logger[_0x466a('0x17')](_0x466a('0x14'),_0x533862,_0x3c41b3[_0x466a('0x17')][_0x466a('0x19')]);return _0x228851(_0x3c41b3['error'][_0x466a('0x19')]);}else{logger['info'](_0x466a('0x14'),_0x533862,_0x466a('0x15'));_0x228851(_0x3c41b3['result'][_0x466a('0x19')]);}})['catch'](function(_0x56ae02){logger['error'](_0x466a('0x14'),_0x533862,_0x56ae02);_0x45e16e(_0x56ae02);});});}function respondWithStatusCode(_0x16375a,_0x1ed555){_0x1ed555=_0x1ed555||0xcc;return function(_0x48b070){if(_0x48b070){return _0x16375a[_0x466a('0x1a')](_0x1ed555);}return _0x16375a[_0x466a('0x1b')](_0x1ed555)[_0x466a('0x1c')]();};}function respondWithResult(_0x5c69f1,_0x237a41){_0x237a41=_0x237a41||0xc8;return function(_0x431e64){if(_0x431e64){return _0x5c69f1[_0x466a('0x1b')](_0x237a41)[_0x466a('0x1d')](_0x431e64);}};}function respondWithFilteredResult(_0x22a336,_0x275dc2){return function(_0x50377b){if(_0x50377b){var _0x246720=typeof _0x275dc2['offset']==='undefined'&&typeof _0x275dc2['limit']===_0x466a('0x1e');var _0x565387=_0x50377b[_0x466a('0x1f')];var _0x47c610=_0x246720?0x0:_0x275dc2[_0x466a('0x20')];var _0x4a2aa5=_0x246720?_0x50377b[_0x466a('0x1f')]:_0x275dc2['offset']+_0x275dc2['limit'];var _0x5f1bc1;if(_0x4a2aa5>=_0x565387){_0x4a2aa5=_0x565387;_0x5f1bc1=0xc8;}else{_0x5f1bc1=0xce;}_0x22a336[_0x466a('0x1b')](_0x5f1bc1);return _0x22a336['set'](_0x466a('0x21'),_0x47c610+'-'+_0x4a2aa5+'/'+_0x565387)[_0x466a('0x1d')](_0x50377b);}return null;};}function saveUpdates(_0x430b97){return function(_0x1ae09e){if(_0x1ae09e){return _0x1ae09e[_0x466a('0x22')](_0x430b97)[_0x466a('0x12')](function(_0x664c83){return _0x664c83;});}return null;};}function removeEntity(_0x2e9214){return function(_0x10f4ae){if(_0x10f4ae){return _0x10f4ae[_0x466a('0x23')]()[_0x466a('0x12')](function(){var _0x2597db=_0x10f4ae[_0x466a('0x24')]({'plain':!![]});var _0x2b5cf5=_0x466a('0x25');return db[_0x466a('0x26')][_0x466a('0x23')]({'where':{'type':_0x2b5cf5,'resourceId':_0x2597db['id']}})['then'](function(){return _0x10f4ae;});})[_0x466a('0x12')](function(){_0x2e9214[_0x466a('0x1b')](0xcc)[_0x466a('0x1c')]();});}};}function handleEntityNotFound(_0x6b9939){return function(_0x3c11b4){if(!_0x3c11b4){_0x6b9939[_0x466a('0x1a')](0x194);}return _0x3c11b4;};}function handleError(_0x31d91f,_0x5a2245){_0x5a2245=_0x5a2245||0x1f4;return function(_0x456a91){logger[_0x466a('0x17')](_0x456a91[_0x466a('0x27')]);if(_0x456a91[_0x466a('0x28')]){delete _0x456a91[_0x466a('0x28')];}_0x31d91f[_0x466a('0x1b')](_0x5a2245)[_0x466a('0x29')](_0x456a91);};}function getImapHost(_0x47010a){switch(_0x47010a){case'gmail':return'imap.gmail.com';case'yahoo':return _0x466a('0x2a');case _0x466a('0x2b'):return _0x466a('0x2c');case _0x466a('0x2d'):return _0x466a('0x2e');}throw new Error(_0x466a('0x2f'),_0x47010a);}function getSmtpHost(_0x4bc8f3){switch(_0x4bc8f3){case'gmail':return _0x466a('0x30');case _0x466a('0x31'):return _0x466a('0x32');case _0x466a('0x2b'):return _0x466a('0x33');case _0x466a('0x2d'):return _0x466a('0x34');}throw new Error('Unknown\x20email\x20service\x20provider',_0x4bc8f3);}function getAuthenticationOptions(_0x4c3ab0,_0x2ff006){var _0x5d2ac0={};var _0xa2fbcf={};if(_0x4c3ab0){_0x5d2ac0['user']=_0xa2fbcf[_0x466a('0x35')]=_0x2ff006['username'];_0x5d2ac0['password']=_0xa2fbcf[_0x466a('0x36')]=_0x2ff006['password'];if(_0x2ff006[_0x466a('0x37')]){_0x5d2ac0[_0x466a('0x37')]=_0xa2fbcf[_0x466a('0x37')]=!![];_0x5d2ac0[_0x466a('0x38')]=_0xa2fbcf[_0x466a('0x38')]=_0x2ff006[_0x466a('0x38')];_0x5d2ac0[_0x466a('0x39')]=_0xa2fbcf['pass']=null;}else{_0x5d2ac0[_0x466a('0x38')]=_0xa2fbcf[_0x466a('0x38')]=null;}_0x5d2ac0[_0x466a('0x3a')]=getImapHost(_0x4c3ab0);_0x5d2ac0[_0x466a('0x3b')]=0x3e1;_0xa2fbcf[_0x466a('0x3a')]=getSmtpHost(_0x4c3ab0);_0xa2fbcf[_0x466a('0x3b')]=0x24b;_0xa2fbcf[_0x466a('0x3c')]=![];_0x5d2ac0[_0x466a('0x3d')]=_0xa2fbcf['service']=null;}else{if(_0x2ff006[_0x466a('0x3e')]){_0x5d2ac0['user']=_0xa2fbcf[_0x466a('0x35')]=_0x2ff006[_0x466a('0x3f')];_0x5d2ac0[_0x466a('0x39')]=_0xa2fbcf[_0x466a('0x36')]=_0x2ff006[_0x466a('0x39')];}else{_0x5d2ac0[_0x466a('0x3e')]=_0xa2fbcf[_0x466a('0x3e')]=![];_0x5d2ac0[_0x466a('0x35')]=_0xa2fbcf['user']=null;_0x5d2ac0[_0x466a('0x39')]=_0xa2fbcf['pass']=null;}_0x5d2ac0[_0x466a('0x3a')]=_0x2ff006[_0x466a('0x40')]['host'];_0x5d2ac0[_0x466a('0x3b')]=_0x2ff006['Imap'][_0x466a('0x3b')];_0xa2fbcf[_0x466a('0x3a')]=_0x2ff006['Smtp']['host'];_0xa2fbcf[_0x466a('0x3b')]=_0x2ff006['Smtp'][_0x466a('0x3b')];}return{'Imap':_0x5d2ac0,'Smtp':_0xa2fbcf};}exports[_0x466a('0x41')]=function(_0x28c079,_0x926f82){var _0x45b70b={'include':[{'model':db[_0x466a('0x42')],'as':_0x466a('0x40')},{'model':db['MailServerOut'],'as':_0x466a('0x43')},{'model':db[_0x466a('0x44')],'as':_0x466a('0x45')}]},_0x561612={},_0xe16dff={'count':0x0,'rows':[]};var _0x4fadb9=_[_0x466a('0x46')](db[_0x466a('0x47')][_0x466a('0x48')],function(_0x41d7c0){return{'name':_0x41d7c0[_0x466a('0x49')],'type':_0x41d7c0[_0x466a('0x4a')]['key']};});_0x561612[_0x466a('0x4b')]=_[_0x466a('0x46')](_0x4fadb9,_0x466a('0x28'));_0x561612[_0x466a('0x4c')]=_[_0x466a('0x4d')](_0x28c079['query']);_0x561612[_0x466a('0x4e')]=_['intersection'](_0x561612[_0x466a('0x4b')],_0x561612[_0x466a('0x4c')]);_0x45b70b[_0x466a('0x4f')]=_[_0x466a('0x50')](_0x561612['model'],qs[_0x466a('0x51')](_0x28c079['query'][_0x466a('0x51')]));_0x45b70b[_0x466a('0x4f')]=_0x45b70b['attributes']['length']?_0x45b70b['attributes']:_0x561612[_0x466a('0x4b')];if(!_0x28c079[_0x466a('0x4c')][_0x466a('0x52')]('nolimit')){_0x45b70b[_0x466a('0x53')]=qs[_0x466a('0x53')](_0x28c079['query'][_0x466a('0x53')]);_0x45b70b['offset']=qs[_0x466a('0x20')](_0x28c079[_0x466a('0x4c')][_0x466a('0x20')]);}_0x45b70b[_0x466a('0x54')]=qs[_0x466a('0x55')](_0x28c079[_0x466a('0x4c')][_0x466a('0x55')]);_0x45b70b[_0x466a('0x56')]=qs[_0x466a('0x4e')](_[_0x466a('0x57')](_0x28c079[_0x466a('0x4c')],_0x561612['filters']),_0x4fadb9);if(_0x28c079[_0x466a('0x4c')][_0x466a('0x58')]){_0x45b70b['where']=_[_0x466a('0x59')](_0x45b70b[_0x466a('0x56')],{'$or':_['map'](_0x4fadb9,function(_0x5b2364){if(_0x5b2364[_0x466a('0x4a')]!==_0x466a('0x5a')){var _0x3697ca={};_0x3697ca[_0x5b2364[_0x466a('0x28')]]={'$like':'%'+_0x28c079[_0x466a('0x4c')][_0x466a('0x58')]+'%'};return _0x3697ca;}})});}_0x45b70b=_[_0x466a('0x59')]({},_0x45b70b,_0x28c079['options']);var _0x4ba71a={'where':_0x45b70b[_0x466a('0x56')]};return db[_0x466a('0x47')][_0x466a('0x1f')](_0x4ba71a)['then'](function(_0x58f1dd){_0xe16dff[_0x466a('0x1f')]=_0x58f1dd;if(_0x28c079['query'][_0x466a('0x5b')]){_0x45b70b[_0x466a('0x5c')]=[{'all':!![]}];}return db[_0x466a('0x47')][_0x466a('0x5d')](_0x45b70b);})[_0x466a('0x12')](function(_0x199d5c){_0xe16dff['rows']=_0x199d5c;return _0xe16dff;})[_0x466a('0x12')](respondWithFilteredResult(_0x926f82,_0x45b70b))[_0x466a('0x5e')](handleError(_0x926f82,null));};exports[_0x466a('0x5f')]=function(_0x3bc4a2,_0x2d9843){var _0x43fba0={'raw':![],'where':{'id':_0x3bc4a2[_0x466a('0x60')]['id']},'include':[{'model':db[_0x466a('0x42')],'as':'Imap'},{'model':db[_0x466a('0x61')],'as':_0x466a('0x43')},{'model':db['Pause'],'as':_0x466a('0x45')}]},_0x3e2b3c={};_0x3e2b3c['model']=_[_0x466a('0x4d')](db[_0x466a('0x47')][_0x466a('0x48')]);_0x3e2b3c[_0x466a('0x4c')]=_[_0x466a('0x4d')](_0x3bc4a2['query']);_0x3e2b3c[_0x466a('0x4e')]=_[_0x466a('0x50')](_0x3e2b3c[_0x466a('0x4b')],_0x3e2b3c[_0x466a('0x4c')]);_0x43fba0[_0x466a('0x4f')]=_[_0x466a('0x50')](_0x3e2b3c[_0x466a('0x4b')],qs['fields'](_0x3bc4a2[_0x466a('0x4c')]['fields']));_0x43fba0[_0x466a('0x4f')]=_0x43fba0[_0x466a('0x4f')][_0x466a('0x62')]?_0x43fba0[_0x466a('0x4f')]:_0x3e2b3c[_0x466a('0x4b')];if(_0x3bc4a2[_0x466a('0x4c')][_0x466a('0x5b')]){_0x43fba0[_0x466a('0x5c')]=[{'all':!![]}];}_0x43fba0=_[_0x466a('0x59')]({},_0x43fba0,_0x3bc4a2[_0x466a('0x63')]);return db['MailAccount'][_0x466a('0x64')](_0x43fba0)[_0x466a('0x12')](handleEntityNotFound(_0x2d9843,null))[_0x466a('0x12')](respondWithResult(_0x2d9843,null))[_0x466a('0x5e')](handleError(_0x2d9843,null));};exports[_0x466a('0x22')]=function(_0x6ac089,_0x41eeda){if(_0x6ac089[_0x466a('0x65')]['id']){delete _0x6ac089[_0x466a('0x65')]['id'];}var _0x2a4dbf=_0x6ac089[_0x466a('0x65')][_0x466a('0x66')]===_0x466a('0x67')?null:_0x6ac089[_0x466a('0x65')][_0x466a('0x66')];var _0x35316d=_0x6ac089[_0x466a('0x65')][_0x466a('0x40')]||{};var _0x113c3b=_0x6ac089[_0x466a('0x65')]['Smtp']||{};if(_0x2a4dbf){_0x35316d['host']=getImapHost(_0x2a4dbf);_0x35316d[_0x466a('0x3b')]=0x3e1;_0x113c3b[_0x466a('0x3a')]=getSmtpHost(_0x2a4dbf);_0x113c3b[_0x466a('0x3b')]=0x24b;_0x113c3b[_0x466a('0x3c')]=![];}if(_0x113c3b[_0x466a('0x37')]){_0x113c3b[_0x466a('0x3c')]=![];}else{_0x113c3b['CloudProviderId']=null;}if(!_0x35316d[_0x466a('0x37')])_0x35316d['CloudProviderId']=null;_0x6ac089['body'][_0x466a('0x40')]=_0x35316d;_0x6ac089[_0x466a('0x65')][_0x466a('0x43')]=_0x113c3b;return db[_0x466a('0x47')][_0x466a('0x64')]({'where':{'id':_0x6ac089[_0x466a('0x60')]['id']},'include':[{'model':db[_0x466a('0x42')],'as':_0x466a('0x40')},{'model':db[_0x466a('0x61')],'as':_0x466a('0x43')},{'model':db[_0x466a('0x44')],'as':_0x466a('0x45')}]})['then'](handleEntityNotFound(_0x41eeda,null))[_0x466a('0x12')](function(_0x14b94f){if(!_0x14b94f)throw new Error(_0x466a('0x68'));if(_0x14b94f['service'])delete _0x6ac089['body'][_0x466a('0x40')];return _0x14b94f;})[_0x466a('0x12')](saveUpdates(_0x6ac089[_0x466a('0x65')],null))['then'](function(_0x185b20){if(!_0x6ac089[_0x466a('0x65')]['Imap'])return _0x185b20;return db[_0x466a('0x42')][_0x466a('0x22')](_0x6ac089[_0x466a('0x65')]['Imap'],{'where':{'MailAccountId':_0x185b20['id']}})['then'](function(){return _0x185b20;});})['then'](function(_0x3623e9){if(!_0x6ac089[_0x466a('0x65')][_0x466a('0x43')])return _0x3623e9;return db[_0x466a('0x61')][_0x466a('0x22')](_0x6ac089[_0x466a('0x65')]['Smtp'],{'where':{'MailAccountId':_0x3623e9['id']}})[_0x466a('0x12')](function(){return _0x3623e9;});})[_0x466a('0x12')](respondWithResult(_0x41eeda,null))[_0x466a('0x5e')](handleError(_0x41eeda,null));};exports['describe']=function(_0x23a538,_0x18c29b){return db[_0x466a('0x47')]['describe']()[_0x466a('0x12')](respondWithResult(_0x18c29b,null))[_0x466a('0x5e')](handleError(_0x18c29b,null));};exports[_0x466a('0x69')]=function(_0x1553ed,_0x37b8c1){if(_0x1553ed[_0x466a('0x65')]['id']){delete _0x1553ed[_0x466a('0x65')]['id'];}return db['MailAccount'][_0x466a('0x64')]({'where':{'id':_0x1553ed['params']['id']}})[_0x466a('0x12')](handleEntityNotFound(_0x37b8c1,null))[_0x466a('0x12')](function(_0x2c0dd8){if(_0x2c0dd8){_0x1553ed[_0x466a('0x65')][_0x466a('0x6a')]=_0x2c0dd8['id'];return db['Disposition'][_0x466a('0x6b')](_0x1553ed[_0x466a('0x65')]);}})[_0x466a('0x12')](respondWithResult(_0x37b8c1,null))[_0x466a('0x5e')](handleError(_0x37b8c1,null));};exports[_0x466a('0x6c')]=function(_0xa00fe0,_0x342c80){var _0x2d7a4d={'raw':![],'where':{}};var _0x3ab306={};var _0xfbdac7={'count':0x0,'rows':[]};return db[_0x466a('0x47')][_0x466a('0x6d')]({'where':{'id':_0xa00fe0['params']['id']}})[_0x466a('0x12')](handleEntityNotFound(_0x342c80,null))[_0x466a('0x12')](function(_0x3c0e9f){if(_0x3c0e9f){_0x3ab306[_0x466a('0x4b')]=_[_0x466a('0x4d')](db['Disposition'][_0x466a('0x48')]);_0x3ab306[_0x466a('0x4c')]=_['keys'](_0xa00fe0['query']);_0x3ab306[_0x466a('0x4e')]=_[_0x466a('0x50')](_0x3ab306['model'],_0x3ab306[_0x466a('0x4c')]);_0x2d7a4d['attributes']=_[_0x466a('0x50')](_0x3ab306[_0x466a('0x4b')],qs[_0x466a('0x51')](_0xa00fe0[_0x466a('0x4c')]['fields']));_0x2d7a4d[_0x466a('0x4f')]=_0x2d7a4d[_0x466a('0x4f')]['length']?_0x2d7a4d[_0x466a('0x4f')]:_0x3ab306['model'];if(!_0xa00fe0[_0x466a('0x4c')][_0x466a('0x52')](_0x466a('0x6e'))){_0x2d7a4d['limit']=qs[_0x466a('0x53')](_0xa00fe0['query']['limit']);_0x2d7a4d[_0x466a('0x20')]=qs[_0x466a('0x20')](_0xa00fe0[_0x466a('0x4c')][_0x466a('0x20')]);}_0x2d7a4d[_0x466a('0x54')]=qs['sort'](_0xa00fe0[_0x466a('0x4c')][_0x466a('0x55')]);_0x2d7a4d['where']=qs[_0x466a('0x4e')](_[_0x466a('0x57')](_0xa00fe0[_0x466a('0x4c')],_0x3ab306[_0x466a('0x4e')]));_0x2d7a4d[_0x466a('0x56')]['MailAccountId']=_0x3c0e9f['id'];if(_0xa00fe0[_0x466a('0x4c')][_0x466a('0x58')]){_0x2d7a4d['where']=_[_0x466a('0x59')](_0x2d7a4d[_0x466a('0x56')],{'$or':_[_0x466a('0x46')](_0x2d7a4d[_0x466a('0x4f')],function(_0x45a5da){var _0x330a75={};_0x330a75[_0x45a5da]={'$like':'%'+_0xa00fe0[_0x466a('0x4c')][_0x466a('0x58')]+'%'};return _0x330a75;})});}_0x2d7a4d=_[_0x466a('0x59')]({},_0x2d7a4d,_0xa00fe0[_0x466a('0x63')]);return db[_0x466a('0x6f')][_0x466a('0x1f')]({'where':_0x2d7a4d[_0x466a('0x56')]})[_0x466a('0x12')](function(_0x149913){_0xfbdac7[_0x466a('0x1f')]=_0x149913;if(_0xa00fe0[_0x466a('0x4c')][_0x466a('0x5b')]){_0x2d7a4d['include']=[{'all':!![]}];}return db[_0x466a('0x6f')]['findAll'](_0x2d7a4d);})[_0x466a('0x12')](function(_0x2c6b4e){_0xfbdac7['rows']=_0x2c6b4e;return _0xfbdac7;});}})[_0x466a('0x12')](respondWithFilteredResult(_0x342c80,_0x2d7a4d))[_0x466a('0x5e')](handleError(_0x342c80,null));};exports['removeDispositions']=function(_0x44b45d,_0x4984b0){return db[_0x466a('0x47')][_0x466a('0x64')]({'where':{'id':_0x44b45d['params']['id']}})['then'](handleEntityNotFound(_0x4984b0,null))['then'](function(_0x40507c){if(_0x40507c){return _0x40507c[_0x466a('0x70')](_0x44b45d[_0x466a('0x4c')][_0x466a('0x71')]);}})[_0x466a('0x12')](respondWithStatusCode(_0x4984b0,null))[_0x466a('0x5e')](handleError(_0x4984b0,null));};exports[_0x466a('0x72')]=function(_0x47a20b,_0x23d9e8){if(_0x47a20b[_0x466a('0x65')]['id']){delete _0x47a20b[_0x466a('0x65')]['id'];}return db['MailAccount'][_0x466a('0x64')]({'where':{'id':_0x47a20b[_0x466a('0x60')]['id']}})[_0x466a('0x12')](handleEntityNotFound(_0x23d9e8,null))[_0x466a('0x12')](function(_0x3c6099){if(_0x3c6099){_0x47a20b[_0x466a('0x65')][_0x466a('0x6a')]=_0x3c6099['id'];return db['CannedAnswer'][_0x466a('0x6b')](_0x47a20b['body']);}})['then'](respondWithResult(_0x23d9e8,null))[_0x466a('0x5e')](handleError(_0x23d9e8,null));};exports[_0x466a('0x73')]=function(_0x5799a3,_0x31630f){var _0x6f6686={'raw':![],'where':{}};var _0x47b3dc={};var _0x442cac={'count':0x0,'rows':[]};return db[_0x466a('0x47')][_0x466a('0x6d')]({'where':{'id':_0x5799a3[_0x466a('0x60')]['id']}})['then'](handleEntityNotFound(_0x31630f,null))[_0x466a('0x12')](function(_0xc15a58){if(_0xc15a58){_0x47b3dc[_0x466a('0x4b')]=_[_0x466a('0x4d')](db['CannedAnswer']['rawAttributes']);_0x47b3dc['query']=_[_0x466a('0x4d')](_0x5799a3['query']);_0x47b3dc[_0x466a('0x4e')]=_[_0x466a('0x50')](_0x47b3dc[_0x466a('0x4b')],_0x47b3dc[_0x466a('0x4c')]);_0x6f6686['attributes']=_['intersection'](_0x47b3dc['model'],qs['fields'](_0x5799a3[_0x466a('0x4c')][_0x466a('0x51')]));_0x6f6686['attributes']=_0x6f6686[_0x466a('0x4f')]['length']?_0x6f6686[_0x466a('0x4f')]:_0x47b3dc[_0x466a('0x4b')];if(!_0x5799a3[_0x466a('0x4c')][_0x466a('0x52')]('nolimit')){_0x6f6686['limit']=qs['limit'](_0x5799a3['query'][_0x466a('0x53')]);_0x6f6686[_0x466a('0x20')]=qs[_0x466a('0x20')](_0x5799a3['query'][_0x466a('0x20')]);}_0x6f6686[_0x466a('0x54')]=qs[_0x466a('0x55')](_0x5799a3['query'][_0x466a('0x55')]);_0x6f6686[_0x466a('0x56')]=qs[_0x466a('0x4e')](_[_0x466a('0x57')](_0x5799a3[_0x466a('0x4c')],_0x47b3dc[_0x466a('0x4e')]));_0x6f6686['where'][_0x466a('0x6a')]=_0xc15a58['id'];if(_0x5799a3[_0x466a('0x4c')]['filter']){_0x6f6686[_0x466a('0x56')]=_[_0x466a('0x59')](_0x6f6686[_0x466a('0x56')],{'$or':_['map'](_0x6f6686['attributes'],function(_0x1f82d7){var _0x52ca2f={};_0x52ca2f[_0x1f82d7]={'$like':'%'+_0x5799a3[_0x466a('0x4c')][_0x466a('0x58')]+'%'};return _0x52ca2f;})});}_0x6f6686=_[_0x466a('0x59')]({},_0x6f6686,_0x5799a3['options']);return db[_0x466a('0x74')][_0x466a('0x1f')]({'where':_0x6f6686[_0x466a('0x56')]})[_0x466a('0x12')](function(_0x2542a6){_0x442cac[_0x466a('0x1f')]=_0x2542a6;if(_0x5799a3[_0x466a('0x4c')][_0x466a('0x5b')]){_0x6f6686['include']=[{'all':!![]}];}return db[_0x466a('0x74')][_0x466a('0x5d')](_0x6f6686);})[_0x466a('0x12')](function(_0x2a041b){_0x442cac['rows']=_0x2a041b;return _0x442cac;});}})[_0x466a('0x12')](respondWithFilteredResult(_0x31630f,_0x6f6686))[_0x466a('0x5e')](handleError(_0x31630f,null));};exports['removeAnswers']=function(_0x560f60,_0x17ed79){return db[_0x466a('0x47')][_0x466a('0x64')]({'where':{'id':_0x560f60[_0x466a('0x60')]['id']}})['then'](handleEntityNotFound(_0x17ed79,null))[_0x466a('0x12')](function(_0x1600a9){if(_0x1600a9){return _0x1600a9[_0x466a('0x75')](_0x560f60[_0x466a('0x4c')]['ids']);}})['then'](respondWithStatusCode(_0x17ed79,null))['catch'](handleError(_0x17ed79,null));};exports[_0x466a('0x6b')]=function(_0x584378,_0x5adf0f){var _0x23cf7e={'name':_0x584378['body'][_0x466a('0x28')],'key':_0x584378['body'][_0x466a('0x76')],'provider':_0x584378[_0x466a('0x65')][_0x466a('0x66')]===_0x466a('0x67')?null:_0x584378['body'][_0x466a('0x66')],'email':_0x584378['body']['email'],'ListId':_0x584378['body'][_0x466a('0x77')],'active':!_[_0x466a('0x78')](_0x584378['body'][_0x466a('0x79')])?_0x584378[_0x466a('0x65')][_0x466a('0x79')]:!![],'description':_0x584378[_0x466a('0x65')][_0x466a('0x7a')]||null};var _0x56318e=getAuthenticationOptions(_0x23cf7e['provider'],_0x584378[_0x466a('0x65')]);_0x23cf7e[_0x466a('0x40')]=_0x56318e['Imap'];_0x23cf7e[_0x466a('0x43')]=_0x56318e[_0x466a('0x43')];return db[_0x466a('0x47')][_0x466a('0x6b')](_0x23cf7e,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x466a('0x42')],'as':'Imap'}]})[_0x466a('0x12')](function(_0x288462){var _0x4425b2=_0x584378[_0x466a('0x35')][_0x466a('0x24')]({'plain':!![]});if(!_0x4425b2)throw new Error(_0x466a('0x7b'));if(_0x4425b2[_0x466a('0x7c')]===_0x466a('0x35')){var _0x3bdb05=_0x288462[_0x466a('0x24')]({'plain':!![]});return db['UserProfileSection'][_0x466a('0x64')]({'where':{'name':_0x466a('0x25'),'userProfileId':_0x4425b2[_0x466a('0x7d')]},'raw':!![]})[_0x466a('0x12')](function(_0x19a851){if(_0x19a851&&_0x19a851[_0x466a('0x7e')]===0x0){return db[_0x466a('0x26')]['create']({'name':_0x3bdb05[_0x466a('0x28')],'resourceId':_0x3bdb05['id'],'type':_0x19a851['name'],'sectionId':_0x19a851['id']},{})[_0x466a('0x12')](function(){return _0x288462;});}else{return _0x288462;}})[_0x466a('0x5e')](function(_0x30eaa0){logger[_0x466a('0x17')](_0x466a('0x7f'),_0x30eaa0);throw _0x30eaa0;});}return _0x288462;})[_0x466a('0x12')](respondWithResult(_0x5adf0f,0xc9))[_0x466a('0x5e')](handleError(_0x5adf0f,null));};exports['getImap']=function(_0x19c1ea,_0x141c2b){return db['MailAccount']['findOne']({'where':{'id':_0x19c1ea[_0x466a('0x60')]['id']}})[_0x466a('0x12')](handleEntityNotFound(_0x141c2b,null))['then'](function(_0x322335){if(_0x322335){return _0x322335[_0x466a('0x80')]();}return null;})[_0x466a('0x12')](respondWithResult(_0x141c2b,null))[_0x466a('0x5e')](handleError(_0x141c2b,null));};exports[_0x466a('0x81')]=function(_0x210341,_0x3d1904){if(_0x210341[_0x466a('0x65')]['id']){delete _0x210341[_0x466a('0x65')]['id'];}return db['MailAccount'][_0x466a('0x64')]({'where':{'id':_0x210341[_0x466a('0x60')]['id']}})['then'](handleEntityNotFound(_0x3d1904,null))[_0x466a('0x12')](function(_0x2134ff){if(_0x2134ff){_0x210341[_0x466a('0x65')][_0x466a('0x6a')]=_0x2134ff['id'];return db[_0x466a('0x42')]['create'](_0x210341[_0x466a('0x65')]);}})[_0x466a('0x12')](respondWithResult(_0x3d1904,null))[_0x466a('0x5e')](handleError(_0x3d1904,null));};exports[_0x466a('0x82')]=function(_0x9cfc78,_0x4f0a2a){return db[_0x466a('0x47')]['findOne']({'where':{'id':_0x9cfc78[_0x466a('0x60')]['id']}})[_0x466a('0x12')](handleEntityNotFound(_0x4f0a2a,null))['then'](function(_0x54b81f){if(_0x54b81f){return _0x54b81f[_0x466a('0x83')](null);}return null;})[_0x466a('0x12')](respondWithStatusCode(_0x4f0a2a,null))[_0x466a('0x5e')](handleError(_0x4f0a2a,null));};exports['getSmtp']=function(_0x556381,_0x101b9e){return db['MailAccount'][_0x466a('0x6d')]({'where':{'id':_0x556381['params']['id']}})[_0x466a('0x12')](handleEntityNotFound(_0x101b9e,null))[_0x466a('0x12')](function(_0x22fe1e){if(_0x22fe1e){return _0x22fe1e[_0x466a('0x84')]();}return null;})['then'](respondWithResult(_0x101b9e,null))[_0x466a('0x5e')](handleError(_0x101b9e,null));};exports[_0x466a('0x85')]=function(_0x536dcd,_0xf9750d){if(_0x536dcd[_0x466a('0x65')]['id']){delete _0x536dcd[_0x466a('0x65')]['id'];}return db[_0x466a('0x47')]['find']({'where':{'id':_0x536dcd[_0x466a('0x60')]['id']}})[_0x466a('0x12')](handleEntityNotFound(_0xf9750d,null))[_0x466a('0x12')](function(_0x6105c8){if(_0x6105c8){_0x536dcd['body'][_0x466a('0x6a')]=_0x6105c8['id'];return db[_0x466a('0x61')][_0x466a('0x6b')](_0x536dcd[_0x466a('0x65')]);}})[_0x466a('0x12')](respondWithResult(_0xf9750d,null))[_0x466a('0x5e')](handleError(_0xf9750d,null));};exports[_0x466a('0x86')]=function(_0x407468,_0x2a972c){return db[_0x466a('0x47')][_0x466a('0x6d')]({'where':{'id':_0x407468[_0x466a('0x60')]['id']}})[_0x466a('0x12')](handleEntityNotFound(_0x2a972c,null))[_0x466a('0x12')](function(_0x3f30c5){if(_0x3f30c5){return _0x3f30c5[_0x466a('0x87')](null);}return null;})[_0x466a('0x12')](respondWithStatusCode(_0x2a972c,null))[_0x466a('0x5e')](handleError(_0x2a972c,null));};exports['addInteraction']=function(_0xb4c3a3,_0x5d05eb){return db[_0x466a('0x88')][_0x466a('0x64')]({'where':{'id':_0xb4c3a3[_0x466a('0x60')]['id']}})[_0x466a('0x12')](handleEntityNotFound(_0x5d05eb,null))[_0x466a('0x12')](function(_0x22660e){if(_0x22660e){return _0x22660e[_0x466a('0x89')](_0xb4c3a3['body'][_0x466a('0x71')],_[_0x466a('0x8a')](_0xb4c3a3[_0x466a('0x65')],[_0x466a('0x71'),'id'])||{});}})['then'](respondWithResult(_0x5d05eb,null))[_0x466a('0x5e')](handleError(_0x5d05eb,null));};exports[_0x466a('0x8b')]=function(_0x134476,_0x26145e){var _0x4133a4={'raw':![],'where':{}};var _0x1beafb={};var _0x5c70db={'count':0x0,'rows':[]};return db['MailAccount'][_0x466a('0x6d')]({'where':{'id':_0x134476['params']['id']}})[_0x466a('0x12')](handleEntityNotFound(_0x26145e,null))[_0x466a('0x12')](function(_0x151730){if(_0x151730){_0x1beafb[_0x466a('0x4b')]=_[_0x466a('0x4d')](db['MailInteraction']['rawAttributes']);_0x1beafb[_0x466a('0x4c')]=_[_0x466a('0x4d')](_0x134476[_0x466a('0x4c')]);_0x1beafb[_0x466a('0x4e')]=_[_0x466a('0x50')](_0x1beafb['model'],_0x1beafb[_0x466a('0x4c')]);_0x4133a4[_0x466a('0x4f')]=_[_0x466a('0x50')](_0x1beafb[_0x466a('0x4b')],qs['fields'](_0x134476[_0x466a('0x4c')][_0x466a('0x51')]));_0x4133a4[_0x466a('0x4f')]=_0x4133a4[_0x466a('0x4f')][_0x466a('0x62')]?_0x4133a4[_0x466a('0x4f')]:_0x1beafb[_0x466a('0x4b')];if(!_0x134476[_0x466a('0x4c')]['hasOwnProperty']('nolimit')){_0x4133a4['limit']=qs[_0x466a('0x53')](_0x134476[_0x466a('0x4c')][_0x466a('0x53')]);_0x4133a4['offset']=qs[_0x466a('0x20')](_0x134476['query']['offset']);}_0x4133a4[_0x466a('0x54')]=qs['sort'](_0x134476[_0x466a('0x4c')][_0x466a('0x55')]);_0x4133a4[_0x466a('0x56')]=qs[_0x466a('0x4e')](_[_0x466a('0x57')](_0x134476[_0x466a('0x4c')],_0x1beafb[_0x466a('0x4e')]));_0x4133a4[_0x466a('0x56')][_0x466a('0x6a')]=_0x151730['id'];if(_0x134476[_0x466a('0x4c')][_0x466a('0x58')]){_0x4133a4[_0x466a('0x56')]=_['merge'](_0x4133a4['where'],{'$or':_[_0x466a('0x46')](_0x4133a4[_0x466a('0x4f')],function(_0xcc8ecd){var _0x28cb56={};_0x28cb56[_0xcc8ecd]={'$like':'%'+_0x134476['query'][_0x466a('0x58')]+'%'};return _0x28cb56;})});}_0x4133a4=_[_0x466a('0x59')]({},_0x4133a4,_0x134476[_0x466a('0x63')]);return db[_0x466a('0x88')][_0x466a('0x1f')]({'where':_0x4133a4['where']})[_0x466a('0x12')](function(_0x38b3ac){_0x5c70db[_0x466a('0x1f')]=_0x38b3ac;if(_0x134476[_0x466a('0x4c')]['includeAll']){_0x4133a4[_0x466a('0x5c')]=[{'model':db[_0x466a('0x8c')],'as':_0x466a('0x8d'),'required':![]},{'model':db[_0x466a('0x8e')],'as':_0x466a('0x8f'),'attributes':[_0x466a('0x28'),_0x466a('0x90'),_0x466a('0x91')],'required':![]},{'model':db[_0x466a('0x92')],'as':_0x466a('0x93'),'attributes':['id',_0x466a('0x28'),_0x466a('0x94')],'where':_0x134476[_0x466a('0x4c')][_0x466a('0x95')]?{'id':_0x134476[_0x466a('0x4c')][_0x466a('0x95')]}:undefined,'required':_0x134476[_0x466a('0x4c')]['tag']?!![]:![]}];}return db[_0x466a('0x88')][_0x466a('0x5d')](_0x4133a4);})[_0x466a('0x12')](function(_0x5d1c98){_0x5c70db[_0x466a('0x96')]=_0x5d1c98;return _0x5c70db;});}})[_0x466a('0x12')](respondWithFilteredResult(_0x26145e,_0x4133a4))[_0x466a('0x5e')](handleError(_0x26145e,null));};exports[_0x466a('0x97')]=function addApplications(_0x586c03,_0xc46f92){var _0xe58f96=_0x586c03[_0x466a('0x60')]['id'];var _0x81f8fa=_0x586c03[_0x466a('0x65')];var _0x100d47=0xc8;var _0xdec584=null;return db[_0x466a('0x98')][_0x466a('0x99')]({'isolationLevel':db['sequelize'][_0x466a('0x9a')][_0x466a('0x9b')][_0x466a('0x9c')]},function(_0x3105e5){return db['MailAccount'][_0x466a('0x6d')]({'where':{'id':_0xe58f96},'transaction':_0x3105e5})[_0x466a('0x12')](function(_0xa6a260){if(_0xa6a260){return db[_0x466a('0x9d')][_0x466a('0x23')]({'where':{'MailAccountId':_0xe58f96},'transaction':_0x3105e5})['then'](function(){var _0x13993e=_[_0x466a('0x46')](_0x81f8fa,function(_0xfc5ee4){_0xfc5ee4[_0x466a('0x6a')]=_0xe58f96;return _0xfc5ee4;});return db['MailApplication'][_0x466a('0x9e')](_0x13993e,{'transaction':_0x3105e5});});}else{_0x100d47=0x194;_0xdec584=[];}});})[_0x466a('0x12')](function(){if(_0x100d47!==0x194){return db[_0x466a('0x9d')][_0x466a('0x9f')]({'where':{'MailAccountId':_0xe58f96},'order':_0x466a('0xa0')})[_0x466a('0x12')](function(_0x22e5d4){_0xdec584=_0x22e5d4;});}})['catch'](function(_0xec5714){_0x100d47=0x1f4;logger[_0x466a('0x17')](_0xec5714[_0x466a('0x27')]);if(_0xec5714[_0x466a('0x28')]){delete _0xec5714['name'];}_0xdec584=_0xec5714;})['finally'](function(){if(_0xdec584===null){_0xc46f92[_0x466a('0x1a')](_0x100d47);}else{if(_0x100d47===0x1f4){_0xc46f92['status'](_0x100d47)[_0x466a('0x29')](_0xdec584);}else{_0xc46f92['status'](_0x100d47)[_0x466a('0x1d')](_0xdec584);}}});};exports['getApplications']=function(_0x5e01fe,_0x2e8215){var _0x358c4f={};var _0x363f62={};var _0x457750;var _0x47c38f;return db[_0x466a('0x47')]['findOne']({'where':{'id':_0x5e01fe['params']['id']}})[_0x466a('0x12')](handleEntityNotFound(_0x2e8215,null))[_0x466a('0x12')](function(_0x41999d){if(_0x41999d){_0x457750=_0x41999d;_0x363f62[_0x466a('0x4b')]=_['keys'](db['MailApplication'][_0x466a('0x48')]);_0x363f62[_0x466a('0x4c')]=_['keys'](_0x5e01fe['query']);_0x363f62[_0x466a('0x4e')]=_['intersection'](_0x363f62[_0x466a('0x4b')],_0x363f62[_0x466a('0x4c')]);_0x358c4f[_0x466a('0x4f')]=_['intersection'](_0x363f62['model'],qs[_0x466a('0x51')](_0x5e01fe[_0x466a('0x4c')]['fields']));_0x358c4f[_0x466a('0x4f')]=_0x358c4f[_0x466a('0x4f')][_0x466a('0x62')]?_0x358c4f[_0x466a('0x4f')]:_0x363f62[_0x466a('0x4b')];_0x358c4f[_0x466a('0x54')]=qs[_0x466a('0x55')](_0x5e01fe['query'][_0x466a('0x55')]);_0x358c4f[_0x466a('0x56')]=qs[_0x466a('0x4e')](_[_0x466a('0x57')](_0x5e01fe[_0x466a('0x4c')],_0x363f62[_0x466a('0x4e')]));if(_0x5e01fe[_0x466a('0x4c')][_0x466a('0x58')]){_0x358c4f[_0x466a('0x56')]=_['merge'](_0x358c4f[_0x466a('0x56')],{'$or':_[_0x466a('0x46')](_0x358c4f['attributes'],function(_0x5943f6){var _0x3b86d3={};_0x3b86d3[_0x5943f6]={'$like':'%'+_0x5e01fe['query'][_0x466a('0x58')]+'%'};return _0x3b86d3;})});}_0x358c4f=_[_0x466a('0x59')]({},_0x358c4f,_0x5e01fe[_0x466a('0x63')]);return _0x457750[_0x466a('0xa1')](_0x358c4f);}})[_0x466a('0x12')](function(_0x876422){if(_0x876422){_0x47c38f=_0x876422[_0x466a('0x62')];if(!_0x5e01fe['query'][_0x466a('0x52')](_0x466a('0x6e'))){_0x358c4f['limit']=qs[_0x466a('0x53')](_0x5e01fe[_0x466a('0x4c')][_0x466a('0x53')]);_0x358c4f[_0x466a('0x20')]=qs[_0x466a('0x20')](_0x5e01fe[_0x466a('0x4c')]['offset']);}return _0x457750['getApplications'](_0x358c4f);}})['then'](function(_0x5f2579){if(_0x5f2579){return _0x5f2579?{'count':_0x47c38f,'rows':_0x5f2579}:null;}})[_0x466a('0x12')](respondWithResult(_0x2e8215,null))['catch'](handleError(_0x2e8215,null));};exports[_0x466a('0xa2')]=function(_0x12e6d7,_0xd6d54b){var _0x9eca81={'raw':!![],'where':{}};var _0x3b5a98={};var _0x36dedb={'count':0x0,'rows':[]};return db[_0x466a('0x47')][_0x466a('0x6d')]({'where':{'id':_0x12e6d7[_0x466a('0x60')]['id']}})['then'](handleEntityNotFound(_0xd6d54b,null))[_0x466a('0x12')](function(_0x1b7b4b){if(_0x1b7b4b){_0x3b5a98[_0x466a('0x4b')]=_[_0x466a('0x4d')](db[_0x466a('0xa3')][_0x466a('0x48')]);_0x3b5a98[_0x466a('0x4c')]=_[_0x466a('0x4d')](_0x12e6d7['query']);_0x3b5a98[_0x466a('0x4e')]=_[_0x466a('0x50')](_0x3b5a98[_0x466a('0x4b')],_0x3b5a98[_0x466a('0x4c')]);_0x9eca81['attributes']=_[_0x466a('0x50')](_0x3b5a98[_0x466a('0x4b')],qs['fields'](_0x12e6d7[_0x466a('0x4c')][_0x466a('0x51')]));_0x9eca81[_0x466a('0x4f')]=_0x9eca81[_0x466a('0x4f')]['length']?_0x9eca81[_0x466a('0x4f')]:_0x3b5a98['model'];if(!_0x12e6d7[_0x466a('0x4c')][_0x466a('0x52')](_0x466a('0x6e'))){_0x9eca81[_0x466a('0x53')]=qs[_0x466a('0x53')](_0x12e6d7['query'][_0x466a('0x53')]);_0x9eca81[_0x466a('0x20')]=qs['offset'](_0x12e6d7[_0x466a('0x4c')][_0x466a('0x20')]);}_0x9eca81['order']=qs[_0x466a('0x55')](_0x12e6d7[_0x466a('0x4c')][_0x466a('0x55')]);_0x9eca81[_0x466a('0x56')]=qs[_0x466a('0x4e')](_[_0x466a('0x57')](_0x12e6d7[_0x466a('0x4c')],_0x3b5a98[_0x466a('0x4e')]));_0x9eca81[_0x466a('0x56')]['MailAccountId']=_0x1b7b4b['id'];if(_0x12e6d7[_0x466a('0x4c')][_0x466a('0x58')]){_0x9eca81['where']=_['merge'](_0x9eca81['where'],{'$or':_[_0x466a('0x46')](_0x9eca81[_0x466a('0x4f')],function(_0x1209bb){var _0x4e594d={};_0x4e594d[_0x1209bb]={'$like':'%'+_0x12e6d7[_0x466a('0x4c')]['filter']+'%'};return _0x4e594d;})});}if(_0x12e6d7[_0x466a('0x4c')][_0x466a('0xa4')]){var _0x4bd015=_0x12e6d7[_0x466a('0x4c')][_0x466a('0xa4')][_0x466a('0xa5')](',');var _0x31c1d5={};_0x31c1d5[_0x4bd015[0x0]]={'$gte':moment(_0x4bd015[0x1])[_0x466a('0xa6')](_0x466a('0xa7'))};_0x9eca81[_0x466a('0x56')]=_[_0x466a('0x59')](_0x9eca81[_0x466a('0x56')],_0x31c1d5);}_0x9eca81=_['merge']({},_0x9eca81,_0x12e6d7[_0x466a('0x63')]);return db[_0x466a('0xa3')][_0x466a('0x1f')]({'where':_0x9eca81['where']})[_0x466a('0x12')](function(_0x238968){_0x36dedb['count']=_0x238968;if(_0x12e6d7['query'][_0x466a('0x5b')]){_0x9eca81[_0x466a('0x5c')]=[{'all':!![]}];}return db[_0x466a('0xa3')][_0x466a('0x5d')](_0x9eca81);})[_0x466a('0x12')](function(_0x1d7801){if(_0x12e6d7[_0x466a('0x4c')][_0x466a('0xa8')]===_0x466a('0xa9')){for(var _0x15dcf4=0x0;_0x15dcf4<_0x1d7801['length'];_0x15dcf4++){_0x1d7801[_0x15dcf4][_0x466a('0x65')]=juice(_0x1d7801[_0x15dcf4]['body']);}}_0x36dedb[_0x466a('0x96')]=_0x1d7801;return _0x36dedb;});}})[_0x466a('0x12')](respondWithFilteredResult(_0xd6d54b,_0x9eca81))[_0x466a('0x5e')](handleError(_0xd6d54b,null));};exports[_0x466a('0x29')]=function(_0x3b711d,_0x468177){var _0x1e311a,_0x5f5a2a={},_0x363eaa;if(_0x3b711d[_0x466a('0x65')]['to']){_0x363eaa=_0x3b711d[_0x466a('0x65')]['to']['split'](',')[0x0];}return db[_0x466a('0x47')][_0x466a('0x64')]({'where':{'id':_0x3b711d[_0x466a('0x60')]['id']},'include':[{'model':db[_0x466a('0xaa')],'as':_0x466a('0xab'),'include':[{'model':db['CmContact'],'as':_0x466a('0xac'),'where':{'email':_0x363eaa},'limit':0x1,'order':[[_0x466a('0xad'),'DESC']]}]},{'model':db[_0x466a('0x61')],'as':_0x466a('0x43'),'raw':!![],'include':[{'model':db[_0x466a('0xae')],'as':_0x466a('0xae'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x468177,null))[_0x466a('0x12')](function(_0x50c6fc){if(!_0x50c6fc)return;_0x1e311a=_0x50c6fc;if(!_0x50c6fc[_0x466a('0x43')])throw new Error(_0x466a('0xaf'));if(_[_0x466a('0x78')](_0x3b711d[_0x466a('0x65')][_0x466a('0xb0')])){_0x3b711d[_0x466a('0x65')][_0x466a('0xb0')]=util[_0x466a('0xa6')](_0x466a('0xb1'),_0x50c6fc['name'],_0x50c6fc[_0x466a('0xb2')]||_0x50c6fc[_0x466a('0x43')]['user']);}if(_0x3b711d[_0x466a('0x65')][_0x466a('0xb3')]&&_0x3b711d['body'][_0x466a('0xb3')][_0x466a('0x62')]){for(var _0x215174=0x0;_0x215174<_0x3b711d[_0x466a('0x65')][_0x466a('0xb3')]['length'];_0x215174+=0x1){_0x3b711d[_0x466a('0x65')][_0x466a('0xb3')][_0x215174]={'filename':_0x3b711d[_0x466a('0x65')][_0x466a('0xb3')][_0x215174][_0x466a('0x28')],'path':path['join'](config['root'],_0x466a('0xb4'),_0x3b711d[_0x466a('0x65')][_0x466a('0xb3')][_0x215174][_0x466a('0xb5')])};}}var _0x10a809=_0x50c6fc[_0x466a('0xb6')]();return respondWithRpcPromise(_0x466a('0xb7'),_0x466a('0xb8'),{'account':_0x10a809,'message':_0x3b711d['body']});})[_0x466a('0x12')](function(_0x33d690){if(!_0x33d690)return;_0x5f5a2a=_0x33d690;if(!_0x1e311a[_0x466a('0xab')])throw new Error('List\x20not\x20found');if(_0x1e311a[_0x466a('0xab')][_0x466a('0xac')][_0x466a('0x62')])return _0x1e311a[_0x466a('0xab')]['Contacts'][0x0];return db[_0x466a('0x8c')][_0x466a('0x6b')](_[_0x466a('0x9')](_0x3b711d[_0x466a('0x65')],{'firstName':_0x3b711d['body']['to'],'email':_0x3b711d['body']['to'],'phone':_0x3b711d[_0x466a('0x65')]['to'],'ListId':_0x1e311a[_0x466a('0x77')]}));})[_0x466a('0x12')](function(_0x4f70cb){if(!_0x4f70cb)return;var _0x5b9ba4={'UserId':_0x3b711d[_0x466a('0x35')]['id'],'ContactId':_0x4f70cb['id'],'MailAccountId':_0x1e311a['id'],'inReplyTo':_0x5f5a2a['messageId'],'to':_0x3b711d[_0x466a('0x65')][_0x466a('0xb0')],'cc':_0x3b711d[_0x466a('0x65')]['cc'],'subject':_0x3b711d[_0x466a('0x65')][_0x466a('0xb9')],'attach':_0x3b711d[_0x466a('0x65')]['attach'],'firstMsgDirection':_0x466a('0xba'),'lastMsgAt':moment()[_0x466a('0xa6')](_0x466a('0xa7')),'lastMsgDirection':_0x466a('0xba'),'Messages':[_['merge'](_0x3b711d[_0x466a('0x65')],{'messageId':_0x5f5a2a['messageId'],'sentAt':moment()[_0x466a('0xa6')](_0x466a('0xa7')),'read':!![],'MailAccountId':_0x1e311a['id'],'UserId':_0x3b711d[_0x466a('0x35')]['id'],'ContactId':_0x4f70cb['id']})]};if(_0x3b711d['body'][_0x466a('0xbb')]){_0x5b9ba4=_['merge'](_0x5b9ba4,_0x3b711d[_0x466a('0x65')]['Interaction']);}return db[_0x466a('0x88')][_0x466a('0x6b')](_0x5b9ba4,{'include':[{'model':db['MailMessage'],'as':_0x466a('0xbc')}]});})[_0x466a('0x12')](respondWithResult(_0x468177,null))[_0x466a('0x5e')](handleError(_0x468177,null));};exports[_0x466a('0xbd')]=function(_0x5470a6,_0x4a57dc){return db[_0x466a('0x47')][_0x466a('0x64')]({'where':{'id':_0x5470a6['params']['id']},'include':[{'model':db[_0x466a('0x61')],'as':_0x466a('0x43'),'raw':!![],'include':[{'model':db[_0x466a('0xae')],'as':_0x466a('0xae'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x4a57dc,null))[_0x466a('0x12')](function(_0x385b11){if(!_0x385b11['Smtp'])return;var _0x5e21f9=_0x385b11[_0x466a('0xb6')]();return respondWithRpcPromise('VerifySmtp',_0x466a('0xbd'),{'account':_0x5e21f9});})[_0x466a('0x12')](respondWithResult(_0x4a57dc,null))[_0x466a('0x5e')](handleError(_0x4a57dc,null));};exports[_0x466a('0x23')]=function(_0x40a11e,_0x118daa){return db[_0x466a('0x47')][_0x466a('0x64')]({'where':{'id':_0x40a11e[_0x466a('0x60')]['id']}})[_0x466a('0x12')](handleEntityNotFound(_0x118daa,null))['then'](function(_0x1aa317){if(_0x1aa317&&_0x1aa317[_0x466a('0x3d')]){throw new db['Sequelize'][(_0x466a('0xbe'))](_0x466a('0xbf'));}return _0x1aa317;})['then'](removeEntity(_0x118daa,null))[_0x466a('0x5e')](handleError(_0x118daa,null));};exports[_0x466a('0xc0')]=function(_0x313814,_0x39b360){return db['MailAccount']['find']({'where':{'id':_0x313814[_0x466a('0x60')]['id']}})[_0x466a('0x12')](handleEntityNotFound(_0x39b360,null))[_0x466a('0x12')](function(_0x1d9f99){if(_0x1d9f99){return _0x1d9f99[_0x466a('0xc0')](_0x313814[_0x466a('0x65')][_0x466a('0x71')],_['omit'](_0x313814[_0x466a('0x65')],['ids','id'])||{})[_0x466a('0xc1')](function(_0x4ee90e){for(var _0x1bdb2a=0x0;_0x1bdb2a<_0x313814['body'][_0x466a('0x71')][_0x466a('0x62')];_0x1bdb2a+=0x1){socket[_0x466a('0xc2')](_0x466a('0xc3'),{'UserId':Number(_0x313814[_0x466a('0x65')][_0x466a('0x71')][_0x1bdb2a]),'MailAccountId':Number(_0x313814[_0x466a('0x60')]['id'])});}return _0x4ee90e;});}})['then'](respondWithResult(_0x39b360,null))['catch'](handleError(_0x39b360,null));};exports['removeAgents']=function(_0x193014,_0x47652d){return db[_0x466a('0x47')][_0x466a('0x64')]({'where':{'id':_0x193014[_0x466a('0x60')]['id']}})['then'](handleEntityNotFound(_0x47652d,null))['then'](function(_0x3e74e5){if(_0x3e74e5){return _0x3e74e5[_0x466a('0xc4')](_0x193014[_0x466a('0x4c')]['ids'])[_0x466a('0x12')](function(){if(_[_0x466a('0xc5')](_0x193014[_0x466a('0x4c')][_0x466a('0x71')])){for(var _0x25430f=0x0;_0x25430f<_0x193014[_0x466a('0x4c')][_0x466a('0x71')][_0x466a('0x62')];_0x25430f+=0x1){socket[_0x466a('0xc2')]('userMailAccount:remove',{'UserId':Number(_0x193014[_0x466a('0x4c')][_0x466a('0x71')][_0x25430f]),'MailAccountId':Number(_0x193014[_0x466a('0x60')]['id'])});}}else{socket['emit'](_0x466a('0xc6'),{'UserId':Number(_0x193014[_0x466a('0x4c')][_0x466a('0x71')]),'MailAccountId':Number(_0x193014[_0x466a('0x60')]['id'])});}});}})[_0x466a('0x12')](respondWithStatusCode(_0x47652d,null))['catch'](handleError(_0x47652d,null));};exports[_0x466a('0xc7')]=function(_0x58cc71,_0xa15b68){var _0xedf695={};var _0x36864c={};var _0x504541;var _0x36df9f;return db[_0x466a('0x47')][_0x466a('0x6d')]({'where':{'id':_0x58cc71[_0x466a('0x60')]['id']}})[_0x466a('0x12')](handleEntityNotFound(_0xa15b68,null))[_0x466a('0x12')](function(_0x29421b){if(_0x29421b){_0x504541=_0x29421b;_0x36864c['model']=_['keys'](db[_0x466a('0x8e')][_0x466a('0x48')]);_0x36864c[_0x466a('0x4c')]=_[_0x466a('0x4d')](_0x58cc71[_0x466a('0x4c')]);_0x36864c[_0x466a('0x4e')]=_[_0x466a('0x50')](_0x36864c[_0x466a('0x4b')],_0x36864c['query']);_0xedf695[_0x466a('0x4f')]=_[_0x466a('0x50')](_0x36864c[_0x466a('0x4b')],qs[_0x466a('0x51')](_0x58cc71[_0x466a('0x4c')][_0x466a('0x51')]));_0xedf695[_0x466a('0x4f')]=_0xedf695[_0x466a('0x4f')][_0x466a('0x62')]?_0xedf695['attributes']:_0x36864c[_0x466a('0x4b')];_0xedf695['order']=qs[_0x466a('0x55')](_0x58cc71[_0x466a('0x4c')][_0x466a('0x55')]);_0xedf695[_0x466a('0x56')]=qs['filters'](_[_0x466a('0x57')](_0x58cc71[_0x466a('0x4c')],_0x36864c[_0x466a('0x4e')]));if(_0x58cc71['query'][_0x466a('0x58')]){_0xedf695[_0x466a('0x56')]=_[_0x466a('0x59')](_0xedf695['where'],{'$or':_[_0x466a('0x46')](_0xedf695[_0x466a('0x4f')],function(_0x418ade){var _0x3b8038={};_0x3b8038[_0x418ade]={'$like':'%'+_0x58cc71[_0x466a('0x4c')]['filter']+'%'};return _0x3b8038;})});}_0xedf695=_[_0x466a('0x59')]({},_0xedf695,_0x58cc71[_0x466a('0x63')]);return _0x504541[_0x466a('0xc7')](_0xedf695);}})[_0x466a('0x12')](function(_0x3280fa){if(_0x3280fa){_0x36df9f=_0x3280fa['length'];if(!_0x58cc71[_0x466a('0x4c')][_0x466a('0x52')](_0x466a('0x6e'))){_0xedf695[_0x466a('0x53')]=qs[_0x466a('0x53')](_0x58cc71[_0x466a('0x4c')][_0x466a('0x53')]);_0xedf695[_0x466a('0x20')]=qs[_0x466a('0x20')](_0x58cc71[_0x466a('0x4c')][_0x466a('0x20')]);}return _0x504541['getAgents'](_0xedf695);}})['then'](function(_0x2daec9){if(_0x2daec9){return _0x2daec9?{'count':_0x36df9f,'rows':_0x2daec9}:null;}})[_0x466a('0x12')](respondWithResult(_0xa15b68,null))[_0x466a('0x5e')](handleError(_0xa15b68,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 9635dd6..e27b93b 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 _0x6f76=['update','remove','emit','hasOwnProperty','hook','exports','events','MailAccount','save'];(function(_0x2226c4,_0x389cd5){var _0x44607d=function(_0x4e9664){while(--_0x4e9664){_0x2226c4['push'](_0x2226c4['shift']());}};_0x44607d(++_0x389cd5);}(_0x6f76,0x14a));var _0x66f7=function(_0x34e1c4,_0x3ab124){_0x34e1c4=_0x34e1c4-0x0;var _0x4b2854=_0x6f76[_0x34e1c4];return _0x4b2854;};'use strict';var EventEmitter=require(_0x66f7('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x66f7('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x66f7('0x2'),'afterUpdate':_0x66f7('0x3'),'afterDestroy':_0x66f7('0x4')};function emitEvent(_0x18e50b){return function(_0xfe550c,_0x5ea5ef,_0x201af1){MailAccountEvents[_0x66f7('0x5')](_0x18e50b+':'+_0xfe550c['id'],_0xfe550c);MailAccountEvents[_0x66f7('0x5')](_0x18e50b,_0xfe550c);_0x201af1(null);};}for(var e in events){if(events[_0x66f7('0x6')](e)){var event=events[e];MailAccount[_0x66f7('0x7')](e,emitEvent(event));}}module[_0x66f7('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x96e0=['update','remove','emit','hasOwnProperty','hook','exports','events','MailAccount'];(function(_0x73ad5b,_0x3703f7){var _0x56284e=function(_0x16fa6e){while(--_0x16fa6e){_0x73ad5b['push'](_0x73ad5b['shift']());}};_0x56284e(++_0x3703f7);}(_0x96e0,0x7e));var _0x096e=function(_0x3d4e2c,_0x379fc4){_0x3d4e2c=_0x3d4e2c-0x0;var _0x4b60cc=_0x96e0[_0x3d4e2c];return _0x4b60cc;};'use strict';var EventEmitter=require(_0x096e('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x096e('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x096e('0x2'),'afterDestroy':_0x096e('0x3')};function emitEvent(_0x44027f){return function(_0xaf295b,_0x58d22d,_0x54a9b6){MailAccountEvents['emit'](_0x44027f+':'+_0xaf295b['id'],_0xaf295b);MailAccountEvents[_0x096e('0x4')](_0x44027f,_0xaf295b);_0x54a9b6(null);};}for(var e in events){if(events[_0x096e('0x5')](e)){var event=events[e];MailAccount[_0x096e('0x6')](e,emitEvent(event));}}module[_0x096e('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index b6b68fc..e2c7a55 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 _0x01b7=['OAuth2','data5','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth'];(function(_0xe896bf,_0x4f8e5e){var _0x4c7a8a=function(_0x410ff2){while(--_0x410ff2){_0xe896bf['push'](_0xe896bf['shift']());}};_0x4c7a8a(++_0x4f8e5e);}(_0x01b7,0x1bb));var _0x701b=function(_0x333f04,_0x35a1f4){_0x333f04=_0x333f04-0x0;var _0x24b6eb=_0x01b7[_0x333f04];return _0x24b6eb;};'use strict';var attributes=require(_0x701b('0x0'));module[_0x701b('0x1')]=function(_0x3496e4){return _0x3496e4[_0x701b('0x2')](_0x701b('0x3'),attributes,{'tableName':_0x701b('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x5f2746=this;var _0x97018b={'id':_0x5f2746['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5f2746[_0x701b('0x5')]!==_0x701b('0x6')){_0x97018b[_0x701b('0x7')]=_0x5f2746[_0x701b('0x5')];}else{_0x97018b[_0x701b('0x8')]=_0x5f2746[_0x701b('0x9')]['host'];_0x97018b[_0x701b('0xa')]=_0x5f2746['Smtp'][_0x701b('0xa')];_0x97018b[_0x701b('0xb')]=_0x5f2746[_0x701b('0x9')][_0x701b('0xb')];}if(_0x5f2746[_0x701b('0x9')][_0x701b('0xc')]){if(_0x5f2746[_0x701b('0x9')][_0x701b('0xd')]){if(!_0x5f2746[_0x701b('0x9')][_0x701b('0xe')])throw new Error(_0x701b('0xf'));_0x97018b[_0x701b('0x10')]={'type':_0x701b('0x11'),'user':_0x5f2746[_0x701b('0x9')]['user'],'accessToken':_0x5f2746[_0x701b('0x9')]['CloudProvider'][_0x701b('0x12')]};}else{_0x97018b[_0x701b('0x10')]={'user':_0x5f2746[_0x701b('0x9')]['user'],'pass':_0x5f2746[_0x701b('0x9')][_0x701b('0x13')]};}}return _0x97018b;}}});}; \ No newline at end of file +var _0xab32=['./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','custom','service','host','port','Smtp','secure','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','data5','user','pass'];(function(_0x265920,_0x45054f){var _0x4814da=function(_0x2c3c34){while(--_0x2c3c34){_0x265920['push'](_0x265920['shift']());}};_0x4814da(++_0x45054f);}(_0xab32,0xe4));var _0x2ab3=function(_0x316c42,_0x3391f0){_0x316c42=_0x316c42-0x0;var _0x2b38f7=_0xab32[_0x316c42];return _0x2b38f7;};'use strict';var attributes=require(_0x2ab3('0x0'));module[_0x2ab3('0x1')]=function(_0x3016ac){return _0x3016ac[_0x2ab3('0x2')](_0x2ab3('0x3'),attributes,{'tableName':_0x2ab3('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x135e13=this;var _0x471e6f={'id':_0x135e13['id'],'tls':{'rejectUnauthorized':![]}};if(_0x135e13[_0x2ab3('0x5')]!==_0x2ab3('0x6')){_0x471e6f[_0x2ab3('0x7')]=_0x135e13[_0x2ab3('0x5')];}else{_0x471e6f['host']=_0x135e13['Smtp'][_0x2ab3('0x8')];_0x471e6f[_0x2ab3('0x9')]=_0x135e13[_0x2ab3('0xa')]['port'];_0x471e6f[_0x2ab3('0xb')]=_0x135e13['Smtp'][_0x2ab3('0xb')];}if(_0x135e13[_0x2ab3('0xa')][_0x2ab3('0xc')]){if(_0x135e13['Smtp']['modernAuthentication']){if(!_0x135e13[_0x2ab3('0xa')][_0x2ab3('0xd')])throw new Error(_0x2ab3('0xe'));_0x471e6f[_0x2ab3('0xf')]={'type':'OAuth2','user':_0x135e13[_0x2ab3('0xa')]['user'],'accessToken':_0x135e13[_0x2ab3('0xa')][_0x2ab3('0xd')][_0x2ab3('0x10')]};}else{_0x471e6f['auth']={'user':_0x135e13['Smtp'][_0x2ab3('0x11')],'pass':_0x135e13[_0x2ab3('0xa')][_0x2ab3('0x12')]};}}return _0x471e6f;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 2f26d0f..031065b 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 _0x2b83=['attributes','include','map','model','ShowMailAccount','find','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','body','mail','difference','CmContact','ListId','from','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','updatedAt','DESC','MailApplication','Applications','Smtp','CloudProvider','List','account','omit','smtpOptions','applications','orderBy','priority','asc','autoclose','push','close','*,*,*,*','Contacts','defaults','create','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','inReplyTo','MailInteraction','spread','update','format','interaction','attachments','originCc','ChatWebsiteId','Email','ChatOfflineMessageId','User','unshift','agent','waitForTheAssignedAgent','queueId','MailQueue','name','waitForTheAssignedQueue','Start','startRouting','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where'];(function(_0x59987a,_0x399e11){var _0x460646=function(_0x32c3c0){while(--_0x32c3c0){_0x59987a['push'](_0x59987a['shift']());}};_0x460646(++_0x399e11);}(_0x2b83,0x1d3));var _0x32b8=function(_0x15a5cc,_0x527bf8){_0x15a5cc=_0x15a5cc-0x0;var _0x422ef7=_0x2b83[_0x15a5cc];return _0x422ef7;};'use strict';var _=require('lodash');var moment=require(_0x32b8('0x0'));var BPromise=require(_0x32b8('0x1'));var rs=require('randomstring');var Redis=require(_0x32b8('0x2'));var db=require(_0x32b8('0x3'))['db'];var logger=require(_0x32b8('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x32b8('0x5'));var client=jayson[_0x32b8('0x6')]['http']({'port':0x232c});config[_0x32b8('0x7')]=_['defaults'](config[_0x32b8('0x7')],{'host':_0x32b8('0x8'),'port':0x18eb});var socket=require(_0x32b8('0x9'))(new Redis(config[_0x32b8('0x7')]));require('./mailAccount.socket')[_0x32b8('0xa')](socket);function respondWithRpcPromise(_0x2c9e57,_0x48257a,_0x4f2aa0){return new BPromise(function(_0x3f58a5,_0x5ecf4e){return client[_0x32b8('0xb')](_0x2c9e57,_0x4f2aa0)[_0x32b8('0xc')](function(_0x465672){logger[_0x32b8('0xd')]('MailAccount,\x20%s,\x20%s',_0x48257a,_0x32b8('0xe'));logger[_0x32b8('0xf')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x48257a,'request\x20sent',JSON[_0x32b8('0x10')](_0x465672));if(_0x465672['error']){if(_0x465672[_0x32b8('0x11')]['code']===0x1f4){logger[_0x32b8('0x11')](_0x32b8('0x12'),_0x48257a,_0x465672[_0x32b8('0x11')][_0x32b8('0x13')]);return _0x5ecf4e(_0x465672[_0x32b8('0x11')]['message']);}logger['error'](_0x32b8('0x12'),_0x48257a,_0x465672['error']['message']);return _0x3f58a5(_0x465672['error'][_0x32b8('0x13')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x48257a,_0x32b8('0xe'));_0x3f58a5(_0x465672[_0x32b8('0x14')][_0x32b8('0x13')]);}})[_0x32b8('0x15')](function(_0x599bc3){logger['error']('MailAccount,\x20%s,\x20%s',_0x48257a,_0x599bc3);_0x5ecf4e(_0x599bc3);});});}exports[_0x32b8('0x16')]=function(_0x2ffea2){var _0x748394=this;return new Promise(function(_0x445da1,_0x4c6077){return db[_0x32b8('0x17')][_0x32b8('0x18')]({'raw':_0x2ffea2[_0x32b8('0x19')]?_0x2ffea2[_0x32b8('0x19')][_0x32b8('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ffea2[_0x32b8('0x19')]?_0x2ffea2[_0x32b8('0x19')][_0x32b8('0x1b')]||null:null,'attributes':_0x2ffea2['options']?_0x2ffea2['options'][_0x32b8('0x1c')]||null:null,'limit':_0x2ffea2['options']?_0x2ffea2[_0x32b8('0x19')]['limit']||null:null,'include':_0x2ffea2[_0x32b8('0x19')]?_0x2ffea2[_0x32b8('0x19')][_0x32b8('0x1d')]?_[_0x32b8('0x1e')](_0x2ffea2[_0x32b8('0x19')]['include'],function(_0x4e1360){return{'model':db[_0x4e1360[_0x32b8('0x1f')]],'as':_0x4e1360['as'],'attributes':_0x4e1360[_0x32b8('0x1c')],'include':_0x4e1360[_0x32b8('0x1d')]?_[_0x32b8('0x1e')](_0x4e1360[_0x32b8('0x1d')],function(_0x57a6a3){return{'model':db[_0x57a6a3[_0x32b8('0x1f')]],'as':_0x57a6a3['as'],'attributes':_0x57a6a3[_0x32b8('0x1c')],'include':_0x57a6a3[_0x32b8('0x1d')]?_[_0x32b8('0x1e')](_0x57a6a3[_0x32b8('0x1d')],function(_0x17dd70){return{'model':db[_0x17dd70[_0x32b8('0x1f')]],'as':_0x17dd70['as'],'attributes':_0x17dd70[_0x32b8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x32b8('0xc')](function(_0xa225ec){logger[_0x32b8('0xd')](_0x32b8('0x16'),_0x2ffea2);logger[_0x32b8('0xf')]('GetMailAccount',_0x2ffea2,JSON[_0x32b8('0x10')](_0xa225ec));_0x445da1(_0xa225ec);})[_0x32b8('0x15')](function(_0x383b0e){logger[_0x32b8('0x11')](_0x32b8('0x16'),_0x383b0e[_0x32b8('0x13')],_0x2ffea2);_0x4c6077(_0x748394[_0x32b8('0x11')](0x1f4,_0x383b0e[_0x32b8('0x13')]));});});};exports[_0x32b8('0x20')]=function(_0x15f152){var _0x521bf4=this;return new Promise(function(_0x1833af,_0x3c1122){return db[_0x32b8('0x17')][_0x32b8('0x21')]({'raw':_0x15f152['options']?_0x15f152['options'][_0x32b8('0x1a')]===undefined?!![]:![]:!![],'where':_0x15f152[_0x32b8('0x19')]?_0x15f152[_0x32b8('0x19')][_0x32b8('0x1b')]||null:null,'attributes':_0x15f152['options']?_0x15f152[_0x32b8('0x19')][_0x32b8('0x1c')]||null:null,'include':_0x15f152[_0x32b8('0x19')]?_0x15f152[_0x32b8('0x19')][_0x32b8('0x1d')]?_[_0x32b8('0x1e')](_0x15f152[_0x32b8('0x19')][_0x32b8('0x1d')],function(_0x591ba8){return{'model':db[_0x591ba8[_0x32b8('0x1f')]],'as':_0x591ba8['as'],'attributes':_0x591ba8['attributes'],'include':_0x591ba8[_0x32b8('0x1d')]?_[_0x32b8('0x1e')](_0x591ba8[_0x32b8('0x1d')],function(_0xc5fa8b){return{'model':db[_0xc5fa8b[_0x32b8('0x1f')]],'as':_0xc5fa8b['as'],'attributes':_0xc5fa8b[_0x32b8('0x1c')],'include':_0xc5fa8b['include']?_[_0x32b8('0x1e')](_0xc5fa8b[_0x32b8('0x1d')],function(_0x7e13a9){return{'model':db[_0x7e13a9['model']],'as':_0x7e13a9['as'],'attributes':_0x7e13a9[_0x32b8('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x449f52){if(_0x15f152[_0x32b8('0x19')][_0x32b8('0x22')]===!![])_0x449f52[_0x32b8('0x23')]('smtpOptions',_0x449f52[_0x32b8('0x24')]());logger[_0x32b8('0xd')](_0x32b8('0x20'),_0x15f152);logger['debug']('ShowMailAccount',_0x15f152,JSON[_0x32b8('0x10')](_0x449f52));_0x1833af(_0x449f52);})[_0x32b8('0x15')](function(_0x117a08){logger['error']('ShowMailAccount',_0x117a08['message'],_0x15f152);_0x3c1122(_0x521bf4[_0x32b8('0x11')](0x1f4,_0x117a08[_0x32b8('0x13')]));});});};exports[_0x32b8('0x25')]=function(_0x544fe5){var _0x305428=this;return new Promise(function(_0x14c109,_0x895b74){var _0x273d5f={'body':_0x544fe5[_0x32b8('0x26')],'channel':_0x32b8('0x27')};var _0x8dd996=_[_0x32b8('0x28')](_['keys'](db[_0x32b8('0x29')]['rawAttributes']),['createdAt','updatedAt','CompanyId',_0x32b8('0x2a')]);var _0x50e6e3=![];if(_0x544fe5[_0x32b8('0x26')]['id']){delete _0x544fe5['body']['id'];}if(_['isNil'](_0x544fe5[_0x32b8('0x26')][_0x32b8('0x2b')])){return _0x895b74(_0x305428[_0x32b8('0x11')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x32b8('0x2c')](_0x544fe5[_0x32b8('0x26')][_0x32b8('0x26')])||_0x544fe5['body']['body']===''){return _0x895b74(_0x305428[_0x32b8('0x11')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x32b8('0x2c')](_0x544fe5['body'][_0x32b8('0x2d')])){return _0x895b74(_0x305428['error'](0x1f4,_0x32b8('0x2e')+_0x8dd996));}if(!_[_0x32b8('0x2f')](_0x8dd996,_0x544fe5[_0x32b8('0x26')][_0x32b8('0x2d')])){return _0x895b74(_0x305428['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x8dd996));}var _0x923049={};_0x923049[_0x544fe5[_0x32b8('0x26')][_0x32b8('0x2d')]]=_0x544fe5['body']['from'];return db[_0x32b8('0x17')][_0x32b8('0x21')]({'where':{'id':_0x544fe5['account']['id']},'include':[{'model':db[_0x32b8('0x30')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x923049,'limit':0x1,'order':[[_0x32b8('0x31'),_0x32b8('0x32')]]}]},{'model':db[_0x32b8('0x33')],'as':_0x32b8('0x34')},{'model':db['MailServerOut'],'as':_0x32b8('0x35'),'include':[{'model':db[_0x32b8('0x36')],'as':_0x32b8('0x36')}]}]})[_0x32b8('0xc')](function(_0x1a5bd4){if(_0x1a5bd4&&_0x1a5bd4[_0x32b8('0x37')]){var _0x25a2a8=_0x1a5bd4['get']({'plain':!![]});_0x273d5f[_0x32b8('0x38')]=_[_0x32b8('0x39')](_0x25a2a8,[_0x32b8('0x34'),_0x32b8('0x37')]);_0x273d5f[_0x32b8('0x38')][_0x32b8('0x3a')]=_0x1a5bd4[_0x32b8('0x24')]();_0x273d5f[_0x32b8('0x3b')]=_0x25a2a8[_0x32b8('0x34')];_0x273d5f['list']=_0x25a2a8['List'];_0x273d5f[_0x32b8('0x3b')]=_[_0x32b8('0x3c')](_0x273d5f[_0x32b8('0x3b')],[_0x32b8('0x3d')],[_0x32b8('0x3e')]);if(_0x273d5f[_0x32b8('0x38')]&&_0x273d5f['account'][_0x32b8('0x3f')]){_0x273d5f[_0x32b8('0x3b')][_0x32b8('0x40')]({'id':0x0,'priority':_0x273d5f[_0x32b8('0x3b')]['length']+0x1,'app':_0x32b8('0x41'),'appdata':_0x32b8('0x3f'),'interval':_0x32b8('0x42')});}if(_0x273d5f['account'][_0x32b8('0x34')]){delete _0x273d5f[_0x32b8('0x38')][_0x32b8('0x34')];}if(_0x273d5f[_0x32b8('0x38')][_0x32b8('0x37')]){delete _0x273d5f[_0x32b8('0x38')][_0x32b8('0x37')];}if(_0x25a2a8['List'][_0x32b8('0x43')]['length']){return _0x25a2a8['List'][_0x32b8('0x43')][0x0];}var _0x2d458e=_[_0x32b8('0x44')](_0x544fe5[_0x32b8('0x26')],{'firstName':_0x544fe5[_0x32b8('0x26')]['from'],'ListId':_0x25a2a8[_0x32b8('0x2a')]});_0x2d458e[_0x544fe5[_0x32b8('0x26')][_0x32b8('0x2d')]]=_0x544fe5['body'][_0x32b8('0x2b')];return db[_0x32b8('0x29')][_0x32b8('0x45')](_0x2d458e);}else{throw new Error('List\x20not\x20found');}})[_0x32b8('0xc')](function(_0x531b62){_0x273d5f[_0x32b8('0x46')]=_0x531b62;if(_0x531b62){if(!_0x544fe5[_0x32b8('0x26')][_0x32b8('0x13')][_0x32b8('0x47')]){_0x544fe5['body'][_0x32b8('0x13')]['messageId']=rs[_0x32b8('0x48')]()+'\x20'+_0x544fe5['body']['message']['from'];}var _0x1618db={'ContactId':_0x531b62['id'],'MailAccountId':_0x544fe5[_0x32b8('0x38')]['id'],'inReplyTo':_0x544fe5[_0x32b8('0x26')][_0x32b8('0x13')]['messageId'],'to':_0x544fe5[_0x32b8('0x26')][_0x32b8('0x13')][_0x32b8('0x2b')],'cc':_0x544fe5[_0x32b8('0x26')]['message']['cc'],'subject':_0x544fe5[_0x32b8('0x26')][_0x32b8('0x13')][_0x32b8('0x49')],'attach':_0x544fe5[_0x32b8('0x26')][_0x32b8('0x13')][_0x32b8('0x4a')],'lastMsgAt':moment()['format'](_0x32b8('0x4b')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x544fe5[_0x32b8('0x38')]['id']},'include':[{'model':db[_0x32b8('0x4c')],'as':_0x32b8('0x4d'),'attributes':['messageId'],'where':{'messageId':_0x544fe5[_0x32b8('0x26')][_0x32b8('0x13')][_0x32b8('0x4e')]}}]})[_0x32b8('0xc')](function(_0x419969){if(_0x419969){return[_0x419969,![]];}return db[_0x32b8('0x4f')][_0x32b8('0x45')](_0x1618db)[_0x32b8('0xc')](function(_0x13c351){return[_0x13c351,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x32b8('0x50')](function(_0x3ff3ad,_0x5a1e0a){if(_0x3ff3ad){_0x50e6e3=_0x5a1e0a;if(!_0x5a1e0a){return _0x3ff3ad[_0x32b8('0x51')]({'inReplyTo':_0x544fe5[_0x32b8('0x26')][_0x32b8('0x13')][_0x32b8('0x47')],'to':_0x544fe5[_0x32b8('0x26')][_0x32b8('0x13')][_0x32b8('0x2b')],'cc':_0x544fe5[_0x32b8('0x26')][_0x32b8('0x13')]['cc'],'subject':_0x544fe5['body'][_0x32b8('0x13')][_0x32b8('0x49')],'attach':_0x3ff3ad['attach']?_0x3ff3ad[_0x32b8('0x4a')]:_0x544fe5['body'][_0x32b8('0x13')][_0x32b8('0x4a')],'substatus':null,'substatusAt':moment()[_0x32b8('0x52')](_0x32b8('0x4b')),'lastMsgAt':moment()[_0x32b8('0x52')](_0x32b8('0x4b')),'lastMsgDirection':'in'});}else{return _0x3ff3ad;}}})[_0x32b8('0xc')](function(_0x8310c7){_0x273d5f['interaction']=_0x8310c7['get']({'plain':!![]});_0x273d5f[_0x32b8('0x53')]['created']=_0x50e6e3;return db[_0x32b8('0x4c')][_0x32b8('0x45')]({'body':_0x544fe5[_0x32b8('0x26')]['body'],'MailAccountId':_0x544fe5[_0x32b8('0x38')]['id'],'MailInteractionId':_0x8310c7['id'],'direction':'in','ContactId':_0x273d5f[_0x32b8('0x46')]['id'],'messageId':_0x544fe5['body'][_0x32b8('0x13')]['messageId'],'from':_0x544fe5[_0x32b8('0x26')][_0x32b8('0x13')][_0x32b8('0x2b')],'to':_0x544fe5[_0x32b8('0x26')]['message']['to'],'cc':_0x544fe5[_0x32b8('0x26')]['message']['cc'],'subject':_0x544fe5[_0x32b8('0x26')][_0x32b8('0x13')]['subject'],'attach':_0x544fe5['body'][_0x32b8('0x13')][_0x32b8('0x4a')],'Attachments':_0x544fe5[_0x32b8('0x26')][_0x32b8('0x13')][_0x32b8('0x54')],'originTo':_0x544fe5[_0x32b8('0x26')][_0x32b8('0x13')]['originTo'],'originCc':_0x544fe5[_0x32b8('0x26')]['message'][_0x32b8('0x55')],'bcc':_0x544fe5[_0x32b8('0x26')][_0x32b8('0x13')]['bcc'],'ChatWebsiteId':_0x544fe5['body'][_0x32b8('0x13')][_0x32b8('0x56')]||null,'originChannel':_0x544fe5[_0x32b8('0x26')][_0x32b8('0x13')]['originChannel']||_0x32b8('0x57'),'ChatOfflineMessageId':_0x544fe5[_0x32b8('0x26')][_0x32b8('0x13')][_0x32b8('0x58')]||null},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})[_0x32b8('0xc')](function(_0x5bc582){_0x273d5f[_0x32b8('0x13')]=_0x5bc582;if(!_0x273d5f[_0x32b8('0x53')]['UserId']){return;}return db[_0x32b8('0x59')][_0x32b8('0x21')]({'attributes':['id','name'],'where':{'id':_0x273d5f[_0x32b8('0x53')]['UserId']}});})[_0x32b8('0xc')](function(_0x41dd0e){if(_0x41dd0e){_0x273d5f[_0x32b8('0x3b')][_0x32b8('0x5a')]({'id':0x0,'priority':0x0,'app':_0x32b8('0x5b'),'appdata':_0x41dd0e['name']+','+(_0x273d5f[_0x32b8('0x38')][_0x32b8('0x5c')]||0xa),'interval':_0x32b8('0x42')});}if(!_0x273d5f[_0x32b8('0x53')][_0x32b8('0x5d')]){return;}return db[_0x32b8('0x5e')][_0x32b8('0x21')]({'attributes':['id',_0x32b8('0x5f')],'where':{'id':_0x273d5f['interaction'][_0x32b8('0x5d')]}});})['then'](function(_0x238c22){if(_0x238c22){_0x273d5f['applications'][_0x32b8('0x5a')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x238c22['name']+','+(_0x273d5f[_0x32b8('0x38')][_0x32b8('0x60')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x32b8('0x61'),_0x32b8('0x62'),_0x273d5f);})[_0x32b8('0xc')](function(_0x315a32){_0x14c109(_0x315a32);})['catch'](function(_0x180000){_0x895b74(_0x305428[_0x32b8('0x11')](0x1f4,_0x180000['message']));});});}; \ No newline at end of file +var _0x36c3=['options','raw','where','limit','include','map','model','attributes','catch','find','smtp','setDataValue','getSmtpOptions','ShowMailAccount','stringify','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','account','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','smtpOptions','list','applications','orderBy','priority','asc','push','length','create','List\x20not\x20found','contact','messageId','generate','subject','MailInteraction','MailMessage','Messages','inReplyTo','spread','update','attach','format','YYYY-MM-DD\x20HH:mm:ss','get','interaction','created','attachments','originTo','bcc','ChatWebsiteId','originChannel','ChatOfflineMessageId','User','UserId','unshift','agent','name','waitForTheAssignedAgent','queueId','MailQueue','queue','waitForTheAssignedQueue','*,*,*,*','Start','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','message','result','GetMailAccount'];(function(_0x1e500e,_0x2c9d74){var _0x10dc5e=function(_0x354423){while(--_0x354423){_0x1e500e['push'](_0x1e500e['shift']());}};_0x10dc5e(++_0x2c9d74);}(_0x36c3,0x1a6));var _0x336c=function(_0x366e99,_0x15d82d){_0x366e99=_0x366e99-0x0;var _0x180bbe=_0x36c3[_0x366e99];return _0x180bbe;};'use strict';var _=require(_0x336c('0x0'));var moment=require(_0x336c('0x1'));var BPromise=require('bluebird');var rs=require(_0x336c('0x2'));var Redis=require(_0x336c('0x3'));var db=require(_0x336c('0x4'))['db'];var logger=require(_0x336c('0x5'))(_0x336c('0x6'));var config=require(_0x336c('0x7'));var jayson=require(_0x336c('0x8'));var client=jayson['client'][_0x336c('0x9')]({'port':0x232c});config[_0x336c('0xa')]=_[_0x336c('0xb')](config[_0x336c('0xa')],{'host':_0x336c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x336c('0xa')]));require(_0x336c('0xd'))[_0x336c('0xe')](socket);function respondWithRpcPromise(_0x5e7830,_0x8b3722,_0x243984){return new BPromise(function(_0x33ced0,_0x1a4503){return client[_0x336c('0xf')](_0x5e7830,_0x243984)[_0x336c('0x10')](function(_0x174acc){logger[_0x336c('0x11')](_0x336c('0x12'),_0x8b3722,_0x336c('0x13'));logger[_0x336c('0x14')](_0x336c('0x15'),_0x8b3722,_0x336c('0x13'),JSON['stringify'](_0x174acc));if(_0x174acc['error']){if(_0x174acc[_0x336c('0x16')]['code']===0x1f4){logger[_0x336c('0x16')](_0x336c('0x12'),_0x8b3722,_0x174acc[_0x336c('0x16')][_0x336c('0x17')]);return _0x1a4503(_0x174acc['error'][_0x336c('0x17')]);}logger[_0x336c('0x16')]('MailAccount,\x20%s,\x20%s',_0x8b3722,_0x174acc[_0x336c('0x16')]['message']);return _0x33ced0(_0x174acc[_0x336c('0x16')]['message']);}else{logger[_0x336c('0x11')]('MailAccount,\x20%s,\x20%s',_0x8b3722,_0x336c('0x13'));_0x33ced0(_0x174acc[_0x336c('0x18')]['message']);}})['catch'](function(_0x13db87){logger[_0x336c('0x16')](_0x336c('0x12'),_0x8b3722,_0x13db87);_0x1a4503(_0x13db87);});});}exports[_0x336c('0x19')]=function(_0x366182){var _0x4fde93=this;return new Promise(function(_0x327e10,_0x532e12){return db['MailAccount']['findAll']({'raw':_0x366182[_0x336c('0x1a')]?_0x366182[_0x336c('0x1a')][_0x336c('0x1b')]===undefined?!![]:![]:!![],'where':_0x366182['options']?_0x366182['options'][_0x336c('0x1c')]||null:null,'attributes':_0x366182[_0x336c('0x1a')]?_0x366182[_0x336c('0x1a')]['attributes']||null:null,'limit':_0x366182[_0x336c('0x1a')]?_0x366182[_0x336c('0x1a')][_0x336c('0x1d')]||null:null,'include':_0x366182['options']?_0x366182[_0x336c('0x1a')][_0x336c('0x1e')]?_[_0x336c('0x1f')](_0x366182[_0x336c('0x1a')]['include'],function(_0x401660){return{'model':db[_0x401660[_0x336c('0x20')]],'as':_0x401660['as'],'attributes':_0x401660[_0x336c('0x21')],'include':_0x401660[_0x336c('0x1e')]?_[_0x336c('0x1f')](_0x401660[_0x336c('0x1e')],function(_0x567bfa){return{'model':db[_0x567bfa[_0x336c('0x20')]],'as':_0x567bfa['as'],'attributes':_0x567bfa[_0x336c('0x21')],'include':_0x567bfa[_0x336c('0x1e')]?_[_0x336c('0x1f')](_0x567bfa['include'],function(_0x637e87){return{'model':db[_0x637e87[_0x336c('0x20')]],'as':_0x637e87['as'],'attributes':_0x637e87['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x562043){logger[_0x336c('0x11')](_0x336c('0x19'),_0x366182);logger['debug']('GetMailAccount',_0x366182,JSON['stringify'](_0x562043));_0x327e10(_0x562043);})[_0x336c('0x22')](function(_0x37782a){logger[_0x336c('0x16')](_0x336c('0x19'),_0x37782a[_0x336c('0x17')],_0x366182);_0x532e12(_0x4fde93[_0x336c('0x16')](0x1f4,_0x37782a[_0x336c('0x17')]));});});};exports['ShowMailAccount']=function(_0x90d7de){var _0x21f671=this;return new Promise(function(_0x2b1af7,_0x34bcbe){return db['MailAccount'][_0x336c('0x23')]({'raw':_0x90d7de[_0x336c('0x1a')]?_0x90d7de['options'][_0x336c('0x1b')]===undefined?!![]:![]:!![],'where':_0x90d7de[_0x336c('0x1a')]?_0x90d7de['options'][_0x336c('0x1c')]||null:null,'attributes':_0x90d7de[_0x336c('0x1a')]?_0x90d7de[_0x336c('0x1a')][_0x336c('0x21')]||null:null,'include':_0x90d7de[_0x336c('0x1a')]?_0x90d7de[_0x336c('0x1a')][_0x336c('0x1e')]?_[_0x336c('0x1f')](_0x90d7de['options'][_0x336c('0x1e')],function(_0x351d13){return{'model':db[_0x351d13[_0x336c('0x20')]],'as':_0x351d13['as'],'attributes':_0x351d13[_0x336c('0x21')],'include':_0x351d13[_0x336c('0x1e')]?_[_0x336c('0x1f')](_0x351d13[_0x336c('0x1e')],function(_0x223c86){return{'model':db[_0x223c86[_0x336c('0x20')]],'as':_0x223c86['as'],'attributes':_0x223c86[_0x336c('0x21')],'include':_0x223c86['include']?_[_0x336c('0x1f')](_0x223c86[_0x336c('0x1e')],function(_0x4690c3){return{'model':db[_0x4690c3[_0x336c('0x20')]],'as':_0x4690c3['as'],'attributes':_0x4690c3[_0x336c('0x21')]};}):[]};}):[]};}):[]:[]})[_0x336c('0x10')](function(_0x853b2d){if(_0x90d7de[_0x336c('0x1a')][_0x336c('0x24')]===!![])_0x853b2d[_0x336c('0x25')]('smtpOptions',_0x853b2d[_0x336c('0x26')]());logger[_0x336c('0x11')](_0x336c('0x27'),_0x90d7de);logger['debug'](_0x336c('0x27'),_0x90d7de,JSON[_0x336c('0x28')](_0x853b2d));_0x2b1af7(_0x853b2d);})[_0x336c('0x22')](function(_0x36a46f){logger['error'](_0x336c('0x27'),_0x36a46f[_0x336c('0x17')],_0x90d7de);_0x34bcbe(_0x21f671['error'](0x1f4,_0x36a46f[_0x336c('0x17')]));});});};exports[_0x336c('0x29')]=function(_0x1d30ac){var _0x4e75fc=this;return new Promise(function(_0x16c6c6,_0x2af458){var _0xdd7677={'body':_0x1d30ac[_0x336c('0x2a')],'channel':_0x336c('0x2b')};var _0x437170=_[_0x336c('0x2c')](_[_0x336c('0x2d')](db[_0x336c('0x2e')][_0x336c('0x2f')]),['createdAt',_0x336c('0x30'),_0x336c('0x31'),_0x336c('0x32')]);var _0x5b2f25=![];if(_0x1d30ac[_0x336c('0x2a')]['id']){delete _0x1d30ac[_0x336c('0x2a')]['id'];}if(_['isNil'](_0x1d30ac[_0x336c('0x2a')][_0x336c('0x33')])){return _0x2af458(_0x4e75fc[_0x336c('0x16')](0x1f4,_0x336c('0x34')));}if(_['isNil'](_0x1d30ac[_0x336c('0x2a')][_0x336c('0x2a')])||_0x1d30ac['body'][_0x336c('0x2a')]===''){return _0x2af458(_0x4e75fc[_0x336c('0x16')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x336c('0x35')](_0x1d30ac[_0x336c('0x2a')][_0x336c('0x36')])){return _0x2af458(_0x4e75fc[_0x336c('0x16')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x437170));}if(!_[_0x336c('0x37')](_0x437170,_0x1d30ac[_0x336c('0x2a')][_0x336c('0x36')])){return _0x2af458(_0x4e75fc[_0x336c('0x16')](0x1f4,_0x336c('0x38')+_0x437170));}var _0x3b68c4={};_0x3b68c4[_0x1d30ac[_0x336c('0x2a')][_0x336c('0x36')]]=_0x1d30ac[_0x336c('0x2a')]['from'];return db[_0x336c('0x39')][_0x336c('0x23')]({'where':{'id':_0x1d30ac[_0x336c('0x3a')]['id']},'include':[{'model':db[_0x336c('0x3b')],'as':_0x336c('0x3c'),'include':[{'model':db[_0x336c('0x2e')],'as':_0x336c('0x3d'),'where':_0x3b68c4,'limit':0x1,'order':[[_0x336c('0x30'),_0x336c('0x3e')]]}]},{'model':db[_0x336c('0x3f')],'as':_0x336c('0x40')},{'model':db[_0x336c('0x41')],'as':_0x336c('0x42'),'include':[{'model':db['CloudProvider'],'as':_0x336c('0x43')}]}]})['then'](function(_0x4f4e12){if(_0x4f4e12&&_0x4f4e12[_0x336c('0x3c')]){var _0x4f717e=_0x4f4e12['get']({'plain':!![]});_0xdd7677[_0x336c('0x3a')]=_['omit'](_0x4f717e,[_0x336c('0x40'),_0x336c('0x3c')]);_0xdd7677[_0x336c('0x3a')][_0x336c('0x44')]=_0x4f4e12['getSmtpOptions']();_0xdd7677['applications']=_0x4f717e[_0x336c('0x40')];_0xdd7677[_0x336c('0x45')]=_0x4f717e['List'];_0xdd7677[_0x336c('0x46')]=_[_0x336c('0x47')](_0xdd7677['applications'],[_0x336c('0x48')],[_0x336c('0x49')]);if(_0xdd7677[_0x336c('0x3a')]&&_0xdd7677[_0x336c('0x3a')]['autoclose']){_0xdd7677[_0x336c('0x46')][_0x336c('0x4a')]({'id':0x0,'priority':_0xdd7677['applications']['length']+0x1,'app':'close','appdata':'autoclose','interval':'*,*,*,*'});}if(_0xdd7677[_0x336c('0x3a')][_0x336c('0x40')]){delete _0xdd7677[_0x336c('0x3a')][_0x336c('0x40')];}if(_0xdd7677['account'][_0x336c('0x3c')]){delete _0xdd7677[_0x336c('0x3a')][_0x336c('0x3c')];}if(_0x4f717e[_0x336c('0x3c')]['Contacts'][_0x336c('0x4b')]){return _0x4f717e['List'][_0x336c('0x3d')][0x0];}var _0x3dc6ee=_[_0x336c('0xb')](_0x1d30ac[_0x336c('0x2a')],{'firstName':_0x1d30ac[_0x336c('0x2a')][_0x336c('0x33')],'ListId':_0x4f717e['ListId']});_0x3dc6ee[_0x1d30ac['body'][_0x336c('0x36')]]=_0x1d30ac[_0x336c('0x2a')]['from'];return db[_0x336c('0x2e')][_0x336c('0x4c')](_0x3dc6ee);}else{throw new Error(_0x336c('0x4d'));}})['then'](function(_0x5bacb9){_0xdd7677[_0x336c('0x4e')]=_0x5bacb9;if(_0x5bacb9){if(!_0x1d30ac[_0x336c('0x2a')][_0x336c('0x17')][_0x336c('0x4f')]){_0x1d30ac[_0x336c('0x2a')][_0x336c('0x17')]['messageId']=rs[_0x336c('0x50')]()+'\x20'+_0x1d30ac[_0x336c('0x2a')][_0x336c('0x17')]['from'];}var _0x58f63f={'ContactId':_0x5bacb9['id'],'MailAccountId':_0x1d30ac[_0x336c('0x3a')]['id'],'inReplyTo':_0x1d30ac[_0x336c('0x2a')][_0x336c('0x17')][_0x336c('0x4f')],'to':_0x1d30ac[_0x336c('0x2a')][_0x336c('0x17')][_0x336c('0x33')],'cc':_0x1d30ac[_0x336c('0x2a')][_0x336c('0x17')]['cc'],'subject':_0x1d30ac[_0x336c('0x2a')][_0x336c('0x17')][_0x336c('0x51')],'attach':_0x1d30ac[_0x336c('0x2a')]['message']['attach'],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x336c('0x52')][_0x336c('0x23')]({'where':{'closed':![],'MailAccountId':_0x1d30ac['account']['id']},'include':[{'model':db[_0x336c('0x53')],'as':_0x336c('0x54'),'attributes':[_0x336c('0x4f')],'where':{'messageId':_0x1d30ac[_0x336c('0x2a')][_0x336c('0x17')][_0x336c('0x55')]}}]})['then'](function(_0x2086a4){if(_0x2086a4){return[_0x2086a4,![]];}return db['MailInteraction'][_0x336c('0x4c')](_0x58f63f)[_0x336c('0x10')](function(_0x2d4c48){return[_0x2d4c48,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x336c('0x56')](function(_0x39697d,_0x579607){if(_0x39697d){_0x5b2f25=_0x579607;if(!_0x579607){return _0x39697d[_0x336c('0x57')]({'inReplyTo':_0x1d30ac['body'][_0x336c('0x17')][_0x336c('0x4f')],'to':_0x1d30ac[_0x336c('0x2a')][_0x336c('0x17')][_0x336c('0x33')],'cc':_0x1d30ac[_0x336c('0x2a')]['message']['cc'],'subject':_0x1d30ac[_0x336c('0x2a')]['message']['subject'],'attach':_0x39697d['attach']?_0x39697d['attach']:_0x1d30ac['body']['message'][_0x336c('0x58')],'substatus':null,'substatusAt':moment()[_0x336c('0x59')](_0x336c('0x5a')),'lastMsgAt':moment()[_0x336c('0x59')](_0x336c('0x5a')),'lastMsgDirection':'in'});}else{return _0x39697d;}}})[_0x336c('0x10')](function(_0x338106){_0xdd7677['interaction']=_0x338106[_0x336c('0x5b')]({'plain':!![]});_0xdd7677[_0x336c('0x5c')][_0x336c('0x5d')]=_0x5b2f25;return db[_0x336c('0x53')]['create']({'body':_0x1d30ac[_0x336c('0x2a')][_0x336c('0x2a')],'MailAccountId':_0x1d30ac[_0x336c('0x3a')]['id'],'MailInteractionId':_0x338106['id'],'direction':'in','ContactId':_0xdd7677['contact']['id'],'messageId':_0x1d30ac[_0x336c('0x2a')][_0x336c('0x17')][_0x336c('0x4f')],'from':_0x1d30ac[_0x336c('0x2a')][_0x336c('0x17')][_0x336c('0x33')],'to':_0x1d30ac[_0x336c('0x2a')]['message']['to'],'cc':_0x1d30ac['body'][_0x336c('0x17')]['cc'],'subject':_0x1d30ac[_0x336c('0x2a')][_0x336c('0x17')][_0x336c('0x51')],'attach':_0x1d30ac[_0x336c('0x2a')][_0x336c('0x17')][_0x336c('0x58')],'Attachments':_0x1d30ac[_0x336c('0x2a')]['message'][_0x336c('0x5e')],'originTo':_0x1d30ac[_0x336c('0x2a')]['message'][_0x336c('0x5f')],'originCc':_0x1d30ac[_0x336c('0x2a')]['message']['originCc'],'bcc':_0x1d30ac[_0x336c('0x2a')]['message'][_0x336c('0x60')],'ChatWebsiteId':_0x1d30ac[_0x336c('0x2a')]['message'][_0x336c('0x61')]||null,'originChannel':_0x1d30ac[_0x336c('0x2a')][_0x336c('0x17')][_0x336c('0x62')]||'Email','ChatOfflineMessageId':_0x1d30ac[_0x336c('0x2a')][_0x336c('0x17')][_0x336c('0x63')]||null},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})['then'](function(_0x553f66){_0xdd7677['message']=_0x553f66;if(!_0xdd7677[_0x336c('0x5c')]['UserId']){return;}return db[_0x336c('0x64')]['find']({'attributes':['id','name'],'where':{'id':_0xdd7677[_0x336c('0x5c')][_0x336c('0x65')]}});})['then'](function(_0x34e9c8){if(_0x34e9c8){_0xdd7677['applications'][_0x336c('0x66')]({'id':0x0,'priority':0x0,'app':_0x336c('0x67'),'appdata':_0x34e9c8[_0x336c('0x68')]+','+(_0xdd7677[_0x336c('0x3a')][_0x336c('0x69')]||0xa),'interval':'*,*,*,*'});}if(!_0xdd7677[_0x336c('0x5c')][_0x336c('0x6a')]){return;}return db[_0x336c('0x6b')]['find']({'attributes':['id',_0x336c('0x68')],'where':{'id':_0xdd7677[_0x336c('0x5c')][_0x336c('0x6a')]}});})[_0x336c('0x10')](function(_0x444c4f){if(_0x444c4f){_0xdd7677[_0x336c('0x46')][_0x336c('0x66')]({'id':0x0,'priority':0x1,'app':_0x336c('0x6c'),'appdata':_0x444c4f['name']+','+(_0xdd7677[_0x336c('0x3a')][_0x336c('0x6d')]||0x12c),'interval':_0x336c('0x6e')});}return respondWithRpcPromise(_0x336c('0x6f'),'startRouting',_0xdd7677);})[_0x336c('0x10')](function(_0x57de54){_0x16c6c6(_0x57de54);})[_0x336c('0x22')](function(_0x364e89){_0x2af458(_0x4e75fc[_0x336c('0x16')](0x1f4,_0x364e89[_0x336c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 53f287f..dba7a0f 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 _0xa81d=['save','update','emit','removeListener','length','mailAccount:','./mailAccount.events'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa81d,0x11e));var _0xda81=function(_0x7d9758,_0xf4d2eb){_0x7d9758=_0x7d9758-0x0;var _0x9e9815=_0xa81d[_0x7d9758];return _0x9e9815;};'use strict';var MailAccountEvents=require(_0xda81('0x0'));var events=[_0xda81('0x1'),'remove',_0xda81('0x2')];function createListener(_0x5063db,_0x26eaeb){return function(_0x327ff8){_0x26eaeb[_0xda81('0x3')](_0x5063db,_0x327ff8);};}function removeListener(_0x1c3649,_0x3d07ad){return function(){MailAccountEvents[_0xda81('0x4')](_0x1c3649,_0x3d07ad);};}exports['register']=function(_0x51c96b){for(var _0x205ce9=0x0,_0x5ecca7=events[_0xda81('0x5')];_0x205ce9<_0x5ecca7;_0x205ce9++){var _0x1b92f7=events[_0x205ce9];var _0x1434dd=createListener(_0xda81('0x6')+_0x1b92f7,_0x51c96b);MailAccountEvents['on'](_0x1b92f7,_0x1434dd);}}; \ No newline at end of file +var _0x57e9=['update','removeListener','register','mailAccount:','remove'];(function(_0x1d8b81,_0x1c6674){var _0xa78343=function(_0x31f0b){while(--_0x31f0b){_0x1d8b81['push'](_0x1d8b81['shift']());}};_0xa78343(++_0x1c6674);}(_0x57e9,0x12b));var _0x957e=function(_0x40bf8a,_0xb0b6b8){_0x40bf8a=_0x40bf8a-0x0;var _0xcb1d41=_0x57e9[_0x40bf8a];return _0xcb1d41;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0x957e('0x0'),_0x957e('0x1')];function createListener(_0x2b91b9,_0xc72cad){return function(_0x369cb6){_0xc72cad['emit'](_0x2b91b9,_0x369cb6);};}function removeListener(_0x3e0abc,_0x5be3f6){return function(){MailAccountEvents[_0x957e('0x2')](_0x3e0abc,_0x5be3f6);};}exports[_0x957e('0x3')]=function(_0x3fdae0){for(var _0x380d85=0x0,_0x2577de=events['length'];_0x380d85<_0x2577de;_0x380d85++){var _0x5756a6=events[_0x380d85];var _0x5856b5=createListener(_0x957e('0x4')+_0x5756a6,_0x3fdae0);MailAccountEvents['on'](_0x5756a6,_0x5856b5);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index b9c0dfa..7f46aed 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 _0x029e=['../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','put','delete','destroy','exports','connect-timeout','express','Router','fs-extra'];(function(_0x268bc7,_0x1b0b49){var _0x3e5019=function(_0x9c6557){while(--_0x9c6557){_0x268bc7['push'](_0x268bc7['shift']());}};_0x3e5019(++_0x1b0b49);}(_0x029e,0x114));var _0xe029=function(_0x1234fa,_0x46cc41){_0x1234fa=_0x1234fa-0x0;var _0x1cca87=_0x029e[_0x1234fa];return _0x1cca87;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe029('0x0'));var express=require(_0xe029('0x1'));var router=express[_0xe029('0x2')]();var fs_extra=require(_0xe029('0x3'));var auth=require(_0xe029('0x4'));var interaction=require(_0xe029('0x5'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0xe029('0x6')](_0xe029('0x7'),auth[_0xe029('0x8')](),controller[_0xe029('0x9')]);router[_0xe029('0xa')]('/:id',auth[_0xe029('0x8')](),controller['update']);router[_0xe029('0xb')](_0xe029('0x7'),auth[_0xe029('0x8')](),controller[_0xe029('0xc')]);module[_0xe029('0xd')]=router; \ No newline at end of file +var _0x85ce=['delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','put','isAuthenticated'];(function(_0xc7089,_0x4768dd){var _0x1f9bf6=function(_0x2b7ccf){while(--_0x2b7ccf){_0xc7089['push'](_0xc7089['shift']());}};_0x1f9bf6(++_0x4768dd);}(_0x85ce,0x102));var _0xe85c=function(_0x2eefa7,_0x16d385){_0x2eefa7=_0x2eefa7-0x0;var _0x41eec1=_0x85ce[_0x2eefa7];return _0x41eec1;};'use strict';var multer=require('multer');var util=require(_0xe85c('0x0'));var path=require('path');var timeout=require(_0xe85c('0x1'));var express=require(_0xe85c('0x2'));var router=express[_0xe85c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe85c('0x4'));var interaction=require(_0xe85c('0x5'));var config=require(_0xe85c('0x6'));var controller=require('./mailApplication.controller');router[_0xe85c('0x7')](_0xe85c('0x8'),auth['isAuthenticated'](),controller[_0xe85c('0x9')]);router[_0xe85c('0xa')](_0xe85c('0x8'),auth[_0xe85c('0xb')](),controller['update']);router[_0xe85c('0xc')]('/:id',auth[_0xe85c('0xb')](),controller[_0xe85c('0xd')]);module[_0xe85c('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 8ea11c0..e4725f0 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 _0xdd54=['INTEGER','STRING','*,*,*,*','exports'];(function(_0x448a55,_0x34eed2){var _0x51c7de=function(_0x21707a){while(--_0x21707a){_0x448a55['push'](_0x448a55['shift']());}};_0x51c7de(++_0x34eed2);}(_0xdd54,0x1ef));var _0x4dd5=function(_0x9553a2,_0x5424d9){_0x9553a2=_0x9553a2-0x0;var _0x3e398c=_0xdd54[_0x9553a2];return _0x3e398c;};'use strict';var Sequelize=require('sequelize');module[_0x4dd5('0x0')]={'priority':{'type':Sequelize[_0x4dd5('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4dd5('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4dd5('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4dd5('0x3')}}; \ No newline at end of file +var _0x7144=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x42e321,_0x3792e0){var _0x4c6b7e=function(_0x13c669){while(--_0x13c669){_0x42e321['push'](_0x42e321['shift']());}};_0x4c6b7e(++_0x3792e0);}(_0x7144,0x16e));var _0x4714=function(_0x3a5555,_0x3147fc){_0x3a5555=_0x3a5555-0x0;var _0x520ad6=_0x7144[_0x3a5555];return _0x520ad6;};'use strict';var Sequelize=require(_0x4714('0x0'));module[_0x4714('0x1')]={'priority':{'type':Sequelize[_0x4714('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4714('0x3')],'allowNull':![],'defaultValue':_0x4714('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4714('0x3')]},'interval':{'type':Sequelize[_0x4714('0x3')],'defaultValue':_0x4714('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index a46d103..f502cf3 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x33d982,_0x49c670){var _0x1c599e=function(_0x1653d6){while(--_0x1653d6){_0x33d982['push'](_0x33d982['shift']());}};_0x1c599e(++_0x49c670);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));}; \ No newline at end of file +var _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x3ef1dc,_0x210a81){var _0x151f5f=function(_0x2ac8b6){while(--_0x2ac8b6){_0x3ef1dc['push'](_0x3ef1dc['shift']());}};_0x151f5f(++_0x210a81);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index bc3dc1e..eac0d9e 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 _0xcab5=['../../config/logger','api','moment','request-promise','path','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x235a76,_0x3f4fc8){var _0x2de1f4=function(_0x4dfd71){while(--_0x4dfd71){_0x235a76['push'](_0x235a76['shift']());}};_0x2de1f4(++_0x3f4fc8);}(_0xcab5,0x98));var _0x5cab=function(_0x27d6c0,_0x1d14e7){_0x27d6c0=_0x27d6c0-0x0;var _0x2026c0=_0xcab5[_0x27d6c0];return _0x2026c0;};'use strict';var _=require(_0x5cab('0x0'));var util=require(_0x5cab('0x1'));var logger=require(_0x5cab('0x2'))(_0x5cab('0x3'));var moment=require(_0x5cab('0x4'));var BPromise=require('bluebird');var rp=require(_0x5cab('0x5'));var fs=require('fs');var path=require(_0x5cab('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module['exports']=function(_0x2419c6,_0x794d48){return _0x2419c6['define'](_0x5cab('0x7'),attributes,{'tableName':_0x5cab('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5cab('0x9'),'collate':_0x5cab('0xa')});}; \ No newline at end of file +var _0x9306=['bluebird','request-promise','../../config/environment','./mailApplication.attributes','exports','MailApplication','mail_applications','utf8mb4_unicode_ci','lodash','util','moment'];(function(_0x42f3d8,_0x38d414){var _0x20ffc1=function(_0x2def54){while(--_0x2def54){_0x42f3d8['push'](_0x42f3d8['shift']());}};_0x20ffc1(++_0x38d414);}(_0x9306,0x1ec));var _0x6930=function(_0x3f7c37,_0x415a9f){_0x3f7c37=_0x3f7c37-0x0;var _0x1accd1=_0x9306[_0x3f7c37];return _0x1accd1;};'use strict';var _=require(_0x6930('0x0'));var util=require(_0x6930('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6930('0x2'));var BPromise=require(_0x6930('0x3'));var rp=require(_0x6930('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6930('0x5'));var attributes=require(_0x6930('0x6'));module[_0x6930('0x7')]=function(_0x15b0c4,_0x57b135){return _0x15b0c4['define'](_0x6930('0x8'),attributes,{'tableName':_0x6930('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6930('0xa')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 0d946f2..492a882 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 _0x4675=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','limit','then'];(function(_0x28beb8,_0x293646){var _0x4ae8ea=function(_0x4f1522){while(--_0x4f1522){_0x28beb8['push'](_0x28beb8['shift']());}};_0x4ae8ea(++_0x293646);}(_0x4675,0x193));var _0x5467=function(_0x55fa0f,_0x122c84){_0x55fa0f=_0x55fa0f-0x0;var _0x53ac7f=_0x4675[_0x55fa0f];return _0x53ac7f;};'use strict';var _=require(_0x5467('0x0'));var util=require(_0x5467('0x1'));var moment=require(_0x5467('0x2'));var BPromise=require(_0x5467('0x3'));var rs=require(_0x5467('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5467('0x5'))['db'];var utils=require(_0x5467('0x6'));var logger=require(_0x5467('0x7'))(_0x5467('0x8'));var config=require(_0x5467('0x9'));var jayson=require(_0x5467('0xa'));var client=jayson['client'][_0x5467('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a9052,_0x141c93,_0x529167){return new BPromise(function(_0x13d143,_0x10644c){return client['request'](_0x2a9052,_0x529167)['then'](function(_0x52fcc4){logger[_0x5467('0xc')](_0x5467('0xd'),_0x141c93,'request\x20sent');logger['debug'](_0x5467('0xe'),_0x141c93,_0x5467('0xf'),JSON[_0x5467('0x10')](_0x52fcc4));if(_0x52fcc4[_0x5467('0x11')]){if(_0x52fcc4['error'][_0x5467('0x12')]===0x1f4){logger[_0x5467('0x11')](_0x5467('0xd'),_0x141c93,_0x52fcc4[_0x5467('0x11')]['message']);return _0x10644c(_0x52fcc4['error']['message']);}logger[_0x5467('0x11')](_0x5467('0xd'),_0x141c93,_0x52fcc4[_0x5467('0x11')][_0x5467('0x13')]);return _0x13d143(_0x52fcc4[_0x5467('0x11')][_0x5467('0x13')]);}else{logger[_0x5467('0xc')](_0x5467('0xd'),_0x141c93,_0x5467('0xf'));_0x13d143(_0x52fcc4[_0x5467('0x14')][_0x5467('0x13')]);}})[_0x5467('0x15')](function(_0x58f643){logger[_0x5467('0x11')]('MailApplication,\x20%s,\x20%s',_0x141c93,_0x58f643);_0x10644c(_0x58f643);});});}exports[_0x5467('0x16')]=function(_0x13a54f){var _0x4bb807=this;return new Promise(function(_0x517b60,_0x5f3fb2){return db[_0x5467('0x17')][_0x5467('0x18')](_0x13a54f[_0x5467('0x19')],{'raw':_0x13a54f[_0x5467('0x1a')]?_0x13a54f[_0x5467('0x1a')][_0x5467('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13a54f[_0x5467('0x1a')]?_0x13a54f['options'][_0x5467('0x1c')]||null:null,'attributes':_0x13a54f['options']?_0x13a54f[_0x5467('0x1a')]['attributes']||null:null,'limit':_0x13a54f[_0x5467('0x1a')]?_0x13a54f['options'][_0x5467('0x1d')]||null:null})[_0x5467('0x1e')](function(_0x3d3e34){logger[_0x5467('0xc')](_0x5467('0x16'),_0x13a54f);logger['debug'](_0x5467('0x16'),_0x13a54f,JSON[_0x5467('0x10')](_0x3d3e34));_0x517b60(_0x3d3e34);})[_0x5467('0x15')](function(_0x2e6e0b){logger[_0x5467('0x11')](_0x5467('0x16'),_0x2e6e0b[_0x5467('0x13')],_0x13a54f);_0x5f3fb2(_0x4bb807[_0x5467('0x11')](0x1f4,_0x2e6e0b[_0x5467('0x13')]));});});}; \ No newline at end of file +var _0x665f=['body','options','raw','where','attributes','limit','UpdateMailApplication','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailApplication,\x20%s,\x20%s','result','catch','MailApplication','update'];(function(_0x780921,_0x7c3eef){var _0x1536c6=function(_0x5b2c11){while(--_0x5b2c11){_0x780921['push'](_0x780921['shift']());}};_0x1536c6(++_0x7c3eef);}(_0x665f,0x19a));var _0xf665=function(_0x309824,_0x150a1a){_0x309824=_0x309824-0x0;var _0x2eaa86=_0x665f[_0x309824];return _0x2eaa86;};'use strict';var _=require('lodash');var util=require(_0xf665('0x0'));var moment=require(_0xf665('0x1'));var BPromise=require('bluebird');var rs=require(_0xf665('0x2'));var fs=require('fs');var Redis=require(_0xf665('0x3'));var db=require(_0xf665('0x4'))['db'];var utils=require(_0xf665('0x5'));var logger=require('../../config/logger')(_0xf665('0x6'));var config=require(_0xf665('0x7'));var jayson=require(_0xf665('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x155d67,_0x4ad922,_0x43c05e){return new BPromise(function(_0x31535f,_0x1249e0){return client[_0xf665('0x9')](_0x155d67,_0x43c05e)[_0xf665('0xa')](function(_0x5784d5){logger[_0xf665('0xb')]('MailApplication,\x20%s,\x20%s',_0x4ad922,_0xf665('0xc'));logger[_0xf665('0xd')](_0xf665('0xe'),_0x4ad922,_0xf665('0xc'),JSON[_0xf665('0xf')](_0x5784d5));if(_0x5784d5['error']){if(_0x5784d5[_0xf665('0x10')][_0xf665('0x11')]===0x1f4){logger[_0xf665('0x10')]('MailApplication,\x20%s,\x20%s',_0x4ad922,_0x5784d5[_0xf665('0x10')][_0xf665('0x12')]);return _0x1249e0(_0x5784d5[_0xf665('0x10')]['message']);}logger[_0xf665('0x10')]('MailApplication,\x20%s,\x20%s',_0x4ad922,_0x5784d5[_0xf665('0x10')][_0xf665('0x12')]);return _0x31535f(_0x5784d5['error'][_0xf665('0x12')]);}else{logger['info'](_0xf665('0x13'),_0x4ad922,_0xf665('0xc'));_0x31535f(_0x5784d5[_0xf665('0x14')]['message']);}})[_0xf665('0x15')](function(_0x2e0786){logger[_0xf665('0x10')](_0xf665('0x13'),_0x4ad922,_0x2e0786);_0x1249e0(_0x2e0786);});});}exports['UpdateMailApplication']=function(_0x334b84){var _0x2f04c8=this;return new Promise(function(_0x36b356,_0x2543da){return db[_0xf665('0x16')][_0xf665('0x17')](_0x334b84[_0xf665('0x18')],{'raw':_0x334b84[_0xf665('0x19')]?_0x334b84['options'][_0xf665('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x334b84[_0xf665('0x19')]?_0x334b84[_0xf665('0x19')][_0xf665('0x1b')]||null:null,'attributes':_0x334b84['options']?_0x334b84[_0xf665('0x19')][_0xf665('0x1c')]||null:null,'limit':_0x334b84['options']?_0x334b84['options'][_0xf665('0x1d')]||null:null})[_0xf665('0xa')](function(_0x418801){logger['info']('UpdateMailApplication',_0x334b84);logger[_0xf665('0xd')](_0xf665('0x1e'),_0x334b84,JSON[_0xf665('0xf')](_0x418801));_0x36b356(_0x418801);})[_0xf665('0x15')](function(_0x373083){logger[_0xf665('0x10')](_0xf665('0x1e'),_0x373083[_0xf665('0x12')],_0x334b84);_0x2543da(_0x2f04c8[_0xf665('0x10')](0x1f4,_0x373083[_0xf665('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 35bc35d..28500ec 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 _0x57ed=['isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','exports','Router','./mailInteraction.controller','get'];(function(_0x22f85a,_0x195ed5){var _0xaa717=function(_0xe9828e){while(--_0xe9828e){_0x22f85a['push'](_0x22f85a['shift']());}};_0xaa717(++_0x195ed5);}(_0x57ed,0x15b));var _0xd57e=function(_0x1d7492,_0x34abc1){_0x1d7492=_0x1d7492-0x0;var _0xc17b6d=_0x57ed[_0x1d7492];return _0xc17b6d;};'use strict';var express=require('express');var router=express[_0xd57e('0x0')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require(_0xd57e('0x1'));router[_0xd57e('0x2')]('/',auth[_0xd57e('0x3')](),controller[_0xd57e('0x4')]);router['get'](_0xd57e('0x5'),auth['isAuthenticated'](),controller[_0xd57e('0x6')]);router[_0xd57e('0x2')](_0xd57e('0x7'),auth[_0xd57e('0x3')](),controller['show']);router[_0xd57e('0x2')](_0xd57e('0x8'),auth[_0xd57e('0x3')](),controller[_0xd57e('0x9')]);router[_0xd57e('0x2')](_0xd57e('0xa'),auth['isAuthenticated'](),controller[_0xd57e('0xb')]);router[_0xd57e('0xc')]('/',auth[_0xd57e('0x3')](),controller[_0xd57e('0xd')]);router[_0xd57e('0xc')](_0xd57e('0x8'),auth[_0xd57e('0x3')](),controller[_0xd57e('0xe')]);router[_0xd57e('0xc')](_0xd57e('0xf'),auth[_0xd57e('0x3')](),interaction[_0xd57e('0x10')](_0xd57e('0x11'),_0xd57e('0x12')),controller[_0xd57e('0x13')]);router[_0xd57e('0x14')](_0xd57e('0x7'),auth['isAuthenticated'](),interaction[_0xd57e('0x10')](_0xd57e('0x11'),_0xd57e('0x15')),controller[_0xd57e('0x16')]);router[_0xd57e('0x17')](_0xd57e('0x7'),auth[_0xd57e('0x3')](),interaction[_0xd57e('0x10')](_0xd57e('0x11'),'mailinteraction:destroy'),controller['destroy']);router[_0xd57e('0x17')]('/:id/tags',auth[_0xd57e('0x3')](),controller['removeTags']);module[_0xd57e('0x18')]=router; \ No newline at end of file +var _0xaffe=['/:id/tags','tracked','mail','addTags','put','mailinteraction:update','update','mailinteraction:destroy','delete','removeTags','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage'];(function(_0x178668,_0x1ec300){var _0x26107d=function(_0x4c0aa8){while(--_0x4c0aa8){_0x178668['push'](_0x178668['shift']());}};_0x26107d(++_0x1ec300);}(_0xaffe,0x14e));var _0xeaff=function(_0x1753ec,_0x3dee54){_0x1753ec=_0x1753ec-0x0;var _0x4a7871=_0xaffe[_0x1753ec];return _0x4a7871;};'use strict';var express=require(_0xeaff('0x0'));var router=express[_0xeaff('0x1')]();var auth=require(_0xeaff('0x2'));var interaction=require(_0xeaff('0x3'));var controller=require(_0xeaff('0x4'));router[_0xeaff('0x5')]('/',auth[_0xeaff('0x6')](),controller['index']);router[_0xeaff('0x5')](_0xeaff('0x7'),auth[_0xeaff('0x6')](),controller[_0xeaff('0x8')]);router['get'](_0xeaff('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0xeaff('0xa'),auth['isAuthenticated'](),controller[_0xeaff('0xb')]);router[_0xeaff('0x5')](_0xeaff('0xc'),auth[_0xeaff('0x6')](),controller[_0xeaff('0xd')]);router[_0xeaff('0xe')]('/',auth[_0xeaff('0x6')](),controller[_0xeaff('0xf')]);router[_0xeaff('0xe')](_0xeaff('0xa'),auth[_0xeaff('0x6')](),controller[_0xeaff('0x10')]);router[_0xeaff('0xe')](_0xeaff('0x11'),auth[_0xeaff('0x6')](),interaction[_0xeaff('0x12')](_0xeaff('0x13'),'mailinteraction:addtags'),controller[_0xeaff('0x14')]);router[_0xeaff('0x15')](_0xeaff('0x9'),auth[_0xeaff('0x6')](),interaction[_0xeaff('0x12')](_0xeaff('0x13'),_0xeaff('0x16')),controller[_0xeaff('0x17')]);router['delete'](_0xeaff('0x9'),auth[_0xeaff('0x6')](),interaction[_0xeaff('0x12')](_0xeaff('0x13'),_0xeaff('0x18')),controller['destroy']);router[_0xeaff('0x19')](_0xeaff('0x11'),auth[_0xeaff('0x6')](),controller[_0xeaff('0x1a')]);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 46fcf88..1c10c12 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 _0xc270=['STRING','long','DATE','ENUM','out','INTEGER','exports','BOOLEAN'];(function(_0x1c4b05,_0x38e5ae){var _0x113a59=function(_0x208391){while(--_0x208391){_0x1c4b05['push'](_0x1c4b05['shift']());}};_0x113a59(++_0x38e5ae);}(_0xc270,0xde));var _0x0c27=function(_0x662180,_0xb5dff7){_0x662180=_0x662180-0x0;var _0x4a70a9=_0xc270[_0x662180];return _0x4a70a9;};'use strict';var Sequelize=require('sequelize');var iconv=require('iconv');module[_0x0c27('0x0')]={'closed':{'type':Sequelize[_0x0c27('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0c27('0x2')]},'note':{'type':Sequelize[_0x0c27('0x2')]},'inReplyTo':{'type':Sequelize[_0x0c27('0x2')](0x1fe)},'to':{'type':Sequelize[_0x0c27('0x2')]},'cc':{'type':Sequelize['TEXT'](_0x0c27('0x3'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0c27('0x4')]},'substatus':{'type':Sequelize[_0x0c27('0x2')](0x3c)},'substatusAt':{'type':Sequelize[_0x0c27('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x0c27('0x5')]('in',_0x0c27('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0c27('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x0c27('0x5')]('in',_0x0c27('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0c27('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x0c27('0x7')]}}; \ No newline at end of file +var _0x8675=['STRING','long','TEXT','ENUM','out','INTEGER','iconv','BOOLEAN','DATE'];(function(_0x414065,_0x5b8fbe){var _0x410567=function(_0x2bdc0f){while(--_0x2bdc0f){_0x414065['push'](_0x414065['shift']());}};_0x410567(++_0x5b8fbe);}(_0x8675,0x165));var _0x5867=function(_0x5dfe9b,_0x318b85){_0x5dfe9b=_0x5dfe9b-0x0;var _0x3bb0f4=_0x8675[_0x5dfe9b];return _0x3bb0f4;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x5867('0x0'));module['exports']={'closed':{'type':Sequelize[_0x5867('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5867('0x2')]},'disposition':{'type':Sequelize[_0x5867('0x3')]},'secondDisposition':{'type':Sequelize[_0x5867('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5867('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x5867('0x3')]},'cc':{'type':Sequelize['TEXT'](_0x5867('0x4'))},'subject':{'type':Sequelize[_0x5867('0x5')]()},'attach':{'type':Sequelize[_0x5867('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x5867('0x2')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x5867('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x5867('0x6')]('in',_0x5867('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5867('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5867('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x5867('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index b1697be..43d890e 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 _0x96ea=['count','Content-Range','destroy','then','sendStatus','error','stack','name','send','map','MailInteraction','rawAttributes','type','key','findAll','query','show','model','keys','filters','fields','attributes','includeAll','include','merge','options','find','create','body','catch','update','params','describe','addMessage','MailMessage','ids','getMessages','findOne','intersection','length','hasOwnProperty','nolimit','order','sort','where','MailInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','addTags','setTags','omit','Tag','color','emit','mailInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','mkdirSync','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','juice','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','status','end','json','offset','undefined','limit'];(function(_0x4d6878,_0x3cf658){var _0x391759=function(_0x422cbc){while(--_0x422cbc){_0x4d6878['push'](_0x4d6878['shift']());}};_0x391759(++_0x3cf658);}(_0x96ea,0x13d));var _0xa96e=function(_0x22a91c,_0x5ce13f){_0x22a91c=_0x22a91c-0x0;var _0x733c2f=_0x96ea[_0x22a91c];return _0x733c2f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa96e('0x0'));var zipdir=require(_0xa96e('0x1'));var moment=require(_0xa96e('0x2'));var BPromise=require(_0xa96e('0x3'));var util=require(_0xa96e('0x4'));var path=require(_0xa96e('0x5'));var fs=require('fs');var _=require('lodash');var juice=require(_0xa96e('0x6'));var Redis=require(_0xa96e('0x7'));var interaction=require(_0xa96e('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0xa96e('0x9'))(_0xa96e('0xa'));var config=require(_0xa96e('0xb'));var db=require(_0xa96e('0xc'))['db'];var htmlEntities=require(_0xa96e('0xd'));config[_0xa96e('0xe')]=_[_0xa96e('0xf')](config[_0xa96e('0xe')],{'host':_0xa96e('0x10'),'port':0x18eb});var socket=require(_0xa96e('0x11'))(new Redis(config[_0xa96e('0xe')]));require(_0xa96e('0x12'))['register'](socket);function respondWithStatusCode(_0x5e9dc1,_0x39cc98){_0x39cc98=_0x39cc98||0xcc;return function(_0x46f669){if(_0x46f669){return _0x5e9dc1['sendStatus'](_0x39cc98);}return _0x5e9dc1[_0xa96e('0x13')](_0x39cc98)[_0xa96e('0x14')]();};}function respondWithResult(_0x22bef8,_0x4be5ce){_0x4be5ce=_0x4be5ce||0xc8;return function(_0x1b955b){if(_0x1b955b){return _0x22bef8[_0xa96e('0x13')](_0x4be5ce)[_0xa96e('0x15')](_0x1b955b);}};}function respondWithFilteredResult(_0xb0ad46,_0x126c14){return function(_0x1dbb30){if(_0x1dbb30){var _0x1281f6=typeof _0x126c14[_0xa96e('0x16')]===_0xa96e('0x17')&&typeof _0x126c14[_0xa96e('0x18')]===_0xa96e('0x17');var _0x3fcc76=_0x1dbb30['count'];var _0x53d732=_0x1281f6?0x0:_0x126c14[_0xa96e('0x16')];var _0x2988ae=_0x1281f6?_0x1dbb30[_0xa96e('0x19')]:_0x126c14[_0xa96e('0x16')]+_0x126c14[_0xa96e('0x18')];var _0x99343;if(_0x2988ae>=_0x3fcc76){_0x2988ae=_0x3fcc76;_0x99343=0xc8;}else{_0x99343=0xce;}_0xb0ad46['status'](_0x99343);return _0xb0ad46['set'](_0xa96e('0x1a'),_0x53d732+'-'+_0x2988ae+'/'+_0x3fcc76)['json'](_0x1dbb30);}return null;};}function saveUpdates(_0x48c2b5){return function(_0x289eb0){if(_0x289eb0){return _0x289eb0['update'](_0x48c2b5)['then'](function(_0x43a921){return _0x43a921;});}return null;};}function removeEntity(_0x508d53){return function(_0x4781ff){if(_0x4781ff){return _0x4781ff[_0xa96e('0x1b')]()[_0xa96e('0x1c')](function(){_0x508d53[_0xa96e('0x13')](0xcc)[_0xa96e('0x14')]();});}};}function handleEntityNotFound(_0x1288e8){return function(_0x41918a){if(!_0x41918a){_0x1288e8[_0xa96e('0x1d')](0x194);}return _0x41918a;};}function handleError(_0x37aba9,_0x1b58bf){_0x1b58bf=_0x1b58bf||0x1f4;return function(_0x202303){logger[_0xa96e('0x1e')](_0x202303[_0xa96e('0x1f')]);if(_0x202303[_0xa96e('0x20')]){delete _0x202303[_0xa96e('0x20')];}_0x37aba9['status'](_0x1b58bf)[_0xa96e('0x21')](_0x202303);};}exports['index']=function(_0x487804,_0x226bb1){var _0x44f812={};var _0x44e08e=_[_0xa96e('0x22')](db[_0xa96e('0x23')][_0xa96e('0x24')],function(_0x5b052b){return{'name':_0x5b052b['fieldName'],'type':_0x5b052b[_0xa96e('0x25')][_0xa96e('0x26')]};});_0x44f812=qs['getOptions'](_0x44e08e,_0x487804);return interaction[_0xa96e('0x27')]('mail',_0x487804[_0xa96e('0x28')],_0x487804['user'],_0x44f812,_0x44e08e)[_0xa96e('0x1c')](respondWithFilteredResult(_0x226bb1,_0x44f812))['catch'](handleError(_0x226bb1,null));};exports[_0xa96e('0x29')]=function(_0x2f2762,_0x5cc6e0){var _0x2a9e8e={'raw':![],'where':{'id':_0x2f2762['params']['id']}},_0x780d5c={};_0x780d5c[_0xa96e('0x2a')]=_[_0xa96e('0x2b')](db[_0xa96e('0x23')][_0xa96e('0x24')]);_0x780d5c[_0xa96e('0x28')]=_[_0xa96e('0x2b')](_0x2f2762[_0xa96e('0x28')]);_0x780d5c[_0xa96e('0x2c')]=_['intersection'](_0x780d5c[_0xa96e('0x2a')],_0x780d5c[_0xa96e('0x28')]);_0x2a9e8e['attributes']=_['intersection'](_0x780d5c[_0xa96e('0x2a')],qs[_0xa96e('0x2d')](_0x2f2762[_0xa96e('0x28')][_0xa96e('0x2d')]));_0x2a9e8e[_0xa96e('0x2e')]=_0x2a9e8e[_0xa96e('0x2e')]['length']?_0x2a9e8e[_0xa96e('0x2e')]:_0x780d5c['model'];if(_0x2f2762[_0xa96e('0x28')][_0xa96e('0x2f')]){_0x2a9e8e[_0xa96e('0x30')]=[{'all':!![]}];}_0x2a9e8e=_[_0xa96e('0x31')]({},_0x2a9e8e,_0x2f2762[_0xa96e('0x32')]);return db['MailInteraction'][_0xa96e('0x33')](_0x2a9e8e)['then'](handleEntityNotFound(_0x5cc6e0,null))[_0xa96e('0x1c')](respondWithResult(_0x5cc6e0,null))['catch'](handleError(_0x5cc6e0,null));};exports[_0xa96e('0x34')]=function(_0x240aaa,_0x19b3ec){return db['MailInteraction'][_0xa96e('0x34')](_0x240aaa[_0xa96e('0x35')],{})[_0xa96e('0x1c')](respondWithResult(_0x19b3ec,0xc9))[_0xa96e('0x36')](handleError(_0x19b3ec,null));};exports[_0xa96e('0x37')]=function(_0x25ea4b,_0x5f5e01){if(_0x25ea4b['body']['id']){delete _0x25ea4b[_0xa96e('0x35')]['id'];}return db['MailInteraction'][_0xa96e('0x33')]({'where':{'id':_0x25ea4b['params']['id']}})['then'](handleEntityNotFound(_0x5f5e01,null))[_0xa96e('0x1c')](saveUpdates(_0x25ea4b[_0xa96e('0x35')],null))[_0xa96e('0x1c')](respondWithResult(_0x5f5e01,null))[_0xa96e('0x36')](handleError(_0x5f5e01,null));};exports[_0xa96e('0x1b')]=function(_0x5b2c62,_0x91cc18){return db[_0xa96e('0x23')][_0xa96e('0x33')]({'where':{'id':_0x5b2c62[_0xa96e('0x38')]['id']}})[_0xa96e('0x1c')](handleEntityNotFound(_0x91cc18,null))['then'](removeEntity(_0x91cc18,null))[_0xa96e('0x36')](handleError(_0x91cc18,null));};exports['describe']=function(_0x34ec12,_0xb9bc8a){return db[_0xa96e('0x23')][_0xa96e('0x39')]()[_0xa96e('0x1c')](respondWithResult(_0xb9bc8a,null))['catch'](handleError(_0xb9bc8a,null));};exports[_0xa96e('0x3a')]=function(_0x5066fc,_0x96cfb5){return db[_0xa96e('0x3b')][_0xa96e('0x33')]({'where':{'id':_0x5066fc['params']['id']}})[_0xa96e('0x1c')](handleEntityNotFound(_0x96cfb5,null))[_0xa96e('0x1c')](function(_0x1aeeef){if(_0x1aeeef){return _0x1aeeef['addMessage'](_0x5066fc['body'][_0xa96e('0x3c')],_['omit'](_0x5066fc[_0xa96e('0x35')],[_0xa96e('0x3c'),'id'])||{});}})[_0xa96e('0x1c')](respondWithResult(_0x96cfb5,null))[_0xa96e('0x36')](handleError(_0x96cfb5,null));};exports[_0xa96e('0x3d')]=function(_0x23122e,_0x4c41b7){var _0xd64378={'raw':![],'where':{}};var _0x46abc6={};var _0x16a16e={'count':0x0,'rows':[]};return db['MailInteraction'][_0xa96e('0x3e')]({'where':{'id':_0x23122e[_0xa96e('0x38')]['id']}})[_0xa96e('0x1c')](handleEntityNotFound(_0x4c41b7,null))[_0xa96e('0x1c')](function(_0x255dc){if(_0x255dc){_0x46abc6[_0xa96e('0x2a')]=_['keys'](db[_0xa96e('0x3b')][_0xa96e('0x24')]);_0x46abc6[_0xa96e('0x28')]=_[_0xa96e('0x2b')](_0x23122e[_0xa96e('0x28')]);_0x46abc6[_0xa96e('0x2c')]=_[_0xa96e('0x3f')](_0x46abc6[_0xa96e('0x2a')],_0x46abc6[_0xa96e('0x28')]);_0xd64378[_0xa96e('0x2e')]=_['intersection'](_0x46abc6[_0xa96e('0x2a')],qs[_0xa96e('0x2d')](_0x23122e[_0xa96e('0x28')]['fields']));_0xd64378[_0xa96e('0x2e')]=_0xd64378['attributes'][_0xa96e('0x40')]?_0xd64378[_0xa96e('0x2e')]:_0x46abc6[_0xa96e('0x2a')];if(!_0x23122e[_0xa96e('0x28')][_0xa96e('0x41')](_0xa96e('0x42'))){_0xd64378['limit']=qs[_0xa96e('0x18')](_0x23122e[_0xa96e('0x28')]['limit']);_0xd64378[_0xa96e('0x16')]=qs[_0xa96e('0x16')](_0x23122e[_0xa96e('0x28')][_0xa96e('0x16')]);}_0xd64378[_0xa96e('0x43')]=qs[_0xa96e('0x44')](_0x23122e[_0xa96e('0x28')]['sort']);_0xd64378[_0xa96e('0x45')]=qs[_0xa96e('0x2c')](_['pick'](_0x23122e[_0xa96e('0x28')],_0x46abc6[_0xa96e('0x2c')]));_0xd64378[_0xa96e('0x45')][_0xa96e('0x46')]=_0x255dc['id'];if(_0x23122e['query'][_0xa96e('0x47')]){_0xd64378[_0xa96e('0x45')]=_['merge'](_0xd64378[_0xa96e('0x45')],{'$or':_[_0xa96e('0x22')](_0xd64378[_0xa96e('0x2e')],function(_0x469d9e){var _0x3aa8be={};_0x3aa8be[_0x469d9e]={'$like':'%'+_0x23122e[_0xa96e('0x28')]['filter']+'%'};return _0x3aa8be;})});}if(_0x23122e['query'][_0xa96e('0x48')]){var _0x5cd7b4=_0x23122e['query'][_0xa96e('0x48')]['split'](',');var _0x3d3778={};_0x3d3778[_0x5cd7b4[0x0]]={'$gte':moment(_0x5cd7b4[0x1])[_0xa96e('0x49')](_0xa96e('0x4a'))};_0xd64378[_0xa96e('0x45')]=_[_0xa96e('0x31')](_0xd64378[_0xa96e('0x45')],_0x3d3778);}_0xd64378=_[_0xa96e('0x31')]({},_0xd64378,_0x23122e['options']);return db[_0xa96e('0x3b')]['count']({'where':_0xd64378[_0xa96e('0x45')]})[_0xa96e('0x1c')](function(_0x50df7f){_0x16a16e[_0xa96e('0x19')]=_0x50df7f;if(_0x23122e[_0xa96e('0x28')][_0xa96e('0x2f')]){_0xd64378[_0xa96e('0x30')]=[{'all':!![]}];}return db[_0xa96e('0x3b')]['findAll'](_0xd64378);})['then'](function(_0x151f1e){if(_0x23122e[_0xa96e('0x28')][_0xa96e('0x4b')]===_0xa96e('0x4c')){for(var _0xa8fba1=0x0;_0xa8fba1<_0x151f1e[_0xa96e('0x40')];_0xa8fba1++){_0x151f1e[_0xa8fba1][_0xa96e('0x35')]=juice(_0x151f1e[_0xa8fba1][_0xa96e('0x35')]);}}_0x16a16e[_0xa96e('0x4d')]=_0x151f1e;return _0x16a16e;});}})['then'](respondWithFilteredResult(_0x4c41b7,_0xd64378))[_0xa96e('0x36')](handleError(_0x4c41b7,null));};exports[_0xa96e('0x4e')]=function(_0x811f9e,_0x1b71ab){return db[_0xa96e('0x23')][_0xa96e('0x33')]({'where':{'id':_0x811f9e[_0xa96e('0x38')]['id']}})['then'](handleEntityNotFound(_0x1b71ab,null))[_0xa96e('0x1c')](function(_0x48c97d){if(_0x48c97d){return _0x48c97d[_0xa96e('0x4f')](_0x811f9e[_0xa96e('0x35')][_0xa96e('0x3c')],_[_0xa96e('0x50')](_0x811f9e[_0xa96e('0x35')],[_0xa96e('0x3c'),'id'])||{})['spread'](function(){return db[_0xa96e('0x51')][_0xa96e('0x27')]({'attributes':['id',_0xa96e('0x20'),_0xa96e('0x52')],'where':{'id':_0x811f9e['body'][_0xa96e('0x3c')]}});})['then'](function(_0x9f482a){socket[_0xa96e('0x53')](_0xa96e('0x54'),{'id':Number(_0x811f9e[_0xa96e('0x38')]['id']),'tags':_0x9f482a||[]});return{'id':Number(_0x811f9e[_0xa96e('0x38')]['id']),'tags':_0x9f482a||[]};});}})[_0xa96e('0x1c')](respondWithResult(_0x1b71ab,null))[_0xa96e('0x36')](handleError(_0x1b71ab,null));};exports[_0xa96e('0x55')]=function(_0x10e691,_0x32e02d){return db['MailInteraction'][_0xa96e('0x33')]({'where':{'id':_0x10e691[_0xa96e('0x38')]['id']}})[_0xa96e('0x1c')](handleEntityNotFound(_0x32e02d,null))[_0xa96e('0x1c')](function(_0x16b787){if(_0x16b787){return _0x16b787[_0xa96e('0x55')](_0x10e691[_0xa96e('0x28')][_0xa96e('0x3c')]);}})['then'](respondWithStatusCode(_0x32e02d,null))[_0xa96e('0x36')](handleError(_0x32e02d,null));};exports['download']=function(_0x3ee0fb,_0x7f4694){var _0x3700ce=moment()[_0xa96e('0x56')]()['toString']();var _0x49e93b=path[_0xa96e('0x57')](config[_0xa96e('0x58')],_0xa96e('0x59'),_0xa96e('0x5a'),_0xa96e('0x5b'));var _0x42f5e7=path[_0xa96e('0x57')](config['root'],_0xa96e('0x59'),_0xa96e('0x5a'),_0xa96e('0x5c'));var _0x31d1d8=path[_0xa96e('0x57')](_0x49e93b,_0x3700ce);var _0x15086f=util[_0xa96e('0x49')]('transcript-%d-%s.zip',_0x3ee0fb['params']['id'],_0x3700ce);var _0x2b90eb=path['join'](_0x49e93b,_0x15086f);var _0x36fe60=[];if(_0x3ee0fb[_0xa96e('0x28')]['attachments']){_0x36fe60[_0xa96e('0x5d')]({'model':db[_0xa96e('0x5e')],'as':_0xa96e('0x5f'),'raw':!![]});}var _0x4ad503=[{'model':db[_0xa96e('0x3b')],'as':_0xa96e('0x60'),'attributes':['id',_0xa96e('0x35'),_0xa96e('0x61'),'to','cc',_0xa96e('0x62'),_0xa96e('0x63'),_0xa96e('0x64')],'where':{'secret':![]},'order':qs[_0xa96e('0x44')]('id'),'include':_0x36fe60}];return db[_0xa96e('0x23')]['find']({'where':{'id':_0x3ee0fb[_0xa96e('0x38')]['id']},'include':_0x4ad503})[_0xa96e('0x1c')](handleEntityNotFound(_0x7f4694,null))['then'](function(_0xcc1002){if(_0xcc1002&&_0xcc1002['Messages']){var _0x35dca8=_0xcc1002['get']({'plain':!![]});fs[_0xa96e('0x65')](_0x31d1d8);return BPromise['each'](_0x35dca8[_0xa96e('0x60')],function(_0x1b32b3,_0x426515){var _0x1f497b={'from':_0x1b32b3[_0xa96e('0x61')],'to':_0x1b32b3['to']||'missing.recipient@your.company.com','subject':_0x1b32b3[_0xa96e('0x63')],'html':htmlEntities[_0xa96e('0x66')](_0x1b32b3[_0xa96e('0x35')]),'headers':{'Date':moment(_0x1b32b3[_0xa96e('0x64')])['format'](_0xa96e('0x67'))},'attachments':[]};if(_0x1b32b3['cc']){_0x1f497b[_0xa96e('0x68')]['Cc']=_0x1b32b3['cc'];}if(_0x1b32b3['bcc']){_0x1f497b[_0xa96e('0x68')][_0xa96e('0x69')]=_0x1b32b3[_0xa96e('0x62')];}return new BPromise(function(_0x53fa9b,_0x4750b3){if(_0x1b32b3[_0xa96e('0x5f')]){for(var _0x1aab2b=0x0;_0x1aab2b<_0x1b32b3[_0xa96e('0x5f')][_0xa96e('0x40')];_0x1aab2b++){var _0x13c8f4=_0x1b32b3[_0xa96e('0x5f')][_0x1aab2b];var _0x487963=path[_0xa96e('0x57')](_0x42f5e7,_0x13c8f4[_0xa96e('0x6a')]);if(fs[_0xa96e('0x6b')](_0x487963)){_0x1f497b[_0xa96e('0x5c')][_0xa96e('0x5d')]({'name':_0x13c8f4[_0xa96e('0x20')],'contentType':_0x13c8f4[_0xa96e('0x25')],'data':fs[_0xa96e('0x6c')](_0x487963)});}}}emlformat[_0xa96e('0x6d')](_0x1f497b,function(_0x51104a,_0x2b98d3){if(_0x51104a)return _0x4750b3(_0x51104a);fs[_0xa96e('0x6e')](path[_0xa96e('0x57')](_0x31d1d8,util[_0xa96e('0x49')](_0xa96e('0x6f'),_0x426515)),_0x2b98d3);return _0x53fa9b(_0x2b98d3);});});})['then'](function(){return new BPromise(function(_0x449f5c,_0x291f86){zipdir(_0x31d1d8,{'saveTo':_0x2b90eb},function(_0x1fba99,_0xf1c99e){if(_0x1fba99)return _0x291f86(_0x1fba99);return _0x449f5c(_0xf1c99e);});})[_0xa96e('0x1c')](function(){return new BPromise(function(_0x1e1558,_0x1d330d){rimraf(_0x31d1d8,function(_0xc89f58){if(_0xc89f58)_0x1d330d(_0xc89f58);return _0x1e1558();});});})[_0xa96e('0x1c')](function(){return _0x7f4694[_0xa96e('0x70')](_0x2b90eb,_0x15086f,function(_0x28d9b3){if(!_0x28d9b3)fs[_0xa96e('0x71')](_0x2b90eb);});});});}else{return _0x7f4694[_0xa96e('0x1d')](0xc8);}})[_0xa96e('0x36')](handleError(_0x7f4694,null));}; \ No newline at end of file +var _0x991b=['tmp','attachments','transcript-%d-%s.zip','push','Attachments','Messages','from','bcc','subject','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','decode','format','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','download','unlinkSync','eml-format','zip-dir','bluebird','juice','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','error','stack','name','map','MailInteraction','rawAttributes','key','getOptions','findAll','mail','query','user','then','catch','show','params','model','keys','intersection','attributes','fields','includeAll','include','merge','find','create','body','destroy','describe','addMessage','ids','omit','getMessages','MailMessage','filters','order','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','length','rows','addTags','setTags','spread','Tag','color','emit','removeTags','join','root','server','files'];(function(_0x31bca0,_0x150f4f){var _0x1de0fe=function(_0x31e3c7){while(--_0x31e3c7){_0x31bca0['push'](_0x31bca0['shift']());}};_0x1de0fe(++_0x150f4f);}(_0x991b,0x83));var _0xb991=function(_0x23c394,_0x13ffae){_0x23c394=_0x23c394-0x0;var _0x59bcef=_0x991b[_0x23c394];return _0x59bcef;};'use strict';var emlformat=require(_0xb991('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb991('0x1'));var moment=require('moment');var BPromise=require(_0xb991('0x2'));var util=require('util');var path=require('path');var fs=require('fs');var _=require('lodash');var juice=require(_0xb991('0x3'));var Redis=require(_0xb991('0x4'));var interaction=require('../../components/interaction/service');var qs=require(_0xb991('0x5'));var logger=require('../../config/logger')(_0xb991('0x6'));var config=require(_0xb991('0x7'));var db=require(_0xb991('0x8'))['db'];var htmlEntities=require(_0xb991('0x9'));config[_0xb991('0xa')]=_['defaults'](config[_0xb991('0xa')],{'host':_0xb991('0xb'),'port':0x18eb});var socket=require(_0xb991('0xc'))(new Redis(config[_0xb991('0xa')]));require(_0xb991('0xd'))[_0xb991('0xe')](socket);function respondWithStatusCode(_0x2daa77,_0x9ff182){_0x9ff182=_0x9ff182||0xcc;return function(_0x111654){if(_0x111654){return _0x2daa77[_0xb991('0xf')](_0x9ff182);}return _0x2daa77[_0xb991('0x10')](_0x9ff182)[_0xb991('0x11')]();};}function respondWithResult(_0x1bd7d5,_0x201097){_0x201097=_0x201097||0xc8;return function(_0x478ad8){if(_0x478ad8){return _0x1bd7d5['status'](_0x201097)[_0xb991('0x12')](_0x478ad8);}};}function respondWithFilteredResult(_0x363a23,_0x5c43f1){return function(_0x2c77ff){if(_0x2c77ff){var _0x3f9622=typeof _0x5c43f1[_0xb991('0x13')]===_0xb991('0x14')&&typeof _0x5c43f1[_0xb991('0x15')]===_0xb991('0x14');var _0x420f29=_0x2c77ff['count'];var _0x3c8800=_0x3f9622?0x0:_0x5c43f1[_0xb991('0x13')];var _0x29c374=_0x3f9622?_0x2c77ff[_0xb991('0x16')]:_0x5c43f1[_0xb991('0x13')]+_0x5c43f1[_0xb991('0x15')];var _0x4f6dca;if(_0x29c374>=_0x420f29){_0x29c374=_0x420f29;_0x4f6dca=0xc8;}else{_0x4f6dca=0xce;}_0x363a23[_0xb991('0x10')](_0x4f6dca);return _0x363a23['set'](_0xb991('0x17'),_0x3c8800+'-'+_0x29c374+'/'+_0x420f29)[_0xb991('0x12')](_0x2c77ff);}return null;};}function saveUpdates(_0x2140f0){return function(_0x43c989){if(_0x43c989){return _0x43c989[_0xb991('0x18')](_0x2140f0)['then'](function(_0x213d93){return _0x213d93;});}return null;};}function removeEntity(_0x1b1efc){return function(_0x238c88){if(_0x238c88){return _0x238c88['destroy']()['then'](function(){_0x1b1efc[_0xb991('0x10')](0xcc)[_0xb991('0x11')]();});}};}function handleEntityNotFound(_0x1fc5ce){return function(_0x6f919e){if(!_0x6f919e){_0x1fc5ce['sendStatus'](0x194);}return _0x6f919e;};}function handleError(_0x1e6047,_0x3f6168){_0x3f6168=_0x3f6168||0x1f4;return function(_0xbabe32){logger[_0xb991('0x19')](_0xbabe32[_0xb991('0x1a')]);if(_0xbabe32[_0xb991('0x1b')]){delete _0xbabe32[_0xb991('0x1b')];}_0x1e6047[_0xb991('0x10')](_0x3f6168)['send'](_0xbabe32);};}exports['index']=function(_0x20bde2,_0x513696){var _0x14f30c={};var _0x3cd708=_[_0xb991('0x1c')](db[_0xb991('0x1d')][_0xb991('0x1e')],function(_0x5ef654){return{'name':_0x5ef654['fieldName'],'type':_0x5ef654['type'][_0xb991('0x1f')]};});_0x14f30c=qs[_0xb991('0x20')](_0x3cd708,_0x20bde2);return interaction[_0xb991('0x21')](_0xb991('0x22'),_0x20bde2[_0xb991('0x23')],_0x20bde2[_0xb991('0x24')],_0x14f30c,_0x3cd708)[_0xb991('0x25')](respondWithFilteredResult(_0x513696,_0x14f30c))[_0xb991('0x26')](handleError(_0x513696,null));};exports[_0xb991('0x27')]=function(_0x54918d,_0x16aa6a){var _0xec04d0={'raw':![],'where':{'id':_0x54918d[_0xb991('0x28')]['id']}},_0x5bbe37={};_0x5bbe37[_0xb991('0x29')]=_[_0xb991('0x2a')](db[_0xb991('0x1d')][_0xb991('0x1e')]);_0x5bbe37[_0xb991('0x23')]=_[_0xb991('0x2a')](_0x54918d[_0xb991('0x23')]);_0x5bbe37['filters']=_[_0xb991('0x2b')](_0x5bbe37[_0xb991('0x29')],_0x5bbe37[_0xb991('0x23')]);_0xec04d0[_0xb991('0x2c')]=_[_0xb991('0x2b')](_0x5bbe37['model'],qs[_0xb991('0x2d')](_0x54918d['query']['fields']));_0xec04d0[_0xb991('0x2c')]=_0xec04d0[_0xb991('0x2c')]['length']?_0xec04d0[_0xb991('0x2c')]:_0x5bbe37['model'];if(_0x54918d[_0xb991('0x23')][_0xb991('0x2e')]){_0xec04d0[_0xb991('0x2f')]=[{'all':!![]}];}_0xec04d0=_[_0xb991('0x30')]({},_0xec04d0,_0x54918d['options']);return db[_0xb991('0x1d')][_0xb991('0x31')](_0xec04d0)[_0xb991('0x25')](handleEntityNotFound(_0x16aa6a,null))[_0xb991('0x25')](respondWithResult(_0x16aa6a,null))['catch'](handleError(_0x16aa6a,null));};exports[_0xb991('0x32')]=function(_0x4b3bff,_0x89b1cc){return db[_0xb991('0x1d')][_0xb991('0x32')](_0x4b3bff[_0xb991('0x33')],{})[_0xb991('0x25')](respondWithResult(_0x89b1cc,0xc9))['catch'](handleError(_0x89b1cc,null));};exports[_0xb991('0x18')]=function(_0x1105b7,_0x193b2c){if(_0x1105b7[_0xb991('0x33')]['id']){delete _0x1105b7['body']['id'];}return db[_0xb991('0x1d')][_0xb991('0x31')]({'where':{'id':_0x1105b7[_0xb991('0x28')]['id']}})[_0xb991('0x25')](handleEntityNotFound(_0x193b2c,null))[_0xb991('0x25')](saveUpdates(_0x1105b7[_0xb991('0x33')],null))[_0xb991('0x25')](respondWithResult(_0x193b2c,null))[_0xb991('0x26')](handleError(_0x193b2c,null));};exports[_0xb991('0x34')]=function(_0x314a63,_0x498998){return db[_0xb991('0x1d')][_0xb991('0x31')]({'where':{'id':_0x314a63[_0xb991('0x28')]['id']}})[_0xb991('0x25')](handleEntityNotFound(_0x498998,null))[_0xb991('0x25')](removeEntity(_0x498998,null))[_0xb991('0x26')](handleError(_0x498998,null));};exports[_0xb991('0x35')]=function(_0x1232ec,_0x4f8d3c){return db[_0xb991('0x1d')][_0xb991('0x35')]()[_0xb991('0x25')](respondWithResult(_0x4f8d3c,null))[_0xb991('0x26')](handleError(_0x4f8d3c,null));};exports['addMessage']=function(_0x18dcc6,_0x3901e9){return db['MailMessage']['find']({'where':{'id':_0x18dcc6[_0xb991('0x28')]['id']}})['then'](handleEntityNotFound(_0x3901e9,null))[_0xb991('0x25')](function(_0x129e1f){if(_0x129e1f){return _0x129e1f[_0xb991('0x36')](_0x18dcc6[_0xb991('0x33')][_0xb991('0x37')],_[_0xb991('0x38')](_0x18dcc6[_0xb991('0x33')],[_0xb991('0x37'),'id'])||{});}})['then'](respondWithResult(_0x3901e9,null))[_0xb991('0x26')](handleError(_0x3901e9,null));};exports[_0xb991('0x39')]=function(_0x56f291,_0x5b12e1){var _0x4d8b82={'raw':![],'where':{}};var _0x2bd22f={};var _0x50e96b={'count':0x0,'rows':[]};return db[_0xb991('0x1d')]['findOne']({'where':{'id':_0x56f291[_0xb991('0x28')]['id']}})[_0xb991('0x25')](handleEntityNotFound(_0x5b12e1,null))[_0xb991('0x25')](function(_0x7d99e5){if(_0x7d99e5){_0x2bd22f['model']=_[_0xb991('0x2a')](db[_0xb991('0x3a')][_0xb991('0x1e')]);_0x2bd22f[_0xb991('0x23')]=_[_0xb991('0x2a')](_0x56f291[_0xb991('0x23')]);_0x2bd22f[_0xb991('0x3b')]=_[_0xb991('0x2b')](_0x2bd22f[_0xb991('0x29')],_0x2bd22f['query']);_0x4d8b82[_0xb991('0x2c')]=_['intersection'](_0x2bd22f['model'],qs['fields'](_0x56f291[_0xb991('0x23')][_0xb991('0x2d')]));_0x4d8b82[_0xb991('0x2c')]=_0x4d8b82[_0xb991('0x2c')]['length']?_0x4d8b82[_0xb991('0x2c')]:_0x2bd22f['model'];if(!_0x56f291[_0xb991('0x23')]['hasOwnProperty']('nolimit')){_0x4d8b82[_0xb991('0x15')]=qs[_0xb991('0x15')](_0x56f291[_0xb991('0x23')][_0xb991('0x15')]);_0x4d8b82[_0xb991('0x13')]=qs[_0xb991('0x13')](_0x56f291[_0xb991('0x23')][_0xb991('0x13')]);}_0x4d8b82[_0xb991('0x3c')]=qs[_0xb991('0x3d')](_0x56f291['query']['sort']);_0x4d8b82[_0xb991('0x3e')]=qs[_0xb991('0x3b')](_[_0xb991('0x3f')](_0x56f291[_0xb991('0x23')],_0x2bd22f[_0xb991('0x3b')]));_0x4d8b82[_0xb991('0x3e')]['MailInteractionId']=_0x7d99e5['id'];if(_0x56f291['query']['filter']){_0x4d8b82[_0xb991('0x3e')]=_['merge'](_0x4d8b82[_0xb991('0x3e')],{'$or':_['map'](_0x4d8b82[_0xb991('0x2c')],function(_0x5b48cf){var _0x444532={};_0x444532[_0x5b48cf]={'$like':'%'+_0x56f291[_0xb991('0x23')][_0xb991('0x40')]+'%'};return _0x444532;})});}if(_0x56f291[_0xb991('0x23')][_0xb991('0x41')]){var _0x56d5f3=_0x56f291['query'][_0xb991('0x41')][_0xb991('0x42')](',');var _0x49faf4={};_0x49faf4[_0x56d5f3[0x0]]={'$gte':moment(_0x56d5f3[0x1])['format'](_0xb991('0x43'))};_0x4d8b82[_0xb991('0x3e')]=_[_0xb991('0x30')](_0x4d8b82[_0xb991('0x3e')],_0x49faf4);}_0x4d8b82=_[_0xb991('0x30')]({},_0x4d8b82,_0x56f291['options']);return db[_0xb991('0x3a')][_0xb991('0x16')]({'where':_0x4d8b82['where']})['then'](function(_0x1d0725){_0x50e96b[_0xb991('0x16')]=_0x1d0725;if(_0x56f291[_0xb991('0x23')]['includeAll']){_0x4d8b82['include']=[{'all':!![]}];}return db[_0xb991('0x3a')]['findAll'](_0x4d8b82);})[_0xb991('0x25')](function(_0x495d55){if(_0x56f291[_0xb991('0x23')][_0xb991('0x44')]===_0xb991('0x45')){for(var _0x2226ff=0x0;_0x2226ff<_0x495d55[_0xb991('0x46')];_0x2226ff++){_0x495d55[_0x2226ff][_0xb991('0x33')]=juice(_0x495d55[_0x2226ff][_0xb991('0x33')]);}}_0x50e96b[_0xb991('0x47')]=_0x495d55;return _0x50e96b;});}})[_0xb991('0x25')](respondWithFilteredResult(_0x5b12e1,_0x4d8b82))[_0xb991('0x26')](handleError(_0x5b12e1,null));};exports[_0xb991('0x48')]=function(_0xeb271e,_0x2799ef){return db[_0xb991('0x1d')][_0xb991('0x31')]({'where':{'id':_0xeb271e[_0xb991('0x28')]['id']}})['then'](handleEntityNotFound(_0x2799ef,null))[_0xb991('0x25')](function(_0x203eea){if(_0x203eea){return _0x203eea[_0xb991('0x49')](_0xeb271e['body'][_0xb991('0x37')],_['omit'](_0xeb271e[_0xb991('0x33')],[_0xb991('0x37'),'id'])||{})[_0xb991('0x4a')](function(){return db[_0xb991('0x4b')][_0xb991('0x21')]({'attributes':['id',_0xb991('0x1b'),_0xb991('0x4c')],'where':{'id':_0xeb271e[_0xb991('0x33')]['ids']}});})[_0xb991('0x25')](function(_0x2e7ddf){socket[_0xb991('0x4d')]('mailInteractionTags:save',{'id':Number(_0xeb271e['params']['id']),'tags':_0x2e7ddf||[]});return{'id':Number(_0xeb271e[_0xb991('0x28')]['id']),'tags':_0x2e7ddf||[]};});}})[_0xb991('0x25')](respondWithResult(_0x2799ef,null))[_0xb991('0x26')](handleError(_0x2799ef,null));};exports[_0xb991('0x4e')]=function(_0x4c05a0,_0x316b67){return db[_0xb991('0x1d')][_0xb991('0x31')]({'where':{'id':_0x4c05a0[_0xb991('0x28')]['id']}})['then'](handleEntityNotFound(_0x316b67,null))[_0xb991('0x25')](function(_0x4421d2){if(_0x4421d2){return _0x4421d2[_0xb991('0x4e')](_0x4c05a0[_0xb991('0x23')]['ids']);}})[_0xb991('0x25')](respondWithStatusCode(_0x316b67,null))[_0xb991('0x26')](handleError(_0x316b67,null));};exports['download']=function(_0x536edf,_0x18542f){var _0x532ccf=moment()['unix']()['toString']();var _0x5710ec=path[_0xb991('0x4f')](config[_0xb991('0x50')],_0xb991('0x51'),_0xb991('0x52'),_0xb991('0x53'));var _0x38b483=path[_0xb991('0x4f')](config[_0xb991('0x50')],_0xb991('0x51'),'files',_0xb991('0x54'));var _0x57c23f=path[_0xb991('0x4f')](_0x5710ec,_0x532ccf);var _0x5447f6=util['format'](_0xb991('0x55'),_0x536edf[_0xb991('0x28')]['id'],_0x532ccf);var _0x1cbfa5=path[_0xb991('0x4f')](_0x5710ec,_0x5447f6);var _0x5b8dbf=[];if(_0x536edf[_0xb991('0x23')]['attachments']){_0x5b8dbf[_0xb991('0x56')]({'model':db['Attachment'],'as':_0xb991('0x57'),'raw':!![]});}var _0x18969b=[{'model':db['MailMessage'],'as':_0xb991('0x58'),'attributes':['id',_0xb991('0x33'),_0xb991('0x59'),'to','cc',_0xb991('0x5a'),_0xb991('0x5b'),_0xb991('0x5c')],'where':{'secret':![]},'order':qs[_0xb991('0x3d')]('id'),'include':_0x5b8dbf}];return db[_0xb991('0x1d')]['find']({'where':{'id':_0x536edf['params']['id']},'include':_0x18969b})[_0xb991('0x25')](handleEntityNotFound(_0x18542f,null))[_0xb991('0x25')](function(_0x24536b){if(_0x24536b&&_0x24536b[_0xb991('0x58')]){var _0x2ee40a=_0x24536b[_0xb991('0x5d')]({'plain':!![]});fs[_0xb991('0x5e')](_0x57c23f);return BPromise[_0xb991('0x5f')](_0x2ee40a[_0xb991('0x58')],function(_0x291bb8,_0xa1fa58){var _0x2d9bf0={'from':_0x291bb8[_0xb991('0x59')],'to':_0x291bb8['to']||_0xb991('0x60'),'subject':_0x291bb8[_0xb991('0x5b')],'html':htmlEntities[_0xb991('0x61')](_0x291bb8[_0xb991('0x33')]),'headers':{'Date':moment(_0x291bb8[_0xb991('0x5c')])[_0xb991('0x62')](_0xb991('0x63'))},'attachments':[]};if(_0x291bb8['cc']){_0x2d9bf0[_0xb991('0x64')]['Cc']=_0x291bb8['cc'];}if(_0x291bb8[_0xb991('0x5a')]){_0x2d9bf0[_0xb991('0x64')][_0xb991('0x65')]=_0x291bb8[_0xb991('0x5a')];}return new BPromise(function(_0x255f97,_0x547d6c){if(_0x291bb8[_0xb991('0x57')]){for(var _0x29ab07=0x0;_0x29ab07<_0x291bb8[_0xb991('0x57')][_0xb991('0x46')];_0x29ab07++){var _0x9fff2b=_0x291bb8[_0xb991('0x57')][_0x29ab07];var _0x485c7f=path['join'](_0x38b483,_0x9fff2b['basename']);if(fs[_0xb991('0x66')](_0x485c7f)){_0x2d9bf0['attachments'][_0xb991('0x56')]({'name':_0x9fff2b['name'],'contentType':_0x9fff2b['type'],'data':fs[_0xb991('0x67')](_0x485c7f)});}}}emlformat[_0xb991('0x68')](_0x2d9bf0,function(_0x4ecf89,_0x4558d0){if(_0x4ecf89)return _0x547d6c(_0x4ecf89);fs['writeFileSync'](path['join'](_0x57c23f,util[_0xb991('0x62')]('message%d.eml',_0xa1fa58)),_0x4558d0);return _0x255f97(_0x4558d0);});});})['then'](function(){return new BPromise(function(_0x44f00c,_0x16718a){zipdir(_0x57c23f,{'saveTo':_0x1cbfa5},function(_0x23c54d,_0x886620){if(_0x23c54d)return _0x16718a(_0x23c54d);return _0x44f00c(_0x886620);});})[_0xb991('0x25')](function(){return new BPromise(function(_0x5ce4cf,_0x218b0a){rimraf(_0x57c23f,function(_0x15db8b){if(_0x15db8b)_0x218b0a(_0x15db8b);return _0x5ce4cf();});});})[_0xb991('0x25')](function(){return _0x18542f[_0xb991('0x69')](_0x1cbfa5,_0x5447f6,function(_0x4c7543){if(!_0x4c7543)fs[_0xb991('0x6a')](_0x1cbfa5);});});});}else{return _0x18542f[_0xb991('0xf')](0xc8);}})[_0xb991('0x26')](handleError(_0x18542f,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index d0140b2..92428af 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 _0xc955=['save','update','remove','setDataValue','Users','map','findAll','then','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners'];(function(_0x4a8712,_0x48a3d2){var _0x1a2945=function(_0x312e3a){while(--_0x312e3a){_0x4a8712['push'](_0x4a8712['shift']());}};_0x1a2945(++_0x48a3d2);}(_0xc955,0x80));var _0x5c95=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0xc955[_0xbc4560];return _0x298cfb;};'use strict';var EventEmitter=require(_0x5c95('0x0'));var MailInteraction=require(_0x5c95('0x1'))['db'][_0x5c95('0x2')];var MailMessage=require('../../mysqldb')['db'][_0x5c95('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x5c95('0x4')](0x0);var events={'afterCreate':_0x5c95('0x5'),'afterUpdate':_0x5c95('0x6'),'afterDestroy':_0x5c95('0x7')};function emitEvent(_0x2fcbfe){return function(_0x559879,_0x579ad0,_0x143c44){_0x559879['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x4bf2cc){_0x559879[_0x5c95('0x8')](_0x5c95('0x9'),_0x4bf2cc[_0x5c95('0xa')](function(_0x2779c5){return{'id':_0x2779c5['id']};}));return MailMessage[_0x5c95('0xb')]({'where':{'MailInteractionId':_0x559879['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5c95('0xc')](function(_0x3f71d9){_0x559879['setDataValue'](_0x5c95('0xd'),_0x3f71d9['length']);MailInteractionEvents[_0x5c95('0xe')](_0x2fcbfe+':'+_0x559879['id'],_0x559879);MailInteractionEvents[_0x5c95('0xe')](_0x2fcbfe,_0x559879);_0x143c44(null);})[_0x5c95('0xf')](_0x143c44(null));};}for(var e in events){if(events[_0x5c95('0x10')](e)){var event=events[e];MailInteraction[_0x5c95('0x11')](e,emitEvent(event));}}module[_0x5c95('0x12')]=MailInteractionEvents; \ No newline at end of file +var _0xd581=['update','remove','getUsers','then','setDataValue','findAll','length','emit','hasOwnProperty','exports','MailInteraction','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd581,0x99));var _0x1d58=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xd581[_0x45d55e];return _0x29812a;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0x1d58('0x0')];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x1d58('0x1')](0x0);var events={'afterCreate':_0x1d58('0x2'),'afterUpdate':_0x1d58('0x3'),'afterDestroy':_0x1d58('0x4')};function emitEvent(_0x409835){return function(_0x4759d3,_0x59d4b6,_0x5175d4){_0x4759d3[_0x1d58('0x5')]({'attributes':['id'],'raw':!![]})[_0x1d58('0x6')](function(_0x71d58d){_0x4759d3[_0x1d58('0x7')]('Users',_0x71d58d['map'](function(_0x2cfa66){return{'id':_0x2cfa66['id']};}));return MailMessage[_0x1d58('0x8')]({'where':{'MailInteractionId':_0x4759d3['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1d58('0x6')](function(_0x2d2668){_0x4759d3[_0x1d58('0x7')]('unreadMessages',_0x2d2668[_0x1d58('0x9')]);MailInteractionEvents['emit'](_0x409835+':'+_0x4759d3['id'],_0x4759d3);MailInteractionEvents[_0x1d58('0xa')](_0x409835,_0x4759d3);_0x5175d4(null);})['catch'](_0x5175d4(null));};}for(var e in events){if(events[_0x1d58('0xb')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x1d58('0xc')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index ecfaa77..9c76153 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 _0xc7bf=['request-promise','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','update','then','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x1e24f8,_0x52070f){var _0x5c4446=function(_0x40bf51){while(--_0x40bf51){_0x1e24f8['push'](_0x1e24f8['shift']());}};_0x5c4446(++_0x52070f);}(_0xc7bf,0x1a6));var _0xfc7b=function(_0x234481,_0x229474){_0x234481=_0x234481-0x0;var _0x36d16e=_0xc7bf[_0x234481];return _0x36d16e;};'use strict';var _=require('lodash');var util=require(_0xfc7b('0x0'));var logger=require(_0xfc7b('0x1'))(_0xfc7b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfc7b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfc7b('0x4'));var config=require('../../config/environment');var attributes=require(_0xfc7b('0x5'));module[_0xfc7b('0x6')]=function(_0x4f4479,_0x2beef5){return _0x4f4479[_0xfc7b('0x7')](_0xfc7b('0x8'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xfc7b('0x9'),'fields':[_0xfc7b('0xa'),'to'],'type':_0xfc7b('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xe44c71,_0x39b6fd,_0x3351be){if(_0xe44c71[_0xfc7b('0xc')]){_0xe44c71[_0xfc7b('0xd')]=moment()[_0xfc7b('0xe')](_0xfc7b('0xf'));}if(_0xe44c71[_0xfc7b('0x10')]){_0xe44c71[_0xfc7b('0x11')]=moment()[_0xfc7b('0xe')](_0xfc7b('0xf'));}_0x3351be(null,_0x39b6fd);},'beforeUpdate':function(_0x216492,_0x15d096,_0x35f012){if(_0x216492[_0xfc7b('0x12')](_0xfc7b('0xc'))){_0x216492['substatusAt']=_0x216492[_0xfc7b('0xc')]?moment()[_0xfc7b('0xe')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x216492['changed'](_0xfc7b('0x10'))){_0x216492[_0xfc7b('0x11')]=moment()[_0xfc7b('0xe')](_0xfc7b('0xf'));_0x216492[_0xfc7b('0xc')]=null;_0x216492[_0xfc7b('0xd')]=null;}_0x35f012(null,_0x216492);},'afterUpdate':function(_0x633415,_0xb08ebd,_0x3c4460){var _0x3c3616=_0x4f4479[_0xfc7b('0x13')];var _0x3ba290=_0x633415[_0xfc7b('0x14')]({'plain':!![]});if(_0x3ba290[_0xfc7b('0x10')]){return _0x3c3616['MailMessage'][_0xfc7b('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x3ba290['id']}})[_0xfc7b('0x16')](function(){_0x3c4460();})['catch'](function(_0x12eb92){_0x3c4460(_0x12eb92);});}else{_0x3c4460();}}},'charset':_0xfc7b('0x17'),'collate':_0xfc7b('0x18')});}; \ No newline at end of file +var _0x73e9=['exports','define','MailInteraction','mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','get','update','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0x73e9,0x1ae));var _0x973e=function(_0x423e15,_0x12b2b2){_0x423e15=_0x423e15-0x0;var _0x184279=_0x73e9[_0x423e15];return _0x184279;};'use strict';var _=require(_0x973e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x973e('0x1'));var moment=require(_0x973e('0x2'));var BPromise=require(_0x973e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x973e('0x4'));var rimraf=require(_0x973e('0x5'));var config=require(_0x973e('0x6'));var attributes=require('./mailInteraction.attributes');module[_0x973e('0x7')]=function(_0x5f78a,_0x59a193){return _0x5f78a[_0x973e('0x8')](_0x973e('0x9'),attributes,{'tableName':_0x973e('0xa'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0x973e('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1c9668,_0x2dfc5c,_0x64a12b){if(_0x1c9668[_0x973e('0xc')]){_0x1c9668[_0x973e('0xd')]=moment()[_0x973e('0xe')](_0x973e('0xf'));}if(_0x1c9668[_0x973e('0x10')]){_0x1c9668[_0x973e('0x11')]=moment()[_0x973e('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x64a12b(null,_0x2dfc5c);},'beforeUpdate':function(_0x4dd69a,_0x3a1e8a,_0x40acd7){if(_0x4dd69a['changed']('substatus')){_0x4dd69a[_0x973e('0xd')]=_0x4dd69a[_0x973e('0xc')]?moment()[_0x973e('0xe')](_0x973e('0xf')):null;}if(_0x4dd69a[_0x973e('0x12')]('closed')){_0x4dd69a[_0x973e('0x11')]=moment()[_0x973e('0xe')](_0x973e('0xf'));_0x4dd69a[_0x973e('0xc')]=null;_0x4dd69a['substatusAt']=null;}_0x40acd7(null,_0x4dd69a);},'afterUpdate':function(_0x1f48e6,_0x1df399,_0x2eb56d){var _0x599665=_0x5f78a['models'];var _0x5a10ba=_0x1f48e6[_0x973e('0x13')]({'plain':!![]});if(_0x5a10ba[_0x973e('0x10')]){return _0x599665['MailMessage'][_0x973e('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x5a10ba['id']}})['then'](function(){_0x2eb56d();})['catch'](function(_0x527415){_0x2eb56d(_0x527415);});}else{_0x2eb56d();}}},'charset':_0x973e('0x15'),'collate':_0x973e('0x16')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 0cb6057..4a2bf73 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 _0x4b9f=['rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','debug','request\x20sent','error','code','message','MailInteraction,\x20%s,\x20%s','result','catch','MailInteraction','update','body','options','raw','where','UpdateMailInteraction','stringify','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x3d070e,_0x4d70ff){var _0x349154=function(_0xa14f0){while(--_0xa14f0){_0x3d070e['push'](_0x3d070e['shift']());}};_0x349154(++_0x4d70ff);}(_0x4b9f,0x18d));var _0xf4b9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4b9f[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xf4b9('0x0'));var util=require(_0xf4b9('0x1'));var moment=require(_0xf4b9('0x2'));var BPromise=require(_0xf4b9('0x3'));var rs=require(_0xf4b9('0x4'));var fs=require('fs');var Redis=require(_0xf4b9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4b9('0x6'));var logger=require(_0xf4b9('0x7'))(_0xf4b9('0x8'));var config=require(_0xf4b9('0x9'));var jayson=require(_0xf4b9('0xa'));var client=jayson[_0xf4b9('0xb')][_0xf4b9('0xc')]({'port':0x232a});config['redis']=_[_0xf4b9('0xd')](config[_0xf4b9('0xe')],{'host':_0xf4b9('0xf'),'port':0x18eb});var socket=require(_0xf4b9('0x10'))(new Redis(config[_0xf4b9('0xe')]));require(_0xf4b9('0x11'))[_0xf4b9('0x12')](socket);function respondWithRpcPromise(_0x1b3c40,_0x5ae354,_0x21081c){return new BPromise(function(_0x1578c0,_0x3f9b9a){return client[_0xf4b9('0x13')](_0x1b3c40,_0x21081c)[_0xf4b9('0x14')](function(_0x89f3cc){logger[_0xf4b9('0x15')]('MailInteraction,\x20%s,\x20%s',_0x5ae354,'request\x20sent');logger[_0xf4b9('0x16')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x5ae354,_0xf4b9('0x17'),JSON['stringify'](_0x89f3cc));if(_0x89f3cc['error']){if(_0x89f3cc[_0xf4b9('0x18')][_0xf4b9('0x19')]===0x1f4){logger[_0xf4b9('0x18')]('MailInteraction,\x20%s,\x20%s',_0x5ae354,_0x89f3cc[_0xf4b9('0x18')][_0xf4b9('0x1a')]);return _0x3f9b9a(_0x89f3cc['error'][_0xf4b9('0x1a')]);}logger['error'](_0xf4b9('0x1b'),_0x5ae354,_0x89f3cc['error']['message']);return _0x1578c0(_0x89f3cc[_0xf4b9('0x18')]['message']);}else{logger[_0xf4b9('0x15')](_0xf4b9('0x1b'),_0x5ae354,_0xf4b9('0x17'));_0x1578c0(_0x89f3cc[_0xf4b9('0x1c')][_0xf4b9('0x1a')]);}})[_0xf4b9('0x1d')](function(_0x606813){logger['error']('MailInteraction,\x20%s,\x20%s',_0x5ae354,_0x606813);_0x3f9b9a(_0x606813);});});}exports['UpdateMailInteraction']=function(_0x535a79){var _0x4d6525=this;return new Promise(function(_0x2c5310,_0x116e7f){return db[_0xf4b9('0x1e')][_0xf4b9('0x1f')](_0x535a79[_0xf4b9('0x20')],{'raw':_0x535a79[_0xf4b9('0x21')]?_0x535a79[_0xf4b9('0x21')][_0xf4b9('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x535a79[_0xf4b9('0x21')]?_0x535a79['options'][_0xf4b9('0x23')]||null:null,'attributes':_0x535a79[_0xf4b9('0x21')]?_0x535a79['options']['attributes']||null:null,'limit':_0x535a79['options']?_0x535a79['options']['limit']||null:null})[_0xf4b9('0x14')](function(_0x49d439){logger['info']('UpdateMailInteraction',_0x535a79);logger[_0xf4b9('0x16')](_0xf4b9('0x24'),_0x535a79,JSON[_0xf4b9('0x25')](_0x49d439));_0x2c5310(_0x49d439);})[_0xf4b9('0x1d')](function(_0x33d40e){logger[_0xf4b9('0x18')](_0xf4b9('0x24'),_0x33d40e['message'],_0x535a79);_0x116e7f(_0x4d6525[_0xf4b9('0x18')](0x1f4,_0x33d40e[_0xf4b9('0x1a')]));});});};exports[_0xf4b9('0x26')]=function(_0x21277f){return new Promise(function(_0x1588f8,_0x337fc4){return db['MailInteraction'][_0xf4b9('0x27')]({'where':_0x21277f[_0xf4b9('0x21')]?_0x21277f['options'][_0xf4b9('0x23')]||null:null})['then'](function(_0x437b12){if(_0x437b12){return _0x437b12[_0xf4b9('0x28')](_0x21277f[_0xf4b9('0x20')][_0xf4b9('0x29')],_[_0xf4b9('0x2a')](_0x21277f[_0xf4b9('0x20')],['ids','id'])||{});}})[_0xf4b9('0x2b')](function(_0x500322){logger[_0xf4b9('0x15')](_0xf4b9('0x2c'),_0x21277f);logger[_0xf4b9('0x16')]('AddTags',_0x21277f,JSON[_0xf4b9('0x25')](_0x500322));_0x1588f8(_0x500322);})[_0xf4b9('0x1d')](function(_0x3c7112){logger['error']('AddTags',_0x3c7112[_0xf4b9('0x1a')],_0x21277f);_0x337fc4(_this[_0xf4b9('0x18')](0x1f4,_0x3c7112[_0xf4b9('0x1a')]));});});}; \ No newline at end of file +var _0xb657=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','then','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','update','body','options','raw','where','attributes','limit','UpdateMailInteraction','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags'];(function(_0x2e4eba,_0x455860){var _0x589cdf=function(_0x55865b){while(--_0x55865b){_0x2e4eba['push'](_0x2e4eba['shift']());}};_0x589cdf(++_0x455860);}(_0xb657,0x150));var _0x7b65=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xb657[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x7b65('0x0'));var util=require(_0x7b65('0x1'));var moment=require(_0x7b65('0x2'));var BPromise=require(_0x7b65('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b65('0x4'));var db=require(_0x7b65('0x5'))['db'];var utils=require(_0x7b65('0x6'));var logger=require(_0x7b65('0x7'))(_0x7b65('0x8'));var config=require(_0x7b65('0x9'));var jayson=require(_0x7b65('0xa'));var client=jayson['client'][_0x7b65('0xb')]({'port':0x232a});config[_0x7b65('0xc')]=_[_0x7b65('0xd')](config[_0x7b65('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7b65('0xe'))(new Redis(config[_0x7b65('0xc')]));require(_0x7b65('0xf'))['register'](socket);function respondWithRpcPromise(_0xf86fd7,_0x414202,_0x3f11b5){return new BPromise(function(_0x6dd6cf,_0x3c0f61){return client['request'](_0xf86fd7,_0x3f11b5)[_0x7b65('0x10')](function(_0x4d4ac2){logger['info'](_0x7b65('0x11'),_0x414202,'request\x20sent');logger[_0x7b65('0x12')](_0x7b65('0x13'),_0x414202,_0x7b65('0x14'),JSON[_0x7b65('0x15')](_0x4d4ac2));if(_0x4d4ac2[_0x7b65('0x16')]){if(_0x4d4ac2['error']['code']===0x1f4){logger['error'](_0x7b65('0x11'),_0x414202,_0x4d4ac2['error']['message']);return _0x3c0f61(_0x4d4ac2[_0x7b65('0x16')][_0x7b65('0x17')]);}logger[_0x7b65('0x16')](_0x7b65('0x11'),_0x414202,_0x4d4ac2[_0x7b65('0x16')][_0x7b65('0x17')]);return _0x6dd6cf(_0x4d4ac2[_0x7b65('0x16')][_0x7b65('0x17')]);}else{logger[_0x7b65('0x18')](_0x7b65('0x11'),_0x414202,_0x7b65('0x14'));_0x6dd6cf(_0x4d4ac2[_0x7b65('0x19')]['message']);}})[_0x7b65('0x1a')](function(_0x398fcb){logger[_0x7b65('0x16')](_0x7b65('0x11'),_0x414202,_0x398fcb);_0x3c0f61(_0x398fcb);});});}exports['UpdateMailInteraction']=function(_0x3ed7de){var _0x455284=this;return new Promise(function(_0xa7a6b,_0x5a4d23){return db['MailInteraction'][_0x7b65('0x1b')](_0x3ed7de[_0x7b65('0x1c')],{'raw':_0x3ed7de[_0x7b65('0x1d')]?_0x3ed7de[_0x7b65('0x1d')][_0x7b65('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ed7de[_0x7b65('0x1d')]?_0x3ed7de['options'][_0x7b65('0x1f')]||null:null,'attributes':_0x3ed7de[_0x7b65('0x1d')]?_0x3ed7de[_0x7b65('0x1d')][_0x7b65('0x20')]||null:null,'limit':_0x3ed7de[_0x7b65('0x1d')]?_0x3ed7de[_0x7b65('0x1d')][_0x7b65('0x21')]||null:null})[_0x7b65('0x10')](function(_0x3c4262){logger[_0x7b65('0x18')](_0x7b65('0x22'),_0x3ed7de);logger['debug'](_0x7b65('0x22'),_0x3ed7de,JSON[_0x7b65('0x15')](_0x3c4262));_0xa7a6b(_0x3c4262);})[_0x7b65('0x1a')](function(_0x165924){logger['error']('UpdateMailInteraction',_0x165924[_0x7b65('0x17')],_0x3ed7de);_0x5a4d23(_0x455284[_0x7b65('0x16')](0x1f4,_0x165924[_0x7b65('0x17')]));});});};exports[_0x7b65('0x23')]=function(_0x5975ae){return new Promise(function(_0x54c0cf,_0x1b714c){return db['MailInteraction'][_0x7b65('0x24')]({'where':_0x5975ae['options']?_0x5975ae[_0x7b65('0x1d')][_0x7b65('0x1f')]||null:null})[_0x7b65('0x10')](function(_0x239dec){if(_0x239dec){return _0x239dec[_0x7b65('0x25')](_0x5975ae[_0x7b65('0x1c')][_0x7b65('0x26')],_[_0x7b65('0x27')](_0x5975ae[_0x7b65('0x1c')],[_0x7b65('0x26'),'id'])||{});}})[_0x7b65('0x28')](function(_0x19a67e){logger[_0x7b65('0x18')](_0x7b65('0x29'),_0x5975ae);logger[_0x7b65('0x12')]('AddTags',_0x5975ae,JSON['stringify'](_0x19a67e));_0x54c0cf(_0x19a67e);})[_0x7b65('0x1a')](function(_0x521215){logger['error'](_0x7b65('0x29'),_0x521215[_0x7b65('0x17')],_0x5975ae);_0x1b714c(_this[_0x7b65('0x16')](0x1f4,_0x521215['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 01cf752..1c5fe49 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 _0x82f0=['register','length','mailInteraction:','./mailInteraction.events','save','remove','emit','removeListener'];(function(_0x4b0a13,_0x9f30e0){var _0x4d11bf=function(_0x1cc6cc){while(--_0x1cc6cc){_0x4b0a13['push'](_0x4b0a13['shift']());}};_0x4d11bf(++_0x9f30e0);}(_0x82f0,0x133));var _0x082f=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x82f0[_0x110c3d];return _0x226d67;};'use strict';var MailInteractionEvents=require(_0x082f('0x0'));var events=[_0x082f('0x1'),_0x082f('0x2'),'update'];function createListener(_0x3a254e,_0x597a5c){return function(_0x660d05){_0x597a5c[_0x082f('0x3')](_0x3a254e,_0x660d05);};}function removeListener(_0x345ead,_0x129d3d){return function(){MailInteractionEvents[_0x082f('0x4')](_0x345ead,_0x129d3d);};}exports[_0x082f('0x5')]=function(_0x59f2b6){for(var _0x459318=0x0,_0x226d96=events[_0x082f('0x6')];_0x459318<_0x226d96;_0x459318++){var _0x35b1fd=events[_0x459318];var _0x1504b1=createListener(_0x082f('0x7')+_0x35b1fd,_0x59f2b6);MailInteractionEvents['on'](_0x35b1fd,_0x1504b1);}}; \ No newline at end of file +var _0x035a=['save','emit','mailInteraction:','./mailInteraction.events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x035a,0x1bb));var _0xa035=function(_0x4e9a35,_0x4aefb7){_0x4e9a35=_0x4e9a35-0x0;var _0x88996d=_0x035a[_0x4e9a35];return _0x88996d;};'use strict';var MailInteractionEvents=require(_0xa035('0x0'));var events=[_0xa035('0x1'),'remove','update'];function createListener(_0x10a1d3,_0x5d4d73){return function(_0x2f2902){_0x5d4d73[_0xa035('0x2')](_0x10a1d3,_0x2f2902);};}function removeListener(_0x5797f3,_0x128f46){return function(){MailInteractionEvents['removeListener'](_0x5797f3,_0x128f46);};}exports['register']=function(_0x135833){for(var _0x4ac5e9=0x0,_0x1313a1=events['length'];_0x4ac5e9<_0x1313a1;_0x4ac5e9++){var _0x2e121f=events[_0x4ac5e9];var _0x40a774=createListener(_0xa035('0x3')+_0x2e121f,_0x135833);MailInteractionEvents['on'](_0x2e121f,_0x40a774);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 80985f7..bca7fac 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 _0x5694=['index','/describe','describe','/:id','/:id/download','download','tracked','mail','mailmessage:create','put','update','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x512654,_0x18b898){var _0x24d4ab=function(_0x48b4f7){while(--_0x48b4f7){_0x512654['push'](_0x512654['shift']());}};_0x24d4ab(++_0x18b898);}(_0x5694,0x1ca));var _0x4569=function(_0x148791,_0x102916){_0x148791=_0x148791-0x0;var _0x10e1e5=_0x5694[_0x148791];return _0x10e1e5;};'use strict';var multer=require(_0x4569('0x0'));var util=require(_0x4569('0x1'));var path=require(_0x4569('0x2'));var timeout=require(_0x4569('0x3'));var express=require('express');var router=express[_0x4569('0x4')]();var fs_extra=require(_0x4569('0x5'));var auth=require(_0x4569('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4569('0x7'));var controller=require('./mailMessage.controller');router[_0x4569('0x8')]('/',auth[_0x4569('0x9')](),controller[_0x4569('0xa')]);router[_0x4569('0x8')](_0x4569('0xb'),auth[_0x4569('0x9')](),controller[_0x4569('0xc')]);router[_0x4569('0x8')](_0x4569('0xd'),auth[_0x4569('0x9')](),controller['show']);router[_0x4569('0x8')](_0x4569('0xe'),auth[_0x4569('0x9')](),controller[_0x4569('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x4569('0x10')](_0x4569('0x11'),_0x4569('0x12')),controller['create']);router[_0x4569('0x13')](_0x4569('0xd'),auth['isAuthenticated'](),controller[_0x4569('0x14')]);router[_0x4569('0x13')](_0x4569('0x15'),auth[_0x4569('0x9')](),controller['accept']);router[_0x4569('0x13')](_0x4569('0x16'),auth[_0x4569('0x9')](),controller[_0x4569('0x17')]);router['delete'](_0x4569('0xd'),auth['isAuthenticated'](),controller[_0x4569('0x18')]);module[_0x4569('0x19')]=router; \ No newline at end of file +var _0xa75b=['get','isAuthenticated','index','/describe','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','/:id','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller'];(function(_0x16d9af,_0x165741){var _0x1ff0a6=function(_0x1414d3){while(--_0x1414d3){_0x16d9af['push'](_0x16d9af['shift']());}};_0x1ff0a6(++_0x165741);}(_0xa75b,0x170));var _0xba75=function(_0x2a3072,_0x36dd48){_0x2a3072=_0x2a3072-0x0;var _0x5e4573=_0xa75b[_0x2a3072];return _0x5e4573;};'use strict';var multer=require(_0xba75('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba75('0x1'));var express=require(_0xba75('0x2'));var router=express[_0xba75('0x3')]();var fs_extra=require(_0xba75('0x4'));var auth=require(_0xba75('0x5'));var interaction=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var controller=require(_0xba75('0x8'));router[_0xba75('0x9')]('/',auth[_0xba75('0xa')](),controller[_0xba75('0xb')]);router[_0xba75('0x9')](_0xba75('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xba75('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xba75('0xd')]);router['get'](_0xba75('0xe'),auth[_0xba75('0xa')](),controller[_0xba75('0xf')]);router[_0xba75('0x10')]('/',auth[_0xba75('0xa')](),interaction[_0xba75('0x11')](_0xba75('0x12'),_0xba75('0x13')),controller[_0xba75('0x14')]);router[_0xba75('0x15')](_0xba75('0x16'),auth[_0xba75('0xa')](),controller['update']);router['put'](_0xba75('0x17'),auth['isAuthenticated'](),controller[_0xba75('0x18')]);router[_0xba75('0x15')](_0xba75('0x19'),auth[_0xba75('0xa')](),controller['reject']);router[_0xba75('0x1a')](_0xba75('0x16'),auth[_0xba75('0xa')](),controller[_0xba75('0x1b')]);module[_0xba75('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 8b58c34..f8bea7f 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 _0x5f4d=['sequelize','lodash','long','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','Chat'];(function(_0x403115,_0x2d6d03){var _0x596ef3=function(_0x145d97){while(--_0x145d97){_0x403115['push'](_0x403115['shift']());}};_0x596ef3(++_0x2d6d03);}(_0x5f4d,0x1e1));var _0xd5f4=function(_0x329a4c,_0x4a124f){_0x329a4c=_0x329a4c-0x0;var _0x4b4197=_0x5f4d[_0x329a4c];return _0x4b4197;};'use strict';var Sequelize=require(_0xd5f4('0x0'));var _=require(_0xd5f4('0x1'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xd5f4('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xd5f4('0x3')](_0xd5f4('0x4'))},'read':{'type':Sequelize[_0xd5f4('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd5f4('0x6')]('in','out'),'defaultValue':_0xd5f4('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xd5f4('0x8')](0x1fe)},'from':{'type':Sequelize[_0xd5f4('0x8')]},'to':{'type':Sequelize[_0xd5f4('0x3')](_0xd5f4('0x2'))},'cc':{'type':Sequelize['TEXT'](_0xd5f4('0x2'))},'bcc':{'type':Sequelize['TEXT'](_0xd5f4('0x2'))},'subject':{'type':Sequelize[_0xd5f4('0x3')]},'sentAt':{'type':Sequelize[_0xd5f4('0x9')]},'attach':{'type':Sequelize[_0xd5f4('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xd5f4('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xd5f4('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0xd5f4('0x2'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize['ENUM'](_0xd5f4('0xb'),_0xd5f4('0xc')),'defaultValue':_0xd5f4('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x08a7=['STRING','long','DATE','Email','Chat','sequelize','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x08a7,0x123));var _0x708a=function(_0x3290fa,_0x402648){_0x3290fa=_0x3290fa-0x0;var _0x18e2e5=_0x08a7[_0x3290fa];return _0x18e2e5;};'use strict';var Sequelize=require(_0x708a('0x0'));var _=require('lodash');module[_0x708a('0x1')]={'body':{'type':Sequelize[_0x708a('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x708a('0x2')]('medium')},'read':{'type':Sequelize[_0x708a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x708a('0x4')]('in',_0x708a('0x5')),'defaultValue':_0x708a('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x708a('0x6')](0x1fe)},'from':{'type':Sequelize[_0x708a('0x6')]},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize[_0x708a('0x2')](_0x708a('0x7'))},'bcc':{'type':Sequelize[_0x708a('0x2')](_0x708a('0x7'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x708a('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x708a('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x708a('0x8')]},'originTo':{'type':Sequelize[_0x708a('0x2')](_0x708a('0x7'))},'originCc':{'type':Sequelize[_0x708a('0x2')](_0x708a('0x7'))},'originChannel':{'type':Sequelize['ENUM'](_0x708a('0x9'),_0x708a('0xa')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 111678b..fe692f9 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 _0x37d9=['MailInteractionId','isNil','read1stAt','format','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','fromString','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','Sequelize','QueryTypes','contact','event','reject','rejectmessage','download','unix','toString','server','files','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','existsSync','build','writeFileSync','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','end','name','index','map','MailMessage','rawAttributes','fieldName','type','key','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','model','keys','find','body','describe','create','split','findOne','MailAccountId','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','defaults','ListId','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','user','agent','get','MailInteraction'];(function(_0xe542d5,_0xe3acd7){var _0x461ed1=function(_0x32c4b3){while(--_0x32c4b3){_0xe542d5['push'](_0xe542d5['shift']());}};_0x461ed1(++_0xe3acd7);}(_0x37d9,0x168));var _0x937d=function(_0x409eb7,_0x3b69f0){_0x409eb7=_0x409eb7-0x0;var _0x5e9078=_0x37d9[_0x409eb7];return _0x5e9078;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require(_0x937d('0x0'));var util=require('util');var path=require(_0x937d('0x1'));var fs=require('fs');var _=require(_0x937d('0x2'));var Redis=require(_0x937d('0x3'));var htmlToText=require(_0x937d('0x4'));var qs=require(_0x937d('0x5'));var logger=require(_0x937d('0x6'))('api');var interaction_log=require('../../config/logger')(_0x937d('0x7'));var config=require(_0x937d('0x8'));var db=require(_0x937d('0x9'))['db'];config['redis']=_['defaults'](config[_0x937d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x937d('0xb'))(new Redis(config[_0x937d('0xa')]));var htmlEntities=require(_0x937d('0xc'));require(_0x937d('0xd'))[_0x937d('0xe')](socket);var jayson=require('jayson/promise');var client=jayson[_0x937d('0xf')]['http']({'port':0x232c});var client9003=jayson[_0x937d('0xf')][_0x937d('0x10')]({'port':0x232b});var client9002=jayson[_0x937d('0xf')][_0x937d('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x2d563d,_0x11ad02,_0x20f5b1,_0x40fdb0){return new BPromise(function(_0x51b039,_0x65c43d){var _0x41ef44=_0x40fdb0||client;return _0x41ef44[_0x937d('0x11')](_0x2d563d,_0x20f5b1)[_0x937d('0x12')](function(_0x24fc42){logger[_0x937d('0x13')](_0x937d('0x14'),_0x11ad02,_0x937d('0x15'));logger[_0x937d('0x16')](_0x937d('0x17'),_0x11ad02,'request\x20sent',JSON[_0x937d('0x18')](_0x24fc42));if(_0x24fc42['error']){if(_0x24fc42[_0x937d('0x19')][_0x937d('0x1a')]===0x1f4){logger[_0x937d('0x19')](_0x937d('0x14'),_0x11ad02,_0x24fc42['error']['message']);return _0x65c43d(_0x24fc42[_0x937d('0x19')][_0x937d('0x1b')]);}logger[_0x937d('0x19')]('MailMessage,\x20%s,\x20%s',_0x11ad02,_0x24fc42[_0x937d('0x19')]['message']);return _0x51b039(_0x24fc42[_0x937d('0x19')][_0x937d('0x1b')]);}else{logger[_0x937d('0x13')](_0x937d('0x14'),_0x11ad02,_0x937d('0x15'));_0x51b039(_0x24fc42[_0x937d('0x1c')][_0x937d('0x1b')]);}})[_0x937d('0x1d')](function(_0x1e7a0e){logger['error'](_0x937d('0x14'),_0x11ad02,_0x1e7a0e);_0x65c43d(_0x1e7a0e);});});}function respondWithResult(_0x270791,_0x1858e2){_0x1858e2=_0x1858e2||0xc8;return function(_0x1efd0a){if(_0x1efd0a){return _0x270791[_0x937d('0x1e')](_0x1858e2)[_0x937d('0x1f')](_0x1efd0a);}};}function respondWithFilteredResult(_0x4c6a2a,_0x41eaa5){return function(_0x10ca6e){if(_0x10ca6e){var _0x10095e=typeof _0x41eaa5[_0x937d('0x20')]===_0x937d('0x21')&&typeof _0x41eaa5[_0x937d('0x22')]===_0x937d('0x21');var _0xc61b53=_0x10ca6e[_0x937d('0x23')];var _0x1b46f5=_0x10095e?0x0:_0x41eaa5[_0x937d('0x20')];var _0x12401c=_0x10095e?_0x10ca6e[_0x937d('0x23')]:_0x41eaa5[_0x937d('0x20')]+_0x41eaa5[_0x937d('0x22')];var _0x387ce6;if(_0x12401c>=_0xc61b53){_0x12401c=_0xc61b53;_0x387ce6=0xc8;}else{_0x387ce6=0xce;}_0x4c6a2a[_0x937d('0x1e')](_0x387ce6);return _0x4c6a2a[_0x937d('0x24')](_0x937d('0x25'),_0x1b46f5+'-'+_0x12401c+'/'+_0xc61b53)['json'](_0x10ca6e);}return null;};}function saveUpdates(_0x9253a0){return function(_0x21fd0e){if(_0x21fd0e){return _0x21fd0e[_0x937d('0x26')](_0x9253a0)[_0x937d('0x12')](function(_0xd1df73){return _0xd1df73;});}return null;};}function removeEntity(_0x259707){return function(_0x602698){if(_0x602698){return _0x602698['destroy']()[_0x937d('0x12')](function(){_0x259707['status'](0xcc)[_0x937d('0x27')]();});}};}function handleEntityNotFound(_0xbf90f6){return function(_0x8983ac){if(!_0x8983ac){_0xbf90f6['sendStatus'](0x194);}return _0x8983ac;};}function handleError(_0x4baad5,_0xe9b787){_0xe9b787=_0xe9b787||0x1f4;return function(_0x3f51e3){logger[_0x937d('0x19')](_0x3f51e3['stack']);if(_0x3f51e3[_0x937d('0x28')]){delete _0x3f51e3[_0x937d('0x28')];}_0x4baad5[_0x937d('0x1e')](_0xe9b787)['send'](_0x3f51e3);};}exports[_0x937d('0x29')]=function(_0x14f588,_0x4e8a05){var _0x3188db={},_0x1cf030={},_0x4c63eb={'count':0x0,'rows':[]};var _0x5204e3=_[_0x937d('0x2a')](db[_0x937d('0x2b')][_0x937d('0x2c')],function(_0x3ca661){return{'name':_0x3ca661[_0x937d('0x2d')],'type':_0x3ca661[_0x937d('0x2e')][_0x937d('0x2f')]};});_0x1cf030['model']=_['map'](_0x5204e3,_0x937d('0x28'));_0x1cf030[_0x937d('0x30')]=_['keys'](_0x14f588[_0x937d('0x30')]);_0x1cf030['filters']=_[_0x937d('0x31')](_0x1cf030['model'],_0x1cf030['query']);_0x3188db[_0x937d('0x32')]=_[_0x937d('0x31')](_0x1cf030['model'],qs[_0x937d('0x33')](_0x14f588['query'][_0x937d('0x33')]));_0x3188db[_0x937d('0x32')]=_0x3188db[_0x937d('0x32')][_0x937d('0x34')]?_0x3188db[_0x937d('0x32')]:_0x1cf030['model'];if(!_0x14f588['query'][_0x937d('0x35')](_0x937d('0x36'))){_0x3188db[_0x937d('0x22')]=qs[_0x937d('0x22')](_0x14f588['query']['limit']);_0x3188db[_0x937d('0x20')]=qs[_0x937d('0x20')](_0x14f588[_0x937d('0x30')][_0x937d('0x20')]);}_0x3188db[_0x937d('0x37')]=qs[_0x937d('0x38')](_0x14f588[_0x937d('0x30')][_0x937d('0x38')]);_0x3188db[_0x937d('0x39')]=qs['filters'](_[_0x937d('0x3a')](_0x14f588[_0x937d('0x30')],_0x1cf030[_0x937d('0x3b')]),_0x5204e3);if(_0x14f588[_0x937d('0x30')][_0x937d('0x3c')]){_0x3188db[_0x937d('0x39')]=_[_0x937d('0x3d')](_0x3188db[_0x937d('0x39')],{'$or':_[_0x937d('0x2a')](_0x5204e3,function(_0x2980f7){if(_0x2980f7['type']!==_0x937d('0x3e')){var _0x177e3a={};_0x177e3a[_0x2980f7[_0x937d('0x28')]]={'$like':'%'+_0x14f588[_0x937d('0x30')][_0x937d('0x3c')]+'%'};return _0x177e3a;}})});}_0x3188db=_['merge']({},_0x3188db,_0x14f588[_0x937d('0x3f')]);var _0x41c103={'where':_0x3188db[_0x937d('0x39')]};return db[_0x937d('0x2b')][_0x937d('0x23')](_0x41c103)['then'](function(_0x284b00){_0x4c63eb[_0x937d('0x23')]=_0x284b00;if(_0x14f588['query'][_0x937d('0x40')]){_0x3188db[_0x937d('0x41')]=[{'all':!![]}];}return db['MailMessage'][_0x937d('0x42')](_0x3188db);})[_0x937d('0x12')](function(_0x1fe47a){_0x4c63eb['rows']=_0x1fe47a;return _0x4c63eb;})['then'](respondWithFilteredResult(_0x4e8a05,_0x3188db))['catch'](handleError(_0x4e8a05,null));};exports[_0x937d('0x43')]=function(_0x17a2b4,_0xf59cf2){var _0x28770b={'raw':!![],'where':{'id':_0x17a2b4[_0x937d('0x44')]['id']}},_0x57d18c={};_0x57d18c[_0x937d('0x45')]=_[_0x937d('0x46')](db[_0x937d('0x2b')][_0x937d('0x2c')]);_0x57d18c['query']=_[_0x937d('0x46')](_0x17a2b4[_0x937d('0x30')]);_0x57d18c['filters']=_[_0x937d('0x31')](_0x57d18c[_0x937d('0x45')],_0x57d18c[_0x937d('0x30')]);_0x28770b[_0x937d('0x32')]=_['intersection'](_0x57d18c['model'],qs[_0x937d('0x33')](_0x17a2b4[_0x937d('0x30')][_0x937d('0x33')]));_0x28770b[_0x937d('0x32')]=_0x28770b[_0x937d('0x32')][_0x937d('0x34')]?_0x28770b[_0x937d('0x32')]:_0x57d18c[_0x937d('0x45')];if(_0x17a2b4[_0x937d('0x30')][_0x937d('0x40')]){_0x28770b['include']=[{'all':!![]}];}_0x28770b=_['merge']({},_0x28770b,_0x17a2b4[_0x937d('0x3f')]);return db[_0x937d('0x2b')][_0x937d('0x47')](_0x28770b)[_0x937d('0x12')](handleEntityNotFound(_0xf59cf2,null))[_0x937d('0x12')](respondWithResult(_0xf59cf2,null))['catch'](handleError(_0xf59cf2,null));};exports[_0x937d('0x26')]=function(_0x16bbf5,_0x37b9b8){if(_0x16bbf5[_0x937d('0x48')]['id']){delete _0x16bbf5[_0x937d('0x48')]['id'];}return db[_0x937d('0x2b')][_0x937d('0x47')]({'where':{'id':_0x16bbf5[_0x937d('0x44')]['id']}})[_0x937d('0x12')](handleEntityNotFound(_0x37b9b8,null))['then'](saveUpdates(_0x16bbf5['body'],null))['then'](respondWithResult(_0x37b9b8,null))['catch'](handleError(_0x37b9b8,null));};exports['destroy']=function(_0x388bb5,_0x50bc37){return db[_0x937d('0x2b')][_0x937d('0x47')]({'where':{'id':_0x388bb5[_0x937d('0x44')]['id']}})[_0x937d('0x12')](handleEntityNotFound(_0x50bc37,null))[_0x937d('0x12')](removeEntity(_0x50bc37,null))[_0x937d('0x1d')](handleError(_0x50bc37,null));};exports[_0x937d('0x49')]=function(_0x459e2a,_0x392e55){return db['MailMessage']['describe']()['then'](respondWithResult(_0x392e55,null))[_0x937d('0x1d')](handleError(_0x392e55,null));};exports[_0x937d('0x4a')]=function(_0x1d5410,_0x15dd3d){return db['MailMessage'][_0x937d('0x4a')](_0x1d5410[_0x937d('0x48')])[_0x937d('0x12')](function(_0x1983fd){if(_0x1983fd){if(_0x1983fd['direction']==='out'&&!_0x1983fd['secret']){var _0xc0611c,_0x9325f5,_0x5257bd;if(_0x1d5410[_0x937d('0x48')]['to']){_0x9325f5=_0x1d5410[_0x937d('0x48')]['to'][_0x937d('0x4b')](',')[0x0];}return db['MailAccount'][_0x937d('0x4c')]({'where':{'id':_0x1983fd[_0x937d('0x4d')]},'include':[{'model':db['CmList'],'as':_0x937d('0x4e'),'include':[{'model':db[_0x937d('0x4f')],'as':_0x937d('0x50'),'where':{'email':_0x9325f5},'limit':0x1,'order':[[_0x937d('0x51'),_0x937d('0x52')]]}]},{'model':db[_0x937d('0x53')],'as':_0x937d('0x54'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x937d('0x55'),'raw':!![]}]}]})[_0x937d('0x12')](function(_0x489a5e){_0xc0611c=_0x489a5e;if(!_0xc0611c||!_0xc0611c['Smtp'])return;var _0x1e5abc=_0xc0611c[_0x937d('0x56')]();if(_0x1d5410[_0x937d('0x48')][_0x937d('0x57')]&&_0x1d5410[_0x937d('0x48')]['attachments'][_0x937d('0x34')]){for(var _0x1937c8=0x0;_0x1937c8<_0x1d5410['body'][_0x937d('0x57')][_0x937d('0x34')];_0x1937c8+=0x1){_0x1d5410[_0x937d('0x48')]['attachments'][_0x1937c8]={'filename':_0x1d5410['body'][_0x937d('0x57')][_0x1937c8][_0x937d('0x28')],'path':path[_0x937d('0x58')](config[_0x937d('0x59')],_0x937d('0x5a'),_0x1d5410[_0x937d('0x48')][_0x937d('0x57')][_0x1937c8][_0x937d('0x5b')])};}}_0x5257bd={'account':_0x1e5abc,'message':_0x1d5410[_0x937d('0x48')]};return;})[_0x937d('0x12')](function(){if(_0xc0611c[_0x937d('0x4e')]){if(_0xc0611c[_0x937d('0x4e')]['Contacts'][_0x937d('0x34')]){return _0xc0611c[_0x937d('0x4e')][_0x937d('0x50')][0x0];}else{return db['CmContact'][_0x937d('0x4a')](_[_0x937d('0x5c')](_0x1d5410[_0x937d('0x48')],{'firstName':_0x1d5410['body']['to'],'email':_0x1d5410[_0x937d('0x48')]['to'],'phone':_0x1d5410[_0x937d('0x48')]['to'],'ListId':_0xc0611c[_0x937d('0x5d')]}));}}else{throw new Error(_0x937d('0x5e'));}})['then'](function(){if(_0x5257bd){return respondWithRpcPromise(_0x937d('0x5f'),_0x937d('0x60'),_0x5257bd,client9003)[_0x937d('0x12')](function(_0x39ff5c){return _0x1983fd[_0x937d('0x26')]({'read':!![],'messageId':_0x39ff5c[_0x937d('0x61')],'sentAt':moment()['format'](_0x937d('0x62'))});})[_0x937d('0x1d')](function(_0x40dd4e){logger[_0x937d('0x19')]('%s',JSON[_0x937d('0x18')](_0x40dd4e));return _0x1983fd;});}return _0x1983fd;});}return _0x1983fd;}})[_0x937d('0x12')](respondWithResult(_0x15dd3d,0xc9))[_0x937d('0x1d')](handleError(_0x15dd3d,null));};exports[_0x937d('0x63')]=function(_0x255c44,_0x98d79b){var _0x23b0b2={'agent':{},'channel':_0x937d('0x64')};if(_0x255c44['body']['id']){delete _0x255c44[_0x937d('0x48')]['id'];}_0x255c44['body'][_0x937d('0x65')]=!![];_0x255c44[_0x937d('0x48')][_0x937d('0x66')]=moment()['format'](_0x937d('0x62'));_0x255c44[_0x937d('0x48')][_0x937d('0x67')]=_0x255c44['body'][_0x937d('0x67')]||_0x255c44[_0x937d('0x68')]['id'];_0x23b0b2[_0x937d('0x69')]['id']=_0x255c44['body']['UserId'];return db['MailMessage'][_0x937d('0x47')]({'where':{'id':_0x255c44['params']['id'],'UserId':null}})[_0x937d('0x12')](handleEntityNotFound(_0x98d79b,null))['then'](saveUpdates(_0x255c44[_0x937d('0x48')],null))[_0x937d('0x12')](function(_0x11bf6a){if(_0x11bf6a){_0x23b0b2[_0x937d('0x1b')]=_0x11bf6a[_0x937d('0x6a')]({'plain':!![]});return db[_0x937d('0x6b')][_0x937d('0x47')]({'where':{'id':_0x11bf6a[_0x937d('0x6c')]}});}return null;})[_0x937d('0x12')](handleEntityNotFound(_0x98d79b,null))['then'](function(_0x251cd2){if(_0x251cd2){return _0x251cd2[_0x937d('0x26')]({'UserId':_0x255c44[_0x937d('0x48')]['UserId'],'read1stAt':_[_0x937d('0x6d')](_0x251cd2[_0x937d('0x6e')])?moment()[_0x937d('0x6f')](_0x937d('0x62')):undefined});}return null;})[_0x937d('0x12')](function(_0x1e5bcf){if(_0x1e5bcf){_0x23b0b2[_0x937d('0x70')]=_0x1e5bcf[_0x937d('0x6a')]({'plain':!![]});interaction_log['info'](_0x937d('0x71'),_0x255c44[_0x937d('0x68')]['id'],_0x255c44['user'][_0x937d('0x28')],_0x255c44[_0x937d('0x68')][_0x937d('0x72')],_0x23b0b2[_0x937d('0x70')]['id'],_0x255c44[_0x937d('0x48')]?JSON['stringify'](_0x255c44['body']):_0x937d('0x73'));return respondWithRpcPromise(_0x937d('0x74'),'acceptMessage',_0x23b0b2);}return null;})[_0x937d('0x12')](function(_0x41dcee){var _0x2f53cd=_0x937d('0x75')+_0x41dcee[_0x937d('0x1b')][_0x937d('0x76')];return db['sequelize'][_0x937d('0x30')](_0x2f53cd,{'type':db['Sequelize']['QueryTypes'][_0x937d('0x77')],'raw':!![]})[_0x937d('0x12')](function(_0x5ac412){return _0x5ac412;});})[_0x937d('0x12')](function(_0x35d1e4){if(_0x35d1e4){_0x23b0b2[_0x937d('0x1b')]['contact']=_0x35d1e4[0x0];if(!_0x255c44['body'][_0x937d('0x67')])return;return db[_0x937d('0x78')][_0x937d('0x47')]({'where':{'id':_0x255c44[_0x937d('0x48')][_0x937d('0x67')],'role':'agent'},'attributes':['id',_0x937d('0x28'),_0x937d('0x79'),_0x937d('0x7a'),_0x937d('0x7b')],'raw':!![]});}return null;})['then'](function(_0xa4f38c){if(!_0xa4f38c)return null;_0x23b0b2[_0x937d('0x1b')][_0x937d('0x69')]=_0xa4f38c;return _0x23b0b2;})[_0x937d('0x12')](function(_0x4021bd){if(_0x4021bd){if(_0x255c44[_0x937d('0x48')][_0x937d('0x7c')]){_0x23b0b2[_0x937d('0x1b')][_0x937d('0x7d')]=util[_0x937d('0x6f')](_0x937d('0x7e'),_0x255c44[_0x937d('0x68')][_0x937d('0x28')]);_0x23b0b2['message'][_0x937d('0x7f')]=_0x23b0b2[_0x937d('0x7f')];_0x23b0b2[_0x937d('0x1b')][_0x937d('0x80')]=_0x23b0b2[_0x937d('0x7f')];_0x23b0b2['message']['event']='accept';_0x23b0b2[_0x937d('0x1b')][_0x937d('0x48')]=htmlToText[_0x937d('0x81')](_0x23b0b2[_0x937d('0x1b')][_0x937d('0x48')]);return respondWithRpcPromise(_0x937d('0x82'),'EventManager',{'event':_0x937d('0x83'),'message':_0x23b0b2[_0x937d('0x1b')]},client9002)[_0x937d('0x12')](function(){return _0x23b0b2;});}return _0x23b0b2;}return null;})['then'](respondWithResult(_0x98d79b,null))[_0x937d('0x1d')](handleError(_0x98d79b,null));};exports['reject']=function(_0x1e733b,_0x376015){var _0x2d48a6={'agent':{},'channel':_0x937d('0x64')};if(_0x1e733b[_0x937d('0x48')]['id']){delete _0x1e733b[_0x937d('0x48')]['id'];}_0x1e733b[_0x937d('0x48')][_0x937d('0x67')]=_0x1e733b[_0x937d('0x48')][_0x937d('0x67')]||_0x1e733b[_0x937d('0x68')]['id'];_0x2d48a6[_0x937d('0x69')]['id']=_0x1e733b[_0x937d('0x48')]['UserId'];return db[_0x937d('0x2b')][_0x937d('0x47')]({'where':{'id':_0x1e733b[_0x937d('0x44')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x376015,null))[_0x937d('0x12')](function(_0x16831b){if(_0x16831b){_0x2d48a6[_0x937d('0x1b')]=_0x16831b['get']({'plain':!![]});return db['MailInteraction'][_0x937d('0x47')]({'where':{'id':_0x16831b[_0x937d('0x6c')]}});}return null;})[_0x937d('0x12')](handleEntityNotFound(_0x376015,null))['then'](function(_0x1a4636){if(_0x1a4636){_0x2d48a6[_0x937d('0x70')]=_0x1a4636['get']({'plain':!![]});interaction_log[_0x937d('0x13')](_0x937d('0x84'),_0x1e733b[_0x937d('0x68')]['id'],_0x1e733b['user'][_0x937d('0x28')],_0x1e733b[_0x937d('0x68')]['role'],_0x2d48a6[_0x937d('0x70')]['id'],_0x1e733b['body']?JSON[_0x937d('0x18')](_0x1e733b[_0x937d('0x48')]):_0x937d('0x73'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x2d48a6);}return null;})['then'](function(_0xbf11a3){var _0x442c6e=_0x937d('0x75')+_0xbf11a3[_0x937d('0x1b')][_0x937d('0x76')];return db['sequelize'][_0x937d('0x30')](_0x442c6e,{'type':db[_0x937d('0x85')][_0x937d('0x86')][_0x937d('0x77')],'raw':!![]})[_0x937d('0x12')](function(_0x2a5795){return _0x2a5795;});})[_0x937d('0x12')](function(_0x1db5e7){if(_0x1db5e7){_0x2d48a6['message'][_0x937d('0x87')]=_0x1db5e7[0x0];if(!_0x1e733b[_0x937d('0x48')][_0x937d('0x67')])return;return db[_0x937d('0x78')][_0x937d('0x47')]({'where':{'id':_0x1e733b['body'][_0x937d('0x67')],'role':_0x937d('0x69')},'attributes':['id',_0x937d('0x28'),_0x937d('0x79'),_0x937d('0x7a'),_0x937d('0x7b')],'raw':!![]});}return null;})[_0x937d('0x12')](function(_0x3c285a){if(!_0x3c285a)return null;_0x2d48a6['message'][_0x937d('0x69')]=_0x3c285a;return _0x2d48a6;})[_0x937d('0x12')](function(_0x12948b){if(_0x12948b){_0x12948b[_0x937d('0x1b')][_0x937d('0x7d')]=util[_0x937d('0x6f')](_0x937d('0x7e'),_0x1e733b[_0x937d('0x68')][_0x937d('0x28')]);_0x12948b['message'][_0x937d('0x7f')]=_0x2d48a6['channel'];_0x12948b['message'][_0x937d('0x80')]=_0x2d48a6[_0x937d('0x7f')];_0x12948b['message'][_0x937d('0x88')]=_0x937d('0x89');_0x12948b[_0x937d('0x1b')][_0x937d('0x48')]=htmlToText[_0x937d('0x81')](_0x2d48a6[_0x937d('0x1b')][_0x937d('0x48')]);respondWithRpcPromise(_0x937d('0x82'),_0x937d('0x82'),{'event':_0x937d('0x8a'),'message':_0x12948b[_0x937d('0x1b')]},client9002);return _0x2d48a6;}return null;})[_0x937d('0x12')](respondWithResult(_0x376015,null))[_0x937d('0x1d')](handleError(_0x376015,null));};exports[_0x937d('0x8b')]=function(_0x3a2558,_0x4e49dc){var _0x385d68=moment()[_0x937d('0x8c')]()[_0x937d('0x8d')]();var _0x20c0cf=path[_0x937d('0x58')](config[_0x937d('0x59')],_0x937d('0x8e'),_0x937d('0x8f'),'tmp');var _0x57436a=path[_0x937d('0x58')](config[_0x937d('0x59')],_0x937d('0x8e'),_0x937d('0x8f'),_0x937d('0x57'));var _0x283f63=util[_0x937d('0x6f')](_0x937d('0x90'),_0x385d68);return db[_0x937d('0x2b')][_0x937d('0x47')]({'where':{'id':_0x3a2558[_0x937d('0x44')]['id']},'attributes':['id',_0x937d('0x48'),_0x937d('0x91'),'to','cc',_0x937d('0x92'),_0x937d('0x93'),_0x937d('0x94')],'include':_0x3a2558[_0x937d('0x30')][_0x937d('0x57')]?[{'model':db[_0x937d('0x95')],'as':_0x937d('0x96')}]:undefined})[_0x937d('0x12')](handleEntityNotFound(_0x4e49dc,null))[_0x937d('0x12')](function(_0x11fb30){if(_0x11fb30){var _0xcde317=_0x11fb30;var _0x3ceff0={'from':_0xcde317[_0x937d('0x91')],'to':_0xcde317['to'],'subject':_0xcde317[_0x937d('0x93')],'html':htmlEntities['decode'](_0xcde317[_0x937d('0x48')]),'headers':{'Date':moment(_0xcde317[_0x937d('0x94')])['format'](_0x937d('0x97'))},'attachments':[]};if(_0x11fb30['cc']){_0x3ceff0['headers']['Cc']=_0x11fb30['cc'];}if(_0x11fb30[_0x937d('0x92')]){_0x3ceff0['headers'][_0x937d('0x98')]=_0x11fb30['bcc'];}return new BPromise(function(_0x45496d,_0x1ff795){if(_0x11fb30[_0x937d('0x96')]){for(var _0x2457dc=0x0;_0x2457dc<_0x11fb30[_0x937d('0x96')][_0x937d('0x34')];_0x2457dc++){var _0x15d634=_0x11fb30[_0x937d('0x96')][_0x2457dc];var _0x114162=path[_0x937d('0x58')](_0x57436a,_0x15d634[_0x937d('0x5b')]);if(fs[_0x937d('0x99')](_0x114162)){_0x3ceff0['attachments']['push']({'name':_0x15d634[_0x937d('0x28')],'contentType':_0x15d634['type'],'data':fs['readFileSync'](_0x114162)});}}}emlformat[_0x937d('0x9a')](_0x3ceff0,function(_0x5b8a3d,_0x36579c){if(_0x5b8a3d)return _0x1ff795(_0x5b8a3d);fs[_0x937d('0x9b')](path[_0x937d('0x58')](_0x20c0cf,_0x283f63),_0x36579c);return _0x45496d(_0x36579c);});});}})[_0x937d('0x12')](function(_0x2879a7){if(_0x2879a7){return _0x4e49dc[_0x937d('0x8b')](path[_0x937d('0x58')](_0x20c0cf,_0x283f63),_0x283f63,function(_0x11188e){if(!_0x11188e)fs['unlinkSync'](path[_0x937d('0x58')](_0x20c0cf,_0x283f63));});}})[_0x937d('0x1d')](handleError(_0x4e49dc,null));}; \ No newline at end of file +var _0xb68d=['reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','User','email','event','download','server','files','tmp','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','readFileSync','unlinkSync','eml-format','moment','bluebird','util','lodash','ioredis','html-to-text','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','message','error','catch','status','offset','limit','undefined','count','update','destroy','end','sendStatus','stack','name','index','MailMessage','rawAttributes','key','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','body','describe','create','direction','out','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','updatedAt','DESC','Smtp','attachments','join','root','server/files/attachments','Contacts','ListId','List\x20not\x20found','sendMail','messageId','format','stringify','accept','read','readAt','UserId','user','MailInteractionId','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','fullname','internal','agent','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage'];(function(_0x599f82,_0x528685){var _0x3cd36b=function(_0x4301af){while(--_0x4301af){_0x599f82['push'](_0x599f82['shift']());}};_0x3cd36b(++_0x528685);}(_0xb68d,0x152));var _0xdb68=function(_0x453eed,_0x447daa){_0x453eed=_0x453eed-0x0;var _0x6db50=_0xb68d[_0x453eed];return _0x6db50;};'use strict';var emlformat=require(_0xdb68('0x0'));var moment=require(_0xdb68('0x1'));var BPromise=require(_0xdb68('0x2'));var util=require(_0xdb68('0x3'));var path=require('path');var fs=require('fs');var _=require(_0xdb68('0x4'));var Redis=require(_0xdb68('0x5'));var htmlToText=require(_0xdb68('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xdb68('0x7'))(_0xdb68('0x8'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require(_0xdb68('0x9'));var db=require(_0xdb68('0xa'))['db'];config[_0xdb68('0xb')]=_[_0xdb68('0xc')](config['redis'],{'host':_0xdb68('0xd'),'port':0x18eb});var socket=require(_0xdb68('0xe'))(new Redis(config['redis']));var htmlEntities=require('html-entities');require('./mailMessage.socket')[_0xdb68('0xf')](socket);var jayson=require(_0xdb68('0x10'));var client=jayson[_0xdb68('0x11')][_0xdb68('0x12')]({'port':0x232c});var client9003=jayson[_0xdb68('0x11')][_0xdb68('0x12')]({'port':0x232b});var client9002=jayson['client'][_0xdb68('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x40b723,_0x45b697,_0x5522e7,_0x5097c3){return new BPromise(function(_0x4ee17d,_0x3ac956){var _0x1787ba=_0x5097c3||client;return _0x1787ba['request'](_0x40b723,_0x5522e7)[_0xdb68('0x13')](function(_0x48685a){logger[_0xdb68('0x14')](_0xdb68('0x15'),_0x45b697,_0xdb68('0x16'));logger[_0xdb68('0x17')](_0xdb68('0x18'),_0x45b697,_0xdb68('0x16'),JSON['stringify'](_0x48685a));if(_0x48685a['error']){if(_0x48685a['error']['code']===0x1f4){logger['error'](_0xdb68('0x15'),_0x45b697,_0x48685a['error'][_0xdb68('0x19')]);return _0x3ac956(_0x48685a[_0xdb68('0x1a')][_0xdb68('0x19')]);}logger['error'](_0xdb68('0x15'),_0x45b697,_0x48685a['error'][_0xdb68('0x19')]);return _0x4ee17d(_0x48685a[_0xdb68('0x1a')]['message']);}else{logger[_0xdb68('0x14')]('MailMessage,\x20%s,\x20%s',_0x45b697,_0xdb68('0x16'));_0x4ee17d(_0x48685a['result'][_0xdb68('0x19')]);}})[_0xdb68('0x1b')](function(_0x3f63c5){logger[_0xdb68('0x1a')](_0xdb68('0x15'),_0x45b697,_0x3f63c5);_0x3ac956(_0x3f63c5);});});}function respondWithResult(_0x4de19e,_0x7c6cf){_0x7c6cf=_0x7c6cf||0xc8;return function(_0x521ae0){if(_0x521ae0){return _0x4de19e[_0xdb68('0x1c')](_0x7c6cf)['json'](_0x521ae0);}};}function respondWithFilteredResult(_0x42f2b4,_0xad5df7){return function(_0x1f9e67){if(_0x1f9e67){var _0x5a129d=typeof _0xad5df7[_0xdb68('0x1d')]==='undefined'&&typeof _0xad5df7[_0xdb68('0x1e')]===_0xdb68('0x1f');var _0x3ea068=_0x1f9e67[_0xdb68('0x20')];var _0x31fa9a=_0x5a129d?0x0:_0xad5df7['offset'];var _0x5d9bdc=_0x5a129d?_0x1f9e67['count']:_0xad5df7[_0xdb68('0x1d')]+_0xad5df7[_0xdb68('0x1e')];var _0x297341;if(_0x5d9bdc>=_0x3ea068){_0x5d9bdc=_0x3ea068;_0x297341=0xc8;}else{_0x297341=0xce;}_0x42f2b4['status'](_0x297341);return _0x42f2b4['set']('Content-Range',_0x31fa9a+'-'+_0x5d9bdc+'/'+_0x3ea068)['json'](_0x1f9e67);}return null;};}function saveUpdates(_0x332b79){return function(_0x36a289){if(_0x36a289){return _0x36a289[_0xdb68('0x21')](_0x332b79)[_0xdb68('0x13')](function(_0x193684){return _0x193684;});}return null;};}function removeEntity(_0x1c6c6e){return function(_0x5b280b){if(_0x5b280b){return _0x5b280b[_0xdb68('0x22')]()[_0xdb68('0x13')](function(){_0x1c6c6e[_0xdb68('0x1c')](0xcc)[_0xdb68('0x23')]();});}};}function handleEntityNotFound(_0x317de7){return function(_0x5f12f6){if(!_0x5f12f6){_0x317de7[_0xdb68('0x24')](0x194);}return _0x5f12f6;};}function handleError(_0x735e61,_0x5ba73e){_0x5ba73e=_0x5ba73e||0x1f4;return function(_0xba041d){logger[_0xdb68('0x1a')](_0xba041d[_0xdb68('0x25')]);if(_0xba041d[_0xdb68('0x26')]){delete _0xba041d[_0xdb68('0x26')];}_0x735e61[_0xdb68('0x1c')](_0x5ba73e)['send'](_0xba041d);};}exports[_0xdb68('0x27')]=function(_0x151438,_0x3f21b4){var _0x2db78a={},_0x207c01={},_0x28e3cf={'count':0x0,'rows':[]};var _0x652557=_['map'](db[_0xdb68('0x28')][_0xdb68('0x29')],function(_0x57cd49){return{'name':_0x57cd49['fieldName'],'type':_0x57cd49['type'][_0xdb68('0x2a')]};});_0x207c01['model']=_[_0xdb68('0x2b')](_0x652557,'name');_0x207c01[_0xdb68('0x2c')]=_['keys'](_0x151438['query']);_0x207c01[_0xdb68('0x2d')]=_[_0xdb68('0x2e')](_0x207c01['model'],_0x207c01['query']);_0x2db78a['attributes']=_[_0xdb68('0x2e')](_0x207c01[_0xdb68('0x2f')],qs[_0xdb68('0x30')](_0x151438[_0xdb68('0x2c')][_0xdb68('0x30')]));_0x2db78a['attributes']=_0x2db78a[_0xdb68('0x31')][_0xdb68('0x32')]?_0x2db78a['attributes']:_0x207c01[_0xdb68('0x2f')];if(!_0x151438[_0xdb68('0x2c')][_0xdb68('0x33')]('nolimit')){_0x2db78a[_0xdb68('0x1e')]=qs[_0xdb68('0x1e')](_0x151438[_0xdb68('0x2c')]['limit']);_0x2db78a[_0xdb68('0x1d')]=qs[_0xdb68('0x1d')](_0x151438[_0xdb68('0x2c')][_0xdb68('0x1d')]);}_0x2db78a[_0xdb68('0x34')]=qs[_0xdb68('0x35')](_0x151438[_0xdb68('0x2c')][_0xdb68('0x35')]);_0x2db78a['where']=qs[_0xdb68('0x2d')](_[_0xdb68('0x36')](_0x151438[_0xdb68('0x2c')],_0x207c01[_0xdb68('0x2d')]),_0x652557);if(_0x151438['query'][_0xdb68('0x37')]){_0x2db78a[_0xdb68('0x38')]=_[_0xdb68('0x39')](_0x2db78a[_0xdb68('0x38')],{'$or':_[_0xdb68('0x2b')](_0x652557,function(_0x1f38da){if(_0x1f38da[_0xdb68('0x3a')]!==_0xdb68('0x3b')){var _0x4c946d={};_0x4c946d[_0x1f38da[_0xdb68('0x26')]]={'$like':'%'+_0x151438[_0xdb68('0x2c')]['filter']+'%'};return _0x4c946d;}})});}_0x2db78a=_[_0xdb68('0x39')]({},_0x2db78a,_0x151438[_0xdb68('0x3c')]);var _0x1ea3ee={'where':_0x2db78a[_0xdb68('0x38')]};return db[_0xdb68('0x28')]['count'](_0x1ea3ee)[_0xdb68('0x13')](function(_0x3a3784){_0x28e3cf[_0xdb68('0x20')]=_0x3a3784;if(_0x151438[_0xdb68('0x2c')][_0xdb68('0x3d')]){_0x2db78a[_0xdb68('0x3e')]=[{'all':!![]}];}return db[_0xdb68('0x28')][_0xdb68('0x3f')](_0x2db78a);})[_0xdb68('0x13')](function(_0x2f79dd){_0x28e3cf[_0xdb68('0x40')]=_0x2f79dd;return _0x28e3cf;})[_0xdb68('0x13')](respondWithFilteredResult(_0x3f21b4,_0x2db78a))[_0xdb68('0x1b')](handleError(_0x3f21b4,null));};exports[_0xdb68('0x41')]=function(_0x151a07,_0x566661){var _0x2e8ffc={'raw':!![],'where':{'id':_0x151a07[_0xdb68('0x42')]['id']}},_0x2f4d7d={};_0x2f4d7d['model']=_[_0xdb68('0x43')](db[_0xdb68('0x28')]['rawAttributes']);_0x2f4d7d[_0xdb68('0x2c')]=_[_0xdb68('0x43')](_0x151a07['query']);_0x2f4d7d[_0xdb68('0x2d')]=_[_0xdb68('0x2e')](_0x2f4d7d[_0xdb68('0x2f')],_0x2f4d7d[_0xdb68('0x2c')]);_0x2e8ffc[_0xdb68('0x31')]=_[_0xdb68('0x2e')](_0x2f4d7d[_0xdb68('0x2f')],qs['fields'](_0x151a07['query'][_0xdb68('0x30')]));_0x2e8ffc[_0xdb68('0x31')]=_0x2e8ffc[_0xdb68('0x31')][_0xdb68('0x32')]?_0x2e8ffc[_0xdb68('0x31')]:_0x2f4d7d[_0xdb68('0x2f')];if(_0x151a07['query']['includeAll']){_0x2e8ffc[_0xdb68('0x3e')]=[{'all':!![]}];}_0x2e8ffc=_[_0xdb68('0x39')]({},_0x2e8ffc,_0x151a07[_0xdb68('0x3c')]);return db['MailMessage'][_0xdb68('0x44')](_0x2e8ffc)['then'](handleEntityNotFound(_0x566661,null))[_0xdb68('0x13')](respondWithResult(_0x566661,null))['catch'](handleError(_0x566661,null));};exports[_0xdb68('0x21')]=function(_0x2b5c18,_0x2cb7cb){if(_0x2b5c18[_0xdb68('0x45')]['id']){delete _0x2b5c18[_0xdb68('0x45')]['id'];}return db[_0xdb68('0x28')][_0xdb68('0x44')]({'where':{'id':_0x2b5c18['params']['id']}})[_0xdb68('0x13')](handleEntityNotFound(_0x2cb7cb,null))['then'](saveUpdates(_0x2b5c18[_0xdb68('0x45')],null))['then'](respondWithResult(_0x2cb7cb,null))[_0xdb68('0x1b')](handleError(_0x2cb7cb,null));};exports[_0xdb68('0x22')]=function(_0xaf4e33,_0x58b1a3){return db[_0xdb68('0x28')]['find']({'where':{'id':_0xaf4e33[_0xdb68('0x42')]['id']}})[_0xdb68('0x13')](handleEntityNotFound(_0x58b1a3,null))[_0xdb68('0x13')](removeEntity(_0x58b1a3,null))[_0xdb68('0x1b')](handleError(_0x58b1a3,null));};exports['describe']=function(_0x579ecb,_0x407bca){return db['MailMessage'][_0xdb68('0x46')]()[_0xdb68('0x13')](respondWithResult(_0x407bca,null))[_0xdb68('0x1b')](handleError(_0x407bca,null));};exports[_0xdb68('0x47')]=function(_0x2fd996,_0x5a5bc7){return db[_0xdb68('0x28')][_0xdb68('0x47')](_0x2fd996[_0xdb68('0x45')])[_0xdb68('0x13')](function(_0x4c9c9d){if(_0x4c9c9d){if(_0x4c9c9d[_0xdb68('0x48')]===_0xdb68('0x49')&&!_0x4c9c9d['secret']){var _0x3219a1,_0x30be3a,_0x49ca58;if(_0x2fd996[_0xdb68('0x45')]['to']){_0x30be3a=_0x2fd996[_0xdb68('0x45')]['to'][_0xdb68('0x4a')](',')[0x0];}return db[_0xdb68('0x4b')][_0xdb68('0x4c')]({'where':{'id':_0x4c9c9d[_0xdb68('0x4d')]},'include':[{'model':db[_0xdb68('0x4e')],'as':_0xdb68('0x4f'),'include':[{'model':db[_0xdb68('0x50')],'as':'Contacts','where':{'email':_0x30be3a},'limit':0x1,'order':[[_0xdb68('0x51'),_0xdb68('0x52')]]}]},{'model':db['MailServerOut'],'as':_0xdb68('0x53'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0xdb68('0x13')](function(_0x4e5448){_0x3219a1=_0x4e5448;if(!_0x3219a1||!_0x3219a1[_0xdb68('0x53')])return;var _0x5cd196=_0x3219a1['getSmtpOptions']();if(_0x2fd996[_0xdb68('0x45')]['attachments']&&_0x2fd996[_0xdb68('0x45')][_0xdb68('0x54')][_0xdb68('0x32')]){for(var _0xe9e391=0x0;_0xe9e391<_0x2fd996['body'][_0xdb68('0x54')][_0xdb68('0x32')];_0xe9e391+=0x1){_0x2fd996['body'][_0xdb68('0x54')][_0xe9e391]={'filename':_0x2fd996[_0xdb68('0x45')][_0xdb68('0x54')][_0xe9e391][_0xdb68('0x26')],'path':path[_0xdb68('0x55')](config[_0xdb68('0x56')],_0xdb68('0x57'),_0x2fd996[_0xdb68('0x45')][_0xdb68('0x54')][_0xe9e391]['basename'])};}}_0x49ca58={'account':_0x5cd196,'message':_0x2fd996[_0xdb68('0x45')]};return;})[_0xdb68('0x13')](function(){if(_0x3219a1[_0xdb68('0x4f')]){if(_0x3219a1['List'][_0xdb68('0x58')][_0xdb68('0x32')]){return _0x3219a1[_0xdb68('0x4f')][_0xdb68('0x58')][0x0];}else{return db[_0xdb68('0x50')]['create'](_[_0xdb68('0xc')](_0x2fd996['body'],{'firstName':_0x2fd996[_0xdb68('0x45')]['to'],'email':_0x2fd996[_0xdb68('0x45')]['to'],'phone':_0x2fd996[_0xdb68('0x45')]['to'],'ListId':_0x3219a1[_0xdb68('0x59')]}));}}else{throw new Error(_0xdb68('0x5a'));}})['then'](function(){if(_0x49ca58){return respondWithRpcPromise('SendMail',_0xdb68('0x5b'),_0x49ca58,client9003)[_0xdb68('0x13')](function(_0x201d7a){return _0x4c9c9d[_0xdb68('0x21')]({'read':!![],'messageId':_0x201d7a[_0xdb68('0x5c')],'sentAt':moment()[_0xdb68('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xdb68('0x1b')](function(_0x30d448){logger[_0xdb68('0x1a')]('%s',JSON[_0xdb68('0x5e')](_0x30d448));return _0x4c9c9d;});}return _0x4c9c9d;});}return _0x4c9c9d;}})[_0xdb68('0x13')](respondWithResult(_0x5a5bc7,0xc9))[_0xdb68('0x1b')](handleError(_0x5a5bc7,null));};exports[_0xdb68('0x5f')]=function(_0x5f4c0b,_0x10dd6e){var _0x398ed6={'agent':{},'channel':'mail'};if(_0x5f4c0b['body']['id']){delete _0x5f4c0b[_0xdb68('0x45')]['id'];}_0x5f4c0b[_0xdb68('0x45')][_0xdb68('0x60')]=!![];_0x5f4c0b[_0xdb68('0x45')][_0xdb68('0x61')]=moment()[_0xdb68('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x5f4c0b[_0xdb68('0x45')][_0xdb68('0x62')]=_0x5f4c0b[_0xdb68('0x45')][_0xdb68('0x62')]||_0x5f4c0b[_0xdb68('0x63')]['id'];_0x398ed6['agent']['id']=_0x5f4c0b[_0xdb68('0x45')]['UserId'];return db[_0xdb68('0x28')][_0xdb68('0x44')]({'where':{'id':_0x5f4c0b[_0xdb68('0x42')]['id'],'UserId':null}})[_0xdb68('0x13')](handleEntityNotFound(_0x10dd6e,null))[_0xdb68('0x13')](saveUpdates(_0x5f4c0b['body'],null))[_0xdb68('0x13')](function(_0x32354d){if(_0x32354d){_0x398ed6[_0xdb68('0x19')]=_0x32354d['get']({'plain':!![]});return db['MailInteraction'][_0xdb68('0x44')]({'where':{'id':_0x32354d[_0xdb68('0x64')]}});}return null;})[_0xdb68('0x13')](handleEntityNotFound(_0x10dd6e,null))[_0xdb68('0x13')](function(_0x1e4826){if(_0x1e4826){return _0x1e4826['update']({'UserId':_0x5f4c0b[_0xdb68('0x45')][_0xdb68('0x62')],'read1stAt':_['isNil'](_0x1e4826[_0xdb68('0x65')])?moment()[_0xdb68('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdb68('0x13')](function(_0x52660e){if(_0x52660e){_0x398ed6[_0xdb68('0x66')]=_0x52660e[_0xdb68('0x67')]({'plain':!![]});interaction_log[_0xdb68('0x14')](_0xdb68('0x68'),_0x5f4c0b[_0xdb68('0x63')]['id'],_0x5f4c0b['user'][_0xdb68('0x26')],_0x5f4c0b[_0xdb68('0x63')][_0xdb68('0x69')],_0x398ed6['interaction']['id'],_0x5f4c0b[_0xdb68('0x45')]?JSON['stringify'](_0x5f4c0b[_0xdb68('0x45')]):_0xdb68('0x6a'));return respondWithRpcPromise(_0xdb68('0x6b'),_0xdb68('0x6c'),_0x398ed6);}return null;})[_0xdb68('0x13')](function(_0x5dc6ba){var _0x59aab8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5dc6ba[_0xdb68('0x19')][_0xdb68('0x6d')];return db[_0xdb68('0x6e')][_0xdb68('0x2c')](_0x59aab8,{'type':db[_0xdb68('0x6f')]['QueryTypes'][_0xdb68('0x70')],'raw':!![]})[_0xdb68('0x13')](function(_0x436185){return _0x436185;});})[_0xdb68('0x13')](function(_0x5f1e63){if(_0x5f1e63){_0x398ed6[_0xdb68('0x19')][_0xdb68('0x71')]=_0x5f1e63[0x0];if(!_0x5f4c0b[_0xdb68('0x45')][_0xdb68('0x62')])return;return db['User'][_0xdb68('0x44')]({'where':{'id':_0x5f4c0b[_0xdb68('0x45')][_0xdb68('0x62')],'role':'agent'},'attributes':['id',_0xdb68('0x26'),_0xdb68('0x72'),'email',_0xdb68('0x73')],'raw':!![]});}return null;})[_0xdb68('0x13')](function(_0x289b57){if(!_0x289b57)return null;_0x398ed6[_0xdb68('0x19')][_0xdb68('0x74')]=_0x289b57;return _0x398ed6;})[_0xdb68('0x13')](function(_0x44eed0){if(_0x44eed0){if(_0x5f4c0b[_0xdb68('0x45')][_0xdb68('0x75')]){_0x398ed6[_0xdb68('0x19')][_0xdb68('0x76')]=util[_0xdb68('0x5d')](_0xdb68('0x77'),_0x5f4c0b[_0xdb68('0x63')]['name']);_0x398ed6[_0xdb68('0x19')][_0xdb68('0x78')]=_0x398ed6[_0xdb68('0x78')];_0x398ed6[_0xdb68('0x19')][_0xdb68('0x79')]=_0x398ed6['channel'];_0x398ed6['message']['event']=_0xdb68('0x5f');_0x398ed6[_0xdb68('0x19')]['body']=htmlToText['fromString'](_0x398ed6[_0xdb68('0x19')][_0xdb68('0x45')]);return respondWithRpcPromise(_0xdb68('0x7a'),_0xdb68('0x7a'),{'event':_0xdb68('0x7b'),'message':_0x398ed6[_0xdb68('0x19')]},client9002)[_0xdb68('0x13')](function(){return _0x398ed6;});}return _0x398ed6;}return null;})['then'](respondWithResult(_0x10dd6e,null))[_0xdb68('0x1b')](handleError(_0x10dd6e,null));};exports[_0xdb68('0x7c')]=function(_0x3edff1,_0x1c2246){var _0x2f8d6e={'agent':{},'channel':_0xdb68('0x7d')};if(_0x3edff1[_0xdb68('0x45')]['id']){delete _0x3edff1[_0xdb68('0x45')]['id'];}_0x3edff1['body']['UserId']=_0x3edff1['body'][_0xdb68('0x62')]||_0x3edff1['user']['id'];_0x2f8d6e[_0xdb68('0x74')]['id']=_0x3edff1['body'][_0xdb68('0x62')];return db['MailMessage']['find']({'where':{'id':_0x3edff1[_0xdb68('0x42')]['id'],'UserId':null}})[_0xdb68('0x13')](handleEntityNotFound(_0x1c2246,null))[_0xdb68('0x13')](function(_0x250623){if(_0x250623){_0x2f8d6e['message']=_0x250623[_0xdb68('0x67')]({'plain':!![]});return db['MailInteraction'][_0xdb68('0x44')]({'where':{'id':_0x250623[_0xdb68('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x1c2246,null))[_0xdb68('0x13')](function(_0x35dab3){if(_0x35dab3){_0x2f8d6e[_0xdb68('0x66')]=_0x35dab3['get']({'plain':!![]});interaction_log[_0xdb68('0x14')](_0xdb68('0x7e'),_0x3edff1[_0xdb68('0x63')]['id'],_0x3edff1[_0xdb68('0x63')]['name'],_0x3edff1['user'][_0xdb68('0x69')],_0x2f8d6e[_0xdb68('0x66')]['id'],_0x3edff1[_0xdb68('0x45')]?JSON[_0xdb68('0x5e')](_0x3edff1[_0xdb68('0x45')]):_0xdb68('0x6a'));return respondWithRpcPromise(_0xdb68('0x7f'),_0xdb68('0x80'),_0x2f8d6e);}return null;})['then'](function(_0x3d00ac){var _0x835455=_0xdb68('0x81')+_0x3d00ac['message'][_0xdb68('0x6d')];return db[_0xdb68('0x6e')][_0xdb68('0x2c')](_0x835455,{'type':db[_0xdb68('0x6f')][_0xdb68('0x82')][_0xdb68('0x70')],'raw':!![]})[_0xdb68('0x13')](function(_0x11e752){return _0x11e752;});})[_0xdb68('0x13')](function(_0x493d39){if(_0x493d39){_0x2f8d6e['message']['contact']=_0x493d39[0x0];if(!_0x3edff1[_0xdb68('0x45')][_0xdb68('0x62')])return;return db[_0xdb68('0x83')][_0xdb68('0x44')]({'where':{'id':_0x3edff1[_0xdb68('0x45')][_0xdb68('0x62')],'role':_0xdb68('0x74')},'attributes':['id',_0xdb68('0x26'),_0xdb68('0x72'),_0xdb68('0x84'),_0xdb68('0x73')],'raw':!![]});}return null;})[_0xdb68('0x13')](function(_0x35f8e5){if(!_0x35f8e5)return null;_0x2f8d6e[_0xdb68('0x19')][_0xdb68('0x74')]=_0x35f8e5;return _0x2f8d6e;})[_0xdb68('0x13')](function(_0x22089d){if(_0x22089d){_0x22089d[_0xdb68('0x19')]['interface']=util['format'](_0xdb68('0x77'),_0x3edff1[_0xdb68('0x63')]['name']);_0x22089d[_0xdb68('0x19')][_0xdb68('0x78')]=_0x2f8d6e[_0xdb68('0x78')];_0x22089d['message'][_0xdb68('0x79')]=_0x2f8d6e[_0xdb68('0x78')];_0x22089d[_0xdb68('0x19')][_0xdb68('0x85')]=_0xdb68('0x7c');_0x22089d[_0xdb68('0x19')][_0xdb68('0x45')]=htmlToText['fromString'](_0x2f8d6e[_0xdb68('0x19')][_0xdb68('0x45')]);respondWithRpcPromise('EventManager',_0xdb68('0x7a'),{'event':'rejectmessage','message':_0x22089d['message']},client9002);return _0x2f8d6e;}return null;})['then'](respondWithResult(_0x1c2246,null))[_0xdb68('0x1b')](handleError(_0x1c2246,null));};exports[_0xdb68('0x86')]=function(_0x1b4d64,_0x597641){var _0x2175c3=moment()['unix']()['toString']();var _0x24df26=path['join'](config[_0xdb68('0x56')],_0xdb68('0x87'),_0xdb68('0x88'),_0xdb68('0x89'));var _0x1b520a=path[_0xdb68('0x55')](config[_0xdb68('0x56')],'server','files',_0xdb68('0x54'));var _0x299a0c=util['format'](_0xdb68('0x8a'),_0x2175c3);return db[_0xdb68('0x28')][_0xdb68('0x44')]({'where':{'id':_0x1b4d64[_0xdb68('0x42')]['id']},'attributes':['id',_0xdb68('0x45'),'from','to','cc',_0xdb68('0x8b'),_0xdb68('0x8c'),_0xdb68('0x8d')],'include':_0x1b4d64['query'][_0xdb68('0x54')]?[{'model':db[_0xdb68('0x8e')],'as':_0xdb68('0x8f')}]:undefined})['then'](handleEntityNotFound(_0x597641,null))['then'](function(_0x4d914b){if(_0x4d914b){var _0x5149e3=_0x4d914b;var _0x8b5676={'from':_0x5149e3[_0xdb68('0x90')],'to':_0x5149e3['to'],'subject':_0x5149e3['subject'],'html':htmlEntities[_0xdb68('0x91')](_0x5149e3['body']),'headers':{'Date':moment(_0x5149e3[_0xdb68('0x8d')])[_0xdb68('0x5d')](_0xdb68('0x92'))},'attachments':[]};if(_0x4d914b['cc']){_0x8b5676['headers']['Cc']=_0x4d914b['cc'];}if(_0x4d914b['bcc']){_0x8b5676[_0xdb68('0x93')][_0xdb68('0x94')]=_0x4d914b['bcc'];}return new BPromise(function(_0x4af33c,_0x2df2a7){if(_0x4d914b[_0xdb68('0x8f')]){for(var _0x48be27=0x0;_0x48be27<_0x4d914b[_0xdb68('0x8f')][_0xdb68('0x32')];_0x48be27++){var _0x5c7082=_0x4d914b[_0xdb68('0x8f')][_0x48be27];var _0x1e3012=path[_0xdb68('0x55')](_0x1b520a,_0x5c7082[_0xdb68('0x95')]);if(fs[_0xdb68('0x96')](_0x1e3012)){_0x8b5676['attachments'][_0xdb68('0x97')]({'name':_0x5c7082[_0xdb68('0x26')],'contentType':_0x5c7082['type'],'data':fs[_0xdb68('0x98')](_0x1e3012)});}}}emlformat['build'](_0x8b5676,function(_0x11478f,_0x52eedd){if(_0x11478f)return _0x2df2a7(_0x11478f);fs['writeFileSync'](path['join'](_0x24df26,_0x299a0c),_0x52eedd);return _0x4af33c(_0x52eedd);});});}})[_0xdb68('0x13')](function(_0x5235da){if(_0x5235da){return _0x597641[_0xdb68('0x86')](path[_0xdb68('0x55')](_0x24df26,_0x299a0c),_0x299a0c,function(_0xff5c55){if(!_0xff5c55)fs[_0xdb68('0x99')](path[_0xdb68('0x55')](_0x24df26,_0x299a0c));});}})[_0xdb68('0x1b')](handleError(_0x597641,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 1b879cf..8f07bef 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 _0x4120=['emit','hasOwnProperty','hook','setMaxListeners','save','update','remove'];(function(_0x4efdfd,_0x4a27df){var _0x2b413=function(_0x14a082){while(--_0x14a082){_0x4efdfd['push'](_0x4efdfd['shift']());}};_0x2b413(++_0x4a27df);}(_0x4120,0x7a));var _0x0412=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x4120[_0xc6be3a];return _0x56a310;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x0412('0x0')](0x0);var events={'afterCreate':_0x0412('0x1'),'afterUpdate':_0x0412('0x2'),'afterDestroy':_0x0412('0x3')};function emitEvent(_0x31fdab){return function(_0x56e335,_0x302368,_0x4b460e){MailMessageEvents[_0x0412('0x4')](_0x31fdab+':'+_0x56e335['id'],_0x56e335);MailMessageEvents['emit'](_0x31fdab,_0x56e335);_0x4b460e(null);};}for(var e in events){if(events[_0x0412('0x5')](e)){var event=events[e];MailMessage[_0x0412('0x6')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xf448=['MailMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0xe62388,_0x20a8dc){var _0x364a83=function(_0x3c3718){while(--_0x3c3718){_0xe62388['push'](_0xe62388['shift']());}};_0x364a83(++_0x20a8dc);}(_0xf448,0x1dc));var _0x8f44=function(_0x2fbb34,_0x358b15){_0x2fbb34=_0x2fbb34-0x0;var _0x26914a=_0xf448[_0x2fbb34];return _0x26914a;};'use strict';var EventEmitter=require(_0x8f44('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x8f44('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x8f44('0x2')](0x0);var events={'afterCreate':_0x8f44('0x3'),'afterUpdate':_0x8f44('0x4'),'afterDestroy':_0x8f44('0x5')};function emitEvent(_0x3f84ae){return function(_0x2756b6,_0x314b1d,_0x394c2d){MailMessageEvents[_0x8f44('0x6')](_0x3f84ae+':'+_0x2756b6['id'],_0x2756b6);MailMessageEvents['emit'](_0x3f84ae,_0x2756b6);_0x394c2d(null);};}for(var e in events){if(events[_0x8f44('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x8f44('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 20b2e04..f14219e 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 _0xa73d=['get','direction','toLowerCase','out','secret','isNil','findOne','MailInteractionId','createdAt','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./mailMessage.attributes','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','models'];(function(_0x119280,_0x439c3e){var _0x481797=function(_0x4265cb){while(--_0x4265cb){_0x119280['push'](_0x119280['shift']());}};_0x481797(++_0x439c3e);}(_0xa73d,0x1af));var _0xda73=function(_0x1b61c3,_0x401666){_0x1b61c3=_0x1b61c3-0x0;var _0x5518b1=_0xa73d[_0x1b61c3];return _0x5518b1;};'use strict';var _=require(_0xda73('0x0'));var util=require(_0xda73('0x1'));var logger=require(_0xda73('0x2'))(_0xda73('0x3'));var moment=require('moment');var BPromise=require(_0xda73('0x4'));var rp=require(_0xda73('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xda73('0x6'));var rimraf=require('rimraf');var config=require(_0xda73('0x7'));var attributes=require(_0xda73('0x8'));module['exports']=function(_0x43b6ee,_0x30fffd){return _0x43b6ee['define'](_0xda73('0x9'),attributes,{'tableName':_0xda73('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xda73('0xb')]},{'name':_0xda73('0xc'),'fields':[_0xda73('0xd'),_0xda73('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5c0bf4,_0x5b6555,_0x3d0739){if(_0x5c0bf4[_0xda73('0xf')]){_0x5c0bf4[_0xda73('0xd')]=htmlToText['fromString'](_0x5c0bf4[_0xda73('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3d0739(null,_0x5b6555);},'afterCreate':function(_0x1cd4b0,_0x13e2e7,_0x30e625){var _0x57ed02=_0x43b6ee[_0xda73('0x10')];var _0x4f8876=_0x1cd4b0[_0xda73('0x11')]({'plain':!![]});if(_0x4f8876[_0xda73('0x12')]['toLowerCase']()==='in'||_0x4f8876['direction'][_0xda73('0x13')]()===_0xda73('0x14')&&!_0x4f8876[_0xda73('0x15')]&&!_[_0xda73('0x16')](_0x4f8876['UserId'])){_0x57ed02['MailInteraction'][_0xda73('0x17')]({'where':{'id':_0x4f8876[_0xda73('0x18')]}})['then'](function(_0x2fbef0){if(_0x2fbef0){_0x2fbef0['update']({'lastMsgAt':_0x4f8876[_0xda73('0x19')],'lastMsgDirection':_0x4f8876['direction'][_0xda73('0x13')]()});}})['catch'](function(_0x70cc8b){console[_0xda73('0x1a')](_0x70cc8b);});}_0x30e625();}},'charset':'utf8mb4','collate':_0xda73('0x1b')});}; \ No newline at end of file +var _0xf4dc=['FULLTEXT','body','fromString','get','direction','toLowerCase','out','isNil','UserId','MailInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xf4dc,0x95));var _0xcf4d=function(_0x4ce618,_0x1b3ac0){_0x4ce618=_0x4ce618-0x0;var _0x158e12=_0xf4dc[_0x4ce618];return _0x158e12;};'use strict';var _=require('lodash');var util=require(_0xcf4d('0x0'));var logger=require(_0xcf4d('0x1'))(_0xcf4d('0x2'));var moment=require(_0xcf4d('0x3'));var BPromise=require(_0xcf4d('0x4'));var rp=require(_0xcf4d('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xcf4d('0x6'));var rimraf=require(_0xcf4d('0x7'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module[_0xcf4d('0x8')]=function(_0x3158b6,_0x33a46f){return _0x3158b6[_0xcf4d('0x9')](_0xcf4d('0xa'),attributes,{'tableName':_0xcf4d('0xb'),'paranoid':![],'indexes':[{'name':_0xcf4d('0xc'),'fields':['messageId']},{'name':_0xcf4d('0xd'),'fields':[_0xcf4d('0xe'),_0xcf4d('0xf')],'type':_0xcf4d('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3dc138,_0x255c7d,_0x52556b){if(_0x3dc138[_0xcf4d('0x11')]){_0x3dc138['plainBody']=htmlToText[_0xcf4d('0x12')](_0x3dc138[_0xcf4d('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x52556b(null,_0x255c7d);},'afterCreate':function(_0x362474,_0x3cd38d,_0x4f491b){var _0x586c84=_0x3158b6['models'];var _0x556155=_0x362474[_0xcf4d('0x13')]({'plain':!![]});if(_0x556155[_0xcf4d('0x14')]['toLowerCase']()==='in'||_0x556155[_0xcf4d('0x14')][_0xcf4d('0x15')]()===_0xcf4d('0x16')&&!_0x556155['secret']&&!_[_0xcf4d('0x17')](_0x556155[_0xcf4d('0x18')])){_0x586c84[_0xcf4d('0x19')][_0xcf4d('0x1a')]({'where':{'id':_0x556155['MailInteractionId']}})[_0xcf4d('0x1b')](function(_0x313fc7){if(_0x313fc7){_0x313fc7[_0xcf4d('0x1c')]({'lastMsgAt':_0x556155[_0xcf4d('0x1d')],'lastMsgDirection':_0x556155[_0xcf4d('0x14')][_0xcf4d('0x15')]()});}})[_0xcf4d('0x1e')](function(_0x497491){console[_0xcf4d('0x1f')](_0x497491);});}_0x4f491b();}},'charset':_0xcf4d('0x20'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index fd2f5de..1b91b28 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 _0x5fdc=['catch','CreateMailMessage','MailMessage','create','body','options','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x327e17,_0x8e788e){var _0x143c10=function(_0x100e1f){while(--_0x100e1f){_0x327e17['push'](_0x327e17['shift']());}};_0x143c10(++_0x8e788e);}(_0x5fdc,0x127));var _0xc5fd=function(_0x36a514,_0x92f847){_0x36a514=_0x36a514-0x0;var _0x86fff7=_0x5fdc[_0x36a514];return _0x86fff7;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));var BPromise=require(_0xc5fd('0x3'));var rs=require(_0xc5fd('0x4'));var fs=require('fs');var Redis=require(_0xc5fd('0x5'));var db=require(_0xc5fd('0x6'))['db'];var utils=require(_0xc5fd('0x7'));var logger=require(_0xc5fd('0x8'))(_0xc5fd('0x9'));var config=require(_0xc5fd('0xa'));var jayson=require(_0xc5fd('0xb'));var client=jayson[_0xc5fd('0xc')][_0xc5fd('0xd')]({'port':0x232a});config[_0xc5fd('0xe')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc5fd('0xf'))(new Redis(config[_0xc5fd('0xe')]));require(_0xc5fd('0x10'))[_0xc5fd('0x11')](socket);function respondWithRpcPromise(_0x4e6d35,_0x4e1e94,_0x3442dd){return new BPromise(function(_0x1edeec,_0x39a95a){return client[_0xc5fd('0x12')](_0x4e6d35,_0x3442dd)[_0xc5fd('0x13')](function(_0x368c80){logger['info'](_0xc5fd('0x14'),_0x4e1e94,'request\x20sent');logger['debug'](_0xc5fd('0x15'),_0x4e1e94,_0xc5fd('0x16'),JSON[_0xc5fd('0x17')](_0x368c80));if(_0x368c80[_0xc5fd('0x18')]){if(_0x368c80[_0xc5fd('0x18')][_0xc5fd('0x19')]===0x1f4){logger[_0xc5fd('0x18')](_0xc5fd('0x14'),_0x4e1e94,_0x368c80['error'][_0xc5fd('0x1a')]);return _0x39a95a(_0x368c80[_0xc5fd('0x18')][_0xc5fd('0x1a')]);}logger[_0xc5fd('0x18')]('MailMessage,\x20%s,\x20%s',_0x4e1e94,_0x368c80['error']['message']);return _0x1edeec(_0x368c80['error']['message']);}else{logger[_0xc5fd('0x1b')](_0xc5fd('0x14'),_0x4e1e94,_0xc5fd('0x16'));_0x1edeec(_0x368c80[_0xc5fd('0x1c')][_0xc5fd('0x1a')]);}})[_0xc5fd('0x1d')](function(_0xfd14c7){logger['error'](_0xc5fd('0x14'),_0x4e1e94,_0xfd14c7);_0x39a95a(_0xfd14c7);});});}exports[_0xc5fd('0x1e')]=function(_0x32eac2){var _0x9c12e4=this;return new Promise(function(_0x3b3093,_0x48024e){return db[_0xc5fd('0x1f')][_0xc5fd('0x20')](_0x32eac2[_0xc5fd('0x21')],{'raw':_0x32eac2[_0xc5fd('0x22')]?_0x32eac2['options']['raw']===undefined?!![]:![]:!![]})[_0xc5fd('0x13')](function(_0x2ab935){logger[_0xc5fd('0x1b')](_0xc5fd('0x1e'),_0x32eac2);logger[_0xc5fd('0x23')](_0xc5fd('0x1e'),_0x32eac2,JSON['stringify'](_0x2ab935));_0x3b3093(_0x2ab935);})[_0xc5fd('0x1d')](function(_0x2701f7){logger[_0xc5fd('0x18')](_0xc5fd('0x1e'),_0x2701f7[_0xc5fd('0x1a')],_0x32eac2);_0x48024e(_0x9c12e4[_0xc5fd('0x18')](0x1f4,_0x2701f7[_0xc5fd('0x1a')]));});});}; \ No newline at end of file +var _0x47c5=['request','then','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','MailMessage','create','options','info','debug','CreateMailMessage','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register'];(function(_0x148645,_0x249915){var _0x43eed6=function(_0xac384b){while(--_0xac384b){_0x148645['push'](_0x148645['shift']());}};_0x43eed6(++_0x249915);}(_0x47c5,0x165));var _0x547c=function(_0x313d6f,_0x122c8d){_0x313d6f=_0x313d6f-0x0;var _0x2059ac=_0x47c5[_0x313d6f];return _0x2059ac;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});config[_0x547c('0xb')]=_[_0x547c('0xc')](config[_0x547c('0xb')],{'host':_0x547c('0xd'),'port':0x18eb});var socket=require(_0x547c('0xe'))(new Redis(config[_0x547c('0xb')]));require(_0x547c('0xf'))[_0x547c('0x10')](socket);function respondWithRpcPromise(_0x44a581,_0x72828d,_0x2c54e){return new BPromise(function(_0x111457,_0x2455e9){return client[_0x547c('0x11')](_0x44a581,_0x2c54e)[_0x547c('0x12')](function(_0x44ab17){logger['info'](_0x547c('0x13'),_0x72828d,_0x547c('0x14'));logger['debug'](_0x547c('0x15'),_0x72828d,_0x547c('0x14'),JSON[_0x547c('0x16')](_0x44ab17));if(_0x44ab17[_0x547c('0x17')]){if(_0x44ab17[_0x547c('0x17')][_0x547c('0x18')]===0x1f4){logger[_0x547c('0x17')](_0x547c('0x13'),_0x72828d,_0x44ab17[_0x547c('0x17')][_0x547c('0x19')]);return _0x2455e9(_0x44ab17[_0x547c('0x17')][_0x547c('0x19')]);}logger[_0x547c('0x17')](_0x547c('0x13'),_0x72828d,_0x44ab17[_0x547c('0x17')][_0x547c('0x19')]);return _0x111457(_0x44ab17[_0x547c('0x17')][_0x547c('0x19')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x72828d,_0x547c('0x14'));_0x111457(_0x44ab17[_0x547c('0x1a')][_0x547c('0x19')]);}})['catch'](function(_0x248aca){logger[_0x547c('0x17')](_0x547c('0x13'),_0x72828d,_0x248aca);_0x2455e9(_0x248aca);});});}exports['CreateMailMessage']=function(_0x4511d3){var _0x41149f=this;return new Promise(function(_0x496c38,_0x5453f9){return db[_0x547c('0x1b')][_0x547c('0x1c')](_0x4511d3['body'],{'raw':_0x4511d3[_0x547c('0x1d')]?_0x4511d3[_0x547c('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x547c('0x12')](function(_0x17fd97){logger[_0x547c('0x1e')]('CreateMailMessage',_0x4511d3);logger[_0x547c('0x1f')](_0x547c('0x20'),_0x4511d3,JSON[_0x547c('0x16')](_0x17fd97));_0x496c38(_0x17fd97);})[_0x547c('0x21')](function(_0x1f3581){logger[_0x547c('0x17')](_0x547c('0x20'),_0x1f3581[_0x547c('0x19')],_0x4511d3);_0x5453f9(_0x41149f['error'](0x1f4,_0x1f3581[_0x547c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 7fb6b37..f783af6 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 _0xd5af=['emit','removeListener','register','length','mailMessage:','./mailMessage.events','save','update'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xd5af,0x1d5));var _0xfd5a=function(_0x409bcd,_0x477ca0){_0x409bcd=_0x409bcd-0x0;var _0x57e84d=_0xd5af[_0x409bcd];return _0x57e84d;};'use strict';var MailMessageEvents=require(_0xfd5a('0x0'));var events=[_0xfd5a('0x1'),'remove',_0xfd5a('0x2')];function createListener(_0x47a9c6,_0x391769){return function(_0x495929){_0x391769[_0xfd5a('0x3')](_0x47a9c6,_0x495929);};}function removeListener(_0x2247a4,_0x49eef0){return function(){MailMessageEvents[_0xfd5a('0x4')](_0x2247a4,_0x49eef0);};}exports[_0xfd5a('0x5')]=function(_0x5a364){for(var _0x4dac18=0x0,_0x4a7a28=events[_0xfd5a('0x6')];_0x4dac18<_0x4a7a28;_0x4dac18++){var _0x4ddbe9=events[_0x4dac18];var _0x235171=createListener(_0xfd5a('0x7')+_0x4ddbe9,_0x5a364);MailMessageEvents['on'](_0x4ddbe9,_0x235171);}}; \ No newline at end of file +var _0x998d=['update','emit','register','length','./mailMessage.events','save','remove'];(function(_0x1a89f3,_0x35d7d4){var _0x4f907a=function(_0x4c7836){while(--_0x4c7836){_0x1a89f3['push'](_0x1a89f3['shift']());}};_0x4f907a(++_0x35d7d4);}(_0x998d,0x11c));var _0xd998=function(_0x52a394,_0x45cdc6){_0x52a394=_0x52a394-0x0;var _0x523cae=_0x998d[_0x52a394];return _0x523cae;};'use strict';var MailMessageEvents=require(_0xd998('0x0'));var events=[_0xd998('0x1'),_0xd998('0x2'),_0xd998('0x3')];function createListener(_0x2de845,_0x581493){return function(_0x3df4fb){_0x581493[_0xd998('0x4')](_0x2de845,_0x3df4fb);};}function removeListener(_0x18566d,_0xa2d4ed){return function(){MailMessageEvents['removeListener'](_0x18566d,_0xa2d4ed);};}exports[_0xd998('0x5')]=function(_0x4bca30){for(var _0x2d3cb8=0x0,_0x1e81ef=events[_0xd998('0x6')];_0x2d3cb8<_0x1e81ef;_0x2d3cb8++){var _0xfd33f8=events[_0x2d3cb8];var _0x40d6a4=createListener('mailMessage:'+_0xfd33f8,_0x4bca30);MailMessageEvents['on'](_0xfd33f8,_0x40d6a4);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 56e5804..9fe428f 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 _0x2b61=['describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','put','update','/:id','destroy','delete','removeTeams','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x5b957a,_0x24674b){var _0x510384=function(_0x34e3df){while(--_0x34e3df){_0x5b957a['push'](_0x5b957a['shift']());}};_0x510384(++_0x24674b);}(_0x2b61,0x1b4));var _0x12b6=function(_0x50a004,_0x193d84){_0x50a004=_0x50a004-0x0;var _0x5e9992=_0x2b61[_0x50a004];return _0x5e9992;};'use strict';var multer=require('multer');var util=require(_0x12b6('0x0'));var path=require(_0x12b6('0x1'));var timeout=require(_0x12b6('0x2'));var express=require(_0x12b6('0x3'));var router=express[_0x12b6('0x4')]();var fs_extra=require(_0x12b6('0x5'));var auth=require(_0x12b6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x12b6('0x7'));var controller=require('./mailQueue.controller');router[_0x12b6('0x8')]('/',auth[_0x12b6('0x9')](),controller[_0x12b6('0xa')]);router['get'](_0x12b6('0xb'),auth[_0x12b6('0x9')](),controller[_0x12b6('0xc')]);router[_0x12b6('0x8')]('/:id',auth[_0x12b6('0x9')](),controller[_0x12b6('0xd')]);router[_0x12b6('0x8')](_0x12b6('0xe'),auth[_0x12b6('0x9')](),controller[_0x12b6('0xf')]);router[_0x12b6('0x8')](_0x12b6('0x10'),auth[_0x12b6('0x9')](),controller[_0x12b6('0x11')]);router[_0x12b6('0x8')](_0x12b6('0x12'),auth['isAuthenticated'](),controller['getAgents']);router[_0x12b6('0x13')]('/',auth[_0x12b6('0x9')](),controller['create']);router[_0x12b6('0x13')]('/:id/teams',auth[_0x12b6('0x9')](),controller[_0x12b6('0x14')]);router[_0x12b6('0x13')](_0x12b6('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x12b6('0x15')]('/:id',auth[_0x12b6('0x9')](),controller[_0x12b6('0x16')]);router['delete'](_0x12b6('0x17'),auth['isAuthenticated'](),controller[_0x12b6('0x18')]);router[_0x12b6('0x19')](_0x12b6('0x10'),auth[_0x12b6('0x9')](),controller[_0x12b6('0x1a')]);router[_0x12b6('0x19')]('/:id/users',auth[_0x12b6('0x9')](),controller['removeAgents']);module[_0x12b6('0x1b')]=router; \ No newline at end of file +var _0x86a1=['/:id/teams','getTeams','create','post','addTeams','/:id/users','put','update','delete','destroy','removeTeams','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers'];(function(_0x129577,_0x1794e3){var _0x2600d9=function(_0x3e211d){while(--_0x3e211d){_0x129577['push'](_0x129577['shift']());}};_0x2600d9(++_0x1794e3);}(_0x86a1,0x105));var _0x186a=function(_0x2984d0,_0x1a7211){_0x2984d0=_0x2984d0-0x0;var _0x2885f2=_0x86a1[_0x2984d0];return _0x2885f2;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x186a('0x0'));var express=require('express');var router=express[_0x186a('0x1')]();var fs_extra=require(_0x186a('0x2'));var auth=require(_0x186a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x186a('0x4'));var controller=require(_0x186a('0x5'));router[_0x186a('0x6')]('/',auth[_0x186a('0x7')](),controller[_0x186a('0x8')]);router['get'](_0x186a('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x186a('0xa'),auth['isAuthenticated'](),controller[_0x186a('0xb')]);router[_0x186a('0x6')](_0x186a('0xc'),auth['isAuthenticated'](),controller[_0x186a('0xd')]);router['get'](_0x186a('0xe'),auth[_0x186a('0x7')](),controller[_0x186a('0xf')]);router[_0x186a('0x6')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x186a('0x10')]);router[_0x186a('0x11')](_0x186a('0xe'),auth[_0x186a('0x7')](),controller[_0x186a('0x12')]);router[_0x186a('0x11')](_0x186a('0x13'),auth[_0x186a('0x7')](),controller['addAgents']);router[_0x186a('0x14')](_0x186a('0xa'),auth[_0x186a('0x7')](),controller[_0x186a('0x15')]);router[_0x186a('0x16')](_0x186a('0xa'),auth[_0x186a('0x7')](),controller[_0x186a('0x17')]);router['delete'](_0x186a('0xe'),auth[_0x186a('0x7')](),controller[_0x186a('0x18')]);router[_0x186a('0x16')]('/:id/users',auth[_0x186a('0x7')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 4313f1f..8d4f0ec 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 _0xf8f7=['sequelize','exports','STRING','name','rrmemory','beepall','roundrobin'];(function(_0x1dc1c2,_0x4eb0dc){var _0x11c518=function(_0x90f2e1){while(--_0x90f2e1){_0x1dc1c2['push'](_0x1dc1c2['shift']());}};_0x11c518(++_0x4eb0dc);}(_0xf8f7,0x19d));var _0x7f8f=function(_0x470221,_0x38ef0e){_0x470221=_0x470221-0x0;var _0x5da0a4=_0xf8f7[_0x470221];return _0x5da0a4;};'use strict';var Sequelize=require(_0x7f8f('0x0'));module[_0x7f8f('0x1')]={'name':{'type':Sequelize[_0x7f8f('0x2')],'unique':_0x7f8f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7f8f('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7f8f('0x4'),_0x7f8f('0x5'),_0x7f8f('0x6'))}}; \ No newline at end of file +var _0x0a42=['beepall','roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x1019e6,_0x3312d1){var _0x5acecc=function(_0x36233d){while(--_0x36233d){_0x1019e6['push'](_0x1019e6['shift']());}};_0x5acecc(++_0x3312d1);}(_0x0a42,0x1ea));var _0x20a4=function(_0xd0c47,_0x18f92a){_0xd0c47=_0xd0c47-0x0;var _0x5e7cca=_0x0a42[_0xd0c47];return _0x5e7cca;};'use strict';var Sequelize=require('sequelize');module[_0x20a4('0x0')]={'name':{'type':Sequelize[_0x20a4('0x1')],'unique':_0x20a4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x20a4('0x1')]},'timeout':{'type':Sequelize[_0x20a4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x20a4('0x4')](_0x20a4('0x5'),_0x20a4('0x6'),_0x20a4('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index daac3ab..79244be 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 _0xf9e0=['Team','order','pick','ids','User','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','userMailQueue:save','select','field','from','join','user_has_teams','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeTeams','isEmpty','userMailQueue:remove','addAgents','spread','emit','removeAgents','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','UserProfileResource','error','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','getOptions','where','include','findAll','rows','catch','params','model','keys','query','filters','intersection','attributes','fields','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','userProfileId','autoAssociation','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','nolimit','sort','MailQueueId','filter','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','mailPause','getTeams'];(function(_0x48051b,_0x339115){var _0x2a4f6e=function(_0x5b7756){while(--_0x5b7756){_0x48051b['push'](_0x48051b['shift']());}};_0x2a4f6e(++_0x339115);}(_0xf9e0,0x11b));var _0x0f9e=function(_0x1392c7,_0x376494){_0x1392c7=_0x1392c7-0x0;var _0x56d7d=_0xf9e0[_0x1392c7];return _0x56d7d;};'use strict';var BPromise=require(_0x0f9e('0x0'));var util=require(_0x0f9e('0x1'));var _=require('lodash');var squel=require(_0x0f9e('0x2'));var Redis=require(_0x0f9e('0x3'));var qs=require(_0x0f9e('0x4'));var logger=require(_0x0f9e('0x5'))(_0x0f9e('0x6'));var config=require('../../config/environment');var db=require(_0x0f9e('0x7'))['db'];config[_0x0f9e('0x8')]=_[_0x0f9e('0x9')](config[_0x0f9e('0x8')],{'host':_0x0f9e('0xa'),'port':0x18eb});var socket=require(_0x0f9e('0xb'))(new Redis(config[_0x0f9e('0x8')]));require('./mailQueue.socket')[_0x0f9e('0xc')](socket);function respondWithStatusCode(_0x1d10a4,_0x4d3364){_0x4d3364=_0x4d3364||0xcc;return function(_0x2aae70){if(_0x2aae70){return _0x1d10a4[_0x0f9e('0xd')](_0x4d3364);}return _0x1d10a4[_0x0f9e('0xe')](_0x4d3364)[_0x0f9e('0xf')]();};}function respondWithResult(_0x33175c,_0xa0b87){_0xa0b87=_0xa0b87||0xc8;return function(_0x5ba6f6){if(_0x5ba6f6){return _0x33175c[_0x0f9e('0xe')](_0xa0b87)['json'](_0x5ba6f6);}};}function respondWithFilteredResult(_0x4b4185,_0x257f7c){return function(_0x3dcd01){if(_0x3dcd01){var _0x2f254a=typeof _0x257f7c[_0x0f9e('0x10')]==='undefined'&&typeof _0x257f7c['limit']===_0x0f9e('0x11');var _0xa3d244=_0x3dcd01[_0x0f9e('0x12')];var _0x2b532e=_0x2f254a?0x0:_0x257f7c[_0x0f9e('0x10')];var _0x4c4797=_0x2f254a?_0x3dcd01[_0x0f9e('0x12')]:_0x257f7c[_0x0f9e('0x10')]+_0x257f7c[_0x0f9e('0x13')];var _0x22d8ac;if(_0x4c4797>=_0xa3d244){_0x4c4797=_0xa3d244;_0x22d8ac=0xc8;}else{_0x22d8ac=0xce;}_0x4b4185[_0x0f9e('0xe')](_0x22d8ac);return _0x4b4185[_0x0f9e('0x14')](_0x0f9e('0x15'),_0x2b532e+'-'+_0x4c4797+'/'+_0xa3d244)['json'](_0x3dcd01);}return null;};}function saveUpdates(_0xef31e8){return function(_0x350193){if(_0x350193){return _0x350193[_0x0f9e('0x16')](_0xef31e8)[_0x0f9e('0x17')](function(_0x3fd974){return _0x3fd974;});}return null;};}function removeEntity(_0x3a15e5){return function(_0x453647){if(_0x453647){return _0x453647[_0x0f9e('0x18')]()[_0x0f9e('0x17')](function(){var _0x269f3a=_0x453647[_0x0f9e('0x19')]({'plain':!![]});var _0x443b4f='MailQueues';return db[_0x0f9e('0x1a')][_0x0f9e('0x18')]({'where':{'type':_0x443b4f,'resourceId':_0x269f3a['id']}})[_0x0f9e('0x17')](function(){return _0x453647;});})['then'](function(){_0x3a15e5[_0x0f9e('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a2037){return function(_0xcd415e){if(!_0xcd415e){_0x5a2037[_0x0f9e('0xd')](0x194);}return _0xcd415e;};}function handleError(_0x283469,_0x1c5e4d){_0x1c5e4d=_0x1c5e4d||0x1f4;return function(_0x5955cb){logger[_0x0f9e('0x1b')](_0x5955cb['stack']);if(_0x5955cb[_0x0f9e('0x1c')]){delete _0x5955cb['name'];}_0x283469[_0x0f9e('0xe')](_0x1c5e4d)[_0x0f9e('0x1d')](_0x5955cb);};}exports[_0x0f9e('0x1e')]=function(_0xf4b0bd,_0x1ca38f){var _0x4c1b47={};var _0x51a0ff={'count':0x0,'rows':[]};var _0xa9526e=_[_0x0f9e('0x1f')](db[_0x0f9e('0x20')][_0x0f9e('0x21')],function(_0x284e0c){return{'name':_0x284e0c[_0x0f9e('0x22')],'type':_0x284e0c[_0x0f9e('0x23')][_0x0f9e('0x24')]};});_0x4c1b47=qs[_0x0f9e('0x25')](_0xa9526e,_0xf4b0bd);var _0x4a1d39={'where':_0x4c1b47[_0x0f9e('0x26')]};return db['MailQueue']['count'](_0x4a1d39)[_0x0f9e('0x17')](function(_0xec2bf1){_0x51a0ff[_0x0f9e('0x12')]=_0xec2bf1;_0x4c1b47[_0x0f9e('0x27')]=qs[_0x0f9e('0x27')](_0xf4b0bd['query']);return db['MailQueue'][_0x0f9e('0x28')](_0x4c1b47);})[_0x0f9e('0x17')](function(_0x4617de){_0x51a0ff[_0x0f9e('0x29')]=_0x4617de;return _0x51a0ff;})[_0x0f9e('0x17')](respondWithFilteredResult(_0x1ca38f,_0x4c1b47))[_0x0f9e('0x2a')](handleError(_0x1ca38f,null));};exports['show']=function(_0x313e49,_0x5bea0c){var _0x5ad8a1={'raw':!![],'where':{'id':_0x313e49[_0x0f9e('0x2b')]['id']}},_0x19d255={};_0x19d255[_0x0f9e('0x2c')]=_[_0x0f9e('0x2d')](db[_0x0f9e('0x20')][_0x0f9e('0x21')]);_0x19d255[_0x0f9e('0x2e')]=_[_0x0f9e('0x2d')](_0x313e49['query']);_0x19d255[_0x0f9e('0x2f')]=_[_0x0f9e('0x30')](_0x19d255[_0x0f9e('0x2c')],_0x19d255['query']);_0x5ad8a1[_0x0f9e('0x31')]=_[_0x0f9e('0x30')](_0x19d255['model'],qs[_0x0f9e('0x32')](_0x313e49[_0x0f9e('0x2e')][_0x0f9e('0x32')]));_0x5ad8a1[_0x0f9e('0x31')]=_0x5ad8a1[_0x0f9e('0x31')][_0x0f9e('0x33')]?_0x5ad8a1[_0x0f9e('0x31')]:_0x19d255[_0x0f9e('0x2c')];if(_0x313e49[_0x0f9e('0x2e')]['includeAll']){_0x5ad8a1['include']=[{'all':!![]}];}_0x5ad8a1=_[_0x0f9e('0x34')]({},_0x5ad8a1,_0x313e49[_0x0f9e('0x35')]);return db['MailQueue'][_0x0f9e('0x36')](_0x5ad8a1)[_0x0f9e('0x17')](handleEntityNotFound(_0x5bea0c,null))[_0x0f9e('0x17')](respondWithResult(_0x5bea0c,null))[_0x0f9e('0x2a')](handleError(_0x5bea0c,null));};exports[_0x0f9e('0x37')]=function(_0x16ec56,_0x4b7260){return db['MailQueue']['create'](_0x16ec56[_0x0f9e('0x38')],{})[_0x0f9e('0x17')](function(_0x5bc6e9){var _0x40a053=_0x16ec56[_0x0f9e('0x39')]['get']({'plain':!![]});if(!_0x40a053)throw new Error(_0x0f9e('0x3a'));if(_0x40a053[_0x0f9e('0x3b')]==='user'){var _0x192ee4=_0x5bc6e9[_0x0f9e('0x19')]({'plain':!![]});var _0x4bcd1d=_0x0f9e('0x3c');return db['UserProfileSection'][_0x0f9e('0x36')]({'where':{'name':_0x4bcd1d,'userProfileId':_0x40a053[_0x0f9e('0x3d')]},'raw':!![]})[_0x0f9e('0x17')](function(_0x380997){if(_0x380997&&_0x380997[_0x0f9e('0x3e')]===0x0){return db[_0x0f9e('0x1a')][_0x0f9e('0x37')]({'name':_0x192ee4['name'],'resourceId':_0x192ee4['id'],'type':_0x380997[_0x0f9e('0x1c')],'sectionId':_0x380997['id']},{})[_0x0f9e('0x17')](function(){return _0x5bc6e9;});}else{return _0x5bc6e9;}})[_0x0f9e('0x2a')](function(_0x1cff05){logger[_0x0f9e('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cff05);throw _0x1cff05;});}return _0x5bc6e9;})['then'](respondWithResult(_0x4b7260,0xc9))[_0x0f9e('0x2a')](handleError(_0x4b7260,null));};exports[_0x0f9e('0x16')]=function(_0x100944,_0x4f6fd5){if(_0x100944[_0x0f9e('0x38')]['id']){delete _0x100944[_0x0f9e('0x38')]['id'];}return db[_0x0f9e('0x20')][_0x0f9e('0x36')]({'where':{'id':_0x100944[_0x0f9e('0x2b')]['id']}})[_0x0f9e('0x17')](handleEntityNotFound(_0x4f6fd5,null))[_0x0f9e('0x17')](saveUpdates(_0x100944[_0x0f9e('0x38')],null))[_0x0f9e('0x17')](respondWithResult(_0x4f6fd5,null))['catch'](handleError(_0x4f6fd5,null));};exports[_0x0f9e('0x18')]=function(_0x4e75c1,_0x204c48){return db[_0x0f9e('0x20')][_0x0f9e('0x36')]({'where':{'id':_0x4e75c1[_0x0f9e('0x2b')]['id']}})[_0x0f9e('0x17')](handleEntityNotFound(_0x204c48,null))[_0x0f9e('0x17')](removeEntity(_0x204c48,null))[_0x0f9e('0x2a')](handleError(_0x204c48,null));};exports['describe']=function(_0x3a7746,_0x53439c){return db[_0x0f9e('0x20')][_0x0f9e('0x3f')]()[_0x0f9e('0x17')](respondWithResult(_0x53439c,null))[_0x0f9e('0x2a')](handleError(_0x53439c,null));};exports[_0x0f9e('0x40')]=function(_0x2a325a,_0x187076){var _0x485a4e={'raw':!![],'where':{}},_0x16f0a4={},_0x271bf6;return db[_0x0f9e('0x20')][_0x0f9e('0x41')]({'where':{'id':_0x2a325a['params']['id']}})[_0x0f9e('0x17')](handleEntityNotFound(_0x187076,null))['then'](function(_0x5545f7){if(_0x5545f7){_0x271bf6=_0x5545f7[_0x0f9e('0x19')]({'plain':!![]});_0x16f0a4[_0x0f9e('0x2c')]=_[_0x0f9e('0x2d')](db[_0x0f9e('0x42')][_0x0f9e('0x21')]);_0x16f0a4[_0x0f9e('0x2e')]=_[_0x0f9e('0x2d')](_0x2a325a[_0x0f9e('0x2e')]);_0x16f0a4[_0x0f9e('0x2f')]=_['intersection'](_0x16f0a4[_0x0f9e('0x2c')],_0x16f0a4[_0x0f9e('0x2e')]);_0x485a4e[_0x0f9e('0x31')]=_[_0x0f9e('0x30')](_0x16f0a4[_0x0f9e('0x2c')],qs[_0x0f9e('0x32')](_0x2a325a[_0x0f9e('0x2e')][_0x0f9e('0x32')]));_0x485a4e[_0x0f9e('0x31')]=_0x485a4e[_0x0f9e('0x31')][_0x0f9e('0x33')]?_0x485a4e['attributes']:_0x16f0a4[_0x0f9e('0x2c')];if(!_0x2a325a['query'][_0x0f9e('0x43')](_0x0f9e('0x44'))){_0x485a4e[_0x0f9e('0x13')]=qs[_0x0f9e('0x13')](_0x2a325a[_0x0f9e('0x2e')][_0x0f9e('0x13')]);_0x485a4e[_0x0f9e('0x10')]=qs['offset'](_0x2a325a[_0x0f9e('0x2e')][_0x0f9e('0x10')]);}_0x485a4e['order']=qs[_0x0f9e('0x45')](_0x2a325a[_0x0f9e('0x2e')][_0x0f9e('0x45')]);_0x485a4e[_0x0f9e('0x26')]=qs[_0x0f9e('0x2f')](_['pick'](_0x2a325a[_0x0f9e('0x2e')],_0x16f0a4[_0x0f9e('0x2f')]));_0x485a4e[_0x0f9e('0x26')][_0x0f9e('0x46')]=_0x5545f7['id'];if(_0x2a325a[_0x0f9e('0x2e')][_0x0f9e('0x47')]){_0x485a4e[_0x0f9e('0x26')]=_[_0x0f9e('0x34')](_0x485a4e['where'],{'$or':_[_0x0f9e('0x1f')](_0x485a4e[_0x0f9e('0x31')],function(_0x810494){var _0x44fc72={};_0x44fc72[_0x810494]={'$like':'%'+_0x2a325a[_0x0f9e('0x2e')][_0x0f9e('0x47')]+'%'};return _0x44fc72;})});}_0x485a4e=_[_0x0f9e('0x34')]({},_0x485a4e,_0x2a325a[_0x0f9e('0x35')]);return db['UserMailQueue'][_0x0f9e('0x28')](_0x485a4e);}})[_0x0f9e('0x17')](function(_0x463d2c){if(_0x463d2c){return db['User'][_0x0f9e('0x48')]({'where':{'id':_[_0x0f9e('0x1f')](_0x463d2c,_0x0f9e('0x49')),'role':_0x0f9e('0x4a')},'attributes':['id',_0x0f9e('0x1c'),'mailPause',_0x0f9e('0x4b'),_0x0f9e('0x4c')]});}})[_0x0f9e('0x17')](function(_0x20e9af){if(_0x20e9af){return{'count':_0x20e9af['count'],'rows':_['map'](_0x20e9af[_0x0f9e('0x29')],function(_0x26ceb3){return{'membername':_0x26ceb3[_0x0f9e('0x1c')],'UserId':_0x26ceb3['id'],'queue_name':_0x271bf6[_0x0f9e('0x1c')],'MailQueueId':_0x271bf6['id'],'interface':util['format'](_0x0f9e('0x4d'),'SIP',_0x26ceb3['name']),'penalty':0x0,'paused':_0x26ceb3[_0x0f9e('0x4e')],'createdAt':_0x26ceb3[_0x0f9e('0x4c')],'updatedAt':_0x26ceb3[_0x0f9e('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x187076,_0x485a4e))[_0x0f9e('0x2a')](handleError(_0x187076,null));};exports[_0x0f9e('0x4f')]=function(_0x5c40e8,_0x41c605){var _0x2021fc={};var _0x8ccec1={};var _0x429069;var _0x284a3a;return db[_0x0f9e('0x20')]['findOne']({'where':{'id':_0x5c40e8[_0x0f9e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x41c605,null))['then'](function(_0x2dc939){if(_0x2dc939){_0x429069=_0x2dc939;_0x8ccec1['model']=_[_0x0f9e('0x2d')](db[_0x0f9e('0x50')]['rawAttributes']);_0x8ccec1[_0x0f9e('0x2e')]=_[_0x0f9e('0x2d')](_0x5c40e8['query']);_0x8ccec1['filters']=_[_0x0f9e('0x30')](_0x8ccec1[_0x0f9e('0x2c')],_0x8ccec1[_0x0f9e('0x2e')]);_0x2021fc[_0x0f9e('0x31')]=_['intersection'](_0x8ccec1['model'],qs[_0x0f9e('0x32')](_0x5c40e8[_0x0f9e('0x2e')]['fields']));_0x2021fc[_0x0f9e('0x31')]=_0x2021fc['attributes']['length']?_0x2021fc[_0x0f9e('0x31')]:_0x8ccec1['model'];_0x2021fc[_0x0f9e('0x51')]=qs[_0x0f9e('0x45')](_0x5c40e8[_0x0f9e('0x2e')][_0x0f9e('0x45')]);_0x2021fc[_0x0f9e('0x26')]=qs[_0x0f9e('0x2f')](_[_0x0f9e('0x52')](_0x5c40e8[_0x0f9e('0x2e')],_0x8ccec1[_0x0f9e('0x2f')]));if(_0x5c40e8['query'][_0x0f9e('0x47')]){_0x2021fc[_0x0f9e('0x26')]=_['merge'](_0x2021fc[_0x0f9e('0x26')],{'$or':_[_0x0f9e('0x1f')](_0x2021fc[_0x0f9e('0x31')],function(_0x116096){var _0x581475={};_0x581475[_0x116096]={'$like':'%'+_0x5c40e8['query']['filter']+'%'};return _0x581475;})});}_0x2021fc=_[_0x0f9e('0x34')]({},_0x2021fc,_0x5c40e8['options']);return _0x429069[_0x0f9e('0x4f')](_0x2021fc);}})[_0x0f9e('0x17')](function(_0x5dacda){if(_0x5dacda){_0x284a3a=_0x5dacda[_0x0f9e('0x33')];if(!_0x5c40e8[_0x0f9e('0x2e')][_0x0f9e('0x43')](_0x0f9e('0x44'))){_0x2021fc[_0x0f9e('0x13')]=qs['limit'](_0x5c40e8[_0x0f9e('0x2e')]['limit']);_0x2021fc[_0x0f9e('0x10')]=qs[_0x0f9e('0x10')](_0x5c40e8[_0x0f9e('0x2e')][_0x0f9e('0x10')]);}return _0x429069['getTeams'](_0x2021fc);}})[_0x0f9e('0x17')](function(_0x2afebe){if(_0x2afebe){return _0x2afebe?{'count':_0x284a3a,'rows':_0x2afebe}:null;}})[_0x0f9e('0x17')](respondWithResult(_0x41c605,null))['catch'](handleError(_0x41c605,null));};exports['addTeams']=function(_0x5f5076,_0x1d819e){var _0x34fa7c=_0x5f5076[_0x0f9e('0x38')][_0x0f9e('0x53')];return db['Team']['findAll']({'where':{'id':_0x34fa7c},'attributes':['id'],'include':[{'model':db[_0x0f9e('0x54')],'as':_0x0f9e('0x55'),'attributes':['id','name','online',_0x0f9e('0x56'),_0x0f9e('0x57')],'raw':!![]}]})[_0x0f9e('0x17')](function(_0x3be0e6){if(_0x3be0e6){var _0x4d777b=_[_0x0f9e('0x58')](_0x3be0e6,function(_0x1698e9){var _0x28d141=_0x1698e9[_0x0f9e('0x19')]({'plain':!![]});return _0x28d141[_0x0f9e('0x55')];});return db['MailQueue'][_0x0f9e('0x36')]({'where':{'id':_0x5f5076[_0x0f9e('0x2b')]['id']}})['then'](function(_0x4b2806){return db[_0x0f9e('0x59')][_0x0f9e('0x5a')](function(_0x31cea9){return _0x4b2806[_0x0f9e('0x5b')](_0x34fa7c,{'transaction':_0x31cea9})[_0x0f9e('0x17')](function(){return BPromise[_0x0f9e('0x5c')](_0x4d777b,function(_0x414d94){return db[_0x0f9e('0x42')][_0x0f9e('0x5d')]({'where':{'UserId':_0x414d94['id'],'MailQueueId':_0x5f5076[_0x0f9e('0x2b')]['id']},'transaction':_0x31cea9});});})[_0x0f9e('0x17')](function(){_0x4d777b[_0x0f9e('0x5e')](function(_0x54df17){socket['emit'](_0x0f9e('0x5f'),{'UserId':_0x54df17['id'],'MailQueueId':_0x4b2806['id']});});});});});}})['then'](respondWithStatusCode(_0x1d819e,null))[_0x0f9e('0x2a')](handleError(_0x1d819e,null));};exports['removeTeams']=function(_0x51f5c3,_0x1bbb01){return db['Team'][_0x0f9e('0x28')]({'where':{'id':_0x51f5c3['query'][_0x0f9e('0x53')]},'attributes':['id'],'include':[{'model':db[_0x0f9e('0x54')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0f9e('0x17')](handleEntityNotFound(_0x1bbb01,null))['then'](function(_0x472d72){var _0xb5bb20=_['map'](_0x472d72,'id');var _0x291c25=[];var _0x4be465=[];var _0x34d011=squel[_0x0f9e('0x60')]();_0x34d011[_0x0f9e('0x61')]('tq.TeamId')[_0x0f9e('0x62')]('team_has_mail_queues','tq')[_0x0f9e('0x63')](_0x0f9e('0x64'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x0f9e('0x65'),_0x51f5c3[_0x0f9e('0x2b')]['id']);for(var _0x1841a9=0x0;_0x1841a9<_0x472d72[_0x0f9e('0x33')];_0x1841a9+=0x1){let _0x2dcf82=_0x472d72[_0x1841a9];for(var _0x22e421=0x0;_0x22e421<_0x2dcf82[_0x0f9e('0x55')][_0x0f9e('0x33')];_0x22e421+=0x1){let _0x1b8899=_0x2dcf82['Agents'][_0x22e421];var _0x41f7df=_0x34d011['clone']();_0x41f7df[_0x0f9e('0x26')](_0x0f9e('0x66'),_0x1b8899['id']);_0x4be465[_0x0f9e('0x67')](db[_0x0f9e('0x59')]['query'](_0x41f7df[_0x0f9e('0x68')](),{'type':db['sequelize'][_0x0f9e('0x69')][_0x0f9e('0x6a')]})[_0x0f9e('0x17')](function(_0x42294e){if(_0x42294e[_0x0f9e('0x33')]===0x1){return _0x1b8899['id'];}else{var _0x2930b8=_[_0x0f9e('0x6b')](_[_0x0f9e('0x1f')](_0x42294e,_0x0f9e('0x6c')),function(_0x36f5d3){return _['includes'](_0xb5bb20,_0x36f5d3);});if(_0x2930b8){return _0x1b8899['id'];}}}));}}return BPromise[_0x0f9e('0x6d')](_0x4be465)[_0x0f9e('0x17')](function(_0x4374f4){_0x291c25=_(_0x291c25)[_0x0f9e('0x6e')](_0x4374f4)[_0x0f9e('0x6f')]()[_0x0f9e('0x70')]();return db['MailQueue'][_0x0f9e('0x36')]({'where':{'id':_0x51f5c3['params']['id']}})[_0x0f9e('0x17')](function(_0x626590){return db['sequelize'][_0x0f9e('0x5a')](function(_0x498fd6){return _0x626590[_0x0f9e('0x71')](_0x51f5c3[_0x0f9e('0x2e')][_0x0f9e('0x53')],{'transaction':_0x498fd6})['then'](function(){if(!_[_0x0f9e('0x72')](_0x291c25)){return _0x626590['removeAgents'](_0x291c25,{'transaction':_0x498fd6});}})[_0x0f9e('0x17')](function(){_0x291c25['forEach'](function(_0xe833f1){socket['emit'](_0x0f9e('0x73'),{'UserId':_0xe833f1,'MailQueueId':_0x626590['id']});});});});});});})[_0x0f9e('0x17')](respondWithStatusCode(_0x1bbb01,null))[_0x0f9e('0x2a')](handleError(_0x1bbb01,null));};exports[_0x0f9e('0x74')]=function(_0x158885,_0x5dc6cf){return db[_0x0f9e('0x20')][_0x0f9e('0x36')]({'where':{'id':_0x158885[_0x0f9e('0x2b')]['id']}})[_0x0f9e('0x17')](handleEntityNotFound(_0x5dc6cf,null))[_0x0f9e('0x17')](function(_0x38a554){if(_0x38a554){return _0x38a554[_0x0f9e('0x74')](_0x158885[_0x0f9e('0x38')][_0x0f9e('0x53')],_['omit'](_0x158885[_0x0f9e('0x38')],[_0x0f9e('0x53'),'id'])||{})[_0x0f9e('0x75')](function(_0x2d4f39){for(var _0x155f16=0x0;_0x155f16<_0x158885[_0x0f9e('0x38')]['ids'][_0x0f9e('0x33')];_0x155f16+=0x1){socket[_0x0f9e('0x76')](_0x0f9e('0x5f'),{'UserId':Number(_0x158885['body'][_0x0f9e('0x53')][_0x155f16]),'MailQueueId':Number(_0x158885['params']['id'])});}return _0x2d4f39;});}})[_0x0f9e('0x17')](respondWithResult(_0x5dc6cf,null))[_0x0f9e('0x2a')](handleError(_0x5dc6cf,null));};exports[_0x0f9e('0x77')]=function(_0x1a3962,_0x558365){return db[_0x0f9e('0x20')][_0x0f9e('0x36')]({'where':{'id':_0x1a3962[_0x0f9e('0x2b')]['id']}})[_0x0f9e('0x17')](handleEntityNotFound(_0x558365,null))[_0x0f9e('0x17')](function(_0x40942d){if(_0x40942d){return _0x40942d[_0x0f9e('0x77')](_0x1a3962['query'][_0x0f9e('0x53')])[_0x0f9e('0x17')](function(){if(_['isArray'](_0x1a3962[_0x0f9e('0x2e')][_0x0f9e('0x53')])){for(var _0x2eb745=0x0;_0x2eb745<_0x1a3962[_0x0f9e('0x2e')][_0x0f9e('0x53')][_0x0f9e('0x33')];_0x2eb745+=0x1){socket[_0x0f9e('0x76')](_0x0f9e('0x73'),{'UserId':Number(_0x1a3962['query'][_0x0f9e('0x53')][_0x2eb745]),'MailQueueId':Number(_0x1a3962['params']['id'])});}}else{socket['emit'](_0x0f9e('0x73'),{'UserId':Number(_0x1a3962[_0x0f9e('0x2e')]['ids']),'MailQueueId':Number(_0x1a3962['params']['id'])});}});}})['then'](respondWithStatusCode(_0x558365,null))[_0x0f9e('0x2a')](handleError(_0x558365,null));};exports[_0x0f9e('0x78')]=function(_0x52e6cf,_0x3f0614){var _0x4dffbb={};var _0x30826d={};var _0x1f6dfe;var _0x115ee1;return db[_0x0f9e('0x20')]['findOne']({'where':{'id':_0x52e6cf[_0x0f9e('0x2b')]['id']}})[_0x0f9e('0x17')](handleEntityNotFound(_0x3f0614,null))['then'](function(_0x3f799e){if(_0x3f799e){_0x1f6dfe=_0x3f799e;_0x30826d[_0x0f9e('0x2c')]=_['keys'](db[_0x0f9e('0x54')][_0x0f9e('0x21')]);_0x30826d[_0x0f9e('0x2e')]=_['keys'](_0x52e6cf[_0x0f9e('0x2e')]);_0x30826d[_0x0f9e('0x2f')]=_['intersection'](_0x30826d[_0x0f9e('0x2c')],_0x30826d[_0x0f9e('0x2e')]);_0x4dffbb['attributes']=_[_0x0f9e('0x30')](_0x30826d[_0x0f9e('0x2c')],qs[_0x0f9e('0x32')](_0x52e6cf['query'][_0x0f9e('0x32')]));_0x4dffbb[_0x0f9e('0x31')]=_0x4dffbb[_0x0f9e('0x31')]['length']?_0x4dffbb[_0x0f9e('0x31')]:_0x30826d[_0x0f9e('0x2c')];_0x4dffbb['order']=qs['sort'](_0x52e6cf[_0x0f9e('0x2e')][_0x0f9e('0x45')]);_0x4dffbb[_0x0f9e('0x26')]=qs[_0x0f9e('0x2f')](_[_0x0f9e('0x52')](_0x52e6cf['query'],_0x30826d[_0x0f9e('0x2f')]));if(_0x52e6cf['query'][_0x0f9e('0x47')]){_0x4dffbb[_0x0f9e('0x26')]=_['merge'](_0x4dffbb[_0x0f9e('0x26')],{'$or':_[_0x0f9e('0x1f')](_0x4dffbb[_0x0f9e('0x31')],function(_0x58786a){var _0x519c69={};_0x519c69[_0x58786a]={'$like':'%'+_0x52e6cf[_0x0f9e('0x2e')][_0x0f9e('0x47')]+'%'};return _0x519c69;})});}_0x4dffbb=_['merge']({},_0x4dffbb,_0x52e6cf['options']);return _0x1f6dfe[_0x0f9e('0x78')](_0x4dffbb);}})[_0x0f9e('0x17')](function(_0x48e186){if(_0x48e186){_0x115ee1=_0x48e186[_0x0f9e('0x33')];if(!_0x52e6cf[_0x0f9e('0x2e')]['hasOwnProperty']('nolimit')){_0x4dffbb[_0x0f9e('0x13')]=qs[_0x0f9e('0x13')](_0x52e6cf[_0x0f9e('0x2e')][_0x0f9e('0x13')]);_0x4dffbb[_0x0f9e('0x10')]=qs[_0x0f9e('0x10')](_0x52e6cf[_0x0f9e('0x2e')][_0x0f9e('0x10')]);}return _0x1f6dfe[_0x0f9e('0x78')](_0x4dffbb);}})[_0x0f9e('0x17')](function(_0x1c0ef7){if(_0x1c0ef7){return _0x1c0ef7?{'count':_0x115ee1,'rows':_0x1c0ef7}:null;}})[_0x0f9e('0x17')](respondWithResult(_0x3f0614,null))['catch'](handleError(_0x3f0614,null));}; \ No newline at end of file +var _0x1746=['updatedAt','createdAt','format','%s/%s','getTeams','Team','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','findOrCreate','userMailQueue:save','ids','User','select','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','removeTeams','isEmpty','emit','addAgents','spread','removeAgents','isArray','userMailQueue:remove','getAgents','order','nolimit','bluebird','util','lodash','squel','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','status','offset','undefined','limit','count','set','update','destroy','then','MailQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','rows','show','keys','filters','intersection','attributes','model','fields','length','includeAll','merge','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','sort','pick','MailQueueId','filter','findAndCountAll','UserId','agent','mailPause'];(function(_0x34bf51,_0x3aae95){var _0x2326cb=function(_0x3d3d0f){while(--_0x3d3d0f){_0x34bf51['push'](_0x34bf51['shift']());}};_0x2326cb(++_0x3aae95);}(_0x1746,0x11b));var _0x6174=function(_0x4d278e,_0x2621d3){_0x4d278e=_0x4d278e-0x0;var _0x598224=_0x1746[_0x4d278e];return _0x598224;};'use strict';var BPromise=require(_0x6174('0x0'));var util=require(_0x6174('0x1'));var _=require(_0x6174('0x2'));var squel=require(_0x6174('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x6174('0x4'))(_0x6174('0x5'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x6174('0x6')]=_[_0x6174('0x7')](config[_0x6174('0x6')],{'host':_0x6174('0x8'),'port':0x18eb});var socket=require(_0x6174('0x9'))(new Redis(config[_0x6174('0x6')]));require('./mailQueue.socket')[_0x6174('0xa')](socket);function respondWithStatusCode(_0x55dd88,_0x482986){_0x482986=_0x482986||0xcc;return function(_0x4ea478){if(_0x4ea478){return _0x55dd88['sendStatus'](_0x482986);}return _0x55dd88[_0x6174('0xb')](_0x482986)['end']();};}function respondWithResult(_0x13430d,_0x24aafe){_0x24aafe=_0x24aafe||0xc8;return function(_0x5e12a6){if(_0x5e12a6){return _0x13430d['status'](_0x24aafe)['json'](_0x5e12a6);}};}function respondWithFilteredResult(_0x16490b,_0x597b53){return function(_0x4adfd7){if(_0x4adfd7){var _0x351e2b=typeof _0x597b53[_0x6174('0xc')]===_0x6174('0xd')&&typeof _0x597b53[_0x6174('0xe')]==='undefined';var _0x1a27cc=_0x4adfd7[_0x6174('0xf')];var _0x4f2e23=_0x351e2b?0x0:_0x597b53['offset'];var _0x5512a2=_0x351e2b?_0x4adfd7[_0x6174('0xf')]:_0x597b53[_0x6174('0xc')]+_0x597b53[_0x6174('0xe')];var _0x1e9f9c;if(_0x5512a2>=_0x1a27cc){_0x5512a2=_0x1a27cc;_0x1e9f9c=0xc8;}else{_0x1e9f9c=0xce;}_0x16490b[_0x6174('0xb')](_0x1e9f9c);return _0x16490b[_0x6174('0x10')]('Content-Range',_0x4f2e23+'-'+_0x5512a2+'/'+_0x1a27cc)['json'](_0x4adfd7);}return null;};}function saveUpdates(_0x330637){return function(_0x5891e8){if(_0x5891e8){return _0x5891e8[_0x6174('0x11')](_0x330637)['then'](function(_0x3e67b8){return _0x3e67b8;});}return null;};}function removeEntity(_0x4ad3e1){return function(_0x3d649c){if(_0x3d649c){return _0x3d649c[_0x6174('0x12')]()[_0x6174('0x13')](function(){var _0x21b9a5=_0x3d649c['get']({'plain':!![]});var _0x4d55b8=_0x6174('0x14');return db[_0x6174('0x15')][_0x6174('0x12')]({'where':{'type':_0x4d55b8,'resourceId':_0x21b9a5['id']}})[_0x6174('0x13')](function(){return _0x3d649c;});})[_0x6174('0x13')](function(){_0x4ad3e1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c226f){return function(_0x58b073){if(!_0x58b073){_0x2c226f[_0x6174('0x16')](0x194);}return _0x58b073;};}function handleError(_0x2e061d,_0x53212b){_0x53212b=_0x53212b||0x1f4;return function(_0x43b162){logger[_0x6174('0x17')](_0x43b162[_0x6174('0x18')]);if(_0x43b162[_0x6174('0x19')]){delete _0x43b162[_0x6174('0x19')];}_0x2e061d['status'](_0x53212b)[_0x6174('0x1a')](_0x43b162);};}exports[_0x6174('0x1b')]=function(_0x3b1fbf,_0x14ad73){var _0x847b6d={};var _0x277963={'count':0x0,'rows':[]};var _0x5a165d=_[_0x6174('0x1c')](db[_0x6174('0x1d')][_0x6174('0x1e')],function(_0x1a7c9f){return{'name':_0x1a7c9f[_0x6174('0x1f')],'type':_0x1a7c9f['type'][_0x6174('0x20')]};});_0x847b6d=qs[_0x6174('0x21')](_0x5a165d,_0x3b1fbf);var _0x89c84c={'where':_0x847b6d[_0x6174('0x22')]};return db[_0x6174('0x1d')][_0x6174('0xf')](_0x89c84c)[_0x6174('0x13')](function(_0x3c58cc){_0x277963[_0x6174('0xf')]=_0x3c58cc;_0x847b6d[_0x6174('0x23')]=qs[_0x6174('0x23')](_0x3b1fbf[_0x6174('0x24')]);return db[_0x6174('0x1d')][_0x6174('0x25')](_0x847b6d);})[_0x6174('0x13')](function(_0x442386){_0x277963[_0x6174('0x26')]=_0x442386;return _0x277963;})[_0x6174('0x13')](respondWithFilteredResult(_0x14ad73,_0x847b6d))['catch'](handleError(_0x14ad73,null));};exports[_0x6174('0x27')]=function(_0x57cb27,_0x2f0ec6){var _0x2e1442={'raw':!![],'where':{'id':_0x57cb27['params']['id']}},_0x577d62={};_0x577d62['model']=_['keys'](db['MailQueue'][_0x6174('0x1e')]);_0x577d62[_0x6174('0x24')]=_[_0x6174('0x28')](_0x57cb27[_0x6174('0x24')]);_0x577d62[_0x6174('0x29')]=_[_0x6174('0x2a')](_0x577d62['model'],_0x577d62[_0x6174('0x24')]);_0x2e1442[_0x6174('0x2b')]=_[_0x6174('0x2a')](_0x577d62[_0x6174('0x2c')],qs[_0x6174('0x2d')](_0x57cb27[_0x6174('0x24')]['fields']));_0x2e1442[_0x6174('0x2b')]=_0x2e1442[_0x6174('0x2b')][_0x6174('0x2e')]?_0x2e1442[_0x6174('0x2b')]:_0x577d62['model'];if(_0x57cb27['query'][_0x6174('0x2f')]){_0x2e1442[_0x6174('0x23')]=[{'all':!![]}];}_0x2e1442=_[_0x6174('0x30')]({},_0x2e1442,_0x57cb27[_0x6174('0x31')]);return db[_0x6174('0x1d')][_0x6174('0x32')](_0x2e1442)[_0x6174('0x13')](handleEntityNotFound(_0x2f0ec6,null))['then'](respondWithResult(_0x2f0ec6,null))[_0x6174('0x33')](handleError(_0x2f0ec6,null));};exports[_0x6174('0x34')]=function(_0x413fa5,_0x23f31b){return db[_0x6174('0x1d')][_0x6174('0x34')](_0x413fa5[_0x6174('0x35')],{})[_0x6174('0x13')](function(_0x52fd15){var _0x4e4d74=_0x413fa5[_0x6174('0x36')]['get']({'plain':!![]});if(!_0x4e4d74)throw new Error(_0x6174('0x37'));if(_0x4e4d74[_0x6174('0x38')]===_0x6174('0x36')){var _0x5de927=_0x52fd15[_0x6174('0x39')]({'plain':!![]});var _0x14c60a=_0x6174('0x14');return db['UserProfileSection'][_0x6174('0x32')]({'where':{'name':_0x14c60a,'userProfileId':_0x4e4d74['userProfileId']},'raw':!![]})[_0x6174('0x13')](function(_0x21550d){if(_0x21550d&&_0x21550d[_0x6174('0x3a')]===0x0){return db['UserProfileResource']['create']({'name':_0x5de927[_0x6174('0x19')],'resourceId':_0x5de927['id'],'type':_0x21550d[_0x6174('0x19')],'sectionId':_0x21550d['id']},{})[_0x6174('0x13')](function(){return _0x52fd15;});}else{return _0x52fd15;}})[_0x6174('0x33')](function(_0x2b3308){logger['error'](_0x6174('0x3b'),_0x2b3308);throw _0x2b3308;});}return _0x52fd15;})[_0x6174('0x13')](respondWithResult(_0x23f31b,0xc9))[_0x6174('0x33')](handleError(_0x23f31b,null));};exports['update']=function(_0x24b047,_0x302513){if(_0x24b047[_0x6174('0x35')]['id']){delete _0x24b047[_0x6174('0x35')]['id'];}return db[_0x6174('0x1d')][_0x6174('0x32')]({'where':{'id':_0x24b047[_0x6174('0x3c')]['id']}})['then'](handleEntityNotFound(_0x302513,null))[_0x6174('0x13')](saveUpdates(_0x24b047[_0x6174('0x35')],null))['then'](respondWithResult(_0x302513,null))['catch'](handleError(_0x302513,null));};exports[_0x6174('0x12')]=function(_0x348805,_0x20ea30){return db[_0x6174('0x1d')][_0x6174('0x32')]({'where':{'id':_0x348805['params']['id']}})['then'](handleEntityNotFound(_0x20ea30,null))[_0x6174('0x13')](removeEntity(_0x20ea30,null))['catch'](handleError(_0x20ea30,null));};exports['describe']=function(_0x26497b,_0x3033e2){return db[_0x6174('0x1d')][_0x6174('0x3d')]()[_0x6174('0x13')](respondWithResult(_0x3033e2,null))[_0x6174('0x33')](handleError(_0x3033e2,null));};exports[_0x6174('0x3e')]=function(_0x52d013,_0x59e629){var _0x49b9fd={'raw':!![],'where':{}},_0x202df5={},_0x46905d;return db[_0x6174('0x1d')][_0x6174('0x3f')]({'where':{'id':_0x52d013[_0x6174('0x3c')]['id']}})[_0x6174('0x13')](handleEntityNotFound(_0x59e629,null))['then'](function(_0x26cf5c){if(_0x26cf5c){_0x46905d=_0x26cf5c['get']({'plain':!![]});_0x202df5[_0x6174('0x2c')]=_[_0x6174('0x28')](db[_0x6174('0x40')][_0x6174('0x1e')]);_0x202df5[_0x6174('0x24')]=_[_0x6174('0x28')](_0x52d013[_0x6174('0x24')]);_0x202df5[_0x6174('0x29')]=_['intersection'](_0x202df5['model'],_0x202df5[_0x6174('0x24')]);_0x49b9fd['attributes']=_['intersection'](_0x202df5['model'],qs[_0x6174('0x2d')](_0x52d013[_0x6174('0x24')][_0x6174('0x2d')]));_0x49b9fd[_0x6174('0x2b')]=_0x49b9fd[_0x6174('0x2b')][_0x6174('0x2e')]?_0x49b9fd[_0x6174('0x2b')]:_0x202df5[_0x6174('0x2c')];if(!_0x52d013[_0x6174('0x24')][_0x6174('0x41')]('nolimit')){_0x49b9fd['limit']=qs[_0x6174('0xe')](_0x52d013[_0x6174('0x24')]['limit']);_0x49b9fd[_0x6174('0xc')]=qs[_0x6174('0xc')](_0x52d013[_0x6174('0x24')][_0x6174('0xc')]);}_0x49b9fd['order']=qs[_0x6174('0x42')](_0x52d013[_0x6174('0x24')][_0x6174('0x42')]);_0x49b9fd[_0x6174('0x22')]=qs[_0x6174('0x29')](_[_0x6174('0x43')](_0x52d013[_0x6174('0x24')],_0x202df5['filters']));_0x49b9fd[_0x6174('0x22')][_0x6174('0x44')]=_0x26cf5c['id'];if(_0x52d013[_0x6174('0x24')][_0x6174('0x45')]){_0x49b9fd[_0x6174('0x22')]=_[_0x6174('0x30')](_0x49b9fd['where'],{'$or':_[_0x6174('0x1c')](_0x49b9fd['attributes'],function(_0x2b7365){var _0x4331a1={};_0x4331a1[_0x2b7365]={'$like':'%'+_0x52d013['query'][_0x6174('0x45')]+'%'};return _0x4331a1;})});}_0x49b9fd=_[_0x6174('0x30')]({},_0x49b9fd,_0x52d013[_0x6174('0x31')]);return db[_0x6174('0x40')][_0x6174('0x25')](_0x49b9fd);}})[_0x6174('0x13')](function(_0x481a32){if(_0x481a32){return db['User'][_0x6174('0x46')]({'where':{'id':_[_0x6174('0x1c')](_0x481a32,_0x6174('0x47')),'role':_0x6174('0x48')},'attributes':['id','name',_0x6174('0x49'),_0x6174('0x4a'),_0x6174('0x4b')]});}})[_0x6174('0x13')](function(_0xbf81f8){if(_0xbf81f8){return{'count':_0xbf81f8[_0x6174('0xf')],'rows':_[_0x6174('0x1c')](_0xbf81f8[_0x6174('0x26')],function(_0x5f0c3f){return{'membername':_0x5f0c3f[_0x6174('0x19')],'UserId':_0x5f0c3f['id'],'queue_name':_0x46905d[_0x6174('0x19')],'MailQueueId':_0x46905d['id'],'interface':util[_0x6174('0x4c')](_0x6174('0x4d'),'SIP',_0x5f0c3f[_0x6174('0x19')]),'penalty':0x0,'paused':_0x5f0c3f[_0x6174('0x49')],'createdAt':_0x5f0c3f[_0x6174('0x4b')],'updatedAt':_0x5f0c3f[_0x6174('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6174('0x13')](respondWithFilteredResult(_0x59e629,_0x49b9fd))[_0x6174('0x33')](handleError(_0x59e629,null));};exports[_0x6174('0x4e')]=function(_0x30f8a5,_0xbbb7ad){var _0x3f8c6b={};var _0x2ec815={};var _0x34b1a9;var _0x18010c;return db[_0x6174('0x1d')][_0x6174('0x3f')]({'where':{'id':_0x30f8a5['params']['id']}})[_0x6174('0x13')](handleEntityNotFound(_0xbbb7ad,null))[_0x6174('0x13')](function(_0x1fcdd1){if(_0x1fcdd1){_0x34b1a9=_0x1fcdd1;_0x2ec815[_0x6174('0x2c')]=_[_0x6174('0x28')](db[_0x6174('0x4f')][_0x6174('0x1e')]);_0x2ec815[_0x6174('0x24')]=_[_0x6174('0x28')](_0x30f8a5['query']);_0x2ec815[_0x6174('0x29')]=_['intersection'](_0x2ec815['model'],_0x2ec815['query']);_0x3f8c6b[_0x6174('0x2b')]=_['intersection'](_0x2ec815[_0x6174('0x2c')],qs['fields'](_0x30f8a5[_0x6174('0x24')][_0x6174('0x2d')]));_0x3f8c6b[_0x6174('0x2b')]=_0x3f8c6b['attributes']['length']?_0x3f8c6b['attributes']:_0x2ec815[_0x6174('0x2c')];_0x3f8c6b['order']=qs[_0x6174('0x42')](_0x30f8a5[_0x6174('0x24')][_0x6174('0x42')]);_0x3f8c6b[_0x6174('0x22')]=qs[_0x6174('0x29')](_[_0x6174('0x43')](_0x30f8a5['query'],_0x2ec815[_0x6174('0x29')]));if(_0x30f8a5[_0x6174('0x24')]['filter']){_0x3f8c6b[_0x6174('0x22')]=_[_0x6174('0x30')](_0x3f8c6b[_0x6174('0x22')],{'$or':_['map'](_0x3f8c6b[_0x6174('0x2b')],function(_0x88ef62){var _0x86f5d1={};_0x86f5d1[_0x88ef62]={'$like':'%'+_0x30f8a5[_0x6174('0x24')]['filter']+'%'};return _0x86f5d1;})});}_0x3f8c6b=_[_0x6174('0x30')]({},_0x3f8c6b,_0x30f8a5['options']);return _0x34b1a9[_0x6174('0x4e')](_0x3f8c6b);}})[_0x6174('0x13')](function(_0x12f359){if(_0x12f359){_0x18010c=_0x12f359[_0x6174('0x2e')];if(!_0x30f8a5[_0x6174('0x24')][_0x6174('0x41')]('nolimit')){_0x3f8c6b['limit']=qs[_0x6174('0xe')](_0x30f8a5[_0x6174('0x24')]['limit']);_0x3f8c6b[_0x6174('0xc')]=qs['offset'](_0x30f8a5['query'][_0x6174('0xc')]);}return _0x34b1a9[_0x6174('0x4e')](_0x3f8c6b);}})[_0x6174('0x13')](function(_0x98e758){if(_0x98e758){return _0x98e758?{'count':_0x18010c,'rows':_0x98e758}:null;}})[_0x6174('0x13')](respondWithResult(_0xbbb7ad,null))[_0x6174('0x33')](handleError(_0xbbb7ad,null));};exports['addTeams']=function(_0x5c7364,_0x2d4438){var _0x40141c=_0x5c7364['body']['ids'];return db[_0x6174('0x4f')][_0x6174('0x25')]({'where':{'id':_0x40141c},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6174('0x50'),'attributes':['id','name',_0x6174('0x51'),_0x6174('0x52'),_0x6174('0x53')],'raw':!![]}]})[_0x6174('0x13')](function(_0x4cdbc3){if(_0x4cdbc3){var _0x2502a8=_[_0x6174('0x54')](_0x4cdbc3,function(_0x59a909){var _0x3252fa=_0x59a909[_0x6174('0x39')]({'plain':!![]});return _0x3252fa['Agents'];});return db[_0x6174('0x1d')][_0x6174('0x32')]({'where':{'id':_0x5c7364[_0x6174('0x3c')]['id']}})[_0x6174('0x13')](function(_0x8ddef){return db['sequelize'][_0x6174('0x55')](function(_0x149951){return _0x8ddef[_0x6174('0x56')](_0x40141c,{'transaction':_0x149951})[_0x6174('0x13')](function(){return BPromise[_0x6174('0x57')](_0x2502a8,function(_0x4332e9){return db[_0x6174('0x40')][_0x6174('0x58')]({'where':{'UserId':_0x4332e9['id'],'MailQueueId':_0x5c7364['params']['id']},'transaction':_0x149951});});})['then'](function(){_0x2502a8['forEach'](function(_0x3db508){socket['emit'](_0x6174('0x59'),{'UserId':_0x3db508['id'],'MailQueueId':_0x8ddef['id']});});});});});}})[_0x6174('0x13')](respondWithStatusCode(_0x2d4438,null))[_0x6174('0x33')](handleError(_0x2d4438,null));};exports['removeTeams']=function(_0x2cd4e2,_0x180518){return db[_0x6174('0x4f')][_0x6174('0x25')]({'where':{'id':_0x2cd4e2[_0x6174('0x24')][_0x6174('0x5a')]},'attributes':['id'],'include':[{'model':db[_0x6174('0x5b')],'as':_0x6174('0x50'),'attributes':['id'],'raw':!![]}]})[_0x6174('0x13')](handleEntityNotFound(_0x180518,null))['then'](function(_0xb2a7a5){var _0x3964a1=_[_0x6174('0x1c')](_0xb2a7a5,'id');var _0x1fa629=[];var _0x15c078=[];var _0x3dd006=squel[_0x6174('0x5c')]();_0x3dd006['field']('tq.TeamId')['from']('team_has_mail_queues','tq')[_0x6174('0x5d')](_0x6174('0x5e'),'ut',_0x6174('0x5f'))[_0x6174('0x22')](_0x6174('0x60'),_0x2cd4e2['params']['id']);for(var _0x449d4c=0x0;_0x449d4c<_0xb2a7a5[_0x6174('0x2e')];_0x449d4c+=0x1){let _0x9bd94b=_0xb2a7a5[_0x449d4c];for(var _0x47c95d=0x0;_0x47c95d<_0x9bd94b[_0x6174('0x50')][_0x6174('0x2e')];_0x47c95d+=0x1){let _0x554efa=_0x9bd94b[_0x6174('0x50')][_0x47c95d];var _0x9d7e26=_0x3dd006[_0x6174('0x61')]();_0x9d7e26[_0x6174('0x22')]('ut.UserId\x20=\x20?',_0x554efa['id']);_0x15c078['push'](db[_0x6174('0x62')][_0x6174('0x24')](_0x9d7e26[_0x6174('0x63')](),{'type':db[_0x6174('0x62')][_0x6174('0x64')][_0x6174('0x65')]})[_0x6174('0x13')](function(_0x37db73){if(_0x37db73['length']===0x1){return _0x554efa['id'];}else{var _0x3a60e6=_[_0x6174('0x66')](_[_0x6174('0x1c')](_0x37db73,_0x6174('0x67')),function(_0x5eefb0){return _[_0x6174('0x68')](_0x3964a1,_0x5eefb0);});if(_0x3a60e6){return _0x554efa['id'];}}}));}}return BPromise[_0x6174('0x69')](_0x15c078)[_0x6174('0x13')](function(_0x1b3b55){_0x1fa629=_(_0x1fa629)['union'](_0x1b3b55)[_0x6174('0x6a')]()[_0x6174('0x6b')]();return db['MailQueue'][_0x6174('0x32')]({'where':{'id':_0x2cd4e2[_0x6174('0x3c')]['id']}})['then'](function(_0x2e0343){return db[_0x6174('0x62')][_0x6174('0x55')](function(_0x103f01){return _0x2e0343[_0x6174('0x6c')](_0x2cd4e2[_0x6174('0x24')]['ids'],{'transaction':_0x103f01})[_0x6174('0x13')](function(){if(!_[_0x6174('0x6d')](_0x1fa629)){return _0x2e0343['removeAgents'](_0x1fa629,{'transaction':_0x103f01});}})[_0x6174('0x13')](function(){_0x1fa629['forEach'](function(_0x18326b){socket[_0x6174('0x6e')]('userMailQueue:remove',{'UserId':_0x18326b,'MailQueueId':_0x2e0343['id']});});});});});});})[_0x6174('0x13')](respondWithStatusCode(_0x180518,null))[_0x6174('0x33')](handleError(_0x180518,null));};exports[_0x6174('0x6f')]=function(_0x1e9440,_0xd12b84){return db['MailQueue'][_0x6174('0x32')]({'where':{'id':_0x1e9440[_0x6174('0x3c')]['id']}})[_0x6174('0x13')](handleEntityNotFound(_0xd12b84,null))[_0x6174('0x13')](function(_0x9cfade){if(_0x9cfade){return _0x9cfade[_0x6174('0x6f')](_0x1e9440[_0x6174('0x35')]['ids'],_['omit'](_0x1e9440[_0x6174('0x35')],[_0x6174('0x5a'),'id'])||{})[_0x6174('0x70')](function(_0x494626){for(var _0x741230=0x0;_0x741230<_0x1e9440['body'][_0x6174('0x5a')][_0x6174('0x2e')];_0x741230+=0x1){socket[_0x6174('0x6e')](_0x6174('0x59'),{'UserId':Number(_0x1e9440[_0x6174('0x35')][_0x6174('0x5a')][_0x741230]),'MailQueueId':Number(_0x1e9440[_0x6174('0x3c')]['id'])});}return _0x494626;});}})['then'](respondWithResult(_0xd12b84,null))[_0x6174('0x33')](handleError(_0xd12b84,null));};exports[_0x6174('0x71')]=function(_0x32fe87,_0x34ba2a){return db['MailQueue'][_0x6174('0x32')]({'where':{'id':_0x32fe87[_0x6174('0x3c')]['id']}})['then'](handleEntityNotFound(_0x34ba2a,null))['then'](function(_0x12fb1d){if(_0x12fb1d){return _0x12fb1d[_0x6174('0x71')](_0x32fe87['query'][_0x6174('0x5a')])[_0x6174('0x13')](function(){if(_[_0x6174('0x72')](_0x32fe87[_0x6174('0x24')][_0x6174('0x5a')])){for(var _0x1b5c86=0x0;_0x1b5c86<_0x32fe87[_0x6174('0x24')]['ids']['length'];_0x1b5c86+=0x1){socket[_0x6174('0x6e')](_0x6174('0x73'),{'UserId':Number(_0x32fe87[_0x6174('0x24')][_0x6174('0x5a')][_0x1b5c86]),'MailQueueId':Number(_0x32fe87[_0x6174('0x3c')]['id'])});}}else{socket['emit'](_0x6174('0x73'),{'UserId':Number(_0x32fe87[_0x6174('0x24')]['ids']),'MailQueueId':Number(_0x32fe87['params']['id'])});}});}})['then'](respondWithStatusCode(_0x34ba2a,null))[_0x6174('0x33')](handleError(_0x34ba2a,null));};exports[_0x6174('0x74')]=function(_0x173394,_0x1a8027){var _0x26e2d8={};var _0x93afb0={};var _0x5b5b8b;var _0x2d68ba;return db[_0x6174('0x1d')][_0x6174('0x3f')]({'where':{'id':_0x173394[_0x6174('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1a8027,null))[_0x6174('0x13')](function(_0x2d84c5){if(_0x2d84c5){_0x5b5b8b=_0x2d84c5;_0x93afb0[_0x6174('0x2c')]=_[_0x6174('0x28')](db['User'][_0x6174('0x1e')]);_0x93afb0[_0x6174('0x24')]=_['keys'](_0x173394[_0x6174('0x24')]);_0x93afb0[_0x6174('0x29')]=_[_0x6174('0x2a')](_0x93afb0[_0x6174('0x2c')],_0x93afb0[_0x6174('0x24')]);_0x26e2d8['attributes']=_[_0x6174('0x2a')](_0x93afb0[_0x6174('0x2c')],qs[_0x6174('0x2d')](_0x173394['query']['fields']));_0x26e2d8[_0x6174('0x2b')]=_0x26e2d8[_0x6174('0x2b')][_0x6174('0x2e')]?_0x26e2d8[_0x6174('0x2b')]:_0x93afb0['model'];_0x26e2d8[_0x6174('0x75')]=qs['sort'](_0x173394[_0x6174('0x24')]['sort']);_0x26e2d8[_0x6174('0x22')]=qs[_0x6174('0x29')](_[_0x6174('0x43')](_0x173394[_0x6174('0x24')],_0x93afb0['filters']));if(_0x173394[_0x6174('0x24')][_0x6174('0x45')]){_0x26e2d8[_0x6174('0x22')]=_[_0x6174('0x30')](_0x26e2d8['where'],{'$or':_['map'](_0x26e2d8[_0x6174('0x2b')],function(_0x3bcc81){var _0x184008={};_0x184008[_0x3bcc81]={'$like':'%'+_0x173394[_0x6174('0x24')][_0x6174('0x45')]+'%'};return _0x184008;})});}_0x26e2d8=_[_0x6174('0x30')]({},_0x26e2d8,_0x173394[_0x6174('0x31')]);return _0x5b5b8b[_0x6174('0x74')](_0x26e2d8);}})[_0x6174('0x13')](function(_0x35f41f){if(_0x35f41f){_0x2d68ba=_0x35f41f['length'];if(!_0x173394[_0x6174('0x24')]['hasOwnProperty'](_0x6174('0x76'))){_0x26e2d8['limit']=qs[_0x6174('0xe')](_0x173394['query']['limit']);_0x26e2d8['offset']=qs[_0x6174('0xc')](_0x173394[_0x6174('0x24')][_0x6174('0xc')]);}return _0x5b5b8b['getAgents'](_0x26e2d8);}})[_0x6174('0x13')](function(_0x32fd7f){if(_0x32fd7f){return _0x32fd7f?{'count':_0x2d68ba,'rows':_0x32fd7f}:null;}})[_0x6174('0x13')](respondWithResult(_0x1a8027,null))[_0x6174('0x33')](handleError(_0x1a8027,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 6ae335f..78b0b30 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 _0x04e5=['hasOwnProperty','hook','../../mysqldb','MailQueue','save','update','remove','emit'];(function(_0x149083,_0x4047b6){var _0x4dc74e=function(_0x1211f9){while(--_0x1211f9){_0x149083['push'](_0x149083['shift']());}};_0x4dc74e(++_0x4047b6);}(_0x04e5,0x182));var _0x504e=function(_0xcb8e20,_0xdac3f0){_0xcb8e20=_0xcb8e20-0x0;var _0x128da8=_0x04e5[_0xcb8e20];return _0x128da8;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x504e('0x0'))['db'][_0x504e('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x504e('0x2'),'afterUpdate':_0x504e('0x3'),'afterDestroy':_0x504e('0x4')};function emitEvent(_0x5a8d88){return function(_0x4107c0,_0x43f64e,_0x210d80){MailQueueEvents[_0x504e('0x5')](_0x5a8d88+':'+_0x4107c0['id'],_0x4107c0);MailQueueEvents[_0x504e('0x5')](_0x5a8d88,_0x4107c0);_0x210d80(null);};}for(var e in events){if(events[_0x504e('0x6')](e)){var event=events[e];MailQueue[_0x504e('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0xf732=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailQueue','setMaxListeners','update'];(function(_0x2918e1,_0x9613bc){var _0x2f5165=function(_0x12d6e2){while(--_0x12d6e2){_0x2918e1['push'](_0x2918e1['shift']());}};_0x2f5165(++_0x9613bc);}(_0xf732,0x67));var _0x2f73=function(_0x582d37,_0xc34a90){_0x582d37=_0x582d37-0x0;var _0x4aa6b6=_0xf732[_0x582d37];return _0x4aa6b6;};'use strict';var EventEmitter=require(_0x2f73('0x0'));var MailQueue=require(_0x2f73('0x1'))['db'][_0x2f73('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x2f73('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2f73('0x4'),'afterDestroy':_0x2f73('0x5')};function emitEvent(_0x1168f7){return function(_0x1aeb9d,_0x5b010b,_0xfcc901){MailQueueEvents[_0x2f73('0x6')](_0x1168f7+':'+_0x1aeb9d['id'],_0x1aeb9d);MailQueueEvents[_0x2f73('0x6')](_0x1168f7,_0x1aeb9d);_0xfcc901(null);};}for(var e in events){if(events[_0x2f73('0x7')](e)){var event=events[e];MailQueue[_0x2f73('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 07ae731..562578c 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 _0x6f2a=['define','MailQueue','mail_queues','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0x517de5,_0x3625a1){var _0x369d04=function(_0xc38c6e){while(--_0xc38c6e){_0x517de5['push'](_0x517de5['shift']());}};_0x369d04(++_0x3625a1);}(_0x6f2a,0x153));var _0xa6f2=function(_0x4fdff8,_0x301af4){_0x4fdff8=_0x4fdff8-0x0;var _0x1ecc6f=_0x6f2a[_0x4fdff8];return _0x1ecc6f;};'use strict';var _=require(_0xa6f2('0x0'));var util=require(_0xa6f2('0x1'));var logger=require(_0xa6f2('0x2'))(_0xa6f2('0x3'));var moment=require('moment');var BPromise=require(_0xa6f2('0x4'));var rp=require(_0xa6f2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa6f2('0x6'));var config=require(_0xa6f2('0x7'));var attributes=require(_0xa6f2('0x8'));module['exports']=function(_0x2906ba,_0x49229c){return _0x2906ba[_0xa6f2('0x9')](_0xa6f2('0xa'),attributes,{'tableName':_0xa6f2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6873=['../../config/logger','api','bluebird','request-promise','exports','define','MailQueue','util'];(function(_0x10b48a,_0x1a0a3f){var _0x2c4533=function(_0x5e4be6){while(--_0x5e4be6){_0x10b48a['push'](_0x10b48a['shift']());}};_0x2c4533(++_0x1a0a3f);}(_0x6873,0x1ef));var _0x3687=function(_0x592e40,_0x2ed011){_0x592e40=_0x592e40-0x0;var _0x5d4288=_0x6873[_0x592e40];return _0x5d4288;};'use strict';var _=require('lodash');var util=require(_0x3687('0x0'));var logger=require(_0x3687('0x1'))(_0x3687('0x2'));var moment=require('moment');var BPromise=require(_0x3687('0x3'));var rp=require(_0x3687('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0x3687('0x5')]=function(_0xb66a7,_0x2cd366){return _0xb66a7[_0x3687('0x6')](_0x3687('0x7'),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 6a59a5e..736068a 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 _0x9e6f=['jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','limit','include','map','model','attributes','stringify','find','ShowMailQueue','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x282d1f,_0x42e463){var _0x12c2af=function(_0x383a3d){while(--_0x383a3d){_0x282d1f['push'](_0x282d1f['shift']());}};_0x12c2af(++_0x42e463);}(_0x9e6f,0x76));var _0xf9e6=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9e6f[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0xf9e6('0x0'));var util=require('util');var moment=require(_0xf9e6('0x1'));var BPromise=require(_0xf9e6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf9e6('0x3'))['db'];var utils=require(_0xf9e6('0x4'));var logger=require(_0xf9e6('0x5'))(_0xf9e6('0x6'));var config=require(_0xf9e6('0x7'));var jayson=require(_0xf9e6('0x8'));var client=jayson[_0xf9e6('0x9')][_0xf9e6('0xa')]({'port':0x232a});config['redis']=_[_0xf9e6('0xb')](config[_0xf9e6('0xc')],{'host':_0xf9e6('0xd'),'port':0x18eb});var socket=require(_0xf9e6('0xe'))(new Redis(config[_0xf9e6('0xc')]));require(_0xf9e6('0xf'))[_0xf9e6('0x10')](socket);function respondWithRpcPromise(_0x5234e8,_0x297557,_0x5cb500){return new BPromise(function(_0x54135c,_0x21169a){return client[_0xf9e6('0x11')](_0x5234e8,_0x5cb500)[_0xf9e6('0x12')](function(_0x17c13c){logger[_0xf9e6('0x13')](_0xf9e6('0x14'),_0x297557,_0xf9e6('0x15'));logger[_0xf9e6('0x16')](_0xf9e6('0x17'),_0x297557,_0xf9e6('0x15'),JSON['stringify'](_0x17c13c));if(_0x17c13c[_0xf9e6('0x18')]){if(_0x17c13c[_0xf9e6('0x18')]['code']===0x1f4){logger[_0xf9e6('0x18')](_0xf9e6('0x14'),_0x297557,_0x17c13c['error'][_0xf9e6('0x19')]);return _0x21169a(_0x17c13c['error'][_0xf9e6('0x19')]);}logger['error'](_0xf9e6('0x14'),_0x297557,_0x17c13c[_0xf9e6('0x18')][_0xf9e6('0x19')]);return _0x54135c(_0x17c13c[_0xf9e6('0x18')]['message']);}else{logger[_0xf9e6('0x13')](_0xf9e6('0x14'),_0x297557,_0xf9e6('0x15'));_0x54135c(_0x17c13c[_0xf9e6('0x1a')][_0xf9e6('0x19')]);}})[_0xf9e6('0x1b')](function(_0x53b957){logger[_0xf9e6('0x18')]('MailQueue,\x20%s,\x20%s',_0x297557,_0x53b957);_0x21169a(_0x53b957);});});}exports[_0xf9e6('0x1c')]=function(_0x218660){var _0x47e21a=this;return new Promise(function(_0x4d39c2,_0x63439){return db[_0xf9e6('0x1d')][_0xf9e6('0x1e')]({'raw':_0x218660[_0xf9e6('0x1f')]?_0x218660[_0xf9e6('0x1f')][_0xf9e6('0x20')]===undefined?!![]:![]:!![],'where':_0x218660[_0xf9e6('0x1f')]?_0x218660[_0xf9e6('0x1f')][_0xf9e6('0x21')]||null:null,'attributes':_0x218660[_0xf9e6('0x1f')]?_0x218660['options']['attributes']||null:null,'limit':_0x218660[_0xf9e6('0x1f')]?_0x218660[_0xf9e6('0x1f')][_0xf9e6('0x22')]||null:null,'include':_0x218660[_0xf9e6('0x1f')]?_0x218660[_0xf9e6('0x1f')][_0xf9e6('0x23')]?_['map'](_0x218660[_0xf9e6('0x1f')][_0xf9e6('0x23')],function(_0x144575){return{'model':db[_0x144575['model']],'as':_0x144575['as'],'attributes':_0x144575['attributes'],'include':_0x144575[_0xf9e6('0x23')]?_[_0xf9e6('0x24')](_0x144575[_0xf9e6('0x23')],function(_0x2ea01a){return{'model':db[_0x2ea01a[_0xf9e6('0x25')]],'as':_0x2ea01a['as'],'attributes':_0x2ea01a['attributes'],'include':_0x2ea01a['include']?_[_0xf9e6('0x24')](_0x2ea01a['include'],function(_0x5a07c1){return{'model':db[_0x5a07c1[_0xf9e6('0x25')]],'as':_0x5a07c1['as'],'attributes':_0x5a07c1[_0xf9e6('0x26')]};}):[]};}):[]};}):[]:[]})[_0xf9e6('0x12')](function(_0x1d247d){logger[_0xf9e6('0x13')](_0xf9e6('0x1c'),_0x218660);logger[_0xf9e6('0x16')](_0xf9e6('0x1c'),_0x218660,JSON[_0xf9e6('0x27')](_0x1d247d));_0x4d39c2(_0x1d247d);})[_0xf9e6('0x1b')](function(_0x4b091d){logger[_0xf9e6('0x18')](_0xf9e6('0x1c'),_0x4b091d[_0xf9e6('0x19')],_0x218660);_0x63439(_0x47e21a[_0xf9e6('0x18')](0x1f4,_0x4b091d[_0xf9e6('0x19')]));});});};exports['ShowMailQueue']=function(_0x310842){var _0x25c69c=this;return new Promise(function(_0x54a5f3,_0xabba9d){return db[_0xf9e6('0x1d')][_0xf9e6('0x28')]({'raw':_0x310842[_0xf9e6('0x1f')]?_0x310842[_0xf9e6('0x1f')][_0xf9e6('0x20')]===undefined?!![]:![]:!![],'where':_0x310842[_0xf9e6('0x1f')]?_0x310842[_0xf9e6('0x1f')][_0xf9e6('0x21')]||null:null,'attributes':_0x310842['options']?_0x310842[_0xf9e6('0x1f')][_0xf9e6('0x26')]||null:null,'include':_0x310842[_0xf9e6('0x1f')]?_0x310842[_0xf9e6('0x1f')]['include']?_[_0xf9e6('0x24')](_0x310842[_0xf9e6('0x1f')][_0xf9e6('0x23')],function(_0x4a77e1){return{'model':db[_0x4a77e1[_0xf9e6('0x25')]],'as':_0x4a77e1['as'],'attributes':_0x4a77e1['attributes'],'include':_0x4a77e1[_0xf9e6('0x23')]?_[_0xf9e6('0x24')](_0x4a77e1['include'],function(_0x526f49){return{'model':db[_0x526f49[_0xf9e6('0x25')]],'as':_0x526f49['as'],'attributes':_0x526f49[_0xf9e6('0x26')],'include':_0x526f49[_0xf9e6('0x23')]?_[_0xf9e6('0x24')](_0x526f49['include'],function(_0x56ad28){return{'model':db[_0x56ad28['model']],'as':_0x56ad28['as'],'attributes':_0x56ad28[_0xf9e6('0x26')]};}):[]};}):[]};}):[]:[]})[_0xf9e6('0x12')](function(_0x470f84){logger[_0xf9e6('0x13')](_0xf9e6('0x29'),_0x310842);logger[_0xf9e6('0x16')]('ShowMailQueue',_0x310842,JSON[_0xf9e6('0x27')](_0x470f84));_0x54a5f3(_0x470f84);})['catch'](function(_0x106c4a){logger[_0xf9e6('0x18')](_0xf9e6('0x29'),_0x106c4a[_0xf9e6('0x19')],_0x310842);_0xabba9d(_0x25c69c[_0xf9e6('0x18')](0x1f4,_0x106c4a[_0xf9e6('0x19')]));});});}; \ No newline at end of file +var _0xf996=['../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include','map','model','debug','ShowMailQueue','find','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x1913dd,_0x1bf814){var _0x31852c=function(_0x30aa2d){while(--_0x30aa2d){_0x1913dd['push'](_0x1913dd['shift']());}};_0x31852c(++_0x1bf814);}(_0xf996,0x74));var _0x6f99=function(_0x343e9f,_0x319944){_0x343e9f=_0x343e9f-0x0;var _0x710004=_0xf996[_0x343e9f];return _0x710004;};'use strict';var _=require(_0x6f99('0x0'));var util=require(_0x6f99('0x1'));var moment=require(_0x6f99('0x2'));var BPromise=require('bluebird');var rs=require(_0x6f99('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6f99('0x4'));var logger=require(_0x6f99('0x5'))(_0x6f99('0x6'));var config=require(_0x6f99('0x7'));var jayson=require(_0x6f99('0x8'));var client=jayson[_0x6f99('0x9')][_0x6f99('0xa')]({'port':0x232a});config[_0x6f99('0xb')]=_[_0x6f99('0xc')](config[_0x6f99('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6f99('0xd'))(new Redis(config['redis']));require(_0x6f99('0xe'))[_0x6f99('0xf')](socket);function respondWithRpcPromise(_0x41f436,_0x161b64,_0xf42ba3){return new BPromise(function(_0x2edd9,_0x43b5c0){return client[_0x6f99('0x10')](_0x41f436,_0xf42ba3)[_0x6f99('0x11')](function(_0x509929){logger[_0x6f99('0x12')]('MailQueue,\x20%s,\x20%s',_0x161b64,'request\x20sent');logger['debug'](_0x6f99('0x13'),_0x161b64,_0x6f99('0x14'),JSON[_0x6f99('0x15')](_0x509929));if(_0x509929[_0x6f99('0x16')]){if(_0x509929[_0x6f99('0x16')][_0x6f99('0x17')]===0x1f4){logger[_0x6f99('0x16')](_0x6f99('0x18'),_0x161b64,_0x509929[_0x6f99('0x16')][_0x6f99('0x19')]);return _0x43b5c0(_0x509929[_0x6f99('0x16')][_0x6f99('0x19')]);}logger['error'](_0x6f99('0x18'),_0x161b64,_0x509929[_0x6f99('0x16')]['message']);return _0x2edd9(_0x509929['error'][_0x6f99('0x19')]);}else{logger['info'](_0x6f99('0x18'),_0x161b64,_0x6f99('0x14'));_0x2edd9(_0x509929[_0x6f99('0x1a')][_0x6f99('0x19')]);}})[_0x6f99('0x1b')](function(_0x5bfb51){logger[_0x6f99('0x16')]('MailQueue,\x20%s,\x20%s',_0x161b64,_0x5bfb51);_0x43b5c0(_0x5bfb51);});});}exports[_0x6f99('0x1c')]=function(_0x286edb){var _0x4cfa68=this;return new Promise(function(_0x26cd36,_0x1dc9e5){return db[_0x6f99('0x1d')]['findAll']({'raw':_0x286edb['options']?_0x286edb[_0x6f99('0x1e')][_0x6f99('0x1f')]===undefined?!![]:![]:!![],'where':_0x286edb['options']?_0x286edb['options'][_0x6f99('0x20')]||null:null,'attributes':_0x286edb[_0x6f99('0x1e')]?_0x286edb[_0x6f99('0x1e')][_0x6f99('0x21')]||null:null,'limit':_0x286edb[_0x6f99('0x1e')]?_0x286edb[_0x6f99('0x1e')][_0x6f99('0x22')]||null:null,'include':_0x286edb[_0x6f99('0x1e')]?_0x286edb[_0x6f99('0x1e')][_0x6f99('0x23')]?_[_0x6f99('0x24')](_0x286edb[_0x6f99('0x1e')][_0x6f99('0x23')],function(_0x381e92){return{'model':db[_0x381e92['model']],'as':_0x381e92['as'],'attributes':_0x381e92[_0x6f99('0x21')],'include':_0x381e92[_0x6f99('0x23')]?_['map'](_0x381e92['include'],function(_0x7eef41){return{'model':db[_0x7eef41[_0x6f99('0x25')]],'as':_0x7eef41['as'],'attributes':_0x7eef41['attributes'],'include':_0x7eef41[_0x6f99('0x23')]?_[_0x6f99('0x24')](_0x7eef41['include'],function(_0x45fe22){return{'model':db[_0x45fe22[_0x6f99('0x25')]],'as':_0x45fe22['as'],'attributes':_0x45fe22['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f99('0x11')](function(_0x3ef6c5){logger[_0x6f99('0x12')](_0x6f99('0x1c'),_0x286edb);logger[_0x6f99('0x26')](_0x6f99('0x1c'),_0x286edb,JSON['stringify'](_0x3ef6c5));_0x26cd36(_0x3ef6c5);})[_0x6f99('0x1b')](function(_0x1972f0){logger['error']('GetMailQueue',_0x1972f0[_0x6f99('0x19')],_0x286edb);_0x1dc9e5(_0x4cfa68[_0x6f99('0x16')](0x1f4,_0x1972f0[_0x6f99('0x19')]));});});};exports[_0x6f99('0x27')]=function(_0x1dea2c){var _0x184bbe=this;return new Promise(function(_0x47d721,_0x499926){return db[_0x6f99('0x1d')][_0x6f99('0x28')]({'raw':_0x1dea2c[_0x6f99('0x1e')]?_0x1dea2c[_0x6f99('0x1e')][_0x6f99('0x1f')]===undefined?!![]:![]:!![],'where':_0x1dea2c[_0x6f99('0x1e')]?_0x1dea2c[_0x6f99('0x1e')][_0x6f99('0x20')]||null:null,'attributes':_0x1dea2c[_0x6f99('0x1e')]?_0x1dea2c[_0x6f99('0x1e')][_0x6f99('0x21')]||null:null,'include':_0x1dea2c['options']?_0x1dea2c[_0x6f99('0x1e')][_0x6f99('0x23')]?_[_0x6f99('0x24')](_0x1dea2c[_0x6f99('0x1e')][_0x6f99('0x23')],function(_0x48a1b8){return{'model':db[_0x48a1b8[_0x6f99('0x25')]],'as':_0x48a1b8['as'],'attributes':_0x48a1b8[_0x6f99('0x21')],'include':_0x48a1b8['include']?_[_0x6f99('0x24')](_0x48a1b8[_0x6f99('0x23')],function(_0x46de85){return{'model':db[_0x46de85[_0x6f99('0x25')]],'as':_0x46de85['as'],'attributes':_0x46de85[_0x6f99('0x21')],'include':_0x46de85[_0x6f99('0x23')]?_[_0x6f99('0x24')](_0x46de85[_0x6f99('0x23')],function(_0x56e206){return{'model':db[_0x56e206[_0x6f99('0x25')]],'as':_0x56e206['as'],'attributes':_0x56e206['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f99('0x11')](function(_0x383220){logger[_0x6f99('0x12')](_0x6f99('0x27'),_0x1dea2c);logger['debug'](_0x6f99('0x27'),_0x1dea2c,JSON['stringify'](_0x383220));_0x47d721(_0x383220);})[_0x6f99('0x1b')](function(_0x321515){logger[_0x6f99('0x16')](_0x6f99('0x27'),_0x321515[_0x6f99('0x19')],_0x1dea2c);_0x499926(_0x184bbe[_0x6f99('0x16')](0x1f4,_0x321515[_0x6f99('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index a5ba218..9a1e92d 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 _0x2fe5=['length','./mailQueue.events','save','emit','removeListener','register'];(function(_0x2bcb75,_0x5789a7){var _0x175345=function(_0x3a7d41){while(--_0x3a7d41){_0x2bcb75['push'](_0x2bcb75['shift']());}};_0x175345(++_0x5789a7);}(_0x2fe5,0x14b));var _0x52fe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2fe5[_0x321bb2];return _0x9c12ed;};'use strict';var MailQueueEvents=require(_0x52fe('0x0'));var events=[_0x52fe('0x1'),'remove','update'];function createListener(_0x3c2763,_0x1d8bec){return function(_0x243be8){_0x1d8bec[_0x52fe('0x2')](_0x3c2763,_0x243be8);};}function removeListener(_0xd0dfd1,_0x48ef08){return function(){MailQueueEvents[_0x52fe('0x3')](_0xd0dfd1,_0x48ef08);};}exports[_0x52fe('0x4')]=function(_0x584af7){for(var _0x2efcaa=0x0,_0x157c5a=events[_0x52fe('0x5')];_0x2efcaa<_0x157c5a;_0x2efcaa++){var _0x31b5dd=events[_0x2efcaa];var _0x408cef=createListener('mailQueue:'+_0x31b5dd,_0x584af7);MailQueueEvents['on'](_0x31b5dd,_0x408cef);}}; \ No newline at end of file +var _0x13c9=['remove','removeListener','length','mailQueue:','save'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0x13c9,0x1c1));var _0x913c=function(_0xe0b9a4,_0x10f667){_0xe0b9a4=_0xe0b9a4-0x0;var _0x4520c6=_0x13c9[_0xe0b9a4];return _0x4520c6;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x913c('0x0'),_0x913c('0x1'),'update'];function createListener(_0x635577,_0xfd36cc){return function(_0x193b82){_0xfd36cc['emit'](_0x635577,_0x193b82);};}function removeListener(_0x2cc2ee,_0x14c2c8){return function(){MailQueueEvents[_0x913c('0x2')](_0x2cc2ee,_0x14c2c8);};}exports['register']=function(_0x4b265f){for(var _0x2c4741=0x0,_0x52e125=events[_0x913c('0x3')];_0x2c4741<_0x52e125;_0x2c4741++){var _0x26a913=events[_0x2c4741];var _0x2e6bc7=createListener(_0x913c('0x4')+_0x26a913,_0x4b265f);MailQueueEvents['on'](_0x26a913,_0x2e6bc7);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 4948dd0..796d886 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 _0xe812=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','post','create','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x481a26,_0x13d43e){var _0x4653c7=function(_0x1fb5ae){while(--_0x1fb5ae){_0x481a26['push'](_0x481a26['shift']());}};_0x4653c7(++_0x13d43e);}(_0xe812,0xbf));var _0x2e81=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe812[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x2e81('0x0'));var util=require(_0x2e81('0x1'));var path=require(_0x2e81('0x2'));var timeout=require(_0x2e81('0x3'));var express=require(_0x2e81('0x4'));var router=express[_0x2e81('0x5')]();var fs_extra=require(_0x2e81('0x6'));var auth=require(_0x2e81('0x7'));var interaction=require(_0x2e81('0x8'));var config=require(_0x2e81('0x9'));var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0x2e81('0xa')](),controller[_0x2e81('0xb')]);router['get'](_0x2e81('0xc'),auth[_0x2e81('0xa')](),controller[_0x2e81('0xd')]);router[_0x2e81('0xe')]('/:id',auth[_0x2e81('0xa')](),controller['show']);router[_0x2e81('0xf')]('/',auth[_0x2e81('0xa')](),controller[_0x2e81('0x10')]);router['put']('/:id',auth[_0x2e81('0xa')](),controller[_0x2e81('0x11')]);router[_0x2e81('0x12')](_0x2e81('0x13'),auth[_0x2e81('0xa')](),controller[_0x2e81('0x14')]);module[_0x2e81('0x15')]=router; \ No newline at end of file +var _0xae0f=['get','/describe','isAuthenticated','/:id','create','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','index'];(function(_0x1e8cf1,_0x494b52){var _0x5026d2=function(_0x39876c){while(--_0x39876c){_0x1e8cf1['push'](_0x1e8cf1['shift']());}};_0x5026d2(++_0x494b52);}(_0xae0f,0xa9));var _0xfae0=function(_0x515516,_0x19cafd){_0x515516=_0x515516-0x0;var _0x1ba828=_0xae0f[_0x515516];return _0x1ba828;};'use strict';var multer=require(_0xfae0('0x0'));var util=require(_0xfae0('0x1'));var path=require(_0xfae0('0x2'));var timeout=require(_0xfae0('0x3'));var express=require(_0xfae0('0x4'));var router=express[_0xfae0('0x5')]();var fs_extra=require(_0xfae0('0x6'));var auth=require(_0xfae0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xfae0('0x8'));var controller=require(_0xfae0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xfae0('0xa')]);router[_0xfae0('0xb')](_0xfae0('0xc'),auth[_0xfae0('0xd')](),controller['describe']);router['get'](_0xfae0('0xe'),auth[_0xfae0('0xd')](),controller['show']);router['post']('/',auth[_0xfae0('0xd')](),controller[_0xfae0('0xf')]);router[_0xfae0('0x10')](_0xfae0('0xe'),auth[_0xfae0('0xd')](),controller['update']);router[_0xfae0('0x11')](_0xfae0('0xe'),auth[_0xfae0('0xd')](),controller['destroy']);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 ce81bb3..008acb8 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 _0x8efc=['STRING','DATE','exports'];(function(_0x583676,_0x5731dc){var _0x2e1415=function(_0x4dce63){while(--_0x4dce63){_0x583676['push'](_0x583676['shift']());}};_0x2e1415(++_0x5731dc);}(_0x8efc,0x8f));var _0xc8ef=function(_0x21f931,_0x598b2d){_0x21f931=_0x21f931-0x0;var _0x3f083c=_0x8efc[_0x21f931];return _0x3f083c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xc8ef('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xc8ef('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xc8ef('0x2')]},'acceptAt':{'type':Sequelize[_0xc8ef('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x22d3=['sequelize','STRING','DATE'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x22d3,0x66));var _0x322d=function(_0x1385dc,_0x2c7fd7){_0x1385dc=_0x1385dc-0x0;var _0x2f6469=_0x22d3[_0x1385dc];return _0x2f6469;};'use strict';var moment=require('moment');var Sequelize=require(_0x322d('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x322d('0x1')]},'joinAt':{'type':Sequelize[_0x322d('0x2')]},'leaveAt':{'type':Sequelize[_0x322d('0x2')]},'acceptAt':{'type':Sequelize[_0x322d('0x2')]},'exitAt':{'type':Sequelize[_0x322d('0x2')]},'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 b3a6667..6cec0c5 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 _0x6343=['VIRTUAL','options','MailQueueReport','then','rows','catch','show','params','keys','includeAll','include','create','body','find','describe','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','send','map','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge'];(function(_0x3cb6dc,_0x120dd3){var _0x47ec89=function(_0x55150a){while(--_0x55150a){_0x3cb6dc['push'](_0x3cb6dc['shift']());}};_0x47ec89(++_0x120dd3);}(_0x6343,0x168));var _0x3634=function(_0x1a2cb4,_0x4945ed){_0x1a2cb4=_0x1a2cb4-0x0;var _0x2942cc=_0x6343[_0x1a2cb4];return _0x2942cc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];function respondWithStatusCode(_0x1e6a04,_0x151c8c){_0x151c8c=_0x151c8c||0xcc;return function(_0x35ae07){if(_0x35ae07){return _0x1e6a04[_0x3634('0x13')](_0x151c8c);}return _0x1e6a04[_0x3634('0x14')](_0x151c8c)[_0x3634('0x15')]();};}function respondWithResult(_0x299e53,_0x71d09b){_0x71d09b=_0x71d09b||0xc8;return function(_0x7e4801){if(_0x7e4801){return _0x299e53[_0x3634('0x14')](_0x71d09b)['json'](_0x7e4801);}};}function respondWithFilteredResult(_0x167247,_0x48787f){return function(_0x69609d){if(_0x69609d){var _0x18285c=typeof _0x48787f[_0x3634('0x16')]===_0x3634('0x17')&&typeof _0x48787f[_0x3634('0x18')]==='undefined';var _0x3121a3=_0x69609d['count'];var _0x50350d=_0x18285c?0x0:_0x48787f[_0x3634('0x16')];var _0x4b2115=_0x18285c?_0x69609d[_0x3634('0x19')]:_0x48787f[_0x3634('0x16')]+_0x48787f[_0x3634('0x18')];var _0x5603d2;if(_0x4b2115>=_0x3121a3){_0x4b2115=_0x3121a3;_0x5603d2=0xc8;}else{_0x5603d2=0xce;}_0x167247[_0x3634('0x14')](_0x5603d2);return _0x167247[_0x3634('0x1a')]('Content-Range',_0x50350d+'-'+_0x4b2115+'/'+_0x3121a3)[_0x3634('0x1b')](_0x69609d);}return null;};}function patchUpdates(_0x506281){return function(_0x742e56){try{jsonpatch[_0x3634('0x1c')](_0x742e56,_0x506281,!![]);}catch(_0x5b77a7){return BPromise[_0x3634('0x1d')](_0x5b77a7);}return _0x742e56[_0x3634('0x1e')]();};}function saveUpdates(_0x206c8e,_0x505026){return function(_0x22b7ef){if(_0x22b7ef){return _0x22b7ef[_0x3634('0x1f')](_0x206c8e)['then'](function(_0x3936ee){return _0x3936ee;});}return null;};}function removeEntity(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(_0x3a8c41){return _0x3a8c41[_0x3634('0x20')]()['then'](function(){_0x596acb[_0x3634('0x14')](0xcc)[_0x3634('0x15')]();});}};}function handleEntityNotFound(_0x17db44,_0x225ddc){return function(_0x363ca2){if(!_0x363ca2){_0x17db44[_0x3634('0x13')](0x194);}return _0x363ca2;};}function handleError(_0x38e863,_0x4762b1){_0x4762b1=_0x4762b1||0x1f4;return function(_0x22f1f1){logger['error'](_0x22f1f1[_0x3634('0x21')]);if(_0x22f1f1['name']){delete _0x22f1f1['name'];}_0x38e863['status'](_0x4762b1)[_0x3634('0x22')](_0x22f1f1);};}exports['index']=function(_0x3bf28b,_0x12b80e){var _0x49804f={},_0x55a77f={},_0x282f73={'count':0x0,'rows':[]};var _0x5bd4e0=_[_0x3634('0x23')](db['MailQueueReport'][_0x3634('0x24')],function(_0x3d7322){return{'name':_0x3d7322[_0x3634('0x25')],'type':_0x3d7322[_0x3634('0x26')][_0x3634('0x27')]};});_0x55a77f[_0x3634('0x28')]=_[_0x3634('0x23')](_0x5bd4e0,_0x3634('0x29'));_0x55a77f['query']=_['keys'](_0x3bf28b['query']);_0x55a77f[_0x3634('0x2a')]=_['intersection'](_0x55a77f[_0x3634('0x28')],_0x55a77f[_0x3634('0x2b')]);_0x49804f[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x55a77f[_0x3634('0x28')],qs[_0x3634('0x2e')](_0x3bf28b['query'][_0x3634('0x2e')]));_0x49804f[_0x3634('0x2c')]=_0x49804f[_0x3634('0x2c')][_0x3634('0x2f')]?_0x49804f[_0x3634('0x2c')]:_0x55a77f[_0x3634('0x28')];if(!_0x3bf28b[_0x3634('0x2b')][_0x3634('0x30')](_0x3634('0x31'))){_0x49804f['limit']=qs[_0x3634('0x18')](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x18')]);_0x49804f[_0x3634('0x16')]=qs['offset'](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x16')]);}_0x49804f[_0x3634('0x32')]=qs['sort'](_0x3bf28b['query']['sort']);_0x49804f[_0x3634('0x33')]=qs[_0x3634('0x2a')](_['pick'](_0x3bf28b[_0x3634('0x2b')],_0x55a77f[_0x3634('0x2a')]),_0x5bd4e0);if(_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]){_0x49804f[_0x3634('0x33')]=_[_0x3634('0x35')](_0x49804f[_0x3634('0x33')],{'$or':_['map'](_0x5bd4e0,function(_0x416987){if(_0x416987['type']!==_0x3634('0x36')){var _0x3ae966={};_0x3ae966[_0x416987[_0x3634('0x29')]]={'$like':'%'+_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]+'%'};return _0x3ae966;}})});}_0x49804f=_['merge']({},_0x49804f,_0x3bf28b[_0x3634('0x37')]);var _0x33af29={'where':_0x49804f[_0x3634('0x33')]};return db[_0x3634('0x38')][_0x3634('0x19')](_0x33af29)[_0x3634('0x39')](function(_0x28c8d0){_0x282f73[_0x3634('0x19')]=_0x28c8d0;if(_0x3bf28b[_0x3634('0x2b')]['includeAll']){_0x49804f['include']=[{'all':!![]}];}return db[_0x3634('0x38')]['findAll'](_0x49804f);})['then'](function(_0x5948db){_0x282f73[_0x3634('0x3a')]=_0x5948db;return _0x282f73;})['then'](respondWithFilteredResult(_0x12b80e,_0x49804f))[_0x3634('0x3b')](handleError(_0x12b80e,null));};exports[_0x3634('0x3c')]=function(_0x53c1ea,_0x505be7){var _0x4896ab={'raw':!![],'where':{'id':_0x53c1ea[_0x3634('0x3d')]['id']}},_0x324970={};_0x324970['model']=_[_0x3634('0x3e')](db[_0x3634('0x38')][_0x3634('0x24')]);_0x324970[_0x3634('0x2b')]=_[_0x3634('0x3e')](_0x53c1ea['query']);_0x324970['filters']=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],_0x324970[_0x3634('0x2b')]);_0x4896ab[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],qs['fields'](_0x53c1ea[_0x3634('0x2b')][_0x3634('0x2e')]));_0x4896ab[_0x3634('0x2c')]=_0x4896ab['attributes']['length']?_0x4896ab[_0x3634('0x2c')]:_0x324970[_0x3634('0x28')];if(_0x53c1ea[_0x3634('0x2b')][_0x3634('0x3f')]){_0x4896ab[_0x3634('0x40')]=[{'all':!![]}];}_0x4896ab=_[_0x3634('0x35')]({},_0x4896ab,_0x53c1ea[_0x3634('0x37')]);return db[_0x3634('0x38')]['find'](_0x4896ab)[_0x3634('0x39')](handleEntityNotFound(_0x505be7,null))[_0x3634('0x39')](respondWithResult(_0x505be7,null))[_0x3634('0x3b')](handleError(_0x505be7,null));};exports[_0x3634('0x41')]=function(_0x615276,_0x151654){return db[_0x3634('0x38')][_0x3634('0x41')](_0x615276[_0x3634('0x42')],{})['then'](respondWithResult(_0x151654,0xc9))[_0x3634('0x3b')](handleError(_0x151654,null));};exports[_0x3634('0x1f')]=function(_0x4a4a94,_0x3c356b){if(_0x4a4a94[_0x3634('0x42')]['id']){delete _0x4a4a94[_0x3634('0x42')]['id'];}return db[_0x3634('0x38')][_0x3634('0x43')]({'where':{'id':_0x4a4a94[_0x3634('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3c356b,null))[_0x3634('0x39')](saveUpdates(_0x4a4a94[_0x3634('0x42')],null))[_0x3634('0x39')](respondWithResult(_0x3c356b,null))[_0x3634('0x3b')](handleError(_0x3c356b,null));};exports[_0x3634('0x20')]=function(_0x582475,_0x66f6a4){return db[_0x3634('0x38')]['find']({'where':{'id':_0x582475['params']['id']}})[_0x3634('0x39')](handleEntityNotFound(_0x66f6a4,null))['then'](removeEntity(_0x66f6a4,null))[_0x3634('0x3b')](handleError(_0x66f6a4,null));};exports[_0x3634('0x44')]=function(_0x1943a5,_0x1834a3){return db['MailQueueReport'][_0x3634('0x44')]()[_0x3634('0x39')](respondWithResult(_0x1834a3,null))[_0x3634('0x3b')](handleError(_0x1834a3,null));}; \ No newline at end of file +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(_0x21aea9,_0x4cc2c3){var _0x233ea8=function(_0x1e86e9){while(--_0x1e86e9){_0x21aea9['push'](_0x21aea9['shift']());}};_0x233ea8(++_0x4cc2c3);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x9c6930,_0x2ae3ab){_0x9c6930=_0x9c6930-0x0;var _0x1e6d58=_0x0adf[_0x9c6930];return _0x1e6d58;};'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 diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 4f86f99..b692f74 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 _0x0946=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid'];(function(_0x5bc4b0,_0x1075b4){var _0xefd33f=function(_0x340679){while(--_0x340679){_0x5bc4b0['push'](_0x5bc4b0['shift']());}};_0xefd33f(++_0x1075b4);}(_0x0946,0x130));var _0x6094=function(_0x385c76,_0xb97335){_0x385c76=_0x385c76-0x0;var _0x5c8367=_0x0946[_0x385c76];return _0x5c8367;};'use strict';var _=require(_0x6094('0x0'));var util=require(_0x6094('0x1'));var logger=require(_0x6094('0x2'))(_0x6094('0x3'));var moment=require(_0x6094('0x4'));var BPromise=require(_0x6094('0x5'));var rp=require(_0x6094('0x6'));var fs=require('fs');var path=require(_0x6094('0x7'));var rimraf=require(_0x6094('0x8'));var config=require(_0x6094('0x9'));var attributes=require(_0x6094('0xa'));module[_0x6094('0xb')]=function(_0x2ef92c,_0x36602b){return _0x2ef92c[_0x6094('0xc')](_0x6094('0xd'),attributes,{'tableName':_0x6094('0xe'),'paranoid':![],'indexes':[{'name':_0x6094('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb4f2=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','define','MailQueueReport','report_mail_queue','uniqueid'];(function(_0x283d9f,_0x424903){var _0xc93b1d=function(_0x317770){while(--_0x317770){_0x283d9f['push'](_0x283d9f['shift']());}};_0xc93b1d(++_0x424903);}(_0xb4f2,0x196));var _0x2b4f=function(_0x2bab66,_0x39499e){_0x2bab66=_0x2bab66-0x0;var _0x1f6fba=_0xb4f2[_0x2bab66];return _0x1f6fba;};'use strict';var _=require(_0x2b4f('0x0'));var util=require('util');var logger=require(_0x2b4f('0x1'))(_0x2b4f('0x2'));var moment=require(_0x2b4f('0x3'));var BPromise=require(_0x2b4f('0x4'));var rp=require(_0x2b4f('0x5'));var fs=require('fs');var path=require(_0x2b4f('0x6'));var rimraf=require(_0x2b4f('0x7'));var config=require(_0x2b4f('0x8'));var attributes=require(_0x2b4f('0x9'));module['exports']=function(_0x3dab6a,_0x239eff){return _0x3dab6a[_0x2b4f('0xa')](_0x2b4f('0xb'),attributes,{'tableName':_0x2b4f('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2b4f('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 bb48fa0..9153403 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x2f5422,_0x44d7e){var _0x1d06e4=function(_0x4e7609){while(--_0x4e7609){_0x2f5422['push'](_0x2f5422['shift']());}};_0x1d06e4(++_0x44d7e);}(_0x7a54,0x106));var _0x47a5=function(_0x5bb064,_0x1c38e1){_0x5bb064=_0x5bb064-0x0;var _0x36a208=_0x7a54[_0x5bb064];return _0x36a208;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4137af,_0x47fc6b){var _0x8dd2eb=function(_0x14a271){while(--_0x14a271){_0x4137af['push'](_0x4137af['shift']());}};_0x8dd2eb(++_0x47fc6b);}(_0x1261,0x144));var _0x1126=function(_0x3b6648,_0x2d723a){_0x3b6648=_0x3b6648-0x0;var _0x5a0a0d=_0x1261[_0x3b6648];return _0x5a0a0d;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 8012f3c..e9cf83a 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5c4737,_0x3fa036){var _0x5b9ecb=function(_0x274a9e){while(--_0x274a9e){_0x5c4737['push'](_0x5c4737['shift']());}};_0x5b9ecb(++_0x3fa036);}(_0x70e0,0x17b));var _0x070e=function(_0x5e13f5,_0x40ddee){_0x5e13f5=_0x5e13f5-0x0;var _0x5d0324=_0x70e0[_0x5e13f5];return _0x5d0324;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x280c4c,_0x170c4c){var _0x46306d=function(_0x335ba1){while(--_0x335ba1){_0x280c4c['push'](_0x280c4c['shift']());}};_0x46306d(++_0x170c4c);}(_0xedd9,0xfc));var _0x9edd=function(_0x96643c,_0x5e101c){_0x96643c=_0x96643c-0x0;var _0x359103=_0xedd9[_0x96643c];return _0x359103;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 3cfc515..87d9082 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 _0xea0c=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xea0c,0x13a));var _0xcea0=function(_0x5c34a9,_0x69b8b8){_0x5c34a9=_0x5c34a9-0x0;var _0x4f44ed=_0xea0c[_0x5c34a9];return _0x4f44ed;};'use strict';var Sequelize=require(_0xcea0('0x0'));module[_0xcea0('0x1')]={'description':{'type':Sequelize[_0xcea0('0x2')]},'host':{'type':Sequelize[_0xcea0('0x2')]},'authentication':{'type':Sequelize[_0xcea0('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xcea0('0x2')]},'port':{'type':Sequelize[_0xcea0('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xcea0('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xcea0('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xcea0('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xbec8=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x46e36d,_0x37b78b){var _0x2c65d6=function(_0x4968fe){while(--_0x4968fe){_0x46e36d['push'](_0x46e36d['shift']());}};_0x2c65d6(++_0x37b78b);}(_0xbec8,0x125));var _0x8bec=function(_0x334201,_0x39f06f){_0x334201=_0x334201-0x0;var _0x134700=_0xbec8[_0x334201];return _0x134700;};'use strict';var Sequelize=require(_0x8bec('0x0'));module[_0x8bec('0x1')]={'description':{'type':Sequelize[_0x8bec('0x2')]},'host':{'type':Sequelize[_0x8bec('0x2')]},'authentication':{'type':Sequelize[_0x8bec('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x8bec('0x2')]},'port':{'type':Sequelize[_0x8bec('0x4')]},'tls':{'type':Sequelize[_0x8bec('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x8bec('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x8bec('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x8bec('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index bb0c711..91bc3e7 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 _0x04f8=['request-promise','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x04f8,0x1b3));var _0x804f=function(_0xd8753,_0x1a87b4){_0xd8753=_0xd8753-0x0;var _0x59d708=_0x04f8[_0xd8753];return _0x59d708;};'use strict';var _=require(_0x804f('0x0'));var util=require(_0x804f('0x1'));var logger=require(_0x804f('0x2'))('api');var moment=require(_0x804f('0x3'));var BPromise=require(_0x804f('0x4'));var rp=require(_0x804f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x804f('0x6'));module[_0x804f('0x7')]=function(_0x2df75b,_0x4dc2a4){return _0x2df75b[_0x804f('0x8')](_0x804f('0x9'),attributes,{'tableName':_0x804f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9141=['MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','define'];(function(_0x45c2b2,_0x4d2d55){var _0x5d7d9b=function(_0x382f6f){while(--_0x382f6f){_0x45c2b2['push'](_0x45c2b2['shift']());}};_0x5d7d9b(++_0x4d2d55);}(_0x9141,0x136));var _0x1914=function(_0x24a6db,_0x14f433){_0x24a6db=_0x24a6db-0x0;var _0x390f46=_0x9141[_0x24a6db];return _0x390f46;};'use strict';var _=require(_0x1914('0x0'));var util=require(_0x1914('0x1'));var logger=require(_0x1914('0x2'))(_0x1914('0x3'));var moment=require(_0x1914('0x4'));var BPromise=require(_0x1914('0x5'));var rp=require(_0x1914('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1914('0x7'));var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x4a8741,_0x9333b7){return _0x4a8741[_0x1914('0x8')](_0x1914('0x9'),attributes,{'tableName':_0x1914('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 f10fc42..4a87ab2 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 _0x94dc=['attributes','limit','include','map','model','GetMailServerIn','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x94dc,0xb1));var _0xc94d=function(_0x33399f,_0xe5c7e4){_0x33399f=_0x33399f-0x0;var _0x16b383=_0x94dc[_0x33399f];return _0x16b383;};'use strict';var _=require(_0xc94d('0x0'));var util=require('util');var moment=require(_0xc94d('0x1'));var BPromise=require('bluebird');var rs=require(_0xc94d('0x2'));var fs=require('fs');var Redis=require(_0xc94d('0x3'));var db=require(_0xc94d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc94d('0x5'))(_0xc94d('0x6'));var config=require(_0xc94d('0x7'));var jayson=require(_0xc94d('0x8'));var client=jayson[_0xc94d('0x9')][_0xc94d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb7275c,_0x5776ab,_0x2f9757){return new BPromise(function(_0xbe5904,_0x15265c){return client[_0xc94d('0xb')](_0xb7275c,_0x2f9757)[_0xc94d('0xc')](function(_0x579245){logger[_0xc94d('0xd')](_0xc94d('0xe'),_0x5776ab,_0xc94d('0xf'));logger[_0xc94d('0x10')](_0xc94d('0x11'),_0x5776ab,_0xc94d('0xf'),JSON['stringify'](_0x579245));if(_0x579245[_0xc94d('0x12')]){if(_0x579245[_0xc94d('0x12')][_0xc94d('0x13')]===0x1f4){logger[_0xc94d('0x12')]('MailServerIn,\x20%s,\x20%s',_0x5776ab,_0x579245['error']['message']);return _0x15265c(_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);}logger[_0xc94d('0x12')](_0xc94d('0xe'),_0x5776ab,_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);return _0xbe5904(_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);}else{logger[_0xc94d('0xd')](_0xc94d('0xe'),_0x5776ab,_0xc94d('0xf'));_0xbe5904(_0x579245[_0xc94d('0x15')][_0xc94d('0x14')]);}})[_0xc94d('0x16')](function(_0x19508d){logger['error']('MailServerIn,\x20%s,\x20%s',_0x5776ab,_0x19508d);_0x15265c(_0x19508d);});});}exports['GetMailServerIn']=function(_0x48b879){var _0x345259=this;return new Promise(function(_0x4784a2,_0x4f7287){return db['MailServerIn'][_0xc94d('0x17')]({'raw':_0x48b879[_0xc94d('0x18')]?_0x48b879['options'][_0xc94d('0x19')]===undefined?!![]:![]:!![],'where':_0x48b879[_0xc94d('0x18')]?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1a')]||null:null,'attributes':_0x48b879[_0xc94d('0x18')]?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1b')]||null:null,'limit':_0x48b879[_0xc94d('0x18')]?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1c')]||null:null,'include':_0x48b879['options']?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1d')]?_[_0xc94d('0x1e')](_0x48b879[_0xc94d('0x18')][_0xc94d('0x1d')],function(_0x557bfb){return{'model':db[_0x557bfb['model']],'as':_0x557bfb['as'],'attributes':_0x557bfb['attributes'],'include':_0x557bfb[_0xc94d('0x1d')]?_[_0xc94d('0x1e')](_0x557bfb[_0xc94d('0x1d')],function(_0x1de964){return{'model':db[_0x1de964['model']],'as':_0x1de964['as'],'attributes':_0x1de964['attributes'],'include':_0x1de964[_0xc94d('0x1d')]?_['map'](_0x1de964[_0xc94d('0x1d')],function(_0x362ff4){return{'model':db[_0x362ff4[_0xc94d('0x1f')]],'as':_0x362ff4['as'],'attributes':_0x362ff4['attributes']};}):[]};}):[]};}):[]:[]})[_0xc94d('0xc')](function(_0x196b59){logger[_0xc94d('0xd')](_0xc94d('0x20'),_0x48b879);logger[_0xc94d('0x10')]('GetMailServerIn',_0x48b879,JSON[_0xc94d('0x21')](_0x196b59));_0x4784a2(_0x196b59);})[_0xc94d('0x16')](function(_0x3a2342){logger[_0xc94d('0x12')](_0xc94d('0x20'),_0x3a2342['message'],_0x48b879);_0x4f7287(_0x345259[_0xc94d('0x12')](0x1f4,_0x3a2342[_0xc94d('0x14')]));});});}; \ No newline at end of file +var _0xd0be=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetMailServerIn','MailServerIn','options','raw','attributes','limit','map','include','model'];(function(_0xfde924,_0x68c74f){var _0x23eebd=function(_0x13cd3a){while(--_0x13cd3a){_0xfde924['push'](_0xfde924['shift']());}};_0x23eebd(++_0x68c74f);}(_0xd0be,0x1a0));var _0xed0b=function(_0x16017e,_0xf8154b){_0x16017e=_0x16017e-0x0;var _0x365023=_0xd0be[_0x16017e];return _0x365023;};'use strict';var _=require(_0xed0b('0x0'));var util=require(_0xed0b('0x1'));var moment=require(_0xed0b('0x2'));var BPromise=require(_0xed0b('0x3'));var rs=require(_0xed0b('0x4'));var fs=require('fs');var Redis=require(_0xed0b('0x5'));var db=require(_0xed0b('0x6'))['db'];var utils=require(_0xed0b('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xed0b('0x8'));var client=jayson[_0xed0b('0x9')][_0xed0b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x234dcd,_0x20c99d,_0x3b8c09){return new BPromise(function(_0xa4213d,_0x1848f4){return client['request'](_0x234dcd,_0x3b8c09)[_0xed0b('0xb')](function(_0x529957){logger[_0xed0b('0xc')](_0xed0b('0xd'),_0x20c99d,_0xed0b('0xe'));logger[_0xed0b('0xf')](_0xed0b('0x10'),_0x20c99d,_0xed0b('0xe'),JSON[_0xed0b('0x11')](_0x529957));if(_0x529957['error']){if(_0x529957['error'][_0xed0b('0x12')]===0x1f4){logger[_0xed0b('0x13')]('MailServerIn,\x20%s,\x20%s',_0x20c99d,_0x529957['error'][_0xed0b('0x14')]);return _0x1848f4(_0x529957[_0xed0b('0x13')][_0xed0b('0x14')]);}logger[_0xed0b('0x13')](_0xed0b('0xd'),_0x20c99d,_0x529957['error']['message']);return _0xa4213d(_0x529957[_0xed0b('0x13')][_0xed0b('0x14')]);}else{logger['info'](_0xed0b('0xd'),_0x20c99d,_0xed0b('0xe'));_0xa4213d(_0x529957[_0xed0b('0x15')][_0xed0b('0x14')]);}})[_0xed0b('0x16')](function(_0x5aa35b){logger['error'](_0xed0b('0xd'),_0x20c99d,_0x5aa35b);_0x1848f4(_0x5aa35b);});});}exports[_0xed0b('0x17')]=function(_0x444f9b){var _0x3e22d3=this;return new Promise(function(_0x3b9307,_0x12600a){return db[_0xed0b('0x18')]['findAll']({'raw':_0x444f9b[_0xed0b('0x19')]?_0x444f9b[_0xed0b('0x19')][_0xed0b('0x1a')]===undefined?!![]:![]:!![],'where':_0x444f9b[_0xed0b('0x19')]?_0x444f9b[_0xed0b('0x19')]['where']||null:null,'attributes':_0x444f9b[_0xed0b('0x19')]?_0x444f9b[_0xed0b('0x19')][_0xed0b('0x1b')]||null:null,'limit':_0x444f9b['options']?_0x444f9b[_0xed0b('0x19')][_0xed0b('0x1c')]||null:null,'include':_0x444f9b[_0xed0b('0x19')]?_0x444f9b['options']['include']?_[_0xed0b('0x1d')](_0x444f9b[_0xed0b('0x19')][_0xed0b('0x1e')],function(_0x36bc17){return{'model':db[_0x36bc17[_0xed0b('0x1f')]],'as':_0x36bc17['as'],'attributes':_0x36bc17[_0xed0b('0x1b')],'include':_0x36bc17[_0xed0b('0x1e')]?_[_0xed0b('0x1d')](_0x36bc17[_0xed0b('0x1e')],function(_0x7f27a5){return{'model':db[_0x7f27a5[_0xed0b('0x1f')]],'as':_0x7f27a5['as'],'attributes':_0x7f27a5[_0xed0b('0x1b')],'include':_0x7f27a5[_0xed0b('0x1e')]?_['map'](_0x7f27a5['include'],function(_0xf4de62){return{'model':db[_0xf4de62[_0xed0b('0x1f')]],'as':_0xf4de62['as'],'attributes':_0xf4de62[_0xed0b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xed0b('0xb')](function(_0x54249f){logger[_0xed0b('0xc')](_0xed0b('0x17'),_0x444f9b);logger['debug'](_0xed0b('0x17'),_0x444f9b,JSON['stringify'](_0x54249f));_0x3b9307(_0x54249f);})[_0xed0b('0x16')](function(_0x4896c3){logger[_0xed0b('0x13')]('GetMailServerIn',_0x4896c3['message'],_0x444f9b);_0x12600a(_0x3e22d3[_0xed0b('0x13')](0x1f4,_0x4896c3[_0xed0b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index aa6ec80..330417c 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(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7a54,0x106));var _0x47a5=function(_0x4b9b1,_0x50ba6a){_0x4b9b1=_0x4b9b1-0x0;var _0x434202=_0x7a54[_0x4b9b1];return _0x434202;};'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(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x7a54,0x106));var _0x47a5=function(_0x29ee7a,_0x52247d){_0x29ee7a=_0x29ee7a-0x0;var _0x5e660a=_0x7a54[_0x29ee7a];return _0x5e660a;};'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 e56d371..55adaa2 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 _0x97c1=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x211a71,_0x36fdb6){var _0x13633a=function(_0x23e293){while(--_0x23e293){_0x211a71['push'](_0x211a71['shift']());}};_0x13633a(++_0x36fdb6);}(_0x97c1,0xdf));var _0x197c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x97c1[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x197c('0x0'));module[_0x197c('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x197c('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x197c('0x3')]},'secure':{'type':Sequelize[_0x197c('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x197c('0x2')]},'authentication':{'type':Sequelize[_0x197c('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x197c('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xa5fa=['exports','STRING','INTEGER','BOOLEAN'];(function(_0x304e5e,_0x19cda0){var _0x2ed500=function(_0x16b448){while(--_0x16b448){_0x304e5e['push'](_0x304e5e['shift']());}};_0x2ed500(++_0x19cda0);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x1ad279,_0x42d157){_0x1ad279=_0x1ad279-0x0;var _0x272861=_0xa5fa[_0x1ad279];return _0x272861;};'use strict';var Sequelize=require('sequelize');module[_0xaa5f('0x0')]={'description':{'type':Sequelize[_0xaa5f('0x1')]},'host':{'type':Sequelize[_0xaa5f('0x1')]},'user':{'type':Sequelize[_0xaa5f('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xaa5f('0x2')]},'secure':{'type':Sequelize[_0xaa5f('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xaa5f('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xaa5f('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 253a9e0..6e243e1 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 _0x9bba=['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','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','error','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','MailServerOut','catch','create','update','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x35bc68,_0x350791){var _0x3da2e8=function(_0x3d68c2){while(--_0x3d68c2){_0x35bc68['push'](_0x35bc68['shift']());}};_0x3da2e8(++_0x350791);}(_0x9bba,0x8f));var _0xa9bb=function(_0xf6dbd1,_0x258774){_0xf6dbd1=_0xf6dbd1-0x0;var _0xa9d04a=_0x9bba[_0xf6dbd1];return _0xa9d04a;};'use strict';var emlformat=require(_0xa9bb('0x0'));var rimraf=require(_0xa9bb('0x1'));var zipdir=require(_0xa9bb('0x2'));var jsonpatch=require(_0xa9bb('0x3'));var rp=require('request-promise');var moment=require(_0xa9bb('0x4'));var BPromise=require(_0xa9bb('0x5'));var Mustache=require(_0xa9bb('0x6'));var util=require('util');var path=require(_0xa9bb('0x7'));var sox=require(_0xa9bb('0x8'));var csv=require(_0xa9bb('0x9'));var ejs=require(_0xa9bb('0xa'));var fs=require('fs');var fs_extra=require(_0xa9bb('0xb'));var _=require(_0xa9bb('0xc'));var squel=require('squel');var crypto=require(_0xa9bb('0xd'));var jsforce=require(_0xa9bb('0xe'));var deskjs=require(_0xa9bb('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa9bb('0x10'));var Papa=require(_0xa9bb('0x11'));var Redis=require(_0xa9bb('0x12'));var authService=require(_0xa9bb('0x13'));var qs=require(_0xa9bb('0x14'));var as=require(_0xa9bb('0x15'));var hardwareService=require(_0xa9bb('0x16'));var logger=require(_0xa9bb('0x17'))('api');var utils=require(_0xa9bb('0x18'));var config=require(_0xa9bb('0x19'));var licenseUtil=require(_0xa9bb('0x1a'));var db=require(_0xa9bb('0x1b'))['db'];function respondWithStatusCode(_0x8e5916,_0x2c62d1){_0x2c62d1=_0x2c62d1||0xcc;return function(_0x1ea7e6){if(_0x1ea7e6){return _0x8e5916[_0xa9bb('0x1c')](_0x2c62d1);}return _0x8e5916[_0xa9bb('0x1d')](_0x2c62d1)[_0xa9bb('0x1e')]();};}function respondWithResult(_0x20d7c3,_0x389f94){_0x389f94=_0x389f94||0xc8;return function(_0x22cca0){if(_0x22cca0){return _0x20d7c3[_0xa9bb('0x1d')](_0x389f94)['json'](_0x22cca0);}};}function respondWithFilteredResult(_0x42804d,_0x5e8c92){return function(_0x38940f){if(_0x38940f){var _0x2cc8bd=typeof _0x5e8c92[_0xa9bb('0x1f')]===_0xa9bb('0x20')&&typeof _0x5e8c92[_0xa9bb('0x21')]===_0xa9bb('0x20');var _0x2d5687=_0x38940f[_0xa9bb('0x22')];var _0x387095=_0x2cc8bd?0x0:_0x5e8c92[_0xa9bb('0x1f')];var _0x36ccd4=_0x2cc8bd?_0x38940f['count']:_0x5e8c92[_0xa9bb('0x1f')]+_0x5e8c92[_0xa9bb('0x21')];var _0x550f26;if(_0x36ccd4>=_0x2d5687){_0x36ccd4=_0x2d5687;_0x550f26=0xc8;}else{_0x550f26=0xce;}_0x42804d[_0xa9bb('0x1d')](_0x550f26);return _0x42804d['set'](_0xa9bb('0x23'),_0x387095+'-'+_0x36ccd4+'/'+_0x2d5687)['json'](_0x38940f);}return null;};}function patchUpdates(_0xc20bec){return function(_0x2739e5){try{jsonpatch[_0xa9bb('0x24')](_0x2739e5,_0xc20bec,!![]);}catch(_0x59889a){return BPromise['reject'](_0x59889a);}return _0x2739e5[_0xa9bb('0x25')]();};}function saveUpdates(_0x5a246c,_0x4710d5){return function(_0x20fc13){if(_0x20fc13){return _0x20fc13['update'](_0x5a246c)[_0xa9bb('0x26')](function(_0x1ba4ab){return _0x1ba4ab;});}return null;};}function removeEntity(_0x375c2c,_0x5c206c){return function(_0x30b8fe){if(_0x30b8fe){return _0x30b8fe[_0xa9bb('0x27')]()[_0xa9bb('0x26')](function(){_0x375c2c[_0xa9bb('0x1d')](0xcc)[_0xa9bb('0x1e')]();});}};}function handleEntityNotFound(_0x1ba4bc,_0x15d1f1){return function(_0x520e59){if(!_0x520e59){_0x1ba4bc[_0xa9bb('0x1c')](0x194);}return _0x520e59;};}function handleError(_0x514671,_0x110de0){_0x110de0=_0x110de0||0x1f4;return function(_0x233c17){logger[_0xa9bb('0x28')](_0x233c17['stack']);if(_0x233c17['name']){delete _0x233c17[_0xa9bb('0x29')];}_0x514671[_0xa9bb('0x1d')](_0x110de0)[_0xa9bb('0x2a')](_0x233c17);};}exports[_0xa9bb('0x2b')]=function(_0x1921ab,_0xadf5fd){var _0x18a0e4={},_0x111793={},_0x2b9408={'count':0x0,'rows':[]};var _0x16dc76=_['map'](db['MailServerOut'][_0xa9bb('0x2c')],function(_0x27fc81){return{'name':_0x27fc81['fieldName'],'type':_0x27fc81[_0xa9bb('0x2d')][_0xa9bb('0x2e')]};});_0x111793[_0xa9bb('0x2f')]=_[_0xa9bb('0x30')](_0x16dc76,_0xa9bb('0x29'));_0x111793[_0xa9bb('0x31')]=_['keys'](_0x1921ab[_0xa9bb('0x31')]);_0x111793[_0xa9bb('0x32')]=_['intersection'](_0x111793[_0xa9bb('0x2f')],_0x111793[_0xa9bb('0x31')]);_0x18a0e4['attributes']=_[_0xa9bb('0x33')](_0x111793[_0xa9bb('0x2f')],qs[_0xa9bb('0x34')](_0x1921ab[_0xa9bb('0x31')][_0xa9bb('0x34')]));_0x18a0e4[_0xa9bb('0x35')]=_0x18a0e4[_0xa9bb('0x35')][_0xa9bb('0x36')]?_0x18a0e4[_0xa9bb('0x35')]:_0x111793[_0xa9bb('0x2f')];if(!_0x1921ab[_0xa9bb('0x31')][_0xa9bb('0x37')](_0xa9bb('0x38'))){_0x18a0e4[_0xa9bb('0x21')]=qs[_0xa9bb('0x21')](_0x1921ab[_0xa9bb('0x31')]['limit']);_0x18a0e4[_0xa9bb('0x1f')]=qs[_0xa9bb('0x1f')](_0x1921ab[_0xa9bb('0x31')]['offset']);}_0x18a0e4[_0xa9bb('0x39')]=qs[_0xa9bb('0x3a')](_0x1921ab['query']['sort']);_0x18a0e4['where']=qs['filters'](_[_0xa9bb('0x3b')](_0x1921ab[_0xa9bb('0x31')],_0x111793[_0xa9bb('0x32')]),_0x16dc76);if(_0x1921ab[_0xa9bb('0x31')][_0xa9bb('0x3c')]){_0x18a0e4[_0xa9bb('0x3d')]=_[_0xa9bb('0x3e')](_0x18a0e4[_0xa9bb('0x3d')],{'$or':_[_0xa9bb('0x30')](_0x16dc76,function(_0x19138d){if(_0x19138d[_0xa9bb('0x2d')]!==_0xa9bb('0x3f')){var _0x4a5770={};_0x4a5770[_0x19138d[_0xa9bb('0x29')]]={'$like':'%'+_0x1921ab[_0xa9bb('0x31')]['filter']+'%'};return _0x4a5770;}})});}_0x18a0e4=_[_0xa9bb('0x3e')]({},_0x18a0e4,_0x1921ab[_0xa9bb('0x40')]);var _0x58b120={'where':_0x18a0e4[_0xa9bb('0x3d')]};return db['MailServerOut'][_0xa9bb('0x22')](_0x58b120)[_0xa9bb('0x26')](function(_0x5d617d){_0x2b9408[_0xa9bb('0x22')]=_0x5d617d;if(_0x1921ab[_0xa9bb('0x31')][_0xa9bb('0x41')]){_0x18a0e4[_0xa9bb('0x42')]=[{'all':!![]}];}return db['MailServerOut'][_0xa9bb('0x43')](_0x18a0e4);})[_0xa9bb('0x26')](function(_0xd58d07){_0x2b9408[_0xa9bb('0x44')]=_0xd58d07;return _0x2b9408;})[_0xa9bb('0x26')](respondWithFilteredResult(_0xadf5fd,_0x18a0e4))['catch'](handleError(_0xadf5fd,null));};exports[_0xa9bb('0x45')]=function(_0x490327,_0xdd7899){var _0x540c26={'raw':!![],'where':{'id':_0x490327[_0xa9bb('0x46')]['id']}},_0x135b42={};_0x135b42['model']=_[_0xa9bb('0x47')](db[_0xa9bb('0x48')]['rawAttributes']);_0x135b42[_0xa9bb('0x31')]=_[_0xa9bb('0x47')](_0x490327['query']);_0x135b42[_0xa9bb('0x32')]=_[_0xa9bb('0x33')](_0x135b42[_0xa9bb('0x2f')],_0x135b42['query']);_0x540c26[_0xa9bb('0x35')]=_['intersection'](_0x135b42[_0xa9bb('0x2f')],qs['fields'](_0x490327[_0xa9bb('0x31')][_0xa9bb('0x34')]));_0x540c26[_0xa9bb('0x35')]=_0x540c26[_0xa9bb('0x35')]['length']?_0x540c26[_0xa9bb('0x35')]:_0x135b42[_0xa9bb('0x2f')];if(_0x490327['query'][_0xa9bb('0x41')]){_0x540c26[_0xa9bb('0x42')]=[{'all':!![]}];}_0x540c26=_['merge']({},_0x540c26,_0x490327[_0xa9bb('0x40')]);return db[_0xa9bb('0x48')]['find'](_0x540c26)['then'](handleEntityNotFound(_0xdd7899,null))[_0xa9bb('0x26')](respondWithResult(_0xdd7899,null))[_0xa9bb('0x49')](handleError(_0xdd7899,null));};exports['create']=function(_0xa1cf1c,_0xaf02b9){return db[_0xa9bb('0x48')][_0xa9bb('0x4a')](_0xa1cf1c['body'],{})[_0xa9bb('0x26')](respondWithResult(_0xaf02b9,0xc9))[_0xa9bb('0x49')](handleError(_0xaf02b9,null));};exports[_0xa9bb('0x4b')]=function(_0x5f495c,_0x59c54d){if(_0x5f495c[_0xa9bb('0x4c')]['id']){delete _0x5f495c[_0xa9bb('0x4c')]['id'];}return db['MailServerOut'][_0xa9bb('0x4d')]({'where':{'id':_0x5f495c[_0xa9bb('0x46')]['id']}})[_0xa9bb('0x26')](handleEntityNotFound(_0x59c54d,null))[_0xa9bb('0x26')](saveUpdates(_0x5f495c[_0xa9bb('0x4c')],null))[_0xa9bb('0x26')](respondWithResult(_0x59c54d,null))[_0xa9bb('0x49')](handleError(_0x59c54d,null));};exports[_0xa9bb('0x27')]=function(_0x19bc80,_0x5ab8a9){return db[_0xa9bb('0x48')][_0xa9bb('0x4d')]({'where':{'id':_0x19bc80['params']['id']}})[_0xa9bb('0x26')](handleEntityNotFound(_0x5ab8a9,null))[_0xa9bb('0x26')](removeEntity(_0x5ab8a9,null))[_0xa9bb('0x49')](handleError(_0x5ab8a9,null));}; \ No newline at end of file +var _0xc087=['sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','stack','name','send','index','MailServerOut','rawAttributes','type','key','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x11c8bc,_0x1f6e51){var _0x1c00ef=function(_0x8574ae){while(--_0x8574ae){_0x11c8bc['push'](_0x11c8bc['shift']());}};_0x1c00ef(++_0x1f6e51);}(_0xc087,0x166));var _0x7c08=function(_0x161f03,_0x5d141b){_0x161f03=_0x161f03-0x0;var _0x2f396f=_0xc087[_0x161f03];return _0x2f396f;};'use strict';var emlformat=require(_0x7c08('0x0'));var rimraf=require(_0x7c08('0x1'));var zipdir=require(_0x7c08('0x2'));var jsonpatch=require(_0x7c08('0x3'));var rp=require('request-promise');var moment=require(_0x7c08('0x4'));var BPromise=require(_0x7c08('0x5'));var Mustache=require(_0x7c08('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7c08('0x7'));var csv=require(_0x7c08('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7c08('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7c08('0xa'));var jsforce=require(_0x7c08('0xb'));var deskjs=require(_0x7c08('0xc'));var toCsv=require(_0x7c08('0x8'));var querystring=require(_0x7c08('0xd'));var Papa=require(_0x7c08('0xe'));var Redis=require('ioredis');var authService=require(_0x7c08('0xf'));var qs=require(_0x7c08('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c08('0x11'));var logger=require('../../config/logger')(_0x7c08('0x12'));var utils=require(_0x7c08('0x13'));var config=require(_0x7c08('0x14'));var licenseUtil=require(_0x7c08('0x15'));var db=require(_0x7c08('0x16'))['db'];function respondWithStatusCode(_0x8b24f8,_0x36be86){_0x36be86=_0x36be86||0xcc;return function(_0x210725){if(_0x210725){return _0x8b24f8[_0x7c08('0x17')](_0x36be86);}return _0x8b24f8[_0x7c08('0x18')](_0x36be86)[_0x7c08('0x19')]();};}function respondWithResult(_0x1fdc53,_0x66fcab){_0x66fcab=_0x66fcab||0xc8;return function(_0x4e5f4f){if(_0x4e5f4f){return _0x1fdc53[_0x7c08('0x18')](_0x66fcab)[_0x7c08('0x1a')](_0x4e5f4f);}};}function respondWithFilteredResult(_0x5cc5c1,_0x18e801){return function(_0x481bdf){if(_0x481bdf){var _0x516a66=typeof _0x18e801[_0x7c08('0x1b')]===_0x7c08('0x1c')&&typeof _0x18e801[_0x7c08('0x1d')]==='undefined';var _0x268831=_0x481bdf[_0x7c08('0x1e')];var _0x496a12=_0x516a66?0x0:_0x18e801[_0x7c08('0x1b')];var _0x570b21=_0x516a66?_0x481bdf[_0x7c08('0x1e')]:_0x18e801[_0x7c08('0x1b')]+_0x18e801[_0x7c08('0x1d')];var _0x210121;if(_0x570b21>=_0x268831){_0x570b21=_0x268831;_0x210121=0xc8;}else{_0x210121=0xce;}_0x5cc5c1[_0x7c08('0x18')](_0x210121);return _0x5cc5c1[_0x7c08('0x1f')](_0x7c08('0x20'),_0x496a12+'-'+_0x570b21+'/'+_0x268831)['json'](_0x481bdf);}return null;};}function patchUpdates(_0x3b2e88){return function(_0x166c52){try{jsonpatch[_0x7c08('0x21')](_0x166c52,_0x3b2e88,!![]);}catch(_0x421933){return BPromise['reject'](_0x421933);}return _0x166c52[_0x7c08('0x22')]();};}function saveUpdates(_0x5e9b5b,_0x106454){return function(_0x10fa68){if(_0x10fa68){return _0x10fa68['update'](_0x5e9b5b)[_0x7c08('0x23')](function(_0x34509a){return _0x34509a;});}return null;};}function removeEntity(_0x290e5f,_0x446aac){return function(_0x218cee){if(_0x218cee){return _0x218cee['destroy']()['then'](function(){_0x290e5f[_0x7c08('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3715c2,_0x34b6fc){return function(_0x16c536){if(!_0x16c536){_0x3715c2[_0x7c08('0x17')](0x194);}return _0x16c536;};}function handleError(_0x16110e,_0x2c42b9){_0x2c42b9=_0x2c42b9||0x1f4;return function(_0x425a16){logger[_0x7c08('0x24')](_0x425a16[_0x7c08('0x25')]);if(_0x425a16['name']){delete _0x425a16[_0x7c08('0x26')];}_0x16110e[_0x7c08('0x18')](_0x2c42b9)[_0x7c08('0x27')](_0x425a16);};}exports[_0x7c08('0x28')]=function(_0x27e65f,_0x44d770){var _0x2f976e={},_0x27fa79={},_0x2527f6={'count':0x0,'rows':[]};var _0x455490=_['map'](db[_0x7c08('0x29')][_0x7c08('0x2a')],function(_0x3da867){return{'name':_0x3da867['fieldName'],'type':_0x3da867[_0x7c08('0x2b')][_0x7c08('0x2c')]};});_0x27fa79['model']=_[_0x7c08('0x2d')](_0x455490,'name');_0x27fa79[_0x7c08('0x2e')]=_['keys'](_0x27e65f[_0x7c08('0x2e')]);_0x27fa79['filters']=_[_0x7c08('0x2f')](_0x27fa79[_0x7c08('0x30')],_0x27fa79[_0x7c08('0x2e')]);_0x2f976e['attributes']=_[_0x7c08('0x2f')](_0x27fa79[_0x7c08('0x30')],qs[_0x7c08('0x31')](_0x27e65f[_0x7c08('0x2e')][_0x7c08('0x31')]));_0x2f976e[_0x7c08('0x32')]=_0x2f976e[_0x7c08('0x32')][_0x7c08('0x33')]?_0x2f976e['attributes']:_0x27fa79[_0x7c08('0x30')];if(!_0x27e65f['query'][_0x7c08('0x34')](_0x7c08('0x35'))){_0x2f976e[_0x7c08('0x1d')]=qs[_0x7c08('0x1d')](_0x27e65f['query'][_0x7c08('0x1d')]);_0x2f976e[_0x7c08('0x1b')]=qs[_0x7c08('0x1b')](_0x27e65f[_0x7c08('0x2e')]['offset']);}_0x2f976e[_0x7c08('0x36')]=qs[_0x7c08('0x37')](_0x27e65f[_0x7c08('0x2e')]['sort']);_0x2f976e[_0x7c08('0x38')]=qs[_0x7c08('0x39')](_[_0x7c08('0x3a')](_0x27e65f['query'],_0x27fa79[_0x7c08('0x39')]),_0x455490);if(_0x27e65f[_0x7c08('0x2e')][_0x7c08('0x3b')]){_0x2f976e[_0x7c08('0x38')]=_[_0x7c08('0x3c')](_0x2f976e['where'],{'$or':_['map'](_0x455490,function(_0x19d8b3){if(_0x19d8b3[_0x7c08('0x2b')]!==_0x7c08('0x3d')){var _0x409814={};_0x409814[_0x19d8b3[_0x7c08('0x26')]]={'$like':'%'+_0x27e65f[_0x7c08('0x2e')][_0x7c08('0x3b')]+'%'};return _0x409814;}})});}_0x2f976e=_[_0x7c08('0x3c')]({},_0x2f976e,_0x27e65f[_0x7c08('0x3e')]);var _0x25b7cf={'where':_0x2f976e[_0x7c08('0x38')]};return db['MailServerOut']['count'](_0x25b7cf)[_0x7c08('0x23')](function(_0x488f6c){_0x2527f6['count']=_0x488f6c;if(_0x27e65f[_0x7c08('0x2e')][_0x7c08('0x3f')]){_0x2f976e[_0x7c08('0x40')]=[{'all':!![]}];}return db[_0x7c08('0x29')][_0x7c08('0x41')](_0x2f976e);})[_0x7c08('0x23')](function(_0x542f96){_0x2527f6['rows']=_0x542f96;return _0x2527f6;})[_0x7c08('0x23')](respondWithFilteredResult(_0x44d770,_0x2f976e))[_0x7c08('0x42')](handleError(_0x44d770,null));};exports['show']=function(_0x3cda21,_0x3b0e5b){var _0x1149f0={'raw':!![],'where':{'id':_0x3cda21[_0x7c08('0x43')]['id']}},_0x5b310e={};_0x5b310e['model']=_[_0x7c08('0x44')](db['MailServerOut']['rawAttributes']);_0x5b310e['query']=_['keys'](_0x3cda21[_0x7c08('0x2e')]);_0x5b310e[_0x7c08('0x39')]=_[_0x7c08('0x2f')](_0x5b310e[_0x7c08('0x30')],_0x5b310e[_0x7c08('0x2e')]);_0x1149f0['attributes']=_[_0x7c08('0x2f')](_0x5b310e[_0x7c08('0x30')],qs[_0x7c08('0x31')](_0x3cda21[_0x7c08('0x2e')]['fields']));_0x1149f0[_0x7c08('0x32')]=_0x1149f0[_0x7c08('0x32')][_0x7c08('0x33')]?_0x1149f0[_0x7c08('0x32')]:_0x5b310e[_0x7c08('0x30')];if(_0x3cda21[_0x7c08('0x2e')][_0x7c08('0x3f')]){_0x1149f0['include']=[{'all':!![]}];}_0x1149f0=_['merge']({},_0x1149f0,_0x3cda21['options']);return db[_0x7c08('0x29')]['find'](_0x1149f0)['then'](handleEntityNotFound(_0x3b0e5b,null))[_0x7c08('0x23')](respondWithResult(_0x3b0e5b,null))[_0x7c08('0x42')](handleError(_0x3b0e5b,null));};exports[_0x7c08('0x45')]=function(_0x318210,_0x310cf2){return db[_0x7c08('0x29')][_0x7c08('0x45')](_0x318210[_0x7c08('0x46')],{})[_0x7c08('0x23')](respondWithResult(_0x310cf2,0xc9))[_0x7c08('0x42')](handleError(_0x310cf2,null));};exports['update']=function(_0x468536,_0x1875a7){if(_0x468536[_0x7c08('0x46')]['id']){delete _0x468536[_0x7c08('0x46')]['id'];}return db[_0x7c08('0x29')][_0x7c08('0x47')]({'where':{'id':_0x468536[_0x7c08('0x43')]['id']}})[_0x7c08('0x23')](handleEntityNotFound(_0x1875a7,null))[_0x7c08('0x23')](saveUpdates(_0x468536[_0x7c08('0x46')],null))['then'](respondWithResult(_0x1875a7,null))[_0x7c08('0x42')](handleError(_0x1875a7,null));};exports[_0x7c08('0x48')]=function(_0x5387e5,_0xb54189){return db[_0x7c08('0x29')][_0x7c08('0x47')]({'where':{'id':_0x5387e5[_0x7c08('0x43')]['id']}})[_0x7c08('0x23')](handleEntityNotFound(_0xb54189,null))[_0x7c08('0x23')](removeEntity(_0xb54189,null))['catch'](handleError(_0xb54189,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 2be7bd5..555059b 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 _0x4001=['../../config/environment','./mailServerOut.attributes','define','MailServerOut','mail_servers_out','lodash','moment','path','rimraf'];(function(_0x14eb9,_0x4d7680){var _0x44cc40=function(_0x4a0c8c){while(--_0x4a0c8c){_0x14eb9['push'](_0x14eb9['shift']());}};_0x44cc40(++_0x4d7680);}(_0x4001,0xf8));var _0x1400=function(_0x258d58,_0xa70cc0){_0x258d58=_0x258d58-0x0;var _0xdcbc04=_0x4001[_0x258d58];return _0xdcbc04;};'use strict';var _=require(_0x1400('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1400('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1400('0x2'));var rimraf=require(_0x1400('0x3'));var config=require(_0x1400('0x4'));var attributes=require(_0x1400('0x5'));module['exports']=function(_0x6526ab,_0x218981){return _0x6526ab[_0x1400('0x6')](_0x1400('0x7'),attributes,{'tableName':_0x1400('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf64=['../../config/environment','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x412f09,_0x35c149){var _0x29c61f=function(_0x54c770){while(--_0x54c770){_0x412f09['push'](_0x412f09['shift']());}};_0x29c61f(++_0x35c149);}(_0xcf64,0x9f));var _0x4cf6=function(_0x5e4886,_0x15ce6e){_0x5e4886=_0x5e4886-0x0;var _0x1bb9f6=_0xcf64[_0x5e4886];return _0x1bb9f6;};'use strict';var _=require(_0x4cf6('0x0'));var util=require(_0x4cf6('0x1'));var logger=require(_0x4cf6('0x2'))(_0x4cf6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4cf6('0x4'));var fs=require('fs');var path=require(_0x4cf6('0x5'));var rimraf=require('rimraf');var config=require(_0x4cf6('0x6'));var attributes=require('./mailServerOut.attributes');module[_0x4cf6('0x7')]=function(_0x1bbd86,_0x3a072a){return _0x1bbd86[_0x4cf6('0x8')](_0x4cf6('0x9'),attributes,{'tableName':_0x4cf6('0xa'),'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 d8d4473..8cb0840 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(_0x99db4c,_0x25f7ed){var _0x417025=function(_0x5b964d){while(--_0x5b964d){_0x99db4c['push'](_0x99db4c['shift']());}};_0x417025(++_0x25f7ed);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc4aa[_0x2641f9];return _0x585741;};'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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x3096e5,_0x5b3392){var _0x348a5a=function(_0x34ec9d){while(--_0x34ec9d){_0x3096e5['push'](_0x3096e5['shift']());}};_0x348a5a(++_0x5b3392);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1a82eb,_0x5d8426){_0x1a82eb=_0x1a82eb-0x0;var _0x5b894a=_0x5f2f[_0x1a82eb];return _0x5b894a;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index a12c3b1..b38fb5d 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 _0xa212=['express','Router','fs-extra','../../config/environment','./mailSubstatus.controller','get','index','/:id','show','create','isAuthenticated','delete','destroy','exports','multer','util','path'];(function(_0xea83ae,_0x4087f9){var _0xfcfa21=function(_0x2eb4a7){while(--_0x2eb4a7){_0xea83ae['push'](_0xea83ae['shift']());}};_0xfcfa21(++_0x4087f9);}(_0xa212,0xda));var _0x2a21=function(_0x36d704,_0xe8efa2){_0x36d704=_0x36d704-0x0;var _0x19afb5=_0xa212[_0x36d704];return _0x19afb5;};'use strict';var multer=require(_0x2a21('0x0'));var util=require(_0x2a21('0x1'));var path=require(_0x2a21('0x2'));var timeout=require('connect-timeout');var express=require(_0x2a21('0x3'));var router=express[_0x2a21('0x4')]();var fs_extra=require(_0x2a21('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2a21('0x6'));var controller=require(_0x2a21('0x7'));router[_0x2a21('0x8')]('/',auth['isAuthenticated'](),controller[_0x2a21('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x2a21('0x8')](_0x2a21('0xa'),auth['isAuthenticated'](),controller[_0x2a21('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2a21('0xc')]);router['put']('/:id',auth[_0x2a21('0xd')](),controller['update']);router[_0x2a21('0xe')](_0x2a21('0xa'),auth[_0x2a21('0xd')](),controller[_0x2a21('0xf')]);module[_0x2a21('0x10')]=router; \ No newline at end of file +var _0x8ec7=['get','isAuthenticated','index','/describe','/:id','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller'];(function(_0x21ef6f,_0x30208e){var _0x558d88=function(_0x2b766b){while(--_0x2b766b){_0x21ef6f['push'](_0x21ef6f['shift']());}};_0x558d88(++_0x30208e);}(_0x8ec7,0x100));var _0x78ec=function(_0x1044e5,_0x498e01){_0x1044e5=_0x1044e5-0x0;var _0x5ad0dd=_0x8ec7[_0x1044e5];return _0x5ad0dd;};'use strict';var multer=require(_0x78ec('0x0'));var util=require(_0x78ec('0x1'));var path=require(_0x78ec('0x2'));var timeout=require(_0x78ec('0x3'));var express=require(_0x78ec('0x4'));var router=express[_0x78ec('0x5')]();var fs_extra=require(_0x78ec('0x6'));var auth=require(_0x78ec('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x78ec('0x8'));var controller=require(_0x78ec('0x9'));router[_0x78ec('0xa')]('/',auth[_0x78ec('0xb')](),controller[_0x78ec('0xc')]);router[_0x78ec('0xa')](_0x78ec('0xd'),auth[_0x78ec('0xb')](),controller['describe']);router[_0x78ec('0xa')](_0x78ec('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x78ec('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x78ec('0x10')]);router[_0x78ec('0x11')](_0x78ec('0xe'),auth[_0x78ec('0xb')](),controller[_0x78ec('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 32d383a..4769971 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 _0x11e5=['name','sequelize','STRING'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x11e5,0x8b));var _0x511e=function(_0x2f66fe,_0x46be8b){_0x2f66fe=_0x2f66fe-0x0;var _0x1a1d22=_0x11e5[_0x2f66fe];return _0x1a1d22;};'use strict';var Sequelize=require(_0x511e('0x0'));module['exports']={'name':{'type':Sequelize[_0x511e('0x1')],'unique':_0x511e('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfdbd=['sequelize','exports','STRING','name'];(function(_0x17b31d,_0x3654f0){var _0xd68ac4=function(_0x164129){while(--_0x164129){_0x17b31d['push'](_0x17b31d['shift']());}};_0xd68ac4(++_0x3654f0);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x5515a7,_0x2c4af1){_0x5515a7=_0x5515a7-0x0;var _0x43f4bf=_0xfdbd[_0x5515a7];return _0x43f4bf;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'unique':_0xdfdb('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdfdb('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index dfb022c..e4a1091 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 _0x042b=['MailSubstatus','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name'];(function(_0xcb9720,_0x381df0){var _0x2b3dac=function(_0x2e2c3){while(--_0x2e2c3){_0xcb9720['push'](_0xcb9720['shift']());}};_0x2b3dac(++_0x381df0);}(_0x042b,0xfa));var _0xb042=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x042b[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0xb042('0x0'));var rimraf=require(_0xb042('0x1'));var zipdir=require(_0xb042('0x2'));var jsonpatch=require(_0xb042('0x3'));var rp=require(_0xb042('0x4'));var moment=require('moment');var BPromise=require(_0xb042('0x5'));var Mustache=require('mustache');var util=require(_0xb042('0x6'));var path=require(_0xb042('0x7'));var sox=require(_0xb042('0x8'));var csv=require(_0xb042('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb042('0xa'));var _=require(_0xb042('0xb'));var squel=require(_0xb042('0xc'));var crypto=require(_0xb042('0xd'));var jsforce=require(_0xb042('0xe'));var deskjs=require(_0xb042('0xf'));var toCsv=require(_0xb042('0x9'));var querystring=require(_0xb042('0x10'));var Papa=require(_0xb042('0x11'));var Redis=require(_0xb042('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb042('0x13'));var as=require(_0xb042('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb042('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb042('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53d8b7,_0x51f2c9){_0x51f2c9=_0x51f2c9||0xcc;return function(_0x45b67b){if(_0x45b67b){return _0x53d8b7[_0xb042('0x17')](_0x51f2c9);}return _0x53d8b7[_0xb042('0x18')](_0x51f2c9)[_0xb042('0x19')]();};}function respondWithResult(_0x368f60,_0x508ef9){_0x508ef9=_0x508ef9||0xc8;return function(_0x115204){if(_0x115204){return _0x368f60[_0xb042('0x18')](_0x508ef9)['json'](_0x115204);}};}function respondWithFilteredResult(_0x28fa59,_0x367d07){return function(_0x3cf495){if(_0x3cf495){var _0x6fbf5f=typeof _0x367d07[_0xb042('0x1a')]===_0xb042('0x1b')&&typeof _0x367d07[_0xb042('0x1c')]===_0xb042('0x1b');var _0x4c13c5=_0x3cf495[_0xb042('0x1d')];var _0x55d4d0=_0x6fbf5f?0x0:_0x367d07[_0xb042('0x1a')];var _0x3067d2=_0x6fbf5f?_0x3cf495[_0xb042('0x1d')]:_0x367d07[_0xb042('0x1a')]+_0x367d07[_0xb042('0x1c')];var _0x1a26c5;if(_0x3067d2>=_0x4c13c5){_0x3067d2=_0x4c13c5;_0x1a26c5=0xc8;}else{_0x1a26c5=0xce;}_0x28fa59['status'](_0x1a26c5);return _0x28fa59[_0xb042('0x1e')](_0xb042('0x1f'),_0x55d4d0+'-'+_0x3067d2+'/'+_0x4c13c5)[_0xb042('0x20')](_0x3cf495);}return null;};}function patchUpdates(_0x297746){return function(_0x3fda80){try{jsonpatch[_0xb042('0x21')](_0x3fda80,_0x297746,!![]);}catch(_0x1be66c){return BPromise[_0xb042('0x22')](_0x1be66c);}return _0x3fda80[_0xb042('0x23')]();};}function saveUpdates(_0x2b6111,_0x3e8d3f){return function(_0x519535){if(_0x519535){return _0x519535[_0xb042('0x24')](_0x2b6111)['then'](function(_0x270e59){return _0x270e59;});}return null;};}function removeEntity(_0x45577b,_0x599f8e){return function(_0x212ba3){if(_0x212ba3){return _0x212ba3[_0xb042('0x25')]()[_0xb042('0x26')](function(){_0x45577b['status'](0xcc)[_0xb042('0x19')]();});}};}function handleEntityNotFound(_0x182e82,_0x27ed77){return function(_0x1bcef3){if(!_0x1bcef3){_0x182e82[_0xb042('0x17')](0x194);}return _0x1bcef3;};}function handleError(_0x25ca98,_0x31b02f){_0x31b02f=_0x31b02f||0x1f4;return function(_0x5ed43c){logger[_0xb042('0x27')](_0x5ed43c[_0xb042('0x28')]);if(_0x5ed43c['name']){delete _0x5ed43c[_0xb042('0x29')];}_0x25ca98[_0xb042('0x18')](_0x31b02f)['send'](_0x5ed43c);};}exports['index']=function(_0xba8d6e,_0x2f0b8e){var _0x364ee1={},_0x496d65={},_0x431362={'count':0x0,'rows':[]};var _0x336385=_['map'](db[_0xb042('0x2a')][_0xb042('0x2b')],function(_0x3df4ef){return{'name':_0x3df4ef['fieldName'],'type':_0x3df4ef[_0xb042('0x2c')]['key']};});_0x496d65[_0xb042('0x2d')]=_[_0xb042('0x2e')](_0x336385,_0xb042('0x29'));_0x496d65[_0xb042('0x2f')]=_[_0xb042('0x30')](_0xba8d6e[_0xb042('0x2f')]);_0x496d65[_0xb042('0x31')]=_[_0xb042('0x32')](_0x496d65[_0xb042('0x2d')],_0x496d65[_0xb042('0x2f')]);_0x364ee1[_0xb042('0x33')]=_['intersection'](_0x496d65[_0xb042('0x2d')],qs[_0xb042('0x34')](_0xba8d6e[_0xb042('0x2f')]['fields']));_0x364ee1['attributes']=_0x364ee1['attributes'][_0xb042('0x35')]?_0x364ee1[_0xb042('0x33')]:_0x496d65['model'];if(!_0xba8d6e[_0xb042('0x2f')]['hasOwnProperty'](_0xb042('0x36'))){_0x364ee1[_0xb042('0x1c')]=qs[_0xb042('0x1c')](_0xba8d6e[_0xb042('0x2f')][_0xb042('0x1c')]);_0x364ee1[_0xb042('0x1a')]=qs[_0xb042('0x1a')](_0xba8d6e[_0xb042('0x2f')][_0xb042('0x1a')]);}_0x364ee1[_0xb042('0x37')]=qs[_0xb042('0x38')](_0xba8d6e[_0xb042('0x2f')]['sort']);_0x364ee1[_0xb042('0x39')]=qs[_0xb042('0x31')](_[_0xb042('0x3a')](_0xba8d6e['query'],_0x496d65[_0xb042('0x31')]),_0x336385);if(_0xba8d6e[_0xb042('0x2f')][_0xb042('0x3b')]){_0x364ee1['where']=_[_0xb042('0x3c')](_0x364ee1[_0xb042('0x39')],{'$or':_[_0xb042('0x2e')](_0x336385,function(_0x20c0fa){if(_0x20c0fa[_0xb042('0x2c')]!==_0xb042('0x3d')){var _0x3c6ab2={};_0x3c6ab2[_0x20c0fa[_0xb042('0x29')]]={'$like':'%'+_0xba8d6e[_0xb042('0x2f')]['filter']+'%'};return _0x3c6ab2;}})});}_0x364ee1=_[_0xb042('0x3c')]({},_0x364ee1,_0xba8d6e['options']);var _0x1859d8={'where':_0x364ee1['where']};return db[_0xb042('0x2a')][_0xb042('0x1d')](_0x1859d8)['then'](function(_0x4e93d7){_0x431362[_0xb042('0x1d')]=_0x4e93d7;if(_0xba8d6e[_0xb042('0x2f')][_0xb042('0x3e')]){_0x364ee1[_0xb042('0x3f')]=[{'all':!![]}];}return db[_0xb042('0x2a')][_0xb042('0x40')](_0x364ee1);})[_0xb042('0x26')](function(_0x276352){_0x431362['rows']=_0x276352;return _0x431362;})[_0xb042('0x26')](respondWithFilteredResult(_0x2f0b8e,_0x364ee1))[_0xb042('0x41')](handleError(_0x2f0b8e,null));};exports[_0xb042('0x42')]=function(_0x16aadd,_0x1d1596){var _0x13c036={'raw':!![],'where':{'id':_0x16aadd[_0xb042('0x43')]['id']}},_0x53a893={};_0x53a893[_0xb042('0x2d')]=_[_0xb042('0x30')](db['MailSubstatus'][_0xb042('0x2b')]);_0x53a893[_0xb042('0x2f')]=_['keys'](_0x16aadd[_0xb042('0x2f')]);_0x53a893[_0xb042('0x31')]=_[_0xb042('0x32')](_0x53a893['model'],_0x53a893[_0xb042('0x2f')]);_0x13c036['attributes']=_[_0xb042('0x32')](_0x53a893[_0xb042('0x2d')],qs[_0xb042('0x34')](_0x16aadd[_0xb042('0x2f')]['fields']));_0x13c036[_0xb042('0x33')]=_0x13c036[_0xb042('0x33')]['length']?_0x13c036['attributes']:_0x53a893[_0xb042('0x2d')];if(_0x16aadd[_0xb042('0x2f')][_0xb042('0x3e')]){_0x13c036[_0xb042('0x3f')]=[{'all':!![]}];}_0x13c036=_[_0xb042('0x3c')]({},_0x13c036,_0x16aadd[_0xb042('0x44')]);return db[_0xb042('0x2a')][_0xb042('0x45')](_0x13c036)['then'](handleEntityNotFound(_0x1d1596,null))['then'](respondWithResult(_0x1d1596,null))[_0xb042('0x41')](handleError(_0x1d1596,null));};exports['create']=function(_0x47a621,_0x307197){return db[_0xb042('0x2a')][_0xb042('0x46')](_0x47a621['body'],{})['then'](respondWithResult(_0x307197,0xc9))[_0xb042('0x41')](handleError(_0x307197,null));};exports['update']=function(_0x576244,_0x283164){if(_0x576244[_0xb042('0x47')]['id']){delete _0x576244[_0xb042('0x47')]['id'];}return db[_0xb042('0x2a')][_0xb042('0x45')]({'where':{'id':_0x576244[_0xb042('0x43')]['id']}})['then'](handleEntityNotFound(_0x283164,null))[_0xb042('0x26')](saveUpdates(_0x576244['body'],null))['then'](respondWithResult(_0x283164,null))[_0xb042('0x41')](handleError(_0x283164,null));};exports['destroy']=function(_0x30fbe7,_0x286c1f){return db['MailSubstatus'][_0xb042('0x45')]({'where':{'id':_0x30fbe7[_0xb042('0x43')]['id']}})[_0xb042('0x26')](handleEntityNotFound(_0x286c1f,null))[_0xb042('0x26')](removeEntity(_0x286c1f,null))['catch'](handleError(_0x286c1f,null));};exports[_0xb042('0x48')]=function(_0x23555f,_0x5c5d9d){return db[_0xb042('0x2a')][_0xb042('0x48')]()[_0xb042('0x26')](respondWithResult(_0x5c5d9d,null))[_0xb042('0x41')](handleError(_0x5c5d9d,null));}; \ No newline at end of file +var _0x415a=['VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','MailSubstatus','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x415a,0x137));var _0xa415=function(_0x4a0f17,_0x1a56d2){_0x4a0f17=_0x4a0f17-0x0;var _0x2a315b=_0x415a[_0x4a0f17];return _0x2a315b;};'use strict';var emlformat=require(_0xa415('0x0'));var rimraf=require(_0xa415('0x1'));var zipdir=require(_0xa415('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa415('0x3'));var moment=require(_0xa415('0x4'));var BPromise=require(_0xa415('0x5'));var Mustache=require(_0xa415('0x6'));var util=require('util');var path=require(_0xa415('0x7'));var sox=require(_0xa415('0x8'));var csv=require(_0xa415('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa415('0xa'));var _=require(_0xa415('0xb'));var squel=require(_0xa415('0xc'));var crypto=require(_0xa415('0xd'));var jsforce=require(_0xa415('0xe'));var deskjs=require(_0xa415('0xf'));var toCsv=require(_0xa415('0x9'));var querystring=require(_0xa415('0x10'));var Papa=require(_0xa415('0x11'));var Redis=require(_0xa415('0x12'));var authService=require(_0xa415('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa415('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa415('0x15'))(_0xa415('0x16'));var utils=require(_0xa415('0x17'));var config=require(_0xa415('0x18'));var licenseUtil=require(_0xa415('0x19'));var db=require(_0xa415('0x1a'))['db'];function respondWithStatusCode(_0x4f0074,_0x253e3e){_0x253e3e=_0x253e3e||0xcc;return function(_0x179695){if(_0x179695){return _0x4f0074[_0xa415('0x1b')](_0x253e3e);}return _0x4f0074[_0xa415('0x1c')](_0x253e3e)[_0xa415('0x1d')]();};}function respondWithResult(_0x2f3d14,_0x2c81d5){_0x2c81d5=_0x2c81d5||0xc8;return function(_0x4bcaf7){if(_0x4bcaf7){return _0x2f3d14[_0xa415('0x1c')](_0x2c81d5)[_0xa415('0x1e')](_0x4bcaf7);}};}function respondWithFilteredResult(_0x257664,_0x1e02a5){return function(_0x1a4f26){if(_0x1a4f26){var _0x5ccaef=typeof _0x1e02a5[_0xa415('0x1f')]===_0xa415('0x20')&&typeof _0x1e02a5[_0xa415('0x21')]==='undefined';var _0x5108ca=_0x1a4f26['count'];var _0x5939fa=_0x5ccaef?0x0:_0x1e02a5[_0xa415('0x1f')];var _0x1d6b3d=_0x5ccaef?_0x1a4f26[_0xa415('0x22')]:_0x1e02a5[_0xa415('0x1f')]+_0x1e02a5['limit'];var _0x1e6c6c;if(_0x1d6b3d>=_0x5108ca){_0x1d6b3d=_0x5108ca;_0x1e6c6c=0xc8;}else{_0x1e6c6c=0xce;}_0x257664[_0xa415('0x1c')](_0x1e6c6c);return _0x257664['set'](_0xa415('0x23'),_0x5939fa+'-'+_0x1d6b3d+'/'+_0x5108ca)[_0xa415('0x1e')](_0x1a4f26);}return null;};}function patchUpdates(_0x50d78b){return function(_0x5b7b31){try{jsonpatch[_0xa415('0x24')](_0x5b7b31,_0x50d78b,!![]);}catch(_0x8cd3f5){return BPromise[_0xa415('0x25')](_0x8cd3f5);}return _0x5b7b31[_0xa415('0x26')]();};}function saveUpdates(_0x53fa82,_0x3c1faa){return function(_0x4f2415){if(_0x4f2415){return _0x4f2415[_0xa415('0x27')](_0x53fa82)['then'](function(_0x5edb77){return _0x5edb77;});}return null;};}function removeEntity(_0x111bc9,_0x22c324){return function(_0x1def7f){if(_0x1def7f){return _0x1def7f[_0xa415('0x28')]()[_0xa415('0x29')](function(){_0x111bc9[_0xa415('0x1c')](0xcc)[_0xa415('0x1d')]();});}};}function handleEntityNotFound(_0x40cc19,_0x3c0cbf){return function(_0x5ca0b6){if(!_0x5ca0b6){_0x40cc19[_0xa415('0x1b')](0x194);}return _0x5ca0b6;};}function handleError(_0x586658,_0x40961b){_0x40961b=_0x40961b||0x1f4;return function(_0x1d96d1){logger[_0xa415('0x2a')](_0x1d96d1['stack']);if(_0x1d96d1[_0xa415('0x2b')]){delete _0x1d96d1['name'];}_0x586658[_0xa415('0x1c')](_0x40961b)[_0xa415('0x2c')](_0x1d96d1);};}exports[_0xa415('0x2d')]=function(_0x52c9b5,_0x168719){var _0x47ccb5={},_0xc113ad={},_0x45c0cf={'count':0x0,'rows':[]};var _0x46e907=_[_0xa415('0x2e')](db[_0xa415('0x2f')]['rawAttributes'],function(_0x4506f0){return{'name':_0x4506f0[_0xa415('0x30')],'type':_0x4506f0[_0xa415('0x31')]['key']};});_0xc113ad[_0xa415('0x32')]=_[_0xa415('0x2e')](_0x46e907,_0xa415('0x2b'));_0xc113ad[_0xa415('0x33')]=_[_0xa415('0x34')](_0x52c9b5[_0xa415('0x33')]);_0xc113ad[_0xa415('0x35')]=_[_0xa415('0x36')](_0xc113ad[_0xa415('0x32')],_0xc113ad[_0xa415('0x33')]);_0x47ccb5['attributes']=_['intersection'](_0xc113ad[_0xa415('0x32')],qs[_0xa415('0x37')](_0x52c9b5[_0xa415('0x33')][_0xa415('0x37')]));_0x47ccb5[_0xa415('0x38')]=_0x47ccb5['attributes'][_0xa415('0x39')]?_0x47ccb5[_0xa415('0x38')]:_0xc113ad[_0xa415('0x32')];if(!_0x52c9b5[_0xa415('0x33')]['hasOwnProperty'](_0xa415('0x3a'))){_0x47ccb5[_0xa415('0x21')]=qs[_0xa415('0x21')](_0x52c9b5[_0xa415('0x33')][_0xa415('0x21')]);_0x47ccb5['offset']=qs[_0xa415('0x1f')](_0x52c9b5['query'][_0xa415('0x1f')]);}_0x47ccb5[_0xa415('0x3b')]=qs[_0xa415('0x3c')](_0x52c9b5['query'][_0xa415('0x3c')]);_0x47ccb5[_0xa415('0x3d')]=qs['filters'](_['pick'](_0x52c9b5[_0xa415('0x33')],_0xc113ad[_0xa415('0x35')]),_0x46e907);if(_0x52c9b5[_0xa415('0x33')][_0xa415('0x3e')]){_0x47ccb5[_0xa415('0x3d')]=_[_0xa415('0x3f')](_0x47ccb5[_0xa415('0x3d')],{'$or':_[_0xa415('0x2e')](_0x46e907,function(_0x2af229){if(_0x2af229[_0xa415('0x31')]!==_0xa415('0x40')){var _0x3eed6a={};_0x3eed6a[_0x2af229[_0xa415('0x2b')]]={'$like':'%'+_0x52c9b5[_0xa415('0x33')][_0xa415('0x3e')]+'%'};return _0x3eed6a;}})});}_0x47ccb5=_[_0xa415('0x3f')]({},_0x47ccb5,_0x52c9b5[_0xa415('0x41')]);var _0x5d2769={'where':_0x47ccb5[_0xa415('0x3d')]};return db[_0xa415('0x2f')][_0xa415('0x22')](_0x5d2769)['then'](function(_0x57535c){_0x45c0cf[_0xa415('0x22')]=_0x57535c;if(_0x52c9b5[_0xa415('0x33')][_0xa415('0x42')]){_0x47ccb5[_0xa415('0x43')]=[{'all':!![]}];}return db[_0xa415('0x2f')]['findAll'](_0x47ccb5);})[_0xa415('0x29')](function(_0x5a1b22){_0x45c0cf['rows']=_0x5a1b22;return _0x45c0cf;})[_0xa415('0x29')](respondWithFilteredResult(_0x168719,_0x47ccb5))[_0xa415('0x44')](handleError(_0x168719,null));};exports[_0xa415('0x45')]=function(_0x54c5e8,_0x59bf03){var _0x441417={'raw':!![],'where':{'id':_0x54c5e8[_0xa415('0x46')]['id']}},_0x20a3ef={};_0x20a3ef[_0xa415('0x32')]=_[_0xa415('0x34')](db[_0xa415('0x2f')]['rawAttributes']);_0x20a3ef[_0xa415('0x33')]=_[_0xa415('0x34')](_0x54c5e8[_0xa415('0x33')]);_0x20a3ef[_0xa415('0x35')]=_[_0xa415('0x36')](_0x20a3ef[_0xa415('0x32')],_0x20a3ef[_0xa415('0x33')]);_0x441417[_0xa415('0x38')]=_['intersection'](_0x20a3ef[_0xa415('0x32')],qs[_0xa415('0x37')](_0x54c5e8[_0xa415('0x33')][_0xa415('0x37')]));_0x441417[_0xa415('0x38')]=_0x441417[_0xa415('0x38')][_0xa415('0x39')]?_0x441417[_0xa415('0x38')]:_0x20a3ef[_0xa415('0x32')];if(_0x54c5e8[_0xa415('0x33')][_0xa415('0x42')]){_0x441417[_0xa415('0x43')]=[{'all':!![]}];}_0x441417=_[_0xa415('0x3f')]({},_0x441417,_0x54c5e8[_0xa415('0x41')]);return db[_0xa415('0x2f')][_0xa415('0x47')](_0x441417)[_0xa415('0x29')](handleEntityNotFound(_0x59bf03,null))[_0xa415('0x29')](respondWithResult(_0x59bf03,null))[_0xa415('0x44')](handleError(_0x59bf03,null));};exports['create']=function(_0x1eb5a4,_0x1b2ef1){return db[_0xa415('0x2f')][_0xa415('0x48')](_0x1eb5a4[_0xa415('0x49')],{})[_0xa415('0x29')](respondWithResult(_0x1b2ef1,0xc9))[_0xa415('0x44')](handleError(_0x1b2ef1,null));};exports[_0xa415('0x27')]=function(_0x340626,_0xb50471){if(_0x340626[_0xa415('0x49')]['id']){delete _0x340626['body']['id'];}return db[_0xa415('0x2f')][_0xa415('0x47')]({'where':{'id':_0x340626[_0xa415('0x46')]['id']}})[_0xa415('0x29')](handleEntityNotFound(_0xb50471,null))[_0xa415('0x29')](saveUpdates(_0x340626['body'],null))['then'](respondWithResult(_0xb50471,null))['catch'](handleError(_0xb50471,null));};exports[_0xa415('0x28')]=function(_0x145cb4,_0x2c9da2){return db[_0xa415('0x2f')][_0xa415('0x47')]({'where':{'id':_0x145cb4[_0xa415('0x46')]['id']}})[_0xa415('0x29')](handleEntityNotFound(_0x2c9da2,null))[_0xa415('0x29')](removeEntity(_0x2c9da2,null))[_0xa415('0x44')](handleError(_0x2c9da2,null));};exports[_0xa415('0x4a')]=function(_0x2420e0,_0x1ff5db){return db[_0xa415('0x2f')]['describe']()[_0xa415('0x29')](respondWithResult(_0x1ff5db,null))['catch'](handleError(_0x1ff5db,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 11c85d0..c48ca8f 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 _0x608a=['MailSubstatus','setMaxListeners','update','emit','events','../../mysqldb'];(function(_0x3c7d53,_0x2826d0){var _0x2c8387=function(_0x21f0e8){while(--_0x21f0e8){_0x3c7d53['push'](_0x3c7d53['shift']());}};_0x2c8387(++_0x2826d0);}(_0x608a,0x100));var _0xa608=function(_0x484f4b,_0x4af77f){_0x484f4b=_0x484f4b-0x0;var _0x5f5966=_0x608a[_0x484f4b];return _0x5f5966;};'use strict';var EventEmitter=require(_0xa608('0x0'));var MailSubstatus=require(_0xa608('0x1'))['db'][_0xa608('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xa608('0x3')](0x0);var events={'afterUpdate':_0xa608('0x4')};function emitEvent(_0x3066fb){return function(_0x116aff,_0x43fc3e,_0x52aad0){MailSubstatusEvents['emit'](_0x3066fb+':'+_0x116aff['id'],_0x116aff);MailSubstatusEvents[_0xa608('0x5')](_0x3066fb,_0x116aff);_0x52aad0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0xec87=['emit','hasOwnProperty','exports','MailSubstatus','update'];(function(_0x305855,_0x28c119){var _0x8272f8=function(_0x3f7340){while(--_0x3f7340){_0x305855['push'](_0x305855['shift']());}};_0x8272f8(++_0x28c119);}(_0xec87,0x18e));var _0x7ec8=function(_0x16337a,_0x4789a1){_0x16337a=_0x16337a-0x0;var _0x422365=_0xec87[_0x16337a];return _0x422365;};'use strict';var EventEmitter=require('events');var MailSubstatus=require('../../mysqldb')['db'][_0x7ec8('0x0')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x7ec8('0x1')};function emitEvent(_0x104020){return function(_0x7b7a5b,_0x1a589d,_0x31041b){MailSubstatusEvents[_0x7ec8('0x2')](_0x104020+':'+_0x7b7a5b['id'],_0x7b7a5b);MailSubstatusEvents[_0x7ec8('0x2')](_0x104020,_0x7b7a5b);_0x31041b(null);};}for(var e in events){if(events[_0x7ec8('0x3')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x7ec8('0x4')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index cb4d184..29930aa 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 _0x6798=['name','then','catch','./mailSubstatus.attributes','models','define','MailSubstatus','mail_substatuses','Condition','update','mailSubstatus','_previousDataValues'];(function(_0x217c2e,_0x358f06){var _0x22b7d8=function(_0x111c48){while(--_0x111c48){_0x217c2e['push'](_0x217c2e['shift']());}};_0x22b7d8(++_0x358f06);}(_0x6798,0x1d7));var _0x8679=function(_0x2d2d31,_0x213a42){_0x2d2d31=_0x2d2d31-0x0;var _0x74cc2a=_0x6798[_0x2d2d31];return _0x74cc2a;};'use strict';var attributes=require(_0x8679('0x0'));module['exports']=function(_0x17a678){var _0x2bad85=_0x17a678[_0x8679('0x1')];return _0x17a678[_0x8679('0x2')](_0x8679('0x3'),attributes,{'tableName':_0x8679('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x4e3917,_0x374e16,_0xff532b){return _0x2bad85[_0x8679('0x5')][_0x8679('0x6')]({'value':_0x4e3917['name']},{'where':{'field':_0x8679('0x7'),'value':_0x4e3917[_0x8679('0x8')][_0x8679('0x9')]}})[_0x8679('0xa')](function(){_0xff532b();})[_0x8679('0xb')](function(_0x52d3b3){_0xff532b(_0x52d3b3);});}}});}; \ No newline at end of file +var _0xe3f3=['mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','./mailSubstatus.attributes','exports','define','MailSubstatus'];(function(_0x2d90ff,_0x11c2dc){var _0x50fe02=function(_0x9e8e84){while(--_0x9e8e84){_0x2d90ff['push'](_0x2d90ff['shift']());}};_0x50fe02(++_0x11c2dc);}(_0xe3f3,0x1eb));var _0x3e3f=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xe3f3[_0x5f309e];return _0x487b5e;};'use strict';var attributes=require(_0x3e3f('0x0'));module[_0x3e3f('0x1')]=function(_0x588a95){var _0x4a469b=_0x588a95['models'];return _0x588a95[_0x3e3f('0x2')](_0x3e3f('0x3'),attributes,{'tableName':_0x3e3f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3aff68,_0x3fcff2,_0xcbdc6e){return _0x4a469b[_0x3e3f('0x5')][_0x3e3f('0x6')]({'value':_0x3aff68[_0x3e3f('0x7')]},{'where':{'field':_0x3e3f('0x8'),'value':_0x3aff68[_0x3e3f('0x9')][_0x3e3f('0x7')]}})[_0x3e3f('0xa')](function(){_0xcbdc6e();})['catch'](function(_0x50cc50){_0xcbdc6e(_0x50cc50);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 7673048..a1edbec 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 _0x6433=['http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x1cf62b,_0x8b19){var _0x543a29=function(_0x18ddfd){while(--_0x18ddfd){_0x1cf62b['push'](_0x1cf62b['shift']());}};_0x543a29(++_0x8b19);}(_0x6433,0x18c));var _0x3643=function(_0x16a1a6,_0x1da60f){_0x16a1a6=_0x16a1a6-0x0;var _0x47e14d=_0x6433[_0x16a1a6];return _0x47e14d;};'use strict';var _=require(_0x3643('0x0'));var util=require(_0x3643('0x1'));var moment=require(_0x3643('0x2'));var BPromise=require(_0x3643('0x3'));var rs=require(_0x3643('0x4'));var fs=require('fs');var Redis=require(_0x3643('0x5'));var db=require(_0x3643('0x6'))['db'];var utils=require(_0x3643('0x7'));var logger=require(_0x3643('0x8'))(_0x3643('0x9'));var config=require(_0x3643('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3643('0xb')][_0x3643('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x614b80,_0x2f5192,_0x81a2fc){return new BPromise(function(_0x860109,_0xd7c7ed){return client[_0x3643('0xd')](_0x614b80,_0x81a2fc)[_0x3643('0xe')](function(_0x412575){logger['info'](_0x3643('0xf'),_0x2f5192,_0x3643('0x10'));logger[_0x3643('0x11')](_0x3643('0x12'),_0x2f5192,_0x3643('0x10'),JSON[_0x3643('0x13')](_0x412575));if(_0x412575[_0x3643('0x14')]){if(_0x412575[_0x3643('0x14')][_0x3643('0x15')]===0x1f4){logger['error'](_0x3643('0xf'),_0x2f5192,_0x412575[_0x3643('0x14')][_0x3643('0x16')]);return _0xd7c7ed(_0x412575[_0x3643('0x14')][_0x3643('0x16')]);}logger[_0x3643('0x14')]('MailSubstatus,\x20%s,\x20%s',_0x2f5192,_0x412575[_0x3643('0x14')]['message']);return _0x860109(_0x412575['error']['message']);}else{logger['info'](_0x3643('0xf'),_0x2f5192,'request\x20sent');_0x860109(_0x412575['result'][_0x3643('0x16')]);}})[_0x3643('0x17')](function(_0x2ac502){logger[_0x3643('0x14')](_0x3643('0xf'),_0x2f5192,_0x2ac502);_0xd7c7ed(_0x2ac502);});});} \ No newline at end of file +var _0x1bd8=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x1fcb63,_0x283fdc){var _0x3a5834=function(_0x5e6d28){while(--_0x5e6d28){_0x1fcb63['push'](_0x1fcb63['shift']());}};_0x3a5834(++_0x283fdc);}(_0x1bd8,0xfa));var _0x81bd=function(_0x213721,_0x5c4621){_0x213721=_0x213721-0x0;var _0x2223b5=_0x1bd8[_0x213721];return _0x2223b5;};'use strict';var _=require(_0x81bd('0x0'));var util=require('util');var moment=require(_0x81bd('0x1'));var BPromise=require(_0x81bd('0x2'));var rs=require(_0x81bd('0x3'));var fs=require('fs');var Redis=require(_0x81bd('0x4'));var db=require(_0x81bd('0x5'))['db'];var utils=require(_0x81bd('0x6'));var logger=require(_0x81bd('0x7'))(_0x81bd('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x81bd('0x9')][_0x81bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d4117,_0x530d62,_0x502b0b){return new BPromise(function(_0x1aeb83,_0x42e0eb){return client[_0x81bd('0xb')](_0x1d4117,_0x502b0b)[_0x81bd('0xc')](function(_0x157d89){logger[_0x81bd('0xd')](_0x81bd('0xe'),_0x530d62,_0x81bd('0xf'));logger[_0x81bd('0x10')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x530d62,_0x81bd('0xf'),JSON[_0x81bd('0x11')](_0x157d89));if(_0x157d89[_0x81bd('0x12')]){if(_0x157d89['error'][_0x81bd('0x13')]===0x1f4){logger[_0x81bd('0x12')](_0x81bd('0xe'),_0x530d62,_0x157d89[_0x81bd('0x12')][_0x81bd('0x14')]);return _0x42e0eb(_0x157d89[_0x81bd('0x12')]['message']);}logger[_0x81bd('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x530d62,_0x157d89[_0x81bd('0x12')][_0x81bd('0x14')]);return _0x1aeb83(_0x157d89[_0x81bd('0x12')][_0x81bd('0x14')]);}else{logger[_0x81bd('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x530d62,_0x81bd('0xf'));_0x1aeb83(_0x157d89[_0x81bd('0x15')][_0x81bd('0x14')]);}})[_0x81bd('0x16')](function(_0x53a2e9){logger[_0x81bd('0x12')](_0x81bd('0xe'),_0x530d62,_0x53a2e9);_0x42e0eb(_0x53a2e9);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 120e3f3..af70364 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 _0x20f0=['Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','destroy','multer','util','connect-timeout','express'];(function(_0x31cc0e,_0x24ba4c){var _0x144862=function(_0x4d236e){while(--_0x4d236e){_0x31cc0e['push'](_0x31cc0e['shift']());}};_0x144862(++_0x24ba4c);}(_0x20f0,0xb0));var _0x020f=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x20f0[_0x1203f];return _0x365f0a;};'use strict';var multer=require(_0x020f('0x0'));var util=require(_0x020f('0x1'));var path=require('path');var timeout=require(_0x020f('0x2'));var express=require(_0x020f('0x3'));var router=express[_0x020f('0x4')]();var fs_extra=require(_0x020f('0x5'));var auth=require(_0x020f('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router[_0x020f('0x7')]('/',auth[_0x020f('0x8')](),controller[_0x020f('0x9')]);router[_0x020f('0x7')](_0x020f('0xa'),auth[_0x020f('0x8')](),controller[_0x020f('0xb')]);router['get'](_0x020f('0xc'),auth['isAuthenticated'](),controller[_0x020f('0xd')]);router['post']('/',auth[_0x020f('0x8')](),controller[_0x020f('0xe')]);router[_0x020f('0xf')]('/:id',auth[_0x020f('0x8')](),controller[_0x020f('0x10')]);router['delete'](_0x020f('0xc'),auth[_0x020f('0x8')](),controller[_0x020f('0x11')]);module['exports']=router; \ No newline at end of file +var _0x2979=['/describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index'];(function(_0x1d2c0e,_0x2322d9){var _0x4d478b=function(_0x33db0b){while(--_0x33db0b){_0x1d2c0e['push'](_0x1d2c0e['shift']());}};_0x4d478b(++_0x2322d9);}(_0x2979,0x1c1));var _0x9297=function(_0x42e495,_0x49d9da){_0x42e495=_0x42e495-0x0;var _0x595da1=_0x2979[_0x42e495];return _0x595da1;};'use strict';var multer=require(_0x9297('0x0'));var util=require(_0x9297('0x1'));var path=require(_0x9297('0x2'));var timeout=require(_0x9297('0x3'));var express=require('express');var router=express[_0x9297('0x4')]();var fs_extra=require(_0x9297('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9297('0x6'));var config=require('../../config/environment');var controller=require(_0x9297('0x7'));router[_0x9297('0x8')]('/',auth[_0x9297('0x9')](),controller[_0x9297('0xa')]);router['get'](_0x9297('0xb'),auth[_0x9297('0x9')](),controller['describe']);router[_0x9297('0x8')](_0x9297('0xc'),auth[_0x9297('0x9')](),controller[_0x9297('0xd')]);router[_0x9297('0xe')]('/',auth[_0x9297('0x9')](),controller[_0x9297('0xf')]);router[_0x9297('0x10')]('/:id',auth[_0x9297('0x9')](),controller[_0x9297('0x11')]);router['delete'](_0x9297('0xc'),auth[_0x9297('0x9')](),controller[_0x9297('0x12')]);module[_0x9297('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 19f386a..986b110 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x43fda2,_0x1c5662){var _0xa492a2=function(_0x3a92c4){while(--_0x3a92c4){_0x43fda2['push'](_0x43fda2['shift']());}};_0xa492a2(++_0x1c5662);}(_0x54ef,0x112));var _0xf54e=function(_0x399fb4,_0x12124b){_0x399fb4=_0x399fb4-0x0;var _0x238623=_0x54ef[_0x399fb4];return _0x238623;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x2226e8,_0x282041){var _0x1054b3=function(_0x42704c){while(--_0x42704c){_0x2226e8['push'](_0x2226e8['shift']());}};_0x1054b3(++_0x282041);}(_0x00bb,0x1d8));var _0xb00b=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x00bb[_0x28947d];return _0x12d2ee;};'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 diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index b2ace0c..86c3e28 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 _0x1610=['jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','includeAll','include','options','find','catch','create','params','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash'];(function(_0x2832b4,_0x2992ef){var _0x1f0f44=function(_0x175055){while(--_0x175055){_0x2832b4['push'](_0x2832b4['shift']());}};_0x1f0f44(++_0x2992ef);}(_0x1610,0x14d));var _0x0161=function(_0x3df1f8,_0x373767){_0x3df1f8=_0x3df1f8-0x0;var _0xccc42d=_0x1610[_0x3df1f8];return _0xccc42d;};'use strict';var emlformat=require(_0x0161('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0161('0x1'));var jsonpatch=require(_0x0161('0x2'));var rp=require('request-promise');var moment=require(_0x0161('0x3'));var BPromise=require(_0x0161('0x4'));var Mustache=require(_0x0161('0x5'));var util=require(_0x0161('0x6'));var path=require(_0x0161('0x7'));var sox=require(_0x0161('0x8'));var csv=require('to-csv');var ejs=require(_0x0161('0x9'));var fs=require('fs');var fs_extra=require(_0x0161('0xa'));var _=require(_0x0161('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0161('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0161('0xd'));var querystring=require('querystring');var Papa=require(_0x0161('0xe'));var Redis=require(_0x0161('0xf'));var authService=require(_0x0161('0x10'));var qs=require(_0x0161('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0161('0x12'));var utils=require('../../config/utils');var config=require(_0x0161('0x13'));var licenseUtil=require(_0x0161('0x14'));var db=require(_0x0161('0x15'))['db'];function respondWithStatusCode(_0x4a4dbb,_0x20b309){_0x20b309=_0x20b309||0xcc;return function(_0x2e7178){if(_0x2e7178){return _0x4a4dbb[_0x0161('0x16')](_0x20b309);}return _0x4a4dbb[_0x0161('0x17')](_0x20b309)[_0x0161('0x18')]();};}function respondWithResult(_0x449f2e,_0x483509){_0x483509=_0x483509||0xc8;return function(_0x329ab3){if(_0x329ab3){return _0x449f2e[_0x0161('0x17')](_0x483509)['json'](_0x329ab3);}};}function respondWithFilteredResult(_0x2ee7ea,_0xcc905){return function(_0x2e83b8){if(_0x2e83b8){var _0x2f9125=typeof _0xcc905[_0x0161('0x19')]===_0x0161('0x1a')&&typeof _0xcc905[_0x0161('0x1b')]===_0x0161('0x1a');var _0x4c0bbb=_0x2e83b8[_0x0161('0x1c')];var _0xae55d9=_0x2f9125?0x0:_0xcc905[_0x0161('0x19')];var _0x9068a5=_0x2f9125?_0x2e83b8[_0x0161('0x1c')]:_0xcc905[_0x0161('0x19')]+_0xcc905['limit'];var _0x439c18;if(_0x9068a5>=_0x4c0bbb){_0x9068a5=_0x4c0bbb;_0x439c18=0xc8;}else{_0x439c18=0xce;}_0x2ee7ea[_0x0161('0x17')](_0x439c18);return _0x2ee7ea[_0x0161('0x1d')]('Content-Range',_0xae55d9+'-'+_0x9068a5+'/'+_0x4c0bbb)[_0x0161('0x1e')](_0x2e83b8);}return null;};}function patchUpdates(_0x207dd3){return function(_0x5064da){try{jsonpatch['apply'](_0x5064da,_0x207dd3,!![]);}catch(_0x1a1e62){return BPromise[_0x0161('0x1f')](_0x1a1e62);}return _0x5064da[_0x0161('0x20')]();};}function saveUpdates(_0x2c557c,_0x1a839c){return function(_0x1c88a0){if(_0x1c88a0){return _0x1c88a0[_0x0161('0x21')](_0x2c557c)[_0x0161('0x22')](function(_0x258863){return _0x258863;});}return null;};}function removeEntity(_0x481e2d,_0x459785){return function(_0x559f46){if(_0x559f46){return _0x559f46['destroy']()['then'](function(){_0x481e2d[_0x0161('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b5a18,_0x952917){return function(_0x28134a){if(!_0x28134a){_0x5b5a18['sendStatus'](0x194);}return _0x28134a;};}function handleError(_0x13ac70,_0x561d5e){_0x561d5e=_0x561d5e||0x1f4;return function(_0x4640ee){logger['error'](_0x4640ee[_0x0161('0x23')]);if(_0x4640ee['name']){delete _0x4640ee[_0x0161('0x24')];}_0x13ac70[_0x0161('0x17')](_0x561d5e)[_0x0161('0x25')](_0x4640ee);};}exports[_0x0161('0x26')]=function(_0x37ecd1,_0x3c9f3f){var _0x2b6d91={},_0x4fe0dd={},_0x3ddb70={'count':0x0,'rows':[]};var _0x2c6c4e=_[_0x0161('0x27')](db[_0x0161('0x28')][_0x0161('0x29')],function(_0x477f49){return{'name':_0x477f49[_0x0161('0x2a')],'type':_0x477f49[_0x0161('0x2b')]['key']};});_0x4fe0dd[_0x0161('0x2c')]=_[_0x0161('0x27')](_0x2c6c4e,_0x0161('0x24'));_0x4fe0dd['query']=_[_0x0161('0x2d')](_0x37ecd1[_0x0161('0x2e')]);_0x4fe0dd[_0x0161('0x2f')]=_['intersection'](_0x4fe0dd[_0x0161('0x2c')],_0x4fe0dd[_0x0161('0x2e')]);_0x2b6d91['attributes']=_[_0x0161('0x30')](_0x4fe0dd[_0x0161('0x2c')],qs['fields'](_0x37ecd1['query'][_0x0161('0x31')]));_0x2b6d91['attributes']=_0x2b6d91[_0x0161('0x32')][_0x0161('0x33')]?_0x2b6d91['attributes']:_0x4fe0dd[_0x0161('0x2c')];if(!_0x37ecd1[_0x0161('0x2e')][_0x0161('0x34')](_0x0161('0x35'))){_0x2b6d91['limit']=qs['limit'](_0x37ecd1['query'][_0x0161('0x1b')]);_0x2b6d91[_0x0161('0x19')]=qs['offset'](_0x37ecd1[_0x0161('0x2e')]['offset']);}_0x2b6d91['order']=qs[_0x0161('0x36')](_0x37ecd1[_0x0161('0x2e')][_0x0161('0x36')]);_0x2b6d91[_0x0161('0x37')]=qs[_0x0161('0x2f')](_['pick'](_0x37ecd1[_0x0161('0x2e')],_0x4fe0dd[_0x0161('0x2f')]),_0x2c6c4e);if(_0x37ecd1[_0x0161('0x2e')]['filter']){_0x2b6d91['where']=_[_0x0161('0x38')](_0x2b6d91[_0x0161('0x37')],{'$or':_[_0x0161('0x27')](_0x2c6c4e,function(_0x257fd1){if(_0x257fd1[_0x0161('0x2b')]!==_0x0161('0x39')){var _0x5210ed={};_0x5210ed[_0x257fd1[_0x0161('0x24')]]={'$like':'%'+_0x37ecd1[_0x0161('0x2e')][_0x0161('0x3a')]+'%'};return _0x5210ed;}})});}_0x2b6d91=_['merge']({},_0x2b6d91,_0x37ecd1['options']);var _0x43ec2d={'where':_0x2b6d91[_0x0161('0x37')]};return db[_0x0161('0x28')][_0x0161('0x1c')](_0x43ec2d)[_0x0161('0x22')](function(_0x5ca4c8){_0x3ddb70['count']=_0x5ca4c8;if(_0x37ecd1[_0x0161('0x2e')][_0x0161('0x3b')]){_0x2b6d91[_0x0161('0x3c')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x2b6d91);})['then'](function(_0x42ef6a){_0x3ddb70['rows']=_0x42ef6a;return _0x3ddb70;})[_0x0161('0x22')](respondWithFilteredResult(_0x3c9f3f,_0x2b6d91))['catch'](handleError(_0x3c9f3f,null));};exports['show']=function(_0x3daa5b,_0xf9e386){var _0x1c7083={'raw':!![],'where':{'id':_0x3daa5b['params']['id']}},_0x373566={};_0x373566[_0x0161('0x2c')]=_['keys'](db['MailTransferReport'][_0x0161('0x29')]);_0x373566['query']=_[_0x0161('0x2d')](_0x3daa5b[_0x0161('0x2e')]);_0x373566[_0x0161('0x2f')]=_[_0x0161('0x30')](_0x373566[_0x0161('0x2c')],_0x373566[_0x0161('0x2e')]);_0x1c7083['attributes']=_['intersection'](_0x373566[_0x0161('0x2c')],qs[_0x0161('0x31')](_0x3daa5b[_0x0161('0x2e')][_0x0161('0x31')]));_0x1c7083[_0x0161('0x32')]=_0x1c7083['attributes'][_0x0161('0x33')]?_0x1c7083[_0x0161('0x32')]:_0x373566[_0x0161('0x2c')];if(_0x3daa5b['query'][_0x0161('0x3b')]){_0x1c7083['include']=[{'all':!![]}];}_0x1c7083=_[_0x0161('0x38')]({},_0x1c7083,_0x3daa5b[_0x0161('0x3d')]);return db[_0x0161('0x28')][_0x0161('0x3e')](_0x1c7083)['then'](handleEntityNotFound(_0xf9e386,null))[_0x0161('0x22')](respondWithResult(_0xf9e386,null))[_0x0161('0x3f')](handleError(_0xf9e386,null));};exports[_0x0161('0x40')]=function(_0xb0ee1b,_0x1541c1){return db[_0x0161('0x28')][_0x0161('0x40')](_0xb0ee1b['body'],{})[_0x0161('0x22')](respondWithResult(_0x1541c1,0xc9))[_0x0161('0x3f')](handleError(_0x1541c1,null));};exports[_0x0161('0x21')]=function(_0xdb8216,_0x4131c9){if(_0xdb8216['body']['id']){delete _0xdb8216['body']['id'];}return db[_0x0161('0x28')][_0x0161('0x3e')]({'where':{'id':_0xdb8216[_0x0161('0x41')]['id']}})[_0x0161('0x22')](handleEntityNotFound(_0x4131c9,null))[_0x0161('0x22')](saveUpdates(_0xdb8216[_0x0161('0x42')],null))[_0x0161('0x22')](respondWithResult(_0x4131c9,null))[_0x0161('0x3f')](handleError(_0x4131c9,null));};exports[_0x0161('0x43')]=function(_0x44bce1,_0x49ffe3){return db[_0x0161('0x28')][_0x0161('0x3e')]({'where':{'id':_0x44bce1['params']['id']}})[_0x0161('0x22')](handleEntityNotFound(_0x49ffe3,null))[_0x0161('0x22')](removeEntity(_0x49ffe3,null))[_0x0161('0x3f')](handleError(_0x49ffe3,null));};exports[_0x0161('0x44')]=function(_0x3dc39b,_0x274083){return db['MailTransferReport']['describe']()[_0x0161('0x22')](respondWithResult(_0x274083,null))[_0x0161('0x3f')](handleError(_0x274083,null));}; \ No newline at end of file +var _0x2ae9=['request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','stack','name','index','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','nolimit','sort','filters','pick','where','merge','VIRTUAL','MailTransferReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch'];(function(_0x5c4e53,_0x5c15f7){var _0x581e7c=function(_0x2c1329){while(--_0x2c1329){_0x5c4e53['push'](_0x5c4e53['shift']());}};_0x581e7c(++_0x5c15f7);}(_0x2ae9,0xdb));var _0x92ae=function(_0x47b844,_0x3e805c){_0x47b844=_0x47b844-0x0;var _0x20f0e1=_0x2ae9[_0x47b844];return _0x20f0e1;};'use strict';var emlformat=require(_0x92ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x92ae('0x1'));var jsonpatch=require(_0x92ae('0x2'));var rp=require(_0x92ae('0x3'));var moment=require('moment');var BPromise=require(_0x92ae('0x4'));var Mustache=require(_0x92ae('0x5'));var util=require(_0x92ae('0x6'));var path=require(_0x92ae('0x7'));var sox=require(_0x92ae('0x8'));var csv=require(_0x92ae('0x9'));var ejs=require(_0x92ae('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x92ae('0xb'));var squel=require(_0x92ae('0xc'));var crypto=require('crypto');var jsforce=require(_0x92ae('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x92ae('0xe'));var Papa=require(_0x92ae('0xf'));var Redis=require(_0x92ae('0x10'));var authService=require(_0x92ae('0x11'));var qs=require(_0x92ae('0x12'));var as=require(_0x92ae('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x92ae('0x14'))('api');var utils=require(_0x92ae('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x92ae('0x16'));var db=require(_0x92ae('0x17'))['db'];function respondWithStatusCode(_0x461ae8,_0x519838){_0x519838=_0x519838||0xcc;return function(_0x1ec7fb){if(_0x1ec7fb){return _0x461ae8[_0x92ae('0x18')](_0x519838);}return _0x461ae8[_0x92ae('0x19')](_0x519838)[_0x92ae('0x1a')]();};}function respondWithResult(_0x24f3c5,_0x470d25){_0x470d25=_0x470d25||0xc8;return function(_0x1db664){if(_0x1db664){return _0x24f3c5[_0x92ae('0x19')](_0x470d25)[_0x92ae('0x1b')](_0x1db664);}};}function respondWithFilteredResult(_0x302021,_0x4c8132){return function(_0x28c5a5){if(_0x28c5a5){var _0x320c46=typeof _0x4c8132['offset']===_0x92ae('0x1c')&&typeof _0x4c8132[_0x92ae('0x1d')]==='undefined';var _0xd81f47=_0x28c5a5['count'];var _0x51db6d=_0x320c46?0x0:_0x4c8132['offset'];var _0x2a54f2=_0x320c46?_0x28c5a5[_0x92ae('0x1e')]:_0x4c8132[_0x92ae('0x1f')]+_0x4c8132['limit'];var _0x37cdc7;if(_0x2a54f2>=_0xd81f47){_0x2a54f2=_0xd81f47;_0x37cdc7=0xc8;}else{_0x37cdc7=0xce;}_0x302021[_0x92ae('0x19')](_0x37cdc7);return _0x302021[_0x92ae('0x20')](_0x92ae('0x21'),_0x51db6d+'-'+_0x2a54f2+'/'+_0xd81f47)['json'](_0x28c5a5);}return null;};}function patchUpdates(_0x3b83ee){return function(_0x2c3631){try{jsonpatch[_0x92ae('0x22')](_0x2c3631,_0x3b83ee,!![]);}catch(_0x5f5a52){return BPromise[_0x92ae('0x23')](_0x5f5a52);}return _0x2c3631[_0x92ae('0x24')]();};}function saveUpdates(_0x10b43d,_0x1ee0b9){return function(_0x50452c){if(_0x50452c){return _0x50452c['update'](_0x10b43d)[_0x92ae('0x25')](function(_0x39da70){return _0x39da70;});}return null;};}function removeEntity(_0x2c8062,_0x20fe42){return function(_0x1428ab){if(_0x1428ab){return _0x1428ab[_0x92ae('0x26')]()['then'](function(){_0x2c8062['status'](0xcc)[_0x92ae('0x1a')]();});}};}function handleEntityNotFound(_0x7f1cb7,_0x132b4a){return function(_0x5686e5){if(!_0x5686e5){_0x7f1cb7['sendStatus'](0x194);}return _0x5686e5;};}function handleError(_0x124360,_0x3bfa3c){_0x3bfa3c=_0x3bfa3c||0x1f4;return function(_0x2c71b2){logger['error'](_0x2c71b2[_0x92ae('0x27')]);if(_0x2c71b2[_0x92ae('0x28')]){delete _0x2c71b2['name'];}_0x124360[_0x92ae('0x19')](_0x3bfa3c)['send'](_0x2c71b2);};}exports[_0x92ae('0x29')]=function(_0x1ab96d,_0x4dddab){var _0x3ea4c2={},_0x103922={},_0xe73e30={'count':0x0,'rows':[]};var _0xca70f0=_['map'](db['MailTransferReport']['rawAttributes'],function(_0x34a0f9){return{'name':_0x34a0f9[_0x92ae('0x2a')],'type':_0x34a0f9[_0x92ae('0x2b')][_0x92ae('0x2c')]};});_0x103922['model']=_[_0x92ae('0x2d')](_0xca70f0,_0x92ae('0x28'));_0x103922[_0x92ae('0x2e')]=_[_0x92ae('0x2f')](_0x1ab96d[_0x92ae('0x2e')]);_0x103922['filters']=_[_0x92ae('0x30')](_0x103922[_0x92ae('0x31')],_0x103922[_0x92ae('0x2e')]);_0x3ea4c2[_0x92ae('0x32')]=_[_0x92ae('0x30')](_0x103922[_0x92ae('0x31')],qs[_0x92ae('0x33')](_0x1ab96d[_0x92ae('0x2e')][_0x92ae('0x33')]));_0x3ea4c2[_0x92ae('0x32')]=_0x3ea4c2[_0x92ae('0x32')][_0x92ae('0x34')]?_0x3ea4c2[_0x92ae('0x32')]:_0x103922[_0x92ae('0x31')];if(!_0x1ab96d[_0x92ae('0x2e')]['hasOwnProperty'](_0x92ae('0x35'))){_0x3ea4c2['limit']=qs[_0x92ae('0x1d')](_0x1ab96d[_0x92ae('0x2e')][_0x92ae('0x1d')]);_0x3ea4c2[_0x92ae('0x1f')]=qs[_0x92ae('0x1f')](_0x1ab96d['query'][_0x92ae('0x1f')]);}_0x3ea4c2['order']=qs[_0x92ae('0x36')](_0x1ab96d[_0x92ae('0x2e')][_0x92ae('0x36')]);_0x3ea4c2['where']=qs[_0x92ae('0x37')](_[_0x92ae('0x38')](_0x1ab96d[_0x92ae('0x2e')],_0x103922[_0x92ae('0x37')]),_0xca70f0);if(_0x1ab96d[_0x92ae('0x2e')]['filter']){_0x3ea4c2[_0x92ae('0x39')]=_[_0x92ae('0x3a')](_0x3ea4c2[_0x92ae('0x39')],{'$or':_[_0x92ae('0x2d')](_0xca70f0,function(_0x5e34f1){if(_0x5e34f1[_0x92ae('0x2b')]!==_0x92ae('0x3b')){var _0x170c51={};_0x170c51[_0x5e34f1['name']]={'$like':'%'+_0x1ab96d[_0x92ae('0x2e')]['filter']+'%'};return _0x170c51;}})});}_0x3ea4c2=_[_0x92ae('0x3a')]({},_0x3ea4c2,_0x1ab96d['options']);var _0x959d38={'where':_0x3ea4c2['where']};return db[_0x92ae('0x3c')][_0x92ae('0x1e')](_0x959d38)[_0x92ae('0x25')](function(_0x1c06d5){_0xe73e30['count']=_0x1c06d5;if(_0x1ab96d[_0x92ae('0x2e')][_0x92ae('0x3d')]){_0x3ea4c2[_0x92ae('0x3e')]=[{'all':!![]}];}return db['MailTransferReport'][_0x92ae('0x3f')](_0x3ea4c2);})[_0x92ae('0x25')](function(_0xf6f08){_0xe73e30[_0x92ae('0x40')]=_0xf6f08;return _0xe73e30;})[_0x92ae('0x25')](respondWithFilteredResult(_0x4dddab,_0x3ea4c2))[_0x92ae('0x41')](handleError(_0x4dddab,null));};exports[_0x92ae('0x42')]=function(_0x1ed93d,_0xf93b91){var _0x110e30={'raw':!![],'where':{'id':_0x1ed93d[_0x92ae('0x43')]['id']}},_0x3ab02e={};_0x3ab02e['model']=_[_0x92ae('0x2f')](db['MailTransferReport'][_0x92ae('0x44')]);_0x3ab02e[_0x92ae('0x2e')]=_[_0x92ae('0x2f')](_0x1ed93d['query']);_0x3ab02e[_0x92ae('0x37')]=_[_0x92ae('0x30')](_0x3ab02e['model'],_0x3ab02e[_0x92ae('0x2e')]);_0x110e30[_0x92ae('0x32')]=_[_0x92ae('0x30')](_0x3ab02e[_0x92ae('0x31')],qs['fields'](_0x1ed93d['query']['fields']));_0x110e30[_0x92ae('0x32')]=_0x110e30[_0x92ae('0x32')]['length']?_0x110e30[_0x92ae('0x32')]:_0x3ab02e['model'];if(_0x1ed93d[_0x92ae('0x2e')][_0x92ae('0x3d')]){_0x110e30[_0x92ae('0x3e')]=[{'all':!![]}];}_0x110e30=_[_0x92ae('0x3a')]({},_0x110e30,_0x1ed93d[_0x92ae('0x45')]);return db[_0x92ae('0x3c')][_0x92ae('0x46')](_0x110e30)['then'](handleEntityNotFound(_0xf93b91,null))[_0x92ae('0x25')](respondWithResult(_0xf93b91,null))['catch'](handleError(_0xf93b91,null));};exports[_0x92ae('0x47')]=function(_0x435520,_0x11cffd){return db[_0x92ae('0x3c')][_0x92ae('0x47')](_0x435520[_0x92ae('0x48')],{})[_0x92ae('0x25')](respondWithResult(_0x11cffd,0xc9))[_0x92ae('0x41')](handleError(_0x11cffd,null));};exports['update']=function(_0x2d5288,_0x22748f){if(_0x2d5288[_0x92ae('0x48')]['id']){delete _0x2d5288[_0x92ae('0x48')]['id'];}return db[_0x92ae('0x3c')][_0x92ae('0x46')]({'where':{'id':_0x2d5288[_0x92ae('0x43')]['id']}})[_0x92ae('0x25')](handleEntityNotFound(_0x22748f,null))[_0x92ae('0x25')](saveUpdates(_0x2d5288[_0x92ae('0x48')],null))[_0x92ae('0x25')](respondWithResult(_0x22748f,null))['catch'](handleError(_0x22748f,null));};exports[_0x92ae('0x26')]=function(_0x1399bc,_0x5e244e){return db['MailTransferReport']['find']({'where':{'id':_0x1399bc[_0x92ae('0x43')]['id']}})[_0x92ae('0x25')](handleEntityNotFound(_0x5e244e,null))[_0x92ae('0x25')](removeEntity(_0x5e244e,null))['catch'](handleError(_0x5e244e,null));};exports[_0x92ae('0x49')]=function(_0x197030,_0x1e974b){return db['MailTransferReport'][_0x92ae('0x49')]()['then'](respondWithResult(_0x1e974b,null))[_0x92ae('0x41')](handleError(_0x1e974b,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 5ec8db7..ef75604 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 _0x522b=['report_mail_transfer','lodash','util','api','request-promise','path','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport'];(function(_0x14c34b,_0x2d2339){var _0x3cf19f=function(_0x37b4b3){while(--_0x37b4b3){_0x14c34b['push'](_0x14c34b['shift']());}};_0x3cf19f(++_0x2d2339);}(_0x522b,0x1c3));var _0xb522=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x522b[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0xb522('0x0'));var util=require(_0xb522('0x1'));var logger=require('../../config/logger')(_0xb522('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb522('0x3'));var fs=require('fs');var path=require(_0xb522('0x4'));var rimraf=require('rimraf');var config=require(_0xb522('0x5'));var attributes=require(_0xb522('0x6'));module[_0xb522('0x7')]=function(_0x2fca5b,_0x47bd53){return _0x2fca5b['define'](_0xb522('0x8'),attributes,{'tableName':_0xb522('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x194c=['./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1a2106,_0x495d37){var _0x423fe7=function(_0x356667){while(--_0x356667){_0x1a2106['push'](_0x1a2106['shift']());}};_0x423fe7(++_0x495d37);}(_0x194c,0x19b));var _0xc194=function(_0x1a3ec7,_0x43c808){_0x1a3ec7=_0x1a3ec7-0x0;var _0xec9ef6=_0x194c[_0x1a3ec7];return _0xec9ef6;};'use strict';var _=require(_0xc194('0x0'));var util=require(_0xc194('0x1'));var logger=require(_0xc194('0x2'))(_0xc194('0x3'));var moment=require(_0xc194('0x4'));var BPromise=require(_0xc194('0x5'));var rp=require(_0xc194('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc194('0x7'));var config=require(_0xc194('0x8'));var attributes=require(_0xc194('0x9'));module[_0xc194('0xa')]=function(_0x3872ac,_0x330147){return _0x3872ac[_0xc194('0xb')](_0xc194('0xc'),attributes,{'tableName':_0xc194('0xd'),'paranoid':![],'indexes':[{'name':_0xc194('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 7a7be98..0c3526c 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 _0x4983=['bluebird','ioredis','../../config/utils','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x7c4ffd,_0x29790d){var _0x47179e=function(_0x31d748){while(--_0x31d748){_0x7c4ffd['push'](_0x7c4ffd['shift']());}};_0x47179e(++_0x29790d);}(_0x4983,0x1eb));var _0x3498=function(_0x33562d,_0x5a96be){_0x33562d=_0x33562d-0x0;var _0x6fef14=_0x4983[_0x33562d];return _0x6fef14;};'use strict';var _=require(_0x3498('0x0'));var util=require(_0x3498('0x1'));var moment=require(_0x3498('0x2'));var BPromise=require(_0x3498('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3498('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3498('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3498('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x30941b,_0x271065,_0x24ce4c){return new BPromise(function(_0x5dfd69,_0x394e33){return client[_0x3498('0x7')](_0x30941b,_0x24ce4c)[_0x3498('0x8')](function(_0x28a7ca){logger[_0x3498('0x9')](_0x3498('0xa'),_0x271065,_0x3498('0xb'));logger[_0x3498('0xc')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x271065,_0x3498('0xb'),JSON[_0x3498('0xd')](_0x28a7ca));if(_0x28a7ca[_0x3498('0xe')]){if(_0x28a7ca[_0x3498('0xe')][_0x3498('0xf')]===0x1f4){logger['error'](_0x3498('0xa'),_0x271065,_0x28a7ca[_0x3498('0xe')]['message']);return _0x394e33(_0x28a7ca[_0x3498('0xe')]['message']);}logger[_0x3498('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x271065,_0x28a7ca['error'][_0x3498('0x10')]);return _0x5dfd69(_0x28a7ca[_0x3498('0xe')]['message']);}else{logger[_0x3498('0x9')](_0x3498('0xa'),_0x271065,_0x3498('0xb'));_0x5dfd69(_0x28a7ca[_0x3498('0x11')][_0x3498('0x10')]);}})[_0x3498('0x12')](function(_0x2bd53d){logger[_0x3498('0xe')](_0x3498('0xa'),_0x271065,_0x2bd53d);_0x394e33(_0x2bd53d);});});} \ No newline at end of file +var _0x8888=['debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent'];(function(_0x22b62c,_0x362e4f){var _0x51c975=function(_0x479954){while(--_0x479954){_0x22b62c['push'](_0x22b62c['shift']());}};_0x51c975(++_0x362e4f);}(_0x8888,0x7c));var _0x8888=function(_0x1516fb,_0xa60c04){_0x1516fb=_0x1516fb-0x0;var _0x40cecb=_0x8888[_0x1516fb];return _0x40cecb;};'use strict';var _=require(_0x8888('0x0'));var util=require(_0x8888('0x1'));var moment=require(_0x8888('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8888('0x3'));var db=require(_0x8888('0x4'))['db'];var utils=require(_0x8888('0x5'));var logger=require(_0x8888('0x6'))(_0x8888('0x7'));var config=require(_0x8888('0x8'));var jayson=require(_0x8888('0x9'));var client=jayson['client'][_0x8888('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ae141,_0x8d1e7,_0x4bb383){return new BPromise(function(_0x131e91,_0x58fcda){return client[_0x8888('0xb')](_0x3ae141,_0x4bb383)[_0x8888('0xc')](function(_0x380e76){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x8d1e7,_0x8888('0xd'));logger[_0x8888('0xe')](_0x8888('0xf'),_0x8d1e7,_0x8888('0xd'),JSON[_0x8888('0x10')](_0x380e76));if(_0x380e76[_0x8888('0x11')]){if(_0x380e76[_0x8888('0x11')][_0x8888('0x12')]===0x1f4){logger[_0x8888('0x11')](_0x8888('0x13'),_0x8d1e7,_0x380e76[_0x8888('0x11')][_0x8888('0x14')]);return _0x58fcda(_0x380e76[_0x8888('0x11')]['message']);}logger[_0x8888('0x11')](_0x8888('0x13'),_0x8d1e7,_0x380e76[_0x8888('0x11')][_0x8888('0x14')]);return _0x131e91(_0x380e76[_0x8888('0x11')][_0x8888('0x14')]);}else{logger['info'](_0x8888('0x13'),_0x8d1e7,_0x8888('0xd'));_0x131e91(_0x380e76[_0x8888('0x15')][_0x8888('0x14')]);}})[_0x8888('0x16')](function(_0x2a9688){logger[_0x8888('0x11')](_0x8888('0x13'),_0x8d1e7,_0x2a9688);_0x58fcda(_0x2a9688);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index d874f8a..cced251 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 _0x01d2=['/:id','show','post','create','put','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x5bc647,_0x37db43){var _0x48fc98=function(_0x191bf2){while(--_0x191bf2){_0x5bc647['push'](_0x5bc647['shift']());}};_0x48fc98(++_0x37db43);}(_0x01d2,0x16c));var _0x201d=function(_0xc08658,_0x5c400d){_0xc08658=_0xc08658-0x0;var _0x1afa06=_0x01d2[_0xc08658];return _0x1afa06;};'use strict';var multer=require('multer');var util=require(_0x201d('0x0'));var path=require(_0x201d('0x1'));var timeout=require('connect-timeout');var express=require(_0x201d('0x2'));var router=express[_0x201d('0x3')]();var fs_extra=require(_0x201d('0x4'));var auth=require(_0x201d('0x5'));var interaction=require(_0x201d('0x6'));var config=require(_0x201d('0x7'));var controller=require(_0x201d('0x8'));router[_0x201d('0x9')]('/',auth[_0x201d('0xa')](),controller[_0x201d('0xb')]);router[_0x201d('0x9')](_0x201d('0xc'),auth[_0x201d('0xa')](),controller[_0x201d('0xd')]);router[_0x201d('0x9')](_0x201d('0xe'),auth[_0x201d('0xa')](),controller[_0x201d('0xf')]);router[_0x201d('0x10')]('/',auth[_0x201d('0xa')](),controller[_0x201d('0x11')]);router[_0x201d('0x12')](_0x201d('0xe'),auth[_0x201d('0xa')](),controller['update']);router['delete'](_0x201d('0xe'),auth[_0x201d('0xa')](),controller[_0x201d('0x13')]);module[_0x201d('0x14')]=router; \ No newline at end of file +var _0x13ad=['../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','update','destroy','util','path','connect-timeout','../../components/auth/service'];(function(_0x469104,_0x42c4ae){var _0x3f4a27=function(_0x2ec8de){while(--_0x2ec8de){_0x469104['push'](_0x469104['shift']());}};_0x3f4a27(++_0x42c4ae);}(_0x13ad,0x9c));var _0xd13a=function(_0x467208,_0x4c4d4e){_0x467208=_0x467208-0x0;var _0x5cb8aa=_0x13ad[_0x467208];return _0x5cb8aa;};'use strict';var multer=require('multer');var util=require(_0xd13a('0x0'));var path=require(_0xd13a('0x1'));var timeout=require(_0xd13a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd13a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd13a('0x4'));var controller=require(_0xd13a('0x5'));router[_0xd13a('0x6')]('/',auth[_0xd13a('0x7')](),controller[_0xd13a('0x8')]);router[_0xd13a('0x6')](_0xd13a('0x9'),auth[_0xd13a('0x7')](),controller[_0xd13a('0xa')]);router[_0xd13a('0x6')](_0xd13a('0xb'),auth[_0xd13a('0x7')](),controller['show']);router[_0xd13a('0xc')]('/',auth['isAuthenticated'](),controller[_0xd13a('0xd')]);router['put'](_0xd13a('0xb'),auth['isAuthenticated'](),controller[_0xd13a('0xe')]);router['delete'](_0xd13a('0xb'),auth[_0xd13a('0x7')](),controller[_0xd13a('0xf')]);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 6b993ba..29a013e 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 _0xc6c3=['getDataValue','enterAt','seconds','setDataValue','exitAt','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','moment','STRING','DEFAULT\x20PAUSE','INTEGER','DATE'];(function(_0x2b627d,_0x4719a4){var _0x4c16c9=function(_0x9fc1c1){while(--_0x9fc1c1){_0x2b627d['push'](_0x2b627d['shift']());}};_0x4c16c9(++_0x4719a4);}(_0xc6c3,0x108));var _0x3c6c=function(_0x27e349,_0x262b9e){_0x27e349=_0x27e349-0x0;var _0x118267=_0xc6c3[_0x27e349];return _0x118267;};'use strict';var Sequelize=require(_0x3c6c('0x0'));var moment=require(_0x3c6c('0x1'));module['exports']={'channel':{'type':Sequelize[_0x3c6c('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x3c6c('0x2')]},'type':{'type':Sequelize[_0x3c6c('0x2')],'defaultValue':_0x3c6c('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x3c6c('0x4')]},'enterAt':{'type':Sequelize[_0x3c6c('0x5')]},'exitAt':{'type':Sequelize[_0x3c6c('0x5')],'set':function(_0x202469){var _0x57fc95=moment(_0x202469);var _0x4e326f=moment(this[_0x3c6c('0x6')](_0x3c6c('0x7')));var _0x29e991=_0x57fc95['diff'](_0x4e326f,_0x3c6c('0x8'));this[_0x3c6c('0x9')](_0x3c6c('0xa'),_0x202469);this[_0x3c6c('0x9')](_0x3c6c('0xb'),_0x29e991>=0x0?_0x29e991:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x3c6c('0x2')],'comment':_0x3c6c('0xc')},'data3':{'type':Sequelize[_0x3c6c('0x2')],'comment':_0x3c6c('0xd')},'data4':{'type':Sequelize['STRING'],'comment':_0x3c6c('0xe')},'data5':{'type':Sequelize[_0x3c6c('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x3c6c('0x4')]},'uniqueid':{'type':Sequelize[_0x3c6c('0x2')]}}; \ No newline at end of file +var _0x6486=['STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6486,0xa8));var _0x6648=function(_0x5b4e97,_0x19a68c){_0x5b4e97=_0x5b4e97-0x0;var _0x43b0f9=_0x6486[_0x5b4e97];return _0x43b0f9;};'use strict';var Sequelize=require(_0x6648('0x0'));var moment=require(_0x6648('0x1'));module['exports']={'channel':{'type':Sequelize[_0x6648('0x2')]},'membername':{'type':Sequelize[_0x6648('0x2')]},'interface':{'type':Sequelize[_0x6648('0x2')]},'type':{'type':Sequelize[_0x6648('0x2')],'defaultValue':_0x6648('0x3'),'comment':_0x6648('0x4')},'duration':{'type':Sequelize[_0x6648('0x5')]},'enterAt':{'type':Sequelize[_0x6648('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x15224b){var _0x222c35=moment(_0x15224b);var _0xc6a9d7=moment(this[_0x6648('0x7')](_0x6648('0x8')));var _0x6219fc=_0x222c35[_0x6648('0x9')](_0xc6a9d7,_0x6648('0xa'));this[_0x6648('0xb')]('exitAt',_0x15224b);this['setDataValue'](_0x6648('0xc'),_0x6219fc>=0x0?_0x6219fc:null);}},'data1':{'type':Sequelize[_0x6648('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':_0x6648('0xd')},'data3':{'type':Sequelize[_0x6648('0x2')],'comment':_0x6648('0xe')},'data4':{'type':Sequelize[_0x6648('0x2')],'comment':_0x6648('0xf')},'data5':{'type':Sequelize[_0x6648('0x2')],'comment':_0x6648('0x10')},'role':{'type':Sequelize[_0x6648('0x2')]},'internal':{'type':Sequelize[_0x6648('0x5')]},'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 be78e48..80496f6 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(_0x1c3765,_0xc3b431){_0x1c3765=_0x1c3765-0x0;var _0x3ab003=_0x55ca[_0x1c3765];return _0x3ab003;};'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 _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x158658,_0x46f304){var _0x2c408f=function(_0x68e3c3){while(--_0x68e3c3){_0x158658['push'](_0x158658['shift']());}};_0x2c408f(++_0x46f304);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 5a403be..1f239c5 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 _0x1623=['membername_interface','membername','interface','lodash','api','moment','bluebird','request-promise','path','./memberReport.attributes','MemberReport','report_member'];(function(_0x49798e,_0x226f50){var _0xffc83b=function(_0x10c053){while(--_0x10c053){_0x49798e['push'](_0x49798e['shift']());}};_0xffc83b(++_0x226f50);}(_0x1623,0xab));var _0x3162=function(_0x5b9a26,_0x637de2){_0x5b9a26=_0x5b9a26-0x0;var _0x587028=_0x1623[_0x5b9a26];return _0x587028;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3162('0x1'));var moment=require(_0x3162('0x2'));var BPromise=require(_0x3162('0x3'));var rp=require(_0x3162('0x4'));var fs=require('fs');var path=require(_0x3162('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3162('0x6'));module['exports']=function(_0x1b55f2,_0x428de6){return _0x1b55f2['define'](_0x3162('0x7'),attributes,{'tableName':_0x3162('0x8'),'paranoid':![],'indexes':[{'name':_0x3162('0x9'),'fields':[_0x3162('0xa'),_0x3162('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9208=['report_member','membername_interface','membername','interface','lodash','util','api','request-promise','path','rimraf','../../config/environment','exports','MemberReport'];(function(_0x2448b2,_0x4d3d93){var _0xa8bf7f=function(_0x4c925a){while(--_0x4c925a){_0x2448b2['push'](_0x2448b2['shift']());}};_0xa8bf7f(++_0x4d3d93);}(_0x9208,0x108));var _0x8920=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9208[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8920('0x0'));var util=require(_0x8920('0x1'));var logger=require('../../config/logger')(_0x8920('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8920('0x3'));var fs=require('fs');var path=require(_0x8920('0x4'));var rimraf=require(_0x8920('0x5'));var config=require(_0x8920('0x6'));var attributes=require('./memberReport.attributes');module[_0x8920('0x7')]=function(_0x126772,_0x194026){return _0x126772['define'](_0x8920('0x8'),attributes,{'tableName':_0x8920('0x9'),'paranoid':![],'indexes':[{'name':_0x8920('0xa'),'fields':[_0x8920('0xb'),_0x8920('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 2bba476..b6becd3 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 _0x4351=['request','then','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetMemberReport','MemberReport','options','where','attributes','include','map','model','stringify','CreateMemberReport','body','raw','update','limit','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4cfc1d,_0x2c0927){var _0x1c01a0=function(_0x264a74){while(--_0x264a74){_0x4cfc1d['push'](_0x4cfc1d['shift']());}};_0x1c01a0(++_0x2c0927);}(_0x4351,0x1b5));var _0x1435=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x4351[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x1435('0x0'));var util=require(_0x1435('0x1'));var moment=require(_0x1435('0x2'));var BPromise=require(_0x1435('0x3'));var rs=require(_0x1435('0x4'));var fs=require('fs');var Redis=require(_0x1435('0x5'));var db=require(_0x1435('0x6'))['db'];var utils=require(_0x1435('0x7'));var logger=require(_0x1435('0x8'))(_0x1435('0x9'));var config=require(_0x1435('0xa'));var jayson=require(_0x1435('0xb'));var client=jayson[_0x1435('0xc')][_0x1435('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x337fd6,_0x56ce86,_0x10760d){return new BPromise(function(_0x5de4b0,_0x4d04c7){return client[_0x1435('0xe')](_0x337fd6,_0x10760d)[_0x1435('0xf')](function(_0x14a9e1){logger[_0x1435('0x10')](_0x1435('0x11'),_0x56ce86,'request\x20sent');logger[_0x1435('0x12')](_0x1435('0x13'),_0x56ce86,'request\x20sent',JSON['stringify'](_0x14a9e1));if(_0x14a9e1[_0x1435('0x14')]){if(_0x14a9e1['error'][_0x1435('0x15')]===0x1f4){logger['error'](_0x1435('0x11'),_0x56ce86,_0x14a9e1['error']['message']);return _0x4d04c7(_0x14a9e1['error'][_0x1435('0x16')]);}logger[_0x1435('0x14')](_0x1435('0x11'),_0x56ce86,_0x14a9e1['error']['message']);return _0x5de4b0(_0x14a9e1[_0x1435('0x14')]['message']);}else{logger[_0x1435('0x10')](_0x1435('0x11'),_0x56ce86,_0x1435('0x17'));_0x5de4b0(_0x14a9e1[_0x1435('0x18')][_0x1435('0x16')]);}})[_0x1435('0x19')](function(_0x5ecd){logger[_0x1435('0x14')](_0x1435('0x11'),_0x56ce86,_0x5ecd);_0x4d04c7(_0x5ecd);});});}exports[_0x1435('0x1a')]=function(_0x430367){var _0x19c9fe=this;return new Promise(function(_0x68f503,_0xb6995b){return db[_0x1435('0x1b')]['findAll']({'raw':_0x430367[_0x1435('0x1c')]?_0x430367[_0x1435('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x430367[_0x1435('0x1c')]?_0x430367['options'][_0x1435('0x1d')]||null:null,'attributes':_0x430367[_0x1435('0x1c')]?_0x430367[_0x1435('0x1c')][_0x1435('0x1e')]||null:null,'limit':_0x430367[_0x1435('0x1c')]?_0x430367[_0x1435('0x1c')]['limit']||null:null,'include':_0x430367[_0x1435('0x1c')]?_0x430367[_0x1435('0x1c')][_0x1435('0x1f')]?_[_0x1435('0x20')](_0x430367[_0x1435('0x1c')][_0x1435('0x1f')],function(_0x302831){return{'model':db[_0x302831[_0x1435('0x21')]],'as':_0x302831['as'],'attributes':_0x302831[_0x1435('0x1e')],'include':_0x302831[_0x1435('0x1f')]?_[_0x1435('0x20')](_0x302831['include'],function(_0x523792){return{'model':db[_0x523792[_0x1435('0x21')]],'as':_0x523792['as'],'attributes':_0x523792[_0x1435('0x1e')],'include':_0x523792[_0x1435('0x1f')]?_['map'](_0x523792[_0x1435('0x1f')],function(_0x25cf29){return{'model':db[_0x25cf29[_0x1435('0x21')]],'as':_0x25cf29['as'],'attributes':_0x25cf29[_0x1435('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1435('0xf')](function(_0x5966ef){logger[_0x1435('0x10')](_0x1435('0x1a'),_0x430367);logger[_0x1435('0x12')](_0x1435('0x1a'),_0x430367,JSON[_0x1435('0x22')](_0x5966ef));_0x68f503(_0x5966ef);})[_0x1435('0x19')](function(_0x2e0e72){logger['error'](_0x1435('0x1a'),_0x2e0e72[_0x1435('0x16')],_0x430367);_0xb6995b(_0x19c9fe[_0x1435('0x14')](0x1f4,_0x2e0e72[_0x1435('0x16')]));});});};exports[_0x1435('0x23')]=function(_0x49649f){var _0x38606a=this;return new Promise(function(_0x2ed478,_0xab53ee){return db[_0x1435('0x1b')]['create'](_0x49649f[_0x1435('0x24')],{'raw':_0x49649f[_0x1435('0x1c')]?_0x49649f['options'][_0x1435('0x25')]===undefined?!![]:![]:!![]})['then'](function(_0x4903f2){logger[_0x1435('0x10')]('CreateMemberReport',_0x49649f);logger[_0x1435('0x12')](_0x1435('0x23'),_0x49649f,JSON['stringify'](_0x4903f2));_0x2ed478(_0x4903f2);})['catch'](function(_0x5c5075){logger[_0x1435('0x14')]('CreateMemberReport',_0x5c5075[_0x1435('0x16')],_0x49649f);_0xab53ee(_0x38606a['error'](0x1f4,_0x5c5075[_0x1435('0x16')]));});});};exports['UpdateMemberReport']=function(_0x1bfdfc){var _0x558ce7=this;return new Promise(function(_0x249edc,_0x20d7d5){return db[_0x1435('0x1b')][_0x1435('0x26')](_0x1bfdfc['body'],{'raw':_0x1bfdfc[_0x1435('0x1c')]?_0x1bfdfc[_0x1435('0x1c')][_0x1435('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bfdfc[_0x1435('0x1c')]?_0x1bfdfc[_0x1435('0x1c')]['where']||null:null,'attributes':_0x1bfdfc[_0x1435('0x1c')]?_0x1bfdfc['options'][_0x1435('0x1e')]||null:null,'limit':_0x1bfdfc[_0x1435('0x1c')]?_0x1bfdfc['options'][_0x1435('0x27')]||null:null})[_0x1435('0xf')](function(_0x4169ab){logger[_0x1435('0x10')](_0x1435('0x28'),_0x1bfdfc);logger[_0x1435('0x12')](_0x1435('0x28'),_0x1bfdfc,JSON[_0x1435('0x22')](_0x4169ab));_0x249edc(_0x4169ab);})[_0x1435('0x19')](function(_0xeb29d0){logger[_0x1435('0x14')](_0x1435('0x28'),_0xeb29d0['message'],_0x1bfdfc);_0x20d7d5(_0x558ce7[_0x1435('0x14')](0x1f4,_0xeb29d0['message']));});});}; \ No newline at end of file +var _0x9120=['CreateMemberReport','MemberReport','create','body','UpdateMemberReport','update','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMemberReport','options','raw','where','limit','include','map','attributes','model'];(function(_0x4acdd0,_0x4d1f59){var _0x392ba5=function(_0x30cab7){while(--_0x30cab7){_0x4acdd0['push'](_0x4acdd0['shift']());}};_0x392ba5(++_0x4d1f59);}(_0x9120,0x1b3));var _0x0912=function(_0x3eed90,_0x1d1db1){_0x3eed90=_0x3eed90-0x0;var _0x326be2=_0x9120[_0x3eed90];return _0x326be2;};'use strict';var _=require(_0x0912('0x0'));var util=require(_0x0912('0x1'));var moment=require(_0x0912('0x2'));var BPromise=require(_0x0912('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0912('0x4'))['db'];var utils=require(_0x0912('0x5'));var logger=require(_0x0912('0x6'))(_0x0912('0x7'));var config=require(_0x0912('0x8'));var jayson=require(_0x0912('0x9'));var client=jayson['client'][_0x0912('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x345969,_0x438bb2,_0x564522){return new BPromise(function(_0x674709,_0x4383c7){return client[_0x0912('0xb')](_0x345969,_0x564522)[_0x0912('0xc')](function(_0x1532bd){logger['info'](_0x0912('0xd'),_0x438bb2,_0x0912('0xe'));logger[_0x0912('0xf')](_0x0912('0x10'),_0x438bb2,'request\x20sent',JSON[_0x0912('0x11')](_0x1532bd));if(_0x1532bd['error']){if(_0x1532bd[_0x0912('0x12')][_0x0912('0x13')]===0x1f4){logger[_0x0912('0x12')](_0x0912('0xd'),_0x438bb2,_0x1532bd[_0x0912('0x12')][_0x0912('0x14')]);return _0x4383c7(_0x1532bd[_0x0912('0x12')][_0x0912('0x14')]);}logger[_0x0912('0x12')](_0x0912('0xd'),_0x438bb2,_0x1532bd[_0x0912('0x12')][_0x0912('0x14')]);return _0x674709(_0x1532bd[_0x0912('0x12')][_0x0912('0x14')]);}else{logger[_0x0912('0x15')]('MemberReport,\x20%s,\x20%s',_0x438bb2,'request\x20sent');_0x674709(_0x1532bd[_0x0912('0x16')]['message']);}})[_0x0912('0x17')](function(_0x5cd19f){logger[_0x0912('0x12')]('MemberReport,\x20%s,\x20%s',_0x438bb2,_0x5cd19f);_0x4383c7(_0x5cd19f);});});}exports[_0x0912('0x18')]=function(_0x5eace1){var _0x22befd=this;return new Promise(function(_0x5357db,_0x495e2e){return db['MemberReport']['findAll']({'raw':_0x5eace1[_0x0912('0x19')]?_0x5eace1['options'][_0x0912('0x1a')]===undefined?!![]:![]:!![],'where':_0x5eace1[_0x0912('0x19')]?_0x5eace1['options'][_0x0912('0x1b')]||null:null,'attributes':_0x5eace1[_0x0912('0x19')]?_0x5eace1[_0x0912('0x19')]['attributes']||null:null,'limit':_0x5eace1['options']?_0x5eace1[_0x0912('0x19')][_0x0912('0x1c')]||null:null,'include':_0x5eace1[_0x0912('0x19')]?_0x5eace1[_0x0912('0x19')][_0x0912('0x1d')]?_[_0x0912('0x1e')](_0x5eace1[_0x0912('0x19')][_0x0912('0x1d')],function(_0xca7f8b){return{'model':db[_0xca7f8b['model']],'as':_0xca7f8b['as'],'attributes':_0xca7f8b[_0x0912('0x1f')],'include':_0xca7f8b[_0x0912('0x1d')]?_[_0x0912('0x1e')](_0xca7f8b['include'],function(_0x4a938e){return{'model':db[_0x4a938e[_0x0912('0x20')]],'as':_0x4a938e['as'],'attributes':_0x4a938e['attributes'],'include':_0x4a938e['include']?_[_0x0912('0x1e')](_0x4a938e[_0x0912('0x1d')],function(_0x4d45d2){return{'model':db[_0x4d45d2[_0x0912('0x20')]],'as':_0x4d45d2['as'],'attributes':_0x4d45d2[_0x0912('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0912('0xc')](function(_0x2c8e48){logger[_0x0912('0x15')]('GetMemberReport',_0x5eace1);logger[_0x0912('0xf')](_0x0912('0x18'),_0x5eace1,JSON['stringify'](_0x2c8e48));_0x5357db(_0x2c8e48);})[_0x0912('0x17')](function(_0x3428a9){logger[_0x0912('0x12')]('GetMemberReport',_0x3428a9[_0x0912('0x14')],_0x5eace1);_0x495e2e(_0x22befd[_0x0912('0x12')](0x1f4,_0x3428a9[_0x0912('0x14')]));});});};exports[_0x0912('0x21')]=function(_0x5a30d8){var _0x448fa3=this;return new Promise(function(_0x195c08,_0x2a9282){return db[_0x0912('0x22')][_0x0912('0x23')](_0x5a30d8[_0x0912('0x24')],{'raw':_0x5a30d8['options']?_0x5a30d8['options'][_0x0912('0x1a')]===undefined?!![]:![]:!![]})[_0x0912('0xc')](function(_0x485c3d){logger['info'](_0x0912('0x21'),_0x5a30d8);logger[_0x0912('0xf')](_0x0912('0x21'),_0x5a30d8,JSON[_0x0912('0x11')](_0x485c3d));_0x195c08(_0x485c3d);})[_0x0912('0x17')](function(_0x933d56){logger[_0x0912('0x12')](_0x0912('0x21'),_0x933d56['message'],_0x5a30d8);_0x2a9282(_0x448fa3['error'](0x1f4,_0x933d56[_0x0912('0x14')]));});});};exports[_0x0912('0x25')]=function(_0x49628d){var _0x2f2448=this;return new Promise(function(_0x271a9c,_0x39a152){return db[_0x0912('0x22')][_0x0912('0x26')](_0x49628d[_0x0912('0x24')],{'raw':_0x49628d[_0x0912('0x19')]?_0x49628d[_0x0912('0x19')][_0x0912('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49628d['options']?_0x49628d[_0x0912('0x19')][_0x0912('0x1b')]||null:null,'attributes':_0x49628d[_0x0912('0x19')]?_0x49628d[_0x0912('0x19')][_0x0912('0x1f')]||null:null,'limit':_0x49628d[_0x0912('0x19')]?_0x49628d[_0x0912('0x19')]['limit']||null:null})[_0x0912('0xc')](function(_0x4aef9a){logger['info']('UpdateMemberReport',_0x49628d);logger[_0x0912('0xf')](_0x0912('0x25'),_0x49628d,JSON['stringify'](_0x4aef9a));_0x271a9c(_0x4aef9a);})[_0x0912('0x17')](function(_0x200399){logger[_0x0912('0x12')]('UpdateMemberReport',_0x200399[_0x0912('0x14')],_0x49628d);_0x39a152(_0x2f2448[_0x0912('0x12')](0x1f4,_0x200399['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 4b0e68b..a3d27f5 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 _0x4f80=['../../components/interaction/service','../../config/environment','get','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x315cff,_0x540d28){var _0x49bc45=function(_0x54858e){while(--_0x54858e){_0x315cff['push'](_0x315cff['shift']());}};_0x49bc45(++_0x540d28);}(_0x4f80,0xcb));var _0x04f8=function(_0x5dda44,_0x40b720){_0x5dda44=_0x5dda44-0x0;var _0x25506a=_0x4f80[_0x5dda44];return _0x25506a;};'use strict';var multer=require(_0x04f8('0x0'));var util=require(_0x04f8('0x1'));var path=require(_0x04f8('0x2'));var timeout=require('connect-timeout');var express=require(_0x04f8('0x3'));var router=express[_0x04f8('0x4')]();var fs_extra=require(_0x04f8('0x5'));var auth=require(_0x04f8('0x6'));var interaction=require(_0x04f8('0x7'));var config=require(_0x04f8('0x8'));var controller=require('./migration.controller');router[_0x04f8('0x9')]('/',controller['index']);module['exports']=router; \ No newline at end of file +var _0x8786=['../../components/interaction/service','../../config/environment','./migration.controller','get','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x218697,_0xea54bf){var _0x29cac1=function(_0x51e3c8){while(--_0x51e3c8){_0x218697['push'](_0x218697['shift']());}};_0x29cac1(++_0xea54bf);}(_0x8786,0x7a));var _0x6878=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x8786[_0x1d1779];return _0x2377e9;};'use strict';var multer=require(_0x6878('0x0'));var util=require(_0x6878('0x1'));var path=require(_0x6878('0x2'));var timeout=require(_0x6878('0x3'));var express=require(_0x6878('0x4'));var router=express[_0x6878('0x5')]();var fs_extra=require(_0x6878('0x6'));var auth=require(_0x6878('0x7'));var interaction=require(_0x6878('0x8'));var config=require(_0x6878('0x9'));var controller=require(_0x6878('0xa'));router[_0x6878('0xb')]('/',controller['index']);module[_0x6878('0xc')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index dfba4e6..350a055 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 _0x3be3=['exports','STRING'];(function(_0xb0301c,_0x143432){var _0x3fc8d5=function(_0x4850c3){while(--_0x4850c3){_0xb0301c['push'](_0xb0301c['shift']());}};_0x3fc8d5(++_0x143432);}(_0x3be3,0x11c));var _0x33be=function(_0x19d350,_0x3c843f){_0x19d350=_0x19d350-0x0;var _0x3bfc8d=_0x3be3[_0x19d350];return _0x3bfc8d;};'use strict';var Sequelize=require('sequelize');module[_0x33be('0x0')]={'version':{'type':Sequelize[_0x33be('0x1')],'unique':'version'}}; \ No newline at end of file +var _0x7aa7=['STRING','version','sequelize','exports'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x7aa7,0x13a));var _0x77aa=function(_0x260d4e,_0x5bf8cf){_0x260d4e=_0x260d4e-0x0;var _0x3aa8f6=_0x7aa7[_0x260d4e];return _0x3aa8f6;};'use strict';var Sequelize=require(_0x77aa('0x0'));module[_0x77aa('0x1')]={'version':{'type':Sequelize[_0x77aa('0x2')],'unique':_0x77aa('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 3c8d0bd..834d1f0 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 _0xe05f=['query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','rows','eml-format','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','reject','update','then','destroy','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key'];(function(_0x413e6d,_0x120b27){var _0x293447=function(_0x52cb77){while(--_0x52cb77){_0x413e6d['push'](_0x413e6d['shift']());}};_0x293447(++_0x120b27);}(_0xe05f,0x158));var _0xfe05=function(_0x5144b1,_0x479dcc){_0x5144b1=_0x5144b1-0x0;var _0x19911e=_0xe05f[_0x5144b1];return _0x19911e;};'use strict';var emlformat=require(_0xfe05('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe05('0x1'));var jsonpatch=require(_0xfe05('0x2'));var rp=require(_0xfe05('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfe05('0x4'));var path=require(_0xfe05('0x5'));var sox=require('sox');var csv=require(_0xfe05('0x6'));var ejs=require(_0xfe05('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe05('0x8'));var squel=require(_0xfe05('0x9'));var crypto=require(_0xfe05('0xa'));var jsforce=require(_0xfe05('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfe05('0x6'));var querystring=require(_0xfe05('0xc'));var Papa=require(_0xfe05('0xd'));var Redis=require(_0xfe05('0xe'));var authService=require(_0xfe05('0xf'));var qs=require(_0xfe05('0x10'));var as=require(_0xfe05('0x11'));var hardwareService=require(_0xfe05('0x12'));var logger=require(_0xfe05('0x13'))('api');var utils=require(_0xfe05('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfe05('0x15'));var db=require(_0xfe05('0x16'))['db'];function respondWithStatusCode(_0x54af9c,_0x49d22f){_0x49d22f=_0x49d22f||0xcc;return function(_0x230815){if(_0x230815){return _0x54af9c[_0xfe05('0x17')](_0x49d22f);}return _0x54af9c[_0xfe05('0x18')](_0x49d22f)[_0xfe05('0x19')]();};}function respondWithResult(_0x49819c,_0x105843){_0x105843=_0x105843||0xc8;return function(_0x470b51){if(_0x470b51){return _0x49819c['status'](_0x105843)['json'](_0x470b51);}};}function respondWithFilteredResult(_0x2069b5,_0x459446){return function(_0x1945b1){if(_0x1945b1){var _0x4134ce=typeof _0x459446['offset']==='undefined'&&typeof _0x459446[_0xfe05('0x1a')]===_0xfe05('0x1b');var _0x52f1a4=_0x1945b1[_0xfe05('0x1c')];var _0x493c39=_0x4134ce?0x0:_0x459446[_0xfe05('0x1d')];var _0x57a21d=_0x4134ce?_0x1945b1[_0xfe05('0x1c')]:_0x459446[_0xfe05('0x1d')]+_0x459446[_0xfe05('0x1a')];var _0x3c00bd;if(_0x57a21d>=_0x52f1a4){_0x57a21d=_0x52f1a4;_0x3c00bd=0xc8;}else{_0x3c00bd=0xce;}_0x2069b5[_0xfe05('0x18')](_0x3c00bd);return _0x2069b5['set'](_0xfe05('0x1e'),_0x493c39+'-'+_0x57a21d+'/'+_0x52f1a4)[_0xfe05('0x1f')](_0x1945b1);}return null;};}function patchUpdates(_0x756a7c){return function(_0x163c16){try{jsonpatch['apply'](_0x163c16,_0x756a7c,!![]);}catch(_0x572e9b){return BPromise[_0xfe05('0x20')](_0x572e9b);}return _0x163c16['save']();};}function saveUpdates(_0x1293cd,_0x4044af){return function(_0x42fd9c){if(_0x42fd9c){return _0x42fd9c[_0xfe05('0x21')](_0x1293cd)[_0xfe05('0x22')](function(_0x579d8d){return _0x579d8d;});}return null;};}function removeEntity(_0x375c77,_0x2813a6){return function(_0x4f001b){if(_0x4f001b){return _0x4f001b[_0xfe05('0x23')]()[_0xfe05('0x22')](function(){_0x375c77[_0xfe05('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a9a36,_0x504f08){return function(_0x5f4e5d){if(!_0x5f4e5d){_0x5a9a36['sendStatus'](0x194);}return _0x5f4e5d;};}function handleError(_0x32bfe8,_0x1e57a8){_0x1e57a8=_0x1e57a8||0x1f4;return function(_0x27fb98){logger['error'](_0x27fb98[_0xfe05('0x24')]);if(_0x27fb98[_0xfe05('0x25')]){delete _0x27fb98['name'];}_0x32bfe8[_0xfe05('0x18')](_0x1e57a8)[_0xfe05('0x26')](_0x27fb98);};}exports[_0xfe05('0x27')]=function(_0x184c32,_0x138332){var _0x3cba30={},_0x53c066={},_0x9bc3bb={'count':0x0,'rows':[]};var _0x4fb95d=_[_0xfe05('0x28')](db[_0xfe05('0x29')][_0xfe05('0x2a')],function(_0xcc3b01){return{'name':_0xcc3b01[_0xfe05('0x2b')],'type':_0xcc3b01[_0xfe05('0x2c')][_0xfe05('0x2d')]};});_0x53c066['model']=_[_0xfe05('0x28')](_0x4fb95d,_0xfe05('0x25'));_0x53c066[_0xfe05('0x2e')]=_[_0xfe05('0x2f')](_0x184c32[_0xfe05('0x2e')]);_0x53c066[_0xfe05('0x30')]=_[_0xfe05('0x31')](_0x53c066['model'],_0x53c066[_0xfe05('0x2e')]);_0x3cba30[_0xfe05('0x32')]=_[_0xfe05('0x31')](_0x53c066[_0xfe05('0x33')],qs[_0xfe05('0x34')](_0x184c32[_0xfe05('0x2e')][_0xfe05('0x34')]));_0x3cba30[_0xfe05('0x32')]=_0x3cba30[_0xfe05('0x32')][_0xfe05('0x35')]?_0x3cba30[_0xfe05('0x32')]:_0x53c066['model'];if(!_0x184c32[_0xfe05('0x2e')]['hasOwnProperty'](_0xfe05('0x36'))){_0x3cba30[_0xfe05('0x1a')]=qs[_0xfe05('0x1a')](_0x184c32[_0xfe05('0x2e')][_0xfe05('0x1a')]);_0x3cba30[_0xfe05('0x1d')]=qs[_0xfe05('0x1d')](_0x184c32[_0xfe05('0x2e')]['offset']);}_0x3cba30[_0xfe05('0x37')]=qs[_0xfe05('0x38')](_0x184c32[_0xfe05('0x2e')]['sort']);_0x3cba30[_0xfe05('0x39')]=qs[_0xfe05('0x30')](_[_0xfe05('0x3a')](_0x184c32[_0xfe05('0x2e')],_0x53c066['filters']),_0x4fb95d);if(_0x184c32[_0xfe05('0x2e')]['filter']){_0x3cba30[_0xfe05('0x39')]=_[_0xfe05('0x3b')](_0x3cba30[_0xfe05('0x39')],{'$or':_['map'](_0x4fb95d,function(_0xcdf954){if(_0xcdf954['type']!=='VIRTUAL'){var _0x537880={};_0x537880[_0xcdf954['name']]={'$like':'%'+_0x184c32[_0xfe05('0x2e')][_0xfe05('0x3c')]+'%'};return _0x537880;}})});}_0x3cba30=_[_0xfe05('0x3b')]({},_0x3cba30,_0x184c32[_0xfe05('0x3d')]);var _0x25251a={'where':_0x3cba30[_0xfe05('0x39')]};return db[_0xfe05('0x29')][_0xfe05('0x1c')](_0x25251a)['then'](function(_0x24e272){_0x9bc3bb[_0xfe05('0x1c')]=_0x24e272;if(_0x184c32[_0xfe05('0x2e')]['includeAll']){_0x3cba30[_0xfe05('0x3e')]=[{'all':!![]}];}return db['Migration'][_0xfe05('0x3f')](_0x3cba30);})[_0xfe05('0x22')](function(_0x40721d){_0x9bc3bb[_0xfe05('0x40')]=_0x40721d;return _0x9bc3bb;})[_0xfe05('0x22')](respondWithFilteredResult(_0x138332,_0x3cba30))['catch'](handleError(_0x138332,null));}; \ No newline at end of file +var _0xcf5f=['type','model','map','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','error','stack','name','Migration'];(function(_0x11f0e1,_0x520662){var _0x383b23=function(_0x397ed4){while(--_0x397ed4){_0x11f0e1['push'](_0x11f0e1['shift']());}};_0x383b23(++_0x520662);}(_0xcf5f,0xcb));var _0xfcf5=function(_0x6ba211,_0x192ba6){_0x6ba211=_0x6ba211-0x0;var _0x3affae=_0xcf5f[_0x6ba211];return _0x3affae;};'use strict';var emlformat=require(_0xfcf5('0x0'));var rimraf=require(_0xfcf5('0x1'));var zipdir=require(_0xfcf5('0x2'));var jsonpatch=require(_0xfcf5('0x3'));var rp=require(_0xfcf5('0x4'));var moment=require('moment');var BPromise=require(_0xfcf5('0x5'));var Mustache=require('mustache');var util=require(_0xfcf5('0x6'));var path=require(_0xfcf5('0x7'));var sox=require(_0xfcf5('0x8'));var csv=require(_0xfcf5('0x9'));var ejs=require(_0xfcf5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfcf5('0xb'));var crypto=require(_0xfcf5('0xc'));var jsforce=require(_0xfcf5('0xd'));var deskjs=require(_0xfcf5('0xe'));var toCsv=require('to-csv');var querystring=require(_0xfcf5('0xf'));var Papa=require(_0xfcf5('0x10'));var Redis=require(_0xfcf5('0x11'));var authService=require(_0xfcf5('0x12'));var qs=require(_0xfcf5('0x13'));var as=require(_0xfcf5('0x14'));var hardwareService=require(_0xfcf5('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xfcf5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xfcf5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x500d95,_0x5cc01c){_0x5cc01c=_0x5cc01c||0xcc;return function(_0x47437f){if(_0x47437f){return _0x500d95[_0xfcf5('0x18')](_0x5cc01c);}return _0x500d95[_0xfcf5('0x19')](_0x5cc01c)[_0xfcf5('0x1a')]();};}function respondWithResult(_0x50f1f1,_0x17b5d1){_0x17b5d1=_0x17b5d1||0xc8;return function(_0x394c00){if(_0x394c00){return _0x50f1f1[_0xfcf5('0x19')](_0x17b5d1)[_0xfcf5('0x1b')](_0x394c00);}};}function respondWithFilteredResult(_0x37f5a1,_0x469fa1){return function(_0x16d2f6){if(_0x16d2f6){var _0x8f4f0=typeof _0x469fa1[_0xfcf5('0x1c')]===_0xfcf5('0x1d')&&typeof _0x469fa1['limit']===_0xfcf5('0x1d');var _0x3af216=_0x16d2f6[_0xfcf5('0x1e')];var _0x16bb78=_0x8f4f0?0x0:_0x469fa1[_0xfcf5('0x1c')];var _0x47dfe7=_0x8f4f0?_0x16d2f6[_0xfcf5('0x1e')]:_0x469fa1[_0xfcf5('0x1c')]+_0x469fa1[_0xfcf5('0x1f')];var _0x32c18a;if(_0x47dfe7>=_0x3af216){_0x47dfe7=_0x3af216;_0x32c18a=0xc8;}else{_0x32c18a=0xce;}_0x37f5a1['status'](_0x32c18a);return _0x37f5a1['set'](_0xfcf5('0x20'),_0x16bb78+'-'+_0x47dfe7+'/'+_0x3af216)[_0xfcf5('0x1b')](_0x16d2f6);}return null;};}function patchUpdates(_0xec3b13){return function(_0x4e7289){try{jsonpatch['apply'](_0x4e7289,_0xec3b13,!![]);}catch(_0x3a0425){return BPromise[_0xfcf5('0x21')](_0x3a0425);}return _0x4e7289[_0xfcf5('0x22')]();};}function saveUpdates(_0xd8ff0,_0x1d7f7f){return function(_0x3042e0){if(_0x3042e0){return _0x3042e0[_0xfcf5('0x23')](_0xd8ff0)[_0xfcf5('0x24')](function(_0x4346c8){return _0x4346c8;});}return null;};}function removeEntity(_0x422066,_0x7fbbca){return function(_0x2803bc){if(_0x2803bc){return _0x2803bc['destroy']()[_0xfcf5('0x24')](function(){_0x422066[_0xfcf5('0x19')](0xcc)[_0xfcf5('0x1a')]();});}};}function handleEntityNotFound(_0x633c02,_0x38f190){return function(_0x2b0c48){if(!_0x2b0c48){_0x633c02[_0xfcf5('0x18')](0x194);}return _0x2b0c48;};}function handleError(_0x4d4da2,_0x52bff5){_0x52bff5=_0x52bff5||0x1f4;return function(_0x2eebbd){logger[_0xfcf5('0x25')](_0x2eebbd[_0xfcf5('0x26')]);if(_0x2eebbd[_0xfcf5('0x27')]){delete _0x2eebbd['name'];}_0x4d4da2[_0xfcf5('0x19')](_0x52bff5)['send'](_0x2eebbd);};}exports['index']=function(_0x34d399,_0x455855){var _0x12c95b={},_0xc0bc24={},_0x4198d8={'count':0x0,'rows':[]};var _0x2b6d01=_['map'](db[_0xfcf5('0x28')]['rawAttributes'],function(_0x1ed1d4){return{'name':_0x1ed1d4['fieldName'],'type':_0x1ed1d4[_0xfcf5('0x29')]['key']};});_0xc0bc24[_0xfcf5('0x2a')]=_[_0xfcf5('0x2b')](_0x2b6d01,_0xfcf5('0x27'));_0xc0bc24['query']=_['keys'](_0x34d399[_0xfcf5('0x2c')]);_0xc0bc24[_0xfcf5('0x2d')]=_[_0xfcf5('0x2e')](_0xc0bc24[_0xfcf5('0x2a')],_0xc0bc24[_0xfcf5('0x2c')]);_0x12c95b['attributes']=_[_0xfcf5('0x2e')](_0xc0bc24[_0xfcf5('0x2a')],qs[_0xfcf5('0x2f')](_0x34d399[_0xfcf5('0x2c')][_0xfcf5('0x2f')]));_0x12c95b[_0xfcf5('0x30')]=_0x12c95b['attributes'][_0xfcf5('0x31')]?_0x12c95b['attributes']:_0xc0bc24[_0xfcf5('0x2a')];if(!_0x34d399[_0xfcf5('0x2c')]['hasOwnProperty'](_0xfcf5('0x32'))){_0x12c95b[_0xfcf5('0x1f')]=qs[_0xfcf5('0x1f')](_0x34d399[_0xfcf5('0x2c')][_0xfcf5('0x1f')]);_0x12c95b[_0xfcf5('0x1c')]=qs[_0xfcf5('0x1c')](_0x34d399[_0xfcf5('0x2c')]['offset']);}_0x12c95b['order']=qs['sort'](_0x34d399[_0xfcf5('0x2c')][_0xfcf5('0x33')]);_0x12c95b[_0xfcf5('0x34')]=qs[_0xfcf5('0x2d')](_[_0xfcf5('0x35')](_0x34d399[_0xfcf5('0x2c')],_0xc0bc24['filters']),_0x2b6d01);if(_0x34d399[_0xfcf5('0x2c')][_0xfcf5('0x36')]){_0x12c95b[_0xfcf5('0x34')]=_[_0xfcf5('0x37')](_0x12c95b[_0xfcf5('0x34')],{'$or':_[_0xfcf5('0x2b')](_0x2b6d01,function(_0x26c5bc){if(_0x26c5bc[_0xfcf5('0x29')]!==_0xfcf5('0x38')){var _0x3e70d3={};_0x3e70d3[_0x26c5bc[_0xfcf5('0x27')]]={'$like':'%'+_0x34d399['query'][_0xfcf5('0x36')]+'%'};return _0x3e70d3;}})});}_0x12c95b=_[_0xfcf5('0x37')]({},_0x12c95b,_0x34d399['options']);var _0xd23199={'where':_0x12c95b['where']};return db[_0xfcf5('0x28')]['count'](_0xd23199)[_0xfcf5('0x24')](function(_0x5f3366){_0x4198d8[_0xfcf5('0x1e')]=_0x5f3366;if(_0x34d399['query']['includeAll']){_0x12c95b[_0xfcf5('0x39')]=[{'all':!![]}];}return db[_0xfcf5('0x28')][_0xfcf5('0x3a')](_0x12c95b);})[_0xfcf5('0x24')](function(_0x155868){_0x4198d8[_0xfcf5('0x3b')]=_0x155868;return _0x4198d8;})[_0xfcf5('0x24')](respondWithFilteredResult(_0x455855,_0x12c95b))[_0xfcf5('0x3c')](handleError(_0x455855,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 7d76a36..a946c4d 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 _0x3671=['request-promise','../../config/environment','./migration.attributes','exports','define','migrations','lodash','../../config/logger','api','moment','bluebird'];(function(_0x44a5d5,_0x396293){var _0x23c6c5=function(_0x3c1510){while(--_0x3c1510){_0x44a5d5['push'](_0x44a5d5['shift']());}};_0x23c6c5(++_0x396293);}(_0x3671,0xf8));var _0x1367=function(_0x4d3b39,_0x4ec5ad){_0x4d3b39=_0x4d3b39-0x0;var _0x3f92ca=_0x3671[_0x4d3b39];return _0x3f92ca;};'use strict';var _=require(_0x1367('0x0'));var util=require('util');var logger=require(_0x1367('0x1'))(_0x1367('0x2'));var moment=require(_0x1367('0x3'));var BPromise=require(_0x1367('0x4'));var rp=require(_0x1367('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1367('0x6'));var attributes=require(_0x1367('0x7'));module[_0x1367('0x8')]=function(_0x4ee217,_0x35a7b2){return _0x4ee217[_0x1367('0x9')]('Migration',attributes,{'tableName':_0x1367('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x063a=['request-promise','path','exports','Migration','migrations','lodash','../../config/logger','api','bluebird'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x063a,0x125));var _0xa063=function(_0x221da6,_0x5e6658){_0x221da6=_0x221da6-0x0;var _0x32726b=_0x063a[_0x221da6];return _0x32726b;};'use strict';var _=require(_0xa063('0x0'));var util=require('util');var logger=require(_0xa063('0x1'))(_0xa063('0x2'));var moment=require('moment');var BPromise=require(_0xa063('0x3'));var rp=require(_0xa063('0x4'));var fs=require('fs');var path=require(_0xa063('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0xa063('0x6')]=function(_0x4000af,_0x5286b4){return _0x4000af['define'](_0xa063('0x7'),attributes,{'tableName':_0xa063('0x8'),'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 a835410..11e0c2a 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 _0xa900=['../../config/environment','jayson/promise','client','http','request','then','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4cfe90,_0x3da8fb){var _0x13591e=function(_0x3f1281){while(--_0x3f1281){_0x4cfe90['push'](_0x4cfe90['shift']());}};_0x13591e(++_0x3da8fb);}(_0xa900,0x101));var _0x0a90=function(_0x1f8069,_0x10b62c){_0x1f8069=_0x1f8069-0x0;var _0x1c2603=_0xa900[_0x1f8069];return _0x1c2603;};'use strict';var _=require(_0x0a90('0x0'));var util=require(_0x0a90('0x1'));var moment=require(_0x0a90('0x2'));var BPromise=require(_0x0a90('0x3'));var rs=require(_0x0a90('0x4'));var fs=require('fs');var Redis=require(_0x0a90('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a90('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0a90('0x7'));var jayson=require(_0x0a90('0x8'));var client=jayson[_0x0a90('0x9')][_0x0a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56a1e5,_0x3909ac,_0x4718e9){return new BPromise(function(_0x33e3cf,_0x4f2b58){return client[_0x0a90('0xb')](_0x56a1e5,_0x4718e9)[_0x0a90('0xc')](function(_0x36c82f){logger['info'](_0x0a90('0xd'),_0x3909ac,'request\x20sent');logger[_0x0a90('0xe')](_0x0a90('0xf'),_0x3909ac,'request\x20sent',JSON[_0x0a90('0x10')](_0x36c82f));if(_0x36c82f[_0x0a90('0x11')]){if(_0x36c82f[_0x0a90('0x11')][_0x0a90('0x12')]===0x1f4){logger[_0x0a90('0x11')](_0x0a90('0xd'),_0x3909ac,_0x36c82f[_0x0a90('0x11')][_0x0a90('0x13')]);return _0x4f2b58(_0x36c82f[_0x0a90('0x11')][_0x0a90('0x13')]);}logger[_0x0a90('0x11')](_0x0a90('0xd'),_0x3909ac,_0x36c82f[_0x0a90('0x11')]['message']);return _0x33e3cf(_0x36c82f['error'][_0x0a90('0x13')]);}else{logger[_0x0a90('0x14')](_0x0a90('0xd'),_0x3909ac,_0x0a90('0x15'));_0x33e3cf(_0x36c82f[_0x0a90('0x16')][_0x0a90('0x13')]);}})[_0x0a90('0x17')](function(_0x4c5979){logger[_0x0a90('0x11')](_0x0a90('0xd'),_0x3909ac,_0x4c5979);_0x4f2b58(_0x4c5979);});});} \ No newline at end of file +var _0x502a=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x502a,0xd8));var _0xa502=function(_0x45c490,_0x117edb){_0x45c490=_0x45c490-0x0;var _0x220c22=_0x502a[_0x45c490];return _0x220c22;};'use strict';var _=require(_0xa502('0x0'));var util=require(_0xa502('0x1'));var moment=require('moment');var BPromise=require(_0xa502('0x2'));var rs=require(_0xa502('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa502('0x4'));var logger=require('../../config/logger')(_0xa502('0x5'));var config=require(_0xa502('0x6'));var jayson=require(_0xa502('0x7'));var client=jayson[_0xa502('0x8')][_0xa502('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x489407,_0x329022,_0x29fb03){return new BPromise(function(_0x4d30f2,_0x4e4e5d){return client[_0xa502('0xa')](_0x489407,_0x29fb03)[_0xa502('0xb')](function(_0x5251fa){logger[_0xa502('0xc')](_0xa502('0xd'),_0x329022,_0xa502('0xe'));logger['debug'](_0xa502('0xf'),_0x329022,_0xa502('0xe'),JSON[_0xa502('0x10')](_0x5251fa));if(_0x5251fa['error']){if(_0x5251fa[_0xa502('0x11')][_0xa502('0x12')]===0x1f4){logger['error'](_0xa502('0xd'),_0x329022,_0x5251fa[_0xa502('0x11')]['message']);return _0x4e4e5d(_0x5251fa[_0xa502('0x11')][_0xa502('0x13')]);}logger[_0xa502('0x11')]('Migration,\x20%s,\x20%s',_0x329022,_0x5251fa[_0xa502('0x11')][_0xa502('0x13')]);return _0x4d30f2(_0x5251fa[_0xa502('0x11')]['message']);}else{logger[_0xa502('0xc')](_0xa502('0xd'),_0x329022,_0xa502('0xe'));_0x4d30f2(_0x5251fa[_0xa502('0x14')][_0xa502('0x13')]);}})[_0xa502('0x15')](function(_0x3107a0){logger[_0xa502('0x11')](_0xa502('0xd'),_0x329022,_0x3107a0);_0x4e4e5d(_0x3107a0);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 4bf6606..72b7dde 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 _0x014b=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','/:id','isAuthenticated','show','post'];(function(_0x16bcd3,_0x220329){var _0x3a0ed8=function(_0x32c67f){while(--_0x32c67f){_0x16bcd3['push'](_0x16bcd3['shift']());}};_0x3a0ed8(++_0x220329);}(_0x014b,0x1a8));var _0xb014=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0x014b[_0xf79bae];return _0x5d2cb7;};'use strict';var multer=require(_0xb014('0x0'));var util=require(_0xb014('0x1'));var path=require(_0xb014('0x2'));var timeout=require(_0xb014('0x3'));var express=require(_0xb014('0x4'));var router=express[_0xb014('0x5')]();var fs_extra=require(_0xb014('0x6'));var auth=require(_0xb014('0x7'));var interaction=require(_0xb014('0x8'));var config=require(_0xb014('0x9'));var controller=require(_0xb014('0xa'));router[_0xb014('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb014('0xc'),auth[_0xb014('0xd')](),controller[_0xb014('0xe')]);router[_0xb014('0xf')]('/',auth[_0xb014('0xd')](),controller[_0xb014('0x10')]);router[_0xb014('0x11')](_0xb014('0xc'),auth[_0xb014('0xd')](),controller[_0xb014('0x12')]);router[_0xb014('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xb014('0x14')]);module[_0xb014('0x15')]=router; \ No newline at end of file +var _0xedf1=['show','post','create','put','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller','index','get','/:id','isAuthenticated'];(function(_0x37b729,_0x8f10af){var _0x40cd25=function(_0x24154b){while(--_0x24154b){_0x37b729['push'](_0x37b729['shift']());}};_0x40cd25(++_0x8f10af);}(_0xedf1,0xb2));var _0x1edf=function(_0x28ae1c,_0x8dd13c){_0x28ae1c=_0x28ae1c-0x0;var _0x5270d2=_0xedf1[_0x28ae1c];return _0x5270d2;};'use strict';var multer=require(_0x1edf('0x0'));var util=require(_0x1edf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1edf('0x2'));var router=express[_0x1edf('0x3')]();var fs_extra=require(_0x1edf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1edf('0x5'));var config=require(_0x1edf('0x6'));var controller=require(_0x1edf('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1edf('0x8')]);router[_0x1edf('0x9')](_0x1edf('0xa'),auth[_0x1edf('0xb')](),controller[_0x1edf('0xc')]);router[_0x1edf('0xd')]('/',auth[_0x1edf('0xb')](),controller[_0x1edf('0xe')]);router[_0x1edf('0xf')]('/:id',auth[_0x1edf('0xb')](),controller[_0x1edf('0x10')]);router[_0x1edf('0x11')](_0x1edf('0xa'),auth['isAuthenticated'](),controller[_0x1edf('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 60dbbf5..3d962ca 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 _0x4ac2=['localnet','externip','turn','STRING','sequelize','exports','ENUM'];(function(_0x379746,_0x348fb9){var _0x5214b4=function(_0x34565f){while(--_0x34565f){_0x379746['push'](_0x379746['shift']());}};_0x5214b4(++_0x348fb9);}(_0x4ac2,0x74));var _0x24ac=function(_0x530593,_0x57d5d5){_0x530593=_0x530593-0x0;var _0x474b0c=_0x4ac2[_0x530593];return _0x474b0c;};'use strict';var Sequelize=require(_0x24ac('0x0'));module[_0x24ac('0x1')]={'type':{'type':Sequelize[_0x24ac('0x2')](_0x24ac('0x3'),_0x24ac('0x4'),'stun',_0x24ac('0x5'))},'value':{'type':Sequelize[_0x24ac('0x6')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x24ac('0x6')]}}; \ No newline at end of file +var _0x6619=['stun','turn','STRING','sequelize','exports','ENUM','localnet','externip'];(function(_0x444e8b,_0x3524cc){var _0x35eb37=function(_0x17e1a3){while(--_0x17e1a3){_0x444e8b['push'](_0x444e8b['shift']());}};_0x35eb37(++_0x3524cc);}(_0x6619,0x7b));var _0x9661=function(_0x3a6c58,_0xf360e2){_0x3a6c58=_0x3a6c58-0x0;var _0x3c9853=_0x6619[_0x3a6c58];return _0x3c9853;};'use strict';var Sequelize=require(_0x9661('0x0'));module[_0x9661('0x1')]={'type':{'type':Sequelize[_0x9661('0x2')](_0x9661('0x3'),_0x9661('0x4'),_0x9661('0x5'),_0x9661('0x6'))},'value':{'type':Sequelize[_0x9661('0x7')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x9661('0x7')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 72ff302..47501f2 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 _0x75f9=['Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','render','chan_sip.so','update','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','server/files/templates/network.ejs','format','util','ejs','lodash','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','then','info','debug','stringify','error','message','Network,\x20%s,\x20%s','request\x20sent','result','status','json','offset','undefined','count','set','Content-Range','destroy','end','sendStatus','stack','name','send','index','Network','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','keys','length','include','options','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf'];(function(_0x5b6bd0,_0x5a9bcb){var _0x583e0b=function(_0x178313){while(--_0x178313){_0x5b6bd0['push'](_0x5b6bd0['shift']());}};_0x583e0b(++_0x5a9bcb);}(_0x75f9,0x111));var _0x975f=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x75f9[_0x725b8e];return _0x43ac45;};'use strict';var util=require(_0x975f('0x0'));var path=require('path');var ejs=require(_0x975f('0x1'));var fs=require('fs');var _=require(_0x975f('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x975f('0x3'))(_0x975f('0x4'));var config=require(_0x975f('0x5'));var db=require(_0x975f('0x6'))['db'];var jayson=require(_0x975f('0x7'));var client=jayson[_0x975f('0x8')][_0x975f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bc346,_0x2cc021,_0x49b668,_0x3e332){return new Promise(function(_0x27fb3b,_0x1beeb4){var _0x5e85b1=_0x3e332||client;return _0x5e85b1['request'](_0x2bc346,_0x49b668)[_0x975f('0xa')](function(_0x36d685){logger[_0x975f('0xb')]('Network,\x20%s,\x20%s',_0x2cc021,'request\x20sent');logger[_0x975f('0xc')]('Network,\x20%s,\x20%s,\x20%s',_0x2cc021,'request\x20sent',JSON[_0x975f('0xd')](_0x36d685));if(_0x36d685[_0x975f('0xe')]){if(_0x36d685[_0x975f('0xe')]['code']===0x1f4){logger[_0x975f('0xe')]('Network,\x20%s,\x20%s',_0x2cc021,_0x36d685['error'][_0x975f('0xf')]);return _0x1beeb4(_0x36d685['error'][_0x975f('0xf')]);}logger['error'](_0x975f('0x10'),_0x2cc021,_0x36d685[_0x975f('0xe')][_0x975f('0xf')]);return _0x27fb3b(_0x36d685[_0x975f('0xe')]['message']);}else{logger[_0x975f('0xb')]('Network,\x20%s,\x20%s',_0x2cc021,_0x975f('0x11'));_0x27fb3b(_0x36d685[_0x975f('0x12')][_0x975f('0xf')]);}})['catch'](function(_0x407c1e){logger[_0x975f('0xe')](_0x975f('0x10'),_0x2cc021,_0x407c1e);_0x1beeb4(_0x407c1e);});});}function respondWithResult(_0x4d3cb7,_0x59a142){_0x59a142=_0x59a142||0xc8;return function(_0x171d45){if(_0x171d45){return _0x4d3cb7[_0x975f('0x13')](_0x59a142)[_0x975f('0x14')](_0x171d45);}};}function respondWithFilteredResult(_0x3f5c51,_0x2c44e2){return function(_0x2a5855){if(_0x2a5855){var _0x484000=typeof _0x2c44e2[_0x975f('0x15')]===_0x975f('0x16')&&typeof _0x2c44e2['limit']===_0x975f('0x16');var _0x3d3cd2=_0x2a5855[_0x975f('0x17')];var _0x468c39=_0x484000?0x0:_0x2c44e2[_0x975f('0x15')];var _0x238fbd=_0x484000?_0x2a5855[_0x975f('0x17')]:_0x2c44e2[_0x975f('0x15')]+_0x2c44e2['limit'];var _0x491e8b;if(_0x238fbd>=_0x3d3cd2){_0x238fbd=_0x3d3cd2;_0x491e8b=0xc8;}else{_0x491e8b=0xce;}_0x3f5c51['status'](_0x491e8b);return _0x3f5c51[_0x975f('0x18')](_0x975f('0x19'),_0x468c39+'-'+_0x238fbd+'/'+_0x3d3cd2)[_0x975f('0x14')](_0x2a5855);}return null;};}function saveUpdates(_0x16952c){return function(_0x3f6ad9){if(_0x3f6ad9){return _0x3f6ad9['update'](_0x16952c)[_0x975f('0xa')](function(_0xac5030){return _0xac5030;});}return null;};}function removeEntity(_0x5c8351){return function(_0x13041f){if(_0x13041f){return _0x13041f[_0x975f('0x1a')]()['then'](function(){_0x5c8351[_0x975f('0x13')](0xcc)[_0x975f('0x1b')]();});}};}function handleEntityNotFound(_0x1c99b1){return function(_0x585a12){if(!_0x585a12){_0x1c99b1[_0x975f('0x1c')](0x194);}return _0x585a12;};}function handleError(_0x2ea68b,_0x225b1e){_0x225b1e=_0x225b1e||0x1f4;return function(_0x3f9238){logger[_0x975f('0xe')](_0x3f9238[_0x975f('0x1d')]);if(_0x3f9238[_0x975f('0x1e')]){delete _0x3f9238[_0x975f('0x1e')];}_0x2ea68b[_0x975f('0x13')](_0x225b1e)[_0x975f('0x1f')](_0x3f9238);};}exports[_0x975f('0x20')]=function(_0x203cda,_0x21bf27){var _0x546a21={},_0x1a5009={},_0x4d4721={'count':0x0,'rows':[]};var _0x50a305=_['map'](db[_0x975f('0x21')][_0x975f('0x22')],function(_0x50b865){return{'name':_0x50b865[_0x975f('0x23')],'type':_0x50b865[_0x975f('0x24')][_0x975f('0x25')]};});_0x1a5009[_0x975f('0x26')]=_[_0x975f('0x27')](_0x50a305,_0x975f('0x1e'));_0x1a5009[_0x975f('0x28')]=_['keys'](_0x203cda['query']);_0x1a5009[_0x975f('0x29')]=_['intersection'](_0x1a5009[_0x975f('0x26')],_0x1a5009[_0x975f('0x28')]);_0x546a21[_0x975f('0x2a')]=_[_0x975f('0x2b')](_0x1a5009[_0x975f('0x26')],qs['fields'](_0x203cda['query'][_0x975f('0x2c')]));_0x546a21[_0x975f('0x2a')]=_0x546a21[_0x975f('0x2a')]['length']?_0x546a21[_0x975f('0x2a')]:_0x1a5009[_0x975f('0x26')];if(!_0x203cda[_0x975f('0x28')][_0x975f('0x2d')]('nolimit')){_0x546a21[_0x975f('0x2e')]=qs[_0x975f('0x2e')](_0x203cda[_0x975f('0x28')][_0x975f('0x2e')]);_0x546a21[_0x975f('0x15')]=qs[_0x975f('0x15')](_0x203cda[_0x975f('0x28')]['offset']);}_0x546a21[_0x975f('0x2f')]=qs[_0x975f('0x30')](_0x203cda['query'][_0x975f('0x30')]);_0x546a21[_0x975f('0x31')]=qs[_0x975f('0x29')](_[_0x975f('0x32')](_0x203cda[_0x975f('0x28')],_0x1a5009[_0x975f('0x29')]),_0x50a305);if(_0x203cda[_0x975f('0x28')][_0x975f('0x33')]){_0x546a21[_0x975f('0x31')]=_[_0x975f('0x34')](_0x546a21[_0x975f('0x31')],{'$or':_[_0x975f('0x27')](_0x50a305,function(_0x3625fd){if(_0x3625fd['type']!==_0x975f('0x35')){var _0x2a0106={};_0x2a0106[_0x3625fd[_0x975f('0x1e')]]={'$like':'%'+_0x203cda[_0x975f('0x28')][_0x975f('0x33')]+'%'};return _0x2a0106;}})});}_0x546a21=_[_0x975f('0x34')]({},_0x546a21,_0x203cda['options']);var _0xacc780={'where':_0x546a21[_0x975f('0x31')]};return db[_0x975f('0x21')][_0x975f('0x17')](_0xacc780)[_0x975f('0xa')](function(_0x3818e1){_0x4d4721['count']=_0x3818e1;if(_0x203cda['query'][_0x975f('0x36')]){_0x546a21['include']=[{'all':!![]}];}return db[_0x975f('0x21')][_0x975f('0x37')](_0x546a21);})[_0x975f('0xa')](function(_0x12f16e){_0x4d4721['rows']=_0x12f16e;return _0x4d4721;})[_0x975f('0xa')](respondWithFilteredResult(_0x21bf27,_0x546a21))[_0x975f('0x38')](handleError(_0x21bf27,null));};exports[_0x975f('0x39')]=function(_0x5c1c51,_0x366915){var _0x2fed26={'raw':!![],'where':{'id':_0x5c1c51[_0x975f('0x3a')]['id']}},_0x54f077={};_0x54f077['model']=_[_0x975f('0x3b')](db[_0x975f('0x21')][_0x975f('0x22')]);_0x54f077['query']=_[_0x975f('0x3b')](_0x5c1c51[_0x975f('0x28')]);_0x54f077['filters']=_['intersection'](_0x54f077[_0x975f('0x26')],_0x54f077['query']);_0x2fed26[_0x975f('0x2a')]=_[_0x975f('0x2b')](_0x54f077[_0x975f('0x26')],qs['fields'](_0x5c1c51[_0x975f('0x28')][_0x975f('0x2c')]));_0x2fed26['attributes']=_0x2fed26[_0x975f('0x2a')][_0x975f('0x3c')]?_0x2fed26[_0x975f('0x2a')]:_0x54f077[_0x975f('0x26')];if(_0x5c1c51[_0x975f('0x28')]['includeAll']){_0x2fed26[_0x975f('0x3d')]=[{'all':!![]}];}_0x2fed26=_[_0x975f('0x34')]({},_0x2fed26,_0x5c1c51[_0x975f('0x3e')]);return db[_0x975f('0x21')][_0x975f('0x3f')](_0x2fed26)[_0x975f('0xa')](handleEntityNotFound(_0x366915,null))[_0x975f('0xa')](respondWithResult(_0x366915,null))[_0x975f('0x38')](handleError(_0x366915,null));};exports[_0x975f('0x40')]=function(_0x1befc3,_0x1670ab){var _0x39a89f;return db[_0x975f('0x21')]['create'](_0x1befc3['body'],{'raw':!![]})[_0x975f('0xa')](function(_0xa499f3){_0x39a89f=_0xa499f3;return db[_0x975f('0x21')][_0x975f('0x37')]({'where':{'type':_0x1befc3[_0x975f('0x41')][_0x975f('0x24')]},'raw':!![]});})[_0x975f('0xa')](function(_0x42ef77){if(_0x39a89f[_0x975f('0x24')][_0x975f('0x42')]()==_0x975f('0x43')){var _0x421fae=fs[_0x975f('0x44')](path[_0x975f('0x45')](config[_0x975f('0x46')],_0x975f('0x47')),_0x975f('0x48'));var _0x55b89a=ejs['render'](_0x421fae,{'networks':_0x42ef77||[]});fs[_0x975f('0x49')](_0x975f('0x4a'),_0x55b89a);return respondWithRpcPromise(_0x975f('0x4b'),_0x975f('0x40'),{'module':_0x975f('0x4c')});}else if(_0x39a89f[_0x975f('0x24')][_0x975f('0x42')]()==_0x975f('0x4d')){var _0x39e42d=fs[_0x975f('0x44')](path[_0x975f('0x45')](config[_0x975f('0x46')],_0x975f('0x4e')),_0x975f('0x48'));var _0x10fe1b=ejs['render'](_0x39e42d,{'networks':_0x42ef77||[]});fs[_0x975f('0x49')](_0x975f('0x4f'),_0x10fe1b);return respondWithRpcPromise(_0x975f('0x4b'),_0x975f('0x40'),{'module':_0x975f('0x4c')});}else{var _0x433579=fs[_0x975f('0x44')](path[_0x975f('0x45')](config[_0x975f('0x46')],'server/files/templates/network.ejs'),_0x975f('0x48'));var _0x4ae2f4=ejs[_0x975f('0x50')](_0x433579,{'networks':_0x42ef77||[]});fs[_0x975f('0x49')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x1befc3[_0x975f('0x41')][_0x975f('0x24')]['toLowerCase']()),_0x4ae2f4);return respondWithRpcPromise(_0x975f('0x4b'),_0x975f('0x40'),{'module':_0x975f('0x51')});}})[_0x975f('0xa')](function(){return _0x39a89f;})['then'](respondWithResult(_0x1670ab,0xc9))['catch'](handleError(_0x1670ab,null));};exports[_0x975f('0x52')]=function(_0x1bd6fe,_0x55b436){var _0x328acb;return db['Network'][_0x975f('0x3f')]({'where':{'id':_0x1bd6fe[_0x975f('0x3a')]['id']}})[_0x975f('0xa')](handleEntityNotFound(_0x55b436,null))[_0x975f('0xa')](saveUpdates(_0x1bd6fe[_0x975f('0x41')],null))[_0x975f('0xa')](function(_0x106a5b){if(_0x106a5b){_0x328acb=_0x106a5b;return db[_0x975f('0x21')][_0x975f('0x37')]({'where':{'type':_0x328acb['type']},'raw':!![]});}return null;})[_0x975f('0xa')](function(_0x36c4b6){if(_0x328acb[_0x975f('0x24')][_0x975f('0x42')]()==_0x975f('0x43')){var _0xad7462=fs['readFileSync'](path['join'](config[_0x975f('0x46')],_0x975f('0x47')),_0x975f('0x48'));var _0x138ae7=ejs[_0x975f('0x50')](_0xad7462,{'networks':_0x36c4b6||[]});fs[_0x975f('0x49')](_0x975f('0x4a'),_0x138ae7);return respondWithRpcPromise(_0x975f('0x4b'),_0x975f('0x52'),{'module':_0x975f('0x4c')});}else if(_0x328acb[_0x975f('0x24')][_0x975f('0x42')]()==_0x975f('0x4d')){var _0x2245c9=fs[_0x975f('0x44')](path['join'](config[_0x975f('0x46')],_0x975f('0x4e')),_0x975f('0x48'));var _0x318878=ejs[_0x975f('0x50')](_0x2245c9,{'networks':_0x36c4b6||[]});fs[_0x975f('0x49')]('/etc/asterisk/turn_xcally.conf',_0x318878);return respondWithRpcPromise(_0x975f('0x4b'),_0x975f('0x52'),{'module':_0x975f('0x4c')});}else{var _0x5af5d5=fs['readFileSync'](path[_0x975f('0x45')](config['root'],'server/files/templates/network.ejs'),_0x975f('0x48'));var _0x43f2ab=ejs[_0x975f('0x50')](_0x5af5d5,{'networks':_0x36c4b6||[]});fs['writeFileSync'](util['format'](_0x975f('0x53'),_0x1bd6fe[_0x975f('0x41')][_0x975f('0x24')][_0x975f('0x54')]()),_0x43f2ab);return respondWithRpcPromise(_0x975f('0x4b'),_0x975f('0x52'),{'module':_0x975f('0x51')});}})['then'](function(_0x59b31a){if(_0x59b31a){return _0x328acb;}return null;})[_0x975f('0xa')](respondWithResult(_0x55b436,null))[_0x975f('0x38')](handleError(_0x55b436,null));};exports['destroy']=function(_0x2f65c1,_0x2c6798){var _0x5c6269;return db[_0x975f('0x21')][_0x975f('0x3f')]({'where':{'id':_0x2f65c1[_0x975f('0x3a')]['id']}})['then'](function(_0x39b9e6){_0x5c6269=_0x39b9e6;return _0x39b9e6;})[_0x975f('0xa')](handleEntityNotFound(_0x2c6798,null))[_0x975f('0xa')](removeEntity(_0x2c6798,null))[_0x975f('0xa')](function(){if(_0x5c6269){return db['Network']['findAll']({'where':{'type':_0x5c6269[_0x975f('0x24')]},'raw':!![]});}})[_0x975f('0xa')](function(_0x1c6138){if(_0x5c6269[_0x975f('0x24')][_0x975f('0x42')]()==_0x975f('0x43')){var _0x3e012a=fs[_0x975f('0x44')](path['join'](config[_0x975f('0x46')],_0x975f('0x47')),'utf8');var _0x31f989=ejs[_0x975f('0x50')](_0x3e012a,{'networks':_0x1c6138||[]});fs['writeFileSync'](_0x975f('0x4a'),_0x31f989);return respondWithRpcPromise('Reload',_0x975f('0x1a'),{'module':_0x975f('0x4c')});}else if(_0x5c6269[_0x975f('0x24')]['toUpperCase']()==_0x975f('0x4d')){var _0x48ad68=fs[_0x975f('0x44')](path[_0x975f('0x45')](config[_0x975f('0x46')],'server/files/templates/turn_multiple.ejs'),_0x975f('0x48'));var _0x53368e=ejs[_0x975f('0x50')](_0x48ad68,{'networks':_0x1c6138||[]});fs[_0x975f('0x49')](_0x975f('0x4f'),_0x53368e);return respondWithRpcPromise('Reload','destroy',{'module':'res_stun_monitor.so'});}else{var _0x2e1289=fs[_0x975f('0x44')](path[_0x975f('0x45')](config[_0x975f('0x46')],_0x975f('0x55')),_0x975f('0x48'));var _0x10e66f=ejs['render'](_0x2e1289,{'networks':_0x1c6138||[]});fs[_0x975f('0x49')](util[_0x975f('0x56')]('/etc/asterisk/sip_xcally_%s.conf',_0x5c6269[_0x975f('0x24')][_0x975f('0x54')]()),_0x10e66f);return respondWithRpcPromise(_0x975f('0x4b'),'destroy',{'module':_0x975f('0x51')});}})[_0x975f('0x38')](handleError(_0x2c6798,null));}; \ No newline at end of file +var _0x9b45=['request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','limit','undefined','count','offset','set','json','update','end','sendStatus','stack','name','send','index','map','Network','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','rawAttributes','find','create','body','findAll','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','format','chan_sip.so','destroy','toLowerCase','ejs','lodash','../../config/logger','api','../../config/environment','jayson/promise','http'];(function(_0x56206c,_0x3cb817){var _0x39a8f0=function(_0x478e67){while(--_0x478e67){_0x56206c['push'](_0x56206c['shift']());}};_0x39a8f0(++_0x3cb817);}(_0x9b45,0x151));var _0x59b4=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9b45[_0x4a9fb1];return _0x348672;};'use strict';var util=require('util');var path=require('path');var ejs=require(_0x59b4('0x0'));var fs=require('fs');var _=require(_0x59b4('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x59b4('0x2'))(_0x59b4('0x3'));var config=require(_0x59b4('0x4'));var db=require('../../mysqldb')['db'];var jayson=require(_0x59b4('0x5'));var client=jayson['client'][_0x59b4('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x597485,_0x2bb524,_0x417c41,_0x156c80){return new Promise(function(_0x4b267a,_0x2c465e){var _0x2e4ce6=_0x156c80||client;return _0x2e4ce6[_0x59b4('0x7')](_0x597485,_0x417c41)[_0x59b4('0x8')](function(_0x14dec1){logger['info'](_0x59b4('0x9'),_0x2bb524,_0x59b4('0xa'));logger[_0x59b4('0xb')](_0x59b4('0xc'),_0x2bb524,_0x59b4('0xa'),JSON[_0x59b4('0xd')](_0x14dec1));if(_0x14dec1[_0x59b4('0xe')]){if(_0x14dec1[_0x59b4('0xe')]['code']===0x1f4){logger[_0x59b4('0xe')](_0x59b4('0x9'),_0x2bb524,_0x14dec1['error'][_0x59b4('0xf')]);return _0x2c465e(_0x14dec1[_0x59b4('0xe')][_0x59b4('0xf')]);}logger['error'](_0x59b4('0x9'),_0x2bb524,_0x14dec1[_0x59b4('0xe')][_0x59b4('0xf')]);return _0x4b267a(_0x14dec1[_0x59b4('0xe')]['message']);}else{logger[_0x59b4('0x10')](_0x59b4('0x9'),_0x2bb524,_0x59b4('0xa'));_0x4b267a(_0x14dec1[_0x59b4('0x11')][_0x59b4('0xf')]);}})[_0x59b4('0x12')](function(_0x1e81ac){logger[_0x59b4('0xe')](_0x59b4('0x9'),_0x2bb524,_0x1e81ac);_0x2c465e(_0x1e81ac);});});}function respondWithResult(_0x15d900,_0x56eb24){_0x56eb24=_0x56eb24||0xc8;return function(_0x542c23){if(_0x542c23){return _0x15d900[_0x59b4('0x13')](_0x56eb24)['json'](_0x542c23);}};}function respondWithFilteredResult(_0x2ce0fb,_0x4551ce){return function(_0x2ff221){if(_0x2ff221){var _0x4c96c4=typeof _0x4551ce['offset']==='undefined'&&typeof _0x4551ce[_0x59b4('0x14')]===_0x59b4('0x15');var _0x2d7951=_0x2ff221[_0x59b4('0x16')];var _0x53d2bb=_0x4c96c4?0x0:_0x4551ce[_0x59b4('0x17')];var _0x49a322=_0x4c96c4?_0x2ff221[_0x59b4('0x16')]:_0x4551ce[_0x59b4('0x17')]+_0x4551ce[_0x59b4('0x14')];var _0x3f7998;if(_0x49a322>=_0x2d7951){_0x49a322=_0x2d7951;_0x3f7998=0xc8;}else{_0x3f7998=0xce;}_0x2ce0fb[_0x59b4('0x13')](_0x3f7998);return _0x2ce0fb[_0x59b4('0x18')]('Content-Range',_0x53d2bb+'-'+_0x49a322+'/'+_0x2d7951)[_0x59b4('0x19')](_0x2ff221);}return null;};}function saveUpdates(_0x5d38a0){return function(_0x1996d4){if(_0x1996d4){return _0x1996d4[_0x59b4('0x1a')](_0x5d38a0)[_0x59b4('0x8')](function(_0xdf9bd0){return _0xdf9bd0;});}return null;};}function removeEntity(_0x271682){return function(_0x2f6c37){if(_0x2f6c37){return _0x2f6c37['destroy']()['then'](function(){_0x271682[_0x59b4('0x13')](0xcc)[_0x59b4('0x1b')]();});}};}function handleEntityNotFound(_0x3312c9){return function(_0x296ee6){if(!_0x296ee6){_0x3312c9[_0x59b4('0x1c')](0x194);}return _0x296ee6;};}function handleError(_0x4336e2,_0x528392){_0x528392=_0x528392||0x1f4;return function(_0x6bc86b){logger[_0x59b4('0xe')](_0x6bc86b[_0x59b4('0x1d')]);if(_0x6bc86b[_0x59b4('0x1e')]){delete _0x6bc86b[_0x59b4('0x1e')];}_0x4336e2['status'](_0x528392)[_0x59b4('0x1f')](_0x6bc86b);};}exports[_0x59b4('0x20')]=function(_0x2d7f37,_0x88bb3a){var _0x23da5a={},_0x45af5e={},_0xfe0d91={'count':0x0,'rows':[]};var _0x104da0=_[_0x59b4('0x21')](db[_0x59b4('0x22')]['rawAttributes'],function(_0xe2dc3c){return{'name':_0xe2dc3c[_0x59b4('0x23')],'type':_0xe2dc3c[_0x59b4('0x24')][_0x59b4('0x25')]};});_0x45af5e['model']=_[_0x59b4('0x21')](_0x104da0,_0x59b4('0x1e'));_0x45af5e[_0x59b4('0x26')]=_[_0x59b4('0x27')](_0x2d7f37[_0x59b4('0x26')]);_0x45af5e[_0x59b4('0x28')]=_['intersection'](_0x45af5e[_0x59b4('0x29')],_0x45af5e[_0x59b4('0x26')]);_0x23da5a[_0x59b4('0x2a')]=_[_0x59b4('0x2b')](_0x45af5e[_0x59b4('0x29')],qs[_0x59b4('0x2c')](_0x2d7f37[_0x59b4('0x26')]['fields']));_0x23da5a[_0x59b4('0x2a')]=_0x23da5a[_0x59b4('0x2a')][_0x59b4('0x2d')]?_0x23da5a[_0x59b4('0x2a')]:_0x45af5e['model'];if(!_0x2d7f37[_0x59b4('0x26')][_0x59b4('0x2e')](_0x59b4('0x2f'))){_0x23da5a[_0x59b4('0x14')]=qs[_0x59b4('0x14')](_0x2d7f37[_0x59b4('0x26')]['limit']);_0x23da5a[_0x59b4('0x17')]=qs[_0x59b4('0x17')](_0x2d7f37[_0x59b4('0x26')][_0x59b4('0x17')]);}_0x23da5a[_0x59b4('0x30')]=qs[_0x59b4('0x31')](_0x2d7f37[_0x59b4('0x26')][_0x59b4('0x31')]);_0x23da5a[_0x59b4('0x32')]=qs[_0x59b4('0x28')](_[_0x59b4('0x33')](_0x2d7f37[_0x59b4('0x26')],_0x45af5e[_0x59b4('0x28')]),_0x104da0);if(_0x2d7f37[_0x59b4('0x26')][_0x59b4('0x34')]){_0x23da5a[_0x59b4('0x32')]=_[_0x59b4('0x35')](_0x23da5a[_0x59b4('0x32')],{'$or':_[_0x59b4('0x21')](_0x104da0,function(_0x1903e6){if(_0x1903e6['type']!==_0x59b4('0x36')){var _0x96fead={};_0x96fead[_0x1903e6[_0x59b4('0x1e')]]={'$like':'%'+_0x2d7f37[_0x59b4('0x26')]['filter']+'%'};return _0x96fead;}})});}_0x23da5a=_[_0x59b4('0x35')]({},_0x23da5a,_0x2d7f37[_0x59b4('0x37')]);var _0x3fa24d={'where':_0x23da5a[_0x59b4('0x32')]};return db['Network'][_0x59b4('0x16')](_0x3fa24d)['then'](function(_0x4a605f){_0xfe0d91[_0x59b4('0x16')]=_0x4a605f;if(_0x2d7f37['query'][_0x59b4('0x38')]){_0x23da5a[_0x59b4('0x39')]=[{'all':!![]}];}return db[_0x59b4('0x22')]['findAll'](_0x23da5a);})[_0x59b4('0x8')](function(_0x262a9f){_0xfe0d91['rows']=_0x262a9f;return _0xfe0d91;})[_0x59b4('0x8')](respondWithFilteredResult(_0x88bb3a,_0x23da5a))[_0x59b4('0x12')](handleError(_0x88bb3a,null));};exports[_0x59b4('0x3a')]=function(_0x24434c,_0x2da9c4){var _0x291223={'raw':!![],'where':{'id':_0x24434c[_0x59b4('0x3b')]['id']}},_0x25bb00={};_0x25bb00[_0x59b4('0x29')]=_[_0x59b4('0x27')](db[_0x59b4('0x22')][_0x59b4('0x3c')]);_0x25bb00[_0x59b4('0x26')]=_[_0x59b4('0x27')](_0x24434c['query']);_0x25bb00[_0x59b4('0x28')]=_[_0x59b4('0x2b')](_0x25bb00[_0x59b4('0x29')],_0x25bb00[_0x59b4('0x26')]);_0x291223[_0x59b4('0x2a')]=_[_0x59b4('0x2b')](_0x25bb00[_0x59b4('0x29')],qs[_0x59b4('0x2c')](_0x24434c[_0x59b4('0x26')][_0x59b4('0x2c')]));_0x291223[_0x59b4('0x2a')]=_0x291223[_0x59b4('0x2a')][_0x59b4('0x2d')]?_0x291223[_0x59b4('0x2a')]:_0x25bb00[_0x59b4('0x29')];if(_0x24434c[_0x59b4('0x26')]['includeAll']){_0x291223[_0x59b4('0x39')]=[{'all':!![]}];}_0x291223=_['merge']({},_0x291223,_0x24434c[_0x59b4('0x37')]);return db[_0x59b4('0x22')][_0x59b4('0x3d')](_0x291223)[_0x59b4('0x8')](handleEntityNotFound(_0x2da9c4,null))['then'](respondWithResult(_0x2da9c4,null))[_0x59b4('0x12')](handleError(_0x2da9c4,null));};exports[_0x59b4('0x3e')]=function(_0xc5af88,_0x329ea2){var _0x2b50f3;return db['Network']['create'](_0xc5af88[_0x59b4('0x3f')],{'raw':!![]})[_0x59b4('0x8')](function(_0xa4d97){_0x2b50f3=_0xa4d97;return db[_0x59b4('0x22')][_0x59b4('0x40')]({'where':{'type':_0xc5af88[_0x59b4('0x3f')]['type']},'raw':!![]});})['then'](function(_0x3a7ffe){if(_0x2b50f3[_0x59b4('0x24')][_0x59b4('0x41')]()==_0x59b4('0x42')){var _0x287c51=fs['readFileSync'](path[_0x59b4('0x43')](config[_0x59b4('0x44')],_0x59b4('0x45')),_0x59b4('0x46'));var _0x2a0bb3=ejs[_0x59b4('0x47')](_0x287c51,{'networks':_0x3a7ffe||[]});fs[_0x59b4('0x48')](_0x59b4('0x49'),_0x2a0bb3);return respondWithRpcPromise(_0x59b4('0x4a'),_0x59b4('0x3e'),{'module':_0x59b4('0x4b')});}else if(_0x2b50f3[_0x59b4('0x24')][_0x59b4('0x41')]()==_0x59b4('0x4c')){var _0x518900=fs[_0x59b4('0x4d')](path['join'](config[_0x59b4('0x44')],_0x59b4('0x4e')),_0x59b4('0x46'));var _0x1664a8=ejs[_0x59b4('0x47')](_0x518900,{'networks':_0x3a7ffe||[]});fs['writeFileSync'](_0x59b4('0x4f'),_0x1664a8);return respondWithRpcPromise(_0x59b4('0x4a'),_0x59b4('0x3e'),{'module':_0x59b4('0x4b')});}else{var _0x53c96c=fs[_0x59b4('0x4d')](path[_0x59b4('0x43')](config[_0x59b4('0x44')],_0x59b4('0x50')),_0x59b4('0x46'));var _0x188928=ejs['render'](_0x53c96c,{'networks':_0x3a7ffe||[]});fs[_0x59b4('0x48')](util['format'](_0x59b4('0x51'),_0xc5af88[_0x59b4('0x3f')][_0x59b4('0x24')]['toLowerCase']()),_0x188928);return respondWithRpcPromise(_0x59b4('0x4a'),_0x59b4('0x3e'),{'module':'chan_sip.so'});}})[_0x59b4('0x8')](function(){return _0x2b50f3;})[_0x59b4('0x8')](respondWithResult(_0x329ea2,0xc9))[_0x59b4('0x12')](handleError(_0x329ea2,null));};exports['update']=function(_0x4153ed,_0x2f9bcc){var _0x550037;return db['Network'][_0x59b4('0x3d')]({'where':{'id':_0x4153ed[_0x59b4('0x3b')]['id']}})[_0x59b4('0x8')](handleEntityNotFound(_0x2f9bcc,null))['then'](saveUpdates(_0x4153ed[_0x59b4('0x3f')],null))[_0x59b4('0x8')](function(_0x31f783){if(_0x31f783){_0x550037=_0x31f783;return db[_0x59b4('0x22')][_0x59b4('0x40')]({'where':{'type':_0x550037[_0x59b4('0x24')]},'raw':!![]});}return null;})[_0x59b4('0x8')](function(_0x179e9e){if(_0x550037['type'][_0x59b4('0x41')]()==_0x59b4('0x42')){var _0x5394ce=fs['readFileSync'](path['join'](config[_0x59b4('0x44')],_0x59b4('0x45')),_0x59b4('0x46'));var _0x37ec4c=ejs['render'](_0x5394ce,{'networks':_0x179e9e||[]});fs[_0x59b4('0x48')]('/etc/asterisk/stun_xcally.conf',_0x37ec4c);return respondWithRpcPromise('Reload',_0x59b4('0x1a'),{'module':_0x59b4('0x4b')});}else if(_0x550037[_0x59b4('0x24')]['toUpperCase']()=='TURN'){var _0x2207d0=fs[_0x59b4('0x4d')](path[_0x59b4('0x43')](config[_0x59b4('0x44')],_0x59b4('0x4e')),'utf8');var _0x4b8ab4=ejs[_0x59b4('0x47')](_0x2207d0,{'networks':_0x179e9e||[]});fs[_0x59b4('0x48')](_0x59b4('0x4f'),_0x4b8ab4);return respondWithRpcPromise(_0x59b4('0x4a'),_0x59b4('0x1a'),{'module':_0x59b4('0x4b')});}else{var _0x334c2a=fs[_0x59b4('0x4d')](path[_0x59b4('0x43')](config[_0x59b4('0x44')],_0x59b4('0x50')),_0x59b4('0x46'));var _0x22a744=ejs[_0x59b4('0x47')](_0x334c2a,{'networks':_0x179e9e||[]});fs[_0x59b4('0x48')](util[_0x59b4('0x52')](_0x59b4('0x51'),_0x4153ed[_0x59b4('0x3f')][_0x59b4('0x24')]['toLowerCase']()),_0x22a744);return respondWithRpcPromise(_0x59b4('0x4a'),_0x59b4('0x1a'),{'module':_0x59b4('0x53')});}})[_0x59b4('0x8')](function(_0x4e0fb5){if(_0x4e0fb5){return _0x550037;}return null;})['then'](respondWithResult(_0x2f9bcc,null))['catch'](handleError(_0x2f9bcc,null));};exports[_0x59b4('0x54')]=function(_0x5caffa,_0x30bc3d){var _0x20d3dc;return db['Network'][_0x59b4('0x3d')]({'where':{'id':_0x5caffa['params']['id']}})[_0x59b4('0x8')](function(_0x2ed930){_0x20d3dc=_0x2ed930;return _0x2ed930;})[_0x59b4('0x8')](handleEntityNotFound(_0x30bc3d,null))[_0x59b4('0x8')](removeEntity(_0x30bc3d,null))[_0x59b4('0x8')](function(){if(_0x20d3dc){return db[_0x59b4('0x22')][_0x59b4('0x40')]({'where':{'type':_0x20d3dc['type']},'raw':!![]});}})[_0x59b4('0x8')](function(_0xa1a3e){if(_0x20d3dc['type'][_0x59b4('0x41')]()=='STUN'){var _0x57470f=fs['readFileSync'](path[_0x59b4('0x43')](config[_0x59b4('0x44')],_0x59b4('0x45')),_0x59b4('0x46'));var _0x263238=ejs[_0x59b4('0x47')](_0x57470f,{'networks':_0xa1a3e||[]});fs[_0x59b4('0x48')]('/etc/asterisk/stun_xcally.conf',_0x263238);return respondWithRpcPromise(_0x59b4('0x4a'),'destroy',{'module':_0x59b4('0x4b')});}else if(_0x20d3dc['type']['toUpperCase']()==_0x59b4('0x4c')){var _0x32d6d3=fs[_0x59b4('0x4d')](path['join'](config[_0x59b4('0x44')],_0x59b4('0x4e')),'utf8');var _0x3240ef=ejs[_0x59b4('0x47')](_0x32d6d3,{'networks':_0xa1a3e||[]});fs['writeFileSync'](_0x59b4('0x4f'),_0x3240ef);return respondWithRpcPromise(_0x59b4('0x4a'),_0x59b4('0x54'),{'module':_0x59b4('0x4b')});}else{var _0x3493d9=fs['readFileSync'](path[_0x59b4('0x43')](config[_0x59b4('0x44')],_0x59b4('0x50')),_0x59b4('0x46'));var _0x587dc6=ejs[_0x59b4('0x47')](_0x3493d9,{'networks':_0xa1a3e||[]});fs[_0x59b4('0x48')](util[_0x59b4('0x52')](_0x59b4('0x51'),_0x20d3dc[_0x59b4('0x24')][_0x59b4('0x55')]()),_0x587dc6);return respondWithRpcPromise(_0x59b4('0x4a'),_0x59b4('0x54'),{'module':'chan_sip.so'});}})[_0x59b4('0x12')](handleError(_0x30bc3d,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index e3958a1..e2c91ac 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 _0xc788=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Network','lodash','util'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xc788,0xc4));var _0x8c78=function(_0x319fc1,_0x29179b){_0x319fc1=_0x319fc1-0x0;var _0xb768af=_0xc788[_0x319fc1];return _0xb768af;};'use strict';var _=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var logger=require(_0x8c78('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8c78('0x3'));var rp=require(_0x8c78('0x4'));var fs=require('fs');var path=require(_0x8c78('0x5'));var rimraf=require(_0x8c78('0x6'));var config=require(_0x8c78('0x7'));var attributes=require('./network.attributes');module[_0x8c78('0x8')]=function(_0x4555da,_0x329152){return _0x4555da[_0x8c78('0x9')](_0x8c78('0xa'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8cc8=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','Network','network','lodash','util','../../config/logger'];(function(_0x252700,_0x5e80ec){var _0x5c4844=function(_0x371874){while(--_0x371874){_0x252700['push'](_0x252700['shift']());}};_0x5c4844(++_0x5e80ec);}(_0x8cc8,0x177));var _0x88cc=function(_0x16c9fc,_0x41195b){_0x16c9fc=_0x16c9fc-0x0;var _0xdfdba1=_0x8cc8[_0x16c9fc];return _0xdfdba1;};'use strict';var _=require(_0x88cc('0x0'));var util=require(_0x88cc('0x1'));var logger=require(_0x88cc('0x2'))(_0x88cc('0x3'));var moment=require(_0x88cc('0x4'));var BPromise=require(_0x88cc('0x5'));var rp=require(_0x88cc('0x6'));var fs=require('fs');var path=require(_0x88cc('0x7'));var rimraf=require(_0x88cc('0x8'));var config=require(_0x88cc('0x9'));var attributes=require(_0x88cc('0xa'));module[_0x88cc('0xb')]=function(_0x1683f9,_0x525362){return _0x1683f9['define'](_0x88cc('0xc'),attributes,{'tableName':_0x88cc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index e1ed7b1..62d7f47 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4d2729,_0x1044b8){var _0x28b218=function(_0xcb06e3){while(--_0xcb06e3){_0x4d2729['push'](_0x4d2729['shift']());}};_0x28b218(++_0x1044b8);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x36d57f,_0x2f9118){var _0x3f93fb=function(_0x567b58){while(--_0x567b58){_0x36d57f['push'](_0x36d57f['shift']());}};_0x3f93fb(++_0x2f9118);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 16b6e38..08c02c2 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 _0xe5af=['exports','util','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','addAnswer','notify','addApplications','addAgents','/:id/send','send','put','delete','/:id','removeAnswers'];(function(_0x4ed5f7,_0x3a6084){var _0x6533a=function(_0x1ab2f4){while(--_0x1ab2f4){_0x4ed5f7['push'](_0x4ed5f7['shift']());}};_0x6533a(++_0x3a6084);}(_0xe5af,0x9c));var _0xfe5a=function(_0x2b8367,_0x51c6d){_0x2b8367=_0x2b8367-0x0;var _0x1cedd2=_0xe5af[_0x2b8367];return _0x1cedd2;};'use strict';var multer=require('multer');var util=require(_0xfe5a('0x0'));var path=require(_0xfe5a('0x1'));var timeout=require('connect-timeout');var express=require(_0xfe5a('0x2'));var router=express[_0xfe5a('0x3')]();var fs_extra=require(_0xfe5a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfe5a('0x5'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0xfe5a('0x6')]('/',auth[_0xfe5a('0x7')](),controller['index']);router['get'](_0xfe5a('0x8'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x9')]);router[_0xfe5a('0x6')]('/:id',auth[_0xfe5a('0x7')](),controller['show']);router['get'](_0xfe5a('0xa'),auth[_0xfe5a('0x7')](),controller['getDispositions']);router[_0xfe5a('0x6')](_0xfe5a('0xb'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xc')]);router[_0xfe5a('0x6')]('/:id/applications',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xd')]);router[_0xfe5a('0x6')](_0xfe5a('0xe'),auth[_0xfe5a('0x7')](),controller['getInteractions']);router[_0xfe5a('0x6')](_0xfe5a('0xf'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x10')]);router[_0xfe5a('0x11')]('/',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x12')]);router[_0xfe5a('0x11')](_0xfe5a('0xa'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x13')]);router[_0xfe5a('0x11')](_0xfe5a('0xb'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x14')]);router[_0xfe5a('0x11')]('/:id/notify',controller[_0xfe5a('0x15')]);router[_0xfe5a('0x11')]('/:id/applications',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x16')]);router[_0xfe5a('0x11')]('/:id/users',auth['isAuthenticated'](),controller[_0xfe5a('0x17')]);router[_0xfe5a('0x11')](_0xfe5a('0x18'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x19')]);router[_0xfe5a('0x1a')]('/:id',auth[_0xfe5a('0x7')](),controller['update']);router[_0xfe5a('0x1b')](_0xfe5a('0x1c'),auth[_0xfe5a('0x7')](),controller['destroy']);router['delete'](_0xfe5a('0xa'),auth[_0xfe5a('0x7')](),controller['removeDispositions']);router[_0xfe5a('0x1b')](_0xfe5a('0xb'),auth['isAuthenticated'](),controller[_0xfe5a('0x1d')]);router[_0xfe5a('0x1b')](_0xfe5a('0xf'),auth[_0xfe5a('0x7')](),controller['removeAgents']);module[_0xfe5a('0x1e')]=router; \ No newline at end of file +var _0xbbbc=['fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','getInteractions','getAgents','post','/:id/dispositions','addDisposition','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','send','put','update','delete','destroy','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router'];(function(_0x91c27d,_0x453090){var _0x22f9a2=function(_0x3be5d1){while(--_0x3be5d1){_0x91c27d['push'](_0x91c27d['shift']());}};_0x22f9a2(++_0x453090);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x6fd730,_0x3b1344){_0x6fd730=_0x6fd730-0x0;var _0x2cb7d7=_0xbbbc[_0x6fd730];return _0x2cb7d7;};'use strict';var multer=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var path=require(_0xcbbb('0x2'));var timeout=require(_0xcbbb('0x3'));var express=require(_0xcbbb('0x4'));var router=express[_0xcbbb('0x5')]();var fs_extra=require(_0xcbbb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xcbbb('0x7'));var config=require(_0xcbbb('0x8'));var controller=require(_0xcbbb('0x9'));router[_0xcbbb('0xa')]('/',auth[_0xcbbb('0xb')](),controller['index']);router[_0xcbbb('0xa')](_0xcbbb('0xc'),auth[_0xcbbb('0xb')](),controller[_0xcbbb('0xd')]);router[_0xcbbb('0xa')](_0xcbbb('0xe'),auth[_0xcbbb('0xb')](),controller['show']);router[_0xcbbb('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xcbbb('0xf')]);router['get'](_0xcbbb('0x10'),auth['isAuthenticated'](),controller[_0xcbbb('0x11')]);router[_0xcbbb('0xa')]('/:id/applications',auth[_0xcbbb('0xb')](),controller['getApplications']);router[_0xcbbb('0xa')]('/:id/interactions',auth[_0xcbbb('0xb')](),controller[_0xcbbb('0x12')]);router[_0xcbbb('0xa')]('/:id/users',auth[_0xcbbb('0xb')](),controller[_0xcbbb('0x13')]);router[_0xcbbb('0x14')]('/',auth[_0xcbbb('0xb')](),controller['create']);router['post'](_0xcbbb('0x15'),auth[_0xcbbb('0xb')](),controller[_0xcbbb('0x16')]);router[_0xcbbb('0x14')]('/:id/canned_answers',auth[_0xcbbb('0xb')](),controller['addAnswer']);router[_0xcbbb('0x14')](_0xcbbb('0x17'),controller[_0xcbbb('0x18')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xcbbb('0x19')]);router[_0xcbbb('0x14')](_0xcbbb('0x1a'),auth[_0xcbbb('0xb')](),controller[_0xcbbb('0x1b')]);router[_0xcbbb('0x14')](_0xcbbb('0x1c'),auth[_0xcbbb('0xb')](),controller[_0xcbbb('0x1d')]);router[_0xcbbb('0x1e')]('/:id',auth[_0xcbbb('0xb')](),controller[_0xcbbb('0x1f')]);router[_0xcbbb('0x20')](_0xcbbb('0xe'),auth[_0xcbbb('0xb')](),controller[_0xcbbb('0x21')]);router[_0xcbbb('0x20')](_0xcbbb('0x15'),auth[_0xcbbb('0xb')](),controller['removeDispositions']);router[_0xcbbb('0x20')](_0xcbbb('0x10'),auth['isAuthenticated'](),controller[_0xcbbb('0x22')]);router['delete']('/:id/users',auth[_0xcbbb('0xb')](),controller[_0xcbbb('0x23')]);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 b94c877..43813d7 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 _0xd7ee=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x126426,_0x588153){var _0x3eb39f=function(_0x56250e){while(--_0x56250e){_0x126426['push'](_0x126426['shift']());}};_0x3eb39f(++_0x588153);}(_0xd7ee,0xa2));var _0xed7e=function(_0x45ea78,_0x31678e){_0x45ea78=_0x45ea78-0x0;var _0xd722b7=_0xd7ee[_0x45ea78];return _0xd722b7;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xed7e('0x0')]={'name':{'type':Sequelize[_0xed7e('0x1')],'unique':_0xed7e('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xed7e('0x1')],'defaultValue':function(){return rs[_0xed7e('0x3')]();}},'replyUri':{'type':Sequelize[_0xed7e('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xed7e('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xed7e('0x4')],'defaultValue':function(){return _0xed7e('0x5');}},'notificationSound':{'type':Sequelize[_0xed7e('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xed7e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xed7e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xed7e('0x1')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xed7e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xed7e('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xed7e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xed7e('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xed7e('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xed7e('0x6')],'defaultValue':![],'comment':_0xed7e('0x9'),'set':function(_0x23250d){if(!_0x23250d)this['setDataValue'](_0xed7e('0xa'),null);this['setDataValue'](_0xed7e('0xb'),_0x23250d);}}}; \ No newline at end of file +var _0x6522=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate'];(function(_0x5057c5,_0x15a845){var _0x335404=function(_0x512876){while(--_0x512876){_0x5057c5['push'](_0x5057c5['shift']());}};_0x335404(++_0x15a845);}(_0x6522,0xa3));var _0x2652=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6522[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x2652('0x0'));var rs=require(_0x2652('0x1'));module[_0x2652('0x2')]={'name':{'type':Sequelize[_0x2652('0x3')],'unique':_0x2652('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x2652('0x3')],'defaultValue':function(){return rs[_0x2652('0x5')]();}},'replyUri':{'type':Sequelize[_0x2652('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x2652('0x6');}},'notificationSound':{'type':Sequelize[_0x2652('0x7')],'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['STRING']},'queueTransfer':{'type':Sequelize[_0x2652('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2652('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2652('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2652('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2652('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x2652('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x2652('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2eec07){if(!_0x2eec07)this[_0x2652('0xa')](_0x2652('0xb'),null);this[_0x2652('0xa')](_0x2652('0xc'),_0x2eec07);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index fc1a3d6..66514b6 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 _0x184e=['Contact','Owner','internal','Tag','Tags','color','tag','addAgents','ids','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','DESC','defaults','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','http','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','OpenchannelAccount','findAll','rows','show','keys','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','params','describe','Disposition','getDispositions','pick','includeAll','removeDispositions','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','findOne','notify','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','ValidationError','from\x20is\x20mandatory','mapKey','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','OpenchannelApplication','account','applications','Applications','list','priority','asc','Contacts','ListId','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','firstName','messageId','interaction','created','push','close','unmanaged','*,*,*,*','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','getInteractions'];(function(_0x506429,_0x32fa24){var _0x3abf3f=function(_0x41ac10){while(--_0x41ac10){_0x506429['push'](_0x506429['shift']());}};_0x3abf3f(++_0x32fa24);}(_0x184e,0x1a0));var _0xe184=function(_0x208128,_0x9e2557){_0x208128=_0x208128-0x0;var _0x213a02=_0x184e[_0x208128];return _0x213a02;};'use strict';var emlformat=require(_0xe184('0x0'));var rimraf=require(_0xe184('0x1'));var zipdir=require(_0xe184('0x2'));var jsonpatch=require(_0xe184('0x3'));var rp=require(_0xe184('0x4'));var moment=require(_0xe184('0x5'));var BPromise=require(_0xe184('0x6'));var Mustache=require('mustache');var util=require(_0xe184('0x7'));var path=require(_0xe184('0x8'));var sox=require(_0xe184('0x9'));var csv=require(_0xe184('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe184('0xb'));var crypto=require('crypto');var jsforce=require(_0xe184('0xc'));var deskjs=require(_0xe184('0xd'));var toCsv=require(_0xe184('0xa'));var querystring=require(_0xe184('0xe'));var Papa=require(_0xe184('0xf'));var Redis=require(_0xe184('0x10'));var authService=require(_0xe184('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe184('0x12'));var logger=require(_0xe184('0x13'))(_0xe184('0x14'));var utils=require(_0xe184('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe184('0x16'));var db=require(_0xe184('0x17'))['db'];config[_0xe184('0x18')]=_['defaults'](config[_0xe184('0x18')],{'host':_0xe184('0x19'),'port':0x18eb});var socket=require(_0xe184('0x1a'))(new Redis(config['redis']));require(_0xe184('0x1b'))[_0xe184('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xe184('0x1d')]({'port':0x232c});var client9002=jayson[_0xe184('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x586553,_0x5a5af1,_0x3ce512,_0xa63804){return new BPromise(function(_0x3b1347,_0x51f2ba){var _0x138ee8=_0xa63804||client;return _0x138ee8[_0xe184('0x1f')](_0x586553,_0x3ce512)[_0xe184('0x20')](function(_0x21548a){logger[_0xe184('0x21')](_0xe184('0x22'),_0x5a5af1,_0xe184('0x23'));logger[_0xe184('0x24')](_0xe184('0x25'),_0x5a5af1,_0xe184('0x23'),JSON[_0xe184('0x26')](_0x21548a));if(_0x21548a['error']){if(_0x21548a['error'][_0xe184('0x27')]===0x1f4){logger[_0xe184('0x28')](_0xe184('0x22'),_0x5a5af1,_0x21548a[_0xe184('0x28')][_0xe184('0x29')]);return _0x51f2ba(_0x21548a['error'][_0xe184('0x29')]);}logger[_0xe184('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0x5a5af1,_0x21548a[_0xe184('0x28')][_0xe184('0x29')]);return _0x3b1347(_0x21548a[_0xe184('0x28')][_0xe184('0x29')]);}else{logger[_0xe184('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x5a5af1,_0xe184('0x23'));_0x3b1347(_0x21548a['result'][_0xe184('0x29')]);}})[_0xe184('0x2a')](function(_0x3f5d65){logger[_0xe184('0x28')](_0xe184('0x22'),_0x5a5af1,_0x3f5d65);_0x51f2ba(_0x3f5d65);});});}function respondWithStatusCode(_0x262212,_0x28bdf8){_0x28bdf8=_0x28bdf8||0xcc;return function(_0x293eb6){if(_0x293eb6){return _0x262212[_0xe184('0x2b')](_0x28bdf8);}return _0x262212[_0xe184('0x2c')](_0x28bdf8)[_0xe184('0x2d')]();};}function respondWithResult(_0x1c600e,_0x362487){_0x362487=_0x362487||0xc8;return function(_0x4772d6){if(_0x4772d6){return _0x1c600e[_0xe184('0x2c')](_0x362487)[_0xe184('0x2e')](_0x4772d6);}};}function respondWithFilteredResult(_0x507124,_0x14c586){return function(_0x1e5df1){if(_0x1e5df1){var _0x5ac76b=typeof _0x14c586[_0xe184('0x2f')]===_0xe184('0x30')&&typeof _0x14c586[_0xe184('0x31')]===_0xe184('0x30');var _0x226b80=_0x1e5df1[_0xe184('0x32')];var _0x2132c0=_0x5ac76b?0x0:_0x14c586[_0xe184('0x2f')];var _0x58f62b=_0x5ac76b?_0x1e5df1[_0xe184('0x32')]:_0x14c586[_0xe184('0x2f')]+_0x14c586[_0xe184('0x31')];var _0x54b3cc;if(_0x58f62b>=_0x226b80){_0x58f62b=_0x226b80;_0x54b3cc=0xc8;}else{_0x54b3cc=0xce;}_0x507124[_0xe184('0x2c')](_0x54b3cc);return _0x507124[_0xe184('0x33')]('Content-Range',_0x2132c0+'-'+_0x58f62b+'/'+_0x226b80)[_0xe184('0x2e')](_0x1e5df1);}return null;};}function patchUpdates(_0x143a0a){return function(_0xeff8f1){try{jsonpatch['apply'](_0xeff8f1,_0x143a0a,!![]);}catch(_0x37d919){return BPromise[_0xe184('0x34')](_0x37d919);}return _0xeff8f1[_0xe184('0x35')]();};}function saveUpdates(_0x30a131,_0x4572c4){return function(_0x49566d){if(_0x49566d){return _0x49566d[_0xe184('0x36')](_0x30a131)[_0xe184('0x20')](function(_0x40892f){return _0x40892f;});}return null;};}function removeEntity(_0x1176a3,_0x585e64){return function(_0x59cf68){if(_0x59cf68){return _0x59cf68[_0xe184('0x37')]()[_0xe184('0x20')](function(){var _0x51deaa=_0x59cf68[_0xe184('0x38')]({'plain':!![]});var _0x52c1b4=_0xe184('0x39');return db[_0xe184('0x3a')][_0xe184('0x37')]({'where':{'type':_0x52c1b4,'resourceId':_0x51deaa['id']}})[_0xe184('0x20')](function(){return _0x59cf68;});})[_0xe184('0x20')](function(){_0x1176a3[_0xe184('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a48b5,_0x4e01c5){return function(_0x4a17a3){if(!_0x4a17a3){_0x4a48b5[_0xe184('0x2b')](0x194);}return _0x4a17a3;};}function handleError(_0x4647e9,_0x2d67c6){_0x2d67c6=_0x2d67c6||0x1f4;return function(_0x5cd84d){logger['error'](_0x5cd84d[_0xe184('0x3b')]);if(_0x5cd84d[_0xe184('0x3c')]){delete _0x5cd84d[_0xe184('0x3c')];}_0x4647e9[_0xe184('0x2c')](_0x2d67c6)[_0xe184('0x3d')](_0x5cd84d);};}exports[_0xe184('0x3e')]=function(_0x135ac0,_0x6bbd2c){var _0x5f45d1={'include':[{'model':db[_0xe184('0x3f')],'as':_0xe184('0x40')}]},_0x5e3c7e={},_0x5d9792={'count':0x0,'rows':[]};var _0x3bf7fa=_['map'](db['OpenchannelAccount'][_0xe184('0x41')],function(_0x50765c){return{'name':_0x50765c[_0xe184('0x42')],'type':_0x50765c['type'][_0xe184('0x43')]};});_0x5e3c7e['model']=_[_0xe184('0x44')](_0x3bf7fa,'name');_0x5e3c7e[_0xe184('0x45')]=_['keys'](_0x135ac0['query']);_0x5e3c7e[_0xe184('0x46')]=_[_0xe184('0x47')](_0x5e3c7e[_0xe184('0x48')],_0x5e3c7e[_0xe184('0x45')]);_0x5f45d1[_0xe184('0x49')]=_[_0xe184('0x47')](_0x5e3c7e[_0xe184('0x48')],qs[_0xe184('0x4a')](_0x135ac0[_0xe184('0x45')][_0xe184('0x4a')]));_0x5f45d1['attributes']=_0x5f45d1[_0xe184('0x49')][_0xe184('0x4b')]?_0x5f45d1[_0xe184('0x49')]:_0x5e3c7e['model'];if(!_0x135ac0[_0xe184('0x45')][_0xe184('0x4c')](_0xe184('0x4d'))){_0x5f45d1[_0xe184('0x31')]=qs[_0xe184('0x31')](_0x135ac0['query'][_0xe184('0x31')]);_0x5f45d1[_0xe184('0x2f')]=qs['offset'](_0x135ac0[_0xe184('0x45')]['offset']);}_0x5f45d1[_0xe184('0x4e')]=qs[_0xe184('0x4f')](_0x135ac0[_0xe184('0x45')]['sort']);_0x5f45d1[_0xe184('0x50')]=qs[_0xe184('0x46')](_['pick'](_0x135ac0['query'],_0x5e3c7e[_0xe184('0x46')]),_0x3bf7fa);if(_0x135ac0[_0xe184('0x45')][_0xe184('0x51')]){_0x5f45d1[_0xe184('0x50')]=_[_0xe184('0x52')](_0x5f45d1['where'],{'$or':_[_0xe184('0x44')](_0x3bf7fa,function(_0x2255ba){if(_0x2255ba['type']!==_0xe184('0x53')){var _0x30e132={};_0x30e132[_0x2255ba[_0xe184('0x3c')]]={'$like':'%'+_0x135ac0['query']['filter']+'%'};return _0x30e132;}})});}_0x5f45d1=_[_0xe184('0x52')]({},_0x5f45d1,_0x135ac0[_0xe184('0x54')]);var _0x4bac70={'where':_0x5f45d1['where']};return db[_0xe184('0x55')][_0xe184('0x32')](_0x4bac70)[_0xe184('0x20')](function(_0xd680b2){_0x5d9792[_0xe184('0x32')]=_0xd680b2;if(_0x135ac0[_0xe184('0x45')]['includeAll']){_0x5f45d1['include']=[{'all':!![]}];}return db[_0xe184('0x55')][_0xe184('0x56')](_0x5f45d1);})[_0xe184('0x20')](function(_0x3c4611){_0x5d9792[_0xe184('0x57')]=_0x3c4611;return _0x5d9792;})[_0xe184('0x20')](respondWithFilteredResult(_0x6bbd2c,_0x5f45d1))['catch'](handleError(_0x6bbd2c,null));};exports[_0xe184('0x58')]=function(_0x5ab1e1,_0x18db7f){var _0x34db94={'raw':![],'where':{'id':_0x5ab1e1['params']['id']},'include':[{'model':db['Pause'],'as':_0xe184('0x40')}]},_0x49cc3e={};_0x49cc3e[_0xe184('0x48')]=_[_0xe184('0x59')](db[_0xe184('0x55')]['rawAttributes']);_0x49cc3e[_0xe184('0x45')]=_[_0xe184('0x59')](_0x5ab1e1['query']);_0x49cc3e['filters']=_[_0xe184('0x47')](_0x49cc3e[_0xe184('0x48')],_0x49cc3e[_0xe184('0x45')]);_0x34db94['attributes']=_[_0xe184('0x47')](_0x49cc3e[_0xe184('0x48')],qs[_0xe184('0x4a')](_0x5ab1e1[_0xe184('0x45')][_0xe184('0x4a')]));_0x34db94[_0xe184('0x49')]=_0x34db94[_0xe184('0x49')][_0xe184('0x4b')]?_0x34db94[_0xe184('0x49')]:_0x49cc3e['model'];if(_0x5ab1e1['query']['includeAll']){_0x34db94[_0xe184('0x5a')]=[{'all':!![]}];}_0x34db94=_[_0xe184('0x52')]({},_0x34db94,_0x5ab1e1[_0xe184('0x54')]);return db['OpenchannelAccount'][_0xe184('0x5b')](_0x34db94)['then'](handleEntityNotFound(_0x18db7f,null))[_0xe184('0x20')](respondWithResult(_0x18db7f,null))['catch'](handleError(_0x18db7f,null));};exports[_0xe184('0x5c')]=function(_0x26a183,_0x57cc99){return db[_0xe184('0x55')][_0xe184('0x5c')](_0x26a183[_0xe184('0x5d')],{})[_0xe184('0x20')](function(_0x57a36e){var _0x15a7e6=_0x26a183['user']['get']({'plain':!![]});if(!_0x15a7e6)throw new Error(_0xe184('0x5e'));if(_0x15a7e6['role']===_0xe184('0x5f')){var _0x5603ed=_0x57a36e[_0xe184('0x38')]({'plain':!![]});var _0x163ffa=_0xe184('0x39');return db[_0xe184('0x60')]['find']({'where':{'name':_0x163ffa,'userProfileId':_0x15a7e6[_0xe184('0x61')]},'raw':!![]})[_0xe184('0x20')](function(_0x4754dd){if(_0x4754dd&&_0x4754dd[_0xe184('0x62')]===0x0){return db['UserProfileResource'][_0xe184('0x5c')]({'name':_0x5603ed[_0xe184('0x3c')],'resourceId':_0x5603ed['id'],'type':_0x4754dd[_0xe184('0x3c')],'sectionId':_0x4754dd['id']},{})[_0xe184('0x20')](function(){return _0x57a36e;});}else{return _0x57a36e;}})[_0xe184('0x2a')](function(_0x505e09){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x505e09);throw _0x505e09;});}return _0x57a36e;})[_0xe184('0x20')](respondWithResult(_0x57cc99,0xc9))[_0xe184('0x2a')](handleError(_0x57cc99,null));};exports[_0xe184('0x36')]=function(_0x8aa548,_0x236381){if(_0x8aa548[_0xe184('0x5d')]['id']){delete _0x8aa548[_0xe184('0x5d')]['id'];}return db[_0xe184('0x55')][_0xe184('0x5b')]({'where':{'id':_0x8aa548[_0xe184('0x63')]['id']},'include':[{'model':db[_0xe184('0x3f')],'as':_0xe184('0x40')}]})[_0xe184('0x20')](handleEntityNotFound(_0x236381,null))[_0xe184('0x20')](saveUpdates(_0x8aa548[_0xe184('0x5d')],null))[_0xe184('0x20')](respondWithResult(_0x236381,null))['catch'](handleError(_0x236381,null));};exports['destroy']=function(_0x31acd1,_0xfe1a94){return db[_0xe184('0x55')][_0xe184('0x5b')]({'where':{'id':_0x31acd1[_0xe184('0x63')]['id']}})[_0xe184('0x20')](handleEntityNotFound(_0xfe1a94,null))[_0xe184('0x20')](removeEntity(_0xfe1a94,null))[_0xe184('0x2a')](handleError(_0xfe1a94,null));};exports[_0xe184('0x64')]=function(_0x43926a,_0x5a48ce){return db['OpenchannelAccount'][_0xe184('0x64')]()[_0xe184('0x20')](respondWithResult(_0x5a48ce,null))['catch'](handleError(_0x5a48ce,null));};exports['addDisposition']=function(_0x1446d9,_0x1fb95b,_0x266175){if(_0x1446d9[_0xe184('0x5d')]['id']){delete _0x1446d9[_0xe184('0x5d')]['id'];}return db[_0xe184('0x55')][_0xe184('0x5b')]({'where':{'id':_0x1446d9[_0xe184('0x63')]['id']}})['then'](handleEntityNotFound(_0x1fb95b,null))[_0xe184('0x20')](function(_0x4b4717){if(_0x4b4717){_0x1446d9['body']['OpenchannelAccountId']=_0x4b4717['id'];return db[_0xe184('0x65')][_0xe184('0x5c')](_0x1446d9['body']);}})[_0xe184('0x20')](respondWithResult(_0x1fb95b,null))[_0xe184('0x2a')](handleError(_0x1fb95b,null));};exports[_0xe184('0x66')]=function(_0x5ea563,_0x2f5d07,_0x4fa7de){var _0xaa3728={'raw':![],'where':{}};var _0x55560c={};var _0x59e641={'count':0x0,'rows':[]};return db[_0xe184('0x55')]['findOne']({'where':{'id':_0x5ea563[_0xe184('0x63')]['id']}})[_0xe184('0x20')](handleEntityNotFound(_0x2f5d07,null))[_0xe184('0x20')](function(_0x37125e){if(_0x37125e){_0x55560c[_0xe184('0x48')]=_['keys'](db[_0xe184('0x65')][_0xe184('0x41')]);_0x55560c[_0xe184('0x45')]=_[_0xe184('0x59')](_0x5ea563[_0xe184('0x45')]);_0x55560c[_0xe184('0x46')]=_[_0xe184('0x47')](_0x55560c[_0xe184('0x48')],_0x55560c[_0xe184('0x45')]);_0xaa3728[_0xe184('0x49')]=_[_0xe184('0x47')](_0x55560c[_0xe184('0x48')],qs[_0xe184('0x4a')](_0x5ea563[_0xe184('0x45')][_0xe184('0x4a')]));_0xaa3728[_0xe184('0x49')]=_0xaa3728[_0xe184('0x49')][_0xe184('0x4b')]?_0xaa3728[_0xe184('0x49')]:_0x55560c[_0xe184('0x48')];if(!_0x5ea563[_0xe184('0x45')][_0xe184('0x4c')](_0xe184('0x4d'))){_0xaa3728[_0xe184('0x31')]=qs[_0xe184('0x31')](_0x5ea563[_0xe184('0x45')][_0xe184('0x31')]);_0xaa3728[_0xe184('0x2f')]=qs['offset'](_0x5ea563[_0xe184('0x45')][_0xe184('0x2f')]);}_0xaa3728[_0xe184('0x4e')]=qs[_0xe184('0x4f')](_0x5ea563[_0xe184('0x45')][_0xe184('0x4f')]);_0xaa3728[_0xe184('0x50')]=qs['filters'](_[_0xe184('0x67')](_0x5ea563[_0xe184('0x45')],_0x55560c[_0xe184('0x46')]));_0xaa3728['where']['OpenchannelAccountId']=_0x37125e['id'];if(_0x5ea563[_0xe184('0x45')][_0xe184('0x51')]){_0xaa3728['where']=_['merge'](_0xaa3728[_0xe184('0x50')],{'$or':_['map'](_0xaa3728[_0xe184('0x49')],function(_0x576971){var _0x6552fd={};_0x6552fd[_0x576971]={'$like':'%'+_0x5ea563[_0xe184('0x45')][_0xe184('0x51')]+'%'};return _0x6552fd;})});}_0xaa3728=_[_0xe184('0x52')]({},_0xaa3728,_0x5ea563['options']);return db[_0xe184('0x65')]['count']({'where':_0xaa3728[_0xe184('0x50')]})['then'](function(_0x4fcb4a){_0x59e641[_0xe184('0x32')]=_0x4fcb4a;if(_0x5ea563[_0xe184('0x45')][_0xe184('0x68')]){_0xaa3728[_0xe184('0x5a')]=[{'all':!![]}];}return db[_0xe184('0x65')][_0xe184('0x56')](_0xaa3728);})['then'](function(_0x2a1f2f){_0x59e641[_0xe184('0x57')]=_0x2a1f2f;return _0x59e641;});}})['then'](respondWithFilteredResult(_0x2f5d07,_0xaa3728))[_0xe184('0x2a')](handleError(_0x2f5d07,null));};exports[_0xe184('0x69')]=function(_0x26f2ec,_0x1e1b69,_0x4e1081){return db[_0xe184('0x55')][_0xe184('0x5b')]({'where':{'id':_0x26f2ec[_0xe184('0x63')]['id']}})[_0xe184('0x20')](handleEntityNotFound(_0x1e1b69,null))[_0xe184('0x20')](function(_0x4aceac){if(_0x4aceac){return _0x4aceac['removeDispositions'](_0x26f2ec[_0xe184('0x45')]['ids']);}})[_0xe184('0x20')](respondWithStatusCode(_0x1e1b69,null))[_0xe184('0x2a')](handleError(_0x1e1b69,null));};exports[_0xe184('0x6a')]=function(_0xbac8e8,_0x548260,_0x423d78){if(_0xbac8e8[_0xe184('0x5d')]['id']){delete _0xbac8e8[_0xe184('0x5d')]['id'];}return db[_0xe184('0x55')][_0xe184('0x5b')]({'where':{'id':_0xbac8e8['params']['id']}})['then'](handleEntityNotFound(_0x548260,null))['then'](function(_0x1c24f1){if(_0x1c24f1){_0xbac8e8[_0xe184('0x5d')][_0xe184('0x6b')]=_0x1c24f1['id'];return db[_0xe184('0x6c')]['create'](_0xbac8e8[_0xe184('0x5d')]);}})[_0xe184('0x20')](respondWithResult(_0x548260,null))[_0xe184('0x2a')](handleError(_0x548260,null));};exports[_0xe184('0x6d')]=function(_0x4cccfb,_0x247c0c,_0x1395cd){var _0x4ba36e={'raw':![],'where':{}};var _0x4dc980={};var _0x19c30a={'count':0x0,'rows':[]};return db[_0xe184('0x55')][_0xe184('0x6e')]({'where':{'id':_0x4cccfb['params']['id']}})[_0xe184('0x20')](handleEntityNotFound(_0x247c0c,null))['then'](function(_0x1867e9){if(_0x1867e9){_0x4dc980[_0xe184('0x48')]=_['keys'](db[_0xe184('0x6c')][_0xe184('0x41')]);_0x4dc980[_0xe184('0x45')]=_[_0xe184('0x59')](_0x4cccfb['query']);_0x4dc980['filters']=_[_0xe184('0x47')](_0x4dc980[_0xe184('0x48')],_0x4dc980['query']);_0x4ba36e[_0xe184('0x49')]=_[_0xe184('0x47')](_0x4dc980['model'],qs[_0xe184('0x4a')](_0x4cccfb[_0xe184('0x45')][_0xe184('0x4a')]));_0x4ba36e[_0xe184('0x49')]=_0x4ba36e[_0xe184('0x49')][_0xe184('0x4b')]?_0x4ba36e[_0xe184('0x49')]:_0x4dc980['model'];if(!_0x4cccfb[_0xe184('0x45')][_0xe184('0x4c')]('nolimit')){_0x4ba36e[_0xe184('0x31')]=qs[_0xe184('0x31')](_0x4cccfb[_0xe184('0x45')][_0xe184('0x31')]);_0x4ba36e['offset']=qs['offset'](_0x4cccfb[_0xe184('0x45')][_0xe184('0x2f')]);}_0x4ba36e[_0xe184('0x4e')]=qs[_0xe184('0x4f')](_0x4cccfb[_0xe184('0x45')][_0xe184('0x4f')]);_0x4ba36e[_0xe184('0x50')]=qs[_0xe184('0x46')](_[_0xe184('0x67')](_0x4cccfb[_0xe184('0x45')],_0x4dc980[_0xe184('0x46')]));_0x4ba36e[_0xe184('0x50')][_0xe184('0x6b')]=_0x1867e9['id'];if(_0x4cccfb['query'][_0xe184('0x51')]){_0x4ba36e['where']=_[_0xe184('0x52')](_0x4ba36e[_0xe184('0x50')],{'$or':_[_0xe184('0x44')](_0x4ba36e['attributes'],function(_0x214b75){var _0x164d53={};_0x164d53[_0x214b75]={'$like':'%'+_0x4cccfb[_0xe184('0x45')][_0xe184('0x51')]+'%'};return _0x164d53;})});}_0x4ba36e=_[_0xe184('0x52')]({},_0x4ba36e,_0x4cccfb['options']);return db[_0xe184('0x6c')]['count']({'where':_0x4ba36e[_0xe184('0x50')]})[_0xe184('0x20')](function(_0x396688){_0x19c30a[_0xe184('0x32')]=_0x396688;if(_0x4cccfb[_0xe184('0x45')][_0xe184('0x68')]){_0x4ba36e[_0xe184('0x5a')]=[{'all':!![]}];}return db[_0xe184('0x6c')][_0xe184('0x56')](_0x4ba36e);})[_0xe184('0x20')](function(_0x3439c0){_0x19c30a['rows']=_0x3439c0;return _0x19c30a;});}})['then'](respondWithFilteredResult(_0x247c0c,_0x4ba36e))[_0xe184('0x2a')](handleError(_0x247c0c,null));};exports['removeAnswers']=function(_0x38171e,_0x1a961d,_0x42dee2){return db['OpenchannelAccount']['find']({'where':{'id':_0x38171e[_0xe184('0x63')]['id']}})[_0xe184('0x20')](handleEntityNotFound(_0x1a961d,null))['then'](function(_0x18490a){if(_0x18490a){return _0x18490a['removeAnswers'](_0x38171e[_0xe184('0x45')]['ids']);}})[_0xe184('0x20')](respondWithStatusCode(_0x1a961d,null))[_0xe184('0x2a')](handleError(_0x1a961d,null));};exports[_0xe184('0x6f')]=function(_0x378a29,_0x104afe,_0x3b0441){var _0x39da61={'body':_0x378a29[_0xe184('0x5d')],'channel':'openchannel'};var _0x55fd87=[];var _0x5e7b9f=[];var _0x2b0e9e={};var _0xd81517=![];return db[_0xe184('0x70')][_0xe184('0x64')]()['then'](function(_0x367f0e){if(!_0x367f0e){throw new db['Sequelize']['ValidationError'](_0xe184('0x71'));}_0x55fd87=_[_0xe184('0x72')](_[_0xe184('0x59')](_0x367f0e),[_0xe184('0x73'),_0xe184('0x74')]);_0x5e7b9f=_[_0xe184('0x72')](_[_0xe184('0x59')](_0x367f0e),[_0xe184('0x73'),'updatedAt',_0xe184('0x75'),'ListId']);if(_0x378a29[_0xe184('0x5d')]['id']){delete _0x378a29[_0xe184('0x5d')]['id'];}if(_[_0xe184('0x76')](_0x378a29['body']['from'])){throw new db['Sequelize'][(_0xe184('0x77'))](_0xe184('0x78'));}if(_[_0xe184('0x76')](_0x378a29['body'][_0xe184('0x5d')])||_0x378a29['body'][_0xe184('0x5d')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe184('0x76')](_0x378a29[_0xe184('0x5d')][_0xe184('0x79')])){throw new db[(_0xe184('0x7a'))]['ValidationError'](_0xe184('0x7b')+_0x5e7b9f);}if(!_[_0xe184('0x7c')](_0x5e7b9f,_0x378a29['body']['mapKey'])){throw new db[(_0xe184('0x7a'))][(_0xe184('0x77'))](_0xe184('0x7d')+_0x5e7b9f);}_0x2b0e9e[_0x378a29[_0xe184('0x5d')][_0xe184('0x79')]]=_0x378a29[_0xe184('0x5d')][_0xe184('0x7e')];})[_0xe184('0x20')](function(){return db[_0xe184('0x55')][_0xe184('0x5b')]({'where':{'id':_0x378a29[_0xe184('0x63')]['id']},'include':[{'model':db['CmList'],'as':_0xe184('0x7f'),'include':[{'model':db[_0xe184('0x70')],'as':'Contacts','where':_0x2b0e9e,'limit':0x1,'order':[[_0xe184('0x74'),'DESC']]}]},{'model':db[_0xe184('0x80')],'as':'Applications'}]});})[_0xe184('0x20')](handleEntityNotFound(_0x104afe,null))[_0xe184('0x20')](function(_0x4ed915){if(_0x4ed915&&_0x4ed915[_0xe184('0x7f')]){_0x39da61[_0xe184('0x81')]=_0x4ed915;_0x39da61[_0xe184('0x82')]=_0x4ed915[_0xe184('0x83')];_0x39da61[_0xe184('0x84')]=_0x4ed915[_0xe184('0x7f')];_0x39da61[_0xe184('0x82')]=_['orderBy'](_0x39da61[_0xe184('0x82')],[_0xe184('0x85')],[_0xe184('0x86')]);if(_0x39da61['account'][_0xe184('0x83')]){delete _0x39da61['account']['Applications'];}if(_0x39da61[_0xe184('0x81')][_0xe184('0x7f')]&&_0x39da61[_0xe184('0x81')][_0xe184('0x7f')][_0xe184('0x87')][_0xe184('0x4b')]){return _0x39da61[_0xe184('0x81')]['List'][_0xe184('0x87')][0x0];}var _0x7ee93b=_['defaults'](_0x378a29['body'],{'firstName':_0x378a29[_0xe184('0x5d')][_0xe184('0x7e')],'ListId':_0x4ed915[_0xe184('0x88')]});_0x7ee93b[_0x378a29[_0xe184('0x5d')][_0xe184('0x79')]]=_0x378a29[_0xe184('0x5d')][_0xe184('0x7e')];return db[_0xe184('0x70')][_0xe184('0x5c')](_0x7ee93b,{'fields':_0x55fd87,'raw':!![]});}})[_0xe184('0x20')](handleEntityNotFound(_0x104afe,null))[_0xe184('0x20')](function(_0x8542f9){_0x39da61['contact']=_0x8542f9;if(_0x8542f9){var _0x5e0ab9={'ContactId':_0x8542f9['id'],'OpenchannelAccountId':_0x378a29[_0xe184('0x63')]['id'],'from':(_0x8542f9['firstName']||'')+'\x20'+(_0x8542f9[_0xe184('0x89')]||'')};var _0x4e66df={'OpenchannelAccountId':_0x378a29[_0xe184('0x63')]['id'],'closed':![]};if(_0x378a29[_0xe184('0x5d')][_0xe184('0x8a')]){_0x4e66df[_0xe184('0x8a')]=_0x378a29[_0xe184('0x5d')]['threadId'];return db[_0xe184('0x8b')][_0xe184('0x5b')]({'where':_0x4e66df})['then'](function(_0x24376a){if(_0x24376a){return[_0x24376a,![]];}_0x5e0ab9[_0xe184('0x8a')]=_0x378a29['body']['threadId'];_0x5e0ab9['externalUrl']=_0x378a29[_0xe184('0x5d')][_0xe184('0x8c')];return db['OpenchannelInteraction'][_0xe184('0x5c')](_0x5e0ab9)[_0xe184('0x20')](function(_0x50037e){return[_0x50037e,!![]];});});}else{_0x4e66df['threadId']=null;}_0x4e66df[_0xe184('0x8d')]=_0x8542f9['id'];return db[_0xe184('0x8b')][_0xe184('0x5b')]({'where':_0x4e66df})[_0xe184('0x20')](function(_0x3ec8e6){if(_0x3ec8e6){return[_0x3ec8e6,![]];}return db[_0xe184('0x8b')]['create'](_0x5e0ab9)[_0xe184('0x20')](function(_0x486aa8){return[_0x486aa8,!![]];});});}})[_0xe184('0x8e')](function(_0x344561,_0x197e08){if(_0x344561){_0xd81517=_0x197e08;if(!_0x197e08){var _0x30781d={'from':(_0x39da61[_0xe184('0x8f')][_0xe184('0x90')]||'')+'\x20'+(_0x39da61[_0xe184('0x8f')]['lastName']||'')};if(_0x378a29[_0xe184('0x5d')]['threadId']&&_0x378a29[_0xe184('0x5d')][_0xe184('0x91')]&&_0x378a29[_0xe184('0x5d')]['threadId']!=_0x378a29['body'][_0xe184('0x91')]){_0x30781d[_0xe184('0x8a')]=_0x378a29[_0xe184('0x5d')]['messageId'];}return _0x344561['update'](_0x30781d);}else{return _0x344561;}}})[_0xe184('0x20')](function(_0xcd3ea7){_0x39da61[_0xe184('0x92')]=_0xcd3ea7[_0xe184('0x38')]({'plain':!![]});_0x39da61['interaction'][_0xe184('0x93')]=_0xd81517;if(_0x39da61['interaction']['created']){if(_0x39da61[_0xe184('0x81')]['autoclose']){_0x39da61['applications'][_0xe184('0x94')]({'id':0x0,'priority':_0x39da61[_0xe184('0x82')][_0xe184('0x4b')]+0x1,'app':_0xe184('0x95'),'appdata':_0xe184('0x96'),'interval':_0xe184('0x97')});}}return db['OpenchannelMessage'][_0xe184('0x5c')]({'body':_0x378a29[_0xe184('0x5d')][_0xe184('0x5d')],'OpenchannelAccountId':_0x378a29[_0xe184('0x63')]['id'],'OpenchannelInteractionId':_0xcd3ea7['id'],'direction':'in','ContactId':_0x39da61['contact']['id'],'AttachmentId':_0x378a29[_0xe184('0x5d')][_0xe184('0x98')]});})['then'](function(_0x129586){_0x39da61[_0xe184('0x29')]=_0x129586;if(!_0x39da61[_0xe184('0x92')]['UserId'])return;return db[_0xe184('0x99')][_0xe184('0x5b')]({'attributes':['id',_0xe184('0x3c')],'where':{'id':_0x39da61[_0xe184('0x92')][_0xe184('0x9a')]}});})['then'](function(_0x423587){if(_0x423587){_0x39da61['applications'][_0xe184('0x9b')]({'id':0x0,'priority':0x0,'app':_0xe184('0x9c'),'appdata':_0x423587[_0xe184('0x3c')]+','+(_0x39da61[_0xe184('0x81')][_0xe184('0x9d')]||0xa),'interval':_0xe184('0x97')});}if(!_0x39da61[_0xe184('0x92')][_0xe184('0x9e')])return;return db[_0xe184('0x9f')][_0xe184('0x5b')]({'attributes':['id',_0xe184('0x3c')],'where':{'id':_0x39da61[_0xe184('0x92')][_0xe184('0x9e')]}});})['then'](function(_0x5299bd){if(_0x5299bd){_0x39da61['applications'][_0xe184('0x9b')]({'id':0x0,'priority':0x1,'app':_0xe184('0xa0'),'appdata':_0x5299bd[_0xe184('0x3c')]+','+(_0x39da61[_0xe184('0x81')][_0xe184('0xa1')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xe184('0xa2'),_0xe184('0xa3'),_0x39da61);})['then'](function(_0x2795a4){respondWithRpcPromise(_0xe184('0xa4'),_0xe184('0xa4'),{'event':_0xe184('0x6f'),'message':_0x2795a4},client9002);return _0x2795a4;})[_0xe184('0x20')](respondWithResult(_0x104afe,null))[_0xe184('0x2a')](handleError(_0x104afe,null));};exports[_0xe184('0xa5')]=function(_0x32560d,_0x2125af){var _0x22407a=_0x32560d[_0xe184('0x63')]['id'];var _0x106431=_0x32560d[_0xe184('0x5d')];var _0x463e6d=0xc8;var _0x7687d5=null;return db[_0xe184('0xa6')][_0xe184('0xa7')]({'isolationLevel':db[_0xe184('0xa6')][_0xe184('0xa8')][_0xe184('0xa9')][_0xe184('0xaa')]},function(_0x229da9){return db['OpenchannelAccount'][_0xe184('0x6e')]({'where':{'id':_0x22407a},'transaction':_0x229da9})[_0xe184('0x20')](function(_0x315249){if(_0x315249){return db[_0xe184('0x80')][_0xe184('0x37')]({'where':{'OpenchannelAccountId':_0x22407a},'transaction':_0x229da9})[_0xe184('0x20')](function(){var _0x319f7d=_['map'](_0x106431,function(_0x32b842){_0x32b842[_0xe184('0x6b')]=_0x22407a;return _0x32b842;});return db['OpenchannelApplication'][_0xe184('0xab')](_0x319f7d,{'transaction':_0x229da9});});}else{_0x463e6d=0x194;_0x7687d5=[];}});})[_0xe184('0x20')](function(){if(_0x463e6d!==0x194){return db[_0xe184('0x80')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x22407a},'order':_0xe184('0x85')})[_0xe184('0x20')](function(_0x224ebf){_0x7687d5=_0x224ebf;});}})[_0xe184('0x2a')](function(_0x261bbe){_0x463e6d=0x1f4;logger[_0xe184('0x28')](_0x261bbe[_0xe184('0x3b')]);if(_0x261bbe['name']){delete _0x261bbe[_0xe184('0x3c')];}_0x7687d5=_0x261bbe;})[_0xe184('0xac')](function(){if(_0x7687d5===null){_0x2125af['sendStatus'](_0x463e6d);}else{if(_0x463e6d===0x1f4){_0x2125af[_0xe184('0x2c')](_0x463e6d)[_0xe184('0x3d')](_0x7687d5);}else{_0x2125af[_0xe184('0x2c')](_0x463e6d)[_0xe184('0x2e')](_0x7687d5);}}});};exports[_0xe184('0xad')]=function(_0x261cfc,_0x18b620,_0x4d188e){var _0x518ca0={};var _0x1dad43={};var _0x50586b;var _0x3348b2;return db[_0xe184('0x55')][_0xe184('0x6e')]({'where':{'id':_0x261cfc[_0xe184('0x63')]['id']}})['then'](handleEntityNotFound(_0x18b620,null))[_0xe184('0x20')](function(_0x55af94){if(_0x55af94){_0x50586b=_0x55af94;_0x1dad43[_0xe184('0x48')]=_[_0xe184('0x59')](db[_0xe184('0x80')][_0xe184('0x41')]);_0x1dad43[_0xe184('0x45')]=_[_0xe184('0x59')](_0x261cfc[_0xe184('0x45')]);_0x1dad43[_0xe184('0x46')]=_[_0xe184('0x47')](_0x1dad43[_0xe184('0x48')],_0x1dad43['query']);_0x518ca0[_0xe184('0x49')]=_[_0xe184('0x47')](_0x1dad43[_0xe184('0x48')],qs[_0xe184('0x4a')](_0x261cfc[_0xe184('0x45')]['fields']));_0x518ca0[_0xe184('0x49')]=_0x518ca0[_0xe184('0x49')][_0xe184('0x4b')]?_0x518ca0['attributes']:_0x1dad43[_0xe184('0x48')];_0x518ca0[_0xe184('0x4e')]=qs[_0xe184('0x4f')](_0x261cfc[_0xe184('0x45')][_0xe184('0x4f')]);_0x518ca0[_0xe184('0x50')]=qs['filters'](_[_0xe184('0x67')](_0x261cfc[_0xe184('0x45')],_0x1dad43[_0xe184('0x46')]));if(_0x261cfc[_0xe184('0x45')][_0xe184('0x51')]){_0x518ca0[_0xe184('0x50')]=_[_0xe184('0x52')](_0x518ca0[_0xe184('0x50')],{'$or':_[_0xe184('0x44')](_0x518ca0['attributes'],function(_0x135cf6){var _0x1b3ce1={};_0x1b3ce1[_0x135cf6]={'$like':'%'+_0x261cfc['query']['filter']+'%'};return _0x1b3ce1;})});}_0x518ca0=_[_0xe184('0x52')]({},_0x518ca0,_0x261cfc[_0xe184('0x54')]);return _0x50586b[_0xe184('0xad')](_0x518ca0);}})[_0xe184('0x20')](function(_0x146c59){if(_0x146c59){_0x3348b2=_0x146c59[_0xe184('0x4b')];if(!_0x261cfc[_0xe184('0x45')][_0xe184('0x4c')](_0xe184('0x4d'))){_0x518ca0[_0xe184('0x31')]=qs[_0xe184('0x31')](_0x261cfc[_0xe184('0x45')][_0xe184('0x31')]);_0x518ca0['offset']=qs[_0xe184('0x2f')](_0x261cfc[_0xe184('0x45')]['offset']);}return _0x50586b[_0xe184('0xad')](_0x518ca0);}})[_0xe184('0x20')](function(_0x450982){if(_0x450982){return _0x450982?{'count':_0x3348b2,'rows':_0x450982}:null;}})[_0xe184('0x20')](respondWithResult(_0x18b620,null))[_0xe184('0x2a')](handleError(_0x18b620,null));};exports[_0xe184('0xae')]=function(_0x1ae4b3,_0x55a115,_0x4a761c){var _0x159e99={'raw':![],'where':{}};var _0x55ff3d={};var _0x1cea0d={'count':0x0,'rows':[]};return db[_0xe184('0x55')][_0xe184('0x6e')]({'where':{'id':_0x1ae4b3['params']['id']}})[_0xe184('0x20')](handleEntityNotFound(_0x55a115,null))['then'](function(_0x35e7e4){if(_0x35e7e4){_0x55ff3d['model']=_[_0xe184('0x59')](db[_0xe184('0x8b')][_0xe184('0x41')]);_0x55ff3d[_0xe184('0x45')]=_[_0xe184('0x59')](_0x1ae4b3[_0xe184('0x45')]);_0x55ff3d[_0xe184('0x46')]=_[_0xe184('0x47')](_0x55ff3d[_0xe184('0x48')],_0x55ff3d[_0xe184('0x45')]);_0x159e99['attributes']=_[_0xe184('0x47')](_0x55ff3d[_0xe184('0x48')],qs[_0xe184('0x4a')](_0x1ae4b3[_0xe184('0x45')][_0xe184('0x4a')]));_0x159e99[_0xe184('0x49')]=_0x159e99[_0xe184('0x49')][_0xe184('0x4b')]?_0x159e99['attributes']:_0x55ff3d[_0xe184('0x48')];if(!_0x1ae4b3[_0xe184('0x45')][_0xe184('0x4c')]('nolimit')){_0x159e99[_0xe184('0x31')]=qs[_0xe184('0x31')](_0x1ae4b3[_0xe184('0x45')][_0xe184('0x31')]);_0x159e99['offset']=qs[_0xe184('0x2f')](_0x1ae4b3['query'][_0xe184('0x2f')]);}_0x159e99[_0xe184('0x4e')]=qs[_0xe184('0x4f')](_0x1ae4b3[_0xe184('0x45')]['sort']);_0x159e99[_0xe184('0x50')]=qs[_0xe184('0x46')](_['pick'](_0x1ae4b3['query'],_0x55ff3d[_0xe184('0x46')]));_0x159e99[_0xe184('0x50')][_0xe184('0x6b')]=_0x35e7e4['id'];if(_0x1ae4b3[_0xe184('0x45')][_0xe184('0x51')]){_0x159e99[_0xe184('0x50')]=_[_0xe184('0x52')](_0x159e99[_0xe184('0x50')],{'$or':_['map'](_0x159e99[_0xe184('0x49')],function(_0x8069bb){var _0xdfae41={};_0xdfae41[_0x8069bb]={'$like':'%'+_0x1ae4b3[_0xe184('0x45')][_0xe184('0x51')]+'%'};return _0xdfae41;})});}_0x159e99=_[_0xe184('0x52')]({},_0x159e99,_0x1ae4b3['options']);return db[_0xe184('0x8b')][_0xe184('0x32')]({'where':_0x159e99[_0xe184('0x50')]})[_0xe184('0x20')](function(_0x34793d){_0x1cea0d[_0xe184('0x32')]=_0x34793d;if(_0x1ae4b3[_0xe184('0x45')]['includeAll']){_0x159e99['include']=[{'model':db['CmContact'],'as':_0xe184('0xaf'),'required':![]},{'model':db[_0xe184('0x99')],'as':_0xe184('0xb0'),'attributes':[_0xe184('0x3c'),'fullname',_0xe184('0xb1')],'required':![]},{'model':db[_0xe184('0xb2')],'as':_0xe184('0xb3'),'attributes':['id',_0xe184('0x3c'),_0xe184('0xb4')],'where':_0x1ae4b3[_0xe184('0x45')][_0xe184('0xb5')]?{'id':_0x1ae4b3[_0xe184('0x45')][_0xe184('0xb5')]}:undefined,'required':_0x1ae4b3[_0xe184('0x45')]['tag']?!![]:![]}];}return db[_0xe184('0x8b')][_0xe184('0x56')](_0x159e99);})[_0xe184('0x20')](function(_0x272b17){_0x1cea0d[_0xe184('0x57')]=_0x272b17;return _0x1cea0d;});}})[_0xe184('0x20')](respondWithFilteredResult(_0x55a115,_0x159e99))[_0xe184('0x2a')](handleError(_0x55a115,null));};exports[_0xe184('0xb6')]=function(_0x5175dd,_0xe3bb5a,_0x25a4fd){return db[_0xe184('0x55')][_0xe184('0x5b')]({'where':{'id':_0x5175dd[_0xe184('0x63')]['id']}})['then'](handleEntityNotFound(_0xe3bb5a,null))['then'](function(_0x2749f8){if(_0x2749f8){return _0x2749f8['addAgents'](_0x5175dd[_0xe184('0x5d')][_0xe184('0xb7')],_['omit'](_0x5175dd['body'],[_0xe184('0xb7'),'id'])||{})['spread'](function(_0x43fa40){for(var _0x362df2=0x0;_0x362df2<_0x5175dd[_0xe184('0x5d')][_0xe184('0xb7')]['length'];_0x362df2+=0x1){socket[_0xe184('0xb8')]('userOpenchannelAccount:save',{'UserId':Number(_0x5175dd[_0xe184('0x5d')][_0xe184('0xb7')][_0x362df2]),'OpenchannelAccountId':Number(_0x5175dd[_0xe184('0x63')]['id'])});}return _0x43fa40;});}})['then'](respondWithResult(_0xe3bb5a,null))['catch'](handleError(_0xe3bb5a,null));};exports[_0xe184('0xb9')]=function(_0x485671,_0x3361e3,_0x160034){return db[_0xe184('0x55')][_0xe184('0x5b')]({'where':{'id':_0x485671[_0xe184('0x63')]['id']}})[_0xe184('0x20')](handleEntityNotFound(_0x3361e3,null))[_0xe184('0x20')](function(_0xf80418){if(_0xf80418){return _0xf80418[_0xe184('0xb9')](_0x485671[_0xe184('0x45')]['ids'])['then'](function(){if(_[_0xe184('0xba')](_0x485671[_0xe184('0x45')][_0xe184('0xb7')])){for(var _0x5093a3=0x0;_0x5093a3<_0x485671[_0xe184('0x45')]['ids'][_0xe184('0x4b')];_0x5093a3+=0x1){socket[_0xe184('0xb8')](_0xe184('0xbb'),{'UserId':Number(_0x485671['query'][_0xe184('0xb7')][_0x5093a3]),'OpenchannelAccountId':Number(_0x485671[_0xe184('0x63')]['id'])});}}else{socket[_0xe184('0xb8')](_0xe184('0xbb'),{'UserId':Number(_0x485671[_0xe184('0x45')]['ids']),'OpenchannelAccountId':Number(_0x485671['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3361e3,null))[_0xe184('0x2a')](handleError(_0x3361e3,null));};exports[_0xe184('0xbc')]=function(_0x7a7db0,_0x20a8c2,_0x47082b){var _0x4ce21f={};var _0x448727={};var _0x1919c0;var _0x56bd99;return db['OpenchannelAccount'][_0xe184('0x6e')]({'where':{'id':_0x7a7db0[_0xe184('0x63')]['id']}})['then'](handleEntityNotFound(_0x20a8c2,null))[_0xe184('0x20')](function(_0x18c6a0){if(_0x18c6a0){_0x1919c0=_0x18c6a0;_0x448727['model']=_[_0xe184('0x59')](db[_0xe184('0x99')][_0xe184('0x41')]);_0x448727[_0xe184('0x45')]=_[_0xe184('0x59')](_0x7a7db0[_0xe184('0x45')]);_0x448727['filters']=_[_0xe184('0x47')](_0x448727['model'],_0x448727[_0xe184('0x45')]);_0x4ce21f[_0xe184('0x49')]=_[_0xe184('0x47')](_0x448727[_0xe184('0x48')],qs[_0xe184('0x4a')](_0x7a7db0[_0xe184('0x45')][_0xe184('0x4a')]));_0x4ce21f[_0xe184('0x49')]=_0x4ce21f[_0xe184('0x49')][_0xe184('0x4b')]?_0x4ce21f[_0xe184('0x49')]:_0x448727[_0xe184('0x48')];_0x4ce21f[_0xe184('0x4e')]=qs[_0xe184('0x4f')](_0x7a7db0[_0xe184('0x45')][_0xe184('0x4f')]);_0x4ce21f[_0xe184('0x50')]=qs[_0xe184('0x46')](_['pick'](_0x7a7db0[_0xe184('0x45')],_0x448727[_0xe184('0x46')]));if(_0x7a7db0[_0xe184('0x45')]['filter']){_0x4ce21f[_0xe184('0x50')]=_[_0xe184('0x52')](_0x4ce21f[_0xe184('0x50')],{'$or':_[_0xe184('0x44')](_0x4ce21f[_0xe184('0x49')],function(_0x3efac7){var _0x4576eb={};_0x4576eb[_0x3efac7]={'$like':'%'+_0x7a7db0[_0xe184('0x45')][_0xe184('0x51')]+'%'};return _0x4576eb;})});}_0x4ce21f=_[_0xe184('0x52')]({},_0x4ce21f,_0x7a7db0[_0xe184('0x54')]);return _0x1919c0[_0xe184('0xbc')](_0x4ce21f);}})[_0xe184('0x20')](function(_0x3847f9){if(_0x3847f9){_0x56bd99=_0x3847f9[_0xe184('0x4b')];if(!_0x7a7db0['query'][_0xe184('0x4c')](_0xe184('0x4d'))){_0x4ce21f[_0xe184('0x31')]=qs[_0xe184('0x31')](_0x7a7db0[_0xe184('0x45')][_0xe184('0x31')]);_0x4ce21f['offset']=qs[_0xe184('0x2f')](_0x7a7db0['query'][_0xe184('0x2f')]);}return _0x1919c0[_0xe184('0xbc')](_0x4ce21f);}})[_0xe184('0x20')](function(_0x3244d4){if(_0x3244d4){return _0x3244d4?{'count':_0x56bd99,'rows':_0x3244d4}:null;}})[_0xe184('0x20')](respondWithResult(_0x20a8c2,null))['catch'](handleError(_0x20a8c2,null));};exports[_0xe184('0x3d')]=function(_0x28d374,_0x1ea1f,_0x2bb802){var _0xc1598e,_0x241e09,_0x3b20fd;if(_[_0xe184('0x76')](_0x28d374['body'][_0xe184('0x5d')])||_0x28d374[_0xe184('0x5d')][_0xe184('0x5d')]===''){throw new db[(_0xe184('0x7a'))][(_0xe184('0x77'))](_0xe184('0xbd'));}if(_[_0xe184('0x76')](_0x28d374['body']['to'])){}_0xc1598e=_0x28d374['body']['to'];return db['OpenchannelAccount'][_0xe184('0x6e')]({'where':{'id':_0x28d374[_0xe184('0x63')]['id']}})[_0xe184('0x20')](handleEntityNotFound(_0x1ea1f,null))[_0xe184('0x20')](function(_0x422dea){if(_0x422dea){return db[_0xe184('0x55')]['find']({'where':{'id':_0x422dea['id']},'include':[{'model':db[_0xe184('0xbe')],'as':'List','include':[{'model':db['CmContact'],'as':_0xe184('0x87'),'where':{[_0x422dea[_0xe184('0x79')]]:_0xc1598e},'limit':0x1,'order':[[_0xe184('0x74'),_0xe184('0xbf')]]}]}]})[_0xe184('0x20')](handleEntityNotFound(_0x1ea1f,null))['then'](function(_0x236db6){if(_0x236db6&&_0x236db6[_0xe184('0x7f')]){_0x241e09=_0x236db6[_0xe184('0x38')]({'plain':!![]});if(_0x241e09[_0xe184('0x7f')]&&_0x241e09[_0xe184('0x7f')][_0xe184('0x87')][_0xe184('0x4b')]){return _0x241e09[_0xe184('0x7f')][_0xe184('0x87')][0x0];}return db[_0xe184('0x70')][_0xe184('0x5c')](_[_0xe184('0xc0')](_0x28d374[_0xe184('0x5d')],{'firstName':_0xc1598e,[_0x236db6[_0xe184('0x79')]]:_0xc1598e,'phone':_0xc1598e,'ListId':_0x241e09[_0xe184('0x88')]}));}})[_0xe184('0x20')](handleEntityNotFound(_0x1ea1f,null))[_0xe184('0x20')](function(_0x5809bc){if(_0x5809bc){_0x3b20fd=_0x5809bc;return db[_0xe184('0x8b')][_0xe184('0x5b')]({'where':{'ContactId':_0x3b20fd['id'],'closed':![],'OpenchannelAccountId':_0x241e09['id']}})[_0xe184('0x20')](function(_0x45d776){if(_0x45d776){return[_0x45d776,![]];}return db[_0xe184('0x8b')]['create']({'UserId':_0x28d374[_0xe184('0x5f')]['id'],'ContactId':_0x3b20fd['id'],'OpenchannelAccountId':_0x241e09['id'],'lastMsgDirection':_0xe184('0xc1'),'firstMsgDirection':'out','Messages':[_[_0xe184('0x52')](_0x28d374['body'],{'read':![],'body':_0x28d374[_0xe184('0x5d')][_0xe184('0x5d')],'OpenchannelAccountId':_0x241e09['id'],'UserId':_0x28d374[_0xe184('0x5f')]['id'],'ContactId':_0x3b20fd['id']})]},{'include':[{'model':db[_0xe184('0xc2')],'as':_0xe184('0xc3')}]})[_0xe184('0x20')](function(_0x2c014d){return[_0x2c014d,!![]];});});}})[_0xe184('0x8e')](function(_0x4d9562,_0x43819a){if(_0x43819a){return _0x4d9562;}return db[_0xe184('0xc2')][_0xe184('0x5c')](_[_0xe184('0x52')](_0x28d374[_0xe184('0x5d')],{'read':![],'body':_0x28d374[_0xe184('0x5d')][_0xe184('0x5d')],'OpenchannelAccountId':_0x241e09['id'],'OpenchannelInteractionId':_0x4d9562['id'],'UserId':_0x28d374['user']['id'],'ContactId':_0x3b20fd['id']}))['then'](function(_0x20e817){_0x4d9562[_0xe184('0xc4')][_0xe184('0xc3')]=[];_0x4d9562[_0xe184('0xc4')][_0xe184('0xc3')][_0xe184('0x94')](_0x20e817[_0xe184('0xc4')]);return _0x4d9562;});});}})[_0xe184('0x20')](respondWithResult(_0x1ea1f,null))['catch'](handleError(_0x1ea1f,null));}; \ No newline at end of file +var _0x3fa4=['lastName','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','queueId','OpenchannelQueue','waitForTheAssignedQueue','Start','startRouting','EventManager','notify','sequelize','transaction','Transaction','ISOLATION_LEVELS','findAndCountAll','priority','finally','send','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','addAgents','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','client','http','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','then','stack','name','index','Pause','mandatoryDispositionPause','fieldName','key','model','map','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','OpenchannelAccount','includeAll','include','findAll','show','params','rawAttributes','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','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','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','list','orderBy','applications','asc','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3fa4,0xf0));var _0x43fa=function(_0x189afb,_0xd441ae){_0x189afb=_0x189afb-0x0;var _0x3b63b7=_0x3fa4[_0x189afb];return _0x3b63b7;};'use strict';var emlformat=require(_0x43fa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x43fa('0x1'));var moment=require(_0x43fa('0x2'));var BPromise=require(_0x43fa('0x3'));var Mustache=require(_0x43fa('0x4'));var util=require(_0x43fa('0x5'));var path=require(_0x43fa('0x6'));var sox=require(_0x43fa('0x7'));var csv=require('to-csv');var ejs=require(_0x43fa('0x8'));var fs=require('fs');var fs_extra=require(_0x43fa('0x9'));var _=require(_0x43fa('0xa'));var squel=require('squel');var crypto=require(_0x43fa('0xb'));var jsforce=require(_0x43fa('0xc'));var deskjs=require(_0x43fa('0xd'));var toCsv=require('to-csv');var querystring=require(_0x43fa('0xe'));var Papa=require(_0x43fa('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43fa('0x10'));var as=require(_0x43fa('0x11'));var hardwareService=require(_0x43fa('0x12'));var logger=require(_0x43fa('0x13'))(_0x43fa('0x14'));var utils=require('../../config/utils');var config=require(_0x43fa('0x15'));var licenseUtil=require(_0x43fa('0x16'));var db=require(_0x43fa('0x17'))['db'];config['redis']=_[_0x43fa('0x18')](config[_0x43fa('0x19')],{'host':_0x43fa('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43fa('0x19')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x43fa('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x43fa('0x1b')][_0x43fa('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4a07b5,_0x27b87f,_0xf421b2,_0x32ac9c){return new BPromise(function(_0x2439d4,_0x2c68e0){var _0x53c04c=_0x32ac9c||client;return _0x53c04c['request'](_0x4a07b5,_0xf421b2)['then'](function(_0x1c98bb){logger[_0x43fa('0x1d')](_0x43fa('0x1e'),_0x27b87f,_0x43fa('0x1f'));logger[_0x43fa('0x20')](_0x43fa('0x21'),_0x27b87f,_0x43fa('0x1f'),JSON[_0x43fa('0x22')](_0x1c98bb));if(_0x1c98bb[_0x43fa('0x23')]){if(_0x1c98bb['error'][_0x43fa('0x24')]===0x1f4){logger[_0x43fa('0x23')](_0x43fa('0x1e'),_0x27b87f,_0x1c98bb[_0x43fa('0x23')][_0x43fa('0x25')]);return _0x2c68e0(_0x1c98bb['error'][_0x43fa('0x25')]);}logger[_0x43fa('0x23')](_0x43fa('0x1e'),_0x27b87f,_0x1c98bb[_0x43fa('0x23')][_0x43fa('0x25')]);return _0x2439d4(_0x1c98bb[_0x43fa('0x23')][_0x43fa('0x25')]);}else{logger[_0x43fa('0x1d')](_0x43fa('0x1e'),_0x27b87f,'request\x20sent');_0x2439d4(_0x1c98bb['result'][_0x43fa('0x25')]);}})[_0x43fa('0x26')](function(_0x28f695){logger[_0x43fa('0x23')](_0x43fa('0x1e'),_0x27b87f,_0x28f695);_0x2c68e0(_0x28f695);});});}function respondWithStatusCode(_0x243dda,_0x5014fb){_0x5014fb=_0x5014fb||0xcc;return function(_0x4f6101){if(_0x4f6101){return _0x243dda[_0x43fa('0x27')](_0x5014fb);}return _0x243dda[_0x43fa('0x28')](_0x5014fb)[_0x43fa('0x29')]();};}function respondWithResult(_0x4d88b1,_0x573261){_0x573261=_0x573261||0xc8;return function(_0x11b998){if(_0x11b998){return _0x4d88b1[_0x43fa('0x28')](_0x573261)[_0x43fa('0x2a')](_0x11b998);}};}function respondWithFilteredResult(_0x186249,_0x4d6c8c){return function(_0x3d5abd){if(_0x3d5abd){var _0x44fdef=typeof _0x4d6c8c[_0x43fa('0x2b')]===_0x43fa('0x2c')&&typeof _0x4d6c8c[_0x43fa('0x2d')]===_0x43fa('0x2c');var _0x2c3acd=_0x3d5abd[_0x43fa('0x2e')];var _0xd383ff=_0x44fdef?0x0:_0x4d6c8c[_0x43fa('0x2b')];var _0x3ef547=_0x44fdef?_0x3d5abd[_0x43fa('0x2e')]:_0x4d6c8c['offset']+_0x4d6c8c['limit'];var _0x2791a0;if(_0x3ef547>=_0x2c3acd){_0x3ef547=_0x2c3acd;_0x2791a0=0xc8;}else{_0x2791a0=0xce;}_0x186249[_0x43fa('0x28')](_0x2791a0);return _0x186249[_0x43fa('0x2f')](_0x43fa('0x30'),_0xd383ff+'-'+_0x3ef547+'/'+_0x2c3acd)['json'](_0x3d5abd);}return null;};}function patchUpdates(_0xd8db16){return function(_0x1ab736){try{jsonpatch[_0x43fa('0x31')](_0x1ab736,_0xd8db16,!![]);}catch(_0x5c9413){return BPromise[_0x43fa('0x32')](_0x5c9413);}return _0x1ab736[_0x43fa('0x33')]();};}function saveUpdates(_0x179c3a,_0x7be71){return function(_0x58919a){if(_0x58919a){return _0x58919a[_0x43fa('0x34')](_0x179c3a)['then'](function(_0x2d1e72){return _0x2d1e72;});}return null;};}function removeEntity(_0x79683a,_0xcdeb70){return function(_0x4e06e0){if(_0x4e06e0){return _0x4e06e0[_0x43fa('0x35')]()['then'](function(){var _0x564dd9=_0x4e06e0[_0x43fa('0x36')]({'plain':!![]});var _0x3fd9c3=_0x43fa('0x37');return db['UserProfileResource'][_0x43fa('0x35')]({'where':{'type':_0x3fd9c3,'resourceId':_0x564dd9['id']}})[_0x43fa('0x38')](function(){return _0x4e06e0;});})[_0x43fa('0x38')](function(){_0x79683a[_0x43fa('0x28')](0xcc)[_0x43fa('0x29')]();});}};}function handleEntityNotFound(_0x5978dd,_0x3daddf){return function(_0x108aca){if(!_0x108aca){_0x5978dd[_0x43fa('0x27')](0x194);}return _0x108aca;};}function handleError(_0x360078,_0x503d9d){_0x503d9d=_0x503d9d||0x1f4;return function(_0x521f7f){logger[_0x43fa('0x23')](_0x521f7f[_0x43fa('0x39')]);if(_0x521f7f[_0x43fa('0x3a')]){delete _0x521f7f[_0x43fa('0x3a')];}_0x360078[_0x43fa('0x28')](_0x503d9d)['send'](_0x521f7f);};}exports[_0x43fa('0x3b')]=function(_0x578688,_0x4cb1bd){var _0x236332={'include':[{'model':db[_0x43fa('0x3c')],'as':_0x43fa('0x3d')}]},_0x59e332={},_0x8ac566={'count':0x0,'rows':[]};var _0x17403c=_['map'](db['OpenchannelAccount']['rawAttributes'],function(_0x20568b){return{'name':_0x20568b[_0x43fa('0x3e')],'type':_0x20568b['type'][_0x43fa('0x3f')]};});_0x59e332[_0x43fa('0x40')]=_[_0x43fa('0x41')](_0x17403c,_0x43fa('0x3a'));_0x59e332['query']=_[_0x43fa('0x42')](_0x578688[_0x43fa('0x43')]);_0x59e332['filters']=_['intersection'](_0x59e332[_0x43fa('0x40')],_0x59e332['query']);_0x236332[_0x43fa('0x44')]=_[_0x43fa('0x45')](_0x59e332['model'],qs[_0x43fa('0x46')](_0x578688['query'][_0x43fa('0x46')]));_0x236332[_0x43fa('0x44')]=_0x236332[_0x43fa('0x44')]['length']?_0x236332[_0x43fa('0x44')]:_0x59e332[_0x43fa('0x40')];if(!_0x578688[_0x43fa('0x43')][_0x43fa('0x47')](_0x43fa('0x48'))){_0x236332[_0x43fa('0x2d')]=qs['limit'](_0x578688[_0x43fa('0x43')]['limit']);_0x236332[_0x43fa('0x2b')]=qs['offset'](_0x578688[_0x43fa('0x43')][_0x43fa('0x2b')]);}_0x236332[_0x43fa('0x49')]=qs[_0x43fa('0x4a')](_0x578688[_0x43fa('0x43')]['sort']);_0x236332[_0x43fa('0x4b')]=qs['filters'](_['pick'](_0x578688['query'],_0x59e332[_0x43fa('0x4c')]),_0x17403c);if(_0x578688[_0x43fa('0x43')][_0x43fa('0x4d')]){_0x236332[_0x43fa('0x4b')]=_[_0x43fa('0x4e')](_0x236332['where'],{'$or':_[_0x43fa('0x41')](_0x17403c,function(_0x1662d5){if(_0x1662d5[_0x43fa('0x4f')]!==_0x43fa('0x50')){var _0x1d1407={};_0x1d1407[_0x1662d5[_0x43fa('0x3a')]]={'$like':'%'+_0x578688[_0x43fa('0x43')][_0x43fa('0x4d')]+'%'};return _0x1d1407;}})});}_0x236332=_[_0x43fa('0x4e')]({},_0x236332,_0x578688[_0x43fa('0x51')]);var _0x1ae6e0={'where':_0x236332['where']};return db[_0x43fa('0x52')][_0x43fa('0x2e')](_0x1ae6e0)['then'](function(_0x44f125){_0x8ac566['count']=_0x44f125;if(_0x578688[_0x43fa('0x43')][_0x43fa('0x53')]){_0x236332[_0x43fa('0x54')]=[{'all':!![]}];}return db[_0x43fa('0x52')][_0x43fa('0x55')](_0x236332);})['then'](function(_0x1bbae4){_0x8ac566['rows']=_0x1bbae4;return _0x8ac566;})[_0x43fa('0x38')](respondWithFilteredResult(_0x4cb1bd,_0x236332))[_0x43fa('0x26')](handleError(_0x4cb1bd,null));};exports[_0x43fa('0x56')]=function(_0x5e05fd,_0x5cbcd9){var _0xc3f7aa={'raw':![],'where':{'id':_0x5e05fd[_0x43fa('0x57')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5be796={};_0x5be796[_0x43fa('0x40')]=_[_0x43fa('0x42')](db['OpenchannelAccount'][_0x43fa('0x58')]);_0x5be796[_0x43fa('0x43')]=_[_0x43fa('0x42')](_0x5e05fd[_0x43fa('0x43')]);_0x5be796['filters']=_[_0x43fa('0x45')](_0x5be796[_0x43fa('0x40')],_0x5be796[_0x43fa('0x43')]);_0xc3f7aa[_0x43fa('0x44')]=_['intersection'](_0x5be796['model'],qs[_0x43fa('0x46')](_0x5e05fd['query']['fields']));_0xc3f7aa['attributes']=_0xc3f7aa[_0x43fa('0x44')][_0x43fa('0x59')]?_0xc3f7aa[_0x43fa('0x44')]:_0x5be796[_0x43fa('0x40')];if(_0x5e05fd[_0x43fa('0x43')][_0x43fa('0x53')]){_0xc3f7aa[_0x43fa('0x54')]=[{'all':!![]}];}_0xc3f7aa=_['merge']({},_0xc3f7aa,_0x5e05fd[_0x43fa('0x51')]);return db[_0x43fa('0x52')]['find'](_0xc3f7aa)[_0x43fa('0x38')](handleEntityNotFound(_0x5cbcd9,null))['then'](respondWithResult(_0x5cbcd9,null))[_0x43fa('0x26')](handleError(_0x5cbcd9,null));};exports[_0x43fa('0x5a')]=function(_0x3b9de0,_0x41caf9){return db['OpenchannelAccount']['create'](_0x3b9de0[_0x43fa('0x5b')],{})[_0x43fa('0x38')](function(_0x1d74a7){var _0x3ba2e0=_0x3b9de0['user']['get']({'plain':!![]});if(!_0x3ba2e0)throw new Error(_0x43fa('0x5c'));if(_0x3ba2e0['role']===_0x43fa('0x5d')){var _0x23b7c1=_0x1d74a7[_0x43fa('0x36')]({'plain':!![]});var _0x33e439='OpenchannelAccounts';return db['UserProfileSection'][_0x43fa('0x5e')]({'where':{'name':_0x33e439,'userProfileId':_0x3ba2e0['userProfileId']},'raw':!![]})[_0x43fa('0x38')](function(_0x13ade5){if(_0x13ade5&&_0x13ade5[_0x43fa('0x5f')]===0x0){return db[_0x43fa('0x60')][_0x43fa('0x5a')]({'name':_0x23b7c1[_0x43fa('0x3a')],'resourceId':_0x23b7c1['id'],'type':_0x13ade5[_0x43fa('0x3a')],'sectionId':_0x13ade5['id']},{})['then'](function(){return _0x1d74a7;});}else{return _0x1d74a7;}})[_0x43fa('0x26')](function(_0x36a8c6){logger[_0x43fa('0x23')](_0x43fa('0x61'),_0x36a8c6);throw _0x36a8c6;});}return _0x1d74a7;})[_0x43fa('0x38')](respondWithResult(_0x41caf9,0xc9))['catch'](handleError(_0x41caf9,null));};exports[_0x43fa('0x34')]=function(_0x295602,_0x202a29){if(_0x295602[_0x43fa('0x5b')]['id']){delete _0x295602[_0x43fa('0x5b')]['id'];}return db[_0x43fa('0x52')][_0x43fa('0x5e')]({'where':{'id':_0x295602[_0x43fa('0x57')]['id']},'include':[{'model':db[_0x43fa('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x43fa('0x38')](handleEntityNotFound(_0x202a29,null))[_0x43fa('0x38')](saveUpdates(_0x295602[_0x43fa('0x5b')],null))[_0x43fa('0x38')](respondWithResult(_0x202a29,null))[_0x43fa('0x26')](handleError(_0x202a29,null));};exports['destroy']=function(_0x5e1ceb,_0x31f416){return db[_0x43fa('0x52')][_0x43fa('0x5e')]({'where':{'id':_0x5e1ceb[_0x43fa('0x57')]['id']}})[_0x43fa('0x38')](handleEntityNotFound(_0x31f416,null))[_0x43fa('0x38')](removeEntity(_0x31f416,null))[_0x43fa('0x26')](handleError(_0x31f416,null));};exports[_0x43fa('0x62')]=function(_0x29338e,_0x45136b){return db[_0x43fa('0x52')][_0x43fa('0x62')]()[_0x43fa('0x38')](respondWithResult(_0x45136b,null))[_0x43fa('0x26')](handleError(_0x45136b,null));};exports[_0x43fa('0x63')]=function(_0xf33ed3,_0x3cc967,_0xbd04bf){if(_0xf33ed3[_0x43fa('0x5b')]['id']){delete _0xf33ed3[_0x43fa('0x5b')]['id'];}return db[_0x43fa('0x52')][_0x43fa('0x5e')]({'where':{'id':_0xf33ed3['params']['id']}})['then'](handleEntityNotFound(_0x3cc967,null))[_0x43fa('0x38')](function(_0x44e268){if(_0x44e268){_0xf33ed3['body'][_0x43fa('0x64')]=_0x44e268['id'];return db['Disposition'][_0x43fa('0x5a')](_0xf33ed3['body']);}})[_0x43fa('0x38')](respondWithResult(_0x3cc967,null))[_0x43fa('0x26')](handleError(_0x3cc967,null));};exports[_0x43fa('0x65')]=function(_0x149093,_0x61aef,_0x5b4981){var _0x19de6c={'raw':![],'where':{}};var _0x492bc4={};var _0x1ea3a0={'count':0x0,'rows':[]};return db[_0x43fa('0x52')][_0x43fa('0x66')]({'where':{'id':_0x149093[_0x43fa('0x57')]['id']}})[_0x43fa('0x38')](handleEntityNotFound(_0x61aef,null))['then'](function(_0x284beb){if(_0x284beb){_0x492bc4[_0x43fa('0x40')]=_['keys'](db[_0x43fa('0x67')]['rawAttributes']);_0x492bc4[_0x43fa('0x43')]=_[_0x43fa('0x42')](_0x149093['query']);_0x492bc4[_0x43fa('0x4c')]=_[_0x43fa('0x45')](_0x492bc4[_0x43fa('0x40')],_0x492bc4['query']);_0x19de6c['attributes']=_[_0x43fa('0x45')](_0x492bc4[_0x43fa('0x40')],qs[_0x43fa('0x46')](_0x149093[_0x43fa('0x43')]['fields']));_0x19de6c[_0x43fa('0x44')]=_0x19de6c['attributes']['length']?_0x19de6c[_0x43fa('0x44')]:_0x492bc4[_0x43fa('0x40')];if(!_0x149093[_0x43fa('0x43')][_0x43fa('0x47')](_0x43fa('0x48'))){_0x19de6c[_0x43fa('0x2d')]=qs['limit'](_0x149093[_0x43fa('0x43')][_0x43fa('0x2d')]);_0x19de6c[_0x43fa('0x2b')]=qs['offset'](_0x149093[_0x43fa('0x43')][_0x43fa('0x2b')]);}_0x19de6c[_0x43fa('0x49')]=qs['sort'](_0x149093[_0x43fa('0x43')][_0x43fa('0x4a')]);_0x19de6c['where']=qs['filters'](_[_0x43fa('0x68')](_0x149093[_0x43fa('0x43')],_0x492bc4[_0x43fa('0x4c')]));_0x19de6c[_0x43fa('0x4b')][_0x43fa('0x64')]=_0x284beb['id'];if(_0x149093[_0x43fa('0x43')][_0x43fa('0x4d')]){_0x19de6c[_0x43fa('0x4b')]=_[_0x43fa('0x4e')](_0x19de6c[_0x43fa('0x4b')],{'$or':_[_0x43fa('0x41')](_0x19de6c[_0x43fa('0x44')],function(_0x529a1c){var _0x408419={};_0x408419[_0x529a1c]={'$like':'%'+_0x149093[_0x43fa('0x43')][_0x43fa('0x4d')]+'%'};return _0x408419;})});}_0x19de6c=_['merge']({},_0x19de6c,_0x149093[_0x43fa('0x51')]);return db[_0x43fa('0x67')][_0x43fa('0x2e')]({'where':_0x19de6c[_0x43fa('0x4b')]})['then'](function(_0x271487){_0x1ea3a0['count']=_0x271487;if(_0x149093['query']['includeAll']){_0x19de6c[_0x43fa('0x54')]=[{'all':!![]}];}return db['Disposition'][_0x43fa('0x55')](_0x19de6c);})[_0x43fa('0x38')](function(_0x39a0d8){_0x1ea3a0[_0x43fa('0x69')]=_0x39a0d8;return _0x1ea3a0;});}})[_0x43fa('0x38')](respondWithFilteredResult(_0x61aef,_0x19de6c))['catch'](handleError(_0x61aef,null));};exports[_0x43fa('0x6a')]=function(_0x1d28b5,_0x44b968,_0x3c8b6a){return db['OpenchannelAccount']['find']({'where':{'id':_0x1d28b5['params']['id']}})['then'](handleEntityNotFound(_0x44b968,null))[_0x43fa('0x38')](function(_0x830a70){if(_0x830a70){return _0x830a70[_0x43fa('0x6a')](_0x1d28b5['query'][_0x43fa('0x6b')]);}})[_0x43fa('0x38')](respondWithStatusCode(_0x44b968,null))[_0x43fa('0x26')](handleError(_0x44b968,null));};exports[_0x43fa('0x6c')]=function(_0x566fe3,_0x170e69,_0x391111){if(_0x566fe3[_0x43fa('0x5b')]['id']){delete _0x566fe3[_0x43fa('0x5b')]['id'];}return db[_0x43fa('0x52')][_0x43fa('0x5e')]({'where':{'id':_0x566fe3[_0x43fa('0x57')]['id']}})[_0x43fa('0x38')](handleEntityNotFound(_0x170e69,null))['then'](function(_0x4b31b2){if(_0x4b31b2){_0x566fe3[_0x43fa('0x5b')][_0x43fa('0x64')]=_0x4b31b2['id'];return db[_0x43fa('0x6d')]['create'](_0x566fe3[_0x43fa('0x5b')]);}})[_0x43fa('0x38')](respondWithResult(_0x170e69,null))[_0x43fa('0x26')](handleError(_0x170e69,null));};exports['getAnswers']=function(_0x3a3771,_0x78ca4e,_0x25eb3a){var _0x532ff4={'raw':![],'where':{}};var _0x10123f={};var _0x457006={'count':0x0,'rows':[]};return db[_0x43fa('0x52')]['findOne']({'where':{'id':_0x3a3771[_0x43fa('0x57')]['id']}})[_0x43fa('0x38')](handleEntityNotFound(_0x78ca4e,null))['then'](function(_0x733caf){if(_0x733caf){_0x10123f[_0x43fa('0x40')]=_[_0x43fa('0x42')](db['CannedAnswer'][_0x43fa('0x58')]);_0x10123f[_0x43fa('0x43')]=_[_0x43fa('0x42')](_0x3a3771[_0x43fa('0x43')]);_0x10123f[_0x43fa('0x4c')]=_[_0x43fa('0x45')](_0x10123f['model'],_0x10123f[_0x43fa('0x43')]);_0x532ff4[_0x43fa('0x44')]=_[_0x43fa('0x45')](_0x10123f[_0x43fa('0x40')],qs[_0x43fa('0x46')](_0x3a3771[_0x43fa('0x43')][_0x43fa('0x46')]));_0x532ff4[_0x43fa('0x44')]=_0x532ff4['attributes']['length']?_0x532ff4[_0x43fa('0x44')]:_0x10123f[_0x43fa('0x40')];if(!_0x3a3771[_0x43fa('0x43')][_0x43fa('0x47')]('nolimit')){_0x532ff4[_0x43fa('0x2d')]=qs[_0x43fa('0x2d')](_0x3a3771['query'][_0x43fa('0x2d')]);_0x532ff4[_0x43fa('0x2b')]=qs[_0x43fa('0x2b')](_0x3a3771[_0x43fa('0x43')][_0x43fa('0x2b')]);}_0x532ff4['order']=qs[_0x43fa('0x4a')](_0x3a3771[_0x43fa('0x43')][_0x43fa('0x4a')]);_0x532ff4[_0x43fa('0x4b')]=qs[_0x43fa('0x4c')](_[_0x43fa('0x68')](_0x3a3771[_0x43fa('0x43')],_0x10123f[_0x43fa('0x4c')]));_0x532ff4[_0x43fa('0x4b')]['OpenchannelAccountId']=_0x733caf['id'];if(_0x3a3771[_0x43fa('0x43')][_0x43fa('0x4d')]){_0x532ff4[_0x43fa('0x4b')]=_[_0x43fa('0x4e')](_0x532ff4[_0x43fa('0x4b')],{'$or':_[_0x43fa('0x41')](_0x532ff4[_0x43fa('0x44')],function(_0x593df8){var _0x25ade1={};_0x25ade1[_0x593df8]={'$like':'%'+_0x3a3771['query'][_0x43fa('0x4d')]+'%'};return _0x25ade1;})});}_0x532ff4=_[_0x43fa('0x4e')]({},_0x532ff4,_0x3a3771['options']);return db['CannedAnswer'][_0x43fa('0x2e')]({'where':_0x532ff4[_0x43fa('0x4b')]})[_0x43fa('0x38')](function(_0x262aee){_0x457006[_0x43fa('0x2e')]=_0x262aee;if(_0x3a3771[_0x43fa('0x43')][_0x43fa('0x53')]){_0x532ff4[_0x43fa('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x43fa('0x55')](_0x532ff4);})[_0x43fa('0x38')](function(_0x17024c){_0x457006[_0x43fa('0x69')]=_0x17024c;return _0x457006;});}})[_0x43fa('0x38')](respondWithFilteredResult(_0x78ca4e,_0x532ff4))[_0x43fa('0x26')](handleError(_0x78ca4e,null));};exports['removeAnswers']=function(_0x599ae9,_0x5c75b0,_0x14a79d){return db[_0x43fa('0x52')]['find']({'where':{'id':_0x599ae9['params']['id']}})['then'](handleEntityNotFound(_0x5c75b0,null))[_0x43fa('0x38')](function(_0x3ea18b){if(_0x3ea18b){return _0x3ea18b[_0x43fa('0x6e')](_0x599ae9[_0x43fa('0x43')][_0x43fa('0x6b')]);}})[_0x43fa('0x38')](respondWithStatusCode(_0x5c75b0,null))['catch'](handleError(_0x5c75b0,null));};exports['notify']=function(_0x151b1f,_0x122586,_0x1132b3){var _0x17d016={'body':_0x151b1f[_0x43fa('0x5b')],'channel':_0x43fa('0x6f')};var _0x431d41=[];var _0x4ae736=[];var _0x14bc72={};var _0xce2cf6=![];return db[_0x43fa('0x70')][_0x43fa('0x62')]()[_0x43fa('0x38')](function(_0x403aa8){if(!_0x403aa8){throw new db[(_0x43fa('0x71'))][(_0x43fa('0x72'))]('no\x20available\x20attributes');}_0x431d41=_[_0x43fa('0x73')](_[_0x43fa('0x42')](_0x403aa8),[_0x43fa('0x74'),_0x43fa('0x75')]);_0x4ae736=_[_0x43fa('0x73')](_[_0x43fa('0x42')](_0x403aa8),[_0x43fa('0x74'),_0x43fa('0x75'),_0x43fa('0x76'),_0x43fa('0x77')]);if(_0x151b1f[_0x43fa('0x5b')]['id']){delete _0x151b1f['body']['id'];}if(_['isNil'](_0x151b1f[_0x43fa('0x5b')][_0x43fa('0x78')])){throw new db['Sequelize'][(_0x43fa('0x72'))](_0x43fa('0x79'));}if(_[_0x43fa('0x7a')](_0x151b1f['body'][_0x43fa('0x5b')])||_0x151b1f[_0x43fa('0x5b')]['body']===''){throw new db[(_0x43fa('0x71'))]['ValidationError'](_0x43fa('0x7b'));}if(_[_0x43fa('0x7a')](_0x151b1f['body']['mapKey'])){throw new db['Sequelize'][(_0x43fa('0x72'))](_0x43fa('0x7c')+_0x4ae736);}if(!_[_0x43fa('0x7d')](_0x4ae736,_0x151b1f[_0x43fa('0x5b')][_0x43fa('0x7e')])){throw new db[(_0x43fa('0x71'))][(_0x43fa('0x72'))](_0x43fa('0x7f')+_0x4ae736);}_0x14bc72[_0x151b1f[_0x43fa('0x5b')][_0x43fa('0x7e')]]=_0x151b1f['body'][_0x43fa('0x78')];})['then'](function(){return db[_0x43fa('0x52')][_0x43fa('0x5e')]({'where':{'id':_0x151b1f[_0x43fa('0x57')]['id']},'include':[{'model':db[_0x43fa('0x80')],'as':_0x43fa('0x81'),'include':[{'model':db[_0x43fa('0x70')],'as':_0x43fa('0x82'),'where':_0x14bc72,'limit':0x1,'order':[[_0x43fa('0x75'),_0x43fa('0x83')]]}]},{'model':db[_0x43fa('0x84')],'as':_0x43fa('0x85')}]});})['then'](handleEntityNotFound(_0x122586,null))['then'](function(_0x307272){if(_0x307272&&_0x307272[_0x43fa('0x81')]){_0x17d016[_0x43fa('0x86')]=_0x307272;_0x17d016['applications']=_0x307272[_0x43fa('0x85')];_0x17d016[_0x43fa('0x87')]=_0x307272[_0x43fa('0x81')];_0x17d016['applications']=_[_0x43fa('0x88')](_0x17d016[_0x43fa('0x89')],['priority'],[_0x43fa('0x8a')]);if(_0x17d016[_0x43fa('0x86')]['Applications']){delete _0x17d016[_0x43fa('0x86')]['Applications'];}if(_0x17d016[_0x43fa('0x86')][_0x43fa('0x81')]&&_0x17d016[_0x43fa('0x86')][_0x43fa('0x81')]['Contacts']['length']){return _0x17d016[_0x43fa('0x86')][_0x43fa('0x81')][_0x43fa('0x82')][0x0];}var _0x496801=_[_0x43fa('0x18')](_0x151b1f[_0x43fa('0x5b')],{'firstName':_0x151b1f[_0x43fa('0x5b')][_0x43fa('0x78')],'ListId':_0x307272['ListId']});_0x496801[_0x151b1f[_0x43fa('0x5b')][_0x43fa('0x7e')]]=_0x151b1f[_0x43fa('0x5b')][_0x43fa('0x78')];return db['CmContact'][_0x43fa('0x5a')](_0x496801,{'fields':_0x431d41,'raw':!![]});}})[_0x43fa('0x38')](handleEntityNotFound(_0x122586,null))[_0x43fa('0x38')](function(_0x12bc8c){_0x17d016[_0x43fa('0x8b')]=_0x12bc8c;if(_0x12bc8c){var _0xb14e5a={'ContactId':_0x12bc8c['id'],'OpenchannelAccountId':_0x151b1f[_0x43fa('0x57')]['id'],'from':(_0x12bc8c[_0x43fa('0x8c')]||'')+'\x20'+(_0x12bc8c['lastName']||'')};var _0x441412={'OpenchannelAccountId':_0x151b1f[_0x43fa('0x57')]['id'],'closed':![]};if(_0x151b1f[_0x43fa('0x5b')][_0x43fa('0x8d')]){_0x441412[_0x43fa('0x8d')]=_0x151b1f[_0x43fa('0x5b')]['threadId'];return db[_0x43fa('0x8e')]['find']({'where':_0x441412})[_0x43fa('0x38')](function(_0x6be06b){if(_0x6be06b){return[_0x6be06b,![]];}_0xb14e5a[_0x43fa('0x8d')]=_0x151b1f['body'][_0x43fa('0x8d')];_0xb14e5a[_0x43fa('0x8f')]=_0x151b1f['body'][_0x43fa('0x8f')];return db[_0x43fa('0x8e')][_0x43fa('0x5a')](_0xb14e5a)[_0x43fa('0x38')](function(_0x560105){return[_0x560105,!![]];});});}else{_0x441412[_0x43fa('0x8d')]=null;}_0x441412[_0x43fa('0x90')]=_0x12bc8c['id'];return db[_0x43fa('0x8e')]['find']({'where':_0x441412})[_0x43fa('0x38')](function(_0x4f99f1){if(_0x4f99f1){return[_0x4f99f1,![]];}return db[_0x43fa('0x8e')][_0x43fa('0x5a')](_0xb14e5a)[_0x43fa('0x38')](function(_0x2f6ebd){return[_0x2f6ebd,!![]];});});}})[_0x43fa('0x91')](function(_0x41c6c3,_0x518b78){if(_0x41c6c3){_0xce2cf6=_0x518b78;if(!_0x518b78){var _0x4128cb={'from':(_0x17d016[_0x43fa('0x8b')]['firstName']||'')+'\x20'+(_0x17d016[_0x43fa('0x8b')][_0x43fa('0x92')]||'')};if(_0x151b1f[_0x43fa('0x5b')]['threadId']&&_0x151b1f['body'][_0x43fa('0x93')]&&_0x151b1f[_0x43fa('0x5b')][_0x43fa('0x8d')]!=_0x151b1f[_0x43fa('0x5b')][_0x43fa('0x93')]){_0x4128cb['threadId']=_0x151b1f[_0x43fa('0x5b')][_0x43fa('0x93')];}return _0x41c6c3['update'](_0x4128cb);}else{return _0x41c6c3;}}})[_0x43fa('0x38')](function(_0x36a2ee){_0x17d016[_0x43fa('0x94')]=_0x36a2ee[_0x43fa('0x36')]({'plain':!![]});_0x17d016[_0x43fa('0x94')][_0x43fa('0x95')]=_0xce2cf6;if(_0x17d016['interaction']['created']){if(_0x17d016['account'][_0x43fa('0x96')]){_0x17d016[_0x43fa('0x89')][_0x43fa('0x97')]({'id':0x0,'priority':_0x17d016[_0x43fa('0x89')][_0x43fa('0x59')]+0x1,'app':'close','appdata':_0x43fa('0x98'),'interval':_0x43fa('0x99')});}}return db[_0x43fa('0x9a')][_0x43fa('0x5a')]({'body':_0x151b1f[_0x43fa('0x5b')][_0x43fa('0x5b')],'OpenchannelAccountId':_0x151b1f[_0x43fa('0x57')]['id'],'OpenchannelInteractionId':_0x36a2ee['id'],'direction':'in','ContactId':_0x17d016[_0x43fa('0x8b')]['id'],'AttachmentId':_0x151b1f[_0x43fa('0x5b')][_0x43fa('0x9b')]});})[_0x43fa('0x38')](function(_0x341313){_0x17d016['message']=_0x341313;if(!_0x17d016['interaction']['UserId'])return;return db[_0x43fa('0x9c')][_0x43fa('0x5e')]({'attributes':['id',_0x43fa('0x3a')],'where':{'id':_0x17d016[_0x43fa('0x94')][_0x43fa('0x9d')]}});})[_0x43fa('0x38')](function(_0x4fcc50){if(_0x4fcc50){_0x17d016[_0x43fa('0x89')][_0x43fa('0x9e')]({'id':0x0,'priority':0x0,'app':_0x43fa('0x9f'),'appdata':_0x4fcc50[_0x43fa('0x3a')]+','+(_0x17d016['account']['waitForTheAssignedAgent']||0xa),'interval':_0x43fa('0x99')});}if(!_0x17d016[_0x43fa('0x94')][_0x43fa('0xa0')])return;return db[_0x43fa('0xa1')][_0x43fa('0x5e')]({'attributes':['id','name'],'where':{'id':_0x17d016['interaction']['queueId']}});})[_0x43fa('0x38')](function(_0x46564e){if(_0x46564e){_0x17d016['applications'][_0x43fa('0x9e')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x46564e[_0x43fa('0x3a')]+','+(_0x17d016['account'][_0x43fa('0xa2')]||0x12c),'interval':_0x43fa('0x99')});}return respondWithRpcPromise(_0x43fa('0xa3'),_0x43fa('0xa4'),_0x17d016);})['then'](function(_0x388f35){respondWithRpcPromise(_0x43fa('0xa5'),_0x43fa('0xa5'),{'event':_0x43fa('0xa6'),'message':_0x388f35},client9002);return _0x388f35;})[_0x43fa('0x38')](respondWithResult(_0x122586,null))[_0x43fa('0x26')](handleError(_0x122586,null));};exports['addApplications']=function(_0x14fb4d,_0xaf699f){var _0x9aaefd=_0x14fb4d['params']['id'];var _0x2367be=_0x14fb4d[_0x43fa('0x5b')];var _0x114d42=0xc8;var _0x4e6c23=null;return db[_0x43fa('0xa7')][_0x43fa('0xa8')]({'isolationLevel':db[_0x43fa('0xa7')][_0x43fa('0xa9')][_0x43fa('0xaa')]['READ_COMMITTED']},function(_0x115013){return db[_0x43fa('0x52')][_0x43fa('0x66')]({'where':{'id':_0x9aaefd},'transaction':_0x115013})[_0x43fa('0x38')](function(_0x6b8cf0){if(_0x6b8cf0){return db['OpenchannelApplication'][_0x43fa('0x35')]({'where':{'OpenchannelAccountId':_0x9aaefd},'transaction':_0x115013})['then'](function(){var _0x1ea7dc=_['map'](_0x2367be,function(_0x1544a3){_0x1544a3[_0x43fa('0x64')]=_0x9aaefd;return _0x1544a3;});return db[_0x43fa('0x84')]['bulkCreate'](_0x1ea7dc,{'transaction':_0x115013});});}else{_0x114d42=0x194;_0x4e6c23=[];}});})['then'](function(){if(_0x114d42!==0x194){return db[_0x43fa('0x84')][_0x43fa('0xab')]({'where':{'OpenchannelAccountId':_0x9aaefd},'order':_0x43fa('0xac')})[_0x43fa('0x38')](function(_0x7c08c2){_0x4e6c23=_0x7c08c2;});}})[_0x43fa('0x26')](function(_0x51a848){_0x114d42=0x1f4;logger[_0x43fa('0x23')](_0x51a848[_0x43fa('0x39')]);if(_0x51a848[_0x43fa('0x3a')]){delete _0x51a848[_0x43fa('0x3a')];}_0x4e6c23=_0x51a848;})[_0x43fa('0xad')](function(){if(_0x4e6c23===null){_0xaf699f['sendStatus'](_0x114d42);}else{if(_0x114d42===0x1f4){_0xaf699f['status'](_0x114d42)[_0x43fa('0xae')](_0x4e6c23);}else{_0xaf699f[_0x43fa('0x28')](_0x114d42)['json'](_0x4e6c23);}}});};exports[_0x43fa('0xaf')]=function(_0x2d00f0,_0x3e37ed,_0xc363b9){var _0xa25974={};var _0x169c0a={};var _0x3b6af4;var _0x274672;return db[_0x43fa('0x52')][_0x43fa('0x66')]({'where':{'id':_0x2d00f0[_0x43fa('0x57')]['id']}})[_0x43fa('0x38')](handleEntityNotFound(_0x3e37ed,null))[_0x43fa('0x38')](function(_0x56827a){if(_0x56827a){_0x3b6af4=_0x56827a;_0x169c0a[_0x43fa('0x40')]=_[_0x43fa('0x42')](db['OpenchannelApplication'][_0x43fa('0x58')]);_0x169c0a[_0x43fa('0x43')]=_[_0x43fa('0x42')](_0x2d00f0[_0x43fa('0x43')]);_0x169c0a[_0x43fa('0x4c')]=_['intersection'](_0x169c0a[_0x43fa('0x40')],_0x169c0a['query']);_0xa25974['attributes']=_[_0x43fa('0x45')](_0x169c0a[_0x43fa('0x40')],qs['fields'](_0x2d00f0[_0x43fa('0x43')]['fields']));_0xa25974[_0x43fa('0x44')]=_0xa25974[_0x43fa('0x44')]['length']?_0xa25974[_0x43fa('0x44')]:_0x169c0a['model'];_0xa25974[_0x43fa('0x49')]=qs['sort'](_0x2d00f0[_0x43fa('0x43')][_0x43fa('0x4a')]);_0xa25974[_0x43fa('0x4b')]=qs['filters'](_[_0x43fa('0x68')](_0x2d00f0[_0x43fa('0x43')],_0x169c0a[_0x43fa('0x4c')]));if(_0x2d00f0[_0x43fa('0x43')][_0x43fa('0x4d')]){_0xa25974[_0x43fa('0x4b')]=_[_0x43fa('0x4e')](_0xa25974['where'],{'$or':_[_0x43fa('0x41')](_0xa25974[_0x43fa('0x44')],function(_0x553d90){var _0xfc449f={};_0xfc449f[_0x553d90]={'$like':'%'+_0x2d00f0[_0x43fa('0x43')]['filter']+'%'};return _0xfc449f;})});}_0xa25974=_['merge']({},_0xa25974,_0x2d00f0[_0x43fa('0x51')]);return _0x3b6af4['getApplications'](_0xa25974);}})[_0x43fa('0x38')](function(_0x12ce32){if(_0x12ce32){_0x274672=_0x12ce32['length'];if(!_0x2d00f0['query']['hasOwnProperty']('nolimit')){_0xa25974[_0x43fa('0x2d')]=qs[_0x43fa('0x2d')](_0x2d00f0[_0x43fa('0x43')][_0x43fa('0x2d')]);_0xa25974['offset']=qs[_0x43fa('0x2b')](_0x2d00f0[_0x43fa('0x43')][_0x43fa('0x2b')]);}return _0x3b6af4[_0x43fa('0xaf')](_0xa25974);}})[_0x43fa('0x38')](function(_0x5637f9){if(_0x5637f9){return _0x5637f9?{'count':_0x274672,'rows':_0x5637f9}:null;}})[_0x43fa('0x38')](respondWithResult(_0x3e37ed,null))['catch'](handleError(_0x3e37ed,null));};exports[_0x43fa('0xb0')]=function(_0x20babd,_0x181ee4,_0x2698a9){var _0x3994a9={'raw':![],'where':{}};var _0xb0245e={};var _0x24e4fb={'count':0x0,'rows':[]};return db[_0x43fa('0x52')][_0x43fa('0x66')]({'where':{'id':_0x20babd['params']['id']}})[_0x43fa('0x38')](handleEntityNotFound(_0x181ee4,null))[_0x43fa('0x38')](function(_0x342b17){if(_0x342b17){_0xb0245e[_0x43fa('0x40')]=_[_0x43fa('0x42')](db['OpenchannelInteraction'][_0x43fa('0x58')]);_0xb0245e['query']=_[_0x43fa('0x42')](_0x20babd['query']);_0xb0245e['filters']=_[_0x43fa('0x45')](_0xb0245e[_0x43fa('0x40')],_0xb0245e['query']);_0x3994a9[_0x43fa('0x44')]=_[_0x43fa('0x45')](_0xb0245e[_0x43fa('0x40')],qs[_0x43fa('0x46')](_0x20babd[_0x43fa('0x43')][_0x43fa('0x46')]));_0x3994a9[_0x43fa('0x44')]=_0x3994a9[_0x43fa('0x44')][_0x43fa('0x59')]?_0x3994a9[_0x43fa('0x44')]:_0xb0245e['model'];if(!_0x20babd[_0x43fa('0x43')][_0x43fa('0x47')]('nolimit')){_0x3994a9[_0x43fa('0x2d')]=qs[_0x43fa('0x2d')](_0x20babd['query'][_0x43fa('0x2d')]);_0x3994a9['offset']=qs['offset'](_0x20babd['query'][_0x43fa('0x2b')]);}_0x3994a9['order']=qs[_0x43fa('0x4a')](_0x20babd[_0x43fa('0x43')][_0x43fa('0x4a')]);_0x3994a9[_0x43fa('0x4b')]=qs[_0x43fa('0x4c')](_[_0x43fa('0x68')](_0x20babd[_0x43fa('0x43')],_0xb0245e[_0x43fa('0x4c')]));_0x3994a9[_0x43fa('0x4b')]['OpenchannelAccountId']=_0x342b17['id'];if(_0x20babd[_0x43fa('0x43')]['filter']){_0x3994a9[_0x43fa('0x4b')]=_[_0x43fa('0x4e')](_0x3994a9[_0x43fa('0x4b')],{'$or':_[_0x43fa('0x41')](_0x3994a9[_0x43fa('0x44')],function(_0x36bab8){var _0x71591c={};_0x71591c[_0x36bab8]={'$like':'%'+_0x20babd[_0x43fa('0x43')][_0x43fa('0x4d')]+'%'};return _0x71591c;})});}_0x3994a9=_[_0x43fa('0x4e')]({},_0x3994a9,_0x20babd['options']);return db[_0x43fa('0x8e')][_0x43fa('0x2e')]({'where':_0x3994a9[_0x43fa('0x4b')]})[_0x43fa('0x38')](function(_0x2ebc2a){_0x24e4fb[_0x43fa('0x2e')]=_0x2ebc2a;if(_0x20babd[_0x43fa('0x43')][_0x43fa('0x53')]){_0x3994a9[_0x43fa('0x54')]=[{'model':db['CmContact'],'as':_0x43fa('0xb1'),'required':![]},{'model':db['User'],'as':_0x43fa('0xb2'),'attributes':[_0x43fa('0x3a'),_0x43fa('0xb3'),'internal'],'required':![]},{'model':db[_0x43fa('0xb4')],'as':_0x43fa('0xb5'),'attributes':['id','name',_0x43fa('0xb6')],'where':_0x20babd[_0x43fa('0x43')][_0x43fa('0xb7')]?{'id':_0x20babd[_0x43fa('0x43')][_0x43fa('0xb7')]}:undefined,'required':_0x20babd['query'][_0x43fa('0xb7')]?!![]:![]}];}return db[_0x43fa('0x8e')][_0x43fa('0x55')](_0x3994a9);})['then'](function(_0x111ce3){_0x24e4fb[_0x43fa('0x69')]=_0x111ce3;return _0x24e4fb;});}})[_0x43fa('0x38')](respondWithFilteredResult(_0x181ee4,_0x3994a9))[_0x43fa('0x26')](handleError(_0x181ee4,null));};exports[_0x43fa('0xb8')]=function(_0x5c345f,_0x51cc4c,_0x5ec132){return db[_0x43fa('0x52')][_0x43fa('0x5e')]({'where':{'id':_0x5c345f[_0x43fa('0x57')]['id']}})['then'](handleEntityNotFound(_0x51cc4c,null))['then'](function(_0x1268a5){if(_0x1268a5){return _0x1268a5[_0x43fa('0xb8')](_0x5c345f[_0x43fa('0x5b')][_0x43fa('0x6b')],_['omit'](_0x5c345f[_0x43fa('0x5b')],[_0x43fa('0x6b'),'id'])||{})['spread'](function(_0x28996b){for(var _0x5d0b38=0x0;_0x5d0b38<_0x5c345f[_0x43fa('0x5b')]['ids'][_0x43fa('0x59')];_0x5d0b38+=0x1){socket[_0x43fa('0xb9')]('userOpenchannelAccount:save',{'UserId':Number(_0x5c345f['body'][_0x43fa('0x6b')][_0x5d0b38]),'OpenchannelAccountId':Number(_0x5c345f[_0x43fa('0x57')]['id'])});}return _0x28996b;});}})[_0x43fa('0x38')](respondWithResult(_0x51cc4c,null))[_0x43fa('0x26')](handleError(_0x51cc4c,null));};exports[_0x43fa('0xba')]=function(_0x4517e2,_0x1fb67d,_0xfabbc0){return db[_0x43fa('0x52')][_0x43fa('0x5e')]({'where':{'id':_0x4517e2[_0x43fa('0x57')]['id']}})['then'](handleEntityNotFound(_0x1fb67d,null))['then'](function(_0x243c9f){if(_0x243c9f){return _0x243c9f[_0x43fa('0xba')](_0x4517e2[_0x43fa('0x43')][_0x43fa('0x6b')])[_0x43fa('0x38')](function(){if(_[_0x43fa('0xbb')](_0x4517e2[_0x43fa('0x43')][_0x43fa('0x6b')])){for(var _0x172bbd=0x0;_0x172bbd<_0x4517e2['query'][_0x43fa('0x6b')]['length'];_0x172bbd+=0x1){socket['emit'](_0x43fa('0xbc'),{'UserId':Number(_0x4517e2['query'][_0x43fa('0x6b')][_0x172bbd]),'OpenchannelAccountId':Number(_0x4517e2[_0x43fa('0x57')]['id'])});}}else{socket[_0x43fa('0xb9')](_0x43fa('0xbc'),{'UserId':Number(_0x4517e2[_0x43fa('0x43')][_0x43fa('0x6b')]),'OpenchannelAccountId':Number(_0x4517e2[_0x43fa('0x57')]['id'])});}});}})[_0x43fa('0x38')](respondWithStatusCode(_0x1fb67d,null))[_0x43fa('0x26')](handleError(_0x1fb67d,null));};exports[_0x43fa('0xbd')]=function(_0x5ae5c1,_0x94ac58,_0x235f0e){var _0x3c89f2={};var _0x95c47={};var _0x56a135;var _0x1efd04;return db[_0x43fa('0x52')][_0x43fa('0x66')]({'where':{'id':_0x5ae5c1['params']['id']}})[_0x43fa('0x38')](handleEntityNotFound(_0x94ac58,null))[_0x43fa('0x38')](function(_0x2e5b74){if(_0x2e5b74){_0x56a135=_0x2e5b74;_0x95c47[_0x43fa('0x40')]=_[_0x43fa('0x42')](db[_0x43fa('0x9c')][_0x43fa('0x58')]);_0x95c47[_0x43fa('0x43')]=_[_0x43fa('0x42')](_0x5ae5c1[_0x43fa('0x43')]);_0x95c47[_0x43fa('0x4c')]=_['intersection'](_0x95c47['model'],_0x95c47[_0x43fa('0x43')]);_0x3c89f2[_0x43fa('0x44')]=_[_0x43fa('0x45')](_0x95c47['model'],qs[_0x43fa('0x46')](_0x5ae5c1[_0x43fa('0x43')][_0x43fa('0x46')]));_0x3c89f2['attributes']=_0x3c89f2[_0x43fa('0x44')][_0x43fa('0x59')]?_0x3c89f2[_0x43fa('0x44')]:_0x95c47[_0x43fa('0x40')];_0x3c89f2[_0x43fa('0x49')]=qs['sort'](_0x5ae5c1['query'][_0x43fa('0x4a')]);_0x3c89f2[_0x43fa('0x4b')]=qs[_0x43fa('0x4c')](_['pick'](_0x5ae5c1[_0x43fa('0x43')],_0x95c47[_0x43fa('0x4c')]));if(_0x5ae5c1['query']['filter']){_0x3c89f2[_0x43fa('0x4b')]=_[_0x43fa('0x4e')](_0x3c89f2['where'],{'$or':_['map'](_0x3c89f2[_0x43fa('0x44')],function(_0x4941e5){var _0x1d3b9b={};_0x1d3b9b[_0x4941e5]={'$like':'%'+_0x5ae5c1[_0x43fa('0x43')][_0x43fa('0x4d')]+'%'};return _0x1d3b9b;})});}_0x3c89f2=_[_0x43fa('0x4e')]({},_0x3c89f2,_0x5ae5c1[_0x43fa('0x51')]);return _0x56a135[_0x43fa('0xbd')](_0x3c89f2);}})[_0x43fa('0x38')](function(_0x28e255){if(_0x28e255){_0x1efd04=_0x28e255[_0x43fa('0x59')];if(!_0x5ae5c1[_0x43fa('0x43')]['hasOwnProperty'](_0x43fa('0x48'))){_0x3c89f2[_0x43fa('0x2d')]=qs['limit'](_0x5ae5c1[_0x43fa('0x43')][_0x43fa('0x2d')]);_0x3c89f2[_0x43fa('0x2b')]=qs[_0x43fa('0x2b')](_0x5ae5c1[_0x43fa('0x43')][_0x43fa('0x2b')]);}return _0x56a135[_0x43fa('0xbd')](_0x3c89f2);}})[_0x43fa('0x38')](function(_0x7779a6){if(_0x7779a6){return _0x7779a6?{'count':_0x1efd04,'rows':_0x7779a6}:null;}})[_0x43fa('0x38')](respondWithResult(_0x94ac58,null))[_0x43fa('0x26')](handleError(_0x94ac58,null));};exports['send']=function(_0x4722f8,_0x36762a,_0x59c287){var _0x52f7cd,_0x1facd1,_0x32281c;if(_[_0x43fa('0x7a')](_0x4722f8['body'][_0x43fa('0x5b')])||_0x4722f8[_0x43fa('0x5b')][_0x43fa('0x5b')]===''){throw new db['Sequelize'][(_0x43fa('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x43fa('0x7a')](_0x4722f8[_0x43fa('0x5b')]['to'])){}_0x52f7cd=_0x4722f8[_0x43fa('0x5b')]['to'];return db[_0x43fa('0x52')]['findOne']({'where':{'id':_0x4722f8[_0x43fa('0x57')]['id']}})['then'](handleEntityNotFound(_0x36762a,null))[_0x43fa('0x38')](function(_0x4aa708){if(_0x4aa708){return db[_0x43fa('0x52')][_0x43fa('0x5e')]({'where':{'id':_0x4aa708['id']},'include':[{'model':db[_0x43fa('0x80')],'as':_0x43fa('0x81'),'include':[{'model':db[_0x43fa('0x70')],'as':_0x43fa('0x82'),'where':{[_0x4aa708[_0x43fa('0x7e')]]:_0x52f7cd},'limit':0x1,'order':[[_0x43fa('0x75'),'DESC']]}]}]})[_0x43fa('0x38')](handleEntityNotFound(_0x36762a,null))[_0x43fa('0x38')](function(_0x3837c1){if(_0x3837c1&&_0x3837c1[_0x43fa('0x81')]){_0x1facd1=_0x3837c1[_0x43fa('0x36')]({'plain':!![]});if(_0x1facd1[_0x43fa('0x81')]&&_0x1facd1[_0x43fa('0x81')][_0x43fa('0x82')][_0x43fa('0x59')]){return _0x1facd1[_0x43fa('0x81')][_0x43fa('0x82')][0x0];}return db['CmContact'][_0x43fa('0x5a')](_[_0x43fa('0x18')](_0x4722f8[_0x43fa('0x5b')],{'firstName':_0x52f7cd,[_0x3837c1[_0x43fa('0x7e')]]:_0x52f7cd,'phone':_0x52f7cd,'ListId':_0x1facd1[_0x43fa('0x77')]}));}})[_0x43fa('0x38')](handleEntityNotFound(_0x36762a,null))[_0x43fa('0x38')](function(_0x2270f0){if(_0x2270f0){_0x32281c=_0x2270f0;return db[_0x43fa('0x8e')][_0x43fa('0x5e')]({'where':{'ContactId':_0x32281c['id'],'closed':![],'OpenchannelAccountId':_0x1facd1['id']}})['then'](function(_0x1001c2){if(_0x1001c2){return[_0x1001c2,![]];}return db['OpenchannelInteraction'][_0x43fa('0x5a')]({'UserId':_0x4722f8[_0x43fa('0x5d')]['id'],'ContactId':_0x32281c['id'],'OpenchannelAccountId':_0x1facd1['id'],'lastMsgDirection':_0x43fa('0xbe'),'firstMsgDirection':_0x43fa('0xbe'),'Messages':[_[_0x43fa('0x4e')](_0x4722f8[_0x43fa('0x5b')],{'read':![],'body':_0x4722f8[_0x43fa('0x5b')]['body'],'OpenchannelAccountId':_0x1facd1['id'],'UserId':_0x4722f8[_0x43fa('0x5d')]['id'],'ContactId':_0x32281c['id']})]},{'include':[{'model':db[_0x43fa('0x9a')],'as':_0x43fa('0xbf')}]})[_0x43fa('0x38')](function(_0x43dd23){return[_0x43dd23,!![]];});});}})['spread'](function(_0x396394,_0x49208c){if(_0x49208c){return _0x396394;}return db[_0x43fa('0x9a')][_0x43fa('0x5a')](_[_0x43fa('0x4e')](_0x4722f8[_0x43fa('0x5b')],{'read':![],'body':_0x4722f8['body'][_0x43fa('0x5b')],'OpenchannelAccountId':_0x1facd1['id'],'OpenchannelInteractionId':_0x396394['id'],'UserId':_0x4722f8[_0x43fa('0x5d')]['id'],'ContactId':_0x32281c['id']}))[_0x43fa('0x38')](function(_0x592ca1){_0x396394[_0x43fa('0xc0')][_0x43fa('0xbf')]=[];_0x396394['dataValues']['Messages'][_0x43fa('0x97')](_0x592ca1[_0x43fa('0xc0')]);return _0x396394;});});}})[_0x43fa('0x38')](respondWithResult(_0x36762a,null))[_0x43fa('0x26')](handleError(_0x36762a,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index e14fc37..4e8bc3d 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 _0x9c44=['save','update','remove','emit','hasOwnProperty','hook','exports','OpenchannelAccount','setMaxListeners'];(function(_0x5973ed,_0x318d43){var _0x36fa18=function(_0x3007bf){while(--_0x3007bf){_0x5973ed['push'](_0x5973ed['shift']());}};_0x36fa18(++_0x318d43);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x49c4('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x49c4('0x1')](0x0);var events={'afterCreate':_0x49c4('0x2'),'afterUpdate':_0x49c4('0x3'),'afterDestroy':_0x49c4('0x4')};function emitEvent(_0x2ad237){return function(_0x4e0313,_0x4941f1,_0x41a183){OpenchannelAccountEvents['emit'](_0x2ad237+':'+_0x4e0313['id'],_0x4e0313);OpenchannelAccountEvents[_0x49c4('0x5')](_0x2ad237,_0x4e0313);_0x41a183(null);};}for(var e in events){if(events[_0x49c4('0x6')](e)){var event=events[e];OpenchannelAccount[_0x49c4('0x7')](e,emitEvent(event));}}module[_0x49c4('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x99e9=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x47ea98,_0x2decc8){var _0x2d9382=function(_0x39bd6b){while(--_0x39bd6b){_0x47ea98['push'](_0x47ea98['shift']());}};_0x2d9382(++_0x2decc8);}(_0x99e9,0xb4));var _0x999e=function(_0x282f9a,_0x63dff){_0x282f9a=_0x282f9a-0x0;var _0x52528c=_0x99e9[_0x282f9a];return _0x52528c;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x999e('0x0'))['db'][_0x999e('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x999e('0x2')](0x0);var events={'afterCreate':_0x999e('0x3'),'afterUpdate':'update','afterDestroy':_0x999e('0x4')};function emitEvent(_0x2f803e){return function(_0x3aac27,_0x4e2112,_0x296411){OpenchannelAccountEvents['emit'](_0x2f803e+':'+_0x3aac27['id'],_0x3aac27);OpenchannelAccountEvents[_0x999e('0x5')](_0x2f803e,_0x3aac27);_0x296411(null);};}for(var e in events){if(events[_0x999e('0x6')](e)){var event=events[e];OpenchannelAccount[_0x999e('0x7')](e,emitEvent(event));}}module[_0x999e('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 5c44366..1ebce09 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(_0x3e87ba,_0x2e73b2){var _0x338874=function(_0x15708c){while(--_0x15708c){_0x3e87ba['push'](_0x3e87ba['shift']());}};_0x338874(++_0x2e73b2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x4744c9,_0x1a2d6e){var _0x1a5d9a=function(_0x392430){while(--_0x392430){_0x4744c9['push'](_0x4744c9['shift']());}};_0x1a5d9a(++_0x1a2d6e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 40aeda8..c5d8a3d 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 _0xb9a7=['catch','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0xebf26c,_0x2dd928){var _0x14c318=function(_0x3e6c71){while(--_0x3e6c71){_0xebf26c['push'](_0xebf26c['shift']());}};_0x14c318(++_0x2dd928);}(_0xb9a7,0x112));var _0x7b9a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xb9a7[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b9a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b9a('0x2'));var logger=require(_0x7b9a('0x3'))(_0x7b9a('0x4'));var config=require(_0x7b9a('0x5'));var jayson=require(_0x7b9a('0x6'));var client=jayson[_0x7b9a('0x7')][_0x7b9a('0x8')]({'port':0x232a});config[_0x7b9a('0x9')]=_[_0x7b9a('0xa')](config[_0x7b9a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x7b9a('0xb'))(new Redis(config[_0x7b9a('0x9')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x47e220,_0x15bc5b,_0x31f3b7){return new BPromise(function(_0x4cf090,_0x32c85d){return client['request'](_0x47e220,_0x31f3b7)[_0x7b9a('0xc')](function(_0x597732){logger[_0x7b9a('0xd')](_0x7b9a('0xe'),_0x15bc5b,_0x7b9a('0xf'));logger['debug'](_0x7b9a('0x10'),_0x15bc5b,_0x7b9a('0xf'),JSON['stringify'](_0x597732));if(_0x597732[_0x7b9a('0x11')]){if(_0x597732[_0x7b9a('0x11')]['code']===0x1f4){logger[_0x7b9a('0x11')](_0x7b9a('0xe'),_0x15bc5b,_0x597732[_0x7b9a('0x11')][_0x7b9a('0x12')]);return _0x32c85d(_0x597732[_0x7b9a('0x11')][_0x7b9a('0x12')]);}logger[_0x7b9a('0x11')](_0x7b9a('0xe'),_0x15bc5b,_0x597732[_0x7b9a('0x11')]['message']);return _0x4cf090(_0x597732[_0x7b9a('0x11')]['message']);}else{logger[_0x7b9a('0xd')](_0x7b9a('0xe'),_0x15bc5b,_0x7b9a('0xf'));_0x4cf090(_0x597732[_0x7b9a('0x13')][_0x7b9a('0x12')]);}})[_0x7b9a('0x14')](function(_0x27ad55){logger[_0x7b9a('0x11')](_0x7b9a('0xe'),_0x15bc5b,_0x27ad55);_0x32c85d(_0x27ad55);});});} \ No newline at end of file +var _0x5ec6=['stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','defaults','redis','socket.io-emitter','./openchannelAccount.socket','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0x5ec6,0x7f));var _0x65ec=function(_0x87077e,_0x1c921f){_0x87077e=_0x87077e-0x0;var _0x28f8c4=_0x5ec6[_0x87077e];return _0x28f8c4;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var moment=require(_0x65ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x65ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65ec('0x5'))('rpc');var config=require(_0x65ec('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x65ec('0x7')][_0x65ec('0x8')]({'port':0x232a});config['redis']=_[_0x65ec('0x9')](config[_0x65ec('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x65ec('0xb'))(new Redis(config[_0x65ec('0xa')]));require(_0x65ec('0xc'))['register'](socket);function respondWithRpcPromise(_0x49aacd,_0x3cf126,_0x5e78f8){return new BPromise(function(_0x136928,_0x28fe68){return client['request'](_0x49aacd,_0x5e78f8)[_0x65ec('0xd')](function(_0xd7cf80){logger['info'](_0x65ec('0xe'),_0x3cf126,_0x65ec('0xf'));logger['debug'](_0x65ec('0x10'),_0x3cf126,_0x65ec('0xf'),JSON[_0x65ec('0x11')](_0xd7cf80));if(_0xd7cf80[_0x65ec('0x12')]){if(_0xd7cf80[_0x65ec('0x12')][_0x65ec('0x13')]===0x1f4){logger[_0x65ec('0x12')](_0x65ec('0xe'),_0x3cf126,_0xd7cf80['error'][_0x65ec('0x14')]);return _0x28fe68(_0xd7cf80[_0x65ec('0x12')][_0x65ec('0x14')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x3cf126,_0xd7cf80[_0x65ec('0x12')][_0x65ec('0x14')]);return _0x136928(_0xd7cf80[_0x65ec('0x12')]['message']);}else{logger[_0x65ec('0x15')](_0x65ec('0xe'),_0x3cf126,_0x65ec('0xf'));_0x136928(_0xd7cf80[_0x65ec('0x16')][_0x65ec('0x14')]);}})[_0x65ec('0x17')](function(_0x37c494){logger[_0x65ec('0x12')](_0x65ec('0xe'),_0x3cf126,_0x37c494);_0x28fe68(_0x37c494);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 49838fa..eae44fc 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 _0x99e9=['update','emit','removeListener','length','openchannelAccount:','save','remove'];(function(_0x1ffd67,_0x1c18ba){var _0xce170f=function(_0x16cdb2){while(--_0x16cdb2){_0x1ffd67['push'](_0x1ffd67['shift']());}};_0xce170f(++_0x1c18ba);}(_0x99e9,0xb4));var _0x999e=function(_0x5dbb84,_0x1bbce9){_0x5dbb84=_0x5dbb84-0x0;var _0x1d6eae=_0x99e9[_0x5dbb84];return _0x1d6eae;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x999e('0x0'),_0x999e('0x1'),_0x999e('0x2')];function createListener(_0x1c6fa0,_0x4aaeb4){return function(_0x19a818){_0x4aaeb4[_0x999e('0x3')](_0x1c6fa0,_0x19a818);};}function removeListener(_0x3aac27,_0x4e2112){return function(){OpenchannelAccountEvents[_0x999e('0x4')](_0x3aac27,_0x4e2112);};}exports['register']=function(_0x25421f){for(var _0x1bda0a=0x0,_0x100330=events[_0x999e('0x5')];_0x1bda0a<_0x100330;_0x1bda0a++){var _0x5c1c17=events[_0x1bda0a];var _0x46aeae=createListener(_0x999e('0x6')+_0x5c1c17,_0x25421f);OpenchannelAccountEvents['on'](_0x5c1c17,_0x46aeae);}}; \ No newline at end of file +var _0xb575=['openchannelAccount:','./openchannelAccount.events','save','update','emit','removeListener','register'];(function(_0x1a1cd2,_0x849e45){var _0x7c3a03=function(_0x29daee){while(--_0x29daee){_0x1a1cd2['push'](_0x1a1cd2['shift']());}};_0x7c3a03(++_0x849e45);}(_0xb575,0xda));var _0x5b57=function(_0x139e29,_0x4e1c87){_0x139e29=_0x139e29-0x0;var _0x409da1=_0xb575[_0x139e29];return _0x409da1;};'use strict';var OpenchannelAccountEvents=require(_0x5b57('0x0'));var events=[_0x5b57('0x1'),'remove',_0x5b57('0x2')];function createListener(_0x4c5b3f,_0x4a644c){return function(_0x585c94){_0x4a644c[_0x5b57('0x3')](_0x4c5b3f,_0x585c94);};}function removeListener(_0x34ae8e,_0x4b91c3){return function(){OpenchannelAccountEvents[_0x5b57('0x4')](_0x34ae8e,_0x4b91c3);};}exports[_0x5b57('0x5')]=function(_0x501a91){for(var _0x542b77=0x0,_0x672beb=events['length'];_0x542b77<_0x672beb;_0x542b77++){var _0x4232d0=events[_0x542b77];var _0x5dd0c7=createListener(_0x5b57('0x6')+_0x4232d0,_0x501a91);OpenchannelAccountEvents['on'](_0x4232d0,_0x5dd0c7);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 35cd91b..4785e3b 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 _0x331e=['put','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x12fe88,_0x360449){var _0x29c9a9=function(_0x4e6371){while(--_0x4e6371){_0x12fe88['push'](_0x12fe88['shift']());}};_0x29c9a9(++_0x360449);}(_0x331e,0x76));var _0xe331=function(_0x407e38,_0x30e1cb){_0x407e38=_0x407e38-0x0;var _0x996a91=_0x331e[_0x407e38];return _0x996a91;};'use strict';var multer=require(_0xe331('0x0'));var util=require('util');var path=require(_0xe331('0x1'));var timeout=require(_0xe331('0x2'));var express=require('express');var router=express[_0xe331('0x3')]();var fs_extra=require(_0xe331('0x4'));var auth=require(_0xe331('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe331('0x6'));var controller=require(_0xe331('0x7'));router[_0xe331('0x8')]('/',auth[_0xe331('0x9')](),controller[_0xe331('0xa')]);router[_0xe331('0x8')](_0xe331('0xb'),auth[_0xe331('0x9')](),controller[_0xe331('0xc')]);router[_0xe331('0xd')]('/',auth[_0xe331('0x9')](),controller[_0xe331('0xe')]);router[_0xe331('0xf')](_0xe331('0xb'),auth[_0xe331('0x9')](),controller[_0xe331('0x10')]);router['delete']('/:id',auth[_0xe331('0x9')](),controller[_0xe331('0x11')]);module[_0xe331('0x12')]=router; \ No newline at end of file +var _0xb889=['index','/:id','isAuthenticated','show','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelApplication.controller','get'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0xb889,0x1f4));var _0x9b88=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xb889[_0x2db12b];return _0x20990b;};'use strict';var multer=require(_0x9b88('0x0'));var util=require(_0x9b88('0x1'));var path=require(_0x9b88('0x2'));var timeout=require(_0x9b88('0x3'));var express=require(_0x9b88('0x4'));var router=express[_0x9b88('0x5')]();var fs_extra=require(_0x9b88('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9b88('0x7'));var config=require('../../config/environment');var controller=require(_0x9b88('0x8'));router[_0x9b88('0x9')]('/',auth['isAuthenticated'](),controller[_0x9b88('0xa')]);router['get'](_0x9b88('0xb'),auth[_0x9b88('0xc')](),controller[_0x9b88('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9b88('0xb'),auth[_0x9b88('0xc')](),controller['update']);router[_0x9b88('0xe')](_0x9b88('0xb'),auth[_0x9b88('0xc')](),controller[_0x9b88('0xf')]);module[_0x9b88('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 994fa83..90bbe85 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 _0xbf92=['sequelize','exports','INTEGER','TEXT','STRING','*,*,*,*'];(function(_0x1e58fe,_0x3665ed){var _0x1521ea=function(_0x221835){while(--_0x221835){_0x1e58fe['push'](_0x1e58fe['shift']());}};_0x1521ea(++_0x3665ed);}(_0xbf92,0x96));var _0x2bf9=function(_0x489e9f,_0x4723f3){_0x489e9f=_0x489e9f-0x0;var _0x5a1086=_0xbf92[_0x489e9f];return _0x5a1086;};'use strict';var Sequelize=require(_0x2bf9('0x0'));module[_0x2bf9('0x1')]={'priority':{'type':Sequelize[_0x2bf9('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2bf9('0x3')]()},'description':{'type':Sequelize[_0x2bf9('0x4')]},'interval':{'type':Sequelize[_0x2bf9('0x4')],'defaultValue':_0x2bf9('0x5')}}; \ No newline at end of file +var _0x5346=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5346,0x1a7));var _0x6534=function(_0x3f47ce,_0x26fd51){_0x3f47ce=_0x3f47ce-0x0;var _0x2eb156=_0x5346[_0x3f47ce];return _0x2eb156;};'use strict';var Sequelize=require(_0x6534('0x0'));module[_0x6534('0x1')]={'priority':{'type':Sequelize[_0x6534('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6534('0x3')],'allowNull':![],'defaultValue':_0x6534('0x4')},'appdata':{'type':Sequelize[_0x6534('0x5')]()},'description':{'type':Sequelize[_0x6534('0x3')]},'interval':{'type':Sequelize[_0x6534('0x3')],'defaultValue':_0x6534('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 4218200..6685903 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 _0xc4fe=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','end','stack','index','map','OpenchannelApplication','fieldName','type','key','model','name','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','update','params','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv'];(function(_0xed5729,_0x4979b1){var _0x4607e4=function(_0x2d77e2){while(--_0x2d77e2){_0xed5729['push'](_0xed5729['shift']());}};_0x4607e4(++_0x4979b1);}(_0xc4fe,0x11c));var _0xec4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec4f('0x0'));var zipdir=require(_0xec4f('0x1'));var jsonpatch=require(_0xec4f('0x2'));var rp=require(_0xec4f('0x3'));var moment=require(_0xec4f('0x4'));var BPromise=require(_0xec4f('0x5'));var Mustache=require(_0xec4f('0x6'));var util=require(_0xec4f('0x7'));var path=require(_0xec4f('0x8'));var sox=require(_0xec4f('0x9'));var csv=require('to-csv');var ejs=require(_0xec4f('0xa'));var fs=require('fs');var fs_extra=require(_0xec4f('0xb'));var _=require(_0xec4f('0xc'));var squel=require(_0xec4f('0xd'));var crypto=require(_0xec4f('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xec4f('0xf'));var querystring=require(_0xec4f('0x10'));var Papa=require(_0xec4f('0x11'));var Redis=require(_0xec4f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xec4f('0x13'));var as=require(_0xec4f('0x14'));var hardwareService=require(_0xec4f('0x15'));var logger=require('../../config/logger')(_0xec4f('0x16'));var utils=require(_0xec4f('0x17'));var config=require(_0xec4f('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d1642,_0xf23894){_0xf23894=_0xf23894||0xcc;return function(_0x23908a){if(_0x23908a){return _0x3d1642[_0xec4f('0x19')](_0xf23894);}return _0x3d1642[_0xec4f('0x1a')](_0xf23894)['end']();};}function respondWithResult(_0x2edbc8,_0x199c19){_0x199c19=_0x199c19||0xc8;return function(_0x1ec4d3){if(_0x1ec4d3){return _0x2edbc8[_0xec4f('0x1a')](_0x199c19)[_0xec4f('0x1b')](_0x1ec4d3);}};}function respondWithFilteredResult(_0x17b5fd,_0x51000c){return function(_0x38353d){if(_0x38353d){var _0x4b8322=typeof _0x51000c[_0xec4f('0x1c')]===_0xec4f('0x1d')&&typeof _0x51000c[_0xec4f('0x1e')]===_0xec4f('0x1d');var _0x2ae9a9=_0x38353d[_0xec4f('0x1f')];var _0x762e57=_0x4b8322?0x0:_0x51000c['offset'];var _0x4b6ed2=_0x4b8322?_0x38353d[_0xec4f('0x1f')]:_0x51000c[_0xec4f('0x1c')]+_0x51000c[_0xec4f('0x1e')];var _0x32e4c9;if(_0x4b6ed2>=_0x2ae9a9){_0x4b6ed2=_0x2ae9a9;_0x32e4c9=0xc8;}else{_0x32e4c9=0xce;}_0x17b5fd[_0xec4f('0x1a')](_0x32e4c9);return _0x17b5fd[_0xec4f('0x20')](_0xec4f('0x21'),_0x762e57+'-'+_0x4b6ed2+'/'+_0x2ae9a9)[_0xec4f('0x1b')](_0x38353d);}return null;};}function patchUpdates(_0x4c7a15){return function(_0x2a51a0){try{jsonpatch[_0xec4f('0x22')](_0x2a51a0,_0x4c7a15,!![]);}catch(_0x1dd952){return BPromise['reject'](_0x1dd952);}return _0x2a51a0['save']();};}function saveUpdates(_0x19a4ed,_0x46ef0c){return function(_0x230ef2){if(_0x230ef2){return _0x230ef2['update'](_0x19a4ed)[_0xec4f('0x23')](function(_0xa0d514){return _0xa0d514;});}return null;};}function removeEntity(_0x3e3c6f,_0xccd0ae){return function(_0x432fae){if(_0x432fae){return _0x432fae[_0xec4f('0x24')]()[_0xec4f('0x23')](function(){_0x3e3c6f[_0xec4f('0x1a')](0xcc)[_0xec4f('0x25')]();});}};}function handleEntityNotFound(_0x5ad001,_0x123f4f){return function(_0x4d71e2){if(!_0x4d71e2){_0x5ad001[_0xec4f('0x19')](0x194);}return _0x4d71e2;};}function handleError(_0x25778e,_0x41b9f4){_0x41b9f4=_0x41b9f4||0x1f4;return function(_0x374789){logger['error'](_0x374789[_0xec4f('0x26')]);if(_0x374789['name']){delete _0x374789['name'];}_0x25778e[_0xec4f('0x1a')](_0x41b9f4)['send'](_0x374789);};}exports[_0xec4f('0x27')]=function(_0x1639a4,_0x2f31cf){var _0x1c1249={},_0x5ce542={},_0x1af181={'count':0x0,'rows':[]};var _0x3c2f06=_[_0xec4f('0x28')](db[_0xec4f('0x29')]['rawAttributes'],function(_0x5985f4){return{'name':_0x5985f4[_0xec4f('0x2a')],'type':_0x5985f4[_0xec4f('0x2b')][_0xec4f('0x2c')]};});_0x5ce542[_0xec4f('0x2d')]=_[_0xec4f('0x28')](_0x3c2f06,_0xec4f('0x2e'));_0x5ce542[_0xec4f('0x2f')]=_[_0xec4f('0x30')](_0x1639a4[_0xec4f('0x2f')]);_0x5ce542[_0xec4f('0x31')]=_[_0xec4f('0x32')](_0x5ce542[_0xec4f('0x2d')],_0x5ce542[_0xec4f('0x2f')]);_0x1c1249['attributes']=_['intersection'](_0x5ce542[_0xec4f('0x2d')],qs[_0xec4f('0x33')](_0x1639a4[_0xec4f('0x2f')][_0xec4f('0x33')]));_0x1c1249['attributes']=_0x1c1249['attributes'][_0xec4f('0x34')]?_0x1c1249[_0xec4f('0x35')]:_0x5ce542[_0xec4f('0x2d')];if(!_0x1639a4[_0xec4f('0x2f')][_0xec4f('0x36')]('nolimit')){_0x1c1249[_0xec4f('0x1e')]=qs[_0xec4f('0x1e')](_0x1639a4[_0xec4f('0x2f')][_0xec4f('0x1e')]);_0x1c1249[_0xec4f('0x1c')]=qs[_0xec4f('0x1c')](_0x1639a4[_0xec4f('0x2f')][_0xec4f('0x1c')]);}_0x1c1249[_0xec4f('0x37')]=qs[_0xec4f('0x38')](_0x1639a4[_0xec4f('0x2f')][_0xec4f('0x38')]);_0x1c1249[_0xec4f('0x39')]=qs[_0xec4f('0x31')](_[_0xec4f('0x3a')](_0x1639a4[_0xec4f('0x2f')],_0x5ce542[_0xec4f('0x31')]),_0x3c2f06);if(_0x1639a4['query'][_0xec4f('0x3b')]){_0x1c1249[_0xec4f('0x39')]=_[_0xec4f('0x3c')](_0x1c1249['where'],{'$or':_[_0xec4f('0x28')](_0x3c2f06,function(_0x13d9af){if(_0x13d9af[_0xec4f('0x2b')]!==_0xec4f('0x3d')){var _0x288e6d={};_0x288e6d[_0x13d9af[_0xec4f('0x2e')]]={'$like':'%'+_0x1639a4['query']['filter']+'%'};return _0x288e6d;}})});}_0x1c1249=_[_0xec4f('0x3c')]({},_0x1c1249,_0x1639a4[_0xec4f('0x3e')]);var _0x50fcc2={'where':_0x1c1249[_0xec4f('0x39')]};return db['OpenchannelApplication'][_0xec4f('0x1f')](_0x50fcc2)['then'](function(_0x16ebed){_0x1af181['count']=_0x16ebed;if(_0x1639a4[_0xec4f('0x2f')][_0xec4f('0x3f')]){_0x1c1249[_0xec4f('0x40')]=[{'all':!![]}];}return db[_0xec4f('0x29')][_0xec4f('0x41')](_0x1c1249);})['then'](function(_0x43ead5){_0x1af181[_0xec4f('0x42')]=_0x43ead5;return _0x1af181;})[_0xec4f('0x23')](respondWithFilteredResult(_0x2f31cf,_0x1c1249))[_0xec4f('0x43')](handleError(_0x2f31cf,null));};exports[_0xec4f('0x44')]=function(_0x35b3c2,_0x47f19b){var _0x2490a4={'raw':!![],'where':{'id':_0x35b3c2['params']['id']}},_0x16d3ee={};_0x16d3ee[_0xec4f('0x2d')]=_[_0xec4f('0x30')](db[_0xec4f('0x29')][_0xec4f('0x45')]);_0x16d3ee[_0xec4f('0x2f')]=_[_0xec4f('0x30')](_0x35b3c2[_0xec4f('0x2f')]);_0x16d3ee[_0xec4f('0x31')]=_[_0xec4f('0x32')](_0x16d3ee[_0xec4f('0x2d')],_0x16d3ee[_0xec4f('0x2f')]);_0x2490a4[_0xec4f('0x35')]=_[_0xec4f('0x32')](_0x16d3ee[_0xec4f('0x2d')],qs[_0xec4f('0x33')](_0x35b3c2[_0xec4f('0x2f')][_0xec4f('0x33')]));_0x2490a4['attributes']=_0x2490a4['attributes']['length']?_0x2490a4[_0xec4f('0x35')]:_0x16d3ee[_0xec4f('0x2d')];if(_0x35b3c2[_0xec4f('0x2f')][_0xec4f('0x3f')]){_0x2490a4[_0xec4f('0x40')]=[{'all':!![]}];}_0x2490a4=_['merge']({},_0x2490a4,_0x35b3c2[_0xec4f('0x3e')]);return db[_0xec4f('0x29')]['find'](_0x2490a4)[_0xec4f('0x23')](handleEntityNotFound(_0x47f19b,null))[_0xec4f('0x23')](respondWithResult(_0x47f19b,null))['catch'](handleError(_0x47f19b,null));};exports[_0xec4f('0x46')]=function(_0x3b169a,_0x30dcd8){return db[_0xec4f('0x29')][_0xec4f('0x46')](_0x3b169a[_0xec4f('0x47')],{})[_0xec4f('0x23')](respondWithResult(_0x30dcd8,0xc9))[_0xec4f('0x43')](handleError(_0x30dcd8,null));};exports[_0xec4f('0x48')]=function(_0x5ecfaa,_0xa9bb60){if(_0x5ecfaa[_0xec4f('0x47')]['id']){delete _0x5ecfaa[_0xec4f('0x47')]['id'];}return db[_0xec4f('0x29')]['find']({'where':{'id':_0x5ecfaa[_0xec4f('0x49')]['id']}})['then'](handleEntityNotFound(_0xa9bb60,null))[_0xec4f('0x23')](saveUpdates(_0x5ecfaa[_0xec4f('0x47')],null))[_0xec4f('0x23')](respondWithResult(_0xa9bb60,null))[_0xec4f('0x43')](handleError(_0xa9bb60,null));};exports[_0xec4f('0x24')]=function(_0x2abf5a,_0x5e4648){return db[_0xec4f('0x29')][_0xec4f('0x4a')]({'where':{'id':_0x2abf5a[_0xec4f('0x49')]['id']}})[_0xec4f('0x23')](handleEntityNotFound(_0x5e4648,null))[_0xec4f('0x23')](removeEntity(_0x5e4648,null))[_0xec4f('0x43')](handleError(_0x5e4648,null));}; \ No newline at end of file +var _0x454e=['sort','where','filters','filter','VIRTUAL','includeAll','rows','catch','show','params','keys','fields','include','merge','options','create','body','find','destroy','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/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','set','json','apply','save','update','then','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','type','model','query','intersection','attributes','hasOwnProperty','nolimit','limit','order'];(function(_0x2fda7f,_0x5c6cf9){var _0x3ce5fe=function(_0x52b27e){while(--_0x52b27e){_0x2fda7f['push'](_0x2fda7f['shift']());}};_0x3ce5fe(++_0x5c6cf9);}(_0x454e,0xa9));var _0xe454=function(_0x4ddfc1,_0x5d1d15){_0x4ddfc1=_0x4ddfc1-0x0;var _0x5c9ad6=_0x454e[_0x4ddfc1];return _0x5c9ad6;};'use strict';var emlformat=require(_0xe454('0x0'));var rimraf=require(_0xe454('0x1'));var zipdir=require(_0xe454('0x2'));var jsonpatch=require(_0xe454('0x3'));var rp=require(_0xe454('0x4'));var moment=require(_0xe454('0x5'));var BPromise=require(_0xe454('0x6'));var Mustache=require(_0xe454('0x7'));var util=require('util');var path=require(_0xe454('0x8'));var sox=require(_0xe454('0x9'));var csv=require(_0xe454('0xa'));var ejs=require(_0xe454('0xb'));var fs=require('fs');var fs_extra=require(_0xe454('0xc'));var _=require(_0xe454('0xd'));var squel=require(_0xe454('0xe'));var crypto=require(_0xe454('0xf'));var jsforce=require(_0xe454('0x10'));var deskjs=require(_0xe454('0x11'));var toCsv=require(_0xe454('0xa'));var querystring=require(_0xe454('0x12'));var Papa=require(_0xe454('0x13'));var Redis=require(_0xe454('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xe454('0x15'));var as=require(_0xe454('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe454('0x17'));var utils=require(_0xe454('0x18'));var config=require(_0xe454('0x19'));var licenseUtil=require(_0xe454('0x1a'));var db=require(_0xe454('0x1b'))['db'];function respondWithStatusCode(_0x2c4d26,_0x4506c4){_0x4506c4=_0x4506c4||0xcc;return function(_0x505bf2){if(_0x505bf2){return _0x2c4d26[_0xe454('0x1c')](_0x4506c4);}return _0x2c4d26[_0xe454('0x1d')](_0x4506c4)['end']();};}function respondWithResult(_0x197b18,_0x4f1983){_0x4f1983=_0x4f1983||0xc8;return function(_0x1d0f93){if(_0x1d0f93){return _0x197b18[_0xe454('0x1d')](_0x4f1983)['json'](_0x1d0f93);}};}function respondWithFilteredResult(_0x4d57a1,_0x3468fc){return function(_0x5ab9ab){if(_0x5ab9ab){var _0x2dcb44=typeof _0x3468fc[_0xe454('0x1e')]===_0xe454('0x1f')&&typeof _0x3468fc['limit']==='undefined';var _0x1dd256=_0x5ab9ab[_0xe454('0x20')];var _0x4ac235=_0x2dcb44?0x0:_0x3468fc[_0xe454('0x1e')];var _0x21e8c7=_0x2dcb44?_0x5ab9ab[_0xe454('0x20')]:_0x3468fc['offset']+_0x3468fc['limit'];var _0x1ff95a;if(_0x21e8c7>=_0x1dd256){_0x21e8c7=_0x1dd256;_0x1ff95a=0xc8;}else{_0x1ff95a=0xce;}_0x4d57a1[_0xe454('0x1d')](_0x1ff95a);return _0x4d57a1[_0xe454('0x21')]('Content-Range',_0x4ac235+'-'+_0x21e8c7+'/'+_0x1dd256)[_0xe454('0x22')](_0x5ab9ab);}return null;};}function patchUpdates(_0x324467){return function(_0x23d0ce){try{jsonpatch[_0xe454('0x23')](_0x23d0ce,_0x324467,!![]);}catch(_0x4a6771){return BPromise['reject'](_0x4a6771);}return _0x23d0ce[_0xe454('0x24')]();};}function saveUpdates(_0x75b76f,_0x289c4f){return function(_0x17141f){if(_0x17141f){return _0x17141f[_0xe454('0x25')](_0x75b76f)[_0xe454('0x26')](function(_0x4e2fd1){return _0x4e2fd1;});}return null;};}function removeEntity(_0x3e79a0,_0xb3ca9b){return function(_0x3630c6){if(_0x3630c6){return _0x3630c6['destroy']()['then'](function(){_0x3e79a0[_0xe454('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10851d,_0x5e3577){return function(_0xa42c72){if(!_0xa42c72){_0x10851d[_0xe454('0x1c')](0x194);}return _0xa42c72;};}function handleError(_0x6665ee,_0x59a6d1){_0x59a6d1=_0x59a6d1||0x1f4;return function(_0x3352a8){logger[_0xe454('0x27')](_0x3352a8[_0xe454('0x28')]);if(_0x3352a8[_0xe454('0x29')]){delete _0x3352a8['name'];}_0x6665ee[_0xe454('0x1d')](_0x59a6d1)[_0xe454('0x2a')](_0x3352a8);};}exports[_0xe454('0x2b')]=function(_0x2551d1,_0x2fd131){var _0x1dcc63={},_0x56a48b={},_0x3300ba={'count':0x0,'rows':[]};var _0x1c2703=_[_0xe454('0x2c')](db[_0xe454('0x2d')][_0xe454('0x2e')],function(_0x4b9279){return{'name':_0x4b9279['fieldName'],'type':_0x4b9279[_0xe454('0x2f')]['key']};});_0x56a48b[_0xe454('0x30')]=_[_0xe454('0x2c')](_0x1c2703,'name');_0x56a48b[_0xe454('0x31')]=_['keys'](_0x2551d1[_0xe454('0x31')]);_0x56a48b['filters']=_[_0xe454('0x32')](_0x56a48b[_0xe454('0x30')],_0x56a48b[_0xe454('0x31')]);_0x1dcc63[_0xe454('0x33')]=_[_0xe454('0x32')](_0x56a48b['model'],qs['fields'](_0x2551d1[_0xe454('0x31')]['fields']));_0x1dcc63[_0xe454('0x33')]=_0x1dcc63[_0xe454('0x33')]['length']?_0x1dcc63[_0xe454('0x33')]:_0x56a48b[_0xe454('0x30')];if(!_0x2551d1[_0xe454('0x31')][_0xe454('0x34')](_0xe454('0x35'))){_0x1dcc63['limit']=qs[_0xe454('0x36')](_0x2551d1[_0xe454('0x31')][_0xe454('0x36')]);_0x1dcc63['offset']=qs[_0xe454('0x1e')](_0x2551d1[_0xe454('0x31')][_0xe454('0x1e')]);}_0x1dcc63[_0xe454('0x37')]=qs['sort'](_0x2551d1[_0xe454('0x31')][_0xe454('0x38')]);_0x1dcc63[_0xe454('0x39')]=qs['filters'](_['pick'](_0x2551d1[_0xe454('0x31')],_0x56a48b[_0xe454('0x3a')]),_0x1c2703);if(_0x2551d1[_0xe454('0x31')][_0xe454('0x3b')]){_0x1dcc63[_0xe454('0x39')]=_['merge'](_0x1dcc63[_0xe454('0x39')],{'$or':_[_0xe454('0x2c')](_0x1c2703,function(_0x35afe3){if(_0x35afe3[_0xe454('0x2f')]!==_0xe454('0x3c')){var _0x4dc910={};_0x4dc910[_0x35afe3['name']]={'$like':'%'+_0x2551d1['query'][_0xe454('0x3b')]+'%'};return _0x4dc910;}})});}_0x1dcc63=_['merge']({},_0x1dcc63,_0x2551d1['options']);var _0x10c447={'where':_0x1dcc63[_0xe454('0x39')]};return db['OpenchannelApplication'][_0xe454('0x20')](_0x10c447)[_0xe454('0x26')](function(_0x425502){_0x3300ba['count']=_0x425502;if(_0x2551d1[_0xe454('0x31')][_0xe454('0x3d')]){_0x1dcc63['include']=[{'all':!![]}];}return db[_0xe454('0x2d')]['findAll'](_0x1dcc63);})[_0xe454('0x26')](function(_0x5604de){_0x3300ba[_0xe454('0x3e')]=_0x5604de;return _0x3300ba;})['then'](respondWithFilteredResult(_0x2fd131,_0x1dcc63))[_0xe454('0x3f')](handleError(_0x2fd131,null));};exports[_0xe454('0x40')]=function(_0x61a48a,_0x1883a0){var _0x52b346={'raw':!![],'where':{'id':_0x61a48a[_0xe454('0x41')]['id']}},_0x3a57bc={};_0x3a57bc[_0xe454('0x30')]=_[_0xe454('0x42')](db['OpenchannelApplication'][_0xe454('0x2e')]);_0x3a57bc[_0xe454('0x31')]=_[_0xe454('0x42')](_0x61a48a[_0xe454('0x31')]);_0x3a57bc['filters']=_[_0xe454('0x32')](_0x3a57bc[_0xe454('0x30')],_0x3a57bc[_0xe454('0x31')]);_0x52b346['attributes']=_[_0xe454('0x32')](_0x3a57bc[_0xe454('0x30')],qs['fields'](_0x61a48a['query'][_0xe454('0x43')]));_0x52b346[_0xe454('0x33')]=_0x52b346[_0xe454('0x33')]['length']?_0x52b346[_0xe454('0x33')]:_0x3a57bc['model'];if(_0x61a48a[_0xe454('0x31')]['includeAll']){_0x52b346[_0xe454('0x44')]=[{'all':!![]}];}_0x52b346=_[_0xe454('0x45')]({},_0x52b346,_0x61a48a[_0xe454('0x46')]);return db[_0xe454('0x2d')]['find'](_0x52b346)[_0xe454('0x26')](handleEntityNotFound(_0x1883a0,null))[_0xe454('0x26')](respondWithResult(_0x1883a0,null))['catch'](handleError(_0x1883a0,null));};exports['create']=function(_0x2a359e,_0xc37182){return db[_0xe454('0x2d')][_0xe454('0x47')](_0x2a359e[_0xe454('0x48')],{})[_0xe454('0x26')](respondWithResult(_0xc37182,0xc9))['catch'](handleError(_0xc37182,null));};exports['update']=function(_0x32812d,_0x38db64){if(_0x32812d[_0xe454('0x48')]['id']){delete _0x32812d[_0xe454('0x48')]['id'];}return db[_0xe454('0x2d')][_0xe454('0x49')]({'where':{'id':_0x32812d['params']['id']}})[_0xe454('0x26')](handleEntityNotFound(_0x38db64,null))[_0xe454('0x26')](saveUpdates(_0x32812d['body'],null))['then'](respondWithResult(_0x38db64,null))[_0xe454('0x3f')](handleError(_0x38db64,null));};exports[_0xe454('0x4a')]=function(_0x5778ee,_0x5b58d0){return db[_0xe454('0x2d')][_0xe454('0x49')]({'where':{'id':_0x5778ee[_0xe454('0x41')]['id']}})[_0xe454('0x26')](handleEntityNotFound(_0x5b58d0,null))['then'](removeEntity(_0x5b58d0,null))['catch'](handleError(_0x5b58d0,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index faf5be7..657b679 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 _0xadd1=['lodash','api','bluebird','path','rimraf','./openchannelApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4b793b,_0x1ee112){var _0xcfbd6a=function(_0x2eb91c){while(--_0x2eb91c){_0x4b793b['push'](_0x4b793b['shift']());}};_0xcfbd6a(++_0x1ee112);}(_0xadd1,0x1d4));var _0x1add=function(_0x42e43d,_0x5b418e){_0x42e43d=_0x42e43d-0x0;var _0x42a350=_0xadd1[_0x42e43d];return _0x42a350;};'use strict';var _=require(_0x1add('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1add('0x1'));var moment=require('moment');var BPromise=require(_0x1add('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1add('0x3'));var rimraf=require(_0x1add('0x4'));var config=require('../../config/environment');var attributes=require(_0x1add('0x5'));module[_0x1add('0x6')]=function(_0x5e831a,_0x55dd79){return _0x5e831a['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1add('0x7'),'collate':_0x1add('0x8')});}; \ No newline at end of file +var _0x8097=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2fb16e,_0x161667){var _0x5e0882=function(_0x4ed56d){while(--_0x4ed56d){_0x2fb16e['push'](_0x2fb16e['shift']());}};_0x5e0882(++_0x161667);}(_0x8097,0x1a0));var _0x7809=function(_0x37f731,_0x29a5a2){_0x37f731=_0x37f731-0x0;var _0x433120=_0x8097[_0x37f731];return _0x433120;};'use strict';var _=require(_0x7809('0x0'));var util=require(_0x7809('0x1'));var logger=require(_0x7809('0x2'))(_0x7809('0x3'));var moment=require(_0x7809('0x4'));var BPromise=require(_0x7809('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7809('0x6'));var rimraf=require(_0x7809('0x7'));var config=require(_0x7809('0x8'));var attributes=require(_0x7809('0x9'));module[_0x7809('0xa')]=function(_0x984846,_0x49a14a){return _0x984846[_0x7809('0xb')](_0x7809('0xc'),attributes,{'tableName':_0x7809('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7809('0xe'),'collate':_0x7809('0xf')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 69f3a12..65be008 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 _0x7e1d=['then','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateOpenchannelApplication','update','body','options','raw','attributes','limit','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x1467e1,_0x4c7955){var _0x47afd0=function(_0x399b3c){while(--_0x399b3c){_0x1467e1['push'](_0x1467e1['shift']());}};_0x47afd0(++_0x4c7955);}(_0x7e1d,0x13b));var _0xd7e1=function(_0x40d562,_0x236022){_0x40d562=_0x40d562-0x0;var _0x2ea525=_0x7e1d[_0x40d562];return _0x2ea525;};'use strict';var _=require(_0xd7e1('0x0'));var util=require(_0xd7e1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd7e1('0x2'));var db=require(_0xd7e1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd7e1('0x4'))(_0xd7e1('0x5'));var config=require(_0xd7e1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd7e1('0x7')][_0xd7e1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29fc44,_0x2604f1,_0x5d97bb){return new BPromise(function(_0xa285f0,_0x49cb66){return client[_0xd7e1('0x9')](_0x29fc44,_0x5d97bb)[_0xd7e1('0xa')](function(_0x10a5b3){logger['info'](_0xd7e1('0xb'),_0x2604f1,'request\x20sent');logger[_0xd7e1('0xc')](_0xd7e1('0xd'),_0x2604f1,'request\x20sent',JSON[_0xd7e1('0xe')](_0x10a5b3));if(_0x10a5b3[_0xd7e1('0xf')]){if(_0x10a5b3[_0xd7e1('0xf')]['code']===0x1f4){logger[_0xd7e1('0xf')](_0xd7e1('0xb'),_0x2604f1,_0x10a5b3[_0xd7e1('0xf')][_0xd7e1('0x10')]);return _0x49cb66(_0x10a5b3[_0xd7e1('0xf')][_0xd7e1('0x10')]);}logger[_0xd7e1('0xf')](_0xd7e1('0xb'),_0x2604f1,_0x10a5b3[_0xd7e1('0xf')][_0xd7e1('0x10')]);return _0xa285f0(_0x10a5b3[_0xd7e1('0xf')][_0xd7e1('0x10')]);}else{logger['info'](_0xd7e1('0xb'),_0x2604f1,'request\x20sent');_0xa285f0(_0x10a5b3['result'][_0xd7e1('0x10')]);}})[_0xd7e1('0x11')](function(_0x1bbda4){logger[_0xd7e1('0xf')](_0xd7e1('0xb'),_0x2604f1,_0x1bbda4);_0x49cb66(_0x1bbda4);});});}exports[_0xd7e1('0x12')]=function(_0x58ab50){var _0x5ec525=this;return new Promise(function(_0x4e04b5,_0xdc4f76){return db['OpenchannelApplication'][_0xd7e1('0x13')](_0x58ab50[_0xd7e1('0x14')],{'raw':_0x58ab50[_0xd7e1('0x15')]?_0x58ab50[_0xd7e1('0x15')][_0xd7e1('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58ab50['options']?_0x58ab50[_0xd7e1('0x15')]['where']||null:null,'attributes':_0x58ab50[_0xd7e1('0x15')]?_0x58ab50[_0xd7e1('0x15')][_0xd7e1('0x17')]||null:null,'limit':_0x58ab50[_0xd7e1('0x15')]?_0x58ab50['options'][_0xd7e1('0x18')]||null:null})[_0xd7e1('0xa')](function(_0x521cce){logger['info']('UpdateOpenchannelApplication',_0x58ab50);logger[_0xd7e1('0xc')](_0xd7e1('0x12'),_0x58ab50,JSON[_0xd7e1('0xe')](_0x521cce));_0x4e04b5(_0x521cce);})[_0xd7e1('0x11')](function(_0x2ea1ef){logger[_0xd7e1('0xf')](_0xd7e1('0x12'),_0x2ea1ef[_0xd7e1('0x10')],_0x58ab50);_0xdc4f76(_0x5ec525[_0xd7e1('0xf')](0x1f4,_0x2ea1ef[_0xd7e1('0x10')]));});});}; \ No newline at end of file +var _0xc662=['debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s'];(function(_0x50def0,_0x52d982){var _0x14baf4=function(_0x2b5e1f){while(--_0x2b5e1f){_0x50def0['push'](_0x50def0['shift']());}};_0x14baf4(++_0x52d982);}(_0xc662,0x83));var _0x2c66=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xc662[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0x2c66('0x0'));var util=require(_0x2c66('0x1'));var moment=require(_0x2c66('0x2'));var BPromise=require(_0x2c66('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c66('0x4'));var db=require(_0x2c66('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2c66('0x6'))(_0x2c66('0x7'));var config=require('../../config/environment');var jayson=require(_0x2c66('0x8'));var client=jayson[_0x2c66('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x425099,_0x1cb1da,_0x226f9e){return new BPromise(function(_0x5a410a,_0x30864e){return client[_0x2c66('0xa')](_0x425099,_0x226f9e)[_0x2c66('0xb')](function(_0x4006e6){logger[_0x2c66('0xc')](_0x2c66('0xd'),_0x1cb1da,'request\x20sent');logger[_0x2c66('0xe')](_0x2c66('0xf'),_0x1cb1da,_0x2c66('0x10'),JSON[_0x2c66('0x11')](_0x4006e6));if(_0x4006e6['error']){if(_0x4006e6['error'][_0x2c66('0x12')]===0x1f4){logger[_0x2c66('0x13')](_0x2c66('0xd'),_0x1cb1da,_0x4006e6[_0x2c66('0x13')][_0x2c66('0x14')]);return _0x30864e(_0x4006e6['error'][_0x2c66('0x14')]);}logger[_0x2c66('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x1cb1da,_0x4006e6[_0x2c66('0x13')][_0x2c66('0x14')]);return _0x5a410a(_0x4006e6[_0x2c66('0x13')][_0x2c66('0x14')]);}else{logger['info'](_0x2c66('0xd'),_0x1cb1da,_0x2c66('0x10'));_0x5a410a(_0x4006e6['result']['message']);}})[_0x2c66('0x15')](function(_0x547599){logger[_0x2c66('0x13')](_0x2c66('0xd'),_0x1cb1da,_0x547599);_0x30864e(_0x547599);});});}exports[_0x2c66('0x16')]=function(_0x127b6f){var _0x4eab4d=this;return new Promise(function(_0x21b0a4,_0x4a938b){return db[_0x2c66('0x17')]['update'](_0x127b6f[_0x2c66('0x18')],{'raw':_0x127b6f['options']?_0x127b6f[_0x2c66('0x19')][_0x2c66('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x127b6f[_0x2c66('0x19')]?_0x127b6f[_0x2c66('0x19')][_0x2c66('0x1b')]||null:null,'attributes':_0x127b6f['options']?_0x127b6f[_0x2c66('0x19')]['attributes']||null:null,'limit':_0x127b6f[_0x2c66('0x19')]?_0x127b6f[_0x2c66('0x19')][_0x2c66('0x1c')]||null:null})[_0x2c66('0xb')](function(_0x269abf){logger[_0x2c66('0xc')]('UpdateOpenchannelApplication',_0x127b6f);logger['debug'](_0x2c66('0x16'),_0x127b6f,JSON[_0x2c66('0x11')](_0x269abf));_0x21b0a4(_0x269abf);})[_0x2c66('0x15')](function(_0xc049c8){logger['error']('UpdateOpenchannelApplication',_0xc049c8[_0x2c66('0x14')],_0x127b6f);_0x4a938b(_0x4eab4d[_0x2c66('0x13')](0x1f4,_0xc049c8[_0x2c66('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 4ba211d..b14c9d7 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 _0xf435=['openchannel','openchannelinteraction:update','update','delete','tracked','destroy','removeTags','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','create','post','/:id/tags','openchannelinteraction:addtags','addTags'];(function(_0x38ad62,_0x45b5dc){var _0x2a48f7=function(_0x3a7bed){while(--_0x3a7bed){_0x38ad62['push'](_0x38ad62['shift']());}};_0x2a48f7(++_0x45b5dc);}(_0xf435,0x1c9));var _0x5f43=function(_0x2a027c,_0x4e94df){_0x2a027c=_0x2a027c-0x0;var _0x500b9d=_0xf435[_0x2a027c];return _0x500b9d;};'use strict';var multer=require(_0x5f43('0x0'));var util=require(_0x5f43('0x1'));var path=require('path');var timeout=require(_0x5f43('0x2'));var express=require(_0x5f43('0x3'));var router=express['Router']();var fs_extra=require(_0x5f43('0x4'));var auth=require(_0x5f43('0x5'));var interaction=require(_0x5f43('0x6'));var config=require(_0x5f43('0x7'));var controller=require(_0x5f43('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x5f43('0x9')]);router[_0x5f43('0xa')](_0x5f43('0xb'),auth[_0x5f43('0xc')](),controller[_0x5f43('0xd')]);router['get'](_0x5f43('0xe'),auth[_0x5f43('0xc')](),controller[_0x5f43('0xf')]);router['get'](_0x5f43('0x10'),auth[_0x5f43('0xc')](),controller[_0x5f43('0x11')]);router['get']('/:id/download',auth[_0x5f43('0xc')](),controller['download']);router['post']('/',auth[_0x5f43('0xc')](),controller[_0x5f43('0x12')]);router[_0x5f43('0x13')](_0x5f43('0x10'),auth['isAuthenticated'](),controller['addMessage']);router[_0x5f43('0x13')](_0x5f43('0x14'),auth[_0x5f43('0xc')](),interaction['tracked']('openchannel',_0x5f43('0x15')),controller[_0x5f43('0x16')]);router['put'](_0x5f43('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0x5f43('0x17'),_0x5f43('0x18')),controller[_0x5f43('0x19')]);router[_0x5f43('0x1a')](_0x5f43('0xe'),auth[_0x5f43('0xc')](),interaction[_0x5f43('0x1b')]('openchannel','openchannelinteraction:destroy'),controller[_0x5f43('0x1c')]);router[_0x5f43('0x1a')](_0x5f43('0x14'),auth['isAuthenticated'](),controller[_0x5f43('0x1d')]);module['exports']=router; \ No newline at end of file +var _0xe19a=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','update','delete','openchannelinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout'];(function(_0x1f667b,_0x585190){var _0x15aee6=function(_0x188296){while(--_0x188296){_0x1f667b['push'](_0x1f667b['shift']());}};_0x15aee6(++_0x585190);}(_0xe19a,0x10c));var _0xae19=function(_0x606fe8,_0x10b084){_0x606fe8=_0x606fe8-0x0;var _0x28b517=_0xe19a[_0x606fe8];return _0x28b517;};'use strict';var multer=require(_0xae19('0x0'));var util=require(_0xae19('0x1'));var path=require(_0xae19('0x2'));var timeout=require(_0xae19('0x3'));var express=require(_0xae19('0x4'));var router=express[_0xae19('0x5')]();var fs_extra=require(_0xae19('0x6'));var auth=require(_0xae19('0x7'));var interaction=require(_0xae19('0x8'));var config=require(_0xae19('0x9'));var controller=require(_0xae19('0xa'));router['get']('/',auth[_0xae19('0xb')](),controller[_0xae19('0xc')]);router['get'](_0xae19('0xd'),auth[_0xae19('0xb')](),controller[_0xae19('0xe')]);router[_0xae19('0xf')](_0xae19('0x10'),auth[_0xae19('0xb')](),controller[_0xae19('0x11')]);router[_0xae19('0xf')](_0xae19('0x12'),auth[_0xae19('0xb')](),controller[_0xae19('0x13')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xae19('0x14')]('/',auth[_0xae19('0xb')](),controller[_0xae19('0x15')]);router[_0xae19('0x14')](_0xae19('0x12'),auth[_0xae19('0xb')](),controller[_0xae19('0x16')]);router['post'](_0xae19('0x17'),auth['isAuthenticated'](),interaction[_0xae19('0x18')](_0xae19('0x19'),_0xae19('0x1a')),controller[_0xae19('0x1b')]);router[_0xae19('0x1c')]('/:id',auth[_0xae19('0xb')](),interaction[_0xae19('0x18')](_0xae19('0x19'),'openchannelinteraction:update'),controller[_0xae19('0x1d')]);router[_0xae19('0x1e')](_0xae19('0x10'),auth['isAuthenticated'](),interaction['tracked']('openchannel',_0xae19('0x1f')),controller['destroy']);router[_0xae19('0x1e')](_0xae19('0x17'),auth[_0xae19('0xb')](),controller[_0xae19('0x20')]);module[_0xae19('0x21')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 8e5cb83..b50416e 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 _0xdae9=['out','BOOLEAN','exports','DATE','STRING','ENUM'];(function(_0x33d1e5,_0x44151f){var _0x42a90d=function(_0x48cc3b){while(--_0x48cc3b){_0x33d1e5['push'](_0x33d1e5['shift']());}};_0x42a90d(++_0x44151f);}(_0xdae9,0x15e));var _0x9dae=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0xdae9[_0x1d1d09];return _0x8827e;};'use strict';var Sequelize=require('sequelize');module[_0x9dae('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9dae('0x1')]},'disposition':{'type':Sequelize[_0x9dae('0x2')]},'secondDisposition':{'type':Sequelize[_0x9dae('0x2')]},'thirdDisposition':{'type':Sequelize[_0x9dae('0x2')]},'note':{'type':Sequelize[_0x9dae('0x2')]},'read1stAt':{'type':Sequelize[_0x9dae('0x1')]},'threadId':{'type':Sequelize[_0x9dae('0x2')]},'externalUrl':{'type':Sequelize[_0x9dae('0x2')]},'lastMsgAt':{'type':Sequelize[_0x9dae('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x9dae('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x9dae('0x3')]('in',_0x9dae('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x9dae('0x5')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe126=['out','BOOLEAN','INTEGER','sequelize','exports','DATE','STRING','ENUM'];(function(_0xcf4569,_0x1ce755){var _0x7fef=function(_0x374ab8){while(--_0x374ab8){_0xcf4569['push'](_0xcf4569['shift']());}};_0x7fef(++_0x1ce755);}(_0xe126,0xeb));var _0x6e12=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xe126[_0x87b0ff];return _0x3bc0b2;};'use strict';var Sequelize=require(_0x6e12('0x0'));module[_0x6e12('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6e12('0x2')]},'disposition':{'type':Sequelize[_0x6e12('0x3')]},'secondDisposition':{'type':Sequelize[_0x6e12('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6e12('0x3')]},'note':{'type':Sequelize[_0x6e12('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x6e12('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x6e12('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x6e12('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x6e12('0x4')]('in',_0x6e12('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6e12('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x6e12('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x6e12('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 0e6b6d0..88b0676 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 _0x7e38=['socket.io-emitter','./openchannelInteraction.socket','register','end','json','undefined','limit','count','offset','status','set','update','then','destroy','sendStatus','name','send','index','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','user','show','from','params','model','keys','OpenchannelInteraction','intersection','attributes','fields','length','include','merge','catch','create','body','find','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','findOne','hasOwnProperty','order','sort','where','filters','filter','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','rows','addTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','attachments','Attachment','Messages','createdAt','direction','secret','OpenchannelAccount','get','mkdirSync','Account','Owner','N.A.','closed','closedAt','disposition','threadId','Public','Private','map','basename','existsSync','createReadStream','out','System','Contact','read','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Openchannel','createPdfFromHTML','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost'];(function(_0x42da88,_0x4dde2d){var _0x4f6da6=function(_0x23d954){while(--_0x23d954){_0x42da88['push'](_0x42da88['shift']());}};_0x4f6da6(++_0x4dde2d);}(_0x7e38,0x75));var _0x87e3=function(_0x68b49c,_0x487f8c){_0x68b49c=_0x68b49c-0x0;var _0x42f79b=_0x7e38[_0x68b49c];return _0x42f79b;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require('moment');var util=require(_0x87e3('0x0'));var path=require('path');var ejs=require(_0x87e3('0x1'));var fs=require('fs');var _=require(_0x87e3('0x2'));var Redis=require(_0x87e3('0x3'));var interaction=require(_0x87e3('0x4'));var qs=require('../../components/parsers/qs');var pdf=require(_0x87e3('0x5'));var logger=require(_0x87e3('0x6'))(_0x87e3('0x7'));var config=require(_0x87e3('0x8'));var db=require(_0x87e3('0x9'))['db'];config[_0x87e3('0xa')]=_[_0x87e3('0xb')](config[_0x87e3('0xa')],{'host':_0x87e3('0xc'),'port':0x18eb});var socket=require(_0x87e3('0xd'))(new Redis(config[_0x87e3('0xa')]));require(_0x87e3('0xe'))[_0x87e3('0xf')](socket);function respondWithStatusCode(_0x3ca0e7,_0xa0686a){_0xa0686a=_0xa0686a||0xcc;return function(_0x11bea4){if(_0x11bea4){return _0x3ca0e7['sendStatus'](_0xa0686a);}return _0x3ca0e7['status'](_0xa0686a)[_0x87e3('0x10')]();};}function respondWithResult(_0x43154c,_0x2bfcf4){_0x2bfcf4=_0x2bfcf4||0xc8;return function(_0x355030){if(_0x355030){return _0x43154c['status'](_0x2bfcf4)[_0x87e3('0x11')](_0x355030);}};}function respondWithFilteredResult(_0x43b072,_0x35b172){return function(_0x44ae3a){if(_0x44ae3a){var _0x5b4b01=typeof _0x35b172['offset']===_0x87e3('0x12')&&typeof _0x35b172[_0x87e3('0x13')]===_0x87e3('0x12');var _0x15b7d2=_0x44ae3a[_0x87e3('0x14')];var _0x2637c4=_0x5b4b01?0x0:_0x35b172[_0x87e3('0x15')];var _0x2e684b=_0x5b4b01?_0x44ae3a[_0x87e3('0x14')]:_0x35b172[_0x87e3('0x15')]+_0x35b172[_0x87e3('0x13')];var _0x17c1cf;if(_0x2e684b>=_0x15b7d2){_0x2e684b=_0x15b7d2;_0x17c1cf=0xc8;}else{_0x17c1cf=0xce;}_0x43b072[_0x87e3('0x16')](_0x17c1cf);return _0x43b072[_0x87e3('0x17')]('Content-Range',_0x2637c4+'-'+_0x2e684b+'/'+_0x15b7d2)[_0x87e3('0x11')](_0x44ae3a);}return null;};}function saveUpdates(_0x1413ec){return function(_0x59d1f5){if(_0x59d1f5){return _0x59d1f5[_0x87e3('0x18')](_0x1413ec)[_0x87e3('0x19')](function(_0x5902ab){return _0x5902ab;});}return null;};}function removeEntity(_0xb94b1e){return function(_0x2be662){if(_0x2be662){return _0x2be662[_0x87e3('0x1a')]()[_0x87e3('0x19')](function(){_0xb94b1e[_0x87e3('0x16')](0xcc)[_0x87e3('0x10')]();});}};}function handleEntityNotFound(_0x577afe){return function(_0x1fa1e4){if(!_0x1fa1e4){_0x577afe[_0x87e3('0x1b')](0x194);}return _0x1fa1e4;};}function handleError(_0x20d6ae,_0xb28b65){_0xb28b65=_0xb28b65||0x1f4;return function(_0x3b9e66){logger['error'](_0x3b9e66['stack']);if(_0x3b9e66[_0x87e3('0x1c')]){delete _0x3b9e66[_0x87e3('0x1c')];}_0x20d6ae[_0x87e3('0x16')](_0xb28b65)[_0x87e3('0x1d')](_0x3b9e66);};}exports[_0x87e3('0x1e')]=function(_0x3815a3,_0x234b6d){var _0x2e509b={};var _0x1a5e2a=_['map'](db['OpenchannelInteraction'][_0x87e3('0x1f')],function(_0x4ef0ad){return{'name':_0x4ef0ad[_0x87e3('0x20')],'type':_0x4ef0ad[_0x87e3('0x21')][_0x87e3('0x22')]};});_0x2e509b=qs[_0x87e3('0x23')](_0x1a5e2a,_0x3815a3);return interaction[_0x87e3('0x24')](_0x87e3('0x25'),_0x3815a3[_0x87e3('0x26')],_0x3815a3[_0x87e3('0x27')],_0x2e509b,_0x1a5e2a)['then'](respondWithFilteredResult(_0x234b6d,_0x2e509b))['catch'](handleError(_0x234b6d,null));};exports[_0x87e3('0x28')]=function(_0x3da197,_0x3df848){var _0x1a3a8c={};if(_0x3da197['query'][_0x87e3('0x21')]&&_0x3da197[_0x87e3('0x26')][_0x87e3('0x21')]===_0x87e3('0x29')){_0x1a3a8c['from']=_0x3da197[_0x87e3('0x2a')]['id'];}else{_0x1a3a8c['id']=_0x3da197[_0x87e3('0x2a')]['id'];}var _0x50df44={'raw':![],'where':_0x1a3a8c},_0x37da58={};_0x37da58[_0x87e3('0x2b')]=_[_0x87e3('0x2c')](db[_0x87e3('0x2d')][_0x87e3('0x1f')]);_0x37da58['query']=_[_0x87e3('0x2c')](_0x3da197[_0x87e3('0x26')]);_0x37da58['filters']=_[_0x87e3('0x2e')](_0x37da58['model'],_0x37da58[_0x87e3('0x26')]);_0x50df44[_0x87e3('0x2f')]=_[_0x87e3('0x2e')](_0x37da58[_0x87e3('0x2b')],qs[_0x87e3('0x30')](_0x3da197[_0x87e3('0x26')][_0x87e3('0x30')]));_0x50df44[_0x87e3('0x2f')]=_0x50df44['attributes'][_0x87e3('0x31')]?_0x50df44[_0x87e3('0x2f')]:_0x37da58[_0x87e3('0x2b')];if(_0x3da197['query']['includeAll']){_0x50df44[_0x87e3('0x32')]=[{'all':!![]}];}_0x50df44=_[_0x87e3('0x33')]({},_0x50df44,_0x3da197['options']);return db[_0x87e3('0x2d')]['find'](_0x50df44)[_0x87e3('0x19')](handleEntityNotFound(_0x3df848,null))[_0x87e3('0x19')](respondWithResult(_0x3df848,null))[_0x87e3('0x34')](handleError(_0x3df848,null));};exports[_0x87e3('0x35')]=function(_0x59c103,_0x18ebb6){return db[_0x87e3('0x2d')]['create'](_0x59c103[_0x87e3('0x36')],{})['then'](respondWithResult(_0x18ebb6,0xc9))[_0x87e3('0x34')](handleError(_0x18ebb6,null));};exports[_0x87e3('0x18')]=function(_0x938500,_0x11cd05){if(_0x938500[_0x87e3('0x36')]['id']){delete _0x938500[_0x87e3('0x36')]['id'];}return db[_0x87e3('0x2d')]['find']({'where':{'id':_0x938500[_0x87e3('0x2a')]['id']}})[_0x87e3('0x19')](handleEntityNotFound(_0x11cd05,null))[_0x87e3('0x19')](saveUpdates(_0x938500['body'],null))[_0x87e3('0x19')](respondWithResult(_0x11cd05,null))[_0x87e3('0x34')](handleError(_0x11cd05,null));};exports['destroy']=function(_0x5b501d,_0x20890f){return db[_0x87e3('0x2d')][_0x87e3('0x37')]({'where':{'id':_0x5b501d[_0x87e3('0x2a')]['id']}})[_0x87e3('0x19')](handleEntityNotFound(_0x20890f,null))[_0x87e3('0x19')](removeEntity(_0x20890f,null))[_0x87e3('0x34')](handleError(_0x20890f,null));};exports[_0x87e3('0x38')]=function(_0x4326b5,_0x5ad11c){return db[_0x87e3('0x2d')][_0x87e3('0x38')]()[_0x87e3('0x19')](respondWithResult(_0x5ad11c,null))['catch'](handleError(_0x5ad11c,null));};exports[_0x87e3('0x39')]=function(_0x15b48c,_0x5e4461){return db[_0x87e3('0x3a')][_0x87e3('0x37')]({'where':{'id':_0x15b48c[_0x87e3('0x2a')]['id']}})[_0x87e3('0x19')](handleEntityNotFound(_0x5e4461,null))[_0x87e3('0x19')](function(_0x3cb101){if(_0x3cb101){return _0x3cb101['addMessage'](_0x15b48c[_0x87e3('0x36')]['ids'],_[_0x87e3('0x3b')](_0x15b48c[_0x87e3('0x36')],[_0x87e3('0x3c'),'id'])||{});}})[_0x87e3('0x19')](respondWithResult(_0x5e4461,null))[_0x87e3('0x34')](handleError(_0x5e4461,null));};exports[_0x87e3('0x3d')]=function(_0x8bccb2,_0x197476){var _0x27dd81={'raw':![],'where':{}};var _0x2a5069={};var _0x51bc78={'count':0x0,'rows':[]};return db[_0x87e3('0x2d')][_0x87e3('0x3e')]({'where':{'id':_0x8bccb2[_0x87e3('0x2a')]['id']}})[_0x87e3('0x19')](handleEntityNotFound(_0x197476,null))[_0x87e3('0x19')](function(_0x56e9b1){if(_0x56e9b1){_0x2a5069[_0x87e3('0x2b')]=_['keys'](db[_0x87e3('0x3a')][_0x87e3('0x1f')]);_0x2a5069[_0x87e3('0x26')]=_['keys'](_0x8bccb2[_0x87e3('0x26')]);_0x2a5069['filters']=_[_0x87e3('0x2e')](_0x2a5069[_0x87e3('0x2b')],_0x2a5069[_0x87e3('0x26')]);_0x27dd81['attributes']=_['intersection'](_0x2a5069[_0x87e3('0x2b')],qs[_0x87e3('0x30')](_0x8bccb2[_0x87e3('0x26')]['fields']));_0x27dd81[_0x87e3('0x2f')]=_0x27dd81[_0x87e3('0x2f')][_0x87e3('0x31')]?_0x27dd81[_0x87e3('0x2f')]:_0x2a5069['model'];if(!_0x8bccb2[_0x87e3('0x26')][_0x87e3('0x3f')]('nolimit')){_0x27dd81['limit']=qs[_0x87e3('0x13')](_0x8bccb2[_0x87e3('0x26')][_0x87e3('0x13')]);_0x27dd81[_0x87e3('0x15')]=qs[_0x87e3('0x15')](_0x8bccb2[_0x87e3('0x26')][_0x87e3('0x15')]);}_0x27dd81[_0x87e3('0x40')]=qs[_0x87e3('0x41')](_0x8bccb2[_0x87e3('0x26')][_0x87e3('0x41')]);_0x27dd81[_0x87e3('0x42')]=qs[_0x87e3('0x43')](_['pick'](_0x8bccb2[_0x87e3('0x26')],_0x2a5069[_0x87e3('0x43')]));_0x27dd81[_0x87e3('0x42')]['OpenchannelInteractionId']=_0x56e9b1['id'];if(_0x8bccb2[_0x87e3('0x26')][_0x87e3('0x44')]){_0x27dd81[_0x87e3('0x42')]=_[_0x87e3('0x33')](_0x27dd81[_0x87e3('0x42')],{'$or':_['map'](_0x27dd81[_0x87e3('0x2f')],function(_0x3637a1){var _0x46e8e6={};_0x46e8e6[_0x3637a1]={'$like':'%'+_0x8bccb2[_0x87e3('0x26')][_0x87e3('0x44')]+'%'};return _0x46e8e6;})});}if(_0x8bccb2[_0x87e3('0x26')]['$gte']){var _0x23df4c=_0x8bccb2[_0x87e3('0x26')]['$gte']['split'](',');var _0x9110cd={};_0x9110cd[_0x23df4c[0x0]]={'$gte':moment(_0x23df4c[0x1])[_0x87e3('0x45')](_0x87e3('0x46'))};_0x27dd81['where']=_[_0x87e3('0x33')](_0x27dd81['where'],_0x9110cd);}_0x27dd81=_['merge']({},_0x27dd81,_0x8bccb2[_0x87e3('0x47')]);return db[_0x87e3('0x3a')]['count']({'where':_0x27dd81[_0x87e3('0x42')]})['then'](function(_0x2d51e0){_0x51bc78[_0x87e3('0x14')]=_0x2d51e0;if(_0x8bccb2['query'][_0x87e3('0x48')]){_0x27dd81[_0x87e3('0x32')]=[{'all':!![]}];}return db[_0x87e3('0x3a')]['findAll'](_0x27dd81);})['then'](function(_0x100993){_0x51bc78[_0x87e3('0x49')]=_0x100993;return _0x51bc78;});}})[_0x87e3('0x19')](respondWithFilteredResult(_0x197476,_0x27dd81))['catch'](handleError(_0x197476,null));};exports[_0x87e3('0x4a')]=function(_0x42078e,_0xa84c78){return db[_0x87e3('0x2d')][_0x87e3('0x37')]({'where':{'id':_0x42078e[_0x87e3('0x2a')]['id']}})[_0x87e3('0x19')](handleEntityNotFound(_0xa84c78,null))['then'](function(_0x3ea3f6){if(_0x3ea3f6){return _0x3ea3f6['setTags'](_0x42078e[_0x87e3('0x36')]['ids'],_[_0x87e3('0x3b')](_0x42078e['body'],[_0x87e3('0x3c'),'id'])||{})[_0x87e3('0x4b')](function(){return db['Tag'][_0x87e3('0x24')]({'attributes':['id',_0x87e3('0x1c'),_0x87e3('0x4c')],'where':{'id':_0x42078e[_0x87e3('0x36')][_0x87e3('0x3c')]}});})[_0x87e3('0x19')](function(_0x19c45a){socket[_0x87e3('0x4d')](_0x87e3('0x4e'),{'id':Number(_0x42078e[_0x87e3('0x2a')]['id']),'tags':_0x19c45a||[]});return{'id':Number(_0x42078e[_0x87e3('0x2a')]['id']),'tags':_0x19c45a||[]};});}})[_0x87e3('0x19')](respondWithResult(_0xa84c78,null))['catch'](handleError(_0xa84c78,null));};exports[_0x87e3('0x4f')]=function(_0x184ebf,_0xe8481d){return db[_0x87e3('0x2d')][_0x87e3('0x37')]({'where':{'id':_0x184ebf[_0x87e3('0x2a')]['id']}})[_0x87e3('0x19')](handleEntityNotFound(_0xe8481d,null))[_0x87e3('0x19')](function(_0x153f36){if(_0x153f36){return _0x153f36[_0x87e3('0x4f')](_0x184ebf['query'][_0x87e3('0x3c')]);}})[_0x87e3('0x19')](respondWithStatusCode(_0xe8481d,null))[_0x87e3('0x34')](handleError(_0xe8481d,null));};exports[_0x87e3('0x50')]=function(_0x58f7eb,_0x12fab5){var _0x55c511=moment()[_0x87e3('0x51')]()[_0x87e3('0x52')]();var _0x9ece41=path[_0x87e3('0x53')](config[_0x87e3('0x54')],_0x87e3('0x55'),_0x87e3('0x56'),'tmp');var _0x20e0eb=path['join'](config[_0x87e3('0x54')],'server',_0x87e3('0x56'),'attachments');var _0x2ab8e7=path[_0x87e3('0x53')](_0x9ece41,_0x55c511);var _0x15afc4=util[_0x87e3('0x45')](_0x87e3('0x57'),_0x58f7eb['params']['id'],_0x55c511);var _0xd8c783=path[_0x87e3('0x53')](_0x9ece41,_0x15afc4);var _0x4aa5d7=[];_0x4aa5d7[_0x87e3('0x58')]({'model':db['User'],'as':_0x87e3('0x59'),'attributes':['id',_0x87e3('0x5a')],'raw':!![]});_0x4aa5d7[_0x87e3('0x58')]({'model':db[_0x87e3('0x5b')],'as':'Contact','attributes':['id',_0x87e3('0x5c'),_0x87e3('0x5d')],'raw':!![]});if(_0x58f7eb[_0x87e3('0x26')][_0x87e3('0x5e')]){_0x4aa5d7[_0x87e3('0x58')]({'model':db[_0x87e3('0x5f')],'as':'Attachment','raw':!![]});}var _0x12fe77=[{'model':db[_0x87e3('0x3a')],'as':_0x87e3('0x60'),'attributes':['id',_0x87e3('0x36'),_0x87e3('0x61'),_0x87e3('0x62'),_0x87e3('0x63'),'read'],'include':_0x4aa5d7}];_0x12fe77['push']({'model':db[_0x87e3('0x64')],'as':'Account','attributes':['id',_0x87e3('0x1c')]});_0x12fe77[_0x87e3('0x58')]({'model':db[_0x87e3('0x59')],'as':'Owner','attributes':['id','fullname']});return db[_0x87e3('0x2d')][_0x87e3('0x37')]({'where':{'id':_0x58f7eb[_0x87e3('0x2a')]['id']},'include':_0x12fe77})[_0x87e3('0x19')](handleEntityNotFound(_0x12fab5,null))[_0x87e3('0x19')](function(_0x2b99c9){if(_0x2b99c9){var _0x3a823a=_0x2b99c9[_0x87e3('0x65')]({'plain':!![]});fs[_0x87e3('0x66')](_0x2ab8e7);var _0x176fd1={'channel':'Openchannel','account':_0x3a823a[_0x87e3('0x67')]['name'],'agent':_0x3a823a[_0x87e3('0x68')]?_0x3a823a['Owner']['fullname']:_0x87e3('0x69'),'createdAt':moment(_0x3a823a[_0x87e3('0x61')])['format'](_0x87e3('0x46'))[_0x87e3('0x52')](),'closedAt':_0x3a823a[_0x87e3('0x6a')]?moment(_0x3a823a[_0x87e3('0x6b')])[_0x87e3('0x45')](_0x87e3('0x46'))['toString']():'','disposition':_0x3a823a[_0x87e3('0x6c')],'visibility':_0x3a823a[_0x87e3('0x6d')]?_0x87e3('0x6e'):_0x87e3('0x6f'),'messages':_(_0x3a823a[_0x87e3('0x60')])[_0x87e3('0x44')]({'secret':![]})[_0x87e3('0x70')](function(_0x20587b){if(_0x20587b[_0x87e3('0x5f')]){var _0x43cdb0=path[_0x87e3('0x53')](_0x20e0eb,_0x20587b[_0x87e3('0x5f')][_0x87e3('0x71')]);if(fs[_0x87e3('0x72')](_0x43cdb0)){fs[_0x87e3('0x73')](_0x43cdb0)['pipe'](fs['createWriteStream'](path[_0x87e3('0x53')](_0x2ab8e7,_0x20587b[_0x87e3('0x5f')][_0x87e3('0x71')])));}}return{'date':moment(_0x20587b[_0x87e3('0x61')])[_0x87e3('0x45')](_0x87e3('0x46'))[_0x87e3('0x52')](),'sender':_0x20587b['direction']===_0x87e3('0x74')?_0x20587b[_0x87e3('0x59')]?_0x20587b[_0x87e3('0x59')][_0x87e3('0x5a')]:_0x87e3('0x75'):_0x20587b[_0x87e3('0x76')][_0x87e3('0x5c')]+(_0x20587b[_0x87e3('0x76')][_0x87e3('0x5d')]?'\x20'+_0x20587b[_0x87e3('0x76')][_0x87e3('0x5d')]:''),'body':_0x20587b[_0x87e3('0x5f')]?_0x20587b[_0x87e3('0x5f')][_0x87e3('0x71')]:_0x20587b[_0x87e3('0x36')],'direction':_0x20587b[_0x87e3('0x62')]===_0x87e3('0x74')?'A':'C','secret':_0x20587b['secret'],'read':_0x20587b[_0x87e3('0x77')],'attachment':_0x20587b['Attachment']};})['value']()};return ejs[_0x87e3('0x78')](path[_0x87e3('0x53')](config[_0x87e3('0x54')],_0x87e3('0x55'),_0x87e3('0x79'),_0x87e3('0x7a')),{'interaction':_0x176fd1})[_0x87e3('0x19')](function(_0x3cb92e){var _0x3753cc=path[_0x87e3('0x53')](_0x2ab8e7,_0x87e3('0x7b')+_0x3a823a['id']+'-'+_0x55c511+_0x87e3('0x7c'));var _0x385ccc={'path':_0x3753cc,'channel':_0x87e3('0x7d'),'interactionId':_0x3a823a['id']};return pdf[_0x87e3('0x7e')](_0x3cb92e,_0x385ccc);})[_0x87e3('0x19')](function(){return new Promise(function(_0x7e5794,_0x367d39){zipdir(_0x2ab8e7,{'saveTo':_0xd8c783},function(_0x2296c4,_0x51e4de){if(_0x2296c4)return _0x367d39(_0x2296c4);return _0x7e5794(_0x51e4de);});})['then'](function(){return new Promise(function(_0x29bf86,_0x53ea8){rimraf(_0x2ab8e7,function(_0x1c0227){if(_0x1c0227)_0x53ea8(_0x1c0227);return _0x29bf86();});});})['then'](function(){return _0x12fab5[_0x87e3('0x50')](_0xd8c783,_0x15afc4,function(_0x51d9ee){if(_0x51d9ee){logger[_0x87e3('0x7f')](_0x87e3('0x80'),_0x51d9ee);}else{fs[_0x87e3('0x81')](_0xd8c783);}});});});}else{return _0x12fab5[_0x87e3('0x1b')](0xc8);}})[_0x87e3('0x34')](handleError(_0x12fab5,null));}; \ No newline at end of file +var _0x7387=['OpenchannelMessage','omit','ids','getMessages','findOne','hasOwnProperty','nolimit','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','CmContact','Contact','Attachment','direction','secret','read','Account','Owner','fullname','get','mkdirSync','createdAt','toString','closed','threadId','Public','Private','Messages','existsSync','createReadStream','pipe','createWriteStream','basename','out','firstName','lastName','value','downloadInteraction.ejs','transcript-','.pdf','Openchannel','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','zip-dir','moment','ejs','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../config/environment','redis','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','update','destroy','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','getOptions','openchannel','query','user','then','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','find','create','body','describe','addMessage'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0x7387,0xbe));var _0x7738=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7387[_0x8c43de];return _0xa6591b;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x7738('0x0'));var moment=require(_0x7738('0x1'));var util=require('util');var path=require('path');var ejs=require(_0x7738('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x7738('0x3'));var qs=require('../../components/parsers/qs');var pdf=require(_0x7738('0x4'));var logger=require(_0x7738('0x5'))('api');var config=require(_0x7738('0x6'));var db=require('../../mysqldb')['db'];config[_0x7738('0x7')]=_['defaults'](config[_0x7738('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x7738('0x8'))(new Redis(config[_0x7738('0x7')]));require(_0x7738('0x9'))['register'](socket);function respondWithStatusCode(_0x2c20c4,_0x24c120){_0x24c120=_0x24c120||0xcc;return function(_0x4fc03c){if(_0x4fc03c){return _0x2c20c4[_0x7738('0xa')](_0x24c120);}return _0x2c20c4[_0x7738('0xb')](_0x24c120)[_0x7738('0xc')]();};}function respondWithResult(_0x20ec9f,_0x39cecc){_0x39cecc=_0x39cecc||0xc8;return function(_0x146d3f){if(_0x146d3f){return _0x20ec9f[_0x7738('0xb')](_0x39cecc)[_0x7738('0xd')](_0x146d3f);}};}function respondWithFilteredResult(_0x38241c,_0x1b9e65){return function(_0x541d6f){if(_0x541d6f){var _0x4242f4=typeof _0x1b9e65['offset']===_0x7738('0xe')&&typeof _0x1b9e65['limit']===_0x7738('0xe');var _0x2ff62b=_0x541d6f[_0x7738('0xf')];var _0x5672be=_0x4242f4?0x0:_0x1b9e65[_0x7738('0x10')];var _0x2be2c1=_0x4242f4?_0x541d6f[_0x7738('0xf')]:_0x1b9e65['offset']+_0x1b9e65[_0x7738('0x11')];var _0x540573;if(_0x2be2c1>=_0x2ff62b){_0x2be2c1=_0x2ff62b;_0x540573=0xc8;}else{_0x540573=0xce;}_0x38241c[_0x7738('0xb')](_0x540573);return _0x38241c[_0x7738('0x12')](_0x7738('0x13'),_0x5672be+'-'+_0x2be2c1+'/'+_0x2ff62b)[_0x7738('0xd')](_0x541d6f);}return null;};}function saveUpdates(_0x275773){return function(_0x34eb9a){if(_0x34eb9a){return _0x34eb9a[_0x7738('0x14')](_0x275773)['then'](function(_0x48ca71){return _0x48ca71;});}return null;};}function removeEntity(_0x175583){return function(_0x24d6d5){if(_0x24d6d5){return _0x24d6d5[_0x7738('0x15')]()['then'](function(){_0x175583[_0x7738('0xb')](0xcc)[_0x7738('0xc')]();});}};}function handleEntityNotFound(_0x1b3e7a){return function(_0x5a635a){if(!_0x5a635a){_0x1b3e7a[_0x7738('0xa')](0x194);}return _0x5a635a;};}function handleError(_0x440515,_0x23984d){_0x23984d=_0x23984d||0x1f4;return function(_0x41d718){logger[_0x7738('0x16')](_0x41d718[_0x7738('0x17')]);if(_0x41d718[_0x7738('0x18')]){delete _0x41d718[_0x7738('0x18')];}_0x440515[_0x7738('0xb')](_0x23984d)[_0x7738('0x19')](_0x41d718);};}exports[_0x7738('0x1a')]=function(_0x4cd777,_0x131df7){var _0x5d3710={};var _0x496eaa=_[_0x7738('0x1b')](db[_0x7738('0x1c')][_0x7738('0x1d')],function(_0x409ec4){return{'name':_0x409ec4[_0x7738('0x1e')],'type':_0x409ec4['type']['key']};});_0x5d3710=qs[_0x7738('0x1f')](_0x496eaa,_0x4cd777);return interaction['findAll'](_0x7738('0x20'),_0x4cd777[_0x7738('0x21')],_0x4cd777[_0x7738('0x22')],_0x5d3710,_0x496eaa)[_0x7738('0x23')](respondWithFilteredResult(_0x131df7,_0x5d3710))[_0x7738('0x24')](handleError(_0x131df7,null));};exports[_0x7738('0x25')]=function(_0x5b6697,_0x2ff730){var _0x15ee0a={};if(_0x5b6697['query']['type']&&_0x5b6697[_0x7738('0x21')]['type']==='from'){_0x15ee0a['from']=_0x5b6697['params']['id'];}else{_0x15ee0a['id']=_0x5b6697[_0x7738('0x26')]['id'];}var _0x31f973={'raw':![],'where':_0x15ee0a},_0x14b85b={};_0x14b85b[_0x7738('0x27')]=_[_0x7738('0x28')](db['OpenchannelInteraction'][_0x7738('0x1d')]);_0x14b85b[_0x7738('0x21')]=_[_0x7738('0x28')](_0x5b6697[_0x7738('0x21')]);_0x14b85b[_0x7738('0x29')]=_[_0x7738('0x2a')](_0x14b85b[_0x7738('0x27')],_0x14b85b[_0x7738('0x21')]);_0x31f973[_0x7738('0x2b')]=_['intersection'](_0x14b85b[_0x7738('0x27')],qs['fields'](_0x5b6697[_0x7738('0x21')][_0x7738('0x2c')]));_0x31f973['attributes']=_0x31f973[_0x7738('0x2b')][_0x7738('0x2d')]?_0x31f973[_0x7738('0x2b')]:_0x14b85b['model'];if(_0x5b6697[_0x7738('0x21')][_0x7738('0x2e')]){_0x31f973[_0x7738('0x2f')]=[{'all':!![]}];}_0x31f973=_[_0x7738('0x30')]({},_0x31f973,_0x5b6697['options']);return db[_0x7738('0x1c')][_0x7738('0x31')](_0x31f973)[_0x7738('0x23')](handleEntityNotFound(_0x2ff730,null))[_0x7738('0x23')](respondWithResult(_0x2ff730,null))[_0x7738('0x24')](handleError(_0x2ff730,null));};exports[_0x7738('0x32')]=function(_0x4c503d,_0x258f42){return db[_0x7738('0x1c')][_0x7738('0x32')](_0x4c503d[_0x7738('0x33')],{})['then'](respondWithResult(_0x258f42,0xc9))['catch'](handleError(_0x258f42,null));};exports[_0x7738('0x14')]=function(_0x3e5dc8,_0x465cda){if(_0x3e5dc8[_0x7738('0x33')]['id']){delete _0x3e5dc8[_0x7738('0x33')]['id'];}return db[_0x7738('0x1c')][_0x7738('0x31')]({'where':{'id':_0x3e5dc8[_0x7738('0x26')]['id']}})[_0x7738('0x23')](handleEntityNotFound(_0x465cda,null))[_0x7738('0x23')](saveUpdates(_0x3e5dc8['body'],null))[_0x7738('0x23')](respondWithResult(_0x465cda,null))[_0x7738('0x24')](handleError(_0x465cda,null));};exports[_0x7738('0x15')]=function(_0x3fb022,_0x3db669){return db[_0x7738('0x1c')][_0x7738('0x31')]({'where':{'id':_0x3fb022[_0x7738('0x26')]['id']}})[_0x7738('0x23')](handleEntityNotFound(_0x3db669,null))['then'](removeEntity(_0x3db669,null))[_0x7738('0x24')](handleError(_0x3db669,null));};exports[_0x7738('0x34')]=function(_0x249e22,_0x41eea7){return db[_0x7738('0x1c')][_0x7738('0x34')]()['then'](respondWithResult(_0x41eea7,null))[_0x7738('0x24')](handleError(_0x41eea7,null));};exports[_0x7738('0x35')]=function(_0x49a462,_0x63d49){return db[_0x7738('0x36')][_0x7738('0x31')]({'where':{'id':_0x49a462[_0x7738('0x26')]['id']}})['then'](handleEntityNotFound(_0x63d49,null))[_0x7738('0x23')](function(_0x47c2f7){if(_0x47c2f7){return _0x47c2f7[_0x7738('0x35')](_0x49a462[_0x7738('0x33')]['ids'],_[_0x7738('0x37')](_0x49a462[_0x7738('0x33')],[_0x7738('0x38'),'id'])||{});}})['then'](respondWithResult(_0x63d49,null))[_0x7738('0x24')](handleError(_0x63d49,null));};exports[_0x7738('0x39')]=function(_0x16467d,_0x3a7cf8){var _0x429623={'raw':![],'where':{}};var _0x4706e8={};var _0xa05a37={'count':0x0,'rows':[]};return db[_0x7738('0x1c')][_0x7738('0x3a')]({'where':{'id':_0x16467d['params']['id']}})[_0x7738('0x23')](handleEntityNotFound(_0x3a7cf8,null))[_0x7738('0x23')](function(_0x209764){if(_0x209764){_0x4706e8[_0x7738('0x27')]=_['keys'](db[_0x7738('0x36')][_0x7738('0x1d')]);_0x4706e8[_0x7738('0x21')]=_[_0x7738('0x28')](_0x16467d[_0x7738('0x21')]);_0x4706e8[_0x7738('0x29')]=_[_0x7738('0x2a')](_0x4706e8[_0x7738('0x27')],_0x4706e8['query']);_0x429623[_0x7738('0x2b')]=_[_0x7738('0x2a')](_0x4706e8[_0x7738('0x27')],qs[_0x7738('0x2c')](_0x16467d['query'][_0x7738('0x2c')]));_0x429623[_0x7738('0x2b')]=_0x429623[_0x7738('0x2b')][_0x7738('0x2d')]?_0x429623['attributes']:_0x4706e8[_0x7738('0x27')];if(!_0x16467d[_0x7738('0x21')][_0x7738('0x3b')](_0x7738('0x3c'))){_0x429623['limit']=qs[_0x7738('0x11')](_0x16467d[_0x7738('0x21')]['limit']);_0x429623['offset']=qs[_0x7738('0x10')](_0x16467d[_0x7738('0x21')][_0x7738('0x10')]);}_0x429623['order']=qs[_0x7738('0x3d')](_0x16467d[_0x7738('0x21')]['sort']);_0x429623[_0x7738('0x3e')]=qs[_0x7738('0x29')](_[_0x7738('0x3f')](_0x16467d['query'],_0x4706e8['filters']));_0x429623[_0x7738('0x3e')][_0x7738('0x40')]=_0x209764['id'];if(_0x16467d[_0x7738('0x21')][_0x7738('0x41')]){_0x429623[_0x7738('0x3e')]=_[_0x7738('0x30')](_0x429623['where'],{'$or':_[_0x7738('0x1b')](_0x429623[_0x7738('0x2b')],function(_0x11e4d6){var _0x5e04c0={};_0x5e04c0[_0x11e4d6]={'$like':'%'+_0x16467d[_0x7738('0x21')][_0x7738('0x41')]+'%'};return _0x5e04c0;})});}if(_0x16467d['query']['$gte']){var _0x166da0=_0x16467d[_0x7738('0x21')][_0x7738('0x42')][_0x7738('0x43')](',');var _0x5f3f57={};_0x5f3f57[_0x166da0[0x0]]={'$gte':moment(_0x166da0[0x1])[_0x7738('0x44')](_0x7738('0x45'))};_0x429623[_0x7738('0x3e')]=_[_0x7738('0x30')](_0x429623[_0x7738('0x3e')],_0x5f3f57);}_0x429623=_[_0x7738('0x30')]({},_0x429623,_0x16467d[_0x7738('0x46')]);return db['OpenchannelMessage']['count']({'where':_0x429623[_0x7738('0x3e')]})[_0x7738('0x23')](function(_0xe9372c){_0xa05a37[_0x7738('0xf')]=_0xe9372c;if(_0x16467d[_0x7738('0x21')][_0x7738('0x2e')]){_0x429623['include']=[{'all':!![]}];}return db[_0x7738('0x36')][_0x7738('0x47')](_0x429623);})[_0x7738('0x23')](function(_0x51300c){_0xa05a37['rows']=_0x51300c;return _0xa05a37;});}})['then'](respondWithFilteredResult(_0x3a7cf8,_0x429623))['catch'](handleError(_0x3a7cf8,null));};exports[_0x7738('0x48')]=function(_0x960d00,_0xee7752){return db['OpenchannelInteraction'][_0x7738('0x31')]({'where':{'id':_0x960d00['params']['id']}})[_0x7738('0x23')](handleEntityNotFound(_0xee7752,null))[_0x7738('0x23')](function(_0x2fd301){if(_0x2fd301){return _0x2fd301['setTags'](_0x960d00[_0x7738('0x33')][_0x7738('0x38')],_[_0x7738('0x37')](_0x960d00['body'],[_0x7738('0x38'),'id'])||{})[_0x7738('0x49')](function(){return db[_0x7738('0x4a')][_0x7738('0x47')]({'attributes':['id',_0x7738('0x18'),_0x7738('0x4b')],'where':{'id':_0x960d00[_0x7738('0x33')][_0x7738('0x38')]}});})[_0x7738('0x23')](function(_0x234a1e){socket[_0x7738('0x4c')](_0x7738('0x4d'),{'id':Number(_0x960d00[_0x7738('0x26')]['id']),'tags':_0x234a1e||[]});return{'id':Number(_0x960d00['params']['id']),'tags':_0x234a1e||[]};});}})[_0x7738('0x23')](respondWithResult(_0xee7752,null))[_0x7738('0x24')](handleError(_0xee7752,null));};exports[_0x7738('0x4e')]=function(_0x3aa879,_0x145b02){return db[_0x7738('0x1c')][_0x7738('0x31')]({'where':{'id':_0x3aa879['params']['id']}})[_0x7738('0x23')](handleEntityNotFound(_0x145b02,null))[_0x7738('0x23')](function(_0x32accf){if(_0x32accf){return _0x32accf[_0x7738('0x4e')](_0x3aa879['query'][_0x7738('0x38')]);}})[_0x7738('0x23')](respondWithStatusCode(_0x145b02,null))[_0x7738('0x24')](handleError(_0x145b02,null));};exports['download']=function(_0x21f287,_0x2f3215){var _0x3834c7=moment()[_0x7738('0x4f')]()['toString']();var _0x23008d=path[_0x7738('0x50')](config[_0x7738('0x51')],_0x7738('0x52'),_0x7738('0x53'),_0x7738('0x54'));var _0x249f00=path['join'](config['root'],_0x7738('0x52'),'files',_0x7738('0x55'));var _0x3756b8=path[_0x7738('0x50')](_0x23008d,_0x3834c7);var _0x179728=util['format'](_0x7738('0x56'),_0x21f287[_0x7738('0x26')]['id'],_0x3834c7);var _0x44a8e5=path[_0x7738('0x50')](_0x23008d,_0x179728);var _0x1c8a7b=[];_0x1c8a7b[_0x7738('0x57')]({'model':db[_0x7738('0x58')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x1c8a7b[_0x7738('0x57')]({'model':db[_0x7738('0x59')],'as':_0x7738('0x5a'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x21f287[_0x7738('0x21')][_0x7738('0x55')]){_0x1c8a7b[_0x7738('0x57')]({'model':db['Attachment'],'as':_0x7738('0x5b'),'raw':!![]});}var _0xbc7172=[{'model':db[_0x7738('0x36')],'as':'Messages','attributes':['id',_0x7738('0x33'),'createdAt',_0x7738('0x5c'),_0x7738('0x5d'),_0x7738('0x5e')],'include':_0x1c8a7b}];_0xbc7172[_0x7738('0x57')]({'model':db['OpenchannelAccount'],'as':_0x7738('0x5f'),'attributes':['id',_0x7738('0x18')]});_0xbc7172[_0x7738('0x57')]({'model':db[_0x7738('0x58')],'as':_0x7738('0x60'),'attributes':['id',_0x7738('0x61')]});return db[_0x7738('0x1c')]['find']({'where':{'id':_0x21f287[_0x7738('0x26')]['id']},'include':_0xbc7172})[_0x7738('0x23')](handleEntityNotFound(_0x2f3215,null))[_0x7738('0x23')](function(_0x484431){if(_0x484431){var _0x2ee34c=_0x484431[_0x7738('0x62')]({'plain':!![]});fs[_0x7738('0x63')](_0x3756b8);var _0x3c02bc={'channel':'Openchannel','account':_0x2ee34c[_0x7738('0x5f')][_0x7738('0x18')],'agent':_0x2ee34c[_0x7738('0x60')]?_0x2ee34c['Owner'][_0x7738('0x61')]:'N.A.','createdAt':moment(_0x2ee34c[_0x7738('0x64')])[_0x7738('0x44')](_0x7738('0x45'))[_0x7738('0x65')](),'closedAt':_0x2ee34c[_0x7738('0x66')]?moment(_0x2ee34c['closedAt'])[_0x7738('0x44')](_0x7738('0x45'))[_0x7738('0x65')]():'','disposition':_0x2ee34c['disposition'],'visibility':_0x2ee34c[_0x7738('0x67')]?_0x7738('0x68'):_0x7738('0x69'),'messages':_(_0x2ee34c[_0x7738('0x6a')])[_0x7738('0x41')]({'secret':![]})[_0x7738('0x1b')](function(_0x244b15){if(_0x244b15[_0x7738('0x5b')]){var _0x5a087e=path[_0x7738('0x50')](_0x249f00,_0x244b15['Attachment']['basename']);if(fs[_0x7738('0x6b')](_0x5a087e)){fs[_0x7738('0x6c')](_0x5a087e)[_0x7738('0x6d')](fs[_0x7738('0x6e')](path['join'](_0x3756b8,_0x244b15[_0x7738('0x5b')][_0x7738('0x6f')])));}}return{'date':moment(_0x244b15[_0x7738('0x64')])[_0x7738('0x44')](_0x7738('0x45'))[_0x7738('0x65')](),'sender':_0x244b15['direction']===_0x7738('0x70')?_0x244b15[_0x7738('0x58')]?_0x244b15[_0x7738('0x58')][_0x7738('0x61')]:'System':_0x244b15[_0x7738('0x5a')][_0x7738('0x71')]+(_0x244b15[_0x7738('0x5a')][_0x7738('0x72')]?'\x20'+_0x244b15[_0x7738('0x5a')][_0x7738('0x72')]:''),'body':_0x244b15[_0x7738('0x5b')]?_0x244b15[_0x7738('0x5b')]['basename']:_0x244b15[_0x7738('0x33')],'direction':_0x244b15['direction']===_0x7738('0x70')?'A':'C','secret':_0x244b15[_0x7738('0x5d')],'read':_0x244b15[_0x7738('0x5e')],'attachment':_0x244b15[_0x7738('0x5b')]};})[_0x7738('0x73')]()};return ejs['renderFile'](path[_0x7738('0x50')](config[_0x7738('0x51')],_0x7738('0x52'),'views',_0x7738('0x74')),{'interaction':_0x3c02bc})[_0x7738('0x23')](function(_0x1a021e){var _0x3bdf0c=path['join'](_0x3756b8,_0x7738('0x75')+_0x2ee34c['id']+'-'+_0x3834c7+_0x7738('0x76'));var _0x2cae38={'path':_0x3bdf0c,'channel':_0x7738('0x77'),'interactionId':_0x2ee34c['id']};return pdf['createPdfFromHTML'](_0x1a021e,_0x2cae38);})[_0x7738('0x23')](function(){return new Promise(function(_0x423e58,_0x55cbad){zipdir(_0x3756b8,{'saveTo':_0x44a8e5},function(_0x2ecccd,_0x16aa9a){if(_0x2ecccd)return _0x55cbad(_0x2ecccd);return _0x423e58(_0x16aa9a);});})['then'](function(){return new Promise(function(_0x400b0e,_0x4d0b8b){rimraf(_0x3756b8,function(_0x540c7a){if(_0x540c7a)_0x4d0b8b(_0x540c7a);return _0x400b0e();});});})[_0x7738('0x23')](function(){return _0x2f3215['download'](_0x44a8e5,_0x179728,function(_0x5cce11){if(_0x5cce11){logger[_0x7738('0x16')](_0x7738('0x78'),_0x5cce11);}else{fs[_0x7738('0x79')](_0x44a8e5);}});});});}else{return _0x2f3215[_0x7738('0xa')](0xc8);}})[_0x7738('0x24')](handleError(_0x2f3215,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 0b09835..b213858 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 _0x914e=['catch','hasOwnProperty','hook','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit'];(function(_0x4f26ba,_0x162eb7){var _0x422c5a=function(_0x307c34){while(--_0x307c34){_0x4f26ba['push'](_0x4f26ba['shift']());}};_0x422c5a(++_0x162eb7);}(_0x914e,0x1c5));var _0xe914=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x914e[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xe914('0x0'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xe914('0x0'))['db'][_0xe914('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe914('0x2')](0x0);var events={'afterCreate':_0xe914('0x3'),'afterUpdate':_0xe914('0x4'),'afterDestroy':_0xe914('0x5')};function emitEvent(_0x245bd5){return function(_0x2ccd51,_0x292feb,_0x213d4b){_0x2ccd51[_0xe914('0x6')]({'attributes':['id'],'raw':!![]})[_0xe914('0x7')](function(_0x58e8eb){_0x2ccd51['setDataValue'](_0xe914('0x8'),_0x58e8eb[_0xe914('0x9')](function(_0x2616b6){return{'id':_0x2616b6['id']};}));return OpenchannelMessage[_0xe914('0xa')]({'where':{'OpenchannelInteractionId':_0x2ccd51['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe914('0x7')](function(_0x19eb21){_0x2ccd51[_0xe914('0xb')](_0xe914('0xc'),_0x19eb21[_0xe914('0xd')]);OpenchannelInteractionEvents[_0xe914('0xe')](_0x245bd5+':'+_0x2ccd51['id'],_0x2ccd51);OpenchannelInteractionEvents[_0xe914('0xe')](_0x245bd5,_0x2ccd51);_0x213d4b(null);})[_0xe914('0xf')](_0x213d4b(null));};}for(var e in events){if(events[_0xe914('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xe914('0x11')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x38d8=['hook','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','emit','catch'];(function(_0x141088,_0x15d40d){var _0x461353=function(_0x26068d){while(--_0x26068d){_0x141088['push'](_0x141088['shift']());}};_0x461353(++_0x15d40d);}(_0x38d8,0xb5));var _0x838d=function(_0x1f99a0,_0x50b73d){_0x1f99a0=_0x1f99a0-0x0;var _0x1e0849=_0x38d8[_0x1f99a0];return _0x1e0849;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x838d('0x0'))['db'][_0x838d('0x1')];var OpenchannelMessage=require(_0x838d('0x0'))['db'][_0x838d('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x838d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x838d('0x4'),'afterDestroy':_0x838d('0x5')};function emitEvent(_0x3f5cec){return function(_0x4df053,_0x1ea0be,_0xb66a46){_0x4df053[_0x838d('0x6')]({'attributes':['id'],'raw':!![]})[_0x838d('0x7')](function(_0x1b4fe9){_0x4df053[_0x838d('0x8')](_0x838d('0x9'),_0x1b4fe9['map'](function(_0x44d919){return{'id':_0x44d919['id']};}));return OpenchannelMessage[_0x838d('0xa')]({'where':{'OpenchannelInteractionId':_0x4df053['id'],'direction':'in','read':![]},'raw':!![]});})[_0x838d('0x7')](function(_0xa64178){_0x4df053[_0x838d('0x8')](_0x838d('0xb'),_0xa64178['length']);OpenchannelInteractionEvents[_0x838d('0xc')](_0x3f5cec+':'+_0x4df053['id'],_0x4df053);OpenchannelInteractionEvents[_0x838d('0xc')](_0x3f5cec,_0x4df053);_0xb66a46(null);})[_0x838d('0xd')](_0xb66a46(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x838d('0xe')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 91534c7..8b861ca 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 _0x753e=['openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction'];(function(_0x4d1890,_0x58a623){var _0x433fd4=function(_0x48a403){while(--_0x48a403){_0x4d1890['push'](_0x4d1890['shift']());}};_0x433fd4(++_0x58a623);}(_0x753e,0xe2));var _0xe753=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x753e[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xe753('0x0'));var util=require(_0xe753('0x1'));var logger=require(_0xe753('0x2'))(_0xe753('0x3'));var moment=require(_0xe753('0x4'));var BPromise=require(_0xe753('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe753('0x6'));var rimraf=require(_0xe753('0x7'));var config=require(_0xe753('0x8'));var attributes=require(_0xe753('0x9'));module[_0xe753('0xa')]=function(_0x10915b,_0x49e0c0){return _0x10915b['define'](_0xe753('0xb'),attributes,{'tableName':_0xe753('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe753('0xd'),'collate':_0xe753('0xe'),'hooks':{'beforeUpdate':function(_0x3d7b36,_0x534bac,_0x1ef300){if(_0x3d7b36[_0xe753('0xf')](_0xe753('0x10'))){_0x3d7b36['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1ef300(null,_0x3d7b36);}}});}; \ No newline at end of file +var _0x84c5=['utf8mb4_unicode_ci','changed','closed','format','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','openchannel_interactions'];(function(_0x3a16b4,_0x1dfc5c){var _0x8eba2f=function(_0x506811){while(--_0x506811){_0x3a16b4['push'](_0x3a16b4['shift']());}};_0x8eba2f(++_0x1dfc5c);}(_0x84c5,0x9a));var _0x584c=function(_0x24819b,_0x32f536){_0x24819b=_0x24819b-0x0;var _0x3ea61f=_0x84c5[_0x24819b];return _0x3ea61f;};'use strict';var _=require('lodash');var util=require(_0x584c('0x0'));var logger=require(_0x584c('0x1'))(_0x584c('0x2'));var moment=require('moment');var BPromise=require(_0x584c('0x3'));var rp=require(_0x584c('0x4'));var fs=require('fs');var path=require(_0x584c('0x5'));var rimraf=require(_0x584c('0x6'));var config=require(_0x584c('0x7'));var attributes=require(_0x584c('0x8'));module['exports']=function(_0x12c067,_0x3c0a23){return _0x12c067[_0x584c('0x9')]('OpenchannelInteraction',attributes,{'tableName':_0x584c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x584c('0xb'),'hooks':{'beforeUpdate':function(_0x3fe0a0,_0x4cd533,_0x4b06c4){if(_0x3fe0a0[_0x584c('0xc')](_0x584c('0xd'))){_0x3fe0a0['closedAt']=moment()[_0x584c('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4b06c4(null,_0x3fe0a0);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index e93ed57..7b468a9 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 _0x048b=['limit','addTags','body','ids','omit','spread','AddTags','lodash','util','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','./openchannelInteraction.socket','register','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where'];(function(_0x4aeb86,_0x30b290){var _0x4c6b92=function(_0x2d523c){while(--_0x2d523c){_0x4aeb86['push'](_0x4aeb86['shift']());}};_0x4c6b92(++_0x30b290);}(_0x048b,0xc5));var _0xb048=function(_0x59e8e2,_0x3d6c74){_0x59e8e2=_0x59e8e2-0x0;var _0x53e8f0=_0x048b[_0x59e8e2];return _0x53e8f0;};'use strict';var _=require(_0xb048('0x0'));var util=require(_0xb048('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb048('0x2'));var db=require(_0xb048('0x3'))['db'];var utils=require(_0xb048('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb048('0x5'));var client=jayson[_0xb048('0x6')][_0xb048('0x7')]({'port':0x232a});config[_0xb048('0x8')]=_[_0xb048('0x9')](config[_0xb048('0x8')],{'host':_0xb048('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb048('0x8')]));require(_0xb048('0xb'))[_0xb048('0xc')](socket);function respondWithRpcPromise(_0x218ac1,_0x22d90a,_0x53968b){return new BPromise(function(_0x527bc5,_0x145af7){return client['request'](_0x218ac1,_0x53968b)[_0xb048('0xd')](function(_0x4401ab){logger['info'](_0xb048('0xe'),_0x22d90a,_0xb048('0xf'));logger[_0xb048('0x10')](_0xb048('0x11'),_0x22d90a,_0xb048('0xf'),JSON[_0xb048('0x12')](_0x4401ab));if(_0x4401ab[_0xb048('0x13')]){if(_0x4401ab[_0xb048('0x13')][_0xb048('0x14')]===0x1f4){logger[_0xb048('0x13')](_0xb048('0xe'),_0x22d90a,_0x4401ab[_0xb048('0x13')]['message']);return _0x145af7(_0x4401ab[_0xb048('0x13')][_0xb048('0x15')]);}logger[_0xb048('0x13')](_0xb048('0xe'),_0x22d90a,_0x4401ab[_0xb048('0x13')][_0xb048('0x15')]);return _0x527bc5(_0x4401ab[_0xb048('0x13')][_0xb048('0x15')]);}else{logger[_0xb048('0x16')](_0xb048('0xe'),_0x22d90a,'request\x20sent');_0x527bc5(_0x4401ab[_0xb048('0x17')][_0xb048('0x15')]);}})[_0xb048('0x18')](function(_0x4e434a){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x22d90a,_0x4e434a);_0x145af7(_0x4e434a);});});}exports[_0xb048('0x19')]=function(_0x402638){var _0x2ee3fa=this;return new Promise(function(_0x4a7821,_0x4bf508){return db[_0xb048('0x1a')][_0xb048('0x1b')](_0x402638['body'],{'raw':_0x402638['options']?_0x402638[_0xb048('0x1c')][_0xb048('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x402638[_0xb048('0x1c')]?_0x402638[_0xb048('0x1c')][_0xb048('0x1e')]||null:null,'attributes':_0x402638[_0xb048('0x1c')]?_0x402638[_0xb048('0x1c')]['attributes']||null:null,'limit':_0x402638[_0xb048('0x1c')]?_0x402638['options'][_0xb048('0x1f')]||null:null})[_0xb048('0xd')](function(_0x45e5d4){logger[_0xb048('0x16')](_0xb048('0x19'),_0x402638);logger[_0xb048('0x10')](_0xb048('0x19'),_0x402638,JSON['stringify'](_0x45e5d4));_0x4a7821(_0x45e5d4);})[_0xb048('0x18')](function(_0x23ccb2){logger[_0xb048('0x13')](_0xb048('0x19'),_0x23ccb2[_0xb048('0x15')],_0x402638);_0x4bf508(_0x2ee3fa[_0xb048('0x13')](0x1f4,_0x23ccb2[_0xb048('0x15')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x2071ef){return new Promise(function(_0x176153,_0x1f69a1){return db[_0xb048('0x1a')]['find']({'where':_0x2071ef[_0xb048('0x1c')]?_0x2071ef['options'][_0xb048('0x1e')]||null:null})[_0xb048('0xd')](function(_0xea11e8){if(_0xea11e8){return _0xea11e8[_0xb048('0x20')](_0x2071ef[_0xb048('0x21')][_0xb048('0x22')],_[_0xb048('0x23')](_0x2071ef[_0xb048('0x21')],[_0xb048('0x22'),'id'])||{});}})[_0xb048('0x24')](function(_0x209063){logger[_0xb048('0x16')]('AddTags',_0x2071ef);logger[_0xb048('0x10')](_0xb048('0x25'),_0x2071ef,JSON['stringify'](_0x209063));_0x176153(_0x209063);})[_0xb048('0x18')](function(_0x2e0440){logger[_0xb048('0x13')](_0xb048('0x25'),_0x2e0440[_0xb048('0x15')],_0x2071ef);_0x1f69a1(_this['error'](0x1f4,_0x2e0440[_0xb048('0x15')]));});});}; \ No newline at end of file +var _0xc3ce=['AddTags','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','attributes','limit','find','where','ids','omit','spread'];(function(_0x48d8fc,_0x5e5bc5){var _0x4c1900=function(_0x2c0be3){while(--_0x2c0be3){_0x48d8fc['push'](_0x48d8fc['shift']());}};_0x4c1900(++_0x5e5bc5);}(_0xc3ce,0x10b));var _0xec3c=function(_0x17468d,_0x313ae9){_0x17468d=_0x17468d-0x0;var _0x30971c=_0xc3ce[_0x17468d];return _0x30971c;};'use strict';var _=require(_0xec3c('0x0'));var util=require(_0xec3c('0x1'));var moment=require('moment');var BPromise=require(_0xec3c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec3c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xec3c('0x4'));var logger=require(_0xec3c('0x5'))(_0xec3c('0x6'));var config=require(_0xec3c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xec3c('0x8')][_0xec3c('0x9')]({'port':0x232a});config[_0xec3c('0xa')]=_[_0xec3c('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xec3c('0xc'))(new Redis(config['redis']));require(_0xec3c('0xd'))[_0xec3c('0xe')](socket);function respondWithRpcPromise(_0x3c0aa2,_0x4a6330,_0x2dac83){return new BPromise(function(_0x2cc013,_0x1d4b97){return client[_0xec3c('0xf')](_0x3c0aa2,_0x2dac83)[_0xec3c('0x10')](function(_0x38306c){logger[_0xec3c('0x11')](_0xec3c('0x12'),_0x4a6330,'request\x20sent');logger[_0xec3c('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x4a6330,_0xec3c('0x14'),JSON[_0xec3c('0x15')](_0x38306c));if(_0x38306c[_0xec3c('0x16')]){if(_0x38306c['error']['code']===0x1f4){logger[_0xec3c('0x16')](_0xec3c('0x12'),_0x4a6330,_0x38306c[_0xec3c('0x16')][_0xec3c('0x17')]);return _0x1d4b97(_0x38306c[_0xec3c('0x16')]['message']);}logger['error'](_0xec3c('0x12'),_0x4a6330,_0x38306c[_0xec3c('0x16')][_0xec3c('0x17')]);return _0x2cc013(_0x38306c['error'][_0xec3c('0x17')]);}else{logger[_0xec3c('0x11')](_0xec3c('0x12'),_0x4a6330,_0xec3c('0x14'));_0x2cc013(_0x38306c['result'][_0xec3c('0x17')]);}})[_0xec3c('0x18')](function(_0xa4dacb){logger[_0xec3c('0x16')](_0xec3c('0x12'),_0x4a6330,_0xa4dacb);_0x1d4b97(_0xa4dacb);});});}exports[_0xec3c('0x19')]=function(_0x460e51){var _0x32133c=this;return new Promise(function(_0x1c591c,_0x52d1e3){return db[_0xec3c('0x1a')]['update'](_0x460e51[_0xec3c('0x1b')],{'raw':_0x460e51[_0xec3c('0x1c')]?_0x460e51[_0xec3c('0x1c')][_0xec3c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x460e51['options']?_0x460e51[_0xec3c('0x1c')]['where']||null:null,'attributes':_0x460e51[_0xec3c('0x1c')]?_0x460e51[_0xec3c('0x1c')][_0xec3c('0x1e')]||null:null,'limit':_0x460e51['options']?_0x460e51[_0xec3c('0x1c')][_0xec3c('0x1f')]||null:null})[_0xec3c('0x10')](function(_0x4a01ab){logger[_0xec3c('0x11')](_0xec3c('0x19'),_0x460e51);logger[_0xec3c('0x13')](_0xec3c('0x19'),_0x460e51,JSON[_0xec3c('0x15')](_0x4a01ab));_0x1c591c(_0x4a01ab);})['catch'](function(_0x404e9f){logger[_0xec3c('0x16')](_0xec3c('0x19'),_0x404e9f['message'],_0x460e51);_0x52d1e3(_0x32133c[_0xec3c('0x16')](0x1f4,_0x404e9f[_0xec3c('0x17')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x5183eb){return new Promise(function(_0x189022,_0x35a501){return db['OpenchannelInteraction'][_0xec3c('0x20')]({'where':_0x5183eb[_0xec3c('0x1c')]?_0x5183eb[_0xec3c('0x1c')][_0xec3c('0x21')]||null:null})['then'](function(_0x55fc73){if(_0x55fc73){return _0x55fc73['addTags'](_0x5183eb['body'][_0xec3c('0x22')],_[_0xec3c('0x23')](_0x5183eb[_0xec3c('0x1b')],['ids','id'])||{});}})[_0xec3c('0x24')](function(_0x58c77b){logger[_0xec3c('0x11')](_0xec3c('0x25'),_0x5183eb);logger[_0xec3c('0x13')](_0xec3c('0x25'),_0x5183eb,JSON['stringify'](_0x58c77b));_0x189022(_0x58c77b);})[_0xec3c('0x18')](function(_0x25976e){logger['error'](_0xec3c('0x25'),_0x25976e['message'],_0x5183eb);_0x35a501(_this['error'](0x1f4,_0x25976e[_0xec3c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 986c2df..e926b61 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 _0x4466=['save','update','emit','register','length','openchannelInteraction:'];(function(_0x41b8d1,_0x3cc4c3){var _0x2c87ef=function(_0xff4d3e){while(--_0xff4d3e){_0x41b8d1['push'](_0x41b8d1['shift']());}};_0x2c87ef(++_0x3cc4c3);}(_0x4466,0x16e));var _0x6446=function(_0x13c4f8,_0x433521){_0x13c4f8=_0x13c4f8-0x0;var _0x5a8f4b=_0x4466[_0x13c4f8];return _0x5a8f4b;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x6446('0x0'),'remove',_0x6446('0x1')];function createListener(_0x12aba8,_0x5be939){return function(_0x5d0c88){_0x5be939[_0x6446('0x2')](_0x12aba8,_0x5d0c88);};}function removeListener(_0x2f7b69,_0x33705b){return function(){OpenchannelInteractionEvents['removeListener'](_0x2f7b69,_0x33705b);};}exports[_0x6446('0x3')]=function(_0x75be5a){for(var _0x13446c=0x0,_0xb01c02=events[_0x6446('0x4')];_0x13446c<_0xb01c02;_0x13446c++){var _0x29d3fb=events[_0x13446c];var _0x5c45b3=createListener(_0x6446('0x5')+_0x29d3fb,_0x75be5a);OpenchannelInteractionEvents['on'](_0x29d3fb,_0x5c45b3);}}; \ No newline at end of file +var _0xffe8=['length','openchannelInteraction:','save','remove','emit','removeListener','register'];(function(_0x43e227,_0x20da9e){var _0x1e9e57=function(_0x565e3a){while(--_0x565e3a){_0x43e227['push'](_0x43e227['shift']());}};_0x1e9e57(++_0x20da9e);}(_0xffe8,0xfe));var _0x8ffe=function(_0x27605b,_0x32808e){_0x27605b=_0x27605b-0x0;var _0x44eea4=_0xffe8[_0x27605b];return _0x44eea4;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x8ffe('0x0'),_0x8ffe('0x1'),'update'];function createListener(_0x6b57c6,_0x541c2f){return function(_0xca1c61){_0x541c2f[_0x8ffe('0x2')](_0x6b57c6,_0xca1c61);};}function removeListener(_0x31dea3,_0xa43ef6){return function(){OpenchannelInteractionEvents[_0x8ffe('0x3')](_0x31dea3,_0xa43ef6);};}exports[_0x8ffe('0x4')]=function(_0x2b54fb){for(var _0x1b3790=0x0,_0x346c99=events[_0x8ffe('0x5')];_0x1b3790<_0x346c99;_0x1b3790++){var _0x1c3743=events[_0x1b3790];var _0x4de284=createListener(_0x8ffe('0x6')+_0x1c3743,_0x2b54fb);OpenchannelInteractionEvents['on'](_0x1c3743,_0x4de284);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index a8c91b3..e3201a4 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x11b4cd,_0x178af0){var _0x280506=function(_0x182e8d){while(--_0x182e8d){_0x11b4cd['push'](_0x11b4cd['shift']());}};_0x280506(++_0x178af0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1c5950,_0x49e128){_0x1c5950=_0x1c5950-0x0;var _0x2b720a=_0xcb91[_0x1c5950];return _0x2b720a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0xfba933,_0x1b26f2){var _0x349af3=function(_0x4ff27f){while(--_0x4ff27f){_0xfba933['push'](_0xfba933['shift']());}};_0x349af3(++_0x1b26f2);}(_0xe706,0xa3));var _0x6e70=function(_0x554a48,_0x3b0b29){_0x554a48=_0x554a48-0x0;var _0x4cd1dc=_0xe706[_0x554a48];return _0x4cd1dc;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 43e3b0d..458f92a 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 _0xc29b=['sequelize','exports','TEXT','BOOLEAN','out','DATE','STRING'];(function(_0x173201,_0x16c3f6){var _0x40ba9e=function(_0x2d9ca3){while(--_0x2d9ca3){_0x173201['push'](_0x173201['shift']());}};_0x40ba9e(++_0x16c3f6);}(_0xc29b,0x12d));var _0xbc29=function(_0x51fd7b,_0x5967ef){_0x51fd7b=_0x51fd7b-0x0;var _0x41268c=_0xc29b[_0x51fd7b];return _0x41268c;};'use strict';var Sequelize=require(_0xbc29('0x0'));module[_0xbc29('0x1')]={'body':{'type':Sequelize[_0xbc29('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbc29('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbc29('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbc29('0x4')),'defaultValue':_0xbc29('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbc29('0x5')]},'providerName':{'type':Sequelize[_0xbc29('0x6')]},'providerResponse':{'type':Sequelize[_0xbc29('0x2')]}}; \ No newline at end of file +var _0xc06d=['BOOLEAN','ENUM','DATE','sequelize','exports','TEXT','medium'];(function(_0x2bc1fe,_0x45da98){var _0x1a47a5=function(_0x2e5053){while(--_0x2e5053){_0x2bc1fe['push'](_0x2bc1fe['shift']());}};_0x1a47a5(++_0x45da98);}(_0xc06d,0x15a));var _0xdc06=function(_0x34e540,_0x3112be){_0x34e540=_0x34e540-0x0;var _0x2dcc0a=_0xc06d[_0x34e540];return _0x2dcc0a;};'use strict';var Sequelize=require(_0xdc06('0x0'));module[_0xdc06('0x1')]={'body':{'type':Sequelize[_0xdc06('0x2')](_0xdc06('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xdc06('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdc06('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xdc06('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xdc06('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index d36734e..0015a6f 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 _0x9075=['mustache','util','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','undefined','count','set','Content-Range','apply','update','destroy','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','includeAll','findAll','rows','params','include','merge','options','find','create','body','describe','openchannel-interactions','accept','openchannel','format','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','Sequelize','event','rejectmessage','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x9075,0x7a));var _0x5907=function(_0xafa3b3,_0x419820){_0xafa3b3=_0xafa3b3-0x0;var _0x25fa7f=_0x9075[_0xafa3b3];return _0x25fa7f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5907('0x0'));var jsonpatch=require(_0x5907('0x1'));var rp=require(_0x5907('0x2'));var moment=require(_0x5907('0x3'));var BPromise=require(_0x5907('0x4'));var Mustache=require(_0x5907('0x5'));var util=require(_0x5907('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5907('0x7'));var ejs=require(_0x5907('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5907('0x9'));var crypto=require('crypto');var jsforce=require(_0x5907('0xa'));var deskjs=require(_0x5907('0xb'));var toCsv=require(_0x5907('0x7'));var querystring=require('querystring');var Papa=require(_0x5907('0xc'));var Redis=require(_0x5907('0xd'));var authService=require(_0x5907('0xe'));var qs=require(_0x5907('0xf'));var as=require(_0x5907('0x10'));var hardwareService=require(_0x5907('0x11'));var logger=require(_0x5907('0x12'))(_0x5907('0x13'));var utils=require(_0x5907('0x14'));var config=require(_0x5907('0x15'));var licenseUtil=require(_0x5907('0x16'));var db=require(_0x5907('0x17'))['db'];config[_0x5907('0x18')]=_[_0x5907('0x19')](config[_0x5907('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5907('0x1a'))(new Redis(config['redis']));require(_0x5907('0x1b'))[_0x5907('0x1c')](socket);var jayson=require(_0x5907('0x1d'));var client=jayson['client'][_0x5907('0x1e')]({'port':0x232c});var client9002=jayson[_0x5907('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb49e1e,_0x48fc51,_0x1ca74e,_0x37b123){return new BPromise(function(_0x30f796,_0x5e518d){var _0x240398=_0x37b123||client;return _0x240398['request'](_0xb49e1e,_0x1ca74e)[_0x5907('0x20')](function(_0x5213c1){logger[_0x5907('0x21')](_0x5907('0x22'),_0x48fc51,_0x5907('0x23'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x48fc51,_0x5907('0x23'),JSON[_0x5907('0x24')](_0x5213c1));if(_0x5213c1[_0x5907('0x25')]){if(_0x5213c1[_0x5907('0x25')][_0x5907('0x26')]===0x1f4){logger[_0x5907('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x48fc51,_0x5213c1['error'][_0x5907('0x27')]);return _0x5e518d(_0x5213c1[_0x5907('0x25')][_0x5907('0x27')]);}logger['error'](_0x5907('0x22'),_0x48fc51,_0x5213c1[_0x5907('0x25')][_0x5907('0x27')]);return _0x30f796(_0x5213c1[_0x5907('0x25')][_0x5907('0x27')]);}else{logger['info'](_0x5907('0x22'),_0x48fc51,'request\x20sent');_0x30f796(_0x5213c1[_0x5907('0x28')][_0x5907('0x27')]);}})[_0x5907('0x29')](function(_0x2c4106){logger[_0x5907('0x25')](_0x5907('0x22'),_0x48fc51,_0x2c4106);_0x5e518d(_0x2c4106);});});}function respondWithStatusCode(_0x2c4e85,_0x4f966b){_0x4f966b=_0x4f966b||0xcc;return function(_0x550d15){if(_0x550d15){return _0x2c4e85['sendStatus'](_0x4f966b);}return _0x2c4e85[_0x5907('0x2a')](_0x4f966b)[_0x5907('0x2b')]();};}function respondWithResult(_0x38e758,_0x38c2ae){_0x38c2ae=_0x38c2ae||0xc8;return function(_0xf1cafb){if(_0xf1cafb){return _0x38e758['status'](_0x38c2ae)[_0x5907('0x2c')](_0xf1cafb);}};}function respondWithFilteredResult(_0x4678c0,_0x5d5e28){return function(_0x307603){if(_0x307603){var _0x32f8c4=typeof _0x5d5e28[_0x5907('0x2d')]===_0x5907('0x2e')&&typeof _0x5d5e28['limit']===_0x5907('0x2e');var _0x4159ee=_0x307603[_0x5907('0x2f')];var _0xa68fa8=_0x32f8c4?0x0:_0x5d5e28[_0x5907('0x2d')];var _0x4c3c0c=_0x32f8c4?_0x307603['count']:_0x5d5e28[_0x5907('0x2d')]+_0x5d5e28['limit'];var _0x51bc99;if(_0x4c3c0c>=_0x4159ee){_0x4c3c0c=_0x4159ee;_0x51bc99=0xc8;}else{_0x51bc99=0xce;}_0x4678c0[_0x5907('0x2a')](_0x51bc99);return _0x4678c0[_0x5907('0x30')](_0x5907('0x31'),_0xa68fa8+'-'+_0x4c3c0c+'/'+_0x4159ee)[_0x5907('0x2c')](_0x307603);}return null;};}function patchUpdates(_0x2a0efc){return function(_0x2632af){try{jsonpatch[_0x5907('0x32')](_0x2632af,_0x2a0efc,!![]);}catch(_0x54419e){return BPromise['reject'](_0x54419e);}return _0x2632af['save']();};}function saveUpdates(_0x572a55,_0x32b1c5){return function(_0x492cf1){if(_0x492cf1){return _0x492cf1[_0x5907('0x33')](_0x572a55)[_0x5907('0x20')](function(_0x27a916){return _0x27a916;});}return null;};}function removeEntity(_0x4eb699,_0x57d8b7){return function(_0x2da61a){if(_0x2da61a){return _0x2da61a[_0x5907('0x34')]()[_0x5907('0x20')](function(){_0x4eb699[_0x5907('0x2a')](0xcc)[_0x5907('0x2b')]();});}};}function handleEntityNotFound(_0x400f72,_0x624b2e){return function(_0x9e459a){if(!_0x9e459a){_0x400f72['sendStatus'](0x194);}return _0x9e459a;};}function handleError(_0x2e4f02,_0x1f4086){_0x1f4086=_0x1f4086||0x1f4;return function(_0x34351a){logger[_0x5907('0x25')](_0x34351a[_0x5907('0x35')]);if(_0x34351a[_0x5907('0x36')]){delete _0x34351a['name'];}_0x2e4f02[_0x5907('0x2a')](_0x1f4086)[_0x5907('0x37')](_0x34351a);};}exports['index']=function(_0x1995d1,_0x524f07){var _0x3c0ec6={},_0x3ed37f={},_0x2e5377={'count':0x0,'rows':[]};var _0xefbffa=_[_0x5907('0x38')](db[_0x5907('0x39')][_0x5907('0x3a')],function(_0x1b5b3a){return{'name':_0x1b5b3a[_0x5907('0x3b')],'type':_0x1b5b3a[_0x5907('0x3c')][_0x5907('0x3d')]};});_0x3ed37f[_0x5907('0x3e')]=_['map'](_0xefbffa,'name');_0x3ed37f[_0x5907('0x3f')]=_[_0x5907('0x40')](_0x1995d1['query']);_0x3ed37f[_0x5907('0x41')]=_[_0x5907('0x42')](_0x3ed37f[_0x5907('0x3e')],_0x3ed37f[_0x5907('0x3f')]);_0x3c0ec6['attributes']=_[_0x5907('0x42')](_0x3ed37f[_0x5907('0x3e')],qs[_0x5907('0x43')](_0x1995d1[_0x5907('0x3f')]['fields']));_0x3c0ec6['attributes']=_0x3c0ec6['attributes'][_0x5907('0x44')]?_0x3c0ec6[_0x5907('0x45')]:_0x3ed37f['model'];if(!_0x1995d1[_0x5907('0x3f')][_0x5907('0x46')](_0x5907('0x47'))){_0x3c0ec6[_0x5907('0x48')]=qs[_0x5907('0x48')](_0x1995d1[_0x5907('0x3f')]['limit']);_0x3c0ec6[_0x5907('0x2d')]=qs[_0x5907('0x2d')](_0x1995d1[_0x5907('0x3f')][_0x5907('0x2d')]);}_0x3c0ec6['order']=qs[_0x5907('0x49')](_0x1995d1['query'][_0x5907('0x49')]);_0x3c0ec6[_0x5907('0x4a')]=qs['filters'](_[_0x5907('0x4b')](_0x1995d1[_0x5907('0x3f')],_0x3ed37f[_0x5907('0x41')]),_0xefbffa);if(_0x1995d1['query'][_0x5907('0x4c')]){_0x3c0ec6[_0x5907('0x4a')]=_['merge'](_0x3c0ec6[_0x5907('0x4a')],{'$or':_[_0x5907('0x38')](_0xefbffa,function(_0x463b82){if(_0x463b82[_0x5907('0x3c')]!==_0x5907('0x4d')){var _0x198cce={};_0x198cce[_0x463b82[_0x5907('0x36')]]={'$like':'%'+_0x1995d1[_0x5907('0x3f')][_0x5907('0x4c')]+'%'};return _0x198cce;}})});}_0x3c0ec6=_['merge']({},_0x3c0ec6,_0x1995d1['options']);var _0x452ae9={'where':_0x3c0ec6[_0x5907('0x4a')]};return db[_0x5907('0x39')]['count'](_0x452ae9)[_0x5907('0x20')](function(_0x479f4a){_0x2e5377[_0x5907('0x2f')]=_0x479f4a;if(_0x1995d1['query'][_0x5907('0x4e')]){_0x3c0ec6['include']=[{'all':!![]}];}return db[_0x5907('0x39')][_0x5907('0x4f')](_0x3c0ec6);})['then'](function(_0x20df0d){_0x2e5377[_0x5907('0x50')]=_0x20df0d;return _0x2e5377;})[_0x5907('0x20')](respondWithFilteredResult(_0x524f07,_0x3c0ec6))['catch'](handleError(_0x524f07,null));};exports['show']=function(_0x1f42ed,_0x254f10){var _0x556b0f={'raw':!![],'where':{'id':_0x1f42ed[_0x5907('0x51')]['id']}},_0x58bc2c={};_0x58bc2c['model']=_[_0x5907('0x40')](db['OpenchannelMessage'][_0x5907('0x3a')]);_0x58bc2c[_0x5907('0x3f')]=_[_0x5907('0x40')](_0x1f42ed[_0x5907('0x3f')]);_0x58bc2c[_0x5907('0x41')]=_[_0x5907('0x42')](_0x58bc2c[_0x5907('0x3e')],_0x58bc2c[_0x5907('0x3f')]);_0x556b0f[_0x5907('0x45')]=_[_0x5907('0x42')](_0x58bc2c[_0x5907('0x3e')],qs[_0x5907('0x43')](_0x1f42ed['query'][_0x5907('0x43')]));_0x556b0f[_0x5907('0x45')]=_0x556b0f['attributes'][_0x5907('0x44')]?_0x556b0f['attributes']:_0x58bc2c['model'];if(_0x1f42ed[_0x5907('0x3f')][_0x5907('0x4e')]){_0x556b0f[_0x5907('0x52')]=[{'all':!![]}];}_0x556b0f=_[_0x5907('0x53')]({},_0x556b0f,_0x1f42ed[_0x5907('0x54')]);return db[_0x5907('0x39')][_0x5907('0x55')](_0x556b0f)[_0x5907('0x20')](handleEntityNotFound(_0x254f10,null))[_0x5907('0x20')](respondWithResult(_0x254f10,null))[_0x5907('0x29')](handleError(_0x254f10,null));};exports[_0x5907('0x56')]=function(_0x2d43ef,_0xc9f76e){return db[_0x5907('0x39')][_0x5907('0x56')](_0x2d43ef['body'],{})[_0x5907('0x20')](respondWithResult(_0xc9f76e,0xc9))[_0x5907('0x29')](handleError(_0xc9f76e,null));};exports[_0x5907('0x33')]=function(_0x33fcc2,_0x42d77f){if(_0x33fcc2[_0x5907('0x57')]['id']){delete _0x33fcc2[_0x5907('0x57')]['id'];}return db[_0x5907('0x39')][_0x5907('0x55')]({'where':{'id':_0x33fcc2[_0x5907('0x51')]['id']}})['then'](handleEntityNotFound(_0x42d77f,null))[_0x5907('0x20')](saveUpdates(_0x33fcc2[_0x5907('0x57')],null))[_0x5907('0x20')](respondWithResult(_0x42d77f,null))['catch'](handleError(_0x42d77f,null));};exports[_0x5907('0x34')]=function(_0x5cfdcf,_0x12d8eb){return db[_0x5907('0x39')][_0x5907('0x55')]({'where':{'id':_0x5cfdcf[_0x5907('0x51')]['id']}})[_0x5907('0x20')](handleEntityNotFound(_0x12d8eb,null))[_0x5907('0x20')](removeEntity(_0x12d8eb,null))[_0x5907('0x29')](handleError(_0x12d8eb,null));};exports[_0x5907('0x58')]=function(_0x4b38d3,_0x13c0ee){return db[_0x5907('0x39')][_0x5907('0x58')]()[_0x5907('0x20')](respondWithResult(_0x13c0ee,null))['catch'](handleError(_0x13c0ee,null));};var interaction_log=require(_0x5907('0x12'))(_0x5907('0x59'));exports[_0x5907('0x5a')]=function(_0x119b2c,_0x11b348,_0x1995db){var _0x585938={'agent':{},'channel':_0x5907('0x5b')};if(_0x119b2c[_0x5907('0x57')]['id']){delete _0x119b2c[_0x5907('0x57')]['id'];}_0x119b2c[_0x5907('0x57')]['read']=!![];_0x119b2c[_0x5907('0x57')]['readAt']=moment()[_0x5907('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x119b2c['body'][_0x5907('0x5d')]=_0x119b2c[_0x5907('0x57')]['UserId']||_0x119b2c['user']['id'];_0x585938[_0x5907('0x5e')]['id']=_0x119b2c['body'][_0x5907('0x5d')];return db[_0x5907('0x39')][_0x5907('0x55')]({'where':{'id':_0x119b2c[_0x5907('0x51')]['id'],'UserId':null}})[_0x5907('0x20')](handleEntityNotFound(_0x11b348,null))[_0x5907('0x20')](saveUpdates(_0x119b2c[_0x5907('0x57')],null))['then'](function(_0x9e51c5){if(_0x9e51c5){_0x585938[_0x5907('0x27')]=_0x9e51c5[_0x5907('0x5f')]({'plain':!![]});return db[_0x5907('0x60')][_0x5907('0x55')]({'where':{'id':_0x9e51c5[_0x5907('0x61')]}});}return null;})[_0x5907('0x20')](handleEntityNotFound(_0x11b348,null))['then'](function(_0x5afac9){if(_0x5afac9){return _0x5afac9['update']({'UserId':_0x119b2c[_0x5907('0x57')][_0x5907('0x5d')],'read1stAt':_[_0x5907('0x62')](_0x5afac9[_0x5907('0x63')])?moment()[_0x5907('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5907('0x20')](function(_0x4c4b3a){if(_0x4c4b3a){_0x585938['interaction']=_0x4c4b3a[_0x5907('0x5f')]({'plain':!![]});interaction_log[_0x5907('0x21')](_0x5907('0x64'),_0x119b2c[_0x5907('0x65')]['id'],_0x119b2c[_0x5907('0x65')][_0x5907('0x36')],_0x119b2c[_0x5907('0x65')][_0x5907('0x66')],_0x585938[_0x5907('0x67')]['id'],_0x119b2c[_0x5907('0x57')]?JSON[_0x5907('0x24')](_0x119b2c[_0x5907('0x57')]):'null');return respondWithRpcPromise('AcceptMessage',_0x5907('0x68'),_0x585938);}return null;})['then'](function(_0x293a23){var _0x466f82=_0x5907('0x69')+_0x293a23[_0x5907('0x27')][_0x5907('0x6a')];return db['sequelize'][_0x5907('0x3f')](_0x466f82,{'type':db['Sequelize'][_0x5907('0x6b')][_0x5907('0x6c')],'raw':!![]})[_0x5907('0x20')](function(_0x24123b){return _0x24123b;});})[_0x5907('0x20')](function(_0x3d4f65){if(_0x3d4f65){_0x585938['message'][_0x5907('0x6d')]=_0x3d4f65[0x0];if(!_0x119b2c['body'][_0x5907('0x5d')])return;return db[_0x5907('0x6e')][_0x5907('0x55')]({'where':{'id':_0x119b2c[_0x5907('0x57')][_0x5907('0x5d')],'role':_0x5907('0x5e')},'attributes':['id',_0x5907('0x36'),_0x5907('0x6f'),'email',_0x5907('0x70')],'raw':!![]});}return null;})[_0x5907('0x20')](function(_0x4ae600){if(!_0x4ae600)return null;_0x585938['message'][_0x5907('0x5e')]=_0x4ae600;return _0x585938;})['then'](function(_0x59369e){if(_0x59369e){if(_0x119b2c[_0x5907('0x57')][_0x5907('0x71')]){_0x585938[_0x5907('0x27')][_0x5907('0x72')]=util[_0x5907('0x5c')](_0x5907('0x73'),_0x119b2c[_0x5907('0x65')]['name']);_0x585938[_0x5907('0x27')][_0x5907('0x74')]=_0x585938[_0x5907('0x74')];_0x585938[_0x5907('0x27')][_0x5907('0x75')]=_0x585938[_0x5907('0x74')];_0x585938[_0x5907('0x27')]['event']=_0x5907('0x5a');return respondWithRpcPromise(_0x5907('0x76'),_0x5907('0x76'),{'event':'acceptmessage','message':_0x585938[_0x5907('0x27')]},client9002)[_0x5907('0x20')](function(){return _0x585938;});}return _0x585938;}return null;})[_0x5907('0x20')](respondWithResult(_0x11b348,null))[_0x5907('0x29')](handleError(_0x11b348,null));};var interaction_log=require(_0x5907('0x12'))(_0x5907('0x59'));exports[_0x5907('0x77')]=function(_0x9db540,_0x3adcda,_0x23180b){var _0x39f1c2={'agent':{},'channel':'openchannel'};if(_0x9db540['body']['id']){delete _0x9db540[_0x5907('0x57')]['id'];}_0x9db540['body'][_0x5907('0x5d')]=_0x9db540['body'][_0x5907('0x5d')]||_0x9db540[_0x5907('0x65')]['id'];_0x39f1c2[_0x5907('0x5e')]['id']=_0x9db540[_0x5907('0x57')][_0x5907('0x5d')];return db[_0x5907('0x39')]['find']({'where':{'id':_0x9db540[_0x5907('0x51')]['id'],'UserId':null}})[_0x5907('0x20')](handleEntityNotFound(_0x3adcda,null))[_0x5907('0x20')](function(_0x1e7cc7){if(_0x1e7cc7){_0x39f1c2[_0x5907('0x27')]=_0x1e7cc7[_0x5907('0x5f')]({'plain':!![]});return db[_0x5907('0x60')][_0x5907('0x55')]({'where':{'id':_0x1e7cc7['OpenchannelInteractionId']}});}return null;})[_0x5907('0x20')](handleEntityNotFound(_0x3adcda,null))[_0x5907('0x20')](function(_0x3ed0f7){if(_0x3ed0f7){_0x39f1c2['interaction']=_0x3ed0f7[_0x5907('0x5f')]({'plain':!![]});interaction_log['info'](_0x5907('0x78'),_0x9db540[_0x5907('0x65')]['id'],_0x9db540[_0x5907('0x65')][_0x5907('0x36')],_0x9db540[_0x5907('0x65')][_0x5907('0x66')],_0x39f1c2[_0x5907('0x67')]['id'],_0x9db540[_0x5907('0x57')]?JSON[_0x5907('0x24')](_0x9db540['body']):_0x5907('0x79'));return respondWithRpcPromise(_0x5907('0x7a'),_0x5907('0x7b'),_0x39f1c2);}return null;})[_0x5907('0x20')](function(_0x365f6c){var _0x129005=_0x5907('0x69')+_0x365f6c[_0x5907('0x27')]['ContactId'];return db['sequelize'][_0x5907('0x3f')](_0x129005,{'type':db[_0x5907('0x7c')]['QueryTypes'][_0x5907('0x6c')],'raw':!![]})[_0x5907('0x20')](function(_0x404fbd){return _0x404fbd;});})[_0x5907('0x20')](function(_0x1af443){if(_0x1af443){_0x39f1c2[_0x5907('0x27')]['contact']=_0x1af443[0x0];if(!_0x9db540[_0x5907('0x57')][_0x5907('0x5d')])return;return db['User']['find']({'where':{'id':_0x9db540[_0x5907('0x57')]['UserId'],'role':_0x5907('0x5e')},'attributes':['id',_0x5907('0x36'),_0x5907('0x6f'),'email','internal'],'raw':!![]});}return null;})[_0x5907('0x20')](function(_0x482573){if(!_0x482573)return null;_0x39f1c2[_0x5907('0x27')][_0x5907('0x5e')]=_0x482573;return _0x39f1c2;})[_0x5907('0x20')](function(_0x1e3249){if(_0x1e3249){_0x1e3249[_0x5907('0x27')][_0x5907('0x72')]=util['format'](_0x5907('0x73'),_0x9db540[_0x5907('0x65')][_0x5907('0x36')]);_0x1e3249[_0x5907('0x27')]['channel']=_0x39f1c2[_0x5907('0x74')];_0x1e3249[_0x5907('0x27')]['motionChannel']=_0x39f1c2[_0x5907('0x74')];_0x1e3249[_0x5907('0x27')][_0x5907('0x7d')]=_0x5907('0x77');respondWithRpcPromise(_0x5907('0x76'),_0x5907('0x76'),{'event':_0x5907('0x7e'),'message':_0x1e3249[_0x5907('0x27')]},client9002);return _0x39f1c2;}return null;})[_0x5907('0x20')](respondWithResult(_0x3adcda,null))[_0x5907('0x29')](handleError(_0x3adcda,null));}; \ No newline at end of file +var _0x51d1=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','params','includeAll','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','email','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','User','internal','interface','rejectmessage','eml-format','rimraf','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','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','end','stack','name','send','index','map','OpenchannelMessage','rawAttributes','type'];(function(_0x242afe,_0x14680b){var _0x3293e9=function(_0x1244e7){while(--_0x1244e7){_0x242afe['push'](_0x242afe['shift']());}};_0x3293e9(++_0x14680b);}(_0x51d1,0x1d6));var _0x151d=function(_0x483d2a,_0x4bffba){_0x483d2a=_0x483d2a-0x0;var _0x5ba5d5=_0x51d1[_0x483d2a];return _0x5ba5d5;};'use strict';var emlformat=require(_0x151d('0x0'));var rimraf=require(_0x151d('0x1'));var zipdir=require(_0x151d('0x2'));var jsonpatch=require(_0x151d('0x3'));var rp=require(_0x151d('0x4'));var moment=require(_0x151d('0x5'));var BPromise=require(_0x151d('0x6'));var Mustache=require(_0x151d('0x7'));var util=require(_0x151d('0x8'));var path=require(_0x151d('0x9'));var sox=require(_0x151d('0xa'));var csv=require('to-csv');var ejs=require(_0x151d('0xb'));var fs=require('fs');var fs_extra=require(_0x151d('0xc'));var _=require(_0x151d('0xd'));var squel=require(_0x151d('0xe'));var crypto=require(_0x151d('0xf'));var jsforce=require(_0x151d('0x10'));var deskjs=require(_0x151d('0x11'));var toCsv=require(_0x151d('0x12'));var querystring=require(_0x151d('0x13'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x151d('0x14'));var qs=require(_0x151d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x151d('0x16'));var logger=require(_0x151d('0x17'))(_0x151d('0x18'));var utils=require(_0x151d('0x19'));var config=require(_0x151d('0x1a'));var licenseUtil=require(_0x151d('0x1b'));var db=require(_0x151d('0x1c'))['db'];config[_0x151d('0x1d')]=_[_0x151d('0x1e')](config[_0x151d('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x151d('0x1f'))(new Redis(config[_0x151d('0x1d')]));require(_0x151d('0x20'))[_0x151d('0x21')](socket);var jayson=require(_0x151d('0x22'));var client=jayson[_0x151d('0x23')]['http']({'port':0x232c});var client9002=jayson[_0x151d('0x23')][_0x151d('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x43629c,_0x2e973b,_0x26bbca,_0x2f5b1b){return new BPromise(function(_0x30ce58,_0x47f4ff){var _0x1eab1a=_0x2f5b1b||client;return _0x1eab1a[_0x151d('0x25')](_0x43629c,_0x26bbca)[_0x151d('0x26')](function(_0x57e3b1){logger[_0x151d('0x27')](_0x151d('0x28'),_0x2e973b,_0x151d('0x29'));logger[_0x151d('0x2a')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x2e973b,_0x151d('0x29'),JSON['stringify'](_0x57e3b1));if(_0x57e3b1['error']){if(_0x57e3b1[_0x151d('0x2b')][_0x151d('0x2c')]===0x1f4){logger[_0x151d('0x2b')](_0x151d('0x28'),_0x2e973b,_0x57e3b1[_0x151d('0x2b')][_0x151d('0x2d')]);return _0x47f4ff(_0x57e3b1['error'][_0x151d('0x2d')]);}logger[_0x151d('0x2b')](_0x151d('0x28'),_0x2e973b,_0x57e3b1['error'][_0x151d('0x2d')]);return _0x30ce58(_0x57e3b1[_0x151d('0x2b')][_0x151d('0x2d')]);}else{logger[_0x151d('0x27')](_0x151d('0x28'),_0x2e973b,_0x151d('0x29'));_0x30ce58(_0x57e3b1[_0x151d('0x2e')][_0x151d('0x2d')]);}})[_0x151d('0x2f')](function(_0xe7ffd0){logger[_0x151d('0x2b')](_0x151d('0x28'),_0x2e973b,_0xe7ffd0);_0x47f4ff(_0xe7ffd0);});});}function respondWithStatusCode(_0x2d2b3e,_0x4790f7){_0x4790f7=_0x4790f7||0xcc;return function(_0x5d36bd){if(_0x5d36bd){return _0x2d2b3e[_0x151d('0x30')](_0x4790f7);}return _0x2d2b3e[_0x151d('0x31')](_0x4790f7)['end']();};}function respondWithResult(_0x4b1263,_0x17b985){_0x17b985=_0x17b985||0xc8;return function(_0x1fd9cb){if(_0x1fd9cb){return _0x4b1263['status'](_0x17b985)[_0x151d('0x32')](_0x1fd9cb);}};}function respondWithFilteredResult(_0x65922e,_0x4de0ef){return function(_0x2bcae7){if(_0x2bcae7){var _0x791b82=typeof _0x4de0ef[_0x151d('0x33')]===_0x151d('0x34')&&typeof _0x4de0ef[_0x151d('0x35')]===_0x151d('0x34');var _0x377920=_0x2bcae7[_0x151d('0x36')];var _0xdbd2e7=_0x791b82?0x0:_0x4de0ef[_0x151d('0x33')];var _0x2495cd=_0x791b82?_0x2bcae7[_0x151d('0x36')]:_0x4de0ef[_0x151d('0x33')]+_0x4de0ef[_0x151d('0x35')];var _0x270a83;if(_0x2495cd>=_0x377920){_0x2495cd=_0x377920;_0x270a83=0xc8;}else{_0x270a83=0xce;}_0x65922e[_0x151d('0x31')](_0x270a83);return _0x65922e[_0x151d('0x37')](_0x151d('0x38'),_0xdbd2e7+'-'+_0x2495cd+'/'+_0x377920)[_0x151d('0x32')](_0x2bcae7);}return null;};}function patchUpdates(_0x287171){return function(_0x1876e0){try{jsonpatch[_0x151d('0x39')](_0x1876e0,_0x287171,!![]);}catch(_0x450bad){return BPromise[_0x151d('0x3a')](_0x450bad);}return _0x1876e0['save']();};}function saveUpdates(_0x13a6c8,_0x3d664d){return function(_0x2b9f52){if(_0x2b9f52){return _0x2b9f52[_0x151d('0x3b')](_0x13a6c8)['then'](function(_0x20e505){return _0x20e505;});}return null;};}function removeEntity(_0x256247,_0x5bdafe){return function(_0x5ec482){if(_0x5ec482){return _0x5ec482[_0x151d('0x3c')]()[_0x151d('0x26')](function(){_0x256247[_0x151d('0x31')](0xcc)[_0x151d('0x3d')]();});}};}function handleEntityNotFound(_0x49c489,_0x410f6e){return function(_0x5c76a8){if(!_0x5c76a8){_0x49c489[_0x151d('0x30')](0x194);}return _0x5c76a8;};}function handleError(_0x4ddd0d,_0x4f586f){_0x4f586f=_0x4f586f||0x1f4;return function(_0xde181e){logger['error'](_0xde181e[_0x151d('0x3e')]);if(_0xde181e['name']){delete _0xde181e[_0x151d('0x3f')];}_0x4ddd0d['status'](_0x4f586f)[_0x151d('0x40')](_0xde181e);};}exports[_0x151d('0x41')]=function(_0x3c0823,_0x9eb943){var _0x13a6d5={},_0x38656d={},_0x4e53aa={'count':0x0,'rows':[]};var _0x1a2a52=_[_0x151d('0x42')](db[_0x151d('0x43')][_0x151d('0x44')],function(_0x387489){return{'name':_0x387489['fieldName'],'type':_0x387489[_0x151d('0x45')][_0x151d('0x46')]};});_0x38656d[_0x151d('0x47')]=_['map'](_0x1a2a52,'name');_0x38656d[_0x151d('0x48')]=_[_0x151d('0x49')](_0x3c0823[_0x151d('0x48')]);_0x38656d[_0x151d('0x4a')]=_[_0x151d('0x4b')](_0x38656d['model'],_0x38656d[_0x151d('0x48')]);_0x13a6d5[_0x151d('0x4c')]=_[_0x151d('0x4b')](_0x38656d[_0x151d('0x47')],qs['fields'](_0x3c0823[_0x151d('0x48')][_0x151d('0x4d')]));_0x13a6d5[_0x151d('0x4c')]=_0x13a6d5['attributes'][_0x151d('0x4e')]?_0x13a6d5[_0x151d('0x4c')]:_0x38656d[_0x151d('0x47')];if(!_0x3c0823[_0x151d('0x48')][_0x151d('0x4f')]('nolimit')){_0x13a6d5['limit']=qs[_0x151d('0x35')](_0x3c0823[_0x151d('0x48')]['limit']);_0x13a6d5[_0x151d('0x33')]=qs[_0x151d('0x33')](_0x3c0823['query'][_0x151d('0x33')]);}_0x13a6d5[_0x151d('0x50')]=qs[_0x151d('0x51')](_0x3c0823[_0x151d('0x48')]['sort']);_0x13a6d5[_0x151d('0x52')]=qs[_0x151d('0x4a')](_[_0x151d('0x53')](_0x3c0823[_0x151d('0x48')],_0x38656d[_0x151d('0x4a')]),_0x1a2a52);if(_0x3c0823[_0x151d('0x48')]['filter']){_0x13a6d5[_0x151d('0x52')]=_['merge'](_0x13a6d5[_0x151d('0x52')],{'$or':_[_0x151d('0x42')](_0x1a2a52,function(_0x4840de){if(_0x4840de[_0x151d('0x45')]!=='VIRTUAL'){var _0x35708e={};_0x35708e[_0x4840de[_0x151d('0x3f')]]={'$like':'%'+_0x3c0823[_0x151d('0x48')][_0x151d('0x54')]+'%'};return _0x35708e;}})});}_0x13a6d5=_[_0x151d('0x55')]({},_0x13a6d5,_0x3c0823[_0x151d('0x56')]);var _0x37b458={'where':_0x13a6d5[_0x151d('0x52')]};return db[_0x151d('0x43')][_0x151d('0x36')](_0x37b458)['then'](function(_0x46ed36){_0x4e53aa[_0x151d('0x36')]=_0x46ed36;if(_0x3c0823[_0x151d('0x48')]['includeAll']){_0x13a6d5[_0x151d('0x57')]=[{'all':!![]}];}return db[_0x151d('0x43')][_0x151d('0x58')](_0x13a6d5);})[_0x151d('0x26')](function(_0x273212){_0x4e53aa[_0x151d('0x59')]=_0x273212;return _0x4e53aa;})['then'](respondWithFilteredResult(_0x9eb943,_0x13a6d5))[_0x151d('0x2f')](handleError(_0x9eb943,null));};exports['show']=function(_0x4b8f4f,_0x196dbb){var _0x6db60f={'raw':!![],'where':{'id':_0x4b8f4f[_0x151d('0x5a')]['id']}},_0x29153c={};_0x29153c['model']=_['keys'](db[_0x151d('0x43')][_0x151d('0x44')]);_0x29153c[_0x151d('0x48')]=_[_0x151d('0x49')](_0x4b8f4f['query']);_0x29153c[_0x151d('0x4a')]=_[_0x151d('0x4b')](_0x29153c[_0x151d('0x47')],_0x29153c[_0x151d('0x48')]);_0x6db60f['attributes']=_['intersection'](_0x29153c[_0x151d('0x47')],qs[_0x151d('0x4d')](_0x4b8f4f[_0x151d('0x48')][_0x151d('0x4d')]));_0x6db60f['attributes']=_0x6db60f[_0x151d('0x4c')][_0x151d('0x4e')]?_0x6db60f[_0x151d('0x4c')]:_0x29153c['model'];if(_0x4b8f4f[_0x151d('0x48')][_0x151d('0x5b')]){_0x6db60f[_0x151d('0x57')]=[{'all':!![]}];}_0x6db60f=_['merge']({},_0x6db60f,_0x4b8f4f['options']);return db[_0x151d('0x43')][_0x151d('0x5c')](_0x6db60f)[_0x151d('0x26')](handleEntityNotFound(_0x196dbb,null))[_0x151d('0x26')](respondWithResult(_0x196dbb,null))['catch'](handleError(_0x196dbb,null));};exports['create']=function(_0x3ddec8,_0xd2610){return db[_0x151d('0x43')][_0x151d('0x5d')](_0x3ddec8[_0x151d('0x5e')],{})[_0x151d('0x26')](respondWithResult(_0xd2610,0xc9))['catch'](handleError(_0xd2610,null));};exports['update']=function(_0x14705e,_0x40e13e){if(_0x14705e[_0x151d('0x5e')]['id']){delete _0x14705e[_0x151d('0x5e')]['id'];}return db['OpenchannelMessage'][_0x151d('0x5c')]({'where':{'id':_0x14705e[_0x151d('0x5a')]['id']}})[_0x151d('0x26')](handleEntityNotFound(_0x40e13e,null))[_0x151d('0x26')](saveUpdates(_0x14705e['body'],null))[_0x151d('0x26')](respondWithResult(_0x40e13e,null))[_0x151d('0x2f')](handleError(_0x40e13e,null));};exports[_0x151d('0x3c')]=function(_0x5ba794,_0x20e081){return db[_0x151d('0x43')][_0x151d('0x5c')]({'where':{'id':_0x5ba794[_0x151d('0x5a')]['id']}})[_0x151d('0x26')](handleEntityNotFound(_0x20e081,null))[_0x151d('0x26')](removeEntity(_0x20e081,null))[_0x151d('0x2f')](handleError(_0x20e081,null));};exports[_0x151d('0x5f')]=function(_0x56cf40,_0x4914b0){return db[_0x151d('0x43')][_0x151d('0x5f')]()[_0x151d('0x26')](respondWithResult(_0x4914b0,null))[_0x151d('0x2f')](handleError(_0x4914b0,null));};var interaction_log=require(_0x151d('0x17'))(_0x151d('0x60'));exports[_0x151d('0x61')]=function(_0x241328,_0x275c55,_0x285a79){var _0x3d6a67={'agent':{},'channel':_0x151d('0x62')};if(_0x241328[_0x151d('0x5e')]['id']){delete _0x241328[_0x151d('0x5e')]['id'];}_0x241328[_0x151d('0x5e')][_0x151d('0x63')]=!![];_0x241328[_0x151d('0x5e')][_0x151d('0x64')]=moment()[_0x151d('0x65')](_0x151d('0x66'));_0x241328[_0x151d('0x5e')]['UserId']=_0x241328[_0x151d('0x5e')][_0x151d('0x67')]||_0x241328[_0x151d('0x68')]['id'];_0x3d6a67[_0x151d('0x69')]['id']=_0x241328[_0x151d('0x5e')][_0x151d('0x67')];return db['OpenchannelMessage']['find']({'where':{'id':_0x241328[_0x151d('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x275c55,null))['then'](saveUpdates(_0x241328[_0x151d('0x5e')],null))[_0x151d('0x26')](function(_0x4d597c){if(_0x4d597c){_0x3d6a67[_0x151d('0x2d')]=_0x4d597c['get']({'plain':!![]});return db[_0x151d('0x6a')][_0x151d('0x5c')]({'where':{'id':_0x4d597c['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x275c55,null))[_0x151d('0x26')](function(_0x1ca402){if(_0x1ca402){return _0x1ca402['update']({'UserId':_0x241328[_0x151d('0x5e')][_0x151d('0x67')],'read1stAt':_['isNil'](_0x1ca402['read1stAt'])?moment()[_0x151d('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x151d('0x26')](function(_0x51220e){if(_0x51220e){_0x3d6a67[_0x151d('0x6b')]=_0x51220e[_0x151d('0x6c')]({'plain':!![]});interaction_log[_0x151d('0x27')](_0x151d('0x6d'),_0x241328[_0x151d('0x68')]['id'],_0x241328[_0x151d('0x68')]['name'],_0x241328[_0x151d('0x68')][_0x151d('0x6e')],_0x3d6a67[_0x151d('0x6b')]['id'],_0x241328[_0x151d('0x5e')]?JSON[_0x151d('0x6f')](_0x241328[_0x151d('0x5e')]):'null');return respondWithRpcPromise('AcceptMessage',_0x151d('0x70'),_0x3d6a67);}return null;})[_0x151d('0x26')](function(_0x3708bc){var _0x41be79=_0x151d('0x71')+_0x3708bc['message'][_0x151d('0x72')];return db[_0x151d('0x73')][_0x151d('0x48')](_0x41be79,{'type':db['Sequelize'][_0x151d('0x74')][_0x151d('0x75')],'raw':!![]})[_0x151d('0x26')](function(_0xa80bfe){return _0xa80bfe;});})[_0x151d('0x26')](function(_0x21f5e4){if(_0x21f5e4){_0x3d6a67[_0x151d('0x2d')][_0x151d('0x76')]=_0x21f5e4[0x0];if(!_0x241328[_0x151d('0x5e')][_0x151d('0x67')])return;return db['User'][_0x151d('0x5c')]({'where':{'id':_0x241328[_0x151d('0x5e')][_0x151d('0x67')],'role':_0x151d('0x69')},'attributes':['id','name',_0x151d('0x77'),_0x151d('0x78'),'internal'],'raw':!![]});}return null;})[_0x151d('0x26')](function(_0xeb1d39){if(!_0xeb1d39)return null;_0x3d6a67['message']['agent']=_0xeb1d39;return _0x3d6a67;})[_0x151d('0x26')](function(_0x5536ce){if(_0x5536ce){if(_0x241328['body']['manual']){_0x3d6a67[_0x151d('0x2d')]['interface']=util[_0x151d('0x65')](_0x151d('0x79'),_0x241328['user'][_0x151d('0x3f')]);_0x3d6a67[_0x151d('0x2d')][_0x151d('0x7a')]=_0x3d6a67['channel'];_0x3d6a67[_0x151d('0x2d')][_0x151d('0x7b')]=_0x3d6a67[_0x151d('0x7a')];_0x3d6a67[_0x151d('0x2d')][_0x151d('0x7c')]='accept';return respondWithRpcPromise(_0x151d('0x7d'),_0x151d('0x7d'),{'event':_0x151d('0x7e'),'message':_0x3d6a67[_0x151d('0x2d')]},client9002)[_0x151d('0x26')](function(){return _0x3d6a67;});}return _0x3d6a67;}return null;})[_0x151d('0x26')](respondWithResult(_0x275c55,null))['catch'](handleError(_0x275c55,null));};var interaction_log=require(_0x151d('0x17'))(_0x151d('0x60'));exports['reject']=function(_0x422f04,_0x482bf4,_0x27dda5){var _0x2cb31b={'agent':{},'channel':_0x151d('0x62')};if(_0x422f04[_0x151d('0x5e')]['id']){delete _0x422f04[_0x151d('0x5e')]['id'];}_0x422f04[_0x151d('0x5e')][_0x151d('0x67')]=_0x422f04[_0x151d('0x5e')][_0x151d('0x67')]||_0x422f04[_0x151d('0x68')]['id'];_0x2cb31b[_0x151d('0x69')]['id']=_0x422f04[_0x151d('0x5e')][_0x151d('0x67')];return db[_0x151d('0x43')][_0x151d('0x5c')]({'where':{'id':_0x422f04[_0x151d('0x5a')]['id'],'UserId':null}})[_0x151d('0x26')](handleEntityNotFound(_0x482bf4,null))['then'](function(_0x40734a){if(_0x40734a){_0x2cb31b[_0x151d('0x2d')]=_0x40734a[_0x151d('0x6c')]({'plain':!![]});return db[_0x151d('0x6a')][_0x151d('0x5c')]({'where':{'id':_0x40734a['OpenchannelInteractionId']}});}return null;})[_0x151d('0x26')](handleEntityNotFound(_0x482bf4,null))[_0x151d('0x26')](function(_0x461e5e){if(_0x461e5e){_0x2cb31b[_0x151d('0x6b')]=_0x461e5e[_0x151d('0x6c')]({'plain':!![]});interaction_log[_0x151d('0x27')](_0x151d('0x7f'),_0x422f04['user']['id'],_0x422f04[_0x151d('0x68')][_0x151d('0x3f')],_0x422f04[_0x151d('0x68')]['role'],_0x2cb31b['interaction']['id'],_0x422f04[_0x151d('0x5e')]?JSON['stringify'](_0x422f04[_0x151d('0x5e')]):'null');return respondWithRpcPromise(_0x151d('0x80'),_0x151d('0x81'),_0x2cb31b);}return null;})[_0x151d('0x26')](function(_0x4f27a8){var _0x2d30ff='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4f27a8[_0x151d('0x2d')]['ContactId'];return db[_0x151d('0x73')][_0x151d('0x48')](_0x2d30ff,{'type':db[_0x151d('0x82')]['QueryTypes'][_0x151d('0x75')],'raw':!![]})[_0x151d('0x26')](function(_0xed22f2){return _0xed22f2;});})[_0x151d('0x26')](function(_0x39e1c9){if(_0x39e1c9){_0x2cb31b[_0x151d('0x2d')][_0x151d('0x76')]=_0x39e1c9[0x0];if(!_0x422f04[_0x151d('0x5e')][_0x151d('0x67')])return;return db[_0x151d('0x83')][_0x151d('0x5c')]({'where':{'id':_0x422f04[_0x151d('0x5e')][_0x151d('0x67')],'role':_0x151d('0x69')},'attributes':['id','name',_0x151d('0x77'),_0x151d('0x78'),_0x151d('0x84')],'raw':!![]});}return null;})[_0x151d('0x26')](function(_0x5bf78c){if(!_0x5bf78c)return null;_0x2cb31b[_0x151d('0x2d')][_0x151d('0x69')]=_0x5bf78c;return _0x2cb31b;})[_0x151d('0x26')](function(_0x4bbb86){if(_0x4bbb86){_0x4bbb86['message'][_0x151d('0x85')]=util[_0x151d('0x65')](_0x151d('0x79'),_0x422f04['user'][_0x151d('0x3f')]);_0x4bbb86[_0x151d('0x2d')][_0x151d('0x7a')]=_0x2cb31b['channel'];_0x4bbb86[_0x151d('0x2d')][_0x151d('0x7b')]=_0x2cb31b[_0x151d('0x7a')];_0x4bbb86['message'][_0x151d('0x7c')]=_0x151d('0x3a');respondWithRpcPromise(_0x151d('0x7d'),_0x151d('0x7d'),{'event':_0x151d('0x86'),'message':_0x4bbb86['message']},client9002);return _0x2cb31b;}return null;})[_0x151d('0x26')](respondWithResult(_0x482bf4,null))[_0x151d('0x2f')](handleError(_0x482bf4,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 1d44694..13b39b3 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 _0x3be3=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x56e144,_0x3f4d9b){var _0x313566=function(_0x1c7646){while(--_0x1c7646){_0x56e144['push'](_0x56e144['shift']());}};_0x313566(++_0x3f4d9b);}(_0x3be3,0x10f));var _0x33be=function(_0x5dfc2a,_0x1a953f){_0x5dfc2a=_0x5dfc2a-0x0;var _0x3f1a71=_0x3be3[_0x5dfc2a];return _0x3f1a71;};'use strict';var EventEmitter=require(_0x33be('0x0'));var OpenchannelMessage=require(_0x33be('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x33be('0x2')](0x0);var events={'afterCreate':_0x33be('0x3'),'afterUpdate':_0x33be('0x4'),'afterDestroy':_0x33be('0x5')};function emitEvent(_0x5f5d98){return function(_0x10c87b,_0x3ea645,_0x228fd9){OpenchannelMessageEvents[_0x33be('0x6')](_0x5f5d98+':'+_0x10c87b['id'],_0x10c87b);OpenchannelMessageEvents['emit'](_0x5f5d98,_0x10c87b);_0x228fd9(null);};}for(var e in events){if(events[_0x33be('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x33be('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xaa01=['events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xaa01,0x154));var _0x1aa0=function(_0x5c28ba,_0x24df4b){_0x5c28ba=_0x5c28ba-0x0;var _0x2f1111=_0xaa01[_0x5c28ba];return _0x2f1111;};'use strict';var EventEmitter=require(_0x1aa0('0x0'));var OpenchannelMessage=require(_0x1aa0('0x1'))['db'][_0x1aa0('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x1aa0('0x3')](0x0);var events={'afterCreate':_0x1aa0('0x4'),'afterUpdate':'update','afterDestroy':_0x1aa0('0x5')};function emitEvent(_0x47fca5){return function(_0x235a0b,_0x4a264d,_0x2776af){OpenchannelMessageEvents['emit'](_0x47fca5+':'+_0x235a0b['id'],_0x235a0b);OpenchannelMessageEvents[_0x1aa0('0x6')](_0x47fca5,_0x235a0b);_0x2776af(null);};}for(var e in events){if(events[_0x1aa0('0x7')](e)){var event=events[e];OpenchannelMessage[_0x1aa0('0x8')](e,emitEvent(event));}}module[_0x1aa0('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 352a309..641963e 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 _0xc96e=['../../config/logger','api','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','error','out','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','GET','POST','body','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','afterCreate','utf8mb4','util'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xc96e,0xb7));var _0xec96=function(_0x52c583,_0x595d8b){_0x52c583=_0x52c583-0x0;var _0x53d77=_0xc96e[_0x52c583];return _0x53d77;};'use strict';var _=require('lodash');var util=require(_0xec96('0x0'));var logger=require(_0xec96('0x1'))(_0xec96('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xec96('0x3'));var config=require(_0xec96('0x4'));var attributes=require(_0xec96('0x5'));module[_0xec96('0x6')]=function(_0x535326,_0x19e173){return _0x535326[_0xec96('0x7')]('OpenchannelMessage',attributes,{'tableName':_0xec96('0x8'),'paranoid':![],'indexes':[{'name':_0xec96('0x9'),'fields':['body'],'type':_0xec96('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xe5d188,_0x1233b0,_0x17ddad){var _0x193211=_0x535326[_0xec96('0xb')];var _0x3e303a=_0xe5d188[_0xec96('0xc')]({'plain':!![]});if(_0x3e303a[_0xec96('0xd')][_0xec96('0xe')]()==='in'||_0x3e303a[_0xec96('0xd')]['toLowerCase']()==='out'&&!_0x3e303a[_0xec96('0xf')]&&!_[_0xec96('0x10')](_0x3e303a['UserId'])){_0x193211[_0xec96('0x11')]['findOne']({'where':{'id':_0x3e303a[_0xec96('0x12')]}})[_0xec96('0x13')](function(_0xd3ebf3){if(_0xd3ebf3){_0xd3ebf3[_0xec96('0x14')]({'lastMsgAt':_0x3e303a[_0xec96('0x15')],'lastMsgDirection':_0x3e303a[_0xec96('0xd')][_0xec96('0xe')]()});}})['catch'](function(_0x5452e5){console[_0xec96('0x16')](_0x5452e5);});}if(_0x3e303a[_0xec96('0xd')]===_0xec96('0x17')&&!_0x3e303a[_0xec96('0xf')]){var _0x39c20b;_0x193211[_0xec96('0x18')][_0xec96('0x19')]()['then'](function(_0x293376){return _0x193211[_0xec96('0x1a')][_0xec96('0x1b')]({'where':{'id':_0x3e303a[_0xec96('0x1c')]},'include':[{'model':_0x193211['OpenchannelInteraction'],'as':_0xec96('0x1d'),'where':{'id':_0x3e303a['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x193211[_0xec96('0x18')],'as':_0xec96('0x1e'),'attributes':_[_0xec96('0x1f')](_0x293376)}]}]});})[_0xec96('0x13')](function(_0x41f363){_0x39c20b=_0x41f363[_0xec96('0xc')]({'plain':!![]});if(_0x39c20b&&_0x39c20b[_0xec96('0x20')]){logger[_0xec96('0x21')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util['format'](_0xec96('0x22'),_0x3e303a['id'],_0x39c20b[_0xec96('0x20')]));if(_0x39c20b[_0xec96('0x1d')]&&_0x39c20b[_0xec96('0x1d')]['length']){_0x3e303a[_0xec96('0x23')]=_[_0xec96('0x24')](_0x39c20b['Interactions'][0x0],_0xec96('0x1e'));_0x3e303a[_0xec96('0x1e')]=_0x39c20b[_0xec96('0x1d')][0x0][_0xec96('0x1e')];}var _0x1233b0={'method':'POST','uri':encodeURI(_0x39c20b[_0xec96('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1233b0['method']){case _0xec96('0x25'):_0x1233b0['qs']=_0x3e303a;break;case _0xec96('0x26'):_0x1233b0[_0xec96('0x27')]=_0x3e303a;break;}return rp(_0x1233b0)[_0xec96('0x13')](function(_0x6c52b2){logger[_0xec96('0x21')](_0xec96('0x28'),'afterCreate',util[_0xec96('0x29')](_0xec96('0x2a'),_0x3e303a['id'],_0x39c20b[_0xec96('0x20')]));if(_0x6c52b2[_0xec96('0x27')][_0xec96('0x2b')]&&_0x6c52b2['body']['threadId']!=_0x3e303a[_0xec96('0x23')][_0xec96('0x2b')]){return _0x193211[_0xec96('0x11')][_0xec96('0x14')]({'threadId':_0x6c52b2[_0xec96('0x27')][_0xec96('0x2b')]},{'where':{'id':_0x3e303a['Interaction']['id']}});}else{return;}})[_0xec96('0x13')](function(){return _0xe5d188[_0xec96('0x14')]({'read':!![]});})['catch'](function(_0x2014e6){logger['error'](_0xec96('0x28'),_0xec96('0x2c'),util['inspect'](_0x2014e6,{'showHidden':![],'depth':null}));_0x17ddad();});}else{_0x17ddad();}})['finally'](function(){_0x17ddad();});}else{_0x17ddad();}}},'charset':_0xec96('0x2d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1aec=['then','createdAt','catch','error','secret','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','POST','method','GET','format','threadId','update','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne'];(function(_0x53b0f3,_0x3d7309){var _0x1e96d4=function(_0x44e591){while(--_0x44e591){_0x53b0f3['push'](_0x53b0f3['shift']());}};_0x1e96d4(++_0x3d7309);}(_0x1aec,0x11c));var _0xc1ae=function(_0xfbf519,_0x18803d){_0xfbf519=_0xfbf519-0x0;var _0x4ccfa9=_0x1aec[_0xfbf519];return _0x4ccfa9;};'use strict';var _=require(_0xc1ae('0x0'));var util=require(_0xc1ae('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc1ae('0x2'));var BPromise=require(_0xc1ae('0x3'));var rp=require(_0xc1ae('0x4'));var fs=require('fs');var path=require(_0xc1ae('0x5'));var rimraf=require(_0xc1ae('0x6'));var config=require('../../config/environment');var attributes=require(_0xc1ae('0x7'));module[_0xc1ae('0x8')]=function(_0x4e9edb,_0x4fd238){return _0x4e9edb['define'](_0xc1ae('0x9'),attributes,{'tableName':_0xc1ae('0xa'),'paranoid':![],'indexes':[{'name':_0xc1ae('0xb'),'fields':[_0xc1ae('0xc')],'type':_0xc1ae('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x43c8ed,_0x1c3b17,_0x564d9a){var _0x16d043=_0x4e9edb[_0xc1ae('0xe')];var _0x4ecd21=_0x43c8ed['get']({'plain':!![]});if(_0x4ecd21[_0xc1ae('0xf')][_0xc1ae('0x10')]()==='in'||_0x4ecd21[_0xc1ae('0xf')]['toLowerCase']()===_0xc1ae('0x11')&&!_0x4ecd21['secret']&&!_[_0xc1ae('0x12')](_0x4ecd21[_0xc1ae('0x13')])){_0x16d043[_0xc1ae('0x14')][_0xc1ae('0x15')]({'where':{'id':_0x4ecd21['OpenchannelInteractionId']}})[_0xc1ae('0x16')](function(_0x521933){if(_0x521933){_0x521933['update']({'lastMsgAt':_0x4ecd21[_0xc1ae('0x17')],'lastMsgDirection':_0x4ecd21[_0xc1ae('0xf')]['toLowerCase']()});}})[_0xc1ae('0x18')](function(_0x5e6447){console[_0xc1ae('0x19')](_0x5e6447);});}if(_0x4ecd21[_0xc1ae('0xf')]==='out'&&!_0x4ecd21[_0xc1ae('0x1a')]){var _0x6340b9;_0x16d043[_0xc1ae('0x1b')][_0xc1ae('0x1c')]()[_0xc1ae('0x16')](function(_0x2a741f){return _0x16d043[_0xc1ae('0x1d')][_0xc1ae('0x1e')]({'where':{'id':_0x4ecd21[_0xc1ae('0x1f')]},'include':[{'model':_0x16d043['OpenchannelInteraction'],'as':_0xc1ae('0x20'),'where':{'id':_0x4ecd21[_0xc1ae('0x21')]},'limit':0x1,'include':[{'model':_0x16d043[_0xc1ae('0x1b')],'as':_0xc1ae('0x22'),'attributes':_[_0xc1ae('0x23')](_0x2a741f)}]}]});})[_0xc1ae('0x16')](function(_0x45ae2c){_0x6340b9=_0x45ae2c[_0xc1ae('0x24')]({'plain':!![]});if(_0x6340b9&&_0x6340b9[_0xc1ae('0x25')]){logger[_0xc1ae('0x26')](_0xc1ae('0x27'),_0xc1ae('0x28'),util['format'](_0xc1ae('0x29'),_0x4ecd21['id'],_0x6340b9[_0xc1ae('0x25')]));if(_0x6340b9[_0xc1ae('0x20')]&&_0x6340b9[_0xc1ae('0x20')][_0xc1ae('0x2a')]){_0x4ecd21[_0xc1ae('0x2b')]=_['omit'](_0x6340b9[_0xc1ae('0x20')][0x0],'Contact');_0x4ecd21[_0xc1ae('0x22')]=_0x6340b9[_0xc1ae('0x20')][0x0]['Contact'];}var _0x1c3b17={'method':_0xc1ae('0x2c'),'uri':encodeURI(_0x6340b9[_0xc1ae('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1c3b17[_0xc1ae('0x2d')]){case _0xc1ae('0x2e'):_0x1c3b17['qs']=_0x4ecd21;break;case _0xc1ae('0x2c'):_0x1c3b17[_0xc1ae('0xc')]=_0x4ecd21;break;}return rp(_0x1c3b17)[_0xc1ae('0x16')](function(_0x4d85bd){logger[_0xc1ae('0x26')](_0xc1ae('0x27'),_0xc1ae('0x28'),util[_0xc1ae('0x2f')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x4ecd21['id'],_0x6340b9[_0xc1ae('0x25')]));if(_0x4d85bd['body']['threadId']&&_0x4d85bd['body']['threadId']!=_0x4ecd21[_0xc1ae('0x2b')][_0xc1ae('0x30')]){return _0x16d043[_0xc1ae('0x14')][_0xc1ae('0x31')]({'threadId':_0x4d85bd[_0xc1ae('0xc')][_0xc1ae('0x30')]},{'where':{'id':_0x4ecd21[_0xc1ae('0x2b')]['id']}});}else{return;}})[_0xc1ae('0x16')](function(){return _0x43c8ed['update']({'read':!![]});})[_0xc1ae('0x18')](function(_0x581efe){logger[_0xc1ae('0x19')](_0xc1ae('0x27'),'afterCreate',util['inspect'](_0x581efe,{'showHidden':![],'depth':null}));_0x564d9a();});}else{_0x564d9a();}})['finally'](function(){_0x564d9a();});}else{_0x564d9a();}}},'charset':'utf8mb4','collate':_0xc1ae('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 6d37959..b10fd67 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 _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x466a1a,_0x37933b){var _0x577165=function(_0x4c97b9){while(--_0x4c97b9){_0x466a1a['push'](_0x466a1a['shift']());}};_0x577165(++_0x37933b);}(_0xdb28,0x106));var _0x8db2=function(_0x2c6cfa,_0x3cbcc0){_0x2c6cfa=_0x2c6cfa-0x0;var _0x43803e=_0xdb28[_0x2c6cfa];return _0x43803e;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x1e405a,_0x5d8635){var _0x578cf1=function(_0x2e8492){while(--_0x2e8492){_0x1e405a['push'](_0x1e405a['shift']());}};_0x578cf1(++_0x5d8635);}(_0x2ef3,0xba));var _0x32ef=function(_0x155bde,_0xc4f717){_0x155bde=_0x155bde-0x0;var _0x17df09=_0x2ef3[_0x155bde];return _0x17df09;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index ee16a55..1f2c972 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 _0xcf8a=['update','emit','removeListener','register','./openchannelMessage.events','save','remove'];(function(_0x3bd555,_0x2081bf){var _0xdd3a1b=function(_0x3b6f87){while(--_0x3b6f87){_0x3bd555['push'](_0x3bd555['shift']());}};_0xdd3a1b(++_0x2081bf);}(_0xcf8a,0x1cb));var _0xacf8=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xcf8a[_0x40a045];return _0x1a687c;};'use strict';var OpenchannelMessageEvents=require(_0xacf8('0x0'));var events=[_0xacf8('0x1'),_0xacf8('0x2'),_0xacf8('0x3')];function createListener(_0x2ae5a4,_0x1d9eb4){return function(_0xe3e80d){_0x1d9eb4[_0xacf8('0x4')](_0x2ae5a4,_0xe3e80d);};}function removeListener(_0x4a8c3c,_0x46b059){return function(){OpenchannelMessageEvents[_0xacf8('0x5')](_0x4a8c3c,_0x46b059);};}exports[_0xacf8('0x6')]=function(_0x372f60){for(var _0x39320a=0x0,_0x1a1a41=events['length'];_0x39320a<_0x1a1a41;_0x39320a++){var _0x4e8e53=events[_0x39320a];var _0xf4a074=createListener('openchannelMessage:'+_0x4e8e53,_0x372f60);OpenchannelMessageEvents['on'](_0x4e8e53,_0xf4a074);}}; \ No newline at end of file +var _0x6cae=['length','openchannelMessage:','./openchannelMessage.events','save','update','emit','register'];(function(_0x22cc16,_0x1f4fa2){var _0x399b70=function(_0x34d464){while(--_0x34d464){_0x22cc16['push'](_0x22cc16['shift']());}};_0x399b70(++_0x1f4fa2);}(_0x6cae,0xf0));var _0xe6ca=function(_0x57d0c1,_0x478e7a){_0x57d0c1=_0x57d0c1-0x0;var _0x3c8b91=_0x6cae[_0x57d0c1];return _0x3c8b91;};'use strict';var OpenchannelMessageEvents=require(_0xe6ca('0x0'));var events=[_0xe6ca('0x1'),'remove',_0xe6ca('0x2')];function createListener(_0x321f19,_0x3bc22b){return function(_0x3630f1){_0x3bc22b[_0xe6ca('0x3')](_0x321f19,_0x3630f1);};}function removeListener(_0x123f96,_0x3c32ce){return function(){OpenchannelMessageEvents['removeListener'](_0x123f96,_0x3c32ce);};}exports[_0xe6ca('0x4')]=function(_0x1fb8a6){for(var _0x30f82a=0x0,_0x257149=events[_0xe6ca('0x5')];_0x30f82a<_0x257149;_0x30f82a++){var _0x91d28c=events[_0x30f82a];var _0x10a28f=createListener(_0xe6ca('0x6')+_0x91d28c,_0x1fb8a6);OpenchannelMessageEvents['on'](_0x91d28c,_0x10a28f);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 0731280..de45ebb 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 _0x2ceb=['removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','index','isAuthenticated','describe','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2ceb,0x110));var _0xb2ce=function(_0x2a3257,_0x170ea2){_0x2a3257=_0x2a3257-0x0;var _0x1f9128=_0x2ceb[_0x2a3257];return _0x1f9128;};'use strict';var multer=require(_0xb2ce('0x0'));var util=require(_0xb2ce('0x1'));var path=require('path');var timeout=require(_0xb2ce('0x2'));var express=require(_0xb2ce('0x3'));var router=express[_0xb2ce('0x4')]();var fs_extra=require(_0xb2ce('0x5'));var auth=require(_0xb2ce('0x6'));var interaction=require(_0xb2ce('0x7'));var config=require('../../config/environment');var controller=require(_0xb2ce('0x8'));router[_0xb2ce('0x9')]('/',auth['isAuthenticated'](),controller[_0xb2ce('0xa')]);router[_0xb2ce('0x9')]('/describe',auth[_0xb2ce('0xb')](),controller[_0xb2ce('0xc')]);router[_0xb2ce('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb2ce('0xd')]);router[_0xb2ce('0x9')]('/:id/members',auth[_0xb2ce('0xb')](),controller[_0xb2ce('0xe')]);router[_0xb2ce('0x9')](_0xb2ce('0xf'),auth[_0xb2ce('0xb')](),controller[_0xb2ce('0x10')]);router['get'](_0xb2ce('0x11'),auth[_0xb2ce('0xb')](),controller[_0xb2ce('0x12')]);router[_0xb2ce('0x13')]('/',auth[_0xb2ce('0xb')](),controller['create']);router['post'](_0xb2ce('0xf'),auth[_0xb2ce('0xb')](),controller[_0xb2ce('0x14')]);router[_0xb2ce('0x13')](_0xb2ce('0x11'),auth[_0xb2ce('0xb')](),controller[_0xb2ce('0x15')]);router[_0xb2ce('0x16')](_0xb2ce('0x17'),auth[_0xb2ce('0xb')](),controller[_0xb2ce('0x18')]);router[_0xb2ce('0x19')](_0xb2ce('0x17'),auth[_0xb2ce('0xb')](),controller[_0xb2ce('0x1a')]);router[_0xb2ce('0x19')](_0xb2ce('0xf'),auth[_0xb2ce('0xb')](),controller[_0xb2ce('0x1b')]);router[_0xb2ce('0x19')](_0xb2ce('0x11'),auth[_0xb2ce('0xb')](),controller[_0xb2ce('0x1c')]);module[_0xb2ce('0x1d')]=router; \ No newline at end of file +var _0x9146=['addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x225679,_0x1e8511){var _0x2a652e=function(_0x2665b6){while(--_0x2665b6){_0x225679['push'](_0x225679['shift']());}};_0x2a652e(++_0x1e8511);}(_0x9146,0x1bb));var _0x6914=function(_0x101a17,_0x5d047a){_0x101a17=_0x101a17-0x0;var _0x3b76ee=_0x9146[_0x101a17];return _0x3b76ee;};'use strict';var multer=require('multer');var util=require(_0x6914('0x0'));var path=require(_0x6914('0x1'));var timeout=require(_0x6914('0x2'));var express=require(_0x6914('0x3'));var router=express['Router']();var fs_extra=require(_0x6914('0x4'));var auth=require(_0x6914('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6914('0x6'));router[_0x6914('0x7')]('/',auth[_0x6914('0x8')](),controller[_0x6914('0x9')]);router[_0x6914('0x7')](_0x6914('0xa'),auth[_0x6914('0x8')](),controller['describe']);router[_0x6914('0x7')](_0x6914('0xb'),auth[_0x6914('0x8')](),controller[_0x6914('0xc')]);router[_0x6914('0x7')](_0x6914('0xd'),auth[_0x6914('0x8')](),controller[_0x6914('0xe')]);router['get'](_0x6914('0xf'),auth[_0x6914('0x8')](),controller[_0x6914('0x10')]);router[_0x6914('0x7')](_0x6914('0x11'),auth[_0x6914('0x8')](),controller[_0x6914('0x12')]);router[_0x6914('0x13')]('/',auth[_0x6914('0x8')](),controller[_0x6914('0x14')]);router[_0x6914('0x13')](_0x6914('0xf'),auth[_0x6914('0x8')](),controller[_0x6914('0x15')]);router[_0x6914('0x13')]('/:id/users',auth[_0x6914('0x8')](),controller[_0x6914('0x16')]);router[_0x6914('0x17')](_0x6914('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6914('0xb'),auth[_0x6914('0x8')](),controller[_0x6914('0x18')]);router[_0x6914('0x19')](_0x6914('0xf'),auth[_0x6914('0x8')](),controller[_0x6914('0x1a')]);router[_0x6914('0x19')](_0x6914('0x11'),auth[_0x6914('0x8')](),controller[_0x6914('0x1b')]);module[_0x6914('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 5970ec3..51c3044 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 _0x6707=['STRING','INTEGER','ENUM','beepall','roundrobin','exports'];(function(_0x247635,_0x33050e){var _0x17c310=function(_0x54bd62){while(--_0x54bd62){_0x247635['push'](_0x247635['shift']());}};_0x17c310(++_0x33050e);}(_0x6707,0x1a3));var _0x7670=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x6707[_0xa6cc5c];return _0x44803d;};'use strict';var Sequelize=require('sequelize');module[_0x7670('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7670('0x1')]},'timeout':{'type':Sequelize[_0x7670('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7670('0x3')]('rrmemory',_0x7670('0x4'),_0x7670('0x5'))}}; \ No newline at end of file +var _0xc779=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0xc779,0xee));var _0x9c77=function(_0x28384d,_0x594725){_0x28384d=_0x28384d-0x0;var _0x4514d8=_0xc779[_0x28384d];return _0x4514d8;};'use strict';var Sequelize=require(_0x9c77('0x0'));module[_0x9c77('0x1')]={'name':{'type':Sequelize[_0x9c77('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9c77('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9c77('0x4')](_0x9c77('0x5'),_0x9c77('0x6'),_0x9c77('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 4a7a73e..e0544a4 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 _0x3615=['isArray','getAgents','util','lodash','squel','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','update','destroy','get','UserProfileResource','then','error','stack','name','map','OpenchannelQueue','rawAttributes','fieldName','type','where','query','rows','show','keys','filters','model','intersection','fields','attributes','includeAll','include','options','catch','create','body','user','role','OpenchannelQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','findOne','length','hasOwnProperty','nolimit','order','sort','OpenchannelQueueId','filter','UserOpenchannelQueue','findAll','User','openchannelPause','%s/%s','SIP','createdAt','updatedAt','pick','merge','getTeams','addTeams','Agents','online','interface','flatMap','find','sequelize','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','Team','ids','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread'];(function(_0x1d1963,_0x32cc0e){var _0x3f58bb=function(_0x514823){while(--_0x514823){_0x1d1963['push'](_0x1d1963['shift']());}};_0x3f58bb(++_0x32cc0e);}(_0x3615,0x167));var _0x5361=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x3615[_0x485b5a];return _0xd2b34d;};'use strict';var BPromise=require('bluebird');var util=require(_0x5361('0x0'));var _=require(_0x5361('0x1'));var squel=require(_0x5361('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x5361('0x3'))(_0x5361('0x4'));var config=require('../../config/environment');var db=require(_0x5361('0x5'))['db'];config[_0x5361('0x6')]=_[_0x5361('0x7')](config[_0x5361('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x5361('0x8'))(new Redis(config[_0x5361('0x6')]));require(_0x5361('0x9'))[_0x5361('0xa')](socket);function respondWithStatusCode(_0x4fa47e,_0x3ebfdc){_0x3ebfdc=_0x3ebfdc||0xcc;return function(_0x41f14d){if(_0x41f14d){return _0x4fa47e[_0x5361('0xb')](_0x3ebfdc);}return _0x4fa47e[_0x5361('0xc')](_0x3ebfdc)[_0x5361('0xd')]();};}function respondWithResult(_0x132322,_0x8587b1){_0x8587b1=_0x8587b1||0xc8;return function(_0x5ee88c){if(_0x5ee88c){return _0x132322[_0x5361('0xc')](_0x8587b1)[_0x5361('0xe')](_0x5ee88c);}};}function respondWithFilteredResult(_0x13d00f,_0x1fb98a){return function(_0x119236){if(_0x119236){var _0x2730f5=typeof _0x1fb98a[_0x5361('0xf')]===_0x5361('0x10')&&typeof _0x1fb98a[_0x5361('0x11')]===_0x5361('0x10');var _0x38f216=_0x119236['count'];var _0x3a7c6a=_0x2730f5?0x0:_0x1fb98a[_0x5361('0xf')];var _0x9b0e9e=_0x2730f5?_0x119236[_0x5361('0x12')]:_0x1fb98a[_0x5361('0xf')]+_0x1fb98a[_0x5361('0x11')];var _0x4b196e;if(_0x9b0e9e>=_0x38f216){_0x9b0e9e=_0x38f216;_0x4b196e=0xc8;}else{_0x4b196e=0xce;}_0x13d00f['status'](_0x4b196e);return _0x13d00f[_0x5361('0x13')]('Content-Range',_0x3a7c6a+'-'+_0x9b0e9e+'/'+_0x38f216)['json'](_0x119236);}return null;};}function saveUpdates(_0x19a8bc){return function(_0x48ec89){if(_0x48ec89){return _0x48ec89[_0x5361('0x14')](_0x19a8bc)['then'](function(_0x25f01d){return _0x25f01d;});}return null;};}function removeEntity(_0x26b5fc){return function(_0x1acf5c){if(_0x1acf5c){return _0x1acf5c[_0x5361('0x15')]()['then'](function(){var _0x1349d1=_0x1acf5c[_0x5361('0x16')]({'plain':!![]});var _0x6ebe59='OpenchannelQueues';return db[_0x5361('0x17')]['destroy']({'where':{'type':_0x6ebe59,'resourceId':_0x1349d1['id']}})[_0x5361('0x18')](function(){return _0x1acf5c;});})['then'](function(){_0x26b5fc[_0x5361('0xc')](0xcc)[_0x5361('0xd')]();});}};}function handleEntityNotFound(_0x1b294a){return function(_0x4994ff){if(!_0x4994ff){_0x1b294a[_0x5361('0xb')](0x194);}return _0x4994ff;};}function handleError(_0x48d2b0,_0x16518b){_0x16518b=_0x16518b||0x1f4;return function(_0x8a6e6a){logger[_0x5361('0x19')](_0x8a6e6a[_0x5361('0x1a')]);if(_0x8a6e6a[_0x5361('0x1b')]){delete _0x8a6e6a[_0x5361('0x1b')];}_0x48d2b0[_0x5361('0xc')](_0x16518b)['send'](_0x8a6e6a);};}exports['index']=function(_0x36d7ac,_0x3bb500){var _0x2cb27b={};var _0x3d56df={'count':0x0,'rows':[]};var _0x34bbee=_[_0x5361('0x1c')](db[_0x5361('0x1d')][_0x5361('0x1e')],function(_0x1f600c){return{'name':_0x1f600c[_0x5361('0x1f')],'type':_0x1f600c[_0x5361('0x20')]['key']};});_0x2cb27b=qs['getOptions'](_0x34bbee,_0x36d7ac);var _0xac8c09={'where':_0x2cb27b[_0x5361('0x21')]};return db['OpenchannelQueue'][_0x5361('0x12')](_0xac8c09)[_0x5361('0x18')](function(_0x121f7f){_0x3d56df[_0x5361('0x12')]=_0x121f7f;_0x2cb27b['include']=qs['include'](_0x36d7ac[_0x5361('0x22')]);return db['OpenchannelQueue']['findAll'](_0x2cb27b);})[_0x5361('0x18')](function(_0x21d3c2){_0x3d56df[_0x5361('0x23')]=_0x21d3c2;return _0x3d56df;})[_0x5361('0x18')](respondWithFilteredResult(_0x3bb500,_0x2cb27b))['catch'](handleError(_0x3bb500,null));};exports[_0x5361('0x24')]=function(_0x5c573c,_0x3858a6){var _0x3e4ef7={'raw':!![],'where':{'id':_0x5c573c['params']['id']}},_0x11170a={};_0x11170a['model']=_[_0x5361('0x25')](db[_0x5361('0x1d')]['rawAttributes']);_0x11170a['query']=_[_0x5361('0x25')](_0x5c573c[_0x5361('0x22')]);_0x11170a[_0x5361('0x26')]=_['intersection'](_0x11170a[_0x5361('0x27')],_0x11170a[_0x5361('0x22')]);_0x3e4ef7['attributes']=_[_0x5361('0x28')](_0x11170a[_0x5361('0x27')],qs[_0x5361('0x29')](_0x5c573c[_0x5361('0x22')][_0x5361('0x29')]));_0x3e4ef7[_0x5361('0x2a')]=_0x3e4ef7[_0x5361('0x2a')]['length']?_0x3e4ef7[_0x5361('0x2a')]:_0x11170a[_0x5361('0x27')];if(_0x5c573c[_0x5361('0x22')][_0x5361('0x2b')]){_0x3e4ef7[_0x5361('0x2c')]=[{'all':!![]}];}_0x3e4ef7=_['merge']({},_0x3e4ef7,_0x5c573c[_0x5361('0x2d')]);return db[_0x5361('0x1d')]['find'](_0x3e4ef7)[_0x5361('0x18')](handleEntityNotFound(_0x3858a6,null))[_0x5361('0x18')](respondWithResult(_0x3858a6,null))[_0x5361('0x2e')](handleError(_0x3858a6,null));};exports[_0x5361('0x2f')]=function(_0x410cf4,_0x13c688){return db['OpenchannelQueue'][_0x5361('0x2f')](_0x410cf4[_0x5361('0x30')],{})[_0x5361('0x18')](function(_0x14f2f2){var _0x31fbaf=_0x410cf4[_0x5361('0x31')][_0x5361('0x16')]({'plain':!![]});if(!_0x31fbaf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31fbaf[_0x5361('0x32')]===_0x5361('0x31')){var _0x5f04ba=_0x14f2f2['get']({'plain':!![]});var _0x451530=_0x5361('0x33');return db[_0x5361('0x34')]['find']({'where':{'name':_0x451530,'userProfileId':_0x31fbaf['userProfileId']},'raw':!![]})[_0x5361('0x18')](function(_0x4ca2ef){if(_0x4ca2ef&&_0x4ca2ef[_0x5361('0x35')]===0x0){return db[_0x5361('0x17')][_0x5361('0x2f')]({'name':_0x5f04ba[_0x5361('0x1b')],'resourceId':_0x5f04ba['id'],'type':_0x4ca2ef[_0x5361('0x1b')],'sectionId':_0x4ca2ef['id']},{})[_0x5361('0x18')](function(){return _0x14f2f2;});}else{return _0x14f2f2;}})[_0x5361('0x2e')](function(_0x3c9ad6){logger[_0x5361('0x19')](_0x5361('0x36'),_0x3c9ad6);throw _0x3c9ad6;});}return _0x14f2f2;})[_0x5361('0x18')](respondWithResult(_0x13c688,0xc9))['catch'](handleError(_0x13c688,null));};exports[_0x5361('0x14')]=function(_0x37253c,_0x58768d){if(_0x37253c[_0x5361('0x30')]['id']){delete _0x37253c[_0x5361('0x30')]['id'];}return db[_0x5361('0x1d')]['find']({'where':{'id':_0x37253c[_0x5361('0x37')]['id']}})[_0x5361('0x18')](handleEntityNotFound(_0x58768d,null))[_0x5361('0x18')](saveUpdates(_0x37253c['body'],null))[_0x5361('0x18')](respondWithResult(_0x58768d,null))[_0x5361('0x2e')](handleError(_0x58768d,null));};exports['destroy']=function(_0x464027,_0x465e13){return db[_0x5361('0x1d')]['find']({'where':{'id':_0x464027[_0x5361('0x37')]['id']}})[_0x5361('0x18')](handleEntityNotFound(_0x465e13,null))[_0x5361('0x18')](removeEntity(_0x465e13,null))[_0x5361('0x2e')](handleError(_0x465e13,null));};exports['describe']=function(_0xf0589b,_0x860637){return db['OpenchannelQueue']['describe']()[_0x5361('0x18')](respondWithResult(_0x860637,null))[_0x5361('0x2e')](handleError(_0x860637,null));};exports['getMembers']=function(_0x12d6c8,_0x88f7b5){var _0x3713d2={'raw':!![],'where':{}},_0x56b9be={},_0x3709a0;return db[_0x5361('0x1d')][_0x5361('0x38')]({'where':{'id':_0x12d6c8[_0x5361('0x37')]['id']}})[_0x5361('0x18')](handleEntityNotFound(_0x88f7b5,null))['then'](function(_0x4b5f18){if(_0x4b5f18){_0x3709a0=_0x4b5f18[_0x5361('0x16')]({'plain':!![]});_0x56b9be[_0x5361('0x27')]=_[_0x5361('0x25')](db['UserOpenchannelQueue'][_0x5361('0x1e')]);_0x56b9be[_0x5361('0x22')]=_['keys'](_0x12d6c8[_0x5361('0x22')]);_0x56b9be[_0x5361('0x26')]=_[_0x5361('0x28')](_0x56b9be[_0x5361('0x27')],_0x56b9be[_0x5361('0x22')]);_0x3713d2['attributes']=_['intersection'](_0x56b9be[_0x5361('0x27')],qs['fields'](_0x12d6c8['query'][_0x5361('0x29')]));_0x3713d2[_0x5361('0x2a')]=_0x3713d2[_0x5361('0x2a')][_0x5361('0x39')]?_0x3713d2[_0x5361('0x2a')]:_0x56b9be['model'];if(!_0x12d6c8[_0x5361('0x22')][_0x5361('0x3a')](_0x5361('0x3b'))){_0x3713d2['limit']=qs[_0x5361('0x11')](_0x12d6c8[_0x5361('0x22')][_0x5361('0x11')]);_0x3713d2[_0x5361('0xf')]=qs['offset'](_0x12d6c8['query'][_0x5361('0xf')]);}_0x3713d2[_0x5361('0x3c')]=qs[_0x5361('0x3d')](_0x12d6c8[_0x5361('0x22')][_0x5361('0x3d')]);_0x3713d2[_0x5361('0x21')]=qs['filters'](_['pick'](_0x12d6c8[_0x5361('0x22')],_0x56b9be[_0x5361('0x26')]));_0x3713d2[_0x5361('0x21')][_0x5361('0x3e')]=_0x4b5f18['id'];if(_0x12d6c8[_0x5361('0x22')][_0x5361('0x3f')]){_0x3713d2[_0x5361('0x21')]=_['merge'](_0x3713d2[_0x5361('0x21')],{'$or':_['map'](_0x3713d2[_0x5361('0x2a')],function(_0x1637aa){var _0x1ca061={};_0x1ca061[_0x1637aa]={'$like':'%'+_0x12d6c8[_0x5361('0x22')][_0x5361('0x3f')]+'%'};return _0x1ca061;})});}_0x3713d2=_['merge']({},_0x3713d2,_0x12d6c8[_0x5361('0x2d')]);return db[_0x5361('0x40')][_0x5361('0x41')](_0x3713d2);}})[_0x5361('0x18')](function(_0x2bc82c){if(_0x2bc82c){return db[_0x5361('0x42')]['findAndCountAll']({'where':{'id':_[_0x5361('0x1c')](_0x2bc82c,'UserId'),'role':'agent'},'attributes':['id',_0x5361('0x1b'),_0x5361('0x43'),'updatedAt','createdAt']});}})['then'](function(_0x165cfb){if(_0x165cfb){return{'count':_0x165cfb[_0x5361('0x12')],'rows':_[_0x5361('0x1c')](_0x165cfb['rows'],function(_0x4364b0){return{'membername':_0x4364b0[_0x5361('0x1b')],'UserId':_0x4364b0['id'],'queue_name':_0x3709a0[_0x5361('0x1b')],'OpenchannelQueueId':_0x3709a0['id'],'interface':util['format'](_0x5361('0x44'),_0x5361('0x45'),_0x4364b0[_0x5361('0x1b')]),'penalty':0x0,'paused':_0x4364b0[_0x5361('0x43')],'createdAt':_0x4364b0[_0x5361('0x46')],'updatedAt':_0x4364b0[_0x5361('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5361('0x18')](respondWithFilteredResult(_0x88f7b5,_0x3713d2))[_0x5361('0x2e')](handleError(_0x88f7b5,null));};exports['getTeams']=function(_0xe4be60,_0x24c16b){var _0x902a4e={};var _0x23b906={};var _0x2eba4f;var _0x443a6c;return db[_0x5361('0x1d')][_0x5361('0x38')]({'where':{'id':_0xe4be60[_0x5361('0x37')]['id']}})['then'](handleEntityNotFound(_0x24c16b,null))['then'](function(_0x4c6412){if(_0x4c6412){_0x2eba4f=_0x4c6412;_0x23b906[_0x5361('0x27')]=_[_0x5361('0x25')](db['Team'][_0x5361('0x1e')]);_0x23b906[_0x5361('0x22')]=_[_0x5361('0x25')](_0xe4be60[_0x5361('0x22')]);_0x23b906[_0x5361('0x26')]=_[_0x5361('0x28')](_0x23b906[_0x5361('0x27')],_0x23b906[_0x5361('0x22')]);_0x902a4e[_0x5361('0x2a')]=_[_0x5361('0x28')](_0x23b906['model'],qs[_0x5361('0x29')](_0xe4be60[_0x5361('0x22')][_0x5361('0x29')]));_0x902a4e[_0x5361('0x2a')]=_0x902a4e[_0x5361('0x2a')][_0x5361('0x39')]?_0x902a4e[_0x5361('0x2a')]:_0x23b906[_0x5361('0x27')];_0x902a4e['order']=qs[_0x5361('0x3d')](_0xe4be60[_0x5361('0x22')][_0x5361('0x3d')]);_0x902a4e['where']=qs[_0x5361('0x26')](_[_0x5361('0x48')](_0xe4be60['query'],_0x23b906['filters']));if(_0xe4be60[_0x5361('0x22')][_0x5361('0x3f')]){_0x902a4e[_0x5361('0x21')]=_[_0x5361('0x49')](_0x902a4e[_0x5361('0x21')],{'$or':_['map'](_0x902a4e[_0x5361('0x2a')],function(_0x51349f){var _0x3258cd={};_0x3258cd[_0x51349f]={'$like':'%'+_0xe4be60['query'][_0x5361('0x3f')]+'%'};return _0x3258cd;})});}_0x902a4e=_['merge']({},_0x902a4e,_0xe4be60['options']);return _0x2eba4f[_0x5361('0x4a')](_0x902a4e);}})['then'](function(_0x4c0412){if(_0x4c0412){_0x443a6c=_0x4c0412[_0x5361('0x39')];if(!_0xe4be60[_0x5361('0x22')][_0x5361('0x3a')]('nolimit')){_0x902a4e[_0x5361('0x11')]=qs[_0x5361('0x11')](_0xe4be60[_0x5361('0x22')][_0x5361('0x11')]);_0x902a4e[_0x5361('0xf')]=qs[_0x5361('0xf')](_0xe4be60[_0x5361('0x22')][_0x5361('0xf')]);}return _0x2eba4f[_0x5361('0x4a')](_0x902a4e);}})[_0x5361('0x18')](function(_0x59dc23){if(_0x59dc23){return _0x59dc23?{'count':_0x443a6c,'rows':_0x59dc23}:null;}})['then'](respondWithResult(_0x24c16b,null))[_0x5361('0x2e')](handleError(_0x24c16b,null));};exports[_0x5361('0x4b')]=function(_0x22e563,_0x1a3dd8){var _0x5e72b3=_0x22e563[_0x5361('0x30')]['ids'];return db['Team'][_0x5361('0x41')]({'where':{'id':_0x5e72b3},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5361('0x4c'),'attributes':['id',_0x5361('0x1b'),_0x5361('0x4d'),'voicePause',_0x5361('0x4e')],'raw':!![]}]})[_0x5361('0x18')](function(_0x432f17){if(_0x432f17){var _0x23d4e0=_[_0x5361('0x4f')](_0x432f17,function(_0x7b0c39){var _0x233eb1=_0x7b0c39['get']({'plain':!![]});return _0x233eb1['Agents'];});return db['OpenchannelQueue'][_0x5361('0x50')]({'where':{'id':_0x22e563[_0x5361('0x37')]['id']}})[_0x5361('0x18')](function(_0x478810){return db[_0x5361('0x51')]['transaction'](function(_0x537378){return _0x478810[_0x5361('0x4b')](_0x5e72b3,{'transaction':_0x537378})[_0x5361('0x18')](function(){return BPromise[_0x5361('0x52')](_0x23d4e0,function(_0x278618){return db[_0x5361('0x40')][_0x5361('0x53')]({'where':{'UserId':_0x278618['id'],'OpenchannelQueueId':_0x22e563[_0x5361('0x37')]['id']},'transaction':_0x537378});});})[_0x5361('0x18')](function(){_0x23d4e0[_0x5361('0x54')](function(_0x549401){socket[_0x5361('0x55')](_0x5361('0x56'),{'UserId':_0x549401['id'],'OpenchannelQueueId':_0x478810['id']});});});});});}})[_0x5361('0x18')](respondWithStatusCode(_0x1a3dd8,null))[_0x5361('0x2e')](handleError(_0x1a3dd8,null));};exports[_0x5361('0x57')]=function(_0x12aa6b,_0x437b4d){return db[_0x5361('0x58')][_0x5361('0x41')]({'where':{'id':_0x12aa6b[_0x5361('0x22')][_0x5361('0x59')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5361('0x4c'),'attributes':['id'],'raw':!![]}]})[_0x5361('0x18')](handleEntityNotFound(_0x437b4d,null))[_0x5361('0x18')](function(_0x2d3742){var _0x11e4af=_[_0x5361('0x1c')](_0x2d3742,'id');var _0x2713e2=[];var _0x57725a=[];var _0x3e725c=squel[_0x5361('0x5a')]();_0x3e725c[_0x5361('0x5b')](_0x5361('0x5c'))[_0x5361('0x5d')]('team_has_openchannel_queues','tq')['join'](_0x5361('0x5e'),'ut',_0x5361('0x5f'))[_0x5361('0x21')](_0x5361('0x60'),_0x12aa6b[_0x5361('0x37')]['id']);for(var _0x75dc4d=0x0;_0x75dc4d<_0x2d3742[_0x5361('0x39')];_0x75dc4d+=0x1){let _0x1cb784=_0x2d3742[_0x75dc4d];for(var _0x5004db=0x0;_0x5004db<_0x1cb784[_0x5361('0x4c')]['length'];_0x5004db+=0x1){let _0x587f2e=_0x1cb784['Agents'][_0x5004db];var _0x592b76=_0x3e725c[_0x5361('0x61')]();_0x592b76['where'](_0x5361('0x62'),_0x587f2e['id']);_0x57725a[_0x5361('0x63')](db[_0x5361('0x51')]['query'](_0x592b76[_0x5361('0x64')](),{'type':db[_0x5361('0x51')][_0x5361('0x65')][_0x5361('0x66')]})[_0x5361('0x18')](function(_0x1d7998){if(_0x1d7998[_0x5361('0x39')]===0x1){return _0x587f2e['id'];}else{var _0xbaeacc=_[_0x5361('0x67')](_['map'](_0x1d7998,_0x5361('0x68')),function(_0x22505c){return _[_0x5361('0x69')](_0x11e4af,_0x22505c);});if(_0xbaeacc){return _0x587f2e['id'];}}}));}}return BPromise[_0x5361('0x6a')](_0x57725a)[_0x5361('0x18')](function(_0xb6dee0){_0x2713e2=_(_0x2713e2)[_0x5361('0x6b')](_0xb6dee0)[_0x5361('0x6c')]()[_0x5361('0x6d')]();return db['OpenchannelQueue'][_0x5361('0x50')]({'where':{'id':_0x12aa6b[_0x5361('0x37')]['id']}})['then'](function(_0x41911f){return db[_0x5361('0x51')][_0x5361('0x6e')](function(_0x598e2e){return _0x41911f['removeTeams'](_0x12aa6b[_0x5361('0x22')][_0x5361('0x59')],{'transaction':_0x598e2e})[_0x5361('0x18')](function(){if(!_[_0x5361('0x6f')](_0x2713e2)){return _0x41911f[_0x5361('0x70')](_0x2713e2,{'transaction':_0x598e2e});}})[_0x5361('0x18')](function(){_0x2713e2[_0x5361('0x54')](function(_0x4350d8){socket[_0x5361('0x55')](_0x5361('0x71'),{'UserId':_0x4350d8,'OpenchannelQueueId':_0x41911f['id']});});});});});});})[_0x5361('0x18')](respondWithStatusCode(_0x437b4d,null))['catch'](handleError(_0x437b4d,null));};exports[_0x5361('0x72')]=function(_0x1eba26,_0x4f7478){return db[_0x5361('0x1d')]['find']({'where':{'id':_0x1eba26[_0x5361('0x37')]['id']}})[_0x5361('0x18')](handleEntityNotFound(_0x4f7478,null))[_0x5361('0x18')](function(_0x206880){if(_0x206880){return _0x206880['addAgents'](_0x1eba26['body'][_0x5361('0x59')],_[_0x5361('0x73')](_0x1eba26['body'],['ids','id'])||{})[_0x5361('0x74')](function(_0x42a3f6){for(var _0x297091=0x0;_0x297091<_0x1eba26[_0x5361('0x30')][_0x5361('0x59')]['length'];_0x297091+=0x1){socket[_0x5361('0x55')](_0x5361('0x56'),{'UserId':Number(_0x1eba26[_0x5361('0x30')]['ids'][_0x297091]),'OpenchannelQueueId':Number(_0x1eba26['params']['id'])});}return _0x42a3f6;});}})[_0x5361('0x18')](respondWithResult(_0x4f7478,null))[_0x5361('0x2e')](handleError(_0x4f7478,null));};exports[_0x5361('0x70')]=function(_0x5e5d31,_0x26b08d){return db['OpenchannelQueue']['find']({'where':{'id':_0x5e5d31[_0x5361('0x37')]['id']}})['then'](handleEntityNotFound(_0x26b08d,null))[_0x5361('0x18')](function(_0x4e1569){if(_0x4e1569){return _0x4e1569[_0x5361('0x70')](_0x5e5d31['query'][_0x5361('0x59')])['then'](function(){if(_[_0x5361('0x75')](_0x5e5d31[_0x5361('0x22')][_0x5361('0x59')])){for(var _0x5e9f6d=0x0;_0x5e9f6d<_0x5e5d31['query'][_0x5361('0x59')]['length'];_0x5e9f6d+=0x1){socket[_0x5361('0x55')](_0x5361('0x71'),{'UserId':Number(_0x5e5d31[_0x5361('0x22')][_0x5361('0x59')][_0x5e9f6d]),'OpenchannelQueueId':Number(_0x5e5d31[_0x5361('0x37')]['id'])});}}else{socket[_0x5361('0x55')](_0x5361('0x71'),{'UserId':Number(_0x5e5d31[_0x5361('0x22')]['ids']),'OpenchannelQueueId':Number(_0x5e5d31[_0x5361('0x37')]['id'])});}});}})['then'](respondWithStatusCode(_0x26b08d,null))[_0x5361('0x2e')](handleError(_0x26b08d,null));};exports[_0x5361('0x76')]=function(_0x4c284e,_0x34b783){var _0xff49e9={};var _0x4343ae={};var _0x3235de;var _0x219293;return db[_0x5361('0x1d')]['findOne']({'where':{'id':_0x4c284e[_0x5361('0x37')]['id']}})[_0x5361('0x18')](handleEntityNotFound(_0x34b783,null))[_0x5361('0x18')](function(_0x3a0834){if(_0x3a0834){_0x3235de=_0x3a0834;_0x4343ae['model']=_[_0x5361('0x25')](db[_0x5361('0x42')]['rawAttributes']);_0x4343ae[_0x5361('0x22')]=_['keys'](_0x4c284e[_0x5361('0x22')]);_0x4343ae[_0x5361('0x26')]=_['intersection'](_0x4343ae[_0x5361('0x27')],_0x4343ae['query']);_0xff49e9[_0x5361('0x2a')]=_[_0x5361('0x28')](_0x4343ae[_0x5361('0x27')],qs[_0x5361('0x29')](_0x4c284e['query'][_0x5361('0x29')]));_0xff49e9[_0x5361('0x2a')]=_0xff49e9[_0x5361('0x2a')][_0x5361('0x39')]?_0xff49e9[_0x5361('0x2a')]:_0x4343ae[_0x5361('0x27')];_0xff49e9[_0x5361('0x3c')]=qs[_0x5361('0x3d')](_0x4c284e['query'][_0x5361('0x3d')]);_0xff49e9[_0x5361('0x21')]=qs[_0x5361('0x26')](_['pick'](_0x4c284e[_0x5361('0x22')],_0x4343ae[_0x5361('0x26')]));if(_0x4c284e['query'][_0x5361('0x3f')]){_0xff49e9['where']=_[_0x5361('0x49')](_0xff49e9[_0x5361('0x21')],{'$or':_[_0x5361('0x1c')](_0xff49e9['attributes'],function(_0x5be080){var _0xa29af2={};_0xa29af2[_0x5be080]={'$like':'%'+_0x4c284e[_0x5361('0x22')][_0x5361('0x3f')]+'%'};return _0xa29af2;})});}_0xff49e9=_['merge']({},_0xff49e9,_0x4c284e[_0x5361('0x2d')]);return _0x3235de[_0x5361('0x76')](_0xff49e9);}})[_0x5361('0x18')](function(_0x397500){if(_0x397500){_0x219293=_0x397500[_0x5361('0x39')];if(!_0x4c284e[_0x5361('0x22')][_0x5361('0x3a')](_0x5361('0x3b'))){_0xff49e9[_0x5361('0x11')]=qs[_0x5361('0x11')](_0x4c284e[_0x5361('0x22')][_0x5361('0x11')]);_0xff49e9[_0x5361('0xf')]=qs[_0x5361('0xf')](_0x4c284e[_0x5361('0x22')]['offset']);}return _0x3235de[_0x5361('0x76')](_0xff49e9);}})[_0x5361('0x18')](function(_0x366dd1){if(_0x366dd1){return _0x366dd1?{'count':_0x219293,'rows':_0x366dd1}:null;}})[_0x5361('0x18')](respondWithResult(_0x34b783,null))['catch'](handleError(_0x34b783,null));}; \ No newline at end of file +var _0x31c0=['name','send','map','OpenchannelQueue','type','key','getOptions','include','show','params','keys','rawAttributes','query','filters','model','intersection','attributes','length','includeAll','merge','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserOpenchannelQueue','fields','hasOwnProperty','order','sort','pick','where','OpenchannelQueueId','filter','findAll','User','findAndCountAll','openchannelPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','transaction','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','nolimit','bluebird','util','lodash','squel','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','get','OpenchannelQueues','UserProfileResource','status'];(function(_0x149234,_0xb398ea){var _0x5a3b92=function(_0x35124e){while(--_0x35124e){_0x149234['push'](_0x149234['shift']());}};_0x5a3b92(++_0xb398ea);}(_0x31c0,0xd7));var _0x031c=function(_0xedc58a,_0x46d853){_0xedc58a=_0xedc58a-0x0;var _0x37ac38=_0x31c0[_0xedc58a];return _0x37ac38;};'use strict';var BPromise=require(_0x031c('0x0'));var util=require(_0x031c('0x1'));var _=require(_0x031c('0x2'));var squel=require(_0x031c('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x031c('0x4'));var config=require(_0x031c('0x5'));var db=require(_0x031c('0x6'))['db'];config[_0x031c('0x7')]=_[_0x031c('0x8')](config[_0x031c('0x7')],{'host':_0x031c('0x9'),'port':0x18eb});var socket=require(_0x031c('0xa'))(new Redis(config[_0x031c('0x7')]));require(_0x031c('0xb'))[_0x031c('0xc')](socket);function respondWithStatusCode(_0x51140c,_0x50ef91){_0x50ef91=_0x50ef91||0xcc;return function(_0x22286c){if(_0x22286c){return _0x51140c[_0x031c('0xd')](_0x50ef91);}return _0x51140c['status'](_0x50ef91)[_0x031c('0xe')]();};}function respondWithResult(_0x4601c4,_0xd61c5b){_0xd61c5b=_0xd61c5b||0xc8;return function(_0x41fe52){if(_0x41fe52){return _0x4601c4['status'](_0xd61c5b)[_0x031c('0xf')](_0x41fe52);}};}function respondWithFilteredResult(_0x517cc4,_0xa5be77){return function(_0x473ac5){if(_0x473ac5){var _0x3e1008=typeof _0xa5be77[_0x031c('0x10')]===_0x031c('0x11')&&typeof _0xa5be77[_0x031c('0x12')]==='undefined';var _0x1f4ac0=_0x473ac5[_0x031c('0x13')];var _0x28d8fa=_0x3e1008?0x0:_0xa5be77[_0x031c('0x10')];var _0x2dfe66=_0x3e1008?_0x473ac5[_0x031c('0x13')]:_0xa5be77[_0x031c('0x10')]+_0xa5be77['limit'];var _0x3a66f0;if(_0x2dfe66>=_0x1f4ac0){_0x2dfe66=_0x1f4ac0;_0x3a66f0=0xc8;}else{_0x3a66f0=0xce;}_0x517cc4['status'](_0x3a66f0);return _0x517cc4[_0x031c('0x14')](_0x031c('0x15'),_0x28d8fa+'-'+_0x2dfe66+'/'+_0x1f4ac0)['json'](_0x473ac5);}return null;};}function saveUpdates(_0x3d7563){return function(_0x4316f4){if(_0x4316f4){return _0x4316f4[_0x031c('0x16')](_0x3d7563)['then'](function(_0x3a5a88){return _0x3a5a88;});}return null;};}function removeEntity(_0x34434a){return function(_0x313c4a){if(_0x313c4a){return _0x313c4a[_0x031c('0x17')]()[_0x031c('0x18')](function(){var _0x20cee3=_0x313c4a[_0x031c('0x19')]({'plain':!![]});var _0x202b54=_0x031c('0x1a');return db[_0x031c('0x1b')][_0x031c('0x17')]({'where':{'type':_0x202b54,'resourceId':_0x20cee3['id']}})[_0x031c('0x18')](function(){return _0x313c4a;});})[_0x031c('0x18')](function(){_0x34434a[_0x031c('0x1c')](0xcc)[_0x031c('0xe')]();});}};}function handleEntityNotFound(_0x5ffe6c){return function(_0x100f6d){if(!_0x100f6d){_0x5ffe6c[_0x031c('0xd')](0x194);}return _0x100f6d;};}function handleError(_0x33a897,_0x53eb28){_0x53eb28=_0x53eb28||0x1f4;return function(_0xc7897){logger['error'](_0xc7897['stack']);if(_0xc7897[_0x031c('0x1d')]){delete _0xc7897['name'];}_0x33a897[_0x031c('0x1c')](_0x53eb28)[_0x031c('0x1e')](_0xc7897);};}exports['index']=function(_0x495674,_0x40ef79){var _0x3483e7={};var _0x4345fc={'count':0x0,'rows':[]};var _0x49f00f=_[_0x031c('0x1f')](db[_0x031c('0x20')]['rawAttributes'],function(_0x594a35){return{'name':_0x594a35['fieldName'],'type':_0x594a35[_0x031c('0x21')][_0x031c('0x22')]};});_0x3483e7=qs[_0x031c('0x23')](_0x49f00f,_0x495674);var _0x368ea0={'where':_0x3483e7['where']};return db[_0x031c('0x20')][_0x031c('0x13')](_0x368ea0)[_0x031c('0x18')](function(_0x4328bd){_0x4345fc[_0x031c('0x13')]=_0x4328bd;_0x3483e7['include']=qs[_0x031c('0x24')](_0x495674['query']);return db[_0x031c('0x20')]['findAll'](_0x3483e7);})['then'](function(_0x1c5714){_0x4345fc['rows']=_0x1c5714;return _0x4345fc;})[_0x031c('0x18')](respondWithFilteredResult(_0x40ef79,_0x3483e7))['catch'](handleError(_0x40ef79,null));};exports[_0x031c('0x25')]=function(_0x4389d3,_0xa9d339){var _0x593f79={'raw':!![],'where':{'id':_0x4389d3[_0x031c('0x26')]['id']}},_0x3ac56a={};_0x3ac56a['model']=_[_0x031c('0x27')](db[_0x031c('0x20')][_0x031c('0x28')]);_0x3ac56a[_0x031c('0x29')]=_[_0x031c('0x27')](_0x4389d3[_0x031c('0x29')]);_0x3ac56a[_0x031c('0x2a')]=_['intersection'](_0x3ac56a[_0x031c('0x2b')],_0x3ac56a['query']);_0x593f79['attributes']=_[_0x031c('0x2c')](_0x3ac56a[_0x031c('0x2b')],qs['fields'](_0x4389d3[_0x031c('0x29')]['fields']));_0x593f79[_0x031c('0x2d')]=_0x593f79[_0x031c('0x2d')][_0x031c('0x2e')]?_0x593f79['attributes']:_0x3ac56a[_0x031c('0x2b')];if(_0x4389d3[_0x031c('0x29')][_0x031c('0x2f')]){_0x593f79[_0x031c('0x24')]=[{'all':!![]}];}_0x593f79=_[_0x031c('0x30')]({},_0x593f79,_0x4389d3[_0x031c('0x31')]);return db[_0x031c('0x20')][_0x031c('0x32')](_0x593f79)[_0x031c('0x18')](handleEntityNotFound(_0xa9d339,null))[_0x031c('0x18')](respondWithResult(_0xa9d339,null))[_0x031c('0x33')](handleError(_0xa9d339,null));};exports[_0x031c('0x34')]=function(_0x3181af,_0x1327b5){return db[_0x031c('0x20')][_0x031c('0x34')](_0x3181af[_0x031c('0x35')],{})[_0x031c('0x18')](function(_0x4deefc){var _0xd53d95=_0x3181af[_0x031c('0x36')][_0x031c('0x19')]({'plain':!![]});if(!_0xd53d95)throw new Error(_0x031c('0x37'));if(_0xd53d95[_0x031c('0x38')]===_0x031c('0x36')){var _0x2b5471=_0x4deefc[_0x031c('0x19')]({'plain':!![]});var _0xb6d1cb='OpenchannelQueues';return db[_0x031c('0x39')][_0x031c('0x32')]({'where':{'name':_0xb6d1cb,'userProfileId':_0xd53d95['userProfileId']},'raw':!![]})[_0x031c('0x18')](function(_0x1813a1){if(_0x1813a1&&_0x1813a1[_0x031c('0x3a')]===0x0){return db['UserProfileResource'][_0x031c('0x34')]({'name':_0x2b5471[_0x031c('0x1d')],'resourceId':_0x2b5471['id'],'type':_0x1813a1[_0x031c('0x1d')],'sectionId':_0x1813a1['id']},{})[_0x031c('0x18')](function(){return _0x4deefc;});}else{return _0x4deefc;}})[_0x031c('0x33')](function(_0x23e290){logger[_0x031c('0x3b')](_0x031c('0x3c'),_0x23e290);throw _0x23e290;});}return _0x4deefc;})[_0x031c('0x18')](respondWithResult(_0x1327b5,0xc9))[_0x031c('0x33')](handleError(_0x1327b5,null));};exports[_0x031c('0x16')]=function(_0x18aa8a,_0x3a1ab3){if(_0x18aa8a[_0x031c('0x35')]['id']){delete _0x18aa8a[_0x031c('0x35')]['id'];}return db[_0x031c('0x20')][_0x031c('0x32')]({'where':{'id':_0x18aa8a['params']['id']}})[_0x031c('0x18')](handleEntityNotFound(_0x3a1ab3,null))[_0x031c('0x18')](saveUpdates(_0x18aa8a[_0x031c('0x35')],null))[_0x031c('0x18')](respondWithResult(_0x3a1ab3,null))[_0x031c('0x33')](handleError(_0x3a1ab3,null));};exports['destroy']=function(_0x2fb772,_0x3192ef){return db['OpenchannelQueue'][_0x031c('0x32')]({'where':{'id':_0x2fb772['params']['id']}})[_0x031c('0x18')](handleEntityNotFound(_0x3192ef,null))[_0x031c('0x18')](removeEntity(_0x3192ef,null))['catch'](handleError(_0x3192ef,null));};exports[_0x031c('0x3d')]=function(_0x5d9210,_0x5ceeaf){return db[_0x031c('0x20')][_0x031c('0x3d')]()[_0x031c('0x18')](respondWithResult(_0x5ceeaf,null))[_0x031c('0x33')](handleError(_0x5ceeaf,null));};exports['getMembers']=function(_0x511151,_0x36f629){var _0x3ec199={'raw':!![],'where':{}},_0x35946b={},_0x33b762;return db[_0x031c('0x20')]['findOne']({'where':{'id':_0x511151[_0x031c('0x26')]['id']}})[_0x031c('0x18')](handleEntityNotFound(_0x36f629,null))[_0x031c('0x18')](function(_0x1d70e2){if(_0x1d70e2){_0x33b762=_0x1d70e2[_0x031c('0x19')]({'plain':!![]});_0x35946b[_0x031c('0x2b')]=_['keys'](db[_0x031c('0x3e')]['rawAttributes']);_0x35946b['query']=_[_0x031c('0x27')](_0x511151[_0x031c('0x29')]);_0x35946b[_0x031c('0x2a')]=_['intersection'](_0x35946b[_0x031c('0x2b')],_0x35946b[_0x031c('0x29')]);_0x3ec199[_0x031c('0x2d')]=_[_0x031c('0x2c')](_0x35946b[_0x031c('0x2b')],qs[_0x031c('0x3f')](_0x511151[_0x031c('0x29')][_0x031c('0x3f')]));_0x3ec199[_0x031c('0x2d')]=_0x3ec199[_0x031c('0x2d')]['length']?_0x3ec199[_0x031c('0x2d')]:_0x35946b[_0x031c('0x2b')];if(!_0x511151[_0x031c('0x29')][_0x031c('0x40')]('nolimit')){_0x3ec199[_0x031c('0x12')]=qs['limit'](_0x511151[_0x031c('0x29')][_0x031c('0x12')]);_0x3ec199[_0x031c('0x10')]=qs[_0x031c('0x10')](_0x511151[_0x031c('0x29')][_0x031c('0x10')]);}_0x3ec199[_0x031c('0x41')]=qs[_0x031c('0x42')](_0x511151[_0x031c('0x29')][_0x031c('0x42')]);_0x3ec199['where']=qs[_0x031c('0x2a')](_[_0x031c('0x43')](_0x511151[_0x031c('0x29')],_0x35946b[_0x031c('0x2a')]));_0x3ec199[_0x031c('0x44')][_0x031c('0x45')]=_0x1d70e2['id'];if(_0x511151[_0x031c('0x29')][_0x031c('0x46')]){_0x3ec199[_0x031c('0x44')]=_[_0x031c('0x30')](_0x3ec199[_0x031c('0x44')],{'$or':_[_0x031c('0x1f')](_0x3ec199[_0x031c('0x2d')],function(_0x36e6ab){var _0x5d4b8f={};_0x5d4b8f[_0x36e6ab]={'$like':'%'+_0x511151[_0x031c('0x29')][_0x031c('0x46')]+'%'};return _0x5d4b8f;})});}_0x3ec199=_['merge']({},_0x3ec199,_0x511151[_0x031c('0x31')]);return db[_0x031c('0x3e')][_0x031c('0x47')](_0x3ec199);}})['then'](function(_0x2825e0){if(_0x2825e0){return db[_0x031c('0x48')][_0x031c('0x49')]({'where':{'id':_[_0x031c('0x1f')](_0x2825e0,'UserId'),'role':'agent'},'attributes':['id',_0x031c('0x1d'),_0x031c('0x4a'),_0x031c('0x4b'),_0x031c('0x4c')]});}})[_0x031c('0x18')](function(_0x515529){if(_0x515529){return{'count':_0x515529['count'],'rows':_[_0x031c('0x1f')](_0x515529[_0x031c('0x4d')],function(_0x1e641b){return{'membername':_0x1e641b[_0x031c('0x1d')],'UserId':_0x1e641b['id'],'queue_name':_0x33b762[_0x031c('0x1d')],'OpenchannelQueueId':_0x33b762['id'],'interface':util[_0x031c('0x4e')](_0x031c('0x4f'),'SIP',_0x1e641b[_0x031c('0x1d')]),'penalty':0x0,'paused':_0x1e641b[_0x031c('0x4a')],'createdAt':_0x1e641b[_0x031c('0x4c')],'updatedAt':_0x1e641b[_0x031c('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x36f629,_0x3ec199))['catch'](handleError(_0x36f629,null));};exports[_0x031c('0x50')]=function(_0x32ec29,_0x2745d0){var _0x5e34d7={};var _0xbb7d54={};var _0x8bab5a;var _0x97b2a7;return db['OpenchannelQueue'][_0x031c('0x51')]({'where':{'id':_0x32ec29[_0x031c('0x26')]['id']}})[_0x031c('0x18')](handleEntityNotFound(_0x2745d0,null))['then'](function(_0x17e995){if(_0x17e995){_0x8bab5a=_0x17e995;_0xbb7d54[_0x031c('0x2b')]=_['keys'](db[_0x031c('0x52')][_0x031c('0x28')]);_0xbb7d54[_0x031c('0x29')]=_[_0x031c('0x27')](_0x32ec29[_0x031c('0x29')]);_0xbb7d54[_0x031c('0x2a')]=_[_0x031c('0x2c')](_0xbb7d54[_0x031c('0x2b')],_0xbb7d54['query']);_0x5e34d7[_0x031c('0x2d')]=_[_0x031c('0x2c')](_0xbb7d54[_0x031c('0x2b')],qs[_0x031c('0x3f')](_0x32ec29[_0x031c('0x29')][_0x031c('0x3f')]));_0x5e34d7[_0x031c('0x2d')]=_0x5e34d7[_0x031c('0x2d')][_0x031c('0x2e')]?_0x5e34d7[_0x031c('0x2d')]:_0xbb7d54[_0x031c('0x2b')];_0x5e34d7[_0x031c('0x41')]=qs[_0x031c('0x42')](_0x32ec29[_0x031c('0x29')][_0x031c('0x42')]);_0x5e34d7[_0x031c('0x44')]=qs['filters'](_[_0x031c('0x43')](_0x32ec29[_0x031c('0x29')],_0xbb7d54[_0x031c('0x2a')]));if(_0x32ec29[_0x031c('0x29')][_0x031c('0x46')]){_0x5e34d7[_0x031c('0x44')]=_['merge'](_0x5e34d7[_0x031c('0x44')],{'$or':_[_0x031c('0x1f')](_0x5e34d7[_0x031c('0x2d')],function(_0x51a01f){var _0x4323b3={};_0x4323b3[_0x51a01f]={'$like':'%'+_0x32ec29[_0x031c('0x29')]['filter']+'%'};return _0x4323b3;})});}_0x5e34d7=_[_0x031c('0x30')]({},_0x5e34d7,_0x32ec29['options']);return _0x8bab5a['getTeams'](_0x5e34d7);}})[_0x031c('0x18')](function(_0x432ac6){if(_0x432ac6){_0x97b2a7=_0x432ac6[_0x031c('0x2e')];if(!_0x32ec29[_0x031c('0x29')][_0x031c('0x40')]('nolimit')){_0x5e34d7[_0x031c('0x12')]=qs[_0x031c('0x12')](_0x32ec29[_0x031c('0x29')][_0x031c('0x12')]);_0x5e34d7[_0x031c('0x10')]=qs[_0x031c('0x10')](_0x32ec29[_0x031c('0x29')]['offset']);}return _0x8bab5a[_0x031c('0x50')](_0x5e34d7);}})[_0x031c('0x18')](function(_0x1dbf74){if(_0x1dbf74){return _0x1dbf74?{'count':_0x97b2a7,'rows':_0x1dbf74}:null;}})[_0x031c('0x18')](respondWithResult(_0x2745d0,null))[_0x031c('0x33')](handleError(_0x2745d0,null));};exports[_0x031c('0x53')]=function(_0x9cda7a,_0x3f3fab){var _0x1efff3=_0x9cda7a['body'][_0x031c('0x54')];return db[_0x031c('0x52')][_0x031c('0x47')]({'where':{'id':_0x1efff3},'attributes':['id'],'include':[{'model':db[_0x031c('0x48')],'as':_0x031c('0x55'),'attributes':['id',_0x031c('0x1d'),_0x031c('0x56'),_0x031c('0x57'),'interface'],'raw':!![]}]})['then'](function(_0x5ab046){if(_0x5ab046){var _0x1ac1b8=_[_0x031c('0x58')](_0x5ab046,function(_0x1738e9){var _0x1e2938=_0x1738e9[_0x031c('0x19')]({'plain':!![]});return _0x1e2938[_0x031c('0x55')];});return db[_0x031c('0x20')][_0x031c('0x32')]({'where':{'id':_0x9cda7a['params']['id']}})[_0x031c('0x18')](function(_0x38dd11){return db[_0x031c('0x59')]['transaction'](function(_0x18edc7){return _0x38dd11['addTeams'](_0x1efff3,{'transaction':_0x18edc7})[_0x031c('0x18')](function(){return BPromise[_0x031c('0x5a')](_0x1ac1b8,function(_0x26a1f1){return db['UserOpenchannelQueue'][_0x031c('0x5b')]({'where':{'UserId':_0x26a1f1['id'],'OpenchannelQueueId':_0x9cda7a['params']['id']},'transaction':_0x18edc7});});})[_0x031c('0x18')](function(){_0x1ac1b8[_0x031c('0x5c')](function(_0x37067d){socket['emit'](_0x031c('0x5d'),{'UserId':_0x37067d['id'],'OpenchannelQueueId':_0x38dd11['id']});});});});});}})[_0x031c('0x18')](respondWithStatusCode(_0x3f3fab,null))[_0x031c('0x33')](handleError(_0x3f3fab,null));};exports[_0x031c('0x5e')]=function(_0x1be6c6,_0x51ef8f){return db[_0x031c('0x52')][_0x031c('0x47')]({'where':{'id':_0x1be6c6[_0x031c('0x29')][_0x031c('0x54')]},'attributes':['id'],'include':[{'model':db[_0x031c('0x48')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x031c('0x18')](handleEntityNotFound(_0x51ef8f,null))[_0x031c('0x18')](function(_0x436e72){var _0x56b9f2=_[_0x031c('0x1f')](_0x436e72,'id');var _0x2abad9=[];var _0x12c0d4=[];var _0x453329=squel[_0x031c('0x5f')]();_0x453329[_0x031c('0x60')](_0x031c('0x61'))['from'](_0x031c('0x62'),'tq')[_0x031c('0x63')]('user_has_teams','ut',_0x031c('0x64'))['where']('OpenchannelQueueId\x20=\x20?',_0x1be6c6[_0x031c('0x26')]['id']);for(var _0x2985a3=0x0;_0x2985a3<_0x436e72[_0x031c('0x2e')];_0x2985a3+=0x1){let _0x280739=_0x436e72[_0x2985a3];for(var _0x24f8d5=0x0;_0x24f8d5<_0x280739['Agents'][_0x031c('0x2e')];_0x24f8d5+=0x1){let _0x3fe53a=_0x280739[_0x031c('0x55')][_0x24f8d5];var _0x5a6dfb=_0x453329[_0x031c('0x65')]();_0x5a6dfb[_0x031c('0x44')]('ut.UserId\x20=\x20?',_0x3fe53a['id']);_0x12c0d4[_0x031c('0x66')](db['sequelize'][_0x031c('0x29')](_0x5a6dfb[_0x031c('0x67')](),{'type':db['sequelize'][_0x031c('0x68')][_0x031c('0x69')]})[_0x031c('0x18')](function(_0x445cae){if(_0x445cae[_0x031c('0x2e')]===0x1){return _0x3fe53a['id'];}else{var _0x3eaa25=_[_0x031c('0x6a')](_[_0x031c('0x1f')](_0x445cae,_0x031c('0x6b')),function(_0x2628ad){return _[_0x031c('0x6c')](_0x56b9f2,_0x2628ad);});if(_0x3eaa25){return _0x3fe53a['id'];}}}));}}return BPromise[_0x031c('0x6d')](_0x12c0d4)[_0x031c('0x18')](function(_0x120560){_0x2abad9=_(_0x2abad9)[_0x031c('0x6e')](_0x120560)[_0x031c('0x6f')]()['value']();return db[_0x031c('0x20')]['find']({'where':{'id':_0x1be6c6[_0x031c('0x26')]['id']}})['then'](function(_0x9795e9){return db[_0x031c('0x59')][_0x031c('0x70')](function(_0x1bed3d){return _0x9795e9['removeTeams'](_0x1be6c6[_0x031c('0x29')][_0x031c('0x54')],{'transaction':_0x1bed3d})[_0x031c('0x18')](function(){if(!_['isEmpty'](_0x2abad9)){return _0x9795e9[_0x031c('0x71')](_0x2abad9,{'transaction':_0x1bed3d});}})[_0x031c('0x18')](function(){_0x2abad9['forEach'](function(_0x59f275){socket[_0x031c('0x72')](_0x031c('0x73'),{'UserId':_0x59f275,'OpenchannelQueueId':_0x9795e9['id']});});});});});});})['then'](respondWithStatusCode(_0x51ef8f,null))['catch'](handleError(_0x51ef8f,null));};exports[_0x031c('0x74')]=function(_0x46df64,_0x329a1b){return db[_0x031c('0x20')][_0x031c('0x32')]({'where':{'id':_0x46df64[_0x031c('0x26')]['id']}})[_0x031c('0x18')](handleEntityNotFound(_0x329a1b,null))[_0x031c('0x18')](function(_0x52b550){if(_0x52b550){return _0x52b550[_0x031c('0x74')](_0x46df64[_0x031c('0x35')][_0x031c('0x54')],_[_0x031c('0x75')](_0x46df64[_0x031c('0x35')],[_0x031c('0x54'),'id'])||{})[_0x031c('0x76')](function(_0x1c1137){for(var _0x57c23b=0x0;_0x57c23b<_0x46df64[_0x031c('0x35')][_0x031c('0x54')][_0x031c('0x2e')];_0x57c23b+=0x1){socket[_0x031c('0x72')](_0x031c('0x5d'),{'UserId':Number(_0x46df64['body'][_0x031c('0x54')][_0x57c23b]),'OpenchannelQueueId':Number(_0x46df64[_0x031c('0x26')]['id'])});}return _0x1c1137;});}})[_0x031c('0x18')](respondWithResult(_0x329a1b,null))[_0x031c('0x33')](handleError(_0x329a1b,null));};exports[_0x031c('0x71')]=function(_0x322835,_0x28e705){return db[_0x031c('0x20')][_0x031c('0x32')]({'where':{'id':_0x322835['params']['id']}})[_0x031c('0x18')](handleEntityNotFound(_0x28e705,null))['then'](function(_0x14c1b1){if(_0x14c1b1){return _0x14c1b1[_0x031c('0x71')](_0x322835['query']['ids'])[_0x031c('0x18')](function(){if(_[_0x031c('0x77')](_0x322835[_0x031c('0x29')][_0x031c('0x54')])){for(var _0x450945=0x0;_0x450945<_0x322835[_0x031c('0x29')]['ids']['length'];_0x450945+=0x1){socket['emit'](_0x031c('0x73'),{'UserId':Number(_0x322835[_0x031c('0x29')][_0x031c('0x54')][_0x450945]),'OpenchannelQueueId':Number(_0x322835[_0x031c('0x26')]['id'])});}}else{socket[_0x031c('0x72')]('userOpenchannelQueue:remove',{'UserId':Number(_0x322835['query'][_0x031c('0x54')]),'OpenchannelQueueId':Number(_0x322835[_0x031c('0x26')]['id'])});}});}})[_0x031c('0x18')](respondWithStatusCode(_0x28e705,null))['catch'](handleError(_0x28e705,null));};exports[_0x031c('0x78')]=function(_0x359ca6,_0x10aaac){var _0x15c090={};var _0x47db60={};var _0x39f573;var _0x5bceb4;return db['OpenchannelQueue'][_0x031c('0x51')]({'where':{'id':_0x359ca6[_0x031c('0x26')]['id']}})['then'](handleEntityNotFound(_0x10aaac,null))['then'](function(_0x139734){if(_0x139734){_0x39f573=_0x139734;_0x47db60[_0x031c('0x2b')]=_[_0x031c('0x27')](db[_0x031c('0x48')][_0x031c('0x28')]);_0x47db60[_0x031c('0x29')]=_[_0x031c('0x27')](_0x359ca6[_0x031c('0x29')]);_0x47db60[_0x031c('0x2a')]=_['intersection'](_0x47db60['model'],_0x47db60[_0x031c('0x29')]);_0x15c090[_0x031c('0x2d')]=_[_0x031c('0x2c')](_0x47db60[_0x031c('0x2b')],qs[_0x031c('0x3f')](_0x359ca6['query'][_0x031c('0x3f')]));_0x15c090[_0x031c('0x2d')]=_0x15c090[_0x031c('0x2d')][_0x031c('0x2e')]?_0x15c090['attributes']:_0x47db60[_0x031c('0x2b')];_0x15c090[_0x031c('0x41')]=qs[_0x031c('0x42')](_0x359ca6[_0x031c('0x29')][_0x031c('0x42')]);_0x15c090[_0x031c('0x44')]=qs[_0x031c('0x2a')](_[_0x031c('0x43')](_0x359ca6[_0x031c('0x29')],_0x47db60[_0x031c('0x2a')]));if(_0x359ca6[_0x031c('0x29')][_0x031c('0x46')]){_0x15c090[_0x031c('0x44')]=_['merge'](_0x15c090[_0x031c('0x44')],{'$or':_[_0x031c('0x1f')](_0x15c090[_0x031c('0x2d')],function(_0x5dd464){var _0x318d84={};_0x318d84[_0x5dd464]={'$like':'%'+_0x359ca6[_0x031c('0x29')][_0x031c('0x46')]+'%'};return _0x318d84;})});}_0x15c090=_['merge']({},_0x15c090,_0x359ca6[_0x031c('0x31')]);return _0x39f573[_0x031c('0x78')](_0x15c090);}})['then'](function(_0x5a17c1){if(_0x5a17c1){_0x5bceb4=_0x5a17c1[_0x031c('0x2e')];if(!_0x359ca6[_0x031c('0x29')]['hasOwnProperty'](_0x031c('0x79'))){_0x15c090[_0x031c('0x12')]=qs[_0x031c('0x12')](_0x359ca6[_0x031c('0x29')][_0x031c('0x12')]);_0x15c090[_0x031c('0x10')]=qs[_0x031c('0x10')](_0x359ca6[_0x031c('0x29')]['offset']);}return _0x39f573['getAgents'](_0x15c090);}})[_0x031c('0x18')](function(_0x341999){if(_0x341999){return _0x341999?{'count':_0x5bceb4,'rows':_0x341999}:null;}})[_0x031c('0x18')](respondWithResult(_0x10aaac,null))[_0x031c('0x33')](handleError(_0x10aaac,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 6f9e423..fb58bfb 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 _0x654a=['exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2615f2,_0x13a7e4){var _0x6bdcdb=function(_0x18fd66){while(--_0x18fd66){_0x2615f2['push'](_0x2615f2['shift']());}};_0x6bdcdb(++_0x13a7e4);}(_0x654a,0xe8));var _0xa654=function(_0x29abe6,_0x39ef28){_0x29abe6=_0x29abe6-0x0;var _0x4f91aa=_0x654a[_0x29abe6];return _0x4f91aa;};'use strict';var EventEmitter=require(_0xa654('0x0'));var OpenchannelQueue=require(_0xa654('0x1'))['db'][_0xa654('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xa654('0x3')](0x0);var events={'afterCreate':_0xa654('0x4'),'afterUpdate':_0xa654('0x5'),'afterDestroy':_0xa654('0x6')};function emitEvent(_0x537aa3){return function(_0x51cff3,_0x5ba370,_0x35be89){OpenchannelQueueEvents[_0xa654('0x7')](_0x537aa3+':'+_0x51cff3['id'],_0x51cff3);OpenchannelQueueEvents[_0xa654('0x7')](_0x537aa3,_0x51cff3);_0x35be89(null);};}for(var e in events){if(events[_0xa654('0x8')](e)){var event=events[e];OpenchannelQueue[_0xa654('0x9')](e,emitEvent(event));}}module[_0xa654('0xa')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x4a83=['exports','../../mysqldb','OpenchannelQueue','save','update','remove','emit','hook'];(function(_0x48854f,_0x3b877f){var _0x48255f=function(_0x5fec38){while(--_0x5fec38){_0x48854f['push'](_0x48854f['shift']());}};_0x48255f(++_0x3b877f);}(_0x4a83,0x1a1));var _0x34a8=function(_0x131bfd,_0x53a8a3){_0x131bfd=_0x131bfd-0x0;var _0x72e362=_0x4a83[_0x131bfd];return _0x72e362;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x34a8('0x0'))['db'][_0x34a8('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x34a8('0x2'),'afterUpdate':_0x34a8('0x3'),'afterDestroy':_0x34a8('0x4')};function emitEvent(_0x13220d){return function(_0x28496e,_0x445db1,_0x5ff3bd){OpenchannelQueueEvents[_0x34a8('0x5')](_0x13220d+':'+_0x28496e['id'],_0x28496e);OpenchannelQueueEvents['emit'](_0x13220d,_0x28496e);_0x5ff3bd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x34a8('0x6')](e,emitEvent(event));}}module[_0x34a8('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 e2621b1..c9e8d90 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 _0x6724=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','OpenchannelQueue','openchannel_queues','util'];(function(_0x3e397b,_0x2bf530){var _0x58f75d=function(_0x424629){while(--_0x424629){_0x3e397b['push'](_0x3e397b['shift']());}};_0x58f75d(++_0x2bf530);}(_0x6724,0x15d));var _0x4672=function(_0x1de61d,_0x2e71b2){_0x1de61d=_0x1de61d-0x0;var _0x5395bf=_0x6724[_0x1de61d];return _0x5395bf;};'use strict';var _=require('lodash');var util=require(_0x4672('0x0'));var logger=require(_0x4672('0x1'))('api');var moment=require(_0x4672('0x2'));var BPromise=require(_0x4672('0x3'));var rp=require(_0x4672('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4672('0x5'));var config=require(_0x4672('0x6'));var attributes=require('./openchannelQueue.attributes');module[_0x4672('0x7')]=function(_0x1c584d,_0xc8f6a9){return _0x1c584d['define'](_0x4672('0x8'),attributes,{'tableName':_0x4672('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a23=['request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','util','../../config/logger','api','bluebird'];(function(_0x5a13e7,_0x5106ca){var _0xdf0d59=function(_0xa46ae){while(--_0xa46ae){_0x5a13e7['push'](_0x5a13e7['shift']());}};_0xdf0d59(++_0x5106ca);}(_0x9a23,0x96));var _0x39a2=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9a23[_0x2064e5];return _0x21a233;};'use strict';var _=require('lodash');var util=require(_0x39a2('0x0'));var logger=require(_0x39a2('0x1'))(_0x39a2('0x2'));var moment=require('moment');var BPromise=require(_0x39a2('0x3'));var rp=require(_0x39a2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39a2('0x5'));var config=require(_0x39a2('0x6'));var attributes=require(_0x39a2('0x7'));module[_0x39a2('0x8')]=function(_0x36632a,_0x1444a7){return _0x36632a[_0x39a2('0x9')]('OpenchannelQueue',attributes,{'tableName':_0x39a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 0cc0dd6..619351e 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 _0x53cb=['http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','map','include','model','then','stringify','ShowOpenchannelQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3c71d9,_0x12ff8c){var _0x6618f9=function(_0x39191d){while(--_0x39191d){_0x3c71d9['push'](_0x3c71d9['shift']());}};_0x6618f9(++_0x12ff8c);}(_0x53cb,0x11b));var _0xb53c=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x53cb[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xb53c('0x0'));var util=require('util');var moment=require(_0xb53c('0x1'));var BPromise=require(_0xb53c('0x2'));var rs=require(_0xb53c('0x3'));var fs=require('fs');var Redis=require(_0xb53c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb53c('0x5'));var logger=require(_0xb53c('0x6'))(_0xb53c('0x7'));var config=require(_0xb53c('0x8'));var jayson=require(_0xb53c('0x9'));var client=jayson[_0xb53c('0xa')][_0xb53c('0xb')]({'port':0x232a});config[_0xb53c('0xc')]=_[_0xb53c('0xd')](config['redis'],{'host':_0xb53c('0xe'),'port':0x18eb});var socket=require(_0xb53c('0xf'))(new Redis(config[_0xb53c('0xc')]));require(_0xb53c('0x10'))[_0xb53c('0x11')](socket);function respondWithRpcPromise(_0x4f6d0a,_0x182201,_0x21b41b){return new BPromise(function(_0x328ca9,_0x2f91ed){return client[_0xb53c('0x12')](_0x4f6d0a,_0x21b41b)['then'](function(_0x30404c){logger['info'](_0xb53c('0x13'),_0x182201,'request\x20sent');logger[_0xb53c('0x14')](_0xb53c('0x15'),_0x182201,_0xb53c('0x16'),JSON['stringify'](_0x30404c));if(_0x30404c[_0xb53c('0x17')]){if(_0x30404c[_0xb53c('0x17')][_0xb53c('0x18')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x182201,_0x30404c[_0xb53c('0x17')][_0xb53c('0x19')]);return _0x2f91ed(_0x30404c['error'][_0xb53c('0x19')]);}logger[_0xb53c('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x182201,_0x30404c[_0xb53c('0x17')][_0xb53c('0x19')]);return _0x328ca9(_0x30404c[_0xb53c('0x17')][_0xb53c('0x19')]);}else{logger[_0xb53c('0x1a')]('OpenchannelQueue,\x20%s,\x20%s',_0x182201,'request\x20sent');_0x328ca9(_0x30404c[_0xb53c('0x1b')][_0xb53c('0x19')]);}})[_0xb53c('0x1c')](function(_0x2cff92){logger[_0xb53c('0x17')](_0xb53c('0x13'),_0x182201,_0x2cff92);_0x2f91ed(_0x2cff92);});});}exports[_0xb53c('0x1d')]=function(_0x4cee61){var _0x3af13a=this;return new Promise(function(_0x1388ab,_0x3a1a5c){return db[_0xb53c('0x1e')]['findAll']({'raw':_0x4cee61[_0xb53c('0x1f')]?_0x4cee61['options'][_0xb53c('0x20')]===undefined?!![]:![]:!![],'where':_0x4cee61[_0xb53c('0x1f')]?_0x4cee61['options'][_0xb53c('0x21')]||null:null,'attributes':_0x4cee61[_0xb53c('0x1f')]?_0x4cee61[_0xb53c('0x1f')][_0xb53c('0x22')]||null:null,'limit':_0x4cee61[_0xb53c('0x1f')]?_0x4cee61[_0xb53c('0x1f')]['limit']||null:null,'include':_0x4cee61[_0xb53c('0x1f')]?_0x4cee61['options']['include']?_[_0xb53c('0x23')](_0x4cee61['options'][_0xb53c('0x24')],function(_0x116e30){return{'model':db[_0x116e30['model']],'as':_0x116e30['as'],'attributes':_0x116e30[_0xb53c('0x22')],'include':_0x116e30[_0xb53c('0x24')]?_[_0xb53c('0x23')](_0x116e30[_0xb53c('0x24')],function(_0x45d71c){return{'model':db[_0x45d71c[_0xb53c('0x25')]],'as':_0x45d71c['as'],'attributes':_0x45d71c[_0xb53c('0x22')],'include':_0x45d71c[_0xb53c('0x24')]?_[_0xb53c('0x23')](_0x45d71c[_0xb53c('0x24')],function(_0x327ead){return{'model':db[_0x327ead[_0xb53c('0x25')]],'as':_0x327ead['as'],'attributes':_0x327ead[_0xb53c('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb53c('0x26')](function(_0x4b241a){logger[_0xb53c('0x1a')](_0xb53c('0x1d'),_0x4cee61);logger[_0xb53c('0x14')](_0xb53c('0x1d'),_0x4cee61,JSON[_0xb53c('0x27')](_0x4b241a));_0x1388ab(_0x4b241a);})[_0xb53c('0x1c')](function(_0xb482c9){logger[_0xb53c('0x17')]('GetOpenchannelQueue',_0xb482c9['message'],_0x4cee61);_0x3a1a5c(_0x3af13a[_0xb53c('0x17')](0x1f4,_0xb482c9[_0xb53c('0x19')]));});});};exports[_0xb53c('0x28')]=function(_0x464881){var _0x36e6aa=this;return new Promise(function(_0x40444e,_0x3abce6){return db[_0xb53c('0x1e')][_0xb53c('0x29')]({'raw':_0x464881[_0xb53c('0x1f')]?_0x464881[_0xb53c('0x1f')][_0xb53c('0x20')]===undefined?!![]:![]:!![],'where':_0x464881[_0xb53c('0x1f')]?_0x464881['options'][_0xb53c('0x21')]||null:null,'attributes':_0x464881['options']?_0x464881['options'][_0xb53c('0x22')]||null:null,'include':_0x464881[_0xb53c('0x1f')]?_0x464881[_0xb53c('0x1f')][_0xb53c('0x24')]?_[_0xb53c('0x23')](_0x464881[_0xb53c('0x1f')][_0xb53c('0x24')],function(_0x3bdc53){return{'model':db[_0x3bdc53[_0xb53c('0x25')]],'as':_0x3bdc53['as'],'attributes':_0x3bdc53['attributes'],'include':_0x3bdc53[_0xb53c('0x24')]?_['map'](_0x3bdc53['include'],function(_0x1fc88b){return{'model':db[_0x1fc88b[_0xb53c('0x25')]],'as':_0x1fc88b['as'],'attributes':_0x1fc88b['attributes'],'include':_0x1fc88b['include']?_[_0xb53c('0x23')](_0x1fc88b[_0xb53c('0x24')],function(_0x40ce84){return{'model':db[_0x40ce84[_0xb53c('0x25')]],'as':_0x40ce84['as'],'attributes':_0x40ce84[_0xb53c('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x22964c){logger[_0xb53c('0x1a')](_0xb53c('0x28'),_0x464881);logger[_0xb53c('0x14')]('ShowOpenchannelQueue',_0x464881,JSON['stringify'](_0x22964c));_0x40444e(_0x22964c);})[_0xb53c('0x1c')](function(_0x16e296){logger['error']('ShowOpenchannelQueue',_0x16e296[_0xb53c('0x19')],_0x464881);_0x3abce6(_0x36e6aa[_0xb53c('0x17')](0x1f4,_0x16e296['message']));});});}; \ No newline at end of file +var _0xb65f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','catch','OpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','GetOpenchannelQueue','ShowOpenchannelQueue','lodash'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb65f,0x1a1));var _0xfb65=function(_0x271688,_0x3be140){_0x271688=_0x271688-0x0;var _0x37c1fa=_0xb65f[_0x271688];return _0x37c1fa;};'use strict';var _=require(_0xfb65('0x0'));var util=require(_0xfb65('0x1'));var moment=require(_0xfb65('0x2'));var BPromise=require(_0xfb65('0x3'));var rs=require(_0xfb65('0x4'));var fs=require('fs');var Redis=require(_0xfb65('0x5'));var db=require(_0xfb65('0x6'))['db'];var utils=require(_0xfb65('0x7'));var logger=require('../../config/logger')(_0xfb65('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfb65('0x9')][_0xfb65('0xa')]({'port':0x232a});config[_0xfb65('0xb')]=_['defaults'](config['redis'],{'host':_0xfb65('0xc'),'port':0x18eb});var socket=require(_0xfb65('0xd'))(new Redis(config[_0xfb65('0xb')]));require(_0xfb65('0xe'))['register'](socket);function respondWithRpcPromise(_0xb2656a,_0x4f46c1,_0x303fb9){return new BPromise(function(_0x51c393,_0x1a97a4){return client[_0xfb65('0xf')](_0xb2656a,_0x303fb9)[_0xfb65('0x10')](function(_0x1d2bdd){logger[_0xfb65('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x4f46c1,_0xfb65('0x12'));logger[_0xfb65('0x13')](_0xfb65('0x14'),_0x4f46c1,_0xfb65('0x12'),JSON[_0xfb65('0x15')](_0x1d2bdd));if(_0x1d2bdd[_0xfb65('0x16')]){if(_0x1d2bdd[_0xfb65('0x16')][_0xfb65('0x17')]===0x1f4){logger[_0xfb65('0x16')](_0xfb65('0x18'),_0x4f46c1,_0x1d2bdd['error'][_0xfb65('0x19')]);return _0x1a97a4(_0x1d2bdd[_0xfb65('0x16')][_0xfb65('0x19')]);}logger[_0xfb65('0x16')](_0xfb65('0x18'),_0x4f46c1,_0x1d2bdd['error']['message']);return _0x51c393(_0x1d2bdd[_0xfb65('0x16')][_0xfb65('0x19')]);}else{logger[_0xfb65('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x4f46c1,_0xfb65('0x12'));_0x51c393(_0x1d2bdd['result'][_0xfb65('0x19')]);}})[_0xfb65('0x1a')](function(_0x5b25ec){logger[_0xfb65('0x16')](_0xfb65('0x18'),_0x4f46c1,_0x5b25ec);_0x1a97a4(_0x5b25ec);});});}exports['GetOpenchannelQueue']=function(_0x266d1a){var _0x81e74f=this;return new Promise(function(_0x91aa00,_0x3eb941){return db[_0xfb65('0x1b')][_0xfb65('0x1c')]({'raw':_0x266d1a[_0xfb65('0x1d')]?_0x266d1a[_0xfb65('0x1d')][_0xfb65('0x1e')]===undefined?!![]:![]:!![],'where':_0x266d1a[_0xfb65('0x1d')]?_0x266d1a[_0xfb65('0x1d')][_0xfb65('0x1f')]||null:null,'attributes':_0x266d1a[_0xfb65('0x1d')]?_0x266d1a[_0xfb65('0x1d')][_0xfb65('0x20')]||null:null,'limit':_0x266d1a[_0xfb65('0x1d')]?_0x266d1a['options']['limit']||null:null,'include':_0x266d1a['options']?_0x266d1a[_0xfb65('0x1d')][_0xfb65('0x21')]?_[_0xfb65('0x22')](_0x266d1a['options']['include'],function(_0x2dd656){return{'model':db[_0x2dd656[_0xfb65('0x23')]],'as':_0x2dd656['as'],'attributes':_0x2dd656[_0xfb65('0x20')],'include':_0x2dd656[_0xfb65('0x21')]?_[_0xfb65('0x22')](_0x2dd656['include'],function(_0x14efa2){return{'model':db[_0x14efa2[_0xfb65('0x23')]],'as':_0x14efa2['as'],'attributes':_0x14efa2[_0xfb65('0x20')],'include':_0x14efa2[_0xfb65('0x21')]?_[_0xfb65('0x22')](_0x14efa2[_0xfb65('0x21')],function(_0x5a8502){return{'model':db[_0x5a8502['model']],'as':_0x5a8502['as'],'attributes':_0x5a8502['attributes']};}):[]};}):[]};}):[]:[]})[_0xfb65('0x10')](function(_0x278e03){logger[_0xfb65('0x11')](_0xfb65('0x24'),_0x266d1a);logger['debug'](_0xfb65('0x24'),_0x266d1a,JSON[_0xfb65('0x15')](_0x278e03));_0x91aa00(_0x278e03);})['catch'](function(_0x536162){logger['error']('GetOpenchannelQueue',_0x536162['message'],_0x266d1a);_0x3eb941(_0x81e74f[_0xfb65('0x16')](0x1f4,_0x536162[_0xfb65('0x19')]));});});};exports[_0xfb65('0x25')]=function(_0x439125){var _0x59bb53=this;return new Promise(function(_0x5157f6,_0x1c41fe){return db[_0xfb65('0x1b')]['find']({'raw':_0x439125['options']?_0x439125[_0xfb65('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x439125[_0xfb65('0x1d')]?_0x439125[_0xfb65('0x1d')][_0xfb65('0x1f')]||null:null,'attributes':_0x439125['options']?_0x439125[_0xfb65('0x1d')]['attributes']||null:null,'include':_0x439125['options']?_0x439125['options'][_0xfb65('0x21')]?_[_0xfb65('0x22')](_0x439125[_0xfb65('0x1d')][_0xfb65('0x21')],function(_0x9c6c15){return{'model':db[_0x9c6c15['model']],'as':_0x9c6c15['as'],'attributes':_0x9c6c15['attributes'],'include':_0x9c6c15[_0xfb65('0x21')]?_[_0xfb65('0x22')](_0x9c6c15[_0xfb65('0x21')],function(_0x3ec544){return{'model':db[_0x3ec544['model']],'as':_0x3ec544['as'],'attributes':_0x3ec544[_0xfb65('0x20')],'include':_0x3ec544[_0xfb65('0x21')]?_[_0xfb65('0x22')](_0x3ec544[_0xfb65('0x21')],function(_0x1cd4a7){return{'model':db[_0x1cd4a7[_0xfb65('0x23')]],'as':_0x1cd4a7['as'],'attributes':_0x1cd4a7[_0xfb65('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfb65('0x10')](function(_0x155317){logger[_0xfb65('0x11')](_0xfb65('0x25'),_0x439125);logger[_0xfb65('0x13')]('ShowOpenchannelQueue',_0x439125,JSON['stringify'](_0x155317));_0x5157f6(_0x155317);})['catch'](function(_0x3517d5){logger[_0xfb65('0x16')](_0xfb65('0x25'),_0x3517d5[_0xfb65('0x19')],_0x439125);_0x1c41fe(_0x59bb53['error'](0x1f4,_0x3517d5[_0xfb65('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 150a97a..68cffcb 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 _0x83e4=['removeListener','./openchannelQueue.events','save','update','emit'];(function(_0x330b8b,_0x578bd2){var _0x476fb4=function(_0x4ed019){while(--_0x4ed019){_0x330b8b['push'](_0x330b8b['shift']());}};_0x476fb4(++_0x578bd2);}(_0x83e4,0x137));var _0x483e=function(_0x2c1d52,_0x227df8){_0x2c1d52=_0x2c1d52-0x0;var _0x19d2d8=_0x83e4[_0x2c1d52];return _0x19d2d8;};'use strict';var OpenchannelQueueEvents=require(_0x483e('0x0'));var events=[_0x483e('0x1'),'remove',_0x483e('0x2')];function createListener(_0x3820c9,_0xa28e19){return function(_0x205fec){_0xa28e19[_0x483e('0x3')](_0x3820c9,_0x205fec);};}function removeListener(_0x5d1fe3,_0x1a9eea){return function(){OpenchannelQueueEvents[_0x483e('0x4')](_0x5d1fe3,_0x1a9eea);};}exports['register']=function(_0x197e5b){for(var _0x68f59b=0x0,_0x1e0026=events['length'];_0x68f59b<_0x1e0026;_0x68f59b++){var _0x5ef802=events[_0x68f59b];var _0x5dd412=createListener('openchannelQueue:'+_0x5ef802,_0x197e5b);OpenchannelQueueEvents['on'](_0x5ef802,_0x5dd412);}}; \ No newline at end of file +var _0x53d0=['remove','update','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x3f6bab,_0x47fdb0){var _0x26d34b=function(_0x1a8bfc){while(--_0x1a8bfc){_0x3f6bab['push'](_0x3f6bab['shift']());}};_0x26d34b(++_0x47fdb0);}(_0x53d0,0xbb));var _0x053d=function(_0x134536,_0x1d4b79){_0x134536=_0x134536-0x0;var _0x15208d=_0x53d0[_0x134536];return _0x15208d;};'use strict';var OpenchannelQueueEvents=require(_0x053d('0x0'));var events=[_0x053d('0x1'),_0x053d('0x2'),_0x053d('0x3')];function createListener(_0x3ceaad,_0x46eacc){return function(_0x422d5f){_0x46eacc[_0x053d('0x4')](_0x3ceaad,_0x422d5f);};}function removeListener(_0x2e311f,_0x4668de){return function(){OpenchannelQueueEvents[_0x053d('0x5')](_0x2e311f,_0x4668de);};}exports[_0x053d('0x6')]=function(_0x3e3bea){for(var _0x9720d2=0x0,_0x177692=events[_0x053d('0x7')];_0x9720d2<_0x177692;_0x9720d2++){var _0x57427f=events[_0x9720d2];var _0x42e8a4=createListener(_0x053d('0x8')+_0x57427f,_0x3e3bea);OpenchannelQueueEvents['on'](_0x57427f,_0x42e8a4);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 704fd5b..d8c31c5 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 _0x4c74=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2b2c53,_0x4bcf9b){var _0x311ec2=function(_0x4a8e72){while(--_0x4a8e72){_0x2b2c53['push'](_0x2b2c53['shift']());}};_0x311ec2(++_0x4bcf9b);}(_0x4c74,0x1ae));var _0x44c7=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x4c74[_0x31a371];return _0x2a5bd6;};'use strict';var multer=require(_0x44c7('0x0'));var util=require(_0x44c7('0x1'));var path=require(_0x44c7('0x2'));var timeout=require(_0x44c7('0x3'));var express=require(_0x44c7('0x4'));var router=express[_0x44c7('0x5')]();var fs_extra=require(_0x44c7('0x6'));var auth=require(_0x44c7('0x7'));var interaction=require(_0x44c7('0x8'));var config=require(_0x44c7('0x9'));var controller=require(_0x44c7('0xa'));router[_0x44c7('0xb')]('/',auth['isAuthenticated'](),controller[_0x44c7('0xc')]);router[_0x44c7('0xb')](_0x44c7('0xd'),auth[_0x44c7('0xe')](),controller[_0x44c7('0xf')]);router[_0x44c7('0xb')](_0x44c7('0x10'),auth[_0x44c7('0xe')](),controller[_0x44c7('0x11')]);router[_0x44c7('0x12')]('/',auth[_0x44c7('0xe')](),controller['create']);router[_0x44c7('0x13')](_0x44c7('0x10'),auth['isAuthenticated'](),controller[_0x44c7('0x14')]);router['delete'](_0x44c7('0x10'),auth[_0x44c7('0xe')](),controller[_0x44c7('0x15')]);module[_0x44c7('0x16')]=router; \ No newline at end of file +var _0xec82=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','index','/describe','isAuthenticated','get','/:id','show','create','put','update','delete','destroy','multer','util'];(function(_0xa389bf,_0x453bdd){var _0x25595c=function(_0x1608c7){while(--_0x1608c7){_0xa389bf['push'](_0xa389bf['shift']());}};_0x25595c(++_0x453bdd);}(_0xec82,0x1a0));var _0x2ec8=function(_0x22f74c,_0x487f52){_0x22f74c=_0x22f74c-0x0;var _0x1d0889=_0xec82[_0x22f74c];return _0x1d0889;};'use strict';var multer=require(_0x2ec8('0x0'));var util=require(_0x2ec8('0x1'));var path=require(_0x2ec8('0x2'));var timeout=require(_0x2ec8('0x3'));var express=require(_0x2ec8('0x4'));var router=express[_0x2ec8('0x5')]();var fs_extra=require(_0x2ec8('0x6'));var auth=require(_0x2ec8('0x7'));var interaction=require(_0x2ec8('0x8'));var config=require(_0x2ec8('0x9'));var controller=require(_0x2ec8('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x2ec8('0xb')]);router['get'](_0x2ec8('0xc'),auth[_0x2ec8('0xd')](),controller['describe']);router[_0x2ec8('0xe')](_0x2ec8('0xf'),auth[_0x2ec8('0xd')](),controller[_0x2ec8('0x10')]);router['post']('/',auth[_0x2ec8('0xd')](),controller[_0x2ec8('0x11')]);router[_0x2ec8('0x12')](_0x2ec8('0xf'),auth[_0x2ec8('0xd')](),controller[_0x2ec8('0x13')]);router[_0x2ec8('0x14')](_0x2ec8('0xf'),auth[_0x2ec8('0xd')](),controller[_0x2ec8('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 88606f9..9d2ca63 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 _0x85d4=['sequelize','exports','STRING','DATE','moment'];(function(_0x472a16,_0x1fe67d){var _0x237416=function(_0x3ed824){while(--_0x3ed824){_0x472a16['push'](_0x472a16['shift']());}};_0x237416(++_0x1fe67d);}(_0x85d4,0x167));var _0x485d=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x85d4[_0x334841];return _0x5beb4b;};'use strict';var moment=require(_0x485d('0x0'));var Sequelize=require(_0x485d('0x1'));module[_0x485d('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x485d('0x3')]},'joinAt':{'type':Sequelize[_0x485d('0x4')]},'leaveAt':{'type':Sequelize[_0x485d('0x4')]},'acceptAt':{'type':Sequelize[_0x485d('0x4')]},'exitAt':{'type':Sequelize[_0x485d('0x4')]},'reason':{'type':Sequelize[_0x485d('0x3')]}}; \ No newline at end of file +var _0x383d=['STRING','DATE','exports'];(function(_0x5311a1,_0x304912){var _0x2acb9f=function(_0x4803e7){while(--_0x4803e7){_0x5311a1['push'](_0x5311a1['shift']());}};_0x2acb9f(++_0x304912);}(_0x383d,0x86));var _0xd383=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x383d[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xd383('0x0')]={'uniqueid':{'type':Sequelize[_0xd383('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xd383('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd383('0x2')]},'acceptAt':{'type':Sequelize[_0xd383('0x2')]},'exitAt':{'type':Sequelize[_0xd383('0x2')]},'reason':{'type':Sequelize[_0xd383('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 28676ec..c64bf1f 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 _0x626f=['type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','params','keys','include','find','catch','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','reject','save','then','stack','name','map','OpenchannelQueueReport','rawAttributes','fieldName'];(function(_0x80f8a2,_0x5a4c19){var _0x1299f8=function(_0x27b08f){while(--_0x27b08f){_0x80f8a2['push'](_0x80f8a2['shift']());}};_0x1299f8(++_0x5a4c19);}(_0x626f,0xfc));var _0xf626=function(_0x39b734,_0x293694){_0x39b734=_0x39b734-0x0;var _0x510ffc=_0x626f[_0x39b734];return _0x510ffc;};'use strict';var emlformat=require(_0xf626('0x0'));var rimraf=require(_0xf626('0x1'));var zipdir=require(_0xf626('0x2'));var jsonpatch=require(_0xf626('0x3'));var rp=require(_0xf626('0x4'));var moment=require(_0xf626('0x5'));var BPromise=require(_0xf626('0x6'));var Mustache=require(_0xf626('0x7'));var util=require(_0xf626('0x8'));var path=require(_0xf626('0x9'));var sox=require(_0xf626('0xa'));var csv=require(_0xf626('0xb'));var ejs=require(_0xf626('0xc'));var fs=require('fs');var fs_extra=require(_0xf626('0xd'));var _=require('lodash');var squel=require(_0xf626('0xe'));var crypto=require('crypto');var jsforce=require(_0xf626('0xf'));var deskjs=require(_0xf626('0x10'));var toCsv=require(_0xf626('0xb'));var querystring=require(_0xf626('0x11'));var Papa=require('papaparse');var Redis=require(_0xf626('0x12'));var authService=require(_0xf626('0x13'));var qs=require(_0xf626('0x14'));var as=require(_0xf626('0x15'));var hardwareService=require(_0xf626('0x16'));var logger=require('../../config/logger')(_0xf626('0x17'));var utils=require('../../config/utils');var config=require(_0xf626('0x18'));var licenseUtil=require(_0xf626('0x19'));var db=require(_0xf626('0x1a'))['db'];function respondWithStatusCode(_0x2e952f,_0x41ee72){_0x41ee72=_0x41ee72||0xcc;return function(_0x5b34f0){if(_0x5b34f0){return _0x2e952f[_0xf626('0x1b')](_0x41ee72);}return _0x2e952f[_0xf626('0x1c')](_0x41ee72)['end']();};}function respondWithResult(_0x193dc7,_0x2cdd56){_0x2cdd56=_0x2cdd56||0xc8;return function(_0x1c6dde){if(_0x1c6dde){return _0x193dc7[_0xf626('0x1c')](_0x2cdd56)[_0xf626('0x1d')](_0x1c6dde);}};}function respondWithFilteredResult(_0x2f4df7,_0xb63b90){return function(_0x519b6a){if(_0x519b6a){var _0x2d3071=typeof _0xb63b90['offset']==='undefined'&&typeof _0xb63b90[_0xf626('0x1e')]===_0xf626('0x1f');var _0x45784e=_0x519b6a[_0xf626('0x20')];var _0x366062=_0x2d3071?0x0:_0xb63b90[_0xf626('0x21')];var _0x20de51=_0x2d3071?_0x519b6a[_0xf626('0x20')]:_0xb63b90['offset']+_0xb63b90['limit'];var _0x1e74ab;if(_0x20de51>=_0x45784e){_0x20de51=_0x45784e;_0x1e74ab=0xc8;}else{_0x1e74ab=0xce;}_0x2f4df7[_0xf626('0x1c')](_0x1e74ab);return _0x2f4df7[_0xf626('0x22')]('Content-Range',_0x366062+'-'+_0x20de51+'/'+_0x45784e)[_0xf626('0x1d')](_0x519b6a);}return null;};}function patchUpdates(_0x4d5aed){return function(_0x43cb29){try{jsonpatch['apply'](_0x43cb29,_0x4d5aed,!![]);}catch(_0x20203e){return BPromise[_0xf626('0x23')](_0x20203e);}return _0x43cb29[_0xf626('0x24')]();};}function saveUpdates(_0x29bb3c,_0x473715){return function(_0x5aab8b){if(_0x5aab8b){return _0x5aab8b['update'](_0x29bb3c)[_0xf626('0x25')](function(_0xfaad2e){return _0xfaad2e;});}return null;};}function removeEntity(_0x11d48d,_0x12e901){return function(_0x39d67e){if(_0x39d67e){return _0x39d67e['destroy']()[_0xf626('0x25')](function(){_0x11d48d[_0xf626('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44b1c7,_0x2a317c){return function(_0x27e809){if(!_0x27e809){_0x44b1c7[_0xf626('0x1b')](0x194);}return _0x27e809;};}function handleError(_0x4b600d,_0x6517da){_0x6517da=_0x6517da||0x1f4;return function(_0xbcaefa){logger['error'](_0xbcaefa[_0xf626('0x26')]);if(_0xbcaefa[_0xf626('0x27')]){delete _0xbcaefa[_0xf626('0x27')];}_0x4b600d[_0xf626('0x1c')](_0x6517da)['send'](_0xbcaefa);};}exports['index']=function(_0x5d3ba7,_0x2535f5){var _0x59ed7e={},_0x5f4a3f={},_0x486689={'count':0x0,'rows':[]};var _0x467297=_[_0xf626('0x28')](db[_0xf626('0x29')][_0xf626('0x2a')],function(_0x2036cd){return{'name':_0x2036cd[_0xf626('0x2b')],'type':_0x2036cd[_0xf626('0x2c')][_0xf626('0x2d')]};});_0x5f4a3f[_0xf626('0x2e')]=_[_0xf626('0x28')](_0x467297,_0xf626('0x27'));_0x5f4a3f[_0xf626('0x2f')]=_['keys'](_0x5d3ba7[_0xf626('0x2f')]);_0x5f4a3f[_0xf626('0x30')]=_[_0xf626('0x31')](_0x5f4a3f['model'],_0x5f4a3f[_0xf626('0x2f')]);_0x59ed7e[_0xf626('0x32')]=_[_0xf626('0x31')](_0x5f4a3f['model'],qs[_0xf626('0x33')](_0x5d3ba7[_0xf626('0x2f')][_0xf626('0x33')]));_0x59ed7e[_0xf626('0x32')]=_0x59ed7e[_0xf626('0x32')][_0xf626('0x34')]?_0x59ed7e[_0xf626('0x32')]:_0x5f4a3f['model'];if(!_0x5d3ba7[_0xf626('0x2f')][_0xf626('0x35')](_0xf626('0x36'))){_0x59ed7e[_0xf626('0x1e')]=qs[_0xf626('0x1e')](_0x5d3ba7[_0xf626('0x2f')][_0xf626('0x1e')]);_0x59ed7e[_0xf626('0x21')]=qs[_0xf626('0x21')](_0x5d3ba7[_0xf626('0x2f')][_0xf626('0x21')]);}_0x59ed7e['order']=qs[_0xf626('0x37')](_0x5d3ba7['query'][_0xf626('0x37')]);_0x59ed7e[_0xf626('0x38')]=qs['filters'](_[_0xf626('0x39')](_0x5d3ba7[_0xf626('0x2f')],_0x5f4a3f[_0xf626('0x30')]),_0x467297);if(_0x5d3ba7[_0xf626('0x2f')][_0xf626('0x3a')]){_0x59ed7e[_0xf626('0x38')]=_[_0xf626('0x3b')](_0x59ed7e[_0xf626('0x38')],{'$or':_[_0xf626('0x28')](_0x467297,function(_0x527202){if(_0x527202[_0xf626('0x2c')]!==_0xf626('0x3c')){var _0x1d7d7b={};_0x1d7d7b[_0x527202[_0xf626('0x27')]]={'$like':'%'+_0x5d3ba7[_0xf626('0x2f')][_0xf626('0x3a')]+'%'};return _0x1d7d7b;}})});}_0x59ed7e=_[_0xf626('0x3b')]({},_0x59ed7e,_0x5d3ba7[_0xf626('0x3d')]);var _0x161e01={'where':_0x59ed7e[_0xf626('0x38')]};return db[_0xf626('0x29')][_0xf626('0x20')](_0x161e01)['then'](function(_0xf5dfdb){_0x486689[_0xf626('0x20')]=_0xf5dfdb;if(_0x5d3ba7[_0xf626('0x2f')]['includeAll']){_0x59ed7e['include']=[{'all':!![]}];}return db[_0xf626('0x29')][_0xf626('0x3e')](_0x59ed7e);})['then'](function(_0x558041){_0x486689[_0xf626('0x3f')]=_0x558041;return _0x486689;})['then'](respondWithFilteredResult(_0x2535f5,_0x59ed7e))['catch'](handleError(_0x2535f5,null));};exports['show']=function(_0x3be982,_0x11ff68){var _0x41d1d3={'raw':!![],'where':{'id':_0x3be982[_0xf626('0x40')]['id']}},_0x16161f={};_0x16161f[_0xf626('0x2e')]=_['keys'](db[_0xf626('0x29')]['rawAttributes']);_0x16161f[_0xf626('0x2f')]=_[_0xf626('0x41')](_0x3be982[_0xf626('0x2f')]);_0x16161f[_0xf626('0x30')]=_[_0xf626('0x31')](_0x16161f[_0xf626('0x2e')],_0x16161f[_0xf626('0x2f')]);_0x41d1d3[_0xf626('0x32')]=_['intersection'](_0x16161f[_0xf626('0x2e')],qs['fields'](_0x3be982[_0xf626('0x2f')][_0xf626('0x33')]));_0x41d1d3[_0xf626('0x32')]=_0x41d1d3[_0xf626('0x32')][_0xf626('0x34')]?_0x41d1d3[_0xf626('0x32')]:_0x16161f[_0xf626('0x2e')];if(_0x3be982[_0xf626('0x2f')]['includeAll']){_0x41d1d3[_0xf626('0x42')]=[{'all':!![]}];}_0x41d1d3=_[_0xf626('0x3b')]({},_0x41d1d3,_0x3be982[_0xf626('0x3d')]);return db['OpenchannelQueueReport'][_0xf626('0x43')](_0x41d1d3)[_0xf626('0x25')](handleEntityNotFound(_0x11ff68,null))[_0xf626('0x25')](respondWithResult(_0x11ff68,null))[_0xf626('0x44')](handleError(_0x11ff68,null));};exports[_0xf626('0x45')]=function(_0x38ba58,_0x113541){return db[_0xf626('0x29')][_0xf626('0x45')](_0x38ba58[_0xf626('0x46')],{})[_0xf626('0x25')](respondWithResult(_0x113541,0xc9))[_0xf626('0x44')](handleError(_0x113541,null));};exports[_0xf626('0x47')]=function(_0x313390,_0x539131){if(_0x313390[_0xf626('0x46')]['id']){delete _0x313390['body']['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x313390[_0xf626('0x40')]['id']}})[_0xf626('0x25')](handleEntityNotFound(_0x539131,null))[_0xf626('0x25')](saveUpdates(_0x313390[_0xf626('0x46')],null))[_0xf626('0x25')](respondWithResult(_0x539131,null))[_0xf626('0x44')](handleError(_0x539131,null));};exports[_0xf626('0x48')]=function(_0x1f818c,_0x334159){return db[_0xf626('0x29')][_0xf626('0x43')]({'where':{'id':_0x1f818c['params']['id']}})[_0xf626('0x25')](handleEntityNotFound(_0x334159,null))[_0xf626('0x25')](removeEntity(_0x334159,null))['catch'](handleError(_0x334159,null));};exports[_0xf626('0x49')]=function(_0x16330d,_0x522641){return db['OpenchannelQueueReport']['describe']()[_0xf626('0x25')](respondWithResult(_0x522641,null))[_0xf626('0x44')](handleError(_0x522641,null));}; \ No newline at end of file +var _0x4d5d=['fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','type','VIRTUAL','includeAll','include','findAll','params','merge','options','find','catch','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','error','name','send','map','OpenchannelQueueReport','rawAttributes'];(function(_0x175254,_0x31b1b5){var _0x5ed1d3=function(_0x3d2452){while(--_0x3d2452){_0x175254['push'](_0x175254['shift']());}};_0x5ed1d3(++_0x31b1b5);}(_0x4d5d,0x6c));var _0xd4d5=function(_0x2599f0,_0x315d31){_0x2599f0=_0x2599f0-0x0;var _0x45e9af=_0x4d5d[_0x2599f0];return _0x45e9af;};'use strict';var emlformat=require(_0xd4d5('0x0'));var rimraf=require(_0xd4d5('0x1'));var zipdir=require(_0xd4d5('0x2'));var jsonpatch=require(_0xd4d5('0x3'));var rp=require(_0xd4d5('0x4'));var moment=require('moment');var BPromise=require(_0xd4d5('0x5'));var Mustache=require(_0xd4d5('0x6'));var util=require(_0xd4d5('0x7'));var path=require(_0xd4d5('0x8'));var sox=require(_0xd4d5('0x9'));var csv=require(_0xd4d5('0xa'));var ejs=require(_0xd4d5('0xb'));var fs=require('fs');var fs_extra=require(_0xd4d5('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd4d5('0xd'));var jsforce=require(_0xd4d5('0xe'));var deskjs=require(_0xd4d5('0xf'));var toCsv=require(_0xd4d5('0xa'));var querystring=require(_0xd4d5('0x10'));var Papa=require('papaparse');var Redis=require(_0xd4d5('0x11'));var authService=require(_0xd4d5('0x12'));var qs=require(_0xd4d5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd4d5('0x14'));var logger=require('../../config/logger')(_0xd4d5('0x15'));var utils=require(_0xd4d5('0x16'));var config=require(_0xd4d5('0x17'));var licenseUtil=require(_0xd4d5('0x18'));var db=require(_0xd4d5('0x19'))['db'];function respondWithStatusCode(_0x4a8207,_0x58fadf){_0x58fadf=_0x58fadf||0xcc;return function(_0xa4f0dd){if(_0xa4f0dd){return _0x4a8207['sendStatus'](_0x58fadf);}return _0x4a8207[_0xd4d5('0x1a')](_0x58fadf)[_0xd4d5('0x1b')]();};}function respondWithResult(_0x6e45eb,_0x27fb9d){_0x27fb9d=_0x27fb9d||0xc8;return function(_0x225099){if(_0x225099){return _0x6e45eb['status'](_0x27fb9d)[_0xd4d5('0x1c')](_0x225099);}};}function respondWithFilteredResult(_0x289ec7,_0x51705e){return function(_0x4902e8){if(_0x4902e8){var _0x3efd1a=typeof _0x51705e[_0xd4d5('0x1d')]===_0xd4d5('0x1e')&&typeof _0x51705e[_0xd4d5('0x1f')]===_0xd4d5('0x1e');var _0x12b313=_0x4902e8['count'];var _0x54bd45=_0x3efd1a?0x0:_0x51705e['offset'];var _0x380408=_0x3efd1a?_0x4902e8[_0xd4d5('0x20')]:_0x51705e['offset']+_0x51705e[_0xd4d5('0x1f')];var _0x24f23c;if(_0x380408>=_0x12b313){_0x380408=_0x12b313;_0x24f23c=0xc8;}else{_0x24f23c=0xce;}_0x289ec7[_0xd4d5('0x1a')](_0x24f23c);return _0x289ec7[_0xd4d5('0x21')](_0xd4d5('0x22'),_0x54bd45+'-'+_0x380408+'/'+_0x12b313)[_0xd4d5('0x1c')](_0x4902e8);}return null;};}function patchUpdates(_0x1a057e){return function(_0x35ac9e){try{jsonpatch[_0xd4d5('0x23')](_0x35ac9e,_0x1a057e,!![]);}catch(_0x5936bd){return BPromise[_0xd4d5('0x24')](_0x5936bd);}return _0x35ac9e[_0xd4d5('0x25')]();};}function saveUpdates(_0x5285ed,_0x4824d0){return function(_0x129fb4){if(_0x129fb4){return _0x129fb4['update'](_0x5285ed)[_0xd4d5('0x26')](function(_0x3a5862){return _0x3a5862;});}return null;};}function removeEntity(_0x5b7ee4,_0x3f757f){return function(_0x14e34c){if(_0x14e34c){return _0x14e34c['destroy']()[_0xd4d5('0x26')](function(){_0x5b7ee4[_0xd4d5('0x1a')](0xcc)[_0xd4d5('0x1b')]();});}};}function handleEntityNotFound(_0x4f938a,_0x30c06d){return function(_0x3228b3){if(!_0x3228b3){_0x4f938a[_0xd4d5('0x27')](0x194);}return _0x3228b3;};}function handleError(_0x49fe70,_0x88544b){_0x88544b=_0x88544b||0x1f4;return function(_0x366357){logger[_0xd4d5('0x28')](_0x366357['stack']);if(_0x366357['name']){delete _0x366357[_0xd4d5('0x29')];}_0x49fe70[_0xd4d5('0x1a')](_0x88544b)[_0xd4d5('0x2a')](_0x366357);};}exports['index']=function(_0x45b299,_0x82da1){var _0x31a682={},_0x4b7ae0={},_0x418e9c={'count':0x0,'rows':[]};var _0x92c5f8=_[_0xd4d5('0x2b')](db[_0xd4d5('0x2c')][_0xd4d5('0x2d')],function(_0x424b65){return{'name':_0x424b65[_0xd4d5('0x2e')],'type':_0x424b65['type'][_0xd4d5('0x2f')]};});_0x4b7ae0[_0xd4d5('0x30')]=_[_0xd4d5('0x2b')](_0x92c5f8,'name');_0x4b7ae0[_0xd4d5('0x31')]=_[_0xd4d5('0x32')](_0x45b299['query']);_0x4b7ae0[_0xd4d5('0x33')]=_[_0xd4d5('0x34')](_0x4b7ae0[_0xd4d5('0x30')],_0x4b7ae0[_0xd4d5('0x31')]);_0x31a682[_0xd4d5('0x35')]=_[_0xd4d5('0x34')](_0x4b7ae0['model'],qs[_0xd4d5('0x36')](_0x45b299[_0xd4d5('0x31')][_0xd4d5('0x36')]));_0x31a682['attributes']=_0x31a682[_0xd4d5('0x35')][_0xd4d5('0x37')]?_0x31a682[_0xd4d5('0x35')]:_0x4b7ae0[_0xd4d5('0x30')];if(!_0x45b299['query'][_0xd4d5('0x38')](_0xd4d5('0x39'))){_0x31a682[_0xd4d5('0x1f')]=qs[_0xd4d5('0x1f')](_0x45b299[_0xd4d5('0x31')][_0xd4d5('0x1f')]);_0x31a682[_0xd4d5('0x1d')]=qs['offset'](_0x45b299[_0xd4d5('0x31')]['offset']);}_0x31a682[_0xd4d5('0x3a')]=qs['sort'](_0x45b299[_0xd4d5('0x31')]['sort']);_0x31a682[_0xd4d5('0x3b')]=qs[_0xd4d5('0x33')](_[_0xd4d5('0x3c')](_0x45b299['query'],_0x4b7ae0[_0xd4d5('0x33')]),_0x92c5f8);if(_0x45b299['query'][_0xd4d5('0x3d')]){_0x31a682['where']=_['merge'](_0x31a682[_0xd4d5('0x3b')],{'$or':_[_0xd4d5('0x2b')](_0x92c5f8,function(_0x39a840){if(_0x39a840[_0xd4d5('0x3e')]!==_0xd4d5('0x3f')){var _0x3420df={};_0x3420df[_0x39a840[_0xd4d5('0x29')]]={'$like':'%'+_0x45b299[_0xd4d5('0x31')][_0xd4d5('0x3d')]+'%'};return _0x3420df;}})});}_0x31a682=_['merge']({},_0x31a682,_0x45b299['options']);var _0x113806={'where':_0x31a682[_0xd4d5('0x3b')]};return db['OpenchannelQueueReport'][_0xd4d5('0x20')](_0x113806)[_0xd4d5('0x26')](function(_0x2f56ca){_0x418e9c[_0xd4d5('0x20')]=_0x2f56ca;if(_0x45b299[_0xd4d5('0x31')][_0xd4d5('0x40')]){_0x31a682[_0xd4d5('0x41')]=[{'all':!![]}];}return db[_0xd4d5('0x2c')][_0xd4d5('0x42')](_0x31a682);})[_0xd4d5('0x26')](function(_0x3823eb){_0x418e9c['rows']=_0x3823eb;return _0x418e9c;})[_0xd4d5('0x26')](respondWithFilteredResult(_0x82da1,_0x31a682))['catch'](handleError(_0x82da1,null));};exports['show']=function(_0x47fd9d,_0x54aab0){var _0x4a4ed3={'raw':!![],'where':{'id':_0x47fd9d[_0xd4d5('0x43')]['id']}},_0x2edb22={};_0x2edb22[_0xd4d5('0x30')]=_[_0xd4d5('0x32')](db[_0xd4d5('0x2c')][_0xd4d5('0x2d')]);_0x2edb22[_0xd4d5('0x31')]=_[_0xd4d5('0x32')](_0x47fd9d['query']);_0x2edb22['filters']=_[_0xd4d5('0x34')](_0x2edb22[_0xd4d5('0x30')],_0x2edb22[_0xd4d5('0x31')]);_0x4a4ed3[_0xd4d5('0x35')]=_['intersection'](_0x2edb22[_0xd4d5('0x30')],qs['fields'](_0x47fd9d[_0xd4d5('0x31')][_0xd4d5('0x36')]));_0x4a4ed3[_0xd4d5('0x35')]=_0x4a4ed3[_0xd4d5('0x35')][_0xd4d5('0x37')]?_0x4a4ed3[_0xd4d5('0x35')]:_0x2edb22[_0xd4d5('0x30')];if(_0x47fd9d[_0xd4d5('0x31')]['includeAll']){_0x4a4ed3[_0xd4d5('0x41')]=[{'all':!![]}];}_0x4a4ed3=_[_0xd4d5('0x44')]({},_0x4a4ed3,_0x47fd9d[_0xd4d5('0x45')]);return db[_0xd4d5('0x2c')][_0xd4d5('0x46')](_0x4a4ed3)[_0xd4d5('0x26')](handleEntityNotFound(_0x54aab0,null))[_0xd4d5('0x26')](respondWithResult(_0x54aab0,null))[_0xd4d5('0x47')](handleError(_0x54aab0,null));};exports[_0xd4d5('0x48')]=function(_0x4db0a8,_0x2e152d){return db[_0xd4d5('0x2c')][_0xd4d5('0x48')](_0x4db0a8[_0xd4d5('0x49')],{})[_0xd4d5('0x26')](respondWithResult(_0x2e152d,0xc9))['catch'](handleError(_0x2e152d,null));};exports[_0xd4d5('0x4a')]=function(_0x141a50,_0xf829af){if(_0x141a50[_0xd4d5('0x49')]['id']){delete _0x141a50[_0xd4d5('0x49')]['id'];}return db['OpenchannelQueueReport'][_0xd4d5('0x46')]({'where':{'id':_0x141a50[_0xd4d5('0x43')]['id']}})['then'](handleEntityNotFound(_0xf829af,null))['then'](saveUpdates(_0x141a50['body'],null))[_0xd4d5('0x26')](respondWithResult(_0xf829af,null))['catch'](handleError(_0xf829af,null));};exports[_0xd4d5('0x4b')]=function(_0x1904cb,_0xdb4c09){return db[_0xd4d5('0x2c')][_0xd4d5('0x46')]({'where':{'id':_0x1904cb[_0xd4d5('0x43')]['id']}})[_0xd4d5('0x26')](handleEntityNotFound(_0xdb4c09,null))[_0xd4d5('0x26')](removeEntity(_0xdb4c09,null))[_0xd4d5('0x47')](handleError(_0xdb4c09,null));};exports[_0xd4d5('0x4c')]=function(_0xf562cc,_0x3e597d){return db[_0xd4d5('0x2c')][_0xd4d5('0x4c')]()[_0xd4d5('0x26')](respondWithResult(_0x3e597d,null))[_0xd4d5('0x47')](handleError(_0x3e597d,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index a261d59..df33e30 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 _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x16d461,_0x400b60){var _0x5348d0=function(_0x4db341){while(--_0x4db341){_0x16d461['push'](_0x16d461['shift']());}};_0x5348d0(++_0x400b60);}(_0x2ef3,0xba));var _0x32ef=function(_0x5532b9,_0x49af3c){_0x5532b9=_0x5532b9-0x0;var _0x240874=_0x2ef3[_0x5532b9];return _0x240874;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x370ff4,_0x5f1f3b){var _0x22490c=function(_0x348597){while(--_0x348597){_0x370ff4['push'](_0x370ff4['shift']());}};_0x22490c(++_0x5f1f3b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xc4aa[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 0742013..5faa391 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 _0xcf66=['jayson/promise','client','http','request','then','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','info','debug','UpdateOpenchannelQueueReport','update','attributes','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xcf66,0x71));var _0x6cf6=function(_0x331909,_0x5ca235){_0x331909=_0x331909-0x0;var _0x134e85=_0xcf66[_0x331909];return _0x134e85;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cf6('0x3'));var fs=require('fs');var Redis=require(_0x6cf6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cf6('0x5'))(_0x6cf6('0x6'));var config=require('../../config/environment');var jayson=require(_0x6cf6('0x7'));var client=jayson[_0x6cf6('0x8')][_0x6cf6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb082,_0x94c6a9,_0x308d0d){return new BPromise(function(_0x36b892,_0x748c93){return client[_0x6cf6('0xa')](_0x5eb082,_0x308d0d)[_0x6cf6('0xb')](function(_0x5b3827){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x94c6a9,_0x6cf6('0xc'));logger['debug'](_0x6cf6('0xd'),_0x94c6a9,_0x6cf6('0xc'),JSON[_0x6cf6('0xe')](_0x5b3827));if(_0x5b3827[_0x6cf6('0xf')]){if(_0x5b3827['error']['code']===0x1f4){logger['error'](_0x6cf6('0x10'),_0x94c6a9,_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);return _0x748c93(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}logger[_0x6cf6('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x94c6a9,_0x5b3827[_0x6cf6('0xf')]['message']);return _0x36b892(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}else{logger['info'](_0x6cf6('0x10'),_0x94c6a9,_0x6cf6('0xc'));_0x36b892(_0x5b3827[_0x6cf6('0x12')][_0x6cf6('0x11')]);}})[_0x6cf6('0x13')](function(_0x2bdb12){logger[_0x6cf6('0xf')](_0x6cf6('0x10'),_0x94c6a9,_0x2bdb12);_0x748c93(_0x2bdb12);});});}exports[_0x6cf6('0x14')]=function(_0x2ca2b1){var _0x5e8b11=this;return new Promise(function(_0x11d994,_0x22915c){return db[_0x6cf6('0x15')]['create'](_0x2ca2b1[_0x6cf6('0x16')],{'raw':_0x2ca2b1[_0x6cf6('0x17')]?_0x2ca2b1[_0x6cf6('0x17')][_0x6cf6('0x18')]===undefined?!![]:![]:!![]})[_0x6cf6('0xb')](function(_0x21e903){logger[_0x6cf6('0x19')]('CreateOpenchannelQueueReport',_0x2ca2b1);logger[_0x6cf6('0x1a')](_0x6cf6('0x14'),_0x2ca2b1,JSON[_0x6cf6('0xe')](_0x21e903));_0x11d994(_0x21e903);})[_0x6cf6('0x13')](function(_0x5cba3a){logger[_0x6cf6('0xf')](_0x6cf6('0x14'),_0x5cba3a[_0x6cf6('0x11')],_0x2ca2b1);_0x22915c(_0x5e8b11['error'](0x1f4,_0x5cba3a['message']));});});};exports[_0x6cf6('0x1b')]=function(_0x59f838){var _0x45ce6e=this;return new Promise(function(_0x18c8cd,_0x14ae3e){return db[_0x6cf6('0x15')][_0x6cf6('0x1c')](_0x59f838[_0x6cf6('0x16')],{'raw':_0x59f838[_0x6cf6('0x17')]?_0x59f838['options'][_0x6cf6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59f838[_0x6cf6('0x17')]?_0x59f838[_0x6cf6('0x17')]['where']||null:null,'attributes':_0x59f838[_0x6cf6('0x17')]?_0x59f838[_0x6cf6('0x17')][_0x6cf6('0x1d')]||null:null,'limit':_0x59f838[_0x6cf6('0x17')]?_0x59f838['options']['limit']||null:null})[_0x6cf6('0xb')](function(_0x4521af){logger[_0x6cf6('0x19')](_0x6cf6('0x1b'),_0x59f838);logger['debug'](_0x6cf6('0x1b'),_0x59f838,JSON['stringify'](_0x4521af));_0x18c8cd(_0x4521af);})['catch'](function(_0x519a70){logger[_0x6cf6('0xf')](_0x6cf6('0x1b'),_0x519a70[_0x6cf6('0x11')],_0x59f838);_0x14ae3e(_0x45ce6e[_0x6cf6('0xf')](0x1f4,_0x519a70[_0x6cf6('0x11')]));});});}; \ No newline at end of file +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(_0x4e61b4,_0x1015fc){var _0x55758a=function(_0x2239b7){while(--_0x2239b7){_0x4e61b4['push'](_0x4e61b4['shift']());}};_0x55758a(++_0x1015fc);}(_0x6582,0x108));var _0x2658=function(_0xdc2b18,_0x385615){_0xdc2b18=_0xdc2b18-0x0;var _0x2b5b88=_0x6582[_0xdc2b18];return _0x2b5b88;};'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 diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index ca20f61..0a9ea89 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 _0xbf3a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','post','put','update','destroy','util'];(function(_0x475f80,_0x1e5060){var _0x4eefca=function(_0x453141){while(--_0x453141){_0x475f80['push'](_0x475f80['shift']());}};_0x4eefca(++_0x1e5060);}(_0xbf3a,0x164));var _0xabf3=function(_0x42020e,_0x4b92fb){_0x42020e=_0x42020e-0x0;var _0x561551=_0xbf3a[_0x42020e];return _0x561551;};'use strict';var multer=require('multer');var util=require(_0xabf3('0x0'));var path=require('path');var timeout=require(_0xabf3('0x1'));var express=require(_0xabf3('0x2'));var router=express[_0xabf3('0x3')]();var fs_extra=require(_0xabf3('0x4'));var auth=require(_0xabf3('0x5'));var interaction=require(_0xabf3('0x6'));var config=require(_0xabf3('0x7'));var controller=require('./openchannelTransferReport.controller');router[_0xabf3('0x8')]('/',auth['isAuthenticated'](),controller[_0xabf3('0x9')]);router[_0xabf3('0x8')]('/describe',auth[_0xabf3('0xa')](),controller[_0xabf3('0xb')]);router[_0xabf3('0x8')](_0xabf3('0xc'),auth[_0xabf3('0xa')](),controller['show']);router[_0xabf3('0xd')]('/',auth[_0xabf3('0xa')](),controller['create']);router[_0xabf3('0xe')](_0xabf3('0xc'),auth[_0xabf3('0xa')](),controller[_0xabf3('0xf')]);router['delete'](_0xabf3('0xc'),auth[_0xabf3('0xa')](),controller[_0xabf3('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3509=['put','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x188719,_0x239a5a){var _0x2bcf5d=function(_0xfd71e7){while(--_0xfd71e7){_0x188719['push'](_0x188719['shift']());}};_0x2bcf5d(++_0x239a5a);}(_0x3509,0xf3));var _0x9350=function(_0x499e28,_0x2d0c3e){_0x499e28=_0x499e28-0x0;var _0x4b8c09=_0x3509[_0x499e28];return _0x4b8c09;};'use strict';var multer=require(_0x9350('0x0'));var util=require(_0x9350('0x1'));var path=require(_0x9350('0x2'));var timeout=require(_0x9350('0x3'));var express=require(_0x9350('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9350('0x5'));var interaction=require(_0x9350('0x6'));var config=require('../../config/environment');var controller=require(_0x9350('0x7'));router[_0x9350('0x8')]('/',auth[_0x9350('0x9')](),controller[_0x9350('0xa')]);router[_0x9350('0x8')](_0x9350('0xb'),auth[_0x9350('0x9')](),controller[_0x9350('0xc')]);router[_0x9350('0x8')](_0x9350('0xd'),auth[_0x9350('0x9')](),controller[_0x9350('0xe')]);router[_0x9350('0xf')]('/',auth['isAuthenticated'](),controller[_0x9350('0x10')]);router[_0x9350('0x11')](_0x9350('0xd'),auth[_0x9350('0x9')](),controller['update']);router['delete']('/:id',auth[_0x9350('0x9')](),controller[_0x9350('0x12')]);module[_0x9350('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index e5c95ec..0cdbb89 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x403891,_0x3b7459){var _0x577d1b=function(_0x4b69fc){while(--_0x4b69fc){_0x403891['push'](_0x403891['shift']());}};_0x577d1b(++_0x3b7459);}(_0xf4eb,0xec));var _0xbf4e=function(_0x80f576,_0x2c7031){_0x80f576=_0x80f576-0x0;var _0x2d2f35=_0xf4eb[_0x80f576];return _0x2d2f35;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x2875b2,_0x43d894){var _0x54f37b=function(_0x37530b){while(--_0x37530b){_0x2875b2['push'](_0x2875b2['shift']());}};_0x54f37b(++_0x43d894);}(_0xf4eb,0xec));var _0xbf4e=function(_0x113ccd,_0x22a01b){_0x113ccd=_0x113ccd-0x0;var _0x1e2d8a=_0xf4eb[_0x113ccd];return _0x1e2d8a;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 5aca849..27a1480 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 _0x3372=['show','params','model','includeAll','create','body','find','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','OpenchannelTransferReport','findAll','catch'];(function(_0x4bfcbe,_0x4630f5){var _0x5b65e6=function(_0x5dcfc8){while(--_0x5dcfc8){_0x4bfcbe['push'](_0x4bfcbe['shift']());}};_0x5b65e6(++_0x4630f5);}(_0x3372,0x138));var _0x2337=function(_0x14e5ea,_0x1d3270){_0x14e5ea=_0x14e5ea-0x0;var _0x32c577=_0x3372[_0x14e5ea];return _0x32c577;};'use strict';var emlformat=require(_0x2337('0x0'));var rimraf=require(_0x2337('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2337('0x2'));var moment=require('moment');var BPromise=require(_0x2337('0x3'));var Mustache=require(_0x2337('0x4'));var util=require(_0x2337('0x5'));var path=require(_0x2337('0x6'));var sox=require(_0x2337('0x7'));var csv=require(_0x2337('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2337('0x9'));var _=require(_0x2337('0xa'));var squel=require(_0x2337('0xb'));var crypto=require(_0x2337('0xc'));var jsforce=require(_0x2337('0xd'));var deskjs=require(_0x2337('0xe'));var toCsv=require(_0x2337('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2337('0xf'));var authService=require(_0x2337('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2337('0x11'));var hardwareService=require(_0x2337('0x12'));var logger=require('../../config/logger')(_0x2337('0x13'));var utils=require(_0x2337('0x14'));var config=require(_0x2337('0x15'));var licenseUtil=require(_0x2337('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3340ed,_0x513d8c){_0x513d8c=_0x513d8c||0xcc;return function(_0x9b52de){if(_0x9b52de){return _0x3340ed[_0x2337('0x17')](_0x513d8c);}return _0x3340ed[_0x2337('0x18')](_0x513d8c)[_0x2337('0x19')]();};}function respondWithResult(_0x2d7660,_0x306036){_0x306036=_0x306036||0xc8;return function(_0x10ec18){if(_0x10ec18){return _0x2d7660[_0x2337('0x18')](_0x306036)[_0x2337('0x1a')](_0x10ec18);}};}function respondWithFilteredResult(_0x563dc6,_0x1ef76d){return function(_0xeeecd0){if(_0xeeecd0){var _0x2e9c01=typeof _0x1ef76d[_0x2337('0x1b')]===_0x2337('0x1c')&&typeof _0x1ef76d[_0x2337('0x1d')]===_0x2337('0x1c');var _0x4e59b6=_0xeeecd0[_0x2337('0x1e')];var _0x2655e7=_0x2e9c01?0x0:_0x1ef76d['offset'];var _0x4adadc=_0x2e9c01?_0xeeecd0[_0x2337('0x1e')]:_0x1ef76d[_0x2337('0x1b')]+_0x1ef76d['limit'];var _0x4577fc;if(_0x4adadc>=_0x4e59b6){_0x4adadc=_0x4e59b6;_0x4577fc=0xc8;}else{_0x4577fc=0xce;}_0x563dc6['status'](_0x4577fc);return _0x563dc6[_0x2337('0x1f')](_0x2337('0x20'),_0x2655e7+'-'+_0x4adadc+'/'+_0x4e59b6)[_0x2337('0x1a')](_0xeeecd0);}return null;};}function patchUpdates(_0x550ff8){return function(_0x647eb5){try{jsonpatch[_0x2337('0x21')](_0x647eb5,_0x550ff8,!![]);}catch(_0x1ecf1a){return BPromise[_0x2337('0x22')](_0x1ecf1a);}return _0x647eb5[_0x2337('0x23')]();};}function saveUpdates(_0x45eb2b,_0xd72a5a){return function(_0x53dd06){if(_0x53dd06){return _0x53dd06[_0x2337('0x24')](_0x45eb2b)[_0x2337('0x25')](function(_0x391526){return _0x391526;});}return null;};}function removeEntity(_0x513b9a,_0x3a21d6){return function(_0xd7f098){if(_0xd7f098){return _0xd7f098[_0x2337('0x26')]()['then'](function(){_0x513b9a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22543f,_0x40fe41){return function(_0x36c4d3){if(!_0x36c4d3){_0x22543f[_0x2337('0x17')](0x194);}return _0x36c4d3;};}function handleError(_0x4435a8,_0x3d6ab4){_0x3d6ab4=_0x3d6ab4||0x1f4;return function(_0x10222c){logger[_0x2337('0x27')](_0x10222c[_0x2337('0x28')]);if(_0x10222c[_0x2337('0x29')]){delete _0x10222c[_0x2337('0x29')];}_0x4435a8[_0x2337('0x18')](_0x3d6ab4)['send'](_0x10222c);};}exports[_0x2337('0x2a')]=function(_0x1e6bf3,_0x2e24cd){var _0x3ff5eb={},_0x3be41d={},_0x55aacd={'count':0x0,'rows':[]};var _0x38fad3=_[_0x2337('0x2b')](db['OpenchannelTransferReport'][_0x2337('0x2c')],function(_0x1659ce){return{'name':_0x1659ce[_0x2337('0x2d')],'type':_0x1659ce[_0x2337('0x2e')][_0x2337('0x2f')]};});_0x3be41d['model']=_[_0x2337('0x2b')](_0x38fad3,_0x2337('0x29'));_0x3be41d[_0x2337('0x30')]=_[_0x2337('0x31')](_0x1e6bf3['query']);_0x3be41d[_0x2337('0x32')]=_[_0x2337('0x33')](_0x3be41d['model'],_0x3be41d[_0x2337('0x30')]);_0x3ff5eb[_0x2337('0x34')]=_[_0x2337('0x33')](_0x3be41d['model'],qs[_0x2337('0x35')](_0x1e6bf3[_0x2337('0x30')][_0x2337('0x35')]));_0x3ff5eb[_0x2337('0x34')]=_0x3ff5eb[_0x2337('0x34')][_0x2337('0x36')]?_0x3ff5eb[_0x2337('0x34')]:_0x3be41d['model'];if(!_0x1e6bf3[_0x2337('0x30')][_0x2337('0x37')](_0x2337('0x38'))){_0x3ff5eb[_0x2337('0x1d')]=qs[_0x2337('0x1d')](_0x1e6bf3[_0x2337('0x30')][_0x2337('0x1d')]);_0x3ff5eb[_0x2337('0x1b')]=qs[_0x2337('0x1b')](_0x1e6bf3[_0x2337('0x30')][_0x2337('0x1b')]);}_0x3ff5eb[_0x2337('0x39')]=qs['sort'](_0x1e6bf3[_0x2337('0x30')][_0x2337('0x3a')]);_0x3ff5eb['where']=qs[_0x2337('0x32')](_['pick'](_0x1e6bf3['query'],_0x3be41d['filters']),_0x38fad3);if(_0x1e6bf3[_0x2337('0x30')]['filter']){_0x3ff5eb[_0x2337('0x3b')]=_[_0x2337('0x3c')](_0x3ff5eb['where'],{'$or':_['map'](_0x38fad3,function(_0x29ad62){if(_0x29ad62[_0x2337('0x2e')]!==_0x2337('0x3d')){var _0x4710c4={};_0x4710c4[_0x29ad62[_0x2337('0x29')]]={'$like':'%'+_0x1e6bf3[_0x2337('0x30')][_0x2337('0x3e')]+'%'};return _0x4710c4;}})});}_0x3ff5eb=_[_0x2337('0x3c')]({},_0x3ff5eb,_0x1e6bf3[_0x2337('0x3f')]);var _0x17fc37={'where':_0x3ff5eb[_0x2337('0x3b')]};return db['OpenchannelTransferReport']['count'](_0x17fc37)[_0x2337('0x25')](function(_0x4aed84){_0x55aacd[_0x2337('0x1e')]=_0x4aed84;if(_0x1e6bf3[_0x2337('0x30')]['includeAll']){_0x3ff5eb[_0x2337('0x40')]=[{'all':!![]}];}return db[_0x2337('0x41')][_0x2337('0x42')](_0x3ff5eb);})[_0x2337('0x25')](function(_0x31269e){_0x55aacd['rows']=_0x31269e;return _0x55aacd;})[_0x2337('0x25')](respondWithFilteredResult(_0x2e24cd,_0x3ff5eb))[_0x2337('0x43')](handleError(_0x2e24cd,null));};exports[_0x2337('0x44')]=function(_0x4da755,_0x24d79a){var _0x8451ee={'raw':!![],'where':{'id':_0x4da755[_0x2337('0x45')]['id']}},_0x230415={};_0x230415[_0x2337('0x46')]=_[_0x2337('0x31')](db[_0x2337('0x41')][_0x2337('0x2c')]);_0x230415[_0x2337('0x30')]=_[_0x2337('0x31')](_0x4da755[_0x2337('0x30')]);_0x230415[_0x2337('0x32')]=_[_0x2337('0x33')](_0x230415[_0x2337('0x46')],_0x230415[_0x2337('0x30')]);_0x8451ee[_0x2337('0x34')]=_[_0x2337('0x33')](_0x230415[_0x2337('0x46')],qs[_0x2337('0x35')](_0x4da755[_0x2337('0x30')][_0x2337('0x35')]));_0x8451ee[_0x2337('0x34')]=_0x8451ee['attributes'][_0x2337('0x36')]?_0x8451ee[_0x2337('0x34')]:_0x230415[_0x2337('0x46')];if(_0x4da755[_0x2337('0x30')][_0x2337('0x47')]){_0x8451ee[_0x2337('0x40')]=[{'all':!![]}];}_0x8451ee=_[_0x2337('0x3c')]({},_0x8451ee,_0x4da755['options']);return db[_0x2337('0x41')]['find'](_0x8451ee)[_0x2337('0x25')](handleEntityNotFound(_0x24d79a,null))[_0x2337('0x25')](respondWithResult(_0x24d79a,null))[_0x2337('0x43')](handleError(_0x24d79a,null));};exports['create']=function(_0x241742,_0x91c537){return db[_0x2337('0x41')][_0x2337('0x48')](_0x241742[_0x2337('0x49')],{})[_0x2337('0x25')](respondWithResult(_0x91c537,0xc9))[_0x2337('0x43')](handleError(_0x91c537,null));};exports['update']=function(_0x5009ad,_0x4cf41f){if(_0x5009ad['body']['id']){delete _0x5009ad[_0x2337('0x49')]['id'];}return db[_0x2337('0x41')][_0x2337('0x4a')]({'where':{'id':_0x5009ad['params']['id']}})[_0x2337('0x25')](handleEntityNotFound(_0x4cf41f,null))['then'](saveUpdates(_0x5009ad[_0x2337('0x49')],null))[_0x2337('0x25')](respondWithResult(_0x4cf41f,null))[_0x2337('0x43')](handleError(_0x4cf41f,null));};exports[_0x2337('0x26')]=function(_0x2e4219,_0x35b266){return db[_0x2337('0x41')]['find']({'where':{'id':_0x2e4219[_0x2337('0x45')]['id']}})[_0x2337('0x25')](handleEntityNotFound(_0x35b266,null))['then'](removeEntity(_0x35b266,null))['catch'](handleError(_0x35b266,null));};exports[_0x2337('0x4b')]=function(_0x28fb01,_0x469ba2){return db['OpenchannelTransferReport'][_0x2337('0x4b')]()[_0x2337('0x25')](respondWithResult(_0x469ba2,null))[_0x2337('0x43')](handleError(_0x469ba2,null));}; \ No newline at end of file +var _0x6260=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','destroy','then','error','name','send','index','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','OpenchannelTransferReport','rawAttributes','find','create','body','update','describe','eml-format'];(function(_0x6cf760,_0x1616c8){var _0x2c0ff0=function(_0x4b8a10){while(--_0x4b8a10){_0x6cf760['push'](_0x6cf760['shift']());}};_0x2c0ff0(++_0x1616c8);}(_0x6260,0xe6));var _0x0626=function(_0x7ad6cb,_0xffee6c){_0x7ad6cb=_0x7ad6cb-0x0;var _0x22a0ba=_0x6260[_0x7ad6cb];return _0x22a0ba;};'use strict';var emlformat=require(_0x0626('0x0'));var rimraf=require(_0x0626('0x1'));var zipdir=require(_0x0626('0x2'));var jsonpatch=require(_0x0626('0x3'));var rp=require(_0x0626('0x4'));var moment=require(_0x0626('0x5'));var BPromise=require(_0x0626('0x6'));var Mustache=require('mustache');var util=require(_0x0626('0x7'));var path=require(_0x0626('0x8'));var sox=require(_0x0626('0x9'));var csv=require(_0x0626('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0626('0xb'));var squel=require(_0x0626('0xc'));var crypto=require(_0x0626('0xd'));var jsforce=require(_0x0626('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0626('0xa'));var querystring=require(_0x0626('0xf'));var Papa=require(_0x0626('0x10'));var Redis=require(_0x0626('0x11'));var authService=require(_0x0626('0x12'));var qs=require(_0x0626('0x13'));var as=require(_0x0626('0x14'));var hardwareService=require(_0x0626('0x15'));var logger=require(_0x0626('0x16'))('api');var utils=require(_0x0626('0x17'));var config=require(_0x0626('0x18'));var licenseUtil=require(_0x0626('0x19'));var db=require(_0x0626('0x1a'))['db'];function respondWithStatusCode(_0x1144a3,_0x1c273b){_0x1c273b=_0x1c273b||0xcc;return function(_0x4b86b7){if(_0x4b86b7){return _0x1144a3[_0x0626('0x1b')](_0x1c273b);}return _0x1144a3[_0x0626('0x1c')](_0x1c273b)[_0x0626('0x1d')]();};}function respondWithResult(_0x489af4,_0x3eb2d4){_0x3eb2d4=_0x3eb2d4||0xc8;return function(_0x520697){if(_0x520697){return _0x489af4[_0x0626('0x1c')](_0x3eb2d4)['json'](_0x520697);}};}function respondWithFilteredResult(_0x79f072,_0x2b9fac){return function(_0x41447e){if(_0x41447e){var _0x13d687=typeof _0x2b9fac['offset']===_0x0626('0x1e')&&typeof _0x2b9fac[_0x0626('0x1f')]==='undefined';var _0x2f8934=_0x41447e[_0x0626('0x20')];var _0x198a71=_0x13d687?0x0:_0x2b9fac[_0x0626('0x21')];var _0x3d265c=_0x13d687?_0x41447e['count']:_0x2b9fac[_0x0626('0x21')]+_0x2b9fac[_0x0626('0x1f')];var _0x475d34;if(_0x3d265c>=_0x2f8934){_0x3d265c=_0x2f8934;_0x475d34=0xc8;}else{_0x475d34=0xce;}_0x79f072[_0x0626('0x1c')](_0x475d34);return _0x79f072['set'](_0x0626('0x22'),_0x198a71+'-'+_0x3d265c+'/'+_0x2f8934)[_0x0626('0x23')](_0x41447e);}return null;};}function patchUpdates(_0x2e5db1){return function(_0x984259){try{jsonpatch[_0x0626('0x24')](_0x984259,_0x2e5db1,!![]);}catch(_0x32c2b9){return BPromise[_0x0626('0x25')](_0x32c2b9);}return _0x984259[_0x0626('0x26')]();};}function saveUpdates(_0x58aa60,_0x1ad587){return function(_0x1b72c7){if(_0x1b72c7){return _0x1b72c7['update'](_0x58aa60)['then'](function(_0x4c3d90){return _0x4c3d90;});}return null;};}function removeEntity(_0x2f43b4,_0x51f27c){return function(_0x1c104a){if(_0x1c104a){return _0x1c104a[_0x0626('0x27')]()[_0x0626('0x28')](function(){_0x2f43b4[_0x0626('0x1c')](0xcc)[_0x0626('0x1d')]();});}};}function handleEntityNotFound(_0x134800,_0x3b340d){return function(_0x1dfba0){if(!_0x1dfba0){_0x134800['sendStatus'](0x194);}return _0x1dfba0;};}function handleError(_0xe7a64b,_0x46b23c){_0x46b23c=_0x46b23c||0x1f4;return function(_0x230f49){logger[_0x0626('0x29')](_0x230f49['stack']);if(_0x230f49['name']){delete _0x230f49[_0x0626('0x2a')];}_0xe7a64b[_0x0626('0x1c')](_0x46b23c)[_0x0626('0x2b')](_0x230f49);};}exports[_0x0626('0x2c')]=function(_0x4fc238,_0x3f37cf){var _0x4f6503={},_0x5784f8={},_0x2ca8f5={'count':0x0,'rows':[]};var _0x39258d=_['map'](db['OpenchannelTransferReport']['rawAttributes'],function(_0x4577bf){return{'name':_0x4577bf[_0x0626('0x2d')],'type':_0x4577bf[_0x0626('0x2e')][_0x0626('0x2f')]};});_0x5784f8['model']=_['map'](_0x39258d,_0x0626('0x2a'));_0x5784f8[_0x0626('0x30')]=_[_0x0626('0x31')](_0x4fc238[_0x0626('0x30')]);_0x5784f8[_0x0626('0x32')]=_[_0x0626('0x33')](_0x5784f8['model'],_0x5784f8[_0x0626('0x30')]);_0x4f6503['attributes']=_['intersection'](_0x5784f8[_0x0626('0x34')],qs[_0x0626('0x35')](_0x4fc238[_0x0626('0x30')]['fields']));_0x4f6503[_0x0626('0x36')]=_0x4f6503[_0x0626('0x36')][_0x0626('0x37')]?_0x4f6503['attributes']:_0x5784f8[_0x0626('0x34')];if(!_0x4fc238[_0x0626('0x30')][_0x0626('0x38')]('nolimit')){_0x4f6503[_0x0626('0x1f')]=qs[_0x0626('0x1f')](_0x4fc238['query']['limit']);_0x4f6503[_0x0626('0x21')]=qs['offset'](_0x4fc238[_0x0626('0x30')][_0x0626('0x21')]);}_0x4f6503[_0x0626('0x39')]=qs['sort'](_0x4fc238[_0x0626('0x30')][_0x0626('0x3a')]);_0x4f6503[_0x0626('0x3b')]=qs[_0x0626('0x32')](_['pick'](_0x4fc238['query'],_0x5784f8['filters']),_0x39258d);if(_0x4fc238['query'][_0x0626('0x3c')]){_0x4f6503['where']=_[_0x0626('0x3d')](_0x4f6503['where'],{'$or':_['map'](_0x39258d,function(_0x300255){if(_0x300255['type']!==_0x0626('0x3e')){var _0x2e045e={};_0x2e045e[_0x300255[_0x0626('0x2a')]]={'$like':'%'+_0x4fc238[_0x0626('0x30')]['filter']+'%'};return _0x2e045e;}})});}_0x4f6503=_[_0x0626('0x3d')]({},_0x4f6503,_0x4fc238[_0x0626('0x3f')]);var _0x5be53f={'where':_0x4f6503[_0x0626('0x3b')]};return db['OpenchannelTransferReport'][_0x0626('0x20')](_0x5be53f)['then'](function(_0x19e0f7){_0x2ca8f5[_0x0626('0x20')]=_0x19e0f7;if(_0x4fc238[_0x0626('0x30')][_0x0626('0x40')]){_0x4f6503[_0x0626('0x41')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x0626('0x42')](_0x4f6503);})[_0x0626('0x28')](function(_0x262c1f){_0x2ca8f5[_0x0626('0x43')]=_0x262c1f;return _0x2ca8f5;})[_0x0626('0x28')](respondWithFilteredResult(_0x3f37cf,_0x4f6503))[_0x0626('0x44')](handleError(_0x3f37cf,null));};exports['show']=function(_0x431915,_0x3464e2){var _0x5b7f52={'raw':!![],'where':{'id':_0x431915[_0x0626('0x45')]['id']}},_0x54a1dd={};_0x54a1dd[_0x0626('0x34')]=_['keys'](db[_0x0626('0x46')][_0x0626('0x47')]);_0x54a1dd[_0x0626('0x30')]=_[_0x0626('0x31')](_0x431915[_0x0626('0x30')]);_0x54a1dd[_0x0626('0x32')]=_[_0x0626('0x33')](_0x54a1dd[_0x0626('0x34')],_0x54a1dd['query']);_0x5b7f52[_0x0626('0x36')]=_[_0x0626('0x33')](_0x54a1dd[_0x0626('0x34')],qs['fields'](_0x431915[_0x0626('0x30')][_0x0626('0x35')]));_0x5b7f52['attributes']=_0x5b7f52[_0x0626('0x36')]['length']?_0x5b7f52['attributes']:_0x54a1dd[_0x0626('0x34')];if(_0x431915[_0x0626('0x30')][_0x0626('0x40')]){_0x5b7f52['include']=[{'all':!![]}];}_0x5b7f52=_[_0x0626('0x3d')]({},_0x5b7f52,_0x431915[_0x0626('0x3f')]);return db[_0x0626('0x46')][_0x0626('0x48')](_0x5b7f52)['then'](handleEntityNotFound(_0x3464e2,null))['then'](respondWithResult(_0x3464e2,null))['catch'](handleError(_0x3464e2,null));};exports['create']=function(_0x2b5957,_0x4740bd){return db[_0x0626('0x46')][_0x0626('0x49')](_0x2b5957[_0x0626('0x4a')],{})[_0x0626('0x28')](respondWithResult(_0x4740bd,0xc9))[_0x0626('0x44')](handleError(_0x4740bd,null));};exports[_0x0626('0x4b')]=function(_0x489bf7,_0x2bd0f1){if(_0x489bf7[_0x0626('0x4a')]['id']){delete _0x489bf7[_0x0626('0x4a')]['id'];}return db[_0x0626('0x46')][_0x0626('0x48')]({'where':{'id':_0x489bf7['params']['id']}})[_0x0626('0x28')](handleEntityNotFound(_0x2bd0f1,null))['then'](saveUpdates(_0x489bf7['body'],null))['then'](respondWithResult(_0x2bd0f1,null))[_0x0626('0x44')](handleError(_0x2bd0f1,null));};exports[_0x0626('0x27')]=function(_0x4d241f,_0x4efe22){return db[_0x0626('0x46')][_0x0626('0x48')]({'where':{'id':_0x4d241f['params']['id']}})[_0x0626('0x28')](handleEntityNotFound(_0x4efe22,null))['then'](removeEntity(_0x4efe22,null))[_0x0626('0x44')](handleError(_0x4efe22,null));};exports[_0x0626('0x4c')]=function(_0x274c65,_0x2afd2e){return db['OpenchannelTransferReport']['describe']()[_0x0626('0x28')](respondWithResult(_0x2afd2e,null))[_0x0626('0x44')](handleError(_0x2afd2e,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 8bd7b1e..61a2a2c 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 _0x4e58=['./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x5ecde6,_0x24791c){var _0xdc89d8=function(_0x4ef91c){while(--_0x4ef91c){_0x5ecde6['push'](_0x5ecde6['shift']());}};_0xdc89d8(++_0x24791c);}(_0x4e58,0x131));var _0x84e5=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x4e58[_0x20a558];return _0x53d3f7;};'use strict';var _=require(_0x84e5('0x0'));var util=require(_0x84e5('0x1'));var logger=require(_0x84e5('0x2'))(_0x84e5('0x3'));var moment=require(_0x84e5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x84e5('0x5'));var rimraf=require(_0x84e5('0x6'));var config=require('../../config/environment');var attributes=require(_0x84e5('0x7'));module[_0x84e5('0x8')]=function(_0x4c83f3,_0x8c5a04){return _0x4c83f3[_0x84e5('0x9')]('OpenchannelTransferReport',attributes,{'tableName':_0x84e5('0xa'),'paranoid':![],'indexes':[{'name':_0x84e5('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa978=['api','moment','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x3c1cbb,_0x383df3){var _0x6be838=function(_0x23f573){while(--_0x23f573){_0x3c1cbb['push'](_0x3c1cbb['shift']());}};_0x6be838(++_0x383df3);}(_0xa978,0xc9));var _0x8a97=function(_0x1bd7a7,_0x573794){_0x1bd7a7=_0x1bd7a7-0x0;var _0x30141c=_0xa978[_0x1bd7a7];return _0x30141c;};'use strict';var _=require(_0x8a97('0x0'));var util=require(_0x8a97('0x1'));var logger=require(_0x8a97('0x2'))(_0x8a97('0x3'));var moment=require(_0x8a97('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8a97('0x5'));var attributes=require(_0x8a97('0x6'));module[_0x8a97('0x7')]=function(_0x550304,_0x5aeca9){return _0x550304[_0x8a97('0x8')](_0x8a97('0x9'),attributes,{'tableName':_0x8a97('0xa'),'paranoid':![],'indexes':[{'name':_0x8a97('0xb'),'fields':[_0x8a97('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 7db8c60..9edd59e 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 _0x885a=['info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x624727,_0x42f874){var _0x5ac512=function(_0x2a45b3){while(--_0x2a45b3){_0x624727['push'](_0x624727['shift']());}};_0x5ac512(++_0x42f874);}(_0x885a,0x180));var _0xa885=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x885a[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require(_0xa885('0x0'));var moment=require(_0xa885('0x1'));var BPromise=require(_0xa885('0x2'));var rs=require(_0xa885('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa885('0x4'))['db'];var utils=require(_0xa885('0x5'));var logger=require(_0xa885('0x6'))(_0xa885('0x7'));var config=require(_0xa885('0x8'));var jayson=require(_0xa885('0x9'));var client=jayson['client'][_0xa885('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1200c7,_0x31fd77,_0x546175){return new BPromise(function(_0x6b26e2,_0x2b7916){return client[_0xa885('0xb')](_0x1200c7,_0x546175)['then'](function(_0x2305b1){logger[_0xa885('0xc')](_0xa885('0xd'),_0x31fd77,_0xa885('0xe'));logger[_0xa885('0xf')](_0xa885('0x10'),_0x31fd77,_0xa885('0xe'),JSON['stringify'](_0x2305b1));if(_0x2305b1[_0xa885('0x11')]){if(_0x2305b1[_0xa885('0x11')][_0xa885('0x12')]===0x1f4){logger[_0xa885('0x11')](_0xa885('0xd'),_0x31fd77,_0x2305b1[_0xa885('0x11')][_0xa885('0x13')]);return _0x2b7916(_0x2305b1['error'][_0xa885('0x13')]);}logger[_0xa885('0x11')](_0xa885('0xd'),_0x31fd77,_0x2305b1[_0xa885('0x11')][_0xa885('0x13')]);return _0x6b26e2(_0x2305b1['error'][_0xa885('0x13')]);}else{logger[_0xa885('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x31fd77,_0xa885('0xe'));_0x6b26e2(_0x2305b1[_0xa885('0x14')]['message']);}})[_0xa885('0x15')](function(_0x41b3de){logger['error'](_0xa885('0xd'),_0x31fd77,_0x41b3de);_0x2b7916(_0x41b3de);});});} \ No newline at end of file +var _0xcb81=['lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x55d56f,_0x287ad1){var _0x3c81a0=function(_0x4778fa){while(--_0x4778fa){_0x55d56f['push'](_0x55d56f['shift']());}};_0x3c81a0(++_0x287ad1);}(_0xcb81,0x154));var _0x1cb8=function(_0x40015a,_0x415db5){_0x40015a=_0x40015a-0x0;var _0x42f8a4=_0xcb81[_0x40015a];return _0x42f8a4;};'use strict';var _=require(_0x1cb8('0x0'));var util=require(_0x1cb8('0x1'));var moment=require('moment');var BPromise=require(_0x1cb8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1cb8('0x3'));var logger=require(_0x1cb8('0x4'))(_0x1cb8('0x5'));var config=require(_0x1cb8('0x6'));var jayson=require(_0x1cb8('0x7'));var client=jayson['client'][_0x1cb8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ac2d6,_0x584b16,_0x2408c2){return new BPromise(function(_0x39b4ad,_0x282fd8){return client['request'](_0x2ac2d6,_0x2408c2)[_0x1cb8('0x9')](function(_0x51dc9e){logger['info'](_0x1cb8('0xa'),_0x584b16,_0x1cb8('0xb'));logger[_0x1cb8('0xc')](_0x1cb8('0xd'),_0x584b16,_0x1cb8('0xb'),JSON[_0x1cb8('0xe')](_0x51dc9e));if(_0x51dc9e[_0x1cb8('0xf')]){if(_0x51dc9e[_0x1cb8('0xf')]['code']===0x1f4){logger[_0x1cb8('0xf')](_0x1cb8('0xa'),_0x584b16,_0x51dc9e[_0x1cb8('0xf')][_0x1cb8('0x10')]);return _0x282fd8(_0x51dc9e[_0x1cb8('0xf')]['message']);}logger[_0x1cb8('0xf')](_0x1cb8('0xa'),_0x584b16,_0x51dc9e[_0x1cb8('0xf')][_0x1cb8('0x10')]);return _0x39b4ad(_0x51dc9e[_0x1cb8('0xf')][_0x1cb8('0x10')]);}else{logger[_0x1cb8('0x11')](_0x1cb8('0xa'),_0x584b16,'request\x20sent');_0x39b4ad(_0x51dc9e[_0x1cb8('0x12')]['message']);}})[_0x1cb8('0x13')](function(_0x28b8ff){logger[_0x1cb8('0xf')](_0x1cb8('0xa'),_0x584b16,_0x28b8ff);_0x282fd8(_0x28b8ff);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index e92fbb4..5b90ac2 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 _0xa095=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','get'];(function(_0x5d8631,_0x44944b){var _0x34c15e=function(_0x4448f8){while(--_0x4448f8){_0x5d8631['push'](_0x5d8631['shift']());}};_0x34c15e(++_0x44944b);}(_0xa095,0x7c));var _0x5a09=function(_0x385c76,_0xb97335){_0x385c76=_0x385c76-0x0;var _0x5c8367=_0xa095[_0x385c76];return _0x5c8367;};'use strict';var multer=require(_0x5a09('0x0'));var util=require(_0x5a09('0x1'));var path=require('path');var timeout=require(_0x5a09('0x2'));var express=require('express');var router=express[_0x5a09('0x3')]();var fs_extra=require(_0x5a09('0x4'));var auth=require(_0x5a09('0x5'));var interaction=require(_0x5a09('0x6'));var config=require('../../config/environment');var controller=require(_0x5a09('0x7'));router[_0x5a09('0x8')]('/',auth[_0x5a09('0x9')](),controller[_0x5a09('0xa')]);router[_0x5a09('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5a09('0xb')]('/',auth[_0x5a09('0x9')](),controller[_0x5a09('0xc')]);router[_0x5a09('0xd')](_0x5a09('0xe'),auth[_0x5a09('0x9')](),controller[_0x5a09('0xf')]);router[_0x5a09('0x10')](_0x5a09('0xe'),auth[_0x5a09('0x9')](),controller[_0x5a09('0x11')]);module[_0x5a09('0x12')]=router; \ No newline at end of file +var _0x1cd0=['fs-extra','../../config/environment','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x3132e8,_0x499a0e){var _0x43eb8c=function(_0x2321e1){while(--_0x2321e1){_0x3132e8['push'](_0x3132e8['shift']());}};_0x43eb8c(++_0x499a0e);}(_0x1cd0,0x13b));var _0x01cd=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x1cd0[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x01cd('0x0'));var util=require(_0x01cd('0x1'));var path=require(_0x01cd('0x2'));var timeout=require(_0x01cd('0x3'));var express=require('express');var router=express[_0x01cd('0x4')]();var fs_extra=require(_0x01cd('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x01cd('0x6'));var controller=require('./pause.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x01cd('0x7'),auth[_0x01cd('0x8')](),controller[_0x01cd('0x9')]);router[_0x01cd('0xa')]('/',auth[_0x01cd('0x8')](),controller[_0x01cd('0xb')]);router[_0x01cd('0xc')]('/:id',auth[_0x01cd('0x8')](),controller[_0x01cd('0xd')]);router[_0x01cd('0xe')]('/:id',auth[_0x01cd('0x8')](),controller['destroy']);module[_0x01cd('0xf')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 2afb649..53efc2e 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 _0x5349=['name','exports','STRING'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x5349,0x12a));var _0x9534=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x5349[_0x3de8a4];return _0x4635cf;};'use strict';var Sequelize=require('sequelize');module[_0x9534('0x0')]={'name':{'type':Sequelize[_0x9534('0x1')],'unique':_0x9534('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5def=['STRING','name','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5def,0xa1));var _0xf5de=function(_0x81a26e,_0x4a6f01){_0x81a26e=_0x81a26e-0x0;var _0x343910=_0x5def[_0x81a26e];return _0x343910;};'use strict';var Sequelize=require('sequelize');module[_0xf5de('0x0')]={'name':{'type':Sequelize[_0xf5de('0x1')],'unique':_0xf5de('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xf5de('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index c01ba57..7869969 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 _0x055b=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','get','end','error','stack','name','index','map','Pause','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Pauses','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/parsers/qs'];(function(_0x43d66d,_0x3c2c83){var _0x3cb9e2=function(_0x1635c3){while(--_0x1635c3){_0x43d66d['push'](_0x43d66d['shift']());}};_0x3cb9e2(++_0x3c2c83);}(_0x055b,0x1e2));var _0xb055=function(_0x32e4f5,_0x301966){_0x32e4f5=_0x32e4f5-0x0;var _0x26067b=_0x055b[_0x32e4f5];return _0x26067b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb055('0x0'));var zipdir=require(_0xb055('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb055('0x2'));var moment=require(_0xb055('0x3'));var BPromise=require(_0xb055('0x4'));var Mustache=require('mustache');var util=require(_0xb055('0x5'));var path=require(_0xb055('0x6'));var sox=require(_0xb055('0x7'));var csv=require(_0xb055('0x8'));var ejs=require(_0xb055('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb055('0xa'));var squel=require(_0xb055('0xb'));var crypto=require(_0xb055('0xc'));var jsforce=require(_0xb055('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb055('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb055('0xf'));var as=require(_0xb055('0x10'));var hardwareService=require(_0xb055('0x11'));var logger=require(_0xb055('0x12'))(_0xb055('0x13'));var utils=require(_0xb055('0x14'));var config=require(_0xb055('0x15'));var licenseUtil=require(_0xb055('0x16'));var db=require(_0xb055('0x17'))['db'];function respondWithStatusCode(_0x3b7000,_0x176005){_0x176005=_0x176005||0xcc;return function(_0x345b69){if(_0x345b69){return _0x3b7000['sendStatus'](_0x176005);}return _0x3b7000[_0xb055('0x18')](_0x176005)['end']();};}function respondWithResult(_0x3f9b21,_0x161659){_0x161659=_0x161659||0xc8;return function(_0x4135e4){if(_0x4135e4){return _0x3f9b21['status'](_0x161659)[_0xb055('0x19')](_0x4135e4);}};}function respondWithFilteredResult(_0x229152,_0x529f14){return function(_0x3f7f92){if(_0x3f7f92){var _0x32d123=typeof _0x529f14[_0xb055('0x1a')]===_0xb055('0x1b')&&typeof _0x529f14[_0xb055('0x1c')]==='undefined';var _0x493ffe=_0x3f7f92[_0xb055('0x1d')];var _0x515f46=_0x32d123?0x0:_0x529f14[_0xb055('0x1a')];var _0x54c426=_0x32d123?_0x3f7f92[_0xb055('0x1d')]:_0x529f14['offset']+_0x529f14[_0xb055('0x1c')];var _0x14171e;if(_0x54c426>=_0x493ffe){_0x54c426=_0x493ffe;_0x14171e=0xc8;}else{_0x14171e=0xce;}_0x229152['status'](_0x14171e);return _0x229152[_0xb055('0x1e')](_0xb055('0x1f'),_0x515f46+'-'+_0x54c426+'/'+_0x493ffe)[_0xb055('0x19')](_0x3f7f92);}return null;};}function patchUpdates(_0x3ede91){return function(_0x340115){try{jsonpatch[_0xb055('0x20')](_0x340115,_0x3ede91,!![]);}catch(_0x25ebe2){return BPromise['reject'](_0x25ebe2);}return _0x340115['save']();};}function saveUpdates(_0x1113fe,_0x1d1e93){return function(_0x5ac892){if(_0x5ac892){return _0x5ac892['update'](_0x1113fe)[_0xb055('0x21')](function(_0x5a1d2c){return _0x5a1d2c;});}return null;};}function removeEntity(_0x4dafed,_0xe810ff){return function(_0x1f1262){if(_0x1f1262){return _0x1f1262[_0xb055('0x22')]()[_0xb055('0x21')](function(){var _0x5a30af=_0x1f1262[_0xb055('0x23')]({'plain':!![]});var _0x34d076='Pauses';return db['UserProfileResource']['destroy']({'where':{'type':_0x34d076,'resourceId':_0x5a30af['id']}})['then'](function(){return _0x1f1262;});})[_0xb055('0x21')](function(){_0x4dafed[_0xb055('0x18')](0xcc)[_0xb055('0x24')]();});}};}function handleEntityNotFound(_0x3a8092,_0x2043b2){return function(_0x3d614b){if(!_0x3d614b){_0x3a8092['sendStatus'](0x194);}return _0x3d614b;};}function handleError(_0x119007,_0x162fc8){_0x162fc8=_0x162fc8||0x1f4;return function(_0x4fb38d){logger[_0xb055('0x25')](_0x4fb38d[_0xb055('0x26')]);if(_0x4fb38d[_0xb055('0x27')]){delete _0x4fb38d[_0xb055('0x27')];}_0x119007[_0xb055('0x18')](_0x162fc8)['send'](_0x4fb38d);};}exports[_0xb055('0x28')]=function(_0x5eda0a,_0x23ef48){var _0x40a39a={},_0x211ad4={},_0x3903ab={'count':0x0,'rows':[]};var _0x55f589=_[_0xb055('0x29')](db[_0xb055('0x2a')]['rawAttributes'],function(_0x3ec6ac){return{'name':_0x3ec6ac['fieldName'],'type':_0x3ec6ac[_0xb055('0x2b')][_0xb055('0x2c')]};});_0x211ad4[_0xb055('0x2d')]=_[_0xb055('0x29')](_0x55f589,_0xb055('0x27'));_0x211ad4[_0xb055('0x2e')]=_[_0xb055('0x2f')](_0x5eda0a[_0xb055('0x2e')]);_0x211ad4[_0xb055('0x30')]=_['intersection'](_0x211ad4[_0xb055('0x2d')],_0x211ad4['query']);_0x40a39a[_0xb055('0x31')]=_[_0xb055('0x32')](_0x211ad4[_0xb055('0x2d')],qs[_0xb055('0x33')](_0x5eda0a['query'][_0xb055('0x33')]));_0x40a39a[_0xb055('0x31')]=_0x40a39a['attributes'][_0xb055('0x34')]?_0x40a39a['attributes']:_0x211ad4[_0xb055('0x2d')];if(!_0x5eda0a[_0xb055('0x2e')][_0xb055('0x35')](_0xb055('0x36'))){_0x40a39a[_0xb055('0x1c')]=qs[_0xb055('0x1c')](_0x5eda0a[_0xb055('0x2e')]['limit']);_0x40a39a['offset']=qs['offset'](_0x5eda0a[_0xb055('0x2e')]['offset']);}_0x40a39a[_0xb055('0x37')]=qs[_0xb055('0x38')](_0x5eda0a[_0xb055('0x2e')][_0xb055('0x38')]);_0x40a39a['where']=qs[_0xb055('0x30')](_[_0xb055('0x39')](_0x5eda0a[_0xb055('0x2e')],_0x211ad4[_0xb055('0x30')]),_0x55f589);if(_0x5eda0a[_0xb055('0x2e')][_0xb055('0x3a')]){_0x40a39a['where']=_[_0xb055('0x3b')](_0x40a39a[_0xb055('0x3c')],{'$or':_[_0xb055('0x29')](_0x55f589,function(_0x5aa15b){if(_0x5aa15b[_0xb055('0x2b')]!==_0xb055('0x3d')){var _0x324ce6={};_0x324ce6[_0x5aa15b[_0xb055('0x27')]]={'$like':'%'+_0x5eda0a[_0xb055('0x2e')][_0xb055('0x3a')]+'%'};return _0x324ce6;}})});}_0x40a39a=_[_0xb055('0x3b')]({},_0x40a39a,_0x5eda0a[_0xb055('0x3e')]);var _0x3d0924={'where':_0x40a39a[_0xb055('0x3c')]};return db[_0xb055('0x2a')][_0xb055('0x1d')](_0x3d0924)[_0xb055('0x21')](function(_0x534bd6){_0x3903ab['count']=_0x534bd6;if(_0x5eda0a[_0xb055('0x2e')]['includeAll']){_0x40a39a[_0xb055('0x3f')]=[{'all':!![]}];}return db['Pause'][_0xb055('0x40')](_0x40a39a);})[_0xb055('0x21')](function(_0x4b9ad8){_0x3903ab[_0xb055('0x41')]=_0x4b9ad8;return _0x3903ab;})[_0xb055('0x21')](respondWithFilteredResult(_0x23ef48,_0x40a39a))[_0xb055('0x42')](handleError(_0x23ef48,null));};exports[_0xb055('0x43')]=function(_0x5149c7,_0x468ca0){var _0x2ca9f5={'raw':!![],'where':{'id':_0x5149c7[_0xb055('0x44')]['id']}},_0x4d5526={};_0x4d5526[_0xb055('0x2d')]=_[_0xb055('0x2f')](db[_0xb055('0x2a')][_0xb055('0x45')]);_0x4d5526[_0xb055('0x2e')]=_['keys'](_0x5149c7['query']);_0x4d5526[_0xb055('0x30')]=_[_0xb055('0x32')](_0x4d5526[_0xb055('0x2d')],_0x4d5526[_0xb055('0x2e')]);_0x2ca9f5[_0xb055('0x31')]=_[_0xb055('0x32')](_0x4d5526[_0xb055('0x2d')],qs['fields'](_0x5149c7[_0xb055('0x2e')][_0xb055('0x33')]));_0x2ca9f5[_0xb055('0x31')]=_0x2ca9f5[_0xb055('0x31')][_0xb055('0x34')]?_0x2ca9f5['attributes']:_0x4d5526['model'];if(_0x5149c7['query'][_0xb055('0x46')]){_0x2ca9f5[_0xb055('0x3f')]=[{'all':!![]}];}_0x2ca9f5=_[_0xb055('0x3b')]({},_0x2ca9f5,_0x5149c7[_0xb055('0x3e')]);return db[_0xb055('0x2a')][_0xb055('0x47')](_0x2ca9f5)[_0xb055('0x21')](handleEntityNotFound(_0x468ca0,null))[_0xb055('0x21')](respondWithResult(_0x468ca0,null))['catch'](handleError(_0x468ca0,null));};exports[_0xb055('0x48')]=function(_0x267e40,_0x254b5d){return db[_0xb055('0x2a')][_0xb055('0x48')](_0x267e40[_0xb055('0x49')],{})[_0xb055('0x21')](function(_0x53df12){var _0x2068e0=_0x267e40['user'][_0xb055('0x23')]({'plain':!![]});if(!_0x2068e0)throw new Error(_0xb055('0x4a'));if(_0x2068e0[_0xb055('0x4b')]===_0xb055('0x4c')){var _0x3cd1c5=_0x53df12['get']({'plain':!![]});var _0x27008f=_0xb055('0x4d');return db['UserProfileSection'][_0xb055('0x47')]({'where':{'name':_0x27008f,'userProfileId':_0x2068e0[_0xb055('0x4e')]},'raw':!![]})[_0xb055('0x21')](function(_0x57e4fd){if(_0x57e4fd&&_0x57e4fd[_0xb055('0x4f')]===0x0){return db[_0xb055('0x50')]['create']({'name':_0x3cd1c5[_0xb055('0x27')],'resourceId':_0x3cd1c5['id'],'type':_0x57e4fd[_0xb055('0x27')],'sectionId':_0x57e4fd['id']},{})['then'](function(){return _0x53df12;});}else{return _0x53df12;}})[_0xb055('0x42')](function(_0xa554f5){logger['error'](_0xb055('0x51'),_0xa554f5);throw _0xa554f5;});}return _0x53df12;})[_0xb055('0x21')](respondWithResult(_0x254b5d,0xc9))[_0xb055('0x42')](handleError(_0x254b5d,null));};exports[_0xb055('0x52')]=function(_0x5391e9,_0x5409d4){if(_0x5391e9['body']['id']){delete _0x5391e9['body']['id'];}return db[_0xb055('0x2a')]['find']({'where':{'id':_0x5391e9[_0xb055('0x44')]['id']}})[_0xb055('0x21')](handleEntityNotFound(_0x5409d4,null))[_0xb055('0x21')](saveUpdates(_0x5391e9[_0xb055('0x49')],null))[_0xb055('0x21')](respondWithResult(_0x5409d4,null))[_0xb055('0x42')](handleError(_0x5409d4,null));};exports['destroy']=function(_0x3cc44e,_0x22e6d0){return db[_0xb055('0x2a')]['find']({'where':{'id':_0x3cc44e[_0xb055('0x44')]['id']}})['then'](handleEntityNotFound(_0x22e6d0,null))['then'](removeEntity(_0x22e6d0,null))[_0xb055('0x42')](handleError(_0x22e6d0,null));}; \ No newline at end of file +var _0x0ca0=['destroy','error','stack','name','index','map','Pause','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','eml-format','rimraf','zip-dir','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','get','Pauses','UserProfileResource'];(function(_0x26f9b7,_0x44adca){var _0x2a6eec=function(_0x253a07){while(--_0x253a07){_0x26f9b7['push'](_0x26f9b7['shift']());}};_0x2a6eec(++_0x44adca);}(_0x0ca0,0xd0));var _0x00ca=function(_0x371a78,_0x53d31c){_0x371a78=_0x371a78-0x0;var _0x12bf0f=_0x0ca0[_0x371a78];return _0x12bf0f;};'use strict';var emlformat=require(_0x00ca('0x0'));var rimraf=require(_0x00ca('0x1'));var zipdir=require(_0x00ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x00ca('0x3'));var Mustache=require(_0x00ca('0x4'));var util=require('util');var path=require('path');var sox=require(_0x00ca('0x5'));var csv=require(_0x00ca('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x00ca('0x7'));var _=require(_0x00ca('0x8'));var squel=require(_0x00ca('0x9'));var crypto=require('crypto');var jsforce=require(_0x00ca('0xa'));var deskjs=require(_0x00ca('0xb'));var toCsv=require(_0x00ca('0x6'));var querystring=require(_0x00ca('0xc'));var Papa=require(_0x00ca('0xd'));var Redis=require(_0x00ca('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x00ca('0xf'));var as=require(_0x00ca('0x10'));var hardwareService=require(_0x00ca('0x11'));var logger=require(_0x00ca('0x12'))(_0x00ca('0x13'));var utils=require('../../config/utils');var config=require(_0x00ca('0x14'));var licenseUtil=require(_0x00ca('0x15'));var db=require(_0x00ca('0x16'))['db'];function respondWithStatusCode(_0x3948e6,_0x55cb2d){_0x55cb2d=_0x55cb2d||0xcc;return function(_0x29786d){if(_0x29786d){return _0x3948e6[_0x00ca('0x17')](_0x55cb2d);}return _0x3948e6[_0x00ca('0x18')](_0x55cb2d)['end']();};}function respondWithResult(_0x559242,_0x2c1803){_0x2c1803=_0x2c1803||0xc8;return function(_0x24f917){if(_0x24f917){return _0x559242[_0x00ca('0x18')](_0x2c1803)[_0x00ca('0x19')](_0x24f917);}};}function respondWithFilteredResult(_0x13a721,_0x5c2a6e){return function(_0x233b90){if(_0x233b90){var _0x21a817=typeof _0x5c2a6e[_0x00ca('0x1a')]===_0x00ca('0x1b')&&typeof _0x5c2a6e[_0x00ca('0x1c')]===_0x00ca('0x1b');var _0x2a5c57=_0x233b90[_0x00ca('0x1d')];var _0x35f3cc=_0x21a817?0x0:_0x5c2a6e['offset'];var _0x14c561=_0x21a817?_0x233b90['count']:_0x5c2a6e['offset']+_0x5c2a6e[_0x00ca('0x1c')];var _0x5f2e67;if(_0x14c561>=_0x2a5c57){_0x14c561=_0x2a5c57;_0x5f2e67=0xc8;}else{_0x5f2e67=0xce;}_0x13a721[_0x00ca('0x18')](_0x5f2e67);return _0x13a721[_0x00ca('0x1e')]('Content-Range',_0x35f3cc+'-'+_0x14c561+'/'+_0x2a5c57)[_0x00ca('0x19')](_0x233b90);}return null;};}function patchUpdates(_0x128382){return function(_0x161b2d){try{jsonpatch['apply'](_0x161b2d,_0x128382,!![]);}catch(_0x2cd6af){return BPromise[_0x00ca('0x1f')](_0x2cd6af);}return _0x161b2d[_0x00ca('0x20')]();};}function saveUpdates(_0x149bce,_0x319119){return function(_0x206b14){if(_0x206b14){return _0x206b14[_0x00ca('0x21')](_0x149bce)[_0x00ca('0x22')](function(_0x2b69cc){return _0x2b69cc;});}return null;};}function removeEntity(_0x18fab2,_0x49b00a){return function(_0x6c704d){if(_0x6c704d){return _0x6c704d['destroy']()[_0x00ca('0x22')](function(){var _0x570f46=_0x6c704d[_0x00ca('0x23')]({'plain':!![]});var _0xd16da6=_0x00ca('0x24');return db[_0x00ca('0x25')][_0x00ca('0x26')]({'where':{'type':_0xd16da6,'resourceId':_0x570f46['id']}})['then'](function(){return _0x6c704d;});})[_0x00ca('0x22')](function(){_0x18fab2[_0x00ca('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5826f1,_0x150b2f){return function(_0x3b1c36){if(!_0x3b1c36){_0x5826f1[_0x00ca('0x17')](0x194);}return _0x3b1c36;};}function handleError(_0x8d1fc9,_0x27a152){_0x27a152=_0x27a152||0x1f4;return function(_0x5adc15){logger[_0x00ca('0x27')](_0x5adc15[_0x00ca('0x28')]);if(_0x5adc15[_0x00ca('0x29')]){delete _0x5adc15['name'];}_0x8d1fc9['status'](_0x27a152)['send'](_0x5adc15);};}exports[_0x00ca('0x2a')]=function(_0x502c22,_0x1fab14){var _0x5abd33={},_0xa12166={},_0x49c8b8={'count':0x0,'rows':[]};var _0x2dfd6d=_[_0x00ca('0x2b')](db[_0x00ca('0x2c')][_0x00ca('0x2d')],function(_0x4c260b){return{'name':_0x4c260b[_0x00ca('0x2e')],'type':_0x4c260b[_0x00ca('0x2f')][_0x00ca('0x30')]};});_0xa12166['model']=_['map'](_0x2dfd6d,_0x00ca('0x29'));_0xa12166[_0x00ca('0x31')]=_[_0x00ca('0x32')](_0x502c22[_0x00ca('0x31')]);_0xa12166[_0x00ca('0x33')]=_[_0x00ca('0x34')](_0xa12166[_0x00ca('0x35')],_0xa12166[_0x00ca('0x31')]);_0x5abd33['attributes']=_[_0x00ca('0x34')](_0xa12166['model'],qs[_0x00ca('0x36')](_0x502c22[_0x00ca('0x31')][_0x00ca('0x36')]));_0x5abd33[_0x00ca('0x37')]=_0x5abd33[_0x00ca('0x37')][_0x00ca('0x38')]?_0x5abd33[_0x00ca('0x37')]:_0xa12166[_0x00ca('0x35')];if(!_0x502c22[_0x00ca('0x31')][_0x00ca('0x39')](_0x00ca('0x3a'))){_0x5abd33[_0x00ca('0x1c')]=qs['limit'](_0x502c22[_0x00ca('0x31')][_0x00ca('0x1c')]);_0x5abd33[_0x00ca('0x1a')]=qs[_0x00ca('0x1a')](_0x502c22['query'][_0x00ca('0x1a')]);}_0x5abd33['order']=qs[_0x00ca('0x3b')](_0x502c22[_0x00ca('0x31')]['sort']);_0x5abd33[_0x00ca('0x3c')]=qs[_0x00ca('0x33')](_[_0x00ca('0x3d')](_0x502c22[_0x00ca('0x31')],_0xa12166[_0x00ca('0x33')]),_0x2dfd6d);if(_0x502c22[_0x00ca('0x31')][_0x00ca('0x3e')]){_0x5abd33[_0x00ca('0x3c')]=_['merge'](_0x5abd33['where'],{'$or':_[_0x00ca('0x2b')](_0x2dfd6d,function(_0x1a8d95){if(_0x1a8d95[_0x00ca('0x2f')]!==_0x00ca('0x3f')){var _0x54c6d9={};_0x54c6d9[_0x1a8d95[_0x00ca('0x29')]]={'$like':'%'+_0x502c22[_0x00ca('0x31')]['filter']+'%'};return _0x54c6d9;}})});}_0x5abd33=_[_0x00ca('0x40')]({},_0x5abd33,_0x502c22[_0x00ca('0x41')]);var _0x130448={'where':_0x5abd33[_0x00ca('0x3c')]};return db[_0x00ca('0x2c')]['count'](_0x130448)[_0x00ca('0x22')](function(_0x5262f6){_0x49c8b8['count']=_0x5262f6;if(_0x502c22['query']['includeAll']){_0x5abd33[_0x00ca('0x42')]=[{'all':!![]}];}return db[_0x00ca('0x2c')][_0x00ca('0x43')](_0x5abd33);})[_0x00ca('0x22')](function(_0x189eb4){_0x49c8b8[_0x00ca('0x44')]=_0x189eb4;return _0x49c8b8;})[_0x00ca('0x22')](respondWithFilteredResult(_0x1fab14,_0x5abd33))[_0x00ca('0x45')](handleError(_0x1fab14,null));};exports[_0x00ca('0x46')]=function(_0x316c89,_0x370f94){var _0x3190a8={'raw':!![],'where':{'id':_0x316c89['params']['id']}},_0x14307d={};_0x14307d[_0x00ca('0x35')]=_['keys'](db[_0x00ca('0x2c')][_0x00ca('0x2d')]);_0x14307d[_0x00ca('0x31')]=_[_0x00ca('0x32')](_0x316c89[_0x00ca('0x31')]);_0x14307d[_0x00ca('0x33')]=_[_0x00ca('0x34')](_0x14307d[_0x00ca('0x35')],_0x14307d[_0x00ca('0x31')]);_0x3190a8[_0x00ca('0x37')]=_[_0x00ca('0x34')](_0x14307d[_0x00ca('0x35')],qs[_0x00ca('0x36')](_0x316c89[_0x00ca('0x31')][_0x00ca('0x36')]));_0x3190a8[_0x00ca('0x37')]=_0x3190a8[_0x00ca('0x37')]['length']?_0x3190a8['attributes']:_0x14307d[_0x00ca('0x35')];if(_0x316c89[_0x00ca('0x31')][_0x00ca('0x47')]){_0x3190a8[_0x00ca('0x42')]=[{'all':!![]}];}_0x3190a8=_[_0x00ca('0x40')]({},_0x3190a8,_0x316c89[_0x00ca('0x41')]);return db[_0x00ca('0x2c')]['find'](_0x3190a8)[_0x00ca('0x22')](handleEntityNotFound(_0x370f94,null))['then'](respondWithResult(_0x370f94,null))[_0x00ca('0x45')](handleError(_0x370f94,null));};exports[_0x00ca('0x48')]=function(_0x36b064,_0x40ad26){return db[_0x00ca('0x2c')][_0x00ca('0x48')](_0x36b064[_0x00ca('0x49')],{})['then'](function(_0x53f71b){var _0x5a087a=_0x36b064[_0x00ca('0x4a')]['get']({'plain':!![]});if(!_0x5a087a)throw new Error(_0x00ca('0x4b'));if(_0x5a087a[_0x00ca('0x4c')]===_0x00ca('0x4a')){var _0x2e85aa=_0x53f71b['get']({'plain':!![]});var _0x318583='Pauses';return db[_0x00ca('0x4d')]['find']({'where':{'name':_0x318583,'userProfileId':_0x5a087a['userProfileId']},'raw':!![]})[_0x00ca('0x22')](function(_0x4f8e07){if(_0x4f8e07&&_0x4f8e07[_0x00ca('0x4e')]===0x0){return db[_0x00ca('0x25')][_0x00ca('0x48')]({'name':_0x2e85aa[_0x00ca('0x29')],'resourceId':_0x2e85aa['id'],'type':_0x4f8e07[_0x00ca('0x29')],'sectionId':_0x4f8e07['id']},{})['then'](function(){return _0x53f71b;});}else{return _0x53f71b;}})['catch'](function(_0x13cd3a){logger[_0x00ca('0x27')](_0x00ca('0x4f'),_0x13cd3a);throw _0x13cd3a;});}return _0x53f71b;})[_0x00ca('0x22')](respondWithResult(_0x40ad26,0xc9))[_0x00ca('0x45')](handleError(_0x40ad26,null));};exports[_0x00ca('0x21')]=function(_0xf4add1,_0x5f006f){if(_0xf4add1[_0x00ca('0x49')]['id']){delete _0xf4add1['body']['id'];}return db['Pause'][_0x00ca('0x50')]({'where':{'id':_0xf4add1[_0x00ca('0x51')]['id']}})[_0x00ca('0x22')](handleEntityNotFound(_0x5f006f,null))[_0x00ca('0x22')](saveUpdates(_0xf4add1['body'],null))['then'](respondWithResult(_0x5f006f,null))[_0x00ca('0x45')](handleError(_0x5f006f,null));};exports['destroy']=function(_0xd9c39a,_0x5e9317){return db[_0x00ca('0x2c')][_0x00ca('0x50')]({'where':{'id':_0xd9c39a['params']['id']}})['then'](handleEntityNotFound(_0x5e9317,null))[_0x00ca('0x22')](removeEntity(_0x5e9317,null))[_0x00ca('0x45')](handleError(_0x5e9317,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index ba569d2..01fd787 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 _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6aa7,0x178));var _0x76aa=function(_0x2261f2,_0x4f6c68){_0x2261f2=_0x2261f2-0x0;var _0x2c7ead=_0x6aa7[_0x2261f2];return _0x2c7ead;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6aa7,0x178));var _0x76aa=function(_0xbc1a4b,_0x4dfbe4){_0xbc1a4b=_0xbc1a4b-0x0;var _0x108b87=_0x6aa7[_0xbc1a4b];return _0x108b87;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index efbddde..dfcf1eb 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0xce5bc7,_0x185999){var _0x2714ec=function(_0x3c3790){while(--_0x3c3790){_0xce5bc7['push'](_0xce5bc7['shift']());}};_0x2714ec(++_0x185999);}(_0xb10b,0x12a));var _0xbb10=function(_0x17ba7d,_0x3d1ace){_0x17ba7d=_0x17ba7d-0x0;var _0x8fd171=_0xb10b[_0x17ba7d];return _0x8fd171;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _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(_0x187f87,_0x4e3be5){var _0x279f2a=function(_0x23a297){while(--_0x23a297){_0x187f87['push'](_0x187f87['shift']());}};_0x279f2a(++_0x4e3be5);}(_0x7a54,0x106));var _0x47a5=function(_0x4ada94,_0x1050c0){_0x4ada94=_0x4ada94-0x0;var _0x3537d6=_0x7a54[_0x4ada94];return _0x3537d6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index bd05d11..daa8946 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 _0x207c=['file','upload','post','webhookPost','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/webhook','/:id','isAuthenticated','/:id/download','download','diskStorage','root','originalname','replace','format','%s-%s%s','extname','now','single'];(function(_0x115da7,_0x5675d0){var _0x1b09ae=function(_0x4ef3eb){while(--_0x4ef3eb){_0x115da7['push'](_0x115da7['shift']());}};_0x1b09ae(++_0x5675d0);}(_0x207c,0x1e8));var _0xc207=function(_0x5c8827,_0x5bc5d7){_0x5c8827=_0x5c8827-0x0;var _0x50ffd5=_0x207c[_0x5c8827];return _0x50ffd5;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./plugin.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc207('0x8')]);router[_0xc207('0x9')](_0xc207('0xa'),controller['webhookGet']);router[_0xc207('0x9')](_0xc207('0xb'),auth[_0xc207('0xc')](),controller['show']);router[_0xc207('0x9')](_0xc207('0xd'),auth[_0xc207('0xc')](),controller[_0xc207('0xe')]);var upload=multer({'storage':multer[_0xc207('0xf')]({'destination':function(_0x347549,_0x487d95,_0x574425){_0x574425(null,path['join'](config[_0xc207('0x10')],'server/files/plugins'));},'filename':function(_0x2741f3,_0x2782ce,_0x59d401){_0x2782ce[_0xc207('0x11')]=_0x2782ce[_0xc207('0x11')][_0xc207('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59d401(null,util[_0xc207('0x13')](_0xc207('0x14'),path['basename'](_0x2782ce[_0xc207('0x11')],path[_0xc207('0x15')](_0x2782ce[_0xc207('0x11')])),Date[_0xc207('0x16')](),path['extname'](_0x2782ce['originalname'])));}})});router['post']('/',upload[_0xc207('0x17')](_0xc207('0x18')),controller[_0xc207('0x19')]);router[_0xc207('0x1a')]('/webhook',controller[_0xc207('0x1b')]);router[_0xc207('0x1c')](_0xc207('0xb'),auth['isAuthenticated'](),controller[_0xc207('0x1d')]);router['delete'](_0xc207('0xb'),auth[_0xc207('0xc')](),controller[_0xc207('0x1e')]);module[_0xc207('0x1f')]=router; \ No newline at end of file +var _0xda55=['diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','now','extname','post','single','file','webhookPost','put','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','get','/webhook','webhookGet','/:id','show','download'];(function(_0x48eda6,_0x3370bc){var _0x9d8653=function(_0x1fc8ef){while(--_0x1fc8ef){_0x48eda6['push'](_0x48eda6['shift']());}};_0x9d8653(++_0x3370bc);}(_0xda55,0x6d));var _0x5da5=function(_0x1a4d43,_0x28b32c){_0x1a4d43=_0x1a4d43-0x0;var _0x3650e0=_0xda55[_0x1a4d43];return _0x3650e0;};'use strict';var multer=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5da5('0x2'));var router=express[_0x5da5('0x3')]();var fs_extra=require(_0x5da5('0x4'));var auth=require(_0x5da5('0x5'));var interaction=require(_0x5da5('0x6'));var config=require('../../config/environment');var controller=require(_0x5da5('0x7'));router['get']('/',auth[_0x5da5('0x8')](),controller['index']);router[_0x5da5('0x9')](_0x5da5('0xa'),controller[_0x5da5('0xb')]);router[_0x5da5('0x9')](_0x5da5('0xc'),auth[_0x5da5('0x8')](),controller[_0x5da5('0xd')]);router[_0x5da5('0x9')]('/:id/download',auth[_0x5da5('0x8')](),controller[_0x5da5('0xe')]);var upload=multer({'storage':multer[_0x5da5('0xf')]({'destination':function(_0x26fbe3,_0x1a047e,_0x2a361c){_0x2a361c(null,path[_0x5da5('0x10')](config['root'],_0x5da5('0x11')));},'filename':function(_0x3b5ff9,_0x4f813b,_0x37aeb0){_0x4f813b[_0x5da5('0x12')]=_0x4f813b[_0x5da5('0x12')][_0x5da5('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x37aeb0(null,util[_0x5da5('0x14')](_0x5da5('0x15'),path['basename'](_0x4f813b['originalname'],path['extname'](_0x4f813b[_0x5da5('0x12')])),Date[_0x5da5('0x16')](),path[_0x5da5('0x17')](_0x4f813b[_0x5da5('0x12')])));}})});router[_0x5da5('0x18')]('/',upload[_0x5da5('0x19')](_0x5da5('0x1a')),controller['upload']);router[_0x5da5('0x18')](_0x5da5('0xa'),controller[_0x5da5('0x1b')]);router[_0x5da5('0x1c')](_0x5da5('0xc'),auth[_0x5da5('0x8')](),controller['update']);router[_0x5da5('0x1d')](_0x5da5('0xc'),auth[_0x5da5('0x8')](),controller[_0x5da5('0x1d')]);module[_0x5da5('0x1e')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 6bcc6f9..0d24697 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 _0xb1f5=['sequelize','exports','STRING','ENUM','html','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never'];(function(_0x2f5b68,_0x313cdc){var _0x4300db=function(_0x180894){while(--_0x180894){_0x2f5b68['push'](_0x2f5b68['shift']());}};_0x4300db(++_0x313cdc);}(_0xb1f5,0x120));var _0x5b1f=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xb1f5[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x5b1f('0x0'));module[_0x5b1f('0x1')]={'name':{'type':Sequelize[_0x5b1f('0x2')]},'type':{'type':Sequelize[_0x5b1f('0x3')](_0x5b1f('0x4'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0x5b1f('0x5')},'active':{'type':Sequelize[_0x5b1f('0x6')],'defaultValue':0x0,'comment':_0x5b1f('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0x5b1f('0x8'),_0x5b1f('0x9'),_0x5b1f('0xa'),_0x5b1f('0xb')),'defaultValue':_0x5b1f('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x5b1f('0x2')]},'agentUrl':{'type':Sequelize[_0x5b1f('0x2')]},'scriptName':{'type':Sequelize[_0x5b1f('0x2')]},'scriptPath':{'type':Sequelize[_0x5b1f('0x2')]}}; \ No newline at end of file +var _0xba07=['always','never','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly'];(function(_0x2bfcfc,_0x3ed0df){var _0x289b8b=function(_0x15b67d){while(--_0x15b67d){_0x2bfcfc['push'](_0x2bfcfc['shift']());}};_0x289b8b(++_0x3ed0df);}(_0xba07,0xc6));var _0x7ba0=function(_0x49d3d2,_0x1c43c0){_0x49d3d2=_0x49d3d2-0x0;var _0x573ad3=_0xba07[_0x49d3d2];return _0x573ad3;};'use strict';var Sequelize=require(_0x7ba0('0x0'));module[_0x7ba0('0x1')]={'name':{'type':Sequelize[_0x7ba0('0x2')]},'type':{'type':Sequelize[_0x7ba0('0x3')](_0x7ba0('0x4'),_0x7ba0('0x5'))},'description':{'type':Sequelize[_0x7ba0('0x6')]},'version':{'type':Sequelize[_0x7ba0('0x6')]},'path':{'type':Sequelize[_0x7ba0('0x2')],'comment':_0x7ba0('0x7')},'active':{'type':Sequelize[_0x7ba0('0x8')],'defaultValue':0x0,'comment':_0x7ba0('0x9')},'sidebar':{'type':Sequelize['ENUM'](_0x7ba0('0xa'),_0x7ba0('0xb'),_0x7ba0('0xc'),_0x7ba0('0xd')),'defaultValue':_0x7ba0('0xc'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x7ba0('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x7ba0('0x2')]},'scriptName':{'type':Sequelize[_0x7ba0('0x2')]},'scriptPath':{'type':Sequelize[_0x7ba0('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 4536607..dd972e5 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 _0x15aa=['parameters','html','Invalid\x20manifest:\x20views\x20missing','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','admin','test','plugins','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','http://localhost:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','defaults','redis','socket.io-emitter','./plugin.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','get','Plugins','UserProfileResource','sendStatus','error','stack','send','index','map','Plugin','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','length','includeAll','find','download','params','join','root','server/files/plugins','%s.zip','basename','zip','warning','code','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified'];(function(_0xca9104,_0x2c35f4){var _0x166619=function(_0x25d5ce){while(--_0x25d5ce){_0xca9104['push'](_0xca9104['shift']());}};_0x166619(++_0x2c35f4);}(_0x15aa,0xd5));var _0xa15a=function(_0x4c2013,_0x484608){_0x4c2013=_0x4c2013-0x0;var _0x245132=_0x15aa[_0x4c2013];return _0x245132;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa15a('0x0'));var zipdir=require(_0xa15a('0x1'));var jsonpatch=require(_0xa15a('0x2'));var rp=require(_0xa15a('0x3'));var moment=require(_0xa15a('0x4'));var BPromise=require(_0xa15a('0x5'));var Mustache=require('mustache');var util=require(_0xa15a('0x6'));var path=require(_0xa15a('0x7'));var sox=require('sox');var csv=require(_0xa15a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa15a('0x9'));var _=require(_0xa15a('0xa'));var squel=require(_0xa15a('0xb'));var crypto=require(_0xa15a('0xc'));var jsforce=require(_0xa15a('0xd'));var deskjs=require(_0xa15a('0xe'));var toCsv=require(_0xa15a('0x8'));var querystring=require(_0xa15a('0xf'));var Papa=require(_0xa15a('0x10'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0xa15a('0x11'));var Redis=require('ioredis');var authService=require(_0xa15a('0x12'));var qs=require(_0xa15a('0x13'));var as=require(_0xa15a('0x14'));var hardwareService=require(_0xa15a('0x15'));var logger=require(_0xa15a('0x16'))(_0xa15a('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa15a('0x18'))['db'];config['redis']=_[_0xa15a('0x19')](config[_0xa15a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xa15a('0x1b'))(new Redis(config['redis']));require(_0xa15a('0x1c'))[_0xa15a('0x1d')](socket);function respondWithStatusCode(_0x5a62df,_0x2e5b82){_0x2e5b82=_0x2e5b82||0xcc;return function(_0x1ef572){if(_0x1ef572){return _0x5a62df['sendStatus'](_0x2e5b82);}return _0x5a62df[_0xa15a('0x1e')](_0x2e5b82)[_0xa15a('0x1f')]();};}function respondWithResult(_0x349789,_0x297491){_0x297491=_0x297491||0xc8;return function(_0x3cd5d0){if(_0x3cd5d0){return _0x349789[_0xa15a('0x1e')](_0x297491)[_0xa15a('0x20')](_0x3cd5d0);}};}function respondWithFilteredResult(_0xfef06d,_0x1ad994){return function(_0x37d9d9){if(_0x37d9d9){var _0x2f564c=typeof _0x1ad994[_0xa15a('0x21')]===_0xa15a('0x22')&&typeof _0x1ad994['limit']===_0xa15a('0x22');var _0x37f805=_0x37d9d9[_0xa15a('0x23')];var _0x1fd3f9=_0x2f564c?0x0:_0x1ad994['offset'];var _0x45b1c1=_0x2f564c?_0x37d9d9[_0xa15a('0x23')]:_0x1ad994[_0xa15a('0x21')]+_0x1ad994[_0xa15a('0x24')];var _0x589827;if(_0x45b1c1>=_0x37f805){_0x45b1c1=_0x37f805;_0x589827=0xc8;}else{_0x589827=0xce;}_0xfef06d[_0xa15a('0x1e')](_0x589827);return _0xfef06d[_0xa15a('0x25')](_0xa15a('0x26'),_0x1fd3f9+'-'+_0x45b1c1+'/'+_0x37f805)['json'](_0x37d9d9);}return null;};}function patchUpdates(_0x12f0cf){return function(_0x2e5244){try{jsonpatch['apply'](_0x2e5244,_0x12f0cf,!![]);}catch(_0x486c9b){return BPromise['reject'](_0x486c9b);}return _0x2e5244[_0xa15a('0x27')]();};}function saveUpdates(_0x390c43,_0x4826c8){return function(_0x292802){if(_0x292802){return _0x292802[_0xa15a('0x28')](_0x390c43)[_0xa15a('0x29')](function(_0x1b5f56){return _0x1b5f56;});}return null;};}function removeEntity(_0x11f2f9,_0x5bdad6){return function(_0x285bd6){if(_0x285bd6){return _0x285bd6[_0xa15a('0x2a')]()['then'](function(){var _0x1ff44a=_0x285bd6[_0xa15a('0x2b')]({'plain':!![]});var _0x53f83e=_0xa15a('0x2c');return db[_0xa15a('0x2d')]['destroy']({'where':{'type':_0x53f83e,'resourceId':_0x1ff44a['id']}})['then'](function(){return _0x285bd6;});})[_0xa15a('0x29')](function(){_0x11f2f9[_0xa15a('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8b31d,_0x141534){return function(_0x55c95e){if(!_0x55c95e){_0xe8b31d[_0xa15a('0x2e')](0x194);}return _0x55c95e;};}function handleError(_0x16a6c8,_0x66350c){_0x66350c=_0x66350c||0x1f4;return function(_0x188f07){logger[_0xa15a('0x2f')](_0x188f07[_0xa15a('0x30')]);if(_0x188f07['name']){delete _0x188f07['name'];}_0x16a6c8[_0xa15a('0x1e')](_0x66350c)[_0xa15a('0x31')](_0x188f07);};}exports[_0xa15a('0x32')]=function(_0x4e85c1,_0x56a78d){var _0x5226fe={},_0x83b38d={},_0x42a838={'count':0x0,'rows':[]};var _0x3679cc=_[_0xa15a('0x33')](db[_0xa15a('0x34')][_0xa15a('0x35')],function(_0x1496b5){return{'name':_0x1496b5[_0xa15a('0x36')],'type':_0x1496b5[_0xa15a('0x37')]['key']};});_0x83b38d[_0xa15a('0x38')]=_['map'](_0x3679cc,_0xa15a('0x39'));_0x83b38d[_0xa15a('0x3a')]=_[_0xa15a('0x3b')](_0x4e85c1[_0xa15a('0x3a')]);_0x83b38d[_0xa15a('0x3c')]=_[_0xa15a('0x3d')](_0x83b38d[_0xa15a('0x38')],_0x83b38d[_0xa15a('0x3a')]);_0x5226fe[_0xa15a('0x3e')]=_['intersection'](_0x83b38d[_0xa15a('0x38')],qs[_0xa15a('0x3f')](_0x4e85c1['query'][_0xa15a('0x3f')]));_0x5226fe[_0xa15a('0x3e')]=_0x5226fe[_0xa15a('0x3e')]['length']?_0x5226fe[_0xa15a('0x3e')]:_0x83b38d['model'];if(!_0x4e85c1['query']['hasOwnProperty']('nolimit')){_0x5226fe[_0xa15a('0x24')]=qs[_0xa15a('0x24')](_0x4e85c1[_0xa15a('0x3a')][_0xa15a('0x24')]);_0x5226fe[_0xa15a('0x21')]=qs[_0xa15a('0x21')](_0x4e85c1[_0xa15a('0x3a')][_0xa15a('0x21')]);}_0x5226fe[_0xa15a('0x40')]=qs[_0xa15a('0x41')](_0x4e85c1[_0xa15a('0x3a')]['sort']);_0x5226fe[_0xa15a('0x42')]=qs['filters'](_[_0xa15a('0x43')](_0x4e85c1[_0xa15a('0x3a')],_0x83b38d[_0xa15a('0x3c')]),_0x3679cc);if(_0x4e85c1[_0xa15a('0x3a')]['filter']){_0x5226fe[_0xa15a('0x42')]=_[_0xa15a('0x44')](_0x5226fe[_0xa15a('0x42')],{'$or':_[_0xa15a('0x33')](_0x3679cc,function(_0x2a467e){if(_0x2a467e[_0xa15a('0x37')]!==_0xa15a('0x45')){var _0x78ca76={};_0x78ca76[_0x2a467e[_0xa15a('0x39')]]={'$like':'%'+_0x4e85c1[_0xa15a('0x3a')][_0xa15a('0x46')]+'%'};return _0x78ca76;}})});}_0x5226fe=_[_0xa15a('0x44')]({},_0x5226fe,_0x4e85c1[_0xa15a('0x47')]);var _0x1835df={'where':_0x5226fe[_0xa15a('0x42')]};return db[_0xa15a('0x34')]['count'](_0x1835df)[_0xa15a('0x29')](function(_0x52d536){_0x42a838[_0xa15a('0x23')]=_0x52d536;if(_0x4e85c1['query']['includeAll']){_0x5226fe[_0xa15a('0x48')]=[{'all':!![]}];}return db[_0xa15a('0x34')][_0xa15a('0x49')](_0x5226fe);})[_0xa15a('0x29')](function(_0x1c166f){_0x42a838[_0xa15a('0x4a')]=_0x1c166f;return _0x42a838;})['then'](respondWithFilteredResult(_0x56a78d,_0x5226fe))[_0xa15a('0x4b')](handleError(_0x56a78d,null));};exports[_0xa15a('0x4c')]=function(_0x49380f,_0x355eb3){var _0x2ddbca={'raw':!![],'where':{'id':_0x49380f['params']['id']}},_0x17c714={};_0x17c714['model']=_[_0xa15a('0x3b')](db[_0xa15a('0x34')]['rawAttributes']);_0x17c714[_0xa15a('0x3a')]=_['keys'](_0x49380f[_0xa15a('0x3a')]);_0x17c714[_0xa15a('0x3c')]=_[_0xa15a('0x3d')](_0x17c714[_0xa15a('0x38')],_0x17c714[_0xa15a('0x3a')]);_0x2ddbca[_0xa15a('0x3e')]=_[_0xa15a('0x3d')](_0x17c714[_0xa15a('0x38')],qs['fields'](_0x49380f['query'][_0xa15a('0x3f')]));_0x2ddbca['attributes']=_0x2ddbca[_0xa15a('0x3e')][_0xa15a('0x4d')]?_0x2ddbca['attributes']:_0x17c714['model'];if(_0x49380f[_0xa15a('0x3a')][_0xa15a('0x4e')]){_0x2ddbca[_0xa15a('0x48')]=[{'all':!![]}];}_0x2ddbca=_[_0xa15a('0x44')]({},_0x2ddbca,_0x49380f[_0xa15a('0x47')]);return db[_0xa15a('0x34')][_0xa15a('0x4f')](_0x2ddbca)[_0xa15a('0x29')](handleEntityNotFound(_0x355eb3,null))['then'](respondWithResult(_0x355eb3,null))[_0xa15a('0x4b')](handleError(_0x355eb3,null));};exports[_0xa15a('0x50')]=function(_0x202732,_0xc210b3,_0x39f58f){return db['Plugin'][_0xa15a('0x4f')]({'where':{'id':_0x202732[_0xa15a('0x51')]['id']},'attributes':[_0xa15a('0x39'),'path'],'raw':!![]})[_0xa15a('0x29')](handleEntityNotFound(_0xc210b3,null))[_0xa15a('0x29')](function(_0x38eb36){if(_0x38eb36){var _0xc73fb0=path[_0xa15a('0x52')](config[_0xa15a('0x53')],_0xa15a('0x54'),util['format'](_0xa15a('0x55'),path[_0xa15a('0x56')](_0x38eb36['path'])));var _0x4154ca=fs['createWriteStream'](_0xc73fb0);var _0x9d4076=archiver(_0xa15a('0x57'),{'zlib':{'level':0x9}});_0x9d4076['on'](_0xa15a('0x58'),function(_0x27fef3){if(_0x27fef3[_0xa15a('0x59')]==='ENOENT'){logger['error'](_0x27fef3);}else{throw new db['Sequelize'][(_0xa15a('0x5a'))](_0xa15a('0x5b'));}});_0x9d4076['on'](_0xa15a('0x2f'),function(_0xfc7f9a){throw new db['Sequelize']['Error'](_0xa15a('0x5b'));});_0x9d4076['pipe'](_0x4154ca);_0x9d4076[_0xa15a('0x5c')](_0xa15a('0x5d'),{'cwd':path[_0xa15a('0x52')](config[_0xa15a('0x53')],'server/files/plugins',path[_0xa15a('0x5e')](_0x38eb36[_0xa15a('0x7')])),'ignore':[path[_0xa15a('0x52')](path[_0xa15a('0x56')](_0x38eb36[_0xa15a('0x7')]),_0xa15a('0x5f')),path[_0xa15a('0x52')](path[_0xa15a('0x56')](_0x38eb36[_0xa15a('0x7')]),_0xa15a('0x60'))],'nodir':!![]})[_0xa15a('0x61')]();_0x4154ca['on']('close',function(){if(!fs[_0xa15a('0x62')](_0xc73fb0)){throw new db['Sequelize'][(_0xa15a('0x5a'))](_0xa15a('0x63'));}return _0xc210b3[_0xa15a('0x50')](_0xc73fb0,util[_0xa15a('0x64')](_0xa15a('0x55'),path['basename'](_0x38eb36[_0xa15a('0x7')])),function(_0xb4e20d){if(_0xb4e20d){throw new db['Sequelize'][(_0xa15a('0x5a'))](_0xa15a('0x65'));}fs[_0xa15a('0x66')](_0xc73fb0);logger[_0xa15a('0x67')]('Download\x20completed');logger[_0xa15a('0x67')](_0xa15a('0x68'));});});}return null;})[_0xa15a('0x4b')](handleError(_0xc210b3,null));};exports[_0xa15a('0x69')]=function(_0xc2b2f2,_0x47ffd4,_0x20d5be){var _0x3b7355=path[_0xa15a('0x56')](_0xc2b2f2[_0xa15a('0x6a')][_0xa15a('0x6b')],path[_0xa15a('0x6c')](_0xc2b2f2[_0xa15a('0x6a')][_0xa15a('0x6b')]));var _0x29eb8a=path[_0xa15a('0x52')](config[_0xa15a('0x53')],_0xa15a('0x54'),_0xc2b2f2[_0xa15a('0x6a')][_0xa15a('0x6b')]);var _0xf19612=path[_0xa15a('0x52')](config[_0xa15a('0x53')],_0xa15a('0x54'),_0x3b7355);logger[_0xa15a('0x67')](_0xa15a('0x6d'),_0x29eb8a);logger[_0xa15a('0x67')](_0xa15a('0x6e'),_0xf19612);try{fs[_0xa15a('0x6f')](_0x29eb8a,parseInt(_0xa15a('0x70'),0x8));extract(_0x29eb8a,{'dir':_0xf19612},function(_0x9825a){if(_0x9825a){logger['error'](_0x9825a);handleError(_0x9825a,!![]);};var _0x5e3e38=fs[_0xa15a('0x71')](_0xf19612);if(_0x5e3e38[_0xa15a('0x4d')]>0x1){removeReferences(_0x29eb8a,_0xf19612);logger['error'](_0xa15a('0x72'));return _0x20d5be(new Error(_0xa15a('0x72')));}var _0x1c1895=fs['lstatSync'](path[_0xa15a('0x52')](_0xf19612,_0x5e3e38[0x0]));if(_0x1c1895[_0xa15a('0x73')]()){removeReferences(_0x29eb8a,_0xf19612);logger['error'](_0xa15a('0x72'));return _0x20d5be(new Error(_0xa15a('0x72')));}if(_0x1c1895[_0xa15a('0x74')]()){var _0x3d4e23=fs[_0xa15a('0x71')](path[_0xa15a('0x52')](_0xf19612,_0x5e3e38[0x0]));if(_0x3d4e23['length']===0x0){removeReferences(_0x29eb8a,_0xf19612);logger[_0xa15a('0x2f')](_0xa15a('0x72'));return _0x20d5be(new Error('Invalid\x20plugin\x20structure'));}var _0xc7e989=_0x3d4e23[_0xa15a('0x75')](function(_0x149e45){return _0x149e45===_0xa15a('0x76');});if(!_0xc7e989){return _0x20d5be(new Error(_0xa15a('0x77')));}var _0x310acc=fs[_0xa15a('0x78')](path['join'](_0xf19612,_0x5e3e38[0x0],_0xa15a('0x76')));var _0x4b75a6=JSON['parse'](_0x310acc);if(_0xa15a('0x22')==typeof _0x4b75a6[_0xa15a('0x39')]){return _0x20d5be(new Error(_0xa15a('0x79')));}if('undefined'==typeof _0x4b75a6[_0xa15a('0x37')]){return _0x20d5be(new Error(_0xa15a('0x7a')));}if('undefined'==typeof _0x4b75a6[_0xa15a('0x7b')]){return _0x20d5be(new Error(_0xa15a('0x7c')));}if(_0xa15a('0x22')==typeof _0x4b75a6[_0xa15a('0x7d')]){return _0x20d5be(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x4b75a6[_0xa15a('0x37')]===_0xa15a('0x7e')){if(_0xa15a('0x22')==typeof _0x4b75a6[_0xa15a('0x7d')]['views']){return _0x20d5be(new Error(_0xa15a('0x7f')));}if(_0xa15a('0x22')==typeof _0x4b75a6[_0xa15a('0x7d')]['views']['admin']&&'undefined'==typeof _0x4b75a6[_0xa15a('0x7d')][_0xa15a('0x80')][_0xa15a('0x81')]){return _0x20d5be(new Error(_0xa15a('0x82')));}}else if(_0x4b75a6['type']===_0xa15a('0x83')){if(_0xa15a('0x22')==typeof _0x4b75a6[_0xa15a('0x7d')][_0xa15a('0x84')]){return _0x20d5be(new Error(_0xa15a('0x85')));}if(_0xa15a('0x22')==typeof _0x4b75a6[_0xa15a('0x7d')][_0xa15a('0x86')]){return _0x20d5be(new Error(_0xa15a('0x87')));}}else{return _0x20d5be(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x3f4c01=_0x4b75a6[_0xa15a('0x39')];var _0x59a978=_0x4b75a6[_0xa15a('0x88')];var _0x241995=_0x4b75a6['type'];var _0x36cdbf=_0x4b75a6[_0xa15a('0x89')]?_0x4b75a6[_0xa15a('0x89')]:_0xa15a('0x8a');var _0x2b68fa=_0x4b75a6['icon']?_0x4b75a6[_0xa15a('0x8b')]:_0xa15a('0x8c');var _0x4d933f='';var _0x266992='';var _0x3f3356='';var _0x25db8f='';var _0x1555e8=_0x4b75a6[_0xa15a('0x7b')];if(_0x241995==='html'){if('undefined'!=typeof _0x4b75a6['parameters'][_0xa15a('0x80')][_0xa15a('0x8d')]){var _0x45cf29=_0x4b75a6[_0xa15a('0x7d')][_0xa15a('0x80')][_0xa15a('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0xa15a('0x8e')](_0x45cf29)){_0x4d933f=path[_0xa15a('0x52')]('plugins',_0x3b7355,_0x5e3e38[0x0],_0x45cf29);}else{_0x4d933f=_0x45cf29;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xa15a('0x22')!=typeof _0x4b75a6[_0xa15a('0x7d')]['views'][_0xa15a('0x81')]){var _0x50be19=_0x4b75a6[_0xa15a('0x7d')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0xa15a('0x8e')](_0x50be19)){_0x266992=path[_0xa15a('0x52')](_0xa15a('0x8f'),_0x3b7355,_0x5e3e38[0x0],_0x50be19);}else{_0x266992=_0x50be19;}}else{logger[_0xa15a('0x67')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x241995===_0xa15a('0x83')){_0x3f3356=_0x4b75a6[_0xa15a('0x7d')][_0xa15a('0x84')];_0x25db8f=_0x4b75a6['parameters'][_0xa15a('0x86')];if('undefined'!=typeof _0x4b75a6[_0xa15a('0x7d')]['views']){if(_0xa15a('0x22')!=typeof _0x4b75a6[_0xa15a('0x7d')][_0xa15a('0x80')]['admin']){var _0x45cf29=_0x4b75a6['parameters'][_0xa15a('0x80')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x45cf29)){_0x4d933f=path['join'](_0xa15a('0x8f'),_0x3b7355,_0x5e3e38[0x0],_0x45cf29);}else{_0x4d933f=_0x45cf29;}}if(_0xa15a('0x22')!=typeof _0x4b75a6[_0xa15a('0x7d')][_0xa15a('0x80')][_0xa15a('0x81')]){var _0x50be19=_0x4b75a6[_0xa15a('0x7d')]['views'][_0xa15a('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x50be19)){_0x266992=path['join'](_0xa15a('0x8f'),_0x3b7355,_0x5e3e38[0x0],_0x50be19);}else{_0x266992=_0x50be19;}}}}var _0x3d5571={'name':_0x3f4c01,'description':_0x59a978,'path':path[_0xa15a('0x52')](_0x3b7355,_0x5e3e38[0x0]),'type':_0x241995,'sidebar':_0x36cdbf,'icon':_0x2b68fa,'adminUrl':_0x4d933f,'agentUrl':_0x266992,'scriptName':_0x3f3356,'scriptPath':_0x25db8f,'version':_0x1555e8};removeReferences(_0x29eb8a,null);return db[_0xa15a('0x34')]['create'](_0x3d5571)['then'](function(_0x264f95){var _0x36327b={'role':_0xc2b2f2[_0xa15a('0x90')][_0xa15a('0x91')],'userProfileId':_0xc2b2f2['body'][_0xa15a('0x92')]};if(!_0x36327b)throw new Error(_0xa15a('0x93'));if(_0x36327b[_0xa15a('0x91')]===_0xa15a('0x94')){var _0x625915=_0x264f95['get']({'plain':!![]});return db[_0xa15a('0x95')]['find']({'where':{'name':_0xa15a('0x2c'),'userProfileId':_0x36327b[_0xa15a('0x92')]},'raw':!![]})[_0xa15a('0x29')](function(_0xf7d108){if(_0xf7d108&&_0xf7d108['autoAssociation']===0x0){return db['UserProfileResource'][_0xa15a('0x96')]({'name':_0x625915[_0xa15a('0x39')],'resourceId':_0x625915['id'],'type':_0xf7d108['name'],'sectionId':_0xf7d108['id']},{})['then'](function(){return _0x264f95;});}else{return _0x264f95;}})['catch'](function(_0xe0b031){logger[_0xa15a('0x2f')](_0xa15a('0x97'),_0xe0b031);throw _0xe0b031;});}return _0x264f95;})[_0xa15a('0x29')](respondWithResult(_0x47ffd4,null))['catch'](handleError(_0x47ffd4,null));}});}catch(_0x31f09f){_0x47ffd4['status'](0x1f4)[_0xa15a('0x31')](_0x31f09f);}};function removeReferences(_0x651cd7,_0xe061e1){try{if(_0x651cd7){fs[_0xa15a('0x66')](_0x651cd7);logger['info'](_0xa15a('0x98'));}if(_0xe061e1){rimraf(_0xe061e1,function(){});logger[_0xa15a('0x67')](_0xa15a('0x99'));}}catch(_0x1030d6){logger[_0xa15a('0x2f')](_0x1030d6);}}exports[_0xa15a('0x28')]=function(_0x1d70a6,_0x132def,_0x4b4db4){return db[_0xa15a('0x34')][_0xa15a('0x4f')]({'where':{'id':_0x1d70a6[_0xa15a('0x51')]['id']}})[_0xa15a('0x29')](handleEntityNotFound(_0x132def,null))[_0xa15a('0x29')](saveUpdates(_0x1d70a6[_0xa15a('0x90')],null))[_0xa15a('0x29')](respondWithResult(_0x132def,null))[_0xa15a('0x4b')](handleError(_0x132def,null));};exports[_0xa15a('0x9a')]=function(_0x4eda79,_0x530206,_0x18e72f){return db[_0xa15a('0x34')][_0xa15a('0x4f')]({'where':{'id':_0x4eda79[_0xa15a('0x51')]['id']}})[_0xa15a('0x29')](function(_0x12a1e3){if(_0x12a1e3){return _0x12a1e3[_0xa15a('0x2a')]();}})[_0xa15a('0x29')](function(_0x1cb8c2){rimraf(path[_0xa15a('0x52')](config[_0xa15a('0x53')],'server/files/plugins',path[_0xa15a('0x5e')](_0x1cb8c2['path'])),function(){});return _0x1cb8c2;})['then'](handleEntityNotFound(_0x530206,null))['then'](respondWithStatusCode(_0x530206,null))['catch'](handleError(_0x530206,null));};exports['webhookGet']=function(_0x1258c1,_0x165863,_0x37aaae){return BPromise[_0xa15a('0x9b')]()[_0xa15a('0x29')](function(){if(!_0x1258c1[_0xa15a('0x3a')][_0xa15a('0x7')]){throw new Error(_0xa15a('0x9c'));}if(!_0x1258c1[_0xa15a('0x3a')][_0xa15a('0x9d')]){throw new Error(_0xa15a('0x9e'));}var _0x213d87=_0x1258c1['query'][_0xa15a('0x9f')]?_0x1258c1[_0xa15a('0x3a')][_0xa15a('0x9f')]+':'+_0x1258c1['query']['port']:'http://localhost:'+_0x1258c1[_0xa15a('0x3a')][_0xa15a('0x9d')];var _0x3029c0=_0x1258c1[_0xa15a('0x3a')][_0xa15a('0x20')]?_0x1258c1['query'][_0xa15a('0x20')]:!![];var _0x523323=_0x1258c1[_0xa15a('0x3a')][_0xa15a('0xa0')]?_0x1258c1[_0xa15a('0x3a')][_0xa15a('0xa0')]:null;var _0x1a992c={'method':_0x1258c1[_0xa15a('0xa1')],'uri':util['format'](_0xa15a('0xa2'),_0x213d87,_0x1258c1[_0xa15a('0x3a')][_0xa15a('0x7')]),'json':_0x3029c0,'resolveWithFullResponse':!![],'encoding':_0x523323,'qs':_0x1258c1[_0xa15a('0x3a')]};if(_0x1258c1[_0xa15a('0xa3')]){_0x1a992c['headers']=_0x1258c1[_0xa15a('0xa3')];if(_0x1a992c[_0xa15a('0xa3')][_0xa15a('0xa4')]){delete _0x1a992c[_0xa15a('0xa3')][_0xa15a('0xa4')];}}if(_0x1a992c[_0xa15a('0xa3')][_0xa15a('0xa5')]){delete _0x1a992c[_0xa15a('0xa3')][_0xa15a('0xa5')];}return rp(_0x1a992c);})['then'](function(_0x33129b){if(_0x33129b){_0x165863['set'](_0x33129b['headers']);logger[_0xa15a('0x67')](_0x33129b[_0xa15a('0x90')]);if(_['endsWith'](_0x1258c1[_0xa15a('0x3a')]['path'],'download')&&_0x33129b[_0xa15a('0xa6')]==0x1f4){return _0x165863[_0xa15a('0x2e')](_0x33129b[_0xa15a('0xa6')]);}else{return _0x165863[_0xa15a('0x1e')](_0x33129b[_0xa15a('0xa6')])[_0xa15a('0x31')](_0x33129b[_0xa15a('0x90')]);}}else{return _0x165863[_0xa15a('0x2e')](0xc8);}})[_0xa15a('0x4b')](handleError(_0x165863,null));};exports[_0xa15a('0xa7')]=function(_0x3392e1,_0x527802,_0xc50f96){return BPromise['resolve']()[_0xa15a('0x29')](function(){if(!_0x3392e1[_0xa15a('0x3a')][_0xa15a('0x7')]){throw new Error(_0xa15a('0x9c'));}if(!_0x3392e1[_0xa15a('0x3a')][_0xa15a('0x9d')]){throw new Error(_0xa15a('0x9e'));}var _0x31b935=_0x3392e1[_0xa15a('0x3a')][_0xa15a('0x9f')]?_0x3392e1[_0xa15a('0x3a')][_0xa15a('0x9f')]+':'+_0x3392e1['query'][_0xa15a('0x9d')]:_0xa15a('0xa8')+_0x3392e1['query'][_0xa15a('0x9d')];var _0x368d50=_0x3392e1[_0xa15a('0x3a')][_0xa15a('0x20')]?_0x3392e1['query'][_0xa15a('0x20')]:!![];var _0x2496ec=_0x3392e1[_0xa15a('0x3a')][_0xa15a('0xa0')]?_0x3392e1[_0xa15a('0x3a')][_0xa15a('0xa0')]:null;var _0x52a6d6={'method':_0x3392e1['method'],'uri':util['format'](_0xa15a('0xa2'),_0x31b935,_0x3392e1[_0xa15a('0x3a')]['path']),'json':_0x368d50,'resolveWithFullResponse':!![],'encoding':_0x2496ec,'body':_0x3392e1[_0xa15a('0x90')]};if(_0x3392e1['headers']){_0x52a6d6[_0xa15a('0xa3')]=_0x3392e1['headers'];if(_0x52a6d6[_0xa15a('0xa3')][_0xa15a('0xa4')]){delete _0x52a6d6[_0xa15a('0xa3')]['content-length'];}}if(_0x52a6d6[_0xa15a('0xa3')][_0xa15a('0xa5')]){delete _0x52a6d6[_0xa15a('0xa3')]['content-type'];}return rp(_0x52a6d6);})[_0xa15a('0x29')](function(_0x255417){if(_0x255417){_0x527802[_0xa15a('0x25')](_0x255417[_0xa15a('0xa3')]);logger[_0xa15a('0x67')](_0x255417['body']);return _0x527802[_0xa15a('0x1e')](_0x255417[_0xa15a('0xa6')])[_0xa15a('0x31')](_0x255417[_0xa15a('0x90')]);}else{return _0x527802[_0xa15a('0x2e')](0xc8);}})[_0xa15a('0x4b')](handleError(_0x527802,null));}; \ No newline at end of file +var _0x74f2=['stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Plugin','includeAll','include','findAll','rows','catch','show','params','find','root','format','%s.zip','createWriteStream','code','ENOENT','Error','Sequelize','pipe','glob','**/*','dirname','join','basename','node_modules/**/*','attachments/**/*','finalize','existsSync','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','upload','file','filename','server/files/plugins','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','readFileSync','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','always','icon','icon-apps','views','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','port','hostname','encoding','method','%s%s','headers','content-type','download','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','content-length','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./plugin.socket','sendStatus','end','status','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','get','UserProfileResource','error'];(function(_0x275205,_0x55be8d){var _0x1b604a=function(_0x40576f){while(--_0x40576f){_0x275205['push'](_0x275205['shift']());}};_0x1b604a(++_0x55be8d);}(_0x74f2,0x7b));var _0x274f=function(_0x187714,_0x47e830){_0x187714=_0x187714-0x0;var _0x1438bb=_0x74f2[_0x187714];return _0x1438bb;};'use strict';var emlformat=require(_0x274f('0x0'));var rimraf=require(_0x274f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x274f('0x2'));var rp=require(_0x274f('0x3'));var moment=require(_0x274f('0x4'));var BPromise=require(_0x274f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x274f('0x6'));var sox=require(_0x274f('0x7'));var csv=require(_0x274f('0x8'));var ejs=require(_0x274f('0x9'));var fs=require('fs');var fs_extra=require(_0x274f('0xa'));var _=require(_0x274f('0xb'));var squel=require(_0x274f('0xc'));var crypto=require('crypto');var jsforce=require(_0x274f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x274f('0x8'));var querystring=require(_0x274f('0xe'));var Papa=require('papaparse');var extract=require(_0x274f('0xf'));var rimraf=require(_0x274f('0x1'));var archiver=require(_0x274f('0x10'));var Redis=require(_0x274f('0x11'));var authService=require(_0x274f('0x12'));var qs=require(_0x274f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x274f('0x14'))(_0x274f('0x15'));var utils=require(_0x274f('0x16'));var config=require(_0x274f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x274f('0x18'))['db'];config[_0x274f('0x19')]=_[_0x274f('0x1a')](config[_0x274f('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x274f('0x1b'))(new Redis(config[_0x274f('0x19')]));require(_0x274f('0x1c'))['register'](socket);function respondWithStatusCode(_0x36e6ee,_0x3919e6){_0x3919e6=_0x3919e6||0xcc;return function(_0x441246){if(_0x441246){return _0x36e6ee[_0x274f('0x1d')](_0x3919e6);}return _0x36e6ee['status'](_0x3919e6)[_0x274f('0x1e')]();};}function respondWithResult(_0xc1073a,_0x3e389f){_0x3e389f=_0x3e389f||0xc8;return function(_0x14374c){if(_0x14374c){return _0xc1073a[_0x274f('0x1f')](_0x3e389f)['json'](_0x14374c);}};}function respondWithFilteredResult(_0x2d6967,_0x2ba134){return function(_0x2431cc){if(_0x2431cc){var _0x157849=typeof _0x2ba134[_0x274f('0x20')]==='undefined'&&typeof _0x2ba134[_0x274f('0x21')]===_0x274f('0x22');var _0x468792=_0x2431cc[_0x274f('0x23')];var _0x43fb90=_0x157849?0x0:_0x2ba134[_0x274f('0x20')];var _0x921054=_0x157849?_0x2431cc[_0x274f('0x23')]:_0x2ba134['offset']+_0x2ba134[_0x274f('0x21')];var _0x45df62;if(_0x921054>=_0x468792){_0x921054=_0x468792;_0x45df62=0xc8;}else{_0x45df62=0xce;}_0x2d6967[_0x274f('0x1f')](_0x45df62);return _0x2d6967[_0x274f('0x24')]('Content-Range',_0x43fb90+'-'+_0x921054+'/'+_0x468792)[_0x274f('0x25')](_0x2431cc);}return null;};}function patchUpdates(_0x1a6aa0){return function(_0x14a188){try{jsonpatch[_0x274f('0x26')](_0x14a188,_0x1a6aa0,!![]);}catch(_0x5f2eba){return BPromise[_0x274f('0x27')](_0x5f2eba);}return _0x14a188[_0x274f('0x28')]();};}function saveUpdates(_0x56728,_0x4a1e20){return function(_0xedda87){if(_0xedda87){return _0xedda87[_0x274f('0x29')](_0x56728)[_0x274f('0x2a')](function(_0x499e65){return _0x499e65;});}return null;};}function removeEntity(_0x6382fe,_0x3af7c2){return function(_0x2d017c){if(_0x2d017c){return _0x2d017c[_0x274f('0x2b')]()[_0x274f('0x2a')](function(){var _0x24e515=_0x2d017c[_0x274f('0x2c')]({'plain':!![]});var _0x501f5c='Plugins';return db[_0x274f('0x2d')][_0x274f('0x2b')]({'where':{'type':_0x501f5c,'resourceId':_0x24e515['id']}})['then'](function(){return _0x2d017c;});})['then'](function(){_0x6382fe[_0x274f('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3166d6,_0x510476){return function(_0x5cbd00){if(!_0x5cbd00){_0x3166d6['sendStatus'](0x194);}return _0x5cbd00;};}function handleError(_0x487ba2,_0x80be96){_0x80be96=_0x80be96||0x1f4;return function(_0x9dae3f){logger[_0x274f('0x2e')](_0x9dae3f[_0x274f('0x2f')]);if(_0x9dae3f[_0x274f('0x30')]){delete _0x9dae3f[_0x274f('0x30')];}_0x487ba2[_0x274f('0x1f')](_0x80be96)[_0x274f('0x31')](_0x9dae3f);};}exports[_0x274f('0x32')]=function(_0xf123f,_0xa4a4a0){var _0x378a1a={},_0x5415f2={},_0x6dd7fb={'count':0x0,'rows':[]};var _0x29b001=_[_0x274f('0x33')](db['Plugin'][_0x274f('0x34')],function(_0x2ecc8c){return{'name':_0x2ecc8c[_0x274f('0x35')],'type':_0x2ecc8c[_0x274f('0x36')][_0x274f('0x37')]};});_0x5415f2[_0x274f('0x38')]=_[_0x274f('0x33')](_0x29b001,_0x274f('0x30'));_0x5415f2[_0x274f('0x39')]=_[_0x274f('0x3a')](_0xf123f[_0x274f('0x39')]);_0x5415f2[_0x274f('0x3b')]=_[_0x274f('0x3c')](_0x5415f2[_0x274f('0x38')],_0x5415f2[_0x274f('0x39')]);_0x378a1a['attributes']=_['intersection'](_0x5415f2[_0x274f('0x38')],qs[_0x274f('0x3d')](_0xf123f[_0x274f('0x39')][_0x274f('0x3d')]));_0x378a1a[_0x274f('0x3e')]=_0x378a1a[_0x274f('0x3e')][_0x274f('0x3f')]?_0x378a1a['attributes']:_0x5415f2['model'];if(!_0xf123f['query'][_0x274f('0x40')]('nolimit')){_0x378a1a[_0x274f('0x21')]=qs['limit'](_0xf123f['query'][_0x274f('0x21')]);_0x378a1a['offset']=qs[_0x274f('0x20')](_0xf123f[_0x274f('0x39')][_0x274f('0x20')]);}_0x378a1a[_0x274f('0x41')]=qs[_0x274f('0x42')](_0xf123f[_0x274f('0x39')][_0x274f('0x42')]);_0x378a1a[_0x274f('0x43')]=qs['filters'](_[_0x274f('0x44')](_0xf123f[_0x274f('0x39')],_0x5415f2[_0x274f('0x3b')]),_0x29b001);if(_0xf123f[_0x274f('0x39')][_0x274f('0x45')]){_0x378a1a[_0x274f('0x43')]=_[_0x274f('0x46')](_0x378a1a[_0x274f('0x43')],{'$or':_[_0x274f('0x33')](_0x29b001,function(_0x4f321b){if(_0x4f321b[_0x274f('0x36')]!==_0x274f('0x47')){var _0x28fb0a={};_0x28fb0a[_0x4f321b[_0x274f('0x30')]]={'$like':'%'+_0xf123f['query']['filter']+'%'};return _0x28fb0a;}})});}_0x378a1a=_[_0x274f('0x46')]({},_0x378a1a,_0xf123f[_0x274f('0x48')]);var _0x5a3ab0={'where':_0x378a1a[_0x274f('0x43')]};return db[_0x274f('0x49')]['count'](_0x5a3ab0)[_0x274f('0x2a')](function(_0x2e6229){_0x6dd7fb[_0x274f('0x23')]=_0x2e6229;if(_0xf123f[_0x274f('0x39')][_0x274f('0x4a')]){_0x378a1a[_0x274f('0x4b')]=[{'all':!![]}];}return db[_0x274f('0x49')][_0x274f('0x4c')](_0x378a1a);})[_0x274f('0x2a')](function(_0x53ca68){_0x6dd7fb[_0x274f('0x4d')]=_0x53ca68;return _0x6dd7fb;})[_0x274f('0x2a')](respondWithFilteredResult(_0xa4a4a0,_0x378a1a))[_0x274f('0x4e')](handleError(_0xa4a4a0,null));};exports[_0x274f('0x4f')]=function(_0x419e75,_0x5eefe4){var _0x3cbc9f={'raw':!![],'where':{'id':_0x419e75[_0x274f('0x50')]['id']}},_0x3f2726={};_0x3f2726[_0x274f('0x38')]=_[_0x274f('0x3a')](db[_0x274f('0x49')][_0x274f('0x34')]);_0x3f2726[_0x274f('0x39')]=_[_0x274f('0x3a')](_0x419e75[_0x274f('0x39')]);_0x3f2726[_0x274f('0x3b')]=_[_0x274f('0x3c')](_0x3f2726['model'],_0x3f2726['query']);_0x3cbc9f['attributes']=_['intersection'](_0x3f2726[_0x274f('0x38')],qs[_0x274f('0x3d')](_0x419e75[_0x274f('0x39')][_0x274f('0x3d')]));_0x3cbc9f[_0x274f('0x3e')]=_0x3cbc9f['attributes'][_0x274f('0x3f')]?_0x3cbc9f[_0x274f('0x3e')]:_0x3f2726[_0x274f('0x38')];if(_0x419e75[_0x274f('0x39')]['includeAll']){_0x3cbc9f['include']=[{'all':!![]}];}_0x3cbc9f=_[_0x274f('0x46')]({},_0x3cbc9f,_0x419e75['options']);return db[_0x274f('0x49')][_0x274f('0x51')](_0x3cbc9f)['then'](handleEntityNotFound(_0x5eefe4,null))[_0x274f('0x2a')](respondWithResult(_0x5eefe4,null))[_0x274f('0x4e')](handleError(_0x5eefe4,null));};exports['download']=function(_0x2d66c1,_0x940c14,_0x1432cd){return db[_0x274f('0x49')][_0x274f('0x51')]({'where':{'id':_0x2d66c1[_0x274f('0x50')]['id']},'attributes':[_0x274f('0x30'),_0x274f('0x6')],'raw':!![]})['then'](handleEntityNotFound(_0x940c14,null))[_0x274f('0x2a')](function(_0x3e2423){if(_0x3e2423){var _0x571c28=path['join'](config[_0x274f('0x52')],'server/files/plugins',util[_0x274f('0x53')](_0x274f('0x54'),path['basename'](_0x3e2423[_0x274f('0x6')])));var _0x137db0=fs[_0x274f('0x55')](_0x571c28);var _0xa335db=archiver('zip',{'zlib':{'level':0x9}});_0xa335db['on']('warning',function(_0x48fc5d){if(_0x48fc5d[_0x274f('0x56')]===_0x274f('0x57')){logger['error'](_0x48fc5d);}else{throw new db['Sequelize'][(_0x274f('0x58'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0xa335db['on'](_0x274f('0x2e'),function(_0x553db1){throw new db[(_0x274f('0x59'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0xa335db[_0x274f('0x5a')](_0x137db0);_0xa335db[_0x274f('0x5b')](_0x274f('0x5c'),{'cwd':path['join'](config['root'],'server/files/plugins',path[_0x274f('0x5d')](_0x3e2423['path'])),'ignore':[path[_0x274f('0x5e')](path[_0x274f('0x5f')](_0x3e2423[_0x274f('0x6')]),_0x274f('0x60')),path[_0x274f('0x5e')](path['basename'](_0x3e2423[_0x274f('0x6')]),_0x274f('0x61'))],'nodir':!![]})[_0x274f('0x62')]();_0x137db0['on']('close',function(){if(!fs[_0x274f('0x63')](_0x571c28)){throw new db['Sequelize']['Error']('Plugin\x20not\x20found');}return _0x940c14['download'](_0x571c28,util[_0x274f('0x53')](_0x274f('0x54'),path[_0x274f('0x5f')](_0x3e2423['path'])),function(_0x50ffbc){if(_0x50ffbc){throw new db[(_0x274f('0x59'))][(_0x274f('0x58'))](_0x274f('0x64'));}fs[_0x274f('0x65')](_0x571c28);logger['info'](_0x274f('0x66'));logger[_0x274f('0x67')](_0x274f('0x68'));});});}return null;})[_0x274f('0x4e')](handleError(_0x940c14,null));};exports[_0x274f('0x69')]=function(_0x239038,_0x338c48,_0x2b4e93){var _0x339245=path[_0x274f('0x5f')](_0x239038[_0x274f('0x6a')][_0x274f('0x6b')],path['extname'](_0x239038[_0x274f('0x6a')][_0x274f('0x6b')]));var _0x5f446e=path[_0x274f('0x5e')](config[_0x274f('0x52')],_0x274f('0x6c'),_0x239038[_0x274f('0x6a')][_0x274f('0x6b')]);var _0xfa0f9f=path[_0x274f('0x5e')](config[_0x274f('0x52')],'server/files/plugins',_0x339245);logger[_0x274f('0x67')](_0x274f('0x6d'),_0x5f446e);logger[_0x274f('0x67')](_0x274f('0x6e'),_0xfa0f9f);try{fs[_0x274f('0x6f')](_0x5f446e,parseInt('0777',0x8));extract(_0x5f446e,{'dir':_0xfa0f9f},function(_0x2cc6ed){if(_0x2cc6ed){logger['error'](_0x2cc6ed);handleError(_0x2cc6ed,!![]);};var _0x2438ac=fs['readdirSync'](_0xfa0f9f);if(_0x2438ac[_0x274f('0x3f')]>0x1){removeReferences(_0x5f446e,_0xfa0f9f);logger[_0x274f('0x2e')](_0x274f('0x70'));return _0x2b4e93(new Error(_0x274f('0x70')));}var _0x11ad40=fs[_0x274f('0x71')](path[_0x274f('0x5e')](_0xfa0f9f,_0x2438ac[0x0]));if(_0x11ad40[_0x274f('0x72')]()){removeReferences(_0x5f446e,_0xfa0f9f);logger[_0x274f('0x2e')](_0x274f('0x70'));return _0x2b4e93(new Error(_0x274f('0x70')));}if(_0x11ad40[_0x274f('0x73')]()){var _0xe39eb3=fs[_0x274f('0x74')](path[_0x274f('0x5e')](_0xfa0f9f,_0x2438ac[0x0]));if(_0xe39eb3[_0x274f('0x3f')]===0x0){removeReferences(_0x5f446e,_0xfa0f9f);logger['error']('Invalid\x20plugin\x20structure');return _0x2b4e93(new Error('Invalid\x20plugin\x20structure'));}var _0x2caa7a=_0xe39eb3[_0x274f('0x75')](function(_0x5464a3){return _0x5464a3===_0x274f('0x76');});if(!_0x2caa7a){return _0x2b4e93(new Error('Plugin\x20manifest\x20missing'));}var _0x93d53=fs[_0x274f('0x77')](path[_0x274f('0x5e')](_0xfa0f9f,_0x2438ac[0x0],_0x274f('0x76')));var _0x1cba00=JSON['parse'](_0x93d53);if('undefined'==typeof _0x1cba00['name']){return _0x2b4e93(new Error(_0x274f('0x78')));}if('undefined'==typeof _0x1cba00[_0x274f('0x36')]){return _0x2b4e93(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x274f('0x22')==typeof _0x1cba00[_0x274f('0x79')]){return _0x2b4e93(new Error(_0x274f('0x7a')));}if(_0x274f('0x22')==typeof _0x1cba00[_0x274f('0x7b')]){return _0x2b4e93(new Error(_0x274f('0x7c')));}if(_0x1cba00[_0x274f('0x36')]===_0x274f('0x7d')){if(_0x274f('0x22')==typeof _0x1cba00[_0x274f('0x7b')]['views']){return _0x2b4e93(new Error(_0x274f('0x7e')));}if(_0x274f('0x22')==typeof _0x1cba00[_0x274f('0x7b')]['views'][_0x274f('0x7f')]&&_0x274f('0x22')==typeof _0x1cba00[_0x274f('0x7b')]['views'][_0x274f('0x80')]){return _0x2b4e93(new Error(_0x274f('0x81')));}}else if(_0x1cba00[_0x274f('0x36')]===_0x274f('0x82')){if('undefined'==typeof _0x1cba00['parameters']['scriptName']){return _0x2b4e93(new Error(_0x274f('0x83')));}if(_0x274f('0x22')==typeof _0x1cba00[_0x274f('0x7b')]['scriptPath']){return _0x2b4e93(new Error(_0x274f('0x84')));}}else{return _0x2b4e93(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0xe6ba09=_0x1cba00['name'];var _0x426db2=_0x1cba00['description'];var _0x118813=_0x1cba00[_0x274f('0x36')];var _0x129ecf=_0x1cba00['sidebar']?_0x1cba00['sidebar']:_0x274f('0x85');var _0x2ac1cb=_0x1cba00[_0x274f('0x86')]?_0x1cba00[_0x274f('0x86')]:_0x274f('0x87');var _0x348fab='';var _0x224092='';var _0x32edb9='';var _0x2cc49f='';var _0x328628=_0x1cba00[_0x274f('0x79')];if(_0x118813===_0x274f('0x7d')){if('undefined'!=typeof _0x1cba00[_0x274f('0x7b')][_0x274f('0x88')][_0x274f('0x7f')]){var _0x5e0d82=_0x1cba00['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x274f('0x89')](_0x5e0d82)){_0x348fab=path['join']('plugins',_0x339245,_0x2438ac[0x0],_0x5e0d82);}else{_0x348fab=_0x5e0d82;}}else{logger[_0x274f('0x67')](_0x274f('0x8a'));}if(_0x274f('0x22')!=typeof _0x1cba00[_0x274f('0x7b')]['views']['agent']){var _0x5c4f94=_0x1cba00[_0x274f('0x7b')][_0x274f('0x88')][_0x274f('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x274f('0x89')](_0x5c4f94)){_0x224092=path[_0x274f('0x5e')](_0x274f('0x8b'),_0x339245,_0x2438ac[0x0],_0x5c4f94);}else{_0x224092=_0x5c4f94;}}else{logger[_0x274f('0x67')](_0x274f('0x8c'));}}else if(_0x118813===_0x274f('0x82')){_0x32edb9=_0x1cba00['parameters'][_0x274f('0x8d')];_0x2cc49f=_0x1cba00[_0x274f('0x7b')]['scriptPath'];if(_0x274f('0x22')!=typeof _0x1cba00[_0x274f('0x7b')][_0x274f('0x88')]){if('undefined'!=typeof _0x1cba00[_0x274f('0x7b')][_0x274f('0x88')][_0x274f('0x7f')]){var _0x5e0d82=_0x1cba00['parameters'][_0x274f('0x88')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5e0d82)){_0x348fab=path[_0x274f('0x5e')]('plugins',_0x339245,_0x2438ac[0x0],_0x5e0d82);}else{_0x348fab=_0x5e0d82;}}if(_0x274f('0x22')!=typeof _0x1cba00[_0x274f('0x7b')][_0x274f('0x88')][_0x274f('0x80')]){var _0x5c4f94=_0x1cba00[_0x274f('0x7b')][_0x274f('0x88')][_0x274f('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5c4f94)){_0x224092=path['join']('plugins',_0x339245,_0x2438ac[0x0],_0x5c4f94);}else{_0x224092=_0x5c4f94;}}}}var _0x4118b2={'name':_0xe6ba09,'description':_0x426db2,'path':path[_0x274f('0x5e')](_0x339245,_0x2438ac[0x0]),'type':_0x118813,'sidebar':_0x129ecf,'icon':_0x2ac1cb,'adminUrl':_0x348fab,'agentUrl':_0x224092,'scriptName':_0x32edb9,'scriptPath':_0x2cc49f,'version':_0x328628};removeReferences(_0x5f446e,null);return db[_0x274f('0x49')][_0x274f('0x8e')](_0x4118b2)[_0x274f('0x2a')](function(_0x200c8e){var _0x40833f={'role':_0x239038[_0x274f('0x8f')][_0x274f('0x90')],'userProfileId':_0x239038['body'][_0x274f('0x91')]};if(!_0x40833f)throw new Error(_0x274f('0x92'));if(_0x40833f[_0x274f('0x90')]===_0x274f('0x93')){var _0x5a24a1=_0x200c8e['get']({'plain':!![]});return db[_0x274f('0x94')]['find']({'where':{'name':'Plugins','userProfileId':_0x40833f[_0x274f('0x91')]},'raw':!![]})[_0x274f('0x2a')](function(_0x46ad1c){if(_0x46ad1c&&_0x46ad1c[_0x274f('0x95')]===0x0){return db['UserProfileResource'][_0x274f('0x8e')]({'name':_0x5a24a1['name'],'resourceId':_0x5a24a1['id'],'type':_0x46ad1c[_0x274f('0x30')],'sectionId':_0x46ad1c['id']},{})[_0x274f('0x2a')](function(){return _0x200c8e;});}else{return _0x200c8e;}})[_0x274f('0x4e')](function(_0x35e56b){logger[_0x274f('0x2e')](_0x274f('0x96'),_0x35e56b);throw _0x35e56b;});}return _0x200c8e;})['then'](respondWithResult(_0x338c48,null))[_0x274f('0x4e')](handleError(_0x338c48,null));}});}catch(_0x177548){_0x338c48[_0x274f('0x1f')](0x1f4)[_0x274f('0x31')](_0x177548);}};function removeReferences(_0x399fc8,_0x91506){try{if(_0x399fc8){fs[_0x274f('0x65')](_0x399fc8);logger[_0x274f('0x67')](_0x274f('0x97'));}if(_0x91506){rimraf(_0x91506,function(){});logger['info'](_0x274f('0x98'));}}catch(_0x317d6b){logger[_0x274f('0x2e')](_0x317d6b);}}exports[_0x274f('0x29')]=function(_0x1e8804,_0x5611c5,_0x430469){return db[_0x274f('0x49')][_0x274f('0x51')]({'where':{'id':_0x1e8804[_0x274f('0x50')]['id']}})['then'](handleEntityNotFound(_0x5611c5,null))[_0x274f('0x2a')](saveUpdates(_0x1e8804[_0x274f('0x8f')],null))[_0x274f('0x2a')](respondWithResult(_0x5611c5,null))[_0x274f('0x4e')](handleError(_0x5611c5,null));};exports[_0x274f('0x99')]=function(_0x3c3152,_0x157a3a,_0x71aabd){return db[_0x274f('0x49')][_0x274f('0x51')]({'where':{'id':_0x3c3152['params']['id']}})[_0x274f('0x2a')](function(_0x14b268){if(_0x14b268){return _0x14b268[_0x274f('0x2b')]();}})[_0x274f('0x2a')](function(_0xa576e1){rimraf(path[_0x274f('0x5e')](config['root'],_0x274f('0x6c'),path[_0x274f('0x5d')](_0xa576e1['path'])),function(){});return _0xa576e1;})['then'](handleEntityNotFound(_0x157a3a,null))[_0x274f('0x2a')](respondWithStatusCode(_0x157a3a,null))[_0x274f('0x4e')](handleError(_0x157a3a,null));};exports[_0x274f('0x9a')]=function(_0xf37107,_0x302182,_0x4ddfa5){return BPromise[_0x274f('0x9b')]()[_0x274f('0x2a')](function(){if(!_0xf37107[_0x274f('0x39')][_0x274f('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0xf37107[_0x274f('0x39')][_0x274f('0x9c')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2a0620=_0xf37107[_0x274f('0x39')]['hostname']?_0xf37107[_0x274f('0x39')][_0x274f('0x9d')]+':'+_0xf37107[_0x274f('0x39')][_0x274f('0x9c')]:'http://localhost:'+_0xf37107['query'][_0x274f('0x9c')];var _0x564bde=_0xf37107[_0x274f('0x39')][_0x274f('0x25')]?_0xf37107[_0x274f('0x39')][_0x274f('0x25')]:!![];var _0xf253bd=_0xf37107[_0x274f('0x39')][_0x274f('0x9e')]?_0xf37107[_0x274f('0x39')][_0x274f('0x9e')]:null;var _0x68fb3e={'method':_0xf37107[_0x274f('0x9f')],'uri':util['format'](_0x274f('0xa0'),_0x2a0620,_0xf37107[_0x274f('0x39')]['path']),'json':_0x564bde,'resolveWithFullResponse':!![],'encoding':_0xf253bd,'qs':_0xf37107[_0x274f('0x39')]};if(_0xf37107[_0x274f('0xa1')]){_0x68fb3e[_0x274f('0xa1')]=_0xf37107['headers'];if(_0x68fb3e[_0x274f('0xa1')]['content-length']){delete _0x68fb3e['headers']['content-length'];}}if(_0x68fb3e[_0x274f('0xa1')][_0x274f('0xa2')]){delete _0x68fb3e[_0x274f('0xa1')][_0x274f('0xa2')];}return rp(_0x68fb3e);})[_0x274f('0x2a')](function(_0x1efc00){if(_0x1efc00){_0x302182[_0x274f('0x24')](_0x1efc00[_0x274f('0xa1')]);logger['info'](_0x1efc00[_0x274f('0x8f')]);if(_['endsWith'](_0xf37107[_0x274f('0x39')][_0x274f('0x6')],_0x274f('0xa3'))&&_0x1efc00[_0x274f('0xa4')]==0x1f4){return _0x302182['sendStatus'](_0x1efc00[_0x274f('0xa4')]);}else{return _0x302182[_0x274f('0x1f')](_0x1efc00[_0x274f('0xa4')])[_0x274f('0x31')](_0x1efc00[_0x274f('0x8f')]);}}else{return _0x302182[_0x274f('0x1d')](0xc8);}})['catch'](handleError(_0x302182,null));};exports[_0x274f('0xa5')]=function(_0x471314,_0x2636ee,_0x2657dc){return BPromise[_0x274f('0x9b')]()[_0x274f('0x2a')](function(){if(!_0x471314[_0x274f('0x39')]['path']){throw new Error(_0x274f('0xa6'));}if(!_0x471314[_0x274f('0x39')]['port']){throw new Error(_0x274f('0xa7'));}var _0xfedee2=_0x471314[_0x274f('0x39')][_0x274f('0x9d')]?_0x471314[_0x274f('0x39')]['hostname']+':'+_0x471314[_0x274f('0x39')][_0x274f('0x9c')]:_0x274f('0xa8')+_0x471314[_0x274f('0x39')][_0x274f('0x9c')];var _0x34698b=_0x471314[_0x274f('0x39')]['json']?_0x471314[_0x274f('0x39')]['json']:!![];var _0x2c3c16=_0x471314[_0x274f('0x39')][_0x274f('0x9e')]?_0x471314['query'][_0x274f('0x9e')]:null;var _0x2e9e45={'method':_0x471314[_0x274f('0x9f')],'uri':util[_0x274f('0x53')](_0x274f('0xa0'),_0xfedee2,_0x471314[_0x274f('0x39')][_0x274f('0x6')]),'json':_0x34698b,'resolveWithFullResponse':!![],'encoding':_0x2c3c16,'body':_0x471314[_0x274f('0x8f')]};if(_0x471314['headers']){_0x2e9e45[_0x274f('0xa1')]=_0x471314['headers'];if(_0x2e9e45[_0x274f('0xa1')]['content-length']){delete _0x2e9e45[_0x274f('0xa1')][_0x274f('0xa9')];}}if(_0x2e9e45['headers'][_0x274f('0xa2')]){delete _0x2e9e45[_0x274f('0xa1')][_0x274f('0xa2')];}return rp(_0x2e9e45);})['then'](function(_0x1b0450){if(_0x1b0450){_0x2636ee[_0x274f('0x24')](_0x1b0450[_0x274f('0xa1')]);logger[_0x274f('0x67')](_0x1b0450[_0x274f('0x8f')]);return _0x2636ee['status'](_0x1b0450[_0x274f('0xa4')])[_0x274f('0x31')](_0x1b0450['body']);}else{return _0x2636ee[_0x274f('0x1d')](0xc8);}})[_0x274f('0x4e')](handleError(_0x2636ee,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index ccaa398..f3fc824 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 _0x4cfd=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5f2f6f,_0x183d02){var _0x506478=function(_0x1ffc9){while(--_0x1ffc9){_0x5f2f6f['push'](_0x5f2f6f['shift']());}};_0x506478(++_0x183d02);}(_0x4cfd,0x170));var _0xd4cf=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x4cfd[_0x47fd36];return _0x21a0fc;};'use strict';var EventEmitter=require(_0xd4cf('0x0'));var Plugin=require(_0xd4cf('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xd4cf('0x2')](0x0);var events={'afterCreate':_0xd4cf('0x3'),'afterUpdate':_0xd4cf('0x4'),'afterDestroy':_0xd4cf('0x5')};function emitEvent(_0x332f55){return function(_0xe90497,_0x4e6f40,_0x1b69e1){PluginEvents[_0xd4cf('0x6')](_0x332f55+':'+_0xe90497['id'],_0xe90497);PluginEvents[_0xd4cf('0x6')](_0x332f55,_0xe90497);_0x1b69e1(null);};}for(var e in events){if(events[_0xd4cf('0x7')](e)){var event=events[e];Plugin[_0xd4cf('0x8')](e,emitEvent(event));}}module[_0xd4cf('0x9')]=PluginEvents; \ No newline at end of file +var _0x9536=['../../mysqldb','Plugin','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x9536,0x179));var _0x6953=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9536[_0xdea41a];return _0x15d0d8;};'use strict';var EventEmitter=require(_0x6953('0x0'));var Plugin=require(_0x6953('0x1'))['db'][_0x6953('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x6953('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6953('0x4'),'afterDestroy':'remove'};function emitEvent(_0x42fb54){return function(_0x3c32c7,_0x1dee7c,_0x3ba964){PluginEvents[_0x6953('0x5')](_0x42fb54+':'+_0x3c32c7['id'],_0x3c32c7);PluginEvents['emit'](_0x42fb54,_0x3c32c7);_0x3ba964(null);};}for(var e in events){if(events[_0x6953('0x6')](e)){var event=events[e];Plugin[_0x6953('0x7')](e,emitEvent(event));}}module[_0x6953('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 5695b02..db18c59 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 _0x1b6a=['path','rimraf','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','moment'];(function(_0x3753ac,_0x3ada46){var _0x3e57c6=function(_0x48aa58){while(--_0x48aa58){_0x3753ac['push'](_0x3753ac['shift']());}};_0x3e57c6(++_0x3ada46);}(_0x1b6a,0xe3));var _0xa1b6=function(_0x17e22e,_0x4fa092){_0x17e22e=_0x17e22e-0x0;var _0x4b0914=_0x1b6a[_0x17e22e];return _0x4b0914;};'use strict';var _=require(_0xa1b6('0x0'));var util=require(_0xa1b6('0x1'));var logger=require(_0xa1b6('0x2'))('api');var moment=require(_0xa1b6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1b6('0x4'));var rimraf=require(_0xa1b6('0x5'));var config=require('../../config/environment');var attributes=require(_0xa1b6('0x6'));module[_0xa1b6('0x7')]=function(_0x42a1ca,_0x189ef3){return _0x42a1ca[_0xa1b6('0x8')](_0xa1b6('0x9'),attributes,{'tableName':_0xa1b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74d8=['path','../../config/environment','./plugin.attributes','exports','define','plugins','../../config/logger','api','moment','request-promise'];(function(_0x5ee024,_0x5a33e2){var _0x542633=function(_0x22d9a7){while(--_0x22d9a7){_0x5ee024['push'](_0x5ee024['shift']());}};_0x542633(++_0x5a33e2);}(_0x74d8,0xd8));var _0x874d=function(_0x421b21,_0x152af2){_0x421b21=_0x421b21-0x0;var _0x5709ad=_0x74d8[_0x421b21];return _0x5709ad;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x874d('0x0'))(_0x874d('0x1'));var moment=require(_0x874d('0x2'));var BPromise=require('bluebird');var rp=require(_0x874d('0x3'));var fs=require('fs');var path=require(_0x874d('0x4'));var rimraf=require('rimraf');var config=require(_0x874d('0x5'));var attributes=require(_0x874d('0x6'));module[_0x874d('0x7')]=function(_0x4260cf,_0xc7720c){return _0x4260cf[_0x874d('0x8')]('Plugin',attributes,{'tableName':_0x874d('0x9'),'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 11fe85a..0588cee 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 _0xadce=['../../config/logger','rpc','../../config/environment','defaults','redis','socket.io-emitter','./plugin.socket','request','then','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','CreatePlugin','Plugin','create','body','options','raw','lodash','moment','randomstring','ioredis'];(function(_0x1e26cb,_0x107494){var _0x56e59d=function(_0x4b36a6){while(--_0x4b36a6){_0x1e26cb['push'](_0x1e26cb['shift']());}};_0x56e59d(++_0x107494);}(_0xadce,0x1dc));var _0xeadc=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xadce[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xeadc('0x0'));var util=require('util');var moment=require(_0xeadc('0x1'));var BPromise=require('bluebird');var rs=require(_0xeadc('0x2'));var fs=require('fs');var Redis=require(_0xeadc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xeadc('0x4'))(_0xeadc('0x5'));var config=require(_0xeadc('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xeadc('0x7')](config[_0xeadc('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xeadc('0x9'))(new Redis(config[_0xeadc('0x8')]));require(_0xeadc('0xa'))['register'](socket);function respondWithRpcPromise(_0xcd3de7,_0x4faccb,_0x4e3c9c){return new BPromise(function(_0xecafa1,_0x59a02c){return client[_0xeadc('0xb')](_0xcd3de7,_0x4e3c9c)[_0xeadc('0xc')](function(_0x1c7996){logger['info'](_0xeadc('0xd'),_0x4faccb,'request\x20sent');logger[_0xeadc('0xe')](_0xeadc('0xf'),_0x4faccb,'request\x20sent',JSON[_0xeadc('0x10')](_0x1c7996));if(_0x1c7996[_0xeadc('0x11')]){if(_0x1c7996['error'][_0xeadc('0x12')]===0x1f4){logger[_0xeadc('0x11')](_0xeadc('0xd'),_0x4faccb,_0x1c7996['error'][_0xeadc('0x13')]);return _0x59a02c(_0x1c7996[_0xeadc('0x11')][_0xeadc('0x13')]);}logger[_0xeadc('0x11')](_0xeadc('0xd'),_0x4faccb,_0x1c7996['error'][_0xeadc('0x13')]);return _0xecafa1(_0x1c7996['error'][_0xeadc('0x13')]);}else{logger[_0xeadc('0x14')](_0xeadc('0xd'),_0x4faccb,_0xeadc('0x15'));_0xecafa1(_0x1c7996[_0xeadc('0x16')]['message']);}})[_0xeadc('0x17')](function(_0x3b3d77){logger[_0xeadc('0x11')]('Plugin,\x20%s,\x20%s',_0x4faccb,_0x3b3d77);_0x59a02c(_0x3b3d77);});});}exports[_0xeadc('0x18')]=function(_0x51bdea){var _0x137097=this;return new Promise(function(_0x509137,_0x866d02){return db[_0xeadc('0x19')][_0xeadc('0x1a')](_0x51bdea[_0xeadc('0x1b')],{'raw':_0x51bdea[_0xeadc('0x1c')]?_0x51bdea[_0xeadc('0x1c')][_0xeadc('0x1d')]===undefined?!![]:![]:!![]})[_0xeadc('0xc')](function(_0x216f09){logger[_0xeadc('0x14')](_0xeadc('0x18'),_0x51bdea);logger[_0xeadc('0xe')](_0xeadc('0x18'),_0x51bdea,JSON[_0xeadc('0x10')](_0x216f09));_0x509137(_0x216f09);})[_0xeadc('0x17')](function(_0x4cc06a){logger[_0xeadc('0x11')](_0xeadc('0x18'),_0x4cc06a[_0xeadc('0x13')],_0x51bdea);_0x866d02(_0x137097[_0xeadc('0x11')](0x1f4,_0x4cc06a[_0xeadc('0x13')]));});});}; \ No newline at end of file +var _0xdd2e=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','CreatePlugin','Plugin','body','options','raw','stringify','lodash','util','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdd2e,0x13d));var _0xedd2=function(_0x459de1,_0x187d8c){_0x459de1=_0x459de1-0x0;var _0x2a1006=_0xdd2e[_0x459de1];return _0x2a1006;};'use strict';var _=require(_0xedd2('0x0'));var util=require(_0xedd2('0x1'));var moment=require('moment');var BPromise=require(_0xedd2('0x2'));var rs=require(_0xedd2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedd2('0x4'))['db'];var utils=require(_0xedd2('0x5'));var logger=require(_0xedd2('0x6'))(_0xedd2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xedd2('0x8')][_0xedd2('0x9')]({'port':0x232a});config[_0xedd2('0xa')]=_[_0xedd2('0xb')](config[_0xedd2('0xa')],{'host':_0xedd2('0xc'),'port':0x18eb});var socket=require(_0xedd2('0xd'))(new Redis(config['redis']));require(_0xedd2('0xe'))['register'](socket);function respondWithRpcPromise(_0x3d243a,_0x46022d,_0x42256f){return new BPromise(function(_0xbac524,_0x1559e9){return client[_0xedd2('0xf')](_0x3d243a,_0x42256f)[_0xedd2('0x10')](function(_0x5c16dd){logger['info'](_0xedd2('0x11'),_0x46022d,_0xedd2('0x12'));logger[_0xedd2('0x13')](_0xedd2('0x14'),_0x46022d,'request\x20sent',JSON['stringify'](_0x5c16dd));if(_0x5c16dd[_0xedd2('0x15')]){if(_0x5c16dd['error']['code']===0x1f4){logger[_0xedd2('0x15')]('Plugin,\x20%s,\x20%s',_0x46022d,_0x5c16dd[_0xedd2('0x15')]['message']);return _0x1559e9(_0x5c16dd[_0xedd2('0x15')]['message']);}logger[_0xedd2('0x15')](_0xedd2('0x11'),_0x46022d,_0x5c16dd[_0xedd2('0x15')][_0xedd2('0x16')]);return _0xbac524(_0x5c16dd[_0xedd2('0x15')][_0xedd2('0x16')]);}else{logger[_0xedd2('0x17')](_0xedd2('0x11'),_0x46022d,_0xedd2('0x12'));_0xbac524(_0x5c16dd[_0xedd2('0x18')][_0xedd2('0x16')]);}})[_0xedd2('0x19')](function(_0x493357){logger['error'](_0xedd2('0x11'),_0x46022d,_0x493357);_0x1559e9(_0x493357);});});}exports[_0xedd2('0x1a')]=function(_0x4dfddb){var _0x1babe8=this;return new Promise(function(_0x381455,_0xd9f8ae){return db[_0xedd2('0x1b')]['create'](_0x4dfddb[_0xedd2('0x1c')],{'raw':_0x4dfddb[_0xedd2('0x1d')]?_0x4dfddb[_0xedd2('0x1d')][_0xedd2('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x445d7a){logger['info'](_0xedd2('0x1a'),_0x4dfddb);logger[_0xedd2('0x13')]('CreatePlugin',_0x4dfddb,JSON[_0xedd2('0x1f')](_0x445d7a));_0x381455(_0x445d7a);})[_0xedd2('0x19')](function(_0x79d98a){logger[_0xedd2('0x15')](_0xedd2('0x1a'),_0x79d98a[_0xedd2('0x16')],_0x4dfddb);_0xd9f8ae(_0x1babe8['error'](0x1f4,_0x79d98a['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index aa2a769..4856800 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 _0x55e7=['remove','update','emit','removeListener','length','./plugin.events'];(function(_0x5cbd7b,_0x207439){var _0x3fdfb8=function(_0x4eb12e){while(--_0x4eb12e){_0x5cbd7b['push'](_0x5cbd7b['shift']());}};_0x3fdfb8(++_0x207439);}(_0x55e7,0x1cd));var _0x755e=function(_0x362b33,_0x4e8a9c){_0x362b33=_0x362b33-0x0;var _0x3ff09f=_0x55e7[_0x362b33];return _0x3ff09f;};'use strict';var PluginEvents=require(_0x755e('0x0'));var events=['save',_0x755e('0x1'),_0x755e('0x2')];function createListener(_0x190f19,_0x47b657){return function(_0x457f8b){_0x47b657[_0x755e('0x3')](_0x190f19,_0x457f8b);};}function removeListener(_0x2ef31d,_0x5ca7c5){return function(){PluginEvents[_0x755e('0x4')](_0x2ef31d,_0x5ca7c5);};}exports['register']=function(_0x2ce213){for(var _0x5b7ccb=0x0,_0x1f4564=events[_0x755e('0x5')];_0x5b7ccb<_0x1f4564;_0x5b7ccb++){var _0xde8b86=events[_0x5b7ccb];var _0x34c047=createListener('plugin:'+_0xde8b86,_0x2ce213);PluginEvents['on'](_0xde8b86,_0x34c047);}}; \ No newline at end of file +var _0x7398=['length','plugin:','./plugin.events','save','remove','update','emit','removeListener'];(function(_0x5f416b,_0x2d8810){var _0x14c815=function(_0x1fd5d2){while(--_0x1fd5d2){_0x5f416b['push'](_0x5f416b['shift']());}};_0x14c815(++_0x2d8810);}(_0x7398,0x162));var _0x8739=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x7398[_0x3511d3];return _0x5d6321;};'use strict';var PluginEvents=require(_0x8739('0x0'));var events=[_0x8739('0x1'),_0x8739('0x2'),_0x8739('0x3')];function createListener(_0x5ad82c,_0x14a324){return function(_0x58910a){_0x14a324[_0x8739('0x4')](_0x5ad82c,_0x58910a);};}function removeListener(_0x5eba34,_0x276b8e){return function(){PluginEvents[_0x8739('0x5')](_0x5eba34,_0x276b8e);};}exports['register']=function(_0x457bc7){for(var _0x1bfcf7=0x0,_0x280f6d=events[_0x8739('0x6')];_0x1bfcf7<_0x280f6d;_0x1bfcf7++){var _0xbb359c=events[_0x1bfcf7];var _0x1d0678=createListener(_0x8739('0x7')+_0xbb359c,_0x457bc7);PluginEvents['on'](_0xbb359c,_0x1d0678);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 3cfd874..e8a0990 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(_0x15354d,_0x2950e0){var _0x2c15d5=function(_0x20ed4a){while(--_0x20ed4a){_0x15354d['push'](_0x15354d['shift']());}};_0x2c15d5(++_0x2950e0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x2db056,_0x2fce25){var _0x156b51=function(_0x420cc1){while(--_0x420cc1){_0x2db056['push'](_0x2db056['shift']());}};_0x156b51(++_0x2fce25);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 6be9277..96d1f55 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 _0x4ea3=['dirname','start','dump','send','Missing\x20name\x20and/or\x20path','update','destroy','lodash','../../config/pm2','../../config/logger','api','child_process','bluebird','sendStatus','status','json','error','name','npm\x20install','info','index','list','then','reject','express','length','catch','show','describe','params','create','body','script','../../files/plugins','chdir'];(function(_0x45c417,_0x555d7b){var _0x3c88da=function(_0x56c1f0){while(--_0x56c1f0){_0x45c417['push'](_0x45c417['shift']());}};_0x3c88da(++_0x555d7b);}(_0x4ea3,0x70));var _0x34ea=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4ea3[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x34ea('0x0'));var pm2=require(_0x34ea('0x1'));var logger=require(_0x34ea('0x2'))(_0x34ea('0x3'));var path=require('path');var exec=require(_0x34ea('0x4'))['exec'];var BPromise=require(_0x34ea('0x5'));function handleEntityNotFound(_0x571f1b,_0x5e5a84){return function(_0x2ce955){if(!_0x2ce955){_0x571f1b[_0x34ea('0x6')](0x194);;}return _0x2ce955;};}function respondWithResult(_0x962596,_0x123d48){_0x123d48=_0x123d48||0xc8;return function(_0x40434e){if(_0x40434e){return _0x962596[_0x34ea('0x7')](_0x123d48)[_0x34ea('0x8')](_0x40434e);}return null;};}function handleError(_0x5bec7c,_0x341727){_0x341727=_0x341727||0x1f4;return function(_0x6e9ccc){logger[_0x34ea('0x9')](_0x6e9ccc['stack']);if(_0x6e9ccc[_0x34ea('0xa')]){delete _0x6e9ccc[_0x34ea('0xa')];}_0x5bec7c['status'](_0x341727)['send'](_0x6e9ccc);};}function execChildProcess(){return new BPromise(function(_0x5bd8b6,_0x346287){exec(_0x34ea('0xb'),function(_0x58bb0d,_0x11229e,_0x29a5c8){logger[_0x34ea('0xc')](_0x11229e);logger[_0x34ea('0xc')](_0x29a5c8);if(_0x58bb0d){logger[_0x34ea('0x9')](_0x58bb0d);return _0x346287(_0x58bb0d);}return _0x5bd8b6(_0x11229e);});});}exports[_0x34ea('0xd')]=function(_0x37e1b4,_0x36af43){return pm2[_0x34ea('0xe')]()[_0x34ea('0xf')](function(_0x36a4c6){if(_0x36a4c6){var _0x5ef9ae=_[_0x34ea('0x10')](_0x36a4c6,function(_0x89e3f2){return _0x89e3f2[_0x34ea('0xa')]===_0x34ea('0x11')||_0x89e3f2[_0x34ea('0xa')]==='motion2';});return{'rows':_0x5ef9ae,'count':_0x5ef9ae[_0x34ea('0x12')]};}return null;})[_0x34ea('0xf')](respondWithResult(_0x36af43,null))[_0x34ea('0x13')](handleError(_0x36af43,null));};exports[_0x34ea('0x14')]=function(_0x5f420f,_0x2680e0){return pm2[_0x34ea('0x15')](_0x5f420f[_0x34ea('0x16')]['id'])['then'](respondWithResult(_0x2680e0,null))[_0x34ea('0xf')](handleEntityNotFound(_0x2680e0,null))[_0x34ea('0x13')](handleError(_0x2680e0,null));};exports[_0x34ea('0x17')]=function(_0x127308,_0x52af16){if(_0x127308[_0x34ea('0x18')][_0x34ea('0xa')]&&_0x127308[_0x34ea('0x18')][_0x34ea('0x19')]){var _0x4fc1a2=path['join'](__dirname,_0x34ea('0x1a'),_0x127308[_0x34ea('0x18')][_0x34ea('0x19')]);var _0x51022f=process['cwd']();process[_0x34ea('0x1b')](path[_0x34ea('0x1c')](_0x4fc1a2));return execChildProcess()[_0x34ea('0xf')](function(_0x30c4b0){process[_0x34ea('0x1b')](_0x51022f);return pm2[_0x34ea('0x1d')]({'name':_0x127308['body'][_0x34ea('0xa')],'script':_0x4fc1a2});})[_0x34ea('0xf')](function(_0x3c0983){pm2[_0x34ea('0x1e')]();return _0x3c0983[0x0];})['then'](respondWithResult(_0x52af16,0xc9))['catch'](handleError(_0x52af16,null));}else{return _0x52af16['status'](0x1f4)[_0x34ea('0x1f')]({'message':_0x34ea('0x20')});}};exports[_0x34ea('0x21')]=function(_0x4204d7,_0x5b8b3e){if(_0x4204d7[_0x34ea('0x18')]['id']){delete _0x4204d7[_0x34ea('0x18')]['id'];}var _0x27c6f7={'online':'restart','stopped':'stop'};if(_0x27c6f7['hasOwnProperty'](_0x4204d7['body'][_0x34ea('0x7')])){return pm2[_0x27c6f7[_0x4204d7[_0x34ea('0x18')][_0x34ea('0x7')]]](_0x4204d7[_0x34ea('0x16')]['id'])['then'](respondWithResult(_0x5b8b3e,0xc8))[_0x34ea('0x13')](handleError(_0x5b8b3e,null));}else{return _0x5b8b3e['status'](0x1f4)[_0x34ea('0x1f')]({'message':'Unknown\x20status'});}};exports[_0x34ea('0x22')]=function(_0x14e018,_0x3cb968){if(_0x14e018['body']['id']){delete _0x14e018[_0x34ea('0x18')]['id'];}if(_0x14e018[_0x34ea('0x16')]['id']){return pm2['delete'](_0x14e018[_0x34ea('0x16')]['id'])['then'](function(_0x1392b6){pm2[_0x34ea('0x1e')]();return _0x1392b6[0x0];})[_0x34ea('0xf')](respondWithResult(_0x3cb968,null))['catch'](handleError(_0x3cb968,null));}else{return _0x3cb968['status'](0x1f4)[_0x34ea('0x1f')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x57f8=['error','name','npm\x20install','info','index','list','express','length','then','catch','show','describe','params','body','script','../../files/plugins','cwd','chdir','dirname','dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json'];(function(_0x3fe280,_0x1d8260){var _0x2e833f=function(_0x2fc4e2){while(--_0x2fc4e2){_0x3fe280['push'](_0x3fe280['shift']());}};_0x2e833f(++_0x1d8260);}(_0x57f8,0x198));var _0x857f=function(_0x25cec5,_0x115d0c){_0x25cec5=_0x25cec5-0x0;var _0x19fba4=_0x57f8[_0x25cec5];return _0x19fba4;};'use strict';var _=require('lodash');var pm2=require(_0x857f('0x0'));var logger=require(_0x857f('0x1'))(_0x857f('0x2'));var path=require(_0x857f('0x3'));var exec=require(_0x857f('0x4'))[_0x857f('0x5')];var BPromise=require(_0x857f('0x6'));function handleEntityNotFound(_0x6f054b,_0x318050){return function(_0xced48e){if(!_0xced48e){_0x6f054b[_0x857f('0x7')](0x194);;}return _0xced48e;};}function respondWithResult(_0x369c40,_0x5d22e4){_0x5d22e4=_0x5d22e4||0xc8;return function(_0x8380e8){if(_0x8380e8){return _0x369c40[_0x857f('0x8')](_0x5d22e4)[_0x857f('0x9')](_0x8380e8);}return null;};}function handleError(_0x577fc3,_0x5f6a66){_0x5f6a66=_0x5f6a66||0x1f4;return function(_0x135855){logger[_0x857f('0xa')](_0x135855['stack']);if(_0x135855[_0x857f('0xb')]){delete _0x135855[_0x857f('0xb')];}_0x577fc3[_0x857f('0x8')](_0x5f6a66)['send'](_0x135855);};}function execChildProcess(){return new BPromise(function(_0xefee53,_0x360827){exec(_0x857f('0xc'),function(_0x11adfd,_0x268f9d,_0x3eb530){logger[_0x857f('0xd')](_0x268f9d);logger['info'](_0x3eb530);if(_0x11adfd){logger[_0x857f('0xa')](_0x11adfd);return _0x360827(_0x11adfd);}return _0xefee53(_0x268f9d);});});}exports[_0x857f('0xe')]=function(_0x373333,_0x2caf29){return pm2[_0x857f('0xf')]()['then'](function(_0x4bc590){if(_0x4bc590){var _0x3b09d9=_['reject'](_0x4bc590,function(_0x1fafbe){return _0x1fafbe['name']===_0x857f('0x10')||_0x1fafbe[_0x857f('0xb')]==='motion2';});return{'rows':_0x3b09d9,'count':_0x3b09d9[_0x857f('0x11')]};}return null;})[_0x857f('0x12')](respondWithResult(_0x2caf29,null))[_0x857f('0x13')](handleError(_0x2caf29,null));};exports[_0x857f('0x14')]=function(_0x279e74,_0x38a3c2){return pm2[_0x857f('0x15')](_0x279e74[_0x857f('0x16')]['id'])[_0x857f('0x12')](respondWithResult(_0x38a3c2,null))[_0x857f('0x12')](handleEntityNotFound(_0x38a3c2,null))[_0x857f('0x13')](handleError(_0x38a3c2,null));};exports['create']=function(_0x1729d8,_0x1e8fd4){if(_0x1729d8['body'][_0x857f('0xb')]&&_0x1729d8[_0x857f('0x17')][_0x857f('0x18')]){var _0x484035=path['join'](__dirname,_0x857f('0x19'),_0x1729d8[_0x857f('0x17')][_0x857f('0x18')]);var _0x4fa031=process[_0x857f('0x1a')]();process[_0x857f('0x1b')](path[_0x857f('0x1c')](_0x484035));return execChildProcess()['then'](function(_0x1961ea){process[_0x857f('0x1b')](_0x4fa031);return pm2['start']({'name':_0x1729d8[_0x857f('0x17')][_0x857f('0xb')],'script':_0x484035});})[_0x857f('0x12')](function(_0x44ff23){pm2[_0x857f('0x1d')]();return _0x44ff23[0x0];})[_0x857f('0x12')](respondWithResult(_0x1e8fd4,0xc9))[_0x857f('0x13')](handleError(_0x1e8fd4,null));}else{return _0x1e8fd4[_0x857f('0x8')](0x1f4)[_0x857f('0x1e')]({'message':_0x857f('0x1f')});}};exports[_0x857f('0x20')]=function(_0x4782ab,_0x250731){if(_0x4782ab[_0x857f('0x17')]['id']){delete _0x4782ab['body']['id'];}var _0x17e415={'online':_0x857f('0x21'),'stopped':_0x857f('0x22')};if(_0x17e415[_0x857f('0x23')](_0x4782ab['body'][_0x857f('0x8')])){return pm2[_0x17e415[_0x4782ab['body'][_0x857f('0x8')]]](_0x4782ab[_0x857f('0x16')]['id'])[_0x857f('0x12')](respondWithResult(_0x250731,0xc8))[_0x857f('0x13')](handleError(_0x250731,null));}else{return _0x250731[_0x857f('0x8')](0x1f4)[_0x857f('0x1e')]({'message':_0x857f('0x24')});}};exports[_0x857f('0x25')]=function(_0x17e7b6,_0x41f832){if(_0x17e7b6[_0x857f('0x17')]['id']){delete _0x17e7b6[_0x857f('0x17')]['id'];}if(_0x17e7b6[_0x857f('0x16')]['id']){return pm2['delete'](_0x17e7b6[_0x857f('0x16')]['id'])[_0x857f('0x12')](function(_0x55e69f){pm2[_0x857f('0x1d')]();return _0x55e69f[0x0];})[_0x857f('0x12')](respondWithResult(_0x41f832,null))['catch'](handleError(_0x41f832,null));}else{return _0x41f832[_0x857f('0x8')](0x1f4)[_0x857f('0x1e')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 17fb267..039bf63 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 _0xb970=['isAuthenticated','getAgents','/queues','exports','express','Router','../../components/auth/service','./realtime.controller'];(function(_0x3f70cd,_0x6bf4ed){var _0x3feb93=function(_0x4a045a){while(--_0x4a045a){_0x3f70cd['push'](_0x3f70cd['shift']());}};_0x3feb93(++_0x6bf4ed);}(_0xb970,0x1cc));var _0x0b97=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0xb970[_0x237546];return _0x233e29;};'use strict';var express=require(_0x0b97('0x0'));var router=express[_0x0b97('0x1')]();var auth=require(_0x0b97('0x2'));var controller=require(_0x0b97('0x3'));router['get']('/agents',auth[_0x0b97('0x4')](),controller[_0x0b97('0x5')]);router['get'](_0x0b97('0x6'),auth[_0x0b97('0x4')](),controller['getQueues']);module[_0x0b97('0x7')]=router; \ No newline at end of file +var _0x5890=['express','Router','../../components/auth/service','./realtime.controller','get','getAgents','/queues','isAuthenticated','exports'];(function(_0x1a662e,_0x4ee34b){var _0x58cd86=function(_0x776a55){while(--_0x776a55){_0x1a662e['push'](_0x1a662e['shift']());}};_0x58cd86(++_0x4ee34b);}(_0x5890,0x1b9));var _0x0589=function(_0x30362e,_0x3a89bb){_0x30362e=_0x30362e-0x0;var _0xe49675=_0x5890[_0x30362e];return _0xe49675;};'use strict';var express=require(_0x0589('0x0'));var router=express[_0x0589('0x1')]();var auth=require(_0x0589('0x2'));var controller=require(_0x0589('0x3'));router[_0x0589('0x4')]('/agents',auth['isAuthenticated'](),controller[_0x0589('0x5')]);router[_0x0589('0x4')](_0x0589('0x6'),auth[_0x0589('0x7')](),controller['getQueues']);module[_0x0589('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index d9992fa..5a43f40 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 _0xddf1=['voice','voiceStatus','talking','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','rows','pick','catch','Queue','fieldName','fields','name','dialActive','outbound','QueueCampaigns','startCase','filter','getResources','getRealtimeQueues','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../mysqldb','APIBadRequestError','handleError','offset','undefined','limit','count','set','Content-Range','getAgents','getChannels','query','globalQueueFilter','pauseTypeFilter','pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','join','getAgentIdsByStatus','length','map','rawAttributes','type','key','role','agent','getOptions','raw','push','sequelize','order','forEach','*pause','Pause','where','merge','user','userProfileId','Agents','online','extraQueryConditions','assign','UserProfile','findAndCountAll','find','globalStatus','getAgentStatus'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xddf1,0x14c));var _0x1ddf=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xddf1[_0x255d5b];return _0x3e141a;};'use strict';var _=require('lodash');var util=require(_0x1ddf('0x0'));var rta=require(_0x1ddf('0x1'));var rtq=require(_0x1ddf('0x2'));var qs=require(_0x1ddf('0x3'));var utils=require('../../config/utils');var db=require(_0x1ddf('0x4'))['db'];var APIBadRequestError=require('../../errors/api')[_0x1ddf('0x5')];var APIHandleError=require('../../errors/api')[_0x1ddf('0x6')];function respondWithFilteredResult(_0x1ce9da,_0x236d91){return function(_0x5a9ab4){if(_0x5a9ab4){var _0x511c79=typeof _0x236d91[_0x1ddf('0x7')]===_0x1ddf('0x8')&&typeof _0x236d91[_0x1ddf('0x9')]==='undefined';var _0x47b8ca=_0x5a9ab4[_0x1ddf('0xa')];var _0x324af8=_0x511c79?0x0:_0x236d91[_0x1ddf('0x7')];var _0x3d4d82=_0x511c79?_0x5a9ab4[_0x1ddf('0xa')]:_0x236d91[_0x1ddf('0x7')]+_0x236d91[_0x1ddf('0x9')];var _0x493c4f;if(_0x3d4d82>=_0x47b8ca){_0x3d4d82=_0x47b8ca;_0x493c4f=0xc8;}else{_0x493c4f=0xce;}_0x1ce9da['status'](_0x493c4f);return _0x1ce9da[_0x1ddf('0xb')](_0x1ddf('0xc'),_0x324af8+'-'+_0x3d4d82+'/'+_0x47b8ca)['json'](_0x5a9ab4);}return null;};}exports[_0x1ddf('0xd')]=function(_0x55a1c9,_0x30cfbb){var _0x562e51={'count':0x0,'rows':[]};var _0xdd18f5={};var _0x5d8ec7;var _0x1bbb14=utils[_0x1ddf('0xe')]();var _0x594602;var _0x70620c;var _0x228430=_0x55a1c9[_0x1ddf('0xf')][_0x1ddf('0x10')];var _0x367160=_0x55a1c9[_0x1ddf('0xf')]['globalStatusFilter'];var _0x2f9593=_0x55a1c9['query'][_0x1ddf('0x11')];var _0x428e21=_0x367160===_0x1ddf('0x12')||_0x367160==='*pause'?!![]:![];var _0x378820=[];var _0x15fb22;var _0x2f1dcd;Promise[_0x1ddf('0x13')]()[_0x1ddf('0x14')](function(){if(_0x55a1c9['query'][_0x1ddf('0x15')]){if(!utils[_0x1ddf('0x16')](_0x55a1c9['query'][_0x1ddf('0x15')])){throw new APIBadRequestError(util[_0x1ddf('0x17')](_0x1ddf('0x18'),_0x55a1c9['query'][_0x1ddf('0x15')]));}_0x5d8ec7=_0x55a1c9['query'][_0x1ddf('0x15')][_0x1ddf('0x19')]();}if(!_0x55a1c9['query'][_0x1ddf('0x1a')]||!_0x55a1c9[_0x1ddf('0xf')][_0x1ddf('0x1a')][_0x1ddf('0x1b')]('globalStatus')){_0x55a1c9[_0x1ddf('0xf')]['sort']=rta['validateSortParameter'](_0x55a1c9[_0x1ddf('0xf')][_0x1ddf('0x1a')]);return;}var _0x5389fb=rta['getUpdatedSortOptions'](_0x55a1c9[_0x1ddf('0xf')][_0x1ddf('0x1a')]);_0x55a1c9['query']['sort']=_0x5389fb['fields'][_0x1ddf('0x1c')](',');_0x15fb22=_0x5389fb['order'];})[_0x1ddf('0x14')](function(){if(!_0x228430){return[];}return rta['getAgentIdsByQueues'](_0x228430,_0x5d8ec7);})[_0x1ddf('0x14')](function(_0x1a7147){_0x378820=_0x1a7147;return rta['getRealtimeAgents']();})[_0x1ddf('0x14')](function(_0x273240){_0x70620c=_0x273240['rows'];if((!_0x367160||_0x428e21)&&!_0x15fb22){return _0x378820;}if(_0x15fb22&&!_0x367160){return rta['getSortedAgentsIdsByStatus'](_0x70620c,_0x378820,_0x15fb22);}else{return rta[_0x1ddf('0x1d')](_0x70620c,_0x378820,_0x367160);}})[_0x1ddf('0x14')](function(_0x3eff33){_0x378820=_0x3eff33;var _0x30ca83=![];if(_0x378820[_0x1ddf('0x1e')]===0x0){if(_0x228430||_0x367160){_0x30ca83=!![];}if(_0x428e21){_0x30ca83=![];}}if(_0x30ca83){return _0x562e51;}var _0x10fef0=_[_0x1ddf('0x1f')](db['User'][_0x1ddf('0x20')],function(_0x1b2a9c){return{'name':_0x1b2a9c['fieldName'],'type':_0x1b2a9c[_0x1ddf('0x21')][_0x1ddf('0x22')]};});_0x55a1c9[_0x1ddf('0xf')][_0x1ddf('0x23')]=_0x1ddf('0x24');_0xdd18f5=qs[_0x1ddf('0x25')](_0x10fef0,_0x55a1c9);_0xdd18f5[_0x1ddf('0x26')]=!![];var _0xd85b5f=[];if(_0x378820['length']>0x0){_0xd85b5f[_0x1ddf('0x27')]({'id':{'$in':_0x378820}});if(_0x15fb22&&!_0x367160){_0x2f1dcd=[db[_0x1ddf('0x28')]['literal']('FIELD(id,'+_0x378820+')')];_0xdd18f5[_0x1ddf('0x29')]=_0x2f1dcd;}}if(_0x428e21){_0x1bbb14[_0x1ddf('0x2a')](function(_0xab6c5f){var _0xd0b280=!![];if(_0x367160===_0x1ddf('0x2b')&&_0x5d8ec7!==_0xab6c5f){_0xd0b280=![];}_0xd85b5f[_0x1ddf('0x27')]({[_0xab6c5f+_0x1ddf('0x2c')]:_0xd0b280});});if(_0x2f9593){_0xd85b5f[_0x1ddf('0x27')]({'pauseType':_0x2f9593});}}else if(_0x367160){_0x1bbb14[_0x1ddf('0x2a')](function(_0x3f0071){_0xd85b5f[_0x1ddf('0x27')]({[_0x3f0071+'Pause']:![]});});}_0xdd18f5[_0x1ddf('0x2d')]=_[_0x1ddf('0x2e')](_0xdd18f5[_0x1ddf('0x2d')],{'$and':_0xd85b5f});if(_0x55a1c9[_0x1ddf('0x2f')][_0x1ddf('0x23')]===_0x1ddf('0x2f')){var _0x458c38={'params':{'id':_0x55a1c9[_0x1ddf('0x2f')][_0x1ddf('0x30')]},'query':{'section':_0x1ddf('0x31'),'role':_0x1ddf('0x24'),'raw':!![],'ids':_0x378820,'customSorting':_0x2f1dcd}};if(_0x55a1c9[_0x1ddf('0xf')]['online']){_0x458c38['query'][_0x1ddf('0x32')]=!![];}if(_0x428e21){_0x458c38[_0x1ddf('0xf')][_0x1ddf('0x33')]=_0xd85b5f;}_0x458c38['query']=Object[_0x1ddf('0x34')](_0x458c38[_0x1ddf('0xf')],_0x55a1c9[_0x1ddf('0xf')]);return db[_0x1ddf('0x35')]['getResources'](_0x458c38);}return db['User'][_0x1ddf('0x36')](_0xdd18f5);})[_0x1ddf('0x14')](function(_0x1c840a){_0x562e51['count']=_0x1c840a['count'];_0x594602=_0x1c840a['rows'];return _0x594602[_0x1ddf('0x1f')](function(_0x546999){var _0x46caea=_[_0x1ddf('0x37')](_0x70620c,['id',_0x546999['id']]);if(_0x46caea){var _0x3334a3=rta['filterAgentAttributes'](_0x46caea);_[_0x1ddf('0x2e')](_0x546999,_0x3334a3);}_0x546999[_0x1ddf('0x38')]=rta[_0x1ddf('0x39')](_0x546999);if(_0x546999[_0x1ddf('0x38')]['includes'](_0x1ddf('0x12'))){_0x1bbb14[_0x1ddf('0x2a')](function(_0x337993){if(_0x546999[_0x337993+'Pause']){if(_0x337993===_0x1ddf('0x3a')){if(_0x546999[_0x1ddf('0x3b')]!==_0x1ddf('0x3c')){_0x546999['voiceStatus']=_0x1ddf('0x12');}}else{_0x546999[_0x337993+_0x1ddf('0x3d')]='pause';}}});}return _0x546999;});})[_0x1ddf('0x14')](function(_0x3254f2){if(!_0x15fb22||_0x2f1dcd){return _0x3254f2;}return rta[_0x1ddf('0x3e')](_0x3254f2,_0x15fb22);})['then'](function(_0x3beb9d){var _0x104cae=rta[_0x1ddf('0x3f')]();_0x562e51[_0x1ddf('0x40')]=_0x3beb9d[_0x1ddf('0x1f')](function(_0x1d8898){return _[_0x1ddf('0x41')](_0x1d8898,_0x104cae);});return _0x562e51;})['then'](respondWithFilteredResult(_0x30cfbb,_0xdd18f5))[_0x1ddf('0x42')](APIHandleError(_0x30cfbb));};exports['getQueues']=function(_0x14b641,_0x38a481){var _0x443a72={'count':0x0,'rows':[]};var _0x40cb61={};var _0x343a9f;var _0x344156;var _0x54e5ef;Promise['resolve']()[_0x1ddf('0x14')](function(){if(_0x14b641['query'][_0x1ddf('0x15')]){if(!utils['isValidChannel'](_0x14b641[_0x1ddf('0xf')][_0x1ddf('0x15')])){throw new APIBadRequestError(util['format'](_0x1ddf('0x18'),_0x14b641['query'][_0x1ddf('0x15')]));}_0x343a9f=_0x14b641[_0x1ddf('0xf')][_0x1ddf('0x15')][_0x1ddf('0x19')]();}var _0x305f25=_['startCase'](_0x343a9f)+_0x1ddf('0x43');var _0x500513=_[_0x1ddf('0x1f')](db[_0x305f25][_0x1ddf('0x20')],function(_0x4165c8){return{'name':_0x4165c8[_0x1ddf('0x44')],'type':_0x4165c8[_0x1ddf('0x21')][_0x1ddf('0x22')]};});if(!_0x14b641[_0x1ddf('0xf')][_0x1ddf('0x45')]){var _0xae6898=['id',_0x1ddf('0x46')];if(_0x343a9f===_0x1ddf('0x3a')){_0xae6898[_0x1ddf('0x27')](_0x1ddf('0x21'));if(_0x14b641['query'][_0x1ddf('0x21')]==='outbound'){_0xae6898[_0x1ddf('0x27')]([_0x1ddf('0x47'),'dialMethod']);}}_0x14b641['query'][_0x1ddf('0x45')]=_0xae6898['join'](',');}_0x40cb61=qs[_0x1ddf('0x25')](_0x500513,_0x14b641);if(_0x14b641['user'][_0x1ddf('0x23')]===_0x1ddf('0x2f')){var _0x33e92f={'params':{'id':_0x14b641[_0x1ddf('0x2f')][_0x1ddf('0x30')]},'query':{'section':_0x343a9f==='voice'&&_0x14b641[_0x1ddf('0xf')][_0x1ddf('0x21')]===_0x1ddf('0x48')?_0x1ddf('0x49'):_[_0x1ddf('0x4a')](_0x343a9f)+'Queues','type':_0x14b641[_0x1ddf('0xf')][_0x1ddf('0x21')],'nolimit':!![],'sort':'name','filter':_0x14b641[_0x1ddf('0xf')][_0x1ddf('0x4b')]}};_0x33e92f[_0x1ddf('0xf')]=Object['assign'](_0x33e92f[_0x1ddf('0xf')],_0x14b641[_0x1ddf('0xf')]);delete _0x33e92f[_0x1ddf('0xf')]['id'];return db[_0x1ddf('0x35')][_0x1ddf('0x4c')](_0x33e92f);}return db[_0x305f25][_0x1ddf('0x36')](_0x40cb61);})[_0x1ddf('0x14')](function(_0xb300b1){_0x443a72['count']=_0xb300b1[_0x1ddf('0xa')];_0x344156=_0xb300b1[_0x1ddf('0x40')];return rtq[_0x1ddf('0x4d')](_0x14b641,_0x343a9f);})[_0x1ddf('0x14')](function(_0x3d0287){_0x54e5ef=_0x3d0287['rows'];return rtq['initializeQueues'](_0x344156,_0x54e5ef,_0x343a9f,_0x14b641[_0x1ddf('0xf')]['type']);})[_0x1ddf('0x14')](function(_0x1a8cd3){_0x443a72[_0x1ddf('0x40')]=_0x1a8cd3;return _0x443a72;})[_0x1ddf('0x14')](respondWithFilteredResult(_0x38a481,_0x40cb61))[_0x1ddf('0x42')](APIHandleError(_0x38a481));}; \ No newline at end of file +var _0xc150=['offset','undefined','limit','count','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','pauseTypeFilter','pause','*pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','getUpdatedSortOptions','fields','join','order','getRealtimeAgents','rows','getAgentIdsByStatus','length','map','User','fieldName','key','role','agent','getOptions','raw','push','sequelize','literal','FIELD(id,','Pause','where','user','Agents','online','extraQueryConditions','assign','UserProfile','findAndCountAll','find','filterAgentAttributes','getAgentStatus','voice','voiceStatus','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','getQueues','startCase','Queue','rawAttributes','type','name','outbound','dialMethod','Queues','filter','getRealtimeQueues','util','../../components/realtime/queues','../../components/parsers/qs','../../errors/api','APIBadRequestError','handleError'];(function(_0x8f2b45,_0x54a119){var _0x664c5c=function(_0x5de1a7){while(--_0x5de1a7){_0x8f2b45['push'](_0x8f2b45['shift']());}};_0x664c5c(++_0x54a119);}(_0xc150,0x1da));var _0x0c15=function(_0x406d8e,_0xa3c666){_0x406d8e=_0x406d8e-0x0;var _0x229317=_0xc150[_0x406d8e];return _0x229317;};'use strict';var _=require('lodash');var util=require(_0x0c15('0x0'));var rta=require('../../components/realtime/agents');var rtq=require(_0x0c15('0x1'));var qs=require(_0x0c15('0x2'));var utils=require('../../config/utils');var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x0c15('0x3'))[_0x0c15('0x4')];var APIHandleError=require(_0x0c15('0x3'))[_0x0c15('0x5')];function respondWithFilteredResult(_0x38220e,_0x5fc52){return function(_0x35857d){if(_0x35857d){var _0x5507c2=typeof _0x5fc52[_0x0c15('0x6')]===_0x0c15('0x7')&&typeof _0x5fc52[_0x0c15('0x8')]==='undefined';var _0x24b56e=_0x35857d[_0x0c15('0x9')];var _0x1bea36=_0x5507c2?0x0:_0x5fc52[_0x0c15('0x6')];var _0x204684=_0x5507c2?_0x35857d[_0x0c15('0x9')]:_0x5fc52[_0x0c15('0x6')]+_0x5fc52[_0x0c15('0x8')];var _0x3824ee;if(_0x204684>=_0x24b56e){_0x204684=_0x24b56e;_0x3824ee=0xc8;}else{_0x3824ee=0xce;}_0x38220e['status'](_0x3824ee);return _0x38220e[_0x0c15('0xa')](_0x0c15('0xb'),_0x1bea36+'-'+_0x204684+'/'+_0x24b56e)[_0x0c15('0xc')](_0x35857d);}return null;};}exports[_0x0c15('0xd')]=function(_0x229316,_0x2816e9){var _0x289743={'count':0x0,'rows':[]};var _0x181169={};var _0x6236a2;var _0x2de80d=utils[_0x0c15('0xe')]();var _0x314f3c;var _0x33dec4;var _0x5b4457=_0x229316[_0x0c15('0xf')][_0x0c15('0x10')];var _0x509e4a=_0x229316['query']['globalStatusFilter'];var _0x4b7c93=_0x229316[_0x0c15('0xf')][_0x0c15('0x11')];var _0x1e07fc=_0x509e4a===_0x0c15('0x12')||_0x509e4a===_0x0c15('0x13')?!![]:![];var _0x13f09b=[];var _0x3ef99b;var _0x4ef303;Promise[_0x0c15('0x14')]()[_0x0c15('0x15')](function(){if(_0x229316[_0x0c15('0xf')][_0x0c15('0x16')]){if(!utils[_0x0c15('0x17')](_0x229316[_0x0c15('0xf')]['channel'])){throw new APIBadRequestError(util[_0x0c15('0x18')](_0x0c15('0x19'),_0x229316['query']['channel']));}_0x6236a2=_0x229316[_0x0c15('0xf')][_0x0c15('0x16')][_0x0c15('0x1a')]();}if(!_0x229316[_0x0c15('0xf')][_0x0c15('0x1b')]||!_0x229316[_0x0c15('0xf')][_0x0c15('0x1b')][_0x0c15('0x1c')](_0x0c15('0x1d'))){_0x229316['query'][_0x0c15('0x1b')]=rta['validateSortParameter'](_0x229316[_0x0c15('0xf')]['sort']);return;}var _0x465f67=rta[_0x0c15('0x1e')](_0x229316[_0x0c15('0xf')]['sort']);_0x229316[_0x0c15('0xf')]['sort']=_0x465f67[_0x0c15('0x1f')][_0x0c15('0x20')](',');_0x3ef99b=_0x465f67[_0x0c15('0x21')];})[_0x0c15('0x15')](function(){if(!_0x5b4457){return[];}return rta['getAgentIdsByQueues'](_0x5b4457,_0x6236a2);})[_0x0c15('0x15')](function(_0x2dd903){_0x13f09b=_0x2dd903;return rta[_0x0c15('0x22')]();})[_0x0c15('0x15')](function(_0x578b68){_0x33dec4=_0x578b68[_0x0c15('0x23')];if((!_0x509e4a||_0x1e07fc)&&!_0x3ef99b){return _0x13f09b;}if(_0x3ef99b&&!_0x509e4a){return rta['getSortedAgentsIdsByStatus'](_0x33dec4,_0x13f09b,_0x3ef99b);}else{return rta[_0x0c15('0x24')](_0x33dec4,_0x13f09b,_0x509e4a);}})['then'](function(_0x4f082a){_0x13f09b=_0x4f082a;var _0x472a42=![];if(_0x13f09b[_0x0c15('0x25')]===0x0){if(_0x5b4457||_0x509e4a){_0x472a42=!![];}if(_0x1e07fc){_0x472a42=![];}}if(_0x472a42){return _0x289743;}var _0x36998e=_[_0x0c15('0x26')](db[_0x0c15('0x27')]['rawAttributes'],function(_0x43d605){return{'name':_0x43d605[_0x0c15('0x28')],'type':_0x43d605['type'][_0x0c15('0x29')]};});_0x229316['query'][_0x0c15('0x2a')]=_0x0c15('0x2b');_0x181169=qs[_0x0c15('0x2c')](_0x36998e,_0x229316);_0x181169[_0x0c15('0x2d')]=!![];var _0x293d5e=[];if(_0x13f09b[_0x0c15('0x25')]>0x0){_0x293d5e[_0x0c15('0x2e')]({'id':{'$in':_0x13f09b}});if(_0x3ef99b&&!_0x509e4a){_0x4ef303=[db[_0x0c15('0x2f')][_0x0c15('0x30')](_0x0c15('0x31')+_0x13f09b+')')];_0x181169[_0x0c15('0x21')]=_0x4ef303;}}if(_0x1e07fc){_0x2de80d['forEach'](function(_0x5c60e2){var _0x2e61b8=!![];if(_0x509e4a===_0x0c15('0x13')&&_0x6236a2!==_0x5c60e2){_0x2e61b8=![];}_0x293d5e[_0x0c15('0x2e')]({[_0x5c60e2+'Pause']:_0x2e61b8});});if(_0x4b7c93){_0x293d5e['push']({'pauseType':_0x4b7c93});}}else if(_0x509e4a){_0x2de80d['forEach'](function(_0x2be8dc){_0x293d5e[_0x0c15('0x2e')]({[_0x2be8dc+_0x0c15('0x32')]:![]});});}_0x181169[_0x0c15('0x33')]=_['merge'](_0x181169['where'],{'$and':_0x293d5e});if(_0x229316['user']['role']===_0x0c15('0x34')){var _0x8658c7={'params':{'id':_0x229316[_0x0c15('0x34')]['userProfileId']},'query':{'section':_0x0c15('0x35'),'role':_0x0c15('0x2b'),'raw':!![],'ids':_0x13f09b,'customSorting':_0x4ef303}};if(_0x229316[_0x0c15('0xf')][_0x0c15('0x36')]){_0x8658c7[_0x0c15('0xf')][_0x0c15('0x36')]=!![];}if(_0x1e07fc){_0x8658c7[_0x0c15('0xf')][_0x0c15('0x37')]=_0x293d5e;}_0x8658c7['query']=Object[_0x0c15('0x38')](_0x8658c7[_0x0c15('0xf')],_0x229316[_0x0c15('0xf')]);return db[_0x0c15('0x39')]['getResources'](_0x8658c7);}return db[_0x0c15('0x27')][_0x0c15('0x3a')](_0x181169);})[_0x0c15('0x15')](function(_0x21bfa7){_0x289743['count']=_0x21bfa7['count'];_0x314f3c=_0x21bfa7['rows'];return _0x314f3c['map'](function(_0x495ac6){var _0x43677e=_[_0x0c15('0x3b')](_0x33dec4,['id',_0x495ac6['id']]);if(_0x43677e){var _0x49f7e5=rta[_0x0c15('0x3c')](_0x43677e);_['merge'](_0x495ac6,_0x49f7e5);}_0x495ac6['globalStatus']=rta[_0x0c15('0x3d')](_0x495ac6);if(_0x495ac6[_0x0c15('0x1d')]['includes']('pause')){_0x2de80d['forEach'](function(_0x2dff42){if(_0x495ac6[_0x2dff42+_0x0c15('0x32')]){if(_0x2dff42===_0x0c15('0x3e')){if(_0x495ac6[_0x0c15('0x3f')]!=='talking'){_0x495ac6[_0x0c15('0x3f')]='pause';}}else{_0x495ac6[_0x2dff42+_0x0c15('0x40')]='pause';}}});}return _0x495ac6;});})[_0x0c15('0x15')](function(_0x10214a){if(!_0x3ef99b||_0x4ef303){return _0x10214a;}return rta[_0x0c15('0x41')](_0x10214a,_0x3ef99b);})[_0x0c15('0x15')](function(_0x5bc389){var _0x53e1d6=rta[_0x0c15('0x42')]();_0x289743[_0x0c15('0x23')]=_0x5bc389['map'](function(_0x550334){return _[_0x0c15('0x43')](_0x550334,_0x53e1d6);});return _0x289743;})['then'](respondWithFilteredResult(_0x2816e9,_0x181169))[_0x0c15('0x44')](APIHandleError(_0x2816e9));};exports[_0x0c15('0x45')]=function(_0x2cb590,_0x532af4){var _0x46094b={'count':0x0,'rows':[]};var _0x483952={};var _0xe50937;var _0x4acbad;var _0x2acad1;Promise['resolve']()[_0x0c15('0x15')](function(){if(_0x2cb590[_0x0c15('0xf')][_0x0c15('0x16')]){if(!utils['isValidChannel'](_0x2cb590[_0x0c15('0xf')][_0x0c15('0x16')])){throw new APIBadRequestError(util[_0x0c15('0x18')](_0x0c15('0x19'),_0x2cb590['query'][_0x0c15('0x16')]));}_0xe50937=_0x2cb590[_0x0c15('0xf')]['channel'][_0x0c15('0x1a')]();}var _0x4fbc7c=_[_0x0c15('0x46')](_0xe50937)+_0x0c15('0x47');var _0x163502=_[_0x0c15('0x26')](db[_0x4fbc7c][_0x0c15('0x48')],function(_0x593fd6){return{'name':_0x593fd6['fieldName'],'type':_0x593fd6[_0x0c15('0x49')][_0x0c15('0x29')]};});if(!_0x2cb590[_0x0c15('0xf')][_0x0c15('0x1f')]){var _0x4836ae=['id',_0x0c15('0x4a')];if(_0xe50937===_0x0c15('0x3e')){_0x4836ae[_0x0c15('0x2e')](_0x0c15('0x49'));if(_0x2cb590[_0x0c15('0xf')][_0x0c15('0x49')]===_0x0c15('0x4b')){_0x4836ae['push'](['dialActive',_0x0c15('0x4c')]);}}_0x2cb590[_0x0c15('0xf')][_0x0c15('0x1f')]=_0x4836ae[_0x0c15('0x20')](',');}_0x483952=qs[_0x0c15('0x2c')](_0x163502,_0x2cb590);if(_0x2cb590['user'][_0x0c15('0x2a')]==='user'){var _0x566d39={'params':{'id':_0x2cb590[_0x0c15('0x34')]['userProfileId']},'query':{'section':_0xe50937===_0x0c15('0x3e')&&_0x2cb590[_0x0c15('0xf')][_0x0c15('0x49')]==='outbound'?'QueueCampaigns':_[_0x0c15('0x46')](_0xe50937)+_0x0c15('0x4d'),'type':_0x2cb590[_0x0c15('0xf')][_0x0c15('0x49')],'nolimit':!![],'sort':'name','filter':_0x2cb590['query'][_0x0c15('0x4e')]}};_0x566d39[_0x0c15('0xf')]=Object['assign'](_0x566d39['query'],_0x2cb590['query']);delete _0x566d39[_0x0c15('0xf')]['id'];return db['UserProfile']['getResources'](_0x566d39);}return db[_0x4fbc7c][_0x0c15('0x3a')](_0x483952);})[_0x0c15('0x15')](function(_0x3301a4){_0x46094b['count']=_0x3301a4[_0x0c15('0x9')];_0x4acbad=_0x3301a4[_0x0c15('0x23')];return rtq[_0x0c15('0x4f')](_0x2cb590,_0xe50937);})['then'](function(_0x4f6aad){_0x2acad1=_0x4f6aad[_0x0c15('0x23')];return rtq['initializeQueues'](_0x4acbad,_0x2acad1,_0xe50937,_0x2cb590[_0x0c15('0xf')][_0x0c15('0x49')]);})[_0x0c15('0x15')](function(_0x293373){_0x46094b[_0x0c15('0x23')]=_0x293373;return _0x46094b;})[_0x0c15('0x15')](respondWithFilteredResult(_0x532af4,_0x483952))['catch'](APIHandleError(_0x532af4));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index f856d27..89cdd39 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1baa24,_0x40f925){var _0x27f681=function(_0x3c1de1){while(--_0x3c1de1){_0x1baa24['push'](_0x1baa24['shift']());}};_0x27f681(++_0x40f925);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0xcb91[_0x40dd56];return _0x4f850f;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5b1892,_0x24ec5b){var _0xeddceb=function(_0x5f5a56){while(--_0x5f5a56){_0x5b1892['push'](_0x5b1892['shift']());}};_0xeddceb(++_0x24ec5b);}(_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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 25f0fee..ec6fb9e 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 _0xd0c9=['STRING','DATE','sequelize','exports'];(function(_0x13ff4f,_0x4defc2){var _0xd04dee=function(_0x516beb){while(--_0x516beb){_0x13ff4f['push'](_0x13ff4f['shift']());}};_0xd04dee(++_0x4defc2);}(_0xd0c9,0xe2));var _0x9d0c=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0xd0c9[_0x5a95fa];return _0x1a61b8;};'use strict';var Sequelize=require(_0x9d0c('0x0'));module[_0x9d0c('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x9d0c('0x2')]},'starttime':{'type':Sequelize[_0x9d0c('0x3')]},'responsetime':{'type':Sequelize[_0x9d0c('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x9d0c('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6455=['INTEGER','STRING','DATE','sequelize'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x6455,0x97));var _0x5645=function(_0x19c5c1,_0x279326){_0x19c5c1=_0x19c5c1-0x0;var _0x59172f=_0x6455[_0x19c5c1];return _0x59172f;};'use strict';var Sequelize=require(_0x5645('0x0'));module['exports']={'state':{'type':Sequelize[_0x5645('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x5645('0x2')]},'scheduledat':{'type':Sequelize[_0x5645('0x3')]},'uniqueid':{'type':Sequelize[_0x5645('0x2')]},'starttime':{'type':Sequelize[_0x5645('0x3')]},'responsetime':{'type':Sequelize[_0x5645('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x5645('0x2')]},'campaigntype':{'type':Sequelize[_0x5645('0x2')]},'membername':{'type':Sequelize[_0x5645('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 55005fd..60445a0 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 _0x776c=['ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./reportAgentPreview.attributes','define'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x776c,0xce));var _0xc776=function(_0x34a3ac,_0x302b47){_0x34a3ac=_0x34a3ac-0x0;var _0x423418=_0x776c[_0x34a3ac];return _0x423418;};'use strict';var _=require(_0xc776('0x0'));var util=require(_0xc776('0x1'));var logger=require(_0xc776('0x2'))('api');var moment=require(_0xc776('0x3'));var BPromise=require(_0xc776('0x4'));var rp=require(_0xc776('0x5'));var fs=require('fs');var path=require(_0xc776('0x6'));var rimraf=require(_0xc776('0x7'));var config=require('../../config/environment');var attributes=require(_0xc776('0x8'));module['exports']=function(_0x28324f,_0x520b59){return _0x28324f[_0xc776('0x9')](_0xc776('0xa'),attributes,{'tableName':_0xc776('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9975=['define','ReportAgentPreview','report_agent_preview','util','../../config/logger','api','bluebird','request-promise','./reportAgentPreview.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9975,0x17d));var _0x5997=function(_0x5bc526,_0x270710){_0x5bc526=_0x5bc526-0x0;var _0x5d3c3b=_0x9975[_0x5bc526];return _0x5d3c3b;};'use strict';var _=require('lodash');var util=require(_0x5997('0x0'));var logger=require(_0x5997('0x1'))(_0x5997('0x2'));var moment=require('moment');var BPromise=require(_0x5997('0x3'));var rp=require(_0x5997('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5997('0x5'));module['exports']=function(_0x639caa,_0x42d681){return _0x639caa[_0x5997('0x6')](_0x5997('0x7'),attributes,{'tableName':_0x5997('0x8'),'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 b20b7fb..9f03233 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 _0x5268=['message','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3a634e,_0x273db2){var _0x2ecddb=function(_0x3a9d2d){while(--_0x3a9d2d){_0x3a634e['push'](_0x3a634e['shift']());}};_0x2ecddb(++_0x273db2);}(_0x5268,0x1ac));var _0x8526=function(_0x17a0b8,_0x42db21){_0x17a0b8=_0x17a0b8-0x0;var _0x3c284a=_0x5268[_0x17a0b8];return _0x3c284a;};'use strict';var _=require(_0x8526('0x0'));var util=require(_0x8526('0x1'));var moment=require(_0x8526('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8526('0x3'));var db=require(_0x8526('0x4'))['db'];var utils=require(_0x8526('0x5'));var logger=require(_0x8526('0x6'))(_0x8526('0x7'));var config=require('../../config/environment');var jayson=require(_0x8526('0x8'));var client=jayson[_0x8526('0x9')][_0x8526('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41d048,_0x1d451c,_0x3819c2){return new BPromise(function(_0x492064,_0x18d60e){return client[_0x8526('0xb')](_0x41d048,_0x3819c2)[_0x8526('0xc')](function(_0x1312ba){logger[_0x8526('0xd')](_0x8526('0xe'),_0x1d451c,_0x8526('0xf'));logger[_0x8526('0x10')](_0x8526('0x11'),_0x1d451c,_0x8526('0xf'),JSON['stringify'](_0x1312ba));if(_0x1312ba['error']){if(_0x1312ba[_0x8526('0x12')][_0x8526('0x13')]===0x1f4){logger[_0x8526('0x12')](_0x8526('0xe'),_0x1d451c,_0x1312ba[_0x8526('0x12')][_0x8526('0x14')]);return _0x18d60e(_0x1312ba[_0x8526('0x12')]['message']);}logger[_0x8526('0x12')](_0x8526('0xe'),_0x1d451c,_0x1312ba[_0x8526('0x12')][_0x8526('0x14')]);return _0x492064(_0x1312ba[_0x8526('0x12')]['message']);}else{logger[_0x8526('0xd')](_0x8526('0xe'),_0x1d451c,_0x8526('0xf'));_0x492064(_0x1312ba['result'][_0x8526('0x14')]);}})[_0x8526('0x15')](function(_0x4c27d7){logger[_0x8526('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x1d451c,_0x4c27d7);_0x18d60e(_0x4c27d7);});});}exports[_0x8526('0x16')]=function(_0x4c3d71){var _0x5c3f37=this;return new Promise(function(_0xf8ad72,_0x32b379){return db[_0x8526('0x17')][_0x8526('0x18')](_0x4c3d71['body'],{'raw':_0x4c3d71['options']?_0x4c3d71[_0x8526('0x19')][_0x8526('0x1a')]===undefined?!![]:![]:!![]})[_0x8526('0xc')](function(_0xb3a6f2){logger[_0x8526('0xd')](_0x8526('0x16'),_0x4c3d71);logger[_0x8526('0x10')](_0x8526('0x16'),_0x4c3d71,JSON[_0x8526('0x1b')](_0xb3a6f2));_0xf8ad72(_0xb3a6f2);})['catch'](function(_0x1527c1){logger[_0x8526('0x12')]('CreateReportAgentPreview',_0x1527c1[_0x8526('0x14')],_0x4c3d71);_0x32b379(_0x5c3f37[_0x8526('0x12')](0x1f4,_0x1527c1['message']));});});}; \ No newline at end of file +var _0xd415=['info','request\x20sent','debug','stringify','error','ReportAgentPreview,\x20%s,\x20%s','message','result','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then'];(function(_0x3bda7b,_0x42ef6c){var _0x290a3f=function(_0x1ecb12){while(--_0x1ecb12){_0x3bda7b['push'](_0x3bda7b['shift']());}};_0x290a3f(++_0x42ef6c);}(_0xd415,0x1e2));var _0x5d41=function(_0x13fe8c,_0x58472c){_0x13fe8c=_0x13fe8c-0x0;var _0x3e3ef4=_0xd415[_0x13fe8c];return _0x3e3ef4;};'use strict';var _=require('lodash');var util=require(_0x5d41('0x0'));var moment=require(_0x5d41('0x1'));var BPromise=require(_0x5d41('0x2'));var rs=require(_0x5d41('0x3'));var fs=require('fs');var Redis=require(_0x5d41('0x4'));var db=require(_0x5d41('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5d41('0x6'));var config=require(_0x5d41('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5d41('0x8')][_0x5d41('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a7e9d,_0x368c7d,_0x4fc872){return new BPromise(function(_0x3dc8cd,_0x4c8a53){return client[_0x5d41('0xa')](_0x4a7e9d,_0x4fc872)[_0x5d41('0xb')](function(_0x189d26){logger[_0x5d41('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x368c7d,_0x5d41('0xd'));logger[_0x5d41('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x368c7d,'request\x20sent',JSON[_0x5d41('0xf')](_0x189d26));if(_0x189d26[_0x5d41('0x10')]){if(_0x189d26['error']['code']===0x1f4){logger['error'](_0x5d41('0x11'),_0x368c7d,_0x189d26[_0x5d41('0x10')]['message']);return _0x4c8a53(_0x189d26[_0x5d41('0x10')][_0x5d41('0x12')]);}logger[_0x5d41('0x10')](_0x5d41('0x11'),_0x368c7d,_0x189d26[_0x5d41('0x10')]['message']);return _0x3dc8cd(_0x189d26[_0x5d41('0x10')][_0x5d41('0x12')]);}else{logger[_0x5d41('0xc')](_0x5d41('0x11'),_0x368c7d,_0x5d41('0xd'));_0x3dc8cd(_0x189d26[_0x5d41('0x13')][_0x5d41('0x12')]);}})['catch'](function(_0x1b8af3){logger[_0x5d41('0x10')](_0x5d41('0x11'),_0x368c7d,_0x1b8af3);_0x4c8a53(_0x1b8af3);});});}exports[_0x5d41('0x14')]=function(_0x285596){var _0x37e946=this;return new Promise(function(_0x2c1dfd,_0xe64d04){return db[_0x5d41('0x15')]['create'](_0x285596[_0x5d41('0x16')],{'raw':_0x285596[_0x5d41('0x17')]?_0x285596['options'][_0x5d41('0x18')]===undefined?!![]:![]:!![]})[_0x5d41('0xb')](function(_0x4377d0){logger[_0x5d41('0xc')]('CreateReportAgentPreview',_0x285596);logger[_0x5d41('0xe')]('CreateReportAgentPreview',_0x285596,JSON[_0x5d41('0xf')](_0x4377d0));_0x2c1dfd(_0x4377d0);})[_0x5d41('0x19')](function(_0x70508c){logger[_0x5d41('0x10')](_0x5d41('0x14'),_0x70508c['message'],_0x285596);_0xe64d04(_0x37e946[_0x5d41('0x10')](0x1f4,_0x70508c['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 2a8329e..48a2559 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 _0x2223=['path','express','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','/openchannel/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','chat','/chat/queues/:id','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x2223,0xee));var _0x3222=function(_0x250c11,_0x1bab96){_0x250c11=_0x250c11-0x0;var _0x531cee=_0x2223[_0x250c11];return _0x531cee;};'use strict';var multer=require(_0x3222('0x0'));var util=require(_0x3222('0x1'));var path=require(_0x3222('0x2'));var express=require(_0x3222('0x3'));var router=express[_0x3222('0x4')]();var auth=require(_0x3222('0x5'));var controller=require('./rpc.controller');router[_0x3222('0x6')](_0x3222('0x7'),auth[_0x3222('0x8')](),controller[_0x3222('0x9')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0x3222('0x8')](),controller[_0x3222('0xa')]);router[_0x3222('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x3222('0x8')](),controller['voiceChannelStopMixMonitor']);router[_0x3222('0x6')](_0x3222('0xb'),auth[_0x3222('0x8')](),controller['voiceQueues']);router['get'](_0x3222('0xc'),auth['isAuthenticated'](),controller[_0x3222('0xd')]);router['get'](_0x3222('0xe'),auth[_0x3222('0x8')](),controller['mailQueues']);router[_0x3222('0x6')](_0x3222('0xf'),auth[_0x3222('0x8')](),controller['mailAccounts']);router[_0x3222('0x6')](_0x3222('0x10'),auth[_0x3222('0x8')](),controller['openchannelQueues']);router['get']('/sms/queues',auth[_0x3222('0x8')](),controller[_0x3222('0x11')]);router[_0x3222('0x6')](_0x3222('0x12'),auth[_0x3222('0x8')](),controller[_0x3222('0x13')]);router[_0x3222('0x6')](_0x3222('0x14'),auth[_0x3222('0x8')](),controller[_0x3222('0x15')]);router[_0x3222('0x6')](_0x3222('0x16'),auth[_0x3222('0x8')](),controller[_0x3222('0x17')]);router['get'](_0x3222('0x18'),auth[_0x3222('0x8')](),controller[_0x3222('0x19')]);router[_0x3222('0x6')](_0x3222('0x1a'),auth['isAuthenticated'](),controller[_0x3222('0x1b')]);router[_0x3222('0x6')](_0x3222('0x1c'),auth['isAuthenticated'](),controller[_0x3222('0x1d')]);router[_0x3222('0x6')](_0x3222('0x1e'),auth[_0x3222('0x8')](),controller['voiceQueuesChannelRedirect']);router[_0x3222('0x6')](_0x3222('0x1f'),auth[_0x3222('0x8')](),controller[_0x3222('0x20')]);router[_0x3222('0x21')](_0x3222('0x1f'),auth['isAuthenticated'](),controller[_0x3222('0x22')]);router[_0x3222('0x6')](_0x3222('0x23'),auth[_0x3222('0x8')](),controller[_0x3222('0x24')]);router[_0x3222('0x6')](_0x3222('0x25'),auth[_0x3222('0x8')](),controller[_0x3222('0x26')]);router[_0x3222('0x6')](_0x3222('0x27'),auth['isAuthenticated'](),controller[_0x3222('0x28')]);router[_0x3222('0x21')](_0x3222('0x29'),auth[_0x3222('0x8')](),controller[_0x3222('0x2a')]);router[_0x3222('0x6')](_0x3222('0x2b'),auth[_0x3222('0x8')](),controller[_0x3222('0x2c')]);router[_0x3222('0x6')]('/trunks',auth[_0x3222('0x8')](),controller[_0x3222('0x2d')]);router[_0x3222('0x6')](_0x3222('0x2e'),auth['isAuthenticated'](),controller['campaigns']);router['get']('/fax/accounts',auth[_0x3222('0x8')](),controller['faxAccounts']);router[_0x3222('0x6')]('/chat/queues/waitinginteractions',auth[_0x3222('0x8')](),controller['chatQueuesWaitingInteractions']);router[_0x3222('0x6')](_0x3222('0x2f'),auth['isAuthenticated'](),controller[_0x3222('0x30')]);router['get'](_0x3222('0x31'),auth[_0x3222('0x8')](),controller[_0x3222('0x32')]);router['get'](_0x3222('0x33'),auth[_0x3222('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0x3222('0x34'),auth[_0x3222('0x8')](),controller[_0x3222('0x35')]);router[_0x3222('0x6')](_0x3222('0x36'),auth['isAuthenticated'](),controller[_0x3222('0x37')]);router['get'](_0x3222('0x38'),auth[_0x3222('0x8')](),controller[_0x3222('0x39')]);router[_0x3222('0x3a')](_0x3222('0x3b'),auth[_0x3222('0x8')](),controller[_0x3222('0x3c')](_0x3222('0x3d')));router[_0x3222('0x6')](_0x3222('0x3e'),auth[_0x3222('0x8')](),controller[_0x3222('0x3f')]);router['post']('/chat/queues/:id/notify',auth[_0x3222('0x8')](),controller[_0x3222('0x3c')](_0x3222('0x40')));router['get'](_0x3222('0x41'),auth[_0x3222('0x8')](),controller['showChatQueues']);router[_0x3222('0x3a')](_0x3222('0x42'),auth['isAuthenticated'](),controller[_0x3222('0x3c')]('fax'));router['get'](_0x3222('0x43'),auth[_0x3222('0x8')](),controller[_0x3222('0x44')]);router['post'](_0x3222('0x45'),auth['isAuthenticated'](),controller[_0x3222('0x3c')](_0x3222('0x46')));router[_0x3222('0x6')]('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0x3222('0x47')]);router[_0x3222('0x3a')](_0x3222('0x48'),auth[_0x3222('0x8')](),controller[_0x3222('0x3c')](_0x3222('0x49')));router[_0x3222('0x3a')]('/whatsapp/queues/:id/notify',auth[_0x3222('0x8')](),controller['queueNotify'](_0x3222('0x4a')));router[_0x3222('0x6')](_0x3222('0x4b'),auth['isAuthenticated'](),controller[_0x3222('0x4c')]);router[_0x3222('0x6')]('/whatsapp/queues/:id',auth[_0x3222('0x8')](),controller[_0x3222('0x4d')]);router[_0x3222('0x3a')](_0x3222('0x4e'),auth['isAuthenticated'](),controller[_0x3222('0x4f')]);module['exports']=router; \ No newline at end of file +var _0x478d=['smsQueues','/whatsapp/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outboundChannels','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','/campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','multer','util','path','express','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x478d,0x89));var _0xd478=function(_0x18cebd,_0x5f138f){_0x18cebd=_0x18cebd-0x0;var _0x4c702f=_0x478d[_0x18cebd];return _0x4c702f;};'use strict';var multer=require(_0xd478('0x0'));var util=require(_0xd478('0x1'));var path=require(_0xd478('0x2'));var express=require(_0xd478('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xd478('0x4'));router[_0xd478('0x5')](_0xd478('0x6'),auth[_0xd478('0x7')](),controller[_0xd478('0x8')]);router[_0xd478('0x5')](_0xd478('0x9'),auth[_0xd478('0x7')](),controller[_0xd478('0xa')]);router[_0xd478('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xd478('0x7')](),controller[_0xd478('0xb')]);router[_0xd478('0x5')](_0xd478('0xc'),auth[_0xd478('0x7')](),controller[_0xd478('0xd')]);router['get']('/chat/queues',auth['isAuthenticated'](),controller[_0xd478('0xe')]);router['get'](_0xd478('0xf'),auth[_0xd478('0x7')](),controller[_0xd478('0x10')]);router[_0xd478('0x5')](_0xd478('0x11'),auth[_0xd478('0x7')](),controller['mailAccounts']);router['get'](_0xd478('0x12'),auth[_0xd478('0x7')](),controller[_0xd478('0x13')]);router['get'](_0xd478('0x14'),auth['isAuthenticated'](),controller[_0xd478('0x15')]);router[_0xd478('0x5')](_0xd478('0x16'),auth[_0xd478('0x7')](),controller['whatsappQueues']);router['get']('/fax/queues',auth['isAuthenticated'](),controller[_0xd478('0x17')]);router[_0xd478('0x5')](_0xd478('0x18'),auth[_0xd478('0x7')](),controller['voiceQueuesPreview']);router[_0xd478('0x5')](_0xd478('0x19'),auth[_0xd478('0x7')](),controller[_0xd478('0x1a')]);router[_0xd478('0x5')](_0xd478('0x1b'),auth['isAuthenticated'](),controller[_0xd478('0x1c')]);router['get'](_0xd478('0x1d'),auth[_0xd478('0x7')](),controller[_0xd478('0x1e')]);router[_0xd478('0x5')](_0xd478('0x1f'),auth[_0xd478('0x7')](),controller['voiceQueuesChannelRedirect']);router[_0xd478('0x5')](_0xd478('0x20'),auth[_0xd478('0x7')](),controller[_0xd478('0x21')]);router[_0xd478('0x22')](_0xd478('0x20'),auth[_0xd478('0x7')](),controller[_0xd478('0x23')]);router[_0xd478('0x5')](_0xd478('0x24'),auth['isAuthenticated'](),controller['outbound']);router[_0xd478('0x5')]('/outbound/channels',auth[_0xd478('0x7')](),controller[_0xd478('0x25')]);router[_0xd478('0x5')]('/agents',auth[_0xd478('0x7')](),controller['agents']);router['put'](_0xd478('0x26'),auth[_0xd478('0x7')](),controller[_0xd478('0x27')]);router['get'](_0xd478('0x28'),auth[_0xd478('0x7')](),controller[_0xd478('0x29')]);router[_0xd478('0x5')](_0xd478('0x2a'),auth[_0xd478('0x7')](),controller['trunks']);router[_0xd478('0x5')](_0xd478('0x2b'),auth[_0xd478('0x7')](),controller['campaigns']);router['get']('/fax/accounts',auth[_0xd478('0x7')](),controller[_0xd478('0x2c')]);router[_0xd478('0x5')](_0xd478('0x2d'),auth[_0xd478('0x7')](),controller[_0xd478('0x2e')]);router[_0xd478('0x5')](_0xd478('0x2f'),auth[_0xd478('0x7')](),controller[_0xd478('0x30')]);router['get'](_0xd478('0x31'),auth[_0xd478('0x7')](),controller[_0xd478('0x32')]);router['get'](_0xd478('0x33'),auth[_0xd478('0x7')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0xd478('0x5')]('/sms/queues/waitinginteractions',auth[_0xd478('0x7')](),controller['smsQueuesWaitingInteractions']);router[_0xd478('0x5')](_0xd478('0x34'),auth[_0xd478('0x7')](),controller[_0xd478('0x35')]);router[_0xd478('0x5')]('/fax/queues/waitinginteractions',auth[_0xd478('0x7')](),controller[_0xd478('0x36')]);router['post']('/mail/queues/:id/notify',auth[_0xd478('0x7')](),controller[_0xd478('0x37')](_0xd478('0x38')));router['get'](_0xd478('0x39'),auth[_0xd478('0x7')](),controller[_0xd478('0x3a')]);router[_0xd478('0x3b')](_0xd478('0x3c'),auth['isAuthenticated'](),controller['queueNotify'](_0xd478('0x3d')));router[_0xd478('0x5')](_0xd478('0x3e'),auth[_0xd478('0x7')](),controller[_0xd478('0x3f')]);router[_0xd478('0x3b')]('/fax/queues/:id/notify',auth[_0xd478('0x7')](),controller['queueNotify']('fax'));router[_0xd478('0x5')](_0xd478('0x40'),auth[_0xd478('0x7')](),controller[_0xd478('0x41')]);router[_0xd478('0x3b')](_0xd478('0x42'),auth['isAuthenticated'](),controller['queueNotify'](_0xd478('0x43')));router['get'](_0xd478('0x44'),auth[_0xd478('0x7')](),controller[_0xd478('0x45')]);router[_0xd478('0x3b')](_0xd478('0x46'),auth[_0xd478('0x7')](),controller['queueNotify'](_0xd478('0x47')));router['post'](_0xd478('0x48'),auth[_0xd478('0x7')](),controller['queueNotify'](_0xd478('0x49')));router[_0xd478('0x5')](_0xd478('0x4a'),auth[_0xd478('0x7')](),controller[_0xd478('0x4b')]);router[_0xd478('0x5')](_0xd478('0x4c'),auth[_0xd478('0x7')](),controller[_0xd478('0x4d')]);router[_0xd478('0x3b')]('/agents/:id/notify',auth[_0xd478('0x7')](),controller[_0xd478('0x4e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index c719d6f..706fec4 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','TransferReport','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','chat','agent','Message','create','Start','agentTransferTimeout','bluebird','moment','../../config/logger','api','jayson/promise','client','http','request','then','error','code','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','findAll','user','length','format','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','internal','capacity','campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues'];(function(_0x1a932a,_0x243812){var _0x5f07da=function(_0x4a6c5a){while(--_0x4a6c5a){_0x1a932a['push'](_0x1a932a['shift']());}};_0x5f07da(++_0x243812);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var BPromise=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var jayson=require(_0x0d8b('0x4'));var amiClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){var _0x129310=_0x413284?_0x413284:amiClient;return _0x129310[_0x0d8b('0x7')](_0x39f43a,_0x4a4470)[_0x0d8b('0x8')](function(_0x1f4800){if(_0x1f4800[_0x0d8b('0x9')]){if(_0x1f4800[_0x0d8b('0x9')][_0x0d8b('0xa')]===0x1f4){return _0x58e4e2(_0x1f4800[_0x0d8b('0x9')]['message']);}return _0x284169(_0x1f4800[_0x0d8b('0x9')]['message']);}else{_0x284169(_0x1f4800[_0x0d8b('0xb')]);}})[_0x0d8b('0xc')](function(_0x340cc4){_0x58e4e2(_0x340cc4);});});}function respondWithResult(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xc8;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0xe')](_0x32bb1a);}return _0x92cdd8[_0x0d8b('0xf')](0x194);};}function handleError(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0x1f4;return function(_0xe65334){logger[_0x0d8b('0x9')](_0xe65334[_0x0d8b('0x10')]);if(_0xe65334['name']){delete _0xe65334[_0x0d8b('0x11')];}_0x2ce75e[_0x0d8b('0xd')](_0x5ad086)[_0x0d8b('0x12')](_0xe65334);};}function findById(_0xe2e167){return function(_0x2cb03c){if(!_['isNil'](_0xe2e167)&&!_[_0x0d8b('0x13')](_0x2cb03c)&&!_[_0x0d8b('0x13')](_0x2cb03c[_0x0d8b('0x14')])){return _[_0x0d8b('0x15')](_0x2cb03c[_0x0d8b('0x14')],function(_0x18dd2d){return _0x18dd2d['id']==_0xe2e167;});}return null;};}exports[_0x0d8b('0x16')]=function(_0xa3612a,_0x4a15bf){return respondWithRpcPromise(_0x0d8b('0x17'),_0xa3612a[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4a15bf,null))[_0x0d8b('0xc')](handleError(_0x4a15bf,null));};exports[_0x0d8b('0x19')]=function(_0x5b709c,_0x393beb){return respondWithRpcPromise(_0x0d8b('0x1a'),_['merge'](_0x5b709c['query'],_0x5b709c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x393beb,null))['catch'](handleError(_0x393beb,null));};exports['voiceChannelStopMixMonitor']=function(_0x238728,_0x2b924f){return respondWithRpcPromise(_0x0d8b('0x1c'),_[_0x0d8b('0x1d')](_0x238728[_0x0d8b('0x18')],_0x238728[_0x0d8b('0x1b')]))[_0x0d8b('0x8')](respondWithResult(_0x2b924f,null))[_0x0d8b('0xc')](handleError(_0x2b924f,null));};exports[_0x0d8b('0x1e')]=function(_0x5e5bc3,_0xe8bbee){return respondWithRpcPromise(_0x0d8b('0x1f'),_0x5e5bc3['query'])[_0x0d8b('0x8')](respondWithResult(_0xe8bbee,null))['catch'](handleError(_0xe8bbee,null));};exports[_0x0d8b('0x20')]=function(_0x234bdd,_0xa2af02){return respondWithRpcPromise('VoiceQueues',_0x234bdd['query'])[_0x0d8b('0x8')](findById(_0x234bdd[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0xa2af02,null))[_0x0d8b('0xc')](handleError(_0xa2af02,null));};exports['updateVoiceQueue']=function(_0x1b2b59,_0x4b59e5){return respondWithRpcPromise(_0x0d8b('0x21'),_['merge'](_0x1b2b59[_0x0d8b('0x22')],_0x1b2b59['params']))[_0x0d8b('0x8')](respondWithResult(_0x4b59e5,null))['catch'](handleError(_0x4b59e5,null));};exports[_0x0d8b('0x23')]=function(_0x106e4c,_0x2c058d){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x106e4c['query'],_0x106e4c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x2c058d,null))[_0x0d8b('0xc')](handleError(_0x2c058d,null));};exports['voiceQueuesChannels']=function(_0x5d05fc,_0x36017a){return respondWithRpcPromise(_0x0d8b('0x24'),_0x5d05fc[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x36017a,null))[_0x0d8b('0xc')](handleError(_0x36017a,null));};exports[_0x0d8b('0x25')]=function(_0x4a99d3,_0x6f93c7){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0d8b('0x1d')](_0x4a99d3[_0x0d8b('0x18')],_0x4a99d3['params']))[_0x0d8b('0x8')](respondWithResult(_0x6f93c7,null))[_0x0d8b('0xc')](handleError(_0x6f93c7,null));};exports[_0x0d8b('0x26')]=function(_0x4f2ed2,_0x113318){return respondWithRpcPromise(_0x0d8b('0x27'),_[_0x0d8b('0x1d')](_0x4f2ed2[_0x0d8b('0x18')],_0x4f2ed2[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x113318,null))[_0x0d8b('0xc')](handleError(_0x113318,null));};exports[_0x0d8b('0x28')]=function(_0x5ad0fe,_0x1180ac){return respondWithRpcPromise(_0x0d8b('0x29'),_[_0x0d8b('0x1d')](_0x5ad0fe[_0x0d8b('0x18')],_0x5ad0fe[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x1180ac,null))['catch'](handleError(_0x1180ac,null));};exports[_0x0d8b('0x2a')]=function(_0x5c2c04,_0x531c55){return respondWithRpcPromise(_0x0d8b('0x2b'),_0x5c2c04[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x531c55,null))[_0x0d8b('0xc')](handleError(_0x531c55,null));};exports[_0x0d8b('0x2c')]=function(_0x24c789,_0x579324){return respondWithRpcPromise(_0x0d8b('0x2d'),_0x24c789[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x579324,null))[_0x0d8b('0xc')](handleError(_0x579324,null));};exports[_0x0d8b('0x2e')]=function(_0x1a39ad,_0xf1680e){var _0x5c980b;return respondWithRpcPromise(_0x0d8b('0x2f'),_0x1a39ad[_0x0d8b('0x18')])[_0x0d8b('0x8')](function(_0x1f196d){_0x5c980b=_0x1f196d;return respondWithRpcPromise('Agents',_0x1a39ad[_0x0d8b('0x18')],routingClient);})['then'](function(_0x37b26c){return _[_0x0d8b('0x1d')]({},_0x37b26c,_0x5c980b);})[_0x0d8b('0x8')](respondWithResult(_0xf1680e,null))[_0x0d8b('0xc')](handleError(_0xf1680e,null));};exports[_0x0d8b('0x30')]=function(_0x3e632e,_0x1ff17d){if(_0x3e632e[_0x0d8b('0x22')]&&_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]&&_0x3e632e['user']&&_0x3e632e['user']['name']){for(var _0x4d0811 in _0x3e632e['body'][_0x0d8b('0x31')]){if(_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]['hasOwnProperty'](_0x4d0811)){db['MemberReport'][_0x0d8b('0x32')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811]&&_0x3e632e['body']['interaction'][_0x4d0811][_0x0d8b('0x34')]?{'$notIn':_0x3e632e['body'][_0x0d8b('0x31')][_0x4d0811]}:{'$ne':null}}})['then'](function(_0x53f643){var _0x30ccee=moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5ebe8a=0x0,_0x59b8e9=_0x53f643['length'];_0x5ebe8a<_0x59b8e9;_0x5ebe8a+=0x1){_0x53f643[_0x5ebe8a][_0x0d8b('0x36')]({'exitAt':_0x30ccee});}});for(var _0x1e0498=0x0;_0x1e0498<_0x3e632e[_0x0d8b('0x22')]['interaction'][_0x4d0811][_0x0d8b('0x34')];_0x1e0498+=0x1){db[_0x0d8b('0x37')][_0x0d8b('0x38')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':_0x0d8b('0x39'),'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498],'exitAt':null},'defaults':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'interface':_[_0x0d8b('0x13')](_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')])?util[_0x0d8b('0x35')](_0x0d8b('0x3b'),_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')]):_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')],'type':'INTERACTION','enterAt':moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3c')],'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3e632e[_0x0d8b('0x1b')]['id'],'capacity':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x3d')]},routingClient)[_0x0d8b('0x8')](respondWithResult(_0x1ff17d,null))[_0x0d8b('0xc')](handleError(_0x1ff17d,null));};exports['telephones']=function(_0x5c0824,_0x4e4d5f){return respondWithRpcPromise('Telephones',_0x5c0824[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4e4d5f,null))['catch'](handleError(_0x4e4d5f,null));};exports['trunks']=function(_0x44c5c1,_0x3d3cb6){return respondWithRpcPromise('Trunks',_0x44c5c1['query'])[_0x0d8b('0x8')](respondWithResult(_0x3d3cb6,null))[_0x0d8b('0xc')](handleError(_0x3d3cb6,null));};exports[_0x0d8b('0x3e')]=function(_0x346c0d,_0x2d5519){return respondWithRpcPromise('Campaigns',_0x346c0d[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x2d5519,null))['catch'](handleError(_0x2d5519,null));};exports['chatQueues']=function(_0xf6a773,_0x3f2d95){return respondWithRpcPromise('ChatQueues',_0xf6a773['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f2d95,null))[_0x0d8b('0xc')](handleError(_0x3f2d95,null));};exports[_0x0d8b('0x3f')]=function(_0xb58818,_0x4a2989){return respondWithRpcPromise(_0x0d8b('0x40'),_0xb58818['query'],routingClient)['then'](findById(_0xb58818[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x4a2989,null))['catch'](handleError(_0x4a2989,null));};exports['mailQueues']=function(_0x44ed23,_0x3d7161){return respondWithRpcPromise(_0x0d8b('0x41'),_0x44ed23[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3d7161,null))[_0x0d8b('0xc')](handleError(_0x3d7161,null));};exports[_0x0d8b('0x42')]=function(_0x3bead7,_0x5418d8){return respondWithRpcPromise(_0x0d8b('0x41'),_0x3bead7[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x3bead7[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x5418d8,null))[_0x0d8b('0xc')](handleError(_0x5418d8,null));};exports[_0x0d8b('0x43')]=function(_0x1c78b6,_0x375684){return respondWithRpcPromise('MailAccounts',_0x1c78b6[_0x0d8b('0x18')],mailClient)[_0x0d8b('0x8')](respondWithResult(_0x375684,null))[_0x0d8b('0xc')](handleError(_0x375684,null));};exports[_0x0d8b('0x44')]=function(_0x43ad22,_0x577951){return respondWithRpcPromise(_0x0d8b('0x45'),_0x43ad22[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x577951,null))[_0x0d8b('0xc')](handleError(_0x577951,null));};exports[_0x0d8b('0x46')]=function(_0x59ada2,_0x4d0e7c){return respondWithRpcPromise(_0x0d8b('0x45'),_0x59ada2[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x59ada2[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0x4d0e7c,null))[_0x0d8b('0xc')](handleError(_0x4d0e7c,null));};exports[_0x0d8b('0x47')]=function(_0x8c0bbe,_0x5952dd){return respondWithRpcPromise(_0x0d8b('0x48'),_0x8c0bbe['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5952dd,null))[_0x0d8b('0xc')](handleError(_0x5952dd,null));};exports[_0x0d8b('0x49')]=function(_0x26ccf0,_0x2b6eb6){return respondWithRpcPromise(_0x0d8b('0x48'),_0x26ccf0['query'],routingClient)[_0x0d8b('0x8')](findById(_0x26ccf0['params']['id']))[_0x0d8b('0x8')](respondWithResult(_0x2b6eb6,null))[_0x0d8b('0xc')](handleError(_0x2b6eb6,null));};exports[_0x0d8b('0x4a')]=function(_0x33a614,_0x48025e){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x33a614[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x48025e,null))[_0x0d8b('0xc')](handleError(_0x48025e,null));};exports[_0x0d8b('0x4c')]=function(_0x273aef,_0x223fd8){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x273aef[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x273aef['params']['id']))['then'](respondWithResult(_0x223fd8,null))[_0x0d8b('0xc')](handleError(_0x223fd8,null));};exports[_0x0d8b('0x4d')]=function(_0x53e399,_0xb1aa96){return respondWithRpcPromise('FaxQueues',_0x53e399['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0xb1aa96,null))[_0x0d8b('0xc')](handleError(_0xb1aa96,null));};exports['showFaxQueues']=function(_0x587128,_0x1900e3){return respondWithRpcPromise(_0x0d8b('0x4e'),_0x587128[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x587128[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x1900e3,null))[_0x0d8b('0xc')](handleError(_0x1900e3,null));};exports['faxAccounts']=function(_0x1ca60c,_0x5878c2){return respondWithRpcPromise(_0x0d8b('0x4f'),_0x1ca60c[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x5878c2,null))[_0x0d8b('0xc')](handleError(_0x5878c2,null));};exports['chatQueuesWaitingInteractions']=function(_0x3fe47d,_0x4a1c4a){return respondWithRpcPromise(_0x0d8b('0x50'),_0x3fe47d[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x4a1c4a,null))[_0x0d8b('0xc')](handleError(_0x4a1c4a,null));};exports[_0x0d8b('0x51')]=function(_0x2b44e5,_0x3e927c){return respondWithRpcPromise(_0x0d8b('0x52'),_0x2b44e5[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e927c,null))['catch'](handleError(_0x3e927c,null));};exports[_0x0d8b('0x53')]=function(_0x54c28b,_0x3e4121){return respondWithRpcPromise(_0x0d8b('0x54'),_0x54c28b['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e4121,null))['catch'](handleError(_0x3e4121,null));};exports[_0x0d8b('0x55')]=function(_0x445a00,_0x24f75){return respondWithRpcPromise(_0x0d8b('0x54'),_0x445a00[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](function(_0x3a073b){if(_0x445a00[_0x0d8b('0x18')]['type']!==undefined){var _0x10eca6=_(_0x3a073b[_0x0d8b('0x14')])['filter']([_0x445a00[_0x0d8b('0x18')][_0x0d8b('0x56')],_0x445a00[_0x0d8b('0x1b')]['id']])[_0x0d8b('0x57')](_0x0d8b('0x58'))[_0x0d8b('0x59')]()[_0x0d8b('0x5a')]();return _0x3a073b[_0x0d8b('0x14')][_0x0d8b('0x5b')](function(_0x5007c0){return _0x10eca6[_0x0d8b('0x5c')](_0x5007c0[_0x0d8b('0x58')])>-0x1;});}else{return _0x3a073b['rows'][_0x0d8b('0x5b')](function(_0x93fc55){return _0x93fc55[_0x0d8b('0x58')]===parseInt(_0x445a00['params']['id']);});}})['then'](respondWithResult(_0x24f75,null))[_0x0d8b('0xc')](handleError(_0x24f75,null));};exports[_0x0d8b('0x5d')]=function(_0x2c55bc,_0x5b76af){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c55bc[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5b76af,null))[_0x0d8b('0xc')](handleError(_0x5b76af,null));};exports[_0x0d8b('0x5e')]=function(_0x2a2b58,_0x3f7895){return respondWithRpcPromise(_0x0d8b('0x5f'),_0x2a2b58[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f7895,null))[_0x0d8b('0xc')](handleError(_0x3f7895,null));};exports[_0x0d8b('0x60')]=function(_0x291336,_0x3b060e){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x291336[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3b060e,null))['catch'](handleError(_0x3b060e,null));};exports['queueNotify']=function(_0x1a1029){return function(_0x1dad9f,_0x3573b4){var _0x14b1b8,_0x23e2e0;var _0x354208=_['capitalize'](_0x1a1029);var _0x502715=_0x1a1029==='chat'?_0x0d8b('0x61'):_0x0d8b('0x62');return db[_0x354208+_0x0d8b('0x63')][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x1dad9f[_0x0d8b('0x1b')]['id']}})[_0x0d8b('0x8')](function(_0x5ef461){if(_[_0x0d8b('0x13')](_0x5ef461)){throw new Error(_0x354208+_0x0d8b('0x65'));}_0x14b1b8=_0x5ef461;return db[_0x354208+'Message'][_0x0d8b('0x64')]({'where':{'id':_0x1dad9f['body'][_0x0d8b('0x66')]},'include':[{'model':db[_0x354208+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x354208+_0x502715],'as':_0x0d8b('0x62')}]});})[_0x0d8b('0x8')](function(_0x8fae7f){if(_[_0x0d8b('0x13')](_0x8fae7f)){throw new Error(_0x354208+_0x0d8b('0x68'));}_0x23e2e0=_0x8fae7f;return _0x8fae7f[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x276558={'uniqueid':_0x1a1029+'.'+_0x23e2e0['id']+'.'+_0x23e2e0[_0x0d8b('0x67')]['id'],'FromUserId':_0x1dad9f['user']['id'],'type':'queue'};_0x276558[_0x354208+_0x0d8b('0x6a')]=_0x23e2e0['id'];_0x276558[_0x354208+_0x0d8b('0x6b')]=_0x23e2e0[_0x0d8b('0x67')]['id'];_0x276558[_0x0d8b('0x6c')+_0x354208+_0x502715+'Id']=_0x23e2e0[_0x0d8b('0x62')]['id'];_0x276558['To'+_0x354208+_0x0d8b('0x6d')]=_0x14b1b8['id'];return db[_0x354208+_0x0d8b('0x6e')]['create'](_0x276558);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a1029,'interaction':_0x23e2e0[_0x0d8b('0x67')],'message':_0x23e2e0,'account':_0x23e2e0['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x14b1b8[_0x0d8b('0x11')]+','+(_0x23e2e0[_0x0d8b('0x62')][_0x0d8b('0x6f')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})[_0x0d8b('0x8')](respondWithResult(_0x3573b4,null))[_0x0d8b('0xc')](handleError(_0x3573b4,null));};};exports[_0x0d8b('0x71')]=function(_0x180eda,_0x35267a){var _0x20a8b6,_0x3a6014;if(_[_0x0d8b('0x13')](_0x180eda['body'][_0x0d8b('0x72')])){throw new Error(_0x0d8b('0x73'));}var _0x8be77c=_0x180eda['body']['channel'];var _0x2db144=_[_0x0d8b('0x74')](_0x8be77c);var _0x36d6ca=_0x8be77c===_0x0d8b('0x75')?_0x0d8b('0x61'):_0x0d8b('0x62');return db['User'][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x180eda[_0x0d8b('0x1b')]['id'],'role':_0x0d8b('0x76')}})[_0x0d8b('0x8')](function(_0x4350ee){if(_['isNil'](_0x4350ee)){throw new Error('Agent\x20not\x20found');}_0x20a8b6=_0x4350ee;return db[_0x2db144+_0x0d8b('0x77')][_0x0d8b('0x64')]({'where':{'id':_0x180eda[_0x0d8b('0x22')]['messageId']},'include':[{'model':db[_0x2db144+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x2db144+_0x36d6ca],'as':_0x0d8b('0x62')}]});})['then'](function(_0xb61d4b){if(_[_0x0d8b('0x13')](_0xb61d4b)){throw new Error(_0x2db144+_0x0d8b('0x68'));}_0x3a6014=_0xb61d4b;return _0xb61d4b[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x150e9f={'uniqueid':_0x8be77c+'.'+_0x3a6014['id']+'.'+_0x3a6014[_0x0d8b('0x67')]['id'],'FromUserId':_0x180eda[_0x0d8b('0x33')]['id'],'type':_0x0d8b('0x76'),'ToUserId':_0x20a8b6['id']};_0x150e9f[_0x2db144+'MessageId']=_0x3a6014['id'];_0x150e9f[_0x2db144+_0x0d8b('0x6b')]=_0x3a6014[_0x0d8b('0x67')]['id'];_0x150e9f[_0x0d8b('0x6c')+_0x2db144+_0x36d6ca+'Id']=_0x3a6014[_0x0d8b('0x62')]['id'];return db[_0x2db144+_0x0d8b('0x6e')][_0x0d8b('0x78')](_0x150e9f);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise(_0x0d8b('0x79'),{'channel':_0x8be77c,'interaction':_0x3a6014[_0x0d8b('0x67')],'message':_0x3a6014,'account':_0x3a6014['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x20a8b6[_0x0d8b('0x11')]+','+(_0x3a6014[_0x0d8b('0x62')][_0x0d8b('0x7a')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x35267a,null))[_0x0d8b('0xc')](handleError(_0x35267a,null));}; \ No newline at end of file +var _0xbaf0=['MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','InteractionId','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','status','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions'];(function(_0x24cd0a,_0x14ab93){var _0xae7451=function(_0x52b358){while(--_0x52b358){_0x24cd0a['push'](_0x24cd0a['shift']());}};_0xae7451(++_0x14ab93);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var db=require(_0x0baf('0x3'))['db'];var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232a});var mailClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232b});var routingClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){var _0x5f20aa=_0x1d0a0d?_0x1d0a0d:amiClient;return _0x5f20aa[_0x0baf('0x8')](_0x1a10b1,_0x2dcaac)[_0x0baf('0x9')](function(_0x465528){if(_0x465528[_0x0baf('0xa')]){if(_0x465528[_0x0baf('0xa')][_0x0baf('0xb')]===0x1f4){return _0x11b947(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}return _0x5f5030(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}else{_0x5f5030(_0x465528[_0x0baf('0xd')]);}})['catch'](function(_0x5a53e2){_0x11b947(_0x5a53e2);});});}function respondWithResult(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xc8;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0xe')](_0xe4378c)['json'](_0x5db689);}return _0x465dd7[_0x0baf('0xf')](0x194);};}function handleError(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0x1f4;return function(_0x1f50c3){logger[_0x0baf('0xa')](_0x1f50c3[_0x0baf('0x10')]);if(_0x1f50c3[_0x0baf('0x11')]){delete _0x1f50c3[_0x0baf('0x11')];}_0x49e44b['status'](_0x1c76a8)['send'](_0x1f50c3);};}function findById(_0x2312c7){return function(_0x38395b){if(!_[_0x0baf('0x12')](_0x2312c7)&&!_[_0x0baf('0x12')](_0x38395b)&&!_[_0x0baf('0x12')](_0x38395b[_0x0baf('0x13')])){return _['find'](_0x38395b[_0x0baf('0x13')],function(_0xfbecec){return _0xfbecec['id']==_0x2312c7;});}return null;};}exports[_0x0baf('0x14')]=function(_0x3e9cb4,_0x47070d){return respondWithRpcPromise(_0x0baf('0x15'),_0x3e9cb4['query'])['then'](respondWithResult(_0x47070d,null))[_0x0baf('0x16')](handleError(_0x47070d,null));};exports[_0x0baf('0x17')]=function(_0x32e839,_0x1848e8){return respondWithRpcPromise(_0x0baf('0x18'),_[_0x0baf('0x19')](_0x32e839[_0x0baf('0x1a')],_0x32e839[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1848e8,null))[_0x0baf('0x16')](handleError(_0x1848e8,null));};exports['voiceChannelStopMixMonitor']=function(_0x334bd6,_0x482522){return respondWithRpcPromise(_0x0baf('0x1c'),_['merge'](_0x334bd6['query'],_0x334bd6[_0x0baf('0x1b')]))['then'](respondWithResult(_0x482522,null))['catch'](handleError(_0x482522,null));};exports[_0x0baf('0x1d')]=function(_0x27b59c,_0x34e264){return respondWithRpcPromise(_0x0baf('0x1e'),_0x27b59c[_0x0baf('0x1a')])['then'](respondWithResult(_0x34e264,null))[_0x0baf('0x16')](handleError(_0x34e264,null));};exports[_0x0baf('0x1f')]=function(_0x1ca35a,_0x366e71){return respondWithRpcPromise(_0x0baf('0x1e'),_0x1ca35a[_0x0baf('0x1a')])[_0x0baf('0x9')](findById(_0x1ca35a['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x366e71,null))[_0x0baf('0x16')](handleError(_0x366e71,null));};exports[_0x0baf('0x20')]=function(_0x265915,_0x55c715){return respondWithRpcPromise(_0x0baf('0x21'),_[_0x0baf('0x19')](_0x265915['body'],_0x265915[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x55c715,null))[_0x0baf('0x16')](handleError(_0x55c715,null));};exports[_0x0baf('0x22')]=function(_0xd14f0f,_0x366924){return respondWithRpcPromise(_0x0baf('0x23'),_['merge'](_0xd14f0f[_0x0baf('0x1a')],_0xd14f0f[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x366924,null))[_0x0baf('0x16')](handleError(_0x366924,null));};exports[_0x0baf('0x24')]=function(_0x275ea1,_0x2fc983){return respondWithRpcPromise(_0x0baf('0x25'),_0x275ea1[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x2fc983,null))[_0x0baf('0x16')](handleError(_0x2fc983,null));};exports[_0x0baf('0x26')]=function(_0x45294a,_0x3a3353){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0baf('0x19')](_0x45294a['query'],_0x45294a[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x3a3353,null))[_0x0baf('0x16')](handleError(_0x3a3353,null));};exports[_0x0baf('0x27')]=function(_0x5300a5,_0x1a2b03){return respondWithRpcPromise(_0x0baf('0x28'),_['merge'](_0x5300a5[_0x0baf('0x1a')],_0x5300a5[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1a2b03,null))[_0x0baf('0x16')](handleError(_0x1a2b03,null));};exports[_0x0baf('0x29')]=function(_0x1b0991,_0xe03d82){return respondWithRpcPromise(_0x0baf('0x2a'),_['merge'](_0x1b0991[_0x0baf('0x1a')],_0x1b0991[_0x0baf('0x1b')]))['then'](respondWithResult(_0xe03d82,null))[_0x0baf('0x16')](handleError(_0xe03d82,null));};exports['outbound']=function(_0x5c545f,_0x11bc49){return respondWithRpcPromise(_0x0baf('0x2b'),_0x5c545f['query'])['then'](respondWithResult(_0x11bc49,null))[_0x0baf('0x16')](handleError(_0x11bc49,null));};exports[_0x0baf('0x2c')]=function(_0x3412bc,_0xb2d9ab){return respondWithRpcPromise(_0x0baf('0x2d'),_0x3412bc[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0xb2d9ab,null))[_0x0baf('0x16')](handleError(_0xb2d9ab,null));};exports[_0x0baf('0x2e')]=function(_0x36c6d2,_0x200864){var _0x148540;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2[_0x0baf('0x1a')])['then'](function(_0x3573ce){_0x148540=_0x3573ce;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2['query'],routingClient);})[_0x0baf('0x9')](function(_0x324369){return _[_0x0baf('0x19')]({},_0x324369,_0x148540);})[_0x0baf('0x9')](respondWithResult(_0x200864,null))[_0x0baf('0x16')](handleError(_0x200864,null));};exports[_0x0baf('0x30')]=function(_0x57b581,_0x23ad34){if(_0x57b581[_0x0baf('0x31')]&&_0x57b581['body'][_0x0baf('0x32')]&&_0x57b581[_0x0baf('0x33')]&&_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]){for(var _0x504031 in _0x57b581[_0x0baf('0x31')][_0x0baf('0x32')]){if(_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x0baf('0x34')](_0x504031)){db[_0x0baf('0x35')][_0x0baf('0x36')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':_0x0baf('0x37'),'exitAt':null,'uniqueid':_0x57b581['body'][_0x0baf('0x32')][_0x504031]&&_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')]?{'$notIn':_0x57b581[_0x0baf('0x31')]['interaction'][_0x504031]}:{'$ne':null}}})[_0x0baf('0x9')](function(_0x310240){var _0x27c3ee=moment()[_0x0baf('0x39')](_0x0baf('0x3a'));for(var _0x54ed41=0x0,_0x2a0924=_0x310240[_0x0baf('0x38')];_0x54ed41<_0x2a0924;_0x54ed41+=0x1){_0x310240[_0x54ed41][_0x0baf('0x3b')]({'exitAt':_0x27c3ee});}});for(var _0x1522b0=0x0;_0x1522b0<_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')];_0x1522b0+=0x1){db['MemberReport'][_0x0baf('0x3c')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':'INTERACTION','uniqueid':_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x1522b0],'exitAt':null},'defaults':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'interface':_[_0x0baf('0x12')](_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')])?util['format'](_0x0baf('0x3e'),_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]):_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')],'type':_0x0baf('0x37'),'enterAt':moment()[_0x0baf('0x39')](_0x0baf('0x3a')),'role':_0x0baf('0x3f'),'internal':_0x57b581[_0x0baf('0x33')][_0x0baf('0x40')],'uniqueid':_0x57b581['body']['interaction'][_0x504031][_0x1522b0]}});}}}}return respondWithRpcPromise(_0x0baf('0x41'),{'id':_0x57b581[_0x0baf('0x1b')]['id'],'capacity':_0x57b581[_0x0baf('0x31')][_0x0baf('0x42')]},routingClient)[_0x0baf('0x9')](respondWithResult(_0x23ad34,null))[_0x0baf('0x16')](handleError(_0x23ad34,null));};exports[_0x0baf('0x43')]=function(_0x4b492c,_0x3fe534){return respondWithRpcPromise(_0x0baf('0x44'),_0x4b492c[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x3fe534,null))[_0x0baf('0x16')](handleError(_0x3fe534,null));};exports[_0x0baf('0x45')]=function(_0x5e1849,_0x3eebe5){return respondWithRpcPromise('Trunks',_0x5e1849[_0x0baf('0x1a')])['then'](respondWithResult(_0x3eebe5,null))[_0x0baf('0x16')](handleError(_0x3eebe5,null));};exports['campaigns']=function(_0x35b1a5,_0x4c035b){return respondWithRpcPromise(_0x0baf('0x46'),_0x35b1a5[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x4c035b,null))[_0x0baf('0x16')](handleError(_0x4c035b,null));};exports[_0x0baf('0x47')]=function(_0x576475,_0x21f179){return respondWithRpcPromise(_0x0baf('0x48'),_0x576475[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21f179,null))[_0x0baf('0x16')](handleError(_0x21f179,null));};exports[_0x0baf('0x49')]=function(_0x480834,_0x402f4d){return respondWithRpcPromise(_0x0baf('0x48'),_0x480834[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x480834[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x402f4d,null))[_0x0baf('0x16')](handleError(_0x402f4d,null));};exports['mailQueues']=function(_0x48e855,_0x23f6ea){return respondWithRpcPromise(_0x0baf('0x4a'),_0x48e855[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x23f6ea,null))[_0x0baf('0x16')](handleError(_0x23f6ea,null));};exports[_0x0baf('0x4b')]=function(_0xaa4293,_0x14a667){return respondWithRpcPromise(_0x0baf('0x4a'),_0xaa4293['query'],routingClient)[_0x0baf('0x9')](findById(_0xaa4293[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x14a667,null))[_0x0baf('0x16')](handleError(_0x14a667,null));};exports[_0x0baf('0x4c')]=function(_0xebfc0c,_0x26f5c9){return respondWithRpcPromise('MailAccounts',_0xebfc0c[_0x0baf('0x1a')],mailClient)[_0x0baf('0x9')](respondWithResult(_0x26f5c9,null))[_0x0baf('0x16')](handleError(_0x26f5c9,null));};exports[_0x0baf('0x4d')]=function(_0x1c7d88,_0x1a6d22){return respondWithRpcPromise(_0x0baf('0x4e'),_0x1c7d88[_0x0baf('0x1a')],routingClient)['then'](respondWithResult(_0x1a6d22,null))[_0x0baf('0x16')](handleError(_0x1a6d22,null));};exports['showOpenchannelQueues']=function(_0x3c00e7,_0x5f2fbe){return respondWithRpcPromise('OpenchannelQueues',_0x3c00e7[_0x0baf('0x1a')],routingClient)['then'](findById(_0x3c00e7[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x5f2fbe,null))['catch'](handleError(_0x5f2fbe,null));};exports[_0x0baf('0x4f')]=function(_0xfb6708,_0x156572){return respondWithRpcPromise('SmsQueues',_0xfb6708['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x156572,null))[_0x0baf('0x16')](handleError(_0x156572,null));};exports[_0x0baf('0x50')]=function(_0x7f49e,_0x784e1a){return respondWithRpcPromise('SmsQueues',_0x7f49e[_0x0baf('0x1a')],routingClient)['then'](findById(_0x7f49e['params']['id']))['then'](respondWithResult(_0x784e1a,null))[_0x0baf('0x16')](handleError(_0x784e1a,null));};exports['whatsappQueues']=function(_0x4946d4,_0x11a81e){return respondWithRpcPromise(_0x0baf('0x51'),_0x4946d4[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x11a81e,null))[_0x0baf('0x16')](handleError(_0x11a81e,null));};exports[_0x0baf('0x52')]=function(_0x4c05d6,_0xec3b32){return respondWithRpcPromise(_0x0baf('0x51'),_0x4c05d6[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x4c05d6[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0xec3b32,null))['catch'](handleError(_0xec3b32,null));};exports[_0x0baf('0x53')]=function(_0x468363,_0x29fd46){return respondWithRpcPromise('FaxQueues',_0x468363[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x29fd46,null))[_0x0baf('0x16')](handleError(_0x29fd46,null));};exports[_0x0baf('0x54')]=function(_0x125906,_0x27a959){return respondWithRpcPromise(_0x0baf('0x55'),_0x125906['query'],routingClient)['then'](findById(_0x125906['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x27a959,null))[_0x0baf('0x16')](handleError(_0x27a959,null));};exports[_0x0baf('0x56')]=function(_0x12b9b5,_0x3e65d4){return respondWithRpcPromise(_0x0baf('0x57'),_0x12b9b5['query'])['then'](respondWithResult(_0x3e65d4,null))[_0x0baf('0x16')](handleError(_0x3e65d4,null));};exports['chatQueuesWaitingInteractions']=function(_0x22cd07,_0x3e9b79){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x22cd07[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x3e9b79,null))[_0x0baf('0x16')](handleError(_0x3e9b79,null));};exports[_0x0baf('0x58')]=function(_0x115ff5,_0x33a5af){return respondWithRpcPromise(_0x0baf('0x59'),_0x115ff5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x33a5af,null))['catch'](handleError(_0x33a5af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x58a079,_0x493784){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x58a079[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x493784,null))[_0x0baf('0x16')](handleError(_0x493784,null));};exports[_0x0baf('0x5a')]=function(_0x5093f5,_0x1be7f2){return respondWithRpcPromise(_0x0baf('0x5b'),_0x5093f5['query'],routingClient)['then'](function(_0x43aecd){if(_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')]!==undefined){var _0x442e5f=_(_0x43aecd[_0x0baf('0x13')])[_0x0baf('0x5d')]([_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')],_0x5093f5['params']['id']])[_0x0baf('0x5e')](_0x0baf('0x5f'))['uniq']()[_0x0baf('0x60')]();return _0x43aecd[_0x0baf('0x13')]['filter'](function(_0x97d385){return _0x442e5f[_0x0baf('0x61')](_0x97d385[_0x0baf('0x5f')])>-0x1;});}else{return _0x43aecd[_0x0baf('0x13')][_0x0baf('0x5d')](function(_0x4fc5af){return _0x4fc5af['queue_id']===parseInt(_0x5093f5[_0x0baf('0x1b')]['id']);});}})[_0x0baf('0x9')](respondWithResult(_0x1be7f2,null))['catch'](handleError(_0x1be7f2,null));};exports[_0x0baf('0x62')]=function(_0x59dad5,_0x21ad25){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x59dad5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21ad25,null))[_0x0baf('0x16')](handleError(_0x21ad25,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3c2bc1,_0x5008c5){return respondWithRpcPromise(_0x0baf('0x63'),_0x3c2bc1[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x5008c5,null))[_0x0baf('0x16')](handleError(_0x5008c5,null));};exports[_0x0baf('0x64')]=function(_0x52e845,_0x866e6e){return respondWithRpcPromise(_0x0baf('0x65'),_0x52e845['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x866e6e,null))[_0x0baf('0x16')](handleError(_0x866e6e,null));};exports[_0x0baf('0x66')]=function(_0x379c54){return function(_0x1cbbcc,_0x250df2){var _0xa4fd1b,_0x1cda78;var _0x44ef57=_[_0x0baf('0x67')](_0x379c54);var _0x3b7abf=_0x379c54===_0x0baf('0x68')?'Website':'Account';return db[_0x44ef57+_0x0baf('0x69')][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1cbbcc[_0x0baf('0x1b')]['id']}})['then'](function(_0x507783){if(_[_0x0baf('0x12')](_0x507783)){throw new Error(_0x44ef57+_0x0baf('0x6b'));}_0xa4fd1b=_0x507783;return db[_0x44ef57+_0x0baf('0x6c')][_0x0baf('0x6a')]({'where':{'id':_0x1cbbcc[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x44ef57+_0x0baf('0x6e')],'as':_0x0baf('0x6e')},{'model':db[_0x44ef57+_0x3b7abf],'as':_0x0baf('0x6f')}]});})['then'](function(_0x1590a5){if(_[_0x0baf('0x12')](_0x1590a5)){throw new Error(_0x44ef57+_0x0baf('0x70'));}_0x1cda78=_0x1590a5;return _0x1590a5[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5d26e6={'uniqueid':_0x379c54+'.'+_0x1cda78['id']+'.'+_0x1cda78['Interaction']['id'],'FromUserId':_0x1cbbcc[_0x0baf('0x33')]['id'],'type':_0x0baf('0x72')};_0x5d26e6[_0x44ef57+'MessageId']=_0x1cda78['id'];_0x5d26e6[_0x44ef57+'InteractionId']=_0x1cda78[_0x0baf('0x6e')]['id'];_0x5d26e6[_0x0baf('0x73')+_0x44ef57+_0x3b7abf+'Id']=_0x1cda78['Account']['id'];_0x5d26e6['To'+_0x44ef57+_0x0baf('0x74')]=_0xa4fd1b['id'];return db[_0x44ef57+_0x0baf('0x75')][_0x0baf('0x76')](_0x5d26e6);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x379c54,'interaction':_0x1cda78[_0x0baf('0x6e')],'message':_0x1cda78,'account':_0x1cda78[_0x0baf('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0baf('0x72'),'appdata':_0xa4fd1b[_0x0baf('0x11')]+','+(_0x1cda78[_0x0baf('0x6f')][_0x0baf('0x78')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x250df2,null))[_0x0baf('0x16')](handleError(_0x250df2,null));};};exports[_0x0baf('0x7a')]=function(_0x1e1adb,_0x3bd15b){var _0x3c37b4,_0x195303;if(_['isNil'](_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x7b')])){throw new Error(_0x0baf('0x7c'));}var _0x457ae8=_0x1e1adb[_0x0baf('0x31')]['channel'];var _0x3761b5=_[_0x0baf('0x67')](_0x457ae8);var _0x2eae1b=_0x457ae8===_0x0baf('0x68')?_0x0baf('0x7d'):'Account';return db['User'][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1e1adb['params']['id'],'role':_0x0baf('0x3f')}})['then'](function(_0x32d8b6){if(_[_0x0baf('0x12')](_0x32d8b6)){throw new Error(_0x0baf('0x7e'));}_0x3c37b4=_0x32d8b6;return db[_0x3761b5+_0x0baf('0x6c')]['findOne']({'where':{'id':_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x3761b5+_0x0baf('0x6e')],'as':'Interaction'},{'model':db[_0x3761b5+_0x2eae1b],'as':'Account'}]});})['then'](function(_0x4d4884){if(_[_0x0baf('0x12')](_0x4d4884)){throw new Error(_0x3761b5+_0x0baf('0x70'));}_0x195303=_0x4d4884;return _0x4d4884[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0baf('0x9')](function(){var _0x597830={'uniqueid':_0x457ae8+'.'+_0x195303['id']+'.'+_0x195303[_0x0baf('0x6e')]['id'],'FromUserId':_0x1e1adb[_0x0baf('0x33')]['id'],'type':_0x0baf('0x3f'),'ToUserId':_0x3c37b4['id']};_0x597830[_0x3761b5+'MessageId']=_0x195303['id'];_0x597830[_0x3761b5+_0x0baf('0x7f')]=_0x195303[_0x0baf('0x6e')]['id'];_0x597830['From'+_0x3761b5+_0x2eae1b+'Id']=_0x195303[_0x0baf('0x6f')]['id'];return db[_0x3761b5+'TransferReport'][_0x0baf('0x76')](_0x597830);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x457ae8,'interaction':_0x195303[_0x0baf('0x6e')],'message':_0x195303,'account':_0x195303['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3c37b4[_0x0baf('0x11')]+','+(_0x195303['Account'][_0x0baf('0x80')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})[_0x0baf('0x9')](respondWithResult(_0x3bd15b,null))[_0x0baf('0x16')](handleError(_0x3bd15b,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index bc7dd2c..766454b 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 _0x2b2b=['./schedule.controller','get','isAuthenticated','index','show','run','create','/:id','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2870e2,_0x40fd0c){var _0x5e078c=function(_0x51ce0a){while(--_0x51ce0a){_0x2870e2['push'](_0x2870e2['shift']());}};_0x5e078c(++_0x40fd0c);}(_0x2b2b,0x14a));var _0xb2b2=function(_0x35e91a,_0x51fa71){_0x35e91a=_0x35e91a-0x0;var _0x24a602=_0x2b2b[_0x35e91a];return _0x24a602;};'use strict';var multer=require(_0xb2b2('0x0'));var util=require(_0xb2b2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb2b2('0x2')]();var fs_extra=require(_0xb2b2('0x3'));var auth=require(_0xb2b2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb2b2('0x5'));var controller=require(_0xb2b2('0x6'));router[_0xb2b2('0x7')]('/',auth[_0xb2b2('0x8')](),controller[_0xb2b2('0x9')]);router[_0xb2b2('0x7')]('/:id',auth[_0xb2b2('0x8')](),controller[_0xb2b2('0xa')]);router['get']('/:id/run',auth[_0xb2b2('0x8')](),controller[_0xb2b2('0xb')]);router['post']('/',auth[_0xb2b2('0x8')](),controller[_0xb2b2('0xc')]);router['put'](_0xb2b2('0xd'),auth[_0xb2b2('0x8')](),controller['update']);router['delete'](_0xb2b2('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf537=['get','/:id','/:id/run','post','create','update','delete','destroy','util','path','connect-timeout','Router','../../config/environment','./schedule.controller','isAuthenticated','index'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0xf537,0x78));var _0x7f53=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf537[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x7f53('0x0'));var path=require(_0x7f53('0x1'));var timeout=require(_0x7f53('0x2'));var express=require('express');var router=express[_0x7f53('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f53('0x4'));var controller=require(_0x7f53('0x5'));router['get']('/',auth[_0x7f53('0x6')](),controller[_0x7f53('0x7')]);router[_0x7f53('0x8')](_0x7f53('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x7f53('0x8')](_0x7f53('0xa'),auth[_0x7f53('0x6')](),controller['run']);router[_0x7f53('0xb')]('/',auth['isAuthenticated'](),controller[_0x7f53('0xc')]);router['put'](_0x7f53('0x9'),auth['isAuthenticated'](),controller[_0x7f53('0xd')]);router[_0x7f53('0xe')](_0x7f53('0x9'),auth[_0x7f53('0x6')](),controller[_0x7f53('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 9cb7ee4..d28572c 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 _0xa35e=['hours','csv','xlsx','custom','BOOLEAN','TEXT','sequelize','exports','STRING','DATE','INTEGER','ENUM','years','quarters','months','weeks'];(function(_0x167657,_0x46a6d9){var _0x45a9ba=function(_0x5c87b5){while(--_0x5c87b5){_0x167657['push'](_0x167657['shift']());}};_0x45a9ba(++_0x46a6d9);}(_0xa35e,0x1d6));var _0xea35=function(_0x269595,_0x4fdf25){_0x269595=_0x269595-0x0;var _0x3e14b8=_0xa35e[_0x269595];return _0x3e14b8;};'use strict';var Sequelize=require(_0xea35('0x0'));module[_0xea35('0x1')]={'name':{'type':Sequelize[_0xea35('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xea35('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xea35('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xea35('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xea35('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xea35('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xea35('0x5')](_0xea35('0x6'),_0xea35('0x7'),_0xea35('0x8'),_0xea35('0x9'),'days',_0xea35('0xa'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xea35('0x5')](_0xea35('0xb'),'pdf',_0xea35('0xc')),'allowNull':![],'defaultValue':_0xea35('0xb')},'type':{'type':Sequelize[_0xea35('0x5')](_0xea35('0xd'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xea35('0xe')],'defaultValue':![]},'email':{'type':Sequelize[_0xea35('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xea35('0xf')]},'sendIfEmpty':{'type':Sequelize[_0xea35('0xe')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe227=['pdf','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','years','quarters','months','weeks','days','hours','minutes','ENUM','csv'];(function(_0x3ebff4,_0x5efe9a){var _0x6331b7=function(_0x4860d6){while(--_0x4860d6){_0x3ebff4['push'](_0x3ebff4['shift']());}};_0x6331b7(++_0x5efe9a);}(_0xe227,0x82));var _0x7e22=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0xe227[_0xbb9dbf];return _0x30223c;};'use strict';var Sequelize=require(_0x7e22('0x0'));module[_0x7e22('0x1')]={'name':{'type':Sequelize[_0x7e22('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7e22('0x2')]},'active':{'type':Sequelize[_0x7e22('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x7e22('0x2')],'allowNull':![],'defaultValue':_0x7e22('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x7e22('0x5'),_0x7e22('0x6'),_0x7e22('0x7'),_0x7e22('0x8'),_0x7e22('0x9'),_0x7e22('0xa'),_0x7e22('0xb')),'allowNull':![],'defaultValue':_0x7e22('0x9')},'output':{'type':Sequelize[_0x7e22('0xc')](_0x7e22('0xd'),_0x7e22('0xe'),'xlsx'),'allowNull':![],'defaultValue':_0x7e22('0xd')},'type':{'type':Sequelize[_0x7e22('0xc')](_0x7e22('0xf'),_0x7e22('0x10')),'allowNull':![],'defaultValue':_0x7e22('0xf')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x7e22('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x7e22('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x7e22('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 927bfb0..806e686 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 _0x319d=['catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','Scheduler','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Schedule','include','findAll','params','keys','includeAll','find'];(function(_0x1f3aec,_0x24c18e){var _0x409f0d=function(_0x52b818){while(--_0x52b818){_0x1f3aec['push'](_0x1f3aec['shift']());}};_0x409f0d(++_0x24c18e);}(_0x319d,0xb2));var _0xd319=function(_0x436827,_0x570104){_0x436827=_0x436827-0x0;var _0x22434d=_0x319d[_0x436827];return _0x22434d;};'use strict';var emlformat=require(_0xd319('0x0'));var rimraf=require(_0xd319('0x1'));var zipdir=require(_0xd319('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd319('0x3'));var BPromise=require(_0xd319('0x4'));var Mustache=require(_0xd319('0x5'));var util=require('util');var path=require(_0xd319('0x6'));var sox=require(_0xd319('0x7'));var csv=require('to-csv');var ejs=require(_0xd319('0x8'));var fs=require('fs');var fs_extra=require(_0xd319('0x9'));var _=require(_0xd319('0xa'));var squel=require(_0xd319('0xb'));var crypto=require(_0xd319('0xc'));var jsforce=require(_0xd319('0xd'));var deskjs=require(_0xd319('0xe'));var toCsv=require(_0xd319('0xf'));var querystring=require(_0xd319('0x10'));var Papa=require(_0xd319('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd319('0x12'));var hardwareService=require(_0xd319('0x13'));var logger=require(_0xd319('0x14'))('api');var utils=require(_0xd319('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd319('0x16'))['db'];function respondWithStatusCode(_0x286fa0,_0x412f02){_0x412f02=_0x412f02||0xcc;return function(_0xe3905c){if(_0xe3905c){return _0x286fa0['sendStatus'](_0x412f02);}return _0x286fa0[_0xd319('0x17')](_0x412f02)[_0xd319('0x18')]();};}function respondWithResult(_0x222bb7,_0x65d5ec){_0x65d5ec=_0x65d5ec||0xc8;return function(_0x345eba){if(_0x345eba){return _0x222bb7[_0xd319('0x17')](_0x65d5ec)[_0xd319('0x19')](_0x345eba);}};}function respondWithFilteredResult(_0x473604,_0x2c3a5a){return function(_0x1390ad){if(_0x1390ad){var _0x1485b4=typeof _0x2c3a5a[_0xd319('0x1a')]===_0xd319('0x1b')&&typeof _0x2c3a5a[_0xd319('0x1c')]===_0xd319('0x1b');var _0x131521=_0x1390ad[_0xd319('0x1d')];var _0x33ea42=_0x1485b4?0x0:_0x2c3a5a[_0xd319('0x1a')];var _0x3f357d=_0x1485b4?_0x1390ad[_0xd319('0x1d')]:_0x2c3a5a[_0xd319('0x1a')]+_0x2c3a5a[_0xd319('0x1c')];var _0xf6d2d;if(_0x3f357d>=_0x131521){_0x3f357d=_0x131521;_0xf6d2d=0xc8;}else{_0xf6d2d=0xce;}_0x473604[_0xd319('0x17')](_0xf6d2d);return _0x473604[_0xd319('0x1e')](_0xd319('0x1f'),_0x33ea42+'-'+_0x3f357d+'/'+_0x131521)[_0xd319('0x19')](_0x1390ad);}return null;};}function patchUpdates(_0x4c45dd){return function(_0x15358c){try{jsonpatch['apply'](_0x15358c,_0x4c45dd,!![]);}catch(_0x1b69b4){return BPromise['reject'](_0x1b69b4);}return _0x15358c['save']();};}function saveUpdates(_0x5dd96c,_0x46d61b){return function(_0x8c1c65){if(_0x8c1c65){return _0x8c1c65[_0xd319('0x20')](_0x5dd96c)[_0xd319('0x21')](function(_0xdae422){return _0xdae422;});}return null;};}function removeEntity(_0x36fe56,_0x285f84){return function(_0x545b8a){if(_0x545b8a){return _0x545b8a['destroy']()[_0xd319('0x21')](function(){var _0x46c997=_0x545b8a['get']({'plain':!![]});var _0x317c9f=_0xd319('0x22');return db[_0xd319('0x23')][_0xd319('0x24')]({'where':{'type':_0x317c9f,'resourceId':_0x46c997['id']}})[_0xd319('0x21')](function(){return _0x545b8a;});})[_0xd319('0x21')](function(){_0x36fe56['status'](0xcc)[_0xd319('0x18')]();});}};}function handleEntityNotFound(_0x5e9f54,_0x410f2d){return function(_0xa363f5){if(!_0xa363f5){_0x5e9f54[_0xd319('0x25')](0x194);}return _0xa363f5;};}function handleError(_0x2a329b,_0x2b69b0){_0x2b69b0=_0x2b69b0||0x1f4;return function(_0x57b689){logger[_0xd319('0x26')](_0x57b689[_0xd319('0x27')]);if(_0x57b689['name']){delete _0x57b689[_0xd319('0x28')];}_0x2a329b[_0xd319('0x17')](_0x2b69b0)[_0xd319('0x29')](_0x57b689);};}exports[_0xd319('0x2a')]=function(_0x28115a,_0x14b79d){var _0x2eba3b={},_0x81f57e={},_0x2117f9={'count':0x0,'rows':[]};var _0x57e3b4=_[_0xd319('0x2b')](db['Schedule']['rawAttributes'],function(_0x123f76){return{'name':_0x123f76[_0xd319('0x2c')],'type':_0x123f76[_0xd319('0x2d')][_0xd319('0x2e')]};});_0x81f57e['model']=_[_0xd319('0x2b')](_0x57e3b4,'name');_0x81f57e['query']=_['keys'](_0x28115a[_0xd319('0x2f')]);_0x81f57e[_0xd319('0x30')]=_['intersection'](_0x81f57e[_0xd319('0x31')],_0x81f57e[_0xd319('0x2f')]);_0x2eba3b[_0xd319('0x32')]=_[_0xd319('0x33')](_0x81f57e[_0xd319('0x31')],qs[_0xd319('0x34')](_0x28115a[_0xd319('0x2f')][_0xd319('0x34')]));_0x2eba3b['attributes']=_0x2eba3b[_0xd319('0x32')][_0xd319('0x35')]?_0x2eba3b[_0xd319('0x32')]:_0x81f57e[_0xd319('0x31')];if(!_0x28115a['query'][_0xd319('0x36')](_0xd319('0x37'))){_0x2eba3b[_0xd319('0x1c')]=qs[_0xd319('0x1c')](_0x28115a[_0xd319('0x2f')]['limit']);_0x2eba3b[_0xd319('0x1a')]=qs[_0xd319('0x1a')](_0x28115a[_0xd319('0x2f')][_0xd319('0x1a')]);}_0x2eba3b[_0xd319('0x38')]=qs[_0xd319('0x39')](_0x28115a['query'][_0xd319('0x39')]);_0x2eba3b[_0xd319('0x3a')]=qs[_0xd319('0x30')](_[_0xd319('0x3b')](_0x28115a['query'],_0x81f57e[_0xd319('0x30')]),_0x57e3b4);if(_0x28115a[_0xd319('0x2f')]['filter']){_0x2eba3b['where']=_[_0xd319('0x3c')](_0x2eba3b['where'],{'$or':_['map'](_0x57e3b4,function(_0x3524fb){if(_0x3524fb[_0xd319('0x2d')]!==_0xd319('0x3d')){var _0x1706a8={};_0x1706a8[_0x3524fb[_0xd319('0x28')]]={'$like':'%'+_0x28115a[_0xd319('0x2f')][_0xd319('0x3e')]+'%'};return _0x1706a8;}})});}_0x2eba3b=_['merge']({},_0x2eba3b,_0x28115a[_0xd319('0x3f')]);var _0x196256={'where':_0x2eba3b[_0xd319('0x3a')]};return db[_0xd319('0x40')]['count'](_0x196256)['then'](function(_0x1bae38){_0x2117f9[_0xd319('0x1d')]=_0x1bae38;if(_0x28115a[_0xd319('0x2f')]['includeAll']){_0x2eba3b[_0xd319('0x41')]=[{'all':!![]}];}return db[_0xd319('0x40')][_0xd319('0x42')](_0x2eba3b);})[_0xd319('0x21')](function(_0x42129d){_0x2117f9['rows']=_0x42129d;return _0x2117f9;})[_0xd319('0x21')](respondWithFilteredResult(_0x14b79d,_0x2eba3b))['catch'](handleError(_0x14b79d,null));};exports['show']=function(_0x314069,_0x1a42e5){var _0xaa7b7e={'raw':![],'where':{'id':_0x314069[_0xd319('0x43')]['id']}},_0x3a8041={};_0x3a8041[_0xd319('0x31')]=_[_0xd319('0x44')](db[_0xd319('0x40')]['rawAttributes']);_0x3a8041[_0xd319('0x2f')]=_['keys'](_0x314069['query']);_0x3a8041[_0xd319('0x30')]=_[_0xd319('0x33')](_0x3a8041['model'],_0x3a8041[_0xd319('0x2f')]);_0xaa7b7e[_0xd319('0x32')]=_['intersection'](_0x3a8041[_0xd319('0x31')],qs['fields'](_0x314069['query'][_0xd319('0x34')]));_0xaa7b7e[_0xd319('0x32')]=_0xaa7b7e[_0xd319('0x32')][_0xd319('0x35')]?_0xaa7b7e[_0xd319('0x32')]:_0x3a8041[_0xd319('0x31')];if(_0x314069[_0xd319('0x2f')][_0xd319('0x45')]){_0xaa7b7e['include']=[{'all':!![]}];}_0xaa7b7e=_[_0xd319('0x3c')]({},_0xaa7b7e,_0x314069['options']);return db[_0xd319('0x40')][_0xd319('0x46')](_0xaa7b7e)[_0xd319('0x21')](handleEntityNotFound(_0x1a42e5,null))[_0xd319('0x21')](respondWithResult(_0x1a42e5,null))[_0xd319('0x47')](handleError(_0x1a42e5,null));};exports[_0xd319('0x48')]=function(_0x239baa,_0x55ed06){return db[_0xd319('0x40')]['create'](_0x239baa[_0xd319('0x49')],{})[_0xd319('0x21')](function(_0x4d9dd7){var _0x17b11c=_0x239baa[_0xd319('0x4a')][_0xd319('0x4b')]({'plain':!![]});if(!_0x17b11c)throw new Error(_0xd319('0x4c'));if(_0x17b11c[_0xd319('0x4d')]===_0xd319('0x4a')){var _0x41d753=_0x4d9dd7[_0xd319('0x4b')]({'plain':!![]});var _0x41e6b3=_0xd319('0x22');return db[_0xd319('0x4e')][_0xd319('0x46')]({'where':{'name':_0x41e6b3,'userProfileId':_0x17b11c[_0xd319('0x4f')]},'raw':!![]})[_0xd319('0x21')](function(_0x352283){if(_0x352283&&_0x352283[_0xd319('0x50')]===0x0){return db['UserProfileResource'][_0xd319('0x48')]({'name':_0x41d753[_0xd319('0x28')],'resourceId':_0x41d753['id'],'type':_0x352283['name'],'sectionId':_0x352283['id']},{})[_0xd319('0x21')](function(){return _0x4d9dd7;});}else{return _0x4d9dd7;}})['catch'](function(_0x1d0220){logger[_0xd319('0x26')](_0xd319('0x51'),_0x1d0220);throw _0x1d0220;});}return _0x4d9dd7;})[_0xd319('0x21')](respondWithResult(_0x55ed06,0xc9))[_0xd319('0x47')](handleError(_0x55ed06,null));};exports['update']=function(_0x8db0cd,_0x503521){if(_0x8db0cd['body']['id']){delete _0x8db0cd[_0xd319('0x49')]['id'];}return db['Schedule'][_0xd319('0x46')]({'where':{'id':_0x8db0cd[_0xd319('0x43')]['id']}})[_0xd319('0x21')](handleEntityNotFound(_0x503521,null))[_0xd319('0x21')](saveUpdates(_0x8db0cd[_0xd319('0x49')],null))[_0xd319('0x21')](respondWithResult(_0x503521,null))[_0xd319('0x47')](handleError(_0x503521,null));};exports[_0xd319('0x24')]=function(_0x3df7d3,_0x34350b){return db['Schedule']['find']({'where':{'id':_0x3df7d3[_0xd319('0x43')]['id']}})[_0xd319('0x21')](handleEntityNotFound(_0x34350b,null))[_0xd319('0x21')](removeEntity(_0x34350b,null))[_0xd319('0x47')](handleError(_0x34350b,null));};exports[_0xd319('0x52')]=function(_0x525faf,_0x178c77,_0x3c6c1e){var _0xfa6b91=require('../../config/schedule');return db[_0xd319('0x40')][_0xd319('0x46')]({'where':{'id':_0x525faf[_0xd319('0x43')]['id']},'raw':!![]})[_0xd319('0x21')](handleEntityNotFound(_0x178c77,null))['then'](function(){_0xfa6b91[_0xd319('0x52')](_0x525faf[_0xd319('0x43')]['id']);})[_0xd319('0x21')](respondWithStatusCode(_0x178c77,null))[_0xd319('0x47')](handleError(_0x178c77,null));}; \ No newline at end of file +var _0xfd41=['query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','Schedule','includeAll','include','findAll','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','ejs','fs-extra','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','map','type','key','model','name'];(function(_0x565656,_0x4e268e){var _0x57aaae=function(_0x5346de){while(--_0x5346de){_0x565656['push'](_0x565656['shift']());}};_0x57aaae(++_0x4e268e);}(_0xfd41,0x1af));var _0x1fd4=function(_0xa4928c,_0x16b89c){_0xa4928c=_0xa4928c-0x0;var _0x27cc29=_0xfd41[_0xa4928c];return _0x27cc29;};'use strict';var emlformat=require(_0x1fd4('0x0'));var rimraf=require(_0x1fd4('0x1'));var zipdir=require(_0x1fd4('0x2'));var jsonpatch=require(_0x1fd4('0x3'));var rp=require(_0x1fd4('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1fd4('0x5'));var util=require('util');var path=require(_0x1fd4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1fd4('0x7'));var fs=require('fs');var fs_extra=require(_0x1fd4('0x8'));var _=require('lodash');var squel=require(_0x1fd4('0x9'));var crypto=require('crypto');var jsforce=require(_0x1fd4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1fd4('0xb'));var querystring=require(_0x1fd4('0xc'));var Papa=require('papaparse');var Redis=require(_0x1fd4('0xd'));var authService=require(_0x1fd4('0xe'));var qs=require(_0x1fd4('0xf'));var as=require(_0x1fd4('0x10'));var hardwareService=require(_0x1fd4('0x11'));var logger=require(_0x1fd4('0x12'))(_0x1fd4('0x13'));var utils=require(_0x1fd4('0x14'));var config=require(_0x1fd4('0x15'));var licenseUtil=require(_0x1fd4('0x16'));var db=require(_0x1fd4('0x17'))['db'];function respondWithStatusCode(_0x137cb8,_0x3fea0e){_0x3fea0e=_0x3fea0e||0xcc;return function(_0x2fdf9f){if(_0x2fdf9f){return _0x137cb8[_0x1fd4('0x18')](_0x3fea0e);}return _0x137cb8[_0x1fd4('0x19')](_0x3fea0e)[_0x1fd4('0x1a')]();};}function respondWithResult(_0x12223f,_0x14f0b5){_0x14f0b5=_0x14f0b5||0xc8;return function(_0x2d0ccc){if(_0x2d0ccc){return _0x12223f[_0x1fd4('0x19')](_0x14f0b5)[_0x1fd4('0x1b')](_0x2d0ccc);}};}function respondWithFilteredResult(_0x324aea,_0x425417){return function(_0x28fef1){if(_0x28fef1){var _0x50ac15=typeof _0x425417[_0x1fd4('0x1c')]==='undefined'&&typeof _0x425417[_0x1fd4('0x1d')]===_0x1fd4('0x1e');var _0xc5b118=_0x28fef1['count'];var _0x126a79=_0x50ac15?0x0:_0x425417[_0x1fd4('0x1c')];var _0x34dd83=_0x50ac15?_0x28fef1[_0x1fd4('0x1f')]:_0x425417[_0x1fd4('0x1c')]+_0x425417[_0x1fd4('0x1d')];var _0x515165;if(_0x34dd83>=_0xc5b118){_0x34dd83=_0xc5b118;_0x515165=0xc8;}else{_0x515165=0xce;}_0x324aea[_0x1fd4('0x19')](_0x515165);return _0x324aea[_0x1fd4('0x20')](_0x1fd4('0x21'),_0x126a79+'-'+_0x34dd83+'/'+_0xc5b118)[_0x1fd4('0x1b')](_0x28fef1);}return null;};}function patchUpdates(_0x26044d){return function(_0x2a20d1){try{jsonpatch[_0x1fd4('0x22')](_0x2a20d1,_0x26044d,!![]);}catch(_0x1355c2){return BPromise[_0x1fd4('0x23')](_0x1355c2);}return _0x2a20d1['save']();};}function saveUpdates(_0x1f135f,_0x36475a){return function(_0x505d8c){if(_0x505d8c){return _0x505d8c[_0x1fd4('0x24')](_0x1f135f)[_0x1fd4('0x25')](function(_0x2aea31){return _0x2aea31;});}return null;};}function removeEntity(_0x14a5ae,_0x502fca){return function(_0x40980c){if(_0x40980c){return _0x40980c[_0x1fd4('0x26')]()['then'](function(){var _0x2ebe55=_0x40980c[_0x1fd4('0x27')]({'plain':!![]});var _0x272b3b=_0x1fd4('0x28');return db[_0x1fd4('0x29')][_0x1fd4('0x26')]({'where':{'type':_0x272b3b,'resourceId':_0x2ebe55['id']}})['then'](function(){return _0x40980c;});})[_0x1fd4('0x25')](function(){_0x14a5ae[_0x1fd4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x211cb9,_0xbfc7e5){return function(_0x1d3102){if(!_0x1d3102){_0x211cb9[_0x1fd4('0x18')](0x194);}return _0x1d3102;};}function handleError(_0x17c9d1,_0x1c4752){_0x1c4752=_0x1c4752||0x1f4;return function(_0x424907){logger[_0x1fd4('0x2a')](_0x424907[_0x1fd4('0x2b')]);if(_0x424907['name']){delete _0x424907['name'];}_0x17c9d1[_0x1fd4('0x19')](_0x1c4752)['send'](_0x424907);};}exports['index']=function(_0x5dc56d,_0xa65356){var _0x562bc9={},_0x132e70={},_0x3c7865={'count':0x0,'rows':[]};var _0x14a1a5=_[_0x1fd4('0x2c')](db['Schedule']['rawAttributes'],function(_0x55868e){return{'name':_0x55868e['fieldName'],'type':_0x55868e[_0x1fd4('0x2d')][_0x1fd4('0x2e')]};});_0x132e70[_0x1fd4('0x2f')]=_[_0x1fd4('0x2c')](_0x14a1a5,_0x1fd4('0x30'));_0x132e70['query']=_['keys'](_0x5dc56d[_0x1fd4('0x31')]);_0x132e70['filters']=_['intersection'](_0x132e70['model'],_0x132e70['query']);_0x562bc9[_0x1fd4('0x32')]=_[_0x1fd4('0x33')](_0x132e70[_0x1fd4('0x2f')],qs[_0x1fd4('0x34')](_0x5dc56d[_0x1fd4('0x31')][_0x1fd4('0x34')]));_0x562bc9['attributes']=_0x562bc9[_0x1fd4('0x32')][_0x1fd4('0x35')]?_0x562bc9[_0x1fd4('0x32')]:_0x132e70[_0x1fd4('0x2f')];if(!_0x5dc56d[_0x1fd4('0x31')][_0x1fd4('0x36')](_0x1fd4('0x37'))){_0x562bc9[_0x1fd4('0x1d')]=qs[_0x1fd4('0x1d')](_0x5dc56d[_0x1fd4('0x31')][_0x1fd4('0x1d')]);_0x562bc9[_0x1fd4('0x1c')]=qs[_0x1fd4('0x1c')](_0x5dc56d['query'][_0x1fd4('0x1c')]);}_0x562bc9[_0x1fd4('0x38')]=qs[_0x1fd4('0x39')](_0x5dc56d[_0x1fd4('0x31')][_0x1fd4('0x39')]);_0x562bc9[_0x1fd4('0x3a')]=qs[_0x1fd4('0x3b')](_['pick'](_0x5dc56d[_0x1fd4('0x31')],_0x132e70[_0x1fd4('0x3b')]),_0x14a1a5);if(_0x5dc56d[_0x1fd4('0x31')][_0x1fd4('0x3c')]){_0x562bc9[_0x1fd4('0x3a')]=_[_0x1fd4('0x3d')](_0x562bc9[_0x1fd4('0x3a')],{'$or':_[_0x1fd4('0x2c')](_0x14a1a5,function(_0x521702){if(_0x521702[_0x1fd4('0x2d')]!==_0x1fd4('0x3e')){var _0xe0085c={};_0xe0085c[_0x521702[_0x1fd4('0x30')]]={'$like':'%'+_0x5dc56d[_0x1fd4('0x31')][_0x1fd4('0x3c')]+'%'};return _0xe0085c;}})});}_0x562bc9=_[_0x1fd4('0x3d')]({},_0x562bc9,_0x5dc56d[_0x1fd4('0x3f')]);var _0x566881={'where':_0x562bc9[_0x1fd4('0x3a')]};return db[_0x1fd4('0x40')]['count'](_0x566881)[_0x1fd4('0x25')](function(_0x196e4b){_0x3c7865[_0x1fd4('0x1f')]=_0x196e4b;if(_0x5dc56d['query'][_0x1fd4('0x41')]){_0x562bc9[_0x1fd4('0x42')]=[{'all':!![]}];}return db['Schedule'][_0x1fd4('0x43')](_0x562bc9);})[_0x1fd4('0x25')](function(_0x32cc15){_0x3c7865['rows']=_0x32cc15;return _0x3c7865;})['then'](respondWithFilteredResult(_0xa65356,_0x562bc9))[_0x1fd4('0x44')](handleError(_0xa65356,null));};exports['show']=function(_0x31f359,_0x14cc5e){var _0x2d04e6={'raw':![],'where':{'id':_0x31f359[_0x1fd4('0x45')]['id']}},_0x4cc190={};_0x4cc190[_0x1fd4('0x2f')]=_[_0x1fd4('0x46')](db['Schedule']['rawAttributes']);_0x4cc190['query']=_[_0x1fd4('0x46')](_0x31f359[_0x1fd4('0x31')]);_0x4cc190[_0x1fd4('0x3b')]=_[_0x1fd4('0x33')](_0x4cc190[_0x1fd4('0x2f')],_0x4cc190[_0x1fd4('0x31')]);_0x2d04e6[_0x1fd4('0x32')]=_[_0x1fd4('0x33')](_0x4cc190[_0x1fd4('0x2f')],qs[_0x1fd4('0x34')](_0x31f359[_0x1fd4('0x31')][_0x1fd4('0x34')]));_0x2d04e6[_0x1fd4('0x32')]=_0x2d04e6[_0x1fd4('0x32')][_0x1fd4('0x35')]?_0x2d04e6[_0x1fd4('0x32')]:_0x4cc190[_0x1fd4('0x2f')];if(_0x31f359[_0x1fd4('0x31')][_0x1fd4('0x41')]){_0x2d04e6[_0x1fd4('0x42')]=[{'all':!![]}];}_0x2d04e6=_['merge']({},_0x2d04e6,_0x31f359[_0x1fd4('0x3f')]);return db[_0x1fd4('0x40')][_0x1fd4('0x47')](_0x2d04e6)['then'](handleEntityNotFound(_0x14cc5e,null))[_0x1fd4('0x25')](respondWithResult(_0x14cc5e,null))[_0x1fd4('0x44')](handleError(_0x14cc5e,null));};exports['create']=function(_0x23be13,_0x61646a){return db[_0x1fd4('0x40')][_0x1fd4('0x48')](_0x23be13[_0x1fd4('0x49')],{})[_0x1fd4('0x25')](function(_0x2bf2c3){var _0x10eb4a=_0x23be13[_0x1fd4('0x4a')][_0x1fd4('0x27')]({'plain':!![]});if(!_0x10eb4a)throw new Error(_0x1fd4('0x4b'));if(_0x10eb4a[_0x1fd4('0x4c')]===_0x1fd4('0x4a')){var _0xb3637=_0x2bf2c3[_0x1fd4('0x27')]({'plain':!![]});var _0x444273='Scheduler';return db['UserProfileSection']['find']({'where':{'name':_0x444273,'userProfileId':_0x10eb4a[_0x1fd4('0x4d')]},'raw':!![]})['then'](function(_0x4e35ea){if(_0x4e35ea&&_0x4e35ea['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xb3637[_0x1fd4('0x30')],'resourceId':_0xb3637['id'],'type':_0x4e35ea[_0x1fd4('0x30')],'sectionId':_0x4e35ea['id']},{})['then'](function(){return _0x2bf2c3;});}else{return _0x2bf2c3;}})[_0x1fd4('0x44')](function(_0x21131c){logger[_0x1fd4('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x21131c);throw _0x21131c;});}return _0x2bf2c3;})[_0x1fd4('0x25')](respondWithResult(_0x61646a,0xc9))['catch'](handleError(_0x61646a,null));};exports['update']=function(_0x121b24,_0x4892af){if(_0x121b24['body']['id']){delete _0x121b24[_0x1fd4('0x49')]['id'];}return db[_0x1fd4('0x40')]['find']({'where':{'id':_0x121b24[_0x1fd4('0x45')]['id']}})[_0x1fd4('0x25')](handleEntityNotFound(_0x4892af,null))[_0x1fd4('0x25')](saveUpdates(_0x121b24['body'],null))[_0x1fd4('0x25')](respondWithResult(_0x4892af,null))['catch'](handleError(_0x4892af,null));};exports[_0x1fd4('0x26')]=function(_0x4c884a,_0x4099f8){return db[_0x1fd4('0x40')][_0x1fd4('0x47')]({'where':{'id':_0x4c884a['params']['id']}})[_0x1fd4('0x25')](handleEntityNotFound(_0x4099f8,null))[_0x1fd4('0x25')](removeEntity(_0x4099f8,null))[_0x1fd4('0x44')](handleError(_0x4099f8,null));};exports[_0x1fd4('0x4e')]=function(_0x223ea4,_0x2c4c1c,_0xbc21ee){var _0x5f56cf=require(_0x1fd4('0x4f'));return db[_0x1fd4('0x40')][_0x1fd4('0x47')]({'where':{'id':_0x223ea4[_0x1fd4('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2c4c1c,null))[_0x1fd4('0x25')](function(){_0x5f56cf[_0x1fd4('0x4e')](_0x223ea4[_0x1fd4('0x45')]['id']);})['then'](respondWithStatusCode(_0x2c4c1c,null))[_0x1fd4('0x44')](handleError(_0x2c4c1c,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 10db55b..c586cd0 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 _0x94dd=['util','api','moment','request-promise','path','rimraf','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash'];(function(_0x1eed52,_0x1bb3c1){var _0x57782a=function(_0x2cb894){while(--_0x2cb894){_0x1eed52['push'](_0x1eed52['shift']());}};_0x57782a(++_0x1bb3c1);}(_0x94dd,0xbf));var _0xd94d=function(_0x3d1cfe,_0x376fb0){_0x3d1cfe=_0x3d1cfe-0x0;var _0x305d72=_0x94dd[_0x3d1cfe];return _0x305d72;};'use strict';var _=require(_0xd94d('0x0'));var util=require(_0xd94d('0x1'));var logger=require('../../config/logger')(_0xd94d('0x2'));var moment=require(_0xd94d('0x3'));var BPromise=require('bluebird');var rp=require(_0xd94d('0x4'));var fs=require('fs');var path=require(_0xd94d('0x5'));var rimraf=require(_0xd94d('0x6'));var config=require('../../config/environment');var attributes=require(_0xd94d('0x7'));module[_0xd94d('0x8')]=function(_0x525be9,_0x2620d3){return _0x525be9[_0xd94d('0x9')](_0xd94d('0xa'),attributes,{'tableName':_0xd94d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a0b=['define','tools_schedules','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes'];(function(_0x3436d1,_0x5ed71e){var _0x2b83e0=function(_0xdcd6ce){while(--_0xdcd6ce){_0x3436d1['push'](_0x3436d1['shift']());}};_0x2b83e0(++_0x5ed71e);}(_0x3a0b,0xc2));var _0xb3a0=function(_0x456b57,_0x58691a){_0x456b57=_0x456b57-0x0;var _0x18f49f=_0x3a0b[_0x456b57];return _0x18f49f;};'use strict';var _=require('lodash');var util=require(_0xb3a0('0x0'));var logger=require(_0xb3a0('0x1'))(_0xb3a0('0x2'));var moment=require(_0xb3a0('0x3'));var BPromise=require(_0xb3a0('0x4'));var rp=require(_0xb3a0('0x5'));var fs=require('fs');var path=require(_0xb3a0('0x6'));var rimraf=require(_0xb3a0('0x7'));var config=require(_0xb3a0('0x8'));var attributes=require(_0xb3a0('0x9'));module['exports']=function(_0x41ed00,_0x4f88af){return _0x41ed00[_0xb3a0('0xa')]('Schedule',attributes,{'tableName':_0xb3a0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 12d4b4b..55e4dbe 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 _0xf119=['moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash'];(function(_0x1e819b,_0x424f96){var _0xc3084a=function(_0x5408f8){while(--_0x5408f8){_0x1e819b['push'](_0x1e819b['shift']());}};_0xc3084a(++_0x424f96);}(_0xf119,0x18b));var _0x9f11=function(_0x472249,_0x34e6ee){_0x472249=_0x472249-0x0;var _0x2bbb09=_0xf119[_0x472249];return _0x2bbb09;};'use strict';var _=require(_0x9f11('0x0'));var util=require('util');var moment=require(_0x9f11('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f11('0x2'))['db'];var utils=require(_0x9f11('0x3'));var logger=require(_0x9f11('0x4'))(_0x9f11('0x5'));var config=require(_0x9f11('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9f11('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55e9f4,_0x212863,_0x28fa4d){return new BPromise(function(_0xbe22d0,_0x4d37a0){return client['request'](_0x55e9f4,_0x28fa4d)[_0x9f11('0x8')](function(_0x241f31){logger[_0x9f11('0x9')](_0x9f11('0xa'),_0x212863,_0x9f11('0xb'));logger[_0x9f11('0xc')](_0x9f11('0xd'),_0x212863,'request\x20sent',JSON['stringify'](_0x241f31));if(_0x241f31[_0x9f11('0xe')]){if(_0x241f31[_0x9f11('0xe')]['code']===0x1f4){logger[_0x9f11('0xe')](_0x9f11('0xa'),_0x212863,_0x241f31[_0x9f11('0xe')][_0x9f11('0xf')]);return _0x4d37a0(_0x241f31[_0x9f11('0xe')][_0x9f11('0xf')]);}logger[_0x9f11('0xe')](_0x9f11('0xa'),_0x212863,_0x241f31[_0x9f11('0xe')][_0x9f11('0xf')]);return _0xbe22d0(_0x241f31[_0x9f11('0xe')][_0x9f11('0xf')]);}else{logger[_0x9f11('0x9')]('Schedule,\x20%s,\x20%s',_0x212863,_0x9f11('0xb'));_0xbe22d0(_0x241f31[_0x9f11('0x10')]['message']);}})[_0x9f11('0x11')](function(_0x2307ac){logger[_0x9f11('0xe')](_0x9f11('0xa'),_0x212863,_0x2307ac);_0x4d37a0(_0x2307ac);});});} \ No newline at end of file +var _0x0d95=['Schedule,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x417e47,_0x3e1d39){var _0x375fe3=function(_0xa13a2b){while(--_0xa13a2b){_0x417e47['push'](_0x417e47['shift']());}};_0x375fe3(++_0x3e1d39);}(_0x0d95,0x12d));var _0x50d9=function(_0x404159,_0x17eae4){_0x404159=_0x404159-0x0;var _0x4edde1=_0x0d95[_0x404159];return _0x4edde1;};'use strict';var _=require(_0x50d9('0x0'));var util=require('util');var moment=require(_0x50d9('0x1'));var BPromise=require('bluebird');var rs=require(_0x50d9('0x2'));var fs=require('fs');var Redis=require(_0x50d9('0x3'));var db=require(_0x50d9('0x4'))['db'];var utils=require(_0x50d9('0x5'));var logger=require(_0x50d9('0x6'))('rpc');var config=require(_0x50d9('0x7'));var jayson=require(_0x50d9('0x8'));var client=jayson[_0x50d9('0x9')][_0x50d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4dd923,_0x101d3e,_0x47ea1c){return new BPromise(function(_0x316891,_0x3f66a5){return client[_0x50d9('0xb')](_0x4dd923,_0x47ea1c)[_0x50d9('0xc')](function(_0x353d5e){logger[_0x50d9('0xd')](_0x50d9('0xe'),_0x101d3e,_0x50d9('0xf'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x101d3e,_0x50d9('0xf'),JSON[_0x50d9('0x10')](_0x353d5e));if(_0x353d5e[_0x50d9('0x11')]){if(_0x353d5e[_0x50d9('0x11')][_0x50d9('0x12')]===0x1f4){logger[_0x50d9('0x11')](_0x50d9('0xe'),_0x101d3e,_0x353d5e['error'][_0x50d9('0x13')]);return _0x3f66a5(_0x353d5e[_0x50d9('0x11')][_0x50d9('0x13')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x101d3e,_0x353d5e[_0x50d9('0x11')][_0x50d9('0x13')]);return _0x316891(_0x353d5e[_0x50d9('0x11')][_0x50d9('0x13')]);}else{logger[_0x50d9('0xd')](_0x50d9('0xe'),_0x101d3e,'request\x20sent');_0x316891(_0x353d5e['result'][_0x50d9('0x13')]);}})[_0x50d9('0x14')](function(_0x337044){logger[_0x50d9('0x11')](_0x50d9('0xe'),_0x101d3e,_0x337044);_0x3f66a5(_0x337044);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index e8cde79..31637be 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 _0x6758=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','get','describe','/:id','show','/:id/download','download','post','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x42e32c,_0x5a59f0){var _0xfcc519=function(_0x3c98dc){while(--_0x3c98dc){_0x42e32c['push'](_0x42e32c['shift']());}};_0xfcc519(++_0x5a59f0);}(_0x6758,0x1b6));var _0x8675=function(_0x2f5435,_0x1789be){_0x2f5435=_0x2f5435-0x0;var _0x4254f2=_0x6758[_0x2f5435];return _0x4254f2;};'use strict';var multer=require('multer');var util=require(_0x8675('0x0'));var path=require(_0x8675('0x1'));var timeout=require(_0x8675('0x2'));var express=require('express');var router=express[_0x8675('0x3')]();var fs_extra=require(_0x8675('0x4'));var auth=require(_0x8675('0x5'));var interaction=require(_0x8675('0x6'));var config=require(_0x8675('0x7'));var controller=require(_0x8675('0x8'));router['get']('/',auth[_0x8675('0x9')](),controller['index']);router[_0x8675('0xa')]('/describe',auth[_0x8675('0x9')](),controller[_0x8675('0xb')]);router[_0x8675('0xa')](_0x8675('0xc'),auth[_0x8675('0x9')](),controller[_0x8675('0xd')]);router['get'](_0x8675('0xe'),auth[_0x8675('0x9')](),controller[_0x8675('0xf')]);router[_0x8675('0x10')]('/',auth[_0x8675('0x9')](),controller['create']);router['put'](_0x8675('0xc'),auth[_0x8675('0x9')](),controller[_0x8675('0x11')]);router[_0x8675('0x12')]('/:id',auth[_0x8675('0x9')](),controller[_0x8675('0x13')]);module[_0x8675('0x14')]=router; \ No newline at end of file +var _0xccd8=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','put','update'];(function(_0x5d1044,_0x18f656){var _0x3cd90e=function(_0x3c40be){while(--_0x3c40be){_0x5d1044['push'](_0x5d1044['shift']());}};_0x3cd90e(++_0x18f656);}(_0xccd8,0x10b));var _0x8ccd=function(_0x2ce2ac,_0x31f105){_0x2ce2ac=_0x2ce2ac-0x0;var _0x384c0d=_0xccd8[_0x2ce2ac];return _0x384c0d;};'use strict';var multer=require(_0x8ccd('0x0'));var util=require(_0x8ccd('0x1'));var path=require(_0x8ccd('0x2'));var timeout=require(_0x8ccd('0x3'));var express=require(_0x8ccd('0x4'));var router=express[_0x8ccd('0x5')]();var fs_extra=require(_0x8ccd('0x6'));var auth=require(_0x8ccd('0x7'));var interaction=require(_0x8ccd('0x8'));var config=require(_0x8ccd('0x9'));var controller=require(_0x8ccd('0xa'));router[_0x8ccd('0xb')]('/',auth[_0x8ccd('0xc')](),controller[_0x8ccd('0xd')]);router[_0x8ccd('0xb')](_0x8ccd('0xe'),auth[_0x8ccd('0xc')](),controller[_0x8ccd('0xf')]);router[_0x8ccd('0xb')](_0x8ccd('0x10'),auth[_0x8ccd('0xc')](),controller[_0x8ccd('0x11')]);router['get'](_0x8ccd('0x12'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x8ccd('0xc')](),controller['create']);router[_0x8ccd('0x13')](_0x8ccd('0x10'),auth[_0x8ccd('0xc')](),controller[_0x8ccd('0x14')]);router[_0x8ccd('0x15')](_0x8ccd('0x10'),auth[_0x8ccd('0xc')](),controller[_0x8ccd('0x16')]);module[_0x8ccd('0x17')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index fa76a01..abca896 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 _0x1a37=['STRING','replace','setDataValue','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname'];(function(_0x3d5e10,_0x5d43c5){var _0x5f4b5a=function(_0x140936){while(--_0x140936){_0x3d5e10['push'](_0x3d5e10['shift']());}};_0x5f4b5a(++_0x5d43c5);}(_0x1a37,0xb4));var _0x71a3=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x1a37[_0x31cb5f];return _0x586042;};'use strict';var Sequelize=require(_0x71a3('0x0'));var moment=require(_0x71a3('0x1'));var path=require(_0x71a3('0x2'));var config=require(_0x71a3('0x3'));module[_0x71a3('0x4')]={'format':{'type':Sequelize[_0x71a3('0x5')],'get':function(){return this[_0x71a3('0x6')](_0x71a3('0x7'))?path[_0x71a3('0x8')](this[_0x71a3('0x6')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x71a3('0x9')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x71a3('0x9')],'set':function(_0x45050a){var _0x231ea7=_0x45050a[_0x71a3('0xa')](/\\/g,'/');this['setDataValue']('value',_0x231ea7);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x89da86){this[_0x71a3('0xb')](_0x71a3('0xc'),moment()[_0x71a3('0xd')](_0x89da86,'ms'));this[_0x71a3('0xb')](_0x71a3('0xe'),moment());this[_0x71a3('0xb')](_0x71a3('0xf'),_0x89da86);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('startedAt'))[_0x71a3('0x10')](_0x71a3('0x11'))[_0x71a3('0x12')]();}},'closedAt':{'type':Sequelize[_0x71a3('0x13')],'get':function(){return moment(this[_0x71a3('0x6')](_0x71a3('0xe')))[_0x71a3('0x10')](_0x71a3('0x11'))[_0x71a3('0x12')]();}},'createdAt':{'type':Sequelize[_0x71a3('0x13')],'get':function(){return moment(this[_0x71a3('0x6')]('createdAt'))[_0x71a3('0x10')](_0x71a3('0x11'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x71a3('0x6')](_0x71a3('0x14')))[_0x71a3('0x10')](_0x71a3('0x11'))[_0x71a3('0x12')]();}}}; \ No newline at end of file +var _0x8212=['moment','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','subtract','duration','DATE','toString','closedAt','format','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize'];(function(_0x2f2d88,_0x32815c){var _0x4742ee=function(_0x19b8ba){while(--_0x19b8ba){_0x2f2d88['push'](_0x2f2d88['shift']());}};_0x4742ee(++_0x32815c);}(_0x8212,0xb3));var _0x2821=function(_0x4d9475,_0x1a6c26){_0x4d9475=_0x4d9475-0x0;var _0x23aa82=_0x8212[_0x4d9475];return _0x23aa82;};'use strict';var Sequelize=require(_0x2821('0x0'));var moment=require(_0x2821('0x1'));var path=require('path');var config=require(_0x2821('0x2'));module[_0x2821('0x3')]={'format':{'type':Sequelize[_0x2821('0x4')],'get':function(){return this[_0x2821('0x5')](_0x2821('0x6'))?path[_0x2821('0x7')](this[_0x2821('0x5')](_0x2821('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2821('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x376c57){var _0x1dc078=_0x376c57['replace'](/\\/g,'/');this[_0x2821('0x9')](_0x2821('0x6'),_0x1dc078);}},'rating':{'type':Sequelize[_0x2821('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x2821('0xa')],'set':function(_0x16003f){this[_0x2821('0x9')](_0x2821('0xb'),moment()[_0x2821('0xc')](_0x16003f,'ms'));this[_0x2821('0x9')]('closedAt',moment());this[_0x2821('0x9')](_0x2821('0xd'),_0x16003f);}},'startedAt':{'type':Sequelize[_0x2821('0xe')],'get':function(){return moment(this['getDataValue']('startedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0x2821('0xf')]();}},'closedAt':{'type':Sequelize[_0x2821('0xe')],'get':function(){return moment(this[_0x2821('0x5')](_0x2821('0x10')))[_0x2821('0x11')](_0x2821('0x12'))['toString']();}},'createdAt':{'type':Sequelize[_0x2821('0xe')],'get':function(){return moment(this['getDataValue']('createdAt'))[_0x2821('0x11')](_0x2821('0x12'))[_0x2821('0xf')]();}},'updatedAt':{'type':Sequelize[_0x2821('0xe')],'get':function(){return moment(this['getDataValue'](_0x2821('0x13')))['format'](_0x2821('0x12'))[_0x2821('0xf')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index bdf675b..3292655 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 _0x5fd1=['body','duration','createdAt','closedAt','describe','../../components/encryptor','uniqueid','join','value','format','%s.cypher','decryptFile','secrets','recording','root','server/files/screen_recordings','existsSync','Sequelize','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','ScreenRecording','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create'];(function(_0x465f17,_0x4bd683){var _0x38fb72=function(_0xcd6ba){while(--_0xcd6ba){_0x465f17['push'](_0x465f17['shift']());}};_0x38fb72(++_0x4bd683);}(_0x5fd1,0x155));var _0x15fd=function(_0x13ba54,_0x2bf9e1){_0x13ba54=_0x13ba54-0x0;var _0x1d2511=_0x5fd1[_0x13ba54];return _0x1d2511;};'use strict';var emlformat=require(_0x15fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15fd('0x1'));var jsonpatch=require(_0x15fd('0x2'));var rp=require(_0x15fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15fd('0x4'));var util=require(_0x15fd('0x5'));var path=require(_0x15fd('0x6'));var sox=require('sox');var csv=require(_0x15fd('0x7'));var ejs=require(_0x15fd('0x8'));var fs=require('fs');var fs_extra=require(_0x15fd('0x9'));var _=require(_0x15fd('0xa'));var squel=require(_0x15fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x15fd('0xc'));var deskjs=require(_0x15fd('0xd'));var toCsv=require(_0x15fd('0x7'));var querystring=require('querystring');var Papa=require(_0x15fd('0xe'));var Redis=require('ioredis');var authService=require(_0x15fd('0xf'));var qs=require(_0x15fd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15fd('0x11'));var utils=require(_0x15fd('0x12'));var config=require(_0x15fd('0x13'));var licenseUtil=require(_0x15fd('0x14'));var db=require(_0x15fd('0x15'))['db'];function respondWithStatusCode(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xcc;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0x16')](_0x346ab1);}return _0x2e18ec['status'](_0x346ab1)['end']();};}function respondWithResult(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0xc8;return function(_0x135a15){if(_0x135a15){return _0x5784a3[_0x15fd('0x17')](_0x3fda60)[_0x15fd('0x18')](_0x135a15);}};}function respondWithFilteredResult(_0x44eae6,_0x2ffa03){return function(_0x2c5375){if(_0x2c5375){var _0x44a63a=typeof _0x2ffa03['offset']==='undefined'&&typeof _0x2ffa03[_0x15fd('0x19')]==='undefined';var _0x7afe9c=_0x2c5375['count'];var _0x917fe4=_0x44a63a?0x0:_0x2ffa03[_0x15fd('0x1a')];var _0x855bae=_0x44a63a?_0x2c5375['count']:_0x2ffa03[_0x15fd('0x1a')]+_0x2ffa03[_0x15fd('0x19')];var _0x8b7b9e;if(_0x855bae>=_0x7afe9c){_0x855bae=_0x7afe9c;_0x8b7b9e=0xc8;}else{_0x8b7b9e=0xce;}_0x44eae6[_0x15fd('0x17')](_0x8b7b9e);return _0x44eae6[_0x15fd('0x1b')](_0x15fd('0x1c'),_0x917fe4+'-'+_0x855bae+'/'+_0x7afe9c)[_0x15fd('0x18')](_0x2c5375);}return null;};}function patchUpdates(_0x2f46f1){return function(_0x1b8b9f){try{jsonpatch[_0x15fd('0x1d')](_0x1b8b9f,_0x2f46f1,!![]);}catch(_0x3ff307){return BPromise['reject'](_0x3ff307);}return _0x1b8b9f['save']();};}function saveUpdates(_0x293d7b,_0x36b21e){return function(_0x252a1c){if(_0x252a1c){return _0x252a1c[_0x15fd('0x1e')](_0x293d7b)[_0x15fd('0x1f')](function(_0x11496a){return _0x11496a;});}return null;};}function removeEntity(_0x2073da,_0x50d493){return function(_0x40d43){if(_0x40d43){return _0x40d43[_0x15fd('0x20')]()[_0x15fd('0x1f')](function(){_0x2073da['status'](0xcc)[_0x15fd('0x21')]();});}};}function handleEntityNotFound(_0x49062f,_0x3d1835){return function(_0x1fc24f){if(!_0x1fc24f){_0x49062f[_0x15fd('0x16')](0x194);}return _0x1fc24f;};}function handleError(_0x4c9708,_0x16b87c){_0x16b87c=_0x16b87c||0x1f4;return function(_0x1cbf2c){logger[_0x15fd('0x22')](_0x1cbf2c['stack']);if(_0x1cbf2c[_0x15fd('0x23')]){delete _0x1cbf2c['name'];}_0x4c9708[_0x15fd('0x17')](_0x16b87c)[_0x15fd('0x24')](_0x1cbf2c);};}exports[_0x15fd('0x25')]=function(_0x27d2c4,_0x233ed3){var _0x6c213b={},_0x218034={},_0xe650a3={'count':0x0,'rows':[]};var _0x4590a1=_[_0x15fd('0x26')](db[_0x15fd('0x27')]['rawAttributes'],function(_0x47c22c){return{'name':_0x47c22c[_0x15fd('0x28')],'type':_0x47c22c['type'][_0x15fd('0x29')]};});_0x218034[_0x15fd('0x2a')]=_['differenceBy'](_[_0x15fd('0x26')](_0x4590a1,_0x15fd('0x23')),['format']);_0x218034[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x27d2c4[_0x15fd('0x2b')]);_0x218034[_0x15fd('0x2d')]=_[_0x15fd('0x2e')](_0x218034[_0x15fd('0x2a')],_0x218034['query']);_0x6c213b[_0x15fd('0x2f')]=_[_0x15fd('0x2e')](_0x218034[_0x15fd('0x2a')],qs[_0x15fd('0x30')](_0x27d2c4['query'][_0x15fd('0x30')]));_0x6c213b[_0x15fd('0x2f')]=_0x6c213b[_0x15fd('0x2f')][_0x15fd('0x31')]?_0x6c213b[_0x15fd('0x2f')]:_0x218034[_0x15fd('0x2a')];if(!_0x27d2c4['query'][_0x15fd('0x32')](_0x15fd('0x33'))){_0x6c213b['limit']=qs[_0x15fd('0x19')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x19')]);_0x6c213b['offset']=qs[_0x15fd('0x1a')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x1a')]);}_0x6c213b[_0x15fd('0x34')]=qs[_0x15fd('0x35')](_0x27d2c4[_0x15fd('0x2b')]['sort']);_0x6c213b['where']=qs['filters'](_[_0x15fd('0x36')](_0x27d2c4[_0x15fd('0x2b')],_0x218034[_0x15fd('0x2d')]),_0x4590a1);if(_0x27d2c4['query']['filter']){_0x6c213b[_0x15fd('0x37')]=_['merge'](_0x6c213b['where'],{'$or':_['map'](_0x4590a1,function(_0x2edb0d){if(_0x2edb0d[_0x15fd('0x38')]!==_0x15fd('0x39')){var _0x59d0d7={};_0x59d0d7[_0x2edb0d[_0x15fd('0x23')]]={'$like':'%'+_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x3a')]+'%'};return _0x59d0d7;}})});}_0x6c213b=_['merge']({},_0x6c213b,_0x27d2c4[_0x15fd('0x3b')]);var _0x1c4d40={'where':_0x6c213b[_0x15fd('0x37')]};return db[_0x15fd('0x27')][_0x15fd('0x3c')](_0x1c4d40)[_0x15fd('0x1f')](function(_0x19a29f){_0xe650a3[_0x15fd('0x3c')]=_0x19a29f;if(_0x27d2c4[_0x15fd('0x2b')]['includeAll']){_0x6c213b[_0x15fd('0x3d')]=[{'all':!![]}];}return db[_0x15fd('0x27')][_0x15fd('0x3e')](_0x6c213b);})[_0x15fd('0x1f')](function(_0x2d2b6f){_0xe650a3[_0x15fd('0x3f')]=_0x2d2b6f;return _0xe650a3;})[_0x15fd('0x1f')](respondWithFilteredResult(_0x233ed3,_0x6c213b))[_0x15fd('0x40')](handleError(_0x233ed3,null));};exports[_0x15fd('0x41')]=function(_0x104eef,_0x2eb6b6){var _0x145eab={'raw':![],'where':{'id':_0x104eef[_0x15fd('0x42')]['id']}},_0x269aae={};_0x269aae[_0x15fd('0x2a')]=_['keys'](db[_0x15fd('0x27')][_0x15fd('0x43')]);_0x269aae[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x104eef[_0x15fd('0x2b')]);_0x269aae[_0x15fd('0x2d')]=_[_0x15fd('0x2e')](_0x269aae[_0x15fd('0x2a')],_0x269aae['query']);_0x145eab['attributes']=_[_0x15fd('0x2e')](_0x269aae['model'],qs[_0x15fd('0x30')](_0x104eef[_0x15fd('0x2b')]['fields']));_0x145eab[_0x15fd('0x2f')]=_0x145eab[_0x15fd('0x2f')][_0x15fd('0x31')]?_0x145eab[_0x15fd('0x2f')]:_0x269aae[_0x15fd('0x2a')];if(_0x104eef[_0x15fd('0x2b')]['includeAll']){_0x145eab[_0x15fd('0x3d')]=[{'all':!![]}];}_0x145eab=_[_0x15fd('0x44')]({},_0x145eab,_0x104eef[_0x15fd('0x3b')]);return db[_0x15fd('0x27')][_0x15fd('0x45')](_0x145eab)[_0x15fd('0x1f')](handleEntityNotFound(_0x2eb6b6,null))[_0x15fd('0x1f')](respondWithResult(_0x2eb6b6,null))[_0x15fd('0x40')](handleError(_0x2eb6b6,null));};exports[_0x15fd('0x46')]=function(_0x1d3beb,_0x16b4f5){return db[_0x15fd('0x27')]['create'](_0x1d3beb[_0x15fd('0x47')],{})['then'](respondWithResult(_0x16b4f5,0xc9))[_0x15fd('0x40')](handleError(_0x16b4f5,null));};exports[_0x15fd('0x1e')]=function(_0xeb1e06,_0x5a1f32){if(_0xeb1e06[_0x15fd('0x47')]['id']){delete _0xeb1e06[_0x15fd('0x47')]['id'];}delete _0xeb1e06[_0x15fd('0x47')][_0x15fd('0x48')];delete _0xeb1e06['body'][_0x15fd('0x49')];delete _0xeb1e06[_0x15fd('0x47')][_0x15fd('0x4a')];delete _0xeb1e06[_0x15fd('0x47')]['value'];return db[_0x15fd('0x27')][_0x15fd('0x45')]({'where':{'id':_0xeb1e06['params']['id']}})['then'](handleEntityNotFound(_0x5a1f32,null))['then'](saveUpdates(_0xeb1e06[_0x15fd('0x47')],null))[_0x15fd('0x1f')](respondWithResult(_0x5a1f32,null))[_0x15fd('0x40')](handleError(_0x5a1f32,null));};exports[_0x15fd('0x4b')]=function(_0x292174,_0x33a128){return db['ScreenRecording'][_0x15fd('0x4b')]()[_0x15fd('0x1f')](respondWithResult(_0x33a128,null))[_0x15fd('0x40')](handleError(_0x33a128,null));};exports['download']=function(_0x30c4e3,_0x4dd1d5,_0x3a48e7){var _0x2886e3=require(_0x15fd('0x4c'));var _0x42d4de=![];var _0x332df7={};if(_0x30c4e3[_0x15fd('0x2b')][_0x15fd('0x38')]&&_0x30c4e3[_0x15fd('0x2b')][_0x15fd('0x38')]===_0x15fd('0x4d')){_0x332df7[_0x15fd('0x4d')]=_0x30c4e3[_0x15fd('0x42')]['id'];}else{_0x332df7['id']=_0x30c4e3[_0x15fd('0x42')]['id'];}return db['ScreenRecording'][_0x15fd('0x45')]({'where':_0x332df7,'attributes':['id','value'],'raw':!![]})[_0x15fd('0x1f')](handleEntityNotFound(_0x4dd1d5,null))['then'](function(_0x25bdea){if(_0x25bdea){var _0x1fac7f=path[_0x15fd('0x4e')](config['root'],'server/files/screen_recordings',_0x25bdea[_0x15fd('0x4f')]);var _0xc9c5ef=util[_0x15fd('0x50')](_0x15fd('0x51'),_0x1fac7f);if(fs['existsSync'](_0xc9c5ef)){_0x42d4de=!![];return _0x2886e3[_0x15fd('0x52')](_0xc9c5ef,_0x1fac7f,config[_0x15fd('0x53')][_0x15fd('0x54')])[_0x15fd('0x1f')](function(){return _0x25bdea;});}return _0x25bdea;}})[_0x15fd('0x1f')](function(_0x321fe7){if(_0x321fe7){var _0x59b3b4=path[_0x15fd('0x4e')](config[_0x15fd('0x55')],_0x15fd('0x56'),_0x321fe7[_0x15fd('0x4f')]);if(!fs[_0x15fd('0x57')](_0x59b3b4)){throw new db[(_0x15fd('0x58'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x321fe7[_0x15fd('0x59')]){return _0x4dd1d5[_0x15fd('0x5a')](_0x59b3b4,_0x321fe7['filename']+path[_0x15fd('0x5b')](_0x59b3b4),function(){if(_0x42d4de){fs[_0x15fd('0x5c')](_0x59b3b4);}});}else{return _0x4dd1d5['download'](_0x59b3b4,function(_0x285fd5){if(_0x42d4de){fs[_0x15fd('0x5c')](_0x59b3b4);}});}}})[_0x15fd('0x40')](function(_0x53bfd7){if(_0x53bfd7[_0x15fd('0x5d')]===_0x15fd('0x5e')){_0x4dd1d5[_0x15fd('0x17')](0x194)[_0x15fd('0x24')](_0x15fd('0x5f'));}else{return handleError(_0x4dd1d5,null);}});};exports[_0x15fd('0x20')]=function(_0xa1bb5c,_0x290497){return db[_0x15fd('0x27')][_0x15fd('0x45')]({'where':{'id':_0xa1bb5c['params']['id']}})[_0x15fd('0x1f')](function(_0x3a26c8){if(_['isNil'](_0x3a26c8)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3a26c8;})[_0x15fd('0x1f')](function(_0x39e6ee){var _0x2bd6ef=path[_0x15fd('0x4e')](config[_0x15fd('0x55')],_0x15fd('0x56'),_0x39e6ee['value']);logger[_0x15fd('0x60')](_0x15fd('0x61'),_0x2bd6ef);if(!_[_0x15fd('0x62')](_0x39e6ee[_0x15fd('0x4f')])&&fs[_0x15fd('0x57')](_0x2bd6ef)){logger[_0x15fd('0x60')](_0x15fd('0x63')+_0x2bd6ef+_0x15fd('0x64'));fs[_0x15fd('0x65')](_0x2bd6ef);}_0x2bd6ef=_0x2bd6ef+_0x15fd('0x66');if(!_[_0x15fd('0x62')](_0x39e6ee['value'])&&fs['existsSync'](_0x2bd6ef)){logger[_0x15fd('0x60')](_0x15fd('0x63')+_0x2bd6ef+_0x15fd('0x64'));fs[_0x15fd('0x65')](_0x2bd6ef);}return _0x39e6ee;})[_0x15fd('0x1f')](function(_0xfa3aa1){if(!_0xfa3aa1)throw new InternalError();return _0xfa3aa1[_0x15fd('0x20')]();})['then'](function(){_0x290497[_0x15fd('0x17')](0xcc)['end']();})[_0x15fd('0x40')](handleError(_0x290497,null));}; \ No newline at end of file +var _0x3eea=['filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','merge','find','create','body','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','format','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','download','filename','extname','Not\x20found','isNil','root','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys'];(function(_0x1c9327,_0x473b1f){var _0x2d49b5=function(_0x23432f){while(--_0x23432f){_0x1c9327['push'](_0x1c9327['shift']());}};_0x2d49b5(++_0x473b1f);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x48cb3e,_0x1e498d){_0x48cb3e=_0x48cb3e-0x0;var _0x5e407e=_0x3eea[_0x48cb3e];return _0x5e407e;};'use strict';var emlformat=require(_0xa3ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3ee('0x1'));var jsonpatch=require(_0xa3ee('0x2'));var rp=require(_0xa3ee('0x3'));var moment=require(_0xa3ee('0x4'));var BPromise=require(_0xa3ee('0x5'));var Mustache=require(_0xa3ee('0x6'));var util=require(_0xa3ee('0x7'));var path=require(_0xa3ee('0x8'));var sox=require(_0xa3ee('0x9'));var csv=require(_0xa3ee('0xa'));var ejs=require(_0xa3ee('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa3ee('0xc'));var crypto=require('crypto');var jsforce=require(_0xa3ee('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa3ee('0xa'));var querystring=require('querystring');var Papa=require(_0xa3ee('0xe'));var Redis=require('ioredis');var authService=require(_0xa3ee('0xf'));var qs=require(_0xa3ee('0x10'));var as=require(_0xa3ee('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa3ee('0x12'))(_0xa3ee('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa3ee('0x14'));var db=require(_0xa3ee('0x15'))['db'];function respondWithStatusCode(_0x403518,_0x4363d1){_0x4363d1=_0x4363d1||0xcc;return function(_0x594c88){if(_0x594c88){return _0x403518[_0xa3ee('0x16')](_0x4363d1);}return _0x403518['status'](_0x4363d1)[_0xa3ee('0x17')]();};}function respondWithResult(_0x20535f,_0x2c34cf){_0x2c34cf=_0x2c34cf||0xc8;return function(_0x150e20){if(_0x150e20){return _0x20535f['status'](_0x2c34cf)[_0xa3ee('0x18')](_0x150e20);}};}function respondWithFilteredResult(_0x23df7d,_0x5da681){return function(_0x5358aa){if(_0x5358aa){var _0x4b2c66=typeof _0x5da681[_0xa3ee('0x19')]===_0xa3ee('0x1a')&&typeof _0x5da681[_0xa3ee('0x1b')]===_0xa3ee('0x1a');var _0x4cc8bb=_0x5358aa[_0xa3ee('0x1c')];var _0x40ffdb=_0x4b2c66?0x0:_0x5da681[_0xa3ee('0x19')];var _0x299b1e=_0x4b2c66?_0x5358aa[_0xa3ee('0x1c')]:_0x5da681['offset']+_0x5da681[_0xa3ee('0x1b')];var _0x18b738;if(_0x299b1e>=_0x4cc8bb){_0x299b1e=_0x4cc8bb;_0x18b738=0xc8;}else{_0x18b738=0xce;}_0x23df7d[_0xa3ee('0x1d')](_0x18b738);return _0x23df7d[_0xa3ee('0x1e')](_0xa3ee('0x1f'),_0x40ffdb+'-'+_0x299b1e+'/'+_0x4cc8bb)[_0xa3ee('0x18')](_0x5358aa);}return null;};}function patchUpdates(_0x4f8c56){return function(_0x3f5d70){try{jsonpatch[_0xa3ee('0x20')](_0x3f5d70,_0x4f8c56,!![]);}catch(_0x4b8445){return BPromise[_0xa3ee('0x21')](_0x4b8445);}return _0x3f5d70['save']();};}function saveUpdates(_0x2fab5,_0x29df43){return function(_0x1d3022){if(_0x1d3022){return _0x1d3022[_0xa3ee('0x22')](_0x2fab5)[_0xa3ee('0x23')](function(_0x47108f){return _0x47108f;});}return null;};}function removeEntity(_0x3ce61b,_0x12108e){return function(_0x5ae0a1){if(_0x5ae0a1){return _0x5ae0a1[_0xa3ee('0x24')]()['then'](function(){_0x3ce61b[_0xa3ee('0x1d')](0xcc)[_0xa3ee('0x17')]();});}};}function handleEntityNotFound(_0x157071,_0x1fe4b4){return function(_0x2c48db){if(!_0x2c48db){_0x157071['sendStatus'](0x194);}return _0x2c48db;};}function handleError(_0x3c68f9,_0x1b766e){_0x1b766e=_0x1b766e||0x1f4;return function(_0x146493){logger[_0xa3ee('0x25')](_0x146493[_0xa3ee('0x26')]);if(_0x146493[_0xa3ee('0x27')]){delete _0x146493[_0xa3ee('0x27')];}_0x3c68f9[_0xa3ee('0x1d')](_0x1b766e)[_0xa3ee('0x28')](_0x146493);};}exports[_0xa3ee('0x29')]=function(_0x59c6f9,_0x5ba571){var _0x4abf49={},_0x78e581={},_0x481358={'count':0x0,'rows':[]};var _0x3fa094=_[_0xa3ee('0x2a')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')],function(_0x26b222){return{'name':_0x26b222[_0xa3ee('0x2d')],'type':_0x26b222[_0xa3ee('0x2e')][_0xa3ee('0x2f')]};});_0x78e581[_0xa3ee('0x30')]=_[_0xa3ee('0x31')](_['map'](_0x3fa094,_0xa3ee('0x27')),['format']);_0x78e581[_0xa3ee('0x32')]=_[_0xa3ee('0x33')](_0x59c6f9['query']);_0x78e581[_0xa3ee('0x34')]=_['intersection'](_0x78e581[_0xa3ee('0x30')],_0x78e581['query']);_0x4abf49[_0xa3ee('0x35')]=_[_0xa3ee('0x36')](_0x78e581[_0xa3ee('0x30')],qs[_0xa3ee('0x37')](_0x59c6f9[_0xa3ee('0x32')]['fields']));_0x4abf49[_0xa3ee('0x35')]=_0x4abf49[_0xa3ee('0x35')][_0xa3ee('0x38')]?_0x4abf49['attributes']:_0x78e581[_0xa3ee('0x30')];if(!_0x59c6f9['query'][_0xa3ee('0x39')]('nolimit')){_0x4abf49[_0xa3ee('0x1b')]=qs['limit'](_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x1b')]);_0x4abf49[_0xa3ee('0x19')]=qs[_0xa3ee('0x19')](_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x19')]);}_0x4abf49[_0xa3ee('0x3a')]=qs[_0xa3ee('0x3b')](_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x3b')]);_0x4abf49[_0xa3ee('0x3c')]=qs[_0xa3ee('0x34')](_[_0xa3ee('0x3d')](_0x59c6f9['query'],_0x78e581[_0xa3ee('0x34')]),_0x3fa094);if(_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x3e')]){_0x4abf49[_0xa3ee('0x3c')]=_['merge'](_0x4abf49[_0xa3ee('0x3c')],{'$or':_[_0xa3ee('0x2a')](_0x3fa094,function(_0x1a9b63){if(_0x1a9b63['type']!==_0xa3ee('0x3f')){var _0x3554eb={};_0x3554eb[_0x1a9b63['name']]={'$like':'%'+_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x3e')]+'%'};return _0x3554eb;}})});}_0x4abf49=_['merge']({},_0x4abf49,_0x59c6f9[_0xa3ee('0x40')]);var _0x6dd235={'where':_0x4abf49[_0xa3ee('0x3c')]};return db[_0xa3ee('0x2b')][_0xa3ee('0x1c')](_0x6dd235)[_0xa3ee('0x23')](function(_0x2ca04f){_0x481358[_0xa3ee('0x1c')]=_0x2ca04f;if(_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x41')]){_0x4abf49[_0xa3ee('0x42')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x4abf49);})['then'](function(_0x45aeec){_0x481358[_0xa3ee('0x43')]=_0x45aeec;return _0x481358;})['then'](respondWithFilteredResult(_0x5ba571,_0x4abf49))[_0xa3ee('0x44')](handleError(_0x5ba571,null));};exports[_0xa3ee('0x45')]=function(_0x279834,_0x55f47f){var _0x1af10b={'raw':![],'where':{'id':_0x279834[_0xa3ee('0x46')]['id']}},_0x559cc1={};_0x559cc1[_0xa3ee('0x30')]=_[_0xa3ee('0x33')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')]);_0x559cc1[_0xa3ee('0x32')]=_[_0xa3ee('0x33')](_0x279834[_0xa3ee('0x32')]);_0x559cc1[_0xa3ee('0x34')]=_[_0xa3ee('0x36')](_0x559cc1[_0xa3ee('0x30')],_0x559cc1[_0xa3ee('0x32')]);_0x1af10b[_0xa3ee('0x35')]=_[_0xa3ee('0x36')](_0x559cc1[_0xa3ee('0x30')],qs[_0xa3ee('0x37')](_0x279834[_0xa3ee('0x32')][_0xa3ee('0x37')]));_0x1af10b['attributes']=_0x1af10b[_0xa3ee('0x35')][_0xa3ee('0x38')]?_0x1af10b[_0xa3ee('0x35')]:_0x559cc1[_0xa3ee('0x30')];if(_0x279834['query'][_0xa3ee('0x41')]){_0x1af10b['include']=[{'all':!![]}];}_0x1af10b=_[_0xa3ee('0x47')]({},_0x1af10b,_0x279834[_0xa3ee('0x40')]);return db[_0xa3ee('0x2b')][_0xa3ee('0x48')](_0x1af10b)[_0xa3ee('0x23')](handleEntityNotFound(_0x55f47f,null))[_0xa3ee('0x23')](respondWithResult(_0x55f47f,null))[_0xa3ee('0x44')](handleError(_0x55f47f,null));};exports[_0xa3ee('0x49')]=function(_0x3c3677,_0xd6160e){return db['ScreenRecording'][_0xa3ee('0x49')](_0x3c3677['body'],{})['then'](respondWithResult(_0xd6160e,0xc9))[_0xa3ee('0x44')](handleError(_0xd6160e,null));};exports[_0xa3ee('0x22')]=function(_0x45029f,_0x1ec479){if(_0x45029f[_0xa3ee('0x4a')]['id']){delete _0x45029f[_0xa3ee('0x4a')]['id'];}delete _0x45029f[_0xa3ee('0x4a')]['duration'];delete _0x45029f[_0xa3ee('0x4a')][_0xa3ee('0x4b')];delete _0x45029f['body'][_0xa3ee('0x4c')];delete _0x45029f[_0xa3ee('0x4a')][_0xa3ee('0x4d')];return db['ScreenRecording']['find']({'where':{'id':_0x45029f[_0xa3ee('0x46')]['id']}})[_0xa3ee('0x23')](handleEntityNotFound(_0x1ec479,null))[_0xa3ee('0x23')](saveUpdates(_0x45029f[_0xa3ee('0x4a')],null))[_0xa3ee('0x23')](respondWithResult(_0x1ec479,null))['catch'](handleError(_0x1ec479,null));};exports['describe']=function(_0x15b55e,_0x441b23){return db['ScreenRecording'][_0xa3ee('0x4e')]()[_0xa3ee('0x23')](respondWithResult(_0x441b23,null))[_0xa3ee('0x44')](handleError(_0x441b23,null));};exports['download']=function(_0x505444,_0x2388f7,_0x49057c){var _0x172a73=require(_0xa3ee('0x4f'));var _0x5b8e79=![];var _0x4232e0={};if(_0x505444[_0xa3ee('0x32')][_0xa3ee('0x2e')]&&_0x505444['query'][_0xa3ee('0x2e')]===_0xa3ee('0x50')){_0x4232e0['uniqueid']=_0x505444[_0xa3ee('0x46')]['id'];}else{_0x4232e0['id']=_0x505444[_0xa3ee('0x46')]['id'];}return db[_0xa3ee('0x2b')]['find']({'where':_0x4232e0,'attributes':['id','value'],'raw':!![]})[_0xa3ee('0x23')](handleEntityNotFound(_0x2388f7,null))[_0xa3ee('0x23')](function(_0x4a1a2f){if(_0x4a1a2f){var _0x1f9913=path[_0xa3ee('0x51')](config['root'],'server/files/screen_recordings',_0x4a1a2f[_0xa3ee('0x4d')]);var _0x659491=util[_0xa3ee('0x52')]('%s.cypher',_0x1f9913);if(fs[_0xa3ee('0x53')](_0x659491)){_0x5b8e79=!![];return _0x172a73[_0xa3ee('0x54')](_0x659491,_0x1f9913,config[_0xa3ee('0x55')][_0xa3ee('0x56')])[_0xa3ee('0x23')](function(){return _0x4a1a2f;});}return _0x4a1a2f;}})[_0xa3ee('0x23')](function(_0x497be4){if(_0x497be4){var _0x10f508=path[_0xa3ee('0x51')](config['root'],_0xa3ee('0x57'),_0x497be4[_0xa3ee('0x4d')]);if(!fs[_0xa3ee('0x53')](_0x10f508)){throw new db[(_0xa3ee('0x58'))][(_0xa3ee('0x59'))](_0xa3ee('0x5a'));}if(_0x497be4['filename']){return _0x2388f7[_0xa3ee('0x5b')](_0x10f508,_0x497be4[_0xa3ee('0x5c')]+path[_0xa3ee('0x5d')](_0x10f508),function(){if(_0x5b8e79){fs['unlink'](_0x10f508);}});}else{return _0x2388f7[_0xa3ee('0x5b')](_0x10f508,function(_0x13b81b){if(_0x5b8e79){fs['unlink'](_0x10f508);}});}}})['catch'](function(_0x4df186){if(_0x4df186['message']===_0xa3ee('0x5a')){_0x2388f7[_0xa3ee('0x1d')](0x194)[_0xa3ee('0x28')](_0xa3ee('0x5e'));}else{return handleError(_0x2388f7,null);}});};exports[_0xa3ee('0x24')]=function(_0x18a164,_0x4000ee){return db['ScreenRecording'][_0xa3ee('0x48')]({'where':{'id':_0x18a164[_0xa3ee('0x46')]['id']}})[_0xa3ee('0x23')](function(_0xaff641){if(_[_0xa3ee('0x5f')](_0xaff641)){throw new ReferenceError('Entity\x20not\x20found');}return _0xaff641;})['then'](function(_0x7b1e97){var _0x303b71=path[_0xa3ee('0x51')](config[_0xa3ee('0x60')],_0xa3ee('0x57'),_0x7b1e97[_0xa3ee('0x4d')]);logger[_0xa3ee('0x61')](_0xa3ee('0x62'),_0x303b71);if(!_[_0xa3ee('0x5f')](_0x7b1e97[_0xa3ee('0x4d')])&&fs[_0xa3ee('0x53')](_0x303b71)){logger[_0xa3ee('0x61')](_0xa3ee('0x63')+_0x303b71+_0xa3ee('0x64'));fs[_0xa3ee('0x65')](_0x303b71);}_0x303b71=_0x303b71+'.cypher';if(!_[_0xa3ee('0x5f')](_0x7b1e97['value'])&&fs['existsSync'](_0x303b71)){logger[_0xa3ee('0x61')]('File:\x20\x22'+_0x303b71+_0xa3ee('0x64'));fs[_0xa3ee('0x65')](_0x303b71);}return _0x7b1e97;})[_0xa3ee('0x23')](function(_0x221deb){if(!_0x221deb)throw new InternalError();return _0x221deb['destroy']();})[_0xa3ee('0x23')](function(){_0x4000ee[_0xa3ee('0x1d')](0xcc)[_0xa3ee('0x17')]();})[_0xa3ee('0x44')](handleError(_0x4000ee,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 9e04ecc..020bf72 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 _0x0019=['bluebird','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','ScreenRecording','interactionid','lodash','util','../../config/logger','api'];(function(_0x57cb3e,_0x3cf3a8){var _0xb30280=function(_0x5f206e){while(--_0x5f206e){_0x57cb3e['push'](_0x57cb3e['shift']());}};_0xb30280(++_0x3cf3a8);}(_0x0019,0x1c4));var _0x9001=function(_0x2077c2,_0x275ab5){_0x2077c2=_0x2077c2-0x0;var _0x312f9f=_0x0019[_0x2077c2];return _0x312f9f;};'use strict';var _=require(_0x9001('0x0'));var util=require(_0x9001('0x1'));var logger=require(_0x9001('0x2'))(_0x9001('0x3'));var moment=require('moment');var BPromise=require(_0x9001('0x4'));var rp=require(_0x9001('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9001('0x6'));var config=require(_0x9001('0x7'));var attributes=require(_0x9001('0x8'));module[_0x9001('0x9')]=function(_0x90c360,_0x18e96d){return _0x90c360['define'](_0x9001('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x9001('0xb'),'fields':[_0x9001('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8161=['./screenRecording.attributes','exports','define','interactionid','util','../../config/logger','api','bluebird','path'];(function(_0x30c684,_0x391514){var _0x3bc4ac=function(_0x22c1f0){while(--_0x22c1f0){_0x30c684['push'](_0x30c684['shift']());}};_0x3bc4ac(++_0x391514);}(_0x8161,0xc1));var _0x1816=function(_0x782701,_0x3bd97a){_0x782701=_0x782701-0x0;var _0x403dcb=_0x8161[_0x782701];return _0x403dcb;};'use strict';var _=require('lodash');var util=require(_0x1816('0x0'));var logger=require(_0x1816('0x1'))(_0x1816('0x2'));var moment=require('moment');var BPromise=require(_0x1816('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1816('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1816('0x5'));module[_0x1816('0x6')]=function(_0x3743e6,_0x5df573){return _0x3743e6[_0x1816('0x7')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x1816('0x8'),'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 1ae4917..fd283d8 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 _0x8895=['rpc','../../config/environment','jayson/promise','client','http','request','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x8895,0x15f));var _0x5889=function(_0x1af98c,_0x4a5fdd){_0x1af98c=_0x1af98c-0x0;var _0xd73eec=_0x8895[_0x1af98c];return _0xd73eec;};'use strict';var _=require(_0x5889('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5889('0x1'));var rs=require(_0x5889('0x2'));var fs=require('fs');var Redis=require(_0x5889('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5889('0x4'));var logger=require(_0x5889('0x5'))(_0x5889('0x6'));var config=require(_0x5889('0x7'));var jayson=require(_0x5889('0x8'));var client=jayson[_0x5889('0x9')][_0x5889('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3da5f2,_0xfd4a96,_0x5753b5){return new BPromise(function(_0x10c3d3,_0x2409c1){return client[_0x5889('0xb')](_0x3da5f2,_0x5753b5)['then'](function(_0x1a59e1){logger[_0x5889('0xc')](_0x5889('0xd'),_0xfd4a96,_0x5889('0xe'));logger['debug'](_0x5889('0xf'),_0xfd4a96,'request\x20sent',JSON[_0x5889('0x10')](_0x1a59e1));if(_0x1a59e1['error']){if(_0x1a59e1[_0x5889('0x11')][_0x5889('0x12')]===0x1f4){logger[_0x5889('0x11')](_0x5889('0xd'),_0xfd4a96,_0x1a59e1['error'][_0x5889('0x13')]);return _0x2409c1(_0x1a59e1[_0x5889('0x11')]['message']);}logger[_0x5889('0x11')](_0x5889('0xd'),_0xfd4a96,_0x1a59e1[_0x5889('0x11')][_0x5889('0x13')]);return _0x10c3d3(_0x1a59e1[_0x5889('0x11')][_0x5889('0x13')]);}else{logger[_0x5889('0xc')](_0x5889('0xd'),_0xfd4a96,_0x5889('0xe'));_0x10c3d3(_0x1a59e1['result']['message']);}})[_0x5889('0x14')](function(_0x538b21){logger['error'](_0x5889('0xd'),_0xfd4a96,_0x538b21);_0x2409c1(_0x538b21);});});} \ No newline at end of file +var _0x8be6=['ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8be6,0x176));var _0x68be=function(_0x50b31a,_0x2f611f){_0x50b31a=_0x50b31a-0x0;var _0x2b2a56=_0x8be6[_0x50b31a];return _0x2b2a56;};'use strict';var _=require('lodash');var util=require(_0x68be('0x0'));var moment=require(_0x68be('0x1'));var BPromise=require(_0x68be('0x2'));var rs=require(_0x68be('0x3'));var fs=require('fs');var Redis=require(_0x68be('0x4'));var db=require(_0x68be('0x5'))['db'];var utils=require(_0x68be('0x6'));var logger=require('../../config/logger')(_0x68be('0x7'));var config=require('../../config/environment');var jayson=require(_0x68be('0x8'));var client=jayson[_0x68be('0x9')][_0x68be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48b2f1,_0x1118d4,_0x37c07b){return new BPromise(function(_0x113ba4,_0xe26bfe){return client[_0x68be('0xb')](_0x48b2f1,_0x37c07b)[_0x68be('0xc')](function(_0xfcfb94){logger[_0x68be('0xd')](_0x68be('0xe'),_0x1118d4,_0x68be('0xf'));logger[_0x68be('0x10')](_0x68be('0x11'),_0x1118d4,'request\x20sent',JSON['stringify'](_0xfcfb94));if(_0xfcfb94[_0x68be('0x12')]){if(_0xfcfb94['error'][_0x68be('0x13')]===0x1f4){logger['error'](_0x68be('0xe'),_0x1118d4,_0xfcfb94['error'][_0x68be('0x14')]);return _0xe26bfe(_0xfcfb94['error']['message']);}logger[_0x68be('0x12')](_0x68be('0xe'),_0x1118d4,_0xfcfb94[_0x68be('0x12')][_0x68be('0x14')]);return _0x113ba4(_0xfcfb94['error'][_0x68be('0x14')]);}else{logger[_0x68be('0xd')](_0x68be('0xe'),_0x1118d4,_0x68be('0xf'));_0x113ba4(_0xfcfb94[_0x68be('0x15')][_0x68be('0x14')]);}})[_0x68be('0x16')](function(_0x3925fb){logger[_0x68be('0x12')](_0x68be('0xe'),_0x1118d4,_0x3925fb);_0xe26bfe(_0x3925fb);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index c86cc15..1ecc41b 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 _0xfc10=['/:id/logo','single','file','addLogo','join','logologin','post','/:id/logo_login','addLogoLogin','preferred','favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/now','getDate','/:id','show','getLogo','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','originalname'];(function(_0x345407,_0x4df647){var _0x1fb47f=function(_0x3d2985){while(--_0x3d2985){_0x345407['push'](_0x345407['shift']());}};_0x1fb47f(++_0x4df647);}(_0xfc10,0x180));var _0x0fc1=function(_0x4dcef9,_0xda7aaf){_0x4dcef9=_0x4dcef9-0x0;var _0x278556=_0xfc10[_0x4dcef9];return _0x278556;};'use strict';var multer=require(_0x0fc1('0x0'));var util=require(_0x0fc1('0x1'));var path=require(_0x0fc1('0x2'));var timeout=require(_0x0fc1('0x3'));var express=require(_0x0fc1('0x4'));var router=express[_0x0fc1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0fc1('0x6'));var interaction=require(_0x0fc1('0x7'));var config=require('../../config/environment');var controller=require('./setting.controller');router[_0x0fc1('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0fc1('0x8')](_0x0fc1('0x9'),controller[_0x0fc1('0xa')]);router[_0x0fc1('0x8')](_0x0fc1('0xb'),controller[_0x0fc1('0xc')]);router[_0x0fc1('0x8')]('/:id/logo',controller[_0x0fc1('0xd')]);router[_0x0fc1('0x8')]('/:id/logo_login',controller['getLogoLogin']);router['get'](_0x0fc1('0xe'),controller[_0x0fc1('0xf')]);router['get'](_0x0fc1('0x10'),controller['getPreferred']);router['get'](_0x0fc1('0x11'),controller['getFavicon']);var upload=multer({'storage':multer[_0x0fc1('0x12')]({'destination':function(_0x1ed1f9,_0x1019cb,_0x383bf0){_0x383bf0(null,path['join'](config[_0x0fc1('0x13')],_0x0fc1('0x14')));},'filename':function(_0x365b53,_0x56ea0c,_0x42170a){_0x42170a(null,util[_0x0fc1('0x15')](_0x0fc1('0x16'),_0x0fc1('0x17'),path[_0x0fc1('0x18')](_0x56ea0c[_0x0fc1('0x19')])));}})});router['post'](_0x0fc1('0x1a'),upload[_0x0fc1('0x1b')](_0x0fc1('0x1c')),controller[_0x0fc1('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2a7bd7,_0x3e290e,_0x44fdd6){_0x44fdd6(null,path[_0x0fc1('0x1e')](config[_0x0fc1('0x13')],_0x0fc1('0x14')));},'filename':function(_0x314b9c,_0x2f879a,_0x21a6fc){_0x21a6fc(null,util['format']('%s%s',_0x0fc1('0x1f'),path[_0x0fc1('0x18')](_0x2f879a[_0x0fc1('0x19')])));}})});router[_0x0fc1('0x20')](_0x0fc1('0x21'),upload[_0x0fc1('0x1b')](_0x0fc1('0x1c')),controller[_0x0fc1('0x22')]);var upload=multer({'storage':multer[_0x0fc1('0x12')]({'destination':function(_0x4b5379,_0x13e894,_0xcedc9e){_0xcedc9e(null,path[_0x0fc1('0x1e')](config[_0x0fc1('0x13')],_0x0fc1('0x14')));},'filename':function(_0x48f493,_0x23afd9,_0x23c727){_0x23c727(null,util['format'](_0x0fc1('0x16'),_0x0fc1('0x23'),path['extname'](_0x23afd9[_0x0fc1('0x19')])));}})});router[_0x0fc1('0x20')](_0x0fc1('0x10'),upload[_0x0fc1('0x1b')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0x0fc1('0x12')]({'destination':function(_0x5d448d,_0x2bef46,_0x1c1336){_0x1c1336(null,path[_0x0fc1('0x1e')](config['root'],_0x0fc1('0x14')));},'filename':function(_0x3925da,_0x387534,_0x15b941){_0x15b941(null,util[_0x0fc1('0x15')](_0x0fc1('0x16'),_0x0fc1('0x24'),path[_0x0fc1('0x18')](_0x387534[_0x0fc1('0x19')])));}})});router[_0x0fc1('0x20')](_0x0fc1('0x11'),upload['single'](_0x0fc1('0x1c')),controller[_0x0fc1('0x25')]);router[_0x0fc1('0x26')]('/:id',auth['isAuthenticated'](),controller[_0x0fc1('0x27')]);module[_0x0fc1('0x28')]=router; \ No newline at end of file +var _0x21e6=['logo','post','single','file','addLogo','diskStorage','server/files/images/logos/','addLogoLogin','%s%s','preferred','extname','addPreferred','root','favicon','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','getDate','/:id','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','join','format'];(function(_0x3df822,_0x299495){var _0x4e457d=function(_0x68a45f){while(--_0x68a45f){_0x3df822['push'](_0x3df822['shift']());}};_0x4e457d(++_0x299495);}(_0x21e6,0x19a));var _0x621e=function(_0x315add,_0x5e9ace){_0x315add=_0x315add-0x0;var _0x40956b=_0x21e6[_0x315add];return _0x40956b;};'use strict';var multer=require(_0x621e('0x0'));var util=require(_0x621e('0x1'));var path=require(_0x621e('0x2'));var timeout=require(_0x621e('0x3'));var express=require(_0x621e('0x4'));var router=express[_0x621e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x621e('0x6'));var config=require(_0x621e('0x7'));var controller=require('./setting.controller');router[_0x621e('0x8')]('/',auth[_0x621e('0x9')](),controller[_0x621e('0xa')]);router[_0x621e('0x8')]('/now',controller[_0x621e('0xb')]);router[_0x621e('0x8')](_0x621e('0xc'),controller['show']);router['get']('/:id/logo',controller[_0x621e('0xd')]);router['get'](_0x621e('0xe'),controller[_0x621e('0xf')]);router['get']('/:id/gdpr',controller[_0x621e('0x10')]);router['get'](_0x621e('0x11'),controller[_0x621e('0x12')]);router[_0x621e('0x8')](_0x621e('0x13'),controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x27a48f,_0x4ea2a6,_0xde2962){_0xde2962(null,path[_0x621e('0x14')](config['root'],'server/files/images/logos/'));},'filename':function(_0x1ce2f4,_0x1b654b,_0x27ee33){_0x27ee33(null,util[_0x621e('0x15')]('%s%s',_0x621e('0x16'),path['extname'](_0x1b654b['originalname'])));}})});router[_0x621e('0x17')]('/:id/logo',upload[_0x621e('0x18')](_0x621e('0x19')),controller[_0x621e('0x1a')]);var upload=multer({'storage':multer[_0x621e('0x1b')]({'destination':function(_0x27da52,_0x37269e,_0x38c953){_0x38c953(null,path['join'](config['root'],_0x621e('0x1c')));},'filename':function(_0x42d509,_0x509cf4,_0x38c216){_0x38c216(null,util[_0x621e('0x15')]('%s%s','logologin',path['extname'](_0x509cf4['originalname'])));}})});router[_0x621e('0x17')](_0x621e('0xe'),upload['single'](_0x621e('0x19')),controller[_0x621e('0x1d')]);var upload=multer({'storage':multer[_0x621e('0x1b')]({'destination':function(_0x181d98,_0x2344df,_0x30d688){_0x30d688(null,path[_0x621e('0x14')](config['root'],_0x621e('0x1c')));},'filename':function(_0x555e17,_0x52ee98,_0x31d375){_0x31d375(null,util[_0x621e('0x15')](_0x621e('0x1e'),_0x621e('0x1f'),path[_0x621e('0x20')](_0x52ee98['originalname'])));}})});router[_0x621e('0x17')](_0x621e('0x11'),upload[_0x621e('0x18')](_0x621e('0x19')),controller[_0x621e('0x21')]);var upload=multer({'storage':multer[_0x621e('0x1b')]({'destination':function(_0x4a292b,_0x1c5671,_0x12ef24){_0x12ef24(null,path['join'](config[_0x621e('0x22')],_0x621e('0x1c')));},'filename':function(_0x2064fb,_0x3b3ebe,_0x44a9af){_0x44a9af(null,util['format'](_0x621e('0x1e'),_0x621e('0x23'),path[_0x621e('0x20')](_0x3b3ebe['originalname'])));}})});router[_0x621e('0x17')](_0x621e('0x13'),upload[_0x621e('0x18')](_0x621e('0x19')),controller['addFavicon']);router['put'](_0x621e('0xc'),auth[_0x621e('0x9')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 4c069d9..561be09 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 _0x9ed2=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','min_internal','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x19386d,_0x53cdfe){var _0x2e5f1a=function(_0x528d81){while(--_0x528d81){_0x19386d['push'](_0x19386d['shift']());}};_0x2e5f1a(++_0x53cdfe);}(_0x9ed2,0x175));var _0x29ed=function(_0x43fdf8,_0x8426b3){_0x43fdf8=_0x43fdf8-0x0;var _0x1160c6=_0x9ed2[_0x43fdf8];return _0x1160c6;};'use strict';var Sequelize=require(_0x29ed('0x0'));module['exports']={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x29ed('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x29ed('0x2')](0xb),'unique':_0x29ed('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x29ed('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x29ed('0x4')],'defaultValue':_0x29ed('0x5')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x29ed('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x29ed('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x29ed('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x29ed('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x29ed('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x29ed('0x4')]},'turnaddr':{'type':Sequelize[_0x29ed('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x29ed('0x4')]},'pageTitle':{'type':Sequelize[_0x29ed('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x29ed('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x29ed('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x29ed('0x4')],'defaultValue':_0x29ed('0x7')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x29ed('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x29ed('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x29ed('0x4')],'defaultValue':_0x29ed('0x8')},'chatTimeout':{'type':Sequelize[_0x29ed('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x29ed('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x29ed('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x29ed('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x29ed('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x29ed('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x29ed('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x29ed('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x29ed('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x29ed('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x29ed('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x29ed('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x29ed('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x29ed('0x2')]},'sentimentRegion':{'type':Sequelize[_0x29ed('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x29ed('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x29ed('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x29ed('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x29ed('0x2')](0x2)[_0x29ed('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x29ed('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x29ed('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x29ed('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x29ed('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x29ed('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x29ed('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x29ed('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x29ed('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x29ed('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0x29ed('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x8b81=['sequelize','exports','min_internal','INTEGER','min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED'];(function(_0x272433,_0x4b081f){var _0x587054=function(_0x48b831){while(--_0x48b831){_0x272433['push'](_0x272433['shift']());}};_0x587054(++_0x4b081f);}(_0x8b81,0x1f4));var _0x18b8=function(_0x1543d2,_0x1bfbcf){_0x1543d2=_0x1543d2-0x0;var _0x5eac89=_0x8b81[_0x1543d2];return _0x5eac89;};'use strict';var Sequelize=require(_0x18b8('0x0'));module[_0x18b8('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x18b8('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x18b8('0x3')](0xb),'unique':_0x18b8('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x18b8('0x5')},'logo':{'type':Sequelize[_0x18b8('0x6')]},'defaultLogo':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x18b8('0x6')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x18b8('0x6')]},'turnpassword':{'type':Sequelize[_0x18b8('0x6')]},'pageTitle':{'type':Sequelize[_0x18b8('0x6')]},'defaultPageTitle':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x18b8('0x6')],'defaultValue':_0x18b8('0x8')},'enableEmailPreview':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x18b8('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x18b8('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x18b8('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x18b8('0x6')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x18b8('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x18b8('0x6')]},'defaultPreferred':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x18b8('0x3')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x18b8('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x18b8('0x6')]},'defaultFavicon':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x18b8('0x3')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x18b8('0x3')]},'transcribeRegion':{'type':Sequelize[_0x18b8('0x6')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x18b8('0x3')]},'sentimentRegion':{'type':Sequelize[_0x18b8('0x6')]},'language':{'type':Sequelize[_0x18b8('0x6')]},'bucket':{'type':Sequelize[_0x18b8('0x6')]},'googleSsoEnabled':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x18b8('0x3')](0x2)[_0x18b8('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x18b8('0x3')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x18b8('0x3')](0x2)[_0x18b8('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x18b8('0x3')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x18b8('0x3')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x18b8('0x3')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x18b8('0x3')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x18b8('0x3')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x18b8('0x3')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x18b8('0x3')],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0x18b8('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index e37f2a5..6f7c5bf 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 _0x4a06=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','end','stack','name','send','index','map','Setting','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','find','body','params','file','filename','logo','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','defaultLogo','defaultLoginLogo','default_loginLogo.svg','download','gdpr','securePassword','addPreferred','getPreferred','favicon','default_preferred.png','getFavicon','default_favicon.ico','now','utcOffset','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3baa42,_0x28d1db){var _0x1d6061=function(_0x4eb8c6){while(--_0x4eb8c6){_0x3baa42['push'](_0x3baa42['shift']());}};_0x1d6061(++_0x28d1db);}(_0x4a06,0x1f2));var _0x64a0=function(_0x5c8e25,_0x4898da){_0x5c8e25=_0x5c8e25-0x0;var _0x3e3b55=_0x4a06[_0x5c8e25];return _0x3e3b55;};'use strict';var emlformat=require(_0x64a0('0x0'));var rimraf=require(_0x64a0('0x1'));var zipdir=require(_0x64a0('0x2'));var jsonpatch=require(_0x64a0('0x3'));var rp=require(_0x64a0('0x4'));var moment=require(_0x64a0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x64a0('0x6'));var util=require(_0x64a0('0x7'));var path=require(_0x64a0('0x8'));var sox=require(_0x64a0('0x9'));var csv=require(_0x64a0('0xa'));var ejs=require(_0x64a0('0xb'));var fs=require('fs');var fs_extra=require(_0x64a0('0xc'));var _=require(_0x64a0('0xd'));var squel=require(_0x64a0('0xe'));var crypto=require(_0x64a0('0xf'));var jsforce=require(_0x64a0('0x10'));var deskjs=require(_0x64a0('0x11'));var toCsv=require(_0x64a0('0xa'));var querystring=require(_0x64a0('0x12'));var Papa=require(_0x64a0('0x13'));var Redis=require('ioredis');var authService=require(_0x64a0('0x14'));var qs=require(_0x64a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x64a0('0x16'));var logger=require(_0x64a0('0x17'))(_0x64a0('0x18'));var utils=require(_0x64a0('0x19'));var config=require(_0x64a0('0x1a'));var licenseUtil=require(_0x64a0('0x1b'));var db=require('../../mysqldb')['db'];var jayson=require(_0x64a0('0x1c'));var client=jayson[_0x64a0('0x1d')][_0x64a0('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5932cb,_0xc1d319,_0x1a1b46,_0x4c125f){return new BPromise(function(_0x18550c,_0x109be2){var _0x3a41db=_0x4c125f||client;return _0x3a41db[_0x64a0('0x1f')](_0x5932cb,_0x1a1b46)['then'](function(_0x143d49){logger[_0x64a0('0x20')](_0x64a0('0x21'),_0xc1d319,_0x64a0('0x22'));logger[_0x64a0('0x23')](_0x64a0('0x24'),_0xc1d319,_0x64a0('0x22'),JSON[_0x64a0('0x25')](_0x143d49));if(_0x143d49[_0x64a0('0x26')]){if(_0x143d49[_0x64a0('0x26')][_0x64a0('0x27')]===0x1f4){logger['error'](_0x64a0('0x21'),_0xc1d319,_0x143d49[_0x64a0('0x26')][_0x64a0('0x28')]);return _0x109be2(_0x143d49[_0x64a0('0x26')][_0x64a0('0x28')]);}logger[_0x64a0('0x26')]('Setting,\x20%s,\x20%s',_0xc1d319,_0x143d49['error'][_0x64a0('0x28')]);return _0x18550c(_0x143d49['error']['message']);}else{logger['info'](_0x64a0('0x21'),_0xc1d319,_0x64a0('0x22'));_0x18550c(_0x143d49[_0x64a0('0x29')]['message']);}})[_0x64a0('0x2a')](function(_0x3190cb){logger[_0x64a0('0x26')]('Setting,\x20%s,\x20%s',_0xc1d319,_0x3190cb);_0x109be2(_0x3190cb);});});}function respondWithStatusCode(_0x8aac66,_0x3d6970){_0x3d6970=_0x3d6970||0xcc;return function(_0x4ff3c8){if(_0x4ff3c8){return _0x8aac66[_0x64a0('0x2b')](_0x3d6970);}return _0x8aac66[_0x64a0('0x2c')](_0x3d6970)['end']();};}function respondWithResult(_0x4cea5a,_0xc0f23){_0xc0f23=_0xc0f23||0xc8;return function(_0x1d9bdd){if(_0x1d9bdd){return _0x4cea5a[_0x64a0('0x2c')](_0xc0f23)[_0x64a0('0x2d')](_0x1d9bdd);}};}function respondWithFilteredResult(_0x4a30ad,_0x52e178){return function(_0x338e81){if(_0x338e81){var _0x3b926a=typeof _0x52e178['offset']===_0x64a0('0x2e')&&typeof _0x52e178[_0x64a0('0x2f')]===_0x64a0('0x2e');var _0x2f3927=_0x338e81[_0x64a0('0x30')];var _0x333b3c=_0x3b926a?0x0:_0x52e178[_0x64a0('0x31')];var _0x17bde4=_0x3b926a?_0x338e81[_0x64a0('0x30')]:_0x52e178[_0x64a0('0x31')]+_0x52e178[_0x64a0('0x2f')];var _0x4ffa4b;if(_0x17bde4>=_0x2f3927){_0x17bde4=_0x2f3927;_0x4ffa4b=0xc8;}else{_0x4ffa4b=0xce;}_0x4a30ad[_0x64a0('0x2c')](_0x4ffa4b);return _0x4a30ad['set'](_0x64a0('0x32'),_0x333b3c+'-'+_0x17bde4+'/'+_0x2f3927)[_0x64a0('0x2d')](_0x338e81);}return null;};}function patchUpdates(_0x544b63){return function(_0x2f4441){try{jsonpatch['apply'](_0x2f4441,_0x544b63,!![]);}catch(_0x2f3794){return BPromise[_0x64a0('0x33')](_0x2f3794);}return _0x2f4441[_0x64a0('0x34')]();};}function saveUpdates(_0x375526,_0x1f19fd){return function(_0x53b6a2){if(_0x53b6a2){return _0x53b6a2[_0x64a0('0x35')](_0x375526)[_0x64a0('0x36')](function(_0x679b89){return _0x679b89;});}return null;};}function removeEntity(_0x1ce778,_0x2b83d3){return function(_0x54cea6){if(_0x54cea6){return _0x54cea6['destroy']()['then'](function(){_0x1ce778[_0x64a0('0x2c')](0xcc)[_0x64a0('0x37')]();});}};}function handleEntityNotFound(_0x1fdf45,_0x2e6fe3){return function(_0x52534a){if(!_0x52534a){_0x1fdf45[_0x64a0('0x2b')](0x194);}return _0x52534a;};}function handleError(_0x46b224,_0xc16c7f){_0xc16c7f=_0xc16c7f||0x1f4;return function(_0x2741ed){logger[_0x64a0('0x26')](_0x2741ed[_0x64a0('0x38')]);if(_0x2741ed[_0x64a0('0x39')]){delete _0x2741ed[_0x64a0('0x39')];}_0x46b224['status'](_0xc16c7f)[_0x64a0('0x3a')](_0x2741ed);};}exports[_0x64a0('0x3b')]=function(_0x1062a2,_0x410fec){var _0x25afd3={},_0xee6408={},_0x50870b={'count':0x0,'rows':[]};var _0x52b5c8=_[_0x64a0('0x3c')](db[_0x64a0('0x3d')]['rawAttributes'],function(_0x214c93){return{'name':_0x214c93[_0x64a0('0x3e')],'type':_0x214c93['type']['key']};});_0xee6408[_0x64a0('0x3f')]=_[_0x64a0('0x3c')](_0x52b5c8,_0x64a0('0x39'));_0xee6408[_0x64a0('0x40')]=_[_0x64a0('0x41')](_0x1062a2[_0x64a0('0x40')]);_0xee6408[_0x64a0('0x42')]=_[_0x64a0('0x43')](_0xee6408[_0x64a0('0x3f')],_0xee6408[_0x64a0('0x40')]);_0x25afd3[_0x64a0('0x44')]=_[_0x64a0('0x43')](_0xee6408[_0x64a0('0x3f')],qs[_0x64a0('0x45')](_0x1062a2[_0x64a0('0x40')][_0x64a0('0x45')]));_0x25afd3[_0x64a0('0x44')]=_0x25afd3[_0x64a0('0x44')][_0x64a0('0x46')]?_0x25afd3[_0x64a0('0x44')]:_0xee6408[_0x64a0('0x3f')];if(!_0x1062a2[_0x64a0('0x40')][_0x64a0('0x47')]('nolimit')){_0x25afd3['limit']=qs[_0x64a0('0x2f')](_0x1062a2[_0x64a0('0x40')]['limit']);_0x25afd3[_0x64a0('0x31')]=qs['offset'](_0x1062a2[_0x64a0('0x40')]['offset']);}_0x25afd3[_0x64a0('0x48')]=qs[_0x64a0('0x49')](_0x1062a2[_0x64a0('0x40')][_0x64a0('0x49')]);_0x25afd3[_0x64a0('0x4a')]=qs['filters'](_[_0x64a0('0x4b')](_0x1062a2[_0x64a0('0x40')],_0xee6408['filters']),_0x52b5c8);if(_0x1062a2[_0x64a0('0x40')][_0x64a0('0x4c')]){_0x25afd3[_0x64a0('0x4a')]=_[_0x64a0('0x4d')](_0x25afd3[_0x64a0('0x4a')],{'$or':_['map'](_0x52b5c8,function(_0x1b8333){if(_0x1b8333[_0x64a0('0x4e')]!==_0x64a0('0x4f')){var _0x2e00dc={};_0x2e00dc[_0x1b8333[_0x64a0('0x39')]]={'$like':'%'+_0x1062a2[_0x64a0('0x40')]['filter']+'%'};return _0x2e00dc;}})});}_0x25afd3=_[_0x64a0('0x4d')]({},_0x25afd3,_0x1062a2[_0x64a0('0x50')]);var _0x58f268={'where':_0x25afd3[_0x64a0('0x4a')]};return db[_0x64a0('0x3d')][_0x64a0('0x30')](_0x58f268)[_0x64a0('0x36')](function(_0x28df3d){_0x50870b[_0x64a0('0x30')]=_0x28df3d;if(_0x1062a2[_0x64a0('0x40')][_0x64a0('0x51')]){_0x25afd3[_0x64a0('0x52')]=[{'all':!![]}];}return db['Setting'][_0x64a0('0x53')](_0x25afd3);})[_0x64a0('0x36')](function(_0x3d28b2){_0x50870b[_0x64a0('0x54')]=_0x3d28b2;return _0x50870b;})['then'](respondWithFilteredResult(_0x410fec,_0x25afd3))['catch'](handleError(_0x410fec,null));};exports[_0x64a0('0x55')]=function(_0x2afbde,_0x34d943){var _0x1d4156={'raw':![],'where':{'id':_0x2afbde['params']['id']}},_0x58b067={};_0x58b067[_0x64a0('0x3f')]=_[_0x64a0('0x41')](db[_0x64a0('0x3d')][_0x64a0('0x56')]);_0x58b067[_0x64a0('0x40')]=_[_0x64a0('0x41')](_0x2afbde[_0x64a0('0x40')]);_0x58b067[_0x64a0('0x42')]=_[_0x64a0('0x43')](_0x58b067[_0x64a0('0x3f')],_0x58b067[_0x64a0('0x40')]);_0x1d4156[_0x64a0('0x44')]=_['intersection'](_0x58b067['model'],qs[_0x64a0('0x45')](_0x2afbde[_0x64a0('0x40')][_0x64a0('0x45')]));_0x1d4156[_0x64a0('0x44')]=_0x1d4156[_0x64a0('0x44')]['length']?_0x1d4156[_0x64a0('0x44')]:_0x58b067[_0x64a0('0x3f')];if(_0x2afbde[_0x64a0('0x40')][_0x64a0('0x51')]){_0x1d4156[_0x64a0('0x52')]=[{'all':!![]}];}_0x1d4156=_[_0x64a0('0x4d')]({},_0x1d4156,_0x2afbde[_0x64a0('0x50')]);return db[_0x64a0('0x3d')][_0x64a0('0x57')](_0x1d4156)['then'](handleEntityNotFound(_0x34d943,null))[_0x64a0('0x36')](respondWithResult(_0x34d943,null))[_0x64a0('0x2a')](handleError(_0x34d943,null));};exports[_0x64a0('0x35')]=function(_0x3676a5,_0x208220){if(_0x3676a5[_0x64a0('0x58')]['id']){delete _0x3676a5['body']['id'];}return db[_0x64a0('0x3d')][_0x64a0('0x57')]({'where':{'id':_0x3676a5[_0x64a0('0x59')]['id']}})[_0x64a0('0x36')](handleEntityNotFound(_0x208220,null))['then'](saveUpdates(_0x3676a5[_0x64a0('0x58')],null))['then'](respondWithResult(_0x208220,null))[_0x64a0('0x2a')](handleError(_0x208220,null));};exports['addLogo']=function(_0x30cd7c,_0x59ed9c,_0x1f5d37){if(_0x30cd7c[_0x64a0('0x5a')]&&_0x30cd7c[_0x64a0('0x5a')][_0x64a0('0x5b')]){_0x30cd7c[_0x64a0('0x58')][_0x64a0('0x5c')]=_0x30cd7c[_0x64a0('0x5a')][_0x64a0('0x5b')];}return db[_0x64a0('0x3d')][_0x64a0('0x57')]({'where':{'id':_0x30cd7c[_0x64a0('0x59')]['id']}})[_0x64a0('0x36')](handleEntityNotFound(_0x59ed9c,null))[_0x64a0('0x36')](saveUpdates(_0x30cd7c[_0x64a0('0x58')],null))[_0x64a0('0x36')](respondWithResult(_0x59ed9c,null))['catch'](handleError(_0x59ed9c,null));};exports['addLogoLogin']=function(_0x5ce2c9,_0x1c8724,_0x31bcc9){if(_0x5ce2c9[_0x64a0('0x5a')]&&_0x5ce2c9[_0x64a0('0x5a')][_0x64a0('0x5b')]){_0x5ce2c9[_0x64a0('0x58')][_0x64a0('0x5d')]=_0x5ce2c9[_0x64a0('0x5a')][_0x64a0('0x5b')];}return db['Setting'][_0x64a0('0x57')]({'where':{'id':_0x5ce2c9['params']['id']}})[_0x64a0('0x36')](handleEntityNotFound(_0x1c8724,null))[_0x64a0('0x36')](saveUpdates(_0x5ce2c9[_0x64a0('0x58')],null))[_0x64a0('0x36')](respondWithResult(_0x1c8724,null))[_0x64a0('0x2a')](handleError(_0x1c8724,null));};var utilLicense=require('../../config/license/util');exports[_0x64a0('0x5e')]=function(_0xd509c5,_0x4241a1,_0x249f08){var _0x20bde1=_0x64a0('0x5f');var _0x4c0601={'custom':![]};return utilLicense[_0x64a0('0x60')]()['then'](function(_0x45afd7){if(_0x45afd7){_0x4c0601=_0x45afd7;}return db[_0x64a0('0x3d')][_0x64a0('0x57')]({'where':{'id':_0xd509c5['params']['id']},'attributes':[_0x64a0('0x5c'),_0x64a0('0x5d'),_0x64a0('0x61'),'favicon','defaultLogo','defaultLoginLogo',_0x64a0('0x62'),_0x64a0('0x63')],'raw':!![]});})[_0x64a0('0x36')](handleEntityNotFound(_0x4241a1,null))['then'](function(_0x1e1278){if(_0x1e1278){var _0x4eadc6=_0x1e1278[_0x64a0('0x5c')]&&fs[_0x64a0('0x64')](path[_0x64a0('0x65')](config['root'],_0x20bde1,_[_0x64a0('0x66')](_0x1e1278[_0x64a0('0x5c')])))?path[_0x64a0('0x65')](config[_0x64a0('0x67')],_0x20bde1,_[_0x64a0('0x66')](_0x1e1278[_0x64a0('0x5c')])):path[_0x64a0('0x65')](config[_0x64a0('0x67')],_0x20bde1,_[_0x64a0('0x66')](_0x64a0('0x68')));var _0x2cc43f=_0x64a0('0x69')+_[_0x64a0('0x6a')](_0x64a0('0x5c'));if(_0x1e1278[_0x2cc43f]||!_0x4c0601[_0x64a0('0x6b')]){_0x4eadc6=path['join'](config[_0x64a0('0x67')],_0x20bde1,_[_0x64a0('0x66')](_0x64a0('0x68')));}if(!fs[_0x64a0('0x64')](_0x4eadc6)){throw new db[(_0x64a0('0x6c'))][(_0x64a0('0x6d'))](_[_0x64a0('0x6a')]('logo')+_0x64a0('0x6e'));}return _0x4241a1['download'](_0x4eadc6);}})[_0x64a0('0x2a')](handleError(_0x4241a1,null));};var utilLicense=require('../../config/license/util');exports[_0x64a0('0x6f')]=function(_0x3e2744,_0x5c7f7d,_0x4bdf7b){var _0x412a2d=_0x64a0('0x5f');var _0x16edf6={'custom':![]};return utilLicense[_0x64a0('0x60')]()[_0x64a0('0x36')](function(_0x59e568){if(_0x59e568){_0x16edf6=_0x59e568;}return db[_0x64a0('0x3d')][_0x64a0('0x57')]({'where':{'id':_0x3e2744[_0x64a0('0x59')]['id']},'attributes':[_0x64a0('0x5c'),'loginLogo',_0x64a0('0x61'),'favicon',_0x64a0('0x70'),_0x64a0('0x71'),_0x64a0('0x62'),_0x64a0('0x63')],'raw':!![]});})[_0x64a0('0x36')](handleEntityNotFound(_0x5c7f7d,null))[_0x64a0('0x36')](function(_0x296d76){if(_0x296d76){var _0x220af4=_0x296d76[_0x64a0('0x5d')]&&fs[_0x64a0('0x64')](path[_0x64a0('0x65')](config['root'],_0x412a2d,_['toLower'](_0x296d76['loginLogo'])))?path[_0x64a0('0x65')](config[_0x64a0('0x67')],_0x412a2d,_[_0x64a0('0x66')](_0x296d76[_0x64a0('0x5d')])):path[_0x64a0('0x65')](config['root'],_0x412a2d,_['toLower']('default_loginLogo.svg'));var _0x1f6a34=_0x64a0('0x69')+_[_0x64a0('0x6a')](_0x64a0('0x5d'));if(_0x296d76[_0x1f6a34]||!_0x16edf6['custom']){_0x220af4=path['join'](config[_0x64a0('0x67')],_0x412a2d,_[_0x64a0('0x66')](_0x64a0('0x72')));}if(!fs['existsSync'](_0x220af4)){throw new db['Sequelize'][(_0x64a0('0x6d'))](_['upperFirst'](_0x64a0('0x5d'))+_0x64a0('0x6e'));}return _0x5c7f7d[_0x64a0('0x73')](_0x220af4);}})[_0x64a0('0x2a')](handleError(_0x5c7f7d,null));};exports[_0x64a0('0x74')]=function(_0x58b71c,_0x40d84b){return db[_0x64a0('0x3d')]['find']({'where':{'id':_0x58b71c[_0x64a0('0x59')]['id']},'attributes':[_0x64a0('0x75')]})[_0x64a0('0x36')](respondWithResult(_0x40d84b,null))[_0x64a0('0x2a')](handleError(_0x40d84b,null));};exports[_0x64a0('0x76')]=function(_0x3d969e,_0x4f9cb5,_0x485a91){if(_0x3d969e['file']&&_0x3d969e[_0x64a0('0x5a')][_0x64a0('0x5b')]){_0x3d969e['body'][_0x64a0('0x61')]=_0x3d969e[_0x64a0('0x5a')][_0x64a0('0x5b')];}return db['Setting'][_0x64a0('0x57')]({'where':{'id':_0x3d969e[_0x64a0('0x59')]['id']}})['then'](handleEntityNotFound(_0x4f9cb5,null))[_0x64a0('0x36')](saveUpdates(_0x3d969e[_0x64a0('0x58')],null))[_0x64a0('0x36')](respondWithResult(_0x4f9cb5,null))[_0x64a0('0x2a')](handleError(_0x4f9cb5,null));};var utilLicense=require(_0x64a0('0x1b'));exports[_0x64a0('0x77')]=function(_0x385b71,_0x51aee6,_0x2725cf){var _0x48d361=_0x64a0('0x5f');var _0x32c17e={'custom':![]};return utilLicense[_0x64a0('0x60')]()['then'](function(_0x11da62){if(_0x11da62){_0x32c17e=_0x11da62;}return db[_0x64a0('0x3d')][_0x64a0('0x57')]({'where':{'id':_0x385b71['params']['id']},'attributes':[_0x64a0('0x5c'),'loginLogo','preferred',_0x64a0('0x78'),_0x64a0('0x70'),'defaultLoginLogo','defaultPreferred',_0x64a0('0x63')],'raw':!![]});})[_0x64a0('0x36')](handleEntityNotFound(_0x51aee6,null))[_0x64a0('0x36')](function(_0x3052ef){if(_0x3052ef){var _0x555ff5=_0x3052ef[_0x64a0('0x61')]&&fs[_0x64a0('0x64')](path[_0x64a0('0x65')](config[_0x64a0('0x67')],_0x48d361,_[_0x64a0('0x66')](_0x3052ef['preferred'])))?path[_0x64a0('0x65')](config[_0x64a0('0x67')],_0x48d361,_['toLower'](_0x3052ef[_0x64a0('0x61')])):path[_0x64a0('0x65')](config['root'],_0x48d361,_['toLower'](_0x64a0('0x79')));var _0x34068d=_0x64a0('0x69')+_[_0x64a0('0x6a')](_0x64a0('0x61'));if(_0x3052ef[_0x34068d]||!_0x32c17e[_0x64a0('0x6b')]||!_0x32c17e[_0x64a0('0x61')]){_0x555ff5=path[_0x64a0('0x65')](config[_0x64a0('0x67')],_0x48d361,_[_0x64a0('0x66')](_0x64a0('0x79')));}if(!fs[_0x64a0('0x64')](_0x555ff5)){throw new db[(_0x64a0('0x6c'))]['ValidationError'](_[_0x64a0('0x6a')]('preferred')+_0x64a0('0x6e'));}return _0x51aee6[_0x64a0('0x73')](_0x555ff5);}})[_0x64a0('0x2a')](handleError(_0x51aee6,null));};exports['addFavicon']=function(_0x2d83ec,_0x3cad9d,_0x5117fb){if(_0x2d83ec[_0x64a0('0x5a')]&&_0x2d83ec[_0x64a0('0x5a')][_0x64a0('0x5b')]){_0x2d83ec[_0x64a0('0x58')][_0x64a0('0x78')]=_0x2d83ec[_0x64a0('0x5a')][_0x64a0('0x5b')];}return db[_0x64a0('0x3d')]['find']({'where':{'id':_0x2d83ec[_0x64a0('0x59')]['id']}})['then'](handleEntityNotFound(_0x3cad9d,null))[_0x64a0('0x36')](saveUpdates(_0x2d83ec[_0x64a0('0x58')],null))['then'](respondWithResult(_0x3cad9d,null))[_0x64a0('0x2a')](handleError(_0x3cad9d,null));};var utilLicense=require('../../config/license/util');exports[_0x64a0('0x7a')]=function(_0xb9ef35,_0x1741e3,_0x1b1774){var _0x47c36d=_0x64a0('0x5f');var _0x2f9a0d={'custom':![]};return utilLicense[_0x64a0('0x60')]()[_0x64a0('0x36')](function(_0x2a290a){if(_0x2a290a){_0x2f9a0d=_0x2a290a;}return db[_0x64a0('0x3d')][_0x64a0('0x57')]({'where':{'id':_0xb9ef35[_0x64a0('0x59')]['id']},'attributes':['logo','loginLogo',_0x64a0('0x61'),_0x64a0('0x78'),'defaultLogo','defaultLoginLogo',_0x64a0('0x62'),_0x64a0('0x63')],'raw':!![]});})[_0x64a0('0x36')](handleEntityNotFound(_0x1741e3,null))['then'](function(_0x14900a){if(_0x14900a){var _0x4d64e9=_0x14900a[_0x64a0('0x78')]&&fs[_0x64a0('0x64')](path['join'](config['root'],_0x47c36d,_[_0x64a0('0x66')](_0x14900a[_0x64a0('0x78')])))?path[_0x64a0('0x65')](config['root'],_0x47c36d,_[_0x64a0('0x66')](_0x14900a['favicon'])):path[_0x64a0('0x65')](config[_0x64a0('0x67')],_0x47c36d,_[_0x64a0('0x66')](_0x64a0('0x7b')));var _0x1f0f9c=_0x64a0('0x69')+_[_0x64a0('0x6a')](_0x64a0('0x78'));if(_0x14900a[_0x1f0f9c]||!_0x2f9a0d[_0x64a0('0x6b')]){_0x4d64e9=path[_0x64a0('0x65')](config[_0x64a0('0x67')],_0x47c36d,_[_0x64a0('0x66')]('default_favicon.ico'));}if(!fs[_0x64a0('0x64')](_0x4d64e9)){throw new db[(_0x64a0('0x6c'))][(_0x64a0('0x6d'))](_['upperFirst'](_0x64a0('0x78'))+_0x64a0('0x6e'));}return _0x1741e3[_0x64a0('0x73')](_0x4d64e9);}})[_0x64a0('0x2a')](handleError(_0x1741e3,null));};exports['getDate']=function(_0x264064,_0x2bb78e){var _0x156aa4={'offset':moment()['utcOffset']()};_0x156aa4[_0x64a0('0x7c')]=moment()[_0x64a0('0x7d')](_0x156aa4[_0x64a0('0x31')])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x2bb78e[_0x64a0('0x2c')](0xc8)[_0x64a0('0x3a')](_0x156aa4);}; \ No newline at end of file +var _0x5c88=['end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Setting','includeAll','include','rows','catch','show','params','options','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultPreferred','join','root','toLower','default_logo.svg','default','custom','Sequelize','ValidationError','upperFirst','download','getLogoLogin','defaultLoginLogo','defaultFavicon','existsSync','default_loginLogo.svg','\x20not\x20found','securePassword','addPreferred','preferred','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Setting,\x20%s,\x20%s','info'];(function(_0x2cc806,_0x50b4ed){var _0x39aa0a=function(_0x587666){while(--_0x587666){_0x2cc806['push'](_0x2cc806['shift']());}};_0x39aa0a(++_0x50b4ed);}(_0x5c88,0x158));var _0x85c8=function(_0xa6209,_0x13d19a){_0xa6209=_0xa6209-0x0;var _0x5717ef=_0x5c88[_0xa6209];return _0x5717ef;};'use strict';var emlformat=require(_0x85c8('0x0'));var rimraf=require(_0x85c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x85c8('0x2'));var rp=require(_0x85c8('0x3'));var moment=require(_0x85c8('0x4'));var BPromise=require(_0x85c8('0x5'));var Mustache=require(_0x85c8('0x6'));var util=require(_0x85c8('0x7'));var path=require(_0x85c8('0x8'));var sox=require('sox');var csv=require(_0x85c8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x85c8('0xa'));var _=require(_0x85c8('0xb'));var squel=require(_0x85c8('0xc'));var crypto=require(_0x85c8('0xd'));var jsforce=require(_0x85c8('0xe'));var deskjs=require(_0x85c8('0xf'));var toCsv=require(_0x85c8('0x9'));var querystring=require('querystring');var Papa=require(_0x85c8('0x10'));var Redis=require(_0x85c8('0x11'));var authService=require(_0x85c8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x85c8('0x13'));var logger=require(_0x85c8('0x14'))(_0x85c8('0x15'));var utils=require(_0x85c8('0x16'));var config=require(_0x85c8('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x85c8('0x18'));var client=jayson['client'][_0x85c8('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x59a1d3,_0x342293,_0x358dd2,_0x480662){return new BPromise(function(_0x45b83f,_0x2cc2c5){var _0x837683=_0x480662||client;return _0x837683[_0x85c8('0x1a')](_0x59a1d3,_0x358dd2)[_0x85c8('0x1b')](function(_0x85fd30){logger['info']('Setting,\x20%s,\x20%s',_0x342293,_0x85c8('0x1c'));logger[_0x85c8('0x1d')](_0x85c8('0x1e'),_0x342293,_0x85c8('0x1c'),JSON[_0x85c8('0x1f')](_0x85fd30));if(_0x85fd30[_0x85c8('0x20')]){if(_0x85fd30[_0x85c8('0x20')][_0x85c8('0x21')]===0x1f4){logger[_0x85c8('0x20')]('Setting,\x20%s,\x20%s',_0x342293,_0x85fd30[_0x85c8('0x20')]['message']);return _0x2cc2c5(_0x85fd30[_0x85c8('0x20')][_0x85c8('0x22')]);}logger[_0x85c8('0x20')](_0x85c8('0x23'),_0x342293,_0x85fd30[_0x85c8('0x20')][_0x85c8('0x22')]);return _0x45b83f(_0x85fd30[_0x85c8('0x20')][_0x85c8('0x22')]);}else{logger[_0x85c8('0x24')](_0x85c8('0x23'),_0x342293,'request\x20sent');_0x45b83f(_0x85fd30['result'][_0x85c8('0x22')]);}})['catch'](function(_0x44049b){logger[_0x85c8('0x20')]('Setting,\x20%s,\x20%s',_0x342293,_0x44049b);_0x2cc2c5(_0x44049b);});});}function respondWithStatusCode(_0x45357b,_0x2d9f5d){_0x2d9f5d=_0x2d9f5d||0xcc;return function(_0x39c28c){if(_0x39c28c){return _0x45357b['sendStatus'](_0x2d9f5d);}return _0x45357b['status'](_0x2d9f5d)[_0x85c8('0x25')]();};}function respondWithResult(_0x4dbc0f,_0x4a4cef){_0x4a4cef=_0x4a4cef||0xc8;return function(_0x230daf){if(_0x230daf){return _0x4dbc0f[_0x85c8('0x26')](_0x4a4cef)[_0x85c8('0x27')](_0x230daf);}};}function respondWithFilteredResult(_0x5a5e3f,_0x82112d){return function(_0x1bec22){if(_0x1bec22){var _0xef6131=typeof _0x82112d[_0x85c8('0x28')]===_0x85c8('0x29')&&typeof _0x82112d[_0x85c8('0x2a')]==='undefined';var _0x1fc87b=_0x1bec22[_0x85c8('0x2b')];var _0x443487=_0xef6131?0x0:_0x82112d[_0x85c8('0x28')];var _0x420168=_0xef6131?_0x1bec22[_0x85c8('0x2b')]:_0x82112d[_0x85c8('0x28')]+_0x82112d[_0x85c8('0x2a')];var _0x5e7ace;if(_0x420168>=_0x1fc87b){_0x420168=_0x1fc87b;_0x5e7ace=0xc8;}else{_0x5e7ace=0xce;}_0x5a5e3f[_0x85c8('0x26')](_0x5e7ace);return _0x5a5e3f[_0x85c8('0x2c')](_0x85c8('0x2d'),_0x443487+'-'+_0x420168+'/'+_0x1fc87b)[_0x85c8('0x27')](_0x1bec22);}return null;};}function patchUpdates(_0x48b467){return function(_0x217208){try{jsonpatch[_0x85c8('0x2e')](_0x217208,_0x48b467,!![]);}catch(_0x516259){return BPromise[_0x85c8('0x2f')](_0x516259);}return _0x217208[_0x85c8('0x30')]();};}function saveUpdates(_0x569730,_0x33a19e){return function(_0x2ea875){if(_0x2ea875){return _0x2ea875['update'](_0x569730)['then'](function(_0x489039){return _0x489039;});}return null;};}function removeEntity(_0x9fbddb,_0x594a1c){return function(_0x14ae7d){if(_0x14ae7d){return _0x14ae7d[_0x85c8('0x31')]()[_0x85c8('0x1b')](function(){_0x9fbddb[_0x85c8('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x516daf,_0xd36e21){return function(_0x3619ff){if(!_0x3619ff){_0x516daf[_0x85c8('0x32')](0x194);}return _0x3619ff;};}function handleError(_0x121b93,_0x26130f){_0x26130f=_0x26130f||0x1f4;return function(_0x46966c){logger['error'](_0x46966c[_0x85c8('0x33')]);if(_0x46966c[_0x85c8('0x34')]){delete _0x46966c['name'];}_0x121b93[_0x85c8('0x26')](_0x26130f)[_0x85c8('0x35')](_0x46966c);};}exports[_0x85c8('0x36')]=function(_0x3ab238,_0xc931d4){var _0x23ed0e={},_0x39aaa7={},_0x14f504={'count':0x0,'rows':[]};var _0xd921e9=_[_0x85c8('0x37')](db['Setting'][_0x85c8('0x38')],function(_0x5296a9){return{'name':_0x5296a9[_0x85c8('0x39')],'type':_0x5296a9[_0x85c8('0x3a')][_0x85c8('0x3b')]};});_0x39aaa7[_0x85c8('0x3c')]=_['map'](_0xd921e9,'name');_0x39aaa7[_0x85c8('0x3d')]=_[_0x85c8('0x3e')](_0x3ab238[_0x85c8('0x3d')]);_0x39aaa7[_0x85c8('0x3f')]=_[_0x85c8('0x40')](_0x39aaa7[_0x85c8('0x3c')],_0x39aaa7[_0x85c8('0x3d')]);_0x23ed0e[_0x85c8('0x41')]=_[_0x85c8('0x40')](_0x39aaa7['model'],qs[_0x85c8('0x42')](_0x3ab238[_0x85c8('0x3d')][_0x85c8('0x42')]));_0x23ed0e['attributes']=_0x23ed0e['attributes'][_0x85c8('0x43')]?_0x23ed0e[_0x85c8('0x41')]:_0x39aaa7[_0x85c8('0x3c')];if(!_0x3ab238[_0x85c8('0x3d')][_0x85c8('0x44')](_0x85c8('0x45'))){_0x23ed0e[_0x85c8('0x2a')]=qs['limit'](_0x3ab238[_0x85c8('0x3d')]['limit']);_0x23ed0e[_0x85c8('0x28')]=qs[_0x85c8('0x28')](_0x3ab238[_0x85c8('0x3d')][_0x85c8('0x28')]);}_0x23ed0e[_0x85c8('0x46')]=qs[_0x85c8('0x47')](_0x3ab238[_0x85c8('0x3d')][_0x85c8('0x47')]);_0x23ed0e[_0x85c8('0x48')]=qs[_0x85c8('0x3f')](_[_0x85c8('0x49')](_0x3ab238['query'],_0x39aaa7[_0x85c8('0x3f')]),_0xd921e9);if(_0x3ab238['query'][_0x85c8('0x4a')]){_0x23ed0e[_0x85c8('0x48')]=_[_0x85c8('0x4b')](_0x23ed0e[_0x85c8('0x48')],{'$or':_[_0x85c8('0x37')](_0xd921e9,function(_0x4aad33){if(_0x4aad33[_0x85c8('0x3a')]!==_0x85c8('0x4c')){var _0x396e98={};_0x396e98[_0x4aad33[_0x85c8('0x34')]]={'$like':'%'+_0x3ab238[_0x85c8('0x3d')][_0x85c8('0x4a')]+'%'};return _0x396e98;}})});}_0x23ed0e=_[_0x85c8('0x4b')]({},_0x23ed0e,_0x3ab238['options']);var _0x5174e6={'where':_0x23ed0e[_0x85c8('0x48')]};return db[_0x85c8('0x4d')][_0x85c8('0x2b')](_0x5174e6)['then'](function(_0xb3d906){_0x14f504[_0x85c8('0x2b')]=_0xb3d906;if(_0x3ab238['query'][_0x85c8('0x4e')]){_0x23ed0e[_0x85c8('0x4f')]=[{'all':!![]}];}return db[_0x85c8('0x4d')]['findAll'](_0x23ed0e);})[_0x85c8('0x1b')](function(_0xdf6d69){_0x14f504[_0x85c8('0x50')]=_0xdf6d69;return _0x14f504;})[_0x85c8('0x1b')](respondWithFilteredResult(_0xc931d4,_0x23ed0e))[_0x85c8('0x51')](handleError(_0xc931d4,null));};exports[_0x85c8('0x52')]=function(_0x47cfe0,_0x2dda89){var _0xc3c9ad={'raw':![],'where':{'id':_0x47cfe0[_0x85c8('0x53')]['id']}},_0x59413e={};_0x59413e['model']=_['keys'](db[_0x85c8('0x4d')]['rawAttributes']);_0x59413e[_0x85c8('0x3d')]=_[_0x85c8('0x3e')](_0x47cfe0[_0x85c8('0x3d')]);_0x59413e[_0x85c8('0x3f')]=_[_0x85c8('0x40')](_0x59413e[_0x85c8('0x3c')],_0x59413e[_0x85c8('0x3d')]);_0xc3c9ad[_0x85c8('0x41')]=_['intersection'](_0x59413e[_0x85c8('0x3c')],qs[_0x85c8('0x42')](_0x47cfe0[_0x85c8('0x3d')][_0x85c8('0x42')]));_0xc3c9ad['attributes']=_0xc3c9ad[_0x85c8('0x41')][_0x85c8('0x43')]?_0xc3c9ad[_0x85c8('0x41')]:_0x59413e[_0x85c8('0x3c')];if(_0x47cfe0['query'][_0x85c8('0x4e')]){_0xc3c9ad[_0x85c8('0x4f')]=[{'all':!![]}];}_0xc3c9ad=_[_0x85c8('0x4b')]({},_0xc3c9ad,_0x47cfe0[_0x85c8('0x54')]);return db[_0x85c8('0x4d')][_0x85c8('0x55')](_0xc3c9ad)[_0x85c8('0x1b')](handleEntityNotFound(_0x2dda89,null))[_0x85c8('0x1b')](respondWithResult(_0x2dda89,null))['catch'](handleError(_0x2dda89,null));};exports['update']=function(_0x1fbc4e,_0x3788c9){if(_0x1fbc4e[_0x85c8('0x56')]['id']){delete _0x1fbc4e['body']['id'];}return db[_0x85c8('0x4d')][_0x85c8('0x55')]({'where':{'id':_0x1fbc4e['params']['id']}})[_0x85c8('0x1b')](handleEntityNotFound(_0x3788c9,null))['then'](saveUpdates(_0x1fbc4e[_0x85c8('0x56')],null))[_0x85c8('0x1b')](respondWithResult(_0x3788c9,null))[_0x85c8('0x51')](handleError(_0x3788c9,null));};exports[_0x85c8('0x57')]=function(_0x1c0a31,_0x404693,_0x388bd5){if(_0x1c0a31['file']&&_0x1c0a31[_0x85c8('0x58')][_0x85c8('0x59')]){_0x1c0a31[_0x85c8('0x56')][_0x85c8('0x5a')]=_0x1c0a31[_0x85c8('0x58')]['filename'];}return db[_0x85c8('0x4d')]['find']({'where':{'id':_0x1c0a31[_0x85c8('0x53')]['id']}})[_0x85c8('0x1b')](handleEntityNotFound(_0x404693,null))[_0x85c8('0x1b')](saveUpdates(_0x1c0a31[_0x85c8('0x56')],null))[_0x85c8('0x1b')](respondWithResult(_0x404693,null))[_0x85c8('0x51')](handleError(_0x404693,null));};exports[_0x85c8('0x5b')]=function(_0x879641,_0xfdb6d,_0x551e42){if(_0x879641[_0x85c8('0x58')]&&_0x879641['file'][_0x85c8('0x59')]){_0x879641[_0x85c8('0x56')][_0x85c8('0x5c')]=_0x879641['file'][_0x85c8('0x59')];}return db['Setting'][_0x85c8('0x55')]({'where':{'id':_0x879641[_0x85c8('0x53')]['id']}})['then'](handleEntityNotFound(_0xfdb6d,null))[_0x85c8('0x1b')](saveUpdates(_0x879641['body'],null))[_0x85c8('0x1b')](respondWithResult(_0xfdb6d,null))['catch'](handleError(_0xfdb6d,null));};var utilLicense=require(_0x85c8('0x5d'));exports[_0x85c8('0x5e')]=function(_0x159154,_0x22cf37,_0xa79fa3){var _0x4b1efb=_0x85c8('0x5f');var _0x43e42a={'custom':![]};return utilLicense[_0x85c8('0x60')]()[_0x85c8('0x1b')](function(_0x1b46e0){if(_0x1b46e0){_0x43e42a=_0x1b46e0;}return db[_0x85c8('0x4d')][_0x85c8('0x55')]({'where':{'id':_0x159154[_0x85c8('0x53')]['id']},'attributes':[_0x85c8('0x5a'),'loginLogo','preferred',_0x85c8('0x61'),_0x85c8('0x62'),'defaultLoginLogo',_0x85c8('0x63'),'defaultFavicon'],'raw':!![]});})[_0x85c8('0x1b')](handleEntityNotFound(_0x22cf37,null))[_0x85c8('0x1b')](function(_0x2355eb){if(_0x2355eb){var _0x4c7965=_0x2355eb[_0x85c8('0x5a')]&&fs['existsSync'](path[_0x85c8('0x64')](config[_0x85c8('0x65')],_0x4b1efb,_[_0x85c8('0x66')](_0x2355eb[_0x85c8('0x5a')])))?path[_0x85c8('0x64')](config['root'],_0x4b1efb,_[_0x85c8('0x66')](_0x2355eb[_0x85c8('0x5a')])):path[_0x85c8('0x64')](config['root'],_0x4b1efb,_['toLower'](_0x85c8('0x67')));var _0x1caa82=_0x85c8('0x68')+_['upperFirst'](_0x85c8('0x5a'));if(_0x2355eb[_0x1caa82]||!_0x43e42a[_0x85c8('0x69')]){_0x4c7965=path[_0x85c8('0x64')](config[_0x85c8('0x65')],_0x4b1efb,_[_0x85c8('0x66')](_0x85c8('0x67')));}if(!fs['existsSync'](_0x4c7965)){throw new db[(_0x85c8('0x6a'))][(_0x85c8('0x6b'))](_[_0x85c8('0x6c')](_0x85c8('0x5a'))+'\x20not\x20found');}return _0x22cf37[_0x85c8('0x6d')](_0x4c7965);}})['catch'](handleError(_0x22cf37,null));};var utilLicense=require(_0x85c8('0x5d'));exports[_0x85c8('0x6e')]=function(_0x4f766d,_0x1f34d8,_0x37ce79){var _0x23091c='server/files/images/logos';var _0x39ae24={'custom':![]};return utilLicense[_0x85c8('0x60')]()[_0x85c8('0x1b')](function(_0x212acf){if(_0x212acf){_0x39ae24=_0x212acf;}return db[_0x85c8('0x4d')][_0x85c8('0x55')]({'where':{'id':_0x4f766d['params']['id']},'attributes':['logo',_0x85c8('0x5c'),'preferred',_0x85c8('0x61'),_0x85c8('0x62'),_0x85c8('0x6f'),'defaultPreferred',_0x85c8('0x70')],'raw':!![]});})[_0x85c8('0x1b')](handleEntityNotFound(_0x1f34d8,null))[_0x85c8('0x1b')](function(_0x4ce349){if(_0x4ce349){var _0x4057c0=_0x4ce349[_0x85c8('0x5c')]&&fs[_0x85c8('0x71')](path[_0x85c8('0x64')](config[_0x85c8('0x65')],_0x23091c,_[_0x85c8('0x66')](_0x4ce349[_0x85c8('0x5c')])))?path[_0x85c8('0x64')](config['root'],_0x23091c,_[_0x85c8('0x66')](_0x4ce349[_0x85c8('0x5c')])):path[_0x85c8('0x64')](config[_0x85c8('0x65')],_0x23091c,_[_0x85c8('0x66')](_0x85c8('0x72')));var _0x268ce5=_0x85c8('0x68')+_['upperFirst'](_0x85c8('0x5c'));if(_0x4ce349[_0x268ce5]||!_0x39ae24[_0x85c8('0x69')]){_0x4057c0=path[_0x85c8('0x64')](config['root'],_0x23091c,_[_0x85c8('0x66')](_0x85c8('0x72')));}if(!fs['existsSync'](_0x4057c0)){throw new db[(_0x85c8('0x6a'))]['ValidationError'](_['upperFirst'](_0x85c8('0x5c'))+_0x85c8('0x73'));}return _0x1f34d8[_0x85c8('0x6d')](_0x4057c0);}})[_0x85c8('0x51')](handleError(_0x1f34d8,null));};exports['gdpr']=function(_0x4d9a5e,_0x51d788){return db[_0x85c8('0x4d')][_0x85c8('0x55')]({'where':{'id':_0x4d9a5e[_0x85c8('0x53')]['id']},'attributes':[_0x85c8('0x74')]})['then'](respondWithResult(_0x51d788,null))[_0x85c8('0x51')](handleError(_0x51d788,null));};exports[_0x85c8('0x75')]=function(_0x31d5dc,_0x38d240,_0x43c836){if(_0x31d5dc[_0x85c8('0x58')]&&_0x31d5dc[_0x85c8('0x58')]['filename']){_0x31d5dc['body'][_0x85c8('0x76')]=_0x31d5dc[_0x85c8('0x58')][_0x85c8('0x59')];}return db['Setting'][_0x85c8('0x55')]({'where':{'id':_0x31d5dc[_0x85c8('0x53')]['id']}})[_0x85c8('0x1b')](handleEntityNotFound(_0x38d240,null))['then'](saveUpdates(_0x31d5dc['body'],null))[_0x85c8('0x1b')](respondWithResult(_0x38d240,null))[_0x85c8('0x51')](handleError(_0x38d240,null));};var utilLicense=require(_0x85c8('0x5d'));exports[_0x85c8('0x77')]=function(_0x332998,_0xb6f546,_0x5ed564){var _0x649d=_0x85c8('0x5f');var _0x23eac4={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x412e0e){if(_0x412e0e){_0x23eac4=_0x412e0e;}return db[_0x85c8('0x4d')][_0x85c8('0x55')]({'where':{'id':_0x332998[_0x85c8('0x53')]['id']},'attributes':['logo','loginLogo',_0x85c8('0x76'),'favicon',_0x85c8('0x62'),_0x85c8('0x6f'),_0x85c8('0x63'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0xb6f546,null))[_0x85c8('0x1b')](function(_0x2e80ad){if(_0x2e80ad){var _0x259446=_0x2e80ad[_0x85c8('0x76')]&&fs['existsSync'](path[_0x85c8('0x64')](config[_0x85c8('0x65')],_0x649d,_[_0x85c8('0x66')](_0x2e80ad[_0x85c8('0x76')])))?path[_0x85c8('0x64')](config[_0x85c8('0x65')],_0x649d,_[_0x85c8('0x66')](_0x2e80ad[_0x85c8('0x76')])):path['join'](config[_0x85c8('0x65')],_0x649d,_['toLower'](_0x85c8('0x78')));var _0x2b6d91=_0x85c8('0x68')+_[_0x85c8('0x6c')]('preferred');if(_0x2e80ad[_0x2b6d91]||!_0x23eac4['custom']||!_0x23eac4[_0x85c8('0x76')]){_0x259446=path['join'](config['root'],_0x649d,_[_0x85c8('0x66')](_0x85c8('0x78')));}if(!fs['existsSync'](_0x259446)){throw new db[(_0x85c8('0x6a'))]['ValidationError'](_[_0x85c8('0x6c')](_0x85c8('0x76'))+_0x85c8('0x73'));}return _0xb6f546[_0x85c8('0x6d')](_0x259446);}})[_0x85c8('0x51')](handleError(_0xb6f546,null));};exports['addFavicon']=function(_0x54cfc6,_0x23d610,_0x71e68c){if(_0x54cfc6[_0x85c8('0x58')]&&_0x54cfc6[_0x85c8('0x58')]['filename']){_0x54cfc6['body'][_0x85c8('0x61')]=_0x54cfc6[_0x85c8('0x58')][_0x85c8('0x59')];}return db[_0x85c8('0x4d')][_0x85c8('0x55')]({'where':{'id':_0x54cfc6[_0x85c8('0x53')]['id']}})['then'](handleEntityNotFound(_0x23d610,null))[_0x85c8('0x1b')](saveUpdates(_0x54cfc6[_0x85c8('0x56')],null))[_0x85c8('0x1b')](respondWithResult(_0x23d610,null))[_0x85c8('0x51')](handleError(_0x23d610,null));};var utilLicense=require(_0x85c8('0x5d'));exports[_0x85c8('0x79')]=function(_0x3a28ba,_0x540f27,_0x43498f){var _0x261e7a=_0x85c8('0x5f');var _0x506eb2={'custom':![]};return utilLicense[_0x85c8('0x60')]()[_0x85c8('0x1b')](function(_0x4ff943){if(_0x4ff943){_0x506eb2=_0x4ff943;}return db[_0x85c8('0x4d')][_0x85c8('0x55')]({'where':{'id':_0x3a28ba[_0x85c8('0x53')]['id']},'attributes':[_0x85c8('0x5a'),_0x85c8('0x5c'),_0x85c8('0x76'),_0x85c8('0x61'),'defaultLogo',_0x85c8('0x6f'),_0x85c8('0x63'),_0x85c8('0x70')],'raw':!![]});})[_0x85c8('0x1b')](handleEntityNotFound(_0x540f27,null))['then'](function(_0x3af171){if(_0x3af171){var _0x1b3c4f=_0x3af171['favicon']&&fs['existsSync'](path[_0x85c8('0x64')](config[_0x85c8('0x65')],_0x261e7a,_[_0x85c8('0x66')](_0x3af171[_0x85c8('0x61')])))?path[_0x85c8('0x64')](config[_0x85c8('0x65')],_0x261e7a,_[_0x85c8('0x66')](_0x3af171['favicon'])):path['join'](config[_0x85c8('0x65')],_0x261e7a,_[_0x85c8('0x66')](_0x85c8('0x7a')));var _0x237a20=_0x85c8('0x68')+_[_0x85c8('0x6c')](_0x85c8('0x61'));if(_0x3af171[_0x237a20]||!_0x506eb2[_0x85c8('0x69')]){_0x1b3c4f=path[_0x85c8('0x64')](config[_0x85c8('0x65')],_0x261e7a,_['toLower'](_0x85c8('0x7a')));}if(!fs[_0x85c8('0x71')](_0x1b3c4f)){throw new db[(_0x85c8('0x6a'))][(_0x85c8('0x6b'))](_[_0x85c8('0x6c')](_0x85c8('0x61'))+_0x85c8('0x73'));}return _0x540f27[_0x85c8('0x6d')](_0x1b3c4f);}})['catch'](handleError(_0x540f27,null));};exports['getDate']=function(_0x2fae4c,_0x79dc17){var _0x2ce035={'offset':moment()[_0x85c8('0x7b')]()};_0x2ce035[_0x85c8('0x7c')]=moment()[_0x85c8('0x7b')](_0x2ce035[_0x85c8('0x28')])[_0x85c8('0x7d')](_0x85c8('0x7e'));return _0x79dc17['status'](0xc8)[_0x85c8('0x35')](_0x2ce035);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index a9d8bcf..f0fe587 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 _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0x7217,0x19e));var _0x7721=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x7217[_0x220dbb];return _0x2b77de;};'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 _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0x7217,0x19e));var _0x7721=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x7217[_0x25bea7];return _0x175952;};'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 diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index b62662c..81624cc 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 _0x641e=['catch','find','options','where','attributes','map','include','model','then','ShowSetting','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result'];(function(_0x4d1f66,_0x3af73b){var _0x27269e=function(_0x48e5c2){while(--_0x48e5c2){_0x4d1f66['push'](_0x4d1f66['shift']());}};_0x27269e(++_0x3af73b);}(_0x641e,0xaa));var _0xe641=function(_0x55d016,_0x30fdcf){_0x55d016=_0x55d016-0x0;var _0x57cdc5=_0x641e[_0x55d016];return _0x57cdc5;};'use strict';var _=require('lodash');var util=require(_0xe641('0x0'));var moment=require(_0xe641('0x1'));var BPromise=require(_0xe641('0x2'));var rs=require(_0xe641('0x3'));var fs=require('fs');var Redis=require(_0xe641('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe641('0x5'));var logger=require(_0xe641('0x6'))(_0xe641('0x7'));var config=require(_0xe641('0x8'));var jayson=require(_0xe641('0x9'));var client=jayson[_0xe641('0xa')][_0xe641('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3849a1,_0x332f86,_0x252a42){return new BPromise(function(_0x38a062,_0x3d2320){return client['request'](_0x3849a1,_0x252a42)['then'](function(_0xbe3b18){logger[_0xe641('0xc')]('Setting,\x20%s,\x20%s',_0x332f86,_0xe641('0xd'));logger[_0xe641('0xe')](_0xe641('0xf'),_0x332f86,_0xe641('0xd'),JSON[_0xe641('0x10')](_0xbe3b18));if(_0xbe3b18['error']){if(_0xbe3b18[_0xe641('0x11')][_0xe641('0x12')]===0x1f4){logger['error'](_0xe641('0x13'),_0x332f86,_0xbe3b18[_0xe641('0x11')]['message']);return _0x3d2320(_0xbe3b18[_0xe641('0x11')]['message']);}logger[_0xe641('0x11')]('Setting,\x20%s,\x20%s',_0x332f86,_0xbe3b18[_0xe641('0x11')][_0xe641('0x14')]);return _0x38a062(_0xbe3b18[_0xe641('0x11')][_0xe641('0x14')]);}else{logger[_0xe641('0xc')](_0xe641('0x13'),_0x332f86,_0xe641('0xd'));_0x38a062(_0xbe3b18[_0xe641('0x15')][_0xe641('0x14')]);}})[_0xe641('0x16')](function(_0x48165c){logger[_0xe641('0x11')]('Setting,\x20%s,\x20%s',_0x332f86,_0x48165c);_0x3d2320(_0x48165c);});});}exports['ShowSetting']=function(_0x171c66){var _0x5eb260=this;return new Promise(function(_0x56431c,_0x3fc066){return db['Setting'][_0xe641('0x17')]({'raw':_0x171c66['options']?_0x171c66[_0xe641('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x171c66[_0xe641('0x18')]?_0x171c66[_0xe641('0x18')][_0xe641('0x19')]||null:null,'attributes':_0x171c66[_0xe641('0x18')]?_0x171c66[_0xe641('0x18')][_0xe641('0x1a')]||null:null,'include':_0x171c66[_0xe641('0x18')]?_0x171c66['options']['include']?_[_0xe641('0x1b')](_0x171c66['options'][_0xe641('0x1c')],function(_0x9dad9c){return{'model':db[_0x9dad9c[_0xe641('0x1d')]],'as':_0x9dad9c['as'],'attributes':_0x9dad9c[_0xe641('0x1a')],'include':_0x9dad9c[_0xe641('0x1c')]?_[_0xe641('0x1b')](_0x9dad9c[_0xe641('0x1c')],function(_0x17e0f9){return{'model':db[_0x17e0f9[_0xe641('0x1d')]],'as':_0x17e0f9['as'],'attributes':_0x17e0f9[_0xe641('0x1a')],'include':_0x17e0f9[_0xe641('0x1c')]?_[_0xe641('0x1b')](_0x17e0f9[_0xe641('0x1c')],function(_0x1a2d9d){return{'model':db[_0x1a2d9d['model']],'as':_0x1a2d9d['as'],'attributes':_0x1a2d9d[_0xe641('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe641('0x1e')](function(_0x4b6f75){logger[_0xe641('0xc')]('ShowSetting',_0x171c66);logger[_0xe641('0xe')]('ShowSetting',_0x171c66,JSON[_0xe641('0x10')](_0x4b6f75));_0x56431c(_0x4b6f75);})['catch'](function(_0x5b5592){logger[_0xe641('0x11')](_0xe641('0x1f'),_0x5b5592[_0xe641('0x14')],_0x171c66);_0x3fc066(_0x5eb260[_0xe641('0x11')](0x1f4,_0x5b5592['message']));});});}; \ No newline at end of file +var _0xf645=['error','code','Setting,\x20%s,\x20%s','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','model','map','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf645,0x143));var _0x5f64=function(_0xd719d2,_0x88d330){_0xd719d2=_0xd719d2-0x0;var _0x2c1995=_0xf645[_0xd719d2];return _0x2c1995;};'use strict';var _=require(_0x5f64('0x0'));var util=require(_0x5f64('0x1'));var moment=require(_0x5f64('0x2'));var BPromise=require(_0x5f64('0x3'));var rs=require(_0x5f64('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5f64('0x5'))['db'];var utils=require(_0x5f64('0x6'));var logger=require(_0x5f64('0x7'))(_0x5f64('0x8'));var config=require(_0x5f64('0x9'));var jayson=require(_0x5f64('0xa'));var client=jayson['client'][_0x5f64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1070c6,_0x3873b0,_0x2e299e){return new BPromise(function(_0x1b5b78,_0x52373e){return client['request'](_0x1070c6,_0x2e299e)[_0x5f64('0xc')](function(_0x3777a7){logger[_0x5f64('0xd')]('Setting,\x20%s,\x20%s',_0x3873b0,_0x5f64('0xe'));logger['debug'](_0x5f64('0xf'),_0x3873b0,_0x5f64('0xe'),JSON[_0x5f64('0x10')](_0x3777a7));if(_0x3777a7[_0x5f64('0x11')]){if(_0x3777a7[_0x5f64('0x11')][_0x5f64('0x12')]===0x1f4){logger[_0x5f64('0x11')](_0x5f64('0x13'),_0x3873b0,_0x3777a7[_0x5f64('0x11')][_0x5f64('0x14')]);return _0x52373e(_0x3777a7[_0x5f64('0x11')][_0x5f64('0x14')]);}logger['error']('Setting,\x20%s,\x20%s',_0x3873b0,_0x3777a7[_0x5f64('0x11')][_0x5f64('0x14')]);return _0x1b5b78(_0x3777a7[_0x5f64('0x11')]['message']);}else{logger['info'](_0x5f64('0x13'),_0x3873b0,'request\x20sent');_0x1b5b78(_0x3777a7[_0x5f64('0x15')]['message']);}})[_0x5f64('0x16')](function(_0x444947){logger['error'](_0x5f64('0x13'),_0x3873b0,_0x444947);_0x52373e(_0x444947);});});}exports[_0x5f64('0x17')]=function(_0x5adce4){var _0x4da2c1=this;return new Promise(function(_0x2032b1,_0x3df660){return db[_0x5f64('0x18')][_0x5f64('0x19')]({'raw':_0x5adce4[_0x5f64('0x1a')]?_0x5adce4[_0x5f64('0x1a')][_0x5f64('0x1b')]===undefined?!![]:![]:!![],'where':_0x5adce4[_0x5f64('0x1a')]?_0x5adce4[_0x5f64('0x1a')][_0x5f64('0x1c')]||null:null,'attributes':_0x5adce4[_0x5f64('0x1a')]?_0x5adce4[_0x5f64('0x1a')][_0x5f64('0x1d')]||null:null,'include':_0x5adce4[_0x5f64('0x1a')]?_0x5adce4['options']['include']?_['map'](_0x5adce4['options'][_0x5f64('0x1e')],function(_0x2a3cf1){return{'model':db[_0x2a3cf1[_0x5f64('0x1f')]],'as':_0x2a3cf1['as'],'attributes':_0x2a3cf1['attributes'],'include':_0x2a3cf1[_0x5f64('0x1e')]?_[_0x5f64('0x20')](_0x2a3cf1[_0x5f64('0x1e')],function(_0xeb43c0){return{'model':db[_0xeb43c0['model']],'as':_0xeb43c0['as'],'attributes':_0xeb43c0['attributes'],'include':_0xeb43c0[_0x5f64('0x1e')]?_['map'](_0xeb43c0[_0x5f64('0x1e')],function(_0x596702){return{'model':db[_0x596702['model']],'as':_0x596702['as'],'attributes':_0x596702[_0x5f64('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5f64('0xc')](function(_0x487dc5){logger['info'](_0x5f64('0x17'),_0x5adce4);logger[_0x5f64('0x21')]('ShowSetting',_0x5adce4,JSON[_0x5f64('0x10')](_0x487dc5));_0x2032b1(_0x487dc5);})[_0x5f64('0x16')](function(_0x3e7f8a){logger[_0x5f64('0x11')](_0x5f64('0x17'),_0x3e7f8a[_0x5f64('0x14')],_0x5adce4);_0x3df660(_0x4da2c1[_0x5f64('0x11')](0x1f4,_0x3e7f8a[_0x5f64('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 2d67870..c5219b4 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(_0x250f82,_0xca2c51){var _0x3d8e8a=function(_0x5ab54d){while(--_0x5ab54d){_0x250f82['push'](_0x250f82['shift']());}};_0x3d8e8a(++_0xca2c51);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file +var _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(_0x284506,_0x191316){var _0x1e9ee5=function(_0xe7eaa){while(--_0xe7eaa){_0x284506['push'](_0x284506['shift']());}};_0x1e9ee5(++_0x191316);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 9a30ff4..651cd82 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 _0x3d20=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','clicksend','clickatell','csc','intelepeer','BOOLEAN'];(function(_0x366ad6,_0x312574){var _0x1dce46=function(_0x4a2fde){while(--_0x4a2fde){_0x366ad6['push'](_0x366ad6['shift']());}};_0x1dce46(++_0x312574);}(_0x3d20,0x86));var _0x03d2=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x3d20[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x03d2('0x0'));module[_0x03d2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x03d2('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x03d2('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x03d2('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x03d2('0x4')]();}},'phone':{'type':Sequelize[_0x03d2('0x3')]},'type':{'type':Sequelize[_0x03d2('0x5')](_0x03d2('0x6'),_0x03d2('0x7'),'connectel',_0x03d2('0x8'),'plivo',_0x03d2('0x9'),'bandwidth',_0x03d2('0xa'),'infobip',_0x03d2('0xb'))},'accountSid':{'type':Sequelize[_0x03d2('0x3')]},'authId':{'type':Sequelize[_0x03d2('0x3')]},'authToken':{'type':Sequelize[_0x03d2('0x3')]},'smsMethod':{'type':Sequelize[_0x03d2('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x03d2('0x3')]},'apiKey':{'type':Sequelize[_0x03d2('0x3')]},'applicationId':{'type':Sequelize[_0x03d2('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x03d2('0x3')]},'deliveryReport':{'type':Sequelize[_0x03d2('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x03d2('0x3')]},'notificationTemplate':{'type':Sequelize[_0x03d2('0xd')],'defaultValue':function(){return _0x03d2('0xe');}},'notificationSound':{'type':Sequelize[_0x03d2('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x03d2('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x03d2('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x03d2('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x03d2('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x03d2('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x03d2('0xf')],'comment':_0x03d2('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x03d2('0xc')],'defaultValue':![],'comment':_0x03d2('0x11'),'set':function(_0x9d53cc){if(!_0x9d53cc)this['setDataValue'](_0x03d2('0x12'),null);this[_0x03d2('0x13')](_0x03d2('0x14'),_0x9d53cc);}}}; \ No newline at end of file +var _0x0ebc=['STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0xf8de64,_0xe99c30){var _0x2e720e=function(_0x2e91e5){while(--_0x2e91e5){_0xf8de64['push'](_0xf8de64['shift']());}};_0x2e720e(++_0xe99c30);}(_0x0ebc,0x1b2));var _0xc0eb=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0ebc[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xc0eb('0x0'));var rs=require(_0xc0eb('0x1'));module[_0xc0eb('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xc0eb('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xc0eb('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xc0eb('0x3')],'defaultValue':function(){return rs[_0xc0eb('0x4')]();}},'phone':{'type':Sequelize[_0xc0eb('0x3')]},'type':{'type':Sequelize[_0xc0eb('0x5')](_0xc0eb('0x6'),_0xc0eb('0x7'),_0xc0eb('0x8'),_0xc0eb('0x9'),_0xc0eb('0xa'),_0xc0eb('0xb'),_0xc0eb('0xc'),_0xc0eb('0xd'),'infobip',_0xc0eb('0xe'))},'accountSid':{'type':Sequelize[_0xc0eb('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xc0eb('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xc0eb('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xc0eb('0x3')]},'applicationId':{'type':Sequelize[_0xc0eb('0x3')]},'accountId':{'type':Sequelize[_0xc0eb('0x3')]},'senderString':{'type':Sequelize[_0xc0eb('0x3')]},'deliveryReport':{'type':Sequelize[_0xc0eb('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0xc0eb('0x3')]},'notificationTemplate':{'type':Sequelize[_0xc0eb('0x10')],'defaultValue':function(){return _0xc0eb('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc0eb('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc0eb('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc0eb('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc0eb('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc0eb('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc0eb('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xc0eb('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc0eb('0x12')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc0eb('0xf')],'defaultValue':![],'comment':_0xc0eb('0x13'),'set':function(_0x2ef4c7){if(!_0x2ef4c7)this[_0xc0eb('0x14')](_0xc0eb('0x15'),null);this[_0xc0eb('0x14')](_0xc0eb('0x16'),_0x2ef4c7);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 9d80819..150ba85 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 _0x2957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./smsAccount.socket','register','client','http','request','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','then','destroy','get','SmsAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','findAll','show','params','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','filter','rows','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','notify','sms','SmsApplication','account','applications','Applications','priority','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','From','MessageSid','text','connectel','messageId','message_id','Text','infobip','results','csc','originatingAddress','clickatell','fromNumber','bandwidth','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','contact','SmsInteraction','spread','interaction','created','autoclose','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','push','inspect','skebby','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','redif','DELIVERED','error_code','DELIVERED_TO_GATEWAY','intelepeer','DELIVRD','statusGet','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents'];(function(_0x53335c,_0x551d13){var _0x46c627=function(_0x1b49ee){while(--_0x1b49ee){_0x53335c['push'](_0x53335c['shift']());}};_0x46c627(++_0x551d13);}(_0x2957,0x1ca));var _0x7295=function(_0xf20dd7,_0x2432dd){_0xf20dd7=_0xf20dd7-0x0;var _0x5c5240=_0x2957[_0xf20dd7];return _0x5c5240;};'use strict';var emlformat=require(_0x7295('0x0'));var rimraf=require(_0x7295('0x1'));var zipdir=require(_0x7295('0x2'));var jsonpatch=require(_0x7295('0x3'));var rp=require('request-promise');var moment=require(_0x7295('0x4'));var BPromise=require(_0x7295('0x5'));var Mustache=require('mustache');var util=require(_0x7295('0x6'));var path=require(_0x7295('0x7'));var sox=require(_0x7295('0x8'));var csv=require(_0x7295('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7295('0xa'));var _=require(_0x7295('0xb'));var squel=require(_0x7295('0xc'));var crypto=require(_0x7295('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7295('0x9'));var querystring=require(_0x7295('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7295('0xf'));var qs=require(_0x7295('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7295('0x11'));var logger=require('../../config/logger')(_0x7295('0x12'));var utils=require('../../config/utils');var config=require(_0x7295('0x13'));var licenseUtil=require(_0x7295('0x14'));var db=require(_0x7295('0x15'))['db'];config[_0x7295('0x16')]=_[_0x7295('0x17')](config[_0x7295('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7295('0x18'))[_0x7295('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7295('0x1a')][_0x7295('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x2fcf5a,_0xeb030e,_0x7531f0,_0x37562e){return new BPromise(function(_0x26a372,_0x15a303){var _0x4fa3a0=_0x37562e||client;return _0x4fa3a0[_0x7295('0x1c')](_0x2fcf5a,_0x7531f0)['then'](function(_0x44650c){logger[_0x7295('0x1d')](_0x7295('0x1e'),_0xeb030e,'request\x20sent');logger[_0x7295('0x1f')](_0x7295('0x20'),_0xeb030e,_0x7295('0x21'),JSON[_0x7295('0x22')](_0x44650c));if(_0x44650c[_0x7295('0x23')]){if(_0x44650c[_0x7295('0x23')]['code']===0x1f4){logger[_0x7295('0x23')](_0x7295('0x1e'),_0xeb030e,_0x44650c[_0x7295('0x23')]['message']);return _0x15a303(_0x44650c['error'][_0x7295('0x24')]);}logger[_0x7295('0x23')](_0x7295('0x1e'),_0xeb030e,_0x44650c['error'][_0x7295('0x24')]);return _0x26a372(_0x44650c[_0x7295('0x23')][_0x7295('0x24')]);}else{logger['info'](_0x7295('0x1e'),_0xeb030e,_0x7295('0x21'));_0x26a372(_0x44650c['result']['message']);}})[_0x7295('0x25')](function(_0x30f9f7){logger[_0x7295('0x23')](_0x7295('0x1e'),_0xeb030e,_0x30f9f7);_0x15a303(_0x30f9f7);});});}function respondWithStatusCode(_0x56e9b4,_0x397fe9){_0x397fe9=_0x397fe9||0xcc;return function(_0x371d3f){if(_0x371d3f){return _0x56e9b4[_0x7295('0x26')](_0x397fe9);}return _0x56e9b4[_0x7295('0x27')](_0x397fe9)[_0x7295('0x28')]();};}function respondWithResult(_0x149484,_0x48a4ba){_0x48a4ba=_0x48a4ba||0xc8;return function(_0x15e780){if(_0x15e780){return _0x149484[_0x7295('0x27')](_0x48a4ba)[_0x7295('0x29')](_0x15e780);}};}function respondWithFilteredResult(_0x49380e,_0x40bb72){return function(_0x5a4a3d){if(_0x5a4a3d){var _0x1a6da2=typeof _0x40bb72['offset']==='undefined'&&typeof _0x40bb72[_0x7295('0x2a')]===_0x7295('0x2b');var _0x49ec8c=_0x5a4a3d[_0x7295('0x2c')];var _0xa66c78=_0x1a6da2?0x0:_0x40bb72[_0x7295('0x2d')];var _0x22481a=_0x1a6da2?_0x5a4a3d[_0x7295('0x2c')]:_0x40bb72[_0x7295('0x2d')]+_0x40bb72[_0x7295('0x2a')];var _0x291245;if(_0x22481a>=_0x49ec8c){_0x22481a=_0x49ec8c;_0x291245=0xc8;}else{_0x291245=0xce;}_0x49380e['status'](_0x291245);return _0x49380e['set'](_0x7295('0x2e'),_0xa66c78+'-'+_0x22481a+'/'+_0x49ec8c)['json'](_0x5a4a3d);}return null;};}function patchUpdates(_0x4a8ea2){return function(_0x2cfa7e){try{jsonpatch['apply'](_0x2cfa7e,_0x4a8ea2,!![]);}catch(_0x34e911){return BPromise[_0x7295('0x2f')](_0x34e911);}return _0x2cfa7e[_0x7295('0x30')]();};}function saveUpdates(_0x445c5a,_0x358e91){return function(_0x5a2494){if(_0x5a2494){return _0x5a2494['update'](_0x445c5a)[_0x7295('0x31')](function(_0x46ec7b){return _0x46ec7b;});}return null;};}function removeEntity(_0x50713f,_0xe24587){return function(_0x131e31){if(_0x131e31){return _0x131e31[_0x7295('0x32')]()[_0x7295('0x31')](function(){var _0x4d00d2=_0x131e31[_0x7295('0x33')]({'plain':!![]});var _0x35e9e5=_0x7295('0x34');return db[_0x7295('0x35')][_0x7295('0x32')]({'where':{'type':_0x35e9e5,'resourceId':_0x4d00d2['id']}})[_0x7295('0x31')](function(){return _0x131e31;});})[_0x7295('0x31')](function(){_0x50713f['status'](0xcc)[_0x7295('0x28')]();});}};}function handleEntityNotFound(_0x271f85,_0x474e19){return function(_0x1e9bbc){if(!_0x1e9bbc){_0x271f85[_0x7295('0x26')](0x194);}return _0x1e9bbc;};}function handleError(_0x1214a6,_0x23801a){_0x23801a=_0x23801a||0x1f4;return function(_0x25e263){logger[_0x7295('0x23')](_0x25e263['stack']);if(_0x25e263[_0x7295('0x36')]){delete _0x25e263[_0x7295('0x36')];}_0x1214a6[_0x7295('0x27')](_0x23801a)[_0x7295('0x37')](_0x25e263);};}exports[_0x7295('0x38')]=function(_0x2e9095,_0x2a11a2){var _0x4016bf={'include':[{'model':db[_0x7295('0x39')],'as':_0x7295('0x3a')}]},_0x2e4f7b={},_0x1b1262={'count':0x0,'rows':[]};var _0x1c253b=_[_0x7295('0x3b')](db[_0x7295('0x3c')][_0x7295('0x3d')],function(_0x5b8927){return{'name':_0x5b8927['fieldName'],'type':_0x5b8927['type'][_0x7295('0x3e')]};});_0x2e4f7b[_0x7295('0x3f')]=_[_0x7295('0x3b')](_0x1c253b,_0x7295('0x36'));_0x2e4f7b[_0x7295('0x40')]=_[_0x7295('0x41')](_0x2e9095['query']);_0x2e4f7b[_0x7295('0x42')]=_[_0x7295('0x43')](_0x2e4f7b[_0x7295('0x3f')],_0x2e4f7b['query']);_0x4016bf[_0x7295('0x44')]=_['intersection'](_0x2e4f7b[_0x7295('0x3f')],qs[_0x7295('0x45')](_0x2e9095[_0x7295('0x40')]['fields']));_0x4016bf[_0x7295('0x44')]=_0x4016bf[_0x7295('0x44')]['length']?_0x4016bf[_0x7295('0x44')]:_0x2e4f7b['model'];if(!_0x2e9095[_0x7295('0x40')][_0x7295('0x46')]('nolimit')){_0x4016bf[_0x7295('0x2a')]=qs[_0x7295('0x2a')](_0x2e9095['query'][_0x7295('0x2a')]);_0x4016bf['offset']=qs[_0x7295('0x2d')](_0x2e9095['query'][_0x7295('0x2d')]);}_0x4016bf[_0x7295('0x47')]=qs[_0x7295('0x48')](_0x2e9095[_0x7295('0x40')]['sort']);_0x4016bf[_0x7295('0x49')]=qs['filters'](_[_0x7295('0x4a')](_0x2e9095[_0x7295('0x40')],_0x2e4f7b['filters']),_0x1c253b);if(_0x2e9095[_0x7295('0x40')]['filter']){_0x4016bf[_0x7295('0x49')]=_[_0x7295('0x4b')](_0x4016bf[_0x7295('0x49')],{'$or':_[_0x7295('0x3b')](_0x1c253b,function(_0x1b1672){if(_0x1b1672[_0x7295('0x4c')]!==_0x7295('0x4d')){var _0x5757ef={};_0x5757ef[_0x1b1672[_0x7295('0x36')]]={'$like':'%'+_0x2e9095[_0x7295('0x40')]['filter']+'%'};return _0x5757ef;}})});}_0x4016bf=_[_0x7295('0x4b')]({},_0x4016bf,_0x2e9095[_0x7295('0x4e')]);var _0x2d0425={'where':_0x4016bf[_0x7295('0x49')]};return db[_0x7295('0x3c')][_0x7295('0x2c')](_0x2d0425)[_0x7295('0x31')](function(_0x5cba05){_0x1b1262[_0x7295('0x2c')]=_0x5cba05;if(_0x2e9095[_0x7295('0x40')][_0x7295('0x4f')]){_0x4016bf['include']=[{'all':!![]}];}return db[_0x7295('0x3c')][_0x7295('0x50')](_0x4016bf);})['then'](function(_0x4edbd3){_0x1b1262['rows']=_0x4edbd3;return _0x1b1262;})[_0x7295('0x31')](respondWithFilteredResult(_0x2a11a2,_0x4016bf))['catch'](handleError(_0x2a11a2,null));};exports[_0x7295('0x51')]=function(_0x503ed6,_0xc6d8e3){var _0x1dcd60={'raw':![],'where':{'id':_0x503ed6[_0x7295('0x52')]['id']},'include':[{'model':db['Pause'],'as':_0x7295('0x3a')}]},_0x417e1b={};_0x417e1b[_0x7295('0x3f')]=_[_0x7295('0x41')](db[_0x7295('0x3c')]['rawAttributes']);_0x417e1b['query']=_['keys'](_0x503ed6[_0x7295('0x40')]);_0x417e1b[_0x7295('0x42')]=_['intersection'](_0x417e1b[_0x7295('0x3f')],_0x417e1b[_0x7295('0x40')]);_0x1dcd60['attributes']=_[_0x7295('0x43')](_0x417e1b[_0x7295('0x3f')],qs['fields'](_0x503ed6[_0x7295('0x40')][_0x7295('0x45')]));_0x1dcd60[_0x7295('0x44')]=_0x1dcd60['attributes'][_0x7295('0x53')]?_0x1dcd60[_0x7295('0x44')]:_0x417e1b[_0x7295('0x3f')];if(_0x503ed6[_0x7295('0x40')][_0x7295('0x4f')]){_0x1dcd60[_0x7295('0x54')]=[{'all':!![]}];}_0x1dcd60=_['merge']({},_0x1dcd60,_0x503ed6[_0x7295('0x4e')]);return db[_0x7295('0x3c')]['find'](_0x1dcd60)[_0x7295('0x31')](handleEntityNotFound(_0xc6d8e3,null))[_0x7295('0x31')](respondWithResult(_0xc6d8e3,null))[_0x7295('0x25')](handleError(_0xc6d8e3,null));};exports[_0x7295('0x55')]=function(_0x5efbcd,_0x1ca0f8){return db[_0x7295('0x3c')][_0x7295('0x55')](_0x5efbcd[_0x7295('0x56')],{})[_0x7295('0x31')](function(_0x583d47){var _0x8ef0bf=_0x5efbcd[_0x7295('0x57')]['get']({'plain':!![]});if(!_0x8ef0bf)throw new Error(_0x7295('0x58'));if(_0x8ef0bf[_0x7295('0x59')]===_0x7295('0x57')){var _0x3bfad3=_0x583d47[_0x7295('0x33')]({'plain':!![]});var _0x56c32a=_0x7295('0x34');return db[_0x7295('0x5a')][_0x7295('0x5b')]({'where':{'name':_0x56c32a,'userProfileId':_0x8ef0bf[_0x7295('0x5c')]},'raw':!![]})[_0x7295('0x31')](function(_0x1eff93){if(_0x1eff93&&_0x1eff93[_0x7295('0x5d')]===0x0){return db[_0x7295('0x35')][_0x7295('0x55')]({'name':_0x3bfad3[_0x7295('0x36')],'resourceId':_0x3bfad3['id'],'type':_0x1eff93[_0x7295('0x36')],'sectionId':_0x1eff93['id']},{})[_0x7295('0x31')](function(){return _0x583d47;});}else{return _0x583d47;}})[_0x7295('0x25')](function(_0x40e963){logger[_0x7295('0x23')](_0x7295('0x5e'),_0x40e963);throw _0x40e963;});}return _0x583d47;})[_0x7295('0x31')](respondWithResult(_0x1ca0f8,0xc9))[_0x7295('0x25')](handleError(_0x1ca0f8,null));};exports[_0x7295('0x5f')]=function(_0x3f4fcd,_0x2ebfba){if(_0x3f4fcd[_0x7295('0x56')]['id']){delete _0x3f4fcd[_0x7295('0x56')]['id'];}return db[_0x7295('0x3c')][_0x7295('0x5b')]({'where':{'id':_0x3f4fcd[_0x7295('0x52')]['id']},'include':[{'model':db[_0x7295('0x39')],'as':'mandatoryDispositionPause'}]})[_0x7295('0x31')](handleEntityNotFound(_0x2ebfba,null))[_0x7295('0x31')](saveUpdates(_0x3f4fcd[_0x7295('0x56')],null))[_0x7295('0x31')](respondWithResult(_0x2ebfba,null))[_0x7295('0x25')](handleError(_0x2ebfba,null));};exports[_0x7295('0x32')]=function(_0x312417,_0x26bc34){return db[_0x7295('0x3c')]['find']({'where':{'id':_0x312417['params']['id']}})[_0x7295('0x31')](handleEntityNotFound(_0x26bc34,null))['then'](removeEntity(_0x26bc34,null))[_0x7295('0x25')](handleError(_0x26bc34,null));};exports[_0x7295('0x60')]=function(_0x4d8bfd,_0x28ef58){return db['SmsAccount']['describe']()[_0x7295('0x31')](respondWithResult(_0x28ef58,null))[_0x7295('0x25')](handleError(_0x28ef58,null));};exports[_0x7295('0x61')]=function(_0x21f06f,_0x1dd86d,_0x333fd1){if(_0x21f06f[_0x7295('0x56')]['id']){delete _0x21f06f[_0x7295('0x56')]['id'];}return db['SmsAccount'][_0x7295('0x5b')]({'where':{'id':_0x21f06f['params']['id']}})['then'](handleEntityNotFound(_0x1dd86d,null))[_0x7295('0x31')](function(_0x1c1cd8){if(_0x1c1cd8){_0x21f06f['body'][_0x7295('0x62')]=_0x1c1cd8['id'];return db[_0x7295('0x63')][_0x7295('0x55')](_0x21f06f[_0x7295('0x56')]);}})[_0x7295('0x31')](respondWithResult(_0x1dd86d,null))[_0x7295('0x25')](handleError(_0x1dd86d,null));};exports[_0x7295('0x64')]=function(_0x15da71,_0xbf4a41,_0x5d3fc0){var _0x164488={'raw':![],'where':{}};var _0xc94094={};var _0x45024a={'count':0x0,'rows':[]};return db['SmsAccount'][_0x7295('0x65')]({'where':{'id':_0x15da71[_0x7295('0x52')]['id']}})['then'](handleEntityNotFound(_0xbf4a41,null))[_0x7295('0x31')](function(_0x4aad98){if(_0x4aad98){_0xc94094[_0x7295('0x3f')]=_[_0x7295('0x41')](db[_0x7295('0x63')][_0x7295('0x3d')]);_0xc94094[_0x7295('0x40')]=_[_0x7295('0x41')](_0x15da71['query']);_0xc94094[_0x7295('0x42')]=_[_0x7295('0x43')](_0xc94094[_0x7295('0x3f')],_0xc94094[_0x7295('0x40')]);_0x164488[_0x7295('0x44')]=_[_0x7295('0x43')](_0xc94094[_0x7295('0x3f')],qs[_0x7295('0x45')](_0x15da71[_0x7295('0x40')][_0x7295('0x45')]));_0x164488[_0x7295('0x44')]=_0x164488[_0x7295('0x44')][_0x7295('0x53')]?_0x164488[_0x7295('0x44')]:_0xc94094[_0x7295('0x3f')];if(!_0x15da71[_0x7295('0x40')]['hasOwnProperty'](_0x7295('0x66'))){_0x164488['limit']=qs['limit'](_0x15da71[_0x7295('0x40')][_0x7295('0x2a')]);_0x164488['offset']=qs[_0x7295('0x2d')](_0x15da71['query'][_0x7295('0x2d')]);}_0x164488[_0x7295('0x47')]=qs[_0x7295('0x48')](_0x15da71[_0x7295('0x40')][_0x7295('0x48')]);_0x164488[_0x7295('0x49')]=qs['filters'](_[_0x7295('0x4a')](_0x15da71['query'],_0xc94094['filters']));_0x164488[_0x7295('0x49')][_0x7295('0x62')]=_0x4aad98['id'];if(_0x15da71[_0x7295('0x40')][_0x7295('0x67')]){_0x164488[_0x7295('0x49')]=_[_0x7295('0x4b')](_0x164488[_0x7295('0x49')],{'$or':_[_0x7295('0x3b')](_0x164488['attributes'],function(_0x5a02d5){var _0x196b3c={};_0x196b3c[_0x5a02d5]={'$like':'%'+_0x15da71['query']['filter']+'%'};return _0x196b3c;})});}_0x164488=_[_0x7295('0x4b')]({},_0x164488,_0x15da71[_0x7295('0x4e')]);return db['Disposition']['count']({'where':_0x164488['where']})[_0x7295('0x31')](function(_0x4120d7){_0x45024a[_0x7295('0x2c')]=_0x4120d7;if(_0x15da71['query'][_0x7295('0x4f')]){_0x164488['include']=[{'all':!![]}];}return db[_0x7295('0x63')][_0x7295('0x50')](_0x164488);})[_0x7295('0x31')](function(_0x16b494){_0x45024a[_0x7295('0x68')]=_0x16b494;return _0x45024a;});}})['then'](respondWithFilteredResult(_0xbf4a41,_0x164488))[_0x7295('0x25')](handleError(_0xbf4a41,null));};exports[_0x7295('0x69')]=function(_0x4f03c6,_0x297797,_0x139e89){return db[_0x7295('0x3c')][_0x7295('0x5b')]({'where':{'id':_0x4f03c6[_0x7295('0x52')]['id']}})[_0x7295('0x31')](handleEntityNotFound(_0x297797,null))['then'](function(_0xa810be){if(_0xa810be){return _0xa810be[_0x7295('0x69')](_0x4f03c6[_0x7295('0x40')]['ids']);}})['then'](respondWithStatusCode(_0x297797,null))[_0x7295('0x25')](handleError(_0x297797,null));};exports[_0x7295('0x6a')]=function(_0x37b522,_0x124e66,_0x31a02b){if(_0x37b522[_0x7295('0x56')]['id']){delete _0x37b522['body']['id'];}return db[_0x7295('0x3c')][_0x7295('0x5b')]({'where':{'id':_0x37b522[_0x7295('0x52')]['id']}})['then'](handleEntityNotFound(_0x124e66,null))[_0x7295('0x31')](function(_0x55f707){if(_0x55f707){_0x37b522[_0x7295('0x56')][_0x7295('0x62')]=_0x55f707['id'];return db['CannedAnswer'][_0x7295('0x55')](_0x37b522['body']);}})[_0x7295('0x31')](respondWithResult(_0x124e66,null))[_0x7295('0x25')](handleError(_0x124e66,null));};exports[_0x7295('0x6b')]=function(_0x2cdcb5,_0x4e0345,_0x2f7ed5){var _0x42463a={'raw':![],'where':{}};var _0x479351={};var _0x199c52={'count':0x0,'rows':[]};return db[_0x7295('0x3c')][_0x7295('0x65')]({'where':{'id':_0x2cdcb5[_0x7295('0x52')]['id']}})['then'](handleEntityNotFound(_0x4e0345,null))[_0x7295('0x31')](function(_0xf74480){if(_0xf74480){_0x479351['model']=_[_0x7295('0x41')](db['CannedAnswer'][_0x7295('0x3d')]);_0x479351[_0x7295('0x40')]=_[_0x7295('0x41')](_0x2cdcb5[_0x7295('0x40')]);_0x479351[_0x7295('0x42')]=_[_0x7295('0x43')](_0x479351[_0x7295('0x3f')],_0x479351['query']);_0x42463a[_0x7295('0x44')]=_[_0x7295('0x43')](_0x479351['model'],qs['fields'](_0x2cdcb5[_0x7295('0x40')][_0x7295('0x45')]));_0x42463a[_0x7295('0x44')]=_0x42463a[_0x7295('0x44')][_0x7295('0x53')]?_0x42463a[_0x7295('0x44')]:_0x479351[_0x7295('0x3f')];if(!_0x2cdcb5[_0x7295('0x40')][_0x7295('0x46')](_0x7295('0x66'))){_0x42463a['limit']=qs[_0x7295('0x2a')](_0x2cdcb5[_0x7295('0x40')]['limit']);_0x42463a[_0x7295('0x2d')]=qs['offset'](_0x2cdcb5[_0x7295('0x40')]['offset']);}_0x42463a['order']=qs[_0x7295('0x48')](_0x2cdcb5[_0x7295('0x40')][_0x7295('0x48')]);_0x42463a['where']=qs[_0x7295('0x42')](_[_0x7295('0x4a')](_0x2cdcb5[_0x7295('0x40')],_0x479351[_0x7295('0x42')]));_0x42463a[_0x7295('0x49')][_0x7295('0x62')]=_0xf74480['id'];if(_0x2cdcb5[_0x7295('0x40')]['filter']){_0x42463a['where']=_[_0x7295('0x4b')](_0x42463a[_0x7295('0x49')],{'$or':_['map'](_0x42463a['attributes'],function(_0x4c2308){var _0x10cbe4={};_0x10cbe4[_0x4c2308]={'$like':'%'+_0x2cdcb5[_0x7295('0x40')][_0x7295('0x67')]+'%'};return _0x10cbe4;})});}_0x42463a=_['merge']({},_0x42463a,_0x2cdcb5[_0x7295('0x4e')]);return db[_0x7295('0x6c')][_0x7295('0x2c')]({'where':_0x42463a[_0x7295('0x49')]})[_0x7295('0x31')](function(_0x4e5bd8){_0x199c52[_0x7295('0x2c')]=_0x4e5bd8;if(_0x2cdcb5[_0x7295('0x40')][_0x7295('0x4f')]){_0x42463a['include']=[{'all':!![]}];}return db[_0x7295('0x6c')][_0x7295('0x50')](_0x42463a);})[_0x7295('0x31')](function(_0x31ad12){_0x199c52[_0x7295('0x68')]=_0x31ad12;return _0x199c52;});}})[_0x7295('0x31')](respondWithFilteredResult(_0x4e0345,_0x42463a))[_0x7295('0x25')](handleError(_0x4e0345,null));};exports['removeAnswers']=function(_0x1af4fc,_0x7341f9,_0x5cd99e){return db[_0x7295('0x3c')][_0x7295('0x5b')]({'where':{'id':_0x1af4fc[_0x7295('0x52')]['id']}})[_0x7295('0x31')](handleEntityNotFound(_0x7341f9,null))[_0x7295('0x31')](function(_0x3a934e){if(_0x3a934e){return _0x3a934e[_0x7295('0x6d')](_0x1af4fc['query'][_0x7295('0x6e')]);}})[_0x7295('0x31')](respondWithStatusCode(_0x7341f9,null))[_0x7295('0x25')](handleError(_0x7341f9,null));};exports[_0x7295('0x6f')]=function(_0x1dfbd5,_0x53689e,_0x390aa5){var _0x49df6d={'channel':_0x7295('0x70')};var _0x625b29=[];var _0x35765f=[];var _0x9ecdb9={};return db[_0x7295('0x3c')][_0x7295('0x5b')]({'where':{'id':_0x1dfbd5['params']['id']},'include':[{'model':db[_0x7295('0x71')],'as':'Applications'}]})[_0x7295('0x31')](handleEntityNotFound(_0x53689e,null))[_0x7295('0x31')](function(_0x5e8c34){_0x49df6d[_0x7295('0x72')]=_0x5e8c34;_0x49df6d[_0x7295('0x73')]=_['orderBy'](_0x5e8c34[_0x7295('0x74')],[_0x7295('0x75')],[_0x7295('0x76')]);if(_0x49df6d[_0x7295('0x72')]['Applications']){delete _0x49df6d[_0x7295('0x72')][_0x7295('0x74')];}return db[_0x7295('0x77')][_0x7295('0x60')]();})[_0x7295('0x31')](function(_0x5e235f){if(!_0x5e235f){throw new db[(_0x7295('0x78'))][(_0x7295('0x79'))]('no\x20available\x20attributes');}_0x625b29=_[_0x7295('0x7a')](_[_0x7295('0x41')](_0x5e235f),[_0x7295('0x7b'),_0x7295('0x7c')]);_0x35765f=_[_0x7295('0x7a')](_[_0x7295('0x41')](_0x5e235f),[_0x7295('0x7b'),_0x7295('0x7c'),_0x7295('0x7d'),_0x7295('0x7e')]);_0x49df6d[_0x7295('0x56')]={'mapKey':'mobile'};if(_0x49df6d[_0x7295('0x72')][_0x7295('0x4c')]){switch(_0x49df6d['account'][_0x7295('0x4c')]){case'twilio':_0x49df6d[_0x7295('0x56')][_0x7295('0x7f')]=_0x1dfbd5[_0x7295('0x56')][_0x7295('0x80')];_0x49df6d[_0x7295('0x56')][_0x7295('0x56')]=_0x1dfbd5['body']['Body'];_0x49df6d[_0x7295('0x56')]['messageId']=_0x1dfbd5[_0x7295('0x56')][_0x7295('0x81')];break;case'skebby':_0x49df6d[_0x7295('0x56')][_0x7295('0x7f')]='+'+_0x1dfbd5[_0x7295('0x56')]['sender'];_0x49df6d[_0x7295('0x56')][_0x7295('0x56')]=_0x1dfbd5[_0x7295('0x56')][_0x7295('0x82')];break;case _0x7295('0x83'):_0x49df6d[_0x7295('0x56')][_0x7295('0x7f')]=_0x1dfbd5[_0x7295('0x56')][_0x7295('0x7f')];_0x49df6d['body'][_0x7295('0x56')]=_0x1dfbd5['body'][_0x7295('0x24')];break;case'clicksend':_0x49df6d['body'][_0x7295('0x7f')]=_0x1dfbd5[_0x7295('0x56')][_0x7295('0x7f')];_0x49df6d[_0x7295('0x56')][_0x7295('0x56')]=_0x1dfbd5[_0x7295('0x56')][_0x7295('0x56')];_0x49df6d[_0x7295('0x56')][_0x7295('0x84')]=_0x1dfbd5['body'][_0x7295('0x85')];break;case'plivo':_0x49df6d[_0x7295('0x56')]['from']=_0x1dfbd5[_0x7295('0x56')][_0x7295('0x80')];_0x49df6d[_0x7295('0x56')]['body']=_0x1dfbd5['body'][_0x7295('0x86')];_0x49df6d[_0x7295('0x56')][_0x7295('0x84')]=_0x1dfbd5[_0x7295('0x56')]['MessageUUID'];break;case _0x7295('0x87'):_0x49df6d['body']['from']='+'+_0x1dfbd5['body']['results'][0x0][_0x7295('0x7f')];_0x49df6d[_0x7295('0x56')]['body']=_0x1dfbd5[_0x7295('0x56')][_0x7295('0x88')][0x0][_0x7295('0x82')];_0x49df6d[_0x7295('0x56')]['messageId']=_0x1dfbd5[_0x7295('0x56')][_0x7295('0x88')][0x0][_0x7295('0x84')];break;case _0x7295('0x89'):_0x49df6d['body']['from']=_0x1dfbd5[_0x7295('0x56')][_0x7295('0x8a')];_0x49df6d[_0x7295('0x56')][_0x7295('0x56')]=_0x1dfbd5[_0x7295('0x56')]['segmentedMessage'][_0x7295('0x24')];break;case _0x7295('0x8b'):_0x49df6d[_0x7295('0x56')][_0x7295('0x7f')]=_0x1dfbd5[_0x7295('0x56')][_0x7295('0x8c')];_0x49df6d['body'][_0x7295('0x56')]=_0x1dfbd5[_0x7295('0x56')][_0x7295('0x82')];_0x49df6d[_0x7295('0x56')][_0x7295('0x84')]=_0x1dfbd5[_0x7295('0x56')]['replyMessageId'];break;case _0x7295('0x8d'):_0x49df6d['body'][_0x7295('0x84')]=_0x1dfbd5[_0x7295('0x56')][0x0][_0x7295('0x24')]['id'];_0x49df6d[_0x7295('0x56')][_0x7295('0x7f')]=_0x1dfbd5['body'][0x0][_0x7295('0x24')]['from'];_0x49df6d['body']['body']=_0x1dfbd5[_0x7295('0x56')][0x0][_0x7295('0x24')]['text'];break;case'intelepeer':_0x49df6d[_0x7295('0x56')][_0x7295('0x7f')]=_0x1dfbd5[_0x7295('0x56')]['from'];_0x49df6d[_0x7295('0x56')][_0x7295('0x56')]=_0x1dfbd5[_0x7295('0x56')]['message'];_0x49df6d[_0x7295('0x56')][_0x7295('0x84')]=_0x1dfbd5['body'][_0x7295('0x8e')];break;}}if(_0x49df6d['body']['id']){delete _0x49df6d[_0x7295('0x56')]['id'];}if(_[_0x7295('0x8f')](_0x49df6d[_0x7295('0x56')][_0x7295('0x7f')])){throw new db[(_0x7295('0x78'))][(_0x7295('0x79'))](_0x7295('0x90'));}if(_[_0x7295('0x8f')](_0x49df6d[_0x7295('0x56')][_0x7295('0x56')])||_0x49df6d[_0x7295('0x56')]['body']===''){throw new db[(_0x7295('0x78'))][(_0x7295('0x79'))](_0x7295('0x91'));}if(_[_0x7295('0x8f')](_0x49df6d[_0x7295('0x56')][_0x7295('0x92')])){throw new db['Sequelize'][(_0x7295('0x79'))](_0x7295('0x93')+_0x35765f);}if(!_[_0x7295('0x94')](_0x35765f,_0x49df6d['body'][_0x7295('0x92')])){throw new db[(_0x7295('0x78'))][(_0x7295('0x79'))](_0x7295('0x95')+_0x35765f);}_0x9ecdb9[_0x49df6d[_0x7295('0x56')]['mapKey']]=_0x49df6d[_0x7295('0x56')]['from'];return db[_0x7295('0x96')][_0x7295('0x5b')]({'where':{'id':_0x49df6d['account']['ListId']},'include':[{'model':db[_0x7295('0x77')],'as':_0x7295('0x97'),'where':_0x9ecdb9,'limit':0x1,'order':[[_0x7295('0x7c'),_0x7295('0x98')]]}]});})['then'](handleEntityNotFound(_0x53689e,null))[_0x7295('0x31')](function(_0x22fcce){if(_0x22fcce){_0x49df6d['list']=_['omit'](_0x22fcce,[_0x7295('0x97')]);if(_0x22fcce[_0x7295('0x97')][_0x7295('0x53')]){return _0x22fcce[_0x7295('0x97')][0x0];}var _0x9177fe=_[_0x7295('0x17')](_0x49df6d['body'],{'firstName':_0x49df6d[_0x7295('0x56')]['from'],'ListId':_0x22fcce['id']});_0x9177fe[_0x49df6d[_0x7295('0x56')][_0x7295('0x92')]]=_0x49df6d[_0x7295('0x56')][_0x7295('0x7f')];return db[_0x7295('0x77')][_0x7295('0x55')](_0x9177fe,{'fields':_0x625b29,'raw':!![]});}})[_0x7295('0x31')](handleEntityNotFound(_0x53689e,null))[_0x7295('0x31')](function(_0x3938c6){if(_0x3938c6){_0x49df6d[_0x7295('0x99')]=_0x3938c6;var _0x479bd2={'ContactId':_0x3938c6['id'],'phone':_0x49df6d[_0x7295('0x56')][_0x7295('0x7f')],'SmsAccountId':_0x1dfbd5[_0x7295('0x52')]['id']};var _0xb45ae8={'ContactId':_0x3938c6['id'],'SmsAccountId':_0x1dfbd5[_0x7295('0x52')]['id'],'closed':![]};return db[_0x7295('0x9a')][_0x7295('0x5b')]({'where':_0xb45ae8})[_0x7295('0x31')](function(_0x2de298){if(_0x2de298){return[_0x2de298,![]];}return db[_0x7295('0x9a')]['create'](_0x479bd2)['then'](function(_0x33392a){return[_0x33392a,!![]];});});}})[_0x7295('0x9b')](function(_0x4a2ee7,_0x10dabb){_0x49df6d['interaction']=_0x4a2ee7[_0x7295('0x33')]({'plain':!![]});_0x49df6d[_0x7295('0x9c')][_0x7295('0x9d')]=![];if(_0x10dabb){if(_0x49df6d[_0x7295('0x72')][_0x7295('0x9e')]){_0x49df6d[_0x7295('0x73')]['push']({'id':0x0,'priority':_0x49df6d[_0x7295('0x73')][_0x7295('0x53')]+0x1,'app':_0x7295('0x9f'),'appdata':'unmanaged','interval':_0x7295('0xa0')});}_0x49df6d[_0x7295('0x9c')][_0x7295('0x9d')]=!![];}return db[_0x7295('0xa1')]['create']({'phone':_0x49df6d[_0x7295('0x56')][_0x7295('0x7f')],'messageId':_0x49df6d['body'][_0x7295('0x84')],'body':_0x49df6d['body'][_0x7295('0x56')],'SmsAccountId':_0x1dfbd5[_0x7295('0x52')]['id'],'SmsInteractionId':_0x4a2ee7['id'],'direction':'in','ContactId':_0x4a2ee7[_0x7295('0xa2')],'AttachmentId':_0x49df6d['body'][_0x7295('0xa3')]});})[_0x7295('0x31')](function(_0x523bd8){_0x49df6d[_0x7295('0x24')]=_0x523bd8;if(!_0x49df6d[_0x7295('0x9c')][_0x7295('0xa4')])return;return db[_0x7295('0xa5')][_0x7295('0x5b')]({'attributes':['id',_0x7295('0x36')],'where':{'id':_0x49df6d[_0x7295('0x9c')]['UserId']}});})[_0x7295('0x31')](function(_0x1dcc70){if(_0x1dcc70){_0x49df6d[_0x7295('0x73')][_0x7295('0xa6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1dcc70[_0x7295('0x36')]+','+(_0x49df6d[_0x7295('0x72')][_0x7295('0xa7')]||0xa),'interval':_0x7295('0xa0')});}if(!_0x49df6d[_0x7295('0x9c')][_0x7295('0xa8')])return;return db[_0x7295('0xa9')][_0x7295('0x5b')]({'attributes':['id',_0x7295('0x36')],'where':{'id':_0x49df6d[_0x7295('0x9c')]['queueId']}});})[_0x7295('0x31')](function(_0x589ac1){if(_0x589ac1){_0x49df6d[_0x7295('0x73')]['unshift']({'id':0x0,'priority':0x1,'app':_0x7295('0xaa'),'appdata':_0x589ac1[_0x7295('0x36')]+','+(_0x49df6d[_0x7295('0x72')][_0x7295('0xab')]||0x12c),'interval':_0x7295('0xa0')});}return respondWithRpcPromise(_0x7295('0xac'),_0x7295('0xad'),_0x49df6d);})['then'](function(_0x1ba19d){if(_0x1ba19d){var _0x3dc64d=0xc8;var _0x53679f=_0x7295('0xae');logger[_0x7295('0x1d')](_0x7295('0x20'),_0x53679f,_0x3dc64d,_0x7295('0xaf'));logger[_0x7295('0x1f')](_0x7295('0xb0'),_0x53679f,_0x3dc64d,_0x7295('0xaf'),JSON[_0x7295('0x22')](_0x1ba19d));if(_0x49df6d[_0x7295('0x72')]['type']==='twilio'){return _0x53689e[_0x7295('0x27')](_0x3dc64d)[_0x7295('0xb1')](_0x7295('0xb2'),_0x7295('0xb3'))[_0x7295('0x37')](_0x7295('0xb4'));}else{return _0x53689e[_0x7295('0x27')](_0x3dc64d)[_0x7295('0x29')](_0x1ba19d);}}})[_0x7295('0x25')](handleError(_0x53689e,null));};exports['addApplications']=function(_0x3aad9b,_0x2950d7){var _0x1c1450=_0x3aad9b[_0x7295('0x52')]['id'];var _0x12c76c=_0x3aad9b[_0x7295('0x56')];var _0x40ecc1=0xc8;var _0x3c9956=null;return db['sequelize'][_0x7295('0xb5')]({'isolationLevel':db[_0x7295('0xb6')][_0x7295('0xb7')][_0x7295('0xb8')][_0x7295('0xb9')]},function(_0x53c2db){return db[_0x7295('0x3c')][_0x7295('0x65')]({'where':{'id':_0x1c1450},'transaction':_0x53c2db})[_0x7295('0x31')](function(_0x565f4d){if(_0x565f4d){return db[_0x7295('0x71')]['destroy']({'where':{'SmsAccountId':_0x1c1450},'transaction':_0x53c2db})['then'](function(){var _0x437c49=_['map'](_0x12c76c,function(_0x540a71){_0x540a71['SmsAccountId']=_0x1c1450;return _0x540a71;});return db[_0x7295('0x71')][_0x7295('0xba')](_0x437c49,{'transaction':_0x53c2db});});}else{_0x40ecc1=0x194;_0x3c9956=[];}});})[_0x7295('0x31')](function(){if(_0x40ecc1!==0x194){return db[_0x7295('0x71')][_0x7295('0xbb')]({'where':{'SmsAccountId':_0x1c1450},'order':'priority'})[_0x7295('0x31')](function(_0x3f003a){_0x3c9956=_0x3f003a;});}})[_0x7295('0x25')](function(_0x47655a){_0x40ecc1=0x1f4;logger[_0x7295('0x23')](_0x47655a[_0x7295('0xbc')]);if(_0x47655a['name']){delete _0x47655a[_0x7295('0x36')];}_0x3c9956=_0x47655a;})[_0x7295('0xbd')](function(){if(_0x3c9956===null){_0x2950d7[_0x7295('0x26')](_0x40ecc1);}else{if(_0x40ecc1===0x1f4){_0x2950d7[_0x7295('0x27')](_0x40ecc1)[_0x7295('0x37')](_0x3c9956);}else{_0x2950d7[_0x7295('0x27')](_0x40ecc1)[_0x7295('0x29')](_0x3c9956);}}});};exports[_0x7295('0xbe')]=function(_0x4d5847,_0x96b377,_0x17a765){var _0x5dcbad={};var _0x2c5b03={};var _0x1bf1a9;var _0x270b57;return db[_0x7295('0x3c')]['findOne']({'where':{'id':_0x4d5847['params']['id']}})[_0x7295('0x31')](handleEntityNotFound(_0x96b377,null))[_0x7295('0x31')](function(_0xe2b7a6){if(_0xe2b7a6){_0x1bf1a9=_0xe2b7a6;_0x2c5b03[_0x7295('0x3f')]=_['keys'](db[_0x7295('0x71')][_0x7295('0x3d')]);_0x2c5b03[_0x7295('0x40')]=_[_0x7295('0x41')](_0x4d5847[_0x7295('0x40')]);_0x2c5b03[_0x7295('0x42')]=_[_0x7295('0x43')](_0x2c5b03[_0x7295('0x3f')],_0x2c5b03[_0x7295('0x40')]);_0x5dcbad['attributes']=_[_0x7295('0x43')](_0x2c5b03['model'],qs[_0x7295('0x45')](_0x4d5847[_0x7295('0x40')]['fields']));_0x5dcbad['attributes']=_0x5dcbad[_0x7295('0x44')][_0x7295('0x53')]?_0x5dcbad['attributes']:_0x2c5b03[_0x7295('0x3f')];_0x5dcbad['order']=qs['sort'](_0x4d5847['query']['sort']);_0x5dcbad[_0x7295('0x49')]=qs[_0x7295('0x42')](_[_0x7295('0x4a')](_0x4d5847[_0x7295('0x40')],_0x2c5b03['filters']));if(_0x4d5847['query'][_0x7295('0x67')]){_0x5dcbad[_0x7295('0x49')]=_[_0x7295('0x4b')](_0x5dcbad[_0x7295('0x49')],{'$or':_[_0x7295('0x3b')](_0x5dcbad['attributes'],function(_0x1f8b22){var _0x48f817={};_0x48f817[_0x1f8b22]={'$like':'%'+_0x4d5847['query'][_0x7295('0x67')]+'%'};return _0x48f817;})});}_0x5dcbad=_[_0x7295('0x4b')]({},_0x5dcbad,_0x4d5847[_0x7295('0x4e')]);return _0x1bf1a9['getApplications'](_0x5dcbad);}})[_0x7295('0x31')](function(_0x482431){if(_0x482431){_0x270b57=_0x482431[_0x7295('0x53')];if(!_0x4d5847[_0x7295('0x40')][_0x7295('0x46')](_0x7295('0x66'))){_0x5dcbad['limit']=qs['limit'](_0x4d5847['query'][_0x7295('0x2a')]);_0x5dcbad['offset']=qs[_0x7295('0x2d')](_0x4d5847[_0x7295('0x40')][_0x7295('0x2d')]);}return _0x1bf1a9[_0x7295('0xbe')](_0x5dcbad);}})[_0x7295('0x31')](function(_0x387780){if(_0x387780){return _0x387780?{'count':_0x270b57,'rows':_0x387780}:null;}})[_0x7295('0x31')](respondWithResult(_0x96b377,null))[_0x7295('0x25')](handleError(_0x96b377,null));};exports[_0x7295('0xbf')]=function(_0x3816fc,_0x240979,_0x10f096){var _0x748e9d={'raw':![],'where':{}};var _0x3a33b8={};var _0x56e40b={'count':0x0,'rows':[]};return db[_0x7295('0x3c')]['findOne']({'where':{'id':_0x3816fc[_0x7295('0x52')]['id']}})['then'](handleEntityNotFound(_0x240979,null))['then'](function(_0x489304){if(_0x489304){_0x3a33b8[_0x7295('0x3f')]=_[_0x7295('0x41')](db[_0x7295('0x9a')]['rawAttributes']);_0x3a33b8['query']=_[_0x7295('0x41')](_0x3816fc[_0x7295('0x40')]);_0x3a33b8[_0x7295('0x42')]=_[_0x7295('0x43')](_0x3a33b8[_0x7295('0x3f')],_0x3a33b8[_0x7295('0x40')]);_0x748e9d[_0x7295('0x44')]=_[_0x7295('0x43')](_0x3a33b8[_0x7295('0x3f')],qs[_0x7295('0x45')](_0x3816fc[_0x7295('0x40')][_0x7295('0x45')]));_0x748e9d[_0x7295('0x44')]=_0x748e9d[_0x7295('0x44')][_0x7295('0x53')]?_0x748e9d[_0x7295('0x44')]:_0x3a33b8[_0x7295('0x3f')];if(!_0x3816fc['query'][_0x7295('0x46')](_0x7295('0x66'))){_0x748e9d[_0x7295('0x2a')]=qs['limit'](_0x3816fc[_0x7295('0x40')][_0x7295('0x2a')]);_0x748e9d['offset']=qs[_0x7295('0x2d')](_0x3816fc[_0x7295('0x40')][_0x7295('0x2d')]);}_0x748e9d[_0x7295('0x47')]=qs['sort'](_0x3816fc['query'][_0x7295('0x48')]);_0x748e9d[_0x7295('0x49')]=qs[_0x7295('0x42')](_[_0x7295('0x4a')](_0x3816fc[_0x7295('0x40')],_0x3a33b8[_0x7295('0x42')]));_0x748e9d[_0x7295('0x49')]['SmsAccountId']=_0x489304['id'];if(_0x3816fc['query'][_0x7295('0x67')]){_0x748e9d['where']=_['merge'](_0x748e9d[_0x7295('0x49')],{'$or':_['map'](_0x748e9d[_0x7295('0x44')],function(_0x1109c8){var _0x295392={};_0x295392[_0x1109c8]={'$like':'%'+_0x3816fc['query'][_0x7295('0x67')]+'%'};return _0x295392;})});}_0x748e9d=_[_0x7295('0x4b')]({},_0x748e9d,_0x3816fc[_0x7295('0x4e')]);return db['SmsInteraction'][_0x7295('0x2c')]({'where':_0x748e9d['where']})[_0x7295('0x31')](function(_0x168764){_0x56e40b[_0x7295('0x2c')]=_0x168764;if(_0x3816fc[_0x7295('0x40')][_0x7295('0x4f')]){_0x748e9d[_0x7295('0x54')]=[{'model':db[_0x7295('0x77')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x7295('0xc0'),'attributes':[_0x7295('0x36'),_0x7295('0xc1'),_0x7295('0xc2')],'required':![]},{'model':db[_0x7295('0xc3')],'as':_0x7295('0xc4'),'attributes':['id',_0x7295('0x36'),'color'],'where':_0x3816fc['query'][_0x7295('0xc5')]?{'id':_0x3816fc[_0x7295('0x40')][_0x7295('0xc5')]}:undefined,'required':_0x3816fc[_0x7295('0x40')][_0x7295('0xc5')]?!![]:![]}];}return db[_0x7295('0x9a')][_0x7295('0x50')](_0x748e9d);})[_0x7295('0x31')](function(_0x31188f){_0x56e40b[_0x7295('0x68')]=_0x31188f;return _0x56e40b;});}})['then'](respondWithFilteredResult(_0x240979,_0x748e9d))[_0x7295('0x25')](handleError(_0x240979,null));};exports[_0x7295('0x37')]=function(_0x1c0e6c,_0x572d6d,_0x50b747){var _0x51e620,_0x556133,_0x516acd;if(_['isNil'](_0x1c0e6c['body'][_0x7295('0x56')])||_0x1c0e6c[_0x7295('0x56')][_0x7295('0x56')]===''){throw new db[(_0x7295('0x78'))][(_0x7295('0x79'))](_0x7295('0x91'));}if(_['isNil'](_0x1c0e6c[_0x7295('0x56')]['to'])){throw new db[(_0x7295('0x78'))]['ValidationError'](_0x7295('0xc6'));}_0x51e620=_0x1c0e6c[_0x7295('0x56')]['to'];return db[_0x7295('0x3c')][_0x7295('0x5b')]({'where':{'id':_0x1c0e6c['params']['id']},'include':[{'model':db['CmList'],'as':_0x7295('0xc7'),'include':[{'model':db[_0x7295('0x77')],'as':'Contacts','where':{'mobile':_0x51e620},'limit':0x1,'order':[[_0x7295('0x7c'),_0x7295('0x98')]]}]}]})[_0x7295('0x31')](handleEntityNotFound(_0x572d6d,null))['then'](function(_0x4c11b3){if(_0x4c11b3&&_0x4c11b3['List']){_0x556133=_0x4c11b3[_0x7295('0x33')]({'plain':!![]});if(_0x556133[_0x7295('0xc7')]&&_0x556133[_0x7295('0xc7')][_0x7295('0x97')][_0x7295('0x53')]){return _0x556133[_0x7295('0xc7')]['Contacts'][0x0];}return db[_0x7295('0x77')][_0x7295('0x55')](_['defaults'](_0x1c0e6c[_0x7295('0x56')],{'firstName':_0x51e620,'mobile':_0x51e620,'phone':_0x51e620,'ListId':_0x556133['ListId']}));}})[_0x7295('0x31')](handleEntityNotFound(_0x572d6d,null))[_0x7295('0x31')](function(_0x259362){if(_0x259362){_0x516acd=_0x259362;return db['SmsInteraction'][_0x7295('0x5b')]({'where':{'ContactId':_0x516acd['id'],'closed':![],'SmsAccountId':_0x556133['id']}})[_0x7295('0x31')](function(_0x13e1b9){if(_0x13e1b9){return[_0x13e1b9,![]];}return db[_0x7295('0x9a')][_0x7295('0x55')]({'UserId':_0x1c0e6c[_0x7295('0x57')]['id'],'ContactId':_0x516acd['id'],'SmsAccountId':_0x556133['id'],'phone':_0x51e620,'firstMsgDirection':_0x7295('0xc8'),'Messages':[_[_0x7295('0x4b')](_0x1c0e6c[_0x7295('0x56')],{'read':![],'body':_0x1c0e6c[_0x7295('0x56')][_0x7295('0x56')],'phone':_0x51e620,'SmsAccountId':_0x556133['id'],'UserId':_0x1c0e6c[_0x7295('0x57')]['id'],'ContactId':_0x516acd['id']})]},{'include':[{'model':db[_0x7295('0xa1')],'as':'Messages'}]})[_0x7295('0x31')](function(_0x4ca6ff){return[_0x4ca6ff,!![]];});});}})[_0x7295('0x9b')](function(_0x34f15f,_0x2091f2){if(_0x2091f2){return _0x34f15f;}return db[_0x7295('0xa1')]['create'](_['merge'](_0x1c0e6c[_0x7295('0x56')],{'read':![],'body':_0x1c0e6c[_0x7295('0x56')]['body'],'phone':_0x51e620,'SmsAccountId':_0x556133['id'],'SmsInteractionId':_0x34f15f['id'],'UserId':_0x1c0e6c['user']['id'],'ContactId':_0x516acd['id']}))[_0x7295('0x31')](function(_0x535639){_0x34f15f['dataValues'][_0x7295('0xc9')]=[];_0x34f15f[_0x7295('0xca')][_0x7295('0xc9')][_0x7295('0xcb')](_0x535639[_0x7295('0xca')]);return _0x34f15f;});})[_0x7295('0x31')](respondWithResult(_0x572d6d,null))[_0x7295('0x25')](handleError(_0x572d6d,null));};exports['status']=function(_0x8b86c1,_0x3fec25,_0x5ea1e6){if(_0x8b86c1[_0x7295('0x56')]['id']){delete _0x8b86c1['body']['id'];}var _0x10f49e,_0x5dda58,_0x2cbfb2;return db[_0x7295('0x3c')][_0x7295('0x5b')]({'where':{'id':_0x8b86c1[_0x7295('0x52')]['id']}})[_0x7295('0x31')](handleEntityNotFound(_0x3fec25,null))[_0x7295('0x31')](function(_0x32816f){if(_0x32816f){_0x2cbfb2=_0x32816f;logger[_0x7295('0x1f')](_0x7295('0x20'),_0x7295('0x27'),'received\x20delivery\x20report\x20from',_0x32816f[_0x7295('0x4c')],util[_0x7295('0xcc')](_0x8b86c1[_0x7295('0x56')],{'showHidden':![],'depth':null}));switch(_0x32816f[_0x7295('0x4c')]){case _0x7295('0xcd'):if(_0x8b86c1[_0x7295('0x56')][_0x7295('0xce')]&&_0x8b86c1[_0x7295('0x56')][_0x7295('0x27')]){_0x5dda58=_0x8b86c1[_0x7295('0x56')][_0x7295('0x27')];return db[_0x7295('0xa1')]['find']({'where':{'messageId':_0x8b86c1[_0x7295('0x56')][_0x7295('0xce')]}});}break;case'connectel':if(_0x8b86c1['body'][_0x7295('0xcf')]&&_0x8b86c1[_0x7295('0x56')][_0x7295('0xd0')]){_0x5dda58=_0x8b86c1[_0x7295('0x56')]['statusInt'];return db['SmsMessage'][_0x7295('0x5b')]({'where':{'messageId':_0x8b86c1[_0x7295('0x56')][_0x7295('0xcf')]}});}break;case _0x7295('0xd1'):if(_0x8b86c1[_0x7295('0x56')]['message_id']&&_0x8b86c1['body']['status_code']){_0x5dda58=_0x8b86c1[_0x7295('0x56')][_0x7295('0xd2')];return db[_0x7295('0xa1')]['find']({'where':{'messageId':_0x8b86c1[_0x7295('0x56')][_0x7295('0x85')]}});}break;case'infobip':var _0x476e79=_0x8b86c1[_0x7295('0x56')][_0x7295('0x88')][0x0];if(_0x476e79[_0x7295('0x84')]&&_0x476e79[_0x7295('0x27')][_0x7295('0xd3')]==='DELIVERED'){_0x5dda58=_0x476e79[_0x7295('0x27')][_0x7295('0xd3')];return db[_0x7295('0xa1')]['find']({'where':{'messageId':_0x476e79['messageId']}});}break;case _0x7295('0x8b'):if(_0x8b86c1['body'][_0x7295('0x84')]&&_0x8b86c1[_0x7295('0x56')]['status']){_0x5dda58=_0x8b86c1[_0x7295('0x56')][_0x7295('0x27')];return db[_0x7295('0xa1')][_0x7295('0x5b')]({'where':{'messageId':_0x8b86c1[_0x7295('0x56')]['messageId']}});}break;case _0x7295('0x8d'):if(_0x8b86c1[_0x7295('0x56')][0x0][_0x7295('0x24')]['id']){_0x5dda58=_0x8b86c1[_0x7295('0x56')][0x0][_0x7295('0x4c')];return db[_0x7295('0xa1')][_0x7295('0x5b')]({'where':{'messageId':_0x8b86c1[_0x7295('0x56')][0x0][_0x7295('0x24')]['id']}});}break;case'intelepeer':if(_0x8b86c1['body'][_0x7295('0xd4')]&&_0x8b86c1[_0x7295('0x56')]['status']){_0x5dda58=_0x8b86c1['body'][_0x7295('0x27')];return db[_0x7295('0xa1')]['find']({'where':{'messageId':_0x8b86c1[_0x7295('0x56')]['redif']}});}break;}}})[_0x7295('0x31')](handleEntityNotFound(_0x3fec25,null))[_0x7295('0x31')](function(_0x1cd190){if(_0x1cd190){_0x10f49e=_0x1cd190;switch(_0x2cbfb2[_0x7295('0x4c')]){case _0x7295('0xcd'):if(_0x5dda58===_0x7295('0xd5')){return _0x10f49e[_0x7295('0x5f')]({'read':!![]});}else{logger[_0x7295('0x23')](_0x7295('0x20'),_0x7295('0x27'),_0x7295('0xcd'),util[_0x7295('0xcc')](_0x8b86c1[_0x7295('0x56')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x5dda58==='1'){return _0x10f49e[_0x7295('0x5f')]({'read':!![]});}else{logger[_0x7295('0x23')](_0x7295('0x20'),_0x7295('0x27'),'skebby',util[_0x7295('0xcc')](_0x8b86c1[_0x7295('0x56')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x8b86c1[_0x7295('0x56')][_0x7295('0xd6')]&&_0x5dda58>=0xc8&&_0x5dda58<=0xce){return _0x10f49e[_0x7295('0x5f')]({'read':!![]});}else{logger[_0x7295('0x23')](_0x7295('0x20'),_0x7295('0x27'),'clicksend',util[_0x7295('0xcc')](_0x8b86c1[_0x7295('0x56')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x3ef751=_0x8b86c1[_0x7295('0x56')]['results'][0x0];if(_0x3ef751[_0x7295('0x27')]['groupName']==='DELIVERED'){return _0x10f49e[_0x7295('0x5f')]({'read':!![]});}else{logger[_0x7295('0x23')](_0x7295('0x20'),_0x7295('0x27'),_0x7295('0x87'),util[_0x7295('0xcc')](_0x8b86c1[_0x7295('0x56')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x5dda58==_0x7295('0xd7')||_0x5dda58=='RECEIVED_BY_RECIPIENT'){return _0x10f49e['update']({'read':!![]});}else{logger[_0x7295('0x23')](_0x7295('0x20'),_0x7295('0x27'),_0x7295('0x8b'),util[_0x7295('0xcc')](_0x8b86c1[_0x7295('0x56')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x5dda58=='message-delivered'){return _0x10f49e[_0x7295('0x5f')]({'read':!![]});}else{logger[_0x7295('0x23')](_0x7295('0x20'),_0x7295('0x27'),_0x7295('0x8d'),util[_0x7295('0xcc')](_0x8b86c1[_0x7295('0x56')],{'showHidden':![],'depth':null}));}break;case _0x7295('0xd8'):if(_0x5dda58===_0x7295('0xd9')||_0x5dda58==='ACCEPTD'){return _0x10f49e[_0x7295('0x5f')]({'read':!![]});}else{logger[_0x7295('0x23')](_0x7295('0x20'),_0x7295('0x27'),_0x7295('0xd8'),util[_0x7295('0xcc')](_0x8b86c1[_0x7295('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x10f49e;}})[_0x7295('0x31')](respondWithResult(_0x3fec25,null))['catch'](handleError(_0x3fec25,null));};exports[_0x7295('0xda')]=function(_0x1754e2,_0x273f68,_0x10643a){var _0x12b5e1,_0x7a6499,_0x4581d8;return db['SmsAccount'][_0x7295('0x5b')]({'where':{'id':_0x1754e2[_0x7295('0x52')]['id']}})[_0x7295('0x31')](handleEntityNotFound(_0x273f68,null))[_0x7295('0x31')](function(_0x183603){if(_0x183603){_0x4581d8=_0x183603;logger[_0x7295('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7295('0x27'),'received\x20delivery\x20report\x20from',_0x183603[_0x7295('0x4c')],util[_0x7295('0xcc')](_0x1754e2['query'],{'showHidden':![],'depth':null}));switch(_0x183603['type']){case _0x7295('0x89'):if(_0x1754e2['query'][_0x7295('0xdb')]&&_0x1754e2[_0x7295('0x40')]['state']){_0x7a6499=_0x1754e2['query'][_0x7295('0xdc')];return db[_0x7295('0xa1')][_0x7295('0x5b')]({'where':{'messageId':_0x1754e2[_0x7295('0x40')][_0x7295('0xdb')]}});}break;}}})['then'](handleEntityNotFound(_0x273f68,null))[_0x7295('0x31')](function(_0x2d8a63){if(_0x2d8a63){_0x12b5e1=_0x2d8a63;switch(_0x4581d8[_0x7295('0x4c')]){case _0x7295('0x89'):if(_0x7a6499==='2'||_0x7a6499==='6'){return _0x12b5e1['update']({'read':!![]});}else{logger[_0x7295('0x23')](_0x7295('0x20'),_0x7295('0x27'),_0x7295('0x89'),util[_0x7295('0xcc')](_0x1754e2['query'],{'showHidden':![],'depth':null}));};break;}return _0x12b5e1;}})[_0x7295('0x31')](respondWithResult(_0x273f68,null))[_0x7295('0x25')](handleError(_0x273f68,null));};exports['addAgents']=function(_0x453ba8,_0x372d35,_0x3bc419){return db['SmsAccount'][_0x7295('0x5b')]({'where':{'id':_0x453ba8[_0x7295('0x52')]['id']}})['then'](handleEntityNotFound(_0x372d35,null))[_0x7295('0x31')](function(_0x5cc656){if(_0x5cc656){return _0x5cc656[_0x7295('0xdd')](_0x453ba8[_0x7295('0x56')][_0x7295('0x6e')],_[_0x7295('0xde')](_0x453ba8['body'],[_0x7295('0x6e'),'id'])||{})['spread'](function(_0x57ea59){for(var _0x45e186=0x0;_0x45e186<_0x453ba8[_0x7295('0x56')][_0x7295('0x6e')]['length'];_0x45e186+=0x1){socket[_0x7295('0xdf')](_0x7295('0xe0'),{'UserId':Number(_0x453ba8['body'][_0x7295('0x6e')][_0x45e186]),'SmsAccountId':Number(_0x453ba8[_0x7295('0x52')]['id'])});}return _0x57ea59;});}})['then'](respondWithResult(_0x372d35,null))['catch'](handleError(_0x372d35,null));};exports[_0x7295('0xe1')]=function(_0x16e878,_0x26290f,_0x540c6b){return db[_0x7295('0x3c')][_0x7295('0x5b')]({'where':{'id':_0x16e878[_0x7295('0x52')]['id']}})[_0x7295('0x31')](handleEntityNotFound(_0x26290f,null))[_0x7295('0x31')](function(_0x3f50fd){if(_0x3f50fd){return _0x3f50fd['removeAgents'](_0x16e878[_0x7295('0x40')][_0x7295('0x6e')])['then'](function(){if(_[_0x7295('0xe2')](_0x16e878[_0x7295('0x40')][_0x7295('0x6e')])){for(var _0x3eaa56=0x0;_0x3eaa56<_0x16e878[_0x7295('0x40')][_0x7295('0x6e')][_0x7295('0x53')];_0x3eaa56+=0x1){socket['emit'](_0x7295('0xe3'),{'UserId':Number(_0x16e878[_0x7295('0x40')]['ids'][_0x3eaa56]),'SmsAccountId':Number(_0x16e878[_0x7295('0x52')]['id'])});}}else{socket[_0x7295('0xdf')](_0x7295('0xe3'),{'UserId':Number(_0x16e878['query'][_0x7295('0x6e')]),'SmsAccountId':Number(_0x16e878[_0x7295('0x52')]['id'])});}});}})[_0x7295('0x31')](respondWithStatusCode(_0x26290f,null))['catch'](handleError(_0x26290f,null));};exports[_0x7295('0xe4')]=function(_0xde2df6,_0x262f23,_0x54c731){var _0x12f3b8={};var _0x433457={};var _0x29076b;var _0x2fd233;return db[_0x7295('0x3c')][_0x7295('0x65')]({'where':{'id':_0xde2df6[_0x7295('0x52')]['id']}})[_0x7295('0x31')](handleEntityNotFound(_0x262f23,null))[_0x7295('0x31')](function(_0x4a9bfb){if(_0x4a9bfb){_0x29076b=_0x4a9bfb;_0x433457[_0x7295('0x3f')]=_[_0x7295('0x41')](db[_0x7295('0xa5')][_0x7295('0x3d')]);_0x433457[_0x7295('0x40')]=_[_0x7295('0x41')](_0xde2df6['query']);_0x433457[_0x7295('0x42')]=_[_0x7295('0x43')](_0x433457[_0x7295('0x3f')],_0x433457[_0x7295('0x40')]);_0x12f3b8[_0x7295('0x44')]=_[_0x7295('0x43')](_0x433457[_0x7295('0x3f')],qs[_0x7295('0x45')](_0xde2df6[_0x7295('0x40')][_0x7295('0x45')]));_0x12f3b8[_0x7295('0x44')]=_0x12f3b8[_0x7295('0x44')][_0x7295('0x53')]?_0x12f3b8[_0x7295('0x44')]:_0x433457[_0x7295('0x3f')];_0x12f3b8[_0x7295('0x47')]=qs[_0x7295('0x48')](_0xde2df6[_0x7295('0x40')][_0x7295('0x48')]);_0x12f3b8[_0x7295('0x49')]=qs[_0x7295('0x42')](_[_0x7295('0x4a')](_0xde2df6['query'],_0x433457[_0x7295('0x42')]));if(_0xde2df6[_0x7295('0x40')][_0x7295('0x67')]){_0x12f3b8[_0x7295('0x49')]=_[_0x7295('0x4b')](_0x12f3b8[_0x7295('0x49')],{'$or':_[_0x7295('0x3b')](_0x12f3b8['attributes'],function(_0x19b9aa){var _0x226a0f={};_0x226a0f[_0x19b9aa]={'$like':'%'+_0xde2df6[_0x7295('0x40')][_0x7295('0x67')]+'%'};return _0x226a0f;})});}_0x12f3b8=_[_0x7295('0x4b')]({},_0x12f3b8,_0xde2df6[_0x7295('0x4e')]);return _0x29076b[_0x7295('0xe4')](_0x12f3b8);}})[_0x7295('0x31')](function(_0x59d2e2){if(_0x59d2e2){_0x2fd233=_0x59d2e2[_0x7295('0x53')];if(!_0xde2df6['query']['hasOwnProperty'](_0x7295('0x66'))){_0x12f3b8[_0x7295('0x2a')]=qs[_0x7295('0x2a')](_0xde2df6['query'][_0x7295('0x2a')]);_0x12f3b8[_0x7295('0x2d')]=qs[_0x7295('0x2d')](_0xde2df6['query']['offset']);}return _0x29076b['getAgents'](_0x12f3b8);}})['then'](function(_0x312eb2){if(_0x312eb2){return _0x312eb2?{'count':_0x2fd233,'rows':_0x312eb2}:null;}})[_0x7295('0x31')](respondWithResult(_0x262f23,null))[_0x7295('0x25')](handleError(_0x262f23,null));}; \ No newline at end of file +var _0xb096=['inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','destroy','SmsAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','show','params','Pause','keys','include','options','find','create','body','user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','SmsAccountId','getDispositions','findOne','Disposition','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','From','Body','skebby','text','connectel','clicksend','messageId','message_id','plivo','Text','MessageUUID','infobip','results','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','SmsInteraction','spread','interaction','created','autoclose','push','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','unshift','queueId','queue','waitForTheAssignedQueue','Start','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','set','Content-Type','text/xml','send','\x0a','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','priority','finally','sendStatus','getApplications','Contact','Owner','internal','Tag','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','requestid','statusInt','status_code','groupName','redif','DELIVERED'];(function(_0x4695ba,_0x5a7f2a){var _0x524b7d=function(_0xfc9707){while(--_0xfc9707){_0x4695ba['push'](_0x4695ba['shift']());}};_0x524b7d(++_0x5a7f2a);}(_0xb096,0xf5));var _0x6b09=function(_0x20a28a,_0x1ba379){_0x20a28a=_0x20a28a-0x0;var _0x4b55b0=_0xb096[_0x20a28a];return _0x4b55b0;};'use strict';var emlformat=require(_0x6b09('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b09('0x1'));var jsonpatch=require(_0x6b09('0x2'));var rp=require(_0x6b09('0x3'));var moment=require(_0x6b09('0x4'));var BPromise=require(_0x6b09('0x5'));var Mustache=require(_0x6b09('0x6'));var util=require('util');var path=require(_0x6b09('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b09('0x8'));var _=require(_0x6b09('0x9'));var squel=require('squel');var crypto=require(_0x6b09('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6b09('0xb'));var querystring=require(_0x6b09('0xc'));var Papa=require('papaparse');var Redis=require(_0x6b09('0xd'));var authService=require(_0x6b09('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6b09('0xf'));var hardwareService=require(_0x6b09('0x10'));var logger=require('../../config/logger')(_0x6b09('0x11'));var utils=require(_0x6b09('0x12'));var config=require(_0x6b09('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6b09('0x14'))['db'];config['redis']=_[_0x6b09('0x15')](config[_0x6b09('0x16')],{'host':_0x6b09('0x17'),'port':0x18eb});var socket=require(_0x6b09('0x18'))(new Redis(config[_0x6b09('0x16')]));require(_0x6b09('0x19'))[_0x6b09('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6b09('0x1b')][_0x6b09('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x321866,_0x3cd918,_0x3fa0b4,_0x44be53){return new BPromise(function(_0x388f2f,_0x14da98){var _0x55e26d=_0x44be53||client;return _0x55e26d[_0x6b09('0x1d')](_0x321866,_0x3fa0b4)[_0x6b09('0x1e')](function(_0x2baf37){logger[_0x6b09('0x1f')](_0x6b09('0x20'),_0x3cd918,_0x6b09('0x21'));logger[_0x6b09('0x22')](_0x6b09('0x23'),_0x3cd918,'request\x20sent',JSON[_0x6b09('0x24')](_0x2baf37));if(_0x2baf37[_0x6b09('0x25')]){if(_0x2baf37[_0x6b09('0x25')][_0x6b09('0x26')]===0x1f4){logger['error'](_0x6b09('0x20'),_0x3cd918,_0x2baf37[_0x6b09('0x25')]['message']);return _0x14da98(_0x2baf37[_0x6b09('0x25')][_0x6b09('0x27')]);}logger[_0x6b09('0x25')]('SmsAccount,\x20%s,\x20%s',_0x3cd918,_0x2baf37['error'][_0x6b09('0x27')]);return _0x388f2f(_0x2baf37[_0x6b09('0x25')][_0x6b09('0x27')]);}else{logger[_0x6b09('0x1f')](_0x6b09('0x20'),_0x3cd918,_0x6b09('0x21'));_0x388f2f(_0x2baf37[_0x6b09('0x28')][_0x6b09('0x27')]);}})[_0x6b09('0x29')](function(_0x426df3){logger[_0x6b09('0x25')]('SmsAccount,\x20%s,\x20%s',_0x3cd918,_0x426df3);_0x14da98(_0x426df3);});});}function respondWithStatusCode(_0x47f31a,_0x189c00){_0x189c00=_0x189c00||0xcc;return function(_0x3697ec){if(_0x3697ec){return _0x47f31a['sendStatus'](_0x189c00);}return _0x47f31a[_0x6b09('0x2a')](_0x189c00)[_0x6b09('0x2b')]();};}function respondWithResult(_0x6a90c0,_0x5e9f5f){_0x5e9f5f=_0x5e9f5f||0xc8;return function(_0x46abe3){if(_0x46abe3){return _0x6a90c0[_0x6b09('0x2a')](_0x5e9f5f)[_0x6b09('0x2c')](_0x46abe3);}};}function respondWithFilteredResult(_0x1b60c2,_0x10a6c9){return function(_0x5afc17){if(_0x5afc17){var _0x4cff9b=typeof _0x10a6c9[_0x6b09('0x2d')]===_0x6b09('0x2e')&&typeof _0x10a6c9['limit']===_0x6b09('0x2e');var _0x37ad59=_0x5afc17[_0x6b09('0x2f')];var _0xed564=_0x4cff9b?0x0:_0x10a6c9[_0x6b09('0x2d')];var _0x21346f=_0x4cff9b?_0x5afc17[_0x6b09('0x2f')]:_0x10a6c9[_0x6b09('0x2d')]+_0x10a6c9['limit'];var _0xcd8bd4;if(_0x21346f>=_0x37ad59){_0x21346f=_0x37ad59;_0xcd8bd4=0xc8;}else{_0xcd8bd4=0xce;}_0x1b60c2['status'](_0xcd8bd4);return _0x1b60c2['set'](_0x6b09('0x30'),_0xed564+'-'+_0x21346f+'/'+_0x37ad59)[_0x6b09('0x2c')](_0x5afc17);}return null;};}function patchUpdates(_0x4d79a8){return function(_0x58e64d){try{jsonpatch[_0x6b09('0x31')](_0x58e64d,_0x4d79a8,!![]);}catch(_0x3550da){return BPromise[_0x6b09('0x32')](_0x3550da);}return _0x58e64d[_0x6b09('0x33')]();};}function saveUpdates(_0x443c69,_0x37c56f){return function(_0x361cd0){if(_0x361cd0){return _0x361cd0['update'](_0x443c69)['then'](function(_0x39e56e){return _0x39e56e;});}return null;};}function removeEntity(_0x1392d0,_0x430cd3){return function(_0x2061b4){if(_0x2061b4){return _0x2061b4[_0x6b09('0x34')]()[_0x6b09('0x1e')](function(){var _0x4bcf9e=_0x2061b4['get']({'plain':!![]});var _0x14e87c=_0x6b09('0x35');return db[_0x6b09('0x36')][_0x6b09('0x34')]({'where':{'type':_0x14e87c,'resourceId':_0x4bcf9e['id']}})[_0x6b09('0x1e')](function(){return _0x2061b4;});})['then'](function(){_0x1392d0[_0x6b09('0x2a')](0xcc)[_0x6b09('0x2b')]();});}};}function handleEntityNotFound(_0x32f3a1,_0x53150a){return function(_0x29755b){if(!_0x29755b){_0x32f3a1['sendStatus'](0x194);}return _0x29755b;};}function handleError(_0x2c95bc,_0x27d31f){_0x27d31f=_0x27d31f||0x1f4;return function(_0x45862d){logger[_0x6b09('0x25')](_0x45862d[_0x6b09('0x37')]);if(_0x45862d[_0x6b09('0x38')]){delete _0x45862d['name'];}_0x2c95bc[_0x6b09('0x2a')](_0x27d31f)['send'](_0x45862d);};}exports[_0x6b09('0x39')]=function(_0x446812,_0x4966cc){var _0x31fa91={'include':[{'model':db['Pause'],'as':_0x6b09('0x3a')}]},_0x3688b6={},_0x12c675={'count':0x0,'rows':[]};var _0x200512=_[_0x6b09('0x3b')](db[_0x6b09('0x3c')][_0x6b09('0x3d')],function(_0x16758c){return{'name':_0x16758c[_0x6b09('0x3e')],'type':_0x16758c[_0x6b09('0x3f')][_0x6b09('0x40')]};});_0x3688b6[_0x6b09('0x41')]=_[_0x6b09('0x3b')](_0x200512,'name');_0x3688b6[_0x6b09('0x42')]=_['keys'](_0x446812['query']);_0x3688b6[_0x6b09('0x43')]=_[_0x6b09('0x44')](_0x3688b6[_0x6b09('0x41')],_0x3688b6['query']);_0x31fa91[_0x6b09('0x45')]=_[_0x6b09('0x44')](_0x3688b6[_0x6b09('0x41')],qs[_0x6b09('0x46')](_0x446812[_0x6b09('0x42')][_0x6b09('0x46')]));_0x31fa91[_0x6b09('0x45')]=_0x31fa91['attributes'][_0x6b09('0x47')]?_0x31fa91['attributes']:_0x3688b6['model'];if(!_0x446812[_0x6b09('0x42')][_0x6b09('0x48')](_0x6b09('0x49'))){_0x31fa91[_0x6b09('0x4a')]=qs[_0x6b09('0x4a')](_0x446812[_0x6b09('0x42')][_0x6b09('0x4a')]);_0x31fa91[_0x6b09('0x2d')]=qs[_0x6b09('0x2d')](_0x446812[_0x6b09('0x42')][_0x6b09('0x2d')]);}_0x31fa91[_0x6b09('0x4b')]=qs[_0x6b09('0x4c')](_0x446812[_0x6b09('0x42')]['sort']);_0x31fa91['where']=qs[_0x6b09('0x43')](_[_0x6b09('0x4d')](_0x446812[_0x6b09('0x42')],_0x3688b6[_0x6b09('0x43')]),_0x200512);if(_0x446812['query'][_0x6b09('0x4e')]){_0x31fa91[_0x6b09('0x4f')]=_[_0x6b09('0x50')](_0x31fa91['where'],{'$or':_['map'](_0x200512,function(_0x2ceb5b){if(_0x2ceb5b[_0x6b09('0x3f')]!==_0x6b09('0x51')){var _0x41b1a0={};_0x41b1a0[_0x2ceb5b['name']]={'$like':'%'+_0x446812[_0x6b09('0x42')][_0x6b09('0x4e')]+'%'};return _0x41b1a0;}})});}_0x31fa91=_[_0x6b09('0x50')]({},_0x31fa91,_0x446812['options']);var _0x3fa507={'where':_0x31fa91[_0x6b09('0x4f')]};return db[_0x6b09('0x3c')][_0x6b09('0x2f')](_0x3fa507)[_0x6b09('0x1e')](function(_0x28067e){_0x12c675[_0x6b09('0x2f')]=_0x28067e;if(_0x446812[_0x6b09('0x42')][_0x6b09('0x52')]){_0x31fa91['include']=[{'all':!![]}];}return db[_0x6b09('0x3c')]['findAll'](_0x31fa91);})[_0x6b09('0x1e')](function(_0x9d66dd){_0x12c675[_0x6b09('0x53')]=_0x9d66dd;return _0x12c675;})['then'](respondWithFilteredResult(_0x4966cc,_0x31fa91))['catch'](handleError(_0x4966cc,null));};exports[_0x6b09('0x54')]=function(_0x8114d7,_0x22f3c3){var _0x33141b={'raw':![],'where':{'id':_0x8114d7[_0x6b09('0x55')]['id']},'include':[{'model':db[_0x6b09('0x56')],'as':_0x6b09('0x3a')}]},_0x5550f6={};_0x5550f6['model']=_[_0x6b09('0x57')](db['SmsAccount'][_0x6b09('0x3d')]);_0x5550f6[_0x6b09('0x42')]=_[_0x6b09('0x57')](_0x8114d7[_0x6b09('0x42')]);_0x5550f6['filters']=_[_0x6b09('0x44')](_0x5550f6[_0x6b09('0x41')],_0x5550f6[_0x6b09('0x42')]);_0x33141b['attributes']=_['intersection'](_0x5550f6[_0x6b09('0x41')],qs[_0x6b09('0x46')](_0x8114d7[_0x6b09('0x42')][_0x6b09('0x46')]));_0x33141b[_0x6b09('0x45')]=_0x33141b[_0x6b09('0x45')][_0x6b09('0x47')]?_0x33141b['attributes']:_0x5550f6[_0x6b09('0x41')];if(_0x8114d7[_0x6b09('0x42')][_0x6b09('0x52')]){_0x33141b[_0x6b09('0x58')]=[{'all':!![]}];}_0x33141b=_[_0x6b09('0x50')]({},_0x33141b,_0x8114d7[_0x6b09('0x59')]);return db[_0x6b09('0x3c')][_0x6b09('0x5a')](_0x33141b)['then'](handleEntityNotFound(_0x22f3c3,null))[_0x6b09('0x1e')](respondWithResult(_0x22f3c3,null))['catch'](handleError(_0x22f3c3,null));};exports[_0x6b09('0x5b')]=function(_0x3c264e,_0x310af2){return db[_0x6b09('0x3c')][_0x6b09('0x5b')](_0x3c264e[_0x6b09('0x5c')],{})[_0x6b09('0x1e')](function(_0x3e3130){var _0x14186e=_0x3c264e[_0x6b09('0x5d')][_0x6b09('0x5e')]({'plain':!![]});if(!_0x14186e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14186e['role']===_0x6b09('0x5d')){var _0x322f7c=_0x3e3130[_0x6b09('0x5e')]({'plain':!![]});var _0x36e6eb=_0x6b09('0x35');return db[_0x6b09('0x5f')][_0x6b09('0x5a')]({'where':{'name':_0x36e6eb,'userProfileId':_0x14186e[_0x6b09('0x60')]},'raw':!![]})['then'](function(_0xfae5ed){if(_0xfae5ed&&_0xfae5ed['autoAssociation']===0x0){return db[_0x6b09('0x36')]['create']({'name':_0x322f7c[_0x6b09('0x38')],'resourceId':_0x322f7c['id'],'type':_0xfae5ed['name'],'sectionId':_0xfae5ed['id']},{})[_0x6b09('0x1e')](function(){return _0x3e3130;});}else{return _0x3e3130;}})[_0x6b09('0x29')](function(_0x368f6e){logger[_0x6b09('0x25')](_0x6b09('0x61'),_0x368f6e);throw _0x368f6e;});}return _0x3e3130;})['then'](respondWithResult(_0x310af2,0xc9))['catch'](handleError(_0x310af2,null));};exports[_0x6b09('0x62')]=function(_0x25388b,_0x2845f8){if(_0x25388b[_0x6b09('0x5c')]['id']){delete _0x25388b[_0x6b09('0x5c')]['id'];}return db[_0x6b09('0x3c')][_0x6b09('0x5a')]({'where':{'id':_0x25388b[_0x6b09('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x6b09('0x3a')}]})[_0x6b09('0x1e')](handleEntityNotFound(_0x2845f8,null))[_0x6b09('0x1e')](saveUpdates(_0x25388b[_0x6b09('0x5c')],null))[_0x6b09('0x1e')](respondWithResult(_0x2845f8,null))[_0x6b09('0x29')](handleError(_0x2845f8,null));};exports['destroy']=function(_0x5b8f9d,_0x156eef){return db[_0x6b09('0x3c')]['find']({'where':{'id':_0x5b8f9d[_0x6b09('0x55')]['id']}})['then'](handleEntityNotFound(_0x156eef,null))[_0x6b09('0x1e')](removeEntity(_0x156eef,null))[_0x6b09('0x29')](handleError(_0x156eef,null));};exports[_0x6b09('0x63')]=function(_0x3d7806,_0x4f9adb){return db['SmsAccount'][_0x6b09('0x63')]()[_0x6b09('0x1e')](respondWithResult(_0x4f9adb,null))[_0x6b09('0x29')](handleError(_0x4f9adb,null));};exports['addDisposition']=function(_0x248ba4,_0x21948a,_0x359a84){if(_0x248ba4[_0x6b09('0x5c')]['id']){delete _0x248ba4[_0x6b09('0x5c')]['id'];}return db[_0x6b09('0x3c')][_0x6b09('0x5a')]({'where':{'id':_0x248ba4[_0x6b09('0x55')]['id']}})[_0x6b09('0x1e')](handleEntityNotFound(_0x21948a,null))['then'](function(_0x47cee3){if(_0x47cee3){_0x248ba4[_0x6b09('0x5c')][_0x6b09('0x64')]=_0x47cee3['id'];return db['Disposition']['create'](_0x248ba4['body']);}})[_0x6b09('0x1e')](respondWithResult(_0x21948a,null))[_0x6b09('0x29')](handleError(_0x21948a,null));};exports[_0x6b09('0x65')]=function(_0x33a90d,_0x2940ec,_0x213f81){var _0x4b451b={'raw':![],'where':{}};var _0x197a88={};var _0xacf1e2={'count':0x0,'rows':[]};return db[_0x6b09('0x3c')][_0x6b09('0x66')]({'where':{'id':_0x33a90d[_0x6b09('0x55')]['id']}})[_0x6b09('0x1e')](handleEntityNotFound(_0x2940ec,null))[_0x6b09('0x1e')](function(_0x465052){if(_0x465052){_0x197a88['model']=_[_0x6b09('0x57')](db[_0x6b09('0x67')][_0x6b09('0x3d')]);_0x197a88['query']=_['keys'](_0x33a90d[_0x6b09('0x42')]);_0x197a88['filters']=_[_0x6b09('0x44')](_0x197a88['model'],_0x197a88[_0x6b09('0x42')]);_0x4b451b['attributes']=_['intersection'](_0x197a88['model'],qs['fields'](_0x33a90d[_0x6b09('0x42')][_0x6b09('0x46')]));_0x4b451b[_0x6b09('0x45')]=_0x4b451b[_0x6b09('0x45')]['length']?_0x4b451b['attributes']:_0x197a88[_0x6b09('0x41')];if(!_0x33a90d[_0x6b09('0x42')][_0x6b09('0x48')]('nolimit')){_0x4b451b[_0x6b09('0x4a')]=qs[_0x6b09('0x4a')](_0x33a90d[_0x6b09('0x42')][_0x6b09('0x4a')]);_0x4b451b[_0x6b09('0x2d')]=qs['offset'](_0x33a90d['query']['offset']);}_0x4b451b[_0x6b09('0x4b')]=qs['sort'](_0x33a90d['query']['sort']);_0x4b451b[_0x6b09('0x4f')]=qs['filters'](_[_0x6b09('0x4d')](_0x33a90d[_0x6b09('0x42')],_0x197a88[_0x6b09('0x43')]));_0x4b451b[_0x6b09('0x4f')]['SmsAccountId']=_0x465052['id'];if(_0x33a90d[_0x6b09('0x42')][_0x6b09('0x4e')]){_0x4b451b[_0x6b09('0x4f')]=_['merge'](_0x4b451b[_0x6b09('0x4f')],{'$or':_[_0x6b09('0x3b')](_0x4b451b[_0x6b09('0x45')],function(_0x31d0c0){var _0x5b958b={};_0x5b958b[_0x31d0c0]={'$like':'%'+_0x33a90d[_0x6b09('0x42')][_0x6b09('0x4e')]+'%'};return _0x5b958b;})});}_0x4b451b=_['merge']({},_0x4b451b,_0x33a90d[_0x6b09('0x59')]);return db[_0x6b09('0x67')][_0x6b09('0x2f')]({'where':_0x4b451b['where']})[_0x6b09('0x1e')](function(_0x1e2609){_0xacf1e2[_0x6b09('0x2f')]=_0x1e2609;if(_0x33a90d[_0x6b09('0x42')][_0x6b09('0x52')]){_0x4b451b[_0x6b09('0x58')]=[{'all':!![]}];}return db['Disposition'][_0x6b09('0x68')](_0x4b451b);})[_0x6b09('0x1e')](function(_0x3dc101){_0xacf1e2[_0x6b09('0x53')]=_0x3dc101;return _0xacf1e2;});}})[_0x6b09('0x1e')](respondWithFilteredResult(_0x2940ec,_0x4b451b))[_0x6b09('0x29')](handleError(_0x2940ec,null));};exports[_0x6b09('0x69')]=function(_0xc930fb,_0x3a37d1,_0x313cc9){return db['SmsAccount'][_0x6b09('0x5a')]({'where':{'id':_0xc930fb[_0x6b09('0x55')]['id']}})[_0x6b09('0x1e')](handleEntityNotFound(_0x3a37d1,null))[_0x6b09('0x1e')](function(_0x2b8eda){if(_0x2b8eda){return _0x2b8eda[_0x6b09('0x69')](_0xc930fb[_0x6b09('0x42')][_0x6b09('0x6a')]);}})[_0x6b09('0x1e')](respondWithStatusCode(_0x3a37d1,null))['catch'](handleError(_0x3a37d1,null));};exports[_0x6b09('0x6b')]=function(_0x1abb54,_0x344c7d,_0xbd26f6){if(_0x1abb54[_0x6b09('0x5c')]['id']){delete _0x1abb54['body']['id'];}return db[_0x6b09('0x3c')][_0x6b09('0x5a')]({'where':{'id':_0x1abb54['params']['id']}})['then'](handleEntityNotFound(_0x344c7d,null))[_0x6b09('0x1e')](function(_0x54612a){if(_0x54612a){_0x1abb54[_0x6b09('0x5c')][_0x6b09('0x64')]=_0x54612a['id'];return db['CannedAnswer']['create'](_0x1abb54[_0x6b09('0x5c')]);}})[_0x6b09('0x1e')](respondWithResult(_0x344c7d,null))['catch'](handleError(_0x344c7d,null));};exports[_0x6b09('0x6c')]=function(_0x5e9fa3,_0x20438d,_0x5d5388){var _0x1d1d63={'raw':![],'where':{}};var _0xd9b061={};var _0x42a59b={'count':0x0,'rows':[]};return db['SmsAccount'][_0x6b09('0x66')]({'where':{'id':_0x5e9fa3[_0x6b09('0x55')]['id']}})['then'](handleEntityNotFound(_0x20438d,null))[_0x6b09('0x1e')](function(_0x387560){if(_0x387560){_0xd9b061['model']=_['keys'](db[_0x6b09('0x6d')][_0x6b09('0x3d')]);_0xd9b061[_0x6b09('0x42')]=_['keys'](_0x5e9fa3[_0x6b09('0x42')]);_0xd9b061[_0x6b09('0x43')]=_[_0x6b09('0x44')](_0xd9b061['model'],_0xd9b061['query']);_0x1d1d63[_0x6b09('0x45')]=_[_0x6b09('0x44')](_0xd9b061[_0x6b09('0x41')],qs[_0x6b09('0x46')](_0x5e9fa3[_0x6b09('0x42')][_0x6b09('0x46')]));_0x1d1d63[_0x6b09('0x45')]=_0x1d1d63['attributes'][_0x6b09('0x47')]?_0x1d1d63[_0x6b09('0x45')]:_0xd9b061[_0x6b09('0x41')];if(!_0x5e9fa3[_0x6b09('0x42')]['hasOwnProperty'](_0x6b09('0x49'))){_0x1d1d63[_0x6b09('0x4a')]=qs[_0x6b09('0x4a')](_0x5e9fa3[_0x6b09('0x42')][_0x6b09('0x4a')]);_0x1d1d63['offset']=qs[_0x6b09('0x2d')](_0x5e9fa3[_0x6b09('0x42')]['offset']);}_0x1d1d63[_0x6b09('0x4b')]=qs['sort'](_0x5e9fa3[_0x6b09('0x42')][_0x6b09('0x4c')]);_0x1d1d63[_0x6b09('0x4f')]=qs[_0x6b09('0x43')](_[_0x6b09('0x4d')](_0x5e9fa3[_0x6b09('0x42')],_0xd9b061[_0x6b09('0x43')]));_0x1d1d63[_0x6b09('0x4f')][_0x6b09('0x64')]=_0x387560['id'];if(_0x5e9fa3['query'][_0x6b09('0x4e')]){_0x1d1d63[_0x6b09('0x4f')]=_[_0x6b09('0x50')](_0x1d1d63[_0x6b09('0x4f')],{'$or':_[_0x6b09('0x3b')](_0x1d1d63[_0x6b09('0x45')],function(_0x520242){var _0x4a6576={};_0x4a6576[_0x520242]={'$like':'%'+_0x5e9fa3[_0x6b09('0x42')][_0x6b09('0x4e')]+'%'};return _0x4a6576;})});}_0x1d1d63=_[_0x6b09('0x50')]({},_0x1d1d63,_0x5e9fa3[_0x6b09('0x59')]);return db[_0x6b09('0x6d')][_0x6b09('0x2f')]({'where':_0x1d1d63[_0x6b09('0x4f')]})[_0x6b09('0x1e')](function(_0x575a2a){_0x42a59b[_0x6b09('0x2f')]=_0x575a2a;if(_0x5e9fa3[_0x6b09('0x42')][_0x6b09('0x52')]){_0x1d1d63['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x1d1d63);})[_0x6b09('0x1e')](function(_0x2d91d0){_0x42a59b[_0x6b09('0x53')]=_0x2d91d0;return _0x42a59b;});}})[_0x6b09('0x1e')](respondWithFilteredResult(_0x20438d,_0x1d1d63))[_0x6b09('0x29')](handleError(_0x20438d,null));};exports[_0x6b09('0x6e')]=function(_0x576336,_0x1f2b33,_0xc6ca82){return db[_0x6b09('0x3c')][_0x6b09('0x5a')]({'where':{'id':_0x576336[_0x6b09('0x55')]['id']}})[_0x6b09('0x1e')](handleEntityNotFound(_0x1f2b33,null))[_0x6b09('0x1e')](function(_0x1e1775){if(_0x1e1775){return _0x1e1775[_0x6b09('0x6e')](_0x576336[_0x6b09('0x42')][_0x6b09('0x6a')]);}})[_0x6b09('0x1e')](respondWithStatusCode(_0x1f2b33,null))[_0x6b09('0x29')](handleError(_0x1f2b33,null));};exports[_0x6b09('0x6f')]=function(_0x2f292e,_0x5c79e9,_0x5b7063){var _0x1983ef={'channel':_0x6b09('0x70')};var _0x528e97=[];var _0x4dc0ad=[];var _0x1dc001={};return db['SmsAccount'][_0x6b09('0x5a')]({'where':{'id':_0x2f292e[_0x6b09('0x55')]['id']},'include':[{'model':db[_0x6b09('0x71')],'as':_0x6b09('0x72')}]})[_0x6b09('0x1e')](handleEntityNotFound(_0x5c79e9,null))[_0x6b09('0x1e')](function(_0x25d567){_0x1983ef[_0x6b09('0x73')]=_0x25d567;_0x1983ef[_0x6b09('0x74')]=_[_0x6b09('0x75')](_0x25d567[_0x6b09('0x72')],['priority'],['asc']);if(_0x1983ef[_0x6b09('0x73')][_0x6b09('0x72')]){delete _0x1983ef[_0x6b09('0x73')]['Applications'];}return db[_0x6b09('0x76')][_0x6b09('0x63')]();})[_0x6b09('0x1e')](function(_0x3cb8d4){if(!_0x3cb8d4){throw new db[(_0x6b09('0x77'))][(_0x6b09('0x78'))]('no\x20available\x20attributes');}_0x528e97=_[_0x6b09('0x79')](_[_0x6b09('0x57')](_0x3cb8d4),[_0x6b09('0x7a'),_0x6b09('0x7b')]);_0x4dc0ad=_['difference'](_[_0x6b09('0x57')](_0x3cb8d4),[_0x6b09('0x7a'),'updatedAt',_0x6b09('0x7c'),_0x6b09('0x7d')]);_0x1983ef[_0x6b09('0x5c')]={'mapKey':_0x6b09('0x7e')};if(_0x1983ef[_0x6b09('0x73')][_0x6b09('0x3f')]){switch(_0x1983ef['account'][_0x6b09('0x3f')]){case'twilio':_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x7f')]=_0x2f292e[_0x6b09('0x5c')][_0x6b09('0x80')];_0x1983ef['body'][_0x6b09('0x5c')]=_0x2f292e[_0x6b09('0x5c')][_0x6b09('0x81')];_0x1983ef[_0x6b09('0x5c')]['messageId']=_0x2f292e[_0x6b09('0x5c')]['MessageSid'];break;case _0x6b09('0x82'):_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x7f')]='+'+_0x2f292e[_0x6b09('0x5c')]['sender'];_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x5c')]=_0x2f292e[_0x6b09('0x5c')][_0x6b09('0x83')];break;case _0x6b09('0x84'):_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x7f')]=_0x2f292e[_0x6b09('0x5c')]['from'];_0x1983ef['body'][_0x6b09('0x5c')]=_0x2f292e[_0x6b09('0x5c')]['message'];break;case _0x6b09('0x85'):_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x7f')]=_0x2f292e[_0x6b09('0x5c')]['from'];_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x5c')]=_0x2f292e[_0x6b09('0x5c')][_0x6b09('0x5c')];_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x86')]=_0x2f292e[_0x6b09('0x5c')][_0x6b09('0x87')];break;case _0x6b09('0x88'):_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x7f')]=_0x2f292e[_0x6b09('0x5c')]['From'];_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x5c')]=_0x2f292e[_0x6b09('0x5c')][_0x6b09('0x89')];_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x86')]=_0x2f292e[_0x6b09('0x5c')][_0x6b09('0x8a')];break;case _0x6b09('0x8b'):_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x7f')]='+'+_0x2f292e[_0x6b09('0x5c')][_0x6b09('0x8c')][0x0][_0x6b09('0x7f')];_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x5c')]=_0x2f292e[_0x6b09('0x5c')][_0x6b09('0x8c')][0x0][_0x6b09('0x83')];_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x86')]=_0x2f292e[_0x6b09('0x5c')]['results'][0x0][_0x6b09('0x86')];break;case _0x6b09('0x8d'):_0x1983ef[_0x6b09('0x5c')]['from']=_0x2f292e[_0x6b09('0x5c')]['originatingAddress'];_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x5c')]=_0x2f292e[_0x6b09('0x5c')][_0x6b09('0x8e')][_0x6b09('0x27')];break;case _0x6b09('0x8f'):_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x7f')]=_0x2f292e['body'][_0x6b09('0x90')];_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x5c')]=_0x2f292e[_0x6b09('0x5c')][_0x6b09('0x83')];_0x1983ef['body'][_0x6b09('0x86')]=_0x2f292e[_0x6b09('0x5c')][_0x6b09('0x91')];break;case _0x6b09('0x92'):_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x86')]=_0x2f292e[_0x6b09('0x5c')][0x0][_0x6b09('0x27')]['id'];_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x7f')]=_0x2f292e[_0x6b09('0x5c')][0x0]['message']['from'];_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x5c')]=_0x2f292e[_0x6b09('0x5c')][0x0][_0x6b09('0x27')][_0x6b09('0x83')];break;case _0x6b09('0x93'):_0x1983ef[_0x6b09('0x5c')]['from']=_0x2f292e[_0x6b09('0x5c')]['from'];_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x5c')]=_0x2f292e[_0x6b09('0x5c')][_0x6b09('0x27')];_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x86')]=_0x2f292e[_0x6b09('0x5c')]['refid'];break;}}if(_0x1983ef[_0x6b09('0x5c')]['id']){delete _0x1983ef[_0x6b09('0x5c')]['id'];}if(_['isNil'](_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x7f')])){throw new db[(_0x6b09('0x77'))]['ValidationError'](_0x6b09('0x94'));}if(_['isNil'](_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x5c')])||_0x1983ef['body']['body']===''){throw new db[(_0x6b09('0x77'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6b09('0x95')](_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x96')])){throw new db[(_0x6b09('0x77'))]['ValidationError'](_0x6b09('0x97')+_0x4dc0ad);}if(!_[_0x6b09('0x98')](_0x4dc0ad,_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x96')])){throw new db[(_0x6b09('0x77'))][(_0x6b09('0x78'))](_0x6b09('0x99')+_0x4dc0ad);}_0x1dc001[_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x96')]]=_0x1983ef[_0x6b09('0x5c')]['from'];return db[_0x6b09('0x9a')]['find']({'where':{'id':_0x1983ef['account'][_0x6b09('0x7d')]},'include':[{'model':db[_0x6b09('0x76')],'as':_0x6b09('0x9b'),'where':_0x1dc001,'limit':0x1,'order':[[_0x6b09('0x7b'),_0x6b09('0x9c')]]}]});})['then'](handleEntityNotFound(_0x5c79e9,null))['then'](function(_0x4e0014){if(_0x4e0014){_0x1983ef[_0x6b09('0x9d')]=_[_0x6b09('0x9e')](_0x4e0014,[_0x6b09('0x9b')]);if(_0x4e0014[_0x6b09('0x9b')][_0x6b09('0x47')]){return _0x4e0014[_0x6b09('0x9b')][0x0];}var _0x12c221=_[_0x6b09('0x15')](_0x1983ef[_0x6b09('0x5c')],{'firstName':_0x1983ef['body'][_0x6b09('0x7f')],'ListId':_0x4e0014['id']});_0x12c221[_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x96')]]=_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x7f')];return db[_0x6b09('0x76')][_0x6b09('0x5b')](_0x12c221,{'fields':_0x528e97,'raw':!![]});}})[_0x6b09('0x1e')](handleEntityNotFound(_0x5c79e9,null))[_0x6b09('0x1e')](function(_0x3a9e37){if(_0x3a9e37){_0x1983ef['contact']=_0x3a9e37;var _0x3b5f74={'ContactId':_0x3a9e37['id'],'phone':_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x7f')],'SmsAccountId':_0x2f292e[_0x6b09('0x55')]['id']};var _0x21570c={'ContactId':_0x3a9e37['id'],'SmsAccountId':_0x2f292e[_0x6b09('0x55')]['id'],'closed':![]};return db[_0x6b09('0x9f')][_0x6b09('0x5a')]({'where':_0x21570c})[_0x6b09('0x1e')](function(_0x59d4d8){if(_0x59d4d8){return[_0x59d4d8,![]];}return db[_0x6b09('0x9f')][_0x6b09('0x5b')](_0x3b5f74)[_0x6b09('0x1e')](function(_0x5ff073){return[_0x5ff073,!![]];});});}})[_0x6b09('0xa0')](function(_0x4eee4d,_0x31e1b3){_0x1983ef[_0x6b09('0xa1')]=_0x4eee4d[_0x6b09('0x5e')]({'plain':!![]});_0x1983ef[_0x6b09('0xa1')][_0x6b09('0xa2')]=![];if(_0x31e1b3){if(_0x1983ef[_0x6b09('0x73')][_0x6b09('0xa3')]){_0x1983ef['applications'][_0x6b09('0xa4')]({'id':0x0,'priority':_0x1983ef['applications'][_0x6b09('0x47')]+0x1,'app':'close','appdata':_0x6b09('0xa5'),'interval':_0x6b09('0xa6')});}_0x1983ef[_0x6b09('0xa1')][_0x6b09('0xa2')]=!![];}return db[_0x6b09('0xa7')]['create']({'phone':_0x1983ef['body'][_0x6b09('0x7f')],'messageId':_0x1983ef[_0x6b09('0x5c')][_0x6b09('0x86')],'body':_0x1983ef['body'][_0x6b09('0x5c')],'SmsAccountId':_0x2f292e[_0x6b09('0x55')]['id'],'SmsInteractionId':_0x4eee4d['id'],'direction':'in','ContactId':_0x4eee4d['ContactId'],'AttachmentId':_0x1983ef[_0x6b09('0x5c')][_0x6b09('0xa8')]});})[_0x6b09('0x1e')](function(_0x3b8a82){_0x1983ef[_0x6b09('0x27')]=_0x3b8a82;if(!_0x1983ef[_0x6b09('0xa1')][_0x6b09('0xa9')])return;return db['User']['find']({'attributes':['id',_0x6b09('0x38')],'where':{'id':_0x1983ef['interaction'][_0x6b09('0xa9')]}});})['then'](function(_0x3d8a3f){if(_0x3d8a3f){_0x1983ef[_0x6b09('0x74')][_0x6b09('0xaa')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3d8a3f[_0x6b09('0x38')]+','+(_0x1983ef[_0x6b09('0x73')]['waitForTheAssignedAgent']||0xa),'interval':_0x6b09('0xa6')});}if(!_0x1983ef[_0x6b09('0xa1')][_0x6b09('0xab')])return;return db['SmsQueue']['find']({'attributes':['id',_0x6b09('0x38')],'where':{'id':_0x1983ef[_0x6b09('0xa1')][_0x6b09('0xab')]}});})[_0x6b09('0x1e')](function(_0x588864){if(_0x588864){_0x1983ef['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0x6b09('0xac'),'appdata':_0x588864['name']+','+(_0x1983ef[_0x6b09('0x73')][_0x6b09('0xad')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x6b09('0xae'),'startRouting',_0x1983ef);})[_0x6b09('0x1e')](function(_0x245d82){if(_0x245d82){var _0x12680d=0xc8;var _0x4f5b93='receiveMessage';logger[_0x6b09('0x1f')](_0x6b09('0x23'),_0x4f5b93,_0x12680d,_0x6b09('0xaf'));logger['debug'](_0x6b09('0xb0'),_0x4f5b93,_0x12680d,_0x6b09('0xaf'),JSON['stringify'](_0x245d82));if(_0x1983ef[_0x6b09('0x73')][_0x6b09('0x3f')]===_0x6b09('0xb1')){return _0x5c79e9[_0x6b09('0x2a')](_0x12680d)[_0x6b09('0xb2')](_0x6b09('0xb3'),_0x6b09('0xb4'))[_0x6b09('0xb5')](_0x6b09('0xb6'));}else{return _0x5c79e9[_0x6b09('0x2a')](_0x12680d)[_0x6b09('0x2c')](_0x245d82);}}})[_0x6b09('0x29')](handleError(_0x5c79e9,null));};exports[_0x6b09('0xb7')]=function(_0x461c80,_0x133f14){var _0xc21f4f=_0x461c80[_0x6b09('0x55')]['id'];var _0x3af0f6=_0x461c80[_0x6b09('0x5c')];var _0x4a9911=0xc8;var _0x5c0a24=null;return db['sequelize'][_0x6b09('0xb8')]({'isolationLevel':db[_0x6b09('0xb9')][_0x6b09('0xba')][_0x6b09('0xbb')]['READ_COMMITTED']},function(_0x13ba3d){return db[_0x6b09('0x3c')][_0x6b09('0x66')]({'where':{'id':_0xc21f4f},'transaction':_0x13ba3d})[_0x6b09('0x1e')](function(_0x483bdc){if(_0x483bdc){return db[_0x6b09('0x71')]['destroy']({'where':{'SmsAccountId':_0xc21f4f},'transaction':_0x13ba3d})['then'](function(){var _0x197cab=_[_0x6b09('0x3b')](_0x3af0f6,function(_0x3000d1){_0x3000d1[_0x6b09('0x64')]=_0xc21f4f;return _0x3000d1;});return db[_0x6b09('0x71')][_0x6b09('0xbc')](_0x197cab,{'transaction':_0x13ba3d});});}else{_0x4a9911=0x194;_0x5c0a24=[];}});})['then'](function(){if(_0x4a9911!==0x194){return db[_0x6b09('0x71')][_0x6b09('0xbd')]({'where':{'SmsAccountId':_0xc21f4f},'order':_0x6b09('0xbe')})['then'](function(_0xcdd10){_0x5c0a24=_0xcdd10;});}})[_0x6b09('0x29')](function(_0x214af9){_0x4a9911=0x1f4;logger[_0x6b09('0x25')](_0x214af9[_0x6b09('0x37')]);if(_0x214af9[_0x6b09('0x38')]){delete _0x214af9[_0x6b09('0x38')];}_0x5c0a24=_0x214af9;})[_0x6b09('0xbf')](function(){if(_0x5c0a24===null){_0x133f14[_0x6b09('0xc0')](_0x4a9911);}else{if(_0x4a9911===0x1f4){_0x133f14[_0x6b09('0x2a')](_0x4a9911)[_0x6b09('0xb5')](_0x5c0a24);}else{_0x133f14[_0x6b09('0x2a')](_0x4a9911)[_0x6b09('0x2c')](_0x5c0a24);}}});};exports[_0x6b09('0xc1')]=function(_0x2e8bc8,_0x9191f2,_0x57afb9){var _0x5ae6b0={};var _0x4d379e={};var _0xc6f2af;var _0x3764a7;return db[_0x6b09('0x3c')][_0x6b09('0x66')]({'where':{'id':_0x2e8bc8['params']['id']}})[_0x6b09('0x1e')](handleEntityNotFound(_0x9191f2,null))[_0x6b09('0x1e')](function(_0x454647){if(_0x454647){_0xc6f2af=_0x454647;_0x4d379e['model']=_[_0x6b09('0x57')](db[_0x6b09('0x71')]['rawAttributes']);_0x4d379e['query']=_[_0x6b09('0x57')](_0x2e8bc8['query']);_0x4d379e[_0x6b09('0x43')]=_[_0x6b09('0x44')](_0x4d379e['model'],_0x4d379e[_0x6b09('0x42')]);_0x5ae6b0['attributes']=_[_0x6b09('0x44')](_0x4d379e[_0x6b09('0x41')],qs['fields'](_0x2e8bc8['query'][_0x6b09('0x46')]));_0x5ae6b0[_0x6b09('0x45')]=_0x5ae6b0['attributes'][_0x6b09('0x47')]?_0x5ae6b0[_0x6b09('0x45')]:_0x4d379e[_0x6b09('0x41')];_0x5ae6b0[_0x6b09('0x4b')]=qs[_0x6b09('0x4c')](_0x2e8bc8['query'][_0x6b09('0x4c')]);_0x5ae6b0['where']=qs[_0x6b09('0x43')](_[_0x6b09('0x4d')](_0x2e8bc8[_0x6b09('0x42')],_0x4d379e[_0x6b09('0x43')]));if(_0x2e8bc8[_0x6b09('0x42')][_0x6b09('0x4e')]){_0x5ae6b0['where']=_[_0x6b09('0x50')](_0x5ae6b0[_0x6b09('0x4f')],{'$or':_[_0x6b09('0x3b')](_0x5ae6b0['attributes'],function(_0x42b26d){var _0x25d981={};_0x25d981[_0x42b26d]={'$like':'%'+_0x2e8bc8[_0x6b09('0x42')][_0x6b09('0x4e')]+'%'};return _0x25d981;})});}_0x5ae6b0=_['merge']({},_0x5ae6b0,_0x2e8bc8[_0x6b09('0x59')]);return _0xc6f2af[_0x6b09('0xc1')](_0x5ae6b0);}})[_0x6b09('0x1e')](function(_0x26552c){if(_0x26552c){_0x3764a7=_0x26552c[_0x6b09('0x47')];if(!_0x2e8bc8[_0x6b09('0x42')]['hasOwnProperty'](_0x6b09('0x49'))){_0x5ae6b0[_0x6b09('0x4a')]=qs[_0x6b09('0x4a')](_0x2e8bc8[_0x6b09('0x42')][_0x6b09('0x4a')]);_0x5ae6b0['offset']=qs['offset'](_0x2e8bc8[_0x6b09('0x42')]['offset']);}return _0xc6f2af['getApplications'](_0x5ae6b0);}})[_0x6b09('0x1e')](function(_0x35d86a){if(_0x35d86a){return _0x35d86a?{'count':_0x3764a7,'rows':_0x35d86a}:null;}})[_0x6b09('0x1e')](respondWithResult(_0x9191f2,null))[_0x6b09('0x29')](handleError(_0x9191f2,null));};exports['getInteractions']=function(_0x362512,_0x43dec4,_0x8f19a9){var _0x4c081b={'raw':![],'where':{}};var _0x11a618={};var _0x5e8458={'count':0x0,'rows':[]};return db[_0x6b09('0x3c')]['findOne']({'where':{'id':_0x362512['params']['id']}})[_0x6b09('0x1e')](handleEntityNotFound(_0x43dec4,null))['then'](function(_0x4a352c){if(_0x4a352c){_0x11a618[_0x6b09('0x41')]=_['keys'](db[_0x6b09('0x9f')][_0x6b09('0x3d')]);_0x11a618['query']=_[_0x6b09('0x57')](_0x362512[_0x6b09('0x42')]);_0x11a618[_0x6b09('0x43')]=_[_0x6b09('0x44')](_0x11a618[_0x6b09('0x41')],_0x11a618[_0x6b09('0x42')]);_0x4c081b[_0x6b09('0x45')]=_['intersection'](_0x11a618[_0x6b09('0x41')],qs[_0x6b09('0x46')](_0x362512[_0x6b09('0x42')][_0x6b09('0x46')]));_0x4c081b[_0x6b09('0x45')]=_0x4c081b[_0x6b09('0x45')][_0x6b09('0x47')]?_0x4c081b[_0x6b09('0x45')]:_0x11a618[_0x6b09('0x41')];if(!_0x362512[_0x6b09('0x42')][_0x6b09('0x48')](_0x6b09('0x49'))){_0x4c081b['limit']=qs[_0x6b09('0x4a')](_0x362512[_0x6b09('0x42')]['limit']);_0x4c081b[_0x6b09('0x2d')]=qs[_0x6b09('0x2d')](_0x362512[_0x6b09('0x42')][_0x6b09('0x2d')]);}_0x4c081b['order']=qs[_0x6b09('0x4c')](_0x362512['query'][_0x6b09('0x4c')]);_0x4c081b['where']=qs[_0x6b09('0x43')](_['pick'](_0x362512[_0x6b09('0x42')],_0x11a618[_0x6b09('0x43')]));_0x4c081b[_0x6b09('0x4f')][_0x6b09('0x64')]=_0x4a352c['id'];if(_0x362512[_0x6b09('0x42')]['filter']){_0x4c081b[_0x6b09('0x4f')]=_[_0x6b09('0x50')](_0x4c081b['where'],{'$or':_[_0x6b09('0x3b')](_0x4c081b[_0x6b09('0x45')],function(_0x2ed0e2){var _0x1f78ac={};_0x1f78ac[_0x2ed0e2]={'$like':'%'+_0x362512[_0x6b09('0x42')][_0x6b09('0x4e')]+'%'};return _0x1f78ac;})});}_0x4c081b=_[_0x6b09('0x50')]({},_0x4c081b,_0x362512[_0x6b09('0x59')]);return db[_0x6b09('0x9f')][_0x6b09('0x2f')]({'where':_0x4c081b[_0x6b09('0x4f')]})['then'](function(_0x1b09f6){_0x5e8458[_0x6b09('0x2f')]=_0x1b09f6;if(_0x362512[_0x6b09('0x42')]['includeAll']){_0x4c081b[_0x6b09('0x58')]=[{'model':db[_0x6b09('0x76')],'as':_0x6b09('0xc2'),'required':![]},{'model':db['User'],'as':_0x6b09('0xc3'),'attributes':[_0x6b09('0x38'),'fullname',_0x6b09('0xc4')],'required':![]},{'model':db[_0x6b09('0xc5')],'as':'Tags','attributes':['id',_0x6b09('0x38'),_0x6b09('0xc6')],'where':_0x362512[_0x6b09('0x42')][_0x6b09('0xc7')]?{'id':_0x362512[_0x6b09('0x42')]['tag']}:undefined,'required':_0x362512['query'][_0x6b09('0xc7')]?!![]:![]}];}return db['SmsInteraction'][_0x6b09('0x68')](_0x4c081b);})[_0x6b09('0x1e')](function(_0x168412){_0x5e8458[_0x6b09('0x53')]=_0x168412;return _0x5e8458;});}})[_0x6b09('0x1e')](respondWithFilteredResult(_0x43dec4,_0x4c081b))[_0x6b09('0x29')](handleError(_0x43dec4,null));};exports[_0x6b09('0xb5')]=function(_0x494a46,_0x2ce72f,_0x2b812b){var _0x387852,_0x3c7379,_0xfc4433;if(_['isNil'](_0x494a46[_0x6b09('0x5c')][_0x6b09('0x5c')])||_0x494a46[_0x6b09('0x5c')]['body']===''){throw new db[(_0x6b09('0x77'))]['ValidationError'](_0x6b09('0xc8'));}if(_[_0x6b09('0x95')](_0x494a46[_0x6b09('0x5c')]['to'])){throw new db['Sequelize'][(_0x6b09('0x78'))](_0x6b09('0xc9'));}_0x387852=_0x494a46[_0x6b09('0x5c')]['to'];return db[_0x6b09('0x3c')]['find']({'where':{'id':_0x494a46[_0x6b09('0x55')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x6b09('0x9b'),'where':{'mobile':_0x387852},'limit':0x1,'order':[[_0x6b09('0x7b'),'DESC']]}]}]})[_0x6b09('0x1e')](handleEntityNotFound(_0x2ce72f,null))[_0x6b09('0x1e')](function(_0x5b8546){if(_0x5b8546&&_0x5b8546['List']){_0x3c7379=_0x5b8546[_0x6b09('0x5e')]({'plain':!![]});if(_0x3c7379[_0x6b09('0xca')]&&_0x3c7379[_0x6b09('0xca')][_0x6b09('0x9b')][_0x6b09('0x47')]){return _0x3c7379[_0x6b09('0xca')][_0x6b09('0x9b')][0x0];}return db[_0x6b09('0x76')][_0x6b09('0x5b')](_[_0x6b09('0x15')](_0x494a46[_0x6b09('0x5c')],{'firstName':_0x387852,'mobile':_0x387852,'phone':_0x387852,'ListId':_0x3c7379[_0x6b09('0x7d')]}));}})[_0x6b09('0x1e')](handleEntityNotFound(_0x2ce72f,null))[_0x6b09('0x1e')](function(_0x20f699){if(_0x20f699){_0xfc4433=_0x20f699;return db['SmsInteraction'][_0x6b09('0x5a')]({'where':{'ContactId':_0xfc4433['id'],'closed':![],'SmsAccountId':_0x3c7379['id']}})[_0x6b09('0x1e')](function(_0x4743ab){if(_0x4743ab){return[_0x4743ab,![]];}return db['SmsInteraction'][_0x6b09('0x5b')]({'UserId':_0x494a46[_0x6b09('0x5d')]['id'],'ContactId':_0xfc4433['id'],'SmsAccountId':_0x3c7379['id'],'phone':_0x387852,'firstMsgDirection':_0x6b09('0xcb'),'Messages':[_[_0x6b09('0x50')](_0x494a46[_0x6b09('0x5c')],{'read':![],'body':_0x494a46[_0x6b09('0x5c')]['body'],'phone':_0x387852,'SmsAccountId':_0x3c7379['id'],'UserId':_0x494a46[_0x6b09('0x5d')]['id'],'ContactId':_0xfc4433['id']})]},{'include':[{'model':db[_0x6b09('0xa7')],'as':_0x6b09('0xcc')}]})[_0x6b09('0x1e')](function(_0x5ed605){return[_0x5ed605,!![]];});});}})[_0x6b09('0xa0')](function(_0x1b55f5,_0x54a831){if(_0x54a831){return _0x1b55f5;}return db[_0x6b09('0xa7')][_0x6b09('0x5b')](_[_0x6b09('0x50')](_0x494a46[_0x6b09('0x5c')],{'read':![],'body':_0x494a46[_0x6b09('0x5c')][_0x6b09('0x5c')],'phone':_0x387852,'SmsAccountId':_0x3c7379['id'],'SmsInteractionId':_0x1b55f5['id'],'UserId':_0x494a46[_0x6b09('0x5d')]['id'],'ContactId':_0xfc4433['id']}))[_0x6b09('0x1e')](function(_0x329938){_0x1b55f5['dataValues'][_0x6b09('0xcc')]=[];_0x1b55f5['dataValues'][_0x6b09('0xcc')][_0x6b09('0xa4')](_0x329938[_0x6b09('0xcd')]);return _0x1b55f5;});})[_0x6b09('0x1e')](respondWithResult(_0x2ce72f,null))[_0x6b09('0x29')](handleError(_0x2ce72f,null));};exports['status']=function(_0x3a82dd,_0x5015d6,_0xc85c00){if(_0x3a82dd[_0x6b09('0x5c')]['id']){delete _0x3a82dd[_0x6b09('0x5c')]['id'];}var _0x39968d,_0x5dae7a,_0x44ed1f;return db[_0x6b09('0x3c')][_0x6b09('0x5a')]({'where':{'id':_0x3a82dd[_0x6b09('0x55')]['id']}})[_0x6b09('0x1e')](handleEntityNotFound(_0x5015d6,null))[_0x6b09('0x1e')](function(_0xd844e3){if(_0xd844e3){_0x44ed1f=_0xd844e3;logger['debug'](_0x6b09('0x23'),'status',_0x6b09('0xce'),_0xd844e3[_0x6b09('0x3f')],util['inspect'](_0x3a82dd[_0x6b09('0x5c')],{'showHidden':![],'depth':null}));switch(_0xd844e3[_0x6b09('0x3f')]){case _0x6b09('0x82'):if(_0x3a82dd['body']['skebby_dispatch_id']&&_0x3a82dd[_0x6b09('0x5c')]['status']){_0x5dae7a=_0x3a82dd[_0x6b09('0x5c')]['status'];return db[_0x6b09('0xa7')][_0x6b09('0x5a')]({'where':{'messageId':_0x3a82dd[_0x6b09('0x5c')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x3a82dd['body'][_0x6b09('0xcf')]&&_0x3a82dd['body'][_0x6b09('0xd0')]){_0x5dae7a=_0x3a82dd[_0x6b09('0x5c')][_0x6b09('0xd0')];return db[_0x6b09('0xa7')][_0x6b09('0x5a')]({'where':{'messageId':_0x3a82dd['body'][_0x6b09('0xcf')]}});}break;case _0x6b09('0x85'):if(_0x3a82dd[_0x6b09('0x5c')]['message_id']&&_0x3a82dd[_0x6b09('0x5c')][_0x6b09('0xd1')]){_0x5dae7a=_0x3a82dd[_0x6b09('0x5c')][_0x6b09('0xd1')];return db['SmsMessage'][_0x6b09('0x5a')]({'where':{'messageId':_0x3a82dd[_0x6b09('0x5c')]['message_id']}});}break;case'infobip':var _0x185364=_0x3a82dd[_0x6b09('0x5c')][_0x6b09('0x8c')][0x0];if(_0x185364[_0x6b09('0x86')]&&_0x185364['status'][_0x6b09('0xd2')]==='DELIVERED'){_0x5dae7a=_0x185364[_0x6b09('0x2a')][_0x6b09('0xd2')];return db['SmsMessage'][_0x6b09('0x5a')]({'where':{'messageId':_0x185364[_0x6b09('0x86')]}});}break;case'clickatell':if(_0x3a82dd[_0x6b09('0x5c')][_0x6b09('0x86')]&&_0x3a82dd[_0x6b09('0x5c')][_0x6b09('0x2a')]){_0x5dae7a=_0x3a82dd[_0x6b09('0x5c')]['status'];return db[_0x6b09('0xa7')][_0x6b09('0x5a')]({'where':{'messageId':_0x3a82dd[_0x6b09('0x5c')][_0x6b09('0x86')]}});}break;case _0x6b09('0x92'):if(_0x3a82dd[_0x6b09('0x5c')][0x0]['message']['id']){_0x5dae7a=_0x3a82dd[_0x6b09('0x5c')][0x0][_0x6b09('0x3f')];return db[_0x6b09('0xa7')][_0x6b09('0x5a')]({'where':{'messageId':_0x3a82dd[_0x6b09('0x5c')][0x0][_0x6b09('0x27')]['id']}});}break;case _0x6b09('0x93'):if(_0x3a82dd['body'][_0x6b09('0xd3')]&&_0x3a82dd[_0x6b09('0x5c')][_0x6b09('0x2a')]){_0x5dae7a=_0x3a82dd[_0x6b09('0x5c')]['status'];return db[_0x6b09('0xa7')][_0x6b09('0x5a')]({'where':{'messageId':_0x3a82dd['body'][_0x6b09('0xd3')]}});}break;}}})[_0x6b09('0x1e')](handleEntityNotFound(_0x5015d6,null))[_0x6b09('0x1e')](function(_0x29ee2f){if(_0x29ee2f){_0x39968d=_0x29ee2f;switch(_0x44ed1f[_0x6b09('0x3f')]){case _0x6b09('0x82'):if(_0x5dae7a===_0x6b09('0xd4')){return _0x39968d['update']({'read':!![]});}else{logger['error'](_0x6b09('0x23'),_0x6b09('0x2a'),_0x6b09('0x82'),util[_0x6b09('0xd5')](_0x3a82dd[_0x6b09('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x6b09('0x84'):if(_0x5dae7a==='1'){return _0x39968d['update']({'read':!![]});}else{logger[_0x6b09('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6b09('0x2a'),_0x6b09('0x82'),util['inspect'](_0x3a82dd[_0x6b09('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x6b09('0x85'):if(!_0x3a82dd[_0x6b09('0x5c')][_0x6b09('0xd6')]&&_0x5dae7a>=0xc8&&_0x5dae7a<=0xce){return _0x39968d[_0x6b09('0x62')]({'read':!![]});}else{logger['error'](_0x6b09('0x23'),_0x6b09('0x2a'),'clicksend',util[_0x6b09('0xd5')](_0x3a82dd['body'],{'showHidden':![],'depth':null}));}break;case _0x6b09('0x8b'):var _0x3d08c9=_0x3a82dd['body'][_0x6b09('0x8c')][0x0];if(_0x3d08c9[_0x6b09('0x2a')][_0x6b09('0xd2')]===_0x6b09('0xd4')){return _0x39968d[_0x6b09('0x62')]({'read':!![]});}else{logger[_0x6b09('0x25')](_0x6b09('0x23'),'status',_0x6b09('0x8b'),util[_0x6b09('0xd5')](_0x3a82dd[_0x6b09('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x6b09('0x8f'):if(_0x5dae7a==_0x6b09('0xd7')||_0x5dae7a==_0x6b09('0xd8')){return _0x39968d[_0x6b09('0x62')]({'read':!![]});}else{logger[_0x6b09('0x25')](_0x6b09('0x23'),_0x6b09('0x2a'),_0x6b09('0x8f'),util['inspect'](_0x3a82dd[_0x6b09('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x6b09('0x92'):if(_0x5dae7a==_0x6b09('0xd9')){return _0x39968d[_0x6b09('0x62')]({'read':!![]});}else{logger[_0x6b09('0x25')](_0x6b09('0x23'),_0x6b09('0x2a'),_0x6b09('0x92'),util[_0x6b09('0xd5')](_0x3a82dd['body'],{'showHidden':![],'depth':null}));}break;case _0x6b09('0x93'):if(_0x5dae7a===_0x6b09('0xda')||_0x5dae7a===_0x6b09('0xdb')){return _0x39968d[_0x6b09('0x62')]({'read':!![]});}else{logger[_0x6b09('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x6b09('0x93'),util[_0x6b09('0xd5')](_0x3a82dd[_0x6b09('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x39968d;}})[_0x6b09('0x1e')](respondWithResult(_0x5015d6,null))[_0x6b09('0x29')](handleError(_0x5015d6,null));};exports[_0x6b09('0xdc')]=function(_0x55aef1,_0x3f35c1,_0x98e1de){var _0x2913c0,_0x3f0a13,_0x16e626;return db[_0x6b09('0x3c')][_0x6b09('0x5a')]({'where':{'id':_0x55aef1[_0x6b09('0x55')]['id']}})[_0x6b09('0x1e')](handleEntityNotFound(_0x3f35c1,null))['then'](function(_0x1671b9){if(_0x1671b9){_0x16e626=_0x1671b9;logger[_0x6b09('0x22')](_0x6b09('0x23'),'status',_0x6b09('0xce'),_0x1671b9[_0x6b09('0x3f')],util[_0x6b09('0xd5')](_0x55aef1[_0x6b09('0x42')],{'showHidden':![],'depth':null}));switch(_0x1671b9[_0x6b09('0x3f')]){case _0x6b09('0x8d'):if(_0x55aef1[_0x6b09('0x42')][_0x6b09('0xdd')]&&_0x55aef1[_0x6b09('0x42')][_0x6b09('0xde')]){_0x3f0a13=_0x55aef1[_0x6b09('0x42')][_0x6b09('0xde')];return db[_0x6b09('0xa7')][_0x6b09('0x5a')]({'where':{'messageId':_0x55aef1[_0x6b09('0x42')][_0x6b09('0xdd')]}});}break;}}})[_0x6b09('0x1e')](handleEntityNotFound(_0x3f35c1,null))[_0x6b09('0x1e')](function(_0x3382cd){if(_0x3382cd){_0x2913c0=_0x3382cd;switch(_0x16e626['type']){case _0x6b09('0x8d'):if(_0x3f0a13==='2'||_0x3f0a13==='6'){return _0x2913c0[_0x6b09('0x62')]({'read':!![]});}else{logger[_0x6b09('0x25')](_0x6b09('0x23'),_0x6b09('0x2a'),_0x6b09('0x8d'),util[_0x6b09('0xd5')](_0x55aef1['query'],{'showHidden':![],'depth':null}));};break;}return _0x2913c0;}})[_0x6b09('0x1e')](respondWithResult(_0x3f35c1,null))[_0x6b09('0x29')](handleError(_0x3f35c1,null));};exports[_0x6b09('0xdf')]=function(_0xde07f0,_0x54c36c,_0x3b103d){return db['SmsAccount'][_0x6b09('0x5a')]({'where':{'id':_0xde07f0[_0x6b09('0x55')]['id']}})[_0x6b09('0x1e')](handleEntityNotFound(_0x54c36c,null))[_0x6b09('0x1e')](function(_0x2664b6){if(_0x2664b6){return _0x2664b6[_0x6b09('0xdf')](_0xde07f0[_0x6b09('0x5c')][_0x6b09('0x6a')],_[_0x6b09('0x9e')](_0xde07f0[_0x6b09('0x5c')],[_0x6b09('0x6a'),'id'])||{})[_0x6b09('0xa0')](function(_0x2911e0){for(var _0x1c7d55=0x0;_0x1c7d55<_0xde07f0[_0x6b09('0x5c')][_0x6b09('0x6a')][_0x6b09('0x47')];_0x1c7d55+=0x1){socket[_0x6b09('0xe0')]('userSmsAccount:save',{'UserId':Number(_0xde07f0[_0x6b09('0x5c')][_0x6b09('0x6a')][_0x1c7d55]),'SmsAccountId':Number(_0xde07f0[_0x6b09('0x55')]['id'])});}return _0x2911e0;});}})[_0x6b09('0x1e')](respondWithResult(_0x54c36c,null))[_0x6b09('0x29')](handleError(_0x54c36c,null));};exports[_0x6b09('0xe1')]=function(_0x7bd108,_0x2d2868,_0x571070){return db[_0x6b09('0x3c')]['find']({'where':{'id':_0x7bd108[_0x6b09('0x55')]['id']}})[_0x6b09('0x1e')](handleEntityNotFound(_0x2d2868,null))[_0x6b09('0x1e')](function(_0x2621cc){if(_0x2621cc){return _0x2621cc[_0x6b09('0xe1')](_0x7bd108['query'][_0x6b09('0x6a')])[_0x6b09('0x1e')](function(){if(_[_0x6b09('0xe2')](_0x7bd108[_0x6b09('0x42')][_0x6b09('0x6a')])){for(var _0x126ed2=0x0;_0x126ed2<_0x7bd108[_0x6b09('0x42')][_0x6b09('0x6a')]['length'];_0x126ed2+=0x1){socket['emit'](_0x6b09('0xe3'),{'UserId':Number(_0x7bd108[_0x6b09('0x42')][_0x6b09('0x6a')][_0x126ed2]),'SmsAccountId':Number(_0x7bd108[_0x6b09('0x55')]['id'])});}}else{socket[_0x6b09('0xe0')](_0x6b09('0xe3'),{'UserId':Number(_0x7bd108[_0x6b09('0x42')][_0x6b09('0x6a')]),'SmsAccountId':Number(_0x7bd108[_0x6b09('0x55')]['id'])});}});}})[_0x6b09('0x1e')](respondWithStatusCode(_0x2d2868,null))['catch'](handleError(_0x2d2868,null));};exports['getAgents']=function(_0x4f3a18,_0x477e4c,_0x3d57f1){var _0x15a300={};var _0x1f87ff={};var _0x48a26a;var _0x4674d2;return db['SmsAccount']['findOne']({'where':{'id':_0x4f3a18[_0x6b09('0x55')]['id']}})['then'](handleEntityNotFound(_0x477e4c,null))[_0x6b09('0x1e')](function(_0x49fc33){if(_0x49fc33){_0x48a26a=_0x49fc33;_0x1f87ff[_0x6b09('0x41')]=_[_0x6b09('0x57')](db['User'][_0x6b09('0x3d')]);_0x1f87ff[_0x6b09('0x42')]=_['keys'](_0x4f3a18[_0x6b09('0x42')]);_0x1f87ff[_0x6b09('0x43')]=_[_0x6b09('0x44')](_0x1f87ff[_0x6b09('0x41')],_0x1f87ff[_0x6b09('0x42')]);_0x15a300[_0x6b09('0x45')]=_['intersection'](_0x1f87ff['model'],qs[_0x6b09('0x46')](_0x4f3a18[_0x6b09('0x42')][_0x6b09('0x46')]));_0x15a300[_0x6b09('0x45')]=_0x15a300[_0x6b09('0x45')][_0x6b09('0x47')]?_0x15a300[_0x6b09('0x45')]:_0x1f87ff['model'];_0x15a300['order']=qs[_0x6b09('0x4c')](_0x4f3a18[_0x6b09('0x42')]['sort']);_0x15a300['where']=qs[_0x6b09('0x43')](_[_0x6b09('0x4d')](_0x4f3a18[_0x6b09('0x42')],_0x1f87ff[_0x6b09('0x43')]));if(_0x4f3a18[_0x6b09('0x42')]['filter']){_0x15a300['where']=_[_0x6b09('0x50')](_0x15a300['where'],{'$or':_[_0x6b09('0x3b')](_0x15a300[_0x6b09('0x45')],function(_0x3bc9c0){var _0x3f3bef={};_0x3f3bef[_0x3bc9c0]={'$like':'%'+_0x4f3a18[_0x6b09('0x42')][_0x6b09('0x4e')]+'%'};return _0x3f3bef;})});}_0x15a300=_[_0x6b09('0x50')]({},_0x15a300,_0x4f3a18[_0x6b09('0x59')]);return _0x48a26a[_0x6b09('0xe4')](_0x15a300);}})['then'](function(_0x133fea){if(_0x133fea){_0x4674d2=_0x133fea[_0x6b09('0x47')];if(!_0x4f3a18[_0x6b09('0x42')][_0x6b09('0x48')](_0x6b09('0x49'))){_0x15a300[_0x6b09('0x4a')]=qs[_0x6b09('0x4a')](_0x4f3a18[_0x6b09('0x42')][_0x6b09('0x4a')]);_0x15a300['offset']=qs[_0x6b09('0x2d')](_0x4f3a18[_0x6b09('0x42')][_0x6b09('0x2d')]);}return _0x48a26a[_0x6b09('0xe4')](_0x15a300);}})[_0x6b09('0x1e')](function(_0x51529f){if(_0x51529f){return _0x51529f?{'count':_0x4674d2,'rows':_0x51529f}:null;}})[_0x6b09('0x1e')](respondWithResult(_0x477e4c,null))['catch'](handleError(_0x477e4c,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index e2fdb3a..85e7866 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 _0xb842=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsAccount','setMaxListeners','update'];(function(_0x22940a,_0x5ee8db){var _0xe7ae3d=function(_0x23b430){while(--_0x23b430){_0x22940a['push'](_0x22940a['shift']());}};_0xe7ae3d(++_0x5ee8db);}(_0xb842,0x1b5));var _0x2b84=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0xb842[_0x1d50f2];return _0x3769b8;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x2b84('0x0'))['db'][_0x2b84('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x2b84('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2b84('0x3'),'afterDestroy':_0x2b84('0x4')};function emitEvent(_0x41aea4){return function(_0x457905,_0x69c1bf,_0x214bfb){SmsAccountEvents[_0x2b84('0x5')](_0x41aea4+':'+_0x457905['id'],_0x457905);SmsAccountEvents[_0x2b84('0x5')](_0x41aea4,_0x457905);_0x214bfb(null);};}for(var e in events){if(events[_0x2b84('0x6')](e)){var event=events[e];SmsAccount[_0x2b84('0x7')](e,emitEvent(event));}}module[_0x2b84('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x58c6=['remove','emit','hasOwnProperty','hook','exports','events','SmsAccount','setMaxListeners','save','update'];(function(_0x2f0521,_0x54bbff){var _0x764f36=function(_0x47ad76){while(--_0x47ad76){_0x2f0521['push'](_0x2f0521['shift']());}};_0x764f36(++_0x54bbff);}(_0x58c6,0x69));var _0x658c=function(_0x36d25e,_0x1a047d){_0x36d25e=_0x36d25e-0x0;var _0x4b95b8=_0x58c6[_0x36d25e];return _0x4b95b8;};'use strict';var EventEmitter=require(_0x658c('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x658c('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x658c('0x2')](0x0);var events={'afterCreate':_0x658c('0x3'),'afterUpdate':_0x658c('0x4'),'afterDestroy':_0x658c('0x5')};function emitEvent(_0x8468fc){return function(_0x7ff908,_0x46689a,_0x1c3b1b){SmsAccountEvents[_0x658c('0x6')](_0x8468fc+':'+_0x7ff908['id'],_0x7ff908);SmsAccountEvents[_0x658c('0x6')](_0x8468fc,_0x7ff908);_0x1c3b1b(null);};}for(var e in events){if(events[_0x658c('0x7')](e)){var event=events[e];SmsAccount[_0x658c('0x8')](e,emitEvent(event));}}module[_0x658c('0x9')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 783338f..5aa686b 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 _0x5edf=['bluebird','path','../../config/environment','exports','define','SmsAccount','sms_accounts','lodash','../../config/logger','api','moment'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x5edf,0x188));var _0xf5ed=function(_0x5823f6,_0x5a4c83){_0x5823f6=_0x5823f6-0x0;var _0x13d89b=_0x5edf[_0x5823f6];return _0x13d89b;};'use strict';var _=require(_0xf5ed('0x0'));var util=require('util');var logger=require(_0xf5ed('0x1'))(_0xf5ed('0x2'));var moment=require(_0xf5ed('0x3'));var BPromise=require(_0xf5ed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5ed('0x5'));var rimraf=require('rimraf');var config=require(_0xf5ed('0x6'));var attributes=require('./smsAccount.attributes');module[_0xf5ed('0x7')]=function(_0x2c260b,_0x5329ea){return _0x2c260b[_0xf5ed('0x8')](_0xf5ed('0x9'),attributes,{'tableName':_0xf5ed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x123d=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','define'];(function(_0x73a09c,_0x3957ea){var _0xb1a553=function(_0x302d61){while(--_0x302d61){_0x73a09c['push'](_0x73a09c['shift']());}};_0xb1a553(++_0x3957ea);}(_0x123d,0x172));var _0xd123=function(_0x41478a,_0x23ebe2){_0x41478a=_0x41478a-0x0;var _0x4d17e1=_0x123d[_0x41478a];return _0x4d17e1;};'use strict';var _=require(_0xd123('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd123('0x1'));var moment=require(_0xd123('0x2'));var BPromise=require(_0xd123('0x3'));var rp=require(_0xd123('0x4'));var fs=require('fs');var path=require(_0xd123('0x5'));var rimraf=require(_0xd123('0x6'));var config=require(_0xd123('0x7'));var attributes=require(_0xd123('0x8'));module['exports']=function(_0x3a5295,_0x36beae){return _0x3a5295[_0xd123('0x9')]('SmsAccount',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 e122ecb..cc596e5 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 _0xcbaf=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','SmsAccount,\x20%s,\x20%s','message','ShowSmsAccount','SmsAccount','find','options','raw','attributes','include','map','model','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x29ecbc,_0x2929d9){var _0x5709b0=function(_0x277721){while(--_0x277721){_0x29ecbc['push'](_0x29ecbc['shift']());}};_0x5709b0(++_0x2929d9);}(_0xcbaf,0x16c));var _0xfcba=function(_0x49ac2d,_0x3b85ff){_0x49ac2d=_0x49ac2d-0x0;var _0x213855=_0xcbaf[_0x49ac2d];return _0x213855;};'use strict';var _=require(_0xfcba('0x0'));var util=require(_0xfcba('0x1'));var moment=require('moment');var BPromise=require(_0xfcba('0x2'));var rs=require(_0xfcba('0x3'));var fs=require('fs');var Redis=require(_0xfcba('0x4'));var db=require(_0xfcba('0x5'))['db'];var utils=require(_0xfcba('0x6'));var logger=require(_0xfcba('0x7'))(_0xfcba('0x8'));var config=require(_0xfcba('0x9'));var jayson=require(_0xfcba('0xa'));var client=jayson[_0xfcba('0xb')][_0xfcba('0xc')]({'port':0x232a});config[_0xfcba('0xd')]=_[_0xfcba('0xe')](config[_0xfcba('0xd')],{'host':_0xfcba('0xf'),'port':0x18eb});var socket=require(_0xfcba('0x10'))(new Redis(config[_0xfcba('0xd')]));require(_0xfcba('0x11'))['register'](socket);function respondWithRpcPromise(_0x2e492c,_0x5961b1,_0x98c085){return new BPromise(function(_0x29e6ea,_0x48966c){return client['request'](_0x2e492c,_0x98c085)[_0xfcba('0x12')](function(_0x59d043){logger[_0xfcba('0x13')]('SmsAccount,\x20%s,\x20%s',_0x5961b1,_0xfcba('0x14'));logger[_0xfcba('0x15')](_0xfcba('0x16'),_0x5961b1,'request\x20sent',JSON[_0xfcba('0x17')](_0x59d043));if(_0x59d043['error']){if(_0x59d043[_0xfcba('0x18')]['code']===0x1f4){logger[_0xfcba('0x18')](_0xfcba('0x19'),_0x5961b1,_0x59d043[_0xfcba('0x18')]['message']);return _0x48966c(_0x59d043[_0xfcba('0x18')][_0xfcba('0x1a')]);}logger[_0xfcba('0x18')](_0xfcba('0x19'),_0x5961b1,_0x59d043[_0xfcba('0x18')][_0xfcba('0x1a')]);return _0x29e6ea(_0x59d043[_0xfcba('0x18')]['message']);}else{logger[_0xfcba('0x13')]('SmsAccount,\x20%s,\x20%s',_0x5961b1,_0xfcba('0x14'));_0x29e6ea(_0x59d043['result']['message']);}})['catch'](function(_0x1f60c4){logger[_0xfcba('0x18')](_0xfcba('0x19'),_0x5961b1,_0x1f60c4);_0x48966c(_0x1f60c4);});});}exports[_0xfcba('0x1b')]=function(_0x4c4e90){var _0x94a151=this;return new Promise(function(_0x56400d,_0x9c2d70){return db[_0xfcba('0x1c')][_0xfcba('0x1d')]({'raw':_0x4c4e90[_0xfcba('0x1e')]?_0x4c4e90['options'][_0xfcba('0x1f')]===undefined?!![]:![]:!![],'where':_0x4c4e90[_0xfcba('0x1e')]?_0x4c4e90[_0xfcba('0x1e')]['where']||null:null,'attributes':_0x4c4e90[_0xfcba('0x1e')]?_0x4c4e90[_0xfcba('0x1e')][_0xfcba('0x20')]||null:null,'include':_0x4c4e90[_0xfcba('0x1e')]?_0x4c4e90[_0xfcba('0x1e')][_0xfcba('0x21')]?_[_0xfcba('0x22')](_0x4c4e90[_0xfcba('0x1e')][_0xfcba('0x21')],function(_0x3dd419){return{'model':db[_0x3dd419[_0xfcba('0x23')]],'as':_0x3dd419['as'],'attributes':_0x3dd419['attributes'],'include':_0x3dd419[_0xfcba('0x21')]?_[_0xfcba('0x22')](_0x3dd419[_0xfcba('0x21')],function(_0x157f2a){return{'model':db[_0x157f2a['model']],'as':_0x157f2a['as'],'attributes':_0x157f2a['attributes'],'include':_0x157f2a['include']?_[_0xfcba('0x22')](_0x157f2a[_0xfcba('0x21')],function(_0x292ea6){return{'model':db[_0x292ea6[_0xfcba('0x23')]],'as':_0x292ea6['as'],'attributes':_0x292ea6[_0xfcba('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfcba('0x12')](function(_0x2a5107){logger[_0xfcba('0x13')](_0xfcba('0x1b'),_0x4c4e90);logger['debug'](_0xfcba('0x1b'),_0x4c4e90,JSON['stringify'](_0x2a5107));_0x56400d(_0x2a5107);})[_0xfcba('0x24')](function(_0x152b15){logger[_0xfcba('0x18')](_0xfcba('0x1b'),_0x152b15[_0xfcba('0x1a')],_0x4c4e90);_0x9c2d70(_0x94a151[_0xfcba('0x18')](0x1f4,_0x152b15[_0xfcba('0x1a')]));});});}; \ No newline at end of file +var _0x4146=['redis','socket.io-emitter','./smsAccount.socket','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','SmsAccount','find','options','where','map','model','attributes','include','ShowSmsAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4353a0,_0x5a7a4b){var _0x4a19c2=function(_0x298729){while(--_0x298729){_0x4353a0['push'](_0x4353a0['shift']());}};_0x4a19c2(++_0x5a7a4b);}(_0x4146,0x114));var _0x6414=function(_0x12240b,_0x51d996){_0x12240b=_0x12240b-0x0;var _0x5c7294=_0x4146[_0x12240b];return _0x5c7294;};'use strict';var _=require(_0x6414('0x0'));var util=require(_0x6414('0x1'));var moment=require(_0x6414('0x2'));var BPromise=require(_0x6414('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6414('0x4'));var db=require(_0x6414('0x5'))['db'];var utils=require(_0x6414('0x6'));var logger=require('../../config/logger')(_0x6414('0x7'));var config=require(_0x6414('0x8'));var jayson=require(_0x6414('0x9'));var client=jayson[_0x6414('0xa')][_0x6414('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6414('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6414('0xd'))(new Redis(config[_0x6414('0xc')]));require(_0x6414('0xe'))['register'](socket);function respondWithRpcPromise(_0x321c4b,_0x1ca43d,_0x3ee5d8){return new BPromise(function(_0xa3d660,_0x25cc1f){return client['request'](_0x321c4b,_0x3ee5d8)['then'](function(_0x35c467){logger[_0x6414('0xf')](_0x6414('0x10'),_0x1ca43d,_0x6414('0x11'));logger[_0x6414('0x12')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1ca43d,_0x6414('0x11'),JSON[_0x6414('0x13')](_0x35c467));if(_0x35c467['error']){if(_0x35c467['error']['code']===0x1f4){logger[_0x6414('0x14')](_0x6414('0x10'),_0x1ca43d,_0x35c467['error'][_0x6414('0x15')]);return _0x25cc1f(_0x35c467[_0x6414('0x14')][_0x6414('0x15')]);}logger[_0x6414('0x14')]('SmsAccount,\x20%s,\x20%s',_0x1ca43d,_0x35c467['error']['message']);return _0xa3d660(_0x35c467[_0x6414('0x14')][_0x6414('0x15')]);}else{logger['info'](_0x6414('0x10'),_0x1ca43d,'request\x20sent');_0xa3d660(_0x35c467['result']['message']);}})[_0x6414('0x16')](function(_0x3d210f){logger['error']('SmsAccount,\x20%s,\x20%s',_0x1ca43d,_0x3d210f);_0x25cc1f(_0x3d210f);});});}exports['ShowSmsAccount']=function(_0x461922){var _0x1faa4c=this;return new Promise(function(_0x2a775d,_0x5d63a8){return db[_0x6414('0x17')][_0x6414('0x18')]({'raw':_0x461922[_0x6414('0x19')]?_0x461922[_0x6414('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x461922[_0x6414('0x19')]?_0x461922[_0x6414('0x19')][_0x6414('0x1a')]||null:null,'attributes':_0x461922[_0x6414('0x19')]?_0x461922[_0x6414('0x19')]['attributes']||null:null,'include':_0x461922[_0x6414('0x19')]?_0x461922[_0x6414('0x19')]['include']?_[_0x6414('0x1b')](_0x461922[_0x6414('0x19')]['include'],function(_0x15e6df){return{'model':db[_0x15e6df[_0x6414('0x1c')]],'as':_0x15e6df['as'],'attributes':_0x15e6df[_0x6414('0x1d')],'include':_0x15e6df['include']?_[_0x6414('0x1b')](_0x15e6df[_0x6414('0x1e')],function(_0x4b32c5){return{'model':db[_0x4b32c5[_0x6414('0x1c')]],'as':_0x4b32c5['as'],'attributes':_0x4b32c5['attributes'],'include':_0x4b32c5[_0x6414('0x1e')]?_[_0x6414('0x1b')](_0x4b32c5[_0x6414('0x1e')],function(_0x2769d5){return{'model':db[_0x2769d5['model']],'as':_0x2769d5['as'],'attributes':_0x2769d5[_0x6414('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x522fc6){logger[_0x6414('0xf')](_0x6414('0x1f'),_0x461922);logger[_0x6414('0x12')](_0x6414('0x1f'),_0x461922,JSON[_0x6414('0x13')](_0x522fc6));_0x2a775d(_0x522fc6);})['catch'](function(_0x347f45){logger[_0x6414('0x14')](_0x6414('0x1f'),_0x347f45[_0x6414('0x15')],_0x461922);_0x5d63a8(_0x1faa4c[_0x6414('0x14')](0x1f4,_0x347f45[_0x6414('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index fccc3b9..7a38af4 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 ab9dfd4..c55ad7e 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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x2590a7,_0xe5dbed){var _0x234749=function(_0x48d7a6){while(--_0x48d7a6){_0x2590a7['push'](_0x2590a7['shift']());}};_0x234749(++_0xe5dbed);}(_0x3e74,0x175));var _0x43e7=function(_0x45f664,_0x248762){_0x45f664=_0x45f664-0x0;var _0x10fe3e=_0x3e74[_0x45f664];return _0x10fe3e;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index f396cd0..9a2392c 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 _0x72e0=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x72e0,0x1ec));var _0x072e=function(_0x2b9cf8,_0x4d317f){_0x2b9cf8=_0x2b9cf8-0x0;var _0x5c62df=_0x72e0[_0x2b9cf8];return _0x5c62df;};'use strict';var Sequelize=require('sequelize');module[_0x072e('0x0')]={'priority':{'type':Sequelize[_0x072e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x072e('0x2')],'allowNull':![],'defaultValue':_0x072e('0x3')},'appdata':{'type':Sequelize[_0x072e('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x072e('0x5')}}; \ No newline at end of file +var _0xc789=['*,*,*,*','exports','STRING','noop','TEXT'];(function(_0x56441c,_0x274fb5){var _0x194552=function(_0x45bcdf){while(--_0x45bcdf){_0x56441c['push'](_0x56441c['shift']());}};_0x194552(++_0x274fb5);}(_0xc789,0xd8));var _0x9c78=function(_0x15bb5d,_0x9d29a4){_0x15bb5d=_0x15bb5d-0x0;var _0x18b3ee=_0xc789[_0x15bb5d];return _0x18b3ee;};'use strict';var Sequelize=require('sequelize');module[_0x9c78('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9c78('0x1')],'allowNull':![],'defaultValue':_0x9c78('0x2')},'appdata':{'type':Sequelize[_0x9c78('0x3')]()},'description':{'type':Sequelize[_0x9c78('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9c78('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 4178122..595d2f4 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 _0x6cec=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x41b170,_0x4d901a){var _0x178de0=function(_0x1770f9){while(--_0x1770f9){_0x41b170['push'](_0x41b170['shift']());}};_0x178de0(++_0x4d901a);}(_0x6cec,0x1c7));var _0xc6ce=function(_0x2f037f,_0x2958c5){_0x2f037f=_0x2f037f-0x0;var _0x2d1573=_0x6cec[_0x2f037f];return _0x2d1573;};'use strict';var emlformat=require(_0xc6ce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc6ce('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc6ce('0x2'));var moment=require(_0xc6ce('0x3'));var BPromise=require(_0xc6ce('0x4'));var Mustache=require('mustache');var util=require(_0xc6ce('0x5'));var path=require(_0xc6ce('0x6'));var sox=require(_0xc6ce('0x7'));var csv=require(_0xc6ce('0x8'));var ejs=require(_0xc6ce('0x9'));var fs=require('fs');var fs_extra=require(_0xc6ce('0xa'));var _=require(_0xc6ce('0xb'));var squel=require(_0xc6ce('0xc'));var crypto=require(_0xc6ce('0xd'));var jsforce=require(_0xc6ce('0xe'));var deskjs=require(_0xc6ce('0xf'));var toCsv=require(_0xc6ce('0x8'));var querystring=require('querystring');var Papa=require(_0xc6ce('0x10'));var Redis=require(_0xc6ce('0x11'));var authService=require(_0xc6ce('0x12'));var qs=require(_0xc6ce('0x13'));var as=require(_0xc6ce('0x14'));var hardwareService=require(_0xc6ce('0x15'));var logger=require(_0xc6ce('0x16'))(_0xc6ce('0x17'));var utils=require(_0xc6ce('0x18'));var config=require(_0xc6ce('0x19'));var licenseUtil=require(_0xc6ce('0x1a'));var db=require(_0xc6ce('0x1b'))['db'];function respondWithStatusCode(_0x5724b9,_0x3741a0){_0x3741a0=_0x3741a0||0xcc;return function(_0x49bb48){if(_0x49bb48){return _0x5724b9[_0xc6ce('0x1c')](_0x3741a0);}return _0x5724b9['status'](_0x3741a0)[_0xc6ce('0x1d')]();};}function respondWithResult(_0x29c279,_0x1a9e21){_0x1a9e21=_0x1a9e21||0xc8;return function(_0x412a08){if(_0x412a08){return _0x29c279[_0xc6ce('0x1e')](_0x1a9e21)[_0xc6ce('0x1f')](_0x412a08);}};}function respondWithFilteredResult(_0x2f048c,_0x220e79){return function(_0x4661df){if(_0x4661df){var _0x28f018=typeof _0x220e79[_0xc6ce('0x20')]===_0xc6ce('0x21')&&typeof _0x220e79['limit']==='undefined';var _0x412684=_0x4661df[_0xc6ce('0x22')];var _0x3446f1=_0x28f018?0x0:_0x220e79[_0xc6ce('0x20')];var _0x289ca0=_0x28f018?_0x4661df[_0xc6ce('0x22')]:_0x220e79['offset']+_0x220e79['limit'];var _0xb0252;if(_0x289ca0>=_0x412684){_0x289ca0=_0x412684;_0xb0252=0xc8;}else{_0xb0252=0xce;}_0x2f048c[_0xc6ce('0x1e')](_0xb0252);return _0x2f048c[_0xc6ce('0x23')]('Content-Range',_0x3446f1+'-'+_0x289ca0+'/'+_0x412684)[_0xc6ce('0x1f')](_0x4661df);}return null;};}function patchUpdates(_0x277d2d){return function(_0x5b726d){try{jsonpatch[_0xc6ce('0x24')](_0x5b726d,_0x277d2d,!![]);}catch(_0x3703a6){return BPromise[_0xc6ce('0x25')](_0x3703a6);}return _0x5b726d[_0xc6ce('0x26')]();};}function saveUpdates(_0x2b869e,_0x36e324){return function(_0x511f70){if(_0x511f70){return _0x511f70[_0xc6ce('0x27')](_0x2b869e)[_0xc6ce('0x28')](function(_0x3bcdfa){return _0x3bcdfa;});}return null;};}function removeEntity(_0x23b669,_0x1b2b74){return function(_0x55ae82){if(_0x55ae82){return _0x55ae82[_0xc6ce('0x29')]()[_0xc6ce('0x28')](function(){_0x23b669['status'](0xcc)[_0xc6ce('0x1d')]();});}};}function handleEntityNotFound(_0x129f0a,_0x24a0ec){return function(_0x8ec0d1){if(!_0x8ec0d1){_0x129f0a[_0xc6ce('0x1c')](0x194);}return _0x8ec0d1;};}function handleError(_0x2d58c6,_0x196eca){_0x196eca=_0x196eca||0x1f4;return function(_0x4252f0){logger[_0xc6ce('0x2a')](_0x4252f0[_0xc6ce('0x2b')]);if(_0x4252f0[_0xc6ce('0x2c')]){delete _0x4252f0[_0xc6ce('0x2c')];}_0x2d58c6[_0xc6ce('0x1e')](_0x196eca)[_0xc6ce('0x2d')](_0x4252f0);};}exports[_0xc6ce('0x2e')]=function(_0x34cdc6,_0x1a6fa3){var _0x59e17b={},_0x2472e6={},_0x422d1d={'count':0x0,'rows':[]};var _0x56fc12=_[_0xc6ce('0x2f')](db[_0xc6ce('0x30')][_0xc6ce('0x31')],function(_0x569be0){return{'name':_0x569be0[_0xc6ce('0x32')],'type':_0x569be0['type'][_0xc6ce('0x33')]};});_0x2472e6[_0xc6ce('0x34')]=_['map'](_0x56fc12,_0xc6ce('0x2c'));_0x2472e6['query']=_[_0xc6ce('0x35')](_0x34cdc6[_0xc6ce('0x36')]);_0x2472e6['filters']=_[_0xc6ce('0x37')](_0x2472e6['model'],_0x2472e6['query']);_0x59e17b['attributes']=_[_0xc6ce('0x37')](_0x2472e6[_0xc6ce('0x34')],qs[_0xc6ce('0x38')](_0x34cdc6[_0xc6ce('0x36')]['fields']));_0x59e17b[_0xc6ce('0x39')]=_0x59e17b['attributes']['length']?_0x59e17b['attributes']:_0x2472e6[_0xc6ce('0x34')];if(!_0x34cdc6[_0xc6ce('0x36')]['hasOwnProperty'](_0xc6ce('0x3a'))){_0x59e17b[_0xc6ce('0x3b')]=qs['limit'](_0x34cdc6[_0xc6ce('0x36')]['limit']);_0x59e17b[_0xc6ce('0x20')]=qs[_0xc6ce('0x20')](_0x34cdc6[_0xc6ce('0x36')][_0xc6ce('0x20')]);}_0x59e17b[_0xc6ce('0x3c')]=qs[_0xc6ce('0x3d')](_0x34cdc6['query'][_0xc6ce('0x3d')]);_0x59e17b[_0xc6ce('0x3e')]=qs[_0xc6ce('0x3f')](_[_0xc6ce('0x40')](_0x34cdc6['query'],_0x2472e6['filters']),_0x56fc12);if(_0x34cdc6[_0xc6ce('0x36')][_0xc6ce('0x41')]){_0x59e17b['where']=_[_0xc6ce('0x42')](_0x59e17b['where'],{'$or':_[_0xc6ce('0x2f')](_0x56fc12,function(_0x5310c4){if(_0x5310c4[_0xc6ce('0x43')]!==_0xc6ce('0x44')){var _0x645ddc={};_0x645ddc[_0x5310c4[_0xc6ce('0x2c')]]={'$like':'%'+_0x34cdc6[_0xc6ce('0x36')][_0xc6ce('0x41')]+'%'};return _0x645ddc;}})});}_0x59e17b=_['merge']({},_0x59e17b,_0x34cdc6[_0xc6ce('0x45')]);var _0x1984c8={'where':_0x59e17b[_0xc6ce('0x3e')]};return db[_0xc6ce('0x30')][_0xc6ce('0x22')](_0x1984c8)[_0xc6ce('0x28')](function(_0x44d797){_0x422d1d['count']=_0x44d797;if(_0x34cdc6[_0xc6ce('0x36')][_0xc6ce('0x46')]){_0x59e17b[_0xc6ce('0x47')]=[{'all':!![]}];}return db[_0xc6ce('0x30')][_0xc6ce('0x48')](_0x59e17b);})[_0xc6ce('0x28')](function(_0x5b6968){_0x422d1d[_0xc6ce('0x49')]=_0x5b6968;return _0x422d1d;})[_0xc6ce('0x28')](respondWithFilteredResult(_0x1a6fa3,_0x59e17b))[_0xc6ce('0x4a')](handleError(_0x1a6fa3,null));};exports[_0xc6ce('0x4b')]=function(_0x101500,_0x1d9ab8){var _0x5b4199={'raw':!![],'where':{'id':_0x101500[_0xc6ce('0x4c')]['id']}},_0x27b063={};_0x27b063[_0xc6ce('0x34')]=_[_0xc6ce('0x35')](db['SmsApplication'][_0xc6ce('0x31')]);_0x27b063['query']=_['keys'](_0x101500['query']);_0x27b063[_0xc6ce('0x3f')]=_[_0xc6ce('0x37')](_0x27b063[_0xc6ce('0x34')],_0x27b063[_0xc6ce('0x36')]);_0x5b4199[_0xc6ce('0x39')]=_[_0xc6ce('0x37')](_0x27b063[_0xc6ce('0x34')],qs[_0xc6ce('0x38')](_0x101500[_0xc6ce('0x36')][_0xc6ce('0x38')]));_0x5b4199['attributes']=_0x5b4199[_0xc6ce('0x39')]['length']?_0x5b4199[_0xc6ce('0x39')]:_0x27b063['model'];if(_0x101500[_0xc6ce('0x36')]['includeAll']){_0x5b4199[_0xc6ce('0x47')]=[{'all':!![]}];}_0x5b4199=_['merge']({},_0x5b4199,_0x101500['options']);return db['SmsApplication'][_0xc6ce('0x4d')](_0x5b4199)[_0xc6ce('0x28')](handleEntityNotFound(_0x1d9ab8,null))[_0xc6ce('0x28')](respondWithResult(_0x1d9ab8,null))[_0xc6ce('0x4a')](handleError(_0x1d9ab8,null));};exports[_0xc6ce('0x4e')]=function(_0x1aab0a,_0x5991c8){return db[_0xc6ce('0x30')][_0xc6ce('0x4e')](_0x1aab0a['body'],{})[_0xc6ce('0x28')](respondWithResult(_0x5991c8,0xc9))[_0xc6ce('0x4a')](handleError(_0x5991c8,null));};exports[_0xc6ce('0x27')]=function(_0x433050,_0x4e8419){if(_0x433050[_0xc6ce('0x4f')]['id']){delete _0x433050[_0xc6ce('0x4f')]['id'];}return db[_0xc6ce('0x30')][_0xc6ce('0x4d')]({'where':{'id':_0x433050[_0xc6ce('0x4c')]['id']}})[_0xc6ce('0x28')](handleEntityNotFound(_0x4e8419,null))[_0xc6ce('0x28')](saveUpdates(_0x433050[_0xc6ce('0x4f')],null))[_0xc6ce('0x28')](respondWithResult(_0x4e8419,null))[_0xc6ce('0x4a')](handleError(_0x4e8419,null));};exports[_0xc6ce('0x29')]=function(_0x466d6e,_0x4b4f6a){return db['SmsApplication'][_0xc6ce('0x4d')]({'where':{'id':_0x466d6e[_0xc6ce('0x4c')]['id']}})[_0xc6ce('0x28')](handleEntityNotFound(_0x4b4f6a,null))[_0xc6ce('0x28')](removeEntity(_0x4b4f6a,null))[_0xc6ce('0x4a')](handleError(_0x4b4f6a,null));}; \ No newline at end of file +var _0x0d87=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','stack','name','send','map','SmsApplication','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','include','catch','params','rawAttributes','intersection','create','update','body','find'];(function(_0x14476b,_0xd1a7a4){var _0x24e2e8=function(_0x52ed26){while(--_0x52ed26){_0x14476b['push'](_0x14476b['shift']());}};_0x24e2e8(++_0xd1a7a4);}(_0x0d87,0x16d));var _0x70d8=function(_0x425496,_0x20ed8f){_0x425496=_0x425496-0x0;var _0x428293=_0x0d87[_0x425496];return _0x428293;};'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('moment');var BPromise=require(_0x70d8('0x5'));var Mustache=require(_0x70d8('0x6'));var util=require(_0x70d8('0x7'));var path=require(_0x70d8('0x8'));var sox=require(_0x70d8('0x9'));var csv=require(_0x70d8('0xa'));var ejs=require(_0x70d8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');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(_0x70d8('0x18'));var config=require(_0x70d8('0x19'));var licenseUtil=require(_0x70d8('0x1a'));var db=require(_0x70d8('0x1b'))['db'];function respondWithStatusCode(_0x4d2bce,_0x5ef8e7){_0x5ef8e7=_0x5ef8e7||0xcc;return function(_0x3ab2ea){if(_0x3ab2ea){return _0x4d2bce[_0x70d8('0x1c')](_0x5ef8e7);}return _0x4d2bce[_0x70d8('0x1d')](_0x5ef8e7)[_0x70d8('0x1e')]();};}function respondWithResult(_0x49cc58,_0x4dfbde){_0x4dfbde=_0x4dfbde||0xc8;return function(_0x3911c1){if(_0x3911c1){return _0x49cc58[_0x70d8('0x1d')](_0x4dfbde)[_0x70d8('0x1f')](_0x3911c1);}};}function respondWithFilteredResult(_0x1925d3,_0x28fd39){return function(_0x592d84){if(_0x592d84){var _0x2cad1d=typeof _0x28fd39[_0x70d8('0x20')]===_0x70d8('0x21')&&typeof _0x28fd39['limit']==='undefined';var _0x46d6b3=_0x592d84[_0x70d8('0x22')];var _0x504d94=_0x2cad1d?0x0:_0x28fd39['offset'];var _0x371754=_0x2cad1d?_0x592d84['count']:_0x28fd39['offset']+_0x28fd39[_0x70d8('0x23')];var _0x54ef71;if(_0x371754>=_0x46d6b3){_0x371754=_0x46d6b3;_0x54ef71=0xc8;}else{_0x54ef71=0xce;}_0x1925d3[_0x70d8('0x1d')](_0x54ef71);return _0x1925d3[_0x70d8('0x24')](_0x70d8('0x25'),_0x504d94+'-'+_0x371754+'/'+_0x46d6b3)['json'](_0x592d84);}return null;};}function patchUpdates(_0xdf39ca){return function(_0x3a634c){try{jsonpatch[_0x70d8('0x26')](_0x3a634c,_0xdf39ca,!![]);}catch(_0xab4136){return BPromise['reject'](_0xab4136);}return _0x3a634c[_0x70d8('0x27')]();};}function saveUpdates(_0x313db5,_0x561935){return function(_0x5e5db8){if(_0x5e5db8){return _0x5e5db8['update'](_0x313db5)[_0x70d8('0x28')](function(_0x19c97d){return _0x19c97d;});}return null;};}function removeEntity(_0x205caf,_0x1d7cdb){return function(_0x222169){if(_0x222169){return _0x222169[_0x70d8('0x29')]()[_0x70d8('0x28')](function(){_0x205caf[_0x70d8('0x1d')](0xcc)[_0x70d8('0x1e')]();});}};}function handleEntityNotFound(_0x593909,_0x289d0b){return function(_0x1500b7){if(!_0x1500b7){_0x593909['sendStatus'](0x194);}return _0x1500b7;};}function handleError(_0x5000fb,_0xee3149){_0xee3149=_0xee3149||0x1f4;return function(_0x422157){logger['error'](_0x422157[_0x70d8('0x2a')]);if(_0x422157[_0x70d8('0x2b')]){delete _0x422157[_0x70d8('0x2b')];}_0x5000fb[_0x70d8('0x1d')](_0xee3149)[_0x70d8('0x2c')](_0x422157);};}exports['index']=function(_0x5669cf,_0x5f3f1b){var _0x2b2b60={},_0x5341b7={},_0x1483c2={'count':0x0,'rows':[]};var _0x421d7f=_[_0x70d8('0x2d')](db[_0x70d8('0x2e')]['rawAttributes'],function(_0x51f83d){return{'name':_0x51f83d['fieldName'],'type':_0x51f83d[_0x70d8('0x2f')][_0x70d8('0x30')]};});_0x5341b7['model']=_[_0x70d8('0x2d')](_0x421d7f,_0x70d8('0x2b'));_0x5341b7[_0x70d8('0x31')]=_[_0x70d8('0x32')](_0x5669cf[_0x70d8('0x31')]);_0x5341b7[_0x70d8('0x33')]=_['intersection'](_0x5341b7[_0x70d8('0x34')],_0x5341b7[_0x70d8('0x31')]);_0x2b2b60[_0x70d8('0x35')]=_['intersection'](_0x5341b7[_0x70d8('0x34')],qs[_0x70d8('0x36')](_0x5669cf[_0x70d8('0x31')]['fields']));_0x2b2b60[_0x70d8('0x35')]=_0x2b2b60[_0x70d8('0x35')][_0x70d8('0x37')]?_0x2b2b60[_0x70d8('0x35')]:_0x5341b7[_0x70d8('0x34')];if(!_0x5669cf[_0x70d8('0x31')][_0x70d8('0x38')]('nolimit')){_0x2b2b60[_0x70d8('0x23')]=qs[_0x70d8('0x23')](_0x5669cf[_0x70d8('0x31')][_0x70d8('0x23')]);_0x2b2b60['offset']=qs[_0x70d8('0x20')](_0x5669cf['query']['offset']);}_0x2b2b60[_0x70d8('0x39')]=qs['sort'](_0x5669cf[_0x70d8('0x31')][_0x70d8('0x3a')]);_0x2b2b60[_0x70d8('0x3b')]=qs[_0x70d8('0x33')](_[_0x70d8('0x3c')](_0x5669cf[_0x70d8('0x31')],_0x5341b7['filters']),_0x421d7f);if(_0x5669cf[_0x70d8('0x31')]['filter']){_0x2b2b60[_0x70d8('0x3b')]=_[_0x70d8('0x3d')](_0x2b2b60[_0x70d8('0x3b')],{'$or':_[_0x70d8('0x2d')](_0x421d7f,function(_0x5939f3){if(_0x5939f3['type']!=='VIRTUAL'){var _0x3c8e37={};_0x3c8e37[_0x5939f3[_0x70d8('0x2b')]]={'$like':'%'+_0x5669cf[_0x70d8('0x31')][_0x70d8('0x3e')]+'%'};return _0x3c8e37;}})});}_0x2b2b60=_['merge']({},_0x2b2b60,_0x5669cf[_0x70d8('0x3f')]);var _0x5e492c={'where':_0x2b2b60[_0x70d8('0x3b')]};return db['SmsApplication'][_0x70d8('0x22')](_0x5e492c)[_0x70d8('0x28')](function(_0x52fbe6){_0x1483c2[_0x70d8('0x22')]=_0x52fbe6;if(_0x5669cf[_0x70d8('0x31')]['includeAll']){_0x2b2b60[_0x70d8('0x40')]=[{'all':!![]}];}return db[_0x70d8('0x2e')]['findAll'](_0x2b2b60);})[_0x70d8('0x28')](function(_0x434aba){_0x1483c2['rows']=_0x434aba;return _0x1483c2;})['then'](respondWithFilteredResult(_0x5f3f1b,_0x2b2b60))[_0x70d8('0x41')](handleError(_0x5f3f1b,null));};exports['show']=function(_0x482d74,_0x18853d){var _0x10a1b1={'raw':!![],'where':{'id':_0x482d74[_0x70d8('0x42')]['id']}},_0x170cdf={};_0x170cdf[_0x70d8('0x34')]=_[_0x70d8('0x32')](db['SmsApplication'][_0x70d8('0x43')]);_0x170cdf[_0x70d8('0x31')]=_['keys'](_0x482d74[_0x70d8('0x31')]);_0x170cdf['filters']=_['intersection'](_0x170cdf[_0x70d8('0x34')],_0x170cdf[_0x70d8('0x31')]);_0x10a1b1['attributes']=_[_0x70d8('0x44')](_0x170cdf['model'],qs['fields'](_0x482d74['query'][_0x70d8('0x36')]));_0x10a1b1[_0x70d8('0x35')]=_0x10a1b1[_0x70d8('0x35')]['length']?_0x10a1b1[_0x70d8('0x35')]:_0x170cdf[_0x70d8('0x34')];if(_0x482d74[_0x70d8('0x31')]['includeAll']){_0x10a1b1[_0x70d8('0x40')]=[{'all':!![]}];}_0x10a1b1=_[_0x70d8('0x3d')]({},_0x10a1b1,_0x482d74[_0x70d8('0x3f')]);return db[_0x70d8('0x2e')]['find'](_0x10a1b1)[_0x70d8('0x28')](handleEntityNotFound(_0x18853d,null))['then'](respondWithResult(_0x18853d,null))['catch'](handleError(_0x18853d,null));};exports[_0x70d8('0x45')]=function(_0x20ce95,_0x59adec){return db['SmsApplication'][_0x70d8('0x45')](_0x20ce95['body'],{})['then'](respondWithResult(_0x59adec,0xc9))['catch'](handleError(_0x59adec,null));};exports[_0x70d8('0x46')]=function(_0x343e52,_0x44e552){if(_0x343e52['body']['id']){delete _0x343e52[_0x70d8('0x47')]['id'];}return db[_0x70d8('0x2e')][_0x70d8('0x48')]({'where':{'id':_0x343e52['params']['id']}})[_0x70d8('0x28')](handleEntityNotFound(_0x44e552,null))['then'](saveUpdates(_0x343e52[_0x70d8('0x47')],null))[_0x70d8('0x28')](respondWithResult(_0x44e552,null))['catch'](handleError(_0x44e552,null));};exports[_0x70d8('0x29')]=function(_0x136127,_0x32bc2e){return db[_0x70d8('0x2e')][_0x70d8('0x48')]({'where':{'id':_0x136127['params']['id']}})[_0x70d8('0x28')](handleEntityNotFound(_0x32bc2e,null))[_0x70d8('0x28')](removeEntity(_0x32bc2e,null))[_0x70d8('0x41')](handleError(_0x32bc2e,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 7616b27..5070323 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 _0x72bb=['request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x54b742,_0x409961){var _0x46e592=function(_0x5185fa){while(--_0x5185fa){_0x54b742['push'](_0x54b742['shift']());}};_0x46e592(++_0x409961);}(_0x72bb,0x14a));var _0xb72b=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0x72bb[_0x3042c5];return _0x7cd140;};'use strict';var _=require(_0xb72b('0x0'));var util=require(_0xb72b('0x1'));var logger=require(_0xb72b('0x2'))(_0xb72b('0x3'));var moment=require(_0xb72b('0x4'));var BPromise=require(_0xb72b('0x5'));var rp=require(_0xb72b('0x6'));var fs=require('fs');var path=require(_0xb72b('0x7'));var rimraf=require(_0xb72b('0x8'));var config=require(_0xb72b('0x9'));var attributes=require(_0xb72b('0xa'));module['exports']=function(_0x516d07,_0x4c7891){return _0x516d07[_0xb72b('0xb')](_0xb72b('0xc'),attributes,{'tableName':_0xb72b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb72b('0xe'),'collate':_0xb72b('0xf')});}; \ No newline at end of file +var _0x50df=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x50df,0x168));var _0xf50d=function(_0x1eb1de,_0x52472d){_0x1eb1de=_0x1eb1de-0x0;var _0x3b4c3e=_0x50df[_0x1eb1de];return _0x3b4c3e;};'use strict';var _=require(_0xf50d('0x0'));var util=require('util');var logger=require(_0xf50d('0x1'))(_0xf50d('0x2'));var moment=require(_0xf50d('0x3'));var BPromise=require(_0xf50d('0x4'));var rp=require(_0xf50d('0x5'));var fs=require('fs');var path=require(_0xf50d('0x6'));var rimraf=require(_0xf50d('0x7'));var config=require(_0xf50d('0x8'));var attributes=require('./smsApplication.attributes');module[_0xf50d('0x9')]=function(_0x4226d0,_0x1e25f1){return _0x4226d0[_0xf50d('0xa')](_0xf50d('0xb'),attributes,{'tableName':_0xf50d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf50d('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 2b46cda..df352ad 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 _0x1867=['http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1670a0,_0x377abe){var _0x518924=function(_0x462bba){while(--_0x462bba){_0x1670a0['push'](_0x1670a0['shift']());}};_0x518924(++_0x377abe);}(_0x1867,0xb5));var _0x7186=function(_0x3ca207,_0x3a29ba){_0x3ca207=_0x3ca207-0x0;var _0x331f94=_0x1867[_0x3ca207];return _0x331f94;};'use strict';var _=require(_0x7186('0x0'));var util=require(_0x7186('0x1'));var moment=require('moment');var BPromise=require(_0x7186('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7186('0x3'));var db=require(_0x7186('0x4'))['db'];var utils=require(_0x7186('0x5'));var logger=require(_0x7186('0x6'))(_0x7186('0x7'));var config=require(_0x7186('0x8'));var jayson=require(_0x7186('0x9'));var client=jayson[_0x7186('0xa')][_0x7186('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bea9f,_0x45938b,_0x18c4b9){return new BPromise(function(_0x546a90,_0x350c54){return client[_0x7186('0xc')](_0x4bea9f,_0x18c4b9)[_0x7186('0xd')](function(_0xb49c4b){logger['info'](_0x7186('0xe'),_0x45938b,_0x7186('0xf'));logger[_0x7186('0x10')](_0x7186('0x11'),_0x45938b,_0x7186('0xf'),JSON['stringify'](_0xb49c4b));if(_0xb49c4b[_0x7186('0x12')]){if(_0xb49c4b[_0x7186('0x12')][_0x7186('0x13')]===0x1f4){logger[_0x7186('0x12')]('SmsApplication,\x20%s,\x20%s',_0x45938b,_0xb49c4b[_0x7186('0x12')][_0x7186('0x14')]);return _0x350c54(_0xb49c4b[_0x7186('0x12')][_0x7186('0x14')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x45938b,_0xb49c4b['error'][_0x7186('0x14')]);return _0x546a90(_0xb49c4b[_0x7186('0x12')][_0x7186('0x14')]);}else{logger[_0x7186('0x15')]('SmsApplication,\x20%s,\x20%s',_0x45938b,_0x7186('0xf'));_0x546a90(_0xb49c4b[_0x7186('0x16')][_0x7186('0x14')]);}})[_0x7186('0x17')](function(_0x6508f5){logger[_0x7186('0x12')](_0x7186('0xe'),_0x45938b,_0x6508f5);_0x350c54(_0x6508f5);});});} \ No newline at end of file +var _0x38b8=['client','http','request','then','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc'];(function(_0x2b152a,_0x3dd988){var _0x2ad4c7=function(_0x2fa97c){while(--_0x2fa97c){_0x2b152a['push'](_0x2b152a['shift']());}};_0x2ad4c7(++_0x3dd988);}(_0x38b8,0x7f));var _0x838b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x38b8[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x838b('0x0'));var util=require('util');var moment=require(_0x838b('0x1'));var BPromise=require(_0x838b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x838b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x838b('0x4'))(_0x838b('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x838b('0x6')][_0x838b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5c516c,_0x2d3e96,_0x15184b){return new BPromise(function(_0x4b9530,_0x552245){return client[_0x838b('0x8')](_0x5c516c,_0x15184b)[_0x838b('0x9')](function(_0x31ba84){logger['info'](_0x838b('0xa'),_0x2d3e96,'request\x20sent');logger[_0x838b('0xb')](_0x838b('0xc'),_0x2d3e96,_0x838b('0xd'),JSON[_0x838b('0xe')](_0x31ba84));if(_0x31ba84[_0x838b('0xf')]){if(_0x31ba84[_0x838b('0xf')]['code']===0x1f4){logger[_0x838b('0xf')](_0x838b('0xa'),_0x2d3e96,_0x31ba84[_0x838b('0xf')][_0x838b('0x10')]);return _0x552245(_0x31ba84[_0x838b('0xf')][_0x838b('0x10')]);}logger[_0x838b('0xf')](_0x838b('0xa'),_0x2d3e96,_0x31ba84[_0x838b('0xf')]['message']);return _0x4b9530(_0x31ba84[_0x838b('0xf')]['message']);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x2d3e96,_0x838b('0xd'));_0x4b9530(_0x31ba84[_0x838b('0x11')][_0x838b('0x10')]);}})[_0x838b('0x12')](function(_0x94e893){logger['error'](_0x838b('0xa'),_0x2d3e96,_0x94e893);_0x552245(_0x94e893);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 7bc4fb0..8073f21 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 _0xb62e=['removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','get','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','smsinteraction:addtags','addTags','put','sms','smsinteraction:update','update','delete','smsinteraction:destroy','destroy'];(function(_0x2cb996,_0x595dad){var _0x3d9fce=function(_0x367a33){while(--_0x367a33){_0x2cb996['push'](_0x2cb996['shift']());}};_0x3d9fce(++_0x595dad);}(_0xb62e,0x1de));var _0xeb62=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb62e[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var path=require(_0xeb62('0x2'));var timeout=require(_0xeb62('0x3'));var express=require('express');var router=express[_0xeb62('0x4')]();var fs_extra=require(_0xeb62('0x5'));var auth=require(_0xeb62('0x6'));var interaction=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var controller=require(_0xeb62('0x9'));router['get']('/',auth[_0xeb62('0xa')](),controller[_0xeb62('0xb')]);router[_0xeb62('0xc')]('/describe',auth[_0xeb62('0xa')](),controller[_0xeb62('0xd')]);router[_0xeb62('0xc')](_0xeb62('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xeb62('0xc')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x10')]);router[_0xeb62('0xc')](_0xeb62('0x11'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x12')]);router[_0xeb62('0x13')]('/',auth[_0xeb62('0xa')](),controller['create']);router[_0xeb62('0x13')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x14')]);router['post'](_0xeb62('0x15'),auth[_0xeb62('0xa')](),interaction[_0xeb62('0x16')]('sms',_0xeb62('0x17')),controller[_0xeb62('0x18')]);router[_0xeb62('0x19')]('/:id',auth[_0xeb62('0xa')](),interaction[_0xeb62('0x16')](_0xeb62('0x1a'),_0xeb62('0x1b')),controller[_0xeb62('0x1c')]);router[_0xeb62('0x1d')](_0xeb62('0xe'),auth[_0xeb62('0xa')](),interaction[_0xeb62('0x16')](_0xeb62('0x1a'),_0xeb62('0x1e')),controller[_0xeb62('0x1f')]);router[_0xeb62('0x1d')]('/:id/tags',auth[_0xeb62('0xa')](),controller[_0xeb62('0x20')]);module[_0xeb62('0x21')]=router; \ No newline at end of file +var _0x6e6c=['create','addMessage','tracked','sms','smsinteraction:addtags','addTags','/:id','smsinteraction:update','update','smsinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id/messages','getMessages','/:id/download','download','post'];(function(_0x368a43,_0x1038a2){var _0x1870b6=function(_0x425fb4){while(--_0x425fb4){_0x368a43['push'](_0x368a43['shift']());}};_0x1870b6(++_0x1038a2);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var path=require('path');var timeout=require(_0xc6e6('0x2'));var express=require(_0xc6e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc6e6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6e6('0x5'));var controller=require('./smsInteraction.controller');router[_0xc6e6('0x6')]('/',auth[_0xc6e6('0x7')](),controller['index']);router[_0xc6e6('0x6')](_0xc6e6('0x8'),auth['isAuthenticated'](),controller[_0xc6e6('0x9')]);router[_0xc6e6('0x6')]('/:id',auth[_0xc6e6('0x7')](),controller['show']);router[_0xc6e6('0x6')](_0xc6e6('0xa'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xb')]);router[_0xc6e6('0x6')](_0xc6e6('0xc'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xd')]);router[_0xc6e6('0xe')]('/',auth['isAuthenticated'](),controller[_0xc6e6('0xf')]);router['post'](_0xc6e6('0xa'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0x10')]);router[_0xc6e6('0xe')]('/:id/tags',auth[_0xc6e6('0x7')](),interaction[_0xc6e6('0x11')](_0xc6e6('0x12'),_0xc6e6('0x13')),controller[_0xc6e6('0x14')]);router['put'](_0xc6e6('0x15'),auth[_0xc6e6('0x7')](),interaction['tracked'](_0xc6e6('0x12'),_0xc6e6('0x16')),controller[_0xc6e6('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0xc6e6('0x11')]('sms',_0xc6e6('0x18')),controller[_0xc6e6('0x19')]);router[_0xc6e6('0x1a')](_0xc6e6('0x1b'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0x1c')]);module[_0xc6e6('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 42de7a2..867d069 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 _0xebcd=['DATE','ENUM','out','BOOLEAN','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xebcd,0x18c));var _0xdebc=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0xebcd[_0x4d82ea];return _0x257f4a;};'use strict';var Sequelize=require(_0xdebc('0x0'));var moment=require('moment');module[_0xdebc('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xdebc('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xdebc('0x2')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xdebc('0x2')]},'read1stAt':{'type':Sequelize[_0xdebc('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xdebc('0x4')]('in',_0xdebc('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdebc('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xdebc('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xdebc('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x13cc=['out','ENUM','INTEGER','exports','BOOLEAN','STRING','DATE'];(function(_0x1c6dc4,_0x40a088){var _0x8a65c=function(_0x2fe808){while(--_0x2fe808){_0x1c6dc4['push'](_0x1c6dc4['shift']());}};_0x8a65c(++_0x40a088);}(_0x13cc,0x161));var _0xc13c=function(_0x345b02,_0x454869){_0x345b02=_0x345b02-0x0;var _0x51483b=_0x13cc[_0x345b02];return _0x51483b;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xc13c('0x0')]={'closed':{'type':Sequelize[_0xc13c('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc13c('0x2')]},'secondDisposition':{'type':Sequelize[_0xc13c('0x2')]},'thirdDisposition':{'type':Sequelize[_0xc13c('0x2')]},'note':{'type':Sequelize[_0xc13c('0x2')]},'phone':{'type':Sequelize[_0xc13c('0x2')]},'read1stAt':{'type':Sequelize[_0xc13c('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xc13c('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc13c('0x5')]('in',_0xc13c('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc13c('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xc13c('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 8938add..6352627 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 _0x34af=['transcript-%d-%s.zip','User','push','Contact','firstName','lastName','Messages','direction','read','SmsAccount','Account','Owner','fullname','get','mkdirSync','N.A.','createdAt','closed','YYYY-MM-DD\x20HH:mm:ss','disposition','out','secret','value','renderFile','downloadInteraction.ejs','.pdf','Sms','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','offset','undefined','count','set','Content-Range','json','update','then','error','stack','name','send','map','SmsInteraction','rawAttributes','fieldName','key','getOptions','findAll','sms','query','user','catch','show','params','model','filters','attributes','fields','length','include','find','create','body','destroy','describe','addMessage','omit','ids','getMessages','findOne','SmsMessage','keys','intersection','hasOwnProperty','limit','order','sort','where','SmsInteractionId','filter','merge','$gte','split','format','includeAll','rows','addTags','setTags','Tag','color','emit','removeTags','download','unix','toString','join','root','server','files','tmp'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x34af,0x18a));var _0xf34a=function(_0x753696,_0x418df9){_0x753696=_0x753696-0x0;var _0x351012=_0x34af[_0x753696];return _0x351012;};'use strict';var rimraf=require(_0xf34a('0x0'));var zipdir=require(_0xf34a('0x1'));var moment=require(_0xf34a('0x2'));var BPromise=require(_0xf34a('0x3'));var util=require(_0xf34a('0x4'));var path=require(_0xf34a('0x5'));var ejs=require(_0xf34a('0x6'));var fs=require('fs');var _=require(_0xf34a('0x7'));var Redis=require(_0xf34a('0x8'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0xf34a('0x9'));var logger=require('../../config/logger')(_0xf34a('0xa'));var config=require(_0xf34a('0xb'));var db=require(_0xf34a('0xc'))['db'];config[_0xf34a('0xd')]=_[_0xf34a('0xe')](config['redis'],{'host':_0xf34a('0xf'),'port':0x18eb});var socket=require(_0xf34a('0x10'))(new Redis(config[_0xf34a('0xd')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x2e7d2c,_0x207b23){_0x207b23=_0x207b23||0xcc;return function(_0x20f48f){if(_0x20f48f){return _0x2e7d2c[_0xf34a('0x11')](_0x207b23);}return _0x2e7d2c['status'](_0x207b23)['end']();};}function respondWithResult(_0x51d289,_0x59268e){_0x59268e=_0x59268e||0xc8;return function(_0x4c3809){if(_0x4c3809){return _0x51d289[_0xf34a('0x12')](_0x59268e)['json'](_0x4c3809);}};}function respondWithFilteredResult(_0x3f2bd6,_0x404eac){return function(_0x4138a1){if(_0x4138a1){var _0x55e8aa=typeof _0x404eac[_0xf34a('0x13')]===_0xf34a('0x14')&&typeof _0x404eac['limit']===_0xf34a('0x14');var _0x40b311=_0x4138a1[_0xf34a('0x15')];var _0x2d859d=_0x55e8aa?0x0:_0x404eac[_0xf34a('0x13')];var _0x22d0df=_0x55e8aa?_0x4138a1[_0xf34a('0x15')]:_0x404eac[_0xf34a('0x13')]+_0x404eac['limit'];var _0x4f0348;if(_0x22d0df>=_0x40b311){_0x22d0df=_0x40b311;_0x4f0348=0xc8;}else{_0x4f0348=0xce;}_0x3f2bd6['status'](_0x4f0348);return _0x3f2bd6[_0xf34a('0x16')](_0xf34a('0x17'),_0x2d859d+'-'+_0x22d0df+'/'+_0x40b311)[_0xf34a('0x18')](_0x4138a1);}return null;};}function saveUpdates(_0x5016c8){return function(_0x539b3b){if(_0x539b3b){return _0x539b3b[_0xf34a('0x19')](_0x5016c8)[_0xf34a('0x1a')](function(_0x1dd1ee){return _0x1dd1ee;});}return null;};}function removeEntity(_0x26e191){return function(_0x2ec3d0){if(_0x2ec3d0){return _0x2ec3d0['destroy']()[_0xf34a('0x1a')](function(){_0x26e191['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4594d3){return function(_0x2be026){if(!_0x2be026){_0x4594d3[_0xf34a('0x11')](0x194);}return _0x2be026;};}function handleError(_0x5ececc,_0x10e2ff){_0x10e2ff=_0x10e2ff||0x1f4;return function(_0xda169c){logger[_0xf34a('0x1b')](_0xda169c[_0xf34a('0x1c')]);if(_0xda169c[_0xf34a('0x1d')]){delete _0xda169c[_0xf34a('0x1d')];}_0x5ececc['status'](_0x10e2ff)[_0xf34a('0x1e')](_0xda169c);};}exports['index']=function(_0x113133,_0x453230){var _0x1902d5={};var _0x3d1f06=_[_0xf34a('0x1f')](db[_0xf34a('0x20')][_0xf34a('0x21')],function(_0x4e7b02){return{'name':_0x4e7b02[_0xf34a('0x22')],'type':_0x4e7b02['type'][_0xf34a('0x23')]};});_0x1902d5=qs[_0xf34a('0x24')](_0x3d1f06,_0x113133);return interaction[_0xf34a('0x25')](_0xf34a('0x26'),_0x113133[_0xf34a('0x27')],_0x113133[_0xf34a('0x28')],_0x1902d5,_0x3d1f06)['then'](respondWithFilteredResult(_0x453230,_0x1902d5))[_0xf34a('0x29')](handleError(_0x453230,null));};exports[_0xf34a('0x2a')]=function(_0x2a97b2,_0x140d9a){var _0x5d8a50={'raw':![],'where':{'id':_0x2a97b2[_0xf34a('0x2b')]['id']}},_0x1f12d9={};_0x1f12d9[_0xf34a('0x2c')]=_['keys'](db[_0xf34a('0x20')]['rawAttributes']);_0x1f12d9[_0xf34a('0x27')]=_['keys'](_0x2a97b2[_0xf34a('0x27')]);_0x1f12d9[_0xf34a('0x2d')]=_['intersection'](_0x1f12d9[_0xf34a('0x2c')],_0x1f12d9[_0xf34a('0x27')]);_0x5d8a50[_0xf34a('0x2e')]=_['intersection'](_0x1f12d9[_0xf34a('0x2c')],qs['fields'](_0x2a97b2[_0xf34a('0x27')][_0xf34a('0x2f')]));_0x5d8a50[_0xf34a('0x2e')]=_0x5d8a50['attributes'][_0xf34a('0x30')]?_0x5d8a50[_0xf34a('0x2e')]:_0x1f12d9[_0xf34a('0x2c')];if(_0x2a97b2['query']['includeAll']){_0x5d8a50[_0xf34a('0x31')]=[{'all':!![]}];}_0x5d8a50=_['merge']({},_0x5d8a50,_0x2a97b2['options']);return db[_0xf34a('0x20')][_0xf34a('0x32')](_0x5d8a50)[_0xf34a('0x1a')](handleEntityNotFound(_0x140d9a,null))[_0xf34a('0x1a')](respondWithResult(_0x140d9a,null))[_0xf34a('0x29')](handleError(_0x140d9a,null));};exports[_0xf34a('0x33')]=function(_0x1cdb0e,_0x544950){return db[_0xf34a('0x20')][_0xf34a('0x33')](_0x1cdb0e[_0xf34a('0x34')],{})[_0xf34a('0x1a')](respondWithResult(_0x544950,0xc9))[_0xf34a('0x29')](handleError(_0x544950,null));};exports[_0xf34a('0x19')]=function(_0x3ec7a5,_0x710e64){if(_0x3ec7a5[_0xf34a('0x34')]['id']){delete _0x3ec7a5[_0xf34a('0x34')]['id'];}return db[_0xf34a('0x20')][_0xf34a('0x32')]({'where':{'id':_0x3ec7a5[_0xf34a('0x2b')]['id']}})[_0xf34a('0x1a')](handleEntityNotFound(_0x710e64,null))['then'](saveUpdates(_0x3ec7a5[_0xf34a('0x34')],null))[_0xf34a('0x1a')](respondWithResult(_0x710e64,null))[_0xf34a('0x29')](handleError(_0x710e64,null));};exports[_0xf34a('0x35')]=function(_0x57973e,_0x1b9963){return db[_0xf34a('0x20')]['find']({'where':{'id':_0x57973e[_0xf34a('0x2b')]['id']}})[_0xf34a('0x1a')](handleEntityNotFound(_0x1b9963,null))[_0xf34a('0x1a')](removeEntity(_0x1b9963,null))['catch'](handleError(_0x1b9963,null));};exports[_0xf34a('0x36')]=function(_0x39d153,_0x226e5d){return db[_0xf34a('0x20')]['describe']()[_0xf34a('0x1a')](respondWithResult(_0x226e5d,null))['catch'](handleError(_0x226e5d,null));};exports['addMessage']=function(_0x4332d6,_0x3a8bde){return db['SmsMessage'][_0xf34a('0x32')]({'where':{'id':_0x4332d6[_0xf34a('0x2b')]['id']}})['then'](handleEntityNotFound(_0x3a8bde,null))[_0xf34a('0x1a')](function(_0x192de3){if(_0x192de3){return _0x192de3[_0xf34a('0x37')](_0x4332d6[_0xf34a('0x34')]['ids'],_[_0xf34a('0x38')](_0x4332d6[_0xf34a('0x34')],[_0xf34a('0x39'),'id'])||{});}})[_0xf34a('0x1a')](respondWithResult(_0x3a8bde,null))[_0xf34a('0x29')](handleError(_0x3a8bde,null));};exports[_0xf34a('0x3a')]=function(_0x185fe9,_0x390c10){var _0x5b4010={'raw':![],'where':{}};var _0x2d40e6={};var _0x4c5c3c={'count':0x0,'rows':[]};return db[_0xf34a('0x20')][_0xf34a('0x3b')]({'where':{'id':_0x185fe9[_0xf34a('0x2b')]['id']}})[_0xf34a('0x1a')](handleEntityNotFound(_0x390c10,null))[_0xf34a('0x1a')](function(_0x1bb44e){if(_0x1bb44e){_0x2d40e6[_0xf34a('0x2c')]=_['keys'](db[_0xf34a('0x3c')][_0xf34a('0x21')]);_0x2d40e6[_0xf34a('0x27')]=_[_0xf34a('0x3d')](_0x185fe9[_0xf34a('0x27')]);_0x2d40e6[_0xf34a('0x2d')]=_['intersection'](_0x2d40e6[_0xf34a('0x2c')],_0x2d40e6[_0xf34a('0x27')]);_0x5b4010[_0xf34a('0x2e')]=_[_0xf34a('0x3e')](_0x2d40e6[_0xf34a('0x2c')],qs[_0xf34a('0x2f')](_0x185fe9[_0xf34a('0x27')]['fields']));_0x5b4010[_0xf34a('0x2e')]=_0x5b4010[_0xf34a('0x2e')]['length']?_0x5b4010[_0xf34a('0x2e')]:_0x2d40e6[_0xf34a('0x2c')];if(!_0x185fe9['query'][_0xf34a('0x3f')]('nolimit')){_0x5b4010[_0xf34a('0x40')]=qs['limit'](_0x185fe9['query'][_0xf34a('0x40')]);_0x5b4010[_0xf34a('0x13')]=qs[_0xf34a('0x13')](_0x185fe9[_0xf34a('0x27')][_0xf34a('0x13')]);}_0x5b4010[_0xf34a('0x41')]=qs['sort'](_0x185fe9['query'][_0xf34a('0x42')]);_0x5b4010[_0xf34a('0x43')]=qs[_0xf34a('0x2d')](_['pick'](_0x185fe9[_0xf34a('0x27')],_0x2d40e6[_0xf34a('0x2d')]));_0x5b4010[_0xf34a('0x43')][_0xf34a('0x44')]=_0x1bb44e['id'];if(_0x185fe9[_0xf34a('0x27')][_0xf34a('0x45')]){_0x5b4010['where']=_[_0xf34a('0x46')](_0x5b4010['where'],{'$or':_['map'](_0x5b4010[_0xf34a('0x2e')],function(_0x1081b6){var _0x3bf160={};_0x3bf160[_0x1081b6]={'$like':'%'+_0x185fe9[_0xf34a('0x27')][_0xf34a('0x45')]+'%'};return _0x3bf160;})});}if(_0x185fe9['query']['$gte']){var _0x156f65=_0x185fe9['query'][_0xf34a('0x47')][_0xf34a('0x48')](',');var _0x35bbe6={};_0x35bbe6[_0x156f65[0x0]]={'$gte':moment(_0x156f65[0x1])[_0xf34a('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5b4010[_0xf34a('0x43')]=_[_0xf34a('0x46')](_0x5b4010[_0xf34a('0x43')],_0x35bbe6);}_0x5b4010=_[_0xf34a('0x46')]({},_0x5b4010,_0x185fe9['options']);return db['SmsMessage'][_0xf34a('0x15')]({'where':_0x5b4010['where']})[_0xf34a('0x1a')](function(_0x3b7b1c){_0x4c5c3c[_0xf34a('0x15')]=_0x3b7b1c;if(_0x185fe9[_0xf34a('0x27')][_0xf34a('0x4a')]){_0x5b4010[_0xf34a('0x31')]=[{'all':!![]}];}return db['SmsMessage'][_0xf34a('0x25')](_0x5b4010);})[_0xf34a('0x1a')](function(_0x456c33){_0x4c5c3c[_0xf34a('0x4b')]=_0x456c33;return _0x4c5c3c;});}})[_0xf34a('0x1a')](respondWithFilteredResult(_0x390c10,_0x5b4010))['catch'](handleError(_0x390c10,null));};exports[_0xf34a('0x4c')]=function(_0x45e056,_0x2ba1f4){return db[_0xf34a('0x20')][_0xf34a('0x32')]({'where':{'id':_0x45e056['params']['id']}})[_0xf34a('0x1a')](handleEntityNotFound(_0x2ba1f4,null))[_0xf34a('0x1a')](function(_0x403e14){if(_0x403e14){return _0x403e14[_0xf34a('0x4d')](_0x45e056[_0xf34a('0x34')][_0xf34a('0x39')],_[_0xf34a('0x38')](_0x45e056['body'],[_0xf34a('0x39'),'id'])||{})['spread'](function(){return db[_0xf34a('0x4e')][_0xf34a('0x25')]({'attributes':['id',_0xf34a('0x1d'),_0xf34a('0x4f')],'where':{'id':_0x45e056[_0xf34a('0x34')][_0xf34a('0x39')]}});})[_0xf34a('0x1a')](function(_0x2e2d10){socket[_0xf34a('0x50')]('smsInteractionTags:save',{'id':Number(_0x45e056[_0xf34a('0x2b')]['id']),'tags':_0x2e2d10||[]});return{'id':Number(_0x45e056[_0xf34a('0x2b')]['id']),'tags':_0x2e2d10||[]};});}})[_0xf34a('0x1a')](respondWithResult(_0x2ba1f4,null))[_0xf34a('0x29')](handleError(_0x2ba1f4,null));};exports[_0xf34a('0x51')]=function(_0x280a51,_0x2dea4f){return db[_0xf34a('0x20')][_0xf34a('0x32')]({'where':{'id':_0x280a51[_0xf34a('0x2b')]['id']}})[_0xf34a('0x1a')](handleEntityNotFound(_0x2dea4f,null))[_0xf34a('0x1a')](function(_0x58c95e){if(_0x58c95e){return _0x58c95e[_0xf34a('0x51')](_0x280a51[_0xf34a('0x27')][_0xf34a('0x39')]);}})[_0xf34a('0x1a')](respondWithStatusCode(_0x2dea4f,null))[_0xf34a('0x29')](handleError(_0x2dea4f,null));};exports[_0xf34a('0x52')]=function(_0x50b01c,_0x4530e4){var _0x2f5b70=moment()[_0xf34a('0x53')]()[_0xf34a('0x54')]();var _0x170ba5=path[_0xf34a('0x55')](config[_0xf34a('0x56')],_0xf34a('0x57'),_0xf34a('0x58'),_0xf34a('0x59'));var _0x5a5428=path[_0xf34a('0x55')](_0x170ba5,_0x2f5b70);var _0x44112c=util[_0xf34a('0x49')](_0xf34a('0x5a'),_0x50b01c[_0xf34a('0x2b')]['id'],_0x2f5b70);var _0x523749=path[_0xf34a('0x55')](_0x170ba5,_0x44112c);var _0x3a064e=[];_0x3a064e['push']({'model':db[_0xf34a('0x5b')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x3a064e[_0xf34a('0x5c')]({'model':db['CmContact'],'as':_0xf34a('0x5d'),'attributes':['id',_0xf34a('0x5e'),_0xf34a('0x5f')],'raw':!![]});var _0x24d7e0=[{'model':db[_0xf34a('0x3c')],'as':_0xf34a('0x60'),'attributes':['id',_0xf34a('0x34'),'createdAt',_0xf34a('0x61'),'secret',_0xf34a('0x62')],'include':_0x3a064e}];_0x24d7e0['push']({'model':db[_0xf34a('0x63')],'as':_0xf34a('0x64'),'attributes':['id',_0xf34a('0x1d')]});_0x24d7e0[_0xf34a('0x5c')]({'model':db[_0xf34a('0x5b')],'as':_0xf34a('0x65'),'attributes':['id',_0xf34a('0x66')]});return db[_0xf34a('0x20')][_0xf34a('0x32')]({'where':{'id':_0x50b01c[_0xf34a('0x2b')]['id']},'include':_0x24d7e0})[_0xf34a('0x1a')](handleEntityNotFound(_0x4530e4,null))[_0xf34a('0x1a')](function(_0x1ca6b7){if(_0x1ca6b7){var _0x142a1e=_0x1ca6b7[_0xf34a('0x67')]({'plain':!![]});fs[_0xf34a('0x68')](_0x5a5428);var _0x31f4a7={'channel':'Sms','account':_0x142a1e['Account'][_0xf34a('0x1d')],'agent':_0x142a1e['Owner']?_0x142a1e[_0xf34a('0x65')]['fullname']:_0xf34a('0x69'),'createdAt':moment(_0x142a1e[_0xf34a('0x6a')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x142a1e[_0xf34a('0x6b')]?moment(_0x142a1e['closedAt'])['format'](_0xf34a('0x6c'))[_0xf34a('0x54')]():'','disposition':_0x142a1e[_0xf34a('0x6d')],'messages':_(_0x142a1e[_0xf34a('0x60')])[_0xf34a('0x45')]({'secret':![]})[_0xf34a('0x1f')](function(_0x586d37){return{'date':moment(_0x586d37['createdAt'])[_0xf34a('0x49')](_0xf34a('0x6c'))[_0xf34a('0x54')](),'sender':_0x586d37[_0xf34a('0x61')]===_0xf34a('0x6e')?_0x586d37[_0xf34a('0x5b')]?_0x586d37[_0xf34a('0x5b')]['fullname']:'System':_0x586d37[_0xf34a('0x5d')]['firstName']+(_0x586d37[_0xf34a('0x5d')][_0xf34a('0x5f')]?'\x20'+_0x586d37['Contact'][_0xf34a('0x5f')]:''),'body':_0x586d37[_0xf34a('0x34')],'direction':_0x586d37[_0xf34a('0x61')]===_0xf34a('0x6e')?'A':'C','secret':_0x586d37[_0xf34a('0x6f')],'read':_0x586d37[_0xf34a('0x62')]};})[_0xf34a('0x70')]()};return ejs[_0xf34a('0x71')](path[_0xf34a('0x55')](config[_0xf34a('0x56')],_0xf34a('0x57'),'views',_0xf34a('0x72')),{'interaction':_0x31f4a7})[_0xf34a('0x1a')](function(_0x37c35f){var _0x2b8957=path[_0xf34a('0x55')](_0x5a5428,'transcript-'+_0x142a1e['id']+'-'+_0x2f5b70+_0xf34a('0x73'));var _0xadc436={'path':_0x2b8957,'channel':_0xf34a('0x74'),'interactionId':_0x142a1e['id']};return pdf[_0xf34a('0x75')](_0x37c35f,_0xadc436);})[_0xf34a('0x1a')](function(){return new BPromise(function(_0x2bf9b8,_0xffd6c6){zipdir(_0x5a5428,{'saveTo':_0x523749},function(_0x2e5e4c,_0x24e27b){if(_0x2e5e4c)return _0xffd6c6(_0x2e5e4c);return _0x2bf9b8(_0x24e27b);});})['then'](function(){return new BPromise(function(_0x2e11d5,_0x343046){rimraf(_0x5a5428,function(_0x3042c7){if(_0x3042c7)_0x343046(_0x3042c7);return _0x2e11d5();});});})[_0xf34a('0x1a')](function(){return _0x4530e4[_0xf34a('0x52')](_0x523749,_0x44112c,function(_0x1fd5af){if(_0x1fd5af){console[_0xf34a('0x76')](_0xf34a('0x77'),_0x1fd5af);}else{fs[_0xf34a('0x78')](_0x523749);}});});});}else{return _0x4530e4[_0xf34a('0x11')](0xc8);}})['catch'](handleError(_0x4530e4,null));}; \ No newline at end of file +var _0x751a=['Contact','firstName','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','download','log','err','unlinkSync','rimraf','moment','bluebird','util','lodash','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','status','end','json','offset','undefined','count','set','Content-Range','update','then','destroy','sendStatus','stack','name','index','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','user','catch','params','model','keys','filters','intersection','attributes','fields','length','include','merge','options','find','create','body','describe','addMessage','omit','ids','getMessages','findOne','SmsMessage','nolimit','limit','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','emit','removeTags','unix','toString','root','server','files','tmp','transcript-%d-%s.zip','join','User','push','CmContact','Messages','secret','read','SmsAccount','Account','fullname','get','mkdirSync','Sms','Owner','N.A.','createdAt','closedAt','disposition','System'];(function(_0x1f31e5,_0x124795){var _0x427fd6=function(_0x17b405){while(--_0x17b405){_0x1f31e5['push'](_0x1f31e5['shift']());}};_0x427fd6(++_0x124795);}(_0x751a,0x1e7));var _0xa751=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x751a[_0x58dc25];return _0x21b0a7;};'use strict';var rimraf=require(_0xa751('0x0'));var zipdir=require('zip-dir');var moment=require(_0xa751('0x1'));var BPromise=require(_0xa751('0x2'));var util=require(_0xa751('0x3'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa751('0x4'));var Redis=require('ioredis');var interaction=require(_0xa751('0x5'));var qs=require('../../components/parsers/qs');var pdf=require(_0xa751('0x6'));var logger=require(_0xa751('0x7'))(_0xa751('0x8'));var config=require(_0xa751('0x9'));var db=require(_0xa751('0xa'))['db'];config[_0xa751('0xb')]=_[_0xa751('0xc')](config[_0xa751('0xb')],{'host':_0xa751('0xd'),'port':0x18eb});var socket=require(_0xa751('0xe'))(new Redis(config[_0xa751('0xb')]));require(_0xa751('0xf'))[_0xa751('0x10')](socket);function respondWithStatusCode(_0xf0cbc2,_0x167bcc){_0x167bcc=_0x167bcc||0xcc;return function(_0x2b1f63){if(_0x2b1f63){return _0xf0cbc2['sendStatus'](_0x167bcc);}return _0xf0cbc2[_0xa751('0x11')](_0x167bcc)[_0xa751('0x12')]();};}function respondWithResult(_0x30a127,_0x29d711){_0x29d711=_0x29d711||0xc8;return function(_0x28792f){if(_0x28792f){return _0x30a127[_0xa751('0x11')](_0x29d711)[_0xa751('0x13')](_0x28792f);}};}function respondWithFilteredResult(_0x185af6,_0x4d7903){return function(_0x2bc3d7){if(_0x2bc3d7){var _0x2ba5f5=typeof _0x4d7903[_0xa751('0x14')]==='undefined'&&typeof _0x4d7903['limit']===_0xa751('0x15');var _0xa6d241=_0x2bc3d7[_0xa751('0x16')];var _0x89d597=_0x2ba5f5?0x0:_0x4d7903[_0xa751('0x14')];var _0x485fb4=_0x2ba5f5?_0x2bc3d7[_0xa751('0x16')]:_0x4d7903['offset']+_0x4d7903['limit'];var _0x1a3f20;if(_0x485fb4>=_0xa6d241){_0x485fb4=_0xa6d241;_0x1a3f20=0xc8;}else{_0x1a3f20=0xce;}_0x185af6['status'](_0x1a3f20);return _0x185af6[_0xa751('0x17')](_0xa751('0x18'),_0x89d597+'-'+_0x485fb4+'/'+_0xa6d241)[_0xa751('0x13')](_0x2bc3d7);}return null;};}function saveUpdates(_0x24b6ad){return function(_0x1667a7){if(_0x1667a7){return _0x1667a7[_0xa751('0x19')](_0x24b6ad)[_0xa751('0x1a')](function(_0x5a51e8){return _0x5a51e8;});}return null;};}function removeEntity(_0x2b4ec8){return function(_0x5d6833){if(_0x5d6833){return _0x5d6833[_0xa751('0x1b')]()[_0xa751('0x1a')](function(){_0x2b4ec8['status'](0xcc)[_0xa751('0x12')]();});}};}function handleEntityNotFound(_0x1bd936){return function(_0x2da24e){if(!_0x2da24e){_0x1bd936[_0xa751('0x1c')](0x194);}return _0x2da24e;};}function handleError(_0x25b27d,_0x30a6e7){_0x30a6e7=_0x30a6e7||0x1f4;return function(_0x100ea6){logger['error'](_0x100ea6[_0xa751('0x1d')]);if(_0x100ea6[_0xa751('0x1e')]){delete _0x100ea6['name'];}_0x25b27d['status'](_0x30a6e7)['send'](_0x100ea6);};}exports[_0xa751('0x1f')]=function(_0x6a550e,_0x48ccb8){var _0x3d7941={};var _0x2e5ce9=_[_0xa751('0x20')](db[_0xa751('0x21')][_0xa751('0x22')],function(_0x25ecf7){return{'name':_0x25ecf7[_0xa751('0x23')],'type':_0x25ecf7[_0xa751('0x24')][_0xa751('0x25')]};});_0x3d7941=qs[_0xa751('0x26')](_0x2e5ce9,_0x6a550e);return interaction[_0xa751('0x27')](_0xa751('0x28'),_0x6a550e[_0xa751('0x29')],_0x6a550e[_0xa751('0x2a')],_0x3d7941,_0x2e5ce9)['then'](respondWithFilteredResult(_0x48ccb8,_0x3d7941))[_0xa751('0x2b')](handleError(_0x48ccb8,null));};exports['show']=function(_0x3d56d6,_0x103844){var _0x54d79e={'raw':![],'where':{'id':_0x3d56d6[_0xa751('0x2c')]['id']}},_0x45085d={};_0x45085d[_0xa751('0x2d')]=_[_0xa751('0x2e')](db[_0xa751('0x21')][_0xa751('0x22')]);_0x45085d['query']=_[_0xa751('0x2e')](_0x3d56d6[_0xa751('0x29')]);_0x45085d[_0xa751('0x2f')]=_[_0xa751('0x30')](_0x45085d[_0xa751('0x2d')],_0x45085d[_0xa751('0x29')]);_0x54d79e[_0xa751('0x31')]=_['intersection'](_0x45085d[_0xa751('0x2d')],qs[_0xa751('0x32')](_0x3d56d6['query'][_0xa751('0x32')]));_0x54d79e['attributes']=_0x54d79e[_0xa751('0x31')][_0xa751('0x33')]?_0x54d79e['attributes']:_0x45085d[_0xa751('0x2d')];if(_0x3d56d6[_0xa751('0x29')]['includeAll']){_0x54d79e[_0xa751('0x34')]=[{'all':!![]}];}_0x54d79e=_[_0xa751('0x35')]({},_0x54d79e,_0x3d56d6[_0xa751('0x36')]);return db['SmsInteraction'][_0xa751('0x37')](_0x54d79e)[_0xa751('0x1a')](handleEntityNotFound(_0x103844,null))['then'](respondWithResult(_0x103844,null))[_0xa751('0x2b')](handleError(_0x103844,null));};exports[_0xa751('0x38')]=function(_0x22c5b2,_0x123108){return db[_0xa751('0x21')]['create'](_0x22c5b2[_0xa751('0x39')],{})[_0xa751('0x1a')](respondWithResult(_0x123108,0xc9))[_0xa751('0x2b')](handleError(_0x123108,null));};exports['update']=function(_0x98a257,_0x22d7b4){if(_0x98a257[_0xa751('0x39')]['id']){delete _0x98a257[_0xa751('0x39')]['id'];}return db[_0xa751('0x21')][_0xa751('0x37')]({'where':{'id':_0x98a257[_0xa751('0x2c')]['id']}})[_0xa751('0x1a')](handleEntityNotFound(_0x22d7b4,null))[_0xa751('0x1a')](saveUpdates(_0x98a257[_0xa751('0x39')],null))[_0xa751('0x1a')](respondWithResult(_0x22d7b4,null))['catch'](handleError(_0x22d7b4,null));};exports[_0xa751('0x1b')]=function(_0x4f5fe9,_0x38be9d){return db['SmsInteraction']['find']({'where':{'id':_0x4f5fe9[_0xa751('0x2c')]['id']}})[_0xa751('0x1a')](handleEntityNotFound(_0x38be9d,null))[_0xa751('0x1a')](removeEntity(_0x38be9d,null))[_0xa751('0x2b')](handleError(_0x38be9d,null));};exports[_0xa751('0x3a')]=function(_0x439859,_0x41a6ef){return db[_0xa751('0x21')]['describe']()[_0xa751('0x1a')](respondWithResult(_0x41a6ef,null))[_0xa751('0x2b')](handleError(_0x41a6ef,null));};exports[_0xa751('0x3b')]=function(_0x26e89a,_0x5d09e6){return db['SmsMessage']['find']({'where':{'id':_0x26e89a[_0xa751('0x2c')]['id']}})[_0xa751('0x1a')](handleEntityNotFound(_0x5d09e6,null))[_0xa751('0x1a')](function(_0x59babf){if(_0x59babf){return _0x59babf['addMessage'](_0x26e89a['body']['ids'],_[_0xa751('0x3c')](_0x26e89a['body'],[_0xa751('0x3d'),'id'])||{});}})[_0xa751('0x1a')](respondWithResult(_0x5d09e6,null))['catch'](handleError(_0x5d09e6,null));};exports[_0xa751('0x3e')]=function(_0x59f9e9,_0x1a8577){var _0x1aa699={'raw':![],'where':{}};var _0x4227d3={};var _0x25d04f={'count':0x0,'rows':[]};return db[_0xa751('0x21')][_0xa751('0x3f')]({'where':{'id':_0x59f9e9[_0xa751('0x2c')]['id']}})[_0xa751('0x1a')](handleEntityNotFound(_0x1a8577,null))[_0xa751('0x1a')](function(_0xe60daa){if(_0xe60daa){_0x4227d3['model']=_['keys'](db[_0xa751('0x40')][_0xa751('0x22')]);_0x4227d3[_0xa751('0x29')]=_[_0xa751('0x2e')](_0x59f9e9[_0xa751('0x29')]);_0x4227d3[_0xa751('0x2f')]=_[_0xa751('0x30')](_0x4227d3[_0xa751('0x2d')],_0x4227d3['query']);_0x1aa699[_0xa751('0x31')]=_[_0xa751('0x30')](_0x4227d3[_0xa751('0x2d')],qs['fields'](_0x59f9e9[_0xa751('0x29')][_0xa751('0x32')]));_0x1aa699['attributes']=_0x1aa699['attributes'][_0xa751('0x33')]?_0x1aa699[_0xa751('0x31')]:_0x4227d3['model'];if(!_0x59f9e9[_0xa751('0x29')]['hasOwnProperty'](_0xa751('0x41'))){_0x1aa699['limit']=qs[_0xa751('0x42')](_0x59f9e9['query'][_0xa751('0x42')]);_0x1aa699[_0xa751('0x14')]=qs[_0xa751('0x14')](_0x59f9e9['query'][_0xa751('0x14')]);}_0x1aa699[_0xa751('0x43')]=qs[_0xa751('0x44')](_0x59f9e9[_0xa751('0x29')][_0xa751('0x44')]);_0x1aa699[_0xa751('0x45')]=qs[_0xa751('0x2f')](_[_0xa751('0x46')](_0x59f9e9['query'],_0x4227d3[_0xa751('0x2f')]));_0x1aa699[_0xa751('0x45')]['SmsInteractionId']=_0xe60daa['id'];if(_0x59f9e9[_0xa751('0x29')]['filter']){_0x1aa699[_0xa751('0x45')]=_['merge'](_0x1aa699[_0xa751('0x45')],{'$or':_[_0xa751('0x20')](_0x1aa699['attributes'],function(_0x1d30d2){var _0x39249b={};_0x39249b[_0x1d30d2]={'$like':'%'+_0x59f9e9['query'][_0xa751('0x47')]+'%'};return _0x39249b;})});}if(_0x59f9e9[_0xa751('0x29')][_0xa751('0x48')]){var _0x5a5d0a=_0x59f9e9[_0xa751('0x29')][_0xa751('0x48')][_0xa751('0x49')](',');var _0x2c27b2={};_0x2c27b2[_0x5a5d0a[0x0]]={'$gte':moment(_0x5a5d0a[0x1])[_0xa751('0x4a')](_0xa751('0x4b'))};_0x1aa699[_0xa751('0x45')]=_[_0xa751('0x35')](_0x1aa699[_0xa751('0x45')],_0x2c27b2);}_0x1aa699=_[_0xa751('0x35')]({},_0x1aa699,_0x59f9e9['options']);return db['SmsMessage'][_0xa751('0x16')]({'where':_0x1aa699[_0xa751('0x45')]})['then'](function(_0x5a2130){_0x25d04f[_0xa751('0x16')]=_0x5a2130;if(_0x59f9e9[_0xa751('0x29')]['includeAll']){_0x1aa699[_0xa751('0x34')]=[{'all':!![]}];}return db[_0xa751('0x40')][_0xa751('0x27')](_0x1aa699);})['then'](function(_0x370cc8){_0x25d04f[_0xa751('0x4c')]=_0x370cc8;return _0x25d04f;});}})[_0xa751('0x1a')](respondWithFilteredResult(_0x1a8577,_0x1aa699))[_0xa751('0x2b')](handleError(_0x1a8577,null));};exports[_0xa751('0x4d')]=function(_0x394520,_0x47a520){return db[_0xa751('0x21')][_0xa751('0x37')]({'where':{'id':_0x394520[_0xa751('0x2c')]['id']}})[_0xa751('0x1a')](handleEntityNotFound(_0x47a520,null))[_0xa751('0x1a')](function(_0x2b0dbb){if(_0x2b0dbb){return _0x2b0dbb[_0xa751('0x4e')](_0x394520[_0xa751('0x39')]['ids'],_['omit'](_0x394520[_0xa751('0x39')],[_0xa751('0x3d'),'id'])||{})[_0xa751('0x4f')](function(){return db['Tag'][_0xa751('0x27')]({'attributes':['id',_0xa751('0x1e'),'color'],'where':{'id':_0x394520[_0xa751('0x39')][_0xa751('0x3d')]}});})[_0xa751('0x1a')](function(_0x5e6bfc){socket[_0xa751('0x50')]('smsInteractionTags:save',{'id':Number(_0x394520[_0xa751('0x2c')]['id']),'tags':_0x5e6bfc||[]});return{'id':Number(_0x394520[_0xa751('0x2c')]['id']),'tags':_0x5e6bfc||[]};});}})[_0xa751('0x1a')](respondWithResult(_0x47a520,null))[_0xa751('0x2b')](handleError(_0x47a520,null));};exports[_0xa751('0x51')]=function(_0x59f139,_0x5446fc){return db[_0xa751('0x21')][_0xa751('0x37')]({'where':{'id':_0x59f139[_0xa751('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5446fc,null))[_0xa751('0x1a')](function(_0x1ba1ee){if(_0x1ba1ee){return _0x1ba1ee[_0xa751('0x51')](_0x59f139[_0xa751('0x29')][_0xa751('0x3d')]);}})['then'](respondWithStatusCode(_0x5446fc,null))[_0xa751('0x2b')](handleError(_0x5446fc,null));};exports['download']=function(_0x464b67,_0x43b622){var _0xc35c50=moment()[_0xa751('0x52')]()[_0xa751('0x53')]();var _0x468c00=path['join'](config[_0xa751('0x54')],_0xa751('0x55'),_0xa751('0x56'),_0xa751('0x57'));var _0x258749=path['join'](_0x468c00,_0xc35c50);var _0xdb90ee=util[_0xa751('0x4a')](_0xa751('0x58'),_0x464b67['params']['id'],_0xc35c50);var _0x5d8103=path[_0xa751('0x59')](_0x468c00,_0xdb90ee);var _0x146525=[];_0x146525['push']({'model':db[_0xa751('0x5a')],'as':_0xa751('0x5a'),'attributes':['id','fullname'],'raw':!![]});_0x146525[_0xa751('0x5b')]({'model':db[_0xa751('0x5c')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});var _0x402578=[{'model':db[_0xa751('0x40')],'as':_0xa751('0x5d'),'attributes':['id',_0xa751('0x39'),'createdAt','direction',_0xa751('0x5e'),_0xa751('0x5f')],'include':_0x146525}];_0x402578[_0xa751('0x5b')]({'model':db[_0xa751('0x60')],'as':_0xa751('0x61'),'attributes':['id',_0xa751('0x1e')]});_0x402578[_0xa751('0x5b')]({'model':db[_0xa751('0x5a')],'as':'Owner','attributes':['id',_0xa751('0x62')]});return db[_0xa751('0x21')][_0xa751('0x37')]({'where':{'id':_0x464b67[_0xa751('0x2c')]['id']},'include':_0x402578})[_0xa751('0x1a')](handleEntityNotFound(_0x43b622,null))[_0xa751('0x1a')](function(_0x24122a){if(_0x24122a){var _0x1d6489=_0x24122a[_0xa751('0x63')]({'plain':!![]});fs[_0xa751('0x64')](_0x258749);var _0x422a00={'channel':_0xa751('0x65'),'account':_0x1d6489['Account'][_0xa751('0x1e')],'agent':_0x1d6489[_0xa751('0x66')]?_0x1d6489['Owner'][_0xa751('0x62')]:_0xa751('0x67'),'createdAt':moment(_0x1d6489[_0xa751('0x68')])[_0xa751('0x4a')](_0xa751('0x4b'))[_0xa751('0x53')](),'closedAt':_0x1d6489['closed']?moment(_0x1d6489[_0xa751('0x69')])[_0xa751('0x4a')](_0xa751('0x4b'))[_0xa751('0x53')]():'','disposition':_0x1d6489[_0xa751('0x6a')],'messages':_(_0x1d6489['Messages'])[_0xa751('0x47')]({'secret':![]})[_0xa751('0x20')](function(_0x3c6291){return{'date':moment(_0x3c6291[_0xa751('0x68')])['format'](_0xa751('0x4b'))[_0xa751('0x53')](),'sender':_0x3c6291['direction']==='out'?_0x3c6291[_0xa751('0x5a')]?_0x3c6291[_0xa751('0x5a')][_0xa751('0x62')]:_0xa751('0x6b'):_0x3c6291[_0xa751('0x6c')][_0xa751('0x6d')]+(_0x3c6291[_0xa751('0x6c')]['lastName']?'\x20'+_0x3c6291[_0xa751('0x6c')]['lastName']:''),'body':_0x3c6291['body'],'direction':_0x3c6291['direction']===_0xa751('0x6e')?'A':'C','secret':_0x3c6291['secret'],'read':_0x3c6291[_0xa751('0x5f')]};})['value']()};return ejs[_0xa751('0x6f')](path[_0xa751('0x59')](config['root'],_0xa751('0x55'),'views',_0xa751('0x70')),{'interaction':_0x422a00})[_0xa751('0x1a')](function(_0x4b1bca){var _0x4a7eda=path[_0xa751('0x59')](_0x258749,_0xa751('0x71')+_0x1d6489['id']+'-'+_0xc35c50+_0xa751('0x72'));var _0x3a0768={'path':_0x4a7eda,'channel':_0xa751('0x65'),'interactionId':_0x1d6489['id']};return pdf['createPdfFromHTML'](_0x4b1bca,_0x3a0768);})['then'](function(){return new BPromise(function(_0x5459ce,_0x4a8bdf){zipdir(_0x258749,{'saveTo':_0x5d8103},function(_0x1c14c7,_0x575542){if(_0x1c14c7)return _0x4a8bdf(_0x1c14c7);return _0x5459ce(_0x575542);});})[_0xa751('0x1a')](function(){return new BPromise(function(_0x46734f,_0x5dbc62){rimraf(_0x258749,function(_0x40d7a7){if(_0x40d7a7)_0x5dbc62(_0x40d7a7);return _0x46734f();});});})['then'](function(){return _0x43b622[_0xa751('0x73')](_0x5d8103,_0xdb90ee,function(_0x47fe6b){if(_0x47fe6b){console[_0xa751('0x74')](_0xa751('0x75'),_0x47fe6b);}else{fs[_0xa751('0x76')](_0x5d8103);}});});});}else{return _0x43b622[_0xa751('0x1c')](0xc8);}})[_0xa751('0x2b')](handleError(_0x43b622,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index bee0fc0..c4cd9e0 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 _0xdb28=['Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','setDataValue'];(function(_0x297b84,_0x302bb6){var _0x12c17d=function(_0x1419de){while(--_0x1419de){_0x297b84['push'](_0x297b84['shift']());}};_0x12c17d(++_0x302bb6);}(_0xdb28,0x106));var _0x8db2=function(_0x53e1a2,_0x432006){_0x53e1a2=_0x53e1a2-0x0;var _0xa7f1d6=_0xdb28[_0x53e1a2];return _0xa7f1d6;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var SmsInteraction=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var SmsMessage=require(_0x8db2('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':_0x8db2('0x4'),'afterUpdate':_0x8db2('0x5'),'afterDestroy':_0x8db2('0x6')};function emitEvent(_0x11109e){return function(_0x52bf99,_0x21a03e,_0x1d2dd3){_0x52bf99['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x477f50){_0x52bf99[_0x8db2('0x7')](_0x8db2('0x8'),_0x477f50[_0x8db2('0x9')](function(_0x2f3f2f){return{'id':_0x2f3f2f['id']};}));return SmsMessage[_0x8db2('0xa')]({'where':{'SmsInteractionId':_0x52bf99['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8db2('0xb')](function(_0x4ba340){_0x52bf99[_0x8db2('0x7')](_0x8db2('0xc'),_0x4ba340[_0x8db2('0xd')]);SmsInteractionEvents['emit'](_0x11109e+':'+_0x52bf99['id'],_0x52bf99);SmsInteractionEvents[_0x8db2('0xe')](_0x11109e,_0x52bf99);_0x1d2dd3(null);})[_0x8db2('0xf')](_0x1d2dd3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x8db2('0x10')](e,emitEvent(event));}}module[_0x8db2('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x1399=['setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','Users','findAll'];(function(_0x535e98,_0xce0971){var _0x9d2a28=function(_0x5e6fac){while(--_0x5e6fac){_0x535e98['push'](_0x535e98['shift']());}};_0x9d2a28(++_0xce0971);}(_0x1399,0x16c));var _0x9139=function(_0xdb027c,_0x555595){_0xdb027c=_0xdb027c-0x0;var _0x7b4cf3=_0x1399[_0xdb027c];return _0x7b4cf3;};'use strict';var EventEmitter=require(_0x9139('0x0'));var SmsInteraction=require(_0x9139('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x9139('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x9139('0x2')](0x0);var events={'afterCreate':_0x9139('0x3'),'afterUpdate':_0x9139('0x4'),'afterDestroy':_0x9139('0x5')};function emitEvent(_0x251798){return function(_0x2acb38,_0x5ac80b,_0x54af2d){_0x2acb38[_0x9139('0x6')]({'attributes':['id'],'raw':!![]})[_0x9139('0x7')](function(_0x4d5d1e){_0x2acb38['setDataValue'](_0x9139('0x8'),_0x4d5d1e['map'](function(_0x504ced){return{'id':_0x504ced['id']};}));return SmsMessage[_0x9139('0x9')]({'where':{'SmsInteractionId':_0x2acb38['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9139('0x7')](function(_0x4830cd){_0x2acb38[_0x9139('0xa')](_0x9139('0xb'),_0x4830cd['length']);SmsInteractionEvents['emit'](_0x251798+':'+_0x2acb38['id'],_0x2acb38);SmsInteractionEvents[_0x9139('0xc')](_0x251798,_0x2acb38);_0x54af2d(null);})[_0x9139('0xd')](_0x54af2d(null));};}for(var e in events){if(events[_0x9139('0xe')](e)){var event=events[e];SmsInteraction[_0x9139('0xf')](e,emitEvent(event));}}module[_0x9139('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 66fc0a5..1571e48 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 _0xa8ad=['exports','define','SmsInteraction','sms_interactions','changed','closed','format','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x56989c,_0x6781f0){var _0x22ab27=function(_0x390034){while(--_0x390034){_0x56989c['push'](_0x56989c['shift']());}};_0x22ab27(++_0x6781f0);}(_0xa8ad,0x142));var _0xda8a=function(_0x527b5a,_0xb49182){_0x527b5a=_0x527b5a-0x0;var _0x132322=_0xa8ad[_0x527b5a];return _0x132322;};'use strict';var _=require(_0xda8a('0x0'));var util=require('util');var logger=require(_0xda8a('0x1'))(_0xda8a('0x2'));var moment=require(_0xda8a('0x3'));var BPromise=require(_0xda8a('0x4'));var rp=require(_0xda8a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xda8a('0x6'));var config=require(_0xda8a('0x7'));var attributes=require('./smsInteraction.attributes');module[_0xda8a('0x8')]=function(_0x5f121e,_0x2e9371){return _0x5f121e[_0xda8a('0x9')](_0xda8a('0xa'),attributes,{'tableName':_0xda8a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2856cb,_0x3095a1,_0x290272){if(_0x2856cb[_0xda8a('0xc')](_0xda8a('0xd'))){_0x2856cb['closedAt']=moment()[_0xda8a('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x290272(null,_0x2856cb);}}});}; \ No newline at end of file +var _0xf03b=['exports','SmsInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','bluebird','rimraf','../../config/environment','./smsInteraction.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf03b,0x171));var _0xbf03=function(_0x5e025a,_0x35a5f3){_0x5e025a=_0x5e025a-0x0;var _0x38e4e3=_0xf03b[_0x5e025a];return _0x38e4e3;};'use strict';var _=require(_0xbf03('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbf03('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf03('0x2'));var config=require(_0xbf03('0x3'));var attributes=require(_0xbf03('0x4'));module[_0xbf03('0x5')]=function(_0x4cb511,_0x29a1e7){return _0x4cb511['define'](_0xbf03('0x6'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c1a1e,_0x1d90d8,_0x22a77e){if(_0x2c1a1e['changed'](_0xbf03('0x7'))){_0x2c1a1e[_0xbf03('0x8')]=moment()[_0xbf03('0x9')](_0xbf03('0xa'));}_0x22a77e(null,_0x2c1a1e);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index a8cbb21..72c78b7 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 _0xd50d=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','./smsInteraction.socket','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','update','body','options','where','attributes','limit','then','UpdateSmsInteraction','debug','AddTagsToSmsInteraction','SmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird'];(function(_0x2c52df,_0x25ff83){var _0x57e63c=function(_0x4b95bd){while(--_0x4b95bd){_0x2c52df['push'](_0x2c52df['shift']());}};_0x57e63c(++_0x25ff83);}(_0xd50d,0xc9));var _0xdd50=function(_0x20d97b,_0x13bf21){_0x20d97b=_0x20d97b-0x0;var _0x33c9de=_0xd50d[_0x20d97b];return _0x33c9de;};'use strict';var _=require(_0xdd50('0x0'));var util=require(_0xdd50('0x1'));var moment=require(_0xdd50('0x2'));var BPromise=require(_0xdd50('0x3'));var rs=require(_0xdd50('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd50('0x5'))['db'];var utils=require(_0xdd50('0x6'));var logger=require(_0xdd50('0x7'))(_0xdd50('0x8'));var config=require(_0xdd50('0x9'));var jayson=require(_0xdd50('0xa'));var client=jayson['client'][_0xdd50('0xb')]({'port':0x232a});config['redis']=_[_0xdd50('0xc')](config['redis'],{'host':_0xdd50('0xd'),'port':0x18eb});var socket=require(_0xdd50('0xe'))(new Redis(config['redis']));require(_0xdd50('0xf'))['register'](socket);function respondWithRpcPromise(_0x5b5cd8,_0x4d64ee,_0x1bb8d6){return new BPromise(function(_0x2b6894,_0x394b9a){return client['request'](_0x5b5cd8,_0x1bb8d6)['then'](function(_0x4eecf4){logger[_0xdd50('0x10')](_0xdd50('0x11'),_0x4d64ee,_0xdd50('0x12'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x4d64ee,_0xdd50('0x12'),JSON[_0xdd50('0x13')](_0x4eecf4));if(_0x4eecf4[_0xdd50('0x14')]){if(_0x4eecf4[_0xdd50('0x14')][_0xdd50('0x15')]===0x1f4){logger['error'](_0xdd50('0x11'),_0x4d64ee,_0x4eecf4[_0xdd50('0x14')]['message']);return _0x394b9a(_0x4eecf4[_0xdd50('0x14')][_0xdd50('0x16')]);}logger[_0xdd50('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x4d64ee,_0x4eecf4[_0xdd50('0x14')]['message']);return _0x2b6894(_0x4eecf4[_0xdd50('0x14')]['message']);}else{logger[_0xdd50('0x10')](_0xdd50('0x11'),_0x4d64ee,_0xdd50('0x12'));_0x2b6894(_0x4eecf4['result']['message']);}})[_0xdd50('0x17')](function(_0x172c19){logger[_0xdd50('0x14')](_0xdd50('0x11'),_0x4d64ee,_0x172c19);_0x394b9a(_0x172c19);});});}exports['UpdateSmsInteraction']=function(_0x5077ad){var _0x34e319=this;return new Promise(function(_0x2019ce,_0xdc11da){return db['SmsInteraction'][_0xdd50('0x18')](_0x5077ad[_0xdd50('0x19')],{'raw':_0x5077ad[_0xdd50('0x1a')]?_0x5077ad['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5077ad[_0xdd50('0x1a')]?_0x5077ad['options'][_0xdd50('0x1b')]||null:null,'attributes':_0x5077ad[_0xdd50('0x1a')]?_0x5077ad[_0xdd50('0x1a')][_0xdd50('0x1c')]||null:null,'limit':_0x5077ad['options']?_0x5077ad[_0xdd50('0x1a')][_0xdd50('0x1d')]||null:null})[_0xdd50('0x1e')](function(_0x28eec0){logger[_0xdd50('0x10')](_0xdd50('0x1f'),_0x5077ad);logger[_0xdd50('0x20')]('UpdateSmsInteraction',_0x5077ad,JSON[_0xdd50('0x13')](_0x28eec0));_0x2019ce(_0x28eec0);})['catch'](function(_0x3287b2){logger[_0xdd50('0x14')]('UpdateSmsInteraction',_0x3287b2[_0xdd50('0x16')],_0x5077ad);_0xdc11da(_0x34e319[_0xdd50('0x14')](0x1f4,_0x3287b2['message']));});});};exports[_0xdd50('0x21')]=function(_0x1bbdf2){return new Promise(function(_0x5d6385,_0x1810d2){return db[_0xdd50('0x22')][_0xdd50('0x23')]({'where':_0x1bbdf2[_0xdd50('0x1a')]?_0x1bbdf2[_0xdd50('0x1a')]['where']||null:null})[_0xdd50('0x1e')](function(_0x98aa1f){if(_0x98aa1f){return _0x98aa1f[_0xdd50('0x24')](_0x1bbdf2['body'][_0xdd50('0x25')],_[_0xdd50('0x26')](_0x1bbdf2[_0xdd50('0x19')],[_0xdd50('0x25'),'id'])||{});}})[_0xdd50('0x27')](function(_0x53a080){logger[_0xdd50('0x10')](_0xdd50('0x28'),_0x1bbdf2);logger[_0xdd50('0x20')](_0xdd50('0x28'),_0x1bbdf2,JSON[_0xdd50('0x13')](_0x53a080));_0x5d6385(_0x53a080);})['catch'](function(_0x93553a){logger[_0xdd50('0x14')]('AddTags',_0x93553a[_0xdd50('0x16')],_0x1bbdf2);_0x1810d2(_this[_0xdd50('0x14')](0x1f4,_0x93553a[_0xdd50('0x16')]));});});}; \ No newline at end of file +var _0x4fde=['http','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','debug','AddTagsToSmsInteraction','find','addTags','ids','omit','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1520bc,_0x41a425){var _0x5994f6=function(_0x29619d){while(--_0x29619d){_0x1520bc['push'](_0x1520bc['shift']());}};_0x5994f6(++_0x41a425);}(_0x4fde,0xf7));var _0xe4fd=function(_0x2fb87c,_0x2dee49){_0x2fb87c=_0x2fb87c-0x0;var _0x43038b=_0x4fde[_0x2fb87c];return _0x43038b;};'use strict';var _=require('lodash');var util=require(_0xe4fd('0x0'));var moment=require(_0xe4fd('0x1'));var BPromise=require(_0xe4fd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4fd('0x3'));var db=require(_0xe4fd('0x4'))['db'];var utils=require(_0xe4fd('0x5'));var logger=require(_0xe4fd('0x6'))(_0xe4fd('0x7'));var config=require(_0xe4fd('0x8'));var jayson=require(_0xe4fd('0x9'));var client=jayson[_0xe4fd('0xa')][_0xe4fd('0xb')]({'port':0x232a});config[_0xe4fd('0xc')]=_[_0xe4fd('0xd')](config[_0xe4fd('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe4fd('0xe'))(new Redis(config['redis']));require(_0xe4fd('0xf'))[_0xe4fd('0x10')](socket);function respondWithRpcPromise(_0x14f42f,_0x30872c,_0x1d218c){return new BPromise(function(_0x31bb13,_0x1d03e9){return client[_0xe4fd('0x11')](_0x14f42f,_0x1d218c)[_0xe4fd('0x12')](function(_0x26a35c){logger[_0xe4fd('0x13')](_0xe4fd('0x14'),_0x30872c,_0xe4fd('0x15'));logger['debug'](_0xe4fd('0x16'),_0x30872c,_0xe4fd('0x15'),JSON[_0xe4fd('0x17')](_0x26a35c));if(_0x26a35c[_0xe4fd('0x18')]){if(_0x26a35c['error'][_0xe4fd('0x19')]===0x1f4){logger[_0xe4fd('0x18')](_0xe4fd('0x14'),_0x30872c,_0x26a35c[_0xe4fd('0x18')]['message']);return _0x1d03e9(_0x26a35c[_0xe4fd('0x18')][_0xe4fd('0x1a')]);}logger[_0xe4fd('0x18')](_0xe4fd('0x14'),_0x30872c,_0x26a35c['error'][_0xe4fd('0x1a')]);return _0x31bb13(_0x26a35c['error']['message']);}else{logger[_0xe4fd('0x13')](_0xe4fd('0x14'),_0x30872c,_0xe4fd('0x15'));_0x31bb13(_0x26a35c['result'][_0xe4fd('0x1a')]);}})[_0xe4fd('0x1b')](function(_0x36fc84){logger['error'](_0xe4fd('0x14'),_0x30872c,_0x36fc84);_0x1d03e9(_0x36fc84);});});}exports[_0xe4fd('0x1c')]=function(_0x1d9885){var _0x225cda=this;return new Promise(function(_0x2c6174,_0x88ec44){return db[_0xe4fd('0x1d')][_0xe4fd('0x1e')](_0x1d9885[_0xe4fd('0x1f')],{'raw':_0x1d9885[_0xe4fd('0x20')]?_0x1d9885[_0xe4fd('0x20')][_0xe4fd('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d9885[_0xe4fd('0x20')]?_0x1d9885[_0xe4fd('0x20')][_0xe4fd('0x22')]||null:null,'attributes':_0x1d9885[_0xe4fd('0x20')]?_0x1d9885['options'][_0xe4fd('0x23')]||null:null,'limit':_0x1d9885[_0xe4fd('0x20')]?_0x1d9885[_0xe4fd('0x20')]['limit']||null:null})[_0xe4fd('0x12')](function(_0x21e6ac){logger[_0xe4fd('0x13')]('UpdateSmsInteraction',_0x1d9885);logger[_0xe4fd('0x24')](_0xe4fd('0x1c'),_0x1d9885,JSON['stringify'](_0x21e6ac));_0x2c6174(_0x21e6ac);})[_0xe4fd('0x1b')](function(_0x1d9f3e){logger[_0xe4fd('0x18')]('UpdateSmsInteraction',_0x1d9f3e['message'],_0x1d9885);_0x88ec44(_0x225cda[_0xe4fd('0x18')](0x1f4,_0x1d9f3e[_0xe4fd('0x1a')]));});});};exports[_0xe4fd('0x25')]=function(_0x2af370){return new Promise(function(_0x128109,_0x269fa7){return db['SmsInteraction'][_0xe4fd('0x26')]({'where':_0x2af370[_0xe4fd('0x20')]?_0x2af370[_0xe4fd('0x20')][_0xe4fd('0x22')]||null:null})[_0xe4fd('0x12')](function(_0x498ac0){if(_0x498ac0){return _0x498ac0[_0xe4fd('0x27')](_0x2af370[_0xe4fd('0x1f')][_0xe4fd('0x28')],_[_0xe4fd('0x29')](_0x2af370[_0xe4fd('0x1f')],[_0xe4fd('0x28'),'id'])||{});}})['spread'](function(_0x22505c){logger[_0xe4fd('0x13')]('AddTags',_0x2af370);logger[_0xe4fd('0x24')](_0xe4fd('0x2a'),_0x2af370,JSON['stringify'](_0x22505c));_0x128109(_0x22505c);})[_0xe4fd('0x1b')](function(_0x2e72e0){logger[_0xe4fd('0x18')]('AddTags',_0x2e72e0[_0xe4fd('0x1a')],_0x2af370);_0x269fa7(_this[_0xe4fd('0x18')](0x1f4,_0x2e72e0[_0xe4fd('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index ba2fcd7..e0be6b2 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 _0x5dbd=['emit','removeListener','register','smsInteraction:','./smsInteraction.events'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x5dbd,0x81));var _0xd5db=function(_0x5b3e56,_0x47072c){_0x5b3e56=_0x5b3e56-0x0;var _0x52ceb0=_0x5dbd[_0x5b3e56];return _0x52ceb0;};'use strict';var SmsInteractionEvents=require(_0xd5db('0x0'));var events=['save','remove','update'];function createListener(_0x3120d0,_0x1879e0){return function(_0x3b83ec){_0x1879e0[_0xd5db('0x1')](_0x3120d0,_0x3b83ec);};}function removeListener(_0xec963,_0x4622ea){return function(){SmsInteractionEvents[_0xd5db('0x2')](_0xec963,_0x4622ea);};}exports[_0xd5db('0x3')]=function(_0x2563e5){for(var _0x1c552c=0x0,_0x1d5c9c=events['length'];_0x1c552c<_0x1d5c9c;_0x1c552c++){var _0x5c853e=events[_0x1c552c];var _0xdeaaba=createListener(_0xd5db('0x4')+_0x5c853e,_0x2563e5);SmsInteractionEvents['on'](_0x5c853e,_0xdeaaba);}}; \ No newline at end of file +var _0xd022=['emit','removeListener','register','length','smsInteraction:','./smsInteraction.events','save','remove'];(function(_0xfab565,_0x83a93){var _0x7d0d6e=function(_0x25f493){while(--_0x25f493){_0xfab565['push'](_0xfab565['shift']());}};_0x7d0d6e(++_0x83a93);}(_0xd022,0x12d));var _0x2d02=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xd022[_0x2b7764];return _0x848dcb;};'use strict';var SmsInteractionEvents=require(_0x2d02('0x0'));var events=[_0x2d02('0x1'),_0x2d02('0x2'),'update'];function createListener(_0x528cb2,_0x15f081){return function(_0x547964){_0x15f081[_0x2d02('0x3')](_0x528cb2,_0x547964);};}function removeListener(_0x5a0053,_0x4d58a8){return function(){SmsInteractionEvents[_0x2d02('0x4')](_0x5a0053,_0x4d58a8);};}exports[_0x2d02('0x5')]=function(_0x1fd84a){for(var _0x569dd4=0x0,_0x10bb26=events[_0x2d02('0x6')];_0x569dd4<_0x10bb26;_0x569dd4++){var _0x1d44f0=events[_0x569dd4];var _0x2e501f=createListener(_0x2d02('0x7')+_0x1d44f0,_0x1fd84a);SmsInteractionEvents['on'](_0x1d44f0,_0x2e501f);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index b12ebfe..9428079 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 _0x9815=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','show','tracked','sms','smsmessage:create','create','/:id/status','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9815,0x1cb));var _0x5981=function(_0x177aac,_0xbb337f){_0x177aac=_0x177aac-0x0;var _0x4cf3a5=_0x9815[_0x177aac];return _0x4cf3a5;};'use strict';var multer=require('multer');var util=require(_0x5981('0x0'));var path=require(_0x5981('0x1'));var timeout=require(_0x5981('0x2'));var express=require('express');var router=express[_0x5981('0x3')]();var fs_extra=require(_0x5981('0x4'));var auth=require(_0x5981('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5981('0x6'));var controller=require(_0x5981('0x7'));router[_0x5981('0x8')]('/',auth[_0x5981('0x9')](),controller[_0x5981('0xa')]);router['get'](_0x5981('0xb'),auth[_0x5981('0x9')](),controller['describe']);router[_0x5981('0x8')](_0x5981('0xc'),auth[_0x5981('0x9')](),controller[_0x5981('0xd')]);router['post']('/',auth[_0x5981('0x9')](),interaction[_0x5981('0xe')](_0x5981('0xf'),_0x5981('0x10')),controller[_0x5981('0x11')]);router['post'](_0x5981('0x12'),controller['status']);router[_0x5981('0x13')](_0x5981('0xc'),auth[_0x5981('0x9')](),controller[_0x5981('0x14')]);router[_0x5981('0x13')](_0x5981('0x15'),auth[_0x5981('0x9')](),controller['accept']);router['put'](_0x5981('0x16'),auth[_0x5981('0x9')](),controller[_0x5981('0x17')]);router[_0x5981('0x18')](_0x5981('0xc'),auth[_0x5981('0x9')](),controller[_0x5981('0x19')]);module[_0x5981('0x1a')]=router; \ No newline at end of file +var _0x0641=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','tracked','sms','create','/:id/status','status','put','update','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1a1e21,_0x490c57){var _0x1f49f6=function(_0x7c05b2){while(--_0x7c05b2){_0x1a1e21['push'](_0x1a1e21['shift']());}};_0x1f49f6(++_0x490c57);}(_0x0641,0x1ac));var _0x1064=function(_0x41c8f8,_0x23be4d){_0x41c8f8=_0x41c8f8-0x0;var _0xbc785a=_0x0641[_0x41c8f8];return _0xbc785a;};'use strict';var multer=require(_0x1064('0x0'));var util=require(_0x1064('0x1'));var path=require(_0x1064('0x2'));var timeout=require(_0x1064('0x3'));var express=require('express');var router=express[_0x1064('0x4')]();var fs_extra=require(_0x1064('0x5'));var auth=require(_0x1064('0x6'));var interaction=require(_0x1064('0x7'));var config=require(_0x1064('0x8'));var controller=require('./smsMessage.controller');router[_0x1064('0x9')]('/',auth['isAuthenticated'](),controller[_0x1064('0xa')]);router[_0x1064('0x9')](_0x1064('0xb'),auth[_0x1064('0xc')](),controller[_0x1064('0xd')]);router['get'](_0x1064('0xe'),auth[_0x1064('0xc')](),controller['show']);router['post']('/',auth[_0x1064('0xc')](),interaction[_0x1064('0xf')](_0x1064('0x10'),'smsmessage:create'),controller[_0x1064('0x11')]);router['post'](_0x1064('0x12'),controller[_0x1064('0x13')]);router[_0x1064('0x14')](_0x1064('0xe'),auth[_0x1064('0xc')](),controller[_0x1064('0x15')]);router[_0x1064('0x14')]('/:id/accept',auth['isAuthenticated'](),controller[_0x1064('0x16')]);router[_0x1064('0x14')](_0x1064('0x17'),auth[_0x1064('0xc')](),controller[_0x1064('0x18')]);router['delete']('/:id',auth[_0x1064('0xc')](),controller[_0x1064('0x19')]);module[_0x1064('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 23bd601..9d93ba7 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 _0xb5ec=['exports','TEXT','medium','ENUM','out','STRING','BOOLEAN','sequelize'];(function(_0x1bb2ce,_0xa86945){var _0x58605a=function(_0x3455fb){while(--_0x3455fb){_0x1bb2ce['push'](_0x1bb2ce['shift']());}};_0x58605a(++_0xa86945);}(_0xb5ec,0x97));var _0xcb5e=function(_0x534a4b,_0x1de4b9){_0x534a4b=_0x534a4b-0x0;var _0x144cdb=_0xb5ec[_0x534a4b];return _0x144cdb;};'use strict';var Sequelize=require(_0xcb5e('0x0'));module[_0xcb5e('0x1')]={'body':{'type':Sequelize[_0xcb5e('0x2')](_0xcb5e('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xcb5e('0x4')]('in',_0xcb5e('0x5')),'defaultValue':_0xcb5e('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xcb5e('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xcb5e('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xcb5e('0x6')]},'providerResponse':{'type':Sequelize[_0xcb5e('0x2')]}}; \ No newline at end of file +var _0xa108=['medium','out','STRING','BOOLEAN','sequelize'];(function(_0x31ed8a,_0x1945f8){var _0xf2ca0a=function(_0x4ec979){while(--_0x4ec979){_0x31ed8a['push'](_0x31ed8a['shift']());}};_0xf2ca0a(++_0x1945f8);}(_0xa108,0x130));var _0x8a10=function(_0x2aa291,_0xda03df){_0x2aa291=_0x2aa291-0x0;var _0x2eb822=_0xa108[_0x2aa291];return _0x2eb822;};'use strict';var Sequelize=require(_0x8a10('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x8a10('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8a10('0x2')),'defaultValue':_0x8a10('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8a10('0x3')](0xbe)},'phone':{'type':Sequelize[_0x8a10('0x3')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x8a10('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8a10('0x3')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 8a13f2b..ffa097c 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 _0x2906=['map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','SmsMessage','includeAll','include','findAll','show','params','options','find','create','body','describe','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','UserId','get','SmsInteractionId','read1stAt','interaction','role','stringify','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','sms-interactions','reject','sms','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','SELECT','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','delivered','Status','groupName','DELIVERED','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','ejs','lodash','crypto','jsforce','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','redis','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','then','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','stack','name','send','index'];(function(_0x4468cd,_0x587fda){var _0x22f675=function(_0x7ac5c){while(--_0x7ac5c){_0x4468cd['push'](_0x4468cd['shift']());}};_0x22f675(++_0x587fda);}(_0x2906,0xe0));var _0x6290=function(_0x336030,_0x4086ea){_0x336030=_0x336030-0x0;var _0x2b203b=_0x2906[_0x336030];return _0x2b203b;};'use strict';var emlformat=require(_0x6290('0x0'));var rimraf=require(_0x6290('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6290('0x2'));var rp=require('request-promise');var moment=require(_0x6290('0x3'));var BPromise=require(_0x6290('0x4'));var Mustache=require(_0x6290('0x5'));var util=require(_0x6290('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6290('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6290('0x8'));var squel=require('squel');var crypto=require(_0x6290('0x9'));var jsforce=require(_0x6290('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6290('0xb'));var querystring=require(_0x6290('0xc'));var Papa=require(_0x6290('0xd'));var Redis=require(_0x6290('0xe'));var authService=require(_0x6290('0xf'));var qs=require(_0x6290('0x10'));var as=require(_0x6290('0x11'));var hardwareService=require(_0x6290('0x12'));var logger=require(_0x6290('0x13'))(_0x6290('0x14'));var utils=require(_0x6290('0x15'));var config=require(_0x6290('0x16'));var licenseUtil=require(_0x6290('0x17'));var db=require('../../mysqldb')['db'];config[_0x6290('0x18')]=_['defaults'](config[_0x6290('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6290('0x19'))(new Redis(config[_0x6290('0x18')]));require(_0x6290('0x1a'))[_0x6290('0x1b')](socket);var jayson=require(_0x6290('0x1c'));var client=jayson['client'][_0x6290('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x6290('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5ba781,_0x204336,_0x5cf917,_0x7b7a23){return new BPromise(function(_0x268cbf,_0x3490d6){var _0x3080e3=_0x7b7a23||client;return _0x3080e3['request'](_0x5ba781,_0x5cf917)[_0x6290('0x1e')](function(_0xe9c974){logger['info'](_0x6290('0x1f'),_0x204336,'request\x20sent');logger[_0x6290('0x20')](_0x6290('0x21'),_0x204336,_0x6290('0x22'),JSON['stringify'](_0xe9c974));if(_0xe9c974[_0x6290('0x23')]){if(_0xe9c974[_0x6290('0x23')]['code']===0x1f4){logger[_0x6290('0x23')](_0x6290('0x1f'),_0x204336,_0xe9c974[_0x6290('0x23')]['message']);return _0x3490d6(_0xe9c974['error'][_0x6290('0x24')]);}logger[_0x6290('0x23')]('SmsMessage,\x20%s,\x20%s',_0x204336,_0xe9c974[_0x6290('0x23')][_0x6290('0x24')]);return _0x268cbf(_0xe9c974[_0x6290('0x23')][_0x6290('0x24')]);}else{logger[_0x6290('0x25')](_0x6290('0x1f'),_0x204336,'request\x20sent');_0x268cbf(_0xe9c974['result']['message']);}})[_0x6290('0x26')](function(_0x321ac4){logger[_0x6290('0x23')]('SmsMessage,\x20%s,\x20%s',_0x204336,_0x321ac4);_0x3490d6(_0x321ac4);});});}function respondWithStatusCode(_0x53c5a8,_0x4c058b){_0x4c058b=_0x4c058b||0xcc;return function(_0x198e1f){if(_0x198e1f){return _0x53c5a8[_0x6290('0x27')](_0x4c058b);}return _0x53c5a8[_0x6290('0x28')](_0x4c058b)[_0x6290('0x29')]();};}function respondWithResult(_0x5aae29,_0x360d9e){_0x360d9e=_0x360d9e||0xc8;return function(_0x4112db){if(_0x4112db){return _0x5aae29[_0x6290('0x28')](_0x360d9e)[_0x6290('0x2a')](_0x4112db);}};}function respondWithFilteredResult(_0x5452f7,_0x3f1570){return function(_0x26bdf0){if(_0x26bdf0){var _0x142b05=typeof _0x3f1570[_0x6290('0x2b')]===_0x6290('0x2c')&&typeof _0x3f1570[_0x6290('0x2d')]==='undefined';var _0x118904=_0x26bdf0['count'];var _0x49188d=_0x142b05?0x0:_0x3f1570[_0x6290('0x2b')];var _0x2eefa0=_0x142b05?_0x26bdf0[_0x6290('0x2e')]:_0x3f1570['offset']+_0x3f1570['limit'];var _0x48f27b;if(_0x2eefa0>=_0x118904){_0x2eefa0=_0x118904;_0x48f27b=0xc8;}else{_0x48f27b=0xce;}_0x5452f7[_0x6290('0x28')](_0x48f27b);return _0x5452f7['set'](_0x6290('0x2f'),_0x49188d+'-'+_0x2eefa0+'/'+_0x118904)['json'](_0x26bdf0);}return null;};}function patchUpdates(_0xc3a147){return function(_0x52f0ee){try{jsonpatch[_0x6290('0x30')](_0x52f0ee,_0xc3a147,!![]);}catch(_0x7290e3){return BPromise['reject'](_0x7290e3);}return _0x52f0ee[_0x6290('0x31')]();};}function saveUpdates(_0x1cd318,_0x885af5){return function(_0x1d157b){if(_0x1d157b){return _0x1d157b[_0x6290('0x32')](_0x1cd318)[_0x6290('0x1e')](function(_0x3edd20){return _0x3edd20;});}return null;};}function removeEntity(_0x497698,_0x4321b6){return function(_0x57d62b){if(_0x57d62b){return _0x57d62b[_0x6290('0x33')]()[_0x6290('0x1e')](function(){_0x497698['status'](0xcc)[_0x6290('0x29')]();});}};}function handleEntityNotFound(_0x30d045,_0x26da00){return function(_0x4ea561){if(!_0x4ea561){_0x30d045['sendStatus'](0x194);}return _0x4ea561;};}function handleError(_0xc42763,_0x34ce5a){_0x34ce5a=_0x34ce5a||0x1f4;return function(_0x56796c){logger[_0x6290('0x23')](_0x56796c[_0x6290('0x34')]);if(_0x56796c[_0x6290('0x35')]){delete _0x56796c[_0x6290('0x35')];}_0xc42763['status'](_0x34ce5a)[_0x6290('0x36')](_0x56796c);};}exports[_0x6290('0x37')]=function(_0x3449ea,_0x3b25ec){var _0x1b03ca={},_0x39d763={},_0x10621f={'count':0x0,'rows':[]};var _0x566ff1=_[_0x6290('0x38')](db['SmsMessage']['rawAttributes'],function(_0x3649a5){return{'name':_0x3649a5[_0x6290('0x39')],'type':_0x3649a5[_0x6290('0x3a')][_0x6290('0x3b')]};});_0x39d763['model']=_[_0x6290('0x38')](_0x566ff1,_0x6290('0x35'));_0x39d763[_0x6290('0x3c')]=_[_0x6290('0x3d')](_0x3449ea[_0x6290('0x3c')]);_0x39d763[_0x6290('0x3e')]=_[_0x6290('0x3f')](_0x39d763[_0x6290('0x40')],_0x39d763[_0x6290('0x3c')]);_0x1b03ca['attributes']=_[_0x6290('0x3f')](_0x39d763['model'],qs['fields'](_0x3449ea[_0x6290('0x3c')][_0x6290('0x41')]));_0x1b03ca[_0x6290('0x42')]=_0x1b03ca[_0x6290('0x42')][_0x6290('0x43')]?_0x1b03ca['attributes']:_0x39d763['model'];if(!_0x3449ea[_0x6290('0x3c')][_0x6290('0x44')](_0x6290('0x45'))){_0x1b03ca[_0x6290('0x2d')]=qs[_0x6290('0x2d')](_0x3449ea[_0x6290('0x3c')][_0x6290('0x2d')]);_0x1b03ca['offset']=qs[_0x6290('0x2b')](_0x3449ea[_0x6290('0x3c')][_0x6290('0x2b')]);}_0x1b03ca[_0x6290('0x46')]=qs[_0x6290('0x47')](_0x3449ea[_0x6290('0x3c')][_0x6290('0x47')]);_0x1b03ca[_0x6290('0x48')]=qs[_0x6290('0x3e')](_[_0x6290('0x49')](_0x3449ea['query'],_0x39d763[_0x6290('0x3e')]),_0x566ff1);if(_0x3449ea[_0x6290('0x3c')][_0x6290('0x4a')]){_0x1b03ca['where']=_[_0x6290('0x4b')](_0x1b03ca['where'],{'$or':_['map'](_0x566ff1,function(_0x40a08d){if(_0x40a08d[_0x6290('0x3a')]!=='VIRTUAL'){var _0x378161={};_0x378161[_0x40a08d['name']]={'$like':'%'+_0x3449ea[_0x6290('0x3c')]['filter']+'%'};return _0x378161;}})});}_0x1b03ca=_[_0x6290('0x4b')]({},_0x1b03ca,_0x3449ea['options']);var _0x3a2d17={'where':_0x1b03ca[_0x6290('0x48')]};return db[_0x6290('0x4c')][_0x6290('0x2e')](_0x3a2d17)[_0x6290('0x1e')](function(_0x1827d2){_0x10621f['count']=_0x1827d2;if(_0x3449ea[_0x6290('0x3c')][_0x6290('0x4d')]){_0x1b03ca[_0x6290('0x4e')]=[{'all':!![]}];}return db['SmsMessage'][_0x6290('0x4f')](_0x1b03ca);})[_0x6290('0x1e')](function(_0x18eb35){_0x10621f['rows']=_0x18eb35;return _0x10621f;})['then'](respondWithFilteredResult(_0x3b25ec,_0x1b03ca))[_0x6290('0x26')](handleError(_0x3b25ec,null));};exports[_0x6290('0x50')]=function(_0x5d6a9f,_0x4ef1c7){var _0x1d7fd4={'raw':!![],'where':{'id':_0x5d6a9f[_0x6290('0x51')]['id']}},_0x40b8c8={};_0x40b8c8[_0x6290('0x40')]=_[_0x6290('0x3d')](db[_0x6290('0x4c')]['rawAttributes']);_0x40b8c8[_0x6290('0x3c')]=_[_0x6290('0x3d')](_0x5d6a9f[_0x6290('0x3c')]);_0x40b8c8[_0x6290('0x3e')]=_[_0x6290('0x3f')](_0x40b8c8[_0x6290('0x40')],_0x40b8c8[_0x6290('0x3c')]);_0x1d7fd4['attributes']=_[_0x6290('0x3f')](_0x40b8c8[_0x6290('0x40')],qs[_0x6290('0x41')](_0x5d6a9f['query'][_0x6290('0x41')]));_0x1d7fd4[_0x6290('0x42')]=_0x1d7fd4[_0x6290('0x42')][_0x6290('0x43')]?_0x1d7fd4[_0x6290('0x42')]:_0x40b8c8[_0x6290('0x40')];if(_0x5d6a9f[_0x6290('0x3c')][_0x6290('0x4d')]){_0x1d7fd4['include']=[{'all':!![]}];}_0x1d7fd4=_['merge']({},_0x1d7fd4,_0x5d6a9f[_0x6290('0x52')]);return db[_0x6290('0x4c')][_0x6290('0x53')](_0x1d7fd4)[_0x6290('0x1e')](handleEntityNotFound(_0x4ef1c7,null))[_0x6290('0x1e')](respondWithResult(_0x4ef1c7,null))[_0x6290('0x26')](handleError(_0x4ef1c7,null));};exports['create']=function(_0x4c1a20,_0x53d85c){return db[_0x6290('0x4c')][_0x6290('0x54')](_0x4c1a20[_0x6290('0x55')],{})['then'](respondWithResult(_0x53d85c,0xc9))[_0x6290('0x26')](handleError(_0x53d85c,null));};exports[_0x6290('0x32')]=function(_0xd42fac,_0x4a3f02){if(_0xd42fac[_0x6290('0x55')]['id']){delete _0xd42fac[_0x6290('0x55')]['id'];}return db[_0x6290('0x4c')][_0x6290('0x53')]({'where':{'id':_0xd42fac[_0x6290('0x51')]['id']}})['then'](handleEntityNotFound(_0x4a3f02,null))[_0x6290('0x1e')](saveUpdates(_0xd42fac[_0x6290('0x55')],null))[_0x6290('0x1e')](respondWithResult(_0x4a3f02,null))[_0x6290('0x26')](handleError(_0x4a3f02,null));};exports[_0x6290('0x33')]=function(_0x221162,_0x30e9de){return db[_0x6290('0x4c')]['find']({'where':{'id':_0x221162[_0x6290('0x51')]['id']}})[_0x6290('0x1e')](handleEntityNotFound(_0x30e9de,null))[_0x6290('0x1e')](removeEntity(_0x30e9de,null))[_0x6290('0x26')](handleError(_0x30e9de,null));};exports['describe']=function(_0x1eef14,_0x44e90a){return db['SmsMessage'][_0x6290('0x56')]()[_0x6290('0x1e')](respondWithResult(_0x44e90a,null))[_0x6290('0x26')](handleError(_0x44e90a,null));};var interaction_log=require(_0x6290('0x13'))('sms-interactions');exports[_0x6290('0x57')]=function(_0x47fce5,_0x4c499e,_0x1ff6e8){var _0x3cdde2={'agent':{},'channel':'sms'};if(_0x47fce5[_0x6290('0x55')]['id']){delete _0x47fce5['body']['id'];}_0x47fce5[_0x6290('0x55')]['read']=!![];_0x47fce5['body'][_0x6290('0x58')]=moment()[_0x6290('0x59')](_0x6290('0x5a'));_0x47fce5[_0x6290('0x55')]['UserId']=_0x47fce5[_0x6290('0x55')]['UserId']||_0x47fce5[_0x6290('0x5b')]['id'];_0x3cdde2['agent']['id']=_0x47fce5[_0x6290('0x55')][_0x6290('0x5c')];return db[_0x6290('0x4c')][_0x6290('0x53')]({'where':{'id':_0x47fce5[_0x6290('0x51')]['id'],'UserId':null}})[_0x6290('0x1e')](handleEntityNotFound(_0x4c499e,null))[_0x6290('0x1e')](saveUpdates(_0x47fce5['body'],null))[_0x6290('0x1e')](function(_0x208a3f){if(_0x208a3f){_0x3cdde2['message']=_0x208a3f[_0x6290('0x5d')]({'plain':!![]});return db['SmsInteraction'][_0x6290('0x53')]({'where':{'id':_0x208a3f[_0x6290('0x5e')]}});}return null;})[_0x6290('0x1e')](handleEntityNotFound(_0x4c499e,null))['then'](function(_0x3a2912){if(_0x3a2912){return _0x3a2912[_0x6290('0x32')]({'UserId':_0x47fce5[_0x6290('0x55')][_0x6290('0x5c')],'read1stAt':_['isNil'](_0x3a2912[_0x6290('0x5f')])?moment()['format'](_0x6290('0x5a')):undefined});}return null;})[_0x6290('0x1e')](function(_0x27698e){if(_0x27698e){_0x3cdde2[_0x6290('0x60')]=_0x27698e[_0x6290('0x5d')]({'plain':!![]});interaction_log[_0x6290('0x25')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x47fce5['user']['id'],_0x47fce5[_0x6290('0x5b')][_0x6290('0x35')],_0x47fce5[_0x6290('0x5b')][_0x6290('0x61')],_0x3cdde2[_0x6290('0x60')]['id'],_0x47fce5['body']?JSON[_0x6290('0x62')](_0x47fce5[_0x6290('0x55')]):'null');return respondWithRpcPromise('AcceptMessage',_0x6290('0x63'),_0x3cdde2);}return null;})[_0x6290('0x1e')](function(_0x366d4e){var _0x3a49bc=_0x6290('0x64')+_0x366d4e[_0x6290('0x24')]['ContactId'];return db[_0x6290('0x65')][_0x6290('0x3c')](_0x3a49bc,{'type':db[_0x6290('0x66')][_0x6290('0x67')]['SELECT'],'raw':!![]})[_0x6290('0x1e')](function(_0x30a372){return _0x30a372;});})[_0x6290('0x1e')](function(_0x5cd3f6){if(_0x5cd3f6){_0x3cdde2[_0x6290('0x24')][_0x6290('0x68')]=_0x5cd3f6[0x0];if(!_0x47fce5[_0x6290('0x55')][_0x6290('0x5c')])return;return db[_0x6290('0x69')][_0x6290('0x53')]({'where':{'id':_0x47fce5[_0x6290('0x55')]['UserId'],'role':_0x6290('0x6a')},'attributes':['id',_0x6290('0x35'),_0x6290('0x6b'),_0x6290('0x6c'),_0x6290('0x6d')],'raw':!![]});}return null;})[_0x6290('0x1e')](function(_0x54b091){if(!_0x54b091)return null;_0x3cdde2[_0x6290('0x24')][_0x6290('0x6a')]=_0x54b091;return _0x3cdde2;})[_0x6290('0x1e')](function(_0x35b836){if(_0x35b836){if(_0x47fce5['body'][_0x6290('0x6e')]){_0x3cdde2[_0x6290('0x24')][_0x6290('0x6f')]=util[_0x6290('0x59')]('SIP/%s',_0x47fce5[_0x6290('0x5b')][_0x6290('0x35')]);_0x3cdde2['message']['channel']=_0x3cdde2[_0x6290('0x70')];_0x3cdde2[_0x6290('0x24')][_0x6290('0x71')]=_0x3cdde2[_0x6290('0x70')];_0x3cdde2[_0x6290('0x24')][_0x6290('0x72')]=_0x6290('0x57');return respondWithRpcPromise(_0x6290('0x73'),_0x6290('0x73'),{'event':_0x6290('0x74'),'message':_0x3cdde2[_0x6290('0x24')]},client9002)[_0x6290('0x1e')](function(){return _0x3cdde2;});}return _0x3cdde2;}return null;})[_0x6290('0x1e')](respondWithResult(_0x4c499e,null))[_0x6290('0x26')](handleError(_0x4c499e,null));};var interaction_log=require(_0x6290('0x13'))(_0x6290('0x75'));exports[_0x6290('0x76')]=function(_0x494e67,_0x1ce880,_0x58bb3e){var _0x3964c6={'agent':{},'channel':_0x6290('0x77')};if(_0x494e67[_0x6290('0x55')]['id']){delete _0x494e67[_0x6290('0x55')]['id'];}_0x494e67['body']['UserId']=_0x494e67['body'][_0x6290('0x5c')]||_0x494e67[_0x6290('0x5b')]['id'];_0x3964c6[_0x6290('0x6a')]['id']=_0x494e67[_0x6290('0x55')][_0x6290('0x5c')];return db[_0x6290('0x4c')][_0x6290('0x53')]({'where':{'id':_0x494e67[_0x6290('0x51')]['id'],'UserId':null}})[_0x6290('0x1e')](handleEntityNotFound(_0x1ce880,null))[_0x6290('0x1e')](function(_0x4512ac){if(_0x4512ac){_0x3964c6[_0x6290('0x24')]=_0x4512ac['get']({'plain':!![]});return db[_0x6290('0x78')][_0x6290('0x53')]({'where':{'id':_0x4512ac[_0x6290('0x5e')]}});}return null;})[_0x6290('0x1e')](handleEntityNotFound(_0x1ce880,null))[_0x6290('0x1e')](function(_0x489a48){if(_0x489a48){_0x3964c6['interaction']=_0x489a48[_0x6290('0x5d')]({'plain':!![]});interaction_log[_0x6290('0x25')](_0x6290('0x79'),_0x494e67[_0x6290('0x5b')]['id'],_0x494e67['user'][_0x6290('0x35')],_0x494e67[_0x6290('0x5b')][_0x6290('0x61')],_0x3964c6[_0x6290('0x60')]['id'],_0x494e67[_0x6290('0x55')]?JSON[_0x6290('0x62')](_0x494e67[_0x6290('0x55')]):'null');return respondWithRpcPromise(_0x6290('0x7a'),_0x6290('0x7b'),_0x3964c6);}return null;})['then'](function(_0x262430){var _0x3e10d1=_0x6290('0x64')+_0x262430[_0x6290('0x24')][_0x6290('0x7c')];return db[_0x6290('0x65')][_0x6290('0x3c')](_0x3e10d1,{'type':db[_0x6290('0x66')]['QueryTypes'][_0x6290('0x7d')],'raw':!![]})[_0x6290('0x1e')](function(_0x332658){return _0x332658;});})[_0x6290('0x1e')](function(_0x7437e){if(_0x7437e){_0x3964c6['message'][_0x6290('0x68')]=_0x7437e[0x0];if(!_0x494e67[_0x6290('0x55')][_0x6290('0x5c')])return;return db[_0x6290('0x69')][_0x6290('0x53')]({'where':{'id':_0x494e67[_0x6290('0x55')]['UserId'],'role':'agent'},'attributes':['id',_0x6290('0x35'),_0x6290('0x6b'),_0x6290('0x6c'),_0x6290('0x6d')],'raw':!![]});}return null;})[_0x6290('0x1e')](function(_0x22b85f){if(!_0x22b85f)return null;_0x3964c6['message']['agent']=_0x22b85f;return _0x3964c6;})[_0x6290('0x1e')](function(_0x24749a){if(_0x24749a){_0x24749a['message'][_0x6290('0x6f')]=util[_0x6290('0x59')](_0x6290('0x7e'),_0x494e67[_0x6290('0x5b')]['name']);_0x24749a[_0x6290('0x24')][_0x6290('0x70')]=_0x3964c6[_0x6290('0x70')];_0x24749a[_0x6290('0x24')]['motionChannel']=_0x3964c6[_0x6290('0x70')];_0x24749a[_0x6290('0x24')][_0x6290('0x72')]=_0x6290('0x76');respondWithRpcPromise('EventManager',_0x6290('0x73'),{'event':_0x6290('0x7f'),'message':_0x24749a[_0x6290('0x24')]},client9002);return _0x3964c6;}return null;})['then'](respondWithResult(_0x1ce880,null))[_0x6290('0x26')](handleError(_0x1ce880,null));};exports[_0x6290('0x28')]=function(_0x4ac10c,_0x253e28,_0xc0cb3c){if(_0x4ac10c[_0x6290('0x55')]['id']){delete _0x4ac10c[_0x6290('0x55')]['id'];}var _0x626158;return db['SmsMessage']['find']({'where':{'id':_0x4ac10c[_0x6290('0x51')]['id']}})['then'](handleEntityNotFound(_0x253e28,null))[_0x6290('0x1e')](function(_0x276f5c){if(_0x276f5c){_0x626158=_0x276f5c;return db[_0x6290('0x80')][_0x6290('0x53')]({'where':{'id':_0x276f5c[_0x6290('0x81')]}});}})[_0x6290('0x1e')](handleEntityNotFound(_0x253e28,null))[_0x6290('0x1e')](function(_0x466576){if(_0x466576){logger[_0x6290('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x466576[_0x6290('0x3a')],util[_0x6290('0x82')](_0x4ac10c[_0x6290('0x55')],{'showHidden':![],'depth':null}));switch(_0x466576[_0x6290('0x3a')]){case _0x6290('0x83'):if(_0x4ac10c['body'][_0x6290('0x84')]&&_0x4ac10c['body'][_0x6290('0x84')]===_0x626158[_0x6290('0x85')]){return _0x626158['update']({'read':!![]});}else{logger[_0x6290('0x23')](_0x6290('0x86'),_0x6290('0x28'),'twilio',util['inspect'](_0x4ac10c[_0x6290('0x55')],{'showHidden':![],'depth':null}));}break;case _0x6290('0x87'):if(_0x4ac10c[_0x6290('0x55')]['MessageUUID']&&_0x4ac10c[_0x6290('0x55')]['MessageUUID']===_0x626158[_0x6290('0x85')]&&_['indexOf'](['sent',_0x6290('0x88')],_0x4ac10c[_0x6290('0x55')][_0x6290('0x89')])>=0x0){return _0x626158[_0x6290('0x32')]({'read':!![]});}else{logger['error'](_0x6290('0x86'),_0x6290('0x28'),'plivio',util['inspect'](_0x4ac10c[_0x6290('0x55')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x138c12=_0x4ac10c[_0x6290('0x55')]['results'][0x0];if(_0x138c12[_0x6290('0x28')][_0x6290('0x8a')]===_0x6290('0x8b')){return _0x626158[_0x6290('0x32')]({'read':!![]});}else{logger[_0x6290('0x23')](_0x6290('0x86'),_0x6290('0x28'),'infobip',util[_0x6290('0x82')](_0x4ac10c[_0x6290('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x626158;}})[_0x6290('0x1e')](respondWithResult(_0x253e28,null))[_0x6290('0x26')](handleError(_0x253e28,null));}; \ No newline at end of file +var _0x7732=['register','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SmsMessage','includeAll','findAll','rows','show','params','find','body','describe','sms-interactions','accept','sms','readAt','YYYY-MM-DD\x20HH:mm:ss','user','agent','SmsInteraction','UserId','isNil','read1stAt','format','role','interaction','null','AcceptMessage','acceptMessage','sequelize','QueryTypes','SELECT','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','../../config/logger','reject','get','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','contact','User','fullname','internal','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','delivered','Status','plivio','results','groupName','infobip','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./smsMessage.socket'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x7732,0x7d));var _0x2773=function(_0x4e697a,_0x56a14b){_0x4e697a=_0x4e697a-0x0;var _0x88850c=_0x7732[_0x4e697a];return _0x88850c;};'use strict';var emlformat=require(_0x2773('0x0'));var rimraf=require(_0x2773('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2773('0x2'));var rp=require(_0x2773('0x3'));var moment=require(_0x2773('0x4'));var BPromise=require(_0x2773('0x5'));var Mustache=require(_0x2773('0x6'));var util=require(_0x2773('0x7'));var path=require(_0x2773('0x8'));var sox=require(_0x2773('0x9'));var csv=require('to-csv');var ejs=require(_0x2773('0xa'));var fs=require('fs');var fs_extra=require(_0x2773('0xb'));var _=require('lodash');var squel=require(_0x2773('0xc'));var crypto=require(_0x2773('0xd'));var jsforce=require(_0x2773('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2773('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2773('0x10'));var qs=require(_0x2773('0x11'));var as=require(_0x2773('0x12'));var hardwareService=require(_0x2773('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2773('0x14'));var config=require(_0x2773('0x15'));var licenseUtil=require(_0x2773('0x16'));var db=require(_0x2773('0x17'))['db'];config['redis']=_[_0x2773('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2773('0x19'))(new Redis(config[_0x2773('0x1a')]));require(_0x2773('0x1b'))[_0x2773('0x1c')](socket);var jayson=require(_0x2773('0x1d'));var client=jayson[_0x2773('0x1e')][_0x2773('0x1f')]({'port':0x232c});var client9002=jayson[_0x2773('0x1e')][_0x2773('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x421c9b,_0x26ce19,_0x25d884,_0x238c9a){return new BPromise(function(_0x50fefe,_0x490719){var _0xa44f8d=_0x238c9a||client;return _0xa44f8d[_0x2773('0x20')](_0x421c9b,_0x25d884)['then'](function(_0x1b450e){logger[_0x2773('0x21')](_0x2773('0x22'),_0x26ce19,_0x2773('0x23'));logger[_0x2773('0x24')](_0x2773('0x25'),_0x26ce19,_0x2773('0x23'),JSON['stringify'](_0x1b450e));if(_0x1b450e[_0x2773('0x26')]){if(_0x1b450e[_0x2773('0x26')][_0x2773('0x27')]===0x1f4){logger[_0x2773('0x26')](_0x2773('0x22'),_0x26ce19,_0x1b450e['error'][_0x2773('0x28')]);return _0x490719(_0x1b450e[_0x2773('0x26')][_0x2773('0x28')]);}logger['error'](_0x2773('0x22'),_0x26ce19,_0x1b450e[_0x2773('0x26')][_0x2773('0x28')]);return _0x50fefe(_0x1b450e['error'][_0x2773('0x28')]);}else{logger['info'](_0x2773('0x22'),_0x26ce19,_0x2773('0x23'));_0x50fefe(_0x1b450e[_0x2773('0x29')]['message']);}})[_0x2773('0x2a')](function(_0x579b20){logger[_0x2773('0x26')](_0x2773('0x22'),_0x26ce19,_0x579b20);_0x490719(_0x579b20);});});}function respondWithStatusCode(_0x3d3283,_0x493ca3){_0x493ca3=_0x493ca3||0xcc;return function(_0xd2ac85){if(_0xd2ac85){return _0x3d3283['sendStatus'](_0x493ca3);}return _0x3d3283[_0x2773('0x2b')](_0x493ca3)['end']();};}function respondWithResult(_0x3aa282,_0x149790){_0x149790=_0x149790||0xc8;return function(_0x211d9c){if(_0x211d9c){return _0x3aa282[_0x2773('0x2b')](_0x149790)[_0x2773('0x2c')](_0x211d9c);}};}function respondWithFilteredResult(_0xe02608,_0x596935){return function(_0x5499a7){if(_0x5499a7){var _0x49d035=typeof _0x596935[_0x2773('0x2d')]===_0x2773('0x2e')&&typeof _0x596935[_0x2773('0x2f')]==='undefined';var _0x428f13=_0x5499a7[_0x2773('0x30')];var _0x286edb=_0x49d035?0x0:_0x596935['offset'];var _0x18c1e6=_0x49d035?_0x5499a7['count']:_0x596935[_0x2773('0x2d')]+_0x596935[_0x2773('0x2f')];var _0x5c8427;if(_0x18c1e6>=_0x428f13){_0x18c1e6=_0x428f13;_0x5c8427=0xc8;}else{_0x5c8427=0xce;}_0xe02608[_0x2773('0x2b')](_0x5c8427);return _0xe02608[_0x2773('0x31')](_0x2773('0x32'),_0x286edb+'-'+_0x18c1e6+'/'+_0x428f13)[_0x2773('0x2c')](_0x5499a7);}return null;};}function patchUpdates(_0xe2a092){return function(_0x206d67){try{jsonpatch[_0x2773('0x33')](_0x206d67,_0xe2a092,!![]);}catch(_0x48d172){return BPromise['reject'](_0x48d172);}return _0x206d67[_0x2773('0x34')]();};}function saveUpdates(_0x165c0e,_0x2c091e){return function(_0x54136c){if(_0x54136c){return _0x54136c[_0x2773('0x35')](_0x165c0e)[_0x2773('0x36')](function(_0x43136d){return _0x43136d;});}return null;};}function removeEntity(_0x2c50e9,_0x26d089){return function(_0x1b183f){if(_0x1b183f){return _0x1b183f[_0x2773('0x37')]()['then'](function(){_0x2c50e9[_0x2773('0x2b')](0xcc)[_0x2773('0x38')]();});}};}function handleEntityNotFound(_0x4f7a84,_0x37e52d){return function(_0x4af1f8){if(!_0x4af1f8){_0x4f7a84[_0x2773('0x39')](0x194);}return _0x4af1f8;};}function handleError(_0x227112,_0x2b375a){_0x2b375a=_0x2b375a||0x1f4;return function(_0x3f6023){logger['error'](_0x3f6023[_0x2773('0x3a')]);if(_0x3f6023[_0x2773('0x3b')]){delete _0x3f6023[_0x2773('0x3b')];}_0x227112[_0x2773('0x2b')](_0x2b375a)[_0x2773('0x3c')](_0x3f6023);};}exports[_0x2773('0x3d')]=function(_0x27ee68,_0x105e8){var _0x2ea479={},_0x3c8051={},_0x16c78a={'count':0x0,'rows':[]};var _0x4c15b1=_['map'](db['SmsMessage'][_0x2773('0x3e')],function(_0x2a00f6){return{'name':_0x2a00f6[_0x2773('0x3f')],'type':_0x2a00f6['type'][_0x2773('0x40')]};});_0x3c8051[_0x2773('0x41')]=_[_0x2773('0x42')](_0x4c15b1,_0x2773('0x3b'));_0x3c8051[_0x2773('0x43')]=_[_0x2773('0x44')](_0x27ee68[_0x2773('0x43')]);_0x3c8051[_0x2773('0x45')]=_[_0x2773('0x46')](_0x3c8051[_0x2773('0x41')],_0x3c8051[_0x2773('0x43')]);_0x2ea479['attributes']=_[_0x2773('0x46')](_0x3c8051[_0x2773('0x41')],qs[_0x2773('0x47')](_0x27ee68['query'][_0x2773('0x47')]));_0x2ea479['attributes']=_0x2ea479[_0x2773('0x48')][_0x2773('0x49')]?_0x2ea479[_0x2773('0x48')]:_0x3c8051[_0x2773('0x41')];if(!_0x27ee68[_0x2773('0x43')][_0x2773('0x4a')](_0x2773('0x4b'))){_0x2ea479[_0x2773('0x2f')]=qs[_0x2773('0x2f')](_0x27ee68[_0x2773('0x43')][_0x2773('0x2f')]);_0x2ea479['offset']=qs[_0x2773('0x2d')](_0x27ee68[_0x2773('0x43')][_0x2773('0x2d')]);}_0x2ea479[_0x2773('0x4c')]=qs[_0x2773('0x4d')](_0x27ee68[_0x2773('0x43')]['sort']);_0x2ea479[_0x2773('0x4e')]=qs[_0x2773('0x45')](_[_0x2773('0x4f')](_0x27ee68[_0x2773('0x43')],_0x3c8051[_0x2773('0x45')]),_0x4c15b1);if(_0x27ee68['query'][_0x2773('0x50')]){_0x2ea479[_0x2773('0x4e')]=_[_0x2773('0x51')](_0x2ea479[_0x2773('0x4e')],{'$or':_[_0x2773('0x42')](_0x4c15b1,function(_0x21b4be){if(_0x21b4be[_0x2773('0x52')]!==_0x2773('0x53')){var _0x493551={};_0x493551[_0x21b4be[_0x2773('0x3b')]]={'$like':'%'+_0x27ee68['query'][_0x2773('0x50')]+'%'};return _0x493551;}})});}_0x2ea479=_[_0x2773('0x51')]({},_0x2ea479,_0x27ee68[_0x2773('0x54')]);var _0x622fa8={'where':_0x2ea479['where']};return db[_0x2773('0x55')]['count'](_0x622fa8)[_0x2773('0x36')](function(_0x71eb83){_0x16c78a['count']=_0x71eb83;if(_0x27ee68[_0x2773('0x43')][_0x2773('0x56')]){_0x2ea479['include']=[{'all':!![]}];}return db[_0x2773('0x55')][_0x2773('0x57')](_0x2ea479);})[_0x2773('0x36')](function(_0x41fdd8){_0x16c78a[_0x2773('0x58')]=_0x41fdd8;return _0x16c78a;})['then'](respondWithFilteredResult(_0x105e8,_0x2ea479))[_0x2773('0x2a')](handleError(_0x105e8,null));};exports[_0x2773('0x59')]=function(_0xc84295,_0x259491){var _0x16fc79={'raw':!![],'where':{'id':_0xc84295[_0x2773('0x5a')]['id']}},_0x865fad={};_0x865fad[_0x2773('0x41')]=_[_0x2773('0x44')](db[_0x2773('0x55')][_0x2773('0x3e')]);_0x865fad[_0x2773('0x43')]=_['keys'](_0xc84295[_0x2773('0x43')]);_0x865fad[_0x2773('0x45')]=_[_0x2773('0x46')](_0x865fad[_0x2773('0x41')],_0x865fad[_0x2773('0x43')]);_0x16fc79[_0x2773('0x48')]=_[_0x2773('0x46')](_0x865fad[_0x2773('0x41')],qs[_0x2773('0x47')](_0xc84295[_0x2773('0x43')][_0x2773('0x47')]));_0x16fc79[_0x2773('0x48')]=_0x16fc79[_0x2773('0x48')][_0x2773('0x49')]?_0x16fc79['attributes']:_0x865fad[_0x2773('0x41')];if(_0xc84295['query'][_0x2773('0x56')]){_0x16fc79['include']=[{'all':!![]}];}_0x16fc79=_[_0x2773('0x51')]({},_0x16fc79,_0xc84295['options']);return db[_0x2773('0x55')][_0x2773('0x5b')](_0x16fc79)['then'](handleEntityNotFound(_0x259491,null))[_0x2773('0x36')](respondWithResult(_0x259491,null))[_0x2773('0x2a')](handleError(_0x259491,null));};exports['create']=function(_0x3d8c2d,_0x5e4da9){return db[_0x2773('0x55')]['create'](_0x3d8c2d[_0x2773('0x5c')],{})[_0x2773('0x36')](respondWithResult(_0x5e4da9,0xc9))[_0x2773('0x2a')](handleError(_0x5e4da9,null));};exports[_0x2773('0x35')]=function(_0x58a634,_0x3150f7){if(_0x58a634[_0x2773('0x5c')]['id']){delete _0x58a634[_0x2773('0x5c')]['id'];}return db[_0x2773('0x55')][_0x2773('0x5b')]({'where':{'id':_0x58a634[_0x2773('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3150f7,null))[_0x2773('0x36')](saveUpdates(_0x58a634[_0x2773('0x5c')],null))[_0x2773('0x36')](respondWithResult(_0x3150f7,null))['catch'](handleError(_0x3150f7,null));};exports[_0x2773('0x37')]=function(_0x3c5a38,_0x57a0d0){return db[_0x2773('0x55')]['find']({'where':{'id':_0x3c5a38[_0x2773('0x5a')]['id']}})[_0x2773('0x36')](handleEntityNotFound(_0x57a0d0,null))['then'](removeEntity(_0x57a0d0,null))[_0x2773('0x2a')](handleError(_0x57a0d0,null));};exports[_0x2773('0x5d')]=function(_0x109384,_0x408adf){return db[_0x2773('0x55')]['describe']()[_0x2773('0x36')](respondWithResult(_0x408adf,null))[_0x2773('0x2a')](handleError(_0x408adf,null));};var interaction_log=require('../../config/logger')(_0x2773('0x5e'));exports[_0x2773('0x5f')]=function(_0x3cfcdb,_0x4b2641,_0x16ef40){var _0x510743={'agent':{},'channel':_0x2773('0x60')};if(_0x3cfcdb[_0x2773('0x5c')]['id']){delete _0x3cfcdb[_0x2773('0x5c')]['id'];}_0x3cfcdb['body']['read']=!![];_0x3cfcdb[_0x2773('0x5c')][_0x2773('0x61')]=moment()['format'](_0x2773('0x62'));_0x3cfcdb[_0x2773('0x5c')]['UserId']=_0x3cfcdb['body']['UserId']||_0x3cfcdb[_0x2773('0x63')]['id'];_0x510743[_0x2773('0x64')]['id']=_0x3cfcdb['body']['UserId'];return db[_0x2773('0x55')][_0x2773('0x5b')]({'where':{'id':_0x3cfcdb[_0x2773('0x5a')]['id'],'UserId':null}})[_0x2773('0x36')](handleEntityNotFound(_0x4b2641,null))[_0x2773('0x36')](saveUpdates(_0x3cfcdb[_0x2773('0x5c')],null))['then'](function(_0x15c06b){if(_0x15c06b){_0x510743[_0x2773('0x28')]=_0x15c06b['get']({'plain':!![]});return db[_0x2773('0x65')]['find']({'where':{'id':_0x15c06b['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4b2641,null))[_0x2773('0x36')](function(_0x315666){if(_0x315666){return _0x315666[_0x2773('0x35')]({'UserId':_0x3cfcdb[_0x2773('0x5c')][_0x2773('0x66')],'read1stAt':_[_0x2773('0x67')](_0x315666[_0x2773('0x68')])?moment()[_0x2773('0x69')](_0x2773('0x62')):undefined});}return null;})[_0x2773('0x36')](function(_0x2c10dd){if(_0x2c10dd){_0x510743['interaction']=_0x2c10dd['get']({'plain':!![]});interaction_log[_0x2773('0x21')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3cfcdb[_0x2773('0x63')]['id'],_0x3cfcdb[_0x2773('0x63')][_0x2773('0x3b')],_0x3cfcdb[_0x2773('0x63')][_0x2773('0x6a')],_0x510743[_0x2773('0x6b')]['id'],_0x3cfcdb[_0x2773('0x5c')]?JSON['stringify'](_0x3cfcdb[_0x2773('0x5c')]):_0x2773('0x6c'));return respondWithRpcPromise(_0x2773('0x6d'),_0x2773('0x6e'),_0x510743);}return null;})[_0x2773('0x36')](function(_0x19072e){var _0x42e8a3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x19072e[_0x2773('0x28')]['ContactId'];return db[_0x2773('0x6f')]['query'](_0x42e8a3,{'type':db['Sequelize'][_0x2773('0x70')][_0x2773('0x71')],'raw':!![]})[_0x2773('0x36')](function(_0x54835e){return _0x54835e;});})[_0x2773('0x36')](function(_0x4a314f){if(_0x4a314f){_0x510743[_0x2773('0x28')]['contact']=_0x4a314f[0x0];if(!_0x3cfcdb[_0x2773('0x5c')][_0x2773('0x66')])return;return db['User'][_0x2773('0x5b')]({'where':{'id':_0x3cfcdb[_0x2773('0x5c')][_0x2773('0x66')],'role':'agent'},'attributes':['id',_0x2773('0x3b'),'fullname',_0x2773('0x72'),'internal'],'raw':!![]});}return null;})[_0x2773('0x36')](function(_0x3c7e76){if(!_0x3c7e76)return null;_0x510743['message'][_0x2773('0x64')]=_0x3c7e76;return _0x510743;})['then'](function(_0x54b7be){if(_0x54b7be){if(_0x3cfcdb[_0x2773('0x5c')][_0x2773('0x73')]){_0x510743[_0x2773('0x28')][_0x2773('0x74')]=util[_0x2773('0x69')](_0x2773('0x75'),_0x3cfcdb['user'][_0x2773('0x3b')]);_0x510743[_0x2773('0x28')][_0x2773('0x76')]=_0x510743[_0x2773('0x76')];_0x510743[_0x2773('0x28')][_0x2773('0x77')]=_0x510743[_0x2773('0x76')];_0x510743[_0x2773('0x28')][_0x2773('0x78')]=_0x2773('0x5f');return respondWithRpcPromise('EventManager',_0x2773('0x79'),{'event':_0x2773('0x7a'),'message':_0x510743[_0x2773('0x28')]},client9002)['then'](function(){return _0x510743;});}return _0x510743;}return null;})[_0x2773('0x36')](respondWithResult(_0x4b2641,null))[_0x2773('0x2a')](handleError(_0x4b2641,null));};var interaction_log=require(_0x2773('0x7b'))(_0x2773('0x5e'));exports[_0x2773('0x7c')]=function(_0x29bb0a,_0xdf4b04,_0x59c225){var _0x5829ca={'agent':{},'channel':'sms'};if(_0x29bb0a[_0x2773('0x5c')]['id']){delete _0x29bb0a['body']['id'];}_0x29bb0a[_0x2773('0x5c')][_0x2773('0x66')]=_0x29bb0a[_0x2773('0x5c')][_0x2773('0x66')]||_0x29bb0a[_0x2773('0x63')]['id'];_0x5829ca[_0x2773('0x64')]['id']=_0x29bb0a['body'][_0x2773('0x66')];return db[_0x2773('0x55')][_0x2773('0x5b')]({'where':{'id':_0x29bb0a['params']['id'],'UserId':null}})[_0x2773('0x36')](handleEntityNotFound(_0xdf4b04,null))[_0x2773('0x36')](function(_0x222ff8){if(_0x222ff8){_0x5829ca[_0x2773('0x28')]=_0x222ff8[_0x2773('0x7d')]({'plain':!![]});return db[_0x2773('0x65')][_0x2773('0x5b')]({'where':{'id':_0x222ff8[_0x2773('0x7e')]}});}return null;})[_0x2773('0x36')](handleEntityNotFound(_0xdf4b04,null))[_0x2773('0x36')](function(_0x18b166){if(_0x18b166){_0x5829ca['interaction']=_0x18b166['get']({'plain':!![]});interaction_log[_0x2773('0x21')](_0x2773('0x7f'),_0x29bb0a[_0x2773('0x63')]['id'],_0x29bb0a[_0x2773('0x63')][_0x2773('0x3b')],_0x29bb0a[_0x2773('0x63')][_0x2773('0x6a')],_0x5829ca[_0x2773('0x6b')]['id'],_0x29bb0a[_0x2773('0x5c')]?JSON[_0x2773('0x80')](_0x29bb0a[_0x2773('0x5c')]):_0x2773('0x6c'));return respondWithRpcPromise('RejectMessage',_0x2773('0x81'),_0x5829ca);}return null;})[_0x2773('0x36')](function(_0x416bd7){var _0xf57cdb=_0x2773('0x82')+_0x416bd7[_0x2773('0x28')][_0x2773('0x83')];return db[_0x2773('0x6f')][_0x2773('0x43')](_0xf57cdb,{'type':db[_0x2773('0x84')]['QueryTypes'][_0x2773('0x71')],'raw':!![]})['then'](function(_0x1d427f){return _0x1d427f;});})[_0x2773('0x36')](function(_0x16eeba){if(_0x16eeba){_0x5829ca[_0x2773('0x28')][_0x2773('0x85')]=_0x16eeba[0x0];if(!_0x29bb0a[_0x2773('0x5c')][_0x2773('0x66')])return;return db[_0x2773('0x86')]['find']({'where':{'id':_0x29bb0a['body'][_0x2773('0x66')],'role':_0x2773('0x64')},'attributes':['id','name',_0x2773('0x87'),'email',_0x2773('0x88')],'raw':!![]});}return null;})[_0x2773('0x36')](function(_0x962729){if(!_0x962729)return null;_0x5829ca[_0x2773('0x28')][_0x2773('0x64')]=_0x962729;return _0x5829ca;})[_0x2773('0x36')](function(_0x3fff6f){if(_0x3fff6f){_0x3fff6f['message'][_0x2773('0x74')]=util[_0x2773('0x69')](_0x2773('0x75'),_0x29bb0a[_0x2773('0x63')][_0x2773('0x3b')]);_0x3fff6f[_0x2773('0x28')][_0x2773('0x76')]=_0x5829ca[_0x2773('0x76')];_0x3fff6f[_0x2773('0x28')]['motionChannel']=_0x5829ca['channel'];_0x3fff6f['message'][_0x2773('0x78')]='reject';respondWithRpcPromise(_0x2773('0x79'),'EventManager',{'event':'rejectmessage','message':_0x3fff6f[_0x2773('0x28')]},client9002);return _0x5829ca;}return null;})[_0x2773('0x36')](respondWithResult(_0xdf4b04,null))[_0x2773('0x2a')](handleError(_0xdf4b04,null));};exports[_0x2773('0x2b')]=function(_0x45ad74,_0xa6f2d5,_0x1fecbb){if(_0x45ad74[_0x2773('0x5c')]['id']){delete _0x45ad74[_0x2773('0x5c')]['id'];}var _0x14f525;return db['SmsMessage'][_0x2773('0x5b')]({'where':{'id':_0x45ad74[_0x2773('0x5a')]['id']}})['then'](handleEntityNotFound(_0xa6f2d5,null))['then'](function(_0x3323f1){if(_0x3323f1){_0x14f525=_0x3323f1;return db[_0x2773('0x89')][_0x2773('0x5b')]({'where':{'id':_0x3323f1[_0x2773('0x8a')]}});}})[_0x2773('0x36')](handleEntityNotFound(_0xa6f2d5,null))[_0x2773('0x36')](function(_0x36d317){if(_0x36d317){logger['debug'](_0x2773('0x25'),_0x2773('0x2b'),_0x2773('0x8b'),_0x36d317[_0x2773('0x52')],util[_0x2773('0x8c')](_0x45ad74[_0x2773('0x5c')],{'showHidden':![],'depth':null}));switch(_0x36d317[_0x2773('0x52')]){case _0x2773('0x8d'):if(_0x45ad74['body'][_0x2773('0x8e')]&&_0x45ad74[_0x2773('0x5c')][_0x2773('0x8e')]===_0x14f525[_0x2773('0x8f')]){return _0x14f525['update']({'read':!![]});}else{logger['error'](_0x2773('0x90'),_0x2773('0x2b'),_0x2773('0x8d'),util['inspect'](_0x45ad74[_0x2773('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x2773('0x91'):if(_0x45ad74[_0x2773('0x5c')][_0x2773('0x92')]&&_0x45ad74[_0x2773('0x5c')][_0x2773('0x92')]===_0x14f525['messageId']&&_['indexOf'](['sent',_0x2773('0x93')],_0x45ad74[_0x2773('0x5c')][_0x2773('0x94')])>=0x0){return _0x14f525['update']({'read':!![]});}else{logger[_0x2773('0x26')](_0x2773('0x90'),_0x2773('0x2b'),_0x2773('0x95'),util[_0x2773('0x8c')](_0x45ad74[_0x2773('0x5c')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x2d8bea=_0x45ad74['body'][_0x2773('0x96')][0x0];if(_0x2d8bea[_0x2773('0x2b')][_0x2773('0x97')]==='DELIVERED'){return _0x14f525[_0x2773('0x35')]({'read':!![]});}else{logger[_0x2773('0x26')](_0x2773('0x90'),'status',_0x2773('0x98'),util[_0x2773('0x8c')](_0x45ad74[_0x2773('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x14f525;}})[_0x2773('0x36')](respondWithResult(_0xa6f2d5,null))[_0x2773('0x2a')](handleError(_0xa6f2d5,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 873b7c7..a0aece4 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 _0xab6e=['hasOwnProperty','hook','exports','events','SmsMessage','setMaxListeners','update','remove','emit'];(function(_0xf06893,_0x300c83){var _0x99cd3=function(_0x117343){while(--_0x117343){_0xf06893['push'](_0xf06893['shift']());}};_0x99cd3(++_0x300c83);}(_0xab6e,0x11a));var _0xeab6=function(_0x484a60,_0x63e920){_0x484a60=_0x484a60-0x0;var _0x18217b=_0xab6e[_0x484a60];return _0x18217b;};'use strict';var EventEmitter=require(_0xeab6('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xeab6('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xeab6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeab6('0x3'),'afterDestroy':_0xeab6('0x4')};function emitEvent(_0x1c5353){return function(_0x1b1d50,_0x40f901,_0x1d3418){SmsMessageEvents[_0xeab6('0x5')](_0x1c5353+':'+_0x1b1d50['id'],_0x1b1d50);SmsMessageEvents['emit'](_0x1c5353,_0x1b1d50);_0x1d3418(null);};}for(var e in events){if(events[_0xeab6('0x6')](e)){var event=events[e];SmsMessage[_0xeab6('0x7')](e,emitEvent(event));}}module[_0xeab6('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0x8f0f=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','SmsMessage','save','update'];(function(_0x397bfb,_0x589665){var _0x16c9b9=function(_0x13ce8a){while(--_0x13ce8a){_0x397bfb['push'](_0x397bfb['shift']());}};_0x16c9b9(++_0x589665);}(_0x8f0f,0x1f3));var _0xf8f0=function(_0x25ba50,_0x5d4aa8){_0x25ba50=_0x25ba50-0x0;var _0x169fa8=_0x8f0f[_0x25ba50];return _0x169fa8;};'use strict';var EventEmitter=require(_0xf8f0('0x0'));var SmsMessage=require(_0xf8f0('0x1'))['db'][_0xf8f0('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf8f0('0x3'),'afterUpdate':_0xf8f0('0x4'),'afterDestroy':_0xf8f0('0x5')};function emitEvent(_0x4392b6){return function(_0x36fe86,_0x2c3332,_0x314029){SmsMessageEvents[_0xf8f0('0x6')](_0x4392b6+':'+_0x36fe86['id'],_0x36fe86);SmsMessageEvents['emit'](_0x4392b6,_0x36fe86);_0x314029(null);};}for(var e in events){if(events[_0xf8f0('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xf8f0('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 fdf35bf..b95de46 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 _0x9972=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','catch','error','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create','body','phone','remote','/api/sms/messages/','token','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','username','password','smsMethod','sender','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','head','message_id','clickSend','authId','%s:%s','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','/status?token=','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','timestamp','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','Token\x20not\x20received','finally'];(function(_0x382c0f,_0x3ec282){var _0x42ec77=function(_0x2993d8){while(--_0x2993d8){_0x382c0f['push'](_0x382c0f['shift']());}};_0x42ec77(++_0x3ec282);}(_0x9972,0x180));var _0x2997=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9972[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x2997('0x0'));var logger=require(_0x2997('0x1'))(_0x2997('0x2'));var moment=require(_0x2997('0x3'));var BPromise=require(_0x2997('0x4'));var rp=require(_0x2997('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2997('0x6'));var config=require(_0x2997('0x7'));var attributes=require(_0x2997('0x8'));module[_0x2997('0x9')]=function(_0x43f9bc,_0x3434b7){return _0x43f9bc[_0x2997('0xa')](_0x2997('0xb'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x2997('0xc'),'fields':[_0x2997('0xc')]},{'name':_0x2997('0xd'),'fields':['body'],'type':_0x2997('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b0228,_0x203287,_0x1de34f){var _0x2b041d=_0x43f9bc[_0x2997('0xf')];var _0x489d7b=_0x5b0228[_0x2997('0x10')]({'plain':!![]});if(_0x489d7b[_0x2997('0x11')][_0x2997('0x12')]()==='in'||_0x489d7b['direction'][_0x2997('0x12')]()===_0x2997('0x13')&&!_0x489d7b['secret']&&!_[_0x2997('0x14')](_0x489d7b[_0x2997('0x15')])&&!_[_0x2997('0x14')](_0x489d7b[_0x2997('0x16')])){_0x2b041d[_0x2997('0x17')][_0x2997('0x18')]({'where':{'id':_0x489d7b[_0x2997('0x16')]}})[_0x2997('0x19')](function(_0x4ad581){if(_0x4ad581){_0x4ad581['update']({'lastMsgAt':_0x489d7b['createdAt'],'lastMsgDirection':_0x489d7b[_0x2997('0x11')][_0x2997('0x12')]()});}})[_0x2997('0x1a')](function(_0x2739b3){console[_0x2997('0x1b')](_0x2739b3);});}if(_0x489d7b[_0x2997('0x11')]==='out'&&!_0x489d7b[_0x2997('0x1c')]){var _0x324c3e;_0x2b041d[_0x2997('0x1d')][_0x2997('0x1e')]({'where':{'id':_0x489d7b[_0x2997('0x1f')]},'raw':!![]})[_0x2997('0x19')](function(_0x4bcd42){_0x324c3e=_0x4bcd42;if(_0x324c3e&&_0x324c3e[_0x2997('0x20')]){switch(_0x324c3e[_0x2997('0x20')]){case _0x2997('0x21'):var _0x3b2895=require(_0x2997('0x21'));if(_0x324c3e[_0x2997('0x22')]&&_0x324c3e[_0x2997('0x23')]&&_0x324c3e['phone']){var _0x25565a=new _0x3b2895(_0x324c3e['accountSid'],_0x324c3e[_0x2997('0x23')]);_0x25565a[_0x2997('0x24')][_0x2997('0x25')]({'body':_0x489d7b[_0x2997('0x26')],'to':_0x489d7b[_0x2997('0x27')],'from':_0x324c3e[_0x2997('0x27')],'statusCallback':_0x324c3e[_0x2997('0x28')]+_0x2997('0x29')+_0x489d7b['id']+'/status?token='+_0x324c3e[_0x2997('0x2a')]})[_0x2997('0x19')](function(_0x221375){if(_0x221375[_0x2997('0x2b')]){return _0x5b0228[_0x2997('0x2c')]({'messageId':_0x221375[_0x2997('0x2b')]});}})['catch'](function(_0x5a286c){logger['error'](_0x2997('0x2d'),_0x2997('0x2e'),'twilio',util[_0x2997('0x2f')](_0x5a286c,{'showHidden':![],'depth':null}));});}else{logger[_0x2997('0x1b')](_0x2997('0x2d'),_0x2997('0x2e'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x2997('0x30'):var _0x287486='https://api.skebby.it/API/v1.0/REST/';if(_0x324c3e[_0x2997('0x31')]&&_0x324c3e[_0x2997('0x32')]){var _0x1cde1b={'recipient':[_0x489d7b[_0x2997('0x27')]],'message':_0x489d7b[_0x2997('0x26')],'message_type':_0x324c3e['smsMethod']};if(_0x324c3e[_0x2997('0x33')]&&_0x324c3e['smsMethod']!=='SI'){_0x1cde1b[_0x2997('0x34')]=_0x324c3e[_0x2997('0x27')];}var _0x52e917={'url':_0x287486+'login?username='+_0x324c3e[_0x2997('0x31')]+'&password='+_0x324c3e['password'],'method':_0x2997('0x35')};rp(_0x52e917)[_0x2997('0x19')](function(_0x303c8f){var _0x4456dd=_0x303c8f[_0x2997('0x36')](';');var _0x3bfa59={'user_key':_0x4456dd[0x0],'session_key':_0x4456dd[0x1]};_0x52e917={'url':_0x287486+_0x2997('0x37'),'method':_0x2997('0x38'),'headers':{'user_key':_0x3bfa59[_0x2997('0x39')],'Session_key':_0x3bfa59[_0x2997('0x3a')]},'json':!![],'body':_0x1cde1b};return rp(_0x52e917);})[_0x2997('0x19')](function(_0x17ea01){if(_0x17ea01[_0x2997('0x3b')]>=0x1){var _0x36ce4a={'messageId':_0x17ea01[_0x2997('0x3c')]};if(_0x324c3e['smsMethod']!=='GP'||!_0x324c3e[_0x2997('0x3d')]){_0x36ce4a['read']=!![];}return _0x5b0228[_0x2997('0x2c')](_0x36ce4a);}else{return logger['error'](_0x2997('0x2d'),'afterCreate','skebby',util[_0x2997('0x2f')](_0x17ea01,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1e35b0){return logger[_0x2997('0x1b')](_0x2997('0x2d'),_0x2997('0x2e'),_0x2997('0x30'),util[_0x2997('0x2f')](_0x1e35b0,{'showHidden':![],'depth':null}));});}else{logger[_0x2997('0x1b')](_0x2997('0x2d'),_0x2997('0x2e'),'skebby',_0x2997('0x3e'));}break;case _0x2997('0x3f'):if(_0x324c3e[_0x2997('0x23')]){var _0x21a715={'recipient':_0x489d7b['phone'],'message':_0x489d7b['body'],'sender':_0x324c3e[_0x2997('0x40')]||_0x324c3e[_0x2997('0x27')],'authorization':_0x324c3e['authToken']};var _0x203287={'method':'POST','uri':_0x2997('0x41'),'body':_0x21a715,'json':!![]};rp(_0x203287)['then'](function(_0xf29e5b){var _0x225298={'messageId':_0xf29e5b[_0x2997('0x42')]};if(!_0x324c3e['deliveryReport']){_0x225298[_0x2997('0x43')]=!![];}return _0x5b0228['update'](_0x225298);})['catch'](function(_0x45ef31){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2997('0x2e'),_0x2997('0x3f'),util[_0x2997('0x2f')](_0x45ef31,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2997('0x2d'),_0x2997('0x2e'),_0x2997('0x3f'),_0x2997('0x44'));}break;case _0x2997('0x45'):if(_0x324c3e[_0x2997('0x31')]&&_0x324c3e['password']){var _0x21a715={'messages':[{'source':_0x2997('0x46'),'to':_0x489d7b[_0x2997('0x27')],'body':_0x489d7b[_0x2997('0x26')],'from':_0x324c3e['senderString']||_0x324c3e[_0x2997('0x27')]}]};var _0x4535b5=util[_0x2997('0x47')]('%s:%s',_0x324c3e['username'],_0x324c3e['password']);var _0x203287={'method':_0x2997('0x38'),'uri':_0x2997('0x48'),'body':_0x21a715,'headers':{'Authorization':util[_0x2997('0x47')](_0x2997('0x49'),new Buffer(_0x4535b5)[_0x2997('0x4a')](_0x2997('0x4b')))},'json':!![]};rp(_0x203287)['then'](function(_0x2a4c26){if(_0x2a4c26[_0x2997('0x4c')]>=0xc8&&_0x2a4c26[_0x2997('0x4c')]<=0xce){if(_0x2a4c26[_0x2997('0x4d')]&&_0x2a4c26[_0x2997('0x4d')]['queued_count']>0x0){var _0x180fc3=_[_0x2997('0x4e')](_0x2a4c26['data'][_0x2997('0x24')]);var _0x5ca90c={'messageId':_0x180fc3[_0x2997('0x4f')]};if(!_0x324c3e['deliveryReport']){_0x5ca90c[_0x2997('0x43')]=!![];}return _0x5b0228['update'](_0x5ca90c);}else{logger[_0x2997('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2997('0x2e'),_0x2997('0x50'),util[_0x2997('0x2f')](_0x2a4c26,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x2997('0x2d'),_0x2997('0x2e'),'clickSend',util['inspect'](_0x2a4c26,{'showHidden':![],'depth':null}));}})[_0x2997('0x1a')](function(_0x55d819){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2997('0x2e'),_0x2997('0x50'),util['inspect'](_0x55d819,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2997('0x2d'),'afterCreate',_0x2997('0x50'),_0x2997('0x3e'));}break;case'plivo':if(_0x324c3e[_0x2997('0x51')]&&_0x324c3e[_0x2997('0x23')]){var _0x21a715={'dst':_0x489d7b[_0x2997('0x27')],'text':_0x489d7b[_0x2997('0x26')],'src':_0x324c3e[_0x2997('0x40')]||_0x324c3e['phone'],'url':_0x324c3e[_0x2997('0x28')]+_0x2997('0x29')+_0x489d7b['id']+'/status?token='+_0x324c3e['token']};var _0x4535b5=util[_0x2997('0x47')](_0x2997('0x52'),_0x324c3e['authId'],_0x324c3e['authToken']);var _0x203287={'method':_0x2997('0x38'),'uri':util[_0x2997('0x47')]('https://api.plivo.com/v1/Account/%s/Message/',_0x324c3e['authId']),'body':_0x21a715,'headers':{'Authorization':util[_0x2997('0x47')]('Basic\x20%s',new Buffer(_0x4535b5)['toString'](_0x2997('0x4b')))},'json':!![]};rp(_0x203287)[_0x2997('0x19')](function(_0x3ef764){var _0x411353={'messageId':_0x3ef764[_0x2997('0x53')][0x0]};return _0x5b0228[_0x2997('0x2c')](_0x411353);})[_0x2997('0x1a')](function(_0x5c168e){logger[_0x2997('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',util[_0x2997('0x2f')](_0x5c168e,{'showHidden':![],'depth':null}));});}else{logger[_0x2997('0x1b')](_0x2997('0x2d'),'afterCreate',_0x2997('0x54'),_0x2997('0x55'));}break;case _0x2997('0x56'):if(_0x324c3e[_0x2997('0x31')]&&_0x324c3e[_0x2997('0x32')]){if(_0x324c3e[_0x2997('0x57')]){var _0x4ad5ad={'method':_0x2997('0x38'),'uri':_0x324c3e[_0x2997('0x57')]+_0x2997('0x58'),'body':{'username':_0x324c3e[_0x2997('0x31')],'password':_0x324c3e['password']},'json':!![]};return rp(_0x4ad5ad)[_0x2997('0x19')](function(_0x2d6122){var _0x5d9d8e={'method':'POST','uri':_0x324c3e[_0x2997('0x57')]+_0x2997('0x59'),'body':{'messages':[{'from':_0x324c3e['phone'],'destinations':[{'to':_0x489d7b['phone']}],'text':_0x489d7b['body'],'notifyUrl':_0x324c3e[_0x2997('0x28')]+_0x2997('0x29')+_0x489d7b['id']+_0x2997('0x5a')+_0x324c3e[_0x2997('0x2a')],'notifyContentType':_0x2997('0x5b'),'callbackData':_0x324c3e[_0x2997('0x27')]+';'+_0x489d7b['body']}]},'headers':{'Authorization':_0x2997('0x5c')+_0x2d6122[_0x2997('0x2a')]},'json':!![]};return rp(_0x5d9d8e)[_0x2997('0x19')](function(_0x254cfb){if(_0x254cfb[_0x2997('0x24')]){var _0xb66b={'messageId':_0x254cfb['messages'][0x0][_0x2997('0xc')]};if(!_0x324c3e['deliveryReport']){_0xb66b[_0x2997('0x43')]=!![];}return _0x5b0228[_0x2997('0x2c')](_0xb66b);}else{return logger[_0x2997('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2997('0x2e'),_0x2997('0x56'),util[_0x2997('0x2f')](_0x254cfb,{'showHidden':![],'depth':null}));}});})[_0x2997('0x1a')](function(_0x2acb13){return logger[_0x2997('0x1b')](_0x2997('0x2d'),_0x2997('0x2e'),_0x2997('0x56'),util[_0x2997('0x2f')](_0x2acb13,{'showHidden':![],'depth':null}));});}else{logger[_0x2997('0x1b')](_0x2997('0x2d'),'afterCreate','infobip',_0x2997('0x5d'));}}else{logger[_0x2997('0x1b')](_0x2997('0x2d'),_0x2997('0x2e'),_0x2997('0x56'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x2997('0x5e'):var _0x5d6ff3=require(_0x2997('0x5f'));if(_0x324c3e[_0x2997('0x60')]){var _0x13c5fe={};_0x13c5fe['login']=_0x324c3e[_0x2997('0x31')];_0x13c5fe[_0x2997('0x27')]=_0x489d7b[_0x2997('0x27')];_0x13c5fe[_0x2997('0x34')]=_0x324c3e['phone'];_0x13c5fe[_0x2997('0x61')]=_0x489d7b[_0x2997('0x26')];_0x13c5fe[_0x2997('0x62')]=+new Date();var _0x2a09a7='';var _0x5987c2='';var _0x27d6b9=Object['keys'](_0x13c5fe);_0x27d6b9[_0x2997('0x63')]();for(var _0x31ff37=0x0;_0x31ff37<_0x27d6b9[_0x2997('0x64')];_0x31ff37++){if(_0x2a09a7!=''){_0x2a09a7+='&';}_0x2a09a7+=_0x27d6b9[_0x31ff37]+'='+encodeURIComponent(_0x13c5fe[_0x27d6b9[_0x31ff37]]);_0x5987c2+=_0x13c5fe[_0x27d6b9[_0x31ff37]];}_0x5987c2+=_0x324c3e[_0x2997('0x60')];_0x5987c2=_0x5d6ff3[_0x2997('0x65')](_0x2997('0x66'))['update'](_0x5987c2)[_0x2997('0x67')](_0x2997('0x68'));if(_0x2a09a7!==''){_0x2a09a7+='&';}_0x2a09a7+=_0x2997('0x69')+_0x5987c2;var _0x52e917={'method':_0x2997('0x35'),'uri':_0x324c3e[_0x2997('0x57')]+_0x2997('0x6a')+_0x2a09a7,'json':!![]};return rp(_0x52e917)['then'](function(_0x5a9aba){var _0xeaf39=Object[_0x2997('0x6b')](_0x5a9aba);if(_0x5a9aba[_0xeaf39[0x0]][_0x2997('0x1b')]&&parseInt(_0x5a9aba[_0xeaf39[0x0]]['error'])===0x0){var _0x862f71={'messageId':_0x5a9aba[_0xeaf39[0x0]][_0x2997('0x6c')]};if(!_0x324c3e[_0x2997('0x3d')]){_0x862f71['read']=!![];}return _0x5b0228['update'](_0x862f71);}else{return logger[_0x2997('0x1b')](_0x2997('0x2d'),'afterCreate',_0x2997('0x5e'),util['inspect'](_0x5a9aba[_0x2997('0x1b')],{'showHidden':![],'depth':null}));}})[_0x2997('0x1a')](function(_0x448fd3){return logger[_0x2997('0x1b')](_0x2997('0x2d'),_0x2997('0x2e'),'csc',util[_0x2997('0x2f')](_0x448fd3,{'showHidden':![],'depth':null}));});}else{logger[_0x2997('0x1b')](_0x2997('0x2d'),_0x2997('0x2e'),_0x2997('0x5e'),_0x2997('0x6d'));}break;case _0x2997('0x6e'):if(_0x324c3e['apiKey']){var _0x19be50={'method':_0x2997('0x38'),'uri':_0x2997('0x6f'),'headers':{'Authorization':_0x324c3e[_0x2997('0x60')]},'body':{'content':_0x489d7b[_0x2997('0x26')],'to':[_0x489d7b[_0x2997('0x27')]],'from':_0x324c3e[_0x2997('0x27')],'binary':![],'clientMessageId':_0x2997('0x70'),'charset':_0x2997('0x71')},'json':!![]};rp(_0x19be50)[_0x2997('0x19')](function(_0x3b29e4){if(!_0x3b29e4[_0x2997('0x1b')]){var _0x2c72d9={'messageId':_0x3b29e4[_0x2997('0x24')][0x0]['apiMessageId']};if(!_0x324c3e[_0x2997('0x3d')]){_0x2c72d9[_0x2997('0x43')]=!![];}return _0x5b0228[_0x2997('0x2c')](_0x2c72d9);}else{return logger['error'](_0x2997('0x2d'),_0x2997('0x2e'),_0x2997('0x6e'),util['inspect'](_0x3b29e4[_0x2997('0x1b')],{'showHidden':![],'depth':null}));}})[_0x2997('0x1a')](function(_0x51d5aa){return logger[_0x2997('0x1b')](_0x2997('0x2d'),'afterCreate',_0x2997('0x6e'),util[_0x2997('0x2f')](_0x51d5aa,{'showHidden':![],'depth':null}));});}else{logger[_0x2997('0x1b')](_0x2997('0x2d'),_0x2997('0x2e'),'clickatell','Missing\x20parameters:\x20apiKey');}break;case _0x2997('0x72'):if(_0x324c3e['username']&&_0x324c3e[_0x2997('0x32')]){var _0x4535b5=util['format'](_0x2997('0x52'),_0x324c3e[_0x2997('0x31')],_0x324c3e[_0x2997('0x32')]);var _0x203287={'method':_0x2997('0x38'),'uri':_0x2997('0x73')+_0x324c3e[_0x2997('0x74')]+_0x2997('0x75'),'body':{'to':[_0x489d7b[_0x2997('0x27')]],'text':_0x489d7b[_0x2997('0x26')],'from':_0x324c3e[_0x2997('0x27')],'applicationId':_0x324c3e[_0x2997('0x76')]},'headers':{'Authorization':util[_0x2997('0x47')]('Basic\x20%s',new Buffer(_0x4535b5)[_0x2997('0x4a')]('base64'))},'json':!![]};rp(_0x203287)['then'](function(_0x2f3078){if(_0x2f3078['id']){var _0x18eaa8={'messageId':_0x2f3078['id']};return _0x5b0228['update'](_0x18eaa8);}else{logger[_0x2997('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2997('0x2e'),_0x2997('0x72'),util['inspect'](_0x2f3078,{'showHidden':![],'depth':null}));}})['catch'](function(_0x241a95){logger[_0x2997('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','bandwidth',util[_0x2997('0x2f')](_0x241a95,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2997('0x2d'),_0x2997('0x2e'),'bandwidth',_0x2997('0x3e'));}break;case _0x2997('0x77'):if(_0x324c3e['apiKey']){var _0x254751={};var _0x52e917={'method':_0x2997('0x38'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x2997('0x78')+_0x324c3e[_0x2997('0x60')],'Content-Type':_0x2997('0x5b')},'body':{'from':_0x324c3e[_0x2997('0x27')],'to':_0x489d7b[_0x2997('0x27')],'text':_0x489d7b['body']},'json':!![]};return rp(_0x52e917)['then'](function(_0x22cf94){if(_0x22cf94[_0x2997('0x79')]==0xca){_0x254751[_0x2997('0x7a')]=_0x22cf94;var _0x55bdf9={'method':_0x2997('0x38'),'uri':_0x2997('0x7b'),'headers':{'Authorization':_0x2997('0x78')+_0x324c3e[_0x2997('0x60')],'Content-Type':_0x2997('0x5b')},'body':{'refid':_0x254751[_0x2997('0x7a')]['refid']},'json':!![]};return rp(_0x55bdf9)[_0x2997('0x19')](function(_0x3ac6e4){_0x254751[_0x2997('0x7c')]=_0x3ac6e4;var _0x1619d3={'messageId':_0x254751[_0x2997('0x7a')][_0x2997('0x7d')],'read':!![]};return _0x5b0228['update'](_0x1619d3);});}else{return logger[_0x2997('0x1b')](_0x2997('0x2d'),_0x2997('0x2e'),_0x2997('0x77'),util['inspect'](_0x22cf94,{'showHidden':![],'depth':null}));}})['catch'](function(_0x22b2ff){return logger[_0x2997('0x1b')](_0x2997('0x2d'),_0x2997('0x2e'),'intelepeer',util[_0x2997('0x2f')](_0x22b2ff,{'showHidden':![],'depth':null}));});}else{return logger[_0x2997('0x1b')](_0x2997('0x2d'),_0x2997('0x2e'),_0x2997('0x77'),_0x2997('0x7e'));}break;}}})[_0x2997('0x7f')](function(){_0x1de34f();});}else{_0x1de34f();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7b7c=['utf8mb4_unicode_ci','lodash','util','moment','path','rimraf','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','UserId','isNil','SmsInteractionId','findOne','update','catch','SmsAccount','find','SmsAccountId','then','twilio','accountSid','authToken','create','phone','/api/sms/messages/','token','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','username','smsMethod','sender','&password=','password','GET','sms','user_key','session_key','total_sent','internal_order_id','read','skebby','connectel','POST','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','clicksend','xCALLY\x20Motion','senderString','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','Missing\x20parameters:\x20username,\x20password','plivo','authId','remote','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','text','timestamp','keys','length','apiKey','createHash','digest','hex','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','refid','status','intelepeer','utf8mb4'];(function(_0x362d42,_0xc6c041){var _0x2a2fdc=function(_0x12477a){while(--_0x12477a){_0x362d42['push'](_0x362d42['shift']());}};_0x2a2fdc(++_0xc6c041);}(_0x7b7c,0x1f1));var _0xc7b7=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x7b7c[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0xc7b7('0x0'));var util=require(_0xc7b7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc7b7('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7b7('0x3'));var rimraf=require(_0xc7b7('0x4'));var config=require('../../config/environment');var attributes=require(_0xc7b7('0x5'));module[_0xc7b7('0x6')]=function(_0x2db845,_0x4e8614){return _0x2db845[_0xc7b7('0x7')](_0xc7b7('0x8'),attributes,{'tableName':_0xc7b7('0x9'),'paranoid':![],'indexes':[{'name':_0xc7b7('0xa'),'fields':[_0xc7b7('0xa')]},{'name':_0xc7b7('0xb'),'fields':[_0xc7b7('0xc')],'type':_0xc7b7('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x30037f,_0x1acada,_0x229314){var _0x40aff5=_0x2db845[_0xc7b7('0xe')];var _0x335994=_0x30037f[_0xc7b7('0xf')]({'plain':!![]});if(_0x335994['direction'][_0xc7b7('0x10')]()==='in'||_0x335994[_0xc7b7('0x11')]['toLowerCase']()===_0xc7b7('0x12')&&!_0x335994[_0xc7b7('0x13')]&&!_['isNil'](_0x335994[_0xc7b7('0x14')])&&!_[_0xc7b7('0x15')](_0x335994[_0xc7b7('0x16')])){_0x40aff5['SmsInteraction'][_0xc7b7('0x17')]({'where':{'id':_0x335994[_0xc7b7('0x16')]}})['then'](function(_0x172390){if(_0x172390){_0x172390[_0xc7b7('0x18')]({'lastMsgAt':_0x335994['createdAt'],'lastMsgDirection':_0x335994[_0xc7b7('0x11')][_0xc7b7('0x10')]()});}})[_0xc7b7('0x19')](function(_0x4cad79){console['error'](_0x4cad79);});}if(_0x335994[_0xc7b7('0x11')]===_0xc7b7('0x12')&&!_0x335994[_0xc7b7('0x13')]){var _0x11ec1a;_0x40aff5[_0xc7b7('0x1a')][_0xc7b7('0x1b')]({'where':{'id':_0x335994[_0xc7b7('0x1c')]},'raw':!![]})[_0xc7b7('0x1d')](function(_0xf1d623){_0x11ec1a=_0xf1d623;if(_0x11ec1a&&_0x11ec1a['type']){switch(_0x11ec1a['type']){case _0xc7b7('0x1e'):var _0x8e365c=require('twilio');if(_0x11ec1a[_0xc7b7('0x1f')]&&_0x11ec1a[_0xc7b7('0x20')]&&_0x11ec1a['phone']){var _0x312ca3=new _0x8e365c(_0x11ec1a[_0xc7b7('0x1f')],_0x11ec1a[_0xc7b7('0x20')]);_0x312ca3['messages'][_0xc7b7('0x21')]({'body':_0x335994[_0xc7b7('0xc')],'to':_0x335994[_0xc7b7('0x22')],'from':_0x11ec1a[_0xc7b7('0x22')],'statusCallback':_0x11ec1a['remote']+_0xc7b7('0x23')+_0x335994['id']+'/status?token='+_0x11ec1a[_0xc7b7('0x24')]})[_0xc7b7('0x1d')](function(_0x2c0644){if(_0x2c0644['sid']){return _0x30037f[_0xc7b7('0x18')]({'messageId':_0x2c0644['sid']});}})[_0xc7b7('0x19')](function(_0x3ebfd4){logger['error'](_0xc7b7('0x25'),_0xc7b7('0x26'),_0xc7b7('0x1e'),util[_0xc7b7('0x27')](_0x3ebfd4,{'showHidden':![],'depth':null}));});}else{logger[_0xc7b7('0x28')](_0xc7b7('0x25'),_0xc7b7('0x26'),_0xc7b7('0x1e'),_0xc7b7('0x29'));}break;case'skebby':var _0x1ae8f5='https://api.skebby.it/API/v1.0/REST/';if(_0x11ec1a[_0xc7b7('0x2a')]&&_0x11ec1a['password']){var _0x29c18c={'recipient':[_0x335994[_0xc7b7('0x22')]],'message':_0x335994['body'],'message_type':_0x11ec1a[_0xc7b7('0x2b')]};if(_0x11ec1a[_0xc7b7('0x2b')]&&_0x11ec1a[_0xc7b7('0x2b')]!=='SI'){_0x29c18c[_0xc7b7('0x2c')]=_0x11ec1a[_0xc7b7('0x22')];}var _0x5a3cac={'url':_0x1ae8f5+'login?username='+_0x11ec1a['username']+_0xc7b7('0x2d')+_0x11ec1a[_0xc7b7('0x2e')],'method':_0xc7b7('0x2f')};rp(_0x5a3cac)[_0xc7b7('0x1d')](function(_0x47abea){var _0x10f927=_0x47abea['split'](';');var _0x18646d={'user_key':_0x10f927[0x0],'session_key':_0x10f927[0x1]};_0x5a3cac={'url':_0x1ae8f5+_0xc7b7('0x30'),'method':'POST','headers':{'user_key':_0x18646d[_0xc7b7('0x31')],'Session_key':_0x18646d[_0xc7b7('0x32')]},'json':!![],'body':_0x29c18c};return rp(_0x5a3cac);})[_0xc7b7('0x1d')](function(_0x15e8c7){if(_0x15e8c7[_0xc7b7('0x33')]>=0x1){var _0xfa2900={'messageId':_0x15e8c7[_0xc7b7('0x34')]};if(_0x11ec1a[_0xc7b7('0x2b')]!=='GP'||!_0x11ec1a['deliveryReport']){_0xfa2900[_0xc7b7('0x35')]=!![];}return _0x30037f['update'](_0xfa2900);}else{return logger[_0xc7b7('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc7b7('0x26'),_0xc7b7('0x36'),util[_0xc7b7('0x27')](_0x15e8c7,{'showHidden':![],'depth':null}));}})[_0xc7b7('0x19')](function(_0x321950){return logger[_0xc7b7('0x28')](_0xc7b7('0x25'),_0xc7b7('0x26'),_0xc7b7('0x36'),util[_0xc7b7('0x27')](_0x321950,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc7b7('0x36'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xc7b7('0x37'):if(_0x11ec1a['authToken']){var _0x43c416={'recipient':_0x335994[_0xc7b7('0x22')],'message':_0x335994['body'],'sender':_0x11ec1a['senderString']||_0x11ec1a[_0xc7b7('0x22')],'authorization':_0x11ec1a[_0xc7b7('0x20')]};var _0x1acada={'method':_0xc7b7('0x38'),'uri':_0xc7b7('0x39'),'body':_0x43c416,'json':!![]};rp(_0x1acada)[_0xc7b7('0x1d')](function(_0xd3e5a9){var _0xd8b069={'messageId':_0xd3e5a9[_0xc7b7('0x3a')]};if(!_0x11ec1a[_0xc7b7('0x3b')]){_0xd8b069[_0xc7b7('0x35')]=!![];}return _0x30037f['update'](_0xd8b069);})['catch'](function(_0x33f248){logger[_0xc7b7('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc7b7('0x26'),_0xc7b7('0x37'),util['inspect'](_0x33f248,{'showHidden':![],'depth':null}));});}else{logger[_0xc7b7('0x28')](_0xc7b7('0x25'),_0xc7b7('0x26'),_0xc7b7('0x37'),'Missing\x20parameters:\x20authToken');}break;case _0xc7b7('0x3c'):if(_0x11ec1a[_0xc7b7('0x2a')]&&_0x11ec1a[_0xc7b7('0x2e')]){var _0x43c416={'messages':[{'source':_0xc7b7('0x3d'),'to':_0x335994[_0xc7b7('0x22')],'body':_0x335994['body'],'from':_0x11ec1a[_0xc7b7('0x3e')]||_0x11ec1a[_0xc7b7('0x22')]}]};var _0x1715a3=util[_0xc7b7('0x3f')](_0xc7b7('0x40'),_0x11ec1a['username'],_0x11ec1a[_0xc7b7('0x2e')]);var _0x1acada={'method':_0xc7b7('0x38'),'uri':_0xc7b7('0x41'),'body':_0x43c416,'headers':{'Authorization':util[_0xc7b7('0x3f')](_0xc7b7('0x42'),new Buffer(_0x1715a3)[_0xc7b7('0x43')](_0xc7b7('0x44')))},'json':!![]};rp(_0x1acada)[_0xc7b7('0x1d')](function(_0x4a4caf){if(_0x4a4caf[_0xc7b7('0x45')]>=0xc8&&_0x4a4caf['http_code']<=0xce){if(_0x4a4caf[_0xc7b7('0x46')]&&_0x4a4caf[_0xc7b7('0x46')][_0xc7b7('0x47')]>0x0){var _0x27e105=_[_0xc7b7('0x48')](_0x4a4caf[_0xc7b7('0x46')][_0xc7b7('0x49')]);var _0xffdb6a={'messageId':_0x27e105[_0xc7b7('0x4a')]};if(!_0x11ec1a[_0xc7b7('0x3b')]){_0xffdb6a[_0xc7b7('0x35')]=!![];}return _0x30037f[_0xc7b7('0x18')](_0xffdb6a);}else{logger[_0xc7b7('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc7b7('0x26'),'clickSend',util[_0xc7b7('0x27')](_0x4a4caf,{'showHidden':![],'depth':null}));}}else{logger[_0xc7b7('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc7b7('0x26'),'clickSend',util[_0xc7b7('0x27')](_0x4a4caf,{'showHidden':![],'depth':null}));}})[_0xc7b7('0x19')](function(_0x7be6a6){logger[_0xc7b7('0x28')](_0xc7b7('0x25'),_0xc7b7('0x26'),_0xc7b7('0x4b'),util['inspect'](_0x7be6a6,{'showHidden':![],'depth':null}));});}else{logger[_0xc7b7('0x28')](_0xc7b7('0x25'),_0xc7b7('0x26'),_0xc7b7('0x4b'),_0xc7b7('0x4c'));}break;case _0xc7b7('0x4d'):if(_0x11ec1a[_0xc7b7('0x4e')]&&_0x11ec1a[_0xc7b7('0x20')]){var _0x43c416={'dst':_0x335994[_0xc7b7('0x22')],'text':_0x335994['body'],'src':_0x11ec1a[_0xc7b7('0x3e')]||_0x11ec1a['phone'],'url':_0x11ec1a[_0xc7b7('0x4f')]+'/api/sms/messages/'+_0x335994['id']+_0xc7b7('0x50')+_0x11ec1a[_0xc7b7('0x24')]};var _0x1715a3=util[_0xc7b7('0x3f')]('%s:%s',_0x11ec1a[_0xc7b7('0x4e')],_0x11ec1a[_0xc7b7('0x20')]);var _0x1acada={'method':_0xc7b7('0x38'),'uri':util[_0xc7b7('0x3f')](_0xc7b7('0x51'),_0x11ec1a[_0xc7b7('0x4e')]),'body':_0x43c416,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x1715a3)[_0xc7b7('0x43')]('base64'))},'json':!![]};rp(_0x1acada)[_0xc7b7('0x1d')](function(_0x460f9c){var _0x44f8fe={'messageId':_0x460f9c[_0xc7b7('0x52')][0x0]};return _0x30037f[_0xc7b7('0x18')](_0x44f8fe);})[_0xc7b7('0x19')](function(_0x179d0a){logger[_0xc7b7('0x28')](_0xc7b7('0x25'),_0xc7b7('0x26'),_0xc7b7('0x4d'),util[_0xc7b7('0x27')](_0x179d0a,{'showHidden':![],'depth':null}));});}else{logger[_0xc7b7('0x28')](_0xc7b7('0x25'),_0xc7b7('0x26'),_0xc7b7('0x4d'),_0xc7b7('0x53'));}break;case _0xc7b7('0x54'):if(_0x11ec1a[_0xc7b7('0x2a')]&&_0x11ec1a[_0xc7b7('0x2e')]){if(_0x11ec1a[_0xc7b7('0x55')]){var _0x4027cd={'method':_0xc7b7('0x38'),'uri':_0x11ec1a[_0xc7b7('0x55')]+_0xc7b7('0x56'),'body':{'username':_0x11ec1a[_0xc7b7('0x2a')],'password':_0x11ec1a['password']},'json':!![]};return rp(_0x4027cd)[_0xc7b7('0x1d')](function(_0x4fc877){var _0x10c897={'method':_0xc7b7('0x38'),'uri':_0x11ec1a[_0xc7b7('0x55')]+_0xc7b7('0x57'),'body':{'messages':[{'from':_0x11ec1a[_0xc7b7('0x22')],'destinations':[{'to':_0x335994[_0xc7b7('0x22')]}],'text':_0x335994[_0xc7b7('0xc')],'notifyUrl':_0x11ec1a[_0xc7b7('0x4f')]+_0xc7b7('0x23')+_0x335994['id']+'/status?token='+_0x11ec1a[_0xc7b7('0x24')],'notifyContentType':'application/json','callbackData':_0x11ec1a[_0xc7b7('0x22')]+';'+_0x335994[_0xc7b7('0xc')]}]},'headers':{'Authorization':_0xc7b7('0x58')+_0x4fc877[_0xc7b7('0x24')]},'json':!![]};return rp(_0x10c897)['then'](function(_0x4c9021){if(_0x4c9021['messages']){var _0x3c9766={'messageId':_0x4c9021['messages'][0x0][_0xc7b7('0xa')]};if(!_0x11ec1a[_0xc7b7('0x3b')]){_0x3c9766[_0xc7b7('0x35')]=!![];}return _0x30037f[_0xc7b7('0x18')](_0x3c9766);}else{return logger[_0xc7b7('0x28')](_0xc7b7('0x25'),_0xc7b7('0x26'),_0xc7b7('0x54'),util[_0xc7b7('0x27')](_0x4c9021,{'showHidden':![],'depth':null}));}});})[_0xc7b7('0x19')](function(_0x5a7b86){return logger['error'](_0xc7b7('0x25'),'afterCreate','infobip',util[_0xc7b7('0x27')](_0x5a7b86,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc7b7('0x25'),_0xc7b7('0x26'),_0xc7b7('0x54'),_0xc7b7('0x59'));}}else{logger[_0xc7b7('0x28')](_0xc7b7('0x25'),'afterCreate','infobip',_0xc7b7('0x4c'));}break;case _0xc7b7('0x5a'):var _0x2bbe3d=require(_0xc7b7('0x5b'));if(_0x11ec1a['apiKey']){var _0x53d2a1={};_0x53d2a1[_0xc7b7('0x5c')]=_0x11ec1a[_0xc7b7('0x2a')];_0x53d2a1[_0xc7b7('0x22')]=_0x335994[_0xc7b7('0x22')];_0x53d2a1[_0xc7b7('0x2c')]=_0x11ec1a['phone'];_0x53d2a1[_0xc7b7('0x5d')]=_0x335994['body'];_0x53d2a1[_0xc7b7('0x5e')]=+new Date();var _0x1a2e58='';var _0x3e8042='';var _0x308e12=Object[_0xc7b7('0x5f')](_0x53d2a1);_0x308e12['sort']();for(var _0x2f489c=0x0;_0x2f489c<_0x308e12[_0xc7b7('0x60')];_0x2f489c++){if(_0x1a2e58!=''){_0x1a2e58+='&';}_0x1a2e58+=_0x308e12[_0x2f489c]+'='+encodeURIComponent(_0x53d2a1[_0x308e12[_0x2f489c]]);_0x3e8042+=_0x53d2a1[_0x308e12[_0x2f489c]];}_0x3e8042+=_0x11ec1a[_0xc7b7('0x61')];_0x3e8042=_0x2bbe3d[_0xc7b7('0x62')]('md5')['update'](_0x3e8042)[_0xc7b7('0x63')](_0xc7b7('0x64'));if(_0x1a2e58!==''){_0x1a2e58+='&';}_0x1a2e58+='signature='+_0x3e8042;var _0x5a3cac={'method':_0xc7b7('0x2f'),'uri':_0x11ec1a[_0xc7b7('0x55')]+_0xc7b7('0x65')+_0x1a2e58,'json':!![]};return rp(_0x5a3cac)[_0xc7b7('0x1d')](function(_0x2b3160){var _0x3506bf=Object['keys'](_0x2b3160);if(_0x2b3160[_0x3506bf[0x0]][_0xc7b7('0x28')]&&parseInt(_0x2b3160[_0x3506bf[0x0]]['error'])===0x0){var _0x352ab4={'messageId':_0x2b3160[_0x3506bf[0x0]][_0xc7b7('0x66')]};if(!_0x11ec1a[_0xc7b7('0x3b')]){_0x352ab4[_0xc7b7('0x35')]=!![];}return _0x30037f['update'](_0x352ab4);}else{return logger[_0xc7b7('0x28')](_0xc7b7('0x25'),_0xc7b7('0x26'),_0xc7b7('0x5a'),util['inspect'](_0x2b3160[_0xc7b7('0x28')],{'showHidden':![],'depth':null}));}})[_0xc7b7('0x19')](function(_0x14bed7){return logger[_0xc7b7('0x28')](_0xc7b7('0x25'),'afterCreate','csc',util['inspect'](_0x14bed7,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc7b7('0x25'),'afterCreate','csc',_0xc7b7('0x67'));}break;case _0xc7b7('0x68'):if(_0x11ec1a[_0xc7b7('0x61')]){var _0x119176={'method':_0xc7b7('0x38'),'uri':_0xc7b7('0x69'),'headers':{'Authorization':_0x11ec1a[_0xc7b7('0x61')]},'body':{'content':_0x335994[_0xc7b7('0xc')],'to':[_0x335994[_0xc7b7('0x22')]],'from':_0x11ec1a[_0xc7b7('0x22')],'binary':![],'clientMessageId':_0xc7b7('0x6a'),'charset':_0xc7b7('0x6b')},'json':!![]};rp(_0x119176)[_0xc7b7('0x1d')](function(_0x1808b6){if(!_0x1808b6[_0xc7b7('0x28')]){var _0x56b053={'messageId':_0x1808b6['messages'][0x0][_0xc7b7('0x6c')]};if(!_0x11ec1a[_0xc7b7('0x3b')]){_0x56b053[_0xc7b7('0x35')]=!![];}return _0x30037f[_0xc7b7('0x18')](_0x56b053);}else{return logger[_0xc7b7('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc7b7('0x26'),'clickatell',util[_0xc7b7('0x27')](_0x1808b6['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x1ce5a6){return logger[_0xc7b7('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc7b7('0x68'),util[_0xc7b7('0x27')](_0x1ce5a6,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc7b7('0x25'),_0xc7b7('0x26'),_0xc7b7('0x68'),_0xc7b7('0x67'));}break;case'bandwidth':if(_0x11ec1a[_0xc7b7('0x2a')]&&_0x11ec1a['password']){var _0x1715a3=util[_0xc7b7('0x3f')](_0xc7b7('0x40'),_0x11ec1a['username'],_0x11ec1a[_0xc7b7('0x2e')]);var _0x1acada={'method':_0xc7b7('0x38'),'uri':_0xc7b7('0x6d')+_0x11ec1a[_0xc7b7('0x6e')]+_0xc7b7('0x6f'),'body':{'to':[_0x335994[_0xc7b7('0x22')]],'text':_0x335994[_0xc7b7('0xc')],'from':_0x11ec1a[_0xc7b7('0x22')],'applicationId':_0x11ec1a[_0xc7b7('0x70')]},'headers':{'Authorization':util['format'](_0xc7b7('0x42'),new Buffer(_0x1715a3)[_0xc7b7('0x43')](_0xc7b7('0x44')))},'json':!![]};rp(_0x1acada)[_0xc7b7('0x1d')](function(_0x403ca2){if(_0x403ca2['id']){var _0x489311={'messageId':_0x403ca2['id']};return _0x30037f[_0xc7b7('0x18')](_0x489311);}else{logger[_0xc7b7('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc7b7('0x26'),_0xc7b7('0x71'),util[_0xc7b7('0x27')](_0x403ca2,{'showHidden':![],'depth':null}));}})[_0xc7b7('0x19')](function(_0x10ec10){logger['error'](_0xc7b7('0x25'),_0xc7b7('0x26'),_0xc7b7('0x71'),util[_0xc7b7('0x27')](_0x10ec10,{'showHidden':![],'depth':null}));});}else{logger[_0xc7b7('0x28')](_0xc7b7('0x25'),_0xc7b7('0x26'),_0xc7b7('0x71'),_0xc7b7('0x4c'));}break;case'intelepeer':if(_0x11ec1a[_0xc7b7('0x61')]){var _0x2cf47e={};var _0x5a3cac={'method':'POST','uri':_0xc7b7('0x72'),'headers':{'Authorization':_0xc7b7('0x73')+_0x11ec1a[_0xc7b7('0x61')],'Content-Type':_0xc7b7('0x74')},'body':{'from':_0x11ec1a[_0xc7b7('0x22')],'to':_0x335994[_0xc7b7('0x22')],'text':_0x335994['body']},'json':!![]};return rp(_0x5a3cac)['then'](function(_0x3f5d1e){if(_0x3f5d1e[_0xc7b7('0x75')]==0xca){_0x2cf47e[_0xc7b7('0x76')]=_0x3f5d1e;var _0xbbf8f7={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xc7b7('0x73')+_0x11ec1a[_0xc7b7('0x61')],'Content-Type':_0xc7b7('0x74')},'body':{'refid':_0x2cf47e[_0xc7b7('0x76')][_0xc7b7('0x77')]},'json':!![]};return rp(_0xbbf8f7)[_0xc7b7('0x1d')](function(_0x1d9ac3){_0x2cf47e[_0xc7b7('0x78')]=_0x1d9ac3;var _0x4af69c={'messageId':_0x2cf47e[_0xc7b7('0x76')][_0xc7b7('0x77')],'read':!![]};return _0x30037f[_0xc7b7('0x18')](_0x4af69c);});}else{return logger[_0xc7b7('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc7b7('0x26'),'intelepeer',util['inspect'](_0x3f5d1e,{'showHidden':![],'depth':null}));}})[_0xc7b7('0x19')](function(_0x5a44ab){return logger[_0xc7b7('0x28')](_0xc7b7('0x25'),'afterCreate',_0xc7b7('0x79'),util[_0xc7b7('0x27')](_0x5a44ab,{'showHidden':![],'depth':null}));});}else{return logger[_0xc7b7('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc7b7('0x26'),_0xc7b7('0x79'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0x229314();});}else{_0x229314();}}},'charset':_0xc7b7('0x7a'),'collate':_0xc7b7('0x7b')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index b3ff9cb..53317db 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 _0xe06a=['SmsMessage','create','body','options','raw','stringify','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./smsMessage.socket','request','then','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','CreateSmsMessage'];(function(_0x5a6b07,_0x1a1f7e){var _0x2f0996=function(_0x4fb9e8){while(--_0x4fb9e8){_0x5a6b07['push'](_0x5a6b07['shift']());}};_0x2f0996(++_0x1a1f7e);}(_0xe06a,0xa6));var _0xae06=function(_0x1d4eb6,_0x3b73d7){_0x1d4eb6=_0x1d4eb6-0x0;var _0x276ad5=_0xe06a[_0x1d4eb6];return _0x276ad5;};'use strict';var _=require(_0xae06('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xae06('0x1'));var rs=require(_0xae06('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae06('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xae06('0x4'))(_0xae06('0x5'));var config=require(_0xae06('0x6'));var jayson=require(_0xae06('0x7'));var client=jayson[_0xae06('0x8')][_0xae06('0x9')]({'port':0x232a});config['redis']=_[_0xae06('0xa')](config[_0xae06('0xb')],{'host':_0xae06('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xae06('0xd'))['register'](socket);function respondWithRpcPromise(_0x4d12bb,_0x1f46be,_0x4bc6f2){return new BPromise(function(_0x3a4d0e,_0x44193b){return client[_0xae06('0xe')](_0x4d12bb,_0x4bc6f2)[_0xae06('0xf')](function(_0x856763){logger['info'](_0xae06('0x10'),_0x1f46be,'request\x20sent');logger[_0xae06('0x11')](_0xae06('0x12'),_0x1f46be,_0xae06('0x13'),JSON['stringify'](_0x856763));if(_0x856763[_0xae06('0x14')]){if(_0x856763[_0xae06('0x14')][_0xae06('0x15')]===0x1f4){logger[_0xae06('0x14')](_0xae06('0x10'),_0x1f46be,_0x856763['error'][_0xae06('0x16')]);return _0x44193b(_0x856763[_0xae06('0x14')][_0xae06('0x16')]);}logger[_0xae06('0x14')](_0xae06('0x10'),_0x1f46be,_0x856763[_0xae06('0x14')][_0xae06('0x16')]);return _0x3a4d0e(_0x856763[_0xae06('0x14')][_0xae06('0x16')]);}else{logger[_0xae06('0x17')](_0xae06('0x10'),_0x1f46be,_0xae06('0x13'));_0x3a4d0e(_0x856763['result'][_0xae06('0x16')]);}})[_0xae06('0x18')](function(_0x549b54){logger[_0xae06('0x14')]('SmsMessage,\x20%s,\x20%s',_0x1f46be,_0x549b54);_0x44193b(_0x549b54);});});}exports[_0xae06('0x19')]=function(_0x10551c){var _0x6f0137=this;return new Promise(function(_0x376c3e,_0x435da1){return db[_0xae06('0x1a')][_0xae06('0x1b')](_0x10551c[_0xae06('0x1c')],{'raw':_0x10551c[_0xae06('0x1d')]?_0x10551c[_0xae06('0x1d')][_0xae06('0x1e')]===undefined?!![]:![]:!![]})[_0xae06('0xf')](function(_0x26cec1){logger[_0xae06('0x17')](_0xae06('0x19'),_0x10551c);logger['debug'](_0xae06('0x19'),_0x10551c,JSON[_0xae06('0x1f')](_0x26cec1));_0x376c3e(_0x26cec1);})['catch'](function(_0x4b9f7b){logger[_0xae06('0x14')](_0xae06('0x19'),_0x4b9f7b[_0xae06('0x16')],_0x10551c);_0x435da1(_0x6f0137[_0xae06('0x14')](0x1f4,_0x4b9f7b[_0xae06('0x16')]));});});}; \ No newline at end of file +var _0x261a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','debug','stringify','error','SmsMessage,\x20%s,\x20%s','message','result','CreateSmsMessage','create','options','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x2aa47b,_0x2d19f0){var _0x4b05d5=function(_0xe6e71){while(--_0xe6e71){_0x2aa47b['push'](_0x2aa47b['shift']());}};_0x4b05d5(++_0x2d19f0);}(_0x261a,0x131));var _0xa261=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x261a[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xa261('0x0'));var util=require(_0xa261('0x1'));var moment=require('moment');var BPromise=require(_0xa261('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa261('0x3'));var db=require(_0xa261('0x4'))['db'];var utils=require(_0xa261('0x5'));var logger=require(_0xa261('0x6'))(_0xa261('0x7'));var config=require(_0xa261('0x8'));var jayson=require(_0xa261('0x9'));var client=jayson[_0xa261('0xa')][_0xa261('0xb')]({'port':0x232a});config[_0xa261('0xc')]=_[_0xa261('0xd')](config['redis'],{'host':_0xa261('0xe'),'port':0x18eb});var socket=require(_0xa261('0xf'))(new Redis(config[_0xa261('0xc')]));require(_0xa261('0x10'))[_0xa261('0x11')](socket);function respondWithRpcPromise(_0x3b01d6,_0x58288b,_0x435960){return new BPromise(function(_0x5b7bd7,_0x23170b){return client[_0xa261('0x12')](_0x3b01d6,_0x435960)[_0xa261('0x13')](function(_0x242758){logger[_0xa261('0x14')]('SmsMessage,\x20%s,\x20%s',_0x58288b,_0xa261('0x15'));logger[_0xa261('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x58288b,_0xa261('0x15'),JSON[_0xa261('0x17')](_0x242758));if(_0x242758['error']){if(_0x242758[_0xa261('0x18')]['code']===0x1f4){logger['error'](_0xa261('0x19'),_0x58288b,_0x242758[_0xa261('0x18')]['message']);return _0x23170b(_0x242758[_0xa261('0x18')][_0xa261('0x1a')]);}logger['error'](_0xa261('0x19'),_0x58288b,_0x242758[_0xa261('0x18')]['message']);return _0x5b7bd7(_0x242758[_0xa261('0x18')]['message']);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x58288b,_0xa261('0x15'));_0x5b7bd7(_0x242758[_0xa261('0x1b')][_0xa261('0x1a')]);}})['catch'](function(_0x35bdc4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x58288b,_0x35bdc4);_0x23170b(_0x35bdc4);});});}exports[_0xa261('0x1c')]=function(_0x355053){var _0x1fd651=this;return new Promise(function(_0x54d3f4,_0x5a6efe){return db['SmsMessage'][_0xa261('0x1d')](_0x355053['body'],{'raw':_0x355053[_0xa261('0x1e')]?_0x355053[_0xa261('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xa261('0x13')](function(_0x52e403){logger[_0xa261('0x14')](_0xa261('0x1c'),_0x355053);logger[_0xa261('0x16')](_0xa261('0x1c'),_0x355053,JSON['stringify'](_0x52e403));_0x54d3f4(_0x52e403);})['catch'](function(_0x185025){logger[_0xa261('0x18')](_0xa261('0x1c'),_0x185025[_0xa261('0x1a')],_0x355053);_0x5a6efe(_0x1fd651[_0xa261('0x18')](0x1f4,_0x185025[_0xa261('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 8a4e19a..15c0189 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 _0x8105=['save','remove','update','register'];(function(_0x1d75dc,_0x333bdd){var _0x8375ad=function(_0x571550){while(--_0x571550){_0x1d75dc['push'](_0x1d75dc['shift']());}};_0x8375ad(++_0x333bdd);}(_0x8105,0x120));var _0x5810=function(_0x2ac513,_0x413cdd){_0x2ac513=_0x2ac513-0x0;var _0x3253b0=_0x8105[_0x2ac513];return _0x3253b0;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x5810('0x0'),_0x5810('0x1'),_0x5810('0x2')];function createListener(_0x5c841d,_0x56d0a8){return function(_0x192c91){_0x56d0a8['emit'](_0x5c841d,_0x192c91);};}function removeListener(_0x5a1779,_0x7f12cc){return function(){SmsMessageEvents['removeListener'](_0x5a1779,_0x7f12cc);};}exports[_0x5810('0x3')]=function(_0x28d4e6){for(var _0x144cdc=0x0,_0xf78c1c=events['length'];_0x144cdc<_0xf78c1c;_0x144cdc++){var _0x4bb013=events[_0x144cdc];var _0x16eb70=createListener('smsMessage:'+_0x4bb013,_0x28d4e6);SmsMessageEvents['on'](_0x4bb013,_0x16eb70);}}; \ No newline at end of file +var _0x7fd5=['save','remove','update','emit','removeListener','length','smsMessage:','./smsMessage.events'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0x7fd5,0x1cf));var _0x57fd=function(_0x1085db,_0x41e087){_0x1085db=_0x1085db-0x0;var _0x392a60=_0x7fd5[_0x1085db];return _0x392a60;};'use strict';var SmsMessageEvents=require(_0x57fd('0x0'));var events=[_0x57fd('0x1'),_0x57fd('0x2'),_0x57fd('0x3')];function createListener(_0x52a2c3,_0x29da1d){return function(_0x277e33){_0x29da1d[_0x57fd('0x4')](_0x52a2c3,_0x277e33);};}function removeListener(_0x558ea3,_0x1d045f){return function(){SmsMessageEvents[_0x57fd('0x5')](_0x558ea3,_0x1d045f);};}exports['register']=function(_0xe18b9b){for(var _0x40e206=0x0,_0x35efc8=events[_0x57fd('0x6')];_0x40e206<_0x35efc8;_0x40e206++){var _0xefd498=events[_0x40e206];var _0x302799=createListener(_0x57fd('0x7')+_0xefd498,_0xe18b9b);SmsMessageEvents['on'](_0xefd498,_0x302799);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 7b47069..6e5ff13 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 _0x1b16=['post','addAgents','put','update','delete','/:id/teams','removeTeams','removeAgents','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','./smsQueue.controller','get','isAuthenticated','/describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','create','addTeams'];(function(_0x42e883,_0xa51188){var _0x1ed5c6=function(_0x1e9c09){while(--_0x1e9c09){_0x42e883['push'](_0x42e883['shift']());}};_0x1ed5c6(++_0xa51188);}(_0x1b16,0x18f));var _0x61b1=function(_0x48185e,_0x52925a){_0x48185e=_0x48185e-0x0;var _0x4f02f7=_0x1b16[_0x48185e];return _0x4f02f7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x61b1('0x0'));var timeout=require(_0x61b1('0x1'));var express=require('express');var router=express[_0x61b1('0x2')]();var fs_extra=require(_0x61b1('0x3'));var auth=require(_0x61b1('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x61b1('0x5'));router[_0x61b1('0x6')]('/',auth[_0x61b1('0x7')](),controller['index']);router[_0x61b1('0x6')](_0x61b1('0x8'),auth[_0x61b1('0x7')](),controller['describe']);router[_0x61b1('0x6')](_0x61b1('0x9'),auth['isAuthenticated'](),controller[_0x61b1('0xa')]);router[_0x61b1('0x6')](_0x61b1('0xb'),auth[_0x61b1('0x7')](),controller[_0x61b1('0xc')]);router[_0x61b1('0x6')]('/:id/teams',auth[_0x61b1('0x7')](),controller['getTeams']);router[_0x61b1('0x6')](_0x61b1('0xd'),auth[_0x61b1('0x7')](),controller[_0x61b1('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x61b1('0xf')]);router['post']('/:id/teams',auth[_0x61b1('0x7')](),controller[_0x61b1('0x10')]);router[_0x61b1('0x11')](_0x61b1('0xd'),auth[_0x61b1('0x7')](),controller[_0x61b1('0x12')]);router[_0x61b1('0x13')](_0x61b1('0x9'),auth[_0x61b1('0x7')](),controller[_0x61b1('0x14')]);router['delete'](_0x61b1('0x9'),auth['isAuthenticated'](),controller['destroy']);router[_0x61b1('0x15')](_0x61b1('0x16'),auth[_0x61b1('0x7')](),controller[_0x61b1('0x17')]);router['delete'](_0x61b1('0xd'),auth[_0x61b1('0x7')](),controller[_0x61b1('0x18')]);module[_0x61b1('0x19')]=router; \ No newline at end of file +var _0xfdf2=['put','/:id','destroy','delete','removeTeams','exports','multer','util','path','fs-extra','../../config/environment','./smsQueue.controller','isAuthenticated','index','/describe','describe','show','/:id/members','get','/:id/users','getAgents','post','create','/:id/teams','addTeams'];(function(_0x39f797,_0x2e96c5){var _0x5c3a5d=function(_0x4c6230){while(--_0x4c6230){_0x39f797['push'](_0x39f797['shift']());}};_0x5c3a5d(++_0x2e96c5);}(_0xfdf2,0xce));var _0x2fdf=function(_0x54e3d3,_0x50b01e){_0x54e3d3=_0x54e3d3-0x0;var _0x5c3bc0=_0xfdf2[_0x54e3d3];return _0x5c3bc0;};'use strict';var multer=require(_0x2fdf('0x0'));var util=require(_0x2fdf('0x1'));var path=require(_0x2fdf('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x2fdf('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2fdf('0x4'));var controller=require(_0x2fdf('0x5'));router['get']('/',auth[_0x2fdf('0x6')](),controller[_0x2fdf('0x7')]);router['get'](_0x2fdf('0x8'),auth[_0x2fdf('0x6')](),controller[_0x2fdf('0x9')]);router['get']('/:id',auth[_0x2fdf('0x6')](),controller[_0x2fdf('0xa')]);router['get'](_0x2fdf('0xb'),auth[_0x2fdf('0x6')](),controller['getMembers']);router[_0x2fdf('0xc')]('/:id/teams',auth[_0x2fdf('0x6')](),controller['getTeams']);router[_0x2fdf('0xc')](_0x2fdf('0xd'),auth['isAuthenticated'](),controller[_0x2fdf('0xe')]);router[_0x2fdf('0xf')]('/',auth[_0x2fdf('0x6')](),controller[_0x2fdf('0x10')]);router[_0x2fdf('0xf')](_0x2fdf('0x11'),auth[_0x2fdf('0x6')](),controller[_0x2fdf('0x12')]);router[_0x2fdf('0xf')](_0x2fdf('0xd'),auth['isAuthenticated'](),controller['addAgents']);router[_0x2fdf('0x13')](_0x2fdf('0x14'),auth[_0x2fdf('0x6')](),controller['update']);router['delete'](_0x2fdf('0x14'),auth['isAuthenticated'](),controller[_0x2fdf('0x15')]);router[_0x2fdf('0x16')]('/:id/teams',auth[_0x2fdf('0x6')](),controller[_0x2fdf('0x17')]);router[_0x2fdf('0x16')]('/:id/users',auth[_0x2fdf('0x6')](),controller['removeAgents']);module[_0x2fdf('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 06c46e3..8867775 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 _0x2a16=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x2d3c60,_0x4df458){var _0x560041=function(_0x5568af){while(--_0x5568af){_0x2d3c60['push'](_0x2d3c60['shift']());}};_0x560041(++_0x4df458);}(_0x2a16,0x198));var _0x62a1=function(_0x27fa18,_0x5df00a){_0x27fa18=_0x27fa18-0x0;var _0x2389fa=_0x2a16[_0x27fa18];return _0x2389fa;};'use strict';var Sequelize=require(_0x62a1('0x0'));module[_0x62a1('0x1')]={'name':{'type':Sequelize[_0x62a1('0x2')],'unique':_0x62a1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x62a1('0x2')]},'timeout':{'type':Sequelize[_0x62a1('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x62a1('0x5')](_0x62a1('0x6'),'beepall',_0x62a1('0x7'))}}; \ No newline at end of file +var _0xd573=['INTEGER','ENUM','roundrobin','sequelize','STRING','name'];(function(_0x12c034,_0x2559e2){var _0x1f3434=function(_0x1c286c){while(--_0x1c286c){_0x12c034['push'](_0x12c034['shift']());}};_0x1f3434(++_0x2559e2);}(_0xd573,0x105));var _0x3d57=function(_0x205fa3,_0x147053){_0x205fa3=_0x205fa3-0x0;var _0x2c19fa=_0xd573[_0x205fa3];return _0x2c19fa;};'use strict';var Sequelize=require(_0x3d57('0x0'));module['exports']={'name':{'type':Sequelize[_0x3d57('0x1')],'unique':_0x3d57('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3d57('0x1')]},'timeout':{'type':Sequelize[_0x3d57('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3d57('0x4')]('rrmemory','beepall',_0x3d57('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index dbdaa07..484dcee 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 _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(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0xadb5,0xad));var _0x5adb=function(_0x421335,_0x20ad81){_0x421335=_0x421335-0x0;var _0x5557c3=_0xadb5[_0x421335];return _0x5557c3;};'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 +var _0x5f66=['show','params','model','keys','intersection','attributes','fields','includeAll','merge','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','rawAttributes','filters','hasOwnProperty','order','sort','pick','map','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','length','filter','nolimit','ids','Team','Agents','interface','flatMap','sequelize','transaction','addTeams','forEach','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','isArray','findOne','getAgents','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','./smsQueue.socket','register','end','json','offset','limit','undefined','count','status','update','then','UserProfileResource','destroy','sendStatus','stack','name','send','index','fieldName','key','getOptions','where','SmsQueue','include','query','findAll','catch'];(function(_0x5a9e32,_0x3197fd){var _0x521b3f=function(_0x55f4f9){while(--_0x55f4f9){_0x5a9e32['push'](_0x5a9e32['shift']());}};_0x521b3f(++_0x3197fd);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var BPromise=require('bluebird');var util=require(_0x65f6('0x0'));var _=require('lodash');var squel=require(_0x65f6('0x1'));var Redis=require(_0x65f6('0x2'));var qs=require(_0x65f6('0x3'));var logger=require(_0x65f6('0x4'))(_0x65f6('0x5'));var config=require('../../config/environment');var db=require(_0x65f6('0x6'))['db'];config['redis']=_[_0x65f6('0x7')](config[_0x65f6('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x65f6('0x8')]));require(_0x65f6('0x9'))[_0x65f6('0xa')](socket);function respondWithStatusCode(_0x8f6451,_0xc44c70){_0xc44c70=_0xc44c70||0xcc;return function(_0x14f4c7){if(_0x14f4c7){return _0x8f6451['sendStatus'](_0xc44c70);}return _0x8f6451['status'](_0xc44c70)[_0x65f6('0xb')]();};}function respondWithResult(_0x2f6d5b,_0x264647){_0x264647=_0x264647||0xc8;return function(_0x25c416){if(_0x25c416){return _0x2f6d5b['status'](_0x264647)[_0x65f6('0xc')](_0x25c416);}};}function respondWithFilteredResult(_0x571436,_0x497cf3){return function(_0x2d2dfa){if(_0x2d2dfa){var _0x576875=typeof _0x497cf3[_0x65f6('0xd')]==='undefined'&&typeof _0x497cf3[_0x65f6('0xe')]===_0x65f6('0xf');var _0x2c4ee5=_0x2d2dfa[_0x65f6('0x10')];var _0x369f96=_0x576875?0x0:_0x497cf3[_0x65f6('0xd')];var _0x44144b=_0x576875?_0x2d2dfa[_0x65f6('0x10')]:_0x497cf3[_0x65f6('0xd')]+_0x497cf3[_0x65f6('0xe')];var _0x59154e;if(_0x44144b>=_0x2c4ee5){_0x44144b=_0x2c4ee5;_0x59154e=0xc8;}else{_0x59154e=0xce;}_0x571436[_0x65f6('0x11')](_0x59154e);return _0x571436['set']('Content-Range',_0x369f96+'-'+_0x44144b+'/'+_0x2c4ee5)[_0x65f6('0xc')](_0x2d2dfa);}return null;};}function saveUpdates(_0x5c69f8){return function(_0x37330d){if(_0x37330d){return _0x37330d[_0x65f6('0x12')](_0x5c69f8)[_0x65f6('0x13')](function(_0x1f974c){return _0x1f974c;});}return null;};}function removeEntity(_0xc8660c){return function(_0x18380e){if(_0x18380e){return _0x18380e['destroy']()['then'](function(){var _0x2d538c=_0x18380e['get']({'plain':!![]});var _0x4c81f3='SmsQueues';return db[_0x65f6('0x14')][_0x65f6('0x15')]({'where':{'type':_0x4c81f3,'resourceId':_0x2d538c['id']}})['then'](function(){return _0x18380e;});})[_0x65f6('0x13')](function(){_0xc8660c[_0x65f6('0x11')](0xcc)[_0x65f6('0xb')]();});}};}function handleEntityNotFound(_0x3876ed){return function(_0x219ab2){if(!_0x219ab2){_0x3876ed[_0x65f6('0x16')](0x194);}return _0x219ab2;};}function handleError(_0x581374,_0x197a49){_0x197a49=_0x197a49||0x1f4;return function(_0x4bb39e){logger['error'](_0x4bb39e[_0x65f6('0x17')]);if(_0x4bb39e[_0x65f6('0x18')]){delete _0x4bb39e['name'];}_0x581374[_0x65f6('0x11')](_0x197a49)[_0x65f6('0x19')](_0x4bb39e);};}exports[_0x65f6('0x1a')]=function(_0x2774a1,_0x4f5a69){var _0x9d7bb0={};var _0x59ea32={'count':0x0,'rows':[]};var _0x20a161=_['map'](db['SmsQueue']['rawAttributes'],function(_0x29abdb){return{'name':_0x29abdb[_0x65f6('0x1b')],'type':_0x29abdb['type'][_0x65f6('0x1c')]};});_0x9d7bb0=qs[_0x65f6('0x1d')](_0x20a161,_0x2774a1);var _0x52277c={'where':_0x9d7bb0[_0x65f6('0x1e')]};return db[_0x65f6('0x1f')][_0x65f6('0x10')](_0x52277c)['then'](function(_0x4ac04b){_0x59ea32['count']=_0x4ac04b;_0x9d7bb0[_0x65f6('0x20')]=qs[_0x65f6('0x20')](_0x2774a1[_0x65f6('0x21')]);return db[_0x65f6('0x1f')][_0x65f6('0x22')](_0x9d7bb0);})[_0x65f6('0x13')](function(_0x144e55){_0x59ea32['rows']=_0x144e55;return _0x59ea32;})['then'](respondWithFilteredResult(_0x4f5a69,_0x9d7bb0))[_0x65f6('0x23')](handleError(_0x4f5a69,null));};exports[_0x65f6('0x24')]=function(_0x5878bc,_0x4e50c0){var _0x10b368={'raw':!![],'where':{'id':_0x5878bc[_0x65f6('0x25')]['id']}},_0x1ce43c={};_0x1ce43c[_0x65f6('0x26')]=_[_0x65f6('0x27')](db[_0x65f6('0x1f')]['rawAttributes']);_0x1ce43c[_0x65f6('0x21')]=_[_0x65f6('0x27')](_0x5878bc[_0x65f6('0x21')]);_0x1ce43c['filters']=_[_0x65f6('0x28')](_0x1ce43c[_0x65f6('0x26')],_0x1ce43c[_0x65f6('0x21')]);_0x10b368[_0x65f6('0x29')]=_[_0x65f6('0x28')](_0x1ce43c[_0x65f6('0x26')],qs['fields'](_0x5878bc[_0x65f6('0x21')][_0x65f6('0x2a')]));_0x10b368['attributes']=_0x10b368[_0x65f6('0x29')]['length']?_0x10b368[_0x65f6('0x29')]:_0x1ce43c['model'];if(_0x5878bc[_0x65f6('0x21')][_0x65f6('0x2b')]){_0x10b368['include']=[{'all':!![]}];}_0x10b368=_[_0x65f6('0x2c')]({},_0x10b368,_0x5878bc[_0x65f6('0x2d')]);return db[_0x65f6('0x1f')]['find'](_0x10b368)['then'](handleEntityNotFound(_0x4e50c0,null))[_0x65f6('0x13')](respondWithResult(_0x4e50c0,null))['catch'](handleError(_0x4e50c0,null));};exports[_0x65f6('0x2e')]=function(_0x4e6653,_0x22d760){return db[_0x65f6('0x1f')]['create'](_0x4e6653[_0x65f6('0x2f')],{})['then'](function(_0x5edd04){var _0x71b16b=_0x4e6653[_0x65f6('0x30')][_0x65f6('0x31')]({'plain':!![]});if(!_0x71b16b)throw new Error(_0x65f6('0x32'));if(_0x71b16b[_0x65f6('0x33')]===_0x65f6('0x30')){var _0x1a55da=_0x5edd04[_0x65f6('0x31')]({'plain':!![]});var _0x4f933b=_0x65f6('0x34');return db['UserProfileSection'][_0x65f6('0x35')]({'where':{'name':_0x4f933b,'userProfileId':_0x71b16b[_0x65f6('0x36')]},'raw':!![]})[_0x65f6('0x13')](function(_0x2ea7f7){if(_0x2ea7f7&&_0x2ea7f7['autoAssociation']===0x0){return db[_0x65f6('0x14')][_0x65f6('0x2e')]({'name':_0x1a55da[_0x65f6('0x18')],'resourceId':_0x1a55da['id'],'type':_0x2ea7f7[_0x65f6('0x18')],'sectionId':_0x2ea7f7['id']},{})[_0x65f6('0x13')](function(){return _0x5edd04;});}else{return _0x5edd04;}})[_0x65f6('0x23')](function(_0xed4c96){logger[_0x65f6('0x37')](_0x65f6('0x38'),_0xed4c96);throw _0xed4c96;});}return _0x5edd04;})['then'](respondWithResult(_0x22d760,0xc9))[_0x65f6('0x23')](handleError(_0x22d760,null));};exports[_0x65f6('0x12')]=function(_0x377ae5,_0x181798){if(_0x377ae5[_0x65f6('0x2f')]['id']){delete _0x377ae5[_0x65f6('0x2f')]['id'];}return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x377ae5[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x181798,null))[_0x65f6('0x13')](saveUpdates(_0x377ae5[_0x65f6('0x2f')],null))[_0x65f6('0x13')](respondWithResult(_0x181798,null))[_0x65f6('0x23')](handleError(_0x181798,null));};exports[_0x65f6('0x15')]=function(_0x2cb38d,_0x5119ee){return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x2cb38d[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x5119ee,null))['then'](removeEntity(_0x5119ee,null))[_0x65f6('0x23')](handleError(_0x5119ee,null));};exports[_0x65f6('0x39')]=function(_0x2b01eb,_0x5e69b4){return db[_0x65f6('0x1f')][_0x65f6('0x39')]()[_0x65f6('0x13')](respondWithResult(_0x5e69b4,null))[_0x65f6('0x23')](handleError(_0x5e69b4,null));};exports['getMembers']=function(_0x2ec114,_0x512527){var _0x3f1baa={'raw':!![],'where':{}},_0x6968b={},_0x577c93;return db[_0x65f6('0x1f')]['findOne']({'where':{'id':_0x2ec114[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x512527,null))[_0x65f6('0x13')](function(_0xc0db01){if(_0xc0db01){_0x577c93=_0xc0db01[_0x65f6('0x31')]({'plain':!![]});_0x6968b[_0x65f6('0x26')]=_['keys'](db['UserSmsQueue'][_0x65f6('0x3a')]);_0x6968b[_0x65f6('0x21')]=_[_0x65f6('0x27')](_0x2ec114[_0x65f6('0x21')]);_0x6968b[_0x65f6('0x3b')]=_[_0x65f6('0x28')](_0x6968b[_0x65f6('0x26')],_0x6968b[_0x65f6('0x21')]);_0x3f1baa[_0x65f6('0x29')]=_['intersection'](_0x6968b[_0x65f6('0x26')],qs[_0x65f6('0x2a')](_0x2ec114[_0x65f6('0x21')]['fields']));_0x3f1baa[_0x65f6('0x29')]=_0x3f1baa[_0x65f6('0x29')]['length']?_0x3f1baa[_0x65f6('0x29')]:_0x6968b[_0x65f6('0x26')];if(!_0x2ec114['query'][_0x65f6('0x3c')]('nolimit')){_0x3f1baa[_0x65f6('0xe')]=qs[_0x65f6('0xe')](_0x2ec114[_0x65f6('0x21')]['limit']);_0x3f1baa[_0x65f6('0xd')]=qs[_0x65f6('0xd')](_0x2ec114['query'][_0x65f6('0xd')]);}_0x3f1baa[_0x65f6('0x3d')]=qs['sort'](_0x2ec114[_0x65f6('0x21')][_0x65f6('0x3e')]);_0x3f1baa[_0x65f6('0x1e')]=qs[_0x65f6('0x3b')](_[_0x65f6('0x3f')](_0x2ec114[_0x65f6('0x21')],_0x6968b[_0x65f6('0x3b')]));_0x3f1baa[_0x65f6('0x1e')]['SmsQueueId']=_0xc0db01['id'];if(_0x2ec114['query']['filter']){_0x3f1baa[_0x65f6('0x1e')]=_[_0x65f6('0x2c')](_0x3f1baa[_0x65f6('0x1e')],{'$or':_[_0x65f6('0x40')](_0x3f1baa['attributes'],function(_0x183c08){var _0x2032b9={};_0x2032b9[_0x183c08]={'$like':'%'+_0x2ec114[_0x65f6('0x21')]['filter']+'%'};return _0x2032b9;})});}_0x3f1baa=_[_0x65f6('0x2c')]({},_0x3f1baa,_0x2ec114[_0x65f6('0x2d')]);return db[_0x65f6('0x41')]['findAll'](_0x3f1baa);}})['then'](function(_0x1d337d){if(_0x1d337d){return db[_0x65f6('0x42')][_0x65f6('0x43')]({'where':{'id':_[_0x65f6('0x40')](_0x1d337d,_0x65f6('0x44')),'role':_0x65f6('0x45')},'attributes':['id',_0x65f6('0x18'),_0x65f6('0x46'),_0x65f6('0x47'),_0x65f6('0x48')]});}})[_0x65f6('0x13')](function(_0x141fcc){if(_0x141fcc){return{'count':_0x141fcc[_0x65f6('0x10')],'rows':_[_0x65f6('0x40')](_0x141fcc['rows'],function(_0x47610a){return{'membername':_0x47610a[_0x65f6('0x18')],'UserId':_0x47610a['id'],'queue_name':_0x577c93[_0x65f6('0x18')],'SmsQueueId':_0x577c93['id'],'interface':util['format'](_0x65f6('0x49'),_0x65f6('0x4a'),_0x47610a[_0x65f6('0x18')]),'penalty':0x0,'paused':_0x47610a[_0x65f6('0x46')],'createdAt':_0x47610a['createdAt'],'updatedAt':_0x47610a[_0x65f6('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x65f6('0x13')](respondWithFilteredResult(_0x512527,_0x3f1baa))[_0x65f6('0x23')](handleError(_0x512527,null));};exports[_0x65f6('0x4b')]=function(_0x553ff0,_0x2923ff){var _0x2fc20f={};var _0x5c55e4={};var _0x28682b;var _0x26481e;return db[_0x65f6('0x1f')]['findOne']({'where':{'id':_0x553ff0[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x2923ff,null))[_0x65f6('0x13')](function(_0x3c23e3){if(_0x3c23e3){_0x28682b=_0x3c23e3;_0x5c55e4[_0x65f6('0x26')]=_[_0x65f6('0x27')](db['Team']['rawAttributes']);_0x5c55e4['query']=_[_0x65f6('0x27')](_0x553ff0[_0x65f6('0x21')]);_0x5c55e4[_0x65f6('0x3b')]=_[_0x65f6('0x28')](_0x5c55e4[_0x65f6('0x26')],_0x5c55e4[_0x65f6('0x21')]);_0x2fc20f['attributes']=_[_0x65f6('0x28')](_0x5c55e4[_0x65f6('0x26')],qs['fields'](_0x553ff0[_0x65f6('0x21')][_0x65f6('0x2a')]));_0x2fc20f[_0x65f6('0x29')]=_0x2fc20f['attributes'][_0x65f6('0x4c')]?_0x2fc20f[_0x65f6('0x29')]:_0x5c55e4['model'];_0x2fc20f[_0x65f6('0x3d')]=qs[_0x65f6('0x3e')](_0x553ff0[_0x65f6('0x21')][_0x65f6('0x3e')]);_0x2fc20f[_0x65f6('0x1e')]=qs[_0x65f6('0x3b')](_[_0x65f6('0x3f')](_0x553ff0['query'],_0x5c55e4['filters']));if(_0x553ff0[_0x65f6('0x21')][_0x65f6('0x4d')]){_0x2fc20f['where']=_[_0x65f6('0x2c')](_0x2fc20f['where'],{'$or':_[_0x65f6('0x40')](_0x2fc20f['attributes'],function(_0x440df1){var _0xdc8989={};_0xdc8989[_0x440df1]={'$like':'%'+_0x553ff0[_0x65f6('0x21')][_0x65f6('0x4d')]+'%'};return _0xdc8989;})});}_0x2fc20f=_[_0x65f6('0x2c')]({},_0x2fc20f,_0x553ff0[_0x65f6('0x2d')]);return _0x28682b[_0x65f6('0x4b')](_0x2fc20f);}})[_0x65f6('0x13')](function(_0x2405a7){if(_0x2405a7){_0x26481e=_0x2405a7['length'];if(!_0x553ff0['query'][_0x65f6('0x3c')](_0x65f6('0x4e'))){_0x2fc20f[_0x65f6('0xe')]=qs['limit'](_0x553ff0['query'][_0x65f6('0xe')]);_0x2fc20f[_0x65f6('0xd')]=qs[_0x65f6('0xd')](_0x553ff0[_0x65f6('0x21')][_0x65f6('0xd')]);}return _0x28682b[_0x65f6('0x4b')](_0x2fc20f);}})['then'](function(_0x4f42ae){if(_0x4f42ae){return _0x4f42ae?{'count':_0x26481e,'rows':_0x4f42ae}:null;}})[_0x65f6('0x13')](respondWithResult(_0x2923ff,null))[_0x65f6('0x23')](handleError(_0x2923ff,null));};exports['addTeams']=function(_0x219bf8,_0x4a8b60){var _0x254e9f=_0x219bf8[_0x65f6('0x2f')][_0x65f6('0x4f')];return db[_0x65f6('0x50')]['findAll']({'where':{'id':_0x254e9f},'attributes':['id'],'include':[{'model':db[_0x65f6('0x42')],'as':_0x65f6('0x51'),'attributes':['id',_0x65f6('0x18'),'online','voicePause',_0x65f6('0x52')],'raw':!![]}]})['then'](function(_0x305967){if(_0x305967){var _0xf6de=_[_0x65f6('0x53')](_0x305967,function(_0x354b90){var _0x512776=_0x354b90['get']({'plain':!![]});return _0x512776['Agents'];});return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x219bf8[_0x65f6('0x25')]['id']}})['then'](function(_0x46cbde){return db[_0x65f6('0x54')][_0x65f6('0x55')](function(_0x49cee2){return _0x46cbde[_0x65f6('0x56')](_0x254e9f,{'transaction':_0x49cee2})[_0x65f6('0x13')](function(){return BPromise['each'](_0xf6de,function(_0x758e80){return db[_0x65f6('0x41')]['findOrCreate']({'where':{'UserId':_0x758e80['id'],'SmsQueueId':_0x219bf8[_0x65f6('0x25')]['id']},'transaction':_0x49cee2});});})['then'](function(){_0xf6de[_0x65f6('0x57')](function(_0x55ea91){socket[_0x65f6('0x58')](_0x65f6('0x59'),{'UserId':_0x55ea91['id'],'SmsQueueId':_0x46cbde['id']});});});});});}})['then'](respondWithStatusCode(_0x4a8b60,null))[_0x65f6('0x23')](handleError(_0x4a8b60,null));};exports[_0x65f6('0x5a')]=function(_0x2a700b,_0x299b85){return db[_0x65f6('0x50')][_0x65f6('0x22')]({'where':{'id':_0x2a700b[_0x65f6('0x21')][_0x65f6('0x4f')]},'attributes':['id'],'include':[{'model':db[_0x65f6('0x42')],'as':_0x65f6('0x51'),'attributes':['id'],'raw':!![]}]})[_0x65f6('0x13')](handleEntityNotFound(_0x299b85,null))['then'](function(_0x10a661){var _0x1cf1bd=_[_0x65f6('0x40')](_0x10a661,'id');var _0x219e42=[];var _0x5694f9=[];var _0x453080=squel[_0x65f6('0x5b')]();_0x453080['field'](_0x65f6('0x5c'))['from'](_0x65f6('0x5d'),'tq')['join'](_0x65f6('0x5e'),'ut',_0x65f6('0x5f'))['where']('SmsQueueId\x20=\x20?',_0x2a700b[_0x65f6('0x25')]['id']);for(var _0x413c21=0x0;_0x413c21<_0x10a661['length'];_0x413c21+=0x1){let _0x2d86c8=_0x10a661[_0x413c21];for(var _0x3b3bd5=0x0;_0x3b3bd5<_0x2d86c8[_0x65f6('0x51')]['length'];_0x3b3bd5+=0x1){let _0x1348ec=_0x2d86c8[_0x65f6('0x51')][_0x3b3bd5];var _0x5889dc=_0x453080[_0x65f6('0x60')]();_0x5889dc['where'](_0x65f6('0x61'),_0x1348ec['id']);_0x5694f9['push'](db['sequelize'][_0x65f6('0x21')](_0x5889dc[_0x65f6('0x62')](),{'type':db[_0x65f6('0x54')][_0x65f6('0x63')][_0x65f6('0x64')]})[_0x65f6('0x13')](function(_0x1ac46f){if(_0x1ac46f[_0x65f6('0x4c')]===0x1){return _0x1348ec['id'];}else{var _0x4d66fe=_['every'](_[_0x65f6('0x40')](_0x1ac46f,'TeamId'),function(_0x1ee28a){return _[_0x65f6('0x65')](_0x1cf1bd,_0x1ee28a);});if(_0x4d66fe){return _0x1348ec['id'];}}}));}}return BPromise[_0x65f6('0x66')](_0x5694f9)[_0x65f6('0x13')](function(_0x43127b){_0x219e42=_(_0x219e42)['union'](_0x43127b)[_0x65f6('0x67')]()[_0x65f6('0x68')]();return db[_0x65f6('0x1f')]['find']({'where':{'id':_0x2a700b[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](function(_0x4254c2){return db[_0x65f6('0x54')][_0x65f6('0x55')](function(_0x16bf93){return _0x4254c2['removeTeams'](_0x2a700b['query'][_0x65f6('0x4f')],{'transaction':_0x16bf93})[_0x65f6('0x13')](function(){if(!_[_0x65f6('0x69')](_0x219e42)){return _0x4254c2[_0x65f6('0x6a')](_0x219e42,{'transaction':_0x16bf93});}})['then'](function(){_0x219e42['forEach'](function(_0x336076){socket[_0x65f6('0x58')](_0x65f6('0x6b'),{'UserId':_0x336076,'SmsQueueId':_0x4254c2['id']});});});});});});})[_0x65f6('0x13')](respondWithStatusCode(_0x299b85,null))[_0x65f6('0x23')](handleError(_0x299b85,null));};exports[_0x65f6('0x6c')]=function(_0x5daaf4,_0x4d607a){return db['SmsQueue'][_0x65f6('0x35')]({'where':{'id':_0x5daaf4[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x4d607a,null))[_0x65f6('0x13')](function(_0x53b11c){if(_0x53b11c){return _0x53b11c['addAgents'](_0x5daaf4[_0x65f6('0x2f')][_0x65f6('0x4f')],_['omit'](_0x5daaf4[_0x65f6('0x2f')],['ids','id'])||{})[_0x65f6('0x6d')](function(_0x4f3ef8){for(var _0x3a30ed=0x0;_0x3a30ed<_0x5daaf4[_0x65f6('0x2f')]['ids'][_0x65f6('0x4c')];_0x3a30ed+=0x1){socket[_0x65f6('0x58')](_0x65f6('0x59'),{'UserId':Number(_0x5daaf4[_0x65f6('0x2f')][_0x65f6('0x4f')][_0x3a30ed]),'SmsQueueId':Number(_0x5daaf4[_0x65f6('0x25')]['id'])});}return _0x4f3ef8;});}})['then'](respondWithResult(_0x4d607a,null))[_0x65f6('0x23')](handleError(_0x4d607a,null));};exports['removeAgents']=function(_0x24495c,_0x56336a){return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x24495c[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x56336a,null))['then'](function(_0x2b6f98){if(_0x2b6f98){return _0x2b6f98[_0x65f6('0x6a')](_0x24495c[_0x65f6('0x21')]['ids'])['then'](function(){if(_[_0x65f6('0x6e')](_0x24495c[_0x65f6('0x21')]['ids'])){for(var _0x180cde=0x0;_0x180cde<_0x24495c[_0x65f6('0x21')][_0x65f6('0x4f')]['length'];_0x180cde+=0x1){socket[_0x65f6('0x58')](_0x65f6('0x6b'),{'UserId':Number(_0x24495c['query'][_0x65f6('0x4f')][_0x180cde]),'SmsQueueId':Number(_0x24495c[_0x65f6('0x25')]['id'])});}}else{socket[_0x65f6('0x58')]('userSmsQueue:remove',{'UserId':Number(_0x24495c[_0x65f6('0x21')][_0x65f6('0x4f')]),'SmsQueueId':Number(_0x24495c[_0x65f6('0x25')]['id'])});}});}})['then'](respondWithStatusCode(_0x56336a,null))[_0x65f6('0x23')](handleError(_0x56336a,null));};exports['getAgents']=function(_0x1beaa7,_0x87a9e4){var _0x31ec61={};var _0x22be6e={};var _0x29b2de;var _0x430fb8;return db['SmsQueue'][_0x65f6('0x6f')]({'where':{'id':_0x1beaa7[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x87a9e4,null))[_0x65f6('0x13')](function(_0x207d15){if(_0x207d15){_0x29b2de=_0x207d15;_0x22be6e['model']=_['keys'](db['User'][_0x65f6('0x3a')]);_0x22be6e[_0x65f6('0x21')]=_[_0x65f6('0x27')](_0x1beaa7['query']);_0x22be6e[_0x65f6('0x3b')]=_['intersection'](_0x22be6e['model'],_0x22be6e[_0x65f6('0x21')]);_0x31ec61[_0x65f6('0x29')]=_['intersection'](_0x22be6e[_0x65f6('0x26')],qs[_0x65f6('0x2a')](_0x1beaa7[_0x65f6('0x21')][_0x65f6('0x2a')]));_0x31ec61[_0x65f6('0x29')]=_0x31ec61[_0x65f6('0x29')][_0x65f6('0x4c')]?_0x31ec61[_0x65f6('0x29')]:_0x22be6e[_0x65f6('0x26')];_0x31ec61[_0x65f6('0x3d')]=qs[_0x65f6('0x3e')](_0x1beaa7[_0x65f6('0x21')]['sort']);_0x31ec61[_0x65f6('0x1e')]=qs['filters'](_['pick'](_0x1beaa7[_0x65f6('0x21')],_0x22be6e[_0x65f6('0x3b')]));if(_0x1beaa7[_0x65f6('0x21')][_0x65f6('0x4d')]){_0x31ec61['where']=_[_0x65f6('0x2c')](_0x31ec61['where'],{'$or':_['map'](_0x31ec61[_0x65f6('0x29')],function(_0x99fe6e){var _0x1a7e52={};_0x1a7e52[_0x99fe6e]={'$like':'%'+_0x1beaa7[_0x65f6('0x21')][_0x65f6('0x4d')]+'%'};return _0x1a7e52;})});}_0x31ec61=_[_0x65f6('0x2c')]({},_0x31ec61,_0x1beaa7['options']);return _0x29b2de[_0x65f6('0x70')](_0x31ec61);}})['then'](function(_0x1ef2a0){if(_0x1ef2a0){_0x430fb8=_0x1ef2a0[_0x65f6('0x4c')];if(!_0x1beaa7[_0x65f6('0x21')]['hasOwnProperty'](_0x65f6('0x4e'))){_0x31ec61['limit']=qs['limit'](_0x1beaa7[_0x65f6('0x21')][_0x65f6('0xe')]);_0x31ec61[_0x65f6('0xd')]=qs[_0x65f6('0xd')](_0x1beaa7[_0x65f6('0x21')]['offset']);}return _0x29b2de[_0x65f6('0x70')](_0x31ec61);}})[_0x65f6('0x13')](function(_0x3bebe3){if(_0x3bebe3){return _0x3bebe3?{'count':_0x430fb8,'rows':_0x3bebe3}:null;}})[_0x65f6('0x13')](respondWithResult(_0x87a9e4,null))['catch'](handleError(_0x87a9e4,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index f788946..e986493 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 _0x1111=['SmsQueue','save','emit','hook','exports','events','../../mysqldb'];(function(_0x329647,_0x2f6850){var _0xbcd89b=function(_0x39ae95){while(--_0x39ae95){_0x329647['push'](_0x329647['shift']());}};_0xbcd89b(++_0x2f6850);}(_0x1111,0x12b));var _0x1111=function(_0x11941d,_0xade6dc){_0x11941d=_0x11941d-0x0;var _0x4890cb=_0x1111[_0x11941d];return _0x4890cb;};'use strict';var EventEmitter=require(_0x1111('0x0'));var SmsQueue=require(_0x1111('0x1'))['db'][_0x1111('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1111('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5e46ec){return function(_0x495cfc,_0x13b3ce,_0x369dc7){SmsQueueEvents[_0x1111('0x4')](_0x5e46ec+':'+_0x495cfc['id'],_0x495cfc);SmsQueueEvents[_0x1111('0x4')](_0x5e46ec,_0x495cfc);_0x369dc7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x1111('0x5')](e,emitEvent(event));}}module[_0x1111('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0x8c30=['emit','hasOwnProperty','hook','events','SmsQueue','setMaxListeners','save','update','remove'];(function(_0x1e8b1e,_0x407bbd){var _0x4a0fde=function(_0x4fd2be){while(--_0x4fd2be){_0x1e8b1e['push'](_0x1e8b1e['shift']());}};_0x4a0fde(++_0x407bbd);}(_0x8c30,0x18f));var _0x08c3=function(_0x14d515,_0x13abf5){_0x14d515=_0x14d515-0x0;var _0x4a4258=_0x8c30[_0x14d515];return _0x4a4258;};'use strict';var EventEmitter=require(_0x08c3('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x08c3('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x08c3('0x2')](0x0);var events={'afterCreate':_0x08c3('0x3'),'afterUpdate':_0x08c3('0x4'),'afterDestroy':_0x08c3('0x5')};function emitEvent(_0x39b539){return function(_0x399d76,_0x356f75,_0x299384){SmsQueueEvents['emit'](_0x39b539+':'+_0x399d76['id'],_0x399d76);SmsQueueEvents[_0x08c3('0x6')](_0x39b539,_0x399d76);_0x299384(null);};}for(var e in events){if(events[_0x08c3('0x7')](e)){var event=events[e];SmsQueue[_0x08c3('0x8')](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 c27acbd..c5ed80e 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 _0x93df=['exports','define','sms_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./smsQueue.attributes'];(function(_0x4fa738,_0x2a491c){var _0x55bf55=function(_0x185d53){while(--_0x185d53){_0x4fa738['push'](_0x4fa738['shift']());}};_0x55bf55(++_0x2a491c);}(_0x93df,0xe9));var _0xf93d=function(_0x377d47,_0x3d5e9a){_0x377d47=_0x377d47-0x0;var _0x289c2f=_0x93df[_0x377d47];return _0x289c2f;};'use strict';var _=require(_0xf93d('0x0'));var util=require('util');var logger=require(_0xf93d('0x1'))(_0xf93d('0x2'));var moment=require(_0xf93d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf93d('0x4'));var rimraf=require('rimraf');var config=require(_0xf93d('0x5'));var attributes=require(_0xf93d('0x6'));module[_0xf93d('0x7')]=function(_0x14de13,_0x2889d6){return _0x14de13[_0xf93d('0x8')]('SmsQueue',attributes,{'tableName':_0xf93d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fc3=['request-promise','path','../../config/environment','./smsQueue.attributes','exports','define','sms_queues','util','../../config/logger','moment'];(function(_0x55bd10,_0xe4c71f){var _0x25057a=function(_0x4ac3f0){while(--_0x4ac3f0){_0x55bd10['push'](_0x55bd10['shift']());}};_0x25057a(++_0xe4c71f);}(_0x2fc3,0x147));var _0x32fc=function(_0x3d3cb1,_0x221263){_0x3d3cb1=_0x3d3cb1-0x0;var _0x1f4353=_0x2fc3[_0x3d3cb1];return _0x1f4353;};'use strict';var _=require('lodash');var util=require(_0x32fc('0x0'));var logger=require(_0x32fc('0x1'))('api');var moment=require(_0x32fc('0x2'));var BPromise=require('bluebird');var rp=require(_0x32fc('0x3'));var fs=require('fs');var path=require(_0x32fc('0x4'));var rimraf=require('rimraf');var config=require(_0x32fc('0x5'));var attributes=require(_0x32fc('0x6'));module[_0x32fc('0x7')]=function(_0x20fe22,_0x1daf5b){return _0x20fe22[_0x32fc('0x8')]('SmsQueue',attributes,{'tableName':_0x32fc('0x9'),'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 f30a966..d1c950e 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 _0xcbc9=['message','catch','GetSmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowSmsQueue','SmsQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error'];(function(_0x3d2a13,_0x546c26){var _0x57c50e=function(_0x383d5d){while(--_0x383d5d){_0x3d2a13['push'](_0x3d2a13['shift']());}};_0x57c50e(++_0x546c26);}(_0xcbc9,0x1e4));var _0x9cbc=function(_0x1fd437,_0x2c0b47){_0x1fd437=_0x1fd437-0x0;var _0x40d9e6=_0xcbc9[_0x1fd437];return _0x40d9e6;};'use strict';var _=require(_0x9cbc('0x0'));var util=require(_0x9cbc('0x1'));var moment=require('moment');var BPromise=require(_0x9cbc('0x2'));var rs=require(_0x9cbc('0x3'));var fs=require('fs');var Redis=require(_0x9cbc('0x4'));var db=require(_0x9cbc('0x5'))['db'];var utils=require(_0x9cbc('0x6'));var logger=require('../../config/logger')(_0x9cbc('0x7'));var config=require('../../config/environment');var jayson=require(_0x9cbc('0x8'));var client=jayson[_0x9cbc('0x9')][_0x9cbc('0xa')]({'port':0x232a});config[_0x9cbc('0xb')]=_[_0x9cbc('0xc')](config[_0x9cbc('0xb')],{'host':_0x9cbc('0xd'),'port':0x18eb});var socket=require(_0x9cbc('0xe'))(new Redis(config['redis']));require(_0x9cbc('0xf'))['register'](socket);function respondWithRpcPromise(_0x1c07c9,_0x42c377,_0x41b96d){return new BPromise(function(_0xb86ce5,_0x2a08bc){return client['request'](_0x1c07c9,_0x41b96d)['then'](function(_0x7e7f5a){logger[_0x9cbc('0x10')](_0x9cbc('0x11'),_0x42c377,_0x9cbc('0x12'));logger[_0x9cbc('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x42c377,'request\x20sent',JSON[_0x9cbc('0x14')](_0x7e7f5a));if(_0x7e7f5a['error']){if(_0x7e7f5a['error'][_0x9cbc('0x15')]===0x1f4){logger['error'](_0x9cbc('0x11'),_0x42c377,_0x7e7f5a[_0x9cbc('0x16')][_0x9cbc('0x17')]);return _0x2a08bc(_0x7e7f5a[_0x9cbc('0x16')][_0x9cbc('0x17')]);}logger[_0x9cbc('0x16')](_0x9cbc('0x11'),_0x42c377,_0x7e7f5a[_0x9cbc('0x16')]['message']);return _0xb86ce5(_0x7e7f5a[_0x9cbc('0x16')][_0x9cbc('0x17')]);}else{logger[_0x9cbc('0x10')]('SmsQueue,\x20%s,\x20%s',_0x42c377,_0x9cbc('0x12'));_0xb86ce5(_0x7e7f5a['result']['message']);}})[_0x9cbc('0x18')](function(_0x43bfd9){logger['error']('SmsQueue,\x20%s,\x20%s',_0x42c377,_0x43bfd9);_0x2a08bc(_0x43bfd9);});});}exports[_0x9cbc('0x19')]=function(_0x2168c7){var _0x2073d6=this;return new Promise(function(_0x18df91,_0x1462c8){return db['SmsQueue'][_0x9cbc('0x1a')]({'raw':_0x2168c7['options']?_0x2168c7[_0x9cbc('0x1b')][_0x9cbc('0x1c')]===undefined?!![]:![]:!![],'where':_0x2168c7[_0x9cbc('0x1b')]?_0x2168c7[_0x9cbc('0x1b')][_0x9cbc('0x1d')]||null:null,'attributes':_0x2168c7[_0x9cbc('0x1b')]?_0x2168c7['options'][_0x9cbc('0x1e')]||null:null,'limit':_0x2168c7[_0x9cbc('0x1b')]?_0x2168c7[_0x9cbc('0x1b')][_0x9cbc('0x1f')]||null:null,'include':_0x2168c7[_0x9cbc('0x1b')]?_0x2168c7[_0x9cbc('0x1b')][_0x9cbc('0x20')]?_[_0x9cbc('0x21')](_0x2168c7['options'][_0x9cbc('0x20')],function(_0x275f9b){return{'model':db[_0x275f9b[_0x9cbc('0x22')]],'as':_0x275f9b['as'],'attributes':_0x275f9b[_0x9cbc('0x1e')],'include':_0x275f9b[_0x9cbc('0x20')]?_[_0x9cbc('0x21')](_0x275f9b['include'],function(_0x545f72){return{'model':db[_0x545f72['model']],'as':_0x545f72['as'],'attributes':_0x545f72[_0x9cbc('0x1e')],'include':_0x545f72[_0x9cbc('0x20')]?_['map'](_0x545f72[_0x9cbc('0x20')],function(_0x4a66ab){return{'model':db[_0x4a66ab[_0x9cbc('0x22')]],'as':_0x4a66ab['as'],'attributes':_0x4a66ab[_0x9cbc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9cbc('0x23')](function(_0x553dd8){logger[_0x9cbc('0x10')](_0x9cbc('0x19'),_0x2168c7);logger[_0x9cbc('0x13')](_0x9cbc('0x19'),_0x2168c7,JSON[_0x9cbc('0x14')](_0x553dd8));_0x18df91(_0x553dd8);})[_0x9cbc('0x18')](function(_0x498884){logger[_0x9cbc('0x16')](_0x9cbc('0x19'),_0x498884[_0x9cbc('0x17')],_0x2168c7);_0x1462c8(_0x2073d6[_0x9cbc('0x16')](0x1f4,_0x498884['message']));});});};exports[_0x9cbc('0x24')]=function(_0x3118f6){var _0x477a1d=this;return new Promise(function(_0x26f477,_0x448654){return db[_0x9cbc('0x25')][_0x9cbc('0x26')]({'raw':_0x3118f6[_0x9cbc('0x1b')]?_0x3118f6['options'][_0x9cbc('0x1c')]===undefined?!![]:![]:!![],'where':_0x3118f6[_0x9cbc('0x1b')]?_0x3118f6['options'][_0x9cbc('0x1d')]||null:null,'attributes':_0x3118f6[_0x9cbc('0x1b')]?_0x3118f6[_0x9cbc('0x1b')][_0x9cbc('0x1e')]||null:null,'include':_0x3118f6[_0x9cbc('0x1b')]?_0x3118f6[_0x9cbc('0x1b')][_0x9cbc('0x20')]?_[_0x9cbc('0x21')](_0x3118f6[_0x9cbc('0x1b')][_0x9cbc('0x20')],function(_0x581c48){return{'model':db[_0x581c48['model']],'as':_0x581c48['as'],'attributes':_0x581c48['attributes'],'include':_0x581c48[_0x9cbc('0x20')]?_['map'](_0x581c48[_0x9cbc('0x20')],function(_0x3f68d1){return{'model':db[_0x3f68d1[_0x9cbc('0x22')]],'as':_0x3f68d1['as'],'attributes':_0x3f68d1[_0x9cbc('0x1e')],'include':_0x3f68d1[_0x9cbc('0x20')]?_['map'](_0x3f68d1[_0x9cbc('0x20')],function(_0x3bf9fa){return{'model':db[_0x3bf9fa[_0x9cbc('0x22')]],'as':_0x3bf9fa['as'],'attributes':_0x3bf9fa[_0x9cbc('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47388c){logger[_0x9cbc('0x10')](_0x9cbc('0x24'),_0x3118f6);logger[_0x9cbc('0x13')](_0x9cbc('0x24'),_0x3118f6,JSON[_0x9cbc('0x14')](_0x47388c));_0x26f477(_0x47388c);})[_0x9cbc('0x18')](function(_0x588df0){logger[_0x9cbc('0x16')](_0x9cbc('0x24'),_0x588df0['message'],_0x3118f6);_0x448654(_0x477a1d[_0x9cbc('0x16')](0x1f4,_0x588df0[_0x9cbc('0x17')]));});});}; \ No newline at end of file +var _0xe56c=['error','code','message','info','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','include','model','map','find','ShowSmsQueue','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0xe56c,0x84));var _0xce56=function(_0x2cc7f2,_0x546901){_0x2cc7f2=_0x2cc7f2-0x0;var _0x395840=_0xe56c[_0x2cc7f2];return _0x395840;};'use strict';var _=require('lodash');var util=require(_0xce56('0x0'));var moment=require(_0xce56('0x1'));var BPromise=require(_0xce56('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce56('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xce56('0x4'));var logger=require('../../config/logger')(_0xce56('0x5'));var config=require(_0xce56('0x6'));var jayson=require(_0xce56('0x7'));var client=jayson[_0xce56('0x8')][_0xce56('0x9')]({'port':0x232a});config[_0xce56('0xa')]=_['defaults'](config[_0xce56('0xa')],{'host':_0xce56('0xb'),'port':0x18eb});var socket=require(_0xce56('0xc'))(new Redis(config['redis']));require(_0xce56('0xd'))[_0xce56('0xe')](socket);function respondWithRpcPromise(_0x199221,_0x3b7143,_0x24480a){return new BPromise(function(_0x1e8a52,_0x29f177){return client['request'](_0x199221,_0x24480a)[_0xce56('0xf')](function(_0x4f4162){logger['info'](_0xce56('0x10'),_0x3b7143,_0xce56('0x11'));logger[_0xce56('0x12')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x3b7143,'request\x20sent',JSON[_0xce56('0x13')](_0x4f4162));if(_0x4f4162['error']){if(_0x4f4162[_0xce56('0x14')][_0xce56('0x15')]===0x1f4){logger[_0xce56('0x14')](_0xce56('0x10'),_0x3b7143,_0x4f4162['error']['message']);return _0x29f177(_0x4f4162['error']['message']);}logger[_0xce56('0x14')](_0xce56('0x10'),_0x3b7143,_0x4f4162['error']['message']);return _0x1e8a52(_0x4f4162['error'][_0xce56('0x16')]);}else{logger[_0xce56('0x17')](_0xce56('0x10'),_0x3b7143,_0xce56('0x11'));_0x1e8a52(_0x4f4162[_0xce56('0x18')][_0xce56('0x16')]);}})[_0xce56('0x19')](function(_0x3f65c8){logger['error']('SmsQueue,\x20%s,\x20%s',_0x3b7143,_0x3f65c8);_0x29f177(_0x3f65c8);});});}exports[_0xce56('0x1a')]=function(_0x4abff7){var _0x12a811=this;return new Promise(function(_0x4080d6,_0x308454){return db[_0xce56('0x1b')][_0xce56('0x1c')]({'raw':_0x4abff7['options']?_0x4abff7[_0xce56('0x1d')][_0xce56('0x1e')]===undefined?!![]:![]:!![],'where':_0x4abff7[_0xce56('0x1d')]?_0x4abff7[_0xce56('0x1d')][_0xce56('0x1f')]||null:null,'attributes':_0x4abff7['options']?_0x4abff7[_0xce56('0x1d')][_0xce56('0x20')]||null:null,'limit':_0x4abff7[_0xce56('0x1d')]?_0x4abff7['options']['limit']||null:null,'include':_0x4abff7[_0xce56('0x1d')]?_0x4abff7[_0xce56('0x1d')][_0xce56('0x21')]?_['map'](_0x4abff7['options'][_0xce56('0x21')],function(_0x18a696){return{'model':db[_0x18a696[_0xce56('0x22')]],'as':_0x18a696['as'],'attributes':_0x18a696[_0xce56('0x20')],'include':_0x18a696[_0xce56('0x21')]?_[_0xce56('0x23')](_0x18a696[_0xce56('0x21')],function(_0x67030f){return{'model':db[_0x67030f['model']],'as':_0x67030f['as'],'attributes':_0x67030f[_0xce56('0x20')],'include':_0x67030f['include']?_[_0xce56('0x23')](_0x67030f['include'],function(_0x4a973f){return{'model':db[_0x4a973f['model']],'as':_0x4a973f['as'],'attributes':_0x4a973f[_0xce56('0x20')]};}):[]};}):[]};}):[]:[]})[_0xce56('0xf')](function(_0x3a0163){logger['info'](_0xce56('0x1a'),_0x4abff7);logger[_0xce56('0x12')](_0xce56('0x1a'),_0x4abff7,JSON['stringify'](_0x3a0163));_0x4080d6(_0x3a0163);})[_0xce56('0x19')](function(_0x3aa8ba){logger['error'](_0xce56('0x1a'),_0x3aa8ba[_0xce56('0x16')],_0x4abff7);_0x308454(_0x12a811['error'](0x1f4,_0x3aa8ba[_0xce56('0x16')]));});});};exports['ShowSmsQueue']=function(_0x50181d){var _0x4e0ad7=this;return new Promise(function(_0x553be1,_0x25ead2){return db[_0xce56('0x1b')][_0xce56('0x24')]({'raw':_0x50181d[_0xce56('0x1d')]?_0x50181d[_0xce56('0x1d')][_0xce56('0x1e')]===undefined?!![]:![]:!![],'where':_0x50181d[_0xce56('0x1d')]?_0x50181d[_0xce56('0x1d')][_0xce56('0x1f')]||null:null,'attributes':_0x50181d[_0xce56('0x1d')]?_0x50181d[_0xce56('0x1d')][_0xce56('0x20')]||null:null,'include':_0x50181d[_0xce56('0x1d')]?_0x50181d[_0xce56('0x1d')][_0xce56('0x21')]?_[_0xce56('0x23')](_0x50181d[_0xce56('0x1d')]['include'],function(_0x30727c){return{'model':db[_0x30727c[_0xce56('0x22')]],'as':_0x30727c['as'],'attributes':_0x30727c['attributes'],'include':_0x30727c[_0xce56('0x21')]?_['map'](_0x30727c['include'],function(_0x36158b){return{'model':db[_0x36158b[_0xce56('0x22')]],'as':_0x36158b['as'],'attributes':_0x36158b['attributes'],'include':_0x36158b[_0xce56('0x21')]?_[_0xce56('0x23')](_0x36158b[_0xce56('0x21')],function(_0xc4dafc){return{'model':db[_0xc4dafc[_0xce56('0x22')]],'as':_0xc4dafc['as'],'attributes':_0xc4dafc[_0xce56('0x20')]};}):[]};}):[]};}):[]:[]})[_0xce56('0xf')](function(_0x1c2daa){logger[_0xce56('0x17')](_0xce56('0x25'),_0x50181d);logger[_0xce56('0x12')](_0xce56('0x25'),_0x50181d,JSON[_0xce56('0x13')](_0x1c2daa));_0x553be1(_0x1c2daa);})[_0xce56('0x19')](function(_0x2f1975){logger['error'](_0xce56('0x25'),_0x2f1975['message'],_0x50181d);_0x25ead2(_0x4e0ad7[_0xce56('0x14')](0x1f4,_0x2f1975['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index fe2f894..2cfbecc 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 _0x6f35=['length','save','update','removeListener','register'];(function(_0x49c1de,_0x3d024e){var _0x66c069=function(_0x4f18fb){while(--_0x4f18fb){_0x49c1de['push'](_0x49c1de['shift']());}};_0x66c069(++_0x3d024e);}(_0x6f35,0x18c));var _0x56f3=function(_0x1e808a,_0x51f0ee){_0x1e808a=_0x1e808a-0x0;var _0x27dc19=_0x6f35[_0x1e808a];return _0x27dc19;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x56f3('0x0'),'remove',_0x56f3('0x1')];function createListener(_0x21347b,_0x1797bb){return function(_0x204134){_0x1797bb['emit'](_0x21347b,_0x204134);};}function removeListener(_0x5f0e7a,_0x166266){return function(){SmsQueueEvents[_0x56f3('0x2')](_0x5f0e7a,_0x166266);};}exports[_0x56f3('0x3')]=function(_0x5a54d5){for(var _0x226897=0x0,_0x5a1fdb=events[_0x56f3('0x4')];_0x226897<_0x5a1fdb;_0x226897++){var _0x1d543b=events[_0x226897];var _0x5d6e64=createListener('smsQueue:'+_0x1d543b,_0x5a54d5);SmsQueueEvents['on'](_0x1d543b,_0x5d6e64);}}; \ No newline at end of file +var _0x7304=['remove','removeListener','register','length','smsQueue:','./smsQueue.events','save'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7304,0x1da));var _0x4730=function(_0x845505,_0x19e5f3){_0x845505=_0x845505-0x0;var _0x2513b9=_0x7304[_0x845505];return _0x2513b9;};'use strict';var SmsQueueEvents=require(_0x4730('0x0'));var events=[_0x4730('0x1'),_0x4730('0x2'),'update'];function createListener(_0x1ae1d5,_0x17999c){return function(_0x572517){_0x17999c['emit'](_0x1ae1d5,_0x572517);};}function removeListener(_0x15a6a6,_0x3594fd){return function(){SmsQueueEvents[_0x4730('0x3')](_0x15a6a6,_0x3594fd);};}exports[_0x4730('0x4')]=function(_0x3eeb5c){for(var _0x5ee127=0x0,_0x333ef3=events[_0x4730('0x5')];_0x5ee127<_0x333ef3;_0x5ee127++){var _0x117c22=events[_0x5ee127];var _0x229b30=createListener(_0x4730('0x6')+_0x117c22,_0x3eeb5c);SmsQueueEvents['on'](_0x117c22,_0x229b30);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index a0081e5..849d2a1 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 _0xe51b=['../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x514260,_0x1891e1){var _0x4ac81b=function(_0x53cab1){while(--_0x53cab1){_0x514260['push'](_0x514260['shift']());}};_0x4ac81b(++_0x1891e1);}(_0xe51b,0x92));var _0xbe51=function(_0x521500,_0x4cc29f){_0x521500=_0x521500-0x0;var _0x4c0a73=_0xe51b[_0x521500];return _0x4c0a73;};'use strict';var multer=require(_0xbe51('0x0'));var util=require(_0xbe51('0x1'));var path=require('path');var timeout=require(_0xbe51('0x2'));var express=require(_0xbe51('0x3'));var router=express[_0xbe51('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbe51('0x5'));var interaction=require(_0xbe51('0x6'));var config=require(_0xbe51('0x7'));var controller=require('./smsQueueReport.controller');router[_0xbe51('0x8')]('/',auth[_0xbe51('0x9')](),controller['index']);router[_0xbe51('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xbe51('0xa')]);router['get'](_0xbe51('0xb'),auth['isAuthenticated'](),controller[_0xbe51('0xc')]);router[_0xbe51('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbe51('0xe')](_0xbe51('0xb'),auth[_0xbe51('0x9')](),controller[_0xbe51('0xf')]);router[_0xbe51('0x10')](_0xbe51('0xb'),auth[_0xbe51('0x9')](),controller[_0xbe51('0x11')]);module[_0xbe51('0x12')]=router; \ No newline at end of file +var _0xb190=['delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','show','post','create','update'];(function(_0x28c9f2,_0x19cab5){var _0x2333d1=function(_0x15c122){while(--_0x15c122){_0x28c9f2['push'](_0x28c9f2['shift']());}};_0x2333d1(++_0x19cab5);}(_0xb190,0xce));var _0x0b19=function(_0x401189,_0x41600c){_0x401189=_0x401189-0x0;var _0x1cb062=_0xb190[_0x401189];return _0x1cb062;};'use strict';var multer=require(_0x0b19('0x0'));var util=require(_0x0b19('0x1'));var path=require(_0x0b19('0x2'));var timeout=require(_0x0b19('0x3'));var express=require('express');var router=express[_0x0b19('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0b19('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router[_0x0b19('0x6')]('/',auth[_0x0b19('0x7')](),controller[_0x0b19('0x8')]);router['get'](_0x0b19('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x0b19('0xa'),auth[_0x0b19('0x7')](),controller[_0x0b19('0xb')]);router[_0x0b19('0xc')]('/',auth[_0x0b19('0x7')](),controller[_0x0b19('0xd')]);router['put'](_0x0b19('0xa'),auth[_0x0b19('0x7')](),controller[_0x0b19('0xe')]);router[_0x0b19('0xf')]('/:id',auth[_0x0b19('0x7')](),controller['destroy']);module[_0x0b19('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 778e456..f61d425 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 _0x203e=['exports','STRING','DATE'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0x203e,0x8d));var _0xe203=function(_0x169c40,_0x4c1689){_0x169c40=_0x169c40-0x0;var _0x289775=_0x203e[_0x169c40];return _0x289775;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xe203('0x0')]={'uniqueid':{'type':Sequelize[_0xe203('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xe203('0x1')]},'joinAt':{'type':Sequelize[_0xe203('0x2')]},'leaveAt':{'type':Sequelize[_0xe203('0x2')]},'acceptAt':{'type':Sequelize[_0xe203('0x2')]},'exitAt':{'type':Sequelize[_0xe203('0x2')]},'reason':{'type':Sequelize[_0xe203('0x1')]}}; \ No newline at end of file +var _0xdf67=['sequelize','exports','STRING','DATE','moment'];(function(_0x1d8ffe,_0x56b8c1){var _0x2c56ae=function(_0x43d452){while(--_0x43d452){_0x1d8ffe['push'](_0x1d8ffe['shift']());}};_0x2c56ae(++_0x56b8c1);}(_0xdf67,0x117));var _0x7df6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf67[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x7df6('0x0'));var Sequelize=require(_0x7df6('0x1'));module[_0x7df6('0x2')]={'uniqueid':{'type':Sequelize[_0x7df6('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7df6('0x4')]},'leaveAt':{'type':Sequelize[_0x7df6('0x4')]},'acceptAt':{'type':Sequelize[_0x7df6('0x4')]},'exitAt':{'type':Sequelize[_0x7df6('0x4')]},'reason':{'type':Sequelize[_0x7df6('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 1a3282f..d2f7518 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 _0x4933=['send','index','map','rawAttributes','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','SmsQueueReport','include','findAll','catch','show','params','intersection','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name'];(function(_0x6df066,_0x11dc28){var _0x59bcd2=function(_0x3adc48){while(--_0x3adc48){_0x6df066['push'](_0x6df066['shift']());}};_0x59bcd2(++_0x11dc28);}(_0x4933,0x19e));var _0x3493=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0x4933[_0x23c6f2];return _0x4c270b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3493('0x0'));var zipdir=require(_0x3493('0x1'));var jsonpatch=require(_0x3493('0x2'));var rp=require(_0x3493('0x3'));var moment=require(_0x3493('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3493('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3493('0x6'));var ejs=require(_0x3493('0x7'));var fs=require('fs');var fs_extra=require(_0x3493('0x8'));var _=require('lodash');var squel=require(_0x3493('0x9'));var crypto=require(_0x3493('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3493('0xb'));var toCsv=require(_0x3493('0x6'));var querystring=require(_0x3493('0xc'));var Papa=require(_0x3493('0xd'));var Redis=require(_0x3493('0xe'));var authService=require(_0x3493('0xf'));var qs=require(_0x3493('0x10'));var as=require(_0x3493('0x11'));var hardwareService=require(_0x3493('0x12'));var logger=require('../../config/logger')(_0x3493('0x13'));var utils=require(_0x3493('0x14'));var config=require(_0x3493('0x15'));var licenseUtil=require(_0x3493('0x16'));var db=require(_0x3493('0x17'))['db'];function respondWithStatusCode(_0x3fde87,_0x10d7cd){_0x10d7cd=_0x10d7cd||0xcc;return function(_0x52178b){if(_0x52178b){return _0x3fde87['sendStatus'](_0x10d7cd);}return _0x3fde87[_0x3493('0x18')](_0x10d7cd)[_0x3493('0x19')]();};}function respondWithResult(_0x491c49,_0x3d5af1){_0x3d5af1=_0x3d5af1||0xc8;return function(_0x58c3b7){if(_0x58c3b7){return _0x491c49[_0x3493('0x18')](_0x3d5af1)[_0x3493('0x1a')](_0x58c3b7);}};}function respondWithFilteredResult(_0x1a825d,_0x5024c4){return function(_0x10f577){if(_0x10f577){var _0x48d173=typeof _0x5024c4[_0x3493('0x1b')]===_0x3493('0x1c')&&typeof _0x5024c4[_0x3493('0x1d')]===_0x3493('0x1c');var _0x23c5ab=_0x10f577[_0x3493('0x1e')];var _0x2a4138=_0x48d173?0x0:_0x5024c4[_0x3493('0x1b')];var _0x1b1fe8=_0x48d173?_0x10f577[_0x3493('0x1e')]:_0x5024c4[_0x3493('0x1b')]+_0x5024c4['limit'];var _0x2286c2;if(_0x1b1fe8>=_0x23c5ab){_0x1b1fe8=_0x23c5ab;_0x2286c2=0xc8;}else{_0x2286c2=0xce;}_0x1a825d[_0x3493('0x18')](_0x2286c2);return _0x1a825d[_0x3493('0x1f')](_0x3493('0x20'),_0x2a4138+'-'+_0x1b1fe8+'/'+_0x23c5ab)[_0x3493('0x1a')](_0x10f577);}return null;};}function patchUpdates(_0x322b73){return function(_0x4928b2){try{jsonpatch['apply'](_0x4928b2,_0x322b73,!![]);}catch(_0x1a63a0){return BPromise[_0x3493('0x21')](_0x1a63a0);}return _0x4928b2[_0x3493('0x22')]();};}function saveUpdates(_0x50060f,_0x477f05){return function(_0x231627){if(_0x231627){return _0x231627[_0x3493('0x23')](_0x50060f)[_0x3493('0x24')](function(_0x2c7012){return _0x2c7012;});}return null;};}function removeEntity(_0xa5d7d3,_0x4596a3){return function(_0x26a822){if(_0x26a822){return _0x26a822[_0x3493('0x25')]()[_0x3493('0x24')](function(){_0xa5d7d3['status'](0xcc)[_0x3493('0x19')]();});}};}function handleEntityNotFound(_0x2203f1,_0xbda59f){return function(_0xd5d2e6){if(!_0xd5d2e6){_0x2203f1[_0x3493('0x26')](0x194);}return _0xd5d2e6;};}function handleError(_0x57343c,_0x4c5e4a){_0x4c5e4a=_0x4c5e4a||0x1f4;return function(_0xe7ad36){logger[_0x3493('0x27')](_0xe7ad36[_0x3493('0x28')]);if(_0xe7ad36['name']){delete _0xe7ad36[_0x3493('0x29')];}_0x57343c['status'](_0x4c5e4a)[_0x3493('0x2a')](_0xe7ad36);};}exports[_0x3493('0x2b')]=function(_0x1e6ee8,_0x4b4331){var _0x42a06e={},_0x444304={},_0x43234f={'count':0x0,'rows':[]};var _0x3707a4=_[_0x3493('0x2c')](db['SmsQueueReport'][_0x3493('0x2d')],function(_0x46374a){return{'name':_0x46374a['fieldName'],'type':_0x46374a[_0x3493('0x2e')][_0x3493('0x2f')]};});_0x444304['model']=_[_0x3493('0x2c')](_0x3707a4,_0x3493('0x29'));_0x444304[_0x3493('0x30')]=_[_0x3493('0x31')](_0x1e6ee8[_0x3493('0x30')]);_0x444304[_0x3493('0x32')]=_['intersection'](_0x444304[_0x3493('0x33')],_0x444304[_0x3493('0x30')]);_0x42a06e[_0x3493('0x34')]=_['intersection'](_0x444304[_0x3493('0x33')],qs[_0x3493('0x35')](_0x1e6ee8[_0x3493('0x30')][_0x3493('0x35')]));_0x42a06e[_0x3493('0x34')]=_0x42a06e[_0x3493('0x34')][_0x3493('0x36')]?_0x42a06e[_0x3493('0x34')]:_0x444304['model'];if(!_0x1e6ee8[_0x3493('0x30')][_0x3493('0x37')]('nolimit')){_0x42a06e['limit']=qs[_0x3493('0x1d')](_0x1e6ee8[_0x3493('0x30')][_0x3493('0x1d')]);_0x42a06e['offset']=qs[_0x3493('0x1b')](_0x1e6ee8[_0x3493('0x30')]['offset']);}_0x42a06e[_0x3493('0x38')]=qs['sort'](_0x1e6ee8[_0x3493('0x30')][_0x3493('0x39')]);_0x42a06e['where']=qs[_0x3493('0x32')](_[_0x3493('0x3a')](_0x1e6ee8[_0x3493('0x30')],_0x444304['filters']),_0x3707a4);if(_0x1e6ee8['query']['filter']){_0x42a06e[_0x3493('0x3b')]=_[_0x3493('0x3c')](_0x42a06e[_0x3493('0x3b')],{'$or':_[_0x3493('0x2c')](_0x3707a4,function(_0x4255b3){if(_0x4255b3[_0x3493('0x2e')]!==_0x3493('0x3d')){var _0x1e8e6e={};_0x1e8e6e[_0x4255b3[_0x3493('0x29')]]={'$like':'%'+_0x1e6ee8[_0x3493('0x30')][_0x3493('0x3e')]+'%'};return _0x1e8e6e;}})});}_0x42a06e=_[_0x3493('0x3c')]({},_0x42a06e,_0x1e6ee8[_0x3493('0x3f')]);var _0xa73da3={'where':_0x42a06e[_0x3493('0x3b')]};return db[_0x3493('0x40')][_0x3493('0x1e')](_0xa73da3)['then'](function(_0x82646b){_0x43234f[_0x3493('0x1e')]=_0x82646b;if(_0x1e6ee8[_0x3493('0x30')]['includeAll']){_0x42a06e[_0x3493('0x41')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x3493('0x42')](_0x42a06e);})['then'](function(_0x3c3a43){_0x43234f['rows']=_0x3c3a43;return _0x43234f;})[_0x3493('0x24')](respondWithFilteredResult(_0x4b4331,_0x42a06e))[_0x3493('0x43')](handleError(_0x4b4331,null));};exports[_0x3493('0x44')]=function(_0x27437c,_0x59cbd2){var _0x31a764={'raw':!![],'where':{'id':_0x27437c[_0x3493('0x45')]['id']}},_0x51364a={};_0x51364a[_0x3493('0x33')]=_[_0x3493('0x31')](db[_0x3493('0x40')][_0x3493('0x2d')]);_0x51364a[_0x3493('0x30')]=_[_0x3493('0x31')](_0x27437c['query']);_0x51364a[_0x3493('0x32')]=_[_0x3493('0x46')](_0x51364a[_0x3493('0x33')],_0x51364a[_0x3493('0x30')]);_0x31a764['attributes']=_[_0x3493('0x46')](_0x51364a[_0x3493('0x33')],qs[_0x3493('0x35')](_0x27437c[_0x3493('0x30')]['fields']));_0x31a764['attributes']=_0x31a764['attributes']['length']?_0x31a764[_0x3493('0x34')]:_0x51364a[_0x3493('0x33')];if(_0x27437c[_0x3493('0x30')][_0x3493('0x47')]){_0x31a764[_0x3493('0x41')]=[{'all':!![]}];}_0x31a764=_[_0x3493('0x3c')]({},_0x31a764,_0x27437c['options']);return db[_0x3493('0x40')][_0x3493('0x48')](_0x31a764)[_0x3493('0x24')](handleEntityNotFound(_0x59cbd2,null))[_0x3493('0x24')](respondWithResult(_0x59cbd2,null))[_0x3493('0x43')](handleError(_0x59cbd2,null));};exports[_0x3493('0x49')]=function(_0xe6655e,_0xb67b62){return db['SmsQueueReport'][_0x3493('0x49')](_0xe6655e['body'],{})[_0x3493('0x24')](respondWithResult(_0xb67b62,0xc9))[_0x3493('0x43')](handleError(_0xb67b62,null));};exports[_0x3493('0x23')]=function(_0x539d48,_0x228e4a){if(_0x539d48[_0x3493('0x4a')]['id']){delete _0x539d48[_0x3493('0x4a')]['id'];}return db[_0x3493('0x40')]['find']({'where':{'id':_0x539d48[_0x3493('0x45')]['id']}})[_0x3493('0x24')](handleEntityNotFound(_0x228e4a,null))[_0x3493('0x24')](saveUpdates(_0x539d48['body'],null))[_0x3493('0x24')](respondWithResult(_0x228e4a,null))[_0x3493('0x43')](handleError(_0x228e4a,null));};exports['destroy']=function(_0x18a09e,_0x136e41){return db[_0x3493('0x40')][_0x3493('0x48')]({'where':{'id':_0x18a09e[_0x3493('0x45')]['id']}})[_0x3493('0x24')](handleEntityNotFound(_0x136e41,null))['then'](removeEntity(_0x136e41,null))['catch'](handleError(_0x136e41,null));};exports[_0x3493('0x4b')]=function(_0x579d26,_0x4acfd9){return db[_0x3493('0x40')][_0x3493('0x4b')]()[_0x3493('0x24')](respondWithResult(_0x4acfd9,null))[_0x3493('0x43')](handleError(_0x4acfd9,null));}; \ No newline at end of file +var _0xf9d4=['map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','error','stack','name','send','index'];(function(_0x15c8b7,_0x39bdb4){var _0xaadd9b=function(_0x20edb8){while(--_0x20edb8){_0x15c8b7['push'](_0x15c8b7['shift']());}};_0xaadd9b(++_0x39bdb4);}(_0xf9d4,0x16a));var _0x4f9d=function(_0x4736c4,_0x2f7c1a){_0x4736c4=_0x4736c4-0x0;var _0x4264ab=_0xf9d4[_0x4736c4];return _0x4264ab;};'use strict';var emlformat=require(_0x4f9d('0x0'));var rimraf=require(_0x4f9d('0x1'));var zipdir=require(_0x4f9d('0x2'));var jsonpatch=require(_0x4f9d('0x3'));var rp=require(_0x4f9d('0x4'));var moment=require(_0x4f9d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4f9d('0x6'));var util=require(_0x4f9d('0x7'));var path=require(_0x4f9d('0x8'));var sox=require(_0x4f9d('0x9'));var csv=require('to-csv');var ejs=require(_0x4f9d('0xa'));var fs=require('fs');var fs_extra=require(_0x4f9d('0xb'));var _=require(_0x4f9d('0xc'));var squel=require(_0x4f9d('0xd'));var crypto=require(_0x4f9d('0xe'));var jsforce=require(_0x4f9d('0xf'));var deskjs=require(_0x4f9d('0x10'));var toCsv=require(_0x4f9d('0x11'));var querystring=require(_0x4f9d('0x12'));var Papa=require(_0x4f9d('0x13'));var Redis=require('ioredis');var authService=require(_0x4f9d('0x14'));var qs=require(_0x4f9d('0x15'));var as=require(_0x4f9d('0x16'));var hardwareService=require(_0x4f9d('0x17'));var logger=require(_0x4f9d('0x18'))(_0x4f9d('0x19'));var utils=require(_0x4f9d('0x1a'));var config=require(_0x4f9d('0x1b'));var licenseUtil=require(_0x4f9d('0x1c'));var db=require(_0x4f9d('0x1d'))['db'];function respondWithStatusCode(_0x345a8f,_0x5e650c){_0x5e650c=_0x5e650c||0xcc;return function(_0x43761a){if(_0x43761a){return _0x345a8f[_0x4f9d('0x1e')](_0x5e650c);}return _0x345a8f[_0x4f9d('0x1f')](_0x5e650c)[_0x4f9d('0x20')]();};}function respondWithResult(_0x2138cb,_0xe81707){_0xe81707=_0xe81707||0xc8;return function(_0x5cc508){if(_0x5cc508){return _0x2138cb[_0x4f9d('0x1f')](_0xe81707)[_0x4f9d('0x21')](_0x5cc508);}};}function respondWithFilteredResult(_0x355102,_0x45d970){return function(_0x53c627){if(_0x53c627){var _0x22b9cf=typeof _0x45d970[_0x4f9d('0x22')]===_0x4f9d('0x23')&&typeof _0x45d970[_0x4f9d('0x24')]===_0x4f9d('0x23');var _0x18a96d=_0x53c627['count'];var _0x13d584=_0x22b9cf?0x0:_0x45d970[_0x4f9d('0x22')];var _0x173c13=_0x22b9cf?_0x53c627[_0x4f9d('0x25')]:_0x45d970[_0x4f9d('0x22')]+_0x45d970[_0x4f9d('0x24')];var _0x137dee;if(_0x173c13>=_0x18a96d){_0x173c13=_0x18a96d;_0x137dee=0xc8;}else{_0x137dee=0xce;}_0x355102['status'](_0x137dee);return _0x355102[_0x4f9d('0x26')](_0x4f9d('0x27'),_0x13d584+'-'+_0x173c13+'/'+_0x18a96d)['json'](_0x53c627);}return null;};}function patchUpdates(_0x3af6a2){return function(_0x21f55c){try{jsonpatch['apply'](_0x21f55c,_0x3af6a2,!![]);}catch(_0x14ff97){return BPromise[_0x4f9d('0x28')](_0x14ff97);}return _0x21f55c['save']();};}function saveUpdates(_0x3d0f5c,_0x4229fd){return function(_0x412793){if(_0x412793){return _0x412793[_0x4f9d('0x29')](_0x3d0f5c)[_0x4f9d('0x2a')](function(_0x3e40ce){return _0x3e40ce;});}return null;};}function removeEntity(_0x3e0842,_0x3bec31){return function(_0x147f94){if(_0x147f94){return _0x147f94['destroy']()[_0x4f9d('0x2a')](function(){_0x3e0842[_0x4f9d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x358c0d,_0x1b109b){return function(_0x25e9e3){if(!_0x25e9e3){_0x358c0d[_0x4f9d('0x1e')](0x194);}return _0x25e9e3;};}function handleError(_0x50e835,_0xd76c43){_0xd76c43=_0xd76c43||0x1f4;return function(_0x5993b5){logger[_0x4f9d('0x2b')](_0x5993b5[_0x4f9d('0x2c')]);if(_0x5993b5[_0x4f9d('0x2d')]){delete _0x5993b5['name'];}_0x50e835[_0x4f9d('0x1f')](_0xd76c43)[_0x4f9d('0x2e')](_0x5993b5);};}exports[_0x4f9d('0x2f')]=function(_0x59a917,_0x226be9){var _0x505d65={},_0x5a6fb5={},_0xf02d64={'count':0x0,'rows':[]};var _0x2df519=_[_0x4f9d('0x30')](db[_0x4f9d('0x31')][_0x4f9d('0x32')],function(_0x557bfa){return{'name':_0x557bfa[_0x4f9d('0x33')],'type':_0x557bfa[_0x4f9d('0x34')][_0x4f9d('0x35')]};});_0x5a6fb5[_0x4f9d('0x36')]=_[_0x4f9d('0x30')](_0x2df519,_0x4f9d('0x2d'));_0x5a6fb5[_0x4f9d('0x37')]=_[_0x4f9d('0x38')](_0x59a917[_0x4f9d('0x37')]);_0x5a6fb5[_0x4f9d('0x39')]=_['intersection'](_0x5a6fb5[_0x4f9d('0x36')],_0x5a6fb5[_0x4f9d('0x37')]);_0x505d65['attributes']=_[_0x4f9d('0x3a')](_0x5a6fb5[_0x4f9d('0x36')],qs['fields'](_0x59a917['query'][_0x4f9d('0x3b')]));_0x505d65[_0x4f9d('0x3c')]=_0x505d65[_0x4f9d('0x3c')]['length']?_0x505d65[_0x4f9d('0x3c')]:_0x5a6fb5['model'];if(!_0x59a917[_0x4f9d('0x37')]['hasOwnProperty'](_0x4f9d('0x3d'))){_0x505d65[_0x4f9d('0x24')]=qs[_0x4f9d('0x24')](_0x59a917['query']['limit']);_0x505d65[_0x4f9d('0x22')]=qs['offset'](_0x59a917['query'][_0x4f9d('0x22')]);}_0x505d65[_0x4f9d('0x3e')]=qs['sort'](_0x59a917['query'][_0x4f9d('0x3f')]);_0x505d65[_0x4f9d('0x40')]=qs[_0x4f9d('0x39')](_[_0x4f9d('0x41')](_0x59a917['query'],_0x5a6fb5[_0x4f9d('0x39')]),_0x2df519);if(_0x59a917[_0x4f9d('0x37')][_0x4f9d('0x42')]){_0x505d65[_0x4f9d('0x40')]=_[_0x4f9d('0x43')](_0x505d65['where'],{'$or':_[_0x4f9d('0x30')](_0x2df519,function(_0x8113ee){if(_0x8113ee[_0x4f9d('0x34')]!=='VIRTUAL'){var _0x25b930={};_0x25b930[_0x8113ee[_0x4f9d('0x2d')]]={'$like':'%'+_0x59a917[_0x4f9d('0x37')][_0x4f9d('0x42')]+'%'};return _0x25b930;}})});}_0x505d65=_['merge']({},_0x505d65,_0x59a917[_0x4f9d('0x44')]);var _0x284249={'where':_0x505d65[_0x4f9d('0x40')]};return db[_0x4f9d('0x31')][_0x4f9d('0x25')](_0x284249)[_0x4f9d('0x2a')](function(_0x172d9f){_0xf02d64['count']=_0x172d9f;if(_0x59a917[_0x4f9d('0x37')][_0x4f9d('0x45')]){_0x505d65[_0x4f9d('0x46')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x4f9d('0x47')](_0x505d65);})['then'](function(_0x33ff74){_0xf02d64[_0x4f9d('0x48')]=_0x33ff74;return _0xf02d64;})[_0x4f9d('0x2a')](respondWithFilteredResult(_0x226be9,_0x505d65))[_0x4f9d('0x49')](handleError(_0x226be9,null));};exports[_0x4f9d('0x4a')]=function(_0x35cd7b,_0x2c1fbb){var _0x3959be={'raw':!![],'where':{'id':_0x35cd7b[_0x4f9d('0x4b')]['id']}},_0x311a77={};_0x311a77[_0x4f9d('0x36')]=_[_0x4f9d('0x38')](db[_0x4f9d('0x31')]['rawAttributes']);_0x311a77[_0x4f9d('0x37')]=_[_0x4f9d('0x38')](_0x35cd7b[_0x4f9d('0x37')]);_0x311a77[_0x4f9d('0x39')]=_[_0x4f9d('0x3a')](_0x311a77['model'],_0x311a77['query']);_0x3959be['attributes']=_[_0x4f9d('0x3a')](_0x311a77['model'],qs[_0x4f9d('0x3b')](_0x35cd7b[_0x4f9d('0x37')][_0x4f9d('0x3b')]));_0x3959be[_0x4f9d('0x3c')]=_0x3959be['attributes'][_0x4f9d('0x4c')]?_0x3959be[_0x4f9d('0x3c')]:_0x311a77[_0x4f9d('0x36')];if(_0x35cd7b[_0x4f9d('0x37')]['includeAll']){_0x3959be['include']=[{'all':!![]}];}_0x3959be=_[_0x4f9d('0x43')]({},_0x3959be,_0x35cd7b[_0x4f9d('0x44')]);return db['SmsQueueReport']['find'](_0x3959be)[_0x4f9d('0x2a')](handleEntityNotFound(_0x2c1fbb,null))[_0x4f9d('0x2a')](respondWithResult(_0x2c1fbb,null))[_0x4f9d('0x49')](handleError(_0x2c1fbb,null));};exports[_0x4f9d('0x4d')]=function(_0x40696c,_0x2194cd){return db[_0x4f9d('0x31')][_0x4f9d('0x4d')](_0x40696c[_0x4f9d('0x4e')],{})[_0x4f9d('0x2a')](respondWithResult(_0x2194cd,0xc9))['catch'](handleError(_0x2194cd,null));};exports[_0x4f9d('0x29')]=function(_0x3aaf65,_0x96723f){if(_0x3aaf65['body']['id']){delete _0x3aaf65[_0x4f9d('0x4e')]['id'];}return db[_0x4f9d('0x31')]['find']({'where':{'id':_0x3aaf65[_0x4f9d('0x4b')]['id']}})[_0x4f9d('0x2a')](handleEntityNotFound(_0x96723f,null))[_0x4f9d('0x2a')](saveUpdates(_0x3aaf65[_0x4f9d('0x4e')],null))[_0x4f9d('0x2a')](respondWithResult(_0x96723f,null))[_0x4f9d('0x49')](handleError(_0x96723f,null));};exports[_0x4f9d('0x4f')]=function(_0xa7b06f,_0x43afd3){return db['SmsQueueReport'][_0x4f9d('0x50')]({'where':{'id':_0xa7b06f[_0x4f9d('0x4b')]['id']}})[_0x4f9d('0x2a')](handleEntityNotFound(_0x43afd3,null))[_0x4f9d('0x2a')](removeEntity(_0x43afd3,null))[_0x4f9d('0x49')](handleError(_0x43afd3,null));};exports[_0x4f9d('0x51')]=function(_0x538862,_0x247f46){return db[_0x4f9d('0x31')][_0x4f9d('0x51')]()[_0x4f9d('0x2a')](respondWithResult(_0x247f46,null))[_0x4f9d('0x49')](handleError(_0x247f46,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index b8770ce..c70fa00 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 _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x51d5da,_0x478c36){var _0x3f4838=function(_0x2d4fd5){while(--_0x2d4fd5){_0x51d5da['push'](_0x51d5da['shift']());}};_0x3f4838(++_0x478c36);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index b7ccfb5..1064b18 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 _0x28c5=['limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','CreateSmsQueueReport','SmsQueueReport','body','options','info','catch','UpdateSmsQueueReport','raw','where','attributes'];(function(_0x4586f9,_0x39aee8){var _0x41d034=function(_0x31002c){while(--_0x31002c){_0x4586f9['push'](_0x4586f9['shift']());}};_0x41d034(++_0x39aee8);}(_0x28c5,0x197));var _0x528c=function(_0x159650,_0x3dc560){_0x159650=_0x159650-0x0;var _0x345810=_0x28c5[_0x159650];return _0x345810;};'use strict';var _=require(_0x528c('0x0'));var util=require(_0x528c('0x1'));var moment=require('moment');var BPromise=require(_0x528c('0x2'));var rs=require(_0x528c('0x3'));var fs=require('fs');var Redis=require(_0x528c('0x4'));var db=require(_0x528c('0x5'))['db'];var utils=require(_0x528c('0x6'));var logger=require(_0x528c('0x7'))(_0x528c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x528c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ceee0,_0x86b805,_0x5d7d9b){return new BPromise(function(_0x4c8dc0,_0x4b8b48){return client['request'](_0x4ceee0,_0x5d7d9b)[_0x528c('0xa')](function(_0x49b1ef){logger['info'](_0x528c('0xb'),_0x86b805,_0x528c('0xc'));logger[_0x528c('0xd')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x86b805,_0x528c('0xc'),JSON[_0x528c('0xe')](_0x49b1ef));if(_0x49b1ef[_0x528c('0xf')]){if(_0x49b1ef[_0x528c('0xf')][_0x528c('0x10')]===0x1f4){logger[_0x528c('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x86b805,_0x49b1ef[_0x528c('0xf')][_0x528c('0x11')]);return _0x4b8b48(_0x49b1ef['error'][_0x528c('0x11')]);}logger[_0x528c('0xf')](_0x528c('0xb'),_0x86b805,_0x49b1ef[_0x528c('0xf')]['message']);return _0x4c8dc0(_0x49b1ef[_0x528c('0xf')][_0x528c('0x11')]);}else{logger['info'](_0x528c('0xb'),_0x86b805,_0x528c('0xc'));_0x4c8dc0(_0x49b1ef['result'][_0x528c('0x11')]);}})['catch'](function(_0x26383b){logger['error'](_0x528c('0xb'),_0x86b805,_0x26383b);_0x4b8b48(_0x26383b);});});}exports[_0x528c('0x12')]=function(_0x410649){var _0x2472ed=this;return new Promise(function(_0x5aa13d,_0x141a67){return db[_0x528c('0x13')]['create'](_0x410649[_0x528c('0x14')],{'raw':_0x410649['options']?_0x410649[_0x528c('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5e05a5){logger[_0x528c('0x16')](_0x528c('0x12'),_0x410649);logger[_0x528c('0xd')](_0x528c('0x12'),_0x410649,JSON[_0x528c('0xe')](_0x5e05a5));_0x5aa13d(_0x5e05a5);})[_0x528c('0x17')](function(_0xdd1c6f){logger[_0x528c('0xf')](_0x528c('0x12'),_0xdd1c6f[_0x528c('0x11')],_0x410649);_0x141a67(_0x2472ed[_0x528c('0xf')](0x1f4,_0xdd1c6f[_0x528c('0x11')]));});});};exports[_0x528c('0x18')]=function(_0x3d6c97){var _0x4fb071=this;return new Promise(function(_0x4591e3,_0x12e668){return db['SmsQueueReport']['update'](_0x3d6c97[_0x528c('0x14')],{'raw':_0x3d6c97['options']?_0x3d6c97[_0x528c('0x15')][_0x528c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d6c97[_0x528c('0x15')]?_0x3d6c97[_0x528c('0x15')][_0x528c('0x1a')]||null:null,'attributes':_0x3d6c97[_0x528c('0x15')]?_0x3d6c97[_0x528c('0x15')][_0x528c('0x1b')]||null:null,'limit':_0x3d6c97[_0x528c('0x15')]?_0x3d6c97[_0x528c('0x15')][_0x528c('0x1c')]||null:null})[_0x528c('0xa')](function(_0x2a74ff){logger[_0x528c('0x16')](_0x528c('0x18'),_0x3d6c97);logger[_0x528c('0xd')]('UpdateSmsQueueReport',_0x3d6c97,JSON['stringify'](_0x2a74ff));_0x4591e3(_0x2a74ff);})[_0x528c('0x17')](function(_0x283a06){logger[_0x528c('0xf')](_0x528c('0x18'),_0x283a06[_0x528c('0x11')],_0x3d6c97);_0x12e668(_0x4fb071[_0x528c('0xf')](0x1f4,_0x283a06[_0x528c('0x11')]));});});}; \ No newline at end of file +var _0xaa0f=['raw','where','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','client','http','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','CreateSmsQueueReport','body','options','catch','UpdateSmsQueueReport','SmsQueueReport','update'];(function(_0x3eff40,_0x1cdf9e){var _0x4ee4fb=function(_0x4b7170){while(--_0x4b7170){_0x3eff40['push'](_0x3eff40['shift']());}};_0x4ee4fb(++_0x1cdf9e);}(_0xaa0f,0x7c));var _0xfaa0=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xaa0f[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require('lodash');var util=require(_0xfaa0('0x0'));var moment=require(_0xfaa0('0x1'));var BPromise=require(_0xfaa0('0x2'));var rs=require(_0xfaa0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfaa0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfaa0('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfaa0('0x6')][_0xfaa0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xe61217,_0x3f4c92,_0x521e73){return new BPromise(function(_0x5ef308,_0x290f1a){return client['request'](_0xe61217,_0x521e73)[_0xfaa0('0x8')](function(_0x23657c){logger[_0xfaa0('0x9')](_0xfaa0('0xa'),_0x3f4c92,_0xfaa0('0xb'));logger[_0xfaa0('0xc')](_0xfaa0('0xd'),_0x3f4c92,'request\x20sent',JSON[_0xfaa0('0xe')](_0x23657c));if(_0x23657c['error']){if(_0x23657c['error'][_0xfaa0('0xf')]===0x1f4){logger[_0xfaa0('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x3f4c92,_0x23657c['error'][_0xfaa0('0x11')]);return _0x290f1a(_0x23657c[_0xfaa0('0x10')][_0xfaa0('0x11')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x3f4c92,_0x23657c['error'][_0xfaa0('0x11')]);return _0x5ef308(_0x23657c[_0xfaa0('0x10')][_0xfaa0('0x11')]);}else{logger[_0xfaa0('0x9')](_0xfaa0('0xa'),_0x3f4c92,_0xfaa0('0xb'));_0x5ef308(_0x23657c[_0xfaa0('0x12')][_0xfaa0('0x11')]);}})['catch'](function(_0x40e1b3){logger['error'](_0xfaa0('0xa'),_0x3f4c92,_0x40e1b3);_0x290f1a(_0x40e1b3);});});}exports[_0xfaa0('0x13')]=function(_0x2281f9){var _0x113c90=this;return new Promise(function(_0x21b0ab,_0x46979c){return db['SmsQueueReport']['create'](_0x2281f9[_0xfaa0('0x14')],{'raw':_0x2281f9['options']?_0x2281f9[_0xfaa0('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xfaa0('0x8')](function(_0x9be4c5){logger[_0xfaa0('0x9')](_0xfaa0('0x13'),_0x2281f9);logger[_0xfaa0('0xc')](_0xfaa0('0x13'),_0x2281f9,JSON[_0xfaa0('0xe')](_0x9be4c5));_0x21b0ab(_0x9be4c5);})[_0xfaa0('0x16')](function(_0x4bc1da){logger['error']('CreateSmsQueueReport',_0x4bc1da['message'],_0x2281f9);_0x46979c(_0x113c90[_0xfaa0('0x10')](0x1f4,_0x4bc1da['message']));});});};exports[_0xfaa0('0x17')]=function(_0x54d70f){var _0x4f30c9=this;return new Promise(function(_0x1e1889,_0x19889b){return db[_0xfaa0('0x18')][_0xfaa0('0x19')](_0x54d70f[_0xfaa0('0x14')],{'raw':_0x54d70f[_0xfaa0('0x15')]?_0x54d70f[_0xfaa0('0x15')][_0xfaa0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54d70f['options']?_0x54d70f[_0xfaa0('0x15')][_0xfaa0('0x1b')]||null:null,'attributes':_0x54d70f[_0xfaa0('0x15')]?_0x54d70f[_0xfaa0('0x15')][_0xfaa0('0x1c')]||null:null,'limit':_0x54d70f['options']?_0x54d70f['options'][_0xfaa0('0x1d')]||null:null})[_0xfaa0('0x8')](function(_0x2d7ea4){logger[_0xfaa0('0x9')](_0xfaa0('0x17'),_0x54d70f);logger[_0xfaa0('0xc')](_0xfaa0('0x17'),_0x54d70f,JSON[_0xfaa0('0xe')](_0x2d7ea4));_0x1e1889(_0x2d7ea4);})[_0xfaa0('0x16')](function(_0x476e77){logger[_0xfaa0('0x10')](_0xfaa0('0x17'),_0x476e77[_0xfaa0('0x11')],_0x54d70f);_0x19889b(_0x4f30c9[_0xfaa0('0x10')](0x1f4,_0x476e77[_0xfaa0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index d5e432e..94f0c1a 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 _0x23f4=['exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','put','update','destroy'];(function(_0x4dba4d,_0x17d11f){var _0x2c11a6=function(_0x1b6d9c){while(--_0x1b6d9c){_0x4dba4d['push'](_0x4dba4d['shift']());}};_0x2c11a6(++_0x17d11f);}(_0x23f4,0x1ee));var _0x423f=function(_0x56cd6d,_0x6b7863){_0x56cd6d=_0x56cd6d-0x0;var _0x5103b4=_0x23f4[_0x56cd6d];return _0x5103b4;};'use strict';var multer=require('multer');var util=require(_0x423f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x423f('0x1'));var router=express[_0x423f('0x2')]();var fs_extra=require(_0x423f('0x3'));var auth=require(_0x423f('0x4'));var interaction=require(_0x423f('0x5'));var config=require(_0x423f('0x6'));var controller=require(_0x423f('0x7'));router[_0x423f('0x8')]('/',auth[_0x423f('0x9')](),controller['index']);router[_0x423f('0x8')](_0x423f('0xa'),auth['isAuthenticated'](),controller[_0x423f('0xb')]);router[_0x423f('0x8')](_0x423f('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x423f('0x9')](),controller['create']);router[_0x423f('0xd')](_0x423f('0xc'),auth[_0x423f('0x9')](),controller[_0x423f('0xe')]);router['delete'](_0x423f('0xc'),auth[_0x423f('0x9')](),controller[_0x423f('0xf')]);module[_0x423f('0x10')]=router; \ No newline at end of file +var _0x90b5=['/describe','describe','/:id','show','post','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x5c3cec,_0x42659f){var _0x3c4f65=function(_0x3e92e7){while(--_0x3e92e7){_0x5c3cec['push'](_0x5c3cec['shift']());}};_0x3c4f65(++_0x42659f);}(_0x90b5,0x139));var _0x590b=function(_0x5151ab,_0x5d0dd9){_0x5151ab=_0x5151ab-0x0;var _0x5b6c0a=_0x90b5[_0x5151ab];return _0x5b6c0a;};'use strict';var multer=require(_0x590b('0x0'));var util=require('util');var path=require(_0x590b('0x1'));var timeout=require(_0x590b('0x2'));var express=require(_0x590b('0x3'));var router=express[_0x590b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x590b('0x5'));var config=require(_0x590b('0x6'));var controller=require('./smsTransferReport.controller');router[_0x590b('0x7')]('/',auth[_0x590b('0x8')](),controller[_0x590b('0x9')]);router['get'](_0x590b('0xa'),auth[_0x590b('0x8')](),controller[_0x590b('0xb')]);router[_0x590b('0x7')](_0x590b('0xc'),auth[_0x590b('0x8')](),controller[_0x590b('0xd')]);router[_0x590b('0xe')]('/',auth[_0x590b('0x8')](),controller['create']);router[_0x590b('0xf')](_0x590b('0xc'),auth['isAuthenticated'](),controller[_0x590b('0x10')]);router['delete'](_0x590b('0xc'),auth[_0x590b('0x8')](),controller[_0x590b('0x11')]);module[_0x590b('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 4dcd68f..e6de908 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x1ac562,_0x270a2d){var _0x483610=function(_0x1eb389){while(--_0x1eb389){_0x1ac562['push'](_0x1ac562['shift']());}};_0x483610(++_0x270a2d);}(_0x54ef,0x112));var _0xf54e=function(_0x43fec9,_0x3b2637){_0x43fec9=_0x43fec9-0x0;var _0x3b62c8=_0x54ef[_0x43fec9];return _0x3b62c8;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0xf32c6d,_0x372704){var _0x156c11=function(_0x34ef76){while(--_0x34ef76){_0xf32c6d['push'](_0xf32c6d['shift']());}};_0x156c11(++_0x372704);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 074f2fd..2ce1c08 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 _0xce31=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','error','name','send','index','fieldName','type','model','map','keys','intersection','query','attributes','fields','nolimit','sort','filters','pick','merge','options','where','SmsTransferReport','include','findAll','catch','params','length','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce31,0x1d5));var _0x1ce3=function(_0x13527c,_0x11137d){_0x13527c=_0x13527c-0x0;var _0x280a24=_0xce31[_0x13527c];return _0x280a24;};'use strict';var emlformat=require(_0x1ce3('0x0'));var rimraf=require(_0x1ce3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1ce3('0x2'));var rp=require(_0x1ce3('0x3'));var moment=require(_0x1ce3('0x4'));var BPromise=require(_0x1ce3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1ce3('0x6'));var sox=require(_0x1ce3('0x7'));var csv=require('to-csv');var ejs=require(_0x1ce3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1ce3('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1ce3('0xa'));var deskjs=require(_0x1ce3('0xb'));var toCsv=require(_0x1ce3('0xc'));var querystring=require(_0x1ce3('0xd'));var Papa=require(_0x1ce3('0xe'));var Redis=require(_0x1ce3('0xf'));var authService=require(_0x1ce3('0x10'));var qs=require(_0x1ce3('0x11'));var as=require(_0x1ce3('0x12'));var hardwareService=require(_0x1ce3('0x13'));var logger=require(_0x1ce3('0x14'))(_0x1ce3('0x15'));var utils=require(_0x1ce3('0x16'));var config=require(_0x1ce3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ce3('0x18'))['db'];function respondWithStatusCode(_0x1fef40,_0x127520){_0x127520=_0x127520||0xcc;return function(_0x10a860){if(_0x10a860){return _0x1fef40[_0x1ce3('0x19')](_0x127520);}return _0x1fef40['status'](_0x127520)[_0x1ce3('0x1a')]();};}function respondWithResult(_0x99ef18,_0x40a682){_0x40a682=_0x40a682||0xc8;return function(_0xf271a6){if(_0xf271a6){return _0x99ef18[_0x1ce3('0x1b')](_0x40a682)[_0x1ce3('0x1c')](_0xf271a6);}};}function respondWithFilteredResult(_0x3a9a6e,_0x578bd0){return function(_0x338edd){if(_0x338edd){var _0x2a1a9c=typeof _0x578bd0[_0x1ce3('0x1d')]===_0x1ce3('0x1e')&&typeof _0x578bd0['limit']===_0x1ce3('0x1e');var _0x17e2cb=_0x338edd[_0x1ce3('0x1f')];var _0x4e23ca=_0x2a1a9c?0x0:_0x578bd0[_0x1ce3('0x1d')];var _0x1b590d=_0x2a1a9c?_0x338edd['count']:_0x578bd0['offset']+_0x578bd0[_0x1ce3('0x20')];var _0x56f854;if(_0x1b590d>=_0x17e2cb){_0x1b590d=_0x17e2cb;_0x56f854=0xc8;}else{_0x56f854=0xce;}_0x3a9a6e[_0x1ce3('0x1b')](_0x56f854);return _0x3a9a6e['set'](_0x1ce3('0x21'),_0x4e23ca+'-'+_0x1b590d+'/'+_0x17e2cb)['json'](_0x338edd);}return null;};}function patchUpdates(_0xa3a1c9){return function(_0x271b89){try{jsonpatch[_0x1ce3('0x22')](_0x271b89,_0xa3a1c9,!![]);}catch(_0x43e749){return BPromise[_0x1ce3('0x23')](_0x43e749);}return _0x271b89['save']();};}function saveUpdates(_0x112a73,_0x1315cc){return function(_0x5c8ada){if(_0x5c8ada){return _0x5c8ada[_0x1ce3('0x24')](_0x112a73)[_0x1ce3('0x25')](function(_0x2caa7a){return _0x2caa7a;});}return null;};}function removeEntity(_0xd5ebe9,_0x33e92a){return function(_0x29a68e){if(_0x29a68e){return _0x29a68e[_0x1ce3('0x26')]()[_0x1ce3('0x25')](function(){_0xd5ebe9[_0x1ce3('0x1b')](0xcc)[_0x1ce3('0x1a')]();});}};}function handleEntityNotFound(_0x75374c,_0x662abe){return function(_0x27131c){if(!_0x27131c){_0x75374c[_0x1ce3('0x19')](0x194);}return _0x27131c;};}function handleError(_0xefe88d,_0x501993){_0x501993=_0x501993||0x1f4;return function(_0x40273f){logger[_0x1ce3('0x27')](_0x40273f['stack']);if(_0x40273f[_0x1ce3('0x28')]){delete _0x40273f[_0x1ce3('0x28')];}_0xefe88d[_0x1ce3('0x1b')](_0x501993)[_0x1ce3('0x29')](_0x40273f);};}exports[_0x1ce3('0x2a')]=function(_0x18bc98,_0x4659e9){var _0x429cab={},_0x3e4b6e={},_0x25482d={'count':0x0,'rows':[]};var _0x7637fe=_['map'](db['SmsTransferReport']['rawAttributes'],function(_0x39e4a8){return{'name':_0x39e4a8[_0x1ce3('0x2b')],'type':_0x39e4a8[_0x1ce3('0x2c')]['key']};});_0x3e4b6e[_0x1ce3('0x2d')]=_[_0x1ce3('0x2e')](_0x7637fe,_0x1ce3('0x28'));_0x3e4b6e['query']=_[_0x1ce3('0x2f')](_0x18bc98['query']);_0x3e4b6e['filters']=_[_0x1ce3('0x30')](_0x3e4b6e[_0x1ce3('0x2d')],_0x3e4b6e[_0x1ce3('0x31')]);_0x429cab[_0x1ce3('0x32')]=_['intersection'](_0x3e4b6e[_0x1ce3('0x2d')],qs['fields'](_0x18bc98[_0x1ce3('0x31')][_0x1ce3('0x33')]));_0x429cab[_0x1ce3('0x32')]=_0x429cab['attributes']['length']?_0x429cab[_0x1ce3('0x32')]:_0x3e4b6e['model'];if(!_0x18bc98[_0x1ce3('0x31')]['hasOwnProperty'](_0x1ce3('0x34'))){_0x429cab[_0x1ce3('0x20')]=qs[_0x1ce3('0x20')](_0x18bc98['query']['limit']);_0x429cab[_0x1ce3('0x1d')]=qs[_0x1ce3('0x1d')](_0x18bc98[_0x1ce3('0x31')][_0x1ce3('0x1d')]);}_0x429cab['order']=qs[_0x1ce3('0x35')](_0x18bc98[_0x1ce3('0x31')]['sort']);_0x429cab['where']=qs[_0x1ce3('0x36')](_[_0x1ce3('0x37')](_0x18bc98[_0x1ce3('0x31')],_0x3e4b6e[_0x1ce3('0x36')]),_0x7637fe);if(_0x18bc98[_0x1ce3('0x31')]['filter']){_0x429cab['where']=_[_0x1ce3('0x38')](_0x429cab['where'],{'$or':_[_0x1ce3('0x2e')](_0x7637fe,function(_0x407a41){if(_0x407a41['type']!=='VIRTUAL'){var _0x58435b={};_0x58435b[_0x407a41[_0x1ce3('0x28')]]={'$like':'%'+_0x18bc98[_0x1ce3('0x31')]['filter']+'%'};return _0x58435b;}})});}_0x429cab=_['merge']({},_0x429cab,_0x18bc98[_0x1ce3('0x39')]);var _0x562626={'where':_0x429cab[_0x1ce3('0x3a')]};return db[_0x1ce3('0x3b')]['count'](_0x562626)[_0x1ce3('0x25')](function(_0x146819){_0x25482d['count']=_0x146819;if(_0x18bc98[_0x1ce3('0x31')]['includeAll']){_0x429cab[_0x1ce3('0x3c')]=[{'all':!![]}];}return db[_0x1ce3('0x3b')][_0x1ce3('0x3d')](_0x429cab);})['then'](function(_0x497161){_0x25482d['rows']=_0x497161;return _0x25482d;})[_0x1ce3('0x25')](respondWithFilteredResult(_0x4659e9,_0x429cab))[_0x1ce3('0x3e')](handleError(_0x4659e9,null));};exports['show']=function(_0x4e4760,_0x3f1e6d){var _0xa9170a={'raw':!![],'where':{'id':_0x4e4760[_0x1ce3('0x3f')]['id']}},_0x286813={};_0x286813[_0x1ce3('0x2d')]=_[_0x1ce3('0x2f')](db[_0x1ce3('0x3b')]['rawAttributes']);_0x286813[_0x1ce3('0x31')]=_['keys'](_0x4e4760[_0x1ce3('0x31')]);_0x286813['filters']=_[_0x1ce3('0x30')](_0x286813['model'],_0x286813[_0x1ce3('0x31')]);_0xa9170a[_0x1ce3('0x32')]=_[_0x1ce3('0x30')](_0x286813[_0x1ce3('0x2d')],qs[_0x1ce3('0x33')](_0x4e4760[_0x1ce3('0x31')][_0x1ce3('0x33')]));_0xa9170a[_0x1ce3('0x32')]=_0xa9170a[_0x1ce3('0x32')][_0x1ce3('0x40')]?_0xa9170a[_0x1ce3('0x32')]:_0x286813[_0x1ce3('0x2d')];if(_0x4e4760[_0x1ce3('0x31')][_0x1ce3('0x41')]){_0xa9170a[_0x1ce3('0x3c')]=[{'all':!![]}];}_0xa9170a=_[_0x1ce3('0x38')]({},_0xa9170a,_0x4e4760['options']);return db[_0x1ce3('0x3b')][_0x1ce3('0x42')](_0xa9170a)[_0x1ce3('0x25')](handleEntityNotFound(_0x3f1e6d,null))[_0x1ce3('0x25')](respondWithResult(_0x3f1e6d,null))[_0x1ce3('0x3e')](handleError(_0x3f1e6d,null));};exports[_0x1ce3('0x43')]=function(_0x5c2137,_0x41ffe7){return db[_0x1ce3('0x3b')][_0x1ce3('0x43')](_0x5c2137[_0x1ce3('0x44')],{})[_0x1ce3('0x25')](respondWithResult(_0x41ffe7,0xc9))[_0x1ce3('0x3e')](handleError(_0x41ffe7,null));};exports[_0x1ce3('0x24')]=function(_0x2a9e18,_0x4e5301){if(_0x2a9e18[_0x1ce3('0x44')]['id']){delete _0x2a9e18['body']['id'];}return db['SmsTransferReport'][_0x1ce3('0x42')]({'where':{'id':_0x2a9e18[_0x1ce3('0x3f')]['id']}})[_0x1ce3('0x25')](handleEntityNotFound(_0x4e5301,null))[_0x1ce3('0x25')](saveUpdates(_0x2a9e18['body'],null))[_0x1ce3('0x25')](respondWithResult(_0x4e5301,null))[_0x1ce3('0x3e')](handleError(_0x4e5301,null));};exports[_0x1ce3('0x26')]=function(_0x413537,_0x5ac7f1){return db['SmsTransferReport']['find']({'where':{'id':_0x413537[_0x1ce3('0x3f')]['id']}})[_0x1ce3('0x25')](handleEntityNotFound(_0x5ac7f1,null))[_0x1ce3('0x25')](removeEntity(_0x5ac7f1,null))[_0x1ce3('0x3e')](handleError(_0x5ac7f1,null));};exports[_0x1ce3('0x45')]=function(_0x3d2eed,_0x4184c3){return db[_0x1ce3('0x3b')][_0x1ce3('0x45')]()[_0x1ce3('0x25')](respondWithResult(_0x4184c3,null))[_0x1ce3('0x3e')](handleError(_0x4184c3,null));}; \ No newline at end of file +var _0xea81=['includeAll','options','find','catch','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','merge','type','VIRTUAL','filter','SmsTransferReport','include','findAll','length'];(function(_0x2bf57c,_0x4563b2){var _0x28a61f=function(_0x47ef0a){while(--_0x47ef0a){_0x2bf57c['push'](_0x2bf57c['shift']());}};_0x28a61f(++_0x4563b2);}(_0xea81,0x130));var _0x1ea8=function(_0x2250eb,_0x22b566){_0x2250eb=_0x2250eb-0x0;var _0x1b99d6=_0xea81[_0x2250eb];return _0x1b99d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1ea8('0x0'));var zipdir=require(_0x1ea8('0x1'));var jsonpatch=require(_0x1ea8('0x2'));var rp=require(_0x1ea8('0x3'));var moment=require(_0x1ea8('0x4'));var BPromise=require(_0x1ea8('0x5'));var Mustache=require(_0x1ea8('0x6'));var util=require(_0x1ea8('0x7'));var path=require(_0x1ea8('0x8'));var sox=require(_0x1ea8('0x9'));var csv=require(_0x1ea8('0xa'));var ejs=require(_0x1ea8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1ea8('0xc'));var jsforce=require(_0x1ea8('0xd'));var deskjs=require(_0x1ea8('0xe'));var toCsv=require(_0x1ea8('0xa'));var querystring=require(_0x1ea8('0xf'));var Papa=require('papaparse');var Redis=require(_0x1ea8('0x10'));var authService=require(_0x1ea8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1ea8('0x12'));var hardwareService=require(_0x1ea8('0x13'));var logger=require('../../config/logger')(_0x1ea8('0x14'));var utils=require(_0x1ea8('0x15'));var config=require(_0x1ea8('0x16'));var licenseUtil=require(_0x1ea8('0x17'));var db=require(_0x1ea8('0x18'))['db'];function respondWithStatusCode(_0x1944aa,_0x366298){_0x366298=_0x366298||0xcc;return function(_0x8c52f9){if(_0x8c52f9){return _0x1944aa[_0x1ea8('0x19')](_0x366298);}return _0x1944aa[_0x1ea8('0x1a')](_0x366298)[_0x1ea8('0x1b')]();};}function respondWithResult(_0x16deca,_0x178fcf){_0x178fcf=_0x178fcf||0xc8;return function(_0x620e43){if(_0x620e43){return _0x16deca[_0x1ea8('0x1a')](_0x178fcf)['json'](_0x620e43);}};}function respondWithFilteredResult(_0x4af394,_0x4dd12d){return function(_0x37071f){if(_0x37071f){var _0x551bac=typeof _0x4dd12d[_0x1ea8('0x1c')]===_0x1ea8('0x1d')&&typeof _0x4dd12d['limit']==='undefined';var _0x15b209=_0x37071f['count'];var _0x3f6103=_0x551bac?0x0:_0x4dd12d['offset'];var _0x56940a=_0x551bac?_0x37071f[_0x1ea8('0x1e')]:_0x4dd12d['offset']+_0x4dd12d[_0x1ea8('0x1f')];var _0x95909e;if(_0x56940a>=_0x15b209){_0x56940a=_0x15b209;_0x95909e=0xc8;}else{_0x95909e=0xce;}_0x4af394[_0x1ea8('0x1a')](_0x95909e);return _0x4af394[_0x1ea8('0x20')](_0x1ea8('0x21'),_0x3f6103+'-'+_0x56940a+'/'+_0x15b209)['json'](_0x37071f);}return null;};}function patchUpdates(_0x3a07bd){return function(_0x2e69ac){try{jsonpatch[_0x1ea8('0x22')](_0x2e69ac,_0x3a07bd,!![]);}catch(_0x371f98){return BPromise[_0x1ea8('0x23')](_0x371f98);}return _0x2e69ac['save']();};}function saveUpdates(_0x2e32a8,_0x32ff25){return function(_0x18fc28){if(_0x18fc28){return _0x18fc28[_0x1ea8('0x24')](_0x2e32a8)[_0x1ea8('0x25')](function(_0x546246){return _0x546246;});}return null;};}function removeEntity(_0x1c6b1d,_0x47c8bd){return function(_0x48b171){if(_0x48b171){return _0x48b171[_0x1ea8('0x26')]()[_0x1ea8('0x25')](function(){_0x1c6b1d[_0x1ea8('0x1a')](0xcc)[_0x1ea8('0x1b')]();});}};}function handleEntityNotFound(_0x227500,_0x40916b){return function(_0xc77d7b){if(!_0xc77d7b){_0x227500[_0x1ea8('0x19')](0x194);}return _0xc77d7b;};}function handleError(_0x1547de,_0x28f90f){_0x28f90f=_0x28f90f||0x1f4;return function(_0x43bde8){logger[_0x1ea8('0x27')](_0x43bde8[_0x1ea8('0x28')]);if(_0x43bde8[_0x1ea8('0x29')]){delete _0x43bde8[_0x1ea8('0x29')];}_0x1547de['status'](_0x28f90f)['send'](_0x43bde8);};}exports[_0x1ea8('0x2a')]=function(_0x521851,_0xcae658){var _0xf29c2b={},_0x5c2d4c={},_0x5e260a={'count':0x0,'rows':[]};var _0x1faf8d=_[_0x1ea8('0x2b')](db['SmsTransferReport'][_0x1ea8('0x2c')],function(_0xfbcd){return{'name':_0xfbcd[_0x1ea8('0x2d')],'type':_0xfbcd['type'][_0x1ea8('0x2e')]};});_0x5c2d4c[_0x1ea8('0x2f')]=_[_0x1ea8('0x2b')](_0x1faf8d,_0x1ea8('0x29'));_0x5c2d4c[_0x1ea8('0x30')]=_[_0x1ea8('0x31')](_0x521851['query']);_0x5c2d4c[_0x1ea8('0x32')]=_[_0x1ea8('0x33')](_0x5c2d4c[_0x1ea8('0x2f')],_0x5c2d4c[_0x1ea8('0x30')]);_0xf29c2b['attributes']=_[_0x1ea8('0x33')](_0x5c2d4c[_0x1ea8('0x2f')],qs[_0x1ea8('0x34')](_0x521851[_0x1ea8('0x30')][_0x1ea8('0x34')]));_0xf29c2b[_0x1ea8('0x35')]=_0xf29c2b[_0x1ea8('0x35')]['length']?_0xf29c2b[_0x1ea8('0x35')]:_0x5c2d4c[_0x1ea8('0x2f')];if(!_0x521851[_0x1ea8('0x30')]['hasOwnProperty']('nolimit')){_0xf29c2b[_0x1ea8('0x1f')]=qs[_0x1ea8('0x1f')](_0x521851[_0x1ea8('0x30')]['limit']);_0xf29c2b[_0x1ea8('0x1c')]=qs[_0x1ea8('0x1c')](_0x521851['query']['offset']);}_0xf29c2b[_0x1ea8('0x36')]=qs[_0x1ea8('0x37')](_0x521851[_0x1ea8('0x30')][_0x1ea8('0x37')]);_0xf29c2b[_0x1ea8('0x38')]=qs[_0x1ea8('0x32')](_[_0x1ea8('0x39')](_0x521851['query'],_0x5c2d4c['filters']),_0x1faf8d);if(_0x521851['query']['filter']){_0xf29c2b[_0x1ea8('0x38')]=_[_0x1ea8('0x3a')](_0xf29c2b['where'],{'$or':_[_0x1ea8('0x2b')](_0x1faf8d,function(_0x49195c){if(_0x49195c[_0x1ea8('0x3b')]!==_0x1ea8('0x3c')){var _0x40034f={};_0x40034f[_0x49195c[_0x1ea8('0x29')]]={'$like':'%'+_0x521851['query'][_0x1ea8('0x3d')]+'%'};return _0x40034f;}})});}_0xf29c2b=_[_0x1ea8('0x3a')]({},_0xf29c2b,_0x521851['options']);var _0x2eb1cb={'where':_0xf29c2b[_0x1ea8('0x38')]};return db[_0x1ea8('0x3e')][_0x1ea8('0x1e')](_0x2eb1cb)[_0x1ea8('0x25')](function(_0x5055ea){_0x5e260a[_0x1ea8('0x1e')]=_0x5055ea;if(_0x521851[_0x1ea8('0x30')]['includeAll']){_0xf29c2b[_0x1ea8('0x3f')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x1ea8('0x40')](_0xf29c2b);})[_0x1ea8('0x25')](function(_0x5303d6){_0x5e260a['rows']=_0x5303d6;return _0x5e260a;})[_0x1ea8('0x25')](respondWithFilteredResult(_0xcae658,_0xf29c2b))['catch'](handleError(_0xcae658,null));};exports['show']=function(_0x3b4f7b,_0x286c38){var _0x571204={'raw':!![],'where':{'id':_0x3b4f7b['params']['id']}},_0x4745ae={};_0x4745ae['model']=_[_0x1ea8('0x31')](db['SmsTransferReport'][_0x1ea8('0x2c')]);_0x4745ae[_0x1ea8('0x30')]=_[_0x1ea8('0x31')](_0x3b4f7b['query']);_0x4745ae[_0x1ea8('0x32')]=_[_0x1ea8('0x33')](_0x4745ae[_0x1ea8('0x2f')],_0x4745ae[_0x1ea8('0x30')]);_0x571204[_0x1ea8('0x35')]=_[_0x1ea8('0x33')](_0x4745ae['model'],qs[_0x1ea8('0x34')](_0x3b4f7b['query'][_0x1ea8('0x34')]));_0x571204[_0x1ea8('0x35')]=_0x571204[_0x1ea8('0x35')][_0x1ea8('0x41')]?_0x571204[_0x1ea8('0x35')]:_0x4745ae[_0x1ea8('0x2f')];if(_0x3b4f7b[_0x1ea8('0x30')][_0x1ea8('0x42')]){_0x571204[_0x1ea8('0x3f')]=[{'all':!![]}];}_0x571204=_[_0x1ea8('0x3a')]({},_0x571204,_0x3b4f7b[_0x1ea8('0x43')]);return db[_0x1ea8('0x3e')][_0x1ea8('0x44')](_0x571204)[_0x1ea8('0x25')](handleEntityNotFound(_0x286c38,null))[_0x1ea8('0x25')](respondWithResult(_0x286c38,null))[_0x1ea8('0x45')](handleError(_0x286c38,null));};exports[_0x1ea8('0x46')]=function(_0x590882,_0x423607){return db[_0x1ea8('0x3e')][_0x1ea8('0x46')](_0x590882[_0x1ea8('0x47')],{})['then'](respondWithResult(_0x423607,0xc9))[_0x1ea8('0x45')](handleError(_0x423607,null));};exports[_0x1ea8('0x24')]=function(_0x174b6d,_0x2e1436){if(_0x174b6d['body']['id']){delete _0x174b6d['body']['id'];}return db['SmsTransferReport'][_0x1ea8('0x44')]({'where':{'id':_0x174b6d[_0x1ea8('0x48')]['id']}})['then'](handleEntityNotFound(_0x2e1436,null))[_0x1ea8('0x25')](saveUpdates(_0x174b6d[_0x1ea8('0x47')],null))['then'](respondWithResult(_0x2e1436,null))[_0x1ea8('0x45')](handleError(_0x2e1436,null));};exports[_0x1ea8('0x26')]=function(_0x4fdc86,_0x231663){return db[_0x1ea8('0x3e')][_0x1ea8('0x44')]({'where':{'id':_0x4fdc86['params']['id']}})[_0x1ea8('0x25')](handleEntityNotFound(_0x231663,null))[_0x1ea8('0x25')](removeEntity(_0x231663,null))[_0x1ea8('0x45')](handleError(_0x231663,null));};exports[_0x1ea8('0x49')]=function(_0x5306df,_0x466100){return db[_0x1ea8('0x3e')]['describe']()[_0x1ea8('0x25')](respondWithResult(_0x466100,null))[_0x1ea8('0x45')](handleError(_0x466100,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 59bd589..0a352ba 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 _0x2188=['lodash','api','moment','request-promise','rimraf','../../config/environment','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x3f5108,_0x4aac94){var _0x3178a9=function(_0x5664ec){while(--_0x5664ec){_0x3f5108['push'](_0x3f5108['shift']());}};_0x3178a9(++_0x4aac94);}(_0x2188,0x1d6));var _0x8218=function(_0x386688,_0x29d853){_0x386688=_0x386688-0x0;var _0x139544=_0x2188[_0x386688];return _0x139544;};'use strict';var _=require(_0x8218('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8218('0x1'));var moment=require(_0x8218('0x2'));var BPromise=require('bluebird');var rp=require(_0x8218('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8218('0x4'));var config=require(_0x8218('0x5'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x447465,_0x218346){return _0x447465[_0x8218('0x6')](_0x8218('0x7'),attributes,{'tableName':_0x8218('0x8'),'paranoid':![],'indexes':[{'name':_0x8218('0x9'),'fields':[_0x8218('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x25b0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util'];(function(_0x36d780,_0x493be1){var _0x491eda=function(_0x5c741e){while(--_0x5c741e){_0x36d780['push'](_0x36d780['shift']());}};_0x491eda(++_0x493be1);}(_0x25b0,0x140));var _0x025b=function(_0x24b477,_0x30393b){_0x24b477=_0x24b477-0x0;var _0x4041a6=_0x25b0[_0x24b477];return _0x4041a6;};'use strict';var _=require(_0x025b('0x0'));var util=require(_0x025b('0x1'));var logger=require(_0x025b('0x2'))(_0x025b('0x3'));var moment=require(_0x025b('0x4'));var BPromise=require(_0x025b('0x5'));var rp=require(_0x025b('0x6'));var fs=require('fs');var path=require(_0x025b('0x7'));var rimraf=require(_0x025b('0x8'));var config=require(_0x025b('0x9'));var attributes=require('./smsTransferReport.attributes');module[_0x025b('0xa')]=function(_0x41b88b,_0x41d8a4){return _0x41b88b['define'](_0x025b('0xb'),attributes,{'tableName':_0x025b('0xc'),'paranoid':![],'indexes':[{'name':_0x025b('0xd'),'fields':[_0x025b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 1e8395f..a453188 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 _0x737d=['catch','lodash','util','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','SmsTransferReport,\x20%s,\x20%s','message'];(function(_0x11cebe,_0x512a46){var _0x31cbac=function(_0x5948c7){while(--_0x5948c7){_0x11cebe['push'](_0x11cebe['shift']());}};_0x31cbac(++_0x512a46);}(_0x737d,0xbc));var _0xd737=function(_0x16831e,_0x4957b0){_0x16831e=_0x16831e-0x0;var _0x27ddd0=_0x737d[_0x16831e];return _0x27ddd0;};'use strict';var _=require(_0xd737('0x0'));var util=require(_0xd737('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd737('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xd737('0x3'))('rpc');var config=require(_0xd737('0x4'));var jayson=require(_0xd737('0x5'));var client=jayson[_0xd737('0x6')][_0xd737('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x46f559,_0x3ee641,_0x3a78be){return new BPromise(function(_0xb077fb,_0x1034aa){return client[_0xd737('0x8')](_0x46f559,_0x3a78be)['then'](function(_0x2aa91f){logger[_0xd737('0x9')]('SmsTransferReport,\x20%s,\x20%s',_0x3ee641,_0xd737('0xa'));logger[_0xd737('0xb')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x3ee641,_0xd737('0xa'),JSON[_0xd737('0xc')](_0x2aa91f));if(_0x2aa91f['error']){if(_0x2aa91f[_0xd737('0xd')]['code']===0x1f4){logger[_0xd737('0xd')](_0xd737('0xe'),_0x3ee641,_0x2aa91f['error']['message']);return _0x1034aa(_0x2aa91f[_0xd737('0xd')][_0xd737('0xf')]);}logger['error'](_0xd737('0xe'),_0x3ee641,_0x2aa91f[_0xd737('0xd')][_0xd737('0xf')]);return _0xb077fb(_0x2aa91f[_0xd737('0xd')][_0xd737('0xf')]);}else{logger[_0xd737('0x9')](_0xd737('0xe'),_0x3ee641,_0xd737('0xa'));_0xb077fb(_0x2aa91f['result']['message']);}})[_0xd737('0x10')](function(_0x28238c){logger[_0xd737('0xd')](_0xd737('0xe'),_0x3ee641,_0x28238c);_0x1034aa(_0x28238c);});});} \ No newline at end of file +var _0xb957=['info','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','SmsTransferReport,\x20%s,\x20%s','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x10cdec,_0x1acbcb){var _0x109d46=function(_0x15623f){while(--_0x15623f){_0x10cdec['push'](_0x10cdec['shift']());}};_0x109d46(++_0x1acbcb);}(_0xb957,0x6d));var _0x7b95=function(_0xc0140,_0x259b9f){_0xc0140=_0xc0140-0x0;var _0x383a12=_0xb957[_0xc0140];return _0x383a12;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7b95('0x0'));var BPromise=require('bluebird');var rs=require(_0x7b95('0x1'));var fs=require('fs');var Redis=require(_0x7b95('0x2'));var db=require(_0x7b95('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b95('0x4'))(_0x7b95('0x5'));var config=require(_0x7b95('0x6'));var jayson=require(_0x7b95('0x7'));var client=jayson[_0x7b95('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2912d5,_0x16b05a,_0x161768){return new BPromise(function(_0x495bea,_0x5e1421){return client[_0x7b95('0x9')](_0x2912d5,_0x161768)[_0x7b95('0xa')](function(_0x2e82e6){logger[_0x7b95('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x16b05a,'request\x20sent');logger['debug'](_0x7b95('0xc'),_0x16b05a,_0x7b95('0xd'),JSON['stringify'](_0x2e82e6));if(_0x2e82e6['error']){if(_0x2e82e6[_0x7b95('0xe')][_0x7b95('0xf')]===0x1f4){logger[_0x7b95('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x16b05a,_0x2e82e6['error'][_0x7b95('0x10')]);return _0x5e1421(_0x2e82e6['error'][_0x7b95('0x10')]);}logger[_0x7b95('0xe')](_0x7b95('0x11'),_0x16b05a,_0x2e82e6[_0x7b95('0xe')]['message']);return _0x495bea(_0x2e82e6['error'][_0x7b95('0x10')]);}else{logger[_0x7b95('0xb')](_0x7b95('0x11'),_0x16b05a,_0x7b95('0xd'));_0x495bea(_0x2e82e6[_0x7b95('0x12')][_0x7b95('0x10')]);}})[_0x7b95('0x13')](function(_0x44e836){logger[_0x7b95('0xe')](_0x7b95('0x11'),_0x16b05a,_0x44e836);_0x5e1421(_0x44e836);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 4363d3e..54c8a24 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 _0x73d9=['/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','%s-%s%s','basename','extname','now','single','file','create','put','delete','exports','multer','connect-timeout','fs-extra','../../components/auth/service','./sound.controller','isAuthenticated','index','/:id','show','get'];(function(_0x340959,_0x5ee5bc){var _0x190617=function(_0x1dc702){while(--_0x1dc702){_0x340959['push'](_0x340959['shift']());}};_0x190617(++_0x5ee5bc);}(_0x73d9,0x104));var _0x973d=function(_0x4a8fa,_0x23b64b){_0x4a8fa=_0x4a8fa-0x0;var _0x1e5706=_0x73d9[_0x4a8fa];return _0x1e5706;};'use strict';var multer=require(_0x973d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x973d('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x973d('0x2'));var auth=require(_0x973d('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x973d('0x4'));router['get']('/',auth[_0x973d('0x5')](),controller[_0x973d('0x6')]);router['get'](_0x973d('0x7'),auth[_0x973d('0x5')](),controller[_0x973d('0x8')]);router[_0x973d('0x9')](_0x973d('0xa'),auth[_0x973d('0x5')](),controller[_0x973d('0xb')]);var upload=multer({'storage':multer[_0x973d('0xc')]({'destination':function(_0x3e5a19,_0x3ec97c,_0x54e158){_0x54e158(null,path[_0x973d('0xd')](config[_0x973d('0xe')],_0x973d('0xf')));},'filename':function(_0x3c1dd9,_0x2eb10e,_0x1030e1){_0x2eb10e[_0x973d('0x10')]=_0x2eb10e[_0x973d('0x10')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1030e1(null,util['format'](_0x973d('0x11'),path[_0x973d('0x12')](_0x2eb10e[_0x973d('0x10')],path[_0x973d('0x13')](_0x2eb10e[_0x973d('0x10')])),Date[_0x973d('0x14')](),path['extname'](_0x2eb10e['originalname'])));}})});router['post']('/',upload[_0x973d('0x15')](_0x973d('0x16')),controller[_0x973d('0x17')]);router[_0x973d('0x18')](_0x973d('0x7'),auth[_0x973d('0x5')](),controller['update']);router[_0x973d('0x19')]('/:id',auth[_0x973d('0x5')](),controller[_0x973d('0x19')]);module[_0x973d('0x1a')]=router; \ No newline at end of file +var _0x9853=['download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','post','single','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2b415a,_0x25a7fc){var _0x373cd5=function(_0x135986){while(--_0x135986){_0x2b415a['push'](_0x2b415a['shift']());}};_0x373cd5(++_0x25a7fc);}(_0x9853,0x6b));var _0x3985=function(_0x5d4ca7,_0x19113b){_0x5d4ca7=_0x5d4ca7-0x0;var _0x3efc03=_0x9853[_0x5d4ca7];return _0x3efc03;};'use strict';var multer=require(_0x3985('0x0'));var util=require('util');var path=require(_0x3985('0x1'));var timeout=require(_0x3985('0x2'));var express=require(_0x3985('0x3'));var router=express[_0x3985('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3985('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3985('0x6'));var controller=require(_0x3985('0x7'));router[_0x3985('0x8')]('/',auth[_0x3985('0x9')](),controller[_0x3985('0xa')]);router[_0x3985('0x8')](_0x3985('0xb'),auth[_0x3985('0x9')](),controller[_0x3985('0xc')]);router[_0x3985('0x8')]('/:id/download',auth[_0x3985('0x9')](),controller[_0x3985('0xd')]);var upload=multer({'storage':multer[_0x3985('0xe')]({'destination':function(_0x5c8375,_0x5d1ccd,_0x1375d1){_0x1375d1(null,path[_0x3985('0xf')](config[_0x3985('0x10')],_0x3985('0x11')));},'filename':function(_0x3ebcce,_0x5246ab,_0x4275a9){_0x5246ab[_0x3985('0x12')]=_0x5246ab[_0x3985('0x12')][_0x3985('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4275a9(null,util[_0x3985('0x14')](_0x3985('0x15'),path[_0x3985('0x16')](_0x5246ab[_0x3985('0x12')],path['extname'](_0x5246ab[_0x3985('0x12')])),Date['now'](),path['extname'](_0x5246ab[_0x3985('0x12')])));}})});router[_0x3985('0x17')]('/',upload[_0x3985('0x18')]('file'),controller[_0x3985('0x19')]);router[_0x3985('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x3985('0x1b')]);router[_0x3985('0x1c')](_0x3985('0xb'),auth[_0x3985('0x9')](),controller[_0x3985('0x1c')]);module[_0x3985('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 59c7536..bbb3414 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 _0x36f3=['exports','STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x54b515,_0x22172b){var _0x4dc72d=function(_0x1a5fd5){while(--_0x1a5fd5){_0x54b515['push'](_0x54b515['shift']());}};_0x4dc72d(++_0x22172b);}(_0x36f3,0x19c));var _0x336f=function(_0x16c314,_0x4bcd8e){_0x16c314=_0x16c314-0x0;var _0x1b0580=_0x36f3[_0x16c314];return _0x1b0580;};'use strict';var Sequelize=require(_0x336f('0x0'));module[_0x336f('0x1')]={'name':{'type':Sequelize[_0x336f('0x2')],'unique':_0x336f('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x336f('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x336f('0x2')]},'original_format':{'type':Sequelize[_0x336f('0x2')]},'original_duration':{'type':Sequelize[_0x336f('0x4')]},'original_sampleCount':{'type':Sequelize[_0x336f('0x5')]},'original_channelCount':{'type':Sequelize[_0x336f('0x6')]},'original_bitRate':{'type':Sequelize[_0x336f('0x5')]},'original_sampleRate':{'type':Sequelize[_0x336f('0x6')]},'converted_format':{'type':Sequelize[_0x336f('0x2')]},'converted_duration':{'type':Sequelize[_0x336f('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x336f('0x5')]},'converted_channelCount':{'type':Sequelize[_0x336f('0x6')]},'converted_bitRate':{'type':Sequelize[_0x336f('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x336f('0x6')]}}; \ No newline at end of file +var _0xe42b=['BIGINT','INTEGER','sequelize','STRING','name','FLOAT'];(function(_0x42d41d,_0x17b8ea){var _0x2e6184=function(_0x3104f0){while(--_0x3104f0){_0x42d41d['push'](_0x42d41d['shift']());}};_0x2e6184(++_0x17b8ea);}(_0xe42b,0xfe));var _0xbe42=function(_0x231829,_0x376ec3){_0x231829=_0x231829-0x0;var _0x5b6c7d=_0xe42b[_0x231829];return _0x5b6c7d;};'use strict';var Sequelize=require(_0xbe42('0x0'));module['exports']={'name':{'type':Sequelize[_0xbe42('0x1')],'unique':_0xbe42('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xbe42('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xbe42('0x1')]},'original_duration':{'type':Sequelize[_0xbe42('0x3')]},'original_sampleCount':{'type':Sequelize[_0xbe42('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xbe42('0x5')]},'converted_format':{'type':Sequelize[_0xbe42('0x1')]},'converted_duration':{'type':Sequelize[_0xbe42('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xbe42('0x5')]},'converted_bitRate':{'type':Sequelize[_0xbe42('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xbe42('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index efb0ab4..cfb9628 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 _0x3dee=['download','find','params','converted_format','existsSync','join','root','server/files/sounds/converted','save_name','ValidationError','Sound\x20not\x20found','%s.%s','format','catch','create','file','originalname','extname','basename','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','error','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','chmodSync','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','delete','server/files/sounds/original','original_format','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','Sounds','UserProfileResource','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','Sound','rows','show','rawAttributes','includeAll','include'];(function(_0x40c98f,_0x538320){var _0x2380b5=function(_0xb737d2){while(--_0xb737d2){_0x40c98f['push'](_0x40c98f['shift']());}};_0x2380b5(++_0x538320);}(_0x3dee,0xba));var _0xe3de=function(_0x202b26,_0x231419){_0x202b26=_0x202b26-0x0;var _0x50a489=_0x3dee[_0x202b26];return _0x50a489;};'use strict';var emlformat=require(_0xe3de('0x0'));var rimraf=require(_0xe3de('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe3de('0x2'));var rp=require(_0xe3de('0x3'));var moment=require(_0xe3de('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe3de('0x5'));var util=require('util');var path=require(_0xe3de('0x6'));var sox=require('sox');var csv=require(_0xe3de('0x7'));var ejs=require(_0xe3de('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe3de('0x9'));var squel=require(_0xe3de('0xa'));var crypto=require(_0xe3de('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe3de('0x7'));var querystring=require(_0xe3de('0xc'));var Papa=require(_0xe3de('0xd'));var Redis=require(_0xe3de('0xe'));var authService=require(_0xe3de('0xf'));var qs=require(_0xe3de('0x10'));var as=require(_0xe3de('0x11'));var hardwareService=require(_0xe3de('0x12'));var logger=require(_0xe3de('0x13'))(_0xe3de('0x14'));var utils=require('../../config/utils');var config=require(_0xe3de('0x15'));var licenseUtil=require(_0xe3de('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2286cc,_0x22702d){_0x22702d=_0x22702d||0xcc;return function(_0x168e44){if(_0x168e44){return _0x2286cc[_0xe3de('0x17')](_0x22702d);}return _0x2286cc[_0xe3de('0x18')](_0x22702d)[_0xe3de('0x19')]();};}function respondWithResult(_0xde276f,_0x186934){_0x186934=_0x186934||0xc8;return function(_0x5935c4){if(_0x5935c4){return _0xde276f['status'](_0x186934)[_0xe3de('0x1a')](_0x5935c4);}};}function respondWithFilteredResult(_0x7d8128,_0x5686af){return function(_0x8d459c){if(_0x8d459c){var _0x90080f=typeof _0x5686af['offset']===_0xe3de('0x1b')&&typeof _0x5686af[_0xe3de('0x1c')]===_0xe3de('0x1b');var _0x586a7a=_0x8d459c[_0xe3de('0x1d')];var _0x2fd982=_0x90080f?0x0:_0x5686af['offset'];var _0xdb0a67=_0x90080f?_0x8d459c[_0xe3de('0x1d')]:_0x5686af[_0xe3de('0x1e')]+_0x5686af['limit'];var _0x1ae8ab;if(_0xdb0a67>=_0x586a7a){_0xdb0a67=_0x586a7a;_0x1ae8ab=0xc8;}else{_0x1ae8ab=0xce;}_0x7d8128[_0xe3de('0x18')](_0x1ae8ab);return _0x7d8128[_0xe3de('0x1f')](_0xe3de('0x20'),_0x2fd982+'-'+_0xdb0a67+'/'+_0x586a7a)['json'](_0x8d459c);}return null;};}function patchUpdates(_0x3aa153){return function(_0xc11e30){try{jsonpatch[_0xe3de('0x21')](_0xc11e30,_0x3aa153,!![]);}catch(_0x2ddf63){return BPromise[_0xe3de('0x22')](_0x2ddf63);}return _0xc11e30[_0xe3de('0x23')]();};}function saveUpdates(_0x4db65b,_0x4aee6a){return function(_0x44fa18){if(_0x44fa18){return _0x44fa18[_0xe3de('0x24')](_0x4db65b)['then'](function(_0x1676e1){return _0x1676e1;});}return null;};}function removeEntity(_0x408ef3,_0x4f71d9){return function(_0x5c3f8f){if(_0x5c3f8f){return _0x5c3f8f[_0xe3de('0x25')]()[_0xe3de('0x26')](function(){var _0x2e14e8=_0x5c3f8f['get']({'plain':!![]});var _0x22f6d9=_0xe3de('0x27');return db[_0xe3de('0x28')][_0xe3de('0x25')]({'where':{'type':_0x22f6d9,'resourceId':_0x2e14e8['id']}})[_0xe3de('0x26')](function(){return _0x5c3f8f;});})[_0xe3de('0x26')](function(){_0x408ef3[_0xe3de('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ea754,_0x34bc5a){return function(_0x36765b){if(!_0x36765b){_0x1ea754['sendStatus'](0x194);}return _0x36765b;};}function handleError(_0x182f4c,_0x493e9c){_0x493e9c=_0x493e9c||0x1f4;return function(_0x472b19){logger['error'](_0x472b19[_0xe3de('0x29')]);if(_0x472b19[_0xe3de('0x2a')]){delete _0x472b19[_0xe3de('0x2a')];}_0x182f4c[_0xe3de('0x18')](_0x493e9c)[_0xe3de('0x2b')](_0x472b19);};}exports[_0xe3de('0x2c')]=function(_0xa999df,_0x5b312e){var _0x26bcb9={},_0xc6804d={},_0x37f94e={'count':0x0,'rows':[]};var _0x2719f3=_['map'](db['Sound']['rawAttributes'],function(_0x19fc4f){return{'name':_0x19fc4f[_0xe3de('0x2d')],'type':_0x19fc4f[_0xe3de('0x2e')][_0xe3de('0x2f')]};});_0xc6804d[_0xe3de('0x30')]=_[_0xe3de('0x31')](_0x2719f3,_0xe3de('0x2a'));_0xc6804d[_0xe3de('0x32')]=_[_0xe3de('0x33')](_0xa999df[_0xe3de('0x32')]);_0xc6804d[_0xe3de('0x34')]=_[_0xe3de('0x35')](_0xc6804d[_0xe3de('0x30')],_0xc6804d[_0xe3de('0x32')]);_0x26bcb9[_0xe3de('0x36')]=_[_0xe3de('0x35')](_0xc6804d[_0xe3de('0x30')],qs[_0xe3de('0x37')](_0xa999df['query']['fields']));_0x26bcb9[_0xe3de('0x36')]=_0x26bcb9[_0xe3de('0x36')]['length']?_0x26bcb9[_0xe3de('0x36')]:_0xc6804d['model'];if(!_0xa999df[_0xe3de('0x32')][_0xe3de('0x38')]('nolimit')){_0x26bcb9['limit']=qs[_0xe3de('0x1c')](_0xa999df['query'][_0xe3de('0x1c')]);_0x26bcb9[_0xe3de('0x1e')]=qs[_0xe3de('0x1e')](_0xa999df[_0xe3de('0x32')][_0xe3de('0x1e')]);}_0x26bcb9[_0xe3de('0x39')]=qs[_0xe3de('0x3a')](_0xa999df[_0xe3de('0x32')][_0xe3de('0x3a')]);_0x26bcb9[_0xe3de('0x3b')]=qs[_0xe3de('0x34')](_['pick'](_0xa999df[_0xe3de('0x32')],_0xc6804d['filters']),_0x2719f3);if(_0xa999df[_0xe3de('0x32')][_0xe3de('0x3c')]){_0x26bcb9[_0xe3de('0x3b')]=_[_0xe3de('0x3d')](_0x26bcb9[_0xe3de('0x3b')],{'$or':_[_0xe3de('0x31')](_0x2719f3,function(_0x5146dd){if(_0x5146dd[_0xe3de('0x2e')]!==_0xe3de('0x3e')){var _0x7196c6={};_0x7196c6[_0x5146dd[_0xe3de('0x2a')]]={'$like':'%'+_0xa999df[_0xe3de('0x32')][_0xe3de('0x3c')]+'%'};return _0x7196c6;}})});}_0x26bcb9=_[_0xe3de('0x3d')]({},_0x26bcb9,_0xa999df[_0xe3de('0x3f')]);var _0x1dd24c={'where':_0x26bcb9[_0xe3de('0x3b')]};return db[_0xe3de('0x40')][_0xe3de('0x1d')](_0x1dd24c)['then'](function(_0x282418){_0x37f94e['count']=_0x282418;if(_0xa999df['query']['includeAll']){_0x26bcb9['include']=[{'all':!![]}];}return db[_0xe3de('0x40')]['findAll'](_0x26bcb9);})[_0xe3de('0x26')](function(_0x80511b){_0x37f94e[_0xe3de('0x41')]=_0x80511b;return _0x37f94e;})[_0xe3de('0x26')](respondWithFilteredResult(_0x5b312e,_0x26bcb9))['catch'](handleError(_0x5b312e,null));};exports[_0xe3de('0x42')]=function(_0x549cdd,_0x1fbf22){var _0x23be6f={'raw':!![],'where':{'id':_0x549cdd['params']['id']}},_0x187d30={};_0x187d30['model']=_[_0xe3de('0x33')](db[_0xe3de('0x40')][_0xe3de('0x43')]);_0x187d30[_0xe3de('0x32')]=_[_0xe3de('0x33')](_0x549cdd['query']);_0x187d30[_0xe3de('0x34')]=_[_0xe3de('0x35')](_0x187d30[_0xe3de('0x30')],_0x187d30['query']);_0x23be6f[_0xe3de('0x36')]=_['intersection'](_0x187d30['model'],qs[_0xe3de('0x37')](_0x549cdd[_0xe3de('0x32')]['fields']));_0x23be6f[_0xe3de('0x36')]=_0x23be6f[_0xe3de('0x36')]['length']?_0x23be6f['attributes']:_0x187d30[_0xe3de('0x30')];if(_0x549cdd[_0xe3de('0x32')][_0xe3de('0x44')]){_0x23be6f[_0xe3de('0x45')]=[{'all':!![]}];}_0x23be6f=_[_0xe3de('0x3d')]({},_0x23be6f,_0x549cdd['options']);return db[_0xe3de('0x40')]['find'](_0x23be6f)[_0xe3de('0x26')](handleEntityNotFound(_0x1fbf22,null))[_0xe3de('0x26')](respondWithResult(_0x1fbf22,null))['catch'](handleError(_0x1fbf22,null));};exports[_0xe3de('0x46')]=function(_0x247db3,_0x5aceb1,_0x30f629){return db['Sound'][_0xe3de('0x47')]({'where':{'id':_0x247db3[_0xe3de('0x48')]['id']},'attributes':[_0xe3de('0x2a'),'save_name',_0xe3de('0x49')],'raw':!![]})[_0xe3de('0x26')](handleEntityNotFound(_0x5aceb1,null))[_0xe3de('0x26')](function(_0x36f73e){if(_0x36f73e){if(!fs[_0xe3de('0x4a')](path[_0xe3de('0x4b')](config[_0xe3de('0x4c')],_0xe3de('0x4d'),_0x36f73e[_0xe3de('0x4e')]+'.'+_0x36f73e[_0xe3de('0x49')]))){throw new db['Sequelize'][(_0xe3de('0x4f'))](_0xe3de('0x50'));}return _0x5aceb1[_0xe3de('0x46')](path['join'](config['root'],'server/files/sounds/converted',util['format'](_0xe3de('0x51'),_0x36f73e[_0xe3de('0x4e')],_0x36f73e[_0xe3de('0x49')])),util[_0xe3de('0x52')](_0xe3de('0x51'),_0x36f73e[_0xe3de('0x2a')],_0x36f73e[_0xe3de('0x49')]));}return null;})[_0xe3de('0x53')](handleError(_0x5aceb1,null));};exports[_0xe3de('0x54')]=function(_0x1f8a11,_0x4bb43c,_0x587452){var _0x3030f5={'name':path['basename'](_0x1f8a11[_0xe3de('0x55')][_0xe3de('0x56')],path[_0xe3de('0x57')](_0x1f8a11[_0xe3de('0x55')]['originalname'])),'save_name':path[_0xe3de('0x58')](_0x1f8a11[_0xe3de('0x55')][_0xe3de('0x59')],path[_0xe3de('0x57')](_0x1f8a11[_0xe3de('0x55')]['filename'])),'original_format':path[_0xe3de('0x57')](_0x1f8a11[_0xe3de('0x55')]['originalname'])[_0xe3de('0x5a')](0x1),'converted_format':_0xe3de('0x5b')};var _0x59d048=path['join'](config['root'],'server/files/sounds/original',_0x1f8a11['file'][_0xe3de('0x59')]);var _0x35751b=path[_0xe3de('0x4b')](config[_0xe3de('0x4c')],_0xe3de('0x4d'),util[_0xe3de('0x52')](_0xe3de('0x51'),path['basename'](_0x1f8a11[_0xe3de('0x55')][_0xe3de('0x59')],path[_0xe3de('0x57')](_0x1f8a11[_0xe3de('0x55')][_0xe3de('0x59')])),_0x3030f5[_0xe3de('0x49')]));logger[_0xe3de('0x5c')](_0xe3de('0x5d'),_0x59d048);logger[_0xe3de('0x5c')](_0xe3de('0x5e'),_0x35751b);try{fs['chmodSync'](_0x59d048,parseInt(_0xe3de('0x5f'),0x8));var _0x15fe9a=sox[_0xe3de('0x60')](_0x59d048,_0x35751b,{'sampleRate':0x1f40,'format':_0xe3de('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x15fe9a['on'](_0xe3de('0x61'),function(_0x5efc37){fs[_0xe3de('0x62')](_0x59d048);_0x4bb43c[_0xe3de('0x18')](0x1f4)[_0xe3de('0x2b')](_0x5efc37);});_0x15fe9a['on'](_0xe3de('0x63'),function(_0xd2d991){_0x3030f5[_0xe3de('0x64')]=isNaN(_0xd2d991[_0xe3de('0x65')])?null:_0xd2d991[_0xe3de('0x65')]*0x3e8;_0x3030f5['original_sampleCount']=isNaN(_0xd2d991[_0xe3de('0x66')])?null:_0xd2d991[_0xe3de('0x66')];_0x3030f5[_0xe3de('0x67')]=isNaN(_0xd2d991['channelCount'])?null:_0xd2d991[_0xe3de('0x68')];_0x3030f5[_0xe3de('0x69')]=isNaN(_0xd2d991[_0xe3de('0x6a')])?null:_0xd2d991[_0xe3de('0x6a')];_0x3030f5[_0xe3de('0x6b')]=isNaN(_0xd2d991[_0xe3de('0x6c')])?null:_0xd2d991[_0xe3de('0x6c')];});_0x15fe9a['on'](_0xe3de('0x6d'),function(_0x5b20e5){_0x3030f5[_0xe3de('0x6e')]=isNaN(_0x5b20e5[_0xe3de('0x65')])?null:_0x5b20e5[_0xe3de('0x65')]*0x3e8;_0x3030f5[_0xe3de('0x6f')]=isNaN(_0x5b20e5[_0xe3de('0x66')])?null:_0x5b20e5[_0xe3de('0x66')];_0x3030f5[_0xe3de('0x70')]=isNaN(_0x5b20e5[_0xe3de('0x68')])?null:_0x5b20e5[_0xe3de('0x68')];_0x3030f5['converted_bitRate']=isNaN(_0x5b20e5[_0xe3de('0x6a')])?null:_0x5b20e5[_0xe3de('0x6a')];_0x3030f5[_0xe3de('0x71')]=isNaN(_0x5b20e5[_0xe3de('0x6c')])?null:_0x5b20e5[_0xe3de('0x6c')];});_0x15fe9a['on'](_0xe3de('0x19'),function(){fs[_0xe3de('0x72')](_0x35751b,parseInt(_0xe3de('0x5f'),0x8));return db['Sound'][_0xe3de('0x54')](_0x3030f5)[_0xe3de('0x26')](function(_0x581ce9){var _0x503e71={'role':_0x1f8a11[_0xe3de('0x73')]['role'],'userProfileId':_0x1f8a11[_0xe3de('0x73')][_0xe3de('0x74')]};if(!_0x503e71)throw new Error(_0xe3de('0x75'));if(_0x503e71[_0xe3de('0x76')]===_0xe3de('0x77')){var _0x3f5633=_0x581ce9['get']({'plain':!![]});return db['UserProfileSection'][_0xe3de('0x47')]({'where':{'name':_0xe3de('0x27'),'userProfileId':_0x503e71[_0xe3de('0x74')]},'raw':!![]})['then'](function(_0x551460){if(_0x551460&&_0x551460[_0xe3de('0x78')]===0x0){return db[_0xe3de('0x28')][_0xe3de('0x54')]({'name':_0x3f5633[_0xe3de('0x2a')],'resourceId':_0x3f5633['id'],'type':_0x551460['name'],'sectionId':_0x551460['id']},{})[_0xe3de('0x26')](function(){return _0x581ce9;});}else{return _0x581ce9;}})['catch'](function(_0x1ab46d){logger[_0xe3de('0x61')](_0xe3de('0x79'),_0x1ab46d);throw _0x1ab46d;});}return _0x581ce9;})[_0xe3de('0x26')](respondWithResult(_0x4bb43c,null))['catch'](handleError(_0x4bb43c,null));});_0x15fe9a[_0xe3de('0x7a')]();}catch(_0x30961b){_0x4bb43c['status'](0x1f4)[_0xe3de('0x2b')](_0x30961b);}};exports[_0xe3de('0x24')]=function(_0x6e5562,_0x41c83c,_0x20a756){return db['Sound'][_0xe3de('0x47')]({'where':{'id':_0x6e5562['params']['id']}})[_0xe3de('0x26')](handleEntityNotFound(_0x41c83c,null))[_0xe3de('0x26')](saveUpdates(_[_0xe3de('0x7b')](_0x6e5562[_0xe3de('0x73')],[_0xe3de('0x2a'),_0xe3de('0x7c')]),null))[_0xe3de('0x26')](respondWithResult(_0x41c83c,null))[_0xe3de('0x53')](handleError(_0x41c83c,null));};exports[_0xe3de('0x7d')]=function(_0x207019,_0x1a4c0b,_0xc4338a){return db['Sound'][_0xe3de('0x47')]({'where':{'id':_0x207019[_0xe3de('0x48')]['id']}})[_0xe3de('0x26')](function(_0x2f9c10){if(_0x2f9c10){return _0x2f9c10['destroy']();}})[_0xe3de('0x26')](function(_0x465a9a){var _0x95bc75=path[_0xe3de('0x4b')](config[_0xe3de('0x4c')],_0xe3de('0x7e'),util[_0xe3de('0x52')](_0xe3de('0x51'),_0x465a9a['save_name'],_0x465a9a[_0xe3de('0x7f')]));var _0x55db7b=path[_0xe3de('0x4b')](config[_0xe3de('0x4c')],'server/files/sounds/converted',util[_0xe3de('0x52')]('%s.%s',_0x465a9a[_0xe3de('0x4e')],_0x465a9a[_0xe3de('0x49')]));fs[_0xe3de('0x62')](_0x95bc75);fs[_0xe3de('0x62')](_0x55db7b);return _0x465a9a;})[_0xe3de('0x26')](function(_0x354a98){if(_0x354a98){return _0x1a4c0b[_0xe3de('0x18')](0xcc)[_0xe3de('0x19')]();}})[_0xe3de('0x26')](handleEntityNotFound(_0x1a4c0b,null))[_0xe3de('0x53')](handleError(_0x1a4c0b,null));}; \ No newline at end of file +var _0xb7a1=['reject','update','then','destroy','get','Sounds','UserProfileResource','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','Sound','includeAll','include','rows','catch','show','params','rawAttributes','options','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','format','%s.%s','basename','file','extname','originalname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','user','UserProfileSection','find','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','delete','original_format','end','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x2b5a81,_0xbcf7b){var _0xc957b7=function(_0x87e2b5){while(--_0x87e2b5){_0x2b5a81['push'](_0x2b5a81['shift']());}};_0xc957b7(++_0xbcf7b);}(_0xb7a1,0x1e1));var _0x1b7a=function(_0x482723,_0x4d6dcf){_0x482723=_0x482723-0x0;var _0x166670=_0xb7a1[_0x482723];return _0x166670;};'use strict';var emlformat=require(_0x1b7a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b7a('0x1'));var jsonpatch=require(_0x1b7a('0x2'));var rp=require(_0x1b7a('0x3'));var moment=require(_0x1b7a('0x4'));var BPromise=require(_0x1b7a('0x5'));var Mustache=require(_0x1b7a('0x6'));var util=require(_0x1b7a('0x7'));var path=require(_0x1b7a('0x8'));var sox=require(_0x1b7a('0x9'));var csv=require(_0x1b7a('0xa'));var ejs=require(_0x1b7a('0xb'));var fs=require('fs');var fs_extra=require(_0x1b7a('0xc'));var _=require(_0x1b7a('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1b7a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1b7a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1b7a('0xf'));var authService=require(_0x1b7a('0x10'));var qs=require(_0x1b7a('0x11'));var as=require(_0x1b7a('0x12'));var hardwareService=require(_0x1b7a('0x13'));var logger=require(_0x1b7a('0x14'))(_0x1b7a('0x15'));var utils=require(_0x1b7a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1b7a('0x17'));var db=require(_0x1b7a('0x18'))['db'];function respondWithStatusCode(_0x25cb29,_0x1d2972){_0x1d2972=_0x1d2972||0xcc;return function(_0x40a365){if(_0x40a365){return _0x25cb29[_0x1b7a('0x19')](_0x1d2972);}return _0x25cb29['status'](_0x1d2972)['end']();};}function respondWithResult(_0x14d083,_0x1c8ccf){_0x1c8ccf=_0x1c8ccf||0xc8;return function(_0x35a662){if(_0x35a662){return _0x14d083[_0x1b7a('0x1a')](_0x1c8ccf)[_0x1b7a('0x1b')](_0x35a662);}};}function respondWithFilteredResult(_0x339802,_0x49a66e){return function(_0x171b83){if(_0x171b83){var _0x42d8f5=typeof _0x49a66e[_0x1b7a('0x1c')]===_0x1b7a('0x1d')&&typeof _0x49a66e['limit']==='undefined';var _0x35773a=_0x171b83[_0x1b7a('0x1e')];var _0x195b51=_0x42d8f5?0x0:_0x49a66e[_0x1b7a('0x1c')];var _0x3d6657=_0x42d8f5?_0x171b83[_0x1b7a('0x1e')]:_0x49a66e['offset']+_0x49a66e[_0x1b7a('0x1f')];var _0x34d8a4;if(_0x3d6657>=_0x35773a){_0x3d6657=_0x35773a;_0x34d8a4=0xc8;}else{_0x34d8a4=0xce;}_0x339802[_0x1b7a('0x1a')](_0x34d8a4);return _0x339802[_0x1b7a('0x20')](_0x1b7a('0x21'),_0x195b51+'-'+_0x3d6657+'/'+_0x35773a)['json'](_0x171b83);}return null;};}function patchUpdates(_0x1caae8){return function(_0x2b5dcb){try{jsonpatch[_0x1b7a('0x22')](_0x2b5dcb,_0x1caae8,!![]);}catch(_0x45e6dd){return BPromise[_0x1b7a('0x23')](_0x45e6dd);}return _0x2b5dcb['save']();};}function saveUpdates(_0x3190c1,_0x57e79f){return function(_0x28d6b7){if(_0x28d6b7){return _0x28d6b7[_0x1b7a('0x24')](_0x3190c1)[_0x1b7a('0x25')](function(_0x22d0b1){return _0x22d0b1;});}return null;};}function removeEntity(_0x5b3b38,_0x358d43){return function(_0x3ee349){if(_0x3ee349){return _0x3ee349[_0x1b7a('0x26')]()[_0x1b7a('0x25')](function(){var _0x393751=_0x3ee349[_0x1b7a('0x27')]({'plain':!![]});var _0x23a19b=_0x1b7a('0x28');return db[_0x1b7a('0x29')][_0x1b7a('0x26')]({'where':{'type':_0x23a19b,'resourceId':_0x393751['id']}})['then'](function(){return _0x3ee349;});})['then'](function(){_0x5b3b38['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21002d,_0x5cbe67){return function(_0x1a35cb){if(!_0x1a35cb){_0x21002d[_0x1b7a('0x19')](0x194);}return _0x1a35cb;};}function handleError(_0x1eb108,_0x1cd4d1){_0x1cd4d1=_0x1cd4d1||0x1f4;return function(_0x4dacdf){logger['error'](_0x4dacdf[_0x1b7a('0x2a')]);if(_0x4dacdf[_0x1b7a('0x2b')]){delete _0x4dacdf['name'];}_0x1eb108[_0x1b7a('0x1a')](_0x1cd4d1)[_0x1b7a('0x2c')](_0x4dacdf);};}exports['index']=function(_0x1f2010,_0x417473){var _0x1cc519={},_0x11b997={},_0x4fd185={'count':0x0,'rows':[]};var _0x387bca=_[_0x1b7a('0x2d')](db['Sound']['rawAttributes'],function(_0x11ae81){return{'name':_0x11ae81[_0x1b7a('0x2e')],'type':_0x11ae81[_0x1b7a('0x2f')][_0x1b7a('0x30')]};});_0x11b997[_0x1b7a('0x31')]=_[_0x1b7a('0x2d')](_0x387bca,'name');_0x11b997[_0x1b7a('0x32')]=_[_0x1b7a('0x33')](_0x1f2010[_0x1b7a('0x32')]);_0x11b997[_0x1b7a('0x34')]=_[_0x1b7a('0x35')](_0x11b997[_0x1b7a('0x31')],_0x11b997[_0x1b7a('0x32')]);_0x1cc519[_0x1b7a('0x36')]=_['intersection'](_0x11b997['model'],qs[_0x1b7a('0x37')](_0x1f2010[_0x1b7a('0x32')]['fields']));_0x1cc519[_0x1b7a('0x36')]=_0x1cc519[_0x1b7a('0x36')][_0x1b7a('0x38')]?_0x1cc519['attributes']:_0x11b997[_0x1b7a('0x31')];if(!_0x1f2010[_0x1b7a('0x32')][_0x1b7a('0x39')](_0x1b7a('0x3a'))){_0x1cc519[_0x1b7a('0x1f')]=qs[_0x1b7a('0x1f')](_0x1f2010['query'][_0x1b7a('0x1f')]);_0x1cc519[_0x1b7a('0x1c')]=qs[_0x1b7a('0x1c')](_0x1f2010[_0x1b7a('0x32')][_0x1b7a('0x1c')]);}_0x1cc519['order']=qs[_0x1b7a('0x3b')](_0x1f2010[_0x1b7a('0x32')][_0x1b7a('0x3b')]);_0x1cc519[_0x1b7a('0x3c')]=qs[_0x1b7a('0x34')](_['pick'](_0x1f2010['query'],_0x11b997['filters']),_0x387bca);if(_0x1f2010[_0x1b7a('0x32')][_0x1b7a('0x3d')]){_0x1cc519[_0x1b7a('0x3c')]=_['merge'](_0x1cc519[_0x1b7a('0x3c')],{'$or':_[_0x1b7a('0x2d')](_0x387bca,function(_0x5ee1ca){if(_0x5ee1ca[_0x1b7a('0x2f')]!==_0x1b7a('0x3e')){var _0x5661ee={};_0x5661ee[_0x5ee1ca[_0x1b7a('0x2b')]]={'$like':'%'+_0x1f2010[_0x1b7a('0x32')]['filter']+'%'};return _0x5661ee;}})});}_0x1cc519=_[_0x1b7a('0x3f')]({},_0x1cc519,_0x1f2010['options']);var _0x16b8bf={'where':_0x1cc519[_0x1b7a('0x3c')]};return db[_0x1b7a('0x40')][_0x1b7a('0x1e')](_0x16b8bf)[_0x1b7a('0x25')](function(_0x59c3a8){_0x4fd185['count']=_0x59c3a8;if(_0x1f2010[_0x1b7a('0x32')][_0x1b7a('0x41')]){_0x1cc519[_0x1b7a('0x42')]=[{'all':!![]}];}return db[_0x1b7a('0x40')]['findAll'](_0x1cc519);})[_0x1b7a('0x25')](function(_0x293aba){_0x4fd185[_0x1b7a('0x43')]=_0x293aba;return _0x4fd185;})[_0x1b7a('0x25')](respondWithFilteredResult(_0x417473,_0x1cc519))[_0x1b7a('0x44')](handleError(_0x417473,null));};exports[_0x1b7a('0x45')]=function(_0x244862,_0x546cc6){var _0x509c8b={'raw':!![],'where':{'id':_0x244862[_0x1b7a('0x46')]['id']}},_0x2f8074={};_0x2f8074[_0x1b7a('0x31')]=_[_0x1b7a('0x33')](db[_0x1b7a('0x40')][_0x1b7a('0x47')]);_0x2f8074[_0x1b7a('0x32')]=_[_0x1b7a('0x33')](_0x244862[_0x1b7a('0x32')]);_0x2f8074[_0x1b7a('0x34')]=_[_0x1b7a('0x35')](_0x2f8074[_0x1b7a('0x31')],_0x2f8074['query']);_0x509c8b[_0x1b7a('0x36')]=_[_0x1b7a('0x35')](_0x2f8074[_0x1b7a('0x31')],qs[_0x1b7a('0x37')](_0x244862['query'][_0x1b7a('0x37')]));_0x509c8b[_0x1b7a('0x36')]=_0x509c8b['attributes'][_0x1b7a('0x38')]?_0x509c8b[_0x1b7a('0x36')]:_0x2f8074[_0x1b7a('0x31')];if(_0x244862[_0x1b7a('0x32')][_0x1b7a('0x41')]){_0x509c8b[_0x1b7a('0x42')]=[{'all':!![]}];}_0x509c8b=_['merge']({},_0x509c8b,_0x244862[_0x1b7a('0x48')]);return db[_0x1b7a('0x40')]['find'](_0x509c8b)[_0x1b7a('0x25')](handleEntityNotFound(_0x546cc6,null))[_0x1b7a('0x25')](respondWithResult(_0x546cc6,null))[_0x1b7a('0x44')](handleError(_0x546cc6,null));};exports[_0x1b7a('0x49')]=function(_0x1834b1,_0x219001,_0x2b3de6){return db[_0x1b7a('0x40')]['find']({'where':{'id':_0x1834b1[_0x1b7a('0x46')]['id']},'attributes':[_0x1b7a('0x2b'),_0x1b7a('0x4a'),_0x1b7a('0x4b')],'raw':!![]})[_0x1b7a('0x25')](handleEntityNotFound(_0x219001,null))[_0x1b7a('0x25')](function(_0x50eeef){if(_0x50eeef){if(!fs[_0x1b7a('0x4c')](path[_0x1b7a('0x4d')](config[_0x1b7a('0x4e')],_0x1b7a('0x4f'),_0x50eeef['save_name']+'.'+_0x50eeef['converted_format']))){throw new db[(_0x1b7a('0x50'))]['ValidationError'](_0x1b7a('0x51'));}return _0x219001[_0x1b7a('0x49')](path['join'](config[_0x1b7a('0x4e')],_0x1b7a('0x4f'),util[_0x1b7a('0x52')](_0x1b7a('0x53'),_0x50eeef[_0x1b7a('0x4a')],_0x50eeef[_0x1b7a('0x4b')])),util['format'](_0x1b7a('0x53'),_0x50eeef[_0x1b7a('0x2b')],_0x50eeef[_0x1b7a('0x4b')]));}return null;})[_0x1b7a('0x44')](handleError(_0x219001,null));};exports['create']=function(_0x12102f,_0x1b8530,_0x27470c){var _0x4f3085={'name':path[_0x1b7a('0x54')](_0x12102f[_0x1b7a('0x55')]['originalname'],path[_0x1b7a('0x56')](_0x12102f[_0x1b7a('0x55')][_0x1b7a('0x57')])),'save_name':path[_0x1b7a('0x54')](_0x12102f[_0x1b7a('0x55')][_0x1b7a('0x58')],path['extname'](_0x12102f[_0x1b7a('0x55')]['filename'])),'original_format':path[_0x1b7a('0x56')](_0x12102f[_0x1b7a('0x55')][_0x1b7a('0x57')])[_0x1b7a('0x59')](0x1),'converted_format':_0x1b7a('0x5a')};var _0x155624=path[_0x1b7a('0x4d')](config[_0x1b7a('0x4e')],_0x1b7a('0x5b'),_0x12102f['file'][_0x1b7a('0x58')]);var _0x5983f8=path[_0x1b7a('0x4d')](config[_0x1b7a('0x4e')],_0x1b7a('0x4f'),util[_0x1b7a('0x52')]('%s.%s',path[_0x1b7a('0x54')](_0x12102f[_0x1b7a('0x55')][_0x1b7a('0x58')],path['extname'](_0x12102f[_0x1b7a('0x55')][_0x1b7a('0x58')])),_0x4f3085['converted_format']));logger[_0x1b7a('0x5c')](_0x1b7a('0x5d'),_0x155624);logger[_0x1b7a('0x5c')](_0x1b7a('0x5e'),_0x5983f8);try{fs[_0x1b7a('0x5f')](_0x155624,parseInt(_0x1b7a('0x60'),0x8));var _0x5d65ae=sox[_0x1b7a('0x61')](_0x155624,_0x5983f8,{'sampleRate':0x1f40,'format':_0x1b7a('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5d65ae['on']('error',function(_0x185515){fs[_0x1b7a('0x62')](_0x155624);_0x1b8530[_0x1b7a('0x1a')](0x1f4)[_0x1b7a('0x2c')](_0x185515);});_0x5d65ae['on'](_0x1b7a('0x63'),function(_0x29e079){_0x4f3085[_0x1b7a('0x64')]=isNaN(_0x29e079[_0x1b7a('0x65')])?null:_0x29e079['duration']*0x3e8;_0x4f3085['original_sampleCount']=isNaN(_0x29e079[_0x1b7a('0x66')])?null:_0x29e079[_0x1b7a('0x66')];_0x4f3085[_0x1b7a('0x67')]=isNaN(_0x29e079[_0x1b7a('0x68')])?null:_0x29e079[_0x1b7a('0x68')];_0x4f3085[_0x1b7a('0x69')]=isNaN(_0x29e079['bitRate'])?null:_0x29e079[_0x1b7a('0x6a')];_0x4f3085['original_sampleRate']=isNaN(_0x29e079[_0x1b7a('0x6b')])?null:_0x29e079[_0x1b7a('0x6b')];});_0x5d65ae['on']('dest',function(_0x40650e){_0x4f3085[_0x1b7a('0x6c')]=isNaN(_0x40650e['duration'])?null:_0x40650e['duration']*0x3e8;_0x4f3085[_0x1b7a('0x6d')]=isNaN(_0x40650e[_0x1b7a('0x66')])?null:_0x40650e['sampleCount'];_0x4f3085[_0x1b7a('0x6e')]=isNaN(_0x40650e['channelCount'])?null:_0x40650e[_0x1b7a('0x68')];_0x4f3085[_0x1b7a('0x6f')]=isNaN(_0x40650e[_0x1b7a('0x6a')])?null:_0x40650e[_0x1b7a('0x6a')];_0x4f3085[_0x1b7a('0x70')]=isNaN(_0x40650e['sampleRate'])?null:_0x40650e['sampleRate'];});_0x5d65ae['on']('end',function(){fs[_0x1b7a('0x5f')](_0x5983f8,parseInt(_0x1b7a('0x60'),0x8));return db[_0x1b7a('0x40')]['create'](_0x4f3085)[_0x1b7a('0x25')](function(_0x49839f){var _0x3c9019={'role':_0x12102f[_0x1b7a('0x71')][_0x1b7a('0x72')],'userProfileId':_0x12102f['body'][_0x1b7a('0x73')]};if(!_0x3c9019)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c9019[_0x1b7a('0x72')]===_0x1b7a('0x74')){var _0x51efa2=_0x49839f[_0x1b7a('0x27')]({'plain':!![]});return db[_0x1b7a('0x75')][_0x1b7a('0x76')]({'where':{'name':_0x1b7a('0x28'),'userProfileId':_0x3c9019[_0x1b7a('0x73')]},'raw':!![]})['then'](function(_0xcee3e6){if(_0xcee3e6&&_0xcee3e6[_0x1b7a('0x77')]===0x0){return db[_0x1b7a('0x29')][_0x1b7a('0x78')]({'name':_0x51efa2[_0x1b7a('0x2b')],'resourceId':_0x51efa2['id'],'type':_0xcee3e6[_0x1b7a('0x2b')],'sectionId':_0xcee3e6['id']},{})[_0x1b7a('0x25')](function(){return _0x49839f;});}else{return _0x49839f;}})[_0x1b7a('0x44')](function(_0x5772cd){logger[_0x1b7a('0x79')](_0x1b7a('0x7a'),_0x5772cd);throw _0x5772cd;});}return _0x49839f;})['then'](respondWithResult(_0x1b8530,null))[_0x1b7a('0x44')](handleError(_0x1b8530,null));});_0x5d65ae[_0x1b7a('0x7b')]();}catch(_0x1b5333){_0x1b8530[_0x1b7a('0x1a')](0x1f4)['send'](_0x1b5333);}};exports[_0x1b7a('0x24')]=function(_0x3ccde1,_0x2c0fc2,_0x3fb9fb){return db[_0x1b7a('0x40')][_0x1b7a('0x76')]({'where':{'id':_0x3ccde1[_0x1b7a('0x46')]['id']}})[_0x1b7a('0x25')](handleEntityNotFound(_0x2c0fc2,null))[_0x1b7a('0x25')](saveUpdates(_[_0x1b7a('0x7c')](_0x3ccde1[_0x1b7a('0x71')],[_0x1b7a('0x2b'),_0x1b7a('0x7d')]),null))[_0x1b7a('0x25')](respondWithResult(_0x2c0fc2,null))[_0x1b7a('0x44')](handleError(_0x2c0fc2,null));};exports[_0x1b7a('0x7e')]=function(_0x3023ca,_0x4f6927,_0x13459e){return db[_0x1b7a('0x40')][_0x1b7a('0x76')]({'where':{'id':_0x3023ca[_0x1b7a('0x46')]['id']}})[_0x1b7a('0x25')](function(_0x902727){if(_0x902727){return _0x902727[_0x1b7a('0x26')]();}})[_0x1b7a('0x25')](function(_0x16db74){var _0x4020aa=path[_0x1b7a('0x4d')](config['root'],_0x1b7a('0x5b'),util[_0x1b7a('0x52')](_0x1b7a('0x53'),_0x16db74[_0x1b7a('0x4a')],_0x16db74[_0x1b7a('0x7f')]));var _0x59857c=path[_0x1b7a('0x4d')](config[_0x1b7a('0x4e')],_0x1b7a('0x4f'),util[_0x1b7a('0x52')]('%s.%s',_0x16db74[_0x1b7a('0x4a')],_0x16db74[_0x1b7a('0x4b')]));fs[_0x1b7a('0x62')](_0x4020aa);fs[_0x1b7a('0x62')](_0x59857c);return _0x16db74;})[_0x1b7a('0x25')](function(_0x4774b6){if(_0x4774b6){return _0x4f6927[_0x1b7a('0x1a')](0xcc)[_0x1b7a('0x80')]();}})[_0x1b7a('0x25')](handleEntityNotFound(_0x4f6927,null))[_0x1b7a('0x44')](handleError(_0x4f6927,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index ed17f26..a2da1ef 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 _0x8877=['./sound.attributes','exports','define','Sound','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x496c30,_0x4f32cf){var _0x168fbb=function(_0x26a112){while(--_0x26a112){_0x496c30['push'](_0x496c30['shift']());}};_0x168fbb(++_0x4f32cf);}(_0x8877,0x1b1));var _0x7887=function(_0x580a59,_0x21266c){_0x580a59=_0x580a59-0x0;var _0x19da51=_0x8877[_0x580a59];return _0x19da51;};'use strict';var _=require(_0x7887('0x0'));var util=require(_0x7887('0x1'));var logger=require(_0x7887('0x2'))(_0x7887('0x3'));var moment=require(_0x7887('0x4'));var BPromise=require(_0x7887('0x5'));var rp=require(_0x7887('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7887('0x7'));var config=require(_0x7887('0x8'));var attributes=require(_0x7887('0x9'));module[_0x7887('0xa')]=function(_0x2de722,_0x3e9e6c){return _0x2de722[_0x7887('0xb')](_0x7887('0xc'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8e8=['../../config/logger','api','moment','./sound.attributes','exports','define','tools_sounds','lodash'];(function(_0x4e5eb8,_0x224fac){var _0xde25cb=function(_0x2f66e2){while(--_0x2f66e2){_0x4e5eb8['push'](_0x4e5eb8['shift']());}};_0xde25cb(++_0x224fac);}(_0xa8e8,0x1bf));var _0x8a8e=function(_0x3b231a,_0x53a00d){_0x3b231a=_0x3b231a-0x0;var _0x18d67a=_0xa8e8[_0x3b231a];return _0x18d67a;};'use strict';var _=require(_0x8a8e('0x0'));var util=require('util');var logger=require(_0x8a8e('0x1'))(_0x8a8e('0x2'));var moment=require(_0x8a8e('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(_0x8a8e('0x4'));module[_0x8a8e('0x5')]=function(_0x45ef94,_0x2d2eed){return _0x45ef94[_0x8a8e('0x6')]('Sound',attributes,{'tableName':_0x8a8e('0x7'),'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 c9bf19d..2e47405 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 _0x3184=['code','Sound,\x20%s,\x20%s','message','result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','model','map','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x48d2f9,_0x2e4981){var _0x2d9527=function(_0xc37d7b){while(--_0xc37d7b){_0x48d2f9['push'](_0x48d2f9['shift']());}};_0x2d9527(++_0x2e4981);}(_0x3184,0x138));var _0x4318=function(_0x3c5924,_0x4d295f){_0x3c5924=_0x3c5924-0x0;var _0x576958=_0x3184[_0x3c5924];return _0x576958;};'use strict';var _=require(_0x4318('0x0'));var util=require(_0x4318('0x1'));var moment=require(_0x4318('0x2'));var BPromise=require(_0x4318('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4318('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4318('0x5'));var logger=require(_0x4318('0x6'))(_0x4318('0x7'));var config=require(_0x4318('0x8'));var jayson=require(_0x4318('0x9'));var client=jayson['client'][_0x4318('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2378f5,_0x8cb205,_0x3c4c83){return new BPromise(function(_0x2ecf9c,_0xf4bdb){return client['request'](_0x2378f5,_0x3c4c83)[_0x4318('0xb')](function(_0x3e1c94){logger[_0x4318('0xc')]('Sound,\x20%s,\x20%s',_0x8cb205,_0x4318('0xd'));logger[_0x4318('0xe')](_0x4318('0xf'),_0x8cb205,_0x4318('0xd'),JSON[_0x4318('0x10')](_0x3e1c94));if(_0x3e1c94[_0x4318('0x11')]){if(_0x3e1c94[_0x4318('0x11')][_0x4318('0x12')]===0x1f4){logger[_0x4318('0x11')](_0x4318('0x13'),_0x8cb205,_0x3e1c94['error']['message']);return _0xf4bdb(_0x3e1c94[_0x4318('0x11')][_0x4318('0x14')]);}logger[_0x4318('0x11')](_0x4318('0x13'),_0x8cb205,_0x3e1c94[_0x4318('0x11')][_0x4318('0x14')]);return _0x2ecf9c(_0x3e1c94[_0x4318('0x11')]['message']);}else{logger[_0x4318('0xc')](_0x4318('0x13'),_0x8cb205,_0x4318('0xd'));_0x2ecf9c(_0x3e1c94[_0x4318('0x15')][_0x4318('0x14')]);}})[_0x4318('0x16')](function(_0x4f111e){logger['error'](_0x4318('0x13'),_0x8cb205,_0x4f111e);_0xf4bdb(_0x4f111e);});});}exports[_0x4318('0x17')]=function(_0x40e79f){var _0x29d229=this;return new Promise(function(_0x249fae,_0x249e3d){return db[_0x4318('0x18')][_0x4318('0x19')]({'raw':_0x40e79f[_0x4318('0x1a')]?_0x40e79f[_0x4318('0x1a')][_0x4318('0x1b')]===undefined?!![]:![]:!![],'where':_0x40e79f[_0x4318('0x1a')]?_0x40e79f[_0x4318('0x1a')][_0x4318('0x1c')]||null:null,'attributes':_0x40e79f[_0x4318('0x1a')]?_0x40e79f[_0x4318('0x1a')][_0x4318('0x1d')]||null:null,'include':_0x40e79f[_0x4318('0x1a')]?_0x40e79f[_0x4318('0x1a')][_0x4318('0x1e')]?_['map'](_0x40e79f['options']['include'],function(_0x58c6e3){return{'model':db[_0x58c6e3[_0x4318('0x1f')]],'as':_0x58c6e3['as'],'attributes':_0x58c6e3['attributes'],'include':_0x58c6e3[_0x4318('0x1e')]?_[_0x4318('0x20')](_0x58c6e3[_0x4318('0x1e')],function(_0x10808e){return{'model':db[_0x10808e[_0x4318('0x1f')]],'as':_0x10808e['as'],'attributes':_0x10808e[_0x4318('0x1d')],'include':_0x10808e[_0x4318('0x1e')]?_[_0x4318('0x20')](_0x10808e['include'],function(_0x2d64c3){return{'model':db[_0x2d64c3[_0x4318('0x1f')]],'as':_0x2d64c3['as'],'attributes':_0x2d64c3[_0x4318('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43c327){logger['info'](_0x4318('0x17'),_0x40e79f);logger[_0x4318('0xe')](_0x4318('0x17'),_0x40e79f,JSON['stringify'](_0x43c327));_0x249fae(_0x43c327);})[_0x4318('0x16')](function(_0x3f4b3d){logger[_0x4318('0x11')](_0x4318('0x17'),_0x3f4b3d['message'],_0x40e79f);_0x249e3d(_0x29d229[_0x4318('0x11')](0x1f4,_0x3f4b3d['message']));});});}; \ No newline at end of file +var _0xb8d5=['Sound','options','where','include','model','attributes','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSound'];(function(_0x32d406,_0x2cde0c){var _0x26d871=function(_0xcfacac){while(--_0xcfacac){_0x32d406['push'](_0x32d406['shift']());}};_0x26d871(++_0x2cde0c);}(_0xb8d5,0x67));var _0x5b8d=function(_0x4f0323,_0x3d0da4){_0x4f0323=_0x4f0323-0x0;var _0x5701dc=_0xb8d5[_0x4f0323];return _0x5701dc;};'use strict';var _=require(_0x5b8d('0x0'));var util=require(_0x5b8d('0x1'));var moment=require(_0x5b8d('0x2'));var BPromise=require(_0x5b8d('0x3'));var rs=require(_0x5b8d('0x4'));var fs=require('fs');var Redis=require(_0x5b8d('0x5'));var db=require(_0x5b8d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b8d('0x7'))('rpc');var config=require(_0x5b8d('0x8'));var jayson=require(_0x5b8d('0x9'));var client=jayson[_0x5b8d('0xa')][_0x5b8d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54d3c6,_0x102cc7,_0x283080){return new BPromise(function(_0x372e3f,_0x3d8669){return client[_0x5b8d('0xc')](_0x54d3c6,_0x283080)[_0x5b8d('0xd')](function(_0xb1adfe){logger[_0x5b8d('0xe')](_0x5b8d('0xf'),_0x102cc7,_0x5b8d('0x10'));logger[_0x5b8d('0x11')](_0x5b8d('0x12'),_0x102cc7,_0x5b8d('0x10'),JSON[_0x5b8d('0x13')](_0xb1adfe));if(_0xb1adfe[_0x5b8d('0x14')]){if(_0xb1adfe[_0x5b8d('0x14')][_0x5b8d('0x15')]===0x1f4){logger[_0x5b8d('0x14')](_0x5b8d('0xf'),_0x102cc7,_0xb1adfe['error']['message']);return _0x3d8669(_0xb1adfe['error'][_0x5b8d('0x16')]);}logger[_0x5b8d('0x14')](_0x5b8d('0xf'),_0x102cc7,_0xb1adfe[_0x5b8d('0x14')][_0x5b8d('0x16')]);return _0x372e3f(_0xb1adfe[_0x5b8d('0x14')][_0x5b8d('0x16')]);}else{logger[_0x5b8d('0xe')]('Sound,\x20%s,\x20%s',_0x102cc7,_0x5b8d('0x10'));_0x372e3f(_0xb1adfe['result']['message']);}})[_0x5b8d('0x17')](function(_0x7ecbed){logger[_0x5b8d('0x14')](_0x5b8d('0xf'),_0x102cc7,_0x7ecbed);_0x3d8669(_0x7ecbed);});});}exports[_0x5b8d('0x18')]=function(_0x335b1e){var _0x4bc4c9=this;return new Promise(function(_0x37631e,_0x27c0ed){return db[_0x5b8d('0x19')]['find']({'raw':_0x335b1e[_0x5b8d('0x1a')]?_0x335b1e[_0x5b8d('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x335b1e[_0x5b8d('0x1a')]?_0x335b1e[_0x5b8d('0x1a')][_0x5b8d('0x1b')]||null:null,'attributes':_0x335b1e['options']?_0x335b1e['options']['attributes']||null:null,'include':_0x335b1e[_0x5b8d('0x1a')]?_0x335b1e['options']['include']?_['map'](_0x335b1e['options'][_0x5b8d('0x1c')],function(_0x1e6907){return{'model':db[_0x1e6907[_0x5b8d('0x1d')]],'as':_0x1e6907['as'],'attributes':_0x1e6907[_0x5b8d('0x1e')],'include':_0x1e6907[_0x5b8d('0x1c')]?_['map'](_0x1e6907['include'],function(_0x44c2ee){return{'model':db[_0x44c2ee[_0x5b8d('0x1d')]],'as':_0x44c2ee['as'],'attributes':_0x44c2ee[_0x5b8d('0x1e')],'include':_0x44c2ee[_0x5b8d('0x1c')]?_[_0x5b8d('0x1f')](_0x44c2ee[_0x5b8d('0x1c')],function(_0x55c5b6){return{'model':db[_0x55c5b6[_0x5b8d('0x1d')]],'as':_0x55c5b6['as'],'attributes':_0x55c5b6[_0x5b8d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5b8d('0xd')](function(_0x997b74){logger['info']('ShowSound',_0x335b1e);logger[_0x5b8d('0x11')](_0x5b8d('0x18'),_0x335b1e,JSON[_0x5b8d('0x13')](_0x997b74));_0x37631e(_0x997b74);})[_0x5b8d('0x17')](function(_0xbbde7b){logger[_0x5b8d('0x14')](_0x5b8d('0x18'),_0xbbde7b[_0x5b8d('0x16')],_0x335b1e);_0x27c0ed(_0x4bc4c9[_0x5b8d('0x14')](0x1f4,_0xbbde7b['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index c3cdc5e..b0ee8f0 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 _0x14a0=['get','isAuthenticated','/:id','show','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareMessage.controller'];(function(_0x1ad6b4,_0x4bc291){var _0x16db8b=function(_0x4ea367){while(--_0x4ea367){_0x1ad6b4['push'](_0x1ad6b4['shift']());}};_0x16db8b(++_0x4bc291);}(_0x14a0,0x8e));var _0x014a=function(_0x191b1a,_0x48e0e6){_0x191b1a=_0x191b1a-0x0;var _0x283089=_0x14a0[_0x191b1a];return _0x283089;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x014a('0xd')]('/:id',auth[_0x014a('0x9')](),controller[_0x014a('0xe')]);module['exports']=router; \ No newline at end of file +var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x3782f1,_0xdb9da7){var _0x59aa2c=function(_0x3ecfb1){while(--_0x3ecfb1){_0x3782f1['push'](_0x3782f1['shift']());}};_0x59aa2c(++_0xdb9da7);}(_0x4fc2,0x111));var _0x24fc=function(_0x71435,_0x5627a7){_0x71435=_0x71435-0x0;var _0x40de4f=_0x4fc2[_0x71435];return _0x40de4f;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('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 c300fd2..8fbb60f 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 _0x3e80=['STRING','TEXT','medium','ENUM','out','sequelize'];(function(_0x458a62,_0x29f5b0){var _0xe10016=function(_0x39ec06){while(--_0x39ec06){_0x458a62['push'](_0x458a62['shift']());}};_0xe10016(++_0x29f5b0);}(_0x3e80,0x125));var _0x03e8=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0x3e80[_0x3902c1];return _0x1266cc;};'use strict';var Sequelize=require(_0x03e8('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x03e8('0x1')]},'body':{'type':Sequelize[_0x03e8('0x2')](_0x03e8('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x03e8('0x4')]('in',_0x03e8('0x5')),'defaultValue':_0x03e8('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x03e8('0x1')]},'providerResponse':{'type':Sequelize[_0x03e8('0x2')]}}; \ No newline at end of file +var _0x1c6c=['out','STRING','exports','TEXT','medium'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1c6c,0x75));var _0xc1c6=function(_0x40dc5c,_0x24f401){_0x40dc5c=_0x40dc5c-0x0;var _0x14ef46=_0x1c6c[_0x40dc5c];return _0x14ef46;};'use strict';var Sequelize=require('sequelize');module[_0xc1c6('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xc1c6('0x1')](_0xc1c6('0x2')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xc1c6('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0xc1c6('0x4')]},'providerResponse':{'type':Sequelize[_0xc1c6('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 6b38d8b..4a0bcc7 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 _0x8d9e=['Content-Range','apply','destroy','then','error','name','send','index','SquareMessage','fieldName','type','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','VIRTUAL','options','where','include','rows','catch','show','params','rawAttributes','keys','includeAll','create','body','update','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x8d9e,0x150));var _0xe8d9=function(_0x1c060b,_0x1f3697){_0x1c060b=_0x1c060b-0x0;var _0x5835e9=_0x8d9e[_0x1c060b];return _0x5835e9;};'use strict';var emlformat=require(_0xe8d9('0x0'));var rimraf=require(_0xe8d9('0x1'));var zipdir=require(_0xe8d9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8d9('0x3'));var moment=require(_0xe8d9('0x4'));var BPromise=require(_0xe8d9('0x5'));var Mustache=require(_0xe8d9('0x6'));var util=require(_0xe8d9('0x7'));var path=require(_0xe8d9('0x8'));var sox=require(_0xe8d9('0x9'));var csv=require('to-csv');var ejs=require(_0xe8d9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe8d9('0xb'));var crypto=require(_0xe8d9('0xc'));var jsforce=require(_0xe8d9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe8d9('0xe'));var Papa=require(_0xe8d9('0xf'));var Redis=require(_0xe8d9('0x10'));var authService=require(_0xe8d9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe8d9('0x12'));var hardwareService=require(_0xe8d9('0x13'));var logger=require(_0xe8d9('0x14'))(_0xe8d9('0x15'));var utils=require(_0xe8d9('0x16'));var config=require(_0xe8d9('0x17'));var licenseUtil=require(_0xe8d9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1879e5,_0xaeb699){_0xaeb699=_0xaeb699||0xcc;return function(_0x4dba98){if(_0x4dba98){return _0x1879e5[_0xe8d9('0x19')](_0xaeb699);}return _0x1879e5[_0xe8d9('0x1a')](_0xaeb699)[_0xe8d9('0x1b')]();};}function respondWithResult(_0x1c4424,_0x279191){_0x279191=_0x279191||0xc8;return function(_0x2937f0){if(_0x2937f0){return _0x1c4424[_0xe8d9('0x1a')](_0x279191)[_0xe8d9('0x1c')](_0x2937f0);}};}function respondWithFilteredResult(_0x25809b,_0x12461e){return function(_0x1410ac){if(_0x1410ac){var _0xc368c0=typeof _0x12461e[_0xe8d9('0x1d')]===_0xe8d9('0x1e')&&typeof _0x12461e[_0xe8d9('0x1f')]===_0xe8d9('0x1e');var _0x17151f=_0x1410ac[_0xe8d9('0x20')];var _0x59d637=_0xc368c0?0x0:_0x12461e[_0xe8d9('0x1d')];var _0x2d7f7b=_0xc368c0?_0x1410ac[_0xe8d9('0x20')]:_0x12461e[_0xe8d9('0x1d')]+_0x12461e[_0xe8d9('0x1f')];var _0x5d218d;if(_0x2d7f7b>=_0x17151f){_0x2d7f7b=_0x17151f;_0x5d218d=0xc8;}else{_0x5d218d=0xce;}_0x25809b['status'](_0x5d218d);return _0x25809b[_0xe8d9('0x21')](_0xe8d9('0x22'),_0x59d637+'-'+_0x2d7f7b+'/'+_0x17151f)[_0xe8d9('0x1c')](_0x1410ac);}return null;};}function patchUpdates(_0x14457b){return function(_0x3a67ed){try{jsonpatch[_0xe8d9('0x23')](_0x3a67ed,_0x14457b,!![]);}catch(_0x50e2bd){return BPromise['reject'](_0x50e2bd);}return _0x3a67ed['save']();};}function saveUpdates(_0x114e21,_0x49f129){return function(_0x1ac3a3){if(_0x1ac3a3){return _0x1ac3a3['update'](_0x114e21)['then'](function(_0x2204bf){return _0x2204bf;});}return null;};}function removeEntity(_0x9fa977,_0x20e6bd){return function(_0x59ce5a){if(_0x59ce5a){return _0x59ce5a[_0xe8d9('0x24')]()[_0xe8d9('0x25')](function(){_0x9fa977[_0xe8d9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x803244,_0x1f31a9){return function(_0x56c2bd){if(!_0x56c2bd){_0x803244['sendStatus'](0x194);}return _0x56c2bd;};}function handleError(_0x4138a5,_0x419a63){_0x419a63=_0x419a63||0x1f4;return function(_0x4ba551){logger[_0xe8d9('0x26')](_0x4ba551['stack']);if(_0x4ba551[_0xe8d9('0x27')]){delete _0x4ba551['name'];}_0x4138a5[_0xe8d9('0x1a')](_0x419a63)[_0xe8d9('0x28')](_0x4ba551);};}exports[_0xe8d9('0x29')]=function(_0x441218,_0xd1903f){var _0x58dec1={},_0x5e9559={},_0x29b476={'count':0x0,'rows':[]};var _0xc0422a=_['map'](db[_0xe8d9('0x2a')]['rawAttributes'],function(_0x11ed5d){return{'name':_0x11ed5d[_0xe8d9('0x2b')],'type':_0x11ed5d[_0xe8d9('0x2c')]['key']};});_0x5e9559[_0xe8d9('0x2d')]=_[_0xe8d9('0x2e')](_0xc0422a,'name');_0x5e9559[_0xe8d9('0x2f')]=_['keys'](_0x441218[_0xe8d9('0x2f')]);_0x5e9559['filters']=_[_0xe8d9('0x30')](_0x5e9559[_0xe8d9('0x2d')],_0x5e9559[_0xe8d9('0x2f')]);_0x58dec1[_0xe8d9('0x31')]=_[_0xe8d9('0x30')](_0x5e9559[_0xe8d9('0x2d')],qs[_0xe8d9('0x32')](_0x441218[_0xe8d9('0x2f')]['fields']));_0x58dec1[_0xe8d9('0x31')]=_0x58dec1[_0xe8d9('0x31')][_0xe8d9('0x33')]?_0x58dec1['attributes']:_0x5e9559[_0xe8d9('0x2d')];if(!_0x441218['query'][_0xe8d9('0x34')](_0xe8d9('0x35'))){_0x58dec1[_0xe8d9('0x1f')]=qs[_0xe8d9('0x1f')](_0x441218[_0xe8d9('0x2f')][_0xe8d9('0x1f')]);_0x58dec1['offset']=qs['offset'](_0x441218[_0xe8d9('0x2f')]['offset']);}_0x58dec1['order']=qs[_0xe8d9('0x36')](_0x441218['query'][_0xe8d9('0x36')]);_0x58dec1['where']=qs[_0xe8d9('0x37')](_[_0xe8d9('0x38')](_0x441218[_0xe8d9('0x2f')],_0x5e9559[_0xe8d9('0x37')]),_0xc0422a);if(_0x441218[_0xe8d9('0x2f')][_0xe8d9('0x39')]){_0x58dec1['where']=_[_0xe8d9('0x3a')](_0x58dec1['where'],{'$or':_['map'](_0xc0422a,function(_0x55ade5){if(_0x55ade5[_0xe8d9('0x2c')]!==_0xe8d9('0x3b')){var _0x1e1f0b={};_0x1e1f0b[_0x55ade5[_0xe8d9('0x27')]]={'$like':'%'+_0x441218['query'][_0xe8d9('0x39')]+'%'};return _0x1e1f0b;}})});}_0x58dec1=_['merge']({},_0x58dec1,_0x441218[_0xe8d9('0x3c')]);var _0x54627d={'where':_0x58dec1[_0xe8d9('0x3d')]};return db[_0xe8d9('0x2a')][_0xe8d9('0x20')](_0x54627d)[_0xe8d9('0x25')](function(_0x2498d0){_0x29b476[_0xe8d9('0x20')]=_0x2498d0;if(_0x441218[_0xe8d9('0x2f')]['includeAll']){_0x58dec1[_0xe8d9('0x3e')]=[{'all':!![]}];}return db[_0xe8d9('0x2a')]['findAll'](_0x58dec1);})['then'](function(_0x3f7a8c){_0x29b476[_0xe8d9('0x3f')]=_0x3f7a8c;return _0x29b476;})[_0xe8d9('0x25')](respondWithFilteredResult(_0xd1903f,_0x58dec1))[_0xe8d9('0x40')](handleError(_0xd1903f,null));};exports[_0xe8d9('0x41')]=function(_0x3afaef,_0x18f6e9){var _0x4e0c37={'raw':!![],'where':{'id':_0x3afaef[_0xe8d9('0x42')]['id']}},_0x742855={};_0x742855[_0xe8d9('0x2d')]=_['keys'](db[_0xe8d9('0x2a')][_0xe8d9('0x43')]);_0x742855[_0xe8d9('0x2f')]=_[_0xe8d9('0x44')](_0x3afaef[_0xe8d9('0x2f')]);_0x742855['filters']=_[_0xe8d9('0x30')](_0x742855[_0xe8d9('0x2d')],_0x742855[_0xe8d9('0x2f')]);_0x4e0c37[_0xe8d9('0x31')]=_[_0xe8d9('0x30')](_0x742855[_0xe8d9('0x2d')],qs['fields'](_0x3afaef[_0xe8d9('0x2f')][_0xe8d9('0x32')]));_0x4e0c37[_0xe8d9('0x31')]=_0x4e0c37[_0xe8d9('0x31')][_0xe8d9('0x33')]?_0x4e0c37[_0xe8d9('0x31')]:_0x742855[_0xe8d9('0x2d')];if(_0x3afaef['query'][_0xe8d9('0x45')]){_0x4e0c37[_0xe8d9('0x3e')]=[{'all':!![]}];}_0x4e0c37=_['merge']({},_0x4e0c37,_0x3afaef['options']);return db['SquareMessage']['find'](_0x4e0c37)[_0xe8d9('0x25')](handleEntityNotFound(_0x18f6e9,null))[_0xe8d9('0x25')](respondWithResult(_0x18f6e9,null))[_0xe8d9('0x40')](handleError(_0x18f6e9,null));};exports[_0xe8d9('0x46')]=function(_0xacff9e,_0x3f36b8){return db['SquareMessage'][_0xe8d9('0x46')](_0xacff9e[_0xe8d9('0x47')],{})[_0xe8d9('0x25')](respondWithResult(_0x3f36b8,0xc9))[_0xe8d9('0x40')](handleError(_0x3f36b8,null));};exports[_0xe8d9('0x48')]=function(_0x4d4ba5,_0x2fc897){if(_0x4d4ba5['body']['id']){delete _0x4d4ba5[_0xe8d9('0x47')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x4d4ba5['params']['id']}})[_0xe8d9('0x25')](handleEntityNotFound(_0x2fc897,null))[_0xe8d9('0x25')](saveUpdates(_0x4d4ba5[_0xe8d9('0x47')],null))[_0xe8d9('0x25')](respondWithResult(_0x2fc897,null))[_0xe8d9('0x40')](handleError(_0x2fc897,null));};exports['destroy']=function(_0x4b4189,_0x1d52e6){return db[_0xe8d9('0x2a')][_0xe8d9('0x49')]({'where':{'id':_0x4b4189[_0xe8d9('0x42')]['id']}})['then'](handleEntityNotFound(_0x1d52e6,null))[_0xe8d9('0x25')](removeEntity(_0x1d52e6,null))[_0xe8d9('0x40')](handleError(_0x1d52e6,null));}; \ No newline at end of file +var _0x7033=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','then','findAll','rows','catch','show','includeAll','include','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','destroy','sendStatus','error','stack','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','model','query'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7033,0x19e));var _0x3703=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x7033[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0x3703('0x0'));var rimraf=require(_0x3703('0x1'));var zipdir=require(_0x3703('0x2'));var jsonpatch=require(_0x3703('0x3'));var rp=require('request-promise');var moment=require(_0x3703('0x4'));var BPromise=require(_0x3703('0x5'));var Mustache=require(_0x3703('0x6'));var util=require(_0x3703('0x7'));var path=require(_0x3703('0x8'));var sox=require(_0x3703('0x9'));var csv=require(_0x3703('0xa'));var ejs=require(_0x3703('0xb'));var fs=require('fs');var fs_extra=require(_0x3703('0xc'));var _=require(_0x3703('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3703('0xe'));var toCsv=require(_0x3703('0xa'));var querystring=require(_0x3703('0xf'));var Papa=require(_0x3703('0x10'));var Redis=require(_0x3703('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3703('0x12'));var as=require(_0x3703('0x13'));var hardwareService=require(_0x3703('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3703('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3703('0x16'));var db=require(_0x3703('0x17'))['db'];function respondWithStatusCode(_0x31c0df,_0x41af55){_0x41af55=_0x41af55||0xcc;return function(_0x520ce3){if(_0x520ce3){return _0x31c0df['sendStatus'](_0x41af55);}return _0x31c0df[_0x3703('0x18')](_0x41af55)[_0x3703('0x19')]();};}function respondWithResult(_0x44d586,_0x6318f2){_0x6318f2=_0x6318f2||0xc8;return function(_0x25d3ef){if(_0x25d3ef){return _0x44d586[_0x3703('0x18')](_0x6318f2)[_0x3703('0x1a')](_0x25d3ef);}};}function respondWithFilteredResult(_0x12d16c,_0x23b04e){return function(_0x2457c1){if(_0x2457c1){var _0x3a8a89=typeof _0x23b04e[_0x3703('0x1b')]===_0x3703('0x1c')&&typeof _0x23b04e[_0x3703('0x1d')]==='undefined';var _0x3cbbce=_0x2457c1['count'];var _0x10ff16=_0x3a8a89?0x0:_0x23b04e['offset'];var _0x433d67=_0x3a8a89?_0x2457c1['count']:_0x23b04e[_0x3703('0x1b')]+_0x23b04e[_0x3703('0x1d')];var _0x5deb5b;if(_0x433d67>=_0x3cbbce){_0x433d67=_0x3cbbce;_0x5deb5b=0xc8;}else{_0x5deb5b=0xce;}_0x12d16c[_0x3703('0x18')](_0x5deb5b);return _0x12d16c[_0x3703('0x1e')](_0x3703('0x1f'),_0x10ff16+'-'+_0x433d67+'/'+_0x3cbbce)[_0x3703('0x1a')](_0x2457c1);}return null;};}function patchUpdates(_0x2a4983){return function(_0x51b1c8){try{jsonpatch[_0x3703('0x20')](_0x51b1c8,_0x2a4983,!![]);}catch(_0xc45c46){return BPromise[_0x3703('0x21')](_0xc45c46);}return _0x51b1c8['save']();};}function saveUpdates(_0x386c4a,_0x255266){return function(_0x10c74d){if(_0x10c74d){return _0x10c74d['update'](_0x386c4a)['then'](function(_0x4b9d6f){return _0x4b9d6f;});}return null;};}function removeEntity(_0x425388,_0x34aaf8){return function(_0x306905){if(_0x306905){return _0x306905[_0x3703('0x22')]()['then'](function(){_0x425388['status'](0xcc)[_0x3703('0x19')]();});}};}function handleEntityNotFound(_0x5e68f2,_0x5a48c5){return function(_0x45dccc){if(!_0x45dccc){_0x5e68f2[_0x3703('0x23')](0x194);}return _0x45dccc;};}function handleError(_0x480df6,_0x21a95c){_0x21a95c=_0x21a95c||0x1f4;return function(_0x35d577){logger[_0x3703('0x24')](_0x35d577[_0x3703('0x25')]);if(_0x35d577[_0x3703('0x26')]){delete _0x35d577['name'];}_0x480df6['status'](_0x21a95c)[_0x3703('0x27')](_0x35d577);};}exports['index']=function(_0x1e280c,_0x1b8211){var _0x5f31df={},_0x5cda62={},_0x1f912d={'count':0x0,'rows':[]};var _0x216818=_[_0x3703('0x28')](db[_0x3703('0x29')][_0x3703('0x2a')],function(_0x2be412){return{'name':_0x2be412[_0x3703('0x2b')],'type':_0x2be412[_0x3703('0x2c')][_0x3703('0x2d')]};});_0x5cda62[_0x3703('0x2e')]=_[_0x3703('0x28')](_0x216818,'name');_0x5cda62[_0x3703('0x2f')]=_[_0x3703('0x30')](_0x1e280c[_0x3703('0x2f')]);_0x5cda62[_0x3703('0x31')]=_[_0x3703('0x32')](_0x5cda62[_0x3703('0x2e')],_0x5cda62[_0x3703('0x2f')]);_0x5f31df[_0x3703('0x33')]=_[_0x3703('0x32')](_0x5cda62[_0x3703('0x2e')],qs[_0x3703('0x34')](_0x1e280c[_0x3703('0x2f')][_0x3703('0x34')]));_0x5f31df[_0x3703('0x33')]=_0x5f31df[_0x3703('0x33')][_0x3703('0x35')]?_0x5f31df[_0x3703('0x33')]:_0x5cda62[_0x3703('0x2e')];if(!_0x1e280c[_0x3703('0x2f')][_0x3703('0x36')](_0x3703('0x37'))){_0x5f31df[_0x3703('0x1d')]=qs['limit'](_0x1e280c[_0x3703('0x2f')]['limit']);_0x5f31df[_0x3703('0x1b')]=qs['offset'](_0x1e280c[_0x3703('0x2f')][_0x3703('0x1b')]);}_0x5f31df[_0x3703('0x38')]=qs[_0x3703('0x39')](_0x1e280c[_0x3703('0x2f')]['sort']);_0x5f31df[_0x3703('0x3a')]=qs['filters'](_[_0x3703('0x3b')](_0x1e280c[_0x3703('0x2f')],_0x5cda62[_0x3703('0x31')]),_0x216818);if(_0x1e280c['query'][_0x3703('0x3c')]){_0x5f31df['where']=_[_0x3703('0x3d')](_0x5f31df[_0x3703('0x3a')],{'$or':_[_0x3703('0x28')](_0x216818,function(_0x1e72b5){if(_0x1e72b5[_0x3703('0x2c')]!==_0x3703('0x3e')){var _0x5f4006={};_0x5f4006[_0x1e72b5['name']]={'$like':'%'+_0x1e280c[_0x3703('0x2f')][_0x3703('0x3c')]+'%'};return _0x5f4006;}})});}_0x5f31df=_['merge']({},_0x5f31df,_0x1e280c[_0x3703('0x3f')]);var _0x1f537a={'where':_0x5f31df[_0x3703('0x3a')]};return db[_0x3703('0x29')][_0x3703('0x40')](_0x1f537a)[_0x3703('0x41')](function(_0x1e2341){_0x1f912d[_0x3703('0x40')]=_0x1e2341;if(_0x1e280c[_0x3703('0x2f')]['includeAll']){_0x5f31df['include']=[{'all':!![]}];}return db[_0x3703('0x29')][_0x3703('0x42')](_0x5f31df);})['then'](function(_0x39760d){_0x1f912d[_0x3703('0x43')]=_0x39760d;return _0x1f912d;})[_0x3703('0x41')](respondWithFilteredResult(_0x1b8211,_0x5f31df))[_0x3703('0x44')](handleError(_0x1b8211,null));};exports[_0x3703('0x45')]=function(_0x30b20f,_0x2e6986){var _0xb54e6c={'raw':!![],'where':{'id':_0x30b20f['params']['id']}},_0x1d39c7={};_0x1d39c7['model']=_[_0x3703('0x30')](db['SquareMessage']['rawAttributes']);_0x1d39c7[_0x3703('0x2f')]=_[_0x3703('0x30')](_0x30b20f[_0x3703('0x2f')]);_0x1d39c7[_0x3703('0x31')]=_[_0x3703('0x32')](_0x1d39c7[_0x3703('0x2e')],_0x1d39c7[_0x3703('0x2f')]);_0xb54e6c['attributes']=_[_0x3703('0x32')](_0x1d39c7[_0x3703('0x2e')],qs[_0x3703('0x34')](_0x30b20f[_0x3703('0x2f')]['fields']));_0xb54e6c['attributes']=_0xb54e6c[_0x3703('0x33')][_0x3703('0x35')]?_0xb54e6c[_0x3703('0x33')]:_0x1d39c7[_0x3703('0x2e')];if(_0x30b20f[_0x3703('0x2f')][_0x3703('0x46')]){_0xb54e6c[_0x3703('0x47')]=[{'all':!![]}];}_0xb54e6c=_['merge']({},_0xb54e6c,_0x30b20f[_0x3703('0x3f')]);return db[_0x3703('0x29')][_0x3703('0x48')](_0xb54e6c)[_0x3703('0x41')](handleEntityNotFound(_0x2e6986,null))['then'](respondWithResult(_0x2e6986,null))['catch'](handleError(_0x2e6986,null));};exports['create']=function(_0x55bd5b,_0x34d3b2){return db[_0x3703('0x29')][_0x3703('0x49')](_0x55bd5b['body'],{})[_0x3703('0x41')](respondWithResult(_0x34d3b2,0xc9))['catch'](handleError(_0x34d3b2,null));};exports[_0x3703('0x4a')]=function(_0x2ab470,_0x2e19f6){if(_0x2ab470['body']['id']){delete _0x2ab470[_0x3703('0x4b')]['id'];}return db[_0x3703('0x29')][_0x3703('0x48')]({'where':{'id':_0x2ab470[_0x3703('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2e19f6,null))['then'](saveUpdates(_0x2ab470['body'],null))[_0x3703('0x41')](respondWithResult(_0x2e19f6,null))['catch'](handleError(_0x2e19f6,null));};exports[_0x3703('0x22')]=function(_0x528db8,_0x2b30d7){return db['SquareMessage'][_0x3703('0x48')]({'where':{'id':_0x528db8[_0x3703('0x4c')]['id']}})[_0x3703('0x41')](handleEntityNotFound(_0x2b30d7,null))['then'](removeEntity(_0x2b30d7,null))[_0x3703('0x44')](handleError(_0x2b30d7,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index d2c361d..70622b8 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 _0x8713=['bluebird','request-promise','path','rimraf','./squareMessage.attributes','exports','define','SquareMessage','square_messages','util','../../config/logger','api','moment'];(function(_0x1e6c29,_0x1477cf){var _0x2b2139=function(_0x2f43e8){while(--_0x2f43e8){_0x1e6c29['push'](_0x1e6c29['shift']());}};_0x2b2139(++_0x1477cf);}(_0x8713,0x1ea));var _0x3871=function(_0x3340d4,_0x298331){_0x3340d4=_0x3340d4-0x0;var _0xc6be90=_0x8713[_0x3340d4];return _0xc6be90;};'use strict';var _=require('lodash');var util=require(_0x3871('0x0'));var logger=require(_0x3871('0x1'))(_0x3871('0x2'));var moment=require(_0x3871('0x3'));var BPromise=require(_0x3871('0x4'));var rp=require(_0x3871('0x5'));var fs=require('fs');var path=require(_0x3871('0x6'));var rimraf=require(_0x3871('0x7'));var config=require('../../config/environment');var attributes=require(_0x3871('0x8'));module[_0x3871('0x9')]=function(_0x556645,_0x47a21f){return _0x556645[_0x3871('0xa')](_0x3871('0xb'),attributes,{'tableName':_0x3871('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4167=['define','SquareMessage','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4167,0x86));var _0x7416=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4167[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7416('0x0'));var logger=require(_0x7416('0x1'))('api');var moment=require(_0x7416('0x2'));var BPromise=require(_0x7416('0x3'));var rp=require(_0x7416('0x4'));var fs=require('fs');var path=require(_0x7416('0x5'));var rimraf=require(_0x7416('0x6'));var config=require(_0x7416('0x7'));var attributes=require('./squareMessage.attributes');module[_0x7416('0x8')]=function(_0x354dfa,_0x2b8440){return _0x354dfa[_0x7416('0x9')](_0x7416('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 60c97d4..119595c 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 _0x3565=['SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','SquareMessage,\x20%s,\x20%s','result','catch','CreateSquareMessage','SquareMessage','options','debug','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent'];(function(_0x28585e,_0x1d87fa){var _0x39fe34=function(_0x5e5345){while(--_0x5e5345){_0x28585e['push'](_0x28585e['shift']());}};_0x39fe34(++_0x1d87fa);}(_0x3565,0x150));var _0x5356=function(_0x3baba2,_0x3272b8){_0x3baba2=_0x3baba2-0x0;var _0x591aee=_0x3565[_0x3baba2];return _0x591aee;};'use strict';var _=require(_0x5356('0x0'));var util=require('util');var moment=require(_0x5356('0x1'));var BPromise=require(_0x5356('0x2'));var rs=require(_0x5356('0x3'));var fs=require('fs');var Redis=require(_0x5356('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5356('0x5'));var logger=require(_0x5356('0x6'))(_0x5356('0x7'));var config=require(_0x5356('0x8'));var jayson=require(_0x5356('0x9'));var client=jayson['client'][_0x5356('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24210f,_0x59f385,_0x5408b5){return new BPromise(function(_0x11e56b,_0x6b4516){return client['request'](_0x24210f,_0x5408b5)[_0x5356('0xb')](function(_0x175337){logger[_0x5356('0xc')]('SquareMessage,\x20%s,\x20%s',_0x59f385,_0x5356('0xd'));logger['debug'](_0x5356('0xe'),_0x59f385,_0x5356('0xd'),JSON[_0x5356('0xf')](_0x175337));if(_0x175337[_0x5356('0x10')]){if(_0x175337[_0x5356('0x10')]['code']===0x1f4){logger[_0x5356('0x10')]('SquareMessage,\x20%s,\x20%s',_0x59f385,_0x175337[_0x5356('0x10')][_0x5356('0x11')]);return _0x6b4516(_0x175337[_0x5356('0x10')]['message']);}logger[_0x5356('0x10')](_0x5356('0x12'),_0x59f385,_0x175337[_0x5356('0x10')]['message']);return _0x11e56b(_0x175337[_0x5356('0x10')][_0x5356('0x11')]);}else{logger[_0x5356('0xc')](_0x5356('0x12'),_0x59f385,_0x5356('0xd'));_0x11e56b(_0x175337[_0x5356('0x13')][_0x5356('0x11')]);}})[_0x5356('0x14')](function(_0x39291d){logger[_0x5356('0x10')]('SquareMessage,\x20%s,\x20%s',_0x59f385,_0x39291d);_0x6b4516(_0x39291d);});});}exports[_0x5356('0x15')]=function(_0x4405f5){var _0xd5b927=this;return new Promise(function(_0x1880fd,_0x416c1c){return db[_0x5356('0x16')]['create'](_0x4405f5['body'],{'raw':_0x4405f5['options']?_0x4405f5[_0x5356('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x15ece6){logger[_0x5356('0xc')](_0x5356('0x15'),_0x4405f5);logger[_0x5356('0x18')](_0x5356('0x15'),_0x4405f5,JSON[_0x5356('0xf')](_0x15ece6));_0x1880fd(_0x15ece6);})[_0x5356('0x14')](function(_0x31b792){logger[_0x5356('0x10')](_0x5356('0x15'),_0x31b792[_0x5356('0x11')],_0x4405f5);_0x416c1c(_0xd5b927['error'](0x1f4,_0x31b792[_0x5356('0x11')]));});});}; \ No newline at end of file +var _0x21af=['info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x2d7a63,_0x596e4c){var _0x94f1c=function(_0x18cffe){while(--_0x18cffe){_0x2d7a63['push'](_0x2d7a63['shift']());}};_0x94f1c(++_0x596e4c);}(_0x21af,0x15a));var _0xf21a=function(_0x2c9f32,_0x24b4aa){_0x2c9f32=_0x2c9f32-0x0;var _0x236b83=_0x21af[_0x2c9f32];return _0x236b83;};'use strict';var _=require(_0xf21a('0x0'));var util=require(_0xf21a('0x1'));var moment=require(_0xf21a('0x2'));var BPromise=require(_0xf21a('0x3'));var rs=require(_0xf21a('0x4'));var fs=require('fs');var Redis=require(_0xf21a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf21a('0x6'));var logger=require(_0xf21a('0x7'))(_0xf21a('0x8'));var config=require(_0xf21a('0x9'));var jayson=require(_0xf21a('0xa'));var client=jayson[_0xf21a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57951,_0x33423a,_0x328e28){return new BPromise(function(_0x500dc0,_0x3ffb3c){return client[_0xf21a('0xc')](_0x57951,_0x328e28)[_0xf21a('0xd')](function(_0x3503a6){logger[_0xf21a('0xe')](_0xf21a('0xf'),_0x33423a,_0xf21a('0x10'));logger[_0xf21a('0x11')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x33423a,'request\x20sent',JSON[_0xf21a('0x12')](_0x3503a6));if(_0x3503a6[_0xf21a('0x13')]){if(_0x3503a6[_0xf21a('0x13')][_0xf21a('0x14')]===0x1f4){logger['error'](_0xf21a('0xf'),_0x33423a,_0x3503a6[_0xf21a('0x13')]['message']);return _0x3ffb3c(_0x3503a6[_0xf21a('0x13')][_0xf21a('0x15')]);}logger[_0xf21a('0x13')]('SquareMessage,\x20%s,\x20%s',_0x33423a,_0x3503a6[_0xf21a('0x13')][_0xf21a('0x15')]);return _0x500dc0(_0x3503a6[_0xf21a('0x13')]['message']);}else{logger[_0xf21a('0xe')]('SquareMessage,\x20%s,\x20%s',_0x33423a,_0xf21a('0x10'));_0x500dc0(_0x3503a6[_0xf21a('0x16')]['message']);}})[_0xf21a('0x17')](function(_0x3f4c92){logger[_0xf21a('0x13')](_0xf21a('0xf'),_0x33423a,_0x3f4c92);_0x3ffb3c(_0x3f4c92);});});}exports[_0xf21a('0x18')]=function(_0x4a6747){var _0x2f6fd1=this;return new Promise(function(_0x1d438e,_0x53e8bd){return db[_0xf21a('0x19')][_0xf21a('0x1a')](_0x4a6747[_0xf21a('0x1b')],{'raw':_0x4a6747[_0xf21a('0x1c')]?_0x4a6747[_0xf21a('0x1c')][_0xf21a('0x1d')]===undefined?!![]:![]:!![]})[_0xf21a('0xd')](function(_0x3cc614){logger[_0xf21a('0xe')](_0xf21a('0x18'),_0x4a6747);logger[_0xf21a('0x11')](_0xf21a('0x18'),_0x4a6747,JSON['stringify'](_0x3cc614));_0x1d438e(_0x3cc614);})['catch'](function(_0x72aa5){logger['error'](_0xf21a('0x18'),_0x72aa5[_0xf21a('0x15')],_0x4a6747);_0x53e8bd(_0x2f6fd1[_0xf21a('0x13')](0x1f4,_0x72aa5[_0xf21a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index fd4cb59..6fe8295 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 _0xf36e=['destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','show','15s','post','create','put','/:id','update','delete'];(function(_0x4dd524,_0x2247e5){var _0x482629=function(_0x1fc3a0){while(--_0x1fc3a0){_0x4dd524['push'](_0x4dd524['shift']());}};_0x482629(++_0x2247e5);}(_0xf36e,0x166));var _0xef36=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf36e[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0xef36('0x0'));var path=require(_0xef36('0x1'));var timeout=require(_0xef36('0x2'));var express=require('express');var router=express[_0xef36('0x3')]();var fs_extra=require(_0xef36('0x4'));var auth=require(_0xef36('0x5'));var interaction=require(_0xef36('0x6'));var config=require(_0xef36('0x7'));var controller=require(_0xef36('0x8'));router[_0xef36('0x9')]('/',auth[_0xef36('0xa')](),controller[_0xef36('0xb')]);router[_0xef36('0x9')]('/:id',auth[_0xef36('0xa')](),controller[_0xef36('0xc')]);router[_0xef36('0x9')]('/:id/test',auth[_0xef36('0xa')](),timeout(_0xef36('0xd')),controller['test']);router[_0xef36('0xe')]('/',auth[_0xef36('0xa')](),controller[_0xef36('0xf')]);router[_0xef36('0x10')](_0xef36('0x11'),auth[_0xef36('0xa')](),controller[_0xef36('0x12')]);router[_0xef36('0x13')](_0xef36('0x11'),auth[_0xef36('0xa')](),controller[_0xef36('0x14')]);module['exports']=router; \ No newline at end of file +var _0x3e52=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/test','test','post','put','update','destroy','exports','multer'];(function(_0x59a205,_0x3fc4be){var _0x4979d0=function(_0x319862){while(--_0x319862){_0x59a205['push'](_0x59a205['shift']());}};_0x4979d0(++_0x3fc4be);}(_0x3e52,0xbc));var _0x23e5=function(_0xe734f7,_0x52c2ff){_0xe734f7=_0xe734f7-0x0;var _0x3a77ec=_0x3e52[_0xe734f7];return _0x3a77ec;};'use strict';var multer=require(_0x23e5('0x0'));var util=require(_0x23e5('0x1'));var path=require(_0x23e5('0x2'));var timeout=require(_0x23e5('0x3'));var express=require(_0x23e5('0x4'));var router=express[_0x23e5('0x5')]();var fs_extra=require(_0x23e5('0x6'));var auth=require(_0x23e5('0x7'));var interaction=require(_0x23e5('0x8'));var config=require(_0x23e5('0x9'));var controller=require('./squareOdbc.controller');router[_0x23e5('0xa')]('/',auth[_0x23e5('0xb')](),controller[_0x23e5('0xc')]);router[_0x23e5('0xa')](_0x23e5('0xd'),auth[_0x23e5('0xb')](),controller['show']);router[_0x23e5('0xa')](_0x23e5('0xe'),auth[_0x23e5('0xb')](),timeout('15s'),controller[_0x23e5('0xf')]);router[_0x23e5('0x10')]('/',auth[_0x23e5('0xb')](),controller['create']);router[_0x23e5('0x11')](_0x23e5('0xd'),auth[_0x23e5('0xb')](),controller[_0x23e5('0x12')]);router['delete'](_0x23e5('0xd'),auth[_0x23e5('0xb')](),controller[_0x23e5('0x13')]);module[_0x23e5('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index e35d2b6..b04c6b5 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 _0xd035=['STRING','sequelize','exports'];(function(_0x16e6fb,_0x4f9d99){var _0x5ea0e9=function(_0x2bd07f){while(--_0x2bd07f){_0x16e6fb['push'](_0x16e6fb['shift']());}};_0x5ea0e9(++_0x4f9d99);}(_0xd035,0x1e1));var _0x5d03=function(_0x3e0b8f,_0x1cddeb){_0x3e0b8f=_0x3e0b8f-0x0;var _0x22f742=_0xd035[_0x3e0b8f];return _0x22f742;};'use strict';var Sequelize=require(_0x5d03('0x0'));module[_0x5d03('0x1')]={'name':{'type':Sequelize[_0x5d03('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x5d03('0x2')]},'description':{'type':Sequelize[_0x5d03('0x2')]}}; \ No newline at end of file +var _0x8294=['exports','STRING','name','sequelize'];(function(_0x36d910,_0x2e8f99){var _0x4bba9e=function(_0x4255a7){while(--_0x4255a7){_0x36d910['push'](_0x36d910['shift']());}};_0x4bba9e(++_0x2e8f99);}(_0x8294,0xbf));var _0x4829=function(_0x2a0fde,_0x31df5d){_0x2a0fde=_0x2a0fde-0x0;var _0x20b510=_0x8294[_0x2a0fde];return _0x20b510;};'use strict';var Sequelize=require(_0x4829('0x0'));module[_0x4829('0x1')]={'name':{'type':Sequelize[_0x4829('0x2')],'unique':_0x4829('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index c0a0b3b..4833dc6 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 _0x4dab=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','SquareOdbc','includeAll','include','findAll','rows','catch','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','test','openSync','dsn','closeSync','eml-format','fast-json-patch','request-promise','moment','util','path','sox','fs-extra','squel','crypto','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','../../mysqldb','sendStatus'];(function(_0x5808d3,_0x4f8862){var _0x38e313=function(_0x18c759){while(--_0x18c759){_0x5808d3['push'](_0x5808d3['shift']());}};_0x38e313(++_0x4f8862);}(_0x4dab,0xf1));var _0xb4da=function(_0x40cf40,_0x250ce2){_0x40cf40=_0x40cf40-0x0;var _0x37e951=_0x4dab[_0x40cf40];return _0x37e951;};'use strict';var emlformat=require(_0xb4da('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb4da('0x1'));var rp=require(_0xb4da('0x2'));var moment=require(_0xb4da('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb4da('0x4'));var path=require(_0xb4da('0x5'));var sox=require(_0xb4da('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb4da('0x7'));var _=require('lodash');var squel=require(_0xb4da('0x8'));var crypto=require(_0xb4da('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xb4da('0xa'));var toCsv=require(_0xb4da('0xb'));var querystring=require(_0xb4da('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb4da('0xd'));var qs=require(_0xb4da('0xe'));var as=require(_0xb4da('0xf'));var hardwareService=require(_0xb4da('0x10'));var logger=require(_0xb4da('0x11'))(_0xb4da('0x12'));var utils=require(_0xb4da('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xb4da('0x14'));var db=require(_0xb4da('0x15'))['db'];function respondWithStatusCode(_0x1797d5,_0x418363){_0x418363=_0x418363||0xcc;return function(_0xe567ca){if(_0xe567ca){return _0x1797d5[_0xb4da('0x16')](_0x418363);}return _0x1797d5[_0xb4da('0x17')](_0x418363)['end']();};}function respondWithResult(_0x51404d,_0xf705ca){_0xf705ca=_0xf705ca||0xc8;return function(_0xcc9da4){if(_0xcc9da4){return _0x51404d[_0xb4da('0x17')](_0xf705ca)[_0xb4da('0x18')](_0xcc9da4);}};}function respondWithFilteredResult(_0x2197e2,_0x501e49){return function(_0x4d074e){if(_0x4d074e){var _0x445908=typeof _0x501e49[_0xb4da('0x19')]===_0xb4da('0x1a')&&typeof _0x501e49[_0xb4da('0x1b')]===_0xb4da('0x1a');var _0x3b0f45=_0x4d074e['count'];var _0x242743=_0x445908?0x0:_0x501e49[_0xb4da('0x19')];var _0xd3c9ac=_0x445908?_0x4d074e[_0xb4da('0x1c')]:_0x501e49['offset']+_0x501e49[_0xb4da('0x1b')];var _0x325149;if(_0xd3c9ac>=_0x3b0f45){_0xd3c9ac=_0x3b0f45;_0x325149=0xc8;}else{_0x325149=0xce;}_0x2197e2[_0xb4da('0x17')](_0x325149);return _0x2197e2[_0xb4da('0x1d')](_0xb4da('0x1e'),_0x242743+'-'+_0xd3c9ac+'/'+_0x3b0f45)[_0xb4da('0x18')](_0x4d074e);}return null;};}function patchUpdates(_0x5309ee){return function(_0x13abdd){try{jsonpatch[_0xb4da('0x1f')](_0x13abdd,_0x5309ee,!![]);}catch(_0x1b5d88){return BPromise[_0xb4da('0x20')](_0x1b5d88);}return _0x13abdd[_0xb4da('0x21')]();};}function saveUpdates(_0x431ec3,_0x587523){return function(_0x2f5908){if(_0x2f5908){return _0x2f5908['update'](_0x431ec3)[_0xb4da('0x22')](function(_0x2dea98){return _0x2dea98;});}return null;};}function removeEntity(_0x1cc90e,_0x48394d){return function(_0x1ad866){if(_0x1ad866){return _0x1ad866[_0xb4da('0x23')]()['then'](function(){var _0x3cff30=_0x1ad866['get']({'plain':!![]});var _0x4209af='ODBC';return db[_0xb4da('0x24')]['destroy']({'where':{'type':_0x4209af,'resourceId':_0x3cff30['id']}})['then'](function(){return _0x1ad866;});})[_0xb4da('0x22')](function(){_0x1cc90e[_0xb4da('0x17')](0xcc)[_0xb4da('0x25')]();});}};}function handleEntityNotFound(_0x2271a7,_0xad4e62){return function(_0x2de36d){if(!_0x2de36d){_0x2271a7[_0xb4da('0x16')](0x194);}return _0x2de36d;};}function handleError(_0x1488db,_0x36f999){_0x36f999=_0x36f999||0x1f4;return function(_0x329a7d){logger[_0xb4da('0x26')](_0x329a7d[_0xb4da('0x27')]);if(_0x329a7d[_0xb4da('0x28')]){delete _0x329a7d[_0xb4da('0x28')];}_0x1488db[_0xb4da('0x17')](_0x36f999)[_0xb4da('0x29')](_0x329a7d);};}exports[_0xb4da('0x2a')]=function(_0x46ff3a,_0x4714da){var _0x183b3d={},_0x999dce={},_0xba0588={'count':0x0,'rows':[]};var _0x478035=_['map'](db['SquareOdbc'][_0xb4da('0x2b')],function(_0x174699){return{'name':_0x174699[_0xb4da('0x2c')],'type':_0x174699[_0xb4da('0x2d')][_0xb4da('0x2e')]};});_0x999dce['model']=_['map'](_0x478035,_0xb4da('0x28'));_0x999dce['query']=_[_0xb4da('0x2f')](_0x46ff3a[_0xb4da('0x30')]);_0x999dce[_0xb4da('0x31')]=_[_0xb4da('0x32')](_0x999dce[_0xb4da('0x33')],_0x999dce[_0xb4da('0x30')]);_0x183b3d[_0xb4da('0x34')]=_[_0xb4da('0x32')](_0x999dce['model'],qs['fields'](_0x46ff3a[_0xb4da('0x30')][_0xb4da('0x35')]));_0x183b3d[_0xb4da('0x34')]=_0x183b3d[_0xb4da('0x34')]['length']?_0x183b3d[_0xb4da('0x34')]:_0x999dce['model'];if(!_0x46ff3a[_0xb4da('0x30')]['hasOwnProperty'](_0xb4da('0x36'))){_0x183b3d['limit']=qs[_0xb4da('0x1b')](_0x46ff3a[_0xb4da('0x30')][_0xb4da('0x1b')]);_0x183b3d[_0xb4da('0x19')]=qs[_0xb4da('0x19')](_0x46ff3a[_0xb4da('0x30')]['offset']);}_0x183b3d[_0xb4da('0x37')]=qs['sort'](_0x46ff3a[_0xb4da('0x30')][_0xb4da('0x38')]);_0x183b3d['where']=qs[_0xb4da('0x31')](_[_0xb4da('0x39')](_0x46ff3a[_0xb4da('0x30')],_0x999dce['filters']),_0x478035);if(_0x46ff3a[_0xb4da('0x30')][_0xb4da('0x3a')]){_0x183b3d[_0xb4da('0x3b')]=_[_0xb4da('0x3c')](_0x183b3d[_0xb4da('0x3b')],{'$or':_[_0xb4da('0x3d')](_0x478035,function(_0x181be5){if(_0x181be5[_0xb4da('0x2d')]!==_0xb4da('0x3e')){var _0x4448ac={};_0x4448ac[_0x181be5['name']]={'$like':'%'+_0x46ff3a['query']['filter']+'%'};return _0x4448ac;}})});}_0x183b3d=_[_0xb4da('0x3c')]({},_0x183b3d,_0x46ff3a[_0xb4da('0x3f')]);var _0x25d6a8={'where':_0x183b3d['where']};return db[_0xb4da('0x40')][_0xb4da('0x1c')](_0x25d6a8)['then'](function(_0x121548){_0xba0588[_0xb4da('0x1c')]=_0x121548;if(_0x46ff3a[_0xb4da('0x30')][_0xb4da('0x41')]){_0x183b3d[_0xb4da('0x42')]=[{'all':!![]}];}return db['SquareOdbc'][_0xb4da('0x43')](_0x183b3d);})[_0xb4da('0x22')](function(_0x58401e){_0xba0588[_0xb4da('0x44')]=_0x58401e;return _0xba0588;})[_0xb4da('0x22')](respondWithFilteredResult(_0x4714da,_0x183b3d))[_0xb4da('0x45')](handleError(_0x4714da,null));};exports['show']=function(_0x19c695,_0x2030b9){var _0x2a1f5b={'raw':!![],'where':{'id':_0x19c695['params']['id']}},_0x3b460f={};_0x3b460f[_0xb4da('0x33')]=_[_0xb4da('0x2f')](db[_0xb4da('0x40')][_0xb4da('0x2b')]);_0x3b460f['query']=_[_0xb4da('0x2f')](_0x19c695[_0xb4da('0x30')]);_0x3b460f[_0xb4da('0x31')]=_[_0xb4da('0x32')](_0x3b460f[_0xb4da('0x33')],_0x3b460f['query']);_0x2a1f5b[_0xb4da('0x34')]=_[_0xb4da('0x32')](_0x3b460f[_0xb4da('0x33')],qs[_0xb4da('0x35')](_0x19c695[_0xb4da('0x30')][_0xb4da('0x35')]));_0x2a1f5b[_0xb4da('0x34')]=_0x2a1f5b['attributes'][_0xb4da('0x46')]?_0x2a1f5b[_0xb4da('0x34')]:_0x3b460f['model'];if(_0x19c695['query']['includeAll']){_0x2a1f5b['include']=[{'all':!![]}];}_0x2a1f5b=_[_0xb4da('0x3c')]({},_0x2a1f5b,_0x19c695['options']);return db[_0xb4da('0x40')][_0xb4da('0x47')](_0x2a1f5b)[_0xb4da('0x22')](handleEntityNotFound(_0x2030b9,null))[_0xb4da('0x22')](respondWithResult(_0x2030b9,null))[_0xb4da('0x45')](handleError(_0x2030b9,null));};exports[_0xb4da('0x48')]=function(_0x54dd21,_0x1362e9){return db[_0xb4da('0x40')][_0xb4da('0x48')](_0x54dd21[_0xb4da('0x49')],{})[_0xb4da('0x22')](function(_0x598b6d){var _0x57e054=_0x54dd21[_0xb4da('0x4a')][_0xb4da('0x4b')]({'plain':!![]});if(!_0x57e054)throw new Error(_0xb4da('0x4c'));if(_0x57e054[_0xb4da('0x4d')]===_0xb4da('0x4a')){var _0x58f638=_0x598b6d[_0xb4da('0x4b')]({'plain':!![]});var _0x58b51b=_0xb4da('0x4e');return db[_0xb4da('0x4f')][_0xb4da('0x47')]({'where':{'name':_0x58b51b,'userProfileId':_0x57e054[_0xb4da('0x50')]},'raw':!![]})[_0xb4da('0x22')](function(_0x168cf7){if(_0x168cf7&&_0x168cf7['autoAssociation']===0x0){return db['UserProfileResource'][_0xb4da('0x48')]({'name':_0x58f638[_0xb4da('0x28')],'resourceId':_0x58f638['id'],'type':_0x168cf7[_0xb4da('0x28')],'sectionId':_0x168cf7['id']},{})[_0xb4da('0x22')](function(){return _0x598b6d;});}else{return _0x598b6d;}})[_0xb4da('0x45')](function(_0xffce70){logger[_0xb4da('0x26')](_0xb4da('0x51'),_0xffce70);throw _0xffce70;});}return _0x598b6d;})[_0xb4da('0x22')](respondWithResult(_0x1362e9,0xc9))[_0xb4da('0x45')](handleError(_0x1362e9,null));};exports[_0xb4da('0x52')]=function(_0x334b9f,_0x3cdcdf){if(_0x334b9f['body']['id']){delete _0x334b9f[_0xb4da('0x49')]['id'];}return db[_0xb4da('0x40')][_0xb4da('0x47')]({'where':{'id':_0x334b9f['params']['id']}})[_0xb4da('0x22')](handleEntityNotFound(_0x3cdcdf,null))[_0xb4da('0x22')](saveUpdates(_0x334b9f[_0xb4da('0x49')],null))[_0xb4da('0x22')](respondWithResult(_0x3cdcdf,null))[_0xb4da('0x45')](handleError(_0x3cdcdf,null));};exports['destroy']=function(_0x364ab9,_0x257987){return db[_0xb4da('0x40')][_0xb4da('0x47')]({'where':{'id':_0x364ab9[_0xb4da('0x53')]['id']}})[_0xb4da('0x22')](handleEntityNotFound(_0x257987,null))[_0xb4da('0x22')](removeEntity(_0x257987,null))[_0xb4da('0x45')](handleError(_0x257987,null));};exports[_0xb4da('0x54')]=function(_0x3f3108,_0xd14858,_0x58758c){var _0x5efa3a;return db[_0xb4da('0x40')][_0xb4da('0x47')]({'where':{'id':_0x3f3108[_0xb4da('0x53')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0xd14858,null))[_0xb4da('0x22')](function(_0x1a4d65){if(_0x1a4d65){var _0x3ab569=require('odbc')();_0x3ab569[_0xb4da('0x55')](_0x1a4d65[_0xb4da('0x56')]);_0x3ab569[_0xb4da('0x57')]();return _0x1a4d65;}})['then'](respondWithResult(_0xd14858,null))[_0xb4da('0x45')](handleError(_0xd14858,null));}; \ No newline at end of file +var _0x652e=['end','json','offset','limit','count','status','apply','reject','save','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','index','SquareOdbc','fieldName','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','type','options','include','rows','show','params','keys','length','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','dsn','closeSync','eml-format','rimraf','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x652e,0x134));var _0xe652=function(_0x56936d,_0x4c8db0){_0x56936d=_0x56936d-0x0;var _0x30c07b=_0x652e[_0x56936d];return _0x30c07b;};'use strict';var emlformat=require(_0xe652('0x0'));var rimraf=require(_0xe652('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe652('0x2'));var moment=require(_0xe652('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe652('0x4'));var sox=require(_0xe652('0x5'));var csv=require(_0xe652('0x6'));var ejs=require(_0xe652('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe652('0x8'));var squel=require(_0xe652('0x9'));var crypto=require('crypto');var jsforce=require(_0xe652('0xa'));var deskjs=require(_0xe652('0xb'));var toCsv=require(_0xe652('0x6'));var querystring=require('querystring');var Papa=require(_0xe652('0xc'));var Redis=require(_0xe652('0xd'));var authService=require(_0xe652('0xe'));var qs=require(_0xe652('0xf'));var as=require(_0xe652('0x10'));var hardwareService=require(_0xe652('0x11'));var logger=require(_0xe652('0x12'))(_0xe652('0x13'));var utils=require(_0xe652('0x14'));var config=require(_0xe652('0x15'));var licenseUtil=require(_0xe652('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182b2e,_0x58ef94){_0x58ef94=_0x58ef94||0xcc;return function(_0x383601){if(_0x383601){return _0x182b2e[_0xe652('0x17')](_0x58ef94);}return _0x182b2e['status'](_0x58ef94)[_0xe652('0x18')]();};}function respondWithResult(_0x1250b6,_0x462eeb){_0x462eeb=_0x462eeb||0xc8;return function(_0x1275e9){if(_0x1275e9){return _0x1250b6['status'](_0x462eeb)[_0xe652('0x19')](_0x1275e9);}};}function respondWithFilteredResult(_0x4206d5,_0x381e83){return function(_0x10da77){if(_0x10da77){var _0x26bc9b=typeof _0x381e83[_0xe652('0x1a')]==='undefined'&&typeof _0x381e83[_0xe652('0x1b')]==='undefined';var _0xb929a0=_0x10da77['count'];var _0xcf74b0=_0x26bc9b?0x0:_0x381e83[_0xe652('0x1a')];var _0x591925=_0x26bc9b?_0x10da77[_0xe652('0x1c')]:_0x381e83['offset']+_0x381e83['limit'];var _0x202d8c;if(_0x591925>=_0xb929a0){_0x591925=_0xb929a0;_0x202d8c=0xc8;}else{_0x202d8c=0xce;}_0x4206d5[_0xe652('0x1d')](_0x202d8c);return _0x4206d5['set']('Content-Range',_0xcf74b0+'-'+_0x591925+'/'+_0xb929a0)[_0xe652('0x19')](_0x10da77);}return null;};}function patchUpdates(_0x428ec5){return function(_0x55d7dc){try{jsonpatch[_0xe652('0x1e')](_0x55d7dc,_0x428ec5,!![]);}catch(_0x350a28){return BPromise[_0xe652('0x1f')](_0x350a28);}return _0x55d7dc[_0xe652('0x20')]();};}function saveUpdates(_0x5e2dcf,_0x36d2ae){return function(_0x27aada){if(_0x27aada){return _0x27aada['update'](_0x5e2dcf)[_0xe652('0x21')](function(_0x19e13e){return _0x19e13e;});}return null;};}function removeEntity(_0xe7d820,_0x4085b1){return function(_0x597d84){if(_0x597d84){return _0x597d84[_0xe652('0x22')]()['then'](function(){var _0x498fa2=_0x597d84[_0xe652('0x23')]({'plain':!![]});var _0x45bd8a=_0xe652('0x24');return db[_0xe652('0x25')]['destroy']({'where':{'type':_0x45bd8a,'resourceId':_0x498fa2['id']}})[_0xe652('0x21')](function(){return _0x597d84;});})[_0xe652('0x21')](function(){_0xe7d820['status'](0xcc)[_0xe652('0x18')]();});}};}function handleEntityNotFound(_0x6c0f49,_0x539f3b){return function(_0x32b350){if(!_0x32b350){_0x6c0f49[_0xe652('0x17')](0x194);}return _0x32b350;};}function handleError(_0x46aae6,_0xf893b8){_0xf893b8=_0xf893b8||0x1f4;return function(_0x33d221){logger[_0xe652('0x26')](_0x33d221[_0xe652('0x27')]);if(_0x33d221[_0xe652('0x28')]){delete _0x33d221[_0xe652('0x28')];}_0x46aae6[_0xe652('0x1d')](_0xf893b8)[_0xe652('0x29')](_0x33d221);};}exports[_0xe652('0x2a')]=function(_0x51ae53,_0x129692){var _0x4dce7c={},_0x597943={},_0x4dd733={'count':0x0,'rows':[]};var _0x3139dd=_['map'](db[_0xe652('0x2b')]['rawAttributes'],function(_0x2b3c79){return{'name':_0x2b3c79[_0xe652('0x2c')],'type':_0x2b3c79['type'][_0xe652('0x2d')]};});_0x597943[_0xe652('0x2e')]=_[_0xe652('0x2f')](_0x3139dd,'name');_0x597943[_0xe652('0x30')]=_['keys'](_0x51ae53['query']);_0x597943[_0xe652('0x31')]=_[_0xe652('0x32')](_0x597943[_0xe652('0x2e')],_0x597943[_0xe652('0x30')]);_0x4dce7c[_0xe652('0x33')]=_[_0xe652('0x32')](_0x597943[_0xe652('0x2e')],qs[_0xe652('0x34')](_0x51ae53[_0xe652('0x30')][_0xe652('0x34')]));_0x4dce7c[_0xe652('0x33')]=_0x4dce7c['attributes']['length']?_0x4dce7c[_0xe652('0x33')]:_0x597943[_0xe652('0x2e')];if(!_0x51ae53[_0xe652('0x30')][_0xe652('0x35')]('nolimit')){_0x4dce7c['limit']=qs[_0xe652('0x1b')](_0x51ae53[_0xe652('0x30')]['limit']);_0x4dce7c['offset']=qs['offset'](_0x51ae53[_0xe652('0x30')][_0xe652('0x1a')]);}_0x4dce7c[_0xe652('0x36')]=qs[_0xe652('0x37')](_0x51ae53[_0xe652('0x30')][_0xe652('0x37')]);_0x4dce7c['where']=qs[_0xe652('0x31')](_[_0xe652('0x38')](_0x51ae53[_0xe652('0x30')],_0x597943[_0xe652('0x31')]),_0x3139dd);if(_0x51ae53['query'][_0xe652('0x39')]){_0x4dce7c[_0xe652('0x3a')]=_[_0xe652('0x3b')](_0x4dce7c[_0xe652('0x3a')],{'$or':_[_0xe652('0x2f')](_0x3139dd,function(_0x377355){if(_0x377355[_0xe652('0x3c')]!=='VIRTUAL'){var _0x341949={};_0x341949[_0x377355[_0xe652('0x28')]]={'$like':'%'+_0x51ae53['query'][_0xe652('0x39')]+'%'};return _0x341949;}})});}_0x4dce7c=_['merge']({},_0x4dce7c,_0x51ae53[_0xe652('0x3d')]);var _0x1419c9={'where':_0x4dce7c['where']};return db[_0xe652('0x2b')][_0xe652('0x1c')](_0x1419c9)[_0xe652('0x21')](function(_0x3b3a8d){_0x4dd733[_0xe652('0x1c')]=_0x3b3a8d;if(_0x51ae53[_0xe652('0x30')]['includeAll']){_0x4dce7c[_0xe652('0x3e')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x4dce7c);})['then'](function(_0xd6a5b5){_0x4dd733[_0xe652('0x3f')]=_0xd6a5b5;return _0x4dd733;})['then'](respondWithFilteredResult(_0x129692,_0x4dce7c))['catch'](handleError(_0x129692,null));};exports[_0xe652('0x40')]=function(_0x5e0066,_0x17b13e){var _0x32355b={'raw':!![],'where':{'id':_0x5e0066[_0xe652('0x41')]['id']}},_0x196e3f={};_0x196e3f[_0xe652('0x2e')]=_[_0xe652('0x42')](db[_0xe652('0x2b')]['rawAttributes']);_0x196e3f['query']=_[_0xe652('0x42')](_0x5e0066[_0xe652('0x30')]);_0x196e3f[_0xe652('0x31')]=_[_0xe652('0x32')](_0x196e3f['model'],_0x196e3f[_0xe652('0x30')]);_0x32355b[_0xe652('0x33')]=_['intersection'](_0x196e3f[_0xe652('0x2e')],qs['fields'](_0x5e0066[_0xe652('0x30')][_0xe652('0x34')]));_0x32355b['attributes']=_0x32355b['attributes'][_0xe652('0x43')]?_0x32355b[_0xe652('0x33')]:_0x196e3f[_0xe652('0x2e')];if(_0x5e0066['query'][_0xe652('0x44')]){_0x32355b['include']=[{'all':!![]}];}_0x32355b=_[_0xe652('0x3b')]({},_0x32355b,_0x5e0066[_0xe652('0x3d')]);return db['SquareOdbc']['find'](_0x32355b)[_0xe652('0x21')](handleEntityNotFound(_0x17b13e,null))[_0xe652('0x21')](respondWithResult(_0x17b13e,null))[_0xe652('0x45')](handleError(_0x17b13e,null));};exports[_0xe652('0x46')]=function(_0x4297b6,_0x2c4c9b){return db[_0xe652('0x2b')]['create'](_0x4297b6[_0xe652('0x47')],{})[_0xe652('0x21')](function(_0x12f77e){var _0x112647=_0x4297b6[_0xe652('0x48')][_0xe652('0x23')]({'plain':!![]});if(!_0x112647)throw new Error(_0xe652('0x49'));if(_0x112647[_0xe652('0x4a')]===_0xe652('0x48')){var _0x5752af=_0x12f77e[_0xe652('0x23')]({'plain':!![]});var _0x213084=_0xe652('0x24');return db[_0xe652('0x4b')][_0xe652('0x4c')]({'where':{'name':_0x213084,'userProfileId':_0x112647['userProfileId']},'raw':!![]})['then'](function(_0xcce5ea){if(_0xcce5ea&&_0xcce5ea[_0xe652('0x4d')]===0x0){return db[_0xe652('0x25')]['create']({'name':_0x5752af[_0xe652('0x28')],'resourceId':_0x5752af['id'],'type':_0xcce5ea[_0xe652('0x28')],'sectionId':_0xcce5ea['id']},{})[_0xe652('0x21')](function(){return _0x12f77e;});}else{return _0x12f77e;}})[_0xe652('0x45')](function(_0x508a11){logger[_0xe652('0x26')](_0xe652('0x4e'),_0x508a11);throw _0x508a11;});}return _0x12f77e;})[_0xe652('0x21')](respondWithResult(_0x2c4c9b,0xc9))[_0xe652('0x45')](handleError(_0x2c4c9b,null));};exports[_0xe652('0x4f')]=function(_0x44e86d,_0x1943b6){if(_0x44e86d[_0xe652('0x47')]['id']){delete _0x44e86d['body']['id'];}return db[_0xe652('0x2b')][_0xe652('0x4c')]({'where':{'id':_0x44e86d[_0xe652('0x41')]['id']}})[_0xe652('0x21')](handleEntityNotFound(_0x1943b6,null))[_0xe652('0x21')](saveUpdates(_0x44e86d[_0xe652('0x47')],null))[_0xe652('0x21')](respondWithResult(_0x1943b6,null))['catch'](handleError(_0x1943b6,null));};exports[_0xe652('0x22')]=function(_0x4b9255,_0x13b7e7){return db[_0xe652('0x2b')][_0xe652('0x4c')]({'where':{'id':_0x4b9255[_0xe652('0x41')]['id']}})[_0xe652('0x21')](handleEntityNotFound(_0x13b7e7,null))[_0xe652('0x21')](removeEntity(_0x13b7e7,null))[_0xe652('0x45')](handleError(_0x13b7e7,null));};exports[_0xe652('0x50')]=function(_0x2614c1,_0x2b1eec,_0x4bb1b2){var _0x41a89c;return db[_0xe652('0x2b')][_0xe652('0x4c')]({'where':{'id':_0x2614c1[_0xe652('0x41')]['id']},'attributes':['id',_0xe652('0x51')]})['then'](handleEntityNotFound(_0x2b1eec,null))[_0xe652('0x21')](function(_0x49acad){if(_0x49acad){var _0x1b75c5=require('odbc')();_0x1b75c5['openSync'](_0x49acad[_0xe652('0x51')]);_0x1b75c5[_0xe652('0x52')]();return _0x49acad;}})['then'](respondWithResult(_0x2b1eec,null))[_0xe652('0x45')](handleError(_0x2b1eec,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 1c4b811..1a6d8b7 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 _0xe742=['path','./squareOdbc.attributes','exports','define','SquareOdbc','../../config/logger','api','bluebird'];(function(_0x12ec6a,_0x201406){var _0x1659ed=function(_0x46f750){while(--_0x46f750){_0x12ec6a['push'](_0x12ec6a['shift']());}};_0x1659ed(++_0x201406);}(_0xe742,0x14d));var _0x2e74=function(_0x2dd38c,_0x23d700){_0x2dd38c=_0x2dd38c-0x0;var _0x3c6565=_0xe742[_0x2dd38c];return _0x3c6565;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2e74('0x0'))(_0x2e74('0x1'));var moment=require('moment');var BPromise=require(_0x2e74('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e74('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2e74('0x4'));module[_0x2e74('0x5')]=function(_0x2ef1b3,_0x31236e){return _0x2ef1b3[_0x2e74('0x6')](_0x2e74('0x7'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe658=['square_odbc','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','define'];(function(_0x457bc6,_0x431adc){var _0x337f06=function(_0x158788){while(--_0x158788){_0x457bc6['push'](_0x457bc6['shift']());}};_0x337f06(++_0x431adc);}(_0xe658,0x123));var _0x8e65=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xe658[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x8e65('0x0'));var util=require(_0x8e65('0x1'));var logger=require('../../config/logger')(_0x8e65('0x2'));var moment=require('moment');var BPromise=require(_0x8e65('0x3'));var rp=require(_0x8e65('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e65('0x5'));var config=require(_0x8e65('0x6'));var attributes=require(_0x8e65('0x7'));module['exports']=function(_0x5c2bf5,_0x27b972){return _0x5c2bf5[_0x8e65('0x8')]('SquareOdbc',attributes,{'tableName':_0x8e65('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 78235ca..c1692ff 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 _0x8cb0=['ShowSquareOdbc','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareOdbc','find','options','raw','where','include','map','attributes','model','then'];(function(_0x101f97,_0x5bb72e){var _0x137bcb=function(_0x16aeae){while(--_0x16aeae){_0x101f97['push'](_0x101f97['shift']());}};_0x137bcb(++_0x5bb72e);}(_0x8cb0,0x79));var _0x08cb=function(_0x4be204,_0x45ab53){_0x4be204=_0x4be204-0x0;var _0xc3f681=_0x8cb0[_0x4be204];return _0xc3f681;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x08cb('0x0'));var BPromise=require('bluebird');var rs=require(_0x08cb('0x1'));var fs=require('fs');var Redis=require(_0x08cb('0x2'));var db=require(_0x08cb('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x08cb('0x4'));var jayson=require(_0x08cb('0x5'));var client=jayson[_0x08cb('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ac38e,_0x296920,_0x269514){return new BPromise(function(_0x583cb3,_0x1c04d3){return client[_0x08cb('0x7')](_0x4ac38e,_0x269514)['then'](function(_0x3df29d){logger[_0x08cb('0x8')](_0x08cb('0x9'),_0x296920,_0x08cb('0xa'));logger[_0x08cb('0xb')](_0x08cb('0xc'),_0x296920,_0x08cb('0xa'),JSON[_0x08cb('0xd')](_0x3df29d));if(_0x3df29d[_0x08cb('0xe')]){if(_0x3df29d[_0x08cb('0xe')][_0x08cb('0xf')]===0x1f4){logger[_0x08cb('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x296920,_0x3df29d[_0x08cb('0xe')][_0x08cb('0x10')]);return _0x1c04d3(_0x3df29d[_0x08cb('0xe')][_0x08cb('0x10')]);}logger[_0x08cb('0xe')](_0x08cb('0x9'),_0x296920,_0x3df29d[_0x08cb('0xe')][_0x08cb('0x10')]);return _0x583cb3(_0x3df29d[_0x08cb('0xe')]['message']);}else{logger[_0x08cb('0x8')]('SquareOdbc,\x20%s,\x20%s',_0x296920,_0x08cb('0xa'));_0x583cb3(_0x3df29d[_0x08cb('0x11')]['message']);}})[_0x08cb('0x12')](function(_0x1c5712){logger[_0x08cb('0xe')](_0x08cb('0x9'),_0x296920,_0x1c5712);_0x1c04d3(_0x1c5712);});});}exports['ShowSquareOdbc']=function(_0x3b17dd){var _0x152c97=this;return new Promise(function(_0x309fed,_0x469d68){return db[_0x08cb('0x13')][_0x08cb('0x14')]({'raw':_0x3b17dd[_0x08cb('0x15')]?_0x3b17dd[_0x08cb('0x15')][_0x08cb('0x16')]===undefined?!![]:![]:!![],'where':_0x3b17dd['options']?_0x3b17dd[_0x08cb('0x15')][_0x08cb('0x17')]||null:null,'attributes':_0x3b17dd[_0x08cb('0x15')]?_0x3b17dd[_0x08cb('0x15')]['attributes']||null:null,'include':_0x3b17dd[_0x08cb('0x15')]?_0x3b17dd[_0x08cb('0x15')][_0x08cb('0x18')]?_[_0x08cb('0x19')](_0x3b17dd[_0x08cb('0x15')][_0x08cb('0x18')],function(_0x4c66e4){return{'model':db[_0x4c66e4['model']],'as':_0x4c66e4['as'],'attributes':_0x4c66e4[_0x08cb('0x1a')],'include':_0x4c66e4[_0x08cb('0x18')]?_[_0x08cb('0x19')](_0x4c66e4[_0x08cb('0x18')],function(_0x4af1a2){return{'model':db[_0x4af1a2[_0x08cb('0x1b')]],'as':_0x4af1a2['as'],'attributes':_0x4af1a2['attributes'],'include':_0x4af1a2[_0x08cb('0x18')]?_[_0x08cb('0x19')](_0x4af1a2[_0x08cb('0x18')],function(_0x44f710){return{'model':db[_0x44f710[_0x08cb('0x1b')]],'as':_0x44f710['as'],'attributes':_0x44f710[_0x08cb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x08cb('0x1c')](function(_0x2ffdb8){logger[_0x08cb('0x8')]('ShowSquareOdbc',_0x3b17dd);logger[_0x08cb('0xb')](_0x08cb('0x1d'),_0x3b17dd,JSON[_0x08cb('0xd')](_0x2ffdb8));_0x309fed(_0x2ffdb8);})[_0x08cb('0x12')](function(_0x31db97){logger[_0x08cb('0xe')](_0x08cb('0x1d'),_0x31db97[_0x08cb('0x10')],_0x3b17dd);_0x469d68(_0x152c97['error'](0x1f4,_0x31db97[_0x08cb('0x10')]));});});}; \ No newline at end of file +var _0xfeb6=['SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','attributes','map','include','model','stringify','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x32b69e,_0xc154fe){var _0x36fb0b=function(_0x138d95){while(--_0x138d95){_0x32b69e['push'](_0x32b69e['shift']());}};_0x36fb0b(++_0xc154fe);}(_0xfeb6,0x1b1));var _0x6feb=function(_0x677f1a,_0x2cc284){_0x677f1a=_0x677f1a-0x0;var _0xe1cad7=_0xfeb6[_0x677f1a];return _0xe1cad7;};'use strict';var _=require('lodash');var util=require(_0x6feb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6feb('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6feb('0x2'))['db'];var utils=require(_0x6feb('0x3'));var logger=require(_0x6feb('0x4'))('rpc');var config=require(_0x6feb('0x5'));var jayson=require(_0x6feb('0x6'));var client=jayson[_0x6feb('0x7')][_0x6feb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45314d,_0x6ba066,_0x570536){return new BPromise(function(_0x339cfc,_0x456d47){return client[_0x6feb('0x9')](_0x45314d,_0x570536)['then'](function(_0x23c3ca){logger[_0x6feb('0xa')]('SquareOdbc,\x20%s,\x20%s',_0x6ba066,'request\x20sent');logger[_0x6feb('0xb')](_0x6feb('0xc'),_0x6ba066,_0x6feb('0xd'),JSON['stringify'](_0x23c3ca));if(_0x23c3ca[_0x6feb('0xe')]){if(_0x23c3ca[_0x6feb('0xe')]['code']===0x1f4){logger[_0x6feb('0xe')](_0x6feb('0xf'),_0x6ba066,_0x23c3ca['error'][_0x6feb('0x10')]);return _0x456d47(_0x23c3ca[_0x6feb('0xe')][_0x6feb('0x10')]);}logger[_0x6feb('0xe')](_0x6feb('0xf'),_0x6ba066,_0x23c3ca[_0x6feb('0xe')]['message']);return _0x339cfc(_0x23c3ca[_0x6feb('0xe')][_0x6feb('0x10')]);}else{logger[_0x6feb('0xa')](_0x6feb('0xf'),_0x6ba066,_0x6feb('0xd'));_0x339cfc(_0x23c3ca[_0x6feb('0x11')][_0x6feb('0x10')]);}})[_0x6feb('0x12')](function(_0x13b8d6){logger[_0x6feb('0xe')](_0x6feb('0xf'),_0x6ba066,_0x13b8d6);_0x456d47(_0x13b8d6);});});}exports[_0x6feb('0x13')]=function(_0xe8498a){var _0x729bb8=this;return new Promise(function(_0x2ced4b,_0x1868ef){return db[_0x6feb('0x14')][_0x6feb('0x15')]({'raw':_0xe8498a[_0x6feb('0x16')]?_0xe8498a[_0x6feb('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xe8498a['options']?_0xe8498a[_0x6feb('0x16')]['where']||null:null,'attributes':_0xe8498a[_0x6feb('0x16')]?_0xe8498a[_0x6feb('0x16')][_0x6feb('0x17')]||null:null,'include':_0xe8498a[_0x6feb('0x16')]?_0xe8498a['options']['include']?_[_0x6feb('0x18')](_0xe8498a[_0x6feb('0x16')][_0x6feb('0x19')],function(_0x4c0fef){return{'model':db[_0x4c0fef[_0x6feb('0x1a')]],'as':_0x4c0fef['as'],'attributes':_0x4c0fef['attributes'],'include':_0x4c0fef[_0x6feb('0x19')]?_['map'](_0x4c0fef[_0x6feb('0x19')],function(_0x4e0873){return{'model':db[_0x4e0873['model']],'as':_0x4e0873['as'],'attributes':_0x4e0873[_0x6feb('0x17')],'include':_0x4e0873[_0x6feb('0x19')]?_[_0x6feb('0x18')](_0x4e0873[_0x6feb('0x19')],function(_0x336c02){return{'model':db[_0x336c02['model']],'as':_0x336c02['as'],'attributes':_0x336c02[_0x6feb('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7477d9){logger[_0x6feb('0xa')]('ShowSquareOdbc',_0xe8498a);logger['debug'](_0x6feb('0x13'),_0xe8498a,JSON[_0x6feb('0x1b')](_0x7477d9));_0x2ced4b(_0x7477d9);})[_0x6feb('0x12')](function(_0x172daf){logger[_0x6feb('0xe')](_0x6feb('0x13'),_0x172daf['message'],_0xe8498a);_0x1868ef(_0x729bb8['error'](0x1f4,_0x172daf[_0x6feb('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 393a07d..35b7869 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 _0xd9d3=['destroy','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','show','put','/:id','update','delete'];(function(_0x2665a3,_0x3bac99){var _0x586de6=function(_0x1034d7){while(--_0x1034d7){_0x2665a3['push'](_0x2665a3['shift']());}};_0x586de6(++_0x3bac99);}(_0xd9d3,0x90));var _0x3d9d=function(_0xf09cd9,_0x43cab2){_0xf09cd9=_0xf09cd9-0x0;var _0x18a832=_0xd9d3[_0xf09cd9];return _0x18a832;};'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['Router']();var fs_extra=require(_0x3d9d('0x0'));var auth=require('../../components/auth/service');var interaction=require(_0x3d9d('0x1'));var config=require(_0x3d9d('0x2'));var controller=require(_0x3d9d('0x3'));router[_0x3d9d('0x4')]('/',auth[_0x3d9d('0x5')](),controller[_0x3d9d('0x6')]);router[_0x3d9d('0x4')]('/:id',auth['isAuthenticated'](),controller[_0x3d9d('0x7')]);router['post']('/',auth[_0x3d9d('0x5')](),controller['create']);router[_0x3d9d('0x8')](_0x3d9d('0x9'),auth['isAuthenticated'](),controller[_0x3d9d('0xa')]);router[_0x3d9d('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x3d9d('0xc')]);module['exports']=router; \ No newline at end of file +var _0x6d80=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports'];(function(_0x1c5cd2,_0x277ceb){var _0x895e35=function(_0x4b4307){while(--_0x4b4307){_0x1c5cd2['push'](_0x1c5cd2['shift']());}};_0x895e35(++_0x277ceb);}(_0x6d80,0x85));var _0x06d8=function(_0x1d5ff1,_0x5b6320){_0x1d5ff1=_0x1d5ff1-0x0;var _0x2c485d=_0x6d80[_0x1d5ff1];return _0x2c485d;};'use strict';var multer=require(_0x06d8('0x0'));var util=require(_0x06d8('0x1'));var path=require(_0x06d8('0x2'));var timeout=require(_0x06d8('0x3'));var express=require(_0x06d8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x06d8('0x5'));var interaction=require(_0x06d8('0x6'));var config=require(_0x06d8('0x7'));var controller=require(_0x06d8('0x8'));router[_0x06d8('0x9')]('/',auth[_0x06d8('0xa')](),controller[_0x06d8('0xb')]);router['get'](_0x06d8('0xc'),auth[_0x06d8('0xa')](),controller[_0x06d8('0xd')]);router[_0x06d8('0xe')]('/',auth['isAuthenticated'](),controller[_0x06d8('0xf')]);router[_0x06d8('0x10')](_0x06d8('0xc'),auth[_0x06d8('0xa')](),controller['update']);router['delete']('/:id',auth[_0x06d8('0xa')](),controller[_0x06d8('0x11')]);module[_0x06d8('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index e25adfe..4fb1d61 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 _0x82c4=['utf8','DATE','sequelize','exports','STRING','name','TEXT','BLOB','getDataValue','toString','long','production'];(function(_0x2ee690,_0x500af9){var _0x54e1ae=function(_0x49d80d){while(--_0x49d80d){_0x2ee690['push'](_0x2ee690['shift']());}};_0x54e1ae(++_0x500af9);}(_0x82c4,0x1ca));var _0x482c=function(_0x58b635,_0xc76a6b){_0x58b635=_0x58b635-0x0;var _0x552de0=_0x82c4[_0x58b635];return _0x552de0;};'use strict';var Sequelize=require(_0x482c('0x0'));module[_0x482c('0x1')]={'name':{'type':Sequelize[_0x482c('0x2')],'unique':_0x482c('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x482c('0x2')]},'notes':{'type':Sequelize[_0x482c('0x4')]},'preproduction':{'type':Sequelize[_0x482c('0x5')]('long'),'get':function(){if(this[_0x482c('0x6')]('preproduction')){return this[_0x482c('0x6')]('preproduction')[_0x482c('0x7')]('utf8');}}},'production':{'type':Sequelize[_0x482c('0x5')](_0x482c('0x8')),'get':function(){if(this[_0x482c('0x6')](_0x482c('0x9'))){return this[_0x482c('0x6')]('production')[_0x482c('0x7')](_0x482c('0xa'));}}},'savedAt':{'type':Sequelize[_0x482c('0xb')]},'publishedAt':{'type':Sequelize[_0x482c('0xb')]}}; \ No newline at end of file +var _0x8aad=['BLOB','preproduction','toString','utf8','getDataValue','production','DATE','sequelize','exports','name','TEXT'];(function(_0x23f75c,_0x3b6a63){var _0x5b2352=function(_0x441b6c){while(--_0x441b6c){_0x23f75c['push'](_0x23f75c['shift']());}};_0x5b2352(++_0x3b6a63);}(_0x8aad,0x146));var _0xd8aa=function(_0x1262ca,_0x2489ab){_0x1262ca=_0x1262ca-0x0;var _0x4979e0=_0x8aad[_0x1262ca];return _0x4979e0;};'use strict';var Sequelize=require(_0xd8aa('0x0'));module[_0xd8aa('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd8aa('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xd8aa('0x3')]},'preproduction':{'type':Sequelize[_0xd8aa('0x4')]('long'),'get':function(){if(this['getDataValue'](_0xd8aa('0x5'))){return this['getDataValue']('preproduction')[_0xd8aa('0x6')](_0xd8aa('0x7'));}}},'production':{'type':Sequelize[_0xd8aa('0x4')]('long'),'get':function(){if(this[_0xd8aa('0x8')](_0xd8aa('0x9'))){return this[_0xd8aa('0x8')](_0xd8aa('0x9'))['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0xd8aa('0xa')]},'publishedAt':{'type':Sequelize[_0xd8aa('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index cc178e9..29bd5d1 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 _0x70c3=['keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','production','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','stringify','sendStatus','error','name','map','SquareProject','rawAttributes','fieldName','type','key','query'];(function(_0x1bbf3f,_0x436db5){var _0x1e10f2=function(_0x4d2d2e){while(--_0x4d2d2e){_0x1bbf3f['push'](_0x1bbf3f['shift']());}};_0x1e10f2(++_0x436db5);}(_0x70c3,0xfd));var _0x370c=function(_0x53b589,_0x8158c7){_0x53b589=_0x53b589-0x0;var _0x4ff409=_0x70c3[_0x53b589];return _0x4ff409;};'use strict';var _=require(_0x370c('0x0'));var Redis=require('ioredis');var qs=require(_0x370c('0x1'));var logger=require(_0x370c('0x2'))(_0x370c('0x3'));var config=require(_0x370c('0x4'));var db=require(_0x370c('0x5'))['db'];config[_0x370c('0x6')]=_[_0x370c('0x7')](config[_0x370c('0x6')],{'host':_0x370c('0x8'),'port':0x18eb});var socket=require(_0x370c('0x9'))(new Redis(config[_0x370c('0x6')]));require(_0x370c('0xa'))[_0x370c('0xb')](socket);function respondWithResult(_0x321dcc,_0xbffef2){_0xbffef2=_0xbffef2||0xc8;return function(_0x1673fa){if(_0x1673fa){return _0x321dcc[_0x370c('0xc')](_0xbffef2)[_0x370c('0xd')](_0x1673fa);}};}function respondWithFilteredResult(_0x1f8b2c,_0x23c49a){return function(_0x326078){if(_0x326078){var _0xa919f9=typeof _0x23c49a['offset']===_0x370c('0xe')&&typeof _0x23c49a[_0x370c('0xf')]===_0x370c('0xe');var _0x371f2b=_0x326078[_0x370c('0x10')];var _0x561fc0=_0xa919f9?0x0:_0x23c49a[_0x370c('0x11')];var _0x1018bb=_0xa919f9?_0x326078[_0x370c('0x10')]:_0x23c49a[_0x370c('0x11')]+_0x23c49a['limit'];var _0x2902d5;if(_0x1018bb>=_0x371f2b){_0x1018bb=_0x371f2b;_0x2902d5=0xc8;}else{_0x2902d5=0xce;}_0x1f8b2c[_0x370c('0xc')](_0x2902d5);return _0x1f8b2c[_0x370c('0x12')](_0x370c('0x13'),_0x561fc0+'-'+_0x1018bb+'/'+_0x371f2b)[_0x370c('0xd')](_0x326078);}return null;};}function saveUpdates(_0x466f80){return function(_0x2c2b30){if(_0x2c2b30){return _0x2c2b30[_0x370c('0x14')](_0x466f80)[_0x370c('0x15')](function(_0xa2deab){return _0xa2deab;});}return null;};}function removeEntity(_0x4eddfd){return function(_0x5bce76){if(_0x5bce76){return _0x5bce76[_0x370c('0x16')]()[_0x370c('0x15')](function(){var _0x4063d6=_0x5bce76[_0x370c('0x17')]({'plain':!![]});var _0x37822e=_0x370c('0x18');return db[_0x370c('0x19')][_0x370c('0x16')]({'where':{'type':_0x37822e,'resourceId':_0x4063d6['id']}})[_0x370c('0x15')](function(){return _0x5bce76;});})[_0x370c('0x15')](function(){var _0x110216=new Redis(config[_0x370c('0x6')]);_0x110216[_0x370c('0x1a')](_0x370c('0x1b'),JSON[_0x370c('0x1c')]({'id':_0x5bce76['id'],'deleted':!![]}));})[_0x370c('0x15')](function(){_0x4eddfd[_0x370c('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58be5a){return function(_0xbfc340){if(!_0xbfc340){_0x58be5a[_0x370c('0x1d')](0x194);}return _0xbfc340;};}function handleError(_0x47fd5b,_0x482aed){_0x482aed=_0x482aed||0x1f4;return function(_0x5350db){logger[_0x370c('0x1e')](_0x5350db['stack']);if(_0x5350db[_0x370c('0x1f')]){delete _0x5350db[_0x370c('0x1f')];}_0x47fd5b[_0x370c('0xc')](_0x482aed)['send'](_0x5350db);};}exports['index']=function(_0x5ef630,_0x28eb27){var _0x110989={},_0x45dae1={},_0x306cf7={'count':0x0,'rows':[]};var _0x31ede8=_[_0x370c('0x20')](db[_0x370c('0x21')][_0x370c('0x22')],function(_0x3f412a){return{'name':_0x3f412a[_0x370c('0x23')],'type':_0x3f412a[_0x370c('0x24')][_0x370c('0x25')]};});_0x45dae1['model']=_[_0x370c('0x20')](_0x31ede8,'name');_0x45dae1[_0x370c('0x26')]=_[_0x370c('0x27')](_0x5ef630[_0x370c('0x26')]);_0x45dae1[_0x370c('0x28')]=_[_0x370c('0x29')](_0x45dae1[_0x370c('0x2a')],_0x45dae1['query']);_0x110989[_0x370c('0x2b')]=_['intersection'](_0x45dae1[_0x370c('0x2a')],qs['fields'](_0x5ef630['query'][_0x370c('0x2c')]));_0x110989[_0x370c('0x2b')]=_0x110989[_0x370c('0x2b')][_0x370c('0x2d')]?_0x110989['attributes']:_0x45dae1[_0x370c('0x2a')];if(!_0x5ef630[_0x370c('0x26')][_0x370c('0x2e')](_0x370c('0x2f'))){_0x110989[_0x370c('0xf')]=qs['limit'](_0x5ef630['query'][_0x370c('0xf')]);_0x110989[_0x370c('0x11')]=qs[_0x370c('0x11')](_0x5ef630[_0x370c('0x26')][_0x370c('0x11')]);}_0x110989[_0x370c('0x30')]=qs['sort'](_0x5ef630[_0x370c('0x26')][_0x370c('0x31')]);_0x110989[_0x370c('0x32')]=qs[_0x370c('0x28')](_[_0x370c('0x33')](_0x5ef630['query'],_0x45dae1[_0x370c('0x28')]),_0x31ede8);if(_0x5ef630[_0x370c('0x26')][_0x370c('0x34')]){_0x110989['where']=_[_0x370c('0x35')](_0x110989['where'],{'$or':_['map'](_0x31ede8,function(_0x2aebbc){if(_0x2aebbc[_0x370c('0x24')]!==_0x370c('0x36')){var _0x23bf82={};_0x23bf82[_0x2aebbc[_0x370c('0x1f')]]={'$like':'%'+_0x5ef630[_0x370c('0x26')][_0x370c('0x34')]+'%'};return _0x23bf82;}})});}_0x110989=_[_0x370c('0x35')]({},_0x110989,_0x5ef630[_0x370c('0x37')]);var _0x4d4381={'where':_0x110989['where']};return db['SquareProject'][_0x370c('0x10')](_0x4d4381)[_0x370c('0x15')](function(_0x35b48c){_0x306cf7['count']=_0x35b48c;if(_0x5ef630['query']['includeAll']){_0x110989['include']=[{'all':!![]}];}return db[_0x370c('0x21')][_0x370c('0x38')](_0x110989);})[_0x370c('0x15')](function(_0x35caad){_0x306cf7[_0x370c('0x39')]=_0x35caad;return _0x306cf7;})[_0x370c('0x15')](respondWithFilteredResult(_0x28eb27,_0x110989))['catch'](handleError(_0x28eb27,null));};exports[_0x370c('0x3a')]=function(_0x3f27aa,_0x3495d2){var _0x2f75b1={'raw':![],'where':{'id':_0x3f27aa[_0x370c('0x3b')]['id']}},_0x1b4991={};_0x1b4991['model']=_[_0x370c('0x27')](db[_0x370c('0x21')][_0x370c('0x22')]);_0x1b4991[_0x370c('0x26')]=_['keys'](_0x3f27aa[_0x370c('0x26')]);_0x1b4991[_0x370c('0x28')]=_['intersection'](_0x1b4991[_0x370c('0x2a')],_0x1b4991['query']);_0x2f75b1[_0x370c('0x2b')]=_[_0x370c('0x29')](_0x1b4991[_0x370c('0x2a')],qs[_0x370c('0x2c')](_0x3f27aa[_0x370c('0x26')][_0x370c('0x2c')]));_0x2f75b1[_0x370c('0x2b')]=_0x2f75b1[_0x370c('0x2b')]['length']?_0x2f75b1[_0x370c('0x2b')]:_0x1b4991[_0x370c('0x2a')];if(_0x3f27aa[_0x370c('0x26')][_0x370c('0x3c')]){_0x2f75b1[_0x370c('0x3d')]=[{'all':!![]}];}_0x2f75b1=_[_0x370c('0x35')]({},_0x2f75b1,_0x3f27aa[_0x370c('0x37')]);return db['SquareProject'][_0x370c('0x3e')](_0x2f75b1)[_0x370c('0x15')](handleEntityNotFound(_0x3495d2,null))[_0x370c('0x15')](respondWithResult(_0x3495d2,null))[_0x370c('0x3f')](handleError(_0x3495d2,null));};exports[_0x370c('0x40')]=function(_0x1646de,_0x5e94a4){return db['SquareProject'][_0x370c('0x40')](_0x1646de['body'],{})[_0x370c('0x15')](function(_0x9460a0){var _0x287185=_0x1646de[_0x370c('0x41')][_0x370c('0x17')]({'plain':!![]});if(!_0x287185)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x287185[_0x370c('0x42')]===_0x370c('0x41')){var _0x31e184=_0x9460a0[_0x370c('0x17')]({'plain':!![]});var _0x34c1b4=_0x370c('0x18');return db[_0x370c('0x43')][_0x370c('0x3e')]({'where':{'name':_0x34c1b4,'userProfileId':_0x287185[_0x370c('0x44')]},'raw':!![]})[_0x370c('0x15')](function(_0x3fe686){if(_0x3fe686&&_0x3fe686[_0x370c('0x45')]===0x0){return db['UserProfileResource'][_0x370c('0x40')]({'name':_0x31e184[_0x370c('0x1f')],'resourceId':_0x31e184['id'],'type':_0x3fe686[_0x370c('0x1f')],'sectionId':_0x3fe686['id']},{})['then'](function(){return _0x9460a0;});}else{return _0x9460a0;}})['catch'](function(_0x14eba2){logger[_0x370c('0x1e')](_0x370c('0x46'),_0x14eba2);throw _0x14eba2;});}return _0x9460a0;})[_0x370c('0x15')](respondWithResult(_0x5e94a4,0xc9))[_0x370c('0x3f')](handleError(_0x5e94a4,null));};exports['update']=function(_0x2c75a0,_0x2a2c14){if(_0x2c75a0[_0x370c('0x47')]['id']){delete _0x2c75a0[_0x370c('0x47')]['id'];}return db[_0x370c('0x21')][_0x370c('0x3e')]({'where':{'id':_0x2c75a0[_0x370c('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2a2c14,null))[_0x370c('0x15')](saveUpdates(_0x2c75a0[_0x370c('0x47')],null))[_0x370c('0x15')](function(_0x343b11){if(!_0x343b11)return;var _0x174640=_0x343b11[_0x370c('0x17')]({'plain':!![]});return _0x174640;})[_0x370c('0x15')](function(_0x1a5b60){var _0x2eded6=new Redis(config[_0x370c('0x6')]);_0x2eded6[_0x370c('0x1a')]('agi',JSON[_0x370c('0x1c')](_[_0x370c('0x33')](_0x1a5b60,['id',_0x370c('0x1f'),_0x370c('0x48')])));return _0x1a5b60;})[_0x370c('0x15')](respondWithResult(_0x2a2c14,null))[_0x370c('0x3f')](handleError(_0x2a2c14,null));};exports[_0x370c('0x16')]=function(_0x21e9d7,_0x5f4a11){return db[_0x370c('0x21')][_0x370c('0x3e')]({'where':{'id':_0x21e9d7[_0x370c('0x3b')]['id']}})[_0x370c('0x15')](handleEntityNotFound(_0x5f4a11,null))[_0x370c('0x15')](removeEntity(_0x5f4a11,null))[_0x370c('0x3f')](handleError(_0x5f4a11,null));}; \ No newline at end of file +var _0x49b2=['rows','catch','show','params','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','stringify','production','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','status','json','undefined','count','offset','limit','set','Content-Range','update','then','destroy','get','SquareProjects','UserProfileResource','end','sendStatus','error','stack','name','send','index','SquareProject','rawAttributes','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','includeAll','include','findAll'];(function(_0x23a1f0,_0x36c8fd){var _0x2cf328=function(_0x4a0da0){while(--_0x4a0da0){_0x23a1f0['push'](_0x23a1f0['shift']());}};_0x2cf328(++_0x36c8fd);}(_0x49b2,0x1bb));var _0x249b=function(_0x50e697,_0x5b4e4b){_0x50e697=_0x50e697-0x0;var _0x14ec31=_0x49b2[_0x50e697];return _0x14ec31;};'use strict';var _=require('lodash');var Redis=require(_0x249b('0x0'));var qs=require(_0x249b('0x1'));var logger=require(_0x249b('0x2'))(_0x249b('0x3'));var config=require(_0x249b('0x4'));var db=require(_0x249b('0x5'))['db'];config[_0x249b('0x6')]=_[_0x249b('0x7')](config[_0x249b('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x249b('0x8'))(new Redis(config['redis']));require(_0x249b('0x9'))['register'](socket);function respondWithResult(_0x5bcb16,_0x11d760){_0x11d760=_0x11d760||0xc8;return function(_0x15e882){if(_0x15e882){return _0x5bcb16[_0x249b('0xa')](_0x11d760)[_0x249b('0xb')](_0x15e882);}};}function respondWithFilteredResult(_0x339372,_0x4d5623){return function(_0xd018e5){if(_0xd018e5){var _0x227dbe=typeof _0x4d5623['offset']===_0x249b('0xc')&&typeof _0x4d5623['limit']==='undefined';var _0x20266d=_0xd018e5[_0x249b('0xd')];var _0x11cefa=_0x227dbe?0x0:_0x4d5623[_0x249b('0xe')];var _0x24345b=_0x227dbe?_0xd018e5['count']:_0x4d5623['offset']+_0x4d5623[_0x249b('0xf')];var _0x49b88d;if(_0x24345b>=_0x20266d){_0x24345b=_0x20266d;_0x49b88d=0xc8;}else{_0x49b88d=0xce;}_0x339372[_0x249b('0xa')](_0x49b88d);return _0x339372[_0x249b('0x10')](_0x249b('0x11'),_0x11cefa+'-'+_0x24345b+'/'+_0x20266d)[_0x249b('0xb')](_0xd018e5);}return null;};}function saveUpdates(_0x550936){return function(_0x1a5b0f){if(_0x1a5b0f){return _0x1a5b0f[_0x249b('0x12')](_0x550936)[_0x249b('0x13')](function(_0x2b900a){return _0x2b900a;});}return null;};}function removeEntity(_0x490ccd){return function(_0x561872){if(_0x561872){return _0x561872[_0x249b('0x14')]()[_0x249b('0x13')](function(){var _0x1f02f6=_0x561872[_0x249b('0x15')]({'plain':!![]});var _0x1ed026=_0x249b('0x16');return db[_0x249b('0x17')][_0x249b('0x14')]({'where':{'type':_0x1ed026,'resourceId':_0x1f02f6['id']}})[_0x249b('0x13')](function(){return _0x561872;});})[_0x249b('0x13')](function(){var _0x41b67c=new Redis(config[_0x249b('0x6')]);_0x41b67c['publish']('agi',JSON['stringify']({'id':_0x561872['id'],'deleted':!![]}));})[_0x249b('0x13')](function(){_0x490ccd[_0x249b('0xa')](0xcc)[_0x249b('0x18')]();});}};}function handleEntityNotFound(_0x310f8e){return function(_0x1b42ee){if(!_0x1b42ee){_0x310f8e[_0x249b('0x19')](0x194);}return _0x1b42ee;};}function handleError(_0x3f2294,_0x1ed9c1){_0x1ed9c1=_0x1ed9c1||0x1f4;return function(_0x2e7d50){logger[_0x249b('0x1a')](_0x2e7d50[_0x249b('0x1b')]);if(_0x2e7d50[_0x249b('0x1c')]){delete _0x2e7d50[_0x249b('0x1c')];}_0x3f2294[_0x249b('0xa')](_0x1ed9c1)[_0x249b('0x1d')](_0x2e7d50);};}exports[_0x249b('0x1e')]=function(_0x264a82,_0x9094d5){var _0x223eea={},_0x255eb5={},_0xb415c7={'count':0x0,'rows':[]};var _0x3c8957=_['map'](db[_0x249b('0x1f')][_0x249b('0x20')],function(_0x94411c){return{'name':_0x94411c['fieldName'],'type':_0x94411c[_0x249b('0x21')][_0x249b('0x22')]};});_0x255eb5[_0x249b('0x23')]=_[_0x249b('0x24')](_0x3c8957,_0x249b('0x1c'));_0x255eb5[_0x249b('0x25')]=_[_0x249b('0x26')](_0x264a82[_0x249b('0x25')]);_0x255eb5['filters']=_[_0x249b('0x27')](_0x255eb5[_0x249b('0x23')],_0x255eb5[_0x249b('0x25')]);_0x223eea['attributes']=_['intersection'](_0x255eb5[_0x249b('0x23')],qs[_0x249b('0x28')](_0x264a82[_0x249b('0x25')]['fields']));_0x223eea[_0x249b('0x29')]=_0x223eea['attributes']['length']?_0x223eea[_0x249b('0x29')]:_0x255eb5[_0x249b('0x23')];if(!_0x264a82['query'][_0x249b('0x2a')](_0x249b('0x2b'))){_0x223eea[_0x249b('0xf')]=qs['limit'](_0x264a82[_0x249b('0x25')]['limit']);_0x223eea['offset']=qs[_0x249b('0xe')](_0x264a82['query'][_0x249b('0xe')]);}_0x223eea[_0x249b('0x2c')]=qs[_0x249b('0x2d')](_0x264a82[_0x249b('0x25')][_0x249b('0x2d')]);_0x223eea[_0x249b('0x2e')]=qs['filters'](_[_0x249b('0x2f')](_0x264a82['query'],_0x255eb5[_0x249b('0x30')]),_0x3c8957);if(_0x264a82[_0x249b('0x25')][_0x249b('0x31')]){_0x223eea[_0x249b('0x2e')]=_[_0x249b('0x32')](_0x223eea[_0x249b('0x2e')],{'$or':_[_0x249b('0x24')](_0x3c8957,function(_0x837d49){if(_0x837d49['type']!=='VIRTUAL'){var _0x5cf40f={};_0x5cf40f[_0x837d49[_0x249b('0x1c')]]={'$like':'%'+_0x264a82[_0x249b('0x25')][_0x249b('0x31')]+'%'};return _0x5cf40f;}})});}_0x223eea=_['merge']({},_0x223eea,_0x264a82['options']);var _0x521af5={'where':_0x223eea[_0x249b('0x2e')]};return db[_0x249b('0x1f')][_0x249b('0xd')](_0x521af5)[_0x249b('0x13')](function(_0x270066){_0xb415c7[_0x249b('0xd')]=_0x270066;if(_0x264a82['query'][_0x249b('0x33')]){_0x223eea[_0x249b('0x34')]=[{'all':!![]}];}return db[_0x249b('0x1f')][_0x249b('0x35')](_0x223eea);})[_0x249b('0x13')](function(_0x8c3e49){_0xb415c7[_0x249b('0x36')]=_0x8c3e49;return _0xb415c7;})[_0x249b('0x13')](respondWithFilteredResult(_0x9094d5,_0x223eea))[_0x249b('0x37')](handleError(_0x9094d5,null));};exports[_0x249b('0x38')]=function(_0xf2648,_0x5667ec){var _0x44f6b1={'raw':![],'where':{'id':_0xf2648[_0x249b('0x39')]['id']}},_0xbbac3c={};_0xbbac3c[_0x249b('0x23')]=_[_0x249b('0x26')](db[_0x249b('0x1f')][_0x249b('0x20')]);_0xbbac3c['query']=_[_0x249b('0x26')](_0xf2648[_0x249b('0x25')]);_0xbbac3c['filters']=_[_0x249b('0x27')](_0xbbac3c[_0x249b('0x23')],_0xbbac3c[_0x249b('0x25')]);_0x44f6b1[_0x249b('0x29')]=_[_0x249b('0x27')](_0xbbac3c[_0x249b('0x23')],qs[_0x249b('0x28')](_0xf2648[_0x249b('0x25')][_0x249b('0x28')]));_0x44f6b1['attributes']=_0x44f6b1[_0x249b('0x29')][_0x249b('0x3a')]?_0x44f6b1[_0x249b('0x29')]:_0xbbac3c[_0x249b('0x23')];if(_0xf2648[_0x249b('0x25')][_0x249b('0x33')]){_0x44f6b1[_0x249b('0x34')]=[{'all':!![]}];}_0x44f6b1=_[_0x249b('0x32')]({},_0x44f6b1,_0xf2648[_0x249b('0x3b')]);return db[_0x249b('0x1f')][_0x249b('0x3c')](_0x44f6b1)[_0x249b('0x13')](handleEntityNotFound(_0x5667ec,null))[_0x249b('0x13')](respondWithResult(_0x5667ec,null))['catch'](handleError(_0x5667ec,null));};exports['create']=function(_0x9a9e2b,_0x598948){return db[_0x249b('0x1f')][_0x249b('0x3d')](_0x9a9e2b['body'],{})['then'](function(_0x5ce8de){var _0x1d664a=_0x9a9e2b[_0x249b('0x3e')]['get']({'plain':!![]});if(!_0x1d664a)throw new Error(_0x249b('0x3f'));if(_0x1d664a[_0x249b('0x40')]==='user'){var _0x168ff9=_0x5ce8de['get']({'plain':!![]});var _0x2408de='SquareProjects';return db[_0x249b('0x41')]['find']({'where':{'name':_0x2408de,'userProfileId':_0x1d664a['userProfileId']},'raw':!![]})['then'](function(_0x24099e){if(_0x24099e&&_0x24099e[_0x249b('0x42')]===0x0){return db['UserProfileResource'][_0x249b('0x3d')]({'name':_0x168ff9[_0x249b('0x1c')],'resourceId':_0x168ff9['id'],'type':_0x24099e['name'],'sectionId':_0x24099e['id']},{})['then'](function(){return _0x5ce8de;});}else{return _0x5ce8de;}})[_0x249b('0x37')](function(_0x660a9f){logger['error'](_0x249b('0x43'),_0x660a9f);throw _0x660a9f;});}return _0x5ce8de;})[_0x249b('0x13')](respondWithResult(_0x598948,0xc9))[_0x249b('0x37')](handleError(_0x598948,null));};exports[_0x249b('0x12')]=function(_0x30e2df,_0x37d6d2){if(_0x30e2df[_0x249b('0x44')]['id']){delete _0x30e2df[_0x249b('0x44')]['id'];}return db[_0x249b('0x1f')][_0x249b('0x3c')]({'where':{'id':_0x30e2df[_0x249b('0x39')]['id']}})['then'](handleEntityNotFound(_0x37d6d2,null))['then'](saveUpdates(_0x30e2df[_0x249b('0x44')],null))[_0x249b('0x13')](function(_0x5b9516){if(!_0x5b9516)return;var _0x12676a=_0x5b9516[_0x249b('0x15')]({'plain':!![]});return _0x12676a;})[_0x249b('0x13')](function(_0x36d391){var _0x295049=new Redis(config[_0x249b('0x6')]);_0x295049['publish']('agi',JSON[_0x249b('0x45')](_[_0x249b('0x2f')](_0x36d391,['id',_0x249b('0x1c'),_0x249b('0x46')])));return _0x36d391;})[_0x249b('0x13')](respondWithResult(_0x37d6d2,null))[_0x249b('0x37')](handleError(_0x37d6d2,null));};exports[_0x249b('0x14')]=function(_0x5e60bc,_0x9c0ab7){return db[_0x249b('0x1f')][_0x249b('0x3c')]({'where':{'id':_0x5e60bc['params']['id']}})[_0x249b('0x13')](handleEntityNotFound(_0x9c0ab7,null))[_0x249b('0x13')](removeEntity(_0x9c0ab7,null))[_0x249b('0x37')](handleError(_0x9c0ab7,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 1397f1a..5dfaaf2 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 _0xc86a=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','SquareProject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc86a,0x165));var _0xac86=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0xc86a[_0x595013];return _0x2a29e3;};'use strict';var EventEmitter=require(_0xac86('0x0'));var SquareProject=require(_0xac86('0x1'))['db'][_0xac86('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xac86('0x3'),'afterUpdate':_0xac86('0x4'),'afterDestroy':_0xac86('0x5')};function emitEvent(_0x2ce427){return function(_0x3c083b,_0x4340a3,_0x255c38){SquareProjectEvents[_0xac86('0x6')](_0x2ce427+':'+_0x3c083b['id'],_0x3c083b);SquareProjectEvents[_0xac86('0x6')](_0x2ce427,_0x3c083b);_0x255c38(null);};}for(var e in events){if(events[_0xac86('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xac86('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x7331=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SquareProject','setMaxListeners','save'];(function(_0x44afa4,_0x5be27b){var _0xcad289=function(_0x206272){while(--_0x206272){_0x44afa4['push'](_0x44afa4['shift']());}};_0xcad289(++_0x5be27b);}(_0x7331,0xc3));var _0x1733=function(_0x40a38e,_0x2b405c){_0x40a38e=_0x40a38e-0x0;var _0x39e784=_0x7331[_0x40a38e];return _0x39e784;};'use strict';var EventEmitter=require(_0x1733('0x0'));var SquareProject=require(_0x1733('0x1'))['db'][_0x1733('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1733('0x3')](0x0);var events={'afterCreate':_0x1733('0x4'),'afterUpdate':_0x1733('0x5'),'afterDestroy':_0x1733('0x6')};function emitEvent(_0x5d8976){return function(_0x18b614,_0x1ceead,_0x7d2558){SquareProjectEvents[_0x1733('0x7')](_0x5d8976+':'+_0x18b614['id'],_0x18b614);SquareProjectEvents[_0x1733('0x7')](_0x5d8976,_0x18b614);_0x7d2558(null);};}for(var e in events){if(events[_0x1733('0x8')](e)){var event=events[e];SquareProject[_0x1733('0x9')](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 87522f1..e39e09e 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 _0x19f5=['exports','define','SquareProject','square_projects','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes'];(function(_0x321dd0,_0x46f61b){var _0x442abd=function(_0x45a9cf){while(--_0x45a9cf){_0x321dd0['push'](_0x321dd0['shift']());}};_0x442abd(++_0x46f61b);}(_0x19f5,0x173));var _0x519f=function(_0x4e93bf,_0x456071){_0x4e93bf=_0x4e93bf-0x0;var _0xf7e28f=_0x19f5[_0x4e93bf];return _0xf7e28f;};'use strict';var _=require(_0x519f('0x0'));var util=require(_0x519f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x519f('0x2'));var BPromise=require(_0x519f('0x3'));var rp=require(_0x519f('0x4'));var fs=require('fs');var path=require(_0x519f('0x5'));var rimraf=require(_0x519f('0x6'));var config=require(_0x519f('0x7'));var attributes=require(_0x519f('0x8'));module[_0x519f('0x9')]=function(_0x484d87,_0x20812f){return _0x484d87[_0x519f('0xa')](_0x519f('0xb'),attributes,{'tableName':_0x519f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a7b63,_0x38b717,_0x3997ea){if(_0x3a7b63[_0x519f('0xd')](_0x519f('0xe'))){_0x3a7b63[_0x519f('0xf')]=moment()['format'](_0x519f('0x10'));}if(_0x3a7b63['changed'](_0x519f('0x11'))){_0x3a7b63[_0x519f('0x12')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x3997ea(null,_0x3a7b63);}}});}; \ No newline at end of file +var _0x8b51=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','lodash'];(function(_0x900b8b,_0x126fc5){var _0x102af7=function(_0x59a023){while(--_0x59a023){_0x900b8b['push'](_0x900b8b['shift']());}};_0x102af7(++_0x126fc5);}(_0x8b51,0xef));var _0x18b5=function(_0x3f6f86,_0x39431e){_0x3f6f86=_0x3f6f86-0x0;var _0x1d6821=_0x8b51[_0x3f6f86];return _0x1d6821;};'use strict';var _=require(_0x18b5('0x0'));var util=require(_0x18b5('0x1'));var logger=require(_0x18b5('0x2'))(_0x18b5('0x3'));var moment=require(_0x18b5('0x4'));var BPromise=require(_0x18b5('0x5'));var rp=require(_0x18b5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x18b5('0x7'));var config=require(_0x18b5('0x8'));var attributes=require(_0x18b5('0x9'));module['exports']=function(_0x1ad597,_0xc69761){return _0x1ad597[_0x18b5('0xa')](_0x18b5('0xb'),attributes,{'tableName':_0x18b5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x395783,_0x21521a,_0x4eb759){if(_0x395783[_0x18b5('0xd')](_0x18b5('0xe'))){_0x395783[_0x18b5('0xf')]=moment()['format'](_0x18b5('0x10'));}if(_0x395783['changed'](_0x18b5('0x11'))){_0x395783[_0x18b5('0x12')]=moment()[_0x18b5('0x13')](_0x18b5('0x10'));}_0x4eb759(null,_0x395783);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index b9099e1..c0f9549 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 _0x9a84=['model','then','debug','stringify','catch','error','message','ShowSquareProject','find','where','info','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','localhost','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','attributes','include','map'];(function(_0x2a3a12,_0x35de36){var _0x3955cb=function(_0x30afee){while(--_0x30afee){_0x2a3a12['push'](_0x2a3a12['shift']());}};_0x3955cb(++_0x35de36);}(_0x9a84,0x1db));var _0x49a8=function(_0x34ecbf,_0x210898){_0x34ecbf=_0x34ecbf-0x0;var _0x115f8a=_0x9a84[_0x34ecbf];return _0x115f8a;};'use strict';var _=require(_0x49a8('0x0'));var Redis=require(_0x49a8('0x1'));var db=require(_0x49a8('0x2'))['db'];var logger=require(_0x49a8('0x3'))(_0x49a8('0x4'));var config=require(_0x49a8('0x5'));config['redis']=_['defaults'](config[_0x49a8('0x6')],{'host':_0x49a8('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x49a8('0x6')]));require(_0x49a8('0x8'))[_0x49a8('0x9')](socket);exports[_0x49a8('0xa')]=function(_0xb395e1){var _0x13c0c2=this;return new Promise(function(_0x268e7a,_0x2de91f){return db[_0x49a8('0xb')][_0x49a8('0xc')]({'raw':_0xb395e1['options']?_0xb395e1[_0x49a8('0xd')][_0x49a8('0xe')]===undefined?!![]:![]:!![],'where':_0xb395e1[_0x49a8('0xd')]?_0xb395e1[_0x49a8('0xd')]['where']||null:null,'attributes':_0xb395e1[_0x49a8('0xd')]?_0xb395e1[_0x49a8('0xd')][_0x49a8('0xf')]||null:null,'limit':_0xb395e1['options']?_0xb395e1[_0x49a8('0xd')]['limit']||null:null,'include':_0xb395e1[_0x49a8('0xd')]?_0xb395e1['options'][_0x49a8('0x10')]?_[_0x49a8('0x11')](_0xb395e1[_0x49a8('0xd')][_0x49a8('0x10')],function(_0x95ce7f){return{'model':db[_0x95ce7f[_0x49a8('0x12')]],'as':_0x95ce7f['as'],'attributes':_0x95ce7f[_0x49a8('0xf')],'include':_0x95ce7f[_0x49a8('0x10')]?_[_0x49a8('0x11')](_0x95ce7f[_0x49a8('0x10')],function(_0x116c46){return{'model':db[_0x116c46[_0x49a8('0x12')]],'as':_0x116c46['as'],'attributes':_0x116c46[_0x49a8('0xf')],'include':_0x116c46['include']?_['map'](_0x116c46[_0x49a8('0x10')],function(_0x143adf){return{'model':db[_0x143adf['model']],'as':_0x143adf['as'],'attributes':_0x143adf[_0x49a8('0xf')]};}):[]};}):[]};}):[]:[]})[_0x49a8('0x13')](function(_0x4a5c67){logger['info'](_0x49a8('0xa'),_0xb395e1);logger[_0x49a8('0x14')](_0x49a8('0xa'),_0xb395e1,JSON[_0x49a8('0x15')](_0x4a5c67));_0x268e7a(_0x4a5c67);})[_0x49a8('0x16')](function(_0x4a2309){logger[_0x49a8('0x17')](_0x49a8('0xa'),_0x4a2309[_0x49a8('0x18')],_0xb395e1);_0x2de91f(_0x13c0c2[_0x49a8('0x17')](0x1f4,_0x4a2309[_0x49a8('0x18')]));});});};exports[_0x49a8('0x19')]=function(_0x4e5559){var _0xbf8d1e=this;return new Promise(function(_0x1ee056,_0x2581f7){return db[_0x49a8('0xb')][_0x49a8('0x1a')]({'raw':_0x4e5559[_0x49a8('0xd')]?_0x4e5559['options'][_0x49a8('0xe')]===undefined?!![]:![]:!![],'where':_0x4e5559[_0x49a8('0xd')]?_0x4e5559[_0x49a8('0xd')][_0x49a8('0x1b')]||null:null,'attributes':_0x4e5559[_0x49a8('0xd')]?_0x4e5559['options'][_0x49a8('0xf')]||null:null,'include':_0x4e5559[_0x49a8('0xd')]?_0x4e5559[_0x49a8('0xd')][_0x49a8('0x10')]?_[_0x49a8('0x11')](_0x4e5559[_0x49a8('0xd')][_0x49a8('0x10')],function(_0x35f763){return{'model':db[_0x35f763[_0x49a8('0x12')]],'as':_0x35f763['as'],'attributes':_0x35f763[_0x49a8('0xf')],'include':_0x35f763[_0x49a8('0x10')]?_[_0x49a8('0x11')](_0x35f763[_0x49a8('0x10')],function(_0x2e55e6){return{'model':db[_0x2e55e6[_0x49a8('0x12')]],'as':_0x2e55e6['as'],'attributes':_0x2e55e6[_0x49a8('0xf')],'include':_0x2e55e6[_0x49a8('0x10')]?_[_0x49a8('0x11')](_0x2e55e6['include'],function(_0x97e42f){return{'model':db[_0x97e42f[_0x49a8('0x12')]],'as':_0x97e42f['as'],'attributes':_0x97e42f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1602fb){logger[_0x49a8('0x1c')](_0x49a8('0x19'),_0x4e5559);logger['debug']('ShowSquareProject',_0x4e5559,JSON[_0x49a8('0x15')](_0x1602fb));_0x1ee056(_0x1602fb);})[_0x49a8('0x16')](function(_0x4c72be){logger['error'](_0x49a8('0x19'),_0x4c72be['message'],_0x4e5559);_0x2581f7(_0xbf8d1e[_0x49a8('0x17')](0x1f4,_0x4c72be[_0x49a8('0x18')]));});});}; \ No newline at end of file +var _0x7923=['limit','map','include','model','info','debug','GetSquareProjects','stringify','catch','error','message','ShowSquareProject','SquareProject','find','lodash','../../mysqldb','rpc','../../config/environment','defaults','redis','./squareProject.socket','register','findAll','options','where','attributes'];(function(_0x55490b,_0x3e464b){var _0x8432cb=function(_0x1c7b6c){while(--_0x1c7b6c){_0x55490b['push'](_0x55490b['shift']());}};_0x8432cb(++_0x3e464b);}(_0x7923,0x146));var _0x3792=function(_0x2abe88,_0x1b598b){_0x2abe88=_0x2abe88-0x0;var _0x11dcd5=_0x7923[_0x2abe88];return _0x11dcd5;};'use strict';var _=require(_0x3792('0x0'));var Redis=require('ioredis');var db=require(_0x3792('0x1'))['db'];var logger=require('../../config/logger')(_0x3792('0x2'));var config=require(_0x3792('0x3'));config['redis']=_[_0x3792('0x4')](config[_0x3792('0x5')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3792('0x5')]));require(_0x3792('0x6'))[_0x3792('0x7')](socket);exports['GetSquareProjects']=function(_0x23d81a){var _0x583867=this;return new Promise(function(_0x35117b,_0x29b08a){return db['SquareProject'][_0x3792('0x8')]({'raw':_0x23d81a[_0x3792('0x9')]?_0x23d81a[_0x3792('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x23d81a[_0x3792('0x9')]?_0x23d81a['options'][_0x3792('0xa')]||null:null,'attributes':_0x23d81a[_0x3792('0x9')]?_0x23d81a['options'][_0x3792('0xb')]||null:null,'limit':_0x23d81a[_0x3792('0x9')]?_0x23d81a[_0x3792('0x9')][_0x3792('0xc')]||null:null,'include':_0x23d81a['options']?_0x23d81a[_0x3792('0x9')]['include']?_[_0x3792('0xd')](_0x23d81a[_0x3792('0x9')][_0x3792('0xe')],function(_0x566c87){return{'model':db[_0x566c87[_0x3792('0xf')]],'as':_0x566c87['as'],'attributes':_0x566c87[_0x3792('0xb')],'include':_0x566c87[_0x3792('0xe')]?_[_0x3792('0xd')](_0x566c87[_0x3792('0xe')],function(_0x187886){return{'model':db[_0x187886[_0x3792('0xf')]],'as':_0x187886['as'],'attributes':_0x187886[_0x3792('0xb')],'include':_0x187886['include']?_[_0x3792('0xd')](_0x187886[_0x3792('0xe')],function(_0x3123e3){return{'model':db[_0x3123e3[_0x3792('0xf')]],'as':_0x3123e3['as'],'attributes':_0x3123e3[_0x3792('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cc9aa){logger[_0x3792('0x10')]('GetSquareProjects',_0x23d81a);logger[_0x3792('0x11')](_0x3792('0x12'),_0x23d81a,JSON[_0x3792('0x13')](_0x5cc9aa));_0x35117b(_0x5cc9aa);})[_0x3792('0x14')](function(_0x5c87cc){logger[_0x3792('0x15')](_0x3792('0x12'),_0x5c87cc[_0x3792('0x16')],_0x23d81a);_0x29b08a(_0x583867['error'](0x1f4,_0x5c87cc[_0x3792('0x16')]));});});};exports[_0x3792('0x17')]=function(_0x8686e3){var _0x395aab=this;return new Promise(function(_0x214350,_0x16c3be){return db[_0x3792('0x18')][_0x3792('0x19')]({'raw':_0x8686e3[_0x3792('0x9')]?_0x8686e3[_0x3792('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x8686e3[_0x3792('0x9')]?_0x8686e3['options'][_0x3792('0xa')]||null:null,'attributes':_0x8686e3[_0x3792('0x9')]?_0x8686e3[_0x3792('0x9')][_0x3792('0xb')]||null:null,'include':_0x8686e3[_0x3792('0x9')]?_0x8686e3[_0x3792('0x9')][_0x3792('0xe')]?_['map'](_0x8686e3['options'][_0x3792('0xe')],function(_0x313f16){return{'model':db[_0x313f16[_0x3792('0xf')]],'as':_0x313f16['as'],'attributes':_0x313f16[_0x3792('0xb')],'include':_0x313f16[_0x3792('0xe')]?_[_0x3792('0xd')](_0x313f16['include'],function(_0x13ba17){return{'model':db[_0x13ba17[_0x3792('0xf')]],'as':_0x13ba17['as'],'attributes':_0x13ba17[_0x3792('0xb')],'include':_0x13ba17[_0x3792('0xe')]?_[_0x3792('0xd')](_0x13ba17[_0x3792('0xe')],function(_0x5ad72c){return{'model':db[_0x5ad72c[_0x3792('0xf')]],'as':_0x5ad72c['as'],'attributes':_0x5ad72c[_0x3792('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4463c6){logger['info']('ShowSquareProject',_0x8686e3);logger[_0x3792('0x11')]('ShowSquareProject',_0x8686e3,JSON['stringify'](_0x4463c6));_0x214350(_0x4463c6);})[_0x3792('0x14')](function(_0xeb7b3){logger['error'](_0x3792('0x17'),_0xeb7b3[_0x3792('0x16')],_0x8686e3);_0x16c3be(_0x395aab[_0x3792('0x15')](0x1f4,_0xeb7b3[_0x3792('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 2ebac31..7532683 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 _0x0667=['save','remove','emit','register','squareProject:','./squareProject.events'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x0667,0x143));var _0x7066=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0667[_0x57b54c];return _0x59cc19;};'use strict';var SquareProjectEvents=require(_0x7066('0x0'));var events=[_0x7066('0x1'),_0x7066('0x2'),'update'];function createListener(_0x138212,_0x5c7afb){return function(_0x1edffe){_0x5c7afb[_0x7066('0x3')](_0x138212,_0x1edffe);};}function removeListener(_0x1dfea4,_0x3d36ce){return function(){SquareProjectEvents['removeListener'](_0x1dfea4,_0x3d36ce);};}exports[_0x7066('0x4')]=function(_0x526084){for(var _0x5cf078=0x0,_0x465d9e=events['length'];_0x5cf078<_0x465d9e;_0x5cf078++){var _0x53866e=events[_0x5cf078];var _0xd514e0=createListener(_0x7066('0x5')+_0x53866e,_0x526084);SquareProjectEvents['on'](_0x53866e,_0xd514e0);}}; \ No newline at end of file +var _0x8617=['save','remove','update','emit','removeListener','register','squareProject:','./squareProject.events'];(function(_0x2bd1ec,_0x3fe65f){var _0x2f7577=function(_0x5234fb){while(--_0x5234fb){_0x2bd1ec['push'](_0x2bd1ec['shift']());}};_0x2f7577(++_0x3fe65f);}(_0x8617,0x1af));var _0x7861=function(_0x1a144b,_0x49bc99){_0x1a144b=_0x1a144b-0x0;var _0x24bbbe=_0x8617[_0x1a144b];return _0x24bbbe;};'use strict';var SquareProjectEvents=require(_0x7861('0x0'));var events=[_0x7861('0x1'),_0x7861('0x2'),_0x7861('0x3')];function createListener(_0x2fe745,_0x3cb5c3){return function(_0x2eac96){_0x3cb5c3[_0x7861('0x4')](_0x2fe745,_0x2eac96);};}function removeListener(_0x465a7f,_0x54702c){return function(){SquareProjectEvents[_0x7861('0x5')](_0x465a7f,_0x54702c);};}exports[_0x7861('0x6')]=function(_0x11b4ef){for(var _0x59962a=0x0,_0x5dddac=events['length'];_0x59962a<_0x5dddac;_0x59962a++){var _0x10e638=events[_0x59962a];var _0x17443f=createListener(_0x7861('0x7')+_0x10e638,_0x11b4ef);SquareProjectEvents['on'](_0x10e638,_0x17443f);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 934f955..d3d7de0 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 _0x814b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports'];(function(_0x39655c,_0x241955){var _0x5d9505=function(_0x316320){while(--_0x316320){_0x39655c['push'](_0x39655c['shift']());}};_0x5d9505(++_0x241955);}(_0x814b,0x1a2));var _0xb814=function(_0x1f16de,_0x548eb9){_0x1f16de=_0x1f16de-0x0;var _0x36cd80=_0x814b[_0x1f16de];return _0x36cd80;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0x10')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xc'),auth[_0xb814('0xb')](),controller['update']);router[_0xb814('0x13')]('/:id',auth[_0xb814('0xb')](),controller[_0xb814('0x14')]);module[_0xb814('0x15')]=router; \ No newline at end of file +var _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x4556f6,_0x22d951){var _0x3cc8c7=function(_0x1afae8){while(--_0x1afae8){_0x4556f6['push'](_0x4556f6['shift']());}};_0x3cc8c7(++_0x22d951);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x14cb58,_0x214d62){_0x14cb58=_0x14cb58-0x0;var _0x5f097e=_0x7fbe[_0x14cb58];return _0x5f097e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index f972a11..9f41811 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 _0xae24=['VIRTUAL','savePath','sequelize','STRING'];(function(_0x10a6c1,_0x57f22f){var _0x2faaf2=function(_0x5ba9ce){while(--_0x5ba9ce){_0x10a6c1['push'](_0x10a6c1['shift']());}};_0x2faaf2(++_0x57f22f);}(_0xae24,0x182));var _0x4ae2=function(_0x41d617,_0x3233f4){_0x41d617=_0x41d617-0x0;var _0x218be9=_0xae24[_0x41d617];return _0x218be9;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x4ae2('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4ae2('0x1')]},'context':{'type':Sequelize[_0x4ae2('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4ae2('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x4ae2('0x1')]},'saveName':{'type':Sequelize[_0x4ae2('0x1')]},'filename':{'type':Sequelize[_0x4ae2('0x1')]},'savePath':{'type':Sequelize[_0x4ae2('0x1')]},'format':{'type':Sequelize[_0x4ae2('0x2')],'get':function(){var _0x307247='';var _0x4f2e84=this['getDataValue'](_0x4ae2('0x3'));if(_0x4f2e84){_0x307247=_0x4f2e84['substring'](_0x4f2e84['lastIndexOf']('.'));}return _0x307247;}}}; \ No newline at end of file +var _0x2d17=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d17,0x17e));var _0x72d1=function(_0x5d9123,_0x39e794){_0x5d9123=_0x5d9123-0x0;var _0x509220=_0x2d17[_0x5d9123];return _0x509220;};'use strict';var Sequelize=require(_0x72d1('0x0'));module[_0x72d1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x72d1('0x2')]},'calleridname':{'type':Sequelize[_0x72d1('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x72d1('0x2')]},'priority':{'type':Sequelize[_0x72d1('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x72d1('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x72d1('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x72d1('0x2')]},'format':{'type':Sequelize[_0x72d1('0x3')],'get':function(){var _0x5b40a9='';var _0x477264=this[_0x72d1('0x4')](_0x72d1('0x5'));if(_0x477264){_0x5b40a9=_0x477264['substring'](_0x477264[_0x72d1('0x6')]('.'));}return _0x5b40a9;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 600322f..66fbdc7 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 _0x3442=['ValidationError','SquareRecording\x20not\x20found','filename','unlink','download','message','Not\x20found','isNil','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','update','destroy','then','end','error','stack','name','send','index','map','SquareRecording','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','params','keys','include','find','create','body','catch','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize'];(function(_0x459f20,_0x57a9f3){var _0x505649=function(_0x566379){while(--_0x566379){_0x459f20['push'](_0x459f20['shift']());}};_0x505649(++_0x57a9f3);}(_0x3442,0x128));var _0x2344=function(_0x53c113,_0x570ee7){_0x53c113=_0x53c113-0x0;var _0x280a8f=_0x3442[_0x53c113];return _0x280a8f;};'use strict';var emlformat=require(_0x2344('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2344('0x1'));var jsonpatch=require(_0x2344('0x2'));var rp=require(_0x2344('0x3'));var moment=require(_0x2344('0x4'));var BPromise=require(_0x2344('0x5'));var Mustache=require(_0x2344('0x6'));var util=require('util');var path=require(_0x2344('0x7'));var sox=require('sox');var csv=require(_0x2344('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2344('0x9'));var _=require(_0x2344('0xa'));var squel=require(_0x2344('0xb'));var crypto=require('crypto');var jsforce=require(_0x2344('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2344('0x8'));var querystring=require(_0x2344('0xd'));var Papa=require(_0x2344('0xe'));var Redis=require('ioredis');var authService=require(_0x2344('0xf'));var qs=require(_0x2344('0x10'));var as=require(_0x2344('0x11'));var hardwareService=require(_0x2344('0x12'));var logger=require(_0x2344('0x13'))(_0x2344('0x14'));var utils=require(_0x2344('0x15'));var config=require(_0x2344('0x16'));var licenseUtil=require(_0x2344('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbefe4a,_0x48605a){_0x48605a=_0x48605a||0xcc;return function(_0x2fab83){if(_0x2fab83){return _0xbefe4a[_0x2344('0x18')](_0x48605a);}return _0xbefe4a[_0x2344('0x19')](_0x48605a)['end']();};}function respondWithResult(_0x20542f,_0xd84c89){_0xd84c89=_0xd84c89||0xc8;return function(_0x5f468a){if(_0x5f468a){return _0x20542f[_0x2344('0x19')](_0xd84c89)[_0x2344('0x1a')](_0x5f468a);}};}function respondWithFilteredResult(_0x4e95b9,_0x4e0e7b){return function(_0x2dc20f){if(_0x2dc20f){var _0x1d34fc=typeof _0x4e0e7b[_0x2344('0x1b')]===_0x2344('0x1c')&&typeof _0x4e0e7b[_0x2344('0x1d')]===_0x2344('0x1c');var _0x9428da=_0x2dc20f[_0x2344('0x1e')];var _0x292e6d=_0x1d34fc?0x0:_0x4e0e7b[_0x2344('0x1b')];var _0x5cb98d=_0x1d34fc?_0x2dc20f['count']:_0x4e0e7b[_0x2344('0x1b')]+_0x4e0e7b[_0x2344('0x1d')];var _0x3a1545;if(_0x5cb98d>=_0x9428da){_0x5cb98d=_0x9428da;_0x3a1545=0xc8;}else{_0x3a1545=0xce;}_0x4e95b9[_0x2344('0x19')](_0x3a1545);return _0x4e95b9['set'](_0x2344('0x1f'),_0x292e6d+'-'+_0x5cb98d+'/'+_0x9428da)[_0x2344('0x1a')](_0x2dc20f);}return null;};}function patchUpdates(_0x37baf0){return function(_0x1fe1ad){try{jsonpatch['apply'](_0x1fe1ad,_0x37baf0,!![]);}catch(_0x5c7772){return BPromise[_0x2344('0x20')](_0x5c7772);}return _0x1fe1ad['save']();};}function saveUpdates(_0x4eafd7,_0x50bf1c){return function(_0x3555d3){if(_0x3555d3){return _0x3555d3[_0x2344('0x21')](_0x4eafd7)['then'](function(_0x2d6f3f){return _0x2d6f3f;});}return null;};}function removeEntity(_0x3fd911,_0x239be4){return function(_0x1b61d3){if(_0x1b61d3){return _0x1b61d3[_0x2344('0x22')]()[_0x2344('0x23')](function(){_0x3fd911['status'](0xcc)[_0x2344('0x24')]();});}};}function handleEntityNotFound(_0x4ef2fb,_0x4b6801){return function(_0xe3b147){if(!_0xe3b147){_0x4ef2fb['sendStatus'](0x194);}return _0xe3b147;};}function handleError(_0x404d55,_0x38be7d){_0x38be7d=_0x38be7d||0x1f4;return function(_0x55a3d7){logger[_0x2344('0x25')](_0x55a3d7[_0x2344('0x26')]);if(_0x55a3d7[_0x2344('0x27')]){delete _0x55a3d7[_0x2344('0x27')];}_0x404d55[_0x2344('0x19')](_0x38be7d)[_0x2344('0x28')](_0x55a3d7);};}exports[_0x2344('0x29')]=function(_0x142753,_0x10fd8a){var _0x24fab6={},_0x3e0808={},_0x5b622f={'count':0x0,'rows':[]};var _0x243429=_[_0x2344('0x2a')](db[_0x2344('0x2b')][_0x2344('0x2c')],function(_0x23b58c){return{'name':_0x23b58c['fieldName'],'type':_0x23b58c[_0x2344('0x2d')][_0x2344('0x2e')]};});_0x3e0808[_0x2344('0x2f')]=_[_0x2344('0x2a')](_0x243429,_0x2344('0x27'));_0x3e0808[_0x2344('0x30')]=_['keys'](_0x142753[_0x2344('0x30')]);_0x3e0808[_0x2344('0x31')]=_[_0x2344('0x32')](_0x3e0808[_0x2344('0x2f')],_0x3e0808[_0x2344('0x30')]);_0x24fab6[_0x2344('0x33')]=_['intersection'](_0x3e0808['model'],qs['fields'](_0x142753['query'][_0x2344('0x34')]));_0x24fab6[_0x2344('0x33')]=_0x24fab6['attributes'][_0x2344('0x35')]?_0x24fab6[_0x2344('0x33')]:_0x3e0808['model'];if(!_0x142753['query']['hasOwnProperty']('nolimit')){_0x24fab6[_0x2344('0x1d')]=qs[_0x2344('0x1d')](_0x142753[_0x2344('0x30')]['limit']);_0x24fab6[_0x2344('0x1b')]=qs['offset'](_0x142753[_0x2344('0x30')][_0x2344('0x1b')]);}_0x24fab6[_0x2344('0x36')]=qs[_0x2344('0x37')](_0x142753[_0x2344('0x30')][_0x2344('0x37')]);_0x24fab6[_0x2344('0x38')]=qs[_0x2344('0x31')](_[_0x2344('0x39')](_0x142753[_0x2344('0x30')],_0x3e0808[_0x2344('0x31')]),_0x243429);if(_0x142753[_0x2344('0x30')][_0x2344('0x3a')]){_0x24fab6[_0x2344('0x38')]=_['merge'](_0x24fab6['where'],{'$or':_[_0x2344('0x2a')](_0x243429,function(_0xdceb90){if(_0xdceb90[_0x2344('0x2d')]!==_0x2344('0x3b')){var _0xe15487={};_0xe15487[_0xdceb90[_0x2344('0x27')]]={'$like':'%'+_0x142753[_0x2344('0x30')][_0x2344('0x3a')]+'%'};return _0xe15487;}})});}_0x24fab6=_[_0x2344('0x3c')]({},_0x24fab6,_0x142753[_0x2344('0x3d')]);var _0x1b629d={'where':_0x24fab6[_0x2344('0x38')]};return db[_0x2344('0x2b')][_0x2344('0x1e')](_0x1b629d)[_0x2344('0x23')](function(_0xd18ef3){_0x5b622f[_0x2344('0x1e')]=_0xd18ef3;if(_0x142753['query']['includeAll']){_0x24fab6['include']=[{'all':!![]}];}return db[_0x2344('0x2b')][_0x2344('0x3e')](_0x24fab6);})[_0x2344('0x23')](function(_0x55ba9e){_0x5b622f['rows']=_0x55ba9e;return _0x5b622f;})[_0x2344('0x23')](respondWithFilteredResult(_0x10fd8a,_0x24fab6))['catch'](handleError(_0x10fd8a,null));};exports['show']=function(_0x23e792,_0x4e4edc){var _0x13887d={'raw':!![],'where':{'id':_0x23e792[_0x2344('0x3f')]['id']}},_0x39a78e={};_0x39a78e['model']=_['keys'](db[_0x2344('0x2b')]['rawAttributes']);_0x39a78e[_0x2344('0x30')]=_[_0x2344('0x40')](_0x23e792[_0x2344('0x30')]);_0x39a78e[_0x2344('0x31')]=_['intersection'](_0x39a78e['model'],_0x39a78e['query']);_0x13887d['attributes']=_[_0x2344('0x32')](_0x39a78e[_0x2344('0x2f')],qs[_0x2344('0x34')](_0x23e792['query'][_0x2344('0x34')]));_0x13887d[_0x2344('0x33')]=_0x13887d[_0x2344('0x33')][_0x2344('0x35')]?_0x13887d['attributes']:_0x39a78e['model'];if(_0x23e792[_0x2344('0x30')]['includeAll']){_0x13887d[_0x2344('0x41')]=[{'all':!![]}];}_0x13887d=_[_0x2344('0x3c')]({},_0x13887d,_0x23e792['options']);return db['SquareRecording'][_0x2344('0x42')](_0x13887d)['then'](handleEntityNotFound(_0x4e4edc,null))['then'](respondWithResult(_0x4e4edc,null))['catch'](handleError(_0x4e4edc,null));};exports[_0x2344('0x43')]=function(_0xfd6841,_0x5888fa){return db['SquareRecording'][_0x2344('0x43')](_0xfd6841[_0x2344('0x44')],{})[_0x2344('0x23')](respondWithResult(_0x5888fa,0xc9))['catch'](handleError(_0x5888fa,null));};exports[_0x2344('0x21')]=function(_0x35ed90,_0x165e39){if(_0x35ed90[_0x2344('0x44')]['id']){delete _0x35ed90[_0x2344('0x44')]['id'];}return db[_0x2344('0x2b')][_0x2344('0x42')]({'where':{'id':_0x35ed90[_0x2344('0x3f')]['id']}})['then'](handleEntityNotFound(_0x165e39,null))[_0x2344('0x23')](saveUpdates(_0x35ed90[_0x2344('0x44')],null))[_0x2344('0x23')](respondWithResult(_0x165e39,null))[_0x2344('0x45')](handleError(_0x165e39,null));};exports['download']=function(_0x15ccf8,_0x5a7307,_0x3a8d6f){var _0x1ce404=require(_0x2344('0x46'));var _0x2806d2=![];var _0x56b2a3={};if(_0x15ccf8[_0x2344('0x30')][_0x2344('0x2d')]&&_0x15ccf8[_0x2344('0x30')][_0x2344('0x2d')]===_0x2344('0x47')){_0x56b2a3[_0x2344('0x47')]=_0x15ccf8[_0x2344('0x3f')]['id'];}else{_0x56b2a3['id']=_0x15ccf8[_0x2344('0x3f')]['id'];}return db[_0x2344('0x2b')][_0x2344('0x42')]({'where':_0x56b2a3,'attributes':['id',_0x2344('0x48'),'filename'],'raw':!![]})[_0x2344('0x23')](handleEntityNotFound(_0x5a7307,null))['then'](function(_0x3f3c09){if(_0x3f3c09){var _0x407acb=_0x3f3c09[_0x2344('0x48')];var _0xbd71b=util[_0x2344('0x49')](_0x2344('0x4a'),_0x407acb);if(fs[_0x2344('0x4b')](_0xbd71b)){_0x2806d2=!![];return _0x1ce404[_0x2344('0x4c')](_0xbd71b,_0x407acb,config[_0x2344('0x4d')][_0x2344('0x4e')])[_0x2344('0x23')](function(){return _0x3f3c09;});}return _0x3f3c09;}})[_0x2344('0x23')](function(_0x118383){if(_0x118383){var _0x9500a5=_0x118383[_0x2344('0x48')];if(!fs[_0x2344('0x4b')](_0x9500a5)){throw new db[(_0x2344('0x4f'))][(_0x2344('0x50'))](_0x2344('0x51'));}if(_0x118383[_0x2344('0x52')]){return _0x5a7307['download'](_0x9500a5,_0x118383[_0x2344('0x52')]+path['extname'](_0x9500a5),function(){if(_0x2806d2){fs[_0x2344('0x53')](_0x9500a5);}});}else{return _0x5a7307[_0x2344('0x54')](_0x9500a5,function(_0xe328d4){if(_0x2806d2){fs['unlink'](_0x9500a5);}});}}})[_0x2344('0x45')](function(_0x2ee3e4){if(_0x2ee3e4[_0x2344('0x55')]===_0x2344('0x51')){_0x5a7307[_0x2344('0x19')](0x194)[_0x2344('0x28')](_0x2344('0x56'));}else{return handleError(_0x5a7307,null);}});};exports[_0x2344('0x22')]=function(_0x1f23ed,_0x2632d8){return db['SquareRecording'][_0x2344('0x42')]({'where':{'id':_0x1f23ed['params']['id']}})[_0x2344('0x23')](function(_0x298eae){if(_[_0x2344('0x57')](_0x298eae)){throw new ReferenceError('Entity\x20not\x20found');}return _0x298eae;})['then'](function(_0x10871d){var _0x218034=_0x10871d[_0x2344('0x48')];logger['info'](_0x2344('0x58'),_0x218034);if(!_[_0x2344('0x57')](_0x10871d[_0x2344('0x48')])&&fs['existsSync'](_0x218034)){logger[_0x2344('0x59')](_0x2344('0x5a')+_0x218034+_0x2344('0x5b'));fs[_0x2344('0x5c')](_0x218034);}_0x218034=_0x218034+_0x2344('0x5d');if(!_[_0x2344('0x57')](_0x10871d[_0x2344('0x48')])&&fs[_0x2344('0x4b')](_0x218034)){logger[_0x2344('0x59')](_0x2344('0x5a')+_0x218034+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x218034);}return _0x10871d;})[_0x2344('0x23')](function(_0x3b2acc){if(!_0x3b2acc)throw new InternalError();return _0x3b2acc[_0x2344('0x22')]();})[_0x2344('0x23')](function(){_0x2632d8[_0x2344('0x19')](0xcc)[_0x2344('0x24')]();})[_0x2344('0x45')](handleError(_0x2632d8,null));}; \ No newline at end of file +var _0x3c2b=['mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','params','keys','fields','includeAll','catch','body','download','uniqueid','savePath','format','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','filename','extname','unlink','SquareRecording\x20not\x20found','send','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x4c446e,_0x19a934){var _0x367191=function(_0x42a399){while(--_0x42a399){_0x4c446e['push'](_0x4c446e['shift']());}};_0x367191(++_0x19a934);}(_0x3c2b,0x16f));var _0xb3c2=function(_0x1a3884,_0x25d611){_0x1a3884=_0x1a3884-0x0;var _0xdcdc56=_0x3c2b[_0x1a3884];return _0xdcdc56;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb3c2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb3c2('0x1'));var rp=require(_0xb3c2('0x2'));var moment=require(_0xb3c2('0x3'));var BPromise=require(_0xb3c2('0x4'));var Mustache=require(_0xb3c2('0x5'));var util=require(_0xb3c2('0x6'));var path=require(_0xb3c2('0x7'));var sox=require(_0xb3c2('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb3c2('0x9'));var crypto=require(_0xb3c2('0xa'));var jsforce=require(_0xb3c2('0xb'));var deskjs=require(_0xb3c2('0xc'));var toCsv=require(_0xb3c2('0xd'));var querystring=require(_0xb3c2('0xe'));var Papa=require('papaparse');var Redis=require(_0xb3c2('0xf'));var authService=require(_0xb3c2('0x10'));var qs=require(_0xb3c2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb3c2('0x12'));var utils=require('../../config/utils');var config=require(_0xb3c2('0x13'));var licenseUtil=require(_0xb3c2('0x14'));var db=require(_0xb3c2('0x15'))['db'];function respondWithStatusCode(_0xc6fe5b,_0x1547b3){_0x1547b3=_0x1547b3||0xcc;return function(_0x50704b){if(_0x50704b){return _0xc6fe5b['sendStatus'](_0x1547b3);}return _0xc6fe5b[_0xb3c2('0x16')](_0x1547b3)[_0xb3c2('0x17')]();};}function respondWithResult(_0x2987d4,_0xf3e051){_0xf3e051=_0xf3e051||0xc8;return function(_0x239631){if(_0x239631){return _0x2987d4[_0xb3c2('0x16')](_0xf3e051)[_0xb3c2('0x18')](_0x239631);}};}function respondWithFilteredResult(_0x5929cf,_0x43816f){return function(_0x2454dd){if(_0x2454dd){var _0x3f50e8=typeof _0x43816f[_0xb3c2('0x19')]===_0xb3c2('0x1a')&&typeof _0x43816f[_0xb3c2('0x1b')]===_0xb3c2('0x1a');var _0x581bb0=_0x2454dd[_0xb3c2('0x1c')];var _0x4d208e=_0x3f50e8?0x0:_0x43816f[_0xb3c2('0x19')];var _0x216966=_0x3f50e8?_0x2454dd[_0xb3c2('0x1c')]:_0x43816f['offset']+_0x43816f[_0xb3c2('0x1b')];var _0x2ecc44;if(_0x216966>=_0x581bb0){_0x216966=_0x581bb0;_0x2ecc44=0xc8;}else{_0x2ecc44=0xce;}_0x5929cf[_0xb3c2('0x16')](_0x2ecc44);return _0x5929cf[_0xb3c2('0x1d')](_0xb3c2('0x1e'),_0x4d208e+'-'+_0x216966+'/'+_0x581bb0)[_0xb3c2('0x18')](_0x2454dd);}return null;};}function patchUpdates(_0x11e122){return function(_0x2d70d6){try{jsonpatch['apply'](_0x2d70d6,_0x11e122,!![]);}catch(_0x4f0b1d){return BPromise[_0xb3c2('0x1f')](_0x4f0b1d);}return _0x2d70d6[_0xb3c2('0x20')]();};}function saveUpdates(_0x1a0bcc,_0x19c24b){return function(_0x4a0652){if(_0x4a0652){return _0x4a0652[_0xb3c2('0x21')](_0x1a0bcc)[_0xb3c2('0x22')](function(_0x2a72c5){return _0x2a72c5;});}return null;};}function removeEntity(_0x2fffe6,_0x239c1d){return function(_0x73eb48){if(_0x73eb48){return _0x73eb48[_0xb3c2('0x23')]()['then'](function(){_0x2fffe6[_0xb3c2('0x16')](0xcc)[_0xb3c2('0x17')]();});}};}function handleEntityNotFound(_0x574472,_0x17d17e){return function(_0x45d787){if(!_0x45d787){_0x574472[_0xb3c2('0x24')](0x194);}return _0x45d787;};}function handleError(_0x26d608,_0x1745e3){_0x1745e3=_0x1745e3||0x1f4;return function(_0x306fda){logger[_0xb3c2('0x25')](_0x306fda[_0xb3c2('0x26')]);if(_0x306fda[_0xb3c2('0x27')]){delete _0x306fda['name'];}_0x26d608[_0xb3c2('0x16')](_0x1745e3)['send'](_0x306fda);};}exports[_0xb3c2('0x28')]=function(_0x28377c,_0xc87ee){var _0x3034a6={},_0x47fbb1={},_0xe0542f={'count':0x0,'rows':[]};var _0x5641b5=_[_0xb3c2('0x29')](db[_0xb3c2('0x2a')][_0xb3c2('0x2b')],function(_0x36f1bf){return{'name':_0x36f1bf[_0xb3c2('0x2c')],'type':_0x36f1bf[_0xb3c2('0x2d')][_0xb3c2('0x2e')]};});_0x47fbb1[_0xb3c2('0x2f')]=_[_0xb3c2('0x29')](_0x5641b5,_0xb3c2('0x27'));_0x47fbb1[_0xb3c2('0x30')]=_['keys'](_0x28377c['query']);_0x47fbb1[_0xb3c2('0x31')]=_[_0xb3c2('0x32')](_0x47fbb1[_0xb3c2('0x2f')],_0x47fbb1[_0xb3c2('0x30')]);_0x3034a6[_0xb3c2('0x33')]=_[_0xb3c2('0x32')](_0x47fbb1[_0xb3c2('0x2f')],qs['fields'](_0x28377c[_0xb3c2('0x30')]['fields']));_0x3034a6[_0xb3c2('0x33')]=_0x3034a6[_0xb3c2('0x33')][_0xb3c2('0x34')]?_0x3034a6[_0xb3c2('0x33')]:_0x47fbb1[_0xb3c2('0x2f')];if(!_0x28377c[_0xb3c2('0x30')][_0xb3c2('0x35')](_0xb3c2('0x36'))){_0x3034a6['limit']=qs[_0xb3c2('0x1b')](_0x28377c['query'][_0xb3c2('0x1b')]);_0x3034a6[_0xb3c2('0x19')]=qs[_0xb3c2('0x19')](_0x28377c[_0xb3c2('0x30')][_0xb3c2('0x19')]);}_0x3034a6[_0xb3c2('0x37')]=qs['sort'](_0x28377c[_0xb3c2('0x30')][_0xb3c2('0x38')]);_0x3034a6[_0xb3c2('0x39')]=qs[_0xb3c2('0x31')](_[_0xb3c2('0x3a')](_0x28377c['query'],_0x47fbb1[_0xb3c2('0x31')]),_0x5641b5);if(_0x28377c[_0xb3c2('0x30')][_0xb3c2('0x3b')]){_0x3034a6[_0xb3c2('0x39')]=_[_0xb3c2('0x3c')](_0x3034a6['where'],{'$or':_[_0xb3c2('0x29')](_0x5641b5,function(_0x62ea2b){if(_0x62ea2b[_0xb3c2('0x2d')]!=='VIRTUAL'){var _0x424ded={};_0x424ded[_0x62ea2b[_0xb3c2('0x27')]]={'$like':'%'+_0x28377c['query'][_0xb3c2('0x3b')]+'%'};return _0x424ded;}})});}_0x3034a6=_[_0xb3c2('0x3c')]({},_0x3034a6,_0x28377c[_0xb3c2('0x3d')]);var _0x3db9c8={'where':_0x3034a6[_0xb3c2('0x39')]};return db[_0xb3c2('0x2a')][_0xb3c2('0x1c')](_0x3db9c8)['then'](function(_0xd26a23){_0xe0542f[_0xb3c2('0x1c')]=_0xd26a23;if(_0x28377c[_0xb3c2('0x30')]['includeAll']){_0x3034a6[_0xb3c2('0x3e')]=[{'all':!![]}];}return db[_0xb3c2('0x2a')][_0xb3c2('0x3f')](_0x3034a6);})[_0xb3c2('0x22')](function(_0x331aad){_0xe0542f[_0xb3c2('0x40')]=_0x331aad;return _0xe0542f;})['then'](respondWithFilteredResult(_0xc87ee,_0x3034a6))['catch'](handleError(_0xc87ee,null));};exports['show']=function(_0x6075b3,_0x54d030){var _0x294506={'raw':!![],'where':{'id':_0x6075b3[_0xb3c2('0x41')]['id']}},_0x5c774f={};_0x5c774f[_0xb3c2('0x2f')]=_[_0xb3c2('0x42')](db['SquareRecording'][_0xb3c2('0x2b')]);_0x5c774f[_0xb3c2('0x30')]=_[_0xb3c2('0x42')](_0x6075b3['query']);_0x5c774f['filters']=_[_0xb3c2('0x32')](_0x5c774f[_0xb3c2('0x2f')],_0x5c774f['query']);_0x294506[_0xb3c2('0x33')]=_['intersection'](_0x5c774f[_0xb3c2('0x2f')],qs[_0xb3c2('0x43')](_0x6075b3['query'][_0xb3c2('0x43')]));_0x294506[_0xb3c2('0x33')]=_0x294506[_0xb3c2('0x33')]['length']?_0x294506[_0xb3c2('0x33')]:_0x5c774f['model'];if(_0x6075b3['query'][_0xb3c2('0x44')]){_0x294506[_0xb3c2('0x3e')]=[{'all':!![]}];}_0x294506=_[_0xb3c2('0x3c')]({},_0x294506,_0x6075b3['options']);return db['SquareRecording']['find'](_0x294506)[_0xb3c2('0x22')](handleEntityNotFound(_0x54d030,null))[_0xb3c2('0x22')](respondWithResult(_0x54d030,null))[_0xb3c2('0x45')](handleError(_0x54d030,null));};exports['create']=function(_0x2ce548,_0x5a9a29){return db[_0xb3c2('0x2a')]['create'](_0x2ce548['body'],{})[_0xb3c2('0x22')](respondWithResult(_0x5a9a29,0xc9))[_0xb3c2('0x45')](handleError(_0x5a9a29,null));};exports[_0xb3c2('0x21')]=function(_0x97c476,_0x1d799d){if(_0x97c476[_0xb3c2('0x46')]['id']){delete _0x97c476[_0xb3c2('0x46')]['id'];}return db[_0xb3c2('0x2a')]['find']({'where':{'id':_0x97c476['params']['id']}})[_0xb3c2('0x22')](handleEntityNotFound(_0x1d799d,null))[_0xb3c2('0x22')](saveUpdates(_0x97c476['body'],null))['then'](respondWithResult(_0x1d799d,null))[_0xb3c2('0x45')](handleError(_0x1d799d,null));};exports[_0xb3c2('0x47')]=function(_0x355c25,_0x272e42,_0x52f566){var _0x1ff266=require('../../components/encryptor');var _0x32335e=![];var _0x5f5123={};if(_0x355c25[_0xb3c2('0x30')][_0xb3c2('0x2d')]&&_0x355c25[_0xb3c2('0x30')][_0xb3c2('0x2d')]===_0xb3c2('0x48')){_0x5f5123[_0xb3c2('0x48')]=_0x355c25[_0xb3c2('0x41')]['id'];}else{_0x5f5123['id']=_0x355c25[_0xb3c2('0x41')]['id'];}return db[_0xb3c2('0x2a')]['find']({'where':_0x5f5123,'attributes':['id','savePath','filename'],'raw':!![]})[_0xb3c2('0x22')](handleEntityNotFound(_0x272e42,null))['then'](function(_0x244561){if(_0x244561){var _0xf59dee=_0x244561[_0xb3c2('0x49')];var _0x3f8fd3=util[_0xb3c2('0x4a')]('%s.cypher',_0xf59dee);if(fs[_0xb3c2('0x4b')](_0x3f8fd3)){_0x32335e=!![];return _0x1ff266[_0xb3c2('0x4c')](_0x3f8fd3,_0xf59dee,config[_0xb3c2('0x4d')][_0xb3c2('0x4e')])[_0xb3c2('0x22')](function(){return _0x244561;});}return _0x244561;}})[_0xb3c2('0x22')](function(_0x5e0d67){if(_0x5e0d67){var _0xde8b12=_0x5e0d67[_0xb3c2('0x49')];if(!fs[_0xb3c2('0x4b')](_0xde8b12)){throw new db[(_0xb3c2('0x4f'))][(_0xb3c2('0x50'))]('SquareRecording\x20not\x20found');}if(_0x5e0d67[_0xb3c2('0x51')]){return _0x272e42[_0xb3c2('0x47')](_0xde8b12,_0x5e0d67['filename']+path[_0xb3c2('0x52')](_0xde8b12),function(){if(_0x32335e){fs['unlink'](_0xde8b12);}});}else{return _0x272e42[_0xb3c2('0x47')](_0xde8b12,function(_0x51b5da){if(_0x32335e){fs[_0xb3c2('0x53')](_0xde8b12);}});}}})[_0xb3c2('0x45')](function(_0x2e5fcb){if(_0x2e5fcb['message']===_0xb3c2('0x54')){_0x272e42[_0xb3c2('0x16')](0x194)[_0xb3c2('0x55')](_0xb3c2('0x56'));}else{return handleError(_0x272e42,null);}});};exports['destroy']=function(_0x296599,_0x5d0aef){return db[_0xb3c2('0x2a')]['find']({'where':{'id':_0x296599['params']['id']}})[_0xb3c2('0x22')](function(_0x29426b){if(_[_0xb3c2('0x57')](_0x29426b)){throw new ReferenceError('Entity\x20not\x20found');}return _0x29426b;})[_0xb3c2('0x22')](function(_0x26f230){var _0x3446b0=_0x26f230[_0xb3c2('0x49')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x3446b0);if(!_['isNil'](_0x26f230[_0xb3c2('0x49')])&&fs[_0xb3c2('0x4b')](_0x3446b0)){logger[_0xb3c2('0x58')](_0xb3c2('0x59')+_0x3446b0+_0xb3c2('0x5a'));fs['unlinkSync'](_0x3446b0);}_0x3446b0=_0x3446b0+_0xb3c2('0x5b');if(!_[_0xb3c2('0x57')](_0x26f230[_0xb3c2('0x49')])&&fs[_0xb3c2('0x4b')](_0x3446b0)){logger[_0xb3c2('0x58')]('File:\x20\x22'+_0x3446b0+_0xb3c2('0x5a'));fs[_0xb3c2('0x5c')](_0x3446b0);}return _0x26f230;})[_0xb3c2('0x22')](function(_0x5355d9){if(!_0x5355d9)throw new InternalError();return _0x5355d9['destroy']();})[_0xb3c2('0x22')](function(){_0x5d0aef[_0xb3c2('0x16')](0xcc)[_0xb3c2('0x17')]();})[_0xb3c2('0x45')](handleError(_0x5d0aef,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 33c687e..6618159 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 _0x7bd0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording'];(function(_0x14070a,_0x97c10f){var _0x4018df=function(_0x4f5936){while(--_0x4f5936){_0x14070a['push'](_0x14070a['shift']());}};_0x4018df(++_0x97c10f);}(_0x7bd0,0x111));var _0x07bd=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x7bd0[_0x38537f];return _0x141e23;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var logger=require(_0x07bd('0x2'))(_0x07bd('0x3'));var moment=require(_0x07bd('0x4'));var BPromise=require(_0x07bd('0x5'));var rp=require(_0x07bd('0x6'));var fs=require('fs');var path=require(_0x07bd('0x7'));var rimraf=require('rimraf');var config=require(_0x07bd('0x8'));var attributes=require(_0x07bd('0x9'));module[_0x07bd('0xa')]=function(_0x313548,_0x3e8349){return _0x313548[_0x07bd('0xb')](_0x07bd('0xc'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4279=['moment','bluebird','request-promise','path','../../config/environment','exports','define','SquareRecording','square_recordings','util','../../config/logger'];(function(_0x531e48,_0x4bb96b){var _0x202971=function(_0x403bf5){while(--_0x403bf5){_0x531e48['push'](_0x531e48['shift']());}};_0x202971(++_0x4bb96b);}(_0x4279,0x8d));var _0x9427=function(_0x18b8f2,_0x3d36d8){_0x18b8f2=_0x18b8f2-0x0;var _0x52ab44=_0x4279[_0x18b8f2];return _0x52ab44;};'use strict';var _=require('lodash');var util=require(_0x9427('0x0'));var logger=require(_0x9427('0x1'))('api');var moment=require(_0x9427('0x2'));var BPromise=require(_0x9427('0x3'));var rp=require(_0x9427('0x4'));var fs=require('fs');var path=require(_0x9427('0x5'));var rimraf=require('rimraf');var config=require(_0x9427('0x6'));var attributes=require('./squareRecording.attributes');module[_0x9427('0x7')]=function(_0x2a0b3e,_0x5e9d1e){return _0x2a0b3e[_0x9427('0x8')](_0x9427('0x9'),attributes,{'tableName':_0x9427('0xa'),'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 2c902ce..3396416 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 _0x6db0=['../../config/logger','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','result','catch','SquareRecording','create','body','options','raw','info','CreateSquareRecording','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1c03ca,_0x154255){var _0x5d97e2=function(_0x299049){while(--_0x299049){_0x1c03ca['push'](_0x1c03ca['shift']());}};_0x5d97e2(++_0x154255);}(_0x6db0,0xed));var _0x06db=function(_0x113cb6,_0x513d39){_0x113cb6=_0x113cb6-0x0;var _0x56339b=_0x6db0[_0x113cb6];return _0x56339b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x06db('0x0'));var BPromise=require(_0x06db('0x1'));var rs=require(_0x06db('0x2'));var fs=require('fs');var Redis=require(_0x06db('0x3'));var db=require(_0x06db('0x4'))['db'];var utils=require(_0x06db('0x5'));var logger=require(_0x06db('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x06db('0x7'));var client=jayson['client'][_0x06db('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d7125,_0x89fc74,_0x169a0d){return new BPromise(function(_0x4e3a38,_0x447d11){return client[_0x06db('0x9')](_0x2d7125,_0x169a0d)[_0x06db('0xa')](function(_0x23c214){logger['info']('SquareRecording,\x20%s,\x20%s',_0x89fc74,_0x06db('0xb'));logger[_0x06db('0xc')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x89fc74,_0x06db('0xb'),JSON[_0x06db('0xd')](_0x23c214));if(_0x23c214[_0x06db('0xe')]){if(_0x23c214[_0x06db('0xe')][_0x06db('0xf')]===0x1f4){logger['error'](_0x06db('0x10'),_0x89fc74,_0x23c214[_0x06db('0xe')][_0x06db('0x11')]);return _0x447d11(_0x23c214['error'][_0x06db('0x11')]);}logger[_0x06db('0xe')](_0x06db('0x10'),_0x89fc74,_0x23c214[_0x06db('0xe')][_0x06db('0x11')]);return _0x4e3a38(_0x23c214['error'][_0x06db('0x11')]);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x89fc74,_0x06db('0xb'));_0x4e3a38(_0x23c214[_0x06db('0x12')]['message']);}})[_0x06db('0x13')](function(_0x3807e8){logger[_0x06db('0xe')](_0x06db('0x10'),_0x89fc74,_0x3807e8);_0x447d11(_0x3807e8);});});}exports['CreateSquareRecording']=function(_0x9b51b2){var _0x577c21=this;return new Promise(function(_0x1565bb,_0xbb89b9){return db[_0x06db('0x14')][_0x06db('0x15')](_0x9b51b2[_0x06db('0x16')],{'raw':_0x9b51b2[_0x06db('0x17')]?_0x9b51b2[_0x06db('0x17')][_0x06db('0x18')]===undefined?!![]:![]:!![]})[_0x06db('0xa')](function(_0x2cfdfa){logger[_0x06db('0x19')]('CreateSquareRecording',_0x9b51b2);logger[_0x06db('0xc')](_0x06db('0x1a'),_0x9b51b2,JSON[_0x06db('0xd')](_0x2cfdfa));_0x1565bb(_0x2cfdfa);})['catch'](function(_0x59aadf){logger[_0x06db('0xe')]('CreateSquareRecording',_0x59aadf['message'],_0x9b51b2);_0xbb89b9(_0x577c21[_0x06db('0xe')](0x1f4,_0x59aadf[_0x06db('0x11')]));});});}; \ No newline at end of file +var _0x3b0c=['SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareRecording','SquareRecording','body','options','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x26bc61,_0x36840d){var _0x249aff=function(_0x2bd42c){while(--_0x2bd42c){_0x26bc61['push'](_0x26bc61['shift']());}};_0x249aff(++_0x36840d);}(_0x3b0c,0x113));var _0xc3b0=function(_0xca8230,_0xbcaeff){_0xca8230=_0xca8230-0x0;var _0x330cf5=_0x3b0c[_0xca8230];return _0x330cf5;};'use strict';var _=require('lodash');var util=require(_0xc3b0('0x0'));var moment=require('moment');var BPromise=require(_0xc3b0('0x1'));var rs=require(_0xc3b0('0x2'));var fs=require('fs');var Redis=require(_0xc3b0('0x3'));var db=require(_0xc3b0('0x4'))['db'];var utils=require(_0xc3b0('0x5'));var logger=require(_0xc3b0('0x6'))(_0xc3b0('0x7'));var config=require(_0xc3b0('0x8'));var jayson=require(_0xc3b0('0x9'));var client=jayson[_0xc3b0('0xa')][_0xc3b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6a350f,_0x11c96a,_0x117d47){return new BPromise(function(_0x1565ab,_0x3e44f1){return client[_0xc3b0('0xc')](_0x6a350f,_0x117d47)[_0xc3b0('0xd')](function(_0x14b604){logger[_0xc3b0('0xe')](_0xc3b0('0xf'),_0x11c96a,_0xc3b0('0x10'));logger[_0xc3b0('0x11')](_0xc3b0('0x12'),_0x11c96a,_0xc3b0('0x10'),JSON[_0xc3b0('0x13')](_0x14b604));if(_0x14b604[_0xc3b0('0x14')]){if(_0x14b604['error'][_0xc3b0('0x15')]===0x1f4){logger['error'](_0xc3b0('0xf'),_0x11c96a,_0x14b604[_0xc3b0('0x14')][_0xc3b0('0x16')]);return _0x3e44f1(_0x14b604[_0xc3b0('0x14')][_0xc3b0('0x16')]);}logger[_0xc3b0('0x14')](_0xc3b0('0xf'),_0x11c96a,_0x14b604[_0xc3b0('0x14')][_0xc3b0('0x16')]);return _0x1565ab(_0x14b604[_0xc3b0('0x14')]['message']);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x11c96a,_0xc3b0('0x10'));_0x1565ab(_0x14b604['result'][_0xc3b0('0x16')]);}})[_0xc3b0('0x17')](function(_0xb74759){logger[_0xc3b0('0x14')](_0xc3b0('0xf'),_0x11c96a,_0xb74759);_0x3e44f1(_0xb74759);});});}exports[_0xc3b0('0x18')]=function(_0x57697a){var _0x433c14=this;return new Promise(function(_0x32410b,_0x2be841){return db[_0xc3b0('0x19')]['create'](_0x57697a[_0xc3b0('0x1a')],{'raw':_0x57697a[_0xc3b0('0x1b')]?_0x57697a[_0xc3b0('0x1b')][_0xc3b0('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x2b0118){logger[_0xc3b0('0xe')](_0xc3b0('0x18'),_0x57697a);logger[_0xc3b0('0x11')](_0xc3b0('0x18'),_0x57697a,JSON[_0xc3b0('0x13')](_0x2b0118));_0x32410b(_0x2b0118);})[_0xc3b0('0x17')](function(_0x2ac127){logger['error'](_0xc3b0('0x18'),_0x2ac127[_0xc3b0('0x16')],_0x57697a);_0x2be841(_0x433c14[_0xc3b0('0x14')](0x1f4,_0x2ac127[_0xc3b0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 703aef5..c5a89f0 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 _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0xb17ac0,_0x58192f){var _0x4b7248=function(_0xe211d2){while(--_0xe211d2){_0xb17ac0['push'](_0xb17ac0['shift']());}};_0x4b7248(++_0x58192f);}(_0xe706,0xa3));var _0x6e70=function(_0x5bac10,_0x436643){_0x5bac10=_0x5bac10-0x0;var _0x362c49=_0xe706[_0x5bac10];return _0x362c49;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x3b9e5f,_0x4798fc){var _0x4ae0e9=function(_0x44ff6e){while(--_0x44ff6e){_0x3b9e5f['push'](_0x3b9e5f['shift']());}};_0x4ae0e9(++_0x4798fc);}(_0xe706,0xa3));var _0x6e70=function(_0x2f3412,_0x2b8d24){_0x2f3412=_0x2f3412-0x0;var _0x4071d6=_0xe706[_0x2f3412];return _0x4071d6;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 7879135..0a7a03a 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 _0xed27=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x5533b6,_0x2d3021){var _0x4174aa=function(_0x41bd6c){while(--_0x41bd6c){_0x5533b6['push'](_0x5533b6['shift']());}};_0x4174aa(++_0x2d3021);}(_0xed27,0x183));var _0x7ed2=function(_0x475da1,_0x2b5d75){_0x475da1=_0x475da1-0x0;var _0x250599=_0xed27[_0x475da1];return _0x250599;};'use strict';var Sequelize=require(_0x7ed2('0x0'));module[_0x7ed2('0x1')]={'network':{'type':Sequelize[_0x7ed2('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x7ed2('0x2')]},'channel':{'type':Sequelize[_0x7ed2('0x2')]},'language':{'type':Sequelize[_0x7ed2('0x2')]},'type':{'type':Sequelize[_0x7ed2('0x2')]},'uniqueid':{'type':Sequelize[_0x7ed2('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x7ed2('0x2')]},'calleridname':{'type':Sequelize[_0x7ed2('0x2')]},'callingpres':{'type':Sequelize[_0x7ed2('0x2')]},'callingani2':{'type':Sequelize[_0x7ed2('0x2')]},'callington':{'type':Sequelize[_0x7ed2('0x2')]},'callingtns':{'type':Sequelize[_0x7ed2('0x2')]},'dnid':{'type':Sequelize[_0x7ed2('0x2')]},'rdnis':{'type':Sequelize[_0x7ed2('0x2')]},'context':{'type':Sequelize[_0x7ed2('0x2')]},'extension':{'type':Sequelize[_0x7ed2('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x7ed2('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x7ed2('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7ed2('0x3')]},'bot':{'type':Sequelize[_0x7ed2('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x8786=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3db122,_0x5e6bee){var _0x325b67=function(_0x5095af){while(--_0x5095af){_0x3db122['push'](_0x3db122['shift']());}};_0x325b67(++_0x5e6bee);}(_0x8786,0x153));var _0x6878=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x8786[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0x6878('0x0'));module[_0x6878('0x1')]={'network':{'type':Sequelize[_0x6878('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x6878('0x2')]},'channel':{'type':Sequelize[_0x6878('0x2')]},'language':{'type':Sequelize[_0x6878('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x6878('0x2')]},'version':{'type':Sequelize[_0x6878('0x2')]},'callerid':{'type':Sequelize[_0x6878('0x2')]},'calleridname':{'type':Sequelize[_0x6878('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x6878('0x2')]},'callington':{'type':Sequelize[_0x6878('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x6878('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6878('0x2')]},'extension':{'type':Sequelize[_0x6878('0x2')]},'priority':{'type':Sequelize[_0x6878('0x2')]},'enhanced':{'type':Sequelize[_0x6878('0x2')]},'accountcode':{'type':Sequelize[_0x6878('0x2')]},'threadid':{'type':Sequelize[_0x6878('0x2')]},'project_name':{'type':Sequelize[_0x6878('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x6878('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 c8d8848..9c0fede 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 _0x08e9=['querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','SquareReport','type','model','query','keys','intersection','attributes','nolimit','sort','where','filters','pick','filter','merge','name','options','findAll','rows','show','params','rawAttributes','fields','length','includeAll','include','find','create','body','catch','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv'];(function(_0x4e7520,_0xff6dc4){var _0x4d2d69=function(_0x3ca976){while(--_0x3ca976){_0x4e7520['push'](_0x4e7520['shift']());}};_0x4d2d69(++_0xff6dc4);}(_0x08e9,0x148));var _0x908e=function(_0x20867d,_0x5f54ed){_0x20867d=_0x20867d-0x0;var _0x53fa30=_0x08e9[_0x20867d];return _0x53fa30;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x908e('0x0'));var jsonpatch=require(_0x908e('0x1'));var rp=require(_0x908e('0x2'));var moment=require(_0x908e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x908e('0x4'));var util=require('util');var path=require('path');var sox=require(_0x908e('0x5'));var csv=require('to-csv');var ejs=require(_0x908e('0x6'));var fs=require('fs');var fs_extra=require(_0x908e('0x7'));var _=require('lodash');var squel=require(_0x908e('0x8'));var crypto=require('crypto');var jsforce=require(_0x908e('0x9'));var deskjs=require(_0x908e('0xa'));var toCsv=require(_0x908e('0xb'));var querystring=require(_0x908e('0xc'));var Papa=require('papaparse');var Redis=require(_0x908e('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x908e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x908e('0xf'));var logger=require(_0x908e('0x10'))(_0x908e('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x908e('0x12'))['db'];function respondWithStatusCode(_0x4ae814,_0x3bf86e){_0x3bf86e=_0x3bf86e||0xcc;return function(_0x15ef5c){if(_0x15ef5c){return _0x4ae814['sendStatus'](_0x3bf86e);}return _0x4ae814[_0x908e('0x13')](_0x3bf86e)[_0x908e('0x14')]();};}function respondWithResult(_0x3413df,_0x3c996a){_0x3c996a=_0x3c996a||0xc8;return function(_0x5ed4a6){if(_0x5ed4a6){return _0x3413df['status'](_0x3c996a)[_0x908e('0x15')](_0x5ed4a6);}};}function respondWithFilteredResult(_0x478522,_0xb44d98){return function(_0x4599){if(_0x4599){var _0x52aa0a=typeof _0xb44d98[_0x908e('0x16')]===_0x908e('0x17')&&typeof _0xb44d98[_0x908e('0x18')]===_0x908e('0x17');var _0x48140b=_0x4599['count'];var _0x55e3a9=_0x52aa0a?0x0:_0xb44d98['offset'];var _0x119de3=_0x52aa0a?_0x4599[_0x908e('0x19')]:_0xb44d98[_0x908e('0x16')]+_0xb44d98[_0x908e('0x18')];var _0x1a73c5;if(_0x119de3>=_0x48140b){_0x119de3=_0x48140b;_0x1a73c5=0xc8;}else{_0x1a73c5=0xce;}_0x478522[_0x908e('0x13')](_0x1a73c5);return _0x478522['set'](_0x908e('0x1a'),_0x55e3a9+'-'+_0x119de3+'/'+_0x48140b)[_0x908e('0x15')](_0x4599);}return null;};}function patchUpdates(_0x5ec4b0){return function(_0x2a983b){try{jsonpatch[_0x908e('0x1b')](_0x2a983b,_0x5ec4b0,!![]);}catch(_0x33d4d1){return BPromise[_0x908e('0x1c')](_0x33d4d1);}return _0x2a983b[_0x908e('0x1d')]();};}function saveUpdates(_0x26f8f3,_0x36a285){return function(_0x3da641){if(_0x3da641){return _0x3da641[_0x908e('0x1e')](_0x26f8f3)[_0x908e('0x1f')](function(_0x2a3791){return _0x2a3791;});}return null;};}function removeEntity(_0x2186ac,_0x3958c5){return function(_0x789892){if(_0x789892){return _0x789892[_0x908e('0x20')]()['then'](function(){_0x2186ac[_0x908e('0x13')](0xcc)[_0x908e('0x14')]();});}};}function handleEntityNotFound(_0x32a4e2,_0x3b476e){return function(_0x35a0f1){if(!_0x35a0f1){_0x32a4e2[_0x908e('0x21')](0x194);}return _0x35a0f1;};}function handleError(_0x45d447,_0x1af3c6){_0x1af3c6=_0x1af3c6||0x1f4;return function(_0x159353){logger['error'](_0x159353[_0x908e('0x22')]);if(_0x159353['name']){delete _0x159353['name'];}_0x45d447['status'](_0x1af3c6)[_0x908e('0x23')](_0x159353);};}exports[_0x908e('0x24')]=function(_0x85adff,_0x162912){var _0x32698b={},_0x565584={},_0x1c8a6a={'count':0x0,'rows':[]};var _0x3c74e6=_[_0x908e('0x25')](db[_0x908e('0x26')]['rawAttributes'],function(_0x2af293){return{'name':_0x2af293['fieldName'],'type':_0x2af293[_0x908e('0x27')]['key']};});_0x565584[_0x908e('0x28')]=_['map'](_0x3c74e6,'name');_0x565584[_0x908e('0x29')]=_[_0x908e('0x2a')](_0x85adff[_0x908e('0x29')]);_0x565584['filters']=_[_0x908e('0x2b')](_0x565584[_0x908e('0x28')],_0x565584['query']);_0x32698b[_0x908e('0x2c')]=_[_0x908e('0x2b')](_0x565584[_0x908e('0x28')],qs['fields'](_0x85adff['query']['fields']));_0x32698b[_0x908e('0x2c')]=_0x32698b[_0x908e('0x2c')]['length']?_0x32698b['attributes']:_0x565584[_0x908e('0x28')];if(!_0x85adff[_0x908e('0x29')]['hasOwnProperty'](_0x908e('0x2d'))){_0x32698b[_0x908e('0x18')]=qs['limit'](_0x85adff[_0x908e('0x29')][_0x908e('0x18')]);_0x32698b['offset']=qs['offset'](_0x85adff[_0x908e('0x29')][_0x908e('0x16')]);}_0x32698b['order']=qs[_0x908e('0x2e')](_0x85adff[_0x908e('0x29')][_0x908e('0x2e')]);_0x32698b[_0x908e('0x2f')]=qs[_0x908e('0x30')](_[_0x908e('0x31')](_0x85adff[_0x908e('0x29')],_0x565584['filters']),_0x3c74e6);if(_0x85adff[_0x908e('0x29')][_0x908e('0x32')]){_0x32698b[_0x908e('0x2f')]=_[_0x908e('0x33')](_0x32698b[_0x908e('0x2f')],{'$or':_[_0x908e('0x25')](_0x3c74e6,function(_0x24ccd9){if(_0x24ccd9['type']!=='VIRTUAL'){var _0x29ed26={};_0x29ed26[_0x24ccd9[_0x908e('0x34')]]={'$like':'%'+_0x85adff[_0x908e('0x29')][_0x908e('0x32')]+'%'};return _0x29ed26;}})});}_0x32698b=_[_0x908e('0x33')]({},_0x32698b,_0x85adff[_0x908e('0x35')]);var _0x33c85f={'where':_0x32698b[_0x908e('0x2f')]};return db['SquareReport'][_0x908e('0x19')](_0x33c85f)[_0x908e('0x1f')](function(_0x316a4e){_0x1c8a6a[_0x908e('0x19')]=_0x316a4e;if(_0x85adff[_0x908e('0x29')]['includeAll']){_0x32698b['include']=[{'all':!![]}];}return db[_0x908e('0x26')][_0x908e('0x36')](_0x32698b);})['then'](function(_0x50f5c4){_0x1c8a6a[_0x908e('0x37')]=_0x50f5c4;return _0x1c8a6a;})['then'](respondWithFilteredResult(_0x162912,_0x32698b))['catch'](handleError(_0x162912,null));};exports[_0x908e('0x38')]=function(_0x530a95,_0x532ec8){var _0x1326d2={'raw':!![],'where':{'id':_0x530a95[_0x908e('0x39')]['id']}},_0x504ae3={};_0x504ae3[_0x908e('0x28')]=_[_0x908e('0x2a')](db[_0x908e('0x26')][_0x908e('0x3a')]);_0x504ae3[_0x908e('0x29')]=_[_0x908e('0x2a')](_0x530a95[_0x908e('0x29')]);_0x504ae3[_0x908e('0x30')]=_[_0x908e('0x2b')](_0x504ae3[_0x908e('0x28')],_0x504ae3[_0x908e('0x29')]);_0x1326d2[_0x908e('0x2c')]=_[_0x908e('0x2b')](_0x504ae3[_0x908e('0x28')],qs[_0x908e('0x3b')](_0x530a95[_0x908e('0x29')][_0x908e('0x3b')]));_0x1326d2[_0x908e('0x2c')]=_0x1326d2[_0x908e('0x2c')][_0x908e('0x3c')]?_0x1326d2[_0x908e('0x2c')]:_0x504ae3[_0x908e('0x28')];if(_0x530a95[_0x908e('0x29')][_0x908e('0x3d')]){_0x1326d2[_0x908e('0x3e')]=[{'all':!![]}];}_0x1326d2=_[_0x908e('0x33')]({},_0x1326d2,_0x530a95[_0x908e('0x35')]);return db['SquareReport'][_0x908e('0x3f')](_0x1326d2)[_0x908e('0x1f')](handleEntityNotFound(_0x532ec8,null))['then'](respondWithResult(_0x532ec8,null))['catch'](handleError(_0x532ec8,null));};exports[_0x908e('0x40')]=function(_0x4885b6,_0x2610eb){return db[_0x908e('0x26')]['create'](_0x4885b6[_0x908e('0x41')],{})[_0x908e('0x1f')](respondWithResult(_0x2610eb,0xc9))[_0x908e('0x42')](handleError(_0x2610eb,null));};exports['update']=function(_0x33d4cf,_0x5d4c18){if(_0x33d4cf[_0x908e('0x41')]['id']){delete _0x33d4cf[_0x908e('0x41')]['id'];}return db[_0x908e('0x26')]['find']({'where':{'id':_0x33d4cf[_0x908e('0x39')]['id']}})[_0x908e('0x1f')](handleEntityNotFound(_0x5d4c18,null))[_0x908e('0x1f')](saveUpdates(_0x33d4cf[_0x908e('0x41')],null))[_0x908e('0x1f')](respondWithResult(_0x5d4c18,null))[_0x908e('0x42')](handleError(_0x5d4c18,null));};exports[_0x908e('0x20')]=function(_0xdc12ab,_0xcefb09){return db[_0x908e('0x26')][_0x908e('0x3f')]({'where':{'id':_0xdc12ab[_0x908e('0x39')]['id']}})['then'](handleEntityNotFound(_0xcefb09,null))[_0x908e('0x1f')](removeEntity(_0xcefb09,null))['catch'](handleError(_0xcefb09,null));};exports[_0x908e('0x43')]=function(_0x3edc29,_0xb8d129){return db[_0x908e('0x26')]['describe']()[_0x908e('0x1f')](respondWithResult(_0xb8d129,null))[_0x908e('0x42')](handleError(_0xb8d129,null));}; \ No newline at end of file +var _0x186a=['papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','Content-Range','apply','reject','then','destroy','error','stack','name','index','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareReport','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x36782c,_0x38c321){var _0xd4e417=function(_0x105817){while(--_0x105817){_0x36782c['push'](_0x36782c['shift']());}};_0xd4e417(++_0x38c321);}(_0x186a,0x168));var _0xa186=function(_0x274f14,_0x27dd7f){_0x274f14=_0x274f14-0x0;var _0x13b97e=_0x186a[_0x274f14];return _0x13b97e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa186('0x0'));var zipdir=require(_0xa186('0x1'));var jsonpatch=require(_0xa186('0x2'));var rp=require(_0xa186('0x3'));var moment=require(_0xa186('0x4'));var BPromise=require(_0xa186('0x5'));var Mustache=require(_0xa186('0x6'));var util=require(_0xa186('0x7'));var path=require(_0xa186('0x8'));var sox=require(_0xa186('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa186('0xa'));var _=require('lodash');var squel=require(_0xa186('0xb'));var crypto=require(_0xa186('0xc'));var jsforce=require(_0xa186('0xd'));var deskjs=require(_0xa186('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa186('0xf'));var Redis=require(_0xa186('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa186('0x11'));var hardwareService=require(_0xa186('0x12'));var logger=require(_0xa186('0x13'))(_0xa186('0x14'));var utils=require(_0xa186('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa186('0x16'));var db=require(_0xa186('0x17'))['db'];function respondWithStatusCode(_0x151fe3,_0x450d0b){_0x450d0b=_0x450d0b||0xcc;return function(_0x455f0a){if(_0x455f0a){return _0x151fe3[_0xa186('0x18')](_0x450d0b);}return _0x151fe3[_0xa186('0x19')](_0x450d0b)[_0xa186('0x1a')]();};}function respondWithResult(_0x2823f0,_0x2c51fd){_0x2c51fd=_0x2c51fd||0xc8;return function(_0x446e3d){if(_0x446e3d){return _0x2823f0[_0xa186('0x19')](_0x2c51fd)[_0xa186('0x1b')](_0x446e3d);}};}function respondWithFilteredResult(_0xf43335,_0xa0f5d2){return function(_0x812ea9){if(_0x812ea9){var _0x50474b=typeof _0xa0f5d2['offset']==='undefined'&&typeof _0xa0f5d2[_0xa186('0x1c')]==='undefined';var _0x52de78=_0x812ea9[_0xa186('0x1d')];var _0x31ae63=_0x50474b?0x0:_0xa0f5d2['offset'];var _0x26f01f=_0x50474b?_0x812ea9['count']:_0xa0f5d2['offset']+_0xa0f5d2[_0xa186('0x1c')];var _0x56bdf4;if(_0x26f01f>=_0x52de78){_0x26f01f=_0x52de78;_0x56bdf4=0xc8;}else{_0x56bdf4=0xce;}_0xf43335[_0xa186('0x19')](_0x56bdf4);return _0xf43335['set'](_0xa186('0x1e'),_0x31ae63+'-'+_0x26f01f+'/'+_0x52de78)[_0xa186('0x1b')](_0x812ea9);}return null;};}function patchUpdates(_0x131a21){return function(_0x5899f7){try{jsonpatch[_0xa186('0x1f')](_0x5899f7,_0x131a21,!![]);}catch(_0x6acfe7){return BPromise[_0xa186('0x20')](_0x6acfe7);}return _0x5899f7['save']();};}function saveUpdates(_0x146e75,_0x49a014){return function(_0x3e1295){if(_0x3e1295){return _0x3e1295['update'](_0x146e75)[_0xa186('0x21')](function(_0x5ec650){return _0x5ec650;});}return null;};}function removeEntity(_0x71030b,_0x397141){return function(_0x766c9f){if(_0x766c9f){return _0x766c9f[_0xa186('0x22')]()[_0xa186('0x21')](function(){_0x71030b[_0xa186('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3eb4c6,_0x4a4446){return function(_0x50ef14){if(!_0x50ef14){_0x3eb4c6['sendStatus'](0x194);}return _0x50ef14;};}function handleError(_0x4a3941,_0x2703c5){_0x2703c5=_0x2703c5||0x1f4;return function(_0x2adb55){logger[_0xa186('0x23')](_0x2adb55[_0xa186('0x24')]);if(_0x2adb55[_0xa186('0x25')]){delete _0x2adb55['name'];}_0x4a3941[_0xa186('0x19')](_0x2703c5)['send'](_0x2adb55);};}exports[_0xa186('0x26')]=function(_0x576b66,_0x2331a1){var _0x5398b8={},_0x1c54e2={},_0x565083={'count':0x0,'rows':[]};var _0x6c9458=_['map'](db['SquareReport']['rawAttributes'],function(_0x58c123){return{'name':_0x58c123[_0xa186('0x27')],'type':_0x58c123[_0xa186('0x28')][_0xa186('0x29')]};});_0x1c54e2['model']=_['map'](_0x6c9458,_0xa186('0x25'));_0x1c54e2[_0xa186('0x2a')]=_[_0xa186('0x2b')](_0x576b66[_0xa186('0x2a')]);_0x1c54e2[_0xa186('0x2c')]=_[_0xa186('0x2d')](_0x1c54e2[_0xa186('0x2e')],_0x1c54e2[_0xa186('0x2a')]);_0x5398b8['attributes']=_[_0xa186('0x2d')](_0x1c54e2['model'],qs[_0xa186('0x2f')](_0x576b66[_0xa186('0x2a')]['fields']));_0x5398b8[_0xa186('0x30')]=_0x5398b8[_0xa186('0x30')][_0xa186('0x31')]?_0x5398b8['attributes']:_0x1c54e2[_0xa186('0x2e')];if(!_0x576b66[_0xa186('0x2a')][_0xa186('0x32')](_0xa186('0x33'))){_0x5398b8[_0xa186('0x1c')]=qs[_0xa186('0x1c')](_0x576b66['query']['limit']);_0x5398b8[_0xa186('0x34')]=qs['offset'](_0x576b66[_0xa186('0x2a')][_0xa186('0x34')]);}_0x5398b8[_0xa186('0x35')]=qs[_0xa186('0x36')](_0x576b66[_0xa186('0x2a')]['sort']);_0x5398b8[_0xa186('0x37')]=qs['filters'](_[_0xa186('0x38')](_0x576b66[_0xa186('0x2a')],_0x1c54e2['filters']),_0x6c9458);if(_0x576b66[_0xa186('0x2a')][_0xa186('0x39')]){_0x5398b8[_0xa186('0x37')]=_[_0xa186('0x3a')](_0x5398b8['where'],{'$or':_['map'](_0x6c9458,function(_0x58a7e9){if(_0x58a7e9[_0xa186('0x28')]!==_0xa186('0x3b')){var _0x1e7898={};_0x1e7898[_0x58a7e9[_0xa186('0x25')]]={'$like':'%'+_0x576b66['query'][_0xa186('0x39')]+'%'};return _0x1e7898;}})});}_0x5398b8=_[_0xa186('0x3a')]({},_0x5398b8,_0x576b66[_0xa186('0x3c')]);var _0x324bee={'where':_0x5398b8[_0xa186('0x37')]};return db[_0xa186('0x3d')]['count'](_0x324bee)[_0xa186('0x21')](function(_0x13f3a4){_0x565083['count']=_0x13f3a4;if(_0x576b66[_0xa186('0x2a')][_0xa186('0x3e')]){_0x5398b8[_0xa186('0x3f')]=[{'all':!![]}];}return db[_0xa186('0x3d')][_0xa186('0x40')](_0x5398b8);})[_0xa186('0x21')](function(_0x4f0e12){_0x565083[_0xa186('0x41')]=_0x4f0e12;return _0x565083;})[_0xa186('0x21')](respondWithFilteredResult(_0x2331a1,_0x5398b8))['catch'](handleError(_0x2331a1,null));};exports[_0xa186('0x42')]=function(_0xf9b140,_0x349280){var _0x597c9d={'raw':!![],'where':{'id':_0xf9b140[_0xa186('0x43')]['id']}},_0x39c8eb={};_0x39c8eb[_0xa186('0x2e')]=_[_0xa186('0x2b')](db['SquareReport'][_0xa186('0x44')]);_0x39c8eb[_0xa186('0x2a')]=_['keys'](_0xf9b140[_0xa186('0x2a')]);_0x39c8eb[_0xa186('0x2c')]=_['intersection'](_0x39c8eb['model'],_0x39c8eb[_0xa186('0x2a')]);_0x597c9d['attributes']=_[_0xa186('0x2d')](_0x39c8eb['model'],qs['fields'](_0xf9b140['query'][_0xa186('0x2f')]));_0x597c9d['attributes']=_0x597c9d[_0xa186('0x30')][_0xa186('0x31')]?_0x597c9d[_0xa186('0x30')]:_0x39c8eb[_0xa186('0x2e')];if(_0xf9b140[_0xa186('0x2a')]['includeAll']){_0x597c9d['include']=[{'all':!![]}];}_0x597c9d=_[_0xa186('0x3a')]({},_0x597c9d,_0xf9b140['options']);return db['SquareReport'][_0xa186('0x45')](_0x597c9d)[_0xa186('0x21')](handleEntityNotFound(_0x349280,null))[_0xa186('0x21')](respondWithResult(_0x349280,null))[_0xa186('0x46')](handleError(_0x349280,null));};exports[_0xa186('0x47')]=function(_0x22c62a,_0x2c2b6f){return db[_0xa186('0x3d')]['create'](_0x22c62a[_0xa186('0x48')],{})[_0xa186('0x21')](respondWithResult(_0x2c2b6f,0xc9))['catch'](handleError(_0x2c2b6f,null));};exports[_0xa186('0x49')]=function(_0x5b7f88,_0x4d636b){if(_0x5b7f88['body']['id']){delete _0x5b7f88[_0xa186('0x48')]['id'];}return db['SquareReport'][_0xa186('0x45')]({'where':{'id':_0x5b7f88[_0xa186('0x43')]['id']}})[_0xa186('0x21')](handleEntityNotFound(_0x4d636b,null))[_0xa186('0x21')](saveUpdates(_0x5b7f88[_0xa186('0x48')],null))['then'](respondWithResult(_0x4d636b,null))[_0xa186('0x46')](handleError(_0x4d636b,null));};exports[_0xa186('0x22')]=function(_0x15a915,_0x19e532){return db['SquareReport'][_0xa186('0x45')]({'where':{'id':_0x15a915[_0xa186('0x43')]['id']}})[_0xa186('0x21')](handleEntityNotFound(_0x19e532,null))[_0xa186('0x21')](removeEntity(_0x19e532,null))[_0xa186('0x46')](handleError(_0x19e532,null));};exports['describe']=function(_0x2a0ad1,_0x47d4b9){return db[_0xa186('0x3d')][_0xa186('0x4a')]()[_0xa186('0x21')](respondWithResult(_0x47d4b9,null))['catch'](handleError(_0x47d4b9,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 65247aa..1c90a03 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 _0xe55a=['SquareReport','report_square','uid_pname','project_name','leaveAt','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareReport.attributes','exports','define'];(function(_0x41a596,_0x9963c){var _0x48cad1=function(_0x48736e){while(--_0x48736e){_0x41a596['push'](_0x41a596['shift']());}};_0x48cad1(++_0x9963c);}(_0xe55a,0x17c));var _0xae55=function(_0x1845e0,_0x312b1c){_0x1845e0=_0x1845e0-0x0;var _0x47f865=_0xe55a[_0x1845e0];return _0x47f865;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xae55('0x0'))(_0xae55('0x1'));var moment=require(_0xae55('0x2'));var BPromise=require(_0xae55('0x3'));var rp=require(_0xae55('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae55('0x5'));var config=require(_0xae55('0x6'));var attributes=require(_0xae55('0x7'));module[_0xae55('0x8')]=function(_0x3787a7,_0x14b71d){return _0x3787a7[_0xae55('0x9')](_0xae55('0xa'),attributes,{'tableName':_0xae55('0xb'),'paranoid':![],'indexes':[{'name':_0xae55('0xc'),'fields':['uniqueid',_0xae55('0xd')]},{'name':_0xae55('0xe'),'fields':[_0xae55('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf3af=['api','moment','bluebird','rimraf','exports','SquareReport','report_square','uid_pname','project_name','leaveAt','lodash','util'];(function(_0x24868b,_0x12284f){var _0x13cb8e=function(_0x3cecfb){while(--_0x3cecfb){_0x24868b['push'](_0x24868b['shift']());}};_0x13cb8e(++_0x12284f);}(_0xf3af,0x9a));var _0xff3a=function(_0x5bbe7e,_0x19c08f){_0x5bbe7e=_0x5bbe7e-0x0;var _0x6ebda1=_0xf3af[_0x5bbe7e];return _0x6ebda1;};'use strict';var _=require(_0xff3a('0x0'));var util=require(_0xff3a('0x1'));var logger=require('../../config/logger')(_0xff3a('0x2'));var moment=require(_0xff3a('0x3'));var BPromise=require(_0xff3a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xff3a('0x5'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0xff3a('0x6')]=function(_0x52e397,_0x253352){return _0x52e397['define'](_0xff3a('0x7'),attributes,{'tableName':_0xff3a('0x8'),'paranoid':![],'indexes':[{'name':_0xff3a('0x9'),'fields':['uniqueid',_0xff3a('0xa')]},{'name':_0xff3a('0xb'),'fields':[_0xff3a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 4803ad3..5d1a6f2 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 _0x4a5a=['client','http','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','CreateSquareReport','SquareReport','create','body','options','raw','then','update','where','UpdateSquareReport','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x19c681,_0x1bf861){var _0x1dc79d=function(_0x5cb5a9){while(--_0x5cb5a9){_0x19c681['push'](_0x19c681['shift']());}};_0x1dc79d(++_0x1bf861);}(_0x4a5a,0x124));var _0xa4a5=function(_0x4172e8,_0x324975){_0x4172e8=_0x4172e8-0x0;var _0x235ee2=_0x4a5a[_0x4172e8];return _0x235ee2;};'use strict';var _=require(_0xa4a5('0x0'));var util=require(_0xa4a5('0x1'));var moment=require('moment');var BPromise=require(_0xa4a5('0x2'));var rs=require(_0xa4a5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa4a5('0x4'));var logger=require('../../config/logger')(_0xa4a5('0x5'));var config=require(_0xa4a5('0x6'));var jayson=require(_0xa4a5('0x7'));var client=jayson[_0xa4a5('0x8')][_0xa4a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39589a,_0x1c36ac,_0x24e0a7){return new BPromise(function(_0x5d1d76,_0x3780a0){return client['request'](_0x39589a,_0x24e0a7)['then'](function(_0x449a04){logger['info'](_0xa4a5('0xa'),_0x1c36ac,'request\x20sent');logger[_0xa4a5('0xb')](_0xa4a5('0xc'),_0x1c36ac,_0xa4a5('0xd'),JSON[_0xa4a5('0xe')](_0x449a04));if(_0x449a04['error']){if(_0x449a04[_0xa4a5('0xf')][_0xa4a5('0x10')]===0x1f4){logger[_0xa4a5('0xf')](_0xa4a5('0xa'),_0x1c36ac,_0x449a04['error'][_0xa4a5('0x11')]);return _0x3780a0(_0x449a04['error'][_0xa4a5('0x11')]);}logger[_0xa4a5('0xf')](_0xa4a5('0xa'),_0x1c36ac,_0x449a04[_0xa4a5('0xf')][_0xa4a5('0x11')]);return _0x5d1d76(_0x449a04[_0xa4a5('0xf')][_0xa4a5('0x11')]);}else{logger[_0xa4a5('0x12')](_0xa4a5('0xa'),_0x1c36ac,_0xa4a5('0xd'));_0x5d1d76(_0x449a04['result'][_0xa4a5('0x11')]);}})[_0xa4a5('0x13')](function(_0x4a66aa){logger[_0xa4a5('0xf')](_0xa4a5('0xa'),_0x1c36ac,_0x4a66aa);_0x3780a0(_0x4a66aa);});});}exports[_0xa4a5('0x14')]=function(_0x3fa9d9){var _0x5191be=this;return new Promise(function(_0x675842,_0x31c5b2){return db[_0xa4a5('0x15')][_0xa4a5('0x16')](_0x3fa9d9[_0xa4a5('0x17')],{'raw':_0x3fa9d9[_0xa4a5('0x18')]?_0x3fa9d9[_0xa4a5('0x18')][_0xa4a5('0x19')]===undefined?!![]:![]:!![]})[_0xa4a5('0x1a')](function(_0x3f5ef8){logger[_0xa4a5('0x12')](_0xa4a5('0x14'),_0x3fa9d9);logger['debug'](_0xa4a5('0x14'),_0x3fa9d9,JSON[_0xa4a5('0xe')](_0x3f5ef8));_0x675842(_0x3f5ef8);})[_0xa4a5('0x13')](function(_0x3e655c){logger['error'](_0xa4a5('0x14'),_0x3e655c[_0xa4a5('0x11')],_0x3fa9d9);_0x31c5b2(_0x5191be[_0xa4a5('0xf')](0x1f4,_0x3e655c[_0xa4a5('0x11')]));});});};exports['UpdateSquareReport']=function(_0x2f1029){var _0x4fb947=this;return new Promise(function(_0x348406,_0x224661){return db[_0xa4a5('0x15')][_0xa4a5('0x1b')](_0x2f1029[_0xa4a5('0x17')],{'raw':_0x2f1029[_0xa4a5('0x18')]?_0x2f1029['options'][_0xa4a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f1029[_0xa4a5('0x18')]?_0x2f1029[_0xa4a5('0x18')][_0xa4a5('0x1c')]||null:null,'attributes':_0x2f1029['options']?_0x2f1029['options']['attributes']||null:null,'limit':_0x2f1029[_0xa4a5('0x18')]?_0x2f1029[_0xa4a5('0x18')]['limit']||null:null})[_0xa4a5('0x1a')](function(_0x3cef88){logger['info'](_0xa4a5('0x1d'),_0x2f1029);logger[_0xa4a5('0xb')](_0xa4a5('0x1d'),_0x2f1029,JSON[_0xa4a5('0xe')](_0x3cef88));_0x348406(_0x3cef88);})[_0xa4a5('0x13')](function(_0x24c249){logger[_0xa4a5('0xf')]('UpdateSquareReport',_0x24c249[_0xa4a5('0x11')],_0x2f1029);_0x224661(_0x4fb947[_0xa4a5('0xf')](0x1f4,_0x24c249[_0xa4a5('0x11')]));});});}; \ No newline at end of file +var _0x9b6c=['create','options','raw','debug','UpdateSquareReport','update','body','where','attributes','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','info','result','catch','CreateSquareReport','SquareReport'];(function(_0x42fd0b,_0x62bc3){var _0x1bb0bd=function(_0x45e402){while(--_0x45e402){_0x42fd0b['push'](_0x42fd0b['shift']());}};_0x1bb0bd(++_0x62bc3);}(_0x9b6c,0x1e6));var _0xc9b6=function(_0x3335a0,_0x167419){_0x3335a0=_0x3335a0-0x0;var _0x2d44fe=_0x9b6c[_0x3335a0];return _0x2d44fe;};'use strict';var _=require(_0xc9b6('0x0'));var util=require('util');var moment=require(_0xc9b6('0x1'));var BPromise=require(_0xc9b6('0x2'));var rs=require(_0xc9b6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc9b6('0x4'))['db'];var utils=require(_0xc9b6('0x5'));var logger=require(_0xc9b6('0x6'))(_0xc9b6('0x7'));var config=require('../../config/environment');var jayson=require(_0xc9b6('0x8'));var client=jayson['client'][_0xc9b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c3e26,_0xaaf8d0,_0x5c447b){return new BPromise(function(_0x2de0c7,_0x45ea11){return client[_0xc9b6('0xa')](_0x4c3e26,_0x5c447b)[_0xc9b6('0xb')](function(_0x1c41ad){logger['info']('SquareReport,\x20%s,\x20%s',_0xaaf8d0,_0xc9b6('0xc'));logger['debug'](_0xc9b6('0xd'),_0xaaf8d0,_0xc9b6('0xc'),JSON[_0xc9b6('0xe')](_0x1c41ad));if(_0x1c41ad[_0xc9b6('0xf')]){if(_0x1c41ad['error'][_0xc9b6('0x10')]===0x1f4){logger[_0xc9b6('0xf')](_0xc9b6('0x11'),_0xaaf8d0,_0x1c41ad[_0xc9b6('0xf')][_0xc9b6('0x12')]);return _0x45ea11(_0x1c41ad[_0xc9b6('0xf')][_0xc9b6('0x12')]);}logger[_0xc9b6('0xf')](_0xc9b6('0x11'),_0xaaf8d0,_0x1c41ad[_0xc9b6('0xf')]['message']);return _0x2de0c7(_0x1c41ad[_0xc9b6('0xf')]['message']);}else{logger[_0xc9b6('0x13')](_0xc9b6('0x11'),_0xaaf8d0,'request\x20sent');_0x2de0c7(_0x1c41ad[_0xc9b6('0x14')][_0xc9b6('0x12')]);}})[_0xc9b6('0x15')](function(_0x41bab9){logger[_0xc9b6('0xf')](_0xc9b6('0x11'),_0xaaf8d0,_0x41bab9);_0x45ea11(_0x41bab9);});});}exports[_0xc9b6('0x16')]=function(_0x56d734){var _0x1ef399=this;return new Promise(function(_0x114867,_0x3a04c9){return db[_0xc9b6('0x17')][_0xc9b6('0x18')](_0x56d734['body'],{'raw':_0x56d734['options']?_0x56d734[_0xc9b6('0x19')][_0xc9b6('0x1a')]===undefined?!![]:![]:!![]})[_0xc9b6('0xb')](function(_0x3b2181){logger['info']('CreateSquareReport',_0x56d734);logger[_0xc9b6('0x1b')]('CreateSquareReport',_0x56d734,JSON[_0xc9b6('0xe')](_0x3b2181));_0x114867(_0x3b2181);})[_0xc9b6('0x15')](function(_0x37da37){logger['error'](_0xc9b6('0x16'),_0x37da37[_0xc9b6('0x12')],_0x56d734);_0x3a04c9(_0x1ef399['error'](0x1f4,_0x37da37['message']));});});};exports[_0xc9b6('0x1c')]=function(_0x53b556){var _0x2fd650=this;return new Promise(function(_0xd17788,_0x33d2df){return db[_0xc9b6('0x17')][_0xc9b6('0x1d')](_0x53b556[_0xc9b6('0x1e')],{'raw':_0x53b556[_0xc9b6('0x19')]?_0x53b556[_0xc9b6('0x19')][_0xc9b6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53b556[_0xc9b6('0x19')]?_0x53b556['options'][_0xc9b6('0x1f')]||null:null,'attributes':_0x53b556[_0xc9b6('0x19')]?_0x53b556[_0xc9b6('0x19')][_0xc9b6('0x20')]||null:null,'limit':_0x53b556[_0xc9b6('0x19')]?_0x53b556[_0xc9b6('0x19')][_0xc9b6('0x21')]||null:null})['then'](function(_0x4c8e29){logger['info'](_0xc9b6('0x1c'),_0x53b556);logger[_0xc9b6('0x1b')]('UpdateSquareReport',_0x53b556,JSON[_0xc9b6('0xe')](_0x4c8e29));_0xd17788(_0x4c8e29);})[_0xc9b6('0x15')](function(_0x10898a){logger[_0xc9b6('0xf')](_0xc9b6('0x1c'),_0x10898a[_0xc9b6('0x12')],_0x53b556);_0x33d2df(_0x2fd650[_0xc9b6('0xf')](0x1f4,_0x10898a['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index c12a073..2f752e2 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 _0xc2b3=['isAuthenticated','index','/describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x3f02cc,_0x3e1a00){var _0x48f4a2=function(_0x5b8806){while(--_0x5b8806){_0x3f02cc['push'](_0x3f02cc['shift']());}};_0x48f4a2(++_0x3e1a00);}(_0xc2b3,0xfb));var _0x3c2b=function(_0x3ef57b,_0xcff8e0){_0x3ef57b=_0x3ef57b-0x0;var _0x1082be=_0xc2b3[_0x3ef57b];return _0x1082be;};'use strict';var multer=require(_0x3c2b('0x0'));var util=require(_0x3c2b('0x1'));var path=require('path');var timeout=require(_0x3c2b('0x2'));var express=require(_0x3c2b('0x3'));var router=express['Router']();var fs_extra=require(_0x3c2b('0x4'));var auth=require(_0x3c2b('0x5'));var interaction=require(_0x3c2b('0x6'));var config=require(_0x3c2b('0x7'));var controller=require('./squareReportDetail.controller');router[_0x3c2b('0x8')]('/',auth[_0x3c2b('0x9')](),controller[_0x3c2b('0xa')]);router[_0x3c2b('0x8')](_0x3c2b('0xb'),auth[_0x3c2b('0x9')](),controller['describe']);router[_0x3c2b('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3c2b('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3c2b('0xd')]);router[_0x3c2b('0xe')](_0x3c2b('0xf'),auth[_0x3c2b('0x9')](),controller[_0x3c2b('0x10')]);router[_0x3c2b('0x11')](_0x3c2b('0xf'),auth['isAuthenticated'](),controller[_0x3c2b('0x12')]);module[_0x3c2b('0x13')]=router; \ No newline at end of file +var _0x34bc=['show','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x303f6a,_0xe67b05){var _0x5cfcb1=function(_0x335a02){while(--_0x335a02){_0x303f6a['push'](_0x303f6a['shift']());}};_0x5cfcb1(++_0xe67b05);}(_0x34bc,0x10c));var _0xc34b=function(_0x11154a,_0x583ade){_0x11154a=_0x11154a-0x0;var _0x2b6d88=_0x34bc[_0x11154a];return _0x2b6d88;};'use strict';var multer=require(_0xc34b('0x0'));var util=require('util');var path=require(_0xc34b('0x1'));var timeout=require('connect-timeout');var express=require(_0xc34b('0x2'));var router=express[_0xc34b('0x3')]();var fs_extra=require(_0xc34b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc34b('0x5'));var controller=require(_0xc34b('0x6'));router[_0xc34b('0x7')]('/',auth[_0xc34b('0x8')](),controller[_0xc34b('0x9')]);router['get']('/describe',auth[_0xc34b('0x8')](),controller[_0xc34b('0xa')]);router['get'](_0xc34b('0xb'),auth['isAuthenticated'](),controller[_0xc34b('0xc')]);router[_0xc34b('0xd')]('/',auth['isAuthenticated'](),controller[_0xc34b('0xe')]);router[_0xc34b('0xf')](_0xc34b('0xb'),auth[_0xc34b('0x8')](),controller[_0xc34b('0x10')]);router[_0xc34b('0x11')]('/:id',auth[_0xc34b('0x8')](),controller[_0xc34b('0x12')]);module[_0xc34b('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 2d16896..c0ee58e 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 _0xc1fa=['sequelize','exports','STRING'];(function(_0xd01702,_0x3d0e9f){var _0x524ce9=function(_0x28c216){while(--_0x28c216){_0xd01702['push'](_0xd01702['shift']());}};_0x524ce9(++_0x3d0e9f);}(_0xc1fa,0xff));var _0xac1f=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0xc1fa[_0x295a3d];return _0x23a732;};'use strict';var Sequelize=require(_0xac1f('0x0'));module[_0xac1f('0x1')]={'uniqueid':{'type':Sequelize[_0xac1f('0x2')]},'node':{'type':Sequelize[_0xac1f('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xac1f('0x2')]}}; \ No newline at end of file +var _0x1bc9=['TEXT','sequelize','STRING'];(function(_0x2f25aa,_0x3af6d1){var _0x2a99a2=function(_0x13d179){while(--_0x13d179){_0x2f25aa['push'](_0x2f25aa['shift']());}};_0x2a99a2(++_0x3af6d1);}(_0x1bc9,0x1c3));var _0x91bc=function(_0x335dda,_0x572399){_0x335dda=_0x335dda-0x0;var _0x3a2c49=_0x1bc9[_0x335dda];return _0x3a2c49;};'use strict';var Sequelize=require(_0x91bc('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x91bc('0x1')]},'node':{'type':Sequelize[_0x91bc('0x1')]},'application':{'type':Sequelize[_0x91bc('0x1')]},'data':{'type':Sequelize[_0x91bc('0x2')]},'project_name':{'type':Sequelize[_0x91bc('0x1')]},'callerid':{'type':Sequelize[_0x91bc('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index c8ca036..ce55def 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 _0x253f=['../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','SquareDetailsReport','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filters','filter','where','merge','options','catch','params','rawAttributes','length','include','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','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'];(function(_0x2c87fb,_0x90a04a){var _0x389a4a=function(_0x123d09){while(--_0x123d09){_0x2c87fb['push'](_0x2c87fb['shift']());}};_0x389a4a(++_0x90a04a);}(_0x253f,0x1d9));var _0xf253=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x253f[_0x2aec52];return _0x3b8835;};'use strict';var emlformat=require(_0xf253('0x0'));var rimraf=require(_0xf253('0x1'));var zipdir=require(_0xf253('0x2'));var jsonpatch=require(_0xf253('0x3'));var rp=require(_0xf253('0x4'));var moment=require('moment');var BPromise=require(_0xf253('0x5'));var Mustache=require(_0xf253('0x6'));var util=require(_0xf253('0x7'));var path=require(_0xf253('0x8'));var sox=require('sox');var csv=require(_0xf253('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf253('0xa'));var squel=require('squel');var crypto=require(_0xf253('0xb'));var jsforce=require(_0xf253('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf253('0x9'));var querystring=require('querystring');var Papa=require(_0xf253('0xd'));var Redis=require(_0xf253('0xe'));var authService=require(_0xf253('0xf'));var qs=require(_0xf253('0x10'));var as=require(_0xf253('0x11'));var hardwareService=require(_0xf253('0x12'));var logger=require(_0xf253('0x13'))(_0xf253('0x14'));var utils=require(_0xf253('0x15'));var config=require(_0xf253('0x16'));var licenseUtil=require(_0xf253('0x17'));var db=require(_0xf253('0x18'))['db'];function respondWithStatusCode(_0x4ed739,_0x4dbb71){_0x4dbb71=_0x4dbb71||0xcc;return function(_0x356ca4){if(_0x356ca4){return _0x4ed739[_0xf253('0x19')](_0x4dbb71);}return _0x4ed739[_0xf253('0x1a')](_0x4dbb71)['end']();};}function respondWithResult(_0x444c09,_0x454081){_0x454081=_0x454081||0xc8;return function(_0x497431){if(_0x497431){return _0x444c09[_0xf253('0x1a')](_0x454081)[_0xf253('0x1b')](_0x497431);}};}function respondWithFilteredResult(_0x5823da,_0x4f233d){return function(_0xc065fb){if(_0xc065fb){var _0x3752b8=typeof _0x4f233d[_0xf253('0x1c')]===_0xf253('0x1d')&&typeof _0x4f233d['limit']===_0xf253('0x1d');var _0x28879a=_0xc065fb[_0xf253('0x1e')];var _0x1f82d0=_0x3752b8?0x0:_0x4f233d[_0xf253('0x1c')];var _0x4fa1db=_0x3752b8?_0xc065fb[_0xf253('0x1e')]:_0x4f233d['offset']+_0x4f233d['limit'];var _0x230e58;if(_0x4fa1db>=_0x28879a){_0x4fa1db=_0x28879a;_0x230e58=0xc8;}else{_0x230e58=0xce;}_0x5823da['status'](_0x230e58);return _0x5823da[_0xf253('0x1f')](_0xf253('0x20'),_0x1f82d0+'-'+_0x4fa1db+'/'+_0x28879a)[_0xf253('0x1b')](_0xc065fb);}return null;};}function patchUpdates(_0x16769a){return function(_0x51ca05){try{jsonpatch[_0xf253('0x21')](_0x51ca05,_0x16769a,!![]);}catch(_0x4053c1){return BPromise[_0xf253('0x22')](_0x4053c1);}return _0x51ca05['save']();};}function saveUpdates(_0x45c947,_0xa44728){return function(_0x3325f8){if(_0x3325f8){return _0x3325f8[_0xf253('0x23')](_0x45c947)[_0xf253('0x24')](function(_0x2bd413){return _0x2bd413;});}return null;};}function removeEntity(_0x3629ee,_0x527d01){return function(_0x50be70){if(_0x50be70){return _0x50be70[_0xf253('0x25')]()['then'](function(){_0x3629ee[_0xf253('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x241a6a,_0x4ebf4a){return function(_0x2ee7fa){if(!_0x2ee7fa){_0x241a6a[_0xf253('0x19')](0x194);}return _0x2ee7fa;};}function handleError(_0x51997f,_0x4f2e56){_0x4f2e56=_0x4f2e56||0x1f4;return function(_0x52196d){logger[_0xf253('0x26')](_0x52196d[_0xf253('0x27')]);if(_0x52196d[_0xf253('0x28')]){delete _0x52196d['name'];}_0x51997f[_0xf253('0x1a')](_0x4f2e56)['send'](_0x52196d);};}exports['index']=function(_0x2bee3e,_0x3cbbeb){var _0x19843f={},_0x16222d={},_0x27600c={'count':0x0,'rows':[]};var _0x425e8e=_[_0xf253('0x29')](db[_0xf253('0x2a')]['rawAttributes'],function(_0x4b7fdf){return{'name':_0x4b7fdf[_0xf253('0x2b')],'type':_0x4b7fdf[_0xf253('0x2c')][_0xf253('0x2d')]};});_0x16222d['model']=_[_0xf253('0x29')](_0x425e8e,'name');_0x16222d[_0xf253('0x2e')]=_[_0xf253('0x2f')](_0x2bee3e['query']);_0x16222d['filters']=_[_0xf253('0x30')](_0x16222d[_0xf253('0x31')],_0x16222d[_0xf253('0x2e')]);_0x19843f[_0xf253('0x32')]=_['intersection'](_0x16222d[_0xf253('0x31')],qs['fields'](_0x2bee3e[_0xf253('0x2e')][_0xf253('0x33')]));_0x19843f[_0xf253('0x32')]=_0x19843f[_0xf253('0x32')]['length']?_0x19843f['attributes']:_0x16222d[_0xf253('0x31')];if(!_0x2bee3e[_0xf253('0x2e')][_0xf253('0x34')](_0xf253('0x35'))){_0x19843f[_0xf253('0x36')]=qs[_0xf253('0x36')](_0x2bee3e[_0xf253('0x2e')]['limit']);_0x19843f[_0xf253('0x1c')]=qs[_0xf253('0x1c')](_0x2bee3e['query'][_0xf253('0x1c')]);}_0x19843f[_0xf253('0x37')]=qs[_0xf253('0x38')](_0x2bee3e[_0xf253('0x2e')][_0xf253('0x38')]);_0x19843f['where']=qs['filters'](_[_0xf253('0x39')](_0x2bee3e[_0xf253('0x2e')],_0x16222d[_0xf253('0x3a')]),_0x425e8e);if(_0x2bee3e[_0xf253('0x2e')][_0xf253('0x3b')]){_0x19843f[_0xf253('0x3c')]=_[_0xf253('0x3d')](_0x19843f['where'],{'$or':_[_0xf253('0x29')](_0x425e8e,function(_0x556d28){if(_0x556d28[_0xf253('0x2c')]!=='VIRTUAL'){var _0xe2d96d={};_0xe2d96d[_0x556d28[_0xf253('0x28')]]={'$like':'%'+_0x2bee3e['query'][_0xf253('0x3b')]+'%'};return _0xe2d96d;}})});}_0x19843f=_[_0xf253('0x3d')]({},_0x19843f,_0x2bee3e[_0xf253('0x3e')]);var _0x3a6f84={'where':_0x19843f['where']};return db[_0xf253('0x2a')][_0xf253('0x1e')](_0x3a6f84)['then'](function(_0x36e571){_0x27600c['count']=_0x36e571;if(_0x2bee3e[_0xf253('0x2e')]['includeAll']){_0x19843f['include']=[{'all':!![]}];}return db[_0xf253('0x2a')]['findAll'](_0x19843f);})['then'](function(_0x3a8762){_0x27600c['rows']=_0x3a8762;return _0x27600c;})[_0xf253('0x24')](respondWithFilteredResult(_0x3cbbeb,_0x19843f))[_0xf253('0x3f')](handleError(_0x3cbbeb,null));};exports['show']=function(_0x55484a,_0x58070e){var _0x2d7d3d={'raw':!![],'where':{'id':_0x55484a[_0xf253('0x40')]['id']}},_0x1d668a={};_0x1d668a[_0xf253('0x31')]=_[_0xf253('0x2f')](db[_0xf253('0x2a')][_0xf253('0x41')]);_0x1d668a['query']=_[_0xf253('0x2f')](_0x55484a[_0xf253('0x2e')]);_0x1d668a['filters']=_['intersection'](_0x1d668a['model'],_0x1d668a[_0xf253('0x2e')]);_0x2d7d3d[_0xf253('0x32')]=_[_0xf253('0x30')](_0x1d668a[_0xf253('0x31')],qs['fields'](_0x55484a[_0xf253('0x2e')][_0xf253('0x33')]));_0x2d7d3d[_0xf253('0x32')]=_0x2d7d3d[_0xf253('0x32')][_0xf253('0x42')]?_0x2d7d3d[_0xf253('0x32')]:_0x1d668a['model'];if(_0x55484a[_0xf253('0x2e')]['includeAll']){_0x2d7d3d[_0xf253('0x43')]=[{'all':!![]}];}_0x2d7d3d=_[_0xf253('0x3d')]({},_0x2d7d3d,_0x55484a['options']);return db[_0xf253('0x2a')][_0xf253('0x44')](_0x2d7d3d)['then'](handleEntityNotFound(_0x58070e,null))['then'](respondWithResult(_0x58070e,null))[_0xf253('0x3f')](handleError(_0x58070e,null));};exports['create']=function(_0x29a70a,_0xfdb3b6){return db[_0xf253('0x2a')]['create'](_0x29a70a[_0xf253('0x45')],{})[_0xf253('0x24')](respondWithResult(_0xfdb3b6,0xc9))[_0xf253('0x3f')](handleError(_0xfdb3b6,null));};exports['update']=function(_0x46ca97,_0x526ec5){if(_0x46ca97[_0xf253('0x45')]['id']){delete _0x46ca97[_0xf253('0x45')]['id'];}return db[_0xf253('0x2a')][_0xf253('0x44')]({'where':{'id':_0x46ca97[_0xf253('0x40')]['id']}})[_0xf253('0x24')](handleEntityNotFound(_0x526ec5,null))[_0xf253('0x24')](saveUpdates(_0x46ca97['body'],null))['then'](respondWithResult(_0x526ec5,null))['catch'](handleError(_0x526ec5,null));};exports[_0xf253('0x25')]=function(_0x8f1f9a,_0x568abe){return db['SquareDetailsReport'][_0xf253('0x44')]({'where':{'id':_0x8f1f9a[_0xf253('0x40')]['id']}})['then'](handleEntityNotFound(_0x568abe,null))[_0xf253('0x24')](removeEntity(_0x568abe,null))[_0xf253('0x3f')](handleError(_0x568abe,null));};exports[_0xf253('0x46')]=function(_0x19ab72,_0x3eb0fb){return db[_0xf253('0x2a')][_0xf253('0x46')]()['then'](respondWithResult(_0x3eb0fb,null))[_0xf253('0x3f')](handleError(_0x3eb0fb,null));}; \ No newline at end of file +var _0xf81b=['catch','find','create','body','params','destroy','describe','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','map','options','SquareDetailsReport','includeAll','include','findAll','rows'];(function(_0x2353ff,_0x4af5cf){var _0x225402=function(_0x2ce5f9){while(--_0x2ce5f9){_0x2353ff['push'](_0x2353ff['shift']());}};_0x225402(++_0x4af5cf);}(_0xf81b,0xdc));var _0xbf81=function(_0x1f7efa,_0x29ac4e){_0x1f7efa=_0x1f7efa-0x0;var _0xd5e854=_0xf81b[_0x1f7efa];return _0xd5e854;};'use strict';var emlformat=require(_0xbf81('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf81('0x1'));var jsonpatch=require(_0xbf81('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf81('0x3'));var util=require(_0xbf81('0x4'));var path=require(_0xbf81('0x5'));var sox=require(_0xbf81('0x6'));var csv=require('to-csv');var ejs=require(_0xbf81('0x7'));var fs=require('fs');var fs_extra=require(_0xbf81('0x8'));var _=require('lodash');var squel=require(_0xbf81('0x9'));var crypto=require(_0xbf81('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xbf81('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbf81('0xc'));var Papa=require(_0xbf81('0xd'));var Redis=require('ioredis');var authService=require(_0xbf81('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbf81('0xf'));var hardwareService=require(_0xbf81('0x10'));var logger=require(_0xbf81('0x11'))(_0xbf81('0x12'));var utils=require(_0xbf81('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbf81('0x14'));var db=require(_0xbf81('0x15'))['db'];function respondWithStatusCode(_0x3d3ee3,_0x55c8c7){_0x55c8c7=_0x55c8c7||0xcc;return function(_0x4ad04b){if(_0x4ad04b){return _0x3d3ee3[_0xbf81('0x16')](_0x55c8c7);}return _0x3d3ee3[_0xbf81('0x17')](_0x55c8c7)[_0xbf81('0x18')]();};}function respondWithResult(_0x1273ed,_0x59b350){_0x59b350=_0x59b350||0xc8;return function(_0x13b8f8){if(_0x13b8f8){return _0x1273ed[_0xbf81('0x17')](_0x59b350)[_0xbf81('0x19')](_0x13b8f8);}};}function respondWithFilteredResult(_0x1de479,_0x51a558){return function(_0x284347){if(_0x284347){var _0x15db00=typeof _0x51a558[_0xbf81('0x1a')]==='undefined'&&typeof _0x51a558[_0xbf81('0x1b')]===_0xbf81('0x1c');var _0x226374=_0x284347[_0xbf81('0x1d')];var _0x338569=_0x15db00?0x0:_0x51a558[_0xbf81('0x1a')];var _0x49a0ca=_0x15db00?_0x284347[_0xbf81('0x1d')]:_0x51a558['offset']+_0x51a558['limit'];var _0x15864e;if(_0x49a0ca>=_0x226374){_0x49a0ca=_0x226374;_0x15864e=0xc8;}else{_0x15864e=0xce;}_0x1de479[_0xbf81('0x17')](_0x15864e);return _0x1de479[_0xbf81('0x1e')]('Content-Range',_0x338569+'-'+_0x49a0ca+'/'+_0x226374)[_0xbf81('0x19')](_0x284347);}return null;};}function patchUpdates(_0x4f7342){return function(_0x5cd4ce){try{jsonpatch[_0xbf81('0x1f')](_0x5cd4ce,_0x4f7342,!![]);}catch(_0x4d6c2b){return BPromise['reject'](_0x4d6c2b);}return _0x5cd4ce['save']();};}function saveUpdates(_0x5678c9,_0x21ef23){return function(_0x2e0923){if(_0x2e0923){return _0x2e0923[_0xbf81('0x20')](_0x5678c9)[_0xbf81('0x21')](function(_0x551b52){return _0x551b52;});}return null;};}function removeEntity(_0x33731f,_0xd8d4ca){return function(_0xdbdf4d){if(_0xdbdf4d){return _0xdbdf4d['destroy']()[_0xbf81('0x21')](function(){_0x33731f[_0xbf81('0x17')](0xcc)[_0xbf81('0x18')]();});}};}function handleEntityNotFound(_0x1e0a4f,_0x15a9d0){return function(_0x1d89c6){if(!_0x1d89c6){_0x1e0a4f[_0xbf81('0x16')](0x194);}return _0x1d89c6;};}function handleError(_0x59ed06,_0x6046d3){_0x6046d3=_0x6046d3||0x1f4;return function(_0x207d86){logger[_0xbf81('0x22')](_0x207d86[_0xbf81('0x23')]);if(_0x207d86[_0xbf81('0x24')]){delete _0x207d86[_0xbf81('0x24')];}_0x59ed06[_0xbf81('0x17')](_0x6046d3)[_0xbf81('0x25')](_0x207d86);};}exports[_0xbf81('0x26')]=function(_0x3ebee4,_0x883587){var _0x2cb23d={},_0x1b353d={},_0x71d0ef={'count':0x0,'rows':[]};var _0xb4532e=_['map'](db['SquareDetailsReport'][_0xbf81('0x27')],function(_0x3bca7f){return{'name':_0x3bca7f[_0xbf81('0x28')],'type':_0x3bca7f[_0xbf81('0x29')][_0xbf81('0x2a')]};});_0x1b353d[_0xbf81('0x2b')]=_['map'](_0xb4532e,_0xbf81('0x24'));_0x1b353d[_0xbf81('0x2c')]=_[_0xbf81('0x2d')](_0x3ebee4[_0xbf81('0x2c')]);_0x1b353d[_0xbf81('0x2e')]=_[_0xbf81('0x2f')](_0x1b353d[_0xbf81('0x2b')],_0x1b353d[_0xbf81('0x2c')]);_0x2cb23d[_0xbf81('0x30')]=_[_0xbf81('0x2f')](_0x1b353d[_0xbf81('0x2b')],qs['fields'](_0x3ebee4[_0xbf81('0x2c')][_0xbf81('0x31')]));_0x2cb23d[_0xbf81('0x30')]=_0x2cb23d[_0xbf81('0x30')][_0xbf81('0x32')]?_0x2cb23d[_0xbf81('0x30')]:_0x1b353d['model'];if(!_0x3ebee4[_0xbf81('0x2c')]['hasOwnProperty'](_0xbf81('0x33'))){_0x2cb23d[_0xbf81('0x1b')]=qs[_0xbf81('0x1b')](_0x3ebee4['query']['limit']);_0x2cb23d[_0xbf81('0x1a')]=qs[_0xbf81('0x1a')](_0x3ebee4['query']['offset']);}_0x2cb23d['order']=qs['sort'](_0x3ebee4[_0xbf81('0x2c')][_0xbf81('0x34')]);_0x2cb23d['where']=qs[_0xbf81('0x2e')](_[_0xbf81('0x35')](_0x3ebee4['query'],_0x1b353d[_0xbf81('0x2e')]),_0xb4532e);if(_0x3ebee4[_0xbf81('0x2c')][_0xbf81('0x36')]){_0x2cb23d[_0xbf81('0x37')]=_[_0xbf81('0x38')](_0x2cb23d[_0xbf81('0x37')],{'$or':_[_0xbf81('0x39')](_0xb4532e,function(_0x384120){if(_0x384120[_0xbf81('0x29')]!=='VIRTUAL'){var _0x229337={};_0x229337[_0x384120[_0xbf81('0x24')]]={'$like':'%'+_0x3ebee4['query']['filter']+'%'};return _0x229337;}})});}_0x2cb23d=_['merge']({},_0x2cb23d,_0x3ebee4[_0xbf81('0x3a')]);var _0x12f04e={'where':_0x2cb23d[_0xbf81('0x37')]};return db[_0xbf81('0x3b')][_0xbf81('0x1d')](_0x12f04e)['then'](function(_0x55c045){_0x71d0ef[_0xbf81('0x1d')]=_0x55c045;if(_0x3ebee4[_0xbf81('0x2c')][_0xbf81('0x3c')]){_0x2cb23d[_0xbf81('0x3d')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0xbf81('0x3e')](_0x2cb23d);})['then'](function(_0x1df87a){_0x71d0ef[_0xbf81('0x3f')]=_0x1df87a;return _0x71d0ef;})[_0xbf81('0x21')](respondWithFilteredResult(_0x883587,_0x2cb23d))[_0xbf81('0x40')](handleError(_0x883587,null));};exports['show']=function(_0xed6217,_0x3f9797){var _0x4268e7={'raw':!![],'where':{'id':_0xed6217['params']['id']}},_0x194be1={};_0x194be1[_0xbf81('0x2b')]=_['keys'](db[_0xbf81('0x3b')][_0xbf81('0x27')]);_0x194be1[_0xbf81('0x2c')]=_['keys'](_0xed6217[_0xbf81('0x2c')]);_0x194be1[_0xbf81('0x2e')]=_[_0xbf81('0x2f')](_0x194be1['model'],_0x194be1[_0xbf81('0x2c')]);_0x4268e7[_0xbf81('0x30')]=_[_0xbf81('0x2f')](_0x194be1['model'],qs[_0xbf81('0x31')](_0xed6217[_0xbf81('0x2c')][_0xbf81('0x31')]));_0x4268e7[_0xbf81('0x30')]=_0x4268e7[_0xbf81('0x30')][_0xbf81('0x32')]?_0x4268e7[_0xbf81('0x30')]:_0x194be1[_0xbf81('0x2b')];if(_0xed6217[_0xbf81('0x2c')][_0xbf81('0x3c')]){_0x4268e7[_0xbf81('0x3d')]=[{'all':!![]}];}_0x4268e7=_['merge']({},_0x4268e7,_0xed6217[_0xbf81('0x3a')]);return db[_0xbf81('0x3b')][_0xbf81('0x41')](_0x4268e7)['then'](handleEntityNotFound(_0x3f9797,null))['then'](respondWithResult(_0x3f9797,null))[_0xbf81('0x40')](handleError(_0x3f9797,null));};exports['create']=function(_0x256a25,_0x47b981){return db[_0xbf81('0x3b')][_0xbf81('0x42')](_0x256a25[_0xbf81('0x43')],{})[_0xbf81('0x21')](respondWithResult(_0x47b981,0xc9))[_0xbf81('0x40')](handleError(_0x47b981,null));};exports[_0xbf81('0x20')]=function(_0x553b7d,_0x296698){if(_0x553b7d['body']['id']){delete _0x553b7d[_0xbf81('0x43')]['id'];}return db[_0xbf81('0x3b')][_0xbf81('0x41')]({'where':{'id':_0x553b7d[_0xbf81('0x44')]['id']}})[_0xbf81('0x21')](handleEntityNotFound(_0x296698,null))[_0xbf81('0x21')](saveUpdates(_0x553b7d[_0xbf81('0x43')],null))['then'](respondWithResult(_0x296698,null))['catch'](handleError(_0x296698,null));};exports[_0xbf81('0x45')]=function(_0x39e6c8,_0x294ba7){return db['SquareDetailsReport'][_0xbf81('0x41')]({'where':{'id':_0x39e6c8[_0xbf81('0x44')]['id']}})[_0xbf81('0x21')](handleEntityNotFound(_0x294ba7,null))['then'](removeEntity(_0x294ba7,null))[_0xbf81('0x40')](handleError(_0x294ba7,null));};exports[_0xbf81('0x46')]=function(_0x4cece9,_0x997a23){return db[_0xbf81('0x3b')][_0xbf81('0x46')]()['then'](respondWithResult(_0x997a23,null))[_0xbf81('0x40')](handleError(_0x997a23,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 7509e79..59a5fc7 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 _0xdcfe=['define','../../config/logger','bluebird','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xdcfe,0xf1));var _0xedcf=function(_0x9da39b,_0xfd57db){_0x9da39b=_0x9da39b-0x0;var _0x49daef=_0xdcfe[_0x9da39b];return _0x49daef;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xedcf('0x0'))('api');var moment=require('moment');var BPromise=require(_0xedcf('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xedcf('0x2'));var rimraf=require(_0xedcf('0x3'));var config=require(_0xedcf('0x4'));var attributes=require(_0xedcf('0x5'));module[_0xedcf('0x6')]=function(_0x692fbf,_0x51380d){return _0x692fbf[_0xedcf('0x7')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f02=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details'];(function(_0xaf3247,_0x39e1bf){var _0x4eea43=function(_0x1225dd){while(--_0x1225dd){_0xaf3247['push'](_0xaf3247['shift']());}};_0x4eea43(++_0x39e1bf);}(_0x1f02,0x120));var _0x21f0=function(_0x536c7b,_0x3a92e1){_0x536c7b=_0x536c7b-0x0;var _0x54ab48=_0x1f02[_0x536c7b];return _0x54ab48;};'use strict';var _=require('lodash');var util=require(_0x21f0('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x21f0('0x1'));var BPromise=require(_0x21f0('0x2'));var rp=require(_0x21f0('0x3'));var fs=require('fs');var path=require(_0x21f0('0x4'));var rimraf=require(_0x21f0('0x5'));var config=require(_0x21f0('0x6'));var attributes=require(_0x21f0('0x7'));module[_0x21f0('0x8')]=function(_0x2aad88,_0x56d1cb){return _0x2aad88[_0x21f0('0x9')](_0x21f0('0xa'),attributes,{'tableName':_0x21f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 1781563..0401f38 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 _0x5a13=['CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','info','result','catch'];(function(_0x54643f,_0x51f728){var _0x222882=function(_0x14c7d1){while(--_0x14c7d1){_0x54643f['push'](_0x54643f['shift']());}};_0x222882(++_0x51f728);}(_0x5a13,0x145));var _0x35a1=function(_0x2fb745,_0x89ea61){_0x2fb745=_0x2fb745-0x0;var _0x5dae6f=_0x5a13[_0x2fb745];return _0x5dae6f;};'use strict';var _=require(_0x35a1('0x0'));var util=require(_0x35a1('0x1'));var moment=require('moment');var BPromise=require(_0x35a1('0x2'));var rs=require(_0x35a1('0x3'));var fs=require('fs');var Redis=require(_0x35a1('0x4'));var db=require(_0x35a1('0x5'))['db'];var utils=require(_0x35a1('0x6'));var logger=require(_0x35a1('0x7'))(_0x35a1('0x8'));var config=require(_0x35a1('0x9'));var jayson=require(_0x35a1('0xa'));var client=jayson[_0x35a1('0xb')][_0x35a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x407b26,_0x10a34f,_0x3aa00e){return new BPromise(function(_0x58afca,_0x57d9fd){return client['request'](_0x407b26,_0x3aa00e)[_0x35a1('0xd')](function(_0x103ec8){logger['info'](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x10a34f,_0x35a1('0xf'),JSON[_0x35a1('0x10')](_0x103ec8));if(_0x103ec8['error']){if(_0x103ec8['error'][_0x35a1('0x11')]===0x1f4){logger['error'](_0x35a1('0xe'),_0x10a34f,_0x103ec8['error'][_0x35a1('0x12')]);return _0x57d9fd(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);return _0x58afca(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}else{logger[_0x35a1('0x14')](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));_0x58afca(_0x103ec8[_0x35a1('0x15')][_0x35a1('0x12')]);}})[_0x35a1('0x16')](function(_0x251d32){logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x251d32);_0x57d9fd(_0x251d32);});});}exports[_0x35a1('0x17')]=function(_0x1de373){var _0x5e4317=this;return new Promise(function(_0x3b17dc,_0xbeb751){return db[_0x35a1('0x18')][_0x35a1('0x19')](_0x1de373[_0x35a1('0x1a')],{'raw':_0x1de373[_0x35a1('0x1b')]?_0x1de373[_0x35a1('0x1b')][_0x35a1('0x1c')]===undefined?!![]:![]:!![]})[_0x35a1('0xd')](function(_0x5929e5){logger[_0x35a1('0x14')](_0x35a1('0x17'),_0x1de373);logger['debug'](_0x35a1('0x17'),_0x1de373,JSON[_0x35a1('0x10')](_0x5929e5));_0x3b17dc(_0x5929e5);})['catch'](function(_0xc13bad){logger['error'](_0x35a1('0x17'),_0xc13bad[_0x35a1('0x12')],_0x1de373);_0xbeb751(_0x5e4317[_0x35a1('0x13')](0x1f4,_0xc13bad['message']));});});}; \ No newline at end of file +var _0xb62e=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','then','lodash','util'];(function(_0x275362,_0x14f7a3){var _0x290e67=function(_0x47487b){while(--_0x47487b){_0x275362['push'](_0x275362['shift']());}};_0x290e67(++_0x14f7a3);}(_0xb62e,0x1de));var _0xeb62=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb62e[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var moment=require(_0xeb62('0x2'));var BPromise=require(_0xeb62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb62('0x4'));var db=require(_0xeb62('0x5'))['db'];var utils=require(_0xeb62('0x6'));var logger=require(_0xeb62('0x7'))(_0xeb62('0x8'));var config=require(_0xeb62('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb62('0xa')][_0xeb62('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31f5ea,_0x5e0dc4,_0x2065a0){return new BPromise(function(_0xab7049,_0x1e10ae){return client[_0xeb62('0xc')](_0x31f5ea,_0x2065a0)['then'](function(_0x5cdef3){logger[_0xeb62('0xd')](_0xeb62('0xe'),_0x5e0dc4,_0xeb62('0xf'));logger[_0xeb62('0x10')](_0xeb62('0x11'),_0x5e0dc4,_0xeb62('0xf'),JSON[_0xeb62('0x12')](_0x5cdef3));if(_0x5cdef3[_0xeb62('0x13')]){if(_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x14')]===0x1f4){logger['error'](_0xeb62('0xe'),_0x5e0dc4,_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x15')]);return _0x1e10ae(_0x5cdef3[_0xeb62('0x13')]['message']);}logger[_0xeb62('0x13')](_0xeb62('0xe'),_0x5e0dc4,_0x5cdef3[_0xeb62('0x13')]['message']);return _0xab7049(_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x15')]);}else{logger[_0xeb62('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x5e0dc4,_0xeb62('0xf'));_0xab7049(_0x5cdef3[_0xeb62('0x16')][_0xeb62('0x15')]);}})[_0xeb62('0x17')](function(_0x3fb280){logger[_0xeb62('0x13')](_0xeb62('0xe'),_0x5e0dc4,_0x3fb280);_0x1e10ae(_0x3fb280);});});}exports[_0xeb62('0x18')]=function(_0x39b138){var _0x27fd84=this;return new Promise(function(_0x27efc8,_0x11d516){return db[_0xeb62('0x19')]['create'](_0x39b138[_0xeb62('0x1a')],{'raw':_0x39b138[_0xeb62('0x1b')]?_0x39b138[_0xeb62('0x1b')][_0xeb62('0x1c')]===undefined?!![]:![]:!![]})[_0xeb62('0x1d')](function(_0x24cbf3){logger[_0xeb62('0xd')]('CreateSquareDetailsReport',_0x39b138);logger['debug'](_0xeb62('0x18'),_0x39b138,JSON[_0xeb62('0x12')](_0x24cbf3));_0x27efc8(_0x24cbf3);})[_0xeb62('0x17')](function(_0x13243f){logger[_0xeb62('0x13')]('CreateSquareDetailsReport',_0x13243f['message'],_0x39b138);_0x11d516(_0x27fd84[_0xeb62('0x13')](0x1f4,_0x13243f[_0xeb62('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 60d81b2..952547d 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 _0x4ce1=['./system.controller','get','isAuthenticated','index','/process/:pid/kill','exports','express','Router','../../components/auth/service'];(function(_0x584998,_0x54d196){var _0x598a99=function(_0x557037){while(--_0x557037){_0x584998['push'](_0x584998['shift']());}};_0x598a99(++_0x54d196);}(_0x4ce1,0xba));var _0x14ce=function(_0x5217d4,_0x192402){_0x5217d4=_0x5217d4-0x0;var _0x34146e=_0x4ce1[_0x5217d4];return _0x34146e;};'use strict';var express=require(_0x14ce('0x0'));var router=express[_0x14ce('0x1')]();var auth=require(_0x14ce('0x2'));var controller=require(_0x14ce('0x3'));router[_0x14ce('0x4')]('/',auth[_0x14ce('0x5')](),controller[_0x14ce('0x6')]);router[_0x14ce('0x4')](_0x14ce('0x7'),auth[_0x14ce('0x5')](),controller['killProcess']);module[_0x14ce('0x8')]=router; \ No newline at end of file +var _0x71cc=['index','killProcess','exports','express','Router','./system.controller','get','isAuthenticated'];(function(_0x195223,_0x121404){var _0x3a62dd=function(_0x3adeda){while(--_0x3adeda){_0x195223['push'](_0x195223['shift']());}};_0x3a62dd(++_0x121404);}(_0x71cc,0x1d3));var _0xc71c=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x71cc[_0x5a79e2];return _0x266c45;};'use strict';var express=require(_0xc71c('0x0'));var router=express[_0xc71c('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xc71c('0x2'));router[_0xc71c('0x3')]('/',auth[_0xc71c('0x4')](),controller[_0xc71c('0x5')]);router[_0xc71c('0x3')]('/process/:pid/kill',auth[_0xc71c('0x4')](),controller[_0xc71c('0x6')]);module[_0xc71c('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 251e4c5..069268c 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 _0xfff1=['params','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','killProcess','systeminformation','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','index','getAllData','then','status','json','format','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!'];(function(_0x171a91,_0x32e277){var _0x10a4f2=function(_0x26858c){while(--_0x26858c){_0x171a91['push'](_0x171a91['shift']());}};_0x10a4f2(++_0x32e277);}(_0xfff1,0xca));var _0x1fff=function(_0x5dfc15,_0x4224fd){_0x5dfc15=_0x5dfc15-0x0;var _0x16551a=_0xfff1[_0x5dfc15];return _0x16551a;};'use strict';var info=require(_0x1fff('0x0'));var exec=require('child_process')[_0x1fff('0x1')];var logger=require(_0x1fff('0x2'))(_0x1fff('0x3'));var util=require(_0x1fff('0x4'));var BPromise=require(_0x1fff('0x5'));var _=require(_0x1fff('0x6'));function handleError(_0x279059,_0x5f5d30,_0x430992){_0x5f5d30=_0x5f5d30||0x1f4;return function(_0x1cb478){logger[_0x1fff('0x7')](_0x1fff('0x8'),_0x430992,_0x5f5d30,util[_0x1fff('0x9')](_0x1cb478,{'showHidden':![],'depth':null}));delete _0x1cb478[_0x1fff('0xa')];_0x279059['status'](_0x5f5d30)['send'](_0x1cb478);};}exports[_0x1fff('0xb')]=function(_0x399a18,_0x53b656){return info[_0x1fff('0xc')]()[_0x1fff('0xd')](function(_0x3c4ecf){return _0x53b656[_0x1fff('0xe')](0xc8)[_0x1fff('0xf')](_0x3c4ecf);})['catch'](function(_0x1d7af2){return _0x53b656['status'](0x1f4)[_0x1fff('0xf')](_0x1d7af2);});};exports['killProcess']=function(_0x3d7606,_0x204cf4){var _0x3e7aa0=['components/import/cm'];return new BPromise(function(_0xd7f501,_0x2baf8e){return exec(util[_0x1fff('0x10')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x3d7606['params'][_0x1fff('0x11')]),function(_0x2c2311,_0x365beb,_0x487126){if(_0x2c2311){return _0x2baf8e(_0x2c2311);}return _0xd7f501(_0x365beb);});})[_0x1fff('0xd')](function(_0x11443b){var _0x5bc3ea=![];var _0x102363=_0x11443b[_0x1fff('0x12')](/\n/);for(var _0x3ea954=0x0,_0x9af4fd=_0x3e7aa0[_0x1fff('0x13')];_0x3ea954<_0x9af4fd,_0x5bc3ea===![];_0x3ea954+=0x1){if(_0x11443b[_0x1fff('0x14')](_0x3e7aa0[_0x3ea954])>=0x0){_0x5bc3ea=!![];}}if(!_0x5bc3ea){throw new Error(util[_0x1fff('0x10')](_0x1fff('0x15'),_0x3d7606[_0x1fff('0x16')][_0x1fff('0x11')]));}process[_0x1fff('0x17')](_0x3d7606['params'][_0x1fff('0x11')],_0x1fff('0x18'));return _0x204cf4[_0x1fff('0xe')](0xc8)[_0x1fff('0xf')]({'message':util[_0x1fff('0x10')](_0x1fff('0x19'),_0x3d7606[_0x1fff('0x16')][_0x1fff('0x11')])});})[_0x1fff('0x1a')](handleError(_0x204cf4,null,_0x1fff('0x1b')));}; \ No newline at end of file +var _0xbc71=['<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','then','json','catch','killProcess','components/import/cm','format','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','api','bluebird'];(function(_0x282ccc,_0x5d66a1){var _0x27c2dd=function(_0x58431a){while(--_0x58431a){_0x282ccc['push'](_0x282ccc['shift']());}};_0x27c2dd(++_0x5d66a1);}(_0xbc71,0x86));var _0x1bc7=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xbc71[_0x1e7b16];return _0x37fadc;};'use strict';var info=require(_0x1bc7('0x0'));var exec=require('child_process')[_0x1bc7('0x1')];var logger=require('../../config/logger')(_0x1bc7('0x2'));var util=require('util');var BPromise=require(_0x1bc7('0x3'));var _=require('lodash');function handleError(_0x53114e,_0x3d1933,_0x44b683){_0x3d1933=_0x3d1933||0x1f4;return function(_0x8dc633){logger['error'](_0x1bc7('0x4'),_0x44b683,_0x3d1933,util[_0x1bc7('0x5')](_0x8dc633,{'showHidden':![],'depth':null}));delete _0x8dc633[_0x1bc7('0x6')];_0x53114e[_0x1bc7('0x7')](_0x3d1933)['send'](_0x8dc633);};}exports[_0x1bc7('0x8')]=function(_0x5bd4b4,_0x31be00){return info['getAllData']()[_0x1bc7('0x9')](function(_0x3ccd0d){return _0x31be00['status'](0xc8)[_0x1bc7('0xa')](_0x3ccd0d);})[_0x1bc7('0xb')](function(_0xe56a1b){return _0x31be00[_0x1bc7('0x7')](0x1f4)['json'](_0xe56a1b);});};exports[_0x1bc7('0xc')]=function(_0x31429d,_0x578584){var _0x25d68c=[_0x1bc7('0xd')];return new BPromise(function(_0x617145,_0x253f89){return exec(util[_0x1bc7('0xe')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x31429d[_0x1bc7('0xf')]['pid']),function(_0x49b1e3,_0x5ce0ac,_0x2d94d3){if(_0x49b1e3){return _0x253f89(_0x49b1e3);}return _0x617145(_0x5ce0ac);});})[_0x1bc7('0x9')](function(_0x4802fa){var _0x1ee9d4=![];var _0x5d3e1f=_0x4802fa[_0x1bc7('0x10')](/\n/);for(var _0x5d8045=0x0,_0x5806f1=_0x25d68c[_0x1bc7('0x11')];_0x5d8045<_0x5806f1,_0x1ee9d4===![];_0x5d8045+=0x1){if(_0x4802fa[_0x1bc7('0x12')](_0x25d68c[_0x5d8045])>=0x0){_0x1ee9d4=!![];}}if(!_0x1ee9d4){throw new Error(util[_0x1bc7('0xe')](_0x1bc7('0x13'),_0x31429d[_0x1bc7('0xf')][_0x1bc7('0x14')]));}process[_0x1bc7('0x15')](_0x31429d[_0x1bc7('0xf')][_0x1bc7('0x14')],'SIGINT');return _0x578584[_0x1bc7('0x7')](0xc8)[_0x1bc7('0xa')]({'message':util['format'](_0x1bc7('0x16'),_0x31429d[_0x1bc7('0xf')][_0x1bc7('0x14')])});})[_0x1bc7('0xb')](handleError(_0x578584,null,_0x1bc7('0xc')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 3ed081c..6f39701 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 _0x45d8=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./tag.controller','index','/:id','isAuthenticated','show','post','create','destroy','exports','multer','util'];(function(_0x2c7542,_0x1195f3){var _0x5e4689=function(_0xba3803){while(--_0xba3803){_0x2c7542['push'](_0x2c7542['shift']());}};_0x5e4689(++_0x1195f3);}(_0x45d8,0x174));var _0x845d=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x45d8[_0xea8947];return _0x2455e9;};'use strict';var multer=require(_0x845d('0x0'));var util=require(_0x845d('0x1'));var path=require(_0x845d('0x2'));var timeout=require(_0x845d('0x3'));var express=require(_0x845d('0x4'));var router=express[_0x845d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x845d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x845d('0x7'));var controller=require(_0x845d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x845d('0x9')]);router['get'](_0x845d('0xa'),auth[_0x845d('0xb')](),controller[_0x845d('0xc')]);router[_0x845d('0xd')]('/',auth[_0x845d('0xb')](),controller[_0x845d('0xe')]);router['put'](_0x845d('0xa'),auth[_0x845d('0xb')](),controller['update']);router['delete'](_0x845d('0xa'),auth[_0x845d('0xb')](),controller[_0x845d('0xf')]);module[_0x845d('0x10')]=router; \ No newline at end of file +var _0xd54d=['fs-extra','../../components/interaction/service','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','path','Router'];(function(_0x5a9ec1,_0x207880){var _0x27927c=function(_0x3869e0){while(--_0x3869e0){_0x5a9ec1['push'](_0x5a9ec1['shift']());}};_0x27927c(++_0x207880);}(_0xd54d,0x6e));var _0xdd54=function(_0xeadb4,_0x19523a){_0xeadb4=_0xeadb4-0x0;var _0xe86888=_0xd54d[_0xeadb4];return _0xe86888;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdd54('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdd54('0x1')]();var fs_extra=require(_0xdd54('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xdd54('0x3'));var config=require('../../config/environment');var controller=require(_0xdd54('0x4'));router[_0xdd54('0x5')]('/',auth[_0xdd54('0x6')](),controller[_0xdd54('0x7')]);router[_0xdd54('0x5')](_0xdd54('0x8'),auth[_0xdd54('0x6')](),controller[_0xdd54('0x9')]);router[_0xdd54('0xa')]('/',auth[_0xdd54('0x6')](),controller[_0xdd54('0xb')]);router[_0xdd54('0xc')](_0xdd54('0x8'),auth[_0xdd54('0x6')](),controller[_0xdd54('0xd')]);router[_0xdd54('0xe')](_0xdd54('0x8'),auth[_0xdd54('0x6')](),controller[_0xdd54('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 715ca07..d07144e 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 _0x4ffa=['STRING','#0091EA'];(function(_0x2dc29a,_0x5cdd22){var _0x21b7ee=function(_0x26d061){while(--_0x26d061){_0x2dc29a['push'](_0x2dc29a['shift']());}};_0x21b7ee(++_0x5cdd22);}(_0x4ffa,0x124));var _0xa4ff=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4ffa[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa4ff('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xa4ff('0x0')],'defaultValue':_0xa4ff('0x1')},'description':{'type':Sequelize[_0xa4ff('0x0')]}}; \ No newline at end of file +var _0x180d=['#0091EA','exports','STRING','name'];(function(_0x3f4315,_0x4ace96){var _0x1945cb=function(_0x45eb1f){while(--_0x45eb1f){_0x3f4315['push'](_0x3f4315['shift']());}};_0x1945cb(++_0x4ace96);}(_0x180d,0xf9));var _0xd180=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x180d[_0x4b7895];return _0x264180;};'use strict';var Sequelize=require('sequelize');module[_0xd180('0x0')]={'name':{'type':Sequelize[_0xd180('0x1')],'unique':_0xd180('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xd180('0x1')],'defaultValue':_0xd180('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 9143279..9094245 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 _0x073e=['save','update','then','destroy','stack','name','send','index','Tag','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','count','limit','set','Content-Range','apply','reject'];(function(_0x170fbd,_0x237318){var _0x1ae97e=function(_0x50dc78){while(--_0x50dc78){_0x170fbd['push'](_0x170fbd['shift']());}};_0x1ae97e(++_0x237318);}(_0x073e,0x181));var _0xe073=function(_0x200490,_0x38bbf3){_0x200490=_0x200490-0x0;var _0x40aa6d=_0x073e[_0x200490];return _0x40aa6d;};'use strict';var emlformat=require(_0xe073('0x0'));var rimraf=require(_0xe073('0x1'));var zipdir=require(_0xe073('0x2'));var jsonpatch=require(_0xe073('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe073('0x4'));var util=require(_0xe073('0x5'));var path=require(_0xe073('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe073('0x7'));var _=require(_0xe073('0x8'));var squel=require(_0xe073('0x9'));var crypto=require(_0xe073('0xa'));var jsforce=require(_0xe073('0xb'));var deskjs=require(_0xe073('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe073('0xd'));var Papa=require(_0xe073('0xe'));var Redis=require(_0xe073('0xf'));var authService=require(_0xe073('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe073('0x11'));var hardwareService=require(_0xe073('0x12'));var logger=require(_0xe073('0x13'))(_0xe073('0x14'));var utils=require(_0xe073('0x15'));var config=require(_0xe073('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe073('0x17'))['db'];function respondWithStatusCode(_0x56e3f5,_0x3dedf7){_0x3dedf7=_0x3dedf7||0xcc;return function(_0x5d2f2f){if(_0x5d2f2f){return _0x56e3f5[_0xe073('0x18')](_0x3dedf7);}return _0x56e3f5['status'](_0x3dedf7)[_0xe073('0x19')]();};}function respondWithResult(_0x27d34,_0x47828d){_0x47828d=_0x47828d||0xc8;return function(_0x2ce92d){if(_0x2ce92d){return _0x27d34[_0xe073('0x1a')](_0x47828d)[_0xe073('0x1b')](_0x2ce92d);}};}function respondWithFilteredResult(_0x2f4b36,_0xfb28f5){return function(_0x208f2e){if(_0x208f2e){var _0x26f3d3=typeof _0xfb28f5[_0xe073('0x1c')]==='undefined'&&typeof _0xfb28f5['limit']==='undefined';var _0x4c578c=_0x208f2e[_0xe073('0x1d')];var _0x10486c=_0x26f3d3?0x0:_0xfb28f5[_0xe073('0x1c')];var _0x4f9c8e=_0x26f3d3?_0x208f2e[_0xe073('0x1d')]:_0xfb28f5[_0xe073('0x1c')]+_0xfb28f5[_0xe073('0x1e')];var _0x54c10e;if(_0x4f9c8e>=_0x4c578c){_0x4f9c8e=_0x4c578c;_0x54c10e=0xc8;}else{_0x54c10e=0xce;}_0x2f4b36[_0xe073('0x1a')](_0x54c10e);return _0x2f4b36[_0xe073('0x1f')](_0xe073('0x20'),_0x10486c+'-'+_0x4f9c8e+'/'+_0x4c578c)[_0xe073('0x1b')](_0x208f2e);}return null;};}function patchUpdates(_0x43668e){return function(_0x17dd4b){try{jsonpatch[_0xe073('0x21')](_0x17dd4b,_0x43668e,!![]);}catch(_0x1d7a13){return BPromise[_0xe073('0x22')](_0x1d7a13);}return _0x17dd4b[_0xe073('0x23')]();};}function saveUpdates(_0x5143fa,_0x4405fd){return function(_0x21f9c2){if(_0x21f9c2){return _0x21f9c2[_0xe073('0x24')](_0x5143fa)[_0xe073('0x25')](function(_0x39bcb4){return _0x39bcb4;});}return null;};}function removeEntity(_0x275aa8,_0x504c26){return function(_0x4c76ef){if(_0x4c76ef){return _0x4c76ef[_0xe073('0x26')]()['then'](function(){var _0x5e3b16=_0x4c76ef['get']({'plain':!![]});var _0x5c4137='Tags';return db['UserProfileResource'][_0xe073('0x26')]({'where':{'type':_0x5c4137,'resourceId':_0x5e3b16['id']}})[_0xe073('0x25')](function(){return _0x4c76ef;});})['then'](function(){_0x275aa8[_0xe073('0x1a')](0xcc)[_0xe073('0x19')]();});}};}function handleEntityNotFound(_0x436c34,_0x5a5b2b){return function(_0x10f5ba){if(!_0x10f5ba){_0x436c34['sendStatus'](0x194);}return _0x10f5ba;};}function handleError(_0x255d91,_0x2e5fac){_0x2e5fac=_0x2e5fac||0x1f4;return function(_0x599972){logger['error'](_0x599972[_0xe073('0x27')]);if(_0x599972[_0xe073('0x28')]){delete _0x599972[_0xe073('0x28')];}_0x255d91[_0xe073('0x1a')](_0x2e5fac)[_0xe073('0x29')](_0x599972);};}exports[_0xe073('0x2a')]=function(_0x4f60dd,_0x2a206a){var _0x5c04fe={},_0x1baa0a={},_0x1cdcb0={'count':0x0,'rows':[]};var _0x4a6884=_['map'](db[_0xe073('0x2b')]['rawAttributes'],function(_0x3f6564){return{'name':_0x3f6564[_0xe073('0x2c')],'type':_0x3f6564[_0xe073('0x2d')]['key']};});_0x1baa0a['model']=_[_0xe073('0x2e')](_0x4a6884,_0xe073('0x28'));_0x1baa0a['query']=_[_0xe073('0x2f')](_0x4f60dd[_0xe073('0x30')]);_0x1baa0a[_0xe073('0x31')]=_['intersection'](_0x1baa0a[_0xe073('0x32')],_0x1baa0a['query']);_0x5c04fe['attributes']=_[_0xe073('0x33')](_0x1baa0a[_0xe073('0x32')],qs[_0xe073('0x34')](_0x4f60dd['query'][_0xe073('0x34')]));_0x5c04fe[_0xe073('0x35')]=_0x5c04fe[_0xe073('0x35')]['length']?_0x5c04fe[_0xe073('0x35')]:_0x1baa0a[_0xe073('0x32')];if(!_0x4f60dd[_0xe073('0x30')][_0xe073('0x36')](_0xe073('0x37'))){_0x5c04fe[_0xe073('0x1e')]=qs['limit'](_0x4f60dd[_0xe073('0x30')][_0xe073('0x1e')]);_0x5c04fe[_0xe073('0x1c')]=qs['offset'](_0x4f60dd[_0xe073('0x30')][_0xe073('0x1c')]);}_0x5c04fe[_0xe073('0x38')]=qs[_0xe073('0x39')](_0x4f60dd[_0xe073('0x30')]['sort']);_0x5c04fe[_0xe073('0x3a')]=qs['filters'](_[_0xe073('0x3b')](_0x4f60dd[_0xe073('0x30')],_0x1baa0a[_0xe073('0x31')]),_0x4a6884);if(_0x4f60dd[_0xe073('0x30')][_0xe073('0x3c')]){_0x5c04fe[_0xe073('0x3a')]=_[_0xe073('0x3d')](_0x5c04fe[_0xe073('0x3a')],{'$or':_[_0xe073('0x2e')](_0x4a6884,function(_0x3d29e5){if(_0x3d29e5[_0xe073('0x2d')]!==_0xe073('0x3e')){var _0x16be1a={};_0x16be1a[_0x3d29e5['name']]={'$like':'%'+_0x4f60dd[_0xe073('0x30')]['filter']+'%'};return _0x16be1a;}})});}_0x5c04fe=_[_0xe073('0x3d')]({},_0x5c04fe,_0x4f60dd[_0xe073('0x3f')]);var _0x5a4e19={'where':_0x5c04fe[_0xe073('0x3a')]};return db['Tag'][_0xe073('0x1d')](_0x5a4e19)[_0xe073('0x25')](function(_0x93852a){_0x1cdcb0[_0xe073('0x1d')]=_0x93852a;if(_0x4f60dd[_0xe073('0x30')]['includeAll']){_0x5c04fe[_0xe073('0x40')]=[{'all':!![]}];}return db['Tag'][_0xe073('0x41')](_0x5c04fe);})[_0xe073('0x25')](function(_0x125d1f){_0x1cdcb0[_0xe073('0x42')]=_0x125d1f;return _0x1cdcb0;})[_0xe073('0x25')](respondWithFilteredResult(_0x2a206a,_0x5c04fe))[_0xe073('0x43')](handleError(_0x2a206a,null));};exports[_0xe073('0x44')]=function(_0x2f4939,_0x1b50c5){var _0x2d3ffe={'raw':!![],'where':{'id':_0x2f4939['params']['id']}},_0x2c312b={};_0x2c312b['model']=_[_0xe073('0x2f')](db[_0xe073('0x2b')][_0xe073('0x45')]);_0x2c312b[_0xe073('0x30')]=_[_0xe073('0x2f')](_0x2f4939['query']);_0x2c312b[_0xe073('0x31')]=_[_0xe073('0x33')](_0x2c312b[_0xe073('0x32')],_0x2c312b[_0xe073('0x30')]);_0x2d3ffe[_0xe073('0x35')]=_['intersection'](_0x2c312b[_0xe073('0x32')],qs['fields'](_0x2f4939['query'][_0xe073('0x34')]));_0x2d3ffe[_0xe073('0x35')]=_0x2d3ffe['attributes']['length']?_0x2d3ffe[_0xe073('0x35')]:_0x2c312b[_0xe073('0x32')];if(_0x2f4939[_0xe073('0x30')][_0xe073('0x46')]){_0x2d3ffe[_0xe073('0x40')]=[{'all':!![]}];}_0x2d3ffe=_[_0xe073('0x3d')]({},_0x2d3ffe,_0x2f4939[_0xe073('0x3f')]);return db['Tag'][_0xe073('0x47')](_0x2d3ffe)['then'](handleEntityNotFound(_0x1b50c5,null))[_0xe073('0x25')](respondWithResult(_0x1b50c5,null))[_0xe073('0x43')](handleError(_0x1b50c5,null));};exports[_0xe073('0x48')]=function(_0x4e1f1d,_0x4d5bcd){return db[_0xe073('0x2b')][_0xe073('0x48')](_0x4e1f1d[_0xe073('0x49')],{})['then'](function(_0x151035){var _0x338557=_0x4e1f1d[_0xe073('0x4a')][_0xe073('0x4b')]({'plain':!![]});if(!_0x338557)throw new Error(_0xe073('0x4c'));if(_0x338557[_0xe073('0x4d')]===_0xe073('0x4a')){var _0x307541=_0x151035[_0xe073('0x4b')]({'plain':!![]});var _0x5626d4=_0xe073('0x4e');return db['UserProfileSection'][_0xe073('0x47')]({'where':{'name':_0x5626d4,'userProfileId':_0x338557['userProfileId']},'raw':!![]})[_0xe073('0x25')](function(_0x202687){if(_0x202687&&_0x202687[_0xe073('0x4f')]===0x0){return db[_0xe073('0x50')]['create']({'name':_0x307541[_0xe073('0x28')],'resourceId':_0x307541['id'],'type':_0x202687[_0xe073('0x28')],'sectionId':_0x202687['id']},{})[_0xe073('0x25')](function(){return _0x151035;});}else{return _0x151035;}})['catch'](function(_0x5503c2){logger[_0xe073('0x51')](_0xe073('0x52'),_0x5503c2);throw _0x5503c2;});}return _0x151035;})[_0xe073('0x25')](respondWithResult(_0x4d5bcd,0xc9))[_0xe073('0x43')](handleError(_0x4d5bcd,null));};exports[_0xe073('0x24')]=function(_0x5212d5,_0x197c42){if(_0x5212d5[_0xe073('0x49')]['id']){delete _0x5212d5[_0xe073('0x49')]['id'];}return db[_0xe073('0x2b')][_0xe073('0x47')]({'where':{'id':_0x5212d5[_0xe073('0x53')]['id']}})[_0xe073('0x25')](handleEntityNotFound(_0x197c42,null))[_0xe073('0x25')](saveUpdates(_0x5212d5[_0xe073('0x49')],null))[_0xe073('0x25')](respondWithResult(_0x197c42,null))['catch'](handleError(_0x197c42,null));};exports[_0xe073('0x26')]=function(_0x582007,_0x5825eb){return db[_0xe073('0x2b')][_0xe073('0x47')]({'where':{'id':_0x582007[_0xe073('0x53')]['id']}})['then'](handleEntityNotFound(_0x5825eb,null))[_0xe073('0x25')](removeEntity(_0x5825eb,null))[_0xe073('0x43')](handleError(_0x5825eb,null));}; \ No newline at end of file +var _0x6737=['error','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','update','then','destroy','get','Tags','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','options','Tag','include','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6737,0xe2));var _0x7673=function(_0x2dead3,_0x24020c){_0x2dead3=_0x2dead3-0x0;var _0x12a04b=_0x6737[_0x2dead3];return _0x12a04b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7673('0x0'));var zipdir=require(_0x7673('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7673('0x2'));var moment=require(_0x7673('0x3'));var BPromise=require(_0x7673('0x4'));var Mustache=require(_0x7673('0x5'));var util=require('util');var path=require(_0x7673('0x6'));var sox=require(_0x7673('0x7'));var csv=require('to-csv');var ejs=require(_0x7673('0x8'));var fs=require('fs');var fs_extra=require(_0x7673('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7673('0xa'));var toCsv=require('to-csv');var querystring=require(_0x7673('0xb'));var Papa=require(_0x7673('0xc'));var Redis=require('ioredis');var authService=require(_0x7673('0xd'));var qs=require(_0x7673('0xe'));var as=require(_0x7673('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7673('0x10'));var utils=require('../../config/utils');var config=require(_0x7673('0x11'));var licenseUtil=require(_0x7673('0x12'));var db=require(_0x7673('0x13'))['db'];function respondWithStatusCode(_0x451c87,_0x41d6bd){_0x41d6bd=_0x41d6bd||0xcc;return function(_0x119e42){if(_0x119e42){return _0x451c87[_0x7673('0x14')](_0x41d6bd);}return _0x451c87[_0x7673('0x15')](_0x41d6bd)[_0x7673('0x16')]();};}function respondWithResult(_0x20a649,_0x5c8626){_0x5c8626=_0x5c8626||0xc8;return function(_0x26f0c4){if(_0x26f0c4){return _0x20a649[_0x7673('0x15')](_0x5c8626)[_0x7673('0x17')](_0x26f0c4);}};}function respondWithFilteredResult(_0x2c83d,_0x224cea){return function(_0x2e83c4){if(_0x2e83c4){var _0x2a2840=typeof _0x224cea['offset']==='undefined'&&typeof _0x224cea[_0x7673('0x18')]===_0x7673('0x19');var _0x50f8d9=_0x2e83c4[_0x7673('0x1a')];var _0x17699a=_0x2a2840?0x0:_0x224cea['offset'];var _0x33ff7d=_0x2a2840?_0x2e83c4[_0x7673('0x1a')]:_0x224cea[_0x7673('0x1b')]+_0x224cea['limit'];var _0x50f22d;if(_0x33ff7d>=_0x50f8d9){_0x33ff7d=_0x50f8d9;_0x50f22d=0xc8;}else{_0x50f22d=0xce;}_0x2c83d[_0x7673('0x15')](_0x50f22d);return _0x2c83d[_0x7673('0x1c')]('Content-Range',_0x17699a+'-'+_0x33ff7d+'/'+_0x50f8d9)[_0x7673('0x17')](_0x2e83c4);}return null;};}function patchUpdates(_0x29bbd9){return function(_0x2e1260){try{jsonpatch[_0x7673('0x1d')](_0x2e1260,_0x29bbd9,!![]);}catch(_0x4245bf){return BPromise[_0x7673('0x1e')](_0x4245bf);}return _0x2e1260['save']();};}function saveUpdates(_0x557161,_0xea9b37){return function(_0x21774f){if(_0x21774f){return _0x21774f[_0x7673('0x1f')](_0x557161)[_0x7673('0x20')](function(_0x16bb16){return _0x16bb16;});}return null;};}function removeEntity(_0x54f38d,_0x2009e1){return function(_0x3b2a75){if(_0x3b2a75){return _0x3b2a75[_0x7673('0x21')]()[_0x7673('0x20')](function(){var _0x132dc6=_0x3b2a75[_0x7673('0x22')]({'plain':!![]});var _0x538280=_0x7673('0x23');return db[_0x7673('0x24')][_0x7673('0x21')]({'where':{'type':_0x538280,'resourceId':_0x132dc6['id']}})[_0x7673('0x20')](function(){return _0x3b2a75;});})['then'](function(){_0x54f38d['status'](0xcc)[_0x7673('0x16')]();});}};}function handleEntityNotFound(_0x11b42b,_0x291d10){return function(_0x9d9eab){if(!_0x9d9eab){_0x11b42b[_0x7673('0x14')](0x194);}return _0x9d9eab;};}function handleError(_0x45a045,_0x442f42){_0x442f42=_0x442f42||0x1f4;return function(_0x5a59f9){logger['error'](_0x5a59f9[_0x7673('0x25')]);if(_0x5a59f9[_0x7673('0x26')]){delete _0x5a59f9[_0x7673('0x26')];}_0x45a045[_0x7673('0x15')](_0x442f42)[_0x7673('0x27')](_0x5a59f9);};}exports[_0x7673('0x28')]=function(_0x224122,_0x4f12b9){var _0x4fcacc={},_0xe7e528={},_0x36c841={'count':0x0,'rows':[]};var _0x268863=_[_0x7673('0x29')](db['Tag'][_0x7673('0x2a')],function(_0x497760){return{'name':_0x497760[_0x7673('0x2b')],'type':_0x497760[_0x7673('0x2c')][_0x7673('0x2d')]};});_0xe7e528[_0x7673('0x2e')]=_[_0x7673('0x29')](_0x268863,_0x7673('0x26'));_0xe7e528[_0x7673('0x2f')]=_[_0x7673('0x30')](_0x224122[_0x7673('0x2f')]);_0xe7e528[_0x7673('0x31')]=_[_0x7673('0x32')](_0xe7e528[_0x7673('0x2e')],_0xe7e528[_0x7673('0x2f')]);_0x4fcacc['attributes']=_[_0x7673('0x32')](_0xe7e528[_0x7673('0x2e')],qs[_0x7673('0x33')](_0x224122[_0x7673('0x2f')][_0x7673('0x33')]));_0x4fcacc[_0x7673('0x34')]=_0x4fcacc[_0x7673('0x34')]['length']?_0x4fcacc['attributes']:_0xe7e528[_0x7673('0x2e')];if(!_0x224122[_0x7673('0x2f')][_0x7673('0x35')](_0x7673('0x36'))){_0x4fcacc[_0x7673('0x18')]=qs[_0x7673('0x18')](_0x224122[_0x7673('0x2f')]['limit']);_0x4fcacc[_0x7673('0x1b')]=qs[_0x7673('0x1b')](_0x224122['query'][_0x7673('0x1b')]);}_0x4fcacc[_0x7673('0x37')]=qs[_0x7673('0x38')](_0x224122[_0x7673('0x2f')]['sort']);_0x4fcacc[_0x7673('0x39')]=qs[_0x7673('0x31')](_['pick'](_0x224122[_0x7673('0x2f')],_0xe7e528[_0x7673('0x31')]),_0x268863);if(_0x224122[_0x7673('0x2f')]['filter']){_0x4fcacc[_0x7673('0x39')]=_[_0x7673('0x3a')](_0x4fcacc[_0x7673('0x39')],{'$or':_['map'](_0x268863,function(_0x4c6106){if(_0x4c6106[_0x7673('0x2c')]!=='VIRTUAL'){var _0x4ba2b4={};_0x4ba2b4[_0x4c6106[_0x7673('0x26')]]={'$like':'%'+_0x224122[_0x7673('0x2f')]['filter']+'%'};return _0x4ba2b4;}})});}_0x4fcacc=_[_0x7673('0x3a')]({},_0x4fcacc,_0x224122[_0x7673('0x3b')]);var _0x2645a2={'where':_0x4fcacc[_0x7673('0x39')]};return db[_0x7673('0x3c')][_0x7673('0x1a')](_0x2645a2)['then'](function(_0x1edb82){_0x36c841['count']=_0x1edb82;if(_0x224122[_0x7673('0x2f')]['includeAll']){_0x4fcacc[_0x7673('0x3d')]=[{'all':!![]}];}return db[_0x7673('0x3c')]['findAll'](_0x4fcacc);})['then'](function(_0x1cac93){_0x36c841['rows']=_0x1cac93;return _0x36c841;})[_0x7673('0x20')](respondWithFilteredResult(_0x4f12b9,_0x4fcacc))[_0x7673('0x3e')](handleError(_0x4f12b9,null));};exports[_0x7673('0x3f')]=function(_0x3b6223,_0x1895df){var _0x545357={'raw':!![],'where':{'id':_0x3b6223[_0x7673('0x40')]['id']}},_0x4ea8b3={};_0x4ea8b3[_0x7673('0x2e')]=_['keys'](db[_0x7673('0x3c')][_0x7673('0x2a')]);_0x4ea8b3[_0x7673('0x2f')]=_['keys'](_0x3b6223[_0x7673('0x2f')]);_0x4ea8b3[_0x7673('0x31')]=_[_0x7673('0x32')](_0x4ea8b3[_0x7673('0x2e')],_0x4ea8b3[_0x7673('0x2f')]);_0x545357[_0x7673('0x34')]=_[_0x7673('0x32')](_0x4ea8b3[_0x7673('0x2e')],qs[_0x7673('0x33')](_0x3b6223['query'][_0x7673('0x33')]));_0x545357[_0x7673('0x34')]=_0x545357[_0x7673('0x34')][_0x7673('0x41')]?_0x545357[_0x7673('0x34')]:_0x4ea8b3[_0x7673('0x2e')];if(_0x3b6223[_0x7673('0x2f')]['includeAll']){_0x545357[_0x7673('0x3d')]=[{'all':!![]}];}_0x545357=_[_0x7673('0x3a')]({},_0x545357,_0x3b6223[_0x7673('0x3b')]);return db[_0x7673('0x3c')][_0x7673('0x42')](_0x545357)['then'](handleEntityNotFound(_0x1895df,null))[_0x7673('0x20')](respondWithResult(_0x1895df,null))[_0x7673('0x3e')](handleError(_0x1895df,null));};exports[_0x7673('0x43')]=function(_0x2397fb,_0x3f76a3){return db['Tag']['create'](_0x2397fb[_0x7673('0x44')],{})[_0x7673('0x20')](function(_0x510960){var _0x2314e7=_0x2397fb[_0x7673('0x45')][_0x7673('0x22')]({'plain':!![]});if(!_0x2314e7)throw new Error(_0x7673('0x46'));if(_0x2314e7[_0x7673('0x47')]==='user'){var _0x23789d=_0x510960[_0x7673('0x22')]({'plain':!![]});var _0x2a275b=_0x7673('0x23');return db['UserProfileSection'][_0x7673('0x42')]({'where':{'name':_0x2a275b,'userProfileId':_0x2314e7[_0x7673('0x48')]},'raw':!![]})[_0x7673('0x20')](function(_0xa93124){if(_0xa93124&&_0xa93124[_0x7673('0x49')]===0x0){return db[_0x7673('0x24')][_0x7673('0x43')]({'name':_0x23789d[_0x7673('0x26')],'resourceId':_0x23789d['id'],'type':_0xa93124[_0x7673('0x26')],'sectionId':_0xa93124['id']},{})[_0x7673('0x20')](function(){return _0x510960;});}else{return _0x510960;}})[_0x7673('0x3e')](function(_0x572119){logger[_0x7673('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x572119);throw _0x572119;});}return _0x510960;})[_0x7673('0x20')](respondWithResult(_0x3f76a3,0xc9))[_0x7673('0x3e')](handleError(_0x3f76a3,null));};exports[_0x7673('0x1f')]=function(_0x523698,_0x185ec5){if(_0x523698[_0x7673('0x44')]['id']){delete _0x523698[_0x7673('0x44')]['id'];}return db[_0x7673('0x3c')][_0x7673('0x42')]({'where':{'id':_0x523698[_0x7673('0x40')]['id']}})[_0x7673('0x20')](handleEntityNotFound(_0x185ec5,null))[_0x7673('0x20')](saveUpdates(_0x523698[_0x7673('0x44')],null))[_0x7673('0x20')](respondWithResult(_0x185ec5,null))[_0x7673('0x3e')](handleError(_0x185ec5,null));};exports[_0x7673('0x21')]=function(_0x9be9a4,_0xb3c9e9){return db['Tag'][_0x7673('0x42')]({'where':{'id':_0x9be9a4['params']['id']}})[_0x7673('0x20')](handleEntityNotFound(_0xb3c9e9,null))[_0x7673('0x20')](removeEntity(_0xb3c9e9,null))[_0x7673('0x3e')](handleError(_0xb3c9e9,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 3f84199..ac8aa86 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 _0x5a12=['Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x34ebc6,_0x201e65){var _0x16f800=function(_0x2c72fc){while(--_0x2c72fc){_0x34ebc6['push'](_0x34ebc6['shift']());}};_0x16f800(++_0x201e65);}(_0x5a12,0x174));var _0x25a1=function(_0x482814,_0x4ab118){_0x482814=_0x482814-0x0;var _0x974619=_0x5a12[_0x482814];return _0x974619;};'use strict';var _=require(_0x25a1('0x0'));var util=require(_0x25a1('0x1'));var logger=require(_0x25a1('0x2'))(_0x25a1('0x3'));var moment=require(_0x25a1('0x4'));var BPromise=require(_0x25a1('0x5'));var rp=require(_0x25a1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x25a1('0x7'));var attributes=require('./tag.attributes');module['exports']=function(_0x4aa0e4,_0x38356d){return _0x4aa0e4['define'](_0x25a1('0x8'),attributes,{'tableName':_0x25a1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa55a=['bluebird','request-promise','path','./tag.attributes','exports','define','Tag','lodash','util','../../config/logger','api'];(function(_0x24f326,_0x616a7){var _0x488e2d=function(_0x293d9a){while(--_0x293d9a){_0x24f326['push'](_0x24f326['shift']());}};_0x488e2d(++_0x616a7);}(_0xa55a,0x1b4));var _0xaa55=function(_0x4686b0,_0x3deb72){_0x4686b0=_0x4686b0-0x0;var _0x295e83=_0xa55a[_0x4686b0];return _0x295e83;};'use strict';var _=require(_0xaa55('0x0'));var util=require(_0xaa55('0x1'));var logger=require(_0xaa55('0x2'))(_0xaa55('0x3'));var moment=require('moment');var BPromise=require(_0xaa55('0x4'));var rp=require(_0xaa55('0x5'));var fs=require('fs');var path=require(_0xaa55('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaa55('0x7'));module[_0xaa55('0x8')]=function(_0x21eb46,_0x556432){return _0x21eb46[_0xaa55('0x9')](_0xaa55('0xa'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 9dbf1ef..7a1ba7e 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 _0x98d3=['client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise'];(function(_0x34d2e8,_0xd2b16f){var _0x1f1f1c=function(_0x5d9e57){while(--_0x5d9e57){_0x34d2e8['push'](_0x34d2e8['shift']());}};_0x1f1f1c(++_0xd2b16f);}(_0x98d3,0x173));var _0x398d=function(_0x37d984,_0x320af8){_0x37d984=_0x37d984-0x0;var _0x571c49=_0x98d3[_0x37d984];return _0x571c49;};'use strict';var _=require(_0x398d('0x0'));var util=require(_0x398d('0x1'));var moment=require('moment');var BPromise=require(_0x398d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x398d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x398d('0x4'));var logger=require(_0x398d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x398d('0x6'));var client=jayson[_0x398d('0x7')][_0x398d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x502652,_0x4ba1a3,_0x391d99){return new BPromise(function(_0x3029f3,_0x399598){return client[_0x398d('0x9')](_0x502652,_0x391d99)['then'](function(_0x3a1934){logger[_0x398d('0xa')](_0x398d('0xb'),_0x4ba1a3,_0x398d('0xc'));logger[_0x398d('0xd')](_0x398d('0xe'),_0x4ba1a3,_0x398d('0xc'),JSON[_0x398d('0xf')](_0x3a1934));if(_0x3a1934['error']){if(_0x3a1934[_0x398d('0x10')][_0x398d('0x11')]===0x1f4){logger[_0x398d('0x10')](_0x398d('0xb'),_0x4ba1a3,_0x3a1934[_0x398d('0x10')][_0x398d('0x12')]);return _0x399598(_0x3a1934[_0x398d('0x10')][_0x398d('0x12')]);}logger[_0x398d('0x10')](_0x398d('0xb'),_0x4ba1a3,_0x3a1934[_0x398d('0x10')]['message']);return _0x3029f3(_0x3a1934['error'][_0x398d('0x12')]);}else{logger[_0x398d('0xa')](_0x398d('0xb'),_0x4ba1a3,_0x398d('0xc'));_0x3029f3(_0x3a1934[_0x398d('0x13')][_0x398d('0x12')]);}})[_0x398d('0x14')](function(_0x3c151a){logger['error'](_0x398d('0xb'),_0x4ba1a3,_0x3c151a);_0x399598(_0x3c151a);});});} \ No newline at end of file +var _0xad8a=['../../config/environment','jayson/promise','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x26f6b9,_0x46e36e){var _0x3815b1=function(_0x35df0a){while(--_0x35df0a){_0x26f6b9['push'](_0x26f6b9['shift']());}};_0x3815b1(++_0x46e36e);}(_0xad8a,0xb0));var _0xaad8=function(_0xa23d93,_0x4d8a82){_0xa23d93=_0xa23d93-0x0;var _0x5c4ba8=_0xad8a[_0xa23d93];return _0x5c4ba8;};'use strict';var _=require(_0xaad8('0x0'));var util=require(_0xaad8('0x1'));var moment=require(_0xaad8('0x2'));var BPromise=require(_0xaad8('0x3'));var rs=require(_0xaad8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaad8('0x5'))['db'];var utils=require(_0xaad8('0x6'));var logger=require(_0xaad8('0x7'))('rpc');var config=require(_0xaad8('0x8'));var jayson=require(_0xaad8('0x9'));var client=jayson[_0xaad8('0xa')][_0xaad8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x95aef9,_0x39c599,_0x28f3a1){return new BPromise(function(_0xf3a6c7,_0x11408a){return client[_0xaad8('0xc')](_0x95aef9,_0x28f3a1)['then'](function(_0x52477f){logger[_0xaad8('0xd')](_0xaad8('0xe'),_0x39c599,_0xaad8('0xf'));logger[_0xaad8('0x10')](_0xaad8('0x11'),_0x39c599,_0xaad8('0xf'),JSON[_0xaad8('0x12')](_0x52477f));if(_0x52477f[_0xaad8('0x13')]){if(_0x52477f[_0xaad8('0x13')]['code']===0x1f4){logger[_0xaad8('0x13')](_0xaad8('0xe'),_0x39c599,_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);return _0x11408a(_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);}logger[_0xaad8('0x13')](_0xaad8('0xe'),_0x39c599,_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);return _0xf3a6c7(_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);}else{logger[_0xaad8('0xd')]('Tag,\x20%s,\x20%s',_0x39c599,_0xaad8('0xf'));_0xf3a6c7(_0x52477f[_0xaad8('0x15')]['message']);}})[_0xaad8('0x16')](function(_0x2a8e12){logger[_0xaad8('0x13')](_0xaad8('0xe'),_0x39c599,_0x2a8e12);_0x11408a(_0x2a8e12);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index be7d888..f5dbfd0 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index cc55992..9d97a38 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 _0xd8b0=['exports','sequelize'];(function(_0x133e8b,_0x4c5680){var _0x51e89d=function(_0x421586){while(--_0x421586){_0x133e8b['push'](_0x133e8b['shift']());}};_0x51e89d(++_0x4c5680);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x251e8c,_0x277c33){var _0x1e0c1d=function(_0x20b89c){while(--_0x20b89c){_0x251e8c['push'](_0x251e8c['shift']());}};_0x1e0c1d(++_0x277c33);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'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 b7baf43..5c3b5fc 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 _0xbafc=['Queue','capitalize','Queues','addQueues','add','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Openchannel','Whatsapp','through','penalty','defaults','TeamVoiceQueue','Queue:save','QueueId','User','findAll','interface','upsert','isNil','format','SIP/%s','all','VoicePrefixId','spread','removeAgents','Sms','Fax','emit','Queue:remove','UserVoiceQueueRt','getAgents','nolimit','eml-format','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','error','stack','name','send','map','rawAttributes','fieldName','type','query','filters','model','fields','attributes','length','order','sort','where','pick','merge','VIRTUAL','filter','options','Team','then','includeAll','include','rows','catch','show','params','keys','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','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','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','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','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase'];(function(_0x25196f,_0x4d0954){var _0x20e7f2=function(_0x169e23){while(--_0x169e23){_0x25196f['push'](_0x25196f['shift']());}};_0x20e7f2(++_0x4d0954);}(_0xbafc,0xc2));var _0xcbaf=function(_0x42f3a5,_0x3a4470){_0x42f3a5=_0x42f3a5-0x0;var _0x1a7d74=_0xbafc[_0x42f3a5];return _0x1a7d74;};'use strict';var emlformat=require(_0xcbaf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcbaf('0x1'));var BPromise=require(_0xcbaf('0x2'));var Mustache=require(_0xcbaf('0x3'));var util=require(_0xcbaf('0x4'));var path=require('path');var sox=require(_0xcbaf('0x5'));var csv=require(_0xcbaf('0x6'));var ejs=require(_0xcbaf('0x7'));var fs=require('fs');var fs_extra=require(_0xcbaf('0x8'));var _=require(_0xcbaf('0x9'));var squel=require(_0xcbaf('0xa'));var crypto=require(_0xcbaf('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcbaf('0x6'));var querystring=require(_0xcbaf('0xc'));var Papa=require(_0xcbaf('0xd'));var Redis=require(_0xcbaf('0xe'));var authService=require(_0xcbaf('0xf'));var qs=require(_0xcbaf('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbaf('0x11'))('api');var utils=require(_0xcbaf('0x12'));var config=require(_0xcbaf('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbaf('0x14'))['db'];config[_0xcbaf('0x15')]=_['defaults'](config[_0xcbaf('0x15')],{'host':_0xcbaf('0x16'),'port':0x18eb});var socket=require(_0xcbaf('0x17'))(new Redis(config[_0xcbaf('0x15')]));require('./team.socket')[_0xcbaf('0x18')](socket);function respondWithStatusCode(_0x29cab9,_0x1675de){_0x1675de=_0x1675de||0xcc;return function(_0x10fbc3){if(_0x10fbc3){return _0x29cab9[_0xcbaf('0x19')](_0x1675de);}return _0x29cab9['status'](_0x1675de)['end']();};}function respondWithResult(_0x5dc1e5,_0x4cb65e){_0x4cb65e=_0x4cb65e||0xc8;return function(_0x314a69){if(_0x314a69){return _0x5dc1e5[_0xcbaf('0x1a')](_0x4cb65e)[_0xcbaf('0x1b')](_0x314a69);}};}function respondWithFilteredResult(_0x3d0d89,_0x4dd6b4){return function(_0x4c44cb){if(_0x4c44cb){var _0x2afaf7=typeof _0x4dd6b4['offset']===_0xcbaf('0x1c')&&typeof _0x4dd6b4[_0xcbaf('0x1d')]==='undefined';var _0x4e1703=_0x4c44cb[_0xcbaf('0x1e')];var _0x15cba6=_0x2afaf7?0x0:_0x4dd6b4[_0xcbaf('0x1f')];var _0x25510b=_0x2afaf7?_0x4c44cb['count']:_0x4dd6b4[_0xcbaf('0x1f')]+_0x4dd6b4[_0xcbaf('0x1d')];var _0xe9a31a;if(_0x25510b>=_0x4e1703){_0x25510b=_0x4e1703;_0xe9a31a=0xc8;}else{_0xe9a31a=0xce;}_0x3d0d89[_0xcbaf('0x1a')](_0xe9a31a);return _0x3d0d89[_0xcbaf('0x20')](_0xcbaf('0x21'),_0x15cba6+'-'+_0x25510b+'/'+_0x4e1703)[_0xcbaf('0x1b')](_0x4c44cb);}return null;};}function patchUpdates(_0x59c09a){return function(_0x473562){try{jsonpatch[_0xcbaf('0x22')](_0x473562,_0x59c09a,!![]);}catch(_0x2c9d13){return BPromise[_0xcbaf('0x23')](_0x2c9d13);}return _0x473562[_0xcbaf('0x24')]();};}function saveUpdates(_0x4d51f0,_0x2f0e88){return function(_0x6cc004){if(_0x6cc004){return _0x6cc004['update'](_0x4d51f0)['then'](function(_0x281640){return _0x281640;});}return null;};}function handleEntityNotFound(_0x56169a,_0x3321fe){return function(_0x2b2494){if(!_0x2b2494){_0x56169a[_0xcbaf('0x19')](0x194);}return _0x2b2494;};}function handleError(_0x5951a1,_0x48212d){_0x48212d=_0x48212d||0x1f4;return function(_0x3035e5){logger[_0xcbaf('0x25')](_0x3035e5[_0xcbaf('0x26')]);if(_0x3035e5[_0xcbaf('0x27')]){delete _0x3035e5[_0xcbaf('0x27')];}_0x5951a1[_0xcbaf('0x1a')](_0x48212d)[_0xcbaf('0x28')](_0x3035e5);};}exports['index']=function(_0x1401fc,_0x1ed443){var _0x975c03={},_0x281836={},_0x220279={'count':0x0,'rows':[]};var _0x16a81f=_[_0xcbaf('0x29')](db['Team'][_0xcbaf('0x2a')],function(_0x5a5a6f){return{'name':_0x5a5a6f[_0xcbaf('0x2b')],'type':_0x5a5a6f[_0xcbaf('0x2c')]['key']};});_0x281836['model']=_['map'](_0x16a81f,_0xcbaf('0x27'));_0x281836[_0xcbaf('0x2d')]=_['keys'](_0x1401fc['query']);_0x281836[_0xcbaf('0x2e')]=_['intersection'](_0x281836[_0xcbaf('0x2f')],_0x281836['query']);_0x975c03['attributes']=_['intersection'](_0x281836[_0xcbaf('0x2f')],qs[_0xcbaf('0x30')](_0x1401fc[_0xcbaf('0x2d')]['fields']));_0x975c03[_0xcbaf('0x31')]=_0x975c03['attributes'][_0xcbaf('0x32')]?_0x975c03['attributes']:_0x281836[_0xcbaf('0x2f')];if(!_0x1401fc[_0xcbaf('0x2d')]['hasOwnProperty']('nolimit')){_0x975c03[_0xcbaf('0x1d')]=qs['limit'](_0x1401fc[_0xcbaf('0x2d')][_0xcbaf('0x1d')]);_0x975c03[_0xcbaf('0x1f')]=qs[_0xcbaf('0x1f')](_0x1401fc['query'][_0xcbaf('0x1f')]);}_0x975c03[_0xcbaf('0x33')]=qs['sort'](_0x1401fc['query'][_0xcbaf('0x34')]);_0x975c03[_0xcbaf('0x35')]=qs['filters'](_[_0xcbaf('0x36')](_0x1401fc[_0xcbaf('0x2d')],_0x281836[_0xcbaf('0x2e')]),_0x16a81f);if(_0x1401fc['query']['filter']){_0x975c03['where']=_[_0xcbaf('0x37')](_0x975c03[_0xcbaf('0x35')],{'$or':_[_0xcbaf('0x29')](_0x16a81f,function(_0x191eea){if(_0x191eea[_0xcbaf('0x2c')]!==_0xcbaf('0x38')){var _0x2d5d99={};_0x2d5d99[_0x191eea[_0xcbaf('0x27')]]={'$like':'%'+_0x1401fc['query'][_0xcbaf('0x39')]+'%'};return _0x2d5d99;}})});}_0x975c03=_[_0xcbaf('0x37')]({},_0x975c03,_0x1401fc[_0xcbaf('0x3a')]);var _0x386a4c={'where':_0x975c03[_0xcbaf('0x35')]};return db[_0xcbaf('0x3b')][_0xcbaf('0x1e')](_0x386a4c)[_0xcbaf('0x3c')](function(_0x2a6c05){_0x220279[_0xcbaf('0x1e')]=_0x2a6c05;if(_0x1401fc[_0xcbaf('0x2d')][_0xcbaf('0x3d')]){_0x975c03[_0xcbaf('0x3e')]=[{'all':!![]}];}return db['Team']['findAll'](_0x975c03);})[_0xcbaf('0x3c')](function(_0xcdc075){_0x220279[_0xcbaf('0x3f')]=_0xcdc075;return _0x220279;})['then'](respondWithFilteredResult(_0x1ed443,_0x975c03))[_0xcbaf('0x40')](handleError(_0x1ed443,null));};exports[_0xcbaf('0x41')]=function(_0x422185,_0x1d03f6){var _0x365d0f={'raw':![],'where':{'id':_0x422185[_0xcbaf('0x42')]['id']}},_0x5af5cd={};_0x5af5cd[_0xcbaf('0x2f')]=_[_0xcbaf('0x43')](db['Team'][_0xcbaf('0x2a')]);_0x5af5cd[_0xcbaf('0x2d')]=_[_0xcbaf('0x43')](_0x422185[_0xcbaf('0x2d')]);_0x5af5cd[_0xcbaf('0x2e')]=_['intersection'](_0x5af5cd['model'],_0x5af5cd[_0xcbaf('0x2d')]);_0x365d0f[_0xcbaf('0x31')]=_[_0xcbaf('0x44')](_0x5af5cd[_0xcbaf('0x2f')],qs[_0xcbaf('0x30')](_0x422185['query']['fields']));_0x365d0f[_0xcbaf('0x31')]=_0x365d0f['attributes'][_0xcbaf('0x32')]?_0x365d0f[_0xcbaf('0x31')]:_0x5af5cd[_0xcbaf('0x2f')];if(_0x422185[_0xcbaf('0x2d')][_0xcbaf('0x3d')]){_0x365d0f[_0xcbaf('0x3e')]=[{'all':!![]}];}_0x365d0f=_[_0xcbaf('0x37')]({},_0x365d0f,_0x422185[_0xcbaf('0x3a')]);return db[_0xcbaf('0x3b')][_0xcbaf('0x45')](_0x365d0f)[_0xcbaf('0x3c')](handleEntityNotFound(_0x1d03f6,null))['then'](respondWithResult(_0x1d03f6,null))[_0xcbaf('0x40')](handleError(_0x1d03f6,null));};exports[_0xcbaf('0x46')]=function(_0x29f533,_0x23754c){return db[_0xcbaf('0x3b')][_0xcbaf('0x46')](_0x29f533[_0xcbaf('0x47')],{})[_0xcbaf('0x3c')](function(_0x5201b8){var _0x2a3a2a=_0x29f533[_0xcbaf('0x48')][_0xcbaf('0x49')]({'plain':!![]});if(!_0x2a3a2a)throw new Error(_0xcbaf('0x4a'));if(_0x2a3a2a[_0xcbaf('0x4b')]===_0xcbaf('0x48')){var _0x55d039=_0x5201b8['get']({'plain':!![]});var _0x251d2b=_0xcbaf('0x4c');return db[_0xcbaf('0x4d')][_0xcbaf('0x45')]({'where':{'name':_0x251d2b,'userProfileId':_0x2a3a2a[_0xcbaf('0x4e')]},'raw':!![]})[_0xcbaf('0x3c')](function(_0x42df88){if(_0x42df88&&_0x42df88[_0xcbaf('0x4f')]===0x0){return db[_0xcbaf('0x50')][_0xcbaf('0x46')]({'name':_0x55d039[_0xcbaf('0x27')],'resourceId':_0x55d039['id'],'type':_0x42df88[_0xcbaf('0x27')],'sectionId':_0x42df88['id']},{})[_0xcbaf('0x3c')](function(){return _0x5201b8;});}else{return _0x5201b8;}})[_0xcbaf('0x40')](function(_0x170062){logger[_0xcbaf('0x25')](_0xcbaf('0x51'),_0x170062);throw _0x170062;});}return _0x5201b8;})[_0xcbaf('0x3c')](respondWithResult(_0x23754c,0xc9))['catch'](handleError(_0x23754c,null));};exports[_0xcbaf('0x52')]=function(_0x433995,_0x5aa9e3){if(_0x433995[_0xcbaf('0x47')]['id']){delete _0x433995[_0xcbaf('0x47')]['id'];}return db[_0xcbaf('0x3b')]['find']({'where':{'id':_0x433995['params']['id']}})[_0xcbaf('0x3c')](handleEntityNotFound(_0x5aa9e3,null))[_0xcbaf('0x3c')](saveUpdates(_0x433995[_0xcbaf('0x47')],null))[_0xcbaf('0x3c')](respondWithResult(_0x5aa9e3,null))[_0xcbaf('0x40')](handleError(_0x5aa9e3,null));};exports[_0xcbaf('0x53')]=function(_0x5e0889,_0x104396){var _0x291fe7=_0x5e0889[_0xcbaf('0x42')]['id'];var _0x6104b6=[];return db[_0xcbaf('0x54')][_0xcbaf('0x55')](function(_0x28db15){var _0x3ea73b=_0xcbaf('0x56')+_0x291fe7;return db[_0xcbaf('0x54')][_0xcbaf('0x2d')](_0x3ea73b,{'type':db[_0xcbaf('0x57')][_0xcbaf('0x58')][_0xcbaf('0x59')],'raw':!![],'transaction':_0x28db15})[_0xcbaf('0x3c')](function(_0x353440){_0x6104b6=_['map'](_0x353440,function(_0x24207f){return Number(_0x24207f[_0xcbaf('0x5a')]);});})['then'](function(){var _0x2601c6=_0xcbaf('0x5b')+_0x291fe7;return db[_0xcbaf('0x54')][_0xcbaf('0x2d')](_0x2601c6,{'type':db[_0xcbaf('0x57')][_0xcbaf('0x58')][_0xcbaf('0x59')],'raw':!![],'transaction':_0x28db15});})[_0xcbaf('0x3c')](function(_0x1fb83a){var _0x37b53e=_[_0xcbaf('0x29')](_0x1fb83a,function(_0x313385){return Number(_0x313385[_0xcbaf('0x5c')]);});return db[_0xcbaf('0x5d')][_0xcbaf('0x53')]({'where':{'UserId':{'$in':_0x6104b6},'VoiceQueueId':{'$in':_0x37b53e}},'transaction':_0x28db15});})[_0xcbaf('0x3c')](function(){var _0xa1250f=_0xcbaf('0x5e')+_0x291fe7;return db['sequelize'][_0xcbaf('0x2d')](_0xa1250f,{'type':db[_0xcbaf('0x57')][_0xcbaf('0x58')]['SELECT'],'raw':!![],'transaction':_0x28db15});})[_0xcbaf('0x3c')](function(_0x1be028){var _0x5e50fb=_[_0xcbaf('0x29')](_0x1be028,function(_0x3cbfa2){return Number(_0x3cbfa2['MailQueueId']);});return db[_0xcbaf('0x5f')][_0xcbaf('0x53')]({'where':{'UserId':{'$in':_0x6104b6},'MailQueueId':{'$in':_0x5e50fb}},'transaction':_0x28db15});})[_0xcbaf('0x3c')](function(){var _0x4c540b=_0xcbaf('0x60')+_0x291fe7;return db[_0xcbaf('0x54')][_0xcbaf('0x2d')](_0x4c540b,{'type':db[_0xcbaf('0x57')][_0xcbaf('0x58')][_0xcbaf('0x59')],'raw':!![],'transaction':_0x28db15});})[_0xcbaf('0x3c')](function(_0xa3e78c){var _0x2a446f=_[_0xcbaf('0x29')](_0xa3e78c,function(_0x37c7ed){return Number(_0x37c7ed[_0xcbaf('0x61')]);});return db[_0xcbaf('0x62')][_0xcbaf('0x53')]({'where':{'UserId':{'$in':_0x6104b6},'SmsQueueId':{'$in':_0x2a446f}},'transaction':_0x28db15});})[_0xcbaf('0x3c')](function(){var _0x11ed3f='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x291fe7;return db[_0xcbaf('0x54')][_0xcbaf('0x2d')](_0x11ed3f,{'type':db[_0xcbaf('0x57')][_0xcbaf('0x58')]['SELECT'],'raw':!![],'transaction':_0x28db15});})[_0xcbaf('0x3c')](function(_0x53eef9){var _0x348334=_[_0xcbaf('0x29')](_0x53eef9,function(_0x468e83){return Number(_0x468e83[_0xcbaf('0x63')]);});return db[_0xcbaf('0x64')]['destroy']({'where':{'UserId':{'$in':_0x6104b6},'ChatQueueId':{'$in':_0x348334}},'transaction':_0x28db15});})['then'](function(){var _0x5d1133=_0xcbaf('0x65')+_0x291fe7;return db[_0xcbaf('0x54')][_0xcbaf('0x2d')](_0x5d1133,{'type':db[_0xcbaf('0x57')][_0xcbaf('0x58')][_0xcbaf('0x59')],'raw':!![],'transaction':_0x28db15});})[_0xcbaf('0x3c')](function(_0x570d31){var _0x536692=_[_0xcbaf('0x29')](_0x570d31,function(_0x529481){return Number(_0x529481[_0xcbaf('0x66')]);});return db['UserFaxQueue'][_0xcbaf('0x53')]({'where':{'UserId':{'$in':_0x6104b6},'FaxQueueId':{'$in':_0x536692}},'transaction':_0x28db15});})[_0xcbaf('0x3c')](function(){var _0x51cc8a=_0xcbaf('0x67')+_0x291fe7;return db[_0xcbaf('0x54')][_0xcbaf('0x2d')](_0x51cc8a,{'type':db[_0xcbaf('0x57')][_0xcbaf('0x58')][_0xcbaf('0x59')],'raw':!![],'transaction':_0x28db15});})[_0xcbaf('0x3c')](function(_0x4ab9dc){var _0x367257=_['map'](_0x4ab9dc,function(_0x48ccef){return Number(_0x48ccef[_0xcbaf('0x68')]);});return db['UserOpenchannelQueue'][_0xcbaf('0x53')]({'where':{'UserId':{'$in':_0x6104b6},'OpenchannelQueueId':{'$in':_0x367257}},'transaction':_0x28db15});})[_0xcbaf('0x3c')](function(){var _0x32007d=_0xcbaf('0x69')+_0x291fe7;return db[_0xcbaf('0x54')][_0xcbaf('0x2d')](_0x32007d,{'type':db[_0xcbaf('0x57')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x28db15});})['then'](function(_0x190d7e){var _0x43be45=_[_0xcbaf('0x29')](_0x190d7e,function(_0x48966e){return Number(_0x48966e[_0xcbaf('0x6a')]);});return db[_0xcbaf('0x6b')][_0xcbaf('0x53')]({'where':{'UserId':{'$in':_0x6104b6},'WhatsappQueueId':{'$in':_0x43be45}},'transaction':_0x28db15});})['then'](function(){return db[_0xcbaf('0x6c')][_0xcbaf('0x45')]({'where':{'TeamId':_0x291fe7}});})[_0xcbaf('0x3c')](function(_0x16cc39){if(_0x16cc39===null){return;}return db['UserVoicePrefix'][_0xcbaf('0x53')]({'where':{'UserId':{'$in':_0x6104b6},'VoicePrefixId':_0x16cc39['VoicePrefixId']},'transaction':_0x28db15});})[_0xcbaf('0x3c')](function(){return db[_0xcbaf('0x3b')][_0xcbaf('0x53')]({'where':{'id':_0x291fe7},'cascade':!![],'transaction':_0x28db15});})[_0xcbaf('0x3c')](function(_0x567eff){if(_0x567eff===0x0){_0x104396[_0xcbaf('0x19')](0x194);}else{return db['UserProfileResource'][_0xcbaf('0x53')]({'where':{'type':_0xcbaf('0x4c'),'resourceId':_0x291fe7},'cascade':!![],'transaction':_0x28db15})['then'](function(){_0x104396['status'](0xcc)['end']();});}})[_0xcbaf('0x40')](function(_0x561bf3){_0x104396['status'](0x1f4)['send'](_0x561bf3);});});};exports[_0xcbaf('0x6d')]=function(_0x5925d4,_0x39f8d4,_0x178845){return db['Team'][_0xcbaf('0x6e')]({'where':{'id':_0x5925d4['params']['id']}})[_0xcbaf('0x3c')](handleEntityNotFound(_0x39f8d4,null))[_0xcbaf('0x3c')](function(_0x494e54){if(!_0x5925d4[_0xcbaf('0x2d')][_0xcbaf('0x6f')]||!utils[_0xcbaf('0x70')](_0x5925d4[_0xcbaf('0x2d')]['channel'])){throw new db[(_0xcbaf('0x57'))][(_0xcbaf('0x71'))](_0xcbaf('0x72'));}var _0xbeb7e={};var _0x3c1666={};_0x3c1666[_0xcbaf('0x2f')]=_[_0xcbaf('0x43')](db[_['capitalize'](_0x5925d4[_0xcbaf('0x2d')][_0xcbaf('0x6f')][_0xcbaf('0x73')]())+_0xcbaf('0x74')][_0xcbaf('0x2a')]);_0x3c1666[_0xcbaf('0x2d')]=_[_0xcbaf('0x43')](_0x5925d4['query']);_0x3c1666[_0xcbaf('0x2e')]=_[_0xcbaf('0x44')](_0x3c1666['model'],_0x3c1666[_0xcbaf('0x2d')]);_0xbeb7e[_0xcbaf('0x31')]=_[_0xcbaf('0x44')](_0x3c1666[_0xcbaf('0x2f')],qs['fields'](_0x5925d4[_0xcbaf('0x2d')][_0xcbaf('0x30')]));_0xbeb7e[_0xcbaf('0x31')]=_0xbeb7e[_0xcbaf('0x31')][_0xcbaf('0x32')]?_0xbeb7e['attributes']:_0x3c1666[_0xcbaf('0x2f')];_0xbeb7e[_0xcbaf('0x1d')]=qs[_0xcbaf('0x1d')](_0x5925d4[_0xcbaf('0x2d')][_0xcbaf('0x1d')]);_0xbeb7e[_0xcbaf('0x1f')]=qs[_0xcbaf('0x1f')](_0x5925d4[_0xcbaf('0x2d')][_0xcbaf('0x1f')]);_0xbeb7e['order']=qs[_0xcbaf('0x34')](_0x5925d4[_0xcbaf('0x2d')][_0xcbaf('0x34')]);_0xbeb7e[_0xcbaf('0x35')]=qs[_0xcbaf('0x2e')](_[_0xcbaf('0x36')](_0x5925d4[_0xcbaf('0x2d')],_0x3c1666[_0xcbaf('0x2e')]));_0xbeb7e=_[_0xcbaf('0x37')]({},_0xbeb7e,_0x5925d4[_0xcbaf('0x3a')]);return _0x494e54[_0xcbaf('0x49')+_[_0xcbaf('0x75')](_0x5925d4[_0xcbaf('0x2d')][_0xcbaf('0x6f')][_0xcbaf('0x73')]())+_0xcbaf('0x76')](_0xbeb7e);})[_0xcbaf('0x3c')](respondWithResult(_0x39f8d4,null))['catch'](handleError(_0x39f8d4,null));};exports[_0xcbaf('0x77')]=function(_0x53575d,_0x32bd5b,_0x213e25){return db['Team'][_0xcbaf('0x6e')]({'where':{'id':_0x53575d[_0xcbaf('0x42')]['id']}})[_0xcbaf('0x3c')](function(_0x26a94d){if(_0x26a94d){if(!_0x53575d[_0xcbaf('0x47')][_0xcbaf('0x6f')]||!utils[_0xcbaf('0x70')](_0x53575d[_0xcbaf('0x47')][_0xcbaf('0x6f')])){throw new db[(_0xcbaf('0x57'))][(_0xcbaf('0x71'))](_0xcbaf('0x72'));}return _0x26a94d[_0xcbaf('0x78')+_['capitalize'](_0x53575d[_0xcbaf('0x47')][_0xcbaf('0x6f')][_0xcbaf('0x73')]())+_0xcbaf('0x76')](_0x53575d[_0xcbaf('0x47')][_0xcbaf('0x79')]);}return null;})[_0xcbaf('0x3c')](handleEntityNotFound(_0x32bd5b,null))[_0xcbaf('0x3c')](respondWithStatusCode(_0x32bd5b,null))[_0xcbaf('0x40')](handleError(_0x32bd5b,null));};exports[_0xcbaf('0x7a')]=function(_0x53485b,_0x3caf5c,_0x3a9d8e){return db['Team']['findOne']({'where':{'id':_0x53485b[_0xcbaf('0x42')]['id']}})[_0xcbaf('0x3c')](function(_0x4ec083){if(_0x4ec083){if(!_0x53485b[_0xcbaf('0x2d')]['channel']||!utils['isValidChannel'](_0x53485b[_0xcbaf('0x2d')]['channel'])){throw new db[(_0xcbaf('0x57'))]['ValidationError']('Unknown\x20channel');}return _0x4ec083[_0xcbaf('0x7b')+_[_0xcbaf('0x75')](_0x53485b[_0xcbaf('0x2d')][_0xcbaf('0x6f')]['toLowerCase']())+_0xcbaf('0x76')](_0x53485b[_0xcbaf('0x2d')][_0xcbaf('0x79')]);}return null;})['then'](handleEntityNotFound(_0x3caf5c,null))[_0xcbaf('0x3c')](respondWithStatusCode(_0x3caf5c,null))['catch'](handleError(_0x3caf5c,null));};exports[_0xcbaf('0x7c')]=function(_0x2028bb,_0x35258f){var _0x52c2c8=_[_0xcbaf('0x7d')](_0x2028bb[_0xcbaf('0x47')][_0xcbaf('0x79')])?_0x2028bb[_0xcbaf('0x47')][_0xcbaf('0x79')]:[_0x2028bb[_0xcbaf('0x47')][_0xcbaf('0x79')]];var _0x25ffec=_0x2028bb[_0xcbaf('0x42')]['id'];return db[_0xcbaf('0x3b')][_0xcbaf('0x45')]({'where':{'id':_0x25ffec}})['then'](handleEntityNotFound(_0x35258f,null))[_0xcbaf('0x3c')](function(_0x1c5dc0){if(_0x1c5dc0){var _0x49ef71=[_0xcbaf('0x7e'),_0xcbaf('0x7f'),_0xcbaf('0x80'),'Sms','Fax',_0xcbaf('0x81'),_0xcbaf('0x82')];return db[_0xcbaf('0x54')][_0xcbaf('0x55')](function(_0x454ac2){var _0x28283e=_[_0xcbaf('0x29')](_0x49ef71,function(_0xd65157){var _0x35947a={'attributes':['id',_0xcbaf('0x27')]};if(_0xd65157===_0xcbaf('0x7e')){_0x35947a[_0xcbaf('0x83')]={'attributes':[_0xcbaf('0x84')]};}return _0x1c5dc0['get'+_0xd65157+_0xcbaf('0x76')](_0x35947a)[_0xcbaf('0x3c')](function(_0x4ca9e4){var _0x4373de=_[_0xcbaf('0x29')](_0x4ca9e4,function(_0x4bd376){var _0x203cbb=_[_0xcbaf('0x29')](_0x52c2c8,function(_0x101855){var _0x5ac563={'where':{'UserId':_0x101855,[_0xd65157+'QueueId']:_0x4bd376['id']},'transaction':_0x454ac2};if(_0xd65157==='Voice'){_0x5ac563[_0xcbaf('0x85')]={'penalty':_0x4bd376[_0xcbaf('0x86')][_0xcbaf('0x84')]};}return db['User'+_0xd65157+_0xcbaf('0x74')]['findOrCreate'](_0x5ac563)[_0xcbaf('0x3c')](function(){socket['emit'](_0xcbaf('0x48')+_0xd65157+_0xcbaf('0x87'),{'UserId':_0x101855,[_0xd65157+_0xcbaf('0x88')]:_0x4bd376['id']});if(_0xd65157!==_0xcbaf('0x7e')){return;}return db[_0xcbaf('0x89')][_0xcbaf('0x8a')]({'where':{'id':_0x52c2c8,'online':0x1},'attributes':['id','name','online','voicePause',_0xcbaf('0x8b')],'raw':!![]})[_0xcbaf('0x3c')](function(_0x15b664){var _0x8c09f2=_[_0xcbaf('0x29')](_0x15b664,function(_0x54a220){return db['UserVoiceQueueRt'][_0xcbaf('0x8c')]({'membername':_0x54a220[_0xcbaf('0x27')],'UserId':_0x54a220['id'],'queue_name':_0x4bd376[_0xcbaf('0x27')],'VoiceQueueId':_0x4bd376['id'],'interface':_[_0xcbaf('0x8d')](_0x54a220[_0xcbaf('0x8b')])?util[_0xcbaf('0x8e')](_0xcbaf('0x8f'),_0x54a220['name']):_0x54a220['interface'],'paused':_0x54a220['voicePause']||![],'penalty':_0x4bd376[_0xcbaf('0x86')]['penalty']},{'transaction':_0x454ac2});});return Promise[_0xcbaf('0x90')](_0x8c09f2);});});});return Promise[_0xcbaf('0x90')](_0x203cbb);});return Promise[_0xcbaf('0x90')](_0x4373de);})[_0xcbaf('0x3c')](function(){return db[_0xcbaf('0x6c')][_0xcbaf('0x6e')]({'where':{'teamId':_0x25ffec}})[_0xcbaf('0x3c')](function(_0x10510b){if(_0x10510b){var _0x8e4090=_[_0xcbaf('0x29')](_0x52c2c8,function(_0x439696){db['UserVoicePrefix'][_0xcbaf('0x8c')]({'UserId':_0x439696,'VoicePrefixId':_0x10510b[_0xcbaf('0x91')]});});return Promise[_0xcbaf('0x90')](_0x8e4090);}});});});return Promise['all'](_0x28283e)[_0xcbaf('0x3c')](function(){return _0x1c5dc0['addAgents'](_0x52c2c8,{'transaction':_0x454ac2})[_0xcbaf('0x92')](function(_0x4500af){return _0x4500af;});});});}})[_0xcbaf('0x3c')](respondWithResult(_0x35258f,null))[_0xcbaf('0x40')](handleError(_0x35258f,null));};exports[_0xcbaf('0x93')]=function(_0x19928c,_0x522810){var _0x2d5234=_[_0xcbaf('0x7d')](_0x19928c['query']['ids'])?_0x19928c['query']['ids']:[_0x19928c[_0xcbaf('0x2d')][_0xcbaf('0x79')]];var _0x2f5caf=_0x19928c[_0xcbaf('0x42')]['id'];return db[_0xcbaf('0x3b')]['find']({'where':{'id':_0x2f5caf}})[_0xcbaf('0x3c')](handleEntityNotFound(_0x522810,null))[_0xcbaf('0x3c')](function(_0x5ceff8){if(_0x5ceff8){var _0x4eed1e=[_0xcbaf('0x7e'),_0xcbaf('0x7f'),_0xcbaf('0x80'),_0xcbaf('0x94'),_0xcbaf('0x95'),_0xcbaf('0x81'),_0xcbaf('0x82')];return db[_0xcbaf('0x54')][_0xcbaf('0x55')](function(_0xa9f53d){var _0xa335b5=_[_0xcbaf('0x29')](_0x4eed1e,function(_0xbba1d8){var _0x3cbfe2={'attributes':['id','name']};return _0x5ceff8[_0xcbaf('0x49')+_0xbba1d8+_0xcbaf('0x76')](_0x3cbfe2)[_0xcbaf('0x3c')](function(_0x40f1ae){var _0x5d1303=_[_0xcbaf('0x29')](_0x40f1ae,function(_0x5ddac9){return _0x5ddac9['removeAgents'](_0x2d5234,{'transaction':_0xa9f53d})['then'](function(){var _0xfcb864=_[_0xcbaf('0x29')](_0x2d5234,function(_0x2ac016){socket[_0xcbaf('0x96')](_0xcbaf('0x48')+_0xbba1d8+_0xcbaf('0x97'),{'UserId':Number(_0x2ac016),[_0xbba1d8+_0xcbaf('0x88')]:_0x5ddac9['id']});if(_0xbba1d8!=='Voice'){return;}return db[_0xcbaf('0x98')][_0xcbaf('0x53')]({'where':{'VoiceQueueId':_0x5ddac9['id'],'UserId':_0x2ac016},'transaction':_0xa9f53d});});return Promise[_0xcbaf('0x90')](_0xfcb864);});});return Promise[_0xcbaf('0x90')](_0x5d1303);});});return Promise[_0xcbaf('0x90')](_0xa335b5)[_0xcbaf('0x3c')](function(){return _0x5ceff8['removeAgents'](_0x2d5234,{'transaction':_0xa9f53d});})[_0xcbaf('0x3c')](function(){return db[_0xcbaf('0x6c')][_0xcbaf('0x6e')]({'where':{'teamId':_0x2f5caf}})[_0xcbaf('0x3c')](function(_0x5d9df5){if(_0x5d9df5){var _0xf0a498=_[_0xcbaf('0x29')](_0x2d5234,function(_0x300f1b){db['UserVoicePrefix'][_0xcbaf('0x53')]({'where':{'UserId':_0x300f1b,'VoicePrefixId':_0x5d9df5[_0xcbaf('0x91')]}});});return Promise[_0xcbaf('0x90')](_0xf0a498);}});});});}})[_0xcbaf('0x3c')](respondWithStatusCode(_0x522810,null))['catch'](handleError(_0x522810,null));};exports[_0xcbaf('0x99')]=function(_0x301762,_0x162bbc,_0x3e33d7){var _0x50326b={};var _0x230855={};var _0x3bf1da;var _0x4f1ed8;return db[_0xcbaf('0x3b')][_0xcbaf('0x6e')]({'where':{'id':_0x301762[_0xcbaf('0x42')]['id']}})[_0xcbaf('0x3c')](handleEntityNotFound(_0x162bbc,null))['then'](function(_0x547909){if(_0x547909){_0x3bf1da=_0x547909;_0x230855[_0xcbaf('0x2f')]=_['keys'](db[_0xcbaf('0x89')][_0xcbaf('0x2a')]);_0x230855['query']=_[_0xcbaf('0x43')](_0x301762[_0xcbaf('0x2d')]);_0x230855['filters']=_[_0xcbaf('0x44')](_0x230855['model'],_0x230855['query']);_0x50326b['attributes']=_['intersection'](_0x230855[_0xcbaf('0x2f')],qs[_0xcbaf('0x30')](_0x301762[_0xcbaf('0x2d')][_0xcbaf('0x30')]));_0x50326b[_0xcbaf('0x31')]=_0x50326b[_0xcbaf('0x31')]['length']?_0x50326b[_0xcbaf('0x31')]:_0x230855[_0xcbaf('0x2f')];_0x50326b[_0xcbaf('0x33')]=qs[_0xcbaf('0x34')](_0x301762[_0xcbaf('0x2d')][_0xcbaf('0x34')]);_0x50326b['where']=qs[_0xcbaf('0x2e')](_['pick'](_0x301762['query'],_0x230855[_0xcbaf('0x2e')]));if(_0x301762[_0xcbaf('0x2d')][_0xcbaf('0x39')]){_0x50326b['where']=_[_0xcbaf('0x37')](_0x50326b[_0xcbaf('0x35')],{'$or':_[_0xcbaf('0x29')](_0x50326b[_0xcbaf('0x31')],function(_0x36fb15){var _0x19ae7c={};_0x19ae7c[_0x36fb15]={'$like':'%'+_0x301762[_0xcbaf('0x2d')][_0xcbaf('0x39')]+'%'};return _0x19ae7c;})});}_0x50326b=_['merge']({},_0x50326b,_0x301762['options']);return _0x3bf1da[_0xcbaf('0x99')](_0x50326b);}})['then'](function(_0xf06dbf){if(_0xf06dbf){_0x4f1ed8=_0xf06dbf['length'];if(!_0x301762['query']['hasOwnProperty'](_0xcbaf('0x9a'))){_0x50326b['limit']=qs[_0xcbaf('0x1d')](_0x301762[_0xcbaf('0x2d')][_0xcbaf('0x1d')]);_0x50326b[_0xcbaf('0x1f')]=qs[_0xcbaf('0x1f')](_0x301762[_0xcbaf('0x2d')]['offset']);}return _0x3bf1da[_0xcbaf('0x99')](_0x50326b);}})[_0xcbaf('0x3c')](function(_0x383a95){if(_0x383a95){return _0x383a95?{'count':_0x4f1ed8,'rows':_0x383a95}:null;}})[_0xcbaf('0x3c')](respondWithResult(_0x162bbc,null))[_0xcbaf('0x40')](handleError(_0x162bbc,null));}; \ No newline at end of file +var _0xbf69=['SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','VoiceQueueId','UserVoiceQueue','UserMailQueue','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','TeamVoicePrefix','UserVoicePrefix','UserProfileResource','channel','isValidChannel','ValidationError','toLowerCase','Queue','pick','capitalize','Queues','findOne','Unknown\x20channel','add','ids','removeQueues','remove','addAgents','isArray','Chat','Sms','Fax','Openchannel','Whatsapp','Voice','QueueId','TeamVoiceQueue','User','findOrCreate','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','penalty','all','VoicePrefixId','removeAgents','Mail','emit','Queue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./team.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','json','stack','name','send','map','Team','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','then','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','get','role','Teams','UserProfileSection','userProfileId','error','destroy','sequelize','transaction'];(function(_0x5e48e0,_0x23b05b){var _0xa934c9=function(_0x3b5253){while(--_0x3b5253){_0x5e48e0['push'](_0x5e48e0['shift']());}};_0xa934c9(++_0x23b05b);}(_0xbf69,0xcd));var _0x9bf6=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0xbf69[_0x3c504b];return _0x2e5354;};'use strict';var emlformat=require(_0x9bf6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9bf6('0x1'));var jsonpatch=require(_0x9bf6('0x2'));var rp=require(_0x9bf6('0x3'));var moment=require('moment');var BPromise=require(_0x9bf6('0x4'));var Mustache=require(_0x9bf6('0x5'));var util=require(_0x9bf6('0x6'));var path=require(_0x9bf6('0x7'));var sox=require('sox');var csv=require(_0x9bf6('0x8'));var ejs=require(_0x9bf6('0x9'));var fs=require('fs');var fs_extra=require(_0x9bf6('0xa'));var _=require(_0x9bf6('0xb'));var squel=require(_0x9bf6('0xc'));var crypto=require('crypto');var jsforce=require(_0x9bf6('0xd'));var deskjs=require(_0x9bf6('0xe'));var toCsv=require(_0x9bf6('0x8'));var querystring=require(_0x9bf6('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9bf6('0x10'));var qs=require(_0x9bf6('0x11'));var as=require(_0x9bf6('0x12'));var hardwareService=require(_0x9bf6('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x9bf6('0x14'));var config=require(_0x9bf6('0x15'));var licenseUtil=require(_0x9bf6('0x16'));var db=require(_0x9bf6('0x17'))['db'];config['redis']=_[_0x9bf6('0x18')](config['redis'],{'host':_0x9bf6('0x19'),'port':0x18eb});var socket=require(_0x9bf6('0x1a'))(new Redis(config[_0x9bf6('0x1b')]));require(_0x9bf6('0x1c'))[_0x9bf6('0x1d')](socket);function respondWithStatusCode(_0x5cd0bd,_0x335e8b){_0x335e8b=_0x335e8b||0xcc;return function(_0x508e8d){if(_0x508e8d){return _0x5cd0bd[_0x9bf6('0x1e')](_0x335e8b);}return _0x5cd0bd[_0x9bf6('0x1f')](_0x335e8b)[_0x9bf6('0x20')]();};}function respondWithResult(_0x27e80f,_0x38ae73){_0x38ae73=_0x38ae73||0xc8;return function(_0x2da465){if(_0x2da465){return _0x27e80f[_0x9bf6('0x1f')](_0x38ae73)['json'](_0x2da465);}};}function respondWithFilteredResult(_0x36c801,_0x35b3c2){return function(_0x5cde56){if(_0x5cde56){var _0x5d3922=typeof _0x35b3c2['offset']===_0x9bf6('0x21')&&typeof _0x35b3c2[_0x9bf6('0x22')]===_0x9bf6('0x21');var _0x4649f1=_0x5cde56[_0x9bf6('0x23')];var _0x29f90c=_0x5d3922?0x0:_0x35b3c2[_0x9bf6('0x24')];var _0x323723=_0x5d3922?_0x5cde56[_0x9bf6('0x23')]:_0x35b3c2['offset']+_0x35b3c2[_0x9bf6('0x22')];var _0x1f63ba;if(_0x323723>=_0x4649f1){_0x323723=_0x4649f1;_0x1f63ba=0xc8;}else{_0x1f63ba=0xce;}_0x36c801[_0x9bf6('0x1f')](_0x1f63ba);return _0x36c801[_0x9bf6('0x25')]('Content-Range',_0x29f90c+'-'+_0x323723+'/'+_0x4649f1)[_0x9bf6('0x26')](_0x5cde56);}return null;};}function patchUpdates(_0x4ef02a){return function(_0x34d111){try{jsonpatch['apply'](_0x34d111,_0x4ef02a,!![]);}catch(_0x5c0a81){return BPromise['reject'](_0x5c0a81);}return _0x34d111['save']();};}function saveUpdates(_0x51e9b4,_0x174ce9){return function(_0x59ef8f){if(_0x59ef8f){return _0x59ef8f['update'](_0x51e9b4)['then'](function(_0x51bd9a){return _0x51bd9a;});}return null;};}function handleEntityNotFound(_0x112653,_0x3cef86){return function(_0x3505e5){if(!_0x3505e5){_0x112653[_0x9bf6('0x1e')](0x194);}return _0x3505e5;};}function handleError(_0x2d843a,_0x55cf17){_0x55cf17=_0x55cf17||0x1f4;return function(_0x211b4c){logger['error'](_0x211b4c[_0x9bf6('0x27')]);if(_0x211b4c[_0x9bf6('0x28')]){delete _0x211b4c['name'];}_0x2d843a[_0x9bf6('0x1f')](_0x55cf17)[_0x9bf6('0x29')](_0x211b4c);};}exports['index']=function(_0x1ae611,_0x4bf160){var _0x6f174c={},_0x44498c={},_0xd2bf62={'count':0x0,'rows':[]};var _0x36b18c=_[_0x9bf6('0x2a')](db[_0x9bf6('0x2b')][_0x9bf6('0x2c')],function(_0x234dd6){return{'name':_0x234dd6['fieldName'],'type':_0x234dd6[_0x9bf6('0x2d')][_0x9bf6('0x2e')]};});_0x44498c[_0x9bf6('0x2f')]=_[_0x9bf6('0x2a')](_0x36b18c,_0x9bf6('0x28'));_0x44498c[_0x9bf6('0x30')]=_[_0x9bf6('0x31')](_0x1ae611[_0x9bf6('0x30')]);_0x44498c['filters']=_[_0x9bf6('0x32')](_0x44498c[_0x9bf6('0x2f')],_0x44498c[_0x9bf6('0x30')]);_0x6f174c['attributes']=_[_0x9bf6('0x32')](_0x44498c[_0x9bf6('0x2f')],qs['fields'](_0x1ae611[_0x9bf6('0x30')][_0x9bf6('0x33')]));_0x6f174c[_0x9bf6('0x34')]=_0x6f174c[_0x9bf6('0x34')][_0x9bf6('0x35')]?_0x6f174c['attributes']:_0x44498c[_0x9bf6('0x2f')];if(!_0x1ae611[_0x9bf6('0x30')][_0x9bf6('0x36')](_0x9bf6('0x37'))){_0x6f174c[_0x9bf6('0x22')]=qs['limit'](_0x1ae611[_0x9bf6('0x30')][_0x9bf6('0x22')]);_0x6f174c[_0x9bf6('0x24')]=qs[_0x9bf6('0x24')](_0x1ae611[_0x9bf6('0x30')][_0x9bf6('0x24')]);}_0x6f174c[_0x9bf6('0x38')]=qs[_0x9bf6('0x39')](_0x1ae611[_0x9bf6('0x30')]['sort']);_0x6f174c[_0x9bf6('0x3a')]=qs[_0x9bf6('0x3b')](_['pick'](_0x1ae611[_0x9bf6('0x30')],_0x44498c['filters']),_0x36b18c);if(_0x1ae611[_0x9bf6('0x30')][_0x9bf6('0x3c')]){_0x6f174c[_0x9bf6('0x3a')]=_[_0x9bf6('0x3d')](_0x6f174c[_0x9bf6('0x3a')],{'$or':_[_0x9bf6('0x2a')](_0x36b18c,function(_0x147bd0){if(_0x147bd0[_0x9bf6('0x2d')]!==_0x9bf6('0x3e')){var _0x43738c={};_0x43738c[_0x147bd0[_0x9bf6('0x28')]]={'$like':'%'+_0x1ae611[_0x9bf6('0x30')][_0x9bf6('0x3c')]+'%'};return _0x43738c;}})});}_0x6f174c=_['merge']({},_0x6f174c,_0x1ae611[_0x9bf6('0x3f')]);var _0x4a6e43={'where':_0x6f174c[_0x9bf6('0x3a')]};return db[_0x9bf6('0x2b')]['count'](_0x4a6e43)[_0x9bf6('0x40')](function(_0x7e6065){_0xd2bf62[_0x9bf6('0x23')]=_0x7e6065;if(_0x1ae611[_0x9bf6('0x30')]['includeAll']){_0x6f174c[_0x9bf6('0x41')]=[{'all':!![]}];}return db[_0x9bf6('0x2b')][_0x9bf6('0x42')](_0x6f174c);})[_0x9bf6('0x40')](function(_0x5a985c){_0xd2bf62[_0x9bf6('0x43')]=_0x5a985c;return _0xd2bf62;})['then'](respondWithFilteredResult(_0x4bf160,_0x6f174c))[_0x9bf6('0x44')](handleError(_0x4bf160,null));};exports[_0x9bf6('0x45')]=function(_0x35f764,_0x38c65e){var _0x18227e={'raw':![],'where':{'id':_0x35f764[_0x9bf6('0x46')]['id']}},_0x21730e={};_0x21730e[_0x9bf6('0x2f')]=_[_0x9bf6('0x31')](db[_0x9bf6('0x2b')]['rawAttributes']);_0x21730e[_0x9bf6('0x30')]=_[_0x9bf6('0x31')](_0x35f764[_0x9bf6('0x30')]);_0x21730e[_0x9bf6('0x3b')]=_[_0x9bf6('0x32')](_0x21730e[_0x9bf6('0x2f')],_0x21730e[_0x9bf6('0x30')]);_0x18227e[_0x9bf6('0x34')]=_[_0x9bf6('0x32')](_0x21730e[_0x9bf6('0x2f')],qs['fields'](_0x35f764[_0x9bf6('0x30')][_0x9bf6('0x33')]));_0x18227e['attributes']=_0x18227e[_0x9bf6('0x34')]['length']?_0x18227e[_0x9bf6('0x34')]:_0x21730e['model'];if(_0x35f764[_0x9bf6('0x30')][_0x9bf6('0x47')]){_0x18227e[_0x9bf6('0x41')]=[{'all':!![]}];}_0x18227e=_[_0x9bf6('0x3d')]({},_0x18227e,_0x35f764[_0x9bf6('0x3f')]);return db[_0x9bf6('0x2b')][_0x9bf6('0x48')](_0x18227e)[_0x9bf6('0x40')](handleEntityNotFound(_0x38c65e,null))['then'](respondWithResult(_0x38c65e,null))[_0x9bf6('0x44')](handleError(_0x38c65e,null));};exports[_0x9bf6('0x49')]=function(_0x39bf67,_0x1cdfe1){return db[_0x9bf6('0x2b')][_0x9bf6('0x49')](_0x39bf67[_0x9bf6('0x4a')],{})['then'](function(_0x6d603b){var _0x2cc49b=_0x39bf67[_0x9bf6('0x4b')][_0x9bf6('0x4c')]({'plain':!![]});if(!_0x2cc49b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2cc49b[_0x9bf6('0x4d')]===_0x9bf6('0x4b')){var _0x59f53f=_0x6d603b[_0x9bf6('0x4c')]({'plain':!![]});var _0x506dd3=_0x9bf6('0x4e');return db[_0x9bf6('0x4f')][_0x9bf6('0x48')]({'where':{'name':_0x506dd3,'userProfileId':_0x2cc49b[_0x9bf6('0x50')]},'raw':!![]})[_0x9bf6('0x40')](function(_0x546a82){if(_0x546a82&&_0x546a82['autoAssociation']===0x0){return db['UserProfileResource'][_0x9bf6('0x49')]({'name':_0x59f53f['name'],'resourceId':_0x59f53f['id'],'type':_0x546a82[_0x9bf6('0x28')],'sectionId':_0x546a82['id']},{})[_0x9bf6('0x40')](function(){return _0x6d603b;});}else{return _0x6d603b;}})[_0x9bf6('0x44')](function(_0x51f448){logger[_0x9bf6('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51f448);throw _0x51f448;});}return _0x6d603b;})[_0x9bf6('0x40')](respondWithResult(_0x1cdfe1,0xc9))[_0x9bf6('0x44')](handleError(_0x1cdfe1,null));};exports['update']=function(_0x543fec,_0x1375a9){if(_0x543fec['body']['id']){delete _0x543fec[_0x9bf6('0x4a')]['id'];}return db[_0x9bf6('0x2b')][_0x9bf6('0x48')]({'where':{'id':_0x543fec['params']['id']}})[_0x9bf6('0x40')](handleEntityNotFound(_0x1375a9,null))[_0x9bf6('0x40')](saveUpdates(_0x543fec[_0x9bf6('0x4a')],null))[_0x9bf6('0x40')](respondWithResult(_0x1375a9,null))[_0x9bf6('0x44')](handleError(_0x1375a9,null));};exports[_0x9bf6('0x52')]=function(_0x47fd52,_0x57626a){var _0x5e28b5=_0x47fd52['params']['id'];var _0x2fb960=[];return db[_0x9bf6('0x53')][_0x9bf6('0x54')](function(_0x4cdd44){var _0x29eb68=_0x9bf6('0x55')+_0x5e28b5;return db[_0x9bf6('0x53')][_0x9bf6('0x30')](_0x29eb68,{'type':db[_0x9bf6('0x56')][_0x9bf6('0x57')]['SELECT'],'raw':!![],'transaction':_0x4cdd44})[_0x9bf6('0x40')](function(_0x28d592){_0x2fb960=_[_0x9bf6('0x2a')](_0x28d592,function(_0x4eaba6){return Number(_0x4eaba6['UserId']);});})[_0x9bf6('0x40')](function(){var _0x9283a2=_0x9bf6('0x58')+_0x5e28b5;return db[_0x9bf6('0x53')][_0x9bf6('0x30')](_0x9283a2,{'type':db[_0x9bf6('0x56')][_0x9bf6('0x57')][_0x9bf6('0x59')],'raw':!![],'transaction':_0x4cdd44});})[_0x9bf6('0x40')](function(_0x4873ab){var _0x403e44=_['map'](_0x4873ab,function(_0x515651){return Number(_0x515651[_0x9bf6('0x5a')]);});return db[_0x9bf6('0x5b')][_0x9bf6('0x52')]({'where':{'UserId':{'$in':_0x2fb960},'VoiceQueueId':{'$in':_0x403e44}},'transaction':_0x4cdd44});})[_0x9bf6('0x40')](function(){var _0x207dd7='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5e28b5;return db[_0x9bf6('0x53')][_0x9bf6('0x30')](_0x207dd7,{'type':db[_0x9bf6('0x56')][_0x9bf6('0x57')][_0x9bf6('0x59')],'raw':!![],'transaction':_0x4cdd44});})[_0x9bf6('0x40')](function(_0x2bae69){var _0x571f9b=_['map'](_0x2bae69,function(_0x561765){return Number(_0x561765['MailQueueId']);});return db[_0x9bf6('0x5c')]['destroy']({'where':{'UserId':{'$in':_0x2fb960},'MailQueueId':{'$in':_0x571f9b}},'transaction':_0x4cdd44});})['then'](function(){var _0x515a0f='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5e28b5;return db[_0x9bf6('0x53')][_0x9bf6('0x30')](_0x515a0f,{'type':db[_0x9bf6('0x56')][_0x9bf6('0x57')][_0x9bf6('0x59')],'raw':!![],'transaction':_0x4cdd44});})[_0x9bf6('0x40')](function(_0xfbf9c4){var _0x436567=_[_0x9bf6('0x2a')](_0xfbf9c4,function(_0x841314){return Number(_0x841314[_0x9bf6('0x5d')]);});return db[_0x9bf6('0x5e')]['destroy']({'where':{'UserId':{'$in':_0x2fb960},'SmsQueueId':{'$in':_0x436567}},'transaction':_0x4cdd44});})[_0x9bf6('0x40')](function(){var _0x53f2d5='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5e28b5;return db['sequelize'][_0x9bf6('0x30')](_0x53f2d5,{'type':db[_0x9bf6('0x56')]['QueryTypes'][_0x9bf6('0x59')],'raw':!![],'transaction':_0x4cdd44});})[_0x9bf6('0x40')](function(_0x3847bd){var _0x1510d1=_['map'](_0x3847bd,function(_0x5ccc28){return Number(_0x5ccc28[_0x9bf6('0x5f')]);});return db[_0x9bf6('0x60')][_0x9bf6('0x52')]({'where':{'UserId':{'$in':_0x2fb960},'ChatQueueId':{'$in':_0x1510d1}},'transaction':_0x4cdd44});})[_0x9bf6('0x40')](function(){var _0x1b79af=_0x9bf6('0x61')+_0x5e28b5;return db['sequelize']['query'](_0x1b79af,{'type':db[_0x9bf6('0x56')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x4cdd44});})[_0x9bf6('0x40')](function(_0x498daa){var _0x2e13a8=_['map'](_0x498daa,function(_0x31e9fd){return Number(_0x31e9fd[_0x9bf6('0x62')]);});return db['UserFaxQueue'][_0x9bf6('0x52')]({'where':{'UserId':{'$in':_0x2fb960},'FaxQueueId':{'$in':_0x2e13a8}},'transaction':_0x4cdd44});})[_0x9bf6('0x40')](function(){var _0x598d9c=_0x9bf6('0x63')+_0x5e28b5;return db[_0x9bf6('0x53')][_0x9bf6('0x30')](_0x598d9c,{'type':db[_0x9bf6('0x56')][_0x9bf6('0x57')]['SELECT'],'raw':!![],'transaction':_0x4cdd44});})[_0x9bf6('0x40')](function(_0x493d50){var _0x309453=_[_0x9bf6('0x2a')](_0x493d50,function(_0x556235){return Number(_0x556235['OpenchannelQueueId']);});return db[_0x9bf6('0x64')][_0x9bf6('0x52')]({'where':{'UserId':{'$in':_0x2fb960},'OpenchannelQueueId':{'$in':_0x309453}},'transaction':_0x4cdd44});})['then'](function(){var _0xeae916=_0x9bf6('0x65')+_0x5e28b5;return db[_0x9bf6('0x53')][_0x9bf6('0x30')](_0xeae916,{'type':db[_0x9bf6('0x56')][_0x9bf6('0x57')]['SELECT'],'raw':!![],'transaction':_0x4cdd44});})[_0x9bf6('0x40')](function(_0x46a5d9){var _0x3f25fd=_[_0x9bf6('0x2a')](_0x46a5d9,function(_0x2db9cb){return Number(_0x2db9cb['WhatsappQueueId']);});return db['UserWhatsappQueue'][_0x9bf6('0x52')]({'where':{'UserId':{'$in':_0x2fb960},'WhatsappQueueId':{'$in':_0x3f25fd}},'transaction':_0x4cdd44});})[_0x9bf6('0x40')](function(){return db[_0x9bf6('0x66')]['find']({'where':{'TeamId':_0x5e28b5}});})[_0x9bf6('0x40')](function(_0x46a434){if(_0x46a434===null){return;}return db[_0x9bf6('0x67')][_0x9bf6('0x52')]({'where':{'UserId':{'$in':_0x2fb960},'VoicePrefixId':_0x46a434['VoicePrefixId']},'transaction':_0x4cdd44});})[_0x9bf6('0x40')](function(){return db[_0x9bf6('0x2b')]['destroy']({'where':{'id':_0x5e28b5},'cascade':!![],'transaction':_0x4cdd44});})['then'](function(_0xa015fd){if(_0xa015fd===0x0){_0x57626a[_0x9bf6('0x1e')](0x194);}else{return db[_0x9bf6('0x68')][_0x9bf6('0x52')]({'where':{'type':_0x9bf6('0x4e'),'resourceId':_0x5e28b5},'cascade':!![],'transaction':_0x4cdd44})[_0x9bf6('0x40')](function(){_0x57626a['status'](0xcc)[_0x9bf6('0x20')]();});}})[_0x9bf6('0x44')](function(_0x4482ab){_0x57626a[_0x9bf6('0x1f')](0x1f4)[_0x9bf6('0x29')](_0x4482ab);});});};exports['getQueues']=function(_0x41c8aa,_0x1ada52,_0x55c969){return db[_0x9bf6('0x2b')]['findOne']({'where':{'id':_0x41c8aa[_0x9bf6('0x46')]['id']}})['then'](handleEntityNotFound(_0x1ada52,null))[_0x9bf6('0x40')](function(_0x4db32a){if(!_0x41c8aa[_0x9bf6('0x30')][_0x9bf6('0x69')]||!utils[_0x9bf6('0x6a')](_0x41c8aa['query'][_0x9bf6('0x69')])){throw new db['Sequelize'][(_0x9bf6('0x6b'))]('Unknown\x20channel');}var _0x2876c0={};var _0x20a87e={};_0x20a87e[_0x9bf6('0x2f')]=_[_0x9bf6('0x31')](db[_['capitalize'](_0x41c8aa[_0x9bf6('0x30')]['channel'][_0x9bf6('0x6c')]())+_0x9bf6('0x6d')]['rawAttributes']);_0x20a87e[_0x9bf6('0x30')]=_[_0x9bf6('0x31')](_0x41c8aa[_0x9bf6('0x30')]);_0x20a87e['filters']=_['intersection'](_0x20a87e[_0x9bf6('0x2f')],_0x20a87e[_0x9bf6('0x30')]);_0x2876c0['attributes']=_['intersection'](_0x20a87e[_0x9bf6('0x2f')],qs[_0x9bf6('0x33')](_0x41c8aa[_0x9bf6('0x30')]['fields']));_0x2876c0[_0x9bf6('0x34')]=_0x2876c0[_0x9bf6('0x34')][_0x9bf6('0x35')]?_0x2876c0['attributes']:_0x20a87e[_0x9bf6('0x2f')];_0x2876c0[_0x9bf6('0x22')]=qs[_0x9bf6('0x22')](_0x41c8aa[_0x9bf6('0x30')][_0x9bf6('0x22')]);_0x2876c0[_0x9bf6('0x24')]=qs[_0x9bf6('0x24')](_0x41c8aa[_0x9bf6('0x30')]['offset']);_0x2876c0[_0x9bf6('0x38')]=qs[_0x9bf6('0x39')](_0x41c8aa[_0x9bf6('0x30')]['sort']);_0x2876c0[_0x9bf6('0x3a')]=qs[_0x9bf6('0x3b')](_[_0x9bf6('0x6e')](_0x41c8aa['query'],_0x20a87e[_0x9bf6('0x3b')]));_0x2876c0=_[_0x9bf6('0x3d')]({},_0x2876c0,_0x41c8aa[_0x9bf6('0x3f')]);return _0x4db32a[_0x9bf6('0x4c')+_[_0x9bf6('0x6f')](_0x41c8aa[_0x9bf6('0x30')]['channel'][_0x9bf6('0x6c')]())+_0x9bf6('0x70')](_0x2876c0);})['then'](respondWithResult(_0x1ada52,null))[_0x9bf6('0x44')](handleError(_0x1ada52,null));};exports['addQueues']=function(_0x17c396,_0x160b9d,_0x48307e){return db['Team'][_0x9bf6('0x71')]({'where':{'id':_0x17c396[_0x9bf6('0x46')]['id']}})['then'](function(_0x38dde0){if(_0x38dde0){if(!_0x17c396['body'][_0x9bf6('0x69')]||!utils[_0x9bf6('0x6a')](_0x17c396['body']['channel'])){throw new db[(_0x9bf6('0x56'))]['ValidationError'](_0x9bf6('0x72'));}return _0x38dde0[_0x9bf6('0x73')+_[_0x9bf6('0x6f')](_0x17c396[_0x9bf6('0x4a')][_0x9bf6('0x69')][_0x9bf6('0x6c')]())+_0x9bf6('0x70')](_0x17c396['body'][_0x9bf6('0x74')]);}return null;})[_0x9bf6('0x40')](handleEntityNotFound(_0x160b9d,null))['then'](respondWithStatusCode(_0x160b9d,null))[_0x9bf6('0x44')](handleError(_0x160b9d,null));};exports[_0x9bf6('0x75')]=function(_0x381344,_0x81d309,_0x467508){return db[_0x9bf6('0x2b')][_0x9bf6('0x71')]({'where':{'id':_0x381344[_0x9bf6('0x46')]['id']}})[_0x9bf6('0x40')](function(_0xf8f52d){if(_0xf8f52d){if(!_0x381344[_0x9bf6('0x30')]['channel']||!utils[_0x9bf6('0x6a')](_0x381344[_0x9bf6('0x30')][_0x9bf6('0x69')])){throw new db[(_0x9bf6('0x56'))][(_0x9bf6('0x6b'))]('Unknown\x20channel');}return _0xf8f52d[_0x9bf6('0x76')+_[_0x9bf6('0x6f')](_0x381344[_0x9bf6('0x30')][_0x9bf6('0x69')][_0x9bf6('0x6c')]())+_0x9bf6('0x70')](_0x381344[_0x9bf6('0x30')][_0x9bf6('0x74')]);}return null;})[_0x9bf6('0x40')](handleEntityNotFound(_0x81d309,null))[_0x9bf6('0x40')](respondWithStatusCode(_0x81d309,null))[_0x9bf6('0x44')](handleError(_0x81d309,null));};exports[_0x9bf6('0x77')]=function(_0x594dbc,_0x3ce335){var _0x13fec1=_[_0x9bf6('0x78')](_0x594dbc[_0x9bf6('0x4a')]['ids'])?_0x594dbc['body'][_0x9bf6('0x74')]:[_0x594dbc[_0x9bf6('0x4a')][_0x9bf6('0x74')]];var _0x2265a2=_0x594dbc['params']['id'];return db[_0x9bf6('0x2b')][_0x9bf6('0x48')]({'where':{'id':_0x2265a2}})['then'](handleEntityNotFound(_0x3ce335,null))[_0x9bf6('0x40')](function(_0x45b977){if(_0x45b977){var _0x2dade5=['Voice',_0x9bf6('0x79'),'Mail',_0x9bf6('0x7a'),_0x9bf6('0x7b'),_0x9bf6('0x7c'),_0x9bf6('0x7d')];return db['sequelize'][_0x9bf6('0x54')](function(_0x92d56a){var _0x92ad7f=_['map'](_0x2dade5,function(_0x362393){var _0x2f451d={'attributes':['id','name']};if(_0x362393===_0x9bf6('0x7e')){_0x2f451d['through']={'attributes':['penalty']};}return _0x45b977[_0x9bf6('0x4c')+_0x362393+'Queues'](_0x2f451d)[_0x9bf6('0x40')](function(_0x59862d){var _0x22f61b=_[_0x9bf6('0x2a')](_0x59862d,function(_0x35cafa){var _0x2451ed=_[_0x9bf6('0x2a')](_0x13fec1,function(_0x15773b){var _0x308abd={'where':{'UserId':_0x15773b,[_0x362393+_0x9bf6('0x7f')]:_0x35cafa['id']},'transaction':_0x92d56a};if(_0x362393==='Voice'){_0x308abd[_0x9bf6('0x18')]={'penalty':_0x35cafa[_0x9bf6('0x80')]['penalty']};}return db[_0x9bf6('0x81')+_0x362393+_0x9bf6('0x6d')][_0x9bf6('0x82')](_0x308abd)['then'](function(){socket['emit'](_0x9bf6('0x4b')+_0x362393+'Queue:save',{'UserId':_0x15773b,[_0x362393+'QueueId']:_0x35cafa['id']});if(_0x362393!==_0x9bf6('0x7e')){return;}return db[_0x9bf6('0x81')][_0x9bf6('0x42')]({'where':{'id':_0x13fec1,'online':0x1},'attributes':['id','name',_0x9bf6('0x83'),_0x9bf6('0x84'),_0x9bf6('0x85')],'raw':!![]})[_0x9bf6('0x40')](function(_0x361530){var _0x44670a=_[_0x9bf6('0x2a')](_0x361530,function(_0x2f56c9){return db[_0x9bf6('0x86')][_0x9bf6('0x87')]({'membername':_0x2f56c9[_0x9bf6('0x28')],'UserId':_0x2f56c9['id'],'queue_name':_0x35cafa['name'],'VoiceQueueId':_0x35cafa['id'],'interface':_[_0x9bf6('0x88')](_0x2f56c9[_0x9bf6('0x85')])?util['format']('SIP/%s',_0x2f56c9[_0x9bf6('0x28')]):_0x2f56c9[_0x9bf6('0x85')],'paused':_0x2f56c9[_0x9bf6('0x84')]||![],'penalty':_0x35cafa['TeamVoiceQueue'][_0x9bf6('0x89')]},{'transaction':_0x92d56a});});return Promise[_0x9bf6('0x8a')](_0x44670a);});});});return Promise[_0x9bf6('0x8a')](_0x2451ed);});return Promise[_0x9bf6('0x8a')](_0x22f61b);})['then'](function(){return db[_0x9bf6('0x66')][_0x9bf6('0x71')]({'where':{'teamId':_0x2265a2}})['then'](function(_0x530364){if(_0x530364){var _0x1ed5de=_[_0x9bf6('0x2a')](_0x13fec1,function(_0x2d117d){db[_0x9bf6('0x67')][_0x9bf6('0x87')]({'UserId':_0x2d117d,'VoicePrefixId':_0x530364[_0x9bf6('0x8b')]});});return Promise['all'](_0x1ed5de);}});});});return Promise['all'](_0x92ad7f)[_0x9bf6('0x40')](function(){return _0x45b977[_0x9bf6('0x77')](_0x13fec1,{'transaction':_0x92d56a})['spread'](function(_0x40434d){return _0x40434d;});});});}})[_0x9bf6('0x40')](respondWithResult(_0x3ce335,null))[_0x9bf6('0x44')](handleError(_0x3ce335,null));};exports[_0x9bf6('0x8c')]=function(_0x5e042d,_0x51c3ef){var _0x15685a=_[_0x9bf6('0x78')](_0x5e042d[_0x9bf6('0x30')][_0x9bf6('0x74')])?_0x5e042d[_0x9bf6('0x30')][_0x9bf6('0x74')]:[_0x5e042d[_0x9bf6('0x30')][_0x9bf6('0x74')]];var _0x432268=_0x5e042d[_0x9bf6('0x46')]['id'];return db[_0x9bf6('0x2b')]['find']({'where':{'id':_0x432268}})['then'](handleEntityNotFound(_0x51c3ef,null))[_0x9bf6('0x40')](function(_0x1c5c47){if(_0x1c5c47){var _0x249385=['Voice',_0x9bf6('0x79'),_0x9bf6('0x8d'),_0x9bf6('0x7a'),_0x9bf6('0x7b'),_0x9bf6('0x7c'),_0x9bf6('0x7d')];return db[_0x9bf6('0x53')][_0x9bf6('0x54')](function(_0x519d9f){var _0x37cd9f=_['map'](_0x249385,function(_0xba1bd4){var _0x43f996={'attributes':['id',_0x9bf6('0x28')]};return _0x1c5c47[_0x9bf6('0x4c')+_0xba1bd4+'Queues'](_0x43f996)[_0x9bf6('0x40')](function(_0x514590){var _0x23bdf0=_[_0x9bf6('0x2a')](_0x514590,function(_0x18283d){return _0x18283d['removeAgents'](_0x15685a,{'transaction':_0x519d9f})[_0x9bf6('0x40')](function(){var _0x3c6b14=_[_0x9bf6('0x2a')](_0x15685a,function(_0x19dcf7){socket[_0x9bf6('0x8e')](_0x9bf6('0x4b')+_0xba1bd4+_0x9bf6('0x8f'),{'UserId':Number(_0x19dcf7),[_0xba1bd4+_0x9bf6('0x7f')]:_0x18283d['id']});if(_0xba1bd4!==_0x9bf6('0x7e')){return;}return db['UserVoiceQueueRt'][_0x9bf6('0x52')]({'where':{'VoiceQueueId':_0x18283d['id'],'UserId':_0x19dcf7},'transaction':_0x519d9f});});return Promise[_0x9bf6('0x8a')](_0x3c6b14);});});return Promise['all'](_0x23bdf0);});});return Promise['all'](_0x37cd9f)[_0x9bf6('0x40')](function(){return _0x1c5c47[_0x9bf6('0x8c')](_0x15685a,{'transaction':_0x519d9f});})[_0x9bf6('0x40')](function(){return db[_0x9bf6('0x66')][_0x9bf6('0x71')]({'where':{'teamId':_0x432268}})[_0x9bf6('0x40')](function(_0x13330a){if(_0x13330a){var _0x1062f2=_[_0x9bf6('0x2a')](_0x15685a,function(_0x12a300){db[_0x9bf6('0x67')][_0x9bf6('0x52')]({'where':{'UserId':_0x12a300,'VoicePrefixId':_0x13330a['VoicePrefixId']}});});return Promise[_0x9bf6('0x8a')](_0x1062f2);}});});});}})[_0x9bf6('0x40')](respondWithStatusCode(_0x51c3ef,null))['catch'](handleError(_0x51c3ef,null));};exports[_0x9bf6('0x90')]=function(_0x3fe02a,_0x433fb3,_0x49d804){var _0xc44c9b={};var _0x354a50={};var _0x42a30f;var _0x4247ac;return db[_0x9bf6('0x2b')][_0x9bf6('0x71')]({'where':{'id':_0x3fe02a['params']['id']}})[_0x9bf6('0x40')](handleEntityNotFound(_0x433fb3,null))[_0x9bf6('0x40')](function(_0x38d3fb){if(_0x38d3fb){_0x42a30f=_0x38d3fb;_0x354a50['model']=_[_0x9bf6('0x31')](db[_0x9bf6('0x81')][_0x9bf6('0x2c')]);_0x354a50[_0x9bf6('0x30')]=_['keys'](_0x3fe02a[_0x9bf6('0x30')]);_0x354a50[_0x9bf6('0x3b')]=_[_0x9bf6('0x32')](_0x354a50['model'],_0x354a50[_0x9bf6('0x30')]);_0xc44c9b[_0x9bf6('0x34')]=_['intersection'](_0x354a50[_0x9bf6('0x2f')],qs[_0x9bf6('0x33')](_0x3fe02a['query'][_0x9bf6('0x33')]));_0xc44c9b['attributes']=_0xc44c9b[_0x9bf6('0x34')]['length']?_0xc44c9b['attributes']:_0x354a50[_0x9bf6('0x2f')];_0xc44c9b[_0x9bf6('0x38')]=qs[_0x9bf6('0x39')](_0x3fe02a['query'][_0x9bf6('0x39')]);_0xc44c9b[_0x9bf6('0x3a')]=qs[_0x9bf6('0x3b')](_[_0x9bf6('0x6e')](_0x3fe02a[_0x9bf6('0x30')],_0x354a50['filters']));if(_0x3fe02a['query']['filter']){_0xc44c9b[_0x9bf6('0x3a')]=_[_0x9bf6('0x3d')](_0xc44c9b[_0x9bf6('0x3a')],{'$or':_[_0x9bf6('0x2a')](_0xc44c9b['attributes'],function(_0x5048e8){var _0x4ae000={};_0x4ae000[_0x5048e8]={'$like':'%'+_0x3fe02a[_0x9bf6('0x30')][_0x9bf6('0x3c')]+'%'};return _0x4ae000;})});}_0xc44c9b=_[_0x9bf6('0x3d')]({},_0xc44c9b,_0x3fe02a['options']);return _0x42a30f[_0x9bf6('0x90')](_0xc44c9b);}})[_0x9bf6('0x40')](function(_0x5c8181){if(_0x5c8181){_0x4247ac=_0x5c8181[_0x9bf6('0x35')];if(!_0x3fe02a[_0x9bf6('0x30')]['hasOwnProperty'](_0x9bf6('0x37'))){_0xc44c9b['limit']=qs['limit'](_0x3fe02a['query'][_0x9bf6('0x22')]);_0xc44c9b['offset']=qs[_0x9bf6('0x24')](_0x3fe02a['query']['offset']);}return _0x42a30f['getAgents'](_0xc44c9b);}})['then'](function(_0xaa2bd0){if(_0xaa2bd0){return _0xaa2bd0?{'count':_0x4247ac,'rows':_0xaa2bd0}:null;}})['then'](respondWithResult(_0x433fb3,null))['catch'](handleError(_0x433fb3,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index d377e89..d62daac 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 _0x51ca=['hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners','save','update','emit'];(function(_0x475878,_0x457560){var _0x5e88cd=function(_0x366e2b){while(--_0x366e2b){_0x475878['push'](_0x475878['shift']());}};_0x5e88cd(++_0x457560);}(_0x51ca,0x8f));var _0xa51c=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x51ca[_0x2aa0e7];return _0x1472c0;};'use strict';var EventEmitter=require(_0xa51c('0x0'));var Team=require(_0xa51c('0x1'))['db'][_0xa51c('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xa51c('0x3')](0x0);var events={'afterCreate':_0xa51c('0x4'),'afterUpdate':_0xa51c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x307c1a){return function(_0x1d5d43,_0x328871,_0x50347c){TeamEvents[_0xa51c('0x6')](_0x307c1a+':'+_0x1d5d43['id'],_0x1d5d43);TeamEvents[_0xa51c('0x6')](_0x307c1a,_0x1d5d43);_0x50347c(null);};}for(var e in events){if(events[_0xa51c('0x7')](e)){var event=events[e];Team[_0xa51c('0x8')](e,emitEvent(event));}}module[_0xa51c('0x9')]=TeamEvents; \ No newline at end of file +var _0xca72=['hasOwnProperty','exports','events','../../mysqldb','Team','setMaxListeners','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca72,0x14f));var _0x2ca7=function(_0x13342f,_0x3d6303){_0x13342f=_0x13342f-0x0;var _0x2fc1fc=_0xca72[_0x13342f];return _0x2fc1fc;};'use strict';var EventEmitter=require(_0x2ca7('0x0'));var Team=require(_0x2ca7('0x1'))['db'][_0x2ca7('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x2ca7('0x3')](0x0);var events={'afterCreate':_0x2ca7('0x4'),'afterUpdate':_0x2ca7('0x5'),'afterDestroy':'remove'};function emitEvent(_0x176898){return function(_0x9d1acf,_0x3657d4,_0x5d52e0){TeamEvents[_0x2ca7('0x6')](_0x176898+':'+_0x9d1acf['id'],_0x9d1acf);TeamEvents[_0x2ca7('0x6')](_0x176898,_0x9d1acf);_0x5d52e0(null);};}for(var e in events){if(events[_0x2ca7('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x2ca7('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 2f6e3b2..52fbb82 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 _0x1c3a=['Fax','Mail','Sms','Voice','Whatsapp','resolve','map','all','lodash','./team.attributes','Queues','then','setDataValue','channel','catch','exports','Team'];(function(_0x1a799e,_0x3e5756){var _0x33f618=function(_0x46350c){while(--_0x46350c){_0x1a799e['push'](_0x1a799e['shift']());}};_0x33f618(++_0x3e5756);}(_0x1c3a,0x16d));var _0xa1c3=function(_0x55e653,_0x30a4d3){_0x55e653=_0x55e653-0x0;var _0x26336d=_0x1c3a[_0x55e653];return _0x26336d;};'use strict';var _=require(_0xa1c3('0x0'));var attributes=require(_0xa1c3('0x1'));function getQueuesByChannel(_0x2244fb,_0x2e2c9e){var _0x20419d='get'+_0x2e2c9e+_0xa1c3('0x2');return _0x2244fb[_0x20419d]()[_0xa1c3('0x3')](function(_0x23edf3){return _['map'](_0x23edf3,function(_0x42aa54){_0x42aa54[_0xa1c3('0x4')](_0xa1c3('0x5'),_0x2e2c9e);return _0x42aa54;});})[_0xa1c3('0x6')](function(_0x1e84aa){throw _0x1e84aa;});}module[_0xa1c3('0x7')]=function(_0x312732){return _0x312732['define'](_0xa1c3('0x8'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x95d3b9=this;var _0x2611a5=['Chat',_0xa1c3('0x9'),_0xa1c3('0xa'),'Openchannel',_0xa1c3('0xb'),_0xa1c3('0xc'),_0xa1c3('0xd')];return Promise[_0xa1c3('0xe')]()[_0xa1c3('0x3')](function(){var _0x5d757a=_[_0xa1c3('0xf')](_0x2611a5,function(_0xb1bf46){return getQueuesByChannel(_0x95d3b9,_0xb1bf46);});return Promise[_0xa1c3('0x10')](_0x5d757a);})[_0xa1c3('0x6')](function(_0x3ab20d){throw _0x3ab20d;});}}});}; \ No newline at end of file +var _0xafd1=['Queues','then','setDataValue','channel','catch','exports','define','Team','Chat','Fax','Mail','Openchannel','Sms','Voice','resolve','map','lodash','./team.attributes','get'];(function(_0xcd105c,_0x180210){var _0x35154c=function(_0x44f151){while(--_0x44f151){_0xcd105c['push'](_0xcd105c['shift']());}};_0x35154c(++_0x180210);}(_0xafd1,0x140));var _0x1afd=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xafd1[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x1afd('0x0'));var attributes=require(_0x1afd('0x1'));function getQueuesByChannel(_0x42839e,_0x467c8f){var _0x29f6f4=_0x1afd('0x2')+_0x467c8f+_0x1afd('0x3');return _0x42839e[_0x29f6f4]()[_0x1afd('0x4')](function(_0x3b98aa){return _['map'](_0x3b98aa,function(_0x4e6704){_0x4e6704[_0x1afd('0x5')](_0x1afd('0x6'),_0x467c8f);return _0x4e6704;});})[_0x1afd('0x7')](function(_0x290476){throw _0x290476;});}module[_0x1afd('0x8')]=function(_0x11adff){return _0x11adff[_0x1afd('0x9')](_0x1afd('0xa'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x2038b0=this;var _0x3c75db=[_0x1afd('0xb'),_0x1afd('0xc'),_0x1afd('0xd'),_0x1afd('0xe'),_0x1afd('0xf'),_0x1afd('0x10'),'Whatsapp'];return Promise[_0x1afd('0x11')]()[_0x1afd('0x4')](function(){var _0x5aa294=_[_0x1afd('0x12')](_0x3c75db,function(_0x4b6fdf){return getQueuesByChannel(_0x2038b0,_0x4b6fdf);});return Promise['all'](_0x5aa294);})[_0x1afd('0x7')](function(_0x5b2dcd){throw _0x5b2dcd;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 04020c9..10ad83a 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 _0xe0c5=['register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket'];(function(_0x116ca9,_0x19a080){var _0x5375f7=function(_0x44e763){while(--_0x44e763){_0x116ca9['push'](_0x116ca9['shift']());}};_0x5375f7(++_0x19a080);}(_0xe0c5,0x98));var _0x5e0c=function(_0x3261de,_0x5e9f4e){_0x3261de=_0x3261de-0x0;var _0xdaf39a=_0xe0c5[_0x3261de];return _0xdaf39a;};'use strict';var _=require(_0x5e0c('0x0'));var util=require(_0x5e0c('0x1'));var moment=require(_0x5e0c('0x2'));var BPromise=require(_0x5e0c('0x3'));var rs=require(_0x5e0c('0x4'));var fs=require('fs');var Redis=require(_0x5e0c('0x5'));var db=require(_0x5e0c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e0c('0x7'))('rpc');var config=require(_0x5e0c('0x8'));var jayson=require(_0x5e0c('0x9'));var client=jayson[_0x5e0c('0xa')][_0x5e0c('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5e0c('0xc')],{'host':_0x5e0c('0xd'),'port':0x18eb});var socket=require(_0x5e0c('0xe'))(new Redis(config[_0x5e0c('0xc')]));require(_0x5e0c('0xf'))[_0x5e0c('0x10')](socket);function respondWithRpcPromise(_0x32e4ae,_0x2a81de,_0xf61c18){return new BPromise(function(_0x46cab9,_0x45de7a){return client[_0x5e0c('0x11')](_0x32e4ae,_0xf61c18)['then'](function(_0x231fc9){logger[_0x5e0c('0x12')](_0x5e0c('0x13'),_0x2a81de,_0x5e0c('0x14'));logger[_0x5e0c('0x15')](_0x5e0c('0x16'),_0x2a81de,_0x5e0c('0x14'),JSON['stringify'](_0x231fc9));if(_0x231fc9['error']){if(_0x231fc9[_0x5e0c('0x17')][_0x5e0c('0x18')]===0x1f4){logger['error'](_0x5e0c('0x13'),_0x2a81de,_0x231fc9['error']['message']);return _0x45de7a(_0x231fc9['error'][_0x5e0c('0x19')]);}logger[_0x5e0c('0x17')](_0x5e0c('0x13'),_0x2a81de,_0x231fc9[_0x5e0c('0x17')][_0x5e0c('0x19')]);return _0x46cab9(_0x231fc9[_0x5e0c('0x17')][_0x5e0c('0x19')]);}else{logger[_0x5e0c('0x12')](_0x5e0c('0x13'),_0x2a81de,_0x5e0c('0x14'));_0x46cab9(_0x231fc9[_0x5e0c('0x1a')][_0x5e0c('0x19')]);}})[_0x5e0c('0x1b')](function(_0x5252f6){logger['error']('Team,\x20%s,\x20%s',_0x2a81de,_0x5252f6);_0x45de7a(_0x5252f6);});});} \ No newline at end of file +var _0xcb9f=['code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x405f56,_0x53f8cb){var _0x49eb89=function(_0x1d2d5e){while(--_0x1d2d5e){_0x405f56['push'](_0x405f56['shift']());}};_0x49eb89(++_0x53f8cb);}(_0xcb9f,0x1d4));var _0xfcb9=function(_0x5a95d5,_0x196667){_0x5a95d5=_0x5a95d5-0x0;var _0x83489e=_0xcb9f[_0x5a95d5];return _0x83489e;};'use strict';var _=require(_0xfcb9('0x0'));var util=require(_0xfcb9('0x1'));var moment=require(_0xfcb9('0x2'));var BPromise=require(_0xfcb9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcb9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfcb9('0x5'))(_0xfcb9('0x6'));var config=require(_0xfcb9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfcb9('0x8')][_0xfcb9('0x9')]({'port':0x232a});config[_0xfcb9('0xa')]=_[_0xfcb9('0xb')](config[_0xfcb9('0xa')],{'host':_0xfcb9('0xc'),'port':0x18eb});var socket=require(_0xfcb9('0xd'))(new Redis(config[_0xfcb9('0xa')]));require(_0xfcb9('0xe'))[_0xfcb9('0xf')](socket);function respondWithRpcPromise(_0x2fcfea,_0x25158a,_0x3f8175){return new BPromise(function(_0x267b25,_0x15bf49){return client[_0xfcb9('0x10')](_0x2fcfea,_0x3f8175)[_0xfcb9('0x11')](function(_0x39d51d){logger[_0xfcb9('0x12')](_0xfcb9('0x13'),_0x25158a,_0xfcb9('0x14'));logger[_0xfcb9('0x15')](_0xfcb9('0x16'),_0x25158a,_0xfcb9('0x14'),JSON[_0xfcb9('0x17')](_0x39d51d));if(_0x39d51d[_0xfcb9('0x18')]){if(_0x39d51d['error'][_0xfcb9('0x19')]===0x1f4){logger[_0xfcb9('0x18')](_0xfcb9('0x13'),_0x25158a,_0x39d51d['error'][_0xfcb9('0x1a')]);return _0x15bf49(_0x39d51d[_0xfcb9('0x18')][_0xfcb9('0x1a')]);}logger[_0xfcb9('0x18')](_0xfcb9('0x13'),_0x25158a,_0x39d51d['error'][_0xfcb9('0x1a')]);return _0x267b25(_0x39d51d[_0xfcb9('0x18')]['message']);}else{logger[_0xfcb9('0x12')]('Team,\x20%s,\x20%s',_0x25158a,'request\x20sent');_0x267b25(_0x39d51d[_0xfcb9('0x1b')][_0xfcb9('0x1a')]);}})[_0xfcb9('0x1c')](function(_0x41ae78){logger[_0xfcb9('0x18')](_0xfcb9('0x13'),_0x25158a,_0x41ae78);_0x15bf49(_0x41ae78);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 83c42ff..7dfaf9c 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 _0xdafb=['team:','./team.events','save','remove','update','emit','register','length'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xdafb,0x1a9));var _0xbdaf=function(_0x2c9a16,_0x86866f){_0x2c9a16=_0x2c9a16-0x0;var _0x485eab=_0xdafb[_0x2c9a16];return _0x485eab;};'use strict';var TeamEvents=require(_0xbdaf('0x0'));var events=[_0xbdaf('0x1'),_0xbdaf('0x2'),_0xbdaf('0x3')];function createListener(_0x166175,_0x46bcad){return function(_0x13946b){_0x46bcad[_0xbdaf('0x4')](_0x166175,_0x13946b);};}function removeListener(_0x5a53e0,_0x5416ef){return function(){TeamEvents['removeListener'](_0x5a53e0,_0x5416ef);};}exports[_0xbdaf('0x5')]=function(_0x3d1367){for(var _0x52ecad=0x0,_0x43f837=events[_0xbdaf('0x6')];_0x52ecad<_0x43f837;_0x52ecad++){var _0x171a1b=events[_0x52ecad];var _0xa70bb6=createListener(_0xbdaf('0x7')+_0x171a1b,_0x3d1367);TeamEvents['on'](_0x171a1b,_0xa70bb6);}}; \ No newline at end of file +var _0xcd89=['update','emit','removeListener','register','team:','save','remove'];(function(_0x108d5f,_0x33f82d){var _0x456ea3=function(_0x228200){while(--_0x228200){_0x108d5f['push'](_0x108d5f['shift']());}};_0x456ea3(++_0x33f82d);}(_0xcd89,0x67));var _0x9cd8=function(_0x48cdc1,_0x3a8edd){_0x48cdc1=_0x48cdc1-0x0;var _0x3e4eca=_0xcd89[_0x48cdc1];return _0x3e4eca;};'use strict';var TeamEvents=require('./team.events');var events=[_0x9cd8('0x0'),_0x9cd8('0x1'),_0x9cd8('0x2')];function createListener(_0x5979c0,_0x2b510c){return function(_0x3de308){_0x2b510c[_0x9cd8('0x3')](_0x5979c0,_0x3de308);};}function removeListener(_0x4dac43,_0x2b0512){return function(){TeamEvents[_0x9cd8('0x4')](_0x4dac43,_0x2b0512);};}exports[_0x9cd8('0x5')]=function(_0x599052){for(var _0xbb4637=0x0,_0x1198a5=events['length'];_0xbb4637<_0x1198a5;_0xbb4637++){var _0x40c3b1=events[_0xbb4637];var _0x33d8c1=createListener(_0x9cd8('0x6')+_0x40c3b1,_0x599052);TeamEvents['on'](_0x40c3b1,_0x33d8c1);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 08f0e68..9ccb276 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 _0x755e=['sequelize','exports','INTEGER'];(function(_0x18aef7,_0x29c3c0){var _0x59321c=function(_0x3deeb6){while(--_0x3deeb6){_0x18aef7['push'](_0x18aef7['shift']());}};_0x59321c(++_0x29c3c0);}(_0x755e,0x96));var _0xe755=function(_0x42e4d7,_0x4bd202){_0x42e4d7=_0x42e4d7-0x0;var _0x346cd8=_0x755e[_0x42e4d7];return _0x346cd8;};'use strict';var Sequelize=require(_0xe755('0x0'));module[_0xe755('0x1')]={'TeamId':{'type':Sequelize[_0xe755('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xe755('0x2')]}}; \ No newline at end of file +var _0x34e5=['exports','INTEGER'];(function(_0x7a4b16,_0x2c3b70){var _0x59e441=function(_0xfc8375){while(--_0xfc8375){_0x7a4b16['push'](_0x7a4b16['shift']());}};_0x59e441(++_0x2c3b70);}(_0x34e5,0x172));var _0x534e=function(_0x6bc46f,_0x339730){_0x6bc46f=_0x6bc46f-0x0;var _0x35e76c=_0x34e5[_0x6bc46f];return _0x35e76c;};'use strict';var Sequelize=require('sequelize');module[_0x534e('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x534e('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index eda7cca..62457cb 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(_0x3314e8,_0x269be7){var _0xda9391=function(_0x12c7b5){while(--_0x12c7b5){_0x3314e8['push'](_0x3314e8['shift']());}};_0xda9391(++_0x269be7);}(_0xb574,0x106));var _0x4b57=function(_0xc393db,_0x56a96e){_0xc393db=_0xc393db-0x0;var _0x144409=_0xb574[_0xc393db];return _0x144409;};'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 _0x9bc3=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x491277,_0x295688){var _0x3bdf82=function(_0xf83ba7){while(--_0xf83ba7){_0x491277['push'](_0x491277['shift']());}};_0x3bdf82(++_0x295688);}(_0x9bc3,0x137));var _0x39bc=function(_0x41e393,_0x35417e){_0x41e393=_0x41e393-0x0;var _0x27db09=_0x9bc3[_0x41e393];return _0x27db09;};'use strict';var _=require(_0x39bc('0x0'));var util=require(_0x39bc('0x1'));var logger=require(_0x39bc('0x2'))('api');var moment=require(_0x39bc('0x3'));var BPromise=require(_0x39bc('0x4'));var rp=require(_0x39bc('0x5'));var fs=require('fs');var path=require(_0x39bc('0x6'));var rimraf=require('rimraf');var config=require(_0x39bc('0x7'));var attributes=require(_0x39bc('0x8'));module[_0x39bc('0x9')]=function(_0x442ec9,_0x5805da){return _0x442ec9[_0x39bc('0xa')](_0x39bc('0xb'),attributes,{'tableName':_0x39bc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 00a5c5d..d92ed2f 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x335b09,_0x213a5c){var _0x37bc0c=function(_0x49b2c5){while(--_0x49b2c5){_0x335b09['push'](_0x335b09['shift']());}};_0x37bc0c(++_0x213a5c);}(_0xe706,0xa3));var _0x6e70=function(_0x5dac46,_0x28e9dc){_0x5dac46=_0x5dac46-0x0;var _0x51095c=_0xe706[_0x5dac46];return _0x51095c;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x478927,_0x137268){var _0x37223f=function(_0x16faf8){while(--_0x16faf8){_0x478927['push'](_0x478927['shift']());}};_0x37223f(++_0x137268);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index a747a42..1252600 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 _0xdb96=['INTEGER','sequelize','exports'];(function(_0x4d4045,_0xce982){var _0x5b5779=function(_0x66f981){while(--_0x66f981){_0x4d4045['push'](_0x4d4045['shift']());}};_0x5b5779(++_0xce982);}(_0xdb96,0x187));var _0x6db9=function(_0xd1a2c4,_0x53f38d){_0xd1a2c4=_0xd1a2c4-0x0;var _0x2a1d77=_0xdb96[_0xd1a2c4];return _0x2a1d77;};'use strict';var Sequelize=require(_0x6db9('0x0'));module[_0x6db9('0x1')]={'penalty':{'type':Sequelize[_0x6db9('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1a6b=['INTEGER','sequelize','exports'];(function(_0x1ce02d,_0x317495){var _0x14f24e=function(_0x116713){while(--_0x116713){_0x1ce02d['push'](_0x1ce02d['shift']());}};_0x14f24e(++_0x317495);}(_0x1a6b,0x94));var _0xb1a6=function(_0x5526ea,_0x1909cd){_0x5526ea=_0x5526ea-0x0;var _0x570fb9=_0x1a6b[_0x5526ea];return _0x570fb9;};'use strict';var Sequelize=require(_0xb1a6('0x0'));module[_0xb1a6('0x1')]={'penalty':{'type':Sequelize[_0xb1a6('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 62ffb32..8aacf04 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 _0xe57e=['lodash','../../config/logger','api','moment','path','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe57e,0xf2));var _0xee57=function(_0x4d3877,_0xbddd0e){_0x4d3877=_0x4d3877-0x0;var _0x4e1977=_0xe57e[_0x4d3877];return _0x4e1977;};'use strict';var _=require(_0xee57('0x0'));var util=require('util');var logger=require(_0xee57('0x1'))(_0xee57('0x2'));var moment=require(_0xee57('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xee57('0x4'));var rimraf=require('rimraf');var config=require(_0xee57('0x5'));var attributes=require(_0xee57('0x6'));module[_0xee57('0x7')]=function(_0x4e21c4,_0x491334){return _0x4e21c4[_0xee57('0x8')](_0xee57('0x9'),attributes,{'tableName':_0xee57('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd04b=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xd04b,0x145));var _0xbd04=function(_0x52e8ea,_0x23a97a){_0x52e8ea=_0x52e8ea-0x0;var _0x40ddc5=_0xd04b[_0x52e8ea];return _0x40ddc5;};'use strict';var _=require(_0xbd04('0x0'));var util=require(_0xbd04('0x1'));var logger=require(_0xbd04('0x2'))('api');var moment=require(_0xbd04('0x3'));var BPromise=require('bluebird');var rp=require(_0xbd04('0x4'));var fs=require('fs');var path=require(_0xbd04('0x5'));var rimraf=require(_0xbd04('0x6'));var config=require(_0xbd04('0x7'));var attributes=require(_0xbd04('0x8'));module[_0xbd04('0x9')]=function(_0x11d6ce,_0x2d8811){return _0x11d6ce[_0xbd04('0xa')](_0xbd04('0xb'),attributes,{'tableName':_0xbd04('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index ba5a842..9653e19 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 _0xd245=['info','request\x20sent','debug','error','code','message','TeamVoiceQueue,\x20%s,\x20%s','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0xb02766,_0xa37d90){var _0x560e6c=function(_0x1ea675){while(--_0x1ea675){_0xb02766['push'](_0xb02766['shift']());}};_0x560e6c(++_0xa37d90);}(_0xd245,0x1e8));var _0x5d24=function(_0x3f2fea,_0x3c4ea8){_0x3f2fea=_0x3f2fea-0x0;var _0x69a4d5=_0xd245[_0x3f2fea];return _0x69a4d5;};'use strict';var _=require(_0x5d24('0x0'));var util=require(_0x5d24('0x1'));var moment=require(_0x5d24('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d24('0x3'));var db=require(_0x5d24('0x4'))['db'];var utils=require(_0x5d24('0x5'));var logger=require(_0x5d24('0x6'))(_0x5d24('0x7'));var config=require('../../config/environment');var jayson=require(_0x5d24('0x8'));var client=jayson[_0x5d24('0x9')][_0x5d24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e2379,_0x97be5f,_0x3fc1df){return new BPromise(function(_0x435711,_0x21428d){return client[_0x5d24('0xb')](_0x1e2379,_0x3fc1df)['then'](function(_0x2f8738){logger[_0x5d24('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x97be5f,_0x5d24('0xd'));logger[_0x5d24('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x97be5f,_0x5d24('0xd'),JSON['stringify'](_0x2f8738));if(_0x2f8738[_0x5d24('0xf')]){if(_0x2f8738[_0x5d24('0xf')][_0x5d24('0x10')]===0x1f4){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x97be5f,_0x2f8738[_0x5d24('0xf')][_0x5d24('0x11')]);return _0x21428d(_0x2f8738['error'][_0x5d24('0x11')]);}logger[_0x5d24('0xf')](_0x5d24('0x12'),_0x97be5f,_0x2f8738[_0x5d24('0xf')]['message']);return _0x435711(_0x2f8738[_0x5d24('0xf')][_0x5d24('0x11')]);}else{logger[_0x5d24('0xc')](_0x5d24('0x12'),_0x97be5f,'request\x20sent');_0x435711(_0x2f8738['result'][_0x5d24('0x11')]);}})[_0x5d24('0x13')](function(_0x5c9eb2){logger['error'](_0x5d24('0x12'),_0x97be5f,_0x5c9eb2);_0x21428d(_0x5c9eb2);});});} \ No newline at end of file +var _0xe600=['rpc','../../config/environment','jayson/promise','client','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1cbdf9,_0x238562){var _0x8870be=function(_0x46e92e){while(--_0x46e92e){_0x1cbdf9['push'](_0x1cbdf9['shift']());}};_0x8870be(++_0x238562);}(_0xe600,0x159));var _0x0e60=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe600[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x0e60('0x0'));var moment=require('moment');var BPromise=require(_0x0e60('0x1'));var rs=require(_0x0e60('0x2'));var fs=require('fs');var Redis=require(_0x0e60('0x3'));var db=require(_0x0e60('0x4'))['db'];var utils=require(_0x0e60('0x5'));var logger=require(_0x0e60('0x6'))(_0x0e60('0x7'));var config=require(_0x0e60('0x8'));var jayson=require(_0x0e60('0x9'));var client=jayson[_0x0e60('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d7563,_0x497a61,_0x6727dd){return new BPromise(function(_0x30eaed,_0x5ba123){return client[_0x0e60('0xb')](_0x1d7563,_0x6727dd)[_0x0e60('0xc')](function(_0x238537){logger[_0x0e60('0xd')](_0x0e60('0xe'),_0x497a61,_0x0e60('0xf'));logger['debug'](_0x0e60('0x10'),_0x497a61,_0x0e60('0xf'),JSON[_0x0e60('0x11')](_0x238537));if(_0x238537[_0x0e60('0x12')]){if(_0x238537[_0x0e60('0x12')][_0x0e60('0x13')]===0x1f4){logger[_0x0e60('0x12')](_0x0e60('0xe'),_0x497a61,_0x238537['error'][_0x0e60('0x14')]);return _0x5ba123(_0x238537[_0x0e60('0x12')][_0x0e60('0x14')]);}logger[_0x0e60('0x12')](_0x0e60('0xe'),_0x497a61,_0x238537[_0x0e60('0x12')]['message']);return _0x30eaed(_0x238537[_0x0e60('0x12')]['message']);}else{logger[_0x0e60('0xd')](_0x0e60('0xe'),_0x497a61,_0x0e60('0xf'));_0x30eaed(_0x238537['result'][_0x0e60('0x14')]);}})[_0x0e60('0x15')](function(_0xdb7760){logger[_0x0e60('0x12')](_0x0e60('0xe'),_0x497a61,_0xdb7760);_0x5ba123(_0xdb7760);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index c5b6869..b0abc71 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 _0x2ff5=['/:id','show','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0xa72931,_0x37d87a){var _0x13b2f5=function(_0x2fc601){while(--_0x2fc601){_0xa72931['push'](_0xa72931['shift']());}};_0x13b2f5(++_0x37d87a);}(_0x2ff5,0x1d5));var _0x52ff=function(_0x53bf25,_0x2a04b6){_0x53bf25=_0x53bf25-0x0;var _0x3630c6=_0x2ff5[_0x53bf25];return _0x3630c6;};'use strict';var multer=require('multer');var util=require(_0x52ff('0x0'));var path=require(_0x52ff('0x1'));var timeout=require('connect-timeout');var express=require(_0x52ff('0x2'));var router=express[_0x52ff('0x3')]();var fs_extra=require(_0x52ff('0x4'));var auth=require(_0x52ff('0x5'));var interaction=require(_0x52ff('0x6'));var config=require(_0x52ff('0x7'));var controller=require('./template.controller');router[_0x52ff('0x8')]('/',auth[_0x52ff('0x9')](),controller[_0x52ff('0xa')]);router['get'](_0x52ff('0xb'),auth[_0x52ff('0x9')](),controller[_0x52ff('0xc')]);router[_0x52ff('0xd')]('/',auth[_0x52ff('0x9')](),controller[_0x52ff('0xe')]);router[_0x52ff('0xf')](_0x52ff('0xb'),auth[_0x52ff('0x9')](),controller[_0x52ff('0x10')]);router[_0x52ff('0x11')](_0x52ff('0xb'),auth[_0x52ff('0x9')](),controller[_0x52ff('0x12')]);module[_0x52ff('0x13')]=router; \ No newline at end of file +var _0x751c=['put','update','destroy','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x2aa4c8,_0x1f65b4){var _0x29edb8=function(_0x77caef){while(--_0x77caef){_0x2aa4c8['push'](_0x2aa4c8['shift']());}};_0x29edb8(++_0x1f65b4);}(_0x751c,0x69));var _0xc751=function(_0x251538,_0x505bd9){_0x251538=_0x251538-0x0;var _0x2cd58b=_0x751c[_0x251538];return _0x2cd58b;};'use strict';var multer=require(_0xc751('0x0'));var util=require(_0xc751('0x1'));var path=require(_0xc751('0x2'));var timeout=require('connect-timeout');var express=require(_0xc751('0x3'));var router=express['Router']();var fs_extra=require(_0xc751('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc751('0x5'));var config=require(_0xc751('0x6'));var controller=require(_0xc751('0x7'));router[_0xc751('0x8')]('/',auth[_0xc751('0x9')](),controller['index']);router[_0xc751('0x8')](_0xc751('0xa'),auth['isAuthenticated'](),controller[_0xc751('0xb')]);router[_0xc751('0xc')]('/',auth['isAuthenticated'](),controller[_0xc751('0xd')]);router[_0xc751('0xe')](_0xc751('0xa'),auth[_0xc751('0x9')](),controller[_0xc751('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc751('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 6ff0606..e9b70e5 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 _0x0d22=['STRING','TEXT','sequelize'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x0d22,0x8f));var _0x20d2=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0x0d22[_0xb1cf84];return _0x4bad2e;};'use strict';var Sequelize=require(_0x20d2('0x0'));module['exports']={'name':{'type':Sequelize[_0x20d2('0x1')]},'description':{'type':Sequelize[_0x20d2('0x1')]},'html':{'type':Sequelize[_0x20d2('0x2')]}}; \ No newline at end of file +var _0xf910=['TEXT','sequelize','exports','STRING'];(function(_0x4edfec,_0x581a4a){var _0x22c10b=function(_0x6c3054){while(--_0x6c3054){_0x4edfec['push'](_0x4edfec['shift']());}};_0x22c10b(++_0x581a4a);}(_0xf910,0xd9));var _0x0f91=function(_0x571097,_0x5b56ac){_0x571097=_0x571097-0x0;var _0x30fc4d=_0xf910[_0x571097];return _0x30fc4d;};'use strict';var Sequelize=require(_0x0f91('0x0'));module[_0x0f91('0x1')]={'name':{'type':Sequelize[_0x0f91('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x0f91('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index c1e4dda..5f78c26 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 _0x556f=['name','send','index','map','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','Template','findAll','rows','catch','show','params','keys','rawAttributes','include','create','body','user','get','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','Templates','UserProfileResource','error','stack'];(function(_0x42b09f,_0x2e4242){var _0x18d801=function(_0x346570){while(--_0x346570){_0x42b09f['push'](_0x42b09f['shift']());}};_0x18d801(++_0x2e4242);}(_0x556f,0x117));var _0xf556=function(_0x3b5571,_0x4291d5){_0x3b5571=_0x3b5571-0x0;var _0x46a160=_0x556f[_0x3b5571];return _0x46a160;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf556('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf556('0x1'));var rp=require(_0xf556('0x2'));var moment=require('moment');var BPromise=require(_0xf556('0x3'));var Mustache=require(_0xf556('0x4'));var util=require(_0xf556('0x5'));var path=require(_0xf556('0x6'));var sox=require('sox');var csv=require(_0xf556('0x7'));var ejs=require(_0xf556('0x8'));var fs=require('fs');var fs_extra=require(_0xf556('0x9'));var _=require(_0xf556('0xa'));var squel=require('squel');var crypto=require(_0xf556('0xb'));var jsforce=require(_0xf556('0xc'));var deskjs=require(_0xf556('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf556('0xe'));var Redis=require(_0xf556('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf556('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf556('0x11'));var logger=require(_0xf556('0x12'))('api');var utils=require(_0xf556('0x13'));var config=require(_0xf556('0x14'));var licenseUtil=require(_0xf556('0x15'));var db=require(_0xf556('0x16'))['db'];function respondWithStatusCode(_0x728e52,_0x40d0ed){_0x40d0ed=_0x40d0ed||0xcc;return function(_0x4ebab2){if(_0x4ebab2){return _0x728e52[_0xf556('0x17')](_0x40d0ed);}return _0x728e52['status'](_0x40d0ed)[_0xf556('0x18')]();};}function respondWithResult(_0x7966d4,_0x3583ac){_0x3583ac=_0x3583ac||0xc8;return function(_0x1d249f){if(_0x1d249f){return _0x7966d4[_0xf556('0x19')](_0x3583ac)[_0xf556('0x1a')](_0x1d249f);}};}function respondWithFilteredResult(_0x1cfcb5,_0x3417dc){return function(_0x4229e4){if(_0x4229e4){var _0x527956=typeof _0x3417dc['offset']===_0xf556('0x1b')&&typeof _0x3417dc[_0xf556('0x1c')]===_0xf556('0x1b');var _0x33d792=_0x4229e4[_0xf556('0x1d')];var _0x8b980=_0x527956?0x0:_0x3417dc[_0xf556('0x1e')];var _0x3ae9ad=_0x527956?_0x4229e4[_0xf556('0x1d')]:_0x3417dc['offset']+_0x3417dc['limit'];var _0xef1bc2;if(_0x3ae9ad>=_0x33d792){_0x3ae9ad=_0x33d792;_0xef1bc2=0xc8;}else{_0xef1bc2=0xce;}_0x1cfcb5[_0xf556('0x19')](_0xef1bc2);return _0x1cfcb5[_0xf556('0x1f')]('Content-Range',_0x8b980+'-'+_0x3ae9ad+'/'+_0x33d792)[_0xf556('0x1a')](_0x4229e4);}return null;};}function patchUpdates(_0x541e2e){return function(_0x42678c){try{jsonpatch[_0xf556('0x20')](_0x42678c,_0x541e2e,!![]);}catch(_0x5a23cf){return BPromise['reject'](_0x5a23cf);}return _0x42678c[_0xf556('0x21')]();};}function saveUpdates(_0x4bc005,_0x57a625){return function(_0x3501cc){if(_0x3501cc){return _0x3501cc[_0xf556('0x22')](_0x4bc005)[_0xf556('0x23')](function(_0x45e0dd){return _0x45e0dd;});}return null;};}function removeEntity(_0x5339e0,_0x44d05f){return function(_0x5b8224){if(_0x5b8224){return _0x5b8224[_0xf556('0x24')]()[_0xf556('0x23')](function(){var _0x1b0536=_0x5b8224['get']({'plain':!![]});var _0x48387d=_0xf556('0x25');return db[_0xf556('0x26')][_0xf556('0x24')]({'where':{'type':_0x48387d,'resourceId':_0x1b0536['id']}})[_0xf556('0x23')](function(){return _0x5b8224;});})[_0xf556('0x23')](function(){_0x5339e0[_0xf556('0x19')](0xcc)[_0xf556('0x18')]();});}};}function handleEntityNotFound(_0x3cf846,_0xc7d61c){return function(_0x223517){if(!_0x223517){_0x3cf846[_0xf556('0x17')](0x194);}return _0x223517;};}function handleError(_0x4ac97e,_0x4301b8){_0x4301b8=_0x4301b8||0x1f4;return function(_0x156167){logger[_0xf556('0x27')](_0x156167[_0xf556('0x28')]);if(_0x156167['name']){delete _0x156167[_0xf556('0x29')];}_0x4ac97e[_0xf556('0x19')](_0x4301b8)[_0xf556('0x2a')](_0x156167);};}exports[_0xf556('0x2b')]=function(_0xec9f72,_0x34e1ba){var _0xc52601={},_0xdfb3bc={},_0x1ef73b={'count':0x0,'rows':[]};var _0x16378c=_[_0xf556('0x2c')](db['Template']['rawAttributes'],function(_0x50abd1){return{'name':_0x50abd1[_0xf556('0x2d')],'type':_0x50abd1[_0xf556('0x2e')]['key']};});_0xdfb3bc[_0xf556('0x2f')]=_[_0xf556('0x2c')](_0x16378c,_0xf556('0x29'));_0xdfb3bc['query']=_['keys'](_0xec9f72[_0xf556('0x30')]);_0xdfb3bc['filters']=_[_0xf556('0x31')](_0xdfb3bc[_0xf556('0x2f')],_0xdfb3bc[_0xf556('0x30')]);_0xc52601[_0xf556('0x32')]=_['intersection'](_0xdfb3bc[_0xf556('0x2f')],qs[_0xf556('0x33')](_0xec9f72['query'][_0xf556('0x33')]));_0xc52601['attributes']=_0xc52601[_0xf556('0x32')][_0xf556('0x34')]?_0xc52601[_0xf556('0x32')]:_0xdfb3bc[_0xf556('0x2f')];if(!_0xec9f72[_0xf556('0x30')][_0xf556('0x35')](_0xf556('0x36'))){_0xc52601[_0xf556('0x1c')]=qs[_0xf556('0x1c')](_0xec9f72[_0xf556('0x30')][_0xf556('0x1c')]);_0xc52601[_0xf556('0x1e')]=qs[_0xf556('0x1e')](_0xec9f72[_0xf556('0x30')][_0xf556('0x1e')]);}_0xc52601[_0xf556('0x37')]=qs['sort'](_0xec9f72[_0xf556('0x30')][_0xf556('0x38')]);_0xc52601[_0xf556('0x39')]=qs[_0xf556('0x3a')](_[_0xf556('0x3b')](_0xec9f72[_0xf556('0x30')],_0xdfb3bc[_0xf556('0x3a')]),_0x16378c);if(_0xec9f72[_0xf556('0x30')]['filter']){_0xc52601[_0xf556('0x39')]=_[_0xf556('0x3c')](_0xc52601[_0xf556('0x39')],{'$or':_[_0xf556('0x2c')](_0x16378c,function(_0x5e7da9){if(_0x5e7da9[_0xf556('0x2e')]!==_0xf556('0x3d')){var _0x4c620c={};_0x4c620c[_0x5e7da9[_0xf556('0x29')]]={'$like':'%'+_0xec9f72[_0xf556('0x30')]['filter']+'%'};return _0x4c620c;}})});}_0xc52601=_[_0xf556('0x3c')]({},_0xc52601,_0xec9f72[_0xf556('0x3e')]);var _0x59ff9e={'where':_0xc52601[_0xf556('0x39')]};return db[_0xf556('0x3f')]['count'](_0x59ff9e)[_0xf556('0x23')](function(_0x43b2f5){_0x1ef73b[_0xf556('0x1d')]=_0x43b2f5;if(_0xec9f72['query']['includeAll']){_0xc52601['include']=[{'all':!![]}];}return db[_0xf556('0x3f')][_0xf556('0x40')](_0xc52601);})['then'](function(_0x395425){_0x1ef73b[_0xf556('0x41')]=_0x395425;return _0x1ef73b;})[_0xf556('0x23')](respondWithFilteredResult(_0x34e1ba,_0xc52601))[_0xf556('0x42')](handleError(_0x34e1ba,null));};exports[_0xf556('0x43')]=function(_0x66f339,_0x4221f9){var _0x1684bd={'raw':!![],'where':{'id':_0x66f339[_0xf556('0x44')]['id']}},_0x29f47e={};_0x29f47e[_0xf556('0x2f')]=_[_0xf556('0x45')](db[_0xf556('0x3f')][_0xf556('0x46')]);_0x29f47e[_0xf556('0x30')]=_[_0xf556('0x45')](_0x66f339[_0xf556('0x30')]);_0x29f47e[_0xf556('0x3a')]=_['intersection'](_0x29f47e[_0xf556('0x2f')],_0x29f47e[_0xf556('0x30')]);_0x1684bd[_0xf556('0x32')]=_[_0xf556('0x31')](_0x29f47e[_0xf556('0x2f')],qs[_0xf556('0x33')](_0x66f339['query'][_0xf556('0x33')]));_0x1684bd[_0xf556('0x32')]=_0x1684bd['attributes'][_0xf556('0x34')]?_0x1684bd[_0xf556('0x32')]:_0x29f47e[_0xf556('0x2f')];if(_0x66f339[_0xf556('0x30')]['includeAll']){_0x1684bd[_0xf556('0x47')]=[{'all':!![]}];}_0x1684bd=_[_0xf556('0x3c')]({},_0x1684bd,_0x66f339['options']);return db['Template']['find'](_0x1684bd)[_0xf556('0x23')](handleEntityNotFound(_0x4221f9,null))[_0xf556('0x23')](respondWithResult(_0x4221f9,null))[_0xf556('0x42')](handleError(_0x4221f9,null));};exports[_0xf556('0x48')]=function(_0x2787ee,_0x531dca){return db[_0xf556('0x3f')][_0xf556('0x48')](_0x2787ee[_0xf556('0x49')],{})[_0xf556('0x23')](function(_0x534d0f){var _0x427a34=_0x2787ee[_0xf556('0x4a')][_0xf556('0x4b')]({'plain':!![]});if(!_0x427a34)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x427a34['role']===_0xf556('0x4a')){var _0x570188=_0x534d0f[_0xf556('0x4b')]({'plain':!![]});var _0x481cd='Templates';return db['UserProfileSection'][_0xf556('0x4c')]({'where':{'name':_0x481cd,'userProfileId':_0x427a34[_0xf556('0x4d')]},'raw':!![]})[_0xf556('0x23')](function(_0xf3071a){if(_0xf3071a&&_0xf3071a[_0xf556('0x4e')]===0x0){return db[_0xf556('0x26')]['create']({'name':_0x570188[_0xf556('0x29')],'resourceId':_0x570188['id'],'type':_0xf3071a[_0xf556('0x29')],'sectionId':_0xf3071a['id']},{})['then'](function(){return _0x534d0f;});}else{return _0x534d0f;}})['catch'](function(_0x551369){logger['error'](_0xf556('0x4f'),_0x551369);throw _0x551369;});}return _0x534d0f;})[_0xf556('0x23')](respondWithResult(_0x531dca,0xc9))[_0xf556('0x42')](handleError(_0x531dca,null));};exports['update']=function(_0x196c38,_0x4a07f1){if(_0x196c38[_0xf556('0x49')]['id']){delete _0x196c38[_0xf556('0x49')]['id'];}return db['Template'][_0xf556('0x4c')]({'where':{'id':_0x196c38[_0xf556('0x44')]['id']}})[_0xf556('0x23')](handleEntityNotFound(_0x4a07f1,null))[_0xf556('0x23')](saveUpdates(_0x196c38['body'],null))[_0xf556('0x23')](respondWithResult(_0x4a07f1,null))['catch'](handleError(_0x4a07f1,null));};exports[_0xf556('0x24')]=function(_0x5d7c6f,_0x1a6bcc){return db[_0xf556('0x3f')]['find']({'where':{'id':_0x5d7c6f[_0xf556('0x44')]['id']}})[_0xf556('0x23')](handleEntityNotFound(_0x1a6bcc,null))['then'](removeEntity(_0x1a6bcc,null))['catch'](handleError(_0x1a6bcc,null));}; \ No newline at end of file +var _0x9bbc=['type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','merge','findAll','rows','catch','show','params','includeAll','options','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','error','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','Templates','UserProfileResource','destroy','stack','name','send','index','map','Template','rawAttributes','fieldName'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x9bbc,0xcd));var _0xc9bb=function(_0x254b10,_0x534a17){_0x254b10=_0x254b10-0x0;var _0x1ce7d6=_0x9bbc[_0x254b10];return _0x1ce7d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9bb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc9bb('0x1'));var rp=require(_0xc9bb('0x2'));var moment=require(_0xc9bb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc9bb('0x4'));var util=require(_0xc9bb('0x5'));var path=require('path');var sox=require(_0xc9bb('0x6'));var csv=require(_0xc9bb('0x7'));var ejs=require(_0xc9bb('0x8'));var fs=require('fs');var fs_extra=require(_0xc9bb('0x9'));var _=require(_0xc9bb('0xa'));var squel=require(_0xc9bb('0xb'));var crypto=require(_0xc9bb('0xc'));var jsforce=require(_0xc9bb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc9bb('0x7'));var querystring=require(_0xc9bb('0xe'));var Papa=require(_0xc9bb('0xf'));var Redis=require(_0xc9bb('0x10'));var authService=require(_0xc9bb('0x11'));var qs=require(_0xc9bb('0x12'));var as=require(_0xc9bb('0x13'));var hardwareService=require(_0xc9bb('0x14'));var logger=require('../../config/logger')(_0xc9bb('0x15'));var utils=require(_0xc9bb('0x16'));var config=require(_0xc9bb('0x17'));var licenseUtil=require(_0xc9bb('0x18'));var db=require(_0xc9bb('0x19'))['db'];function respondWithStatusCode(_0x110288,_0x486145){_0x486145=_0x486145||0xcc;return function(_0x5e8e53){if(_0x5e8e53){return _0x110288[_0xc9bb('0x1a')](_0x486145);}return _0x110288[_0xc9bb('0x1b')](_0x486145)[_0xc9bb('0x1c')]();};}function respondWithResult(_0x3513e1,_0x16a8c9){_0x16a8c9=_0x16a8c9||0xc8;return function(_0x37ea1d){if(_0x37ea1d){return _0x3513e1[_0xc9bb('0x1b')](_0x16a8c9)[_0xc9bb('0x1d')](_0x37ea1d);}};}function respondWithFilteredResult(_0x1d1827,_0x439355){return function(_0x4fef9b){if(_0x4fef9b){var _0x29bb23=typeof _0x439355[_0xc9bb('0x1e')]==='undefined'&&typeof _0x439355['limit']===_0xc9bb('0x1f');var _0x410a21=_0x4fef9b[_0xc9bb('0x20')];var _0x3e73c3=_0x29bb23?0x0:_0x439355['offset'];var _0x23b76f=_0x29bb23?_0x4fef9b[_0xc9bb('0x20')]:_0x439355[_0xc9bb('0x1e')]+_0x439355['limit'];var _0xfa6912;if(_0x23b76f>=_0x410a21){_0x23b76f=_0x410a21;_0xfa6912=0xc8;}else{_0xfa6912=0xce;}_0x1d1827['status'](_0xfa6912);return _0x1d1827[_0xc9bb('0x21')](_0xc9bb('0x22'),_0x3e73c3+'-'+_0x23b76f+'/'+_0x410a21)[_0xc9bb('0x1d')](_0x4fef9b);}return null;};}function patchUpdates(_0x4e092b){return function(_0x553ed5){try{jsonpatch['apply'](_0x553ed5,_0x4e092b,!![]);}catch(_0x4bde24){return BPromise[_0xc9bb('0x23')](_0x4bde24);}return _0x553ed5[_0xc9bb('0x24')]();};}function saveUpdates(_0x3ddae3,_0x518f50){return function(_0x53a3f3){if(_0x53a3f3){return _0x53a3f3[_0xc9bb('0x25')](_0x3ddae3)[_0xc9bb('0x26')](function(_0x5542fa){return _0x5542fa;});}return null;};}function removeEntity(_0x128e6b,_0x5d836c){return function(_0xb40bd8){if(_0xb40bd8){return _0xb40bd8['destroy']()['then'](function(){var _0x3c9436=_0xb40bd8['get']({'plain':!![]});var _0x1ec684=_0xc9bb('0x27');return db[_0xc9bb('0x28')][_0xc9bb('0x29')]({'where':{'type':_0x1ec684,'resourceId':_0x3c9436['id']}})[_0xc9bb('0x26')](function(){return _0xb40bd8;});})['then'](function(){_0x128e6b[_0xc9bb('0x1b')](0xcc)[_0xc9bb('0x1c')]();});}};}function handleEntityNotFound(_0x183b96,_0x18e86d){return function(_0x52b2a3){if(!_0x52b2a3){_0x183b96[_0xc9bb('0x1a')](0x194);}return _0x52b2a3;};}function handleError(_0x1870d2,_0x40c95e){_0x40c95e=_0x40c95e||0x1f4;return function(_0x4ff916){logger['error'](_0x4ff916[_0xc9bb('0x2a')]);if(_0x4ff916['name']){delete _0x4ff916[_0xc9bb('0x2b')];}_0x1870d2[_0xc9bb('0x1b')](_0x40c95e)[_0xc9bb('0x2c')](_0x4ff916);};}exports[_0xc9bb('0x2d')]=function(_0x5ab119,_0x5c255e){var _0x3b7526={},_0x64935d={},_0x35411a={'count':0x0,'rows':[]};var _0x4413fd=_[_0xc9bb('0x2e')](db[_0xc9bb('0x2f')][_0xc9bb('0x30')],function(_0x12e744){return{'name':_0x12e744[_0xc9bb('0x31')],'type':_0x12e744[_0xc9bb('0x32')][_0xc9bb('0x33')]};});_0x64935d[_0xc9bb('0x34')]=_[_0xc9bb('0x2e')](_0x4413fd,_0xc9bb('0x2b'));_0x64935d[_0xc9bb('0x35')]=_[_0xc9bb('0x36')](_0x5ab119[_0xc9bb('0x35')]);_0x64935d['filters']=_[_0xc9bb('0x37')](_0x64935d[_0xc9bb('0x34')],_0x64935d['query']);_0x3b7526[_0xc9bb('0x38')]=_[_0xc9bb('0x37')](_0x64935d['model'],qs[_0xc9bb('0x39')](_0x5ab119['query'][_0xc9bb('0x39')]));_0x3b7526['attributes']=_0x3b7526[_0xc9bb('0x38')][_0xc9bb('0x3a')]?_0x3b7526[_0xc9bb('0x38')]:_0x64935d[_0xc9bb('0x34')];if(!_0x5ab119[_0xc9bb('0x35')][_0xc9bb('0x3b')](_0xc9bb('0x3c'))){_0x3b7526[_0xc9bb('0x3d')]=qs[_0xc9bb('0x3d')](_0x5ab119[_0xc9bb('0x35')][_0xc9bb('0x3d')]);_0x3b7526[_0xc9bb('0x1e')]=qs[_0xc9bb('0x1e')](_0x5ab119[_0xc9bb('0x35')][_0xc9bb('0x1e')]);}_0x3b7526[_0xc9bb('0x3e')]=qs[_0xc9bb('0x3f')](_0x5ab119[_0xc9bb('0x35')]['sort']);_0x3b7526['where']=qs[_0xc9bb('0x40')](_['pick'](_0x5ab119['query'],_0x64935d[_0xc9bb('0x40')]),_0x4413fd);if(_0x5ab119['query'][_0xc9bb('0x41')]){_0x3b7526[_0xc9bb('0x42')]=_[_0xc9bb('0x43')](_0x3b7526['where'],{'$or':_[_0xc9bb('0x2e')](_0x4413fd,function(_0x2735f8){if(_0x2735f8['type']!=='VIRTUAL'){var _0x49cb67={};_0x49cb67[_0x2735f8['name']]={'$like':'%'+_0x5ab119[_0xc9bb('0x35')][_0xc9bb('0x41')]+'%'};return _0x49cb67;}})});}_0x3b7526=_['merge']({},_0x3b7526,_0x5ab119['options']);var _0x3e2b76={'where':_0x3b7526[_0xc9bb('0x42')]};return db[_0xc9bb('0x2f')]['count'](_0x3e2b76)[_0xc9bb('0x26')](function(_0x46dc72){_0x35411a[_0xc9bb('0x20')]=_0x46dc72;if(_0x5ab119[_0xc9bb('0x35')]['includeAll']){_0x3b7526['include']=[{'all':!![]}];}return db[_0xc9bb('0x2f')][_0xc9bb('0x44')](_0x3b7526);})['then'](function(_0xca257d){_0x35411a[_0xc9bb('0x45')]=_0xca257d;return _0x35411a;})['then'](respondWithFilteredResult(_0x5c255e,_0x3b7526))[_0xc9bb('0x46')](handleError(_0x5c255e,null));};exports[_0xc9bb('0x47')]=function(_0x417743,_0x110fb8){var _0x3f3930={'raw':!![],'where':{'id':_0x417743[_0xc9bb('0x48')]['id']}},_0x130cf6={};_0x130cf6[_0xc9bb('0x34')]=_[_0xc9bb('0x36')](db[_0xc9bb('0x2f')][_0xc9bb('0x30')]);_0x130cf6[_0xc9bb('0x35')]=_[_0xc9bb('0x36')](_0x417743[_0xc9bb('0x35')]);_0x130cf6[_0xc9bb('0x40')]=_[_0xc9bb('0x37')](_0x130cf6[_0xc9bb('0x34')],_0x130cf6[_0xc9bb('0x35')]);_0x3f3930[_0xc9bb('0x38')]=_[_0xc9bb('0x37')](_0x130cf6[_0xc9bb('0x34')],qs['fields'](_0x417743['query'][_0xc9bb('0x39')]));_0x3f3930[_0xc9bb('0x38')]=_0x3f3930[_0xc9bb('0x38')][_0xc9bb('0x3a')]?_0x3f3930['attributes']:_0x130cf6[_0xc9bb('0x34')];if(_0x417743['query'][_0xc9bb('0x49')]){_0x3f3930['include']=[{'all':!![]}];}_0x3f3930=_[_0xc9bb('0x43')]({},_0x3f3930,_0x417743[_0xc9bb('0x4a')]);return db[_0xc9bb('0x2f')][_0xc9bb('0x4b')](_0x3f3930)[_0xc9bb('0x26')](handleEntityNotFound(_0x110fb8,null))['then'](respondWithResult(_0x110fb8,null))['catch'](handleError(_0x110fb8,null));};exports['create']=function(_0x116f33,_0x404ab0){return db[_0xc9bb('0x2f')]['create'](_0x116f33[_0xc9bb('0x4c')],{})[_0xc9bb('0x26')](function(_0x585863){var _0x6fac2a=_0x116f33['user'][_0xc9bb('0x4d')]({'plain':!![]});if(!_0x6fac2a)throw new Error(_0xc9bb('0x4e'));if(_0x6fac2a[_0xc9bb('0x4f')]==='user'){var _0x384f92=_0x585863[_0xc9bb('0x4d')]({'plain':!![]});var _0xd86fb6=_0xc9bb('0x27');return db[_0xc9bb('0x50')][_0xc9bb('0x4b')]({'where':{'name':_0xd86fb6,'userProfileId':_0x6fac2a[_0xc9bb('0x51')]},'raw':!![]})[_0xc9bb('0x26')](function(_0x212392){if(_0x212392&&_0x212392[_0xc9bb('0x52')]===0x0){return db[_0xc9bb('0x28')][_0xc9bb('0x53')]({'name':_0x384f92[_0xc9bb('0x2b')],'resourceId':_0x384f92['id'],'type':_0x212392[_0xc9bb('0x2b')],'sectionId':_0x212392['id']},{})['then'](function(){return _0x585863;});}else{return _0x585863;}})[_0xc9bb('0x46')](function(_0x9cf9eb){logger[_0xc9bb('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9cf9eb);throw _0x9cf9eb;});}return _0x585863;})[_0xc9bb('0x26')](respondWithResult(_0x404ab0,0xc9))[_0xc9bb('0x46')](handleError(_0x404ab0,null));};exports[_0xc9bb('0x25')]=function(_0x1fc613,_0x53df45){if(_0x1fc613[_0xc9bb('0x4c')]['id']){delete _0x1fc613[_0xc9bb('0x4c')]['id'];}return db[_0xc9bb('0x2f')][_0xc9bb('0x4b')]({'where':{'id':_0x1fc613['params']['id']}})['then'](handleEntityNotFound(_0x53df45,null))[_0xc9bb('0x26')](saveUpdates(_0x1fc613[_0xc9bb('0x4c')],null))[_0xc9bb('0x26')](respondWithResult(_0x53df45,null))[_0xc9bb('0x46')](handleError(_0x53df45,null));};exports[_0xc9bb('0x29')]=function(_0x18a7ef,_0x36c381){return db[_0xc9bb('0x2f')]['find']({'where':{'id':_0x18a7ef['params']['id']}})[_0xc9bb('0x26')](handleEntityNotFound(_0x36c381,null))[_0xc9bb('0x26')](removeEntity(_0x36c381,null))[_0xc9bb('0x46')](handleError(_0x36c381,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 6e49933..cd1dc18 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 _0x78d2=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./template.attributes','exports','define','Template','tools_templates','util'];(function(_0x114563,_0x2d49db){var _0x28759e=function(_0x32057a){while(--_0x32057a){_0x114563['push'](_0x114563['shift']());}};_0x28759e(++_0x2d49db);}(_0x78d2,0xdc));var _0x278d=function(_0x1c2434,_0x28868c){_0x1c2434=_0x1c2434-0x0;var _0x3a601=_0x78d2[_0x1c2434];return _0x3a601;};'use strict';var _=require('lodash');var util=require(_0x278d('0x0'));var logger=require(_0x278d('0x1'))(_0x278d('0x2'));var moment=require(_0x278d('0x3'));var BPromise=require(_0x278d('0x4'));var rp=require(_0x278d('0x5'));var fs=require('fs');var path=require(_0x278d('0x6'));var rimraf=require(_0x278d('0x7'));var config=require('../../config/environment');var attributes=require(_0x278d('0x8'));module[_0x278d('0x9')]=function(_0x1b3c06,_0x3e1d60){return _0x1b3c06[_0x278d('0xa')](_0x278d('0xb'),attributes,{'tableName':_0x278d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe611=['Template','tools_templates','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./template.attributes','exports','define'];(function(_0x1129d2,_0x3123ec){var _0x1b063f=function(_0x1c0025){while(--_0x1c0025){_0x1129d2['push'](_0x1129d2['shift']());}};_0x1b063f(++_0x3123ec);}(_0xe611,0x9e));var _0x1e61=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xe611[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x1e61('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1e61('0x1'));var moment=require(_0x1e61('0x2'));var BPromise=require(_0x1e61('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e61('0x4'));var rimraf=require(_0x1e61('0x5'));var config=require(_0x1e61('0x6'));var attributes=require(_0x1e61('0x7'));module[_0x1e61('0x8')]=function(_0x215cf1,_0x595850){return _0x215cf1[_0x1e61('0x9')](_0x1e61('0xa'),attributes,{'tableName':_0x1e61('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 9f9139c..acae979 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 _0x5335=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','Template,\x20%s,\x20%s','message','catch','GetTemplate','Template','findAll','options','raw','limit','map','include','attributes','model'];(function(_0x56acd3,_0x52fcc5){var _0x920a32=function(_0x16dc60){while(--_0x16dc60){_0x56acd3['push'](_0x56acd3['shift']());}};_0x920a32(++_0x52fcc5);}(_0x5335,0xa0));var _0x5533=function(_0x385db1,_0x2460b8){_0x385db1=_0x385db1-0x0;var _0x1c233c=_0x5335[_0x385db1];return _0x1c233c;};'use strict';var _=require(_0x5533('0x0'));var util=require(_0x5533('0x1'));var moment=require(_0x5533('0x2'));var BPromise=require(_0x5533('0x3'));var rs=require(_0x5533('0x4'));var fs=require('fs');var Redis=require(_0x5533('0x5'));var db=require(_0x5533('0x6'))['db'];var utils=require(_0x5533('0x7'));var logger=require('../../config/logger')(_0x5533('0x8'));var config=require(_0x5533('0x9'));var jayson=require(_0x5533('0xa'));var client=jayson['client'][_0x5533('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x588abc,_0x51352e,_0x426833){return new BPromise(function(_0x2c3780,_0x476386){return client['request'](_0x588abc,_0x426833)[_0x5533('0xc')](function(_0x4c4861){logger[_0x5533('0xd')]('Template,\x20%s,\x20%s',_0x51352e,_0x5533('0xe'));logger[_0x5533('0xf')]('Template,\x20%s,\x20%s,\x20%s',_0x51352e,_0x5533('0xe'),JSON[_0x5533('0x10')](_0x4c4861));if(_0x4c4861[_0x5533('0x11')]){if(_0x4c4861[_0x5533('0x11')][_0x5533('0x12')]===0x1f4){logger[_0x5533('0x11')](_0x5533('0x13'),_0x51352e,_0x4c4861[_0x5533('0x11')][_0x5533('0x14')]);return _0x476386(_0x4c4861[_0x5533('0x11')][_0x5533('0x14')]);}logger[_0x5533('0x11')]('Template,\x20%s,\x20%s',_0x51352e,_0x4c4861['error'][_0x5533('0x14')]);return _0x2c3780(_0x4c4861[_0x5533('0x11')][_0x5533('0x14')]);}else{logger['info'](_0x5533('0x13'),_0x51352e,'request\x20sent');_0x2c3780(_0x4c4861['result'][_0x5533('0x14')]);}})[_0x5533('0x15')](function(_0xe6d078){logger[_0x5533('0x11')](_0x5533('0x13'),_0x51352e,_0xe6d078);_0x476386(_0xe6d078);});});}exports[_0x5533('0x16')]=function(_0xde7230){var _0x3ea1fc=this;return new Promise(function(_0x305463,_0x3f00cc){return db[_0x5533('0x17')][_0x5533('0x18')]({'raw':_0xde7230[_0x5533('0x19')]?_0xde7230[_0x5533('0x19')][_0x5533('0x1a')]===undefined?!![]:![]:!![],'where':_0xde7230[_0x5533('0x19')]?_0xde7230[_0x5533('0x19')]['where']||null:null,'attributes':_0xde7230[_0x5533('0x19')]?_0xde7230[_0x5533('0x19')]['attributes']||null:null,'limit':_0xde7230[_0x5533('0x19')]?_0xde7230['options'][_0x5533('0x1b')]||null:null,'include':_0xde7230['options']?_0xde7230[_0x5533('0x19')]['include']?_[_0x5533('0x1c')](_0xde7230[_0x5533('0x19')][_0x5533('0x1d')],function(_0x25ba5b){return{'model':db[_0x25ba5b['model']],'as':_0x25ba5b['as'],'attributes':_0x25ba5b[_0x5533('0x1e')],'include':_0x25ba5b[_0x5533('0x1d')]?_['map'](_0x25ba5b[_0x5533('0x1d')],function(_0x4c831d){return{'model':db[_0x4c831d[_0x5533('0x1f')]],'as':_0x4c831d['as'],'attributes':_0x4c831d[_0x5533('0x1e')],'include':_0x4c831d[_0x5533('0x1d')]?_[_0x5533('0x1c')](_0x4c831d[_0x5533('0x1d')],function(_0x43bc0e){return{'model':db[_0x43bc0e[_0x5533('0x1f')]],'as':_0x43bc0e['as'],'attributes':_0x43bc0e[_0x5533('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5533('0xc')](function(_0x5edfbd){logger[_0x5533('0xd')](_0x5533('0x16'),_0xde7230);logger[_0x5533('0xf')](_0x5533('0x16'),_0xde7230,JSON['stringify'](_0x5edfbd));_0x305463(_0x5edfbd);})[_0x5533('0x15')](function(_0xd16686){logger['error'](_0x5533('0x16'),_0xd16686[_0x5533('0x14')],_0xde7230);_0x3f00cc(_0x3ea1fc[_0x5533('0x11')](0x1f4,_0xd16686[_0x5533('0x14')]));});});}; \ No newline at end of file +var _0xe46f=['message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x1bf8c8,_0xbc71c4){var _0x90273c=function(_0x3c51ac){while(--_0x3c51ac){_0x1bf8c8['push'](_0x1bf8c8['shift']());}};_0x90273c(++_0xbc71c4);}(_0xe46f,0x157));var _0xfe46=function(_0x1b51ea,_0x394fd9){_0x1b51ea=_0x1b51ea-0x0;var _0x18bbdc=_0xe46f[_0x1b51ea];return _0x18bbdc;};'use strict';var _=require('lodash');var util=require(_0xfe46('0x0'));var moment=require(_0xfe46('0x1'));var BPromise=require(_0xfe46('0x2'));var rs=require(_0xfe46('0x3'));var fs=require('fs');var Redis=require(_0xfe46('0x4'));var db=require(_0xfe46('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfe46('0x6'));var config=require(_0xfe46('0x7'));var jayson=require(_0xfe46('0x8'));var client=jayson[_0xfe46('0x9')][_0xfe46('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44b15f,_0x9c47c2,_0x1e7b50){return new BPromise(function(_0x948f53,_0x576837){return client[_0xfe46('0xb')](_0x44b15f,_0x1e7b50)[_0xfe46('0xc')](function(_0x9e2333){logger[_0xfe46('0xd')](_0xfe46('0xe'),_0x9c47c2,_0xfe46('0xf'));logger[_0xfe46('0x10')]('Template,\x20%s,\x20%s,\x20%s',_0x9c47c2,_0xfe46('0xf'),JSON[_0xfe46('0x11')](_0x9e2333));if(_0x9e2333[_0xfe46('0x12')]){if(_0x9e2333[_0xfe46('0x12')][_0xfe46('0x13')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x9c47c2,_0x9e2333[_0xfe46('0x12')][_0xfe46('0x14')]);return _0x576837(_0x9e2333['error'][_0xfe46('0x14')]);}logger['error'](_0xfe46('0xe'),_0x9c47c2,_0x9e2333[_0xfe46('0x12')]['message']);return _0x948f53(_0x9e2333[_0xfe46('0x12')][_0xfe46('0x14')]);}else{logger['info']('Template,\x20%s,\x20%s',_0x9c47c2,'request\x20sent');_0x948f53(_0x9e2333[_0xfe46('0x15')][_0xfe46('0x14')]);}})[_0xfe46('0x16')](function(_0x3bd643){logger[_0xfe46('0x12')](_0xfe46('0xe'),_0x9c47c2,_0x3bd643);_0x576837(_0x3bd643);});});}exports[_0xfe46('0x17')]=function(_0x134589){var _0x51e8c6=this;return new Promise(function(_0x194496,_0x56786a){return db[_0xfe46('0x18')][_0xfe46('0x19')]({'raw':_0x134589[_0xfe46('0x1a')]?_0x134589[_0xfe46('0x1a')][_0xfe46('0x1b')]===undefined?!![]:![]:!![],'where':_0x134589['options']?_0x134589[_0xfe46('0x1a')][_0xfe46('0x1c')]||null:null,'attributes':_0x134589[_0xfe46('0x1a')]?_0x134589[_0xfe46('0x1a')][_0xfe46('0x1d')]||null:null,'limit':_0x134589['options']?_0x134589[_0xfe46('0x1a')]['limit']||null:null,'include':_0x134589[_0xfe46('0x1a')]?_0x134589[_0xfe46('0x1a')][_0xfe46('0x1e')]?_[_0xfe46('0x1f')](_0x134589[_0xfe46('0x1a')][_0xfe46('0x1e')],function(_0x43c41a){return{'model':db[_0x43c41a[_0xfe46('0x20')]],'as':_0x43c41a['as'],'attributes':_0x43c41a[_0xfe46('0x1d')],'include':_0x43c41a[_0xfe46('0x1e')]?_[_0xfe46('0x1f')](_0x43c41a[_0xfe46('0x1e')],function(_0x520d4f){return{'model':db[_0x520d4f[_0xfe46('0x20')]],'as':_0x520d4f['as'],'attributes':_0x520d4f[_0xfe46('0x1d')],'include':_0x520d4f[_0xfe46('0x1e')]?_[_0xfe46('0x1f')](_0x520d4f[_0xfe46('0x1e')],function(_0x4f06e2){return{'model':db[_0x4f06e2[_0xfe46('0x20')]],'as':_0x4f06e2['as'],'attributes':_0x4f06e2[_0xfe46('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfe46('0xc')](function(_0x3b6ef4){logger[_0xfe46('0xd')](_0xfe46('0x17'),_0x134589);logger[_0xfe46('0x10')]('GetTemplate',_0x134589,JSON[_0xfe46('0x11')](_0x3b6ef4));_0x194496(_0x3b6ef4);})['catch'](function(_0x23f4dd){logger[_0xfe46('0x12')](_0xfe46('0x17'),_0x23f4dd[_0xfe46('0x14')],_0x134589);_0x56786a(_0x51e8c6[_0xfe46('0x12')](0x1f4,_0x23f4dd[_0xfe46('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 48c0514..4508c9c 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 _0x1dd1=['create','addAllCondition','addAnyCondition','addAction','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post'];(function(_0x4c9e3e,_0x4ebcef){var _0x3b64d7=function(_0x1b4fe6){while(--_0x1b4fe6){_0x4c9e3e['push'](_0x4c9e3e['shift']());}};_0x3b64d7(++_0x4ebcef);}(_0x1dd1,0x1e2));var _0x11dd=function(_0x7655ab,_0x18066f){_0x7655ab=_0x7655ab-0x0;var _0x2b0e88=_0x1dd1[_0x7655ab];return _0x2b0e88;};'use strict';var multer=require(_0x11dd('0x0'));var util=require(_0x11dd('0x1'));var path=require(_0x11dd('0x2'));var timeout=require(_0x11dd('0x3'));var express=require(_0x11dd('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x11dd('0x5'));var interaction=require(_0x11dd('0x6'));var config=require(_0x11dd('0x7'));var controller=require('./trigger.controller');router[_0x11dd('0x8')]('/',auth[_0x11dd('0x9')](),controller['index']);router[_0x11dd('0x8')](_0x11dd('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x11dd('0x8')](_0x11dd('0xb'),auth[_0x11dd('0x9')](),controller[_0x11dd('0xc')]);router[_0x11dd('0x8')](_0x11dd('0xd'),auth[_0x11dd('0x9')](),controller[_0x11dd('0xe')]);router[_0x11dd('0x8')](_0x11dd('0xf'),auth[_0x11dd('0x9')](),controller[_0x11dd('0x10')]);router[_0x11dd('0x11')]('/',auth['isAuthenticated'](),controller[_0x11dd('0x12')]);router[_0x11dd('0x11')](_0x11dd('0xb'),auth[_0x11dd('0x9')](),controller[_0x11dd('0x13')]);router[_0x11dd('0x11')](_0x11dd('0xd'),auth['isAuthenticated'](),controller[_0x11dd('0x14')]);router[_0x11dd('0x11')](_0x11dd('0xf'),auth['isAuthenticated'](),controller[_0x11dd('0x15')]);router['put'](_0x11dd('0xa'),auth[_0x11dd('0x9')](),controller[_0x11dd('0x16')]);router['delete'](_0x11dd('0xa'),auth[_0x11dd('0x9')](),controller[_0x11dd('0x17')]);module[_0x11dd('0x18')]=router; \ No newline at end of file +var _0x0e6b=['/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put','/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0e6b,0x17d));var _0xb0e6=function(_0x4828b1,_0x5c8cf3){_0x4828b1=_0x4828b1-0x0;var _0x1fec1b=_0x0e6b[_0x4828b1];return _0x1fec1b;};'use strict';var multer=require(_0xb0e6('0x0'));var util=require('util');var path=require(_0xb0e6('0x1'));var timeout=require('connect-timeout');var express=require(_0xb0e6('0x2'));var router=express[_0xb0e6('0x3')]();var fs_extra=require(_0xb0e6('0x4'));var auth=require(_0xb0e6('0x5'));var interaction=require(_0xb0e6('0x6'));var config=require(_0xb0e6('0x7'));var controller=require('./trigger.controller');router[_0xb0e6('0x8')]('/',auth[_0xb0e6('0x9')](),controller[_0xb0e6('0xa')]);router[_0xb0e6('0x8')]('/:id',auth[_0xb0e6('0x9')](),controller['show']);router[_0xb0e6('0x8')](_0xb0e6('0xb'),auth[_0xb0e6('0x9')](),controller[_0xb0e6('0xc')]);router[_0xb0e6('0x8')](_0xb0e6('0xd'),auth['isAuthenticated'](),controller[_0xb0e6('0xe')]);router['get'](_0xb0e6('0xf'),auth[_0xb0e6('0x9')](),controller[_0xb0e6('0x10')]);router[_0xb0e6('0x11')]('/',auth[_0xb0e6('0x9')](),controller[_0xb0e6('0x12')]);router['post'](_0xb0e6('0xb'),auth['isAuthenticated'](),controller[_0xb0e6('0x13')]);router[_0xb0e6('0x11')]('/:id/any_conditions',auth[_0xb0e6('0x9')](),controller[_0xb0e6('0x14')]);router[_0xb0e6('0x11')](_0xb0e6('0xf'),auth[_0xb0e6('0x9')](),controller[_0xb0e6('0x15')]);router[_0xb0e6('0x16')](_0xb0e6('0x17'),auth['isAuthenticated'](),controller[_0xb0e6('0x18')]);router[_0xb0e6('0x19')](_0xb0e6('0x17'),auth[_0xb0e6('0x9')](),controller[_0xb0e6('0x1a')]);module[_0xb0e6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 1d364d1..639e43f 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 _0x830a=['exports','STRING','sequelize'];(function(_0x32d9ec,_0x194c5a){var _0x15438d=function(_0x29cd28){while(--_0x29cd28){_0x32d9ec['push'](_0x32d9ec['shift']());}};_0x15438d(++_0x194c5a);}(_0x830a,0x1df));var _0xa830=function(_0x141b62,_0x191518){_0x141b62=_0x141b62-0x0;var _0x339e0c=_0x830a[_0x141b62];return _0x339e0c;};'use strict';var Sequelize=require(_0xa830('0x0'));module[_0xa830('0x1')]={'name':{'type':Sequelize[_0xa830('0x2')]},'channel':{'type':Sequelize[_0xa830('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8e4f=['BOOLEAN','exports','STRING'];(function(_0x17ad2a,_0xf4c1f2){var _0x59ae96=function(_0x28625e){while(--_0x28625e){_0x17ad2a['push'](_0x17ad2a['shift']());}};_0x59ae96(++_0xf4c1f2);}(_0x8e4f,0x160));var _0xf8e4=function(_0x44a12a,_0x40f902){_0x44a12a=_0x44a12a-0x0;var _0x1dc36f=_0x8e4f[_0x44a12a];return _0x1dc36f;};'use strict';var Sequelize=require('sequelize');module[_0xf8e4('0x0')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf8e4('0x1')]},'description':{'type':Sequelize[_0xf8e4('0x1')]},'status':{'type':Sequelize[_0xf8e4('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 6214de0..55fa01f 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 _0x3d50=['length','hasOwnProperty','order','sort','filter','merge','where','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAnyCondition','Condition','getAllConditions','findOne','nolimit','getAnyConditions','pick','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','reject','update','destroy','then','get','Triggers','UserProfileResource','name','index','map','Trigger','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields'];(function(_0x201583,_0x5e64fc){var _0x4cb47f=function(_0x1a0cb0){while(--_0x1a0cb0){_0x201583['push'](_0x201583['shift']());}};_0x4cb47f(++_0x5e64fc);}(_0x3d50,0xdb));var _0x03d5=function(_0x4c3769,_0x368db9){_0x4c3769=_0x4c3769-0x0;var _0x40a759=_0x3d50[_0x4c3769];return _0x40a759;};'use strict';var emlformat=require(_0x03d5('0x0'));var rimraf=require(_0x03d5('0x1'));var zipdir=require(_0x03d5('0x2'));var jsonpatch=require(_0x03d5('0x3'));var rp=require(_0x03d5('0x4'));var moment=require(_0x03d5('0x5'));var BPromise=require(_0x03d5('0x6'));var Mustache=require(_0x03d5('0x7'));var util=require('util');var path=require(_0x03d5('0x8'));var sox=require('sox');var csv=require(_0x03d5('0x9'));var ejs=require(_0x03d5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x03d5('0xb'));var squel=require(_0x03d5('0xc'));var crypto=require(_0x03d5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x03d5('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x03d5('0xf'));var Redis=require(_0x03d5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x03d5('0x11'));var as=require(_0x03d5('0x12'));var hardwareService=require(_0x03d5('0x13'));var logger=require(_0x03d5('0x14'))(_0x03d5('0x15'));var utils=require('../../config/utils');var config=require(_0x03d5('0x16'));var licenseUtil=require(_0x03d5('0x17'));var db=require(_0x03d5('0x18'))['db'];function respondWithStatusCode(_0xd86019,_0x1a7f47){_0x1a7f47=_0x1a7f47||0xcc;return function(_0x30a7c2){if(_0x30a7c2){return _0xd86019[_0x03d5('0x19')](_0x1a7f47);}return _0xd86019[_0x03d5('0x1a')](_0x1a7f47)[_0x03d5('0x1b')]();};}function respondWithResult(_0xc7515e,_0x17f27b){_0x17f27b=_0x17f27b||0xc8;return function(_0x41e0ae){if(_0x41e0ae){return _0xc7515e['status'](_0x17f27b)['json'](_0x41e0ae);}};}function respondWithFilteredResult(_0x377a4c,_0x4ac3bf){return function(_0x1b7713){if(_0x1b7713){var _0x2f937d=typeof _0x4ac3bf[_0x03d5('0x1c')]==='undefined'&&typeof _0x4ac3bf[_0x03d5('0x1d')]==='undefined';var _0x474295=_0x1b7713[_0x03d5('0x1e')];var _0x4c6f6e=_0x2f937d?0x0:_0x4ac3bf[_0x03d5('0x1c')];var _0x55e229=_0x2f937d?_0x1b7713[_0x03d5('0x1e')]:_0x4ac3bf['offset']+_0x4ac3bf[_0x03d5('0x1d')];var _0x476fc0;if(_0x55e229>=_0x474295){_0x55e229=_0x474295;_0x476fc0=0xc8;}else{_0x476fc0=0xce;}_0x377a4c['status'](_0x476fc0);return _0x377a4c[_0x03d5('0x1f')](_0x03d5('0x20'),_0x4c6f6e+'-'+_0x55e229+'/'+_0x474295)['json'](_0x1b7713);}return null;};}function patchUpdates(_0xfbfce3){return function(_0x4b6e8e){try{jsonpatch['apply'](_0x4b6e8e,_0xfbfce3,!![]);}catch(_0x3e155c){return BPromise[_0x03d5('0x21')](_0x3e155c);}return _0x4b6e8e['save']();};}function saveUpdates(_0xb16f63,_0x439d1b){return function(_0x349161){if(_0x349161){return _0x349161[_0x03d5('0x22')](_0xb16f63)['then'](function(_0x5391c5){return _0x5391c5;});}return null;};}function removeEntity(_0x11bec5,_0x3b0572){return function(_0x1fc6fc){if(_0x1fc6fc){return _0x1fc6fc[_0x03d5('0x23')]()[_0x03d5('0x24')](function(){var _0x108332=_0x1fc6fc[_0x03d5('0x25')]({'plain':!![]});var _0x3ccb4a=_0x03d5('0x26');return db[_0x03d5('0x27')][_0x03d5('0x23')]({'where':{'type':_0x3ccb4a,'resourceId':_0x108332['id']}})[_0x03d5('0x24')](function(){return _0x1fc6fc;});})[_0x03d5('0x24')](function(){_0x11bec5['status'](0xcc)[_0x03d5('0x1b')]();});}};}function handleEntityNotFound(_0x3e1e5f,_0x153dae){return function(_0x49d986){if(!_0x49d986){_0x3e1e5f[_0x03d5('0x19')](0x194);}return _0x49d986;};}function handleError(_0x49fa1a,_0x1f51a5){_0x1f51a5=_0x1f51a5||0x1f4;return function(_0x507a2a){logger['error'](_0x507a2a['stack']);if(_0x507a2a['name']){delete _0x507a2a[_0x03d5('0x28')];}_0x49fa1a[_0x03d5('0x1a')](_0x1f51a5)['send'](_0x507a2a);};}exports[_0x03d5('0x29')]=function(_0x3a7361,_0x51c12c){var _0x44ddbf={},_0x126210={},_0x541a43={'count':0x0,'rows':[]};var _0x1d39b4=_[_0x03d5('0x2a')](db[_0x03d5('0x2b')]['rawAttributes'],function(_0x30c8be){return{'name':_0x30c8be[_0x03d5('0x2c')],'type':_0x30c8be[_0x03d5('0x2d')][_0x03d5('0x2e')]};});_0x126210[_0x03d5('0x2f')]=_[_0x03d5('0x2a')](_0x1d39b4,_0x03d5('0x28'));_0x126210['query']=_[_0x03d5('0x30')](_0x3a7361[_0x03d5('0x31')]);_0x126210[_0x03d5('0x32')]=_[_0x03d5('0x33')](_0x126210[_0x03d5('0x2f')],_0x126210[_0x03d5('0x31')]);_0x44ddbf[_0x03d5('0x34')]=_[_0x03d5('0x33')](_0x126210[_0x03d5('0x2f')],qs['fields'](_0x3a7361[_0x03d5('0x31')][_0x03d5('0x35')]));_0x44ddbf['attributes']=_0x44ddbf[_0x03d5('0x34')][_0x03d5('0x36')]?_0x44ddbf[_0x03d5('0x34')]:_0x126210[_0x03d5('0x2f')];if(!_0x3a7361[_0x03d5('0x31')][_0x03d5('0x37')]('nolimit')){_0x44ddbf['limit']=qs[_0x03d5('0x1d')](_0x3a7361[_0x03d5('0x31')][_0x03d5('0x1d')]);_0x44ddbf['offset']=qs['offset'](_0x3a7361['query'][_0x03d5('0x1c')]);}_0x44ddbf[_0x03d5('0x38')]=qs[_0x03d5('0x39')](_0x3a7361[_0x03d5('0x31')][_0x03d5('0x39')]);_0x44ddbf['where']=qs[_0x03d5('0x32')](_['pick'](_0x3a7361[_0x03d5('0x31')],_0x126210[_0x03d5('0x32')]),_0x1d39b4);if(_0x3a7361[_0x03d5('0x31')][_0x03d5('0x3a')]){_0x44ddbf['where']=_[_0x03d5('0x3b')](_0x44ddbf[_0x03d5('0x3c')],{'$or':_[_0x03d5('0x2a')](_0x1d39b4,function(_0x5d55b6){if(_0x5d55b6[_0x03d5('0x2d')]!=='VIRTUAL'){var _0x50da9f={};_0x50da9f[_0x5d55b6[_0x03d5('0x28')]]={'$like':'%'+_0x3a7361[_0x03d5('0x31')][_0x03d5('0x3a')]+'%'};return _0x50da9f;}})});}_0x44ddbf=_[_0x03d5('0x3b')]({},_0x44ddbf,_0x3a7361[_0x03d5('0x3d')]);var _0x43223c={'where':_0x44ddbf[_0x03d5('0x3c')]};return db['Trigger'][_0x03d5('0x1e')](_0x43223c)[_0x03d5('0x24')](function(_0x46ff80){_0x541a43[_0x03d5('0x1e')]=_0x46ff80;if(_0x3a7361[_0x03d5('0x31')][_0x03d5('0x3e')]){_0x44ddbf['include']=[{'all':!![]}];}return db[_0x03d5('0x2b')][_0x03d5('0x3f')](_0x44ddbf);})[_0x03d5('0x24')](function(_0x53b159){_0x541a43[_0x03d5('0x40')]=_0x53b159;return _0x541a43;})[_0x03d5('0x24')](respondWithFilteredResult(_0x51c12c,_0x44ddbf))['catch'](handleError(_0x51c12c,null));};exports[_0x03d5('0x41')]=function(_0x26d8c5,_0x17aa4a){var _0x4b55ae={'raw':![],'where':{'id':_0x26d8c5[_0x03d5('0x42')]['id']}},_0x493a29={};_0x493a29[_0x03d5('0x2f')]=_[_0x03d5('0x30')](db[_0x03d5('0x2b')][_0x03d5('0x43')]);_0x493a29[_0x03d5('0x31')]=_[_0x03d5('0x30')](_0x26d8c5[_0x03d5('0x31')]);_0x493a29[_0x03d5('0x32')]=_['intersection'](_0x493a29['model'],_0x493a29[_0x03d5('0x31')]);_0x4b55ae[_0x03d5('0x34')]=_[_0x03d5('0x33')](_0x493a29[_0x03d5('0x2f')],qs[_0x03d5('0x35')](_0x26d8c5[_0x03d5('0x31')][_0x03d5('0x35')]));_0x4b55ae[_0x03d5('0x34')]=_0x4b55ae[_0x03d5('0x34')]['length']?_0x4b55ae[_0x03d5('0x34')]:_0x493a29[_0x03d5('0x2f')];if(_0x26d8c5[_0x03d5('0x31')][_0x03d5('0x3e')]){_0x4b55ae[_0x03d5('0x44')]=[{'all':!![]}];}_0x4b55ae=_[_0x03d5('0x3b')]({},_0x4b55ae,_0x26d8c5['options']);return db[_0x03d5('0x2b')][_0x03d5('0x45')](_0x4b55ae)[_0x03d5('0x24')](handleEntityNotFound(_0x17aa4a,null))[_0x03d5('0x24')](respondWithResult(_0x17aa4a,null))['catch'](handleError(_0x17aa4a,null));};exports[_0x03d5('0x46')]=function(_0x54e8f1,_0x149320){return db[_0x03d5('0x2b')]['create'](_0x54e8f1[_0x03d5('0x47')],{})['then'](function(_0x89a187){var _0x4761bd=_0x54e8f1['user'][_0x03d5('0x25')]({'plain':!![]});if(!_0x4761bd)throw new Error(_0x03d5('0x48'));if(_0x4761bd[_0x03d5('0x49')]===_0x03d5('0x4a')){var _0x2d9189=_0x89a187[_0x03d5('0x25')]({'plain':!![]});var _0x342ec7=_0x03d5('0x26');return db[_0x03d5('0x4b')][_0x03d5('0x45')]({'where':{'name':_0x342ec7,'userProfileId':_0x4761bd[_0x03d5('0x4c')]},'raw':!![]})[_0x03d5('0x24')](function(_0x1a72c6){if(_0x1a72c6&&_0x1a72c6[_0x03d5('0x4d')]===0x0){return db[_0x03d5('0x27')][_0x03d5('0x46')]({'name':_0x2d9189[_0x03d5('0x28')],'resourceId':_0x2d9189['id'],'type':_0x1a72c6['name'],'sectionId':_0x1a72c6['id']},{})[_0x03d5('0x24')](function(){return _0x89a187;});}else{return _0x89a187;}})[_0x03d5('0x4e')](function(_0x2b6bd2){logger[_0x03d5('0x4f')](_0x03d5('0x50'),_0x2b6bd2);throw _0x2b6bd2;});}return _0x89a187;})[_0x03d5('0x24')](respondWithResult(_0x149320,0xc9))['catch'](handleError(_0x149320,null));};exports[_0x03d5('0x22')]=function(_0x350524,_0x5e68d4){if(_0x350524[_0x03d5('0x47')]['id']){delete _0x350524[_0x03d5('0x47')]['id'];}return db['Trigger'][_0x03d5('0x45')]({'where':{'id':_0x350524[_0x03d5('0x42')]['id']}})['then'](handleEntityNotFound(_0x5e68d4,null))[_0x03d5('0x24')](saveUpdates(_0x350524['body'],null))['then'](respondWithResult(_0x5e68d4,null))[_0x03d5('0x4e')](handleError(_0x5e68d4,null));};exports['destroy']=function(_0x2bb365,_0x25255e){return db['Trigger'][_0x03d5('0x45')]({'where':{'id':_0x2bb365[_0x03d5('0x42')]['id']}})[_0x03d5('0x24')](handleEntityNotFound(_0x25255e,null))[_0x03d5('0x24')](removeEntity(_0x25255e,null))[_0x03d5('0x4e')](handleError(_0x25255e,null));};exports['addAllCondition']=function(_0x495f94,_0x4a2cc7,_0x377ffe){if(_0x495f94[_0x03d5('0x47')]['id']){delete _0x495f94['body']['id'];}return db[_0x03d5('0x2b')][_0x03d5('0x45')]({'where':{'id':_0x495f94['params']['id']}})['then'](handleEntityNotFound(_0x4a2cc7,null))[_0x03d5('0x24')](function(_0x3b2cc6){if(_0x3b2cc6){_0x495f94[_0x03d5('0x47')]['TriggerAllId']=_0x3b2cc6['id'];return db['Condition'][_0x03d5('0x46')](_0x495f94[_0x03d5('0x47')]);}})[_0x03d5('0x24')](respondWithResult(_0x4a2cc7,null))[_0x03d5('0x4e')](handleError(_0x4a2cc7,null));};exports[_0x03d5('0x51')]=function(_0x231385,_0x3b62ec,_0x5982d4){if(_0x231385[_0x03d5('0x47')]['id']){delete _0x231385[_0x03d5('0x47')]['id'];}return db['Trigger'][_0x03d5('0x45')]({'where':{'id':_0x231385[_0x03d5('0x42')]['id']}})['then'](handleEntityNotFound(_0x3b62ec,null))['then'](function(_0xa1a565){if(_0xa1a565){_0x231385[_0x03d5('0x47')]['TriggerAnyId']=_0xa1a565['id'];return db[_0x03d5('0x52')]['create'](_0x231385[_0x03d5('0x47')]);}})[_0x03d5('0x24')](respondWithResult(_0x3b62ec,null))['catch'](handleError(_0x3b62ec,null));};exports[_0x03d5('0x53')]=function(_0x11d05e,_0x104b0e,_0x42b64a){var _0xda7370={};var _0x39390c={};var _0x1e5234;var _0x868308;return db[_0x03d5('0x2b')][_0x03d5('0x54')]({'where':{'id':_0x11d05e[_0x03d5('0x42')]['id']}})[_0x03d5('0x24')](handleEntityNotFound(_0x104b0e,null))[_0x03d5('0x24')](function(_0xaa1778){if(_0xaa1778){_0x1e5234=_0xaa1778;_0x39390c[_0x03d5('0x2f')]=_[_0x03d5('0x30')](db['Condition'][_0x03d5('0x43')]);_0x39390c['query']=_[_0x03d5('0x30')](_0x11d05e[_0x03d5('0x31')]);_0x39390c['filters']=_[_0x03d5('0x33')](_0x39390c[_0x03d5('0x2f')],_0x39390c[_0x03d5('0x31')]);_0xda7370[_0x03d5('0x34')]=_[_0x03d5('0x33')](_0x39390c[_0x03d5('0x2f')],qs[_0x03d5('0x35')](_0x11d05e[_0x03d5('0x31')][_0x03d5('0x35')]));_0xda7370['attributes']=_0xda7370[_0x03d5('0x34')][_0x03d5('0x36')]?_0xda7370[_0x03d5('0x34')]:_0x39390c[_0x03d5('0x2f')];_0xda7370[_0x03d5('0x38')]=qs[_0x03d5('0x39')](_0x11d05e[_0x03d5('0x31')][_0x03d5('0x39')]);_0xda7370[_0x03d5('0x3c')]=qs[_0x03d5('0x32')](_['pick'](_0x11d05e['query'],_0x39390c[_0x03d5('0x32')]));if(_0x11d05e[_0x03d5('0x31')][_0x03d5('0x3a')]){_0xda7370['where']=_['merge'](_0xda7370['where'],{'$or':_['map'](_0xda7370[_0x03d5('0x34')],function(_0x209e9d){var _0x12667e={};_0x12667e[_0x209e9d]={'$like':'%'+_0x11d05e['query'][_0x03d5('0x3a')]+'%'};return _0x12667e;})});}_0xda7370=_[_0x03d5('0x3b')]({},_0xda7370,_0x11d05e[_0x03d5('0x3d')]);return _0x1e5234[_0x03d5('0x53')](_0xda7370);}})[_0x03d5('0x24')](function(_0x475fd4){if(_0x475fd4){_0x868308=_0x475fd4[_0x03d5('0x36')];if(!_0x11d05e[_0x03d5('0x31')]['hasOwnProperty'](_0x03d5('0x55'))){_0xda7370[_0x03d5('0x1d')]=qs[_0x03d5('0x1d')](_0x11d05e['query'][_0x03d5('0x1d')]);_0xda7370['offset']=qs['offset'](_0x11d05e[_0x03d5('0x31')][_0x03d5('0x1c')]);}return _0x1e5234[_0x03d5('0x53')](_0xda7370);}})[_0x03d5('0x24')](function(_0x3f8c12){if(_0x3f8c12){return _0x3f8c12?{'count':_0x868308,'rows':_0x3f8c12}:null;}})[_0x03d5('0x24')](respondWithResult(_0x104b0e,null))[_0x03d5('0x4e')](handleError(_0x104b0e,null));};exports[_0x03d5('0x56')]=function(_0x5611e6,_0x31a4dd,_0x3c94f0){var _0x2713af={};var _0x2d30eb={};var _0x3dcf92;var _0x1a19ea;return db[_0x03d5('0x2b')][_0x03d5('0x54')]({'where':{'id':_0x5611e6[_0x03d5('0x42')]['id']}})[_0x03d5('0x24')](handleEntityNotFound(_0x31a4dd,null))['then'](function(_0x2f6eaf){if(_0x2f6eaf){_0x3dcf92=_0x2f6eaf;_0x2d30eb['model']=_['keys'](db['Condition'][_0x03d5('0x43')]);_0x2d30eb['query']=_[_0x03d5('0x30')](_0x5611e6['query']);_0x2d30eb[_0x03d5('0x32')]=_[_0x03d5('0x33')](_0x2d30eb[_0x03d5('0x2f')],_0x2d30eb[_0x03d5('0x31')]);_0x2713af[_0x03d5('0x34')]=_['intersection'](_0x2d30eb[_0x03d5('0x2f')],qs[_0x03d5('0x35')](_0x5611e6[_0x03d5('0x31')][_0x03d5('0x35')]));_0x2713af[_0x03d5('0x34')]=_0x2713af[_0x03d5('0x34')]['length']?_0x2713af[_0x03d5('0x34')]:_0x2d30eb[_0x03d5('0x2f')];_0x2713af[_0x03d5('0x38')]=qs[_0x03d5('0x39')](_0x5611e6[_0x03d5('0x31')][_0x03d5('0x39')]);_0x2713af[_0x03d5('0x3c')]=qs['filters'](_[_0x03d5('0x57')](_0x5611e6[_0x03d5('0x31')],_0x2d30eb[_0x03d5('0x32')]));if(_0x5611e6[_0x03d5('0x31')]['filter']){_0x2713af[_0x03d5('0x3c')]=_[_0x03d5('0x3b')](_0x2713af[_0x03d5('0x3c')],{'$or':_[_0x03d5('0x2a')](_0x2713af[_0x03d5('0x34')],function(_0x1454ac){var _0x10d263={};_0x10d263[_0x1454ac]={'$like':'%'+_0x5611e6[_0x03d5('0x31')]['filter']+'%'};return _0x10d263;})});}_0x2713af=_['merge']({},_0x2713af,_0x5611e6[_0x03d5('0x3d')]);return _0x3dcf92['getAnyConditions'](_0x2713af);}})[_0x03d5('0x24')](function(_0x4e7293){if(_0x4e7293){_0x1a19ea=_0x4e7293[_0x03d5('0x36')];if(!_0x5611e6[_0x03d5('0x31')][_0x03d5('0x37')](_0x03d5('0x55'))){_0x2713af['limit']=qs[_0x03d5('0x1d')](_0x5611e6['query'][_0x03d5('0x1d')]);_0x2713af[_0x03d5('0x1c')]=qs[_0x03d5('0x1c')](_0x5611e6[_0x03d5('0x31')][_0x03d5('0x1c')]);}return _0x3dcf92[_0x03d5('0x56')](_0x2713af);}})[_0x03d5('0x24')](function(_0x19288b){if(_0x19288b){return _0x19288b?{'count':_0x1a19ea,'rows':_0x19288b}:null;}})[_0x03d5('0x24')](respondWithResult(_0x31a4dd,null))[_0x03d5('0x4e')](handleError(_0x31a4dd,null));};exports['addAction']=function(_0x121fa2,_0x5b1e86,_0x3ae212){if(_0x121fa2['body']['id']){delete _0x121fa2[_0x03d5('0x47')]['id'];}return db[_0x03d5('0x2b')][_0x03d5('0x45')]({'where':{'id':_0x121fa2[_0x03d5('0x42')]['id']}})[_0x03d5('0x24')](handleEntityNotFound(_0x5b1e86,null))[_0x03d5('0x24')](function(_0x1454d7){if(_0x1454d7){_0x121fa2['body'][_0x03d5('0x58')]=_0x1454d7['id'];return db[_0x03d5('0x59')][_0x03d5('0x46')](_0x121fa2[_0x03d5('0x47')]);}})[_0x03d5('0x24')](respondWithResult(_0x5b1e86,null))[_0x03d5('0x4e')](handleError(_0x5b1e86,null));};exports[_0x03d5('0x5a')]=function(_0x363ef6,_0x43ba85,_0x47f8c3){var _0x48055d={};var _0xe9dc5d={};var _0x34710d;var _0x21e0fd;return db[_0x03d5('0x2b')]['findOne']({'where':{'id':_0x363ef6['params']['id']}})[_0x03d5('0x24')](handleEntityNotFound(_0x43ba85,null))[_0x03d5('0x24')](function(_0x4225aa){if(_0x4225aa){_0x34710d=_0x4225aa;_0xe9dc5d[_0x03d5('0x2f')]=_[_0x03d5('0x30')](db[_0x03d5('0x59')][_0x03d5('0x43')]);_0xe9dc5d[_0x03d5('0x31')]=_[_0x03d5('0x30')](_0x363ef6['query']);_0xe9dc5d[_0x03d5('0x32')]=_[_0x03d5('0x33')](_0xe9dc5d[_0x03d5('0x2f')],_0xe9dc5d[_0x03d5('0x31')]);_0x48055d['attributes']=_[_0x03d5('0x33')](_0xe9dc5d[_0x03d5('0x2f')],qs[_0x03d5('0x35')](_0x363ef6[_0x03d5('0x31')]['fields']));_0x48055d['attributes']=_0x48055d['attributes'][_0x03d5('0x36')]?_0x48055d['attributes']:_0xe9dc5d['model'];_0x48055d[_0x03d5('0x38')]=qs['sort'](_0x363ef6[_0x03d5('0x31')][_0x03d5('0x39')]);_0x48055d[_0x03d5('0x3c')]=qs[_0x03d5('0x32')](_[_0x03d5('0x57')](_0x363ef6[_0x03d5('0x31')],_0xe9dc5d[_0x03d5('0x32')]));if(_0x363ef6[_0x03d5('0x31')]['filter']){_0x48055d[_0x03d5('0x3c')]=_[_0x03d5('0x3b')](_0x48055d['where'],{'$or':_[_0x03d5('0x2a')](_0x48055d['attributes'],function(_0x5c99d3){var _0x3f68a3={};_0x3f68a3[_0x5c99d3]={'$like':'%'+_0x363ef6[_0x03d5('0x31')][_0x03d5('0x3a')]+'%'};return _0x3f68a3;})});}_0x48055d=_[_0x03d5('0x3b')]({},_0x48055d,_0x363ef6[_0x03d5('0x3d')]);return _0x34710d[_0x03d5('0x5a')](_0x48055d);}})[_0x03d5('0x24')](function(_0x23d584){if(_0x23d584){_0x21e0fd=_0x23d584[_0x03d5('0x36')];if(!_0x363ef6[_0x03d5('0x31')][_0x03d5('0x37')](_0x03d5('0x55'))){_0x48055d[_0x03d5('0x1d')]=qs['limit'](_0x363ef6[_0x03d5('0x31')]['limit']);_0x48055d[_0x03d5('0x1c')]=qs[_0x03d5('0x1c')](_0x363ef6[_0x03d5('0x31')][_0x03d5('0x1c')]);}return _0x34710d[_0x03d5('0x5a')](_0x48055d);}})[_0x03d5('0x24')](function(_0xa55bf3){if(_0xa55bf3){return _0xa55bf3?{'count':_0x21e0fd,'rows':_0xa55bf3}:null;}})[_0x03d5('0x24')](respondWithResult(_0x43ba85,null))[_0x03d5('0x4e')](handleError(_0x43ba85,null));}; \ No newline at end of file +var _0x8071=['options','includeAll','include','findAll','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','TriggerAnyId','findOne','pick','getAllConditions','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','Triggers','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','merge'];(function(_0xa5f4e0,_0x5990b5){var _0x10fcd5=function(_0xf1cc42){while(--_0xf1cc42){_0xa5f4e0['push'](_0xa5f4e0['shift']());}};_0x10fcd5(++_0x5990b5);}(_0x8071,0xe2));var _0x1807=function(_0xc66597,_0x4a9b7b){_0xc66597=_0xc66597-0x0;var _0x1cf738=_0x8071[_0xc66597];return _0x1cf738;};'use strict';var emlformat=require(_0x1807('0x0'));var rimraf=require(_0x1807('0x1'));var zipdir=require(_0x1807('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1807('0x3'));var moment=require(_0x1807('0x4'));var BPromise=require(_0x1807('0x5'));var Mustache=require(_0x1807('0x6'));var util=require('util');var path=require(_0x1807('0x7'));var sox=require('sox');var csv=require(_0x1807('0x8'));var ejs=require(_0x1807('0x9'));var fs=require('fs');var fs_extra=require(_0x1807('0xa'));var _=require('lodash');var squel=require(_0x1807('0xb'));var crypto=require(_0x1807('0xc'));var jsforce=require(_0x1807('0xd'));var deskjs=require(_0x1807('0xe'));var toCsv=require(_0x1807('0x8'));var querystring=require(_0x1807('0xf'));var Papa=require(_0x1807('0x10'));var Redis=require(_0x1807('0x11'));var authService=require(_0x1807('0x12'));var qs=require(_0x1807('0x13'));var as=require(_0x1807('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1807('0x15'))(_0x1807('0x16'));var utils=require(_0x1807('0x17'));var config=require(_0x1807('0x18'));var licenseUtil=require(_0x1807('0x19'));var db=require(_0x1807('0x1a'))['db'];function respondWithStatusCode(_0x299c58,_0x53a6b7){_0x53a6b7=_0x53a6b7||0xcc;return function(_0x51deb8){if(_0x51deb8){return _0x299c58[_0x1807('0x1b')](_0x53a6b7);}return _0x299c58[_0x1807('0x1c')](_0x53a6b7)[_0x1807('0x1d')]();};}function respondWithResult(_0x528787,_0x12cd9b){_0x12cd9b=_0x12cd9b||0xc8;return function(_0x33ce54){if(_0x33ce54){return _0x528787[_0x1807('0x1c')](_0x12cd9b)[_0x1807('0x1e')](_0x33ce54);}};}function respondWithFilteredResult(_0x41474d,_0x27cba7){return function(_0x117492){if(_0x117492){var _0x7f727f=typeof _0x27cba7[_0x1807('0x1f')]==='undefined'&&typeof _0x27cba7[_0x1807('0x20')]===_0x1807('0x21');var _0x1b855f=_0x117492[_0x1807('0x22')];var _0x27c81e=_0x7f727f?0x0:_0x27cba7[_0x1807('0x1f')];var _0x1e148d=_0x7f727f?_0x117492[_0x1807('0x22')]:_0x27cba7['offset']+_0x27cba7[_0x1807('0x20')];var _0x1d6dbe;if(_0x1e148d>=_0x1b855f){_0x1e148d=_0x1b855f;_0x1d6dbe=0xc8;}else{_0x1d6dbe=0xce;}_0x41474d[_0x1807('0x1c')](_0x1d6dbe);return _0x41474d[_0x1807('0x23')]('Content-Range',_0x27c81e+'-'+_0x1e148d+'/'+_0x1b855f)[_0x1807('0x1e')](_0x117492);}return null;};}function patchUpdates(_0x4fde8a){return function(_0x5ec326){try{jsonpatch[_0x1807('0x24')](_0x5ec326,_0x4fde8a,!![]);}catch(_0x42ade0){return BPromise[_0x1807('0x25')](_0x42ade0);}return _0x5ec326[_0x1807('0x26')]();};}function saveUpdates(_0x5219c1,_0x4a609b){return function(_0x26c9fc){if(_0x26c9fc){return _0x26c9fc[_0x1807('0x27')](_0x5219c1)[_0x1807('0x28')](function(_0x8ceb4b){return _0x8ceb4b;});}return null;};}function removeEntity(_0x2fc5cd,_0x4767ab){return function(_0x367146){if(_0x367146){return _0x367146[_0x1807('0x29')]()[_0x1807('0x28')](function(){var _0x4e9e5d=_0x367146['get']({'plain':!![]});var _0x12cca9=_0x1807('0x2a');return db['UserProfileResource'][_0x1807('0x29')]({'where':{'type':_0x12cca9,'resourceId':_0x4e9e5d['id']}})['then'](function(){return _0x367146;});})[_0x1807('0x28')](function(){_0x2fc5cd[_0x1807('0x1c')](0xcc)[_0x1807('0x1d')]();});}};}function handleEntityNotFound(_0x27ebcb,_0x445087){return function(_0x471ea8){if(!_0x471ea8){_0x27ebcb[_0x1807('0x1b')](0x194);}return _0x471ea8;};}function handleError(_0xa65462,_0x4a9bd3){_0x4a9bd3=_0x4a9bd3||0x1f4;return function(_0x3194dd){logger[_0x1807('0x2b')](_0x3194dd[_0x1807('0x2c')]);if(_0x3194dd[_0x1807('0x2d')]){delete _0x3194dd[_0x1807('0x2d')];}_0xa65462['status'](_0x4a9bd3)[_0x1807('0x2e')](_0x3194dd);};}exports[_0x1807('0x2f')]=function(_0x1b744a,_0x9a077d){var _0x4b8f54={},_0x4410c1={},_0x36f02f={'count':0x0,'rows':[]};var _0x4c0509=_[_0x1807('0x30')](db[_0x1807('0x31')][_0x1807('0x32')],function(_0x1976e0){return{'name':_0x1976e0[_0x1807('0x33')],'type':_0x1976e0['type'][_0x1807('0x34')]};});_0x4410c1['model']=_['map'](_0x4c0509,_0x1807('0x2d'));_0x4410c1[_0x1807('0x35')]=_[_0x1807('0x36')](_0x1b744a[_0x1807('0x35')]);_0x4410c1[_0x1807('0x37')]=_[_0x1807('0x38')](_0x4410c1[_0x1807('0x39')],_0x4410c1[_0x1807('0x35')]);_0x4b8f54[_0x1807('0x3a')]=_[_0x1807('0x38')](_0x4410c1[_0x1807('0x39')],qs['fields'](_0x1b744a[_0x1807('0x35')][_0x1807('0x3b')]));_0x4b8f54[_0x1807('0x3a')]=_0x4b8f54[_0x1807('0x3a')][_0x1807('0x3c')]?_0x4b8f54[_0x1807('0x3a')]:_0x4410c1[_0x1807('0x39')];if(!_0x1b744a[_0x1807('0x35')]['hasOwnProperty'](_0x1807('0x3d'))){_0x4b8f54[_0x1807('0x20')]=qs[_0x1807('0x20')](_0x1b744a['query'][_0x1807('0x20')]);_0x4b8f54['offset']=qs[_0x1807('0x1f')](_0x1b744a['query']['offset']);}_0x4b8f54[_0x1807('0x3e')]=qs[_0x1807('0x3f')](_0x1b744a[_0x1807('0x35')][_0x1807('0x3f')]);_0x4b8f54[_0x1807('0x40')]=qs[_0x1807('0x37')](_['pick'](_0x1b744a[_0x1807('0x35')],_0x4410c1[_0x1807('0x37')]),_0x4c0509);if(_0x1b744a[_0x1807('0x35')][_0x1807('0x41')]){_0x4b8f54[_0x1807('0x40')]=_['merge'](_0x4b8f54['where'],{'$or':_[_0x1807('0x30')](_0x4c0509,function(_0x42c11f){if(_0x42c11f[_0x1807('0x42')]!=='VIRTUAL'){var _0x1b9bdb={};_0x1b9bdb[_0x42c11f[_0x1807('0x2d')]]={'$like':'%'+_0x1b744a[_0x1807('0x35')]['filter']+'%'};return _0x1b9bdb;}})});}_0x4b8f54=_[_0x1807('0x43')]({},_0x4b8f54,_0x1b744a[_0x1807('0x44')]);var _0xea3d87={'where':_0x4b8f54['where']};return db[_0x1807('0x31')][_0x1807('0x22')](_0xea3d87)[_0x1807('0x28')](function(_0x118178){_0x36f02f[_0x1807('0x22')]=_0x118178;if(_0x1b744a[_0x1807('0x35')][_0x1807('0x45')]){_0x4b8f54[_0x1807('0x46')]=[{'all':!![]}];}return db['Trigger'][_0x1807('0x47')](_0x4b8f54);})[_0x1807('0x28')](function(_0x24f41c){_0x36f02f[_0x1807('0x48')]=_0x24f41c;return _0x36f02f;})[_0x1807('0x28')](respondWithFilteredResult(_0x9a077d,_0x4b8f54))[_0x1807('0x49')](handleError(_0x9a077d,null));};exports['show']=function(_0x4df4d9,_0x44790e){var _0x511335={'raw':![],'where':{'id':_0x4df4d9[_0x1807('0x4a')]['id']}},_0x32bc20={};_0x32bc20['model']=_[_0x1807('0x36')](db[_0x1807('0x31')][_0x1807('0x32')]);_0x32bc20[_0x1807('0x35')]=_[_0x1807('0x36')](_0x4df4d9[_0x1807('0x35')]);_0x32bc20['filters']=_[_0x1807('0x38')](_0x32bc20[_0x1807('0x39')],_0x32bc20[_0x1807('0x35')]);_0x511335[_0x1807('0x3a')]=_[_0x1807('0x38')](_0x32bc20['model'],qs[_0x1807('0x3b')](_0x4df4d9['query'][_0x1807('0x3b')]));_0x511335[_0x1807('0x3a')]=_0x511335[_0x1807('0x3a')][_0x1807('0x3c')]?_0x511335[_0x1807('0x3a')]:_0x32bc20[_0x1807('0x39')];if(_0x4df4d9[_0x1807('0x35')]['includeAll']){_0x511335['include']=[{'all':!![]}];}_0x511335=_[_0x1807('0x43')]({},_0x511335,_0x4df4d9[_0x1807('0x44')]);return db['Trigger']['find'](_0x511335)[_0x1807('0x28')](handleEntityNotFound(_0x44790e,null))['then'](respondWithResult(_0x44790e,null))['catch'](handleError(_0x44790e,null));};exports['create']=function(_0xaca335,_0x303092){return db[_0x1807('0x31')][_0x1807('0x4b')](_0xaca335[_0x1807('0x4c')],{})[_0x1807('0x28')](function(_0x885b8f){var _0x19c273=_0xaca335[_0x1807('0x4d')]['get']({'plain':!![]});if(!_0x19c273)throw new Error(_0x1807('0x4e'));if(_0x19c273['role']===_0x1807('0x4d')){var _0x543d0c=_0x885b8f[_0x1807('0x4f')]({'plain':!![]});var _0x519796=_0x1807('0x2a');return db[_0x1807('0x50')][_0x1807('0x51')]({'where':{'name':_0x519796,'userProfileId':_0x19c273[_0x1807('0x52')]},'raw':!![]})['then'](function(_0x498ed7){if(_0x498ed7&&_0x498ed7['autoAssociation']===0x0){return db[_0x1807('0x53')][_0x1807('0x4b')]({'name':_0x543d0c[_0x1807('0x2d')],'resourceId':_0x543d0c['id'],'type':_0x498ed7[_0x1807('0x2d')],'sectionId':_0x498ed7['id']},{})[_0x1807('0x28')](function(){return _0x885b8f;});}else{return _0x885b8f;}})[_0x1807('0x49')](function(_0x1b567b){logger[_0x1807('0x2b')](_0x1807('0x54'),_0x1b567b);throw _0x1b567b;});}return _0x885b8f;})['then'](respondWithResult(_0x303092,0xc9))['catch'](handleError(_0x303092,null));};exports['update']=function(_0x52cfaa,_0x4086f7){if(_0x52cfaa[_0x1807('0x4c')]['id']){delete _0x52cfaa[_0x1807('0x4c')]['id'];}return db['Trigger'][_0x1807('0x51')]({'where':{'id':_0x52cfaa[_0x1807('0x4a')]['id']}})[_0x1807('0x28')](handleEntityNotFound(_0x4086f7,null))[_0x1807('0x28')](saveUpdates(_0x52cfaa[_0x1807('0x4c')],null))['then'](respondWithResult(_0x4086f7,null))[_0x1807('0x49')](handleError(_0x4086f7,null));};exports[_0x1807('0x29')]=function(_0x3a274c,_0x219a63){return db[_0x1807('0x31')][_0x1807('0x51')]({'where':{'id':_0x3a274c['params']['id']}})['then'](handleEntityNotFound(_0x219a63,null))[_0x1807('0x28')](removeEntity(_0x219a63,null))[_0x1807('0x49')](handleError(_0x219a63,null));};exports[_0x1807('0x55')]=function(_0x13be51,_0x467cae,_0x318490){if(_0x13be51[_0x1807('0x4c')]['id']){delete _0x13be51[_0x1807('0x4c')]['id'];}return db[_0x1807('0x31')][_0x1807('0x51')]({'where':{'id':_0x13be51[_0x1807('0x4a')]['id']}})[_0x1807('0x28')](handleEntityNotFound(_0x467cae,null))[_0x1807('0x28')](function(_0x4578f1){if(_0x4578f1){_0x13be51[_0x1807('0x4c')][_0x1807('0x56')]=_0x4578f1['id'];return db[_0x1807('0x57')][_0x1807('0x4b')](_0x13be51[_0x1807('0x4c')]);}})[_0x1807('0x28')](respondWithResult(_0x467cae,null))['catch'](handleError(_0x467cae,null));};exports['addAnyCondition']=function(_0x5e5a48,_0x1ca5b8,_0x4dfd2a){if(_0x5e5a48['body']['id']){delete _0x5e5a48[_0x1807('0x4c')]['id'];}return db[_0x1807('0x31')][_0x1807('0x51')]({'where':{'id':_0x5e5a48[_0x1807('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1ca5b8,null))[_0x1807('0x28')](function(_0x423459){if(_0x423459){_0x5e5a48[_0x1807('0x4c')][_0x1807('0x58')]=_0x423459['id'];return db[_0x1807('0x57')][_0x1807('0x4b')](_0x5e5a48[_0x1807('0x4c')]);}})['then'](respondWithResult(_0x1ca5b8,null))['catch'](handleError(_0x1ca5b8,null));};exports['getAllConditions']=function(_0x3a043a,_0x3e4a04,_0x296666){var _0x23bf74={};var _0x3d118c={};var _0x3c3754;var _0x2c9d74;return db['Trigger'][_0x1807('0x59')]({'where':{'id':_0x3a043a[_0x1807('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3e4a04,null))[_0x1807('0x28')](function(_0x45b297){if(_0x45b297){_0x3c3754=_0x45b297;_0x3d118c['model']=_[_0x1807('0x36')](db['Condition'][_0x1807('0x32')]);_0x3d118c[_0x1807('0x35')]=_[_0x1807('0x36')](_0x3a043a[_0x1807('0x35')]);_0x3d118c[_0x1807('0x37')]=_[_0x1807('0x38')](_0x3d118c[_0x1807('0x39')],_0x3d118c['query']);_0x23bf74[_0x1807('0x3a')]=_[_0x1807('0x38')](_0x3d118c[_0x1807('0x39')],qs[_0x1807('0x3b')](_0x3a043a[_0x1807('0x35')]['fields']));_0x23bf74['attributes']=_0x23bf74[_0x1807('0x3a')][_0x1807('0x3c')]?_0x23bf74[_0x1807('0x3a')]:_0x3d118c[_0x1807('0x39')];_0x23bf74[_0x1807('0x3e')]=qs[_0x1807('0x3f')](_0x3a043a[_0x1807('0x35')]['sort']);_0x23bf74[_0x1807('0x40')]=qs[_0x1807('0x37')](_[_0x1807('0x5a')](_0x3a043a[_0x1807('0x35')],_0x3d118c[_0x1807('0x37')]));if(_0x3a043a[_0x1807('0x35')][_0x1807('0x41')]){_0x23bf74[_0x1807('0x40')]=_['merge'](_0x23bf74['where'],{'$or':_[_0x1807('0x30')](_0x23bf74[_0x1807('0x3a')],function(_0x51ba3f){var _0x535c60={};_0x535c60[_0x51ba3f]={'$like':'%'+_0x3a043a['query'][_0x1807('0x41')]+'%'};return _0x535c60;})});}_0x23bf74=_[_0x1807('0x43')]({},_0x23bf74,_0x3a043a[_0x1807('0x44')]);return _0x3c3754[_0x1807('0x5b')](_0x23bf74);}})[_0x1807('0x28')](function(_0x96bc67){if(_0x96bc67){_0x2c9d74=_0x96bc67[_0x1807('0x3c')];if(!_0x3a043a[_0x1807('0x35')][_0x1807('0x5c')](_0x1807('0x3d'))){_0x23bf74[_0x1807('0x20')]=qs[_0x1807('0x20')](_0x3a043a[_0x1807('0x35')][_0x1807('0x20')]);_0x23bf74[_0x1807('0x1f')]=qs[_0x1807('0x1f')](_0x3a043a[_0x1807('0x35')][_0x1807('0x1f')]);}return _0x3c3754[_0x1807('0x5b')](_0x23bf74);}})['then'](function(_0x30617f){if(_0x30617f){return _0x30617f?{'count':_0x2c9d74,'rows':_0x30617f}:null;}})[_0x1807('0x28')](respondWithResult(_0x3e4a04,null))['catch'](handleError(_0x3e4a04,null));};exports['getAnyConditions']=function(_0x5e5a83,_0x3f2fe7,_0x2deafe){var _0x4d13e0={};var _0x5b9e37={};var _0x589586;var _0x571142;return db[_0x1807('0x31')]['findOne']({'where':{'id':_0x5e5a83['params']['id']}})[_0x1807('0x28')](handleEntityNotFound(_0x3f2fe7,null))[_0x1807('0x28')](function(_0x5bd142){if(_0x5bd142){_0x589586=_0x5bd142;_0x5b9e37[_0x1807('0x39')]=_[_0x1807('0x36')](db[_0x1807('0x57')][_0x1807('0x32')]);_0x5b9e37[_0x1807('0x35')]=_[_0x1807('0x36')](_0x5e5a83[_0x1807('0x35')]);_0x5b9e37[_0x1807('0x37')]=_['intersection'](_0x5b9e37[_0x1807('0x39')],_0x5b9e37[_0x1807('0x35')]);_0x4d13e0['attributes']=_[_0x1807('0x38')](_0x5b9e37[_0x1807('0x39')],qs['fields'](_0x5e5a83[_0x1807('0x35')][_0x1807('0x3b')]));_0x4d13e0[_0x1807('0x3a')]=_0x4d13e0['attributes']['length']?_0x4d13e0['attributes']:_0x5b9e37[_0x1807('0x39')];_0x4d13e0['order']=qs[_0x1807('0x3f')](_0x5e5a83[_0x1807('0x35')][_0x1807('0x3f')]);_0x4d13e0[_0x1807('0x40')]=qs[_0x1807('0x37')](_[_0x1807('0x5a')](_0x5e5a83[_0x1807('0x35')],_0x5b9e37[_0x1807('0x37')]));if(_0x5e5a83[_0x1807('0x35')][_0x1807('0x41')]){_0x4d13e0[_0x1807('0x40')]=_[_0x1807('0x43')](_0x4d13e0[_0x1807('0x40')],{'$or':_['map'](_0x4d13e0[_0x1807('0x3a')],function(_0x2e6edc){var _0xfaaa1d={};_0xfaaa1d[_0x2e6edc]={'$like':'%'+_0x5e5a83[_0x1807('0x35')][_0x1807('0x41')]+'%'};return _0xfaaa1d;})});}_0x4d13e0=_[_0x1807('0x43')]({},_0x4d13e0,_0x5e5a83['options']);return _0x589586[_0x1807('0x5d')](_0x4d13e0);}})[_0x1807('0x28')](function(_0x466c10){if(_0x466c10){_0x571142=_0x466c10[_0x1807('0x3c')];if(!_0x5e5a83[_0x1807('0x35')][_0x1807('0x5c')]('nolimit')){_0x4d13e0[_0x1807('0x20')]=qs[_0x1807('0x20')](_0x5e5a83[_0x1807('0x35')][_0x1807('0x20')]);_0x4d13e0[_0x1807('0x1f')]=qs['offset'](_0x5e5a83[_0x1807('0x35')][_0x1807('0x1f')]);}return _0x589586['getAnyConditions'](_0x4d13e0);}})[_0x1807('0x28')](function(_0x5ae6b7){if(_0x5ae6b7){return _0x5ae6b7?{'count':_0x571142,'rows':_0x5ae6b7}:null;}})[_0x1807('0x28')](respondWithResult(_0x3f2fe7,null))[_0x1807('0x49')](handleError(_0x3f2fe7,null));};exports[_0x1807('0x5e')]=function(_0x69896d,_0x554f50,_0x5f227b){if(_0x69896d[_0x1807('0x4c')]['id']){delete _0x69896d[_0x1807('0x4c')]['id'];}return db[_0x1807('0x31')]['find']({'where':{'id':_0x69896d[_0x1807('0x4a')]['id']}})[_0x1807('0x28')](handleEntityNotFound(_0x554f50,null))['then'](function(_0x45dbce){if(_0x45dbce){_0x69896d[_0x1807('0x4c')][_0x1807('0x5f')]=_0x45dbce['id'];return db[_0x1807('0x60')][_0x1807('0x4b')](_0x69896d[_0x1807('0x4c')]);}})['then'](respondWithResult(_0x554f50,null))['catch'](handleError(_0x554f50,null));};exports[_0x1807('0x61')]=function(_0x4a0b8b,_0x367429,_0x277bf8){var _0x17e8a2={};var _0x30faeb={};var _0x58208c;var _0x539c1d;return db[_0x1807('0x31')][_0x1807('0x59')]({'where':{'id':_0x4a0b8b['params']['id']}})[_0x1807('0x28')](handleEntityNotFound(_0x367429,null))['then'](function(_0x398620){if(_0x398620){_0x58208c=_0x398620;_0x30faeb[_0x1807('0x39')]=_[_0x1807('0x36')](db[_0x1807('0x60')][_0x1807('0x32')]);_0x30faeb[_0x1807('0x35')]=_['keys'](_0x4a0b8b[_0x1807('0x35')]);_0x30faeb[_0x1807('0x37')]=_[_0x1807('0x38')](_0x30faeb[_0x1807('0x39')],_0x30faeb[_0x1807('0x35')]);_0x17e8a2['attributes']=_[_0x1807('0x38')](_0x30faeb[_0x1807('0x39')],qs[_0x1807('0x3b')](_0x4a0b8b[_0x1807('0x35')][_0x1807('0x3b')]));_0x17e8a2[_0x1807('0x3a')]=_0x17e8a2[_0x1807('0x3a')][_0x1807('0x3c')]?_0x17e8a2['attributes']:_0x30faeb['model'];_0x17e8a2['order']=qs[_0x1807('0x3f')](_0x4a0b8b[_0x1807('0x35')]['sort']);_0x17e8a2['where']=qs[_0x1807('0x37')](_[_0x1807('0x5a')](_0x4a0b8b['query'],_0x30faeb[_0x1807('0x37')]));if(_0x4a0b8b[_0x1807('0x35')]['filter']){_0x17e8a2['where']=_['merge'](_0x17e8a2[_0x1807('0x40')],{'$or':_[_0x1807('0x30')](_0x17e8a2[_0x1807('0x3a')],function(_0x5d5525){var _0x384b5d={};_0x384b5d[_0x5d5525]={'$like':'%'+_0x4a0b8b[_0x1807('0x35')][_0x1807('0x41')]+'%'};return _0x384b5d;})});}_0x17e8a2=_[_0x1807('0x43')]({},_0x17e8a2,_0x4a0b8b[_0x1807('0x44')]);return _0x58208c[_0x1807('0x61')](_0x17e8a2);}})[_0x1807('0x28')](function(_0x260c16){if(_0x260c16){_0x539c1d=_0x260c16['length'];if(!_0x4a0b8b[_0x1807('0x35')][_0x1807('0x5c')]('nolimit')){_0x17e8a2['limit']=qs[_0x1807('0x20')](_0x4a0b8b[_0x1807('0x35')][_0x1807('0x20')]);_0x17e8a2[_0x1807('0x1f')]=qs['offset'](_0x4a0b8b[_0x1807('0x35')][_0x1807('0x1f')]);}return _0x58208c[_0x1807('0x61')](_0x17e8a2);}})[_0x1807('0x28')](function(_0x4c28de){if(_0x4c28de){return _0x4c28de?{'count':_0x539c1d,'rows':_0x4c28de}:null;}})['then'](respondWithResult(_0x367429,null))['catch'](handleError(_0x367429,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 78e9f87..4657d04 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 _0xe630=['util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','Trigger','lodash'];(function(_0x3c66e5,_0xab5ea3){var _0x678a=function(_0xd43f50){while(--_0xd43f50){_0x3c66e5['push'](_0x3c66e5['shift']());}};_0x678a(++_0xab5ea3);}(_0xe630,0x149));var _0x0e63=function(_0x4ce9e6,_0x255059){_0x4ce9e6=_0x4ce9e6-0x0;var _0x1db19b=_0xe630[_0x4ce9e6];return _0x1db19b;};'use strict';var _=require(_0x0e63('0x0'));var util=require(_0x0e63('0x1'));var logger=require('../../config/logger')(_0x0e63('0x2'));var moment=require(_0x0e63('0x3'));var BPromise=require(_0x0e63('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e63('0x5'));var rimraf=require(_0x0e63('0x6'));var config=require(_0x0e63('0x7'));var attributes=require('./trigger.attributes');module[_0x0e63('0x8')]=function(_0x308039,_0x356abb){return _0x308039[_0x0e63('0x9')](_0x0e63('0xa'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15cb=['exports','define','Trigger','tools_triggers','util','api','bluebird','request-promise','path','rimraf','./trigger.attributes'];(function(_0x4bde3e,_0x5e222b){var _0x5a0e8d=function(_0x48de3f){while(--_0x48de3f){_0x4bde3e['push'](_0x4bde3e['shift']());}};_0x5a0e8d(++_0x5e222b);}(_0x15cb,0x16f));var _0xb15c=function(_0x5eb9a1,_0x3dcf64){_0x5eb9a1=_0x5eb9a1-0x0;var _0x5a2f8d=_0x15cb[_0x5eb9a1];return _0x5a2f8d;};'use strict';var _=require('lodash');var util=require(_0xb15c('0x0'));var logger=require('../../config/logger')(_0xb15c('0x1'));var moment=require('moment');var BPromise=require(_0xb15c('0x2'));var rp=require(_0xb15c('0x3'));var fs=require('fs');var path=require(_0xb15c('0x4'));var rimraf=require(_0xb15c('0x5'));var config=require('../../config/environment');var attributes=require(_0xb15c('0x6'));module[_0xb15c('0x7')]=function(_0x50ea76,_0x5a1b40){return _0x50ea76[_0xb15c('0x8')](_0xb15c('0x9'),attributes,{'tableName':_0xb15c('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 bff5a27..f6d54d8 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 _0x9adb=['Trigger,\x20%s,\x20%s,\x20%s','stringify','error','Trigger,\x20%s,\x20%s','message','Trigger','findAll','options','raw','where','limit','include','attributes','map','model','then','GetTrigger','catch','find','ShowTrigger','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','request\x20sent','debug'];(function(_0x5e9f85,_0x5d1f4f){var _0x2ee0d7=function(_0x2fb246){while(--_0x2fb246){_0x5e9f85['push'](_0x5e9f85['shift']());}};_0x2ee0d7(++_0x5d1f4f);}(_0x9adb,0x1a7));var _0xb9ad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9adb[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb9ad('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb9ad('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9ad('0x2'))['db'];var utils=require(_0xb9ad('0x3'));var logger=require(_0xb9ad('0x4'))(_0xb9ad('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb9ad('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46de5f,_0x3bcc48,_0x34a8e3){return new BPromise(function(_0x338ae4,_0x537047){return client[_0xb9ad('0x7')](_0x46de5f,_0x34a8e3)['then'](function(_0x2f2ef3){logger[_0xb9ad('0x8')]('Trigger,\x20%s,\x20%s',_0x3bcc48,_0xb9ad('0x9'));logger[_0xb9ad('0xa')](_0xb9ad('0xb'),_0x3bcc48,_0xb9ad('0x9'),JSON[_0xb9ad('0xc')](_0x2f2ef3));if(_0x2f2ef3['error']){if(_0x2f2ef3[_0xb9ad('0xd')]['code']===0x1f4){logger['error'](_0xb9ad('0xe'),_0x3bcc48,_0x2f2ef3['error'][_0xb9ad('0xf')]);return _0x537047(_0x2f2ef3[_0xb9ad('0xd')]['message']);}logger[_0xb9ad('0xd')](_0xb9ad('0xe'),_0x3bcc48,_0x2f2ef3[_0xb9ad('0xd')][_0xb9ad('0xf')]);return _0x338ae4(_0x2f2ef3[_0xb9ad('0xd')][_0xb9ad('0xf')]);}else{logger[_0xb9ad('0x8')](_0xb9ad('0xe'),_0x3bcc48,_0xb9ad('0x9'));_0x338ae4(_0x2f2ef3['result']['message']);}})['catch'](function(_0x377750){logger[_0xb9ad('0xd')]('Trigger,\x20%s,\x20%s',_0x3bcc48,_0x377750);_0x537047(_0x377750);});});}exports['GetTrigger']=function(_0x359f1a){var _0x5f0181=this;return new Promise(function(_0x5091d3,_0x115d9b){return db[_0xb9ad('0x10')][_0xb9ad('0x11')]({'raw':_0x359f1a[_0xb9ad('0x12')]?_0x359f1a[_0xb9ad('0x12')][_0xb9ad('0x13')]===undefined?!![]:![]:!![],'where':_0x359f1a[_0xb9ad('0x12')]?_0x359f1a[_0xb9ad('0x12')][_0xb9ad('0x14')]||null:null,'attributes':_0x359f1a[_0xb9ad('0x12')]?_0x359f1a[_0xb9ad('0x12')]['attributes']||null:null,'limit':_0x359f1a['options']?_0x359f1a[_0xb9ad('0x12')][_0xb9ad('0x15')]||null:null,'include':_0x359f1a[_0xb9ad('0x12')]?_0x359f1a[_0xb9ad('0x12')]['include']?_['map'](_0x359f1a[_0xb9ad('0x12')][_0xb9ad('0x16')],function(_0x2f6769){return{'model':db[_0x2f6769['model']],'as':_0x2f6769['as'],'attributes':_0x2f6769[_0xb9ad('0x17')],'include':_0x2f6769[_0xb9ad('0x16')]?_[_0xb9ad('0x18')](_0x2f6769[_0xb9ad('0x16')],function(_0x2fd217){return{'model':db[_0x2fd217['model']],'as':_0x2fd217['as'],'attributes':_0x2fd217[_0xb9ad('0x17')],'include':_0x2fd217['include']?_[_0xb9ad('0x18')](_0x2fd217[_0xb9ad('0x16')],function(_0xac6204){return{'model':db[_0xac6204[_0xb9ad('0x19')]],'as':_0xac6204['as'],'attributes':_0xac6204[_0xb9ad('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb9ad('0x1a')](function(_0x493d37){logger['info'](_0xb9ad('0x1b'),_0x359f1a);logger['debug'](_0xb9ad('0x1b'),_0x359f1a,JSON[_0xb9ad('0xc')](_0x493d37));_0x5091d3(_0x493d37);})[_0xb9ad('0x1c')](function(_0x29b26b){logger['error']('GetTrigger',_0x29b26b[_0xb9ad('0xf')],_0x359f1a);_0x115d9b(_0x5f0181['error'](0x1f4,_0x29b26b[_0xb9ad('0xf')]));});});};exports['ShowTrigger']=function(_0x226a0b){var _0x42ef1b=this;return new Promise(function(_0x57f4cc,_0x1e3d02){return db[_0xb9ad('0x10')][_0xb9ad('0x1d')]({'raw':_0x226a0b[_0xb9ad('0x12')]?_0x226a0b[_0xb9ad('0x12')][_0xb9ad('0x13')]===undefined?!![]:![]:!![],'where':_0x226a0b[_0xb9ad('0x12')]?_0x226a0b['options'][_0xb9ad('0x14')]||null:null,'attributes':_0x226a0b[_0xb9ad('0x12')]?_0x226a0b[_0xb9ad('0x12')][_0xb9ad('0x17')]||null:null,'include':_0x226a0b[_0xb9ad('0x12')]?_0x226a0b['options'][_0xb9ad('0x16')]?_[_0xb9ad('0x18')](_0x226a0b[_0xb9ad('0x12')][_0xb9ad('0x16')],function(_0x39792a){return{'model':db[_0x39792a[_0xb9ad('0x19')]],'as':_0x39792a['as'],'attributes':_0x39792a[_0xb9ad('0x17')],'include':_0x39792a['include']?_['map'](_0x39792a[_0xb9ad('0x16')],function(_0xe60295){return{'model':db[_0xe60295[_0xb9ad('0x19')]],'as':_0xe60295['as'],'attributes':_0xe60295['attributes'],'include':_0xe60295[_0xb9ad('0x16')]?_['map'](_0xe60295[_0xb9ad('0x16')],function(_0x44ea7c){return{'model':db[_0x44ea7c[_0xb9ad('0x19')]],'as':_0x44ea7c['as'],'attributes':_0x44ea7c['attributes']};}):[]};}):[]};}):[]:[]})[_0xb9ad('0x1a')](function(_0x549f40){logger['info'](_0xb9ad('0x1e'),_0x226a0b);logger['debug']('ShowTrigger',_0x226a0b,JSON[_0xb9ad('0xc')](_0x549f40));_0x57f4cc(_0x549f40);})['catch'](function(_0x9b8391){logger[_0xb9ad('0xd')](_0xb9ad('0x1e'),_0x9b8391['message'],_0x226a0b);_0x1e3d02(_0x42ef1b[_0xb9ad('0xd')](0x1f4,_0x9b8391['message']));});});}; \ No newline at end of file +var _0xa9c2=['request','info','request\x20sent','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','findAll','options','raw','where','attributes','map','include','model','then','ShowTrigger','Trigger','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x3b1e3d,_0x521157){var _0xc5e0a=function(_0x3348fe){while(--_0x3348fe){_0x3b1e3d['push'](_0x3b1e3d['shift']());}};_0xc5e0a(++_0x521157);}(_0xa9c2,0x1d6));var _0x2a9c=function(_0xd7556a,_0x14d7a1){_0xd7556a=_0xd7556a-0x0;var _0x34e5a5=_0xa9c2[_0xd7556a];return _0x34e5a5;};'use strict';var _=require(_0x2a9c('0x0'));var util=require(_0x2a9c('0x1'));var moment=require(_0x2a9c('0x2'));var BPromise=require('bluebird');var rs=require(_0x2a9c('0x3'));var fs=require('fs');var Redis=require(_0x2a9c('0x4'));var db=require(_0x2a9c('0x5'))['db'];var utils=require(_0x2a9c('0x6'));var logger=require('../../config/logger')(_0x2a9c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2a9c('0x8')][_0x2a9c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31b289,_0x42d5b0,_0x26a2c7){return new BPromise(function(_0x1b07d1,_0x25d12d){return client[_0x2a9c('0xa')](_0x31b289,_0x26a2c7)['then'](function(_0x4c3f54){logger[_0x2a9c('0xb')]('Trigger,\x20%s,\x20%s',_0x42d5b0,_0x2a9c('0xc'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x42d5b0,_0x2a9c('0xc'),JSON[_0x2a9c('0xd')](_0x4c3f54));if(_0x4c3f54[_0x2a9c('0xe')]){if(_0x4c3f54['error'][_0x2a9c('0xf')]===0x1f4){logger[_0x2a9c('0xe')](_0x2a9c('0x10'),_0x42d5b0,_0x4c3f54[_0x2a9c('0xe')][_0x2a9c('0x11')]);return _0x25d12d(_0x4c3f54[_0x2a9c('0xe')][_0x2a9c('0x11')]);}logger['error'](_0x2a9c('0x10'),_0x42d5b0,_0x4c3f54[_0x2a9c('0xe')][_0x2a9c('0x11')]);return _0x1b07d1(_0x4c3f54['error']['message']);}else{logger['info'](_0x2a9c('0x10'),_0x42d5b0,'request\x20sent');_0x1b07d1(_0x4c3f54[_0x2a9c('0x12')][_0x2a9c('0x11')]);}})[_0x2a9c('0x13')](function(_0x3e68de){logger[_0x2a9c('0xe')]('Trigger,\x20%s,\x20%s',_0x42d5b0,_0x3e68de);_0x25d12d(_0x3e68de);});});}exports[_0x2a9c('0x14')]=function(_0x151486){var _0x16acd7=this;return new Promise(function(_0xccd4cc,_0x3a4639){return db['Trigger'][_0x2a9c('0x15')]({'raw':_0x151486[_0x2a9c('0x16')]?_0x151486['options'][_0x2a9c('0x17')]===undefined?!![]:![]:!![],'where':_0x151486[_0x2a9c('0x16')]?_0x151486[_0x2a9c('0x16')][_0x2a9c('0x18')]||null:null,'attributes':_0x151486['options']?_0x151486['options'][_0x2a9c('0x19')]||null:null,'limit':_0x151486['options']?_0x151486[_0x2a9c('0x16')]['limit']||null:null,'include':_0x151486[_0x2a9c('0x16')]?_0x151486['options']['include']?_[_0x2a9c('0x1a')](_0x151486[_0x2a9c('0x16')][_0x2a9c('0x1b')],function(_0x392a69){return{'model':db[_0x392a69[_0x2a9c('0x1c')]],'as':_0x392a69['as'],'attributes':_0x392a69[_0x2a9c('0x19')],'include':_0x392a69['include']?_['map'](_0x392a69[_0x2a9c('0x1b')],function(_0x3cb057){return{'model':db[_0x3cb057[_0x2a9c('0x1c')]],'as':_0x3cb057['as'],'attributes':_0x3cb057[_0x2a9c('0x19')],'include':_0x3cb057[_0x2a9c('0x1b')]?_[_0x2a9c('0x1a')](_0x3cb057[_0x2a9c('0x1b')],function(_0x4b0963){return{'model':db[_0x4b0963['model']],'as':_0x4b0963['as'],'attributes':_0x4b0963[_0x2a9c('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2a9c('0x1d')](function(_0x5a7079){logger['info']('GetTrigger',_0x151486);logger['debug'](_0x2a9c('0x14'),_0x151486,JSON[_0x2a9c('0xd')](_0x5a7079));_0xccd4cc(_0x5a7079);})['catch'](function(_0xe69a9a){logger['error'](_0x2a9c('0x14'),_0xe69a9a[_0x2a9c('0x11')],_0x151486);_0x3a4639(_0x16acd7[_0x2a9c('0xe')](0x1f4,_0xe69a9a[_0x2a9c('0x11')]));});});};exports[_0x2a9c('0x1e')]=function(_0x46f811){var _0x3c9f4b=this;return new Promise(function(_0x24a551,_0x21aad4){return db[_0x2a9c('0x1f')]['find']({'raw':_0x46f811[_0x2a9c('0x16')]?_0x46f811['options'][_0x2a9c('0x17')]===undefined?!![]:![]:!![],'where':_0x46f811['options']?_0x46f811[_0x2a9c('0x16')][_0x2a9c('0x18')]||null:null,'attributes':_0x46f811[_0x2a9c('0x16')]?_0x46f811[_0x2a9c('0x16')]['attributes']||null:null,'include':_0x46f811[_0x2a9c('0x16')]?_0x46f811[_0x2a9c('0x16')]['include']?_[_0x2a9c('0x1a')](_0x46f811['options'][_0x2a9c('0x1b')],function(_0x4eff19){return{'model':db[_0x4eff19[_0x2a9c('0x1c')]],'as':_0x4eff19['as'],'attributes':_0x4eff19[_0x2a9c('0x19')],'include':_0x4eff19['include']?_['map'](_0x4eff19[_0x2a9c('0x1b')],function(_0x44eeaf){return{'model':db[_0x44eeaf[_0x2a9c('0x1c')]],'as':_0x44eeaf['as'],'attributes':_0x44eeaf['attributes'],'include':_0x44eeaf['include']?_['map'](_0x44eeaf[_0x2a9c('0x1b')],function(_0x264ee0){return{'model':db[_0x264ee0[_0x2a9c('0x1c')]],'as':_0x264ee0['as'],'attributes':_0x264ee0['attributes']};}):[]};}):[]};}):[]:[]})[_0x2a9c('0x1d')](function(_0x1476e3){logger[_0x2a9c('0xb')](_0x2a9c('0x1e'),_0x46f811);logger['debug'](_0x2a9c('0x1e'),_0x46f811,JSON[_0x2a9c('0xd')](_0x1476e3));_0x24a551(_0x1476e3);})['catch'](function(_0x21635d){logger['error'](_0x2a9c('0x1e'),_0x21635d[_0x2a9c('0x11')],_0x46f811);_0x21aad4(_0x3c9f4b['error'](0x1f4,_0x21635d[_0x2a9c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index b9933a0..10782cc 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 _0x4b50=['isAuthenticated','index','/:id','show','post','/:id/clone','clone','create','put','update','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2a37ff,_0x1f95f4){var _0x5d171d=function(_0x485f4f){while(--_0x485f4f){_0x2a37ff['push'](_0x2a37ff['shift']());}};_0x5d171d(++_0x1f95f4);}(_0x4b50,0x160));var _0x04b5=function(_0x476c7,_0x298ee0){_0x476c7=_0x476c7-0x0;var _0x47ae56=_0x4b50[_0x476c7];return _0x47ae56;};'use strict';var multer=require('multer');var util=require(_0x04b5('0x0'));var path=require(_0x04b5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x04b5('0x2')]();var fs_extra=require(_0x04b5('0x3'));var auth=require(_0x04b5('0x4'));var interaction=require(_0x04b5('0x5'));var config=require(_0x04b5('0x6'));var controller=require('./trunk.controller');router[_0x04b5('0x7')]('/',auth[_0x04b5('0x8')](),controller[_0x04b5('0x9')]);router['get'](_0x04b5('0xa'),auth[_0x04b5('0x8')](),controller[_0x04b5('0xb')]);router[_0x04b5('0xc')](_0x04b5('0xd'),auth[_0x04b5('0x8')](),controller[_0x04b5('0xe')]);router['post']('/',auth[_0x04b5('0x8')](),controller[_0x04b5('0xf')]);router[_0x04b5('0x10')](_0x04b5('0xa'),auth['isAuthenticated'](),controller[_0x04b5('0x11')]);router['delete']('/:id',auth[_0x04b5('0x8')](),controller[_0x04b5('0x12')]);module[_0x04b5('0x13')]=router; \ No newline at end of file +var _0xa62c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','/:id/clone','clone','create','put','update','destroy','exports','multer','util','path'];(function(_0x2ce1e2,_0x422716){var _0x29ea19=function(_0x2240f6){while(--_0x2240f6){_0x2ce1e2['push'](_0x2ce1e2['shift']());}};_0x29ea19(++_0x422716);}(_0xa62c,0xe4));var _0xca62=function(_0x52684f,_0xff73fc){_0x52684f=_0x52684f-0x0;var _0x4a55f0=_0xa62c[_0x52684f];return _0x4a55f0;};'use strict';var multer=require(_0xca62('0x0'));var util=require(_0xca62('0x1'));var path=require(_0xca62('0x2'));var timeout=require('connect-timeout');var express=require(_0xca62('0x3'));var router=express[_0xca62('0x4')]();var fs_extra=require(_0xca62('0x5'));var auth=require(_0xca62('0x6'));var interaction=require(_0xca62('0x7'));var config=require(_0xca62('0x8'));var controller=require('./trunk.controller');router[_0xca62('0x9')]('/',auth[_0xca62('0xa')](),controller[_0xca62('0xb')]);router[_0xca62('0x9')](_0xca62('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xca62('0xd')](_0xca62('0xe'),auth[_0xca62('0xa')](),controller[_0xca62('0xf')]);router[_0xca62('0xd')]('/',auth[_0xca62('0xa')](),controller[_0xca62('0x10')]);router[_0xca62('0x11')](_0xca62('0xc'),auth[_0xca62('0xa')](),controller[_0xca62('0x12')]);router['delete'](_0xca62('0xc'),auth[_0xca62('0xa')](),controller[_0xca62('0x13')]);module[_0xca62('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 088495e..03cf14a 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 _0x6869=['yes','force_rport,comedia','setDataValue','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','join','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','originate','uac','uas','pai','fingerprint','certificate','active','passive','dynamic','BOOLEAN','exports','name','ENUM','friend','user','peer','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','transport','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','nonat'];(function(_0x4fb2b1,_0x15a014){var _0x173cab=function(_0x429a1b){while(--_0x429a1b){_0x4fb2b1['push'](_0x4fb2b1['shift']());}};_0x173cab(++_0x15a014);}(_0x6869,0x13b));var _0x9686=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6869[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0x9686('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9686('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9686('0x2')](_0x9686('0x3'),_0x9686('0x4'),_0x9686('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x9686('0x6')],'allowNull':![],'defaultValue':_0x9686('0x7')},'callingpres':{'type':Sequelize[_0x9686('0x2')](_0x9686('0x8'),_0x9686('0x9'),_0x9686('0xa'),'ALLOWED',_0x9686('0xb'),'PROHIB_PASSED_SCREEN',_0x9686('0xc'),'PROHIB')},'deny':{'type':Sequelize[_0x9686('0x6')]},'permit':{'type':Sequelize[_0x9686('0x6')]},'secret':{'type':Sequelize[_0x9686('0x6')]},'md5secret':{'type':Sequelize[_0x9686('0x6')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x9686('0x6')],'defaultValue':'udp','set':function(_0xca89c9){this['setDataValue'](_0x9686('0xd'),_0xca89c9?_0xca89c9['join'](','):null);},'get':function(){return this['getDataValue'](_0x9686('0xd'))?this[_0x9686('0xe')](_0x9686('0xd'))['split'](','):null;},'comment':_0x9686('0xf')},'dtmfmode':{'type':Sequelize['ENUM'](_0x9686('0x10'),_0x9686('0x11'),'shortinfo',_0x9686('0x12'),_0x9686('0x13')),'defaultValue':_0x9686('0x10')},'directmedia':{'type':Sequelize[_0x9686('0x2')]('yes','no',_0x9686('0x14'),'update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x9686('0x15'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9686('0x6')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x9686('0x6')],'defaultValue':_0x9686('0x16'),'set':function(_0x25f641){this[_0x9686('0x17')](_0x9686('0x18'),_0x25f641?_0x25f641['join'](','):null);},'get':function(){return this[_0x9686('0xe')]('nat')?this['getDataValue'](_0x9686('0x18'))[_0x9686('0x19')](','):null;},'comment':_0x9686('0x1a')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9686('0x6')]},'pickupgroup':{'type':Sequelize[_0x9686('0x6')]},'namedpickupgroup':{'type':Sequelize[_0x9686('0x6')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9686('0x6')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x9686('0x6')],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x12f329){this[_0x9686('0x17')]('allow',_0x12f329?_0x12f329[_0x9686('0x1b')](';'):_0x9686('0x1c'));},'get':function(){return this[_0x9686('0xe')](_0x9686('0x1d'))?this['getDataValue'](_0x9686('0x1d'))[_0x9686('0x19')](';'):null;},'comment':_0x9686('0x1e')},'autoframing':{'type':Sequelize[_0x9686('0x2')]('yes','no')},'insecure':{'type':Sequelize[_0x9686('0x6')],'defaultValue':_0x9686('0x1f'),'set':function(_0xecd1cd){this[_0x9686('0x17')]('insecure',_0xecd1cd?_0xecd1cd[_0x9686('0x1b')](','):null);},'get':function(){return this[_0x9686('0xe')](_0x9686('0x20'))?this[_0x9686('0xe')]('insecure')[_0x9686('0x19')](','):null;},'comment':_0x9686('0x21')},'trustrpid':{'type':Sequelize[_0x9686('0x2')](_0x9686('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9686('0x2')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9686('0x2')](_0x9686('0x15'),'no',_0x9686('0x22'))},'promiscredir':{'type':Sequelize['ENUM'](_0x9686('0x15'),'no')},'useclientcode':{'type':Sequelize[_0x9686('0x2')]('yes','no')},'accountcode':{'type':Sequelize[_0x9686('0x23')](0xb)},'setvar':{'type':Sequelize[_0x9686('0x6')]},'callerid':{'type':Sequelize[_0x9686('0x6')],'defaultValue':_0x9686('0x24')},'amaflags':{'type':Sequelize[_0x9686('0x6')]},'callcounter':{'type':Sequelize[_0x9686('0x2')]('yes','no'),'defaultValue':_0x9686('0x15')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x9686('0x2')](_0x9686('0x15'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9686('0x15'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x9686('0x15'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x9686('0x15'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x9686('0x6')]},'videosupport':{'type':Sequelize[_0x9686('0x2')]('yes','no',_0x9686('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9686('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x9686('0x2')](_0x9686('0x15'),'no')},'mailbox':{'type':Sequelize[_0x9686('0x6')]},'session_timers':{'type':Sequelize[_0x9686('0x2')]('accept','refuse',_0x9686('0x26'))},'session_expires':{'type':Sequelize[_0x9686('0x23')](0xb)},'session_minse':{'type':Sequelize[_0x9686('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0x9686('0x2')](_0x9686('0x27'),'uas'),'defaultValue':_0x9686('0x28')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x9686('0x6')]},'fromdomain':{'type':Sequelize[_0x9686('0x6')]},'fromuser':{'type':Sequelize[_0x9686('0x6')]},'port':{'type':Sequelize[_0x9686('0x23')](0x5)},'qualify':{'type':Sequelize[_0x9686('0x2')](_0x9686('0x15'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x9686('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x9686('0x6')]},'defaultuser':{'type':Sequelize[_0x9686('0x6')]},'rtptimeout':{'type':Sequelize[_0x9686('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x9686('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x9686('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0x9686('0x2')](_0x9686('0x15'),'no',_0x9686('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9686('0x6')]},'callbackextension':{'type':Sequelize[_0x9686('0x6')]},'timert1':{'type':Sequelize[_0x9686('0x23')](0xb)},'timerb':{'type':Sequelize[_0x9686('0x23')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x9686('0x6')]},'contactdeny':{'type':Sequelize[_0x9686('0x6')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x9686('0x6')]},'maxforwards':{'type':Sequelize[_0x9686('0x23')](0xb)},'encryption':{'type':Sequelize[_0x9686('0x2')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9686('0x2')](_0x9686('0x15'),'no')},'force_avp':{'type':Sequelize[_0x9686('0x2')](_0x9686('0x15'),'no')},'icesupport':{'type':Sequelize[_0x9686('0x2')](_0x9686('0x15'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x9686('0x15'),'no')},'dtlsverify':{'type':Sequelize[_0x9686('0x2')](_0x9686('0x15'),'no',_0x9686('0x2a'),_0x9686('0x2b'))},'dtlsrekey':{'type':Sequelize[_0x9686('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0x9686('0x6')]},'dtlsprivatekey':{'type':Sequelize[_0x9686('0x6')]},'dtlscipher':{'type':Sequelize[_0x9686('0x6')]},'dtlscafile':{'type':Sequelize[_0x9686('0x6')]},'dtlscapath':{'type':Sequelize[_0x9686('0x6')]},'dtlssetup':{'type':Sequelize[_0x9686('0x2')](_0x9686('0x2c'),_0x9686('0x2d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0x9686('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9686('0x6')]},'recordofffeature':{'type':Sequelize[_0x9686('0x6')]},'call_limit':{'type':Sequelize[_0x9686('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x9686('0x2')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x9686('0x15'),'no')},'vmexten':{'type':Sequelize[_0x9686('0x6')]},'mohinterpret':{'type':Sequelize[_0x9686('0x6')]},'mohsuggest':{'type':Sequelize[_0x9686('0x6')]},'parkinglot':{'type':Sequelize[_0x9686('0x6')]},'description':{'type':Sequelize[_0x9686('0x6')]},'host':{'type':Sequelize[_0x9686('0x6')],'defaultValue':_0x9686('0x2e')},'canreinvite':{'type':Sequelize[_0x9686('0x2')]('yes','no','nonat','update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x9686('0x6')]},'otherFields':{'type':Sequelize[_0x9686('0x6')]},'active':{'type':Sequelize[_0x9686('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0xb006=['ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','info','shortinfo','inband','auto','yes','nonat','outgoing','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','pai','certificate','active','passive','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','friend','peer','from-voip-provider'];(function(_0x59b439,_0x14ae7b){var _0x521ea3=function(_0x5af627){while(--_0x5af627){_0x59b439['push'](_0x59b439['shift']());}};_0x521ea3(++_0x14ae7b);}(_0xb006,0xd1));var _0x6b00=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xb006[_0x51c819];return _0x15c5d2;};'use strict';var Sequelize=require(_0x6b00('0x0'));module[_0x6b00('0x1')]={'name':{'type':Sequelize[_0x6b00('0x2')],'allowNull':![],'unique':_0x6b00('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x6b00('0x4'),'user',_0x6b00('0x5')),'allowNull':![],'defaultValue':_0x6b00('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b00('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0x6b00('0x7'),_0x6b00('0x8'),_0x6b00('0x9'),_0x6b00('0xa'),_0x6b00('0xb'),_0x6b00('0xc'),_0x6b00('0xd'),_0x6b00('0xe'))},'deny':{'type':Sequelize[_0x6b00('0x2')]},'permit':{'type':Sequelize[_0x6b00('0x2')]},'secret':{'type':Sequelize[_0x6b00('0x2')]},'md5secret':{'type':Sequelize[_0x6b00('0x2')]},'remotesecret':{'type':Sequelize[_0x6b00('0x2')]},'transport':{'type':Sequelize[_0x6b00('0x2')],'defaultValue':'udp','set':function(_0x1d4aff){this[_0x6b00('0xf')]('transport',_0x1d4aff?_0x1d4aff['join'](','):null);},'get':function(){return this[_0x6b00('0x10')](_0x6b00('0x11'))?this[_0x6b00('0x10')](_0x6b00('0x11'))[_0x6b00('0x12')](','):null;},'comment':_0x6b00('0x13')},'dtmfmode':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x15'),_0x6b00('0x16'),_0x6b00('0x17'),_0x6b00('0x18'),_0x6b00('0x19')),'defaultValue':_0x6b00('0x15')},'directmedia':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x1a'),'no',_0x6b00('0x1b'),'update',_0x6b00('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x6b00('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6b00('0x2')]},'directmediadeny':{'type':Sequelize[_0x6b00('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x6b00('0x1d'),'set':function(_0x4c15e8){this[_0x6b00('0xf')](_0x6b00('0x1e'),_0x4c15e8?_0x4c15e8[_0x6b00('0x1f')](','):null);},'get':function(){return this[_0x6b00('0x10')]('nat')?this['getDataValue'](_0x6b00('0x1e'))['split'](','):null;},'comment':_0x6b00('0x20')},'callgroup':{'type':Sequelize[_0x6b00('0x2')]},'namedcallgroup':{'type':Sequelize[_0x6b00('0x2')]},'pickupgroup':{'type':Sequelize[_0x6b00('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x6b00('0x2')]},'language':{'type':Sequelize[_0x6b00('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x6b00('0x2')],'defaultValue':_0x6b00('0x21')},'allow':{'type':Sequelize[_0x6b00('0x2')],'allowNull':![],'defaultValue':_0x6b00('0x22'),'set':function(_0x535932){this[_0x6b00('0xf')]('allow',_0x535932?_0x535932[_0x6b00('0x1f')](';'):_0x6b00('0x22'));},'get':function(){return this[_0x6b00('0x10')](_0x6b00('0x23'))?this[_0x6b00('0x10')](_0x6b00('0x23'))[_0x6b00('0x12')](';'):null;},'comment':_0x6b00('0x24')},'autoframing':{'type':Sequelize['ENUM'](_0x6b00('0x1a'),'no')},'insecure':{'type':Sequelize[_0x6b00('0x2')],'defaultValue':'port,invite','set':function(_0x32a910){this[_0x6b00('0xf')](_0x6b00('0x25'),_0x32a910?_0x32a910['join'](','):null);},'get':function(){return this[_0x6b00('0x10')](_0x6b00('0x25'))?this[_0x6b00('0x10')](_0x6b00('0x25'))['split'](','):null;},'comment':_0x6b00('0x26')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x1a'),'no',_0x6b00('0x27'))},'promiscredir':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x1a'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x6b00('0x1a'),'no')},'accountcode':{'type':Sequelize[_0x6b00('0x28')](0xb)},'setvar':{'type':Sequelize[_0x6b00('0x2')]},'callerid':{'type':Sequelize[_0x6b00('0x2')],'defaultValue':_0x6b00('0x29')},'amaflags':{'type':Sequelize[_0x6b00('0x2')]},'callcounter':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x1a'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x6b00('0x28')](0xb)},'allowoverlap':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x6b00('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0x6b00('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x6b00('0x14')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6b00('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x6b00('0x14')]('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x2a'),_0x6b00('0x2b'),_0x6b00('0x2c'))},'session_expires':{'type':Sequelize[_0x6b00('0x28')](0xb)},'session_minse':{'type':Sequelize[_0x6b00('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x2d'),_0x6b00('0x2e')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x6b00('0x2')]},'regexten':{'type':Sequelize[_0x6b00('0x2')]},'fromdomain':{'type':Sequelize[_0x6b00('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x1a'),'no'),'defaultValue':_0x6b00('0x1a')},'keepalive':{'type':Sequelize[_0x6b00('0x28')](0xb)},'defaultip':{'type':Sequelize[_0x6b00('0x2')]},'defaultuser':{'type':Sequelize[_0x6b00('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x6b00('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x6b00('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0x6b00('0x14')]('yes','no',_0x6b00('0x2f')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6b00('0x2')]},'callbackextension':{'type':Sequelize[_0x6b00('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x6b00('0x28')](0xb)},'contactpermit':{'type':Sequelize[_0x6b00('0x2')]},'contactdeny':{'type':Sequelize[_0x6b00('0x2')]},'contactacl':{'type':Sequelize[_0x6b00('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x6b00('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x6b00('0x28')](0xb)},'encryption':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x1a'),'no')},'force_avp':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x1a'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x6b00('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x1a'),'no','fingerprint',_0x6b00('0x30'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x6b00('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x6b00('0x2')]},'dtlscafile':{'type':Sequelize[_0x6b00('0x2')]},'dtlscapath':{'type':Sequelize[_0x6b00('0x2')]},'dtlssetup':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x31'),_0x6b00('0x32'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6b00('0x2')]},'usereqphone':{'type':Sequelize[_0x6b00('0x14')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6b00('0x2')]},'recordofffeature':{'type':Sequelize[_0x6b00('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize[_0x6b00('0x14')](_0x6b00('0x1a'),'no')},'vmexten':{'type':Sequelize[_0x6b00('0x2')]},'mohinterpret':{'type':Sequelize[_0x6b00('0x2')]},'mohsuggest':{'type':Sequelize[_0x6b00('0x2')]},'parkinglot':{'type':Sequelize[_0x6b00('0x2')]},'description':{'type':Sequelize[_0x6b00('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x6b00('0x33')},'canreinvite':{'type':Sequelize[_0x6b00('0x14')]('yes','no',_0x6b00('0x1b'),'update',_0x6b00('0x34')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x6b00('0x2')]},'otherFields':{'type':Sequelize[_0x6b00('0x2')]},'active':{'type':Sequelize[_0x6b00('0x35')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x6b00('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index c979891..aa74af5 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(_0x22ee0f,_0x22e6d2){var _0x204696=function(_0x4cab38){while(--_0x4cab38){_0x22ee0f['push'](_0x22ee0f['shift']());}};_0x204696(++_0x22e6d2);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x57da17,_0x375bd8){_0x57da17=_0x57da17-0x0;var _0x41e9c9=_0x8d0e[_0x57da17];return _0x41e9c9;};'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 _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','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','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x5b3fb1,_0x1f8307){var _0x4222e1=function(_0x46d38b){while(--_0x46d38b){_0x5b3fb1['push'](_0x5b3fb1['shift']());}};_0x4222e1(++_0x1f8307);}(_0x98a8,0x12c));var _0x898a=function(_0x3f1691,_0x201077){_0x3f1691=_0x3f1691-0x0;var _0x32a9a5=_0x98a8[_0x3f1691];return _0x32a9a5;};'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'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 7bd43bd..ebdc6ca 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 _0x8ed3=['util','moment','bluebird','request-promise','path','./trunk.attributes','define','Trunk','tools_trunks','lodash'];(function(_0x2fa21e,_0x49f072){var _0x19173a=function(_0x57afd0){while(--_0x57afd0){_0x2fa21e['push'](_0x2fa21e['shift']());}};_0x19173a(++_0x49f072);}(_0x8ed3,0x8b));var _0x38ed=function(_0x1fd6b0,_0x5a40a0){_0x1fd6b0=_0x1fd6b0-0x0;var _0x202a08=_0x8ed3[_0x1fd6b0];return _0x202a08;};'use strict';var _=require(_0x38ed('0x0'));var util=require(_0x38ed('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x38ed('0x2'));var BPromise=require(_0x38ed('0x3'));var rp=require(_0x38ed('0x4'));var fs=require('fs');var path=require(_0x38ed('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x38ed('0x6'));module['exports']=function(_0x14036a,_0x26136d){return _0x14036a[_0x38ed('0x7')](_0x38ed('0x8'),attributes,{'tableName':_0x38ed('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51e1=['../../config/environment','./trunk.attributes','exports','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1b2844,_0x24f744){var _0x477498=function(_0x2b45a3){while(--_0x2b45a3){_0x1b2844['push'](_0x1b2844['shift']());}};_0x477498(++_0x24f744);}(_0x51e1,0x16c));var _0x151e=function(_0x3c04ef,_0x9d110c){_0x3c04ef=_0x3c04ef-0x0;var _0x6a3a69=_0x51e1[_0x3c04ef];return _0x6a3a69;};'use strict';var _=require(_0x151e('0x0'));var util=require(_0x151e('0x1'));var logger=require(_0x151e('0x2'))(_0x151e('0x3'));var moment=require(_0x151e('0x4'));var BPromise=require(_0x151e('0x5'));var rp=require(_0x151e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x151e('0x7'));var config=require(_0x151e('0x8'));var attributes=require(_0x151e('0x9'));module[_0x151e('0xa')]=function(_0x3b8d08,_0x31d72b){return _0x3b8d08['define']('Trunk',attributes,{'tableName':_0x151e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 7033417..c4a1537 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 _0x6d80=['raw','where','attributes','limit','include','model','map','catch','ShowTrunk','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','GetTrunk','Trunk','findAll','options'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x6d80,0x9e));var _0x06d8=function(_0x194c2d,_0x2b4ff8){_0x194c2d=_0x194c2d-0x0;var _0x332875=_0x6d80[_0x194c2d];return _0x332875;};'use strict';var _=require(_0x06d8('0x0'));var util=require(_0x06d8('0x1'));var moment=require(_0x06d8('0x2'));var BPromise=require(_0x06d8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06d8('0x4'));var db=require(_0x06d8('0x5'))['db'];var utils=require(_0x06d8('0x6'));var logger=require('../../config/logger')(_0x06d8('0x7'));var config=require('../../config/environment');var jayson=require(_0x06d8('0x8'));var client=jayson[_0x06d8('0x9')][_0x06d8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5432b3,_0x4e59d4,_0x2c6edc){return new BPromise(function(_0x44567b,_0x322b84){return client[_0x06d8('0xb')](_0x5432b3,_0x2c6edc)[_0x06d8('0xc')](function(_0x382db2){logger[_0x06d8('0xd')]('Trunk,\x20%s,\x20%s',_0x4e59d4,'request\x20sent');logger[_0x06d8('0xe')](_0x06d8('0xf'),_0x4e59d4,_0x06d8('0x10'),JSON[_0x06d8('0x11')](_0x382db2));if(_0x382db2[_0x06d8('0x12')]){if(_0x382db2['error'][_0x06d8('0x13')]===0x1f4){logger['error'](_0x06d8('0x14'),_0x4e59d4,_0x382db2[_0x06d8('0x12')][_0x06d8('0x15')]);return _0x322b84(_0x382db2[_0x06d8('0x12')][_0x06d8('0x15')]);}logger[_0x06d8('0x12')]('Trunk,\x20%s,\x20%s',_0x4e59d4,_0x382db2[_0x06d8('0x12')][_0x06d8('0x15')]);return _0x44567b(_0x382db2[_0x06d8('0x12')][_0x06d8('0x15')]);}else{logger[_0x06d8('0xd')](_0x06d8('0x14'),_0x4e59d4,'request\x20sent');_0x44567b(_0x382db2[_0x06d8('0x16')]['message']);}})['catch'](function(_0xe40df8){logger['error'](_0x06d8('0x14'),_0x4e59d4,_0xe40df8);_0x322b84(_0xe40df8);});});}exports[_0x06d8('0x17')]=function(_0x4e1adc){var _0x3428d5=this;return new Promise(function(_0x49646d,_0x2a15b4){return db[_0x06d8('0x18')][_0x06d8('0x19')]({'raw':_0x4e1adc[_0x06d8('0x1a')]?_0x4e1adc[_0x06d8('0x1a')][_0x06d8('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e1adc[_0x06d8('0x1a')]?_0x4e1adc[_0x06d8('0x1a')][_0x06d8('0x1c')]||null:null,'attributes':_0x4e1adc[_0x06d8('0x1a')]?_0x4e1adc['options'][_0x06d8('0x1d')]||null:null,'limit':_0x4e1adc['options']?_0x4e1adc[_0x06d8('0x1a')][_0x06d8('0x1e')]||null:null,'include':_0x4e1adc[_0x06d8('0x1a')]?_0x4e1adc['options'][_0x06d8('0x1f')]?_['map'](_0x4e1adc[_0x06d8('0x1a')][_0x06d8('0x1f')],function(_0x2f5024){return{'model':db[_0x2f5024[_0x06d8('0x20')]],'as':_0x2f5024['as'],'attributes':_0x2f5024[_0x06d8('0x1d')],'include':_0x2f5024[_0x06d8('0x1f')]?_[_0x06d8('0x21')](_0x2f5024[_0x06d8('0x1f')],function(_0x4ee5e2){return{'model':db[_0x4ee5e2[_0x06d8('0x20')]],'as':_0x4ee5e2['as'],'attributes':_0x4ee5e2[_0x06d8('0x1d')],'include':_0x4ee5e2['include']?_['map'](_0x4ee5e2[_0x06d8('0x1f')],function(_0x1f0a73){return{'model':db[_0x1f0a73['model']],'as':_0x1f0a73['as'],'attributes':_0x1f0a73[_0x06d8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x06d8('0xc')](function(_0x43fca5){logger['info'](_0x06d8('0x17'),_0x4e1adc);logger[_0x06d8('0xe')](_0x06d8('0x17'),_0x4e1adc,JSON[_0x06d8('0x11')](_0x43fca5));_0x49646d(_0x43fca5);})[_0x06d8('0x22')](function(_0x3f4994){logger[_0x06d8('0x12')](_0x06d8('0x17'),_0x3f4994[_0x06d8('0x15')],_0x4e1adc);_0x2a15b4(_0x3428d5[_0x06d8('0x12')](0x1f4,_0x3f4994[_0x06d8('0x15')]));});});};exports[_0x06d8('0x23')]=function(_0x5a89ce){var _0x22b0c9=this;return new Promise(function(_0x219c7f,_0x5db30d){return db[_0x06d8('0x18')][_0x06d8('0x24')]({'raw':_0x5a89ce[_0x06d8('0x1a')]?_0x5a89ce['options'][_0x06d8('0x1b')]===undefined?!![]:![]:!![],'where':_0x5a89ce[_0x06d8('0x1a')]?_0x5a89ce[_0x06d8('0x1a')]['where']||null:null,'attributes':_0x5a89ce[_0x06d8('0x1a')]?_0x5a89ce[_0x06d8('0x1a')][_0x06d8('0x1d')]||null:null,'include':_0x5a89ce['options']?_0x5a89ce[_0x06d8('0x1a')][_0x06d8('0x1f')]?_['map'](_0x5a89ce[_0x06d8('0x1a')][_0x06d8('0x1f')],function(_0x15d617){return{'model':db[_0x15d617['model']],'as':_0x15d617['as'],'attributes':_0x15d617[_0x06d8('0x1d')],'include':_0x15d617['include']?_['map'](_0x15d617[_0x06d8('0x1f')],function(_0x571e3b){return{'model':db[_0x571e3b['model']],'as':_0x571e3b['as'],'attributes':_0x571e3b['attributes'],'include':_0x571e3b['include']?_[_0x06d8('0x21')](_0x571e3b[_0x06d8('0x1f')],function(_0x20063f){return{'model':db[_0x20063f[_0x06d8('0x20')]],'as':_0x20063f['as'],'attributes':_0x20063f[_0x06d8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a36a8){logger[_0x06d8('0xd')](_0x06d8('0x23'),_0x5a89ce);logger[_0x06d8('0xe')](_0x06d8('0x23'),_0x5a89ce,JSON[_0x06d8('0x11')](_0x2a36a8));_0x219c7f(_0x2a36a8);})[_0x06d8('0x22')](function(_0xc30878){logger['error'](_0x06d8('0x23'),_0xc30878[_0x06d8('0x15')],_0x5a89ce);_0x5db30d(_0x22b0c9['error'](0x1f4,_0xc30878['message']));});});}; \ No newline at end of file +var _0x5715=['limit','include','map','model','ShowTrunk','find','where','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','attributes'];(function(_0x41a321,_0x56b843){var _0x2459bd=function(_0x3ff83c){while(--_0x3ff83c){_0x41a321['push'](_0x41a321['shift']());}};_0x2459bd(++_0x56b843);}(_0x5715,0x1e3));var _0x5571=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x5715[_0x2df507];return _0x1f7167;};'use strict';var _=require(_0x5571('0x0'));var util=require('util');var moment=require(_0x5571('0x1'));var BPromise=require(_0x5571('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5571('0x3'));var db=require(_0x5571('0x4'))['db'];var utils=require(_0x5571('0x5'));var logger=require(_0x5571('0x6'))('rpc');var config=require(_0x5571('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5571('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x379d76,_0x535560,_0x17b890){return new BPromise(function(_0x1333d4,_0x504e54){return client[_0x5571('0x9')](_0x379d76,_0x17b890)[_0x5571('0xa')](function(_0x3b5dd3){logger[_0x5571('0xb')](_0x5571('0xc'),_0x535560,_0x5571('0xd'));logger['debug'](_0x5571('0xe'),_0x535560,_0x5571('0xd'),JSON[_0x5571('0xf')](_0x3b5dd3));if(_0x3b5dd3[_0x5571('0x10')]){if(_0x3b5dd3['error'][_0x5571('0x11')]===0x1f4){logger['error'](_0x5571('0xc'),_0x535560,_0x3b5dd3[_0x5571('0x10')][_0x5571('0x12')]);return _0x504e54(_0x3b5dd3['error'][_0x5571('0x12')]);}logger[_0x5571('0x10')]('Trunk,\x20%s,\x20%s',_0x535560,_0x3b5dd3[_0x5571('0x10')][_0x5571('0x12')]);return _0x1333d4(_0x3b5dd3['error']['message']);}else{logger[_0x5571('0xb')]('Trunk,\x20%s,\x20%s',_0x535560,_0x5571('0xd'));_0x1333d4(_0x3b5dd3[_0x5571('0x13')]['message']);}})[_0x5571('0x14')](function(_0x1eab59){logger[_0x5571('0x10')]('Trunk,\x20%s,\x20%s',_0x535560,_0x1eab59);_0x504e54(_0x1eab59);});});}exports[_0x5571('0x15')]=function(_0x20847f){var _0x2518e6=this;return new Promise(function(_0x5512fc,_0x18243c){return db[_0x5571('0x16')][_0x5571('0x17')]({'raw':_0x20847f['options']?_0x20847f[_0x5571('0x18')][_0x5571('0x19')]===undefined?!![]:![]:!![],'where':_0x20847f['options']?_0x20847f[_0x5571('0x18')]['where']||null:null,'attributes':_0x20847f[_0x5571('0x18')]?_0x20847f[_0x5571('0x18')][_0x5571('0x1a')]||null:null,'limit':_0x20847f[_0x5571('0x18')]?_0x20847f['options'][_0x5571('0x1b')]||null:null,'include':_0x20847f['options']?_0x20847f[_0x5571('0x18')][_0x5571('0x1c')]?_[_0x5571('0x1d')](_0x20847f[_0x5571('0x18')]['include'],function(_0x55d3db){return{'model':db[_0x55d3db['model']],'as':_0x55d3db['as'],'attributes':_0x55d3db[_0x5571('0x1a')],'include':_0x55d3db[_0x5571('0x1c')]?_[_0x5571('0x1d')](_0x55d3db[_0x5571('0x1c')],function(_0x45d564){return{'model':db[_0x45d564['model']],'as':_0x45d564['as'],'attributes':_0x45d564[_0x5571('0x1a')],'include':_0x45d564['include']?_[_0x5571('0x1d')](_0x45d564['include'],function(_0x3d7dde){return{'model':db[_0x3d7dde[_0x5571('0x1e')]],'as':_0x3d7dde['as'],'attributes':_0x3d7dde[_0x5571('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5571('0xa')](function(_0x3c2dc1){logger[_0x5571('0xb')]('GetTrunk',_0x20847f);logger['debug']('GetTrunk',_0x20847f,JSON['stringify'](_0x3c2dc1));_0x5512fc(_0x3c2dc1);})[_0x5571('0x14')](function(_0x587377){logger[_0x5571('0x10')](_0x5571('0x15'),_0x587377[_0x5571('0x12')],_0x20847f);_0x18243c(_0x2518e6['error'](0x1f4,_0x587377[_0x5571('0x12')]));});});};exports[_0x5571('0x1f')]=function(_0x3f2cb2){var _0xe7bb2a=this;return new Promise(function(_0x489f43,_0x4b3639){return db[_0x5571('0x16')][_0x5571('0x20')]({'raw':_0x3f2cb2['options']?_0x3f2cb2[_0x5571('0x18')][_0x5571('0x19')]===undefined?!![]:![]:!![],'where':_0x3f2cb2[_0x5571('0x18')]?_0x3f2cb2[_0x5571('0x18')][_0x5571('0x21')]||null:null,'attributes':_0x3f2cb2['options']?_0x3f2cb2['options'][_0x5571('0x1a')]||null:null,'include':_0x3f2cb2[_0x5571('0x18')]?_0x3f2cb2[_0x5571('0x18')][_0x5571('0x1c')]?_[_0x5571('0x1d')](_0x3f2cb2[_0x5571('0x18')]['include'],function(_0x1818f3){return{'model':db[_0x1818f3[_0x5571('0x1e')]],'as':_0x1818f3['as'],'attributes':_0x1818f3[_0x5571('0x1a')],'include':_0x1818f3['include']?_['map'](_0x1818f3[_0x5571('0x1c')],function(_0x23345e){return{'model':db[_0x23345e[_0x5571('0x1e')]],'as':_0x23345e['as'],'attributes':_0x23345e['attributes'],'include':_0x23345e[_0x5571('0x1c')]?_[_0x5571('0x1d')](_0x23345e[_0x5571('0x1c')],function(_0x1ab32a){return{'model':db[_0x1ab32a[_0x5571('0x1e')]],'as':_0x1ab32a['as'],'attributes':_0x1ab32a[_0x5571('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x415d72){logger[_0x5571('0xb')]('ShowTrunk',_0x3f2cb2);logger['debug'](_0x5571('0x1f'),_0x3f2cb2,JSON[_0x5571('0xf')](_0x415d72));_0x489f43(_0x415d72);})[_0x5571('0x14')](function(_0x40d278){logger[_0x5571('0x10')](_0x5571('0x1f'),_0x40d278['message'],_0x3f2cb2);_0x4b3639(_0xe7bb2a[_0x5571('0x10')](0x1f4,_0x40d278[_0x5571('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index dbacb83..ced460f 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 _0x36b3=['isAuthenticated','update','exports','Router','../../components/auth/service','put','/:id'];(function(_0x1bf6ca,_0x2a054b){var _0x4c47ff=function(_0x41d24f){while(--_0x41d24f){_0x1bf6ca['push'](_0x1bf6ca['shift']());}};_0x4c47ff(++_0x2a054b);}(_0x36b3,0x1a7));var _0x336b=function(_0xdd3471,_0x309547){_0xdd3471=_0xdd3471-0x0;var _0x397587=_0x36b3[_0xdd3471];return _0x397587;};'use strict';var express=require('express');var router=express[_0x336b('0x0')]();var auth=require(_0x336b('0x1'));var controller=require('./user-setting.controller');router[_0x336b('0x2')](_0x336b('0x3'),auth[_0x336b('0x4')](),controller[_0x336b('0x5')]);module[_0x336b('0x6')]=router; \ No newline at end of file +var _0x29f3=['/:id','isAuthenticated','exports','../../components/auth/service','./user-setting.controller'];(function(_0x59b14a,_0x1be3a6){var _0x174bc5=function(_0xa6cafb){while(--_0xa6cafb){_0x59b14a['push'](_0x59b14a['shift']());}};_0x174bc5(++_0x1be3a6);}(_0x29f3,0x16b));var _0x329f=function(_0x5f3a9a,_0x464476){_0x5f3a9a=_0x5f3a9a-0x0;var _0x543c23=_0x29f3[_0x5f3a9a];return _0x543c23;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x329f('0x0'));var controller=require(_0x329f('0x1'));router['put'](_0x329f('0x2'),auth[_0x329f('0x3')](),controller['update']);module[_0x329f('0x4')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index f05697e..1b93dd3 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 _0x61e7=['error','warning','info','debug','exports','ENUM','INTEGER','UserId','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x61e7,0x1d3));var _0x761e=function(_0x35ff7e,_0x26dfe7){_0x35ff7e=_0x35ff7e-0x0;var _0x97d364=_0x61e7[_0x35ff7e];return _0x97d364;};'use strict';var Sequelize=require(_0x761e('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x761e('0x1'),_0x761e('0x2'),_0x761e('0x3'),_0x761e('0x4')];module[_0x761e('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0x761e('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x761e('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x761e('0x7')],'unique':_0x761e('0x8')}}; \ No newline at end of file +var _0xea37=['exports','ENUM','BOOLEAN','DATE','INTEGER','error','warning','info','debug'];(function(_0x45c489,_0x5a55ac){var _0x4ba812=function(_0x778206){while(--_0x778206){_0x45c489['push'](_0x45c489['shift']());}};_0x4ba812(++_0x5a55ac);}(_0xea37,0xdd));var _0x7ea3=function(_0x385603,_0x1cf762){_0x385603=_0x385603-0x0;var _0x2e10ca=_0xea37[_0x385603];return _0x2e10ca;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x7ea3('0x0'),_0x7ea3('0x1'),_0x7ea3('0x2'),_0x7ea3('0x3')];module[_0x7ea3('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x7ea3('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x7ea3('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x7ea3('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x7ea3('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x7ea3('0x8')],'unique':'UserId'}}; \ 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 8e0fbf6..5fe1242 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 _0xa9e0=['json','update','then','sendStatus','stack','name','status','send','user','role','admin','Unauthorized','params','UserSetting','body','catch','lodash','ioredis','../../config/logger','../../mysqldb','redis','./user-setting.socket','register','defaults','localhost'];(function(_0x70064c,_0x220c11){var _0x2d8a70=function(_0x1b6ea0){while(--_0x1b6ea0){_0x70064c['push'](_0x70064c['shift']());}};_0x2d8a70(++_0x220c11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x0a9e('0x0'));var Redis=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var config=require('../../config/environment');var db=require(_0x0a9e('0x3'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x4')]));require(_0x0a9e('0x5'))[_0x0a9e('0x6')](socket);config[_0x0a9e('0x4')]=_[_0x0a9e('0x7')](config['redis'],{'host':_0x0a9e('0x8'),'port':0x18eb});function respondWithResult(_0x441e3a,_0x2cc193){_0x2cc193=_0x2cc193||0xc8;return function(_0x5f41ea){if(_0x5f41ea){return _0x441e3a['status'](_0x2cc193)[_0x0a9e('0x9')](_0x5f41ea);}};}function saveUpdates(_0x56465b){return function(_0x52cace){if(_0x52cace){return _0x52cace[_0x0a9e('0xa')](_0x56465b)[_0x0a9e('0xb')](function(_0x307b3e){return _0x307b3e;});}return null;};}function handleEntityNotFound(_0x3ab53f){return function(_0xfeb75b){if(!_0xfeb75b){_0x3ab53f[_0x0a9e('0xc')](0x194);}return _0xfeb75b;};}function handleError(_0x4a4c56,_0x50dfb2){_0x50dfb2=_0x50dfb2||0x1f4;return function(_0x527cdd){logger['error'](_0x527cdd[_0x0a9e('0xd')]);if(_0x527cdd[_0x0a9e('0xe')]){delete _0x527cdd[_0x0a9e('0xe')];}_0x4a4c56[_0x0a9e('0xf')](_0x50dfb2)[_0x0a9e('0x10')](_0x527cdd);};}exports[_0x0a9e('0xa')]=function(_0x5db4b0,_0x4283ce){if(_0x5db4b0[_0x0a9e('0x11')][_0x0a9e('0x12')]!==_0x0a9e('0x13'))throw new Error(_0x0a9e('0x14'));if(isNaN(Number(_0x5db4b0[_0x0a9e('0x15')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x0a9e('0x16')]['find']({'where':{'id':_0x5db4b0[_0x0a9e('0x15')]['id']}})['then'](handleEntityNotFound(_0x4283ce,null))[_0x0a9e('0xb')](saveUpdates(_0x5db4b0[_0x0a9e('0x17')],null))['then'](respondWithResult(_0x4283ce,null))[_0x0a9e('0x18')](handleError(_0x4283ce,null));}; \ No newline at end of file +var _0x142c=['sendStatus','error','stack','name','send','update','role','params','Invalid\x20user\x20setting\x20id','UserSetting','find','then','body','catch','lodash','../../config/logger','api','../../config/environment','socket.io-emitter','redis'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x142c,0x86));var _0xc142=function(_0x113de8,_0x12aa03){_0x113de8=_0x113de8-0x0;var _0xd3c67a=_0x142c[_0x113de8];return _0xd3c67a;};'use strict';var _=require(_0xc142('0x0'));var Redis=require('ioredis');var logger=require(_0xc142('0x1'))(_0xc142('0x2'));var config=require(_0xc142('0x3'));var db=require('../../mysqldb')['db'];var socket=require(_0xc142('0x4'))(new Redis(config[_0xc142('0x5')]));require('./user-setting.socket')['register'](socket);config[_0xc142('0x5')]=_['defaults'](config[_0xc142('0x5')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x2d6796,_0x43226a){_0x43226a=_0x43226a||0xc8;return function(_0x30bf01){if(_0x30bf01){return _0x2d6796['status'](_0x43226a)['json'](_0x30bf01);}};}function saveUpdates(_0x27abe2){return function(_0x10ce67){if(_0x10ce67){return _0x10ce67['update'](_0x27abe2)['then'](function(_0x128066){return _0x128066;});}return null;};}function handleEntityNotFound(_0xc9a6a0){return function(_0x565b60){if(!_0x565b60){_0xc9a6a0[_0xc142('0x6')](0x194);}return _0x565b60;};}function handleError(_0x487384,_0x3d404d){_0x3d404d=_0x3d404d||0x1f4;return function(_0x5cf72b){logger[_0xc142('0x7')](_0x5cf72b[_0xc142('0x8')]);if(_0x5cf72b[_0xc142('0x9')]){delete _0x5cf72b[_0xc142('0x9')];}_0x487384['status'](_0x3d404d)[_0xc142('0xa')](_0x5cf72b);};}exports[_0xc142('0xb')]=function(_0x4a6370,_0x252f5f){if(_0x4a6370['user'][_0xc142('0xc')]!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0x4a6370[_0xc142('0xd')]['id'])))throw new Error(_0xc142('0xe'));return db[_0xc142('0xf')][_0xc142('0x10')]({'where':{'id':_0x4a6370['params']['id']}})[_0xc142('0x11')](handleEntityNotFound(_0x252f5f,null))[_0xc142('0x11')](saveUpdates(_0x4a6370[_0xc142('0x12')],null))[_0xc142('0x11')](respondWithResult(_0x252f5f,null))[_0xc142('0x13')](handleError(_0x252f5f,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 6ac3dad..34266dc 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 _0x5ef7=['setMaxListeners','save','emit','hasOwnProperty','events','../../mysqldb','UserSetting'];(function(_0x2a18b7,_0x5041c8){var _0x45e74e=function(_0x1d32d6){while(--_0x1d32d6){_0x2a18b7['push'](_0x2a18b7['shift']());}};_0x45e74e(++_0x5041c8);}(_0x5ef7,0x162));var _0x75ef=function(_0x31887f,_0x2b7076){_0x31887f=_0x31887f-0x0;var _0x213940=_0x5ef7[_0x31887f];return _0x213940;};'use strict';var EventEmitter=require(_0x75ef('0x0'));var UserSetting=require(_0x75ef('0x1'))['db'][_0x75ef('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x75ef('0x3')](0x0);var events={'afterCreate':_0x75ef('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1d2489){return function(_0x3f391c,_0x48d500,_0x568653){UserSettingEvents[_0x75ef('0x5')](_0x1d2489+':'+_0x3f391c['id'],_0x3f391c);UserSettingEvents['emit'](_0x1d2489,_0x3f391c);_0x568653(null);};}for(var e in events){if(events[_0x75ef('0x6')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0x20ec=['remove','emit','hasOwnProperty','exports','../../mysqldb','UserSetting','save','update'];(function(_0x999180,_0x265b67){var _0x411528=function(_0x3bc1c5){while(--_0x3bc1c5){_0x999180['push'](_0x999180['shift']());}};_0x411528(++_0x265b67);}(_0x20ec,0x19c));var _0xc20e=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0x20ec[_0xc82d1a];return _0x32fad2;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xc20e('0x0'))['db'][_0xc20e('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc20e('0x2'),'afterUpdate':_0xc20e('0x3'),'afterDestroy':_0xc20e('0x4')};function emitEvent(_0x2d0679){return function(_0x2a3492,_0x763628,_0x4ae826){UserSettingEvents[_0xc20e('0x5')](_0x2d0679+':'+_0x2a3492['id'],_0x2a3492);UserSettingEvents[_0xc20e('0x5')](_0x2d0679,_0x2a3492);_0x4ae826(null);};}for(var e in events){if(events[_0xc20e('0x6')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0xc20e('0x7')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 1558adc..7a1ed2f 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 _0x2cae=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','UserSetting'];(function(_0x1c446a,_0x3b3ad2){var _0x899e24=function(_0x579843){while(--_0x579843){_0x1c446a['push'](_0x1c446a['shift']());}};_0x899e24(++_0x3b3ad2);}(_0x2cae,0x16b));var _0xe2ca=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0x2cae[_0x31a576];return _0x30b1d3;};'use strict';var attributes=require(_0xe2ca('0x0'));module[_0xe2ca('0x1')]=function(_0x5d4b71){return _0x5d4b71['define'](_0xe2ca('0x2'),attributes,{'tableName':_0xe2ca('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x482b27){if(!_0x482b27[_0xe2ca('0x4')])_0x482b27[_0xe2ca('0x5')]=null;else if(_0x482b27[_0xe2ca('0x5')]===null)_0x482b27[_0xe2ca('0x5')]=new Date();}}});}; \ No newline at end of file +var _0xd4dc=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','define','UserSetting'];(function(_0x397476,_0x40ebb5){var _0x4473ce=function(_0x669b3a){while(--_0x669b3a){_0x397476['push'](_0x397476['shift']());}};_0x4473ce(++_0x40ebb5);}(_0xd4dc,0xff));var _0xcd4d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd4dc[_0x59ee6f];return _0x4c0979;};'use strict';var attributes=require(_0xcd4d('0x0'));module['exports']=function(_0x2712ce){return _0x2712ce[_0xcd4d('0x1')](_0xcd4d('0x2'),attributes,{'tableName':_0xcd4d('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1e7c24){if(!_0x1e7c24[_0xcd4d('0x4')])_0x1e7c24[_0xcd4d('0x5')]=null;else if(_0x1e7c24['clientSideLoggingEnabledSince']===null)_0x1e7c24[_0xcd4d('0x5')]=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 07f4ac8..5eb859b 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 _0x2d3f=['register','length','user-setting:','./user-setting.events','save','remove','update','emit','user-setting:update:user-'];(function(_0x19fb29,_0x40f044){var _0x10ee8b=function(_0x31eb38){while(--_0x31eb38){_0x19fb29['push'](_0x19fb29['shift']());}};_0x10ee8b(++_0x40f044);}(_0x2d3f,0x17d));var _0xf2d3=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x2d3f[_0x3ff085];return _0x2b68c3;};'use strict';var UserSettingEvents=require(_0xf2d3('0x0'));var events=[_0xf2d3('0x1'),_0xf2d3('0x2'),_0xf2d3('0x3')];function createListener(_0x2ed4d5,_0x3c0a76){return function(_0x57a202){_0x3c0a76[_0xf2d3('0x4')](_0x2ed4d5,_0x57a202);if(_0x2ed4d5==='user-setting:update'){_0x3c0a76[_0xf2d3('0x4')](_0xf2d3('0x5')+_0x57a202['UserId'],_0x57a202);}};}exports[_0xf2d3('0x6')]=function(_0x5b8c11){for(var _0x272cd2=0x0,_0x509520=events[_0xf2d3('0x7')];_0x272cd2<_0x509520;_0x272cd2++){var _0xbecd39=events[_0x272cd2];var _0x4c14a1=createListener(_0xf2d3('0x8')+_0xbecd39,_0x5b8c11);UserSettingEvents['on'](_0xbecd39,_0x4c14a1);}}; \ No newline at end of file +var _0x7ee6=['length','user-setting:','save','remove','update','user-setting:update','emit','user-setting:update:user-','UserId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7ee6,0x1a0));var _0x67ee=function(_0x4c1f27,_0x2eb028){_0x4c1f27=_0x4c1f27-0x0;var _0x28849b=_0x7ee6[_0x4c1f27];return _0x28849b;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x67ee('0x0'),_0x67ee('0x1'),_0x67ee('0x2')];function createListener(_0x5e73ec,_0x46ac51){return function(_0x331af4){_0x46ac51['emit'](_0x5e73ec,_0x331af4);if(_0x5e73ec===_0x67ee('0x3')){_0x46ac51[_0x67ee('0x4')](_0x67ee('0x5')+_0x331af4[_0x67ee('0x6')],_0x331af4);}};}exports['register']=function(_0x5a1216){for(var _0x1e4e9e=0x0,_0x2bef52=events[_0x67ee('0x7')];_0x1e4e9e<_0x2bef52;_0x1e4e9e++){var _0x4047fc=events[_0x1e4e9e];var _0x1551ab=createListener(_0x67ee('0x8')+_0x4047fc,_0x5a1216);UserSettingEvents['on'](_0x4047fc,_0x1551ab);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 19cc162..378fc3c 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 _0x86f0=['getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','bulkCreate','/:id/queues','addQueues','diskStorage','root','format','now','/:id/avatar','single','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addFaxAccounts','addOpenchannelAccounts','addWhatsappAccounts','createApiKey','put','/:id/password','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','/:id/messengerSoundNotification','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','describe','/whoami','/:id','show','getOpenTabs','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists'];(function(_0x2c6bad,_0x29ffed){var _0x5f5435=function(_0x23f89b){while(--_0x23f89b){_0x2c6bad['push'](_0x2c6bad['shift']());}};_0x5f5435(++_0x29ffed);}(_0x86f0,0x1e4));var _0x086f=function(_0x3b506d,_0x3de2f4){_0x3b506d=_0x3b506d-0x0;var _0x4391fa=_0x86f0[_0x3b506d];return _0x4391fa;};'use strict';var multer=require(_0x086f('0x0'));var util=require(_0x086f('0x1'));var path=require(_0x086f('0x2'));var timeout=require('connect-timeout');var express=require(_0x086f('0x3'));var router=express['Router']();var fs_extra=require(_0x086f('0x4'));var auth=require(_0x086f('0x5'));var interaction=require(_0x086f('0x6'));var config=require(_0x086f('0x7'));var controller=require(_0x086f('0x8'));router[_0x086f('0x9')]('/',auth[_0x086f('0xa')](),controller['index']);router[_0x086f('0x9')](_0x086f('0xb'),auth['isAuthenticated'](),controller[_0x086f('0xc')]);router[_0x086f('0x9')](_0x086f('0xd'),auth[_0x086f('0xa')](),controller['whoami']);router[_0x086f('0x9')]('/presence',auth[_0x086f('0xa')](),controller['getPresence']);router['get'](_0x086f('0xe'),auth[_0x086f('0xa')](),controller[_0x086f('0xf')]);router[_0x086f('0x9')]('/:id/avatar',controller['getAvatar']);router[_0x086f('0x9')]('/:id/open_tabs',auth[_0x086f('0xa')](),controller[_0x086f('0x10')]);router[_0x086f('0x9')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x086f('0x11')]);router[_0x086f('0x9')]('/:id/queues',auth[_0x086f('0xa')](),controller[_0x086f('0x12')]);router[_0x086f('0x9')](_0x086f('0x13'),auth[_0x086f('0xa')](),controller[_0x086f('0x14')]);router[_0x086f('0x9')](_0x086f('0x15'),auth['isAuthenticated'](),controller['getGroups']);router[_0x086f('0x9')](_0x086f('0x16'),auth['isAuthenticated'](),controller[_0x086f('0x17')]);router[_0x086f('0x9')]('/:id/screen_recordings',auth[_0x086f('0xa')](),controller[_0x086f('0x18')]);router[_0x086f('0x9')](_0x086f('0x19'),auth[_0x086f('0xa')](),controller[_0x086f('0x1a')]);router[_0x086f('0x9')](_0x086f('0x1b'),auth['isAuthenticated'](),controller[_0x086f('0x1c')]);router[_0x086f('0x9')]('/:id/mail/interactions',auth[_0x086f('0xa')](),controller[_0x086f('0x1d')]);router[_0x086f('0x9')]('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0x086f('0x1e')]);router['get'](_0x086f('0x1f'),auth[_0x086f('0xa')](),controller['getFaxInteractions']);router['get'](_0x086f('0x20'),auth[_0x086f('0xa')](),controller['getWhatsappInteractions']);router[_0x086f('0x9')](_0x086f('0x21'),auth[_0x086f('0xa')](),controller[_0x086f('0x22')]);router[_0x086f('0x9')](_0x086f('0x23'),auth[_0x086f('0xa')](),controller[_0x086f('0x24')]);router[_0x086f('0x9')](_0x086f('0x25'),auth[_0x086f('0xa')](),controller[_0x086f('0x26')]);router['get'](_0x086f('0x27'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0x086f('0x9')](_0x086f('0x28'),auth[_0x086f('0xa')](),controller[_0x086f('0x29')]);router[_0x086f('0x9')](_0x086f('0x2a'),auth[_0x086f('0xa')](),controller['getMailAccounts']);router[_0x086f('0x9')](_0x086f('0x2b'),auth[_0x086f('0xa')](),controller[_0x086f('0x2c')]);router[_0x086f('0x9')](_0x086f('0x2d'),auth[_0x086f('0xa')](),controller[_0x086f('0x2e')]);router['get'](_0x086f('0x2f'),auth['isAuthenticated'](),controller[_0x086f('0x30')]);router[_0x086f('0x9')](_0x086f('0x31'),auth[_0x086f('0xa')](),controller[_0x086f('0x32')]);router[_0x086f('0x9')](_0x086f('0x33'),auth['isAuthenticated'](),controller[_0x086f('0x34')]);router[_0x086f('0x9')](_0x086f('0x35'),auth['isAuthenticated'](),controller[_0x086f('0x36')]);router[_0x086f('0x37')]('/:id/contacts',auth[_0x086f('0xa')](),controller['addContacts']);router[_0x086f('0x37')]('/',auth[_0x086f('0xa')](),controller[_0x086f('0x38')]);router['post']('/create_many',auth['isAuthenticated'](),controller[_0x086f('0x39')]);router[_0x086f('0x37')](_0x086f('0x3a'),auth[_0x086f('0xa')](),controller[_0x086f('0x3b')]);var upload=multer({'storage':multer[_0x086f('0x3c')]({'destination':function(_0x41d910,_0x5ecaed,_0x1318f5){_0x1318f5(null,path['join'](config[_0x086f('0x3d')],'server/files/images/'));},'filename':function(_0x3b5e9e,_0x35616f,_0x3ae49d){_0x3ae49d(null,util[_0x086f('0x3e')]('%s-%s',Date[_0x086f('0x3f')](),_0x35616f['originalname']));}})});router[_0x086f('0x37')](_0x086f('0x40'),upload[_0x086f('0x41')]('file'),controller[_0x086f('0x42')]);router[_0x086f('0x37')](_0x086f('0x43'),auth[_0x086f('0xa')](),controller[_0x086f('0x44')]);router[_0x086f('0x37')](_0x086f('0x45'),auth[_0x086f('0xa')](),controller[_0x086f('0x46')]);router[_0x086f('0x37')](_0x086f('0x47'),auth[_0x086f('0xa')](),controller[_0x086f('0x48')]);router[_0x086f('0x37')](_0x086f('0x49'),auth[_0x086f('0xa')](),controller[_0x086f('0x4a')]);router[_0x086f('0x37')]('/:id/teams',auth['isAuthenticated'](),controller[_0x086f('0x4b')]);router[_0x086f('0x37')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x086f('0x4c')]);router[_0x086f('0x37')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x086f('0x4d')]);router[_0x086f('0x37')](_0x086f('0x4e'),auth[_0x086f('0xa')](),controller[_0x086f('0x4f')]);router['post'](_0x086f('0x50'),auth['isAuthenticated'](),controller['addSmsInteractions']);router['post']('/:id/openchannel_interactions',auth[_0x086f('0xa')](),controller['addOpenchannelInteractions']);router[_0x086f('0x37')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller['addWhatsappInteractions']);router['post'](_0x086f('0x28'),auth[_0x086f('0xa')](),controller[_0x086f('0x51')]);router[_0x086f('0x37')](_0x086f('0x2a'),auth[_0x086f('0xa')](),controller['addMailAccounts']);router[_0x086f('0x37')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x086f('0x52')]);router[_0x086f('0x37')]('/:id/sms_accounts',auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0x086f('0x37')]('/:id/chat_websites',auth[_0x086f('0xa')](),controller['addChatWebsites']);router[_0x086f('0x37')](_0x086f('0x31'),auth[_0x086f('0xa')](),controller[_0x086f('0x53')]);router[_0x086f('0x37')]('/:id/api_key',auth[_0x086f('0xa')](),controller[_0x086f('0x54')]);router[_0x086f('0x55')](_0x086f('0xe'),auth[_0x086f('0xa')](),controller['update']);router[_0x086f('0x55')](_0x086f('0x56'),auth['isAuthenticated'](),controller['changePassword']);router[_0x086f('0x57')](_0x086f('0x3a'),auth[_0x086f('0xa')](),controller[_0x086f('0x58')]);router[_0x086f('0x57')](_0x086f('0x21'),auth[_0x086f('0xa')](),controller[_0x086f('0x59')]);router['delete'](_0x086f('0xe'),auth[_0x086f('0xa')](),controller[_0x086f('0x5a')]);router[_0x086f('0x57')](_0x086f('0x5b'),auth[_0x086f('0xa')](),controller['removeChatInteractions']);router['delete']('/:id/mail_interactions',auth[_0x086f('0xa')](),controller[_0x086f('0x5c')]);router[_0x086f('0x57')](_0x086f('0x4e'),auth[_0x086f('0xa')](),controller[_0x086f('0x5d')]);router['delete'](_0x086f('0x50'),auth[_0x086f('0xa')](),controller[_0x086f('0x5e')]);router[_0x086f('0x57')]('/:id/openchannel_interactions',auth[_0x086f('0xa')](),controller[_0x086f('0x5f')]);router[_0x086f('0x57')]('/:id/whatsapp_interactions',auth[_0x086f('0xa')](),controller['removeWhatsappInteractions']);router['delete']('/:id/fax_accounts',auth[_0x086f('0xa')](),controller[_0x086f('0x60')]);router[_0x086f('0x57')](_0x086f('0x2a'),auth['isAuthenticated'](),controller[_0x086f('0x61')]);router[_0x086f('0x57')](_0x086f('0x2b'),auth['isAuthenticated'](),controller[_0x086f('0x62')]);router[_0x086f('0x57')](_0x086f('0x2d'),auth[_0x086f('0xa')](),controller[_0x086f('0x63')]);router[_0x086f('0x57')](_0x086f('0x2f'),auth[_0x086f('0xa')](),controller[_0x086f('0x64')]);router['delete'](_0x086f('0x31'),auth[_0x086f('0xa')](),controller['removeWhatsappAccounts']);router['delete']('/:id/api_key',auth[_0x086f('0xa')](),controller[_0x086f('0x65')]);router[_0x086f('0x37')](_0x086f('0x66'),auth[_0x086f('0xa')](),controller['messengerSoundNotification']);module[_0x086f('0x67')]=router; \ No newline at end of file +var _0x652d=['/:id/sms_interactions','addSmsInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','/:id','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeChatWebsites','removeWhatsappAccounts','messengerSoundNotification','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','/whoami','whoami','getPresence','/:id/avatar','getOpenTabs','getContacts','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','getAgents','/:id/prefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/api_key','/:id/contacts','addContacts','create','post','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','%s-%s','now','originalname','single','addAvatar','login','/:id/logout','logout','/:id/pause','pause','unpause','/:id/mail_interactions','addMailInteractions'];(function(_0x52893b,_0x12b7da){var _0x2c3bbc=function(_0x41e383){while(--_0x41e383){_0x52893b['push'](_0x52893b['shift']());}};_0x2c3bbc(++_0x12b7da);}(_0x652d,0x1a0));var _0xd652=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x652d[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0xd652('0x0'));var path=require(_0xd652('0x1'));var timeout=require(_0xd652('0x2'));var express=require(_0xd652('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd652('0x4'));var config=require(_0xd652('0x5'));var controller=require(_0xd652('0x6'));router['get']('/',auth[_0xd652('0x7')](),controller[_0xd652('0x8')]);router[_0xd652('0x9')](_0xd652('0xa'),auth['isAuthenticated'](),controller[_0xd652('0xb')]);router[_0xd652('0x9')](_0xd652('0xc'),auth[_0xd652('0x7')](),controller[_0xd652('0xd')]);router[_0xd652('0x9')]('/presence',auth['isAuthenticated'](),controller[_0xd652('0xe')]);router[_0xd652('0x9')]('/:id',auth[_0xd652('0x7')](),controller['show']);router[_0xd652('0x9')](_0xd652('0xf'),controller['getAvatar']);router[_0xd652('0x9')]('/:id/open_tabs',auth[_0xd652('0x7')](),controller[_0xd652('0x10')]);router[_0xd652('0x9')]('/:id/contacts',auth[_0xd652('0x7')](),controller[_0xd652('0x11')]);router[_0xd652('0x9')]('/:id/queues',auth[_0xd652('0x7')](),controller['getQueues']);router[_0xd652('0x9')](_0xd652('0x12'),auth[_0xd652('0x7')](),controller[_0xd652('0x13')]);router[_0xd652('0x9')](_0xd652('0x14'),auth['isAuthenticated'](),controller[_0xd652('0x15')]);router['get']('/:id/recordings',auth[_0xd652('0x7')](),controller[_0xd652('0x16')]);router[_0xd652('0x9')]('/:id/screen_recordings',auth[_0xd652('0x7')](),controller[_0xd652('0x17')]);router[_0xd652('0x9')](_0xd652('0x18'),auth[_0xd652('0x7')](),controller[_0xd652('0x19')]);router[_0xd652('0x9')]('/:id/openchannel/interactions',auth[_0xd652('0x7')](),controller[_0xd652('0x1a')]);router[_0xd652('0x9')](_0xd652('0x1b'),auth[_0xd652('0x7')](),controller[_0xd652('0x1c')]);router['get'](_0xd652('0x1d'),auth[_0xd652('0x7')](),controller[_0xd652('0x1e')]);router[_0xd652('0x9')](_0xd652('0x1f'),auth[_0xd652('0x7')](),controller[_0xd652('0x20')]);router['get'](_0xd652('0x21'),auth[_0xd652('0x7')](),controller[_0xd652('0x22')]);router[_0xd652('0x9')](_0xd652('0x23'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xd652('0x24'),auth[_0xd652('0x7')](),controller[_0xd652('0x25')]);router[_0xd652('0x9')]('/:id/agents',auth['isAuthenticated'](),controller[_0xd652('0x26')]);router[_0xd652('0x9')](_0xd652('0x27'),auth[_0xd652('0x7')](),controller['getVoicePrefixes']);router[_0xd652('0x9')](_0xd652('0x28'),auth[_0xd652('0x7')](),controller['getFaxAccounts']);router[_0xd652('0x9')](_0xd652('0x29'),auth[_0xd652('0x7')](),controller[_0xd652('0x2a')]);router['get'](_0xd652('0x2b'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0xd652('0x9')](_0xd652('0x2c'),auth[_0xd652('0x7')](),controller['getSmsAccounts']);router[_0xd652('0x9')](_0xd652('0x2d'),auth['isAuthenticated'](),controller[_0xd652('0x2e')]);router[_0xd652('0x9')](_0xd652('0x2f'),auth[_0xd652('0x7')](),controller['getWhatsappAccounts']);router[_0xd652('0x9')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0xd652('0x9')](_0xd652('0x30'),auth[_0xd652('0x7')](),controller['getApiKey']);router['post'](_0xd652('0x31'),auth[_0xd652('0x7')](),controller[_0xd652('0x32')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd652('0x33')]);router[_0xd652('0x34')](_0xd652('0x35'),auth['isAuthenticated'](),controller[_0xd652('0x36')]);router['post'](_0xd652('0x37'),auth['isAuthenticated'](),controller[_0xd652('0x38')]);var upload=multer({'storage':multer[_0xd652('0x39')]({'destination':function(_0x5bef9e,_0x3df1df,_0x38a2b4){_0x38a2b4(null,path[_0xd652('0x3a')](config[_0xd652('0x3b')],_0xd652('0x3c')));},'filename':function(_0x41552e,_0x18f69d,_0x2d655d){_0x2d655d(null,util['format'](_0xd652('0x3d'),Date[_0xd652('0x3e')](),_0x18f69d[_0xd652('0x3f')]));}})});router[_0xd652('0x34')]('/:id/avatar',upload[_0xd652('0x40')]('file'),controller[_0xd652('0x41')]);router[_0xd652('0x34')]('/:id/login',auth[_0xd652('0x7')](),controller[_0xd652('0x42')]);router[_0xd652('0x34')](_0xd652('0x43'),auth[_0xd652('0x7')](),controller[_0xd652('0x44')]);router[_0xd652('0x34')](_0xd652('0x45'),auth[_0xd652('0x7')](),controller[_0xd652('0x46')]);router[_0xd652('0x34')]('/:id/unpause',auth[_0xd652('0x7')](),controller[_0xd652('0x47')]);router[_0xd652('0x34')]('/:id/teams',auth[_0xd652('0x7')](),controller['addTeams']);router[_0xd652('0x34')]('/:id/chat_interactions',auth['isAuthenticated'](),controller['addChatInteractions']);router['post'](_0xd652('0x48'),auth['isAuthenticated'](),controller[_0xd652('0x49')]);router[_0xd652('0x34')]('/:id/fax_interactions',auth[_0xd652('0x7')](),controller['addFaxInteractions']);router[_0xd652('0x34')](_0xd652('0x4a'),auth[_0xd652('0x7')](),controller[_0xd652('0x4b')]);router[_0xd652('0x34')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0xd652('0x34')](_0xd652('0x4c'),auth[_0xd652('0x7')](),controller[_0xd652('0x4d')]);router['post']('/:id/fax_accounts',auth['isAuthenticated'](),controller['addFaxAccounts']);router[_0xd652('0x34')]('/:id/mail_accounts',auth[_0xd652('0x7')](),controller['addMailAccounts']);router['post']('/:id/openchannel_accounts',auth[_0xd652('0x7')](),controller['addOpenchannelAccounts']);router[_0xd652('0x34')]('/:id/sms_accounts',auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0xd652('0x34')](_0xd652('0x2d'),auth['isAuthenticated'](),controller['addChatWebsites']);router['post']('/:id/whatsapp_accounts',auth[_0xd652('0x7')](),controller['addWhatsappAccounts']);router[_0xd652('0x34')]('/:id/api_key',auth[_0xd652('0x7')](),controller['createApiKey']);router[_0xd652('0x4e')]('/:id',auth['isAuthenticated'](),controller[_0xd652('0x4f')]);router[_0xd652('0x4e')](_0xd652('0x50'),auth[_0xd652('0x7')](),controller[_0xd652('0x51')]);router[_0xd652('0x52')]('/:id/queues',auth[_0xd652('0x7')](),controller[_0xd652('0x53')]);router[_0xd652('0x52')](_0xd652('0x23'),auth['isAuthenticated'](),controller[_0xd652('0x54')]);router[_0xd652('0x52')](_0xd652('0x55'),auth[_0xd652('0x7')](),controller['destroy']);router[_0xd652('0x52')]('/:id/chat_interactions',auth[_0xd652('0x7')](),controller['removeChatInteractions']);router[_0xd652('0x52')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0xd652('0x56')]);router[_0xd652('0x52')](_0xd652('0x57'),auth[_0xd652('0x7')](),controller[_0xd652('0x58')]);router[_0xd652('0x52')](_0xd652('0x4a'),auth[_0xd652('0x7')](),controller[_0xd652('0x59')]);router['delete'](_0xd652('0x5a'),auth[_0xd652('0x7')](),controller[_0xd652('0x5b')]);router[_0xd652('0x52')](_0xd652('0x4c'),auth[_0xd652('0x7')](),controller['removeWhatsappInteractions']);router[_0xd652('0x52')](_0xd652('0x28'),auth[_0xd652('0x7')](),controller[_0xd652('0x5c')]);router[_0xd652('0x52')](_0xd652('0x29'),auth[_0xd652('0x7')](),controller[_0xd652('0x5d')]);router[_0xd652('0x52')](_0xd652('0x2b'),auth[_0xd652('0x7')](),controller['removeOpenchannelAccounts']);router[_0xd652('0x52')](_0xd652('0x2c'),auth[_0xd652('0x7')](),controller['removeSmsAccounts']);router[_0xd652('0x52')]('/:id/chat_websites',auth[_0xd652('0x7')](),controller[_0xd652('0x5e')]);router[_0xd652('0x52')](_0xd652('0x2f'),auth['isAuthenticated'](),controller[_0xd652('0x5f')]);router[_0xd652('0x52')](_0xd652('0x30'),auth['isAuthenticated'](),controller['removeApiKey']);router[_0xd652('0x34')]('/:id/messengerSoundNotification',auth[_0xd652('0x7')](),controller[_0xd652('0x60')]);module[_0xd652('0x61')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index a319023..a207999 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 _0x241f=['STRING','setDataValue','name','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','format','\x22%s\x22\x20<%s>','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','dtlsverify','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','lodash','exports'];(function(_0x35cebe,_0x254acf){var _0x22c897=function(_0x3c1838){while(--_0x3c1838){_0x35cebe['push'](_0x35cebe['shift']());}};_0x22c897(++_0x254acf);}(_0x241f,0x1e1));var _0xf241=function(_0x1956c9,_0x2ad6b4){_0x1956c9=_0x1956c9-0x0;var _0x499d4=_0x241f[_0x1956c9];return _0x499d4;};'use strict';var Sequelize=require(_0xf241('0x0'));var moment=require(_0xf241('0x1'));var util=require('util');var _=require(_0xf241('0x2'));module[_0xf241('0x3')]={'name':{'type':Sequelize[_0xf241('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3e9d1){this[_0xf241('0x5')](_0xf241('0x6'),_0x3e9d1);this[_0xf241('0x5')](_0xf241('0x7'),_0x3e9d1);},'comment':_0xf241('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4aa107){this[_0xf241('0x5')](_0xf241('0x9'),_0x4aa107);this['setDataValue'](_0xf241('0xa'),util['format']('\x22%s\x22\x20<%s>',_0x4aa107,this[_0xf241('0xb')](_0xf241('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x5c000a){if(_0x5c000a){this[_0xf241('0x5')](_0xf241('0xd'),_0x5c000a[_0xf241('0xe')]());}}},'role':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x10'),_0xf241('0x11'),_0xf241('0x12'),_0xf241('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0xf241('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xf241('0x14')},'internal':{'type':Sequelize[_0xf241('0x15')](0xb),'allowNull':![],'unique':'internal','set':function(_0x2ee949){this[_0xf241('0x5')]('internal',_0x2ee949);this[_0xf241('0x5')](_0xf241('0x16'),_0x2ee949);this[_0xf241('0x5')](_0xf241('0xa'),util[_0xf241('0x17')](_0xf241('0x18'),this[_0xf241('0xb')](_0xf241('0x9')),_0x2ee949));}},'salt':{'type':Sequelize[_0xf241('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xf241('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xf241('0x4')]},'userpic':{'type':Sequelize[_0xf241('0x4')]},'city':{'type':Sequelize[_0xf241('0x4')]},'country':{'type':Sequelize[_0xf241('0x4')]},'online':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xf241('0x4')],'defaultValue':_0xf241('0x1a')},'lastPauseAt':{'type':Sequelize[_0xf241('0x1b')]},'chatCapacity':{'type':Sequelize[_0xf241('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xf241('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xf241('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xf241('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xf241('0x19')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xf241('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xf241('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xf241('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'description':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![],'defaultValue':_0xf241('0x1c')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xf241('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xf241('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xf241('0xf')]('friend',_0xf241('0x11'),'peer'),'allowNull':!![],'defaultValue':_0xf241('0x1d')},'context':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![],'defaultValue':_0xf241('0x1e')},'callingpres':{'type':Sequelize['ENUM'](_0xf241('0x1f'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0xf241('0x20'),_0xf241('0x21'),'PROHIB_PASSED_SCREEN',_0xf241('0x22'),_0xf241('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![],'defaultValue':_0xf241('0x24'),'set':function(_0x3bb166){this[_0xf241('0x5')](_0xf241('0x25'),_0x3bb166?_0x3bb166[_0xf241('0x26')](','):null);},'get':function(){return this[_0xf241('0xb')](_0xf241('0x25'))?this[_0xf241('0xb')]('transport')[_0xf241('0x27')](','):null;},'comment':_0xf241('0x28')},'dtmfmode':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x29'),_0xf241('0x2a'),_0xf241('0x2b'),_0xf241('0x2c'),_0xf241('0x2d')),'allowNull':!![],'defaultValue':_0xf241('0x29')},'directmedia':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no',_0xf241('0x2f'),_0xf241('0x30'),_0xf241('0x31')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![],'defaultValue':_0xf241('0x32'),'set':function(_0x28ca5f){this[_0xf241('0x5')](_0xf241('0x33'),_0x28ca5f?_0x28ca5f[_0xf241('0x26')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0xf241('0xb')](_0xf241('0x33'))[_0xf241('0x27')](','):null;},'comment':_0xf241('0x34')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xf241('0x4')]},'pickupgroup':{'type':Sequelize[_0xf241('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xf241('0x4')]},'language':{'type':Sequelize[_0xf241('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xf241('0x4')],'allowNull':![],'defaultValue':_0xf241('0x35')},'allow':{'type':Sequelize[_0xf241('0x4')],'allowNull':![],'defaultValue':_0xf241('0x36'),'set':function(_0x1729c7){this[_0xf241('0x5')]('allow',_0x1729c7?_0x1729c7[_0xf241('0x26')](';'):_0xf241('0x36'));},'get':function(){return this['getDataValue'](_0xf241('0x37'))?this[_0xf241('0xb')]('allow')[_0xf241('0x27')](';'):null;},'comment':_0xf241('0x38')},'autoframing':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![],'set':function(_0xfccf37){this[_0xf241('0x5')]('insecure',_0xfccf37?_0xfccf37[_0xf241('0x26')](','):null);},'get':function(){return this[_0xf241('0xb')]('insecure')?this[_0xf241('0xb')](_0xf241('0x39'))['split'](','):null;},'comment':_0xf241('0x3a')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no',_0xf241('0x3b')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xf241('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![],'defaultValue':_0xf241('0x3c')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no'),'allowNull':!![],'defaultValue':_0xf241('0x2e')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf241('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xf241('0xf')]('accept','refuse',_0xf241('0x3d')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xf241('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x3e'),'uas'),'allowNull':!![],'defaultValue':_0xf241('0x3f')},'t38pt_usertpsource':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xf241('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xf241('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xf241('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xf241('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xf241('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xf241('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0xf241('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xf241('0xf')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no',_0xf241('0x40'),_0xf241('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xf241('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0xf241('0x42'),_0xf241('0x43'),_0xf241('0x44')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xf241('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xf241('0x2e'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xf241('0x2e'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no',_0xf241('0x2f'),'update',_0xf241('0x45')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xf241('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xf241('0x1b')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xf241('0x46')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x337fd7){this[_0xf241('0x5')](_0xf241('0x47'),_0x337fd7);var _0xd3233d=this[_0xf241('0x48')]({'plain':!![]});switch(_0x337fd7){case 0x0:case 0x1:var _0x1c90b3=_0xd3233d[_0xf241('0x25')]?_[_0xf241('0x49')](_0xd3233d[_0xf241('0x25')])?_0xd3233d[_0xf241('0x25')][_0xf241('0x26')]():_0xd3233d[_0xf241('0x25')]:_0xf241('0x24');if(_0x1c90b3===_0xf241('0x4a')){_0x1c90b3='udp';}this[_0xf241('0x5')](_0xf241('0x25'),_0x1c90b3);this[_0xf241('0x5')](_0xf241('0x4b'),'no');this[_0xf241('0x5')](_0xf241('0x4c'),null);this[_0xf241('0x5')](_0xf241('0x4d'),null);this[_0xf241('0x5')](_0xf241('0x4e'),null);this[_0xf241('0x5')](_0xf241('0x4f'),null);this['setDataValue']('dtlsverify',null);this[_0xf241('0x5')](_0xf241('0x50'),null);this[_0xf241('0x5')](_0xf241('0x51'),null);this[_0xf241('0x5')]('dtlsprivatekey',null);this[_0xf241('0x5')]('rtcp_mux','no');break;case 0x2:this[_0xf241('0x5')](_0xf241('0x25'),_0xf241('0x4a'));this[_0xf241('0x5')](_0xf241('0x4b'),'yes');this[_0xf241('0x5')]('avpf',_0xf241('0x2e'));this['setDataValue'](_0xf241('0x4d'),_0xf241('0x2e'));this['setDataValue'](_0xf241('0x4e'),_0xf241('0x2e'));this['setDataValue'](_0xf241('0x4f'),_0xf241('0x2e'));this['setDataValue'](_0xf241('0x52'),'no');this[_0xf241('0x5')](_0xf241('0x50'),_0xf241('0x44'));this[_0xf241('0x5')](_0xf241('0x51'),_0xd3233d[_0xf241('0x51')]||_0xf241('0x53'));this['setDataValue'](_0xf241('0x54'),_0xd3233d[_0xf241('0x54')]||_0xf241('0x55'));this[_0xf241('0x5')](_0xf241('0x56'),_0xf241('0x2e'));break;default:}}},'permissions':{'type':Sequelize[_0xf241('0x46')],'set':function(_0x287eb9){this[_0xf241('0x5')](_0xf241('0x57'),_0x287eb9?_0x287eb9['join'](','):[]);},'get':function(){return this['getDataValue']('permissions')?_[_0xf241('0x58')](this[_0xf241('0xb')](_0xf241('0x57'))[_0xf241('0x27')](','),function(_0x4124b7){return parseInt(_0x4124b7,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xf241('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xf241('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xf241('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xf241('0x19')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xf241('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xf241('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xf241('0xf')](_0xf241('0x2e'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xf241('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf241('0xb')]('phoneBarEnableScreenRecordingByAgent')?this[_0xf241('0xb')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xf241('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xf241('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![],'set':function(_0x2dd2c1){if(typeof _0x2dd2c1===_0xf241('0x59')){var _0x5f2717=_0x2dd2c1==='1'?!![]:_0x2dd2c1==='0'?![]:_0x2dd2c1===_0xf241('0x5a')?!![]:_0x2dd2c1===_0xf241('0x5b')?![]:![];this[_0xf241('0x5')]('screenrecording',_0x5f2717);}else{this['setDataValue'](_0xf241('0x5c'),_0x2dd2c1);}}},'blocked':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![],'set':function(_0x34a6e1){this[_0xf241('0x5')](_0xf241('0x5d'),_0x34a6e1);if(_0x34a6e1===!![]){this[_0xf241('0x5')](_0xf241('0x5e'),moment());this[_0xf241('0x5')](_0xf241('0x5f'),0x0);}else{this[_0xf241('0x5')](_0xf241('0x5e'),null);}}},'blockedAt':{'type':Sequelize[_0xf241('0x1b')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xf241('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xf241('0x19')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0xf241('0x60')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xf241('0x19')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf241('0x19')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf241('0x19')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xf241('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xf241('0x15')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xf241('0x15')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xf241('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0xf241('0x19')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0xf241('0x15')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xca06=['exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','toLowerCase','ENUM','admin','user','local','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','refuse','originate','uac','uas','certificate','active','actpass','update,nonat','TEXT','showWebBar','get','encryption','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlsprivatekey','dtlsverify','dtlscertfile','/etc/pki/tls/private/motion.key','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','sequelize','moment','util','lodash'];(function(_0x469ac7,_0xd1f270){var _0x4e6051=function(_0x4a56ad){while(--_0x4a56ad){_0x469ac7['push'](_0x469ac7['shift']());}};_0x4e6051(++_0xd1f270);}(_0xca06,0x10a));var _0x6ca0=function(_0x42d552,_0x59abeb){_0x42d552=_0x42d552-0x0;var _0x4dacf5=_0xca06[_0x42d552];return _0x4dacf5;};'use strict';var Sequelize=require(_0x6ca0('0x0'));var moment=require(_0x6ca0('0x1'));var util=require(_0x6ca0('0x2'));var _=require(_0x6ca0('0x3'));module[_0x6ca0('0x4')]={'name':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':![],'unique':_0x6ca0('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x332f12){this['setDataValue'](_0x6ca0('0x6'),_0x332f12);this[_0x6ca0('0x7')](_0x6ca0('0x8'),_0x332f12);},'comment':_0x6ca0('0x9')},'fullname':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':![],'set':function(_0x30b6f6){this['setDataValue'](_0x6ca0('0xa'),_0x30b6f6);this['setDataValue'](_0x6ca0('0xb'),util[_0x6ca0('0xc')](_0x6ca0('0xd'),_0x30b6f6,this[_0x6ca0('0xe')](_0x6ca0('0xf'))));}},'alias':{'type':Sequelize[_0x6ca0('0x5')]},'email':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x59df87){if(_0x59df87){this[_0x6ca0('0x7')]('email',_0x59df87[_0x6ca0('0x10')]());}}},'role':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x12'),_0x6ca0('0x13'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x6ca0('0x14')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x6ca0('0xf'),'set':function(_0x213699){this[_0x6ca0('0x7')]('internal',_0x213699);this[_0x6ca0('0x7')](_0x6ca0('0x15'),_0x213699);this[_0x6ca0('0x7')](_0x6ca0('0xb'),util[_0x6ca0('0xc')](_0x6ca0('0xd'),this[_0x6ca0('0xe')](_0x6ca0('0xa')),_0x213699));}},'salt':{'type':Sequelize[_0x6ca0('0x5')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6ca0('0x5')]},'address':{'type':Sequelize[_0x6ca0('0x5')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x6ca0('0x5')]},'country':{'type':Sequelize[_0x6ca0('0x5')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x6ca0('0x16')]},'voicePause':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x6ca0('0x18')},'lastPauseAt':{'type':Sequelize[_0x6ca0('0x16')]},'chatCapacity':{'type':Sequelize[_0x6ca0('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x6ca0('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x6ca0('0x19')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x6ca0('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x6ca0('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x6ca0('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x6ca0('0x19')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x6ca0('0x19')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x6ca0('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6ca0('0x1a')},'ipaddr':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x6ca0('0x19')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x6ca0('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x6ca0('0x1b'),_0x6ca0('0x13'),_0x6ca0('0x1c')),'allowNull':!![],'defaultValue':_0x6ca0('0x1b')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6ca0('0x1d')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x6ca0('0x1e'),_0x6ca0('0x1f'),_0x6ca0('0x20'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x6ca0('0x21'),_0x6ca0('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'permit':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![],'defaultValue':_0x6ca0('0x23'),'set':function(_0x13c1e3){this[_0x6ca0('0x7')](_0x6ca0('0x24'),_0x13c1e3?_0x13c1e3[_0x6ca0('0x25')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x6ca0('0xe')]('transport')[_0x6ca0('0x26')](','):null;},'comment':_0x6ca0('0x27')},'dtmfmode':{'type':Sequelize[_0x6ca0('0x11')]('rfc2833',_0x6ca0('0x28'),_0x6ca0('0x29'),_0x6ca0('0x2a'),_0x6ca0('0x2b')),'allowNull':!![],'defaultValue':_0x6ca0('0x2c')},'directmedia':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no',_0x6ca0('0x2e'),_0x6ca0('0x2f'),_0x6ca0('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![],'defaultValue':_0x6ca0('0x31'),'set':function(_0x3b99c6){this[_0x6ca0('0x7')]('nat',_0x3b99c6?_0x3b99c6['join'](','):null);},'get':function(){return this[_0x6ca0('0xe')]('nat')?this[_0x6ca0('0xe')](_0x6ca0('0x32'))[_0x6ca0('0x26')](','):null;},'comment':_0x6ca0('0x33')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x6ca0('0x5')]},'pickupgroup':{'type':Sequelize[_0x6ca0('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x6ca0('0x5')]},'language':{'type':Sequelize[_0x6ca0('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6ca0('0x5')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6ca0('0x34')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6ca0('0x35'),'set':function(_0x5ab4b2){this[_0x6ca0('0x7')](_0x6ca0('0x36'),_0x5ab4b2?_0x5ab4b2['join'](';'):_0x6ca0('0x35'));},'get':function(){return this[_0x6ca0('0xe')](_0x6ca0('0x36'))?this[_0x6ca0('0xe')](_0x6ca0('0x36'))[_0x6ca0('0x26')](';'):null;},'comment':_0x6ca0('0x37')},'autoframing':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![],'set':function(_0x566556){this[_0x6ca0('0x7')](_0x6ca0('0x38'),_0x566556?_0x566556[_0x6ca0('0x25')](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0x6ca0('0xe')]('insecure')[_0x6ca0('0x26')](','):null;},'comment':_0x6ca0('0x39')},'trustrpid':{'type':Sequelize['ENUM'](_0x6ca0('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6ca0('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x6ca0('0x2d'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x6ca0('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x6ca0('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![],'defaultValue':_0x6ca0('0x3a')},'amaflags':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x6ca0('0x2d')},'busylevel':{'type':Sequelize[_0x6ca0('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x6ca0('0x11')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x6ca0('0x11')]('yes','no',_0x6ca0('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6ca0('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x6ca0('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x6ca0('0x11')]('accept',_0x6ca0('0x3c'),_0x6ca0('0x3d')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x6ca0('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x6ca0('0x19')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x6ca0('0x3e'),_0x6ca0('0x3f')),'allowNull':!![],'defaultValue':_0x6ca0('0x3f')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x6ca0('0x19')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x6ca0('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x6ca0('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6ca0('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x6ca0('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x6ca0('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x6ca0('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no','fingerprint',_0x6ca0('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x6ca0('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x41'),'passive',_0x6ca0('0x42')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x6ca0('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x6ca0('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x6ca0('0x11')](_0x6ca0('0x2d'),'no',_0x6ca0('0x2e'),'update',_0x6ca0('0x43')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x6ca0('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x6ca0('0x44')]},'showWebBar':{'type':Sequelize[_0x6ca0('0x19')],'defaultValue':0x0,'set':function(_0x237f10){this['setDataValue'](_0x6ca0('0x45'),_0x237f10);var _0x160960=this[_0x6ca0('0x46')]({'plain':!![]});switch(_0x237f10){case 0x0:case 0x1:var _0x2ba658=_0x160960[_0x6ca0('0x24')]?_['isArray'](_0x160960[_0x6ca0('0x24')])?_0x160960[_0x6ca0('0x24')][_0x6ca0('0x25')]():_0x160960[_0x6ca0('0x24')]:_0x6ca0('0x23');if(_0x2ba658==='wss'){_0x2ba658='udp';}this[_0x6ca0('0x7')](_0x6ca0('0x24'),_0x2ba658);this[_0x6ca0('0x7')](_0x6ca0('0x47'),'no');this['setDataValue'](_0x6ca0('0x48'),null);this['setDataValue'](_0x6ca0('0x49'),null);this['setDataValue'](_0x6ca0('0x4a'),null);this[_0x6ca0('0x7')](_0x6ca0('0x4b'),null);this[_0x6ca0('0x7')]('dtlsverify',null);this[_0x6ca0('0x7')](_0x6ca0('0x4c'),null);this['setDataValue']('dtlscertfile',null);this[_0x6ca0('0x7')](_0x6ca0('0x4d'),null);this[_0x6ca0('0x7')]('rtcp_mux','no');break;case 0x2:this[_0x6ca0('0x7')](_0x6ca0('0x24'),'wss');this[_0x6ca0('0x7')](_0x6ca0('0x47'),_0x6ca0('0x2d'));this[_0x6ca0('0x7')](_0x6ca0('0x48'),'yes');this[_0x6ca0('0x7')](_0x6ca0('0x49'),'yes');this[_0x6ca0('0x7')]('icesupport',_0x6ca0('0x2d'));this[_0x6ca0('0x7')](_0x6ca0('0x4b'),'yes');this[_0x6ca0('0x7')](_0x6ca0('0x4e'),'no');this[_0x6ca0('0x7')](_0x6ca0('0x4c'),_0x6ca0('0x42'));this[_0x6ca0('0x7')](_0x6ca0('0x4f'),_0x160960[_0x6ca0('0x4f')]||'/etc/pki/tls/certs/motion.crt');this[_0x6ca0('0x7')](_0x6ca0('0x4d'),_0x160960[_0x6ca0('0x4d')]||_0x6ca0('0x50'));this['setDataValue']('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x6ca0('0x44')],'set':function(_0x4bb314){this[_0x6ca0('0x7')]('permissions',_0x4bb314?_0x4bb314[_0x6ca0('0x25')](','):[]);},'get':function(){return this['getDataValue'](_0x6ca0('0x51'))?_[_0x6ca0('0x52')](this[_0x6ca0('0xe')](_0x6ca0('0x51'))[_0x6ca0('0x26')](','),function(_0x4b1247){return parseInt(_0x4b1247,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x6ca0('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x6ca0('0x11')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6ca0('0x5')]},'phoneBarEnableJaws':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x6ca0('0xe')](_0x6ca0('0x53'))?this[_0x6ca0('0xe')](_0x6ca0('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x6ca0('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x6ca0('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![],'set':function(_0x4b9ee7){if(typeof _0x4b9ee7===_0x6ca0('0x54')){var _0x9b4d9b=_0x4b9ee7==='1'?!![]:_0x4b9ee7==='0'?![]:_0x4b9ee7===_0x6ca0('0x55')?!![]:_0x4b9ee7===_0x6ca0('0x56')?![]:![];this[_0x6ca0('0x7')](_0x6ca0('0x57'),_0x9b4d9b);}else{this[_0x6ca0('0x7')](_0x6ca0('0x57'),_0x4b9ee7);}}},'blocked':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![],'set':function(_0x307825){this[_0x6ca0('0x7')]('blocked',_0x307825);if(_0x307825===!![]){this[_0x6ca0('0x7')](_0x6ca0('0x58'),moment());this[_0x6ca0('0x7')](_0x6ca0('0x59'),0x0);}else{this['setDataValue'](_0x6ca0('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x6ca0('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x6ca0('0x19')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x6ca0('0x19')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x6ca0('0x19')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x6ca0('0x19')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x6ca0('0x17')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 803d04b..9eb00cb 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 _0x3f23=['catch','body','params','describe','addContacts','ids','omit','Setting','findById','securePassword','validatePasswordPattern','password','max','internal','min_internal','sequelize','QueryTypes','SELECT','from','mailbox','VoiceMail','fullname','email','permissions','101','103','113','110','104','105','106','108','109','111','114','115','create','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','isEmpty','compact','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','oldPassword','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','addQueues','loginInPause','voicePause','interface','Unknown\x20channel','add','capitalize','toLowerCase','spread','QueueId','Queue:save','voice','VoiceQueue','online','isNil','format','penalty','upsert','removeQueues','channel','isValidChannel','remove','Queues','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','file','filename','getAvatar','root','server/files/images/logos/default_profile.png','existsSync','join','server/files/images/','download','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','concat','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','CmList','List','Tag','color','tag','keys','rawAttributes','filters','model','fields','order','pick','where','merge','options','Queue','getVoiceQueuesRt','intersection','sort','nolimit','ChatGroup','getGroups','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','WhatsappInteraction','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','SIP/%s','user:%s','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','PAUSE','LOGININPAUSE','MemberReport','resolve','updateAttributes','type','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','getTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','Team','flattenDeep','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','isArray','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeAgent','Voice','getLists','values','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','$and','$or','$gte','$lt','$lte','$ne','$eq','$not','$between','$notIn','$like','$contains','$contained','$any','firstName','CmContact','Contact','dialActive','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','ringing','teams','getAgents','flatten','toString','lower','col','asc','desc','substring','uniqBy','orderBy','getRealtimeAgents','offline','pause','voiceStatus','unavailable','slice','charAt','toUpperCase','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','messengerSoundNotification','enabled','moment','util','path','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/realtime/agents','api','../../config/utils','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','socket.io-emitter','redis','./user.socket','defaults','localhost','status','end','json','undefined','limit','count','offset','update','then','agent','emit','userNotification:recalc:','destroy','get','admin','Users','Agents','Telephones','telephone','filter','ignore','map','value','includes','role','find','UserProfileResource','sendStatus','error','stack','name','send','User','fieldName','key','resetPasswordToken','resetPasswordExpires','index','getOptions','includeAll','include','query','userSetting','true','UserSetting','attributes','findAll','rows','openTabs','length','push','chat','sms','dataValues','fax','mail','openchannel','all'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x3f23,0x133));var _0x33f2=function(_0x229362,_0x4c642c){_0x229362=_0x229362-0x0;var _0xf3acfb=_0x3f23[_0x229362];return _0xf3acfb;};'use strict';var moment=require(_0x33f2('0x0'));var util=require(_0x33f2('0x1'));var path=require(_0x33f2('0x2'));var fs=require('fs');var _=require(_0x33f2('0x3'));var squel=require(_0x33f2('0x4'));var Redis=require(_0x33f2('0x5'));var authService=require(_0x33f2('0x6'));var contacts=require('../../components/contacts');var qs=require(_0x33f2('0x7'));var rta=require(_0x33f2('0x8'));var logger=require('../../config/logger')(_0x33f2('0x9'));var utils=require(_0x33f2('0xa'));var config=require(_0x33f2('0xb'));var licenseUtil=require('../../config/license/util');var APIBadRequestError=require(_0x33f2('0xc'))[_0x33f2('0xd')];var APINotFoundError=require(_0x33f2('0xc'))[_0x33f2('0xe')];var APIHandleError=require(_0x33f2('0xc'))['handleError'];var db=require('../../mysqldb')['db'];var socket=require(_0x33f2('0xf'))(new Redis(config[_0x33f2('0x10')]));require(_0x33f2('0x11'))['register'](socket);config[_0x33f2('0x10')]=_[_0x33f2('0x12')](config[_0x33f2('0x10')],{'host':_0x33f2('0x13'),'port':0x18eb});var values;function respondWithStatusCode(_0x21155d,_0x501343){_0x501343=_0x501343||0xcc;return function(_0x4a5186){if(_0x4a5186){return _0x21155d['sendStatus'](_0x501343);}return _0x21155d[_0x33f2('0x14')](_0x501343)[_0x33f2('0x15')]();};}function respondWithResult(_0x23c23c,_0xe524f7){_0xe524f7=_0xe524f7||0xc8;return function(_0x4cf41a){if(_0x4cf41a){return _0x23c23c[_0x33f2('0x14')](_0xe524f7)[_0x33f2('0x16')](_0x4cf41a);}};}function respondWithFilteredResult(_0x236a96,_0x459bad){return function(_0x11aef2){if(_0x11aef2){var _0x46294b=typeof _0x459bad['offset']===_0x33f2('0x17')&&typeof _0x459bad[_0x33f2('0x18')]==='undefined';var _0x282885=_0x11aef2[_0x33f2('0x19')];var _0x1c3146=_0x46294b?0x0:_0x459bad[_0x33f2('0x1a')];var _0x4a3b1a=_0x46294b?_0x11aef2['count']:_0x459bad[_0x33f2('0x1a')]+_0x459bad[_0x33f2('0x18')];var _0x3ed86a;if(_0x4a3b1a>=_0x282885){_0x4a3b1a=_0x282885;_0x3ed86a=0xc8;}else{_0x3ed86a=0xce;}_0x236a96[_0x33f2('0x14')](_0x3ed86a);return _0x236a96['set']('Content-Range',_0x1c3146+'-'+_0x4a3b1a+'/'+_0x282885)[_0x33f2('0x16')](_0x11aef2);}return null;};}function saveUpdates(_0x4cc816){return function(_0x47b421){if(_0x47b421){return _0x47b421[_0x33f2('0x1b')](_0x4cc816)[_0x33f2('0x1c')](function(_0x58e7bc){if(_0x58e7bc['role']===_0x33f2('0x1d')){socket[_0x33f2('0x1e')](_0x33f2('0x1f')+_0x58e7bc['id'],_0x58e7bc);}return _0x58e7bc;});}return null;};}function removeEntity(_0x5cdeab){return function(_0x1d9ae1){if(_0x1d9ae1){return _0x1d9ae1[_0x33f2('0x20')]()[_0x33f2('0x1c')](function(){var _0x4bb8f0=_0x1d9ae1[_0x33f2('0x21')]({'plain':!![]});if(_0x4bb8f0['role']===_0x33f2('0x22'))return;var _0x26bb31=[{'name':_0x33f2('0x23'),'value':'user','ignore':!![]},{'name':_0x33f2('0x24'),'value':_0x33f2('0x1d'),'ignore':![]},{'name':_0x33f2('0x25'),'value':_0x33f2('0x26'),'ignore':![]}];var _0x5db20b=_(_0x26bb31)[_0x33f2('0x27')](_0x33f2('0x28'))[_0x33f2('0x29')](_0x33f2('0x2a'))[_0x33f2('0x2a')]();if(_[_0x33f2('0x2b')](_0x5db20b,_0x4bb8f0[_0x33f2('0x2c')])){return;}var _0x36b346=_[_0x33f2('0x2d')](_0x26bb31,[_0x33f2('0x2a'),_0x4bb8f0[_0x33f2('0x2c')]])['name'];return db[_0x33f2('0x2e')][_0x33f2('0x20')]({'where':{'type':_0x36b346,'resourceId':_0x4bb8f0['id']}})[_0x33f2('0x1c')](function(){return _0x1d9ae1;});})[_0x33f2('0x1c')](function(){_0x5cdeab[_0x33f2('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x63f3a3){return function(_0x34baf4){if(!_0x34baf4){_0x63f3a3[_0x33f2('0x2f')](0x194);}return _0x34baf4;};}function handleError(_0x1e306b,_0x1c9229){_0x1c9229=_0x1c9229||0x1f4;return function(_0x745366){logger[_0x33f2('0x30')](_0x745366[_0x33f2('0x31')]);if(_0x745366[_0x33f2('0x32')]){delete _0x745366[_0x33f2('0x32')];}_0x1e306b[_0x33f2('0x14')](_0x1c9229)[_0x33f2('0x33')](_0x745366);};}function getUserAttributes(){return _(db[_0x33f2('0x34')]['rawAttributes'])[_0x33f2('0x29')](function(_0x49260b){return{'name':_0x49260b[_0x33f2('0x35')],'type':_0x49260b['type'][_0x33f2('0x36')]};})[_0x33f2('0x27')](function(_0x3875a8){return!['password','salt','previousPasswords',_0x33f2('0x37'),_0x33f2('0x38'),'md5secret'][_0x33f2('0x2b')](_0x3875a8['name']);})[_0x33f2('0x2a')]();}exports[_0x33f2('0x39')]=function(_0x44dcee,_0x5ed6ad){var _0x3cdf8d={},_0x210d29={'count':0x0,'rows':[]};var _0x21da17=getUserAttributes();_0x3cdf8d=qs[_0x33f2('0x3a')](_0x21da17,_0x44dcee);var _0x1d2109={'where':_0x3cdf8d['where']};return db['User'][_0x33f2('0x19')](_0x1d2109)[_0x33f2('0x1c')](function(_0x5ecbfa){_0x210d29[_0x33f2('0x19')]=_0x5ecbfa;if(_0x44dcee['query'][_0x33f2('0x3b')]){_0x3cdf8d[_0x33f2('0x3c')]=[{'all':!![]}];}if(_0x44dcee[_0x33f2('0x3d')][_0x33f2('0x3e')]===_0x33f2('0x3f')){_0x3cdf8d[_0x33f2('0x3c')]=[{'model':db[_0x33f2('0x40')],'as':_0x33f2('0x3e')}];}if(!_[_0x33f2('0x2b')](_0x3cdf8d[_0x33f2('0x41')],'id')){_0x3cdf8d[_0x33f2('0x41')]['push']('id');}return db['User'][_0x33f2('0x42')](_0x3cdf8d);})[_0x33f2('0x1c')](function(_0x44b7d4){_0x210d29[_0x33f2('0x43')]=_0x44b7d4;if(_0x44dcee[_0x33f2('0x3d')][_0x33f2('0x44')]===_0x33f2('0x3f')){var _0x5b1188=[];for(var _0x4f918a=0x0;_0x4f918a<_0x210d29[_0x33f2('0x43')][_0x33f2('0x45')];_0x4f918a++){_0x5b1188[_0x33f2('0x46')](get_open_tabs(_0x33f2('0x47'),_0x210d29[_0x33f2('0x43')][_0x4f918a]['dataValues']));_0x5b1188[_0x33f2('0x46')](get_open_tabs(_0x33f2('0x48'),_0x210d29[_0x33f2('0x43')][_0x4f918a][_0x33f2('0x49')]));_0x5b1188[_0x33f2('0x46')](get_open_tabs(_0x33f2('0x4a'),_0x210d29['rows'][_0x4f918a][_0x33f2('0x49')]));_0x5b1188[_0x33f2('0x46')](get_open_tabs(_0x33f2('0x4b'),_0x210d29[_0x33f2('0x43')][_0x4f918a]['dataValues']));_0x5b1188['push'](get_open_tabs(_0x33f2('0x4c'),_0x210d29[_0x33f2('0x43')][_0x4f918a][_0x33f2('0x49')]));_0x5b1188['push'](get_open_tabs('whatsapp',_0x210d29[_0x33f2('0x43')][_0x4f918a][_0x33f2('0x49')]));}return Promise[_0x33f2('0x4d')](_0x5b1188)[_0x33f2('0x1c')](function(){return _0x210d29;});}else{return _0x210d29;}})[_0x33f2('0x1c')](respondWithFilteredResult(_0x5ed6ad,_0x3cdf8d))['catch'](handleError(_0x5ed6ad,null));};exports['show']=function(_0x483ae5,_0x45a81c){var _0x271bb1=getUserAttributes();_0x483ae5[_0x33f2('0x3d')]['id']=_0x483ae5['params']['id'];var _0x494a5d=qs[_0x33f2('0x3a')](_0x271bb1,_0x483ae5);if(_0x483ae5['query'][_0x33f2('0x3b')]){_0x494a5d[_0x33f2('0x3c')]=[{'all':!![]}];}if(_0x483ae5[_0x33f2('0x3d')][_0x33f2('0x3e')]==='true'){_0x494a5d[_0x33f2('0x3c')]=[{'model':db['UserSetting'],'as':_0x33f2('0x3e')}];}_0x494a5d=_['merge']({},_0x494a5d,_0x483ae5['options']);if(!_['includes'](_0x494a5d[_0x33f2('0x41')],'id')){_0x494a5d[_0x33f2('0x41')][_0x33f2('0x46')]('id');}return db[_0x33f2('0x34')][_0x33f2('0x2d')](_0x494a5d)[_0x33f2('0x1c')](handleEntityNotFound(_0x45a81c,null))['then'](function(_0x2dc1b6){var _0x284e03=[];values=_0x2dc1b6;if(_0x483ae5['query'][_0x33f2('0x44')]===_0x33f2('0x3f')){_0x284e03['push'](get_open_tabs(_0x33f2('0x47'),_0x2dc1b6[_0x33f2('0x49')]));_0x284e03[_0x33f2('0x46')](get_open_tabs(_0x33f2('0x48'),_0x2dc1b6[_0x33f2('0x49')]));_0x284e03[_0x33f2('0x46')](get_open_tabs(_0x33f2('0x4c'),_0x2dc1b6[_0x33f2('0x49')]));_0x284e03[_0x33f2('0x46')](get_open_tabs('whatsapp',_0x2dc1b6['dataValues']));_0x284e03['push'](get_open_tabs('fax',_0x2dc1b6[_0x33f2('0x49')]));_0x284e03['push'](get_open_tabs('mail',_0x2dc1b6[_0x33f2('0x49')]));return Promise[_0x33f2('0x4d')](_0x284e03);}else{return values;}})['then'](function(){return values;})['then'](respondWithResult(_0x45a81c,null))[_0x33f2('0x4e')](handleError(_0x45a81c,null));};exports['update']=function(_0x57653e,_0x2e6add){if(_0x57653e['body']['id']){delete _0x57653e[_0x33f2('0x4f')]['id'];}delete _0x57653e[_0x33f2('0x4f')]['role'];return db[_0x33f2('0x34')][_0x33f2('0x2d')]({'where':{'id':_0x57653e[_0x33f2('0x50')]['id']}})[_0x33f2('0x1c')](handleEntityNotFound(_0x2e6add,null))[_0x33f2('0x1c')](saveUpdates(_0x57653e[_0x33f2('0x4f')],null))[_0x33f2('0x1c')](respondWithResult(_0x2e6add,null))[_0x33f2('0x4e')](handleError(_0x2e6add,null));};exports[_0x33f2('0x51')]=function(_0x3a29aa,_0x11ceed){return db[_0x33f2('0x34')][_0x33f2('0x51')]()['then'](respondWithResult(_0x11ceed,null))['catch'](handleError(_0x11ceed,null));};exports['addContacts']=function(_0x2d6cbe,_0xb9b2b1){return db[_0x33f2('0x34')]['find']({'where':{'id':_0x2d6cbe['params']['id']}})['then'](handleEntityNotFound(_0xb9b2b1,null))[_0x33f2('0x1c')](function(_0x311aa5){if(_0x311aa5){return _0x311aa5[_0x33f2('0x52')](_0x2d6cbe[_0x33f2('0x4f')][_0x33f2('0x53')],_[_0x33f2('0x54')](_0x2d6cbe['body'],['ids','id'])||{});}})[_0x33f2('0x1c')](respondWithResult(_0xb9b2b1,null))[_0x33f2('0x4e')](handleError(_0xb9b2b1,null));};function validateUser(_0x1ae22e){return new Promise(function(_0xaa3ee2,_0x447c14){if(_0x1ae22e['internal'])return _0xaa3ee2(_0x1ae22e);return db[_0x33f2('0x55')][_0x33f2('0x56')](0x1)[_0x33f2('0x1c')](function(_0x4982bf){if(_0x4982bf[_0x33f2('0x57')])authService[_0x33f2('0x58')](_0x1ae22e[_0x33f2('0x59')]);db[_0x33f2('0x34')][_0x33f2('0x5a')]('internal')[_0x33f2('0x1c')](function(_0x11d22a){if(_['isNil'](_0x11d22a)){_0x1ae22e[_0x33f2('0x5b')]=_0x4982bf[_0x33f2('0x5c')]||0x1;return;}if(_['isNil'](_0x4982bf['min_internal'])||_0x4982bf[_0x33f2('0x5c')]===_0x11d22a){_0x1ae22e[_0x33f2('0x5b')]=_0x11d22a+0x1;return;}if(_0x4982bf[_0x33f2('0x5c')]>_0x11d22a){_0x1ae22e['internal']=_0x4982bf[_0x33f2('0x5c')];return;}return db[_0x33f2('0x5d')][_0x33f2('0x3d')]('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['sequelize'][_0x33f2('0x5e')][_0x33f2('0x5f')]})[_0x33f2('0x1c')](function(_0x16ba16){if(_0x16ba16&&_0x16ba16[_0x33f2('0x45')]){for(var _0x556eb7=0x0,_0x28a70b=_0x16ba16[_0x33f2('0x45')];_0x556eb7<_0x28a70b&&_['isNil'](_0x1ae22e[_0x33f2('0x5b')]);_0x556eb7++){if(_0x4982bf[_0x33f2('0x5c')]<=_0x16ba16[_0x556eb7]['from']){_0x1ae22e['internal']=_0x16ba16[_0x556eb7][_0x33f2('0x60')];}else if(_0x4982bf[_0x33f2('0x5c')]>_0x16ba16[_0x556eb7]['from']&&_0x4982bf[_0x33f2('0x5c')]<=_0x16ba16[_0x556eb7]['to']){_0x1ae22e[_0x33f2('0x5b')]=_0x4982bf[_0x33f2('0x5c')];}}}if(_['isNil'](_0x1ae22e[_0x33f2('0x5b')])){_0x1ae22e[_0x33f2('0x5b')]=_0x11d22a+0x1;}return _0xaa3ee2(_0x1ae22e);});});})[_0x33f2('0x4e')](function(_0x18faca){_0x447c14(_0x18faca);});});}function updateUser(_0x3de64e){return new Promise(function(_0x3ce7c9,_0x216805){try{if(_0x3de64e['voicemail']){_0x3de64e[_0x33f2('0x61')]=_0x3de64e[_0x33f2('0x5b')];_0x3de64e[_0x33f2('0x62')]={'mailbox':_0x3de64e[_0x33f2('0x5b')],'password':_0x3de64e['password'],'fullname':_0x3de64e[_0x33f2('0x63')],'email':_0x3de64e[_0x33f2('0x64')]};}if(_0x3de64e[_0x33f2('0x2c')]==='agent'){if(!_0x3de64e[_0x33f2('0x65')])_0x3de64e['permissions']=[_0x33f2('0x66'),'102',_0x33f2('0x67'),_0x33f2('0x68'),_0x33f2('0x69'),_0x33f2('0x6a'),_0x33f2('0x6b'),_0x33f2('0x6c'),'107',_0x33f2('0x6d'),_0x33f2('0x6e'),'100',_0x33f2('0x6f'),_0x33f2('0x70'),_0x33f2('0x71')];}_0x3ce7c9(_0x3de64e);}catch(_0x138431){_0x216805(_0x138431);}});}exports[_0x33f2('0x72')]=function(_0x1ab69e,_0x4fdd7b){if(_0x1ab69e[_0x33f2('0x73')][_0x33f2('0x2c')]===_0x33f2('0x1d'))throw new Error(_0x33f2('0x74'));if(_0x1ab69e[_0x33f2('0x4f')][_0x33f2('0x2c')]===_0x33f2('0x73')&&_0x1ab69e[_0x33f2('0x73')]['role']!==_0x33f2('0x22')){throw new Error(_0x33f2('0x75'));}if(_0x1ab69e[_0x33f2('0x4f')][_0x33f2('0x2c')]===_0x33f2('0x22')&&_0x1ab69e['user'][_0x33f2('0x2c')]!=='admin'){throw new Error(_0x33f2('0x76'));}return licenseUtil[_0x33f2('0x77')]([_0x1ab69e[_0x33f2('0x4f')]])[_0x33f2('0x1c')](function(){return validateUser(_0x1ab69e['body']);})[_0x33f2('0x1c')](function(_0x50f5d8){return updateUser(_0x50f5d8)['then'](function(_0x250105){if(_0x250105[_0x33f2('0x2c')]==='admin'){_0x250105[_0x33f2('0x78')]=_0x1ab69e['user'][_0x33f2('0x78')];delete _0x250105['userProfileId'];}return _0x250105;});})[_0x33f2('0x1c')](function(_0x31f235){return db[_0x33f2('0x34')][_0x33f2('0x72')](_0x31f235,{'include':[{'model':db[_0x33f2('0x62')],'as':_0x33f2('0x62')}]});})[_0x33f2('0x1c')](function(_0x5415b8){if(_0x1ab69e['body'][_0x33f2('0x2c')]===_0x33f2('0x73'))return _0x5415b8;if(_0x1ab69e['user'][_0x33f2('0x2c')]!==_0x33f2('0x73'))return _0x5415b8;return db[_0x33f2('0x79')][_0x33f2('0x2d')]({'where':{'name':_0x5415b8[_0x33f2('0x2c')]==='agent'?'Agents':_0x33f2('0x25'),'userProfileId':_0x1ab69e[_0x33f2('0x73')][_0x33f2('0x7a')]},'raw':!![]})['then'](function(_0x4da7bf){if(!_0x4da7bf||_0x4da7bf[_0x33f2('0x7b')]!=0x0)return _0x5415b8;return db['UserProfileResource'][_0x33f2('0x72')]({'name':_0x5415b8[_0x33f2('0x32')],'resourceId':_0x5415b8['id'],'type':_0x4da7bf[_0x33f2('0x32')],'sectionId':_0x4da7bf['id']},{})['then'](function(){return _0x5415b8;});})[_0x33f2('0x4e')](function(_0x3eefe5){logger[_0x33f2('0x30')](_0x33f2('0x7c'),_0x3eefe5);throw _0x3eefe5;});})['then'](respondWithResult(_0x4fdd7b,0xc9))[_0x33f2('0x4e')](handleError(_0x4fdd7b,null));};exports[_0x33f2('0x7d')]=function(_0x26b40a,_0x522157){var _0xee589f=_0x26b40a['body'];var _0x2ed4fc=[];if(_0x26b40a[_0x33f2('0x73')]['role']==='agent')throw new Error(_0x33f2('0x74'));if(_[_0x33f2('0x7e')](_0xee589f,[_0x33f2('0x2c'),'user'])&&_0x26b40a['user'][_0x33f2('0x2c')]!=='admin'){throw new Error(_0x33f2('0x75'));}if(_[_0x33f2('0x7e')](_0xee589f,[_0x33f2('0x2c'),_0x33f2('0x22')])&&_0x26b40a[_0x33f2('0x73')][_0x33f2('0x2c')]!=='admin'){throw new Error(_0x33f2('0x7f'));}return licenseUtil[_0x33f2('0x77')](_0xee589f)['then'](function(){return validateUser(_0xee589f[0x0]);})[_0x33f2('0x1c')](function(){for(var _0x12fbd9=0x1;_0x12fbd9<_0xee589f[_0x33f2('0x45')];_0x12fbd9++){var _0x50282a=_0xee589f[_0x12fbd9-0x1][_0x33f2('0x5b')];if(!_0xee589f[_0x12fbd9][_0x33f2('0x5b')])_0xee589f[_0x12fbd9][_0x33f2('0x5b')]=_0x50282a+0x1;_0x2ed4fc[_0x33f2('0x46')](validateUser(_0xee589f[_0x12fbd9]));}return Promise['all'](_0x2ed4fc);})[_0x33f2('0x1c')](function(){_0x2ed4fc=[];for(var _0x352178=0x0;_0x352178<_0xee589f['length'];_0x352178++){_0x2ed4fc[_0x33f2('0x46')](updateUser(_0xee589f[_0x352178]));}return Promise[_0x33f2('0x4d')](_0x2ed4fc);})[_0x33f2('0x1c')](function(){_0x2ed4fc=_0xee589f[_0x33f2('0x29')](function(_0x1cef84){return db[_0x33f2('0x34')][_0x33f2('0x72')](_0x1cef84,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})['then'](function(_0x1b16d7){_0x1cef84['id']=_0x1b16d7['id'];return _0x1cef84;});});return Promise[_0x33f2('0x4d')](_0x2ed4fc);})['then'](function(_0x2ca00f){if(_0x26b40a[_0x33f2('0x4f')][_0x33f2('0x2c')]==='user')return _0x2ca00f;if(_0x26b40a['user'][_0x33f2('0x2c')]!==_0x33f2('0x73'))return _0x2ca00f;var _0x2dffc6=_[_0x33f2('0x7e')](_0x2ca00f,function(_0x5a7ae3){return _0x5a7ae3[_0x33f2('0x2c')]==='agent'||_0x5a7ae3[_0x33f2('0x2c')]===_0x33f2('0x26');});if(!_0x2dffc6)return _0x2ca00f;return db[_0x33f2('0x79')][_0x33f2('0x42')]({'where':{'name':{'$or':[_0x33f2('0x24'),_0x33f2('0x25')]},'userProfileId':_0x26b40a[_0x33f2('0x73')][_0x33f2('0x7a')]},'raw':!![]})['then'](function(_0x356e2e){if(_[_0x33f2('0x80')](_0x356e2e)||!_[_0x33f2('0x7e')](_0x356e2e,['autoAssociation',0x0]))return _0x2ca00f;_0x2ed4fc=[];var _0xb7db3d=_(_0x356e2e)['map'](function(_0x59f015){if(_0x59f015['autoAssociation']===0x1)return;return _0x59f015[_0x33f2('0x32')]===_0x33f2('0x24')?_0x33f2('0x1d'):_0x33f2('0x26');})[_0x33f2('0x81')]()[_0x33f2('0x2a')]();for(var _0x4007cd=0x0;_0x4007cd<_0x2ca00f[_0x33f2('0x45')];_0x4007cd++){if(!_[_0x33f2('0x2b')](_0xb7db3d,_0x2ca00f[_0x4007cd][_0x33f2('0x2c')]))return;var _0x5f1751=_0x2ca00f[_0x4007cd][_0x33f2('0x2c')]==='agent'?'Agents':'Telephones';_0x2ed4fc[_0x33f2('0x46')](db[_0x33f2('0x2e')][_0x33f2('0x72')]({'name':_0x2ca00f[_0x4007cd]['name'],'resourceId':_0x2ca00f[_0x4007cd]['id'],'type':_0x5f1751,'sectionId':_[_0x33f2('0x2d')](_0x356e2e,['name',_0x5f1751])['id']},{}));}return Promise[_0x33f2('0x4d')](_0x2ed4fc);});})[_0x33f2('0x1c')](respondWithResult(_0x522157,0xc9))[_0x33f2('0x4e')](handleError(_0x522157,null));};exports['changePassword']=function(_0x43e9d6,_0x5c3bbe){if(_0x43e9d6['body']['id']){delete _0x43e9d6[_0x33f2('0x4f')]['id'];}return db[_0x33f2('0x34')][_0x33f2('0x2d')]({'where':{'id':_0x43e9d6[_0x33f2('0x50')]['id']}})['then'](function(_0x5bebc8){if(!_0x5bebc8)return null;if(_0x5bebc8['id']===_0x43e9d6[_0x33f2('0x73')]['id']){if(!_0x43e9d6['body']['oldPassword']||!_0x43e9d6['body']['newPassword']){throw new db[(_0x33f2('0x82'))][(_0x33f2('0x83'))](_0x33f2('0x84'));}if(!_0x5bebc8[_0x33f2('0x85')](_0x43e9d6[_0x33f2('0x4f')]['oldPassword'])){throw new db[(_0x33f2('0x82'))]['ValidationError'](_0x33f2('0x86'));}if(_0x43e9d6[_0x33f2('0x4f')][_0x33f2('0x87')]===_0x43e9d6[_0x33f2('0x4f')][_0x33f2('0x88')]){throw new db['Sequelize'][(_0x33f2('0x83'))](_0x33f2('0x89'));}}else if(_0x43e9d6[_0x33f2('0x73')][_0x33f2('0x2c')]==='admin'){if(!_0x43e9d6[_0x33f2('0x4f')][_0x33f2('0x88')]){throw new db[(_0x33f2('0x82'))][(_0x33f2('0x83'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x43e9d6[_0x33f2('0x73')][_0x33f2('0x2c')]===_0x33f2('0x73')){if(!_0x43e9d6[_0x33f2('0x4f')]['newPassword']){throw new db[(_0x33f2('0x82'))]['ValidationError'](_0x33f2('0x8a'));}if(_0x5bebc8[_0x33f2('0x2c')]!=='agent'){throw new db['Sequelize']['ValidationError'](_0x33f2('0x74'));}}else{throw new db['Sequelize'][(_0x33f2('0x83'))](_0x33f2('0x74'));}return _0x5bebc8;})[_0x33f2('0x1c')](handleEntityNotFound(_0x5c3bbe,null))[_0x33f2('0x1c')](function(_0x26da24){return db[_0x33f2('0x55')][_0x33f2('0x8b')]({'attributes':['id','securePassword',_0x33f2('0x8c'),_0x33f2('0x8d')]})['then'](function(_0x187d6a){if(_0x187d6a[_0x33f2('0x57')])authService[_0x33f2('0x58')](_0x43e9d6[_0x33f2('0x4f')][_0x33f2('0x88')]);if(!_0x187d6a['enforcePasswordHistory']||!_0x26da24['previousPasswords'])return _0x26da24;authService['validatePasswordHistory'](_0x43e9d6[_0x33f2('0x4f')][_0x33f2('0x88')],_0x26da24[_0x33f2('0x8e')],_0x187d6a[_0x33f2('0x8d')]);return _0x26da24;})[_0x33f2('0x1c')](saveUpdates({'password':_0x43e9d6['body']['newPassword'],'passwordResetAt':_0x43e9d6['user']['id']==_0x43e9d6['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x43e9d6[_0x33f2('0x4f')][_0x33f2('0x88')],_0x26da24['previousPasswords'])},null));})[_0x33f2('0x1c')](respondWithResult(_0x5c3bbe,null))['catch'](handleError(_0x5c3bbe,null));};exports[_0x33f2('0x8f')]=function(_0x2ba4ba,_0x50d670){var _0x3fbe92=_0x2ba4ba[_0x33f2('0x4f')]['channel'];return db[_0x33f2('0x34')][_0x33f2('0x2d')]({'where':{'id':_0x2ba4ba[_0x33f2('0x50')]['id']},'attributes':['id',_0x33f2('0x32'),_0x33f2('0x2c'),'online',_0x33f2('0x90'),_0x33f2('0x91'),_0x33f2('0x92')]})[_0x33f2('0x1c')](handleEntityNotFound(_0x50d670,null))['then'](function(_0x436d6a){if(_0x436d6a){if(!utils['isValidChannel'](_0x3fbe92)){throw new db['Sequelize'][(_0x33f2('0x83'))](_0x33f2('0x93'));}return _0x436d6a[_0x33f2('0x94')+_[_0x33f2('0x95')](_0x3fbe92[_0x33f2('0x96')]())+'Queues'](_0x2ba4ba['body'][_0x33f2('0x53')],{'penalty':_0x2ba4ba[_0x33f2('0x4f')]['penalty']||0x0})[_0x33f2('0x97')](function(_0x20fb23){for(var _0xfd5bc9=0x0;_0xfd5bc9<_0x2ba4ba['body'][_0x33f2('0x53')][_0x33f2('0x45')];_0xfd5bc9+=0x1){var _0x3ed759={'UserId':Number(_0x2ba4ba[_0x33f2('0x50')]['id'])};_0x3ed759[_[_0x33f2('0x95')](_0x3fbe92[_0x33f2('0x96')]())+_0x33f2('0x98')]=Number(_0x2ba4ba[_0x33f2('0x4f')][_0x33f2('0x53')][_0xfd5bc9]);socket['emit'](_0x33f2('0x73')+_[_0x33f2('0x95')](_0x3fbe92[_0x33f2('0x96')]())+_0x33f2('0x99'),_0x3ed759);}return _0x20fb23;})[_0x33f2('0x1c')](function(){if(_0x3fbe92===_0x33f2('0x9a')){return db[_0x33f2('0x9b')][_0x33f2('0x42')]({'where':{'id':_0x2ba4ba[_0x33f2('0x4f')][_0x33f2('0x53')]||[]},'raw':!![],'attributes':['id',_0x33f2('0x32')]});}})[_0x33f2('0x1c')](function(_0xc23d7d){var _0x504c37=_0x436d6a['get']({'plain':!![]});var _0xf3aa2e=[];if(_0x3fbe92===_0x33f2('0x9a')&&_0x504c37[_0x33f2('0x2c')]===_0x33f2('0x1d')&&_0x504c37[_0x33f2('0x9c')]){for(let _0x1f3dc1=0x0;_0x1f3dc1<_0xc23d7d[_0x33f2('0x45')];_0x1f3dc1+=0x1){_0xf3aa2e[_0x33f2('0x46')]({'membername':_0x504c37[_0x33f2('0x32')],'UserId':_0x504c37['id'],'queue_name':_0xc23d7d[_0x1f3dc1][_0x33f2('0x32')],'VoiceQueueId':_0xc23d7d[_0x1f3dc1]['id'],'interface':_[_0x33f2('0x9d')](_0x504c37['interface'])?util[_0x33f2('0x9e')]('SIP/%s',_0x504c37[_0x33f2('0x32')]):_0x504c37[_0x33f2('0x92')],'paused':_0x504c37[_0x33f2('0x91')]||![],'penalty':_0x2ba4ba[_0x33f2('0x4f')][_0x33f2('0x9f')]||0x0});}return Promise['all'](_0xf3aa2e['map'](function(_0x12b6a4){return db['UserVoiceQueueRt'][_0x33f2('0xa0')](_0x12b6a4);}));}return _0x436d6a;});}})['then'](respondWithStatusCode(_0x50d670,null))['catch'](handleError(_0x50d670,null));};exports[_0x33f2('0xa1')]=function(_0x374148,_0x33de38){var _0x587d4e,_0x75fd28;return db[_0x33f2('0x34')][_0x33f2('0x2d')]({'where':{'id':_0x374148['params']['id']},'attributes':['id',_0x33f2('0x32'),_0x33f2('0x2c')]})[_0x33f2('0x1c')](handleEntityNotFound(_0x33de38,null))[_0x33f2('0x1c')](function(_0x41e3f4){if(_0x41e3f4){_0x587d4e=_0x41e3f4;if(!_0x374148['query'][_0x33f2('0xa2')]||!utils[_0x33f2('0xa3')](_0x374148[_0x33f2('0x3d')][_0x33f2('0xa2')])){throw new db['Sequelize'][(_0x33f2('0x83'))]('Unknown\x20channel');}return _0x41e3f4[_0x33f2('0xa4')+_[_0x33f2('0x95')](_0x374148[_0x33f2('0x3d')][_0x33f2('0xa2')][_0x33f2('0x96')]())+_0x33f2('0xa5')](_0x374148[_0x33f2('0x3d')][_0x33f2('0x53')]);}})[_0x33f2('0x1c')](function(_0x5e3dc6){if(_['isArray'](_0x374148[_0x33f2('0x3d')]['ids'])){for(var _0x3e9cde=0x0;_0x3e9cde<_0x374148[_0x33f2('0x3d')]['ids'][_0x33f2('0x45')];_0x3e9cde+=0x1){_0x75fd28={'UserId':Number(_0x374148['params']['id'])};_0x75fd28[_['capitalize'](_0x374148[_0x33f2('0x3d')][_0x33f2('0xa2')][_0x33f2('0x96')]())+'QueueId']=Number(_0x374148[_0x33f2('0x3d')][_0x33f2('0x53')][_0x3e9cde]);socket['emit'](_0x33f2('0x73')+_[_0x33f2('0x95')](_0x374148['query'][_0x33f2('0xa2')]['toLowerCase']())+'Queue:remove',_0x75fd28);}}else{_0x75fd28={'UserId':Number(_0x374148[_0x33f2('0x50')]['id'])};_0x75fd28[_['capitalize'](_0x374148['query'][_0x33f2('0xa2')][_0x33f2('0x96')]())+_0x33f2('0x98')]=Number(_0x374148['query'][_0x33f2('0x53')]);socket[_0x33f2('0x1e')](_0x33f2('0x73')+_[_0x33f2('0x95')](_0x374148[_0x33f2('0x3d')][_0x33f2('0xa2')][_0x33f2('0x96')]())+_0x33f2('0xa6'),_0x75fd28);}return _0x5e3dc6;})['then'](function(){if(_0x374148[_0x33f2('0x3d')][_0x33f2('0xa2')]==='voice'){return db[_0x33f2('0xa7')]['destroy']({'where':{'UserId':_0x374148[_0x33f2('0x50')]['id'],'VoiceQueueId':_0x374148[_0x33f2('0x3d')][_0x33f2('0x53')]},'individualHooks':!![]})['then'](function(){return _0x587d4e;});}return _0x587d4e;})[_0x33f2('0x1c')](respondWithStatusCode(_0x33de38,null))[_0x33f2('0x4e')](handleError(_0x33de38,null));};exports[_0x33f2('0xa8')]=function(_0x2b2931,_0x676725){_0x2b2931[_0x33f2('0x4f')][_0x33f2('0xa9')]=_0x2b2931[_0x33f2('0xaa')][_0x33f2('0xab')];return db[_0x33f2('0x34')][_0x33f2('0x2d')]({'where':{'id':_0x2b2931[_0x33f2('0x50')]['id']}})['then'](handleEntityNotFound(_0x676725,null))['then'](saveUpdates(_0x2b2931[_0x33f2('0x4f')],null))[_0x33f2('0x1c')](respondWithResult(_0x676725,null))[_0x33f2('0x4e')](handleError(_0x676725,null));};exports[_0x33f2('0xac')]=function(_0x24f299,_0x35c309){var _0x5c6a33=path['join'](config[_0x33f2('0xad')],_0x33f2('0xae'));return db[_0x33f2('0x34')][_0x33f2('0x2d')]({'where':{'id':_0x24f299[_0x33f2('0x50')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x33f2('0x1c')](handleEntityNotFound(_0x35c309,null))[_0x33f2('0x1c')](function(_0x5192ec){if(_0x5192ec){if(_['isNil'](_0x5192ec['userpic'])){return _0x35c309['download'](_0x5c6a33);}else{if(!fs[_0x33f2('0xaf')](path[_0x33f2('0xb0')](config['root'],_0x33f2('0xb1'),_0x5192ec['userpic']))){return _0x35c309[_0x33f2('0xb2')](_0x5c6a33);}return _0x35c309[_0x33f2('0xb2')](path[_0x33f2('0xb0')](config[_0x33f2('0xad')],_0x33f2('0xb1'),_0x5192ec['userpic']));}}})['catch'](handleError(_0x35c309,null));};exports[_0x33f2('0xb3')]=function(_0x2346d3,_0x188ae9){return db[_0x33f2('0x34')][_0x33f2('0x2d')]({'where':{'id':_0x2346d3[_0x33f2('0x50')]['id']},'attributes':['id']})[_0x33f2('0x1c')](handleEntityNotFound(_0x188ae9,null))[_0x33f2('0x1c')](function(_0x171d0a){var _0x3a611b=[];values=_0x171d0a[_0x33f2('0x49')];_0x3a611b[_0x33f2('0x46')](get_open_tabs(_0x33f2('0x47'),_0x171d0a['dataValues']));_0x3a611b[_0x33f2('0x46')](get_open_tabs(_0x33f2('0x48'),_0x171d0a[_0x33f2('0x49')]));_0x3a611b[_0x33f2('0x46')](get_open_tabs('openchannel',_0x171d0a['dataValues']));_0x3a611b['push'](get_open_tabs('whatsapp',_0x171d0a['dataValues']));_0x3a611b['push'](get_open_tabs(_0x33f2('0x4a'),_0x171d0a[_0x33f2('0x49')]));_0x3a611b[_0x33f2('0x46')](get_open_tabs(_0x33f2('0x4b'),_0x171d0a[_0x33f2('0x49')]));return Promise[_0x33f2('0x4d')](_0x3a611b);})[_0x33f2('0x1c')](function(_0x122eee){if(_0x122eee){var _0x15faf9=_[_0x33f2('0x29')](values[_0x33f2('0xb4')],function(_0x5b1da6){return{'channel':_0x33f2('0xb5'),'id':_0x5b1da6['id'],'createdAt':_0x5b1da6[_0x33f2('0xb6')]};});var _0x13b605=_[_0x33f2('0x29')](values[_0x33f2('0xb7')],function(_0x4c8212){return{'channel':_0x33f2('0xb8'),'id':_0x4c8212['id'],'createdAt':_0x4c8212[_0x33f2('0xb6')]};});var _0x44fdbb=_[_0x33f2('0x29')](values[_0x33f2('0xb9')],function(_0x27160f){return{'channel':_0x33f2('0xba'),'id':_0x27160f['id'],'createdAt':_0x27160f[_0x33f2('0xb6')]};});var _0x4ca3f5=_['map'](values[_0x33f2('0xbb')],function(_0x5ae4b9){return{'channel':'MAIL','id':_0x5ae4b9['id'],'createdAt':_0x5ae4b9[_0x33f2('0xb6')]};});var _0x278f1b=_[_0x33f2('0x29')](values['SmsOpenTabs'],function(_0x2569a8){return{'channel':'SMS','id':_0x2569a8['id'],'createdAt':_0x2569a8['createdAt']};});var _0x566f05=_[_0x33f2('0x29')](values['WhatsappOpenTabs'],function(_0x419cbe){return{'channel':'WHATSAPP','id':_0x419cbe['id'],'createdAt':_0x419cbe['createdAt']};});var _0x23786c=_[_0x33f2('0xbc')](_0x15faf9,_0x13b605,_0x44fdbb,_0x4ca3f5,_0x278f1b,_0x566f05);var _0xd0c047={'count':_0x23786c[_0x33f2('0x45')],'rows':_0x23786c};return _0xd0c047;}else return null;})[_0x33f2('0x1c')](respondWithResult(_0x188ae9,null))[_0x33f2('0x4e')](handleError(_0x188ae9,null));};exports['getContacts']=function(_0x4a9673,_0x36c227){var _0x16a1a7={};return db[_0x33f2('0x34')][_0x33f2('0x8b')]({'where':{'id':_0x4a9673[_0x33f2('0x50')]['id']}})[_0x33f2('0x1c')](function(_0x167046){if(!_0x167046){throw new APINotFoundError(util[_0x33f2('0x9e')](_0x33f2('0xbd'),_0x4a9673[_0x33f2('0x50')]['id']));}return contacts[_0x33f2('0x51')]();})[_0x33f2('0x1c')](function(_0x4a7c84){_0x4a9673[_0x33f2('0x3d')]['User']=_0x4a9673[_0x33f2('0x50')]['id'];_0x16a1a7=qs['getOptions'](_0x4a7c84,_0x4a9673);if(_0x4a9673[_0x33f2('0x3d')][_0x33f2('0xbe')](_0x33f2('0x3b'))){_0x16a1a7['include']=[{'model':db[_0x33f2('0xbf')],'as':_0x33f2('0xc0'),'required':![]},{'model':db[_0x33f2('0xc1')],'as':'Tags','attributes':['id',_0x33f2('0x32'),_0x33f2('0xc2')],'where':_0x4a9673[_0x33f2('0x3d')][_0x33f2('0xc3')]?{'id':_0x4a9673['query'][_0x33f2('0xc3')]}:undefined,'required':_0x4a9673['query'][_0x33f2('0xc3')]?!![]:![]}];}return contacts['findAll'](_0x4a9673[_0x33f2('0x3d')],_0x4a9673[_0x33f2('0x73')],_0x16a1a7,_0x4a7c84);})[_0x33f2('0x1c')](respondWithFilteredResult(_0x36c227,_0x16a1a7))['catch'](APIHandleError(_0x36c227));};exports['getQueues']=function(_0x6c81a,_0x12728d){var _0x130874;var _0x539027={};var _0x12327e;return db['User'][_0x33f2('0x8b')]({'where':{'id':_0x6c81a[_0x33f2('0x50')]['id']},'attributes':['id',_0x33f2('0x32'),_0x33f2('0x2c')]})[_0x33f2('0x1c')](handleEntityNotFound(_0x12728d,null))[_0x33f2('0x1c')](function(_0x5da068){if(!utils['isValidChannel'](_0x6c81a[_0x33f2('0x3d')]['channel'])){throw new db[(_0x33f2('0x82'))][(_0x33f2('0x83'))]('Unknown\x20channel');}_0x130874=_0x5da068;var _0x2fddda={};_0x2fddda['model']=_[_0x33f2('0xc4')](db[_[_0x33f2('0x95')](_0x6c81a[_0x33f2('0x3d')][_0x33f2('0xa2')])+'Queue'][_0x33f2('0xc5')]);_0x2fddda[_0x33f2('0x3d')]=_[_0x33f2('0xc4')](_0x6c81a[_0x33f2('0x3d')]);_0x2fddda[_0x33f2('0xc6')]=_['intersection'](_0x2fddda['model'],_0x2fddda[_0x33f2('0x3d')]);_0x539027['attributes']=_['intersection'](_0x2fddda[_0x33f2('0xc7')],qs[_0x33f2('0xc8')](_0x6c81a[_0x33f2('0x3d')][_0x33f2('0xc8')]));_0x539027[_0x33f2('0x41')]=_0x539027[_0x33f2('0x41')]['length']?_0x539027[_0x33f2('0x41')]:_0x2fddda[_0x33f2('0xc7')];_0x539027[_0x33f2('0xc9')]=qs['sort'](_0x6c81a[_0x33f2('0x3d')]['sort']);_0x539027['where']=qs['filters'](_[_0x33f2('0xca')](_0x6c81a[_0x33f2('0x3d')],_0x2fddda[_0x33f2('0xc6')]));if(_0x6c81a[_0x33f2('0x3d')][_0x33f2('0x27')]){_0x539027[_0x33f2('0xcb')]=_[_0x33f2('0xcc')](_0x539027[_0x33f2('0xcb')],{'$or':_[_0x33f2('0x29')](_0x539027[_0x33f2('0x41')],function(_0x3898a3){var _0x4f28f2={};_0x4f28f2[_0x3898a3]={'$like':'%'+_0x6c81a[_0x33f2('0x3d')][_0x33f2('0x27')]+'%'};return _0x4f28f2;})});}_0x539027=_[_0x33f2('0xcc')]({},_0x539027,_0x6c81a[_0x33f2('0xcd')]);switch(_0x130874[_0x33f2('0x2c')]){case _0x33f2('0x22'):return db[_[_0x33f2('0x95')](_0x6c81a[_0x33f2('0x3d')][_0x33f2('0xa2')])+_0x33f2('0xce')][_0x33f2('0x42')](_0x539027);case _0x33f2('0x73'):case _0x33f2('0x1d'):return _0x130874[_0x33f2('0x21')+_['capitalize'](_0x6c81a[_0x33f2('0x3d')][_0x33f2('0xa2')])+_0x33f2('0xa5')](_0x539027);default:throw new db[(_0x33f2('0x82'))]['ValidationError']('Unknown\x20role');}})[_0x33f2('0x1c')](function(_0x46355c){_0x12327e=_0x46355c[_0x33f2('0x45')];if(!_0x6c81a[_0x33f2('0x3d')][_0x33f2('0xbe')]('nolimit')){_0x539027[_0x33f2('0x18')]=qs['limit'](_0x6c81a['query']['limit']);_0x539027[_0x33f2('0x1a')]=qs['offset'](_0x6c81a[_0x33f2('0x3d')][_0x33f2('0x1a')]);}switch(_0x130874[_0x33f2('0x2c')]){case _0x33f2('0x22'):return db[_[_0x33f2('0x95')](_0x6c81a[_0x33f2('0x3d')][_0x33f2('0xa2')])+'Queue'][_0x33f2('0x42')](_0x539027);case _0x33f2('0x73'):case _0x33f2('0x1d'):return _0x130874['get'+_[_0x33f2('0x95')](_0x6c81a['query']['channel'])+_0x33f2('0xa5')](_0x539027);}})[_0x33f2('0x1c')](function(_0x1dec56){return{'count':_0x12327e,'rows':_0x1dec56};})[_0x33f2('0x1c')](respondWithResult(_0x12728d,null))[_0x33f2('0x4e')](handleError(_0x12728d,null));};exports[_0x33f2('0xcf')]=function(_0x355107,_0x27e48a){var _0x1330d6={};var _0x10063d={};var _0x3f137d;var _0x34afbc;return db['User'][_0x33f2('0x8b')]({'where':{'id':_0x355107[_0x33f2('0x50')]['id']}})[_0x33f2('0x1c')](handleEntityNotFound(_0x27e48a,null))[_0x33f2('0x1c')](function(_0x2d2d75){if(_0x2d2d75){_0x3f137d=_0x2d2d75;_0x10063d[_0x33f2('0xc7')]=_[_0x33f2('0xc4')](db[_0x33f2('0xa7')]['rawAttributes']);_0x10063d[_0x33f2('0x3d')]=_['keys'](_0x355107[_0x33f2('0x3d')]);_0x10063d[_0x33f2('0xc6')]=_[_0x33f2('0xd0')](_0x10063d[_0x33f2('0xc7')],_0x10063d[_0x33f2('0x3d')]);_0x1330d6[_0x33f2('0x41')]=_[_0x33f2('0xd0')](_0x10063d['model'],qs['fields'](_0x355107[_0x33f2('0x3d')][_0x33f2('0xc8')]));_0x1330d6[_0x33f2('0x41')]=_0x1330d6[_0x33f2('0x41')][_0x33f2('0x45')]?_0x1330d6['attributes']:_0x10063d['model'];_0x1330d6['order']=qs['sort'](_0x355107[_0x33f2('0x3d')][_0x33f2('0xd1')]);_0x1330d6[_0x33f2('0xcb')]=qs[_0x33f2('0xc6')](_[_0x33f2('0xca')](_0x355107[_0x33f2('0x3d')],_0x10063d[_0x33f2('0xc6')]));if(_0x355107[_0x33f2('0x3d')][_0x33f2('0x27')]){_0x1330d6[_0x33f2('0xcb')]=_[_0x33f2('0xcc')](_0x1330d6[_0x33f2('0xcb')],{'$or':_['map'](_0x1330d6[_0x33f2('0x41')],function(_0xb6a9b){var _0x3311a6={};_0x3311a6[_0xb6a9b]={'$like':'%'+_0x355107[_0x33f2('0x3d')][_0x33f2('0x27')]+'%'};return _0x3311a6;})});}_0x1330d6=_[_0x33f2('0xcc')]({},_0x1330d6,_0x355107['options']);return _0x3f137d[_0x33f2('0xcf')](_0x1330d6);}})[_0x33f2('0x1c')](function(_0x21b82e){if(_0x21b82e){_0x34afbc=_0x21b82e['length'];if(!_0x355107[_0x33f2('0x3d')][_0x33f2('0xbe')](_0x33f2('0xd2'))){_0x1330d6['limit']=qs['limit'](_0x355107['query'][_0x33f2('0x18')]);_0x1330d6[_0x33f2('0x1a')]=qs[_0x33f2('0x1a')](_0x355107[_0x33f2('0x3d')]['offset']);}return _0x3f137d[_0x33f2('0xcf')](_0x1330d6);}})[_0x33f2('0x1c')](function(_0x3359f1){if(_0x3359f1){return _0x3359f1?{'count':_0x34afbc,'rows':_0x3359f1}:null;}})[_0x33f2('0x1c')](respondWithResult(_0x27e48a,null))[_0x33f2('0x4e')](handleError(_0x27e48a,null));};exports['getGroups']=function(_0x586768,_0x2ce0eb){var _0x183fdf={};var _0xd0dd49={};var _0x3fcb85;var _0x32aa33;return db['User'][_0x33f2('0x8b')]({'where':{'id':_0x586768[_0x33f2('0x50')]['id']}})['then'](handleEntityNotFound(_0x2ce0eb,null))['then'](function(_0x174994){if(_0x174994){_0x3fcb85=_0x174994;_0xd0dd49[_0x33f2('0xc7')]=_['keys'](db[_0x33f2('0xd3')][_0x33f2('0xc5')]);_0xd0dd49[_0x33f2('0x3d')]=_[_0x33f2('0xc4')](_0x586768['query']);_0xd0dd49[_0x33f2('0xc6')]=_[_0x33f2('0xd0')](_0xd0dd49[_0x33f2('0xc7')],_0xd0dd49[_0x33f2('0x3d')]);_0x183fdf[_0x33f2('0x41')]=_[_0x33f2('0xd0')](_0xd0dd49[_0x33f2('0xc7')],qs[_0x33f2('0xc8')](_0x586768[_0x33f2('0x3d')][_0x33f2('0xc8')]));_0x183fdf[_0x33f2('0x41')]=_0x183fdf[_0x33f2('0x41')][_0x33f2('0x45')]?_0x183fdf[_0x33f2('0x41')]:_0xd0dd49[_0x33f2('0xc7')];_0x183fdf[_0x33f2('0xc9')]=qs[_0x33f2('0xd1')](_0x586768['query'][_0x33f2('0xd1')]);_0x183fdf['where']=qs[_0x33f2('0xc6')](_['pick'](_0x586768['query'],_0xd0dd49[_0x33f2('0xc6')]));if(_0x586768[_0x33f2('0x3d')][_0x33f2('0x27')]){_0x183fdf[_0x33f2('0xcb')]=_[_0x33f2('0xcc')](_0x183fdf[_0x33f2('0xcb')],{'$or':_[_0x33f2('0x29')](_0x183fdf[_0x33f2('0x41')],function(_0x2ef508){var _0x4cd559={};_0x4cd559[_0x2ef508]={'$like':'%'+_0x586768[_0x33f2('0x3d')]['filter']+'%'};return _0x4cd559;})});}_0x183fdf=_['merge']({},_0x183fdf,_0x586768[_0x33f2('0xcd')]);return _0x3fcb85['getGroups'](_0x183fdf);}})[_0x33f2('0x1c')](function(_0xef04e8){if(_0xef04e8){_0x32aa33=_0xef04e8[_0x33f2('0x45')];if(!_0x586768[_0x33f2('0x3d')][_0x33f2('0xbe')](_0x33f2('0xd2'))){_0x183fdf['limit']=qs['limit'](_0x586768[_0x33f2('0x3d')][_0x33f2('0x18')]);_0x183fdf[_0x33f2('0x1a')]=qs[_0x33f2('0x1a')](_0x586768[_0x33f2('0x3d')]['offset']);}return _0x3fcb85[_0x33f2('0xd4')](_0x183fdf);}})[_0x33f2('0x1c')](function(_0x4abed0){if(_0x4abed0){return _0x4abed0?{'count':_0x32aa33,'rows':_0x4abed0}:null;}})[_0x33f2('0x1c')](respondWithResult(_0x2ce0eb,null))[_0x33f2('0x4e')](handleError(_0x2ce0eb,null));};exports[_0x33f2('0xd5')]=function(_0x574bf7,_0x552867){var _0x4a6863={'raw':!![],'where':{}};var _0x50295a={};var _0x265b6d={'count':0x0,'rows':[]};return db[_0x33f2('0x34')][_0x33f2('0x8b')]({'where':{'id':_0x574bf7[_0x33f2('0x50')]['id']}})[_0x33f2('0x1c')](handleEntityNotFound(_0x552867,null))[_0x33f2('0x1c')](function(_0x3e9773){if(_0x3e9773){_0x50295a['model']=_[_0x33f2('0xc4')](db[_0x33f2('0xd6')]['rawAttributes']);_0x50295a[_0x33f2('0x3d')]=_[_0x33f2('0xc4')](_0x574bf7[_0x33f2('0x3d')]);_0x50295a[_0x33f2('0xc6')]=_[_0x33f2('0xd0')](_0x50295a['model'],_0x50295a[_0x33f2('0x3d')]);_0x4a6863[_0x33f2('0x41')]=_[_0x33f2('0xd0')](_0x50295a[_0x33f2('0xc7')],qs[_0x33f2('0xc8')](_0x574bf7[_0x33f2('0x3d')][_0x33f2('0xc8')]));_0x4a6863['attributes']=_0x4a6863[_0x33f2('0x41')][_0x33f2('0x45')]?_0x4a6863[_0x33f2('0x41')]:_0x50295a[_0x33f2('0xc7')];if(!_0x574bf7[_0x33f2('0x3d')][_0x33f2('0xbe')]('nolimit')){_0x4a6863[_0x33f2('0x18')]=qs[_0x33f2('0x18')](_0x574bf7[_0x33f2('0x3d')][_0x33f2('0x18')]);_0x4a6863[_0x33f2('0x1a')]=qs[_0x33f2('0x1a')](_0x574bf7[_0x33f2('0x3d')]['offset']);}_0x4a6863[_0x33f2('0xc9')]=qs[_0x33f2('0xd1')](_0x574bf7[_0x33f2('0x3d')][_0x33f2('0xd1')]);_0x4a6863[_0x33f2('0xcb')]=qs[_0x33f2('0xc6')](_['pick'](_0x574bf7['query'],_0x50295a[_0x33f2('0xc6')]));_0x4a6863[_0x33f2('0xcb')]['UserId']=_0x3e9773['id'];if(_0x574bf7['query'][_0x33f2('0x27')]){_0x4a6863[_0x33f2('0xcb')]=_[_0x33f2('0xcc')](_0x4a6863[_0x33f2('0xcb')],{'$or':_['map'](_0x4a6863[_0x33f2('0x41')],function(_0x53c907){var _0x40dcfd={};_0x40dcfd[_0x53c907]={'$like':'%'+_0x574bf7[_0x33f2('0x3d')]['filter']+'%'};return _0x40dcfd;})});}_0x4a6863=_[_0x33f2('0xcc')]({},_0x4a6863,_0x574bf7[_0x33f2('0xcd')]);return db[_0x33f2('0xd6')][_0x33f2('0x19')]({'where':_0x4a6863[_0x33f2('0xcb')]})['then'](function(_0x4fe6e8){_0x265b6d[_0x33f2('0x19')]=_0x4fe6e8;if(_0x574bf7[_0x33f2('0x3d')]['includeAll']){_0x4a6863[_0x33f2('0x3c')]=[{'all':!![]}];}return db['VoiceRecording'][_0x33f2('0x42')](_0x4a6863);})['then'](function(_0x43af95){_0x265b6d['rows']=_0x43af95;return _0x265b6d;});}})[_0x33f2('0x1c')](respondWithFilteredResult(_0x552867,_0x4a6863))[_0x33f2('0x4e')](handleError(_0x552867,null));};exports[_0x33f2('0xd7')]=function(_0x4213d7,_0x327842){var _0x149779={'raw':!![],'where':{}};var _0x585603={};var _0x1f95d9={'count':0x0,'rows':[]};return db[_0x33f2('0x34')]['findOne']({'where':{'id':_0x4213d7[_0x33f2('0x50')]['id']}})[_0x33f2('0x1c')](handleEntityNotFound(_0x327842,null))['then'](function(_0x44dde6){if(_0x44dde6){_0x585603[_0x33f2('0xc7')]=_['keys'](db[_0x33f2('0xd8')][_0x33f2('0xc5')]);_0x585603[_0x33f2('0x3d')]=_[_0x33f2('0xc4')](_0x4213d7[_0x33f2('0x3d')]);_0x585603[_0x33f2('0xc6')]=_[_0x33f2('0xd0')](_0x585603[_0x33f2('0xc7')],_0x585603[_0x33f2('0x3d')]);_0x149779[_0x33f2('0x41')]=_['intersection'](_0x585603[_0x33f2('0xc7')],qs[_0x33f2('0xc8')](_0x4213d7[_0x33f2('0x3d')][_0x33f2('0xc8')]));_0x149779[_0x33f2('0x41')]=_0x149779[_0x33f2('0x41')]['length']?_0x149779['attributes']:_0x585603[_0x33f2('0xc7')];if(!_0x4213d7[_0x33f2('0x3d')][_0x33f2('0xbe')]('nolimit')){_0x149779[_0x33f2('0x18')]=qs[_0x33f2('0x18')](_0x4213d7[_0x33f2('0x3d')][_0x33f2('0x18')]);_0x149779['offset']=qs[_0x33f2('0x1a')](_0x4213d7[_0x33f2('0x3d')]['offset']);}_0x149779[_0x33f2('0xc9')]=qs[_0x33f2('0xd1')](_0x4213d7[_0x33f2('0x3d')]['sort']);_0x149779[_0x33f2('0xcb')]=qs[_0x33f2('0xc6')](_[_0x33f2('0xca')](_0x4213d7[_0x33f2('0x3d')],_0x585603['filters']));_0x149779['where'][_0x33f2('0xd9')]=_0x44dde6['id'];if(_0x4213d7['query']['filter']){_0x149779['where']=_[_0x33f2('0xcc')](_0x149779[_0x33f2('0xcb')],{'$or':_[_0x33f2('0x29')](_0x149779[_0x33f2('0x41')],function(_0x1c4488){var _0x19d8ec={};_0x19d8ec[_0x1c4488]={'$like':'%'+_0x4213d7[_0x33f2('0x3d')][_0x33f2('0x27')]+'%'};return _0x19d8ec;})});}_0x149779=_[_0x33f2('0xcc')]({},_0x149779,_0x4213d7[_0x33f2('0xcd')]);return db['ScreenRecording'][_0x33f2('0x19')]({'where':_0x149779[_0x33f2('0xcb')]})[_0x33f2('0x1c')](function(_0x4c4e35){_0x1f95d9[_0x33f2('0x19')]=_0x4c4e35;if(_0x4213d7[_0x33f2('0x3d')]['includeAll']){_0x149779['include']=[{'all':!![]}];}return db[_0x33f2('0xd8')][_0x33f2('0x42')](_0x149779);})['then'](function(_0x5275e1){_0x1f95d9[_0x33f2('0x43')]=_0x5275e1;return _0x1f95d9;});}})[_0x33f2('0x1c')](respondWithFilteredResult(_0x327842,_0x149779))[_0x33f2('0x4e')](handleError(_0x327842,null));};exports[_0x33f2('0xda')]=function(_0x59f403,_0x185841){var _0x5a90bb={};var _0x34ec0a={};var _0x15e628;var _0x49996a;return db[_0x33f2('0x34')]['findOne']({'where':{'id':_0x59f403[_0x33f2('0x50')]['id']}})[_0x33f2('0x1c')](handleEntityNotFound(_0x185841,null))[_0x33f2('0x1c')](function(_0x48e378){if(_0x48e378){_0x15e628=_0x48e378;_0x34ec0a[_0x33f2('0xc7')]=_[_0x33f2('0xc4')](db[_0x33f2('0xdb')][_0x33f2('0xc5')]);_0x34ec0a[_0x33f2('0x3d')]=_[_0x33f2('0xc4')](_0x59f403['query']);_0x34ec0a[_0x33f2('0xc6')]=_[_0x33f2('0xd0')](_0x34ec0a[_0x33f2('0xc7')],_0x34ec0a[_0x33f2('0x3d')]);_0x5a90bb[_0x33f2('0x41')]=_['intersection'](_0x34ec0a[_0x33f2('0xc7')],qs[_0x33f2('0xc8')](_0x59f403[_0x33f2('0x3d')][_0x33f2('0xc8')]));_0x5a90bb['attributes']=_0x5a90bb[_0x33f2('0x41')][_0x33f2('0x45')]?_0x5a90bb[_0x33f2('0x41')]:_0x34ec0a[_0x33f2('0xc7')];_0x5a90bb['order']=qs[_0x33f2('0xd1')](_0x59f403[_0x33f2('0x3d')]['sort']);_0x5a90bb[_0x33f2('0xcb')]=qs[_0x33f2('0xc6')](_[_0x33f2('0xca')](_0x59f403[_0x33f2('0x3d')],_0x34ec0a[_0x33f2('0xc6')]));if(_0x59f403['query']['filter']){_0x5a90bb[_0x33f2('0xcb')]=_['merge'](_0x5a90bb[_0x33f2('0xcb')],{'$or':_['map'](_0x5a90bb['attributes'],function(_0x4cd046){var _0x379d39={};_0x379d39[_0x4cd046]={'$like':'%'+_0x59f403['query'][_0x33f2('0x27')]+'%'};return _0x379d39;})});}_0x5a90bb=_[_0x33f2('0xcc')]({},_0x5a90bb,_0x59f403['options']);return _0x15e628[_0x33f2('0xda')](_0x5a90bb);}})[_0x33f2('0x1c')](function(_0x3050b1){if(_0x3050b1){_0x49996a=_0x3050b1['length'];if(!_0x59f403[_0x33f2('0x3d')][_0x33f2('0xbe')](_0x33f2('0xd2'))){_0x5a90bb['limit']=qs[_0x33f2('0x18')](_0x59f403[_0x33f2('0x3d')]['limit']);_0x5a90bb[_0x33f2('0x1a')]=qs[_0x33f2('0x1a')](_0x59f403[_0x33f2('0x3d')][_0x33f2('0x1a')]);}return _0x15e628[_0x33f2('0xda')](_0x5a90bb);}})[_0x33f2('0x1c')](function(_0x57f5e8){if(_0x57f5e8){return _0x57f5e8?{'count':_0x49996a,'rows':_0x57f5e8}:null;}})[_0x33f2('0x1c')](respondWithResult(_0x185841,null))['catch'](handleError(_0x185841,null));};exports[_0x33f2('0xdc')]=function(_0x2c8c10,_0x578c0a){var _0x4f9ebf={};var _0x2ee702={};var _0x441f28;var _0x5d8eb9;return db['User'][_0x33f2('0x8b')]({'where':{'id':_0x2c8c10[_0x33f2('0x50')]['id']}})['then'](handleEntityNotFound(_0x578c0a,null))[_0x33f2('0x1c')](function(_0x24c373){if(_0x24c373){_0x441f28=_0x24c373;_0x2ee702[_0x33f2('0xc7')]=_[_0x33f2('0xc4')](db[_0x33f2('0xdd')][_0x33f2('0xc5')]);_0x2ee702[_0x33f2('0x3d')]=_[_0x33f2('0xc4')](_0x2c8c10[_0x33f2('0x3d')]);_0x2ee702[_0x33f2('0xc6')]=_['intersection'](_0x2ee702['model'],_0x2ee702['query']);_0x4f9ebf[_0x33f2('0x41')]=_[_0x33f2('0xd0')](_0x2ee702[_0x33f2('0xc7')],qs[_0x33f2('0xc8')](_0x2c8c10['query'][_0x33f2('0xc8')]));_0x4f9ebf[_0x33f2('0x41')]=_0x4f9ebf[_0x33f2('0x41')][_0x33f2('0x45')]?_0x4f9ebf[_0x33f2('0x41')]:_0x2ee702['model'];_0x4f9ebf[_0x33f2('0xc9')]=qs[_0x33f2('0xd1')](_0x2c8c10[_0x33f2('0x3d')][_0x33f2('0xd1')]);_0x4f9ebf[_0x33f2('0xcb')]=qs[_0x33f2('0xc6')](_[_0x33f2('0xca')](_0x2c8c10[_0x33f2('0x3d')],_0x2ee702[_0x33f2('0xc6')]));if(_0x2c8c10[_0x33f2('0x3d')][_0x33f2('0x27')]){_0x4f9ebf[_0x33f2('0xcb')]=_[_0x33f2('0xcc')](_0x4f9ebf[_0x33f2('0xcb')],{'$or':_[_0x33f2('0x29')](_0x4f9ebf[_0x33f2('0x41')],function(_0x20ebd4){var _0x32ddb3={};_0x32ddb3[_0x20ebd4]={'$like':'%'+_0x2c8c10[_0x33f2('0x3d')]['filter']+'%'};return _0x32ddb3;})});}_0x4f9ebf=_[_0x33f2('0xcc')]({},_0x4f9ebf,_0x2c8c10['options']);return _0x441f28[_0x33f2('0xdc')](_0x4f9ebf);}})[_0x33f2('0x1c')](function(_0x75894a){if(_0x75894a){_0x5d8eb9=_0x75894a['length'];if(!_0x2c8c10['query']['hasOwnProperty'](_0x33f2('0xd2'))){_0x4f9ebf[_0x33f2('0x18')]=qs[_0x33f2('0x18')](_0x2c8c10[_0x33f2('0x3d')][_0x33f2('0x18')]);_0x4f9ebf[_0x33f2('0x1a')]=qs[_0x33f2('0x1a')](_0x2c8c10[_0x33f2('0x3d')][_0x33f2('0x1a')]);}return _0x441f28[_0x33f2('0xdc')](_0x4f9ebf);}})['then'](function(_0x5bd6b3){if(_0x5bd6b3){return _0x5bd6b3?{'count':_0x5d8eb9,'rows':_0x5bd6b3}:null;}})[_0x33f2('0x1c')](respondWithResult(_0x578c0a,null))[_0x33f2('0x4e')](handleError(_0x578c0a,null));};exports[_0x33f2('0xde')]=function(_0xc022cc,_0x54ebe7){var _0x395bfe={'raw':!![],'where':{}};var _0x479159={};var _0x4da30e={'count':0x0,'rows':[]};return db[_0x33f2('0x34')][_0x33f2('0x8b')]({'where':{'id':_0xc022cc['params']['id']}})[_0x33f2('0x1c')](handleEntityNotFound(_0x54ebe7,null))[_0x33f2('0x1c')](function(_0x50db16){if(_0x50db16){_0x479159[_0x33f2('0xc7')]=_['keys'](db[_0x33f2('0xdf')][_0x33f2('0xc5')]);_0x479159['query']=_[_0x33f2('0xc4')](_0xc022cc[_0x33f2('0x3d')]);_0x479159['filters']=_[_0x33f2('0xd0')](_0x479159[_0x33f2('0xc7')],_0x479159[_0x33f2('0x3d')]);_0x395bfe[_0x33f2('0x41')]=_[_0x33f2('0xd0')](_0x479159[_0x33f2('0xc7')],qs[_0x33f2('0xc8')](_0xc022cc['query'][_0x33f2('0xc8')]));_0x395bfe['attributes']=_0x395bfe[_0x33f2('0x41')]['length']?_0x395bfe[_0x33f2('0x41')]:_0x479159['model'];if(!_0xc022cc[_0x33f2('0x3d')][_0x33f2('0xbe')](_0x33f2('0xd2'))){_0x395bfe[_0x33f2('0x18')]=qs['limit'](_0xc022cc[_0x33f2('0x3d')]['limit']);_0x395bfe[_0x33f2('0x1a')]=qs['offset'](_0xc022cc[_0x33f2('0x3d')][_0x33f2('0x1a')]);}_0x395bfe[_0x33f2('0xc9')]=qs['sort'](_0xc022cc[_0x33f2('0x3d')]['sort']);_0x395bfe[_0x33f2('0xcb')]=qs[_0x33f2('0xc6')](_['pick'](_0xc022cc[_0x33f2('0x3d')],_0x479159[_0x33f2('0xc6')]));_0x395bfe[_0x33f2('0xcb')][_0x33f2('0xd9')]=_0x50db16['id'];if(_0xc022cc[_0x33f2('0x3d')]['filter']){_0x395bfe['where']=_[_0x33f2('0xcc')](_0x395bfe[_0x33f2('0xcb')],{'$or':_[_0x33f2('0x29')](_0x395bfe['attributes'],function(_0x13992d){var _0x667e59={};_0x667e59[_0x13992d]={'$like':'%'+_0xc022cc['query']['filter']+'%'};return _0x667e59;})});}_0x395bfe=_[_0x33f2('0xcc')]({},_0x395bfe,_0xc022cc[_0x33f2('0xcd')]);return db[_0x33f2('0xdf')][_0x33f2('0x19')]({'where':_0x395bfe[_0x33f2('0xcb')]})[_0x33f2('0x1c')](function(_0x6d89ec){_0x4da30e['count']=_0x6d89ec;if(_0xc022cc[_0x33f2('0x3d')][_0x33f2('0x3b')]){_0x395bfe[_0x33f2('0x3c')]=[{'all':!![]}];}return db[_0x33f2('0xdf')][_0x33f2('0x42')](_0x395bfe);})[_0x33f2('0x1c')](function(_0x60d72c){_0x4da30e[_0x33f2('0x43')]=_0x60d72c;return _0x4da30e;});}})[_0x33f2('0x1c')](respondWithFilteredResult(_0x54ebe7,_0x395bfe))[_0x33f2('0x4e')](handleError(_0x54ebe7,null));};exports['getSmsInteractions']=function(_0x137e83,_0x3afa2c){var _0x3e35eb={};var _0x1ea261={};var _0x1c8988;var _0x216548;return db[_0x33f2('0x34')][_0x33f2('0x8b')]({'where':{'id':_0x137e83[_0x33f2('0x50')]['id']}})[_0x33f2('0x1c')](handleEntityNotFound(_0x3afa2c,null))[_0x33f2('0x1c')](function(_0xf744e){if(_0xf744e){_0x1c8988=_0xf744e;_0x1ea261['model']=_['keys'](db[_0x33f2('0xe0')][_0x33f2('0xc5')]);_0x1ea261[_0x33f2('0x3d')]=_[_0x33f2('0xc4')](_0x137e83[_0x33f2('0x3d')]);_0x1ea261[_0x33f2('0xc6')]=_['intersection'](_0x1ea261[_0x33f2('0xc7')],_0x1ea261['query']);_0x3e35eb[_0x33f2('0x41')]=_['intersection'](_0x1ea261[_0x33f2('0xc7')],qs[_0x33f2('0xc8')](_0x137e83[_0x33f2('0x3d')]['fields']));_0x3e35eb['attributes']=_0x3e35eb[_0x33f2('0x41')]['length']?_0x3e35eb[_0x33f2('0x41')]:_0x1ea261[_0x33f2('0xc7')];_0x3e35eb['order']=qs['sort'](_0x137e83[_0x33f2('0x3d')][_0x33f2('0xd1')]);_0x3e35eb[_0x33f2('0xcb')]=qs[_0x33f2('0xc6')](_[_0x33f2('0xca')](_0x137e83[_0x33f2('0x3d')],_0x1ea261[_0x33f2('0xc6')]));if(_0x137e83['query'][_0x33f2('0x27')]){_0x3e35eb[_0x33f2('0xcb')]=_[_0x33f2('0xcc')](_0x3e35eb[_0x33f2('0xcb')],{'$or':_[_0x33f2('0x29')](_0x3e35eb[_0x33f2('0x41')],function(_0x35bebb){var _0x3904c2={};_0x3904c2[_0x35bebb]={'$like':'%'+_0x137e83['query'][_0x33f2('0x27')]+'%'};return _0x3904c2;})});}_0x3e35eb=_[_0x33f2('0xcc')]({},_0x3e35eb,_0x137e83[_0x33f2('0xcd')]);return _0x1c8988['getSmsInteractions'](_0x3e35eb);}})[_0x33f2('0x1c')](function(_0x528397){if(_0x528397){_0x216548=_0x528397[_0x33f2('0x45')];if(!_0x137e83['query'][_0x33f2('0xbe')](_0x33f2('0xd2'))){_0x3e35eb['limit']=qs['limit'](_0x137e83[_0x33f2('0x3d')][_0x33f2('0x18')]);_0x3e35eb['offset']=qs[_0x33f2('0x1a')](_0x137e83['query'][_0x33f2('0x1a')]);}return _0x1c8988[_0x33f2('0xe1')](_0x3e35eb);}})[_0x33f2('0x1c')](function(_0x705386){if(_0x705386){return _0x705386?{'count':_0x216548,'rows':_0x705386}:null;}})['then'](respondWithResult(_0x3afa2c,null))['catch'](handleError(_0x3afa2c,null));};exports[_0x33f2('0xe2')]=function(_0x5308b9,_0x2a6d73){var _0x114017={};var _0x27e59d={};var _0x50e93b;var _0x3ddb4f;return db[_0x33f2('0x34')]['findOne']({'where':{'id':_0x5308b9[_0x33f2('0x50')]['id']}})['then'](handleEntityNotFound(_0x2a6d73,null))[_0x33f2('0x1c')](function(_0x8aefe4){if(_0x8aefe4){_0x50e93b=_0x8aefe4;_0x27e59d[_0x33f2('0xc7')]=_['keys'](db[_0x33f2('0xe3')][_0x33f2('0xc5')]);_0x27e59d['query']=_[_0x33f2('0xc4')](_0x5308b9[_0x33f2('0x3d')]);_0x27e59d['filters']=_[_0x33f2('0xd0')](_0x27e59d[_0x33f2('0xc7')],_0x27e59d[_0x33f2('0x3d')]);_0x114017[_0x33f2('0x41')]=_[_0x33f2('0xd0')](_0x27e59d['model'],qs['fields'](_0x5308b9[_0x33f2('0x3d')]['fields']));_0x114017[_0x33f2('0x41')]=_0x114017[_0x33f2('0x41')][_0x33f2('0x45')]?_0x114017['attributes']:_0x27e59d[_0x33f2('0xc7')];_0x114017['order']=qs[_0x33f2('0xd1')](_0x5308b9[_0x33f2('0x3d')][_0x33f2('0xd1')]);_0x114017[_0x33f2('0xcb')]=qs['filters'](_[_0x33f2('0xca')](_0x5308b9[_0x33f2('0x3d')],_0x27e59d[_0x33f2('0xc6')]));if(_0x5308b9[_0x33f2('0x3d')][_0x33f2('0x27')]){_0x114017['where']=_[_0x33f2('0xcc')](_0x114017[_0x33f2('0xcb')],{'$or':_[_0x33f2('0x29')](_0x114017[_0x33f2('0x41')],function(_0x2caa46){var _0x469515={};_0x469515[_0x2caa46]={'$like':'%'+_0x5308b9[_0x33f2('0x3d')][_0x33f2('0x27')]+'%'};return _0x469515;})});}_0x114017=_['merge']({},_0x114017,_0x5308b9[_0x33f2('0xcd')]);return _0x50e93b[_0x33f2('0xe2')](_0x114017);}})[_0x33f2('0x1c')](function(_0x2baf72){if(_0x2baf72){_0x3ddb4f=_0x2baf72[_0x33f2('0x45')];if(!_0x5308b9[_0x33f2('0x3d')][_0x33f2('0xbe')](_0x33f2('0xd2'))){_0x114017[_0x33f2('0x18')]=qs[_0x33f2('0x18')](_0x5308b9['query'][_0x33f2('0x18')]);_0x114017[_0x33f2('0x1a')]=qs[_0x33f2('0x1a')](_0x5308b9['query'][_0x33f2('0x1a')]);}return _0x50e93b['getFaxInteractions'](_0x114017);}})['then'](function(_0x37852f){if(_0x37852f){return _0x37852f?{'count':_0x3ddb4f,'rows':_0x37852f}:null;}})[_0x33f2('0x1c')](respondWithResult(_0x2a6d73,null))['catch'](handleError(_0x2a6d73,null));};exports['getWhatsappInteractions']=function(_0x1e6696,_0x486f32){var _0x324b3f={};var _0x12cec7={};var _0x494c3f;var _0x27fbc4;return db[_0x33f2('0x34')][_0x33f2('0x8b')]({'where':{'id':_0x1e6696[_0x33f2('0x50')]['id']}})[_0x33f2('0x1c')](handleEntityNotFound(_0x486f32,null))[_0x33f2('0x1c')](function(_0x469235){if(_0x469235){_0x494c3f=_0x469235;_0x12cec7[_0x33f2('0xc7')]=_[_0x33f2('0xc4')](db[_0x33f2('0xe4')][_0x33f2('0xc5')]);_0x12cec7[_0x33f2('0x3d')]=_[_0x33f2('0xc4')](_0x1e6696['query']);_0x12cec7[_0x33f2('0xc6')]=_['intersection'](_0x12cec7[_0x33f2('0xc7')],_0x12cec7[_0x33f2('0x3d')]);_0x324b3f['attributes']=_[_0x33f2('0xd0')](_0x12cec7[_0x33f2('0xc7')],qs['fields'](_0x1e6696[_0x33f2('0x3d')]['fields']));_0x324b3f['attributes']=_0x324b3f[_0x33f2('0x41')][_0x33f2('0x45')]?_0x324b3f[_0x33f2('0x41')]:_0x12cec7[_0x33f2('0xc7')];_0x324b3f[_0x33f2('0xc9')]=qs['sort'](_0x1e6696[_0x33f2('0x3d')]['sort']);_0x324b3f[_0x33f2('0xcb')]=qs['filters'](_['pick'](_0x1e6696[_0x33f2('0x3d')],_0x12cec7['filters']));if(_0x1e6696[_0x33f2('0x3d')][_0x33f2('0x27')]){_0x324b3f[_0x33f2('0xcb')]=_[_0x33f2('0xcc')](_0x324b3f[_0x33f2('0xcb')],{'$or':_['map'](_0x324b3f[_0x33f2('0x41')],function(_0x42bd6b){var _0x2459dc={};_0x2459dc[_0x42bd6b]={'$like':'%'+_0x1e6696[_0x33f2('0x3d')][_0x33f2('0x27')]+'%'};return _0x2459dc;})});}_0x324b3f=_[_0x33f2('0xcc')]({},_0x324b3f,_0x1e6696['options']);return _0x494c3f[_0x33f2('0xe5')](_0x324b3f);}})[_0x33f2('0x1c')](function(_0x2856aa){if(_0x2856aa){_0x27fbc4=_0x2856aa[_0x33f2('0x45')];if(!_0x1e6696[_0x33f2('0x3d')][_0x33f2('0xbe')](_0x33f2('0xd2'))){_0x324b3f[_0x33f2('0x18')]=qs['limit'](_0x1e6696[_0x33f2('0x3d')][_0x33f2('0x18')]);_0x324b3f[_0x33f2('0x1a')]=qs[_0x33f2('0x1a')](_0x1e6696[_0x33f2('0x3d')][_0x33f2('0x1a')]);}return _0x494c3f[_0x33f2('0xe5')](_0x324b3f);}})[_0x33f2('0x1c')](function(_0x2c1963){if(_0x2c1963){return _0x2c1963?{'count':_0x27fbc4,'rows':_0x2c1963}:null;}})[_0x33f2('0x1c')](respondWithResult(_0x486f32,null))[_0x33f2('0x4e')](handleError(_0x486f32,null));};exports[_0x33f2('0xe6')]=function(_0x49ab4d,_0xf900b1,_0x32c181){var _0x4c4f85;var _0x57c9c3;var _0x22f3bc;var _0x42545e=!_['isNil'](_0x49ab4d[_0x33f2('0x50')]['id'])?_0x49ab4d[_0x33f2('0x50')]['id']:!_[_0x33f2('0x9d')](_0x49ab4d['user']['id'])?_0x49ab4d[_0x33f2('0x73')]['id']:null;return db['User'][_0x33f2('0x2d')]({'where':{'id':_0x42545e,'role':{'$or':[_0x33f2('0x22'),_0x33f2('0x73'),_0x33f2('0x1d')]}},'attributes':['id','name',_0x33f2('0xe7'),_0x33f2('0xe8'),'role',_0x33f2('0x5b'),_0x33f2('0x90')]})[_0x33f2('0x1c')](function(_0x486e08){if(_0x486e08){if(_0x486e08[_0x33f2('0x2c')]===_0x33f2('0x1d')){_0x4c4f85=_0x486e08;if(_0x49ab4d[_0x33f2('0x4f')][_0x33f2('0x92')]){_0x22f3bc=util[_0x33f2('0x9e')](_0x33f2('0xe9'),_0x4c4f85[_0x49ab4d['body'][_0x33f2('0x92')]]);}else if(_0x49ab4d[_0x33f2('0x4f')]['intrf']){_0x22f3bc=util[_0x33f2('0x9e')](_0x33f2('0xea'),_0x49ab4d[_0x33f2('0x4f')]['intrf']);}else{_0x22f3bc=util[_0x33f2('0x9e')](_0x33f2('0xea'),_0x4c4f85[_0x33f2('0x32')]);}socket['to'](util['format'](_0x33f2('0xeb'),_0x4c4f85[_0x33f2('0x32')]))[_0x33f2('0x1e')]('user:forcelogout',{'user':{'id':_0x4c4f85['id'],'name':_0x4c4f85[_0x33f2('0x32')]},'ip':_0x49ab4d['headers'][_0x33f2('0xec')]||_0x49ab4d[_0x33f2('0xed')][_0x33f2('0xee')]||_0x49ab4d['socket'][_0x33f2('0xee')]||_0x49ab4d[_0x33f2('0xed')][_0x33f2('0xef')][_0x33f2('0xee')]});return db[_0x33f2('0xa7')][_0x33f2('0x20')]({'where':{'membername':_0x4c4f85[_0x33f2('0x32')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x33f2('0x83'))](_0x33f2('0xf0'));}})[_0x33f2('0x1c')](function(){if(_0x4c4f85){return _0x4c4f85[_0x33f2('0xf1')]({'raw':!![]});}})[_0x33f2('0x1c')](function(_0x188e7b){if(_0x4c4f85){if(_0x188e7b){_0x57c9c3=_0x188e7b;if(_0x57c9c3[_0x33f2('0x45')]){var _0x1e4e38=_0x57c9c3[_0x33f2('0x29')](function(_0x106985){var _0x357dfb={'membername':_0x4c4f85['name'],'UserId':_0x4c4f85['id'],'queue_name':_0x106985[_0x33f2('0x32')],'VoiceQueueId':_0x106985['id'],'interface':_0x22f3bc,'paused':_0x4c4f85[_0x33f2('0x90')]||![],'penalty':_0x106985['UserVoiceQueue.penalty']||0x0};return db[_0x33f2('0xa7')][_0x33f2('0xa0')](_0x357dfb);});return Promise[_0x33f2('0x4d')](_0x1e4e38);}}}})['then'](function(){if(_0x4c4f85){return db['MemberReport']['findAll']({'where':{'membername':_0x4c4f85['name'],'exitAt':null}});}})[_0x33f2('0x1c')](function(_0x3f1af5){if(_0x4c4f85){var _0xa8595a=[];_0x3f1af5['forEach'](function(_0x1c4e53){_0xa8595a['push'](_0x1c4e53['update']({'exitAt':moment()[_0x33f2('0x9e')](_0x33f2('0xf2'))}));});return Promise['all'](_0xa8595a);}})[_0x33f2('0x1c')](function(){if(_0x4c4f85){var _0x6deef1=[];var _0x223be5=[];var _0x526791=utils[_0x33f2('0xf3')]();var _0x5730ee={'membername':_0x4c4f85[_0x33f2('0x32')],'interface':_0x22f3bc,'enterAt':moment()[_0x33f2('0x9e')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x4c4f85[_0x33f2('0x2c')],'internal':_0x4c4f85[_0x33f2('0x5b')]};_0x526791[_0x33f2('0xf4')](function(_0x11d2d1){_0x6deef1['push'](_['merge']({'channel':_0x11d2d1,'type':_0x33f2('0xf5'),'data1':_0x49ab4d[_0x33f2('0x4f')][_0x33f2('0xf6')],'data2':_0x22f3bc},_0x5730ee));if(_0x4c4f85[_0x33f2('0x90')]){_0x223be5[_0x33f2('0x46')](_[_0x33f2('0xcc')]({'channel':_0x11d2d1,'type':_0x33f2('0xf7'),'data1':_0x33f2('0xf8')},_0x5730ee));}});return db[_0x33f2('0xf9')][_0x33f2('0x7d')](_0x6deef1['concat'](_0x223be5),{'individualHooks':!![]});}})['then'](function(){if(_0x4c4f85){return _0x4c4f85[_0x33f2('0x1b')]({'online':!![],'lastLoginAt':moment()[_0x33f2('0x9e')](_0x33f2('0xf2')),'voicePause':_0x4c4f85[_0x33f2('0x90')]||![],'mailPause':_0x4c4f85['loginInPause']||![],'chatPause':_0x4c4f85[_0x33f2('0x90')]||![],'faxPause':_0x4c4f85['loginInPause']||![],'smsPause':_0x4c4f85[_0x33f2('0x90')]||![],'openchannelPause':_0x4c4f85[_0x33f2('0x90')]||![],'whatsappPause':_0x4c4f85[_0x33f2('0x90')]||![],'pauseType':_0x4c4f85[_0x33f2('0x90')]?'LOGININPAUSE':null,'interface':_0x22f3bc,'lastPauseAt':moment()[_0x33f2('0x9e')](_0x33f2('0xf2'))});}})['then'](function(_0x203f9d){if(_0x49ab4d['isMiddleware']){return _0x32c181();}else{return Promise[_0x33f2('0xfa')](_0x203f9d)[_0x33f2('0x1c')](respondWithResult(_0xf900b1,null));}})['catch'](handleError(_0xf900b1,null));};exports['logout']=function(_0x734b0f,_0x5477d8){var _0x261823;return db[_0x33f2('0x34')][_0x33f2('0x2d')]({'where':{'id':_0x734b0f[_0x33f2('0x50')]['id'],'role':'agent'},'attributes':['id',_0x33f2('0x32'),'role']})['then'](handleEntityNotFound(_0x5477d8,null))[_0x33f2('0x1c')](function(_0x3211b8){if(_0x3211b8){_0x261823=_0x3211b8;return db[_0x33f2('0xa7')][_0x33f2('0x20')]({'where':{'membername':_0x261823['name']},'individualHooks':!![]});}})[_0x33f2('0x1c')](function(){return db[_0x33f2('0xf9')][_0x33f2('0x42')]({'where':{'membername':_0x261823['name'],'exitAt':null}});})['then'](function(_0xe0a063){var _0x8906e8=[];_0xe0a063['forEach'](function(_0x184274){_0x8906e8[_0x33f2('0x46')](_0x184274[_0x33f2('0x1b')]({'exitAt':moment()[_0x33f2('0x9e')](_0x33f2('0xf2'))}));});return Promise[_0x33f2('0x4d')](_0x8906e8);})[_0x33f2('0x1c')](function(){return _0x261823[_0x33f2('0x1b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x5477d8,null))[_0x33f2('0x4e')](handleError(_0x5477d8,null));};exports['pause']=function(_0x58a7a4,_0x5ace78){var _0x22732e;return db[_0x33f2('0xa7')]['update']({'paused':0x1},{'where':{'UserId':_0x58a7a4[_0x33f2('0x50')]['id']},'individualHooks':!![]})[_0x33f2('0x1c')](function(){return db['User']['find']({'where':{'id':_0x58a7a4[_0x33f2('0x50')]['id'],'role':_0x33f2('0x1d')},'attributes':['id',_0x33f2('0x32'),_0x33f2('0x2c'),_0x33f2('0x5b'),_0x33f2('0x92'),_0x33f2('0x9c')]});})[_0x33f2('0x1c')](handleEntityNotFound(_0x5ace78,null))[_0x33f2('0x1c')](function(_0x578106){if(_0x578106){_0x22732e=_0x578106;return db[_0x33f2('0xf9')]['findAll']({'where':{'membername':_0x22732e[_0x33f2('0x32')],'type':_0x33f2('0xf7'),'exitAt':null}});}})['then'](function(_0x5d27a3){if(_0x5d27a3[_0x33f2('0x45')]){var _0x306cc7=moment()[_0x33f2('0x9e')](_0x33f2('0xf2'));for(var _0x17e4f9=0x0,_0x28a352=_0x5d27a3[_0x33f2('0x45')];_0x17e4f9<_0x28a352;_0x17e4f9++){_0x5d27a3[_0x17e4f9][_0x33f2('0xfb')]({'exitAt':_0x306cc7});}}})['then'](function(){var _0x4accdb=[];var _0x1f4a0e=utils[_0x33f2('0xf3')]();_0x1f4a0e['forEach'](function(_0x3f6bc7){_0x4accdb[_0x33f2('0x46')]({'channel':_0x3f6bc7,'membername':_0x22732e[_0x33f2('0x32')],'interface':_[_0x33f2('0x9d')](_0x22732e[_0x33f2('0x92')])?util['format']('SIP/%s',_0x22732e[_0x33f2('0x32')]):_0x22732e['interface'],'type':_0x33f2('0xf7'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x58a7a4['body'][_0x33f2('0xfc')]||'DEFAULT\x20PAUSE','role':_0x22732e[_0x33f2('0x2c')],'internal':_0x22732e[_0x33f2('0x5b')]});});return db[_0x33f2('0xf9')]['bulkCreate'](_0x4accdb,{'individualHooks':!![]});})[_0x33f2('0x1c')](function(){return _0x22732e[_0x33f2('0x1b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x58a7a4[_0x33f2('0x4f')][_0x33f2('0xfc')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0x33f2('0xf2'))});})[_0x33f2('0x1c')](respondWithResult(_0x5ace78,null))[_0x33f2('0x4e')](handleError(_0x5ace78,null));};exports[_0x33f2('0xfd')]=function(_0x38787b,_0xcd6402){if(_0x38787b[_0x33f2('0x4f')]['channel']&&!utils[_0x33f2('0xa3')](_0x38787b['body'][_0x33f2('0xa2')])){throw new APIBadRequestError(util[_0x33f2('0x9e')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x38787b[_0x33f2('0x4f')]['channel']));}return db[_0x33f2('0x34')][_0x33f2('0x2d')]({'where':{'id':_0x38787b[_0x33f2('0x50')]['id']},'attributes':['id',_0x33f2('0x32'),_0x33f2('0x2c'),'internal',_0x33f2('0x92'),_0x33f2('0x9c'),'voicePause',_0x33f2('0xfe'),_0x33f2('0xff'),_0x33f2('0x100'),_0x33f2('0x101'),_0x33f2('0x102'),_0x33f2('0x103'),_0x33f2('0x104'),'lastPauseAt']})[_0x33f2('0x1c')](function(_0x15b146){if(!_0x15b146){throw new APINotFoundError(util[_0x33f2('0x9e')](_0x33f2('0xbd'),_0x38787b['params']['id']));}return _0x15b146[_0x33f2('0xfd')](_0x38787b[_0x33f2('0x4f')][_0x33f2('0xa2')]);})['then'](respondWithResult(_0xcd6402,null))['catch'](APIHandleError(_0xcd6402));};exports[_0x33f2('0x105')]=function(_0x528fcb,_0x2ccdb1){var _0x21d639={};var _0x3df157={};var _0x519008;var _0x477b5b;return db[_0x33f2('0x34')][_0x33f2('0x8b')]({'where':{'id':_0x528fcb['params']['id']}})['then'](handleEntityNotFound(_0x2ccdb1,null))[_0x33f2('0x1c')](function(_0x1ea388){if(_0x1ea388){_0x519008=_0x1ea388;_0x3df157[_0x33f2('0xc7')]=_['keys'](db['Team']['rawAttributes']);_0x3df157[_0x33f2('0x3d')]=_[_0x33f2('0xc4')](_0x528fcb['query']);_0x3df157[_0x33f2('0xc6')]=_['intersection'](_0x3df157[_0x33f2('0xc7')],_0x3df157[_0x33f2('0x3d')]);_0x21d639['attributes']=_[_0x33f2('0xd0')](_0x3df157[_0x33f2('0xc7')],qs['fields'](_0x528fcb['query'][_0x33f2('0xc8')]));_0x21d639['attributes']=_0x21d639[_0x33f2('0x41')][_0x33f2('0x45')]?_0x21d639[_0x33f2('0x41')]:_0x3df157[_0x33f2('0xc7')];_0x21d639['order']=qs['sort'](_0x528fcb[_0x33f2('0x3d')][_0x33f2('0xd1')]);_0x21d639['where']=qs[_0x33f2('0xc6')](_[_0x33f2('0xca')](_0x528fcb[_0x33f2('0x3d')],_0x3df157[_0x33f2('0xc6')]));if(_0x528fcb[_0x33f2('0x3d')][_0x33f2('0x27')]){_0x21d639[_0x33f2('0xcb')]=_[_0x33f2('0xcc')](_0x21d639[_0x33f2('0xcb')],{'$or':_[_0x33f2('0x29')](_0x21d639[_0x33f2('0x41')],function(_0x3dc5df){var _0x519853={};_0x519853[_0x3dc5df]={'$like':'%'+_0x528fcb[_0x33f2('0x3d')][_0x33f2('0x27')]+'%'};return _0x519853;})});}_0x21d639=_[_0x33f2('0xcc')]({},_0x21d639,_0x528fcb['options']);return _0x519008['getTeams'](_0x21d639);}})['then'](function(_0xa88615){if(_0xa88615){_0x477b5b=_0xa88615[_0x33f2('0x45')];if(!_0x528fcb[_0x33f2('0x3d')][_0x33f2('0xbe')](_0x33f2('0xd2'))){_0x21d639['limit']=qs[_0x33f2('0x18')](_0x528fcb['query'][_0x33f2('0x18')]);_0x21d639['offset']=qs[_0x33f2('0x1a')](_0x528fcb[_0x33f2('0x3d')][_0x33f2('0x1a')]);}return _0x519008[_0x33f2('0x105')](_0x21d639);}})[_0x33f2('0x1c')](function(_0x1eb018){if(_0x1eb018){return _0x1eb018?{'count':_0x477b5b,'rows':_0x1eb018}:null;}})[_0x33f2('0x1c')](respondWithResult(_0x2ccdb1,null))[_0x33f2('0x4e')](handleError(_0x2ccdb1,null));};exports['addTeams']=function(_0x6405b2,_0x2a3e5e){var _0x52905a=_0x6405b2[_0x33f2('0x50')]['id'];var _0x292f82=_0x6405b2[_0x33f2('0x4f')]?_0x6405b2[_0x33f2('0x4f')][_0x33f2('0x53')]:null;var _0x5066d7=[];return Promise[_0x33f2('0xfa')]()[_0x33f2('0x1c')](function(){if(!_0x292f82)throw new APIBadRequestError(_0x33f2('0x106'));})['then'](function(){return db[_0x33f2('0x34')][_0x33f2('0x8b')]({'where':{'id':_0x52905a}});})[_0x33f2('0x1c')](function(_0x21f8a2){if(!_0x21f8a2)throw new APINotFoundError(util[_0x33f2('0x9e')](_0x33f2('0xbd'),_0x6405b2[_0x33f2('0x50')]['id']));return db[_0x33f2('0x5d')][_0x33f2('0x107')](function(_0x1abb2c){return _0x21f8a2['addTeams'](_0x292f82,{'transaction':_0x1abb2c})[_0x33f2('0x1c')](function(){return db[_0x33f2('0x108')]['findAll']({'where':{'id':{'$in':_0x292f82}}});})[_0x33f2('0x1c')](function(_0x188e1c){var _0x50648d=_[_0x33f2('0x29')](_0x188e1c,function(_0x1b2973){return _0x1b2973['getAssociatedQueues']();});return Promise[_0x33f2('0x4d')](_0x50648d);})[_0x33f2('0x1c')](function(_0x23fb84){_0x5066d7=_[_0x33f2('0x109')](_0x23fb84);var _0x3b806d=_[_0x33f2('0x29')](_0x5066d7,function(_0x77e913){return _0x77e913['addAgent'](_0x21f8a2['id'],{'transaction':_0x1abb2c});});return Promise[_0x33f2('0x4d')](_0x3b806d);})[_0x33f2('0x1c')](function(){if(!_0x21f8a2[_0x33f2('0x9c')])return;var _0x56be65=_[_0x33f2('0x27')](_0x5066d7,function(_0x4a0283){return _0x4a0283[_0x33f2('0x10a')]('channel')==='Voice';});var _0xdf27b6=_[_0x33f2('0x29')](_0x56be65,function(_0x17d7ea){return db['UserVoiceQueueRt'][_0x33f2('0xa0')]({'membername':_0x21f8a2['name'],'UserId':_0x21f8a2['id'],'queue_name':_0x17d7ea[_0x33f2('0x32')],'VoiceQueueId':_0x17d7ea['id'],'interface':_[_0x33f2('0x9d')](_0x21f8a2['interface'])?util[_0x33f2('0x9e')](_0x33f2('0xea'),_0x21f8a2[_0x33f2('0x32')]):_0x21f8a2[_0x33f2('0x92')],'paused':_0x21f8a2['voicePause']||![],'penalty':_0x21f8a2['penalty']},{'transaction':_0x1abb2c});});return Promise[_0x33f2('0x4d')](_0xdf27b6);})[_0x33f2('0x1c')](function(){return db[_0x33f2('0x10b')][_0x33f2('0x42')]({'where':{'teamId':{'$in':_0x292f82}}});})[_0x33f2('0x1c')](function(_0x2659e7){var _0x42b10b=_['map'](_0x2659e7,function(_0x4fa1b3){return db[_0x33f2('0x10c')]['create']({'UserId':_0x21f8a2['id'],'VoicePrefixId':_0x4fa1b3[_0x33f2('0x10d')]},{'transaction':_0x1abb2c});});return Promise[_0x33f2('0x4d')](_0x42b10b);});});})['then'](function(){for(var _0x508536=0x0;_0x508536<_0x5066d7[_0x33f2('0x45')];_0x508536++){var _0x353885=_0x5066d7[_0x508536][_0x33f2('0x10a')](_0x33f2('0xa2'));var _0x2c2ada=_0x353885+_0x33f2('0x98');socket[_0x33f2('0x1e')]('user'+_0x353885+_0x33f2('0x99'),{'UserId':_0x52905a,['queueField']:_0x5066d7[_0x508536]['id']});}})[_0x33f2('0x1c')](respondWithStatusCode(_0x2a3e5e,null))[_0x33f2('0x4e')](APIHandleError(_0x2a3e5e));};exports[_0x33f2('0x10e')]=function(_0x1f5ea3,_0x59c894){var _0x3e88c2=_0x1f5ea3['params']['id'];var _0x225081=null;if(_0x1f5ea3[_0x33f2('0x3d')][_0x33f2('0x53')]){_0x225081=_[_0x33f2('0x10f')](_0x1f5ea3[_0x33f2('0x3d')]['ids'])?_0x1f5ea3[_0x33f2('0x3d')][_0x33f2('0x53')]:[_0x1f5ea3['query']['ids']];}var _0x4eb188=[];return Promise['resolve']()[_0x33f2('0x1c')](function(){if(!_0x225081)throw new APIBadRequestError(_0x33f2('0x110'));})[_0x33f2('0x1c')](function(){return db[_0x33f2('0x34')][_0x33f2('0x8b')]({'where':{'id':_0x3e88c2}});})['then'](function(_0x1e79c7){if(!_0x1e79c7)throw new APINotFoundError(util['format'](_0x33f2('0xbd'),_0x1f5ea3['params']['id']));return db[_0x33f2('0x5d')][_0x33f2('0x107')](function(_0x4943c3){return _0x1e79c7[_0x33f2('0x10e')](_0x225081,{'transaction':_0x4943c3})['then'](function(){return db[_0x33f2('0x108')][_0x33f2('0x42')]({'where':{'id':{'$in':_0x225081}}});})[_0x33f2('0x1c')](function(_0x370e5c){var _0x5f038a=_['map'](_0x370e5c,function(_0x316c42){return _0x316c42['getAssociatedQueues']();});return Promise['all'](_0x5f038a);})['then'](function(_0x559f08){_0x4eb188=_[_0x33f2('0x109')](_0x559f08);var _0x3b528e=_[_0x33f2('0x29')](_0x4eb188,function(_0x48e29d){return _0x48e29d[_0x33f2('0x111')](_0x1e79c7['id'],{'transaction':_0x4943c3});});return Promise[_0x33f2('0x4d')](_0x3b528e);})['then'](function(){if(!_0x1e79c7[_0x33f2('0x9c')])return;var _0x439a83=_['filter'](_0x4eb188,function(_0x1c4a2e){return _0x1c4a2e[_0x33f2('0x10a')](_0x33f2('0xa2'))===_0x33f2('0x112');});var _0x593f84=_['map'](_0x439a83,function(_0x4ca2e7){return db[_0x33f2('0xa7')][_0x33f2('0x20')]({'where':{'VoiceQueueId':_0x4ca2e7['id'],'UserId':_0x1e79c7['id']},'transaction':_0x4943c3});});return Promise[_0x33f2('0x4d')](_0x593f84);})[_0x33f2('0x1c')](function(){return db[_0x33f2('0x10b')][_0x33f2('0x42')]({'where':{'teamId':{'$in':_0x225081}}});})['then'](function(_0x31120a){var _0x396747=_[_0x33f2('0x29')](_0x31120a,function(_0x4de43e){return db['UserVoicePrefix'][_0x33f2('0x20')]({'where':{'UserId':_0x1e79c7['id'],'VoicePrefixId':_0x4de43e[_0x33f2('0x10d')]}},{'transaction':_0x4943c3});});return Promise[_0x33f2('0x4d')](_0x396747);});});})['then'](function(){for(var _0x5684b1=0x0;_0x5684b1<_0x4eb188[_0x33f2('0x45')];_0x5684b1++){var _0xf43dd3=_0x4eb188[_0x5684b1]['getDataValue'](_0x33f2('0xa2'));var _0x4f2af0=_0xf43dd3+_0x33f2('0x98');socket[_0x33f2('0x1e')]('user'+_0xf43dd3+_0x33f2('0xa6'),{'UserId':_0x3e88c2,['queueField']:_0x4eb188[_0x5684b1]['id']});}})[_0x33f2('0x1c')](respondWithStatusCode(_0x59c894,null))['catch'](APIHandleError(_0x59c894));};exports['getLists']=function(_0x148aaa,_0x3299ee){var _0x1ca590={};var _0x33686b={};var _0x3f8233;var _0x406607;return db['User']['findOne']({'where':{'id':_0x148aaa[_0x33f2('0x50')]['id']}})['then'](handleEntityNotFound(_0x3299ee,null))[_0x33f2('0x1c')](function(_0x2c8a3a){if(_0x2c8a3a){_0x3f8233=_0x2c8a3a;_0x33686b[_0x33f2('0xc7')]=_[_0x33f2('0xc4')](db[_0x33f2('0xbf')][_0x33f2('0xc5')]);_0x33686b[_0x33f2('0x3d')]=_[_0x33f2('0xc4')](_0x148aaa[_0x33f2('0x3d')]);_0x33686b[_0x33f2('0xc6')]=_[_0x33f2('0xd0')](_0x33686b[_0x33f2('0xc7')],_0x33686b[_0x33f2('0x3d')]);_0x1ca590[_0x33f2('0x41')]=_[_0x33f2('0xd0')](_0x33686b[_0x33f2('0xc7')],qs['fields'](_0x148aaa[_0x33f2('0x3d')][_0x33f2('0xc8')]));_0x1ca590[_0x33f2('0x41')]=_0x1ca590['attributes'][_0x33f2('0x45')]?_0x1ca590[_0x33f2('0x41')]:_0x33686b['model'];_0x1ca590[_0x33f2('0xc9')]=qs['sort'](_0x148aaa[_0x33f2('0x3d')][_0x33f2('0xd1')]);_0x1ca590[_0x33f2('0xcb')]=qs[_0x33f2('0xc6')](_[_0x33f2('0xca')](_0x148aaa[_0x33f2('0x3d')],_0x33686b[_0x33f2('0xc6')]));if(_0x148aaa[_0x33f2('0x3d')][_0x33f2('0x27')]){_0x1ca590['where']=_[_0x33f2('0xcc')](_0x1ca590[_0x33f2('0xcb')],{'$or':_['map'](_0x1ca590[_0x33f2('0x41')],function(_0x5271dd){var _0x27041f={};_0x27041f[_0x5271dd]={'$like':'%'+_0x148aaa[_0x33f2('0x3d')][_0x33f2('0x27')]+'%'};return _0x27041f;})});}_0x1ca590=_[_0x33f2('0xcc')]({},_0x1ca590,_0x148aaa['options']);return _0x3f8233[_0x33f2('0x113')](_0x1ca590);}})[_0x33f2('0x1c')](function(_0x349dc0){if(_0x349dc0){_0x406607=_0x349dc0[_0x33f2('0x45')];if(!_0x148aaa['query'][_0x33f2('0xbe')](_0x33f2('0xd2'))){_0x1ca590['limit']=qs[_0x33f2('0x18')](_0x148aaa[_0x33f2('0x3d')][_0x33f2('0x18')]);_0x1ca590[_0x33f2('0x1a')]=qs[_0x33f2('0x1a')](_0x148aaa['query'][_0x33f2('0x1a')]);}return _0x3f8233[_0x33f2('0x113')](_0x1ca590);}})[_0x33f2('0x1c')](function(_0x3c6967){if(_0x3c6967){return _0x3c6967?{'count':_0x406607,'rows':_0x3c6967}:null;}})[_0x33f2('0x1c')](respondWithResult(_0x3299ee,null))[_0x33f2('0x4e')](handleError(_0x3299ee,null));};exports['getAgents']=function(_0x1f4bf8,_0x4fe0e){var _0x1025d8={};var _0x284ee0={};var _0x5ee5de;return db[_0x33f2('0x34')]['findOne']({'where':{'id':_0x1f4bf8[_0x33f2('0x50')]['id']}})[_0x33f2('0x1c')](handleEntityNotFound(_0x4fe0e,null))[_0x33f2('0x1c')](function(_0x35a1b5){if(_0x35a1b5){_0x5ee5de=_0x35a1b5;_0x284ee0[_0x33f2('0xc7')]=_['keys'](db[_0x33f2('0x34')]['rawAttributes']);_0x284ee0[_0x33f2('0x3d')]=_[_0x33f2('0xc4')](_0x1f4bf8[_0x33f2('0x3d')]);_0x284ee0[_0x33f2('0xc6')]=_[_0x33f2('0xd0')](_0x284ee0[_0x33f2('0xc7')],_0x284ee0[_0x33f2('0x3d')]);_0x1025d8[_0x33f2('0x41')]=_[_0x33f2('0xd0')](_0x284ee0['model'],qs[_0x33f2('0xc8')](_0x1f4bf8[_0x33f2('0x3d')]['fields']));_0x1025d8[_0x33f2('0x41')]=_0x1025d8[_0x33f2('0x41')][_0x33f2('0x45')]?_0x1025d8[_0x33f2('0x41')]:_0x284ee0[_0x33f2('0xc7')];_0x1025d8[_0x33f2('0xc9')]=qs[_0x33f2('0xd1')](_0x1f4bf8['query']['sort']);_0x1025d8[_0x33f2('0xcb')]=qs['filters'](_['pick'](_0x1f4bf8[_0x33f2('0x3d')],_0x284ee0['filters']));if(_0x1f4bf8[_0x33f2('0x3d')][_0x33f2('0x27')]){_0x1025d8[_0x33f2('0xcb')]=_[_0x33f2('0xcc')](_0x1025d8['where'],{'$or':_[_0x33f2('0x29')](_0x1025d8[_0x33f2('0x41')],function(_0x47f3a2){var _0x1992e6={};_0x1992e6[_0x47f3a2]={'$like':'%'+_0x1f4bf8[_0x33f2('0x3d')][_0x33f2('0x27')]+'%'};return _0x1992e6;})});}_0x1025d8[_0x33f2('0xc7')]=db['User'];_0x1025d8['as']='Agents';_0x1025d8=_[_0x33f2('0xcc')]({},_0x1025d8,_0x1f4bf8[_0x33f2('0xcd')]);return _0x5ee5de[_0x33f2('0xf1')]({'include':[_0x1025d8]});}})['then'](function(_0x26cf73){if(_0x26cf73){var _0x4f9279={},_0x1885b6=[];for(var _0x177887=0x0;_0x177887<_0x26cf73[_0x33f2('0x45')];_0x177887+=0x1){for(var _0xcc7568=0x0,_0x1cf507;_0xcc7568<_0x26cf73[_0x177887][_0x33f2('0x24')][_0x33f2('0x45')];_0xcc7568+=0x1){_0x1cf507=_0x26cf73[_0x177887][_0x33f2('0x24')][_0xcc7568][_0x33f2('0x21')]({'plain':!![]});_0x4f9279[_0x1cf507['id']]=_0x1cf507;}}_0x4f9279=_[_0x33f2('0x114')](_0x4f9279);for(var _0xda804e=qs[_0x33f2('0x1a')](_0x1f4bf8[_0x33f2('0x3d')][_0x33f2('0x1a')]);_0xda804e<_0x4f9279[_0x33f2('0x45')]&&_0x1885b6['length']=_0x4f7dbd){_0x4b2350=_0x4f7dbd;_0x194926=0xc8;}else{_0x194926=0xce;}_0x3f0901[_0xb39c('0x19')](_0x194926);return _0x3f0901[_0xb39c('0x1f')](_0xb39c('0x20'),_0x45bc85+'-'+_0x4b2350+'/'+_0x4f7dbd)[_0xb39c('0x1a')](_0x365c06);}return null;};}function saveUpdates(_0x121b09){return function(_0x528f44){if(_0x528f44){return _0x528f44[_0xb39c('0x21')](_0x121b09)[_0xb39c('0x22')](function(_0xa65989){if(_0xa65989[_0xb39c('0x23')]===_0xb39c('0x24')){socket[_0xb39c('0x25')]('userNotification:recalc:'+_0xa65989['id'],_0xa65989);}return _0xa65989;});}return null;};}function removeEntity(_0x59cb22){return function(_0x35831a){if(_0x35831a){return _0x35831a[_0xb39c('0x26')]()['then'](function(){var _0x300cb1=_0x35831a[_0xb39c('0x27')]({'plain':!![]});if(_0x300cb1[_0xb39c('0x23')]===_0xb39c('0x28'))return;var _0x41657c=[{'name':_0xb39c('0x29'),'value':_0xb39c('0x2a'),'ignore':!![]},{'name':_0xb39c('0x2b'),'value':_0xb39c('0x24'),'ignore':![]},{'name':_0xb39c('0x2c'),'value':_0xb39c('0x2d'),'ignore':![]}];var _0xdac2b3=_(_0x41657c)[_0xb39c('0x2e')](_0xb39c('0x2f'))[_0xb39c('0x30')](_0xb39c('0x31'))[_0xb39c('0x31')]();if(_[_0xb39c('0x32')](_0xdac2b3,_0x300cb1[_0xb39c('0x23')])){return;}var _0x3681c1=_[_0xb39c('0x33')](_0x41657c,['value',_0x300cb1[_0xb39c('0x23')]])[_0xb39c('0x34')];return db[_0xb39c('0x35')][_0xb39c('0x26')]({'where':{'type':_0x3681c1,'resourceId':_0x300cb1['id']}})[_0xb39c('0x22')](function(){return _0x35831a;});})[_0xb39c('0x22')](function(){_0x59cb22[_0xb39c('0x19')](0xcc)[_0xb39c('0x36')]();});}};}function handleEntityNotFound(_0x2fe921){return function(_0x356a57){if(!_0x356a57){_0x2fe921[_0xb39c('0x37')](0x194);}return _0x356a57;};}function handleError(_0x218c98,_0x6d217a){_0x6d217a=_0x6d217a||0x1f4;return function(_0x35462a){logger[_0xb39c('0x38')](_0x35462a['stack']);if(_0x35462a['name']){delete _0x35462a['name'];}_0x218c98[_0xb39c('0x19')](_0x6d217a)[_0xb39c('0x39')](_0x35462a);};}function getUserAttributes(){return _(db[_0xb39c('0x3a')][_0xb39c('0x3b')])[_0xb39c('0x30')](function(_0x4e3bab){return{'name':_0x4e3bab[_0xb39c('0x3c')],'type':_0x4e3bab[_0xb39c('0x3d')][_0xb39c('0x3e')]};})['filter'](function(_0x1c45ed){return!['password','salt',_0xb39c('0x3f'),_0xb39c('0x40'),_0xb39c('0x41'),_0xb39c('0x42')][_0xb39c('0x32')](_0x1c45ed['name']);})['value']();}exports['index']=function(_0x2beb44,_0x31852a){var _0x4e2a26={},_0x42f55a={'count':0x0,'rows':[]};var _0x4c77be=getUserAttributes();_0x4e2a26=qs['getOptions'](_0x4c77be,_0x2beb44);var _0x25bcc3={'where':_0x4e2a26[_0xb39c('0x43')]};return db[_0xb39c('0x3a')][_0xb39c('0x1e')](_0x25bcc3)['then'](function(_0x56219c){_0x42f55a[_0xb39c('0x1e')]=_0x56219c;if(_0x2beb44[_0xb39c('0x44')][_0xb39c('0x45')]){_0x4e2a26['include']=[{'all':!![]}];}if(_0x2beb44[_0xb39c('0x44')][_0xb39c('0x46')]===_0xb39c('0x47')){_0x4e2a26[_0xb39c('0x48')]=[{'model':db[_0xb39c('0x49')],'as':_0xb39c('0x46')}];}if(!_[_0xb39c('0x32')](_0x4e2a26['attributes'],'id')){_0x4e2a26[_0xb39c('0x4a')][_0xb39c('0x4b')]('id');}return db[_0xb39c('0x3a')]['findAll'](_0x4e2a26);})['then'](function(_0x34ab98){_0x42f55a[_0xb39c('0x4c')]=_0x34ab98;if(_0x2beb44['query'][_0xb39c('0x4d')]==='true'){var _0x13f521=[];for(var _0x561266=0x0;_0x561266<_0x42f55a[_0xb39c('0x4c')][_0xb39c('0x4e')];_0x561266++){_0x13f521[_0xb39c('0x4b')](get_open_tabs(_0xb39c('0x4f'),_0x42f55a[_0xb39c('0x4c')][_0x561266][_0xb39c('0x50')]));_0x13f521[_0xb39c('0x4b')](get_open_tabs(_0xb39c('0x51'),_0x42f55a[_0xb39c('0x4c')][_0x561266]['dataValues']));_0x13f521['push'](get_open_tabs(_0xb39c('0x52'),_0x42f55a[_0xb39c('0x4c')][_0x561266][_0xb39c('0x50')]));_0x13f521[_0xb39c('0x4b')](get_open_tabs(_0xb39c('0x53'),_0x42f55a[_0xb39c('0x4c')][_0x561266]['dataValues']));_0x13f521[_0xb39c('0x4b')](get_open_tabs('openchannel',_0x42f55a[_0xb39c('0x4c')][_0x561266]['dataValues']));_0x13f521['push'](get_open_tabs(_0xb39c('0x54'),_0x42f55a[_0xb39c('0x4c')][_0x561266][_0xb39c('0x50')]));}return Promise['all'](_0x13f521)['then'](function(){return _0x42f55a;});}else{return _0x42f55a;}})['then'](respondWithFilteredResult(_0x31852a,_0x4e2a26))[_0xb39c('0x55')](handleError(_0x31852a,null));};exports[_0xb39c('0x56')]=function(_0x54dc95,_0x129f2e){var _0x4b76d7=getUserAttributes();_0x54dc95[_0xb39c('0x44')]['id']=_0x54dc95[_0xb39c('0x57')]['id'];var _0x2fee98=qs[_0xb39c('0x58')](_0x4b76d7,_0x54dc95);if(_0x54dc95[_0xb39c('0x44')][_0xb39c('0x45')]){_0x2fee98[_0xb39c('0x48')]=[{'all':!![]}];}if(_0x54dc95['query']['userSetting']===_0xb39c('0x47')){_0x2fee98[_0xb39c('0x48')]=[{'model':db[_0xb39c('0x49')],'as':'userSetting'}];}_0x2fee98=_[_0xb39c('0x59')]({},_0x2fee98,_0x54dc95[_0xb39c('0x5a')]);if(!_[_0xb39c('0x32')](_0x2fee98[_0xb39c('0x4a')],'id')){_0x2fee98[_0xb39c('0x4a')][_0xb39c('0x4b')]('id');}return db[_0xb39c('0x3a')][_0xb39c('0x33')](_0x2fee98)[_0xb39c('0x22')](handleEntityNotFound(_0x129f2e,null))[_0xb39c('0x22')](function(_0x3594e7){var _0x2c22ff=[];values=_0x3594e7;if(_0x54dc95[_0xb39c('0x44')]['openTabs']===_0xb39c('0x47')){_0x2c22ff[_0xb39c('0x4b')](get_open_tabs('chat',_0x3594e7[_0xb39c('0x50')]));_0x2c22ff[_0xb39c('0x4b')](get_open_tabs(_0xb39c('0x51'),_0x3594e7[_0xb39c('0x50')]));_0x2c22ff[_0xb39c('0x4b')](get_open_tabs('openchannel',_0x3594e7[_0xb39c('0x50')]));_0x2c22ff[_0xb39c('0x4b')](get_open_tabs('whatsapp',_0x3594e7[_0xb39c('0x50')]));_0x2c22ff[_0xb39c('0x4b')](get_open_tabs(_0xb39c('0x52'),_0x3594e7[_0xb39c('0x50')]));_0x2c22ff[_0xb39c('0x4b')](get_open_tabs(_0xb39c('0x53'),_0x3594e7[_0xb39c('0x50')]));return Promise[_0xb39c('0x5b')](_0x2c22ff);}else{return values;}})[_0xb39c('0x22')](function(){return values;})['then'](respondWithResult(_0x129f2e,null))[_0xb39c('0x55')](handleError(_0x129f2e,null));};exports[_0xb39c('0x21')]=function(_0x9a4b7c,_0x570e2a){if(_0x9a4b7c['body']['id']){delete _0x9a4b7c[_0xb39c('0x5c')]['id'];}delete _0x9a4b7c['body'][_0xb39c('0x23')];return db[_0xb39c('0x3a')][_0xb39c('0x33')]({'where':{'id':_0x9a4b7c[_0xb39c('0x57')]['id']}})[_0xb39c('0x22')](handleEntityNotFound(_0x570e2a,null))[_0xb39c('0x22')](saveUpdates(_0x9a4b7c['body'],null))['then'](respondWithResult(_0x570e2a,null))[_0xb39c('0x55')](handleError(_0x570e2a,null));};exports['describe']=function(_0x5f5d37,_0x3b9111){return db[_0xb39c('0x3a')]['describe']()[_0xb39c('0x22')](respondWithResult(_0x3b9111,null))[_0xb39c('0x55')](handleError(_0x3b9111,null));};exports[_0xb39c('0x5d')]=function(_0x1e16ac,_0x4b5461){return db['User']['find']({'where':{'id':_0x1e16ac[_0xb39c('0x57')]['id']}})[_0xb39c('0x22')](handleEntityNotFound(_0x4b5461,null))[_0xb39c('0x22')](function(_0x5325a8){if(_0x5325a8){return _0x5325a8['addContacts'](_0x1e16ac[_0xb39c('0x5c')][_0xb39c('0x5e')],_[_0xb39c('0x5f')](_0x1e16ac[_0xb39c('0x5c')],[_0xb39c('0x5e'),'id'])||{});}})[_0xb39c('0x22')](respondWithResult(_0x4b5461,null))[_0xb39c('0x55')](handleError(_0x4b5461,null));};function validateUser(_0x57f769){return new Promise(function(_0x26be34,_0x350bd8){if(_0x57f769[_0xb39c('0x60')])return _0x26be34(_0x57f769);return db[_0xb39c('0x61')][_0xb39c('0x62')](0x1)['then'](function(_0x233835){if(_0x233835[_0xb39c('0x63')])authService['validatePasswordPattern'](_0x57f769[_0xb39c('0x64')]);db[_0xb39c('0x3a')][_0xb39c('0x65')](_0xb39c('0x60'))['then'](function(_0x38bd70){if(_[_0xb39c('0x66')](_0x38bd70)){_0x57f769[_0xb39c('0x60')]=_0x233835[_0xb39c('0x67')]||0x1;return;}if(_[_0xb39c('0x66')](_0x233835[_0xb39c('0x67')])||_0x233835[_0xb39c('0x67')]===_0x38bd70){_0x57f769[_0xb39c('0x60')]=_0x38bd70+0x1;return;}if(_0x233835[_0xb39c('0x67')]>_0x38bd70){_0x57f769[_0xb39c('0x60')]=_0x233835['min_internal'];return;}return db[_0xb39c('0x68')]['query'](_0xb39c('0x69'),{'type':db[_0xb39c('0x68')][_0xb39c('0x6a')][_0xb39c('0x6b')]})['then'](function(_0x4f8ea3){if(_0x4f8ea3&&_0x4f8ea3['length']){for(var _0x46e5f6=0x0,_0xd06917=_0x4f8ea3[_0xb39c('0x4e')];_0x46e5f6<_0xd06917&&_[_0xb39c('0x66')](_0x57f769[_0xb39c('0x60')]);_0x46e5f6++){if(_0x233835['min_internal']<=_0x4f8ea3[_0x46e5f6][_0xb39c('0x6c')]){_0x57f769[_0xb39c('0x60')]=_0x4f8ea3[_0x46e5f6][_0xb39c('0x6c')];}else if(_0x233835[_0xb39c('0x67')]>_0x4f8ea3[_0x46e5f6][_0xb39c('0x6c')]&&_0x233835['min_internal']<=_0x4f8ea3[_0x46e5f6]['to']){_0x57f769[_0xb39c('0x60')]=_0x233835[_0xb39c('0x67')];}}}if(_[_0xb39c('0x66')](_0x57f769[_0xb39c('0x60')])){_0x57f769['internal']=_0x38bd70+0x1;}return _0x26be34(_0x57f769);});});})[_0xb39c('0x55')](function(_0x585899){_0x350bd8(_0x585899);});});}function updateUser(_0x273af5){return new Promise(function(_0x260623,_0x29f345){try{if(_0x273af5[_0xb39c('0x6d')]){_0x273af5[_0xb39c('0x6e')]=_0x273af5['internal'];_0x273af5[_0xb39c('0x6f')]={'mailbox':_0x273af5[_0xb39c('0x60')],'password':_0x273af5['password'],'fullname':_0x273af5['fullname'],'email':_0x273af5['email']};}if(_0x273af5['role']==='agent'){if(!_0x273af5['permissions'])_0x273af5[_0xb39c('0x70')]=[_0xb39c('0x71'),_0xb39c('0x72'),_0xb39c('0x73'),_0xb39c('0x74'),_0xb39c('0x75'),'104',_0xb39c('0x76'),_0xb39c('0x77'),'107',_0xb39c('0x78'),_0xb39c('0x79'),_0xb39c('0x7a'),_0xb39c('0x7b'),'114',_0xb39c('0x7c')];}_0x260623(_0x273af5);}catch(_0x8563){_0x29f345(_0x8563);}});}exports[_0xb39c('0x7d')]=function(_0x5624f8,_0x30bcbe){if(_0x5624f8[_0xb39c('0x2a')][_0xb39c('0x23')]==='agent')throw new Error('Unauthorized');if(_0x5624f8['body'][_0xb39c('0x23')]===_0xb39c('0x2a')&&_0x5624f8['user'][_0xb39c('0x23')]!=='admin'){throw new Error(_0xb39c('0x7e'));}if(_0x5624f8['body']['role']===_0xb39c('0x28')&&_0x5624f8[_0xb39c('0x2a')][_0xb39c('0x23')]!=='admin'){throw new Error(_0xb39c('0x7f'));}return licenseUtil[_0xb39c('0x80')]([_0x5624f8[_0xb39c('0x5c')]])['then'](function(){return validateUser(_0x5624f8['body']);})[_0xb39c('0x22')](function(_0x14fe44){return updateUser(_0x14fe44)[_0xb39c('0x22')](function(_0x1e6c68){if(_0x1e6c68[_0xb39c('0x23')]===_0xb39c('0x28')){_0x1e6c68[_0xb39c('0x81')]=_0x5624f8[_0xb39c('0x2a')][_0xb39c('0x81')];delete _0x1e6c68[_0xb39c('0x82')];}return _0x1e6c68;});})[_0xb39c('0x22')](function(_0x3b3975){return db[_0xb39c('0x3a')][_0xb39c('0x7d')](_0x3b3975,{'include':[{'model':db[_0xb39c('0x6f')],'as':_0xb39c('0x6f')}]});})[_0xb39c('0x22')](function(_0x399e62){if(_0x5624f8[_0xb39c('0x5c')]['role']===_0xb39c('0x2a'))return _0x399e62;if(_0x5624f8[_0xb39c('0x2a')][_0xb39c('0x23')]!==_0xb39c('0x2a'))return _0x399e62;return db[_0xb39c('0x83')][_0xb39c('0x33')]({'where':{'name':_0x399e62['role']===_0xb39c('0x24')?_0xb39c('0x2b'):_0xb39c('0x2c'),'userProfileId':_0x5624f8[_0xb39c('0x2a')][_0xb39c('0x82')]},'raw':!![]})[_0xb39c('0x22')](function(_0x160ac9){if(!_0x160ac9||_0x160ac9[_0xb39c('0x84')]!=0x0)return _0x399e62;return db[_0xb39c('0x35')]['create']({'name':_0x399e62[_0xb39c('0x34')],'resourceId':_0x399e62['id'],'type':_0x160ac9[_0xb39c('0x34')],'sectionId':_0x160ac9['id']},{})[_0xb39c('0x22')](function(){return _0x399e62;});})[_0xb39c('0x55')](function(_0x22012e){logger['error'](_0xb39c('0x85'),_0x22012e);throw _0x22012e;});})[_0xb39c('0x22')](respondWithResult(_0x30bcbe,0xc9))[_0xb39c('0x55')](handleError(_0x30bcbe,null));};exports['bulkCreate']=function(_0x520a26,_0x2285b6){var _0x5af4d8=_0x520a26['body'];var _0x46c3c4=[];if(_0x520a26[_0xb39c('0x2a')][_0xb39c('0x23')]===_0xb39c('0x24'))throw new Error(_0xb39c('0x86'));if(_['some'](_0x5af4d8,[_0xb39c('0x23'),'user'])&&_0x520a26[_0xb39c('0x2a')][_0xb39c('0x23')]!==_0xb39c('0x28')){throw new Error(_0xb39c('0x7e'));}if(_[_0xb39c('0x87')](_0x5af4d8,['role','admin'])&&_0x520a26[_0xb39c('0x2a')][_0xb39c('0x23')]!==_0xb39c('0x28')){throw new Error(_0xb39c('0x88'));}return licenseUtil[_0xb39c('0x80')](_0x5af4d8)['then'](function(){return validateUser(_0x5af4d8[0x0]);})[_0xb39c('0x22')](function(){for(var _0x26a12f=0x1;_0x26a12f<_0x5af4d8[_0xb39c('0x4e')];_0x26a12f++){var _0x100091=_0x5af4d8[_0x26a12f-0x1]['internal'];if(!_0x5af4d8[_0x26a12f][_0xb39c('0x60')])_0x5af4d8[_0x26a12f]['internal']=_0x100091+0x1;_0x46c3c4[_0xb39c('0x4b')](validateUser(_0x5af4d8[_0x26a12f]));}return Promise[_0xb39c('0x5b')](_0x46c3c4);})[_0xb39c('0x22')](function(){_0x46c3c4=[];for(var _0x15d91e=0x0;_0x15d91e<_0x5af4d8[_0xb39c('0x4e')];_0x15d91e++){_0x46c3c4[_0xb39c('0x4b')](updateUser(_0x5af4d8[_0x15d91e]));}return Promise[_0xb39c('0x5b')](_0x46c3c4);})[_0xb39c('0x22')](function(){_0x46c3c4=_0x5af4d8[_0xb39c('0x30')](function(_0x3963e8){return db[_0xb39c('0x3a')][_0xb39c('0x7d')](_0x3963e8,{'include':[{'model':db[_0xb39c('0x6f')],'as':'VoiceMail'}]})[_0xb39c('0x22')](function(_0x41e95a){_0x3963e8['id']=_0x41e95a['id'];return _0x3963e8;});});return Promise['all'](_0x46c3c4);})[_0xb39c('0x22')](function(_0x5d1be1){if(_0x520a26['body'][_0xb39c('0x23')]===_0xb39c('0x2a'))return _0x5d1be1;if(_0x520a26['user'][_0xb39c('0x23')]!==_0xb39c('0x2a'))return _0x5d1be1;var _0x593b03=_['some'](_0x5d1be1,function(_0x56c2b9){return _0x56c2b9[_0xb39c('0x23')]===_0xb39c('0x24')||_0x56c2b9['role']==='telephone';});if(!_0x593b03)return _0x5d1be1;return db[_0xb39c('0x83')]['findAll']({'where':{'name':{'$or':[_0xb39c('0x2b'),_0xb39c('0x2c')]},'userProfileId':_0x520a26[_0xb39c('0x2a')][_0xb39c('0x82')]},'raw':!![]})[_0xb39c('0x22')](function(_0x5ef788){if(_[_0xb39c('0x89')](_0x5ef788)||!_['some'](_0x5ef788,[_0xb39c('0x84'),0x0]))return _0x5d1be1;_0x46c3c4=[];var _0x4cf459=_(_0x5ef788)[_0xb39c('0x30')](function(_0x3a8a12){if(_0x3a8a12['autoAssociation']===0x1)return;return _0x3a8a12[_0xb39c('0x34')]==='Agents'?_0xb39c('0x24'):_0xb39c('0x2d');})[_0xb39c('0x8a')]()[_0xb39c('0x31')]();for(var _0x5da5b4=0x0;_0x5da5b4<_0x5d1be1[_0xb39c('0x4e')];_0x5da5b4++){if(!_[_0xb39c('0x32')](_0x4cf459,_0x5d1be1[_0x5da5b4][_0xb39c('0x23')]))return;var _0x2c937f=_0x5d1be1[_0x5da5b4][_0xb39c('0x23')]===_0xb39c('0x24')?_0xb39c('0x2b'):'Telephones';_0x46c3c4['push'](db[_0xb39c('0x35')][_0xb39c('0x7d')]({'name':_0x5d1be1[_0x5da5b4]['name'],'resourceId':_0x5d1be1[_0x5da5b4]['id'],'type':_0x2c937f,'sectionId':_[_0xb39c('0x33')](_0x5ef788,['name',_0x2c937f])['id']},{}));}return Promise[_0xb39c('0x5b')](_0x46c3c4);});})['then'](respondWithResult(_0x2285b6,0xc9))[_0xb39c('0x55')](handleError(_0x2285b6,null));};exports['changePassword']=function(_0x60b469,_0x30cf68){if(_0x60b469[_0xb39c('0x5c')]['id']){delete _0x60b469['body']['id'];}return db[_0xb39c('0x3a')]['find']({'where':{'id':_0x60b469[_0xb39c('0x57')]['id']}})[_0xb39c('0x22')](function(_0x5867dd){if(!_0x5867dd)return null;if(_0x5867dd['id']===_0x60b469[_0xb39c('0x2a')]['id']){if(!_0x60b469['body'][_0xb39c('0x8b')]||!_0x60b469[_0xb39c('0x5c')][_0xb39c('0x8c')]){throw new db[(_0xb39c('0x8d'))][(_0xb39c('0x8e'))](_0xb39c('0x8f'));}if(!_0x5867dd[_0xb39c('0x90')](_0x60b469[_0xb39c('0x5c')][_0xb39c('0x8b')])){throw new db[(_0xb39c('0x8d'))]['ValidationError'](_0xb39c('0x91'));}if(_0x60b469[_0xb39c('0x5c')][_0xb39c('0x8b')]===_0x60b469[_0xb39c('0x5c')][_0xb39c('0x8c')]){throw new db[(_0xb39c('0x8d'))][(_0xb39c('0x8e'))](_0xb39c('0x92'));}}else if(_0x60b469['user'][_0xb39c('0x23')]==='admin'){if(!_0x60b469[_0xb39c('0x5c')]['newPassword']){throw new db[(_0xb39c('0x8d'))][(_0xb39c('0x8e'))](_0xb39c('0x93'));}}else if(_0x60b469[_0xb39c('0x2a')][_0xb39c('0x23')]===_0xb39c('0x2a')){if(!_0x60b469[_0xb39c('0x5c')]['newPassword']){throw new db[(_0xb39c('0x8d'))][(_0xb39c('0x8e'))](_0xb39c('0x93'));}if(_0x5867dd[_0xb39c('0x23')]!==_0xb39c('0x24')){throw new db[(_0xb39c('0x8d'))]['ValidationError'](_0xb39c('0x86'));}}else{throw new db[(_0xb39c('0x8d'))]['ValidationError'](_0xb39c('0x86'));}return _0x5867dd;})['then'](handleEntityNotFound(_0x30cf68,null))['then'](function(_0x3103c0){return db[_0xb39c('0x61')]['findOne']({'attributes':['id',_0xb39c('0x63'),_0xb39c('0x94'),'passwordHistoryLimit']})[_0xb39c('0x22')](function(_0xa868f1){if(_0xa868f1[_0xb39c('0x63')])authService[_0xb39c('0x95')](_0x60b469['body'][_0xb39c('0x8c')]);if(!_0xa868f1[_0xb39c('0x94')]||!_0x3103c0[_0xb39c('0x3f')])return _0x3103c0;authService['validatePasswordHistory'](_0x60b469[_0xb39c('0x5c')][_0xb39c('0x8c')],_0x3103c0[_0xb39c('0x3f')],_0xa868f1[_0xb39c('0x96')]);return _0x3103c0;})['then'](saveUpdates({'password':_0x60b469[_0xb39c('0x5c')][_0xb39c('0x8c')],'passwordResetAt':_0x60b469[_0xb39c('0x2a')]['id']==_0x60b469['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x60b469[_0xb39c('0x5c')]['newPassword'],_0x3103c0[_0xb39c('0x3f')])},null));})[_0xb39c('0x22')](respondWithResult(_0x30cf68,null))[_0xb39c('0x55')](handleError(_0x30cf68,null));};exports[_0xb39c('0x97')]=function(_0x4a93db,_0x3a09ce){var _0x1aba2c=_0x4a93db[_0xb39c('0x5c')][_0xb39c('0x98')];return db[_0xb39c('0x3a')][_0xb39c('0x33')]({'where':{'id':_0x4a93db[_0xb39c('0x57')]['id']},'attributes':['id',_0xb39c('0x34'),_0xb39c('0x23'),_0xb39c('0x99'),'loginInPause',_0xb39c('0x9a'),_0xb39c('0x9b')]})[_0xb39c('0x22')](handleEntityNotFound(_0x3a09ce,null))['then'](function(_0x4e6272){if(_0x4e6272){if(!utils[_0xb39c('0x9c')](_0x1aba2c)){throw new db[(_0xb39c('0x8d'))]['ValidationError'](_0xb39c('0x9d'));}return _0x4e6272[_0xb39c('0x9e')+_[_0xb39c('0x9f')](_0x1aba2c['toLowerCase']())+_0xb39c('0xa0')](_0x4a93db['body']['ids'],{'penalty':_0x4a93db[_0xb39c('0x5c')][_0xb39c('0xa1')]||0x0})[_0xb39c('0xa2')](function(_0x2884c1){for(var _0x455f0f=0x0;_0x455f0f<_0x4a93db[_0xb39c('0x5c')][_0xb39c('0x5e')][_0xb39c('0x4e')];_0x455f0f+=0x1){var _0x36b558={'UserId':Number(_0x4a93db[_0xb39c('0x57')]['id'])};_0x36b558[_[_0xb39c('0x9f')](_0x1aba2c['toLowerCase']())+_0xb39c('0xa3')]=Number(_0x4a93db[_0xb39c('0x5c')][_0xb39c('0x5e')][_0x455f0f]);socket['emit'](_0xb39c('0x2a')+_[_0xb39c('0x9f')](_0x1aba2c[_0xb39c('0xa4')]())+_0xb39c('0xa5'),_0x36b558);}return _0x2884c1;})[_0xb39c('0x22')](function(){if(_0x1aba2c==='voice'){return db[_0xb39c('0xa6')][_0xb39c('0xa7')]({'where':{'id':_0x4a93db[_0xb39c('0x5c')][_0xb39c('0x5e')]||[]},'raw':!![],'attributes':['id','name']});}})[_0xb39c('0x22')](function(_0x202630){var _0x7fa817=_0x4e6272[_0xb39c('0x27')]({'plain':!![]});var _0xbbc5d7=[];if(_0x1aba2c===_0xb39c('0xa8')&&_0x7fa817[_0xb39c('0x23')]===_0xb39c('0x24')&&_0x7fa817[_0xb39c('0x99')]){for(let _0x58ce68=0x0;_0x58ce68<_0x202630[_0xb39c('0x4e')];_0x58ce68+=0x1){_0xbbc5d7[_0xb39c('0x4b')]({'membername':_0x7fa817[_0xb39c('0x34')],'UserId':_0x7fa817['id'],'queue_name':_0x202630[_0x58ce68][_0xb39c('0x34')],'VoiceQueueId':_0x202630[_0x58ce68]['id'],'interface':_[_0xb39c('0x66')](_0x7fa817['interface'])?util[_0xb39c('0xa9')](_0xb39c('0xaa'),_0x7fa817['name']):_0x7fa817[_0xb39c('0x9b')],'paused':_0x7fa817[_0xb39c('0x9a')]||![],'penalty':_0x4a93db[_0xb39c('0x5c')][_0xb39c('0xa1')]||0x0});}return Promise['all'](_0xbbc5d7[_0xb39c('0x30')](function(_0xcc02f4){return db[_0xb39c('0xab')][_0xb39c('0xac')](_0xcc02f4);}));}return _0x4e6272;});}})[_0xb39c('0x22')](respondWithStatusCode(_0x3a09ce,null))[_0xb39c('0x55')](handleError(_0x3a09ce,null));};exports[_0xb39c('0xad')]=function(_0x497722,_0x1ba15e){var _0x9e7645,_0x5841c7;return db[_0xb39c('0x3a')][_0xb39c('0x33')]({'where':{'id':_0x497722[_0xb39c('0x57')]['id']},'attributes':['id',_0xb39c('0x34'),'role']})['then'](handleEntityNotFound(_0x1ba15e,null))[_0xb39c('0x22')](function(_0x33a8b4){if(_0x33a8b4){_0x9e7645=_0x33a8b4;if(!_0x497722[_0xb39c('0x44')][_0xb39c('0x98')]||!utils[_0xb39c('0x9c')](_0x497722['query'][_0xb39c('0x98')])){throw new db[(_0xb39c('0x8d'))]['ValidationError']('Unknown\x20channel');}return _0x33a8b4[_0xb39c('0xae')+_[_0xb39c('0x9f')](_0x497722[_0xb39c('0x44')][_0xb39c('0x98')]['toLowerCase']())+_0xb39c('0xa0')](_0x497722[_0xb39c('0x44')][_0xb39c('0x5e')]);}})[_0xb39c('0x22')](function(_0x1a4af3){if(_['isArray'](_0x497722[_0xb39c('0x44')][_0xb39c('0x5e')])){for(var _0x1305e4=0x0;_0x1305e4<_0x497722[_0xb39c('0x44')][_0xb39c('0x5e')][_0xb39c('0x4e')];_0x1305e4+=0x1){_0x5841c7={'UserId':Number(_0x497722[_0xb39c('0x57')]['id'])};_0x5841c7[_[_0xb39c('0x9f')](_0x497722[_0xb39c('0x44')][_0xb39c('0x98')][_0xb39c('0xa4')]())+_0xb39c('0xa3')]=Number(_0x497722[_0xb39c('0x44')][_0xb39c('0x5e')][_0x1305e4]);socket['emit'](_0xb39c('0x2a')+_[_0xb39c('0x9f')](_0x497722[_0xb39c('0x44')]['channel'][_0xb39c('0xa4')]())+'Queue:remove',_0x5841c7);}}else{_0x5841c7={'UserId':Number(_0x497722[_0xb39c('0x57')]['id'])};_0x5841c7[_[_0xb39c('0x9f')](_0x497722['query']['channel'][_0xb39c('0xa4')]())+_0xb39c('0xa3')]=Number(_0x497722[_0xb39c('0x44')]['ids']);socket[_0xb39c('0x25')]('user'+_['capitalize'](_0x497722[_0xb39c('0x44')]['channel'][_0xb39c('0xa4')]())+_0xb39c('0xaf'),_0x5841c7);}return _0x1a4af3;})[_0xb39c('0x22')](function(){if(_0x497722['query']['channel']==='voice'){return db['UserVoiceQueueRt'][_0xb39c('0x26')]({'where':{'UserId':_0x497722['params']['id'],'VoiceQueueId':_0x497722[_0xb39c('0x44')][_0xb39c('0x5e')]},'individualHooks':!![]})[_0xb39c('0x22')](function(){return _0x9e7645;});}return _0x9e7645;})[_0xb39c('0x22')](respondWithStatusCode(_0x1ba15e,null))[_0xb39c('0x55')](handleError(_0x1ba15e,null));};exports['addAvatar']=function(_0x3483e6,_0x56096b){_0x3483e6[_0xb39c('0x5c')][_0xb39c('0xb0')]=_0x3483e6['file'][_0xb39c('0xb1')];return db[_0xb39c('0x3a')][_0xb39c('0x33')]({'where':{'id':_0x3483e6[_0xb39c('0x57')]['id']}})[_0xb39c('0x22')](handleEntityNotFound(_0x56096b,null))[_0xb39c('0x22')](saveUpdates(_0x3483e6[_0xb39c('0x5c')],null))[_0xb39c('0x22')](respondWithResult(_0x56096b,null))['catch'](handleError(_0x56096b,null));};exports[_0xb39c('0xb2')]=function(_0x289883,_0x2f7e0a){var _0x120461=path[_0xb39c('0xb3')](config[_0xb39c('0xb4')],_0xb39c('0xb5'));return db[_0xb39c('0x3a')][_0xb39c('0x33')]({'where':{'id':_0x289883[_0xb39c('0x57')]['id']},'attributes':['id',_0xb39c('0xb0')],'raw':!![]})[_0xb39c('0x22')](handleEntityNotFound(_0x2f7e0a,null))[_0xb39c('0x22')](function(_0x2a17f2){if(_0x2a17f2){if(_[_0xb39c('0x66')](_0x2a17f2[_0xb39c('0xb0')])){return _0x2f7e0a['download'](_0x120461);}else{if(!fs[_0xb39c('0xb6')](path['join'](config[_0xb39c('0xb4')],_0xb39c('0xb7'),_0x2a17f2[_0xb39c('0xb0')]))){return _0x2f7e0a['download'](_0x120461);}return _0x2f7e0a['download'](path[_0xb39c('0xb3')](config[_0xb39c('0xb4')],_0xb39c('0xb7'),_0x2a17f2[_0xb39c('0xb0')]));}}})['catch'](handleError(_0x2f7e0a,null));};exports['getOpenTabs']=function(_0x11ba32,_0x350148){return db['User']['find']({'where':{'id':_0x11ba32[_0xb39c('0x57')]['id']},'attributes':['id']})[_0xb39c('0x22')](handleEntityNotFound(_0x350148,null))[_0xb39c('0x22')](function(_0x5e119e){var _0x457840=[];values=_0x5e119e[_0xb39c('0x50')];_0x457840['push'](get_open_tabs(_0xb39c('0x4f'),_0x5e119e['dataValues']));_0x457840[_0xb39c('0x4b')](get_open_tabs(_0xb39c('0x51'),_0x5e119e[_0xb39c('0x50')]));_0x457840['push'](get_open_tabs(_0xb39c('0xb8'),_0x5e119e[_0xb39c('0x50')]));_0x457840[_0xb39c('0x4b')](get_open_tabs(_0xb39c('0x54'),_0x5e119e['dataValues']));_0x457840[_0xb39c('0x4b')](get_open_tabs(_0xb39c('0x52'),_0x5e119e['dataValues']));_0x457840[_0xb39c('0x4b')](get_open_tabs('mail',_0x5e119e[_0xb39c('0x50')]));return Promise[_0xb39c('0x5b')](_0x457840);})[_0xb39c('0x22')](function(_0x3378c9){if(_0x3378c9){var _0x455b31=_[_0xb39c('0x30')](values['ChatOpenTabs'],function(_0x44ed94){return{'channel':_0xb39c('0xb9'),'id':_0x44ed94['id'],'createdAt':_0x44ed94[_0xb39c('0xba')]};});var _0xbdd661=_[_0xb39c('0x30')](values[_0xb39c('0xbb')],function(_0x42bcfc){return{'channel':'FAX','id':_0x42bcfc['id'],'createdAt':_0x42bcfc[_0xb39c('0xba')]};});var _0x397249=_['map'](values[_0xb39c('0xbc')],function(_0x3d859b){return{'channel':_0xb39c('0xbd'),'id':_0x3d859b['id'],'createdAt':_0x3d859b[_0xb39c('0xba')]};});var _0x3b7a5b=_[_0xb39c('0x30')](values[_0xb39c('0xbe')],function(_0x3c7933){return{'channel':_0xb39c('0xbf'),'id':_0x3c7933['id'],'createdAt':_0x3c7933[_0xb39c('0xba')]};});var _0x25ae4a=_[_0xb39c('0x30')](values[_0xb39c('0xc0')],function(_0x1c6951){return{'channel':_0xb39c('0xc1'),'id':_0x1c6951['id'],'createdAt':_0x1c6951[_0xb39c('0xba')]};});var _0x508715=_[_0xb39c('0x30')](values[_0xb39c('0xc2')],function(_0x34fa89){return{'channel':'WHATSAPP','id':_0x34fa89['id'],'createdAt':_0x34fa89[_0xb39c('0xba')]};});var _0x268b2b=_[_0xb39c('0xc3')](_0x455b31,_0xbdd661,_0x397249,_0x3b7a5b,_0x25ae4a,_0x508715);var _0x23855d={'count':_0x268b2b['length'],'rows':_0x268b2b};return _0x23855d;}else return null;})[_0xb39c('0x22')](respondWithResult(_0x350148,null))[_0xb39c('0x55')](handleError(_0x350148,null));};exports[_0xb39c('0xc4')]=function(_0x13d4b8,_0x514bee){var _0x4a1ed1={};return db[_0xb39c('0x3a')][_0xb39c('0xc5')]({'where':{'id':_0x13d4b8[_0xb39c('0x57')]['id']}})[_0xb39c('0x22')](function(_0x2af0f5){if(!_0x2af0f5){throw new APINotFoundError(util['format'](_0xb39c('0xc6'),_0x13d4b8[_0xb39c('0x57')]['id']));}return contacts[_0xb39c('0xc7')]();})[_0xb39c('0x22')](function(_0x23f88e){_0x13d4b8[_0xb39c('0x44')][_0xb39c('0x3a')]=_0x13d4b8['params']['id'];_0x4a1ed1=qs[_0xb39c('0x58')](_0x23f88e,_0x13d4b8);if(_0x13d4b8[_0xb39c('0x44')][_0xb39c('0xc8')]('includeAll')){_0x4a1ed1[_0xb39c('0x48')]=[{'model':db['CmList'],'as':_0xb39c('0xc9'),'required':![]},{'model':db[_0xb39c('0xca')],'as':'Tags','attributes':['id',_0xb39c('0x34'),_0xb39c('0xcb')],'where':_0x13d4b8[_0xb39c('0x44')][_0xb39c('0xcc')]?{'id':_0x13d4b8[_0xb39c('0x44')][_0xb39c('0xcc')]}:undefined,'required':_0x13d4b8[_0xb39c('0x44')][_0xb39c('0xcc')]?!![]:![]}];}return contacts['findAll'](_0x13d4b8[_0xb39c('0x44')],_0x13d4b8['user'],_0x4a1ed1,_0x23f88e);})[_0xb39c('0x22')](respondWithFilteredResult(_0x514bee,_0x4a1ed1))[_0xb39c('0x55')](APIHandleError(_0x514bee));};exports['getQueues']=function(_0x56af57,_0x16d2b9){var _0x65debe;var _0x1e0391={};var _0x8bf788;return db[_0xb39c('0x3a')][_0xb39c('0xc5')]({'where':{'id':_0x56af57[_0xb39c('0x57')]['id']},'attributes':['id',_0xb39c('0x34'),_0xb39c('0x23')]})[_0xb39c('0x22')](handleEntityNotFound(_0x16d2b9,null))['then'](function(_0xe20459){if(!utils[_0xb39c('0x9c')](_0x56af57[_0xb39c('0x44')][_0xb39c('0x98')])){throw new db['Sequelize']['ValidationError'](_0xb39c('0x9d'));}_0x65debe=_0xe20459;var _0x43b54a={};_0x43b54a[_0xb39c('0xcd')]=_[_0xb39c('0xce')](db[_[_0xb39c('0x9f')](_0x56af57[_0xb39c('0x44')][_0xb39c('0x98')])+_0xb39c('0xcf')][_0xb39c('0x3b')]);_0x43b54a[_0xb39c('0x44')]=_[_0xb39c('0xce')](_0x56af57['query']);_0x43b54a[_0xb39c('0xd0')]=_['intersection'](_0x43b54a[_0xb39c('0xcd')],_0x43b54a[_0xb39c('0x44')]);_0x1e0391[_0xb39c('0x4a')]=_[_0xb39c('0xd1')](_0x43b54a['model'],qs[_0xb39c('0xd2')](_0x56af57[_0xb39c('0x44')][_0xb39c('0xd2')]));_0x1e0391[_0xb39c('0x4a')]=_0x1e0391[_0xb39c('0x4a')][_0xb39c('0x4e')]?_0x1e0391[_0xb39c('0x4a')]:_0x43b54a[_0xb39c('0xcd')];_0x1e0391[_0xb39c('0xd3')]=qs['sort'](_0x56af57[_0xb39c('0x44')]['sort']);_0x1e0391[_0xb39c('0x43')]=qs[_0xb39c('0xd0')](_[_0xb39c('0xd4')](_0x56af57[_0xb39c('0x44')],_0x43b54a[_0xb39c('0xd0')]));if(_0x56af57[_0xb39c('0x44')][_0xb39c('0x2e')]){_0x1e0391[_0xb39c('0x43')]=_[_0xb39c('0x59')](_0x1e0391[_0xb39c('0x43')],{'$or':_[_0xb39c('0x30')](_0x1e0391[_0xb39c('0x4a')],function(_0x372f8f){var _0x3eb918={};_0x3eb918[_0x372f8f]={'$like':'%'+_0x56af57[_0xb39c('0x44')][_0xb39c('0x2e')]+'%'};return _0x3eb918;})});}_0x1e0391=_[_0xb39c('0x59')]({},_0x1e0391,_0x56af57[_0xb39c('0x5a')]);switch(_0x65debe['role']){case _0xb39c('0x28'):return db[_[_0xb39c('0x9f')](_0x56af57[_0xb39c('0x44')][_0xb39c('0x98')])+_0xb39c('0xcf')][_0xb39c('0xa7')](_0x1e0391);case'user':case _0xb39c('0x24'):return _0x65debe[_0xb39c('0x27')+_['capitalize'](_0x56af57[_0xb39c('0x44')][_0xb39c('0x98')])+_0xb39c('0xa0')](_0x1e0391);default:throw new db[(_0xb39c('0x8d'))]['ValidationError'](_0xb39c('0xd5'));}})[_0xb39c('0x22')](function(_0x23d099){_0x8bf788=_0x23d099[_0xb39c('0x4e')];if(!_0x56af57[_0xb39c('0x44')][_0xb39c('0xc8')](_0xb39c('0xd6'))){_0x1e0391[_0xb39c('0x1c')]=qs[_0xb39c('0x1c')](_0x56af57['query'][_0xb39c('0x1c')]);_0x1e0391[_0xb39c('0x1b')]=qs[_0xb39c('0x1b')](_0x56af57[_0xb39c('0x44')]['offset']);}switch(_0x65debe['role']){case _0xb39c('0x28'):return db[_[_0xb39c('0x9f')](_0x56af57[_0xb39c('0x44')][_0xb39c('0x98')])+_0xb39c('0xcf')][_0xb39c('0xa7')](_0x1e0391);case'user':case _0xb39c('0x24'):return _0x65debe[_0xb39c('0x27')+_[_0xb39c('0x9f')](_0x56af57[_0xb39c('0x44')][_0xb39c('0x98')])+_0xb39c('0xa0')](_0x1e0391);}})['then'](function(_0x52d36b){return{'count':_0x8bf788,'rows':_0x52d36b};})[_0xb39c('0x22')](respondWithResult(_0x16d2b9,null))['catch'](handleError(_0x16d2b9,null));};exports['getVoiceQueuesRt']=function(_0x2794ea,_0x20178a){var _0x124c75={};var _0x4554e7={};var _0x23a766;var _0x4f5001;return db[_0xb39c('0x3a')][_0xb39c('0xc5')]({'where':{'id':_0x2794ea[_0xb39c('0x57')]['id']}})[_0xb39c('0x22')](handleEntityNotFound(_0x20178a,null))['then'](function(_0x42a75c){if(_0x42a75c){_0x23a766=_0x42a75c;_0x4554e7[_0xb39c('0xcd')]=_['keys'](db[_0xb39c('0xab')]['rawAttributes']);_0x4554e7[_0xb39c('0x44')]=_['keys'](_0x2794ea[_0xb39c('0x44')]);_0x4554e7[_0xb39c('0xd0')]=_[_0xb39c('0xd1')](_0x4554e7[_0xb39c('0xcd')],_0x4554e7[_0xb39c('0x44')]);_0x124c75['attributes']=_[_0xb39c('0xd1')](_0x4554e7[_0xb39c('0xcd')],qs[_0xb39c('0xd2')](_0x2794ea[_0xb39c('0x44')][_0xb39c('0xd2')]));_0x124c75[_0xb39c('0x4a')]=_0x124c75[_0xb39c('0x4a')]['length']?_0x124c75[_0xb39c('0x4a')]:_0x4554e7[_0xb39c('0xcd')];_0x124c75[_0xb39c('0xd3')]=qs[_0xb39c('0xd7')](_0x2794ea[_0xb39c('0x44')][_0xb39c('0xd7')]);_0x124c75[_0xb39c('0x43')]=qs[_0xb39c('0xd0')](_[_0xb39c('0xd4')](_0x2794ea['query'],_0x4554e7[_0xb39c('0xd0')]));if(_0x2794ea[_0xb39c('0x44')][_0xb39c('0x2e')]){_0x124c75[_0xb39c('0x43')]=_[_0xb39c('0x59')](_0x124c75['where'],{'$or':_[_0xb39c('0x30')](_0x124c75[_0xb39c('0x4a')],function(_0x179219){var _0x23b461={};_0x23b461[_0x179219]={'$like':'%'+_0x2794ea[_0xb39c('0x44')]['filter']+'%'};return _0x23b461;})});}_0x124c75=_[_0xb39c('0x59')]({},_0x124c75,_0x2794ea['options']);return _0x23a766[_0xb39c('0xd8')](_0x124c75);}})[_0xb39c('0x22')](function(_0x339c47){if(_0x339c47){_0x4f5001=_0x339c47[_0xb39c('0x4e')];if(!_0x2794ea['query'][_0xb39c('0xc8')](_0xb39c('0xd6'))){_0x124c75['limit']=qs[_0xb39c('0x1c')](_0x2794ea[_0xb39c('0x44')][_0xb39c('0x1c')]);_0x124c75[_0xb39c('0x1b')]=qs[_0xb39c('0x1b')](_0x2794ea[_0xb39c('0x44')]['offset']);}return _0x23a766[_0xb39c('0xd8')](_0x124c75);}})['then'](function(_0x310502){if(_0x310502){return _0x310502?{'count':_0x4f5001,'rows':_0x310502}:null;}})['then'](respondWithResult(_0x20178a,null))[_0xb39c('0x55')](handleError(_0x20178a,null));};exports['getGroups']=function(_0xb7266a,_0x534020){var _0x1676ec={};var _0x5595b2={};var _0xf91113;var _0x59893d;return db[_0xb39c('0x3a')][_0xb39c('0xc5')]({'where':{'id':_0xb7266a[_0xb39c('0x57')]['id']}})[_0xb39c('0x22')](handleEntityNotFound(_0x534020,null))[_0xb39c('0x22')](function(_0xc854bd){if(_0xc854bd){_0xf91113=_0xc854bd;_0x5595b2[_0xb39c('0xcd')]=_[_0xb39c('0xce')](db[_0xb39c('0xd9')][_0xb39c('0x3b')]);_0x5595b2[_0xb39c('0x44')]=_[_0xb39c('0xce')](_0xb7266a[_0xb39c('0x44')]);_0x5595b2[_0xb39c('0xd0')]=_[_0xb39c('0xd1')](_0x5595b2['model'],_0x5595b2['query']);_0x1676ec[_0xb39c('0x4a')]=_[_0xb39c('0xd1')](_0x5595b2[_0xb39c('0xcd')],qs[_0xb39c('0xd2')](_0xb7266a['query'][_0xb39c('0xd2')]));_0x1676ec[_0xb39c('0x4a')]=_0x1676ec[_0xb39c('0x4a')][_0xb39c('0x4e')]?_0x1676ec[_0xb39c('0x4a')]:_0x5595b2[_0xb39c('0xcd')];_0x1676ec['order']=qs[_0xb39c('0xd7')](_0xb7266a[_0xb39c('0x44')][_0xb39c('0xd7')]);_0x1676ec[_0xb39c('0x43')]=qs[_0xb39c('0xd0')](_[_0xb39c('0xd4')](_0xb7266a['query'],_0x5595b2[_0xb39c('0xd0')]));if(_0xb7266a[_0xb39c('0x44')][_0xb39c('0x2e')]){_0x1676ec[_0xb39c('0x43')]=_[_0xb39c('0x59')](_0x1676ec[_0xb39c('0x43')],{'$or':_[_0xb39c('0x30')](_0x1676ec[_0xb39c('0x4a')],function(_0x46b902){var _0x4e7bb3={};_0x4e7bb3[_0x46b902]={'$like':'%'+_0xb7266a['query'][_0xb39c('0x2e')]+'%'};return _0x4e7bb3;})});}_0x1676ec=_['merge']({},_0x1676ec,_0xb7266a[_0xb39c('0x5a')]);return _0xf91113[_0xb39c('0xda')](_0x1676ec);}})[_0xb39c('0x22')](function(_0x477c56){if(_0x477c56){_0x59893d=_0x477c56['length'];if(!_0xb7266a[_0xb39c('0x44')][_0xb39c('0xc8')](_0xb39c('0xd6'))){_0x1676ec['limit']=qs[_0xb39c('0x1c')](_0xb7266a[_0xb39c('0x44')]['limit']);_0x1676ec[_0xb39c('0x1b')]=qs[_0xb39c('0x1b')](_0xb7266a['query'][_0xb39c('0x1b')]);}return _0xf91113['getGroups'](_0x1676ec);}})[_0xb39c('0x22')](function(_0x1c2ab2){if(_0x1c2ab2){return _0x1c2ab2?{'count':_0x59893d,'rows':_0x1c2ab2}:null;}})[_0xb39c('0x22')](respondWithResult(_0x534020,null))['catch'](handleError(_0x534020,null));};exports[_0xb39c('0xdb')]=function(_0x3f52c8,_0xab3d19){var _0x587441={'raw':!![],'where':{}};var _0x50824a={};var _0x2af52e={'count':0x0,'rows':[]};return db[_0xb39c('0x3a')][_0xb39c('0xc5')]({'where':{'id':_0x3f52c8[_0xb39c('0x57')]['id']}})[_0xb39c('0x22')](handleEntityNotFound(_0xab3d19,null))[_0xb39c('0x22')](function(_0x30e68c){if(_0x30e68c){_0x50824a[_0xb39c('0xcd')]=_[_0xb39c('0xce')](db[_0xb39c('0xdc')][_0xb39c('0x3b')]);_0x50824a['query']=_[_0xb39c('0xce')](_0x3f52c8['query']);_0x50824a['filters']=_[_0xb39c('0xd1')](_0x50824a[_0xb39c('0xcd')],_0x50824a['query']);_0x587441[_0xb39c('0x4a')]=_[_0xb39c('0xd1')](_0x50824a['model'],qs[_0xb39c('0xd2')](_0x3f52c8[_0xb39c('0x44')][_0xb39c('0xd2')]));_0x587441[_0xb39c('0x4a')]=_0x587441[_0xb39c('0x4a')][_0xb39c('0x4e')]?_0x587441['attributes']:_0x50824a[_0xb39c('0xcd')];if(!_0x3f52c8[_0xb39c('0x44')]['hasOwnProperty'](_0xb39c('0xd6'))){_0x587441['limit']=qs[_0xb39c('0x1c')](_0x3f52c8[_0xb39c('0x44')][_0xb39c('0x1c')]);_0x587441[_0xb39c('0x1b')]=qs[_0xb39c('0x1b')](_0x3f52c8['query'][_0xb39c('0x1b')]);}_0x587441[_0xb39c('0xd3')]=qs[_0xb39c('0xd7')](_0x3f52c8[_0xb39c('0x44')][_0xb39c('0xd7')]);_0x587441['where']=qs[_0xb39c('0xd0')](_[_0xb39c('0xd4')](_0x3f52c8[_0xb39c('0x44')],_0x50824a[_0xb39c('0xd0')]));_0x587441[_0xb39c('0x43')][_0xb39c('0xdd')]=_0x30e68c['id'];if(_0x3f52c8[_0xb39c('0x44')]['filter']){_0x587441['where']=_['merge'](_0x587441['where'],{'$or':_['map'](_0x587441[_0xb39c('0x4a')],function(_0x35fbaa){var _0x533b4a={};_0x533b4a[_0x35fbaa]={'$like':'%'+_0x3f52c8[_0xb39c('0x44')]['filter']+'%'};return _0x533b4a;})});}_0x587441=_[_0xb39c('0x59')]({},_0x587441,_0x3f52c8['options']);return db[_0xb39c('0xdc')][_0xb39c('0x1e')]({'where':_0x587441[_0xb39c('0x43')]})[_0xb39c('0x22')](function(_0x1f6a34){_0x2af52e[_0xb39c('0x1e')]=_0x1f6a34;if(_0x3f52c8[_0xb39c('0x44')][_0xb39c('0x45')]){_0x587441[_0xb39c('0x48')]=[{'all':!![]}];}return db['VoiceRecording'][_0xb39c('0xa7')](_0x587441);})[_0xb39c('0x22')](function(_0x2cad99){_0x2af52e[_0xb39c('0x4c')]=_0x2cad99;return _0x2af52e;});}})[_0xb39c('0x22')](respondWithFilteredResult(_0xab3d19,_0x587441))[_0xb39c('0x55')](handleError(_0xab3d19,null));};exports[_0xb39c('0xde')]=function(_0x4b3650,_0x33f352){var _0x201e92={'raw':!![],'where':{}};var _0x45ff02={};var _0x4c9870={'count':0x0,'rows':[]};return db['User'][_0xb39c('0xc5')]({'where':{'id':_0x4b3650['params']['id']}})[_0xb39c('0x22')](handleEntityNotFound(_0x33f352,null))[_0xb39c('0x22')](function(_0x35b6bb){if(_0x35b6bb){_0x45ff02[_0xb39c('0xcd')]=_[_0xb39c('0xce')](db[_0xb39c('0xdf')][_0xb39c('0x3b')]);_0x45ff02[_0xb39c('0x44')]=_[_0xb39c('0xce')](_0x4b3650['query']);_0x45ff02[_0xb39c('0xd0')]=_[_0xb39c('0xd1')](_0x45ff02[_0xb39c('0xcd')],_0x45ff02[_0xb39c('0x44')]);_0x201e92['attributes']=_['intersection'](_0x45ff02[_0xb39c('0xcd')],qs[_0xb39c('0xd2')](_0x4b3650[_0xb39c('0x44')]['fields']));_0x201e92[_0xb39c('0x4a')]=_0x201e92['attributes'][_0xb39c('0x4e')]?_0x201e92[_0xb39c('0x4a')]:_0x45ff02[_0xb39c('0xcd')];if(!_0x4b3650[_0xb39c('0x44')][_0xb39c('0xc8')](_0xb39c('0xd6'))){_0x201e92[_0xb39c('0x1c')]=qs[_0xb39c('0x1c')](_0x4b3650[_0xb39c('0x44')][_0xb39c('0x1c')]);_0x201e92[_0xb39c('0x1b')]=qs[_0xb39c('0x1b')](_0x4b3650[_0xb39c('0x44')]['offset']);}_0x201e92[_0xb39c('0xd3')]=qs[_0xb39c('0xd7')](_0x4b3650[_0xb39c('0x44')]['sort']);_0x201e92[_0xb39c('0x43')]=qs[_0xb39c('0xd0')](_[_0xb39c('0xd4')](_0x4b3650[_0xb39c('0x44')],_0x45ff02[_0xb39c('0xd0')]));_0x201e92[_0xb39c('0x43')]['UserId']=_0x35b6bb['id'];if(_0x4b3650[_0xb39c('0x44')][_0xb39c('0x2e')]){_0x201e92[_0xb39c('0x43')]=_[_0xb39c('0x59')](_0x201e92[_0xb39c('0x43')],{'$or':_['map'](_0x201e92[_0xb39c('0x4a')],function(_0x24f95e){var _0x272158={};_0x272158[_0x24f95e]={'$like':'%'+_0x4b3650[_0xb39c('0x44')][_0xb39c('0x2e')]+'%'};return _0x272158;})});}_0x201e92=_[_0xb39c('0x59')]({},_0x201e92,_0x4b3650['options']);return db[_0xb39c('0xdf')][_0xb39c('0x1e')]({'where':_0x201e92[_0xb39c('0x43')]})[_0xb39c('0x22')](function(_0x3af825){_0x4c9870[_0xb39c('0x1e')]=_0x3af825;if(_0x4b3650[_0xb39c('0x44')][_0xb39c('0x45')]){_0x201e92['include']=[{'all':!![]}];}return db[_0xb39c('0xdf')]['findAll'](_0x201e92);})[_0xb39c('0x22')](function(_0x580fb5){_0x4c9870[_0xb39c('0x4c')]=_0x580fb5;return _0x4c9870;});}})['then'](respondWithFilteredResult(_0x33f352,_0x201e92))[_0xb39c('0x55')](handleError(_0x33f352,null));};exports[_0xb39c('0xe0')]=function(_0x354975,_0x2e9689){var _0x425f02={};var _0x1fa1f9={};var _0x462083;var _0x670cf0;return db[_0xb39c('0x3a')]['findOne']({'where':{'id':_0x354975[_0xb39c('0x57')]['id']}})['then'](handleEntityNotFound(_0x2e9689,null))[_0xb39c('0x22')](function(_0xde629f){if(_0xde629f){_0x462083=_0xde629f;_0x1fa1f9[_0xb39c('0xcd')]=_[_0xb39c('0xce')](db[_0xb39c('0xe1')][_0xb39c('0x3b')]);_0x1fa1f9[_0xb39c('0x44')]=_[_0xb39c('0xce')](_0x354975[_0xb39c('0x44')]);_0x1fa1f9[_0xb39c('0xd0')]=_[_0xb39c('0xd1')](_0x1fa1f9[_0xb39c('0xcd')],_0x1fa1f9[_0xb39c('0x44')]);_0x425f02[_0xb39c('0x4a')]=_[_0xb39c('0xd1')](_0x1fa1f9[_0xb39c('0xcd')],qs['fields'](_0x354975[_0xb39c('0x44')][_0xb39c('0xd2')]));_0x425f02[_0xb39c('0x4a')]=_0x425f02['attributes'][_0xb39c('0x4e')]?_0x425f02[_0xb39c('0x4a')]:_0x1fa1f9[_0xb39c('0xcd')];_0x425f02[_0xb39c('0xd3')]=qs[_0xb39c('0xd7')](_0x354975[_0xb39c('0x44')]['sort']);_0x425f02['where']=qs[_0xb39c('0xd0')](_[_0xb39c('0xd4')](_0x354975[_0xb39c('0x44')],_0x1fa1f9[_0xb39c('0xd0')]));if(_0x354975[_0xb39c('0x44')][_0xb39c('0x2e')]){_0x425f02[_0xb39c('0x43')]=_[_0xb39c('0x59')](_0x425f02[_0xb39c('0x43')],{'$or':_[_0xb39c('0x30')](_0x425f02[_0xb39c('0x4a')],function(_0x34fd8e){var _0x930a2={};_0x930a2[_0x34fd8e]={'$like':'%'+_0x354975[_0xb39c('0x44')]['filter']+'%'};return _0x930a2;})});}_0x425f02=_[_0xb39c('0x59')]({},_0x425f02,_0x354975[_0xb39c('0x5a')]);return _0x462083[_0xb39c('0xe0')](_0x425f02);}})[_0xb39c('0x22')](function(_0x2e076c){if(_0x2e076c){_0x670cf0=_0x2e076c[_0xb39c('0x4e')];if(!_0x354975['query'][_0xb39c('0xc8')](_0xb39c('0xd6'))){_0x425f02['limit']=qs[_0xb39c('0x1c')](_0x354975[_0xb39c('0x44')][_0xb39c('0x1c')]);_0x425f02[_0xb39c('0x1b')]=qs[_0xb39c('0x1b')](_0x354975[_0xb39c('0x44')]['offset']);}return _0x462083[_0xb39c('0xe0')](_0x425f02);}})[_0xb39c('0x22')](function(_0x129338){if(_0x129338){return _0x129338?{'count':_0x670cf0,'rows':_0x129338}:null;}})[_0xb39c('0x22')](respondWithResult(_0x2e9689,null))[_0xb39c('0x55')](handleError(_0x2e9689,null));};exports[_0xb39c('0xe2')]=function(_0xf2bb03,_0x1f5dd2){var _0x1cbc89={};var _0x48260a={};var _0x383016;var _0x499f77;return db[_0xb39c('0x3a')][_0xb39c('0xc5')]({'where':{'id':_0xf2bb03[_0xb39c('0x57')]['id']}})['then'](handleEntityNotFound(_0x1f5dd2,null))[_0xb39c('0x22')](function(_0x2cd06a){if(_0x2cd06a){_0x383016=_0x2cd06a;_0x48260a['model']=_[_0xb39c('0xce')](db['OpenchannelInteraction'][_0xb39c('0x3b')]);_0x48260a['query']=_[_0xb39c('0xce')](_0xf2bb03[_0xb39c('0x44')]);_0x48260a[_0xb39c('0xd0')]=_[_0xb39c('0xd1')](_0x48260a[_0xb39c('0xcd')],_0x48260a[_0xb39c('0x44')]);_0x1cbc89['attributes']=_['intersection'](_0x48260a[_0xb39c('0xcd')],qs[_0xb39c('0xd2')](_0xf2bb03['query']['fields']));_0x1cbc89[_0xb39c('0x4a')]=_0x1cbc89[_0xb39c('0x4a')][_0xb39c('0x4e')]?_0x1cbc89['attributes']:_0x48260a[_0xb39c('0xcd')];_0x1cbc89[_0xb39c('0xd3')]=qs[_0xb39c('0xd7')](_0xf2bb03['query'][_0xb39c('0xd7')]);_0x1cbc89['where']=qs[_0xb39c('0xd0')](_[_0xb39c('0xd4')](_0xf2bb03[_0xb39c('0x44')],_0x48260a[_0xb39c('0xd0')]));if(_0xf2bb03[_0xb39c('0x44')][_0xb39c('0x2e')]){_0x1cbc89['where']=_[_0xb39c('0x59')](_0x1cbc89[_0xb39c('0x43')],{'$or':_[_0xb39c('0x30')](_0x1cbc89['attributes'],function(_0x3e9d89){var _0x4d3dfa={};_0x4d3dfa[_0x3e9d89]={'$like':'%'+_0xf2bb03['query'][_0xb39c('0x2e')]+'%'};return _0x4d3dfa;})});}_0x1cbc89=_[_0xb39c('0x59')]({},_0x1cbc89,_0xf2bb03[_0xb39c('0x5a')]);return _0x383016[_0xb39c('0xe2')](_0x1cbc89);}})[_0xb39c('0x22')](function(_0x30570f){if(_0x30570f){_0x499f77=_0x30570f['length'];if(!_0xf2bb03[_0xb39c('0x44')][_0xb39c('0xc8')](_0xb39c('0xd6'))){_0x1cbc89[_0xb39c('0x1c')]=qs['limit'](_0xf2bb03[_0xb39c('0x44')][_0xb39c('0x1c')]);_0x1cbc89[_0xb39c('0x1b')]=qs[_0xb39c('0x1b')](_0xf2bb03[_0xb39c('0x44')][_0xb39c('0x1b')]);}return _0x383016[_0xb39c('0xe2')](_0x1cbc89);}})[_0xb39c('0x22')](function(_0x162ce9){if(_0x162ce9){return _0x162ce9?{'count':_0x499f77,'rows':_0x162ce9}:null;}})[_0xb39c('0x22')](respondWithResult(_0x1f5dd2,null))[_0xb39c('0x55')](handleError(_0x1f5dd2,null));};exports[_0xb39c('0xe3')]=function(_0x4305e6,_0x151d36){var _0x3fbee5={'raw':!![],'where':{}};var _0x2603ce={};var _0x12285e={'count':0x0,'rows':[]};return db[_0xb39c('0x3a')][_0xb39c('0xc5')]({'where':{'id':_0x4305e6[_0xb39c('0x57')]['id']}})[_0xb39c('0x22')](handleEntityNotFound(_0x151d36,null))[_0xb39c('0x22')](function(_0x5b38fa){if(_0x5b38fa){_0x2603ce[_0xb39c('0xcd')]=_[_0xb39c('0xce')](db[_0xb39c('0xe4')]['rawAttributes']);_0x2603ce[_0xb39c('0x44')]=_[_0xb39c('0xce')](_0x4305e6['query']);_0x2603ce[_0xb39c('0xd0')]=_[_0xb39c('0xd1')](_0x2603ce[_0xb39c('0xcd')],_0x2603ce[_0xb39c('0x44')]);_0x3fbee5[_0xb39c('0x4a')]=_[_0xb39c('0xd1')](_0x2603ce[_0xb39c('0xcd')],qs[_0xb39c('0xd2')](_0x4305e6[_0xb39c('0x44')]['fields']));_0x3fbee5[_0xb39c('0x4a')]=_0x3fbee5[_0xb39c('0x4a')][_0xb39c('0x4e')]?_0x3fbee5['attributes']:_0x2603ce[_0xb39c('0xcd')];if(!_0x4305e6[_0xb39c('0x44')][_0xb39c('0xc8')](_0xb39c('0xd6'))){_0x3fbee5['limit']=qs[_0xb39c('0x1c')](_0x4305e6['query'][_0xb39c('0x1c')]);_0x3fbee5[_0xb39c('0x1b')]=qs[_0xb39c('0x1b')](_0x4305e6[_0xb39c('0x44')][_0xb39c('0x1b')]);}_0x3fbee5[_0xb39c('0xd3')]=qs[_0xb39c('0xd7')](_0x4305e6[_0xb39c('0x44')][_0xb39c('0xd7')]);_0x3fbee5[_0xb39c('0x43')]=qs['filters'](_[_0xb39c('0xd4')](_0x4305e6[_0xb39c('0x44')],_0x2603ce[_0xb39c('0xd0')]));_0x3fbee5[_0xb39c('0x43')][_0xb39c('0xdd')]=_0x5b38fa['id'];if(_0x4305e6['query']['filter']){_0x3fbee5['where']=_[_0xb39c('0x59')](_0x3fbee5['where'],{'$or':_[_0xb39c('0x30')](_0x3fbee5['attributes'],function(_0x3d5c43){var _0x2eba15={};_0x2eba15[_0x3d5c43]={'$like':'%'+_0x4305e6[_0xb39c('0x44')][_0xb39c('0x2e')]+'%'};return _0x2eba15;})});}_0x3fbee5=_[_0xb39c('0x59')]({},_0x3fbee5,_0x4305e6['options']);return db['MailInteraction'][_0xb39c('0x1e')]({'where':_0x3fbee5[_0xb39c('0x43')]})[_0xb39c('0x22')](function(_0x189432){_0x12285e[_0xb39c('0x1e')]=_0x189432;if(_0x4305e6[_0xb39c('0x44')]['includeAll']){_0x3fbee5['include']=[{'all':!![]}];}return db[_0xb39c('0xe4')][_0xb39c('0xa7')](_0x3fbee5);})[_0xb39c('0x22')](function(_0x277399){_0x12285e[_0xb39c('0x4c')]=_0x277399;return _0x12285e;});}})[_0xb39c('0x22')](respondWithFilteredResult(_0x151d36,_0x3fbee5))['catch'](handleError(_0x151d36,null));};exports[_0xb39c('0xe5')]=function(_0x453c34,_0x174f25){var _0x392cfe={};var _0x4064b9={};var _0x3ffff6;var _0x8f9cbc;return db[_0xb39c('0x3a')]['findOne']({'where':{'id':_0x453c34[_0xb39c('0x57')]['id']}})[_0xb39c('0x22')](handleEntityNotFound(_0x174f25,null))[_0xb39c('0x22')](function(_0xc5958a){if(_0xc5958a){_0x3ffff6=_0xc5958a;_0x4064b9['model']=_['keys'](db[_0xb39c('0xe6')][_0xb39c('0x3b')]);_0x4064b9[_0xb39c('0x44')]=_[_0xb39c('0xce')](_0x453c34[_0xb39c('0x44')]);_0x4064b9[_0xb39c('0xd0')]=_[_0xb39c('0xd1')](_0x4064b9[_0xb39c('0xcd')],_0x4064b9['query']);_0x392cfe[_0xb39c('0x4a')]=_[_0xb39c('0xd1')](_0x4064b9[_0xb39c('0xcd')],qs[_0xb39c('0xd2')](_0x453c34[_0xb39c('0x44')][_0xb39c('0xd2')]));_0x392cfe['attributes']=_0x392cfe[_0xb39c('0x4a')]['length']?_0x392cfe[_0xb39c('0x4a')]:_0x4064b9[_0xb39c('0xcd')];_0x392cfe[_0xb39c('0xd3')]=qs[_0xb39c('0xd7')](_0x453c34[_0xb39c('0x44')][_0xb39c('0xd7')]);_0x392cfe[_0xb39c('0x43')]=qs[_0xb39c('0xd0')](_['pick'](_0x453c34[_0xb39c('0x44')],_0x4064b9[_0xb39c('0xd0')]));if(_0x453c34[_0xb39c('0x44')][_0xb39c('0x2e')]){_0x392cfe[_0xb39c('0x43')]=_[_0xb39c('0x59')](_0x392cfe[_0xb39c('0x43')],{'$or':_['map'](_0x392cfe[_0xb39c('0x4a')],function(_0x4e5c7d){var _0xfa102b={};_0xfa102b[_0x4e5c7d]={'$like':'%'+_0x453c34[_0xb39c('0x44')]['filter']+'%'};return _0xfa102b;})});}_0x392cfe=_[_0xb39c('0x59')]({},_0x392cfe,_0x453c34[_0xb39c('0x5a')]);return _0x3ffff6[_0xb39c('0xe5')](_0x392cfe);}})[_0xb39c('0x22')](function(_0x49758e){if(_0x49758e){_0x8f9cbc=_0x49758e[_0xb39c('0x4e')];if(!_0x453c34[_0xb39c('0x44')][_0xb39c('0xc8')](_0xb39c('0xd6'))){_0x392cfe[_0xb39c('0x1c')]=qs['limit'](_0x453c34[_0xb39c('0x44')]['limit']);_0x392cfe['offset']=qs[_0xb39c('0x1b')](_0x453c34[_0xb39c('0x44')][_0xb39c('0x1b')]);}return _0x3ffff6['getSmsInteractions'](_0x392cfe);}})['then'](function(_0x4f444b){if(_0x4f444b){return _0x4f444b?{'count':_0x8f9cbc,'rows':_0x4f444b}:null;}})[_0xb39c('0x22')](respondWithResult(_0x174f25,null))[_0xb39c('0x55')](handleError(_0x174f25,null));};exports['getFaxInteractions']=function(_0x1fe730,_0x4683bc){var _0x1f56f5={};var _0x44d96e={};var _0x46839d;var _0x4489d0;return db['User'][_0xb39c('0xc5')]({'where':{'id':_0x1fe730[_0xb39c('0x57')]['id']}})[_0xb39c('0x22')](handleEntityNotFound(_0x4683bc,null))[_0xb39c('0x22')](function(_0x4a5b6e){if(_0x4a5b6e){_0x46839d=_0x4a5b6e;_0x44d96e[_0xb39c('0xcd')]=_[_0xb39c('0xce')](db[_0xb39c('0xe7')][_0xb39c('0x3b')]);_0x44d96e['query']=_[_0xb39c('0xce')](_0x1fe730[_0xb39c('0x44')]);_0x44d96e['filters']=_['intersection'](_0x44d96e['model'],_0x44d96e['query']);_0x1f56f5[_0xb39c('0x4a')]=_['intersection'](_0x44d96e['model'],qs[_0xb39c('0xd2')](_0x1fe730[_0xb39c('0x44')]['fields']));_0x1f56f5[_0xb39c('0x4a')]=_0x1f56f5[_0xb39c('0x4a')][_0xb39c('0x4e')]?_0x1f56f5[_0xb39c('0x4a')]:_0x44d96e[_0xb39c('0xcd')];_0x1f56f5['order']=qs[_0xb39c('0xd7')](_0x1fe730[_0xb39c('0x44')][_0xb39c('0xd7')]);_0x1f56f5['where']=qs[_0xb39c('0xd0')](_[_0xb39c('0xd4')](_0x1fe730[_0xb39c('0x44')],_0x44d96e['filters']));if(_0x1fe730['query'][_0xb39c('0x2e')]){_0x1f56f5[_0xb39c('0x43')]=_[_0xb39c('0x59')](_0x1f56f5['where'],{'$or':_[_0xb39c('0x30')](_0x1f56f5[_0xb39c('0x4a')],function(_0xe167cf){var _0x29feae={};_0x29feae[_0xe167cf]={'$like':'%'+_0x1fe730[_0xb39c('0x44')][_0xb39c('0x2e')]+'%'};return _0x29feae;})});}_0x1f56f5=_[_0xb39c('0x59')]({},_0x1f56f5,_0x1fe730['options']);return _0x46839d[_0xb39c('0xe8')](_0x1f56f5);}})[_0xb39c('0x22')](function(_0x2f1504){if(_0x2f1504){_0x4489d0=_0x2f1504['length'];if(!_0x1fe730[_0xb39c('0x44')]['hasOwnProperty'](_0xb39c('0xd6'))){_0x1f56f5[_0xb39c('0x1c')]=qs['limit'](_0x1fe730['query'][_0xb39c('0x1c')]);_0x1f56f5['offset']=qs[_0xb39c('0x1b')](_0x1fe730[_0xb39c('0x44')][_0xb39c('0x1b')]);}return _0x46839d[_0xb39c('0xe8')](_0x1f56f5);}})[_0xb39c('0x22')](function(_0xfa43e6){if(_0xfa43e6){return _0xfa43e6?{'count':_0x4489d0,'rows':_0xfa43e6}:null;}})[_0xb39c('0x22')](respondWithResult(_0x4683bc,null))[_0xb39c('0x55')](handleError(_0x4683bc,null));};exports[_0xb39c('0xe9')]=function(_0x47b409,_0x3fc8bd){var _0x5b0d84={};var _0x3c8dac={};var _0x21c626;var _0x4652e3;return db[_0xb39c('0x3a')][_0xb39c('0xc5')]({'where':{'id':_0x47b409[_0xb39c('0x57')]['id']}})[_0xb39c('0x22')](handleEntityNotFound(_0x3fc8bd,null))[_0xb39c('0x22')](function(_0x434c6d){if(_0x434c6d){_0x21c626=_0x434c6d;_0x3c8dac['model']=_['keys'](db['WhatsappInteraction'][_0xb39c('0x3b')]);_0x3c8dac[_0xb39c('0x44')]=_['keys'](_0x47b409[_0xb39c('0x44')]);_0x3c8dac[_0xb39c('0xd0')]=_['intersection'](_0x3c8dac[_0xb39c('0xcd')],_0x3c8dac[_0xb39c('0x44')]);_0x5b0d84[_0xb39c('0x4a')]=_['intersection'](_0x3c8dac[_0xb39c('0xcd')],qs[_0xb39c('0xd2')](_0x47b409[_0xb39c('0x44')][_0xb39c('0xd2')]));_0x5b0d84[_0xb39c('0x4a')]=_0x5b0d84[_0xb39c('0x4a')]['length']?_0x5b0d84[_0xb39c('0x4a')]:_0x3c8dac[_0xb39c('0xcd')];_0x5b0d84[_0xb39c('0xd3')]=qs[_0xb39c('0xd7')](_0x47b409[_0xb39c('0x44')][_0xb39c('0xd7')]);_0x5b0d84[_0xb39c('0x43')]=qs[_0xb39c('0xd0')](_['pick'](_0x47b409[_0xb39c('0x44')],_0x3c8dac['filters']));if(_0x47b409[_0xb39c('0x44')][_0xb39c('0x2e')]){_0x5b0d84[_0xb39c('0x43')]=_[_0xb39c('0x59')](_0x5b0d84[_0xb39c('0x43')],{'$or':_[_0xb39c('0x30')](_0x5b0d84[_0xb39c('0x4a')],function(_0x534ddc){var _0x2afc38={};_0x2afc38[_0x534ddc]={'$like':'%'+_0x47b409[_0xb39c('0x44')][_0xb39c('0x2e')]+'%'};return _0x2afc38;})});}_0x5b0d84=_[_0xb39c('0x59')]({},_0x5b0d84,_0x47b409[_0xb39c('0x5a')]);return _0x21c626[_0xb39c('0xe9')](_0x5b0d84);}})['then'](function(_0x185320){if(_0x185320){_0x4652e3=_0x185320[_0xb39c('0x4e')];if(!_0x47b409['query'][_0xb39c('0xc8')](_0xb39c('0xd6'))){_0x5b0d84[_0xb39c('0x1c')]=qs[_0xb39c('0x1c')](_0x47b409[_0xb39c('0x44')][_0xb39c('0x1c')]);_0x5b0d84[_0xb39c('0x1b')]=qs[_0xb39c('0x1b')](_0x47b409[_0xb39c('0x44')]['offset']);}return _0x21c626[_0xb39c('0xe9')](_0x5b0d84);}})[_0xb39c('0x22')](function(_0x480284){if(_0x480284){return _0x480284?{'count':_0x4652e3,'rows':_0x480284}:null;}})['then'](respondWithResult(_0x3fc8bd,null))['catch'](handleError(_0x3fc8bd,null));};exports[_0xb39c('0xea')]=function(_0xcde79f,_0x38e1ee,_0x219bcc){var _0x248b2f;var _0x214051;var _0x304d52;var _0x366d99=!_[_0xb39c('0x66')](_0xcde79f[_0xb39c('0x57')]['id'])?_0xcde79f[_0xb39c('0x57')]['id']:!_['isNil'](_0xcde79f[_0xb39c('0x2a')]['id'])?_0xcde79f[_0xb39c('0x2a')]['id']:null;return db[_0xb39c('0x3a')][_0xb39c('0x33')]({'where':{'id':_0x366d99,'role':{'$or':[_0xb39c('0x28'),'user',_0xb39c('0x24')]}},'attributes':['id',_0xb39c('0x34'),_0xb39c('0xeb'),_0xb39c('0xec'),'role',_0xb39c('0x60'),'loginInPause']})['then'](function(_0x1f34d1){if(_0x1f34d1){if(_0x1f34d1[_0xb39c('0x23')]==='agent'){_0x248b2f=_0x1f34d1;if(_0xcde79f[_0xb39c('0x5c')]['interface']){_0x304d52=util['format'](_0xb39c('0xed'),_0x248b2f[_0xcde79f[_0xb39c('0x5c')]['interface']]);}else if(_0xcde79f[_0xb39c('0x5c')][_0xb39c('0xee')]){_0x304d52=util['format']('SIP/%s',_0xcde79f[_0xb39c('0x5c')][_0xb39c('0xee')]);}else{_0x304d52=util[_0xb39c('0xa9')](_0xb39c('0xaa'),_0x248b2f['name']);}socket['to'](util[_0xb39c('0xa9')](_0xb39c('0xef'),_0x248b2f[_0xb39c('0x34')]))[_0xb39c('0x25')]('user:forcelogout',{'user':{'id':_0x248b2f['id'],'name':_0x248b2f[_0xb39c('0x34')]},'ip':_0xcde79f['headers'][_0xb39c('0xf0')]||_0xcde79f[_0xb39c('0xf1')][_0xb39c('0xf2')]||_0xcde79f[_0xb39c('0xf3')][_0xb39c('0xf2')]||_0xcde79f[_0xb39c('0xf1')]['socket'][_0xb39c('0xf2')]});return db[_0xb39c('0xab')][_0xb39c('0x26')]({'where':{'membername':_0x248b2f[_0xb39c('0x34')]},'individualHooks':!![]});}}else{throw new db[(_0xb39c('0x8d'))][(_0xb39c('0x8e'))](_0xb39c('0xf4'));}})[_0xb39c('0x22')](function(){if(_0x248b2f){return _0x248b2f[_0xb39c('0xf5')]({'raw':!![]});}})[_0xb39c('0x22')](function(_0x3ce95d){if(_0x248b2f){if(_0x3ce95d){_0x214051=_0x3ce95d;if(_0x214051[_0xb39c('0x4e')]){var _0x563c6f=_0x214051[_0xb39c('0x30')](function(_0x3b1a6f){var _0x895155={'membername':_0x248b2f[_0xb39c('0x34')],'UserId':_0x248b2f['id'],'queue_name':_0x3b1a6f['name'],'VoiceQueueId':_0x3b1a6f['id'],'interface':_0x304d52,'paused':_0x248b2f[_0xb39c('0xf6')]||![],'penalty':_0x3b1a6f['UserVoiceQueue.penalty']||0x0};return db[_0xb39c('0xab')][_0xb39c('0xac')](_0x895155);});return Promise['all'](_0x563c6f);}}}})[_0xb39c('0x22')](function(){if(_0x248b2f){return db[_0xb39c('0xf7')][_0xb39c('0xa7')]({'where':{'membername':_0x248b2f['name'],'exitAt':null}});}})[_0xb39c('0x22')](function(_0x55b4a6){if(_0x248b2f){var _0x112f8e=[];_0x55b4a6[_0xb39c('0xf8')](function(_0x40b588){_0x112f8e[_0xb39c('0x4b')](_0x40b588[_0xb39c('0x21')]({'exitAt':moment()[_0xb39c('0xa9')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xb39c('0x5b')](_0x112f8e);}})['then'](function(){if(_0x248b2f){var _0x3eb101=[];var _0xa3b107=[];var _0x36342f=utils['getChannels']();var _0x2d8f49={'membername':_0x248b2f[_0xb39c('0x34')],'interface':_0x304d52,'enterAt':moment()[_0xb39c('0xa9')](_0xb39c('0xf9')),'role':_0x248b2f[_0xb39c('0x23')],'internal':_0x248b2f[_0xb39c('0x60')]};_0x36342f[_0xb39c('0xf8')](function(_0x4c7b44){_0x3eb101['push'](_['merge']({'channel':_0x4c7b44,'type':_0xb39c('0xfa'),'data1':_0xcde79f[_0xb39c('0x5c')][_0xb39c('0xfb')],'data2':_0x304d52},_0x2d8f49));if(_0x248b2f[_0xb39c('0xf6')]){_0xa3b107['push'](_[_0xb39c('0x59')]({'channel':_0x4c7b44,'type':_0xb39c('0xfc'),'data1':_0xb39c('0xfd')},_0x2d8f49));}});return db[_0xb39c('0xf7')][_0xb39c('0xfe')](_0x3eb101[_0xb39c('0xc3')](_0xa3b107),{'individualHooks':!![]});}})['then'](function(){if(_0x248b2f){return _0x248b2f[_0xb39c('0x21')]({'online':!![],'lastLoginAt':moment()[_0xb39c('0xa9')](_0xb39c('0xf9')),'voicePause':_0x248b2f[_0xb39c('0xf6')]||![],'mailPause':_0x248b2f[_0xb39c('0xf6')]||![],'chatPause':_0x248b2f[_0xb39c('0xf6')]||![],'faxPause':_0x248b2f[_0xb39c('0xf6')]||![],'smsPause':_0x248b2f[_0xb39c('0xf6')]||![],'openchannelPause':_0x248b2f['loginInPause']||![],'whatsappPause':_0x248b2f[_0xb39c('0xf6')]||![],'pauseType':_0x248b2f[_0xb39c('0xf6')]?_0xb39c('0xfd'):null,'interface':_0x304d52,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xb39c('0x22')](function(_0x1bffb6){if(_0xcde79f[_0xb39c('0xff')]){return _0x219bcc();}else{return Promise[_0xb39c('0x100')](_0x1bffb6)[_0xb39c('0x22')](respondWithResult(_0x38e1ee,null));}})[_0xb39c('0x55')](handleError(_0x38e1ee,null));};exports[_0xb39c('0x101')]=function(_0x253bf3,_0x3f8ea7){var _0x5d2e42;return db['User']['find']({'where':{'id':_0x253bf3['params']['id'],'role':'agent'},'attributes':['id',_0xb39c('0x34'),_0xb39c('0x23')]})['then'](handleEntityNotFound(_0x3f8ea7,null))[_0xb39c('0x22')](function(_0x3f6a6a){if(_0x3f6a6a){_0x5d2e42=_0x3f6a6a;return db[_0xb39c('0xab')]['destroy']({'where':{'membername':_0x5d2e42[_0xb39c('0x34')]},'individualHooks':!![]});}})[_0xb39c('0x22')](function(){return db[_0xb39c('0xf7')][_0xb39c('0xa7')]({'where':{'membername':_0x5d2e42[_0xb39c('0x34')],'exitAt':null}});})['then'](function(_0x39119b){var _0x25f3b5=[];_0x39119b[_0xb39c('0xf8')](function(_0x2620a3){_0x25f3b5[_0xb39c('0x4b')](_0x2620a3['update']({'exitAt':moment()[_0xb39c('0xa9')](_0xb39c('0xf9'))}));});return Promise[_0xb39c('0x5b')](_0x25f3b5);})[_0xb39c('0x22')](function(){return _0x5d2e42[_0xb39c('0x21')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x3f8ea7,null))[_0xb39c('0x55')](handleError(_0x3f8ea7,null));};exports[_0xb39c('0x102')]=function(_0x31cd2b,_0x3ab927){var _0x12baf6;return db[_0xb39c('0xab')][_0xb39c('0x21')]({'paused':0x1},{'where':{'UserId':_0x31cd2b[_0xb39c('0x57')]['id']},'individualHooks':!![]})['then'](function(){return db[_0xb39c('0x3a')][_0xb39c('0x33')]({'where':{'id':_0x31cd2b[_0xb39c('0x57')]['id'],'role':_0xb39c('0x24')},'attributes':['id',_0xb39c('0x34'),'role',_0xb39c('0x60'),_0xb39c('0x9b'),'online']});})[_0xb39c('0x22')](handleEntityNotFound(_0x3ab927,null))['then'](function(_0x94c98e){if(_0x94c98e){_0x12baf6=_0x94c98e;return db[_0xb39c('0xf7')][_0xb39c('0xa7')]({'where':{'membername':_0x12baf6[_0xb39c('0x34')],'type':'PAUSE','exitAt':null}});}})[_0xb39c('0x22')](function(_0x3d7897){if(_0x3d7897[_0xb39c('0x4e')]){var _0xf41cb3=moment()[_0xb39c('0xa9')](_0xb39c('0xf9'));for(var _0x2ab90a=0x0,_0x1a32ae=_0x3d7897[_0xb39c('0x4e')];_0x2ab90a<_0x1a32ae;_0x2ab90a++){_0x3d7897[_0x2ab90a][_0xb39c('0x103')]({'exitAt':_0xf41cb3});}}})[_0xb39c('0x22')](function(){var _0x5a322e=[];var _0x15b051=utils[_0xb39c('0x104')]();_0x15b051[_0xb39c('0xf8')](function(_0x9d242a){_0x5a322e[_0xb39c('0x4b')]({'channel':_0x9d242a,'membername':_0x12baf6[_0xb39c('0x34')],'interface':_['isNil'](_0x12baf6['interface'])?util[_0xb39c('0xa9')](_0xb39c('0xaa'),_0x12baf6[_0xb39c('0x34')]):_0x12baf6['interface'],'type':_0xb39c('0xfc'),'enterAt':moment()[_0xb39c('0xa9')](_0xb39c('0xf9')),'data1':_0x31cd2b[_0xb39c('0x5c')][_0xb39c('0x3d')]||'DEFAULT\x20PAUSE','role':_0x12baf6['role'],'internal':_0x12baf6[_0xb39c('0x60')]});});return db[_0xb39c('0xf7')][_0xb39c('0xfe')](_0x5a322e,{'individualHooks':!![]});})[_0xb39c('0x22')](function(){return _0x12baf6[_0xb39c('0x21')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x31cd2b[_0xb39c('0x5c')][_0xb39c('0x3d')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0xb39c('0xf9'))});})[_0xb39c('0x22')](respondWithResult(_0x3ab927,null))[_0xb39c('0x55')](handleError(_0x3ab927,null));};exports[_0xb39c('0x105')]=function(_0x223c74,_0x54e7fb){if(_0x223c74[_0xb39c('0x5c')][_0xb39c('0x98')]&&!utils[_0xb39c('0x9c')](_0x223c74[_0xb39c('0x5c')][_0xb39c('0x98')])){throw new APIBadRequestError(util[_0xb39c('0xa9')](_0xb39c('0x106'),_0x223c74['body'][_0xb39c('0x98')]));}return db[_0xb39c('0x3a')]['find']({'where':{'id':_0x223c74[_0xb39c('0x57')]['id']},'attributes':['id','name',_0xb39c('0x23'),_0xb39c('0x60'),_0xb39c('0x9b'),_0xb39c('0x99'),_0xb39c('0x9a'),_0xb39c('0x107'),_0xb39c('0x108'),_0xb39c('0x109'),_0xb39c('0x10a'),'smsPause',_0xb39c('0x10b'),_0xb39c('0x10c'),_0xb39c('0x10d')]})[_0xb39c('0x22')](function(_0x322309){if(!_0x322309){throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x223c74['params']['id']));}return _0x322309['unpause'](_0x223c74[_0xb39c('0x5c')][_0xb39c('0x98')]);})[_0xb39c('0x22')](respondWithResult(_0x54e7fb,null))[_0xb39c('0x55')](APIHandleError(_0x54e7fb));};exports[_0xb39c('0x10e')]=function(_0x5afd61,_0x28e0eb){var _0x4952d5={};var _0x21e0de={};var _0x25750a;var _0x237384;return db[_0xb39c('0x3a')][_0xb39c('0xc5')]({'where':{'id':_0x5afd61[_0xb39c('0x57')]['id']}})[_0xb39c('0x22')](handleEntityNotFound(_0x28e0eb,null))[_0xb39c('0x22')](function(_0x47076e){if(_0x47076e){_0x25750a=_0x47076e;_0x21e0de['model']=_['keys'](db[_0xb39c('0x10f')][_0xb39c('0x3b')]);_0x21e0de[_0xb39c('0x44')]=_[_0xb39c('0xce')](_0x5afd61[_0xb39c('0x44')]);_0x21e0de[_0xb39c('0xd0')]=_[_0xb39c('0xd1')](_0x21e0de['model'],_0x21e0de[_0xb39c('0x44')]);_0x4952d5[_0xb39c('0x4a')]=_['intersection'](_0x21e0de[_0xb39c('0xcd')],qs[_0xb39c('0xd2')](_0x5afd61[_0xb39c('0x44')][_0xb39c('0xd2')]));_0x4952d5[_0xb39c('0x4a')]=_0x4952d5[_0xb39c('0x4a')][_0xb39c('0x4e')]?_0x4952d5[_0xb39c('0x4a')]:_0x21e0de['model'];_0x4952d5[_0xb39c('0xd3')]=qs['sort'](_0x5afd61[_0xb39c('0x44')]['sort']);_0x4952d5['where']=qs[_0xb39c('0xd0')](_['pick'](_0x5afd61[_0xb39c('0x44')],_0x21e0de[_0xb39c('0xd0')]));if(_0x5afd61['query'][_0xb39c('0x2e')]){_0x4952d5['where']=_['merge'](_0x4952d5['where'],{'$or':_[_0xb39c('0x30')](_0x4952d5[_0xb39c('0x4a')],function(_0x52c75a){var _0x2b308e={};_0x2b308e[_0x52c75a]={'$like':'%'+_0x5afd61[_0xb39c('0x44')][_0xb39c('0x2e')]+'%'};return _0x2b308e;})});}_0x4952d5=_[_0xb39c('0x59')]({},_0x4952d5,_0x5afd61[_0xb39c('0x5a')]);return _0x25750a[_0xb39c('0x10e')](_0x4952d5);}})[_0xb39c('0x22')](function(_0xc913aa){if(_0xc913aa){_0x237384=_0xc913aa[_0xb39c('0x4e')];if(!_0x5afd61[_0xb39c('0x44')][_0xb39c('0xc8')](_0xb39c('0xd6'))){_0x4952d5[_0xb39c('0x1c')]=qs['limit'](_0x5afd61[_0xb39c('0x44')]['limit']);_0x4952d5[_0xb39c('0x1b')]=qs[_0xb39c('0x1b')](_0x5afd61[_0xb39c('0x44')][_0xb39c('0x1b')]);}return _0x25750a[_0xb39c('0x10e')](_0x4952d5);}})[_0xb39c('0x22')](function(_0x6a2714){if(_0x6a2714){return _0x6a2714?{'count':_0x237384,'rows':_0x6a2714}:null;}})['then'](respondWithResult(_0x28e0eb,null))[_0xb39c('0x55')](handleError(_0x28e0eb,null));};exports['addTeams']=function(_0x3bad26,_0x17ff08){var _0x2af36f=_0x3bad26[_0xb39c('0x57')]['id'];var _0x48e941=_0x3bad26[_0xb39c('0x5c')]?_0x3bad26[_0xb39c('0x5c')]['ids']:null;var _0x1bdc2f=[];return Promise[_0xb39c('0x100')]()['then'](function(){if(!_0x48e941)throw new APIBadRequestError(_0xb39c('0x110'));})[_0xb39c('0x22')](function(){return db[_0xb39c('0x3a')]['findOne']({'where':{'id':_0x2af36f}});})[_0xb39c('0x22')](function(_0x52358a){if(!_0x52358a)throw new APINotFoundError(util['format'](_0xb39c('0xc6'),_0x3bad26[_0xb39c('0x57')]['id']));return db[_0xb39c('0x68')]['transaction'](function(_0x15ca34){return _0x52358a[_0xb39c('0x111')](_0x48e941,{'transaction':_0x15ca34})[_0xb39c('0x22')](function(){return db[_0xb39c('0x10f')]['findAll']({'where':{'id':{'$in':_0x48e941}}});})[_0xb39c('0x22')](function(_0xf234e7){var _0x416f0b=_[_0xb39c('0x30')](_0xf234e7,function(_0x4bd5b3){return _0x4bd5b3[_0xb39c('0x112')]();});return Promise['all'](_0x416f0b);})[_0xb39c('0x22')](function(_0x459d17){_0x1bdc2f=_[_0xb39c('0x113')](_0x459d17);var _0x2552c2=_[_0xb39c('0x30')](_0x1bdc2f,function(_0x4ea5fa){return _0x4ea5fa[_0xb39c('0x114')](_0x52358a['id'],{'transaction':_0x15ca34});});return Promise['all'](_0x2552c2);})['then'](function(){if(!_0x52358a[_0xb39c('0x99')])return;var _0x492860=_[_0xb39c('0x2e')](_0x1bdc2f,function(_0x166841){return _0x166841[_0xb39c('0x115')]('channel')===_0xb39c('0x116');});var _0x717f27=_[_0xb39c('0x30')](_0x492860,function(_0x5570bf){return db[_0xb39c('0xab')][_0xb39c('0xac')]({'membername':_0x52358a[_0xb39c('0x34')],'UserId':_0x52358a['id'],'queue_name':_0x5570bf['name'],'VoiceQueueId':_0x5570bf['id'],'interface':_['isNil'](_0x52358a[_0xb39c('0x9b')])?util['format'](_0xb39c('0xaa'),_0x52358a[_0xb39c('0x34')]):_0x52358a[_0xb39c('0x9b')],'paused':_0x52358a[_0xb39c('0x9a')]||![],'penalty':_0x52358a[_0xb39c('0xa1')]},{'transaction':_0x15ca34});});return Promise[_0xb39c('0x5b')](_0x717f27);})[_0xb39c('0x22')](function(){return db[_0xb39c('0x117')][_0xb39c('0xa7')]({'where':{'teamId':{'$in':_0x48e941}}});})['then'](function(_0x33e728){var _0x23dd8a=_[_0xb39c('0x30')](_0x33e728,function(_0x5a51a8){return db[_0xb39c('0x118')][_0xb39c('0x7d')]({'UserId':_0x52358a['id'],'VoicePrefixId':_0x5a51a8[_0xb39c('0x119')]},{'transaction':_0x15ca34});});return Promise[_0xb39c('0x5b')](_0x23dd8a);});});})['then'](function(){for(var _0x162ca1=0x0;_0x162ca1<_0x1bdc2f[_0xb39c('0x4e')];_0x162ca1++){var _0x2a78b0=_0x1bdc2f[_0x162ca1][_0xb39c('0x115')]('channel');var _0x6d7388=_0x2a78b0+_0xb39c('0xa3');socket['emit'](_0xb39c('0x2a')+_0x2a78b0+_0xb39c('0xa5'),{'UserId':_0x2af36f,['queueField']:_0x1bdc2f[_0x162ca1]['id']});}})['then'](respondWithStatusCode(_0x17ff08,null))['catch'](APIHandleError(_0x17ff08));};exports[_0xb39c('0x11a')]=function(_0x9bb44c,_0x468fa1){var _0x208131=_0x9bb44c[_0xb39c('0x57')]['id'];var _0x331593=null;if(_0x9bb44c[_0xb39c('0x44')][_0xb39c('0x5e')]){_0x331593=_['isArray'](_0x9bb44c[_0xb39c('0x44')][_0xb39c('0x5e')])?_0x9bb44c[_0xb39c('0x44')]['ids']:[_0x9bb44c[_0xb39c('0x44')][_0xb39c('0x5e')]];}var _0x5d7c95=[];return Promise['resolve']()[_0xb39c('0x22')](function(){if(!_0x331593)throw new APIBadRequestError(_0xb39c('0x11b'));})['then'](function(){return db[_0xb39c('0x3a')][_0xb39c('0xc5')]({'where':{'id':_0x208131}});})['then'](function(_0x48e24e){if(!_0x48e24e)throw new APINotFoundError(util[_0xb39c('0xa9')]('User\x20with\x20id\x20%s\x20not\x20found',_0x9bb44c[_0xb39c('0x57')]['id']));return db[_0xb39c('0x68')][_0xb39c('0x11c')](function(_0x456204){return _0x48e24e['removeTeams'](_0x331593,{'transaction':_0x456204})['then'](function(){return db[_0xb39c('0x10f')][_0xb39c('0xa7')]({'where':{'id':{'$in':_0x331593}}});})[_0xb39c('0x22')](function(_0x22a10e){var _0x2a8e7b=_[_0xb39c('0x30')](_0x22a10e,function(_0x1026ce){return _0x1026ce[_0xb39c('0x112')]();});return Promise[_0xb39c('0x5b')](_0x2a8e7b);})[_0xb39c('0x22')](function(_0x486d8a){_0x5d7c95=_[_0xb39c('0x113')](_0x486d8a);var _0x30f365=_[_0xb39c('0x30')](_0x5d7c95,function(_0x34efd2){return _0x34efd2[_0xb39c('0x11d')](_0x48e24e['id'],{'transaction':_0x456204});});return Promise[_0xb39c('0x5b')](_0x30f365);})[_0xb39c('0x22')](function(){if(!_0x48e24e['online'])return;var _0x4a88e6=_[_0xb39c('0x2e')](_0x5d7c95,function(_0x26f268){return _0x26f268[_0xb39c('0x115')](_0xb39c('0x98'))===_0xb39c('0x116');});var _0x2297e6=_[_0xb39c('0x30')](_0x4a88e6,function(_0x15b40a){return db['UserVoiceQueueRt'][_0xb39c('0x26')]({'where':{'VoiceQueueId':_0x15b40a['id'],'UserId':_0x48e24e['id']},'transaction':_0x456204});});return Promise[_0xb39c('0x5b')](_0x2297e6);})[_0xb39c('0x22')](function(){return db[_0xb39c('0x117')]['findAll']({'where':{'teamId':{'$in':_0x331593}}});})[_0xb39c('0x22')](function(_0x1f3023){var _0x52251e=_[_0xb39c('0x30')](_0x1f3023,function(_0x553940){return db[_0xb39c('0x118')][_0xb39c('0x26')]({'where':{'UserId':_0x48e24e['id'],'VoicePrefixId':_0x553940[_0xb39c('0x119')]}},{'transaction':_0x456204});});return Promise[_0xb39c('0x5b')](_0x52251e);});});})['then'](function(){for(var _0x4b8d6a=0x0;_0x4b8d6a<_0x5d7c95[_0xb39c('0x4e')];_0x4b8d6a++){var _0x170d9f=_0x5d7c95[_0x4b8d6a]['getDataValue']('channel');var _0x42d10d=_0x170d9f+_0xb39c('0xa3');socket['emit'](_0xb39c('0x2a')+_0x170d9f+_0xb39c('0xaf'),{'UserId':_0x208131,['queueField']:_0x5d7c95[_0x4b8d6a]['id']});}})['then'](respondWithStatusCode(_0x468fa1,null))[_0xb39c('0x55')](APIHandleError(_0x468fa1));};exports[_0xb39c('0x11e')]=function(_0xfdfed4,_0x259064){var _0x1aa374={};var _0x4d4481={};var _0x466846;var _0x1ce4ef;return db['User'][_0xb39c('0xc5')]({'where':{'id':_0xfdfed4[_0xb39c('0x57')]['id']}})[_0xb39c('0x22')](handleEntityNotFound(_0x259064,null))[_0xb39c('0x22')](function(_0x234a40){if(_0x234a40){_0x466846=_0x234a40;_0x4d4481[_0xb39c('0xcd')]=_['keys'](db['CmList'][_0xb39c('0x3b')]);_0x4d4481[_0xb39c('0x44')]=_[_0xb39c('0xce')](_0xfdfed4[_0xb39c('0x44')]);_0x4d4481['filters']=_['intersection'](_0x4d4481[_0xb39c('0xcd')],_0x4d4481['query']);_0x1aa374['attributes']=_['intersection'](_0x4d4481[_0xb39c('0xcd')],qs[_0xb39c('0xd2')](_0xfdfed4[_0xb39c('0x44')]['fields']));_0x1aa374[_0xb39c('0x4a')]=_0x1aa374[_0xb39c('0x4a')][_0xb39c('0x4e')]?_0x1aa374[_0xb39c('0x4a')]:_0x4d4481['model'];_0x1aa374[_0xb39c('0xd3')]=qs[_0xb39c('0xd7')](_0xfdfed4[_0xb39c('0x44')][_0xb39c('0xd7')]);_0x1aa374[_0xb39c('0x43')]=qs[_0xb39c('0xd0')](_['pick'](_0xfdfed4[_0xb39c('0x44')],_0x4d4481['filters']));if(_0xfdfed4[_0xb39c('0x44')][_0xb39c('0x2e')]){_0x1aa374[_0xb39c('0x43')]=_[_0xb39c('0x59')](_0x1aa374['where'],{'$or':_['map'](_0x1aa374[_0xb39c('0x4a')],function(_0x256024){var _0x3d439a={};_0x3d439a[_0x256024]={'$like':'%'+_0xfdfed4[_0xb39c('0x44')][_0xb39c('0x2e')]+'%'};return _0x3d439a;})});}_0x1aa374=_[_0xb39c('0x59')]({},_0x1aa374,_0xfdfed4[_0xb39c('0x5a')]);return _0x466846[_0xb39c('0x11e')](_0x1aa374);}})[_0xb39c('0x22')](function(_0x3b021b){if(_0x3b021b){_0x1ce4ef=_0x3b021b[_0xb39c('0x4e')];if(!_0xfdfed4['query']['hasOwnProperty']('nolimit')){_0x1aa374[_0xb39c('0x1c')]=qs[_0xb39c('0x1c')](_0xfdfed4[_0xb39c('0x44')][_0xb39c('0x1c')]);_0x1aa374[_0xb39c('0x1b')]=qs[_0xb39c('0x1b')](_0xfdfed4[_0xb39c('0x44')][_0xb39c('0x1b')]);}return _0x466846['getLists'](_0x1aa374);}})[_0xb39c('0x22')](function(_0x41ee91){if(_0x41ee91){return _0x41ee91?{'count':_0x1ce4ef,'rows':_0x41ee91}:null;}})[_0xb39c('0x22')](respondWithResult(_0x259064,null))['catch'](handleError(_0x259064,null));};exports[_0xb39c('0x11f')]=function(_0x54b24a,_0xec71f5){var _0x37a9a9={};var _0x5d2452={};var _0x56f1a1;return db[_0xb39c('0x3a')]['findOne']({'where':{'id':_0x54b24a[_0xb39c('0x57')]['id']}})[_0xb39c('0x22')](handleEntityNotFound(_0xec71f5,null))[_0xb39c('0x22')](function(_0x198cb1){if(_0x198cb1){_0x56f1a1=_0x198cb1;_0x5d2452[_0xb39c('0xcd')]=_[_0xb39c('0xce')](db[_0xb39c('0x3a')]['rawAttributes']);_0x5d2452[_0xb39c('0x44')]=_[_0xb39c('0xce')](_0x54b24a[_0xb39c('0x44')]);_0x5d2452[_0xb39c('0xd0')]=_[_0xb39c('0xd1')](_0x5d2452[_0xb39c('0xcd')],_0x5d2452[_0xb39c('0x44')]);_0x37a9a9[_0xb39c('0x4a')]=_[_0xb39c('0xd1')](_0x5d2452[_0xb39c('0xcd')],qs[_0xb39c('0xd2')](_0x54b24a[_0xb39c('0x44')][_0xb39c('0xd2')]));_0x37a9a9['attributes']=_0x37a9a9[_0xb39c('0x4a')][_0xb39c('0x4e')]?_0x37a9a9[_0xb39c('0x4a')]:_0x5d2452[_0xb39c('0xcd')];_0x37a9a9[_0xb39c('0xd3')]=qs['sort'](_0x54b24a[_0xb39c('0x44')]['sort']);_0x37a9a9[_0xb39c('0x43')]=qs[_0xb39c('0xd0')](_[_0xb39c('0xd4')](_0x54b24a[_0xb39c('0x44')],_0x5d2452['filters']));if(_0x54b24a[_0xb39c('0x44')]['filter']){_0x37a9a9['where']=_[_0xb39c('0x59')](_0x37a9a9[_0xb39c('0x43')],{'$or':_['map'](_0x37a9a9[_0xb39c('0x4a')],function(_0x231694){var _0x411d92={};_0x411d92[_0x231694]={'$like':'%'+_0x54b24a['query'][_0xb39c('0x2e')]+'%'};return _0x411d92;})});}_0x37a9a9[_0xb39c('0xcd')]=db[_0xb39c('0x3a')];_0x37a9a9['as']=_0xb39c('0x2b');_0x37a9a9=_['merge']({},_0x37a9a9,_0x54b24a[_0xb39c('0x5a')]);return _0x56f1a1[_0xb39c('0xf5')]({'include':[_0x37a9a9]});}})[_0xb39c('0x22')](function(_0xa69e3e){if(_0xa69e3e){var _0x4815d5={},_0x22224f=[];for(var _0x4711e6=0x0;_0x4711e6<_0xa69e3e[_0xb39c('0x4e')];_0x4711e6+=0x1){for(var _0x2ddf3d=0x0,_0x3dfdf5;_0x2ddf3d<_0xa69e3e[_0x4711e6][_0xb39c('0x2b')][_0xb39c('0x4e')];_0x2ddf3d+=0x1){_0x3dfdf5=_0xa69e3e[_0x4711e6]['Agents'][_0x2ddf3d][_0xb39c('0x27')]({'plain':!![]});_0x4815d5[_0x3dfdf5['id']]=_0x3dfdf5;}}_0x4815d5=_[_0xb39c('0x120')](_0x4815d5);for(var _0x5d69a5=qs['offset'](_0x54b24a[_0xb39c('0x44')][_0xb39c('0x1b')]);_0x5d69a5<_0x4815d5[_0xb39c('0x4e')]&&_0x22224f[_0xb39c('0x4e')]=_0xfe079e[_0x3be3('0x4f')]){throw new Error(_0x3be3('0x50'));}})[_0x3be3('0x16')](function(){if(_0x219793){return db[_0x3be3('0x26')]['destroy']({'where':{'membername':_0x219793['name']},'individualHooks':!![]});}})[_0x3be3('0x16')](function(){if(_0x219793){return _0x219793[_0x3be3('0x51')]({'raw':!![]});}})[_0x3be3('0x16')](function(_0x137a83){if(_0x219793){if(_0x137a83){var _0x3d562a=[];_0x158ae3=_0x137a83;if(_0x158ae3[_0x3be3('0x2b')]){for(var _0x37f6b0=0x0;_0x37f6b0<_0x158ae3[_0x3be3('0x2b')];_0x37f6b0++){_0x3d562a[_0x3be3('0x31')](db['UserVoiceQueueRt'][_0x3be3('0x52')]({'membername':_0x219793[_0x3be3('0x21')],'UserId':_0x219793['id'],'queue_name':_0x158ae3[_0x37f6b0]['name'],'VoiceQueueId':_0x158ae3[_0x37f6b0]['id'],'interface':_0x44dffa,'paused':_0x219793[_0x3be3('0x4b')]||![],'penalty':_0x158ae3[_0x37f6b0][_0x3be3('0x53')]||0x0}));}return BPromise['all'](_0x3d562a);}}}})[_0x3be3('0x16')](function(){if(_0x219793){return db[_0x3be3('0x28')]['findAll']({'where':{'membername':_0x219793[_0x3be3('0x21')],'exitAt':null}});}})[_0x3be3('0x16')](function(_0x3a1f9a){if(_0x219793){if(_0x3a1f9a&&_0x3a1f9a[_0x3be3('0x2b')]){var _0x541604=[];_0x3a1f9a[_0x3be3('0x30')](function(_0x37b4b6){_0x541604[_0x3be3('0x31')](_0x37b4b6[_0x3be3('0x27')]({'exitAt':moment()['format'](_0x3be3('0x2d'))}));});return BPromise[_0x3be3('0x48')](_0x541604);}}})['then'](function(){if(_0x219793){var _0x195d8e=[];var _0x178add=[];var _0x20d4ba=utils[_0x3be3('0x2f')]();var _0x4837d2={'membername':_0x219793[_0x3be3('0x21')],'interface':_0x44dffa,'enterAt':moment()[_0x3be3('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x219793['role'],'internal':_0x219793['internal']};_0x20d4ba[_0x3be3('0x30')](function(_0x438003){_0x195d8e[_0x3be3('0x31')](_[_0x3be3('0x54')]({'channel':_0x438003,'type':_0x3be3('0x55'),'data1':_0x3be3('0x56'),'data2':_0x44dffa},_0x4837d2));if(_0x219793[_0x3be3('0x4b')]){_0x178add['push'](_['merge']({'channel':_0x438003,'type':'PAUSE','data1':_0x3be3('0x57')},_0x4837d2));}});return db[_0x3be3('0x28')][_0x3be3('0x58')](_0x195d8e[_0x3be3('0x59')](_0x178add),{'individualHooks':!![]});}})['then'](function(){if(_0x219793){return _0x219793[_0x3be3('0x27')]({'online':!![],'lastLoginAt':moment()['format'](_0x3be3('0x2d')),'voicePause':_0x219793[_0x3be3('0x4b')]||![],'mailPause':_0x219793[_0x3be3('0x4b')]||![],'chatPause':_0x219793[_0x3be3('0x4b')]||![],'faxPause':_0x219793[_0x3be3('0x4b')]||![],'smsPause':_0x219793[_0x3be3('0x4b')]||![],'openchannelPause':_0x219793['loginInPause']||![],'pauseType':_0x219793[_0x3be3('0x4b')]?_0x3be3('0x57'):null,'lastPauseAt':moment()[_0x3be3('0x2c')](_0x3be3('0x2d')),'interface':_0x44dffa});}})[_0x3be3('0x16')](function(_0x2e461f){_0x4267c8(_0x2e461f);})[_0x3be3('0x1b')](function(_0x1d8e26){_0x29adfd(_0x146028[_0x3be3('0x1c')](0x1f4,_0x1d8e26['message']));});});}; \ No newline at end of file +var _0x93ad=['length','updateAttributes','getChannels','forEach','push','interface','body','type','DEFAULT\x20PAUSE','uniqueid','MemberReport','UnpauseUser','channel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','voicePause','chatPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','unpause','LogoutUser','all','LoginUser','phone','loginInPause','SIP/%s','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','UserVoiceQueueRt','getVoiceQueues','upsert','merge','callysquare','concat','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','defaults','redis','socket.io-emitter','./user.socket','register','GetUser','User','findAll','options','raw','where','attributes','limit','include','model','map','then','debug','stringify','catch','error','message','ShowUser','find','info','role','internal','format','User\x20with\x20id\x20%s\x20not\x20found','params','update','name','PAUSE','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2b2401,_0x572f38){var _0x3c0102=function(_0x198b2a){while(--_0x198b2a){_0x2b2401['push'](_0x2b2401['shift']());}};_0x3c0102(++_0x572f38);}(_0x93ad,0x16c));var _0xd93a=function(_0x56d78c,_0x2b65d6){_0x56d78c=_0x56d78c-0x0;var _0x9a8155=_0x93ad[_0x56d78c];return _0x9a8155;};'use strict';var _=require('lodash');var util=require(_0xd93a('0x0'));var moment=require(_0xd93a('0x1'));var BPromise=require(_0xd93a('0x2'));var Redis=require('ioredis');var db=require(_0xd93a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd93a('0x4'))(_0xd93a('0x5'));var config=require(_0xd93a('0x6'));config['redis']=_[_0xd93a('0x7')](config[_0xd93a('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xd93a('0x9'))(new Redis(config[_0xd93a('0x8')]));require(_0xd93a('0xa'))[_0xd93a('0xb')](socket);exports[_0xd93a('0xc')]=function(_0x2c7e1b){var _0x3eb79f=this;return new Promise(function(_0x4f130c,_0x13c70b){return db[_0xd93a('0xd')][_0xd93a('0xe')]({'raw':_0x2c7e1b[_0xd93a('0xf')]?_0x2c7e1b[_0xd93a('0xf')][_0xd93a('0x10')]===undefined?!![]:![]:!![],'where':_0x2c7e1b[_0xd93a('0xf')]?_0x2c7e1b['options'][_0xd93a('0x11')]||null:null,'attributes':_0x2c7e1b[_0xd93a('0xf')]?_0x2c7e1b[_0xd93a('0xf')][_0xd93a('0x12')]||null:null,'limit':_0x2c7e1b[_0xd93a('0xf')]?_0x2c7e1b[_0xd93a('0xf')][_0xd93a('0x13')]||null:null,'include':_0x2c7e1b[_0xd93a('0xf')]?_0x2c7e1b[_0xd93a('0xf')][_0xd93a('0x14')]?_['map'](_0x2c7e1b['options'][_0xd93a('0x14')],function(_0x367d35){return{'model':db[_0x367d35[_0xd93a('0x15')]],'as':_0x367d35['as'],'attributes':_0x367d35[_0xd93a('0x12')],'include':_0x367d35[_0xd93a('0x14')]?_['map'](_0x367d35[_0xd93a('0x14')],function(_0x457f8d){return{'model':db[_0x457f8d[_0xd93a('0x15')]],'as':_0x457f8d['as'],'attributes':_0x457f8d[_0xd93a('0x12')],'include':_0x457f8d[_0xd93a('0x14')]?_[_0xd93a('0x16')](_0x457f8d[_0xd93a('0x14')],function(_0x5868bb){return{'model':db[_0x5868bb[_0xd93a('0x15')]],'as':_0x5868bb['as'],'attributes':_0x5868bb[_0xd93a('0x12')]};}):[]};}):[]};}):[]:[]})[_0xd93a('0x17')](function(_0x4b7bbb){logger['info']('GetUser',_0x2c7e1b);logger[_0xd93a('0x18')]('GetUser',_0x2c7e1b,JSON[_0xd93a('0x19')](_0x4b7bbb));_0x4f130c(_0x4b7bbb);})[_0xd93a('0x1a')](function(_0x8744e0){logger[_0xd93a('0x1b')]('GetUser',_0x8744e0['message'],_0x2c7e1b);_0x13c70b(_0x3eb79f[_0xd93a('0x1b')](0x1f4,_0x8744e0[_0xd93a('0x1c')]));});});};exports[_0xd93a('0x1d')]=function(_0x1d014e){var _0x3e7ba9=this;return new Promise(function(_0x44c86c,_0x42aa41){return db['User'][_0xd93a('0x1e')]({'raw':_0x1d014e[_0xd93a('0xf')]?_0x1d014e['options'][_0xd93a('0x10')]===undefined?!![]:![]:!![],'where':_0x1d014e['options']?_0x1d014e[_0xd93a('0xf')][_0xd93a('0x11')]||null:null,'attributes':_0x1d014e['options']?_0x1d014e[_0xd93a('0xf')][_0xd93a('0x12')]||null:null,'include':_0x1d014e[_0xd93a('0xf')]?_0x1d014e[_0xd93a('0xf')][_0xd93a('0x14')]?_['map'](_0x1d014e[_0xd93a('0xf')]['include'],function(_0x55a055){return{'model':db[_0x55a055[_0xd93a('0x15')]],'as':_0x55a055['as'],'attributes':_0x55a055[_0xd93a('0x12')],'include':_0x55a055['include']?_[_0xd93a('0x16')](_0x55a055[_0xd93a('0x14')],function(_0x40b7be){return{'model':db[_0x40b7be[_0xd93a('0x15')]],'as':_0x40b7be['as'],'attributes':_0x40b7be[_0xd93a('0x12')],'include':_0x40b7be[_0xd93a('0x14')]?_[_0xd93a('0x16')](_0x40b7be['include'],function(_0x2ef9c9){return{'model':db[_0x2ef9c9[_0xd93a('0x15')]],'as':_0x2ef9c9['as'],'attributes':_0x2ef9c9[_0xd93a('0x12')]};}):[]};}):[]};}):[]:[]})[_0xd93a('0x17')](function(_0x1d04ed){logger[_0xd93a('0x1f')](_0xd93a('0x1d'),_0x1d014e);logger[_0xd93a('0x18')]('ShowUser',_0x1d014e,JSON[_0xd93a('0x19')](_0x1d04ed));_0x44c86c(_0x1d04ed);})[_0xd93a('0x1a')](function(_0x569009){logger['error'](_0xd93a('0x1d'),_0x569009['message'],_0x1d014e);_0x42aa41(_0x3e7ba9['error'](0x1f4,_0x569009[_0xd93a('0x1c')]));});});};exports['PauseUser']=function(_0x190204){var _0x2ac8d4;return db[_0xd93a('0xd')]['find']({'where':_0x190204['options'][_0xd93a('0x11')]||{},'attributes':['id','name',_0xd93a('0x20'),_0xd93a('0x21'),'interface']})['then'](function(_0x8e9ec0){if(!_0x8e9ec0){throw new Error(util[_0xd93a('0x22')](_0xd93a('0x23'),_0x190204[_0xd93a('0x24')]['id']));}_0x2ac8d4=_0x8e9ec0;return db['UserVoiceQueueRt'][_0xd93a('0x25')]({'paused':0x1},{'where':{'UserId':_0x2ac8d4['id']},'individualHooks':!![]});})[_0xd93a('0x17')](function(){return db['MemberReport'][_0xd93a('0xe')]({'where':{'membername':_0x2ac8d4[_0xd93a('0x26')],'type':_0xd93a('0x27'),'exitAt':null}});})[_0xd93a('0x17')](function(_0x45cbc7){if(_0x45cbc7&&_0x45cbc7['length']){var _0x52eea0=moment()[_0xd93a('0x22')](_0xd93a('0x28'));for(var _0xd61d55=0x0,_0x1b2046=_0x45cbc7[_0xd93a('0x29')];_0xd61d55<_0x1b2046;_0xd61d55++){_0x45cbc7[_0xd61d55][_0xd93a('0x2a')]({'exitAt':_0x52eea0});}}})['then'](function(){var _0x3befbf=[];var _0x440381=utils[_0xd93a('0x2b')]();_0x440381[_0xd93a('0x2c')](function(_0x5befa8){_0x3befbf[_0xd93a('0x2d')]({'channel':_0x5befa8,'membername':_0x2ac8d4['name'],'interface':_['isNil'](_0x2ac8d4[_0xd93a('0x2e')])?util[_0xd93a('0x22')]('SIP/%s',_0x2ac8d4['name']):_0x2ac8d4[_0xd93a('0x2e')],'type':_0xd93a('0x27'),'enterAt':moment()['format'](_0xd93a('0x28')),'data1':_0x190204[_0xd93a('0x2f')][_0xd93a('0x30')]||_0xd93a('0x31'),'role':_0x2ac8d4[_0xd93a('0x20')],'internal':_0x2ac8d4['internal'],'uniqueid':_0x190204[_0xd93a('0x2f')][_0xd93a('0x32')]||null});});return db[_0xd93a('0x33')]['bulkCreate'](_0x3befbf,{'individualHooks':!![]});})['then'](function(){return _0x2ac8d4[_0xd93a('0x25')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x190204[_0xd93a('0x2f')][_0xd93a('0x30')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0xd93a('0x1a')](function(_0x4cb8c3){throw _0x4cb8c3;});};exports[_0xd93a('0x34')]=function(_0x2c4c59){return Promise['resolve']()[_0xd93a('0x17')](function(){if(_0x2c4c59[_0xd93a('0x2f')][_0xd93a('0x35')]&&!utils['isValidChannel'](_0x2c4c59['body'][_0xd93a('0x35')])){throw new Error(util[_0xd93a('0x22')](_0xd93a('0x36'),_0x2c4c59['body'][_0xd93a('0x35')]));}return db[_0xd93a('0xd')][_0xd93a('0x37')]({'where':_0x2c4c59[_0xd93a('0xf')][_0xd93a('0x11')]||{},'attributes':['id',_0xd93a('0x26'),_0xd93a('0x20'),_0xd93a('0x21'),_0xd93a('0x2e'),'online',_0xd93a('0x38'),'mailPause',_0xd93a('0x39'),'faxPause',_0xd93a('0x3a'),_0xd93a('0x3b'),_0xd93a('0x3c'),_0xd93a('0x3d'),_0xd93a('0x3e')]});})[_0xd93a('0x17')](function(_0x93d995){if(!_0x93d995){throw new Error(util['format'](_0xd93a('0x23'),_0x2c4c59[_0xd93a('0x24')]['id']));}return _0x93d995[_0xd93a('0x3f')](_0x2c4c59[_0xd93a('0x2f')]['channel'],'system');})[_0xd93a('0x1a')](function(_0x5982b0){throw _0x5982b0;});};exports[_0xd93a('0x40')]=function(_0x50adb4){var _0x14b571=this;return new Promise(function(_0x311973,_0x48bf21){var _0x5dfb48;return db[_0xd93a('0xd')][_0xd93a('0x37')]({'where':_0x50adb4[_0xd93a('0xf')][_0xd93a('0x11')]||{},'attributes':['id',_0xd93a('0x26')]})[_0xd93a('0x17')](function(_0x21ed47){if(_0x21ed47){_0x5dfb48=_0x21ed47;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x5dfb48['name']},'individualHooks':!![]});}})[_0xd93a('0x17')](function(){if(_0x5dfb48){return db['MemberReport'][_0xd93a('0xe')]({'where':{'membername':_0x5dfb48[_0xd93a('0x26')],'exitAt':null}});}})['then'](function(_0x5e0676){if(_0x5dfb48){if(_0x5e0676&&_0x5e0676[_0xd93a('0x29')]){var _0x2d5601=[];_0x5e0676[_0xd93a('0x2c')](function(_0x26b67a){_0x2d5601['push'](_0x26b67a[_0xd93a('0x25')]({'exitAt':moment()[_0xd93a('0x22')](_0xd93a('0x28'))}));});return BPromise[_0xd93a('0x41')](_0x2d5601);}}})[_0xd93a('0x17')](function(){if(_0x5dfb48){return _0x5dfb48[_0xd93a('0x25')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xd93a('0x17')](function(_0x57b181){_0x311973(_0x57b181);})[_0xd93a('0x1a')](function(_0x3f35ac){_0x48bf21(_0x14b571['error'](0x1f4,_0x3f35ac[_0xd93a('0x1c')]));});});};exports[_0xd93a('0x42')]=function(_0x2c44e7){var _0x26367f=this;return new Promise(function(_0x53b1ef,_0x585a2d){var _0xc9b99d;var _0x41af29;var _0x28a860;var _0x2d38f9;return db['User'][_0xd93a('0x37')]({'where':_0x2c44e7[_0xd93a('0xf')][_0xd93a('0x11')]||{},'attributes':['id',_0xd93a('0x26'),'role','mobile',_0xd93a('0x43'),_0xd93a('0x21'),_0xd93a('0x44'),_0xd93a('0x2e')]})['then'](function(_0x265aa7){if(_0x265aa7){_0xc9b99d=_0x265aa7;_0x2d38f9=_0x2c44e7[_0xd93a('0x2f')][_0xd93a('0x2e')]?_0x2c44e7[_0xd93a('0x2f')]['interface']:util[_0xd93a('0x22')](_0xd93a('0x45'),_0xc9b99d[_0xd93a('0x26')]);return db[_0xd93a('0xd')][_0xd93a('0x46')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0xc9b99d['id']}}});}})[_0xd93a('0x17')](function(_0x15e289){if(_0x15e289){_0x28a860=_0x15e289;return require(_0xd93a('0x47'))[_0xd93a('0x48')]();}})[_0xd93a('0x17')](function(_0x5e98ae){if(_0x5e98ae&&_0x5e98ae[_0xd93a('0x49')]&&_0x28a860>=_0x5e98ae['agents']){throw new Error(_0xd93a('0x4a'));}})[_0xd93a('0x17')](function(){if(_0xc9b99d){return db[_0xd93a('0x4b')]['destroy']({'where':{'membername':_0xc9b99d[_0xd93a('0x26')]},'individualHooks':!![]});}})[_0xd93a('0x17')](function(){if(_0xc9b99d){return _0xc9b99d[_0xd93a('0x4c')]({'raw':!![]});}})[_0xd93a('0x17')](function(_0x20657f){if(_0xc9b99d){if(_0x20657f){var _0x1629e2=[];_0x41af29=_0x20657f;if(_0x41af29['length']){for(var _0x28de05=0x0;_0x28de05<_0x41af29['length'];_0x28de05++){_0x1629e2[_0xd93a('0x2d')](db[_0xd93a('0x4b')][_0xd93a('0x4d')]({'membername':_0xc9b99d[_0xd93a('0x26')],'UserId':_0xc9b99d['id'],'queue_name':_0x41af29[_0x28de05][_0xd93a('0x26')],'VoiceQueueId':_0x41af29[_0x28de05]['id'],'interface':_0x2d38f9,'paused':_0xc9b99d[_0xd93a('0x44')]||![],'penalty':_0x41af29[_0x28de05]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xd93a('0x41')](_0x1629e2);}}}})[_0xd93a('0x17')](function(){if(_0xc9b99d){return db[_0xd93a('0x33')][_0xd93a('0xe')]({'where':{'membername':_0xc9b99d[_0xd93a('0x26')],'exitAt':null}});}})[_0xd93a('0x17')](function(_0x32b6dc){if(_0xc9b99d){if(_0x32b6dc&&_0x32b6dc[_0xd93a('0x29')]){var _0x3c9bc3=[];_0x32b6dc[_0xd93a('0x2c')](function(_0xc54e14){_0x3c9bc3[_0xd93a('0x2d')](_0xc54e14[_0xd93a('0x25')]({'exitAt':moment()[_0xd93a('0x22')](_0xd93a('0x28'))}));});return BPromise[_0xd93a('0x41')](_0x3c9bc3);}}})['then'](function(){if(_0xc9b99d){var _0x9ca0bf=[];var _0x431651=[];var _0x1f6d4e=utils[_0xd93a('0x2b')]();var _0x396363={'membername':_0xc9b99d[_0xd93a('0x26')],'interface':_0x2d38f9,'enterAt':moment()[_0xd93a('0x22')](_0xd93a('0x28')),'role':_0xc9b99d[_0xd93a('0x20')],'internal':_0xc9b99d['internal']};_0x1f6d4e['forEach'](function(_0x279eaa){_0x9ca0bf['push'](_[_0xd93a('0x4e')]({'channel':_0x279eaa,'type':'LOGIN','data1':_0xd93a('0x4f'),'data2':_0x2d38f9},_0x396363));if(_0xc9b99d[_0xd93a('0x44')]){_0x431651[_0xd93a('0x2d')](_[_0xd93a('0x4e')]({'channel':_0x279eaa,'type':_0xd93a('0x27'),'data1':'LOGININPAUSE'},_0x396363));}});return db['MemberReport']['bulkCreate'](_0x9ca0bf[_0xd93a('0x50')](_0x431651),{'individualHooks':!![]});}})[_0xd93a('0x17')](function(){if(_0xc9b99d){return _0xc9b99d[_0xd93a('0x25')]({'online':!![],'lastLoginAt':moment()['format'](_0xd93a('0x28')),'voicePause':_0xc9b99d[_0xd93a('0x44')]||![],'mailPause':_0xc9b99d[_0xd93a('0x44')]||![],'chatPause':_0xc9b99d[_0xd93a('0x44')]||![],'faxPause':_0xc9b99d[_0xd93a('0x44')]||![],'smsPause':_0xc9b99d[_0xd93a('0x44')]||![],'openchannelPause':_0xc9b99d[_0xd93a('0x44')]||![],'pauseType':_0xc9b99d[_0xd93a('0x44')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0xd93a('0x28')),'interface':_0x2d38f9});}})['then'](function(_0x5418ed){_0x53b1ef(_0x5418ed);})['catch'](function(_0x58a19d){_0x585a2d(_0x26367f[_0xd93a('0x1b')](0x1f4,_0x58a19d[_0xd93a('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 5b2f732..1887e9a 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 _0x07bf=['register','length','user:','./user.events','remove','update','emit'];(function(_0x5d836c,_0x4d315f){var _0x2820a5=function(_0x278804){while(--_0x278804){_0x5d836c['push'](_0x5d836c['shift']());}};_0x2820a5(++_0x4d315f);}(_0x07bf,0x129));var _0xf07b=function(_0x1ce4a4,_0x1387bb){_0x1ce4a4=_0x1ce4a4-0x0;var _0x421e1d=_0x07bf[_0x1ce4a4];return _0x421e1d;};'use strict';var UserEvents=require(_0xf07b('0x0'));var events=['save',_0xf07b('0x1'),_0xf07b('0x2')];function createListener(_0x61e2d5,_0x19d451){return function(_0x2fe26b){_0x19d451[_0xf07b('0x3')](_0x61e2d5,_0x2fe26b);};}function removeListener(_0x6accc4,_0x26da06){return function(){UserEvents['removeListener'](_0x6accc4,_0x26da06);};}exports[_0xf07b('0x4')]=function(_0x4e06ba){for(var _0x560270=0x0,_0x2f44fc=events[_0xf07b('0x5')];_0x560270<_0x2f44fc;_0x560270++){var _0x3d1913=events[_0x560270];var _0x392b3b=createListener(_0xf07b('0x6')+_0x3d1913,_0x4e06ba);UserEvents['on'](_0x3d1913,_0x392b3b);}}; \ No newline at end of file +var _0x17d6=['register','length','user:','./user.events','save','remove','removeListener'];(function(_0x4b0fd6,_0x208dcc){var _0x53f64a=function(_0x466b9b){while(--_0x466b9b){_0x4b0fd6['push'](_0x4b0fd6['shift']());}};_0x53f64a(++_0x208dcc);}(_0x17d6,0x8f));var _0x617d=function(_0x59eb48,_0x31691f){_0x59eb48=_0x59eb48-0x0;var _0x130bab=_0x17d6[_0x59eb48];return _0x130bab;};'use strict';var UserEvents=require(_0x617d('0x0'));var events=[_0x617d('0x1'),_0x617d('0x2'),'update'];function createListener(_0x58c494,_0x31593e){return function(_0xd6eb52){_0x31593e['emit'](_0x58c494,_0xd6eb52);};}function removeListener(_0x255dbb,_0x5a3d96){return function(){UserEvents[_0x617d('0x3')](_0x255dbb,_0x5a3d96);};}exports[_0x617d('0x4')]=function(_0x2ec634){for(var _0x7dcfe8=0x0,_0x1f135a=events[_0x617d('0x5')];_0x7dcfe8<_0x1f135a;_0x7dcfe8++){var _0x5a1afd=events[_0x7dcfe8];var _0x118cce=createListener(_0x617d('0x6')+_0x5a1afd,_0x2ec634);UserEvents['on'](_0x5a1afd,_0x118cce);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 5465df3..76c4202 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x43a175,_0xe018e0){var _0x2756ea=function(_0x25af7c){while(--_0x25af7c){_0x43a175['push'](_0x43a175['shift']());}};_0x2756ea(++_0xe018e0);}(_0xedd9,0xfc));var _0x9edd=function(_0x2570b1,_0x3fed7f){_0x2570b1=_0x2570b1-0x0;var _0x5b4e74=_0xedd9[_0x2570b1];return _0x5b4e74;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x51a032,_0x43ab93){var _0x59b1f0=function(_0x4b2969){while(--_0x4b2969){_0x51a032['push'](_0x51a032['shift']());}};_0x59b1f0(++_0x43ab93);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index e0b634a..4d1039b 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 _0x8645=['INTEGER','sequelize'];(function(_0x2b8a10,_0x4d2032){var _0x4adc9c=function(_0x10aeba){while(--_0x10aeba){_0x2b8a10['push'](_0x2b8a10['shift']());}};_0x4adc9c(++_0x4d2032);}(_0x8645,0x145));var _0x5864=function(_0x13486c,_0x139348){_0x13486c=_0x13486c-0x0;var _0x135738=_0x8645[_0x13486c];return _0x135738;};'use strict';var Sequelize=require(_0x5864('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x5864('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf6d8=['sequelize','exports','INTEGER'];(function(_0x4e8401,_0x51b328){var _0x17269f=function(_0x35ac65){while(--_0x35ac65){_0x4e8401['push'](_0x4e8401['shift']());}};_0x17269f(++_0x51b328);}(_0xf6d8,0xb4));var _0x8f6d=function(_0x39438a,_0x4bbf96){_0x39438a=_0x39438a-0x0;var _0x306d09=_0xf6d8[_0x39438a];return _0x306d09;};'use strict';var Sequelize=require(_0x8f6d('0x0'));module[_0x8f6d('0x1')]={'penalty':{'type':Sequelize[_0x8f6d('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index d11a367..5947695 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 _0x4a2b=['../../config/environment','./userChatQueue.attributes','exports','define','user_has_chat_queues','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x5aef17,_0x592cd4){var _0x43f9d0=function(_0x49ea9c){while(--_0x49ea9c){_0x5aef17['push'](_0x5aef17['shift']());}};_0x43f9d0(++_0x592cd4);}(_0x4a2b,0x165));var _0xb4a2=function(_0x2a18c6,_0x30b53c){_0x2a18c6=_0x2a18c6-0x0;var _0x1fba88=_0x4a2b[_0x2a18c6];return _0x1fba88;};'use strict';var _=require('lodash');var util=require(_0xb4a2('0x0'));var logger=require(_0xb4a2('0x1'))('api');var moment=require(_0xb4a2('0x2'));var BPromise=require(_0xb4a2('0x3'));var rp=require(_0xb4a2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb4a2('0x5'));var config=require(_0xb4a2('0x6'));var attributes=require(_0xb4a2('0x7'));module[_0xb4a2('0x8')]=function(_0x58740a,_0x58bae1){return _0x58740a[_0xb4a2('0x9')]('UserChatQueue',attributes,{'tableName':_0xb4a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84f8=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserChatQueue','../../config/logger'];(function(_0x5f0225,_0x52631a){var _0x2cef4b=function(_0x5a29c6){while(--_0x5a29c6){_0x5f0225['push'](_0x5f0225['shift']());}};_0x2cef4b(++_0x52631a);}(_0x84f8,0xba));var _0x884f=function(_0x31a2fb,_0x1996d7){_0x31a2fb=_0x31a2fb-0x0;var _0x2e343b=_0x84f8[_0x31a2fb];return _0x2e343b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x884f('0x0'))(_0x884f('0x1'));var moment=require(_0x884f('0x2'));var BPromise=require(_0x884f('0x3'));var rp=require(_0x884f('0x4'));var fs=require('fs');var path=require(_0x884f('0x5'));var rimraf=require(_0x884f('0x6'));var config=require(_0x884f('0x7'));var attributes=require('./userChatQueue.attributes');module[_0x884f('0x8')]=function(_0x4a7655,_0x292dda){return _0x4a7655[_0x884f('0x9')](_0x884f('0xa'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 5a93e4e..554b32c 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 _0xad4c=['../../config/environment','jayson/promise','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x215959,_0x146f28){var _0x219a3f=function(_0x59bd29){while(--_0x59bd29){_0x215959['push'](_0x215959['shift']());}};_0x219a3f(++_0x146f28);}(_0xad4c,0xea));var _0xcad4=function(_0x3286f4,_0x113b76){_0x3286f4=_0x3286f4-0x0;var _0x113cbf=_0xad4c[_0x3286f4];return _0x113cbf;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xcad4('0x0'));var rs=require(_0xcad4('0x1'));var fs=require('fs');var Redis=require(_0xcad4('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcad4('0x3'))('rpc');var config=require(_0xcad4('0x4'));var jayson=require(_0xcad4('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x396d9f,_0x4853ac,_0x277576){return new BPromise(function(_0x4760b5,_0x4cffeb){return client['request'](_0x396d9f,_0x277576)[_0xcad4('0x6')](function(_0x42b0f0){logger[_0xcad4('0x7')](_0xcad4('0x8'),_0x4853ac,'request\x20sent');logger[_0xcad4('0x9')](_0xcad4('0xa'),_0x4853ac,_0xcad4('0xb'),JSON[_0xcad4('0xc')](_0x42b0f0));if(_0x42b0f0[_0xcad4('0xd')]){if(_0x42b0f0[_0xcad4('0xd')][_0xcad4('0xe')]===0x1f4){logger[_0xcad4('0xd')](_0xcad4('0x8'),_0x4853ac,_0x42b0f0['error'][_0xcad4('0xf')]);return _0x4cffeb(_0x42b0f0[_0xcad4('0xd')][_0xcad4('0xf')]);}logger[_0xcad4('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x4853ac,_0x42b0f0[_0xcad4('0xd')][_0xcad4('0xf')]);return _0x4760b5(_0x42b0f0[_0xcad4('0xd')][_0xcad4('0xf')]);}else{logger['info'](_0xcad4('0x8'),_0x4853ac,_0xcad4('0xb'));_0x4760b5(_0x42b0f0['result'][_0xcad4('0xf')]);}})[_0xcad4('0x10')](function(_0x5d38c0){logger[_0xcad4('0xd')](_0xcad4('0x8'),_0x4853ac,_0x5d38c0);_0x4cffeb(_0x5d38c0);});});} \ No newline at end of file +var _0x8560=['stringify','error','UserChatQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug'];(function(_0x1f5494,_0x45b5e2){var _0x1b3062=function(_0x2f85f3){while(--_0x2f85f3){_0x1f5494['push'](_0x1f5494['shift']());}};_0x1b3062(++_0x45b5e2);}(_0x8560,0x6e));var _0x0856=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x8560[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x0856('0x0'));var util=require(_0x0856('0x1'));var moment=require(_0x0856('0x2'));var BPromise=require(_0x0856('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0856('0x4'));var db=require(_0x0856('0x5'))['db'];var utils=require(_0x0856('0x6'));var logger=require(_0x0856('0x7'))(_0x0856('0x8'));var config=require(_0x0856('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0856('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54cddf,_0x10f3c6,_0x3380cb){return new BPromise(function(_0x5cc449,_0x4e1f77){return client[_0x0856('0xb')](_0x54cddf,_0x3380cb)[_0x0856('0xc')](function(_0x8a939e){logger[_0x0856('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x10f3c6,_0x0856('0xe'));logger[_0x0856('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x10f3c6,'request\x20sent',JSON[_0x0856('0x10')](_0x8a939e));if(_0x8a939e['error']){if(_0x8a939e[_0x0856('0x11')]['code']===0x1f4){logger[_0x0856('0x11')](_0x0856('0x12'),_0x10f3c6,_0x8a939e['error'][_0x0856('0x13')]);return _0x4e1f77(_0x8a939e[_0x0856('0x11')][_0x0856('0x13')]);}logger[_0x0856('0x11')](_0x0856('0x12'),_0x10f3c6,_0x8a939e['error']['message']);return _0x5cc449(_0x8a939e['error'][_0x0856('0x13')]);}else{logger[_0x0856('0xd')](_0x0856('0x12'),_0x10f3c6,_0x0856('0xe'));_0x5cc449(_0x8a939e['result'][_0x0856('0x13')]);}})[_0x0856('0x14')](function(_0x2e9686){logger[_0x0856('0x11')](_0x0856('0x12'),_0x10f3c6,_0x2e9686);_0x4e1f77(_0x2e9686);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index ec34dec..1d310dc 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1cf28f,_0x2e75ea){var _0x51c3cd=function(_0x5c8ed7){while(--_0x5c8ed7){_0x1cf28f['push'](_0x1cf28f['shift']());}};_0x51c3cd(++_0x2e75ea);}(_0x70e0,0x17b));var _0x070e=function(_0x17f208,_0x241117){_0x17f208=_0x17f208-0x0;var _0x1c49d2=_0x70e0[_0x17f208];return _0x1c49d2;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x283697,_0x43d671){var _0x264030=function(_0x522e2c){while(--_0x522e2c){_0x283697['push'](_0x283697['shift']());}};_0x264030(++_0x43d671);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x134d5e,_0x2a47d8){_0x134d5e=_0x134d5e-0x0;var _0x1e166a=_0xcb91[_0x134d5e];return _0x1e166a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');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 1de5991..78c714b 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 _0x1d91=['STRING','sequelize','INTEGER'];(function(_0x30c713,_0x14ddfd){var _0x5791af=function(_0x17e37d){while(--_0x17e37d){_0x30c713['push'](_0x30c713['shift']());}};_0x5791af(++_0x14ddfd);}(_0x1d91,0x154));var _0x11d9=function(_0x4319e2,_0x335a67){_0x4319e2=_0x4319e2-0x0;var _0x4abbb5=_0x1d91[_0x4319e2];return _0x4abbb5;};'use strict';var Sequelize=require(_0x11d9('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x11d9('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x11d9('0x2')]}}; \ No newline at end of file +var _0xaa9f=['STRING','sequelize','exports','INTEGER'];(function(_0x5bdf54,_0x12cd1b){var _0x59522a=function(_0xb5db52){while(--_0xb5db52){_0x5bdf54['push'](_0x5bdf54['shift']());}};_0x59522a(++_0x12cd1b);}(_0xaa9f,0x1bd));var _0xfaa9=function(_0x1678c8,_0x1c32f4){_0x1678c8=_0x1678c8-0x0;var _0x387aa9=_0xaa9f[_0x1678c8];return _0x387aa9;};'use strict';var Sequelize=require(_0xfaa9('0x0'));module[_0xfaa9('0x1')]={'penalty':{'type':Sequelize[_0xfaa9('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xfaa9('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 96dea48..da69002 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 _0xf222=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash'];(function(_0x23f564,_0x48d2ba){var _0x47582b=function(_0x3a8876){while(--_0x3a8876){_0x23f564['push'](_0x23f564['shift']());}};_0x47582b(++_0x48d2ba);}(_0xf222,0x137));var _0x2f22=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf222[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x2f22('0x0'));var util=require(_0x2f22('0x1'));var logger=require(_0x2f22('0x2'))(_0x2f22('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2f22('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f22('0x5'));var config=require(_0x2f22('0x6'));var attributes=require(_0x2f22('0x7'));module[_0x2f22('0x8')]=function(_0x4427b3,_0x18e591){return _0x4427b3[_0x2f22('0x9')](_0x2f22('0xa'),attributes,{'tableName':_0x2f22('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x399f=['api','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger'];(function(_0x32c1de,_0x319a95){var _0x1e01d8=function(_0x342f06){while(--_0x342f06){_0x32c1de['push'](_0x32c1de['shift']());}};_0x1e01d8(++_0x319a95);}(_0x399f,0x1c4));var _0xf399=function(_0x240eb3,_0x8022b7){_0x240eb3=_0x240eb3-0x0;var _0x235a7d=_0x399f[_0x240eb3];return _0x235a7d;};'use strict';var _=require(_0xf399('0x0'));var util=require(_0xf399('0x1'));var logger=require(_0xf399('0x2'))(_0xf399('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf399('0x4'));var fs=require('fs');var path=require(_0xf399('0x5'));var rimraf=require(_0xf399('0x6'));var config=require(_0xf399('0x7'));var attributes=require(_0xf399('0x8'));module[_0xf399('0x9')]=function(_0x5c2ab9,_0x1757a1){return _0x5c2ab9[_0xf399('0xa')](_0xf399('0xb'),attributes,{'tableName':_0xf399('0xc'),'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 4449c06..36bb4cf 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 _0xd596=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch'];(function(_0x40c813,_0x7dde60){var _0x240166=function(_0x5c081b){while(--_0x5c081b){_0x40c813['push'](_0x40c813['shift']());}};_0x240166(++_0x7dde60);}(_0xd596,0x150));var _0x6d59=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0xd596[_0x1b1e76];return _0x3d743a;};'use strict';var _=require(_0x6d59('0x0'));var util=require(_0x6d59('0x1'));var moment=require(_0x6d59('0x2'));var BPromise=require(_0x6d59('0x3'));var rs=require(_0x6d59('0x4'));var fs=require('fs');var Redis=require(_0x6d59('0x5'));var db=require(_0x6d59('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6d59('0x7'))(_0x6d59('0x8'));var config=require(_0x6d59('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6d59('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52dfb0,_0x40f9ab,_0x5a13f7){return new BPromise(function(_0x18e80f,_0x375233){return client[_0x6d59('0xb')](_0x52dfb0,_0x5a13f7)[_0x6d59('0xc')](function(_0x329615){logger[_0x6d59('0xd')](_0x6d59('0xe'),_0x40f9ab,'request\x20sent');logger[_0x6d59('0xf')](_0x6d59('0x10'),_0x40f9ab,_0x6d59('0x11'),JSON['stringify'](_0x329615));if(_0x329615[_0x6d59('0x12')]){if(_0x329615[_0x6d59('0x12')]['code']===0x1f4){logger['error'](_0x6d59('0xe'),_0x40f9ab,_0x329615[_0x6d59('0x12')]['message']);return _0x375233(_0x329615['error'][_0x6d59('0x13')]);}logger[_0x6d59('0x12')](_0x6d59('0xe'),_0x40f9ab,_0x329615[_0x6d59('0x12')][_0x6d59('0x13')]);return _0x18e80f(_0x329615[_0x6d59('0x12')][_0x6d59('0x13')]);}else{logger[_0x6d59('0xd')](_0x6d59('0xe'),_0x40f9ab,_0x6d59('0x11'));_0x18e80f(_0x329615['result']['message']);}})[_0x6d59('0x14')](function(_0x94897a){logger[_0x6d59('0x12')](_0x6d59('0xe'),_0x40f9ab,_0x94897a);_0x375233(_0x94897a);});});} \ No newline at end of file +var _0xf60a=['../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x15658b,_0x32d0e5){var _0x47fa38=function(_0x7e535d){while(--_0x7e535d){_0x15658b['push'](_0x15658b['shift']());}};_0x47fa38(++_0x32d0e5);}(_0xf60a,0xaf));var _0xaf60=function(_0x351ad4,_0x20114a){_0x351ad4=_0x351ad4-0x0;var _0xa3efa3=_0xf60a[_0x351ad4];return _0xa3efa3;};'use strict';var _=require(_0xaf60('0x0'));var util=require(_0xaf60('0x1'));var moment=require(_0xaf60('0x2'));var BPromise=require(_0xaf60('0x3'));var rs=require(_0xaf60('0x4'));var fs=require('fs');var Redis=require(_0xaf60('0x5'));var db=require(_0xaf60('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaf60('0x7'))(_0xaf60('0x8'));var config=require(_0xaf60('0x9'));var jayson=require(_0xaf60('0xa'));var client=jayson[_0xaf60('0xb')][_0xaf60('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45735d,_0x315e92,_0xb40fc){return new BPromise(function(_0x5a78ab,_0xab134d){return client[_0xaf60('0xd')](_0x45735d,_0xb40fc)[_0xaf60('0xe')](function(_0x126b4f){logger[_0xaf60('0xf')](_0xaf60('0x10'),_0x315e92,_0xaf60('0x11'));logger[_0xaf60('0x12')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x315e92,_0xaf60('0x11'),JSON[_0xaf60('0x13')](_0x126b4f));if(_0x126b4f['error']){if(_0x126b4f['error']['code']===0x1f4){logger[_0xaf60('0x14')](_0xaf60('0x10'),_0x315e92,_0x126b4f['error'][_0xaf60('0x15')]);return _0xab134d(_0x126b4f[_0xaf60('0x14')]['message']);}logger[_0xaf60('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x315e92,_0x126b4f['error'][_0xaf60('0x15')]);return _0x5a78ab(_0x126b4f[_0xaf60('0x14')][_0xaf60('0x15')]);}else{logger[_0xaf60('0xf')](_0xaf60('0x10'),_0x315e92,_0xaf60('0x11'));_0x5a78ab(_0x126b4f[_0xaf60('0x16')]['message']);}})['catch'](function(_0x30f7b0){logger[_0xaf60('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x315e92,_0x30f7b0);_0xab134d(_0x30f7b0);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 4774f72..3e33983 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x13f196,_0x3af9c9){var _0x17bd9e=function(_0x49e6be){while(--_0x49e6be){_0x13f196['push'](_0x13f196['shift']());}};_0x17bd9e(++_0x3af9c9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3aed67,_0x2822a7){var _0x378176=function(_0x3e6c93){while(--_0x3e6c93){_0x3aed67['push'](_0x3aed67['shift']());}};_0x378176(++_0x2822a7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x40911a,_0x55ec99){_0x40911a=_0x40911a-0x0;var _0x27e8e3=_0xcb91[_0x40911a];return _0x27e8e3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 9630c60..c0b76b6 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 _0xc7c0=['exports','INTEGER'];(function(_0x1c6a8f,_0xbe4d68){var _0x4c3d1f=function(_0x17ba43){while(--_0x17ba43){_0x1c6a8f['push'](_0x1c6a8f['shift']());}};_0x4c3d1f(++_0xbe4d68);}(_0xc7c0,0x1c8));var _0x0c7c=function(_0x387ef5,_0x3e520b){_0x387ef5=_0x387ef5-0x0;var _0x34b356=_0xc7c0[_0x387ef5];return _0x34b356;};'use strict';var Sequelize=require('sequelize');module[_0x0c7c('0x0')]={'penalty':{'type':Sequelize[_0x0c7c('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x167b=['INTEGER','sequelize','exports'];(function(_0x5e5f5a,_0x5cb19a){var _0x4141ae=function(_0x4bb2ea){while(--_0x4bb2ea){_0x5e5f5a['push'](_0x5e5f5a['shift']());}};_0x4141ae(++_0x5cb19a);}(_0x167b,0x163));var _0xb167=function(_0x8584d6,_0x5d3337){_0x8584d6=_0x8584d6-0x0;var _0x49f863=_0x167b[_0x8584d6];return _0x49f863;};'use strict';var Sequelize=require(_0xb167('0x0'));module[_0xb167('0x1')]={'penalty':{'type':Sequelize[_0xb167('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 91c08ce..b800157 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 _0xb1fd=['user_has_mail_queues','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./userMailQueue.attributes','exports','define'];(function(_0x4b1b3c,_0x284f68){var _0x5c3afa=function(_0x229c38){while(--_0x229c38){_0x4b1b3c['push'](_0x4b1b3c['shift']());}};_0x5c3afa(++_0x284f68);}(_0xb1fd,0x173));var _0xdb1f=function(_0x59f1c2,_0x378533){_0x59f1c2=_0x59f1c2-0x0;var _0x1b69b6=_0xb1fd[_0x59f1c2];return _0x1b69b6;};'use strict';var _=require('lodash');var util=require(_0xdb1f('0x0'));var logger=require(_0xdb1f('0x1'))('api');var moment=require(_0xdb1f('0x2'));var BPromise=require(_0xdb1f('0x3'));var rp=require(_0xdb1f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdb1f('0x5'));var attributes=require(_0xdb1f('0x6'));module[_0xdb1f('0x7')]=function(_0x27cca7,_0x1ce32d){return _0x27cca7[_0xdb1f('0x8')]('UserMailQueue',attributes,{'tableName':_0xdb1f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x567f=['rimraf','../../config/environment','exports','define','user_has_mail_queues','lodash','util','../../config/logger','api','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x567f,0xe1));var _0xf567=function(_0x20713e,_0x44f710){_0x20713e=_0x20713e-0x0;var _0x7d998b=_0x567f[_0x20713e];return _0x7d998b;};'use strict';var _=require(_0xf567('0x0'));var util=require(_0xf567('0x1'));var logger=require(_0xf567('0x2'))(_0xf567('0x3'));var moment=require('moment');var BPromise=require(_0xf567('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf567('0x5'));var config=require(_0xf567('0x6'));var attributes=require('./userMailQueue.attributes');module[_0xf567('0x7')]=function(_0x3d9585,_0x4400ed){return _0x3d9585[_0xf567('0x8')]('UserMailQueue',attributes,{'tableName':_0xf567('0x9'),'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 f31998e..dd466e2 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7217,0x19e));var _0x7721=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x7217[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +var _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserMailQueue,\x20%s,\x20%s','message','result'];(function(_0x279755,_0x42ad77){var _0x138178=function(_0x462033){while(--_0x462033){_0x279755['push'](_0x279755['shift']());}};_0x138178(++_0x42ad77);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x20259c,_0xe43fb2){_0x20259c=_0x20259c-0x0;var _0x4d988e=_0xf3cd[_0x20259c];return _0x4d988e;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('UserMailQueue,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 6274e59..ce8d203 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 _0x028e=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated','exports','util','path'];(function(_0x4e4ee8,_0x4b507a){var _0x410289=function(_0x283383){while(--_0x283383){_0x4e4ee8['push'](_0x4e4ee8['shift']());}};_0x410289(++_0x4b507a);}(_0x028e,0x1ae));var _0xe028=function(_0x2ce5b9,_0x2b72b4){_0x2ce5b9=_0x2ce5b9-0x0;var _0x4f33c8=_0x028e[_0x2ce5b9];return _0x4f33c8;};'use strict';var multer=require('multer');var util=require(_0xe028('0x0'));var path=require(_0xe028('0x1'));var timeout=require(_0xe028('0x2'));var express=require(_0xe028('0x3'));var router=express[_0xe028('0x4')]();var fs_extra=require(_0xe028('0x5'));var auth=require(_0xe028('0x6'));var interaction=require(_0xe028('0x7'));var config=require(_0xe028('0x8'));var controller=require(_0xe028('0x9'));router['post']('/',auth[_0xe028('0xa')](),controller['sendUserNotification']);module[_0xe028('0xb')]=router; \ No newline at end of file +var _0x586a=['../../components/auth/service','../../components/interaction/service','./userNotification.controller','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0x586a,0x199));var _0xa586=function(_0x44737d,_0x2f74bf){_0x44737d=_0x44737d-0x0;var _0x2b01e1=_0x586a[_0x44737d];return _0x2b01e1;};'use strict';var multer=require(_0xa586('0x0'));var util=require(_0xa586('0x1'));var path=require(_0xa586('0x2'));var timeout=require(_0xa586('0x3'));var express=require(_0xa586('0x4'));var router=express[_0xa586('0x5')]();var fs_extra=require(_0xa586('0x6'));var auth=require(_0xa586('0x7'));var interaction=require(_0xa586('0x8'));var config=require('../../config/environment');var controller=require(_0xa586('0x9'));router['post']('/',auth[_0xa586('0xa')](),controller[_0xa586('0xb')]);module[_0xa586('0xc')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 16b326a..3b63aff 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 _0xd41b=['exports','TEXT','STRING','BOOLEAN'];(function(_0x53ad58,_0x3fb489){var _0x554b03=function(_0x5769ba){while(--_0x5769ba){_0x53ad58['push'](_0x53ad58['shift']());}};_0x554b03(++_0x3fb489);}(_0xd41b,0x1b8));var _0xbd41=function(_0x5ebae4,_0x5217b7){_0x5ebae4=_0x5ebae4-0x0;var _0x41ecce=_0xd41b[_0x5ebae4];return _0x41ecce;};'use strict';var Sequelize=require('sequelize');module[_0xbd41('0x0')]={'body':{'type':Sequelize[_0xbd41('0x1')]},'senderName':{'type':Sequelize[_0xbd41('0x2')]},'recipientsId':{'type':Sequelize[_0xbd41('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xbd41('0x3')]}}; \ No newline at end of file +var _0xdeae=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xdeae,0x11d));var _0xedea=function(_0x38b5f7,_0x153d04){_0x38b5f7=_0x38b5f7-0x0;var _0x34595c=_0xdeae[_0x38b5f7];return _0x34595c;};'use strict';var Sequelize=require(_0xedea('0x0'));module[_0xedea('0x1')]={'body':{'type':Sequelize[_0xedea('0x2')]},'senderName':{'type':Sequelize[_0xedea('0x3')]},'recipientsId':{'type':Sequelize[_0xedea('0x2')]},'recipientsDescription':{'type':Sequelize[_0xedea('0x3')]},'beep':{'type':Sequelize[_0xedea('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index efc5460..4d4e998 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 _0x274b=['fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','register','status','end','json','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error','name','sendUserNotification','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','Missing\x20\x27view\x27\x20parameter','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','forEach','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','startCase','toLowerCase','union','ids','queue','replace','Queue','push','all','eml-format','rimraf'];(function(_0x5b2907,_0x34d5e3){var _0x5eb408=function(_0x599677){while(--_0x599677){_0x5b2907['push'](_0x5b2907['shift']());}};_0x5eb408(++_0x34d5e3);}(_0x274b,0x1d4));var _0xb274=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x274b[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require(_0xb274('0x0'));var rimraf=require(_0xb274('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb274('0x2'));var rp=require(_0xb274('0x3'));var moment=require(_0xb274('0x4'));var BPromise=require(_0xb274('0x5'));var Mustache=require(_0xb274('0x6'));var util=require(_0xb274('0x7'));var path=require('path');var sox=require(_0xb274('0x8'));var csv=require(_0xb274('0x9'));var ejs=require(_0xb274('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb274('0xb'));var squel=require(_0xb274('0xc'));var crypto=require(_0xb274('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb274('0xe'));var toCsv=require(_0xb274('0x9'));var querystring=require(_0xb274('0xf'));var Papa=require('papaparse');var Redis=require(_0xb274('0x10'));var authService=require(_0xb274('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb274('0x12'));var hardwareService=require(_0xb274('0x13'));var logger=require(_0xb274('0x14'))('api');var utils=require(_0xb274('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb274('0x16'));var db=require(_0xb274('0x17'))['db'];config[_0xb274('0x18')]=_[_0xb274('0x19')](config[_0xb274('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb274('0x1a'))(new Redis(config[_0xb274('0x18')]));require(_0xb274('0x1b'))[_0xb274('0x1c')](socket);function respondWithStatusCode(_0x4e5cbb,_0x356d17){_0x356d17=_0x356d17||0xcc;return function(_0x12d551){if(_0x12d551){return _0x4e5cbb['sendStatus'](_0x356d17);}return _0x4e5cbb[_0xb274('0x1d')](_0x356d17)[_0xb274('0x1e')]();};}function respondWithResult(_0x53c660,_0x4bd793){_0x4bd793=_0x4bd793||0xc8;return function(_0x2d224d){if(_0x2d224d){return _0x53c660[_0xb274('0x1d')](_0x4bd793)[_0xb274('0x1f')](_0x2d224d);}};}function respondWithFilteredResult(_0xaebbe1,_0xbf8d82){return function(_0x170770){if(_0x170770){var _0x501180=typeof _0xbf8d82['offset']==='undefined'&&typeof _0xbf8d82[_0xb274('0x20')]==='undefined';var _0x3c812d=_0x170770[_0xb274('0x21')];var _0x4a9b11=_0x501180?0x0:_0xbf8d82['offset'];var _0x1e6a54=_0x501180?_0x170770[_0xb274('0x21')]:_0xbf8d82[_0xb274('0x22')]+_0xbf8d82[_0xb274('0x20')];var _0x1e9a20;if(_0x1e6a54>=_0x3c812d){_0x1e6a54=_0x3c812d;_0x1e9a20=0xc8;}else{_0x1e9a20=0xce;}_0xaebbe1[_0xb274('0x1d')](_0x1e9a20);return _0xaebbe1['set'](_0xb274('0x23'),_0x4a9b11+'-'+_0x1e6a54+'/'+_0x3c812d)[_0xb274('0x1f')](_0x170770);}return null;};}function patchUpdates(_0x124058){return function(_0x2ba87c){try{jsonpatch[_0xb274('0x24')](_0x2ba87c,_0x124058,!![]);}catch(_0x44d679){return BPromise[_0xb274('0x25')](_0x44d679);}return _0x2ba87c['save']();};}function saveUpdates(_0x4ef654,_0x2074ba){return function(_0x21853f){if(_0x21853f){return _0x21853f[_0xb274('0x26')](_0x4ef654)[_0xb274('0x27')](function(_0x289b41){return _0x289b41;});}return null;};}function removeEntity(_0x5a14e9,_0x273986){return function(_0x1be4ec){if(_0x1be4ec){return _0x1be4ec[_0xb274('0x28')]()[_0xb274('0x27')](function(){_0x5a14e9[_0xb274('0x1d')](0xcc)[_0xb274('0x1e')]();});}};}function handleEntityNotFound(_0x149027,_0x50c376){return function(_0x1f561f){if(!_0x1f561f){_0x149027['sendStatus'](0x194);}return _0x1f561f;};}function handleError(_0x435912,_0xbadcff){_0xbadcff=_0xbadcff||0x1f4;return function(_0x3df7cf){logger[_0xb274('0x29')](_0x3df7cf['stack']);if(_0x3df7cf[_0xb274('0x2a')]){delete _0x3df7cf['name'];}_0x435912[_0xb274('0x1d')](_0xbadcff)['send'](_0x3df7cf);};}exports[_0xb274('0x2b')]=function(_0x467b96,_0xe5ba31,_0x54f4b1){if(!_0x467b96[_0xb274('0x2c')][_0xb274('0x2d')](_0xb274('0x2e'))&&!_0x467b96[_0xb274('0x2c')][_0xb274('0x2d')]('TemplateId')){throw new db[(_0xb274('0x2f'))][(_0xb274('0x30'))](_0xb274('0x31'));}else{if(_0x467b96[_0xb274('0x2c')][_0xb274('0x2d')](_0xb274('0x32'))&&!_0x467b96[_0xb274('0x2c')][_0xb274('0x2d')]('view')){throw new db[(_0xb274('0x2f'))]['ValidationError'](_0xb274('0x33'));}if(!_0x467b96[_0xb274('0x2c')]['hasOwnProperty'](_0xb274('0x34'))){throw new db[(_0xb274('0x2f'))][(_0xb274('0x30'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0xf427b5=JSON['parse'](_0x467b96[_0xb274('0x2c')][_0xb274('0x34')]);}catch(_0xf4a2a4){logger['error'](_0xf4a2a4);throw new db[(_0xb274('0x2f'))][(_0xb274('0x30'))](_0xb274('0x35'));}var _0x30af21=[_0xb274('0x36'),'faxqueue',_0xb274('0x37'),_0xb274('0x38'),_0xb274('0x39'),'voicequeue',_0xb274('0x3a'),_0xb274('0x3b'),_0xb274('0x3c')];if(_['some'](_0xf427b5,function(_0x473e65){return!_[_0xb274('0x3d')](_0x30af21,_0x473e65[_0xb274('0x3e')]['toLowerCase']());})){throw new db[(_0xb274('0x2f'))][(_0xb274('0x30'))](_0xb274('0x3f'));}}}var _0x3f7fef={};_0x3f7fef[_0xb274('0x40')]=_0x467b96[_0xb274('0x2c')]['hasOwnProperty'](_0xb274('0x40'))?_0x467b96['body'][_0xb274('0x40')]:_0x467b96[_0xb274('0x3c')][_0xb274('0x41')];_0x3f7fef[_0xb274('0x42')]=_[_0xb274('0x43')](_0x467b96['body'][_0xb274('0x42')])?null:_0x467b96[_0xb274('0x2c')][_0xb274('0x42')];_0x3f7fef[_0xb274('0x44')]=_0x467b96[_0xb274('0x2c')][_0xb274('0x44')]||![];_0x3f7fef[_0xb274('0x45')]=_0x467b96[_0xb274('0x3c')]['id'];return getContent(_0x467b96['body'])[_0xb274('0x27')](function(_0x404f2c){_0x3f7fef[_0xb274('0x2c')]=_0x404f2c;return getRecipients(_0xf427b5);})[_0xb274('0x27')](function(_0x1f9b25){_0x3f7fef[_0xb274('0x46')]=_[_0xb274('0x47')](_0x1f9b25)[_0xb274('0x48')](',');return db[_0xb274('0x49')][_0xb274('0x4a')](function(_0x3916f7){return db[_0xb274('0x4b')]['create'](_0x3f7fef,{'raw':!![],'transaction':_0x3916f7})[_0xb274('0x27')](function(_0x3b11f8){var _0x80582={'sender':_0x3f7fef[_0xb274('0x40')],'description':_0x3f7fef[_0xb274('0x42')],'content':_0x3f7fef[_0xb274('0x2c')],'beep':_0x3f7fef['beep']};_0x1f9b25[_0xb274('0x4c')](function(_0x318e94){_0x80582['recipient']=_0x318e94;socket['emit'](_0xb274('0x4d'),_0x80582);});return _0x3b11f8;});});})['then'](respondWithResult(_0xe5ba31,0xc9))[_0xb274('0x4e')](handleError(_0xe5ba31,null));};function getContent(_0x217cb3){return new BPromise(function(_0x54f079,_0x526f5b){if(_0x217cb3[_0xb274('0x2e')]){_0x54f079(_0x217cb3['text']);return;}return db[_0xb274('0x4f')][_0xb274('0x50')]({'attributes':[_0xb274('0x51')],'where':{'id':_0x217cb3[_0xb274('0x32')]},'raw':!![]})[_0xb274('0x27')](function(_0x1d2ee7){if(!_0x1d2ee7)throw new db[(_0xb274('0x2f'))][(_0xb274('0x30'))](_0xb274('0x52'));var _0xa2a14=Mustache[_0xb274('0x53')](_0x1d2ee7[_0xb274('0x51')],_0x217cb3[_0xb274('0x54')]);_0x54f079(_0xa2a14);})[_0xb274('0x4e')](function(_0x564baf){_0x526f5b(_0x564baf);});});}function getRecipients(_0x1a5712){return new BPromise(function(_0x2601df,_0x433507){var _0x3d2e65=[];var _0x4030f6=[];_0x1a5712[_0xb274('0x4c')](function(_0x5ec02c){var _0x1bb1f4=_[_0xb274('0x55')](_0x5ec02c[_0xb274('0x3e')][_0xb274('0x56')]());if(_0x1bb1f4==='User'){_0x3d2e65=_[_0xb274('0x57')](_0x3d2e65,_0x5ec02c[_0xb274('0x58')]);}else{if(_[_0xb274('0x3d')](_0x1bb1f4,_0xb274('0x59')))_0x1bb1f4=_0x1bb1f4[_0xb274('0x5a')](_0xb274('0x59'),_0xb274('0x5b'));_0x5ec02c[_0xb274('0x58')][_0xb274('0x4c')](function(_0x561e53){_0x4030f6[_0xb274('0x5c')](getAgents(_0x1bb1f4,_0x561e53));});}});return BPromise[_0xb274('0x5d')](_0x4030f6)[_0xb274('0x27')](function(_0x3154d7){_0x3d2e65=_[_0xb274('0x57')](_0x3d2e65,_['flatten'](_0x3154d7));_0x2601df(_0x3d2e65);})[_0xb274('0x4e')](function(_0x2eafd7){_0x433507(_0x2eafd7);});});}function getAgents(_0x3ae8d0,_0x5e72b6){return new BPromise(function(_0x923f33,_0x9f99d4){return db[_0x3ae8d0][_0xb274('0x50')]({'where':{'id':_0x5e72b6}})[_0xb274('0x27')](function(_0x581404){return _0x581404['getAgents']({'attributes':['id'],'raw':!![]})[_0xb274('0x27')](function(_0x13fd5b){var _0x5ae7e9=_['map'](_0x13fd5b,'id');_0x923f33(_0x5ae7e9);});})[_0xb274('0x4e')](function(_0x78f30a){_0x9f99d4(_0x78f30a);});});} \ No newline at end of file +var _0xfbd5=['offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','sendUserNotification','text','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','whatsappqueue','team','user','some','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','sortBy','sequelize','transaction','UserNotification','create','forEach','recipient','userNotification:send','catch','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','html','startCase','User','ids','includes','queue','replace','Queue','push','all','union','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json'];(function(_0x79d706,_0x4e5e39){var _0x3c8c3d=function(_0x2cf0f4){while(--_0x2cf0f4){_0x79d706['push'](_0x79d706['shift']());}};_0x3c8c3d(++_0x4e5e39);}(_0xfbd5,0x116));var _0x5fbd=function(_0x2ad2c6,_0x31c419){_0x2ad2c6=_0x2ad2c6-0x0;var _0x37fd0b=_0xfbd5[_0x2ad2c6];return _0x37fd0b;};'use strict';var emlformat=require(_0x5fbd('0x0'));var rimraf=require(_0x5fbd('0x1'));var zipdir=require(_0x5fbd('0x2'));var jsonpatch=require(_0x5fbd('0x3'));var rp=require(_0x5fbd('0x4'));var moment=require(_0x5fbd('0x5'));var BPromise=require(_0x5fbd('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5fbd('0x7'));var sox=require(_0x5fbd('0x8'));var csv=require(_0x5fbd('0x9'));var ejs=require(_0x5fbd('0xa'));var fs=require('fs');var fs_extra=require(_0x5fbd('0xb'));var _=require(_0x5fbd('0xc'));var squel=require(_0x5fbd('0xd'));var crypto=require(_0x5fbd('0xe'));var jsforce=require(_0x5fbd('0xf'));var deskjs=require(_0x5fbd('0x10'));var toCsv=require(_0x5fbd('0x9'));var querystring=require('querystring');var Papa=require(_0x5fbd('0x11'));var Redis=require('ioredis');var authService=require(_0x5fbd('0x12'));var qs=require(_0x5fbd('0x13'));var as=require(_0x5fbd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5fbd('0x15'))(_0x5fbd('0x16'));var utils=require(_0x5fbd('0x17'));var config=require(_0x5fbd('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5fbd('0x19'))['db'];config['redis']=_[_0x5fbd('0x1a')](config[_0x5fbd('0x1b')],{'host':_0x5fbd('0x1c'),'port':0x18eb});var socket=require(_0x5fbd('0x1d'))(new Redis(config['redis']));require('./userNotification.socket')[_0x5fbd('0x1e')](socket);function respondWithStatusCode(_0x18c28b,_0x5ad551){_0x5ad551=_0x5ad551||0xcc;return function(_0x31dd9b){if(_0x31dd9b){return _0x18c28b[_0x5fbd('0x1f')](_0x5ad551);}return _0x18c28b[_0x5fbd('0x20')](_0x5ad551)['end']();};}function respondWithResult(_0x479e10,_0x585309){_0x585309=_0x585309||0xc8;return function(_0x4d437f){if(_0x4d437f){return _0x479e10[_0x5fbd('0x20')](_0x585309)[_0x5fbd('0x21')](_0x4d437f);}};}function respondWithFilteredResult(_0x3d0344,_0x4d61aa){return function(_0x5a4405){if(_0x5a4405){var _0x35c648=typeof _0x4d61aa[_0x5fbd('0x22')]===_0x5fbd('0x23')&&typeof _0x4d61aa[_0x5fbd('0x24')]===_0x5fbd('0x23');var _0x2a575c=_0x5a4405[_0x5fbd('0x25')];var _0x2d41b9=_0x35c648?0x0:_0x4d61aa['offset'];var _0x42e9ea=_0x35c648?_0x5a4405[_0x5fbd('0x25')]:_0x4d61aa['offset']+_0x4d61aa[_0x5fbd('0x24')];var _0x432302;if(_0x42e9ea>=_0x2a575c){_0x42e9ea=_0x2a575c;_0x432302=0xc8;}else{_0x432302=0xce;}_0x3d0344[_0x5fbd('0x20')](_0x432302);return _0x3d0344[_0x5fbd('0x26')]('Content-Range',_0x2d41b9+'-'+_0x42e9ea+'/'+_0x2a575c)[_0x5fbd('0x21')](_0x5a4405);}return null;};}function patchUpdates(_0x5f42bd){return function(_0x532ac){try{jsonpatch[_0x5fbd('0x27')](_0x532ac,_0x5f42bd,!![]);}catch(_0x553e39){return BPromise[_0x5fbd('0x28')](_0x553e39);}return _0x532ac[_0x5fbd('0x29')]();};}function saveUpdates(_0x5baf8c,_0x19ac3e){return function(_0x3f2578){if(_0x3f2578){return _0x3f2578[_0x5fbd('0x2a')](_0x5baf8c)[_0x5fbd('0x2b')](function(_0x1a663e){return _0x1a663e;});}return null;};}function removeEntity(_0x4646ee,_0xfb622){return function(_0x271b9a){if(_0x271b9a){return _0x271b9a[_0x5fbd('0x2c')]()[_0x5fbd('0x2b')](function(){_0x4646ee['status'](0xcc)[_0x5fbd('0x2d')]();});}};}function handleEntityNotFound(_0x312895,_0x187566){return function(_0xc4eeea){if(!_0xc4eeea){_0x312895['sendStatus'](0x194);}return _0xc4eeea;};}function handleError(_0x5180d3,_0x36ecd2){_0x36ecd2=_0x36ecd2||0x1f4;return function(_0x39c79d){logger[_0x5fbd('0x2e')](_0x39c79d[_0x5fbd('0x2f')]);if(_0x39c79d[_0x5fbd('0x30')]){delete _0x39c79d[_0x5fbd('0x30')];}_0x5180d3['status'](_0x36ecd2)[_0x5fbd('0x31')](_0x39c79d);};}exports[_0x5fbd('0x32')]=function(_0x3a7df6,_0xad8fdd,_0x5365bf){if(!_0x3a7df6['body']['hasOwnProperty'](_0x5fbd('0x33'))&&!_0x3a7df6[_0x5fbd('0x34')][_0x5fbd('0x35')](_0x5fbd('0x36'))){throw new db[(_0x5fbd('0x37'))][(_0x5fbd('0x38'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x3a7df6[_0x5fbd('0x34')][_0x5fbd('0x35')](_0x5fbd('0x36'))&&!_0x3a7df6[_0x5fbd('0x34')]['hasOwnProperty'](_0x5fbd('0x39'))){throw new db['Sequelize'][(_0x5fbd('0x38'))](_0x5fbd('0x3a'));}if(!_0x3a7df6[_0x5fbd('0x34')]['hasOwnProperty'](_0x5fbd('0x3b'))){throw new db['Sequelize'][(_0x5fbd('0x38'))](_0x5fbd('0x3c'));}else{try{var _0x341815=JSON[_0x5fbd('0x3d')](_0x3a7df6[_0x5fbd('0x34')][_0x5fbd('0x3b')]);}catch(_0xaa5b90){logger[_0x5fbd('0x2e')](_0xaa5b90);throw new db[(_0x5fbd('0x37'))][(_0x5fbd('0x38'))](_0x5fbd('0x3e'));}var _0x231143=[_0x5fbd('0x3f'),_0x5fbd('0x40'),_0x5fbd('0x41'),_0x5fbd('0x42'),'smsqueue','voicequeue',_0x5fbd('0x43'),_0x5fbd('0x44'),_0x5fbd('0x45')];if(_[_0x5fbd('0x46')](_0x341815,function(_0x32b18b){return!_['includes'](_0x231143,_0x32b18b['model'][_0x5fbd('0x47')]());})){throw new db[(_0x5fbd('0x37'))][(_0x5fbd('0x38'))](_0x5fbd('0x48'));}}}var _0x32fe77={};_0x32fe77[_0x5fbd('0x49')]=_0x3a7df6[_0x5fbd('0x34')]['hasOwnProperty']('senderName')?_0x3a7df6[_0x5fbd('0x34')][_0x5fbd('0x49')]:_0x3a7df6['user'][_0x5fbd('0x4a')];_0x32fe77[_0x5fbd('0x4b')]=_[_0x5fbd('0x4c')](_0x3a7df6['body']['recipientsDescription'])?null:_0x3a7df6['body'][_0x5fbd('0x4b')];_0x32fe77['beep']=_0x3a7df6[_0x5fbd('0x34')][_0x5fbd('0x4d')]||![];_0x32fe77[_0x5fbd('0x4e')]=_0x3a7df6[_0x5fbd('0x45')]['id'];return getContent(_0x3a7df6[_0x5fbd('0x34')])['then'](function(_0x10375e){_0x32fe77[_0x5fbd('0x34')]=_0x10375e;return getRecipients(_0x341815);})[_0x5fbd('0x2b')](function(_0x127665){_0x32fe77['recipientsId']=_[_0x5fbd('0x4f')](_0x127665)['join'](',');return db[_0x5fbd('0x50')][_0x5fbd('0x51')](function(_0x383396){return db[_0x5fbd('0x52')][_0x5fbd('0x53')](_0x32fe77,{'raw':!![],'transaction':_0x383396})[_0x5fbd('0x2b')](function(_0x415e65){var _0x44df6a={'sender':_0x32fe77[_0x5fbd('0x49')],'description':_0x32fe77[_0x5fbd('0x4b')],'content':_0x32fe77['body'],'beep':_0x32fe77[_0x5fbd('0x4d')]};_0x127665[_0x5fbd('0x54')](function(_0x482c42){_0x44df6a[_0x5fbd('0x55')]=_0x482c42;socket['emit'](_0x5fbd('0x56'),_0x44df6a);});return _0x415e65;});});})[_0x5fbd('0x2b')](respondWithResult(_0xad8fdd,0xc9))[_0x5fbd('0x57')](handleError(_0xad8fdd,null));};function getContent(_0x1bbaae){return new BPromise(function(_0x279f2e,_0x20a3f2){if(_0x1bbaae['text']){_0x279f2e(_0x1bbaae[_0x5fbd('0x33')]);return;}return db['Template'][_0x5fbd('0x58')]({'attributes':['html'],'where':{'id':_0x1bbaae[_0x5fbd('0x36')]},'raw':!![]})['then'](function(_0x323b37){if(!_0x323b37)throw new db['Sequelize']['ValidationError'](_0x5fbd('0x59'));var _0x5cd242=Mustache['render'](_0x323b37[_0x5fbd('0x5a')],_0x1bbaae[_0x5fbd('0x39')]);_0x279f2e(_0x5cd242);})[_0x5fbd('0x57')](function(_0x503a30){_0x20a3f2(_0x503a30);});});}function getRecipients(_0x355502){return new BPromise(function(_0x18823b,_0xe53baf){var _0x14fb9f=[];var _0x285f20=[];_0x355502[_0x5fbd('0x54')](function(_0x260653){var _0x45df00=_[_0x5fbd('0x5b')](_0x260653['model'][_0x5fbd('0x47')]());if(_0x45df00===_0x5fbd('0x5c')){_0x14fb9f=_['union'](_0x14fb9f,_0x260653[_0x5fbd('0x5d')]);}else{if(_[_0x5fbd('0x5e')](_0x45df00,_0x5fbd('0x5f')))_0x45df00=_0x45df00[_0x5fbd('0x60')](_0x5fbd('0x5f'),_0x5fbd('0x61'));_0x260653[_0x5fbd('0x5d')]['forEach'](function(_0x1ccc51){_0x285f20[_0x5fbd('0x62')](getAgents(_0x45df00,_0x1ccc51));});}});return BPromise[_0x5fbd('0x63')](_0x285f20)[_0x5fbd('0x2b')](function(_0x9da38f){_0x14fb9f=_[_0x5fbd('0x64')](_0x14fb9f,_[_0x5fbd('0x65')](_0x9da38f));_0x18823b(_0x14fb9f);})[_0x5fbd('0x57')](function(_0x400422){_0xe53baf(_0x400422);});});}function getAgents(_0x4c833f,_0x4a1267){return new BPromise(function(_0x2b6512,_0x1e1caa){return db[_0x4c833f][_0x5fbd('0x58')]({'where':{'id':_0x4a1267}})[_0x5fbd('0x2b')](function(_0x288b19){return _0x288b19[_0x5fbd('0x66')]({'attributes':['id'],'raw':!![]})['then'](function(_0x346124){var _0x198dc0=_[_0x5fbd('0x67')](_0x346124,'id');_0x2b6512(_0x198dc0);});})[_0x5fbd('0x57')](function(_0x3b708a){_0x1e1caa(_0x3b708a);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index d08e005..80a0b70 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 _0x7529=['../../mysqldb','UserNotification','setMaxListeners','remove','hook','exports','events'];(function(_0xe9a83,_0x54529c){var _0x1107fa=function(_0x3d66d9){while(--_0x3d66d9){_0xe9a83['push'](_0xe9a83['shift']());}};_0x1107fa(++_0x54529c);}(_0x7529,0xdf));var _0x9752=function(_0xe3d9de,_0x1f020b){_0xe3d9de=_0xe3d9de-0x0;var _0x2b9382=_0x7529[_0xe3d9de];return _0x2b9382;};'use strict';var EventEmitter=require(_0x9752('0x0'));var UserNotification=require(_0x9752('0x1'))['db'][_0x9752('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x9752('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9752('0x4')};function emitEvent(_0x33a2c9){return function(_0xc33133,_0x38f0be,_0x2a9da2){UserNotificationEvents['emit'](_0x33a2c9+':'+_0xc33133['id'],_0xc33133);UserNotificationEvents['emit'](_0x33a2c9,_0xc33133);_0x2a9da2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x9752('0x5')](e,emitEvent(event));}}module[_0x9752('0x6')]=UserNotificationEvents; \ No newline at end of file +var _0x87b2=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','save','update'];(function(_0x520e85,_0x457525){var _0x57dcc3=function(_0x4d436c){while(--_0x4d436c){_0x520e85['push'](_0x520e85['shift']());}};_0x57dcc3(++_0x457525);}(_0x87b2,0x69));var _0x287b=function(_0x3e5a4a,_0xd61f19){_0x3e5a4a=_0x3e5a4a-0x0;var _0x119bc0=_0x87b2[_0x3e5a4a];return _0x119bc0;};'use strict';var EventEmitter=require(_0x287b('0x0'));var UserNotification=require(_0x287b('0x1'))['db'][_0x287b('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x287b('0x3'),'afterUpdate':_0x287b('0x4'),'afterDestroy':_0x287b('0x5')};function emitEvent(_0x49494d){return function(_0x21233e,_0x253c6d,_0x31ce23){UserNotificationEvents[_0x287b('0x6')](_0x49494d+':'+_0x21233e['id'],_0x21233e);UserNotificationEvents[_0x287b('0x6')](_0x49494d,_0x21233e);_0x31ce23(null);};}for(var e in events){if(events[_0x287b('0x7')](e)){var event=events[e];UserNotification[_0x287b('0x8')](e,emitEvent(event));}}module[_0x287b('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 42b419d..832b4fb 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 _0xdda9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserNotification','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4a34f3,_0x37f8f6){var _0xefb6c9=function(_0x516184){while(--_0x516184){_0x4a34f3['push'](_0x4a34f3['shift']());}};_0xefb6c9(++_0x37f8f6);}(_0xdda9,0x78));var _0x9dda=function(_0x347b33,_0x1b84a8){_0x347b33=_0x347b33-0x0;var _0x5b6c18=_0xdda9[_0x347b33];return _0x5b6c18;};'use strict';var _=require(_0x9dda('0x0'));var util=require(_0x9dda('0x1'));var logger=require(_0x9dda('0x2'))(_0x9dda('0x3'));var moment=require(_0x9dda('0x4'));var BPromise=require(_0x9dda('0x5'));var rp=require(_0x9dda('0x6'));var fs=require('fs');var path=require(_0x9dda('0x7'));var rimraf=require(_0x9dda('0x8'));var config=require(_0x9dda('0x9'));var attributes=require('./userNotification.attributes');module[_0x9dda('0xa')]=function(_0x81d165,_0x296d76){return _0x81d165[_0x9dda('0xb')](_0x9dda('0xc'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9dda('0xd'),'collate':_0x9dda('0xe')});}; \ No newline at end of file +var _0x99d4=['UserNotification','userNotifications','lodash','../../config/logger','bluebird','request-promise','./userNotification.attributes','exports','define'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x99d4,0x122));var _0x499d=function(_0x4dc6ec,_0x99f444){_0x4dc6ec=_0x4dc6ec-0x0;var _0x3d042a=_0x99d4[_0x4dc6ec];return _0x3d042a;};'use strict';var _=require(_0x499d('0x0'));var util=require('util');var logger=require(_0x499d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x499d('0x2'));var rp=require(_0x499d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x499d('0x4'));module[_0x499d('0x5')]=function(_0x4748bc,_0x53264c){return _0x4748bc[_0x499d('0x6')](_0x499d('0x7'),attributes,{'tableName':_0x499d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 583489b..c7fb4a7 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 _0x2079=['debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','http','redis','socket.io-emitter','./userNotification.socket','register','request','info','UserNotification,\x20%s,\x20%s','request\x20sent'];(function(_0x289fbe,_0x148173){var _0x34eb3e=function(_0x515b55){while(--_0x515b55){_0x289fbe['push'](_0x289fbe['shift']());}};_0x34eb3e(++_0x148173);}(_0x2079,0xe3));var _0x9207=function(_0x14ebb6,_0x5884e4){_0x14ebb6=_0x14ebb6-0x0;var _0x111d41=_0x2079[_0x14ebb6];return _0x111d41;};'use strict';var _=require(_0x9207('0x0'));var util=require(_0x9207('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9207('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9207('0x3'));var logger=require(_0x9207('0x4'))(_0x9207('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9207('0x6')]({'port':0x232a});config[_0x9207('0x7')]=_['defaults'](config[_0x9207('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x9207('0x8'))(new Redis(config[_0x9207('0x7')]));require(_0x9207('0x9'))[_0x9207('0xa')](socket);function respondWithRpcPromise(_0x2a8dd6,_0x32dd59,_0x20f789){return new BPromise(function(_0x397b43,_0x305d00){return client[_0x9207('0xb')](_0x2a8dd6,_0x20f789)['then'](function(_0x51af37){logger[_0x9207('0xc')](_0x9207('0xd'),_0x32dd59,_0x9207('0xe'));logger[_0x9207('0xf')](_0x9207('0x10'),_0x32dd59,_0x9207('0xe'),JSON[_0x9207('0x11')](_0x51af37));if(_0x51af37[_0x9207('0x12')]){if(_0x51af37[_0x9207('0x12')][_0x9207('0x13')]===0x1f4){logger['error'](_0x9207('0xd'),_0x32dd59,_0x51af37[_0x9207('0x12')]['message']);return _0x305d00(_0x51af37[_0x9207('0x12')][_0x9207('0x14')]);}logger[_0x9207('0x12')](_0x9207('0xd'),_0x32dd59,_0x51af37['error'][_0x9207('0x14')]);return _0x397b43(_0x51af37[_0x9207('0x12')][_0x9207('0x14')]);}else{logger[_0x9207('0xc')]('UserNotification,\x20%s,\x20%s',_0x32dd59,'request\x20sent');_0x397b43(_0x51af37['result'][_0x9207('0x14')]);}})[_0x9207('0x15')](function(_0x247437){logger[_0x9207('0x12')]('UserNotification,\x20%s,\x20%s',_0x32dd59,_0x247437);_0x305d00(_0x247437);});});} \ No newline at end of file +var _0xbfcf=['debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','./userNotification.socket','register','then','info','UserNotification,\x20%s,\x20%s','request\x20sent'];(function(_0x40de62,_0x2efb79){var _0x56d2ca=function(_0x119bbf){while(--_0x119bbf){_0x40de62['push'](_0x40de62['shift']());}};_0x56d2ca(++_0x2efb79);}(_0xbfcf,0x126));var _0xfbfc=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0xbfcf[_0x291d3f];return _0x242080;};'use strict';var _=require(_0xfbfc('0x0'));var util=require(_0xfbfc('0x1'));var moment=require(_0xfbfc('0x2'));var BPromise=require('bluebird');var rs=require(_0xfbfc('0x3'));var fs=require('fs');var Redis=require(_0xfbfc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbfc('0x5'));var logger=require(_0xfbfc('0x6'))(_0xfbfc('0x7'));var config=require('../../config/environment');var jayson=require(_0xfbfc('0x8'));var client=jayson[_0xfbfc('0x9')]['http']({'port':0x232a});config[_0xfbfc('0xa')]=_['defaults'](config['redis'],{'host':_0xfbfc('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfbfc('0xa')]));require(_0xfbfc('0xc'))[_0xfbfc('0xd')](socket);function respondWithRpcPromise(_0x2b7577,_0x363a7d,_0x4daf7c){return new BPromise(function(_0x41b79c,_0x320625){return client['request'](_0x2b7577,_0x4daf7c)[_0xfbfc('0xe')](function(_0x1660d0){logger[_0xfbfc('0xf')](_0xfbfc('0x10'),_0x363a7d,_0xfbfc('0x11'));logger[_0xfbfc('0x12')](_0xfbfc('0x13'),_0x363a7d,_0xfbfc('0x11'),JSON[_0xfbfc('0x14')](_0x1660d0));if(_0x1660d0[_0xfbfc('0x15')]){if(_0x1660d0['error']['code']===0x1f4){logger['error'](_0xfbfc('0x10'),_0x363a7d,_0x1660d0[_0xfbfc('0x15')][_0xfbfc('0x16')]);return _0x320625(_0x1660d0['error'][_0xfbfc('0x16')]);}logger[_0xfbfc('0x15')](_0xfbfc('0x10'),_0x363a7d,_0x1660d0[_0xfbfc('0x15')][_0xfbfc('0x16')]);return _0x41b79c(_0x1660d0['error'][_0xfbfc('0x16')]);}else{logger[_0xfbfc('0xf')](_0xfbfc('0x10'),_0x363a7d,_0xfbfc('0x11'));_0x41b79c(_0x1660d0['result'][_0xfbfc('0x16')]);}})[_0xfbfc('0x17')](function(_0xde370e){logger[_0xfbfc('0x15')](_0xfbfc('0x10'),_0x363a7d,_0xde370e);_0x320625(_0xde370e);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 032ba1c..12a48b7 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 _0x97ce=['removeListener','length','userNotification:','save','remove','update','emit'];(function(_0x461467,_0x81d0dd){var _0x5c47da=function(_0x5a10a8){while(--_0x5a10a8){_0x461467['push'](_0x461467['shift']());}};_0x5c47da(++_0x81d0dd);}(_0x97ce,0xab));var _0xe97c=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x97ce[_0x39c734];return _0xb2a2f9;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xe97c('0x0'),_0xe97c('0x1'),_0xe97c('0x2')];function createListener(_0x3439e6,_0x40d5c4){return function(_0x18b9d1){_0x40d5c4[_0xe97c('0x3')](_0x3439e6,_0x18b9d1);};}function removeListener(_0x2cd366,_0x53678d){return function(){UserNotificationEvents[_0xe97c('0x4')](_0x2cd366,_0x53678d);};}exports['register']=function(_0x4b7d4e){for(var _0x457f1f=0x0,_0x4b5977=events[_0xe97c('0x5')];_0x457f1f<_0x4b5977;_0x457f1f++){var _0x32891c=events[_0x457f1f];var _0x3f026d=createListener(_0xe97c('0x6')+_0x32891c,_0x4b7d4e);UserNotificationEvents['on'](_0x32891c,_0x3f026d);}}; \ No newline at end of file +var _0x708c=['length','userNotification:','./userNotification.events','save','remove','update','emit'];(function(_0x44fce0,_0x92278a){var _0x5c1498=function(_0x2a42b6){while(--_0x2a42b6){_0x44fce0['push'](_0x44fce0['shift']());}};_0x5c1498(++_0x92278a);}(_0x708c,0xe9));var _0xc708=function(_0x364d91,_0x2ff4fa){_0x364d91=_0x364d91-0x0;var _0x432f36=_0x708c[_0x364d91];return _0x432f36;};'use strict';var UserNotificationEvents=require(_0xc708('0x0'));var events=[_0xc708('0x1'),_0xc708('0x2'),_0xc708('0x3')];function createListener(_0x2edca8,_0x13e622){return function(_0x474075){_0x13e622[_0xc708('0x4')](_0x2edca8,_0x474075);};}function removeListener(_0x1e10ce,_0x3c5d1b){return function(){UserNotificationEvents['removeListener'](_0x1e10ce,_0x3c5d1b);};}exports['register']=function(_0x578751){for(var _0x35869a=0x0,_0x3f68d9=events[_0xc708('0x5')];_0x35869a<_0x3f68d9;_0x35869a++){var _0x5ad6e8=events[_0x35869a];var _0xbd494a=createListener(_0xc708('0x6')+_0x5ad6e8,_0x578751);UserNotificationEvents['on'](_0x5ad6e8,_0xbd494a);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 89b2c1c..119c58e 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x161f0c,_0x2c3ef4){var _0x460a00=function(_0x34284b){while(--_0x34284b){_0x161f0c['push'](_0x161f0c['shift']());}};_0x460a00(++_0x2c3ef4);}(_0xe706,0xa3));var _0x6e70=function(_0x1f625b,_0x276b0e){_0x1f625b=_0x1f625b-0x0;var _0x748222=_0xe706[_0x1f625b];return _0x748222;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5aca71,_0x583dfa){var _0x375f79=function(_0x3b2d5e){while(--_0x3b2d5e){_0x5aca71['push'](_0x5aca71['shift']());}};_0x375f79(++_0x583dfa);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index b0e796a..41d01e5 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 _0x9843=['sequelize'];(function(_0x22a013,_0x5a082e){var _0x493eaa=function(_0x5d1896){while(--_0x5d1896){_0x22a013['push'](_0x22a013['shift']());}};_0x493eaa(++_0x5a082e);}(_0x9843,0xaa));var _0x3984=function(_0x25ddfa,_0xbc4e37){_0x25ddfa=_0x25ddfa-0x0;var _0x10ce7b=_0x9843[_0x25ddfa];return _0x10ce7b;};'use strict';var Sequelize=require(_0x3984('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb56a=['INTEGER','exports'];(function(_0x1e8be5,_0x3fa4b0){var _0x1627c0=function(_0x32bc40){while(--_0x32bc40){_0x1e8be5['push'](_0x1e8be5['shift']());}};_0x1627c0(++_0x3fa4b0);}(_0xb56a,0xab));var _0xab56=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xb56a[_0x12f688];return _0x59c3de;};'use strict';var Sequelize=require('sequelize');module[_0xab56('0x0')]={'penalty':{'type':Sequelize[_0xab56('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index e3dd9d2..2dcaa2d 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 _0x64d0=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0xf1f37e,_0x159a20){var _0x2e3a6d=function(_0x4163cd){while(--_0x4163cd){_0xf1f37e['push'](_0xf1f37e['shift']());}};_0x2e3a6d(++_0x159a20);}(_0x64d0,0x1a7));var _0x064d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64d0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x064d('0x0'));var util=require(_0x064d('0x1'));var logger=require(_0x064d('0x2'))(_0x064d('0x3'));var moment=require(_0x064d('0x4'));var BPromise=require('bluebird');var rp=require(_0x064d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x064d('0x6'));var config=require(_0x064d('0x7'));var attributes=require(_0x064d('0x8'));module[_0x064d('0x9')]=function(_0x4a0db7,_0x1b62af){return _0x4a0db7[_0x064d('0xa')](_0x064d('0xb'),attributes,{'tableName':_0x064d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x598e=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x548514,_0x517190){var _0x1aa7b9=function(_0x292fde){while(--_0x292fde){_0x548514['push'](_0x548514['shift']());}};_0x1aa7b9(++_0x517190);}(_0x598e,0xd6));var _0xe598=function(_0x47eedd,_0x45ba0a){_0x47eedd=_0x47eedd-0x0;var _0x522ed4=_0x598e[_0x47eedd];return _0x522ed4;};'use strict';var _=require('lodash');var util=require(_0xe598('0x0'));var logger=require(_0xe598('0x1'))('api');var moment=require(_0xe598('0x2'));var BPromise=require(_0xe598('0x3'));var rp=require(_0xe598('0x4'));var fs=require('fs');var path=require(_0xe598('0x5'));var rimraf=require(_0xe598('0x6'));var config=require(_0xe598('0x7'));var attributes=require(_0xe598('0x8'));module[_0xe598('0x9')]=function(_0x2b0fe2,_0x43ada4){return _0x2b0fe2[_0xe598('0xa')]('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','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 559e2ec..77ee006 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 _0x545b=['then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x4cabc5,_0x4caa1a){var _0x5009fc=function(_0x5a5335){while(--_0x5a5335){_0x4cabc5['push'](_0x4cabc5['shift']());}};_0x5009fc(++_0x4caa1a);}(_0x545b,0x128));var _0xb545=function(_0x187dfb,_0x33bfce){_0x187dfb=_0x187dfb-0x0;var _0x1116df=_0x545b[_0x187dfb];return _0x1116df;};'use strict';var _=require(_0xb545('0x0'));var util=require(_0xb545('0x1'));var moment=require(_0xb545('0x2'));var BPromise=require(_0xb545('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb545('0x4'));var db=require(_0xb545('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb545('0x6'))(_0xb545('0x7'));var config=require(_0xb545('0x8'));var jayson=require(_0xb545('0x9'));var client=jayson[_0xb545('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b8cdb,_0x48019a,_0x4f94f8){return new BPromise(function(_0x368e47,_0x2972f6){return client[_0xb545('0xb')](_0x2b8cdb,_0x4f94f8)[_0xb545('0xc')](function(_0x5c1277){logger[_0xb545('0xd')](_0xb545('0xe'),_0x48019a,_0xb545('0xf'));logger[_0xb545('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x48019a,_0xb545('0xf'),JSON[_0xb545('0x11')](_0x5c1277));if(_0x5c1277['error']){if(_0x5c1277[_0xb545('0x12')][_0xb545('0x13')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x48019a,_0x5c1277[_0xb545('0x12')][_0xb545('0x14')]);return _0x2972f6(_0x5c1277['error'][_0xb545('0x14')]);}logger['error'](_0xb545('0xe'),_0x48019a,_0x5c1277[_0xb545('0x12')][_0xb545('0x14')]);return _0x368e47(_0x5c1277['error'][_0xb545('0x14')]);}else{logger[_0xb545('0xd')](_0xb545('0xe'),_0x48019a,_0xb545('0xf'));_0x368e47(_0x5c1277[_0xb545('0x15')][_0xb545('0x14')]);}})['catch'](function(_0x4025ae){logger[_0xb545('0x12')](_0xb545('0xe'),_0x48019a,_0x4025ae);_0x2972f6(_0x4025ae);});});} \ No newline at end of file +var _0x3120=['client','http','request','then','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UserOpenchannelQueue,\x20%s,\x20%s','lodash','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x48e645,_0x53cc57){var _0x2902f5=function(_0x2c3d4c){while(--_0x2c3d4c){_0x48e645['push'](_0x48e645['shift']());}};_0x2902f5(++_0x53cc57);}(_0x3120,0x92));var _0x0312=function(_0xa87484,_0x3fa98d){_0xa87484=_0xa87484-0x0;var _0x1b31b9=_0x3120[_0xa87484];return _0x1b31b9;};'use strict';var _=require(_0x0312('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0312('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x0312('0x2'));var logger=require(_0x0312('0x3'))('rpc');var config=require(_0x0312('0x4'));var jayson=require(_0x0312('0x5'));var client=jayson[_0x0312('0x6')][_0x0312('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x464eae,_0x332da7,_0x35ba36){return new BPromise(function(_0x3ff632,_0x2eea60){return client[_0x0312('0x8')](_0x464eae,_0x35ba36)[_0x0312('0x9')](function(_0x1f10c0){logger[_0x0312('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x332da7,_0x0312('0xb'));logger[_0x0312('0xc')](_0x0312('0xd'),_0x332da7,_0x0312('0xb'),JSON[_0x0312('0xe')](_0x1f10c0));if(_0x1f10c0[_0x0312('0xf')]){if(_0x1f10c0[_0x0312('0xf')]['code']===0x1f4){logger[_0x0312('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x332da7,_0x1f10c0[_0x0312('0xf')][_0x0312('0x10')]);return _0x2eea60(_0x1f10c0[_0x0312('0xf')]['message']);}logger[_0x0312('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x332da7,_0x1f10c0[_0x0312('0xf')][_0x0312('0x10')]);return _0x3ff632(_0x1f10c0[_0x0312('0xf')][_0x0312('0x10')]);}else{logger[_0x0312('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x332da7,_0x0312('0xb'));_0x3ff632(_0x1f10c0[_0x0312('0x11')][_0x0312('0x10')]);}})['catch'](function(_0x38434f){logger['error'](_0x0312('0x12'),_0x332da7,_0x38434f);_0x2eea60(_0x38434f);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 922bae8..e168f5a 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 _0x17f5=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','addSections','addResources','put','update','destroy','delete','removeResources','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x468938,_0x550e5c){var _0x727af0=function(_0x65b60d){while(--_0x65b60d){_0x468938['push'](_0x468938['shift']());}};_0x727af0(++_0x550e5c);}(_0x17f5,0xaf));var _0x517f=function(_0x53ecf0,_0x16240c){_0x53ecf0=_0x53ecf0-0x0;var _0x100d28=_0x17f5[_0x53ecf0];return _0x100d28;};'use strict';var multer=require(_0x517f('0x0'));var util=require(_0x517f('0x1'));var path=require(_0x517f('0x2'));var timeout=require(_0x517f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x517f('0x4'));var auth=require(_0x517f('0x5'));var interaction=require(_0x517f('0x6'));var config=require(_0x517f('0x7'));var controller=require(_0x517f('0x8'));router[_0x517f('0x9')]('/',auth[_0x517f('0xa')](),controller['index']);router[_0x517f('0x9')](_0x517f('0xb'),auth[_0x517f('0xa')](),controller[_0x517f('0xc')]);router['get'](_0x517f('0xd'),auth['isAuthenticated'](),controller[_0x517f('0xe')]);router[_0x517f('0x9')](_0x517f('0xf'),auth['isAuthenticated'](),controller[_0x517f('0x10')]);router[_0x517f('0x9')](_0x517f('0x11'),auth['isAuthenticated'](),controller[_0x517f('0x12')]);router[_0x517f('0x13')]('/',auth[_0x517f('0xa')](),controller[_0x517f('0x14')]);router[_0x517f('0x13')](_0x517f('0x15'),auth[_0x517f('0xa')](),controller['clone']);router[_0x517f('0x13')](_0x517f('0xf'),auth['isAuthenticated'](),controller[_0x517f('0x16')]);router[_0x517f('0x13')](_0x517f('0x11'),auth[_0x517f('0xa')](),controller[_0x517f('0x17')]);router[_0x517f('0x18')](_0x517f('0xd'),auth['isAuthenticated'](),controller[_0x517f('0x19')]);router['delete'](_0x517f('0xd'),auth[_0x517f('0xa')](),controller[_0x517f('0x1a')]);router['delete'](_0x517f('0xf'),auth[_0x517f('0xa')](),controller['removeSections']);router[_0x517f('0x1b')](_0x517f('0x11'),auth[_0x517f('0xa')](),controller[_0x517f('0x1c')]);module[_0x517f('0x1d')]=router; \ No newline at end of file +var _0x29c9=['destroy','removeSections','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/sections','/:id/resources','getResources','create','/:id/clone','clone','post','update','delete'];(function(_0x57dbce,_0x2a4604){var _0x2ab396=function(_0x321f80){while(--_0x321f80){_0x57dbce['push'](_0x57dbce['shift']());}};_0x2ab396(++_0x2a4604);}(_0x29c9,0x85));var _0x929c=function(_0x2ef53e,_0x502c7b){_0x2ef53e=_0x2ef53e-0x0;var _0x533af6=_0x29c9[_0x2ef53e];return _0x533af6;};'use strict';var multer=require(_0x929c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x929c('0x1'));var express=require(_0x929c('0x2'));var router=express[_0x929c('0x3')]();var fs_extra=require(_0x929c('0x4'));var auth=require(_0x929c('0x5'));var interaction=require(_0x929c('0x6'));var config=require('../../config/environment');var controller=require(_0x929c('0x7'));router[_0x929c('0x8')]('/',auth['isAuthenticated'](),controller[_0x929c('0x9')]);router['get'](_0x929c('0xa'),auth[_0x929c('0xb')](),controller['describe']);router['get'](_0x929c('0xc'),auth['isAuthenticated'](),controller[_0x929c('0xd')]);router[_0x929c('0x8')](_0x929c('0xe'),auth[_0x929c('0xb')](),controller['getSections']);router[_0x929c('0x8')](_0x929c('0xf'),auth[_0x929c('0xb')](),controller[_0x929c('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x929c('0x11')]);router['post'](_0x929c('0x12'),auth[_0x929c('0xb')](),controller[_0x929c('0x13')]);router[_0x929c('0x14')](_0x929c('0xe'),auth[_0x929c('0xb')](),controller['addSections']);router[_0x929c('0x14')](_0x929c('0xf'),auth[_0x929c('0xb')](),controller['addResources']);router['put'](_0x929c('0xc'),auth[_0x929c('0xb')](),controller[_0x929c('0x15')]);router[_0x929c('0x16')](_0x929c('0xc'),auth[_0x929c('0xb')](),controller[_0x929c('0x17')]);router[_0x929c('0x16')](_0x929c('0xe'),auth[_0x929c('0xb')](),controller[_0x929c('0x18')]);router['delete'](_0x929c('0xf'),auth['isAuthenticated'](),controller['removeResources']);module[_0x929c('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index de55b61..9c628d4 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 _0x6a6b=['crudPermissions','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x27a611,_0xe00621){var _0x39c5de=function(_0x1bdcfc){while(--_0x1bdcfc){_0x27a611['push'](_0x27a611['shift']());}};_0x39c5de(++_0xe00621);}(_0x6a6b,0xd3));var _0xb6a6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x6a6b[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0xb6a6('0x0'));module[_0xb6a6('0x1')]={'name':{'type':Sequelize[_0xb6a6('0x2')],'allowNull':![],'unique':_0xb6a6('0x3')},'crudPermissions':{'type':Sequelize[_0xb6a6('0x2')],'set':function(_0x1aadbe){this[_0xb6a6('0x4')](_0xb6a6('0x5'),_0x1aadbe?_0x1aadbe['join'](''):[]);},'get':function(){return this[_0xb6a6('0x6')](_0xb6a6('0x5'))?this['getDataValue'](_0xb6a6('0x5'))[_0xb6a6('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xb6a6('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xb6a6('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xb6a6('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xb6a6('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xb6a6('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4f59=['sequelize','STRING','join','getDataValue','crudPermissions','split','BOOLEAN'];(function(_0x103513,_0x3370dd){var _0x44b4d4=function(_0x222ecb){while(--_0x222ecb){_0x103513['push'](_0x103513['shift']());}};_0x44b4d4(++_0x3370dd);}(_0x4f59,0xd2));var _0x94f5=function(_0x474c66,_0xbce925){_0x474c66=_0x474c66-0x0;var _0xcbd9bf=_0x4f59[_0x474c66];return _0xcbd9bf;};'use strict';var Sequelize=require(_0x94f5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x94f5('0x1')],'set':function(_0x222263){this['setDataValue']('crudPermissions',_0x222263?_0x222263[_0x94f5('0x2')](''):[]);},'get':function(){return this[_0x94f5('0x3')](_0x94f5('0x4'))?this[_0x94f5('0x3')]('crudPermissions')[_0x94f5('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x94f5('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x94f5('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x94f5('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x94f5('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x94f5('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x94f5('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x94f5('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 8d99e53..7883cb3 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 _0x1855=['isEmpty','subsections','concat','push','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','Missing\x20section\x20parameter','hasOwnProperty','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','send','index','map','UserProfile','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','params','length','includeAll','include','find','create','clone','get','omit','createdAt','updatedAt','crudPermissions','body','sequelize','transaction','UserProfileSection','each','autoAssociation','userProfileId','Resources','describe','sectionId','UserProfileResource','removeSections','name','ids','getSections','enabled','includes'];(function(_0x35359b,_0x1ec5a5){var _0x48e3df=function(_0x36f2e5){while(--_0x36f2e5){_0x35359b['push'](_0x35359b['shift']());}};_0x48e3df(++_0x1ec5a5);}(_0x1855,0x82));var _0x5185=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x1855[_0x2a6809];return _0x11c371;};'use strict';var emlformat=require(_0x5185('0x0'));var rimraf=require(_0x5185('0x1'));var zipdir=require(_0x5185('0x2'));var jsonpatch=require(_0x5185('0x3'));var rp=require(_0x5185('0x4'));var moment=require(_0x5185('0x5'));var BPromise=require(_0x5185('0x6'));var Mustache=require('mustache');var util=require(_0x5185('0x7'));var path=require(_0x5185('0x8'));var sox=require(_0x5185('0x9'));var csv=require('to-csv');var ejs=require(_0x5185('0xa'));var fs=require('fs');var fs_extra=require(_0x5185('0xb'));var _=require(_0x5185('0xc'));var squel=require(_0x5185('0xd'));var crypto=require(_0x5185('0xe'));var jsforce=require(_0x5185('0xf'));var deskjs=require(_0x5185('0x10'));var toCsv=require(_0x5185('0x11'));var querystring=require(_0x5185('0x12'));var Papa=require(_0x5185('0x13'));var Redis=require('ioredis');var authService=require(_0x5185('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x5185('0x15'));var hardwareService=require(_0x5185('0x16'));var logger=require('../../config/logger')(_0x5185('0x17'));var utils=require(_0x5185('0x18'));var config=require(_0x5185('0x19'));var licenseUtil=require(_0x5185('0x1a'));var db=require(_0x5185('0x1b'))['db'];config[_0x5185('0x1c')]=_[_0x5185('0x1d')](config[_0x5185('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x5185('0x1e'))(new Redis(config['redis']));require(_0x5185('0x1f'))['register'](socket);function respondWithStatusCode(_0x288cf6,_0x2d9c22){_0x2d9c22=_0x2d9c22||0xcc;return function(_0x20d51f){if(_0x20d51f){return _0x288cf6[_0x5185('0x20')](_0x2d9c22);}return _0x288cf6['status'](_0x2d9c22)[_0x5185('0x21')]();};}function respondWithResult(_0x2111f0,_0x9151ff){_0x9151ff=_0x9151ff||0xc8;return function(_0x1d792b){if(_0x1d792b){return _0x2111f0[_0x5185('0x22')](_0x9151ff)['json'](_0x1d792b);}};}function respondWithFilteredResult(_0x9d697,_0x3d9d71){return function(_0x49b02c){if(_0x49b02c){var _0x2d5782=typeof _0x3d9d71[_0x5185('0x23')]===_0x5185('0x24')&&typeof _0x3d9d71[_0x5185('0x25')]==='undefined';var _0x3c0807=_0x49b02c['count'];var _0x549419=_0x2d5782?0x0:_0x3d9d71['offset'];var _0x2ce11e=_0x2d5782?_0x49b02c[_0x5185('0x26')]:_0x3d9d71[_0x5185('0x23')]+_0x3d9d71[_0x5185('0x25')];var _0x4e3c67;if(_0x2ce11e>=_0x3c0807){_0x2ce11e=_0x3c0807;_0x4e3c67=0xc8;}else{_0x4e3c67=0xce;}_0x9d697[_0x5185('0x22')](_0x4e3c67);return _0x9d697[_0x5185('0x27')](_0x5185('0x28'),_0x549419+'-'+_0x2ce11e+'/'+_0x3c0807)['json'](_0x49b02c);}return null;};}function patchUpdates(_0x39c134){return function(_0x2da523){try{jsonpatch[_0x5185('0x29')](_0x2da523,_0x39c134,!![]);}catch(_0x3c77d7){return BPromise[_0x5185('0x2a')](_0x3c77d7);}return _0x2da523['save']();};}function saveUpdates(_0x2cfc1e,_0x30dbf0){return function(_0x41a295){if(_0x41a295){return _0x41a295[_0x5185('0x2b')](_0x2cfc1e)[_0x5185('0x2c')](function(_0x456f61){return _0x456f61;});}return null;};}function removeEntity(_0x31cee1,_0x2a392e){return function(_0x45b41a){if(_0x45b41a){return _0x45b41a[_0x5185('0x2d')]()[_0x5185('0x2c')](function(){_0x31cee1['status'](0xcc)[_0x5185('0x21')]();});}};}function handleEntityNotFound(_0x586aa7,_0xfe2641){return function(_0x37c98e){if(!_0x37c98e){_0x586aa7['sendStatus'](0x194);}return _0x37c98e;};}function handleError(_0x259db6,_0x5dff32){_0x5dff32=_0x5dff32||0x1f4;return function(_0x175b27){logger[_0x5185('0x2e')](_0x175b27[_0x5185('0x2f')]);if(_0x175b27['name']){delete _0x175b27['name'];}_0x259db6[_0x5185('0x22')](_0x5dff32)[_0x5185('0x30')](_0x175b27);};}exports[_0x5185('0x31')]=function(_0x3be947,_0x533820){var _0x443c97={},_0x14efd7={},_0x2666a5={'count':0x0,'rows':[]};var _0x3afeed=_[_0x5185('0x32')](db[_0x5185('0x33')][_0x5185('0x34')],function(_0x17a52d){return{'name':_0x17a52d[_0x5185('0x35')],'type':_0x17a52d[_0x5185('0x36')]['key']};});_0x14efd7[_0x5185('0x37')]=_[_0x5185('0x32')](_0x3afeed,'name');_0x14efd7[_0x5185('0x38')]=_[_0x5185('0x39')](_0x3be947['query']);_0x14efd7[_0x5185('0x3a')]=_[_0x5185('0x3b')](_0x14efd7[_0x5185('0x37')],_0x14efd7[_0x5185('0x38')]);_0x443c97[_0x5185('0x3c')]=_[_0x5185('0x3b')](_0x14efd7[_0x5185('0x37')],qs[_0x5185('0x3d')](_0x3be947[_0x5185('0x38')][_0x5185('0x3d')]));_0x443c97['attributes']=_0x443c97[_0x5185('0x3c')]['length']?_0x443c97[_0x5185('0x3c')]:_0x14efd7[_0x5185('0x37')];if(!_0x3be947[_0x5185('0x38')]['hasOwnProperty'](_0x5185('0x3e'))){_0x443c97[_0x5185('0x25')]=qs['limit'](_0x3be947['query'][_0x5185('0x25')]);_0x443c97['offset']=qs['offset'](_0x3be947[_0x5185('0x38')][_0x5185('0x23')]);}_0x443c97['order']=qs[_0x5185('0x3f')](_0x3be947[_0x5185('0x38')][_0x5185('0x3f')]);_0x443c97[_0x5185('0x40')]=qs[_0x5185('0x3a')](_[_0x5185('0x41')](_0x3be947[_0x5185('0x38')],_0x14efd7[_0x5185('0x3a')]),_0x3afeed);if(_0x3be947[_0x5185('0x38')]['filter']){_0x443c97['where']=_[_0x5185('0x42')](_0x443c97[_0x5185('0x40')],{'$or':_[_0x5185('0x32')](_0x3afeed,function(_0x3e1b1b){if(_0x3e1b1b[_0x5185('0x36')]!==_0x5185('0x43')){var _0x1655d0={};_0x1655d0[_0x3e1b1b['name']]={'$like':'%'+_0x3be947['query'][_0x5185('0x44')]+'%'};return _0x1655d0;}})});}_0x443c97=_['merge']({},_0x443c97,_0x3be947[_0x5185('0x45')]);var _0x273413={'where':_0x443c97[_0x5185('0x40')]};return db[_0x5185('0x33')][_0x5185('0x26')](_0x273413)[_0x5185('0x2c')](function(_0x27cb35){_0x2666a5[_0x5185('0x26')]=_0x27cb35;if(_0x3be947[_0x5185('0x38')]['includeAll']){_0x443c97['include']=[{'all':!![]}];}return db[_0x5185('0x33')][_0x5185('0x46')](_0x443c97);})[_0x5185('0x2c')](function(_0x20c100){_0x2666a5[_0x5185('0x47')]=_0x20c100;return _0x2666a5;})[_0x5185('0x2c')](respondWithFilteredResult(_0x533820,_0x443c97))[_0x5185('0x48')](handleError(_0x533820,null));};exports['show']=function(_0x3bd6b1,_0x3d1799){var _0x1bcb52={'raw':![],'where':{'id':_0x3bd6b1[_0x5185('0x49')]['id']}},_0x9c763d={};_0x9c763d[_0x5185('0x37')]=_[_0x5185('0x39')](db[_0x5185('0x33')][_0x5185('0x34')]);_0x9c763d[_0x5185('0x38')]=_[_0x5185('0x39')](_0x3bd6b1[_0x5185('0x38')]);_0x9c763d['filters']=_[_0x5185('0x3b')](_0x9c763d['model'],_0x9c763d[_0x5185('0x38')]);_0x1bcb52[_0x5185('0x3c')]=_[_0x5185('0x3b')](_0x9c763d[_0x5185('0x37')],qs['fields'](_0x3bd6b1['query'][_0x5185('0x3d')]));_0x1bcb52[_0x5185('0x3c')]=_0x1bcb52[_0x5185('0x3c')][_0x5185('0x4a')]?_0x1bcb52[_0x5185('0x3c')]:_0x9c763d[_0x5185('0x37')];if(_0x3bd6b1[_0x5185('0x38')][_0x5185('0x4b')]){_0x1bcb52[_0x5185('0x4c')]=[{'all':!![]}];}_0x1bcb52=_[_0x5185('0x42')]({},_0x1bcb52,_0x3bd6b1[_0x5185('0x45')]);return db[_0x5185('0x33')][_0x5185('0x4d')](_0x1bcb52)[_0x5185('0x2c')](handleEntityNotFound(_0x3d1799,null))[_0x5185('0x2c')](respondWithResult(_0x3d1799,null))[_0x5185('0x48')](handleError(_0x3d1799,null));};exports[_0x5185('0x4e')]=function(_0x334ca2,_0x2894a0){return db[_0x5185('0x33')][_0x5185('0x4e')](_0x334ca2['body'],{})['then'](respondWithResult(_0x2894a0,0xc9))[_0x5185('0x48')](handleError(_0x2894a0,null));};exports[_0x5185('0x4f')]=function(_0x442d25,_0x4d3cb4){var _0x37e216={'where':{'id':_0x442d25[_0x5185('0x49')]['id']}},_0x3a03d2={};_0x3a03d2['model']=_[_0x5185('0x39')](db[_0x5185('0x33')][_0x5185('0x34')]);_0x37e216['attributes']=_[_0x5185('0x3b')](_0x3a03d2[_0x5185('0x37')],qs[_0x5185('0x3d')](_0x442d25[_0x5185('0x38')][_0x5185('0x3d')]));_0x37e216['attributes']=_0x37e216['attributes'][_0x5185('0x4a')]?_0x37e216[_0x5185('0x3c')]:_0x3a03d2[_0x5185('0x37')];if(_0x442d25[_0x5185('0x38')][_0x5185('0x4b')]){_0x37e216[_0x5185('0x4c')]=[{'all':!![]}];}_0x37e216=_[_0x5185('0x42')]({},_0x37e216,_0x442d25[_0x5185('0x45')]);return db[_0x5185('0x33')]['find'](_0x37e216)[_0x5185('0x2c')](handleEntityNotFound(_0x4d3cb4,null))[_0x5185('0x2c')](function(_0xd49c2e){if(_0xd49c2e){var _0x33ad85=_0xd49c2e[_0x5185('0x50')]({'plain':!![]});_0x33ad85=qs[_0x5185('0x51')](_0x33ad85,['id',_0x5185('0x52'),_0x5185('0x53'),_0x5185('0x54')]);_0x442d25['body']=_[_0x5185('0x51')](_0x442d25[_0x5185('0x55')],['id','createdAt',_0x5185('0x53')]);return db[_0x5185('0x56')][_0x5185('0x57')](function(_0x48aea9){return db['UserProfile'][_0x5185('0x4e')](_[_0x5185('0x42')](_0x33ad85,_0x442d25[_0x5185('0x55')]),{'include':_0x442d25[_0x5185('0x38')][_0x5185('0x4b')]?[{'all':!![]}]:undefined,'transaction':_0x48aea9})[_0x5185('0x2c')](function(_0x1ee295){var _0x1585d4=_0x1ee295[_0x5185('0x50')]({'plain':!![]});return db[_0x5185('0x58')]['findAll']({'where':{'userProfileId':_0x442d25[_0x5185('0x49')]['id']},'raw':!![]})[_0x5185('0x2c')](function(_0x346f02){if(_0x346f02){return BPromise[_0x5185('0x59')](_0x346f02,function(_0x6f9480){return new BPromise(function(_0x54096a,_0xd74228){if(_0x6f9480['autoAssociation']===null||_0x6f9480[_0x5185('0x5a')]===0x1)_0x54096a(null);return db['UserProfileResource'][_0x5185('0x46')]({'where':{'sectionId':_0x6f9480['id']},'raw':!![]})['then'](function(_0x56b85c){var _0x19751e=_[_0x5185('0x32')](_0x56b85c,function(_0x83d50c){return qs[_0x5185('0x51')](_0x83d50c,['id',_0x5185('0x52'),_0x5185('0x53'),'sectionId']);});_0x54096a(_0x19751e);})[_0x5185('0x48')](function(_0xef5650){_0xd74228(_0xef5650);});})['then'](function(_0x2e5b59){var _0x3d8496=qs[_0x5185('0x51')](_0x6f9480,['id','createdAt',_0x5185('0x53')]);_0x3d8496[_0x5185('0x5b')]=_0x1585d4['id'];if(_0x2e5b59)_0x3d8496[_0x5185('0x5c')]=_0x2e5b59;return _0x3d8496;})[_0x5185('0x2c')](function(_0x32a055){return db[_0x5185('0x58')][_0x5185('0x4e')](_0x32a055,{'include':[{'model':db['UserProfileResource'],'as':_0x5185('0x5c')}],'raw':!![],'transaction':_0x48aea9});});})[_0x5185('0x2c')](function(){return _0x1585d4;});}});});});}})[_0x5185('0x2c')](respondWithResult(_0x4d3cb4,0xc9))[_0x5185('0x48')](handleError(_0x4d3cb4,null));};exports[_0x5185('0x2b')]=function(_0xbcd79e,_0x44a34c){if(_0xbcd79e[_0x5185('0x55')]['id']){delete _0xbcd79e[_0x5185('0x55')]['id'];}return db[_0x5185('0x33')][_0x5185('0x4d')]({'where':{'id':_0xbcd79e[_0x5185('0x49')]['id']}})[_0x5185('0x2c')](handleEntityNotFound(_0x44a34c,null))[_0x5185('0x2c')](saveUpdates(_0xbcd79e['body'],null))[_0x5185('0x2c')](respondWithResult(_0x44a34c,null))[_0x5185('0x48')](handleError(_0x44a34c,null));};exports[_0x5185('0x2d')]=function(_0x326968,_0xbcdcd9){return db[_0x5185('0x33')][_0x5185('0x4d')]({'where':{'id':_0x326968[_0x5185('0x49')]['id']}})[_0x5185('0x2c')](handleEntityNotFound(_0xbcdcd9,null))['then'](removeEntity(_0xbcdcd9,null))[_0x5185('0x48')](handleError(_0xbcdcd9,null));};exports['describe']=function(_0x4e5374,_0x541575){return db[_0x5185('0x33')][_0x5185('0x5d')]()[_0x5185('0x2c')](respondWithResult(_0x541575,null))[_0x5185('0x48')](handleError(_0x541575,null));};exports['addSections']=function(_0x4f0e3f,_0x5039d){var _0x1c5bc2=_0x4f0e3f[_0x5185('0x55')];return db[_0x5185('0x33')]['find']({'where':{'id':_0x4f0e3f['params']['id']}})['then'](handleEntityNotFound(_0x5039d,null))['then'](function(_0x20faf1){if(_0x20faf1){return db[_0x5185('0x56')][_0x5185('0x57')](function(_0x1a66ef){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x4f0e3f[_0x5185('0x49')]['id'],'sectionId':_[_0x5185('0x32')](_0x1c5bc2,function(_0x5eacdb){return _0x5eacdb[_0x5185('0x5e')];})},'transaction':_0x1a66ef})[_0x5185('0x2c')](function(){var _0x3013fa=_[_0x5185('0x32')](_0x1c5bc2,function(_0xe58005){_0xe58005[_0x5185('0x5b')]=_0x4f0e3f['params']['id'];return _0xe58005;});var _0x3b8725=[];return BPromise[_0x5185('0x59')](_0x3013fa,function(_0x4567d2){return db[_0x5185('0x58')][_0x5185('0x4e')](_0x4567d2,{'include':[{'model':db[_0x5185('0x5f')],'as':'Resources'}],'raw':!![],'transaction':_0x1a66ef})[_0x5185('0x2c')](function(_0x46090b){_0x3b8725['push'](_0x46090b[_0x5185('0x50')]({'plain':!![]}));});})['then'](function(){return _0x3b8725;});});});}})[_0x5185('0x2c')](function(_0x4e574f){return _0x4e574f;})['then'](respondWithResult(_0x5039d,null))[_0x5185('0x48')](handleError(_0x5039d,null));};exports[_0x5185('0x60')]=function(_0x276f78,_0x473682){var _0x482d1a;return db[_0x5185('0x33')][_0x5185('0x4d')]({'where':{'id':_0x276f78[_0x5185('0x49')]['id']},'attributes':['id',_0x5185('0x61')]})[_0x5185('0x2c')](handleEntityNotFound(_0x473682,null))[_0x5185('0x2c')](function(_0x31cf0c){if(_0x31cf0c){_0x482d1a=_0x31cf0c;return db[_0x5185('0x58')][_0x5185('0x2d')]({'where':{'userProfileId':_0x276f78[_0x5185('0x49')]['id'],'sectionId':_0x276f78[_0x5185('0x38')][_0x5185('0x62')]}});}})[_0x5185('0x2c')](function(){return _0x482d1a;})[_0x5185('0x2c')](respondWithStatusCode(_0x473682,null))[_0x5185('0x48')](handleError(_0x473682,null));};exports[_0x5185('0x63')]=function(_0x8f88bf,_0x49fb7b){var _0x3295ae=[];var _0x54dcec=[];return db['UserProfileSection'][_0x5185('0x46')]({'where':{'userProfileId':_0x8f88bf['params']['id']},'raw':!![]})['then'](function(_0x38d57c){_0x3295ae=_[_0x5185('0x44')](_0x38d57c,function(_0x279424){return _0x279424[_0x5185('0x64')]===0x1||_[_0x5185('0x65')]([0x3eb,0x709],_0x279424[_0x5185('0x5e')]);});if(!_[_0x5185('0x66')](_0x3295ae)){return _[_0x5185('0x32')](_0x3295ae,function(_0x2ed04c){return _0x2ed04c['sectionId'];});}else{return;}})[_0x5185('0x2c')](function(_0x3f0dbf){if(_0x3f0dbf)_0x54dcec=_0x3f0dbf;if(_['includes'](_0x54dcec,0x64)){var _0x43fab8=_[_0x5185('0x4d')](_0x3295ae,{'sectionId':0x64});return hasDefaultDashboard(_0x43fab8)[_0x5185('0x2c')](function(_0x5be102){return _['map'](_0x3295ae,function(_0x2b1ec3){if(_0x2b1ec3['sectionId']===0x64){_0x2b1ec3[_0x5185('0x67')]=_0x5be102;}return _0x2b1ec3;});});}else{return;}})['then'](function(_0x38bc6c){if(_0x38bc6c)_0x3295ae=_0x38bc6c;if(_['includes'](_0x54dcec,0x3eb)){var _0x44e8ba=_['find'](_0x3295ae,{'sectionId':0x3eb});return getCustomDashboards(_0x44e8ba)['then'](function(_0x400ee9){return _['map'](_0x3295ae,function(_0x455f5d){if(_0x44e8ba['enabled']){if(_0x455f5d[_0x5185('0x5e')]===0x3eb){_0x455f5d[_0x5185('0x67')]=_0x400ee9;}}else{if(_0x455f5d[_0x5185('0x5e')]===0x64){if(!_0x455f5d['subsections']){_0x455f5d[_0x5185('0x67')]=[];}_0x455f5d['subsections']=_0x455f5d[_0x5185('0x67')][_0x5185('0x68')](_0x400ee9);}}return _0x455f5d;});});}else{return;}})[_0x5185('0x2c')](function(_0x2070c1){if(_0x2070c1)_0x3295ae=_0x2070c1;if(_[_0x5185('0x65')](_0x54dcec,0x709)){var _0x2cde5e=_[_0x5185('0x4d')](_0x3295ae,{'sectionId':0x709});return getPlugins(_0x2cde5e)['then'](function(_0x314c87){if(_0x2cde5e[_0x5185('0x64')]){return _[_0x5185('0x32')](_0x3295ae,function(_0x3c7a0b){if(_0x3c7a0b[_0x5185('0x5e')]===0x709){_0x3c7a0b['subsections']=_0x314c87;}return _0x3c7a0b;});}else{var _0x5bec99={'sectionId':0x76c,'enabled':0x1,'subsections':_0x314c87};var _0x55a12a=_['map'](_0x3295ae);_0x55a12a[_0x5185('0x69')](_0x5bec99);return _0x55a12a;}});}else{return;}})['then'](function(_0x30c8a5){if(_0x30c8a5)_0x3295ae=_0x30c8a5;return _['filter'](_0x3295ae,[_0x5185('0x64'),0x1]);})[_0x5185('0x2c')](respondWithResult(_0x49fb7b,null))[_0x5185('0x48')](handleError(_0x49fb7b,null));};function hasDefaultDashboard(_0x42f0af){var _0x53829e=[0x65];return new BPromise(function(_0x56cc9e,_0x16ebbc){try{if(_0x42f0af[_0x5185('0x5a')]){_0x56cc9e(_0x53829e);}else{return db['UserProfileResource'][_0x5185('0x6a')]({'where':{'sectionId':_0x42f0af['id']},'raw':!![]})[_0x5185('0x2c')](function(_0x16c75b){_0x16c75b?_0x56cc9e(_0x53829e):_0x56cc9e();});}}catch(_0x4e88da){_0x16ebbc(_0x4e88da);}});}function getCustomDashboards(_0x33aa45){var _0x558673=[];return new BPromise(function(_0x59df98,_0x41b5d8){try{if(_0x33aa45[_0x5185('0x5a')]){return db[_0x5185('0x6b')][_0x5185('0x46')]({'raw':!![]})[_0x5185('0x2c')](function(_0x175994){_0x175994[_0x5185('0x6c')](function(_0x1d2aab){_0x558673[_0x5185('0x69')](_0x1d2aab['id']+0x1869f);});_0x59df98(_0x558673);});}else{return db[_0x5185('0x5f')][_0x5185('0x46')]({'where':{'sectionId':_0x33aa45['id']},'raw':!![]})[_0x5185('0x2c')](function(_0x120bbc){_0x120bbc['forEach'](function(_0x5c581f){_0x558673[_0x5185('0x69')](_0x5c581f[_0x5185('0x6d')]+0x1869f);});_0x59df98(_0x558673);});}}catch(_0x119311){_0x41b5d8(_0x119311);}});}function getPlugins(_0x367f17){var _0x99fa1f=[];return new BPromise(function(_0xb0640c,_0x51b916){try{if(_0x367f17[_0x5185('0x5a')]){return db['Plugin'][_0x5185('0x46')]({'raw':!![]})[_0x5185('0x2c')](function(_0x448f14){_0x448f14['forEach'](function(_0x5b3ba0){_0x99fa1f[_0x5185('0x69')](_0x5b3ba0['id']+0x15b38);});_0xb0640c(_0x99fa1f);});}else{return db[_0x5185('0x5f')]['findAll']({'where':{'sectionId':_0x367f17['id']},'raw':!![]})['then'](function(_0x45b98e){_0x45b98e[_0x5185('0x6c')](function(_0x36ae94){_0x99fa1f[_0x5185('0x69')](_0x36ae94[_0x5185('0x6d')]+0x15b38);});_0xb0640c(_0x99fa1f);});}}catch(_0x3f80bb){_0x51b916(_0x3f80bb);}});}exports[_0x5185('0x6e')]=function(_0x376008,_0x51345c){return db[_0x5185('0x33')][_0x5185('0x4d')]({'where':{'id':_0x376008[_0x5185('0x49')]['id']}})['then'](handleEntityNotFound(_0x51345c,null))[_0x5185('0x2c')](function(_0x58ef25){if(_0x58ef25){return db[_0x5185('0x56')][_0x5185('0x57')](function(_0xe30b08){return db[_0x5185('0x58')][_0x5185('0x46')]({'where':{'userProfileId':_0x376008[_0x5185('0x49')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x55cc23){if(_0x55cc23){return db[_0x5185('0x58')][_0x5185('0x2d')]({'where':{'userProfileId':_0x376008[_0x5185('0x49')]['id'],'id':_[_0x5185('0x32')](_0x55cc23,function(_0x3a9aaf){return _0x3a9aaf['id'];})},'transaction':_0xe30b08});}})['then'](function(_0x52566a){var _0x2d3ee7=_[_0x5185('0x32')](_0x376008[_0x5185('0x55')],function(_0x2bad8d){_0x2bad8d['userProfileId']=_0x376008[_0x5185('0x49')]['id'];return _0x2bad8d;});return db[_0x5185('0x58')][_0x5185('0x6f')](_0x2d3ee7,{'raw':!![],'transaction':_0xe30b08});})['then'](function(_0x12e604){var _0x8bb614=_[_0x5185('0x44')](_[_0x5185('0x32')](_0x12e604,function(_0x516826){return _0x516826[_0x5185('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x8bb614){return db[_0x5185('0x58')][_0x5185('0x46')]({'where':{'userProfileId':_0x376008[_0x5185('0x49')]['id'],'sectionId':_[_0x5185('0x32')](_0x8bb614,function(_0x435df8){return _0x435df8[_0x5185('0x5e')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x5185('0x2c')](function(_0x5f0bcc){var _0x3000b3=_['map'](_0x376008[_0x5185('0x55')],function(_0x201a25){_0x201a25[_0x5185('0x5b')]=_0x376008['params']['id'];return _0x201a25;});return db['UserProfileResource'][_0x5185('0x6f')](_0x3000b3,{'raw':!![],'transaction':_0xe30b08});});}})[_0x5185('0x48')](handleError(_0x51345c,null));});}})[_0x5185('0x2c')](function(_0x886f0f){var _0x1cb957=_[_0x5185('0x32')](_0x886f0f,function(_0x290600){return _0x290600[_0x5185('0x50')]({'plain':!![]});});})[_0x5185('0x2c')](respondWithResult(_0x51345c,null))[_0x5185('0x48')](handleError(_0x51345c,null));};exports[_0x5185('0x70')]=function(_0x13c710,_0x496ab1,_0xa086b){return db[_0x5185('0x33')]['find']({'where':{'id':_0x13c710[_0x5185('0x49')]['id']}})[_0x5185('0x2c')](handleEntityNotFound(_0x496ab1,null))[_0x5185('0x2c')](function(_0x58f951){if(_0x58f951){return _0x58f951[_0x5185('0x70')](_0x13c710['query'][_0x5185('0x62')]);}})[_0x5185('0x2c')](respondWithStatusCode(_0x496ab1,null))['catch'](handleError(_0x496ab1,null));};exports['getResources']=function(_0x39ab90,_0x1daa03){var _0x3c78fa={};if(!_0x39ab90[_0x5185('0x38')]['section'])throw new Error(_0x5185('0x71'));if(!_0x39ab90[_0x5185('0x38')][_0x5185('0x72')](_0x5185('0x3e'))){_0x3c78fa[_0x5185('0x25')]=qs[_0x5185('0x25')](_0x39ab90[_0x5185('0x38')][_0x5185('0x25')]);_0x3c78fa[_0x5185('0x23')]=qs[_0x5185('0x23')](_0x39ab90[_0x5185('0x38')][_0x5185('0x23')]);}return db[_0x5185('0x33')][_0x5185('0x4d')]({'where':{'id':_0x39ab90[_0x5185('0x49')]['id']}})[_0x5185('0x2c')](function(_0x490ad7){if(!_0x490ad7)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x39ab90[_0x5185('0x49')]['id']);return db[_0x5185('0x33')][_0x5185('0x73')](_0x39ab90);})[_0x5185('0x2c')](respondWithFilteredResult(_0x1daa03,_0x3c78fa))['catch'](handleError(_0x1daa03,null));}; \ No newline at end of file +var _0x7520=['fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./userProfile.socket','register','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','destroy','then','sendStatus','stack','name','send','index','map','UserProfile','fieldName','type','key','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','fields','find','create','clone','get','updatedAt','crudPermissions','body','omit','createdAt','sequelize','transaction','each','UserProfileResource','findAll','sectionId','Resources','UserProfileSection','describe','userProfileId','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','concat','push','autoAssociation','findOne','Dashboard','forEach','addResources','bulkCreate','removeResources','getResources','section','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x11664b,_0x549e6b){var _0x1bd6ee=function(_0x365b04){while(--_0x365b04){_0x11664b['push'](_0x11664b['shift']());}};_0x1bd6ee(++_0x549e6b);}(_0x7520,0x67));var _0x0752=function(_0x3ba8a3,_0x1e575c){_0x3ba8a3=_0x3ba8a3-0x0;var _0x2de759=_0x7520[_0x3ba8a3];return _0x2de759;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0752('0x0'));var zipdir=require(_0x0752('0x1'));var jsonpatch=require(_0x0752('0x2'));var rp=require(_0x0752('0x3'));var moment=require(_0x0752('0x4'));var BPromise=require(_0x0752('0x5'));var Mustache=require(_0x0752('0x6'));var util=require('util');var path=require(_0x0752('0x7'));var sox=require(_0x0752('0x8'));var csv=require(_0x0752('0x9'));var ejs=require(_0x0752('0xa'));var fs=require('fs');var fs_extra=require(_0x0752('0xb'));var _=require('lodash');var squel=require(_0x0752('0xc'));var crypto=require('crypto');var jsforce=require(_0x0752('0xd'));var deskjs=require(_0x0752('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0752('0xf'));var authService=require(_0x0752('0x10'));var qs=require(_0x0752('0x11'));var as=require(_0x0752('0x12'));var hardwareService=require(_0x0752('0x13'));var logger=require(_0x0752('0x14'))(_0x0752('0x15'));var utils=require('../../config/utils');var config=require(_0x0752('0x16'));var licenseUtil=require(_0x0752('0x17'));var db=require(_0x0752('0x18'))['db'];config[_0x0752('0x19')]=_[_0x0752('0x1a')](config[_0x0752('0x19')],{'host':_0x0752('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0752('0x19')]));require(_0x0752('0x1c'))[_0x0752('0x1d')](socket);function respondWithStatusCode(_0x8e1798,_0x177fbd){_0x177fbd=_0x177fbd||0xcc;return function(_0x3496d6){if(_0x3496d6){return _0x8e1798['sendStatus'](_0x177fbd);}return _0x8e1798[_0x0752('0x1e')](_0x177fbd)[_0x0752('0x1f')]();};}function respondWithResult(_0x5b56cc,_0x6080df){_0x6080df=_0x6080df||0xc8;return function(_0x98af7d){if(_0x98af7d){return _0x5b56cc[_0x0752('0x1e')](_0x6080df)[_0x0752('0x20')](_0x98af7d);}};}function respondWithFilteredResult(_0x237494,_0x4d0cc5){return function(_0x597e75){if(_0x597e75){var _0x32dd6c=typeof _0x4d0cc5['offset']===_0x0752('0x21')&&typeof _0x4d0cc5[_0x0752('0x22')]===_0x0752('0x21');var _0x30660e=_0x597e75[_0x0752('0x23')];var _0x3ad120=_0x32dd6c?0x0:_0x4d0cc5[_0x0752('0x24')];var _0x4c8c34=_0x32dd6c?_0x597e75['count']:_0x4d0cc5['offset']+_0x4d0cc5['limit'];var _0x5e38e5;if(_0x4c8c34>=_0x30660e){_0x4c8c34=_0x30660e;_0x5e38e5=0xc8;}else{_0x5e38e5=0xce;}_0x237494[_0x0752('0x1e')](_0x5e38e5);return _0x237494['set'](_0x0752('0x25'),_0x3ad120+'-'+_0x4c8c34+'/'+_0x30660e)[_0x0752('0x20')](_0x597e75);}return null;};}function patchUpdates(_0x31bc72){return function(_0x1ff069){try{jsonpatch[_0x0752('0x26')](_0x1ff069,_0x31bc72,!![]);}catch(_0x6d776a){return BPromise[_0x0752('0x27')](_0x6d776a);}return _0x1ff069['save']();};}function saveUpdates(_0x2c664c,_0xaafddc){return function(_0x58dfec){if(_0x58dfec){return _0x58dfec[_0x0752('0x28')](_0x2c664c)['then'](function(_0x4fa5b4){return _0x4fa5b4;});}return null;};}function removeEntity(_0x1d9905,_0x45d6d2){return function(_0xc8ecd7){if(_0xc8ecd7){return _0xc8ecd7[_0x0752('0x29')]()[_0x0752('0x2a')](function(){_0x1d9905['status'](0xcc)[_0x0752('0x1f')]();});}};}function handleEntityNotFound(_0x60f884,_0x2b8c38){return function(_0x1934ba){if(!_0x1934ba){_0x60f884[_0x0752('0x2b')](0x194);}return _0x1934ba;};}function handleError(_0x58f166,_0x1c7066){_0x1c7066=_0x1c7066||0x1f4;return function(_0x1aa6bd){logger['error'](_0x1aa6bd[_0x0752('0x2c')]);if(_0x1aa6bd[_0x0752('0x2d')]){delete _0x1aa6bd['name'];}_0x58f166[_0x0752('0x1e')](_0x1c7066)[_0x0752('0x2e')](_0x1aa6bd);};}exports[_0x0752('0x2f')]=function(_0x3ba309,_0x5d3f25){var _0x1b3837={},_0x3578a4={},_0x9cdd68={'count':0x0,'rows':[]};var _0x326bf6=_[_0x0752('0x30')](db[_0x0752('0x31')]['rawAttributes'],function(_0x34adaf){return{'name':_0x34adaf[_0x0752('0x32')],'type':_0x34adaf[_0x0752('0x33')][_0x0752('0x34')]};});_0x3578a4[_0x0752('0x35')]=_['map'](_0x326bf6,'name');_0x3578a4['query']=_[_0x0752('0x36')](_0x3ba309['query']);_0x3578a4[_0x0752('0x37')]=_[_0x0752('0x38')](_0x3578a4['model'],_0x3578a4[_0x0752('0x39')]);_0x1b3837[_0x0752('0x3a')]=_[_0x0752('0x38')](_0x3578a4[_0x0752('0x35')],qs['fields'](_0x3ba309[_0x0752('0x39')]['fields']));_0x1b3837[_0x0752('0x3a')]=_0x1b3837[_0x0752('0x3a')][_0x0752('0x3b')]?_0x1b3837['attributes']:_0x3578a4['model'];if(!_0x3ba309['query'][_0x0752('0x3c')]('nolimit')){_0x1b3837['limit']=qs[_0x0752('0x22')](_0x3ba309['query'][_0x0752('0x22')]);_0x1b3837[_0x0752('0x24')]=qs[_0x0752('0x24')](_0x3ba309['query']['offset']);}_0x1b3837[_0x0752('0x3d')]=qs[_0x0752('0x3e')](_0x3ba309[_0x0752('0x39')]['sort']);_0x1b3837[_0x0752('0x3f')]=qs[_0x0752('0x37')](_[_0x0752('0x40')](_0x3ba309[_0x0752('0x39')],_0x3578a4[_0x0752('0x37')]),_0x326bf6);if(_0x3ba309['query'][_0x0752('0x41')]){_0x1b3837[_0x0752('0x3f')]=_['merge'](_0x1b3837[_0x0752('0x3f')],{'$or':_[_0x0752('0x30')](_0x326bf6,function(_0x58d778){if(_0x58d778[_0x0752('0x33')]!==_0x0752('0x42')){var _0x24f383={};_0x24f383[_0x58d778['name']]={'$like':'%'+_0x3ba309[_0x0752('0x39')]['filter']+'%'};return _0x24f383;}})});}_0x1b3837=_[_0x0752('0x43')]({},_0x1b3837,_0x3ba309[_0x0752('0x44')]);var _0x41dedf={'where':_0x1b3837[_0x0752('0x3f')]};return db[_0x0752('0x31')][_0x0752('0x23')](_0x41dedf)[_0x0752('0x2a')](function(_0x55fcf4){_0x9cdd68['count']=_0x55fcf4;if(_0x3ba309[_0x0752('0x39')][_0x0752('0x45')]){_0x1b3837[_0x0752('0x46')]=[{'all':!![]}];}return db[_0x0752('0x31')]['findAll'](_0x1b3837);})[_0x0752('0x2a')](function(_0x4ec01e){_0x9cdd68[_0x0752('0x47')]=_0x4ec01e;return _0x9cdd68;})[_0x0752('0x2a')](respondWithFilteredResult(_0x5d3f25,_0x1b3837))[_0x0752('0x48')](handleError(_0x5d3f25,null));};exports['show']=function(_0x25a710,_0x3fc3e1){var _0x48a8bb={'raw':![],'where':{'id':_0x25a710[_0x0752('0x49')]['id']}},_0x2ab97a={};_0x2ab97a[_0x0752('0x35')]=_['keys'](db['UserProfile']['rawAttributes']);_0x2ab97a[_0x0752('0x39')]=_['keys'](_0x25a710['query']);_0x2ab97a[_0x0752('0x37')]=_[_0x0752('0x38')](_0x2ab97a[_0x0752('0x35')],_0x2ab97a[_0x0752('0x39')]);_0x48a8bb[_0x0752('0x3a')]=_[_0x0752('0x38')](_0x2ab97a[_0x0752('0x35')],qs[_0x0752('0x4a')](_0x25a710[_0x0752('0x39')]['fields']));_0x48a8bb['attributes']=_0x48a8bb[_0x0752('0x3a')][_0x0752('0x3b')]?_0x48a8bb[_0x0752('0x3a')]:_0x2ab97a[_0x0752('0x35')];if(_0x25a710['query'][_0x0752('0x45')]){_0x48a8bb[_0x0752('0x46')]=[{'all':!![]}];}_0x48a8bb=_[_0x0752('0x43')]({},_0x48a8bb,_0x25a710['options']);return db[_0x0752('0x31')][_0x0752('0x4b')](_0x48a8bb)[_0x0752('0x2a')](handleEntityNotFound(_0x3fc3e1,null))[_0x0752('0x2a')](respondWithResult(_0x3fc3e1,null))[_0x0752('0x48')](handleError(_0x3fc3e1,null));};exports[_0x0752('0x4c')]=function(_0x3fef04,_0x38b06b){return db[_0x0752('0x31')][_0x0752('0x4c')](_0x3fef04['body'],{})['then'](respondWithResult(_0x38b06b,0xc9))['catch'](handleError(_0x38b06b,null));};exports[_0x0752('0x4d')]=function(_0x6ae782,_0x63d9bc){var _0x2fb0df={'where':{'id':_0x6ae782[_0x0752('0x49')]['id']}},_0x28d55c={};_0x28d55c[_0x0752('0x35')]=_[_0x0752('0x36')](db[_0x0752('0x31')]['rawAttributes']);_0x2fb0df[_0x0752('0x3a')]=_[_0x0752('0x38')](_0x28d55c['model'],qs[_0x0752('0x4a')](_0x6ae782['query'][_0x0752('0x4a')]));_0x2fb0df[_0x0752('0x3a')]=_0x2fb0df[_0x0752('0x3a')][_0x0752('0x3b')]?_0x2fb0df[_0x0752('0x3a')]:_0x28d55c[_0x0752('0x35')];if(_0x6ae782[_0x0752('0x39')][_0x0752('0x45')]){_0x2fb0df[_0x0752('0x46')]=[{'all':!![]}];}_0x2fb0df=_[_0x0752('0x43')]({},_0x2fb0df,_0x6ae782['options']);return db[_0x0752('0x31')][_0x0752('0x4b')](_0x2fb0df)[_0x0752('0x2a')](handleEntityNotFound(_0x63d9bc,null))[_0x0752('0x2a')](function(_0x5051bc){if(_0x5051bc){var _0x26c9ca=_0x5051bc[_0x0752('0x4e')]({'plain':!![]});_0x26c9ca=qs['omit'](_0x26c9ca,['id','createdAt',_0x0752('0x4f'),_0x0752('0x50')]);_0x6ae782[_0x0752('0x51')]=_[_0x0752('0x52')](_0x6ae782[_0x0752('0x51')],['id',_0x0752('0x53'),_0x0752('0x4f')]);return db[_0x0752('0x54')][_0x0752('0x55')](function(_0x30b48a){return db[_0x0752('0x31')]['create'](_[_0x0752('0x43')](_0x26c9ca,_0x6ae782[_0x0752('0x51')]),{'include':_0x6ae782[_0x0752('0x39')][_0x0752('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x30b48a})[_0x0752('0x2a')](function(_0x323db9){var _0x3fb568=_0x323db9[_0x0752('0x4e')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x6ae782[_0x0752('0x49')]['id']},'raw':!![]})['then'](function(_0x4a206f){if(_0x4a206f){return BPromise[_0x0752('0x56')](_0x4a206f,function(_0x1d23d4){return new BPromise(function(_0x403c56,_0x194283){if(_0x1d23d4['autoAssociation']===null||_0x1d23d4['autoAssociation']===0x1)_0x403c56(null);return db[_0x0752('0x57')][_0x0752('0x58')]({'where':{'sectionId':_0x1d23d4['id']},'raw':!![]})[_0x0752('0x2a')](function(_0x100da1){var _0x46422b=_['map'](_0x100da1,function(_0x26c30c){return qs[_0x0752('0x52')](_0x26c30c,['id',_0x0752('0x53'),_0x0752('0x4f'),_0x0752('0x59')]);});_0x403c56(_0x46422b);})[_0x0752('0x48')](function(_0x3b7a6f){_0x194283(_0x3b7a6f);});})[_0x0752('0x2a')](function(_0x1de6ed){var _0x1333d4=qs[_0x0752('0x52')](_0x1d23d4,['id','createdAt',_0x0752('0x4f')]);_0x1333d4['userProfileId']=_0x3fb568['id'];if(_0x1de6ed)_0x1333d4[_0x0752('0x5a')]=_0x1de6ed;return _0x1333d4;})[_0x0752('0x2a')](function(_0x13fc71){return db[_0x0752('0x5b')][_0x0752('0x4c')](_0x13fc71,{'include':[{'model':db['UserProfileResource'],'as':_0x0752('0x5a')}],'raw':!![],'transaction':_0x30b48a});});})[_0x0752('0x2a')](function(){return _0x3fb568;});}});});});}})['then'](respondWithResult(_0x63d9bc,0xc9))[_0x0752('0x48')](handleError(_0x63d9bc,null));};exports['update']=function(_0x2074c3,_0x54878a){if(_0x2074c3[_0x0752('0x51')]['id']){delete _0x2074c3[_0x0752('0x51')]['id'];}return db[_0x0752('0x31')][_0x0752('0x4b')]({'where':{'id':_0x2074c3[_0x0752('0x49')]['id']}})[_0x0752('0x2a')](handleEntityNotFound(_0x54878a,null))[_0x0752('0x2a')](saveUpdates(_0x2074c3[_0x0752('0x51')],null))[_0x0752('0x2a')](respondWithResult(_0x54878a,null))[_0x0752('0x48')](handleError(_0x54878a,null));};exports[_0x0752('0x29')]=function(_0x54c633,_0xa751b3){return db[_0x0752('0x31')][_0x0752('0x4b')]({'where':{'id':_0x54c633[_0x0752('0x49')]['id']}})[_0x0752('0x2a')](handleEntityNotFound(_0xa751b3,null))[_0x0752('0x2a')](removeEntity(_0xa751b3,null))[_0x0752('0x48')](handleError(_0xa751b3,null));};exports[_0x0752('0x5c')]=function(_0x2b9e70,_0x549123){return db[_0x0752('0x31')][_0x0752('0x5c')]()[_0x0752('0x2a')](respondWithResult(_0x549123,null))[_0x0752('0x48')](handleError(_0x549123,null));};exports['addSections']=function(_0x2b5e0a,_0x4d8cf4){var _0x4fdeb5=_0x2b5e0a[_0x0752('0x51')];return db['UserProfile'][_0x0752('0x4b')]({'where':{'id':_0x2b5e0a['params']['id']}})[_0x0752('0x2a')](handleEntityNotFound(_0x4d8cf4,null))[_0x0752('0x2a')](function(_0x102a4d){if(_0x102a4d){return db[_0x0752('0x54')][_0x0752('0x55')](function(_0xc8ef3b){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x2b5e0a['params']['id'],'sectionId':_[_0x0752('0x30')](_0x4fdeb5,function(_0x864617){return _0x864617[_0x0752('0x59')];})},'transaction':_0xc8ef3b})[_0x0752('0x2a')](function(){var _0x2670ab=_['map'](_0x4fdeb5,function(_0x4ae94b){_0x4ae94b[_0x0752('0x5d')]=_0x2b5e0a[_0x0752('0x49')]['id'];return _0x4ae94b;});var _0x48782c=[];return BPromise[_0x0752('0x56')](_0x2670ab,function(_0xe0bb2){return db[_0x0752('0x5b')][_0x0752('0x4c')](_0xe0bb2,{'include':[{'model':db[_0x0752('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0xc8ef3b})[_0x0752('0x2a')](function(_0x28d3bd){_0x48782c['push'](_0x28d3bd[_0x0752('0x4e')]({'plain':!![]}));});})[_0x0752('0x2a')](function(){return _0x48782c;});});});}})[_0x0752('0x2a')](function(_0x2e1527){return _0x2e1527;})[_0x0752('0x2a')](respondWithResult(_0x4d8cf4,null))['catch'](handleError(_0x4d8cf4,null));};exports[_0x0752('0x5e')]=function(_0x256106,_0x684ebe){var _0x24bfa3;return db[_0x0752('0x31')]['find']({'where':{'id':_0x256106[_0x0752('0x49')]['id']},'attributes':['id',_0x0752('0x2d')]})[_0x0752('0x2a')](handleEntityNotFound(_0x684ebe,null))['then'](function(_0x415d8f){if(_0x415d8f){_0x24bfa3=_0x415d8f;return db[_0x0752('0x5b')][_0x0752('0x29')]({'where':{'userProfileId':_0x256106[_0x0752('0x49')]['id'],'sectionId':_0x256106[_0x0752('0x39')][_0x0752('0x5f')]}});}})['then'](function(){return _0x24bfa3;})[_0x0752('0x2a')](respondWithStatusCode(_0x684ebe,null))[_0x0752('0x48')](handleError(_0x684ebe,null));};exports[_0x0752('0x60')]=function(_0x31dd45,_0x349199){var _0x540060=[];var _0x27ddae=[];return db[_0x0752('0x5b')][_0x0752('0x58')]({'where':{'userProfileId':_0x31dd45[_0x0752('0x49')]['id']},'raw':!![]})[_0x0752('0x2a')](function(_0x4592dc){_0x540060=_[_0x0752('0x41')](_0x4592dc,function(_0xea7a2b){return _0xea7a2b[_0x0752('0x61')]===0x1||_['includes']([0x3eb,0x709],_0xea7a2b['sectionId']);});if(!_[_0x0752('0x62')](_0x540060)){return _[_0x0752('0x30')](_0x540060,function(_0x5b8d27){return _0x5b8d27[_0x0752('0x59')];});}else{return;}})[_0x0752('0x2a')](function(_0x5de156){if(_0x5de156)_0x27ddae=_0x5de156;if(_[_0x0752('0x63')](_0x27ddae,0x64)){var _0x5b6bd2=_['find'](_0x540060,{'sectionId':0x64});return hasDefaultDashboard(_0x5b6bd2)['then'](function(_0x1a59d1){return _[_0x0752('0x30')](_0x540060,function(_0x2236c7){if(_0x2236c7[_0x0752('0x59')]===0x64){_0x2236c7[_0x0752('0x64')]=_0x1a59d1;}return _0x2236c7;});});}else{return;}})[_0x0752('0x2a')](function(_0x20372c){if(_0x20372c)_0x540060=_0x20372c;if(_[_0x0752('0x63')](_0x27ddae,0x3eb)){var _0x10dc2a=_[_0x0752('0x4b')](_0x540060,{'sectionId':0x3eb});return getCustomDashboards(_0x10dc2a)[_0x0752('0x2a')](function(_0x2b28f8){return _[_0x0752('0x30')](_0x540060,function(_0x45ad65){if(_0x10dc2a[_0x0752('0x61')]){if(_0x45ad65[_0x0752('0x59')]===0x3eb){_0x45ad65['subsections']=_0x2b28f8;}}else{if(_0x45ad65[_0x0752('0x59')]===0x64){if(!_0x45ad65[_0x0752('0x64')]){_0x45ad65['subsections']=[];}_0x45ad65[_0x0752('0x64')]=_0x45ad65[_0x0752('0x64')][_0x0752('0x65')](_0x2b28f8);}}return _0x45ad65;});});}else{return;}})[_0x0752('0x2a')](function(_0x4b1001){if(_0x4b1001)_0x540060=_0x4b1001;if(_[_0x0752('0x63')](_0x27ddae,0x709)){var _0x2753fd=_[_0x0752('0x4b')](_0x540060,{'sectionId':0x709});return getPlugins(_0x2753fd)[_0x0752('0x2a')](function(_0x10e6f0){if(_0x2753fd[_0x0752('0x61')]){return _[_0x0752('0x30')](_0x540060,function(_0x45055d){if(_0x45055d[_0x0752('0x59')]===0x709){_0x45055d[_0x0752('0x64')]=_0x10e6f0;}return _0x45055d;});}else{var _0x592ab8={'sectionId':0x76c,'enabled':0x1,'subsections':_0x10e6f0};var _0x31dca9=_['map'](_0x540060);_0x31dca9[_0x0752('0x66')](_0x592ab8);return _0x31dca9;}});}else{return;}})[_0x0752('0x2a')](function(_0xc68460){if(_0xc68460)_0x540060=_0xc68460;return _[_0x0752('0x41')](_0x540060,[_0x0752('0x61'),0x1]);})[_0x0752('0x2a')](respondWithResult(_0x349199,null))[_0x0752('0x48')](handleError(_0x349199,null));};function hasDefaultDashboard(_0x514159){var _0x19ceec=[0x65];return new BPromise(function(_0x3e76c8,_0x117743){try{if(_0x514159[_0x0752('0x67')]){_0x3e76c8(_0x19ceec);}else{return db[_0x0752('0x57')][_0x0752('0x68')]({'where':{'sectionId':_0x514159['id']},'raw':!![]})[_0x0752('0x2a')](function(_0x121829){_0x121829?_0x3e76c8(_0x19ceec):_0x3e76c8();});}}catch(_0x1c24f2){_0x117743(_0x1c24f2);}});}function getCustomDashboards(_0x310620){var _0x17e2ed=[];return new BPromise(function(_0x41240e,_0x5c6bb5){try{if(_0x310620[_0x0752('0x67')]){return db[_0x0752('0x69')][_0x0752('0x58')]({'raw':!![]})[_0x0752('0x2a')](function(_0x2d0078){_0x2d0078[_0x0752('0x6a')](function(_0x257cfb){_0x17e2ed[_0x0752('0x66')](_0x257cfb['id']+0x1869f);});_0x41240e(_0x17e2ed);});}else{return db[_0x0752('0x57')]['findAll']({'where':{'sectionId':_0x310620['id']},'raw':!![]})[_0x0752('0x2a')](function(_0x48509b){_0x48509b[_0x0752('0x6a')](function(_0x3c1681){_0x17e2ed[_0x0752('0x66')](_0x3c1681['resourceId']+0x1869f);});_0x41240e(_0x17e2ed);});}}catch(_0x5e8dce){_0x5c6bb5(_0x5e8dce);}});}function getPlugins(_0x36fe5a){var _0x26e977=[];return new BPromise(function(_0x72360,_0x5e855c){try{if(_0x36fe5a[_0x0752('0x67')]){return db['Plugin'][_0x0752('0x58')]({'raw':!![]})[_0x0752('0x2a')](function(_0x33fb08){_0x33fb08[_0x0752('0x6a')](function(_0x4f2ad6){_0x26e977['push'](_0x4f2ad6['id']+0x15b38);});_0x72360(_0x26e977);});}else{return db['UserProfileResource'][_0x0752('0x58')]({'where':{'sectionId':_0x36fe5a['id']},'raw':!![]})['then'](function(_0x992049){_0x992049[_0x0752('0x6a')](function(_0x53ce1d){_0x26e977[_0x0752('0x66')](_0x53ce1d['resourceId']+0x15b38);});_0x72360(_0x26e977);});}}catch(_0x22e79e){_0x5e855c(_0x22e79e);}});}exports[_0x0752('0x6b')]=function(_0xe85184,_0x4eb392){return db[_0x0752('0x31')][_0x0752('0x4b')]({'where':{'id':_0xe85184[_0x0752('0x49')]['id']}})[_0x0752('0x2a')](handleEntityNotFound(_0x4eb392,null))[_0x0752('0x2a')](function(_0x1e6326){if(_0x1e6326){return db[_0x0752('0x54')][_0x0752('0x55')](function(_0x3c0ee0){return db[_0x0752('0x5b')][_0x0752('0x58')]({'where':{'userProfileId':_0xe85184[_0x0752('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0x0752('0x2a')](function(_0x363b74){if(_0x363b74){return db[_0x0752('0x5b')][_0x0752('0x29')]({'where':{'userProfileId':_0xe85184[_0x0752('0x49')]['id'],'id':_[_0x0752('0x30')](_0x363b74,function(_0x1e9242){return _0x1e9242['id'];})},'transaction':_0x3c0ee0});}})[_0x0752('0x2a')](function(_0x12dc54){var _0xfcc2b0=_[_0x0752('0x30')](_0xe85184[_0x0752('0x51')],function(_0x1dcd17){_0x1dcd17['userProfileId']=_0xe85184['params']['id'];return _0x1dcd17;});return db[_0x0752('0x5b')]['bulkCreate'](_0xfcc2b0,{'raw':!![],'transaction':_0x3c0ee0});})[_0x0752('0x2a')](function(_0x446dd8){var _0x274f9f=_[_0x0752('0x41')](_[_0x0752('0x30')](_0x446dd8,function(_0x32fd34){return _0x32fd34[_0x0752('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x274f9f){return db[_0x0752('0x5b')][_0x0752('0x58')]({'where':{'userProfileId':_0xe85184[_0x0752('0x49')]['id'],'sectionId':_[_0x0752('0x30')](_0x274f9f,function(_0x1df655){return _0x1df655[_0x0752('0x59')];})},'attributes':['id',_0x0752('0x59')],'raw':!![]})[_0x0752('0x2a')](function(_0x3488e7){var _0x1b8b1e=_['map'](_0xe85184[_0x0752('0x51')],function(_0x1b5a81){_0x1b5a81[_0x0752('0x5d')]=_0xe85184[_0x0752('0x49')]['id'];return _0x1b5a81;});return db[_0x0752('0x57')][_0x0752('0x6c')](_0x1b8b1e,{'raw':!![],'transaction':_0x3c0ee0});});}})['catch'](handleError(_0x4eb392,null));});}})[_0x0752('0x2a')](function(_0x4390b1){var _0x51296e=_[_0x0752('0x30')](_0x4390b1,function(_0x257d96){return _0x257d96[_0x0752('0x4e')]({'plain':!![]});});})[_0x0752('0x2a')](respondWithResult(_0x4eb392,null))[_0x0752('0x48')](handleError(_0x4eb392,null));};exports[_0x0752('0x6d')]=function(_0x140a02,_0x5b8d0f,_0x37e061){return db[_0x0752('0x31')][_0x0752('0x4b')]({'where':{'id':_0x140a02[_0x0752('0x49')]['id']}})[_0x0752('0x2a')](handleEntityNotFound(_0x5b8d0f,null))[_0x0752('0x2a')](function(_0x43111d){if(_0x43111d){return _0x43111d[_0x0752('0x6d')](_0x140a02[_0x0752('0x39')][_0x0752('0x5f')]);}})[_0x0752('0x2a')](respondWithStatusCode(_0x5b8d0f,null))[_0x0752('0x48')](handleError(_0x5b8d0f,null));};exports[_0x0752('0x6e')]=function(_0x44529e,_0x14d467){var _0x54157e={};if(!_0x44529e[_0x0752('0x39')][_0x0752('0x6f')])throw new Error('Missing\x20section\x20parameter');if(!_0x44529e[_0x0752('0x39')][_0x0752('0x3c')](_0x0752('0x70'))){_0x54157e['limit']=qs[_0x0752('0x22')](_0x44529e[_0x0752('0x39')][_0x0752('0x22')]);_0x54157e['offset']=qs[_0x0752('0x24')](_0x44529e['query'][_0x0752('0x24')]);}return db[_0x0752('0x31')][_0x0752('0x4b')]({'where':{'id':_0x44529e[_0x0752('0x49')]['id']}})['then'](function(_0x2f819c){if(!_0x2f819c)throw new Error(_0x0752('0x71')+_0x44529e[_0x0752('0x49')]['id']);return db[_0x0752('0x31')]['getResources'](_0x44529e);})[_0x0752('0x2a')](respondWithFilteredResult(_0x14d467,_0x54157e))[_0x0752('0x48')](handleError(_0x14d467,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 05fb31e..385c0b3 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 _0x1189=['hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','update','remove','emit'];(function(_0x36a4ba,_0x504349){var _0x4acc18=function(_0x417e87){while(--_0x417e87){_0x36a4ba['push'](_0x36a4ba['shift']());}};_0x4acc18(++_0x504349);}(_0x1189,0x17f));var _0x9118=function(_0x159c68,_0xc544c9){_0x159c68=_0x159c68-0x0;var _0x32792f=_0x1189[_0x159c68];return _0x32792f;};'use strict';var EventEmitter=require(_0x9118('0x0'));var UserProfile=require(_0x9118('0x1'))['db'][_0x9118('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x9118('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9118('0x4'),'afterDestroy':_0x9118('0x5')};function emitEvent(_0x175cd5){return function(_0xd7a81b,_0x37a638,_0x3650f2){UserProfileEvents[_0x9118('0x6')](_0x175cd5+':'+_0xd7a81b['id'],_0xd7a81b);UserProfileEvents['emit'](_0x175cd5,_0xd7a81b);_0x3650f2(null);};}for(var e in events){if(events[_0x9118('0x7')](e)){var event=events[e];UserProfile[_0x9118('0x8')](e,emitEvent(event));}}module[_0x9118('0x9')]=UserProfileEvents; \ No newline at end of file +var _0x1f2d=['hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0xc47eb1,_0x43a0c6){var _0x1b60c2=function(_0x1747e9){while(--_0x1747e9){_0xc47eb1['push'](_0xc47eb1['shift']());}};_0x1b60c2(++_0x43a0c6);}(_0x1f2d,0x1c4));var _0xd1f2=function(_0x5550b3,_0x2d0ee0){_0x5550b3=_0x5550b3-0x0;var _0x4b8fc4=_0x1f2d[_0x5550b3];return _0x4b8fc4;};'use strict';var EventEmitter=require(_0xd1f2('0x0'));var UserProfile=require(_0xd1f2('0x1'))['db'][_0xd1f2('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xd1f2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd1f2('0x4'),'afterDestroy':_0xd1f2('0x5')};function emitEvent(_0x13626e){return function(_0xd4f928,_0x21f154,_0x194b49){UserProfileEvents[_0xd1f2('0x6')](_0x13626e+':'+_0xd4f928['id'],_0xd4f928);UserProfileEvents[_0xd1f2('0x6')](_0x13626e,_0xd4f928);_0x194b49(null);};}for(var e in events){if(events[_0xd1f2('0x7')](e)){var event=events[e];UserProfile[_0xd1f2('0x8')](e,emitEvent(event));}}module[_0xd1f2('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 5536ae7..e576ef5 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 _0x1997=['reportType','default','DefaultReports','custom','CustomReports','rows','ids','customSorting','extraQueryConditions','count','includeAll','Tags','tag','color','openTabs','true','chat','sms','dataValues','fax','mail','whatsapp','lodash','./userProfile.attributes','exports','models','filter','value','findAll','then','associatedResources','map','catch','field','model','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','SquareProject','odbc','SquareRecording','parentSections','SquareProjects','projectName','projects','contacts','CmContact','Lists','ListId','lists','CmList','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','inboundroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','WhatsappAccount','teams','Team','voicequeues','users','agents','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Dashboard','intervals','Interval','Pause','scheduler','Schedule','tags','Tag','Template','Trigger','trunks','variables','Variable','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','QueryTypes','SELECT','ui.','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','mergeResources','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','all','ignore','union','length','autoAssociation','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','filters','merge','foreignKey','include','forEach'];(function(_0xcf059,_0x23ebd1){var _0x5bda20=function(_0x13f5c3){while(--_0x13f5c3){_0xcf059['push'](_0xcf059['shift']());}};_0x5bda20(++_0x23ebd1);}(_0x1997,0x190));var _0x7199=function(_0x2c34ca,_0x79b23a){_0x2c34ca=_0x2c34ca-0x0;var _0x5409dd=_0x1997[_0x2c34ca];return _0x5409dd;};'use strict';var _=require(_0x7199('0x0'));var attributes=require(_0x7199('0x1'));var squel=require('squel');module[_0x7199('0x2')]=function(_0x416d0a){var _0x3c724d=_0x416d0a[_0x7199('0x3')];function _0x3dc3b9(_0x4b42a1,_0x36b4ba){return new Promise(function(_0x4d5be6,_0x5db13d){if(!_0x36b4ba)return _0x4d5be6(null);var _0x36f129=_0x36b4ba[_0x7199('0x4')]?{[_0x36b4ba[_0x7199('0x4')]['field']]:_0x36b4ba[_0x7199('0x4')][_0x7199('0x5')]}:undefined;return _0x3c724d[_0x4b42a1][_0x7199('0x6')]({'where':_0x36f129,'raw':!![]})[_0x7199('0x7')](function(_0x269a2a){_0x36b4ba[_0x7199('0x8')]=_[_0x7199('0x9')](_0x269a2a,'id');_0x4d5be6(_0x36b4ba);})[_0x7199('0xa')](function(_0x53a79c){_0x5db13d(_0x53a79c);});});}function _0x21e5dc(_0x3952a1,_0x4eed2f){return new Promise(function(_0x3b89e0,_0x3adb05){var _0xff463=_0x3952a1[_0x7199('0x4')]?{[_0x3952a1[_0x7199('0x4')][_0x7199('0xb')]]:_0x3952a1[_0x7199('0x4')]['value']}:undefined;return _0x3c724d[_0x3952a1[_0x7199('0xc')]][_0x7199('0x6')]({'where':_0xff463,'raw':!![]})[_0x7199('0x7')](function(_0x5f1712){_0x4eed2f[_0x7199('0x8')]=_[_0x7199('0x9')](_0x5f1712,function(_0x4b19b8){return _0x4b19b8[_0x7199('0xd')];});_0x3b89e0(_0x4eed2f);})[_0x7199('0xa')](function(_0x4c9cf6){_0x3adb05(_0x4c9cf6);});});}function _0x52e725(_0x402463,_0x4d80ac,_0x5902c1){if(!_0x4d80ac)return Promise[_0x7199('0xe')](null);return new Promise(function(_0x19817d,_0x349d94){return _0x3c724d[_0x7199('0xf')][_0x7199('0x6')]({'where':{'sectionId':_0x4d80ac['id']},'raw':!![]})[_0x7199('0x7')](function(_0x39a56e){if(_0x402463[_0x7199('0xb')]&&_0x402463[_0x7199('0xb')]!=='id'){_0x4d80ac['associatedResources']=_[_0x7199('0x9')](_0x39a56e,function(_0x25d46f){return _0x25d46f[_0x402463[_0x7199('0xb')]];});}else{if(_0x5902c1===_0x7199('0x10')){_0x4d80ac[_0x7199('0x8')]=_[_0x7199('0x9')](_0x39a56e,function(_0x39453d){return{'id':_0x39453d[_0x7199('0x11')],'type':_0x39453d[_0x7199('0x12')]};});}else{_0x4d80ac[_0x7199('0x8')]=_[_0x7199('0x9')](_0x39a56e,function(_0x1e2036){return _0x1e2036[_0x7199('0x11')];});}}_0x19817d(_0x4d80ac);})[_0x7199('0xa')](function(_0xbb2dd8){_0x349d94(_0xbb2dd8);});});}function _0x3c6713(_0x128b43,_0x5cb381){var _0x1fba57={'parentSections':[]};switch(_0x128b43[_0x7199('0x13')]()){case'squareprojects':_0x1fba57[_0x7199('0x14')]=_0x7199('0x15');break;case _0x7199('0x16'):_0x1fba57[_0x7199('0x14')]='SquareOdbc';break;case'squarerecordings':_0x1fba57[_0x7199('0x14')]=_0x7199('0x17');_0x1fba57[_0x7199('0x18')]=[{'name':_0x7199('0x19'),'field':_0x7199('0xd'),'foreignKey':_0x7199('0x1a')}];break;case _0x7199('0x1b'):_0x1fba57['childModel']='JscriptyProject';break;case _0x7199('0x1c'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x1d');_0x1fba57[_0x7199('0x18')]=[{'name':_0x7199('0x1e'),'field':'id','foreignKey':_0x7199('0x1f')}];break;case _0x7199('0x20'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x21');break;case'companies':_0x1fba57[_0x7199('0x14')]=_0x7199('0x22');break;case _0x7199('0x23'):_0x1fba57[_0x7199('0x14')]='CmCustomField';break;case _0x7199('0x24'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x25');break;case _0x7199('0x26'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x27');break;case _0x7199('0x28'):_0x1fba57[_0x7199('0x14')]='FaxQueue';break;case _0x7199('0x29'):_0x1fba57[_0x7199('0x14')]='FaxAccount';break;case _0x7199('0x2a'):case'internalroutes':case _0x7199('0x2b'):_0x1fba57[_0x7199('0x14')]='VoiceExtension';break;case _0x7199('0x2c'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x2d');break;case _0x7199('0x2e'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x2f');break;case'voicerecordings':_0x1fba57[_0x7199('0x14')]=_0x7199('0x30');_0x1fba57[_0x7199('0x18')]=[{'name':_0x7199('0x31'),'field':'name','foreignKey':_0x7199('0x32'),'model':_0x7199('0x33'),'filter':{'field':'role','value':[_0x7199('0x34')]}},{'name':_0x7199('0x35'),'field':_0x7199('0xd'),'foreignKey':_0x7199('0x32'),'model':'User','filter':{'field':_0x7199('0x36'),'value':[_0x7199('0x37')]}},{'name':_0x7199('0x38'),'field':'name','foreignKey':'queue','model':_0x7199('0x39'),'filter':{'field':_0x7199('0x12'),'value':[_0x7199('0x3a')]}},{'name':_0x7199('0x3b'),'field':'name','foreignKey':_0x7199('0x3c'),'model':_0x7199('0x39'),'filter':{'field':_0x7199('0x12'),'value':[_0x7199('0x3d')]}}];break;case _0x7199('0x3e'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x3f');break;case _0x7199('0x40'):_0x1fba57[_0x7199('0x14')]='VoiceChanSpy';break;case _0x7199('0x41'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x42');break;case _0x7199('0x43'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x44');break;case _0x7199('0x45'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x46');break;case'mailaccounts':_0x1fba57['childModel']=_0x7199('0x47');break;case _0x7199('0x48'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x49');break;case _0x7199('0x4a'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x4b');break;case _0x7199('0x4c'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x4d');break;case _0x7199('0x4e'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x4f');break;case _0x7199('0x50'):_0x1fba57['childModel']=_0x7199('0x51');break;case'whatsappqueues':_0x1fba57[_0x7199('0x14')]=_0x7199('0x52');break;case'whatsappaccounts':_0x1fba57[_0x7199('0x14')]=_0x7199('0x53');break;case _0x7199('0x54'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x55');break;case _0x7199('0x56'):case'queuecampaigns':_0x1fba57['childModel']=_0x7199('0x39');if(_0x5cb381){_0x1fba57[_0x7199('0x18')]=[{'name':_0x7199('0x38')},{'name':_0x7199('0x3b')}];}break;case _0x7199('0x57'):case _0x7199('0x58'):case'telephones':_0x1fba57[_0x7199('0x14')]=_0x7199('0x33');if(_0x5cb381){_0x1fba57[_0x7199('0x18')]=[{'name':_0x7199('0x59'),'filter':{'field':'role','value':[_0x7199('0x5a'),_0x7199('0x5b')]},'ignore':!![]},{'name':_0x7199('0x31')},{'name':_0x7199('0x35')}];}break;case _0x7199('0x5c'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x5d');break;case _0x7199('0x5e'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x5f');break;case _0x7199('0x60'):_0x1fba57[_0x7199('0x14')]=_0x7199('0x61');break;case'sugarcrmaccounts':_0x1fba57[_0x7199('0x14')]='SugarcrmAccount';break;case _0x7199('0x62'):_0x1fba57['childModel']=_0x7199('0x63');break;case _0x7199('0x64'):_0x1fba57['childModel']=_0x7199('0x65');break;case'vtigeraccounts':_0x1fba57[_0x7199('0x14')]=_0x7199('0x33');break;case _0x7199('0x66'):_0x1fba57['childModel']=_0x7199('0x67');break;case _0x7199('0x68'):_0x1fba57[_0x7199('0x14')]='Disposition';break;case'customdashboards':_0x1fba57[_0x7199('0x14')]=_0x7199('0x69');break;case _0x7199('0x6a'):_0x1fba57['childModel']=_0x7199('0x6b');break;case'pauses':_0x1fba57[_0x7199('0x14')]=_0x7199('0x6c');break;case _0x7199('0x6d'):_0x1fba57['childModel']=_0x7199('0x6e');break;case'sounds':_0x1fba57[_0x7199('0x14')]='Sound';break;case _0x7199('0x6f'):_0x1fba57['childModel']=_0x7199('0x70');break;case'templates':_0x1fba57[_0x7199('0x14')]=_0x7199('0x71');break;case'triggers':_0x1fba57[_0x7199('0x14')]=_0x7199('0x72');break;case _0x7199('0x73'):_0x1fba57[_0x7199('0x14')]='Trunk';break;case _0x7199('0x74'):_0x1fba57['childModel']=_0x7199('0x75');break;case'plugins':_0x1fba57[_0x7199('0x14')]=_0x7199('0x76');break;case _0x7199('0x77'):_0x1fba57[_0x7199('0x14')]='AnalyticExtractedReport';_0x1fba57[_0x7199('0x18')]=[{'name':_0x7199('0x78'),'field':'id','foreignKey':_0x7199('0x79')}];break;case _0x7199('0x7a'):_0x1fba57['childModel']=_0x7199('0x7b');break;}return _0x1fba57;}function _0x1a70cf(_0xae557a,_0x35e027){var _0x3953af=_0xae557a[_0x7199('0x7c')](0x0)[_0x7199('0x7d')]()+_0xae557a['slice'](0x1);var _0x386e78={'type':_0x3c724d['Sequelize'][_0x7199('0x7e')][_0x7199('0x7f')],'raw':!![]};return new Promise(function(_0x5616d1,_0x4442f7){var _0xc1cffb=squel['select']()[_0x7199('0xb')](_0x7199('0x80')+_0x3953af+'InteractionId','id')[_0x7199('0xb')](_0x7199('0x81'))[_0x7199('0x82')](_0x7199('0x83')+_0xae557a+'_interactions','ui')[_0x7199('0x84')](_0x7199('0x85'),_0x35e027['id']);return _0x3c724d['sequelize'][_0x7199('0x86')](_0xc1cffb[_0x7199('0x87')](),_0x386e78)[_0x7199('0x7')](function(_0x3063d2){_0x35e027[_0x3953af+_0x7199('0x88')]=_0x3063d2;_0x5616d1(_0x3063d2);})[_0x7199('0xa')](function(_0x13960b){_0x4442f7(_0x13960b);});});}return _0x416d0a[_0x7199('0x89')](_0x7199('0x8a'),attributes,{'tableName':_0x7199('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x5e744b){var _0x424fb8=require(_0x7199('0x8c'));var _0x5bb4c8={'raw':_0x5e744b['query']['raw'],'where':{}};var _0x3c1522={};var _0x31b7dc={'count':0x0,'rows':[]};var _0x119928=_0x5e744b[_0x7199('0x86')]['section'];var _0x209bce=_0x5e744b[_0x7199('0x86')][_0x7199('0x8d')]||![];var _0x232da4=_0x3c6713(_0x119928,_0x209bce);if(!_0x232da4[_0x7199('0x14')])throw new Error(_0x7199('0x8e')+_0x119928+'\x27');var _0x2166ed=[{'name':_0x119928}];if(!_[_0x7199('0x8f')](_0x232da4[_0x7199('0x18')]))_0x2166ed=_0x232da4['parentSections'];var _0x57dff2=[];for(var _0x2015e3=0x0;_0x2015e3<_0x2166ed['length'];_0x2015e3++){_0x57dff2[_0x7199('0x90')](_0x3c724d[_0x7199('0x91')][_0x7199('0x92')]({'where':{'userProfileId':_0x5e744b['params']['id'],'name':_0x2166ed[_0x2015e3][_0x7199('0xd')]},'raw':!![]}));}return Promise[_0x7199('0x93')](_0x57dff2)[_0x7199('0x7')](function(_0x51ebc2){var _0x53433b=_[_0x7199('0x4')](_0x51ebc2,function(_0x6e5f94){return _0x6e5f94?_0x6e5f94:undefined;});var _0xcb272d=_['filter'](_0x2166ed,[_0x7199('0x94'),!![]]);var _0x5b217f=_[_0x7199('0x8f')](_0x53433b)&&_[_0x7199('0x8f')](_0xcb272d)?null:_[_0x7199('0x95')](_0xcb272d,_0x53433b);if(!_0x5b217f)return null;var _0x2ec200=[];for(var _0x20f127=0x0;_0x20f127<_0x5b217f[_0x7199('0x96')];_0x20f127++){var _0x1c8687=_[_0x7199('0x92')](_0x2166ed,function(_0x50e4a8){return _0x5b217f[_0x20f127]?_0x50e4a8[_0x7199('0xd')]===_0x5b217f[_0x20f127][_0x7199('0xd')]:null;});if(_0x1c8687){if(_0x5b217f[_0x20f127][_0x7199('0x94')]){_0x2ec200[_0x7199('0x90')](_0x3dc3b9(_0x232da4[_0x7199('0x14')],_0x5b217f[_0x20f127]));}else{if(!_0x5b217f[_0x20f127][_0x7199('0x97')]){_0x2ec200[_0x7199('0x90')](_0x52e725(_0x1c8687,_0x5b217f[_0x20f127],_0x232da4[_0x7199('0x14')]));}else{if(_0x1c8687[_0x7199('0xc')]){_0x2ec200[_0x7199('0x90')](_0x21e5dc(_0x1c8687,_0x5b217f[_0x20f127]));}}}}}return Promise[_0x7199('0x93')](_0x2ec200);})[_0x7199('0x7')](function(_0x709abd){var _0x5d9e6b=_0x709abd;var _0x47424f=null;if(_0x5d9e6b){_0x47424f=_0x5d9e6b['length']===0x1?_0x5d9e6b[0x0]:null;}if(!_0x47424f&&!_0x5d9e6b)return _0x31b7dc;var _0x1d6671=_0x3c724d[_0x232da4['childModel']]['rawAttributes'];_0x3c1522[_0x7199('0xc')]=_['keys'](_0x1d6671);_0x3c1522[_0x7199('0x86')]=_[_0x7199('0x98')](_0x5e744b['query']);_0x3c1522['filters']=_['intersection'](_0x3c1522['model'],_0x3c1522['query']);_0x5bb4c8['attributes']=_[_0x7199('0x99')](_0x3c1522['model'],_0x424fb8[_0x7199('0x9a')](_0x5e744b[_0x7199('0x86')][_0x7199('0x9a')]));_0x5bb4c8[_0x7199('0x9b')]=_0x5bb4c8[_0x7199('0x9b')]['length']?_0x5bb4c8['attributes']:_0x3c1522[_0x7199('0xc')];if(!_0x5e744b[_0x7199('0x86')][_0x7199('0x9c')](_0x7199('0x9d'))){_0x5bb4c8[_0x7199('0x9e')]=_0x424fb8[_0x7199('0x9e')](_0x5e744b['query'][_0x7199('0x9e')]);_0x5bb4c8['offset']=_0x424fb8['offset'](_0x5e744b[_0x7199('0x86')][_0x7199('0x9f')]);}_0x5bb4c8[_0x7199('0xa0')]=_0x424fb8[_0x7199('0xa1')](_0x5e744b[_0x7199('0x86')]['sort']);_0x5bb4c8[_0x7199('0x84')]=_0x424fb8[_0x7199('0xa2')](_['pick'](_0x5e744b[_0x7199('0x86')],_0x3c1522['filters']));if(_0x5e744b['query'][_0x7199('0x4')]){_0x5bb4c8[_0x7199('0x84')]=_[_0x7199('0xa3')](_0x5bb4c8[_0x7199('0x84')],{'$or':_['map'](_0x1d6671,function(_0x21f142){if(_0x21f142[_0x7199('0x12')]['key']!=='VIRTUAL'){var _0x27cdf9={};_0x27cdf9[_0x21f142[_0x7199('0xb')]]={'$like':'%'+_0x5e744b[_0x7199('0x86')][_0x7199('0x4')]+'%'};return _0x27cdf9;}})});}var _0x2f4c69=[];var _0x33a859=null;var _0x2d3965={};if(_0x47424f){_0x33a859=_[_0x7199('0x92')](_0x2166ed,[_0x7199('0xd'),_0x47424f['name']]);if(_0x33a859[_0x7199('0xb')]){_0x2d3965={};if(_0x232da4[_0x7199('0x14')]===_0x7199('0x10')){_0x2d3965[_0x33a859[_0x7199('0xa4')]]=_[_0x7199('0x9')](_0x47424f[_0x7199('0x8')],'id');}else{_0x2d3965[_0x33a859[_0x7199('0xa4')]]=_0x47424f[_0x7199('0x8')];}_0x2f4c69[_0x7199('0x90')](_0x2d3965);}else{_0x5bb4c8['where']['id']=_0x47424f[_0x7199('0x8')];}}else{for(var _0x252b3c=0x0;_0x252b3c<_0x5d9e6b[_0x7199('0x96')];_0x252b3c++){_0x33a859=_['find'](_0x2166ed,[_0x7199('0xd'),_0x5d9e6b[_0x252b3c]['name']]);if(_0x33a859[_0x7199('0xb')]){_0x2d3965={};_0x2d3965[_0x33a859[_0x7199('0xa4')]]=_0x5d9e6b[_0x252b3c][_0x7199('0x8')];_0x2f4c69['push'](_0x2d3965);}else{if(!_0x5bb4c8[_0x7199('0x84')]['id'])_0x5bb4c8[_0x7199('0x84')]['id']=[];_0x5d9e6b[_0x252b3c][_0x7199('0x8')]['forEach'](function(_0x13da81){_0x5bb4c8[_0x7199('0x84')]['id'][_0x7199('0x90')](_0x13da81);});}}}if(!_[_0x7199('0x8f')](_0x2f4c69)){_0x5bb4c8[_0x7199('0x84')]=_[_0x7199('0xa3')](_0x5bb4c8[_0x7199('0x84')],{'$and':{'$or':_0x2f4c69}});}_0x5bb4c8=_['merge']({},_0x5bb4c8,_0x5e744b['options']);if(_0x47424f&&!_0x47424f[_0x7199('0x97')]&&_0x232da4['childModel']===_0x7199('0x10')){if(_0x5e744b[_0x7199('0x86')]['includeAll']){_0x5bb4c8[_0x7199('0xa5')]=[{'all':!![]}];}return _0x3c724d[_0x232da4['childModel']]['findAll'](_0x5bb4c8)[_0x7199('0x7')](function(_0x4c18d6){var _0x5f5431=[];_0x4c18d6[_0x7199('0xa6')](function(_0x170de6){var _0xb1f114;switch(_0x170de6[_0x7199('0xa7')]){case _0x7199('0xa8'):_0xb1f114=_['find'](_0x47424f[_0x7199('0x8')],function(_0x43d5b6){return _0x43d5b6['id']===_0x170de6[_0x7199('0x79')]&&_0x43d5b6[_0x7199('0x12')]===_0x7199('0xa9');});break;case _0x7199('0xaa'):_0xb1f114=_[_0x7199('0x92')](_0x47424f['associatedResources'],function(_0x537411){return _0x537411['id']===_0x170de6[_0x7199('0x79')]&&_0x537411[_0x7199('0x12')]===_0x7199('0xab');});break;}if(_0xb1f114)_0x5f5431[_0x7199('0x90')](_0x170de6);});_0x31b7dc['count']=_0x5f5431['length'];_0x31b7dc[_0x7199('0xac')]=_0x5f5431;return _0x31b7dc;});}else{if(!_[_0x7199('0x8f')](_0x5e744b[_0x7199('0x86')][_0x7199('0xad')])){_0x5bb4c8[_0x7199('0x84')]['id']=_0x5bb4c8['where']['id']?_[_0x7199('0x99')](_0x5bb4c8[_0x7199('0x84')]['id'],_0x5e744b[_0x7199('0x86')]['ids']):_0x5e744b['query'][_0x7199('0xad')];if(_0x5e744b[_0x7199('0x86')][_0x7199('0xae')]){_0x5bb4c8[_0x7199('0xa0')]=_0x5e744b[_0x7199('0x86')][_0x7199('0xae')];}}if(_0x5e744b['query'][_0x7199('0xaf')]){_0x5bb4c8[_0x7199('0x84')]=_[_0x7199('0xa3')](_0x5bb4c8['where'],{'$and':_0x5e744b[_0x7199('0x86')][_0x7199('0xaf')]});}return _0x3c724d[_0x232da4[_0x7199('0x14')]][_0x7199('0xb0')]({'where':_0x5bb4c8[_0x7199('0x84')]})[_0x7199('0x7')](function(_0x56e140){_0x31b7dc[_0x7199('0xb0')]=_0x56e140;if(_0x5e744b[_0x7199('0x86')][_0x7199('0xb1')]){if(_0x232da4[_0x7199('0x14')]===_0x7199('0x1d')){_0x5bb4c8['include']=[{'model':_0x3c724d['Tag'],'as':_0x7199('0xb2'),'attributes':['id','name','color'],'required':_0x5e744b[_0x7199('0x86')][_0x7199('0xb3')]?!![]:![]},{'model':_0x3c724d[_0x7199('0x70')],'as':'ThroughTags','attributes':['id','name',_0x7199('0xb4')],'through':_0x5e744b[_0x7199('0x86')][_0x7199('0xb3')]?{'attributes':[],'where':{'TagId':_0x5e744b[_0x7199('0x86')][_0x7199('0xb3')]||undefined}}:{},'required':_0x5e744b[_0x7199('0x86')][_0x7199('0xb3')]?!![]:![]}];}else{_0x5bb4c8[_0x7199('0xa5')]=[{'all':!![]}];}}return _0x3c724d[_0x232da4['childModel']][_0x7199('0x6')](_0x5bb4c8);})[_0x7199('0x7')](function(_0x5f2c55){_0x31b7dc[_0x7199('0xac')]=_0x5f2c55;if(_0x119928===_0x7199('0x31')&&_0x5e744b[_0x7199('0x86')][_0x7199('0xb5')]===_0x7199('0xb6')){var _0x1df067=[];for(var _0x3f3f8d=0x0;_0x3f3f8d<_0x31b7dc[_0x7199('0xac')]['length'];_0x3f3f8d++){_0x1df067[_0x7199('0x90')](_0x1a70cf(_0x7199('0xb7'),_0x31b7dc[_0x7199('0xac')][_0x3f3f8d]['dataValues']));_0x1df067[_0x7199('0x90')](_0x1a70cf(_0x7199('0xb8'),_0x31b7dc[_0x7199('0xac')][_0x3f3f8d][_0x7199('0xb9')]));_0x1df067[_0x7199('0x90')](_0x1a70cf(_0x7199('0xba'),_0x31b7dc[_0x7199('0xac')][_0x3f3f8d][_0x7199('0xb9')]));_0x1df067['push'](_0x1a70cf(_0x7199('0xbb'),_0x31b7dc['rows'][_0x3f3f8d][_0x7199('0xb9')]));_0x1df067[_0x7199('0x90')](_0x1a70cf('openchannel',_0x31b7dc[_0x7199('0xac')][_0x3f3f8d][_0x7199('0xb9')]));_0x1df067[_0x7199('0x90')](_0x1a70cf(_0x7199('0xbc'),_0x31b7dc[_0x7199('0xac')][_0x3f3f8d]['dataValues']));}return Promise['all'](_0x1df067)[_0x7199('0x7')](function(){return _0x31b7dc;});}return _0x31b7dc;});}});}}});}; \ No newline at end of file +var _0x9801=['WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','agents','telephones','admin','user','zendeskaccounts','ZendeskAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','Pause','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','InteractionId','ui.createdAt','from','_interactions','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','UserProfile','user_profiles','../../components/parsers/qs','raw','section','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','find','params','all','ignore','isEmpty','union','rawAttributes','keys','filters','attributes','intersection','fields','hasOwnProperty','limit','offset','order','where','pick','merge','key','VIRTUAL','foreignKey','forEach','autoAssociation','includeAll','include','reportType','custom','CustomReports','ids','customSorting','extraQueryConditions','Tags','color','tag','rows','openTabs','dataValues','sms','whatsapp','lodash','./userProfile.attributes','exports','filter','field','value','findAll','associatedResources','catch','model','map','UserProfileResource','then','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','parentSections','JscriptyProject','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceRecording','Agents','name','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','VoiceChanSpy','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts'];(function(_0x13a0ea,_0x18960e){var _0x206bd7=function(_0x5a9711){while(--_0x5a9711){_0x13a0ea['push'](_0x13a0ea['shift']());}};_0x206bd7(++_0x18960e);}(_0x9801,0x128));var _0x1980=function(_0x48753b,_0x51994f){_0x48753b=_0x48753b-0x0;var _0x57400a=_0x9801[_0x48753b];return _0x57400a;};'use strict';var _=require(_0x1980('0x0'));var attributes=require(_0x1980('0x1'));var squel=require('squel');module[_0x1980('0x2')]=function(_0x1a1ee3){var _0x3639e5=_0x1a1ee3['models'];function _0x3df94a(_0x16d6f2,_0x455a4c){return new Promise(function(_0x3214e6,_0x22cdc0){if(!_0x455a4c)return _0x3214e6(null);var _0x113a92=_0x455a4c['filter']?{[_0x455a4c[_0x1980('0x3')][_0x1980('0x4')]]:_0x455a4c[_0x1980('0x3')][_0x1980('0x5')]}:undefined;return _0x3639e5[_0x16d6f2][_0x1980('0x6')]({'where':_0x113a92,'raw':!![]})['then'](function(_0x2b95c6){_0x455a4c[_0x1980('0x7')]=_['map'](_0x2b95c6,'id');_0x3214e6(_0x455a4c);})[_0x1980('0x8')](function(_0x518f27){_0x22cdc0(_0x518f27);});});}function _0x66cab2(_0x18c677,_0x1e6939){return new Promise(function(_0x2f8c77,_0x780d78){var _0x466f44=_0x18c677['filter']?{[_0x18c677[_0x1980('0x3')][_0x1980('0x4')]]:_0x18c677[_0x1980('0x3')][_0x1980('0x5')]}:undefined;return _0x3639e5[_0x18c677[_0x1980('0x9')]][_0x1980('0x6')]({'where':_0x466f44,'raw':!![]})['then'](function(_0xd6eb3c){_0x1e6939['associatedResources']=_[_0x1980('0xa')](_0xd6eb3c,function(_0x2a6e1d){return _0x2a6e1d['name'];});_0x2f8c77(_0x1e6939);})[_0x1980('0x8')](function(_0x21dc48){_0x780d78(_0x21dc48);});});}function _0x11d2c0(_0x480dd7,_0x2222bd,_0x3f6105){if(!_0x2222bd)return Promise['resolve'](null);return new Promise(function(_0x765d1d,_0x3f8d29){return _0x3639e5[_0x1980('0xb')][_0x1980('0x6')]({'where':{'sectionId':_0x2222bd['id']},'raw':!![]})[_0x1980('0xc')](function(_0x297aca){if(_0x480dd7[_0x1980('0x4')]&&_0x480dd7[_0x1980('0x4')]!=='id'){_0x2222bd['associatedResources']=_['map'](_0x297aca,function(_0x5c33e4){return _0x5c33e4[_0x480dd7[_0x1980('0x4')]];});}else{if(_0x3f6105===_0x1980('0xd')){_0x2222bd[_0x1980('0x7')]=_['map'](_0x297aca,function(_0x3968cb){return{'id':_0x3968cb[_0x1980('0xe')],'type':_0x3968cb[_0x1980('0xf')]};});}else{_0x2222bd[_0x1980('0x7')]=_['map'](_0x297aca,function(_0x3b7c7a){return _0x3b7c7a[_0x1980('0xe')];});}}_0x765d1d(_0x2222bd);})[_0x1980('0x8')](function(_0x1679b2){_0x3f8d29(_0x1679b2);});});}function _0x5a2922(_0x2bb322,_0x2e539e){var _0x38cb6d={'parentSections':[]};switch(_0x2bb322[_0x1980('0x10')]()){case _0x1980('0x11'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x13');break;case _0x1980('0x14'):_0x38cb6d[_0x1980('0x12')]='SquareOdbc';break;case _0x1980('0x15'):_0x38cb6d[_0x1980('0x12')]='SquareRecording';_0x38cb6d[_0x1980('0x16')]=[{'name':'SquareProjects','field':'name','foreignKey':'projectName'}];break;case'projects':_0x38cb6d['childModel']=_0x1980('0x17');break;case'contacts':_0x38cb6d[_0x1980('0x12')]=_0x1980('0x18');_0x38cb6d[_0x1980('0x16')]=[{'name':_0x1980('0x19'),'field':'id','foreignKey':'ListId'}];break;case _0x1980('0x1a'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x1b');break;case _0x1980('0x1c'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x1d');break;case _0x1980('0x1e'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x1f');break;case _0x1980('0x20'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x21');break;case _0x1980('0x22'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x23');break;case'faxqueues':_0x38cb6d[_0x1980('0x12')]=_0x1980('0x24');break;case _0x1980('0x25'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x26');break;case'inboundroutes':case _0x1980('0x27'):case _0x1980('0x28'):_0x38cb6d['childModel']=_0x1980('0x29');break;case _0x1980('0x2a'):_0x38cb6d[_0x1980('0x12')]='VoiceContext';break;case _0x1980('0x2b'):_0x38cb6d[_0x1980('0x12')]='VoiceMail';break;case'voicerecordings':_0x38cb6d[_0x1980('0x12')]=_0x1980('0x2c');_0x38cb6d[_0x1980('0x16')]=[{'name':_0x1980('0x2d'),'field':_0x1980('0x2e'),'foreignKey':_0x1980('0x2f'),'model':_0x1980('0x30'),'filter':{'field':_0x1980('0x31'),'value':[_0x1980('0x32')]}},{'name':_0x1980('0x33'),'field':'name','foreignKey':_0x1980('0x2f'),'model':_0x1980('0x30'),'filter':{'field':'role','value':[_0x1980('0x34')]}},{'name':_0x1980('0x35'),'field':'name','foreignKey':_0x1980('0x36'),'model':_0x1980('0x37'),'filter':{'field':_0x1980('0xf'),'value':[_0x1980('0x38')]}},{'name':_0x1980('0x39'),'field':_0x1980('0x2e'),'foreignKey':_0x1980('0x36'),'model':_0x1980('0x37'),'filter':{'field':_0x1980('0xf'),'value':['outbound']}}];break;case _0x1980('0x3a'):_0x38cb6d['childModel']=_0x1980('0x3b');break;case'chanspies':_0x38cb6d[_0x1980('0x12')]=_0x1980('0x3c');break;case'voiceprefixes':_0x38cb6d[_0x1980('0x12')]='VoicePrefix';break;case _0x1980('0x3d'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x3e');break;case _0x1980('0x3f'):_0x38cb6d['childModel']=_0x1980('0x40');break;case _0x1980('0x41'):_0x38cb6d[_0x1980('0x12')]='MailAccount';break;case _0x1980('0x42'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x43');break;case _0x1980('0x44'):_0x38cb6d['childModel']=_0x1980('0x45');break;case'openchannelaccounts':_0x38cb6d[_0x1980('0x12')]=_0x1980('0x46');break;case _0x1980('0x47'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x48');break;case _0x1980('0x49'):_0x38cb6d[_0x1980('0x12')]='SmsAccount';break;case'whatsappqueues':_0x38cb6d[_0x1980('0x12')]=_0x1980('0x4a');break;case _0x1980('0x4b'):_0x38cb6d[_0x1980('0x12')]='WhatsappAccount';break;case _0x1980('0x4c'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x4d');break;case _0x1980('0x4e'):case _0x1980('0x4f'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x37');if(_0x2e539e){_0x38cb6d['parentSections']=[{'name':_0x1980('0x35')},{'name':_0x1980('0x39')}];}break;case'users':case _0x1980('0x50'):case _0x1980('0x51'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x30');if(_0x2e539e){_0x38cb6d['parentSections']=[{'name':'Users','filter':{'field':_0x1980('0x31'),'value':[_0x1980('0x52'),_0x1980('0x53')]},'ignore':!![]},{'name':_0x1980('0x2d')},{'name':'Telephones'}];}break;case _0x1980('0x54'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x55');break;case'salesforceaccounts':_0x38cb6d[_0x1980('0x12')]='SalesforceAccount';break;case _0x1980('0x56'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x57');break;case _0x1980('0x58'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x59');break;case _0x1980('0x5a'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x5b');break;case _0x1980('0x5c'):_0x38cb6d['childModel']='ZohoAccount';break;case _0x1980('0x5d'):_0x38cb6d[_0x1980('0x12')]='User';break;case _0x1980('0x5e'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x5f');break;case _0x1980('0x60'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x61');break;case _0x1980('0x62'):_0x38cb6d['childModel']='Dashboard';break;case _0x1980('0x63'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x64');break;case'pauses':_0x38cb6d['childModel']=_0x1980('0x65');break;case'scheduler':_0x38cb6d['childModel']=_0x1980('0x66');break;case _0x1980('0x67'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x68');break;case _0x1980('0x69'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x6a');break;case _0x1980('0x6b'):_0x38cb6d['childModel']=_0x1980('0x6c');break;case _0x1980('0x6d'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x6e');break;case'trunks':_0x38cb6d[_0x1980('0x12')]=_0x1980('0x6f');break;case _0x1980('0x70'):_0x38cb6d['childModel']=_0x1980('0x71');break;case _0x1980('0x72'):_0x38cb6d[_0x1980('0x12')]=_0x1980('0x73');break;case'extractedreports':_0x38cb6d[_0x1980('0x12')]=_0x1980('0xd');_0x38cb6d['parentSections']=[{'name':_0x1980('0x74'),'field':'id','foreignKey':_0x1980('0x75')}];break;case _0x1980('0x76'):_0x38cb6d['childModel']=_0x1980('0x77');break;}return _0x38cb6d;}function _0x2a709c(_0x5e4eb3,_0x4f4815){var _0x17e696=_0x5e4eb3[_0x1980('0x78')](0x0)[_0x1980('0x79')]()+_0x5e4eb3[_0x1980('0x7a')](0x1);var _0x4151ea={'type':_0x3639e5[_0x1980('0x7b')]['QueryTypes'][_0x1980('0x7c')],'raw':!![]};return new Promise(function(_0x4a8604,_0x2679e7){var _0x4e4cfa=squel[_0x1980('0x7d')]()[_0x1980('0x4')](_0x1980('0x7e')+_0x17e696+_0x1980('0x7f'),'id')[_0x1980('0x4')](_0x1980('0x80'))[_0x1980('0x81')]('user_has_'+_0x5e4eb3+_0x1980('0x82'),'ui')['where'](_0x1980('0x83'),_0x4f4815['id']);return _0x3639e5[_0x1980('0x84')][_0x1980('0x85')](_0x4e4cfa['toString'](),_0x4151ea)[_0x1980('0xc')](function(_0x1dfdb2){_0x4f4815[_0x17e696+_0x1980('0x86')]=_0x1dfdb2;_0x4a8604(_0x1dfdb2);})[_0x1980('0x8')](function(_0x1078b6){_0x2679e7(_0x1078b6);});});}return _0x1a1ee3['define'](_0x1980('0x87'),attributes,{'tableName':_0x1980('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xb1518){var _0x57d19f=require(_0x1980('0x89'));var _0x479490={'raw':_0xb1518[_0x1980('0x85')][_0x1980('0x8a')],'where':{}};var _0x80f21e={};var _0x3887f4={'count':0x0,'rows':[]};var _0x38e032=_0xb1518[_0x1980('0x85')][_0x1980('0x8b')];var _0x1642d0=_0xb1518['query'][_0x1980('0x8c')]||![];var _0x7afa63=_0x5a2922(_0x38e032,_0x1642d0);if(!_0x7afa63[_0x1980('0x12')])throw new Error(_0x1980('0x8d')+_0x38e032+'\x27');var _0x2cd562=[{'name':_0x38e032}];if(!_['isEmpty'](_0x7afa63[_0x1980('0x16')]))_0x2cd562=_0x7afa63[_0x1980('0x16')];var _0x66642a=[];for(var _0x72e9bb=0x0;_0x72e9bb<_0x2cd562[_0x1980('0x8e')];_0x72e9bb++){_0x66642a[_0x1980('0x8f')](_0x3639e5[_0x1980('0x90')][_0x1980('0x91')]({'where':{'userProfileId':_0xb1518[_0x1980('0x92')]['id'],'name':_0x2cd562[_0x72e9bb][_0x1980('0x2e')]},'raw':!![]}));}return Promise[_0x1980('0x93')](_0x66642a)[_0x1980('0xc')](function(_0x3f3627){var _0xfcabf=_[_0x1980('0x3')](_0x3f3627,function(_0x192ba7){return _0x192ba7?_0x192ba7:undefined;});var _0x3cddd3=_['filter'](_0x2cd562,[_0x1980('0x94'),!![]]);var _0x4cfe91=_['isEmpty'](_0xfcabf)&&_[_0x1980('0x95')](_0x3cddd3)?null:_[_0x1980('0x96')](_0x3cddd3,_0xfcabf);if(!_0x4cfe91)return null;var _0x550717=[];for(var _0x16896b=0x0;_0x16896b<_0x4cfe91[_0x1980('0x8e')];_0x16896b++){var _0x112dda=_[_0x1980('0x91')](_0x2cd562,function(_0x1ec938){return _0x4cfe91[_0x16896b]?_0x1ec938[_0x1980('0x2e')]===_0x4cfe91[_0x16896b][_0x1980('0x2e')]:null;});if(_0x112dda){if(_0x4cfe91[_0x16896b][_0x1980('0x94')]){_0x550717[_0x1980('0x8f')](_0x3df94a(_0x7afa63[_0x1980('0x12')],_0x4cfe91[_0x16896b]));}else{if(!_0x4cfe91[_0x16896b]['autoAssociation']){_0x550717[_0x1980('0x8f')](_0x11d2c0(_0x112dda,_0x4cfe91[_0x16896b],_0x7afa63[_0x1980('0x12')]));}else{if(_0x112dda[_0x1980('0x9')]){_0x550717['push'](_0x66cab2(_0x112dda,_0x4cfe91[_0x16896b]));}}}}}return Promise[_0x1980('0x93')](_0x550717);})[_0x1980('0xc')](function(_0x33a650){var _0x149a25=_0x33a650;var _0x23fe2e=null;if(_0x149a25){_0x23fe2e=_0x149a25[_0x1980('0x8e')]===0x1?_0x149a25[0x0]:null;}if(!_0x23fe2e&&!_0x149a25)return _0x3887f4;var _0x455b63=_0x3639e5[_0x7afa63[_0x1980('0x12')]][_0x1980('0x97')];_0x80f21e[_0x1980('0x9')]=_[_0x1980('0x98')](_0x455b63);_0x80f21e[_0x1980('0x85')]=_[_0x1980('0x98')](_0xb1518['query']);_0x80f21e[_0x1980('0x99')]=_['intersection'](_0x80f21e[_0x1980('0x9')],_0x80f21e[_0x1980('0x85')]);_0x479490[_0x1980('0x9a')]=_[_0x1980('0x9b')](_0x80f21e['model'],_0x57d19f[_0x1980('0x9c')](_0xb1518[_0x1980('0x85')][_0x1980('0x9c')]));_0x479490['attributes']=_0x479490[_0x1980('0x9a')]['length']?_0x479490[_0x1980('0x9a')]:_0x80f21e[_0x1980('0x9')];if(!_0xb1518[_0x1980('0x85')][_0x1980('0x9d')]('nolimit')){_0x479490['limit']=_0x57d19f[_0x1980('0x9e')](_0xb1518[_0x1980('0x85')][_0x1980('0x9e')]);_0x479490[_0x1980('0x9f')]=_0x57d19f[_0x1980('0x9f')](_0xb1518['query']['offset']);}_0x479490[_0x1980('0xa0')]=_0x57d19f['sort'](_0xb1518[_0x1980('0x85')]['sort']);_0x479490[_0x1980('0xa1')]=_0x57d19f[_0x1980('0x99')](_[_0x1980('0xa2')](_0xb1518[_0x1980('0x85')],_0x80f21e[_0x1980('0x99')]));if(_0xb1518[_0x1980('0x85')]['filter']){_0x479490['where']=_[_0x1980('0xa3')](_0x479490[_0x1980('0xa1')],{'$or':_['map'](_0x455b63,function(_0x5c5f7b){if(_0x5c5f7b[_0x1980('0xf')][_0x1980('0xa4')]!==_0x1980('0xa5')){var _0x57e3dd={};_0x57e3dd[_0x5c5f7b[_0x1980('0x4')]]={'$like':'%'+_0xb1518['query']['filter']+'%'};return _0x57e3dd;}})});}var _0x27d4e2=[];var _0x5cfef9=null;var _0x3edef2={};if(_0x23fe2e){_0x5cfef9=_[_0x1980('0x91')](_0x2cd562,[_0x1980('0x2e'),_0x23fe2e['name']]);if(_0x5cfef9[_0x1980('0x4')]){_0x3edef2={};if(_0x7afa63[_0x1980('0x12')]===_0x1980('0xd')){_0x3edef2[_0x5cfef9[_0x1980('0xa6')]]=_['map'](_0x23fe2e[_0x1980('0x7')],'id');}else{_0x3edef2[_0x5cfef9['foreignKey']]=_0x23fe2e[_0x1980('0x7')];}_0x27d4e2[_0x1980('0x8f')](_0x3edef2);}else{_0x479490[_0x1980('0xa1')]['id']=_0x23fe2e[_0x1980('0x7')];}}else{for(var _0x1a24bc=0x0;_0x1a24bc<_0x149a25[_0x1980('0x8e')];_0x1a24bc++){_0x5cfef9=_[_0x1980('0x91')](_0x2cd562,[_0x1980('0x2e'),_0x149a25[_0x1a24bc][_0x1980('0x2e')]]);if(_0x5cfef9['field']){_0x3edef2={};_0x3edef2[_0x5cfef9[_0x1980('0xa6')]]=_0x149a25[_0x1a24bc]['associatedResources'];_0x27d4e2[_0x1980('0x8f')](_0x3edef2);}else{if(!_0x479490['where']['id'])_0x479490[_0x1980('0xa1')]['id']=[];_0x149a25[_0x1a24bc]['associatedResources'][_0x1980('0xa7')](function(_0x42b93e){_0x479490[_0x1980('0xa1')]['id']['push'](_0x42b93e);});}}}if(!_['isEmpty'](_0x27d4e2)){_0x479490[_0x1980('0xa1')]=_[_0x1980('0xa3')](_0x479490[_0x1980('0xa1')],{'$and':{'$or':_0x27d4e2}});}_0x479490=_[_0x1980('0xa3')]({},_0x479490,_0xb1518['options']);if(_0x23fe2e&&!_0x23fe2e[_0x1980('0xa8')]&&_0x7afa63[_0x1980('0x12')]===_0x1980('0xd')){if(_0xb1518[_0x1980('0x85')][_0x1980('0xa9')]){_0x479490[_0x1980('0xaa')]=[{'all':!![]}];}return _0x3639e5[_0x7afa63[_0x1980('0x12')]][_0x1980('0x6')](_0x479490)['then'](function(_0x2d6142){var _0x5bfcf3=[];_0x2d6142['forEach'](function(_0x50bf6b){var _0x25286e;switch(_0x50bf6b[_0x1980('0xab')]){case'default':_0x25286e=_[_0x1980('0x91')](_0x23fe2e[_0x1980('0x7')],function(_0x41b3d0){return _0x41b3d0['id']===_0x50bf6b[_0x1980('0x75')]&&_0x41b3d0[_0x1980('0xf')]==='DefaultReports';});break;case _0x1980('0xac'):_0x25286e=_[_0x1980('0x91')](_0x23fe2e[_0x1980('0x7')],function(_0x19190e){return _0x19190e['id']===_0x50bf6b[_0x1980('0x75')]&&_0x19190e[_0x1980('0xf')]===_0x1980('0xad');});break;}if(_0x25286e)_0x5bfcf3['push'](_0x50bf6b);});_0x3887f4['count']=_0x5bfcf3['length'];_0x3887f4['rows']=_0x5bfcf3;return _0x3887f4;});}else{if(!_[_0x1980('0x95')](_0xb1518[_0x1980('0x85')][_0x1980('0xae')])){_0x479490['where']['id']=_0x479490[_0x1980('0xa1')]['id']?_['intersection'](_0x479490[_0x1980('0xa1')]['id'],_0xb1518['query'][_0x1980('0xae')]):_0xb1518[_0x1980('0x85')]['ids'];if(_0xb1518[_0x1980('0x85')]['customSorting']){_0x479490['order']=_0xb1518[_0x1980('0x85')][_0x1980('0xaf')];}}if(_0xb1518[_0x1980('0x85')][_0x1980('0xb0')]){_0x479490[_0x1980('0xa1')]=_[_0x1980('0xa3')](_0x479490[_0x1980('0xa1')],{'$and':_0xb1518['query']['extraQueryConditions']});}return _0x3639e5[_0x7afa63[_0x1980('0x12')]]['count']({'where':_0x479490['where']})[_0x1980('0xc')](function(_0x5d7e0e){_0x3887f4['count']=_0x5d7e0e;if(_0xb1518[_0x1980('0x85')]['includeAll']){if(_0x7afa63['childModel']===_0x1980('0x18')){_0x479490[_0x1980('0xaa')]=[{'model':_0x3639e5[_0x1980('0x6a')],'as':_0x1980('0xb1'),'attributes':['id',_0x1980('0x2e'),_0x1980('0xb2')],'required':_0xb1518[_0x1980('0x85')][_0x1980('0xb3')]?!![]:![]},{'model':_0x3639e5[_0x1980('0x6a')],'as':'ThroughTags','attributes':['id',_0x1980('0x2e'),'color'],'through':_0xb1518[_0x1980('0x85')][_0x1980('0xb3')]?{'attributes':[],'where':{'TagId':_0xb1518[_0x1980('0x85')][_0x1980('0xb3')]||undefined}}:{},'required':_0xb1518[_0x1980('0x85')][_0x1980('0xb3')]?!![]:![]}];}else{_0x479490[_0x1980('0xaa')]=[{'all':!![]}];}}return _0x3639e5[_0x7afa63[_0x1980('0x12')]][_0x1980('0x6')](_0x479490);})[_0x1980('0xc')](function(_0x10ed50){_0x3887f4[_0x1980('0xb4')]=_0x10ed50;if(_0x38e032===_0x1980('0x2d')&&_0xb1518[_0x1980('0x85')][_0x1980('0xb5')]==='true'){var _0x23765d=[];for(var _0x5c91ce=0x0;_0x5c91ce<_0x3887f4['rows'][_0x1980('0x8e')];_0x5c91ce++){_0x23765d[_0x1980('0x8f')](_0x2a709c('chat',_0x3887f4[_0x1980('0xb4')][_0x5c91ce][_0x1980('0xb6')]));_0x23765d[_0x1980('0x8f')](_0x2a709c(_0x1980('0xb7'),_0x3887f4[_0x1980('0xb4')][_0x5c91ce][_0x1980('0xb6')]));_0x23765d[_0x1980('0x8f')](_0x2a709c('fax',_0x3887f4['rows'][_0x5c91ce][_0x1980('0xb6')]));_0x23765d['push'](_0x2a709c('mail',_0x3887f4['rows'][_0x5c91ce][_0x1980('0xb6')]));_0x23765d[_0x1980('0x8f')](_0x2a709c('openchannel',_0x3887f4['rows'][_0x5c91ce][_0x1980('0xb6')]));_0x23765d[_0x1980('0x8f')](_0x2a709c(_0x1980('0xb8'),_0x3887f4[_0x1980('0xb4')][_0x5c91ce][_0x1980('0xb6')]));}return Promise[_0x1980('0x93')](_0x23765d)[_0x1980('0xc')](function(){return _0x3887f4;});}return _0x3887f4;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index b0d4986..2650539 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 _0x1115=['http','defaults','redis','socket.io-emitter','./userProfile.socket','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x4fe966,_0x5ce8fb){var _0x3d6ee2=function(_0x54539b){while(--_0x54539b){_0x4fe966['push'](_0x4fe966['shift']());}};_0x3d6ee2(++_0x5ce8fb);}(_0x1115,0x1b6));var _0x5111=function(_0x5e0fb2,_0x498b25){_0x5e0fb2=_0x5e0fb2-0x0;var _0x2686d5=_0x1115[_0x5e0fb2];return _0x2686d5;};'use strict';var _=require('lodash');var util=require(_0x5111('0x0'));var moment=require(_0x5111('0x1'));var BPromise=require(_0x5111('0x2'));var rs=require(_0x5111('0x3'));var fs=require('fs');var Redis=require(_0x5111('0x4'));var db=require(_0x5111('0x5'))['db'];var utils=require(_0x5111('0x6'));var logger=require(_0x5111('0x7'))(_0x5111('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5111('0x9')][_0x5111('0xa')]({'port':0x232a});config['redis']=_[_0x5111('0xb')](config[_0x5111('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5111('0xd'))(new Redis(config['redis']));require(_0x5111('0xe'))[_0x5111('0xf')](socket);function respondWithRpcPromise(_0x4ecb50,_0x5e12a7,_0x347d87){return new BPromise(function(_0x5a826a,_0x162624){return client['request'](_0x4ecb50,_0x347d87)[_0x5111('0x10')](function(_0x532984){logger[_0x5111('0x11')](_0x5111('0x12'),_0x5e12a7,_0x5111('0x13'));logger[_0x5111('0x14')](_0x5111('0x15'),_0x5e12a7,_0x5111('0x13'),JSON[_0x5111('0x16')](_0x532984));if(_0x532984[_0x5111('0x17')]){if(_0x532984[_0x5111('0x17')][_0x5111('0x18')]===0x1f4){logger[_0x5111('0x17')](_0x5111('0x12'),_0x5e12a7,_0x532984[_0x5111('0x17')][_0x5111('0x19')]);return _0x162624(_0x532984[_0x5111('0x17')][_0x5111('0x19')]);}logger['error'](_0x5111('0x12'),_0x5e12a7,_0x532984['error']['message']);return _0x5a826a(_0x532984[_0x5111('0x17')][_0x5111('0x19')]);}else{logger[_0x5111('0x11')]('UserProfile,\x20%s,\x20%s',_0x5e12a7,_0x5111('0x13'));_0x5a826a(_0x532984[_0x5111('0x1a')]['message']);}})[_0x5111('0x1b')](function(_0x10110b){logger[_0x5111('0x17')](_0x5111('0x12'),_0x5e12a7,_0x10110b);_0x162624(_0x10110b);});});} \ No newline at end of file +var _0xa7be=['then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','request'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa7be,0xfd));var _0xea7b=function(_0x3736d3,_0x1e2839){_0x3736d3=_0x3736d3-0x0;var _0x15fc1b=_0xa7be[_0x3736d3];return _0x15fc1b;};'use strict';var _=require(_0xea7b('0x0'));var util=require(_0xea7b('0x1'));var moment=require(_0xea7b('0x2'));var BPromise=require(_0xea7b('0x3'));var rs=require(_0xea7b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xea7b('0x5'));var logger=require(_0xea7b('0x6'))(_0xea7b('0x7'));var config=require('../../config/environment');var jayson=require(_0xea7b('0x8'));var client=jayson[_0xea7b('0x9')][_0xea7b('0xa')]({'port':0x232a});config[_0xea7b('0xb')]=_[_0xea7b('0xc')](config[_0xea7b('0xb')],{'host':_0xea7b('0xd'),'port':0x18eb});var socket=require(_0xea7b('0xe'))(new Redis(config[_0xea7b('0xb')]));require(_0xea7b('0xf'))['register'](socket);function respondWithRpcPromise(_0x413c1b,_0x13bdcf,_0x37e035){return new BPromise(function(_0x3675a9,_0x4de636){return client[_0xea7b('0x10')](_0x413c1b,_0x37e035)[_0xea7b('0x11')](function(_0x4a5b29){logger[_0xea7b('0x12')](_0xea7b('0x13'),_0x13bdcf,_0xea7b('0x14'));logger[_0xea7b('0x15')](_0xea7b('0x16'),_0x13bdcf,_0xea7b('0x14'),JSON[_0xea7b('0x17')](_0x4a5b29));if(_0x4a5b29[_0xea7b('0x18')]){if(_0x4a5b29['error']['code']===0x1f4){logger[_0xea7b('0x18')]('UserProfile,\x20%s,\x20%s',_0x13bdcf,_0x4a5b29[_0xea7b('0x18')][_0xea7b('0x19')]);return _0x4de636(_0x4a5b29['error']['message']);}logger[_0xea7b('0x18')]('UserProfile,\x20%s,\x20%s',_0x13bdcf,_0x4a5b29[_0xea7b('0x18')][_0xea7b('0x19')]);return _0x3675a9(_0x4a5b29[_0xea7b('0x18')][_0xea7b('0x19')]);}else{logger[_0xea7b('0x12')]('UserProfile,\x20%s,\x20%s',_0x13bdcf,_0xea7b('0x14'));_0x3675a9(_0x4a5b29[_0xea7b('0x1a')][_0xea7b('0x19')]);}})['catch'](function(_0x1d7c67){logger[_0xea7b('0x18')]('UserProfile,\x20%s,\x20%s',_0x13bdcf,_0x1d7c67);_0x4de636(_0x1d7c67);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index bd6599a..38d4767 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 _0xc0ca=['remove','update','emit','removeListener','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc0ca,0x168));var _0xac0c=function(_0x34fc44,_0x289794){_0x34fc44=_0x34fc44-0x0;var _0x277fdc=_0xc0ca[_0x34fc44];return _0x277fdc;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=['save',_0xac0c('0x0'),_0xac0c('0x1')];function createListener(_0x461066,_0x500849){return function(_0x5c4540){_0x500849[_0xac0c('0x2')](_0x461066,_0x5c4540);};}function removeListener(_0xc500e0,_0x7da217){return function(){UserProfileEvents[_0xac0c('0x3')](_0xc500e0,_0x7da217);};}exports[_0xac0c('0x4')]=function(_0x39d947){for(var _0x53954f=0x0,_0x177061=events['length'];_0x53954f<_0x177061;_0x53954f++){var _0x35b971=events[_0x53954f];var _0x4406ff=createListener('userProfile:'+_0x35b971,_0x39d947);UserProfileEvents['on'](_0x35b971,_0x4406ff);}}; \ No newline at end of file +var _0x7cc7=['update','emit','removeListener','register','length','./userProfile.events','remove'];(function(_0x2bcdf9,_0x56f338){var _0x582597=function(_0x20940f){while(--_0x20940f){_0x2bcdf9['push'](_0x2bcdf9['shift']());}};_0x582597(++_0x56f338);}(_0x7cc7,0xc2));var _0x77cc=function(_0x416ac3,_0x52e360){_0x416ac3=_0x416ac3-0x0;var _0x2f7668=_0x7cc7[_0x416ac3];return _0x2f7668;};'use strict';var UserProfileEvents=require(_0x77cc('0x0'));var events=['save',_0x77cc('0x1'),_0x77cc('0x2')];function createListener(_0x5c37df,_0x1ad96c){return function(_0x505b8a){_0x1ad96c[_0x77cc('0x3')](_0x5c37df,_0x505b8a);};}function removeListener(_0x5e2046,_0x349f42){return function(){UserProfileEvents[_0x77cc('0x4')](_0x5e2046,_0x349f42);};}exports[_0x77cc('0x5')]=function(_0x19fec0){for(var _0x5acada=0x0,_0x31ca79=events[_0x77cc('0x6')];_0x5acada<_0x31ca79;_0x5acada++){var _0xce7ccc=events[_0x5acada];var _0x16194c=createListener('userProfile:'+_0xce7ccc,_0x19fec0);UserProfileEvents['on'](_0xce7ccc,_0x16194c);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index e847232..2a41acc 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 _0xec09=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x2567c5,_0x2cba1e){var _0x149bd9=function(_0x40a0ee){while(--_0x40a0ee){_0x2567c5['push'](_0x2567c5['shift']());}};_0x149bd9(++_0x2cba1e);}(_0xec09,0x1d4));var _0x9ec0=function(_0x2801b2,_0x1dbe10){_0x2801b2=_0x2801b2-0x0;var _0x1eb39a=_0xec09[_0x2801b2];return _0x1eb39a;};'use strict';var multer=require(_0x9ec0('0x0'));var util=require(_0x9ec0('0x1'));var path=require(_0x9ec0('0x2'));var timeout=require(_0x9ec0('0x3'));var express=require(_0x9ec0('0x4'));var router=express['Router']();var fs_extra=require(_0x9ec0('0x5'));var auth=require(_0x9ec0('0x6'));var interaction=require(_0x9ec0('0x7'));var config=require(_0x9ec0('0x8'));var controller=require(_0x9ec0('0x9'));router[_0x9ec0('0xa')]('/',auth[_0x9ec0('0xb')](),controller[_0x9ec0('0xc')]);router[_0x9ec0('0xa')]('/describe',auth[_0x9ec0('0xb')](),controller[_0x9ec0('0xd')]);router['get'](_0x9ec0('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x9ec0('0xb')](),controller[_0x9ec0('0xf')]);router[_0x9ec0('0x10')](_0x9ec0('0xe'),auth[_0x9ec0('0xb')](),controller[_0x9ec0('0x11')]);router[_0x9ec0('0x12')](_0x9ec0('0xe'),auth[_0x9ec0('0xb')](),controller[_0x9ec0('0x13')]);module[_0x9ec0('0x14')]=router; \ No newline at end of file +var _0x13c6=['describe','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get'];(function(_0x174804,_0x204927){var _0x5cfb06=function(_0x44eb65){while(--_0x44eb65){_0x174804['push'](_0x174804['shift']());}};_0x5cfb06(++_0x204927);}(_0x13c6,0x15c));var _0x613c=function(_0x120636,_0x477fb3){_0x120636=_0x120636-0x0;var _0x482238=_0x13c6[_0x120636];return _0x482238;};'use strict';var multer=require(_0x613c('0x0'));var util=require(_0x613c('0x1'));var path=require(_0x613c('0x2'));var timeout=require(_0x613c('0x3'));var express=require(_0x613c('0x4'));var router=express['Router']();var fs_extra=require(_0x613c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x613c('0x6'));var config=require(_0x613c('0x7'));var controller=require(_0x613c('0x8'));router['get']('/',auth[_0x613c('0x9')](),controller[_0x613c('0xa')]);router[_0x613c('0xb')]('/describe',auth[_0x613c('0x9')](),controller[_0x613c('0xc')]);router[_0x613c('0xb')](_0x613c('0xd'),auth[_0x613c('0x9')](),controller[_0x613c('0xe')]);router[_0x613c('0xf')]('/',auth[_0x613c('0x9')](),controller[_0x613c('0x10')]);router['put']('/:id',auth[_0x613c('0x9')](),controller[_0x613c('0x11')]);router['delete']('/:id',auth[_0x613c('0x9')](),controller[_0x613c('0x12')]);module[_0x613c('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 3773edc..191bdb9 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 _0xa0bc=['exports','STRING','sequelize'];(function(_0x4a4897,_0x4cc568){var _0x416951=function(_0x95aeaa){while(--_0x95aeaa){_0x4a4897['push'](_0x4a4897['shift']());}};_0x416951(++_0x4cc568);}(_0xa0bc,0x1c7));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xca0b('0x0'));module[_0xca0b('0x1')]={'name':{'type':Sequelize[_0xca0b('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xca0b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xaa95=['STRING','INTEGER','sequelize','exports'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0xaa95,0x1ae));var _0x5aa9=function(_0x599044,_0x49c267){_0x599044=_0x599044-0x0;var _0x1358f0=_0xaa95[_0x599044];return _0x1358f0;};'use strict';var Sequelize=require(_0x5aa9('0x0'));module[_0x5aa9('0x1')]={'name':{'type':Sequelize[_0x5aa9('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x5aa9('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x5aa9('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index d0b2f62..deb3136 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 _0xd943=['jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','UserProfileResource','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','merge','includeAll','include','findAll','catch','show','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto'];(function(_0x5301a2,_0x1e3186){var _0x4043c5=function(_0x1a894b){while(--_0x1a894b){_0x5301a2['push'](_0x5301a2['shift']());}};_0x4043c5(++_0x1e3186);}(_0xd943,0x15d));var _0x3d94=function(_0x3183af,_0x171e3f){_0x3183af=_0x3183af-0x0;var _0x3aeefe=_0xd943[_0x3183af];return _0x3aeefe;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d94('0x10'));var logger=require(_0x3d94('0x11'))('api');var utils=require(_0x3d94('0x12'));var config=require(_0x3d94('0x13'));var licenseUtil=require(_0x3d94('0x14'));var db=require(_0x3d94('0x15'))['db'];function respondWithStatusCode(_0x15a392,_0x548b89){_0x548b89=_0x548b89||0xcc;return function(_0x96c54b){if(_0x96c54b){return _0x15a392[_0x3d94('0x16')](_0x548b89);}return _0x15a392[_0x3d94('0x17')](_0x548b89)['end']();};}function respondWithResult(_0x24e8b9,_0x29608d){_0x29608d=_0x29608d||0xc8;return function(_0x7d6969){if(_0x7d6969){return _0x24e8b9['status'](_0x29608d)[_0x3d94('0x18')](_0x7d6969);}};}function respondWithFilteredResult(_0x340818,_0x292419){return function(_0x34098e){if(_0x34098e){var _0xaf939a=typeof _0x292419[_0x3d94('0x19')]===_0x3d94('0x1a')&&typeof _0x292419[_0x3d94('0x1b')]==='undefined';var _0x22676a=_0x34098e[_0x3d94('0x1c')];var _0x2acee3=_0xaf939a?0x0:_0x292419[_0x3d94('0x19')];var _0x4afc92=_0xaf939a?_0x34098e[_0x3d94('0x1c')]:_0x292419[_0x3d94('0x19')]+_0x292419['limit'];var _0x9bca24;if(_0x4afc92>=_0x22676a){_0x4afc92=_0x22676a;_0x9bca24=0xc8;}else{_0x9bca24=0xce;}_0x340818['status'](_0x9bca24);return _0x340818[_0x3d94('0x1d')](_0x3d94('0x1e'),_0x2acee3+'-'+_0x4afc92+'/'+_0x22676a)[_0x3d94('0x18')](_0x34098e);}return null;};}function patchUpdates(_0x1e9ec2){return function(_0x35a3cc){try{jsonpatch['apply'](_0x35a3cc,_0x1e9ec2,!![]);}catch(_0x578002){return BPromise[_0x3d94('0x1f')](_0x578002);}return _0x35a3cc[_0x3d94('0x20')]();};}function saveUpdates(_0x9c2f2c,_0x4edee4){return function(_0x30af25){if(_0x30af25){return _0x30af25[_0x3d94('0x21')](_0x9c2f2c)[_0x3d94('0x22')](function(_0x384f76){return _0x384f76;});}return null;};}function removeEntity(_0x395133,_0x4093a4){return function(_0x295493){if(_0x295493){return _0x295493[_0x3d94('0x23')]()[_0x3d94('0x22')](function(){_0x395133[_0x3d94('0x17')](0xcc)[_0x3d94('0x24')]();});}};}function handleEntityNotFound(_0x192839,_0x292976){return function(_0x3496c3){if(!_0x3496c3){_0x192839[_0x3d94('0x16')](0x194);}return _0x3496c3;};}function handleError(_0x5b3b31,_0x123183){_0x123183=_0x123183||0x1f4;return function(_0x558fd2){logger[_0x3d94('0x25')](_0x558fd2[_0x3d94('0x26')]);if(_0x558fd2[_0x3d94('0x27')]){delete _0x558fd2[_0x3d94('0x27')];}_0x5b3b31[_0x3d94('0x17')](_0x123183)[_0x3d94('0x28')](_0x558fd2);};}exports[_0x3d94('0x29')]=function(_0x47d6ab,_0x584c4a){var _0x362642={},_0x4813e1={},_0x4dd410={'count':0x0,'rows':[]};var _0x23d20d=_['map'](db[_0x3d94('0x2a')][_0x3d94('0x2b')],function(_0x32403a){return{'name':_0x32403a['fieldName'],'type':_0x32403a[_0x3d94('0x2c')]['key']};});_0x4813e1[_0x3d94('0x2d')]=_['map'](_0x23d20d,_0x3d94('0x27'));_0x4813e1[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x47d6ab[_0x3d94('0x2e')]);_0x4813e1['filters']=_[_0x3d94('0x30')](_0x4813e1['model'],_0x4813e1[_0x3d94('0x2e')]);_0x362642[_0x3d94('0x31')]=_['intersection'](_0x4813e1['model'],qs[_0x3d94('0x32')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x32')]));_0x362642['attributes']=_0x362642[_0x3d94('0x31')][_0x3d94('0x33')]?_0x362642['attributes']:_0x4813e1[_0x3d94('0x2d')];if(!_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x34')](_0x3d94('0x35'))){_0x362642[_0x3d94('0x1b')]=qs['limit'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x1b')]);_0x362642[_0x3d94('0x19')]=qs[_0x3d94('0x19')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x19')]);}_0x362642['order']=qs['sort'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x36')]);_0x362642[_0x3d94('0x37')]=qs[_0x3d94('0x38')](_[_0x3d94('0x39')](_0x47d6ab[_0x3d94('0x2e')],_0x4813e1[_0x3d94('0x38')]),_0x23d20d);if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]){_0x362642[_0x3d94('0x37')]=_['merge'](_0x362642[_0x3d94('0x37')],{'$or':_[_0x3d94('0x3b')](_0x23d20d,function(_0x361fbb){if(_0x361fbb[_0x3d94('0x2c')]!=='VIRTUAL'){var _0xcf7a73={};_0xcf7a73[_0x361fbb[_0x3d94('0x27')]]={'$like':'%'+_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]+'%'};return _0xcf7a73;}})});}_0x362642=_[_0x3d94('0x3c')]({},_0x362642,_0x47d6ab['options']);var _0x217e5e={'where':_0x362642[_0x3d94('0x37')]};return db[_0x3d94('0x2a')]['count'](_0x217e5e)['then'](function(_0x4d8a8f){_0x4dd410['count']=_0x4d8a8f;if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x362642[_0x3d94('0x3e')]=[{'all':!![]}];}return db[_0x3d94('0x2a')][_0x3d94('0x3f')](_0x362642);})[_0x3d94('0x22')](function(_0x3a3898){_0x4dd410['rows']=_0x3a3898;return _0x4dd410;})['then'](respondWithFilteredResult(_0x584c4a,_0x362642))[_0x3d94('0x40')](handleError(_0x584c4a,null));};exports[_0x3d94('0x41')]=function(_0x512cef,_0x2d0aa2){var _0x4af4b6={'raw':![],'where':{'id':_0x512cef[_0x3d94('0x42')]['id']}},_0x1361fb={};_0x1361fb[_0x3d94('0x2d')]=_[_0x3d94('0x2f')](db[_0x3d94('0x2a')]['rawAttributes']);_0x1361fb[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x512cef[_0x3d94('0x2e')]);_0x1361fb['filters']=_[_0x3d94('0x30')](_0x1361fb['model'],_0x1361fb['query']);_0x4af4b6[_0x3d94('0x31')]=_[_0x3d94('0x30')](_0x1361fb[_0x3d94('0x2d')],qs[_0x3d94('0x32')](_0x512cef['query'][_0x3d94('0x32')]));_0x4af4b6['attributes']=_0x4af4b6[_0x3d94('0x31')][_0x3d94('0x33')]?_0x4af4b6[_0x3d94('0x31')]:_0x1361fb[_0x3d94('0x2d')];if(_0x512cef[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x4af4b6[_0x3d94('0x3e')]=[{'all':!![]}];}_0x4af4b6=_['merge']({},_0x4af4b6,_0x512cef[_0x3d94('0x43')]);return db[_0x3d94('0x2a')]['find'](_0x4af4b6)['then'](handleEntityNotFound(_0x2d0aa2,null))[_0x3d94('0x22')](respondWithResult(_0x2d0aa2,null))[_0x3d94('0x40')](handleError(_0x2d0aa2,null));};exports['create']=function(_0x3c8571,_0x13fda9){return db[_0x3d94('0x2a')][_0x3d94('0x44')](_0x3c8571[_0x3d94('0x45')],{})[_0x3d94('0x22')](respondWithResult(_0x13fda9,0xc9))[_0x3d94('0x40')](handleError(_0x13fda9,null));};exports[_0x3d94('0x21')]=function(_0x60279f,_0x2429bc){if(_0x60279f[_0x3d94('0x45')]['id']){delete _0x60279f[_0x3d94('0x45')]['id'];}return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x60279f[_0x3d94('0x42')]['id']}})['then'](handleEntityNotFound(_0x2429bc,null))[_0x3d94('0x22')](saveUpdates(_0x60279f[_0x3d94('0x45')],null))[_0x3d94('0x22')](respondWithResult(_0x2429bc,null))[_0x3d94('0x40')](handleError(_0x2429bc,null));};exports[_0x3d94('0x23')]=function(_0x3ce0be,_0x129783){return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x3ce0be['params']['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x129783,null))['then'](removeEntity(_0x129783,null))[_0x3d94('0x40')](handleError(_0x129783,null));};exports[_0x3d94('0x47')]=function(_0x4af4c2,_0x255630){return db['UserProfileResource']['describe']()[_0x3d94('0x22')](respondWithResult(_0x255630,null))['catch'](handleError(_0x255630,null));}; \ No newline at end of file +var _0x33af=['findAll','rows','catch','show','params','length','include','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','merge','VIRTUAL','filter','includeAll'];(function(_0x376ebf,_0x2c4cd9){var _0x15a932=function(_0x260d20){while(--_0x260d20){_0x376ebf['push'](_0x376ebf['shift']());}};_0x15a932(++_0x2c4cd9);}(_0x33af,0xec));var _0xf33a=function(_0x5e4a4c,_0x1b8d7e){_0x5e4a4c=_0x5e4a4c-0x0;var _0x1afefb=_0x33af[_0x5e4a4c];return _0x1afefb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf33a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf33a('0x1'));var rp=require(_0xf33a('0x2'));var moment=require(_0xf33a('0x3'));var BPromise=require(_0xf33a('0x4'));var Mustache=require(_0xf33a('0x5'));var util=require(_0xf33a('0x6'));var path=require('path');var sox=require(_0xf33a('0x7'));var csv=require(_0xf33a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf33a('0x9'));var _=require(_0xf33a('0xa'));var squel=require(_0xf33a('0xb'));var crypto=require(_0xf33a('0xc'));var jsforce=require(_0xf33a('0xd'));var deskjs=require(_0xf33a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf33a('0xf'));var Papa=require(_0xf33a('0x10'));var Redis=require(_0xf33a('0x11'));var authService=require(_0xf33a('0x12'));var qs=require(_0xf33a('0x13'));var as=require(_0xf33a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf33a('0x15'));var utils=require(_0xf33a('0x16'));var config=require(_0xf33a('0x17'));var licenseUtil=require(_0xf33a('0x18'));var db=require(_0xf33a('0x19'))['db'];function respondWithStatusCode(_0x5959c9,_0x9f87bc){_0x9f87bc=_0x9f87bc||0xcc;return function(_0x21b80e){if(_0x21b80e){return _0x5959c9['sendStatus'](_0x9f87bc);}return _0x5959c9['status'](_0x9f87bc)[_0xf33a('0x1a')]();};}function respondWithResult(_0x1b3bf0,_0x17043){_0x17043=_0x17043||0xc8;return function(_0x153bda){if(_0x153bda){return _0x1b3bf0[_0xf33a('0x1b')](_0x17043)[_0xf33a('0x1c')](_0x153bda);}};}function respondWithFilteredResult(_0x45e311,_0x1f2b1b){return function(_0x507cb9){if(_0x507cb9){var _0x441f59=typeof _0x1f2b1b['offset']===_0xf33a('0x1d')&&typeof _0x1f2b1b[_0xf33a('0x1e')]==='undefined';var _0x37e76c=_0x507cb9[_0xf33a('0x1f')];var _0x524109=_0x441f59?0x0:_0x1f2b1b[_0xf33a('0x20')];var _0x23d9e2=_0x441f59?_0x507cb9[_0xf33a('0x1f')]:_0x1f2b1b[_0xf33a('0x20')]+_0x1f2b1b['limit'];var _0x11efa0;if(_0x23d9e2>=_0x37e76c){_0x23d9e2=_0x37e76c;_0x11efa0=0xc8;}else{_0x11efa0=0xce;}_0x45e311[_0xf33a('0x1b')](_0x11efa0);return _0x45e311[_0xf33a('0x21')](_0xf33a('0x22'),_0x524109+'-'+_0x23d9e2+'/'+_0x37e76c)[_0xf33a('0x1c')](_0x507cb9);}return null;};}function patchUpdates(_0x6cdf7b){return function(_0x19986f){try{jsonpatch[_0xf33a('0x23')](_0x19986f,_0x6cdf7b,!![]);}catch(_0x19055e){return BPromise[_0xf33a('0x24')](_0x19055e);}return _0x19986f['save']();};}function saveUpdates(_0x3854b4,_0x272e60){return function(_0x1bf9bc){if(_0x1bf9bc){return _0x1bf9bc[_0xf33a('0x25')](_0x3854b4)[_0xf33a('0x26')](function(_0x51d3fd){return _0x51d3fd;});}return null;};}function removeEntity(_0x44654c,_0x5882ba){return function(_0x492986){if(_0x492986){return _0x492986[_0xf33a('0x27')]()[_0xf33a('0x26')](function(){_0x44654c[_0xf33a('0x1b')](0xcc)[_0xf33a('0x1a')]();});}};}function handleEntityNotFound(_0x4b9801,_0x57cb1d){return function(_0x393005){if(!_0x393005){_0x4b9801['sendStatus'](0x194);}return _0x393005;};}function handleError(_0x4af24a,_0x16ef31){_0x16ef31=_0x16ef31||0x1f4;return function(_0x5f0a53){logger['error'](_0x5f0a53[_0xf33a('0x28')]);if(_0x5f0a53['name']){delete _0x5f0a53[_0xf33a('0x29')];}_0x4af24a['status'](_0x16ef31)[_0xf33a('0x2a')](_0x5f0a53);};}exports[_0xf33a('0x2b')]=function(_0x469741,_0x729fca){var _0x4552c9={},_0x3068a9={},_0x1d19ee={'count':0x0,'rows':[]};var _0x1246ff=_[_0xf33a('0x2c')](db[_0xf33a('0x2d')][_0xf33a('0x2e')],function(_0x8f8ddc){return{'name':_0x8f8ddc[_0xf33a('0x2f')],'type':_0x8f8ddc[_0xf33a('0x30')][_0xf33a('0x31')]};});_0x3068a9['model']=_[_0xf33a('0x2c')](_0x1246ff,_0xf33a('0x29'));_0x3068a9[_0xf33a('0x32')]=_[_0xf33a('0x33')](_0x469741['query']);_0x3068a9[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x3068a9[_0xf33a('0x36')],_0x3068a9[_0xf33a('0x32')]);_0x4552c9[_0xf33a('0x37')]=_[_0xf33a('0x35')](_0x3068a9['model'],qs[_0xf33a('0x38')](_0x469741[_0xf33a('0x32')][_0xf33a('0x38')]));_0x4552c9[_0xf33a('0x37')]=_0x4552c9[_0xf33a('0x37')]['length']?_0x4552c9['attributes']:_0x3068a9[_0xf33a('0x36')];if(!_0x469741['query']['hasOwnProperty']('nolimit')){_0x4552c9[_0xf33a('0x1e')]=qs[_0xf33a('0x1e')](_0x469741['query'][_0xf33a('0x1e')]);_0x4552c9['offset']=qs[_0xf33a('0x20')](_0x469741[_0xf33a('0x32')][_0xf33a('0x20')]);}_0x4552c9[_0xf33a('0x39')]=qs[_0xf33a('0x3a')](_0x469741[_0xf33a('0x32')]['sort']);_0x4552c9[_0xf33a('0x3b')]=qs[_0xf33a('0x34')](_['pick'](_0x469741[_0xf33a('0x32')],_0x3068a9[_0xf33a('0x34')]),_0x1246ff);if(_0x469741[_0xf33a('0x32')]['filter']){_0x4552c9[_0xf33a('0x3b')]=_[_0xf33a('0x3c')](_0x4552c9[_0xf33a('0x3b')],{'$or':_[_0xf33a('0x2c')](_0x1246ff,function(_0x3ec562){if(_0x3ec562[_0xf33a('0x30')]!==_0xf33a('0x3d')){var _0x128baf={};_0x128baf[_0x3ec562[_0xf33a('0x29')]]={'$like':'%'+_0x469741['query'][_0xf33a('0x3e')]+'%'};return _0x128baf;}})});}_0x4552c9=_[_0xf33a('0x3c')]({},_0x4552c9,_0x469741['options']);var _0x1e8800={'where':_0x4552c9['where']};return db['UserProfileResource'][_0xf33a('0x1f')](_0x1e8800)[_0xf33a('0x26')](function(_0x4dada1){_0x1d19ee[_0xf33a('0x1f')]=_0x4dada1;if(_0x469741[_0xf33a('0x32')][_0xf33a('0x3f')]){_0x4552c9['include']=[{'all':!![]}];}return db[_0xf33a('0x2d')][_0xf33a('0x40')](_0x4552c9);})['then'](function(_0x1e9748){_0x1d19ee[_0xf33a('0x41')]=_0x1e9748;return _0x1d19ee;})[_0xf33a('0x26')](respondWithFilteredResult(_0x729fca,_0x4552c9))[_0xf33a('0x42')](handleError(_0x729fca,null));};exports[_0xf33a('0x43')]=function(_0x5044f9,_0x45ae15){var _0x1722e5={'raw':![],'where':{'id':_0x5044f9[_0xf33a('0x44')]['id']}},_0x2325eb={};_0x2325eb[_0xf33a('0x36')]=_['keys'](db[_0xf33a('0x2d')][_0xf33a('0x2e')]);_0x2325eb[_0xf33a('0x32')]=_['keys'](_0x5044f9[_0xf33a('0x32')]);_0x2325eb[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x2325eb[_0xf33a('0x36')],_0x2325eb[_0xf33a('0x32')]);_0x1722e5[_0xf33a('0x37')]=_['intersection'](_0x2325eb[_0xf33a('0x36')],qs[_0xf33a('0x38')](_0x5044f9[_0xf33a('0x32')][_0xf33a('0x38')]));_0x1722e5[_0xf33a('0x37')]=_0x1722e5['attributes'][_0xf33a('0x45')]?_0x1722e5[_0xf33a('0x37')]:_0x2325eb[_0xf33a('0x36')];if(_0x5044f9['query'][_0xf33a('0x3f')]){_0x1722e5[_0xf33a('0x46')]=[{'all':!![]}];}_0x1722e5=_['merge']({},_0x1722e5,_0x5044f9['options']);return db[_0xf33a('0x2d')]['find'](_0x1722e5)[_0xf33a('0x26')](handleEntityNotFound(_0x45ae15,null))[_0xf33a('0x26')](respondWithResult(_0x45ae15,null))[_0xf33a('0x42')](handleError(_0x45ae15,null));};exports[_0xf33a('0x47')]=function(_0xecc82f,_0x1a98f9){return db[_0xf33a('0x2d')][_0xf33a('0x47')](_0xecc82f[_0xf33a('0x48')],{})[_0xf33a('0x26')](respondWithResult(_0x1a98f9,0xc9))[_0xf33a('0x42')](handleError(_0x1a98f9,null));};exports[_0xf33a('0x25')]=function(_0x190a2b,_0x6b79da){if(_0x190a2b[_0xf33a('0x48')]['id']){delete _0x190a2b[_0xf33a('0x48')]['id'];}return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x190a2b[_0xf33a('0x44')]['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x6b79da,null))[_0xf33a('0x26')](saveUpdates(_0x190a2b[_0xf33a('0x48')],null))[_0xf33a('0x26')](respondWithResult(_0x6b79da,null))[_0xf33a('0x42')](handleError(_0x6b79da,null));};exports[_0xf33a('0x27')]=function(_0x1b15a1,_0x3bab07){return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x1b15a1['params']['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x3bab07,null))[_0xf33a('0x26')](removeEntity(_0x3bab07,null))['catch'](handleError(_0x3bab07,null));};exports[_0xf33a('0x4a')]=function(_0xd40707,_0x36cba8){return db['UserProfileResource'][_0xf33a('0x4a')]()[_0xf33a('0x26')](respondWithResult(_0x36cba8,null))[_0xf33a('0x42')](handleError(_0x36cba8,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 0531231..4de6b6a 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 _0x4d54=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId'];(function(_0x95799c,_0x134ab6){var _0x2a3f84=function(_0x2c3053){while(--_0x2c3053){_0x95799c['push'](_0x95799c['shift']());}};_0x2a3f84(++_0x134ab6);}(_0x4d54,0x168));var _0x44d5=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4d54[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x44d5('0x0'));var util=require(_0x44d5('0x1'));var logger=require(_0x44d5('0x2'))(_0x44d5('0x3'));var moment=require(_0x44d5('0x4'));var BPromise=require('bluebird');var rp=require(_0x44d5('0x5'));var fs=require('fs');var path=require(_0x44d5('0x6'));var rimraf=require(_0x44d5('0x7'));var config=require(_0x44d5('0x8'));var attributes=require('./userProfileResource.attributes');module[_0x44d5('0x9')]=function(_0x4a3e3e,_0x10f651){return _0x4a3e3e[_0x44d5('0xa')](_0x44d5('0xb'),attributes,{'tableName':_0x44d5('0xc'),'paranoid':![],'indexes':[{'name':_0x44d5('0xd'),'fields':['resourceId',_0x44d5('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfbc1=['moment','bluebird','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','api'];(function(_0x1abc1c,_0x1e6013){var _0x2e354f=function(_0x2bc1be){while(--_0x2bc1be){_0x1abc1c['push'](_0x1abc1c['shift']());}};_0x2e354f(++_0x1e6013);}(_0xfbc1,0x108));var _0x1fbc=function(_0x1034bb,_0x4e20b3){_0x1034bb=_0x1034bb-0x0;var _0x453fdb=_0xfbc1[_0x1034bb];return _0x453fdb;};'use strict';var _=require('lodash');var util=require(_0x1fbc('0x0'));var logger=require('../../config/logger')(_0x1fbc('0x1'));var moment=require(_0x1fbc('0x2'));var BPromise=require(_0x1fbc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1fbc('0x4'));var config=require(_0x1fbc('0x5'));var attributes=require(_0x1fbc('0x6'));module[_0x1fbc('0x7')]=function(_0x3bea1b,_0x4c0893){return _0x3bea1b[_0x1fbc('0x8')](_0x1fbc('0x9'),attributes,{'tableName':_0x1fbc('0xa'),'paranoid':![],'indexes':[{'name':_0x1fbc('0xb'),'fields':[_0x1fbc('0xc'),_0x1fbc('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 7c4aa01..abab111 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 _0x9565=['lodash','bluebird','../../config/utils','../../config/environment','jayson/promise','http','then','info','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result'];(function(_0x1e54e5,_0x4b737c){var _0x16645f=function(_0x3cbeac){while(--_0x3cbeac){_0x1e54e5['push'](_0x1e54e5['shift']());}};_0x16645f(++_0x4b737c);}(_0x9565,0x180));var _0x5956=function(_0x2ce498,_0x49956e){_0x2ce498=_0x2ce498-0x0;var _0x347c71=_0x9565[_0x2ce498];return _0x347c71;};'use strict';var _=require(_0x5956('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5956('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5956('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x5956('0x3'));var jayson=require(_0x5956('0x4'));var client=jayson['client'][_0x5956('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x4485a6,_0x53204d,_0x41d0b9){return new BPromise(function(_0xd8f2b7,_0x310cdc){return client['request'](_0x4485a6,_0x41d0b9)[_0x5956('0x6')](function(_0x22c51d){logger[_0x5956('0x7')]('UserProfileResource,\x20%s,\x20%s',_0x53204d,'request\x20sent');logger['debug'](_0x5956('0x8'),_0x53204d,_0x5956('0x9'),JSON[_0x5956('0xa')](_0x22c51d));if(_0x22c51d[_0x5956('0xb')]){if(_0x22c51d['error'][_0x5956('0xc')]===0x1f4){logger[_0x5956('0xb')](_0x5956('0xd'),_0x53204d,_0x22c51d[_0x5956('0xb')][_0x5956('0xe')]);return _0x310cdc(_0x22c51d['error']['message']);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x53204d,_0x22c51d[_0x5956('0xb')][_0x5956('0xe')]);return _0xd8f2b7(_0x22c51d[_0x5956('0xb')][_0x5956('0xe')]);}else{logger[_0x5956('0x7')](_0x5956('0xd'),_0x53204d,_0x5956('0x9'));_0xd8f2b7(_0x22c51d[_0x5956('0xf')][_0x5956('0xe')]);}})['catch'](function(_0x48e169){logger[_0x5956('0xb')](_0x5956('0xd'),_0x53204d,_0x48e169);_0x310cdc(_0x48e169);});});} \ No newline at end of file +var _0xa320=['../../config/environment','jayson/promise','http','then','info','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','error','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1e8c3d,_0x378458){var _0x5e29bd=function(_0x1b86cb){while(--_0x1b86cb){_0x1e8c3d['push'](_0x1e8c3d['shift']());}};_0x5e29bd(++_0x378458);}(_0xa320,0x1df));var _0x0a32=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xa320[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x0a32('0x0'));var util=require(_0x0a32('0x1'));var moment=require(_0x0a32('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a32('0x3'));var db=require(_0x0a32('0x4'))['db'];var utils=require(_0x0a32('0x5'));var logger=require('../../config/logger')(_0x0a32('0x6'));var config=require(_0x0a32('0x7'));var jayson=require(_0x0a32('0x8'));var client=jayson['client'][_0x0a32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x681322,_0x501d13,_0x3181aa){return new BPromise(function(_0x315683,_0x185774){return client['request'](_0x681322,_0x3181aa)[_0x0a32('0xa')](function(_0x45217a){logger[_0x0a32('0xb')](_0x0a32('0xc'),_0x501d13,'request\x20sent');logger[_0x0a32('0xd')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x501d13,_0x0a32('0xe'),JSON['stringify'](_0x45217a));if(_0x45217a[_0x0a32('0xf')]){if(_0x45217a['error']['code']===0x1f4){logger['error'](_0x0a32('0xc'),_0x501d13,_0x45217a[_0x0a32('0xf')]['message']);return _0x185774(_0x45217a['error'][_0x0a32('0x10')]);}logger[_0x0a32('0xf')](_0x0a32('0xc'),_0x501d13,_0x45217a['error'][_0x0a32('0x10')]);return _0x315683(_0x45217a[_0x0a32('0xf')][_0x0a32('0x10')]);}else{logger[_0x0a32('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x501d13,'request\x20sent');_0x315683(_0x45217a[_0x0a32('0x11')][_0x0a32('0x10')]);}})['catch'](function(_0x4571d4){logger['error'](_0x0a32('0xc'),_0x501d13,_0x4571d4);_0x185774(_0x4571d4);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index f77d53e..c862f1f 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 _0xc8a4=['/:id','post','create','put','destroy','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe'];(function(_0x29f014,_0x508522){var _0x316be5=function(_0x1753a5){while(--_0x1753a5){_0x29f014['push'](_0x29f014['shift']());}};_0x316be5(++_0x508522);}(_0xc8a4,0x1d5));var _0x4c8a=function(_0x126f31,_0x5191af){_0x126f31=_0x126f31-0x0;var _0x1b1eb2=_0xc8a4[_0x126f31];return _0x1b1eb2;};'use strict';var multer=require(_0x4c8a('0x0'));var util=require('util');var path=require(_0x4c8a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4c8a('0x2')]();var fs_extra=require(_0x4c8a('0x3'));var auth=require(_0x4c8a('0x4'));var interaction=require(_0x4c8a('0x5'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0x4c8a('0x6')]('/',auth[_0x4c8a('0x7')](),controller[_0x4c8a('0x8')]);router['get'](_0x4c8a('0x9'),auth['isAuthenticated'](),controller[_0x4c8a('0xa')]);router[_0x4c8a('0x6')](_0x4c8a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x4c8a('0xc')]('/',auth[_0x4c8a('0x7')](),controller[_0x4c8a('0xd')]);router[_0x4c8a('0xe')](_0x4c8a('0xb'),auth[_0x4c8a('0x7')](),controller['update']);router['delete'](_0x4c8a('0xb'),auth[_0x4c8a('0x7')](),controller[_0x4c8a('0xf')]);module['exports']=router; \ No newline at end of file +var _0x7567=['fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','index','/describe','/:id','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x7567,0x14e));var _0x7756=function(_0x23e83f,_0x587b7e){_0x23e83f=_0x23e83f-0x0;var _0x8e4b15=_0x7567[_0x23e83f];return _0x8e4b15;};'use strict';var multer=require(_0x7756('0x0'));var util=require(_0x7756('0x1'));var path=require(_0x7756('0x2'));var timeout=require(_0x7756('0x3'));var express=require(_0x7756('0x4'));var router=express[_0x7756('0x5')]();var fs_extra=require(_0x7756('0x6'));var auth=require(_0x7756('0x7'));var interaction=require(_0x7756('0x8'));var config=require('../../config/environment');var controller=require(_0x7756('0x9'));router[_0x7756('0xa')]('/',auth[_0x7756('0xb')](),controller[_0x7756('0xc')]);router['get'](_0x7756('0xd'),auth[_0x7756('0xb')](),controller['describe']);router[_0x7756('0xa')](_0x7756('0xe'),auth[_0x7756('0xb')](),controller['show']);router[_0x7756('0xf')]('/',auth[_0x7756('0xb')](),controller['create']);router[_0x7756('0x10')](_0x7756('0xe'),auth[_0x7756('0xb')](),controller[_0x7756('0x11')]);router[_0x7756('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x7756('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index ffd31ea..07fa8e6 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 _0xbc9d=['sequelize','exports','STRING','INTEGER','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x50d623,_0x438635){var _0x4904e0=function(_0xa21bd5){while(--_0xa21bd5){_0x50d623['push'](_0x50d623['shift']());}};_0x4904e0(++_0x438635);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x28b35b,_0x446d31){_0x28b35b=_0x28b35b-0x0;var _0x331d4f=_0xbc9d[_0x28b35b];return _0x331d4f;};'use strict';var Sequelize=require(_0xdbc9('0x0'));module[_0xdbc9('0x1')]={'name':{'type':Sequelize[_0xdbc9('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xdbc9('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xdbc9('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2aba48){this[_0xdbc9('0x4')](_0xdbc9('0x5'),_0x2aba48?_0x2aba48[_0xdbc9('0x6')](''):[]);},'get':function(){return this[_0xdbc9('0x7')](_0xdbc9('0x5'))?this[_0xdbc9('0x7')]('crudPermissions')[_0xdbc9('0x8')](''):[];}}}; \ No newline at end of file +var _0x9348=['exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize'];(function(_0x404dc0,_0x347716){var _0x5e7e81=function(_0x15d90b){while(--_0x15d90b){_0x404dc0['push'](_0x404dc0['shift']());}};_0x5e7e81(++_0x347716);}(_0x9348,0x10d));var _0x8934=function(_0x4f526c,_0x184e16){_0x4f526c=_0x4f526c-0x0;var _0x5197f9=_0x9348[_0x4f526c];return _0x5197f9;};'use strict';var Sequelize=require(_0x8934('0x0'));module[_0x8934('0x1')]={'name':{'type':Sequelize[_0x8934('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x8934('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x8934('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x8934('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x8934('0x2')],'set':function(_0x5f34d7){this[_0x8934('0x5')](_0x8934('0x6'),_0x5f34d7?_0x5f34d7[_0x8934('0x7')](''):[]);},'get':function(){return this[_0x8934('0x8')](_0x8934('0x6'))?this[_0x8934('0x8')]('crudPermissions')[_0x8934('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 43dfd8d..6da780f 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 _0x7c3e=['options','catch','body','find','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../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','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','UserProfileSection','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','include','findAll','show','rawAttributes','includeAll'];(function(_0x18b9de,_0x5c3dad){var _0xe1dfe7=function(_0xc37052){while(--_0xc37052){_0x18b9de['push'](_0x18b9de['shift']());}};_0xe1dfe7(++_0x5c3dad);}(_0x7c3e,0x17e));var _0xe7c3=function(_0x5c2cd5,_0x1c2fbb){_0x5c2cd5=_0x5c2cd5-0x0;var _0x5180e9=_0x7c3e[_0x5c2cd5];return _0x5180e9;};'use strict';var emlformat=require(_0xe7c3('0x0'));var rimraf=require(_0xe7c3('0x1'));var zipdir=require(_0xe7c3('0x2'));var jsonpatch=require(_0xe7c3('0x3'));var rp=require(_0xe7c3('0x4'));var moment=require(_0xe7c3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe7c3('0x6'));var util=require('util');var path=require(_0xe7c3('0x7'));var sox=require(_0xe7c3('0x8'));var csv=require(_0xe7c3('0x9'));var ejs=require(_0xe7c3('0xa'));var fs=require('fs');var fs_extra=require(_0xe7c3('0xb'));var _=require(_0xe7c3('0xc'));var squel=require(_0xe7c3('0xd'));var crypto=require(_0xe7c3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe7c3('0x9'));var querystring=require(_0xe7c3('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7c3('0x10'));var qs=require(_0xe7c3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe7c3('0x12'))(_0xe7c3('0x13'));var utils=require(_0xe7c3('0x14'));var config=require(_0xe7c3('0x15'));var licenseUtil=require(_0xe7c3('0x16'));var db=require(_0xe7c3('0x17'))['db'];function respondWithStatusCode(_0x4edbc8,_0x4223b0){_0x4223b0=_0x4223b0||0xcc;return function(_0x883f5c){if(_0x883f5c){return _0x4edbc8[_0xe7c3('0x18')](_0x4223b0);}return _0x4edbc8['status'](_0x4223b0)[_0xe7c3('0x19')]();};}function respondWithResult(_0x4f773f,_0xaab05e){_0xaab05e=_0xaab05e||0xc8;return function(_0x47d7b9){if(_0x47d7b9){return _0x4f773f[_0xe7c3('0x1a')](_0xaab05e)[_0xe7c3('0x1b')](_0x47d7b9);}};}function respondWithFilteredResult(_0x1a8a3c,_0x7658f3){return function(_0x436c15){if(_0x436c15){var _0x45697e=typeof _0x7658f3[_0xe7c3('0x1c')]===_0xe7c3('0x1d')&&typeof _0x7658f3[_0xe7c3('0x1e')]===_0xe7c3('0x1d');var _0x1b34d2=_0x436c15[_0xe7c3('0x1f')];var _0x5ab320=_0x45697e?0x0:_0x7658f3[_0xe7c3('0x1c')];var _0x1e75e3=_0x45697e?_0x436c15[_0xe7c3('0x1f')]:_0x7658f3['offset']+_0x7658f3[_0xe7c3('0x1e')];var _0x2638df;if(_0x1e75e3>=_0x1b34d2){_0x1e75e3=_0x1b34d2;_0x2638df=0xc8;}else{_0x2638df=0xce;}_0x1a8a3c[_0xe7c3('0x1a')](_0x2638df);return _0x1a8a3c['set'](_0xe7c3('0x20'),_0x5ab320+'-'+_0x1e75e3+'/'+_0x1b34d2)['json'](_0x436c15);}return null;};}function patchUpdates(_0x18ba33){return function(_0x575076){try{jsonpatch[_0xe7c3('0x21')](_0x575076,_0x18ba33,!![]);}catch(_0x48df25){return BPromise[_0xe7c3('0x22')](_0x48df25);}return _0x575076[_0xe7c3('0x23')]();};}function saveUpdates(_0x382aec,_0x1a53bb){return function(_0x2b2c9e){if(_0x2b2c9e){return _0x2b2c9e[_0xe7c3('0x24')](_0x382aec)[_0xe7c3('0x25')](function(_0x5e50cd){return _0x5e50cd;});}return null;};}function removeEntity(_0x44ee46,_0x187662){return function(_0x2ee6e6){if(_0x2ee6e6){return _0x2ee6e6['destroy']()['then'](function(){_0x44ee46[_0xe7c3('0x1a')](0xcc)[_0xe7c3('0x19')]();});}};}function handleEntityNotFound(_0x299c9c,_0x5db5ee){return function(_0x256889){if(!_0x256889){_0x299c9c[_0xe7c3('0x18')](0x194);}return _0x256889;};}function handleError(_0x2b67ef,_0x106e95){_0x106e95=_0x106e95||0x1f4;return function(_0x9e0cc0){logger['error'](_0x9e0cc0[_0xe7c3('0x26')]);if(_0x9e0cc0['name']){delete _0x9e0cc0[_0xe7c3('0x27')];}_0x2b67ef[_0xe7c3('0x1a')](_0x106e95)[_0xe7c3('0x28')](_0x9e0cc0);};}exports[_0xe7c3('0x29')]=function(_0x41a775,_0x2a26a1){var _0x291ef0={},_0x5726dc={},_0x2c353c={'count':0x0,'rows':[]};var _0xc703ec=_[_0xe7c3('0x2a')](db[_0xe7c3('0x2b')]['rawAttributes'],function(_0x4d7e4a){return{'name':_0x4d7e4a[_0xe7c3('0x2c')],'type':_0x4d7e4a[_0xe7c3('0x2d')][_0xe7c3('0x2e')]};});_0x5726dc[_0xe7c3('0x2f')]=_[_0xe7c3('0x2a')](_0xc703ec,_0xe7c3('0x27'));_0x5726dc[_0xe7c3('0x30')]=_[_0xe7c3('0x31')](_0x41a775[_0xe7c3('0x30')]);_0x5726dc[_0xe7c3('0x32')]=_['intersection'](_0x5726dc[_0xe7c3('0x2f')],_0x5726dc[_0xe7c3('0x30')]);_0x291ef0[_0xe7c3('0x33')]=_[_0xe7c3('0x34')](_0x5726dc['model'],qs[_0xe7c3('0x35')](_0x41a775[_0xe7c3('0x30')]['fields']));_0x291ef0['attributes']=_0x291ef0[_0xe7c3('0x33')][_0xe7c3('0x36')]?_0x291ef0[_0xe7c3('0x33')]:_0x5726dc[_0xe7c3('0x2f')];if(!_0x41a775[_0xe7c3('0x30')][_0xe7c3('0x37')]('nolimit')){_0x291ef0[_0xe7c3('0x1e')]=qs[_0xe7c3('0x1e')](_0x41a775['query'][_0xe7c3('0x1e')]);_0x291ef0['offset']=qs['offset'](_0x41a775[_0xe7c3('0x30')][_0xe7c3('0x1c')]);}_0x291ef0[_0xe7c3('0x38')]=qs[_0xe7c3('0x39')](_0x41a775[_0xe7c3('0x30')]['sort']);_0x291ef0['where']=qs['filters'](_[_0xe7c3('0x3a')](_0x41a775[_0xe7c3('0x30')],_0x5726dc[_0xe7c3('0x32')]),_0xc703ec);if(_0x41a775[_0xe7c3('0x30')][_0xe7c3('0x3b')]){_0x291ef0['where']=_[_0xe7c3('0x3c')](_0x291ef0[_0xe7c3('0x3d')],{'$or':_['map'](_0xc703ec,function(_0x521775){if(_0x521775[_0xe7c3('0x2d')]!==_0xe7c3('0x3e')){var _0x11574e={};_0x11574e[_0x521775[_0xe7c3('0x27')]]={'$like':'%'+_0x41a775[_0xe7c3('0x30')][_0xe7c3('0x3b')]+'%'};return _0x11574e;}})});}_0x291ef0=_['merge']({},_0x291ef0,_0x41a775['options']);var _0x48a111={'where':_0x291ef0['where']};return db[_0xe7c3('0x2b')][_0xe7c3('0x1f')](_0x48a111)[_0xe7c3('0x25')](function(_0x5d69c7){_0x2c353c[_0xe7c3('0x1f')]=_0x5d69c7;if(_0x41a775[_0xe7c3('0x30')]['includeAll']){_0x291ef0[_0xe7c3('0x3f')]=[{'all':!![]}];}return db[_0xe7c3('0x2b')][_0xe7c3('0x40')](_0x291ef0);})[_0xe7c3('0x25')](function(_0x21790d){_0x2c353c['rows']=_0x21790d;return _0x2c353c;})['then'](respondWithFilteredResult(_0x2a26a1,_0x291ef0))['catch'](handleError(_0x2a26a1,null));};exports[_0xe7c3('0x41')]=function(_0xeb09c3,_0x33f035){var _0x5d47f7={'raw':![],'where':{'id':_0xeb09c3['params']['id']}},_0x1892c4={};_0x1892c4['model']=_[_0xe7c3('0x31')](db[_0xe7c3('0x2b')][_0xe7c3('0x42')]);_0x1892c4['query']=_[_0xe7c3('0x31')](_0xeb09c3['query']);_0x1892c4[_0xe7c3('0x32')]=_['intersection'](_0x1892c4[_0xe7c3('0x2f')],_0x1892c4[_0xe7c3('0x30')]);_0x5d47f7['attributes']=_[_0xe7c3('0x34')](_0x1892c4['model'],qs[_0xe7c3('0x35')](_0xeb09c3[_0xe7c3('0x30')][_0xe7c3('0x35')]));_0x5d47f7[_0xe7c3('0x33')]=_0x5d47f7[_0xe7c3('0x33')][_0xe7c3('0x36')]?_0x5d47f7[_0xe7c3('0x33')]:_0x1892c4[_0xe7c3('0x2f')];if(_0xeb09c3[_0xe7c3('0x30')][_0xe7c3('0x43')]){_0x5d47f7[_0xe7c3('0x3f')]=[{'all':!![]}];}_0x5d47f7=_[_0xe7c3('0x3c')]({},_0x5d47f7,_0xeb09c3[_0xe7c3('0x44')]);return db[_0xe7c3('0x2b')]['find'](_0x5d47f7)[_0xe7c3('0x25')](handleEntityNotFound(_0x33f035,null))[_0xe7c3('0x25')](respondWithResult(_0x33f035,null))[_0xe7c3('0x45')](handleError(_0x33f035,null));};exports['create']=function(_0x279035,_0x33cb73){return db['UserProfileSection']['create'](_0x279035[_0xe7c3('0x46')],{})[_0xe7c3('0x25')](respondWithResult(_0x33cb73,0xc9))[_0xe7c3('0x45')](handleError(_0x33cb73,null));};exports[_0xe7c3('0x24')]=function(_0x5ca56e,_0x5068ee){if(_0x5ca56e[_0xe7c3('0x46')]['id']){delete _0x5ca56e['body']['id'];}return db[_0xe7c3('0x2b')][_0xe7c3('0x47')]({'where':{'id':_0x5ca56e[_0xe7c3('0x48')]['id']}})['then'](handleEntityNotFound(_0x5068ee,null))[_0xe7c3('0x25')](saveUpdates(_0x5ca56e[_0xe7c3('0x46')],null))[_0xe7c3('0x25')](respondWithResult(_0x5068ee,null))[_0xe7c3('0x45')](handleError(_0x5068ee,null));};exports[_0xe7c3('0x49')]=function(_0x183333,_0x8955d4){return db['UserProfileSection'][_0xe7c3('0x47')]({'where':{'id':_0x183333[_0xe7c3('0x48')]['id']}})['then'](handleEntityNotFound(_0x8955d4,null))[_0xe7c3('0x25')](removeEntity(_0x8955d4,null))[_0xe7c3('0x45')](handleError(_0x8955d4,null));};exports[_0xe7c3('0x4a')]=function(_0x150080,_0x502651){return db[_0xe7c3('0x2b')][_0xe7c3('0x4a')]()[_0xe7c3('0x25')](respondWithResult(_0x502651,null))[_0xe7c3('0x45')](handleError(_0x502651,null));}; \ No newline at end of file +var _0xdc18=['catch','show','params','fields','length','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','sendStatus','error','stack','send','index','UserProfileSection','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows'];(function(_0x58a30e,_0x4d4cae){var _0x59840b=function(_0x8c1b47){while(--_0x8c1b47){_0x58a30e['push'](_0x58a30e['shift']());}};_0x59840b(++_0x4d4cae);}(_0xdc18,0x139));var _0x8dc1=function(_0xcb32c0,_0x45d5c1){_0xcb32c0=_0xcb32c0-0x0;var _0x3c757b=_0xdc18[_0xcb32c0];return _0x3c757b;};'use strict';var emlformat=require(_0x8dc1('0x0'));var rimraf=require(_0x8dc1('0x1'));var zipdir=require(_0x8dc1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8dc1('0x3'));var moment=require(_0x8dc1('0x4'));var BPromise=require(_0x8dc1('0x5'));var Mustache=require('mustache');var util=require(_0x8dc1('0x6'));var path=require('path');var sox=require(_0x8dc1('0x7'));var csv=require(_0x8dc1('0x8'));var ejs=require(_0x8dc1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8dc1('0xa'));var squel=require(_0x8dc1('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8dc1('0xc'));var Papa=require(_0x8dc1('0xd'));var Redis=require(_0x8dc1('0xe'));var authService=require(_0x8dc1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8dc1('0x10'));var hardwareService=require(_0x8dc1('0x11'));var logger=require(_0x8dc1('0x12'))(_0x8dc1('0x13'));var utils=require(_0x8dc1('0x14'));var config=require(_0x8dc1('0x15'));var licenseUtil=require(_0x8dc1('0x16'));var db=require(_0x8dc1('0x17'))['db'];function respondWithStatusCode(_0x297a5c,_0x33a75c){_0x33a75c=_0x33a75c||0xcc;return function(_0x279275){if(_0x279275){return _0x297a5c['sendStatus'](_0x33a75c);}return _0x297a5c[_0x8dc1('0x18')](_0x33a75c)[_0x8dc1('0x19')]();};}function respondWithResult(_0x273cf2,_0x4fe3d1){_0x4fe3d1=_0x4fe3d1||0xc8;return function(_0x45deb0){if(_0x45deb0){return _0x273cf2[_0x8dc1('0x18')](_0x4fe3d1)[_0x8dc1('0x1a')](_0x45deb0);}};}function respondWithFilteredResult(_0x25390d,_0x2dd7c2){return function(_0x5e18ce){if(_0x5e18ce){var _0x1907fd=typeof _0x2dd7c2[_0x8dc1('0x1b')]===_0x8dc1('0x1c')&&typeof _0x2dd7c2['limit']===_0x8dc1('0x1c');var _0x22e8d7=_0x5e18ce[_0x8dc1('0x1d')];var _0x57a14d=_0x1907fd?0x0:_0x2dd7c2[_0x8dc1('0x1b')];var _0x3c0e65=_0x1907fd?_0x5e18ce[_0x8dc1('0x1d')]:_0x2dd7c2[_0x8dc1('0x1b')]+_0x2dd7c2[_0x8dc1('0x1e')];var _0xfb4d9;if(_0x3c0e65>=_0x22e8d7){_0x3c0e65=_0x22e8d7;_0xfb4d9=0xc8;}else{_0xfb4d9=0xce;}_0x25390d[_0x8dc1('0x18')](_0xfb4d9);return _0x25390d[_0x8dc1('0x1f')](_0x8dc1('0x20'),_0x57a14d+'-'+_0x3c0e65+'/'+_0x22e8d7)[_0x8dc1('0x1a')](_0x5e18ce);}return null;};}function patchUpdates(_0x376cc7){return function(_0x1e1317){try{jsonpatch['apply'](_0x1e1317,_0x376cc7,!![]);}catch(_0x7b5c24){return BPromise['reject'](_0x7b5c24);}return _0x1e1317[_0x8dc1('0x21')]();};}function saveUpdates(_0x2852b6,_0x2240ef){return function(_0x33f28c){if(_0x33f28c){return _0x33f28c[_0x8dc1('0x22')](_0x2852b6)[_0x8dc1('0x23')](function(_0x4a9d02){return _0x4a9d02;});}return null;};}function removeEntity(_0x1544c5,_0x4164f8){return function(_0x2432b1){if(_0x2432b1){return _0x2432b1[_0x8dc1('0x24')]()['then'](function(){_0x1544c5[_0x8dc1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x119fe4,_0xe7c997){return function(_0x4f71e6){if(!_0x4f71e6){_0x119fe4[_0x8dc1('0x25')](0x194);}return _0x4f71e6;};}function handleError(_0x27effe,_0x3765c0){_0x3765c0=_0x3765c0||0x1f4;return function(_0x4cafd2){logger[_0x8dc1('0x26')](_0x4cafd2[_0x8dc1('0x27')]);if(_0x4cafd2['name']){delete _0x4cafd2['name'];}_0x27effe['status'](_0x3765c0)[_0x8dc1('0x28')](_0x4cafd2);};}exports[_0x8dc1('0x29')]=function(_0x3147ab,_0x180d86){var _0x1c47ea={},_0xaac54c={},_0x400433={'count':0x0,'rows':[]};var _0x2ea40a=_['map'](db[_0x8dc1('0x2a')][_0x8dc1('0x2b')],function(_0x507e07){return{'name':_0x507e07[_0x8dc1('0x2c')],'type':_0x507e07[_0x8dc1('0x2d')]['key']};});_0xaac54c['model']=_['map'](_0x2ea40a,_0x8dc1('0x2e'));_0xaac54c[_0x8dc1('0x2f')]=_[_0x8dc1('0x30')](_0x3147ab['query']);_0xaac54c[_0x8dc1('0x31')]=_[_0x8dc1('0x32')](_0xaac54c[_0x8dc1('0x33')],_0xaac54c['query']);_0x1c47ea['attributes']=_['intersection'](_0xaac54c[_0x8dc1('0x33')],qs['fields'](_0x3147ab[_0x8dc1('0x2f')]['fields']));_0x1c47ea[_0x8dc1('0x34')]=_0x1c47ea['attributes']['length']?_0x1c47ea[_0x8dc1('0x34')]:_0xaac54c['model'];if(!_0x3147ab['query'][_0x8dc1('0x35')](_0x8dc1('0x36'))){_0x1c47ea[_0x8dc1('0x1e')]=qs[_0x8dc1('0x1e')](_0x3147ab['query'][_0x8dc1('0x1e')]);_0x1c47ea[_0x8dc1('0x1b')]=qs['offset'](_0x3147ab[_0x8dc1('0x2f')][_0x8dc1('0x1b')]);}_0x1c47ea['order']=qs[_0x8dc1('0x37')](_0x3147ab[_0x8dc1('0x2f')][_0x8dc1('0x37')]);_0x1c47ea[_0x8dc1('0x38')]=qs[_0x8dc1('0x31')](_[_0x8dc1('0x39')](_0x3147ab[_0x8dc1('0x2f')],_0xaac54c[_0x8dc1('0x31')]),_0x2ea40a);if(_0x3147ab[_0x8dc1('0x2f')]['filter']){_0x1c47ea[_0x8dc1('0x38')]=_[_0x8dc1('0x3a')](_0x1c47ea[_0x8dc1('0x38')],{'$or':_[_0x8dc1('0x3b')](_0x2ea40a,function(_0x2beeb4){if(_0x2beeb4['type']!==_0x8dc1('0x3c')){var _0xe9a328={};_0xe9a328[_0x2beeb4[_0x8dc1('0x2e')]]={'$like':'%'+_0x3147ab['query'][_0x8dc1('0x3d')]+'%'};return _0xe9a328;}})});}_0x1c47ea=_[_0x8dc1('0x3a')]({},_0x1c47ea,_0x3147ab[_0x8dc1('0x3e')]);var _0x444f8d={'where':_0x1c47ea[_0x8dc1('0x38')]};return db[_0x8dc1('0x2a')][_0x8dc1('0x1d')](_0x444f8d)[_0x8dc1('0x23')](function(_0x4c34dc){_0x400433[_0x8dc1('0x1d')]=_0x4c34dc;if(_0x3147ab[_0x8dc1('0x2f')][_0x8dc1('0x3f')]){_0x1c47ea[_0x8dc1('0x40')]=[{'all':!![]}];}return db[_0x8dc1('0x2a')][_0x8dc1('0x41')](_0x1c47ea);})[_0x8dc1('0x23')](function(_0x40367b){_0x400433[_0x8dc1('0x42')]=_0x40367b;return _0x400433;})[_0x8dc1('0x23')](respondWithFilteredResult(_0x180d86,_0x1c47ea))[_0x8dc1('0x43')](handleError(_0x180d86,null));};exports[_0x8dc1('0x44')]=function(_0x486635,_0x434db0){var _0x147168={'raw':![],'where':{'id':_0x486635[_0x8dc1('0x45')]['id']}},_0x479c8e={};_0x479c8e[_0x8dc1('0x33')]=_[_0x8dc1('0x30')](db[_0x8dc1('0x2a')]['rawAttributes']);_0x479c8e['query']=_[_0x8dc1('0x30')](_0x486635[_0x8dc1('0x2f')]);_0x479c8e['filters']=_['intersection'](_0x479c8e[_0x8dc1('0x33')],_0x479c8e['query']);_0x147168[_0x8dc1('0x34')]=_['intersection'](_0x479c8e[_0x8dc1('0x33')],qs[_0x8dc1('0x46')](_0x486635['query'][_0x8dc1('0x46')]));_0x147168[_0x8dc1('0x34')]=_0x147168[_0x8dc1('0x34')][_0x8dc1('0x47')]?_0x147168[_0x8dc1('0x34')]:_0x479c8e[_0x8dc1('0x33')];if(_0x486635[_0x8dc1('0x2f')]['includeAll']){_0x147168[_0x8dc1('0x40')]=[{'all':!![]}];}_0x147168=_['merge']({},_0x147168,_0x486635['options']);return db[_0x8dc1('0x2a')]['find'](_0x147168)[_0x8dc1('0x23')](handleEntityNotFound(_0x434db0,null))[_0x8dc1('0x23')](respondWithResult(_0x434db0,null))[_0x8dc1('0x43')](handleError(_0x434db0,null));};exports[_0x8dc1('0x48')]=function(_0x1a3ab4,_0x2fe052){return db[_0x8dc1('0x2a')][_0x8dc1('0x48')](_0x1a3ab4['body'],{})[_0x8dc1('0x23')](respondWithResult(_0x2fe052,0xc9))[_0x8dc1('0x43')](handleError(_0x2fe052,null));};exports[_0x8dc1('0x22')]=function(_0x43c357,_0x29c12c){if(_0x43c357[_0x8dc1('0x49')]['id']){delete _0x43c357['body']['id'];}return db['UserProfileSection'][_0x8dc1('0x4a')]({'where':{'id':_0x43c357[_0x8dc1('0x45')]['id']}})[_0x8dc1('0x23')](handleEntityNotFound(_0x29c12c,null))['then'](saveUpdates(_0x43c357[_0x8dc1('0x49')],null))[_0x8dc1('0x23')](respondWithResult(_0x29c12c,null))[_0x8dc1('0x43')](handleError(_0x29c12c,null));};exports[_0x8dc1('0x24')]=function(_0x7712dd,_0x466a3d){return db['UserProfileSection'][_0x8dc1('0x4a')]({'where':{'id':_0x7712dd[_0x8dc1('0x45')]['id']}})[_0x8dc1('0x23')](handleEntityNotFound(_0x466a3d,null))[_0x8dc1('0x23')](removeEntity(_0x466a3d,null))[_0x8dc1('0x43')](handleError(_0x466a3d,null));};exports[_0x8dc1('0x4b')]=function(_0xf022f4,_0x36c9ec){return db[_0x8dc1('0x2a')][_0x8dc1('0x4b')]()[_0x8dc1('0x23')](respondWithResult(_0x36c9ec,null))[_0x8dc1('0x43')](handleError(_0x36c9ec,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 3d42123..809e7a0 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 _0xe1d4=['UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe1d4,0x1ae));var _0x4e1d=function(_0x172210,_0xb6b4d6){_0x172210=_0x172210-0x0;var _0x42a6f6=_0xe1d4[_0x172210];return _0x42a6f6;};'use strict';var _=require(_0x4e1d('0x0'));var util=require(_0x4e1d('0x1'));var logger=require(_0x4e1d('0x2'))(_0x4e1d('0x3'));var moment=require('moment');var BPromise=require(_0x4e1d('0x4'));var rp=require(_0x4e1d('0x5'));var fs=require('fs');var path=require(_0x4e1d('0x6'));var rimraf=require(_0x4e1d('0x7'));var config=require(_0x4e1d('0x8'));var attributes=require(_0x4e1d('0x9'));module[_0x4e1d('0xa')]=function(_0x5b9686,_0x200a39){return _0x5b9686[_0x4e1d('0xb')](_0x4e1d('0xc'),attributes,{'tableName':_0x4e1d('0xd'),'paranoid':![],'indexes':[{'name':_0x4e1d('0xe'),'fields':[_0x4e1d('0xf'),_0x4e1d('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x74f4=['userProfileId','util','api','moment','bluebird','../../config/environment','exports','define','UserProfileSection','compositeIndex','sectionId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x74f4,0x114));var _0x474f=function(_0x323684,_0x25494b){_0x323684=_0x323684-0x0;var _0x32dd90=_0x74f4[_0x323684];return _0x32dd90;};'use strict';var _=require('lodash');var util=require(_0x474f('0x0'));var logger=require('../../config/logger')(_0x474f('0x1'));var moment=require(_0x474f('0x2'));var BPromise=require(_0x474f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x474f('0x4'));var attributes=require('./userProfileSection.attributes');module[_0x474f('0x5')]=function(_0x294759,_0x51f7b7){return _0x294759[_0x474f('0x6')](_0x474f('0x7'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x474f('0x8'),'fields':[_0x474f('0x9'),_0x474f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 4771a32..29a5392 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 _0xa026=['../../config/logger','rpc','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x353979,_0x377a80){var _0x4f15a4=function(_0x25d482){while(--_0x25d482){_0x353979['push'](_0x353979['shift']());}};_0x4f15a4(++_0x377a80);}(_0xa026,0x1f4));var _0x6a02=function(_0x37e775,_0x3bb1c6){_0x37e775=_0x37e775-0x0;var _0x3c1ab5=_0xa026[_0x37e775];return _0x3c1ab5;};'use strict';var _=require('lodash');var util=require(_0x6a02('0x0'));var moment=require(_0x6a02('0x1'));var BPromise=require('bluebird');var rs=require(_0x6a02('0x2'));var fs=require('fs');var Redis=require(_0x6a02('0x3'));var db=require(_0x6a02('0x4'))['db'];var utils=require(_0x6a02('0x5'));var logger=require(_0x6a02('0x6'))(_0x6a02('0x7'));var config=require('../../config/environment');var jayson=require(_0x6a02('0x8'));var client=jayson[_0x6a02('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e9af6,_0x1565c6,_0x348909){return new BPromise(function(_0x1a6f0a,_0x3ffcf5){return client[_0x6a02('0xa')](_0x1e9af6,_0x348909)[_0x6a02('0xb')](function(_0x5137ef){logger[_0x6a02('0xc')](_0x6a02('0xd'),_0x1565c6,_0x6a02('0xe'));logger[_0x6a02('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x1565c6,_0x6a02('0xe'),JSON[_0x6a02('0x10')](_0x5137ef));if(_0x5137ef[_0x6a02('0x11')]){if(_0x5137ef[_0x6a02('0x11')][_0x6a02('0x12')]===0x1f4){logger[_0x6a02('0x11')](_0x6a02('0xd'),_0x1565c6,_0x5137ef[_0x6a02('0x11')][_0x6a02('0x13')]);return _0x3ffcf5(_0x5137ef[_0x6a02('0x11')][_0x6a02('0x13')]);}logger[_0x6a02('0x11')](_0x6a02('0xd'),_0x1565c6,_0x5137ef[_0x6a02('0x11')][_0x6a02('0x13')]);return _0x1a6f0a(_0x5137ef['error'][_0x6a02('0x13')]);}else{logger[_0x6a02('0xc')](_0x6a02('0xd'),_0x1565c6,'request\x20sent');_0x1a6f0a(_0x5137ef[_0x6a02('0x14')][_0x6a02('0x13')]);}})[_0x6a02('0x15')](function(_0x472d30){logger[_0x6a02('0x11')](_0x6a02('0xd'),_0x1565c6,_0x472d30);_0x3ffcf5(_0x472d30);});});} \ No newline at end of file +var _0x0db5=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x8e383e,_0x40bf9a){var _0x196dca=function(_0x3297c5){while(--_0x3297c5){_0x8e383e['push'](_0x8e383e['shift']());}};_0x196dca(++_0x40bf9a);}(_0x0db5,0xae));var _0x50db=function(_0x560b04,_0x4ee106){_0x560b04=_0x560b04-0x0;var _0x12c7f8=_0x0db5[_0x560b04];return _0x12c7f8;};'use strict';var _=require(_0x50db('0x0'));var util=require(_0x50db('0x1'));var moment=require('moment');var BPromise=require(_0x50db('0x2'));var rs=require(_0x50db('0x3'));var fs=require('fs');var Redis=require(_0x50db('0x4'));var db=require(_0x50db('0x5'))['db'];var utils=require(_0x50db('0x6'));var logger=require(_0x50db('0x7'))(_0x50db('0x8'));var config=require(_0x50db('0x9'));var jayson=require(_0x50db('0xa'));var client=jayson[_0x50db('0xb')][_0x50db('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xbf807,_0x2aab96,_0x4362c8){return new BPromise(function(_0x3faa98,_0x132ee3){return client[_0x50db('0xd')](_0xbf807,_0x4362c8)['then'](function(_0x27c85c){logger[_0x50db('0xe')](_0x50db('0xf'),_0x2aab96,_0x50db('0x10'));logger[_0x50db('0x11')](_0x50db('0x12'),_0x2aab96,_0x50db('0x10'),JSON[_0x50db('0x13')](_0x27c85c));if(_0x27c85c[_0x50db('0x14')]){if(_0x27c85c[_0x50db('0x14')][_0x50db('0x15')]===0x1f4){logger['error'](_0x50db('0xf'),_0x2aab96,_0x27c85c[_0x50db('0x14')]['message']);return _0x132ee3(_0x27c85c['error'][_0x50db('0x16')]);}logger[_0x50db('0x14')](_0x50db('0xf'),_0x2aab96,_0x27c85c[_0x50db('0x14')][_0x50db('0x16')]);return _0x3faa98(_0x27c85c[_0x50db('0x14')]['message']);}else{logger[_0x50db('0xe')](_0x50db('0xf'),_0x2aab96,_0x50db('0x10'));_0x3faa98(_0x27c85c[_0x50db('0x17')][_0x50db('0x16')]);}})[_0x50db('0x18')](function(_0x5392ad){logger[_0x50db('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x2aab96,_0x5392ad);_0x132ee3(_0x5392ad);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 764e430..8ab1a69 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x43f084,_0xb48804){var _0x2a6dde=function(_0x1fab7f){while(--_0x1fab7f){_0x43f084['push'](_0x43f084['shift']());}};_0x2a6dde(++_0xb48804);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x171de5,_0x260fd1){var _0x1c2d68=function(_0x111adc){while(--_0x111adc){_0x171de5['push'](_0x171de5['shift']());}};_0x1c2d68(++_0x260fd1);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 32fbf7e..a384685 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 _0xbddb=['sequelize','exports','INTEGER'];(function(_0x45082a,_0x3e3243){var _0x26d37f=function(_0xb73e64){while(--_0xb73e64){_0x45082a['push'](_0x45082a['shift']());}};_0x26d37f(++_0x3e3243);}(_0xbddb,0x1bf));var _0xbbdd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xbddb[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xbbdd('0x0'));module[_0xbbdd('0x1')]={'penalty':{'type':Sequelize[_0xbbdd('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb70d=['sequelize','exports','INTEGER'];(function(_0x16051a,_0x5e4326){var _0x35d20d=function(_0x52b02e){while(--_0x52b02e){_0x16051a['push'](_0x16051a['shift']());}};_0x35d20d(++_0x5e4326);}(_0xb70d,0xc6));var _0xdb70=function(_0x24d6a8,_0x5aa3a7){_0x24d6a8=_0x24d6a8-0x0;var _0x4255dc=_0xb70d[_0x24d6a8];return _0x4255dc;};'use strict';var Sequelize=require(_0xdb70('0x0'));module[_0xdb70('0x1')]={'penalty':{'type':Sequelize[_0xdb70('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 39c17e1..dda54b5 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash','util'];(function(_0x160395,_0x57d47b){var _0x4d6e20=function(_0x829570){while(--_0x829570){_0x160395['push'](_0x160395['shift']());}};_0x4d6e20(++_0x57d47b);}(_0x7a54,0x106));var _0x47a5=function(_0x5abff8,_0x234cb5){_0x5abff8=_0x5abff8-0x0;var _0x38fe2b=_0x7a54[_0x5abff8];return _0x38fe2b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7046=['path','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x50c7d6,_0x43aaed){var _0x4e1b11=function(_0x247a15){while(--_0x247a15){_0x50c7d6['push'](_0x50c7d6['shift']());}};_0x4e1b11(++_0x43aaed);}(_0x7046,0x144));var _0x6704=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7046[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var logger=require(_0x6704('0x2'))(_0x6704('0x3'));var moment=require('moment');var BPromise=require(_0x6704('0x4'));var rp=require(_0x6704('0x5'));var fs=require('fs');var path=require(_0x6704('0x6'));var rimraf=require('rimraf');var config=require(_0x6704('0x7'));var attributes=require(_0x6704('0x8'));module[_0x6704('0x9')]=function(_0x626a14,_0x2917be){return _0x626a14['define'](_0x6704('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index f1ec843..a15a625 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 _0xf86b=['UserSmsQueue,\x20%s,\x20%s','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/environment','client','http','request','then','info'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0xf86b,0x14c));var _0xbf86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf86b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xbf86('0x0'));var moment=require('moment');var BPromise=require(_0xbf86('0x1'));var rs=require(_0xbf86('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf86('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbf86('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xbf86('0x5')][_0xbf86('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x55310a,_0xe5f4a1,_0x42d655){return new BPromise(function(_0x5143e1,_0x104e55){return client[_0xbf86('0x7')](_0x55310a,_0x42d655)[_0xbf86('0x8')](function(_0x1f347b){logger[_0xbf86('0x9')](_0xbf86('0xa'),_0xe5f4a1,'request\x20sent');logger['debug'](_0xbf86('0xb'),_0xe5f4a1,_0xbf86('0xc'),JSON[_0xbf86('0xd')](_0x1f347b));if(_0x1f347b[_0xbf86('0xe')]){if(_0x1f347b[_0xbf86('0xe')][_0xbf86('0xf')]===0x1f4){logger[_0xbf86('0xe')](_0xbf86('0xa'),_0xe5f4a1,_0x1f347b[_0xbf86('0xe')]['message']);return _0x104e55(_0x1f347b[_0xbf86('0xe')]['message']);}logger[_0xbf86('0xe')](_0xbf86('0xa'),_0xe5f4a1,_0x1f347b[_0xbf86('0xe')][_0xbf86('0x10')]);return _0x5143e1(_0x1f347b[_0xbf86('0xe')][_0xbf86('0x10')]);}else{logger['info'](_0xbf86('0xa'),_0xe5f4a1,_0xbf86('0xc'));_0x5143e1(_0x1f347b[_0xbf86('0x11')][_0xbf86('0x10')]);}})[_0xbf86('0x12')](function(_0x1bb2a0){logger['error'](_0xbf86('0xa'),_0xe5f4a1,_0x1bb2a0);_0x104e55(_0x1bb2a0);});});} \ No newline at end of file +var _0xee1c=['http','request','then','info','request\x20sent','debug','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x41780b,_0x19b998){var _0x38c281=function(_0x1b07cc){while(--_0x1b07cc){_0x41780b['push'](_0x41780b['shift']());}};_0x38c281(++_0x19b998);}(_0xee1c,0x1da));var _0xcee1=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0xee1c[_0x3d4876];return _0x58ca9d;};'use strict';var _=require('lodash');var util=require(_0xcee1('0x0'));var moment=require(_0xcee1('0x1'));var BPromise=require('bluebird');var rs=require(_0xcee1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcee1('0x3'))['db'];var utils=require(_0xcee1('0x4'));var logger=require(_0xcee1('0x5'))('rpc');var config=require(_0xcee1('0x6'));var jayson=require(_0xcee1('0x7'));var client=jayson[_0xcee1('0x8')][_0xcee1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x351356,_0x31415a,_0x46a722){return new BPromise(function(_0x386994,_0x5a557f){return client[_0xcee1('0xa')](_0x351356,_0x46a722)[_0xcee1('0xb')](function(_0x1af5ac){logger[_0xcee1('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x31415a,_0xcee1('0xd'));logger[_0xcee1('0xe')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x31415a,_0xcee1('0xd'),JSON['stringify'](_0x1af5ac));if(_0x1af5ac[_0xcee1('0xf')]){if(_0x1af5ac[_0xcee1('0xf')][_0xcee1('0x10')]===0x1f4){logger[_0xcee1('0xf')](_0xcee1('0x11'),_0x31415a,_0x1af5ac[_0xcee1('0xf')]['message']);return _0x5a557f(_0x1af5ac[_0xcee1('0xf')][_0xcee1('0x12')]);}logger[_0xcee1('0xf')](_0xcee1('0x11'),_0x31415a,_0x1af5ac[_0xcee1('0xf')][_0xcee1('0x12')]);return _0x386994(_0x1af5ac[_0xcee1('0xf')]['message']);}else{logger[_0xcee1('0xc')](_0xcee1('0x11'),_0x31415a,_0xcee1('0xd'));_0x386994(_0x1af5ac[_0xcee1('0x13')]['message']);}})[_0xcee1('0x14')](function(_0x59f25a){logger['error'](_0xcee1('0x11'),_0x31415a,_0x59f25a);_0x5a557f(_0x59f25a);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 4434b4f..0e59c53 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 _0xb184=['INTEGER','exports'];(function(_0x1b25c1,_0x2c6ce6){var _0x1e4447=function(_0xaaafca){while(--_0xaaafca){_0x1b25c1['push'](_0x1b25c1['shift']());}};_0x1e4447(++_0x2c6ce6);}(_0xb184,0x91));var _0x4b18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb184[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x4b18('0x0')]={'UserId':{'type':Sequelize[_0x4b18('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x4b18('0x1')]}}; \ No newline at end of file +var _0x5b23=['INTEGER','sequelize','exports'];(function(_0x1481b2,_0x3afbd9){var _0x5f4282=function(_0x2b24b8){while(--_0x2b24b8){_0x1481b2['push'](_0x1481b2['shift']());}};_0x5f4282(++_0x3afbd9);}(_0x5b23,0xd9));var _0x35b2=function(_0x420282,_0x1f941f){_0x420282=_0x420282-0x0;var _0x535480=_0x5b23[_0x420282];return _0x535480;};'use strict';var Sequelize=require(_0x35b2('0x0'));module[_0x35b2('0x1')]={'UserId':{'type':Sequelize[_0x35b2('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 94396e2..8c8db76 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(_0x3b232a,_0x2ffb11){var _0x39e8fc=function(_0x5ec044){while(--_0x5ec044){_0x3b232a['push'](_0x3b232a['shift']());}};_0x39e8fc(++_0x2ffb11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x2117fa,_0x524d1b){var _0x139542=function(_0x4cdad9){while(--_0x4cdad9){_0x2117fa['push'](_0x2117fa['shift']());}};_0x139542(++_0x524d1b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 38c6bb3..6799d63 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x329406,_0x34ff27){var _0x42176f=function(_0x313034){while(--_0x313034){_0x329406['push'](_0x329406['shift']());}};_0x42176f(++_0x34ff27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x43ebac,_0x2fc79b){var _0xe417b0=function(_0x251c40){while(--_0x251c40){_0x43ebac['push'](_0x43ebac['shift']());}};_0xe417b0(++_0x2fc79b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index dea2331..1fed9de 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 _0x6adf=['sequelize','exports','INTEGER'];(function(_0x406e9f,_0x49adee){var _0x500565=function(_0x3ec272){while(--_0x3ec272){_0x406e9f['push'](_0x406e9f['shift']());}};_0x500565(++_0x49adee);}(_0x6adf,0xc3));var _0xf6ad=function(_0x11bb45,_0x5237e4){_0x11bb45=_0x11bb45-0x0;var _0x1c7bad=_0x6adf[_0x11bb45];return _0x1c7bad;};'use strict';var Sequelize=require(_0xf6ad('0x0'));module[_0xf6ad('0x1')]={'penalty':{'type':Sequelize[_0xf6ad('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb22e=['sequelize','exports','INTEGER'];(function(_0x47b7c9,_0x3848b2){var _0x435aaf=function(_0x3befc4){while(--_0x3befc4){_0x47b7c9['push'](_0x47b7c9['shift']());}};_0x435aaf(++_0x3848b2);}(_0xb22e,0x81));var _0xeb22=function(_0x2683af,_0xed2c4c){_0x2683af=_0x2683af-0x0;var _0x5bba33=_0xb22e[_0x2683af];return _0x5bba33;};'use strict';var Sequelize=require(_0xeb22('0x0'));module[_0xeb22('0x1')]={'penalty':{'type':Sequelize[_0xeb22('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index ef63f15..6aa6a3a 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 _0xce9e=['moment','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','user_has_voice_queues','lodash','util','api'];(function(_0x35645c,_0x55d263){var _0x5598e7=function(_0xd214e5){while(--_0xd214e5){_0x35645c['push'](_0x35645c['shift']());}};_0x5598e7(++_0x55d263);}(_0xce9e,0x189));var _0xece9=function(_0x50388b,_0x276225){_0x50388b=_0x50388b-0x0;var _0x6037b=_0xce9e[_0x50388b];return _0x6037b;};'use strict';var _=require(_0xece9('0x0'));var util=require(_0xece9('0x1'));var logger=require('../../config/logger')(_0xece9('0x2'));var moment=require(_0xece9('0x3'));var BPromise=require(_0xece9('0x4'));var rp=require(_0xece9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xece9('0x6'));var config=require(_0xece9('0x7'));var attributes=require(_0xece9('0x8'));module[_0xece9('0x9')]=function(_0x49839b,_0x582419){return _0x49839b[_0xece9('0xa')]('UserVoiceQueue',attributes,{'tableName':_0xece9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8b1=['api','moment','bluebird','request-promise','path','rimraf','./userVoiceQueue.attributes','exports','user_has_voice_queues','lodash','util','../../config/logger'];(function(_0xd63ad8,_0x2f884){var _0x87159a=function(_0x37d9c6){while(--_0x37d9c6){_0xd63ad8['push'](_0xd63ad8['shift']());}};_0x87159a(++_0x2f884);}(_0xe8b1,0x69));var _0x1e8b=function(_0x3dea7d,_0x2cd4ea){_0x3dea7d=_0x3dea7d-0x0;var _0x53919a=_0xe8b1[_0x3dea7d];return _0x53919a;};'use strict';var _=require(_0x1e8b('0x0'));var util=require(_0x1e8b('0x1'));var logger=require(_0x1e8b('0x2'))(_0x1e8b('0x3'));var moment=require(_0x1e8b('0x4'));var BPromise=require(_0x1e8b('0x5'));var rp=require(_0x1e8b('0x6'));var fs=require('fs');var path=require(_0x1e8b('0x7'));var rimraf=require(_0x1e8b('0x8'));var config=require('../../config/environment');var attributes=require(_0x1e8b('0x9'));module[_0x1e8b('0xa')]=function(_0x30aab8,_0x240125){return _0x30aab8['define']('UserVoiceQueue',attributes,{'tableName':_0x1e8b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index eccf4c2..bceadee 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 _0x6782=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6782,0x97));var _0x2678=function(_0x57b211,_0x803ac3){_0x57b211=_0x57b211-0x0;var _0x1731ca=_0x6782[_0x57b211];return _0x1731ca;};'use strict';var _=require(_0x2678('0x0'));var util=require(_0x2678('0x1'));var moment=require(_0x2678('0x2'));var BPromise=require(_0x2678('0x3'));var rs=require(_0x2678('0x4'));var fs=require('fs');var Redis=require(_0x2678('0x5'));var db=require(_0x2678('0x6'))['db'];var utils=require(_0x2678('0x7'));var logger=require(_0x2678('0x8'))(_0x2678('0x9'));var config=require(_0x2678('0xa'));var jayson=require(_0x2678('0xb'));var client=jayson[_0x2678('0xc')][_0x2678('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1a0239,_0x1f9632,_0x29c749){return new BPromise(function(_0x343dd6,_0x1c5e7f){return client[_0x2678('0xe')](_0x1a0239,_0x29c749)[_0x2678('0xf')](function(_0x3a43fd){logger[_0x2678('0x10')](_0x2678('0x11'),_0x1f9632,_0x2678('0x12'));logger[_0x2678('0x13')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x1f9632,'request\x20sent',JSON[_0x2678('0x14')](_0x3a43fd));if(_0x3a43fd[_0x2678('0x15')]){if(_0x3a43fd[_0x2678('0x15')][_0x2678('0x16')]===0x1f4){logger[_0x2678('0x15')](_0x2678('0x11'),_0x1f9632,_0x3a43fd[_0x2678('0x15')]['message']);return _0x1c5e7f(_0x3a43fd[_0x2678('0x15')][_0x2678('0x17')]);}logger['error'](_0x2678('0x11'),_0x1f9632,_0x3a43fd['error'][_0x2678('0x17')]);return _0x343dd6(_0x3a43fd['error'][_0x2678('0x17')]);}else{logger[_0x2678('0x10')](_0x2678('0x11'),_0x1f9632,_0x2678('0x12'));_0x343dd6(_0x3a43fd[_0x2678('0x18')]['message']);}})[_0x2678('0x19')](function(_0x2b55d7){logger[_0x2678('0x15')](_0x2678('0x11'),_0x1f9632,_0x2b55d7);_0x1c5e7f(_0x2b55d7);});});} \ No newline at end of file +var _0x3eb8=['stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3eb8,0x18c));var _0x83eb=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x3eb8[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x83eb('0x0'));var util=require(_0x83eb('0x1'));var moment=require(_0x83eb('0x2'));var BPromise=require('bluebird');var rs=require(_0x83eb('0x3'));var fs=require('fs');var Redis=require(_0x83eb('0x4'));var db=require(_0x83eb('0x5'))['db'];var utils=require(_0x83eb('0x6'));var logger=require('../../config/logger')(_0x83eb('0x7'));var config=require(_0x83eb('0x8'));var jayson=require(_0x83eb('0x9'));var client=jayson[_0x83eb('0xa')][_0x83eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x578430,_0x31d678,_0x40b7fb){return new BPromise(function(_0x154077,_0x5568d1){return client[_0x83eb('0xc')](_0x578430,_0x40b7fb)[_0x83eb('0xd')](function(_0x4c3ae2){logger[_0x83eb('0xe')](_0x83eb('0xf'),_0x31d678,_0x83eb('0x10'));logger['debug'](_0x83eb('0x11'),_0x31d678,_0x83eb('0x10'),JSON[_0x83eb('0x12')](_0x4c3ae2));if(_0x4c3ae2['error']){if(_0x4c3ae2[_0x83eb('0x13')][_0x83eb('0x14')]===0x1f4){logger['error'](_0x83eb('0xf'),_0x31d678,_0x4c3ae2[_0x83eb('0x13')][_0x83eb('0x15')]);return _0x5568d1(_0x4c3ae2[_0x83eb('0x13')][_0x83eb('0x15')]);}logger[_0x83eb('0x13')](_0x83eb('0xf'),_0x31d678,_0x4c3ae2[_0x83eb('0x13')][_0x83eb('0x15')]);return _0x154077(_0x4c3ae2[_0x83eb('0x13')][_0x83eb('0x15')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x31d678,'request\x20sent');_0x154077(_0x4c3ae2[_0x83eb('0x16')][_0x83eb('0x15')]);}})['catch'](function(_0x42613f){logger['error'](_0x83eb('0xf'),_0x31d678,_0x42613f);_0x5568d1(_0x42613f);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index a7f3d38..8e4a375 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1e5a59,_0x22d345){var _0x4ca834=function(_0x2b2968){while(--_0x2b2968){_0x1e5a59['push'](_0x1e5a59['shift']());}};_0x4ca834(++_0x22d345);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2c7377,_0x32ade5){var _0x35e181=function(_0x1be1e6){while(--_0x1be1e6){_0x2c7377['push'](_0x2c7377['shift']());}};_0x35e181(++_0x32ade5);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'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 c5e7a01..9c5ca7e 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 _0xb47b=['queue_interface','INTEGER','STRING','Required\x20by\x20Asterisk'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb47b,0x1ed));var _0xbb47=function(_0x42d010,_0x3ee3fb){_0x42d010=_0x42d010-0x0;var _0x4d5c28=_0xb47b[_0x42d010];return _0x4d5c28;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xbb47('0x0')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xbb47('0x1')],'allowNull':![],'comment':_0xbb47('0x2')},'UserId':{'type':Sequelize[_0xbb47('0x0')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbb47('0x3'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xbb47('0x0')],'allowNull':![]},'interface':{'type':Sequelize[_0xbb47('0x1')],'allowNull':![],'unique':_0xbb47('0x3'),'comment':_0xbb47('0x2')},'penalty':{'type':Sequelize[_0xbb47('0x0')](0xb),'defaultValue':0x0,'comment':_0xbb47('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xfdf4=['exports','INTEGER','Required\x20by\x20Asterisk','queue_interface','STRING'];(function(_0x4d91d4,_0x349ae2){var _0x348829=function(_0x5a1e7c){while(--_0x5a1e7c){_0x4d91d4['push'](_0x4d91d4['shift']());}};_0x348829(++_0x349ae2);}(_0xfdf4,0xb4));var _0x4fdf=function(_0x142c9e,_0x141cd7){_0x142c9e=_0x142c9e-0x0;var _0x6d03b6=_0xfdf4[_0x142c9e];return _0x6d03b6;};'use strict';var Sequelize=require('sequelize');module[_0x4fdf('0x0')]={'uniqueid':{'type':Sequelize[_0x4fdf('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x4fdf('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x4fdf('0x2')},'UserId':{'type':Sequelize[_0x4fdf('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4fdf('0x3'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x4fdf('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x4fdf('0x4')],'allowNull':![],'unique':_0x4fdf('0x3'),'comment':_0x4fdf('0x2')},'penalty':{'type':Sequelize[_0x4fdf('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x4fdf('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index d5af8da..ccbd482 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 _0x4a10=['events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x4f6a6d,_0x11285c){var _0x5e607a=function(_0x1e1bec){while(--_0x1e1bec){_0x4f6a6d['push'](_0x4f6a6d['shift']());}};_0x5e607a(++_0x11285c);}(_0x4a10,0x1cc));var _0x04a1=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4a10[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x04a1('0x0'));var UserVoiceQueueRt=require(_0x04a1('0x1'))['db'][_0x04a1('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x04a1('0x3')](0x0);var events={'afterCreate':_0x04a1('0x4'),'afterUpdate':_0x04a1('0x5'),'afterDestroy':_0x04a1('0x6')};function emitEvent(_0x19468a){return function(_0x5d6951,_0x3f94c0,_0x226993){UserVoiceQueueRtEvents[_0x04a1('0x7')](_0x19468a+':'+_0x5d6951['id'],_0x5d6951);UserVoiceQueueRtEvents[_0x04a1('0x7')](_0x19468a,_0x5d6951);_0x226993(null);};}for(var e in events){if(events[_0x04a1('0x8')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x04a1('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x960c=['UserVoiceQueueRt','setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x3815b2,_0xdeaa84){var _0x2ebd79=function(_0x4ed85a){while(--_0x4ed85a){_0x3815b2['push'](_0x3815b2['shift']());}};_0x2ebd79(++_0xdeaa84);}(_0x960c,0x154));var _0xc960=function(_0x293238,_0x4d7287){_0x293238=_0x293238-0x0;var _0x1e1b5c=_0x960c[_0x293238];return _0x1e1b5c;};'use strict';var EventEmitter=require(_0xc960('0x0'));var UserVoiceQueueRt=require(_0xc960('0x1'))['db'][_0xc960('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xc960('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc960('0x4'),'afterDestroy':_0xc960('0x5')};function emitEvent(_0x117e0b){return function(_0x1d4119,_0x159271,_0x37bc4a){UserVoiceQueueRtEvents['emit'](_0x117e0b+':'+_0x1d4119['id'],_0x1d4119);UserVoiceQueueRtEvents[_0xc960('0x6')](_0x117e0b,_0x1d4119);_0x37bc4a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xc960('0x7')](e,emitEvent(event));}}module[_0xc960('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 a1b1152..1f30199 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 _0xa8c2=['lodash','util','api','bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa8c2,0x8c));var _0x2a8c=function(_0x2a8925,_0x7245af){_0x2a8925=_0x2a8925-0x0;var _0x38c067=_0xa8c2[_0x2a8925];return _0x38c067;};'use strict';var _=require(_0x2a8c('0x0'));var util=require(_0x2a8c('0x1'));var logger=require('../../config/logger')(_0x2a8c('0x2'));var moment=require('moment');var BPromise=require(_0x2a8c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a8c('0x4'));var rimraf=require(_0x2a8c('0x5'));var config=require(_0x2a8c('0x6'));var attributes=require(_0x2a8c('0x7'));module[_0x2a8c('0x8')]=function(_0x54a9fe,_0x29b218){return _0x54a9fe[_0x2a8c('0x9')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6362=['bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','lodash','util','api','moment'];(function(_0x16dbab,_0x3ac1e1){var _0x59b0b2=function(_0x2e13e2){while(--_0x2e13e2){_0x16dbab['push'](_0x16dbab['shift']());}};_0x59b0b2(++_0x3ac1e1);}(_0x6362,0x14e));var _0x2636=function(_0xabb7ba,_0x54612d){_0xabb7ba=_0xabb7ba-0x0;var _0x3fb15e=_0x6362[_0xabb7ba];return _0x3fb15e;};'use strict';var _=require(_0x2636('0x0'));var util=require(_0x2636('0x1'));var logger=require('../../config/logger')(_0x2636('0x2'));var moment=require(_0x2636('0x3'));var BPromise=require(_0x2636('0x4'));var rp=require(_0x2636('0x5'));var fs=require('fs');var path=require(_0x2636('0x6'));var rimraf=require(_0x2636('0x7'));var config=require(_0x2636('0x8'));var attributes=require(_0x2636('0x9'));module[_0x2636('0xa')]=function(_0x252de5,_0x5c49c7){return _0x252de5[_0x2636('0xb')](_0x2636('0xc'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 5f80cd4..848db77 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 _0x70f3=['../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x16bb0e,_0x343132){var _0x102b8b=function(_0x17a62b){while(--_0x17a62b){_0x16bb0e['push'](_0x16bb0e['shift']());}};_0x102b8b(++_0x343132);}(_0x70f3,0xf0));var _0x370f=function(_0x2e5c07,_0x5c29e0){_0x2e5c07=_0x2e5c07-0x0;var _0x4fa341=_0x70f3[_0x2e5c07];return _0x4fa341;};'use strict';var _=require(_0x370f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x370f('0x1'));var rs=require(_0x370f('0x2'));var fs=require('fs');var Redis=require(_0x370f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x370f('0x4'));var logger=require(_0x370f('0x5'))('rpc');var config=require(_0x370f('0x6'));var jayson=require(_0x370f('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x370f('0x8')]=_[_0x370f('0x9')](config[_0x370f('0x8')],{'host':_0x370f('0xa'),'port':0x18eb});var socket=require(_0x370f('0xb'))(new Redis(config[_0x370f('0x8')]));require(_0x370f('0xc'))[_0x370f('0xd')](socket);function respondWithRpcPromise(_0x5775d0,_0x2aa71c,_0xd7b405){return new BPromise(function(_0x13077a,_0x36ec9d){return client['request'](_0x5775d0,_0xd7b405)[_0x370f('0xe')](function(_0x1b6a3d){logger[_0x370f('0xf')](_0x370f('0x10'),_0x2aa71c,'request\x20sent');logger[_0x370f('0x11')](_0x370f('0x12'),_0x2aa71c,_0x370f('0x13'),JSON[_0x370f('0x14')](_0x1b6a3d));if(_0x1b6a3d['error']){if(_0x1b6a3d[_0x370f('0x15')][_0x370f('0x16')]===0x1f4){logger[_0x370f('0x15')](_0x370f('0x10'),_0x2aa71c,_0x1b6a3d[_0x370f('0x15')][_0x370f('0x17')]);return _0x36ec9d(_0x1b6a3d[_0x370f('0x15')]['message']);}logger['error'](_0x370f('0x10'),_0x2aa71c,_0x1b6a3d[_0x370f('0x15')][_0x370f('0x17')]);return _0x13077a(_0x1b6a3d[_0x370f('0x15')]['message']);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2aa71c,'request\x20sent');_0x13077a(_0x1b6a3d['result']['message']);}})[_0x370f('0x18')](function(_0x51d8a6){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2aa71c,_0x51d8a6);_0x36ec9d(_0x51d8a6);});});}exports['GetVoiceQueueRtPauses']=function(_0x485800){var _0x8a35d7=this;return new Promise(function(_0x2414b9,_0x111666){return db[_0x370f('0x19')][_0x370f('0x1a')]({'raw':_0x485800[_0x370f('0x1b')]?_0x485800[_0x370f('0x1b')][_0x370f('0x1c')]===undefined?!![]:![]:!![],'where':_0x485800[_0x370f('0x1b')]?_0x485800[_0x370f('0x1b')][_0x370f('0x1d')]||null:null,'attributes':[[db[_0x370f('0x1e')]['fn'](_0x370f('0x1f'),db[_0x370f('0x1e')]['fn']('IF',db['sequelize'][_0x370f('0x20')]('`paused`\x20=\x201,\x201,\x20null'))),_0x370f('0x21')]]})['then'](function(_0x55f409){logger[_0x370f('0xf')](_0x370f('0x22'),_0x485800);logger[_0x370f('0x11')](_0x370f('0x22'),_0x485800,JSON[_0x370f('0x14')](_0x55f409));_0x2414b9(_0x55f409);})[_0x370f('0x18')](function(_0x56ae64){logger['error']('GetVoiceQueueRtPauses',_0x56ae64[_0x370f('0x17')],_0x485800);_0x111666(_0x8a35d7[_0x370f('0x15')](0x1f4,_0x56ae64[_0x370f('0x17')]));});});}; \ No newline at end of file +var _0x3901=['UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','findAll','options','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x530077,_0x413ea1){var _0x217e25=function(_0x2139f2){while(--_0x2139f2){_0x530077['push'](_0x530077['shift']());}};_0x217e25(++_0x413ea1);}(_0x3901,0x124));var _0x1390=function(_0x2697f3,_0x44084c){_0x2697f3=_0x2697f3-0x0;var _0x558909=_0x3901[_0x2697f3];return _0x558909;};'use strict';var _=require(_0x1390('0x0'));var util=require(_0x1390('0x1'));var moment=require(_0x1390('0x2'));var BPromise=require(_0x1390('0x3'));var rs=require(_0x1390('0x4'));var fs=require('fs');var Redis=require(_0x1390('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1390('0x6'));var logger=require(_0x1390('0x7'))('rpc');var config=require(_0x1390('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1390('0x9')][_0x1390('0xa')]({'port':0x232a});config[_0x1390('0xb')]=_[_0x1390('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1390('0xd'))(new Redis(config[_0x1390('0xb')]));require(_0x1390('0xe'))[_0x1390('0xf')](socket);function respondWithRpcPromise(_0x64815d,_0x4bc9c1,_0x1126bd){return new BPromise(function(_0x9be401,_0x2ed6a3){return client[_0x1390('0x10')](_0x64815d,_0x1126bd)[_0x1390('0x11')](function(_0x29e55d){logger[_0x1390('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4bc9c1,_0x1390('0x13'));logger[_0x1390('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x4bc9c1,'request\x20sent',JSON[_0x1390('0x15')](_0x29e55d));if(_0x29e55d[_0x1390('0x16')]){if(_0x29e55d['error']['code']===0x1f4){logger[_0x1390('0x16')](_0x1390('0x17'),_0x4bc9c1,_0x29e55d[_0x1390('0x16')][_0x1390('0x18')]);return _0x2ed6a3(_0x29e55d[_0x1390('0x16')][_0x1390('0x18')]);}logger[_0x1390('0x16')](_0x1390('0x17'),_0x4bc9c1,_0x29e55d['error'][_0x1390('0x18')]);return _0x9be401(_0x29e55d['error'][_0x1390('0x18')]);}else{logger[_0x1390('0x12')](_0x1390('0x17'),_0x4bc9c1,_0x1390('0x13'));_0x9be401(_0x29e55d[_0x1390('0x19')]['message']);}})[_0x1390('0x1a')](function(_0x54505e){logger[_0x1390('0x16')](_0x1390('0x17'),_0x4bc9c1,_0x54505e);_0x2ed6a3(_0x54505e);});});}exports['GetVoiceQueueRtPauses']=function(_0x2ed890){var _0x320631=this;return new Promise(function(_0x3d9e1f,_0x462460){return db['UserVoiceQueueRt'][_0x1390('0x1b')]({'raw':_0x2ed890[_0x1390('0x1c')]?_0x2ed890[_0x1390('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2ed890[_0x1390('0x1c')]?_0x2ed890[_0x1390('0x1c')]['where']||null:null,'attributes':[[db[_0x1390('0x1d')]['fn'](_0x1390('0x1e'),db[_0x1390('0x1d')]['fn']('IF',db[_0x1390('0x1d')][_0x1390('0x1f')](_0x1390('0x20')))),_0x1390('0x21')]]})[_0x1390('0x11')](function(_0x2af430){logger['info']('GetVoiceQueueRtPauses',_0x2ed890);logger[_0x1390('0x14')]('GetVoiceQueueRtPauses',_0x2ed890,JSON[_0x1390('0x15')](_0x2af430));_0x3d9e1f(_0x2af430);})[_0x1390('0x1a')](function(_0x2376a9){logger['error'](_0x1390('0x22'),_0x2376a9[_0x1390('0x18')],_0x2ed890);_0x462460(_0x320631[_0x1390('0x16')](0x1f4,_0x2376a9['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index dcb06ae..382b0ba 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 _0xa381=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','removeListener','register'];(function(_0x4a6145,_0x16e4ae){var _0x41daa2=function(_0xb94fa3){while(--_0xb94fa3){_0x4a6145['push'](_0x4a6145['shift']());}};_0x41daa2(++_0x16e4ae);}(_0xa381,0x79));var _0x1a38=function(_0x3fa132,_0x2f5df2){_0x3fa132=_0x3fa132-0x0;var _0x51d168=_0xa381[_0x3fa132];return _0x51d168;};'use strict';var UserVoiceQueueRtEvents=require(_0x1a38('0x0'));var events=[_0x1a38('0x1'),'remove','update'];function createListener(_0x41cdc2,_0xe2d8b3){return function(_0x2a069e){_0xe2d8b3['emit'](_0x41cdc2,_0x2a069e);};}function removeListener(_0x2a4353,_0x6cbf3){return function(){UserVoiceQueueRtEvents[_0x1a38('0x2')](_0x2a4353,_0x6cbf3);};}exports[_0x1a38('0x3')]=function(_0x4bb44f){for(var _0x411f6a=0x0,_0x569e9f=events['length'];_0x411f6a<_0x569e9f;_0x411f6a++){var _0x3d12f8=events[_0x411f6a];var _0x4df1db=createListener(_0x1a38('0x4')+_0x3d12f8,_0x4bb44f);UserVoiceQueueRtEvents['on'](_0x3d12f8,_0x4df1db);}}; \ No newline at end of file +var _0x7edb=['save','remove','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x4ffb55,_0x18dc8e){var _0x5625ab=function(_0x471160){while(--_0x471160){_0x4ffb55['push'](_0x4ffb55['shift']());}};_0x5625ab(++_0x18dc8e);}(_0x7edb,0x158));var _0xb7ed=function(_0x548ce2,_0x271f70){_0x548ce2=_0x548ce2-0x0;var _0x4a26b9=_0x7edb[_0x548ce2];return _0x4a26b9;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xb7ed('0x0'),_0xb7ed('0x1'),_0xb7ed('0x2')];function createListener(_0x37440f,_0x15d080){return function(_0x5a485a){_0x15d080[_0xb7ed('0x3')](_0x37440f,_0x5a485a);};}function removeListener(_0x595b65,_0x4c8316){return function(){UserVoiceQueueRtEvents[_0xb7ed('0x4')](_0x595b65,_0x4c8316);};}exports[_0xb7ed('0x5')]=function(_0x2aa67d){for(var _0x246cfa=0x0,_0x85fdf0=events[_0xb7ed('0x6')];_0x246cfa<_0x85fdf0;_0x246cfa++){var _0xac7ffe=events[_0x246cfa];var _0x3c991d=createListener(_0xb7ed('0x7')+_0xac7ffe,_0x2aa67d);UserVoiceQueueRtEvents['on'](_0xac7ffe,_0x3c991d);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index f2fc2f0..09dcd56 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x59a4be,_0x1ba00a){var _0x1d4a28=function(_0x2106a8){while(--_0x2106a8){_0x59a4be['push'](_0x59a4be['shift']());}};_0x1d4a28(++_0x1ba00a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x28cb54,_0x1e32e0){var _0x4c6ade=function(_0x316769){while(--_0x316769){_0x28cb54['push'](_0x28cb54['shift']());}};_0x4c6ade(++_0x1e32e0);}(_0x70e0,0x17b));var _0x070e=function(_0x4f70fa,_0x352fca){_0x4f70fa=_0x4f70fa-0x0;var _0x19c581=_0x70e0[_0x4f70fa];return _0x19c581;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 17f536e..a840ba3 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 _0x8a54=['INTEGER','sequelize','exports'];(function(_0x3833fd,_0x3d4f6a){var _0x111c26=function(_0x703aa8){while(--_0x703aa8){_0x3833fd['push'](_0x3833fd['shift']());}};_0x111c26(++_0x3d4f6a);}(_0x8a54,0xca));var _0x48a5=function(_0x66b3f,_0x53d6da){_0x66b3f=_0x66b3f-0x0;var _0x369de7=_0x8a54[_0x66b3f];return _0x369de7;};'use strict';var Sequelize=require(_0x48a5('0x0'));module[_0x48a5('0x1')]={'penalty':{'type':Sequelize[_0x48a5('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8d29=['exports','sequelize'];(function(_0x418714,_0x53d445){var _0x3782fb=function(_0xe7ac4){while(--_0xe7ac4){_0x418714['push'](_0x418714['shift']());}};_0x3782fb(++_0x53d445);}(_0x8d29,0x101));var _0x98d2=function(_0x5ef5ad,_0x2ea729){_0x5ef5ad=_0x5ef5ad-0x0;var _0x484ced=_0x8d29[_0x5ef5ad];return _0x484ced;};'use strict';var Sequelize=require(_0x98d2('0x0'));module[_0x98d2('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 25ffbfa..083ebf5 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 _0x3ad9=['rimraf','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','request-promise','path'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x3ad9,0x16d));var _0x93ad=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0x3ad9[_0x4ed32d];return _0xf624df;};'use strict';var _=require(_0x93ad('0x0'));var util=require(_0x93ad('0x1'));var logger=require(_0x93ad('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x93ad('0x3'));var fs=require('fs');var path=require(_0x93ad('0x4'));var rimraf=require(_0x93ad('0x5'));var config=require('../../config/environment');var attributes=require(_0x93ad('0x6'));module[_0x93ad('0x7')]=function(_0xb3a60d,_0x350ff1){return _0xb3a60d['define'](_0x93ad('0x8'),attributes,{'tableName':_0x93ad('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ae9=['request-promise','rimraf','../../config/environment','./userWhatsappQueue.attributes','UserWhatsappQueue','lodash','api','moment','bluebird'];(function(_0xe0ce73,_0x2b5e80){var _0x33d685=function(_0x5875dc){while(--_0x5875dc){_0xe0ce73['push'](_0xe0ce73['shift']());}};_0x33d685(++_0x2b5e80);}(_0x4ae9,0xdd));var _0x94ae=function(_0x52753e,_0x1718bc){_0x52753e=_0x52753e-0x0;var _0x5b2cd5=_0x4ae9[_0x52753e];return _0x5b2cd5;};'use strict';var _=require(_0x94ae('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x94ae('0x1'));var moment=require(_0x94ae('0x2'));var BPromise=require(_0x94ae('0x3'));var rp=require(_0x94ae('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x94ae('0x5'));var config=require(_0x94ae('0x6'));var attributes=require(_0x94ae('0x7'));module['exports']=function(_0x21e939,_0x1ff88c){return _0x21e939['define'](_0x94ae('0x8'),attributes,{'tableName':'user_has_whatsapp_queues','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 710b5da..9cd7eeb 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 _0xc1b3=['../../config/logger','../../config/environment','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1e4b5b,_0x2c2222){var _0x1d13ed=function(_0x65d17d){while(--_0x65d17d){_0x1e4b5b['push'](_0x1e4b5b['shift']());}};_0x1d13ed(++_0x2c2222);}(_0xc1b3,0x1dd));var _0x3c1b=function(_0x11c552,_0x3a25ba){_0x11c552=_0x11c552-0x0;var _0x26353e=_0xc1b3[_0x11c552];return _0x26353e;};'use strict';var _=require('lodash');var util=require(_0x3c1b('0x0'));var moment=require(_0x3c1b('0x1'));var BPromise=require(_0x3c1b('0x2'));var rs=require(_0x3c1b('0x3'));var fs=require('fs');var Redis=require(_0x3c1b('0x4'));var db=require(_0x3c1b('0x5'))['db'];var utils=require(_0x3c1b('0x6'));var logger=require(_0x3c1b('0x7'))('rpc');var config=require(_0x3c1b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3c1b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcf1ca9,_0x196f93,_0x41275f){return new BPromise(function(_0x4e7ccd,_0x37b620){return client[_0x3c1b('0xa')](_0xcf1ca9,_0x41275f)[_0x3c1b('0xb')](function(_0x487b3f){logger[_0x3c1b('0xc')](_0x3c1b('0xd'),_0x196f93,_0x3c1b('0xe'));logger[_0x3c1b('0xf')](_0x3c1b('0x10'),_0x196f93,'request\x20sent',JSON[_0x3c1b('0x11')](_0x487b3f));if(_0x487b3f['error']){if(_0x487b3f['error'][_0x3c1b('0x12')]===0x1f4){logger[_0x3c1b('0x13')](_0x3c1b('0xd'),_0x196f93,_0x487b3f[_0x3c1b('0x13')][_0x3c1b('0x14')]);return _0x37b620(_0x487b3f['error'][_0x3c1b('0x14')]);}logger[_0x3c1b('0x13')](_0x3c1b('0xd'),_0x196f93,_0x487b3f[_0x3c1b('0x13')][_0x3c1b('0x14')]);return _0x4e7ccd(_0x487b3f[_0x3c1b('0x13')][_0x3c1b('0x14')]);}else{logger[_0x3c1b('0xc')](_0x3c1b('0xd'),_0x196f93,'request\x20sent');_0x4e7ccd(_0x487b3f[_0x3c1b('0x15')][_0x3c1b('0x14')]);}})['catch'](function(_0x1df4ff){logger[_0x3c1b('0x13')](_0x3c1b('0xd'),_0x196f93,_0x1df4ff);_0x37b620(_0x1df4ff);});});} \ No newline at end of file +var _0x5164=['jayson/promise','client','http','info','request\x20sent','debug','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1db4c8,_0x47004c){var _0x570c4b=function(_0x5b5ce0){while(--_0x5b5ce0){_0x1db4c8['push'](_0x1db4c8['shift']());}};_0x570c4b(++_0x47004c);}(_0x5164,0x198));var _0x4516=function(_0x453bcc,_0x3bb539){_0x453bcc=_0x453bcc-0x0;var _0x5cd80d=_0x5164[_0x453bcc];return _0x5cd80d;};'use strict';var _=require(_0x4516('0x0'));var util=require(_0x4516('0x1'));var moment=require(_0x4516('0x2'));var BPromise=require(_0x4516('0x3'));var rs=require(_0x4516('0x4'));var fs=require('fs');var Redis=require(_0x4516('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4516('0x6'));var logger=require(_0x4516('0x7'))(_0x4516('0x8'));var config=require(_0x4516('0x9'));var jayson=require(_0x4516('0xa'));var client=jayson[_0x4516('0xb')][_0x4516('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x89e92b,_0x53261f,_0x8a0e39){return new BPromise(function(_0x4bf2e7,_0x565ceb){return client['request'](_0x89e92b,_0x8a0e39)['then'](function(_0x56adad){logger[_0x4516('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x53261f,_0x4516('0xe'));logger[_0x4516('0xf')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x53261f,_0x4516('0xe'),JSON[_0x4516('0x10')](_0x56adad));if(_0x56adad[_0x4516('0x11')]){if(_0x56adad[_0x4516('0x11')][_0x4516('0x12')]===0x1f4){logger['error'](_0x4516('0x13'),_0x53261f,_0x56adad['error'][_0x4516('0x14')]);return _0x565ceb(_0x56adad['error'][_0x4516('0x14')]);}logger[_0x4516('0x11')](_0x4516('0x13'),_0x53261f,_0x56adad[_0x4516('0x11')][_0x4516('0x14')]);return _0x4bf2e7(_0x56adad[_0x4516('0x11')][_0x4516('0x14')]);}else{logger[_0x4516('0xd')](_0x4516('0x13'),_0x53261f,'request\x20sent');_0x4bf2e7(_0x56adad['result']['message']);}})[_0x4516('0x15')](function(_0x16a2c7){logger[_0x4516('0x11')](_0x4516('0x13'),_0x53261f,_0x16a2c7);_0x565ceb(_0x16a2c7);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index babe8a5..bf65c8f 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 _0x00bb=['get','/:id','isAuthenticated','show','post','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./variable.controller'];(function(_0x5805b2,_0x19579d){var _0x56f536=function(_0x1106de){while(--_0x1106de){_0x5805b2['push'](_0x5805b2['shift']());}};_0x56f536(++_0x19579d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x00bb[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var path=require(_0xb00b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb00b('0x3'));var router=express['Router']();var fs_extra=require(_0xb00b('0x4'));var auth=require(_0xb00b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb00b('0x6'));var controller=require(_0xb00b('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb00b('0x8')](_0xb00b('0x9'),auth[_0xb00b('0xa')](),controller[_0xb00b('0xb')]);router[_0xb00b('0xc')]('/',auth[_0xb00b('0xa')](),controller['create']);router['put'](_0xb00b('0x9'),auth[_0xb00b('0xa')](),controller[_0xb00b('0xd')]);router[_0xb00b('0xe')](_0xb00b('0x9'),auth['isAuthenticated'](),controller[_0xb00b('0xf')]);module['exports']=router; \ No newline at end of file +var _0xc874=['put','update','delete','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','get','index','/:id','isAuthenticated','show'];(function(_0x1630f8,_0x173a13){var _0x22e185=function(_0x3ebfac){while(--_0x3ebfac){_0x1630f8['push'](_0x1630f8['shift']());}};_0x22e185(++_0x173a13);}(_0xc874,0x154));var _0x4c87=function(_0x4d674b,_0x176474){_0x4d674b=_0x4d674b-0x0;var _0x535a1f=_0xc874[_0x4d674b];return _0x535a1f;};'use strict';var multer=require(_0x4c87('0x0'));var util=require('util');var path=require(_0x4c87('0x1'));var timeout=require(_0x4c87('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4c87('0x3'));var auth=require(_0x4c87('0x4'));var interaction=require(_0x4c87('0x5'));var config=require('../../config/environment');var controller=require(_0x4c87('0x6'));router[_0x4c87('0x7')]('/',auth['isAuthenticated'](),controller[_0x4c87('0x8')]);router[_0x4c87('0x7')](_0x4c87('0x9'),auth[_0x4c87('0xa')](),controller[_0x4c87('0xb')]);router['post']('/',auth[_0x4c87('0xa')](),controller['create']);router[_0x4c87('0xc')](_0x4c87('0x9'),auth[_0x4c87('0xa')](),controller[_0x4c87('0xd')]);router[_0x4c87('0xe')]('/:id',auth[_0x4c87('0xa')](),controller[_0x4c87('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 8008408..398410c 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 _0x6737=['exports','STRING'];(function(_0x1233a6,_0xdd43c7){var _0x459fe6=function(_0x56a3c2){while(--_0x56a3c2){_0x1233a6['push'](_0x1233a6['shift']());}};_0x459fe6(++_0xdd43c7);}(_0x6737,0xe2));var _0x7673=function(_0x24df30,_0x41f95b){_0x24df30=_0x24df30-0x0;var _0x55ac3a=_0x6737[_0x24df30];return _0x55ac3a;};'use strict';var Sequelize=require('sequelize');module[_0x7673('0x0')]={'name':{'type':Sequelize[_0x7673('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7673('0x1')]}}; \ No newline at end of file +var _0xca9a=['STRING','sequelize','exports'];(function(_0x3dc473,_0x4b2a0b){var _0x4820a6=function(_0x31cc73){while(--_0x31cc73){_0x3dc473['push'](_0x3dc473['shift']());}};_0x4820a6(++_0x4b2a0b);}(_0xca9a,0x181));var _0xaca9=function(_0x262417,_0xd14a17){_0x262417=_0x262417-0x0;var _0x43a2bb=_0xca9a[_0x262417];return _0x43a2bb;};'use strict';var Sequelize=require(_0xaca9('0x0'));module[_0xaca9('0x1')]={'name':{'type':Sequelize[_0xaca9('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xaca9('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 33e7f4f..722a9f8 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 _0xd270=['stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Variables','UserProfileResource','sendStatus','error'];(function(_0x23d685,_0x5a2d46){var _0x4c7239=function(_0x1253d7){while(--_0x1253d7){_0x23d685['push'](_0x23d685['shift']());}};_0x4c7239(++_0x5a2d46);}(_0xd270,0x16e));var _0x0d27=function(_0x2b4cd3,_0x3b5c02){_0x2b4cd3=_0x2b4cd3-0x0;var _0x29447a=_0xd270[_0x2b4cd3];return _0x29447a;};'use strict';var emlformat=require(_0x0d27('0x0'));var rimraf=require(_0x0d27('0x1'));var zipdir=require(_0x0d27('0x2'));var jsonpatch=require(_0x0d27('0x3'));var rp=require(_0x0d27('0x4'));var moment=require(_0x0d27('0x5'));var BPromise=require(_0x0d27('0x6'));var Mustache=require(_0x0d27('0x7'));var util=require(_0x0d27('0x8'));var path=require(_0x0d27('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d27('0xa'));var fs=require('fs');var fs_extra=require(_0x0d27('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0d27('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0d27('0xd'));var toCsv=require(_0x0d27('0xe'));var querystring=require('querystring');var Papa=require(_0x0d27('0xf'));var Redis=require(_0x0d27('0x10'));var authService=require(_0x0d27('0x11'));var qs=require(_0x0d27('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d27('0x13'));var logger=require(_0x0d27('0x14'))(_0x0d27('0x15'));var utils=require(_0x0d27('0x16'));var config=require(_0x0d27('0x17'));var licenseUtil=require(_0x0d27('0x18'));var db=require(_0x0d27('0x19'))['db'];function respondWithStatusCode(_0x27a54f,_0x2b0a46){_0x2b0a46=_0x2b0a46||0xcc;return function(_0xd29fcc){if(_0xd29fcc){return _0x27a54f['sendStatus'](_0x2b0a46);}return _0x27a54f[_0x0d27('0x1a')](_0x2b0a46)[_0x0d27('0x1b')]();};}function respondWithResult(_0x135610,_0x3ab9f8){_0x3ab9f8=_0x3ab9f8||0xc8;return function(_0x1fb825){if(_0x1fb825){return _0x135610['status'](_0x3ab9f8)['json'](_0x1fb825);}};}function respondWithFilteredResult(_0x2e2c22,_0x165aba){return function(_0x2b4589){if(_0x2b4589){var _0x1fed06=typeof _0x165aba['offset']===_0x0d27('0x1c')&&typeof _0x165aba['limit']===_0x0d27('0x1c');var _0x3bbde1=_0x2b4589[_0x0d27('0x1d')];var _0x4a54fe=_0x1fed06?0x0:_0x165aba[_0x0d27('0x1e')];var _0x124481=_0x1fed06?_0x2b4589[_0x0d27('0x1d')]:_0x165aba[_0x0d27('0x1e')]+_0x165aba['limit'];var _0x1cdd86;if(_0x124481>=_0x3bbde1){_0x124481=_0x3bbde1;_0x1cdd86=0xc8;}else{_0x1cdd86=0xce;}_0x2e2c22[_0x0d27('0x1a')](_0x1cdd86);return _0x2e2c22[_0x0d27('0x1f')](_0x0d27('0x20'),_0x4a54fe+'-'+_0x124481+'/'+_0x3bbde1)['json'](_0x2b4589);}return null;};}function patchUpdates(_0x2e198c){return function(_0x4f246a){try{jsonpatch[_0x0d27('0x21')](_0x4f246a,_0x2e198c,!![]);}catch(_0xc77fa6){return BPromise[_0x0d27('0x22')](_0xc77fa6);}return _0x4f246a[_0x0d27('0x23')]();};}function saveUpdates(_0x5ad8ad,_0x4527ec){return function(_0x27f128){if(_0x27f128){return _0x27f128[_0x0d27('0x24')](_0x5ad8ad)['then'](function(_0x332311){return _0x332311;});}return null;};}function removeEntity(_0x581ff4,_0x1af03c){return function(_0x28c6b3){if(_0x28c6b3){return _0x28c6b3[_0x0d27('0x25')]()[_0x0d27('0x26')](function(){var _0x15c61a=_0x28c6b3[_0x0d27('0x27')]({'plain':!![]});var _0x5772f5=_0x0d27('0x28');return db[_0x0d27('0x29')][_0x0d27('0x25')]({'where':{'type':_0x5772f5,'resourceId':_0x15c61a['id']}})[_0x0d27('0x26')](function(){return _0x28c6b3;});})[_0x0d27('0x26')](function(){_0x581ff4[_0x0d27('0x1a')](0xcc)[_0x0d27('0x1b')]();});}};}function handleEntityNotFound(_0x1aff8c,_0x51701f){return function(_0x2be1fb){if(!_0x2be1fb){_0x1aff8c[_0x0d27('0x2a')](0x194);}return _0x2be1fb;};}function handleError(_0x23ac51,_0x14936e){_0x14936e=_0x14936e||0x1f4;return function(_0x2dd18a){logger[_0x0d27('0x2b')](_0x2dd18a[_0x0d27('0x2c')]);if(_0x2dd18a[_0x0d27('0x2d')]){delete _0x2dd18a['name'];}_0x23ac51[_0x0d27('0x1a')](_0x14936e)[_0x0d27('0x2e')](_0x2dd18a);};}exports[_0x0d27('0x2f')]=function(_0x5ec917,_0x4d50df){var _0xc1b4f9={},_0x3ec532={},_0x318663={'count':0x0,'rows':[]};var _0x1ea95b=_[_0x0d27('0x30')](db[_0x0d27('0x31')][_0x0d27('0x32')],function(_0x23fcb7){return{'name':_0x23fcb7[_0x0d27('0x33')],'type':_0x23fcb7[_0x0d27('0x34')][_0x0d27('0x35')]};});_0x3ec532[_0x0d27('0x36')]=_['map'](_0x1ea95b,_0x0d27('0x2d'));_0x3ec532['query']=_['keys'](_0x5ec917[_0x0d27('0x37')]);_0x3ec532[_0x0d27('0x38')]=_[_0x0d27('0x39')](_0x3ec532[_0x0d27('0x36')],_0x3ec532[_0x0d27('0x37')]);_0xc1b4f9['attributes']=_[_0x0d27('0x39')](_0x3ec532[_0x0d27('0x36')],qs[_0x0d27('0x3a')](_0x5ec917['query']['fields']));_0xc1b4f9[_0x0d27('0x3b')]=_0xc1b4f9[_0x0d27('0x3b')][_0x0d27('0x3c')]?_0xc1b4f9['attributes']:_0x3ec532[_0x0d27('0x36')];if(!_0x5ec917[_0x0d27('0x37')][_0x0d27('0x3d')]('nolimit')){_0xc1b4f9['limit']=qs[_0x0d27('0x3e')](_0x5ec917[_0x0d27('0x37')][_0x0d27('0x3e')]);_0xc1b4f9[_0x0d27('0x1e')]=qs['offset'](_0x5ec917[_0x0d27('0x37')][_0x0d27('0x1e')]);}_0xc1b4f9[_0x0d27('0x3f')]=qs['sort'](_0x5ec917[_0x0d27('0x37')][_0x0d27('0x40')]);_0xc1b4f9[_0x0d27('0x41')]=qs[_0x0d27('0x38')](_[_0x0d27('0x42')](_0x5ec917[_0x0d27('0x37')],_0x3ec532[_0x0d27('0x38')]),_0x1ea95b);if(_0x5ec917[_0x0d27('0x37')]['filter']){_0xc1b4f9[_0x0d27('0x41')]=_['merge'](_0xc1b4f9[_0x0d27('0x41')],{'$or':_['map'](_0x1ea95b,function(_0x2ba900){if(_0x2ba900[_0x0d27('0x34')]!=='VIRTUAL'){var _0x26cab2={};_0x26cab2[_0x2ba900[_0x0d27('0x2d')]]={'$like':'%'+_0x5ec917[_0x0d27('0x37')]['filter']+'%'};return _0x26cab2;}})});}_0xc1b4f9=_[_0x0d27('0x43')]({},_0xc1b4f9,_0x5ec917[_0x0d27('0x44')]);var _0x2a334b={'where':_0xc1b4f9[_0x0d27('0x41')]};return db[_0x0d27('0x31')][_0x0d27('0x1d')](_0x2a334b)['then'](function(_0x46d5db){_0x318663[_0x0d27('0x1d')]=_0x46d5db;if(_0x5ec917[_0x0d27('0x37')][_0x0d27('0x45')]){_0xc1b4f9[_0x0d27('0x46')]=[{'all':!![]}];}return db[_0x0d27('0x31')][_0x0d27('0x47')](_0xc1b4f9);})[_0x0d27('0x26')](function(_0x501d8b){_0x318663[_0x0d27('0x48')]=_0x501d8b;return _0x318663;})[_0x0d27('0x26')](respondWithFilteredResult(_0x4d50df,_0xc1b4f9))[_0x0d27('0x49')](handleError(_0x4d50df,null));};exports['show']=function(_0x16ece7,_0x3236f9){var _0x15db0d={'raw':!![],'where':{'id':_0x16ece7['params']['id']}},_0x542825={};_0x542825['model']=_['keys'](db['Variable'][_0x0d27('0x32')]);_0x542825['query']=_['keys'](_0x16ece7[_0x0d27('0x37')]);_0x542825[_0x0d27('0x38')]=_[_0x0d27('0x39')](_0x542825[_0x0d27('0x36')],_0x542825[_0x0d27('0x37')]);_0x15db0d[_0x0d27('0x3b')]=_[_0x0d27('0x39')](_0x542825[_0x0d27('0x36')],qs[_0x0d27('0x3a')](_0x16ece7[_0x0d27('0x37')][_0x0d27('0x3a')]));_0x15db0d[_0x0d27('0x3b')]=_0x15db0d['attributes'][_0x0d27('0x3c')]?_0x15db0d[_0x0d27('0x3b')]:_0x542825[_0x0d27('0x36')];if(_0x16ece7[_0x0d27('0x37')]['includeAll']){_0x15db0d[_0x0d27('0x46')]=[{'all':!![]}];}_0x15db0d=_[_0x0d27('0x43')]({},_0x15db0d,_0x16ece7[_0x0d27('0x44')]);return db['Variable']['find'](_0x15db0d)[_0x0d27('0x26')](handleEntityNotFound(_0x3236f9,null))['then'](respondWithResult(_0x3236f9,null))[_0x0d27('0x49')](handleError(_0x3236f9,null));};exports['create']=function(_0x40bdee,_0x256ea7){return db[_0x0d27('0x31')]['create'](_0x40bdee['body'],{})[_0x0d27('0x26')](function(_0x4a6902){var _0x1d01f4=_0x40bdee[_0x0d27('0x4a')][_0x0d27('0x27')]({'plain':!![]});if(!_0x1d01f4)throw new Error(_0x0d27('0x4b'));if(_0x1d01f4['role']===_0x0d27('0x4a')){var _0x3cb213=_0x4a6902[_0x0d27('0x27')]({'plain':!![]});var _0x56405f=_0x0d27('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x56405f,'userProfileId':_0x1d01f4[_0x0d27('0x4c')]},'raw':!![]})[_0x0d27('0x26')](function(_0xe06073){if(_0xe06073&&_0xe06073[_0x0d27('0x4d')]===0x0){return db[_0x0d27('0x29')]['create']({'name':_0x3cb213[_0x0d27('0x2d')],'resourceId':_0x3cb213['id'],'type':_0xe06073[_0x0d27('0x2d')],'sectionId':_0xe06073['id']},{})[_0x0d27('0x26')](function(){return _0x4a6902;});}else{return _0x4a6902;}})[_0x0d27('0x49')](function(_0x94bad){logger['error'](_0x0d27('0x4e'),_0x94bad);throw _0x94bad;});}return _0x4a6902;})['then'](respondWithResult(_0x256ea7,0xc9))[_0x0d27('0x49')](handleError(_0x256ea7,null));};exports[_0x0d27('0x24')]=function(_0x307361,_0x3a1e05){if(_0x307361[_0x0d27('0x4f')]['id']){delete _0x307361['body']['id'];}return db[_0x0d27('0x31')][_0x0d27('0x50')]({'where':{'id':_0x307361[_0x0d27('0x51')]['id']}})[_0x0d27('0x26')](handleEntityNotFound(_0x3a1e05,null))['then'](saveUpdates(_0x307361[_0x0d27('0x4f')],null))[_0x0d27('0x26')](respondWithResult(_0x3a1e05,null))['catch'](handleError(_0x3a1e05,null));};exports[_0x0d27('0x25')]=function(_0x2c3c64,_0x297ad7){return db[_0x0d27('0x31')][_0x0d27('0x50')]({'where':{'id':_0x2c3c64['params']['id']}})['then'](handleEntityNotFound(_0x297ad7,null))[_0x0d27('0x26')](removeEntity(_0x297ad7,null))[_0x0d27('0x49')](handleError(_0x297ad7,null));}; \ No newline at end of file +var _0xb713=['eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','update','then','destroy','get','Variables','UserProfileResource','name','index','Variable','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x2212d3,_0x324f32){var _0x51c05d=function(_0x376102){while(--_0x376102){_0x2212d3['push'](_0x2212d3['shift']());}};_0x51c05d(++_0x324f32);}(_0xb713,0xa0));var _0x3b71=function(_0x476b00,_0x250877){_0x476b00=_0x476b00-0x0;var _0x44ec8e=_0xb713[_0x476b00];return _0x44ec8e;};'use strict';var emlformat=require(_0x3b71('0x0'));var rimraf=require(_0x3b71('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3b71('0x2'));var moment=require(_0x3b71('0x3'));var BPromise=require(_0x3b71('0x4'));var Mustache=require(_0x3b71('0x5'));var util=require(_0x3b71('0x6'));var path=require(_0x3b71('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3b71('0x8'));var fs=require('fs');var fs_extra=require(_0x3b71('0x9'));var _=require(_0x3b71('0xa'));var squel=require(_0x3b71('0xb'));var crypto=require(_0x3b71('0xc'));var jsforce=require(_0x3b71('0xd'));var deskjs=require(_0x3b71('0xe'));var toCsv=require(_0x3b71('0xf'));var querystring=require(_0x3b71('0x10'));var Papa=require(_0x3b71('0x11'));var Redis=require(_0x3b71('0x12'));var authService=require(_0x3b71('0x13'));var qs=require(_0x3b71('0x14'));var as=require(_0x3b71('0x15'));var hardwareService=require(_0x3b71('0x16'));var logger=require(_0x3b71('0x17'))(_0x3b71('0x18'));var utils=require(_0x3b71('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3b71('0x1a'))['db'];function respondWithStatusCode(_0x5e2e18,_0x13ce84){_0x13ce84=_0x13ce84||0xcc;return function(_0x1a7f38){if(_0x1a7f38){return _0x5e2e18[_0x3b71('0x1b')](_0x13ce84);}return _0x5e2e18[_0x3b71('0x1c')](_0x13ce84)[_0x3b71('0x1d')]();};}function respondWithResult(_0x21d21c,_0x3b7f40){_0x3b7f40=_0x3b7f40||0xc8;return function(_0x4954cd){if(_0x4954cd){return _0x21d21c[_0x3b71('0x1c')](_0x3b7f40)[_0x3b71('0x1e')](_0x4954cd);}};}function respondWithFilteredResult(_0x505e4b,_0xabe91a){return function(_0xfa4f93){if(_0xfa4f93){var _0x175618=typeof _0xabe91a[_0x3b71('0x1f')]===_0x3b71('0x20')&&typeof _0xabe91a['limit']==='undefined';var _0x3aba28=_0xfa4f93[_0x3b71('0x21')];var _0x503a2f=_0x175618?0x0:_0xabe91a[_0x3b71('0x1f')];var _0x3311d2=_0x175618?_0xfa4f93[_0x3b71('0x21')]:_0xabe91a[_0x3b71('0x1f')]+_0xabe91a[_0x3b71('0x22')];var _0x3e26f5;if(_0x3311d2>=_0x3aba28){_0x3311d2=_0x3aba28;_0x3e26f5=0xc8;}else{_0x3e26f5=0xce;}_0x505e4b[_0x3b71('0x1c')](_0x3e26f5);return _0x505e4b['set']('Content-Range',_0x503a2f+'-'+_0x3311d2+'/'+_0x3aba28)[_0x3b71('0x1e')](_0xfa4f93);}return null;};}function patchUpdates(_0x50cc4d){return function(_0x2c0afb){try{jsonpatch['apply'](_0x2c0afb,_0x50cc4d,!![]);}catch(_0x5f2149){return BPromise['reject'](_0x5f2149);}return _0x2c0afb['save']();};}function saveUpdates(_0x2248de,_0x42b7bb){return function(_0x4a7da6){if(_0x4a7da6){return _0x4a7da6[_0x3b71('0x23')](_0x2248de)[_0x3b71('0x24')](function(_0x7a6a0d){return _0x7a6a0d;});}return null;};}function removeEntity(_0x25c638,_0x620c52){return function(_0x5e4b39){if(_0x5e4b39){return _0x5e4b39[_0x3b71('0x25')]()[_0x3b71('0x24')](function(){var _0x49b089=_0x5e4b39[_0x3b71('0x26')]({'plain':!![]});var _0x233c2b=_0x3b71('0x27');return db[_0x3b71('0x28')]['destroy']({'where':{'type':_0x233c2b,'resourceId':_0x49b089['id']}})[_0x3b71('0x24')](function(){return _0x5e4b39;});})[_0x3b71('0x24')](function(){_0x25c638['status'](0xcc)[_0x3b71('0x1d')]();});}};}function handleEntityNotFound(_0x7f98f4,_0x27eca9){return function(_0x4e8af7){if(!_0x4e8af7){_0x7f98f4['sendStatus'](0x194);}return _0x4e8af7;};}function handleError(_0x44ec24,_0x4d8ea7){_0x4d8ea7=_0x4d8ea7||0x1f4;return function(_0x54c6c1){logger['error'](_0x54c6c1['stack']);if(_0x54c6c1[_0x3b71('0x29')]){delete _0x54c6c1[_0x3b71('0x29')];}_0x44ec24[_0x3b71('0x1c')](_0x4d8ea7)['send'](_0x54c6c1);};}exports[_0x3b71('0x2a')]=function(_0x512648,_0x4061be){var _0x2e5701={},_0x10d287={},_0x4aad10={'count':0x0,'rows':[]};var _0x1c7df1=_['map'](db[_0x3b71('0x2b')][_0x3b71('0x2c')],function(_0x56a7bc){return{'name':_0x56a7bc[_0x3b71('0x2d')],'type':_0x56a7bc['type'][_0x3b71('0x2e')]};});_0x10d287[_0x3b71('0x2f')]=_[_0x3b71('0x30')](_0x1c7df1,_0x3b71('0x29'));_0x10d287[_0x3b71('0x31')]=_[_0x3b71('0x32')](_0x512648[_0x3b71('0x31')]);_0x10d287['filters']=_[_0x3b71('0x33')](_0x10d287['model'],_0x10d287[_0x3b71('0x31')]);_0x2e5701[_0x3b71('0x34')]=_[_0x3b71('0x33')](_0x10d287[_0x3b71('0x2f')],qs[_0x3b71('0x35')](_0x512648[_0x3b71('0x31')][_0x3b71('0x35')]));_0x2e5701[_0x3b71('0x34')]=_0x2e5701[_0x3b71('0x34')][_0x3b71('0x36')]?_0x2e5701[_0x3b71('0x34')]:_0x10d287[_0x3b71('0x2f')];if(!_0x512648[_0x3b71('0x31')][_0x3b71('0x37')]('nolimit')){_0x2e5701[_0x3b71('0x22')]=qs[_0x3b71('0x22')](_0x512648[_0x3b71('0x31')][_0x3b71('0x22')]);_0x2e5701[_0x3b71('0x1f')]=qs[_0x3b71('0x1f')](_0x512648[_0x3b71('0x31')][_0x3b71('0x1f')]);}_0x2e5701['order']=qs[_0x3b71('0x38')](_0x512648[_0x3b71('0x31')][_0x3b71('0x38')]);_0x2e5701[_0x3b71('0x39')]=qs['filters'](_[_0x3b71('0x3a')](_0x512648[_0x3b71('0x31')],_0x10d287[_0x3b71('0x3b')]),_0x1c7df1);if(_0x512648['query'][_0x3b71('0x3c')]){_0x2e5701[_0x3b71('0x39')]=_[_0x3b71('0x3d')](_0x2e5701[_0x3b71('0x39')],{'$or':_[_0x3b71('0x30')](_0x1c7df1,function(_0x45d07c){if(_0x45d07c[_0x3b71('0x3e')]!==_0x3b71('0x3f')){var _0x7d465f={};_0x7d465f[_0x45d07c['name']]={'$like':'%'+_0x512648[_0x3b71('0x31')]['filter']+'%'};return _0x7d465f;}})});}_0x2e5701=_[_0x3b71('0x3d')]({},_0x2e5701,_0x512648[_0x3b71('0x40')]);var _0x4521c8={'where':_0x2e5701[_0x3b71('0x39')]};return db['Variable']['count'](_0x4521c8)[_0x3b71('0x24')](function(_0x391125){_0x4aad10[_0x3b71('0x21')]=_0x391125;if(_0x512648['query']['includeAll']){_0x2e5701['include']=[{'all':!![]}];}return db[_0x3b71('0x2b')][_0x3b71('0x41')](_0x2e5701);})[_0x3b71('0x24')](function(_0x2bc54a){_0x4aad10[_0x3b71('0x42')]=_0x2bc54a;return _0x4aad10;})[_0x3b71('0x24')](respondWithFilteredResult(_0x4061be,_0x2e5701))[_0x3b71('0x43')](handleError(_0x4061be,null));};exports[_0x3b71('0x44')]=function(_0x28f9b5,_0xd7818d){var _0x2ed0b3={'raw':!![],'where':{'id':_0x28f9b5[_0x3b71('0x45')]['id']}},_0x1e6f99={};_0x1e6f99[_0x3b71('0x2f')]=_['keys'](db['Variable'][_0x3b71('0x2c')]);_0x1e6f99['query']=_[_0x3b71('0x32')](_0x28f9b5[_0x3b71('0x31')]);_0x1e6f99[_0x3b71('0x3b')]=_['intersection'](_0x1e6f99[_0x3b71('0x2f')],_0x1e6f99[_0x3b71('0x31')]);_0x2ed0b3[_0x3b71('0x34')]=_[_0x3b71('0x33')](_0x1e6f99['model'],qs[_0x3b71('0x35')](_0x28f9b5['query'][_0x3b71('0x35')]));_0x2ed0b3['attributes']=_0x2ed0b3[_0x3b71('0x34')]['length']?_0x2ed0b3[_0x3b71('0x34')]:_0x1e6f99[_0x3b71('0x2f')];if(_0x28f9b5[_0x3b71('0x31')][_0x3b71('0x46')]){_0x2ed0b3['include']=[{'all':!![]}];}_0x2ed0b3=_[_0x3b71('0x3d')]({},_0x2ed0b3,_0x28f9b5['options']);return db['Variable'][_0x3b71('0x47')](_0x2ed0b3)[_0x3b71('0x24')](handleEntityNotFound(_0xd7818d,null))[_0x3b71('0x24')](respondWithResult(_0xd7818d,null))[_0x3b71('0x43')](handleError(_0xd7818d,null));};exports[_0x3b71('0x48')]=function(_0x44c809,_0x3fc510){return db[_0x3b71('0x2b')][_0x3b71('0x48')](_0x44c809[_0x3b71('0x49')],{})['then'](function(_0x4771c3){var _0x4c37db=_0x44c809[_0x3b71('0x4a')][_0x3b71('0x26')]({'plain':!![]});if(!_0x4c37db)throw new Error(_0x3b71('0x4b'));if(_0x4c37db[_0x3b71('0x4c')]==='user'){var _0x3337ca=_0x4771c3[_0x3b71('0x26')]({'plain':!![]});var _0x4ce519=_0x3b71('0x27');return db[_0x3b71('0x4d')][_0x3b71('0x47')]({'where':{'name':_0x4ce519,'userProfileId':_0x4c37db[_0x3b71('0x4e')]},'raw':!![]})['then'](function(_0x24a29f){if(_0x24a29f&&_0x24a29f[_0x3b71('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x3337ca['name'],'resourceId':_0x3337ca['id'],'type':_0x24a29f['name'],'sectionId':_0x24a29f['id']},{})[_0x3b71('0x24')](function(){return _0x4771c3;});}else{return _0x4771c3;}})[_0x3b71('0x43')](function(_0x49a290){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a290);throw _0x49a290;});}return _0x4771c3;})[_0x3b71('0x24')](respondWithResult(_0x3fc510,0xc9))['catch'](handleError(_0x3fc510,null));};exports[_0x3b71('0x23')]=function(_0x40dc6d,_0xf6b2ac){if(_0x40dc6d[_0x3b71('0x49')]['id']){delete _0x40dc6d[_0x3b71('0x49')]['id'];}return db[_0x3b71('0x2b')][_0x3b71('0x47')]({'where':{'id':_0x40dc6d['params']['id']}})[_0x3b71('0x24')](handleEntityNotFound(_0xf6b2ac,null))[_0x3b71('0x24')](saveUpdates(_0x40dc6d[_0x3b71('0x49')],null))[_0x3b71('0x24')](respondWithResult(_0xf6b2ac,null))[_0x3b71('0x43')](handleError(_0xf6b2ac,null));};exports[_0x3b71('0x25')]=function(_0x123681,_0x588f0b){return db[_0x3b71('0x2b')][_0x3b71('0x47')]({'where':{'id':_0x123681[_0x3b71('0x45')]['id']}})['then'](handleEntityNotFound(_0x588f0b,null))[_0x3b71('0x24')](removeEntity(_0x588f0b,null))[_0x3b71('0x43')](handleError(_0x588f0b,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 9e5d3e2..23972d4 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 _0xdea8=['bluebird','request-promise','path','./variable.attributes','exports','Variable','tools_variables','lodash','../../config/logger','api','moment'];(function(_0x263cb4,_0x53ce57){var _0x32a04b=function(_0x31e87b){while(--_0x31e87b){_0x263cb4['push'](_0x263cb4['shift']());}};_0x32a04b(++_0x53ce57);}(_0xdea8,0x1b4));var _0x8dea=function(_0x55187a,_0x15f89a){_0x55187a=_0x55187a-0x0;var _0x494f79=_0xdea8[_0x55187a];return _0x494f79;};'use strict';var _=require(_0x8dea('0x0'));var util=require('util');var logger=require(_0x8dea('0x1'))(_0x8dea('0x2'));var moment=require(_0x8dea('0x3'));var BPromise=require(_0x8dea('0x4'));var rp=require(_0x8dea('0x5'));var fs=require('fs');var path=require(_0x8dea('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8dea('0x7'));module[_0x8dea('0x8')]=function(_0x10e752,_0x2dd9a1){return _0x10e752['define'](_0x8dea('0x9'),attributes,{'tableName':_0x8dea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ac1=['exports','Variable','tools_variables','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes'];(function(_0xad36ff,_0x4e0bc7){var _0x3b8496=function(_0x265561){while(--_0x265561){_0xad36ff['push'](_0xad36ff['shift']());}};_0x3b8496(++_0x4e0bc7);}(_0x6ac1,0x1bd));var _0x16ac=function(_0x558849,_0x113740){_0x558849=_0x558849-0x0;var _0x4149cd=_0x6ac1[_0x558849];return _0x4149cd;};'use strict';var _=require(_0x16ac('0x0'));var util=require(_0x16ac('0x1'));var logger=require(_0x16ac('0x2'))(_0x16ac('0x3'));var moment=require(_0x16ac('0x4'));var BPromise=require(_0x16ac('0x5'));var rp=require(_0x16ac('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x16ac('0x7'));var config=require(_0x16ac('0x8'));var attributes=require(_0x16ac('0x9'));module[_0x16ac('0xa')]=function(_0x57dded,_0x5424a9){return _0x57dded['define'](_0x16ac('0xb'),attributes,{'tableName':_0x16ac('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 1652c39..7ede9da 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 _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(_0x27cbc0,_0x1466f8){var _0x43d9ae=function(_0x4f9302){while(--_0x4f9302){_0x27cbc0['push'](_0x27cbc0['shift']());}};_0x43d9ae(++_0x1466f8);}(_0x814b,0x1a2));var _0xb814=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0x814b[_0x588011];return _0x3b3773;};'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 +var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xa41a,0x6b));var _0xaa41=function(_0x4627fb,_0x23f8a2){_0x4627fb=_0x4627fb-0x0;var _0x5740c4=_0xa41a[_0x4627fb];return _0x5740c4;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 8d1630e..e717ced 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 _0x0f67=['reset','/pull','pull','/restart','restart','/migrations','migrations','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/reset'];(function(_0x3e1c71,_0x684e05){var _0x1b71d1=function(_0x19897d){while(--_0x19897d){_0x3e1c71['push'](_0x3e1c71['shift']());}};_0x1b71d1(++_0x684e05);}(_0x0f67,0x1c7));var _0x70f6=function(_0x1d9aad,_0x1c2e75){_0x1d9aad=_0x1d9aad-0x0;var _0xfc20ce=_0x0f67[_0x1d9aad];return _0xfc20ce;};'use strict';var express=require('express');var router=express[_0x70f6('0x0')]();var auth=require(_0x70f6('0x1'));var controller=require(_0x70f6('0x2'));router[_0x70f6('0x3')]('/',controller[_0x70f6('0x4')]);router[_0x70f6('0x3')](_0x70f6('0x5'),auth[_0x70f6('0x6')](),auth[_0x70f6('0x7')](),controller['fetch']);router[_0x70f6('0x3')](_0x70f6('0x8'),auth[_0x70f6('0x6')](),auth[_0x70f6('0x7')](),controller[_0x70f6('0x9')]);router[_0x70f6('0x3')](_0x70f6('0xa'),auth[_0x70f6('0x6')](),auth['canUpdate'](),controller[_0x70f6('0xb')]);router[_0x70f6('0x3')](_0x70f6('0xc'),auth[_0x70f6('0x6')](),controller[_0x70f6('0xd')]);router[_0x70f6('0x3')](_0x70f6('0xe'),controller[_0x70f6('0xf')]);module['exports']=router; \ No newline at end of file +var _0x62cf=['/restart','restart','/migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','fetch','/reset','canUpdate','reset','/pull'];(function(_0x3a96b8,_0x4142a3){var _0x20fb74=function(_0x3f68c0){while(--_0x3f68c0){_0x3a96b8['push'](_0x3a96b8['shift']());}};_0x20fb74(++_0x4142a3);}(_0x62cf,0x114));var _0xf62c=function(_0x2e68a6,_0x17e06a){_0x2e68a6=_0x2e68a6-0x0;var _0x46ccbe=_0x62cf[_0x2e68a6];return _0x46ccbe;};'use strict';var express=require(_0xf62c('0x0'));var router=express[_0xf62c('0x1')]();var auth=require(_0xf62c('0x2'));var controller=require(_0xf62c('0x3'));router[_0xf62c('0x4')]('/',controller[_0xf62c('0x5')]);router['get'](_0xf62c('0x6'),auth[_0xf62c('0x7')](),auth['canUpdate'](),controller[_0xf62c('0x8')]);router[_0xf62c('0x4')](_0xf62c('0x9'),auth[_0xf62c('0x7')](),auth[_0xf62c('0xa')](),controller[_0xf62c('0xb')]);router[_0xf62c('0x4')](_0xf62c('0xc'),auth['isAuthenticated'](),auth[_0xf62c('0xa')](),controller['pull']);router[_0xf62c('0x4')](_0xf62c('0xd'),auth[_0xf62c('0x7')](),controller[_0xf62c('0xe')]);router[_0xf62c('0x4')](_0xf62c('0xf'),controller['migrations']);module[_0xf62c('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 967b6c4..a386794 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 _0x4c0f=['../../mysqldb','../../config/environment','simple-git','root','exports','version','query','latest','fetch','tags','2.0.0','status','json','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','map','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','exec'];(function(_0x4aca79,_0x2866fb){var _0x4b5827=function(_0x7c9089){while(--_0x7c9089){_0x4aca79['push'](_0x4aca79['shift']());}};_0x4b5827(++_0x2866fb);}(_0x4c0f,0x129));var _0xf4c0=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x4c0f[_0x138adb];return _0x1b27f2;};'use strict';var Umzug=require(_0xf4c0('0x0'));var path=require(_0xf4c0('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,'version');var compareVersions=require('compare-versions');var exec=require('child_process')[_0xf4c0('0x2')];var db=require(_0xf4c0('0x3'))['db'];var config=require(_0xf4c0('0x4'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')('update');var git=require(_0xf4c0('0x5'))(config[_0xf4c0('0x6')]);exports['index']=function(_0x588ed7,_0x1322b7){var _0x6647c2={'current':module[_0xf4c0('0x7')][_0xf4c0('0x8')],'phonebar':0x2};if(_0x588ed7[_0xf4c0('0x9')]&&_0x588ed7[_0xf4c0('0x9')][_0xf4c0('0xa')]){return git[_0xf4c0('0xb')]()[_0xf4c0('0xc')](function(_0x377c6d,_0x358df4){_0x6647c2['latest']=(_0x377c6d?module['exports']['version']:_0x358df4['latest'])||_0xf4c0('0xd');return _0x1322b7[_0xf4c0('0xe')](0xc8)[_0xf4c0('0xf')](_0x6647c2);});}else{return _0x1322b7[_0xf4c0('0xe')](0xc8)['json'](_0x6647c2);}};exports[_0xf4c0('0xb')]=function(_0x43b4b6,_0x71d3cf){return git[_0xf4c0('0xb')]([_0xf4c0('0x10'),'master'],function(_0xe3560f){if(_0xe3560f){logger[_0xf4c0('0x11')](_0xe3560f);return _0x71d3cf[_0xf4c0('0xe')](0x1f4)[_0xf4c0('0xf')](_0xe3560f);}logger[_0xf4c0('0x12')](_0xf4c0('0x13'));return _0x71d3cf['status'](0xc8)[_0xf4c0('0xf')]({'output':_0xf4c0('0x14')});});};exports[_0xf4c0('0x15')]=function(_0x14fd6a,_0x53bd85){return git[_0xf4c0('0x15')]([_0xf4c0('0x16'),_0xf4c0('0x17')],function(_0x423e29){if(_0x423e29){logger['error'](_0x423e29);return _0x53bd85['status'](0x1f4)[_0xf4c0('0xf')](_0x423e29);}logger[_0xf4c0('0x12')](_0xf4c0('0x18'));return _0x53bd85[_0xf4c0('0xe')](0xc8)[_0xf4c0('0xf')]({'output':'git\x20reset\x20--hard'});});};exports[_0xf4c0('0x19')]=function(_0x42cacf,_0x5ec56d){exec(_0xf4c0('0x1a'),function(_0x54edec,_0x27bc9d,_0x2263a0){logger[_0xf4c0('0x12')](_0x27bc9d);logger['info'](_0x2263a0);if(_0x54edec){logger[_0xf4c0('0x11')](_0x54edec);return _0x5ec56d[_0xf4c0('0xe')](0x1f4)['json'](_0x54edec);}return _0x5ec56d[_0xf4c0('0xe')](0xc8)[_0xf4c0('0xf')]({'output':_0x27bc9d});});};exports[_0xf4c0('0x1b')]=function(_0x71f001,_0x233705){return pm2[_0xf4c0('0x1b')](_0xf4c0('0x1c'))[_0xf4c0('0x1d')](function(_0x19c0b0){logger[_0xf4c0('0x12')](_0xf4c0('0x1e'),_0x19c0b0);return _0x233705[_0xf4c0('0xe')](0xc8)[_0xf4c0('0xf')]({'output':_0xf4c0('0x1f')});})[_0xf4c0('0x20')](function(_0x1d6512){logger[_0xf4c0('0x11')](_0x1d6512);return _0x233705[_0xf4c0('0xe')](0x1f4)[_0xf4c0('0xf')](_0x1d6512);});};exports[_0xf4c0('0x21')]=function(_0x38f74b,_0x214bf4){var _0x28364e=fs[_0xf4c0('0x22')](path[_0xf4c0('0x23')](config[_0xf4c0('0x6')],_0xf4c0('0x24'),_0xf4c0('0x21')));var _0x45a176=[];for(var _0x451921=0x0;_0x451921<_0x28364e[_0xf4c0('0x25')];_0x451921++){var _0x4e9c62=_0x28364e[_0x451921]['replace'](_0xf4c0('0x26'),'');if(compareVersions(module['exports']['version'],_0x4e9c62)===-0x1){_0x45a176[_0xf4c0('0x27')](_0x4e9c62);}}if(_0x45a176[_0xf4c0('0x25')]){var _0x39e40a=_0x45a176[_0xf4c0('0x28')](compareVersions);var _0x5d0340=new Umzug({'storage':_0xf4c0('0x29'),'storageOptions':{'model':db[_0xf4c0('0x2a')],'modelName':_0xf4c0('0x2a'),'columnName':_0xf4c0('0x8')},'migrations':{'params':[db[_0xf4c0('0x29')][_0xf4c0('0x2b')](),db[_0xf4c0('0x29')][_0xf4c0('0x2c')],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[_0xf4c0('0x23')](config[_0xf4c0('0x6')],_0xf4c0('0x24'),_0xf4c0('0x21')),'pattern':/\.js$/}});_0x5d0340['up']({'migrations':_[_0xf4c0('0x2d')](_0x39e40a,function(_0x1e0db5){return _0x1e0db5+_0xf4c0('0x26');})})['then'](function(){return _0x214bf4[_0xf4c0('0xe')](0xc8)[_0xf4c0('0xf')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xf4c0('0x7')][_0xf4c0('0x8')]+_0xf4c0('0x2e')+_[_0xf4c0('0x2f')](_0x39e40a),'migrations':_[_0xf4c0('0x23')](_0x39e40a)});})[_0xf4c0('0x20')](function(_0x2505b8){if(_0x2505b8 instanceof db[_0xf4c0('0x29')][_0xf4c0('0x30')]){return _0x214bf4[_0xf4c0('0xe')](0xc8)[_0xf4c0('0xf')]({'output':_0xf4c0('0x31')});}else{return _0x214bf4[_0xf4c0('0xe')](0x1f4)['json'](_0x2505b8);}});}else{return _0x214bf4['status'](0xc8)[_0xf4c0('0xf')]({'output':_0xf4c0('0x31')});}}; \ No newline at end of file +var _0x962d=['reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard','pull','npm\x20install\x20--production','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','root','server','length','replace','push','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','.js','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','index','exports','version','latest','tags','status','json','fetch','origin','master','info'];(function(_0x5badb8,_0x414c2f){var _0xaea164=function(_0x1aa4ac){while(--_0x1aa4ac){_0x5badb8['push'](_0x5badb8['shift']());}};_0xaea164(++_0x414c2f);}(_0x962d,0xb1));var _0xd962=function(_0x5b8b97,_0x6b4dfa){_0x5b8b97=_0x5b8b97-0x0;var _0x1fdf84=_0x962d[_0x5b8b97];return _0x1fdf84;};'use strict';var Umzug=require(_0xd962('0x0'));var path=require(_0xd962('0x1'));var fs=require('fs');var _=require(_0xd962('0x2'));var pkginfo=require(_0xd962('0x3'))(module,'version');var compareVersions=require(_0xd962('0x4'));var exec=require(_0xd962('0x5'))[_0xd962('0x6')];var db=require(_0xd962('0x7'))['db'];var config=require(_0xd962('0x8'));var pm2=require(_0xd962('0x9'));var logger=require('../../config/logger')(_0xd962('0xa'));var git=require(_0xd962('0xb'))(config['root']);exports[_0xd962('0xc')]=function(_0xf54de9,_0x26f18a){var _0x4874d4={'current':module[_0xd962('0xd')][_0xd962('0xe')],'phonebar':0x2};if(_0xf54de9['query']&&_0xf54de9['query'][_0xd962('0xf')]){return git['fetch']()[_0xd962('0x10')](function(_0x1b8ee3,_0x503eed){_0x4874d4[_0xd962('0xf')]=(_0x1b8ee3?module[_0xd962('0xd')][_0xd962('0xe')]:_0x503eed[_0xd962('0xf')])||'2.0.0';return _0x26f18a[_0xd962('0x11')](0xc8)[_0xd962('0x12')](_0x4874d4);});}else{return _0x26f18a['status'](0xc8)[_0xd962('0x12')](_0x4874d4);}};exports['fetch']=function(_0x4c71ad,_0x3c989f){return git[_0xd962('0x13')]([_0xd962('0x14'),_0xd962('0x15')],function(_0x21b5e0){if(_0x21b5e0){logger['error'](_0x21b5e0);return _0x3c989f[_0xd962('0x11')](0x1f4)[_0xd962('0x12')](_0x21b5e0);}logger[_0xd962('0x16')]('git\x20fetch');return _0x3c989f['status'](0xc8)[_0xd962('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xd962('0x17')]=function(_0x14ad50,_0x44fbbe){return git['reset']([_0xd962('0x18'),_0xd962('0x19')],function(_0x327c58){if(_0x327c58){logger[_0xd962('0x1a')](_0x327c58);return _0x44fbbe['status'](0x1f4)[_0xd962('0x12')](_0x327c58);}logger[_0xd962('0x16')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x44fbbe[_0xd962('0x11')](0xc8)[_0xd962('0x12')]({'output':_0xd962('0x1b')});});};exports[_0xd962('0x1c')]=function(_0x1f45bf,_0x5d83c7){exec(_0xd962('0x1d'),function(_0x2964e3,_0x101332,_0x14ea49){logger[_0xd962('0x16')](_0x101332);logger[_0xd962('0x16')](_0x14ea49);if(_0x2964e3){logger[_0xd962('0x1a')](_0x2964e3);return _0x5d83c7[_0xd962('0x11')](0x1f4)[_0xd962('0x12')](_0x2964e3);}return _0x5d83c7[_0xd962('0x11')](0xc8)[_0xd962('0x12')]({'output':_0x101332});});};exports['restart']=function(_0x37e9b5,_0x3c4e6f){return pm2['restart'](_0xd962('0x1e'))[_0xd962('0x1f')](function(_0x11740b){logger[_0xd962('0x16')](_0xd962('0x20'),_0x11740b);return _0x3c4e6f[_0xd962('0x11')](0xc8)[_0xd962('0x12')]({'output':_0xd962('0x21')});})[_0xd962('0x22')](function(_0x372dcd){logger[_0xd962('0x1a')](_0x372dcd);return _0x3c4e6f[_0xd962('0x11')](0x1f4)[_0xd962('0x12')](_0x372dcd);});};exports[_0xd962('0x23')]=function(_0xb9448c,_0xe6710){var _0x3d2abc=fs['readdirSync'](path[_0xd962('0x24')](config[_0xd962('0x25')],_0xd962('0x26'),_0xd962('0x23')));var _0x33cc00=[];for(var _0x53cf06=0x0;_0x53cf06<_0x3d2abc[_0xd962('0x27')];_0x53cf06++){var _0x52dc2b=_0x3d2abc[_0x53cf06][_0xd962('0x28')]('.js','');if(compareVersions(module[_0xd962('0xd')]['version'],_0x52dc2b)===-0x1){_0x33cc00[_0xd962('0x29')](_0x52dc2b);}}if(_0x33cc00[_0xd962('0x27')]){var _0x1e57c3=_0x33cc00['sort'](compareVersions);var _0x4c924b=new Umzug({'storage':_0xd962('0x2a'),'storageOptions':{'model':db['Migration'],'modelName':_0xd962('0x2b'),'columnName':_0xd962('0xe')},'migrations':{'params':[db[_0xd962('0x2a')][_0xd962('0x2c')](),db[_0xd962('0x2a')][_0xd962('0x2d')],function(){throw new Error(_0xd962('0x2e'));}],'path':path[_0xd962('0x24')](config[_0xd962('0x25')],'server','migrations'),'pattern':/\.js$/}});_0x4c924b['up']({'migrations':_['map'](_0x1e57c3,function(_0x3dd2c5){return _0x3dd2c5+_0xd962('0x2f');})})[_0xd962('0x1f')](function(){return _0xe6710[_0xd962('0x11')](0xc8)[_0xd962('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xd962('0xd')][_0xd962('0xe')]+'\x20to\x20'+_['last'](_0x1e57c3),'migrations':_['join'](_0x1e57c3)});})[_0xd962('0x22')](function(_0x1edf9c){if(_0x1edf9c instanceof db[_0xd962('0x2a')][_0xd962('0x30')]){return _0xe6710[_0xd962('0x11')](0xc8)[_0xd962('0x12')]({'output':'Database\x20already\x20up-to-date'});}else{return _0xe6710[_0xd962('0x11')](0x1f4)[_0xd962('0x12')](_0x1edf9c);}});}else{return _0xe6710['status'](0xc8)[_0xd962('0x12')]({'output':_0xd962('0x31')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index ac323d4..6618197 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 _0xa6b0=['../../components/interaction/service','./voiceAgentReport.controller','get','index','/describe','isAuthenticated','/:id','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x21cc03,_0x143bb2){var _0x53f415=function(_0x408dd4){while(--_0x408dd4){_0x21cc03['push'](_0x21cc03['shift']());}};_0x53f415(++_0x143bb2);}(_0xa6b0,0x175));var _0x0a6b=function(_0xb10d68,_0x126383){_0xb10d68=_0xb10d68-0x0;var _0x5a7715=_0xa6b0[_0xb10d68];return _0x5a7715;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require(_0x0a6b('0x2'));var timeout=require('connect-timeout');var express=require(_0x0a6b('0x3'));var router=express[_0x0a6b('0x4')]();var fs_extra=require(_0x0a6b('0x5'));var auth=require(_0x0a6b('0x6'));var interaction=require(_0x0a6b('0x7'));var config=require('../../config/environment');var controller=require(_0x0a6b('0x8'));router[_0x0a6b('0x9')]('/',auth['isAuthenticated'](),controller[_0x0a6b('0xa')]);router[_0x0a6b('0x9')](_0x0a6b('0xb'),auth[_0x0a6b('0xc')](),controller['describe']);router[_0x0a6b('0x9')](_0x0a6b('0xd'),auth[_0x0a6b('0xc')](),controller['show']);router['post']('/',auth[_0x0a6b('0xc')](),controller['create']);router[_0x0a6b('0xe')](_0x0a6b('0xd'),auth['isAuthenticated'](),controller[_0x0a6b('0xf')]);router[_0x0a6b('0x10')](_0x0a6b('0xd'),auth[_0x0a6b('0xc')](),controller[_0x0a6b('0x11')]);module[_0x0a6b('0x12')]=router; \ No newline at end of file +var _0xef11=['show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','get','isAuthenticated','describe','/:id'];(function(_0x3c222b,_0x5d2eb7){var _0xd9fdbb=function(_0x3aa0d2){while(--_0x3aa0d2){_0x3c222b['push'](_0x3c222b['shift']());}};_0xd9fdbb(++_0x5d2eb7);}(_0xef11,0xf5));var _0x1ef1=function(_0x2077c2,_0x275ab5){_0x2077c2=_0x2077c2-0x0;var _0x312f9f=_0xef11[_0x2077c2];return _0x312f9f;};'use strict';var multer=require(_0x1ef1('0x0'));var util=require(_0x1ef1('0x1'));var path=require(_0x1ef1('0x2'));var timeout=require(_0x1ef1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1ef1('0x4'));var auth=require(_0x1ef1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0x1ef1('0x6')]('/',auth[_0x1ef1('0x7')](),controller['index']);router[_0x1ef1('0x6')]('/describe',auth[_0x1ef1('0x7')](),controller[_0x1ef1('0x8')]);router[_0x1ef1('0x6')](_0x1ef1('0x9'),auth['isAuthenticated'](),controller[_0x1ef1('0xa')]);router[_0x1ef1('0xb')]('/',auth[_0x1ef1('0x7')](),controller[_0x1ef1('0xc')]);router[_0x1ef1('0xd')](_0x1ef1('0x9'),auth[_0x1ef1('0x7')](),controller['update']);router[_0x1ef1('0xe')](_0x1ef1('0x9'),auth[_0x1ef1('0x7')](),controller[_0x1ef1('0xf')]);module[_0x1ef1('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 354a8cf..1b23a0c 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 _0xa693=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x588f19,_0x296c57){var _0x2ce72b=function(_0xa41926){while(--_0xa41926){_0x588f19['push'](_0x588f19['shift']());}};_0x2ce72b(++_0x296c57);}(_0xa693,0xf1));var _0x3a69=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa693[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x3a69('0x0'));module[_0x3a69('0x1')]={'type':{'type':Sequelize[_0x3a69('0x2')]},'uniqueid':{'type':Sequelize[_0x3a69('0x2')]},'calleridnum':{'type':Sequelize[_0x3a69('0x2')]},'calleridname':{'type':Sequelize[_0x3a69('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x3a69('0x3')]},'agentconnectAt':{'type':Sequelize[_0x3a69('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x3a69('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x3a69('0x3')]},'agentdumpAt':{'type':Sequelize[_0x3a69('0x3')]},'holdtime':{'type':Sequelize[_0x3a69('0x4')]},'agentcomplete':{'type':Sequelize[_0x3a69('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x3a69('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x3a69('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x3a69('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x3a69('0x4')]},'channelstatedesc':{'type':Sequelize[_0x3a69('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3a69('0x2')]},'connectedlinename':{'type':Sequelize[_0x3a69('0x2')]},'language':{'type':Sequelize[_0x3a69('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x3a69('0x2')]},'exten':{'type':Sequelize[_0x3a69('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x3a69('0x2')]},'destchannelstate':{'type':Sequelize[_0x3a69('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x3a69('0x2')]},'destcalleridnum':{'type':Sequelize[_0x3a69('0x2')]},'destcalleridname':{'type':Sequelize[_0x3a69('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x3a69('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x3a69('0x2')]},'destlanguage':{'type':Sequelize[_0x3a69('0x2')]},'destaccountcode':{'type':Sequelize[_0x3a69('0x2')]},'destcontext':{'type':Sequelize[_0x3a69('0x2')]},'destexten':{'type':Sequelize[_0x3a69('0x2')]},'destpriority':{'type':Sequelize[_0x3a69('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x3a69('0x2')]},'transfer':{'type':Sequelize[_0x3a69('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3a69('0x2')],'comment':_0x3a69('0x6')},'transferexten':{'type':Sequelize[_0x3a69('0x2')]},'transferuniqueid':{'type':Sequelize[_0x3a69('0x2')]},'agententerreason':{'type':Sequelize[_0x3a69('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x36ee=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','STRING','DATE','INTEGER'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xe36e('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe36e('0x0')]},'calleridname':{'type':Sequelize[_0xe36e('0x0')]},'queue':{'type':Sequelize[_0xe36e('0x0')]},'interface':{'type':Sequelize[_0xe36e('0x0')]},'membername':{'type':Sequelize[_0xe36e('0x0')]},'agentcalledAt':{'type':Sequelize[_0xe36e('0x1')]},'agentconnectAt':{'type':Sequelize[_0xe36e('0x1')]},'agentcompleteAt':{'type':Sequelize[_0xe36e('0x1')]},'agentringnoanswerAt':{'type':Sequelize[_0xe36e('0x1')]},'agentdumpAt':{'type':Sequelize[_0xe36e('0x1')]},'holdtime':{'type':Sequelize[_0xe36e('0x2')]},'agentcomplete':{'type':Sequelize[_0xe36e('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xe36e('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xe36e('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe36e('0x2')]},'reason':{'type':Sequelize[_0xe36e('0x0')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe36e('0x0')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe36e('0x0')]},'connectedlinenum':{'type':Sequelize[_0xe36e('0x0')]},'connectedlinename':{'type':Sequelize[_0xe36e('0x0')]},'language':{'type':Sequelize[_0xe36e('0x0')]},'accountcode':{'type':Sequelize[_0xe36e('0x0')]},'context':{'type':Sequelize[_0xe36e('0x0')]},'exten':{'type':Sequelize[_0xe36e('0x0')]},'priority':{'type':Sequelize[_0xe36e('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xe36e('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xe36e('0x0')]},'destcalleridnum':{'type':Sequelize[_0xe36e('0x0')]},'destcalleridname':{'type':Sequelize[_0xe36e('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xe36e('0x0')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xe36e('0x0')]},'destexten':{'type':Sequelize[_0xe36e('0x0')]},'destpriority':{'type':Sequelize[_0xe36e('0x0')]},'destuniqueid':{'type':Sequelize[_0xe36e('0x0')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xe36e('0x0')]},'answeredelsewheremembername':{'type':Sequelize[_0xe36e('0x0')]},'transfer':{'type':Sequelize[_0xe36e('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe36e('0x0')],'comment':_0xe36e('0x4')},'transferexten':{'type':Sequelize[_0xe36e('0x0')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xe36e('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 5d672f7..0b6121c 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(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 d02a76a..26cc107 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 _0xb4c7=['moment','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','define','report_agent','uniqueid','lodash','util','../../config/logger','api'];(function(_0x1bb2e4,_0x244229){var _0x4db487=function(_0x4a720f){while(--_0x4a720f){_0x1bb2e4['push'](_0x1bb2e4['shift']());}};_0x4db487(++_0x244229);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4e23c7,_0x54025a){_0x4e23c7=_0x4e23c7-0x0;var _0x1b83d8=_0xb4c7[_0x4e23c7];return _0x1b83d8;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var logger=require(_0x7b4c('0x2'))(_0x7b4c('0x3'));var moment=require(_0x7b4c('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b4c('0x5'));var fs=require('fs');var path=require(_0x7b4c('0x6'));var rimraf=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var attributes=require(_0x7b4c('0x9'));module['exports']=function(_0x1b0f57,_0x10e197){return _0x1b0f57[_0x7b4c('0xa')]('VoiceAgentReport',attributes,{'tableName':_0x7b4c('0xb'),'paranoid':![],'indexes':[{'fields':[_0x7b4c('0xc'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf041=['bluebird','path','../../config/environment','define','VoiceAgentReport','report_agent','uniqueid','../../config/logger','api','moment'];(function(_0x541095,_0x582b30){var _0x5a2c40=function(_0xb7650f){while(--_0xb7650f){_0x541095['push'](_0x541095['shift']());}};_0x5a2c40(++_0x582b30);}(_0xf041,0x15b));var _0x1f04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf041[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f04('0x0'))(_0x1f04('0x1'));var moment=require(_0x1f04('0x2'));var BPromise=require(_0x1f04('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f04('0x4'));var rimraf=require('rimraf');var config=require(_0x1f04('0x5'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x25d578,_0x504d71){return _0x25d578[_0x1f04('0x6')](_0x1f04('0x7'),attributes,{'tableName':_0x1f04('0x8'),'paranoid':![],'indexes':[{'fields':[_0x1f04('0x9'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index f7b7131..871b033 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 _0xffc2=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','VoiceAgentReport','create','options','raw','debug','UpdateVoiceAgentReport','update','where','attributes','lodash'];(function(_0x5c3d11,_0x589686){var _0x31e455=function(_0x251512){while(--_0x251512){_0x5c3d11['push'](_0x5c3d11['shift']());}};_0x31e455(++_0x589686);}(_0xffc2,0x173));var _0x2ffc=function(_0x1f0448,_0xa2865f){_0x1f0448=_0x1f0448-0x0;var _0x16fe78=_0xffc2[_0x1f0448];return _0x16fe78;};'use strict';var _=require(_0x2ffc('0x0'));var util=require(_0x2ffc('0x1'));var moment=require(_0x2ffc('0x2'));var BPromise=require(_0x2ffc('0x3'));var rs=require(_0x2ffc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ffc('0x5'))['db'];var utils=require(_0x2ffc('0x6'));var logger=require(_0x2ffc('0x7'))('rpc');var config=require(_0x2ffc('0x8'));var jayson=require(_0x2ffc('0x9'));var client=jayson[_0x2ffc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x559e92,_0x361c9c,_0x49a0e4){return new BPromise(function(_0x440376,_0xe1f550){return client['request'](_0x559e92,_0x49a0e4)[_0x2ffc('0xb')](function(_0x53d181){logger['info'](_0x2ffc('0xc'),_0x361c9c,'request\x20sent');logger['debug'](_0x2ffc('0xd'),_0x361c9c,'request\x20sent',JSON[_0x2ffc('0xe')](_0x53d181));if(_0x53d181[_0x2ffc('0xf')]){if(_0x53d181[_0x2ffc('0xf')][_0x2ffc('0x10')]===0x1f4){logger[_0x2ffc('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x361c9c,_0x53d181[_0x2ffc('0xf')][_0x2ffc('0x11')]);return _0xe1f550(_0x53d181[_0x2ffc('0xf')][_0x2ffc('0x11')]);}logger['error'](_0x2ffc('0xc'),_0x361c9c,_0x53d181[_0x2ffc('0xf')][_0x2ffc('0x11')]);return _0x440376(_0x53d181['error'][_0x2ffc('0x11')]);}else{logger[_0x2ffc('0x12')](_0x2ffc('0xc'),_0x361c9c,_0x2ffc('0x13'));_0x440376(_0x53d181[_0x2ffc('0x14')][_0x2ffc('0x11')]);}})[_0x2ffc('0x15')](function(_0x66aaee){logger[_0x2ffc('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x361c9c,_0x66aaee);_0xe1f550(_0x66aaee);});});}exports['CreateVoiceAgentReport']=function(_0x4cea39){var _0x139f6a=this;return new Promise(function(_0x1df4f6,_0x5b95ae){return db[_0x2ffc('0x16')][_0x2ffc('0x17')](_0x4cea39['body'],{'raw':_0x4cea39[_0x2ffc('0x18')]?_0x4cea39[_0x2ffc('0x18')][_0x2ffc('0x19')]===undefined?!![]:![]:!![]})[_0x2ffc('0xb')](function(_0x119bd2){logger[_0x2ffc('0x12')]('CreateVoiceAgentReport',_0x4cea39);logger[_0x2ffc('0x1a')]('CreateVoiceAgentReport',_0x4cea39,JSON['stringify'](_0x119bd2));_0x1df4f6(_0x119bd2);})['catch'](function(_0x48f952){logger[_0x2ffc('0xf')]('CreateVoiceAgentReport',_0x48f952[_0x2ffc('0x11')],_0x4cea39);_0x5b95ae(_0x139f6a['error'](0x1f4,_0x48f952[_0x2ffc('0x11')]));});});};exports[_0x2ffc('0x1b')]=function(_0x1cc34d){var _0x3598f4=this;return new Promise(function(_0xe513ea,_0x48bbad){return db[_0x2ffc('0x16')][_0x2ffc('0x1c')](_0x1cc34d['body'],{'raw':_0x1cc34d[_0x2ffc('0x18')]?_0x1cc34d[_0x2ffc('0x18')][_0x2ffc('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cc34d[_0x2ffc('0x18')]?_0x1cc34d[_0x2ffc('0x18')][_0x2ffc('0x1d')]||null:null,'attributes':_0x1cc34d['options']?_0x1cc34d[_0x2ffc('0x18')][_0x2ffc('0x1e')]||null:null,'limit':_0x1cc34d['options']?_0x1cc34d[_0x2ffc('0x18')]['limit']||null:null})[_0x2ffc('0xb')](function(_0x257f8a){logger['info'](_0x2ffc('0x1b'),_0x1cc34d);logger[_0x2ffc('0x1a')](_0x2ffc('0x1b'),_0x1cc34d,JSON[_0x2ffc('0xe')](_0x257f8a));_0xe513ea(_0x257f8a);})[_0x2ffc('0x15')](function(_0x3b6b77){logger[_0x2ffc('0xf')](_0x2ffc('0x1b'),_0x3b6b77[_0x2ffc('0x11')],_0x1cc34d);_0x48bbad(_0x3598f4['error'](0x1f4,_0x3b6b77[_0x2ffc('0x11')]));});});}; \ No newline at end of file +var _0x0b0c=['message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','raw','UpdateVoiceAgentReport','update','options','where','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xeee6c7,_0x408226){var _0x35f402=function(_0x2b5bcc){while(--_0x2b5bcc){_0xeee6c7['push'](_0xeee6c7['shift']());}};_0x35f402(++_0x408226);}(_0x0b0c,0xfd));var _0xc0b0=function(_0x25680f,_0x49646a){_0x25680f=_0x25680f-0x0;var _0x135948=_0x0b0c[_0x25680f];return _0x135948;};'use strict';var _=require(_0xc0b0('0x0'));var util=require(_0xc0b0('0x1'));var moment=require(_0xc0b0('0x2'));var BPromise=require(_0xc0b0('0x3'));var rs=require(_0xc0b0('0x4'));var fs=require('fs');var Redis=require(_0xc0b0('0x5'));var db=require(_0xc0b0('0x6'))['db'];var utils=require(_0xc0b0('0x7'));var logger=require(_0xc0b0('0x8'))(_0xc0b0('0x9'));var config=require(_0xc0b0('0xa'));var jayson=require(_0xc0b0('0xb'));var client=jayson[_0xc0b0('0xc')][_0xc0b0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x183153,_0x1b40e2,_0x3fdf8b){return new BPromise(function(_0x52b7ef,_0x3acf27){return client['request'](_0x183153,_0x3fdf8b)[_0xc0b0('0xe')](function(_0x251eae){logger['info'](_0xc0b0('0xf'),_0x1b40e2,_0xc0b0('0x10'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x1b40e2,_0xc0b0('0x10'),JSON[_0xc0b0('0x11')](_0x251eae));if(_0x251eae[_0xc0b0('0x12')]){if(_0x251eae['error']['code']===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x1b40e2,_0x251eae[_0xc0b0('0x12')][_0xc0b0('0x13')]);return _0x3acf27(_0x251eae[_0xc0b0('0x12')][_0xc0b0('0x13')]);}logger[_0xc0b0('0x12')](_0xc0b0('0xf'),_0x1b40e2,_0x251eae[_0xc0b0('0x12')][_0xc0b0('0x13')]);return _0x52b7ef(_0x251eae[_0xc0b0('0x12')]['message']);}else{logger[_0xc0b0('0x14')](_0xc0b0('0xf'),_0x1b40e2,_0xc0b0('0x10'));_0x52b7ef(_0x251eae[_0xc0b0('0x15')][_0xc0b0('0x13')]);}})[_0xc0b0('0x16')](function(_0x285368){logger[_0xc0b0('0x12')](_0xc0b0('0xf'),_0x1b40e2,_0x285368);_0x3acf27(_0x285368);});});}exports[_0xc0b0('0x17')]=function(_0x59232d){var _0x2df71a=this;return new Promise(function(_0x28f4e5,_0x2c1900){return db[_0xc0b0('0x18')][_0xc0b0('0x19')](_0x59232d[_0xc0b0('0x1a')],{'raw':_0x59232d['options']?_0x59232d['options'][_0xc0b0('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x5ab874){logger[_0xc0b0('0x14')]('CreateVoiceAgentReport',_0x59232d);logger['debug'](_0xc0b0('0x17'),_0x59232d,JSON[_0xc0b0('0x11')](_0x5ab874));_0x28f4e5(_0x5ab874);})[_0xc0b0('0x16')](function(_0x511a51){logger['error'](_0xc0b0('0x17'),_0x511a51[_0xc0b0('0x13')],_0x59232d);_0x2c1900(_0x2df71a[_0xc0b0('0x12')](0x1f4,_0x511a51[_0xc0b0('0x13')]));});});};exports[_0xc0b0('0x1c')]=function(_0x58d468){var _0x11516=this;return new Promise(function(_0x5b589c,_0x2466ef){return db[_0xc0b0('0x18')][_0xc0b0('0x1d')](_0x58d468[_0xc0b0('0x1a')],{'raw':_0x58d468['options']?_0x58d468[_0xc0b0('0x1e')][_0xc0b0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58d468[_0xc0b0('0x1e')]?_0x58d468[_0xc0b0('0x1e')][_0xc0b0('0x1f')]||null:null,'attributes':_0x58d468['options']?_0x58d468[_0xc0b0('0x1e')]['attributes']||null:null,'limit':_0x58d468[_0xc0b0('0x1e')]?_0x58d468[_0xc0b0('0x1e')][_0xc0b0('0x20')]||null:null})['then'](function(_0x4a5b95){logger[_0xc0b0('0x14')](_0xc0b0('0x1c'),_0x58d468);logger[_0xc0b0('0x21')](_0xc0b0('0x1c'),_0x58d468,JSON[_0xc0b0('0x11')](_0x4a5b95));_0x5b589c(_0x4a5b95);})[_0xc0b0('0x16')](function(_0x23fa1b){logger['error'](_0xc0b0('0x1c'),_0x23fa1b[_0xc0b0('0x13')],_0x58d468);_0x2466ef(_0x11516[_0xc0b0('0x12')](0x1f4,_0x23fa1b[_0xc0b0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index a9d5384..7e65b8d 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 _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x2f4414,_0x2709bf){var _0x53911f=function(_0x12dd06){while(--_0x12dd06){_0x2f4414['push'](_0x2f4414['shift']());}};_0x53911f(++_0x2709bf);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2240ad,_0x5e44b9){_0x2240ad=_0x2240ad-0x0;var _0xfe33e8=_0x1cb9[_0x2240ad];return _0xfe33e8;};'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('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file +var _0x5089=['show','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x5089,0x1bb));var _0x9508=function(_0x149f32,_0x4273f7){_0x149f32=_0x149f32-0x0;var _0x11f475=_0x5089[_0x149f32];return _0x11f475;};'use strict';var multer=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var path=require('path');var timeout=require(_0x9508('0x2'));var express=require(_0x9508('0x3'));var router=express[_0x9508('0x4')]();var fs_extra=require(_0x9508('0x5'));var auth=require(_0x9508('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9508('0x7'));var controller=require('./voiceCallReport.controller');router[_0x9508('0x8')]('/',auth[_0x9508('0x9')](),controller[_0x9508('0xa')]);router['get'](_0x9508('0xb'),auth[_0x9508('0x9')](),controller['describe']);router[_0x9508('0x8')](_0x9508('0xc'),auth['isAuthenticated'](),controller[_0x9508('0xd')]);router['post']('/',auth[_0x9508('0x9')](),controller[_0x9508('0xe')]);router[_0x9508('0xf')](_0x9508('0xc'),auth[_0x9508('0x9')](),controller[_0x9508('0x10')]);router['delete'](_0x9508('0xc'),auth['isAuthenticated'](),controller[_0x9508('0x11')]);module[_0x9508('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 08b402f..252abdc 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 _0x153c=['ENUM','internal','outbound','inbound-fax','outbound-fax','dialer','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x146c71,_0xbe3ead){var _0x25f0aa=function(_0x40ce9b){while(--_0x40ce9b){_0x146c71['push'](_0x146c71['shift']());}};_0x25f0aa(++_0xbe3ead);}(_0x153c,0x8c));var _0xc153=function(_0x153ff2,_0x195043){_0x153ff2=_0x153ff2-0x0;var _0x4ffb3f=_0x153c[_0x153ff2];return _0x4ffb3f;};'use strict';var Sequelize=require(_0xc153('0x0'));module[_0xc153('0x1')]={'uniqueid':{'type':Sequelize[_0xc153('0x2')]},'type':{'type':Sequelize[_0xc153('0x3')]('inbound',_0xc153('0x4'),_0xc153('0x5'),_0xc153('0x6'),_0xc153('0x7'),_0xc153('0x8'))},'tag':{'type':Sequelize[_0xc153('0x2')]},'accountcode':{'type':Sequelize[_0xc153('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xc153('0x2')]},'destinationcontext':{'type':Sequelize[_0xc153('0x2')]},'callerid':{'type':Sequelize[_0xc153('0x2')]},'channel':{'type':Sequelize[_0xc153('0x2')]},'destinationchannel':{'type':Sequelize[_0xc153('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xc153('0x9')]},'answertime':{'type':Sequelize[_0xc153('0x9')]},'endtime':{'type':Sequelize[_0xc153('0x9')]},'duration':{'type':Sequelize[_0xc153('0xa')]},'billableseconds':{'type':Sequelize[_0xc153('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xc153('0x2')]},'userfield':{'type':Sequelize[_0xc153('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xc153('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xc153('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xc153('0xa')]},'sipcallid':{'type':Sequelize[_0xc153('0x2')]}}; \ No newline at end of file +var _0x25c2=['outbound','outbound-fax','dialer','DATE','INTEGER','sequelize','STRING','ENUM','internal'];(function(_0x80f2f0,_0x50643f){var _0x23a795=function(_0x364fea){while(--_0x364fea){_0x80f2f0['push'](_0x80f2f0['shift']());}};_0x23a795(++_0x50643f);}(_0x25c2,0xdd));var _0x225c=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0x25c2[_0x18fb16];return _0x147b0d;};'use strict';var Sequelize=require(_0x225c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x225c('0x1')]},'type':{'type':Sequelize[_0x225c('0x2')]('inbound',_0x225c('0x3'),_0x225c('0x4'),'inbound-fax',_0x225c('0x5'),_0x225c('0x6'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x225c('0x1')]},'source':{'type':Sequelize[_0x225c('0x1')]},'destination':{'type':Sequelize[_0x225c('0x1')]},'destinationcontext':{'type':Sequelize[_0x225c('0x1')]},'callerid':{'type':Sequelize[_0x225c('0x1')]},'channel':{'type':Sequelize[_0x225c('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x225c('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x225c('0x7')]},'answertime':{'type':Sequelize[_0x225c('0x7')]},'endtime':{'type':Sequelize[_0x225c('0x7')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x225c('0x8')]},'mohtime':{'type':Sequelize[_0x225c('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x225c('0x1')]},'amaflags':{'type':Sequelize[_0x225c('0x1')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x225c('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x225c('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x225c('0x1')]},'prefix':{'type':Sequelize[_0x225c('0x1')]},'routeid':{'type':Sequelize[_0x225c('0x8')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index e5e2dd0..b6a0604 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 _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4a91fc,_0x515ea2){_0x4a91fc=_0x4a91fc-0x0;var _0x35de82=_0x5f2f[_0x4a91fc];return _0x35de82;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file +var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x29e3b6,_0x40b0b4){var _0x55d4b0=function(_0x55c58e){while(--_0x55c58e){_0x29e3b6['push'](_0x29e3b6['shift']());}};_0x55d4b0(++_0x40b0b4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4d63ce,_0x5bfa20){_0x4d63ce=_0x4d63ce-0x0;var _0x376e17=_0x5f2f[_0x4d63ce];return _0x376e17;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 30e83b6..c0c15e9 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 _0xecb6=['report_call','uniqueid','lodash','util','api','moment','bluebird','path','../../config/environment','exports','define','VoiceCallReport'];(function(_0x4f66ef,_0x3d47ef){var _0x34c6ec=function(_0x449aaf){while(--_0x449aaf){_0x4f66ef['push'](_0x4f66ef['shift']());}};_0x34c6ec(++_0x3d47ef);}(_0xecb6,0xaa));var _0x6ecb=function(_0x34c94a,_0x204645){_0x34c94a=_0x34c94a-0x0;var _0x2f4b63=_0xecb6[_0x34c94a];return _0x2f4b63;};'use strict';var _=require(_0x6ecb('0x0'));var util=require(_0x6ecb('0x1'));var logger=require('../../config/logger')(_0x6ecb('0x2'));var moment=require(_0x6ecb('0x3'));var BPromise=require(_0x6ecb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ecb('0x5'));var rimraf=require('rimraf');var config=require(_0x6ecb('0x6'));var attributes=require('./voiceCallReport.attributes');module[_0x6ecb('0x7')]=function(_0x45220b,_0x59da7a){return _0x45220b[_0x6ecb('0x8')](_0x6ecb('0x9'),attributes,{'tableName':_0x6ecb('0xa'),'paranoid':![],'indexes':[{'fields':[_0x6ecb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xabe6=['lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid'];(function(_0x460050,_0x47f8f4){var _0x274b0d=function(_0x3f4341){while(--_0x3f4341){_0x460050['push'](_0x460050['shift']());}};_0x274b0d(++_0x47f8f4);}(_0xabe6,0x84));var _0x6abe=function(_0x3bf8c1,_0x243384){_0x3bf8c1=_0x3bf8c1-0x0;var _0x105a82=_0xabe6[_0x3bf8c1];return _0x105a82;};'use strict';var _=require(_0x6abe('0x0'));var util=require(_0x6abe('0x1'));var logger=require(_0x6abe('0x2'))(_0x6abe('0x3'));var moment=require(_0x6abe('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6abe('0x5'));var config=require(_0x6abe('0x6'));var attributes=require(_0x6abe('0x7'));module[_0x6abe('0x8')]=function(_0x4c8755,_0x2f50b8){return _0x4c8755[_0x6abe('0x9')](_0x6abe('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x6abe('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index fc0b49f..a309266 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 _0x4ecf=['client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetVoiceCallReport','options','raw','attributes','include','map','model','debug','CreateVoiceCallReport','VoiceCallReport','create','UpdateVoiceCallReport','update','body','where','limit','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xf89deb,_0x37f171){var _0x16d99c=function(_0x5c2a28){while(--_0x5c2a28){_0xf89deb['push'](_0xf89deb['shift']());}};_0x16d99c(++_0x37f171);}(_0x4ecf,0x15f));var _0xf4ec=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x4ecf[_0x11005e];return _0x29338f;};'use strict';var _=require('lodash');var util=require(_0xf4ec('0x0'));var moment=require('moment');var BPromise=require(_0xf4ec('0x1'));var rs=require(_0xf4ec('0x2'));var fs=require('fs');var Redis=require(_0xf4ec('0x3'));var db=require(_0xf4ec('0x4'))['db'];var utils=require(_0xf4ec('0x5'));var logger=require(_0xf4ec('0x6'))(_0xf4ec('0x7'));var config=require(_0xf4ec('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf4ec('0x9')][_0xf4ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8d9d02,_0x5c9bde,_0x5a4018){return new BPromise(function(_0x51345c,_0x126026){return client[_0xf4ec('0xb')](_0x8d9d02,_0x5a4018)[_0xf4ec('0xc')](function(_0x35db58){logger[_0xf4ec('0xd')](_0xf4ec('0xe'),_0x5c9bde,_0xf4ec('0xf'));logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x5c9bde,_0xf4ec('0xf'),JSON[_0xf4ec('0x10')](_0x35db58));if(_0x35db58['error']){if(_0x35db58[_0xf4ec('0x11')]['code']===0x1f4){logger[_0xf4ec('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x5c9bde,_0x35db58['error'][_0xf4ec('0x12')]);return _0x126026(_0x35db58[_0xf4ec('0x11')][_0xf4ec('0x12')]);}logger[_0xf4ec('0x11')](_0xf4ec('0xe'),_0x5c9bde,_0x35db58['error'][_0xf4ec('0x12')]);return _0x51345c(_0x35db58[_0xf4ec('0x11')]['message']);}else{logger['info'](_0xf4ec('0xe'),_0x5c9bde,_0xf4ec('0xf'));_0x51345c(_0x35db58['result']['message']);}})[_0xf4ec('0x13')](function(_0x3d5edf){logger[_0xf4ec('0x11')](_0xf4ec('0xe'),_0x5c9bde,_0x3d5edf);_0x126026(_0x3d5edf);});});}exports[_0xf4ec('0x14')]=function(_0x17f1f8){var _0x5aa584=this;return new Promise(function(_0x57f881,_0x1d2932){return db['VoiceCallReport']['findAll']({'raw':_0x17f1f8[_0xf4ec('0x15')]?_0x17f1f8['options'][_0xf4ec('0x16')]===undefined?!![]:![]:!![],'where':_0x17f1f8[_0xf4ec('0x15')]?_0x17f1f8[_0xf4ec('0x15')]['where']||null:null,'attributes':_0x17f1f8[_0xf4ec('0x15')]?_0x17f1f8[_0xf4ec('0x15')][_0xf4ec('0x17')]||null:null,'limit':_0x17f1f8[_0xf4ec('0x15')]?_0x17f1f8['options']['limit']||null:null,'include':_0x17f1f8['options']?_0x17f1f8['options'][_0xf4ec('0x18')]?_[_0xf4ec('0x19')](_0x17f1f8['options'][_0xf4ec('0x18')],function(_0x56a6b8){return{'model':db[_0x56a6b8[_0xf4ec('0x1a')]],'as':_0x56a6b8['as'],'attributes':_0x56a6b8['attributes'],'include':_0x56a6b8['include']?_[_0xf4ec('0x19')](_0x56a6b8[_0xf4ec('0x18')],function(_0x560d8e){return{'model':db[_0x560d8e[_0xf4ec('0x1a')]],'as':_0x560d8e['as'],'attributes':_0x560d8e[_0xf4ec('0x17')],'include':_0x560d8e[_0xf4ec('0x18')]?_[_0xf4ec('0x19')](_0x560d8e['include'],function(_0x39ad2a){return{'model':db[_0x39ad2a[_0xf4ec('0x1a')]],'as':_0x39ad2a['as'],'attributes':_0x39ad2a[_0xf4ec('0x17')]};}):[]};}):[]};}):[]:[]})[_0xf4ec('0xc')](function(_0x224622){logger[_0xf4ec('0xd')](_0xf4ec('0x14'),_0x17f1f8);logger[_0xf4ec('0x1b')](_0xf4ec('0x14'),_0x17f1f8,JSON['stringify'](_0x224622));_0x57f881(_0x224622);})[_0xf4ec('0x13')](function(_0x246502){logger[_0xf4ec('0x11')](_0xf4ec('0x14'),_0x246502[_0xf4ec('0x12')],_0x17f1f8);_0x1d2932(_0x5aa584[_0xf4ec('0x11')](0x1f4,_0x246502[_0xf4ec('0x12')]));});});};exports[_0xf4ec('0x1c')]=function(_0x44256f){var _0x4d798f=this;return new Promise(function(_0x53c9c4,_0x1367ac){return db[_0xf4ec('0x1d')][_0xf4ec('0x1e')](_0x44256f['body'],{'raw':_0x44256f['options']?_0x44256f[_0xf4ec('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xf4ec('0xc')](function(_0x24ab1f){logger[_0xf4ec('0xd')](_0xf4ec('0x1c'),_0x44256f);logger[_0xf4ec('0x1b')](_0xf4ec('0x1c'),_0x44256f,JSON[_0xf4ec('0x10')](_0x24ab1f));_0x53c9c4(_0x24ab1f);})[_0xf4ec('0x13')](function(_0x281ff8){logger[_0xf4ec('0x11')](_0xf4ec('0x1c'),_0x281ff8['message'],_0x44256f);_0x1367ac(_0x4d798f['error'](0x1f4,_0x281ff8[_0xf4ec('0x12')]));});});};exports[_0xf4ec('0x1f')]=function(_0x5979eb){var _0x22af7d=this;return new Promise(function(_0x51801a,_0x57f836){return db[_0xf4ec('0x1d')][_0xf4ec('0x20')](_0x5979eb[_0xf4ec('0x21')],{'raw':_0x5979eb['options']?_0x5979eb[_0xf4ec('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5979eb[_0xf4ec('0x15')]?_0x5979eb['options'][_0xf4ec('0x22')]||null:null,'attributes':_0x5979eb[_0xf4ec('0x15')]?_0x5979eb['options'][_0xf4ec('0x17')]||null:null,'limit':_0x5979eb[_0xf4ec('0x15')]?_0x5979eb[_0xf4ec('0x15')][_0xf4ec('0x23')]||null:null})[_0xf4ec('0xc')](function(_0x4ae7e6){logger[_0xf4ec('0xd')]('UpdateVoiceCallReport',_0x5979eb);logger[_0xf4ec('0x1b')](_0xf4ec('0x1f'),_0x5979eb,JSON['stringify'](_0x4ae7e6));_0x51801a(_0x4ae7e6);})['catch'](function(_0x24f31a){logger[_0xf4ec('0x11')](_0xf4ec('0x1f'),_0x24f31a[_0xf4ec('0x12')],_0x5979eb);_0x57f836(_0x22af7d[_0xf4ec('0x11')](0x1f4,_0x24f31a[_0xf4ec('0x12')]));});});}; \ No newline at end of file +var _0x0f7c=['model','map','CreateVoiceCallReport','VoiceCallReport','create','body','update','where','UpdateVoiceCallReport','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','findAll','options','raw','attributes','limit','include'];(function(_0x35b47c,_0x4669a6){var _0x128d77=function(_0x291c7e){while(--_0x291c7e){_0x35b47c['push'](_0x35b47c['shift']());}};_0x128d77(++_0x4669a6);}(_0x0f7c,0x131));var _0xc0f7=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x0f7c[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xc0f7('0x0'));var util=require(_0xc0f7('0x1'));var moment=require(_0xc0f7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc0f7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc0f7('0x4'));var logger=require(_0xc0f7('0x5'))(_0xc0f7('0x6'));var config=require(_0xc0f7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc0f7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6904d2,_0x49df94,_0x403cd7){return new BPromise(function(_0xb716e7,_0x45e480){return client['request'](_0x6904d2,_0x403cd7)[_0xc0f7('0x9')](function(_0x1f968c){logger[_0xc0f7('0xa')](_0xc0f7('0xb'),_0x49df94,_0xc0f7('0xc'));logger[_0xc0f7('0xd')](_0xc0f7('0xe'),_0x49df94,_0xc0f7('0xc'),JSON[_0xc0f7('0xf')](_0x1f968c));if(_0x1f968c['error']){if(_0x1f968c[_0xc0f7('0x10')][_0xc0f7('0x11')]===0x1f4){logger[_0xc0f7('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x49df94,_0x1f968c[_0xc0f7('0x10')][_0xc0f7('0x12')]);return _0x45e480(_0x1f968c[_0xc0f7('0x10')][_0xc0f7('0x12')]);}logger['error'](_0xc0f7('0xb'),_0x49df94,_0x1f968c[_0xc0f7('0x10')][_0xc0f7('0x12')]);return _0xb716e7(_0x1f968c[_0xc0f7('0x10')][_0xc0f7('0x12')]);}else{logger[_0xc0f7('0xa')](_0xc0f7('0xb'),_0x49df94,_0xc0f7('0xc'));_0xb716e7(_0x1f968c[_0xc0f7('0x13')]['message']);}})[_0xc0f7('0x14')](function(_0x71dfde){logger[_0xc0f7('0x10')](_0xc0f7('0xb'),_0x49df94,_0x71dfde);_0x45e480(_0x71dfde);});});}exports[_0xc0f7('0x15')]=function(_0x1a2f2e){var _0xb0e806=this;return new Promise(function(_0x4aefb,_0x3ebc21){return db['VoiceCallReport'][_0xc0f7('0x16')]({'raw':_0x1a2f2e[_0xc0f7('0x17')]?_0x1a2f2e[_0xc0f7('0x17')][_0xc0f7('0x18')]===undefined?!![]:![]:!![],'where':_0x1a2f2e[_0xc0f7('0x17')]?_0x1a2f2e[_0xc0f7('0x17')]['where']||null:null,'attributes':_0x1a2f2e[_0xc0f7('0x17')]?_0x1a2f2e[_0xc0f7('0x17')][_0xc0f7('0x19')]||null:null,'limit':_0x1a2f2e[_0xc0f7('0x17')]?_0x1a2f2e[_0xc0f7('0x17')][_0xc0f7('0x1a')]||null:null,'include':_0x1a2f2e[_0xc0f7('0x17')]?_0x1a2f2e['options'][_0xc0f7('0x1b')]?_['map'](_0x1a2f2e[_0xc0f7('0x17')][_0xc0f7('0x1b')],function(_0x512570){return{'model':db[_0x512570[_0xc0f7('0x1c')]],'as':_0x512570['as'],'attributes':_0x512570[_0xc0f7('0x19')],'include':_0x512570[_0xc0f7('0x1b')]?_[_0xc0f7('0x1d')](_0x512570[_0xc0f7('0x1b')],function(_0x1dda71){return{'model':db[_0x1dda71[_0xc0f7('0x1c')]],'as':_0x1dda71['as'],'attributes':_0x1dda71[_0xc0f7('0x19')],'include':_0x1dda71['include']?_[_0xc0f7('0x1d')](_0x1dda71[_0xc0f7('0x1b')],function(_0xa02d9a){return{'model':db[_0xa02d9a['model']],'as':_0xa02d9a['as'],'attributes':_0xa02d9a[_0xc0f7('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc0f7('0x9')](function(_0x2598ae){logger[_0xc0f7('0xa')](_0xc0f7('0x15'),_0x1a2f2e);logger[_0xc0f7('0xd')](_0xc0f7('0x15'),_0x1a2f2e,JSON[_0xc0f7('0xf')](_0x2598ae));_0x4aefb(_0x2598ae);})[_0xc0f7('0x14')](function(_0x3bb17a){logger[_0xc0f7('0x10')]('GetVoiceCallReport',_0x3bb17a[_0xc0f7('0x12')],_0x1a2f2e);_0x3ebc21(_0xb0e806['error'](0x1f4,_0x3bb17a[_0xc0f7('0x12')]));});});};exports[_0xc0f7('0x1e')]=function(_0x2ecf7b){var _0x363186=this;return new Promise(function(_0x506d1f,_0x5c7746){return db[_0xc0f7('0x1f')][_0xc0f7('0x20')](_0x2ecf7b[_0xc0f7('0x21')],{'raw':_0x2ecf7b['options']?_0x2ecf7b[_0xc0f7('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xc0f7('0x9')](function(_0x27e052){logger[_0xc0f7('0xa')](_0xc0f7('0x1e'),_0x2ecf7b);logger['debug'](_0xc0f7('0x1e'),_0x2ecf7b,JSON[_0xc0f7('0xf')](_0x27e052));_0x506d1f(_0x27e052);})[_0xc0f7('0x14')](function(_0x1398a4){logger[_0xc0f7('0x10')](_0xc0f7('0x1e'),_0x1398a4[_0xc0f7('0x12')],_0x2ecf7b);_0x5c7746(_0x363186[_0xc0f7('0x10')](0x1f4,_0x1398a4[_0xc0f7('0x12')]));});});};exports['UpdateVoiceCallReport']=function(_0x58f233){var _0x63e92c=this;return new Promise(function(_0x448292,_0x19330f){return db[_0xc0f7('0x1f')][_0xc0f7('0x22')](_0x58f233[_0xc0f7('0x21')],{'raw':_0x58f233['options']?_0x58f233[_0xc0f7('0x17')][_0xc0f7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58f233['options']?_0x58f233[_0xc0f7('0x17')][_0xc0f7('0x23')]||null:null,'attributes':_0x58f233[_0xc0f7('0x17')]?_0x58f233[_0xc0f7('0x17')]['attributes']||null:null,'limit':_0x58f233[_0xc0f7('0x17')]?_0x58f233[_0xc0f7('0x17')][_0xc0f7('0x1a')]||null:null})['then'](function(_0x3e5d65){logger[_0xc0f7('0xa')](_0xc0f7('0x24'),_0x58f233);logger['debug']('UpdateVoiceCallReport',_0x58f233,JSON[_0xc0f7('0xf')](_0x3e5d65));_0x448292(_0x3e5d65);})[_0xc0f7('0x14')](function(_0x6d5fb9){logger[_0xc0f7('0x10')](_0xc0f7('0x24'),_0x6d5fb9['message'],_0x58f233);_0x19330f(_0x63e92c[_0xc0f7('0x10')](0x1f4,_0x6d5fb9['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 63c9b7d..56d82e5 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 _0xde0e=['show','post','put','delete','destroy','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id'];(function(_0x318a06,_0x32c5ac){var _0x552d7b=function(_0x2c9e6d){while(--_0x2c9e6d){_0x318a06['push'](_0x318a06['shift']());}};_0x552d7b(++_0x32c5ac);}(_0xde0e,0x95));var _0xede0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde0e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xede0('0x0'));var util=require(_0xede0('0x1'));var path=require('path');var timeout=require(_0xede0('0x2'));var express=require(_0xede0('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xede0('0x4'));var config=require(_0xede0('0x5'));var controller=require(_0xede0('0x6'));router[_0xede0('0x7')]('/',auth[_0xede0('0x8')](),controller[_0xede0('0x9')]);router['get'](_0xede0('0xa'),auth[_0xede0('0x8')](),controller[_0xede0('0xb')]);router[_0xede0('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xede0('0xd')](_0xede0('0xa'),auth[_0xede0('0x8')](),controller['update']);router[_0xede0('0xe')](_0xede0('0xa'),auth[_0xede0('0x8')](),controller[_0xede0('0xf')]);module['exports']=router; \ No newline at end of file +var _0xc3ee=['post','create','/:id','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','show'];(function(_0x59d7f9,_0x411365){var _0x19f590=function(_0x4add39){while(--_0x4add39){_0x59d7f9['push'](_0x59d7f9['shift']());}};_0x19f590(++_0x411365);}(_0xc3ee,0xd1));var _0xec3e=function(_0x275c3f,_0x5e2069){_0x275c3f=_0x275c3f-0x0;var _0x2df932=_0xc3ee[_0x275c3f];return _0x2df932;};'use strict';var multer=require(_0xec3e('0x0'));var util=require('util');var path=require(_0xec3e('0x1'));var timeout=require(_0xec3e('0x2'));var express=require('express');var router=express[_0xec3e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xec3e('0x4'));var interaction=require(_0xec3e('0x5'));var config=require(_0xec3e('0x6'));var controller=require(_0xec3e('0x7'));router[_0xec3e('0x8')]('/',auth[_0xec3e('0x9')](),controller[_0xec3e('0xa')]);router[_0xec3e('0x8')]('/:id',auth[_0xec3e('0x9')](),controller[_0xec3e('0xb')]);router[_0xec3e('0xc')]('/',auth[_0xec3e('0x9')](),controller[_0xec3e('0xd')]);router['put'](_0xec3e('0xe'),auth[_0xec3e('0x9')](),controller['update']);router['delete']('/:id',auth[_0xec3e('0x9')](),controller[_0xec3e('0xf')]);module[_0xec3e('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index aa452d4..940962d 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 _0xeb7d=['name','setDataValue','options','getDataValue','split','BOOLEAN','sequelize','STRING'];(function(_0x42cb8f,_0x4a18a2){var _0x1e9fce=function(_0x2c77f9){while(--_0x2c77f9){_0x42cb8f['push'](_0x42cb8f['shift']());}};_0x1e9fce(++_0x4a18a2);}(_0xeb7d,0x106));var _0xdeb7=function(_0xb20ec1,_0x49dc85){_0xb20ec1=_0xb20ec1-0x0;var _0x53cd29=_0xeb7d[_0xb20ec1];return _0x53cd29;};'use strict';var Sequelize=require(_0xdeb7('0x0'));module['exports']={'name':{'type':Sequelize[_0xdeb7('0x1')]},'prefix':{'type':Sequelize[_0xdeb7('0x1')],'unique':_0xdeb7('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x435001){this[_0xdeb7('0x3')]('options',_0x435001?_0x435001['join'](''):[]);},'get':function(){return this['getDataValue'](_0xdeb7('0x4'))?this[_0xdeb7('0x5')](_0xdeb7('0x4'))[_0xdeb7('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xdeb7('0x1')]},'record':{'type':Sequelize[_0xdeb7('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xdeb7('0x1')]},'description':{'type':Sequelize[_0xdeb7('0x1')]}}; \ No newline at end of file +var _0xe8db=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','setDataValue','options','join'];(function(_0x3b2044,_0x10a5a6){var _0x484ab8=function(_0x371f7e){while(--_0x371f7e){_0x3b2044['push'](_0x3b2044['shift']());}};_0x484ab8(++_0x10a5a6);}(_0xe8db,0x1c5));var _0xbe8d=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xe8db[_0x580647];return _0x5f0792;};'use strict';var Sequelize=require(_0xbe8d('0x0'));module[_0xbe8d('0x1')]={'name':{'type':Sequelize[_0xbe8d('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xbe8d('0x2')],'set':function(_0x45a428){this[_0xbe8d('0x3')](_0xbe8d('0x4'),_0x45a428?_0x45a428[_0xbe8d('0x5')](''):[]);},'get':function(){return this[_0xbe8d('0x6')](_0xbe8d('0x4'))?this[_0xbe8d('0x6')](_0xbe8d('0x4'))[_0xbe8d('0x7')](''):[];}},'auth':{'type':Sequelize[_0xbe8d('0x8')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xbe8d('0x2')]},'description':{'type':Sequelize[_0xbe8d('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 0432b0d..17d9abc 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 _0xffaa=['set','Content-Range','reject','save','then','destroy','get','ChanSpies','UserProfileResource','end','sendStatus','error','stack','send','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','status','json','offset','undefined','count'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xffaa,0x130));var _0xaffa=function(_0x10dd4f,_0xc20544){_0x10dd4f=_0x10dd4f-0x0;var _0x38877e=_0xffaa[_0x10dd4f];return _0x38877e;};'use strict';var emlformat=require(_0xaffa('0x0'));var rimraf=require(_0xaffa('0x1'));var zipdir=require(_0xaffa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaffa('0x3'));var BPromise=require(_0xaffa('0x4'));var Mustache=require(_0xaffa('0x5'));var util=require(_0xaffa('0x6'));var path=require(_0xaffa('0x7'));var sox=require(_0xaffa('0x8'));var csv=require(_0xaffa('0x9'));var ejs=require(_0xaffa('0xa'));var fs=require('fs');var fs_extra=require(_0xaffa('0xb'));var _=require(_0xaffa('0xc'));var squel=require('squel');var crypto=require(_0xaffa('0xd'));var jsforce=require(_0xaffa('0xe'));var deskjs=require(_0xaffa('0xf'));var toCsv=require(_0xaffa('0x9'));var querystring=require('querystring');var Papa=require(_0xaffa('0x10'));var Redis=require('ioredis');var authService=require(_0xaffa('0x11'));var qs=require(_0xaffa('0x12'));var as=require(_0xaffa('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaffa('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaffa('0x15'));var db=require(_0xaffa('0x16'))['db'];function respondWithStatusCode(_0x2ba362,_0x54f27f){_0x54f27f=_0x54f27f||0xcc;return function(_0x3806e9){if(_0x3806e9){return _0x2ba362['sendStatus'](_0x54f27f);}return _0x2ba362[_0xaffa('0x17')](_0x54f27f)['end']();};}function respondWithResult(_0xd8e9c6,_0x8ecc6b){_0x8ecc6b=_0x8ecc6b||0xc8;return function(_0x255025){if(_0x255025){return _0xd8e9c6[_0xaffa('0x17')](_0x8ecc6b)[_0xaffa('0x18')](_0x255025);}};}function respondWithFilteredResult(_0x326bab,_0x11d334){return function(_0x323a2f){if(_0x323a2f){var _0x5cc262=typeof _0x11d334[_0xaffa('0x19')]===_0xaffa('0x1a')&&typeof _0x11d334['limit']===_0xaffa('0x1a');var _0x5974cc=_0x323a2f[_0xaffa('0x1b')];var _0x2d57ab=_0x5cc262?0x0:_0x11d334[_0xaffa('0x19')];var _0x398968=_0x5cc262?_0x323a2f[_0xaffa('0x1b')]:_0x11d334[_0xaffa('0x19')]+_0x11d334['limit'];var _0x34d70f;if(_0x398968>=_0x5974cc){_0x398968=_0x5974cc;_0x34d70f=0xc8;}else{_0x34d70f=0xce;}_0x326bab[_0xaffa('0x17')](_0x34d70f);return _0x326bab[_0xaffa('0x1c')](_0xaffa('0x1d'),_0x2d57ab+'-'+_0x398968+'/'+_0x5974cc)[_0xaffa('0x18')](_0x323a2f);}return null;};}function patchUpdates(_0x16297d){return function(_0x23e60f){try{jsonpatch['apply'](_0x23e60f,_0x16297d,!![]);}catch(_0x520d62){return BPromise[_0xaffa('0x1e')](_0x520d62);}return _0x23e60f[_0xaffa('0x1f')]();};}function saveUpdates(_0x45c856,_0x2f5091){return function(_0x4f8084){if(_0x4f8084){return _0x4f8084['update'](_0x45c856)[_0xaffa('0x20')](function(_0x3f7dee){return _0x3f7dee;});}return null;};}function removeEntity(_0x587e8b,_0x2a5bb8){return function(_0x298e2b){if(_0x298e2b){return _0x298e2b[_0xaffa('0x21')]()[_0xaffa('0x20')](function(){var _0x1d83ce=_0x298e2b[_0xaffa('0x22')]({'plain':!![]});var _0x492b82=_0xaffa('0x23');return db[_0xaffa('0x24')]['destroy']({'where':{'type':_0x492b82,'resourceId':_0x1d83ce['id']}})['then'](function(){return _0x298e2b;});})[_0xaffa('0x20')](function(){_0x587e8b[_0xaffa('0x17')](0xcc)[_0xaffa('0x25')]();});}};}function handleEntityNotFound(_0x28b4e2,_0x247915){return function(_0x411448){if(!_0x411448){_0x28b4e2[_0xaffa('0x26')](0x194);}return _0x411448;};}function handleError(_0x42808b,_0x3872c1){_0x3872c1=_0x3872c1||0x1f4;return function(_0x1b8111){logger[_0xaffa('0x27')](_0x1b8111[_0xaffa('0x28')]);if(_0x1b8111['name']){delete _0x1b8111['name'];}_0x42808b[_0xaffa('0x17')](_0x3872c1)[_0xaffa('0x29')](_0x1b8111);};}exports['index']=function(_0x571540,_0x5c6412){var _0x2c0364={},_0x38a56b={},_0x2c77e6={'count':0x0,'rows':[]};var _0x50ca99=_[_0xaffa('0x2a')](db[_0xaffa('0x2b')][_0xaffa('0x2c')],function(_0x178d76){return{'name':_0x178d76[_0xaffa('0x2d')],'type':_0x178d76[_0xaffa('0x2e')][_0xaffa('0x2f')]};});_0x38a56b[_0xaffa('0x30')]=_[_0xaffa('0x2a')](_0x50ca99,_0xaffa('0x31'));_0x38a56b['query']=_[_0xaffa('0x32')](_0x571540[_0xaffa('0x33')]);_0x38a56b[_0xaffa('0x34')]=_[_0xaffa('0x35')](_0x38a56b[_0xaffa('0x30')],_0x38a56b[_0xaffa('0x33')]);_0x2c0364[_0xaffa('0x36')]=_[_0xaffa('0x35')](_0x38a56b['model'],qs['fields'](_0x571540[_0xaffa('0x33')]['fields']));_0x2c0364['attributes']=_0x2c0364[_0xaffa('0x36')][_0xaffa('0x37')]?_0x2c0364[_0xaffa('0x36')]:_0x38a56b[_0xaffa('0x30')];if(!_0x571540['query'][_0xaffa('0x38')](_0xaffa('0x39'))){_0x2c0364['limit']=qs[_0xaffa('0x3a')](_0x571540[_0xaffa('0x33')]['limit']);_0x2c0364['offset']=qs[_0xaffa('0x19')](_0x571540[_0xaffa('0x33')][_0xaffa('0x19')]);}_0x2c0364[_0xaffa('0x3b')]=qs[_0xaffa('0x3c')](_0x571540['query']['sort']);_0x2c0364[_0xaffa('0x3d')]=qs[_0xaffa('0x34')](_['pick'](_0x571540[_0xaffa('0x33')],_0x38a56b[_0xaffa('0x34')]),_0x50ca99);if(_0x571540[_0xaffa('0x33')][_0xaffa('0x3e')]){_0x2c0364[_0xaffa('0x3d')]=_['merge'](_0x2c0364[_0xaffa('0x3d')],{'$or':_['map'](_0x50ca99,function(_0x37bafe){if(_0x37bafe[_0xaffa('0x2e')]!==_0xaffa('0x3f')){var _0x5e0561={};_0x5e0561[_0x37bafe['name']]={'$like':'%'+_0x571540['query'][_0xaffa('0x3e')]+'%'};return _0x5e0561;}})});}_0x2c0364=_[_0xaffa('0x40')]({},_0x2c0364,_0x571540[_0xaffa('0x41')]);var _0x5bbc63={'where':_0x2c0364[_0xaffa('0x3d')]};return db['VoiceChanSpy'][_0xaffa('0x1b')](_0x5bbc63)['then'](function(_0x4b0aaf){_0x2c77e6[_0xaffa('0x1b')]=_0x4b0aaf;if(_0x571540[_0xaffa('0x33')][_0xaffa('0x42')]){_0x2c0364[_0xaffa('0x43')]=[{'all':!![]}];}return db[_0xaffa('0x2b')][_0xaffa('0x44')](_0x2c0364);})[_0xaffa('0x20')](function(_0x263058){_0x2c77e6[_0xaffa('0x45')]=_0x263058;return _0x2c77e6;})[_0xaffa('0x20')](respondWithFilteredResult(_0x5c6412,_0x2c0364))['catch'](handleError(_0x5c6412,null));};exports[_0xaffa('0x46')]=function(_0x21e1d9,_0x1115bc){var _0x149b59={'raw':![],'where':{'id':_0x21e1d9[_0xaffa('0x47')]['id']}},_0x282f1d={};_0x282f1d[_0xaffa('0x30')]=_[_0xaffa('0x32')](db['VoiceChanSpy'][_0xaffa('0x2c')]);_0x282f1d['query']=_[_0xaffa('0x32')](_0x21e1d9[_0xaffa('0x33')]);_0x282f1d[_0xaffa('0x34')]=_[_0xaffa('0x35')](_0x282f1d['model'],_0x282f1d['query']);_0x149b59[_0xaffa('0x36')]=_['intersection'](_0x282f1d[_0xaffa('0x30')],qs[_0xaffa('0x48')](_0x21e1d9['query'][_0xaffa('0x48')]));_0x149b59[_0xaffa('0x36')]=_0x149b59[_0xaffa('0x36')]['length']?_0x149b59['attributes']:_0x282f1d['model'];if(_0x21e1d9[_0xaffa('0x33')]['includeAll']){_0x149b59[_0xaffa('0x43')]=[{'all':!![]}];}_0x149b59=_[_0xaffa('0x40')]({},_0x149b59,_0x21e1d9[_0xaffa('0x41')]);return db['VoiceChanSpy'][_0xaffa('0x49')](_0x149b59)[_0xaffa('0x20')](handleEntityNotFound(_0x1115bc,null))[_0xaffa('0x20')](respondWithResult(_0x1115bc,null))[_0xaffa('0x4a')](handleError(_0x1115bc,null));};exports[_0xaffa('0x4b')]=function(_0x5e0029,_0x2b0ecc){return db[_0xaffa('0x2b')]['create'](_0x5e0029['body'],{})['then'](function(_0x17c913){var _0x1a52f6=_0x5e0029[_0xaffa('0x4c')][_0xaffa('0x22')]({'plain':!![]});if(!_0x1a52f6)throw new Error(_0xaffa('0x4d'));if(_0x1a52f6['role']===_0xaffa('0x4c')){var _0x3a69cb=_0x17c913[_0xaffa('0x22')]({'plain':!![]});var _0x3b7740=_0xaffa('0x23');return db[_0xaffa('0x4e')]['find']({'where':{'name':_0x3b7740,'userProfileId':_0x1a52f6[_0xaffa('0x4f')]},'raw':!![]})['then'](function(_0x3d99a9){if(_0x3d99a9&&_0x3d99a9[_0xaffa('0x50')]===0x0){return db['UserProfileResource'][_0xaffa('0x4b')]({'name':_0x3a69cb['name'],'resourceId':_0x3a69cb['id'],'type':_0x3d99a9[_0xaffa('0x31')],'sectionId':_0x3d99a9['id']},{})[_0xaffa('0x20')](function(){return _0x17c913;});}else{return _0x17c913;}})[_0xaffa('0x4a')](function(_0x3347ee){logger[_0xaffa('0x27')](_0xaffa('0x51'),_0x3347ee);throw _0x3347ee;});}return _0x17c913;})['then'](respondWithResult(_0x2b0ecc,0xc9))[_0xaffa('0x4a')](handleError(_0x2b0ecc,null));};exports['update']=function(_0x5ae8c8,_0x1b3bc9){if(_0x5ae8c8[_0xaffa('0x52')]['id']){delete _0x5ae8c8[_0xaffa('0x52')]['id'];}return db['VoiceChanSpy'][_0xaffa('0x49')]({'where':{'id':_0x5ae8c8[_0xaffa('0x47')]['id']}})[_0xaffa('0x20')](handleEntityNotFound(_0x1b3bc9,null))[_0xaffa('0x20')](saveUpdates(_0x5ae8c8[_0xaffa('0x52')],null))['then'](respondWithResult(_0x1b3bc9,null))[_0xaffa('0x4a')](handleError(_0x1b3bc9,null));};exports[_0xaffa('0x21')]=function(_0x1822e8,_0x13adef){return db[_0xaffa('0x2b')][_0xaffa('0x49')]({'where':{'id':_0x1822e8[_0xaffa('0x47')]['id']}})[_0xaffa('0x20')](handleEntityNotFound(_0x13adef,null))[_0xaffa('0x20')](removeEntity(_0x13adef,null))[_0xaffa('0x4a')](handleError(_0x13adef,null));}; \ No newline at end of file +var _0x13c0=['reject','then','destroy','ChanSpies','UserProfileResource','stack','name','send','index','map','VoiceChanSpy','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','includeAll','find','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','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json'];(function(_0xfb557c,_0x126b35){var _0x4c066f=function(_0xaf3e66){while(--_0xaf3e66){_0xfb557c['push'](_0xfb557c['shift']());}};_0x4c066f(++_0x126b35);}(_0x13c0,0x79));var _0x013c=function(_0x3e2480,_0x2eed70){_0x3e2480=_0x3e2480-0x0;var _0x652c0=_0x13c0[_0x3e2480];return _0x652c0;};'use strict';var emlformat=require(_0x013c('0x0'));var rimraf=require(_0x013c('0x1'));var zipdir=require(_0x013c('0x2'));var jsonpatch=require(_0x013c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x013c('0x4'));var util=require(_0x013c('0x5'));var path=require(_0x013c('0x6'));var sox=require(_0x013c('0x7'));var csv=require(_0x013c('0x8'));var ejs=require(_0x013c('0x9'));var fs=require('fs');var fs_extra=require(_0x013c('0xa'));var _=require(_0x013c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x013c('0xc'));var toCsv=require(_0x013c('0x8'));var querystring=require('querystring');var Papa=require(_0x013c('0xd'));var Redis=require(_0x013c('0xe'));var authService=require(_0x013c('0xf'));var qs=require(_0x013c('0x10'));var as=require(_0x013c('0x11'));var hardwareService=require(_0x013c('0x12'));var logger=require(_0x013c('0x13'))(_0x013c('0x14'));var utils=require(_0x013c('0x15'));var config=require(_0x013c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xce456f,_0x4631c5){_0x4631c5=_0x4631c5||0xcc;return function(_0x1ee348){if(_0x1ee348){return _0xce456f[_0x013c('0x17')](_0x4631c5);}return _0xce456f['status'](_0x4631c5)[_0x013c('0x18')]();};}function respondWithResult(_0x2313de,_0xcfe81a){_0xcfe81a=_0xcfe81a||0xc8;return function(_0x17b085){if(_0x17b085){return _0x2313de[_0x013c('0x19')](_0xcfe81a)['json'](_0x17b085);}};}function respondWithFilteredResult(_0x307f34,_0x1c2e11){return function(_0x84244){if(_0x84244){var _0x92c3ca=typeof _0x1c2e11[_0x013c('0x1a')]===_0x013c('0x1b')&&typeof _0x1c2e11[_0x013c('0x1c')]===_0x013c('0x1b');var _0x246f11=_0x84244[_0x013c('0x1d')];var _0x34d59f=_0x92c3ca?0x0:_0x1c2e11[_0x013c('0x1a')];var _0x25eb26=_0x92c3ca?_0x84244['count']:_0x1c2e11['offset']+_0x1c2e11[_0x013c('0x1c')];var _0x153b0a;if(_0x25eb26>=_0x246f11){_0x25eb26=_0x246f11;_0x153b0a=0xc8;}else{_0x153b0a=0xce;}_0x307f34['status'](_0x153b0a);return _0x307f34[_0x013c('0x1e')](_0x013c('0x1f'),_0x34d59f+'-'+_0x25eb26+'/'+_0x246f11)[_0x013c('0x20')](_0x84244);}return null;};}function patchUpdates(_0x38bac2){return function(_0xb87452){try{jsonpatch['apply'](_0xb87452,_0x38bac2,!![]);}catch(_0xb039bc){return BPromise[_0x013c('0x21')](_0xb039bc);}return _0xb87452['save']();};}function saveUpdates(_0x1df9d2,_0x82f9f1){return function(_0x53fbbd){if(_0x53fbbd){return _0x53fbbd['update'](_0x1df9d2)[_0x013c('0x22')](function(_0x1996e6){return _0x1996e6;});}return null;};}function removeEntity(_0x2509f4,_0x447c0b){return function(_0x20aff2){if(_0x20aff2){return _0x20aff2[_0x013c('0x23')]()[_0x013c('0x22')](function(){var _0x1b9bdc=_0x20aff2['get']({'plain':!![]});var _0x468fe7=_0x013c('0x24');return db[_0x013c('0x25')][_0x013c('0x23')]({'where':{'type':_0x468fe7,'resourceId':_0x1b9bdc['id']}})[_0x013c('0x22')](function(){return _0x20aff2;});})[_0x013c('0x22')](function(){_0x2509f4['status'](0xcc)[_0x013c('0x18')]();});}};}function handleEntityNotFound(_0xd85349,_0x21c86e){return function(_0x5f251b){if(!_0x5f251b){_0xd85349[_0x013c('0x17')](0x194);}return _0x5f251b;};}function handleError(_0x4f062f,_0x395081){_0x395081=_0x395081||0x1f4;return function(_0x455b88){logger['error'](_0x455b88[_0x013c('0x26')]);if(_0x455b88[_0x013c('0x27')]){delete _0x455b88[_0x013c('0x27')];}_0x4f062f[_0x013c('0x19')](_0x395081)[_0x013c('0x28')](_0x455b88);};}exports[_0x013c('0x29')]=function(_0x12ba2a,_0x1f0aab){var _0xba783b={},_0x441898={},_0x556bdc={'count':0x0,'rows':[]};var _0x315cd8=_[_0x013c('0x2a')](db[_0x013c('0x2b')][_0x013c('0x2c')],function(_0x330ccf){return{'name':_0x330ccf['fieldName'],'type':_0x330ccf[_0x013c('0x2d')][_0x013c('0x2e')]};});_0x441898[_0x013c('0x2f')]=_[_0x013c('0x2a')](_0x315cd8,'name');_0x441898['query']=_['keys'](_0x12ba2a[_0x013c('0x30')]);_0x441898[_0x013c('0x31')]=_[_0x013c('0x32')](_0x441898[_0x013c('0x2f')],_0x441898[_0x013c('0x30')]);_0xba783b[_0x013c('0x33')]=_[_0x013c('0x32')](_0x441898[_0x013c('0x2f')],qs[_0x013c('0x34')](_0x12ba2a[_0x013c('0x30')][_0x013c('0x34')]));_0xba783b[_0x013c('0x33')]=_0xba783b['attributes']['length']?_0xba783b[_0x013c('0x33')]:_0x441898[_0x013c('0x2f')];if(!_0x12ba2a[_0x013c('0x30')][_0x013c('0x35')]('nolimit')){_0xba783b[_0x013c('0x1c')]=qs[_0x013c('0x1c')](_0x12ba2a[_0x013c('0x30')][_0x013c('0x1c')]);_0xba783b['offset']=qs[_0x013c('0x1a')](_0x12ba2a[_0x013c('0x30')]['offset']);}_0xba783b[_0x013c('0x36')]=qs['sort'](_0x12ba2a[_0x013c('0x30')][_0x013c('0x37')]);_0xba783b[_0x013c('0x38')]=qs[_0x013c('0x31')](_['pick'](_0x12ba2a[_0x013c('0x30')],_0x441898[_0x013c('0x31')]),_0x315cd8);if(_0x12ba2a[_0x013c('0x30')][_0x013c('0x39')]){_0xba783b[_0x013c('0x38')]=_[_0x013c('0x3a')](_0xba783b[_0x013c('0x38')],{'$or':_[_0x013c('0x2a')](_0x315cd8,function(_0x3de22f){if(_0x3de22f['type']!==_0x013c('0x3b')){var _0x3e5e50={};_0x3e5e50[_0x3de22f['name']]={'$like':'%'+_0x12ba2a[_0x013c('0x30')][_0x013c('0x39')]+'%'};return _0x3e5e50;}})});}_0xba783b=_['merge']({},_0xba783b,_0x12ba2a[_0x013c('0x3c')]);var _0x3384da={'where':_0xba783b[_0x013c('0x38')]};return db[_0x013c('0x2b')][_0x013c('0x1d')](_0x3384da)['then'](function(_0x3d0ffd){_0x556bdc['count']=_0x3d0ffd;if(_0x12ba2a['query']['includeAll']){_0xba783b['include']=[{'all':!![]}];}return db[_0x013c('0x2b')][_0x013c('0x3d')](_0xba783b);})[_0x013c('0x22')](function(_0x49db0c){_0x556bdc[_0x013c('0x3e')]=_0x49db0c;return _0x556bdc;})[_0x013c('0x22')](respondWithFilteredResult(_0x1f0aab,_0xba783b))[_0x013c('0x3f')](handleError(_0x1f0aab,null));};exports[_0x013c('0x40')]=function(_0x926ca5,_0x491b30){var _0x465c24={'raw':![],'where':{'id':_0x926ca5['params']['id']}},_0x3bfcd4={};_0x3bfcd4['model']=_['keys'](db['VoiceChanSpy'][_0x013c('0x2c')]);_0x3bfcd4[_0x013c('0x30')]=_['keys'](_0x926ca5[_0x013c('0x30')]);_0x3bfcd4[_0x013c('0x31')]=_['intersection'](_0x3bfcd4[_0x013c('0x2f')],_0x3bfcd4[_0x013c('0x30')]);_0x465c24[_0x013c('0x33')]=_[_0x013c('0x32')](_0x3bfcd4[_0x013c('0x2f')],qs[_0x013c('0x34')](_0x926ca5[_0x013c('0x30')][_0x013c('0x34')]));_0x465c24['attributes']=_0x465c24[_0x013c('0x33')]['length']?_0x465c24[_0x013c('0x33')]:_0x3bfcd4['model'];if(_0x926ca5['query'][_0x013c('0x41')]){_0x465c24['include']=[{'all':!![]}];}_0x465c24=_[_0x013c('0x3a')]({},_0x465c24,_0x926ca5[_0x013c('0x3c')]);return db[_0x013c('0x2b')][_0x013c('0x42')](_0x465c24)['then'](handleEntityNotFound(_0x491b30,null))['then'](respondWithResult(_0x491b30,null))['catch'](handleError(_0x491b30,null));};exports['create']=function(_0x7f4350,_0x5daeda){return db[_0x013c('0x2b')][_0x013c('0x43')](_0x7f4350[_0x013c('0x44')],{})[_0x013c('0x22')](function(_0x104a68){var _0x2e99db=_0x7f4350[_0x013c('0x45')][_0x013c('0x46')]({'plain':!![]});if(!_0x2e99db)throw new Error(_0x013c('0x47'));if(_0x2e99db['role']===_0x013c('0x45')){var _0x5163d8=_0x104a68['get']({'plain':!![]});var _0x12236a='ChanSpies';return db['UserProfileSection'][_0x013c('0x42')]({'where':{'name':_0x12236a,'userProfileId':_0x2e99db[_0x013c('0x48')]},'raw':!![]})['then'](function(_0x435f8e){if(_0x435f8e&&_0x435f8e[_0x013c('0x49')]===0x0){return db[_0x013c('0x25')]['create']({'name':_0x5163d8[_0x013c('0x27')],'resourceId':_0x5163d8['id'],'type':_0x435f8e[_0x013c('0x27')],'sectionId':_0x435f8e['id']},{})[_0x013c('0x22')](function(){return _0x104a68;});}else{return _0x104a68;}})[_0x013c('0x3f')](function(_0x2a64a1){logger['error'](_0x013c('0x4a'),_0x2a64a1);throw _0x2a64a1;});}return _0x104a68;})[_0x013c('0x22')](respondWithResult(_0x5daeda,0xc9))[_0x013c('0x3f')](handleError(_0x5daeda,null));};exports[_0x013c('0x4b')]=function(_0x4a8968,_0x27f877){if(_0x4a8968[_0x013c('0x44')]['id']){delete _0x4a8968[_0x013c('0x44')]['id'];}return db[_0x013c('0x2b')][_0x013c('0x42')]({'where':{'id':_0x4a8968[_0x013c('0x4c')]['id']}})[_0x013c('0x22')](handleEntityNotFound(_0x27f877,null))[_0x013c('0x22')](saveUpdates(_0x4a8968[_0x013c('0x44')],null))['then'](respondWithResult(_0x27f877,null))[_0x013c('0x3f')](handleError(_0x27f877,null));};exports[_0x013c('0x23')]=function(_0x5c8cc9,_0x55bf4a){return db[_0x013c('0x2b')]['find']({'where':{'id':_0x5c8cc9[_0x013c('0x4c')]['id']}})[_0x013c('0x22')](handleEntityNotFound(_0x55bf4a,null))[_0x013c('0x22')](removeEntity(_0x55bf4a,null))[_0x013c('0x3f')](handleError(_0x55bf4a,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 2d6b033..4b9e660 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 _0xbbc3=['from-sip','format','%s%s','prefix','push','merge','Set','CDR(type)=%s','record','${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','concat','internal','User','findAll','agent','then','catch','exports','voice_chanspy','length','bulkCreate','destroy','VoiceExtension','util','./voiceChanSpy.attributes'];(function(_0x54691e,_0x28b041){var _0x5520b2=function(_0x501a05){while(--_0x501a05){_0x54691e['push'](_0x54691e['shift']());}};_0x5520b2(++_0x28b041);}(_0xbbc3,0x196));var _0x3bbc=function(_0x470899,_0x50c450){_0x470899=_0x470899-0x0;var _0x312732=_0xbbc3[_0x470899];return _0x312732;};'use strict';var _=require('lodash');var util=require(_0x3bbc('0x0'));var BPromise=require('bluebird');var attributes=require(_0x3bbc('0x1'));var getUserApplications=function(_0x1ace8d,_0x3dbbe4,_0x16e735){var _0x41c933=0x1;var _0x5a4a47=[];var _0x1ad5d7={'context':_0x3dbbe4['context']||_0x3bbc('0x2'),'exten':util[_0x3bbc('0x3')](_0x3bbc('0x4'),_0x1ace8d[_0x3bbc('0x5')],_0x16e735),'type':'system','isApp':![],'ChanSpyId':_0x1ace8d['id'],'UserId':_0x3dbbe4['id']};_0x5a4a47[_0x3bbc('0x6')](_[_0x3bbc('0x7')]({'app':_0x3bbc('0x8'),'appdata':util['format'](_0x3bbc('0x9'),'chanspy'),'priority':_0x41c933++},_0x1ad5d7));if(_0x1ace8d[_0x3bbc('0xa')]){_0x5a4a47[_0x3bbc('0x6')](_['merge']({'app':'MixMonitor','appdata':util[_0x3bbc('0x3')](_0x3bbc('0xb'),_0x1ace8d[_0x3bbc('0xc')]),'priority':_0x41c933++},_0x1ad5d7));}if(_0x1ace8d[_0x3bbc('0xd')]){_0x5a4a47['push'](_[_0x3bbc('0x7')]({'app':'Authenticate','appdata':_0x1ace8d[_0x3bbc('0xe')],'priority':_0x41c933++},_0x1ad5d7));}_0x5a4a47[_0x3bbc('0x6')](_['merge']({'app':_0x3bbc('0xf'),'appdata':util['format'](_0x3bbc('0x10'),_0x3dbbe4[_0x3bbc('0x11')],_0x1ace8d[_0x3bbc('0x12')]?_0x1ace8d[_0x3bbc('0x12')][_0x3bbc('0x13')](''):''),'priority':_0x41c933++},_0x1ad5d7));if(_0x1ace8d[_0x3bbc('0xa')]){_0x5a4a47['push'](_[_0x3bbc('0x7')]({'app':_0x3bbc('0x14'),'priority':_0x41c933++},_0x1ad5d7));}return _0x5a4a47;};var getChanSpyApplications=function(_0x3dd7e8,_0x49f8f4){var _0x13f99a=[];for(var _0x3feb6e=0x0,_0x50b9d5=0x1;_0x3feb6e<_0x49f8f4['length'];_0x3feb6e++,_0x50b9d5=0x1){_0x13f99a=_0x13f99a[_0x3bbc('0x15')](getUserApplications(_0x3dd7e8,_0x49f8f4[_0x3feb6e],_0x49f8f4[_0x3feb6e][_0x3bbc('0x16')]));if(_0x49f8f4[_0x3feb6e][_0x3bbc('0x16')]!=_0x49f8f4[_0x3feb6e]['name']){_0x13f99a=_0x13f99a[_0x3bbc('0x15')](getUserApplications(_0x3dd7e8,_0x49f8f4[_0x3feb6e],_0x49f8f4[_0x3feb6e][_0x3bbc('0x11')]));}}return _0x13f99a;};var getChanSpyPromise=function(_0x3edfc7,_0x3d098e){return new BPromise(function(_0x4f3c14,_0x4aa256){return _0x3edfc7[_0x3bbc('0x17')][_0x3bbc('0x18')]({'attributes':['id',_0x3bbc('0x11'),_0x3bbc('0x16')],'where':{'role':_0x3bbc('0x19'),'chanspy':!![]},'raw':!![]})[_0x3bbc('0x1a')](function(_0x4b1dc5){if(_0x4b1dc5){return _0x4f3c14(getChanSpyApplications(_0x3d098e,_0x4b1dc5));}return _0x4f3c14([]);})[_0x3bbc('0x1b')](function(_0xef2e68){_0x4aa256(_0xef2e68);});});};module[_0x3bbc('0x1c')]=function(_0x52e95f,_0x1a3beb){var _0x5547b5=_0x52e95f['models'];return _0x52e95f['define']('VoiceChanSpy',attributes,{'tableName':_0x3bbc('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x46ce11,_0x3ffc36,_0x5346ba){return getChanSpyPromise(_0x5547b5,_0x46ce11)[_0x3bbc('0x1a')](function(_0x5b9259){if(_0x5b9259&&_0x5b9259[_0x3bbc('0x1e')]){return _0x5547b5['VoiceExtension'][_0x3bbc('0x1f')](_0x5b9259);}})[_0x3bbc('0x1a')](function(){_0x5346ba();})[_0x3bbc('0x1b')](function(_0x24f6c8){_0x5346ba(_0x24f6c8);});},'afterUpdate':function(_0x48f8c8,_0x48ffcc,_0x33387b){return _0x5547b5['VoiceExtension'][_0x3bbc('0x20')]({'where':{'ChanSpyId':_0x48f8c8['id']}})[_0x3bbc('0x1a')](function(){return getChanSpyPromise(_0x5547b5,_0x48f8c8);})[_0x3bbc('0x1a')](function(_0x327b64){if(_0x327b64&&_0x327b64[_0x3bbc('0x1e')]){return _0x5547b5[_0x3bbc('0x21')]['bulkCreate'](_0x327b64);}})['then'](function(){_0x33387b();})[_0x3bbc('0x1b')](function(_0xd2abbe){_0x33387b(_0xd2abbe);});},'afterDestroy':function(_0x149014,_0x3e6413,_0x11e2f7){return _0x5547b5['VoiceExtension'][_0x3bbc('0x20')]({'where':{'ChanSpyId':_0x149014['id']}})[_0x3bbc('0x1a')](function(){_0x11e2f7();})[_0x3bbc('0x1b')](function(_0x40f28d){_0x11e2f7(_0x40f28d);});}}});}; \ No newline at end of file +var _0x6597=['User','agent','catch','exports','models','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','lodash','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','system','push','Set','chanspy','record','MixMonitor','recordingFormat','auth','merge','Authenticate','password','ChanSpy','options','join','StopMixMonitor','length','concat','internal','name'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x6597,0x1a2));var _0x7659=function(_0x1106fd,_0x3f60f3){_0x1106fd=_0x1106fd-0x0;var _0x1975fb=_0x6597[_0x1106fd];return _0x1975fb;};'use strict';var _=require(_0x7659('0x0'));var util=require(_0x7659('0x1'));var BPromise=require('bluebird');var attributes=require(_0x7659('0x2'));var getUserApplications=function(_0x43525a,_0x4e038e,_0x515926){var _0x99d2ba=0x1;var _0x450f50=[];var _0x389d47={'context':_0x4e038e[_0x7659('0x3')]||_0x7659('0x4'),'exten':util[_0x7659('0x5')](_0x7659('0x6'),_0x43525a['prefix'],_0x515926),'type':_0x7659('0x7'),'isApp':![],'ChanSpyId':_0x43525a['id'],'UserId':_0x4e038e['id']};_0x450f50[_0x7659('0x8')](_['merge']({'app':_0x7659('0x9'),'appdata':util[_0x7659('0x5')]('CDR(type)=%s',_0x7659('0xa')),'priority':_0x99d2ba++},_0x389d47));if(_0x43525a[_0x7659('0xb')]){_0x450f50[_0x7659('0x8')](_['merge']({'app':_0x7659('0xc'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x43525a[_0x7659('0xd')]),'priority':_0x99d2ba++},_0x389d47));}if(_0x43525a[_0x7659('0xe')]){_0x450f50[_0x7659('0x8')](_[_0x7659('0xf')]({'app':_0x7659('0x10'),'appdata':_0x43525a[_0x7659('0x11')],'priority':_0x99d2ba++},_0x389d47));}_0x450f50[_0x7659('0x8')](_[_0x7659('0xf')]({'app':_0x7659('0x12'),'appdata':util[_0x7659('0x5')]('SIP/%s,%s',_0x4e038e['name'],_0x43525a[_0x7659('0x13')]?_0x43525a[_0x7659('0x13')][_0x7659('0x14')](''):''),'priority':_0x99d2ba++},_0x389d47));if(_0x43525a[_0x7659('0xb')]){_0x450f50[_0x7659('0x8')](_[_0x7659('0xf')]({'app':_0x7659('0x15'),'priority':_0x99d2ba++},_0x389d47));}return _0x450f50;};var getChanSpyApplications=function(_0x5005b0,_0x6140e8){var _0x506f61=[];for(var _0x2f60fc=0x0,_0x181b69=0x1;_0x2f60fc<_0x6140e8[_0x7659('0x16')];_0x2f60fc++,_0x181b69=0x1){_0x506f61=_0x506f61[_0x7659('0x17')](getUserApplications(_0x5005b0,_0x6140e8[_0x2f60fc],_0x6140e8[_0x2f60fc][_0x7659('0x18')]));if(_0x6140e8[_0x2f60fc][_0x7659('0x18')]!=_0x6140e8[_0x2f60fc][_0x7659('0x19')]){_0x506f61=_0x506f61['concat'](getUserApplications(_0x5005b0,_0x6140e8[_0x2f60fc],_0x6140e8[_0x2f60fc][_0x7659('0x19')]));}}return _0x506f61;};var getChanSpyPromise=function(_0x2d50c2,_0x3e5327){return new BPromise(function(_0x11a399,_0x37166d){return _0x2d50c2[_0x7659('0x1a')]['findAll']({'attributes':['id',_0x7659('0x19'),_0x7659('0x18')],'where':{'role':_0x7659('0x1b'),'chanspy':!![]},'raw':!![]})['then'](function(_0x3db4ed){if(_0x3db4ed){return _0x11a399(getChanSpyApplications(_0x3e5327,_0x3db4ed));}return _0x11a399([]);})[_0x7659('0x1c')](function(_0x3e6f04){_0x37166d(_0x3e6f04);});});};module[_0x7659('0x1d')]=function(_0x47930b,_0x5550f7){var _0x513f91=_0x47930b[_0x7659('0x1e')];return _0x47930b['define'](_0x7659('0x1f'),attributes,{'tableName':_0x7659('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x347b15,_0xebb2ad,_0x36dbf3){return getChanSpyPromise(_0x513f91,_0x347b15)[_0x7659('0x21')](function(_0x32bfa4){if(_0x32bfa4&&_0x32bfa4[_0x7659('0x16')]){return _0x513f91[_0x7659('0x22')][_0x7659('0x23')](_0x32bfa4);}})[_0x7659('0x21')](function(){_0x36dbf3();})[_0x7659('0x1c')](function(_0x3d38aa){_0x36dbf3(_0x3d38aa);});},'afterUpdate':function(_0x5b5b52,_0x4d6752,_0x58dc20){return _0x513f91[_0x7659('0x22')]['destroy']({'where':{'ChanSpyId':_0x5b5b52['id']}})[_0x7659('0x21')](function(){return getChanSpyPromise(_0x513f91,_0x5b5b52);})[_0x7659('0x21')](function(_0x496dd7){if(_0x496dd7&&_0x496dd7[_0x7659('0x16')]){return _0x513f91[_0x7659('0x22')][_0x7659('0x23')](_0x496dd7);}})[_0x7659('0x21')](function(){_0x58dc20();})[_0x7659('0x1c')](function(_0x571ea9){_0x58dc20(_0x571ea9);});},'afterDestroy':function(_0x42d4cf,_0x36ec7d,_0x4489b8){return _0x513f91[_0x7659('0x22')][_0x7659('0x24')]({'where':{'ChanSpyId':_0x42d4cf['id']}})[_0x7659('0x21')](function(){_0x4489b8();})[_0x7659('0x1c')](function(_0x43ba8b){_0x4489b8(_0x43ba8b);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 81e60f0..ca4e207 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x2194a6,_0x25267c){var _0x50cba1=function(_0x445126){while(--_0x445126){_0x2194a6['push'](_0x2194a6['shift']());}};_0x50cba1(++_0x25267c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x42bafd,_0x3f0fe3){_0x42bafd=_0x42bafd-0x0;var _0x2ed705=_0xcb91[_0x42bafd];return _0x2ed705;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0x2f3a=['http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x3d0477,_0x2d255e){var _0x244db3=function(_0x9e7745){while(--_0x9e7745){_0x3d0477['push'](_0x3d0477['shift']());}};_0x244db3(++_0x2d255e);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x1a13c7,_0x1e6fbd){_0x1a13c7=_0x1a13c7-0x0;var _0x48b1a3=_0x2f3a[_0x1a13c7];return _0x48b1a3;};'use strict';var _=require(_0xa2f3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa2f3('0x1'));var rs=require(_0xa2f3('0x2'));var fs=require('fs');var Redis=require(_0xa2f3('0x3'));var db=require(_0xa2f3('0x4'))['db'];var utils=require(_0xa2f3('0x5'));var logger=require(_0xa2f3('0x6'))('rpc');var config=require(_0xa2f3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa2f3('0x8')][_0xa2f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4db21d,_0x521ddf,_0x2faf36){return new BPromise(function(_0x3944a0,_0x4405a2){return client[_0xa2f3('0xa')](_0x4db21d,_0x2faf36)['then'](function(_0x358263){logger[_0xa2f3('0xb')](_0xa2f3('0xc'),_0x521ddf,_0xa2f3('0xd'));logger[_0xa2f3('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x521ddf,_0xa2f3('0xd'),JSON[_0xa2f3('0xf')](_0x358263));if(_0x358263['error']){if(_0x358263[_0xa2f3('0x10')][_0xa2f3('0x11')]===0x1f4){logger[_0xa2f3('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x521ddf,_0x358263[_0xa2f3('0x10')][_0xa2f3('0x12')]);return _0x4405a2(_0x358263[_0xa2f3('0x10')][_0xa2f3('0x12')]);}logger[_0xa2f3('0x10')](_0xa2f3('0xc'),_0x521ddf,_0x358263[_0xa2f3('0x10')][_0xa2f3('0x12')]);return _0x3944a0(_0x358263[_0xa2f3('0x10')]['message']);}else{logger[_0xa2f3('0xb')](_0xa2f3('0xc'),_0x521ddf,_0xa2f3('0xd'));_0x3944a0(_0x358263['result'][_0xa2f3('0x12')]);}})[_0xa2f3('0x13')](function(_0x4b138b){logger['error'](_0xa2f3('0xc'),_0x521ddf,_0x4b138b);_0x4405a2(_0x4b138b);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 62a100a..f1311f1 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 _0xc137=['../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4e35a2,_0x5aed71){var _0x1d4ebb=function(_0x22127f){while(--_0x22127f){_0x4e35a2['push'](_0x4e35a2['shift']());}};_0x1d4ebb(++_0x5aed71);}(_0xc137,0x116));var _0x7c13=function(_0x24de5f,_0x10aefd){_0x24de5f=_0x24de5f-0x0;var _0x4fa43e=_0xc137[_0x24de5f];return _0x4fa43e;};'use strict';var multer=require(_0x7c13('0x0'));var util=require(_0x7c13('0x1'));var path=require(_0x7c13('0x2'));var timeout=require(_0x7c13('0x3'));var express=require(_0x7c13('0x4'));var router=express[_0x7c13('0x5')]();var fs_extra=require(_0x7c13('0x6'));var auth=require(_0x7c13('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7c13('0x8'));var controller=require(_0x7c13('0x9'));router[_0x7c13('0xa')]('/',auth[_0x7c13('0xb')](),controller[_0x7c13('0xc')]);router[_0x7c13('0xa')]('/:id',auth[_0x7c13('0xb')](),controller[_0x7c13('0xd')]);router[_0x7c13('0xe')]('/',auth[_0x7c13('0xb')](),controller[_0x7c13('0xf')]);router['put']('/:id',auth[_0x7c13('0xb')](),controller['update']);router[_0x7c13('0x10')]('/:id',auth[_0x7c13('0xb')](),controller[_0x7c13('0x11')]);module[_0x7c13('0x12')]=router; \ No newline at end of file +var _0xc402=['Router','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xae54ea,_0x39bf42){var _0x5c6376=function(_0x45e09e){while(--_0x45e09e){_0xae54ea['push'](_0xae54ea['shift']());}};_0x5c6376(++_0x39bf42);}(_0xc402,0x175));var _0x2c40=function(_0x5b6a54,_0xf393d3){_0x5b6a54=_0x5b6a54-0x0;var _0x2b1a2e=_0xc402[_0x5b6a54];return _0x2b1a2e;};'use strict';var multer=require(_0x2c40('0x0'));var util=require(_0x2c40('0x1'));var path=require(_0x2c40('0x2'));var timeout=require(_0x2c40('0x3'));var express=require(_0x2c40('0x4'));var router=express[_0x2c40('0x5')]();var fs_extra=require(_0x2c40('0x6'));var auth=require(_0x2c40('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2c40('0x8'));var controller=require(_0x2c40('0x9'));router[_0x2c40('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x2c40('0xb')](),controller[_0x2c40('0xc')]);router[_0x2c40('0xd')]('/',auth[_0x2c40('0xb')](),controller[_0x2c40('0xe')]);router[_0x2c40('0xf')](_0x2c40('0x10'),auth[_0x2c40('0xb')](),controller[_0x2c40('0x11')]);router[_0x2c40('0x12')](_0x2c40('0x10'),auth[_0x2c40('0xb')](),controller[_0x2c40('0x13')]);module[_0x2c40('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index a41f1fd..6200094 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 _0x6de4=['exports','STRING','name','BOOLEAN'];(function(_0x1dd947,_0x2944fc){var _0x3e05b3=function(_0x15aa00){while(--_0x15aa00){_0x1dd947['push'](_0x1dd947['shift']());}};_0x3e05b3(++_0x2944fc);}(_0x6de4,0x178));var _0x46de=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x6de4[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');module[_0x46de('0x0')]={'name':{'type':Sequelize[_0x46de('0x1')],'unique':_0x46de('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x46de('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa01e=['sequelize','BOOLEAN'];(function(_0x1e2848,_0x589383){var _0x13f296=function(_0x67c59e){while(--_0x67c59e){_0x1e2848['push'](_0x1e2848['shift']());}};_0x13f296(++_0x589383);}(_0xa01e,0x106));var _0xea01=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa01e[_0x4bfac3];return _0x15f0f2;};'use strict';var Sequelize=require(_0xea01('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xea01('0x1')],'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 a1b8105..3632bad 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 _0x378f=['user','UserProfileSection','server/files/templates/context.ejs','join','eml-format','fast-json-patch','sox','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VoiceContext,\x20%s,\x20%s','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','find','create','body','readFileSync','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0xe7b1c0,_0x5af74f){var _0xee9f3c=function(_0x4e4133){while(--_0x4e4133){_0xe7b1c0['push'](_0xe7b1c0['shift']());}};_0xee9f3c(++_0x5af74f);}(_0x378f,0x124));var _0xf378=function(_0x99e141,_0x2e6727){_0x99e141=_0x99e141-0x0;var _0x1d4e59=_0x378f[_0x99e141];return _0x1d4e59;};'use strict';var emlformat=require(_0xf378('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf378('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf378('0x2'));var csv=require('to-csv');var ejs=require(_0xf378('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf378('0x4'));var jsforce=require(_0xf378('0x5'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf378('0x6'));var Papa=require(_0xf378('0x7'));var Redis=require(_0xf378('0x8'));var authService=require(_0xf378('0x9'));var qs=require(_0xf378('0xa'));var as=require(_0xf378('0xb'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf378('0xc'));var utils=require(_0xf378('0xd'));var config=require(_0xf378('0xe'));var licenseUtil=require(_0xf378('0xf'));var db=require(_0xf378('0x10'))['db'];var jayson=require(_0xf378('0x11'));var client=jayson['client'][_0xf378('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x3899d0,_0x38013d,_0x3907da,_0xd3a0d4){return new BPromise(function(_0x23eddf,_0x3a29d5){var _0x2687dc=_0xd3a0d4||client;return _0x2687dc[_0xf378('0x13')](_0x3899d0,_0x3907da)[_0xf378('0x14')](function(_0x48e610){logger[_0xf378('0x15')]('VoiceContext,\x20%s,\x20%s',_0x38013d,'request\x20sent');logger[_0xf378('0x16')](_0xf378('0x17'),_0x38013d,_0xf378('0x18'),JSON[_0xf378('0x19')](_0x48e610));if(_0x48e610[_0xf378('0x1a')]){if(_0x48e610[_0xf378('0x1a')][_0xf378('0x1b')]===0x1f4){logger[_0xf378('0x1a')]('VoiceContext,\x20%s,\x20%s',_0x38013d,_0x48e610[_0xf378('0x1a')]['message']);return _0x3a29d5(_0x48e610['error']['message']);}logger[_0xf378('0x1a')]('VoiceContext,\x20%s,\x20%s',_0x38013d,_0x48e610['error'][_0xf378('0x1c')]);return _0x23eddf(_0x48e610[_0xf378('0x1a')][_0xf378('0x1c')]);}else{logger[_0xf378('0x15')]('VoiceContext,\x20%s,\x20%s',_0x38013d,_0xf378('0x18'));_0x23eddf(_0x48e610[_0xf378('0x1d')][_0xf378('0x1c')]);}})[_0xf378('0x1e')](function(_0x1c81d9){logger[_0xf378('0x1a')](_0xf378('0x1f'),_0x38013d,_0x1c81d9);_0x3a29d5(_0x1c81d9);});});}function respondWithStatusCode(_0x575dad,_0x3d0b55){_0x3d0b55=_0x3d0b55||0xcc;return function(_0xcee56f){if(_0xcee56f){return _0x575dad[_0xf378('0x20')](_0x3d0b55);}return _0x575dad[_0xf378('0x21')](_0x3d0b55)[_0xf378('0x22')]();};}function respondWithResult(_0x251dbd,_0x40da1e){_0x40da1e=_0x40da1e||0xc8;return function(_0x373f59){if(_0x373f59){return _0x251dbd[_0xf378('0x21')](_0x40da1e)['json'](_0x373f59);}};}function respondWithFilteredResult(_0x12fb6b,_0x5e373f){return function(_0x46ab13){if(_0x46ab13){var _0x53ed92=typeof _0x5e373f[_0xf378('0x23')]==='undefined'&&typeof _0x5e373f[_0xf378('0x24')]===_0xf378('0x25');var _0x33c21b=_0x46ab13[_0xf378('0x26')];var _0x5c35a2=_0x53ed92?0x0:_0x5e373f['offset'];var _0x3763fc=_0x53ed92?_0x46ab13[_0xf378('0x26')]:_0x5e373f[_0xf378('0x23')]+_0x5e373f[_0xf378('0x24')];var _0xbd5ecf;if(_0x3763fc>=_0x33c21b){_0x3763fc=_0x33c21b;_0xbd5ecf=0xc8;}else{_0xbd5ecf=0xce;}_0x12fb6b[_0xf378('0x21')](_0xbd5ecf);return _0x12fb6b['set'](_0xf378('0x27'),_0x5c35a2+'-'+_0x3763fc+'/'+_0x33c21b)[_0xf378('0x28')](_0x46ab13);}return null;};}function patchUpdates(_0x4d4323){return function(_0x169cbc){try{jsonpatch[_0xf378('0x29')](_0x169cbc,_0x4d4323,!![]);}catch(_0xb4026c){return BPromise['reject'](_0xb4026c);}return _0x169cbc[_0xf378('0x2a')]();};}function saveUpdates(_0x1661c7,_0x379262){return function(_0x131aca){if(_0x131aca){return _0x131aca[_0xf378('0x2b')](_0x1661c7)[_0xf378('0x14')](function(_0x2958a5){return _0x2958a5;});}return null;};}function removeEntity(_0xaa12b9,_0x22a90d){return function(_0x5c8eae){if(_0x5c8eae){return _0x5c8eae[_0xf378('0x2c')]()['then'](function(){var _0x509b74=_0x5c8eae[_0xf378('0x2d')]({'plain':!![]});var _0x1e706f=_0xf378('0x2e');return db[_0xf378('0x2f')][_0xf378('0x2c')]({'where':{'type':_0x1e706f,'resourceId':_0x509b74['id']}})[_0xf378('0x14')](function(){return _0x5c8eae;});})['then'](function(){_0xaa12b9[_0xf378('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x136584,_0x1c91d6){return function(_0x15de53){if(!_0x15de53){_0x136584['sendStatus'](0x194);}return _0x15de53;};}function handleError(_0x2d4c91,_0x516c1c){_0x516c1c=_0x516c1c||0x1f4;return function(_0x3ea2a0){logger[_0xf378('0x1a')](_0x3ea2a0[_0xf378('0x30')]);if(_0x3ea2a0[_0xf378('0x31')]){delete _0x3ea2a0[_0xf378('0x31')];}_0x2d4c91['status'](_0x516c1c)[_0xf378('0x32')](_0x3ea2a0);};}exports[_0xf378('0x33')]=function(_0x18f075,_0x377a79){var _0x401c27={},_0x2a8fce={},_0x5c26e2={'count':0x0,'rows':[]};var _0x582c19=_[_0xf378('0x34')](db[_0xf378('0x35')][_0xf378('0x36')],function(_0x1214e9){return{'name':_0x1214e9['fieldName'],'type':_0x1214e9['type'][_0xf378('0x37')]};});_0x2a8fce['model']=_[_0xf378('0x34')](_0x582c19,_0xf378('0x31'));_0x2a8fce[_0xf378('0x38')]=_[_0xf378('0x39')](_0x18f075[_0xf378('0x38')]);_0x2a8fce[_0xf378('0x3a')]=_[_0xf378('0x3b')](_0x2a8fce[_0xf378('0x3c')],_0x2a8fce[_0xf378('0x38')]);_0x401c27[_0xf378('0x3d')]=_[_0xf378('0x3b')](_0x2a8fce[_0xf378('0x3c')],qs[_0xf378('0x3e')](_0x18f075[_0xf378('0x38')][_0xf378('0x3e')]));_0x401c27[_0xf378('0x3d')]=_0x401c27['attributes']['length']?_0x401c27['attributes']:_0x2a8fce[_0xf378('0x3c')];if(!_0x18f075[_0xf378('0x38')]['hasOwnProperty'](_0xf378('0x3f'))){_0x401c27[_0xf378('0x24')]=qs[_0xf378('0x24')](_0x18f075[_0xf378('0x38')]['limit']);_0x401c27[_0xf378('0x23')]=qs[_0xf378('0x23')](_0x18f075[_0xf378('0x38')][_0xf378('0x23')]);}_0x401c27[_0xf378('0x40')]=qs[_0xf378('0x41')](_0x18f075['query'][_0xf378('0x41')]);_0x401c27[_0xf378('0x42')]=qs[_0xf378('0x3a')](_['pick'](_0x18f075[_0xf378('0x38')],_0x2a8fce[_0xf378('0x3a')]),_0x582c19);if(_0x18f075[_0xf378('0x38')][_0xf378('0x43')]){_0x401c27[_0xf378('0x42')]=_[_0xf378('0x44')](_0x401c27[_0xf378('0x42')],{'$or':_[_0xf378('0x34')](_0x582c19,function(_0x1ce76e){if(_0x1ce76e[_0xf378('0x45')]!==_0xf378('0x46')){var _0x54aef4={};_0x54aef4[_0x1ce76e[_0xf378('0x31')]]={'$like':'%'+_0x18f075[_0xf378('0x38')][_0xf378('0x43')]+'%'};return _0x54aef4;}})});}_0x401c27=_['merge']({},_0x401c27,_0x18f075[_0xf378('0x47')]);var _0x5ec848={'where':_0x401c27[_0xf378('0x42')]};return db[_0xf378('0x35')][_0xf378('0x26')](_0x5ec848)[_0xf378('0x14')](function(_0x516a9d){_0x5c26e2[_0xf378('0x26')]=_0x516a9d;if(_0x18f075[_0xf378('0x38')]['includeAll']){_0x401c27[_0xf378('0x48')]=[{'all':!![]}];}return db['VoiceContext'][_0xf378('0x49')](_0x401c27);})[_0xf378('0x14')](function(_0x18f5cf){_0x5c26e2[_0xf378('0x4a')]=_0x18f5cf;return _0x5c26e2;})[_0xf378('0x14')](respondWithFilteredResult(_0x377a79,_0x401c27))[_0xf378('0x1e')](handleError(_0x377a79,null));};exports[_0xf378('0x4b')]=function(_0x286cad,_0x54d8bd){var _0x3c5b75={'raw':![],'where':{'id':_0x286cad[_0xf378('0x4c')]['id']}},_0x3e4b={};_0x3e4b['model']=_[_0xf378('0x39')](db[_0xf378('0x35')][_0xf378('0x36')]);_0x3e4b[_0xf378('0x38')]=_[_0xf378('0x39')](_0x286cad[_0xf378('0x38')]);_0x3e4b[_0xf378('0x3a')]=_[_0xf378('0x3b')](_0x3e4b[_0xf378('0x3c')],_0x3e4b[_0xf378('0x38')]);_0x3c5b75[_0xf378('0x3d')]=_[_0xf378('0x3b')](_0x3e4b[_0xf378('0x3c')],qs[_0xf378('0x3e')](_0x286cad['query'][_0xf378('0x3e')]));_0x3c5b75['attributes']=_0x3c5b75[_0xf378('0x3d')][_0xf378('0x4d')]?_0x3c5b75[_0xf378('0x3d')]:_0x3e4b[_0xf378('0x3c')];if(_0x286cad[_0xf378('0x38')][_0xf378('0x4e')]){_0x3c5b75[_0xf378('0x48')]=[{'all':!![]}];}_0x3c5b75=_['merge']({},_0x3c5b75,_0x286cad[_0xf378('0x47')]);return db[_0xf378('0x35')][_0xf378('0x4f')](_0x3c5b75)[_0xf378('0x14')](handleEntityNotFound(_0x54d8bd,null))[_0xf378('0x14')](respondWithResult(_0x54d8bd,null))[_0xf378('0x1e')](handleError(_0x54d8bd,null));};exports[_0xf378('0x50')]=function(_0x2d3e3d,_0x3fefb8,_0xa6044){var _0x39080e;return db[_0xf378('0x35')][_0xf378('0x50')](_0x2d3e3d[_0xf378('0x51')],{'raw':!![]})['then'](function(_0x1beee9){_0x39080e=_0x1beee9;return db['VoiceContext']['findAll']({'raw':!![]});})[_0xf378('0x14')](function(_0x42630e){var _0x30fc0f=fs[_0xf378('0x52')](path['join'](config[_0xf378('0x53')],'server/files/templates/context.ejs'),_0xf378('0x54'));var _0x1c72db=ejs[_0xf378('0x55')](_0x30fc0f,{'contexts':_0x42630e||[]});fs[_0xf378('0x56')](_0xf378('0x57'),_0x1c72db);})[_0xf378('0x14')](function(){return respondWithRpcPromise(_0xf378('0x58'),_0xf378('0x50'),{'module':_0xf378('0x59')});})[_0xf378('0x14')](function(){var _0x1cf5ec=_0x2d3e3d['user'][_0xf378('0x2d')]({'plain':!![]});if(!_0x1cf5ec)throw new Error(_0xf378('0x5a'));if(_0x1cf5ec[_0xf378('0x5b')]===_0xf378('0x5c')){var _0x4f6957=_0x39080e['get']({'plain':!![]});return db[_0xf378('0x5d')][_0xf378('0x4f')]({'where':{'name':_0xf378('0x2e'),'userProfileId':_0x1cf5ec['userProfileId']},'raw':!![]})['then'](function(_0x55475d){if(_0x55475d&&_0x55475d['autoAssociation']===0x0){return db[_0xf378('0x2f')][_0xf378('0x50')]({'name':_0x4f6957[_0xf378('0x31')],'resourceId':_0x4f6957['id'],'type':_0x55475d['name'],'sectionId':_0x55475d['id']},{})[_0xf378('0x14')](function(){return _0x39080e;});}else{return _0x39080e;}})['catch'](function(_0x8a1625){logger[_0xf378('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8a1625);throw _0x8a1625;});}return _0x39080e;})[_0xf378('0x14')](respondWithResult(_0x3fefb8,0xc9))[_0xf378('0x1e')](handleError(_0x3fefb8,null));};exports[_0xf378('0x2b')]=function(_0xe1c362,_0x4f6b27,_0x331841){var _0x32d0b4;return db[_0xf378('0x35')]['find']({'where':{'id':_0xe1c362[_0xf378('0x4c')]['id']}})[_0xf378('0x14')](handleEntityNotFound(_0x4f6b27,null))[_0xf378('0x14')](saveUpdates(_0xe1c362[_0xf378('0x51')],null))[_0xf378('0x14')](function(_0x2fa590){if(_0x2fa590){_0x32d0b4=_0x2fa590;return db[_0xf378('0x35')]['findAll']({'raw':!![]});}})['then'](function(_0x111903){var _0x5804ba=fs[_0xf378('0x52')](path['join'](config['root'],_0xf378('0x5e')),_0xf378('0x54'));var _0x5070b6=ejs['render'](_0x5804ba,{'contexts':_0x111903||[]});fs[_0xf378('0x56')](_0xf378('0x57'),_0x5070b6);})[_0xf378('0x14')](function(){return respondWithRpcPromise(_0xf378('0x58'),_0xf378('0x2b'),{'module':_0xf378('0x59')});})[_0xf378('0x14')](function(){return _0x32d0b4;})[_0xf378('0x14')](respondWithResult(_0x4f6b27,null))[_0xf378('0x1e')](handleError(_0x4f6b27,null));};exports[_0xf378('0x2c')]=function(_0x553880,_0x442b59,_0x2f286c){var _0x17ed31;return db[_0xf378('0x35')][_0xf378('0x4f')]({'where':{'id':_0x553880['params']['id']}})[_0xf378('0x14')](handleEntityNotFound(_0x442b59,null))[_0xf378('0x14')](removeEntity(_0x442b59,null))['then'](function(){return db[_0xf378('0x35')][_0xf378('0x49')]({'raw':!![]});})[_0xf378('0x14')](function(_0x4b47c2){var _0x18a6ce=fs[_0xf378('0x52')](path[_0xf378('0x5f')](config['root'],'server/files/templates/context.ejs'),_0xf378('0x54'));var _0x4d2725=ejs[_0xf378('0x55')](_0x18a6ce,{'contexts':_0x4b47c2});fs['writeFileSync'](_0xf378('0x57'),_0x4d2725);return respondWithRpcPromise('Reload',_0xf378('0x2c'),{'module':_0xf378('0x59')});})[_0xf378('0x1e')](handleError(_0x442b59,null));}; \ No newline at end of file +var _0x5cdf=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','get','Contexts','end','name','send','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','find','create','body','readFileSync','join','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','server/files/templates/context.ejs','writeFileSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x5cdf,0xb8));var _0xf5cd=function(_0x782890,_0x52135b){_0x782890=_0x782890-0x0;var _0x428ffa=_0x5cdf[_0x782890];return _0x428ffa;};'use strict';var emlformat=require(_0xf5cd('0x0'));var rimraf=require(_0xf5cd('0x1'));var zipdir=require(_0xf5cd('0x2'));var jsonpatch=require(_0xf5cd('0x3'));var rp=require(_0xf5cd('0x4'));var moment=require(_0xf5cd('0x5'));var BPromise=require(_0xf5cd('0x6'));var Mustache=require(_0xf5cd('0x7'));var util=require(_0xf5cd('0x8'));var path=require(_0xf5cd('0x9'));var sox=require(_0xf5cd('0xa'));var csv=require(_0xf5cd('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf5cd('0xc'));var crypto=require('crypto');var jsforce=require(_0xf5cd('0xd'));var deskjs=require(_0xf5cd('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf5cd('0xf'));var Papa=require(_0xf5cd('0x10'));var Redis=require(_0xf5cd('0x11'));var authService=require(_0xf5cd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5cd('0x13'));var hardwareService=require(_0xf5cd('0x14'));var logger=require('../../config/logger')(_0xf5cd('0x15'));var utils=require(_0xf5cd('0x16'));var config=require(_0xf5cd('0x17'));var licenseUtil=require(_0xf5cd('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf5cd('0x19'));var client=jayson[_0xf5cd('0x1a')][_0xf5cd('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x20acda,_0x131d00,_0x2cb781,_0x32c649){return new BPromise(function(_0x4d3b14,_0x601fd3){var _0x4f37b3=_0x32c649||client;return _0x4f37b3[_0xf5cd('0x1c')](_0x20acda,_0x2cb781)[_0xf5cd('0x1d')](function(_0x2bfa54){logger['info'](_0xf5cd('0x1e'),_0x131d00,_0xf5cd('0x1f'));logger[_0xf5cd('0x20')](_0xf5cd('0x21'),_0x131d00,_0xf5cd('0x1f'),JSON['stringify'](_0x2bfa54));if(_0x2bfa54[_0xf5cd('0x22')]){if(_0x2bfa54['error'][_0xf5cd('0x23')]===0x1f4){logger[_0xf5cd('0x22')](_0xf5cd('0x1e'),_0x131d00,_0x2bfa54['error'][_0xf5cd('0x24')]);return _0x601fd3(_0x2bfa54[_0xf5cd('0x22')][_0xf5cd('0x24')]);}logger[_0xf5cd('0x22')](_0xf5cd('0x1e'),_0x131d00,_0x2bfa54['error'][_0xf5cd('0x24')]);return _0x4d3b14(_0x2bfa54['error']['message']);}else{logger[_0xf5cd('0x25')](_0xf5cd('0x1e'),_0x131d00,_0xf5cd('0x1f'));_0x4d3b14(_0x2bfa54[_0xf5cd('0x26')]['message']);}})[_0xf5cd('0x27')](function(_0x105583){logger[_0xf5cd('0x22')](_0xf5cd('0x1e'),_0x131d00,_0x105583);_0x601fd3(_0x105583);});});}function respondWithStatusCode(_0x4c99b6,_0x747e76){_0x747e76=_0x747e76||0xcc;return function(_0x36a3b6){if(_0x36a3b6){return _0x4c99b6[_0xf5cd('0x28')](_0x747e76);}return _0x4c99b6[_0xf5cd('0x29')](_0x747e76)['end']();};}function respondWithResult(_0x395b9c,_0x13c88c){_0x13c88c=_0x13c88c||0xc8;return function(_0x57b581){if(_0x57b581){return _0x395b9c[_0xf5cd('0x29')](_0x13c88c)[_0xf5cd('0x2a')](_0x57b581);}};}function respondWithFilteredResult(_0x8324e0,_0x47db9a){return function(_0x5d6814){if(_0x5d6814){var _0x15e99=typeof _0x47db9a[_0xf5cd('0x2b')]===_0xf5cd('0x2c')&&typeof _0x47db9a[_0xf5cd('0x2d')]===_0xf5cd('0x2c');var _0x3bf060=_0x5d6814['count'];var _0x388e47=_0x15e99?0x0:_0x47db9a[_0xf5cd('0x2b')];var _0x144fdf=_0x15e99?_0x5d6814[_0xf5cd('0x2e')]:_0x47db9a['offset']+_0x47db9a[_0xf5cd('0x2d')];var _0xbb29c7;if(_0x144fdf>=_0x3bf060){_0x144fdf=_0x3bf060;_0xbb29c7=0xc8;}else{_0xbb29c7=0xce;}_0x8324e0['status'](_0xbb29c7);return _0x8324e0[_0xf5cd('0x2f')]('Content-Range',_0x388e47+'-'+_0x144fdf+'/'+_0x3bf060)['json'](_0x5d6814);}return null;};}function patchUpdates(_0x3238f7){return function(_0x36f1ab){try{jsonpatch[_0xf5cd('0x30')](_0x36f1ab,_0x3238f7,!![]);}catch(_0x5a70ae){return BPromise['reject'](_0x5a70ae);}return _0x36f1ab[_0xf5cd('0x31')]();};}function saveUpdates(_0x33e8f0,_0x380f30){return function(_0x26c0e6){if(_0x26c0e6){return _0x26c0e6[_0xf5cd('0x32')](_0x33e8f0)['then'](function(_0x710152){return _0x710152;});}return null;};}function removeEntity(_0x4f9717,_0x44b0c1){return function(_0x2c58d8){if(_0x2c58d8){return _0x2c58d8[_0xf5cd('0x33')]()[_0xf5cd('0x1d')](function(){var _0x4e4f8f=_0x2c58d8[_0xf5cd('0x34')]({'plain':!![]});var _0x237d0b=_0xf5cd('0x35');return db['UserProfileResource'][_0xf5cd('0x33')]({'where':{'type':_0x237d0b,'resourceId':_0x4e4f8f['id']}})[_0xf5cd('0x1d')](function(){return _0x2c58d8;});})[_0xf5cd('0x1d')](function(){_0x4f9717[_0xf5cd('0x29')](0xcc)[_0xf5cd('0x36')]();});}};}function handleEntityNotFound(_0x40bdc2,_0x49ad0c){return function(_0x34f3b8){if(!_0x34f3b8){_0x40bdc2[_0xf5cd('0x28')](0x194);}return _0x34f3b8;};}function handleError(_0x2d1fe6,_0x2d85b0){_0x2d85b0=_0x2d85b0||0x1f4;return function(_0xb35ce8){logger['error'](_0xb35ce8['stack']);if(_0xb35ce8[_0xf5cd('0x37')]){delete _0xb35ce8[_0xf5cd('0x37')];}_0x2d1fe6[_0xf5cd('0x29')](_0x2d85b0)[_0xf5cd('0x38')](_0xb35ce8);};}exports['index']=function(_0x5ddf0d,_0x1c807b){var _0x5bbe4c={},_0x100e62={},_0x22a78d={'count':0x0,'rows':[]};var _0x2f54d8=_['map'](db[_0xf5cd('0x39')][_0xf5cd('0x3a')],function(_0x520f7f){return{'name':_0x520f7f[_0xf5cd('0x3b')],'type':_0x520f7f[_0xf5cd('0x3c')][_0xf5cd('0x3d')]};});_0x100e62[_0xf5cd('0x3e')]=_['map'](_0x2f54d8,_0xf5cd('0x37'));_0x100e62[_0xf5cd('0x3f')]=_[_0xf5cd('0x40')](_0x5ddf0d['query']);_0x100e62[_0xf5cd('0x41')]=_['intersection'](_0x100e62['model'],_0x100e62[_0xf5cd('0x3f')]);_0x5bbe4c[_0xf5cd('0x42')]=_['intersection'](_0x100e62[_0xf5cd('0x3e')],qs[_0xf5cd('0x43')](_0x5ddf0d[_0xf5cd('0x3f')]['fields']));_0x5bbe4c[_0xf5cd('0x42')]=_0x5bbe4c['attributes'][_0xf5cd('0x44')]?_0x5bbe4c['attributes']:_0x100e62['model'];if(!_0x5ddf0d['query']['hasOwnProperty']('nolimit')){_0x5bbe4c[_0xf5cd('0x2d')]=qs['limit'](_0x5ddf0d[_0xf5cd('0x3f')][_0xf5cd('0x2d')]);_0x5bbe4c[_0xf5cd('0x2b')]=qs[_0xf5cd('0x2b')](_0x5ddf0d[_0xf5cd('0x3f')][_0xf5cd('0x2b')]);}_0x5bbe4c[_0xf5cd('0x45')]=qs[_0xf5cd('0x46')](_0x5ddf0d['query']['sort']);_0x5bbe4c['where']=qs[_0xf5cd('0x41')](_[_0xf5cd('0x47')](_0x5ddf0d['query'],_0x100e62[_0xf5cd('0x41')]),_0x2f54d8);if(_0x5ddf0d[_0xf5cd('0x3f')][_0xf5cd('0x48')]){_0x5bbe4c[_0xf5cd('0x49')]=_[_0xf5cd('0x4a')](_0x5bbe4c['where'],{'$or':_[_0xf5cd('0x4b')](_0x2f54d8,function(_0x4ef78c){if(_0x4ef78c[_0xf5cd('0x3c')]!==_0xf5cd('0x4c')){var _0x144035={};_0x144035[_0x4ef78c['name']]={'$like':'%'+_0x5ddf0d[_0xf5cd('0x3f')]['filter']+'%'};return _0x144035;}})});}_0x5bbe4c=_[_0xf5cd('0x4a')]({},_0x5bbe4c,_0x5ddf0d[_0xf5cd('0x4d')]);var _0x4b00c9={'where':_0x5bbe4c[_0xf5cd('0x49')]};return db[_0xf5cd('0x39')][_0xf5cd('0x2e')](_0x4b00c9)['then'](function(_0x18174d){_0x22a78d['count']=_0x18174d;if(_0x5ddf0d[_0xf5cd('0x3f')][_0xf5cd('0x4e')]){_0x5bbe4c[_0xf5cd('0x4f')]=[{'all':!![]}];}return db['VoiceContext'][_0xf5cd('0x50')](_0x5bbe4c);})[_0xf5cd('0x1d')](function(_0x2a6824){_0x22a78d[_0xf5cd('0x51')]=_0x2a6824;return _0x22a78d;})[_0xf5cd('0x1d')](respondWithFilteredResult(_0x1c807b,_0x5bbe4c))[_0xf5cd('0x27')](handleError(_0x1c807b,null));};exports[_0xf5cd('0x52')]=function(_0x2ad45f,_0x445397){var _0xfa86bb={'raw':![],'where':{'id':_0x2ad45f[_0xf5cd('0x53')]['id']}},_0x534069={};_0x534069[_0xf5cd('0x3e')]=_[_0xf5cd('0x40')](db['VoiceContext'][_0xf5cd('0x3a')]);_0x534069['query']=_[_0xf5cd('0x40')](_0x2ad45f[_0xf5cd('0x3f')]);_0x534069['filters']=_[_0xf5cd('0x54')](_0x534069[_0xf5cd('0x3e')],_0x534069[_0xf5cd('0x3f')]);_0xfa86bb[_0xf5cd('0x42')]=_[_0xf5cd('0x54')](_0x534069[_0xf5cd('0x3e')],qs['fields'](_0x2ad45f['query'][_0xf5cd('0x43')]));_0xfa86bb[_0xf5cd('0x42')]=_0xfa86bb[_0xf5cd('0x42')][_0xf5cd('0x44')]?_0xfa86bb['attributes']:_0x534069[_0xf5cd('0x3e')];if(_0x2ad45f['query'][_0xf5cd('0x4e')]){_0xfa86bb['include']=[{'all':!![]}];}_0xfa86bb=_[_0xf5cd('0x4a')]({},_0xfa86bb,_0x2ad45f['options']);return db['VoiceContext'][_0xf5cd('0x55')](_0xfa86bb)[_0xf5cd('0x1d')](handleEntityNotFound(_0x445397,null))[_0xf5cd('0x1d')](respondWithResult(_0x445397,null))[_0xf5cd('0x27')](handleError(_0x445397,null));};exports['create']=function(_0x41854c,_0x1f3ce9,_0x4dedf4){var _0x1d623f;return db[_0xf5cd('0x39')][_0xf5cd('0x56')](_0x41854c[_0xf5cd('0x57')],{'raw':!![]})[_0xf5cd('0x1d')](function(_0x15c823){_0x1d623f=_0x15c823;return db[_0xf5cd('0x39')][_0xf5cd('0x50')]({'raw':!![]});})[_0xf5cd('0x1d')](function(_0x2e1212){var _0x368a6f=fs[_0xf5cd('0x58')](path[_0xf5cd('0x59')](config['root'],'server/files/templates/context.ejs'),_0xf5cd('0x5a'));var _0x4b21c1=ejs[_0xf5cd('0x5b')](_0x368a6f,{'contexts':_0x2e1212||[]});fs['writeFileSync'](_0xf5cd('0x5c'),_0x4b21c1);})[_0xf5cd('0x1d')](function(){return respondWithRpcPromise(_0xf5cd('0x5d'),_0xf5cd('0x56'),{'module':_0xf5cd('0x5e')});})[_0xf5cd('0x1d')](function(){var _0x392f2b=_0x41854c[_0xf5cd('0x5f')][_0xf5cd('0x34')]({'plain':!![]});if(!_0x392f2b)throw new Error(_0xf5cd('0x60'));if(_0x392f2b['role']===_0xf5cd('0x5f')){var _0x4cd217=_0x1d623f['get']({'plain':!![]});return db['UserProfileSection'][_0xf5cd('0x55')]({'where':{'name':_0xf5cd('0x35'),'userProfileId':_0x392f2b[_0xf5cd('0x61')]},'raw':!![]})[_0xf5cd('0x1d')](function(_0x17aab){if(_0x17aab&&_0x17aab[_0xf5cd('0x62')]===0x0){return db[_0xf5cd('0x63')][_0xf5cd('0x56')]({'name':_0x4cd217[_0xf5cd('0x37')],'resourceId':_0x4cd217['id'],'type':_0x17aab[_0xf5cd('0x37')],'sectionId':_0x17aab['id']},{})[_0xf5cd('0x1d')](function(){return _0x1d623f;});}else{return _0x1d623f;}})[_0xf5cd('0x27')](function(_0x1e41e8){logger[_0xf5cd('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e41e8);throw _0x1e41e8;});}return _0x1d623f;})[_0xf5cd('0x1d')](respondWithResult(_0x1f3ce9,0xc9))['catch'](handleError(_0x1f3ce9,null));};exports[_0xf5cd('0x32')]=function(_0x754dea,_0x2b8397,_0x169379){var _0x1a4b37;return db[_0xf5cd('0x39')][_0xf5cd('0x55')]({'where':{'id':_0x754dea[_0xf5cd('0x53')]['id']}})[_0xf5cd('0x1d')](handleEntityNotFound(_0x2b8397,null))[_0xf5cd('0x1d')](saveUpdates(_0x754dea[_0xf5cd('0x57')],null))[_0xf5cd('0x1d')](function(_0x21756c){if(_0x21756c){_0x1a4b37=_0x21756c;return db[_0xf5cd('0x39')][_0xf5cd('0x50')]({'raw':!![]});}})[_0xf5cd('0x1d')](function(_0xe1881){var _0xbfa04a=fs['readFileSync'](path['join'](config['root'],_0xf5cd('0x64')),_0xf5cd('0x5a'));var _0x3b67dc=ejs[_0xf5cd('0x5b')](_0xbfa04a,{'contexts':_0xe1881||[]});fs[_0xf5cd('0x65')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3b67dc);})[_0xf5cd('0x1d')](function(){return respondWithRpcPromise('Reload',_0xf5cd('0x32'),{'module':_0xf5cd('0x5e')});})[_0xf5cd('0x1d')](function(){return _0x1a4b37;})[_0xf5cd('0x1d')](respondWithResult(_0x2b8397,null))[_0xf5cd('0x27')](handleError(_0x2b8397,null));};exports['destroy']=function(_0x83b4ae,_0x1b2edd,_0x5aa738){var _0x56ba86;return db[_0xf5cd('0x39')][_0xf5cd('0x55')]({'where':{'id':_0x83b4ae[_0xf5cd('0x53')]['id']}})[_0xf5cd('0x1d')](handleEntityNotFound(_0x1b2edd,null))[_0xf5cd('0x1d')](removeEntity(_0x1b2edd,null))[_0xf5cd('0x1d')](function(){return db['VoiceContext'][_0xf5cd('0x50')]({'raw':!![]});})[_0xf5cd('0x1d')](function(_0x19a964){var _0x51b51a=fs[_0xf5cd('0x58')](path[_0xf5cd('0x59')](config['root'],_0xf5cd('0x64')),_0xf5cd('0x5a'));var _0x3b2503=ejs['render'](_0x51b51a,{'contexts':_0x19a964});fs['writeFileSync'](_0xf5cd('0x5c'),_0x3b2503);return respondWithRpcPromise('Reload','destroy',{'module':_0xf5cd('0x5e')});})[_0xf5cd('0x27')](handleError(_0x1b2edd,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 20d5076..8e69160 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 _0x8e53=['../../config/environment','define','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x405df7,_0x2a3e43){var _0x1829eb=function(_0x3a886a){while(--_0x3a886a){_0x405df7['push'](_0x405df7['shift']());}};_0x1829eb(++_0x2a3e43);}(_0x8e53,0xb6));var _0x38e5=function(_0x1e303c,_0x406229){_0x1e303c=_0x1e303c-0x0;var _0x5badd7=_0x8e53[_0x1e303c];return _0x5badd7;};'use strict';var _=require(_0x38e5('0x0'));var util=require('util');var logger=require(_0x38e5('0x1'))(_0x38e5('0x2'));var moment=require(_0x38e5('0x3'));var BPromise=require(_0x38e5('0x4'));var rp=require(_0x38e5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x38e5('0x6'));var config=require(_0x38e5('0x7'));var attributes=require('./voiceContext.attributes');module['exports']=function(_0x2b9064,_0x526830){return _0x2b9064[_0x38e5('0x8')]('VoiceContext',attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57c0=['../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x49dba6,_0x46b1a7){var _0x2ca633=function(_0x315d66){while(--_0x315d66){_0x49dba6['push'](_0x49dba6['shift']());}};_0x2ca633(++_0x46b1a7);}(_0x57c0,0xa0));var _0x057c=function(_0x343c76,_0x1cac3a){_0x343c76=_0x343c76-0x0;var _0x1bb83=_0x57c0[_0x343c76];return _0x1bb83;};'use strict';var _=require(_0x057c('0x0'));var util=require(_0x057c('0x1'));var logger=require('../../config/logger')(_0x057c('0x2'));var moment=require(_0x057c('0x3'));var BPromise=require(_0x057c('0x4'));var rp=require(_0x057c('0x5'));var fs=require('fs');var path=require(_0x057c('0x6'));var rimraf=require(_0x057c('0x7'));var config=require(_0x057c('0x8'));var attributes=require(_0x057c('0x9'));module[_0x057c('0xa')]=function(_0x406fa6,_0x3ab2ad){return _0x406fa6[_0x057c('0xb')](_0x057c('0xc'),attributes,{'tableName':_0x057c('0xd'),'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 9e94099..c8a3b64 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 _0xd6d8=['VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug'];(function(_0x54b665,_0x57c07b){var _0x3e6160=function(_0x506bb8){while(--_0x506bb8){_0x54b665['push'](_0x54b665['shift']());}};_0x3e6160(++_0x57c07b);}(_0xd6d8,0x1a8));var _0x8d6d=function(_0x49aa7d,_0x5d46d8){_0x49aa7d=_0x49aa7d-0x0;var _0xdd0d26=_0xd6d8[_0x49aa7d];return _0xdd0d26;};'use strict';var _=require(_0x8d6d('0x0'));var util=require(_0x8d6d('0x1'));var moment=require(_0x8d6d('0x2'));var BPromise=require(_0x8d6d('0x3'));var rs=require(_0x8d6d('0x4'));var fs=require('fs');var Redis=require(_0x8d6d('0x5'));var db=require(_0x8d6d('0x6'))['db'];var utils=require(_0x8d6d('0x7'));var logger=require('../../config/logger')(_0x8d6d('0x8'));var config=require('../../config/environment');var jayson=require(_0x8d6d('0x9'));var client=jayson['client'][_0x8d6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3785b3,_0x5dceaf,_0x88b2a4){return new BPromise(function(_0x35aa24,_0x11b0ff){return client[_0x8d6d('0xb')](_0x3785b3,_0x88b2a4)[_0x8d6d('0xc')](function(_0x4646b0){logger[_0x8d6d('0xd')](_0x8d6d('0xe'),_0x5dceaf,'request\x20sent');logger[_0x8d6d('0xf')](_0x8d6d('0x10'),_0x5dceaf,_0x8d6d('0x11'),JSON[_0x8d6d('0x12')](_0x4646b0));if(_0x4646b0[_0x8d6d('0x13')]){if(_0x4646b0[_0x8d6d('0x13')]['code']===0x1f4){logger[_0x8d6d('0x13')](_0x8d6d('0xe'),_0x5dceaf,_0x4646b0[_0x8d6d('0x13')]['message']);return _0x11b0ff(_0x4646b0['error'][_0x8d6d('0x14')]);}logger[_0x8d6d('0x13')]('VoiceContext,\x20%s,\x20%s',_0x5dceaf,_0x4646b0['error'][_0x8d6d('0x14')]);return _0x35aa24(_0x4646b0[_0x8d6d('0x13')]['message']);}else{logger[_0x8d6d('0xd')]('VoiceContext,\x20%s,\x20%s',_0x5dceaf,_0x8d6d('0x11'));_0x35aa24(_0x4646b0[_0x8d6d('0x15')][_0x8d6d('0x14')]);}})['catch'](function(_0x29415e){logger[_0x8d6d('0x13')]('VoiceContext,\x20%s,\x20%s',_0x5dceaf,_0x29415e);_0x11b0ff(_0x29415e);});});} \ No newline at end of file +var _0x5269=['../../config/environment','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','ioredis','../../mysqldb','../../config/utils'];(function(_0x750023,_0x367b1f){var _0xf6bc98=function(_0x3ef7b7){while(--_0x3ef7b7){_0x750023['push'](_0x750023['shift']());}};_0xf6bc98(++_0x367b1f);}(_0x5269,0x150));var _0x9526=function(_0x5d06c5,_0x30cdf8){_0x5d06c5=_0x5d06c5-0x0;var _0x1940ad=_0x5269[_0x5d06c5];return _0x1940ad;};'use strict';var _=require(_0x9526('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9526('0x1'));var db=require(_0x9526('0x2'))['db'];var utils=require(_0x9526('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x9526('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x9526('0x5')][_0x9526('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2e217a,_0x2082b4,_0x1d4acf){return new BPromise(function(_0x4569a0,_0x161880){return client[_0x9526('0x7')](_0x2e217a,_0x1d4acf)[_0x9526('0x8')](function(_0x320908){logger[_0x9526('0x9')](_0x9526('0xa'),_0x2082b4,'request\x20sent');logger[_0x9526('0xb')](_0x9526('0xc'),_0x2082b4,'request\x20sent',JSON[_0x9526('0xd')](_0x320908));if(_0x320908[_0x9526('0xe')]){if(_0x320908[_0x9526('0xe')][_0x9526('0xf')]===0x1f4){logger[_0x9526('0xe')](_0x9526('0xa'),_0x2082b4,_0x320908[_0x9526('0xe')]['message']);return _0x161880(_0x320908[_0x9526('0xe')][_0x9526('0x10')]);}logger['error'](_0x9526('0xa'),_0x2082b4,_0x320908[_0x9526('0xe')]['message']);return _0x4569a0(_0x320908['error']['message']);}else{logger[_0x9526('0x9')]('VoiceContext,\x20%s,\x20%s',_0x2082b4,_0x9526('0x11'));_0x4569a0(_0x320908[_0x9526('0x12')][_0x9526('0x10')]);}})[_0x9526('0x13')](function(_0x3108ba){logger[_0x9526('0xe')]('VoiceContext,\x20%s,\x20%s',_0x2082b4,_0x3108ba);_0x161880(_0x3108ba);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 1a0d857..00fd55d 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 _0x7762=['util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','show','post','create','put','/:id','delete','exports','multer'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0x7762,0x17b));var _0x2776=function(_0x29b464,_0x44ac24){_0x29b464=_0x29b464-0x0;var _0x4bd6a3=_0x7762[_0x29b464];return _0x4bd6a3;};'use strict';var multer=require(_0x2776('0x0'));var util=require(_0x2776('0x1'));var path=require(_0x2776('0x2'));var timeout=require('connect-timeout');var express=require(_0x2776('0x3'));var router=express[_0x2776('0x4')]();var fs_extra=require(_0x2776('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2776('0x6'));var config=require(_0x2776('0x7'));var controller=require('./voiceDialReport.controller');router[_0x2776('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2776('0x9'),auth[_0x2776('0xa')](),controller[_0x2776('0xb')]);router[_0x2776('0x8')]('/:id',auth[_0x2776('0xa')](),controller[_0x2776('0xc')]);router[_0x2776('0xd')]('/',auth[_0x2776('0xa')](),controller[_0x2776('0xe')]);router[_0x2776('0xf')](_0x2776('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x2776('0x11')](_0x2776('0x10'),auth[_0x2776('0xa')](),controller['destroy']);module[_0x2776('0x12')]=router; \ No newline at end of file +var _0xb81a=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','exports','util'];(function(_0x481e1e,_0x56649c){var _0x50c2ad=function(_0x4ba33a){while(--_0x4ba33a){_0x481e1e['push'](_0x481e1e['shift']());}};_0x50c2ad(++_0x56649c);}(_0xb81a,0x186));var _0xab81=function(_0x1985bf,_0xb3aead){_0x1985bf=_0x1985bf-0x0;var _0x6ca8d=_0xb81a[_0x1985bf];return _0x6ca8d;};'use strict';var multer=require('multer');var util=require(_0xab81('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xab81('0x1'));var router=express[_0xab81('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xab81('0x3'));var config=require(_0xab81('0x4'));var controller=require('./voiceDialReport.controller');router[_0xab81('0x5')]('/',auth[_0xab81('0x6')](),controller['index']);router['get'](_0xab81('0x7'),auth[_0xab81('0x6')](),controller[_0xab81('0x8')]);router[_0xab81('0x5')](_0xab81('0x9'),auth['isAuthenticated'](),controller[_0xab81('0xa')]);router[_0xab81('0xb')]('/',auth['isAuthenticated'](),controller[_0xab81('0xc')]);router[_0xab81('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xab81('0xe')]);router[_0xab81('0xf')](_0xab81('0x9'),auth[_0xab81('0x6')](),controller['destroy']);module[_0xab81('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 7b25576..a879f68 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 _0x24ca=['STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x548ad9,_0x37d192){var _0x2472fd=function(_0x36ade1){while(--_0x36ade1){_0x548ad9['push'](_0x548ad9['shift']());}};_0x2472fd(++_0x37d192);}(_0x24ca,0x1bc));var _0xa24c=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0x24ca[_0x44a64f];return _0x52024b;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xa24c('0x1')]},'channel':{'type':Sequelize[_0xa24c('0x1')]},'channelstate':{'type':Sequelize[_0xa24c('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa24c('0x1')]},'calleridname':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'language':{'type':Sequelize[_0xa24c('0x1')]},'accountcode':{'type':Sequelize[_0xa24c('0x1')]},'context':{'type':Sequelize[_0xa24c('0x1')]},'exten':{'type':Sequelize[_0xa24c('0x1')]},'priority':{'type':Sequelize[_0xa24c('0x2')]},'uniqueid':{'type':Sequelize[_0xa24c('0x1')]},'linkedid':{'type':Sequelize[_0xa24c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa24c('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridnum':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'destlanguage':{'type':Sequelize[_0xa24c('0x1')]},'destaccountcode':{'type':Sequelize[_0xa24c('0x1')]},'destcontext':{'type':Sequelize[_0xa24c('0x1')]},'destexten':{'type':Sequelize[_0xa24c('0x1')]},'destpriority':{'type':Sequelize[_0xa24c('0x2')]},'destuniqueid':{'type':Sequelize[_0xa24c('0x1')]},'destlinkedid':{'type':Sequelize[_0xa24c('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xa24c('0x1')]},'starttime':{'type':Sequelize[_0xa24c('0x3')]},'answertime':{'type':Sequelize[_0xa24c('0x3')]},'endtime':{'type':Sequelize[_0xa24c('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xa24c('0x4')},'routeId':{'type':Sequelize[_0xa24c('0x2')]},'duration':{'type':Sequelize[_0xa24c('0x2')]},'holdtime':{'type':Sequelize[_0xa24c('0x2')]},'billableseconds':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file +var _0x9957=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x492ddf,_0x95f6ff){var _0x3ae873=function(_0x688052){while(--_0x688052){_0x492ddf['push'](_0x492ddf['shift']());}};_0x3ae873(++_0x95f6ff);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'privilege':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize[_0x7995('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7995('0x2')]},'calleridnum':{'type':Sequelize[_0x7995('0x2')]},'calleridname':{'type':Sequelize[_0x7995('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'context':{'type':Sequelize[_0x7995('0x2')]},'exten':{'type':Sequelize[_0x7995('0x2')]},'priority':{'type':Sequelize[_0x7995('0x3')]},'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x7995('0x2')]},'destchannelstate':{'type':Sequelize[_0x7995('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x7995('0x2')]},'destcalleridname':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7995('0x2')]},'destlanguage':{'type':Sequelize[_0x7995('0x2')]},'destaccountcode':{'type':Sequelize[_0x7995('0x2')]},'destcontext':{'type':Sequelize[_0x7995('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x7995('0x3')]},'destuniqueid':{'type':Sequelize[_0x7995('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x7995('0x2')]},'dialstatus':{'type':Sequelize[_0x7995('0x2')]},'starttime':{'type':Sequelize[_0x7995('0x4')]},'answertime':{'type':Sequelize[_0x7995('0x4')]},'endtime':{'type':Sequelize[_0x7995('0x4')]},'lastevent':{'type':Sequelize[_0x7995('0x2')],'comment':_0x7995('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x7995('0x3')]},'billableseconds':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 14b1de8..68e178a 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 _0x7741=['limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7741,0x1a0));var _0x1774=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x7741[_0x16d10f];return _0x50c823;};'use strict';var emlformat=require(_0x1774('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1774('0x1'));var jsonpatch=require(_0x1774('0x2'));var rp=require(_0x1774('0x3'));var moment=require(_0x1774('0x4'));var BPromise=require(_0x1774('0x5'));var Mustache=require('mustache');var util=require(_0x1774('0x6'));var path=require(_0x1774('0x7'));var sox=require('sox');var csv=require(_0x1774('0x8'));var ejs=require(_0x1774('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1774('0xa'));var squel=require('squel');var crypto=require(_0x1774('0xb'));var jsforce=require(_0x1774('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1774('0x8'));var querystring=require('querystring');var Papa=require(_0x1774('0xd'));var Redis=require(_0x1774('0xe'));var authService=require(_0x1774('0xf'));var qs=require(_0x1774('0x10'));var as=require(_0x1774('0x11'));var hardwareService=require(_0x1774('0x12'));var logger=require('../../config/logger')(_0x1774('0x13'));var utils=require(_0x1774('0x14'));var config=require(_0x1774('0x15'));var licenseUtil=require(_0x1774('0x16'));var db=require(_0x1774('0x17'))['db'];function respondWithStatusCode(_0x10ac7f,_0x2301a3){_0x2301a3=_0x2301a3||0xcc;return function(_0x19ffb1){if(_0x19ffb1){return _0x10ac7f['sendStatus'](_0x2301a3);}return _0x10ac7f[_0x1774('0x18')](_0x2301a3)[_0x1774('0x19')]();};}function respondWithResult(_0x5e0adc,_0x47de42){_0x47de42=_0x47de42||0xc8;return function(_0x4da9e1){if(_0x4da9e1){return _0x5e0adc['status'](_0x47de42)['json'](_0x4da9e1);}};}function respondWithFilteredResult(_0x22f10f,_0x283bdd){return function(_0x4ccaf6){if(_0x4ccaf6){var _0x5b3148=typeof _0x283bdd[_0x1774('0x1a')]===_0x1774('0x1b')&&typeof _0x283bdd[_0x1774('0x1c')]===_0x1774('0x1b');var _0x13ac19=_0x4ccaf6[_0x1774('0x1d')];var _0x45040c=_0x5b3148?0x0:_0x283bdd['offset'];var _0x12c4fa=_0x5b3148?_0x4ccaf6[_0x1774('0x1d')]:_0x283bdd[_0x1774('0x1a')]+_0x283bdd[_0x1774('0x1c')];var _0x31ed99;if(_0x12c4fa>=_0x13ac19){_0x12c4fa=_0x13ac19;_0x31ed99=0xc8;}else{_0x31ed99=0xce;}_0x22f10f[_0x1774('0x18')](_0x31ed99);return _0x22f10f[_0x1774('0x1e')](_0x1774('0x1f'),_0x45040c+'-'+_0x12c4fa+'/'+_0x13ac19)[_0x1774('0x20')](_0x4ccaf6);}return null;};}function patchUpdates(_0x4eb1b7){return function(_0x5d6ccf){try{jsonpatch[_0x1774('0x21')](_0x5d6ccf,_0x4eb1b7,!![]);}catch(_0x79ca06){return BPromise[_0x1774('0x22')](_0x79ca06);}return _0x5d6ccf[_0x1774('0x23')]();};}function saveUpdates(_0x26847e,_0x10bad6){return function(_0x3b5226){if(_0x3b5226){return _0x3b5226[_0x1774('0x24')](_0x26847e)[_0x1774('0x25')](function(_0x4a662d){return _0x4a662d;});}return null;};}function removeEntity(_0x4dc373,_0x3d98e1){return function(_0x4a46f9){if(_0x4a46f9){return _0x4a46f9[_0x1774('0x26')]()['then'](function(){_0x4dc373[_0x1774('0x18')](0xcc)[_0x1774('0x19')]();});}};}function handleEntityNotFound(_0xd9d7e,_0x32215f){return function(_0xf2c094){if(!_0xf2c094){_0xd9d7e[_0x1774('0x27')](0x194);}return _0xf2c094;};}function handleError(_0x47cce0,_0x51510f){_0x51510f=_0x51510f||0x1f4;return function(_0x23d2a1){logger[_0x1774('0x28')](_0x23d2a1[_0x1774('0x29')]);if(_0x23d2a1[_0x1774('0x2a')]){delete _0x23d2a1[_0x1774('0x2a')];}_0x47cce0['status'](_0x51510f)[_0x1774('0x2b')](_0x23d2a1);};}exports['index']=function(_0x18ac87,_0x3648d7){var _0x2103e6={},_0x2a0ca2={},_0x579dc0={'count':0x0,'rows':[]};var _0x45f610=_[_0x1774('0x2c')](db[_0x1774('0x2d')][_0x1774('0x2e')],function(_0x1d5505){return{'name':_0x1d5505[_0x1774('0x2f')],'type':_0x1d5505[_0x1774('0x30')][_0x1774('0x31')]};});_0x2a0ca2[_0x1774('0x32')]=_[_0x1774('0x2c')](_0x45f610,_0x1774('0x2a'));_0x2a0ca2[_0x1774('0x33')]=_[_0x1774('0x34')](_0x18ac87[_0x1774('0x33')]);_0x2a0ca2[_0x1774('0x35')]=_[_0x1774('0x36')](_0x2a0ca2['model'],_0x2a0ca2[_0x1774('0x33')]);_0x2103e6[_0x1774('0x37')]=_[_0x1774('0x36')](_0x2a0ca2[_0x1774('0x32')],qs['fields'](_0x18ac87[_0x1774('0x33')][_0x1774('0x38')]));_0x2103e6[_0x1774('0x37')]=_0x2103e6[_0x1774('0x37')][_0x1774('0x39')]?_0x2103e6['attributes']:_0x2a0ca2['model'];if(!_0x18ac87['query']['hasOwnProperty']('nolimit')){_0x2103e6[_0x1774('0x1c')]=qs[_0x1774('0x1c')](_0x18ac87[_0x1774('0x33')][_0x1774('0x1c')]);_0x2103e6['offset']=qs[_0x1774('0x1a')](_0x18ac87[_0x1774('0x33')][_0x1774('0x1a')]);}_0x2103e6[_0x1774('0x3a')]=qs['sort'](_0x18ac87['query']['sort']);_0x2103e6[_0x1774('0x3b')]=qs['filters'](_[_0x1774('0x3c')](_0x18ac87['query'],_0x2a0ca2['filters']),_0x45f610);if(_0x18ac87[_0x1774('0x33')][_0x1774('0x3d')]){_0x2103e6[_0x1774('0x3b')]=_['merge'](_0x2103e6['where'],{'$or':_[_0x1774('0x2c')](_0x45f610,function(_0x581c48){if(_0x581c48[_0x1774('0x30')]!==_0x1774('0x3e')){var _0x23d305={};_0x23d305[_0x581c48[_0x1774('0x2a')]]={'$like':'%'+_0x18ac87[_0x1774('0x33')][_0x1774('0x3d')]+'%'};return _0x23d305;}})});}_0x2103e6=_[_0x1774('0x3f')]({},_0x2103e6,_0x18ac87[_0x1774('0x40')]);var _0x4c6118={'where':_0x2103e6[_0x1774('0x3b')]};return db[_0x1774('0x2d')]['count'](_0x4c6118)[_0x1774('0x25')](function(_0x302d6d){_0x579dc0[_0x1774('0x1d')]=_0x302d6d;if(_0x18ac87[_0x1774('0x33')][_0x1774('0x41')]){_0x2103e6[_0x1774('0x42')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x2103e6);})[_0x1774('0x25')](function(_0x5339c0){_0x579dc0[_0x1774('0x43')]=_0x5339c0;return _0x579dc0;})[_0x1774('0x25')](respondWithFilteredResult(_0x3648d7,_0x2103e6))[_0x1774('0x44')](handleError(_0x3648d7,null));};exports['show']=function(_0x2de64b,_0x57ac78){var _0x55c879={'raw':!![],'where':{'id':_0x2de64b[_0x1774('0x45')]['id']}},_0x2d7263={};_0x2d7263['model']=_['keys'](db[_0x1774('0x2d')][_0x1774('0x2e')]);_0x2d7263['query']=_['keys'](_0x2de64b[_0x1774('0x33')]);_0x2d7263['filters']=_[_0x1774('0x36')](_0x2d7263[_0x1774('0x32')],_0x2d7263[_0x1774('0x33')]);_0x55c879['attributes']=_[_0x1774('0x36')](_0x2d7263['model'],qs['fields'](_0x2de64b[_0x1774('0x33')][_0x1774('0x38')]));_0x55c879['attributes']=_0x55c879['attributes'][_0x1774('0x39')]?_0x55c879[_0x1774('0x37')]:_0x2d7263[_0x1774('0x32')];if(_0x2de64b['query'][_0x1774('0x41')]){_0x55c879['include']=[{'all':!![]}];}_0x55c879=_[_0x1774('0x3f')]({},_0x55c879,_0x2de64b[_0x1774('0x40')]);return db[_0x1774('0x2d')][_0x1774('0x46')](_0x55c879)[_0x1774('0x25')](handleEntityNotFound(_0x57ac78,null))[_0x1774('0x25')](respondWithResult(_0x57ac78,null))[_0x1774('0x44')](handleError(_0x57ac78,null));};exports[_0x1774('0x47')]=function(_0x37096f,_0x3937fb){return db[_0x1774('0x2d')][_0x1774('0x47')](_0x37096f[_0x1774('0x48')],{})[_0x1774('0x25')](respondWithResult(_0x3937fb,0xc9))['catch'](handleError(_0x3937fb,null));};exports[_0x1774('0x24')]=function(_0x23bd11,_0x54e4f9){if(_0x23bd11['body']['id']){delete _0x23bd11[_0x1774('0x48')]['id'];}return db['VoiceDialReport'][_0x1774('0x46')]({'where':{'id':_0x23bd11[_0x1774('0x45')]['id']}})[_0x1774('0x25')](handleEntityNotFound(_0x54e4f9,null))['then'](saveUpdates(_0x23bd11['body'],null))[_0x1774('0x25')](respondWithResult(_0x54e4f9,null))['catch'](handleError(_0x54e4f9,null));};exports[_0x1774('0x26')]=function(_0xad1060,_0x4d518c){return db['VoiceDialReport'][_0x1774('0x46')]({'where':{'id':_0xad1060[_0x1774('0x45')]['id']}})[_0x1774('0x25')](handleEntityNotFound(_0x4d518c,null))[_0x1774('0x25')](removeEntity(_0x4d518c,null))[_0x1774('0x44')](handleError(_0x4d518c,null));};exports[_0x1774('0x49')]=function(_0x44f5f5,_0x4a4cf0){return db[_0x1774('0x2d')]['describe']()['then'](respondWithResult(_0x4a4cf0,null))[_0x1774('0x44')](handleError(_0x4a4cf0,null));}; \ No newline at end of file +var _0x3113=['params','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','options','includeAll','include','rows','catch','show'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x3113,0xe7));var _0x3311=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3113[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x3311('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3311('0x1'));var jsonpatch=require(_0x3311('0x2'));var rp=require('request-promise');var moment=require(_0x3311('0x3'));var BPromise=require(_0x3311('0x4'));var Mustache=require(_0x3311('0x5'));var util=require(_0x3311('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3311('0x7'));var ejs=require(_0x3311('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3311('0x9'));var squel=require(_0x3311('0xa'));var crypto=require(_0x3311('0xb'));var jsforce=require(_0x3311('0xc'));var deskjs=require(_0x3311('0xd'));var toCsv=require(_0x3311('0x7'));var querystring=require(_0x3311('0xe'));var Papa=require('papaparse');var Redis=require(_0x3311('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3311('0x10'));var as=require(_0x3311('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3311('0x12'))(_0x3311('0x13'));var utils=require(_0x3311('0x14'));var config=require(_0x3311('0x15'));var licenseUtil=require(_0x3311('0x16'));var db=require(_0x3311('0x17'))['db'];function respondWithStatusCode(_0x94b69,_0x31e1f7){_0x31e1f7=_0x31e1f7||0xcc;return function(_0x47d467){if(_0x47d467){return _0x94b69[_0x3311('0x18')](_0x31e1f7);}return _0x94b69[_0x3311('0x19')](_0x31e1f7)[_0x3311('0x1a')]();};}function respondWithResult(_0x461e5e,_0x5c5c28){_0x5c5c28=_0x5c5c28||0xc8;return function(_0x2b4e3d){if(_0x2b4e3d){return _0x461e5e[_0x3311('0x19')](_0x5c5c28)[_0x3311('0x1b')](_0x2b4e3d);}};}function respondWithFilteredResult(_0x374085,_0x334bda){return function(_0x18c98f){if(_0x18c98f){var _0x3b7c98=typeof _0x334bda[_0x3311('0x1c')]===_0x3311('0x1d')&&typeof _0x334bda[_0x3311('0x1e')]==='undefined';var _0x161a3c=_0x18c98f[_0x3311('0x1f')];var _0x344eef=_0x3b7c98?0x0:_0x334bda[_0x3311('0x1c')];var _0x4955e5=_0x3b7c98?_0x18c98f[_0x3311('0x1f')]:_0x334bda[_0x3311('0x1c')]+_0x334bda[_0x3311('0x1e')];var _0x2f4205;if(_0x4955e5>=_0x161a3c){_0x4955e5=_0x161a3c;_0x2f4205=0xc8;}else{_0x2f4205=0xce;}_0x374085[_0x3311('0x19')](_0x2f4205);return _0x374085['set'](_0x3311('0x20'),_0x344eef+'-'+_0x4955e5+'/'+_0x161a3c)['json'](_0x18c98f);}return null;};}function patchUpdates(_0x371169){return function(_0x4ec5ef){try{jsonpatch[_0x3311('0x21')](_0x4ec5ef,_0x371169,!![]);}catch(_0x419bc7){return BPromise[_0x3311('0x22')](_0x419bc7);}return _0x4ec5ef[_0x3311('0x23')]();};}function saveUpdates(_0x2b195c,_0x4567cf){return function(_0x2888f0){if(_0x2888f0){return _0x2888f0[_0x3311('0x24')](_0x2b195c)[_0x3311('0x25')](function(_0x4c3d4e){return _0x4c3d4e;});}return null;};}function removeEntity(_0x171b07,_0x3e2dfe){return function(_0x27bb10){if(_0x27bb10){return _0x27bb10['destroy']()[_0x3311('0x25')](function(){_0x171b07[_0x3311('0x19')](0xcc)[_0x3311('0x1a')]();});}};}function handleEntityNotFound(_0x19fc4b,_0x4d0f82){return function(_0xe58ed6){if(!_0xe58ed6){_0x19fc4b[_0x3311('0x18')](0x194);}return _0xe58ed6;};}function handleError(_0x2b5219,_0x23e906){_0x23e906=_0x23e906||0x1f4;return function(_0x6ca3fc){logger[_0x3311('0x26')](_0x6ca3fc[_0x3311('0x27')]);if(_0x6ca3fc['name']){delete _0x6ca3fc[_0x3311('0x28')];}_0x2b5219['status'](_0x23e906)[_0x3311('0x29')](_0x6ca3fc);};}exports['index']=function(_0x2b58c0,_0x17612b){var _0x13a1a5={},_0x3b286d={},_0x43e9f2={'count':0x0,'rows':[]};var _0x50e746=_[_0x3311('0x2a')](db[_0x3311('0x2b')][_0x3311('0x2c')],function(_0x5c14c6){return{'name':_0x5c14c6[_0x3311('0x2d')],'type':_0x5c14c6[_0x3311('0x2e')][_0x3311('0x2f')]};});_0x3b286d[_0x3311('0x30')]=_[_0x3311('0x2a')](_0x50e746,'name');_0x3b286d[_0x3311('0x31')]=_[_0x3311('0x32')](_0x2b58c0['query']);_0x3b286d[_0x3311('0x33')]=_['intersection'](_0x3b286d[_0x3311('0x30')],_0x3b286d[_0x3311('0x31')]);_0x13a1a5[_0x3311('0x34')]=_[_0x3311('0x35')](_0x3b286d['model'],qs['fields'](_0x2b58c0['query'][_0x3311('0x36')]));_0x13a1a5[_0x3311('0x34')]=_0x13a1a5[_0x3311('0x34')][_0x3311('0x37')]?_0x13a1a5[_0x3311('0x34')]:_0x3b286d[_0x3311('0x30')];if(!_0x2b58c0[_0x3311('0x31')][_0x3311('0x38')](_0x3311('0x39'))){_0x13a1a5[_0x3311('0x1e')]=qs[_0x3311('0x1e')](_0x2b58c0[_0x3311('0x31')][_0x3311('0x1e')]);_0x13a1a5[_0x3311('0x1c')]=qs['offset'](_0x2b58c0['query'][_0x3311('0x1c')]);}_0x13a1a5[_0x3311('0x3a')]=qs['sort'](_0x2b58c0['query']['sort']);_0x13a1a5['where']=qs[_0x3311('0x33')](_[_0x3311('0x3b')](_0x2b58c0[_0x3311('0x31')],_0x3b286d[_0x3311('0x33')]),_0x50e746);if(_0x2b58c0[_0x3311('0x31')][_0x3311('0x3c')]){_0x13a1a5[_0x3311('0x3d')]=_[_0x3311('0x3e')](_0x13a1a5[_0x3311('0x3d')],{'$or':_['map'](_0x50e746,function(_0x129af9){if(_0x129af9[_0x3311('0x2e')]!=='VIRTUAL'){var _0x276e82={};_0x276e82[_0x129af9[_0x3311('0x28')]]={'$like':'%'+_0x2b58c0[_0x3311('0x31')][_0x3311('0x3c')]+'%'};return _0x276e82;}})});}_0x13a1a5=_['merge']({},_0x13a1a5,_0x2b58c0[_0x3311('0x3f')]);var _0x42051a={'where':_0x13a1a5[_0x3311('0x3d')]};return db[_0x3311('0x2b')][_0x3311('0x1f')](_0x42051a)[_0x3311('0x25')](function(_0x298b05){_0x43e9f2['count']=_0x298b05;if(_0x2b58c0['query'][_0x3311('0x40')]){_0x13a1a5[_0x3311('0x41')]=[{'all':!![]}];}return db[_0x3311('0x2b')]['findAll'](_0x13a1a5);})[_0x3311('0x25')](function(_0x56cebb){_0x43e9f2[_0x3311('0x42')]=_0x56cebb;return _0x43e9f2;})[_0x3311('0x25')](respondWithFilteredResult(_0x17612b,_0x13a1a5))[_0x3311('0x43')](handleError(_0x17612b,null));};exports[_0x3311('0x44')]=function(_0x91d5fe,_0xdb1ff0){var _0x30d679={'raw':!![],'where':{'id':_0x91d5fe[_0x3311('0x45')]['id']}},_0x480904={};_0x480904[_0x3311('0x30')]=_['keys'](db[_0x3311('0x2b')][_0x3311('0x2c')]);_0x480904[_0x3311('0x31')]=_[_0x3311('0x32')](_0x91d5fe['query']);_0x480904['filters']=_[_0x3311('0x35')](_0x480904['model'],_0x480904[_0x3311('0x31')]);_0x30d679[_0x3311('0x34')]=_['intersection'](_0x480904[_0x3311('0x30')],qs[_0x3311('0x36')](_0x91d5fe[_0x3311('0x31')][_0x3311('0x36')]));_0x30d679[_0x3311('0x34')]=_0x30d679[_0x3311('0x34')]['length']?_0x30d679[_0x3311('0x34')]:_0x480904[_0x3311('0x30')];if(_0x91d5fe['query'][_0x3311('0x40')]){_0x30d679['include']=[{'all':!![]}];}_0x30d679=_[_0x3311('0x3e')]({},_0x30d679,_0x91d5fe[_0x3311('0x3f')]);return db[_0x3311('0x2b')][_0x3311('0x46')](_0x30d679)['then'](handleEntityNotFound(_0xdb1ff0,null))['then'](respondWithResult(_0xdb1ff0,null))['catch'](handleError(_0xdb1ff0,null));};exports['create']=function(_0x3676ef,_0x507bce){return db['VoiceDialReport'][_0x3311('0x47')](_0x3676ef['body'],{})[_0x3311('0x25')](respondWithResult(_0x507bce,0xc9))[_0x3311('0x43')](handleError(_0x507bce,null));};exports['update']=function(_0x4f8495,_0x11d9e2){if(_0x4f8495[_0x3311('0x48')]['id']){delete _0x4f8495['body']['id'];}return db[_0x3311('0x2b')][_0x3311('0x46')]({'where':{'id':_0x4f8495[_0x3311('0x45')]['id']}})[_0x3311('0x25')](handleEntityNotFound(_0x11d9e2,null))[_0x3311('0x25')](saveUpdates(_0x4f8495['body'],null))[_0x3311('0x25')](respondWithResult(_0x11d9e2,null))[_0x3311('0x43')](handleError(_0x11d9e2,null));};exports[_0x3311('0x49')]=function(_0x3339d7,_0x1feb55){return db[_0x3311('0x2b')][_0x3311('0x46')]({'where':{'id':_0x3339d7[_0x3311('0x45')]['id']}})[_0x3311('0x25')](handleEntityNotFound(_0x1feb55,null))['then'](removeEntity(_0x1feb55,null))[_0x3311('0x43')](handleError(_0x1feb55,null));};exports[_0x3311('0x4a')]=function(_0x169e72,_0x70466b){return db[_0x3311('0x2b')][_0x3311('0x4a')]()['then'](respondWithResult(_0x70466b,null))[_0x3311('0x43')](handleError(_0x70466b,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 28da424..1b1c4bf 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 _0xc59c=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','report_dial','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0xdf79b4,_0x3dba3e){var _0x2dd96c=function(_0x266e44){while(--_0x266e44){_0xdf79b4['push'](_0xdf79b4['shift']());}};_0x2dd96c(++_0x3dba3e);}(_0xc59c,0x72));var _0xcc59=function(_0xbaf094,_0x2f86ad){_0xbaf094=_0xbaf094-0x0;var _0x3974fd=_0xc59c[_0xbaf094];return _0x3974fd;};'use strict';var _=require(_0xcc59('0x0'));var util=require(_0xcc59('0x1'));var logger=require(_0xcc59('0x2'))(_0xcc59('0x3'));var moment=require(_0xcc59('0x4'));var BPromise=require('bluebird');var rp=require(_0xcc59('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc59('0x6'));var config=require(_0xcc59('0x7'));var attributes=require(_0xcc59('0x8'));module[_0xcc59('0x9')]=function(_0x4c112f,_0x1d0697){return _0x4c112f[_0xcc59('0xa')]('VoiceDialReport',attributes,{'tableName':_0xcc59('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x32f6=['report_dial','uniqueid','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','VoiceDialReport'];(function(_0x21f403,_0x209e8d){var _0x470dec=function(_0x1336eb){while(--_0x1336eb){_0x21f403['push'](_0x21f403['shift']());}};_0x470dec(++_0x209e8d);}(_0x32f6,0xbd));var _0x632f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x32f6[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x632f('0x0'))(_0x632f('0x1'));var moment=require('moment');var BPromise=require(_0x632f('0x2'));var rp=require(_0x632f('0x3'));var fs=require('fs');var path=require(_0x632f('0x4'));var rimraf=require(_0x632f('0x5'));var config=require(_0x632f('0x6'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x4cead1,_0x5f3464){return _0x4cead1[_0x632f('0x7')](_0x632f('0x8'),attributes,{'tableName':_0x632f('0x9'),'paranoid':![],'indexes':[{'fields':[_0x632f('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 30cd896..8b365c9 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 _0x7c0c=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','VoiceDialReport,\x20%s,\x20%s','message','CreateVoiceDialReport','VoiceDialReport','body','options','raw','then','UpdateVoiceDialReport','update','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x246115,_0x398123){var _0x385878=function(_0x534a9c){while(--_0x534a9c){_0x246115['push'](_0x246115['shift']());}};_0x385878(++_0x398123);}(_0x7c0c,0x12e));var _0xc7c0=function(_0x695b76,_0x551526){_0x695b76=_0x695b76-0x0;var _0x1dc21f=_0x7c0c[_0x695b76];return _0x1dc21f;};'use strict';var _=require(_0xc7c0('0x0'));var util=require(_0xc7c0('0x1'));var moment=require(_0xc7c0('0x2'));var BPromise=require(_0xc7c0('0x3'));var rs=require(_0xc7c0('0x4'));var fs=require('fs');var Redis=require(_0xc7c0('0x5'));var db=require(_0xc7c0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc7c0('0x7'))(_0xc7c0('0x8'));var config=require(_0xc7c0('0x9'));var jayson=require(_0xc7c0('0xa'));var client=jayson[_0xc7c0('0xb')][_0xc7c0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x52adcd,_0x5c4c87,_0x4aed1e){return new BPromise(function(_0xbdf1ab,_0x533ad8){return client[_0xc7c0('0xd')](_0x52adcd,_0x4aed1e)['then'](function(_0x51755b){logger[_0xc7c0('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x5c4c87,_0xc7c0('0xf'));logger[_0xc7c0('0x10')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x5c4c87,_0xc7c0('0xf'),JSON[_0xc7c0('0x11')](_0x51755b));if(_0x51755b[_0xc7c0('0x12')]){if(_0x51755b['error']['code']===0x1f4){logger['error'](_0xc7c0('0x13'),_0x5c4c87,_0x51755b[_0xc7c0('0x12')][_0xc7c0('0x14')]);return _0x533ad8(_0x51755b[_0xc7c0('0x12')]['message']);}logger[_0xc7c0('0x12')](_0xc7c0('0x13'),_0x5c4c87,_0x51755b[_0xc7c0('0x12')][_0xc7c0('0x14')]);return _0xbdf1ab(_0x51755b[_0xc7c0('0x12')][_0xc7c0('0x14')]);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x5c4c87,'request\x20sent');_0xbdf1ab(_0x51755b['result'][_0xc7c0('0x14')]);}})['catch'](function(_0x2e2b2e){logger[_0xc7c0('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x5c4c87,_0x2e2b2e);_0x533ad8(_0x2e2b2e);});});}exports[_0xc7c0('0x15')]=function(_0x4a0c31){var _0x5803e8=this;return new Promise(function(_0x276cb3,_0x223b68){return db[_0xc7c0('0x16')]['create'](_0x4a0c31[_0xc7c0('0x17')],{'raw':_0x4a0c31[_0xc7c0('0x18')]?_0x4a0c31[_0xc7c0('0x18')][_0xc7c0('0x19')]===undefined?!![]:![]:!![]})[_0xc7c0('0x1a')](function(_0x2b1e93){logger[_0xc7c0('0xe')](_0xc7c0('0x15'),_0x4a0c31);logger['debug'](_0xc7c0('0x15'),_0x4a0c31,JSON[_0xc7c0('0x11')](_0x2b1e93));_0x276cb3(_0x2b1e93);})['catch'](function(_0x51fb47){logger[_0xc7c0('0x12')](_0xc7c0('0x15'),_0x51fb47['message'],_0x4a0c31);_0x223b68(_0x5803e8[_0xc7c0('0x12')](0x1f4,_0x51fb47[_0xc7c0('0x14')]));});});};exports[_0xc7c0('0x1b')]=function(_0x1e7023){var _0x3062d8=this;return new Promise(function(_0x26d188,_0x3e27da){return db[_0xc7c0('0x16')][_0xc7c0('0x1c')](_0x1e7023[_0xc7c0('0x17')],{'raw':_0x1e7023[_0xc7c0('0x18')]?_0x1e7023[_0xc7c0('0x18')][_0xc7c0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e7023[_0xc7c0('0x18')]?_0x1e7023[_0xc7c0('0x18')]['where']||null:null,'attributes':_0x1e7023[_0xc7c0('0x18')]?_0x1e7023[_0xc7c0('0x18')]['attributes']||null:null,'limit':_0x1e7023[_0xc7c0('0x18')]?_0x1e7023['options'][_0xc7c0('0x1d')]||null:null})['then'](function(_0x256c1f){logger['info'](_0xc7c0('0x1b'),_0x1e7023);logger['debug']('UpdateVoiceDialReport',_0x1e7023,JSON[_0xc7c0('0x11')](_0x256c1f));_0x26d188(_0x256c1f);})[_0xc7c0('0x1e')](function(_0x42e2de){logger[_0xc7c0('0x12')](_0xc7c0('0x1b'),_0x42e2de[_0xc7c0('0x14')],_0x1e7023);_0x3e27da(_0x3062d8[_0xc7c0('0x12')](0x1f4,_0x42e2de[_0xc7c0('0x14')]));});});}; \ No newline at end of file +var _0xacf0=['VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','debug','catch','UpdateVoiceDialReport','where','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0xb1a84d,_0x383b93){var _0x3ef4dc=function(_0x1218af){while(--_0x1218af){_0xb1a84d['push'](_0xb1a84d['shift']());}};_0x3ef4dc(++_0x383b93);}(_0xacf0,0x1c4));var _0x0acf=function(_0x149f24,_0x468c28){_0x149f24=_0x149f24-0x0;var _0x239293=_0xacf0[_0x149f24];return _0x239293;};'use strict';var _=require('lodash');var util=require(_0x0acf('0x0'));var moment=require(_0x0acf('0x1'));var BPromise=require(_0x0acf('0x2'));var rs=require(_0x0acf('0x3'));var fs=require('fs');var Redis=require(_0x0acf('0x4'));var db=require(_0x0acf('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0acf('0x6'));var jayson=require(_0x0acf('0x7'));var client=jayson[_0x0acf('0x8')][_0x0acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x147fa8,_0x5ab804,_0x3ca9ed){return new BPromise(function(_0x9c343,_0x4436ed){return client[_0x0acf('0xa')](_0x147fa8,_0x3ca9ed)['then'](function(_0x5b7e3c){logger[_0x0acf('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x5ab804,_0x0acf('0xc'));logger['debug'](_0x0acf('0xd'),_0x5ab804,'request\x20sent',JSON[_0x0acf('0xe')](_0x5b7e3c));if(_0x5b7e3c[_0x0acf('0xf')]){if(_0x5b7e3c['error'][_0x0acf('0x10')]===0x1f4){logger[_0x0acf('0xf')](_0x0acf('0x11'),_0x5ab804,_0x5b7e3c[_0x0acf('0xf')][_0x0acf('0x12')]);return _0x4436ed(_0x5b7e3c[_0x0acf('0xf')]['message']);}logger[_0x0acf('0xf')](_0x0acf('0x11'),_0x5ab804,_0x5b7e3c[_0x0acf('0xf')][_0x0acf('0x12')]);return _0x9c343(_0x5b7e3c['error'][_0x0acf('0x12')]);}else{logger[_0x0acf('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x5ab804,_0x0acf('0xc'));_0x9c343(_0x5b7e3c[_0x0acf('0x13')]['message']);}})['catch'](function(_0x346b00){logger['error'](_0x0acf('0x11'),_0x5ab804,_0x346b00);_0x4436ed(_0x346b00);});});}exports[_0x0acf('0x14')]=function(_0x19f61){var _0x5e0189=this;return new Promise(function(_0x4b8305,_0x3806bf){return db[_0x0acf('0x15')][_0x0acf('0x16')](_0x19f61[_0x0acf('0x17')],{'raw':_0x19f61[_0x0acf('0x18')]?_0x19f61[_0x0acf('0x18')][_0x0acf('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x5a8a89){logger[_0x0acf('0xb')](_0x0acf('0x14'),_0x19f61);logger[_0x0acf('0x1a')]('CreateVoiceDialReport',_0x19f61,JSON['stringify'](_0x5a8a89));_0x4b8305(_0x5a8a89);})[_0x0acf('0x1b')](function(_0xd32844){logger[_0x0acf('0xf')](_0x0acf('0x14'),_0xd32844[_0x0acf('0x12')],_0x19f61);_0x3806bf(_0x5e0189[_0x0acf('0xf')](0x1f4,_0xd32844[_0x0acf('0x12')]));});});};exports[_0x0acf('0x1c')]=function(_0x5a7801){var _0x56fb55=this;return new Promise(function(_0x19a3a9,_0x1a25a9){return db[_0x0acf('0x15')]['update'](_0x5a7801[_0x0acf('0x17')],{'raw':_0x5a7801[_0x0acf('0x18')]?_0x5a7801[_0x0acf('0x18')][_0x0acf('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a7801[_0x0acf('0x18')]?_0x5a7801[_0x0acf('0x18')][_0x0acf('0x1d')]||null:null,'attributes':_0x5a7801[_0x0acf('0x18')]?_0x5a7801[_0x0acf('0x18')]['attributes']||null:null,'limit':_0x5a7801[_0x0acf('0x18')]?_0x5a7801['options']['limit']||null:null})[_0x0acf('0x1e')](function(_0x376d69){logger[_0x0acf('0xb')]('UpdateVoiceDialReport',_0x5a7801);logger[_0x0acf('0x1a')](_0x0acf('0x1c'),_0x5a7801,JSON[_0x0acf('0xe')](_0x376d69));_0x19a3a9(_0x376d69);})['catch'](function(_0x3bbdaa){logger['error'](_0x0acf('0x1c'),_0x3bbdaa[_0x0acf('0x12')],_0x5a7801);_0x1a25a9(_0x56fb55[_0x0acf('0xf')](0x1f4,_0x3bbdaa['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index a0d4551..a4664d5 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 _0xe6d9=['get','isAuthenticated','index','/:id','post','create','/:id/applications','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./voiceExtension.controller'];(function(_0x32f6b9,_0x2d4aa9){var _0x267d52=function(_0x10f74f){while(--_0x10f74f){_0x32f6b9['push'](_0x32f6b9['shift']());}};_0x267d52(++_0x2d4aa9);}(_0xe6d9,0xf0));var _0x9e6d=function(_0x4e2579,_0x52a9f7){_0x4e2579=_0x4e2579-0x0;var _0x14a286=_0xe6d9[_0x4e2579];return _0x14a286;};'use strict';var multer=require(_0x9e6d('0x0'));var util=require(_0x9e6d('0x1'));var path=require(_0x9e6d('0x2'));var timeout=require(_0x9e6d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9e6d('0x4'));var config=require(_0x9e6d('0x5'));var controller=require(_0x9e6d('0x6'));router[_0x9e6d('0x7')]('/',auth[_0x9e6d('0x8')](),controller[_0x9e6d('0x9')]);router[_0x9e6d('0x7')](_0x9e6d('0xa'),auth[_0x9e6d('0x8')](),controller['show']);router[_0x9e6d('0xb')]('/',auth[_0x9e6d('0x8')](),controller[_0x9e6d('0xc')]);router[_0x9e6d('0xb')](_0x9e6d('0xd'),auth[_0x9e6d('0x8')](),controller['addApplications']);router[_0x9e6d('0xe')](_0x9e6d('0xa'),auth['isAuthenticated'](),controller[_0x9e6d('0xf')]);router[_0x9e6d('0x10')]('/:id',auth[_0x9e6d('0x8')](),controller[_0x9e6d('0x11')]);module[_0x9e6d('0x12')]=router; \ No newline at end of file +var _0x4470=['index','/:id','isAuthenticated','show','post','create','addApplications','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get'];(function(_0x39758d,_0x346423){var _0x44ac11=function(_0x175008){while(--_0x175008){_0x39758d['push'](_0x39758d['shift']());}};_0x44ac11(++_0x346423);}(_0x4470,0xe8));var _0x0447=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x4470[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0447('0x0'));var util=require(_0x0447('0x1'));var path=require(_0x0447('0x2'));var timeout=require('connect-timeout');var express=require(_0x0447('0x3'));var router=express[_0x0447('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0447('0x5'));var interaction=require(_0x0447('0x6'));var config=require(_0x0447('0x7'));var controller=require(_0x0447('0x8'));router[_0x0447('0x9')]('/',auth['isAuthenticated'](),controller[_0x0447('0xa')]);router[_0x0447('0x9')](_0x0447('0xb'),auth[_0x0447('0xc')](),controller[_0x0447('0xd')]);router[_0x0447('0xe')]('/',auth[_0x0447('0xc')](),controller[_0x0447('0xf')]);router[_0x0447('0xe')]('/:id/applications',auth[_0x0447('0xc')](),controller[_0x0447('0x10')]);router[_0x0447('0x11')]('/:id',auth[_0x0447('0xc')](),controller[_0x0447('0x12')]);router[_0x0447('0x13')](_0x0447('0xb'),auth[_0x0447('0xc')](),controller[_0x0447('0x14')]);module[_0x0447('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 21c695e..cb907a4 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 _0x8ac2=['outbound','internal','inbound-fax','outbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','sequelize','exports','STRING','compositeIndex','ENUM','inbound'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ac2,0xdb));var _0x28ac=function(_0xf22b3b,_0x435061){_0xf22b3b=_0xf22b3b-0x0;var _0x34fd6c=_0x8ac2[_0xf22b3b];return _0x34fd6c;};'use strict';var Sequelize=require(_0x28ac('0x0'));module[_0x28ac('0x1')]={'context':{'type':Sequelize[_0x28ac('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x28ac('0x2')],'allowNull':![],'unique':_0x28ac('0x3')},'priority':{'type':Sequelize[_0x28ac('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x28ac('0x3')},'tag':{'type':Sequelize[_0x28ac('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x28ac('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x28ac('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x28ac('0x4')](_0x28ac('0x5'),_0x28ac('0x6'),_0x28ac('0x7'),_0x28ac('0x8'),_0x28ac('0x9'),_0x28ac('0xa'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x28ac('0x2')]},'interval':{'type':Sequelize[_0x28ac('0x2')],'allowNull':![],'defaultValue':_0x28ac('0xb')},'IntervalId':{'type':Sequelize[_0x28ac('0xc')]},'isApp':{'type':Sequelize[_0x28ac('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x28ac('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x28ac('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x28ac('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x28ac('0xc')]},'recordingFormat':{'type':Sequelize[_0x28ac('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x28ac('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x28ac('0xe')],'get':function(_0x49af1e){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0x28ac('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xc7e4=['getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','wav'];(function(_0xf62d7a,_0x2b2cbc){var _0x479a5d=function(_0x367d32){while(--_0x367d32){_0xf62d7a['push'](_0xf62d7a['shift']());}};_0x479a5d(++_0x2b2cbc);}(_0xc7e4,0x178));var _0x4c7e=function(_0x157c81,_0x2c0224){_0x157c81=_0x157c81-0x0;var _0x1bfb12=_0xc7e4[_0x157c81];return _0x1bfb12;};'use strict';var Sequelize=require(_0x4c7e('0x0'));module[_0x4c7e('0x1')]={'context':{'type':Sequelize[_0x4c7e('0x2')],'allowNull':![],'unique':_0x4c7e('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4c7e('0x2')],'allowNull':![],'unique':_0x4c7e('0x3')},'priority':{'type':Sequelize[_0x4c7e('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x4c7e('0x3')},'tag':{'type':Sequelize[_0x4c7e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4c7e('0x2')],'allowNull':![],'defaultValue':_0x4c7e('0x4')},'appdata':{'type':Sequelize[_0x4c7e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x4c7e('0x5'),_0x4c7e('0x6'),_0x4c7e('0x7'),'inbound-fax',_0x4c7e('0x8'),_0x4c7e('0x9'),_0x4c7e('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x4c7e('0x2')]},'interval':{'type':Sequelize[_0x4c7e('0x2')],'allowNull':![],'defaultValue':_0x4c7e('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x4c7e('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4c7e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x4c7e('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x4c7e('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x4c7e('0xd')]},'recordingFormat':{'type':Sequelize[_0x4c7e('0x2')],'defaultValue':_0x4c7e('0xe')},'answer':{'type':Sequelize[_0x4c7e('0xc')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1fdf81){return this[_0x4c7e('0xf')](_0x4c7e('0x10'));}},'alias':{'type':Sequelize[_0x4c7e('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index fb2af03..448c804 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 _0x208d=['attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','include','findAll','rows','params','options','create','body','outbound','startsWith','exten','user','role','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','cutdigits','mandatoryDisposition','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','finally','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','./voiceExtension.socket','sendStatus','status','json','offset','undefined','count','limit','set','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','includes','type','find','value','name','UserProfileResource','end','error','stack','send','index','VoiceExtension','rawAttributes','key','model','query','keys','filters'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x208d,0x1de));var _0xd208=function(_0x3bf6bb,_0x4b85c7){_0x3bf6bb=_0x3bf6bb-0x0;var _0x4f9809=_0x208d[_0x3bf6bb];return _0x4f9809;};'use strict';var _=require('lodash');var Redis=require(_0xd208('0x0'));var qs=require(_0xd208('0x1'));var logger=require(_0xd208('0x2'))('api');var config=require('../../config/environment');var db=require(_0xd208('0x3'))['db'];config[_0xd208('0x4')]=_[_0xd208('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd208('0x4')]));require(_0xd208('0x6'))['register'](socket);function respondWithStatusCode(_0x5c00f0,_0x30b9ce){_0x30b9ce=_0x30b9ce||0xcc;return function(_0x3d5d07){if(_0x3d5d07){return _0x5c00f0[_0xd208('0x7')](_0x30b9ce);}return _0x5c00f0[_0xd208('0x8')](_0x30b9ce)['end']();};}function respondWithResult(_0x4bd795,_0x36a364){_0x36a364=_0x36a364||0xc8;return function(_0x4ae742){if(_0x4ae742){return _0x4bd795[_0xd208('0x8')](_0x36a364)[_0xd208('0x9')](_0x4ae742);}};}function respondWithFilteredResult(_0x20ca41,_0x4086f7){return function(_0x872a5d){if(_0x872a5d){var _0x144bda=typeof _0x4086f7[_0xd208('0xa')]===_0xd208('0xb')&&typeof _0x4086f7['limit']==='undefined';var _0x36618f=_0x872a5d[_0xd208('0xc')];var _0x10347c=_0x144bda?0x0:_0x4086f7[_0xd208('0xa')];var _0x529a73=_0x144bda?_0x872a5d[_0xd208('0xc')]:_0x4086f7[_0xd208('0xa')]+_0x4086f7[_0xd208('0xd')];var _0x295fcf;if(_0x529a73>=_0x36618f){_0x529a73=_0x36618f;_0x295fcf=0xc8;}else{_0x295fcf=0xce;}_0x20ca41[_0xd208('0x8')](_0x295fcf);return _0x20ca41[_0xd208('0xe')]('Content-Range',_0x10347c+'-'+_0x529a73+'/'+_0x36618f)[_0xd208('0x9')](_0x872a5d);}return null;};}function removeEntity(_0x4ee938){return function(_0x215565){if(_0x215565){return _0x215565[_0xd208('0xf')]()[_0xd208('0x10')](function(){var _0x50cbac=_0x215565[_0xd208('0x11')]({'plain':!![]});var _0x254165=[{'name':_0xd208('0x12'),'value':_0xd208('0x13'),'ignore':![]},{'name':_0xd208('0x14'),'value':'outbound','ignore':![]},{'name':_0xd208('0x15'),'value':_0xd208('0x16'),'ignore':![]}];var _0x176d61=_(_0x254165)[_0xd208('0x17')](_0xd208('0x18'))[_0xd208('0x19')]('value')['value']();if(_[_0xd208('0x1a')](_0x176d61,_0x50cbac[_0xd208('0x1b')])){return;}var _0x2b9ef2=_[_0xd208('0x1c')](_0x254165,[_0xd208('0x1d'),_0x50cbac[_0xd208('0x1b')]])[_0xd208('0x1e')];return db[_0xd208('0x1f')][_0xd208('0xf')]({'where':{'type':_0x2b9ef2,'resourceId':_0x50cbac['id']}})[_0xd208('0x10')](function(){return _0x215565;});})['then'](function(){_0x4ee938[_0xd208('0x8')](0xcc)[_0xd208('0x20')]();});}};}function handleEntityNotFound(_0x4322d5){return function(_0x34d73f){if(!_0x34d73f){_0x4322d5[_0xd208('0x7')](0x194);}return _0x34d73f;};}function handleError(_0x549661,_0x4c3c10){_0x4c3c10=_0x4c3c10||0x1f4;return function(_0x22c564){logger[_0xd208('0x21')](_0x22c564[_0xd208('0x22')]);if(_0x22c564[_0xd208('0x1e')]){delete _0x22c564['name'];}_0x549661[_0xd208('0x8')](_0x4c3c10)[_0xd208('0x23')](_0x22c564);};}exports[_0xd208('0x24')]=function(_0x519529,_0x21fd54){var _0x4da9d8={},_0x2b46b2={},_0xae10aa={'count':0x0,'rows':[]};var _0x362c92=_['map'](db[_0xd208('0x25')][_0xd208('0x26')],function(_0x33769b){return{'name':_0x33769b['fieldName'],'type':_0x33769b[_0xd208('0x1b')][_0xd208('0x27')]};});_0x2b46b2[_0xd208('0x28')]=_[_0xd208('0x19')](_0x362c92,_0xd208('0x1e'));_0x2b46b2[_0xd208('0x29')]=_[_0xd208('0x2a')](_0x519529[_0xd208('0x29')]);_0x2b46b2[_0xd208('0x2b')]=_['intersection'](_0x2b46b2[_0xd208('0x28')],_0x2b46b2[_0xd208('0x29')]);_0x4da9d8[_0xd208('0x2c')]=_[_0xd208('0x2d')](_0x2b46b2[_0xd208('0x28')],qs[_0xd208('0x2e')](_0x519529['query'][_0xd208('0x2e')]));_0x4da9d8['attributes']=_0x4da9d8['attributes'][_0xd208('0x2f')]?_0x4da9d8[_0xd208('0x2c')]:_0x2b46b2[_0xd208('0x28')];if(!_0x519529[_0xd208('0x29')][_0xd208('0x30')]('nolimit')){_0x4da9d8[_0xd208('0xd')]=qs[_0xd208('0xd')](_0x519529[_0xd208('0x29')]['limit']);_0x4da9d8[_0xd208('0xa')]=qs[_0xd208('0xa')](_0x519529[_0xd208('0x29')]['offset']);}_0x4da9d8[_0xd208('0x31')]=qs[_0xd208('0x32')](_0x519529[_0xd208('0x29')][_0xd208('0x32')]);_0x4da9d8[_0xd208('0x33')]=qs[_0xd208('0x2b')](_[_0xd208('0x34')](_0x519529['query'],_0x2b46b2[_0xd208('0x2b')]),_0x362c92);if(_0x519529[_0xd208('0x29')][_0xd208('0x17')]){_0x4da9d8['where']=_[_0xd208('0x35')](_0x4da9d8['where'],{'$or':_[_0xd208('0x19')](_0x362c92,function(_0x241748){if(_0x241748[_0xd208('0x1b')]!==_0xd208('0x36')){var _0xea8ca4={};_0xea8ca4[_0x241748[_0xd208('0x1e')]]={'$like':'%'+_0x519529[_0xd208('0x29')][_0xd208('0x17')]+'%'};return _0xea8ca4;}})});}_0x4da9d8=_['merge']({},_0x4da9d8,_0x519529['options']);var _0xd541c4={'where':_0x4da9d8[_0xd208('0x33')]};return db[_0xd208('0x25')][_0xd208('0xc')](_0xd541c4)['then'](function(_0x5ba702){_0xae10aa[_0xd208('0xc')]=_0x5ba702;if(_0x519529[_0xd208('0x29')]['includeAll']){_0x4da9d8[_0xd208('0x37')]=[{'all':!![]}];}return db[_0xd208('0x25')][_0xd208('0x38')](_0x4da9d8);})[_0xd208('0x10')](function(_0x12dfe6){_0xae10aa[_0xd208('0x39')]=_0x12dfe6;return _0xae10aa;})[_0xd208('0x10')](respondWithFilteredResult(_0x21fd54,_0x4da9d8))['catch'](handleError(_0x21fd54,null));};exports['show']=function(_0x567f42,_0xac3aea){var _0x5671a6={'raw':![],'where':{'id':_0x567f42[_0xd208('0x3a')]['id']}},_0x3f9478={};_0x3f9478[_0xd208('0x28')]=_['keys'](db[_0xd208('0x25')][_0xd208('0x26')]);_0x3f9478[_0xd208('0x29')]=_['keys'](_0x567f42[_0xd208('0x29')]);_0x3f9478['filters']=_[_0xd208('0x2d')](_0x3f9478[_0xd208('0x28')],_0x3f9478[_0xd208('0x29')]);_0x5671a6[_0xd208('0x2c')]=_[_0xd208('0x2d')](_0x3f9478[_0xd208('0x28')],qs[_0xd208('0x2e')](_0x567f42[_0xd208('0x29')]['fields']));_0x5671a6[_0xd208('0x2c')]=_0x5671a6[_0xd208('0x2c')][_0xd208('0x2f')]?_0x5671a6[_0xd208('0x2c')]:_0x3f9478[_0xd208('0x28')];if(_0x567f42[_0xd208('0x29')]['includeAll']){_0x5671a6[_0xd208('0x37')]=[{'all':!![]}];}_0x5671a6=_[_0xd208('0x35')]({},_0x5671a6,_0x567f42[_0xd208('0x3b')]);return db['VoiceExtension'][_0xd208('0x1c')](_0x5671a6)['then'](handleEntityNotFound(_0xac3aea,null))['then'](respondWithResult(_0xac3aea,null))['catch'](handleError(_0xac3aea,null));};exports['destroy']=function(_0x34054b,_0x1c3b02){return db[_0xd208('0x25')]['find']({'where':{'id':_0x34054b[_0xd208('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1c3b02,null))[_0xd208('0x10')](removeEntity(_0x1c3b02,null))['catch'](handleError(_0x1c3b02,null));};exports[_0xd208('0x3c')]=function(_0x31f1a4,_0x11d30d){if(_0x31f1a4[_0xd208('0x3d')][_0xd208('0x1b')]===_0xd208('0x3e')&&!_[_0xd208('0x3f')](_0x31f1a4['body']['exten'],'_')){_0x31f1a4[_0xd208('0x3d')][_0xd208('0x40')]='_'['concat'](_0x31f1a4['body'][_0xd208('0x40')]);}return db[_0xd208('0x25')]['create'](_0x31f1a4['body'],{'raw':![]})[_0xd208('0x10')](function(_0x4f7e81){var _0x4efa4b=_0x31f1a4[_0xd208('0x41')][_0xd208('0x11')]({'plain':!![]});if(!_0x4efa4b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4efa4b[_0xd208('0x42')]==='user'){var _0x3a6131=_0x4f7e81['get']({'plain':!![]});var _0x38c0ef=[{'name':_0xd208('0x12'),'value':_0xd208('0x13')},{'name':'OutboundRoutes','value':_0xd208('0x3e')},{'name':'InternalRoutes','value':_0xd208('0x16')}];var _0x509fad=_[_0xd208('0x1c')](_0x38c0ef,[_0xd208('0x1d'),_0x3a6131[_0xd208('0x1b')]])[_0xd208('0x1e')];return db['UserProfileSection']['find']({'where':{'name':_0x509fad,'userProfileId':_0x4efa4b[_0xd208('0x43')]},'raw':!![]})[_0xd208('0x10')](function(_0x355b6b){if(_0x355b6b&&_0x355b6b[_0xd208('0x44')]===0x0){return db[_0xd208('0x1f')]['create']({'name':_0x3a6131['name'],'resourceId':_0x3a6131['id'],'type':_0x355b6b[_0xd208('0x1e')],'sectionId':_0x355b6b['id']},{})[_0xd208('0x10')](function(){return _0x4f7e81;});}else{return _0x4f7e81;}})[_0xd208('0x45')](function(_0x340e98){logger[_0xd208('0x21')](_0xd208('0x46'),_0x340e98);throw _0x340e98;});}return _0x4f7e81;})[_0xd208('0x10')](respondWithResult(_0x11d30d,0xc9))[_0xd208('0x45')](handleError(_0x11d30d,null));};exports[_0xd208('0x47')]=function(_0x33843f,_0x4efaff){if(_0x33843f[_0xd208('0x3d')]['id']){delete _0x33843f['body']['id'];}return db[_0xd208('0x25')]['find']({'where':{'id':_0x33843f[_0xd208('0x3a')]['id']}})[_0xd208('0x10')](handleEntityNotFound(_0x4efaff,null))[_0xd208('0x10')](function(_0x199380){if(_0x199380){return db[_0xd208('0x25')][_0xd208('0x47')](_[_0xd208('0x34')](_0x33843f[_0xd208('0x3d')],[_0xd208('0x40'),_0xd208('0x48'),_0xd208('0x49'),'recordingFormat',_0xd208('0x4a'),_0xd208('0x4b'),'alias']),{'where':{'context':_0x199380['context'],'exten':_0x199380[_0xd208('0x40')]},'individualHooks':!![]})[_0xd208('0x10')](function(_0xaf5a42){return _0xaf5a42;});}return null;})[_0xd208('0x10')](respondWithStatusCode(_0x4efaff,null))[_0xd208('0x45')](handleError(_0x4efaff,null));};exports['addApplications']=function(_0x38c541,_0xd7a13f){var _0x7a5047=_0x38c541['params']['id'];var _0x265d90=_0x38c541[_0xd208('0x3d')];var _0x20c9b2=0xc8;var _0x563f1c=null;return db[_0xd208('0x4c')]['transaction']({'isolationLevel':db[_0xd208('0x4c')][_0xd208('0x4d')][_0xd208('0x4e')][_0xd208('0x4f')]},function(_0x3b9fcc){return db[_0xd208('0x25')][_0xd208('0x50')]({'where':{'id':_0x7a5047},'transaction':_0x3b9fcc})[_0xd208('0x10')](function(_0xc94302){if(_0xc94302){return db[_0xd208('0x25')][_0xd208('0xf')]({'where':{'VoiceExtensionId':_0x7a5047},'transaction':_0x3b9fcc})[_0xd208('0x10')](function(){var _0x116f87=_['map'](_0x265d90,function(_0x3ca1c0){_0x3ca1c0[_0xd208('0x51')]=_0x7a5047;_0x3ca1c0[_0xd208('0x52')]=!![];return _0x3ca1c0;});return _0xc94302[_0xd208('0x53')](_0x116f87);})['then'](function(_0x33e7f9){return db['VoiceExtension'][_0xd208('0x54')](_0x33e7f9,{'transaction':_0x3b9fcc});});}else{_0x20c9b2=0x194;_0x563f1c=[];}});})[_0xd208('0x10')](function(){if(_0x20c9b2!==0x194){return db[_0xd208('0x25')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x7a5047},'order':_0xd208('0x55')})['then'](function(_0x52a4b4){_0x563f1c=_0x52a4b4;});}})[_0xd208('0x45')](function(_0x12593f){_0x20c9b2=0x1f4;logger[_0xd208('0x21')](_0x12593f[_0xd208('0x22')]);if(_0x12593f[_0xd208('0x1e')]){delete _0x12593f[_0xd208('0x1e')];}_0x563f1c=_0x12593f;})[_0xd208('0x56')](function(){if(_0x563f1c===null){_0xd7a13f[_0xd208('0x7')](_0x20c9b2);}else{if(_0x20c9b2===0x1f4){_0xd7a13f[_0xd208('0x8')](_0x20c9b2)[_0xd208('0x23')](_0x563f1c);}else{_0xd7a13f[_0xd208('0x8')](_0x20c9b2)[_0xd208('0x9')](_0x563f1c);}}});}; \ No newline at end of file +var _0x7f49=['ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','json','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','internal','map','value','includes','type','find','UserProfileResource','stack','name','send','index','VoiceExtension','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','fields','create','body','exten','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','addApplications','sequelize','transaction','Transaction'];(function(_0x9b9584,_0x35b71c){var _0x3fd9c4=function(_0x400107){while(--_0x400107){_0x9b9584['push'](_0x9b9584['shift']());}};_0x3fd9c4(++_0x35b71c);}(_0x7f49,0x197));var _0x97f4=function(_0x385161,_0xa2d1a4){_0x385161=_0x385161-0x0;var _0x173b0c=_0x7f49[_0x385161];return _0x173b0c;};'use strict';var _=require(_0x97f4('0x0'));var Redis=require(_0x97f4('0x1'));var qs=require(_0x97f4('0x2'));var logger=require(_0x97f4('0x3'))(_0x97f4('0x4'));var config=require(_0x97f4('0x5'));var db=require(_0x97f4('0x6'))['db'];config[_0x97f4('0x7')]=_[_0x97f4('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x97f4('0x9'))(new Redis(config[_0x97f4('0x7')]));require(_0x97f4('0xa'))[_0x97f4('0xb')](socket);function respondWithStatusCode(_0x514a26,_0x113867){_0x113867=_0x113867||0xcc;return function(_0x571f2d){if(_0x571f2d){return _0x514a26[_0x97f4('0xc')](_0x113867);}return _0x514a26[_0x97f4('0xd')](_0x113867)[_0x97f4('0xe')]();};}function respondWithResult(_0x9a008c,_0x5a7e08){_0x5a7e08=_0x5a7e08||0xc8;return function(_0x44d288){if(_0x44d288){return _0x9a008c['status'](_0x5a7e08)['json'](_0x44d288);}};}function respondWithFilteredResult(_0x3655c8,_0xb368b6){return function(_0x3d902a){if(_0x3d902a){var _0x1fef2e=typeof _0xb368b6[_0x97f4('0xf')]===_0x97f4('0x10')&&typeof _0xb368b6['limit']===_0x97f4('0x10');var _0x3e91a0=_0x3d902a[_0x97f4('0x11')];var _0x186cb3=_0x1fef2e?0x0:_0xb368b6['offset'];var _0x5d90ec=_0x1fef2e?_0x3d902a['count']:_0xb368b6[_0x97f4('0xf')]+_0xb368b6[_0x97f4('0x12')];var _0x45f858;if(_0x5d90ec>=_0x3e91a0){_0x5d90ec=_0x3e91a0;_0x45f858=0xc8;}else{_0x45f858=0xce;}_0x3655c8['status'](_0x45f858);return _0x3655c8[_0x97f4('0x13')](_0x97f4('0x14'),_0x186cb3+'-'+_0x5d90ec+'/'+_0x3e91a0)['json'](_0x3d902a);}return null;};}function removeEntity(_0x448a7c){return function(_0x173763){if(_0x173763){return _0x173763[_0x97f4('0x15')]()[_0x97f4('0x16')](function(){var _0x27e39e=_0x173763[_0x97f4('0x17')]({'plain':!![]});var _0x233587=[{'name':_0x97f4('0x18'),'value':_0x97f4('0x19'),'ignore':![]},{'name':_0x97f4('0x1a'),'value':_0x97f4('0x1b'),'ignore':![]},{'name':'InternalRoutes','value':_0x97f4('0x1c'),'ignore':![]}];var _0x4f1ef5=_(_0x233587)['filter']('ignore')[_0x97f4('0x1d')](_0x97f4('0x1e'))['value']();if(_[_0x97f4('0x1f')](_0x4f1ef5,_0x27e39e[_0x97f4('0x20')])){return;}var _0x25347d=_[_0x97f4('0x21')](_0x233587,[_0x97f4('0x1e'),_0x27e39e[_0x97f4('0x20')]])['name'];return db[_0x97f4('0x22')][_0x97f4('0x15')]({'where':{'type':_0x25347d,'resourceId':_0x27e39e['id']}})['then'](function(){return _0x173763;});})[_0x97f4('0x16')](function(){_0x448a7c['status'](0xcc)[_0x97f4('0xe')]();});}};}function handleEntityNotFound(_0x2db9a9){return function(_0x314a31){if(!_0x314a31){_0x2db9a9[_0x97f4('0xc')](0x194);}return _0x314a31;};}function handleError(_0x1b33b9,_0x2e9754){_0x2e9754=_0x2e9754||0x1f4;return function(_0x90e582){logger['error'](_0x90e582[_0x97f4('0x23')]);if(_0x90e582[_0x97f4('0x24')]){delete _0x90e582[_0x97f4('0x24')];}_0x1b33b9[_0x97f4('0xd')](_0x2e9754)[_0x97f4('0x25')](_0x90e582);};}exports[_0x97f4('0x26')]=function(_0x5cee7a,_0x3b8af6){var _0x5e4415={},_0x1befa0={},_0x5ddde8={'count':0x0,'rows':[]};var _0x318e57=_[_0x97f4('0x1d')](db[_0x97f4('0x27')]['rawAttributes'],function(_0x14bee8){return{'name':_0x14bee8['fieldName'],'type':_0x14bee8[_0x97f4('0x20')][_0x97f4('0x28')]};});_0x1befa0[_0x97f4('0x29')]=_[_0x97f4('0x1d')](_0x318e57,_0x97f4('0x24'));_0x1befa0['query']=_['keys'](_0x5cee7a[_0x97f4('0x2a')]);_0x1befa0[_0x97f4('0x2b')]=_[_0x97f4('0x2c')](_0x1befa0[_0x97f4('0x29')],_0x1befa0[_0x97f4('0x2a')]);_0x5e4415[_0x97f4('0x2d')]=_[_0x97f4('0x2c')](_0x1befa0[_0x97f4('0x29')],qs['fields'](_0x5cee7a[_0x97f4('0x2a')]['fields']));_0x5e4415['attributes']=_0x5e4415[_0x97f4('0x2d')][_0x97f4('0x2e')]?_0x5e4415[_0x97f4('0x2d')]:_0x1befa0['model'];if(!_0x5cee7a['query'][_0x97f4('0x2f')](_0x97f4('0x30'))){_0x5e4415[_0x97f4('0x12')]=qs[_0x97f4('0x12')](_0x5cee7a[_0x97f4('0x2a')][_0x97f4('0x12')]);_0x5e4415[_0x97f4('0xf')]=qs['offset'](_0x5cee7a['query'][_0x97f4('0xf')]);}_0x5e4415[_0x97f4('0x31')]=qs[_0x97f4('0x32')](_0x5cee7a[_0x97f4('0x2a')]['sort']);_0x5e4415[_0x97f4('0x33')]=qs['filters'](_['pick'](_0x5cee7a['query'],_0x1befa0['filters']),_0x318e57);if(_0x5cee7a[_0x97f4('0x2a')]['filter']){_0x5e4415[_0x97f4('0x33')]=_[_0x97f4('0x34')](_0x5e4415[_0x97f4('0x33')],{'$or':_[_0x97f4('0x1d')](_0x318e57,function(_0x1d66e2){if(_0x1d66e2['type']!==_0x97f4('0x35')){var _0x2aa19c={};_0x2aa19c[_0x1d66e2[_0x97f4('0x24')]]={'$like':'%'+_0x5cee7a[_0x97f4('0x2a')][_0x97f4('0x36')]+'%'};return _0x2aa19c;}})});}_0x5e4415=_['merge']({},_0x5e4415,_0x5cee7a[_0x97f4('0x37')]);var _0x55f364={'where':_0x5e4415[_0x97f4('0x33')]};return db['VoiceExtension']['count'](_0x55f364)[_0x97f4('0x16')](function(_0x1aa9ac){_0x5ddde8['count']=_0x1aa9ac;if(_0x5cee7a[_0x97f4('0x2a')][_0x97f4('0x38')]){_0x5e4415[_0x97f4('0x39')]=[{'all':!![]}];}return db[_0x97f4('0x27')][_0x97f4('0x3a')](_0x5e4415);})[_0x97f4('0x16')](function(_0x1bbbb6){_0x5ddde8[_0x97f4('0x3b')]=_0x1bbbb6;return _0x5ddde8;})[_0x97f4('0x16')](respondWithFilteredResult(_0x3b8af6,_0x5e4415))[_0x97f4('0x3c')](handleError(_0x3b8af6,null));};exports[_0x97f4('0x3d')]=function(_0x284ab7,_0x2c1228){var _0x182f45={'raw':![],'where':{'id':_0x284ab7[_0x97f4('0x3e')]['id']}},_0x2d1767={};_0x2d1767['model']=_['keys'](db['VoiceExtension'][_0x97f4('0x3f')]);_0x2d1767[_0x97f4('0x2a')]=_[_0x97f4('0x40')](_0x284ab7['query']);_0x2d1767['filters']=_[_0x97f4('0x2c')](_0x2d1767['model'],_0x2d1767[_0x97f4('0x2a')]);_0x182f45[_0x97f4('0x2d')]=_[_0x97f4('0x2c')](_0x2d1767[_0x97f4('0x29')],qs['fields'](_0x284ab7[_0x97f4('0x2a')][_0x97f4('0x41')]));_0x182f45[_0x97f4('0x2d')]=_0x182f45['attributes'][_0x97f4('0x2e')]?_0x182f45[_0x97f4('0x2d')]:_0x2d1767[_0x97f4('0x29')];if(_0x284ab7[_0x97f4('0x2a')][_0x97f4('0x38')]){_0x182f45[_0x97f4('0x39')]=[{'all':!![]}];}_0x182f45=_[_0x97f4('0x34')]({},_0x182f45,_0x284ab7[_0x97f4('0x37')]);return db[_0x97f4('0x27')]['find'](_0x182f45)['then'](handleEntityNotFound(_0x2c1228,null))['then'](respondWithResult(_0x2c1228,null))[_0x97f4('0x3c')](handleError(_0x2c1228,null));};exports[_0x97f4('0x15')]=function(_0x2ac08b,_0x8e9a51){return db[_0x97f4('0x27')][_0x97f4('0x21')]({'where':{'id':_0x2ac08b['params']['id']}})[_0x97f4('0x16')](handleEntityNotFound(_0x8e9a51,null))['then'](removeEntity(_0x8e9a51,null))[_0x97f4('0x3c')](handleError(_0x8e9a51,null));};exports[_0x97f4('0x42')]=function(_0x1a56e1,_0x2b4a85){if(_0x1a56e1[_0x97f4('0x43')][_0x97f4('0x20')]===_0x97f4('0x1b')&&!_['startsWith'](_0x1a56e1['body']['exten'],'_')){_0x1a56e1[_0x97f4('0x43')]['exten']='_'['concat'](_0x1a56e1['body'][_0x97f4('0x44')]);}return db[_0x97f4('0x27')]['create'](_0x1a56e1[_0x97f4('0x43')],{'raw':![]})[_0x97f4('0x16')](function(_0x2bb3be){var _0x527c9e=_0x1a56e1['user'][_0x97f4('0x17')]({'plain':!![]});if(!_0x527c9e)throw new Error(_0x97f4('0x45'));if(_0x527c9e[_0x97f4('0x46')]===_0x97f4('0x47')){var _0x33c076=_0x2bb3be[_0x97f4('0x17')]({'plain':!![]});var _0x500f12=[{'name':_0x97f4('0x18'),'value':_0x97f4('0x19')},{'name':_0x97f4('0x1a'),'value':_0x97f4('0x1b')},{'name':'InternalRoutes','value':'internal'}];var _0x496aee=_[_0x97f4('0x21')](_0x500f12,['value',_0x33c076[_0x97f4('0x20')]])[_0x97f4('0x24')];return db[_0x97f4('0x48')]['find']({'where':{'name':_0x496aee,'userProfileId':_0x527c9e[_0x97f4('0x49')]},'raw':!![]})[_0x97f4('0x16')](function(_0x324f8d){if(_0x324f8d&&_0x324f8d[_0x97f4('0x4a')]===0x0){return db['UserProfileResource'][_0x97f4('0x42')]({'name':_0x33c076[_0x97f4('0x24')],'resourceId':_0x33c076['id'],'type':_0x324f8d[_0x97f4('0x24')],'sectionId':_0x324f8d['id']},{})['then'](function(){return _0x2bb3be;});}else{return _0x2bb3be;}})[_0x97f4('0x3c')](function(_0x4c6c15){logger[_0x97f4('0x4b')](_0x97f4('0x4c'),_0x4c6c15);throw _0x4c6c15;});}return _0x2bb3be;})[_0x97f4('0x16')](respondWithResult(_0x2b4a85,0xc9))[_0x97f4('0x3c')](handleError(_0x2b4a85,null));};exports[_0x97f4('0x4d')]=function(_0x295597,_0x516086){if(_0x295597['body']['id']){delete _0x295597[_0x97f4('0x43')]['id'];}return db['VoiceExtension'][_0x97f4('0x21')]({'where':{'id':_0x295597[_0x97f4('0x3e')]['id']}})['then'](handleEntityNotFound(_0x516086,null))[_0x97f4('0x16')](function(_0x13e672){if(_0x13e672){return db[_0x97f4('0x27')]['update'](_['pick'](_0x295597[_0x97f4('0x43')],[_0x97f4('0x44'),'context',_0x97f4('0x4e'),_0x97f4('0x4f'),_0x97f4('0x50'),_0x97f4('0x51'),_0x97f4('0x52')]),{'where':{'context':_0x13e672[_0x97f4('0x53')],'exten':_0x13e672[_0x97f4('0x44')]},'individualHooks':!![]})[_0x97f4('0x16')](function(_0x1e5946){return _0x1e5946;});}return null;})['then'](respondWithStatusCode(_0x516086,null))['catch'](handleError(_0x516086,null));};exports[_0x97f4('0x54')]=function(_0x56048c,_0x263989){var _0x43c53b=_0x56048c[_0x97f4('0x3e')]['id'];var _0x5d52e0=_0x56048c[_0x97f4('0x43')];var _0x13cb50=0xc8;var _0x5cccf4=null;return db[_0x97f4('0x55')][_0x97f4('0x56')]({'isolationLevel':db[_0x97f4('0x55')][_0x97f4('0x57')][_0x97f4('0x58')][_0x97f4('0x59')]},function(_0x151fec){return db[_0x97f4('0x27')][_0x97f4('0x5a')]({'where':{'id':_0x43c53b},'transaction':_0x151fec})[_0x97f4('0x16')](function(_0x323731){if(_0x323731){return db[_0x97f4('0x27')][_0x97f4('0x15')]({'where':{'VoiceExtensionId':_0x43c53b},'transaction':_0x151fec})['then'](function(){var _0x283179=_[_0x97f4('0x1d')](_0x5d52e0,function(_0x4d6455){_0x4d6455[_0x97f4('0x5b')]=_0x43c53b;_0x4d6455[_0x97f4('0x5c')]=!![];return _0x4d6455;});return _0x323731[_0x97f4('0x5d')](_0x283179);})['then'](function(_0x1a7193){return db[_0x97f4('0x27')][_0x97f4('0x5e')](_0x1a7193,{'transaction':_0x151fec});});}else{_0x13cb50=0x194;_0x5cccf4=[];}});})['then'](function(){if(_0x13cb50!==0x194){return db[_0x97f4('0x27')][_0x97f4('0x5f')]({'where':{'isApp':!![],'VoiceExtensionId':_0x43c53b},'order':_0x97f4('0x60')})[_0x97f4('0x16')](function(_0xd52066){_0x5cccf4=_0xd52066;});}})[_0x97f4('0x3c')](function(_0x5a8710){_0x13cb50=0x1f4;logger['error'](_0x5a8710[_0x97f4('0x23')]);if(_0x5a8710['name']){delete _0x5a8710[_0x97f4('0x24')];}_0x5cccf4=_0x5a8710;})[_0x97f4('0x61')](function(){if(_0x5cccf4===null){_0x263989['sendStatus'](_0x13cb50);}else{if(_0x13cb50===0x1f4){_0x263989[_0x97f4('0xd')](_0x13cb50)[_0x97f4('0x25')](_0x5cccf4);}else{_0x263989[_0x97f4('0xd')](_0x13cb50)[_0x97f4('0x62')](_0x5cccf4);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index c73c783..3c1c88d 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 _0xdd84=['hasOwnProperty','exports','../../mysqldb','VoiceExtension','save','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd84,0xaa));var _0x4dd8=function(_0xa0ddc3,_0x29502e){_0xa0ddc3=_0xa0ddc3-0x0;var _0x3aa707=_0xdd84[_0xa0ddc3];return _0x3aa707;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x4dd8('0x0'))['db'][_0x4dd8('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4dd8('0x2'),'afterUpdate':_0x4dd8('0x3'),'afterDestroy':_0x4dd8('0x4')};function emitEvent(_0x5f0ce1){return function(_0x3b68d2,_0x2e33ea,_0x5ce9f6){VoiceExtensionEvents[_0x4dd8('0x5')](_0x5f0ce1+':'+_0x3b68d2['id'],_0x3b68d2);VoiceExtensionEvents[_0x4dd8('0x5')](_0x5f0ce1,_0x3b68d2);_0x5ce9f6(null);};}for(var e in events){if(events[_0x4dd8('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x4dd8('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0x4138=['exports','events','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x411e51,_0x272bdb){var _0x16b571=function(_0x209624){while(--_0x209624){_0x411e51['push'](_0x411e51['shift']());}};_0x16b571(++_0x272bdb);}(_0x4138,0xa3));var _0x8413=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4138[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x8413('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x8413('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x8413('0x2')](0x0);var events={'afterCreate':_0x8413('0x3'),'afterUpdate':_0x8413('0x4'),'afterDestroy':_0x8413('0x5')};function emitEvent(_0x2d2ba0){return function(_0x5965fb,_0xf2f1cd,_0x26a5b3){VoiceExtensionEvents[_0x8413('0x6')](_0x2d2ba0+':'+_0x5965fb['id'],_0x5965fb);VoiceExtensionEvents[_0x8413('0x6')](_0x2d2ba0,_0x5965fb);_0x26a5b3(null);};}for(var e in events){if(events[_0x8413('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x8413('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 c5bf12c..6bdcc22 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 _0xc5b1=['XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','concat','last','catch','VoiceExtension','voice_extensions','Hangup','lodash','./voiceExtension.attributes','exports','models','Set','type','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','options','url','split','length','name','param','prefix','phone','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','then','*,*,*,*','intervals','map','toLowerCase','tag','CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer'];(function(_0x5832b3,_0x9ba1f3){var _0x455b6f=function(_0x25e9d6){while(--_0x25e9d6){_0x5832b3['push'](_0x5832b3['shift']());}};_0x455b6f(++_0x9ba1f3);}(_0xc5b1,0x106));var _0x1c5b=function(_0x3161b4,_0x55eac1){_0x3161b4=_0x3161b4-0x0;var _0x298cd5=_0xc5b1[_0x3161b4];return _0x298cd5;};'use strict';var _=require(_0x1c5b('0x0'));var attributes=require(_0x1c5b('0x1'));module[_0x1c5b('0x2')]=function(_0x5a9bb3){var _0x50a847=_0x5a9bb3[_0x1c5b('0x3')];function _0x5eb32a(_0x569a71){var _0x42d03a=0x2;var _0x4f4765=[{'type':_0x569a71['type'],'app':_0x1c5b('0x4'),'appdata':'CDR(type)='+_0x569a71[_0x1c5b('0x5')],'context':_0x569a71[_0x1c5b('0x6')],'exten':_0x569a71[_0x1c5b('0x7')],'priority':_0x42d03a++,'VoiceExtensionId':_0x569a71['id']},{'type':_0x569a71[_0x1c5b('0x5')],'app':_0x569a71[_0x1c5b('0x8')]?'Set':_0x1c5b('0x9'),'appdata':_0x569a71[_0x1c5b('0x8')]?_0x1c5b('0xa')+_0x569a71[_0x1c5b('0x8')]:_0x1c5b('0xb'),'context':_0x569a71['context'],'exten':_0x569a71[_0x1c5b('0x7')],'priority':_0x42d03a++,'VoiceExtensionId':_0x569a71['id']}];if(_0x569a71[_0x1c5b('0x5')]===_0x1c5b('0xc')){_0x4f4765[_0x1c5b('0xd')]({'type':_0x1c5b('0xc'),'app':'Set','appdata':'CDR(routeid)='+_0x569a71['id'],'context':_0x569a71[_0x1c5b('0x6')],'exten':_0x569a71['exten'],'priority':_0x42d03a++,'VoiceExtensionId':_0x569a71['id']});}_0x4f4765['push']({'type':_0x569a71[_0x1c5b('0x5')],'app':_0x1c5b('0x4'),'appdata':_0x1c5b('0xe'),'context':_0x569a71[_0x1c5b('0x6')],'exten':_0x569a71[_0x1c5b('0x7')],'priority':_0x42d03a++,'VoiceExtensionId':_0x569a71['id']},{'type':_0x569a71[_0x1c5b('0x5')],'app':'Set','appdata':_0x1c5b('0xf'),'context':_0x569a71['context'],'exten':_0x569a71[_0x1c5b('0x7')],'priority':_0x42d03a++,'VoiceExtensionId':_0x569a71['id']},{'type':_0x569a71[_0x1c5b('0x5')],'app':_0x1c5b('0x4'),'appdata':_0x1c5b('0x10'),'context':_0x569a71[_0x1c5b('0x6')],'exten':_0x569a71[_0x1c5b('0x7')],'priority':_0x42d03a++,'VoiceExtensionId':_0x569a71['id']});return _0x4f4765;}function _0x37f051(_0x25e015){var _0x49b73a=0x2;var _0x8aa516=[{'type':_0x1c5b('0x11'),'app':'Set','appdata':_0x1c5b('0x12'),'context':_0x25e015['context'],'exten':_0x25e015['exten'],'priority':_0x49b73a++,'VoiceExtensionId':_0x25e015['id']},{'type':_0x1c5b('0x11'),'app':_0x25e015[_0x1c5b('0x8')]?'Set':'NoOp','appdata':_0x25e015[_0x1c5b('0x8')]?_0x1c5b('0xa')+_0x25e015['alias']:_0x1c5b('0xb'),'context':_0x25e015[_0x1c5b('0x6')],'exten':_0x25e015[_0x1c5b('0x7')],'priority':_0x49b73a++,'VoiceExtensionId':_0x25e015['id']},{'type':_0x1c5b('0x11'),'app':_0x1c5b('0x4'),'appdata':_0x1c5b('0x13')+(_0x25e015[_0x1c5b('0x14')]?_0x1c5b('0x15')+_0x25e015[_0x1c5b('0x14')]+'}':_0x1c5b('0x16')),'context':_0x25e015[_0x1c5b('0x6')],'exten':_0x25e015[_0x1c5b('0x7')],'priority':_0x49b73a++,'VoiceExtensionId':_0x25e015['id']},{'type':_0x1c5b('0x11'),'app':_0x1c5b('0x4'),'appdata':'CDR(routeid)='+_0x25e015['id'],'context':_0x25e015['context'],'exten':_0x25e015[_0x1c5b('0x7')],'priority':_0x49b73a++,'VoiceExtensionId':_0x25e015['id']},{'type':'outbound','app':_0x1c5b('0x17'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x49b73a+0x2)+_0x1c5b('0x18')+(_0x49b73a+0x1)+')','context':_0x25e015[_0x1c5b('0x6')],'exten':_0x25e015[_0x1c5b('0x7')],'priority':_0x49b73a++,'VoiceExtensionId':_0x25e015['id']},{'type':_0x1c5b('0x11'),'app':_0x1c5b('0x4'),'appdata':_0x25e015['cutdigits']?_0x1c5b('0x19')+_0x25e015[_0x1c5b('0x14')]+'}':_0x1c5b('0x1a'),'context':_0x25e015[_0x1c5b('0x6')],'exten':_0x25e015[_0x1c5b('0x7')],'priority':_0x49b73a++,'VoiceExtensionId':_0x25e015['id']},{'type':_0x1c5b('0x11'),'app':'Set','appdata':_0x1c5b('0xe'),'context':_0x25e015[_0x1c5b('0x6')],'exten':_0x25e015[_0x1c5b('0x7')],'priority':_0x49b73a++,'VoiceExtensionId':_0x25e015['id']},{'type':'outbound','app':'Set','appdata':_0x1c5b('0xf'),'context':_0x25e015['context'],'exten':_0x25e015[_0x1c5b('0x7')],'priority':_0x49b73a++,'VoiceExtensionId':_0x25e015['id']},{'type':_0x1c5b('0x11'),'app':_0x1c5b('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x25e015[_0x1c5b('0x6')],'exten':_0x25e015[_0x1c5b('0x7')],'priority':_0x49b73a++,'VoiceExtensionId':_0x25e015['id']},{'type':_0x1c5b('0x11'),'app':_0x1c5b('0x4'),'appdata':_0x1c5b('0x1b')+_0x25e015['id'],'context':_0x25e015[_0x1c5b('0x6')],'exten':_0x25e015[_0x1c5b('0x7')],'priority':_0x49b73a++,'VoiceExtensionId':_0x25e015['id']}];if(_0x25e015[_0x1c5b('0x1c')](_0x1c5b('0x1d'))&&_0x25e015['recordingFormat']!=='none'){_0x8aa516['push']({'type':_0x1c5b('0x11'),'app':_0x1c5b('0x4'),'appdata':_0x1c5b('0x1e'),'context':_0x25e015[_0x1c5b('0x6')],'exten':_0x25e015[_0x1c5b('0x7')],'priority':_0x49b73a++,'VoiceExtensionId':_0x25e015['id']},{'type':_0x1c5b('0x11'),'app':_0x1c5b('0x4'),'appdata':_0x1c5b('0x1f')+_0x25e015[_0x1c5b('0x1d')]||'wav','context':_0x25e015['context'],'exten':_0x25e015[_0x1c5b('0x7')],'priority':_0x49b73a++,'VoiceExtensionId':_0x25e015['id']});}return _0x8aa516;}function _0x255c32(_0x254ea8,_0x193a35){var _0x3289f4=[{'name':_0x1c5b('0x20'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x1c5b('0x21'),'param':0x2},{'name':_0x1c5b('0x22'),'param':0x3}];var _0x50337d={};var _0x4760d2=_0x193a35[_0x1c5b('0x23')](',');var _0x4e5bf4=[];for(var _0x3294b1=0x0;_0x3294b1<_0x3289f4[_0x1c5b('0x24')];_0x3294b1++){switch(_0x3289f4[_0x3294b1][_0x1c5b('0x25')]){case _0x1c5b('0x20'):_0x50337d[_0x1c5b('0x20')]=_0x4760d2[_0x3289f4[_0x3294b1][_0x1c5b('0x26')]][_0x1c5b('0x23')]('/')[0x1];_0x50337d['phone']=_0x4760d2[_0x3289f4[_0x3294b1][_0x1c5b('0x26')]][_0x1c5b('0x23')]('/')[0x2];_0x50337d[_0x1c5b('0x27')]=_0x50337d[_0x1c5b('0x28')]?_0x50337d[_0x1c5b('0x28')]['split']('$')[0x0]:undefined;_0x50337d[_0x1c5b('0x28')]=_0x254ea8[_0x1c5b('0x14')]?(_0x50337d[_0x1c5b('0x27')]||'')+_0x1c5b('0x15')+_0x254ea8[_0x1c5b('0x14')]+'}':(_0x50337d[_0x1c5b('0x27')]||'')+'${EXTEN}';_0x4e5bf4[_0x3289f4[_0x3294b1][_0x1c5b('0x26')]]=[_0x1c5b('0x29'),_0x50337d[_0x1c5b('0x20')],_0x50337d['phone']][_0x1c5b('0x2a')]('/');break;case _0x1c5b('0x21'):_0x50337d[_0x1c5b('0x21')]=_0x4760d2[_0x3289f4[_0x3294b1][_0x1c5b('0x26')]];if(_0x254ea8[_0x1c5b('0x1d')]!=='none'){if(_0x50337d[_0x1c5b('0x21')][_0x1c5b('0x2b')](_0x1c5b('0x2c'))<0x0){_0x50337d[_0x1c5b('0x21')]+=_0x1c5b('0x2c');}}else{_0x50337d['options']=_0x50337d[_0x1c5b('0x21')][_0x1c5b('0x2d')](_0x1c5b('0x2c'),'');}_0x4e5bf4[_0x3289f4[_0x3294b1][_0x1c5b('0x26')]]=_0x50337d[_0x1c5b('0x21')];break;default:_0x4e5bf4[_0x3289f4[_0x3294b1][_0x1c5b('0x26')]]=_0x4760d2[_0x3289f4[_0x3294b1][_0x1c5b('0x26')]];}}return _0x4e5bf4[_0x1c5b('0x2a')](',');}function _0x510708(_0x3bd8c7,_0x43b348,_0x2803cf){return new Promise(function(_0x22d583,_0x4d8622){var _0xd473e=[];if(_[_0x1c5b('0x2e')](_0x43b348))return _0x22d583(_0xd473e);_0x50a847[_0x1c5b('0x2f')][_0x1c5b('0x30')]({'attributes':['id',_0x1c5b('0x31'),'IntervalId'],'raw':!![]})[_0x1c5b('0x32')](function(_0x386fd7){for(var _0x569e49=0x0,_0x14e8a0=0x0;_0x569e49<_0x43b348['length'];_0x569e49++,_0x14e8a0=0x0){var _0x2f5e7a=_0x43b348[_0x569e49];var _0x1c8589=[];var _0x1aa7e1=[];delete _0x2f5e7a['id'];if(_0x2f5e7a[_0x1c5b('0x31')]!==_0x1c5b('0x33')){_0x2f5e7a[_0x1c5b('0x34')]=[_0x2f5e7a[_0x1c5b('0x31')]];}else{_0x2f5e7a[_0x1c5b('0x34')]=_0x2f5e7a['IntervalId']?_[_0x1c5b('0x35')](_['filter'](_0x386fd7,{'IntervalId':_0x2f5e7a['IntervalId']}),'interval'):[];}_0x2f5e7a[_0x1c5b('0x6')]=_0x3bd8c7['context'];_0x2f5e7a[_0x1c5b('0x7')]=_0x3bd8c7['exten'];if(_0x2f5e7a[_0x1c5b('0x5')])_0x2f5e7a[_0x1c5b('0x5')]=_0x2f5e7a[_0x1c5b('0x5')][_0x1c5b('0x36')]();if(_0x3bd8c7['type']===_0x1c5b('0x11')){if(_0x2f5e7a[_0x1c5b('0x1c')](_0x1c5b('0x37'))&&_0x2f5e7a[_0x1c5b('0x37')]&&_0x2f5e7a['tag']!=='--'){_0x1c8589['push']({'type':_0x2f5e7a[_0x1c5b('0x5')][_0x1c5b('0x36')](),'app':_0x1c5b('0x4'),'appdata':_0x1c5b('0x38')+_0x2f5e7a[_0x1c5b('0x37')],'context':_0x3bd8c7[_0x1c5b('0x6')],'exten':_0x3bd8c7[_0x1c5b('0x7')],'priority':_0x2f5e7a[_0x1c5b('0x34')][_0x1c5b('0x24')]+_0x2803cf+_0x14e8a0++,'VoiceExtensionId':_0x3bd8c7['id']});}_0x1c8589[_0x1c5b('0xd')]({'type':_0x2f5e7a[_0x1c5b('0x5')]['toLowerCase'](),'app':_0x1c5b('0x17'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x2f5e7a[_0x1c5b('0x39')]?_0x1c5b('0x3a')+_0x2f5e7a[_0x1c5b('0x39')]+')':_0x1c5b('0x3b')),'context':_0x3bd8c7[_0x1c5b('0x6')],'exten':_0x3bd8c7[_0x1c5b('0x7')],'priority':_0x2f5e7a[_0x1c5b('0x34')][_0x1c5b('0x24')]+_0x2803cf+_0x14e8a0++,'VoiceExtensionId':_0x3bd8c7['id']});}else{if(_0x2f5e7a['hasOwnProperty'](_0x1c5b('0x3c'))){if([_0x1c5b('0x3d'),_0x1c5b('0x3e')][_0x1c5b('0x3f')](_0x2f5e7a['app']['toLowerCase']())&&_0x2f5e7a[_0x1c5b('0x40')]!=='custom'){if(_0x2f5e7a[_0x1c5b('0x3c')]){_0x1c8589[_0x1c5b('0xd')]({'type':_0x2f5e7a['type'][_0x1c5b('0x36')](),'app':_0x1c5b('0x17'),'appdata':_0x1c5b('0x41'),'context':_0x3bd8c7[_0x1c5b('0x6')],'exten':_0x3bd8c7['exten'],'priority':_0x2f5e7a[_0x1c5b('0x34')][_0x1c5b('0x24')]+_0x2803cf+_0x14e8a0++,'VoiceExtensionId':_0x3bd8c7['id']});_0x1c8589[_0x1c5b('0xd')]({'type':_0x2f5e7a['type'][_0x1c5b('0x36')](),'app':_0x1c5b('0x4'),'appdata':_0x1c5b('0x42'),'context':_0x3bd8c7[_0x1c5b('0x6')],'exten':_0x3bd8c7['exten'],'priority':_0x2f5e7a[_0x1c5b('0x34')][_0x1c5b('0x24')]+_0x2803cf+_0x14e8a0++,'VoiceExtensionId':_0x3bd8c7['id']});}else{_0x1c8589['push']({'type':_0x2f5e7a[_0x1c5b('0x5')][_0x1c5b('0x36')](),'app':_0x1c5b('0x17'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3bd8c7[_0x1c5b('0x6')],'exten':_0x3bd8c7[_0x1c5b('0x7')],'priority':_0x2f5e7a[_0x1c5b('0x34')][_0x1c5b('0x24')]+_0x2803cf+_0x14e8a0++,'VoiceExtensionId':_0x3bd8c7['id']});_0x1c8589[_0x1c5b('0xd')]({'type':_0x2f5e7a[_0x1c5b('0x5')][_0x1c5b('0x36')](),'app':_0x1c5b('0x4'),'appdata':_0x1c5b('0x43'),'context':_0x3bd8c7[_0x1c5b('0x6')],'exten':_0x3bd8c7[_0x1c5b('0x7')],'priority':_0x2f5e7a[_0x1c5b('0x34')]['length']+_0x2803cf+_0x14e8a0++,'VoiceExtensionId':_0x3bd8c7['id']});}}}}for(var _0x559a48=0x0;_0x559a48<_0x2f5e7a[_0x1c5b('0x34')][_0x1c5b('0x24')];_0x559a48++){var _0x61eb01=_0x2803cf+_0x2f5e7a[_0x1c5b('0x34')][_0x1c5b('0x24')];var _0x2bb622=_0x559a48===_0x2f5e7a[_0x1c5b('0x34')][_0x1c5b('0x24')]-0x1?_0x2803cf+_0x1c8589[_0x1c5b('0x24')]+_0x1aa7e1['length']+0x2:_0x2803cf+_0x559a48+0x1;_0x1c8589[_0x1c5b('0x44')](_0x559a48,0x0,{'type':_0x3bd8c7[_0x1c5b('0x5')],'app':_0x1c5b('0x45'),'appdata':_0x2f5e7a[_0x1c5b('0x34')][_0x559a48]+'?'+_0x3bd8c7[_0x1c5b('0x6')]+_0x1c5b('0x46')+_0x61eb01+':'+_0x3bd8c7['context']+_0x1c5b('0x46')+_0x2bb622,'exten':_0x3bd8c7['exten'],'context':_0x3bd8c7[_0x1c5b('0x6')],'priority':_0x2803cf+_0x559a48,'VoiceExtensionId':_0x3bd8c7['id']});}if(_0x2f5e7a[_0x1c5b('0x40')]===_0x1c5b('0x47')){_0x2f5e7a[_0x1c5b('0x48')]=_0x255c32(_0x3bd8c7,_0x2f5e7a['appdata']);}if(_0x2f5e7a[_0x1c5b('0x40')]===_0x1c5b('0x49')){_0x1c8589[_0x1c5b('0xd')]({'type':_0x2f5e7a[_0x1c5b('0x5')][_0x1c5b('0x36')](),'app':_0x1c5b('0x4'),'appdata':_0x1c5b('0x4a'),'context':_0x3bd8c7[_0x1c5b('0x6')],'exten':_0x3bd8c7[_0x1c5b('0x7')],'priority':_0x2f5e7a[_0x1c5b('0x34')]['length']+_0x2803cf+_0x14e8a0++,'VoiceExtensionId':_0x3bd8c7['id']});}_0x2f5e7a['priority']=_0x1c8589[_0x1c5b('0x24')]?_['last'](_0x1c8589)[_0x1c5b('0x4b')]+0x1:_0x2803cf;_0xd473e=_[_0x1c5b('0x4c')](_0xd473e,_0x1c8589,[_0x2f5e7a],_0x1aa7e1);_0x2803cf=_[_0x1c5b('0x4d')](_0xd473e)['priority']+0x1;}return _0x22d583(_0xd473e);})[_0x1c5b('0x4e')](function(_0x391ad8){_0x4d8622(_0x391ad8);});});}return _0x5a9bb3['define'](_0x1c5b('0x4f'),attributes,{'tableName':_0x1c5b('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5256e3){var _0x475635=this['get']({'plain':!![]});var _0x5084a4=_0x475635[_0x1c5b('0x5')]===_0x1c5b('0x11')?_0x37f051(_0x475635):_0x5eb32a(_0x475635);return _0x510708(_0x475635,_0x5256e3,_[_0x1c5b('0x4d')](_0x5084a4)[_0x1c5b('0x4b')]+0x1)[_0x1c5b('0x32')](function(_0x4ef51c){var _0xe55051=_['concat'](_0x5084a4,_0x4ef51c);_0xe55051[_0x1c5b('0xd')]({'type':_0x475635[_0x1c5b('0x5')],'app':_0x1c5b('0x51'),'exten':_0x475635[_0x1c5b('0x7')],'context':_0x475635[_0x1c5b('0x6')],'priority':_[_0x1c5b('0x4d')](_0xe55051)[_0x1c5b('0x4b')]+0x1,'VoiceExtensionId':_0x475635['id']});return _0xe55051;});}}});}; \ No newline at end of file +var _0xd2c6=['trunk','timeout','options','url','split','name','phone','param','prefix','${EXTEN}','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','then','length','*,*,*,*','intervals','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','queue','playback','includes','app','appType','answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','last','priority','concat','catch','define','VoiceExtension','voice_extensions','Hangup','lodash','./voiceExtension.attributes','exten','type','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','push','Set','context','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','${EXTEN:','cutdigits','CDR(routeid)=','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav'];(function(_0xd6640b,_0x475e47){var _0x4c843e=function(_0x11040f){while(--_0x11040f){_0xd6640b['push'](_0xd6640b['shift']());}};_0x4c843e(++_0x475e47);}(_0xd2c6,0x171));var _0x6d2c=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xd2c6[_0x4ed520];return _0x4415a6;};'use strict';var _=require(_0x6d2c('0x0'));var attributes=require(_0x6d2c('0x1'));module['exports']=function(_0x3e72e3){var _0x4a3f59=_0x3e72e3['models'];function _0x2768e1(_0x1c9217){var _0x3659ce=0x2;var _0x51efd6=[{'type':_0x1c9217['type'],'app':'Set','appdata':'CDR(type)='+_0x1c9217['type'],'context':_0x1c9217['context'],'exten':_0x1c9217[_0x6d2c('0x2')],'priority':_0x3659ce++,'VoiceExtensionId':_0x1c9217['id']},{'type':_0x1c9217[_0x6d2c('0x3')],'app':_0x1c9217[_0x6d2c('0x4')]?'Set':_0x6d2c('0x5'),'appdata':_0x1c9217['alias']?_0x6d2c('0x6')+_0x1c9217[_0x6d2c('0x4')]:_0x6d2c('0x7'),'context':_0x1c9217['context'],'exten':_0x1c9217[_0x6d2c('0x2')],'priority':_0x3659ce++,'VoiceExtensionId':_0x1c9217['id']}];if(_0x1c9217[_0x6d2c('0x3')]==='inbound'){_0x51efd6[_0x6d2c('0x8')]({'type':'inbound','app':_0x6d2c('0x9'),'appdata':'CDR(routeid)='+_0x1c9217['id'],'context':_0x1c9217[_0x6d2c('0xa')],'exten':_0x1c9217[_0x6d2c('0x2')],'priority':_0x3659ce++,'VoiceExtensionId':_0x1c9217['id']});}_0x51efd6[_0x6d2c('0x8')]({'type':_0x1c9217[_0x6d2c('0x3')],'app':_0x6d2c('0x9'),'appdata':_0x6d2c('0xb'),'context':_0x1c9217[_0x6d2c('0xa')],'exten':_0x1c9217['exten'],'priority':_0x3659ce++,'VoiceExtensionId':_0x1c9217['id']},{'type':_0x1c9217[_0x6d2c('0x3')],'app':_0x6d2c('0x9'),'appdata':_0x6d2c('0xc'),'context':_0x1c9217[_0x6d2c('0xa')],'exten':_0x1c9217[_0x6d2c('0x2')],'priority':_0x3659ce++,'VoiceExtensionId':_0x1c9217['id']},{'type':_0x1c9217[_0x6d2c('0x3')],'app':'Set','appdata':_0x6d2c('0xd'),'context':_0x1c9217[_0x6d2c('0xa')],'exten':_0x1c9217['exten'],'priority':_0x3659ce++,'VoiceExtensionId':_0x1c9217['id']});return _0x51efd6;}function _0x4d0f7a(_0x35733d){var _0x48407d=0x2;var _0x403d2a=[{'type':_0x6d2c('0xe'),'app':_0x6d2c('0x9'),'appdata':_0x6d2c('0xf'),'context':_0x35733d[_0x6d2c('0xa')],'exten':_0x35733d['exten'],'priority':_0x48407d++,'VoiceExtensionId':_0x35733d['id']},{'type':_0x6d2c('0xe'),'app':_0x35733d[_0x6d2c('0x4')]?_0x6d2c('0x9'):_0x6d2c('0x5'),'appdata':_0x35733d['alias']?_0x6d2c('0x6')+_0x35733d[_0x6d2c('0x4')]:_0x6d2c('0x7'),'context':_0x35733d[_0x6d2c('0xa')],'exten':_0x35733d['exten'],'priority':_0x48407d++,'VoiceExtensionId':_0x35733d['id']},{'type':'outbound','app':'Set','appdata':'CDR(destination)='+(_0x35733d['cutdigits']?_0x6d2c('0x10')+_0x35733d[_0x6d2c('0x11')]+'}':'${EXTEN}'),'context':_0x35733d['context'],'exten':_0x35733d[_0x6d2c('0x2')],'priority':_0x48407d++,'VoiceExtensionId':_0x35733d['id']},{'type':_0x6d2c('0xe'),'app':_0x6d2c('0x9'),'appdata':_0x6d2c('0x12')+_0x35733d['id'],'context':_0x35733d[_0x6d2c('0xa')],'exten':_0x35733d['exten'],'priority':_0x48407d++,'VoiceExtensionId':_0x35733d['id']},{'type':_0x6d2c('0xe'),'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x48407d+0x2)+_0x6d2c('0x13')+(_0x48407d+0x1)+')','context':_0x35733d[_0x6d2c('0xa')],'exten':_0x35733d[_0x6d2c('0x2')],'priority':_0x48407d++,'VoiceExtensionId':_0x35733d['id']},{'type':_0x6d2c('0xe'),'app':_0x6d2c('0x9'),'appdata':_0x35733d['cutdigits']?_0x6d2c('0x14')+_0x35733d[_0x6d2c('0x11')]+'}':_0x6d2c('0x15'),'context':_0x35733d['context'],'exten':_0x35733d[_0x6d2c('0x2')],'priority':_0x48407d++,'VoiceExtensionId':_0x35733d['id']},{'type':'outbound','app':_0x6d2c('0x9'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x35733d[_0x6d2c('0xa')],'exten':_0x35733d[_0x6d2c('0x2')],'priority':_0x48407d++,'VoiceExtensionId':_0x35733d['id']},{'type':'outbound','app':_0x6d2c('0x9'),'appdata':_0x6d2c('0xc'),'context':_0x35733d[_0x6d2c('0xa')],'exten':_0x35733d[_0x6d2c('0x2')],'priority':_0x48407d++,'VoiceExtensionId':_0x35733d['id']},{'type':'outbound','app':_0x6d2c('0x9'),'appdata':_0x6d2c('0xd'),'context':_0x35733d['context'],'exten':_0x35733d[_0x6d2c('0x2')],'priority':_0x48407d++,'VoiceExtensionId':_0x35733d['id']},{'type':'outbound','app':_0x6d2c('0x9'),'appdata':'outboundrouteid='+_0x35733d['id'],'context':_0x35733d[_0x6d2c('0xa')],'exten':_0x35733d['exten'],'priority':_0x48407d++,'VoiceExtensionId':_0x35733d['id']}];if(_0x35733d['hasOwnProperty'](_0x6d2c('0x16'))&&_0x35733d[_0x6d2c('0x16')]!==_0x6d2c('0x17')){_0x403d2a['push']({'type':'outbound','app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x35733d[_0x6d2c('0xa')],'exten':_0x35733d['exten'],'priority':_0x48407d++,'VoiceExtensionId':_0x35733d['id']},{'type':_0x6d2c('0xe'),'app':_0x6d2c('0x9'),'appdata':_0x6d2c('0x18')+_0x35733d[_0x6d2c('0x16')]||_0x6d2c('0x19'),'context':_0x35733d[_0x6d2c('0xa')],'exten':_0x35733d[_0x6d2c('0x2')],'priority':_0x48407d++,'VoiceExtensionId':_0x35733d['id']});}return _0x403d2a;}function _0x29bfad(_0x8a0364,_0x190ae9){var _0x533f9d=[{'name':_0x6d2c('0x1a'),'param':0x0},{'name':_0x6d2c('0x1b'),'param':0x1},{'name':_0x6d2c('0x1c'),'param':0x2},{'name':_0x6d2c('0x1d'),'param':0x3}];var _0x17dbaa={};var _0x25a15e=_0x190ae9[_0x6d2c('0x1e')](',');var _0x483d69=[];for(var _0x9c036f=0x0;_0x9c036f<_0x533f9d['length'];_0x9c036f++){switch(_0x533f9d[_0x9c036f][_0x6d2c('0x1f')]){case _0x6d2c('0x1a'):_0x17dbaa[_0x6d2c('0x1a')]=_0x25a15e[_0x533f9d[_0x9c036f]['param']][_0x6d2c('0x1e')]('/')[0x1];_0x17dbaa[_0x6d2c('0x20')]=_0x25a15e[_0x533f9d[_0x9c036f][_0x6d2c('0x21')]][_0x6d2c('0x1e')]('/')[0x2];_0x17dbaa[_0x6d2c('0x22')]=_0x17dbaa[_0x6d2c('0x20')]?_0x17dbaa[_0x6d2c('0x20')][_0x6d2c('0x1e')]('$')[0x0]:undefined;_0x17dbaa['phone']=_0x8a0364[_0x6d2c('0x11')]?(_0x17dbaa[_0x6d2c('0x22')]||'')+_0x6d2c('0x10')+_0x8a0364[_0x6d2c('0x11')]+'}':(_0x17dbaa[_0x6d2c('0x22')]||'')+_0x6d2c('0x23');_0x483d69[_0x533f9d[_0x9c036f][_0x6d2c('0x21')]]=[_0x6d2c('0x24'),_0x17dbaa['trunk'],_0x17dbaa[_0x6d2c('0x20')]][_0x6d2c('0x25')]('/');break;case _0x6d2c('0x1c'):_0x17dbaa[_0x6d2c('0x1c')]=_0x25a15e[_0x533f9d[_0x9c036f][_0x6d2c('0x21')]];if(_0x8a0364[_0x6d2c('0x16')]!==_0x6d2c('0x17')){if(_0x17dbaa[_0x6d2c('0x1c')][_0x6d2c('0x26')](_0x6d2c('0x27'))<0x0){_0x17dbaa[_0x6d2c('0x1c')]+=_0x6d2c('0x27');}}else{_0x17dbaa[_0x6d2c('0x1c')]=_0x17dbaa['options']['replace'](_0x6d2c('0x27'),'');}_0x483d69[_0x533f9d[_0x9c036f]['param']]=_0x17dbaa[_0x6d2c('0x1c')];break;default:_0x483d69[_0x533f9d[_0x9c036f][_0x6d2c('0x21')]]=_0x25a15e[_0x533f9d[_0x9c036f][_0x6d2c('0x21')]];}}return _0x483d69[_0x6d2c('0x25')](',');}function _0x5e8c4b(_0x39ad25,_0x3737d9,_0x54a4fd){return new Promise(function(_0x1f3a36,_0x62dad2){var _0x482334=[];if(_[_0x6d2c('0x28')](_0x3737d9))return _0x1f3a36(_0x482334);_0x4a3f59[_0x6d2c('0x29')][_0x6d2c('0x2a')]({'attributes':['id',_0x6d2c('0x2b'),_0x6d2c('0x2c')],'raw':!![]})[_0x6d2c('0x2d')](function(_0x400ace){for(var _0x390aa4=0x0,_0x3a94d6=0x0;_0x390aa4<_0x3737d9[_0x6d2c('0x2e')];_0x390aa4++,_0x3a94d6=0x0){var _0x3133e6=_0x3737d9[_0x390aa4];var _0x44a9e5=[];var _0x2a4ec7=[];delete _0x3133e6['id'];if(_0x3133e6['interval']!==_0x6d2c('0x2f')){_0x3133e6[_0x6d2c('0x30')]=[_0x3133e6[_0x6d2c('0x2b')]];}else{_0x3133e6[_0x6d2c('0x30')]=_0x3133e6[_0x6d2c('0x2c')]?_[_0x6d2c('0x31')](_[_0x6d2c('0x32')](_0x400ace,{'IntervalId':_0x3133e6[_0x6d2c('0x2c')]}),_0x6d2c('0x2b')):[];}_0x3133e6['context']=_0x39ad25[_0x6d2c('0xa')];_0x3133e6[_0x6d2c('0x2')]=_0x39ad25[_0x6d2c('0x2')];if(_0x3133e6[_0x6d2c('0x3')])_0x3133e6['type']=_0x3133e6['type'][_0x6d2c('0x33')]();if(_0x39ad25[_0x6d2c('0x3')]==='outbound'){if(_0x3133e6[_0x6d2c('0x34')](_0x6d2c('0x35'))&&_0x3133e6[_0x6d2c('0x35')]&&_0x3133e6[_0x6d2c('0x35')]!=='--'){_0x44a9e5[_0x6d2c('0x8')]({'type':_0x3133e6[_0x6d2c('0x3')][_0x6d2c('0x33')](),'app':'Set','appdata':_0x6d2c('0x36')+_0x3133e6[_0x6d2c('0x35')],'context':_0x39ad25[_0x6d2c('0xa')],'exten':_0x39ad25[_0x6d2c('0x2')],'priority':_0x3133e6['intervals'][_0x6d2c('0x2e')]+_0x54a4fd+_0x3a94d6++,'VoiceExtensionId':_0x39ad25['id']});}_0x44a9e5[_0x6d2c('0x8')]({'type':_0x3133e6['type'][_0x6d2c('0x33')](),'app':_0x6d2c('0x37'),'appdata':_0x6d2c('0x38')+(_0x3133e6[_0x6d2c('0x39')]?'Set(CALLERID(all)='+_0x3133e6['callerID']+')':'NoOp(No\x20number\x20available)'),'context':_0x39ad25[_0x6d2c('0xa')],'exten':_0x39ad25[_0x6d2c('0x2')],'priority':_0x3133e6[_0x6d2c('0x30')][_0x6d2c('0x2e')]+_0x54a4fd+_0x3a94d6++,'VoiceExtensionId':_0x39ad25['id']});}else{if(_0x3133e6[_0x6d2c('0x34')]('answer')){if([_0x6d2c('0x3a'),_0x6d2c('0x3b')][_0x6d2c('0x3c')](_0x3133e6[_0x6d2c('0x3d')][_0x6d2c('0x33')]())&&_0x3133e6[_0x6d2c('0x3e')]!=='custom'){if(_0x3133e6[_0x6d2c('0x3f')]){_0x44a9e5[_0x6d2c('0x8')]({'type':_0x3133e6[_0x6d2c('0x3')]['toLowerCase'](),'app':_0x6d2c('0x37'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x39ad25['context'],'exten':_0x39ad25[_0x6d2c('0x2')],'priority':_0x3133e6[_0x6d2c('0x30')]['length']+_0x54a4fd+_0x3a94d6++,'VoiceExtensionId':_0x39ad25['id']});_0x44a9e5[_0x6d2c('0x8')]({'type':_0x3133e6['type']['toLowerCase'](),'app':'Set','appdata':_0x6d2c('0x40'),'context':_0x39ad25[_0x6d2c('0xa')],'exten':_0x39ad25[_0x6d2c('0x2')],'priority':_0x3133e6[_0x6d2c('0x30')][_0x6d2c('0x2e')]+_0x54a4fd+_0x3a94d6++,'VoiceExtensionId':_0x39ad25['id']});}else{_0x44a9e5[_0x6d2c('0x8')]({'type':_0x3133e6[_0x6d2c('0x3')][_0x6d2c('0x33')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x39ad25[_0x6d2c('0xa')],'exten':_0x39ad25[_0x6d2c('0x2')],'priority':_0x3133e6[_0x6d2c('0x30')][_0x6d2c('0x2e')]+_0x54a4fd+_0x3a94d6++,'VoiceExtensionId':_0x39ad25['id']});_0x44a9e5[_0x6d2c('0x8')]({'type':_0x3133e6[_0x6d2c('0x3')][_0x6d2c('0x33')](),'app':_0x6d2c('0x9'),'appdata':_0x6d2c('0x41'),'context':_0x39ad25[_0x6d2c('0xa')],'exten':_0x39ad25[_0x6d2c('0x2')],'priority':_0x3133e6[_0x6d2c('0x30')][_0x6d2c('0x2e')]+_0x54a4fd+_0x3a94d6++,'VoiceExtensionId':_0x39ad25['id']});}}}}for(var _0x1095c4=0x0;_0x1095c4<_0x3133e6[_0x6d2c('0x30')][_0x6d2c('0x2e')];_0x1095c4++){var _0x4d7350=_0x54a4fd+_0x3133e6[_0x6d2c('0x30')][_0x6d2c('0x2e')];var _0x3685d8=_0x1095c4===_0x3133e6[_0x6d2c('0x30')]['length']-0x1?_0x54a4fd+_0x44a9e5[_0x6d2c('0x2e')]+_0x2a4ec7[_0x6d2c('0x2e')]+0x2:_0x54a4fd+_0x1095c4+0x1;_0x44a9e5['splice'](_0x1095c4,0x0,{'type':_0x39ad25[_0x6d2c('0x3')],'app':_0x6d2c('0x42'),'appdata':_0x3133e6[_0x6d2c('0x30')][_0x1095c4]+'?'+_0x39ad25['context']+_0x6d2c('0x43')+_0x4d7350+':'+_0x39ad25['context']+_0x6d2c('0x43')+_0x3685d8,'exten':_0x39ad25[_0x6d2c('0x2')],'context':_0x39ad25[_0x6d2c('0xa')],'priority':_0x54a4fd+_0x1095c4,'VoiceExtensionId':_0x39ad25['id']});}if(_0x3133e6['appType']===_0x6d2c('0x44')){_0x3133e6[_0x6d2c('0x45')]=_0x29bfad(_0x39ad25,_0x3133e6['appdata']);}if(_0x3133e6[_0x6d2c('0x3e')]==='agi'){_0x44a9e5[_0x6d2c('0x8')]({'type':_0x3133e6['type']['toLowerCase'](),'app':_0x6d2c('0x9'),'appdata':_0x6d2c('0x46'),'context':_0x39ad25[_0x6d2c('0xa')],'exten':_0x39ad25[_0x6d2c('0x2')],'priority':_0x3133e6[_0x6d2c('0x30')][_0x6d2c('0x2e')]+_0x54a4fd+_0x3a94d6++,'VoiceExtensionId':_0x39ad25['id']});}_0x3133e6['priority']=_0x44a9e5['length']?_[_0x6d2c('0x47')](_0x44a9e5)[_0x6d2c('0x48')]+0x1:_0x54a4fd;_0x482334=_[_0x6d2c('0x49')](_0x482334,_0x44a9e5,[_0x3133e6],_0x2a4ec7);_0x54a4fd=_[_0x6d2c('0x47')](_0x482334)['priority']+0x1;}return _0x1f3a36(_0x482334);})[_0x6d2c('0x4a')](function(_0x42be54){_0x62dad2(_0x42be54);});});}return _0x3e72e3[_0x6d2c('0x4b')](_0x6d2c('0x4c'),attributes,{'tableName':_0x6d2c('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x262b8e){var _0x3e3f15=this['get']({'plain':!![]});var _0x42abbf=_0x3e3f15['type']===_0x6d2c('0xe')?_0x4d0f7a(_0x3e3f15):_0x2768e1(_0x3e3f15);return _0x5e8c4b(_0x3e3f15,_0x262b8e,_[_0x6d2c('0x47')](_0x42abbf)[_0x6d2c('0x48')]+0x1)[_0x6d2c('0x2d')](function(_0x4111e6){var _0x11c21a=_['concat'](_0x42abbf,_0x4111e6);_0x11c21a[_0x6d2c('0x8')]({'type':_0x3e3f15[_0x6d2c('0x3')],'app':_0x6d2c('0x4e'),'exten':_0x3e3f15[_0x6d2c('0x2')],'context':_0x3e3f15[_0x6d2c('0xa')],'priority':_[_0x6d2c('0x47')](_0x11c21a)[_0x6d2c('0x48')]+0x1,'VoiceExtensionId':_0x3e3f15['id']});return _0x11c21a;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index bb8e821..d6b0b46 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 _0x5419=['./voiceExtension.socket','request','then','info','debug','request\x20sent','error','code','VoiceExtension,\x20%s,\x20%s','message','result','VoiceExtension','findAll','options','raw','attributes','limit','include','model','map','GetVoiceExtension','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x5eedac,_0x366877){var _0x68fada=function(_0x1c7f54){while(--_0x1c7f54){_0x5eedac['push'](_0x5eedac['shift']());}};_0x68fada(++_0x366877);}(_0x5419,0x175));var _0x9541=function(_0x1662a0,_0x2a19cd){_0x1662a0=_0x1662a0-0x0;var _0xbb687f=_0x5419[_0x1662a0];return _0xbb687f;};'use strict';var _=require(_0x9541('0x0'));var util=require(_0x9541('0x1'));var moment=require(_0x9541('0x2'));var BPromise=require(_0x9541('0x3'));var rs=require(_0x9541('0x4'));var fs=require('fs');var Redis=require(_0x9541('0x5'));var db=require(_0x9541('0x6'))['db'];var utils=require(_0x9541('0x7'));var logger=require(_0x9541('0x8'))(_0x9541('0x9'));var config=require('../../config/environment');var jayson=require(_0x9541('0xa'));var client=jayson[_0x9541('0xb')][_0x9541('0xc')]({'port':0x232a});config[_0x9541('0xd')]=_[_0x9541('0xe')](config[_0x9541('0xd')],{'host':_0x9541('0xf'),'port':0x18eb});var socket=require(_0x9541('0x10'))(new Redis(config['redis']));require(_0x9541('0x11'))['register'](socket);function respondWithRpcPromise(_0x144fc9,_0x3dec9b,_0x76ee06){return new BPromise(function(_0x46dd8a,_0x35b36a){return client[_0x9541('0x12')](_0x144fc9,_0x76ee06)[_0x9541('0x13')](function(_0x47b213){logger[_0x9541('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x3dec9b,'request\x20sent');logger[_0x9541('0x15')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x3dec9b,_0x9541('0x16'),JSON['stringify'](_0x47b213));if(_0x47b213[_0x9541('0x17')]){if(_0x47b213[_0x9541('0x17')][_0x9541('0x18')]===0x1f4){logger[_0x9541('0x17')](_0x9541('0x19'),_0x3dec9b,_0x47b213[_0x9541('0x17')]['message']);return _0x35b36a(_0x47b213[_0x9541('0x17')]['message']);}logger[_0x9541('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x3dec9b,_0x47b213[_0x9541('0x17')]['message']);return _0x46dd8a(_0x47b213[_0x9541('0x17')][_0x9541('0x1a')]);}else{logger[_0x9541('0x14')](_0x9541('0x19'),_0x3dec9b,_0x9541('0x16'));_0x46dd8a(_0x47b213[_0x9541('0x1b')]['message']);}})['catch'](function(_0xfaef86){logger[_0x9541('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x3dec9b,_0xfaef86);_0x35b36a(_0xfaef86);});});}exports['GetVoiceExtension']=function(_0x2aafdb){var _0x7c52dc=this;return new Promise(function(_0x2417e4,_0xc6683a){return db[_0x9541('0x1c')][_0x9541('0x1d')]({'raw':_0x2aafdb[_0x9541('0x1e')]?_0x2aafdb[_0x9541('0x1e')][_0x9541('0x1f')]===undefined?!![]:![]:!![],'where':_0x2aafdb[_0x9541('0x1e')]?_0x2aafdb[_0x9541('0x1e')]['where']||null:null,'attributes':_0x2aafdb[_0x9541('0x1e')]?_0x2aafdb[_0x9541('0x1e')][_0x9541('0x20')]||null:null,'limit':_0x2aafdb[_0x9541('0x1e')]?_0x2aafdb[_0x9541('0x1e')][_0x9541('0x21')]||null:null,'include':_0x2aafdb[_0x9541('0x1e')]?_0x2aafdb[_0x9541('0x1e')][_0x9541('0x22')]?_['map'](_0x2aafdb[_0x9541('0x1e')]['include'],function(_0xbaf6cb){return{'model':db[_0xbaf6cb[_0x9541('0x23')]],'as':_0xbaf6cb['as'],'attributes':_0xbaf6cb[_0x9541('0x20')],'include':_0xbaf6cb[_0x9541('0x22')]?_['map'](_0xbaf6cb[_0x9541('0x22')],function(_0x46ea7e){return{'model':db[_0x46ea7e[_0x9541('0x23')]],'as':_0x46ea7e['as'],'attributes':_0x46ea7e[_0x9541('0x20')],'include':_0x46ea7e['include']?_[_0x9541('0x24')](_0x46ea7e['include'],function(_0x40a1bc){return{'model':db[_0x40a1bc[_0x9541('0x23')]],'as':_0x40a1bc['as'],'attributes':_0x40a1bc['attributes']};}):[]};}):[]};}):[]:[]})[_0x9541('0x13')](function(_0x2b2883){logger['info'](_0x9541('0x25'),_0x2aafdb);logger[_0x9541('0x15')]('GetVoiceExtension',_0x2aafdb,JSON[_0x9541('0x26')](_0x2b2883));_0x2417e4(_0x2b2883);})['catch'](function(_0x4455cf){logger[_0x9541('0x17')](_0x9541('0x25'),_0x4455cf[_0x9541('0x1a')],_0x2aafdb);_0xc6683a(_0x7c52dc[_0x9541('0x17')](0x1f4,_0x4455cf[_0x9541('0x1a')]));});});}; \ No newline at end of file +var _0x36bb=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','map','model','include','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x20f635,_0x2237d4){var _0x38be5f=function(_0x420b2f){while(--_0x420b2f){_0x20f635['push'](_0x20f635['shift']());}};_0x38be5f(++_0x2237d4);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb36b('0x0'));var util=require(_0xb36b('0x1'));var moment=require(_0xb36b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb36b('0x3'));var fs=require('fs');var Redis=require(_0xb36b('0x4'));var db=require(_0xb36b('0x5'))['db'];var utils=require(_0xb36b('0x6'));var logger=require(_0xb36b('0x7'))(_0xb36b('0x8'));var config=require(_0xb36b('0x9'));var jayson=require(_0xb36b('0xa'));var client=jayson[_0xb36b('0xb')][_0xb36b('0xc')]({'port':0x232a});config[_0xb36b('0xd')]=_[_0xb36b('0xe')](config[_0xb36b('0xd')],{'host':_0xb36b('0xf'),'port':0x18eb});var socket=require(_0xb36b('0x10'))(new Redis(config[_0xb36b('0xd')]));require(_0xb36b('0x11'))[_0xb36b('0x12')](socket);function respondWithRpcPromise(_0x18dea6,_0x5b70e7,_0x2323b0){return new BPromise(function(_0x2b26c4,_0x2bd78b){return client['request'](_0x18dea6,_0x2323b0)[_0xb36b('0x13')](function(_0x449056){logger[_0xb36b('0x14')](_0xb36b('0x15'),_0x5b70e7,_0xb36b('0x16'));logger[_0xb36b('0x17')](_0xb36b('0x18'),_0x5b70e7,_0xb36b('0x16'),JSON[_0xb36b('0x19')](_0x449056));if(_0x449056[_0xb36b('0x1a')]){if(_0x449056[_0xb36b('0x1a')]['code']===0x1f4){logger[_0xb36b('0x1a')]('VoiceExtension,\x20%s,\x20%s',_0x5b70e7,_0x449056['error'][_0xb36b('0x1b')]);return _0x2bd78b(_0x449056[_0xb36b('0x1a')][_0xb36b('0x1b')]);}logger[_0xb36b('0x1a')](_0xb36b('0x15'),_0x5b70e7,_0x449056[_0xb36b('0x1a')]['message']);return _0x2b26c4(_0x449056[_0xb36b('0x1a')][_0xb36b('0x1b')]);}else{logger[_0xb36b('0x14')](_0xb36b('0x15'),_0x5b70e7,'request\x20sent');_0x2b26c4(_0x449056[_0xb36b('0x1c')][_0xb36b('0x1b')]);}})[_0xb36b('0x1d')](function(_0x57a7b2){logger[_0xb36b('0x1a')]('VoiceExtension,\x20%s,\x20%s',_0x5b70e7,_0x57a7b2);_0x2bd78b(_0x57a7b2);});});}exports[_0xb36b('0x1e')]=function(_0xac85bd){var _0x27979d=this;return new Promise(function(_0x3eba4b,_0x4049fa){return db[_0xb36b('0x1f')][_0xb36b('0x20')]({'raw':_0xac85bd['options']?_0xac85bd[_0xb36b('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0xac85bd[_0xb36b('0x21')]?_0xac85bd['options'][_0xb36b('0x22')]||null:null,'attributes':_0xac85bd[_0xb36b('0x21')]?_0xac85bd[_0xb36b('0x21')][_0xb36b('0x23')]||null:null,'limit':_0xac85bd[_0xb36b('0x21')]?_0xac85bd['options'][_0xb36b('0x24')]||null:null,'include':_0xac85bd[_0xb36b('0x21')]?_0xac85bd[_0xb36b('0x21')]['include']?_[_0xb36b('0x25')](_0xac85bd['options']['include'],function(_0x50e8e4){return{'model':db[_0x50e8e4[_0xb36b('0x26')]],'as':_0x50e8e4['as'],'attributes':_0x50e8e4[_0xb36b('0x23')],'include':_0x50e8e4[_0xb36b('0x27')]?_[_0xb36b('0x25')](_0x50e8e4[_0xb36b('0x27')],function(_0x46dfc){return{'model':db[_0x46dfc[_0xb36b('0x26')]],'as':_0x46dfc['as'],'attributes':_0x46dfc[_0xb36b('0x23')],'include':_0x46dfc['include']?_['map'](_0x46dfc[_0xb36b('0x27')],function(_0x2724bf){return{'model':db[_0x2724bf[_0xb36b('0x26')]],'as':_0x2724bf['as'],'attributes':_0x2724bf[_0xb36b('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x492a96){logger[_0xb36b('0x14')]('GetVoiceExtension',_0xac85bd);logger[_0xb36b('0x17')](_0xb36b('0x1e'),_0xac85bd,JSON['stringify'](_0x492a96));_0x3eba4b(_0x492a96);})[_0xb36b('0x1d')](function(_0x24f8bc){logger[_0xb36b('0x1a')](_0xb36b('0x1e'),_0x24f8bc[_0xb36b('0x1b')],_0xac85bd);_0x4049fa(_0x27979d[_0xb36b('0x1a')](0x1f4,_0x24f8bc[_0xb36b('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index aab9ad9..29c192b 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 _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0x5ec473,_0x2e9c3a){var _0x581e90=function(_0x48c587){while(--_0x48c587){_0x5ec473['push'](_0x5ec473['shift']());}};_0x581e90(++_0x2e9c3a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x420f2a,_0x2cc58d){_0x420f2a=_0x420f2a-0x0;var _0x28f802=_0x5fc3[_0x420f2a];return _0x28f802;};'use strict';var VoiceExtensionEvents=require(_0x35fc('0x0'));var events=[_0x35fc('0x1'),'remove',_0x35fc('0x2')];function createListener(_0x2ac6da,_0x196bc2){return function(_0x91d024){_0x196bc2[_0x35fc('0x3')](_0x2ac6da,_0x91d024);};}function removeListener(_0x5e75e6,_0x2d1404){return function(){VoiceExtensionEvents[_0x35fc('0x4')](_0x5e75e6,_0x2d1404);};}exports[_0x35fc('0x5')]=function(_0x5b85ad){for(var _0x5754be=0x0,_0x19a0d1=events['length'];_0x5754be<_0x19a0d1;_0x5754be++){var _0x16e153=events[_0x5754be];var _0x27524f=createListener(_0x35fc('0x6')+_0x16e153,_0x5b85ad);VoiceExtensionEvents['on'](_0x16e153,_0x27524f);}}; \ No newline at end of file +var _0x53ec=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0x2cf57f,_0x4ecf6a){var _0x18e5d3=function(_0x109420){while(--_0x109420){_0x2cf57f['push'](_0x2cf57f['shift']());}};_0x18e5d3(++_0x4ecf6a);}(_0x53ec,0x192));var _0xc53e=function(_0x50068c,_0x38a87a){_0x50068c=_0x50068c-0x0;var _0x11826a=_0x53ec[_0x50068c];return _0x11826a;};'use strict';var VoiceExtensionEvents=require(_0xc53e('0x0'));var events=[_0xc53e('0x1'),_0xc53e('0x2'),_0xc53e('0x3')];function createListener(_0x1b04cc,_0xe45c6d){return function(_0x51c435){_0xe45c6d[_0xc53e('0x4')](_0x1b04cc,_0x51c435);};}function removeListener(_0x4e954a,_0x2b90f6){return function(){VoiceExtensionEvents[_0xc53e('0x5')](_0x4e954a,_0x2b90f6);};}exports['register']=function(_0x2f1414){for(var _0x4f989b=0x0,_0x41a9e8=events[_0xc53e('0x6')];_0x4f989b<_0x41a9e8;_0x4f989b++){var _0x5d3b28=events[_0x4f989b];var _0x1616ac=createListener(_0xc53e('0x7')+_0x5d3b28,_0x2f1414);VoiceExtensionEvents['on'](_0x5d3b28,_0x1616ac);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index ec56346..d5be904 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 _0x9a5a=['post','create','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','show','getMessages'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9a5a,0x194));var _0xa9a5=function(_0x3d4c68,_0x1d03c7){_0x3d4c68=_0x3d4c68-0x0;var _0x175590=_0x9a5a[_0x3d4c68];return _0x175590;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var fs_extra=require(_0xa9a5('0x5'));var auth=require(_0xa9a5('0x6'));var interaction=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var controller=require(_0xa9a5('0x9'));router[_0xa9a5('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9a5('0xb')]);router[_0xa9a5('0xa')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0xe')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xa9a5('0xf')]);router[_0xa9a5('0x10')]('/',auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x11')]);router[_0xa9a5('0x12')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller['update']);router['delete']('/:id',auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x13')]);module[_0xa9a5('0x14')]=router; \ No newline at end of file +var _0x4137=['getMessages','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','/:id/messages'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x4137,0xf8));var _0x7413=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4137[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['show']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0x11')]('/',auth['isAuthenticated'](),controller[_0x7413('0x12')]);router[_0x7413('0x13')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller[_0x7413('0x14')]);router['delete'](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['destroy']);module[_0x7413('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index d863aaa..e4dd84d 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 _0x3aea=['getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x2ddcbe,_0x146899){var _0x8c3255=function(_0xda5b80){while(--_0xda5b80){_0x2ddcbe['push'](_0x2ddcbe['shift']());}};_0x8c3255(++_0x146899);}(_0x3aea,0x15a));var _0xa3ae=function(_0x460ee6,_0xe7b05b){_0x460ee6=_0x460ee6-0x0;var _0x477a08=_0x3aea[_0x460ee6];return _0x477a08;};'use strict';var Sequelize=require(_0xa3ae('0x0'));module[_0xa3ae('0x1')]={'customer_id':{'type':Sequelize[_0xa3ae('0x2')]},'context':{'type':Sequelize[_0xa3ae('0x2')],'defaultValue':_0xa3ae('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xa3ae('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xa3ae('0x2')]},'fullname':{'type':Sequelize[_0xa3ae('0x2')]},'email':{'type':Sequelize[_0xa3ae('0x2')],'validate':{'isEmail':!![]},'set':function(_0x18e242){this[_0xa3ae('0x4')](_0xa3ae('0x5'),typeof _0x18e242===_0xa3ae('0x6')&&_0x18e242[_0xa3ae('0x7')]()?_0x18e242['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xa3ae('0x2')],'defaultValue':_0xa3ae('0x8')},'attach':{'type':Sequelize['ENUM'](_0xa3ae('0x9'),'no'),'defaultValue':_0xa3ae('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xa3ae('0xa')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xa3ae('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xa3ae('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xa3ae('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xa3ae('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xa3ae('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xa3ae('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xa3ae('0xa')](_0xa3ae('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xa3ae('0xa')](_0xa3ae('0x9'),'no'),'defaultValue':_0xa3ae('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xa3ae('0xa')](_0xa3ae('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xa3ae('0xa')](_0xa3ae('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xa3ae('0xa')]('yes','no'),'defaultValue':_0xa3ae('0x9'),'allowNull':![]},'stamp':{'type':_0xa3ae('0xc')},'emailsubject':{'type':Sequelize[_0xa3ae('0x2')]},'emailbody':{'type':Sequelize[_0xa3ae('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xa3ae('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xa3ae('0xe')],'get':function(){return this[_0xa3ae('0xf')](_0xa3ae('0x10'))+_0xa3ae('0x11')+this[_0xa3ae('0xf')](_0xa3ae('0x12'));}}}; \ No newline at end of file +var _0xa536=['contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize','STRING','from-voicemail'];(function(_0x57362e,_0x168f94){var _0x2255ab=function(_0x3959ad){while(--_0x3959ad){_0x57362e['push'](_0x57362e['shift']());}};_0x2255ab(++_0x168f94);}(_0xa536,0x173));var _0x6a53=function(_0x728e60,_0x432cd8){_0x728e60=_0x728e60-0x0;var _0x4cff82=_0xa536[_0x728e60];return _0x4cff82;};'use strict';var Sequelize=require(_0x6a53('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6a53('0x1')],'defaultValue':_0x6a53('0x2'),'unique':_0x6a53('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x6a53('0x1')]},'fullname':{'type':Sequelize[_0x6a53('0x1')]},'email':{'type':Sequelize[_0x6a53('0x1')],'validate':{'isEmail':!![]},'set':function(_0x326e53){this[_0x6a53('0x4')](_0x6a53('0x5'),typeof _0x326e53===_0x6a53('0x6')&&_0x326e53[_0x6a53('0x7')]()?_0x326e53[_0x6a53('0x7')]():null);}},'pager':{'type':Sequelize[_0x6a53('0x1')]},'tz':{'type':Sequelize[_0x6a53('0x1')],'defaultValue':_0x6a53('0x8')},'attach':{'type':Sequelize[_0x6a53('0x9')](_0x6a53('0xa'),'no'),'defaultValue':_0x6a53('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x6a53('0x9')](_0x6a53('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x6a53('0x1')]},'review':{'type':Sequelize[_0x6a53('0x9')](_0x6a53('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x6a53('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x6a53('0x9')](_0x6a53('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x6a53('0x9')](_0x6a53('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x6a53('0x9')](_0x6a53('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x6a53('0x9')]('yes','no'),'defaultValue':_0x6a53('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x6a53('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x6a53('0x9')](_0x6a53('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x6a53('0x9')](_0x6a53('0xa'),'no'),'defaultValue':_0x6a53('0xa'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x6a53('0x1')]},'emailbody':{'type':Sequelize[_0x6a53('0x1')]},'maxsecs':{'type':Sequelize[_0x6a53('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x6a53('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x6a53('0xc')],'get':function(){return this['getDataValue'](_0x6a53('0xd'))+_0x6a53('0xe')+this[_0x6a53('0xf')](_0x6a53('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index c2228ae..ed07f76 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 _0xae60=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','VoiceMail','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','order','pick','mailbox','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0xf8886b,_0x504891){var _0x321bd5=function(_0x3c116b){while(--_0x3c116b){_0xf8886b['push'](_0xf8886b['shift']());}};_0x321bd5(++_0x504891);}(_0xae60,0x1c7));var _0x0ae6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xae60[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0ae6('0x0'));var rimraf=require(_0x0ae6('0x1'));var zipdir=require(_0x0ae6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae6('0x3'));var moment=require(_0x0ae6('0x4'));var BPromise=require(_0x0ae6('0x5'));var Mustache=require('mustache');var util=require(_0x0ae6('0x6'));var path=require(_0x0ae6('0x7'));var sox=require('sox');var csv=require(_0x0ae6('0x8'));var ejs=require(_0x0ae6('0x9'));var fs=require('fs');var fs_extra=require(_0x0ae6('0xa'));var _=require(_0x0ae6('0xb'));var squel=require(_0x0ae6('0xc'));var crypto=require(_0x0ae6('0xd'));var jsforce=require(_0x0ae6('0xe'));var deskjs=require(_0x0ae6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ae6('0x10'));var Papa=require(_0x0ae6('0x11'));var Redis=require(_0x0ae6('0x12'));var authService=require(_0x0ae6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0ae6('0x14'));var hardwareService=require(_0x0ae6('0x15'));var logger=require(_0x0ae6('0x16'))(_0x0ae6('0x17'));var utils=require(_0x0ae6('0x18'));var config=require(_0x0ae6('0x19'));var licenseUtil=require(_0x0ae6('0x1a'));var db=require(_0x0ae6('0x1b'))['db'];function respondWithStatusCode(_0x3b05a4,_0x30f8f9){_0x30f8f9=_0x30f8f9||0xcc;return function(_0x1aefd5){if(_0x1aefd5){return _0x3b05a4[_0x0ae6('0x1c')](_0x30f8f9);}return _0x3b05a4[_0x0ae6('0x1d')](_0x30f8f9)[_0x0ae6('0x1e')]();};}function respondWithResult(_0x4d2da8,_0x3809c6){_0x3809c6=_0x3809c6||0xc8;return function(_0x10c3bc){if(_0x10c3bc){return _0x4d2da8[_0x0ae6('0x1d')](_0x3809c6)[_0x0ae6('0x1f')](_0x10c3bc);}};}function respondWithFilteredResult(_0xce3e23,_0x3a1e26){return function(_0x151144){if(_0x151144){var _0x3b64ac=typeof _0x3a1e26[_0x0ae6('0x20')]===_0x0ae6('0x21')&&typeof _0x3a1e26[_0x0ae6('0x22')]===_0x0ae6('0x21');var _0xa97151=_0x151144[_0x0ae6('0x23')];var _0xda4f01=_0x3b64ac?0x0:_0x3a1e26[_0x0ae6('0x20')];var _0x2fdf25=_0x3b64ac?_0x151144[_0x0ae6('0x23')]:_0x3a1e26[_0x0ae6('0x20')]+_0x3a1e26[_0x0ae6('0x22')];var _0x26b369;if(_0x2fdf25>=_0xa97151){_0x2fdf25=_0xa97151;_0x26b369=0xc8;}else{_0x26b369=0xce;}_0xce3e23[_0x0ae6('0x1d')](_0x26b369);return _0xce3e23['set'](_0x0ae6('0x24'),_0xda4f01+'-'+_0x2fdf25+'/'+_0xa97151)[_0x0ae6('0x1f')](_0x151144);}return null;};}function patchUpdates(_0x140a3b){return function(_0x1027c2){try{jsonpatch[_0x0ae6('0x25')](_0x1027c2,_0x140a3b,!![]);}catch(_0xb4e6af){return BPromise[_0x0ae6('0x26')](_0xb4e6af);}return _0x1027c2[_0x0ae6('0x27')]();};}function saveUpdates(_0x515f3d,_0x39b22e){return function(_0x2a6484){if(_0x2a6484){return _0x2a6484[_0x0ae6('0x28')](_0x515f3d)[_0x0ae6('0x29')](function(_0x31ad85){return _0x31ad85;});}return null;};}function removeEntity(_0x4eba72,_0x296a9d){return function(_0x4e1242){if(_0x4e1242){return _0x4e1242[_0x0ae6('0x2a')]()[_0x0ae6('0x29')](function(){var _0x3c43d8=_0x4e1242[_0x0ae6('0x2b')]({'plain':!![]});var _0x5b86fe=_0x0ae6('0x2c');return db[_0x0ae6('0x2d')]['destroy']({'where':{'type':_0x5b86fe,'resourceId':_0x3c43d8['id']}})['then'](function(){return _0x4e1242;});})[_0x0ae6('0x29')](function(){_0x4eba72[_0x0ae6('0x1d')](0xcc)[_0x0ae6('0x1e')]();});}};}function handleEntityNotFound(_0x4fe77b,_0x3b5f8f){return function(_0xb68cbe){if(!_0xb68cbe){_0x4fe77b[_0x0ae6('0x1c')](0x194);}return _0xb68cbe;};}function handleError(_0x4df796,_0x2428b2){_0x2428b2=_0x2428b2||0x1f4;return function(_0x29fef3){logger[_0x0ae6('0x2e')](_0x29fef3[_0x0ae6('0x2f')]);if(_0x29fef3[_0x0ae6('0x30')]){delete _0x29fef3[_0x0ae6('0x30')];}_0x4df796['status'](_0x2428b2)['send'](_0x29fef3);};}exports[_0x0ae6('0x31')]=function(_0x419384,_0x4e6df8){var _0x4a06f1={},_0x1ca059={},_0x278577={'count':0x0,'rows':[]};var _0x714c6d=_[_0x0ae6('0x32')](db['VoiceMail'][_0x0ae6('0x33')],function(_0x429f06){return{'name':_0x429f06[_0x0ae6('0x34')],'type':_0x429f06['type'][_0x0ae6('0x35')]};});_0x1ca059[_0x0ae6('0x36')]=_[_0x0ae6('0x32')](_0x714c6d,_0x0ae6('0x30'));_0x1ca059[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x419384[_0x0ae6('0x37')]);_0x1ca059[_0x0ae6('0x39')]=_[_0x0ae6('0x3a')](_0x1ca059[_0x0ae6('0x36')],_0x1ca059['query']);_0x4a06f1[_0x0ae6('0x3b')]=_[_0x0ae6('0x3a')](_0x1ca059['model'],qs[_0x0ae6('0x3c')](_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x4a06f1['attributes']=_0x4a06f1[_0x0ae6('0x3b')]['length']?_0x4a06f1['attributes']:_0x1ca059[_0x0ae6('0x36')];if(!_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3d')](_0x0ae6('0x3e'))){_0x4a06f1[_0x0ae6('0x22')]=qs['limit'](_0x419384['query'][_0x0ae6('0x22')]);_0x4a06f1['offset']=qs[_0x0ae6('0x20')](_0x419384['query'][_0x0ae6('0x20')]);}_0x4a06f1['order']=qs[_0x0ae6('0x3f')](_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3f')]);_0x4a06f1[_0x0ae6('0x40')]=qs['filters'](_['pick'](_0x419384[_0x0ae6('0x37')],_0x1ca059[_0x0ae6('0x39')]),_0x714c6d);if(_0x419384[_0x0ae6('0x37')]['filter']){_0x4a06f1[_0x0ae6('0x40')]=_['merge'](_0x4a06f1[_0x0ae6('0x40')],{'$or':_[_0x0ae6('0x32')](_0x714c6d,function(_0x460e3f){if(_0x460e3f[_0x0ae6('0x41')]!==_0x0ae6('0x42')){var _0x1f8258={};_0x1f8258[_0x460e3f['name']]={'$like':'%'+_0x419384[_0x0ae6('0x37')][_0x0ae6('0x43')]+'%'};return _0x1f8258;}})});}_0x4a06f1=_[_0x0ae6('0x44')]({},_0x4a06f1,_0x419384[_0x0ae6('0x45')]);var _0x1ad562={'where':_0x4a06f1[_0x0ae6('0x40')]};return db[_0x0ae6('0x46')][_0x0ae6('0x23')](_0x1ad562)['then'](function(_0x38faeb){_0x278577[_0x0ae6('0x23')]=_0x38faeb;if(_0x419384[_0x0ae6('0x37')][_0x0ae6('0x47')]){_0x4a06f1[_0x0ae6('0x48')]=[{'all':!![]}];}return db[_0x0ae6('0x46')][_0x0ae6('0x49')](_0x4a06f1);})[_0x0ae6('0x29')](function(_0xb38cbb){_0x278577[_0x0ae6('0x4a')]=_0xb38cbb;return _0x278577;})[_0x0ae6('0x29')](respondWithFilteredResult(_0x4e6df8,_0x4a06f1))[_0x0ae6('0x4b')](handleError(_0x4e6df8,null));};exports[_0x0ae6('0x4c')]=function(_0x85d9ce,_0x201e95){var _0x16d225={'raw':!![],'where':{'id':_0x85d9ce[_0x0ae6('0x4d')]['id']}},_0x4235de={};_0x4235de['model']=_[_0x0ae6('0x38')](db[_0x0ae6('0x46')][_0x0ae6('0x33')]);_0x4235de[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x85d9ce[_0x0ae6('0x37')]);_0x4235de['filters']=_[_0x0ae6('0x3a')](_0x4235de[_0x0ae6('0x36')],_0x4235de[_0x0ae6('0x37')]);_0x16d225[_0x0ae6('0x3b')]=_['intersection'](_0x4235de['model'],qs['fields'](_0x85d9ce[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x16d225[_0x0ae6('0x3b')]=_0x16d225['attributes'][_0x0ae6('0x4e')]?_0x16d225[_0x0ae6('0x3b')]:_0x4235de['model'];if(_0x85d9ce[_0x0ae6('0x37')][_0x0ae6('0x47')]){_0x16d225['include']=[{'all':!![]}];}_0x16d225=_[_0x0ae6('0x44')]({},_0x16d225,_0x85d9ce[_0x0ae6('0x45')]);return db['VoiceMail'][_0x0ae6('0x4f')](_0x16d225)[_0x0ae6('0x29')](handleEntityNotFound(_0x201e95,null))[_0x0ae6('0x29')](respondWithResult(_0x201e95,null))['catch'](handleError(_0x201e95,null));};exports[_0x0ae6('0x50')]=function(_0x21de54,_0x46075a){return db[_0x0ae6('0x46')][_0x0ae6('0x50')](_0x21de54[_0x0ae6('0x51')],{})[_0x0ae6('0x29')](function(_0x5ababa){var _0x5afd3b=_0x21de54[_0x0ae6('0x52')][_0x0ae6('0x2b')]({'plain':!![]});if(!_0x5afd3b)throw new Error(_0x0ae6('0x53'));if(_0x5afd3b['role']===_0x0ae6('0x52')){var _0x51df5c=_0x5ababa['get']({'plain':!![]});var _0x23454a=_0x0ae6('0x2c');return db[_0x0ae6('0x54')]['find']({'where':{'name':_0x23454a,'userProfileId':_0x5afd3b[_0x0ae6('0x55')]},'raw':!![]})[_0x0ae6('0x29')](function(_0x31a4db){if(_0x31a4db&&_0x31a4db[_0x0ae6('0x56')]===0x0){return db[_0x0ae6('0x2d')][_0x0ae6('0x50')]({'name':_0x51df5c[_0x0ae6('0x30')],'resourceId':_0x51df5c['id'],'type':_0x31a4db[_0x0ae6('0x30')],'sectionId':_0x31a4db['id']},{})[_0x0ae6('0x29')](function(){return _0x5ababa;});}else{return _0x5ababa;}})[_0x0ae6('0x4b')](function(_0x1cc515){logger[_0x0ae6('0x2e')](_0x0ae6('0x57'),_0x1cc515);throw _0x1cc515;});}return _0x5ababa;})[_0x0ae6('0x29')](respondWithResult(_0x46075a,0xc9))[_0x0ae6('0x4b')](handleError(_0x46075a,null));};exports['update']=function(_0x4cbe19,_0x30a9f1){if(_0x4cbe19[_0x0ae6('0x51')]['id']){delete _0x4cbe19[_0x0ae6('0x51')]['id'];}return db[_0x0ae6('0x46')][_0x0ae6('0x4f')]({'where':{'id':_0x4cbe19[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x30a9f1,null))[_0x0ae6('0x29')](saveUpdates(_0x4cbe19[_0x0ae6('0x51')],null))[_0x0ae6('0x29')](respondWithResult(_0x30a9f1,null))[_0x0ae6('0x4b')](handleError(_0x30a9f1,null));};exports[_0x0ae6('0x2a')]=function(_0x16a311,_0x2babcc){return db[_0x0ae6('0x46')][_0x0ae6('0x4f')]({'where':{'id':_0x16a311[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x2babcc,null))['then'](removeEntity(_0x2babcc,null))[_0x0ae6('0x4b')](handleError(_0x2babcc,null));};exports[_0x0ae6('0x58')]=function(_0x15191e,_0x578125,_0x2648de){return db[_0x0ae6('0x46')][_0x0ae6('0x59')]({'where':{'id':_0x15191e[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x578125,null))[_0x0ae6('0x29')](function(_0x5ec716){var _0x456d2a;var _0x2132d6={},_0x1c53bf={};_0x1c53bf[_0x0ae6('0x36')]=_[_0x0ae6('0x38')](db[_0x0ae6('0x5a')][_0x0ae6('0x33')]);_0x1c53bf[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x15191e['query']);_0x1c53bf['filters']=_[_0x0ae6('0x3a')](_0x1c53bf[_0x0ae6('0x36')],_0x1c53bf['query']);_0x2132d6['attributes']=_[_0x0ae6('0x3a')](_0x1c53bf[_0x0ae6('0x36')],qs[_0x0ae6('0x3c')](_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x2132d6[_0x0ae6('0x3b')]=_0x2132d6[_0x0ae6('0x3b')]['length']?_0x2132d6[_0x0ae6('0x3b')]:_0x1c53bf['model'];if(!_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x3d')]('nolimit')){_0x2132d6[_0x0ae6('0x22')]=qs[_0x0ae6('0x22')](_0x15191e[_0x0ae6('0x37')]['limit']);_0x2132d6[_0x0ae6('0x20')]=qs['offset'](_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x20')]);}_0x2132d6[_0x0ae6('0x5b')]=qs[_0x0ae6('0x3f')](_0x15191e['query']['sort']);_0x2132d6[_0x0ae6('0x40')]=qs[_0x0ae6('0x39')](_[_0x0ae6('0x5c')](_0x15191e[_0x0ae6('0x37')],_0x1c53bf[_0x0ae6('0x39')]));if(_0x15191e[_0x0ae6('0x37')]['filter']){_0x2132d6['where']=_[_0x0ae6('0x44')](_0x2132d6[_0x0ae6('0x40')],{'$or':_[_0x0ae6('0x32')](_0x2132d6[_0x0ae6('0x3b')],function(_0x2bafcc){var _0x15f38f={};_0x15f38f[_0x2bafcc]={'$like':'%'+_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x43')]+'%'};return _0x15f38f;})});}_0x2132d6['where']=_[_0x0ae6('0x44')](_0x2132d6[_0x0ae6('0x40')],{'mailboxuser':_0x5ec716[_0x0ae6('0x5d')]});_0x2132d6=_[_0x0ae6('0x44')]({},_0x2132d6,_0x15191e[_0x0ae6('0x45')]);return db[_0x0ae6('0x5a')]['findAndCountAll'](_0x2132d6)['then'](respondWithFilteredResult(_0x578125,_0x2132d6));})[_0x0ae6('0x4b')](handleError(_0x578125,null));}; \ No newline at end of file +var _0xf4eb=['fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','Voicemails','UserProfileResource','error','stack','name','send','index','map','VoiceMail','fieldName','key','model','keys','filters','intersection','attributes','fields','query','length','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','rows','catch','show','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','getMessages','VoiceMailMessage','hasOwnProperty','nolimit','mailbox','eml-format','moment','util','path','sox','to-csv','ejs'];(function(_0x1259c4,_0x14cb41){var _0x27eba2=function(_0x3b3ba6){while(--_0x3b3ba6){_0x1259c4['push'](_0x1259c4['shift']());}};_0x27eba2(++_0x14cb41);}(_0xf4eb,0xec));var _0xbf4e=function(_0x8229e5,_0x4e9ddb){_0x8229e5=_0x8229e5-0x0;var _0x3eddfe=_0xf4eb[_0x8229e5];return _0x3eddfe;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){var _0x3a5d72=_0x30994d['get']({'plain':!![]});var _0x90635e=_0xbf4e('0x21');return db[_0xbf4e('0x22')]['destroy']({'where':{'type':_0x90635e,'resourceId':_0x3a5d72['id']}})[_0xbf4e('0x1f')](function(){return _0x30994d;});})['then'](function(){_0x51648c['status'](0xcc)[_0xbf4e('0x15')]();});}};}function handleEntityNotFound(_0x5a0a9b,_0x38c923){return function(_0x315df3){if(!_0x315df3){_0x5a0a9b[_0xbf4e('0x13')](0x194);}return _0x315df3;};}function handleError(_0x41f918,_0x5c912f){_0x5c912f=_0x5c912f||0x1f4;return function(_0x2d4686){logger[_0xbf4e('0x23')](_0x2d4686[_0xbf4e('0x24')]);if(_0x2d4686['name']){delete _0x2d4686[_0xbf4e('0x25')];}_0x41f918['status'](_0x5c912f)[_0xbf4e('0x26')](_0x2d4686);};}exports[_0xbf4e('0x27')]=function(_0xb8b58e,_0x498dbd){var _0x1d12e2={},_0x362716={},_0x2f3cf8={'count':0x0,'rows':[]};var _0xc7ca87=_[_0xbf4e('0x28')](db[_0xbf4e('0x29')]['rawAttributes'],function(_0x35c82d){return{'name':_0x35c82d[_0xbf4e('0x2a')],'type':_0x35c82d['type'][_0xbf4e('0x2b')]};});_0x362716[_0xbf4e('0x2c')]=_['map'](_0xc7ca87,_0xbf4e('0x25'));_0x362716['query']=_[_0xbf4e('0x2d')](_0xb8b58e['query']);_0x362716[_0xbf4e('0x2e')]=_[_0xbf4e('0x2f')](_0x362716[_0xbf4e('0x2c')],_0x362716['query']);_0x1d12e2[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x362716[_0xbf4e('0x2c')],qs[_0xbf4e('0x31')](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x1d12e2['attributes']=_0x1d12e2[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x1d12e2[_0xbf4e('0x30')]:_0x362716[_0xbf4e('0x2c')];if(!_0xb8b58e[_0xbf4e('0x32')]['hasOwnProperty']('nolimit')){_0x1d12e2['limit']=qs['limit'](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x18')]);_0x1d12e2[_0xbf4e('0x16')]=qs[_0xbf4e('0x16')](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x16')]);}_0x1d12e2[_0xbf4e('0x34')]=qs[_0xbf4e('0x35')](_0xb8b58e[_0xbf4e('0x32')]['sort']);_0x1d12e2['where']=qs[_0xbf4e('0x2e')](_[_0xbf4e('0x36')](_0xb8b58e[_0xbf4e('0x32')],_0x362716['filters']),_0xc7ca87);if(_0xb8b58e[_0xbf4e('0x32')]['filter']){_0x1d12e2[_0xbf4e('0x37')]=_[_0xbf4e('0x38')](_0x1d12e2[_0xbf4e('0x37')],{'$or':_[_0xbf4e('0x28')](_0xc7ca87,function(_0x5ce339){if(_0x5ce339[_0xbf4e('0x39')]!==_0xbf4e('0x3a')){var _0x3aa308={};_0x3aa308[_0x5ce339[_0xbf4e('0x25')]]={'$like':'%'+_0xb8b58e['query'][_0xbf4e('0x3b')]+'%'};return _0x3aa308;}})});}_0x1d12e2=_[_0xbf4e('0x38')]({},_0x1d12e2,_0xb8b58e[_0xbf4e('0x3c')]);var _0x29fe9d={'where':_0x1d12e2[_0xbf4e('0x37')]};return db[_0xbf4e('0x29')][_0xbf4e('0x19')](_0x29fe9d)['then'](function(_0x176166){_0x2f3cf8[_0xbf4e('0x19')]=_0x176166;if(_0xb8b58e['query']['includeAll']){_0x1d12e2[_0xbf4e('0x3d')]=[{'all':!![]}];}return db[_0xbf4e('0x29')]['findAll'](_0x1d12e2);})['then'](function(_0x2b1bf4){_0x2f3cf8[_0xbf4e('0x3e')]=_0x2b1bf4;return _0x2f3cf8;})[_0xbf4e('0x1f')](respondWithFilteredResult(_0x498dbd,_0x1d12e2))[_0xbf4e('0x3f')](handleError(_0x498dbd,null));};exports[_0xbf4e('0x40')]=function(_0x3ad0a4,_0x5a03c6){var _0x3ecc15={'raw':!![],'where':{'id':_0x3ad0a4['params']['id']}},_0x7bd91={};_0x7bd91['model']=_['keys'](db['VoiceMail'][_0xbf4e('0x41')]);_0x7bd91['query']=_[_0xbf4e('0x2d')](_0x3ad0a4[_0xbf4e('0x32')]);_0x7bd91['filters']=_['intersection'](_0x7bd91[_0xbf4e('0x2c')],_0x7bd91[_0xbf4e('0x32')]);_0x3ecc15[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x7bd91[_0xbf4e('0x2c')],qs['fields'](_0x3ad0a4[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x3ecc15[_0xbf4e('0x30')]=_0x3ecc15[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x3ecc15[_0xbf4e('0x30')]:_0x7bd91[_0xbf4e('0x2c')];if(_0x3ad0a4[_0xbf4e('0x32')]['includeAll']){_0x3ecc15[_0xbf4e('0x3d')]=[{'all':!![]}];}_0x3ecc15=_[_0xbf4e('0x38')]({},_0x3ecc15,_0x3ad0a4[_0xbf4e('0x3c')]);return db[_0xbf4e('0x29')][_0xbf4e('0x42')](_0x3ecc15)[_0xbf4e('0x1f')](handleEntityNotFound(_0x5a03c6,null))[_0xbf4e('0x1f')](respondWithResult(_0x5a03c6,null))[_0xbf4e('0x3f')](handleError(_0x5a03c6,null));};exports[_0xbf4e('0x43')]=function(_0x3447ab,_0x2fdba9){return db[_0xbf4e('0x29')][_0xbf4e('0x43')](_0x3447ab[_0xbf4e('0x44')],{})[_0xbf4e('0x1f')](function(_0x2892ce){var _0x10bc23=_0x3447ab['user'][_0xbf4e('0x45')]({'plain':!![]});if(!_0x10bc23)throw new Error(_0xbf4e('0x46'));if(_0x10bc23[_0xbf4e('0x47')]==='user'){var _0x33ab9a=_0x2892ce['get']({'plain':!![]});var _0x4a050e=_0xbf4e('0x21');return db[_0xbf4e('0x48')]['find']({'where':{'name':_0x4a050e,'userProfileId':_0x10bc23[_0xbf4e('0x49')]},'raw':!![]})[_0xbf4e('0x1f')](function(_0x31d779){if(_0x31d779&&_0x31d779[_0xbf4e('0x4a')]===0x0){return db[_0xbf4e('0x22')][_0xbf4e('0x43')]({'name':_0x33ab9a[_0xbf4e('0x25')],'resourceId':_0x33ab9a['id'],'type':_0x31d779[_0xbf4e('0x25')],'sectionId':_0x31d779['id']},{})[_0xbf4e('0x1f')](function(){return _0x2892ce;});}else{return _0x2892ce;}})[_0xbf4e('0x3f')](function(_0x271ad2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x271ad2);throw _0x271ad2;});}return _0x2892ce;})[_0xbf4e('0x1f')](respondWithResult(_0x2fdba9,0xc9))[_0xbf4e('0x3f')](handleError(_0x2fdba9,null));};exports[_0xbf4e('0x4b')]=function(_0x586f5d,_0x339ce6){if(_0x586f5d[_0xbf4e('0x44')]['id']){delete _0x586f5d['body']['id'];}return db['VoiceMail'][_0xbf4e('0x42')]({'where':{'id':_0x586f5d['params']['id']}})['then'](handleEntityNotFound(_0x339ce6,null))[_0xbf4e('0x1f')](saveUpdates(_0x586f5d[_0xbf4e('0x44')],null))[_0xbf4e('0x1f')](respondWithResult(_0x339ce6,null))[_0xbf4e('0x3f')](handleError(_0x339ce6,null));};exports[_0xbf4e('0x20')]=function(_0x5ec2d9,_0x242a75){return db['VoiceMail'][_0xbf4e('0x42')]({'where':{'id':_0x5ec2d9['params']['id']}})[_0xbf4e('0x1f')](handleEntityNotFound(_0x242a75,null))['then'](removeEntity(_0x242a75,null))[_0xbf4e('0x3f')](handleError(_0x242a75,null));};exports[_0xbf4e('0x4c')]=function(_0x3e60e7,_0x16592f,_0xfd54c){return db['VoiceMail']['findOne']({'where':{'id':_0x3e60e7['params']['id']}})['then'](handleEntityNotFound(_0x16592f,null))[_0xbf4e('0x1f')](function(_0x453411){var _0x5cfc26;var _0x200096={},_0x23c335={};_0x23c335[_0xbf4e('0x2c')]=_[_0xbf4e('0x2d')](db[_0xbf4e('0x4d')][_0xbf4e('0x41')]);_0x23c335[_0xbf4e('0x32')]=_['keys'](_0x3e60e7[_0xbf4e('0x32')]);_0x23c335[_0xbf4e('0x2e')]=_[_0xbf4e('0x2f')](_0x23c335['model'],_0x23c335['query']);_0x200096[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x23c335[_0xbf4e('0x2c')],qs['fields'](_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x200096[_0xbf4e('0x30')]=_0x200096[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x200096[_0xbf4e('0x30')]:_0x23c335[_0xbf4e('0x2c')];if(!_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x4e')](_0xbf4e('0x4f'))){_0x200096[_0xbf4e('0x18')]=qs[_0xbf4e('0x18')](_0x3e60e7['query'][_0xbf4e('0x18')]);_0x200096['offset']=qs[_0xbf4e('0x16')](_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x16')]);}_0x200096[_0xbf4e('0x34')]=qs[_0xbf4e('0x35')](_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x35')]);_0x200096[_0xbf4e('0x37')]=qs['filters'](_[_0xbf4e('0x36')](_0x3e60e7[_0xbf4e('0x32')],_0x23c335[_0xbf4e('0x2e')]));if(_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x3b')]){_0x200096['where']=_[_0xbf4e('0x38')](_0x200096[_0xbf4e('0x37')],{'$or':_[_0xbf4e('0x28')](_0x200096[_0xbf4e('0x30')],function(_0x12f19f){var _0x2c606b={};_0x2c606b[_0x12f19f]={'$like':'%'+_0x3e60e7['query'][_0xbf4e('0x3b')]+'%'};return _0x2c606b;})});}_0x200096['where']=_[_0xbf4e('0x38')](_0x200096[_0xbf4e('0x37')],{'mailboxuser':_0x453411[_0xbf4e('0x50')]});_0x200096=_[_0xbf4e('0x38')]({},_0x200096,_0x3e60e7['options']);return db[_0xbf4e('0x4d')]['findAndCountAll'](_0x200096)['then'](respondWithFilteredResult(_0x16592f,_0x200096));})[_0xbf4e('0x3f')](handleError(_0x16592f,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 041b803..53c2100 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 _0x4693=['./voiceMail.attributes','define','voice_voicemail','mailbox_context','context','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1b857f,_0x286e31){var _0x5582e9=function(_0x643a90){while(--_0x643a90){_0x1b857f['push'](_0x1b857f['shift']());}};_0x5582e9(++_0x286e31);}(_0x4693,0x16d));var _0x3469=function(_0x3af634,_0x288cf2){_0x3af634=_0x3af634-0x0;var _0x15bf41=_0x4693[_0x3af634];return _0x15bf41;};'use strict';var _=require('lodash');var util=require(_0x3469('0x0'));var logger=require(_0x3469('0x1'))('api');var moment=require(_0x3469('0x2'));var BPromise=require(_0x3469('0x3'));var rp=require(_0x3469('0x4'));var fs=require('fs');var path=require(_0x3469('0x5'));var rimraf=require(_0x3469('0x6'));var config=require('../../config/environment');var attributes=require(_0x3469('0x7'));module['exports']=function(_0x1429dd,_0x5f2a06){return _0x1429dd[_0x3469('0x8')]('VoiceMail',attributes,{'tableName':_0x3469('0x9'),'paranoid':![],'indexes':[{'name':_0x3469('0xa'),'fields':['mailbox',_0x3469('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaa47=['moment','bluebird','request-promise','path','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','util'];(function(_0x96a2cb,_0x51f751){var _0x4bccfa=function(_0x175691){while(--_0x175691){_0x96a2cb['push'](_0x96a2cb['shift']());}};_0x4bccfa(++_0x51f751);}(_0xaa47,0x12b));var _0x7aa4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xaa47[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x7aa4('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7aa4('0x1'));var BPromise=require(_0x7aa4('0x2'));var rp=require(_0x7aa4('0x3'));var fs=require('fs');var path=require(_0x7aa4('0x4'));var rimraf=require('rimraf');var config=require(_0x7aa4('0x5'));var attributes=require(_0x7aa4('0x6'));module[_0x7aa4('0x7')]=function(_0x1d4e4e,_0xbde8bd){return _0x1d4e4e['define'](_0x7aa4('0x8'),attributes,{'tableName':_0x7aa4('0x9'),'paranoid':![],'indexes':[{'name':_0x7aa4('0xa'),'fields':[_0x7aa4('0xb'),'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 e91c60f..d9f70a2 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 _0xf6f3=['http','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0xf6f3,0x114));var _0x3f6f=function(_0x223552,_0x27dcaf){_0x223552=_0x223552-0x0;var _0x5117c3=_0xf6f3[_0x223552];return _0x5117c3;};'use strict';var _=require('lodash');var util=require(_0x3f6f('0x0'));var moment=require(_0x3f6f('0x1'));var BPromise=require(_0x3f6f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f6f('0x3'));var db=require(_0x3f6f('0x4'))['db'];var utils=require(_0x3f6f('0x5'));var logger=require(_0x3f6f('0x6'))(_0x3f6f('0x7'));var config=require('../../config/environment');var jayson=require(_0x3f6f('0x8'));var client=jayson[_0x3f6f('0x9')][_0x3f6f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18387b,_0x16afbc,_0x2a2cf1){return new BPromise(function(_0x1c497d,_0x3f983c){return client['request'](_0x18387b,_0x2a2cf1)['then'](function(_0xd73d6a){logger[_0x3f6f('0xb')]('VoiceMail,\x20%s,\x20%s',_0x16afbc,_0x3f6f('0xc'));logger[_0x3f6f('0xd')](_0x3f6f('0xe'),_0x16afbc,_0x3f6f('0xc'),JSON[_0x3f6f('0xf')](_0xd73d6a));if(_0xd73d6a[_0x3f6f('0x10')]){if(_0xd73d6a[_0x3f6f('0x10')][_0x3f6f('0x11')]===0x1f4){logger['error'](_0x3f6f('0x12'),_0x16afbc,_0xd73d6a['error'][_0x3f6f('0x13')]);return _0x3f983c(_0xd73d6a[_0x3f6f('0x10')]['message']);}logger['error'](_0x3f6f('0x12'),_0x16afbc,_0xd73d6a[_0x3f6f('0x10')][_0x3f6f('0x13')]);return _0x1c497d(_0xd73d6a[_0x3f6f('0x10')][_0x3f6f('0x13')]);}else{logger[_0x3f6f('0xb')](_0x3f6f('0x12'),_0x16afbc,_0x3f6f('0xc'));_0x1c497d(_0xd73d6a[_0x3f6f('0x14')][_0x3f6f('0x13')]);}})[_0x3f6f('0x15')](function(_0x1e3079){logger['error'](_0x3f6f('0x12'),_0x16afbc,_0x1e3079);_0x3f983c(_0x1e3079);});});} \ No newline at end of file +var _0x1da9=['then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1da9,0x164));var _0x91da=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1da9[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x91da('0x0'));var util=require(_0x91da('0x1'));var moment=require(_0x91da('0x2'));var BPromise=require('bluebird');var rs=require(_0x91da('0x3'));var fs=require('fs');var Redis=require(_0x91da('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91da('0x5'));var logger=require('../../config/logger')(_0x91da('0x6'));var config=require(_0x91da('0x7'));var jayson=require(_0x91da('0x8'));var client=jayson[_0x91da('0x9')][_0x91da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xba35b1,_0x1f30ac,_0x59ff7d){return new BPromise(function(_0x5359da,_0x51789c){return client[_0x91da('0xb')](_0xba35b1,_0x59ff7d)[_0x91da('0xc')](function(_0x2885e5){logger[_0x91da('0xd')](_0x91da('0xe'),_0x1f30ac,'request\x20sent');logger[_0x91da('0xf')](_0x91da('0x10'),_0x1f30ac,_0x91da('0x11'),JSON[_0x91da('0x12')](_0x2885e5));if(_0x2885e5[_0x91da('0x13')]){if(_0x2885e5['error']['code']===0x1f4){logger[_0x91da('0x13')]('VoiceMail,\x20%s,\x20%s',_0x1f30ac,_0x2885e5['error'][_0x91da('0x14')]);return _0x51789c(_0x2885e5['error'][_0x91da('0x14')]);}logger[_0x91da('0x13')](_0x91da('0xe'),_0x1f30ac,_0x2885e5[_0x91da('0x13')][_0x91da('0x14')]);return _0x5359da(_0x2885e5[_0x91da('0x13')][_0x91da('0x14')]);}else{logger[_0x91da('0xd')](_0x91da('0xe'),_0x1f30ac,_0x91da('0x11'));_0x5359da(_0x2885e5[_0x91da('0x15')][_0x91da('0x14')]);}})[_0x91da('0x16')](function(_0x2241e4){logger['error'](_0x91da('0xe'),_0x1f30ac,_0x2241e4);_0x51789c(_0x2241e4);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 267a8d4..1ebb447 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 _0x380a=['isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','./voiceMailMessage.controller','get'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x380a,0xfd));var _0xa380=function(_0x31bfee,_0x5e7b65){_0x31bfee=_0x31bfee-0x0;var _0x4fe58e=_0x380a[_0x31bfee];return _0x4fe58e;};'use strict';var multer=require('multer');var util=require(_0xa380('0x0'));var path=require(_0xa380('0x1'));var timeout=require(_0xa380('0x2'));var express=require(_0xa380('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa380('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa380('0x5'));router[_0xa380('0x6')]('/',auth[_0xa380('0x7')](),controller[_0xa380('0x8')]);router[_0xa380('0x6')]('/:id',auth[_0xa380('0x7')](),controller[_0xa380('0x9')]);router[_0xa380('0x6')](_0xa380('0xa'),auth[_0xa380('0x7')](),controller[_0xa380('0xb')]);router[_0xa380('0xc')]('/',auth[_0xa380('0x7')](),controller[_0xa380('0xd')]);router[_0xa380('0xe')](_0xa380('0xf'),auth['isAuthenticated'](),controller[_0xa380('0x10')]);router[_0xa380('0x11')]('/:id',auth[_0xa380('0x7')](),controller[_0xa380('0x12')]);module[_0xa380('0x13')]=router; \ No newline at end of file +var _0x3497=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','get','/:id','show','/:id/download','post','put','update'];(function(_0x8fc9dd,_0x1c5712){var _0x2fae6b=function(_0x4d13bc){while(--_0x4d13bc){_0x8fc9dd['push'](_0x8fc9dd['shift']());}};_0x2fae6b(++_0x1c5712);}(_0x3497,0xc0));var _0x7349=function(_0x456200,_0x3d4c03){_0x456200=_0x456200-0x0;var _0x551f2e=_0x3497[_0x456200];return _0x551f2e;};'use strict';var multer=require(_0x7349('0x0'));var util=require(_0x7349('0x1'));var path=require(_0x7349('0x2'));var timeout=require(_0x7349('0x3'));var express=require('express');var router=express[_0x7349('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7349('0x5'));var interaction=require(_0x7349('0x6'));var config=require(_0x7349('0x7'));var controller=require(_0x7349('0x8'));router['get']('/',auth[_0x7349('0x9')](),controller['index']);router[_0x7349('0xa')](_0x7349('0xb'),auth[_0x7349('0x9')](),controller[_0x7349('0xc')]);router[_0x7349('0xa')](_0x7349('0xd'),auth[_0x7349('0x9')](),controller['download']);router[_0x7349('0xe')]('/',auth[_0x7349('0x9')](),controller['create']);router[_0x7349('0xf')](_0x7349('0xb'),auth['isAuthenticated'](),controller[_0x7349('0x10')]);router['delete'](_0x7349('0xb'),auth['isAuthenticated'](),controller[_0x7349('0x11')]);module[_0x7349('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 2ec8f1b..c25ee50 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 _0x3a15=['exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a15,0x1af));var _0x53a1=function(_0x46e523,_0xe6fccb){_0x46e523=_0x46e523-0x0;var _0x5da0ee=_0x3a15[_0x46e523];return _0x5da0ee;};'use strict';var Sequelize=require(_0x53a1('0x0'));module[_0x53a1('0x1')]={'name':{'type':Sequelize[_0x53a1('0x2')],'get':function(_0xe3cfa9){return this[_0x53a1('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x53a1('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x53a1('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x53a1('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x53a1('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x53a1('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x53a1('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x53a1('0x6')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x53a1('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x53a1('0x5')],'defaultValue':''},'stamp':{'type':_0x53a1('0x7'),'defaultValue':Sequelize['literal'](_0x53a1('0x8'))}}; \ No newline at end of file +var _0x083b=['sequelize','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x083b,0x9a));var _0xb083=function(_0x5ad190,_0xd39c9e){_0x5ad190=_0x5ad190-0x0;var _0x518ed3=_0x083b[_0x5ad190];return _0x518ed3;};'use strict';var Sequelize=require(_0xb083('0x0'));module['exports']={'name':{'type':Sequelize[_0xb083('0x1')],'get':function(_0x2f62f8){return this[_0xb083('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xb083('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb083('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xb083('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xb083('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb083('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb083('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xb083('0x5')](_0xb083('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb083('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 16fbc26..72e71e4 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 _0xbf23=['send','map','fieldName','model','differenceBy','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','VoiceMailMessage','include','findAll','show','keys','includeAll','find','create','body','update','params','catch','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','set','json','reject','save','then','destroy','error','stack','name'];(function(_0x143526,_0x14de3b){var _0x5c93ca=function(_0x3f8dcf){while(--_0x3f8dcf){_0x143526['push'](_0x143526['shift']());}};_0x5c93ca(++_0x14de3b);}(_0xbf23,0x164));var _0x3bf2=function(_0x37e7a4,_0xb7a496){_0x37e7a4=_0x37e7a4-0x0;var _0x269b2a=_0xbf23[_0x37e7a4];return _0x269b2a;};'use strict';var emlformat=require(_0x3bf2('0x0'));var rimraf=require(_0x3bf2('0x1'));var zipdir=require(_0x3bf2('0x2'));var jsonpatch=require(_0x3bf2('0x3'));var rp=require(_0x3bf2('0x4'));var moment=require('moment');var BPromise=require(_0x3bf2('0x5'));var Mustache=require(_0x3bf2('0x6'));var util=require(_0x3bf2('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3bf2('0x8'));var fs=require('fs');var fs_extra=require(_0x3bf2('0x9'));var _=require('lodash');var squel=require(_0x3bf2('0xa'));var crypto=require('crypto');var jsforce=require(_0x3bf2('0xb'));var deskjs=require(_0x3bf2('0xc'));var toCsv=require(_0x3bf2('0xd'));var querystring=require(_0x3bf2('0xe'));var Papa=require(_0x3bf2('0xf'));var Redis=require('ioredis');var authService=require(_0x3bf2('0x10'));var qs=require(_0x3bf2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3bf2('0x12'));var logger=require(_0x3bf2('0x13'))(_0x3bf2('0x14'));var utils=require(_0x3bf2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3bf2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a1232,_0x50b7d3){_0x50b7d3=_0x50b7d3||0xcc;return function(_0x2f4a1c){if(_0x2f4a1c){return _0x3a1232[_0x3bf2('0x17')](_0x50b7d3);}return _0x3a1232['status'](_0x50b7d3)[_0x3bf2('0x18')]();};}function respondWithResult(_0x48df05,_0x4d00bf){_0x4d00bf=_0x4d00bf||0xc8;return function(_0x1f41ad){if(_0x1f41ad){return _0x48df05[_0x3bf2('0x19')](_0x4d00bf)['json'](_0x1f41ad);}};}function respondWithFilteredResult(_0x55ce1a,_0x49c79c){return function(_0x4d07ae){if(_0x4d07ae){var _0x1959d9=typeof _0x49c79c[_0x3bf2('0x1a')]===_0x3bf2('0x1b')&&typeof _0x49c79c['limit']===_0x3bf2('0x1b');var _0x23541d=_0x4d07ae['count'];var _0x9c61bd=_0x1959d9?0x0:_0x49c79c[_0x3bf2('0x1a')];var _0x55d6c3=_0x1959d9?_0x4d07ae[_0x3bf2('0x1c')]:_0x49c79c['offset']+_0x49c79c[_0x3bf2('0x1d')];var _0x2a2295;if(_0x55d6c3>=_0x23541d){_0x55d6c3=_0x23541d;_0x2a2295=0xc8;}else{_0x2a2295=0xce;}_0x55ce1a[_0x3bf2('0x19')](_0x2a2295);return _0x55ce1a[_0x3bf2('0x1e')]('Content-Range',_0x9c61bd+'-'+_0x55d6c3+'/'+_0x23541d)[_0x3bf2('0x1f')](_0x4d07ae);}return null;};}function patchUpdates(_0x2ccd95){return function(_0x15a732){try{jsonpatch['apply'](_0x15a732,_0x2ccd95,!![]);}catch(_0x1b89c2){return BPromise[_0x3bf2('0x20')](_0x1b89c2);}return _0x15a732[_0x3bf2('0x21')]();};}function saveUpdates(_0x481dd5,_0x21482b){return function(_0x1c2e59){if(_0x1c2e59){return _0x1c2e59['update'](_0x481dd5)[_0x3bf2('0x22')](function(_0x14737b){return _0x14737b;});}return null;};}function removeEntity(_0x4ec38d,_0xf6c702){return function(_0x2fd93c){if(_0x2fd93c){return _0x2fd93c[_0x3bf2('0x23')]()[_0x3bf2('0x22')](function(){_0x4ec38d[_0x3bf2('0x19')](0xcc)[_0x3bf2('0x18')]();});}};}function handleEntityNotFound(_0x2ae48d,_0x2fbd50){return function(_0x5d183f){if(!_0x5d183f){_0x2ae48d[_0x3bf2('0x17')](0x194);}return _0x5d183f;};}function handleError(_0x3480f3,_0x689b8){_0x689b8=_0x689b8||0x1f4;return function(_0x3de5db){logger[_0x3bf2('0x24')](_0x3de5db[_0x3bf2('0x25')]);if(_0x3de5db[_0x3bf2('0x26')]){delete _0x3de5db[_0x3bf2('0x26')];}_0x3480f3[_0x3bf2('0x19')](_0x689b8)[_0x3bf2('0x27')](_0x3de5db);};}exports['index']=function(_0x59d68c,_0x20126e){var _0x2f83e4={},_0x29b95f={},_0x34d3a2={'count':0x0,'rows':[]};var _0x46dad9=_[_0x3bf2('0x28')](db['VoiceMailMessage']['rawAttributes'],function(_0xca893e){return{'name':_0xca893e[_0x3bf2('0x29')],'type':_0xca893e['type']['key']};});_0x29b95f[_0x3bf2('0x2a')]=_[_0x3bf2('0x2b')](_['map'](_0x46dad9,_0x3bf2('0x26')),[_0x3bf2('0x26')]);_0x29b95f[_0x3bf2('0x2c')]=_['keys'](_0x59d68c['query']);_0x29b95f[_0x3bf2('0x2d')]=_[_0x3bf2('0x2e')](_0x29b95f[_0x3bf2('0x2a')],_0x29b95f['query']);_0x2f83e4['attributes']=_[_0x3bf2('0x2e')](_0x29b95f[_0x3bf2('0x2a')],qs[_0x3bf2('0x2f')](_0x59d68c['query'][_0x3bf2('0x2f')]));_0x2f83e4[_0x3bf2('0x30')]=_0x2f83e4[_0x3bf2('0x30')][_0x3bf2('0x31')]?_0x2f83e4[_0x3bf2('0x30')]:_0x29b95f[_0x3bf2('0x2a')];if(!_0x59d68c[_0x3bf2('0x2c')][_0x3bf2('0x32')]('nolimit')){_0x2f83e4[_0x3bf2('0x1d')]=qs['limit'](_0x59d68c['query'][_0x3bf2('0x1d')]);_0x2f83e4[_0x3bf2('0x1a')]=qs[_0x3bf2('0x1a')](_0x59d68c['query'][_0x3bf2('0x1a')]);}_0x2f83e4[_0x3bf2('0x33')]=qs[_0x3bf2('0x34')](_0x59d68c[_0x3bf2('0x2c')][_0x3bf2('0x34')]);_0x2f83e4[_0x3bf2('0x35')]=qs[_0x3bf2('0x2d')](_['pick'](_0x59d68c[_0x3bf2('0x2c')],_0x29b95f[_0x3bf2('0x2d')]),_0x46dad9);if(_0x59d68c['query']['filter']){_0x2f83e4['where']=_[_0x3bf2('0x36')](_0x2f83e4[_0x3bf2('0x35')],{'$or':_['map'](_0x46dad9,function(_0x5155a2){if(_0x5155a2[_0x3bf2('0x37')]!==_0x3bf2('0x38')){var _0x4fbf27={};_0x4fbf27[_0x5155a2[_0x3bf2('0x26')]]={'$like':'%'+_0x59d68c[_0x3bf2('0x2c')][_0x3bf2('0x39')]+'%'};return _0x4fbf27;}})});}_0x2f83e4=_[_0x3bf2('0x36')]({},_0x2f83e4,_0x59d68c[_0x3bf2('0x3a')]);var _0x7387f={'where':_0x2f83e4['where']};return db[_0x3bf2('0x3b')][_0x3bf2('0x1c')](_0x7387f)['then'](function(_0x2e1a61){_0x34d3a2['count']=_0x2e1a61;if(_0x59d68c[_0x3bf2('0x2c')]['includeAll']){_0x2f83e4[_0x3bf2('0x3c')]=[{'all':!![]}];}return db[_0x3bf2('0x3b')][_0x3bf2('0x3d')](_0x2f83e4);})[_0x3bf2('0x22')](function(_0x478385){_0x34d3a2['rows']=_0x478385;return _0x34d3a2;})[_0x3bf2('0x22')](respondWithFilteredResult(_0x20126e,_0x2f83e4))['catch'](handleError(_0x20126e,null));};exports[_0x3bf2('0x3e')]=function(_0x247b72,_0x5a6a40){var _0x4881c5={'raw':!![],'where':{'id':_0x247b72['params']['id']}},_0x2d9180={};_0x2d9180[_0x3bf2('0x2a')]=_[_0x3bf2('0x3f')](db['VoiceMailMessage']['rawAttributes']);_0x2d9180[_0x3bf2('0x2c')]=_[_0x3bf2('0x3f')](_0x247b72[_0x3bf2('0x2c')]);_0x2d9180[_0x3bf2('0x2d')]=_[_0x3bf2('0x2e')](_0x2d9180[_0x3bf2('0x2a')],_0x2d9180[_0x3bf2('0x2c')]);_0x4881c5[_0x3bf2('0x30')]=_[_0x3bf2('0x2e')](_0x2d9180[_0x3bf2('0x2a')],qs[_0x3bf2('0x2f')](_0x247b72['query']['fields']));_0x4881c5[_0x3bf2('0x30')]=_0x4881c5['attributes'][_0x3bf2('0x31')]?_0x4881c5['attributes']:_0x2d9180[_0x3bf2('0x2a')];if(_0x247b72[_0x3bf2('0x2c')][_0x3bf2('0x40')]){_0x4881c5[_0x3bf2('0x3c')]=[{'all':!![]}];}_0x4881c5=_['merge']({},_0x4881c5,_0x247b72[_0x3bf2('0x3a')]);return db[_0x3bf2('0x3b')][_0x3bf2('0x41')](_0x4881c5)[_0x3bf2('0x22')](handleEntityNotFound(_0x5a6a40,null))[_0x3bf2('0x22')](respondWithResult(_0x5a6a40,null))['catch'](handleError(_0x5a6a40,null));};exports['create']=function(_0x7d1240,_0x21daea){return db['VoiceMailMessage'][_0x3bf2('0x42')](_0x7d1240[_0x3bf2('0x43')],{})[_0x3bf2('0x22')](respondWithResult(_0x21daea,0xc9))['catch'](handleError(_0x21daea,null));};exports[_0x3bf2('0x44')]=function(_0x2b62e1,_0x9c32b3){if(_0x2b62e1[_0x3bf2('0x43')]['id']){delete _0x2b62e1['body']['id'];}return db[_0x3bf2('0x3b')][_0x3bf2('0x41')]({'where':{'id':_0x2b62e1[_0x3bf2('0x45')]['id']}})['then'](handleEntityNotFound(_0x9c32b3,null))[_0x3bf2('0x22')](saveUpdates(_0x2b62e1[_0x3bf2('0x43')],null))[_0x3bf2('0x22')](respondWithResult(_0x9c32b3,null))[_0x3bf2('0x46')](handleError(_0x9c32b3,null));};exports[_0x3bf2('0x23')]=function(_0x222430,_0x2d02e3){return db[_0x3bf2('0x3b')][_0x3bf2('0x41')]({'where':{'id':_0x222430[_0x3bf2('0x45')]['id']}})[_0x3bf2('0x22')](handleEntityNotFound(_0x2d02e3,null))['then'](removeEntity(_0x2d02e3,null))[_0x3bf2('0x46')](handleError(_0x2d02e3,null));};exports['download']=function(_0x4de370,_0x1ede0d,_0x2a0ccb){return db['VoiceMailMessage'][_0x3bf2('0x41')]({'where':{'id':_0x4de370[_0x3bf2('0x45')]['id']},'attributes':['id',_0x3bf2('0x47'),_0x3bf2('0x48')]})['then'](handleEntityNotFound(_0x1ede0d,null))[_0x3bf2('0x22')](function(_0x527ec1){if(_0x527ec1){if(!_0x527ec1['recording']){throw new db[(_0x3bf2('0x49'))][(_0x3bf2('0x4a'))](_0x3bf2('0x4b'));}var _0x51e044={'Content-Type':_0x3bf2('0x4c'),'Content-Disposition':_0x3bf2('0x4d')};if(_0x527ec1['msg_id']){_0x51e044['Content-Disposition']='attachment;\x20filename=\x22'+_0x527ec1[_0x3bf2('0x48')]+_0x3bf2('0x4e');}_0x1ede0d[_0x3bf2('0x1e')](_0x51e044);return _0x1ede0d[_0x3bf2('0x27')](new Buffer(_0x527ec1['recording']));}})[_0x3bf2('0x46')](handleError(_0x1ede0d,null));}; \ No newline at end of file +var _0x034e=['bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','apply','reject','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','differenceBy','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','merge','where','filter','VoiceMailMessage','includeAll','include','findAll','catch','params','options','find','create','body','download','msg_id','recording','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x217d33,_0x39dc74){var _0x197f95=function(_0x2cd696){while(--_0x2cd696){_0x217d33['push'](_0x217d33['shift']());}};_0x197f95(++_0x39dc74);}(_0x034e,0xe7));var _0xe034=function(_0x1325ca,_0x21c3ab){_0x1325ca=_0x1325ca-0x0;var _0x40fde5=_0x034e[_0x1325ca];return _0x40fde5;};'use strict';var emlformat=require(_0xe034('0x0'));var rimraf=require(_0xe034('0x1'));var zipdir=require(_0xe034('0x2'));var jsonpatch=require(_0xe034('0x3'));var rp=require(_0xe034('0x4'));var moment=require(_0xe034('0x5'));var BPromise=require(_0xe034('0x6'));var Mustache=require(_0xe034('0x7'));var util=require(_0xe034('0x8'));var path=require(_0xe034('0x9'));var sox=require('sox');var csv=require(_0xe034('0xa'));var ejs=require(_0xe034('0xb'));var fs=require('fs');var fs_extra=require(_0xe034('0xc'));var _=require(_0xe034('0xd'));var squel=require(_0xe034('0xe'));var crypto=require('crypto');var jsforce=require(_0xe034('0xf'));var deskjs=require(_0xe034('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe034('0x11'));var qs=require(_0xe034('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe034('0x13'));var logger=require(_0xe034('0x14'))(_0xe034('0x15'));var utils=require(_0xe034('0x16'));var config=require(_0xe034('0x17'));var licenseUtil=require(_0xe034('0x18'));var db=require(_0xe034('0x19'))['db'];function respondWithStatusCode(_0x5e19e4,_0x1dd9da){_0x1dd9da=_0x1dd9da||0xcc;return function(_0xc2460b){if(_0xc2460b){return _0x5e19e4[_0xe034('0x1a')](_0x1dd9da);}return _0x5e19e4[_0xe034('0x1b')](_0x1dd9da)[_0xe034('0x1c')]();};}function respondWithResult(_0x300fd9,_0x14671f){_0x14671f=_0x14671f||0xc8;return function(_0x343c43){if(_0x343c43){return _0x300fd9[_0xe034('0x1b')](_0x14671f)[_0xe034('0x1d')](_0x343c43);}};}function respondWithFilteredResult(_0x12c86d,_0x12981e){return function(_0xfc211a){if(_0xfc211a){var _0x18f37c=typeof _0x12981e['offset']==='undefined'&&typeof _0x12981e[_0xe034('0x1e')]==='undefined';var _0x1a9091=_0xfc211a[_0xe034('0x1f')];var _0x121399=_0x18f37c?0x0:_0x12981e[_0xe034('0x20')];var _0x19c98c=_0x18f37c?_0xfc211a[_0xe034('0x1f')]:_0x12981e[_0xe034('0x20')]+_0x12981e[_0xe034('0x1e')];var _0x3c1526;if(_0x19c98c>=_0x1a9091){_0x19c98c=_0x1a9091;_0x3c1526=0xc8;}else{_0x3c1526=0xce;}_0x12c86d['status'](_0x3c1526);return _0x12c86d[_0xe034('0x21')]('Content-Range',_0x121399+'-'+_0x19c98c+'/'+_0x1a9091)[_0xe034('0x1d')](_0xfc211a);}return null;};}function patchUpdates(_0x53352c){return function(_0x521439){try{jsonpatch[_0xe034('0x22')](_0x521439,_0x53352c,!![]);}catch(_0x186b8b){return BPromise[_0xe034('0x23')](_0x186b8b);}return _0x521439['save']();};}function saveUpdates(_0x1210a5,_0x439949){return function(_0x26ec15){if(_0x26ec15){return _0x26ec15[_0xe034('0x24')](_0x1210a5)[_0xe034('0x25')](function(_0x4b8e36){return _0x4b8e36;});}return null;};}function removeEntity(_0x5de8e4,_0x3615d7){return function(_0xf4463f){if(_0xf4463f){return _0xf4463f[_0xe034('0x26')]()['then'](function(){_0x5de8e4[_0xe034('0x1b')](0xcc)[_0xe034('0x1c')]();});}};}function handleEntityNotFound(_0x196f09,_0x133eb5){return function(_0xfa793){if(!_0xfa793){_0x196f09[_0xe034('0x1a')](0x194);}return _0xfa793;};}function handleError(_0x37eee9,_0x44722){_0x44722=_0x44722||0x1f4;return function(_0x1f40fe){logger[_0xe034('0x27')](_0x1f40fe['stack']);if(_0x1f40fe[_0xe034('0x28')]){delete _0x1f40fe[_0xe034('0x28')];}_0x37eee9[_0xe034('0x1b')](_0x44722)[_0xe034('0x29')](_0x1f40fe);};}exports[_0xe034('0x2a')]=function(_0x1728d7,_0xf5ed38){var _0x38a8be={},_0x232714={},_0x162711={'count':0x0,'rows':[]};var _0x2ff10b=_[_0xe034('0x2b')](db['VoiceMailMessage'][_0xe034('0x2c')],function(_0x2fbbd7){return{'name':_0x2fbbd7['fieldName'],'type':_0x2fbbd7[_0xe034('0x2d')][_0xe034('0x2e')]};});_0x232714['model']=_[_0xe034('0x2f')](_[_0xe034('0x2b')](_0x2ff10b,'name'),[_0xe034('0x28')]);_0x232714[_0xe034('0x30')]=_[_0xe034('0x31')](_0x1728d7[_0xe034('0x30')]);_0x232714['filters']=_['intersection'](_0x232714[_0xe034('0x32')],_0x232714[_0xe034('0x30')]);_0x38a8be[_0xe034('0x33')]=_[_0xe034('0x34')](_0x232714['model'],qs[_0xe034('0x35')](_0x1728d7[_0xe034('0x30')][_0xe034('0x35')]));_0x38a8be[_0xe034('0x33')]=_0x38a8be[_0xe034('0x33')]['length']?_0x38a8be[_0xe034('0x33')]:_0x232714[_0xe034('0x32')];if(!_0x1728d7[_0xe034('0x30')][_0xe034('0x36')](_0xe034('0x37'))){_0x38a8be[_0xe034('0x1e')]=qs[_0xe034('0x1e')](_0x1728d7[_0xe034('0x30')][_0xe034('0x1e')]);_0x38a8be['offset']=qs[_0xe034('0x20')](_0x1728d7[_0xe034('0x30')]['offset']);}_0x38a8be[_0xe034('0x38')]=qs['sort'](_0x1728d7[_0xe034('0x30')][_0xe034('0x39')]);_0x38a8be['where']=qs[_0xe034('0x3a')](_['pick'](_0x1728d7[_0xe034('0x30')],_0x232714['filters']),_0x2ff10b);if(_0x1728d7[_0xe034('0x30')]['filter']){_0x38a8be['where']=_[_0xe034('0x3b')](_0x38a8be[_0xe034('0x3c')],{'$or':_['map'](_0x2ff10b,function(_0x15b5ec){if(_0x15b5ec[_0xe034('0x2d')]!=='VIRTUAL'){var _0x34ba51={};_0x34ba51[_0x15b5ec[_0xe034('0x28')]]={'$like':'%'+_0x1728d7[_0xe034('0x30')][_0xe034('0x3d')]+'%'};return _0x34ba51;}})});}_0x38a8be=_[_0xe034('0x3b')]({},_0x38a8be,_0x1728d7['options']);var _0x333193={'where':_0x38a8be[_0xe034('0x3c')]};return db[_0xe034('0x3e')]['count'](_0x333193)[_0xe034('0x25')](function(_0x4d3e8b){_0x162711[_0xe034('0x1f')]=_0x4d3e8b;if(_0x1728d7[_0xe034('0x30')][_0xe034('0x3f')]){_0x38a8be[_0xe034('0x40')]=[{'all':!![]}];}return db[_0xe034('0x3e')][_0xe034('0x41')](_0x38a8be);})[_0xe034('0x25')](function(_0x4cc4fa){_0x162711['rows']=_0x4cc4fa;return _0x162711;})['then'](respondWithFilteredResult(_0xf5ed38,_0x38a8be))[_0xe034('0x42')](handleError(_0xf5ed38,null));};exports['show']=function(_0x1adc21,_0x33e391){var _0x4200b7={'raw':!![],'where':{'id':_0x1adc21[_0xe034('0x43')]['id']}},_0x533da9={};_0x533da9[_0xe034('0x32')]=_[_0xe034('0x31')](db[_0xe034('0x3e')][_0xe034('0x2c')]);_0x533da9[_0xe034('0x30')]=_[_0xe034('0x31')](_0x1adc21[_0xe034('0x30')]);_0x533da9['filters']=_['intersection'](_0x533da9[_0xe034('0x32')],_0x533da9[_0xe034('0x30')]);_0x4200b7[_0xe034('0x33')]=_[_0xe034('0x34')](_0x533da9[_0xe034('0x32')],qs[_0xe034('0x35')](_0x1adc21[_0xe034('0x30')][_0xe034('0x35')]));_0x4200b7[_0xe034('0x33')]=_0x4200b7[_0xe034('0x33')]['length']?_0x4200b7[_0xe034('0x33')]:_0x533da9[_0xe034('0x32')];if(_0x1adc21[_0xe034('0x30')][_0xe034('0x3f')]){_0x4200b7[_0xe034('0x40')]=[{'all':!![]}];}_0x4200b7=_[_0xe034('0x3b')]({},_0x4200b7,_0x1adc21[_0xe034('0x44')]);return db['VoiceMailMessage'][_0xe034('0x45')](_0x4200b7)['then'](handleEntityNotFound(_0x33e391,null))[_0xe034('0x25')](respondWithResult(_0x33e391,null))[_0xe034('0x42')](handleError(_0x33e391,null));};exports[_0xe034('0x46')]=function(_0x4a1657,_0x54029d){return db[_0xe034('0x3e')][_0xe034('0x46')](_0x4a1657['body'],{})[_0xe034('0x25')](respondWithResult(_0x54029d,0xc9))[_0xe034('0x42')](handleError(_0x54029d,null));};exports[_0xe034('0x24')]=function(_0x2c042d,_0x449f01){if(_0x2c042d[_0xe034('0x47')]['id']){delete _0x2c042d['body']['id'];}return db[_0xe034('0x3e')]['find']({'where':{'id':_0x2c042d['params']['id']}})[_0xe034('0x25')](handleEntityNotFound(_0x449f01,null))['then'](saveUpdates(_0x2c042d[_0xe034('0x47')],null))[_0xe034('0x25')](respondWithResult(_0x449f01,null))[_0xe034('0x42')](handleError(_0x449f01,null));};exports[_0xe034('0x26')]=function(_0x440236,_0x13e3b8){return db['VoiceMailMessage'][_0xe034('0x45')]({'where':{'id':_0x440236['params']['id']}})[_0xe034('0x25')](handleEntityNotFound(_0x13e3b8,null))['then'](removeEntity(_0x13e3b8,null))[_0xe034('0x42')](handleError(_0x13e3b8,null));};exports[_0xe034('0x48')]=function(_0x31cd8a,_0x51949b,_0x49520c){return db[_0xe034('0x3e')][_0xe034('0x45')]({'where':{'id':_0x31cd8a[_0xe034('0x43')]['id']},'attributes':['id','recording',_0xe034('0x49')]})[_0xe034('0x25')](handleEntityNotFound(_0x51949b,null))[_0xe034('0x25')](function(_0x40266c){if(_0x40266c){if(!_0x40266c[_0xe034('0x4a')]){throw new db['Sequelize'][(_0xe034('0x4b'))](_0xe034('0x4c'));}var _0x54110a={'Content-Type':_0xe034('0x4d'),'Content-Disposition':'attachment'};if(_0x40266c[_0xe034('0x49')]){_0x54110a['Content-Disposition']='attachment;\x20filename=\x22'+_0x40266c['msg_id']+_0xe034('0x4e');}_0x51949b[_0xe034('0x21')](_0x54110a);return _0x51949b[_0xe034('0x29')](new Buffer(_0x40266c[_0xe034('0x4a')]));}})[_0xe034('0x42')](handleError(_0x51949b,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 5a23087..0ff2363 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 _0xc55b=['api','bluebird','path','rimraf','../../config/environment','exports','define','voice_voicemail_messages','dir','util','../../config/logger'];(function(_0x35af2d,_0x57df44){var _0xb742f1=function(_0xc1c096){while(--_0xc1c096){_0x35af2d['push'](_0x35af2d['shift']());}};_0xb742f1(++_0x57df44);}(_0xc55b,0xcf));var _0xbc55=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xc55b[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0xbc55('0x0'));var logger=require(_0xbc55('0x1'))(_0xbc55('0x2'));var moment=require('moment');var BPromise=require(_0xbc55('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc55('0x4'));var rimraf=require(_0xbc55('0x5'));var config=require(_0xbc55('0x6'));var attributes=require('./voiceMailMessage.attributes');module[_0xbc55('0x7')]=function(_0x587015,_0x57d4d2){return _0x587015[_0xbc55('0x8')]('VoiceMailMessage',attributes,{'tableName':_0xbc55('0x9'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xbc55('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x11b6=['../../config/environment','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x51951b,_0x5d1a16){var _0x17dc1a=function(_0x5d6ea9){while(--_0x5d6ea9){_0x51951b['push'](_0x51951b['shift']());}};_0x17dc1a(++_0x5d1a16);}(_0x11b6,0x8d));var _0x611b=function(_0x4d8942,_0x1aa5b1){_0x4d8942=_0x4d8942-0x0;var _0x374d29=_0x11b6[_0x4d8942];return _0x374d29;};'use strict';var _=require(_0x611b('0x0'));var util=require(_0x611b('0x1'));var logger=require(_0x611b('0x2'))(_0x611b('0x3'));var moment=require(_0x611b('0x4'));var BPromise=require(_0x611b('0x5'));var rp=require(_0x611b('0x6'));var fs=require('fs');var path=require(_0x611b('0x7'));var rimraf=require(_0x611b('0x8'));var config=require(_0x611b('0x9'));var attributes=require(_0x611b('0xa'));module[_0x611b('0xb')]=function(_0x24ef09,_0xd259a1){return _0x24ef09[_0x611b('0xc')]('VoiceMailMessage',attributes,{'tableName':_0x611b('0xd'),'paranoid':![],'indexes':[{'name':_0x611b('0xe'),'fields':[_0x611b('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index f0b04da..f16e809 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 _0x6dc9=['../../config/environment','jayson/promise','client','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x421526,_0x368eca){var _0xc44c07=function(_0x31b0cc){while(--_0x31b0cc){_0x421526['push'](_0x421526['shift']());}};_0xc44c07(++_0x368eca);}(_0x6dc9,0xf1));var _0x96dc=function(_0x2876c8,_0x560e0f){_0x2876c8=_0x2876c8-0x0;var _0x3972f0=_0x6dc9[_0x2876c8];return _0x3972f0;};'use strict';var _=require(_0x96dc('0x0'));var util=require(_0x96dc('0x1'));var moment=require(_0x96dc('0x2'));var BPromise=require(_0x96dc('0x3'));var rs=require(_0x96dc('0x4'));var fs=require('fs');var Redis=require(_0x96dc('0x5'));var db=require(_0x96dc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x96dc('0x7'))(_0x96dc('0x8'));var config=require(_0x96dc('0x9'));var jayson=require(_0x96dc('0xa'));var client=jayson[_0x96dc('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3154e8,_0x598823,_0x3e806b){return new BPromise(function(_0x286e40,_0x704f49){return client[_0x96dc('0xc')](_0x3154e8,_0x3e806b)[_0x96dc('0xd')](function(_0x8c410a){logger[_0x96dc('0xe')](_0x96dc('0xf'),_0x598823,_0x96dc('0x10'));logger[_0x96dc('0x11')](_0x96dc('0x12'),_0x598823,_0x96dc('0x10'),JSON[_0x96dc('0x13')](_0x8c410a));if(_0x8c410a[_0x96dc('0x14')]){if(_0x8c410a[_0x96dc('0x14')][_0x96dc('0x15')]===0x1f4){logger[_0x96dc('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x598823,_0x8c410a[_0x96dc('0x14')][_0x96dc('0x16')]);return _0x704f49(_0x8c410a[_0x96dc('0x14')][_0x96dc('0x16')]);}logger[_0x96dc('0x14')](_0x96dc('0xf'),_0x598823,_0x8c410a[_0x96dc('0x14')]['message']);return _0x286e40(_0x8c410a[_0x96dc('0x14')][_0x96dc('0x16')]);}else{logger['info'](_0x96dc('0xf'),_0x598823,_0x96dc('0x10'));_0x286e40(_0x8c410a[_0x96dc('0x17')][_0x96dc('0x16')]);}})[_0x96dc('0x18')](function(_0x357a9e){logger[_0x96dc('0x14')](_0x96dc('0xf'),_0x598823,_0x357a9e);_0x704f49(_0x357a9e);});});} \ No newline at end of file +var _0x3516=['request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x14f4f0,_0x6559ae){var _0x3b8cad=function(_0x3d19ba){while(--_0x3d19ba){_0x14f4f0['push'](_0x14f4f0['shift']());}};_0x3b8cad(++_0x6559ae);}(_0x3516,0xaf));var _0x6351=function(_0x121736,_0x11d49b){_0x121736=_0x121736-0x0;var _0x439395=_0x3516[_0x121736];return _0x439395;};'use strict';var _=require(_0x6351('0x0'));var util=require(_0x6351('0x1'));var moment=require(_0x6351('0x2'));var BPromise=require('bluebird');var rs=require(_0x6351('0x3'));var fs=require('fs');var Redis=require(_0x6351('0x4'));var db=require(_0x6351('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6351('0x6'))(_0x6351('0x7'));var config=require(_0x6351('0x8'));var jayson=require(_0x6351('0x9'));var client=jayson['client'][_0x6351('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7cea07,_0x2ef58d,_0xa55c8f){return new BPromise(function(_0x20a6db,_0x2d919e){return client['request'](_0x7cea07,_0xa55c8f)[_0x6351('0xb')](function(_0xf19a86){logger[_0x6351('0xc')](_0x6351('0xd'),_0x2ef58d,_0x6351('0xe'));logger[_0x6351('0xf')](_0x6351('0x10'),_0x2ef58d,_0x6351('0xe'),JSON['stringify'](_0xf19a86));if(_0xf19a86[_0x6351('0x11')]){if(_0xf19a86[_0x6351('0x11')][_0x6351('0x12')]===0x1f4){logger[_0x6351('0x11')](_0x6351('0xd'),_0x2ef58d,_0xf19a86[_0x6351('0x11')][_0x6351('0x13')]);return _0x2d919e(_0xf19a86[_0x6351('0x11')][_0x6351('0x13')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x2ef58d,_0xf19a86[_0x6351('0x11')][_0x6351('0x13')]);return _0x20a6db(_0xf19a86[_0x6351('0x11')][_0x6351('0x13')]);}else{logger[_0x6351('0xc')](_0x6351('0xd'),_0x2ef58d,_0x6351('0xe'));_0x20a6db(_0xf19a86['result'][_0x6351('0x13')]);}})[_0x6351('0x14')](function(_0xb1e8ab){logger[_0x6351('0x11')](_0x6351('0xd'),_0x2ef58d,_0xb1e8ab);_0x2d919e(_0xb1e8ab);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index aa2e60a..3ae76b6 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 _0x2c21=['./voiceMusicOnHold.controller','get','isAuthenticated','index','show','/:id/sounds','getSounds','post','create','put','/:id','update','delete','/:id/sounds/:id2','removeSound','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xfd3557,_0x31bd26){var _0x2eec7a=function(_0x233ffe){while(--_0x233ffe){_0xfd3557['push'](_0xfd3557['shift']());}};_0x2eec7a(++_0x31bd26);}(_0x2c21,0x18b));var _0x12c2=function(_0x46012c,_0x66bacf){_0x46012c=_0x46012c-0x0;var _0x26d30f=_0x2c21[_0x46012c];return _0x26d30f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x12c2('0x0'));var timeout=require('connect-timeout');var express=require(_0x12c2('0x1'));var router=express[_0x12c2('0x2')]();var fs_extra=require(_0x12c2('0x3'));var auth=require(_0x12c2('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x12c2('0x5'));router[_0x12c2('0x6')]('/',auth[_0x12c2('0x7')](),controller[_0x12c2('0x8')]);router[_0x12c2('0x6')]('/:id',auth[_0x12c2('0x7')](),controller[_0x12c2('0x9')]);router[_0x12c2('0x6')](_0x12c2('0xa'),auth[_0x12c2('0x7')](),controller[_0x12c2('0xb')]);router[_0x12c2('0xc')]('/',auth['isAuthenticated'](),controller[_0x12c2('0xd')]);router[_0x12c2('0xc')](_0x12c2('0xa'),auth[_0x12c2('0x7')](),controller['addSound']);router[_0x12c2('0xe')](_0x12c2('0xf'),auth['isAuthenticated'](),controller[_0x12c2('0x10')]);router[_0x12c2('0x11')](_0x12c2('0xf'),auth[_0x12c2('0x7')](),controller['destroy']);router[_0x12c2('0x11')](_0x12c2('0x12'),auth[_0x12c2('0x7')](),controller[_0x12c2('0x13')]);module['exports']=router; \ No newline at end of file +var _0xc249=['removeSound','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/sounds','getSounds','post','create','addSound','put','/:id','update','delete','destroy','/:id/sounds/:id2'];(function(_0x1e1c40,_0x33d5a0){var _0x266d00=function(_0x4b5860){while(--_0x4b5860){_0x1e1c40['push'](_0x1e1c40['shift']());}};_0x266d00(++_0x33d5a0);}(_0xc249,0x189));var _0x9c24=function(_0x453ccf,_0x4ed71d){_0x453ccf=_0x453ccf-0x0;var _0x1c6582=_0xc249[_0x453ccf];return _0x1c6582;};'use strict';var multer=require('multer');var util=require(_0x9c24('0x0'));var path=require(_0x9c24('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9c24('0x2'));var auth=require(_0x9c24('0x3'));var interaction=require(_0x9c24('0x4'));var config=require(_0x9c24('0x5'));var controller=require('./voiceMusicOnHold.controller');router[_0x9c24('0x6')]('/',auth['isAuthenticated'](),controller[_0x9c24('0x7')]);router[_0x9c24('0x6')]('/:id',auth[_0x9c24('0x8')](),controller[_0x9c24('0x9')]);router[_0x9c24('0x6')](_0x9c24('0xa'),auth['isAuthenticated'](),controller[_0x9c24('0xb')]);router[_0x9c24('0xc')]('/',auth[_0x9c24('0x8')](),controller[_0x9c24('0xd')]);router[_0x9c24('0xc')]('/:id/sounds',auth[_0x9c24('0x8')](),controller[_0x9c24('0xe')]);router[_0x9c24('0xf')](_0x9c24('0x10'),auth[_0x9c24('0x8')](),controller[_0x9c24('0x11')]);router[_0x9c24('0x12')](_0x9c24('0x10'),auth[_0x9c24('0x8')](),controller[_0x9c24('0x13')]);router[_0x9c24('0x12')](_0x9c24('0x14'),auth['isAuthenticated'](),controller[_0x9c24('0x15')]);module[_0x9c24('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 3c9aaba..554ada6 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 _0x3369=['custom','files','mp3nb','quietmp3nb','mp3','sequelize','exports','STRING','name'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0x3369,0x1c7));var _0x9336=function(_0x22093a,_0xa7acf1){_0x22093a=_0x22093a-0x0;var _0x2f4989=_0x3369[_0x22093a];return _0x2f4989;};'use strict';var Sequelize=require(_0x9336('0x0'));module[_0x9336('0x1')]={'name':{'type':Sequelize[_0x9336('0x2')],'allowNull':![],'unique':_0x9336('0x3')},'mode':{'type':Sequelize['ENUM'](_0x9336('0x4'),_0x9336('0x5'),_0x9336('0x6'),_0x9336('0x7'),'quietmp3',_0x9336('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x9336('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x9336('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x9336('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x9336('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x9336('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xba02=['files','mp3nb','quietmp3nb','mp3','BOOLEAN','STRING','name'];(function(_0x420a4d,_0x4d1a77){var _0x3018e3=function(_0x587fa2){while(--_0x587fa2){_0x420a4d['push'](_0x420a4d['shift']());}};_0x3018e3(++_0x4d1a77);}(_0xba02,0xc2));var _0x2ba0=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xba02[_0x5f3f88];return _0xd08119;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2ba0('0x0')],'allowNull':![],'unique':_0x2ba0('0x1')},'mode':{'type':Sequelize['ENUM']('custom',_0x2ba0('0x2'),_0x2ba0('0x3'),_0x2ba0('0x4'),'quietmp3',_0x2ba0('0x5')),'allowNull':!![],'defaultValue':_0x2ba0('0x2')},'directory':{'type':Sequelize[_0x2ba0('0x0')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x2ba0('0x0')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2ba0('0x0')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x2ba0('0x0')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x2ba0('0x6')],'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 2545d7c..baf644e 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 _0xb4df=['reject','save','update','then','get','MusicOnHolds','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','fields','find','body','create','sequelize','transaction','directory','join','root','server/files/moh','files','mkdirSync','0777','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','extname','symlinkSync','Sequelize','removeSound','id2','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','offset','count','set','json','apply'];(function(_0x19fb67,_0x7ec8d9){var _0x1cb8b1=function(_0x7729e4){while(--_0x7729e4){_0x19fb67['push'](_0x19fb67['shift']());}};_0x1cb8b1(++_0x7ec8d9);}(_0xb4df,0x133));var _0xfb4d=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xb4df[_0x376b45];return _0x2341b3;};'use strict';var emlformat=require(_0xfb4d('0x0'));var rimraf=require(_0xfb4d('0x1'));var zipdir=require(_0xfb4d('0x2'));var jsonpatch=require(_0xfb4d('0x3'));var rp=require(_0xfb4d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfb4d('0x5'));var util=require(_0xfb4d('0x6'));var path=require(_0xfb4d('0x7'));var sox=require(_0xfb4d('0x8'));var csv=require(_0xfb4d('0x9'));var ejs=require(_0xfb4d('0xa'));var fs=require('fs');var fs_extra=require(_0xfb4d('0xb'));var _=require(_0xfb4d('0xc'));var squel=require(_0xfb4d('0xd'));var crypto=require(_0xfb4d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xfb4d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfb4d('0x10'));var authService=require(_0xfb4d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfb4d('0x12'));var hardwareService=require(_0xfb4d('0x13'));var logger=require(_0xfb4d('0x14'))(_0xfb4d('0x15'));var utils=require(_0xfb4d('0x16'));var config=require(_0xfb4d('0x17'));var licenseUtil=require(_0xfb4d('0x18'));var db=require(_0xfb4d('0x19'))['db'];function respondWithStatusCode(_0x2804ff,_0x1663b8){_0x1663b8=_0x1663b8||0xcc;return function(_0x29a260){if(_0x29a260){return _0x2804ff[_0xfb4d('0x1a')](_0x1663b8);}return _0x2804ff[_0xfb4d('0x1b')](_0x1663b8)[_0xfb4d('0x1c')]();};}function respondWithResult(_0x34e34f,_0x3fd1a1){_0x3fd1a1=_0x3fd1a1||0xc8;return function(_0x406af4){if(_0x406af4){return _0x34e34f[_0xfb4d('0x1b')](_0x3fd1a1)['json'](_0x406af4);}};}function respondWithFilteredResult(_0x4ae7f2,_0x1fafe9){return function(_0x2bc2ad){if(_0x2bc2ad){var _0x1d3aa1=typeof _0x1fafe9['offset']===_0xfb4d('0x1d')&&typeof _0x1fafe9['limit']===_0xfb4d('0x1d');var _0x1422c1=_0x2bc2ad['count'];var _0x4ba59a=_0x1d3aa1?0x0:_0x1fafe9[_0xfb4d('0x1e')];var _0x4a705c=_0x1d3aa1?_0x2bc2ad[_0xfb4d('0x1f')]:_0x1fafe9[_0xfb4d('0x1e')]+_0x1fafe9['limit'];var _0x5e4025;if(_0x4a705c>=_0x1422c1){_0x4a705c=_0x1422c1;_0x5e4025=0xc8;}else{_0x5e4025=0xce;}_0x4ae7f2['status'](_0x5e4025);return _0x4ae7f2[_0xfb4d('0x20')]('Content-Range',_0x4ba59a+'-'+_0x4a705c+'/'+_0x1422c1)[_0xfb4d('0x21')](_0x2bc2ad);}return null;};}function patchUpdates(_0x312529){return function(_0xc46ba0){try{jsonpatch[_0xfb4d('0x22')](_0xc46ba0,_0x312529,!![]);}catch(_0x4daf56){return BPromise[_0xfb4d('0x23')](_0x4daf56);}return _0xc46ba0[_0xfb4d('0x24')]();};}function saveUpdates(_0x497b4f,_0x165706){return function(_0x49dda8){if(_0x49dda8){return _0x49dda8[_0xfb4d('0x25')](_0x497b4f)[_0xfb4d('0x26')](function(_0x394776){return _0x394776;});}return null;};}function removeEntity(_0x385587,_0x453230){return function(_0x2a9898){if(_0x2a9898){return _0x2a9898['destroy']()['then'](function(){var _0x450763=_0x2a9898[_0xfb4d('0x27')]({'plain':!![]});var _0x13b583=_0xfb4d('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x13b583,'resourceId':_0x450763['id']}})[_0xfb4d('0x26')](function(){return _0x2a9898;});})['then'](function(){_0x385587[_0xfb4d('0x1b')](0xcc)[_0xfb4d('0x1c')]();});}};}function handleEntityNotFound(_0x57c3aa,_0x5e90d4){return function(_0x30ae34){if(!_0x30ae34){_0x57c3aa['sendStatus'](0x194);}return _0x30ae34;};}function handleError(_0x1a9c4f,_0x1f92c4){_0x1f92c4=_0x1f92c4||0x1f4;return function(_0x53a86b){logger[_0xfb4d('0x29')](_0x53a86b[_0xfb4d('0x2a')]);if(_0x53a86b[_0xfb4d('0x2b')]){delete _0x53a86b[_0xfb4d('0x2b')];}_0x1a9c4f[_0xfb4d('0x1b')](_0x1f92c4)[_0xfb4d('0x2c')](_0x53a86b);};}exports[_0xfb4d('0x2d')]=function(_0x3b906c,_0x312e74){var _0x2f00b6={},_0x59e398={},_0x8ed7cc={'count':0x0,'rows':[]};var _0x458220=_[_0xfb4d('0x2e')](db[_0xfb4d('0x2f')][_0xfb4d('0x30')],function(_0x4952f8){return{'name':_0x4952f8['fieldName'],'type':_0x4952f8[_0xfb4d('0x31')]['key']};});_0x59e398[_0xfb4d('0x32')]=_[_0xfb4d('0x2e')](_0x458220,'name');_0x59e398[_0xfb4d('0x33')]=_[_0xfb4d('0x34')](_0x3b906c['query']);_0x59e398[_0xfb4d('0x35')]=_[_0xfb4d('0x36')](_0x59e398['model'],_0x59e398[_0xfb4d('0x33')]);_0x2f00b6[_0xfb4d('0x37')]=_[_0xfb4d('0x36')](_0x59e398[_0xfb4d('0x32')],qs['fields'](_0x3b906c[_0xfb4d('0x33')]['fields']));_0x2f00b6['attributes']=_0x2f00b6['attributes'][_0xfb4d('0x38')]?_0x2f00b6[_0xfb4d('0x37')]:_0x59e398[_0xfb4d('0x32')];if(!_0x3b906c['query'][_0xfb4d('0x39')](_0xfb4d('0x3a'))){_0x2f00b6['limit']=qs[_0xfb4d('0x3b')](_0x3b906c[_0xfb4d('0x33')][_0xfb4d('0x3b')]);_0x2f00b6[_0xfb4d('0x1e')]=qs[_0xfb4d('0x1e')](_0x3b906c[_0xfb4d('0x33')]['offset']);}_0x2f00b6[_0xfb4d('0x3c')]=qs[_0xfb4d('0x3d')](_0x3b906c[_0xfb4d('0x33')][_0xfb4d('0x3d')]);delete _0x3b906c[_0xfb4d('0x33')]['sort'];_0x2f00b6[_0xfb4d('0x3e')]=qs[_0xfb4d('0x35')](_[_0xfb4d('0x3f')](_0x3b906c[_0xfb4d('0x33')],_0x59e398[_0xfb4d('0x35')]),_0x458220);if(_0x3b906c[_0xfb4d('0x33')][_0xfb4d('0x40')]){_0x2f00b6['where']=_[_0xfb4d('0x41')](_0x2f00b6[_0xfb4d('0x3e')],{'$or':_[_0xfb4d('0x2e')](_0x458220,function(_0x3ff4d8){if(_0x3ff4d8[_0xfb4d('0x31')]!=='VIRTUAL'){var _0x10632f={};_0x10632f[_0x3ff4d8[_0xfb4d('0x2b')]]={'$like':'%'+_0x3b906c['query'][_0xfb4d('0x40')]+'%'};return _0x10632f;}})});}_0x2f00b6=_['merge']({},_0x2f00b6,_0x3b906c[_0xfb4d('0x42')]);var _0x38c211={'where':_0x2f00b6[_0xfb4d('0x3e')]};return db['VoiceMusicOnHold']['count'](_0x38c211)['then'](function(_0x500e52){_0x8ed7cc['count']=_0x500e52;if(_0x3b906c[_0xfb4d('0x33')][_0xfb4d('0x43')]){_0x2f00b6[_0xfb4d('0x44')]=[{'all':!![]}];}return db[_0xfb4d('0x2f')][_0xfb4d('0x45')](_0x2f00b6);})[_0xfb4d('0x26')](function(_0x58165a){_0x8ed7cc[_0xfb4d('0x46')]=_0x58165a;return _0x8ed7cc;})['then'](respondWithFilteredResult(_0x312e74,_0x2f00b6))[_0xfb4d('0x47')](handleError(_0x312e74,null));};exports['show']=function(_0x385021,_0xa7c9bc){var _0x38c24e={'raw':![],'where':{'id':_0x385021[_0xfb4d('0x48')]['id']}},_0x4c9e1d={};_0x4c9e1d[_0xfb4d('0x32')]=_[_0xfb4d('0x34')](db[_0xfb4d('0x2f')][_0xfb4d('0x30')]);_0x4c9e1d['query']=_['keys'](_0x385021['query']);_0x4c9e1d['filters']=_[_0xfb4d('0x36')](_0x4c9e1d['model'],_0x4c9e1d[_0xfb4d('0x33')]);_0x38c24e[_0xfb4d('0x37')]=_[_0xfb4d('0x36')](_0x4c9e1d[_0xfb4d('0x32')],qs[_0xfb4d('0x49')](_0x385021[_0xfb4d('0x33')][_0xfb4d('0x49')]));_0x38c24e[_0xfb4d('0x37')]=_0x38c24e['attributes'][_0xfb4d('0x38')]?_0x38c24e['attributes']:_0x4c9e1d[_0xfb4d('0x32')];if(_0x385021[_0xfb4d('0x33')][_0xfb4d('0x43')]){_0x38c24e[_0xfb4d('0x44')]=[{'all':!![]}];}_0x38c24e=_[_0xfb4d('0x41')]({},_0x38c24e,_0x385021['options']);return db['VoiceMusicOnHold'][_0xfb4d('0x4a')](_0x38c24e)[_0xfb4d('0x26')](handleEntityNotFound(_0xa7c9bc,null))['then'](respondWithResult(_0xa7c9bc,null))[_0xfb4d('0x47')](handleError(_0xa7c9bc,null));};exports['update']=function(_0x4d7f95,_0x4ab765){if(_0x4d7f95[_0xfb4d('0x4b')]['id']){delete _0x4d7f95[_0xfb4d('0x4b')]['id'];}return db[_0xfb4d('0x2f')][_0xfb4d('0x4a')]({'where':{'id':_0x4d7f95['params']['id']}})[_0xfb4d('0x26')](handleEntityNotFound(_0x4ab765,null))[_0xfb4d('0x26')](saveUpdates(_0x4d7f95['body'],null))['then'](respondWithResult(_0x4ab765,null))['catch'](handleError(_0x4ab765,null));};exports[_0xfb4d('0x4c')]=function(_0x2a692f,_0x376f11,_0x527c4b){return db[_0xfb4d('0x4d')][_0xfb4d('0x4e')](function(_0x523f77){if(_0x2a692f[_0xfb4d('0x4b')]['mode']==='files'){_0x2a692f['body'][_0xfb4d('0x4f')]=path[_0xfb4d('0x50')](config[_0xfb4d('0x51')],_0xfb4d('0x52'),_0x2a692f[_0xfb4d('0x4b')]['name']);}return db['VoiceMusicOnHold']['create'](_0x2a692f[_0xfb4d('0x4b')],{'transaction':_0x523f77})[_0xfb4d('0x26')](function(_0x519fb2){if(_0x2a692f[_0xfb4d('0x4b')]['mode']===_0xfb4d('0x53')){fs[_0xfb4d('0x54')](_0x519fb2['directory'],parseInt(_0xfb4d('0x55'),0x8));}var _0x184ef9=_0x2a692f[_0xfb4d('0x56')][_0xfb4d('0x27')]({'plain':!![]});if(!_0x184ef9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x184ef9[_0xfb4d('0x57')]===_0xfb4d('0x56')){var _0x48656a=_0x519fb2[_0xfb4d('0x27')]({'plain':!![]});return db['UserProfileSection'][_0xfb4d('0x4a')]({'where':{'name':'MusicOnHolds','userProfileId':_0x184ef9[_0xfb4d('0x58')]},'raw':!![]})[_0xfb4d('0x26')](function(_0x2c545d){if(_0x2c545d&&_0x2c545d[_0xfb4d('0x59')]===0x0){return db[_0xfb4d('0x5a')]['create']({'name':_0x48656a[_0xfb4d('0x2b')],'resourceId':_0x48656a['id'],'type':_0x2c545d[_0xfb4d('0x2b')],'sectionId':_0x2c545d['id']},{})[_0xfb4d('0x26')](function(){return _0x519fb2;});}else{return _0x519fb2;}})[_0xfb4d('0x47')](function(_0x4a5b41){logger[_0xfb4d('0x29')](_0xfb4d('0x5b'),_0x4a5b41);});}return _0x519fb2;});})[_0xfb4d('0x26')](respondWithResult(_0x376f11,0xc9))[_0xfb4d('0x47')](handleError(_0x376f11,null));};exports[_0xfb4d('0x5c')]=function(_0x22a42d,_0x56ccc8,_0x2c2029){var _0x4d32d5;return db[_0xfb4d('0x2f')]['find']({'where':{'id':_0x22a42d[_0xfb4d('0x48')]['id']}})[_0xfb4d('0x26')](function(_0x15acba){if(_0x15acba){return db[_0xfb4d('0x4d')][_0xfb4d('0x4e')](function(_0x38a274){return _0x15acba['destroy']({'transaction':_0x38a274,'raw':!![]})[_0xfb4d('0x26')](function(_0x243b3f){if(_0x243b3f[_0xfb4d('0x4f')]){fs[_0xfb4d('0x5d')](_0x243b3f[_0xfb4d('0x4f')])[_0xfb4d('0x5e')](function(_0x13291e){fs[_0xfb4d('0x5f')](path[_0xfb4d('0x50')](_0x243b3f[_0xfb4d('0x4f')],_0x13291e));});fs[_0xfb4d('0x60')](_0x243b3f[_0xfb4d('0x4f')]);}return _0x243b3f;});})[_0xfb4d('0x47')](function(_0x2a6903){throw new db['Sequelize'][(_0xfb4d('0x61'))](_0x2a6903[_0xfb4d('0x62')]);});}})[_0xfb4d('0x26')](handleEntityNotFound(_0x56ccc8,null))[_0xfb4d('0x26')](removeEntity(_0x56ccc8,null))['catch'](handleError(_0x56ccc8,null));};exports[_0xfb4d('0x63')]=function(_0x37b246,_0x15838a,_0xb09dff){return db[_0xfb4d('0x4d')][_0xfb4d('0x4e')](function(_0xd6fb85){var _0x27eacb;return db[_0xfb4d('0x2f')][_0xfb4d('0x4a')]({'where':{'id':_0x37b246[_0xfb4d('0x48')]['id']}})['then'](function(_0x108660){if(_0x108660){_0x27eacb=_0x108660;return _0x108660[_0xfb4d('0x63')](_0x37b246['body']['id'],{'transaction':_0xd6fb85});}})['then'](function(_0x25ad44){if(_0x25ad44){return db[_0xfb4d('0x64')][_0xfb4d('0x65')]({'where':{'id':_0x37b246[_0xfb4d('0x4b')]['id']},'attributes':['id',_0xfb4d('0x2b'),_0xfb4d('0x66'),_0xfb4d('0x67'),_0xfb4d('0x68')],'raw':!![]});}})[_0xfb4d('0x26')](function(_0x332e54){if(_0x332e54){var _0x24aca9=path[_0xfb4d('0x50')](config[_0xfb4d('0x51')],_0xfb4d('0x69'),util[_0xfb4d('0x6a')](_0xfb4d('0x6b'),path['basename'](_0x332e54[_0xfb4d('0x66')],path[_0xfb4d('0x6c')](_0x332e54[_0xfb4d('0x66')])),_0x332e54[_0xfb4d('0x67')]));var _0x4edba0=path[_0xfb4d('0x50')](config[_0xfb4d('0x51')],'server/files/moh',_0x27eacb[_0xfb4d('0x2b')],util[_0xfb4d('0x6a')](_0xfb4d('0x6b'),_0x332e54[_0xfb4d('0x2b')],_0x332e54[_0xfb4d('0x67')]));fs[_0xfb4d('0x6d')](_0x24aca9,_0x4edba0);return _0x332e54;}})[_0xfb4d('0x47')](function(_0xc6e296){throw new db[(_0xfb4d('0x6e'))][(_0xfb4d('0x61'))](_0xc6e296['message']);});})[_0xfb4d('0x26')](handleEntityNotFound(_0x15838a,null))['then'](respondWithResult(_0x15838a,0xc9))[_0xfb4d('0x47')](handleError(_0x15838a,null));};exports['removeSound']=function(_0xf01c5e,_0x1f19bc,_0x5af97e){return db['sequelize'][_0xfb4d('0x4e')](function(_0x1546c3){var _0x28d10d;return db[_0xfb4d('0x2f')][_0xfb4d('0x65')]({'where':{'id':_0xf01c5e[_0xfb4d('0x48')]['id']}})[_0xfb4d('0x26')](handleEntityNotFound(_0x1f19bc,null))[_0xfb4d('0x26')](function(_0x2675ee){if(_0x2675ee){_0x28d10d=_0x2675ee;return _0x2675ee[_0xfb4d('0x6f')](_0xf01c5e[_0xfb4d('0x48')]['id2']);}})[_0xfb4d('0x26')](function(_0x522334){if(_0x522334){return db['Sound'][_0xfb4d('0x65')]({'where':{'id':_0xf01c5e['params'][_0xfb4d('0x70')]},'attributes':['id',_0xfb4d('0x2b'),_0xfb4d('0x66'),_0xfb4d('0x67'),_0xfb4d('0x68')],'raw':!![]});}})[_0xfb4d('0x26')](function(_0x423a82){if(_0x423a82){fs['unlinkSync'](path['join'](_0x28d10d['directory'],util[_0xfb4d('0x6a')](_0xfb4d('0x6b'),_0x423a82[_0xfb4d('0x2b')],_0x423a82['converted_format'])));return _0x423a82;}})['catch'](function(_0x350471){throw new db[(_0xfb4d('0x6e'))]['ValidationError'](_0x350471[_0xfb4d('0x62')]);});})['then'](handleEntityNotFound(_0x1f19bc,null))[_0xfb4d('0x26')](respondWithStatusCode(_0x1f19bc,0xcc))[_0xfb4d('0x47')](handleError(_0x1f19bc,null));};exports[_0xfb4d('0x71')]=function(_0x4be6ef,_0x2d6ae0,_0x174319){var _0x54ad2b={};var _0x3822e5={};var _0x3b3907;var _0x5de49f;return db[_0xfb4d('0x2f')][_0xfb4d('0x65')]({'where':{'id':_0x4be6ef[_0xfb4d('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d6ae0,null))[_0xfb4d('0x26')](function(_0x2d50fa){if(_0x2d50fa){_0x3b3907=_0x2d50fa;_0x3822e5[_0xfb4d('0x32')]=_['keys'](db[_0xfb4d('0x64')][_0xfb4d('0x30')]);_0x3822e5[_0xfb4d('0x33')]=_[_0xfb4d('0x34')](_0x4be6ef['query']);_0x3822e5[_0xfb4d('0x35')]=_['intersection'](_0x3822e5[_0xfb4d('0x32')],_0x3822e5[_0xfb4d('0x33')]);_0x54ad2b[_0xfb4d('0x37')]=_[_0xfb4d('0x36')](_0x3822e5['model'],qs['fields'](_0x4be6ef[_0xfb4d('0x33')][_0xfb4d('0x49')]));_0x54ad2b[_0xfb4d('0x37')]=_0x54ad2b[_0xfb4d('0x37')]['length']?_0x54ad2b[_0xfb4d('0x37')]:_0x3822e5[_0xfb4d('0x32')];_0x54ad2b[_0xfb4d('0x3c')]=qs[_0xfb4d('0x3d')](_0x4be6ef[_0xfb4d('0x33')]['sort']);_0x54ad2b[_0xfb4d('0x3e')]=qs['filters'](_[_0xfb4d('0x3f')](_0x4be6ef[_0xfb4d('0x33')],_0x3822e5[_0xfb4d('0x35')]));if(_0x4be6ef['query'][_0xfb4d('0x40')]){_0x54ad2b[_0xfb4d('0x3e')]=_[_0xfb4d('0x41')](_0x54ad2b['where'],{'$or':_[_0xfb4d('0x2e')](_0x54ad2b[_0xfb4d('0x37')],function(_0x10d84d){var _0x47d0fe={};_0x47d0fe[_0x10d84d]={'$like':'%'+_0x4be6ef[_0xfb4d('0x33')][_0xfb4d('0x40')]+'%'};return _0x47d0fe;})});}_0x54ad2b=_['merge']({},_0x54ad2b,_0x4be6ef['options']);return _0x3b3907[_0xfb4d('0x71')](_0x54ad2b);}})[_0xfb4d('0x26')](function(_0x39cece){if(_0x39cece){_0x5de49f=_0x39cece[_0xfb4d('0x38')];if(!_0x4be6ef[_0xfb4d('0x33')][_0xfb4d('0x39')]('nolimit')){_0x54ad2b['limit']=qs[_0xfb4d('0x3b')](_0x4be6ef[_0xfb4d('0x33')]['limit']);_0x54ad2b[_0xfb4d('0x1e')]=qs[_0xfb4d('0x1e')](_0x4be6ef[_0xfb4d('0x33')][_0xfb4d('0x1e')]);}return _0x3b3907['getSounds'](_0x54ad2b);}})[_0xfb4d('0x26')](function(_0x119223){if(_0x119223){return _0x119223?{'count':_0x5de49f,'rows':_0x119223}:null;}})[_0xfb4d('0x26')](respondWithResult(_0x2d6ae0,null))[_0xfb4d('0x47')](handleError(_0x2d6ae0,null));}; \ No newline at end of file +var _0x818f=['transaction','mode','files','directory','join','root','create','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','basename','extname','server/files/moh','format','symlinkSync','Sequelize','removeSound','id2','getSounds','pick','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','MusicOnHolds','destroy','error','stack','send','index','VoiceMusicOnHold','rawAttributes','fieldName','key','map','name','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','find','catch','body','params','sequelize'];(function(_0x50eab9,_0x1a6d00){var _0x102a2f=function(_0x5af23c){while(--_0x5af23c){_0x50eab9['push'](_0x50eab9['shift']());}};_0x102a2f(++_0x1a6d00);}(_0x818f,0x190));var _0xf818=function(_0x5bd718,_0xb0327){_0x5bd718=_0x5bd718-0x0;var _0x36a95b=_0x818f[_0x5bd718];return _0x36a95b;};'use strict';var emlformat=require(_0xf818('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf818('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf818('0x2'));var BPromise=require(_0xf818('0x3'));var Mustache=require(_0xf818('0x4'));var util=require(_0xf818('0x5'));var path=require(_0xf818('0x6'));var sox=require(_0xf818('0x7'));var csv=require(_0xf818('0x8'));var ejs=require(_0xf818('0x9'));var fs=require('fs');var fs_extra=require(_0xf818('0xa'));var _=require(_0xf818('0xb'));var squel=require(_0xf818('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf818('0xd'));var toCsv=require(_0xf818('0x8'));var querystring=require(_0xf818('0xe'));var Papa=require(_0xf818('0xf'));var Redis=require(_0xf818('0x10'));var authService=require(_0xf818('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf818('0x12'));var hardwareService=require(_0xf818('0x13'));var logger=require(_0xf818('0x14'))(_0xf818('0x15'));var utils=require(_0xf818('0x16'));var config=require(_0xf818('0x17'));var licenseUtil=require(_0xf818('0x18'));var db=require(_0xf818('0x19'))['db'];function respondWithStatusCode(_0x276a67,_0x4d0418){_0x4d0418=_0x4d0418||0xcc;return function(_0x6d0f4d){if(_0x6d0f4d){return _0x276a67[_0xf818('0x1a')](_0x4d0418);}return _0x276a67['status'](_0x4d0418)[_0xf818('0x1b')]();};}function respondWithResult(_0xb914d7,_0x17a7e3){_0x17a7e3=_0x17a7e3||0xc8;return function(_0x196dbc){if(_0x196dbc){return _0xb914d7[_0xf818('0x1c')](_0x17a7e3)[_0xf818('0x1d')](_0x196dbc);}};}function respondWithFilteredResult(_0x2c4fa3,_0x29b960){return function(_0x4bdfa9){if(_0x4bdfa9){var _0x5e0ab0=typeof _0x29b960[_0xf818('0x1e')]==='undefined'&&typeof _0x29b960[_0xf818('0x1f')]===_0xf818('0x20');var _0x3ff379=_0x4bdfa9[_0xf818('0x21')];var _0x587a0b=_0x5e0ab0?0x0:_0x29b960['offset'];var _0x947879=_0x5e0ab0?_0x4bdfa9[_0xf818('0x21')]:_0x29b960[_0xf818('0x1e')]+_0x29b960['limit'];var _0x40ca9a;if(_0x947879>=_0x3ff379){_0x947879=_0x3ff379;_0x40ca9a=0xc8;}else{_0x40ca9a=0xce;}_0x2c4fa3[_0xf818('0x1c')](_0x40ca9a);return _0x2c4fa3[_0xf818('0x22')](_0xf818('0x23'),_0x587a0b+'-'+_0x947879+'/'+_0x3ff379)[_0xf818('0x1d')](_0x4bdfa9);}return null;};}function patchUpdates(_0xe96b9d){return function(_0x2ba4e8){try{jsonpatch[_0xf818('0x24')](_0x2ba4e8,_0xe96b9d,!![]);}catch(_0x26ecbf){return BPromise[_0xf818('0x25')](_0x26ecbf);}return _0x2ba4e8[_0xf818('0x26')]();};}function saveUpdates(_0x2384f3,_0xf259cb){return function(_0xcc8c1f){if(_0xcc8c1f){return _0xcc8c1f[_0xf818('0x27')](_0x2384f3)[_0xf818('0x28')](function(_0x3c62f2){return _0x3c62f2;});}return null;};}function removeEntity(_0x53879b,_0x5694a4){return function(_0x9fcaae){if(_0x9fcaae){return _0x9fcaae['destroy']()[_0xf818('0x28')](function(){var _0x4f8842=_0x9fcaae[_0xf818('0x29')]({'plain':!![]});var _0x2abe85=_0xf818('0x2a');return db['UserProfileResource'][_0xf818('0x2b')]({'where':{'type':_0x2abe85,'resourceId':_0x4f8842['id']}})[_0xf818('0x28')](function(){return _0x9fcaae;});})[_0xf818('0x28')](function(){_0x53879b[_0xf818('0x1c')](0xcc)[_0xf818('0x1b')]();});}};}function handleEntityNotFound(_0x4c0ea0,_0x30f58d){return function(_0x5291e2){if(!_0x5291e2){_0x4c0ea0['sendStatus'](0x194);}return _0x5291e2;};}function handleError(_0x2a6f29,_0x32d25f){_0x32d25f=_0x32d25f||0x1f4;return function(_0x3ded3d){logger[_0xf818('0x2c')](_0x3ded3d[_0xf818('0x2d')]);if(_0x3ded3d['name']){delete _0x3ded3d['name'];}_0x2a6f29[_0xf818('0x1c')](_0x32d25f)[_0xf818('0x2e')](_0x3ded3d);};}exports[_0xf818('0x2f')]=function(_0x57f21c,_0x93bd5e){var _0x59d8fd={},_0x13f912={},_0x418f73={'count':0x0,'rows':[]};var _0x22805c=_['map'](db[_0xf818('0x30')][_0xf818('0x31')],function(_0x2ec482){return{'name':_0x2ec482[_0xf818('0x32')],'type':_0x2ec482['type'][_0xf818('0x33')]};});_0x13f912['model']=_[_0xf818('0x34')](_0x22805c,_0xf818('0x35'));_0x13f912[_0xf818('0x36')]=_[_0xf818('0x37')](_0x57f21c[_0xf818('0x36')]);_0x13f912[_0xf818('0x38')]=_['intersection'](_0x13f912[_0xf818('0x39')],_0x13f912['query']);_0x59d8fd[_0xf818('0x3a')]=_[_0xf818('0x3b')](_0x13f912[_0xf818('0x39')],qs[_0xf818('0x3c')](_0x57f21c['query'][_0xf818('0x3c')]));_0x59d8fd[_0xf818('0x3a')]=_0x59d8fd[_0xf818('0x3a')][_0xf818('0x3d')]?_0x59d8fd['attributes']:_0x13f912[_0xf818('0x39')];if(!_0x57f21c[_0xf818('0x36')]['hasOwnProperty'](_0xf818('0x3e'))){_0x59d8fd[_0xf818('0x1f')]=qs[_0xf818('0x1f')](_0x57f21c[_0xf818('0x36')]['limit']);_0x59d8fd['offset']=qs[_0xf818('0x1e')](_0x57f21c[_0xf818('0x36')][_0xf818('0x1e')]);}_0x59d8fd[_0xf818('0x3f')]=qs['sort'](_0x57f21c[_0xf818('0x36')][_0xf818('0x40')]);delete _0x57f21c[_0xf818('0x36')][_0xf818('0x40')];_0x59d8fd[_0xf818('0x41')]=qs[_0xf818('0x38')](_['pick'](_0x57f21c[_0xf818('0x36')],_0x13f912[_0xf818('0x38')]),_0x22805c);if(_0x57f21c[_0xf818('0x36')]['filter']){_0x59d8fd[_0xf818('0x41')]=_[_0xf818('0x42')](_0x59d8fd[_0xf818('0x41')],{'$or':_[_0xf818('0x34')](_0x22805c,function(_0x4eb24a){if(_0x4eb24a[_0xf818('0x43')]!==_0xf818('0x44')){var _0x435020={};_0x435020[_0x4eb24a[_0xf818('0x35')]]={'$like':'%'+_0x57f21c[_0xf818('0x36')][_0xf818('0x45')]+'%'};return _0x435020;}})});}_0x59d8fd=_[_0xf818('0x42')]({},_0x59d8fd,_0x57f21c[_0xf818('0x46')]);var _0xc1c10c={'where':_0x59d8fd[_0xf818('0x41')]};return db[_0xf818('0x30')][_0xf818('0x21')](_0xc1c10c)[_0xf818('0x28')](function(_0x51705a){_0x418f73['count']=_0x51705a;if(_0x57f21c[_0xf818('0x36')][_0xf818('0x47')]){_0x59d8fd[_0xf818('0x48')]=[{'all':!![]}];}return db[_0xf818('0x30')][_0xf818('0x49')](_0x59d8fd);})[_0xf818('0x28')](function(_0x1249da){_0x418f73[_0xf818('0x4a')]=_0x1249da;return _0x418f73;})[_0xf818('0x28')](respondWithFilteredResult(_0x93bd5e,_0x59d8fd))['catch'](handleError(_0x93bd5e,null));};exports['show']=function(_0xb335a,_0xdac2b0){var _0x360088={'raw':![],'where':{'id':_0xb335a['params']['id']}},_0x3d9945={};_0x3d9945[_0xf818('0x39')]=_[_0xf818('0x37')](db[_0xf818('0x30')]['rawAttributes']);_0x3d9945[_0xf818('0x36')]=_[_0xf818('0x37')](_0xb335a[_0xf818('0x36')]);_0x3d9945[_0xf818('0x38')]=_['intersection'](_0x3d9945[_0xf818('0x39')],_0x3d9945[_0xf818('0x36')]);_0x360088['attributes']=_[_0xf818('0x3b')](_0x3d9945['model'],qs[_0xf818('0x3c')](_0xb335a[_0xf818('0x36')][_0xf818('0x3c')]));_0x360088['attributes']=_0x360088[_0xf818('0x3a')][_0xf818('0x3d')]?_0x360088[_0xf818('0x3a')]:_0x3d9945[_0xf818('0x39')];if(_0xb335a[_0xf818('0x36')]['includeAll']){_0x360088[_0xf818('0x48')]=[{'all':!![]}];}_0x360088=_['merge']({},_0x360088,_0xb335a['options']);return db['VoiceMusicOnHold'][_0xf818('0x4b')](_0x360088)[_0xf818('0x28')](handleEntityNotFound(_0xdac2b0,null))[_0xf818('0x28')](respondWithResult(_0xdac2b0,null))[_0xf818('0x4c')](handleError(_0xdac2b0,null));};exports[_0xf818('0x27')]=function(_0x2728ab,_0x56329a){if(_0x2728ab[_0xf818('0x4d')]['id']){delete _0x2728ab[_0xf818('0x4d')]['id'];}return db[_0xf818('0x30')]['find']({'where':{'id':_0x2728ab[_0xf818('0x4e')]['id']}})[_0xf818('0x28')](handleEntityNotFound(_0x56329a,null))[_0xf818('0x28')](saveUpdates(_0x2728ab[_0xf818('0x4d')],null))['then'](respondWithResult(_0x56329a,null))['catch'](handleError(_0x56329a,null));};exports['create']=function(_0x24733c,_0x289997,_0x5b1c3b){return db[_0xf818('0x4f')][_0xf818('0x50')](function(_0x274f8c){if(_0x24733c[_0xf818('0x4d')][_0xf818('0x51')]===_0xf818('0x52')){_0x24733c[_0xf818('0x4d')][_0xf818('0x53')]=path[_0xf818('0x54')](config[_0xf818('0x55')],'server/files/moh',_0x24733c['body'][_0xf818('0x35')]);}return db[_0xf818('0x30')][_0xf818('0x56')](_0x24733c[_0xf818('0x4d')],{'transaction':_0x274f8c})[_0xf818('0x28')](function(_0x59de31){if(_0x24733c[_0xf818('0x4d')]['mode']===_0xf818('0x52')){fs[_0xf818('0x57')](_0x59de31[_0xf818('0x53')],parseInt(_0xf818('0x58'),0x8));}var _0x578fa8=_0x24733c[_0xf818('0x59')]['get']({'plain':!![]});if(!_0x578fa8)throw new Error(_0xf818('0x5a'));if(_0x578fa8['role']===_0xf818('0x59')){var _0x575631=_0x59de31[_0xf818('0x29')]({'plain':!![]});return db[_0xf818('0x5b')][_0xf818('0x4b')]({'where':{'name':_0xf818('0x2a'),'userProfileId':_0x578fa8[_0xf818('0x5c')]},'raw':!![]})[_0xf818('0x28')](function(_0x4fb880){if(_0x4fb880&&_0x4fb880[_0xf818('0x5d')]===0x0){return db[_0xf818('0x5e')]['create']({'name':_0x575631[_0xf818('0x35')],'resourceId':_0x575631['id'],'type':_0x4fb880[_0xf818('0x35')],'sectionId':_0x4fb880['id']},{})['then'](function(){return _0x59de31;});}else{return _0x59de31;}})[_0xf818('0x4c')](function(_0x222939){logger[_0xf818('0x2c')](_0xf818('0x5f'),_0x222939);});}return _0x59de31;});})[_0xf818('0x28')](respondWithResult(_0x289997,0xc9))[_0xf818('0x4c')](handleError(_0x289997,null));};exports[_0xf818('0x2b')]=function(_0x10ffd9,_0x7fc398,_0x5a4ac7){var _0x395c89;return db[_0xf818('0x30')][_0xf818('0x4b')]({'where':{'id':_0x10ffd9[_0xf818('0x4e')]['id']}})['then'](function(_0x4d14fc){if(_0x4d14fc){return db[_0xf818('0x4f')][_0xf818('0x50')](function(_0x2df8a1){return _0x4d14fc[_0xf818('0x2b')]({'transaction':_0x2df8a1,'raw':!![]})[_0xf818('0x28')](function(_0x202ec8){if(_0x202ec8[_0xf818('0x53')]){fs[_0xf818('0x60')](_0x202ec8[_0xf818('0x53')])[_0xf818('0x61')](function(_0x3d84bf){fs[_0xf818('0x62')](path[_0xf818('0x54')](_0x202ec8[_0xf818('0x53')],_0x3d84bf));});fs[_0xf818('0x63')](_0x202ec8[_0xf818('0x53')]);}return _0x202ec8;});})[_0xf818('0x4c')](function(_0x3ec1ae){throw new db['Sequelize'][(_0xf818('0x64'))](_0x3ec1ae[_0xf818('0x65')]);});}})[_0xf818('0x28')](handleEntityNotFound(_0x7fc398,null))['then'](removeEntity(_0x7fc398,null))[_0xf818('0x4c')](handleError(_0x7fc398,null));};exports[_0xf818('0x66')]=function(_0x28ed72,_0x4f6d14,_0x576e43){return db[_0xf818('0x4f')]['transaction'](function(_0x5309ad){var _0x4627a5;return db[_0xf818('0x30')][_0xf818('0x4b')]({'where':{'id':_0x28ed72[_0xf818('0x4e')]['id']}})[_0xf818('0x28')](function(_0x449d78){if(_0x449d78){_0x4627a5=_0x449d78;return _0x449d78['addSound'](_0x28ed72['body']['id'],{'transaction':_0x5309ad});}})['then'](function(_0x32ecbb){if(_0x32ecbb){return db[_0xf818('0x67')][_0xf818('0x68')]({'where':{'id':_0x28ed72[_0xf818('0x4d')]['id']},'attributes':['id','name',_0xf818('0x69'),_0xf818('0x6a'),_0xf818('0x6b')],'raw':!![]});}})['then'](function(_0x3797b8){if(_0x3797b8){var _0x1e6e32=path[_0xf818('0x54')](config[_0xf818('0x55')],_0xf818('0x6c'),util['format'](_0xf818('0x6d'),path[_0xf818('0x6e')](_0x3797b8[_0xf818('0x69')],path[_0xf818('0x6f')](_0x3797b8[_0xf818('0x69')])),_0x3797b8[_0xf818('0x6a')]));var _0x2802bf=path[_0xf818('0x54')](config[_0xf818('0x55')],_0xf818('0x70'),_0x4627a5[_0xf818('0x35')],util[_0xf818('0x71')](_0xf818('0x6d'),_0x3797b8[_0xf818('0x35')],_0x3797b8[_0xf818('0x6a')]));fs[_0xf818('0x72')](_0x1e6e32,_0x2802bf);return _0x3797b8;}})[_0xf818('0x4c')](function(_0x120d2d){throw new db[(_0xf818('0x73'))][(_0xf818('0x64'))](_0x120d2d[_0xf818('0x65')]);});})[_0xf818('0x28')](handleEntityNotFound(_0x4f6d14,null))[_0xf818('0x28')](respondWithResult(_0x4f6d14,0xc9))[_0xf818('0x4c')](handleError(_0x4f6d14,null));};exports[_0xf818('0x74')]=function(_0x2b0850,_0x51add9,_0x16146e){return db['sequelize'][_0xf818('0x50')](function(_0x103abd){var _0x34e9ec;return db[_0xf818('0x30')]['findOne']({'where':{'id':_0x2b0850[_0xf818('0x4e')]['id']}})[_0xf818('0x28')](handleEntityNotFound(_0x51add9,null))[_0xf818('0x28')](function(_0xadc42d){if(_0xadc42d){_0x34e9ec=_0xadc42d;return _0xadc42d[_0xf818('0x74')](_0x2b0850[_0xf818('0x4e')][_0xf818('0x75')]);}})[_0xf818('0x28')](function(_0x59a174){if(_0x59a174){return db[_0xf818('0x67')]['findOne']({'where':{'id':_0x2b0850[_0xf818('0x4e')]['id2']},'attributes':['id',_0xf818('0x35'),_0xf818('0x69'),'converted_format',_0xf818('0x6b')],'raw':!![]});}})[_0xf818('0x28')](function(_0x132d22){if(_0x132d22){fs[_0xf818('0x62')](path[_0xf818('0x54')](_0x34e9ec['directory'],util[_0xf818('0x71')]('%s.%s',_0x132d22[_0xf818('0x35')],_0x132d22['converted_format'])));return _0x132d22;}})[_0xf818('0x4c')](function(_0x305d98){throw new db[(_0xf818('0x73'))][(_0xf818('0x64'))](_0x305d98[_0xf818('0x65')]);});})['then'](handleEntityNotFound(_0x51add9,null))[_0xf818('0x28')](respondWithStatusCode(_0x51add9,0xcc))[_0xf818('0x4c')](handleError(_0x51add9,null));};exports[_0xf818('0x76')]=function(_0x6ae14c,_0x272f2d,_0xbf41f5){var _0x190ac5={};var _0x4d903f={};var _0x561690;var _0xc01cdb;return db['VoiceMusicOnHold'][_0xf818('0x68')]({'where':{'id':_0x6ae14c[_0xf818('0x4e')]['id']}})[_0xf818('0x28')](handleEntityNotFound(_0x272f2d,null))[_0xf818('0x28')](function(_0x28c897){if(_0x28c897){_0x561690=_0x28c897;_0x4d903f[_0xf818('0x39')]=_[_0xf818('0x37')](db[_0xf818('0x67')][_0xf818('0x31')]);_0x4d903f[_0xf818('0x36')]=_[_0xf818('0x37')](_0x6ae14c[_0xf818('0x36')]);_0x4d903f['filters']=_[_0xf818('0x3b')](_0x4d903f['model'],_0x4d903f[_0xf818('0x36')]);_0x190ac5[_0xf818('0x3a')]=_[_0xf818('0x3b')](_0x4d903f[_0xf818('0x39')],qs[_0xf818('0x3c')](_0x6ae14c[_0xf818('0x36')][_0xf818('0x3c')]));_0x190ac5[_0xf818('0x3a')]=_0x190ac5[_0xf818('0x3a')][_0xf818('0x3d')]?_0x190ac5[_0xf818('0x3a')]:_0x4d903f[_0xf818('0x39')];_0x190ac5[_0xf818('0x3f')]=qs['sort'](_0x6ae14c[_0xf818('0x36')]['sort']);_0x190ac5[_0xf818('0x41')]=qs[_0xf818('0x38')](_[_0xf818('0x77')](_0x6ae14c[_0xf818('0x36')],_0x4d903f[_0xf818('0x38')]));if(_0x6ae14c[_0xf818('0x36')][_0xf818('0x45')]){_0x190ac5[_0xf818('0x41')]=_[_0xf818('0x42')](_0x190ac5['where'],{'$or':_['map'](_0x190ac5[_0xf818('0x3a')],function(_0x3c49c7){var _0x509b98={};_0x509b98[_0x3c49c7]={'$like':'%'+_0x6ae14c[_0xf818('0x36')]['filter']+'%'};return _0x509b98;})});}_0x190ac5=_[_0xf818('0x42')]({},_0x190ac5,_0x6ae14c[_0xf818('0x46')]);return _0x561690['getSounds'](_0x190ac5);}})[_0xf818('0x28')](function(_0x442da0){if(_0x442da0){_0xc01cdb=_0x442da0['length'];if(!_0x6ae14c['query']['hasOwnProperty'](_0xf818('0x3e'))){_0x190ac5[_0xf818('0x1f')]=qs[_0xf818('0x1f')](_0x6ae14c[_0xf818('0x36')]['limit']);_0x190ac5[_0xf818('0x1e')]=qs['offset'](_0x6ae14c['query'][_0xf818('0x1e')]);}return _0x561690[_0xf818('0x76')](_0x190ac5);}})[_0xf818('0x28')](function(_0x4280c7){if(_0x4280c7){return _0x4280c7?{'count':_0xc01cdb,'rows':_0x4280c7}:null;}})[_0xf818('0x28')](respondWithResult(_0x272f2d,null))[_0xf818('0x4c')](handleError(_0x272f2d,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 1fdb3cc..2d5142d 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 _0x7af5=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold'];(function(_0x1344fe,_0x39cdb8){var _0x57fa7a=function(_0x219c53){while(--_0x219c53){_0x1344fe['push'](_0x1344fe['shift']());}};_0x57fa7a(++_0x39cdb8);}(_0x7af5,0x9a));var _0x57af=function(_0x263a9e,_0x35bace){_0x263a9e=_0x263a9e-0x0;var _0x43c527=_0x7af5[_0x263a9e];return _0x43c527;};'use strict';var _=require(_0x57af('0x0'));var util=require(_0x57af('0x1'));var logger=require(_0x57af('0x2'))('api');var moment=require(_0x57af('0x3'));var BPromise=require(_0x57af('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x57af('0x5'));var rimraf=require('rimraf');var config=require(_0x57af('0x6'));var attributes=require(_0x57af('0x7'));module[_0x57af('0x8')]=function(_0x38ac66,_0x5e70c6){return _0x38ac66[_0x57af('0x9')]('VoiceMusicOnHold',attributes,{'tableName':_0x57af('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9113=['define','VoiceMusicOnHold','voice_musiconhold','util','moment','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x9113,0x12c));var _0x3911=function(_0x16b52a,_0x141ba2){_0x16b52a=_0x16b52a-0x0;var _0x5bc265=_0x9113[_0x16b52a];return _0x5bc265;};'use strict';var _=require('lodash');var util=require(_0x3911('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3911('0x1'));var BPromise=require('bluebird');var rp=require(_0x3911('0x2'));var fs=require('fs');var path=require(_0x3911('0x3'));var rimraf=require(_0x3911('0x4'));var config=require(_0x3911('0x5'));var attributes=require(_0x3911('0x6'));module[_0x3911('0x7')]=function(_0x24f987,_0x13b075){return _0x24f987[_0x3911('0x8')](_0x3911('0x9'),attributes,{'tableName':_0x3911('0xa'),'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 8a66119..00a54e1 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x333166,_0x2a47af){var _0x126a24=function(_0x1c893b){while(--_0x1c893b){_0x333166['push'](_0x333166['shift']());}};_0x126a24(++_0x2a47af);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2b5e4a,_0x57007e){var _0x220179=function(_0x3cb6a3){while(--_0x3cb6a3){_0x2b5e4a['push'](_0x2b5e4a['shift']());}};_0x220179(++_0x57007e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 975d4c1..b69773e 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 _0x731d=['./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','show','/:id/users','getAgents','/:id/teams','post','create','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x731d,0x123));var _0xd731=function(_0xee10d1,_0x4ef158){_0xee10d1=_0xee10d1-0x0;var _0x2997f5=_0x731d[_0xee10d1];return _0x2997f5;};'use strict';var multer=require(_0xd731('0x0'));var util=require(_0xd731('0x1'));var path=require('path');var timeout=require(_0xd731('0x2'));var express=require(_0xd731('0x3'));var router=express[_0xd731('0x4')]();var fs_extra=require(_0xd731('0x5'));var auth=require(_0xd731('0x6'));var interaction=require(_0xd731('0x7'));var config=require('../../config/environment');var controller=require(_0xd731('0x8'));router[_0xd731('0x9')]('/',auth[_0xd731('0xa')](),controller[_0xd731('0xb')]);router[_0xd731('0x9')]('/describe',auth[_0xd731('0xa')](),controller[_0xd731('0xc')]);router['get'](_0xd731('0xd'),auth[_0xd731('0xa')](),controller[_0xd731('0xe')]);router['get'](_0xd731('0xf'),auth['isAuthenticated'](),controller[_0xd731('0x10')]);router[_0xd731('0x9')](_0xd731('0x11'),auth[_0xd731('0xa')](),controller['getTeams']);router[_0xd731('0x12')]('/',auth['isAuthenticated'](),controller[_0xd731('0x13')]);router[_0xd731('0x12')]('/:id/users',auth[_0xd731('0xa')](),controller['addAgents']);router['post']('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0xd731('0x14')](_0xd731('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xd731('0x15')](_0xd731('0xd'),auth[_0xd731('0xa')](),controller['destroy']);router[_0xd731('0x15')](_0xd731('0xf'),auth['isAuthenticated'](),controller['removeAgents']);router[_0xd731('0x15')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);module[_0xd731('0x16')]=router; \ No newline at end of file +var _0x1294=['describe','show','getAgents','post','addAgents','/:id/teams','addTeams','put','/:id','update','destroy','delete','/:id/users','removeAgents','removeTeams','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe'];(function(_0x52d5b4,_0x329039){var _0x3464b5=function(_0x1ac9d8){while(--_0x1ac9d8){_0x52d5b4['push'](_0x52d5b4['shift']());}};_0x3464b5(++_0x329039);}(_0x1294,0xb8));var _0x4129=function(_0x1979d8,_0x10d8f2){_0x1979d8=_0x1979d8-0x0;var _0x1d5bb3=_0x1294[_0x1979d8];return _0x1d5bb3;};'use strict';var multer=require(_0x4129('0x0'));var util=require('util');var path=require(_0x4129('0x1'));var timeout=require('connect-timeout');var express=require(_0x4129('0x2'));var router=express[_0x4129('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4129('0x4'));var interaction=require(_0x4129('0x5'));var config=require(_0x4129('0x6'));var controller=require(_0x4129('0x7'));router[_0x4129('0x8')]('/',auth[_0x4129('0x9')](),controller[_0x4129('0xa')]);router[_0x4129('0x8')](_0x4129('0xb'),auth[_0x4129('0x9')](),controller[_0x4129('0xc')]);router[_0x4129('0x8')]('/:id',auth[_0x4129('0x9')](),controller[_0x4129('0xd')]);router[_0x4129('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x4129('0xe')]);router[_0x4129('0x8')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4129('0xf')]('/:id/users',auth[_0x4129('0x9')](),controller[_0x4129('0x10')]);router[_0x4129('0xf')](_0x4129('0x11'),auth[_0x4129('0x9')](),controller[_0x4129('0x12')]);router[_0x4129('0x13')](_0x4129('0x14'),auth[_0x4129('0x9')](),controller[_0x4129('0x15')]);router['delete'](_0x4129('0x14'),auth['isAuthenticated'](),controller[_0x4129('0x16')]);router[_0x4129('0x17')](_0x4129('0x18'),auth[_0x4129('0x9')](),controller[_0x4129('0x19')]);router[_0x4129('0x17')](_0x4129('0x11'),auth['isAuthenticated'](),controller[_0x4129('0x1a')]);module[_0x4129('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index fc305ab..065a002 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 _0xed8c=['name','INTEGER','exports','STRING','getDataValue'];(function(_0x3d3bb6,_0x1a0c79){var _0x56f929=function(_0x1bd3c3){while(--_0x1bd3c3){_0x3d3bb6['push'](_0x3d3bb6['shift']());}};_0x56f929(++_0x1a0c79);}(_0xed8c,0x16f));var _0xced8=function(_0x2e4061,_0x2de5e9){_0x2e4061=_0x2e4061-0x0;var _0x155109=_0xed8c[_0x2e4061];return _0x155109;};'use strict';var Sequelize=require('sequelize');module[_0xced8('0x0')]={'name':{'type':Sequelize[_0xced8('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x219f94){return'system-'+this[_0xced8('0x2')](_0xced8('0x3'))+'-';}},'description':{'type':Sequelize[_0xced8('0x1')]},'callerIdAll':{'type':Sequelize[_0xced8('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xced8('0x4')]}}; \ No newline at end of file +var _0x797a=['system-','STRING','INTEGER','sequelize','exports','name','VIRTUAL'];(function(_0x1d294e,_0x5c50e9){var _0x264294=function(_0x30871e){while(--_0x30871e){_0x1d294e['push'](_0x1d294e['shift']());}};_0x264294(++_0x5c50e9);}(_0x797a,0x6c));var _0xa797=function(_0x2b8ead,_0x2caf25){_0x2b8ead=_0x2b8ead-0x0;var _0x5e364e=_0x797a[_0x2b8ead];return _0x5e364e;};'use strict';var Sequelize=require(_0xa797('0x0'));module[_0xa797('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa797('0x2')},'prefix':{'type':Sequelize[_0xa797('0x3')],'get':function(_0xbbec44){return _0xa797('0x4')+this['getDataValue'](_0xa797('0x2'))+'-';}},'description':{'type':Sequelize[_0xa797('0x5')]},'callerIdAll':{'type':Sequelize[_0xa797('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0xa797('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index f755e44..79f8d19 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 _0x4cf8=['forEach','removeTeams','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','map','VoicePrefix','fieldName','key','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','options','includeAll','show','rawAttributes','find','params','describe','create','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','prefix','system-','sequelize','findById','addAgents','body','ids','spread','emit','isArray','userVoicePrefix:remove','getAgents','findOne','User','pick','getTeams','Team','findAll','Agents','voicePause','interface','flatMap','transaction','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate'];(function(_0x12cfa8,_0x2deabd){var _0x58390c=function(_0x24d971){while(--_0x24d971){_0x12cfa8['push'](_0x12cfa8['shift']());}};_0x58390c(++_0x2deabd);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x204eb7,_0x4974c3){_0x204eb7=_0x204eb7-0x0;var _0x37e444=_0x4cf8[_0x204eb7];return _0x37e444;};'use strict';var emlformat=require(_0x84cf('0x0'));var rimraf=require(_0x84cf('0x1'));var zipdir=require(_0x84cf('0x2'));var jsonpatch=require(_0x84cf('0x3'));var rp=require(_0x84cf('0x4'));var moment=require(_0x84cf('0x5'));var BPromise=require(_0x84cf('0x6'));var Mustache=require(_0x84cf('0x7'));var util=require(_0x84cf('0x8'));var path=require(_0x84cf('0x9'));var sox=require(_0x84cf('0xa'));var csv=require(_0x84cf('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84cf('0xc'));var squel=require('squel');var crypto=require(_0x84cf('0xd'));var jsforce=require(_0x84cf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x84cf('0xb'));var querystring=require(_0x84cf('0xf'));var Papa=require('papaparse');var Redis=require(_0x84cf('0x10'));var authService=require(_0x84cf('0x11'));var qs=require(_0x84cf('0x12'));var as=require(_0x84cf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84cf('0x14'))(_0x84cf('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x84cf('0x16'));var db=require(_0x84cf('0x17'))['db'];config[_0x84cf('0x18')]=_[_0x84cf('0x19')](config[_0x84cf('0x18')],{'host':_0x84cf('0x1a'),'port':0x18eb});var socket=require(_0x84cf('0x1b'))(new Redis(config[_0x84cf('0x18')]));require(_0x84cf('0x1c'))[_0x84cf('0x1d')](socket);function respondWithStatusCode(_0x2fc41f,_0x385027){_0x385027=_0x385027||0xcc;return function(_0x7db8f){if(_0x7db8f){return _0x2fc41f[_0x84cf('0x1e')](_0x385027);}return _0x2fc41f[_0x84cf('0x1f')](_0x385027)[_0x84cf('0x20')]();};}function respondWithResult(_0x464e70,_0x240edf){_0x240edf=_0x240edf||0xc8;return function(_0xe12c7b){if(_0xe12c7b){return _0x464e70['status'](_0x240edf)[_0x84cf('0x21')](_0xe12c7b);}};}function respondWithFilteredResult(_0x5d6a93,_0xfa6641){return function(_0x1abe2d){if(_0x1abe2d){var _0x1dad1a=typeof _0xfa6641[_0x84cf('0x22')]===_0x84cf('0x23')&&typeof _0xfa6641['limit']==='undefined';var _0x42d6d4=_0x1abe2d[_0x84cf('0x24')];var _0x346b43=_0x1dad1a?0x0:_0xfa6641[_0x84cf('0x22')];var _0x219afa=_0x1dad1a?_0x1abe2d['count']:_0xfa6641[_0x84cf('0x22')]+_0xfa6641[_0x84cf('0x25')];var _0x3ca1be;if(_0x219afa>=_0x42d6d4){_0x219afa=_0x42d6d4;_0x3ca1be=0xc8;}else{_0x3ca1be=0xce;}_0x5d6a93[_0x84cf('0x1f')](_0x3ca1be);return _0x5d6a93[_0x84cf('0x26')]('Content-Range',_0x346b43+'-'+_0x219afa+'/'+_0x42d6d4)[_0x84cf('0x21')](_0x1abe2d);}return null;};}function patchUpdates(_0x160f86){return function(_0x475b19){try{jsonpatch[_0x84cf('0x27')](_0x475b19,_0x160f86,!![]);}catch(_0x3e5e94){return BPromise[_0x84cf('0x28')](_0x3e5e94);}return _0x475b19[_0x84cf('0x29')]();};}function saveUpdates(_0x4c9d1c,_0x2b2c90){return function(_0x26db3f){if(_0x26db3f){return _0x26db3f[_0x84cf('0x2a')](_0x4c9d1c)[_0x84cf('0x2b')](function(_0x1d220a){return _0x1d220a;});}return null;};}function removeEntity(_0x44d4bf,_0x3c7eda){return function(_0xa44c81){if(_0xa44c81){return _0xa44c81[_0x84cf('0x2c')]()[_0x84cf('0x2b')](function(){var _0x5179c1=_0xa44c81[_0x84cf('0x2d')]({'plain':!![]});var _0x17bc92=_0x84cf('0x2e');return db[_0x84cf('0x2f')]['destroy']({'where':{'type':_0x17bc92,'resourceId':_0x5179c1['id']}})[_0x84cf('0x2b')](function(){return _0xa44c81;});})['then'](function(){_0x44d4bf[_0x84cf('0x1f')](0xcc)[_0x84cf('0x20')]();});}};}function handleEntityNotFound(_0x43b41b,_0xc15298){return function(_0x51adcf){if(!_0x51adcf){_0x43b41b[_0x84cf('0x1e')](0x194);}return _0x51adcf;};}function handleError(_0x2e4653,_0x309398){_0x309398=_0x309398||0x1f4;return function(_0x1bfa56){logger[_0x84cf('0x30')](_0x1bfa56[_0x84cf('0x31')]);if(_0x1bfa56[_0x84cf('0x32')]){delete _0x1bfa56[_0x84cf('0x32')];}_0x2e4653[_0x84cf('0x1f')](_0x309398)['send'](_0x1bfa56);};}exports['index']=function(_0x2795ef,_0x25de3a){var _0x16ebaa={},_0x1e889e={},_0x38eeea={'count':0x0,'rows':[]};var _0x1453cf=_[_0x84cf('0x33')](db[_0x84cf('0x34')]['rawAttributes'],function(_0x113b3e){return{'name':_0x113b3e[_0x84cf('0x35')],'type':_0x113b3e['type'][_0x84cf('0x36')]};});_0x1e889e['model']=_[_0x84cf('0x33')](_0x1453cf,_0x84cf('0x32'));_0x1e889e[_0x84cf('0x37')]=_[_0x84cf('0x38')](_0x2795ef[_0x84cf('0x37')]);_0x1e889e['filters']=_[_0x84cf('0x39')](_0x1e889e['model'],_0x1e889e['query']);_0x16ebaa[_0x84cf('0x3a')]=_[_0x84cf('0x39')](_0x1e889e['model'],qs[_0x84cf('0x3b')](_0x2795ef[_0x84cf('0x37')][_0x84cf('0x3b')]));_0x16ebaa[_0x84cf('0x3a')]=_0x16ebaa[_0x84cf('0x3a')][_0x84cf('0x3c')]?_0x16ebaa['attributes']:_0x1e889e[_0x84cf('0x3d')];if(!_0x2795ef[_0x84cf('0x37')][_0x84cf('0x3e')](_0x84cf('0x3f'))){_0x16ebaa[_0x84cf('0x25')]=qs[_0x84cf('0x25')](_0x2795ef['query'][_0x84cf('0x25')]);_0x16ebaa['offset']=qs[_0x84cf('0x22')](_0x2795ef[_0x84cf('0x37')][_0x84cf('0x22')]);}_0x16ebaa[_0x84cf('0x40')]=qs[_0x84cf('0x41')](_0x2795ef[_0x84cf('0x37')][_0x84cf('0x41')]);_0x16ebaa[_0x84cf('0x42')]=qs[_0x84cf('0x43')](_['pick'](_0x2795ef[_0x84cf('0x37')],_0x1e889e['filters']),_0x1453cf);if(_0x2795ef[_0x84cf('0x37')][_0x84cf('0x44')]){_0x16ebaa['where']=_[_0x84cf('0x45')](_0x16ebaa['where'],{'$or':_[_0x84cf('0x33')](_0x1453cf,function(_0x504d32){if(_0x504d32[_0x84cf('0x46')]!=='VIRTUAL'){var _0x2db7dd={};_0x2db7dd[_0x504d32[_0x84cf('0x32')]]={'$like':'%'+_0x2795ef['query'][_0x84cf('0x44')]+'%'};return _0x2db7dd;}})});}_0x16ebaa=_[_0x84cf('0x45')]({},_0x16ebaa,_0x2795ef[_0x84cf('0x47')]);var _0x5ef5fb={'where':_0x16ebaa[_0x84cf('0x42')]};return db['VoicePrefix'][_0x84cf('0x24')](_0x5ef5fb)['then'](function(_0x56b0e5){_0x38eeea['count']=_0x56b0e5;if(_0x2795ef[_0x84cf('0x37')][_0x84cf('0x48')]){_0x16ebaa['include']=[{'all':!![]}];}return db[_0x84cf('0x34')]['findAll'](_0x16ebaa);})[_0x84cf('0x2b')](function(_0x3fe8c1){_0x38eeea['rows']=_0x3fe8c1;return _0x38eeea;})[_0x84cf('0x2b')](respondWithFilteredResult(_0x25de3a,_0x16ebaa))['catch'](handleError(_0x25de3a,null));};exports[_0x84cf('0x49')]=function(_0x593b35,_0x4feb7e){var _0x5d8b69={'raw':![],'where':{'id':_0x593b35['params']['id']}},_0x5498ec={};_0x5498ec['model']=_['keys'](db[_0x84cf('0x34')][_0x84cf('0x4a')]);_0x5498ec[_0x84cf('0x37')]=_[_0x84cf('0x38')](_0x593b35['query']);_0x5498ec[_0x84cf('0x43')]=_['intersection'](_0x5498ec[_0x84cf('0x3d')],_0x5498ec[_0x84cf('0x37')]);_0x5d8b69[_0x84cf('0x3a')]=_[_0x84cf('0x39')](_0x5498ec[_0x84cf('0x3d')],qs[_0x84cf('0x3b')](_0x593b35['query'][_0x84cf('0x3b')]));_0x5d8b69[_0x84cf('0x3a')]=_0x5d8b69['attributes'][_0x84cf('0x3c')]?_0x5d8b69[_0x84cf('0x3a')]:_0x5498ec[_0x84cf('0x3d')];if(_0x593b35['query']['includeAll']){_0x5d8b69['include']=[{'all':!![]}];}_0x5d8b69=_[_0x84cf('0x45')]({},_0x5d8b69,_0x593b35[_0x84cf('0x47')]);return db[_0x84cf('0x34')][_0x84cf('0x4b')](_0x5d8b69)[_0x84cf('0x2b')](handleEntityNotFound(_0x4feb7e,null))[_0x84cf('0x2b')](respondWithResult(_0x4feb7e,null))['catch'](handleError(_0x4feb7e,null));};exports[_0x84cf('0x2c')]=function(_0x55316e,_0x44b8b0){return db['VoicePrefix']['find']({'where':{'id':_0x55316e[_0x84cf('0x4c')]['id']}})[_0x84cf('0x2b')](handleEntityNotFound(_0x44b8b0,null))[_0x84cf('0x2b')](removeEntity(_0x44b8b0,null))['catch'](handleError(_0x44b8b0,null));};exports['describe']=function(_0x290a4d,_0x1ce99c){return db[_0x84cf('0x34')][_0x84cf('0x4d')]()[_0x84cf('0x2b')](respondWithResult(_0x1ce99c,null))['catch'](handleError(_0x1ce99c,null));};exports[_0x84cf('0x4e')]=function(_0x225fc2,_0x5e4af1){var _0x33145e;return db['sequelize']['transaction'](function(_0x147194){return db[_0x84cf('0x34')]['create'](_0x225fc2['body'],{'transaction':_0x147194})[_0x84cf('0x2b')](function(_0x9f2467){_0x33145e=_0x9f2467[_0x84cf('0x2d')]({'plain':!![]});return db[_0x84cf('0x4f')][_0x84cf('0x4b')]({'where':{'id':_0x33145e[_0x84cf('0x50')]},'raw':!![]})[_0x84cf('0x2b')](function(_0x20ae02){return createVoicePrefixExtensions(_0x33145e,_0x20ae02,_0x147194);});});})['then'](function(){var _0x1bc15c=_0x225fc2[_0x84cf('0x51')]['get']({'plain':!![]});if(!_0x1bc15c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bc15c[_0x84cf('0x52')]===_0x84cf('0x51')){var _0x3912cb=_0x33145e;return db[_0x84cf('0x53')][_0x84cf('0x4b')]({'where':{'name':_0x84cf('0x2e'),'userProfileId':_0x1bc15c[_0x84cf('0x54')]},'raw':!![]})['then'](function(_0x652356){if(_0x652356&&_0x652356['autoAssociation']===0x0){return db[_0x84cf('0x2f')]['create']({'name':_0x3912cb[_0x84cf('0x32')],'resourceId':_0x3912cb['id'],'type':_0x652356[_0x84cf('0x32')],'sectionId':_0x652356['id']},{})['then'](function(){return _0x33145e;});}else{return _0x33145e;}})[_0x84cf('0x55')](function(_0x448260){logger['error'](_0x84cf('0x56'),_0x448260);throw _0x448260;});}return _0x33145e;})['then'](respondWithResult(_0x5e4af1,null))['catch'](handleError(_0x5e4af1,null));};function Extension(_0x5cc371,_0x50cde2,_0x2007a6,_0x39394f){this[_0x84cf('0x57')]=_0x84cf('0x58');this['exten']=_0x5cc371;this[_0x84cf('0x59')]=_0x2007a6;this[_0x84cf('0x46')]='system';this[_0x84cf('0x5a')]=_0x84cf('0x5b');this[_0x84cf('0x5c')]=_0x50cde2;this[_0x84cf('0x5d')]=_0x39394f;}function createVoicePrefixExtensions(_0x2073f1,_0x273711,_0x1f1f76){return new BPromise(function(_0x39a336,_0x553ee2){var _0x155934=new Extension(formatPrefixName(_0x2073f1['prefix']),0x1,_0x84cf('0x5e'),_0x84cf('0x5f'));_0x155934[_0x84cf('0x60')]=_0x2073f1['id'];return db[_0x84cf('0x4f')][_0x84cf('0x4e')](_0x155934,{'transaction':_0x1f1f76})['then'](function(_0xfea0d2){var _0x41ee7a=_0xfea0d2[_0x84cf('0x2d')]({'plain':!![]});var _0x4ebb4b=_[_0x84cf('0x33')](addVoicePrefixExtensions(_0x2073f1,_0x273711),function(_0x240cca){_0x240cca['VoiceExtensionId']=_0x41ee7a['id'];_0x240cca[_0x84cf('0x60')]=_0x2073f1['id'];return _0x240cca;});return db['VoiceExtension'][_0x84cf('0x61')](_0x4ebb4b,{'transaction':_0x1f1f76})[_0x84cf('0x2b')](function(_0x57f1f2){if(!_0x57f1f2){return _0x553ee2(_0x84cf('0x62'));}else{return _0x39a336(_0x57f1f2);}})[_0x84cf('0x55')](function(_0x4a7905){return _0x553ee2(_0x4a7905);});});;});};function addVoicePrefixExtensions(_0x40b33e,_0x2ff1bb){var _0x262ae1=[];var _0x286769=formatPrefixName(_0x40b33e['prefix']);_0x262ae1[_0x84cf('0x63')](new Extension(_0x286769,0x2,_0x84cf('0x64'),'CDR(prefix)='+_0x40b33e['name']));if(_0x40b33e['callerIdAll']){_0x262ae1[_0x84cf('0x63')](new Extension(_0x286769,0x3,_0x84cf('0x64'),_0x84cf('0x65')+_0x40b33e['callerIdAll']));}else{_0x262ae1['push'](new Extension(_0x286769,0x3,_0x84cf('0x5e'),_0x84cf('0x66')));}_0x262ae1[_0x84cf('0x63')](new Extension(_0x286769,0x4,_0x84cf('0x67'),_0x2ff1bb[_0x84cf('0x57')]+','+_0x84cf('0x68')+(0x8+_0x40b33e[_0x84cf('0x32')][_0x84cf('0x3c')])+'}'+','+0x1));return _0x262ae1;}function formatPrefixName(_0x4a5e79){var _0x20b930='_';for(var _0x5350d9=0x0;_0x5350d9<_0x4a5e79[_0x84cf('0x3c')];_0x5350d9++){if(_0x4a5e79[_0x84cf('0x69')](_0x5350d9)=='-'){_0x20b930+=_0x4a5e79['charAt'](_0x5350d9);}else{_0x20b930+='['+_0x4a5e79['charAt'](_0x5350d9)+']';}}_0x20b930+='.';return _0x20b930;}exports[_0x84cf('0x2a')]=function(_0x31e622,_0x373a25,_0x1c6e56){var _0xad54e8=_0x31e622['body'];_0xad54e8[_0x84cf('0x6a')]=_0x84cf('0x6b')+_0xad54e8[_0x84cf('0x32')]+'-';return db[_0x84cf('0x6c')]['transaction'](function(_0x93d687){return db['VoicePrefix']['update'](_0xad54e8,{'where':{'id':_0xad54e8['id']},'transaction':_0x93d687})[_0x84cf('0x2b')](function(){return db[_0x84cf('0x4f')][_0x84cf('0x2c')]({'where':{'VoicePrefixId':_0xad54e8['id']},'transaction':_0x93d687})[_0x84cf('0x2b')](function(){return db['VoiceExtension']['find']({'where':{'id':_0xad54e8['VoiceExtensionId']},'raw':!![]})[_0x84cf('0x2b')](function(_0x53e61f){return createVoicePrefixExtensions(_0xad54e8,_0x53e61f,_0x93d687);});});});})[_0x84cf('0x2b')](function(){return db[_0x84cf('0x34')][_0x84cf('0x6d')](_0xad54e8['id']);})[_0x84cf('0x2b')](respondWithResult(_0x373a25,null))['catch'](handleError(_0x373a25,null));};exports[_0x84cf('0x6e')]=function(_0x14ac69,_0x4e1141,_0xa373e4){return db['VoicePrefix']['find']({'where':{'id':_0x14ac69[_0x84cf('0x4c')]['id']}})[_0x84cf('0x2b')](handleEntityNotFound(_0x4e1141,null))['then'](function(_0x5b95b7){if(_0x5b95b7){return _0x5b95b7[_0x84cf('0x6e')](_0x14ac69['body']['ids'],_['omit'](_0x14ac69[_0x84cf('0x6f')],[_0x84cf('0x70'),'id'])||{})[_0x84cf('0x71')](function(_0x58300f){for(var _0x49e6f6=0x0;_0x49e6f6<_0x14ac69[_0x84cf('0x6f')][_0x84cf('0x70')][_0x84cf('0x3c')];_0x49e6f6+=0x1){socket[_0x84cf('0x72')]('userVoicePrefix:save',{'UserId':Number(_0x14ac69['body']['ids'][_0x49e6f6]),'VoicePrefixId':Number(_0x14ac69[_0x84cf('0x4c')]['id'])});}return _0x58300f;});}})[_0x84cf('0x2b')](respondWithResult(_0x4e1141,null))[_0x84cf('0x55')](handleError(_0x4e1141,null));};exports['removeAgents']=function(_0x20693f,_0x29d062,_0x242e39){return db[_0x84cf('0x34')][_0x84cf('0x4b')]({'where':{'id':_0x20693f['params']['id']}})[_0x84cf('0x2b')](handleEntityNotFound(_0x29d062,null))[_0x84cf('0x2b')](function(_0xc32a6f){if(_0xc32a6f){return _0xc32a6f['removeAgents'](_0x20693f[_0x84cf('0x37')][_0x84cf('0x70')])['then'](function(){if(_[_0x84cf('0x73')](_0x20693f[_0x84cf('0x37')][_0x84cf('0x70')])){for(var _0x132210=0x0;_0x132210<_0x20693f['query']['ids'][_0x84cf('0x3c')];_0x132210+=0x1){socket[_0x84cf('0x72')]('userVoicePrefix:remove',{'UserId':Number(_0x20693f['query'][_0x84cf('0x70')][_0x132210]),'VoicePrefixId':Number(_0x20693f[_0x84cf('0x4c')]['id'])});}}else{socket[_0x84cf('0x72')](_0x84cf('0x74'),{'UserId':Number(_0x20693f[_0x84cf('0x37')][_0x84cf('0x70')]),'VoicePrefixId':Number(_0x20693f[_0x84cf('0x4c')]['id'])});}});}})[_0x84cf('0x2b')](respondWithStatusCode(_0x29d062,null))['catch'](handleError(_0x29d062,null));};exports[_0x84cf('0x75')]=function(_0x2323bc,_0x1f7ecd,_0xcb28b4){var _0x4fd3f1={};var _0x3bf924={};var _0x56ea7d;var _0x3ec503;return db['VoicePrefix'][_0x84cf('0x76')]({'where':{'id':_0x2323bc[_0x84cf('0x4c')]['id']}})[_0x84cf('0x2b')](handleEntityNotFound(_0x1f7ecd,null))[_0x84cf('0x2b')](function(_0xc4029f){if(_0xc4029f){_0x56ea7d=_0xc4029f;_0x3bf924['model']=_[_0x84cf('0x38')](db[_0x84cf('0x77')][_0x84cf('0x4a')]);_0x3bf924[_0x84cf('0x37')]=_[_0x84cf('0x38')](_0x2323bc[_0x84cf('0x37')]);_0x3bf924[_0x84cf('0x43')]=_[_0x84cf('0x39')](_0x3bf924[_0x84cf('0x3d')],_0x3bf924[_0x84cf('0x37')]);_0x4fd3f1[_0x84cf('0x3a')]=_[_0x84cf('0x39')](_0x3bf924[_0x84cf('0x3d')],qs[_0x84cf('0x3b')](_0x2323bc[_0x84cf('0x37')][_0x84cf('0x3b')]));_0x4fd3f1[_0x84cf('0x3a')]=_0x4fd3f1[_0x84cf('0x3a')]['length']?_0x4fd3f1['attributes']:_0x3bf924[_0x84cf('0x3d')];_0x4fd3f1['order']=qs[_0x84cf('0x41')](_0x2323bc[_0x84cf('0x37')]['sort']);_0x4fd3f1[_0x84cf('0x42')]=qs[_0x84cf('0x43')](_[_0x84cf('0x78')](_0x2323bc['query'],_0x3bf924[_0x84cf('0x43')]));if(_0x2323bc['query'][_0x84cf('0x44')]){_0x4fd3f1['where']=_[_0x84cf('0x45')](_0x4fd3f1[_0x84cf('0x42')],{'$or':_['map'](_0x4fd3f1[_0x84cf('0x3a')],function(_0x10e44b){var _0xe11402={};_0xe11402[_0x10e44b]={'$like':'%'+_0x2323bc['query'][_0x84cf('0x44')]+'%'};return _0xe11402;})});}_0x4fd3f1=_['merge']({},_0x4fd3f1,_0x2323bc[_0x84cf('0x47')]);return _0x56ea7d[_0x84cf('0x75')](_0x4fd3f1);}})[_0x84cf('0x2b')](function(_0xff46d2){if(_0xff46d2){_0x3ec503=_0xff46d2[_0x84cf('0x3c')];if(!_0x2323bc[_0x84cf('0x37')]['hasOwnProperty'](_0x84cf('0x3f'))){_0x4fd3f1[_0x84cf('0x25')]=qs[_0x84cf('0x25')](_0x2323bc[_0x84cf('0x37')][_0x84cf('0x25')]);_0x4fd3f1[_0x84cf('0x22')]=qs[_0x84cf('0x22')](_0x2323bc[_0x84cf('0x37')][_0x84cf('0x22')]);}return _0x56ea7d['getAgents'](_0x4fd3f1);}})[_0x84cf('0x2b')](function(_0x4dc17f){if(_0x4dc17f){return _0x4dc17f?{'count':_0x3ec503,'rows':_0x4dc17f}:null;}})['then'](respondWithResult(_0x1f7ecd,null))[_0x84cf('0x55')](handleError(_0x1f7ecd,null));};exports[_0x84cf('0x79')]=function(_0x55da82,_0xf14418,_0x1def45){var _0x13d30b={};var _0x4dad47={};var _0x3152c2;var _0x50e088;return db[_0x84cf('0x34')][_0x84cf('0x76')]({'where':{'id':_0x55da82[_0x84cf('0x4c')]['id']}})[_0x84cf('0x2b')](handleEntityNotFound(_0xf14418,null))[_0x84cf('0x2b')](function(_0x3b5f14){if(_0x3b5f14){_0x3152c2=_0x3b5f14;_0x4dad47['model']=_[_0x84cf('0x38')](db[_0x84cf('0x7a')][_0x84cf('0x4a')]);_0x4dad47[_0x84cf('0x37')]=_[_0x84cf('0x38')](_0x55da82[_0x84cf('0x37')]);_0x4dad47[_0x84cf('0x43')]=_[_0x84cf('0x39')](_0x4dad47[_0x84cf('0x3d')],_0x4dad47[_0x84cf('0x37')]);_0x13d30b['attributes']=_['intersection'](_0x4dad47[_0x84cf('0x3d')],qs['fields'](_0x55da82[_0x84cf('0x37')][_0x84cf('0x3b')]));_0x13d30b[_0x84cf('0x3a')]=_0x13d30b['attributes'][_0x84cf('0x3c')]?_0x13d30b[_0x84cf('0x3a')]:_0x4dad47[_0x84cf('0x3d')];_0x13d30b[_0x84cf('0x40')]=qs['sort'](_0x55da82['query'][_0x84cf('0x41')]);_0x13d30b[_0x84cf('0x42')]=qs[_0x84cf('0x43')](_[_0x84cf('0x78')](_0x55da82[_0x84cf('0x37')],_0x4dad47[_0x84cf('0x43')]));if(_0x55da82[_0x84cf('0x37')][_0x84cf('0x44')]){_0x13d30b[_0x84cf('0x42')]=_[_0x84cf('0x45')](_0x13d30b['where'],{'$or':_[_0x84cf('0x33')](_0x13d30b[_0x84cf('0x3a')],function(_0x543607){var _0x4e9be5={};_0x4e9be5[_0x543607]={'$like':'%'+_0x55da82[_0x84cf('0x37')][_0x84cf('0x44')]+'%'};return _0x4e9be5;})});}_0x13d30b=_[_0x84cf('0x45')]({},_0x13d30b,_0x55da82[_0x84cf('0x47')]);return _0x3152c2[_0x84cf('0x79')](_0x13d30b);}})['then'](function(_0x38e27d){if(_0x38e27d){_0x50e088=_0x38e27d[_0x84cf('0x3c')];if(!_0x55da82[_0x84cf('0x37')][_0x84cf('0x3e')](_0x84cf('0x3f'))){_0x13d30b[_0x84cf('0x25')]=qs['limit'](_0x55da82[_0x84cf('0x37')][_0x84cf('0x25')]);_0x13d30b['offset']=qs['offset'](_0x55da82[_0x84cf('0x37')]['offset']);}return _0x3152c2[_0x84cf('0x79')](_0x13d30b);}})['then'](function(_0x127ac0){if(_0x127ac0){return _0x127ac0?{'count':_0x50e088,'rows':_0x127ac0}:null;}})[_0x84cf('0x2b')](respondWithResult(_0xf14418,null))[_0x84cf('0x55')](handleError(_0xf14418,null));};exports['addTeams']=function(_0x2e145c,_0x15ed32,_0x265818){var _0x57c01b=_0x2e145c[_0x84cf('0x6f')][_0x84cf('0x70')];var _0x27492c;return db[_0x84cf('0x7a')][_0x84cf('0x7b')]({'where':{'id':_0x57c01b},'attributes':['id'],'include':[{'model':db['User'],'as':_0x84cf('0x7c'),'attributes':['id',_0x84cf('0x32'),'online',_0x84cf('0x7d'),_0x84cf('0x7e')],'raw':!![]}]})[_0x84cf('0x2b')](function(_0x188afd){if(_0x188afd){_0x27492c=_0x188afd;var _0x2d75f8=_[_0x84cf('0x7f')](_0x188afd,function(_0x5b9da4){var _0x8e16b4=_0x5b9da4[_0x84cf('0x2d')]({'plain':!![]});return _0x8e16b4[_0x84cf('0x7c')];});return db[_0x84cf('0x34')][_0x84cf('0x4b')]({'where':{'id':_0x2e145c[_0x84cf('0x4c')]['id']}})[_0x84cf('0x2b')](function(_0x1a083d){return db[_0x84cf('0x6c')][_0x84cf('0x80')](function(_0x5e41df){return _0x1a083d[_0x84cf('0x81')](_0x57c01b,{'transaction':_0x5e41df})[_0x84cf('0x2b')](function(){return BPromise[_0x84cf('0x82')](_0x27492c,function(_0x33fb10){return db[_0x84cf('0x83')][_0x84cf('0x84')]({'TeamId':_0x33fb10['id'],'VoicePrefixId':_0x2e145c['params']['id']},{'transaction':_0x5e41df});});})['then'](function(){return BPromise[_0x84cf('0x82')](_0x2d75f8,function(_0x166065){return db[_0x84cf('0x85')][_0x84cf('0x86')]({'where':{'UserId':_0x166065['id'],'VoicePrefixId':_0x2e145c[_0x84cf('0x4c')]['id']},'transaction':_0x5e41df});});})['then'](function(){_0x2d75f8[_0x84cf('0x87')](function(_0x4ce3ea){socket['emit']('userVoicePrefix:save',{'UserId':_0x4ce3ea['id'],'VoicePrefixId':_0x1a083d['id']});});});});});}})['then'](respondWithStatusCode(_0x15ed32,null))[_0x84cf('0x55')](handleError(_0x15ed32,null));};exports[_0x84cf('0x88')]=function(_0x5d6832,_0x502910,_0x311d7e){return db[_0x84cf('0x7a')][_0x84cf('0x7b')]({'where':{'id':_0x5d6832[_0x84cf('0x37')][_0x84cf('0x70')]},'attributes':['id'],'include':[{'model':db[_0x84cf('0x77')],'as':_0x84cf('0x7c'),'attributes':['id'],'raw':!![]}]})[_0x84cf('0x2b')](handleEntityNotFound(_0x502910,null))[_0x84cf('0x2b')](function(_0x2d17a1){var _0x5d0481=_[_0x84cf('0x33')](_0x2d17a1,'id');var _0x38c81a=[];var _0x4cb254=[];var _0x2aa96a=squel['select']();_0x2aa96a[_0x84cf('0x89')](_0x84cf('0x8a'))[_0x84cf('0x8b')]('team_has_voice_prefixes','tq')[_0x84cf('0x8c')]('user_has_teams','ut',_0x84cf('0x8d'))[_0x84cf('0x42')]('VoicePrefixId\x20=\x20?',_0x5d6832[_0x84cf('0x4c')]['id']);for(var _0x5b6ced=0x0;_0x5b6ced<_0x2d17a1[_0x84cf('0x3c')];_0x5b6ced+=0x1){let _0x202101=_0x2d17a1[_0x5b6ced];for(var _0x4b06c6=0x0;_0x4b06c6<_0x202101[_0x84cf('0x7c')][_0x84cf('0x3c')];_0x4b06c6+=0x1){let _0x3c05ec=_0x202101[_0x84cf('0x7c')][_0x4b06c6];var _0x145498=_0x2aa96a[_0x84cf('0x8e')]();_0x145498[_0x84cf('0x42')](_0x84cf('0x8f'),_0x3c05ec['id']);_0x4cb254[_0x84cf('0x63')](db[_0x84cf('0x6c')][_0x84cf('0x37')](_0x145498[_0x84cf('0x90')](),{'type':db['sequelize'][_0x84cf('0x91')][_0x84cf('0x92')]})[_0x84cf('0x2b')](function(_0x30b3c9){if(_0x30b3c9[_0x84cf('0x3c')]===0x1){return _0x3c05ec['id'];}else{var _0x562de5=_['every'](_['map'](_0x30b3c9,_0x84cf('0x93')),function(_0x55f411){return _[_0x84cf('0x94')](_0x5d0481,_0x55f411);});if(_0x562de5){return _0x3c05ec['id'];}}}));}}return BPromise[_0x84cf('0x95')](_0x4cb254)[_0x84cf('0x2b')](function(_0x5d4ece){_0x38c81a=_(_0x38c81a)[_0x84cf('0x96')](_0x5d4ece)[_0x84cf('0x97')]()[_0x84cf('0x98')]();return db['VoicePrefix']['find']({'where':{'id':_0x5d6832['params']['id']}})[_0x84cf('0x2b')](function(_0x399112){return db[_0x84cf('0x6c')][_0x84cf('0x80')](function(_0x209b79){return _0x399112['removeTeams'](_0x5d6832[_0x84cf('0x37')][_0x84cf('0x70')],{'transaction':_0x209b79})[_0x84cf('0x2b')](function(){if(!_['isEmpty'](_0x38c81a)){return _0x399112[_0x84cf('0x99')](_0x38c81a,{'transaction':_0x209b79});}})['then'](function(){_0x38c81a[_0x84cf('0x87')](function(_0x194267){socket[_0x84cf('0x72')](_0x84cf('0x74'),{'UserId':_0x194267,'VoicePrefixId':_0x399112['id']});});});});});});})['then'](respondWithStatusCode(_0x502910,null))[_0x84cf('0x55')](handleError(_0x502910,null));}; \ No newline at end of file +var _0x1775=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','VoicePrefixes','UserProfileResource','then','error','stack','name','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','params','keys','includeAll','include','describe','create','sequelize','body','VoiceExtension','find','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','appdata','prefix','NoOp','VoicePrefixId','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','transaction','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','User','getAgents','hasOwnProperty','nolimit','getTeams','Team','addTeams','Agents','online','voicePause','interface','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x2d3095,_0x1d4806){var _0x48efa4=function(_0x146ac2){while(--_0x146ac2){_0x2d3095['push'](_0x2d3095['shift']());}};_0x48efa4(++_0x1d4806);}(_0x1775,0x1db));var _0x5177=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1775[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5177('0x0'));var zipdir=require(_0x5177('0x1'));var jsonpatch=require(_0x5177('0x2'));var rp=require(_0x5177('0x3'));var moment=require(_0x5177('0x4'));var BPromise=require(_0x5177('0x5'));var Mustache=require(_0x5177('0x6'));var util=require(_0x5177('0x7'));var path=require(_0x5177('0x8'));var sox=require(_0x5177('0x9'));var csv=require(_0x5177('0xa'));var ejs=require(_0x5177('0xb'));var fs=require('fs');var fs_extra=require(_0x5177('0xc'));var _=require(_0x5177('0xd'));var squel=require(_0x5177('0xe'));var crypto=require(_0x5177('0xf'));var jsforce=require(_0x5177('0x10'));var deskjs=require(_0x5177('0x11'));var toCsv=require(_0x5177('0xa'));var querystring=require(_0x5177('0x12'));var Papa=require(_0x5177('0x13'));var Redis=require(_0x5177('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5177('0x15'));var hardwareService=require(_0x5177('0x16'));var logger=require(_0x5177('0x17'))(_0x5177('0x18'));var utils=require(_0x5177('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5177('0x1a'));var db=require(_0x5177('0x1b'))['db'];config[_0x5177('0x1c')]=_[_0x5177('0x1d')](config[_0x5177('0x1c')],{'host':_0x5177('0x1e'),'port':0x18eb});var socket=require(_0x5177('0x1f'))(new Redis(config[_0x5177('0x1c')]));require(_0x5177('0x20'))[_0x5177('0x21')](socket);function respondWithStatusCode(_0x41bef4,_0x2bf5bb){_0x2bf5bb=_0x2bf5bb||0xcc;return function(_0x29cd2c){if(_0x29cd2c){return _0x41bef4[_0x5177('0x22')](_0x2bf5bb);}return _0x41bef4[_0x5177('0x23')](_0x2bf5bb)[_0x5177('0x24')]();};}function respondWithResult(_0x2ab5e5,_0x7dba6f){_0x7dba6f=_0x7dba6f||0xc8;return function(_0xe6dcf6){if(_0xe6dcf6){return _0x2ab5e5['status'](_0x7dba6f)[_0x5177('0x25')](_0xe6dcf6);}};}function respondWithFilteredResult(_0x41e687,_0x3f5ab5){return function(_0x1b4102){if(_0x1b4102){var _0x5f5bd4=typeof _0x3f5ab5[_0x5177('0x26')]===_0x5177('0x27')&&typeof _0x3f5ab5[_0x5177('0x28')]==='undefined';var _0x86f5f8=_0x1b4102['count'];var _0xc2b2b5=_0x5f5bd4?0x0:_0x3f5ab5[_0x5177('0x26')];var _0x219744=_0x5f5bd4?_0x1b4102[_0x5177('0x29')]:_0x3f5ab5[_0x5177('0x26')]+_0x3f5ab5[_0x5177('0x28')];var _0x174c4f;if(_0x219744>=_0x86f5f8){_0x219744=_0x86f5f8;_0x174c4f=0xc8;}else{_0x174c4f=0xce;}_0x41e687[_0x5177('0x23')](_0x174c4f);return _0x41e687[_0x5177('0x2a')](_0x5177('0x2b'),_0xc2b2b5+'-'+_0x219744+'/'+_0x86f5f8)[_0x5177('0x25')](_0x1b4102);}return null;};}function patchUpdates(_0x3b0c37){return function(_0x5d9a9c){try{jsonpatch[_0x5177('0x2c')](_0x5d9a9c,_0x3b0c37,!![]);}catch(_0x556f96){return BPromise[_0x5177('0x2d')](_0x556f96);}return _0x5d9a9c[_0x5177('0x2e')]();};}function saveUpdates(_0x3b39b5,_0x2d51d0){return function(_0x4bc8e2){if(_0x4bc8e2){return _0x4bc8e2[_0x5177('0x2f')](_0x3b39b5)['then'](function(_0x564139){return _0x564139;});}return null;};}function removeEntity(_0x19a0c2,_0x15cb93){return function(_0x577bf7){if(_0x577bf7){return _0x577bf7[_0x5177('0x30')]()['then'](function(){var _0x231d35=_0x577bf7[_0x5177('0x31')]({'plain':!![]});var _0x58846c=_0x5177('0x32');return db[_0x5177('0x33')][_0x5177('0x30')]({'where':{'type':_0x58846c,'resourceId':_0x231d35['id']}})[_0x5177('0x34')](function(){return _0x577bf7;});})[_0x5177('0x34')](function(){_0x19a0c2[_0x5177('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x498fcd,_0x45cf20){return function(_0x1c660e){if(!_0x1c660e){_0x498fcd[_0x5177('0x22')](0x194);}return _0x1c660e;};}function handleError(_0x174f7a,_0x2e1985){_0x2e1985=_0x2e1985||0x1f4;return function(_0x8134f9){logger[_0x5177('0x35')](_0x8134f9[_0x5177('0x36')]);if(_0x8134f9['name']){delete _0x8134f9[_0x5177('0x37')];}_0x174f7a[_0x5177('0x23')](_0x2e1985)['send'](_0x8134f9);};}exports[_0x5177('0x38')]=function(_0x5e4c48,_0x172b36){var _0x1a2c46={},_0x1ba51c={},_0x5e2e5a={'count':0x0,'rows':[]};var _0x4f70df=_[_0x5177('0x39')](db[_0x5177('0x3a')][_0x5177('0x3b')],function(_0x3735e9){return{'name':_0x3735e9[_0x5177('0x3c')],'type':_0x3735e9[_0x5177('0x3d')][_0x5177('0x3e')]};});_0x1ba51c[_0x5177('0x3f')]=_['map'](_0x4f70df,_0x5177('0x37'));_0x1ba51c[_0x5177('0x40')]=_['keys'](_0x5e4c48[_0x5177('0x40')]);_0x1ba51c[_0x5177('0x41')]=_[_0x5177('0x42')](_0x1ba51c[_0x5177('0x3f')],_0x1ba51c[_0x5177('0x40')]);_0x1a2c46[_0x5177('0x43')]=_['intersection'](_0x1ba51c[_0x5177('0x3f')],qs[_0x5177('0x44')](_0x5e4c48[_0x5177('0x40')][_0x5177('0x44')]));_0x1a2c46[_0x5177('0x43')]=_0x1a2c46[_0x5177('0x43')][_0x5177('0x45')]?_0x1a2c46['attributes']:_0x1ba51c[_0x5177('0x3f')];if(!_0x5e4c48[_0x5177('0x40')]['hasOwnProperty']('nolimit')){_0x1a2c46[_0x5177('0x28')]=qs[_0x5177('0x28')](_0x5e4c48[_0x5177('0x40')][_0x5177('0x28')]);_0x1a2c46[_0x5177('0x26')]=qs[_0x5177('0x26')](_0x5e4c48[_0x5177('0x40')][_0x5177('0x26')]);}_0x1a2c46[_0x5177('0x46')]=qs[_0x5177('0x47')](_0x5e4c48[_0x5177('0x40')][_0x5177('0x47')]);_0x1a2c46[_0x5177('0x48')]=qs['filters'](_[_0x5177('0x49')](_0x5e4c48[_0x5177('0x40')],_0x1ba51c['filters']),_0x4f70df);if(_0x5e4c48[_0x5177('0x40')]['filter']){_0x1a2c46[_0x5177('0x48')]=_[_0x5177('0x4a')](_0x1a2c46[_0x5177('0x48')],{'$or':_['map'](_0x4f70df,function(_0x56eba4){if(_0x56eba4[_0x5177('0x3d')]!==_0x5177('0x4b')){var _0x1a149b={};_0x1a149b[_0x56eba4[_0x5177('0x37')]]={'$like':'%'+_0x5e4c48[_0x5177('0x40')][_0x5177('0x4c')]+'%'};return _0x1a149b;}})});}_0x1a2c46=_[_0x5177('0x4a')]({},_0x1a2c46,_0x5e4c48[_0x5177('0x4d')]);var _0x4e287e={'where':_0x1a2c46[_0x5177('0x48')]};return db['VoicePrefix']['count'](_0x4e287e)[_0x5177('0x34')](function(_0x17dc98){_0x5e2e5a['count']=_0x17dc98;if(_0x5e4c48[_0x5177('0x40')]['includeAll']){_0x1a2c46['include']=[{'all':!![]}];}return db[_0x5177('0x3a')][_0x5177('0x4e')](_0x1a2c46);})[_0x5177('0x34')](function(_0x3776b8){_0x5e2e5a[_0x5177('0x4f')]=_0x3776b8;return _0x5e2e5a;})[_0x5177('0x34')](respondWithFilteredResult(_0x172b36,_0x1a2c46))[_0x5177('0x50')](handleError(_0x172b36,null));};exports['show']=function(_0x5396cc,_0x12b70){var _0x511dc0={'raw':![],'where':{'id':_0x5396cc[_0x5177('0x51')]['id']}},_0x23be2a={};_0x23be2a[_0x5177('0x3f')]=_[_0x5177('0x52')](db['VoicePrefix'][_0x5177('0x3b')]);_0x23be2a[_0x5177('0x40')]=_[_0x5177('0x52')](_0x5396cc[_0x5177('0x40')]);_0x23be2a[_0x5177('0x41')]=_[_0x5177('0x42')](_0x23be2a[_0x5177('0x3f')],_0x23be2a[_0x5177('0x40')]);_0x511dc0[_0x5177('0x43')]=_[_0x5177('0x42')](_0x23be2a[_0x5177('0x3f')],qs['fields'](_0x5396cc[_0x5177('0x40')]['fields']));_0x511dc0['attributes']=_0x511dc0['attributes'][_0x5177('0x45')]?_0x511dc0[_0x5177('0x43')]:_0x23be2a['model'];if(_0x5396cc[_0x5177('0x40')][_0x5177('0x53')]){_0x511dc0[_0x5177('0x54')]=[{'all':!![]}];}_0x511dc0=_['merge']({},_0x511dc0,_0x5396cc[_0x5177('0x4d')]);return db['VoicePrefix']['find'](_0x511dc0)['then'](handleEntityNotFound(_0x12b70,null))[_0x5177('0x34')](respondWithResult(_0x12b70,null))[_0x5177('0x50')](handleError(_0x12b70,null));};exports[_0x5177('0x30')]=function(_0x5a1f8b,_0x4e53e4){return db[_0x5177('0x3a')]['find']({'where':{'id':_0x5a1f8b[_0x5177('0x51')]['id']}})[_0x5177('0x34')](handleEntityNotFound(_0x4e53e4,null))[_0x5177('0x34')](removeEntity(_0x4e53e4,null))[_0x5177('0x50')](handleError(_0x4e53e4,null));};exports[_0x5177('0x55')]=function(_0xa0edd7,_0x26bac0){return db[_0x5177('0x3a')][_0x5177('0x55')]()[_0x5177('0x34')](respondWithResult(_0x26bac0,null))[_0x5177('0x50')](handleError(_0x26bac0,null));};exports[_0x5177('0x56')]=function(_0x422d6c,_0x4c2068){var _0x59376b;return db[_0x5177('0x57')]['transaction'](function(_0x649c6f){return db['VoicePrefix'][_0x5177('0x56')](_0x422d6c[_0x5177('0x58')],{'transaction':_0x649c6f})[_0x5177('0x34')](function(_0x55a0b6){_0x59376b=_0x55a0b6['get']({'plain':!![]});return db[_0x5177('0x59')][_0x5177('0x5a')]({'where':{'id':_0x59376b[_0x5177('0x5b')]},'raw':!![]})[_0x5177('0x34')](function(_0x4a4758){return createVoicePrefixExtensions(_0x59376b,_0x4a4758,_0x649c6f);});});})['then'](function(){var _0x3f0e89=_0x422d6c[_0x5177('0x5c')][_0x5177('0x31')]({'plain':!![]});if(!_0x3f0e89)throw new Error(_0x5177('0x5d'));if(_0x3f0e89['role']===_0x5177('0x5c')){var _0x143aff=_0x59376b;return db[_0x5177('0x5e')]['find']({'where':{'name':_0x5177('0x32'),'userProfileId':_0x3f0e89[_0x5177('0x5f')]},'raw':!![]})[_0x5177('0x34')](function(_0x49e3e3){if(_0x49e3e3&&_0x49e3e3[_0x5177('0x60')]===0x0){return db['UserProfileResource'][_0x5177('0x56')]({'name':_0x143aff[_0x5177('0x37')],'resourceId':_0x143aff['id'],'type':_0x49e3e3[_0x5177('0x37')],'sectionId':_0x49e3e3['id']},{})['then'](function(){return _0x59376b;});}else{return _0x59376b;}})[_0x5177('0x50')](function(_0x161e03){logger[_0x5177('0x35')](_0x5177('0x61'),_0x161e03);throw _0x161e03;});}return _0x59376b;})[_0x5177('0x34')](respondWithResult(_0x4c2068,null))[_0x5177('0x50')](handleError(_0x4c2068,null));};function Extension(_0x37380c,_0x267599,_0x5ceed2,_0x5d96ce){this['context']=_0x5177('0x62');this[_0x5177('0x63')]=_0x37380c;this[_0x5177('0x64')]=_0x5ceed2;this[_0x5177('0x3d')]=_0x5177('0x65');this[_0x5177('0x66')]='Voice\x20Prefix\x20Extension';this['priority']=_0x267599;this[_0x5177('0x67')]=_0x5d96ce;}function createVoicePrefixExtensions(_0x23eb6e,_0x1f294e,_0x336017){return new BPromise(function(_0x123d40,_0x1b1778){var _0x2d1745=new Extension(formatPrefixName(_0x23eb6e[_0x5177('0x68')]),0x1,_0x5177('0x69'),'Voice\x20Prefix');_0x2d1745[_0x5177('0x6a')]=_0x23eb6e['id'];return db[_0x5177('0x59')]['create'](_0x2d1745,{'transaction':_0x336017})[_0x5177('0x34')](function(_0x4481b6){var _0x4edebc=_0x4481b6[_0x5177('0x31')]({'plain':!![]});var _0x2f3344=_[_0x5177('0x39')](addVoicePrefixExtensions(_0x23eb6e,_0x1f294e),function(_0x4be4b2){_0x4be4b2[_0x5177('0x5b')]=_0x4edebc['id'];_0x4be4b2[_0x5177('0x6a')]=_0x23eb6e['id'];return _0x4be4b2;});return db['VoiceExtension']['bulkCreate'](_0x2f3344,{'transaction':_0x336017})[_0x5177('0x34')](function(_0x4f76d7){if(!_0x4f76d7){return _0x1b1778(_0x5177('0x6b'));}else{return _0x123d40(_0x4f76d7);}})['catch'](function(_0x2771fa){return _0x1b1778(_0x2771fa);});});;});};function addVoicePrefixExtensions(_0x16f17c,_0x5a8ada){var _0x2af938=[];var _0x3b090d=formatPrefixName(_0x16f17c[_0x5177('0x68')]);_0x2af938[_0x5177('0x6c')](new Extension(_0x3b090d,0x2,_0x5177('0x6d'),_0x5177('0x6e')+_0x16f17c[_0x5177('0x37')]));if(_0x16f17c['callerIdAll']){_0x2af938[_0x5177('0x6c')](new Extension(_0x3b090d,0x3,'Set','PREFIX-CALLERIDALL='+_0x16f17c[_0x5177('0x6f')]));}else{_0x2af938[_0x5177('0x6c')](new Extension(_0x3b090d,0x3,'NoOp',_0x5177('0x70')));}_0x2af938[_0x5177('0x6c')](new Extension(_0x3b090d,0x4,_0x5177('0x71'),_0x5a8ada[_0x5177('0x72')]+','+_0x5177('0x73')+(0x8+_0x16f17c[_0x5177('0x37')][_0x5177('0x45')])+'}'+','+0x1));return _0x2af938;}function formatPrefixName(_0x3b26f4){var _0x478d5e='_';for(var _0x54b28f=0x0;_0x54b28f<_0x3b26f4[_0x5177('0x45')];_0x54b28f++){if(_0x3b26f4[_0x5177('0x74')](_0x54b28f)=='-'){_0x478d5e+=_0x3b26f4[_0x5177('0x74')](_0x54b28f);}else{_0x478d5e+='['+_0x3b26f4[_0x5177('0x74')](_0x54b28f)+']';}}_0x478d5e+='.';return _0x478d5e;}exports[_0x5177('0x2f')]=function(_0x3dd58f,_0x4fc289,_0x3692b2){var _0x397b75=_0x3dd58f[_0x5177('0x58')];_0x397b75[_0x5177('0x68')]='system-'+_0x397b75[_0x5177('0x37')]+'-';return db[_0x5177('0x57')][_0x5177('0x75')](function(_0x22da9d){return db[_0x5177('0x3a')]['update'](_0x397b75,{'where':{'id':_0x397b75['id']},'transaction':_0x22da9d})[_0x5177('0x34')](function(){return db['VoiceExtension'][_0x5177('0x30')]({'where':{'VoicePrefixId':_0x397b75['id']},'transaction':_0x22da9d})[_0x5177('0x34')](function(){return db['VoiceExtension'][_0x5177('0x5a')]({'where':{'id':_0x397b75[_0x5177('0x5b')]},'raw':!![]})[_0x5177('0x34')](function(_0x44ed82){return createVoicePrefixExtensions(_0x397b75,_0x44ed82,_0x22da9d);});});});})['then'](function(){return db[_0x5177('0x3a')][_0x5177('0x76')](_0x397b75['id']);})[_0x5177('0x34')](respondWithResult(_0x4fc289,null))[_0x5177('0x50')](handleError(_0x4fc289,null));};exports['addAgents']=function(_0x16b85b,_0x17456b,_0x3502dd){return db['VoicePrefix']['find']({'where':{'id':_0x16b85b[_0x5177('0x51')]['id']}})[_0x5177('0x34')](handleEntityNotFound(_0x17456b,null))[_0x5177('0x34')](function(_0x170e25){if(_0x170e25){return _0x170e25[_0x5177('0x77')](_0x16b85b[_0x5177('0x58')][_0x5177('0x78')],_[_0x5177('0x79')](_0x16b85b[_0x5177('0x58')],['ids','id'])||{})['spread'](function(_0x597a84){for(var _0x290315=0x0;_0x290315<_0x16b85b['body'][_0x5177('0x78')][_0x5177('0x45')];_0x290315+=0x1){socket[_0x5177('0x7a')](_0x5177('0x7b'),{'UserId':Number(_0x16b85b[_0x5177('0x58')]['ids'][_0x290315]),'VoicePrefixId':Number(_0x16b85b[_0x5177('0x51')]['id'])});}return _0x597a84;});}})[_0x5177('0x34')](respondWithResult(_0x17456b,null))[_0x5177('0x50')](handleError(_0x17456b,null));};exports['removeAgents']=function(_0x3d845e,_0x484762,_0x3d95df){return db[_0x5177('0x3a')]['find']({'where':{'id':_0x3d845e[_0x5177('0x51')]['id']}})[_0x5177('0x34')](handleEntityNotFound(_0x484762,null))['then'](function(_0x5f0141){if(_0x5f0141){return _0x5f0141[_0x5177('0x7c')](_0x3d845e['query'][_0x5177('0x78')])[_0x5177('0x34')](function(){if(_['isArray'](_0x3d845e[_0x5177('0x40')][_0x5177('0x78')])){for(var _0xcbbb73=0x0;_0xcbbb73<_0x3d845e[_0x5177('0x40')][_0x5177('0x78')][_0x5177('0x45')];_0xcbbb73+=0x1){socket[_0x5177('0x7a')](_0x5177('0x7d'),{'UserId':Number(_0x3d845e['query'][_0x5177('0x78')][_0xcbbb73]),'VoicePrefixId':Number(_0x3d845e['params']['id'])});}}else{socket[_0x5177('0x7a')](_0x5177('0x7d'),{'UserId':Number(_0x3d845e[_0x5177('0x40')][_0x5177('0x78')]),'VoicePrefixId':Number(_0x3d845e['params']['id'])});}});}})[_0x5177('0x34')](respondWithStatusCode(_0x484762,null))[_0x5177('0x50')](handleError(_0x484762,null));};exports['getAgents']=function(_0x17efe1,_0x30c2dc,_0x523012){var _0x33e1a6={};var _0x5f57bc={};var _0x3f1aad;var _0x558e04;return db['VoicePrefix']['findOne']({'where':{'id':_0x17efe1[_0x5177('0x51')]['id']}})[_0x5177('0x34')](handleEntityNotFound(_0x30c2dc,null))[_0x5177('0x34')](function(_0x516d0b){if(_0x516d0b){_0x3f1aad=_0x516d0b;_0x5f57bc[_0x5177('0x3f')]=_[_0x5177('0x52')](db[_0x5177('0x7e')][_0x5177('0x3b')]);_0x5f57bc[_0x5177('0x40')]=_['keys'](_0x17efe1[_0x5177('0x40')]);_0x5f57bc[_0x5177('0x41')]=_['intersection'](_0x5f57bc[_0x5177('0x3f')],_0x5f57bc['query']);_0x33e1a6[_0x5177('0x43')]=_['intersection'](_0x5f57bc[_0x5177('0x3f')],qs[_0x5177('0x44')](_0x17efe1[_0x5177('0x40')][_0x5177('0x44')]));_0x33e1a6[_0x5177('0x43')]=_0x33e1a6[_0x5177('0x43')]['length']?_0x33e1a6['attributes']:_0x5f57bc[_0x5177('0x3f')];_0x33e1a6[_0x5177('0x46')]=qs[_0x5177('0x47')](_0x17efe1['query'][_0x5177('0x47')]);_0x33e1a6[_0x5177('0x48')]=qs['filters'](_[_0x5177('0x49')](_0x17efe1['query'],_0x5f57bc[_0x5177('0x41')]));if(_0x17efe1[_0x5177('0x40')][_0x5177('0x4c')]){_0x33e1a6['where']=_[_0x5177('0x4a')](_0x33e1a6['where'],{'$or':_[_0x5177('0x39')](_0x33e1a6[_0x5177('0x43')],function(_0x5a40f1){var _0x5a8146={};_0x5a8146[_0x5a40f1]={'$like':'%'+_0x17efe1['query'][_0x5177('0x4c')]+'%'};return _0x5a8146;})});}_0x33e1a6=_['merge']({},_0x33e1a6,_0x17efe1[_0x5177('0x4d')]);return _0x3f1aad[_0x5177('0x7f')](_0x33e1a6);}})[_0x5177('0x34')](function(_0x57adf4){if(_0x57adf4){_0x558e04=_0x57adf4['length'];if(!_0x17efe1['query'][_0x5177('0x80')](_0x5177('0x81'))){_0x33e1a6[_0x5177('0x28')]=qs['limit'](_0x17efe1[_0x5177('0x40')][_0x5177('0x28')]);_0x33e1a6['offset']=qs[_0x5177('0x26')](_0x17efe1['query'][_0x5177('0x26')]);}return _0x3f1aad['getAgents'](_0x33e1a6);}})['then'](function(_0x5910a8){if(_0x5910a8){return _0x5910a8?{'count':_0x558e04,'rows':_0x5910a8}:null;}})[_0x5177('0x34')](respondWithResult(_0x30c2dc,null))['catch'](handleError(_0x30c2dc,null));};exports[_0x5177('0x82')]=function(_0x450c61,_0x1d351b,_0x1372ad){var _0x3b4cab={};var _0x197377={};var _0x580d34;var _0x1e76cf;return db[_0x5177('0x3a')]['findOne']({'where':{'id':_0x450c61[_0x5177('0x51')]['id']}})[_0x5177('0x34')](handleEntityNotFound(_0x1d351b,null))[_0x5177('0x34')](function(_0x51f7ce){if(_0x51f7ce){_0x580d34=_0x51f7ce;_0x197377['model']=_['keys'](db[_0x5177('0x83')][_0x5177('0x3b')]);_0x197377[_0x5177('0x40')]=_[_0x5177('0x52')](_0x450c61[_0x5177('0x40')]);_0x197377[_0x5177('0x41')]=_[_0x5177('0x42')](_0x197377[_0x5177('0x3f')],_0x197377[_0x5177('0x40')]);_0x3b4cab[_0x5177('0x43')]=_[_0x5177('0x42')](_0x197377[_0x5177('0x3f')],qs['fields'](_0x450c61[_0x5177('0x40')]['fields']));_0x3b4cab[_0x5177('0x43')]=_0x3b4cab[_0x5177('0x43')][_0x5177('0x45')]?_0x3b4cab['attributes']:_0x197377[_0x5177('0x3f')];_0x3b4cab[_0x5177('0x46')]=qs[_0x5177('0x47')](_0x450c61[_0x5177('0x40')][_0x5177('0x47')]);_0x3b4cab[_0x5177('0x48')]=qs[_0x5177('0x41')](_[_0x5177('0x49')](_0x450c61['query'],_0x197377['filters']));if(_0x450c61[_0x5177('0x40')]['filter']){_0x3b4cab[_0x5177('0x48')]=_[_0x5177('0x4a')](_0x3b4cab['where'],{'$or':_[_0x5177('0x39')](_0x3b4cab[_0x5177('0x43')],function(_0x54efd0){var _0x3e8a29={};_0x3e8a29[_0x54efd0]={'$like':'%'+_0x450c61[_0x5177('0x40')][_0x5177('0x4c')]+'%'};return _0x3e8a29;})});}_0x3b4cab=_[_0x5177('0x4a')]({},_0x3b4cab,_0x450c61[_0x5177('0x4d')]);return _0x580d34[_0x5177('0x82')](_0x3b4cab);}})[_0x5177('0x34')](function(_0x7a67fb){if(_0x7a67fb){_0x1e76cf=_0x7a67fb[_0x5177('0x45')];if(!_0x450c61[_0x5177('0x40')][_0x5177('0x80')](_0x5177('0x81'))){_0x3b4cab[_0x5177('0x28')]=qs['limit'](_0x450c61[_0x5177('0x40')][_0x5177('0x28')]);_0x3b4cab[_0x5177('0x26')]=qs['offset'](_0x450c61[_0x5177('0x40')][_0x5177('0x26')]);}return _0x580d34['getTeams'](_0x3b4cab);}})[_0x5177('0x34')](function(_0x5cbc48){if(_0x5cbc48){return _0x5cbc48?{'count':_0x1e76cf,'rows':_0x5cbc48}:null;}})['then'](respondWithResult(_0x1d351b,null))[_0x5177('0x50')](handleError(_0x1d351b,null));};exports[_0x5177('0x84')]=function(_0xd8f8f3,_0x40ded0,_0x356874){var _0x219a7c=_0xd8f8f3['body'][_0x5177('0x78')];var _0xcb831c;return db['Team'][_0x5177('0x4e')]({'where':{'id':_0x219a7c},'attributes':['id'],'include':[{'model':db[_0x5177('0x7e')],'as':_0x5177('0x85'),'attributes':['id',_0x5177('0x37'),_0x5177('0x86'),_0x5177('0x87'),_0x5177('0x88')],'raw':!![]}]})[_0x5177('0x34')](function(_0x4e60b2){if(_0x4e60b2){_0xcb831c=_0x4e60b2;var _0x193dbf=_['flatMap'](_0x4e60b2,function(_0xecd419){var _0x4970b3=_0xecd419[_0x5177('0x31')]({'plain':!![]});return _0x4970b3[_0x5177('0x85')];});return db[_0x5177('0x3a')][_0x5177('0x5a')]({'where':{'id':_0xd8f8f3['params']['id']}})[_0x5177('0x34')](function(_0x1b7c52){return db[_0x5177('0x57')][_0x5177('0x75')](function(_0x4e8c0c){return _0x1b7c52['addTeams'](_0x219a7c,{'transaction':_0x4e8c0c})['then'](function(){return BPromise['each'](_0xcb831c,function(_0xaafc9f){return db['TeamVoicePrefix'][_0x5177('0x89')]({'TeamId':_0xaafc9f['id'],'VoicePrefixId':_0xd8f8f3['params']['id']},{'transaction':_0x4e8c0c});});})[_0x5177('0x34')](function(){return BPromise['each'](_0x193dbf,function(_0x384af7){return db[_0x5177('0x8a')][_0x5177('0x8b')]({'where':{'UserId':_0x384af7['id'],'VoicePrefixId':_0xd8f8f3[_0x5177('0x51')]['id']},'transaction':_0x4e8c0c});});})[_0x5177('0x34')](function(){_0x193dbf[_0x5177('0x8c')](function(_0x3a9c65){socket[_0x5177('0x7a')](_0x5177('0x7b'),{'UserId':_0x3a9c65['id'],'VoicePrefixId':_0x1b7c52['id']});});});});});}})[_0x5177('0x34')](respondWithStatusCode(_0x40ded0,null))['catch'](handleError(_0x40ded0,null));};exports[_0x5177('0x8d')]=function(_0x13fa90,_0x3475c3,_0x5ed46a){return db[_0x5177('0x83')][_0x5177('0x4e')]({'where':{'id':_0x13fa90[_0x5177('0x40')][_0x5177('0x78')]},'attributes':['id'],'include':[{'model':db[_0x5177('0x7e')],'as':_0x5177('0x85'),'attributes':['id'],'raw':!![]}]})[_0x5177('0x34')](handleEntityNotFound(_0x3475c3,null))[_0x5177('0x34')](function(_0xb8f7de){var _0x1bc4cb=_[_0x5177('0x39')](_0xb8f7de,'id');var _0x4d29b7=[];var _0x1f8c26=[];var _0x365b68=squel[_0x5177('0x8e')]();_0x365b68['field'](_0x5177('0x8f'))[_0x5177('0x90')]('team_has_voice_prefixes','tq')[_0x5177('0x91')](_0x5177('0x92'),'ut',_0x5177('0x93'))['where'](_0x5177('0x94'),_0x13fa90[_0x5177('0x51')]['id']);for(var _0x3b8c79=0x0;_0x3b8c79<_0xb8f7de[_0x5177('0x45')];_0x3b8c79+=0x1){let _0x2a16ed=_0xb8f7de[_0x3b8c79];for(var _0x5d1909=0x0;_0x5d1909<_0x2a16ed['Agents'][_0x5177('0x45')];_0x5d1909+=0x1){let _0x61ead2=_0x2a16ed['Agents'][_0x5d1909];var _0x2ffb25=_0x365b68[_0x5177('0x95')]();_0x2ffb25['where'](_0x5177('0x96'),_0x61ead2['id']);_0x1f8c26[_0x5177('0x6c')](db['sequelize']['query'](_0x2ffb25[_0x5177('0x97')](),{'type':db['sequelize']['QueryTypes'][_0x5177('0x98')]})[_0x5177('0x34')](function(_0x58170f){if(_0x58170f[_0x5177('0x45')]===0x1){return _0x61ead2['id'];}else{var _0xdc5504=_[_0x5177('0x99')](_[_0x5177('0x39')](_0x58170f,_0x5177('0x9a')),function(_0x2fa026){return _['includes'](_0x1bc4cb,_0x2fa026);});if(_0xdc5504){return _0x61ead2['id'];}}}));}}return BPromise[_0x5177('0x9b')](_0x1f8c26)['then'](function(_0x55e914){_0x4d29b7=_(_0x4d29b7)[_0x5177('0x9c')](_0x55e914)[_0x5177('0x9d')]()[_0x5177('0x9e')]();return db['VoicePrefix'][_0x5177('0x5a')]({'where':{'id':_0x13fa90[_0x5177('0x51')]['id']}})[_0x5177('0x34')](function(_0x3873ca){return db[_0x5177('0x57')][_0x5177('0x75')](function(_0x10698d){return _0x3873ca[_0x5177('0x8d')](_0x13fa90[_0x5177('0x40')][_0x5177('0x78')],{'transaction':_0x10698d})[_0x5177('0x34')](function(){if(!_[_0x5177('0x9f')](_0x4d29b7)){return _0x3873ca['removeAgents'](_0x4d29b7,{'transaction':_0x10698d});}})[_0x5177('0x34')](function(){_0x4d29b7[_0x5177('0x8c')](function(_0x38f0f4){socket[_0x5177('0x7a')]('userVoicePrefix:remove',{'UserId':_0x38f0f4,'VoicePrefixId':_0x3873ca['id']});});});});});});})['then'](respondWithStatusCode(_0x3475c3,null))['catch'](handleError(_0x3475c3,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 346239a..64cef51 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 _0x6c3e=['exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2971b5,_0x56ff55){var _0x5f0f88=function(_0x246739){while(--_0x246739){_0x2971b5['push'](_0x2971b5['shift']());}};_0x5f0f88(++_0x56ff55);}(_0x6c3e,0x19f));var _0xe6c3=function(_0x170919,_0x176c39){_0x170919=_0x170919-0x0;var _0x5d97e4=_0x6c3e[_0x170919];return _0x5d97e4;};'use strict';var EventEmitter=require(_0xe6c3('0x0'));var VoicePrefix=require(_0xe6c3('0x1'))['db'][_0xe6c3('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xe6c3('0x3')](0x0);var events={'afterCreate':_0xe6c3('0x4'),'afterUpdate':_0xe6c3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x380ff0){return function(_0x576082,_0x526739,_0x5b55c6){VoicePrefixEvents[_0xe6c3('0x6')](_0x380ff0+':'+_0x576082['id'],_0x576082);VoicePrefixEvents[_0xe6c3('0x6')](_0x380ff0,_0x576082);_0x5b55c6(null);};}for(var e in events){if(events[_0xe6c3('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xe6c3('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x829d=['remove','emit','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x2a2069,_0xb5f258){var _0x4b8f9a=function(_0x106595){while(--_0x106595){_0x2a2069['push'](_0x2a2069['shift']());}};_0x4b8f9a(++_0xb5f258);}(_0x829d,0x1e4));var _0xd829=function(_0x596def,_0x432257){_0x596def=_0x596def-0x0;var _0x3e382c=_0x829d[_0x596def];return _0x3e382c;};'use strict';var EventEmitter=require(_0xd829('0x0'));var VoicePrefix=require(_0xd829('0x1'))['db'][_0xd829('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xd829('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd829('0x4')};function emitEvent(_0x240f25){return function(_0x347c0f,_0x38f261,_0x4f1fa7){VoicePrefixEvents['emit'](_0x240f25+':'+_0x347c0f['id'],_0x347c0f);VoicePrefixEvents[_0xd829('0x5')](_0x240f25,_0x347c0f);_0x4f1fa7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xd829('0x6')](e,emitEvent(event));}}module[_0xd829('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 25a2f64..14dfe75 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 _0x10ab=['voice_prefixes','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','VoicePrefix'];(function(_0x4f893f,_0x2d4c83){var _0x1a8fd3=function(_0x56652d){while(--_0x56652d){_0x4f893f['push'](_0x4f893f['shift']());}};_0x1a8fd3(++_0x2d4c83);}(_0x10ab,0x1e5));var _0xb10a=function(_0x1e6db1,_0xb90700){_0x1e6db1=_0x1e6db1-0x0;var _0x55e924=_0x10ab[_0x1e6db1];return _0x55e924;};'use strict';var _=require('lodash');var util=require(_0xb10a('0x0'));var logger=require(_0xb10a('0x1'))('api');var moment=require(_0xb10a('0x2'));var BPromise=require(_0xb10a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb10a('0x4'));var rimraf=require(_0xb10a('0x5'));var config=require(_0xb10a('0x6'));var attributes=require('./voicePrefix.attributes');module[_0xb10a('0x7')]=function(_0x4b619d,_0x4d69ab){return _0x4b619d[_0xb10a('0x8')](_0xb10a('0x9'),attributes,{'tableName':_0xb10a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe809=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','voice_prefixes','lodash','util'];(function(_0xd942c6,_0x57e645){var _0x430f21=function(_0x34a8c4){while(--_0x34a8c4){_0xd942c6['push'](_0xd942c6['shift']());}};_0x430f21(++_0x57e645);}(_0xe809,0xca));var _0x9e80=function(_0x2a43a0,_0xace59f){_0x2a43a0=_0x2a43a0-0x0;var _0x2b4877=_0xe809[_0x2a43a0];return _0x2b4877;};'use strict';var _=require(_0x9e80('0x0'));var util=require(_0x9e80('0x1'));var logger=require(_0x9e80('0x2'))(_0x9e80('0x3'));var moment=require(_0x9e80('0x4'));var BPromise=require(_0x9e80('0x5'));var rp=require(_0x9e80('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9e80('0x7'));var config=require(_0x9e80('0x8'));var attributes=require('./voicePrefix.attributes');module[_0x9e80('0x9')]=function(_0x574994,_0x9e9fa2){return _0x574994[_0x9e80('0xa')]('VoicePrefix',attributes,{'tableName':_0x9e80('0xb'),'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 8921dcf..77b02f0 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 _0x753c=['then','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register'];(function(_0x236db9,_0x33234c){var _0x243279=function(_0x14d1b9){while(--_0x14d1b9){_0x236db9['push'](_0x236db9['shift']());}};_0x243279(++_0x33234c);}(_0x753c,0x96));var _0xc753=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x753c[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xc753('0x0'));var moment=require('moment');var BPromise=require(_0xc753('0x1'));var rs=require(_0xc753('0x2'));var fs=require('fs');var Redis=require(_0xc753('0x3'));var db=require(_0xc753('0x4'))['db'];var utils=require(_0xc753('0x5'));var logger=require(_0xc753('0x6'))(_0xc753('0x7'));var config=require(_0xc753('0x8'));var jayson=require(_0xc753('0x9'));var client=jayson[_0xc753('0xa')][_0xc753('0xb')]({'port':0x232a});config[_0xc753('0xc')]=_[_0xc753('0xd')](config[_0xc753('0xc')],{'host':_0xc753('0xe'),'port':0x18eb});var socket=require(_0xc753('0xf'))(new Redis(config[_0xc753('0xc')]));require(_0xc753('0x10'))[_0xc753('0x11')](socket);function respondWithRpcPromise(_0x12c8bb,_0x1fe61c,_0x26cebf){return new BPromise(function(_0x358393,_0xed0fdd){return client['request'](_0x12c8bb,_0x26cebf)[_0xc753('0x12')](function(_0x366591){logger['info'](_0xc753('0x13'),_0x1fe61c,'request\x20sent');logger[_0xc753('0x14')](_0xc753('0x15'),_0x1fe61c,_0xc753('0x16'),JSON['stringify'](_0x366591));if(_0x366591[_0xc753('0x17')]){if(_0x366591['error'][_0xc753('0x18')]===0x1f4){logger['error'](_0xc753('0x13'),_0x1fe61c,_0x366591[_0xc753('0x17')][_0xc753('0x19')]);return _0xed0fdd(_0x366591[_0xc753('0x17')][_0xc753('0x19')]);}logger['error'](_0xc753('0x13'),_0x1fe61c,_0x366591[_0xc753('0x17')][_0xc753('0x19')]);return _0x358393(_0x366591[_0xc753('0x17')][_0xc753('0x19')]);}else{logger[_0xc753('0x1a')](_0xc753('0x13'),_0x1fe61c,_0xc753('0x16'));_0x358393(_0x366591['result'][_0xc753('0x19')]);}})[_0xc753('0x1b')](function(_0x367c39){logger[_0xc753('0x17')](_0xc753('0x13'),_0x1fe61c,_0x367c39);_0xed0fdd(_0x367c39);});});} \ No newline at end of file +var _0x672a=['then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request'];(function(_0x56cdff,_0x33eab2){var _0x93c557=function(_0x20f590){while(--_0x20f590){_0x56cdff['push'](_0x56cdff['shift']());}};_0x93c557(++_0x33eab2);}(_0x672a,0x122));var _0xa672=function(_0x1c9ffa,_0x4fd275){_0x1c9ffa=_0x1c9ffa-0x0;var _0xd94b95=_0x672a[_0x1c9ffa];return _0xd94b95;};'use strict';var _=require(_0xa672('0x0'));var util=require(_0xa672('0x1'));var moment=require(_0xa672('0x2'));var BPromise=require(_0xa672('0x3'));var rs=require(_0xa672('0x4'));var fs=require('fs');var Redis=require(_0xa672('0x5'));var db=require(_0xa672('0x6'))['db'];var utils=require(_0xa672('0x7'));var logger=require(_0xa672('0x8'))(_0xa672('0x9'));var config=require(_0xa672('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa672('0xb')][_0xa672('0xc')]({'port':0x232a});config[_0xa672('0xd')]=_[_0xa672('0xe')](config[_0xa672('0xd')],{'host':_0xa672('0xf'),'port':0x18eb});var socket=require(_0xa672('0x10'))(new Redis(config[_0xa672('0xd')]));require(_0xa672('0x11'))[_0xa672('0x12')](socket);function respondWithRpcPromise(_0x215c43,_0x2f2b63,_0x2c1de6){return new BPromise(function(_0x351025,_0x5ae63c){return client[_0xa672('0x13')](_0x215c43,_0x2c1de6)[_0xa672('0x14')](function(_0x59fd41){logger[_0xa672('0x15')](_0xa672('0x16'),_0x2f2b63,_0xa672('0x17'));logger[_0xa672('0x18')](_0xa672('0x19'),_0x2f2b63,_0xa672('0x17'),JSON[_0xa672('0x1a')](_0x59fd41));if(_0x59fd41[_0xa672('0x1b')]){if(_0x59fd41[_0xa672('0x1b')]['code']===0x1f4){logger[_0xa672('0x1b')](_0xa672('0x16'),_0x2f2b63,_0x59fd41['error']['message']);return _0x5ae63c(_0x59fd41[_0xa672('0x1b')]['message']);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x2f2b63,_0x59fd41[_0xa672('0x1b')]['message']);return _0x351025(_0x59fd41['error'][_0xa672('0x1c')]);}else{logger[_0xa672('0x15')](_0xa672('0x16'),_0x2f2b63,_0xa672('0x17'));_0x351025(_0x59fd41[_0xa672('0x1d')][_0xa672('0x1c')]);}})[_0xa672('0x1e')](function(_0x21817d){logger[_0xa672('0x1b')](_0xa672('0x16'),_0x2f2b63,_0x21817d);_0x5ae63c(_0x21817d);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index cd74970..9fc7ae8 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 _0xa446=['register','voicePrefix:','./voicePrefix.events','save','update','emit','removeListener'];(function(_0x23b106,_0x50acec){var _0x3c88e5=function(_0x1fcb42){while(--_0x1fcb42){_0x23b106['push'](_0x23b106['shift']());}};_0x3c88e5(++_0x50acec);}(_0xa446,0xc6));var _0x6a44=function(_0x5b48af,_0x190918){_0x5b48af=_0x5b48af-0x0;var _0x138e1f=_0xa446[_0x5b48af];return _0x138e1f;};'use strict';var VoicePrefixEvents=require(_0x6a44('0x0'));var events=[_0x6a44('0x1'),'remove',_0x6a44('0x2')];function createListener(_0x549473,_0x45c6e2){return function(_0x4c400a){_0x45c6e2[_0x6a44('0x3')](_0x549473,_0x4c400a);};}function removeListener(_0x4f4586,_0x3a8c6f){return function(){VoicePrefixEvents[_0x6a44('0x4')](_0x4f4586,_0x3a8c6f);};}exports[_0x6a44('0x5')]=function(_0x1bcc30){for(var _0x1fc85d=0x0,_0x417c8c=events['length'];_0x1fc85d<_0x417c8c;_0x1fc85d++){var _0x1569ec=events[_0x1fc85d];var _0x36a426=createListener(_0x6a44('0x6')+_0x1569ec,_0x1bcc30);VoicePrefixEvents['on'](_0x1569ec,_0x36a426);}}; \ No newline at end of file +var _0x41bb=['save','update','emit','removeListener','register','./voicePrefix.events'];(function(_0x3149a9,_0x471df5){var _0x3b63b3=function(_0x240756){while(--_0x240756){_0x3149a9['push'](_0x3149a9['shift']());}};_0x3b63b3(++_0x471df5);}(_0x41bb,0xc5));var _0xb41b=function(_0x430b47,_0x4c0b51){_0x430b47=_0x430b47-0x0;var _0xdc5277=_0x41bb[_0x430b47];return _0xdc5277;};'use strict';var VoicePrefixEvents=require(_0xb41b('0x0'));var events=[_0xb41b('0x1'),'remove',_0xb41b('0x2')];function createListener(_0x4d5578,_0x30ea75){return function(_0x1c9d36){_0x30ea75[_0xb41b('0x3')](_0x4d5578,_0x1c9d36);};}function removeListener(_0x448c8e,_0x4ee21b){return function(){VoicePrefixEvents[_0xb41b('0x4')](_0x448c8e,_0x4ee21b);};}exports[_0xb41b('0x5')]=function(_0x2dbaa3){for(var _0x50bc62=0x0,_0x5455ce=events['length'];_0x50bc62<_0x5455ce;_0x50bc62++){var _0x2704f0=events[_0x50bc62];var _0x29c30d=createListener('voicePrefix:'+_0x2704f0,_0x2dbaa3);VoicePrefixEvents['on'](_0x2704f0,_0x29c30d);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index f157160..bb9bdb7 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(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0xb10b,0x12a));var _0xbb10=function(_0x5a5aca,_0x368fbb){_0x5a5aca=_0x5a5aca-0x0;var _0x1cb523=_0xb10b[_0x5a5aca];return _0x1cb523;};'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(_0x1bf4bb,_0x435c71){var _0xf6c59a=function(_0x1baf3c){while(--_0x1baf3c){_0x1bf4bb['push'](_0x1bf4bb['shift']());}};_0xf6c59a(++_0x435c71);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 40f6488..e1fe59b 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 _0xb5e6=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','inbound','outbound','default','ENUM','ringall','leastrecent','fewestcalls','random','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','preview','booked','roundrobin','includes','INTEGER','yes','once','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','progressive','predictive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\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','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','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)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb5e6,0x109));var _0x6b5e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb5e6[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6b5e('0x0')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x6b5e('0x1'),_0x6b5e('0x2')),'allowNull':![],'defaultValue':_0x6b5e('0x1')},'musiconhold':{'type':Sequelize[_0x6b5e('0x0')],'defaultValue':_0x6b5e('0x3')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x6b5e('0x4')]('rr',_0x6b5e('0x5'),_0x6b5e('0x6'),_0x6b5e('0x7'),_0x6b5e('0x8'),'rrmemory',_0x6b5e('0x9'),_0x6b5e('0xa'),_0x6b5e('0xb')),'allowNull':![],'defaultValue':_0x6b5e('0x5'),'set':function(_0xc8764d){this[_0x6b5e('0xc')](_0x6b5e('0xd'),_0xc8764d?_0xc8764d:_0x6b5e('0xe'));},'get':function(){var _0x53cde7=this[_0x6b5e('0xf')](_0x6b5e('0x10'));var _0x3afa17=this[_0x6b5e('0xf')](_0x6b5e('0x11'));var _0x590263=this[_0x6b5e('0xf')](_0x6b5e('0xd'));if(_0x53cde7==='outbound'){if(_0x3afa17===_0x6b5e('0x12')){return null;}if(_0x3afa17===_0x6b5e('0x13')&&![_0x6b5e('0xe'),_0x6b5e('0x14')][_0x6b5e('0x15')](_0x590263)){this['setDataValue'](_0x6b5e('0xd'),_0x6b5e('0xe'));}}return _0x590263;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x6b5e('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x6b5e('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x6b5e('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x6b5e('0x0')]},'weight':{'type':Sequelize[_0x6b5e('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x6b5e('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x6b5e('0x17'),'no'),'defaultValue':_0x6b5e('0x17')},'autopause':{'type':Sequelize[_0x6b5e('0x4')](_0x6b5e('0x17'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x6b5e('0x4')](_0x6b5e('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x6b5e('0x4')](_0x6b5e('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x6b5e('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x6b5e('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x6b5e('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x6b5e('0x4')](_0x6b5e('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x6b5e('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x6b5e('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x6b5e('0x0')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x6b5e('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x6b5e('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x6b5e('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x6b5e('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x6b5e('0x4')](_0x6b5e('0x17'),'no'),'defaultValue':_0x6b5e('0x17')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x6b5e('0x17'),'no',_0x6b5e('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x6b5e('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x6b5e('0x4')](_0x6b5e('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x6b5e('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x6b5e('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x6b5e('0x0')]},'queue_youarenext':{'type':Sequelize[_0x6b5e('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x6b5e('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x6b5e('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x6b5e('0x0')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x6b5e('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x6b5e('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x6b5e('0x0')]},'queue_quantity1':{'type':Sequelize[_0x6b5e('0x0')]},'queue_quantity2':{'type':Sequelize[_0x6b5e('0x0')]},'queue_periodic_announce':{'type':Sequelize[_0x6b5e('0x0')]},'queue_less_than':{'type':Sequelize[_0x6b5e('0x0')]},'periodic_announce':{'type':Sequelize[_0x6b5e('0x19')],'set':function(_0x275b55){this['setDataValue']('periodic_announce',_0x275b55?_0x275b55[_0x6b5e('0x1a')](','):[]);},'get':function(){return this['getDataValue'](_0x6b5e('0x1b'))?this['getDataValue'](_0x6b5e('0x1b'))[_0x6b5e('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x6b5e('0x0')],'defaultValue':_0x6b5e('0x17'),'set':function(_0x58577c){this['setDataValue'](_0x6b5e('0x1d'),_0x58577c?_0x58577c['join'](','):undefined);},'get':function(){return this[_0x6b5e('0xf')]('joinempty')?this['getDataValue'](_0x6b5e('0x1d'))[_0x6b5e('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x6b5e('0x0')],'defaultValue':'no','set':function(_0x27ca19){this[_0x6b5e('0xc')]('leavewhenempty',_0x27ca19?_0x27ca19[_0x6b5e('0x1a')](','):undefined);},'get':function(){return this[_0x6b5e('0xf')](_0x6b5e('0x1e'))?this['getDataValue']('leavewhenempty')[_0x6b5e('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x6b5e('0x4')](_0x6b5e('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x6b5e('0x4')](_0x6b5e('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x6b5e('0x0')]},'description':{'type':Sequelize[_0x6b5e('0x0')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x5aaed8){this['setDataValue'](_0x6b5e('0x1f'),_0x5aaed8);if(_0x5aaed8){if(this[_0x6b5e('0xf')]('wrapuptime')<0x2){this['setDataValue'](_0x6b5e('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x6b5e('0x21')],'defaultValue':0x0,'comment':_0x6b5e('0x22')},'dialMethod':{'type':Sequelize[_0x6b5e('0x4')](_0x6b5e('0x12'),_0x6b5e('0x23'),'power',_0x6b5e('0x24'),_0x6b5e('0x13')),'defaultValue':'progressive','comment':_0x6b5e('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x6b5e('0x26')},'dialLimitQueue':{'type':Sequelize[_0x6b5e('0x16')](0x4)[_0x6b5e('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x6b5e('0x28')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x6b5e('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x6b5e('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x6b5e('0x4')](_0x6b5e('0x2a'),_0x6b5e('0x2b')),'defaultValue':'dropRate','comment':_0x6b5e('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x6b5e('0x2d')](0x2)[_0x6b5e('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x6b5e('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x6b5e('0x16')](0x3)[_0x6b5e('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x6b5e('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize[_0x6b5e('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6b5e('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0x6b5e('0x16')](0x3)[_0x6b5e('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b5e('0x30')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':_0x6b5e('0x31')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x6b5e('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x6b5e('0x32')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6b5e('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b5e('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6b5e('0x16')](0x5)[_0x6b5e('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b5e('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0x6b5e('0x16')](0x3)[_0x6b5e('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b5e('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0x6b5e('0x16')](0x5)[_0x6b5e('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b5e('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6b5e('0x27')],'defaultValue':0x3,'comment':_0x6b5e('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6b5e('0x16')](0x5)[_0x6b5e('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b5e('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0x6b5e('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x6b5e('0x39')},'dialTimezone':{'type':Sequelize[_0x6b5e('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6b5e('0x0')],'defaultValue':_0x6b5e('0x3a')},'dialPrefix':{'type':Sequelize[_0x6b5e('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x6b5e('0x3b'),_0x6b5e('0x3c'),_0x6b5e('0x3d')),'defaultValue':_0x6b5e('0x3b')},'dialAMDActive':{'type':Sequelize[_0x6b5e('0x21')],'defaultValue':0x0,'comment':_0x6b5e('0x3e')},'dialAMDInitialSilence':{'type':Sequelize[_0x6b5e('0x16')](0x9)[_0x6b5e('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x6b5e('0x3f')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x6b5e('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x6b5e('0x40')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6b5e('0x16')](0x9)[_0x6b5e('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6b5e('0x41')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x6b5e('0x16')](0x9)[_0x6b5e('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x6b5e('0x16')](0x9)[_0x6b5e('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x6b5e('0x42')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x6b5e('0x16')](0x9)[_0x6b5e('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6b5e('0x43')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x6b5e('0x16')](0x9)[_0x6b5e('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x6b5e('0x44')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6b5e('0x16')](0x5)[_0x6b5e('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x6b5e('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6b5e('0x45')},'dialRecallMeTimeout':{'type':Sequelize[_0x6b5e('0x16')](0x5)[_0x6b5e('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x6b5e('0x46')},'dialRecallInQueue':{'type':Sequelize[_0x6b5e('0x21')],'defaultValue':0x0,'comment':_0x6b5e('0x47')},'dialOrderByScheduledAt':{'type':Sequelize[_0x6b5e('0x4')]('DESC',_0x6b5e('0x48')),'defaultValue':_0x6b5e('0x49')},'dialQueueProject2':{'type':Sequelize[_0x6b5e('0x0')],'comment':_0x6b5e('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x6b5e('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x6b5e('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x6b5e('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6b5e('0x4a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6b5e('0x4b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x6b5e('0x16')](0x3)[_0x6b5e('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b5e('0x4c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6b5e('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x6b5e('0x16')](0x3)[_0x6b5e('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b5e('0x4d')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6b5e('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x6b5e('0x16')](0x3)[_0x6b5e('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b5e('0x4e')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6b5e('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b5e('0x4f')},'dialMachineMaxRetry':{'type':Sequelize[_0x6b5e('0x16')](0x3)[_0x6b5e('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b5e('0x50')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6b5e('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b5e('0x51')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6b5e('0x16')](0x3)[_0x6b5e('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b5e('0x52')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x6b5e('0x16')](0x5)[_0x6b5e('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6b5e('0x16')],'allowNull':!![],'comment':_0x6b5e('0x53')},'mandatoryDisposition':{'type':Sequelize[_0x6b5e('0x21')],'defaultValue':![],'comment':_0x6b5e('0x54'),'set':function(_0x48d418){if(!_0x48d418)this[_0x6b5e('0xc')](_0x6b5e('0x55'),null);this[_0x6b5e('0xc')](_0x6b5e('0x56'),_0x48d418);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x6b5e('0x16')](0x3)[_0x6b5e('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x6b5e('0x16')](0x3)[_0x6b5e('0x27')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x6b5e('0x21')],'defaultValue':![]}}; \ No newline at end of file +var _0xef24=['07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\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','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','outbound','default','ringall','leastrecent','rrmemory','wrandom','setDataValue','strategy','getDataValue','dialMethod','preview','roundrobin','includes','INTEGER','yes','once','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','progressive','power','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','UNSIGNED','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'];(function(_0x3f01b8,_0x44115b){var _0x27377e=function(_0x2969b3){while(--_0x2969b3){_0x3f01b8['push'](_0x3f01b8['shift']());}};_0x27377e(++_0x44115b);}(_0xef24,0x18d));var _0x4ef2=function(_0x32d7c4,_0x25cb15){_0x32d7c4=_0x32d7c4-0x0;var _0x48b422=_0xef24[_0x32d7c4];return _0x48b422;};'use strict';var Sequelize=require(_0x4ef2('0x0'));module[_0x4ef2('0x1')]={'name':{'type':Sequelize[_0x4ef2('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4ef2('0x3')]('inbound',_0x4ef2('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x4ef2('0x2')],'defaultValue':_0x4ef2('0x5')},'announce':{'type':Sequelize[_0x4ef2('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x4ef2('0x3')]('rr',_0x4ef2('0x6'),_0x4ef2('0x7'),'fewestcalls','random',_0x4ef2('0x8'),'linear',_0x4ef2('0x9'),'rrordered'),'allowNull':![],'defaultValue':_0x4ef2('0x6'),'set':function(_0x4309d7){this[_0x4ef2('0xa')](_0x4ef2('0xb'),_0x4309d7?_0x4309d7:_0x4ef2('0x8'));},'get':function(){var _0x21e855=this[_0x4ef2('0xc')]('type');var _0x259045=this[_0x4ef2('0xc')](_0x4ef2('0xd'));var _0x45098e=this[_0x4ef2('0xc')](_0x4ef2('0xb'));if(_0x21e855===_0x4ef2('0x4')){if(_0x259045===_0x4ef2('0xe')){return null;}if(_0x259045==='booked'&&![_0x4ef2('0x8'),_0x4ef2('0xf')][_0x4ef2('0x10')](_0x45098e)){this[_0x4ef2('0xa')]('strategy',_0x4ef2('0x8'));}}return _0x45098e;}},'servicelevel':{'type':Sequelize[_0x4ef2('0x11')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x4ef2('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x4ef2('0x11')](0xb)},'timeout':{'type':Sequelize[_0x4ef2('0x11')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x4ef2('0x11')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x4ef2('0x11')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x4ef2('0x11')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x4ef2('0x3')](_0x4ef2('0x12'),'no'),'defaultValue':_0x4ef2('0x12')},'autopause':{'type':Sequelize[_0x4ef2('0x3')](_0x4ef2('0x12'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x4ef2('0x11')](0xb)},'autopausebusy':{'type':Sequelize[_0x4ef2('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x4ef2('0x12'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x4ef2('0x11')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x4ef2('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x4ef2('0x3')](_0x4ef2('0x12'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x4ef2('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x4ef2('0x3')](_0x4ef2('0x12'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x4ef2('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x4ef2('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x4ef2('0x11')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x4ef2('0x11')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x4ef2('0x11')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x4ef2('0x3')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x4ef2('0x3')](_0x4ef2('0x12'),'no'),'defaultValue':_0x4ef2('0x12')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0x4ef2('0x13')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x4ef2('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x4ef2('0x12'),'no')},'announce_position_limit':{'type':Sequelize[_0x4ef2('0x11')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x4ef2('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x4ef2('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x4ef2('0x2')]},'queue_youarenext':{'type':Sequelize[_0x4ef2('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x4ef2('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x4ef2('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x4ef2('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x4ef2('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x4ef2('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x4ef2('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x4ef2('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x4ef2('0x2')]},'queue_quantity1':{'type':Sequelize[_0x4ef2('0x2')]},'queue_quantity2':{'type':Sequelize[_0x4ef2('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x4ef2('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x318298){this[_0x4ef2('0xa')]('periodic_announce',_0x318298?_0x318298[_0x4ef2('0x14')](','):[]);},'get':function(){return this['getDataValue'](_0x4ef2('0x15'))?this[_0x4ef2('0xc')](_0x4ef2('0x15'))[_0x4ef2('0x16')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x4ef2('0x12'),'set':function(_0x4be1bf){this[_0x4ef2('0xa')](_0x4ef2('0x17'),_0x4be1bf?_0x4be1bf[_0x4ef2('0x14')](','):undefined);},'get':function(){return this['getDataValue'](_0x4ef2('0x17'))?this[_0x4ef2('0xc')](_0x4ef2('0x17'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x4ef2('0x2')],'defaultValue':'no','set':function(_0x56c3f0){this[_0x4ef2('0xa')](_0x4ef2('0x18'),_0x56c3f0?_0x56c3f0['join'](','):undefined);},'get':function(){return this[_0x4ef2('0xc')](_0x4ef2('0x18'))?this[_0x4ef2('0xc')](_0x4ef2('0x18'))[_0x4ef2('0x16')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x4ef2('0x3')](_0x4ef2('0x12'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x4ef2('0x3')](_0x4ef2('0x12'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x4ef2('0x11')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x4ef2('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x4ef2('0x2')]},'description':{'type':Sequelize[_0x4ef2('0x2')]},'acw':{'type':Sequelize[_0x4ef2('0x19')],'defaultValue':0x0,'set':function(_0x3c82a6){this[_0x4ef2('0xa')]('acw',_0x3c82a6);if(_0x3c82a6){if(this['getDataValue'](_0x4ef2('0x1a'))<0x2){this['setDataValue'](_0x4ef2('0x1a'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x4ef2('0x3')](_0x4ef2('0xe'),_0x4ef2('0x1b'),_0x4ef2('0x1c'),'predictive','booked'),'defaultValue':_0x4ef2('0x1b'),'comment':_0x4ef2('0x1d')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4ef2('0x1e')},'dialLimitQueue':{'type':Sequelize[_0x4ef2('0x11')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4ef2('0x1f')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x4ef2('0x20')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x4ef2('0x21')},'dialPredictiveOptimization':{'type':Sequelize[_0x4ef2('0x3')](_0x4ef2('0x22'),_0x4ef2('0x23')),'defaultValue':_0x4ef2('0x23'),'comment':_0x4ef2('0x24')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x4ef2('0x25')](0x2)[_0x4ef2('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x4ef2('0x26')},'dialPredictiveInterval':{'type':Sequelize[_0x4ef2('0x11')](0x3)[_0x4ef2('0x20')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4ef2('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x4ef2('0x11')](0x3)[_0x4ef2('0x20')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x4ef2('0x2')],'defaultValue':_0x4ef2('0x27'),'comment':_0x4ef2('0x28')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x4ef2('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ef2('0x29')},'dialQueueProject':{'type':Sequelize[_0x4ef2('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x4ef2('0x11')](0x3)[_0x4ef2('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4ef2('0x11')](0x5)[_0x4ef2('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ef2('0x2a')},'dialBusyMaxRetry':{'type':Sequelize[_0x4ef2('0x11')](0x3)[_0x4ef2('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ef2('0x2b')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4ef2('0x11')](0x5)[_0x4ef2('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ef2('0x2c')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4ef2('0x11')](0x3)[_0x4ef2('0x20')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4ef2('0x11')](0x5)[_0x4ef2('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ef2('0x2d')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4ef2('0x11')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4ef2('0x2e')},'dialTimezone':{'type':Sequelize[_0x4ef2('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4ef2('0x2')],'defaultValue':_0x4ef2('0x2f')},'dialPrefix':{'type':Sequelize[_0x4ef2('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x4ef2('0x30'),_0x4ef2('0x31'),_0x4ef2('0x32')),'defaultValue':_0x4ef2('0x30')},'dialAMDActive':{'type':Sequelize[_0x4ef2('0x19')],'defaultValue':0x0,'comment':_0x4ef2('0x33')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x4ef2('0x11')](0x9)[_0x4ef2('0x20')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4ef2('0x34')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4ef2('0x11')](0x9)[_0x4ef2('0x20')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4ef2('0x35')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4ef2('0x11')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4ef2('0x36')},'dialAMDMinWordLength':{'type':Sequelize[_0x4ef2('0x11')](0x9)[_0x4ef2('0x20')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4ef2('0x37')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4ef2('0x20')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4ef2('0x38')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4ef2('0x11')](0x9)[_0x4ef2('0x20')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4ef2('0x11')](0x5)[_0x4ef2('0x20')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4ef2('0x39')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4ef2('0x11')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4ef2('0x3a')},'dialRecallMeTimeout':{'type':Sequelize[_0x4ef2('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x4ef2('0x3b')},'dialRecallInQueue':{'type':Sequelize[_0x4ef2('0x19')],'defaultValue':0x0,'comment':_0x4ef2('0x3c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4ef2('0x3')](_0x4ef2('0x3d'),_0x4ef2('0x3e')),'defaultValue':_0x4ef2('0x3d')},'dialQueueProject2':{'type':Sequelize[_0x4ef2('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x4ef2('0x19')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x4ef2('0x19')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4ef2('0x11')](0x3)[_0x4ef2('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4ef2('0x3f')},'dialCutDigit':{'type':Sequelize[_0x4ef2('0x11')](0x3)[_0x4ef2('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4ef2('0x40')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4ef2('0x11')](0x3)[_0x4ef2('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ef2('0x41')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4ef2('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ef2('0x42')},'dialDropMaxRetry':{'type':Sequelize[_0x4ef2('0x11')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ef2('0x43')},'dialDropRetryFrequency':{'type':Sequelize[_0x4ef2('0x11')](0x5)[_0x4ef2('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ef2('0x44')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4ef2('0x11')](0x3)[_0x4ef2('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4ef2('0x11')](0x5)[_0x4ef2('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x4ef2('0x11')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ef2('0x45')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4ef2('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4ef2('0x11')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ef2('0x46')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4ef2('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ef2('0x47')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4ef2('0x11')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4ef2('0x19')],'defaultValue':![],'comment':_0x4ef2('0x48'),'set':function(_0x5a4c05){if(!_0x5a4c05)this[_0x4ef2('0xa')](_0x4ef2('0x49'),null);this[_0x4ef2('0xa')]('mandatoryDisposition',_0x5a4c05);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x4ef2('0x11')](0x3)[_0x4ef2('0x20')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x4ef2('0x11')](0x3)[_0x4ef2('0x20')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x4ef2('0x11')](0x3)[_0x4ef2('0x20')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x4ef2('0x19')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 47750c5..78eaab2 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 _0x1cb9=['VoiceQueues','inbound','filter','ignore','map','value','includes','type','name','UserProfileResource','error','send','index','VoiceQueue','rawAttributes','fieldName','key','getOptions','where','count','include','query','rows','catch','params','keys','filters','intersection','attributes','model','fields','length','includeAll','merge','find','create','body','user','get','role','QueueCampaigns','outbound','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','getHoppers','CmHopper','nolimit','order','sort','pick','VoiceQueueId','findAll','getHopperHistories','findOne','CmHopperHistory','hasOwnProperty','getHopperFinals','CmHopperFinal','options','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','online','voicePause','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','userVoiceQueue:save','removeTeams','ids','User','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','addAgents','spread','emit','push','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','ContactId','phone','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId','scheduledAt','cm_hopper_additional_phones','CmHopperId','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','util','lodash','squel','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','undefined','limit','offset','Content-Range','update','then','destroy'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0x1cb9,0x14e));var _0x91cb=function(_0x597b4b,_0x34707b){_0x597b4b=_0x597b4b-0x0;var _0x4f2423=_0x1cb9[_0x597b4b];return _0x4f2423;};'use strict';var moment=require(_0x91cb('0x0'));var BPromise=require('bluebird');var util=require(_0x91cb('0x1'));var _=require(_0x91cb('0x2'));var squel=require(_0x91cb('0x3'));var Redis=require(_0x91cb('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x91cb('0x5'))(_0x91cb('0x6'));var config=require('../../config/environment');var db=require(_0x91cb('0x7'))['db'];config[_0x91cb('0x8')]=_[_0x91cb('0x9')](config[_0x91cb('0x8')],{'host':_0x91cb('0xa'),'port':0x18eb});var socket=require(_0x91cb('0xb'))(new Redis(config['redis']));require(_0x91cb('0xc'))['register'](socket);function respondWithStatusCode(_0x2fdfce,_0x4cf9ed){_0x4cf9ed=_0x4cf9ed||0xcc;return function(_0xa43e7a){if(_0xa43e7a){return _0x2fdfce[_0x91cb('0xd')](_0x4cf9ed);}return _0x2fdfce[_0x91cb('0xe')](_0x4cf9ed)[_0x91cb('0xf')]();};}function respondWithResult(_0x429928,_0x23ba9a){_0x23ba9a=_0x23ba9a||0xc8;return function(_0x21a0a5){if(_0x21a0a5){return _0x429928[_0x91cb('0xe')](_0x23ba9a)[_0x91cb('0x10')](_0x21a0a5);}};}function respondWithFilteredResult(_0x8c0097,_0x530d92){return function(_0x3c1f56){if(_0x3c1f56){var _0x366f09=typeof _0x530d92['offset']===_0x91cb('0x11')&&typeof _0x530d92[_0x91cb('0x12')]===_0x91cb('0x11');var _0x2c7d40=_0x3c1f56['count'];var _0x4cc6ef=_0x366f09?0x0:_0x530d92[_0x91cb('0x13')];var _0x3d22b7=_0x366f09?_0x3c1f56['count']:_0x530d92['offset']+_0x530d92[_0x91cb('0x12')];var _0xc3629e;if(_0x3d22b7>=_0x2c7d40){_0x3d22b7=_0x2c7d40;_0xc3629e=0xc8;}else{_0xc3629e=0xce;}_0x8c0097[_0x91cb('0xe')](_0xc3629e);return _0x8c0097['set'](_0x91cb('0x14'),_0x4cc6ef+'-'+_0x3d22b7+'/'+_0x2c7d40)[_0x91cb('0x10')](_0x3c1f56);}return null;};}function saveUpdates(_0x4f1554){return function(_0xc594e3){if(_0xc594e3){return _0xc594e3[_0x91cb('0x15')](_0x4f1554)[_0x91cb('0x16')](function(_0xcd1a78){return _0xcd1a78;});}return null;};}function removeEntity(_0x5cc1c3){return function(_0x3fba4f){if(_0x3fba4f){return _0x3fba4f[_0x91cb('0x17')]()['then'](function(){var _0x123847=_0x3fba4f['get']({'plain':!![]});var _0x55042a=[{'name':_0x91cb('0x18'),'value':_0x91cb('0x19'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x5b385a=_(_0x55042a)[_0x91cb('0x1a')](_0x91cb('0x1b'))[_0x91cb('0x1c')](_0x91cb('0x1d'))['value']();if(_[_0x91cb('0x1e')](_0x5b385a,_0x123847[_0x91cb('0x1f')])){return;}var _0x1fa837=_['find'](_0x55042a,[_0x91cb('0x1d'),_0x123847[_0x91cb('0x1f')]])[_0x91cb('0x20')];return db[_0x91cb('0x21')][_0x91cb('0x17')]({'where':{'type':_0x1fa837,'resourceId':_0x123847['id']}})[_0x91cb('0x16')](function(){return _0x3fba4f;});})[_0x91cb('0x16')](function(){_0x5cc1c3[_0x91cb('0xe')](0xcc)[_0x91cb('0xf')]();});}};}function handleEntityNotFound(_0x4c8438){return function(_0x59bf3a){if(!_0x59bf3a){_0x4c8438[_0x91cb('0xd')](0x194);}return _0x59bf3a;};}function handleError(_0x554350,_0x1c67d2){_0x1c67d2=_0x1c67d2||0x1f4;return function(_0x34d372){logger[_0x91cb('0x22')](_0x34d372['stack']);if(_0x34d372[_0x91cb('0x20')]){delete _0x34d372['name'];}_0x554350[_0x91cb('0xe')](_0x1c67d2)[_0x91cb('0x23')](_0x34d372);};}exports[_0x91cb('0x24')]=function(_0x2fb473,_0x468908){var _0x504275={};var _0x2f04a3={'count':0x0,'rows':[]};var _0x52670a=_[_0x91cb('0x1c')](db[_0x91cb('0x25')][_0x91cb('0x26')],function(_0x4944bd){return{'name':_0x4944bd[_0x91cb('0x27')],'type':_0x4944bd[_0x91cb('0x1f')][_0x91cb('0x28')]};});_0x504275=qs[_0x91cb('0x29')](_0x52670a,_0x2fb473);var _0xf296bc={'where':_0x504275[_0x91cb('0x2a')]};return db[_0x91cb('0x25')][_0x91cb('0x2b')](_0xf296bc)[_0x91cb('0x16')](function(_0x5e6ed3){_0x2f04a3[_0x91cb('0x2b')]=_0x5e6ed3;_0x504275[_0x91cb('0x2c')]=qs[_0x91cb('0x2c')](_0x2fb473[_0x91cb('0x2d')]);return db[_0x91cb('0x25')]['findAll'](_0x504275);})[_0x91cb('0x16')](function(_0x74b443){_0x2f04a3[_0x91cb('0x2e')]=_0x74b443;return _0x2f04a3;})[_0x91cb('0x16')](respondWithFilteredResult(_0x468908,_0x504275))[_0x91cb('0x2f')](handleError(_0x468908,null));};exports['show']=function(_0x121c37,_0x5927cb){var _0x47fc17={'raw':![],'where':{'id':_0x121c37[_0x91cb('0x30')]['id']}},_0x479968={};_0x479968['model']=_[_0x91cb('0x31')](db['VoiceQueue']['rawAttributes']);_0x479968[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x121c37[_0x91cb('0x2d')]);_0x479968[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x479968['model'],_0x479968[_0x91cb('0x2d')]);_0x47fc17[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x479968[_0x91cb('0x35')],qs['fields'](_0x121c37['query'][_0x91cb('0x36')]));_0x47fc17[_0x91cb('0x34')]=_0x47fc17['attributes'][_0x91cb('0x37')]?_0x47fc17[_0x91cb('0x34')]:_0x479968['model'];if(_0x121c37[_0x91cb('0x2d')][_0x91cb('0x38')]){_0x47fc17['include']=[{'all':!![]}];}_0x47fc17=_[_0x91cb('0x39')]({},_0x47fc17,_0x121c37['options']);return db[_0x91cb('0x25')][_0x91cb('0x3a')](_0x47fc17)[_0x91cb('0x16')](handleEntityNotFound(_0x5927cb,null))[_0x91cb('0x16')](respondWithResult(_0x5927cb,null))[_0x91cb('0x2f')](handleError(_0x5927cb,null));};exports[_0x91cb('0x3b')]=function(_0x5d0e37,_0xa90111){return db[_0x91cb('0x25')]['create'](_0x5d0e37[_0x91cb('0x3c')],{})['then'](function(_0x2c6102){var _0x2eac87=_0x5d0e37[_0x91cb('0x3d')][_0x91cb('0x3e')]({'plain':!![]});if(!_0x2eac87)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2eac87[_0x91cb('0x3f')]===_0x91cb('0x3d')){var _0x2cf27e=_0x2c6102[_0x91cb('0x3e')]({'plain':!![]});var _0x42a7f3=[{'name':_0x91cb('0x18'),'value':_0x91cb('0x19')},{'name':_0x91cb('0x40'),'value':_0x91cb('0x41')}];var _0x3cc4c1=_['find'](_0x42a7f3,[_0x91cb('0x1d'),_0x2cf27e['type']])[_0x91cb('0x20')];return db['UserProfileSection'][_0x91cb('0x3a')]({'where':{'name':_0x3cc4c1,'userProfileId':_0x2eac87['userProfileId']},'raw':!![]})[_0x91cb('0x16')](function(_0x477131){if(_0x477131&&_0x477131[_0x91cb('0x42')]===0x0){return db[_0x91cb('0x21')]['create']({'name':_0x2cf27e[_0x91cb('0x20')],'resourceId':_0x2cf27e['id'],'type':_0x477131[_0x91cb('0x20')],'sectionId':_0x477131['id']},{})['then'](function(){return _0x2c6102;});}else{return _0x2c6102;}})[_0x91cb('0x2f')](function(_0x2f1749){logger[_0x91cb('0x22')](_0x91cb('0x43'),_0x2f1749);throw _0x2f1749;});}return _0x2c6102;})[_0x91cb('0x16')](respondWithResult(_0xa90111,0xc9))[_0x91cb('0x2f')](handleError(_0xa90111,null));};exports[_0x91cb('0x44')]=function(_0x29d5a1,_0x396b81){var _0x4b26f6={'where':{'id':_0x29d5a1[_0x91cb('0x30')]['id']}},_0x7c22b3={};_0x7c22b3[_0x91cb('0x35')]=_[_0x91cb('0x31')](db[_0x91cb('0x25')][_0x91cb('0x26')]);_0x4b26f6[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x7c22b3['model'],qs[_0x91cb('0x36')](_0x29d5a1[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x4b26f6[_0x91cb('0x34')]=_0x4b26f6['attributes'][_0x91cb('0x37')]?_0x4b26f6[_0x91cb('0x34')]:_0x7c22b3['model'];if(_0x29d5a1[_0x91cb('0x2d')]['includeAll']){_0x4b26f6[_0x91cb('0x2c')]=[{'all':!![]}];}_0x4b26f6=_['merge']({},_0x4b26f6,_0x29d5a1['options']);return db['VoiceQueue'][_0x91cb('0x3a')](_0x4b26f6)[_0x91cb('0x16')](handleEntityNotFound(_0x396b81,null))[_0x91cb('0x16')](function(_0x2f8384){if(_0x2f8384){var _0x333814=_0x2f8384['get']({'plain':!![]});_0x333814=qs['omit'](_0x333814,['id',_0x91cb('0x45'),_0x91cb('0x46')]);_0x29d5a1[_0x91cb('0x3c')]=_[_0x91cb('0x47')](_0x29d5a1['body'],['id','createdAt','updatedAt']);return db[_0x91cb('0x25')]['create'](_[_0x91cb('0x39')](_0x333814,_0x29d5a1['body']),{'include':_0x29d5a1[_0x91cb('0x2d')][_0x91cb('0x38')]?[{'all':!![]}]:undefined})[_0x91cb('0x16')](function(_0x649976){var _0x1884bc=_0x29d5a1[_0x91cb('0x3d')][_0x91cb('0x3e')]({'plain':!![]});if(!_0x1884bc)throw new Error(_0x91cb('0x48'));if(_0x1884bc[_0x91cb('0x3f')]===_0x91cb('0x3d')){var _0xd8f7c2=_0x649976['get']({'plain':!![]});var _0x1e445a=[{'name':_0x91cb('0x18'),'value':'inbound'},{'name':_0x91cb('0x40'),'value':_0x91cb('0x41')}];var _0x4bab7d=_[_0x91cb('0x3a')](_0x1e445a,[_0x91cb('0x1d'),_0xd8f7c2[_0x91cb('0x1f')]])[_0x91cb('0x20')];return db[_0x91cb('0x49')][_0x91cb('0x3a')]({'where':{'name':_0x4bab7d,'userProfileId':_0x1884bc[_0x91cb('0x4a')]},'raw':!![]})[_0x91cb('0x16')](function(_0x3320bd){if(_0x3320bd&&_0x3320bd[_0x91cb('0x42')]===0x0){return db[_0x91cb('0x21')]['create']({'name':_0xd8f7c2[_0x91cb('0x20')],'resourceId':_0xd8f7c2['id'],'type':_0x3320bd['name'],'sectionId':_0x3320bd['id']},{})[_0x91cb('0x16')](function(){return _0x649976;});}else{return _0x649976;}})['catch'](function(_0x3dfff9){logger[_0x91cb('0x22')](_0x91cb('0x43'),_0x3dfff9);throw _0x3dfff9;});}return _0x649976;});}})['then'](respondWithResult(_0x396b81,0xc9))[_0x91cb('0x2f')](handleError(_0x396b81,null));};exports[_0x91cb('0x15')]=function(_0x48dcf7,_0xef4754){if(_0x48dcf7[_0x91cb('0x3c')]['id']){delete _0x48dcf7[_0x91cb('0x3c')]['id'];}return db[_0x91cb('0x25')]['find']({'where':{'id':_0x48dcf7[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0xef4754,null))[_0x91cb('0x16')](saveUpdates(_0x48dcf7[_0x91cb('0x3c')],null))['then'](respondWithResult(_0xef4754,null))[_0x91cb('0x2f')](handleError(_0xef4754,null));};exports[_0x91cb('0x17')]=function(_0x5c2c01,_0x492b09){return db[_0x91cb('0x25')]['find']({'where':{'id':_0x5c2c01[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x492b09,null))['then'](removeEntity(_0x492b09,null))['catch'](handleError(_0x492b09,null));};exports[_0x91cb('0x4b')]=function(_0x5c468a,_0x1b69ce){var _0x961ebf={'raw':![],'where':{}};var _0x33de58={};var _0x551836={'count':0x0,'rows':[]};return db[_0x91cb('0x25')]['findOne']({'where':{'id':_0x5c468a[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x1b69ce,null))[_0x91cb('0x16')](function(_0x2c1911){if(_0x2c1911){_0x33de58['model']=_[_0x91cb('0x31')](db[_0x91cb('0x4c')][_0x91cb('0x26')]);_0x33de58[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x5c468a[_0x91cb('0x2d')]);_0x33de58[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x33de58[_0x91cb('0x35')],_0x33de58[_0x91cb('0x2d')]);_0x961ebf[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x33de58['model'],qs[_0x91cb('0x36')](_0x5c468a[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x961ebf[_0x91cb('0x34')]=_0x961ebf[_0x91cb('0x34')][_0x91cb('0x37')]?_0x961ebf[_0x91cb('0x34')]:_0x33de58['model'];if(!_0x5c468a[_0x91cb('0x2d')]['hasOwnProperty'](_0x91cb('0x4d'))){_0x961ebf[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x5c468a[_0x91cb('0x2d')]['limit']);_0x961ebf[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x5c468a[_0x91cb('0x2d')][_0x91cb('0x13')]);}_0x961ebf[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x5c468a['query'][_0x91cb('0x4f')]);_0x961ebf[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_[_0x91cb('0x50')](_0x5c468a[_0x91cb('0x2d')],_0x33de58[_0x91cb('0x32')]));_0x961ebf[_0x91cb('0x2a')][_0x91cb('0x51')]=_0x2c1911['id'];if(_0x5c468a[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x961ebf[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x961ebf[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x961ebf[_0x91cb('0x34')],function(_0x2605c3){var _0x1d9ded={};_0x1d9ded[_0x2605c3]={'$like':'%'+_0x5c468a['query'][_0x91cb('0x1a')]+'%'};return _0x1d9ded;})});}_0x961ebf=_[_0x91cb('0x39')]({},_0x961ebf,_0x5c468a['options']);return db[_0x91cb('0x4c')][_0x91cb('0x2b')]({'where':_0x961ebf[_0x91cb('0x2a')]})['then'](function(_0x45e26b){_0x551836[_0x91cb('0x2b')]=_0x45e26b;if(_0x5c468a['query']['includeAll']){_0x961ebf[_0x91cb('0x2c')]=[{'all':!![]}];}return db['CmHopper'][_0x91cb('0x52')](_0x961ebf);})[_0x91cb('0x16')](function(_0x4e11e3){_0x551836[_0x91cb('0x2e')]=_0x4e11e3;return _0x551836;});}})['then'](respondWithFilteredResult(_0x1b69ce,_0x961ebf))[_0x91cb('0x2f')](handleError(_0x1b69ce,null));};exports[_0x91cb('0x53')]=function(_0x4f827e,_0x5d8a7e){var _0x16a21f={'raw':!![],'where':{}};var _0x43be3e={};var _0x37666a={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x91cb('0x54')]({'where':{'id':_0x4f827e[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x5d8a7e,null))[_0x91cb('0x16')](function(_0x570f6b){if(_0x570f6b){_0x43be3e[_0x91cb('0x35')]=_['keys'](db[_0x91cb('0x55')][_0x91cb('0x26')]);_0x43be3e[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x4f827e['query']);_0x43be3e['filters']=_[_0x91cb('0x33')](_0x43be3e['model'],_0x43be3e[_0x91cb('0x2d')]);_0x16a21f[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x43be3e[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x16a21f['attributes']=_0x16a21f[_0x91cb('0x34')][_0x91cb('0x37')]?_0x16a21f['attributes']:_0x43be3e[_0x91cb('0x35')];if(!_0x4f827e['query'][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x16a21f[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x16a21f[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x13')]);}_0x16a21f[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x16a21f[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_['pick'](_0x4f827e[_0x91cb('0x2d')],_0x43be3e['filters']));_0x16a21f[_0x91cb('0x2a')][_0x91cb('0x51')]=_0x570f6b['id'];if(_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x16a21f[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x16a21f[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x16a21f['attributes'],function(_0xb5c264){var _0xdee7f={};_0xdee7f[_0xb5c264]={'$like':'%'+_0x4f827e['query']['filter']+'%'};return _0xdee7f;})});}_0x16a21f=_[_0x91cb('0x39')]({},_0x16a21f,_0x4f827e['options']);return db['CmHopperHistory'][_0x91cb('0x2b')]({'where':_0x16a21f['where']})[_0x91cb('0x16')](function(_0x498382){_0x37666a[_0x91cb('0x2b')]=_0x498382;if(_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x38')]){_0x16a21f[_0x91cb('0x2c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x91cb('0x52')](_0x16a21f);})[_0x91cb('0x16')](function(_0x42d07b){_0x37666a[_0x91cb('0x2e')]=_0x42d07b;return _0x37666a;});}})[_0x91cb('0x16')](respondWithFilteredResult(_0x5d8a7e,_0x16a21f))[_0x91cb('0x2f')](handleError(_0x5d8a7e,null));};exports[_0x91cb('0x57')]=function(_0x3cf8c5,_0x21dfd3){var _0x24facc={'raw':!![],'where':{}};var _0xafda63={};var _0x32704d={'count':0x0,'rows':[]};return db[_0x91cb('0x25')][_0x91cb('0x54')]({'where':{'id':_0x3cf8c5[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x21dfd3,null))[_0x91cb('0x16')](function(_0x39fce4){if(_0x39fce4){_0xafda63[_0x91cb('0x35')]=_[_0x91cb('0x31')](db[_0x91cb('0x58')][_0x91cb('0x26')]);_0xafda63[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x3cf8c5[_0x91cb('0x2d')]);_0xafda63['filters']=_[_0x91cb('0x33')](_0xafda63[_0x91cb('0x35')],_0xafda63[_0x91cb('0x2d')]);_0x24facc[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0xafda63[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x3cf8c5[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x24facc[_0x91cb('0x34')]=_0x24facc[_0x91cb('0x34')]['length']?_0x24facc[_0x91cb('0x34')]:_0xafda63['model'];if(!_0x3cf8c5['query'][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x24facc[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x3cf8c5[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x24facc[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x3cf8c5[_0x91cb('0x2d')][_0x91cb('0x13')]);}_0x24facc['order']=qs[_0x91cb('0x4f')](_0x3cf8c5[_0x91cb('0x2d')]['sort']);_0x24facc[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_['pick'](_0x3cf8c5[_0x91cb('0x2d')],_0xafda63[_0x91cb('0x32')]));_0x24facc[_0x91cb('0x2a')][_0x91cb('0x51')]=_0x39fce4['id'];if(_0x3cf8c5[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x24facc[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x24facc[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x24facc[_0x91cb('0x34')],function(_0x378cd0){var _0x538a8c={};_0x538a8c[_0x378cd0]={'$like':'%'+_0x3cf8c5['query'][_0x91cb('0x1a')]+'%'};return _0x538a8c;})});}_0x24facc=_[_0x91cb('0x39')]({},_0x24facc,_0x3cf8c5[_0x91cb('0x59')]);return db[_0x91cb('0x58')][_0x91cb('0x2b')]({'where':_0x24facc[_0x91cb('0x2a')]})[_0x91cb('0x16')](function(_0x5ac5cc){_0x32704d[_0x91cb('0x2b')]=_0x5ac5cc;if(_0x3cf8c5['query'][_0x91cb('0x38')]){_0x24facc[_0x91cb('0x2c')]=[{'all':!![]}];}return db[_0x91cb('0x58')][_0x91cb('0x52')](_0x24facc);})[_0x91cb('0x16')](function(_0x4ac4dd){_0x32704d[_0x91cb('0x2e')]=_0x4ac4dd;return _0x32704d;});}})[_0x91cb('0x16')](respondWithFilteredResult(_0x21dfd3,_0x24facc))[_0x91cb('0x2f')](handleError(_0x21dfd3,null));};exports[_0x91cb('0x5a')]=function(_0x3a213e,_0x4e4003){var _0x4003c9={'raw':!![],'where':{}};var _0x9cff8f={};var _0x25a779={'count':0x0,'rows':[]};return db[_0x91cb('0x25')]['findOne']({'where':{'id':_0x3a213e['params']['id']}})['then'](handleEntityNotFound(_0x4e4003,null))[_0x91cb('0x16')](function(_0x182aa5){if(_0x182aa5){_0x9cff8f[_0x91cb('0x35')]=_[_0x91cb('0x31')](db['CmHopperBlack'][_0x91cb('0x26')]);_0x9cff8f[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x3a213e[_0x91cb('0x2d')]);_0x9cff8f['filters']=_['intersection'](_0x9cff8f[_0x91cb('0x35')],_0x9cff8f[_0x91cb('0x2d')]);_0x4003c9[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x9cff8f[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x4003c9[_0x91cb('0x34')]=_0x4003c9[_0x91cb('0x34')][_0x91cb('0x37')]?_0x4003c9[_0x91cb('0x34')]:_0x9cff8f[_0x91cb('0x35')];if(!_0x3a213e['query']['hasOwnProperty'](_0x91cb('0x4d'))){_0x4003c9['limit']=qs[_0x91cb('0x12')](_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x4003c9[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x13')]);}_0x4003c9[_0x91cb('0x4e')]=qs['sort'](_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x4003c9[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_[_0x91cb('0x50')](_0x3a213e['query'],_0x9cff8f[_0x91cb('0x32')]));_0x4003c9[_0x91cb('0x2a')][_0x91cb('0x51')]=_0x182aa5['id'];if(_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x4003c9['where']=_[_0x91cb('0x39')](_0x4003c9[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x4003c9[_0x91cb('0x34')],function(_0x440ef4){var _0x2c2ed8={};_0x2c2ed8[_0x440ef4]={'$like':'%'+_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x2c2ed8;})});}_0x4003c9=_[_0x91cb('0x39')]({},_0x4003c9,_0x3a213e[_0x91cb('0x59')]);return db[_0x91cb('0x5b')][_0x91cb('0x2b')]({'where':_0x4003c9[_0x91cb('0x2a')]})[_0x91cb('0x16')](function(_0x7c84fc){_0x25a779[_0x91cb('0x2b')]=_0x7c84fc;if(_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x38')]){_0x4003c9[_0x91cb('0x2c')]=[{'all':!![]}];}return db[_0x91cb('0x5b')][_0x91cb('0x52')](_0x4003c9);})[_0x91cb('0x16')](function(_0x275c80){_0x25a779[_0x91cb('0x2e')]=_0x275c80;return _0x25a779;});}})[_0x91cb('0x16')](respondWithFilteredResult(_0x4e4003,_0x4003c9))[_0x91cb('0x2f')](handleError(_0x4e4003,null));};exports['getTeams']=function(_0x16cf02,_0x2b8634){var _0x1eb46e={};var _0x261a3a={};var _0x16f334;var _0x5ca377;return db['VoiceQueue']['findOne']({'where':{'id':_0x16cf02['params']['id']}})['then'](handleEntityNotFound(_0x2b8634,null))[_0x91cb('0x16')](function(_0x46a6cc){if(_0x46a6cc){_0x16f334=_0x46a6cc;_0x261a3a[_0x91cb('0x35')]=_[_0x91cb('0x31')](db[_0x91cb('0x5c')][_0x91cb('0x26')]);_0x261a3a[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x16cf02[_0x91cb('0x2d')]);_0x261a3a[_0x91cb('0x32')]=_['intersection'](_0x261a3a[_0x91cb('0x35')],_0x261a3a[_0x91cb('0x2d')]);_0x1eb46e['attributes']=_[_0x91cb('0x33')](_0x261a3a[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x1eb46e[_0x91cb('0x34')]=_0x1eb46e[_0x91cb('0x34')]['length']?_0x1eb46e[_0x91cb('0x34')]:_0x261a3a[_0x91cb('0x35')];_0x1eb46e[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x1eb46e[_0x91cb('0x2a')]=qs['filters'](_[_0x91cb('0x50')](_0x16cf02['query'],_0x261a3a[_0x91cb('0x32')]));if(_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x1eb46e[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x1eb46e[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x1eb46e[_0x91cb('0x34')],function(_0x1c7c10){var _0x570cf0={};_0x570cf0[_0x1c7c10]={'$like':'%'+_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x570cf0;})});}_0x1eb46e=_[_0x91cb('0x39')]({},_0x1eb46e,_0x16cf02[_0x91cb('0x59')]);return _0x16f334[_0x91cb('0x5d')](_0x1eb46e);}})[_0x91cb('0x16')](function(_0x189a87){if(_0x189a87){_0x5ca377=_0x189a87[_0x91cb('0x37')];if(!_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x1eb46e[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x16cf02['query'][_0x91cb('0x12')]);_0x1eb46e['offset']=qs[_0x91cb('0x13')](_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x13')]);}return _0x16f334[_0x91cb('0x5d')](_0x1eb46e);}})[_0x91cb('0x16')](function(_0x12da14){if(_0x12da14){return _0x12da14?{'count':_0x5ca377,'rows':_0x12da14}:null;}})[_0x91cb('0x16')](respondWithResult(_0x2b8634,null))[_0x91cb('0x2f')](handleError(_0x2b8634,null));};exports['addTeams']=function(_0x3353bf,_0x5b3658){var _0x3c1703=_0x3353bf[_0x91cb('0x3c')][_0x91cb('0x5e')];var _0x598663=_[_0x91cb('0x1c')](_0x3c1703,'id');return db[_0x91cb('0x5c')][_0x91cb('0x52')]({'where':{'id':_0x598663},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x91cb('0x5f'),_0x91cb('0x60'),_0x91cb('0x61')],'raw':!![]}]})['then'](function(_0x469e62){if(_0x469e62){var _0x1e9441=_[_0x91cb('0x62')](_0x469e62,function(_0x1bb2de){var _0x129ea0=_0x1bb2de[_0x91cb('0x3e')]({'plain':!![]});_0x129ea0[_0x91cb('0x63')][_0x91cb('0x64')](function(_0x50b8d6){_0x50b8d6[_0x91cb('0x65')]=_[_0x91cb('0x3a')](_0x3c1703,{'id':_0x129ea0['id']})[_0x91cb('0x65')];});return _0x129ea0[_0x91cb('0x63')];});return db['VoiceQueue'][_0x91cb('0x3a')]({'where':{'id':_0x3353bf['params']['id']}})[_0x91cb('0x16')](function(_0x43b620){return db[_0x91cb('0x66')][_0x91cb('0x67')](function(_0x3b0bd5){return _0x43b620['addTeams'](_0x598663,{'transaction':_0x3b0bd5})[_0x91cb('0x16')](function(){return BPromise['each'](_0x3c1703,function(_0x58608e){return db[_0x91cb('0x68')][_0x91cb('0x69')]({'TeamId':_0x58608e['id'],'VoiceQueueId':_0x3353bf[_0x91cb('0x30')]['id'],'penalty':_0x58608e[_0x91cb('0x65')]},{'transaction':_0x3b0bd5});});})[_0x91cb('0x16')](function(){return BPromise[_0x91cb('0x6a')](_0x1e9441,function(_0x20ef3d){return db[_0x91cb('0x6b')]['findOrCreate']({'where':{'UserId':_0x20ef3d['id'],'VoiceQueueId':_0x3353bf[_0x91cb('0x30')]['id']},'defaults':{'penalty':_0x20ef3d[_0x91cb('0x65')]},'transaction':_0x3b0bd5});});})[_0x91cb('0x16')](function(){return BPromise['each'](_['filter'](_0x1e9441,{'online':!![]}),function(_0x530565){return db[_0x91cb('0x6c')][_0x91cb('0x69')]({'membername':_0x530565[_0x91cb('0x20')],'UserId':_0x530565['id'],'queue_name':_0x43b620['name'],'VoiceQueueId':_0x43b620['id'],'interface':_[_0x91cb('0x6d')](_0x530565[_0x91cb('0x61')])?util[_0x91cb('0x6e')](_0x91cb('0x6f'),_0x530565['name']):_0x530565[_0x91cb('0x61')],'paused':_0x530565[_0x91cb('0x60')]||![],'penalty':_0x530565[_0x91cb('0x65')]},{'transaction':_0x3b0bd5});});})[_0x91cb('0x16')](function(){_0x1e9441[_0x91cb('0x64')](function(_0x3c788e){socket['emit'](_0x91cb('0x70'),{'UserId':_0x3c788e['id'],'VoiceQueueId':_0x43b620['id']});});});});});}})[_0x91cb('0x16')](respondWithStatusCode(_0x5b3658,null))[_0x91cb('0x2f')](handleError(_0x5b3658,null));};exports[_0x91cb('0x71')]=function(_0x3782cd,_0x4b290e){return db[_0x91cb('0x5c')][_0x91cb('0x52')]({'where':{'id':_0x3782cd[_0x91cb('0x2d')][_0x91cb('0x72')]},'attributes':['id'],'include':[{'model':db[_0x91cb('0x73')],'as':_0x91cb('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4b290e,null))[_0x91cb('0x16')](function(_0x2bafae){var _0x27472a=_['map'](_0x2bafae,'id');var _0x59cb69=[];var _0x5d0f96=[];var _0x174325=squel[_0x91cb('0x74')]();_0x174325[_0x91cb('0x75')](_0x91cb('0x76'))['from'](_0x91cb('0x77'),'tq')[_0x91cb('0x78')](_0x91cb('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x91cb('0x2a')]('VoiceQueueId\x20=\x20?',_0x3782cd[_0x91cb('0x30')]['id']);for(var _0x43b2e7=0x0;_0x43b2e7<_0x2bafae['length'];_0x43b2e7+=0x1){let _0x1b47fe=_0x2bafae[_0x43b2e7];for(var _0x1853de=0x0;_0x1853de<_0x1b47fe[_0x91cb('0x63')][_0x91cb('0x37')];_0x1853de+=0x1){let _0x376426=_0x1b47fe['Agents'][_0x1853de];var _0x22a6e6=_0x174325[_0x91cb('0x44')]();_0x22a6e6[_0x91cb('0x2a')](_0x91cb('0x7a'),_0x376426['id']);_0x5d0f96['push'](db[_0x91cb('0x66')]['query'](_0x22a6e6['toString'](),{'type':db['sequelize'][_0x91cb('0x7b')][_0x91cb('0x7c')]})[_0x91cb('0x16')](function(_0x4972c3){if(_0x4972c3[_0x91cb('0x37')]===0x1){return _0x376426['id'];}else{var _0x53dbb2=_[_0x91cb('0x7d')](_[_0x91cb('0x1c')](_0x4972c3,_0x91cb('0x7e')),function(_0x2a2a71){return _[_0x91cb('0x1e')](_0x27472a,_0x2a2a71);});if(_0x53dbb2){return _0x376426['id'];}}}));}}return BPromise[_0x91cb('0x7f')](_0x5d0f96)['then'](function(_0x5bfd2c){_0x59cb69=_(_0x59cb69)[_0x91cb('0x80')](_0x5bfd2c)['compact']()[_0x91cb('0x1d')]();return db[_0x91cb('0x25')][_0x91cb('0x3a')]({'where':{'id':_0x3782cd[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](function(_0x51d431){return db[_0x91cb('0x66')][_0x91cb('0x67')](function(_0x18ec67){return _0x51d431['removeTeams'](_0x3782cd[_0x91cb('0x2d')][_0x91cb('0x72')],{'transaction':_0x18ec67})['then'](function(){if(!_[_0x91cb('0x81')](_0x59cb69)){return _0x51d431[_0x91cb('0x82')](_0x59cb69,{'transaction':_0x18ec67})[_0x91cb('0x16')](function(){return db[_0x91cb('0x6c')][_0x91cb('0x17')]({'where':{'VoiceQueueId':_0x3782cd[_0x91cb('0x30')]['id'],'UserId':_0x59cb69},'transaction':_0x18ec67});});}})['then'](function(){_0x59cb69[_0x91cb('0x64')](function(_0x5da781){socket['emit']('userVoiceQueue:remove',{'UserId':_0x5da781,'VoiceQueueId':_0x51d431['id']});});});});});});})[_0x91cb('0x16')](respondWithStatusCode(_0x4b290e,null))['catch'](handleError(_0x4b290e,null));};exports['addAgents']=function(_0x3c0211,_0x3710e9){var _0x395e21,_0x52b9af;return db['VoiceQueue'][_0x91cb('0x3a')]({'where':{'id':_0x3c0211[_0x91cb('0x30')]['id']}})['then'](handleEntityNotFound(_0x3710e9,null))[_0x91cb('0x16')](function(_0x3280a5){if(_0x3280a5){_0x52b9af=_0x3280a5;return _0x3280a5[_0x91cb('0x83')](_0x3c0211[_0x91cb('0x3c')][_0x91cb('0x72')],_['omit'](_0x3c0211['body'],[_0x91cb('0x72'),'id'])||{})[_0x91cb('0x84')](function(_0x547b4d){for(var _0x1aef0b=0x0;_0x1aef0b<_0x3c0211[_0x91cb('0x3c')][_0x91cb('0x72')][_0x91cb('0x37')];_0x1aef0b+=0x1){socket[_0x91cb('0x85')]('userVoiceQueue:save',{'UserId':Number(_0x3c0211[_0x91cb('0x3c')][_0x91cb('0x72')][_0x1aef0b]),'VoiceQueueId':Number(_0x3c0211[_0x91cb('0x30')]['id'])});}return _0x547b4d;});}})['then'](function(_0x4ba088){_0x395e21=_0x4ba088||[];if(_0x52b9af){return db[_0x91cb('0x73')][_0x91cb('0x52')]({'where':{'id':_0x3c0211[_0x91cb('0x3c')][_0x91cb('0x72')]},'attributes':['id',_0x91cb('0x20'),_0x91cb('0x5f'),_0x91cb('0x60'),_0x91cb('0x61')],'raw':!![]});}})['then'](function(_0x33b7a7){if(!_[_0x91cb('0x81')](_0x33b7a7)){var _0x4ac7b9=[];for(var _0x41c3ff=0x0;_0x41c3ff<_0x33b7a7[_0x91cb('0x37')];_0x41c3ff++){if(_0x33b7a7[_0x41c3ff]['online']){_0x4ac7b9[_0x91cb('0x86')](db[_0x91cb('0x6c')][_0x91cb('0x69')]({'membername':_0x33b7a7[_0x41c3ff][_0x91cb('0x20')],'UserId':_0x33b7a7[_0x41c3ff]['id'],'queue_name':_0x52b9af[_0x91cb('0x20')],'VoiceQueueId':_0x52b9af['id'],'interface':_['isNil'](_0x33b7a7[_0x41c3ff][_0x91cb('0x61')])?util[_0x91cb('0x6e')](_0x91cb('0x6f'),_0x33b7a7[_0x41c3ff][_0x91cb('0x20')]):_0x33b7a7[_0x41c3ff]['interface'],'paused':_0x33b7a7[_0x41c3ff][_0x91cb('0x60')]||![],'penalty':_0x3c0211['body'][_0x91cb('0x65')]||0x0}));}}return BPromise[_0x91cb('0x7f')](_0x4ac7b9);}})[_0x91cb('0x16')](function(){return _0x395e21;})[_0x91cb('0x16')](respondWithResult(_0x3710e9,null))[_0x91cb('0x2f')](handleError(_0x3710e9,null));};exports[_0x91cb('0x82')]=function(_0xd572bc,_0x1e7a48){return db[_0x91cb('0x25')]['find']({'where':{'id':_0xd572bc[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x1e7a48,null))[_0x91cb('0x16')](function(_0x51ef1c){if(_0x51ef1c){return _0x51ef1c[_0x91cb('0x82')](_0xd572bc['query'][_0x91cb('0x72')])['then'](function(){if(_[_0x91cb('0x87')](_0xd572bc[_0x91cb('0x2d')][_0x91cb('0x72')])){for(var _0x10fe63=0x0;_0x10fe63<_0xd572bc[_0x91cb('0x2d')][_0x91cb('0x72')][_0x91cb('0x37')];_0x10fe63+=0x1){socket['emit'](_0x91cb('0x88'),{'UserId':Number(_0xd572bc[_0x91cb('0x2d')][_0x91cb('0x72')][_0x10fe63]),'VoiceQueueId':Number(_0xd572bc[_0x91cb('0x30')]['id'])});}}else{socket[_0x91cb('0x85')](_0x91cb('0x88'),{'UserId':Number(_0xd572bc[_0x91cb('0x2d')]['ids']),'VoiceQueueId':Number(_0xd572bc[_0x91cb('0x30')]['id'])});}});}})[_0x91cb('0x16')](function(_0x219b5f){return db[_0x91cb('0x6c')][_0x91cb('0x17')]({'where':{'VoiceQueueId':_0xd572bc['params']['id'],'UserId':_0xd572bc['query']['ids']}})[_0x91cb('0x16')](function(){return _0x219b5f;});})[_0x91cb('0x16')](respondWithStatusCode(_0x1e7a48,null))['catch'](handleError(_0x1e7a48,null));};exports['getAgents']=function(_0x471c17,_0x6549a7){var _0x13564d={};var _0x3c1e63={};var _0x1f2d72;var _0x376adc;return db[_0x91cb('0x25')][_0x91cb('0x54')]({'where':{'id':_0x471c17['params']['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x6549a7,null))[_0x91cb('0x16')](function(_0xf15400){if(_0xf15400){_0x1f2d72=_0xf15400;_0x3c1e63['model']=_[_0x91cb('0x31')](db[_0x91cb('0x73')][_0x91cb('0x26')]);_0x3c1e63[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x471c17[_0x91cb('0x2d')]);_0x3c1e63[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x3c1e63['model'],_0x3c1e63['query']);_0x13564d[_0x91cb('0x34')]=_['intersection'](_0x3c1e63[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x471c17[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x13564d['attributes']=_0x13564d[_0x91cb('0x34')][_0x91cb('0x37')]?_0x13564d[_0x91cb('0x34')]:_0x3c1e63[_0x91cb('0x35')];_0x13564d[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x471c17[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x13564d['where']=qs[_0x91cb('0x32')](_['pick'](_0x471c17[_0x91cb('0x2d')],_0x3c1e63[_0x91cb('0x32')]));if(_0x471c17['query'][_0x91cb('0x1a')]){_0x13564d[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x13564d[_0x91cb('0x2a')],{'$or':_['map'](_0x13564d[_0x91cb('0x34')],function(_0x1bef2b){var _0x5a38f7={};_0x5a38f7[_0x1bef2b]={'$like':'%'+_0x471c17[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x5a38f7;})});}_0x13564d=_[_0x91cb('0x39')]({},_0x13564d,_0x471c17[_0x91cb('0x59')]);return _0x1f2d72[_0x91cb('0x89')](_0x13564d);}})[_0x91cb('0x16')](function(_0x2f42ef){if(_0x2f42ef){_0x376adc=_0x2f42ef[_0x91cb('0x37')];if(!_0x471c17[_0x91cb('0x2d')][_0x91cb('0x56')]('nolimit')){_0x13564d[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x471c17[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x13564d[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x471c17[_0x91cb('0x2d')][_0x91cb('0x13')]);}return _0x1f2d72[_0x91cb('0x89')](_0x13564d);}})[_0x91cb('0x16')](function(_0x31cf76){if(_0x31cf76){return _0x31cf76?{'count':_0x376adc,'rows':_0x31cf76}:null;}})['then'](respondWithResult(_0x6549a7,null))[_0x91cb('0x2f')](handleError(_0x6549a7,null));};exports['getMembers']=function(_0x3a5022,_0x17141e){var _0x3e2c58={};var _0x11c67c={};var _0xf4b4ab;var _0x2fa5e3;return db[_0x91cb('0x25')]['findOne']({'where':{'id':_0x3a5022[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x17141e,null))[_0x91cb('0x16')](function(_0x4483fb){if(_0x4483fb){_0xf4b4ab=_0x4483fb;_0x11c67c['model']=_['keys'](db['UserVoiceQueueRt'][_0x91cb('0x26')]);_0x11c67c[_0x91cb('0x2d')]=_['keys'](_0x3a5022['query']);_0x11c67c['filters']=_[_0x91cb('0x33')](_0x11c67c[_0x91cb('0x35')],_0x11c67c['query']);_0x3e2c58['attributes']=_['intersection'](_0x11c67c[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x3a5022['query'][_0x91cb('0x36')]));_0x3e2c58[_0x91cb('0x34')]=_0x3e2c58['attributes']['length']?_0x3e2c58[_0x91cb('0x34')]:_0x11c67c[_0x91cb('0x35')];_0x3e2c58[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x3a5022[_0x91cb('0x2d')]['sort']);_0x3e2c58[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_['pick'](_0x3a5022[_0x91cb('0x2d')],_0x11c67c[_0x91cb('0x32')]));if(_0x3a5022[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x3e2c58[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x3e2c58[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x3e2c58[_0x91cb('0x34')],function(_0x1ea132){var _0x3b1d97={};_0x3b1d97[_0x1ea132]={'$like':'%'+_0x3a5022[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x3b1d97;})});}_0x3e2c58=_[_0x91cb('0x39')]({},_0x3e2c58,_0x3a5022[_0x91cb('0x59')]);return _0xf4b4ab[_0x91cb('0x8a')](_0x3e2c58);}})[_0x91cb('0x16')](function(_0x5cf6df){if(_0x5cf6df){_0x2fa5e3=_0x5cf6df['length'];if(!_0x3a5022['query'][_0x91cb('0x56')]('nolimit')){_0x3e2c58[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x3a5022[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x3e2c58[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x3a5022[_0x91cb('0x2d')][_0x91cb('0x13')]);}return _0xf4b4ab['getMembers'](_0x3e2c58);}})['then'](function(_0x5f2de0){return _0x5f2de0?{'count':_0x2fa5e3,'rows':_0x5f2de0}:null;})[_0x91cb('0x16')](respondWithResult(_0x17141e,null))[_0x91cb('0x2f')](handleError(_0x17141e,null));};exports[_0x91cb('0x8b')]=function(_0x2b4e25,_0x4c044d){var _0x54c194={};var _0x3cfdcb={};var _0x1624b3;var _0x1e2acd;return db[_0x91cb('0x25')][_0x91cb('0x54')]({'where':{'id':_0x2b4e25['params']['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x4c044d,null))['then'](function(_0x1e979e){if(_0x1e979e){_0x1624b3=_0x1e979e;_0x3cfdcb[_0x91cb('0x35')]=_['keys'](db[_0x91cb('0x8c')][_0x91cb('0x26')]);_0x3cfdcb[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x2b4e25[_0x91cb('0x2d')]);_0x3cfdcb['filters']=_[_0x91cb('0x33')](_0x3cfdcb[_0x91cb('0x35')],_0x3cfdcb[_0x91cb('0x2d')]);_0x54c194[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x3cfdcb['model'],qs[_0x91cb('0x36')](_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x54c194['attributes']=_0x54c194['attributes'][_0x91cb('0x37')]?_0x54c194['attributes']:_0x3cfdcb[_0x91cb('0x35')];_0x54c194[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x2b4e25[_0x91cb('0x2d')]['sort']);_0x54c194[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_['pick'](_0x2b4e25[_0x91cb('0x2d')],_0x3cfdcb[_0x91cb('0x32')]));if(_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x54c194[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x54c194['where'],{'$or':_[_0x91cb('0x1c')](_0x54c194['attributes'],function(_0x283743){var _0x44ffde={};_0x44ffde[_0x283743]={'$like':'%'+_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x44ffde;})});}_0x54c194=_['merge']({},_0x54c194,_0x2b4e25[_0x91cb('0x59')]);return _0x1624b3[_0x91cb('0x8b')](_0x54c194);}})[_0x91cb('0x16')](function(_0x5e629){if(_0x5e629){_0x1e2acd=_0x5e629[_0x91cb('0x37')];if(!_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x54c194[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x2b4e25['query'][_0x91cb('0x12')]);_0x54c194['offset']=qs[_0x91cb('0x13')](_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x13')]);}return _0x1624b3[_0x91cb('0x8b')](_0x54c194);}})['then'](function(_0x87f382){if(_0x87f382){return _0x87f382?{'count':_0x1e2acd,'rows':_0x87f382}:null;}})[_0x91cb('0x16')](respondWithResult(_0x4c044d,null))[_0x91cb('0x2f')](handleError(_0x4c044d,null));};exports['addLists']=function(_0x330123,_0x23bc13){var _0x175d85=moment()[_0x91cb('0x6e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x97ba8,_0x4bc382;return db[_0x91cb('0x25')]['find']({'where':{'id':_0x330123[_0x91cb('0x30')]['id']}})['then'](handleEntityNotFound(_0x23bc13,null))[_0x91cb('0x16')](function(_0x399012){if(_0x399012){_0x4bc382=_0x399012;return _0x399012[_0x91cb('0x8d')](_0x330123['body']['ids'],_[_0x91cb('0x47')](_0x330123[_0x91cb('0x3c')],[_0x91cb('0x72'),'id'])||{});}return null;})[_0x91cb('0x84')](function(_0x571a6f){var _0x19596b;_0x97ba8=_0x571a6f||[];var _0x5b4849=[];if(_0x571a6f){for(var _0x39a183=0x0;_0x39a183<_0x571a6f[_0x91cb('0x37')];_0x39a183+=0x1){var _0x693690=_0x571a6f[_0x39a183][_0x91cb('0x3e')]({'plain':!![]});_0x4bc382[_0x91cb('0x8e')]=_0x330123[_0x91cb('0x3c')][_0x91cb('0x8e')]?_0x330123[_0x91cb('0x3c')]['dialCheckDuplicateType']:_0x4bc382['dialCheckDuplicateType'];switch(_0x4bc382['dialCheckDuplicateType']){case'always':_0x19596b=squel[_0x91cb('0x8f')]()[_0x91cb('0x90')](_0x91cb('0x91'))[_0x91cb('0x92')](['phone','scheduledAt',_0x91cb('0x93'),'ListId',_0x91cb('0x51'),_0x91cb('0x45'),_0x91cb('0x46')],squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0x94'),_0x91cb('0x94'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27','scheduledAt')[_0x91cb('0x75')]('id',_0x91cb('0x93'))[_0x91cb('0x75')](_0x693690[_0x91cb('0x95')]['toString'](),'ListId')['field'](_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')](),_0x91cb('0x51'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x45'))['field']('\x27'+_0x175d85+'\x27',_0x91cb('0x46'))[_0x91cb('0x97')](_0x91cb('0x98'))[_0x91cb('0x2a')](_0x91cb('0x99'))[_0x91cb('0x2a')](_0x91cb('0x9a'),_0x693690[_0x91cb('0x95')][_0x91cb('0x96')]())[_0x91cb('0x2a')](_0x91cb('0x9b'))[_0x91cb('0x2a')](_0x91cb('0x9c'),squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0x9d'))[_0x91cb('0x97')](_0x91cb('0x9e'))[_0x91cb('0x2a')](_0x91cb('0x9f'),_0x330123[_0x91cb('0x30')]['id']['toString']()))[_0x91cb('0x2a')](_0x91cb('0x9c'),squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0xa0'))['from'](_0x91cb('0x91'))[_0x91cb('0x2a')](_0x91cb('0x9f'),_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')]())))['toString']();break;case _0x91cb('0xa1'):_0x19596b=squel[_0x91cb('0x8f')]()['into'](_0x91cb('0x91'))['fromQuery']([_0x91cb('0x94'),'scheduledAt',_0x91cb('0x93'),_0x91cb('0xa2'),_0x91cb('0x51'),'createdAt',_0x91cb('0x46')],squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0x94'),_0x91cb('0x94'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0xa3'))[_0x91cb('0x75')]('id',_0x91cb('0x93'))['field'](_0x693690[_0x91cb('0x95')][_0x91cb('0x96')](),_0x91cb('0xa2'))[_0x91cb('0x75')](_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')](),_0x91cb('0x51'))['field']('\x27'+_0x175d85+'\x27',_0x91cb('0x45'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x46'))[_0x91cb('0x97')](_0x91cb('0x98'))[_0x91cb('0x2a')](_0x91cb('0x99'))['where'](_0x91cb('0x9a'),_0x693690[_0x91cb('0x95')][_0x91cb('0x96')]())[_0x91cb('0x2a')](_0x91cb('0x9b'))[_0x91cb('0x2a')](_0x91cb('0x9c'),squel[_0x91cb('0x74')]()['field']('COALESCE(phone,\x27\x27)')[_0x91cb('0x97')]('cm_hopper')[_0x91cb('0x2a')](_0x91cb('0x9f'),_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')]())))[_0x91cb('0x96')]();break;default:_0x19596b=squel['insert']()[_0x91cb('0x90')](_0x91cb('0x91'))[_0x91cb('0x92')]([_0x91cb('0x94'),_0x91cb('0xa3'),_0x91cb('0x93'),_0x91cb('0xa2'),'VoiceQueueId',_0x91cb('0x45'),_0x91cb('0x46')],squel[_0x91cb('0x74')]()['field'](_0x91cb('0x94'),'phone')['field']('\x27'+_0x175d85+'\x27',_0x91cb('0xa3'))['field']('id',_0x91cb('0x93'))[_0x91cb('0x75')](_0x693690['CmListId'][_0x91cb('0x96')](),_0x91cb('0xa2'))[_0x91cb('0x75')](_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')](),_0x91cb('0x51'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x45'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x46'))[_0x91cb('0x97')](_0x91cb('0x98'))['where'](_0x91cb('0x99'))[_0x91cb('0x2a')](_0x91cb('0x9a'),_0x693690[_0x91cb('0x95')][_0x91cb('0x96')]())['where'](_0x91cb('0x9b')))[_0x91cb('0x96')]();}_0x5b4849['push'](db[_0x91cb('0x66')]['query'](_0x19596b));}return BPromise[_0x91cb('0x7f')](_0x5b4849);}})['then'](function(){var _0x739447=[];var _0x2deed1=squel[_0x91cb('0x8f')]()[_0x91cb('0x90')](_0x91cb('0xa4'))['fromQuery']([_0x91cb('0xa5'),_0x91cb('0x94'),'OrderBy','createdAt',_0x91cb('0x46')],squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0xa6'))['field'](_0x91cb('0xa7'))[_0x91cb('0x75')](_0x91cb('0xa8'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x45'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x46'))['from'](_0x91cb('0xa9'),'ci')[_0x91cb('0x78')]('cm_hopper','h','h.ContactId=ci.CmContactId')[_0x91cb('0x2a')](_0x91cb('0xaa'),_0x175d85)[_0x91cb('0x2a')](_0x91cb('0xab'),_0x91cb('0xac')))[_0x91cb('0x96')]();_0x739447[_0x91cb('0x86')](db[_0x91cb('0x66')]['query'](_0x2deed1));return BPromise[_0x91cb('0x7f')](_0x739447);})[_0x91cb('0x16')](function(){return _0x97ba8;})[_0x91cb('0x16')](respondWithResult(_0x23bc13,null))[_0x91cb('0x2f')](handleError(_0x23bc13,null));};exports[_0x91cb('0xad')]=function(_0x554923,_0x2fe556){return db[_0x91cb('0x25')]['find']({'where':{'id':_0x554923[_0x91cb('0x30')]['id']}})['then'](handleEntityNotFound(_0x2fe556,null))[_0x91cb('0x16')](function(_0x43958a){if(_0x43958a){return _0x43958a[_0x91cb('0xad')](_0x554923['query'][_0x91cb('0x72')]);}})[_0x91cb('0x16')](function(_0x409a36){if(_0x409a36){return db[_0x91cb('0x4c')][_0x91cb('0x17')]({'where':{'ListId':_0x554923[_0x91cb('0x2d')][_0x91cb('0x72')],'VoiceQueueId':_0x554923[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](function(){return _0x409a36;});}})[_0x91cb('0x16')](respondWithStatusCode(_0x2fe556,null))['catch'](handleError(_0x2fe556,null));};exports[_0x91cb('0xae')]=function(_0x2d870d,_0x173761){var _0x2cf0d8={};var _0x9d63ff={};var _0x720de;var _0x80f0ba;return db[_0x91cb('0x25')][_0x91cb('0x54')]({'where':{'id':_0x2d870d[_0x91cb('0x30')]['id']}})['then'](handleEntityNotFound(_0x173761,null))[_0x91cb('0x16')](function(_0x800860){if(_0x800860){_0x720de=_0x800860;_0x9d63ff[_0x91cb('0x35')]=_[_0x91cb('0x31')](db[_0x91cb('0x8c')][_0x91cb('0x26')]);_0x9d63ff['query']=_['keys'](_0x2d870d[_0x91cb('0x2d')]);_0x9d63ff[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x9d63ff['model'],_0x9d63ff[_0x91cb('0x2d')]);_0x2cf0d8[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x9d63ff[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x2d870d[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x2cf0d8[_0x91cb('0x34')]=_0x2cf0d8[_0x91cb('0x34')][_0x91cb('0x37')]?_0x2cf0d8[_0x91cb('0x34')]:_0x9d63ff[_0x91cb('0x35')];_0x2cf0d8[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x2d870d[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x2cf0d8[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_[_0x91cb('0x50')](_0x2d870d['query'],_0x9d63ff[_0x91cb('0x32')]));if(_0x2d870d[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x2cf0d8['where']=_['merge'](_0x2cf0d8['where'],{'$or':_[_0x91cb('0x1c')](_0x2cf0d8[_0x91cb('0x34')],function(_0x4370f6){var _0x5bc712={};_0x5bc712[_0x4370f6]={'$like':'%'+_0x2d870d['query'][_0x91cb('0x1a')]+'%'};return _0x5bc712;})});}_0x2cf0d8=_[_0x91cb('0x39')]({},_0x2cf0d8,_0x2d870d[_0x91cb('0x59')]);return _0x720de[_0x91cb('0xae')](_0x2cf0d8);}})[_0x91cb('0x16')](function(_0x182f2c){if(_0x182f2c){_0x80f0ba=_0x182f2c[_0x91cb('0x37')];if(!_0x2d870d[_0x91cb('0x2d')][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x2cf0d8['limit']=qs['limit'](_0x2d870d[_0x91cb('0x2d')]['limit']);_0x2cf0d8[_0x91cb('0x13')]=qs['offset'](_0x2d870d['query'][_0x91cb('0x13')]);}return _0x720de['getBlackLists'](_0x2cf0d8);}})[_0x91cb('0x16')](function(_0x2ac9df){if(_0x2ac9df){return _0x2ac9df?{'count':_0x80f0ba,'rows':_0x2ac9df}:null;}})['then'](respondWithResult(_0x173761,null))[_0x91cb('0x2f')](handleError(_0x173761,null));};exports[_0x91cb('0xaf')]=function(_0x331381,_0x52ce8c){var _0x534968;return db[_0x91cb('0x25')][_0x91cb('0x3a')]({'where':{'id':_0x331381['params']['id']}})['then'](handleEntityNotFound(_0x52ce8c,null))['then'](function(_0x397397){if(_0x397397){return _0x397397[_0x91cb('0xaf')](_0x331381[_0x91cb('0x3c')][_0x91cb('0x72')],_['omit'](_0x331381[_0x91cb('0x3c')],[_0x91cb('0x72'),'id'])||{});}return null;})[_0x91cb('0x84')](function(_0x2a0c3c){var _0x30ef98;_0x534968=_0x2a0c3c||[];var _0x27d0ab=[];if(_0x2a0c3c){for(var _0x547db7=0x0;_0x547db7<_0x2a0c3c['length'];_0x547db7+=0x1){var _0x38d608=_0x2a0c3c[_0x547db7][_0x91cb('0x3e')]({'plain':!![]});_0x30ef98=squel[_0x91cb('0x8f')]()[_0x91cb('0x90')](_0x91cb('0xb0'))[_0x91cb('0x92')](['phone',_0x91cb('0x93'),_0x91cb('0xa2'),_0x91cb('0x51'),'createdAt',_0x91cb('0x46')],squel['select']()[_0x91cb('0x75')](_0x91cb('0x94'),'phone')[_0x91cb('0x75')]('id','ContactId')[_0x91cb('0x75')](_0x38d608[_0x91cb('0x95')][_0x91cb('0x96')](),_0x91cb('0xa2'))['field'](_0x331381[_0x91cb('0x30')]['id']['toString'](),_0x91cb('0x51'))['field']('NOW()',_0x91cb('0x45'))[_0x91cb('0x75')](_0x91cb('0xb1'),_0x91cb('0x46'))[_0x91cb('0x97')]('cm_contacts')['where'](_0x91cb('0x99'))['where'](_0x91cb('0x9a'),_0x38d608['CmListId'][_0x91cb('0x96')]())[_0x91cb('0x2a')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x27d0ab[_0x91cb('0x86')](db['sequelize'][_0x91cb('0x2d')](_0x30ef98));}return BPromise['all'](_0x27d0ab);}})['then'](function(){return _0x534968;})[_0x91cb('0x16')](respondWithResult(_0x52ce8c,null))[_0x91cb('0x2f')](handleError(_0x52ce8c,null));};exports[_0x91cb('0xb2')]=function(_0x4ef95b,_0x2f0269){return db[_0x91cb('0x25')][_0x91cb('0x3a')]({'where':{'id':_0x4ef95b[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x2f0269,null))['then'](function(_0x5e1b97){if(_0x5e1b97){return _0x5e1b97[_0x91cb('0xb2')](_0x4ef95b['query'][_0x91cb('0x72')]);}})[_0x91cb('0x16')](function(_0xcb3114){if(_0xcb3114){return db[_0x91cb('0x5b')][_0x91cb('0x17')]({'where':{'ListId':_0x4ef95b['query'][_0x91cb('0x72')],'VoiceQueueId':_0x4ef95b['params']['id']}})[_0x91cb('0x16')](function(){return _0xcb3114;});}})['then'](respondWithStatusCode(_0x2f0269,null))[_0x91cb('0x2f')](handleError(_0x2f0269,null));}; \ No newline at end of file +var _0x7fbe=['send','VoiceQueue','rawAttributes','fieldName','key','where','include','query','findAll','rows','catch','show','params','keys','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','inbound','outbound','update','getHoppers','findOne','hasOwnProperty','nolimit','order','sort','VoiceQueueId','CmHopper','CmHopperHistory','pick','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','Agents','forEach','penalty','sequelize','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','interface','format','SIP/%s','voicePause','userVoiceQueue:save','removeTeams','ids','User','select','field','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','transaction','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','emit','online','isNil','isArray','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','cm_contacts','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','get','VoiceQueues','QueueCampaigns','filter','map','value','type','name','sendStatus','error'];(function(_0x37e069,_0x5edc46){var _0x5cb67e=function(_0x33a3f4){while(--_0x33a3f4){_0x37e069['push'](_0x37e069['shift']());}};_0x5cb67e(++_0x5edc46);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x41bdd4,_0x3d5c76){_0x41bdd4=_0x41bdd4-0x0;var _0x5c03a6=_0x7fbe[_0x41bdd4];return _0x5c03a6;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xe7fb('0x0'));var _=require(_0xe7fb('0x1'));var squel=require(_0xe7fb('0x2'));var Redis=require(_0xe7fb('0x3'));var qs=require(_0xe7fb('0x4'));var logger=require(_0xe7fb('0x5'))(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var db=require(_0xe7fb('0x8'))['db'];config[_0xe7fb('0x9')]=_[_0xe7fb('0xa')](config[_0xe7fb('0x9')],{'host':_0xe7fb('0xb'),'port':0x18eb});var socket=require(_0xe7fb('0xc'))(new Redis(config['redis']));require(_0xe7fb('0xd'))[_0xe7fb('0xe')](socket);function respondWithStatusCode(_0x1d0741,_0x190a7a){_0x190a7a=_0x190a7a||0xcc;return function(_0x4ba197){if(_0x4ba197){return _0x1d0741['sendStatus'](_0x190a7a);}return _0x1d0741[_0xe7fb('0xf')](_0x190a7a)[_0xe7fb('0x10')]();};}function respondWithResult(_0x41a514,_0x348a73){_0x348a73=_0x348a73||0xc8;return function(_0x2a2223){if(_0x2a2223){return _0x41a514[_0xe7fb('0xf')](_0x348a73)[_0xe7fb('0x11')](_0x2a2223);}};}function respondWithFilteredResult(_0x3c07f3,_0x325035){return function(_0x2fe8ab){if(_0x2fe8ab){var _0x2437d4=typeof _0x325035[_0xe7fb('0x12')]===_0xe7fb('0x13')&&typeof _0x325035[_0xe7fb('0x14')]===_0xe7fb('0x13');var _0x598729=_0x2fe8ab[_0xe7fb('0x15')];var _0x2225e5=_0x2437d4?0x0:_0x325035['offset'];var _0x30015a=_0x2437d4?_0x2fe8ab[_0xe7fb('0x15')]:_0x325035['offset']+_0x325035[_0xe7fb('0x14')];var _0x559129;if(_0x30015a>=_0x598729){_0x30015a=_0x598729;_0x559129=0xc8;}else{_0x559129=0xce;}_0x3c07f3[_0xe7fb('0xf')](_0x559129);return _0x3c07f3[_0xe7fb('0x16')](_0xe7fb('0x17'),_0x2225e5+'-'+_0x30015a+'/'+_0x598729)[_0xe7fb('0x11')](_0x2fe8ab);}return null;};}function saveUpdates(_0x562262){return function(_0x892b0f){if(_0x892b0f){return _0x892b0f['update'](_0x562262)[_0xe7fb('0x18')](function(_0x546463){return _0x546463;});}return null;};}function removeEntity(_0x1e77fd){return function(_0x4708f7){if(_0x4708f7){return _0x4708f7[_0xe7fb('0x19')]()[_0xe7fb('0x18')](function(){var _0x5df1a1=_0x4708f7[_0xe7fb('0x1a')]({'plain':!![]});var _0x5d1c87=[{'name':_0xe7fb('0x1b'),'value':'inbound','ignore':![]},{'name':_0xe7fb('0x1c'),'value':'outbound','ignore':![]}];var _0xa5af01=_(_0x5d1c87)[_0xe7fb('0x1d')]('ignore')[_0xe7fb('0x1e')](_0xe7fb('0x1f'))[_0xe7fb('0x1f')]();if(_['includes'](_0xa5af01,_0x5df1a1[_0xe7fb('0x20')])){return;}var _0x469ead=_['find'](_0x5d1c87,['value',_0x5df1a1['type']])[_0xe7fb('0x21')];return db['UserProfileResource']['destroy']({'where':{'type':_0x469ead,'resourceId':_0x5df1a1['id']}})[_0xe7fb('0x18')](function(){return _0x4708f7;});})[_0xe7fb('0x18')](function(){_0x1e77fd[_0xe7fb('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6c930){return function(_0x2b69c4){if(!_0x2b69c4){_0x6c930[_0xe7fb('0x22')](0x194);}return _0x2b69c4;};}function handleError(_0x1ceed8,_0x392d75){_0x392d75=_0x392d75||0x1f4;return function(_0x16237a){logger[_0xe7fb('0x23')](_0x16237a['stack']);if(_0x16237a['name']){delete _0x16237a[_0xe7fb('0x21')];}_0x1ceed8[_0xe7fb('0xf')](_0x392d75)[_0xe7fb('0x24')](_0x16237a);};}exports['index']=function(_0xb1f2f4,_0x251807){var _0xd3fffe={};var _0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x1e')](db[_0xe7fb('0x25')][_0xe7fb('0x26')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x27')],'type':_0x4ce993[_0xe7fb('0x20')][_0xe7fb('0x28')]};});_0xd3fffe=qs['getOptions'](_0x219554,_0xb1f2f4);var _0x517d70={'where':_0xd3fffe[_0xe7fb('0x29')]};return db['VoiceQueue'][_0xe7fb('0x15')](_0x517d70)[_0xe7fb('0x18')](function(_0xe49053){_0x5f265f[_0xe7fb('0x15')]=_0xe49053;_0xd3fffe['include']=qs[_0xe7fb('0x2a')](_0xb1f2f4[_0xe7fb('0x2b')]);return db[_0xe7fb('0x25')][_0xe7fb('0x2c')](_0xd3fffe);})[_0xe7fb('0x18')](function(_0x480819){_0x5f265f[_0xe7fb('0x2d')]=_0x480819;return _0x5f265f;})[_0xe7fb('0x18')](respondWithFilteredResult(_0x251807,_0xd3fffe))[_0xe7fb('0x2e')](handleError(_0x251807,null));};exports[_0xe7fb('0x2f')]=function(_0x46f430,_0x25e925){var _0x1bc72d={'raw':![],'where':{'id':_0x46f430[_0xe7fb('0x30')]['id']}},_0x147eb1={};_0x147eb1['model']=_[_0xe7fb('0x31')](db[_0xe7fb('0x25')][_0xe7fb('0x26')]);_0x147eb1['query']=_[_0xe7fb('0x31')](_0x46f430[_0xe7fb('0x2b')]);_0x147eb1[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x147eb1[_0xe7fb('0x34')],_0x147eb1[_0xe7fb('0x2b')]);_0x1bc72d[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x147eb1[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x46f430[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x1bc72d[_0xe7fb('0x35')]=_0x1bc72d[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x1bc72d[_0xe7fb('0x35')]:_0x147eb1[_0xe7fb('0x34')];if(_0x46f430[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x1bc72d['include']=[{'all':!![]}];}_0x1bc72d=_[_0xe7fb('0x39')]({},_0x1bc72d,_0x46f430[_0xe7fb('0x3a')]);return db[_0xe7fb('0x25')][_0xe7fb('0x3b')](_0x1bc72d)['then'](handleEntityNotFound(_0x25e925,null))[_0xe7fb('0x18')](respondWithResult(_0x25e925,null))[_0xe7fb('0x2e')](handleError(_0x25e925,null));};exports[_0xe7fb('0x3c')]=function(_0x413a13,_0x49fe9d){return db[_0xe7fb('0x25')][_0xe7fb('0x3c')](_0x413a13[_0xe7fb('0x3d')],{})[_0xe7fb('0x18')](function(_0x468d16){var _0xb729fc=_0x413a13['user'][_0xe7fb('0x1a')]({'plain':!![]});if(!_0xb729fc)throw new Error(_0xe7fb('0x3e'));if(_0xb729fc[_0xe7fb('0x3f')]==='user'){var _0x36a341=_0x468d16[_0xe7fb('0x1a')]({'plain':!![]});var _0x5d42ac=[{'name':'VoiceQueues','value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x900d67=_[_0xe7fb('0x3b')](_0x5d42ac,[_0xe7fb('0x1f'),_0x36a341['type']])[_0xe7fb('0x21')];return db['UserProfileSection'][_0xe7fb('0x3b')]({'where':{'name':_0x900d67,'userProfileId':_0xb729fc[_0xe7fb('0x40')]},'raw':!![]})['then'](function(_0x108a16){if(_0x108a16&&_0x108a16[_0xe7fb('0x41')]===0x0){return db[_0xe7fb('0x42')][_0xe7fb('0x3c')]({'name':_0x36a341['name'],'resourceId':_0x36a341['id'],'type':_0x108a16[_0xe7fb('0x21')],'sectionId':_0x108a16['id']},{})[_0xe7fb('0x18')](function(){return _0x468d16;});}else{return _0x468d16;}})[_0xe7fb('0x2e')](function(_0x56a84f){logger[_0xe7fb('0x23')](_0xe7fb('0x43'),_0x56a84f);throw _0x56a84f;});}return _0x468d16;})[_0xe7fb('0x18')](respondWithResult(_0x49fe9d,0xc9))[_0xe7fb('0x2e')](handleError(_0x49fe9d,null));};exports[_0xe7fb('0x44')]=function(_0x5a1ce1,_0x2eb999){var _0x4df4aa={'where':{'id':_0x5a1ce1[_0xe7fb('0x30')]['id']}},_0x2c72dd={};_0x2c72dd[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x25')]['rawAttributes']);_0x4df4aa[_0xe7fb('0x35')]=_['intersection'](_0x2c72dd['model'],qs[_0xe7fb('0x36')](_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x4df4aa['attributes']=_0x4df4aa[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x4df4aa['attributes']:_0x2c72dd['model'];if(_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x4df4aa[_0xe7fb('0x2a')]=[{'all':!![]}];}_0x4df4aa=_[_0xe7fb('0x39')]({},_0x4df4aa,_0x5a1ce1[_0xe7fb('0x3a')]);return db[_0xe7fb('0x25')][_0xe7fb('0x3b')](_0x4df4aa)[_0xe7fb('0x18')](handleEntityNotFound(_0x2eb999,null))['then'](function(_0x925a5e){if(_0x925a5e){var _0x5cc28f=_0x925a5e[_0xe7fb('0x1a')]({'plain':!![]});_0x5cc28f=qs[_0xe7fb('0x45')](_0x5cc28f,['id','createdAt',_0xe7fb('0x46')]);_0x5a1ce1['body']=_[_0xe7fb('0x45')](_0x5a1ce1['body'],['id',_0xe7fb('0x47'),'updatedAt']);return db[_0xe7fb('0x25')]['create'](_[_0xe7fb('0x39')](_0x5cc28f,_0x5a1ce1[_0xe7fb('0x3d')]),{'include':_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x38')]?[{'all':!![]}]:undefined})[_0xe7fb('0x18')](function(_0x2f959d){var _0x2f4760=_0x5a1ce1['user']['get']({'plain':!![]});if(!_0x2f4760)throw new Error(_0xe7fb('0x3e'));if(_0x2f4760['role']==='user'){var _0x4c3eb7=_0x2f959d['get']({'plain':!![]});var _0x539252=[{'name':_0xe7fb('0x1b'),'value':_0xe7fb('0x48')},{'name':_0xe7fb('0x1c'),'value':_0xe7fb('0x49')}];var _0x59c92d=_[_0xe7fb('0x3b')](_0x539252,[_0xe7fb('0x1f'),_0x4c3eb7[_0xe7fb('0x20')]])['name'];return db['UserProfileSection'][_0xe7fb('0x3b')]({'where':{'name':_0x59c92d,'userProfileId':_0x2f4760[_0xe7fb('0x40')]},'raw':!![]})[_0xe7fb('0x18')](function(_0x4f4ba3){if(_0x4f4ba3&&_0x4f4ba3[_0xe7fb('0x41')]===0x0){return db[_0xe7fb('0x42')][_0xe7fb('0x3c')]({'name':_0x4c3eb7[_0xe7fb('0x21')],'resourceId':_0x4c3eb7['id'],'type':_0x4f4ba3['name'],'sectionId':_0x4f4ba3['id']},{})['then'](function(){return _0x2f959d;});}else{return _0x2f959d;}})[_0xe7fb('0x2e')](function(_0x3104c2){logger[_0xe7fb('0x23')](_0xe7fb('0x43'),_0x3104c2);throw _0x3104c2;});}return _0x2f959d;});}})[_0xe7fb('0x18')](respondWithResult(_0x2eb999,0xc9))['catch'](handleError(_0x2eb999,null));};exports[_0xe7fb('0x4a')]=function(_0x349a2a,_0x23755b){if(_0x349a2a['body']['id']){delete _0x349a2a['body']['id'];}return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x349a2a[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x23755b,null))[_0xe7fb('0x18')](saveUpdates(_0x349a2a[_0xe7fb('0x3d')],null))['then'](respondWithResult(_0x23755b,null))[_0xe7fb('0x2e')](handleError(_0x23755b,null));};exports[_0xe7fb('0x19')]=function(_0x2cd4e5,_0x1aef59){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x2cd4e5['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x1aef59,null))['then'](removeEntity(_0x1aef59,null))[_0xe7fb('0x2e')](handleError(_0x1aef59,null));};exports[_0xe7fb('0x4b')]=function(_0x116c7e,_0x1b24fd){var _0x5925e6={'raw':![],'where':{}};var _0x47ac92={};var _0x2789a4={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x116c7e[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x1b24fd,null))['then'](function(_0x4096d4){if(_0x4096d4){_0x47ac92['model']=_[_0xe7fb('0x31')](db['CmHopper']['rawAttributes']);_0x47ac92[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x116c7e[_0xe7fb('0x2b')]);_0x47ac92['filters']=_[_0xe7fb('0x33')](_0x47ac92[_0xe7fb('0x34')],_0x47ac92[_0xe7fb('0x2b')]);_0x5925e6[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x47ac92['model'],qs[_0xe7fb('0x36')](_0x116c7e[_0xe7fb('0x2b')]['fields']));_0x5925e6[_0xe7fb('0x35')]=_0x5925e6[_0xe7fb('0x35')]['length']?_0x5925e6[_0xe7fb('0x35')]:_0x47ac92['model'];if(!_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x5925e6['limit']=qs[_0xe7fb('0x14')](_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x5925e6[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}_0x5925e6[_0xe7fb('0x4f')]=qs['sort'](_0x116c7e['query'][_0xe7fb('0x50')]);_0x5925e6[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_['pick'](_0x116c7e['query'],_0x47ac92[_0xe7fb('0x32')]));_0x5925e6[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x4096d4['id'];if(_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x5925e6[_0xe7fb('0x29')]=_[_0xe7fb('0x39')](_0x5925e6[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x5925e6[_0xe7fb('0x35')],function(_0x1ff5e7){var _0xf423ab={};_0xf423ab[_0x1ff5e7]={'$like':'%'+_0x116c7e[_0xe7fb('0x2b')]['filter']+'%'};return _0xf423ab;})});}_0x5925e6=_['merge']({},_0x5925e6,_0x116c7e[_0xe7fb('0x3a')]);return db[_0xe7fb('0x52')][_0xe7fb('0x15')]({'where':_0x5925e6[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x562493){_0x2789a4[_0xe7fb('0x15')]=_0x562493;if(_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x5925e6[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x52')][_0xe7fb('0x2c')](_0x5925e6);})[_0xe7fb('0x18')](function(_0x1e6256){_0x2789a4[_0xe7fb('0x2d')]=_0x1e6256;return _0x2789a4;});}})['then'](respondWithFilteredResult(_0x1b24fd,_0x5925e6))[_0xe7fb('0x2e')](handleError(_0x1b24fd,null));};exports['getHopperHistories']=function(_0x279663,_0x2f13f2){var _0x2a2079={'raw':!![],'where':{}};var _0x31c159={};var _0x318d06={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x279663[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x2f13f2,null))[_0xe7fb('0x18')](function(_0x15d881){if(_0x15d881){_0x31c159[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x53')][_0xe7fb('0x26')]);_0x31c159[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x279663[_0xe7fb('0x2b')]);_0x31c159[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x31c159['model'],_0x31c159['query']);_0x2a2079['attributes']=_[_0xe7fb('0x33')](_0x31c159[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x279663[_0xe7fb('0x2b')]['fields']));_0x2a2079[_0xe7fb('0x35')]=_0x2a2079[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x2a2079[_0xe7fb('0x35')]:_0x31c159['model'];if(!_0x279663[_0xe7fb('0x2b')]['hasOwnProperty'](_0xe7fb('0x4e'))){_0x2a2079[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x2a2079['offset']=qs[_0xe7fb('0x12')](_0x279663['query'][_0xe7fb('0x12')]);}_0x2a2079['order']=qs[_0xe7fb('0x50')](_0x279663[_0xe7fb('0x2b')]['sort']);_0x2a2079[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x279663[_0xe7fb('0x2b')],_0x31c159['filters']));_0x2a2079[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x15d881['id'];if(_0x279663[_0xe7fb('0x2b')]['filter']){_0x2a2079[_0xe7fb('0x29')]=_['merge'](_0x2a2079['where'],{'$or':_['map'](_0x2a2079[_0xe7fb('0x35')],function(_0x27019a){var _0x4a8a65={};_0x4a8a65[_0x27019a]={'$like':'%'+_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x4a8a65;})});}_0x2a2079=_[_0xe7fb('0x39')]({},_0x2a2079,_0x279663[_0xe7fb('0x3a')]);return db[_0xe7fb('0x53')][_0xe7fb('0x15')]({'where':_0x2a2079[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x42190e){_0x318d06[_0xe7fb('0x15')]=_0x42190e;if(_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x2a2079[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x53')][_0xe7fb('0x2c')](_0x2a2079);})[_0xe7fb('0x18')](function(_0x3c5bd9){_0x318d06[_0xe7fb('0x2d')]=_0x3c5bd9;return _0x318d06;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x2f13f2,_0x2a2079))[_0xe7fb('0x2e')](handleError(_0x2f13f2,null));};exports['getHopperFinals']=function(_0x47568c,_0x185ac0){var _0xc3958f={'raw':!![],'where':{}};var _0x1b8fdb={};var _0x19fe06={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x47568c['params']['id']}})['then'](handleEntityNotFound(_0x185ac0,null))[_0xe7fb('0x18')](function(_0x4e1865){if(_0x4e1865){_0x1b8fdb[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db['CmHopperFinal'][_0xe7fb('0x26')]);_0x1b8fdb[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x47568c[_0xe7fb('0x2b')]);_0x1b8fdb[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x1b8fdb['model'],_0x1b8fdb[_0xe7fb('0x2b')]);_0xc3958f[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x1b8fdb[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x47568c[_0xe7fb('0x2b')]['fields']));_0xc3958f['attributes']=_0xc3958f['attributes'][_0xe7fb('0x37')]?_0xc3958f[_0xe7fb('0x35')]:_0x1b8fdb[_0xe7fb('0x34')];if(!_0x47568c['query'][_0xe7fb('0x4d')]('nolimit')){_0xc3958f[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0xc3958f['offset']=qs[_0xe7fb('0x12')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}_0xc3958f[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0xc3958f[_0xe7fb('0x29')]=qs['filters'](_['pick'](_0x47568c[_0xe7fb('0x2b')],_0x1b8fdb['filters']));_0xc3958f[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x4e1865['id'];if(_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0xc3958f['where']=_['merge'](_0xc3958f[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0xc3958f['attributes'],function(_0x21cb12){var _0x431d21={};_0x431d21[_0x21cb12]={'$like':'%'+_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x431d21;})});}_0xc3958f=_[_0xe7fb('0x39')]({},_0xc3958f,_0x47568c[_0xe7fb('0x3a')]);return db['CmHopperFinal'][_0xe7fb('0x15')]({'where':_0xc3958f[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x2607b9){_0x19fe06[_0xe7fb('0x15')]=_0x2607b9;if(_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0xc3958f[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x55')][_0xe7fb('0x2c')](_0xc3958f);})[_0xe7fb('0x18')](function(_0x3b1a90){_0x19fe06[_0xe7fb('0x2d')]=_0x3b1a90;return _0x19fe06;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x185ac0,_0xc3958f))[_0xe7fb('0x2e')](handleError(_0x185ac0,null));};exports[_0xe7fb('0x56')]=function(_0x27c100,_0x19e86f){var _0x4b4cf6={'raw':!![],'where':{}};var _0x173d85={};var _0xa1368a={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x27c100['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x19e86f,null))[_0xe7fb('0x18')](function(_0x4ca09c){if(_0x4ca09c){_0x173d85[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x57')]['rawAttributes']);_0x173d85[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x27c100['query']);_0x173d85['filters']=_[_0xe7fb('0x33')](_0x173d85[_0xe7fb('0x34')],_0x173d85[_0xe7fb('0x2b')]);_0x4b4cf6[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x173d85[_0xe7fb('0x34')],qs['fields'](_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x4b4cf6[_0xe7fb('0x35')]=_0x4b4cf6['attributes'][_0xe7fb('0x37')]?_0x4b4cf6[_0xe7fb('0x35')]:_0x173d85[_0xe7fb('0x34')];if(!_0x27c100[_0xe7fb('0x2b')]['hasOwnProperty'](_0xe7fb('0x4e'))){_0x4b4cf6[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x27c100['query'][_0xe7fb('0x14')]);_0x4b4cf6[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x27c100[_0xe7fb('0x2b')]['offset']);}_0x4b4cf6[_0xe7fb('0x4f')]=qs['sort'](_0x27c100[_0xe7fb('0x2b')]['sort']);_0x4b4cf6[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_['pick'](_0x27c100['query'],_0x173d85[_0xe7fb('0x32')]));_0x4b4cf6['where'][_0xe7fb('0x51')]=_0x4ca09c['id'];if(_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x4b4cf6[_0xe7fb('0x29')]=_['merge'](_0x4b4cf6[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x4b4cf6[_0xe7fb('0x35')],function(_0x27a822){var _0x5505e5={};_0x5505e5[_0x27a822]={'$like':'%'+_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x5505e5;})});}_0x4b4cf6=_[_0xe7fb('0x39')]({},_0x4b4cf6,_0x27c100[_0xe7fb('0x3a')]);return db[_0xe7fb('0x57')]['count']({'where':_0x4b4cf6[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x54233){_0xa1368a[_0xe7fb('0x15')]=_0x54233;if(_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x4b4cf6[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x57')][_0xe7fb('0x2c')](_0x4b4cf6);})['then'](function(_0x795e32){_0xa1368a[_0xe7fb('0x2d')]=_0x795e32;return _0xa1368a;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x19e86f,_0x4b4cf6))[_0xe7fb('0x2e')](handleError(_0x19e86f,null));};exports[_0xe7fb('0x58')]=function(_0x16f2b1,_0x3a8154){var _0x51335c={};var _0x4f4772={};var _0x4ef7b4;var _0x1bcee7;return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x16f2b1['params']['id']}})['then'](handleEntityNotFound(_0x3a8154,null))[_0xe7fb('0x18')](function(_0x5bd869){if(_0x5bd869){_0x4ef7b4=_0x5bd869;_0x4f4772[_0xe7fb('0x34')]=_['keys'](db[_0xe7fb('0x59')][_0xe7fb('0x26')]);_0x4f4772[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x16f2b1[_0xe7fb('0x2b')]);_0x4f4772[_0xe7fb('0x32')]=_['intersection'](_0x4f4772[_0xe7fb('0x34')],_0x4f4772[_0xe7fb('0x2b')]);_0x51335c[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x4f4772[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x16f2b1[_0xe7fb('0x2b')]['fields']));_0x51335c[_0xe7fb('0x35')]=_0x51335c[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x51335c[_0xe7fb('0x35')]:_0x4f4772['model'];_0x51335c[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x51335c[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x16f2b1['query'],_0x4f4772['filters']));if(_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x51335c['where']=_[_0xe7fb('0x39')](_0x51335c['where'],{'$or':_[_0xe7fb('0x1e')](_0x51335c[_0xe7fb('0x35')],function(_0x220d72){var _0x5ea91d={};_0x5ea91d[_0x220d72]={'$like':'%'+_0x16f2b1['query'][_0xe7fb('0x1d')]+'%'};return _0x5ea91d;})});}_0x51335c=_['merge']({},_0x51335c,_0x16f2b1['options']);return _0x4ef7b4[_0xe7fb('0x58')](_0x51335c);}})[_0xe7fb('0x18')](function(_0x3b073e){if(_0x3b073e){_0x1bcee7=_0x3b073e[_0xe7fb('0x37')];if(!_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x51335c[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x51335c[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x4ef7b4[_0xe7fb('0x58')](_0x51335c);}})[_0xe7fb('0x18')](function(_0x249d6f){if(_0x249d6f){return _0x249d6f?{'count':_0x1bcee7,'rows':_0x249d6f}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x3a8154,null))['catch'](handleError(_0x3a8154,null));};exports[_0xe7fb('0x5a')]=function(_0x19ebe2,_0x3406ed){var _0x1631cc=_0x19ebe2['body'][_0xe7fb('0x5b')];var _0x21ee89=_[_0xe7fb('0x1e')](_0x1631cc,'id');return db[_0xe7fb('0x59')][_0xe7fb('0x2c')]({'where':{'id':_0x21ee89},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe7fb('0x21'),'online','voicePause','interface'],'raw':!![]}]})[_0xe7fb('0x18')](function(_0x5a97c8){if(_0x5a97c8){var _0x503ae2=_['flatMap'](_0x5a97c8,function(_0x2ccf71){var _0x35be16=_0x2ccf71[_0xe7fb('0x1a')]({'plain':!![]});_0x35be16[_0xe7fb('0x5c')][_0xe7fb('0x5d')](function(_0x1db971){_0x1db971['penalty']=_['find'](_0x1631cc,{'id':_0x35be16['id']})[_0xe7fb('0x5e')];});return _0x35be16['Agents'];});return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x19ebe2[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(_0x3891ed){return db[_0xe7fb('0x5f')]['transaction'](function(_0x4aa499){return _0x3891ed[_0xe7fb('0x5a')](_0x21ee89,{'transaction':_0x4aa499})[_0xe7fb('0x18')](function(){return BPromise[_0xe7fb('0x60')](_0x1631cc,function(_0x7a7a6b){return db[_0xe7fb('0x61')][_0xe7fb('0x62')]({'TeamId':_0x7a7a6b['id'],'VoiceQueueId':_0x19ebe2['params']['id'],'penalty':_0x7a7a6b[_0xe7fb('0x5e')]},{'transaction':_0x4aa499});});})[_0xe7fb('0x18')](function(){return BPromise[_0xe7fb('0x60')](_0x503ae2,function(_0x33d638){return db[_0xe7fb('0x63')]['findOrCreate']({'where':{'UserId':_0x33d638['id'],'VoiceQueueId':_0x19ebe2[_0xe7fb('0x30')]['id']},'defaults':{'penalty':_0x33d638[_0xe7fb('0x5e')]},'transaction':_0x4aa499});});})[_0xe7fb('0x18')](function(){return BPromise['each'](_['filter'](_0x503ae2,{'online':!![]}),function(_0x5d30ef){return db[_0xe7fb('0x64')]['upsert']({'membername':_0x5d30ef['name'],'UserId':_0x5d30ef['id'],'queue_name':_0x3891ed[_0xe7fb('0x21')],'VoiceQueueId':_0x3891ed['id'],'interface':_['isNil'](_0x5d30ef[_0xe7fb('0x65')])?util[_0xe7fb('0x66')](_0xe7fb('0x67'),_0x5d30ef[_0xe7fb('0x21')]):_0x5d30ef[_0xe7fb('0x65')],'paused':_0x5d30ef[_0xe7fb('0x68')]||![],'penalty':_0x5d30ef[_0xe7fb('0x5e')]},{'transaction':_0x4aa499});});})['then'](function(){_0x503ae2[_0xe7fb('0x5d')](function(_0x16e9d4){socket['emit'](_0xe7fb('0x69'),{'UserId':_0x16e9d4['id'],'VoiceQueueId':_0x3891ed['id']});});});});});}})[_0xe7fb('0x18')](respondWithStatusCode(_0x3406ed,null))[_0xe7fb('0x2e')](handleError(_0x3406ed,null));};exports[_0xe7fb('0x6a')]=function(_0x366acb,_0x4d2c92){return db['Team'][_0xe7fb('0x2c')]({'where':{'id':_0x366acb[_0xe7fb('0x2b')][_0xe7fb('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xe7fb('0x6c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe7fb('0x18')](handleEntityNotFound(_0x4d2c92,null))[_0xe7fb('0x18')](function(_0x2e276c){var _0x4efcdc=_[_0xe7fb('0x1e')](_0x2e276c,'id');var _0x146fc9=[];var _0x470718=[];var _0x55048c=squel[_0xe7fb('0x6d')]();_0x55048c[_0xe7fb('0x6e')]('tq.TeamId')[_0xe7fb('0x6f')](_0xe7fb('0x70'),'tq')['join'](_0xe7fb('0x71'),'ut',_0xe7fb('0x72'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x366acb[_0xe7fb('0x30')]['id']);for(var _0x5d9b58=0x0;_0x5d9b58<_0x2e276c['length'];_0x5d9b58+=0x1){let _0x5986f1=_0x2e276c[_0x5d9b58];for(var _0x23ec12=0x0;_0x23ec12<_0x5986f1[_0xe7fb('0x5c')][_0xe7fb('0x37')];_0x23ec12+=0x1){let _0x36be03=_0x5986f1['Agents'][_0x23ec12];var _0x29de1e=_0x55048c[_0xe7fb('0x44')]();_0x29de1e['where']('ut.UserId\x20=\x20?',_0x36be03['id']);_0x470718[_0xe7fb('0x74')](db[_0xe7fb('0x5f')][_0xe7fb('0x2b')](_0x29de1e[_0xe7fb('0x75')](),{'type':db[_0xe7fb('0x5f')]['QueryTypes'][_0xe7fb('0x76')]})[_0xe7fb('0x18')](function(_0xe52155){if(_0xe52155['length']===0x1){return _0x36be03['id'];}else{var _0x20b1fc=_[_0xe7fb('0x77')](_['map'](_0xe52155,_0xe7fb('0x78')),function(_0x6ec6b6){return _[_0xe7fb('0x79')](_0x4efcdc,_0x6ec6b6);});if(_0x20b1fc){return _0x36be03['id'];}}}));}}return BPromise[_0xe7fb('0x7a')](_0x470718)['then'](function(_0x4ed327){_0x146fc9=_(_0x146fc9)[_0xe7fb('0x7b')](_0x4ed327)[_0xe7fb('0x7c')]()[_0xe7fb('0x1f')]();return db['VoiceQueue'][_0xe7fb('0x3b')]({'where':{'id':_0x366acb[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(_0x49fb4b){return db[_0xe7fb('0x5f')][_0xe7fb('0x7d')](function(_0x362fe1){return _0x49fb4b['removeTeams'](_0x366acb[_0xe7fb('0x2b')][_0xe7fb('0x6b')],{'transaction':_0x362fe1})[_0xe7fb('0x18')](function(){if(!_[_0xe7fb('0x7e')](_0x146fc9)){return _0x49fb4b[_0xe7fb('0x7f')](_0x146fc9,{'transaction':_0x362fe1})[_0xe7fb('0x18')](function(){return db[_0xe7fb('0x64')][_0xe7fb('0x19')]({'where':{'VoiceQueueId':_0x366acb['params']['id'],'UserId':_0x146fc9},'transaction':_0x362fe1});});}})[_0xe7fb('0x18')](function(){_0x146fc9[_0xe7fb('0x5d')](function(_0x5dadac){socket['emit'](_0xe7fb('0x80'),{'UserId':_0x5dadac,'VoiceQueueId':_0x49fb4b['id']});});});});});});})[_0xe7fb('0x18')](respondWithStatusCode(_0x4d2c92,null))[_0xe7fb('0x2e')](handleError(_0x4d2c92,null));};exports[_0xe7fb('0x81')]=function(_0x4b58de,_0x4386ea){var _0x41c771,_0x489c9d;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x4b58de[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x4386ea,null))[_0xe7fb('0x18')](function(_0x39fef6){if(_0x39fef6){_0x489c9d=_0x39fef6;return _0x39fef6[_0xe7fb('0x81')](_0x4b58de['body'][_0xe7fb('0x6b')],_['omit'](_0x4b58de[_0xe7fb('0x3d')],['ids','id'])||{})['spread'](function(_0x260067){for(var _0xed4af4=0x0;_0xed4af4<_0x4b58de[_0xe7fb('0x3d')][_0xe7fb('0x6b')][_0xe7fb('0x37')];_0xed4af4+=0x1){socket[_0xe7fb('0x82')](_0xe7fb('0x69'),{'UserId':Number(_0x4b58de['body'][_0xe7fb('0x6b')][_0xed4af4]),'VoiceQueueId':Number(_0x4b58de[_0xe7fb('0x30')]['id'])});}return _0x260067;});}})[_0xe7fb('0x18')](function(_0x19a7ec){_0x41c771=_0x19a7ec||[];if(_0x489c9d){return db[_0xe7fb('0x6c')][_0xe7fb('0x2c')]({'where':{'id':_0x4b58de[_0xe7fb('0x3d')]['ids']},'attributes':['id',_0xe7fb('0x21'),_0xe7fb('0x83'),_0xe7fb('0x68'),'interface'],'raw':!![]});}})[_0xe7fb('0x18')](function(_0x52c758){if(!_['isEmpty'](_0x52c758)){var _0x4930c6=[];for(var _0x1a3d44=0x0;_0x1a3d44<_0x52c758[_0xe7fb('0x37')];_0x1a3d44++){if(_0x52c758[_0x1a3d44]['online']){_0x4930c6[_0xe7fb('0x74')](db[_0xe7fb('0x64')]['upsert']({'membername':_0x52c758[_0x1a3d44]['name'],'UserId':_0x52c758[_0x1a3d44]['id'],'queue_name':_0x489c9d[_0xe7fb('0x21')],'VoiceQueueId':_0x489c9d['id'],'interface':_[_0xe7fb('0x84')](_0x52c758[_0x1a3d44][_0xe7fb('0x65')])?util['format'](_0xe7fb('0x67'),_0x52c758[_0x1a3d44][_0xe7fb('0x21')]):_0x52c758[_0x1a3d44]['interface'],'paused':_0x52c758[_0x1a3d44]['voicePause']||![],'penalty':_0x4b58de[_0xe7fb('0x3d')]['penalty']||0x0}));}}return BPromise['all'](_0x4930c6);}})['then'](function(){return _0x41c771;})[_0xe7fb('0x18')](respondWithResult(_0x4386ea,null))[_0xe7fb('0x2e')](handleError(_0x4386ea,null));};exports['removeAgents']=function(_0x35b5ad,_0x55c935){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x35b5ad[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x55c935,null))[_0xe7fb('0x18')](function(_0x4736bf){if(_0x4736bf){return _0x4736bf[_0xe7fb('0x7f')](_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')])[_0xe7fb('0x18')](function(){if(_[_0xe7fb('0x85')](_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')])){for(var _0x5744a8=0x0;_0x5744a8<_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')]['length'];_0x5744a8+=0x1){socket['emit'](_0xe7fb('0x80'),{'UserId':Number(_0x35b5ad['query'][_0xe7fb('0x6b')][_0x5744a8]),'VoiceQueueId':Number(_0x35b5ad[_0xe7fb('0x30')]['id'])});}}else{socket[_0xe7fb('0x82')](_0xe7fb('0x80'),{'UserId':Number(_0x35b5ad[_0xe7fb('0x2b')]['ids']),'VoiceQueueId':Number(_0x35b5ad['params']['id'])});}});}})[_0xe7fb('0x18')](function(_0x27b153){return db[_0xe7fb('0x64')][_0xe7fb('0x19')]({'where':{'VoiceQueueId':_0x35b5ad[_0xe7fb('0x30')]['id'],'UserId':_0x35b5ad['query'][_0xe7fb('0x6b')]}})['then'](function(){return _0x27b153;});})[_0xe7fb('0x18')](respondWithStatusCode(_0x55c935,null))[_0xe7fb('0x2e')](handleError(_0x55c935,null));};exports['getAgents']=function(_0x5d0f05,_0x519e35){var _0x16ae95={};var _0xb1a3fa={};var _0x59e676;var _0x577895;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x5d0f05['params']['id']}})['then'](handleEntityNotFound(_0x519e35,null))[_0xe7fb('0x18')](function(_0xe1613c){if(_0xe1613c){_0x59e676=_0xe1613c;_0xb1a3fa[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db['User'][_0xe7fb('0x26')]);_0xb1a3fa[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x5d0f05[_0xe7fb('0x2b')]);_0xb1a3fa[_0xe7fb('0x32')]=_['intersection'](_0xb1a3fa['model'],_0xb1a3fa[_0xe7fb('0x2b')]);_0x16ae95[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0xb1a3fa[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x5d0f05['query'][_0xe7fb('0x36')]));_0x16ae95['attributes']=_0x16ae95['attributes'][_0xe7fb('0x37')]?_0x16ae95[_0xe7fb('0x35')]:_0xb1a3fa[_0xe7fb('0x34')];_0x16ae95[_0xe7fb('0x4f')]=qs['sort'](_0x5d0f05[_0xe7fb('0x2b')]['sort']);_0x16ae95['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x5d0f05[_0xe7fb('0x2b')],_0xb1a3fa[_0xe7fb('0x32')]));if(_0x5d0f05[_0xe7fb('0x2b')]['filter']){_0x16ae95['where']=_[_0xe7fb('0x39')](_0x16ae95['where'],{'$or':_['map'](_0x16ae95[_0xe7fb('0x35')],function(_0x5763dd){var _0x4cab2f={};_0x4cab2f[_0x5763dd]={'$like':'%'+_0x5d0f05[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x4cab2f;})});}_0x16ae95=_[_0xe7fb('0x39')]({},_0x16ae95,_0x5d0f05[_0xe7fb('0x3a')]);return _0x59e676[_0xe7fb('0x86')](_0x16ae95);}})['then'](function(_0xcf6d2){if(_0xcf6d2){_0x577895=_0xcf6d2['length'];if(!_0x5d0f05['query'][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x16ae95[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x5d0f05[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x16ae95[_0xe7fb('0x12')]=qs['offset'](_0x5d0f05['query'][_0xe7fb('0x12')]);}return _0x59e676['getAgents'](_0x16ae95);}})[_0xe7fb('0x18')](function(_0x51ff1e){if(_0x51ff1e){return _0x51ff1e?{'count':_0x577895,'rows':_0x51ff1e}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x519e35,null))['catch'](handleError(_0x519e35,null));};exports[_0xe7fb('0x87')]=function(_0x4407ee,_0x56869b){var _0x2139e3={};var _0x2e0e13={};var _0x23e1db;var _0x2a2fa6;return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x4407ee[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x56869b,null))[_0xe7fb('0x18')](function(_0x454ef0){if(_0x454ef0){_0x23e1db=_0x454ef0;_0x2e0e13['model']=_[_0xe7fb('0x31')](db[_0xe7fb('0x64')][_0xe7fb('0x26')]);_0x2e0e13[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x4407ee[_0xe7fb('0x2b')]);_0x2e0e13[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x2e0e13[_0xe7fb('0x34')],_0x2e0e13[_0xe7fb('0x2b')]);_0x2139e3[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x2e0e13[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x4407ee[_0xe7fb('0x2b')]['fields']));_0x2139e3['attributes']=_0x2139e3[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x2139e3[_0xe7fb('0x35')]:_0x2e0e13[_0xe7fb('0x34')];_0x2139e3[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x2139e3['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x4407ee[_0xe7fb('0x2b')],_0x2e0e13[_0xe7fb('0x32')]));if(_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x2139e3['where']=_[_0xe7fb('0x39')](_0x2139e3[_0xe7fb('0x29')],{'$or':_['map'](_0x2139e3[_0xe7fb('0x35')],function(_0x5dde83){var _0x21d86e={};_0x21d86e[_0x5dde83]={'$like':'%'+_0x4407ee['query'][_0xe7fb('0x1d')]+'%'};return _0x21d86e;})});}_0x2139e3=_[_0xe7fb('0x39')]({},_0x2139e3,_0x4407ee['options']);return _0x23e1db[_0xe7fb('0x87')](_0x2139e3);}})[_0xe7fb('0x18')](function(_0x5892cd){if(_0x5892cd){_0x2a2fa6=_0x5892cd['length'];if(!_0x4407ee['query']['hasOwnProperty'](_0xe7fb('0x4e'))){_0x2139e3[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x2139e3[_0xe7fb('0x12')]=qs['offset'](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x23e1db[_0xe7fb('0x87')](_0x2139e3);}})['then'](function(_0x3c56ad){return _0x3c56ad?{'count':_0x2a2fa6,'rows':_0x3c56ad}:null;})['then'](respondWithResult(_0x56869b,null))[_0xe7fb('0x2e')](handleError(_0x56869b,null));};exports['getLists']=function(_0x4880a7,_0x27669f){var _0x3d8b9a={};var _0x3503ac={};var _0x413843;var _0x55ce0f;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x4880a7[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x27669f,null))[_0xe7fb('0x18')](function(_0x21d9b0){if(_0x21d9b0){_0x413843=_0x21d9b0;_0x3503ac[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x88')][_0xe7fb('0x26')]);_0x3503ac[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x4880a7[_0xe7fb('0x2b')]);_0x3503ac[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x3503ac[_0xe7fb('0x34')],_0x3503ac[_0xe7fb('0x2b')]);_0x3d8b9a['attributes']=_[_0xe7fb('0x33')](_0x3503ac[_0xe7fb('0x34')],qs['fields'](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x3d8b9a[_0xe7fb('0x35')]=_0x3d8b9a['attributes'][_0xe7fb('0x37')]?_0x3d8b9a[_0xe7fb('0x35')]:_0x3503ac[_0xe7fb('0x34')];_0x3d8b9a[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x4880a7[_0xe7fb('0x2b')]['sort']);_0x3d8b9a[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x4880a7['query'],_0x3503ac[_0xe7fb('0x32')]));if(_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x3d8b9a[_0xe7fb('0x29')]=_['merge'](_0x3d8b9a[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x3d8b9a[_0xe7fb('0x35')],function(_0x39ffed){var _0x47e833={};_0x47e833[_0x39ffed]={'$like':'%'+_0x4880a7['query'][_0xe7fb('0x1d')]+'%'};return _0x47e833;})});}_0x3d8b9a=_[_0xe7fb('0x39')]({},_0x3d8b9a,_0x4880a7[_0xe7fb('0x3a')]);return _0x413843[_0xe7fb('0x89')](_0x3d8b9a);}})['then'](function(_0x57750a){if(_0x57750a){_0x55ce0f=_0x57750a[_0xe7fb('0x37')];if(!_0x4880a7['query'][_0xe7fb('0x4d')]('nolimit')){_0x3d8b9a[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x3d8b9a[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x413843[_0xe7fb('0x89')](_0x3d8b9a);}})[_0xe7fb('0x18')](function(_0x14014d){if(_0x14014d){return _0x14014d?{'count':_0x55ce0f,'rows':_0x14014d}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x27669f,null))[_0xe7fb('0x2e')](handleError(_0x27669f,null));};exports[_0xe7fb('0x8a')]=function(_0x4d9a76,_0x23a49e){var _0x30651f=moment()[_0xe7fb('0x66')](_0xe7fb('0x8b'));var _0x582862,_0x5b6da5;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x4d9a76[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x23a49e,null))['then'](function(_0x4e09d8){if(_0x4e09d8){_0x5b6da5=_0x4e09d8;return _0x4e09d8[_0xe7fb('0x8a')](_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x6b')],_[_0xe7fb('0x45')](_0x4d9a76[_0xe7fb('0x3d')],[_0xe7fb('0x6b'),'id'])||{});}return null;})[_0xe7fb('0x8c')](function(_0x2e2167){var _0xd7f440;_0x582862=_0x2e2167||[];var _0xc8055f=[];if(_0x2e2167){for(var _0x45b449=0x0;_0x45b449<_0x2e2167['length'];_0x45b449+=0x1){var _0x366c06=_0x2e2167[_0x45b449][_0xe7fb('0x1a')]({'plain':!![]});_0x5b6da5[_0xe7fb('0x8d')]=_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x8d')]?_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x8d')]:_0x5b6da5[_0xe7fb('0x8d')];switch(_0x5b6da5['dialCheckDuplicateType']){case _0xe7fb('0x8e'):_0xd7f440=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0x91'))['fromQuery']([_0xe7fb('0x92'),_0xe7fb('0x93'),_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()['field'](_0xe7fb('0x92'),_0xe7fb('0x92'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))['field']('id',_0xe7fb('0x94'))[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))[_0xe7fb('0x6e')](_0x4d9a76[_0xe7fb('0x30')]['id']['toString'](),'VoiceQueueId')[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27','createdAt')['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')]('cm_contacts')[_0xe7fb('0x29')](_0xe7fb('0x97'))['where'](_0xe7fb('0x98'),_0x366c06['CmListId'][_0xe7fb('0x75')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xe7fb('0x29')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xe7fb('0x6e')](_0xe7fb('0x99'))['from'](_0xe7fb('0x9a'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x4d9a76[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')]()))[_0xe7fb('0x29')](_0xe7fb('0x9b'),squel['select']()['field'](_0xe7fb('0x9c'))['from']('cm_hopper')[_0xe7fb('0x29')]('VoiceQueueId\x20=\x20?',_0x4d9a76['params']['id'][_0xe7fb('0x75')]())))['toString']();break;case _0xe7fb('0x9d'):_0xd7f440=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0x91'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),'scheduledAt',_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0x92'),_0xe7fb('0x92'))['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))[_0xe7fb('0x6e')]('id',_0xe7fb('0x94'))[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))['field'](_0x4d9a76['params']['id']['toString'](),_0xe7fb('0x51'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))['where'](_0xe7fb('0x97'))[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x366c06['CmListId']['toString']())[_0xe7fb('0x29')](_0xe7fb('0xa0'))[_0xe7fb('0x29')](_0xe7fb('0x9b'),squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0x9c'))['from'](_0xe7fb('0x91'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x4d9a76['params']['id'][_0xe7fb('0x75')]())))['toString']();break;default:_0xd7f440=squel[_0xe7fb('0x8f')]()['into'](_0xe7fb('0x91'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),_0xe7fb('0x93'),_0xe7fb('0x94'),'ListId',_0xe7fb('0x51'),'createdAt','updatedAt'],squel['select']()[_0xe7fb('0x6e')]('phone','phone')['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))[_0xe7fb('0x6e')]('id','ContactId')[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')]['toString'](),_0xe7fb('0x95'))['field'](_0x4d9a76[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')](),_0xe7fb('0x51'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))['where'](_0xe7fb('0x97'))[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x366c06[_0xe7fb('0x96')]['toString']())[_0xe7fb('0x29')](_0xe7fb('0xa0')))['toString']();}_0xc8055f['push'](db[_0xe7fb('0x5f')]['query'](_0xd7f440));}return BPromise[_0xe7fb('0x7a')](_0xc8055f);}})[_0xe7fb('0x18')](function(){var _0x20b22f=[];var _0x2e22c1=squel[_0xe7fb('0x8f')]()['into'](_0xe7fb('0xa1'))['fromQuery']([_0xe7fb('0xa2'),_0xe7fb('0x92'),_0xe7fb('0xa3'),'createdAt',_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0xa4'))[_0xe7fb('0x6e')]('ci.item')[_0xe7fb('0x6e')](_0xe7fb('0xa5'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0xa6'),'ci')[_0xe7fb('0xa7')]('cm_hopper','h',_0xe7fb('0xa8'))[_0xe7fb('0x29')]('h.scheduledat=?',_0x30651f)[_0xe7fb('0x29')]('ci.ItemClass=?',_0xe7fb('0xa9')))[_0xe7fb('0x75')]();_0x20b22f[_0xe7fb('0x74')](db[_0xe7fb('0x5f')][_0xe7fb('0x2b')](_0x2e22c1));return BPromise[_0xe7fb('0x7a')](_0x20b22f);})[_0xe7fb('0x18')](function(){return _0x582862;})['then'](respondWithResult(_0x23a49e,null))[_0xe7fb('0x2e')](handleError(_0x23a49e,null));};exports[_0xe7fb('0xaa')]=function(_0x3c04f4,_0x290cc3){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x3c04f4['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x290cc3,null))[_0xe7fb('0x18')](function(_0x3ed48f){if(_0x3ed48f){return _0x3ed48f['removeLists'](_0x3c04f4[_0xe7fb('0x2b')][_0xe7fb('0x6b')]);}})[_0xe7fb('0x18')](function(_0x2eeff4){if(_0x2eeff4){return db[_0xe7fb('0x52')]['destroy']({'where':{'ListId':_0x3c04f4[_0xe7fb('0x2b')][_0xe7fb('0x6b')],'VoiceQueueId':_0x3c04f4[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(){return _0x2eeff4;});}})[_0xe7fb('0x18')](respondWithStatusCode(_0x290cc3,null))[_0xe7fb('0x2e')](handleError(_0x290cc3,null));};exports[_0xe7fb('0xab')]=function(_0xcaad94,_0x5b88bd){var _0x143dbb={};var _0x715444={};var _0x92a316;var _0x30a834;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0xcaad94[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x5b88bd,null))[_0xe7fb('0x18')](function(_0x1b1818){if(_0x1b1818){_0x92a316=_0x1b1818;_0x715444[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x88')][_0xe7fb('0x26')]);_0x715444[_0xe7fb('0x2b')]=_['keys'](_0xcaad94[_0xe7fb('0x2b')]);_0x715444[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x715444[_0xe7fb('0x34')],_0x715444[_0xe7fb('0x2b')]);_0x143dbb['attributes']=_[_0xe7fb('0x33')](_0x715444[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0xcaad94['query']['fields']));_0x143dbb[_0xe7fb('0x35')]=_0x143dbb[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x143dbb[_0xe7fb('0x35')]:_0x715444['model'];_0x143dbb[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x143dbb['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0xcaad94['query'],_0x715444[_0xe7fb('0x32')]));if(_0xcaad94[_0xe7fb('0x2b')]['filter']){_0x143dbb['where']=_[_0xe7fb('0x39')](_0x143dbb[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x143dbb['attributes'],function(_0x3b2375){var _0x170347={};_0x170347[_0x3b2375]={'$like':'%'+_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x170347;})});}_0x143dbb=_['merge']({},_0x143dbb,_0xcaad94[_0xe7fb('0x3a')]);return _0x92a316[_0xe7fb('0xab')](_0x143dbb);}})[_0xe7fb('0x18')](function(_0x2a984e){if(_0x2a984e){_0x30a834=_0x2a984e[_0xe7fb('0x37')];if(!_0xcaad94[_0xe7fb('0x2b')]['hasOwnProperty']('nolimit')){_0x143dbb[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x143dbb[_0xe7fb('0x12')]=qs['offset'](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x92a316[_0xe7fb('0xab')](_0x143dbb);}})[_0xe7fb('0x18')](function(_0x286382){if(_0x286382){return _0x286382?{'count':_0x30a834,'rows':_0x286382}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x5b88bd,null))[_0xe7fb('0x2e')](handleError(_0x5b88bd,null));};exports[_0xe7fb('0xac')]=function(_0x325c7b,_0x38472b){var _0x1a33f8;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x325c7b[_0xe7fb('0x30')]['id']}})['then'](handleEntityNotFound(_0x38472b,null))[_0xe7fb('0x18')](function(_0x291a8d){if(_0x291a8d){return _0x291a8d['addBlackLists'](_0x325c7b[_0xe7fb('0x3d')]['ids'],_[_0xe7fb('0x45')](_0x325c7b[_0xe7fb('0x3d')],[_0xe7fb('0x6b'),'id'])||{});}return null;})[_0xe7fb('0x8c')](function(_0x3ade81){var _0x1b9ea2;_0x1a33f8=_0x3ade81||[];var _0x418561=[];if(_0x3ade81){for(var _0x3ec66a=0x0;_0x3ec66a<_0x3ade81[_0xe7fb('0x37')];_0x3ec66a+=0x1){var _0x1c76a1=_0x3ade81[_0x3ec66a][_0xe7fb('0x1a')]({'plain':!![]});_0x1b9ea2=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0xad'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')]('phone',_0xe7fb('0x92'))[_0xe7fb('0x6e')]('id',_0xe7fb('0x94'))['field'](_0x1c76a1[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))[_0xe7fb('0x6e')](_0x325c7b[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')](),'VoiceQueueId')[_0xe7fb('0x6e')](_0xe7fb('0xae'),_0xe7fb('0x47'))[_0xe7fb('0x6e')]('NOW()',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))[_0xe7fb('0x29')]('deletedAt\x20IS\x20NULL')[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x1c76a1[_0xe7fb('0x96')][_0xe7fb('0x75')]())[_0xe7fb('0x29')](_0xe7fb('0xa0')))['toString']();_0x418561[_0xe7fb('0x74')](db[_0xe7fb('0x5f')]['query'](_0x1b9ea2));}return BPromise[_0xe7fb('0x7a')](_0x418561);}})[_0xe7fb('0x18')](function(){return _0x1a33f8;})['then'](respondWithResult(_0x38472b,null))[_0xe7fb('0x2e')](handleError(_0x38472b,null));};exports['removeBlackLists']=function(_0x127051,_0x4d9376){return db[_0xe7fb('0x25')]['find']({'where':{'id':_0x127051['params']['id']}})['then'](handleEntityNotFound(_0x4d9376,null))['then'](function(_0x547d29){if(_0x547d29){return _0x547d29[_0xe7fb('0xaf')](_0x127051[_0xe7fb('0x2b')]['ids']);}})[_0xe7fb('0x18')](function(_0x5c0baf){if(_0x5c0baf){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x127051['query'][_0xe7fb('0x6b')],'VoiceQueueId':_0x127051[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(){return _0x5c0baf;});}})['then'](respondWithStatusCode(_0x4d9376,null))[_0xe7fb('0x2e')](handleError(_0x4d9376,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 0a763dd..a08dc25 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 _0x3021=['save','emit','hasOwnProperty','hook','exports','events','VoiceQueue','setMaxListeners'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3021,0x85));var _0x1302=function(_0x720773,_0x11abd4){_0x720773=_0x720773-0x0;var _0x1be858=_0x3021[_0x720773];return _0x1be858;};'use strict';var EventEmitter=require(_0x1302('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x1302('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1302('0x2')](0x0);var events={'afterCreate':_0x1302('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1b2f65){return function(_0x3dce4b,_0x28d083,_0x3769c7){VoiceQueueEvents[_0x1302('0x4')](_0x1b2f65+':'+_0x3dce4b['id'],_0x3dce4b);VoiceQueueEvents['emit'](_0x1b2f65,_0x3dce4b);_0x3769c7(null);};}for(var e in events){if(events[_0x1302('0x5')](e)){var event=events[e];VoiceQueue[_0x1302('0x6')](e,emitEvent(event));}}module[_0x1302('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x4c23=['hook','exports','events','../../mysqldb','VoiceQueue','save','update','remove','hasOwnProperty'];(function(_0x4fa916,_0x3ec36a){var _0x576439=function(_0x5692e0){while(--_0x5692e0){_0x4fa916['push'](_0x4fa916['shift']());}};_0x576439(++_0x3ec36a);}(_0x4c23,0x1b2));var _0x34c2=function(_0x240af0,_0x1b2ade){_0x240af0=_0x240af0-0x0;var _0x120aec=_0x4c23[_0x240af0];return _0x120aec;};'use strict';var EventEmitter=require(_0x34c2('0x0'));var VoiceQueue=require(_0x34c2('0x1'))['db'][_0x34c2('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x34c2('0x3'),'afterUpdate':_0x34c2('0x4'),'afterDestroy':_0x34c2('0x5')};function emitEvent(_0x2b2079){return function(_0x33ab19,_0x54d477,_0x44d866){VoiceQueueEvents['emit'](_0x2b2079+':'+_0x33ab19['id'],_0x33ab19);VoiceQueueEvents['emit'](_0x2b2079,_0x33ab19);_0x44d866(null);};}for(var e in events){if(events[_0x34c2('0x6')](e)){var event=events[e];VoiceQueue[_0x34c2('0x7')](e,emitEvent(event));}}module[_0x34c2('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 55aecdd..73b7ad0 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 _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x41a427,_0x1c96c2){var _0x32163d=function(_0x5daf65){while(--_0x5daf65){_0x41a427['push'](_0x41a427['shift']());}};_0x32163d(++_0x1c96c2);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x5504fb,_0x270144){var _0x38776d=function(_0x21032b){while(--_0x21032b){_0x5504fb['push'](_0x5504fb['shift']());}};_0x38776d(++_0x270144);}(_0x34e8,0x12c));var _0x834e=function(_0x50cfdb,_0x41ba17){_0x50cfdb=_0x50cfdb-0x0;var _0x13d112=_0x34e8[_0x50cfdb];return _0x13d112;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 9f55ebc..610d85c 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 _0x0884=['localhost','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowVoiceQueue','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x4f6df4,_0x1f73a3){var _0x44e44d=function(_0x188dc5){while(--_0x188dc5){_0x4f6df4['push'](_0x4f6df4['shift']());}};_0x44e44d(++_0x1f73a3);}(_0x0884,0x1c0));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4088('0x0'));var util=require(_0x4088('0x1'));var moment=require(_0x4088('0x2'));var BPromise=require('bluebird');var rs=require(_0x4088('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4088('0x4'))['db'];var utils=require(_0x4088('0x5'));var logger=require(_0x4088('0x6'))(_0x4088('0x7'));var config=require(_0x4088('0x8'));var jayson=require(_0x4088('0x9'));var client=jayson[_0x4088('0xa')][_0x4088('0xb')]({'port':0x232a});config[_0x4088('0xc')]=_[_0x4088('0xd')](config['redis'],{'host':_0x4088('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4088('0xc')]));require(_0x4088('0xf'))[_0x4088('0x10')](socket);function respondWithRpcPromise(_0x5a875d,_0x4f7204,_0x3b487b){return new BPromise(function(_0x10e4fe,_0x29b3f0){return client[_0x4088('0x11')](_0x5a875d,_0x3b487b)[_0x4088('0x12')](function(_0x1105bc){logger[_0x4088('0x13')](_0x4088('0x14'),_0x4f7204,_0x4088('0x15'));logger[_0x4088('0x16')](_0x4088('0x17'),_0x4f7204,_0x4088('0x15'),JSON[_0x4088('0x18')](_0x1105bc));if(_0x1105bc['error']){if(_0x1105bc['error'][_0x4088('0x19')]===0x1f4){logger['error'](_0x4088('0x14'),_0x4f7204,_0x1105bc[_0x4088('0x1a')][_0x4088('0x1b')]);return _0x29b3f0(_0x1105bc[_0x4088('0x1a')][_0x4088('0x1b')]);}logger[_0x4088('0x1a')]('VoiceQueue,\x20%s,\x20%s',_0x4f7204,_0x1105bc[_0x4088('0x1a')][_0x4088('0x1b')]);return _0x10e4fe(_0x1105bc[_0x4088('0x1a')]['message']);}else{logger[_0x4088('0x13')](_0x4088('0x14'),_0x4f7204,_0x4088('0x15'));_0x10e4fe(_0x1105bc['result'][_0x4088('0x1b')]);}})[_0x4088('0x1c')](function(_0x2ee650){logger[_0x4088('0x1a')](_0x4088('0x14'),_0x4f7204,_0x2ee650);_0x29b3f0(_0x2ee650);});});}exports[_0x4088('0x1d')]=function(_0x28fd8e){var _0xc87d95=this;return new Promise(function(_0x444146,_0x29b7f1){return db[_0x4088('0x1e')][_0x4088('0x1f')]({'raw':_0x28fd8e[_0x4088('0x20')]?_0x28fd8e[_0x4088('0x20')][_0x4088('0x21')]===undefined?!![]:![]:!![],'where':_0x28fd8e[_0x4088('0x20')]?_0x28fd8e[_0x4088('0x20')][_0x4088('0x22')]||null:null,'attributes':_0x28fd8e[_0x4088('0x20')]?_0x28fd8e[_0x4088('0x20')][_0x4088('0x23')]||null:null,'limit':_0x28fd8e[_0x4088('0x20')]?_0x28fd8e[_0x4088('0x20')][_0x4088('0x24')]||null:null,'include':_0x28fd8e[_0x4088('0x20')]?_0x28fd8e['options'][_0x4088('0x25')]?_['map'](_0x28fd8e[_0x4088('0x20')][_0x4088('0x25')],function(_0x32950c){return{'model':db[_0x32950c['model']],'as':_0x32950c['as'],'attributes':_0x32950c[_0x4088('0x23')],'include':_0x32950c[_0x4088('0x25')]?_[_0x4088('0x26')](_0x32950c[_0x4088('0x25')],function(_0x4ee750){return{'model':db[_0x4ee750[_0x4088('0x27')]],'as':_0x4ee750['as'],'attributes':_0x4ee750[_0x4088('0x23')],'include':_0x4ee750[_0x4088('0x25')]?_[_0x4088('0x26')](_0x4ee750[_0x4088('0x25')],function(_0x5c36cd){return{'model':db[_0x5c36cd['model']],'as':_0x5c36cd['as'],'attributes':_0x5c36cd[_0x4088('0x23')]};}):[]};}):[]};}):[]:[]})[_0x4088('0x12')](function(_0x3db8a9){logger['info']('GetVoiceQueue',_0x28fd8e);logger[_0x4088('0x16')]('GetVoiceQueue',_0x28fd8e,JSON[_0x4088('0x18')](_0x3db8a9));_0x444146(_0x3db8a9);})[_0x4088('0x1c')](function(_0x5809eb){logger['error']('GetVoiceQueue',_0x5809eb['message'],_0x28fd8e);_0x29b7f1(_0xc87d95[_0x4088('0x1a')](0x1f4,_0x5809eb[_0x4088('0x1b')]));});});};exports[_0x4088('0x28')]=function(_0x3fa2ad){var _0xeb2e8=this;return new Promise(function(_0x5842ad,_0x23bee4){return db[_0x4088('0x1e')][_0x4088('0x29')]({'raw':_0x3fa2ad[_0x4088('0x20')]?_0x3fa2ad[_0x4088('0x20')][_0x4088('0x21')]===undefined?!![]:![]:!![],'where':_0x3fa2ad['options']?_0x3fa2ad[_0x4088('0x20')][_0x4088('0x22')]||null:null,'attributes':_0x3fa2ad[_0x4088('0x20')]?_0x3fa2ad[_0x4088('0x20')][_0x4088('0x23')]||null:null,'include':_0x3fa2ad[_0x4088('0x20')]?_0x3fa2ad[_0x4088('0x20')][_0x4088('0x25')]?_[_0x4088('0x26')](_0x3fa2ad[_0x4088('0x20')][_0x4088('0x25')],function(_0x3faed6){return{'model':db[_0x3faed6[_0x4088('0x27')]],'as':_0x3faed6['as'],'attributes':_0x3faed6[_0x4088('0x23')],'include':_0x3faed6[_0x4088('0x25')]?_[_0x4088('0x26')](_0x3faed6[_0x4088('0x25')],function(_0x49d7b7){return{'model':db[_0x49d7b7[_0x4088('0x27')]],'as':_0x49d7b7['as'],'attributes':_0x49d7b7['attributes'],'include':_0x49d7b7[_0x4088('0x25')]?_['map'](_0x49d7b7[_0x4088('0x25')],function(_0x1db82a){return{'model':db[_0x1db82a[_0x4088('0x27')]],'as':_0x1db82a['as'],'attributes':_0x1db82a[_0x4088('0x23')]};}):[]};}):[]};}):[]:[]})[_0x4088('0x12')](function(_0x5eb962){logger[_0x4088('0x13')](_0x4088('0x28'),_0x3fa2ad);logger[_0x4088('0x16')](_0x4088('0x28'),_0x3fa2ad,JSON[_0x4088('0x18')](_0x5eb962));_0x5842ad(_0x5eb962);})[_0x4088('0x1c')](function(_0x466045){logger[_0x4088('0x1a')](_0x4088('0x28'),_0x466045[_0x4088('0x1b')],_0x3fa2ad);_0x23bee4(_0xeb2e8[_0x4088('0x1a')](0x1f4,_0x466045['message']));});});}; \ No newline at end of file +var _0x3eac=['where','attributes','limit','include','model','map','stringify','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','./voiceQueue.socket','request','then','VoiceQueue,\x20%s,\x20%s','debug','error','message','info','request\x20sent','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw'];(function(_0x5985f0,_0x273df9){var _0x285f54=function(_0x8780af){while(--_0x8780af){_0x5985f0['push'](_0x5985f0['shift']());}};_0x285f54(++_0x273df9);}(_0x3eac,0x185));var _0xc3ea=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0x3eac[_0x217c2e];return _0x22b7d8;};'use strict';var _=require(_0xc3ea('0x0'));var util=require(_0xc3ea('0x1'));var moment=require(_0xc3ea('0x2'));var BPromise=require(_0xc3ea('0x3'));var rs=require(_0xc3ea('0x4'));var fs=require('fs');var Redis=require(_0xc3ea('0x5'));var db=require(_0xc3ea('0x6'))['db'];var utils=require(_0xc3ea('0x7'));var logger=require(_0xc3ea('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc3ea('0x9'));var client=jayson[_0xc3ea('0xa')][_0xc3ea('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc3ea('0xc')],{'host':_0xc3ea('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc3ea('0xc')]));require(_0xc3ea('0xe'))['register'](socket);function respondWithRpcPromise(_0x5e3a25,_0x53eb09,_0x57e902){return new BPromise(function(_0x3af7d9,_0x460138){return client[_0xc3ea('0xf')](_0x5e3a25,_0x57e902)[_0xc3ea('0x10')](function(_0x4844c1){logger['info'](_0xc3ea('0x11'),_0x53eb09,'request\x20sent');logger[_0xc3ea('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x53eb09,'request\x20sent',JSON['stringify'](_0x4844c1));if(_0x4844c1[_0xc3ea('0x13')]){if(_0x4844c1[_0xc3ea('0x13')]['code']===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x53eb09,_0x4844c1[_0xc3ea('0x13')][_0xc3ea('0x14')]);return _0x460138(_0x4844c1['error'][_0xc3ea('0x14')]);}logger[_0xc3ea('0x13')](_0xc3ea('0x11'),_0x53eb09,_0x4844c1[_0xc3ea('0x13')][_0xc3ea('0x14')]);return _0x3af7d9(_0x4844c1['error'][_0xc3ea('0x14')]);}else{logger[_0xc3ea('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x53eb09,_0xc3ea('0x16'));_0x3af7d9(_0x4844c1['result'][_0xc3ea('0x14')]);}})[_0xc3ea('0x17')](function(_0x5d5a37){logger['error'](_0xc3ea('0x11'),_0x53eb09,_0x5d5a37);_0x460138(_0x5d5a37);});});}exports[_0xc3ea('0x18')]=function(_0x137cc2){var _0x37daee=this;return new Promise(function(_0x3ebdc2,_0x17d9cb){return db[_0xc3ea('0x19')][_0xc3ea('0x1a')]({'raw':_0x137cc2[_0xc3ea('0x1b')]?_0x137cc2[_0xc3ea('0x1b')][_0xc3ea('0x1c')]===undefined?!![]:![]:!![],'where':_0x137cc2['options']?_0x137cc2[_0xc3ea('0x1b')][_0xc3ea('0x1d')]||null:null,'attributes':_0x137cc2[_0xc3ea('0x1b')]?_0x137cc2[_0xc3ea('0x1b')][_0xc3ea('0x1e')]||null:null,'limit':_0x137cc2[_0xc3ea('0x1b')]?_0x137cc2[_0xc3ea('0x1b')][_0xc3ea('0x1f')]||null:null,'include':_0x137cc2['options']?_0x137cc2['options'][_0xc3ea('0x20')]?_['map'](_0x137cc2['options'][_0xc3ea('0x20')],function(_0x22b58a){return{'model':db[_0x22b58a[_0xc3ea('0x21')]],'as':_0x22b58a['as'],'attributes':_0x22b58a['attributes'],'include':_0x22b58a['include']?_[_0xc3ea('0x22')](_0x22b58a[_0xc3ea('0x20')],function(_0x333e31){return{'model':db[_0x333e31[_0xc3ea('0x21')]],'as':_0x333e31['as'],'attributes':_0x333e31[_0xc3ea('0x1e')],'include':_0x333e31['include']?_[_0xc3ea('0x22')](_0x333e31['include'],function(_0x380b64){return{'model':db[_0x380b64['model']],'as':_0x380b64['as'],'attributes':_0x380b64[_0xc3ea('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc3ea('0x10')](function(_0x138d73){logger['info'](_0xc3ea('0x18'),_0x137cc2);logger[_0xc3ea('0x12')]('GetVoiceQueue',_0x137cc2,JSON[_0xc3ea('0x23')](_0x138d73));_0x3ebdc2(_0x138d73);})[_0xc3ea('0x17')](function(_0x27671b){logger[_0xc3ea('0x13')](_0xc3ea('0x18'),_0x27671b[_0xc3ea('0x14')],_0x137cc2);_0x17d9cb(_0x37daee[_0xc3ea('0x13')](0x1f4,_0x27671b[_0xc3ea('0x14')]));});});};exports[_0xc3ea('0x24')]=function(_0x2665db){var _0x1edaa1=this;return new Promise(function(_0x1313d2,_0x52457d){return db['VoiceQueue'][_0xc3ea('0x25')]({'raw':_0x2665db['options']?_0x2665db['options'][_0xc3ea('0x1c')]===undefined?!![]:![]:!![],'where':_0x2665db[_0xc3ea('0x1b')]?_0x2665db['options'][_0xc3ea('0x1d')]||null:null,'attributes':_0x2665db[_0xc3ea('0x1b')]?_0x2665db['options']['attributes']||null:null,'include':_0x2665db[_0xc3ea('0x1b')]?_0x2665db[_0xc3ea('0x1b')][_0xc3ea('0x20')]?_[_0xc3ea('0x22')](_0x2665db[_0xc3ea('0x1b')][_0xc3ea('0x20')],function(_0x5d366a){return{'model':db[_0x5d366a['model']],'as':_0x5d366a['as'],'attributes':_0x5d366a[_0xc3ea('0x1e')],'include':_0x5d366a[_0xc3ea('0x20')]?_['map'](_0x5d366a[_0xc3ea('0x20')],function(_0x1c02b5){return{'model':db[_0x1c02b5[_0xc3ea('0x21')]],'as':_0x1c02b5['as'],'attributes':_0x1c02b5[_0xc3ea('0x1e')],'include':_0x1c02b5['include']?_[_0xc3ea('0x22')](_0x1c02b5[_0xc3ea('0x20')],function(_0x56fda5){return{'model':db[_0x56fda5[_0xc3ea('0x21')]],'as':_0x56fda5['as'],'attributes':_0x56fda5[_0xc3ea('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc3ea('0x10')](function(_0x446d34){logger[_0xc3ea('0x15')](_0xc3ea('0x24'),_0x2665db);logger[_0xc3ea('0x12')]('ShowVoiceQueue',_0x2665db,JSON[_0xc3ea('0x23')](_0x446d34));_0x1313d2(_0x446d34);})[_0xc3ea('0x17')](function(_0x49876e){logger[_0xc3ea('0x13')](_0xc3ea('0x24'),_0x49876e['message'],_0x2665db);_0x52457d(_0x1edaa1['error'](0x1f4,_0x49876e[_0xc3ea('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index c550251..a22a508 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 _0x4473=['emit','removeListener','register','length','save','remove'];(function(_0x461108,_0x2c3453){var _0x1bb0d5=function(_0x1d7a1c){while(--_0x1d7a1c){_0x461108['push'](_0x461108['shift']());}};_0x1bb0d5(++_0x2c3453);}(_0x4473,0x1cc));var _0x3447=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x4473[_0x5bd426];return _0x23a7eb;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x3447('0x0'),_0x3447('0x1'),'update'];function createListener(_0x2090a3,_0x1b3ea9){return function(_0x1a13ab){_0x1b3ea9[_0x3447('0x2')](_0x2090a3,_0x1a13ab);};}function removeListener(_0x4ec53c,_0x7c6938){return function(){VoiceQueueEvents[_0x3447('0x3')](_0x4ec53c,_0x7c6938);};}exports[_0x3447('0x4')]=function(_0x3d49ef){for(var _0x2332b2=0x0,_0x119890=events[_0x3447('0x5')];_0x2332b2<_0x119890;_0x2332b2++){var _0x2f3ad9=events[_0x2332b2];var _0x240da0=createListener('voiceQueue:'+_0x2f3ad9,_0x3d49ef);VoiceQueueEvents['on'](_0x2f3ad9,_0x240da0);}}; \ No newline at end of file +var _0x12d7=['length','voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x57b1cb,_0x2b84ef){var _0x4df9bc=function(_0x5b9cd1){while(--_0x5b9cd1){_0x57b1cb['push'](_0x57b1cb['shift']());}};_0x4df9bc(++_0x2b84ef);}(_0x12d7,0x1c4));var _0x712d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12d7[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueEvents=require(_0x712d('0x0'));var events=[_0x712d('0x1'),_0x712d('0x2'),_0x712d('0x3')];function createListener(_0xe022eb,_0x1efa45){return function(_0x5625d2){_0x1efa45[_0x712d('0x4')](_0xe022eb,_0x5625d2);};}function removeListener(_0x25839d,_0x590c5a){return function(){VoiceQueueEvents[_0x712d('0x5')](_0x25839d,_0x590c5a);};}exports[_0x712d('0x6')]=function(_0x1ce368){for(var _0x3a0f50=0x0,_0x2ad5e0=events[_0x712d('0x7')];_0x3a0f50<_0x2ad5e0;_0x3a0f50++){var _0x44f00f=events[_0x3a0f50];var _0x2ec2d9=createListener(_0x712d('0x8')+_0x44f00f,_0x1ce368);VoiceQueueEvents['on'](_0x44f00f,_0x2ec2d9);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index c052774..cf7c1fe 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 _0x635d=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','isAuthenticated','get','/describe','describe','/index','getVoiceQueuesReport','/:id','post','put','update','delete','destroy','multer'];(function(_0x1110d9,_0x1bcba2){var _0xa204ce=function(_0x4c4d53){while(--_0x4c4d53){_0x1110d9['push'](_0x1110d9['shift']());}};_0xa204ce(++_0x1bcba2);}(_0x635d,0x1cd));var _0xd635=function(_0x148785,_0x195ee5){_0x148785=_0x148785-0x0;var _0x17a172=_0x635d[_0x148785];return _0x17a172;};'use strict';var multer=require(_0xd635('0x0'));var util=require(_0xd635('0x1'));var path=require(_0xd635('0x2'));var timeout=require(_0xd635('0x3'));var express=require(_0xd635('0x4'));var router=express[_0xd635('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd635('0x6'));var interaction=require(_0xd635('0x7'));var config=require('../../config/environment');var controller=require(_0xd635('0x8'));router['get']('/',auth[_0xd635('0x9')](),controller['index']);router[_0xd635('0xa')](_0xd635('0xb'),auth[_0xd635('0x9')](),controller[_0xd635('0xc')]);router[_0xd635('0xa')](_0xd635('0xd'),auth['isAuthenticated'](),controller[_0xd635('0xe')]);router[_0xd635('0xa')](_0xd635('0xf'),auth[_0xd635('0x9')](),controller['show']);router[_0xd635('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd635('0x11')](_0xd635('0xf'),auth[_0xd635('0x9')](),controller[_0xd635('0x12')]);router[_0xd635('0x13')]('/:id',auth[_0xd635('0x9')](),controller[_0xd635('0x14')]);module['exports']=router; \ No newline at end of file +var _0x2713=['isAuthenticated','describe','/index','getVoiceQueuesReport','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get'];(function(_0x290ef5,_0x32cfa7){var _0x450d92=function(_0x4308db){while(--_0x4308db){_0x290ef5['push'](_0x290ef5['shift']());}};_0x450d92(++_0x32cfa7);}(_0x2713,0x91));var _0x3271=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2713[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x3271('0x0'));var util=require(_0x3271('0x1'));var path=require(_0x3271('0x2'));var timeout=require('connect-timeout');var express=require(_0x3271('0x3'));var router=express['Router']();var fs_extra=require(_0x3271('0x4'));var auth=require(_0x3271('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3271('0x6'));var controller=require(_0x3271('0x7'));router[_0x3271('0x8')]('/',auth[_0x3271('0x9')](),controller['index']);router['get']('/describe',auth[_0x3271('0x9')](),controller[_0x3271('0xa')]);router[_0x3271('0x8')](_0x3271('0xb'),auth[_0x3271('0x9')](),controller[_0x3271('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3271('0xd')]);router[_0x3271('0xe')]('/',auth[_0x3271('0x9')](),controller[_0x3271('0xf')]);router[_0x3271('0x10')](_0x3271('0x11'),auth[_0x3271('0x9')](),controller[_0x3271('0x12')]);router[_0x3271('0x13')](_0x3271('0x11'),auth[_0x3271('0x9')](),controller[_0x3271('0x14')]);module[_0x3271('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index eb26031..46f4ea2 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 _0xdc44=['YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt'];(function(_0x280faf,_0x31bd74){var _0x59e18d=function(_0x308642){while(--_0x308642){_0x280faf['push'](_0x280faf['shift']());}};_0x59e18d(++_0x31bd74);}(_0xdc44,0x162));var _0x4dc4=function(_0x1fc84d,_0x3f469d){_0x1fc84d=_0x1fc84d-0x0;var _0x2658fa=_0xdc44[_0x1fc84d];return _0x2658fa;};'use strict';var Sequelize=require(_0x4dc4('0x0'));var moment=require(_0x4dc4('0x1'));module[_0x4dc4('0x2')]={'type':{'type':Sequelize[_0x4dc4('0x3')]},'uniqueid':{'type':Sequelize[_0x4dc4('0x3')]},'calleridnum':{'type':Sequelize[_0x4dc4('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x4dc4('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x4dc4('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x4dc4('0x4')],'set':function(_0x4fa0a0){var _0x4f50d4=moment(_0x4fa0a0);var _0x453146=moment(this['getDataValue'](_0x4dc4('0x5')))['format'](_0x4dc4('0x6'));var _0x46e93d=_0x4f50d4[_0x4dc4('0x7')](_0x453146,'seconds');this[_0x4dc4('0x8')](_0x4dc4('0x9'),_0x4fa0a0);this[_0x4dc4('0x8')](_0x4dc4('0xa'),_0x46e93d||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x4dc4('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x4dc4('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x4dc4('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x4dc4('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x4dc4('0x4')]},'queuecallerexit':{'type':Sequelize[_0x4dc4('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x4dc4('0x3')],'comment':_0x4dc4('0xd')},'originalposition':{'type':Sequelize[_0x4dc4('0xb')]},'channel':{'type':Sequelize[_0x4dc4('0x3')]},'connectedlinenum':{'type':Sequelize[_0x4dc4('0x3')]},'connectedlinename':{'type':Sequelize[_0x4dc4('0x3')]},'accountcode':{'type':Sequelize[_0x4dc4('0x3')]},'context':{'type':Sequelize[_0x4dc4('0x3')]},'exten':{'type':Sequelize[_0x4dc4('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x4dc4('0xb')]},'mohtime':{'type':Sequelize[_0x4dc4('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x4dc4('0x3')]},'transfer':{'type':Sequelize[_0x4dc4('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4dc4('0x3')],'comment':_0x4dc4('0xe')},'transferexten':{'type':Sequelize[_0x4dc4('0x3')]},'transferuniqueid':{'type':Sequelize[_0x4dc4('0x3')]},'disposition':{'type':Sequelize[_0x4dc4('0x3')]},'secondDisposition':{'type':Sequelize[_0x4dc4('0x3')]},'thirdDisposition':{'type':Sequelize[_0x4dc4('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x4dc4('0xb')],'defaultValue':0x0},'note':{'type':Sequelize[_0x4dc4('0x3')]}}; \ No newline at end of file +var _0x3bd1=['queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','seconds','setDataValue'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3bd1,0x1a8));var _0x13bd=function(_0x4a4d6d,_0x150bfb){_0x4a4d6d=_0x4a4d6d-0x0;var _0x45f689=_0x3bd1[_0x4a4d6d];return _0x45f689;};'use strict';var Sequelize=require(_0x13bd('0x0'));var moment=require('moment');module[_0x13bd('0x1')]={'type':{'type':Sequelize[_0x13bd('0x2')]},'uniqueid':{'type':Sequelize[_0x13bd('0x2')]},'calleridnum':{'type':Sequelize[_0x13bd('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x13bd('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x13bd('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0xc8c063){var _0x991420=moment(_0xc8c063);var _0x14f9c0=moment(this[_0x13bd('0x4')](_0x13bd('0x5')))[_0x13bd('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x67031c=_0x991420[_0x13bd('0x7')](_0x14f9c0,_0x13bd('0x8'));this[_0x13bd('0x9')](_0x13bd('0xa'),_0xc8c063);this[_0x13bd('0x9')](_0x13bd('0xb'),_0x67031c||null);}},'position':{'type':Sequelize[_0x13bd('0xc')]},'count':{'type':Sequelize[_0x13bd('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x13bd('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x13bd('0x3')]},'queuecallerexit':{'type':Sequelize[_0x13bd('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x13bd('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x13bd('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x13bd('0xc')]},'channel':{'type':Sequelize[_0x13bd('0x2')]},'connectedlinenum':{'type':Sequelize[_0x13bd('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x13bd('0x2')]},'context':{'type':Sequelize[_0x13bd('0x2')]},'exten':{'type':Sequelize[_0x13bd('0x2')]},'priority':{'type':Sequelize[_0x13bd('0x2')]},'holdtime':{'type':Sequelize[_0x13bd('0xc')]},'mohtime':{'type':Sequelize[_0x13bd('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x13bd('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x13bd('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x13bd('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x13bd('0x2')]},'transferuniqueid':{'type':Sequelize[_0x13bd('0x2')]},'disposition':{'type':Sequelize[_0x13bd('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x13bd('0xc')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index fb2b84c..7f01bd6 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 _0xe061=['find','create','body','describe','getVoiceQueuesReport','hasOwnProperty','nolimit','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','send','map','VoiceQueueReport','rawAttributes','fieldName','type','model','name','query','filters','intersection','attributes','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','fields','length','includeAll'];(function(_0x2fa060,_0x551c32){var _0x27033a=function(_0x1c340a){while(--_0x1c340a){_0x2fa060['push'](_0x2fa060['shift']());}};_0x27033a(++_0x551c32);}(_0xe061,0xae));var _0x1e06=function(_0x3b82d3,_0xf62429){_0x3b82d3=_0x3b82d3-0x0;var _0x510c3e=_0xe061[_0x3b82d3];return _0x510c3e;};'use strict';var emlformat=require(_0x1e06('0x0'));var rimraf=require(_0x1e06('0x1'));var zipdir=require(_0x1e06('0x2'));var jsonpatch=require(_0x1e06('0x3'));var rp=require(_0x1e06('0x4'));var moment=require('moment');var BPromise=require(_0x1e06('0x5'));var Mustache=require(_0x1e06('0x6'));var util=require(_0x1e06('0x7'));var path=require(_0x1e06('0x8'));var sox=require('sox');var csv=require(_0x1e06('0x9'));var ejs=require(_0x1e06('0xa'));var fs=require('fs');var fs_extra=require(_0x1e06('0xb'));var _=require(_0x1e06('0xc'));var squel=require(_0x1e06('0xd'));var crypto=require('crypto');var jsforce=require(_0x1e06('0xe'));var deskjs=require(_0x1e06('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1e06('0x10'));var Papa=require(_0x1e06('0x11'));var Redis=require(_0x1e06('0x12'));var authService=require(_0x1e06('0x13'));var qs=require(_0x1e06('0x14'));var as=require(_0x1e06('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e06('0x16'))(_0x1e06('0x17'));var utils=require('../../config/utils');var config=require(_0x1e06('0x18'));var licenseUtil=require(_0x1e06('0x19'));var db=require(_0x1e06('0x1a'))['db'];config[_0x1e06('0x1b')]=_[_0x1e06('0x1c')](config[_0x1e06('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x1e06('0x1d'))(new Redis(config['redis']));require(_0x1e06('0x1e'))['register'](socket);function respondWithStatusCode(_0x1131ad,_0x27e063){_0x27e063=_0x27e063||0xcc;return function(_0x37deee){if(_0x37deee){return _0x1131ad['sendStatus'](_0x27e063);}return _0x1131ad[_0x1e06('0x1f')](_0x27e063)[_0x1e06('0x20')]();};}function respondWithResult(_0x34aa99,_0x29661f){_0x29661f=_0x29661f||0xc8;return function(_0x4d6b79){if(_0x4d6b79){return _0x34aa99[_0x1e06('0x1f')](_0x29661f)[_0x1e06('0x21')](_0x4d6b79);}};}function respondWithFilteredResult(_0x48c65f,_0x1193e1){return function(_0x3c80f4){if(_0x3c80f4){var _0x2a2cc7=typeof _0x1193e1[_0x1e06('0x22')]===_0x1e06('0x23')&&typeof _0x1193e1[_0x1e06('0x24')]===_0x1e06('0x23');var _0x127497=_0x3c80f4['count'];var _0x537b9f=_0x2a2cc7?0x0:_0x1193e1[_0x1e06('0x22')];var _0x410be6=_0x2a2cc7?_0x3c80f4[_0x1e06('0x25')]:_0x1193e1[_0x1e06('0x22')]+_0x1193e1[_0x1e06('0x24')];var _0x28278f;if(_0x410be6>=_0x127497){_0x410be6=_0x127497;_0x28278f=0xc8;}else{_0x28278f=0xce;}_0x48c65f[_0x1e06('0x1f')](_0x28278f);return _0x48c65f['set'](_0x1e06('0x26'),_0x537b9f+'-'+_0x410be6+'/'+_0x127497)['json'](_0x3c80f4);}return null;};}function patchUpdates(_0x1bba36){return function(_0x180a57){try{jsonpatch[_0x1e06('0x27')](_0x180a57,_0x1bba36,!![]);}catch(_0x198688){return BPromise['reject'](_0x198688);}return _0x180a57[_0x1e06('0x28')]();};}function saveUpdates(_0x5a9098,_0x4d7642){return function(_0x30d7e0){if(_0x30d7e0){return _0x30d7e0[_0x1e06('0x29')](_0x5a9098)['then'](function(_0x145716){return _0x145716;});}return null;};}function removeEntity(_0x21e769,_0x841270){return function(_0x2e1e59){if(_0x2e1e59){return _0x2e1e59[_0x1e06('0x2a')]()[_0x1e06('0x2b')](function(){_0x21e769[_0x1e06('0x1f')](0xcc)[_0x1e06('0x20')]();});}};}function handleEntityNotFound(_0x39fff1,_0x931b){return function(_0x564870){if(!_0x564870){_0x39fff1[_0x1e06('0x2c')](0x194);}return _0x564870;};}function handleError(_0x2c976d,_0xd22238){_0xd22238=_0xd22238||0x1f4;return function(_0x99508b){logger[_0x1e06('0x2d')](_0x99508b[_0x1e06('0x2e')]);if(_0x99508b['name']){delete _0x99508b['name'];}_0x2c976d[_0x1e06('0x1f')](_0xd22238)[_0x1e06('0x2f')](_0x99508b);};}exports['index']=function(_0x277669,_0x62251f){var _0x3eff01={},_0x2d6075={},_0x329a81={'count':0x0,'rows':[]};var _0x5663ff=_[_0x1e06('0x30')](db[_0x1e06('0x31')][_0x1e06('0x32')],function(_0x33e652){return{'name':_0x33e652[_0x1e06('0x33')],'type':_0x33e652[_0x1e06('0x34')]['key']};});_0x2d6075[_0x1e06('0x35')]=_['map'](_0x5663ff,_0x1e06('0x36'));_0x2d6075[_0x1e06('0x37')]=_['keys'](_0x277669[_0x1e06('0x37')]);_0x2d6075[_0x1e06('0x38')]=_[_0x1e06('0x39')](_0x2d6075[_0x1e06('0x35')],_0x2d6075['query']);_0x3eff01[_0x1e06('0x3a')]=_[_0x1e06('0x39')](_0x2d6075['model'],qs['fields'](_0x277669['query']['fields']));_0x3eff01['attributes']=_0x3eff01[_0x1e06('0x3a')]['length']?_0x3eff01[_0x1e06('0x3a')]:_0x2d6075[_0x1e06('0x35')];if(!_0x277669[_0x1e06('0x37')]['hasOwnProperty']('nolimit')){_0x3eff01[_0x1e06('0x24')]=qs['limit'](_0x277669[_0x1e06('0x37')][_0x1e06('0x24')]);_0x3eff01['offset']=qs['offset'](_0x277669[_0x1e06('0x37')][_0x1e06('0x22')]);}_0x3eff01['order']=qs[_0x1e06('0x3b')](_0x277669['query']['sort']);_0x3eff01[_0x1e06('0x3c')]=qs[_0x1e06('0x38')](_[_0x1e06('0x3d')](_0x277669[_0x1e06('0x37')],_0x2d6075['filters']),_0x5663ff);if(_0x277669[_0x1e06('0x37')][_0x1e06('0x3e')]){_0x3eff01[_0x1e06('0x3c')]=_[_0x1e06('0x3f')](_0x3eff01['where'],{'$or':_['map'](_0x5663ff,function(_0x3ea299){if(_0x3ea299[_0x1e06('0x34')]!==_0x1e06('0x40')){var _0x26aa11={};_0x26aa11[_0x3ea299[_0x1e06('0x36')]]={'$like':'%'+_0x277669['query'][_0x1e06('0x3e')]+'%'};return _0x26aa11;}})});}_0x3eff01=_[_0x1e06('0x3f')]({},_0x3eff01,_0x277669[_0x1e06('0x41')]);var _0x342e03={'where':_0x3eff01[_0x1e06('0x3c')]};return db['VoiceQueueReport'][_0x1e06('0x25')](_0x342e03)[_0x1e06('0x2b')](function(_0x14b762){_0x329a81[_0x1e06('0x25')]=_0x14b762;if(_0x277669[_0x1e06('0x37')]['includeAll']){_0x3eff01[_0x1e06('0x42')]=[{'all':!![]}];}return db[_0x1e06('0x31')][_0x1e06('0x43')](_0x3eff01);})['then'](function(_0x4203e6){_0x329a81[_0x1e06('0x44')]=_0x4203e6;return _0x329a81;})[_0x1e06('0x2b')](respondWithFilteredResult(_0x62251f,_0x3eff01))[_0x1e06('0x45')](handleError(_0x62251f,null));};exports['show']=function(_0x45e98a,_0x3d06b5){var _0x3e8414={'raw':![],'where':{'id':_0x45e98a[_0x1e06('0x46')]['id']}},_0x2a9889={};_0x2a9889[_0x1e06('0x35')]=_[_0x1e06('0x47')](db[_0x1e06('0x31')]['rawAttributes']);_0x2a9889[_0x1e06('0x37')]=_[_0x1e06('0x47')](_0x45e98a[_0x1e06('0x37')]);_0x2a9889[_0x1e06('0x38')]=_[_0x1e06('0x39')](_0x2a9889['model'],_0x2a9889['query']);_0x3e8414[_0x1e06('0x3a')]=_['intersection'](_0x2a9889['model'],qs['fields'](_0x45e98a[_0x1e06('0x37')][_0x1e06('0x48')]));_0x3e8414[_0x1e06('0x3a')]=_0x3e8414[_0x1e06('0x3a')][_0x1e06('0x49')]?_0x3e8414[_0x1e06('0x3a')]:_0x2a9889[_0x1e06('0x35')];if(_0x45e98a[_0x1e06('0x37')][_0x1e06('0x4a')]){_0x3e8414[_0x1e06('0x42')]=[{'all':!![]}];}_0x3e8414=_['merge']({},_0x3e8414,_0x45e98a[_0x1e06('0x41')]);return db['VoiceQueueReport'][_0x1e06('0x4b')](_0x3e8414)[_0x1e06('0x2b')](handleEntityNotFound(_0x3d06b5,null))['then'](respondWithResult(_0x3d06b5,null))[_0x1e06('0x45')](handleError(_0x3d06b5,null));};exports[_0x1e06('0x4c')]=function(_0x1d3827,_0x1e215e){return db[_0x1e06('0x31')]['create'](_0x1d3827[_0x1e06('0x4d')],{})[_0x1e06('0x2b')](respondWithResult(_0x1e215e,0xc9))[_0x1e06('0x45')](handleError(_0x1e215e,null));};exports['update']=function(_0x4f8a20,_0x4d3aa6){if(_0x4f8a20['body']['id']){delete _0x4f8a20[_0x1e06('0x4d')]['id'];}return db[_0x1e06('0x31')][_0x1e06('0x4b')]({'where':{'id':_0x4f8a20['params']['id']}})[_0x1e06('0x2b')](handleEntityNotFound(_0x4d3aa6,null))['then'](saveUpdates(_0x4f8a20['body'],null))[_0x1e06('0x2b')](respondWithResult(_0x4d3aa6,null))[_0x1e06('0x45')](handleError(_0x4d3aa6,null));};exports['destroy']=function(_0x19fbe7,_0x5d0636){return db[_0x1e06('0x31')][_0x1e06('0x4b')]({'where':{'id':_0x19fbe7[_0x1e06('0x46')]['id']}})['then'](handleEntityNotFound(_0x5d0636,null))['then'](removeEntity(_0x5d0636,null))[_0x1e06('0x45')](handleError(_0x5d0636,null));};exports['describe']=function(_0x26c1b6,_0x51b429){return db[_0x1e06('0x31')][_0x1e06('0x4e')]()[_0x1e06('0x2b')](respondWithResult(_0x51b429,null))['catch'](handleError(_0x51b429,null));};exports[_0x1e06('0x4f')]=function(_0x4753c6,_0x31947f){var _0x1b5aa2={},_0x3d6da8={},_0x282cde={'count':0x0,'rows':[]};_0x3d6da8[_0x1e06('0x35')]=_[_0x1e06('0x47')](db['VoiceQueueReport'][_0x1e06('0x32')]);_0x3d6da8[_0x1e06('0x37')]=_[_0x1e06('0x47')](_0x4753c6['query']);_0x3d6da8['filters']=_[_0x1e06('0x39')](_0x3d6da8['model'],_0x3d6da8[_0x1e06('0x37')]);_0x1b5aa2[_0x1e06('0x3a')]=_[_0x1e06('0x39')](_0x3d6da8[_0x1e06('0x35')],qs[_0x1e06('0x48')](_0x4753c6[_0x1e06('0x37')][_0x1e06('0x48')]));_0x1b5aa2[_0x1e06('0x3a')]=_0x1b5aa2[_0x1e06('0x3a')][_0x1e06('0x49')]?_0x1b5aa2['attributes']:_0x3d6da8[_0x1e06('0x35')];if(!_0x4753c6['query'][_0x1e06('0x50')](_0x1e06('0x51'))){_0x1b5aa2[_0x1e06('0x24')]=qs['limit'](_0x4753c6[_0x1e06('0x37')][_0x1e06('0x24')]);_0x1b5aa2['offset']=qs[_0x1e06('0x22')](_0x4753c6[_0x1e06('0x37')][_0x1e06('0x22')]);}_0x1b5aa2[_0x1e06('0x52')]=qs[_0x1e06('0x3b')](_0x4753c6[_0x1e06('0x37')][_0x1e06('0x3b')]);_0x1b5aa2['where']=qs[_0x1e06('0x38')](_['pick'](_0x4753c6[_0x1e06('0x37')],_0x3d6da8[_0x1e06('0x38')]));if(_0x4753c6[_0x1e06('0x37')][_0x1e06('0x3e')]){_0x1b5aa2[_0x1e06('0x3c')]=_[_0x1e06('0x3f')](_0x1b5aa2['where'],{'$or':_[_0x1e06('0x30')](_0x1b5aa2[_0x1e06('0x3a')],function(_0x3fc0a5){var _0x3ba309={};_0x3ba309[_0x3fc0a5]={'$like':'%'+_0x4753c6[_0x1e06('0x37')]['filter']+'%'};return _0x3ba309;})});}_0x1b5aa2=_[_0x1e06('0x3f')]({},_0x1b5aa2,_0x4753c6['options']);var _0x2e320f={'where':_0x1b5aa2[_0x1e06('0x3c')]};return db[_0x1e06('0x31')]['count'](_0x2e320f)[_0x1e06('0x2b')](function(_0x2b0fe5){_0x282cde[_0x1e06('0x25')]=_0x2b0fe5;if(_0x4753c6[_0x1e06('0x37')]['includeAll']){_0x1b5aa2['include']=[{'all':!![]}];}return db[_0x1e06('0x31')]['findAll'](_0x1b5aa2);})[_0x1e06('0x2b')](function(_0x2acc49){_0x282cde['rows']=_0x2acc49;return _0x282cde;})[_0x1e06('0x2b')](respondWithFilteredResult(_0x31947f,_0x1b5aa2,_0x1e06('0x4f')))[_0x1e06('0x45')](handleError(_0x31947f,null,_0x1e06('0x4f')));}; \ No newline at end of file +var _0xc56a=['rows','catch','show','params','keys','length','include','create','body','find','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','end','status','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceQueueReport','includeAll','findAll'];(function(_0x17f65a,_0x24ec2e){var _0x523b7c=function(_0x7b2ce7){while(--_0x7b2ce7){_0x17f65a['push'](_0x17f65a['shift']());}};_0x523b7c(++_0x24ec2e);}(_0xc56a,0xb1));var _0xac56=function(_0x4eb86a,_0x592362){_0x4eb86a=_0x4eb86a-0x0;var _0x1258d9=_0xc56a[_0x4eb86a];return _0x1258d9;};'use strict';var emlformat=require(_0xac56('0x0'));var rimraf=require(_0xac56('0x1'));var zipdir=require(_0xac56('0x2'));var jsonpatch=require(_0xac56('0x3'));var rp=require(_0xac56('0x4'));var moment=require(_0xac56('0x5'));var BPromise=require(_0xac56('0x6'));var Mustache=require(_0xac56('0x7'));var util=require(_0xac56('0x8'));var path=require('path');var sox=require(_0xac56('0x9'));var csv=require(_0xac56('0xa'));var ejs=require(_0xac56('0xb'));var fs=require('fs');var fs_extra=require(_0xac56('0xc'));var _=require(_0xac56('0xd'));var squel=require('squel');var crypto=require(_0xac56('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xac56('0xf'));var toCsv=require(_0xac56('0xa'));var querystring=require('querystring');var Papa=require(_0xac56('0x10'));var Redis=require(_0xac56('0x11'));var authService=require(_0xac56('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xac56('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac56('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xac56('0x15'));var licenseUtil=require(_0xac56('0x16'));var db=require(_0xac56('0x17'))['db'];config[_0xac56('0x18')]=_[_0xac56('0x19')](config[_0xac56('0x18')],{'host':_0xac56('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac56('0x18')]));require(_0xac56('0x1b'))[_0xac56('0x1c')](socket);function respondWithStatusCode(_0x5a634a,_0x2163d9){_0x2163d9=_0x2163d9||0xcc;return function(_0x14472c){if(_0x14472c){return _0x5a634a[_0xac56('0x1d')](_0x2163d9);}return _0x5a634a['status'](_0x2163d9)[_0xac56('0x1e')]();};}function respondWithResult(_0xcd7400,_0x4587bd){_0x4587bd=_0x4587bd||0xc8;return function(_0xfdd97a){if(_0xfdd97a){return _0xcd7400[_0xac56('0x1f')](_0x4587bd)['json'](_0xfdd97a);}};}function respondWithFilteredResult(_0x592b06,_0x39f17c){return function(_0x490a76){if(_0x490a76){var _0x47c33e=typeof _0x39f17c['offset']===_0xac56('0x20')&&typeof _0x39f17c[_0xac56('0x21')]===_0xac56('0x20');var _0x28758b=_0x490a76[_0xac56('0x22')];var _0x8c0779=_0x47c33e?0x0:_0x39f17c[_0xac56('0x23')];var _0x414a8b=_0x47c33e?_0x490a76[_0xac56('0x22')]:_0x39f17c[_0xac56('0x23')]+_0x39f17c[_0xac56('0x21')];var _0x365ee9;if(_0x414a8b>=_0x28758b){_0x414a8b=_0x28758b;_0x365ee9=0xc8;}else{_0x365ee9=0xce;}_0x592b06[_0xac56('0x1f')](_0x365ee9);return _0x592b06[_0xac56('0x24')]('Content-Range',_0x8c0779+'-'+_0x414a8b+'/'+_0x28758b)[_0xac56('0x25')](_0x490a76);}return null;};}function patchUpdates(_0x2f060e){return function(_0xe59403){try{jsonpatch[_0xac56('0x26')](_0xe59403,_0x2f060e,!![]);}catch(_0x563903){return BPromise[_0xac56('0x27')](_0x563903);}return _0xe59403[_0xac56('0x28')]();};}function saveUpdates(_0x18f544,_0x52a705){return function(_0x1328cb){if(_0x1328cb){return _0x1328cb[_0xac56('0x29')](_0x18f544)[_0xac56('0x2a')](function(_0x45d2db){return _0x45d2db;});}return null;};}function removeEntity(_0x313011,_0x87ed05){return function(_0x54ed33){if(_0x54ed33){return _0x54ed33[_0xac56('0x2b')]()[_0xac56('0x2a')](function(){_0x313011[_0xac56('0x1f')](0xcc)[_0xac56('0x1e')]();});}};}function handleEntityNotFound(_0x42c65d,_0x3a2158){return function(_0x26f871){if(!_0x26f871){_0x42c65d[_0xac56('0x1d')](0x194);}return _0x26f871;};}function handleError(_0x360ca6,_0x5d711e){_0x5d711e=_0x5d711e||0x1f4;return function(_0xfe11a3){logger[_0xac56('0x2c')](_0xfe11a3[_0xac56('0x2d')]);if(_0xfe11a3[_0xac56('0x2e')]){delete _0xfe11a3['name'];}_0x360ca6['status'](_0x5d711e)[_0xac56('0x2f')](_0xfe11a3);};}exports[_0xac56('0x30')]=function(_0x15b2e8,_0x35f669){var _0x432448={},_0x4730fb={},_0x19162e={'count':0x0,'rows':[]};var _0x480313=_[_0xac56('0x31')](db['VoiceQueueReport'][_0xac56('0x32')],function(_0x36dbf5){return{'name':_0x36dbf5[_0xac56('0x33')],'type':_0x36dbf5['type'][_0xac56('0x34')]};});_0x4730fb['model']=_[_0xac56('0x31')](_0x480313,_0xac56('0x2e'));_0x4730fb[_0xac56('0x35')]=_['keys'](_0x15b2e8[_0xac56('0x35')]);_0x4730fb[_0xac56('0x36')]=_[_0xac56('0x37')](_0x4730fb[_0xac56('0x38')],_0x4730fb[_0xac56('0x35')]);_0x432448[_0xac56('0x39')]=_[_0xac56('0x37')](_0x4730fb[_0xac56('0x38')],qs['fields'](_0x15b2e8[_0xac56('0x35')][_0xac56('0x3a')]));_0x432448['attributes']=_0x432448[_0xac56('0x39')]['length']?_0x432448[_0xac56('0x39')]:_0x4730fb[_0xac56('0x38')];if(!_0x15b2e8[_0xac56('0x35')][_0xac56('0x3b')]('nolimit')){_0x432448['limit']=qs[_0xac56('0x21')](_0x15b2e8[_0xac56('0x35')][_0xac56('0x21')]);_0x432448[_0xac56('0x23')]=qs[_0xac56('0x23')](_0x15b2e8[_0xac56('0x35')]['offset']);}_0x432448[_0xac56('0x3c')]=qs[_0xac56('0x3d')](_0x15b2e8['query'][_0xac56('0x3d')]);_0x432448[_0xac56('0x3e')]=qs[_0xac56('0x36')](_[_0xac56('0x3f')](_0x15b2e8[_0xac56('0x35')],_0x4730fb[_0xac56('0x36')]),_0x480313);if(_0x15b2e8[_0xac56('0x35')][_0xac56('0x40')]){_0x432448[_0xac56('0x3e')]=_[_0xac56('0x41')](_0x432448[_0xac56('0x3e')],{'$or':_[_0xac56('0x31')](_0x480313,function(_0x14c8cf){if(_0x14c8cf[_0xac56('0x42')]!==_0xac56('0x43')){var _0xfd545e={};_0xfd545e[_0x14c8cf[_0xac56('0x2e')]]={'$like':'%'+_0x15b2e8['query']['filter']+'%'};return _0xfd545e;}})});}_0x432448=_[_0xac56('0x41')]({},_0x432448,_0x15b2e8[_0xac56('0x44')]);var _0x463343={'where':_0x432448[_0xac56('0x3e')]};return db[_0xac56('0x45')][_0xac56('0x22')](_0x463343)[_0xac56('0x2a')](function(_0x54499c){_0x19162e['count']=_0x54499c;if(_0x15b2e8[_0xac56('0x35')][_0xac56('0x46')]){_0x432448['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0xac56('0x47')](_0x432448);})[_0xac56('0x2a')](function(_0x4712df){_0x19162e[_0xac56('0x48')]=_0x4712df;return _0x19162e;})[_0xac56('0x2a')](respondWithFilteredResult(_0x35f669,_0x432448))[_0xac56('0x49')](handleError(_0x35f669,null));};exports[_0xac56('0x4a')]=function(_0x12e1e3,_0x3d15e2){var _0x3dcafe={'raw':![],'where':{'id':_0x12e1e3[_0xac56('0x4b')]['id']}},_0x2ecf61={};_0x2ecf61[_0xac56('0x38')]=_['keys'](db['VoiceQueueReport'][_0xac56('0x32')]);_0x2ecf61['query']=_[_0xac56('0x4c')](_0x12e1e3[_0xac56('0x35')]);_0x2ecf61[_0xac56('0x36')]=_['intersection'](_0x2ecf61[_0xac56('0x38')],_0x2ecf61[_0xac56('0x35')]);_0x3dcafe[_0xac56('0x39')]=_[_0xac56('0x37')](_0x2ecf61[_0xac56('0x38')],qs[_0xac56('0x3a')](_0x12e1e3[_0xac56('0x35')][_0xac56('0x3a')]));_0x3dcafe[_0xac56('0x39')]=_0x3dcafe[_0xac56('0x39')][_0xac56('0x4d')]?_0x3dcafe[_0xac56('0x39')]:_0x2ecf61[_0xac56('0x38')];if(_0x12e1e3[_0xac56('0x35')][_0xac56('0x46')]){_0x3dcafe[_0xac56('0x4e')]=[{'all':!![]}];}_0x3dcafe=_[_0xac56('0x41')]({},_0x3dcafe,_0x12e1e3[_0xac56('0x44')]);return db['VoiceQueueReport']['find'](_0x3dcafe)[_0xac56('0x2a')](handleEntityNotFound(_0x3d15e2,null))[_0xac56('0x2a')](respondWithResult(_0x3d15e2,null))['catch'](handleError(_0x3d15e2,null));};exports[_0xac56('0x4f')]=function(_0x2fd5c1,_0x143fbf){return db['VoiceQueueReport'][_0xac56('0x4f')](_0x2fd5c1[_0xac56('0x50')],{})[_0xac56('0x2a')](respondWithResult(_0x143fbf,0xc9))[_0xac56('0x49')](handleError(_0x143fbf,null));};exports['update']=function(_0x38b1ea,_0x1381bb){if(_0x38b1ea[_0xac56('0x50')]['id']){delete _0x38b1ea[_0xac56('0x50')]['id'];}return db[_0xac56('0x45')][_0xac56('0x51')]({'where':{'id':_0x38b1ea[_0xac56('0x4b')]['id']}})[_0xac56('0x2a')](handleEntityNotFound(_0x1381bb,null))[_0xac56('0x2a')](saveUpdates(_0x38b1ea[_0xac56('0x50')],null))['then'](respondWithResult(_0x1381bb,null))['catch'](handleError(_0x1381bb,null));};exports[_0xac56('0x2b')]=function(_0xf027ad,_0x3b47ef){return db[_0xac56('0x45')][_0xac56('0x51')]({'where':{'id':_0xf027ad[_0xac56('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3b47ef,null))['then'](removeEntity(_0x3b47ef,null))['catch'](handleError(_0x3b47ef,null));};exports['describe']=function(_0xe547b0,_0x354b01){return db[_0xac56('0x45')]['describe']()[_0xac56('0x2a')](respondWithResult(_0x354b01,null))[_0xac56('0x49')](handleError(_0x354b01,null));};exports[_0xac56('0x52')]=function(_0x9b36b,_0x1e42da){var _0x1f055b={},_0x28da6e={},_0x13e7c6={'count':0x0,'rows':[]};_0x28da6e['model']=_[_0xac56('0x4c')](db['VoiceQueueReport']['rawAttributes']);_0x28da6e['query']=_[_0xac56('0x4c')](_0x9b36b[_0xac56('0x35')]);_0x28da6e[_0xac56('0x36')]=_[_0xac56('0x37')](_0x28da6e[_0xac56('0x38')],_0x28da6e[_0xac56('0x35')]);_0x1f055b[_0xac56('0x39')]=_[_0xac56('0x37')](_0x28da6e['model'],qs[_0xac56('0x3a')](_0x9b36b[_0xac56('0x35')][_0xac56('0x3a')]));_0x1f055b[_0xac56('0x39')]=_0x1f055b[_0xac56('0x39')][_0xac56('0x4d')]?_0x1f055b[_0xac56('0x39')]:_0x28da6e[_0xac56('0x38')];if(!_0x9b36b[_0xac56('0x35')][_0xac56('0x3b')]('nolimit')){_0x1f055b[_0xac56('0x21')]=qs[_0xac56('0x21')](_0x9b36b['query'][_0xac56('0x21')]);_0x1f055b['offset']=qs[_0xac56('0x23')](_0x9b36b['query']['offset']);}_0x1f055b['order']=qs[_0xac56('0x3d')](_0x9b36b[_0xac56('0x35')]['sort']);_0x1f055b[_0xac56('0x3e')]=qs[_0xac56('0x36')](_[_0xac56('0x3f')](_0x9b36b['query'],_0x28da6e[_0xac56('0x36')]));if(_0x9b36b['query'][_0xac56('0x40')]){_0x1f055b[_0xac56('0x3e')]=_[_0xac56('0x41')](_0x1f055b['where'],{'$or':_['map'](_0x1f055b['attributes'],function(_0x3baea0){var _0x32d7b3={};_0x32d7b3[_0x3baea0]={'$like':'%'+_0x9b36b['query']['filter']+'%'};return _0x32d7b3;})});}_0x1f055b=_['merge']({},_0x1f055b,_0x9b36b['options']);var _0x12269a={'where':_0x1f055b[_0xac56('0x3e')]};return db['VoiceQueueReport'][_0xac56('0x22')](_0x12269a)[_0xac56('0x2a')](function(_0x3eb5d9){_0x13e7c6[_0xac56('0x22')]=_0x3eb5d9;if(_0x9b36b[_0xac56('0x35')][_0xac56('0x46')]){_0x1f055b[_0xac56('0x4e')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x1f055b);})[_0xac56('0x2a')](function(_0x858fc){_0x13e7c6['rows']=_0x858fc;return _0x13e7c6;})[_0xac56('0x2a')](respondWithFilteredResult(_0x1e42da,_0x1f055b,_0xac56('0x52')))[_0xac56('0x49')](handleError(_0x1e42da,null,_0xac56('0x52')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index fc80c90..51e6241 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 _0x1624=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x262c7b,_0x45f2fe){var _0x28c52a=function(_0x304b6d){while(--_0x304b6d){_0x262c7b['push'](_0x262c7b['shift']());}};_0x28c52a(++_0x45f2fe);}(_0x1624,0x144));var _0x4162=function(_0x34b02e,_0x5d5032){_0x34b02e=_0x34b02e-0x0;var _0x161364=_0x1624[_0x34b02e];return _0x161364;};'use strict';var EventEmitter=require(_0x4162('0x0'));var VoiceQueueReport=require(_0x4162('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x4162('0x2')](0x0);var events={'afterCreate':_0x4162('0x3'),'afterUpdate':_0x4162('0x4'),'afterDestroy':_0x4162('0x5')};function emitEvent(_0x2e0155){return function(_0x276f73,_0x23af17,_0x225326){VoiceQueueReportEvents[_0x4162('0x6')](_0x2e0155+':'+_0x276f73['id'],_0x276f73);VoiceQueueReportEvents[_0x4162('0x6')](_0x2e0155,_0x276f73);_0x225326(null);};}for(var e in events){if(events[_0x4162('0x7')](e)){var event=events[e];VoiceQueueReport[_0x4162('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0xaddf=['setMaxListeners','save','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceQueueReport'];(function(_0x534b46,_0x5cdd4d){var _0x525eb8=function(_0x278711){while(--_0x278711){_0x534b46['push'](_0x534b46['shift']());}};_0x525eb8(++_0x5cdd4d);}(_0xaddf,0x14d));var _0xfadd=function(_0x5ea6d3,_0x5be0cc){_0x5ea6d3=_0x5ea6d3-0x0;var _0x505843=_0xaddf[_0x5ea6d3];return _0x505843;};'use strict';var EventEmitter=require(_0xfadd('0x0'));var VoiceQueueReport=require(_0xfadd('0x1'))['db'][_0xfadd('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xfadd('0x3')](0x0);var events={'afterCreate':_0xfadd('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3ad94a){return function(_0x5321e3,_0x43ed2d,_0x2505db){VoiceQueueReportEvents[_0xfadd('0x5')](_0x3ad94a+':'+_0x5321e3['id'],_0x5321e3);VoiceQueueReportEvents['emit'](_0x3ad94a,_0x5321e3);_0x2505db(null);};}for(var e in events){if(events[_0xfadd('0x6')](e)){var event=events[e];VoiceQueueReport[_0xfadd('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 4825cd3..84b2fe3 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 _0x28ac=['api','bluebird','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','uniqueid','calleridnum','lodash','util','../../config/logger'];(function(_0x1e0b61,_0x112a72){var _0x9ad2d8=function(_0x171b09){while(--_0x171b09){_0x1e0b61['push'](_0x1e0b61['shift']());}};_0x9ad2d8(++_0x112a72);}(_0x28ac,0x1cb));var _0xc28a=function(_0x469c4c,_0x45e4cc){_0x469c4c=_0x469c4c-0x0;var _0x54c6e5=_0x28ac[_0x469c4c];return _0x54c6e5;};'use strict';var _=require(_0xc28a('0x0'));var util=require(_0xc28a('0x1'));var logger=require(_0xc28a('0x2'))(_0xc28a('0x3'));var moment=require('moment');var BPromise=require(_0xc28a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc28a('0x5'));var config=require(_0xc28a('0x6'));var attributes=require(_0xc28a('0x7'));module[_0xc28a('0x8')]=function(_0x52dc74,_0x255505){return _0x52dc74['define']('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xc28a('0x9')]},{'fields':[_0xc28a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe994=['moment','request-promise','../../config/environment','./voiceQueueReport.attributes','report_queue','calleridnum','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe994,0xe6));var _0x4e99=function(_0x2fb356,_0x567092){_0x2fb356=_0x2fb356-0x0;var _0x27fb4b=_0xe994[_0x2fb356];return _0x27fb4b;};'use strict';var _=require('lodash');var util=require(_0x4e99('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4e99('0x1'));var BPromise=require('bluebird');var rp=require(_0x4e99('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4e99('0x3'));var attributes=require(_0x4e99('0x4'));module['exports']=function(_0x3698a8,_0x9f0742){return _0x3698a8['define']('VoiceQueueReport',attributes,{'tableName':_0x4e99('0x5'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x4e99('0x6')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 52573db..9e3ba9c 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 _0x54e6=['VoiceQueueReport','options','raw','where','attributes','limit','include','model','map','then','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','body','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','./voiceQueueReport.socket','register','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueueReport'];(function(_0x189d3c,_0x5efebf){var _0x485959=function(_0x1161da){while(--_0x1161da){_0x189d3c['push'](_0x189d3c['shift']());}};_0x485959(++_0x5efebf);}(_0x54e6,0xe1));var _0x654e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x54e6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x654e('0x0'));var util=require(_0x654e('0x1'));var moment=require(_0x654e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x654e('0x3'));var db=require(_0x654e('0x4'))['db'];var utils=require(_0x654e('0x5'));var logger=require('../../config/logger')(_0x654e('0x6'));var config=require('../../config/environment');var jayson=require(_0x654e('0x7'));var client=jayson[_0x654e('0x8')][_0x654e('0x9')]({'port':0x232a});config[_0x654e('0xa')]=_[_0x654e('0xb')](config[_0x654e('0xa')],{'host':_0x654e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x654e('0xd'))[_0x654e('0xe')](socket);function respondWithRpcPromise(_0x5888f1,_0x3e3589,_0x1ef4ad){return new BPromise(function(_0x405601,_0xe0686a){return client['request'](_0x5888f1,_0x1ef4ad)['then'](function(_0x343ef6){logger['info'](_0x654e('0xf'),_0x3e3589,_0x654e('0x10'));logger[_0x654e('0x11')](_0x654e('0x12'),_0x3e3589,_0x654e('0x10'),JSON[_0x654e('0x13')](_0x343ef6));if(_0x343ef6[_0x654e('0x14')]){if(_0x343ef6[_0x654e('0x14')][_0x654e('0x15')]===0x1f4){logger[_0x654e('0x14')](_0x654e('0xf'),_0x3e3589,_0x343ef6['error']['message']);return _0xe0686a(_0x343ef6['error'][_0x654e('0x16')]);}logger[_0x654e('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x3e3589,_0x343ef6[_0x654e('0x14')]['message']);return _0x405601(_0x343ef6[_0x654e('0x14')][_0x654e('0x16')]);}else{logger[_0x654e('0x17')](_0x654e('0xf'),_0x3e3589,_0x654e('0x10'));_0x405601(_0x343ef6[_0x654e('0x18')]['message']);}})[_0x654e('0x19')](function(_0x1fc823){logger['error'](_0x654e('0xf'),_0x3e3589,_0x1fc823);_0xe0686a(_0x1fc823);});});}exports[_0x654e('0x1a')]=function(_0x2c8df0){var _0x20a108=this;return new Promise(function(_0x32e8a4,_0x1f95b7){return db[_0x654e('0x1b')]['findAll']({'raw':_0x2c8df0[_0x654e('0x1c')]?_0x2c8df0[_0x654e('0x1c')][_0x654e('0x1d')]===undefined?!![]:![]:!![],'where':_0x2c8df0[_0x654e('0x1c')]?_0x2c8df0[_0x654e('0x1c')][_0x654e('0x1e')]||null:null,'attributes':_0x2c8df0[_0x654e('0x1c')]?_0x2c8df0[_0x654e('0x1c')][_0x654e('0x1f')]||null:null,'limit':_0x2c8df0[_0x654e('0x1c')]?_0x2c8df0[_0x654e('0x1c')][_0x654e('0x20')]||null:null,'include':_0x2c8df0['options']?_0x2c8df0['options'][_0x654e('0x21')]?_['map'](_0x2c8df0['options'][_0x654e('0x21')],function(_0x2e3ac6){return{'model':db[_0x2e3ac6[_0x654e('0x22')]],'as':_0x2e3ac6['as'],'attributes':_0x2e3ac6['attributes'],'include':_0x2e3ac6[_0x654e('0x21')]?_[_0x654e('0x23')](_0x2e3ac6['include'],function(_0x45f86d){return{'model':db[_0x45f86d[_0x654e('0x22')]],'as':_0x45f86d['as'],'attributes':_0x45f86d[_0x654e('0x1f')],'include':_0x45f86d['include']?_[_0x654e('0x23')](_0x45f86d[_0x654e('0x21')],function(_0x3589df){return{'model':db[_0x3589df[_0x654e('0x22')]],'as':_0x3589df['as'],'attributes':_0x3589df['attributes']};}):[]};}):[]};}):[]:[]})[_0x654e('0x24')](function(_0x45cb36){logger[_0x654e('0x17')](_0x654e('0x1a'),_0x2c8df0);logger[_0x654e('0x11')](_0x654e('0x1a'),_0x2c8df0,JSON['stringify'](_0x45cb36));_0x32e8a4(_0x45cb36);})['catch'](function(_0x27d1bd){logger[_0x654e('0x14')]('GetVoiceQueueReport',_0x27d1bd[_0x654e('0x16')],_0x2c8df0);_0x1f95b7(_0x20a108[_0x654e('0x14')](0x1f4,_0x27d1bd[_0x654e('0x16')]));});});};exports[_0x654e('0x25')]=function(_0x23d56a){var _0x382987=this;return new Promise(function(_0x1029be,_0x4698c1){return db[_0x654e('0x1b')][_0x654e('0x26')](_0x23d56a['body'],{'raw':_0x23d56a[_0x654e('0x1c')]?_0x23d56a[_0x654e('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x654e('0x24')](function(_0x53c6e0){logger[_0x654e('0x17')](_0x654e('0x25'),_0x23d56a);logger[_0x654e('0x11')](_0x654e('0x25'),_0x23d56a,JSON[_0x654e('0x13')](_0x53c6e0));_0x1029be(_0x53c6e0);})[_0x654e('0x19')](function(_0x4d024c){logger[_0x654e('0x14')](_0x654e('0x25'),_0x4d024c[_0x654e('0x16')],_0x23d56a);_0x4698c1(_0x382987[_0x654e('0x14')](0x1f4,_0x4d024c[_0x654e('0x16')]));});});};exports[_0x654e('0x27')]=function(_0x1ca758){var _0x51a3ee=this;return new Promise(function(_0x5cd55b,_0x4eeafb){return db[_0x654e('0x1b')][_0x654e('0x28')](_0x1ca758[_0x654e('0x29')],{'raw':_0x1ca758['options']?_0x1ca758[_0x654e('0x1c')][_0x654e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ca758[_0x654e('0x1c')]?_0x1ca758[_0x654e('0x1c')][_0x654e('0x1e')]||null:null,'attributes':_0x1ca758[_0x654e('0x1c')]?_0x1ca758[_0x654e('0x1c')][_0x654e('0x1f')]||null:null,'limit':_0x1ca758['options']?_0x1ca758[_0x654e('0x1c')][_0x654e('0x20')]||null:null})[_0x654e('0x24')](function(_0x16bc11){logger[_0x654e('0x17')](_0x654e('0x27'),_0x1ca758);logger['debug'](_0x654e('0x27'),_0x1ca758,JSON[_0x654e('0x13')](_0x16bc11));_0x5cd55b(_0x16bc11);})[_0x654e('0x19')](function(_0x91f2ba){logger[_0x654e('0x14')]('UpdateVoiceQueueReport',_0x91f2ba['message'],_0x1ca758);_0x4eeafb(_0x51a3ee[_0x654e('0x14')](0x1f4,_0x91f2ba[_0x654e('0x16')]));});});}; \ No newline at end of file +var _0x2e3c=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','options','raw','attributes','limit','include','model','map','GetVoiceQueueReport','catch','VoiceQueueReport','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','where','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x26333a,_0x3c5363){var _0x2c3ba4=function(_0x3323a9){while(--_0x3323a9){_0x26333a['push'](_0x26333a['shift']());}};_0x2c3ba4(++_0x3c5363);}(_0x2e3c,0xa7));var _0xc2e3=function(_0x1bf617,_0x37ca04){_0x1bf617=_0x1bf617-0x0;var _0x2aa87f=_0x2e3c[_0x1bf617];return _0x2aa87f;};'use strict';var _=require(_0xc2e3('0x0'));var util=require(_0xc2e3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc2e3('0x2'));var fs=require('fs');var Redis=require(_0xc2e3('0x3'));var db=require(_0xc2e3('0x4'))['db'];var utils=require(_0xc2e3('0x5'));var logger=require(_0xc2e3('0x6'))('rpc');var config=require(_0xc2e3('0x7'));var jayson=require(_0xc2e3('0x8'));var client=jayson[_0xc2e3('0x9')][_0xc2e3('0xa')]({'port':0x232a});config[_0xc2e3('0xb')]=_['defaults'](config[_0xc2e3('0xb')],{'host':_0xc2e3('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0xc2e3('0xd')](socket);function respondWithRpcPromise(_0x2c21ea,_0x3e51b5,_0x1db5fb){return new BPromise(function(_0x5d5534,_0x54b312){return client[_0xc2e3('0xe')](_0x2c21ea,_0x1db5fb)[_0xc2e3('0xf')](function(_0x410c93){logger[_0xc2e3('0x10')](_0xc2e3('0x11'),_0x3e51b5,_0xc2e3('0x12'));logger[_0xc2e3('0x13')](_0xc2e3('0x14'),_0x3e51b5,'request\x20sent',JSON[_0xc2e3('0x15')](_0x410c93));if(_0x410c93['error']){if(_0x410c93[_0xc2e3('0x16')][_0xc2e3('0x17')]===0x1f4){logger['error'](_0xc2e3('0x11'),_0x3e51b5,_0x410c93[_0xc2e3('0x16')][_0xc2e3('0x18')]);return _0x54b312(_0x410c93[_0xc2e3('0x16')][_0xc2e3('0x18')]);}logger[_0xc2e3('0x16')](_0xc2e3('0x11'),_0x3e51b5,_0x410c93[_0xc2e3('0x16')][_0xc2e3('0x18')]);return _0x5d5534(_0x410c93[_0xc2e3('0x16')][_0xc2e3('0x18')]);}else{logger[_0xc2e3('0x10')](_0xc2e3('0x11'),_0x3e51b5,'request\x20sent');_0x5d5534(_0x410c93[_0xc2e3('0x19')][_0xc2e3('0x18')]);}})['catch'](function(_0x53b670){logger['error'](_0xc2e3('0x11'),_0x3e51b5,_0x53b670);_0x54b312(_0x53b670);});});}exports['GetVoiceQueueReport']=function(_0x47e15e){var _0x5f01d6=this;return new Promise(function(_0x50ed2c,_0x5f2534){return db['VoiceQueueReport'][_0xc2e3('0x1a')]({'raw':_0x47e15e['options']?_0x47e15e[_0xc2e3('0x1b')][_0xc2e3('0x1c')]===undefined?!![]:![]:!![],'where':_0x47e15e[_0xc2e3('0x1b')]?_0x47e15e[_0xc2e3('0x1b')]['where']||null:null,'attributes':_0x47e15e[_0xc2e3('0x1b')]?_0x47e15e[_0xc2e3('0x1b')][_0xc2e3('0x1d')]||null:null,'limit':_0x47e15e[_0xc2e3('0x1b')]?_0x47e15e['options'][_0xc2e3('0x1e')]||null:null,'include':_0x47e15e[_0xc2e3('0x1b')]?_0x47e15e[_0xc2e3('0x1b')][_0xc2e3('0x1f')]?_['map'](_0x47e15e[_0xc2e3('0x1b')][_0xc2e3('0x1f')],function(_0x15752c){return{'model':db[_0x15752c[_0xc2e3('0x20')]],'as':_0x15752c['as'],'attributes':_0x15752c['attributes'],'include':_0x15752c['include']?_[_0xc2e3('0x21')](_0x15752c['include'],function(_0x1ed91c){return{'model':db[_0x1ed91c[_0xc2e3('0x20')]],'as':_0x1ed91c['as'],'attributes':_0x1ed91c[_0xc2e3('0x1d')],'include':_0x1ed91c[_0xc2e3('0x1f')]?_[_0xc2e3('0x21')](_0x1ed91c[_0xc2e3('0x1f')],function(_0x346b1e){return{'model':db[_0x346b1e['model']],'as':_0x346b1e['as'],'attributes':_0x346b1e[_0xc2e3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc2e3('0xf')](function(_0x39b9bd){logger['info'](_0xc2e3('0x22'),_0x47e15e);logger[_0xc2e3('0x13')](_0xc2e3('0x22'),_0x47e15e,JSON['stringify'](_0x39b9bd));_0x50ed2c(_0x39b9bd);})[_0xc2e3('0x23')](function(_0x148eb3){logger['error'](_0xc2e3('0x22'),_0x148eb3[_0xc2e3('0x18')],_0x47e15e);_0x5f2534(_0x5f01d6[_0xc2e3('0x16')](0x1f4,_0x148eb3[_0xc2e3('0x18')]));});});};exports['CreateVoiceQueueReport']=function(_0x24bf34){var _0x52fc79=this;return new Promise(function(_0x3cd899,_0xbae789){return db[_0xc2e3('0x24')][_0xc2e3('0x25')](_0x24bf34[_0xc2e3('0x26')],{'raw':_0x24bf34[_0xc2e3('0x1b')]?_0x24bf34[_0xc2e3('0x1b')][_0xc2e3('0x1c')]===undefined?!![]:![]:!![]})[_0xc2e3('0xf')](function(_0x1203af){logger[_0xc2e3('0x10')](_0xc2e3('0x27'),_0x24bf34);logger[_0xc2e3('0x13')]('CreateVoiceQueueReport',_0x24bf34,JSON[_0xc2e3('0x15')](_0x1203af));_0x3cd899(_0x1203af);})[_0xc2e3('0x23')](function(_0x1efa52){logger[_0xc2e3('0x16')](_0xc2e3('0x27'),_0x1efa52[_0xc2e3('0x18')],_0x24bf34);_0xbae789(_0x52fc79[_0xc2e3('0x16')](0x1f4,_0x1efa52['message']));});});};exports[_0xc2e3('0x28')]=function(_0x4ed3ce){var _0x4cdd74=this;return new Promise(function(_0x397536,_0x88f3d1){return db['VoiceQueueReport'][_0xc2e3('0x29')](_0x4ed3ce[_0xc2e3('0x26')],{'raw':_0x4ed3ce[_0xc2e3('0x1b')]?_0x4ed3ce[_0xc2e3('0x1b')][_0xc2e3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ed3ce['options']?_0x4ed3ce['options'][_0xc2e3('0x2a')]||null:null,'attributes':_0x4ed3ce['options']?_0x4ed3ce['options'][_0xc2e3('0x1d')]||null:null,'limit':_0x4ed3ce[_0xc2e3('0x1b')]?_0x4ed3ce[_0xc2e3('0x1b')][_0xc2e3('0x1e')]||null:null})[_0xc2e3('0xf')](function(_0x21df7d){logger[_0xc2e3('0x10')](_0xc2e3('0x28'),_0x4ed3ce);logger[_0xc2e3('0x13')](_0xc2e3('0x28'),_0x4ed3ce,JSON[_0xc2e3('0x15')](_0x21df7d));_0x397536(_0x21df7d);})[_0xc2e3('0x23')](function(_0x40250b){logger[_0xc2e3('0x16')]('UpdateVoiceQueueReport',_0x40250b[_0xc2e3('0x18')],_0x4ed3ce);_0x88f3d1(_0x4cdd74['error'](0x1f4,_0x40250b[_0xc2e3('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 976ff75..c76b9c3 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 _0x7024=['remove','update','removeListener','register','length','./voiceQueueReport.events'];(function(_0x3948ec,_0x3dfb10){var _0x2ad8f4=function(_0x4282fb){while(--_0x4282fb){_0x3948ec['push'](_0x3948ec['shift']());}};_0x2ad8f4(++_0x3dfb10);}(_0x7024,0xa1));var _0x4702=function(_0x559910,_0x82ae4){_0x559910=_0x559910-0x0;var _0xe741e9=_0x7024[_0x559910];return _0xe741e9;};'use strict';var VoiceQueueReportEvents=require(_0x4702('0x0'));var events=['save',_0x4702('0x1'),_0x4702('0x2')];function createListener(_0x4467b1,_0x5c8334){return function(_0x53217b){_0x5c8334['emit'](_0x4467b1,_0x53217b);};}function removeListener(_0x144426,_0x5902f0){return function(){VoiceQueueReportEvents[_0x4702('0x3')](_0x144426,_0x5902f0);};}exports[_0x4702('0x4')]=function(_0x57b12d){for(var _0x2a5a09=0x0,_0x336266=events[_0x4702('0x5')];_0x2a5a09<_0x336266;_0x2a5a09++){var _0x3f924e=events[_0x2a5a09];var _0x5072e8=createListener('voiceQueueReport:'+_0x3f924e,_0x57b12d);VoiceQueueReportEvents['on'](_0x3f924e,_0x5072e8);}}; \ No newline at end of file +var _0x031f=['length','voiceQueueReport:','./voiceQueueReport.events','remove','emit','removeListener','register'];(function(_0x8074ef,_0x7560bf){var _0x5c0c56=function(_0x46aeca){while(--_0x46aeca){_0x8074ef['push'](_0x8074ef['shift']());}};_0x5c0c56(++_0x7560bf);}(_0x031f,0x1c2));var _0xf031=function(_0x43afcd,_0xc54395){_0x43afcd=_0x43afcd-0x0;var _0x3b5ce7=_0x031f[_0x43afcd];return _0x3b5ce7;};'use strict';var VoiceQueueReportEvents=require(_0xf031('0x0'));var events=['save',_0xf031('0x1'),'update'];function createListener(_0x41ba47,_0x82a41a){return function(_0x14a69c){_0x82a41a[_0xf031('0x2')](_0x41ba47,_0x14a69c);};}function removeListener(_0x4901fd,_0x363a55){return function(){VoiceQueueReportEvents[_0xf031('0x3')](_0x4901fd,_0x363a55);};}exports[_0xf031('0x4')]=function(_0x503c4b){for(var _0x4582af=0x0,_0x32aa5c=events[_0xf031('0x5')];_0x4582af<_0x32aa5c;_0x4582af++){var _0x506616=events[_0x4582af];var _0x3f27ee=createListener(_0xf031('0x6')+_0x506616,_0x503c4b);VoiceQueueReportEvents['on'](_0x506616,_0x3f27ee);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index be2a812..ac95048 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 _0x1af7=['get','create','put','delete','/:id','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x35f336,_0x38c7d7){var _0x3324a7=function(_0x2dffe5){while(--_0x2dffe5){_0x35f336['push'](_0x35f336['shift']());}};_0x3324a7(++_0x38c7d7);}(_0x1af7,0x1b8));var _0x71af=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x1af7[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x71af('0x0'));var util=require(_0x71af('0x1'));var path=require(_0x71af('0x2'));var timeout=require(_0x71af('0x3'));var express=require('express');var router=express[_0x71af('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x71af('0x5'));var interaction=require(_0x71af('0x6'));var config=require('../../config/environment');var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0x71af('0x7')](),controller['index']);router[_0x71af('0x8')]('/:id',auth[_0x71af('0x7')](),controller['show']);router['post']('/',auth[_0x71af('0x7')](),controller[_0x71af('0x9')]);router[_0x71af('0xa')]('/:id',auth[_0x71af('0x7')](),controller['update']);router[_0x71af('0xb')](_0x71af('0xc'),auth[_0x71af('0x7')](),controller[_0x71af('0xd')]);module['exports']=router; \ No newline at end of file +var _0x7722=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','post','create','delete'];(function(_0x387dc1,_0x3ba649){var _0x17567c=function(_0x4690aa){while(--_0x4690aa){_0x387dc1['push'](_0x387dc1['shift']());}};_0x17567c(++_0x3ba649);}(_0x7722,0xdd));var _0x2772=function(_0x561aa9,_0x4c70ed){_0x561aa9=_0x561aa9-0x0;var _0x3dc0b6=_0x7722[_0x561aa9];return _0x3dc0b6;};'use strict';var multer=require(_0x2772('0x0'));var util=require(_0x2772('0x1'));var path=require(_0x2772('0x2'));var timeout=require('connect-timeout');var express=require(_0x2772('0x3'));var router=express[_0x2772('0x4')]();var fs_extra=require(_0x2772('0x5'));var auth=require(_0x2772('0x6'));var interaction=require(_0x2772('0x7'));var config=require(_0x2772('0x8'));var controller=require(_0x2772('0x9'));router[_0x2772('0xa')]('/',auth[_0x2772('0xb')](),controller[_0x2772('0xc')]);router['get'](_0x2772('0xd'),auth[_0x2772('0xb')](),controller['show']);router[_0x2772('0xe')]('/',auth[_0x2772('0xb')](),controller[_0x2772('0xf')]);router['put'](_0x2772('0xd'),auth[_0x2772('0xb')](),controller['update']);router[_0x2772('0x10')](_0x2772('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 60e9d0c..6f7da99 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 _0xecfe=['sequelize','exports','STRING','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x494b5a,_0x2e7c33){var _0x2b141a=function(_0x428a0a){while(--_0x428a0a){_0x494b5a['push'](_0x494b5a['shift']());}};_0x2b141a(++_0x2e7c33);}(_0xecfe,0xe1));var _0xeecf=function(_0x31a938,_0x4daec6){_0x31a938=_0x31a938-0x0;var _0x1bf341=_0xecfe[_0x31a938];return _0x1bf341;};'use strict';var Sequelize=require(_0xeecf('0x0'));var moment=require('moment');module[_0xeecf('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xeecf('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xeecf('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xeecf('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xeecf('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xeecf('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xeecf('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xeecf('0x3')](_0xeecf('0x4'))}}; \ No newline at end of file +var _0x907b=['DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','STRING'];(function(_0x3965b3,_0x472ff8){var _0x566f01=function(_0x19bb65){while(--_0x19bb65){_0x3965b3['push'](_0x3965b3['shift']());}};_0x566f01(++_0x472ff8);}(_0x907b,0xf9));var _0xb907=function(_0x2ac87c,_0x1b07b4){_0x2ac87c=_0x2ac87c-0x0;var _0x41a0b5=_0x907b[_0x2ac87c];return _0x41a0b5;};'use strict';var Sequelize=require(_0xb907('0x0'));var moment=require(_0xb907('0x1'));module['exports']={'time':{'type':Sequelize[_0xb907('0x2')]},'callid':{'type':Sequelize[_0xb907('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xb907('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xb907('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xb907('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xb907('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xb907('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xb907('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xb907('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xb907('0x4')](_0xb907('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 587fcc7..23a8552 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 _0xbf19=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','type','key','model','map','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','VoiceQueuesLog','rows','catch','fields','create','body','find','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','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','json','offset','limit','undefined','count'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbf19,0x14e));var _0x9bf1=function(_0x517648,_0x3e4708){_0x517648=_0x517648-0x0;var _0xb5372a=_0xbf19[_0x517648];return _0xb5372a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9bf1('0x0'));var rp=require(_0x9bf1('0x1'));var moment=require(_0x9bf1('0x2'));var BPromise=require(_0x9bf1('0x3'));var Mustache=require('mustache');var util=require(_0x9bf1('0x4'));var path=require(_0x9bf1('0x5'));var sox=require('sox');var csv=require(_0x9bf1('0x6'));var ejs=require(_0x9bf1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9bf1('0x8'));var squel=require(_0x9bf1('0x9'));var crypto=require('crypto');var jsforce=require(_0x9bf1('0xa'));var deskjs=require(_0x9bf1('0xb'));var toCsv=require(_0x9bf1('0x6'));var querystring=require(_0x9bf1('0xc'));var Papa=require(_0x9bf1('0xd'));var Redis=require('ioredis');var authService=require(_0x9bf1('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x9bf1('0xf'));var hardwareService=require(_0x9bf1('0x10'));var logger=require(_0x9bf1('0x11'))(_0x9bf1('0x12'));var utils=require(_0x9bf1('0x13'));var config=require(_0x9bf1('0x14'));var licenseUtil=require(_0x9bf1('0x15'));var db=require(_0x9bf1('0x16'))['db'];function respondWithStatusCode(_0xaca5f5,_0x2e81d7){_0x2e81d7=_0x2e81d7||0xcc;return function(_0x4f9f5f){if(_0x4f9f5f){return _0xaca5f5[_0x9bf1('0x17')](_0x2e81d7);}return _0xaca5f5[_0x9bf1('0x18')](_0x2e81d7)[_0x9bf1('0x19')]();};}function respondWithResult(_0x343bc9,_0x39a4b0){_0x39a4b0=_0x39a4b0||0xc8;return function(_0x473557){if(_0x473557){return _0x343bc9[_0x9bf1('0x18')](_0x39a4b0)[_0x9bf1('0x1a')](_0x473557);}};}function respondWithFilteredResult(_0x27c9b5,_0x1c4674){return function(_0x18e93e){if(_0x18e93e){var _0x381779=typeof _0x1c4674[_0x9bf1('0x1b')]==='undefined'&&typeof _0x1c4674[_0x9bf1('0x1c')]===_0x9bf1('0x1d');var _0x2405c6=_0x18e93e[_0x9bf1('0x1e')];var _0x4ad5af=_0x381779?0x0:_0x1c4674[_0x9bf1('0x1b')];var _0x1225b1=_0x381779?_0x18e93e[_0x9bf1('0x1e')]:_0x1c4674[_0x9bf1('0x1b')]+_0x1c4674[_0x9bf1('0x1c')];var _0x1be7a1;if(_0x1225b1>=_0x2405c6){_0x1225b1=_0x2405c6;_0x1be7a1=0xc8;}else{_0x1be7a1=0xce;}_0x27c9b5[_0x9bf1('0x18')](_0x1be7a1);return _0x27c9b5[_0x9bf1('0x1f')](_0x9bf1('0x20'),_0x4ad5af+'-'+_0x1225b1+'/'+_0x2405c6)[_0x9bf1('0x1a')](_0x18e93e);}return null;};}function patchUpdates(_0x1de820){return function(_0x3406e2){try{jsonpatch[_0x9bf1('0x21')](_0x3406e2,_0x1de820,!![]);}catch(_0x1583b7){return BPromise[_0x9bf1('0x22')](_0x1583b7);}return _0x3406e2[_0x9bf1('0x23')]();};}function saveUpdates(_0x176022,_0x483bd2){return function(_0x15503d){if(_0x15503d){return _0x15503d[_0x9bf1('0x24')](_0x176022)[_0x9bf1('0x25')](function(_0x4bf3c4){return _0x4bf3c4;});}return null;};}function removeEntity(_0xe9fd0b,_0x4ddddd){return function(_0x474875){if(_0x474875){return _0x474875[_0x9bf1('0x26')]()['then'](function(){_0xe9fd0b[_0x9bf1('0x18')](0xcc)[_0x9bf1('0x19')]();});}};}function handleEntityNotFound(_0x41527d,_0x4e4ee2){return function(_0xc73220){if(!_0xc73220){_0x41527d[_0x9bf1('0x17')](0x194);}return _0xc73220;};}function handleError(_0x502d47,_0x5cb90d){_0x5cb90d=_0x5cb90d||0x1f4;return function(_0x36c506){logger[_0x9bf1('0x27')](_0x36c506[_0x9bf1('0x28')]);if(_0x36c506['name']){delete _0x36c506[_0x9bf1('0x29')];}_0x502d47[_0x9bf1('0x18')](_0x5cb90d)[_0x9bf1('0x2a')](_0x36c506);};}exports[_0x9bf1('0x2b')]=function(_0x36e9a7,_0x563a63){var _0x58d8f9={},_0x551317={},_0x47c425={'count':0x0,'rows':[]};var _0x443f01=_['map'](db['VoiceQueuesLog'][_0x9bf1('0x2c')],function(_0x2843cd){return{'name':_0x2843cd['fieldName'],'type':_0x2843cd[_0x9bf1('0x2d')][_0x9bf1('0x2e')]};});_0x551317[_0x9bf1('0x2f')]=_[_0x9bf1('0x30')](_0x443f01,'name');_0x551317['query']=_[_0x9bf1('0x31')](_0x36e9a7['query']);_0x551317[_0x9bf1('0x32')]=_[_0x9bf1('0x33')](_0x551317[_0x9bf1('0x2f')],_0x551317[_0x9bf1('0x34')]);_0x58d8f9[_0x9bf1('0x35')]=_[_0x9bf1('0x33')](_0x551317[_0x9bf1('0x2f')],qs['fields'](_0x36e9a7[_0x9bf1('0x34')]['fields']));_0x58d8f9['attributes']=_0x58d8f9[_0x9bf1('0x35')][_0x9bf1('0x36')]?_0x58d8f9[_0x9bf1('0x35')]:_0x551317['model'];if(!_0x36e9a7[_0x9bf1('0x34')][_0x9bf1('0x37')](_0x9bf1('0x38'))){_0x58d8f9[_0x9bf1('0x1c')]=qs[_0x9bf1('0x1c')](_0x36e9a7[_0x9bf1('0x34')][_0x9bf1('0x1c')]);_0x58d8f9[_0x9bf1('0x1b')]=qs['offset'](_0x36e9a7[_0x9bf1('0x34')][_0x9bf1('0x1b')]);}_0x58d8f9[_0x9bf1('0x39')]=qs[_0x9bf1('0x3a')](_0x36e9a7['query'][_0x9bf1('0x3a')]);_0x58d8f9[_0x9bf1('0x3b')]=qs[_0x9bf1('0x32')](_[_0x9bf1('0x3c')](_0x36e9a7['query'],_0x551317[_0x9bf1('0x32')]),_0x443f01);if(_0x36e9a7[_0x9bf1('0x34')][_0x9bf1('0x3d')]){_0x58d8f9[_0x9bf1('0x3b')]=_[_0x9bf1('0x3e')](_0x58d8f9['where'],{'$or':_[_0x9bf1('0x30')](_0x443f01,function(_0x498123){if(_0x498123[_0x9bf1('0x2d')]!=='VIRTUAL'){var _0x19c8be={};_0x19c8be[_0x498123[_0x9bf1('0x29')]]={'$like':'%'+_0x36e9a7['query']['filter']+'%'};return _0x19c8be;}})});}_0x58d8f9=_[_0x9bf1('0x3e')]({},_0x58d8f9,_0x36e9a7[_0x9bf1('0x3f')]);var _0x1dcb86={'where':_0x58d8f9[_0x9bf1('0x3b')]};return db['VoiceQueuesLog'][_0x9bf1('0x1e')](_0x1dcb86)[_0x9bf1('0x25')](function(_0x21fdba){_0x47c425[_0x9bf1('0x1e')]=_0x21fdba;if(_0x36e9a7['query'][_0x9bf1('0x40')]){_0x58d8f9[_0x9bf1('0x41')]=[{'all':!![]}];}return db[_0x9bf1('0x42')]['findAll'](_0x58d8f9);})[_0x9bf1('0x25')](function(_0x1e290f){_0x47c425[_0x9bf1('0x43')]=_0x1e290f;return _0x47c425;})[_0x9bf1('0x25')](respondWithFilteredResult(_0x563a63,_0x58d8f9))[_0x9bf1('0x44')](handleError(_0x563a63,null));};exports['show']=function(_0x4c62a8,_0x280534){var _0xb8907a={'raw':!![],'where':{'id':_0x4c62a8['params']['id']}},_0x58df69={};_0x58df69[_0x9bf1('0x2f')]=_['keys'](db[_0x9bf1('0x42')][_0x9bf1('0x2c')]);_0x58df69['query']=_['keys'](_0x4c62a8[_0x9bf1('0x34')]);_0x58df69[_0x9bf1('0x32')]=_[_0x9bf1('0x33')](_0x58df69[_0x9bf1('0x2f')],_0x58df69[_0x9bf1('0x34')]);_0xb8907a[_0x9bf1('0x35')]=_[_0x9bf1('0x33')](_0x58df69[_0x9bf1('0x2f')],qs[_0x9bf1('0x45')](_0x4c62a8[_0x9bf1('0x34')][_0x9bf1('0x45')]));_0xb8907a[_0x9bf1('0x35')]=_0xb8907a[_0x9bf1('0x35')][_0x9bf1('0x36')]?_0xb8907a[_0x9bf1('0x35')]:_0x58df69[_0x9bf1('0x2f')];if(_0x4c62a8[_0x9bf1('0x34')]['includeAll']){_0xb8907a[_0x9bf1('0x41')]=[{'all':!![]}];}_0xb8907a=_[_0x9bf1('0x3e')]({},_0xb8907a,_0x4c62a8[_0x9bf1('0x3f')]);return db['VoiceQueuesLog']['find'](_0xb8907a)[_0x9bf1('0x25')](handleEntityNotFound(_0x280534,null))['then'](respondWithResult(_0x280534,null))['catch'](handleError(_0x280534,null));};exports[_0x9bf1('0x46')]=function(_0x371775,_0x20f377){return db[_0x9bf1('0x42')][_0x9bf1('0x46')](_0x371775[_0x9bf1('0x47')],{})[_0x9bf1('0x25')](respondWithResult(_0x20f377,0xc9))['catch'](handleError(_0x20f377,null));};exports[_0x9bf1('0x24')]=function(_0x211128,_0x1259e6){if(_0x211128['body']['id']){delete _0x211128[_0x9bf1('0x47')]['id'];}return db['VoiceQueuesLog'][_0x9bf1('0x48')]({'where':{'id':_0x211128['params']['id']}})[_0x9bf1('0x25')](handleEntityNotFound(_0x1259e6,null))['then'](saveUpdates(_0x211128[_0x9bf1('0x47')],null))[_0x9bf1('0x25')](respondWithResult(_0x1259e6,null))[_0x9bf1('0x44')](handleError(_0x1259e6,null));};exports[_0x9bf1('0x26')]=function(_0x3286d1,_0x53a1a5){return db['VoiceQueuesLog']['find']({'where':{'id':_0x3286d1['params']['id']}})['then'](handleEntityNotFound(_0x53a1a5,null))[_0x9bf1('0x25')](removeEntity(_0x53a1a5,null))['catch'](handleError(_0x53a1a5,null));}; \ No newline at end of file +var _0x10cf=['reject','update','then','destroy','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x3c08c9,_0x137365){var _0x343f10=function(_0x236592){while(--_0x236592){_0x3c08c9['push'](_0x3c08c9['shift']());}};_0x343f10(++_0x137365);}(_0x10cf,0x1ea));var _0xf10c=function(_0xd7df61,_0x330080){_0xd7df61=_0xd7df61-0x0;var _0x5c2433=_0x10cf[_0xd7df61];return _0x5c2433;};'use strict';var emlformat=require(_0xf10c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf10c('0x1'));var jsonpatch=require(_0xf10c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf10c('0x3'));var Mustache=require(_0xf10c('0x4'));var util=require(_0xf10c('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xf10c('0x6'));var ejs=require(_0xf10c('0x7'));var fs=require('fs');var fs_extra=require(_0xf10c('0x8'));var _=require(_0xf10c('0x9'));var squel=require(_0xf10c('0xa'));var crypto=require(_0xf10c('0xb'));var jsforce=require(_0xf10c('0xc'));var deskjs=require(_0xf10c('0xd'));var toCsv=require(_0xf10c('0x6'));var querystring=require(_0xf10c('0xe'));var Papa=require(_0xf10c('0xf'));var Redis=require(_0xf10c('0x10'));var authService=require(_0xf10c('0x11'));var qs=require(_0xf10c('0x12'));var as=require(_0xf10c('0x13'));var hardwareService=require(_0xf10c('0x14'));var logger=require(_0xf10c('0x15'))(_0xf10c('0x16'));var utils=require(_0xf10c('0x17'));var config=require(_0xf10c('0x18'));var licenseUtil=require(_0xf10c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29f80b,_0x11febd){_0x11febd=_0x11febd||0xcc;return function(_0x5f3788){if(_0x5f3788){return _0x29f80b['sendStatus'](_0x11febd);}return _0x29f80b[_0xf10c('0x1a')](_0x11febd)[_0xf10c('0x1b')]();};}function respondWithResult(_0x4c2c19,_0x220d1b){_0x220d1b=_0x220d1b||0xc8;return function(_0xc21a6f){if(_0xc21a6f){return _0x4c2c19[_0xf10c('0x1a')](_0x220d1b)[_0xf10c('0x1c')](_0xc21a6f);}};}function respondWithFilteredResult(_0x4af66f,_0x354f46){return function(_0xbb8dc8){if(_0xbb8dc8){var _0x913e44=typeof _0x354f46['offset']===_0xf10c('0x1d')&&typeof _0x354f46[_0xf10c('0x1e')]===_0xf10c('0x1d');var _0xb268c2=_0xbb8dc8[_0xf10c('0x1f')];var _0x1d77fb=_0x913e44?0x0:_0x354f46[_0xf10c('0x20')];var _0x1a4f3c=_0x913e44?_0xbb8dc8[_0xf10c('0x1f')]:_0x354f46[_0xf10c('0x20')]+_0x354f46[_0xf10c('0x1e')];var _0x54abce;if(_0x1a4f3c>=_0xb268c2){_0x1a4f3c=_0xb268c2;_0x54abce=0xc8;}else{_0x54abce=0xce;}_0x4af66f['status'](_0x54abce);return _0x4af66f[_0xf10c('0x21')](_0xf10c('0x22'),_0x1d77fb+'-'+_0x1a4f3c+'/'+_0xb268c2)[_0xf10c('0x1c')](_0xbb8dc8);}return null;};}function patchUpdates(_0x5af3ad){return function(_0x43f00a){try{jsonpatch['apply'](_0x43f00a,_0x5af3ad,!![]);}catch(_0x35ef98){return BPromise[_0xf10c('0x23')](_0x35ef98);}return _0x43f00a['save']();};}function saveUpdates(_0x4fe598,_0x4f6a96){return function(_0x1e6979){if(_0x1e6979){return _0x1e6979[_0xf10c('0x24')](_0x4fe598)[_0xf10c('0x25')](function(_0x28331d){return _0x28331d;});}return null;};}function removeEntity(_0x41bc2c,_0x4935fd){return function(_0x1b3fdb){if(_0x1b3fdb){return _0x1b3fdb[_0xf10c('0x26')]()['then'](function(){_0x41bc2c[_0xf10c('0x1a')](0xcc)[_0xf10c('0x1b')]();});}};}function handleEntityNotFound(_0x10db27,_0x37999e){return function(_0x182eb3){if(!_0x182eb3){_0x10db27['sendStatus'](0x194);}return _0x182eb3;};}function handleError(_0x598ee6,_0x181f97){_0x181f97=_0x181f97||0x1f4;return function(_0x3b9488){logger[_0xf10c('0x27')](_0x3b9488[_0xf10c('0x28')]);if(_0x3b9488[_0xf10c('0x29')]){delete _0x3b9488['name'];}_0x598ee6[_0xf10c('0x1a')](_0x181f97)[_0xf10c('0x2a')](_0x3b9488);};}exports[_0xf10c('0x2b')]=function(_0x141f97,_0x5befc2){var _0xc6eab4={},_0x3bb639={},_0x4e54b7={'count':0x0,'rows':[]};var _0x5778d3=_['map'](db[_0xf10c('0x2c')][_0xf10c('0x2d')],function(_0xfdcac5){return{'name':_0xfdcac5['fieldName'],'type':_0xfdcac5[_0xf10c('0x2e')][_0xf10c('0x2f')]};});_0x3bb639[_0xf10c('0x30')]=_[_0xf10c('0x31')](_0x5778d3,'name');_0x3bb639[_0xf10c('0x32')]=_['keys'](_0x141f97['query']);_0x3bb639[_0xf10c('0x33')]=_[_0xf10c('0x34')](_0x3bb639[_0xf10c('0x30')],_0x3bb639[_0xf10c('0x32')]);_0xc6eab4[_0xf10c('0x35')]=_['intersection'](_0x3bb639['model'],qs[_0xf10c('0x36')](_0x141f97[_0xf10c('0x32')][_0xf10c('0x36')]));_0xc6eab4[_0xf10c('0x35')]=_0xc6eab4[_0xf10c('0x35')][_0xf10c('0x37')]?_0xc6eab4['attributes']:_0x3bb639['model'];if(!_0x141f97['query'][_0xf10c('0x38')]('nolimit')){_0xc6eab4[_0xf10c('0x1e')]=qs[_0xf10c('0x1e')](_0x141f97['query'][_0xf10c('0x1e')]);_0xc6eab4[_0xf10c('0x20')]=qs[_0xf10c('0x20')](_0x141f97[_0xf10c('0x32')][_0xf10c('0x20')]);}_0xc6eab4[_0xf10c('0x39')]=qs[_0xf10c('0x3a')](_0x141f97[_0xf10c('0x32')]['sort']);_0xc6eab4[_0xf10c('0x3b')]=qs['filters'](_[_0xf10c('0x3c')](_0x141f97[_0xf10c('0x32')],_0x3bb639[_0xf10c('0x33')]),_0x5778d3);if(_0x141f97[_0xf10c('0x32')][_0xf10c('0x3d')]){_0xc6eab4['where']=_[_0xf10c('0x3e')](_0xc6eab4[_0xf10c('0x3b')],{'$or':_[_0xf10c('0x31')](_0x5778d3,function(_0x2eb104){if(_0x2eb104[_0xf10c('0x2e')]!==_0xf10c('0x3f')){var _0x45d091={};_0x45d091[_0x2eb104[_0xf10c('0x29')]]={'$like':'%'+_0x141f97[_0xf10c('0x32')]['filter']+'%'};return _0x45d091;}})});}_0xc6eab4=_['merge']({},_0xc6eab4,_0x141f97[_0xf10c('0x40')]);var _0x29a68b={'where':_0xc6eab4['where']};return db['VoiceQueuesLog'][_0xf10c('0x1f')](_0x29a68b)[_0xf10c('0x25')](function(_0x51beff){_0x4e54b7[_0xf10c('0x1f')]=_0x51beff;if(_0x141f97[_0xf10c('0x32')][_0xf10c('0x41')]){_0xc6eab4[_0xf10c('0x42')]=[{'all':!![]}];}return db[_0xf10c('0x2c')][_0xf10c('0x43')](_0xc6eab4);})[_0xf10c('0x25')](function(_0x4913ba){_0x4e54b7['rows']=_0x4913ba;return _0x4e54b7;})[_0xf10c('0x25')](respondWithFilteredResult(_0x5befc2,_0xc6eab4))[_0xf10c('0x44')](handleError(_0x5befc2,null));};exports[_0xf10c('0x45')]=function(_0x5b42f0,_0x3acf8f){var _0x32b22b={'raw':!![],'where':{'id':_0x5b42f0[_0xf10c('0x46')]['id']}},_0x263405={};_0x263405[_0xf10c('0x30')]=_[_0xf10c('0x47')](db[_0xf10c('0x2c')][_0xf10c('0x2d')]);_0x263405[_0xf10c('0x32')]=_['keys'](_0x5b42f0[_0xf10c('0x32')]);_0x263405[_0xf10c('0x33')]=_[_0xf10c('0x34')](_0x263405['model'],_0x263405['query']);_0x32b22b[_0xf10c('0x35')]=_['intersection'](_0x263405[_0xf10c('0x30')],qs['fields'](_0x5b42f0[_0xf10c('0x32')][_0xf10c('0x36')]));_0x32b22b[_0xf10c('0x35')]=_0x32b22b[_0xf10c('0x35')][_0xf10c('0x37')]?_0x32b22b[_0xf10c('0x35')]:_0x263405[_0xf10c('0x30')];if(_0x5b42f0['query'][_0xf10c('0x41')]){_0x32b22b[_0xf10c('0x42')]=[{'all':!![]}];}_0x32b22b=_[_0xf10c('0x3e')]({},_0x32b22b,_0x5b42f0[_0xf10c('0x40')]);return db['VoiceQueuesLog'][_0xf10c('0x48')](_0x32b22b)[_0xf10c('0x25')](handleEntityNotFound(_0x3acf8f,null))[_0xf10c('0x25')](respondWithResult(_0x3acf8f,null))['catch'](handleError(_0x3acf8f,null));};exports[_0xf10c('0x49')]=function(_0x1068db,_0x1dc4cc){return db[_0xf10c('0x2c')][_0xf10c('0x49')](_0x1068db[_0xf10c('0x4a')],{})['then'](respondWithResult(_0x1dc4cc,0xc9))[_0xf10c('0x44')](handleError(_0x1dc4cc,null));};exports[_0xf10c('0x24')]=function(_0x3850fb,_0x3de241){if(_0x3850fb['body']['id']){delete _0x3850fb[_0xf10c('0x4a')]['id'];}return db['VoiceQueuesLog'][_0xf10c('0x48')]({'where':{'id':_0x3850fb[_0xf10c('0x46')]['id']}})['then'](handleEntityNotFound(_0x3de241,null))['then'](saveUpdates(_0x3850fb[_0xf10c('0x4a')],null))[_0xf10c('0x25')](respondWithResult(_0x3de241,null))[_0xf10c('0x44')](handleError(_0x3de241,null));};exports['destroy']=function(_0x2b93b8,_0x3f3327){return db[_0xf10c('0x2c')][_0xf10c('0x48')]({'where':{'id':_0x2b93b8[_0xf10c('0x46')]['id']}})[_0xf10c('0x25')](handleEntityNotFound(_0x3f3327,null))[_0xf10c('0x25')](removeEntity(_0x3f3327,null))[_0xf10c('0x44')](handleError(_0x3f3327,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index e255ea0..6854df4 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 _0x421a=['VoiceQueuesLog','voice_queues_log','event_dtm','dtm','lodash','util','api','bluebird','request-promise','path','rimraf','./voiceQueuesLog.attributes','exports','define'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x421a,0x146));var _0xa421=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x421a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa421('0x0'));var util=require(_0xa421('0x1'));var logger=require('../../config/logger')(_0xa421('0x2'));var moment=require('moment');var BPromise=require(_0xa421('0x3'));var rp=require(_0xa421('0x4'));var fs=require('fs');var path=require(_0xa421('0x5'));var rimraf=require(_0xa421('0x6'));var config=require('../../config/environment');var attributes=require(_0xa421('0x7'));module[_0xa421('0x8')]=function(_0x37b2fb,_0x24bcee){return _0x37b2fb[_0xa421('0x9')](_0xa421('0xa'),attributes,{'tableName':_0xa421('0xb'),'paranoid':![],'indexes':[{'name':_0xa421('0xc'),'fields':['event',_0xa421('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe978=['../../config/environment','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x516871,_0x89bbe1){var _0x59e298=function(_0x102a25){while(--_0x102a25){_0x516871['push'](_0x516871['shift']());}};_0x59e298(++_0x89bbe1);}(_0xe978,0x1b1));var _0x8e97=function(_0x58110f,_0x9b3c86){_0x58110f=_0x58110f-0x0;var _0x5282c6=_0xe978[_0x58110f];return _0x5282c6;};'use strict';var _=require(_0x8e97('0x0'));var util=require(_0x8e97('0x1'));var logger=require(_0x8e97('0x2'))(_0x8e97('0x3'));var moment=require(_0x8e97('0x4'));var BPromise=require(_0x8e97('0x5'));var rp=require(_0x8e97('0x6'));var fs=require('fs');var path=require(_0x8e97('0x7'));var rimraf=require(_0x8e97('0x8'));var config=require(_0x8e97('0x9'));var attributes=require('./voiceQueuesLog.attributes');module[_0x8e97('0xa')]=function(_0xe5b994,_0x122e29){return _0xe5b994[_0x8e97('0xb')](_0x8e97('0xc'),attributes,{'tableName':_0x8e97('0xd'),'paranoid':![],'indexes':[{'name':_0x8e97('0xe'),'fields':[_0x8e97('0xf'),_0x8e97('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index afc7e9f..bb72285 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 _0x7314=['jayson/promise','client','request','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3968c9,_0x346c1b){var _0x790570=function(_0x569dab){while(--_0x569dab){_0x3968c9['push'](_0x3968c9['shift']());}};_0x790570(++_0x346c1b);}(_0x7314,0x100));var _0x4731=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7314[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4731('0x0'));var util=require(_0x4731('0x1'));var moment=require('moment');var BPromise=require(_0x4731('0x2'));var rs=require(_0x4731('0x3'));var fs=require('fs');var Redis=require(_0x4731('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4731('0x5'));var logger=require(_0x4731('0x6'))(_0x4731('0x7'));var config=require('../../config/environment');var jayson=require(_0x4731('0x8'));var client=jayson[_0x4731('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb73308,_0x3d181e,_0x3635a6){return new BPromise(function(_0x2f76d0,_0x5389b5){return client[_0x4731('0xa')](_0xb73308,_0x3635a6)['then'](function(_0x2087ca){logger[_0x4731('0xb')](_0x4731('0xc'),_0x3d181e,'request\x20sent');logger[_0x4731('0xd')](_0x4731('0xe'),_0x3d181e,_0x4731('0xf'),JSON[_0x4731('0x10')](_0x2087ca));if(_0x2087ca[_0x4731('0x11')]){if(_0x2087ca[_0x4731('0x11')][_0x4731('0x12')]===0x1f4){logger[_0x4731('0x11')](_0x4731('0xc'),_0x3d181e,_0x2087ca[_0x4731('0x11')][_0x4731('0x13')]);return _0x5389b5(_0x2087ca['error']['message']);}logger[_0x4731('0x11')](_0x4731('0xc'),_0x3d181e,_0x2087ca['error'][_0x4731('0x13')]);return _0x2f76d0(_0x2087ca[_0x4731('0x11')][_0x4731('0x13')]);}else{logger[_0x4731('0xb')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3d181e,_0x4731('0xf'));_0x2f76d0(_0x2087ca[_0x4731('0x14')]['message']);}})[_0x4731('0x15')](function(_0x1597ac){logger['error'](_0x4731('0xc'),_0x3d181e,_0x1597ac);_0x5389b5(_0x1597ac);});});} \ No newline at end of file +var _0xde5d=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueuesLog,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xde5d,0xd7));var _0xdde5=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xde5d[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xdde5('0x0'));var util=require('util');var moment=require(_0xdde5('0x1'));var BPromise=require(_0xdde5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdde5('0x3'))['db'];var utils=require(_0xdde5('0x4'));var logger=require(_0xdde5('0x5'))('rpc');var config=require(_0xdde5('0x6'));var jayson=require(_0xdde5('0x7'));var client=jayson[_0xdde5('0x8')][_0xdde5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4feada,_0x35d8e8,_0x57402f){return new BPromise(function(_0x39b7f0,_0x560b14){return client[_0xdde5('0xa')](_0x4feada,_0x57402f)[_0xdde5('0xb')](function(_0x501ef0){logger[_0xdde5('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x35d8e8,_0xdde5('0xd'));logger[_0xdde5('0xe')](_0xdde5('0xf'),_0x35d8e8,'request\x20sent',JSON[_0xdde5('0x10')](_0x501ef0));if(_0x501ef0[_0xdde5('0x11')]){if(_0x501ef0[_0xdde5('0x11')][_0xdde5('0x12')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x35d8e8,_0x501ef0[_0xdde5('0x11')][_0xdde5('0x13')]);return _0x560b14(_0x501ef0[_0xdde5('0x11')]['message']);}logger['error'](_0xdde5('0x14'),_0x35d8e8,_0x501ef0[_0xdde5('0x11')]['message']);return _0x39b7f0(_0x501ef0['error'][_0xdde5('0x13')]);}else{logger[_0xdde5('0xc')](_0xdde5('0x14'),_0x35d8e8,'request\x20sent');_0x39b7f0(_0x501ef0[_0xdde5('0x15')]['message']);}})[_0xdde5('0x16')](function(_0x29fd36){logger[_0xdde5('0x11')](_0xdde5('0x14'),_0x35d8e8,_0x29fd36);_0x560b14(_0x29fd36);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index d56855f..c8886bf 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 _0xa2ec=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete'];(function(_0x81b231,_0xef1f9c){var _0x12637d=function(_0x813bef){while(--_0x813bef){_0x81b231['push'](_0x81b231['shift']());}};_0x12637d(++_0xef1f9c);}(_0xa2ec,0x141));var _0xca2e=function(_0x7a42d9,_0x5a0c72){_0x7a42d9=_0x7a42d9-0x0;var _0x278b78=_0xa2ec[_0x7a42d9];return _0x278b78;};'use strict';var multer=require(_0xca2e('0x0'));var util=require(_0xca2e('0x1'));var path=require(_0xca2e('0x2'));var timeout=require('connect-timeout');var express=require(_0xca2e('0x3'));var router=express[_0xca2e('0x4')]();var fs_extra=require(_0xca2e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xca2e('0x6'));var config=require(_0xca2e('0x7'));var controller=require(_0xca2e('0x8'));router[_0xca2e('0x9')]('/',auth[_0xca2e('0xa')](),controller['index']);router[_0xca2e('0x9')](_0xca2e('0xb'),auth['isAuthenticated'](),controller[_0xca2e('0xc')]);router['get'](_0xca2e('0xd'),auth[_0xca2e('0xa')](),controller[_0xca2e('0xe')]);router[_0xca2e('0x9')](_0xca2e('0xf'),auth['isAuthenticated'](),controller[_0xca2e('0x10')]);router[_0xca2e('0x9')](_0xca2e('0x11'),controller[_0xca2e('0x12')]);router[_0xca2e('0x9')](_0xca2e('0x13'),auth[_0xca2e('0xa')](),controller[_0xca2e('0x14')]);router[_0xca2e('0x15')]('/',auth['isAuthenticated'](),controller[_0xca2e('0x16')]);router[_0xca2e('0x15')](_0xca2e('0x13'),auth['isAuthenticated'](),controller[_0xca2e('0x17')]);router[_0xca2e('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xca2e('0x19')]);router[_0xca2e('0x1a')](_0xca2e('0xd'),auth[_0xca2e('0xa')](),controller[_0xca2e('0x1b')]);module[_0xca2e('0x1c')]=router; \ No newline at end of file +var _0xbb6f=['get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller'];(function(_0x4bf575,_0x2c03f5){var _0x5a07ff=function(_0x7568d7){while(--_0x7568d7){_0x4bf575['push'](_0x4bf575['shift']());}};_0x5a07ff(++_0x2c03f5);}(_0xbb6f,0x1a6));var _0xfbb6=function(_0x4dcf0c,_0x30a636){_0x4dcf0c=_0x4dcf0c-0x0;var _0x1691b7=_0xbb6f[_0x4dcf0c];return _0x1691b7;};'use strict';var multer=require(_0xfbb6('0x0'));var util=require(_0xfbb6('0x1'));var path=require('path');var timeout=require(_0xfbb6('0x2'));var express=require(_0xfbb6('0x3'));var router=express[_0xfbb6('0x4')]();var fs_extra=require(_0xfbb6('0x5'));var auth=require(_0xfbb6('0x6'));var interaction=require(_0xfbb6('0x7'));var config=require(_0xfbb6('0x8'));var controller=require(_0xfbb6('0x9'));router[_0xfbb6('0xa')]('/',auth[_0xfbb6('0xb')](),controller[_0xfbb6('0xc')]);router['get'](_0xfbb6('0xd'),auth[_0xfbb6('0xb')](),controller[_0xfbb6('0xe')]);router[_0xfbb6('0xa')](_0xfbb6('0xf'),auth[_0xfbb6('0xb')](),controller['show']);router[_0xfbb6('0xa')](_0xfbb6('0x10'),auth['isAuthenticated'](),controller[_0xfbb6('0x11')]);router['get'](_0xfbb6('0x12'),controller['downloads']);router[_0xfbb6('0xa')](_0xfbb6('0x13'),auth[_0xfbb6('0xb')](),controller[_0xfbb6('0x14')]);router[_0xfbb6('0x15')]('/',auth[_0xfbb6('0xb')](),controller[_0xfbb6('0x16')]);router[_0xfbb6('0x15')](_0xfbb6('0x13'),auth['isAuthenticated'](),controller['runTranscribe']);router[_0xfbb6('0x17')](_0xfbb6('0xf'),auth[_0xfbb6('0xb')](),controller['update']);router[_0xfbb6('0x18')](_0xfbb6('0xf'),auth[_0xfbb6('0xb')](),controller[_0xfbb6('0x19')]);module[_0xfbb6('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index a9dcee2..d38d5d0 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(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 74765d7..5957736 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 _0xbbe6=['lodash','squel','crypto','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','count','offset','set','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','download','../../components/encryptor','uniqueid','value','format','existsSync','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','sequelize','MD5','token','$and','push','%s.cypher','info','cancellazione\x20fisica\x20documento\x20%s','isNil','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','upload','TranscribeService','startTranscriptionJob','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','findOne','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra'];(function(_0xa61d0a,_0x2ba437){var _0x178048=function(_0x3f7ddc){while(--_0x3f7ddc){_0xa61d0a['push'](_0xa61d0a['shift']());}};_0x178048(++_0x2ba437);}(_0xbbe6,0x89));var _0x6bbe=function(_0x236935,_0x7072eb){_0x236935=_0x236935-0x0;var _0x41c2fa=_0xbbe6[_0x236935];return _0x41c2fa;};'use strict';var emlformat=require(_0x6bbe('0x0'));var rimraf=require(_0x6bbe('0x1'));var zipdir=require(_0x6bbe('0x2'));var jsonpatch=require(_0x6bbe('0x3'));var rp=require(_0x6bbe('0x4'));var moment=require(_0x6bbe('0x5'));var BPromise=require(_0x6bbe('0x6'));var Mustache=require(_0x6bbe('0x7'));var util=require('util');var path=require(_0x6bbe('0x8'));var sox=require(_0x6bbe('0x9'));var csv=require('to-csv');var ejs=require(_0x6bbe('0xa'));var fs=require('fs');var fs_extra=require(_0x6bbe('0xb'));var _=require(_0x6bbe('0xc'));var squel=require(_0x6bbe('0xd'));var crypto=require(_0x6bbe('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6bbe('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6bbe('0x10'));var Papa=require(_0x6bbe('0x11'));var AWS=require(_0x6bbe('0x12'));var uuidv4=require(_0x6bbe('0x13'));var Redis=require(_0x6bbe('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x6bbe('0x15'));var as=require(_0x6bbe('0x16'));var hardwareService=require(_0x6bbe('0x17'));var logger=require('../../config/logger')(_0x6bbe('0x18'));var utils=require(_0x6bbe('0x19'));var config=require(_0x6bbe('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x430486,_0x4c0d9f){_0x4c0d9f=_0x4c0d9f||0xcc;return function(_0x34e4aa){if(_0x34e4aa){return _0x430486[_0x6bbe('0x1b')](_0x4c0d9f);}return _0x430486[_0x6bbe('0x1c')](_0x4c0d9f)[_0x6bbe('0x1d')]();};}function respondWithResult(_0x166563,_0xb47b77){_0xb47b77=_0xb47b77||0xc8;return function(_0x30a976){if(_0x30a976){return _0x166563['status'](_0xb47b77)['json'](_0x30a976);}};}function respondWithFilteredResult(_0x5c1ea8,_0xfe75f4){return function(_0x2dd64e){if(_0x2dd64e){var _0x14ca21=typeof _0xfe75f4['offset']===_0x6bbe('0x1e')&&typeof _0xfe75f4[_0x6bbe('0x1f')]==='undefined';var _0x21bd5e=_0x2dd64e[_0x6bbe('0x20')];var _0x141629=_0x14ca21?0x0:_0xfe75f4[_0x6bbe('0x21')];var _0x29952f=_0x14ca21?_0x2dd64e[_0x6bbe('0x20')]:_0xfe75f4[_0x6bbe('0x21')]+_0xfe75f4[_0x6bbe('0x1f')];var _0x596e11;if(_0x29952f>=_0x21bd5e){_0x29952f=_0x21bd5e;_0x596e11=0xc8;}else{_0x596e11=0xce;}_0x5c1ea8['status'](_0x596e11);return _0x5c1ea8[_0x6bbe('0x22')]('Content-Range',_0x141629+'-'+_0x29952f+'/'+_0x21bd5e)['json'](_0x2dd64e);}return null;};}function patchUpdates(_0x1b6ba3){return function(_0x3a82aa){try{jsonpatch['apply'](_0x3a82aa,_0x1b6ba3,!![]);}catch(_0x3b2657){return BPromise[_0x6bbe('0x23')](_0x3b2657);}return _0x3a82aa[_0x6bbe('0x24')]();};}function saveUpdates(_0x3fef35,_0x17f833){return function(_0x49351e){if(_0x49351e){return _0x49351e[_0x6bbe('0x25')](_0x3fef35)[_0x6bbe('0x26')](function(_0x1b963b){return _0x1b963b;});}return null;};}function removeEntity(_0x4414f9,_0x316e39){return function(_0x5ec05f){if(_0x5ec05f){return _0x5ec05f[_0x6bbe('0x27')]()['then'](function(){_0x4414f9[_0x6bbe('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e7a85,_0x573df8){return function(_0x442bd5){if(!_0x442bd5){_0x1e7a85[_0x6bbe('0x1b')](0x194);}return _0x442bd5;};}function handleError(_0x17bc9a,_0x31304b){_0x31304b=_0x31304b||0x1f4;return function(_0x262f27){logger[_0x6bbe('0x28')](_0x262f27[_0x6bbe('0x29')]);if(_0x262f27[_0x6bbe('0x2a')]){delete _0x262f27['name'];}_0x17bc9a[_0x6bbe('0x1c')](_0x31304b)[_0x6bbe('0x2b')](_0x262f27);};}exports[_0x6bbe('0x2c')]=function(_0x35d6c7,_0x2a67bc){var _0x31e5cc={},_0x223a06={},_0xc4d365={'count':0x0,'rows':[]};var _0x238298=_[_0x6bbe('0x2d')](db[_0x6bbe('0x2e')][_0x6bbe('0x2f')],function(_0xc86432){return{'name':_0xc86432[_0x6bbe('0x30')],'type':_0xc86432[_0x6bbe('0x31')]['key']};});_0x223a06[_0x6bbe('0x32')]=_[_0x6bbe('0x33')](_[_0x6bbe('0x2d')](_0x238298,_0x6bbe('0x2a')),['format']);_0x223a06[_0x6bbe('0x34')]=_[_0x6bbe('0x35')](_0x35d6c7['query']);_0x223a06[_0x6bbe('0x36')]=_[_0x6bbe('0x37')](_0x223a06[_0x6bbe('0x32')],_0x223a06[_0x6bbe('0x34')]);_0x31e5cc[_0x6bbe('0x38')]=_['intersection'](_0x223a06[_0x6bbe('0x32')],qs[_0x6bbe('0x39')](_0x35d6c7[_0x6bbe('0x34')]['fields']));_0x31e5cc['attributes']=_0x31e5cc[_0x6bbe('0x38')][_0x6bbe('0x3a')]?_0x31e5cc['attributes']:_0x223a06['model'];if(!_0x35d6c7['query']['hasOwnProperty'](_0x6bbe('0x3b'))){_0x31e5cc['limit']=qs[_0x6bbe('0x1f')](_0x35d6c7[_0x6bbe('0x34')]['limit']);_0x31e5cc[_0x6bbe('0x21')]=qs[_0x6bbe('0x21')](_0x35d6c7[_0x6bbe('0x34')][_0x6bbe('0x21')]);}_0x31e5cc['order']=qs[_0x6bbe('0x3c')](_0x35d6c7[_0x6bbe('0x34')][_0x6bbe('0x3c')]);_0x31e5cc['where']=qs[_0x6bbe('0x36')](_[_0x6bbe('0x3d')](_0x35d6c7[_0x6bbe('0x34')],_0x223a06[_0x6bbe('0x36')]),_0x238298);if(_0x35d6c7['query'][_0x6bbe('0x3e')]){_0x31e5cc[_0x6bbe('0x3f')]=_[_0x6bbe('0x40')](_0x31e5cc[_0x6bbe('0x3f')],{'$or':_[_0x6bbe('0x2d')](_0x238298,function(_0x10dcec){if(_0x10dcec[_0x6bbe('0x31')]!==_0x6bbe('0x41')){var _0x425487={};_0x425487[_0x10dcec['name']]={'$like':'%'+_0x35d6c7[_0x6bbe('0x34')][_0x6bbe('0x3e')]+'%'};return _0x425487;}})});}_0x31e5cc=_[_0x6bbe('0x40')]({},_0x31e5cc,_0x35d6c7[_0x6bbe('0x42')]);var _0x18aa61={'where':_0x31e5cc[_0x6bbe('0x3f')]};return db[_0x6bbe('0x2e')][_0x6bbe('0x20')](_0x18aa61)[_0x6bbe('0x26')](function(_0xcb74f5){_0xc4d365[_0x6bbe('0x20')]=_0xcb74f5;if(_0x35d6c7['query'][_0x6bbe('0x43')]){_0x31e5cc[_0x6bbe('0x44')]=[{'all':!![]}];}return db[_0x6bbe('0x2e')][_0x6bbe('0x45')](_0x31e5cc);})[_0x6bbe('0x26')](function(_0x437015){_0xc4d365['rows']=_0x437015;return _0xc4d365;})[_0x6bbe('0x26')](respondWithFilteredResult(_0x2a67bc,_0x31e5cc))[_0x6bbe('0x46')](handleError(_0x2a67bc,null));};exports[_0x6bbe('0x47')]=function(_0xbf50ab,_0x5625ee){var _0x310e68={'raw':![],'where':{'id':_0xbf50ab[_0x6bbe('0x48')]['id']}},_0x2a0095={};_0x2a0095[_0x6bbe('0x32')]=_[_0x6bbe('0x35')](db['VoiceRecording'][_0x6bbe('0x2f')]);_0x2a0095[_0x6bbe('0x34')]=_['keys'](_0xbf50ab['query']);_0x2a0095[_0x6bbe('0x36')]=_[_0x6bbe('0x37')](_0x2a0095['model'],_0x2a0095[_0x6bbe('0x34')]);_0x310e68['attributes']=_[_0x6bbe('0x37')](_0x2a0095['model'],qs[_0x6bbe('0x39')](_0xbf50ab[_0x6bbe('0x34')][_0x6bbe('0x39')]));_0x310e68[_0x6bbe('0x38')]=_0x310e68['attributes'][_0x6bbe('0x3a')]?_0x310e68[_0x6bbe('0x38')]:_0x2a0095[_0x6bbe('0x32')];if(_0xbf50ab[_0x6bbe('0x34')]['includeAll']){_0x310e68[_0x6bbe('0x44')]=[{'all':!![]}];}_0x310e68=_[_0x6bbe('0x40')]({},_0x310e68,_0xbf50ab[_0x6bbe('0x42')]);return db['VoiceRecording'][_0x6bbe('0x49')](_0x310e68)[_0x6bbe('0x26')](handleEntityNotFound(_0x5625ee,null))[_0x6bbe('0x26')](respondWithResult(_0x5625ee,null))[_0x6bbe('0x46')](handleError(_0x5625ee,null));};exports[_0x6bbe('0x4a')]=function(_0x2fbcfd,_0x581e70){return db[_0x6bbe('0x2e')][_0x6bbe('0x4a')](_0x2fbcfd['body'],{})['then'](respondWithResult(_0x581e70,0xc9))[_0x6bbe('0x46')](handleError(_0x581e70,null));};exports[_0x6bbe('0x25')]=function(_0x5e2f30,_0x48c67e){if(_0x5e2f30['body']['id']){delete _0x5e2f30[_0x6bbe('0x4b')]['id'];}return db[_0x6bbe('0x2e')][_0x6bbe('0x49')]({'where':{'id':_0x5e2f30[_0x6bbe('0x48')]['id']}})[_0x6bbe('0x26')](handleEntityNotFound(_0x48c67e,null))['then'](saveUpdates(_0x5e2f30[_0x6bbe('0x4b')],null))[_0x6bbe('0x26')](respondWithResult(_0x48c67e,null))['catch'](handleError(_0x48c67e,null));};exports['describe']=function(_0x453725,_0x3934db){return db[_0x6bbe('0x2e')][_0x6bbe('0x4c')]()[_0x6bbe('0x26')](respondWithResult(_0x3934db,null))[_0x6bbe('0x46')](handleError(_0x3934db,null));};exports[_0x6bbe('0x4d')]=function(_0x18e02e,_0x4f550d,_0x39313d){var _0x1c0b83=require(_0x6bbe('0x4e'));var _0x4eb186=![];var _0x5833c9={};if(_0x18e02e['query'][_0x6bbe('0x31')]&&_0x18e02e[_0x6bbe('0x34')][_0x6bbe('0x31')]===_0x6bbe('0x4f')){_0x5833c9[_0x6bbe('0x4f')]=_0x18e02e[_0x6bbe('0x48')]['id'];}else{_0x5833c9['id']=_0x18e02e[_0x6bbe('0x48')]['id'];}return db[_0x6bbe('0x2e')]['find']({'where':_0x5833c9,'attributes':['id',_0x6bbe('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x4f550d,null))[_0x6bbe('0x26')](function(_0x5d12fa){if(_0x5d12fa){var _0x114012=_0x5d12fa[_0x6bbe('0x50')];var _0x458af5=util[_0x6bbe('0x51')]('%s.cypher',_0x114012);if(fs[_0x6bbe('0x52')](_0x458af5)){_0x4eb186=!![];return _0x1c0b83['decryptFile'](_0x458af5,_0x114012,config[_0x6bbe('0x53')][_0x6bbe('0x54')])['then'](function(){return _0x5d12fa;});}return _0x5d12fa;}})[_0x6bbe('0x26')](function(_0x115fab){if(_0x115fab){var _0x3c8100=_0x115fab[_0x6bbe('0x50')];if(!fs[_0x6bbe('0x52')](_0x3c8100)){throw new db[(_0x6bbe('0x55'))][(_0x6bbe('0x56'))](_0x6bbe('0x57'));}if(_0x115fab[_0x6bbe('0x58')]){return _0x4f550d[_0x6bbe('0x4d')](_0x3c8100,_0x115fab['filename']+path[_0x6bbe('0x59')](_0x3c8100),function(){if(_0x4eb186){fs[_0x6bbe('0x5a')](_0x3c8100);}});}else{return _0x4f550d['download'](_0x3c8100,function(_0x46a98c){if(_0x4eb186){fs[_0x6bbe('0x5a')](_0x3c8100);}});}}})[_0x6bbe('0x46')](function(_0x49a778){if(_0x49a778[_0x6bbe('0x5b')]===_0x6bbe('0x57')){_0x4f550d[_0x6bbe('0x1c')](0x194)[_0x6bbe('0x2b')]('Not\x20found');}else{return handleError(_0x4f550d,null);}});};exports[_0x6bbe('0x5c')]=function(_0x574d6f,_0x323115,_0x3369f1){var _0x69fe73=require(_0x6bbe('0x4e'));var _0x541821=![];var _0x4615f8={'$and':[db[_0x6bbe('0x5d')]['where'](db[_0x6bbe('0x5d')]['fn'](_0x6bbe('0x5e'),db[_0x6bbe('0x5d')]['col'](_0x6bbe('0x4f'))),_0x574d6f[_0x6bbe('0x34')][_0x6bbe('0x5f')])]};if(_0x574d6f[_0x6bbe('0x34')][_0x6bbe('0x31')]&&_0x574d6f[_0x6bbe('0x34')][_0x6bbe('0x31')]===_0x6bbe('0x4f')){_0x4615f8[_0x6bbe('0x60')][_0x6bbe('0x61')]({'uniqueid':_0x574d6f[_0x6bbe('0x48')]['id']});}else{_0x4615f8[_0x6bbe('0x60')]['push']({'id':_0x574d6f['params']['id']});}return db[_0x6bbe('0x2e')][_0x6bbe('0x49')]({'where':_0x4615f8,'attributes':['id',_0x6bbe('0x50')],'raw':!![]})[_0x6bbe('0x26')](handleEntityNotFound(_0x323115,null))[_0x6bbe('0x26')](function(_0x2395fc){if(_0x2395fc){var _0x5a2058=util['format'](_0x6bbe('0x62'),_0x2395fc[_0x6bbe('0x50')]);if(fs[_0x6bbe('0x52')](_0x5a2058)){_0x541821=!![];return _0x69fe73['decryptFile'](_0x5a2058,_0x2395fc[_0x6bbe('0x50')],config['secrets'][_0x6bbe('0x54')])[_0x6bbe('0x26')](function(){return _0x2395fc;});}return _0x2395fc;}})[_0x6bbe('0x26')](function(_0x594f64){if(_0x594f64){if(!fs[_0x6bbe('0x52')](_0x594f64[_0x6bbe('0x50')])){throw new db[(_0x6bbe('0x55'))]['ValidationError'](_0x6bbe('0x57'));}if(_0x594f64[_0x6bbe('0x58')]){return _0x323115[_0x6bbe('0x4d')](_0x594f64['value'],_0x594f64[_0x6bbe('0x58')]+path[_0x6bbe('0x59')](_0x594f64[_0x6bbe('0x50')]),function(){if(_0x541821){fs[_0x6bbe('0x5a')](_0x594f64[_0x6bbe('0x50')]);}});}else{return _0x323115[_0x6bbe('0x4d')](_0x594f64[_0x6bbe('0x50')],function(_0x245d48){if(_0x541821){fs[_0x6bbe('0x5a')](_0x594f64['value']);}});}}})[_0x6bbe('0x46')](handleError(_0x323115,null));};exports[_0x6bbe('0x27')]=function(_0x3dbd96,_0x2121e0){return db[_0x6bbe('0x2e')][_0x6bbe('0x49')]({'where':{'id':_0x3dbd96[_0x6bbe('0x48')]['id']}})['then'](function(_0x5d7c70){if(_['isNil'](_0x5d7c70)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5d7c70;})['then'](function(_0x3ef561){var _0x29a74c=_0x3ef561[_0x6bbe('0x50')];logger[_0x6bbe('0x63')](_0x6bbe('0x64'),_0x29a74c);if(!_[_0x6bbe('0x65')](_0x3ef561[_0x6bbe('0x50')])&&fs[_0x6bbe('0x52')](_0x29a74c)){logger['info']('File:\x20\x22'+_0x29a74c+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x6bbe('0x66')](_0x29a74c);}_0x29a74c=_0x29a74c+_0x6bbe('0x67');if(!_[_0x6bbe('0x65')](_0x3ef561['value'])&&fs[_0x6bbe('0x52')](_0x29a74c)){logger[_0x6bbe('0x63')](_0x6bbe('0x68')+_0x29a74c+_0x6bbe('0x69'));fs[_0x6bbe('0x66')](_0x29a74c);}return _0x3ef561;})['then'](function(_0x117be4){if(!_0x117be4)throw new InternalError();return _0x117be4[_0x6bbe('0x27')]();})[_0x6bbe('0x26')](function(){_0x2121e0['status'](0xcc)[_0x6bbe('0x1d')]();})['catch'](handleError(_0x2121e0,null));};function getBucketslist(_0x3f08b8,_0x494ab6,_0x5d981f){return new Promise(function(_0x4414c4,_0x35df3a){var _0x1d960b=new AWS['S3']({'accessKeyId':_0x494ab6,'secretAccessKey':_0x3f08b8,'region':_0x5d981f});_0x1d960b[_0x6bbe('0x6a')]({},function(_0x3d4b59,_0x5f40c5){if(_0x3d4b59){return _0x35df3a(_0x3d4b59);}else{return _0x4414c4(_0x5f40c5);}});});}function createBucket(_0x5f4af6,_0x35f1b1,_0x42d1db,_0x5a6321){return new Promise(function(_0x169158,_0x4c70f5){var _0x4dfecf=new AWS['S3']({'accessKeyId':_0x35f1b1,'secretAccessKey':_0x5f4af6,'region':_0x42d1db});_0x4dfecf['createBucket']({'Bucket':_0x5a6321},function(_0x12f20b,_0x39e52c){if(_0x12f20b){return _0x4c70f5(_0x12f20b);}else{return _0x169158(_0x39e52c);}});});}function uploadFile(_0x2d8800,_0x50a002,_0x4f2af4,_0x67c648,_0x48ca05,_0x2762ec){return new Promise(function(_0x141643,_0xb88df8){var _0x2d5284=new AWS['S3']({'accessKeyId':_0x50a002,'secretAccessKey':_0x2d8800,'region':_0x4f2af4});_0x2d5284[_0x6bbe('0x6b')]({'Bucket':_0x67c648,'Key':_0x48ca05,'Body':_0x2762ec},function(_0x1e5dd5,_0x15558c){if(_0x1e5dd5){return _0xb88df8(_0x1e5dd5);}else{return _0x141643(_0x15558c);}});});}function startTranscribe(_0x5094c2,_0x48915c,_0x5680b1,_0x5e7730,_0x407071,_0x21c1ac){return new Promise(function(_0x5c87ff,_0x29a6c8){var _0x10e73d=new AWS[(_0x6bbe('0x6c'))]({'accessKeyId':_0x48915c,'secretAccessKey':_0x5094c2,'region':_0x5680b1});_0x10e73d[_0x6bbe('0x6d')]({'TranscriptionJobName':_0x5e7730,'LanguageCode':_0x407071,'Media':{'MediaFileUri':_0x21c1ac}},function(_0x55d32c,_0x42d3d1){if(_0x55d32c){return _0x29a6c8(_0x55d32c);}else{return _0x5c87ff(_0x42d3d1);}});});}function transcribe(_0x4fc596,_0x2dae01,_0x433b5e,_0x57bd7b,_0x19dbad,_0x388187,_0x306451){return new Promise(function(_0x139258,_0x13f82d){var _0x29bc49={};logger[_0x6bbe('0x63')](util[_0x6bbe('0x51')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x4fc596,_0x19dbad));return uploadFile(_0x2dae01,_0x433b5e,_0x57bd7b,_0x19dbad,path[_0x6bbe('0x6e')](_0x388187),fs['readFileSync'](_0x388187))['then'](function(_0x1600b6){logger[_0x6bbe('0x63')](util[_0x6bbe('0x51')](_0x6bbe('0x6f'),_0x4fc596,_0x19dbad,_0x1600b6[_0x6bbe('0x70')]));_0x29bc49[_0x6bbe('0x71')]=_0x1600b6['Bucket'];_0x29bc49['location']=_0x1600b6[_0x6bbe('0x70')];logger['info'](util[_0x6bbe('0x51')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x4fc596));return startTranscribe(_0x2dae01,_0x433b5e,_0x57bd7b,uuidv4(),_0x306451,_0x1600b6[_0x6bbe('0x70')]);})[_0x6bbe('0x26')](function(_0x4ffa57){logger[_0x6bbe('0x63')](util[_0x6bbe('0x51')](_0x6bbe('0x72'),_0x4fc596,_0x4ffa57['TranscriptionJob'][_0x6bbe('0x73')]));_0x29bc49[_0x6bbe('0x74')]=_0x4ffa57[_0x6bbe('0x75')][_0x6bbe('0x73')];_0x29bc49[_0x6bbe('0x76')]=_0x4ffa57[_0x6bbe('0x75')][_0x6bbe('0x77')];return _0x139258(_0x29bc49);})[_0x6bbe('0x46')](function(_0x78712b){return _0x13f82d(_0x78712b);});});}exports[_0x6bbe('0x78')]=function(_0x135d8d,_0x375180,_0x800575){var _0x30d36d;var _0x540509;var _0x1d2245;var _0x578f10=require(_0x6bbe('0x4e'));return db[_0x6bbe('0x2e')]['findOne']({'where':{'id':_0x135d8d[_0x6bbe('0x48')]['id']}})[_0x6bbe('0x26')](function(_0x577df2){if(_0x577df2){var _0x4f93d7=util['format']('%s.cypher',_0x577df2[_0x6bbe('0x50')]);if(fs[_0x6bbe('0x52')](_0x4f93d7)){cypher=!![];return _0x578f10['decryptFile'](_0x4f93d7,_0x577df2[_0x6bbe('0x50')],config[_0x6bbe('0x53')][_0x6bbe('0x54')])[_0x6bbe('0x26')](function(){return _0x577df2;});}return _0x577df2;}})[_0x6bbe('0x26')](function(_0x32cf49){if(!_0x32cf49){throw new db[(_0x6bbe('0x55'))]['ValidationError'](_0x6bbe('0x79'));}_0x540509=_0x32cf49;return db['Setting'][_0x6bbe('0x7a')]({'where':{'id':0x1}});})[_0x6bbe('0x26')](handleEntityNotFound(_0x375180,null))[_0x6bbe('0x26')](function(_0x29d478){if(_0x29d478){_0x30d36d=_0x29d478;if(!_0x30d36d[_0x6bbe('0x7b')]||!_0x30d36d[_0x6bbe('0x7c')]||!_0x30d36d['transcribeRegion']||!_0x30d36d[_0x6bbe('0x7d')]||!_0x30d36d[_0x6bbe('0x71')]){throw new db[(_0x6bbe('0x55'))][(_0x6bbe('0x56'))](_0x6bbe('0x7e'));}if(_0x135d8d['body'][_0x6bbe('0x7f')]&&(!_0x30d36d[_0x6bbe('0x80')]||!_0x30d36d[_0x6bbe('0x81')]||!_0x30d36d[_0x6bbe('0x82')]||!_0x30d36d[_0x6bbe('0x7d')]||!_0x30d36d['bucket'])){throw new db[(_0x6bbe('0x55'))][(_0x6bbe('0x56'))](_0x6bbe('0x83'));}return db[_0x6bbe('0x84')][_0x6bbe('0x7a')]({'where':{'id':_0x30d36d['transcribeAccountId']}});}})[_0x6bbe('0x26')](function(_0x4e0dfa){if(!_0x4e0dfa){throw new db['Sequelize'][(_0x6bbe('0x56'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x4e0dfa[_0x6bbe('0x85')]||!_0x4e0dfa[_0x6bbe('0x86')]){throw new db[(_0x6bbe('0x55'))][(_0x6bbe('0x56'))]('Cloud\x20Provider\x20not\x20configured');}_0x1d2245=_0x4e0dfa;return getBucketslist(_0x1d2245['data1'],_0x1d2245[_0x6bbe('0x86')],_0x30d36d[_0x6bbe('0x87')]);})['then'](function(_0x4b0ca8){if(_0x4b0ca8&&_0x4b0ca8[_0x6bbe('0x88')]){var _0x16dc60=_[_0x6bbe('0x49')](_0x4b0ca8[_0x6bbe('0x88')],function(_0xc9e0b5){return _0xc9e0b5[_0x6bbe('0x89')]===_0x30d36d[_0x6bbe('0x71')];});if(!_0x16dc60){logger[_0x6bbe('0x63')](util[_0x6bbe('0x51')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x135d8d[_0x6bbe('0x48')]['id'],_0x30d36d[_0x6bbe('0x71')]));return createBucket(_0x1d2245[_0x6bbe('0x85')],_0x1d2245[_0x6bbe('0x86')],_0x30d36d[_0x6bbe('0x87')],_0x30d36d[_0x6bbe('0x71')]);}logger[_0x6bbe('0x63')](util[_0x6bbe('0x51')](_0x6bbe('0x8a'),_0x135d8d[_0x6bbe('0x48')]['id'],_0x30d36d[_0x6bbe('0x71')]));return;}})['then'](function(_0x341e1f){if(_0x540509[_0x6bbe('0x76')]===_0x6bbe('0x8b')){return transcribe(_0x135d8d['params']['id'],_0x1d2245[_0x6bbe('0x85')],_0x1d2245[_0x6bbe('0x86')],_0x30d36d[_0x6bbe('0x87')],_0x30d36d[_0x6bbe('0x71')],_0x540509[_0x6bbe('0x50')],_0x30d36d['language']);}else{logger[_0x6bbe('0x63')](util[_0x6bbe('0x51')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x135d8d[_0x6bbe('0x48')]['id']));return{'transcribeStatus':_0x6bbe('0x8c')};}})[_0x6bbe('0x26')](function(_0x5f0888){if(_0x5f0888){_0x5f0888['tempSentiment']=_0x135d8d[_0x6bbe('0x4b')][_0x6bbe('0x7f')];return _0x540509[_0x6bbe('0x8d')](_0x5f0888);}})[_0x6bbe('0x26')](respondWithResult(_0x375180,null))[_0x6bbe('0x46')](handleError(_0x375180,null));};function writeFile(_0x5d6e01,_0x510b0c){return new Promise(function(_0x4609f5,_0x29b4a2){fs[_0x6bbe('0x8e')](_0x510b0c,_0x5d6e01,function(_0xa97796,_0x4a8040){if(_0xa97796){return _0x29b4a2(_0xa97796);}else{return _0x4609f5(_0x4a8040);}});});}exports[_0x6bbe('0x8f')]=function(_0x50403f,_0xcf8c8b,_0x1d3430){return db[_0x6bbe('0x2e')][_0x6bbe('0x7a')]({'where':{'id':_0x50403f[_0x6bbe('0x48')]['id']}})['then'](handleEntityNotFound(_0xcf8c8b))['then'](function(_0x91c047){if(_0x91c047&&_0x91c047[_0x6bbe('0x90')]){var _0x4ce1c8=_0x91c047[_0x6bbe('0x90')];var _0x2f1ad7=config[_0x6bbe('0x91')]+_0x6bbe('0x92')+_0x91c047['id']+_0x6bbe('0x93');if(fs[_0x6bbe('0x52')](_0x2f1ad7)){return _0x2f1ad7;}return writeFile(_0x4ce1c8,_0x2f1ad7)[_0x6bbe('0x26')](function(){return _0x2f1ad7;});}else{throw new db['Sequelize']['ValidationError'](_0x6bbe('0x94'));}})[_0x6bbe('0x26')](function(_0x10f585){return _0xcf8c8b[_0x6bbe('0x4d')](_0x10f585);})[_0x6bbe('0x46')](handleError(_0xcf8c8b));}; \ No newline at end of file +var _0x6f44=['createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','findOne','Setting','transcribeAccountId','transcribeRegion','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','data2','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','fieldName','type','differenceBy','format','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','VoiceRecording','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','describe','download','../../components/encryptor','value','%s.cypher','decryptFile','secrets','existsSync','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','Not\x20found','downloads','sequelize','uniqueid','token','$and','push','recording','Sequelize','extname','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets'];(function(_0x260fa3,_0x491c80){var _0x142101=function(_0xb10631){while(--_0xb10631){_0x260fa3['push'](_0x260fa3['shift']());}};_0x142101(++_0x491c80);}(_0x6f44,0x164));var _0x46f4=function(_0x10e787,_0x738603){_0x10e787=_0x10e787-0x0;var _0x350dfe=_0x6f44[_0x10e787];return _0x350dfe;};'use strict';var emlformat=require(_0x46f4('0x0'));var rimraf=require(_0x46f4('0x1'));var zipdir=require(_0x46f4('0x2'));var jsonpatch=require(_0x46f4('0x3'));var rp=require(_0x46f4('0x4'));var moment=require(_0x46f4('0x5'));var BPromise=require(_0x46f4('0x6'));var Mustache=require(_0x46f4('0x7'));var util=require('util');var path=require('path');var sox=require(_0x46f4('0x8'));var csv=require(_0x46f4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46f4('0xa'));var _=require(_0x46f4('0xb'));var squel=require('squel');var crypto=require(_0x46f4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x46f4('0xd'));var toCsv=require(_0x46f4('0x9'));var querystring=require(_0x46f4('0xe'));var Papa=require(_0x46f4('0xf'));var AWS=require(_0x46f4('0x10'));var uuidv4=require(_0x46f4('0x11'));var Redis=require(_0x46f4('0x12'));var authService=require(_0x46f4('0x13'));var qs=require(_0x46f4('0x14'));var as=require(_0x46f4('0x15'));var hardwareService=require(_0x46f4('0x16'));var logger=require(_0x46f4('0x17'))(_0x46f4('0x18'));var utils=require('../../config/utils');var config=require(_0x46f4('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x46f4('0x1a'))['db'];function respondWithStatusCode(_0x4bfc28,_0x81bb2d){_0x81bb2d=_0x81bb2d||0xcc;return function(_0xa7951a){if(_0xa7951a){return _0x4bfc28['sendStatus'](_0x81bb2d);}return _0x4bfc28[_0x46f4('0x1b')](_0x81bb2d)[_0x46f4('0x1c')]();};}function respondWithResult(_0x58eee9,_0x2e2b07){_0x2e2b07=_0x2e2b07||0xc8;return function(_0x40232d){if(_0x40232d){return _0x58eee9[_0x46f4('0x1b')](_0x2e2b07)[_0x46f4('0x1d')](_0x40232d);}};}function respondWithFilteredResult(_0x3e397a,_0x366bc9){return function(_0x1714b9){if(_0x1714b9){var _0x18f0f7=typeof _0x366bc9[_0x46f4('0x1e')]===_0x46f4('0x1f')&&typeof _0x366bc9[_0x46f4('0x20')]===_0x46f4('0x1f');var _0xd57d51=_0x1714b9[_0x46f4('0x21')];var _0x463932=_0x18f0f7?0x0:_0x366bc9[_0x46f4('0x1e')];var _0x28baf=_0x18f0f7?_0x1714b9['count']:_0x366bc9[_0x46f4('0x1e')]+_0x366bc9[_0x46f4('0x20')];var _0x30953f;if(_0x28baf>=_0xd57d51){_0x28baf=_0xd57d51;_0x30953f=0xc8;}else{_0x30953f=0xce;}_0x3e397a[_0x46f4('0x1b')](_0x30953f);return _0x3e397a[_0x46f4('0x22')](_0x46f4('0x23'),_0x463932+'-'+_0x28baf+'/'+_0xd57d51)[_0x46f4('0x1d')](_0x1714b9);}return null;};}function patchUpdates(_0x7db00d){return function(_0x12866b){try{jsonpatch[_0x46f4('0x24')](_0x12866b,_0x7db00d,!![]);}catch(_0x457cee){return BPromise[_0x46f4('0x25')](_0x457cee);}return _0x12866b[_0x46f4('0x26')]();};}function saveUpdates(_0x44c570,_0x3134f6){return function(_0x1ccf60){if(_0x1ccf60){return _0x1ccf60[_0x46f4('0x27')](_0x44c570)[_0x46f4('0x28')](function(_0xf4cfc9){return _0xf4cfc9;});}return null;};}function removeEntity(_0x23702f,_0x427355){return function(_0xc007e6){if(_0xc007e6){return _0xc007e6[_0x46f4('0x29')]()[_0x46f4('0x28')](function(){_0x23702f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b44c5,_0x573ce9){return function(_0x433c97){if(!_0x433c97){_0x4b44c5[_0x46f4('0x2a')](0x194);}return _0x433c97;};}function handleError(_0x3b9898,_0x38a1d6){_0x38a1d6=_0x38a1d6||0x1f4;return function(_0x1e1235){logger[_0x46f4('0x2b')](_0x1e1235['stack']);if(_0x1e1235[_0x46f4('0x2c')]){delete _0x1e1235['name'];}_0x3b9898[_0x46f4('0x1b')](_0x38a1d6)[_0x46f4('0x2d')](_0x1e1235);};}exports[_0x46f4('0x2e')]=function(_0x4531af,_0x365c45){var _0xefabb3={},_0x5bbdef={},_0x3e6dfa={'count':0x0,'rows':[]};var _0x42b59a=_[_0x46f4('0x2f')](db['VoiceRecording']['rawAttributes'],function(_0x5442a5){return{'name':_0x5442a5[_0x46f4('0x30')],'type':_0x5442a5[_0x46f4('0x31')]['key']};});_0x5bbdef['model']=_[_0x46f4('0x32')](_['map'](_0x42b59a,_0x46f4('0x2c')),[_0x46f4('0x33')]);_0x5bbdef[_0x46f4('0x34')]=_[_0x46f4('0x35')](_0x4531af[_0x46f4('0x34')]);_0x5bbdef['filters']=_['intersection'](_0x5bbdef[_0x46f4('0x36')],_0x5bbdef[_0x46f4('0x34')]);_0xefabb3[_0x46f4('0x37')]=_[_0x46f4('0x38')](_0x5bbdef[_0x46f4('0x36')],qs[_0x46f4('0x39')](_0x4531af[_0x46f4('0x34')][_0x46f4('0x39')]));_0xefabb3[_0x46f4('0x37')]=_0xefabb3[_0x46f4('0x37')][_0x46f4('0x3a')]?_0xefabb3['attributes']:_0x5bbdef[_0x46f4('0x36')];if(!_0x4531af[_0x46f4('0x34')][_0x46f4('0x3b')](_0x46f4('0x3c'))){_0xefabb3[_0x46f4('0x20')]=qs[_0x46f4('0x20')](_0x4531af['query'][_0x46f4('0x20')]);_0xefabb3[_0x46f4('0x1e')]=qs[_0x46f4('0x1e')](_0x4531af['query'][_0x46f4('0x1e')]);}_0xefabb3[_0x46f4('0x3d')]=qs[_0x46f4('0x3e')](_0x4531af[_0x46f4('0x34')][_0x46f4('0x3e')]);_0xefabb3[_0x46f4('0x3f')]=qs[_0x46f4('0x40')](_[_0x46f4('0x41')](_0x4531af[_0x46f4('0x34')],_0x5bbdef[_0x46f4('0x40')]),_0x42b59a);if(_0x4531af[_0x46f4('0x34')][_0x46f4('0x42')]){_0xefabb3[_0x46f4('0x3f')]=_['merge'](_0xefabb3['where'],{'$or':_[_0x46f4('0x2f')](_0x42b59a,function(_0x59bc6f){if(_0x59bc6f[_0x46f4('0x31')]!=='VIRTUAL'){var _0x48c595={};_0x48c595[_0x59bc6f[_0x46f4('0x2c')]]={'$like':'%'+_0x4531af[_0x46f4('0x34')][_0x46f4('0x42')]+'%'};return _0x48c595;}})});}_0xefabb3=_[_0x46f4('0x43')]({},_0xefabb3,_0x4531af[_0x46f4('0x44')]);var _0x1fc39c={'where':_0xefabb3[_0x46f4('0x3f')]};return db[_0x46f4('0x45')][_0x46f4('0x21')](_0x1fc39c)[_0x46f4('0x28')](function(_0x42c4c9){_0x3e6dfa[_0x46f4('0x21')]=_0x42c4c9;if(_0x4531af[_0x46f4('0x34')][_0x46f4('0x46')]){_0xefabb3['include']=[{'all':!![]}];}return db[_0x46f4('0x45')][_0x46f4('0x47')](_0xefabb3);})[_0x46f4('0x28')](function(_0xec9356){_0x3e6dfa[_0x46f4('0x48')]=_0xec9356;return _0x3e6dfa;})[_0x46f4('0x28')](respondWithFilteredResult(_0x365c45,_0xefabb3))[_0x46f4('0x49')](handleError(_0x365c45,null));};exports[_0x46f4('0x4a')]=function(_0x26ef14,_0xa13d8f){var _0x5901c0={'raw':![],'where':{'id':_0x26ef14['params']['id']}},_0x59ad46={};_0x59ad46[_0x46f4('0x36')]=_[_0x46f4('0x35')](db[_0x46f4('0x45')][_0x46f4('0x4b')]);_0x59ad46[_0x46f4('0x34')]=_[_0x46f4('0x35')](_0x26ef14['query']);_0x59ad46['filters']=_[_0x46f4('0x38')](_0x59ad46[_0x46f4('0x36')],_0x59ad46[_0x46f4('0x34')]);_0x5901c0['attributes']=_[_0x46f4('0x38')](_0x59ad46[_0x46f4('0x36')],qs[_0x46f4('0x39')](_0x26ef14[_0x46f4('0x34')][_0x46f4('0x39')]));_0x5901c0[_0x46f4('0x37')]=_0x5901c0[_0x46f4('0x37')][_0x46f4('0x3a')]?_0x5901c0[_0x46f4('0x37')]:_0x59ad46[_0x46f4('0x36')];if(_0x26ef14[_0x46f4('0x34')][_0x46f4('0x46')]){_0x5901c0[_0x46f4('0x4c')]=[{'all':!![]}];}_0x5901c0=_[_0x46f4('0x43')]({},_0x5901c0,_0x26ef14[_0x46f4('0x44')]);return db[_0x46f4('0x45')][_0x46f4('0x4d')](_0x5901c0)[_0x46f4('0x28')](handleEntityNotFound(_0xa13d8f,null))[_0x46f4('0x28')](respondWithResult(_0xa13d8f,null))[_0x46f4('0x49')](handleError(_0xa13d8f,null));};exports[_0x46f4('0x4e')]=function(_0x2119be,_0x2abbc4){return db[_0x46f4('0x45')][_0x46f4('0x4e')](_0x2119be[_0x46f4('0x4f')],{})['then'](respondWithResult(_0x2abbc4,0xc9))[_0x46f4('0x49')](handleError(_0x2abbc4,null));};exports[_0x46f4('0x27')]=function(_0x4df1eb,_0x127703){if(_0x4df1eb[_0x46f4('0x4f')]['id']){delete _0x4df1eb['body']['id'];}return db[_0x46f4('0x45')][_0x46f4('0x4d')]({'where':{'id':_0x4df1eb[_0x46f4('0x50')]['id']}})[_0x46f4('0x28')](handleEntityNotFound(_0x127703,null))[_0x46f4('0x28')](saveUpdates(_0x4df1eb[_0x46f4('0x4f')],null))['then'](respondWithResult(_0x127703,null))['catch'](handleError(_0x127703,null));};exports[_0x46f4('0x51')]=function(_0x45cddf,_0x2f3f67){return db['VoiceRecording'][_0x46f4('0x51')]()['then'](respondWithResult(_0x2f3f67,null))[_0x46f4('0x49')](handleError(_0x2f3f67,null));};exports[_0x46f4('0x52')]=function(_0x15c021,_0x23504c,_0xc2b382){var _0x17c50f=require(_0x46f4('0x53'));var _0x1fdf79=![];var _0xa6c76e={};if(_0x15c021[_0x46f4('0x34')][_0x46f4('0x31')]&&_0x15c021[_0x46f4('0x34')][_0x46f4('0x31')]==='uniqueid'){_0xa6c76e['uniqueid']=_0x15c021[_0x46f4('0x50')]['id'];}else{_0xa6c76e['id']=_0x15c021[_0x46f4('0x50')]['id'];}return db['VoiceRecording']['find']({'where':_0xa6c76e,'attributes':['id',_0x46f4('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x23504c,null))[_0x46f4('0x28')](function(_0xe82b74){if(_0xe82b74){var _0x2b333a=_0xe82b74['value'];var _0x25b3ac=util[_0x46f4('0x33')](_0x46f4('0x55'),_0x2b333a);if(fs['existsSync'](_0x25b3ac)){_0x1fdf79=!![];return _0x17c50f[_0x46f4('0x56')](_0x25b3ac,_0x2b333a,config[_0x46f4('0x57')]['recording'])['then'](function(){return _0xe82b74;});}return _0xe82b74;}})[_0x46f4('0x28')](function(_0x45fa26){if(_0x45fa26){var _0x44b507=_0x45fa26[_0x46f4('0x54')];if(!fs[_0x46f4('0x58')](_0x44b507)){throw new db['Sequelize'][(_0x46f4('0x59'))](_0x46f4('0x5a'));}if(_0x45fa26[_0x46f4('0x5b')]){return _0x23504c[_0x46f4('0x52')](_0x44b507,_0x45fa26[_0x46f4('0x5b')]+path['extname'](_0x44b507),function(){if(_0x1fdf79){fs[_0x46f4('0x5c')](_0x44b507);}});}else{return _0x23504c[_0x46f4('0x52')](_0x44b507,function(_0x5da085){if(_0x1fdf79){fs[_0x46f4('0x5c')](_0x44b507);}});}}})[_0x46f4('0x49')](function(_0x39006f){if(_0x39006f['message']===_0x46f4('0x5a')){_0x23504c[_0x46f4('0x1b')](0x194)['send'](_0x46f4('0x5d'));}else{return handleError(_0x23504c,null);}});};exports[_0x46f4('0x5e')]=function(_0x1fccfa,_0x19760f,_0x2ab07a){var _0x6ba34=require(_0x46f4('0x53'));var _0x5bcb1f=![];var _0x13f44e={'$and':[db[_0x46f4('0x5f')][_0x46f4('0x3f')](db[_0x46f4('0x5f')]['fn']('MD5',db[_0x46f4('0x5f')]['col'](_0x46f4('0x60'))),_0x1fccfa['query'][_0x46f4('0x61')])]};if(_0x1fccfa[_0x46f4('0x34')][_0x46f4('0x31')]&&_0x1fccfa[_0x46f4('0x34')]['type']===_0x46f4('0x60')){_0x13f44e[_0x46f4('0x62')][_0x46f4('0x63')]({'uniqueid':_0x1fccfa['params']['id']});}else{_0x13f44e[_0x46f4('0x62')][_0x46f4('0x63')]({'id':_0x1fccfa[_0x46f4('0x50')]['id']});}return db['VoiceRecording'][_0x46f4('0x4d')]({'where':_0x13f44e,'attributes':['id','value'],'raw':!![]})[_0x46f4('0x28')](handleEntityNotFound(_0x19760f,null))[_0x46f4('0x28')](function(_0x25a120){if(_0x25a120){var _0x5eb900=util[_0x46f4('0x33')](_0x46f4('0x55'),_0x25a120[_0x46f4('0x54')]);if(fs[_0x46f4('0x58')](_0x5eb900)){_0x5bcb1f=!![];return _0x6ba34[_0x46f4('0x56')](_0x5eb900,_0x25a120[_0x46f4('0x54')],config[_0x46f4('0x57')][_0x46f4('0x64')])[_0x46f4('0x28')](function(){return _0x25a120;});}return _0x25a120;}})['then'](function(_0x2b5108){if(_0x2b5108){if(!fs['existsSync'](_0x2b5108[_0x46f4('0x54')])){throw new db[(_0x46f4('0x65'))][(_0x46f4('0x59'))]('VoiceRecording\x20not\x20found');}if(_0x2b5108[_0x46f4('0x5b')]){return _0x19760f[_0x46f4('0x52')](_0x2b5108[_0x46f4('0x54')],_0x2b5108[_0x46f4('0x5b')]+path[_0x46f4('0x66')](_0x2b5108[_0x46f4('0x54')]),function(){if(_0x5bcb1f){fs[_0x46f4('0x5c')](_0x2b5108[_0x46f4('0x54')]);}});}else{return _0x19760f['download'](_0x2b5108[_0x46f4('0x54')],function(_0x6a62a){if(_0x5bcb1f){fs[_0x46f4('0x5c')](_0x2b5108[_0x46f4('0x54')]);}});}}})[_0x46f4('0x49')](handleError(_0x19760f,null));};exports[_0x46f4('0x29')]=function(_0x3f9abb,_0x2f9bbb){return db['VoiceRecording'][_0x46f4('0x4d')]({'where':{'id':_0x3f9abb[_0x46f4('0x50')]['id']}})[_0x46f4('0x28')](function(_0x2b3efe){if(_[_0x46f4('0x67')](_0x2b3efe)){throw new ReferenceError(_0x46f4('0x68'));}return _0x2b3efe;})[_0x46f4('0x28')](function(_0x5eebb4){var _0x3f8e63=_0x5eebb4[_0x46f4('0x54')];logger[_0x46f4('0x69')](_0x46f4('0x6a'),_0x3f8e63);if(!_[_0x46f4('0x67')](_0x5eebb4['value'])&&fs[_0x46f4('0x58')](_0x3f8e63)){logger['info']('File:\x20\x22'+_0x3f8e63+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x46f4('0x6b')](_0x3f8e63);}_0x3f8e63=_0x3f8e63+_0x46f4('0x6c');if(!_[_0x46f4('0x67')](_0x5eebb4[_0x46f4('0x54')])&&fs['existsSync'](_0x3f8e63)){logger['info'](_0x46f4('0x6d')+_0x3f8e63+_0x46f4('0x6e'));fs[_0x46f4('0x6b')](_0x3f8e63);}return _0x5eebb4;})[_0x46f4('0x28')](function(_0x1f9db0){if(!_0x1f9db0)throw new InternalError();return _0x1f9db0[_0x46f4('0x29')]();})[_0x46f4('0x28')](function(){_0x2f9bbb['status'](0xcc)[_0x46f4('0x1c')]();})['catch'](handleError(_0x2f9bbb,null));};function getBucketslist(_0xb9597,_0x5d566c,_0x33096d){return new Promise(function(_0x4a2cb0,_0x2358b1){var _0x4a9bd9=new AWS['S3']({'accessKeyId':_0x5d566c,'secretAccessKey':_0xb9597,'region':_0x33096d});_0x4a9bd9[_0x46f4('0x6f')]({},function(_0x388a3b,_0x418cf1){if(_0x388a3b){return _0x2358b1(_0x388a3b);}else{return _0x4a2cb0(_0x418cf1);}});});}function createBucket(_0x3cd35b,_0xb64215,_0x3bc63f,_0x49c9d5){return new Promise(function(_0x2aee28,_0x18b0fb){var _0x39c64d=new AWS['S3']({'accessKeyId':_0xb64215,'secretAccessKey':_0x3cd35b,'region':_0x3bc63f});_0x39c64d[_0x46f4('0x70')]({'Bucket':_0x49c9d5},function(_0x5c9046,_0x5d847a){if(_0x5c9046){return _0x18b0fb(_0x5c9046);}else{return _0x2aee28(_0x5d847a);}});});}function uploadFile(_0x3294df,_0x116e12,_0x226bf6,_0x52b0ea,_0x432e9f,_0x513d70){return new Promise(function(_0x580065,_0x1e0f8c){var _0x4d5a04=new AWS['S3']({'accessKeyId':_0x116e12,'secretAccessKey':_0x3294df,'region':_0x226bf6});_0x4d5a04[_0x46f4('0x71')]({'Bucket':_0x52b0ea,'Key':_0x432e9f,'Body':_0x513d70},function(_0x3d7431,_0x2f8259){if(_0x3d7431){return _0x1e0f8c(_0x3d7431);}else{return _0x580065(_0x2f8259);}});});}function startTranscribe(_0x14bbed,_0x5415a7,_0x5378da,_0x38b5ba,_0x113814,_0x1520fd){return new Promise(function(_0x4b83e1,_0xb6cc4c){var _0x11ad04=new AWS[(_0x46f4('0x72'))]({'accessKeyId':_0x5415a7,'secretAccessKey':_0x14bbed,'region':_0x5378da});_0x11ad04[_0x46f4('0x73')]({'TranscriptionJobName':_0x38b5ba,'LanguageCode':_0x113814,'Media':{'MediaFileUri':_0x1520fd}},function(_0x50b247,_0x32624c){if(_0x50b247){return _0xb6cc4c(_0x50b247);}else{return _0x4b83e1(_0x32624c);}});});}function transcribe(_0x1dbd26,_0x176c43,_0x1e9f10,_0x4cf126,_0x3f5df4,_0x7e3f15,_0x7fb5b3){return new Promise(function(_0x5af7d2,_0x132f15){var _0x55fe7c={};logger[_0x46f4('0x69')](util['format'](_0x46f4('0x74'),_0x1dbd26,_0x3f5df4));return uploadFile(_0x176c43,_0x1e9f10,_0x4cf126,_0x3f5df4,path[_0x46f4('0x75')](_0x7e3f15),fs[_0x46f4('0x76')](_0x7e3f15))[_0x46f4('0x28')](function(_0x57803b){logger[_0x46f4('0x69')](util[_0x46f4('0x33')](_0x46f4('0x77'),_0x1dbd26,_0x3f5df4,_0x57803b[_0x46f4('0x78')]));_0x55fe7c['bucket']=_0x57803b[_0x46f4('0x79')];_0x55fe7c[_0x46f4('0x7a')]=_0x57803b[_0x46f4('0x78')];logger[_0x46f4('0x69')](util[_0x46f4('0x33')](_0x46f4('0x7b'),_0x1dbd26));return startTranscribe(_0x176c43,_0x1e9f10,_0x4cf126,uuidv4(),_0x7fb5b3,_0x57803b['Location']);})[_0x46f4('0x28')](function(_0x1aec6a){logger['info'](util[_0x46f4('0x33')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x1dbd26,_0x1aec6a[_0x46f4('0x7c')][_0x46f4('0x7d')]));_0x55fe7c[_0x46f4('0x7e')]=_0x1aec6a['TranscriptionJob'][_0x46f4('0x7d')];_0x55fe7c[_0x46f4('0x7f')]=_0x1aec6a[_0x46f4('0x7c')]['TranscriptionJobStatus'];return _0x5af7d2(_0x55fe7c);})['catch'](function(_0x468725){return _0x132f15(_0x468725);});});}exports[_0x46f4('0x80')]=function(_0x23a25f,_0x2f01cb,_0x3412f0){var _0x3b85f1;var _0x182c27;var _0x38746a;var _0x53cb96=require(_0x46f4('0x53'));return db[_0x46f4('0x45')][_0x46f4('0x81')]({'where':{'id':_0x23a25f[_0x46f4('0x50')]['id']}})[_0x46f4('0x28')](function(_0xc39b75){if(_0xc39b75){var _0x454503=util['format'](_0x46f4('0x55'),_0xc39b75[_0x46f4('0x54')]);if(fs[_0x46f4('0x58')](_0x454503)){cypher=!![];return _0x53cb96['decryptFile'](_0x454503,_0xc39b75[_0x46f4('0x54')],config['secrets'][_0x46f4('0x64')])[_0x46f4('0x28')](function(){return _0xc39b75;});}return _0xc39b75;}})['then'](function(_0x23d230){if(!_0x23d230){throw new db[(_0x46f4('0x65'))][(_0x46f4('0x59'))]('Voice\x20Recording\x20not\x20found');}_0x182c27=_0x23d230;return db[_0x46f4('0x82')][_0x46f4('0x81')]({'where':{'id':0x1}});})[_0x46f4('0x28')](handleEntityNotFound(_0x2f01cb,null))[_0x46f4('0x28')](function(_0x327349){if(_0x327349){_0x3b85f1=_0x327349;if(!_0x3b85f1['transcribe']||!_0x3b85f1[_0x46f4('0x83')]||!_0x3b85f1[_0x46f4('0x84')]||!_0x3b85f1[_0x46f4('0x85')]||!_0x3b85f1[_0x46f4('0x86')]){throw new db['Sequelize'][(_0x46f4('0x59'))](_0x46f4('0x87'));}if(_0x23a25f[_0x46f4('0x4f')][_0x46f4('0x88')]&&(!_0x3b85f1[_0x46f4('0x89')]||!_0x3b85f1['sentimentAccountId']||!_0x3b85f1[_0x46f4('0x8a')]||!_0x3b85f1[_0x46f4('0x85')]||!_0x3b85f1['bucket'])){throw new db[(_0x46f4('0x65'))][(_0x46f4('0x59'))](_0x46f4('0x8b'));}return db[_0x46f4('0x8c')][_0x46f4('0x81')]({'where':{'id':_0x3b85f1[_0x46f4('0x83')]}});}})[_0x46f4('0x28')](function(_0x5d5e68){if(!_0x5d5e68){throw new db[(_0x46f4('0x65'))][(_0x46f4('0x59'))](_0x46f4('0x8d'));}if(!_0x5d5e68['data1']||!_0x5d5e68['data2']){throw new db['Sequelize'][(_0x46f4('0x59'))]('Cloud\x20Provider\x20not\x20configured');}_0x38746a=_0x5d5e68;return getBucketslist(_0x38746a[_0x46f4('0x8e')],_0x38746a['data2'],_0x3b85f1['transcribeRegion']);})[_0x46f4('0x28')](function(_0x5b6145){if(_0x5b6145&&_0x5b6145[_0x46f4('0x8f')]){var _0x1ee583=_[_0x46f4('0x4d')](_0x5b6145[_0x46f4('0x8f')],function(_0x1b92f5){return _0x1b92f5['Name']===_0x3b85f1[_0x46f4('0x86')];});if(!_0x1ee583){logger['info'](util[_0x46f4('0x33')](_0x46f4('0x90'),_0x23a25f[_0x46f4('0x50')]['id'],_0x3b85f1[_0x46f4('0x86')]));return createBucket(_0x38746a['data1'],_0x38746a['data2'],_0x3b85f1[_0x46f4('0x84')],_0x3b85f1[_0x46f4('0x86')]);}logger['info'](util['format'](_0x46f4('0x91'),_0x23a25f[_0x46f4('0x50')]['id'],_0x3b85f1['bucket']));return;}})[_0x46f4('0x28')](function(_0x2d699a){if(_0x182c27['transcribeStatus']===_0x46f4('0x92')){return transcribe(_0x23a25f[_0x46f4('0x50')]['id'],_0x38746a[_0x46f4('0x8e')],_0x38746a[_0x46f4('0x93')],_0x3b85f1[_0x46f4('0x84')],_0x3b85f1[_0x46f4('0x86')],_0x182c27[_0x46f4('0x54')],_0x3b85f1[_0x46f4('0x85')]);}else{logger[_0x46f4('0x69')](util['format'](_0x46f4('0x94'),_0x23a25f[_0x46f4('0x50')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x46f4('0x28')](function(_0x5030b6){if(_0x5030b6){_0x5030b6[_0x46f4('0x95')]=_0x23a25f[_0x46f4('0x4f')][_0x46f4('0x88')];return _0x182c27[_0x46f4('0x96')](_0x5030b6);}})[_0x46f4('0x28')](respondWithResult(_0x2f01cb,null))[_0x46f4('0x49')](handleError(_0x2f01cb,null));};function writeFile(_0x732836,_0x2aa4bc){return new Promise(function(_0x3ae316,_0x2b6106){fs[_0x46f4('0x97')](_0x2aa4bc,_0x732836,function(_0x3bdacd,_0x4db54b){if(_0x3bdacd){return _0x2b6106(_0x3bdacd);}else{return _0x3ae316(_0x4db54b);}});});}exports['downloadTranscribe']=function(_0x392fd9,_0x2fa36e,_0x508e78){return db[_0x46f4('0x45')]['findOne']({'where':{'id':_0x392fd9[_0x46f4('0x50')]['id']}})[_0x46f4('0x28')](handleEntityNotFound(_0x2fa36e))[_0x46f4('0x28')](function(_0x328d9f){if(_0x328d9f&&_0x328d9f[_0x46f4('0x98')]){var _0x378c41=_0x328d9f[_0x46f4('0x98')];var _0x50773d=config[_0x46f4('0x99')]+_0x46f4('0x9a')+_0x328d9f['id']+_0x46f4('0x9b');if(fs[_0x46f4('0x58')](_0x50773d)){return _0x50773d;}return writeFile(_0x378c41,_0x50773d)[_0x46f4('0x28')](function(){return _0x50773d;});}else{throw new db[(_0x46f4('0x65'))][(_0x46f4('0x59'))]('Transcript\x20not\x20available');}})[_0x46f4('0x28')](function(_0x41dd8b){return _0x2fa36e['download'](_0x41dd8b);})['catch'](handleError(_0x2fa36e));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 2b4796b..a022d52 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 _0x25b5=['./voiceRecording.attributes','exports','define','voice_recordings','uniqueid','transcribeStatus'];(function(_0x3fc4b0,_0x2ed873){var _0x3965ef=function(_0x416432){while(--_0x416432){_0x3fc4b0['push'](_0x3fc4b0['shift']());}};_0x3965ef(++_0x2ed873);}(_0x25b5,0x198));var _0x525b=function(_0x3888cd,_0x2df6ca){_0x3888cd=_0x3888cd-0x0;var _0x2403aa=_0x25b5[_0x3888cd];return _0x2403aa;};'use strict';var attributes=require(_0x525b('0x0'));module[_0x525b('0x1')]=function(_0x1c1c9b,_0xe2aec9){return _0x1c1c9b[_0x525b('0x2')]('VoiceRecording',attributes,{'tableName':_0x525b('0x3'),'paranoid':![],'indexes':[{'name':_0x525b('0x4'),'fields':[_0x525b('0x4')]},{'name':_0x525b('0x5'),'fields':[_0x525b('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x21a3=['./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x21a3,0x66));var _0x321a=function(_0x29a707,_0x342505){_0x29a707=_0x29a707-0x0;var _0x229e83=_0x21a3[_0x29a707];return _0x229e83;};'use strict';var attributes=require(_0x321a('0x0'));module['exports']=function(_0x2b85b5,_0x19e537){return _0x2b85b5[_0x321a('0x1')](_0x321a('0x2'),attributes,{'tableName':_0x321a('0x3'),'paranoid':![],'indexes':[{'name':_0x321a('0x4'),'fields':['uniqueid']},{'name':'transcribeStatus','fields':[_0x321a('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 2969876..08b3557 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 _0x5430=['info','request\x20sent','debug','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','UpdateVoiceRecording','VoiceRecording','options','raw','limit','catch','CreateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','create','body','existsSync','format','%s.cypher','value','encryptFile','secrets','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','then'];(function(_0x2ccd0e,_0x26c3a7){var _0x195e1f=function(_0x1fe9b5){while(--_0x1fe9b5){_0x2ccd0e['push'](_0x2ccd0e['shift']());}};_0x195e1f(++_0x26c3a7);}(_0x5430,0x10c));var _0x0543=function(_0x5082e6,_0x6ac8f9){_0x5082e6=_0x5082e6-0x0;var _0x525ef6=_0x5430[_0x5082e6];return _0x525ef6;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var moment=require(_0x0543('0x2'));var BPromise=require(_0x0543('0x3'));var rs=require(_0x0543('0x4'));var fs=require('fs');var Redis=require(_0x0543('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0543('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0543('0x7'));var client=jayson[_0x0543('0x8')][_0x0543('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x319568,_0x46bca7,_0x5ac352){return new BPromise(function(_0x372974,_0x7b8280){return client[_0x0543('0xa')](_0x319568,_0x5ac352)[_0x0543('0xb')](function(_0x2fb723){logger[_0x0543('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'));logger[_0x0543('0xe')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'),JSON[_0x0543('0xf')](_0x2fb723));if(_0x2fb723[_0x0543('0x10')]){if(_0x2fb723[_0x0543('0x10')][_0x0543('0x11')]===0x1f4){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x7b8280(_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);}logger[_0x0543('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x372974(_0x2fb723['error']['message']);}else{logger[_0x0543('0xc')](_0x0543('0x12'),_0x46bca7,_0x0543('0xd'));_0x372974(_0x2fb723[_0x0543('0x14')][_0x0543('0x13')]);}})['catch'](function(_0xe69a3d){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0xe69a3d);_0x7b8280(_0xe69a3d);});});}exports[_0x0543('0x15')]=function(_0x20b396){var _0x285080=this;return new Promise(function(_0x577cf0,_0x5eb03e){return db[_0x0543('0x16')]['update'](_0x20b396['body'],{'raw':_0x20b396[_0x0543('0x17')]?_0x20b396[_0x0543('0x17')][_0x0543('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20b396['options']?_0x20b396[_0x0543('0x17')]['where']||null:null,'attributes':_0x20b396[_0x0543('0x17')]?_0x20b396[_0x0543('0x17')]['attributes']||null:null,'limit':_0x20b396[_0x0543('0x17')]?_0x20b396[_0x0543('0x17')][_0x0543('0x19')]||null:null})[_0x0543('0xb')](function(_0x37347e){logger[_0x0543('0xc')]('UpdateVoiceRecording',_0x20b396);logger['debug']('UpdateVoiceRecording',_0x20b396,JSON[_0x0543('0xf')](_0x37347e));_0x577cf0(_0x37347e);})[_0x0543('0x1a')](function(_0x15ebeb){logger[_0x0543('0x10')](_0x0543('0x15'),_0x15ebeb[_0x0543('0x13')],_0x20b396);_0x5eb03e(_0x285080[_0x0543('0x10')](0x1f4,_0x15ebeb[_0x0543('0x13')]));});});};exports[_0x0543('0x1b')]=function(_0xf1eccf){var _0x40a261=this;return new Promise(function(_0x21fc63,_0x547a88){var _0x25e6f1=require(_0x0543('0x1c'));var _0x30ad9e;return db['Setting'][_0x0543('0x1d')]({'attributes':['id',_0x0543('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0543('0xb')](function(_0x10b881){_0x30ad9e=_0x10b881;return db['VoiceRecording'][_0x0543('0x1f')](_0xf1eccf[_0x0543('0x20')]);})['then'](function(_0x576084){if(_0x30ad9e[_0x0543('0x1e')]&&fs[_0x0543('0x21')](_0x576084['value'])){var _0x3b879b=util[_0x0543('0x22')](_0x0543('0x23'),_0x576084[_0x0543('0x24')]);return _0x25e6f1[_0x0543('0x25')](_0x576084[_0x0543('0x24')],_0x3b879b,config[_0x0543('0x26')]['recording'])[_0x0543('0xb')](function(){fs['unlink'](_0x576084[_0x0543('0x24')]);logger[_0x0543('0xc')](_0x0543('0x27'));return _0x576084;});}return _0x576084;})[_0x0543('0xb')](function(_0x28307f){logger['info'](_0x0543('0x1b'),_0xf1eccf);logger['debug'](_0x0543('0x1b'),_0xf1eccf,JSON[_0x0543('0xf')](_0x28307f));_0x21fc63(_0x28307f);})[_0x0543('0x1a')](function(_0x327027){logger['error'](_0x0543('0x1b'),_0x327027['message'],_0xf1eccf);_0x547a88(_0x40a261[_0x0543('0x10')](0x1f4,_0x327027[_0x0543('0x13')]));});});}; \ No newline at end of file +var _0x1893=['http','request','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','then','existsSync','value','format','%s.cypher','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x496a49,_0x5430cd){var _0x3f7705=function(_0x13a9cb){while(--_0x13a9cb){_0x496a49['push'](_0x496a49['shift']());}};_0x3f7705(++_0x5430cd);}(_0x1893,0xa2));var _0x3189=function(_0x2c2954,_0x3cadf4){_0x2c2954=_0x2c2954-0x0;var _0x1e834e=_0x1893[_0x2c2954];return _0x1e834e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3189('0x0'));var BPromise=require(_0x3189('0x1'));var rs=require(_0x3189('0x2'));var fs=require('fs');var Redis=require(_0x3189('0x3'));var db=require(_0x3189('0x4'))['db'];var utils=require(_0x3189('0x5'));var logger=require(_0x3189('0x6'))('rpc');var config=require(_0x3189('0x7'));var jayson=require(_0x3189('0x8'));var client=jayson[_0x3189('0x9')][_0x3189('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x77c566,_0x118970,_0x14d84b){return new BPromise(function(_0x1f6764,_0x5312a3){return client[_0x3189('0xb')](_0x77c566,_0x14d84b)['then'](function(_0x127449){logger['info'](_0x3189('0xc'),_0x118970,_0x3189('0xd'));logger[_0x3189('0xe')](_0x3189('0xf'),_0x118970,'request\x20sent',JSON[_0x3189('0x10')](_0x127449));if(_0x127449[_0x3189('0x11')]){if(_0x127449[_0x3189('0x11')][_0x3189('0x12')]===0x1f4){logger[_0x3189('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x118970,_0x127449[_0x3189('0x11')][_0x3189('0x13')]);return _0x5312a3(_0x127449[_0x3189('0x11')][_0x3189('0x13')]);}logger[_0x3189('0x11')](_0x3189('0xc'),_0x118970,_0x127449[_0x3189('0x11')][_0x3189('0x13')]);return _0x1f6764(_0x127449['error'][_0x3189('0x13')]);}else{logger[_0x3189('0x14')](_0x3189('0xc'),_0x118970,_0x3189('0xd'));_0x1f6764(_0x127449['result'][_0x3189('0x13')]);}})['catch'](function(_0x55f432){logger[_0x3189('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x118970,_0x55f432);_0x5312a3(_0x55f432);});});}exports[_0x3189('0x15')]=function(_0xf8aed7){var _0x22c7ba=this;return new Promise(function(_0x9905c4,_0x4c4d9b){return db[_0x3189('0x16')][_0x3189('0x17')](_0xf8aed7[_0x3189('0x18')],{'raw':_0xf8aed7['options']?_0xf8aed7[_0x3189('0x19')][_0x3189('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf8aed7[_0x3189('0x19')]?_0xf8aed7[_0x3189('0x19')][_0x3189('0x1b')]||null:null,'attributes':_0xf8aed7['options']?_0xf8aed7[_0x3189('0x19')][_0x3189('0x1c')]||null:null,'limit':_0xf8aed7[_0x3189('0x19')]?_0xf8aed7['options'][_0x3189('0x1d')]||null:null})['then'](function(_0x4bfc03){logger[_0x3189('0x14')](_0x3189('0x15'),_0xf8aed7);logger[_0x3189('0xe')](_0x3189('0x15'),_0xf8aed7,JSON[_0x3189('0x10')](_0x4bfc03));_0x9905c4(_0x4bfc03);})['catch'](function(_0x4b03ad){logger[_0x3189('0x11')](_0x3189('0x15'),_0x4b03ad[_0x3189('0x13')],_0xf8aed7);_0x4c4d9b(_0x22c7ba[_0x3189('0x11')](0x1f4,_0x4b03ad[_0x3189('0x13')]));});});};exports[_0x3189('0x1e')]=function(_0xdda38b){var _0x379a48=this;return new Promise(function(_0x17b540,_0x5ec0ac){var _0x5ce5f5=require('../../components/encryptor');var _0x5aa34a;return db[_0x3189('0x1f')][_0x3189('0x20')]({'attributes':['id',_0x3189('0x21')],'where':{'id':0x1},'raw':!![]})[_0x3189('0x22')](function(_0x36b258){_0x5aa34a=_0x36b258;return db[_0x3189('0x16')]['create'](_0xdda38b[_0x3189('0x18')]);})[_0x3189('0x22')](function(_0x4bd677){if(_0x5aa34a[_0x3189('0x21')]&&fs[_0x3189('0x23')](_0x4bd677[_0x3189('0x24')])){var _0x5c7a36=util[_0x3189('0x25')](_0x3189('0x26'),_0x4bd677[_0x3189('0x24')]);return _0x5ce5f5['encryptFile'](_0x4bd677[_0x3189('0x24')],_0x5c7a36,config[_0x3189('0x27')]['recording'])[_0x3189('0x22')](function(){fs[_0x3189('0x28')](_0x4bd677[_0x3189('0x24')]);logger[_0x3189('0x14')](_0x3189('0x29'));return _0x4bd677;});}return _0x4bd677;})['then'](function(_0x544c49){logger[_0x3189('0x14')]('CreateVoiceRecording',_0xdda38b);logger[_0x3189('0xe')](_0x3189('0x1e'),_0xdda38b,JSON[_0x3189('0x10')](_0x544c49));_0x17b540(_0x544c49);})[_0x3189('0x2a')](function(_0x231d72){logger[_0x3189('0x11')](_0x3189('0x1e'),_0x231d72[_0x3189('0x13')],_0xdda38b);_0x5ec0ac(_0x379a48[_0x3189('0x11')](0x1f4,_0x231d72['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 1ebaff5..eba34e5 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 _0x5174=['post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x232719,_0x435255){var _0x23deea=function(_0xb04c87){while(--_0xb04c87){_0x232719['push'](_0x232719['shift']());}};_0x23deea(++_0x435255);}(_0x5174,0x18e));var _0x4517=function(_0x4c35e9,_0x375f56){_0x4c35e9=_0x4c35e9-0x0;var _0x541b52=_0x5174[_0x4c35e9];return _0x541b52;};'use strict';var multer=require(_0x4517('0x0'));var util=require(_0x4517('0x1'));var path=require(_0x4517('0x2'));var timeout=require('connect-timeout');var express=require(_0x4517('0x3'));var router=express[_0x4517('0x4')]();var fs_extra=require(_0x4517('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4517('0x6'));var config=require(_0x4517('0x7'));var controller=require(_0x4517('0x8'));router[_0x4517('0x9')]('/',auth[_0x4517('0xa')](),controller[_0x4517('0xb')]);router[_0x4517('0x9')](_0x4517('0xc'),auth[_0x4517('0xa')](),controller[_0x4517('0xd')]);router[_0x4517('0x9')](_0x4517('0xe'),auth[_0x4517('0xa')](),controller[_0x4517('0xf')]);router[_0x4517('0x10')]('/',auth[_0x4517('0xa')](),controller[_0x4517('0x11')]);router[_0x4517('0x12')]('/:id',auth[_0x4517('0xa')](),controller[_0x4517('0x13')]);router[_0x4517('0x14')]('/:id',auth[_0x4517('0xa')](),controller[_0x4517('0x15')]);module[_0x4517('0x16')]=router; \ No newline at end of file +var _0x4005=['/:id','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4005,0x1da));var _0x5400=function(_0x3fe26d,_0x331cc9){_0x3fe26d=_0x3fe26d-0x0;var _0x27eddd=_0x4005[_0x3fe26d];return _0x27eddd;};'use strict';var multer=require(_0x5400('0x0'));var util=require(_0x5400('0x1'));var path=require(_0x5400('0x2'));var timeout=require(_0x5400('0x3'));var express=require(_0x5400('0x4'));var router=express[_0x5400('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5400('0x6'));var config=require('../../config/environment');var controller=require(_0x5400('0x7'));router[_0x5400('0x8')]('/',auth[_0x5400('0x9')](),controller[_0x5400('0xa')]);router[_0x5400('0x8')](_0x5400('0xb'),auth[_0x5400('0x9')](),controller['describe']);router['get'](_0x5400('0xc'),auth[_0x5400('0x9')](),controller['show']);router[_0x5400('0xd')]('/',auth[_0x5400('0x9')](),controller[_0x5400('0xe')]);router[_0x5400('0xf')]('/:id',auth[_0x5400('0x9')](),controller['update']);router[_0x5400('0x10')](_0x5400('0xc'),auth['isAuthenticated'](),controller[_0x5400('0x11')]);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 606ba9e..80b1d84 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 _0x2651=['STRING','Yes','moment','exports','ENUM','attended'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x2651,0xce));var _0x1265=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x2651[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1265('0x0'));module[_0x1265('0x1')]={'type':{'type':Sequelize[_0x1265('0x2')]('blind',_0x1265('0x3'))},'result':{'type':Sequelize[_0x1265('0x4')]},'transfererchannel':{'type':Sequelize[_0x1265('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x1265('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x1265('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x1265('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x1265('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x1265('0x4')]},'transfereechannel':{'type':Sequelize[_0x1265('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x1265('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x1265('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1265('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1265('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x1265('0x4')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x1265('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x1265('0x4')]},'isexternal':{'type':Sequelize[_0x1265('0x2')](_0x1265('0x5'),'No')},'context':{'type':Sequelize[_0x1265('0x4')]},'extension':{'type':Sequelize[_0x1265('0x4')]}}; \ No newline at end of file +var _0x979d=['ENUM','blind','attended','STRING','moment','exports'];(function(_0x10c51f,_0x11270f){var _0x56a0cd=function(_0x563ac6){while(--_0x563ac6){_0x10c51f['push'](_0x10c51f['shift']());}};_0x56a0cd(++_0x11270f);}(_0x979d,0x7c));var _0xd979=function(_0x477b50,_0x2dea04){_0x477b50=_0x477b50-0x0;var _0x2f7d9d=_0x979d[_0x477b50];return _0x2f7d9d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd979('0x0'));module[_0xd979('0x1')]={'type':{'type':Sequelize[_0xd979('0x2')](_0xd979('0x3'),_0xd979('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xd979('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xd979('0x5')]},'transferercalleridname':{'type':Sequelize[_0xd979('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xd979('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xd979('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xd979('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xd979('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xd979('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xd979('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xd979('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xd979('0x5')]},'transfereecontext':{'type':Sequelize[_0xd979('0x5')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xd979('0x2')]('Yes','No')},'context':{'type':Sequelize[_0xd979('0x5')]},'extension':{'type':Sequelize[_0xd979('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 708aeac..e0ae43a 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 _0xc1e4=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','VoiceTransferReport','rawAttributes','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5baa25,_0x1cab73){var _0x4b72f0=function(_0x417de9){while(--_0x417de9){_0x5baa25['push'](_0x5baa25['shift']());}};_0x4b72f0(++_0x1cab73);}(_0xc1e4,0xc6));var _0x4c1e=function(_0x5760fe,_0x354834){_0x5760fe=_0x5760fe-0x0;var _0x386175=_0xc1e4[_0x5760fe];return _0x386175;};'use strict';var emlformat=require(_0x4c1e('0x0'));var rimraf=require(_0x4c1e('0x1'));var zipdir=require(_0x4c1e('0x2'));var jsonpatch=require(_0x4c1e('0x3'));var rp=require(_0x4c1e('0x4'));var moment=require(_0x4c1e('0x5'));var BPromise=require(_0x4c1e('0x6'));var Mustache=require(_0x4c1e('0x7'));var util=require('util');var path=require(_0x4c1e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4c1e('0x9'));var fs=require('fs');var fs_extra=require(_0x4c1e('0xa'));var _=require(_0x4c1e('0xb'));var squel=require(_0x4c1e('0xc'));var crypto=require(_0x4c1e('0xd'));var jsforce=require(_0x4c1e('0xe'));var deskjs=require(_0x4c1e('0xf'));var toCsv=require(_0x4c1e('0x10'));var querystring=require('querystring');var Papa=require(_0x4c1e('0x11'));var Redis=require('ioredis');var authService=require(_0x4c1e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4c1e('0x13'));var hardwareService=require(_0x4c1e('0x14'));var logger=require(_0x4c1e('0x15'))('api');var utils=require(_0x4c1e('0x16'));var config=require(_0x4c1e('0x17'));var licenseUtil=require(_0x4c1e('0x18'));var db=require(_0x4c1e('0x19'))['db'];function respondWithStatusCode(_0x5205f4,_0x1f0145){_0x1f0145=_0x1f0145||0xcc;return function(_0x49e4df){if(_0x49e4df){return _0x5205f4[_0x4c1e('0x1a')](_0x1f0145);}return _0x5205f4[_0x4c1e('0x1b')](_0x1f0145)[_0x4c1e('0x1c')]();};}function respondWithResult(_0x21b412,_0x16c9b9){_0x16c9b9=_0x16c9b9||0xc8;return function(_0x24e260){if(_0x24e260){return _0x21b412[_0x4c1e('0x1b')](_0x16c9b9)['json'](_0x24e260);}};}function respondWithFilteredResult(_0x5e3fba,_0x3a9f07){return function(_0x3aad80){if(_0x3aad80){var _0x4182da=typeof _0x3a9f07[_0x4c1e('0x1d')]===_0x4c1e('0x1e')&&typeof _0x3a9f07[_0x4c1e('0x1f')]===_0x4c1e('0x1e');var _0x1212f3=_0x3aad80[_0x4c1e('0x20')];var _0xefb989=_0x4182da?0x0:_0x3a9f07[_0x4c1e('0x1d')];var _0x4ceab9=_0x4182da?_0x3aad80['count']:_0x3a9f07[_0x4c1e('0x1d')]+_0x3a9f07[_0x4c1e('0x1f')];var _0x166cf6;if(_0x4ceab9>=_0x1212f3){_0x4ceab9=_0x1212f3;_0x166cf6=0xc8;}else{_0x166cf6=0xce;}_0x5e3fba[_0x4c1e('0x1b')](_0x166cf6);return _0x5e3fba['set'](_0x4c1e('0x21'),_0xefb989+'-'+_0x4ceab9+'/'+_0x1212f3)['json'](_0x3aad80);}return null;};}function patchUpdates(_0x3b01ee){return function(_0x264352){try{jsonpatch[_0x4c1e('0x22')](_0x264352,_0x3b01ee,!![]);}catch(_0x1583d8){return BPromise[_0x4c1e('0x23')](_0x1583d8);}return _0x264352[_0x4c1e('0x24')]();};}function saveUpdates(_0x514989,_0x45ab18){return function(_0x3e223a){if(_0x3e223a){return _0x3e223a[_0x4c1e('0x25')](_0x514989)[_0x4c1e('0x26')](function(_0x35c653){return _0x35c653;});}return null;};}function removeEntity(_0x186180,_0x292464){return function(_0x4dfdea){if(_0x4dfdea){return _0x4dfdea[_0x4c1e('0x27')]()['then'](function(){_0x186180[_0x4c1e('0x1b')](0xcc)[_0x4c1e('0x1c')]();});}};}function handleEntityNotFound(_0x4f7e8b,_0x141517){return function(_0xbb1983){if(!_0xbb1983){_0x4f7e8b[_0x4c1e('0x1a')](0x194);}return _0xbb1983;};}function handleError(_0x3157cc,_0x423638){_0x423638=_0x423638||0x1f4;return function(_0xb88c1b){logger['error'](_0xb88c1b[_0x4c1e('0x28')]);if(_0xb88c1b['name']){delete _0xb88c1b[_0x4c1e('0x29')];}_0x3157cc['status'](_0x423638)['send'](_0xb88c1b);};}exports[_0x4c1e('0x2a')]=function(_0x3692fc,_0x404805){var _0x3b7b96={},_0x594d08={},_0xfbb37a={'count':0x0,'rows':[]};var _0x98fe2c=_['map'](db[_0x4c1e('0x2b')][_0x4c1e('0x2c')],function(_0x593aef){return{'name':_0x593aef['fieldName'],'type':_0x593aef[_0x4c1e('0x2d')][_0x4c1e('0x2e')]};});_0x594d08[_0x4c1e('0x2f')]=_[_0x4c1e('0x30')](_0x98fe2c,'name');_0x594d08['query']=_[_0x4c1e('0x31')](_0x3692fc['query']);_0x594d08[_0x4c1e('0x32')]=_[_0x4c1e('0x33')](_0x594d08[_0x4c1e('0x2f')],_0x594d08[_0x4c1e('0x34')]);_0x3b7b96[_0x4c1e('0x35')]=_[_0x4c1e('0x33')](_0x594d08[_0x4c1e('0x2f')],qs[_0x4c1e('0x36')](_0x3692fc[_0x4c1e('0x34')]['fields']));_0x3b7b96[_0x4c1e('0x35')]=_0x3b7b96[_0x4c1e('0x35')][_0x4c1e('0x37')]?_0x3b7b96[_0x4c1e('0x35')]:_0x594d08['model'];if(!_0x3692fc[_0x4c1e('0x34')][_0x4c1e('0x38')]('nolimit')){_0x3b7b96[_0x4c1e('0x1f')]=qs['limit'](_0x3692fc[_0x4c1e('0x34')][_0x4c1e('0x1f')]);_0x3b7b96[_0x4c1e('0x1d')]=qs[_0x4c1e('0x1d')](_0x3692fc[_0x4c1e('0x34')][_0x4c1e('0x1d')]);}_0x3b7b96['order']=qs[_0x4c1e('0x39')](_0x3692fc[_0x4c1e('0x34')]['sort']);_0x3b7b96['where']=qs[_0x4c1e('0x32')](_[_0x4c1e('0x3a')](_0x3692fc[_0x4c1e('0x34')],_0x594d08[_0x4c1e('0x32')]),_0x98fe2c);if(_0x3692fc[_0x4c1e('0x34')][_0x4c1e('0x3b')]){_0x3b7b96['where']=_['merge'](_0x3b7b96[_0x4c1e('0x3c')],{'$or':_['map'](_0x98fe2c,function(_0x44b7b8){if(_0x44b7b8[_0x4c1e('0x2d')]!==_0x4c1e('0x3d')){var _0x4fc34e={};_0x4fc34e[_0x44b7b8[_0x4c1e('0x29')]]={'$like':'%'+_0x3692fc['query'][_0x4c1e('0x3b')]+'%'};return _0x4fc34e;}})});}_0x3b7b96=_[_0x4c1e('0x3e')]({},_0x3b7b96,_0x3692fc[_0x4c1e('0x3f')]);var _0x7a26d6={'where':_0x3b7b96[_0x4c1e('0x3c')]};return db['VoiceTransferReport'][_0x4c1e('0x20')](_0x7a26d6)[_0x4c1e('0x26')](function(_0x1b953b){_0xfbb37a[_0x4c1e('0x20')]=_0x1b953b;if(_0x3692fc[_0x4c1e('0x34')][_0x4c1e('0x40')]){_0x3b7b96[_0x4c1e('0x41')]=[{'all':!![]}];}return db[_0x4c1e('0x2b')][_0x4c1e('0x42')](_0x3b7b96);})[_0x4c1e('0x26')](function(_0x2ff8c6){_0xfbb37a['rows']=_0x2ff8c6;return _0xfbb37a;})['then'](respondWithFilteredResult(_0x404805,_0x3b7b96))[_0x4c1e('0x43')](handleError(_0x404805,null));};exports['show']=function(_0x48685e,_0x38de70){var _0x3b02c4={'raw':!![],'where':{'id':_0x48685e[_0x4c1e('0x44')]['id']}},_0x1a9d25={};_0x1a9d25['model']=_[_0x4c1e('0x31')](db[_0x4c1e('0x2b')][_0x4c1e('0x2c')]);_0x1a9d25['query']=_[_0x4c1e('0x31')](_0x48685e[_0x4c1e('0x34')]);_0x1a9d25[_0x4c1e('0x32')]=_[_0x4c1e('0x33')](_0x1a9d25[_0x4c1e('0x2f')],_0x1a9d25[_0x4c1e('0x34')]);_0x3b02c4[_0x4c1e('0x35')]=_[_0x4c1e('0x33')](_0x1a9d25[_0x4c1e('0x2f')],qs[_0x4c1e('0x36')](_0x48685e[_0x4c1e('0x34')]['fields']));_0x3b02c4[_0x4c1e('0x35')]=_0x3b02c4[_0x4c1e('0x35')][_0x4c1e('0x37')]?_0x3b02c4['attributes']:_0x1a9d25['model'];if(_0x48685e[_0x4c1e('0x34')][_0x4c1e('0x40')]){_0x3b02c4[_0x4c1e('0x41')]=[{'all':!![]}];}_0x3b02c4=_[_0x4c1e('0x3e')]({},_0x3b02c4,_0x48685e[_0x4c1e('0x3f')]);return db[_0x4c1e('0x2b')][_0x4c1e('0x45')](_0x3b02c4)[_0x4c1e('0x26')](handleEntityNotFound(_0x38de70,null))[_0x4c1e('0x26')](respondWithResult(_0x38de70,null))['catch'](handleError(_0x38de70,null));};exports[_0x4c1e('0x46')]=function(_0x3b3263,_0x1cf4bd){return db[_0x4c1e('0x2b')][_0x4c1e('0x46')](_0x3b3263['body'],{})[_0x4c1e('0x26')](respondWithResult(_0x1cf4bd,0xc9))[_0x4c1e('0x43')](handleError(_0x1cf4bd,null));};exports[_0x4c1e('0x25')]=function(_0x1583a9,_0x510869){if(_0x1583a9[_0x4c1e('0x47')]['id']){delete _0x1583a9[_0x4c1e('0x47')]['id'];}return db[_0x4c1e('0x2b')][_0x4c1e('0x45')]({'where':{'id':_0x1583a9[_0x4c1e('0x44')]['id']}})[_0x4c1e('0x26')](handleEntityNotFound(_0x510869,null))[_0x4c1e('0x26')](saveUpdates(_0x1583a9[_0x4c1e('0x47')],null))[_0x4c1e('0x26')](respondWithResult(_0x510869,null))[_0x4c1e('0x43')](handleError(_0x510869,null));};exports[_0x4c1e('0x27')]=function(_0x1be15d,_0x3e2320){return db[_0x4c1e('0x2b')][_0x4c1e('0x45')]({'where':{'id':_0x1be15d[_0x4c1e('0x44')]['id']}})[_0x4c1e('0x26')](handleEntityNotFound(_0x3e2320,null))[_0x4c1e('0x26')](removeEntity(_0x3e2320,null))[_0x4c1e('0x43')](handleError(_0x3e2320,null));};exports['describe']=function(_0x3f825d,_0x5659d8){return db[_0x4c1e('0x2b')][_0x4c1e('0x48')]()[_0x4c1e('0x26')](respondWithResult(_0x5659d8,null))['catch'](handleError(_0x5659d8,null));}; \ No newline at end of file +var _0x3b0e=['count','set','apply','save','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','VoiceTransferReport','create','update','body','find','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x3b0e,0x1db));var _0xe3b0=function(_0x254877,_0x539228){_0x254877=_0x254877-0x0;var _0x3f7da9=_0x3b0e[_0x254877];return _0x3f7da9;};'use strict';var emlformat=require(_0xe3b0('0x0'));var rimraf=require(_0xe3b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe3b0('0x2'));var rp=require('request-promise');var moment=require(_0xe3b0('0x3'));var BPromise=require(_0xe3b0('0x4'));var Mustache=require('mustache');var util=require(_0xe3b0('0x5'));var path=require(_0xe3b0('0x6'));var sox=require(_0xe3b0('0x7'));var csv=require('to-csv');var ejs=require(_0xe3b0('0x8'));var fs=require('fs');var fs_extra=require(_0xe3b0('0x9'));var _=require(_0xe3b0('0xa'));var squel=require(_0xe3b0('0xb'));var crypto=require(_0xe3b0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe3b0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe3b0('0xe'));var Redis=require('ioredis');var authService=require(_0xe3b0('0xf'));var qs=require(_0xe3b0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe3b0('0x11'))(_0xe3b0('0x12'));var utils=require(_0xe3b0('0x13'));var config=require(_0xe3b0('0x14'));var licenseUtil=require(_0xe3b0('0x15'));var db=require(_0xe3b0('0x16'))['db'];function respondWithStatusCode(_0x37cc36,_0x783689){_0x783689=_0x783689||0xcc;return function(_0x3b71af){if(_0x3b71af){return _0x37cc36[_0xe3b0('0x17')](_0x783689);}return _0x37cc36[_0xe3b0('0x18')](_0x783689)['end']();};}function respondWithResult(_0x29b750,_0x2419fe){_0x2419fe=_0x2419fe||0xc8;return function(_0x550bd7){if(_0x550bd7){return _0x29b750[_0xe3b0('0x18')](_0x2419fe)[_0xe3b0('0x19')](_0x550bd7);}};}function respondWithFilteredResult(_0x3a6401,_0x3039c8){return function(_0x2dce0a){if(_0x2dce0a){var _0x618d06=typeof _0x3039c8[_0xe3b0('0x1a')]===_0xe3b0('0x1b')&&typeof _0x3039c8[_0xe3b0('0x1c')]===_0xe3b0('0x1b');var _0x32fa8e=_0x2dce0a['count'];var _0x5f075a=_0x618d06?0x0:_0x3039c8[_0xe3b0('0x1a')];var _0x205975=_0x618d06?_0x2dce0a[_0xe3b0('0x1d')]:_0x3039c8[_0xe3b0('0x1a')]+_0x3039c8[_0xe3b0('0x1c')];var _0x51847e;if(_0x205975>=_0x32fa8e){_0x205975=_0x32fa8e;_0x51847e=0xc8;}else{_0x51847e=0xce;}_0x3a6401[_0xe3b0('0x18')](_0x51847e);return _0x3a6401[_0xe3b0('0x1e')]('Content-Range',_0x5f075a+'-'+_0x205975+'/'+_0x32fa8e)[_0xe3b0('0x19')](_0x2dce0a);}return null;};}function patchUpdates(_0x573d59){return function(_0x10b1fd){try{jsonpatch[_0xe3b0('0x1f')](_0x10b1fd,_0x573d59,!![]);}catch(_0x27ef54){return BPromise['reject'](_0x27ef54);}return _0x10b1fd[_0xe3b0('0x20')]();};}function saveUpdates(_0x253c50,_0x10a523){return function(_0x47a9ea){if(_0x47a9ea){return _0x47a9ea['update'](_0x253c50)['then'](function(_0x16c3fe){return _0x16c3fe;});}return null;};}function removeEntity(_0x41d61c,_0x3a29b8){return function(_0x24ef7e){if(_0x24ef7e){return _0x24ef7e[_0xe3b0('0x21')]()[_0xe3b0('0x22')](function(){_0x41d61c[_0xe3b0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44f473,_0x28f957){return function(_0x4459db){if(!_0x4459db){_0x44f473[_0xe3b0('0x17')](0x194);}return _0x4459db;};}function handleError(_0xf66062,_0x3ea971){_0x3ea971=_0x3ea971||0x1f4;return function(_0x4a1179){logger[_0xe3b0('0x23')](_0x4a1179[_0xe3b0('0x24')]);if(_0x4a1179[_0xe3b0('0x25')]){delete _0x4a1179[_0xe3b0('0x25')];}_0xf66062[_0xe3b0('0x18')](_0x3ea971)[_0xe3b0('0x26')](_0x4a1179);};}exports['index']=function(_0x5e34ed,_0x2106d3){var _0x4484c3={},_0x2868fe={},_0x4f483e={'count':0x0,'rows':[]};var _0x119fb2=_[_0xe3b0('0x27')](db['VoiceTransferReport'][_0xe3b0('0x28')],function(_0x3e5580){return{'name':_0x3e5580[_0xe3b0('0x29')],'type':_0x3e5580[_0xe3b0('0x2a')][_0xe3b0('0x2b')]};});_0x2868fe[_0xe3b0('0x2c')]=_[_0xe3b0('0x27')](_0x119fb2,_0xe3b0('0x25'));_0x2868fe[_0xe3b0('0x2d')]=_[_0xe3b0('0x2e')](_0x5e34ed[_0xe3b0('0x2d')]);_0x2868fe['filters']=_[_0xe3b0('0x2f')](_0x2868fe[_0xe3b0('0x2c')],_0x2868fe[_0xe3b0('0x2d')]);_0x4484c3[_0xe3b0('0x30')]=_['intersection'](_0x2868fe['model'],qs[_0xe3b0('0x31')](_0x5e34ed[_0xe3b0('0x2d')][_0xe3b0('0x31')]));_0x4484c3[_0xe3b0('0x30')]=_0x4484c3[_0xe3b0('0x30')][_0xe3b0('0x32')]?_0x4484c3[_0xe3b0('0x30')]:_0x2868fe[_0xe3b0('0x2c')];if(!_0x5e34ed[_0xe3b0('0x2d')]['hasOwnProperty'](_0xe3b0('0x33'))){_0x4484c3[_0xe3b0('0x1c')]=qs[_0xe3b0('0x1c')](_0x5e34ed[_0xe3b0('0x2d')]['limit']);_0x4484c3[_0xe3b0('0x1a')]=qs[_0xe3b0('0x1a')](_0x5e34ed[_0xe3b0('0x2d')][_0xe3b0('0x1a')]);}_0x4484c3[_0xe3b0('0x34')]=qs[_0xe3b0('0x35')](_0x5e34ed['query'][_0xe3b0('0x35')]);_0x4484c3[_0xe3b0('0x36')]=qs['filters'](_['pick'](_0x5e34ed[_0xe3b0('0x2d')],_0x2868fe[_0xe3b0('0x37')]),_0x119fb2);if(_0x5e34ed[_0xe3b0('0x2d')]['filter']){_0x4484c3['where']=_[_0xe3b0('0x38')](_0x4484c3[_0xe3b0('0x36')],{'$or':_['map'](_0x119fb2,function(_0x16ad58){if(_0x16ad58[_0xe3b0('0x2a')]!==_0xe3b0('0x39')){var _0x3571a2={};_0x3571a2[_0x16ad58[_0xe3b0('0x25')]]={'$like':'%'+_0x5e34ed[_0xe3b0('0x2d')][_0xe3b0('0x3a')]+'%'};return _0x3571a2;}})});}_0x4484c3=_[_0xe3b0('0x38')]({},_0x4484c3,_0x5e34ed[_0xe3b0('0x3b')]);var _0x576a18={'where':_0x4484c3[_0xe3b0('0x36')]};return db['VoiceTransferReport']['count'](_0x576a18)['then'](function(_0x40145f){_0x4f483e[_0xe3b0('0x1d')]=_0x40145f;if(_0x5e34ed[_0xe3b0('0x2d')][_0xe3b0('0x3c')]){_0x4484c3[_0xe3b0('0x3d')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xe3b0('0x3e')](_0x4484c3);})[_0xe3b0('0x22')](function(_0x254efd){_0x4f483e['rows']=_0x254efd;return _0x4f483e;})['then'](respondWithFilteredResult(_0x2106d3,_0x4484c3))[_0xe3b0('0x3f')](handleError(_0x2106d3,null));};exports[_0xe3b0('0x40')]=function(_0x2d6411,_0x5820d2){var _0x2a24e3={'raw':!![],'where':{'id':_0x2d6411[_0xe3b0('0x41')]['id']}},_0x2c8c52={};_0x2c8c52[_0xe3b0('0x2c')]=_[_0xe3b0('0x2e')](db[_0xe3b0('0x42')][_0xe3b0('0x28')]);_0x2c8c52[_0xe3b0('0x2d')]=_[_0xe3b0('0x2e')](_0x2d6411[_0xe3b0('0x2d')]);_0x2c8c52[_0xe3b0('0x37')]=_[_0xe3b0('0x2f')](_0x2c8c52[_0xe3b0('0x2c')],_0x2c8c52[_0xe3b0('0x2d')]);_0x2a24e3['attributes']=_[_0xe3b0('0x2f')](_0x2c8c52[_0xe3b0('0x2c')],qs[_0xe3b0('0x31')](_0x2d6411[_0xe3b0('0x2d')]['fields']));_0x2a24e3[_0xe3b0('0x30')]=_0x2a24e3['attributes'][_0xe3b0('0x32')]?_0x2a24e3[_0xe3b0('0x30')]:_0x2c8c52[_0xe3b0('0x2c')];if(_0x2d6411[_0xe3b0('0x2d')][_0xe3b0('0x3c')]){_0x2a24e3['include']=[{'all':!![]}];}_0x2a24e3=_['merge']({},_0x2a24e3,_0x2d6411[_0xe3b0('0x3b')]);return db[_0xe3b0('0x42')]['find'](_0x2a24e3)[_0xe3b0('0x22')](handleEntityNotFound(_0x5820d2,null))[_0xe3b0('0x22')](respondWithResult(_0x5820d2,null))['catch'](handleError(_0x5820d2,null));};exports[_0xe3b0('0x43')]=function(_0x8812c6,_0x45bf2b){return db[_0xe3b0('0x42')][_0xe3b0('0x43')](_0x8812c6['body'],{})[_0xe3b0('0x22')](respondWithResult(_0x45bf2b,0xc9))['catch'](handleError(_0x45bf2b,null));};exports[_0xe3b0('0x44')]=function(_0x5d295d,_0x264a4d){if(_0x5d295d[_0xe3b0('0x45')]['id']){delete _0x5d295d[_0xe3b0('0x45')]['id'];}return db['VoiceTransferReport'][_0xe3b0('0x46')]({'where':{'id':_0x5d295d['params']['id']}})['then'](handleEntityNotFound(_0x264a4d,null))['then'](saveUpdates(_0x5d295d[_0xe3b0('0x45')],null))[_0xe3b0('0x22')](respondWithResult(_0x264a4d,null))[_0xe3b0('0x3f')](handleError(_0x264a4d,null));};exports[_0xe3b0('0x21')]=function(_0x53b789,_0x31ea23){return db['VoiceTransferReport']['find']({'where':{'id':_0x53b789[_0xe3b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x31ea23,null))[_0xe3b0('0x22')](removeEntity(_0x31ea23,null))[_0xe3b0('0x3f')](handleError(_0x31ea23,null));};exports[_0xe3b0('0x47')]=function(_0x428e55,_0x3a9a6f){return db[_0xe3b0('0x42')][_0xe3b0('0x47')]()[_0xe3b0('0x22')](respondWithResult(_0x3a9a6f,null))[_0xe3b0('0x3f')](handleError(_0x3a9a6f,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 0728756..30dfb2f 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 _0xbf55=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceTransferReport','util','../../config/logger'];(function(_0x495eea,_0x4d9b23){var _0x2c4962=function(_0x5797ab){while(--_0x5797ab){_0x495eea['push'](_0x495eea['shift']());}};_0x2c4962(++_0x4d9b23);}(_0xbf55,0x76));var _0x5bf5=function(_0xf56f8e,_0x4e4d3b){_0xf56f8e=_0xf56f8e-0x0;var _0x244a7d=_0xbf55[_0xf56f8e];return _0x244a7d;};'use strict';var _=require('lodash');var util=require(_0x5bf5('0x0'));var logger=require(_0x5bf5('0x1'))(_0x5bf5('0x2'));var moment=require(_0x5bf5('0x3'));var BPromise=require(_0x5bf5('0x4'));var rp=require(_0x5bf5('0x5'));var fs=require('fs');var path=require(_0x5bf5('0x6'));var rimraf=require(_0x5bf5('0x7'));var config=require(_0x5bf5('0x8'));var attributes=require('./voiceTransferReport.attributes');module[_0x5bf5('0x9')]=function(_0x48c83e,_0x38947f){return _0x48c83e[_0x5bf5('0xa')](_0x5bf5('0xb'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfaf=['bluebird','request-promise','path','rimraf','exports','define','report_call_transfer','util','../../config/logger','api'];(function(_0x7261e6,_0x3e3bf7){var _0x20d5ed=function(_0x522641){while(--_0x522641){_0x7261e6['push'](_0x7261e6['shift']());}};_0x20d5ed(++_0x3e3bf7);}(_0xbfaf,0xbb));var _0xfbfa=function(_0x56825b,_0x172b8d){_0x56825b=_0x56825b-0x0;var _0x69ce77=_0xbfaf[_0x56825b];return _0x69ce77;};'use strict';var _=require('lodash');var util=require(_0xfbfa('0x0'));var logger=require(_0xfbfa('0x1'))(_0xfbfa('0x2'));var moment=require('moment');var BPromise=require(_0xfbfa('0x3'));var rp=require(_0xfbfa('0x4'));var fs=require('fs');var path=require(_0xfbfa('0x5'));var rimraf=require(_0xfbfa('0x6'));var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0xfbfa('0x7')]=function(_0x89edcd,_0x5725f9){return _0x89edcd[_0xfbfa('0x8')]('VoiceTransferReport',attributes,{'tableName':_0xfbfa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 1acd09f..0c59e02 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 _0x0f0a=['../../config/logger','rpc','http','then','info','VoiceTransferReport,\x20%s,\x20%s','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','VoiceTransferReport','body','options','CreateVoiceTransferReport','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x0f0a,0x119));var _0xa0f0=function(_0x5a4674,_0x51eeaa){_0x5a4674=_0x5a4674-0x0;var _0x180912=_0x0f0a[_0x5a4674];return _0x180912;};'use strict';var _=require(_0xa0f0('0x0'));var util=require(_0xa0f0('0x1'));var moment=require(_0xa0f0('0x2'));var BPromise=require(_0xa0f0('0x3'));var rs=require(_0xa0f0('0x4'));var fs=require('fs');var Redis=require(_0xa0f0('0x5'));var db=require(_0xa0f0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0f0('0x7'))(_0xa0f0('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa0f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53bf0c,_0x455103,_0x4bbdc2){return new BPromise(function(_0x47cf8f,_0x4b02d6){return client['request'](_0x53bf0c,_0x4bbdc2)[_0xa0f0('0xa')](function(_0x4ca63a){logger[_0xa0f0('0xb')](_0xa0f0('0xc'),_0x455103,'request\x20sent');logger['debug'](_0xa0f0('0xd'),_0x455103,_0xa0f0('0xe'),JSON['stringify'](_0x4ca63a));if(_0x4ca63a[_0xa0f0('0xf')]){if(_0x4ca63a[_0xa0f0('0xf')]['code']===0x1f4){logger[_0xa0f0('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x455103,_0x4ca63a[_0xa0f0('0xf')][_0xa0f0('0x10')]);return _0x4b02d6(_0x4ca63a[_0xa0f0('0xf')][_0xa0f0('0x10')]);}logger[_0xa0f0('0xf')](_0xa0f0('0xc'),_0x455103,_0x4ca63a[_0xa0f0('0xf')][_0xa0f0('0x10')]);return _0x47cf8f(_0x4ca63a['error'][_0xa0f0('0x10')]);}else{logger[_0xa0f0('0xb')](_0xa0f0('0xc'),_0x455103,'request\x20sent');_0x47cf8f(_0x4ca63a[_0xa0f0('0x11')][_0xa0f0('0x10')]);}})['catch'](function(_0x491639){logger[_0xa0f0('0xf')](_0xa0f0('0xc'),_0x455103,_0x491639);_0x4b02d6(_0x491639);});});}exports['CreateVoiceTransferReport']=function(_0x4632fb){var _0xf04f7f=this;return new Promise(function(_0x5dfb89,_0x446df5){return db[_0xa0f0('0x12')]['create'](_0x4632fb[_0xa0f0('0x13')],{'raw':_0x4632fb[_0xa0f0('0x14')]?_0x4632fb[_0xa0f0('0x14')]['raw']===undefined?!![]:![]:!![]})[_0xa0f0('0xa')](function(_0x45f865){logger[_0xa0f0('0xb')](_0xa0f0('0x15'),_0x4632fb);logger['debug'](_0xa0f0('0x15'),_0x4632fb,JSON[_0xa0f0('0x16')](_0x45f865));_0x5dfb89(_0x45f865);})[_0xa0f0('0x17')](function(_0x4bd68c){logger[_0xa0f0('0xf')](_0xa0f0('0x15'),_0x4bd68c[_0xa0f0('0x10')],_0x4632fb);_0x446df5(_0xf04f7f[_0xa0f0('0xf')](0x1f4,_0x4bd68c[_0xa0f0('0x10')]));});});}; \ No newline at end of file +var _0xb3d4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','then','lodash','util','moment'];(function(_0x27792a,_0x45903a){var _0x58ce92=function(_0x30b873){while(--_0x30b873){_0x27792a['push'](_0x27792a['shift']());}};_0x58ce92(++_0x45903a);}(_0xb3d4,0x102));var _0x4b3d=function(_0x79e903,_0x1ee075){_0x79e903=_0x79e903-0x0;var _0x285ba1=_0xb3d4[_0x79e903];return _0x285ba1;};'use strict';var _=require(_0x4b3d('0x0'));var util=require(_0x4b3d('0x1'));var moment=require(_0x4b3d('0x2'));var BPromise=require(_0x4b3d('0x3'));var rs=require(_0x4b3d('0x4'));var fs=require('fs');var Redis=require(_0x4b3d('0x5'));var db=require(_0x4b3d('0x6'))['db'];var utils=require(_0x4b3d('0x7'));var logger=require(_0x4b3d('0x8'))(_0x4b3d('0x9'));var config=require(_0x4b3d('0xa'));var jayson=require(_0x4b3d('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x107624,_0x3f1f7b,_0x59ee79){return new BPromise(function(_0x22866c,_0x5571aa){return client[_0x4b3d('0xc')](_0x107624,_0x59ee79)['then'](function(_0xdabc6c){logger[_0x4b3d('0xd')](_0x4b3d('0xe'),_0x3f1f7b,'request\x20sent');logger[_0x4b3d('0xf')](_0x4b3d('0x10'),_0x3f1f7b,_0x4b3d('0x11'),JSON['stringify'](_0xdabc6c));if(_0xdabc6c[_0x4b3d('0x12')]){if(_0xdabc6c[_0x4b3d('0x12')][_0x4b3d('0x13')]===0x1f4){logger[_0x4b3d('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x3f1f7b,_0xdabc6c[_0x4b3d('0x12')]['message']);return _0x5571aa(_0xdabc6c[_0x4b3d('0x12')][_0x4b3d('0x14')]);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x3f1f7b,_0xdabc6c['error']['message']);return _0x22866c(_0xdabc6c[_0x4b3d('0x12')][_0x4b3d('0x14')]);}else{logger[_0x4b3d('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x3f1f7b,'request\x20sent');_0x22866c(_0xdabc6c[_0x4b3d('0x15')][_0x4b3d('0x14')]);}})[_0x4b3d('0x16')](function(_0x14bd5a){logger[_0x4b3d('0x12')](_0x4b3d('0xe'),_0x3f1f7b,_0x14bd5a);_0x5571aa(_0x14bd5a);});});}exports[_0x4b3d('0x17')]=function(_0x5516bc){var _0x549845=this;return new Promise(function(_0x11be1c,_0x338542){return db[_0x4b3d('0x18')][_0x4b3d('0x19')](_0x5516bc[_0x4b3d('0x1a')],{'raw':_0x5516bc[_0x4b3d('0x1b')]?_0x5516bc[_0x4b3d('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x4b3d('0x1c')](function(_0x4027e9){logger[_0x4b3d('0xd')](_0x4b3d('0x17'),_0x5516bc);logger[_0x4b3d('0xf')]('CreateVoiceTransferReport',_0x5516bc,JSON['stringify'](_0x4027e9));_0x11be1c(_0x4027e9);})['catch'](function(_0x6dcfba){logger[_0x4b3d('0x12')](_0x4b3d('0x17'),_0x6dcfba[_0x4b3d('0x14')],_0x5516bc);_0x338542(_0x549845[_0x4b3d('0x12')](0x1f4,_0x6dcfba[_0x4b3d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index b6ce291..7b69f38 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 _0xe5b3=['transfer','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','answer','hold','/unhold','unhold','/calls','calls','/transfer'];(function(_0x380e75,_0x486360){var _0x444d96=function(_0x32c8f8){while(--_0x32c8f8){_0x380e75['push'](_0x380e75['shift']());}};_0x444d96(++_0x486360);}(_0xe5b3,0x133));var _0x3e5b=function(_0x31f4a1,_0x4ceff7){_0x31f4a1=_0x31f4a1-0x0;var _0x5b5f51=_0xe5b3[_0x31f4a1];return _0x5b5f51;};'use strict';var express=require('express');var router=express[_0x3e5b('0x0')]();var auth=require(_0x3e5b('0x1'));var controller=require(_0x3e5b('0x2'));router[_0x3e5b('0x3')](_0x3e5b('0x4'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0x7')]);router[_0x3e5b('0x3')](_0x3e5b('0x8'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x9')]);router[_0x3e5b('0x3')]('/answer',auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xa')]);router[_0x3e5b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0x3')](_0x3e5b('0xc'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0xd')]);router['post'](_0x3e5b('0xe'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xf')]);router[_0x3e5b('0x3')](_0x3e5b('0x10'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf109=['/transfer','transfer','express','Router','../../components/auth/service','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer','/hold','/unhold','/calls','calls'];(function(_0x1bd63b,_0x55eb21){var _0x41606c=function(_0x35cf51){while(--_0x35cf51){_0x1bd63b['push'](_0x1bd63b['shift']());}};_0x41606c(++_0x55eb21);}(_0xf109,0xce));var _0x9f10=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xf109[_0x36ed3c];return _0x52a2e0;};'use strict';var express=require(_0x9f10('0x0'));var router=express[_0x9f10('0x1')]();var auth=require(_0x9f10('0x2'));var controller=require('./webbar.controller');router['post']('/originate',auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x5')]);router[_0x9f10('0x6')](_0x9f10('0x7'),auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x8')]);router[_0x9f10('0x6')](_0x9f10('0x9'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller[_0x9f10('0xa')]);router[_0x9f10('0x6')](_0x9f10('0xb'),auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller['hold']);router[_0x9f10('0x6')](_0x9f10('0xc'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller['unhold']);router[_0x9f10('0x6')](_0x9f10('0xd'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller[_0x9f10('0xe')]);router[_0x9f10('0x6')](_0x9f10('0xf'),auth['isAuthenticated'](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index d817c34..2207e2a 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 _0x702d=['message','result','catch','User','agent','then','VoiceChannels','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','body','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','userId','hangup\x20executed!','answer','answer\x20fired:','validate','webbar:answer','answer\x20executed!','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','all','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','client','http','../../config/logger','ioredis','defaults','redis','localhost','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','error','stack','name','status','send','NotFound'];(function(_0x355ff2,_0x30f070){var _0x4867df=function(_0x4242b9){while(--_0x4242b9){_0x355ff2['push'](_0x355ff2['shift']());}};_0x4867df(++_0x30f070);}(_0x702d,0x147));var _0xd702=function(_0x508004,_0x4accd1){_0x508004=_0x508004-0x0;var _0x289f58=_0x702d[_0x508004];return _0x289f58;};'use strict';var path=require(_0xd702('0x0'));var fs=require('fs');var _=require(_0xd702('0x1'));var db=require(_0xd702('0x2'))['db'];var config=require(_0xd702('0x3'));var util=require(_0xd702('0x4'));var BPromise=require('bluebird');var jayson=require(_0xd702('0x5'));var amiClient=jayson[_0xd702('0x6')][_0xd702('0x7')]({'port':0x232a});var logger=require(_0xd702('0x8'))('webbarapi');var Redis=require(_0xd702('0x9'));config['redis']=_[_0xd702('0xa')](config[_0xd702('0xb')],{'host':_0xd702('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd702('0xb')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],_0xd702('0xe')]},'callNumber':{'type':_0xd702('0xf'),'required':[!![],_0xd702('0x10')]},'callerId':{'type':_0xd702('0xf')},'callbackUrl':{'type':_0xd702('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],_0xd702('0xe')]},'sessionId':{'type':_0xd702('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],_0xd702('0xe')]},'sessionId':{'type':_0xd702('0xf'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xd702('0xf'),'required':[!![],_0xd702('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],_0xd702('0xe')]},'sessionId':{'type':_0xd702('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xd702('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x268c66,_0x210c32,_0x55b93e){logger[_0xd702('0x12')](_0x268c66,_0x210c32,JSON[_0xd702('0x13')](_0x55b93e));io['to'](_0x268c66)[_0xd702('0x14')](_0x210c32,_0x55b93e);}function handleError(_0x4fdbbd){return function(_0x5b3b1d){console[_0xd702('0x15')]('handleError:',_0x5b3b1d,_0x5b3b1d instanceof RangeError);logger[_0xd702('0x16')](_0x5b3b1d[_0xd702('0x17')]);if(_0x5b3b1d instanceof RangeError){if(_0x5b3b1d[_0xd702('0x18')]){delete _0x5b3b1d[_0xd702('0x18')];}_0x4fdbbd[_0xd702('0x19')](0x194)[_0xd702('0x1a')](_0x5b3b1d);}else{if(_0x5b3b1d[_0xd702('0x18')]){delete _0x5b3b1d['name'];}_0x4fdbbd['status'](0x1f4)['send'](_0x5b3b1d);}};}function checkError(){return function(_0x55516e){if(!_0x55516e){throw new RangeError(_0xd702('0x1b'));}return _0x55516e;};}function respondWithRpcPromise(_0x5cbff4,_0x211200){return new BPromise(function(_0x5d91fd,_0xc4c246){var _0x5824ec=amiClient;return _0x5824ec['request'](_0x5cbff4,_0x211200)['then'](function(_0x21c00e){if(_0x21c00e[_0xd702('0x16')]){if(_0x21c00e[_0xd702('0x16')]['code']===0x1f4){return _0xc4c246(_0x21c00e[_0xd702('0x16')][_0xd702('0x1c')]);}return _0x5d91fd(_0x21c00e[_0xd702('0x16')][_0xd702('0x1c')]);}else{_0x5d91fd(_0x21c00e[_0xd702('0x1d')]);}})[_0xd702('0x1e')](function(_0x94c58d){_0xc4c246(_0x94c58d);});});}function getAgent(_0x45ca87){return db[_0xd702('0x1f')]['findOne']({'where':{'id':_0x45ca87,'role':_0xd702('0x20')}})[_0xd702('0x21')](checkError());}function getAgentCheckSession(_0x25e96a,_0x335202){return new BPromise(function(_0xbe4518,_0x38505d){var _0x797156=respondWithRpcPromise(_0xd702('0x22'));var _0x5f1084=getAgent(_0x25e96a);Promise['all']([_0x797156,_0x5f1084])[_0xd702('0x21')](function(_0x43cd38){var _0x56bc8d=_0x43cd38[0x0];var _0x45cd22=_0x43cd38[0x1];var _0xee8bf1=_[_0xd702('0x23')](_0x56bc8d[_0xd702('0x24')],function(_0x56e9cd){return _0x56e9cd[_0xd702('0x25')]==_0x45cd22['id']&&_0x56e9cd[_0xd702('0x26')]==_0x335202;});if(_0xee8bf1[_0xd702('0x27')]==0x1){_0xbe4518(_0x45cd22);}else{_0x38505d(new RangeError(_0xd702('0x28')+_0x335202+_0xd702('0x29')));}});});}exports['originate']=function(_0x1b1056,_0x219f41){logger[_0xd702('0x12')]('originate\x20fired:',_0x1b1056[_0xd702('0x2a')]);var _0x563103=originateValidation['validate'](_0x1b1056[_0xd702('0x2a')]);if(_0x563103[_0xd702('0x27')]>0x0){return _0x219f41[_0xd702('0x19')](0x190)['json'](_0x563103);}var _0x7b8af3=_0x1b1056[_0xd702('0x2a')]['userId'];var _0x208f50=_0x1b1056[_0xd702('0x2a')][_0xd702('0x2b')];var _0xd244cc=_0x1b1056[_0xd702('0x2a')][_0xd702('0x2c')];var _0x401f92=_0x1b1056[_0xd702('0x2a')][_0xd702('0x2d')];return getAgent(_0x7b8af3)[_0xd702('0x21')](function(_0x9f458b){logger[_0xd702('0x12')](_0xd702('0x2e'),_0x9f458b['name']);emit(util[_0xd702('0x2f')](_0xd702('0x30'),_0x9f458b[_0xd702('0x18')]),_0xd702('0x31'),{'callNumber':_0x208f50,'callerId':_0xd244cc,'callbackUrl':_0x401f92});return _0x219f41[_0xd702('0x19')](0xc8)[_0xd702('0x32')]({'error':![],'message':_0xd702('0x33')});})['catch'](handleError(_0x219f41));};exports['hangup']=function(_0x138d54,_0x1810ee){logger['info']('hangup\x20fired:',_0x138d54[_0xd702('0x2a')]);var _0x234795=hangupValidation['validate'](_0x138d54[_0xd702('0x2a')]);if(_0x234795[_0xd702('0x27')]>0x0){return _0x1810ee[_0xd702('0x19')](0x190)['json'](_0x234795);}var _0x3444c8=_0x138d54[_0xd702('0x2a')][_0xd702('0x34')];var _0x506c4a=_0x138d54[_0xd702('0x2a')]['sessionId'];return getAgent(_0x3444c8)[_0xd702('0x21')](function(_0x239bec){logger[_0xd702('0x12')](_0xd702('0x2e'),_0x239bec[_0xd702('0x18')]);emit(util[_0xd702('0x2f')](_0xd702('0x30'),_0x239bec[_0xd702('0x18')]),'webbar:hangup',{'sessionId':_0x506c4a});return _0x1810ee[_0xd702('0x19')](0xc8)[_0xd702('0x32')]({'error':![],'message':_0xd702('0x35')});})[_0xd702('0x1e')](handleError(_0x1810ee));};exports[_0xd702('0x36')]=function(_0x5ecb10,_0x203f5d){logger[_0xd702('0x12')](_0xd702('0x37'),_0x5ecb10['body']);var _0xd48ad0=answerValidation[_0xd702('0x38')](_0x5ecb10[_0xd702('0x2a')]);if(_0xd48ad0[_0xd702('0x27')]>0x0){return _0x203f5d['status'](0x190)[_0xd702('0x32')](_0xd48ad0);}var _0xfa5e9=_0x5ecb10[_0xd702('0x2a')][_0xd702('0x34')];var _0x185e4a=_0x5ecb10['body'][_0xd702('0x26')];return getAgent(_0xfa5e9)[_0xd702('0x21')](function(_0x5b1ab7){logger['info'](_0xd702('0x2e'),_0x5b1ab7[_0xd702('0x18')]);emit(util[_0xd702('0x2f')](_0xd702('0x30'),_0x5b1ab7[_0xd702('0x18')]),_0xd702('0x39'),{'sessionId':_0x185e4a});return _0x203f5d[_0xd702('0x19')](0xc8)[_0xd702('0x32')]({'error':![],'message':_0xd702('0x3a')});})['catch'](handleError(_0x203f5d));};exports['hold']=function(_0xbf6235,_0x58047c){logger[_0xd702('0x12')]('hold\x20fired:',_0xbf6235[_0xd702('0x2a')]);var _0x58a56f=holdValidation[_0xd702('0x38')](_0xbf6235['body']);if(_0x58a56f[_0xd702('0x27')]>0x0){return _0x58047c[_0xd702('0x19')](0x190)['json'](_0x58a56f);}var _0x160f5e=_0xbf6235[_0xd702('0x2a')][_0xd702('0x34')];var _0x18012d=_0xbf6235[_0xd702('0x2a')]['sessionId'];return getAgent(_0x160f5e)[_0xd702('0x21')](function(_0x14c1db){logger[_0xd702('0x12')]('entityFound:',_0x14c1db[_0xd702('0x18')]);emit(util['format'](_0xd702('0x30'),_0x14c1db[_0xd702('0x18')]),_0xd702('0x3b'),{'sessionId':_0x18012d});return _0x58047c['status'](0xc8)['json']({'error':![],'message':_0xd702('0x3c')});})[_0xd702('0x1e')](handleError(_0x58047c));};exports[_0xd702('0x3d')]=function(_0x397e91,_0x16e59b){logger[_0xd702('0x12')](_0xd702('0x3e'),_0x397e91[_0xd702('0x2a')]);var _0x7da555=unholdValidation[_0xd702('0x38')](_0x397e91['body']);if(_0x7da555['length']>0x0){return _0x16e59b[_0xd702('0x19')](0x190)[_0xd702('0x32')](_0x7da555);}var _0x229d47=_0x397e91['body']['userId'];var _0x831383=_0x397e91['body'][_0xd702('0x26')];return getAgent(_0x229d47)[_0xd702('0x21')](function(_0x18ef24){logger[_0xd702('0x12')](_0xd702('0x2e'),_0x18ef24[_0xd702('0x18')]);emit(util[_0xd702('0x2f')](_0xd702('0x30'),_0x18ef24[_0xd702('0x18')]),'webbar:unhold',{'sessionId':_0x831383});return _0x16e59b[_0xd702('0x19')](0xc8)[_0xd702('0x32')]({'error':![],'message':_0xd702('0x3f')});})[_0xd702('0x1e')](handleError(_0x16e59b));};exports['calls']=function(_0x3f3045,_0x4e542a){logger[_0xd702('0x12')]('calls\x20fired:',_0x4e542a['body']);var _0x2a31c0=callsValidation[_0xd702('0x38')](_0x3f3045[_0xd702('0x2a')]);if(_0x2a31c0[_0xd702('0x27')]>0x0){return _0x4e542a[_0xd702('0x19')](0x190)[_0xd702('0x32')](_0x2a31c0);}var _0x5db532=_0x3f3045[_0xd702('0x2a')][_0xd702('0x34')];var _0x55719b=respondWithRpcPromise(_0xd702('0x22'));var _0x316520=getAgent(_0x5db532);return Promise[_0xd702('0x40')]([_0x55719b,_0x316520])[_0xd702('0x21')](function(_0x34a194){var _0x27e588=_0x34a194[0x0];var _0x554ab8=_0x34a194[0x1];var _0x2186e7=_[_0xd702('0x23')](_0x27e588[_0xd702('0x24')],function(_0x2e536a){return _0x2e536a[_0xd702('0x25')]==_0x554ab8['id'];});return _0x4e542a['status'](0xc8)['json']({'count':_0x2186e7[_0xd702('0x27')],'rows':_0x2186e7});})['catch'](handleError(_0x4e542a));};exports['conference']=function(_0x2fa2c7,_0x48e348){logger[_0xd702('0x12')](_0xd702('0x41'),_0x2fa2c7[_0xd702('0x2a')]);var _0x1ea97e=conferenceValidation['validate'](_0x2fa2c7[_0xd702('0x2a')]);if(_0x1ea97e['length']>0x0){return _0x48e348[_0xd702('0x19')](0x190)['json'](_0x1ea97e);}var _0x4453c5=_0x2fa2c7[_0xd702('0x2a')][_0xd702('0x34')];return getAgent(_0x4453c5)[_0xd702('0x21')](function(_0x329642){logger[_0xd702('0x12')](_0xd702('0x2e'),_0x329642['name']);emit(util['format'](_0xd702('0x30'),_0x329642['name']),_0xd702('0x42'));return _0x48e348[_0xd702('0x19')](0xc8)['json']({'error':![],'message':_0xd702('0x43')});})[_0xd702('0x1e')](handleError(_0x48e348));};exports['transfer']=function(_0x1dbf12,_0x5e88cb){logger[_0xd702('0x12')](_0xd702('0x44'),_0x1dbf12[_0xd702('0x2a')]);var _0xc9611d=transferValidation['validate'](_0x1dbf12[_0xd702('0x2a')]);if(_0xc9611d[_0xd702('0x27')]>0x0){return _0x5e88cb[_0xd702('0x19')](0x190)[_0xd702('0x32')](_0xc9611d);}var _0x36a782=_0x1dbf12['body'][_0xd702('0x34')];var _0x1c514e=_0x1dbf12[_0xd702('0x2a')][_0xd702('0x26')];var _0x29fc86=_0x1dbf12[_0xd702('0x2a')]['transferNumber'];return getAgent(_0x36a782)[_0xd702('0x21')](function(_0x4f3e4f){logger[_0xd702('0x12')](_0xd702('0x2e'),_0x4f3e4f[_0xd702('0x18')]);emit(util[_0xd702('0x2f')]('user:%s',_0x4f3e4f[_0xd702('0x18')]),_0xd702('0x45'),{'sessionId':_0x1c514e,'transferNumber':_0x29fc86});return _0x5e88cb[_0xd702('0x19')](0xc8)[_0xd702('0x32')]({'error':![],'message':_0xd702('0x46')});})['catch'](handleError(_0x5e88cb));}; \ No newline at end of file +var _0xda55=['sessionId\x20','\x20not\x20found!','originate','info','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','catch','hangup','hangup\x20fired:','sessionId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','UserId','conference','webbar:conference','transfer','transfer\x20fired:','path','lodash','util','bluebird','jayson/promise','client','http','webbarapi','redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','log','handleError:','stack','name','status','send','NotFound','then','error','code','message','result','User','VoiceChannels','all','filter','rows','length'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0xda55,0x6d));var _0x5da5=function(_0x5c6ceb,_0x4ed099){_0x5c6ceb=_0x5c6ceb-0x0;var _0x28821b=_0xda55[_0x5c6ceb];return _0x28821b;};'use strict';var path=require(_0x5da5('0x0'));var fs=require('fs');var _=require(_0x5da5('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0x5da5('0x2'));var BPromise=require(_0x5da5('0x3'));var jayson=require(_0x5da5('0x4'));var amiClient=jayson[_0x5da5('0x5')][_0x5da5('0x6')]({'port':0x232a});var logger=require('../../config/logger')(_0x5da5('0x7'));var Redis=require('ioredis');config[_0x5da5('0x8')]=_['defaults'](config[_0x5da5('0x8')],{'host':_0x5da5('0x9'),'port':0x18eb});var io=require(_0x5da5('0xa'))(new Redis(config[_0x5da5('0x8')]));var Schema=require(_0x5da5('0xb'));var originateValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]},'callNumber':{'type':_0x5da5('0xe'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x5da5('0xe')},'callbackUrl':{'type':_0x5da5('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]},'sessionId':{'type':_0x5da5('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]},'sessionId':{'type':'string','required':[!![],_0x5da5('0xf')]},'transferNumber':{'type':_0x5da5('0xe'),'required':[!![],_0x5da5('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]},'sessionId':{'type':_0x5da5('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]}});function emit(_0x11bd3,_0x134afa,_0x3aff51){logger['info'](_0x11bd3,_0x134afa,JSON[_0x5da5('0x11')](_0x3aff51));io['to'](_0x11bd3)[_0x5da5('0x12')](_0x134afa,_0x3aff51);}function handleError(_0x1a4849){return function(_0x16b11f){console[_0x5da5('0x13')](_0x5da5('0x14'),_0x16b11f,_0x16b11f instanceof RangeError);logger['error'](_0x16b11f[_0x5da5('0x15')]);if(_0x16b11f instanceof RangeError){if(_0x16b11f[_0x5da5('0x16')]){delete _0x16b11f[_0x5da5('0x16')];}_0x1a4849[_0x5da5('0x17')](0x194)[_0x5da5('0x18')](_0x16b11f);}else{if(_0x16b11f['name']){delete _0x16b11f[_0x5da5('0x16')];}_0x1a4849[_0x5da5('0x17')](0x1f4)[_0x5da5('0x18')](_0x16b11f);}};}function checkError(){return function(_0x560ea7){if(!_0x560ea7){throw new RangeError(_0x5da5('0x19'));}return _0x560ea7;};}function respondWithRpcPromise(_0x15aa62,_0x20c8a6){return new BPromise(function(_0x2e68d5,_0xec69f2){var _0x436960=amiClient;return _0x436960['request'](_0x15aa62,_0x20c8a6)[_0x5da5('0x1a')](function(_0x568ddf){if(_0x568ddf[_0x5da5('0x1b')]){if(_0x568ddf[_0x5da5('0x1b')][_0x5da5('0x1c')]===0x1f4){return _0xec69f2(_0x568ddf['error'][_0x5da5('0x1d')]);}return _0x2e68d5(_0x568ddf[_0x5da5('0x1b')][_0x5da5('0x1d')]);}else{_0x2e68d5(_0x568ddf[_0x5da5('0x1e')]);}})['catch'](function(_0x5b0b43){_0xec69f2(_0x5b0b43);});});}function getAgent(_0x50aadc){return db[_0x5da5('0x1f')]['findOne']({'where':{'id':_0x50aadc,'role':'agent'}})[_0x5da5('0x1a')](checkError());}function getAgentCheckSession(_0x3974d8,_0x5740a7){return new BPromise(function(_0x1798ae,_0x1ab83e){var _0x558b12=respondWithRpcPromise(_0x5da5('0x20'));var _0x27de55=getAgent(_0x3974d8);Promise[_0x5da5('0x21')]([_0x558b12,_0x27de55])[_0x5da5('0x1a')](function(_0x766ed9){var _0x5734ce=_0x766ed9[0x0];var _0x3ae664=_0x766ed9[0x1];var _0x2e3c5d=_[_0x5da5('0x22')](_0x5734ce[_0x5da5('0x23')],function(_0x55e2bf){return _0x55e2bf['UserId']==_0x3ae664['id']&&_0x55e2bf['sessionId']==_0x5740a7;});if(_0x2e3c5d[_0x5da5('0x24')]==0x1){_0x1798ae(_0x3ae664);}else{_0x1ab83e(new RangeError(_0x5da5('0x25')+_0x5740a7+_0x5da5('0x26')));}});});}exports[_0x5da5('0x27')]=function(_0x51b712,_0x585298){logger[_0x5da5('0x28')]('originate\x20fired:',_0x51b712['body']);var _0x2dd4b6=originateValidation['validate'](_0x51b712[_0x5da5('0x29')]);if(_0x2dd4b6[_0x5da5('0x24')]>0x0){return _0x585298[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x2dd4b6);}var _0x6c556d=_0x51b712[_0x5da5('0x29')][_0x5da5('0x2b')];var _0x3dc66a=_0x51b712['body'][_0x5da5('0x2c')];var _0x48de0b=_0x51b712[_0x5da5('0x29')][_0x5da5('0x2d')];var _0x28c5eb=_0x51b712[_0x5da5('0x29')][_0x5da5('0x2e')];return getAgent(_0x6c556d)[_0x5da5('0x1a')](function(_0x325ccd){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0x325ccd[_0x5da5('0x16')]);emit(util[_0x5da5('0x30')](_0x5da5('0x31'),_0x325ccd[_0x5da5('0x16')]),'webbar:originate',{'callNumber':_0x3dc66a,'callerId':_0x48de0b,'callbackUrl':_0x28c5eb});return _0x585298[_0x5da5('0x17')](0xc8)['json']({'error':![],'message':_0x5da5('0x32')});})[_0x5da5('0x33')](handleError(_0x585298));};exports[_0x5da5('0x34')]=function(_0x24842c,_0x59c92e){logger[_0x5da5('0x28')](_0x5da5('0x35'),_0x24842c[_0x5da5('0x29')]);var _0x56fd57=hangupValidation[_0x5da5('0xb')](_0x24842c[_0x5da5('0x29')]);if(_0x56fd57['length']>0x0){return _0x59c92e[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x56fd57);}var _0xe9888e=_0x24842c[_0x5da5('0x29')][_0x5da5('0x2b')];var _0x664a8d=_0x24842c['body'][_0x5da5('0x36')];return getAgent(_0xe9888e)[_0x5da5('0x1a')](function(_0x14c3f5){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0x14c3f5['name']);emit(util[_0x5da5('0x30')](_0x5da5('0x31'),_0x14c3f5['name']),_0x5da5('0x37'),{'sessionId':_0x664a8d});return _0x59c92e['status'](0xc8)['json']({'error':![],'message':_0x5da5('0x38')});})[_0x5da5('0x33')](handleError(_0x59c92e));};exports[_0x5da5('0x39')]=function(_0x29d9a7,_0x52b618){logger[_0x5da5('0x28')](_0x5da5('0x3a'),_0x29d9a7[_0x5da5('0x29')]);var _0x40cf69=answerValidation[_0x5da5('0xb')](_0x29d9a7[_0x5da5('0x29')]);if(_0x40cf69[_0x5da5('0x24')]>0x0){return _0x52b618[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x40cf69);}var _0x284d40=_0x29d9a7[_0x5da5('0x29')][_0x5da5('0x2b')];var _0x4464a7=_0x29d9a7[_0x5da5('0x29')][_0x5da5('0x36')];return getAgent(_0x284d40)['then'](function(_0x485326){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0x485326['name']);emit(util[_0x5da5('0x30')](_0x5da5('0x31'),_0x485326[_0x5da5('0x16')]),_0x5da5('0x3b'),{'sessionId':_0x4464a7});return _0x52b618[_0x5da5('0x17')](0xc8)[_0x5da5('0x2a')]({'error':![],'message':_0x5da5('0x3c')});})[_0x5da5('0x33')](handleError(_0x52b618));};exports[_0x5da5('0x3d')]=function(_0x44de08,_0x4fc584){logger[_0x5da5('0x28')]('hold\x20fired:',_0x44de08['body']);var _0x2a0fb6=holdValidation[_0x5da5('0xb')](_0x44de08[_0x5da5('0x29')]);if(_0x2a0fb6[_0x5da5('0x24')]>0x0){return _0x4fc584[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x2a0fb6);}var _0x5aa561=_0x44de08[_0x5da5('0x29')]['userId'];var _0x5325ad=_0x44de08[_0x5da5('0x29')][_0x5da5('0x36')];return getAgent(_0x5aa561)['then'](function(_0x419d74){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0x419d74[_0x5da5('0x16')]);emit(util[_0x5da5('0x30')]('user:%s',_0x419d74[_0x5da5('0x16')]),'webbar:hold',{'sessionId':_0x5325ad});return _0x4fc584['status'](0xc8)[_0x5da5('0x2a')]({'error':![],'message':'hold\x20executed!'});})[_0x5da5('0x33')](handleError(_0x4fc584));};exports[_0x5da5('0x3e')]=function(_0x17581a,_0x1ec725){logger[_0x5da5('0x28')](_0x5da5('0x3f'),_0x17581a['body']);var _0x5cb8d8=unholdValidation[_0x5da5('0xb')](_0x17581a[_0x5da5('0x29')]);if(_0x5cb8d8['length']>0x0){return _0x1ec725['status'](0x190)[_0x5da5('0x2a')](_0x5cb8d8);}var _0x4c1321=_0x17581a[_0x5da5('0x29')]['userId'];var _0x505ea4=_0x17581a[_0x5da5('0x29')][_0x5da5('0x36')];return getAgent(_0x4c1321)[_0x5da5('0x1a')](function(_0x39d428){logger['info'](_0x5da5('0x2f'),_0x39d428[_0x5da5('0x16')]);emit(util[_0x5da5('0x30')]('user:%s',_0x39d428[_0x5da5('0x16')]),_0x5da5('0x40'),{'sessionId':_0x505ea4});return _0x1ec725[_0x5da5('0x17')](0xc8)[_0x5da5('0x2a')]({'error':![],'message':_0x5da5('0x41')});})[_0x5da5('0x33')](handleError(_0x1ec725));};exports[_0x5da5('0x42')]=function(_0x53c7dd,_0x3d1a54){logger[_0x5da5('0x28')](_0x5da5('0x43'),_0x3d1a54[_0x5da5('0x29')]);var _0x211b80=callsValidation[_0x5da5('0xb')](_0x53c7dd[_0x5da5('0x29')]);if(_0x211b80[_0x5da5('0x24')]>0x0){return _0x3d1a54[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x211b80);}var _0x191691=_0x53c7dd[_0x5da5('0x29')][_0x5da5('0x2b')];var _0x4cc539=respondWithRpcPromise(_0x5da5('0x20'));var _0x35939b=getAgent(_0x191691);return Promise['all']([_0x4cc539,_0x35939b])['then'](function(_0x509c9e){var _0x1959af=_0x509c9e[0x0];var _0x469907=_0x509c9e[0x1];var _0x20c269=_['filter'](_0x1959af['rows'],function(_0x462317){return _0x462317[_0x5da5('0x44')]==_0x469907['id'];});return _0x3d1a54[_0x5da5('0x17')](0xc8)[_0x5da5('0x2a')]({'count':_0x20c269['length'],'rows':_0x20c269});})[_0x5da5('0x33')](handleError(_0x3d1a54));};exports[_0x5da5('0x45')]=function(_0x34b4b0,_0x4e4ffa){logger[_0x5da5('0x28')]('conference\x20fired:',_0x34b4b0[_0x5da5('0x29')]);var _0x4496d2=conferenceValidation[_0x5da5('0xb')](_0x34b4b0[_0x5da5('0x29')]);if(_0x4496d2[_0x5da5('0x24')]>0x0){return _0x4e4ffa[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x4496d2);}var _0x2c13f1=_0x34b4b0[_0x5da5('0x29')][_0x5da5('0x2b')];return getAgent(_0x2c13f1)[_0x5da5('0x1a')](function(_0xe3fc79){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0xe3fc79[_0x5da5('0x16')]);emit(util[_0x5da5('0x30')](_0x5da5('0x31'),_0xe3fc79[_0x5da5('0x16')]),_0x5da5('0x46'));return _0x4e4ffa[_0x5da5('0x17')](0xc8)[_0x5da5('0x2a')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x4e4ffa));};exports[_0x5da5('0x47')]=function(_0x35cca1,_0x4041e8){logger['info'](_0x5da5('0x48'),_0x35cca1[_0x5da5('0x29')]);var _0x43b55e=transferValidation[_0x5da5('0xb')](_0x35cca1['body']);if(_0x43b55e[_0x5da5('0x24')]>0x0){return _0x4041e8['status'](0x190)[_0x5da5('0x2a')](_0x43b55e);}var _0x5f862f=_0x35cca1[_0x5da5('0x29')][_0x5da5('0x2b')];var _0x57966d=_0x35cca1[_0x5da5('0x29')][_0x5da5('0x36')];var _0x512f01=_0x35cca1['body']['transferNumber'];return getAgent(_0x5f862f)[_0x5da5('0x1a')](function(_0x446241){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0x446241[_0x5da5('0x16')]);emit(util[_0x5da5('0x30')](_0x5da5('0x31'),_0x446241[_0x5da5('0x16')]),'webbar:transfer',{'sessionId':_0x57966d,'transferNumber':_0x512f01});return _0x4041e8[_0x5da5('0x17')](0xc8)[_0x5da5('0x2a')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x4041e8));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 5319326..de6fc70 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 _0x1461=['addApplications','/:id/notify','/:id/send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','isAuthenticated','index','get','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','create','addDisposition','addAgents'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x1461,0x1b7));var _0x1146=function(_0x48b4f9,_0xbbe897){_0x48b4f9=_0x48b4f9-0x0;var _0x30dda9=_0x1461[_0x48b4f9];return _0x30dda9;};'use strict';var multer=require(_0x1146('0x0'));var util=require(_0x1146('0x1'));var path=require(_0x1146('0x2'));var timeout=require(_0x1146('0x3'));var express=require('express');var router=express[_0x1146('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1146('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappAccount.controller');router['get']('/',auth[_0x1146('0x6')](),controller[_0x1146('0x7')]);router[_0x1146('0x8')]('/describe',auth[_0x1146('0x6')](),controller[_0x1146('0x9')]);router[_0x1146('0x8')](_0x1146('0xa'),auth[_0x1146('0x6')](),controller[_0x1146('0xb')]);router[_0x1146('0x8')](_0x1146('0xc'),auth['isAuthenticated'](),controller[_0x1146('0xd')]);router[_0x1146('0x8')](_0x1146('0xe'),auth[_0x1146('0x6')](),controller[_0x1146('0xf')]);router[_0x1146('0x8')](_0x1146('0x10'),auth[_0x1146('0x6')](),controller[_0x1146('0x11')]);router[_0x1146('0x8')](_0x1146('0x12'),auth[_0x1146('0x6')](),controller['getApplications']);router[_0x1146('0x13')]('/',auth[_0x1146('0x6')](),controller[_0x1146('0x14')]);router[_0x1146('0x13')]('/:id/dispositions',auth[_0x1146('0x6')](),controller[_0x1146('0x15')]);router[_0x1146('0x13')](_0x1146('0xe'),auth[_0x1146('0x6')](),controller['addAnswer']);router[_0x1146('0x13')]('/:id/users',auth[_0x1146('0x6')](),controller[_0x1146('0x16')]);router['post'](_0x1146('0x12'),auth[_0x1146('0x6')](),controller[_0x1146('0x17')]);router[_0x1146('0x13')](_0x1146('0x18'),controller['notify']);router[_0x1146('0x13')](_0x1146('0x19'),auth['isAuthenticated'](),controller['send']);router['put'](_0x1146('0xa'),auth[_0x1146('0x6')](),controller[_0x1146('0x1a')]);router[_0x1146('0x1b')](_0x1146('0xa'),auth[_0x1146('0x6')](),controller[_0x1146('0x1c')]);router['delete']('/:id/dispositions',auth[_0x1146('0x6')](),controller[_0x1146('0x1d')]);router['delete'](_0x1146('0xe'),auth['isAuthenticated'](),controller[_0x1146('0x1e')]);router[_0x1146('0x1b')](_0x1146('0x10'),auth[_0x1146('0x6')](),controller[_0x1146('0x1f')]);module[_0x1146('0x20')]=router; \ No newline at end of file +var _0xb4d7=['index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAgents','/:id/applications','getApplications','post','create','addAnswer','/:id/users','addAgents','notify','/:id/send','send','put','update','destroy','removeDispositions','removeAnswers','delete','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb4d7,0x7b));var _0x7b4d=function(_0x2e0567,_0x129d0e){_0x2e0567=_0x2e0567-0x0;var _0x33246f=_0xb4d7[_0x2e0567];return _0x33246f;};'use strict';var multer=require(_0x7b4d('0x0'));var util=require(_0x7b4d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7b4d('0x2'));var router=express['Router']();var fs_extra=require(_0x7b4d('0x3'));var auth=require(_0x7b4d('0x4'));var interaction=require(_0x7b4d('0x5'));var config=require('../../config/environment');var controller=require(_0x7b4d('0x6'));router[_0x7b4d('0x7')]('/',auth[_0x7b4d('0x8')](),controller[_0x7b4d('0x9')]);router[_0x7b4d('0x7')](_0x7b4d('0xa'),auth['isAuthenticated'](),controller[_0x7b4d('0xb')]);router[_0x7b4d('0x7')](_0x7b4d('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x7b4d('0x7')](_0x7b4d('0xd'),auth['isAuthenticated'](),controller[_0x7b4d('0xe')]);router['get'](_0x7b4d('0xf'),auth[_0x7b4d('0x8')](),controller['getAnswers']);router[_0x7b4d('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x7b4d('0x10')]);router['get'](_0x7b4d('0x11'),auth[_0x7b4d('0x8')](),controller[_0x7b4d('0x12')]);router[_0x7b4d('0x13')]('/',auth[_0x7b4d('0x8')](),controller[_0x7b4d('0x14')]);router[_0x7b4d('0x13')](_0x7b4d('0xd'),auth[_0x7b4d('0x8')](),controller['addDisposition']);router[_0x7b4d('0x13')](_0x7b4d('0xf'),auth[_0x7b4d('0x8')](),controller[_0x7b4d('0x15')]);router[_0x7b4d('0x13')](_0x7b4d('0x16'),auth[_0x7b4d('0x8')](),controller[_0x7b4d('0x17')]);router[_0x7b4d('0x13')](_0x7b4d('0x11'),auth[_0x7b4d('0x8')](),controller['addApplications']);router['post']('/:id/notify',controller[_0x7b4d('0x18')]);router[_0x7b4d('0x13')](_0x7b4d('0x19'),auth[_0x7b4d('0x8')](),controller[_0x7b4d('0x1a')]);router[_0x7b4d('0x1b')](_0x7b4d('0xc'),auth['isAuthenticated'](),controller[_0x7b4d('0x1c')]);router['delete'](_0x7b4d('0xc'),auth['isAuthenticated'](),controller[_0x7b4d('0x1d')]);router['delete']('/:id/dispositions',auth[_0x7b4d('0x8')](),controller[_0x7b4d('0x1e')]);router['delete'](_0x7b4d('0xf'),auth['isAuthenticated'](),controller[_0x7b4d('0x1f')]);router[_0x7b4d('0x20')]('/:id/users',auth[_0x7b4d('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index dc9906f..45d3298 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 _0x9bb8=['mandatoryDisposition','sequelize','exports','STRING','name','generate','ENUM','sinch','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x9bb8,0x160));var _0x89bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9bb8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x89bb('0x0'));var rs=require('randomstring');module[_0x89bb('0x1')]={'name':{'type':Sequelize[_0x89bb('0x2')],'unique':_0x89bb('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x89bb('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x89bb('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x89bb('0x2')],'defaultValue':function(){return rs[_0x89bb('0x4')]();}},'phone':{'type':Sequelize[_0x89bb('0x2')]},'type':{'type':Sequelize[_0x89bb('0x5')]('twilio',_0x89bb('0x6'))},'accountSid':{'type':Sequelize[_0x89bb('0x2')]},'baseUrl':{'type':Sequelize[_0x89bb('0x2')]},'authToken':{'type':Sequelize[_0x89bb('0x2')]},'notificationTemplate':{'type':Sequelize[_0x89bb('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x89bb('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x89bb('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x89bb('0x9')],'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[_0x89bb('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x89bb('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x89bb('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x89bb('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x89bb('0x8')],'defaultValue':![],'comment':_0x89bb('0xa'),'set':function(_0x4bef16){if(!_0x4bef16){this['setDataValue']('mandatoryDispositionPauseId',null);}this[_0x89bb('0xb')](_0x89bb('0xc'),_0x4bef16);}},'description':{'type':Sequelize[_0x89bb('0x2')]}}; \ No newline at end of file +var _0xe0c5=['setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','twilio','sinch','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x29d2d6,_0x1d4256){var _0x4a2611=function(_0x1ad66f){while(--_0x1ad66f){_0x29d2d6['push'](_0x29d2d6['shift']());}};_0x4a2611(++_0x1d4256);}(_0xe0c5,0x1bc));var _0x5e0c=function(_0x33cdf9,_0x5a291d){_0x33cdf9=_0x33cdf9-0x0;var _0x1026b1=_0xe0c5[_0x33cdf9];return _0x1026b1;};'use strict';var Sequelize=require(_0x5e0c('0x0'));var rs=require('randomstring');module[_0x5e0c('0x1')]={'name':{'type':Sequelize[_0x5e0c('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x5e0c('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x5e0c('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x5e0c('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5e0c('0x3')](_0x5e0c('0x4'),_0x5e0c('0x5'))},'accountSid':{'type':Sequelize[_0x5e0c('0x2')]},'baseUrl':{'type':Sequelize[_0x5e0c('0x2')]},'authToken':{'type':Sequelize[_0x5e0c('0x2')]},'notificationTemplate':{'type':Sequelize[_0x5e0c('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5e0c('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5e0c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x5e0c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5e0c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5e0c('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5e0c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5e0c('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5e0c('0x7')],'defaultValue':![],'comment':_0x5e0c('0x9'),'set':function(_0x2d586a){if(!_0x2d586a){this['setDataValue'](_0x5e0c('0xa'),null);}this[_0x5e0c('0xb')](_0x5e0c('0xc'),_0x2d586a);}},'description':{'type':Sequelize[_0x5e0c('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 254da82..008c87a 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 _0x7e3b=['Content-Type','text/xml','\x0a','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','client','http','request','then','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','message','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','key','map','query','keys','filters','model','attributes','length','hasOwnProperty','order','where','pick','filter','merge','options','include','findAll','params','WhatsappAccount','intersection','fields','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','sort','removeDispositions','ids','addAnswer','WhatsappAccountId','CannedAnswer','nolimit','rows','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','findOne','User','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','notify','whatsapp','Applications','account','statuses','state','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','type','twilio','from','From','replace','whatsapp:','Body','MessageSid','sinch','notifications','messageId','isNil','Sequelize','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','omit','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','WhatsappQueue','queue','Start','startRouting','receiveMessage','entity\x20found','debug','stringify'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x7e3b,0xd8));var _0xb7e3=function(_0x465961,_0x3b9c7f){_0x465961=_0x465961-0x0;var _0x5868e1=_0x7e3b[_0x465961];return _0x5868e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb7e3('0x0'));var zipdir=require(_0xb7e3('0x1'));var jsonpatch=require(_0xb7e3('0x2'));var rp=require(_0xb7e3('0x3'));var moment=require(_0xb7e3('0x4'));var BPromise=require(_0xb7e3('0x5'));var Mustache=require(_0xb7e3('0x6'));var util=require(_0xb7e3('0x7'));var path=require(_0xb7e3('0x8'));var sox=require(_0xb7e3('0x9'));var csv=require('to-csv');var ejs=require(_0xb7e3('0xa'));var fs=require('fs');var fs_extra=require(_0xb7e3('0xb'));var _=require('lodash');var squel=require(_0xb7e3('0xc'));var crypto=require('crypto');var jsforce=require(_0xb7e3('0xd'));var deskjs=require(_0xb7e3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb7e3('0xf'));var Papa=require('papaparse');var Redis=require(_0xb7e3('0x10'));var authService=require(_0xb7e3('0x11'));var qs=require(_0xb7e3('0x12'));var as=require(_0xb7e3('0x13'));var hardwareService=require(_0xb7e3('0x14'));var logger=require(_0xb7e3('0x15'))(_0xb7e3('0x16'));var utils=require('../../config/utils');var config=require(_0xb7e3('0x17'));var licenseUtil=require(_0xb7e3('0x18'));var db=require(_0xb7e3('0x19'))['db'];config['redis']=_[_0xb7e3('0x1a')](config[_0xb7e3('0x1b')],{'host':_0xb7e3('0x1c'),'port':0x18eb});var socket=require(_0xb7e3('0x1d'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0xb7e3('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb7e3('0x1f')][_0xb7e3('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x4eec1e,_0x101c2f,_0x18958a,_0x4a1ab0){return new BPromise(function(_0x4aaa9a,_0x18511a){var _0x250305=_0x4a1ab0||client;return _0x250305[_0xb7e3('0x21')](_0x4eec1e,_0x18958a)[_0xb7e3('0x22')](function(_0x1432e7){logger[_0xb7e3('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x101c2f,_0xb7e3('0x24'));logger['debug'](_0xb7e3('0x25'),_0x101c2f,_0xb7e3('0x24'),JSON['stringify'](_0x1432e7));if(_0x1432e7[_0xb7e3('0x26')]){if(_0x1432e7[_0xb7e3('0x26')][_0xb7e3('0x27')]===0x1f4){logger['error'](_0xb7e3('0x28'),_0x101c2f,_0x1432e7[_0xb7e3('0x26')][_0xb7e3('0x29')]);return _0x18511a(_0x1432e7[_0xb7e3('0x26')][_0xb7e3('0x29')]);}logger[_0xb7e3('0x26')](_0xb7e3('0x28'),_0x101c2f,_0x1432e7['error']['message']);return _0x4aaa9a(_0x1432e7[_0xb7e3('0x26')]['message']);}else{logger[_0xb7e3('0x23')](_0xb7e3('0x28'),_0x101c2f,_0xb7e3('0x24'));_0x4aaa9a(_0x1432e7['result']['message']);}})[_0xb7e3('0x2a')](function(_0x142566){logger[_0xb7e3('0x26')](_0xb7e3('0x28'),_0x101c2f,_0x142566);_0x18511a(_0x142566);});});}function respondWithStatusCode(_0x1aa5aa,_0x46212e){_0x46212e=_0x46212e||0xcc;return function(_0x90879c){if(_0x90879c){return _0x1aa5aa[_0xb7e3('0x2b')](_0x46212e);}return _0x1aa5aa['status'](_0x46212e)[_0xb7e3('0x2c')]();};}function respondWithResult(_0x328f31,_0x5626cb){_0x5626cb=_0x5626cb||0xc8;return function(_0x1cbeb8){if(_0x1cbeb8){return _0x328f31[_0xb7e3('0x2d')](_0x5626cb)['json'](_0x1cbeb8);}};}function respondWithFilteredResult(_0x2ff32e,_0x53475f){return function(_0x579f81){if(_0x579f81){var _0xb0fa39=typeof _0x53475f[_0xb7e3('0x2e')]===_0xb7e3('0x2f')&&typeof _0x53475f[_0xb7e3('0x30')]==='undefined';var _0x51685d=_0x579f81[_0xb7e3('0x31')];var _0x3f5440=_0xb0fa39?0x0:_0x53475f[_0xb7e3('0x2e')];var _0x267ee7=_0xb0fa39?_0x579f81[_0xb7e3('0x31')]:_0x53475f[_0xb7e3('0x2e')]+_0x53475f[_0xb7e3('0x30')];var _0x4852f6;if(_0x267ee7>=_0x51685d){_0x267ee7=_0x51685d;_0x4852f6=0xc8;}else{_0x4852f6=0xce;}_0x2ff32e[_0xb7e3('0x2d')](_0x4852f6);return _0x2ff32e[_0xb7e3('0x32')](_0xb7e3('0x33'),_0x3f5440+'-'+_0x267ee7+'/'+_0x51685d)[_0xb7e3('0x34')](_0x579f81);}return null;};}function patchUpdates(_0x523cf9){return function(_0x87eeff){try{jsonpatch[_0xb7e3('0x35')](_0x87eeff,_0x523cf9,!![]);}catch(_0x5a0f10){return BPromise['reject'](_0x5a0f10);}return _0x87eeff[_0xb7e3('0x36')]();};}function saveUpdates(_0x49a9d1,_0x41492d){return function(_0x4409d9){if(_0x4409d9){return _0x4409d9[_0xb7e3('0x37')](_0x49a9d1)['then'](function(_0xaa036b){return _0xaa036b;});}return null;};}function removeEntity(_0xe9785a,_0x39052c){return function(_0x1f0af6){if(_0x1f0af6){return _0x1f0af6[_0xb7e3('0x38')]()[_0xb7e3('0x22')](function(){var _0x3bc02a=_0x1f0af6['get']({'plain':!![]});var _0x5168b4='WhatsappAccounts';return db[_0xb7e3('0x39')][_0xb7e3('0x38')]({'where':{'type':_0x5168b4,'resourceId':_0x3bc02a['id']}})[_0xb7e3('0x22')](function(){return _0x1f0af6;});})[_0xb7e3('0x22')](function(){_0xe9785a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31e601,_0x42516f){return function(_0x2b8a6a){if(!_0x2b8a6a){_0x31e601[_0xb7e3('0x2b')](0x194);}return _0x2b8a6a;};}function handleError(_0x2d5bd0,_0x35b6a7){_0x35b6a7=_0x35b6a7||0x1f4;return function(_0x4e26a5){logger[_0xb7e3('0x26')](_0x4e26a5[_0xb7e3('0x3a')]);if(_0x4e26a5[_0xb7e3('0x3b')]){delete _0x4e26a5[_0xb7e3('0x3b')];}_0x2d5bd0[_0xb7e3('0x2d')](_0x35b6a7)['send'](_0x4e26a5);};}exports[_0xb7e3('0x3c')]=function(_0x56b9ad,_0x3bb69c){var _0x5f38ef={'include':[{'model':db[_0xb7e3('0x3d')],'as':_0xb7e3('0x3e')}]},_0x17acc2={},_0x284ccd={'count':0x0,'rows':[]};var _0xda8274=_['map'](db['WhatsappAccount'][_0xb7e3('0x3f')],function(_0x254b58){return{'name':_0x254b58[_0xb7e3('0x40')],'type':_0x254b58['type'][_0xb7e3('0x41')]};});_0x17acc2['model']=_[_0xb7e3('0x42')](_0xda8274,'name');_0x17acc2[_0xb7e3('0x43')]=_[_0xb7e3('0x44')](_0x56b9ad[_0xb7e3('0x43')]);_0x17acc2[_0xb7e3('0x45')]=_['intersection'](_0x17acc2[_0xb7e3('0x46')],_0x17acc2[_0xb7e3('0x43')]);_0x5f38ef[_0xb7e3('0x47')]=_['intersection'](_0x17acc2[_0xb7e3('0x46')],qs['fields'](_0x56b9ad[_0xb7e3('0x43')]['fields']));_0x5f38ef[_0xb7e3('0x47')]=_0x5f38ef[_0xb7e3('0x47')][_0xb7e3('0x48')]?_0x5f38ef[_0xb7e3('0x47')]:_0x17acc2[_0xb7e3('0x46')];if(!_0x56b9ad['query'][_0xb7e3('0x49')]('nolimit')){_0x5f38ef[_0xb7e3('0x30')]=qs[_0xb7e3('0x30')](_0x56b9ad[_0xb7e3('0x43')]['limit']);_0x5f38ef[_0xb7e3('0x2e')]=qs[_0xb7e3('0x2e')](_0x56b9ad['query'][_0xb7e3('0x2e')]);}_0x5f38ef[_0xb7e3('0x4a')]=qs['sort'](_0x56b9ad[_0xb7e3('0x43')]['sort']);_0x5f38ef[_0xb7e3('0x4b')]=qs['filters'](_[_0xb7e3('0x4c')](_0x56b9ad[_0xb7e3('0x43')],_0x17acc2[_0xb7e3('0x45')]),_0xda8274);if(_0x56b9ad['query'][_0xb7e3('0x4d')]){_0x5f38ef[_0xb7e3('0x4b')]=_[_0xb7e3('0x4e')](_0x5f38ef['where'],{'$or':_[_0xb7e3('0x42')](_0xda8274,function(_0x4d1b75){if(_0x4d1b75['type']!=='VIRTUAL'){var _0x1d2572={};_0x1d2572[_0x4d1b75['name']]={'$like':'%'+_0x56b9ad['query'][_0xb7e3('0x4d')]+'%'};return _0x1d2572;}})});}_0x5f38ef=_['merge']({},_0x5f38ef,_0x56b9ad[_0xb7e3('0x4f')]);var _0x67381b={'where':_0x5f38ef[_0xb7e3('0x4b')]};return db['WhatsappAccount'][_0xb7e3('0x31')](_0x67381b)[_0xb7e3('0x22')](function(_0x2c9e82){_0x284ccd['count']=_0x2c9e82;if(_0x56b9ad[_0xb7e3('0x43')]['includeAll']){_0x5f38ef[_0xb7e3('0x50')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xb7e3('0x51')](_0x5f38ef);})[_0xb7e3('0x22')](function(_0x83ed9b){_0x284ccd['rows']=_0x83ed9b;return _0x284ccd;})['then'](respondWithFilteredResult(_0x3bb69c,_0x5f38ef))[_0xb7e3('0x2a')](handleError(_0x3bb69c,null));};exports['show']=function(_0x2c7d16,_0x486f22){var _0xe13d4f={'raw':![],'where':{'id':_0x2c7d16[_0xb7e3('0x52')]['id']},'include':[{'model':db['Pause'],'as':_0xb7e3('0x3e')}]},_0x24b0d6={};_0x24b0d6[_0xb7e3('0x46')]=_[_0xb7e3('0x44')](db[_0xb7e3('0x53')]['rawAttributes']);_0x24b0d6[_0xb7e3('0x43')]=_[_0xb7e3('0x44')](_0x2c7d16['query']);_0x24b0d6['filters']=_['intersection'](_0x24b0d6[_0xb7e3('0x46')],_0x24b0d6[_0xb7e3('0x43')]);_0xe13d4f['attributes']=_[_0xb7e3('0x54')](_0x24b0d6[_0xb7e3('0x46')],qs[_0xb7e3('0x55')](_0x2c7d16['query']['fields']));_0xe13d4f['attributes']=_0xe13d4f['attributes'][_0xb7e3('0x48')]?_0xe13d4f['attributes']:_0x24b0d6[_0xb7e3('0x46')];if(_0x2c7d16[_0xb7e3('0x43')][_0xb7e3('0x56')]){_0xe13d4f[_0xb7e3('0x50')]=[{'all':!![]}];}_0xe13d4f=_[_0xb7e3('0x4e')]({},_0xe13d4f,_0x2c7d16['options']);return db['WhatsappAccount'][_0xb7e3('0x57')](_0xe13d4f)[_0xb7e3('0x22')](handleEntityNotFound(_0x486f22,null))[_0xb7e3('0x22')](respondWithResult(_0x486f22,null))[_0xb7e3('0x2a')](handleError(_0x486f22,null));};exports[_0xb7e3('0x58')]=function(_0x3e53c6,_0x5ecf43){return db['WhatsappAccount']['create'](_0x3e53c6[_0xb7e3('0x59')],{})[_0xb7e3('0x22')](function(_0x408f89){var _0x1f994d=_0x3e53c6[_0xb7e3('0x5a')][_0xb7e3('0x5b')]({'plain':!![]});if(!_0x1f994d)throw new Error(_0xb7e3('0x5c'));if(_0x1f994d[_0xb7e3('0x5d')]===_0xb7e3('0x5a')){var _0x47a609=_0x408f89[_0xb7e3('0x5b')]({'plain':!![]});var _0x3f382b=_0xb7e3('0x5e');return db[_0xb7e3('0x5f')][_0xb7e3('0x57')]({'where':{'name':_0x3f382b,'userProfileId':_0x1f994d[_0xb7e3('0x60')]},'raw':!![]})[_0xb7e3('0x22')](function(_0x166034){if(_0x166034&&_0x166034['autoAssociation']===0x0){return db[_0xb7e3('0x39')][_0xb7e3('0x58')]({'name':_0x47a609['name'],'resourceId':_0x47a609['id'],'type':_0x166034[_0xb7e3('0x3b')],'sectionId':_0x166034['id']},{})[_0xb7e3('0x22')](function(){return _0x408f89;});}else{return _0x408f89;}})[_0xb7e3('0x2a')](function(_0x59bc80){logger[_0xb7e3('0x26')](_0xb7e3('0x61'),_0x59bc80);throw _0x59bc80;});}return _0x408f89;})['then'](respondWithResult(_0x5ecf43,0xc9))['catch'](handleError(_0x5ecf43,null));};exports[_0xb7e3('0x37')]=function(_0x767ed3,_0x4634a1){if(_0x767ed3['body']['id']){delete _0x767ed3[_0xb7e3('0x59')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x767ed3[_0xb7e3('0x52')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xb7e3('0x22')](handleEntityNotFound(_0x4634a1,null))[_0xb7e3('0x22')](saveUpdates(_0x767ed3['body'],null))[_0xb7e3('0x22')](respondWithResult(_0x4634a1,null))[_0xb7e3('0x2a')](handleError(_0x4634a1,null));};exports['destroy']=function(_0x22cf92,_0x1d7543){return db[_0xb7e3('0x53')][_0xb7e3('0x57')]({'where':{'id':_0x22cf92[_0xb7e3('0x52')]['id']}})['then'](handleEntityNotFound(_0x1d7543,null))[_0xb7e3('0x22')](removeEntity(_0x1d7543,null))[_0xb7e3('0x2a')](handleError(_0x1d7543,null));};exports['describe']=function(_0x521334,_0x3ac7b6){return db[_0xb7e3('0x53')][_0xb7e3('0x62')]()[_0xb7e3('0x22')](respondWithResult(_0x3ac7b6,null))[_0xb7e3('0x2a')](handleError(_0x3ac7b6,null));};exports['addDisposition']=function(_0x7a75ef,_0xf53a6c,_0x2249f2){if(_0x7a75ef['body']['id']){delete _0x7a75ef[_0xb7e3('0x59')]['id'];}return db[_0xb7e3('0x53')]['find']({'where':{'id':_0x7a75ef['params']['id']}})[_0xb7e3('0x22')](handleEntityNotFound(_0xf53a6c,null))[_0xb7e3('0x22')](function(_0x584549){if(_0x584549){_0x7a75ef[_0xb7e3('0x59')]['WhatsappAccountId']=_0x584549['id'];return db[_0xb7e3('0x63')][_0xb7e3('0x58')](_0x7a75ef[_0xb7e3('0x59')]);}})['then'](respondWithResult(_0xf53a6c,null))['catch'](handleError(_0xf53a6c,null));};exports[_0xb7e3('0x64')]=function(_0x370519,_0x55983c,_0x158d7b){var _0x11ce1b={'raw':![],'where':{}};var _0x11519c={};var _0x569d11={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x370519['params']['id']}})[_0xb7e3('0x22')](handleEntityNotFound(_0x55983c,null))[_0xb7e3('0x22')](function(_0x22c86a){if(_0x22c86a){_0x11519c[_0xb7e3('0x46')]=_[_0xb7e3('0x44')](db[_0xb7e3('0x63')][_0xb7e3('0x3f')]);_0x11519c[_0xb7e3('0x43')]=_['keys'](_0x370519[_0xb7e3('0x43')]);_0x11519c[_0xb7e3('0x45')]=_[_0xb7e3('0x54')](_0x11519c[_0xb7e3('0x46')],_0x11519c[_0xb7e3('0x43')]);_0x11ce1b['attributes']=_['intersection'](_0x11519c[_0xb7e3('0x46')],qs[_0xb7e3('0x55')](_0x370519[_0xb7e3('0x43')][_0xb7e3('0x55')]));_0x11ce1b['attributes']=_0x11ce1b[_0xb7e3('0x47')][_0xb7e3('0x48')]?_0x11ce1b[_0xb7e3('0x47')]:_0x11519c[_0xb7e3('0x46')];if(!_0x370519[_0xb7e3('0x43')]['hasOwnProperty']('nolimit')){_0x11ce1b[_0xb7e3('0x30')]=qs['limit'](_0x370519[_0xb7e3('0x43')][_0xb7e3('0x30')]);_0x11ce1b[_0xb7e3('0x2e')]=qs[_0xb7e3('0x2e')](_0x370519[_0xb7e3('0x43')]['offset']);}_0x11ce1b[_0xb7e3('0x4a')]=qs[_0xb7e3('0x65')](_0x370519[_0xb7e3('0x43')]['sort']);_0x11ce1b[_0xb7e3('0x4b')]=qs['filters'](_[_0xb7e3('0x4c')](_0x370519[_0xb7e3('0x43')],_0x11519c['filters']));_0x11ce1b[_0xb7e3('0x4b')]['WhatsappAccountId']=_0x22c86a['id'];if(_0x370519[_0xb7e3('0x43')][_0xb7e3('0x4d')]){_0x11ce1b[_0xb7e3('0x4b')]=_[_0xb7e3('0x4e')](_0x11ce1b[_0xb7e3('0x4b')],{'$or':_[_0xb7e3('0x42')](_0x11ce1b[_0xb7e3('0x47')],function(_0x1a04b4){var _0x4cd1ae={};_0x4cd1ae[_0x1a04b4]={'$like':'%'+_0x370519['query'][_0xb7e3('0x4d')]+'%'};return _0x4cd1ae;})});}_0x11ce1b=_[_0xb7e3('0x4e')]({},_0x11ce1b,_0x370519['options']);return db[_0xb7e3('0x63')][_0xb7e3('0x31')]({'where':_0x11ce1b['where']})[_0xb7e3('0x22')](function(_0x3f6ce8){_0x569d11[_0xb7e3('0x31')]=_0x3f6ce8;if(_0x370519[_0xb7e3('0x43')][_0xb7e3('0x56')]){_0x11ce1b['include']=[{'all':!![]}];}return db[_0xb7e3('0x63')]['findAll'](_0x11ce1b);})['then'](function(_0x51378d){_0x569d11['rows']=_0x51378d;return _0x569d11;});}})[_0xb7e3('0x22')](respondWithFilteredResult(_0x55983c,_0x11ce1b))[_0xb7e3('0x2a')](handleError(_0x55983c,null));};exports[_0xb7e3('0x66')]=function(_0x4ee7cc,_0x2e0fc3,_0x11948a){return db[_0xb7e3('0x53')][_0xb7e3('0x57')]({'where':{'id':_0x4ee7cc['params']['id']}})[_0xb7e3('0x22')](handleEntityNotFound(_0x2e0fc3,null))[_0xb7e3('0x22')](function(_0x1a2008){if(_0x1a2008){return _0x1a2008['removeDispositions'](_0x4ee7cc[_0xb7e3('0x43')][_0xb7e3('0x67')]);}})[_0xb7e3('0x22')](respondWithStatusCode(_0x2e0fc3,null))[_0xb7e3('0x2a')](handleError(_0x2e0fc3,null));};exports[_0xb7e3('0x68')]=function(_0x5e1b23,_0x515647,_0x560e01){if(_0x5e1b23[_0xb7e3('0x59')]['id']){delete _0x5e1b23[_0xb7e3('0x59')]['id'];}return db['WhatsappAccount'][_0xb7e3('0x57')]({'where':{'id':_0x5e1b23[_0xb7e3('0x52')]['id']}})['then'](handleEntityNotFound(_0x515647,null))[_0xb7e3('0x22')](function(_0x3d57ba){if(_0x3d57ba){_0x5e1b23['body'][_0xb7e3('0x69')]=_0x3d57ba['id'];return db[_0xb7e3('0x6a')]['create'](_0x5e1b23[_0xb7e3('0x59')]);}})['then'](respondWithResult(_0x515647,null))[_0xb7e3('0x2a')](handleError(_0x515647,null));};exports['getAnswers']=function(_0x304815,_0x387afe,_0x21df5a){var _0x119012={'raw':![],'where':{}};var _0x993a9d={};var _0x195c24={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x304815[_0xb7e3('0x52')]['id']}})[_0xb7e3('0x22')](handleEntityNotFound(_0x387afe,null))[_0xb7e3('0x22')](function(_0xbbbbc0){if(_0xbbbbc0){_0x993a9d[_0xb7e3('0x46')]=_[_0xb7e3('0x44')](db[_0xb7e3('0x6a')]['rawAttributes']);_0x993a9d['query']=_[_0xb7e3('0x44')](_0x304815[_0xb7e3('0x43')]);_0x993a9d['filters']=_[_0xb7e3('0x54')](_0x993a9d['model'],_0x993a9d[_0xb7e3('0x43')]);_0x119012['attributes']=_[_0xb7e3('0x54')](_0x993a9d[_0xb7e3('0x46')],qs[_0xb7e3('0x55')](_0x304815[_0xb7e3('0x43')][_0xb7e3('0x55')]));_0x119012[_0xb7e3('0x47')]=_0x119012[_0xb7e3('0x47')][_0xb7e3('0x48')]?_0x119012['attributes']:_0x993a9d[_0xb7e3('0x46')];if(!_0x304815['query'][_0xb7e3('0x49')](_0xb7e3('0x6b'))){_0x119012[_0xb7e3('0x30')]=qs[_0xb7e3('0x30')](_0x304815[_0xb7e3('0x43')][_0xb7e3('0x30')]);_0x119012[_0xb7e3('0x2e')]=qs[_0xb7e3('0x2e')](_0x304815[_0xb7e3('0x43')][_0xb7e3('0x2e')]);}_0x119012[_0xb7e3('0x4a')]=qs[_0xb7e3('0x65')](_0x304815[_0xb7e3('0x43')][_0xb7e3('0x65')]);_0x119012['where']=qs[_0xb7e3('0x45')](_[_0xb7e3('0x4c')](_0x304815[_0xb7e3('0x43')],_0x993a9d[_0xb7e3('0x45')]));_0x119012[_0xb7e3('0x4b')][_0xb7e3('0x69')]=_0xbbbbc0['id'];if(_0x304815['query'][_0xb7e3('0x4d')]){_0x119012[_0xb7e3('0x4b')]=_[_0xb7e3('0x4e')](_0x119012[_0xb7e3('0x4b')],{'$or':_['map'](_0x119012[_0xb7e3('0x47')],function(_0xcc9ef1){var _0x23dbdb={};_0x23dbdb[_0xcc9ef1]={'$like':'%'+_0x304815[_0xb7e3('0x43')][_0xb7e3('0x4d')]+'%'};return _0x23dbdb;})});}_0x119012=_[_0xb7e3('0x4e')]({},_0x119012,_0x304815[_0xb7e3('0x4f')]);return db[_0xb7e3('0x6a')][_0xb7e3('0x31')]({'where':_0x119012['where']})[_0xb7e3('0x22')](function(_0x146c01){_0x195c24[_0xb7e3('0x31')]=_0x146c01;if(_0x304815[_0xb7e3('0x43')][_0xb7e3('0x56')]){_0x119012[_0xb7e3('0x50')]=[{'all':!![]}];}return db[_0xb7e3('0x6a')]['findAll'](_0x119012);})['then'](function(_0x2ce261){_0x195c24[_0xb7e3('0x6c')]=_0x2ce261;return _0x195c24;});}})[_0xb7e3('0x22')](respondWithFilteredResult(_0x387afe,_0x119012))['catch'](handleError(_0x387afe,null));};exports[_0xb7e3('0x6d')]=function(_0x2c45d7,_0x2c5bcf,_0x18d754){return db[_0xb7e3('0x53')][_0xb7e3('0x57')]({'where':{'id':_0x2c45d7[_0xb7e3('0x52')]['id']}})[_0xb7e3('0x22')](handleEntityNotFound(_0x2c5bcf,null))[_0xb7e3('0x22')](function(_0x3fb3d1){if(_0x3fb3d1){return _0x3fb3d1[_0xb7e3('0x6d')](_0x2c45d7['query'][_0xb7e3('0x67')]);}})['then'](respondWithStatusCode(_0x2c5bcf,null))['catch'](handleError(_0x2c5bcf,null));};exports['addAgents']=function(_0x239e43,_0x52329b,_0x4e16d7){return db[_0xb7e3('0x53')][_0xb7e3('0x57')]({'where':{'id':_0x239e43[_0xb7e3('0x52')]['id']}})[_0xb7e3('0x22')](handleEntityNotFound(_0x52329b,null))['then'](function(_0x48e776){if(_0x48e776){return _0x48e776[_0xb7e3('0x6e')](_0x239e43[_0xb7e3('0x59')]['ids'],_['omit'](_0x239e43[_0xb7e3('0x59')],[_0xb7e3('0x67'),'id'])||{})[_0xb7e3('0x6f')](function(_0x5c8175){for(var _0x142181=0x0;_0x142181<_0x239e43[_0xb7e3('0x59')][_0xb7e3('0x67')][_0xb7e3('0x48')];_0x142181+=0x1){socket[_0xb7e3('0x70')](_0xb7e3('0x71'),{'UserId':Number(_0x239e43['body'][_0xb7e3('0x67')][_0x142181]),'WhatsappAccountId':Number(_0x239e43[_0xb7e3('0x52')]['id'])});}return _0x5c8175;});}})[_0xb7e3('0x22')](respondWithResult(_0x52329b,null))[_0xb7e3('0x2a')](handleError(_0x52329b,null));};exports[_0xb7e3('0x72')]=function(_0xa608d2,_0x538bdb,_0x233b8d){return db[_0xb7e3('0x53')][_0xb7e3('0x57')]({'where':{'id':_0xa608d2[_0xb7e3('0x52')]['id']}})[_0xb7e3('0x22')](handleEntityNotFound(_0x538bdb,null))[_0xb7e3('0x22')](function(_0x207971){if(_0x207971){return _0x207971['removeAgents'](_0xa608d2[_0xb7e3('0x43')]['ids'])['then'](function(){if(_[_0xb7e3('0x73')](_0xa608d2[_0xb7e3('0x43')]['ids'])){for(var _0x458519=0x0;_0x458519<_0xa608d2[_0xb7e3('0x43')]['ids']['length'];_0x458519+=0x1){socket[_0xb7e3('0x70')](_0xb7e3('0x74'),{'UserId':Number(_0xa608d2[_0xb7e3('0x43')][_0xb7e3('0x67')][_0x458519]),'WhatsappAccountId':Number(_0xa608d2[_0xb7e3('0x52')]['id'])});}}else{socket['emit'](_0xb7e3('0x74'),{'UserId':Number(_0xa608d2['query'][_0xb7e3('0x67')]),'WhatsappAccountId':Number(_0xa608d2[_0xb7e3('0x52')]['id'])});}});}})[_0xb7e3('0x22')](respondWithStatusCode(_0x538bdb,null))[_0xb7e3('0x2a')](handleError(_0x538bdb,null));};exports[_0xb7e3('0x75')]=function(_0x38a496,_0x15022a,_0x182377){var _0x16e65b={};var _0x49d2c0={};var _0x4e9a2d;var _0x540236;return db[_0xb7e3('0x53')][_0xb7e3('0x76')]({'where':{'id':_0x38a496[_0xb7e3('0x52')]['id']}})[_0xb7e3('0x22')](handleEntityNotFound(_0x15022a,null))[_0xb7e3('0x22')](function(_0x9d8022){if(_0x9d8022){_0x4e9a2d=_0x9d8022;_0x49d2c0['model']=_[_0xb7e3('0x44')](db[_0xb7e3('0x77')]['rawAttributes']);_0x49d2c0[_0xb7e3('0x43')]=_[_0xb7e3('0x44')](_0x38a496[_0xb7e3('0x43')]);_0x49d2c0[_0xb7e3('0x45')]=_[_0xb7e3('0x54')](_0x49d2c0[_0xb7e3('0x46')],_0x49d2c0[_0xb7e3('0x43')]);_0x16e65b['attributes']=_[_0xb7e3('0x54')](_0x49d2c0[_0xb7e3('0x46')],qs[_0xb7e3('0x55')](_0x38a496[_0xb7e3('0x43')][_0xb7e3('0x55')]));_0x16e65b[_0xb7e3('0x47')]=_0x16e65b['attributes'][_0xb7e3('0x48')]?_0x16e65b['attributes']:_0x49d2c0['model'];_0x16e65b[_0xb7e3('0x4a')]=qs[_0xb7e3('0x65')](_0x38a496['query']['sort']);_0x16e65b[_0xb7e3('0x4b')]=qs[_0xb7e3('0x45')](_['pick'](_0x38a496[_0xb7e3('0x43')],_0x49d2c0[_0xb7e3('0x45')]));if(_0x38a496[_0xb7e3('0x43')]['filter']){_0x16e65b[_0xb7e3('0x4b')]=_[_0xb7e3('0x4e')](_0x16e65b['where'],{'$or':_[_0xb7e3('0x42')](_0x16e65b['attributes'],function(_0x216320){var _0x51fe21={};_0x51fe21[_0x216320]={'$like':'%'+_0x38a496[_0xb7e3('0x43')]['filter']+'%'};return _0x51fe21;})});}_0x16e65b=_['merge']({},_0x16e65b,_0x38a496[_0xb7e3('0x4f')]);return _0x4e9a2d[_0xb7e3('0x75')](_0x16e65b);}})[_0xb7e3('0x22')](function(_0x2f6f9e){if(_0x2f6f9e){_0x540236=_0x2f6f9e[_0xb7e3('0x48')];if(!_0x38a496[_0xb7e3('0x43')][_0xb7e3('0x49')](_0xb7e3('0x6b'))){_0x16e65b['limit']=qs[_0xb7e3('0x30')](_0x38a496['query'][_0xb7e3('0x30')]);_0x16e65b[_0xb7e3('0x2e')]=qs[_0xb7e3('0x2e')](_0x38a496[_0xb7e3('0x43')][_0xb7e3('0x2e')]);}return _0x4e9a2d['getAgents'](_0x16e65b);}})[_0xb7e3('0x22')](function(_0x25c9da){if(_0x25c9da){return _0x25c9da?{'count':_0x540236,'rows':_0x25c9da}:null;}})['then'](respondWithResult(_0x15022a,null))['catch'](handleError(_0x15022a,null));};exports[_0xb7e3('0x78')]=function(_0x196a7b,_0x328c20){var _0x4b9912=_0x196a7b[_0xb7e3('0x52')]['id'];var _0x219bcb=_0x196a7b[_0xb7e3('0x59')];var _0x48370a=0xc8;var _0x1941d7=null;return db[_0xb7e3('0x79')]['transaction']({'isolationLevel':db['sequelize'][_0xb7e3('0x7a')][_0xb7e3('0x7b')][_0xb7e3('0x7c')]},function(_0x16b72e){return db[_0xb7e3('0x53')][_0xb7e3('0x76')]({'where':{'id':_0x4b9912},'transaction':_0x16b72e})[_0xb7e3('0x22')](function(_0x2b332c){if(_0x2b332c){return db[_0xb7e3('0x7d')][_0xb7e3('0x38')]({'where':{'WhatsappAccountId':_0x4b9912},'transaction':_0x16b72e})[_0xb7e3('0x22')](function(){var _0x2f7495=_[_0xb7e3('0x42')](_0x219bcb,function(_0x62eb1e){_0x62eb1e[_0xb7e3('0x69')]=_0x4b9912;return _0x62eb1e;});return db[_0xb7e3('0x7d')][_0xb7e3('0x7e')](_0x2f7495,{'transaction':_0x16b72e});});}else{_0x48370a=0x194;_0x1941d7=[];}});})[_0xb7e3('0x22')](function(){if(_0x48370a!==0x194){return db['WhatsappApplication'][_0xb7e3('0x7f')]({'where':{'WhatsappAccountId':_0x4b9912},'order':_0xb7e3('0x80')})[_0xb7e3('0x22')](function(_0x4995b2){_0x1941d7=_0x4995b2;});}})['catch'](function(_0x37557d){_0x48370a=0x1f4;logger[_0xb7e3('0x26')](_0x37557d[_0xb7e3('0x3a')]);if(_0x37557d['name']){delete _0x37557d[_0xb7e3('0x3b')];}_0x1941d7=_0x37557d;})[_0xb7e3('0x81')](function(){if(_0x1941d7===null){_0x328c20[_0xb7e3('0x2b')](_0x48370a);}else{if(_0x48370a===0x1f4){_0x328c20[_0xb7e3('0x2d')](_0x48370a)[_0xb7e3('0x82')](_0x1941d7);}else{_0x328c20[_0xb7e3('0x2d')](_0x48370a)['json'](_0x1941d7);}}});};exports[_0xb7e3('0x83')]=function(_0x52e3d0,_0x483859,_0x153b4c){var _0x941403={};var _0xc6270={};var _0x49d5b3;var _0x3b9734;return db[_0xb7e3('0x53')][_0xb7e3('0x76')]({'where':{'id':_0x52e3d0[_0xb7e3('0x52')]['id']}})[_0xb7e3('0x22')](handleEntityNotFound(_0x483859,null))[_0xb7e3('0x22')](function(_0x4c4075){if(_0x4c4075){_0x49d5b3=_0x4c4075;_0xc6270['model']=_[_0xb7e3('0x44')](db[_0xb7e3('0x7d')][_0xb7e3('0x3f')]);_0xc6270['query']=_['keys'](_0x52e3d0[_0xb7e3('0x43')]);_0xc6270[_0xb7e3('0x45')]=_[_0xb7e3('0x54')](_0xc6270[_0xb7e3('0x46')],_0xc6270[_0xb7e3('0x43')]);_0x941403[_0xb7e3('0x47')]=_[_0xb7e3('0x54')](_0xc6270[_0xb7e3('0x46')],qs['fields'](_0x52e3d0[_0xb7e3('0x43')][_0xb7e3('0x55')]));_0x941403[_0xb7e3('0x47')]=_0x941403['attributes'][_0xb7e3('0x48')]?_0x941403[_0xb7e3('0x47')]:_0xc6270[_0xb7e3('0x46')];_0x941403[_0xb7e3('0x4a')]=qs[_0xb7e3('0x65')](_0x52e3d0[_0xb7e3('0x43')][_0xb7e3('0x65')]);_0x941403[_0xb7e3('0x4b')]=qs['filters'](_[_0xb7e3('0x4c')](_0x52e3d0[_0xb7e3('0x43')],_0xc6270[_0xb7e3('0x45')]));if(_0x52e3d0[_0xb7e3('0x43')][_0xb7e3('0x4d')]){_0x941403[_0xb7e3('0x4b')]=_['merge'](_0x941403[_0xb7e3('0x4b')],{'$or':_[_0xb7e3('0x42')](_0x941403['attributes'],function(_0xd851bc){var _0x4b5e33={};_0x4b5e33[_0xd851bc]={'$like':'%'+_0x52e3d0[_0xb7e3('0x43')][_0xb7e3('0x4d')]+'%'};return _0x4b5e33;})});}_0x941403=_[_0xb7e3('0x4e')]({},_0x941403,_0x52e3d0[_0xb7e3('0x4f')]);return _0x49d5b3['getApplications'](_0x941403);}})[_0xb7e3('0x22')](function(_0x223cbe){if(_0x223cbe){_0x3b9734=_0x223cbe[_0xb7e3('0x48')];if(!_0x52e3d0[_0xb7e3('0x43')][_0xb7e3('0x49')](_0xb7e3('0x6b'))){_0x941403[_0xb7e3('0x30')]=qs[_0xb7e3('0x30')](_0x52e3d0['query'][_0xb7e3('0x30')]);_0x941403[_0xb7e3('0x2e')]=qs['offset'](_0x52e3d0['query'][_0xb7e3('0x2e')]);}return _0x49d5b3[_0xb7e3('0x83')](_0x941403);}})['then'](function(_0x3e246a){if(_0x3e246a){return _0x3e246a?{'count':_0x3b9734,'rows':_0x3e246a}:null;}})[_0xb7e3('0x22')](respondWithResult(_0x483859,null))[_0xb7e3('0x2a')](handleError(_0x483859,null));};exports[_0xb7e3('0x84')]=function(_0x55c74b,_0x1183af,_0x432de0){var _0x11933d={'channel':_0xb7e3('0x85')};var _0x3ab234=[];var _0x36a227=[];var _0x3046a5={};return db[_0xb7e3('0x53')][_0xb7e3('0x57')]({'where':{'id':_0x55c74b[_0xb7e3('0x52')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xb7e3('0x86')}]})[_0xb7e3('0x22')](handleEntityNotFound(_0x1183af,null))[_0xb7e3('0x22')](function(_0x21e724){_0x11933d['account']=_0x21e724;if(_0x11933d[_0xb7e3('0x87')]&&_0x11933d[_0xb7e3('0x87')]['type']==='sinch'&&_0x55c74b[_0xb7e3('0x59')][_0xb7e3('0x88')]){if(_0x55c74b[_0xb7e3('0x59')][_0xb7e3('0x88')][_0xb7e3('0x48')]===0x0)return;if(_0x55c74b[_0xb7e3('0x59')][_0xb7e3('0x88')][0x0][_0xb7e3('0x89')]!=='read')return;return db[_0xb7e3('0x8a')]['update']({'read':!![],'readAt':_0x55c74b[_0xb7e3('0x59')][_0xb7e3('0x88')][0x0][_0xb7e3('0x8b')]},{'where':{'messageId':_0x55c74b['body'][_0xb7e3('0x88')][0x0][_0xb7e3('0x8c')]},'individualHooks':!![]})[_0xb7e3('0x22')](function(_0x483570){return _0x1183af[_0xb7e3('0x2d')](0xc8)[_0xb7e3('0x34')](_0x483570);});}_0x11933d[_0xb7e3('0x8d')]=_[_0xb7e3('0x8e')](_0x21e724['Applications'],[_0xb7e3('0x80')],[_0xb7e3('0x8f')]);if(_0x11933d[_0xb7e3('0x87')][_0xb7e3('0x86')]){delete _0x11933d[_0xb7e3('0x87')]['Applications'];}return db[_0xb7e3('0x90')]['describe']()[_0xb7e3('0x22')](function(_0x28315b){if(!_0x28315b){throw new db['Sequelize'][(_0xb7e3('0x91'))](_0xb7e3('0x92'));}_0x3ab234=_[_0xb7e3('0x93')](_['keys'](_0x28315b),[_0xb7e3('0x94'),_0xb7e3('0x95')]);_0x36a227=_[_0xb7e3('0x93')](_[_0xb7e3('0x44')](_0x28315b),[_0xb7e3('0x94'),_0xb7e3('0x95'),_0xb7e3('0x96'),_0xb7e3('0x97')]);_0x11933d[_0xb7e3('0x59')]={'mapKey':_0xb7e3('0x98')};if(_0x11933d[_0xb7e3('0x87')]&&_0x11933d[_0xb7e3('0x87')][_0xb7e3('0x99')]===_0xb7e3('0x9a')){_0x11933d[_0xb7e3('0x59')][_0xb7e3('0x9b')]=_0x55c74b[_0xb7e3('0x59')][_0xb7e3('0x9c')][_0xb7e3('0x9d')](_0xb7e3('0x9e'),'');_0x11933d['body']['body']=_0x55c74b[_0xb7e3('0x59')][_0xb7e3('0x9f')];_0x11933d[_0xb7e3('0x59')]['messageId']=_0x55c74b[_0xb7e3('0x59')][_0xb7e3('0xa0')];}if(_0x11933d['account']&&_0x11933d[_0xb7e3('0x87')][_0xb7e3('0x99')]===_0xb7e3('0xa1')){_0x11933d[_0xb7e3('0x59')][_0xb7e3('0x9b')]=_0x55c74b['body'][_0xb7e3('0xa2')][0x0][_0xb7e3('0x9b')];_0x11933d[_0xb7e3('0x59')][_0xb7e3('0x59')]=_0x55c74b[_0xb7e3('0x59')][_0xb7e3('0xa2')][0x0]['message'][_0xb7e3('0x59')];_0x11933d['body'][_0xb7e3('0xa3')]=_0x55c74b[_0xb7e3('0x59')][_0xb7e3('0xa2')][0x0][_0xb7e3('0x8c')];}if(_0x11933d['body']['id']){delete _0x11933d[_0xb7e3('0x59')]['id'];}if(_[_0xb7e3('0xa4')](_0x11933d[_0xb7e3('0x59')]['from'])){throw new db[(_0xb7e3('0xa5'))][(_0xb7e3('0x91'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x11933d[_0xb7e3('0x59')][_0xb7e3('0x59')])||_0x11933d['body'][_0xb7e3('0x59')]===''){throw new db[(_0xb7e3('0xa5'))][(_0xb7e3('0x91'))](_0xb7e3('0xa6'));}if(_[_0xb7e3('0xa4')](_0x11933d[_0xb7e3('0x59')][_0xb7e3('0xa7')])){throw new db[(_0xb7e3('0xa5'))][(_0xb7e3('0x91'))](_0xb7e3('0xa8')+_0x36a227);}if(!_[_0xb7e3('0xa9')](_0x36a227,_0x11933d[_0xb7e3('0x59')][_0xb7e3('0xa7')])){throw new db['Sequelize'][(_0xb7e3('0x91'))](_0xb7e3('0xaa')+_0x36a227);}_0x3046a5[_0x11933d[_0xb7e3('0x59')][_0xb7e3('0xa7')]]=_0x11933d['body'][_0xb7e3('0x9b')];return db['CmList'][_0xb7e3('0x57')]({'where':{'id':_0x11933d[_0xb7e3('0x87')]['ListId']},'include':[{'model':db[_0xb7e3('0x90')],'as':_0xb7e3('0xab'),'where':_0x3046a5,'limit':0x1,'order':[[_0xb7e3('0x95'),_0xb7e3('0xac')]]}]});})['then'](handleEntityNotFound(_0x1183af,null))['then'](function(_0x3a6b9b){if(_0x3a6b9b){_0x11933d[_0xb7e3('0xad')]=_[_0xb7e3('0xae')](_0x3a6b9b,['Contacts']);if(_0x3a6b9b[_0xb7e3('0xab')][_0xb7e3('0x48')]){return _0x3a6b9b[_0xb7e3('0xab')][0x0];}var _0x2e3955=_[_0xb7e3('0x1a')](_0x11933d['body'],{'firstName':_0x11933d[_0xb7e3('0x59')]['from'],'ListId':_0x3a6b9b['id']});_0x2e3955[_0x11933d[_0xb7e3('0x59')][_0xb7e3('0xa7')]]=_0x11933d['body']['from'];return db[_0xb7e3('0x90')][_0xb7e3('0x58')](_0x2e3955,{'fields':_0x3ab234,'raw':!![]});}})[_0xb7e3('0x22')](handleEntityNotFound(_0x1183af,null))[_0xb7e3('0x22')](function(_0x2d5b50){if(_0x2d5b50){_0x11933d['contact']=_0x2d5b50;var _0x38f213={'ContactId':_0x2d5b50['id'],'phone':_0x11933d[_0xb7e3('0x59')][_0xb7e3('0x9b')],'WhatsappAccountId':_0x55c74b['params']['id']};var _0x4a762a={'ContactId':_0x2d5b50['id'],'WhatsappAccountId':_0x55c74b[_0xb7e3('0x52')]['id'],'closed':![]};return db[_0xb7e3('0xaf')]['find']({'where':_0x4a762a})[_0xb7e3('0x22')](function(_0x3d15ac){if(_0x3d15ac){return[_0x3d15ac,![]];}return db['WhatsappInteraction']['create'](_0x38f213)[_0xb7e3('0x22')](function(_0xea817a){return[_0xea817a,!![]];});});}})['spread'](function(_0x4869cf,_0x520cb5){_0x11933d[_0xb7e3('0xb0')]=_0x4869cf[_0xb7e3('0x5b')]({'plain':!![]});_0x11933d[_0xb7e3('0xb0')][_0xb7e3('0xb1')]=![];if(_0x520cb5){if(_0x11933d[_0xb7e3('0x87')][_0xb7e3('0xb2')]){_0x11933d[_0xb7e3('0x8d')][_0xb7e3('0xb3')]({'id':0x0,'priority':_0x11933d[_0xb7e3('0x8d')][_0xb7e3('0x48')]+0x1,'app':_0xb7e3('0xb4'),'appdata':_0xb7e3('0xb5'),'interval':_0xb7e3('0xb6')});}_0x11933d[_0xb7e3('0xb0')]['created']=!![];}return db[_0xb7e3('0x8a')]['create']({'phone':_0x11933d[_0xb7e3('0x59')]['from'],'messageId':_0x11933d[_0xb7e3('0x59')]['messageId'],'body':_0x11933d[_0xb7e3('0x59')][_0xb7e3('0x59')],'WhatsappAccountId':_0x55c74b[_0xb7e3('0x52')]['id'],'WhatsappInteractionId':_0x4869cf['id'],'direction':'in','ContactId':_0x4869cf[_0xb7e3('0xb7')],'AttachmentId':_0x11933d[_0xb7e3('0x59')][_0xb7e3('0xb8')]});})[_0xb7e3('0x22')](function(_0x7a9e7a){_0x11933d[_0xb7e3('0x29')]=_0x7a9e7a;if(!_0x11933d[_0xb7e3('0xb0')][_0xb7e3('0xb9')])return;return db[_0xb7e3('0x77')][_0xb7e3('0x57')]({'attributes':['id',_0xb7e3('0x3b')],'where':{'id':_0x11933d[_0xb7e3('0xb0')][_0xb7e3('0xb9')]}});})[_0xb7e3('0x22')](function(_0x49c0de){if(_0x49c0de){_0x11933d['applications'][_0xb7e3('0xba')]({'id':0x0,'priority':0x0,'app':_0xb7e3('0xbb'),'appdata':_0x49c0de['name']+','+(_0x11933d[_0xb7e3('0x87')][_0xb7e3('0xbc')]||0xa),'interval':_0xb7e3('0xb6')});}if(!_0x11933d[_0xb7e3('0xb0')][_0xb7e3('0xbd')])return;return db[_0xb7e3('0xbe')][_0xb7e3('0x57')]({'attributes':['id',_0xb7e3('0x3b')],'where':{'id':_0x11933d[_0xb7e3('0xb0')][_0xb7e3('0xbd')]}});})[_0xb7e3('0x22')](function(_0x25282b){if(_0x25282b){_0x11933d[_0xb7e3('0x8d')]['unshift']({'id':0x0,'priority':0x1,'app':_0xb7e3('0xbf'),'appdata':_0x25282b[_0xb7e3('0x3b')]+','+(_0x11933d[_0xb7e3('0x87')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xb7e3('0xc0'),_0xb7e3('0xc1'),_0x11933d);})[_0xb7e3('0x22')](function(_0x3df672){if(_0x3df672){var _0x27dcd2=0xc8;var _0x4e51c5=_0xb7e3('0xc2');logger['info'](_0xb7e3('0x25'),_0x4e51c5,_0x27dcd2,_0xb7e3('0xc3'));logger[_0xb7e3('0xc4')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x4e51c5,_0x27dcd2,_0xb7e3('0xc3'),JSON[_0xb7e3('0xc5')](_0x3df672));if(_0x11933d[_0xb7e3('0x87')]['type']===_0xb7e3('0x9a')){return _0x1183af[_0xb7e3('0x2d')](_0x27dcd2)[_0xb7e3('0x32')](_0xb7e3('0xc6'),_0xb7e3('0xc7'))['send'](_0xb7e3('0xc8'));}else{return _0x1183af['status'](_0x27dcd2)['json'](_0x3df672);}}});})[_0xb7e3('0x2a')](handleError(_0x1183af,null));};exports[_0xb7e3('0x82')]=function(_0xd89215,_0x53a2b0,_0x6cc90f){var _0x3cee73,_0x474a57,_0x4d5461;if(_[_0xb7e3('0xa4')](_0xd89215[_0xb7e3('0x59')]['body'])||_0xd89215['body'][_0xb7e3('0x59')]===''){throw new db[(_0xb7e3('0xa5'))][(_0xb7e3('0x91'))](_0xb7e3('0xa6'));}if(_[_0xb7e3('0xa4')](_0xd89215[_0xb7e3('0x59')]['to'])){throw new db[(_0xb7e3('0xa5'))][(_0xb7e3('0x91'))](_0xb7e3('0xc9'));}_0x3cee73=_0xd89215[_0xb7e3('0x59')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0xd89215[_0xb7e3('0x52')]['id']},'include':[{'model':db[_0xb7e3('0xca')],'as':_0xb7e3('0xcb'),'include':[{'model':db[_0xb7e3('0x90')],'as':_0xb7e3('0xab'),'where':{'mobile':_0x3cee73},'limit':0x1,'order':[[_0xb7e3('0x95'),_0xb7e3('0xac')]]}]}]})['then'](handleEntityNotFound(_0x53a2b0,null))['then'](function(_0xe97558){if(_0xe97558&&_0xe97558[_0xb7e3('0xcb')]){_0x474a57=_0xe97558[_0xb7e3('0x5b')]({'plain':!![]});if(_0x474a57['List']&&_0x474a57[_0xb7e3('0xcb')][_0xb7e3('0xab')][_0xb7e3('0x48')]){return _0x474a57[_0xb7e3('0xcb')]['Contacts'][0x0];}return db[_0xb7e3('0x90')][_0xb7e3('0x58')](_[_0xb7e3('0x1a')](_0xd89215[_0xb7e3('0x59')],{'firstName':_0x3cee73,'mobile':_0x3cee73,'phone':_0x3cee73,'ListId':_0x474a57['ListId']}));}})['then'](handleEntityNotFound(_0x53a2b0,null))[_0xb7e3('0x22')](function(_0x265f07){if(_0x265f07){_0x4d5461=_0x265f07;return db[_0xb7e3('0xaf')][_0xb7e3('0x57')]({'where':{'ContactId':_0x4d5461['id'],'closed':![],'WhatsappAccountId':_0x474a57['id']}})[_0xb7e3('0x22')](function(_0x2b185d){if(_0x2b185d){return[_0x2b185d,![]];}return db[_0xb7e3('0xaf')]['create']({'UserId':_0xd89215[_0xb7e3('0x5a')]['id'],'ContactId':_0x4d5461['id'],'WhatsappAccountId':_0x474a57['id'],'phone':_0x3cee73,'firstMsgDirection':_0xb7e3('0xcc'),'Messages':[_[_0xb7e3('0x4e')](_0xd89215[_0xb7e3('0x59')],{'read':![],'body':_0xd89215['body'][_0xb7e3('0x59')],'phone':_0x3cee73,'WhatsappAccountId':_0x474a57['id'],'UserId':_0xd89215[_0xb7e3('0x5a')]['id'],'ContactId':_0x4d5461['id']})]},{'include':[{'model':db[_0xb7e3('0x8a')],'as':_0xb7e3('0xcd')}]})[_0xb7e3('0x22')](function(_0x34d3b3){return[_0x34d3b3,!![]];});});}})[_0xb7e3('0x6f')](function(_0x1801ce,_0x33b29d){if(_0x33b29d){return _0x1801ce;}return db[_0xb7e3('0x8a')][_0xb7e3('0x58')](_['merge'](_0xd89215[_0xb7e3('0x59')],{'read':![],'body':_0xd89215['body'][_0xb7e3('0x59')],'phone':_0x3cee73,'WhatsappAccountId':_0x474a57['id'],'WhatsappInteractionId':_0x1801ce['id'],'UserId':_0xd89215[_0xb7e3('0x5a')]['id'],'ContactId':_0x4d5461['id']}))[_0xb7e3('0x22')](function(_0x2158d7){_0x1801ce[_0xb7e3('0xce')][_0xb7e3('0xcd')]=[];_0x1801ce[_0xb7e3('0xce')]['Messages'][_0xb7e3('0xb3')](_0x2158d7[_0xb7e3('0xce')]);return _0x1801ce;});})[_0xb7e3('0x22')](respondWithResult(_0x53a2b0,null))[_0xb7e3('0x2a')](handleError(_0x53a2b0,null));}; \ No newline at end of file +var _0x0e16=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','http','request','then','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','end','stack','name','send','Pause','map','WhatsappAccount','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','mandatoryDispositionPause','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','params','describe','WhatsappAccountId','Disposition','getDispositions','rows','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','ids','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','finally','getApplications','account','type','sinch','statuses','WhatsappMessage','message_id','orderBy','asc','Applications','CmContact','Sequelize','no\x20available\x20attributes','updatedAt','difference','CompanyId','ListId','mobile','twilio','from','whatsapp:','Body','MessageSid','notifications','messageId','isNil','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','omit','defaults','contact','WhatsappInteraction','interaction','autoclose','applications','push','unmanaged','created','AttachmentId','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','queueId','WhatsappQueue','waitForTheAssignedQueue','startRouting','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','DESC','out','dataValues','Messages','eml-format'];(function(_0x4ce213,_0x33f3de){var _0x572a87=function(_0xe0227c){while(--_0xe0227c){_0x4ce213['push'](_0x4ce213['shift']());}};_0x572a87(++_0x33f3de);}(_0x0e16,0x183));var _0x60e1=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x0e16[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0x60e1('0x0'));var rimraf=require(_0x60e1('0x1'));var zipdir=require(_0x60e1('0x2'));var jsonpatch=require(_0x60e1('0x3'));var rp=require(_0x60e1('0x4'));var moment=require(_0x60e1('0x5'));var BPromise=require(_0x60e1('0x6'));var Mustache=require(_0x60e1('0x7'));var util=require(_0x60e1('0x8'));var path=require(_0x60e1('0x9'));var sox=require(_0x60e1('0xa'));var csv=require(_0x60e1('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x60e1('0xc'));var _=require('lodash');var squel=require(_0x60e1('0xd'));var crypto=require(_0x60e1('0xe'));var jsforce=require(_0x60e1('0xf'));var deskjs=require(_0x60e1('0x10'));var toCsv=require(_0x60e1('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x60e1('0x11'));var authService=require(_0x60e1('0x12'));var qs=require(_0x60e1('0x13'));var as=require(_0x60e1('0x14'));var hardwareService=require(_0x60e1('0x15'));var logger=require(_0x60e1('0x16'))(_0x60e1('0x17'));var utils=require(_0x60e1('0x18'));var config=require(_0x60e1('0x19'));var licenseUtil=require(_0x60e1('0x1a'));var db=require(_0x60e1('0x1b'))['db'];config[_0x60e1('0x1c')]=_['defaults'](config[_0x60e1('0x1c')],{'host':_0x60e1('0x1d'),'port':0x18eb});var socket=require(_0x60e1('0x1e'))(new Redis(config[_0x60e1('0x1c')]));require(_0x60e1('0x1f'))['register'](socket);var jayson=require(_0x60e1('0x20'));var client=jayson['client'][_0x60e1('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x5979cc,_0x43b094,_0x1e782b,_0x4813e1){return new BPromise(function(_0x192f38,_0xa510f9){var _0xa6a09a=_0x4813e1||client;return _0xa6a09a[_0x60e1('0x22')](_0x5979cc,_0x1e782b)[_0x60e1('0x23')](function(_0x5a18bb){logger['info'](_0x60e1('0x24'),_0x43b094,'request\x20sent');logger['debug'](_0x60e1('0x25'),_0x43b094,'request\x20sent',JSON['stringify'](_0x5a18bb));if(_0x5a18bb[_0x60e1('0x26')]){if(_0x5a18bb['error'][_0x60e1('0x27')]===0x1f4){logger[_0x60e1('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x43b094,_0x5a18bb[_0x60e1('0x26')][_0x60e1('0x28')]);return _0xa510f9(_0x5a18bb[_0x60e1('0x26')][_0x60e1('0x28')]);}logger[_0x60e1('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x43b094,_0x5a18bb[_0x60e1('0x26')]['message']);return _0x192f38(_0x5a18bb['error'][_0x60e1('0x28')]);}else{logger[_0x60e1('0x29')](_0x60e1('0x24'),_0x43b094,_0x60e1('0x2a'));_0x192f38(_0x5a18bb[_0x60e1('0x2b')][_0x60e1('0x28')]);}})[_0x60e1('0x2c')](function(_0x2848ff){logger[_0x60e1('0x26')](_0x60e1('0x24'),_0x43b094,_0x2848ff);_0xa510f9(_0x2848ff);});});}function respondWithStatusCode(_0x297733,_0x2565a2){_0x2565a2=_0x2565a2||0xcc;return function(_0x5ea803){if(_0x5ea803){return _0x297733[_0x60e1('0x2d')](_0x2565a2);}return _0x297733[_0x60e1('0x2e')](_0x2565a2)['end']();};}function respondWithResult(_0x361b2c,_0x36e803){_0x36e803=_0x36e803||0xc8;return function(_0x2127a6){if(_0x2127a6){return _0x361b2c[_0x60e1('0x2e')](_0x36e803)[_0x60e1('0x2f')](_0x2127a6);}};}function respondWithFilteredResult(_0x1be296,_0x584435){return function(_0x48527d){if(_0x48527d){var _0x17defe=typeof _0x584435[_0x60e1('0x30')]===_0x60e1('0x31')&&typeof _0x584435[_0x60e1('0x32')]==='undefined';var _0x1ab3af=_0x48527d[_0x60e1('0x33')];var _0x239f30=_0x17defe?0x0:_0x584435[_0x60e1('0x30')];var _0x5c4987=_0x17defe?_0x48527d['count']:_0x584435[_0x60e1('0x30')]+_0x584435[_0x60e1('0x32')];var _0x8735c2;if(_0x5c4987>=_0x1ab3af){_0x5c4987=_0x1ab3af;_0x8735c2=0xc8;}else{_0x8735c2=0xce;}_0x1be296[_0x60e1('0x2e')](_0x8735c2);return _0x1be296[_0x60e1('0x34')]('Content-Range',_0x239f30+'-'+_0x5c4987+'/'+_0x1ab3af)[_0x60e1('0x2f')](_0x48527d);}return null;};}function patchUpdates(_0x2dd391){return function(_0x110944){try{jsonpatch[_0x60e1('0x35')](_0x110944,_0x2dd391,!![]);}catch(_0x37875a){return BPromise[_0x60e1('0x36')](_0x37875a);}return _0x110944[_0x60e1('0x37')]();};}function saveUpdates(_0x2b9ed,_0x110950){return function(_0x5170ba){if(_0x5170ba){return _0x5170ba[_0x60e1('0x38')](_0x2b9ed)[_0x60e1('0x23')](function(_0x5be4cc){return _0x5be4cc;});}return null;};}function removeEntity(_0x5e348a,_0x44af28){return function(_0x176efc){if(_0x176efc){return _0x176efc[_0x60e1('0x39')]()['then'](function(){var _0xba3af7=_0x176efc[_0x60e1('0x3a')]({'plain':!![]});var _0x305bee=_0x60e1('0x3b');return db[_0x60e1('0x3c')][_0x60e1('0x39')]({'where':{'type':_0x305bee,'resourceId':_0xba3af7['id']}})[_0x60e1('0x23')](function(){return _0x176efc;});})[_0x60e1('0x23')](function(){_0x5e348a[_0x60e1('0x2e')](0xcc)[_0x60e1('0x3d')]();});}};}function handleEntityNotFound(_0x3e3d0c,_0x1cf4b5){return function(_0x197108){if(!_0x197108){_0x3e3d0c[_0x60e1('0x2d')](0x194);}return _0x197108;};}function handleError(_0x481814,_0x2b5e40){_0x2b5e40=_0x2b5e40||0x1f4;return function(_0xe8c2cf){logger[_0x60e1('0x26')](_0xe8c2cf[_0x60e1('0x3e')]);if(_0xe8c2cf[_0x60e1('0x3f')]){delete _0xe8c2cf[_0x60e1('0x3f')];}_0x481814[_0x60e1('0x2e')](_0x2b5e40)[_0x60e1('0x40')](_0xe8c2cf);};}exports['index']=function(_0x20cd9f,_0x53a224){var _0x5db919={'include':[{'model':db[_0x60e1('0x41')],'as':'mandatoryDispositionPause'}]},_0x244c61={},_0x492097={'count':0x0,'rows':[]};var _0x23b931=_[_0x60e1('0x42')](db[_0x60e1('0x43')][_0x60e1('0x44')],function(_0x4179c4){return{'name':_0x4179c4[_0x60e1('0x45')],'type':_0x4179c4['type'][_0x60e1('0x46')]};});_0x244c61['model']=_[_0x60e1('0x42')](_0x23b931,_0x60e1('0x3f'));_0x244c61[_0x60e1('0x47')]=_[_0x60e1('0x48')](_0x20cd9f[_0x60e1('0x47')]);_0x244c61[_0x60e1('0x49')]=_[_0x60e1('0x4a')](_0x244c61['model'],_0x244c61[_0x60e1('0x47')]);_0x5db919[_0x60e1('0x4b')]=_[_0x60e1('0x4a')](_0x244c61[_0x60e1('0x4c')],qs[_0x60e1('0x4d')](_0x20cd9f['query'][_0x60e1('0x4d')]));_0x5db919[_0x60e1('0x4b')]=_0x5db919[_0x60e1('0x4b')][_0x60e1('0x4e')]?_0x5db919[_0x60e1('0x4b')]:_0x244c61['model'];if(!_0x20cd9f[_0x60e1('0x47')][_0x60e1('0x4f')](_0x60e1('0x50'))){_0x5db919[_0x60e1('0x32')]=qs[_0x60e1('0x32')](_0x20cd9f[_0x60e1('0x47')]['limit']);_0x5db919[_0x60e1('0x30')]=qs[_0x60e1('0x30')](_0x20cd9f[_0x60e1('0x47')]['offset']);}_0x5db919[_0x60e1('0x51')]=qs['sort'](_0x20cd9f[_0x60e1('0x47')][_0x60e1('0x52')]);_0x5db919[_0x60e1('0x53')]=qs[_0x60e1('0x49')](_[_0x60e1('0x54')](_0x20cd9f[_0x60e1('0x47')],_0x244c61[_0x60e1('0x49')]),_0x23b931);if(_0x20cd9f[_0x60e1('0x47')][_0x60e1('0x55')]){_0x5db919[_0x60e1('0x53')]=_[_0x60e1('0x56')](_0x5db919[_0x60e1('0x53')],{'$or':_[_0x60e1('0x42')](_0x23b931,function(_0x2e296d){if(_0x2e296d['type']!=='VIRTUAL'){var _0x224fda={};_0x224fda[_0x2e296d['name']]={'$like':'%'+_0x20cd9f[_0x60e1('0x47')][_0x60e1('0x55')]+'%'};return _0x224fda;}})});}_0x5db919=_['merge']({},_0x5db919,_0x20cd9f[_0x60e1('0x57')]);var _0x1d8f82={'where':_0x5db919['where']};return db[_0x60e1('0x43')][_0x60e1('0x33')](_0x1d8f82)[_0x60e1('0x23')](function(_0x589920){_0x492097[_0x60e1('0x33')]=_0x589920;if(_0x20cd9f[_0x60e1('0x47')][_0x60e1('0x58')]){_0x5db919[_0x60e1('0x59')]=[{'all':!![]}];}return db[_0x60e1('0x43')][_0x60e1('0x5a')](_0x5db919);})[_0x60e1('0x23')](function(_0x256612){_0x492097['rows']=_0x256612;return _0x492097;})['then'](respondWithFilteredResult(_0x53a224,_0x5db919))[_0x60e1('0x2c')](handleError(_0x53a224,null));};exports[_0x60e1('0x5b')]=function(_0x4a354f,_0x42e244){var _0x441c24={'raw':![],'where':{'id':_0x4a354f['params']['id']},'include':[{'model':db['Pause'],'as':_0x60e1('0x5c')}]},_0x2e0db5={};_0x2e0db5[_0x60e1('0x4c')]=_[_0x60e1('0x48')](db[_0x60e1('0x43')][_0x60e1('0x44')]);_0x2e0db5[_0x60e1('0x47')]=_['keys'](_0x4a354f[_0x60e1('0x47')]);_0x2e0db5[_0x60e1('0x49')]=_[_0x60e1('0x4a')](_0x2e0db5['model'],_0x2e0db5[_0x60e1('0x47')]);_0x441c24[_0x60e1('0x4b')]=_[_0x60e1('0x4a')](_0x2e0db5[_0x60e1('0x4c')],qs[_0x60e1('0x4d')](_0x4a354f['query'][_0x60e1('0x4d')]));_0x441c24[_0x60e1('0x4b')]=_0x441c24['attributes']['length']?_0x441c24[_0x60e1('0x4b')]:_0x2e0db5['model'];if(_0x4a354f['query'][_0x60e1('0x58')]){_0x441c24[_0x60e1('0x59')]=[{'all':!![]}];}_0x441c24=_['merge']({},_0x441c24,_0x4a354f[_0x60e1('0x57')]);return db[_0x60e1('0x43')][_0x60e1('0x5d')](_0x441c24)['then'](handleEntityNotFound(_0x42e244,null))['then'](respondWithResult(_0x42e244,null))['catch'](handleError(_0x42e244,null));};exports[_0x60e1('0x5e')]=function(_0x53c813,_0x80cd2){return db['WhatsappAccount']['create'](_0x53c813[_0x60e1('0x5f')],{})['then'](function(_0x2ec5d4){var _0x289095=_0x53c813['user'][_0x60e1('0x3a')]({'plain':!![]});if(!_0x289095)throw new Error(_0x60e1('0x60'));if(_0x289095['role']===_0x60e1('0x61')){var _0x157eec=_0x2ec5d4[_0x60e1('0x3a')]({'plain':!![]});var _0x2930f9=_0x60e1('0x3b');return db[_0x60e1('0x62')]['find']({'where':{'name':_0x2930f9,'userProfileId':_0x289095[_0x60e1('0x63')]},'raw':!![]})[_0x60e1('0x23')](function(_0x5900a6){if(_0x5900a6&&_0x5900a6[_0x60e1('0x64')]===0x0){return db[_0x60e1('0x3c')]['create']({'name':_0x157eec['name'],'resourceId':_0x157eec['id'],'type':_0x5900a6[_0x60e1('0x3f')],'sectionId':_0x5900a6['id']},{})[_0x60e1('0x23')](function(){return _0x2ec5d4;});}else{return _0x2ec5d4;}})[_0x60e1('0x2c')](function(_0x5e037a){logger[_0x60e1('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e037a);throw _0x5e037a;});}return _0x2ec5d4;})['then'](respondWithResult(_0x80cd2,0xc9))['catch'](handleError(_0x80cd2,null));};exports[_0x60e1('0x38')]=function(_0x3a050b,_0x2163e2){if(_0x3a050b[_0x60e1('0x5f')]['id']){delete _0x3a050b[_0x60e1('0x5f')]['id'];}return db[_0x60e1('0x43')][_0x60e1('0x5d')]({'where':{'id':_0x3a050b['params']['id']},'include':[{'model':db[_0x60e1('0x41')],'as':_0x60e1('0x5c')}]})['then'](handleEntityNotFound(_0x2163e2,null))[_0x60e1('0x23')](saveUpdates(_0x3a050b[_0x60e1('0x5f')],null))[_0x60e1('0x23')](respondWithResult(_0x2163e2,null))['catch'](handleError(_0x2163e2,null));};exports[_0x60e1('0x39')]=function(_0x5705cc,_0x5264e9){return db[_0x60e1('0x43')][_0x60e1('0x5d')]({'where':{'id':_0x5705cc[_0x60e1('0x65')]['id']}})['then'](handleEntityNotFound(_0x5264e9,null))['then'](removeEntity(_0x5264e9,null))[_0x60e1('0x2c')](handleError(_0x5264e9,null));};exports['describe']=function(_0x3f9b4c,_0x5d2879){return db['WhatsappAccount'][_0x60e1('0x66')]()['then'](respondWithResult(_0x5d2879,null))[_0x60e1('0x2c')](handleError(_0x5d2879,null));};exports['addDisposition']=function(_0x3067d3,_0x77a451,_0xb8cdbe){if(_0x3067d3[_0x60e1('0x5f')]['id']){delete _0x3067d3[_0x60e1('0x5f')]['id'];}return db[_0x60e1('0x43')]['find']({'where':{'id':_0x3067d3[_0x60e1('0x65')]['id']}})[_0x60e1('0x23')](handleEntityNotFound(_0x77a451,null))['then'](function(_0x18b7e2){if(_0x18b7e2){_0x3067d3[_0x60e1('0x5f')][_0x60e1('0x67')]=_0x18b7e2['id'];return db[_0x60e1('0x68')][_0x60e1('0x5e')](_0x3067d3[_0x60e1('0x5f')]);}})[_0x60e1('0x23')](respondWithResult(_0x77a451,null))[_0x60e1('0x2c')](handleError(_0x77a451,null));};exports[_0x60e1('0x69')]=function(_0x5de41d,_0x30f9a2,_0x2ca52d){var _0x4a0148={'raw':![],'where':{}};var _0x1599c4={};var _0x201b1b={'count':0x0,'rows':[]};return db[_0x60e1('0x43')]['findOne']({'where':{'id':_0x5de41d[_0x60e1('0x65')]['id']}})[_0x60e1('0x23')](handleEntityNotFound(_0x30f9a2,null))['then'](function(_0x54e9ec){if(_0x54e9ec){_0x1599c4[_0x60e1('0x4c')]=_['keys'](db['Disposition'][_0x60e1('0x44')]);_0x1599c4[_0x60e1('0x47')]=_['keys'](_0x5de41d[_0x60e1('0x47')]);_0x1599c4[_0x60e1('0x49')]=_[_0x60e1('0x4a')](_0x1599c4[_0x60e1('0x4c')],_0x1599c4['query']);_0x4a0148[_0x60e1('0x4b')]=_[_0x60e1('0x4a')](_0x1599c4[_0x60e1('0x4c')],qs['fields'](_0x5de41d[_0x60e1('0x47')]['fields']));_0x4a0148[_0x60e1('0x4b')]=_0x4a0148[_0x60e1('0x4b')][_0x60e1('0x4e')]?_0x4a0148['attributes']:_0x1599c4[_0x60e1('0x4c')];if(!_0x5de41d['query'][_0x60e1('0x4f')](_0x60e1('0x50'))){_0x4a0148[_0x60e1('0x32')]=qs[_0x60e1('0x32')](_0x5de41d['query'][_0x60e1('0x32')]);_0x4a0148[_0x60e1('0x30')]=qs['offset'](_0x5de41d[_0x60e1('0x47')][_0x60e1('0x30')]);}_0x4a0148['order']=qs[_0x60e1('0x52')](_0x5de41d[_0x60e1('0x47')][_0x60e1('0x52')]);_0x4a0148[_0x60e1('0x53')]=qs[_0x60e1('0x49')](_['pick'](_0x5de41d[_0x60e1('0x47')],_0x1599c4[_0x60e1('0x49')]));_0x4a0148[_0x60e1('0x53')][_0x60e1('0x67')]=_0x54e9ec['id'];if(_0x5de41d[_0x60e1('0x47')][_0x60e1('0x55')]){_0x4a0148['where']=_['merge'](_0x4a0148[_0x60e1('0x53')],{'$or':_['map'](_0x4a0148[_0x60e1('0x4b')],function(_0x7330bf){var _0x2397d5={};_0x2397d5[_0x7330bf]={'$like':'%'+_0x5de41d[_0x60e1('0x47')]['filter']+'%'};return _0x2397d5;})});}_0x4a0148=_[_0x60e1('0x56')]({},_0x4a0148,_0x5de41d[_0x60e1('0x57')]);return db[_0x60e1('0x68')]['count']({'where':_0x4a0148[_0x60e1('0x53')]})['then'](function(_0x3b67a1){_0x201b1b[_0x60e1('0x33')]=_0x3b67a1;if(_0x5de41d[_0x60e1('0x47')][_0x60e1('0x58')]){_0x4a0148[_0x60e1('0x59')]=[{'all':!![]}];}return db[_0x60e1('0x68')][_0x60e1('0x5a')](_0x4a0148);})[_0x60e1('0x23')](function(_0xa063cf){_0x201b1b[_0x60e1('0x6a')]=_0xa063cf;return _0x201b1b;});}})[_0x60e1('0x23')](respondWithFilteredResult(_0x30f9a2,_0x4a0148))[_0x60e1('0x2c')](handleError(_0x30f9a2,null));};exports[_0x60e1('0x6b')]=function(_0x5ce9e0,_0x322e4e,_0x4a474a){return db[_0x60e1('0x43')][_0x60e1('0x5d')]({'where':{'id':_0x5ce9e0[_0x60e1('0x65')]['id']}})[_0x60e1('0x23')](handleEntityNotFound(_0x322e4e,null))[_0x60e1('0x23')](function(_0x4dbf1a){if(_0x4dbf1a){return _0x4dbf1a[_0x60e1('0x6b')](_0x5ce9e0[_0x60e1('0x47')]['ids']);}})['then'](respondWithStatusCode(_0x322e4e,null))[_0x60e1('0x2c')](handleError(_0x322e4e,null));};exports[_0x60e1('0x6c')]=function(_0x1c62ce,_0xddd6b9,_0x2410be){if(_0x1c62ce[_0x60e1('0x5f')]['id']){delete _0x1c62ce['body']['id'];}return db[_0x60e1('0x43')][_0x60e1('0x5d')]({'where':{'id':_0x1c62ce[_0x60e1('0x65')]['id']}})[_0x60e1('0x23')](handleEntityNotFound(_0xddd6b9,null))[_0x60e1('0x23')](function(_0x10ed96){if(_0x10ed96){_0x1c62ce[_0x60e1('0x5f')][_0x60e1('0x67')]=_0x10ed96['id'];return db['CannedAnswer'][_0x60e1('0x5e')](_0x1c62ce[_0x60e1('0x5f')]);}})[_0x60e1('0x23')](respondWithResult(_0xddd6b9,null))[_0x60e1('0x2c')](handleError(_0xddd6b9,null));};exports[_0x60e1('0x6d')]=function(_0x322106,_0x5a1ecd,_0x1ae438){var _0x481854={'raw':![],'where':{}};var _0x7a26f4={};var _0x3651e5={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x60e1('0x6e')]({'where':{'id':_0x322106['params']['id']}})[_0x60e1('0x23')](handleEntityNotFound(_0x5a1ecd,null))[_0x60e1('0x23')](function(_0x5d538c){if(_0x5d538c){_0x7a26f4[_0x60e1('0x4c')]=_[_0x60e1('0x48')](db[_0x60e1('0x6f')][_0x60e1('0x44')]);_0x7a26f4[_0x60e1('0x47')]=_[_0x60e1('0x48')](_0x322106[_0x60e1('0x47')]);_0x7a26f4[_0x60e1('0x49')]=_[_0x60e1('0x4a')](_0x7a26f4[_0x60e1('0x4c')],_0x7a26f4[_0x60e1('0x47')]);_0x481854[_0x60e1('0x4b')]=_[_0x60e1('0x4a')](_0x7a26f4[_0x60e1('0x4c')],qs['fields'](_0x322106[_0x60e1('0x47')][_0x60e1('0x4d')]));_0x481854[_0x60e1('0x4b')]=_0x481854['attributes'][_0x60e1('0x4e')]?_0x481854[_0x60e1('0x4b')]:_0x7a26f4[_0x60e1('0x4c')];if(!_0x322106['query'][_0x60e1('0x4f')](_0x60e1('0x50'))){_0x481854[_0x60e1('0x32')]=qs['limit'](_0x322106[_0x60e1('0x47')][_0x60e1('0x32')]);_0x481854[_0x60e1('0x30')]=qs['offset'](_0x322106[_0x60e1('0x47')][_0x60e1('0x30')]);}_0x481854['order']=qs[_0x60e1('0x52')](_0x322106[_0x60e1('0x47')][_0x60e1('0x52')]);_0x481854[_0x60e1('0x53')]=qs['filters'](_[_0x60e1('0x54')](_0x322106['query'],_0x7a26f4[_0x60e1('0x49')]));_0x481854[_0x60e1('0x53')][_0x60e1('0x67')]=_0x5d538c['id'];if(_0x322106['query'][_0x60e1('0x55')]){_0x481854[_0x60e1('0x53')]=_[_0x60e1('0x56')](_0x481854[_0x60e1('0x53')],{'$or':_['map'](_0x481854[_0x60e1('0x4b')],function(_0x1343d9){var _0x531d59={};_0x531d59[_0x1343d9]={'$like':'%'+_0x322106[_0x60e1('0x47')][_0x60e1('0x55')]+'%'};return _0x531d59;})});}_0x481854=_[_0x60e1('0x56')]({},_0x481854,_0x322106[_0x60e1('0x57')]);return db[_0x60e1('0x6f')][_0x60e1('0x33')]({'where':_0x481854[_0x60e1('0x53')]})[_0x60e1('0x23')](function(_0x473306){_0x3651e5['count']=_0x473306;if(_0x322106[_0x60e1('0x47')][_0x60e1('0x58')]){_0x481854[_0x60e1('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0x60e1('0x5a')](_0x481854);})[_0x60e1('0x23')](function(_0x33f8e0){_0x3651e5[_0x60e1('0x6a')]=_0x33f8e0;return _0x3651e5;});}})['then'](respondWithFilteredResult(_0x5a1ecd,_0x481854))['catch'](handleError(_0x5a1ecd,null));};exports['removeAnswers']=function(_0x31ad3b,_0x4c09a9,_0x1f3eb1){return db['WhatsappAccount'][_0x60e1('0x5d')]({'where':{'id':_0x31ad3b[_0x60e1('0x65')]['id']}})[_0x60e1('0x23')](handleEntityNotFound(_0x4c09a9,null))['then'](function(_0x5eacc9){if(_0x5eacc9){return _0x5eacc9[_0x60e1('0x70')](_0x31ad3b[_0x60e1('0x47')][_0x60e1('0x71')]);}})[_0x60e1('0x23')](respondWithStatusCode(_0x4c09a9,null))[_0x60e1('0x2c')](handleError(_0x4c09a9,null));};exports[_0x60e1('0x72')]=function(_0x557db1,_0x5795c3,_0x506cdc){return db[_0x60e1('0x43')]['find']({'where':{'id':_0x557db1[_0x60e1('0x65')]['id']}})[_0x60e1('0x23')](handleEntityNotFound(_0x5795c3,null))[_0x60e1('0x23')](function(_0x102476){if(_0x102476){return _0x102476[_0x60e1('0x72')](_0x557db1[_0x60e1('0x5f')][_0x60e1('0x71')],_['omit'](_0x557db1[_0x60e1('0x5f')],[_0x60e1('0x71'),'id'])||{})[_0x60e1('0x73')](function(_0x10c784){for(var _0x348687=0x0;_0x348687<_0x557db1[_0x60e1('0x5f')][_0x60e1('0x71')][_0x60e1('0x4e')];_0x348687+=0x1){socket[_0x60e1('0x74')](_0x60e1('0x75'),{'UserId':Number(_0x557db1[_0x60e1('0x5f')][_0x60e1('0x71')][_0x348687]),'WhatsappAccountId':Number(_0x557db1[_0x60e1('0x65')]['id'])});}return _0x10c784;});}})[_0x60e1('0x23')](respondWithResult(_0x5795c3,null))['catch'](handleError(_0x5795c3,null));};exports[_0x60e1('0x76')]=function(_0x59875f,_0x544a44,_0x58c1d1){return db[_0x60e1('0x43')][_0x60e1('0x5d')]({'where':{'id':_0x59875f[_0x60e1('0x65')]['id']}})[_0x60e1('0x23')](handleEntityNotFound(_0x544a44,null))['then'](function(_0x4a0531){if(_0x4a0531){return _0x4a0531[_0x60e1('0x76')](_0x59875f[_0x60e1('0x47')][_0x60e1('0x71')])['then'](function(){if(_[_0x60e1('0x77')](_0x59875f[_0x60e1('0x47')][_0x60e1('0x71')])){for(var _0x30b05a=0x0;_0x30b05a<_0x59875f[_0x60e1('0x47')][_0x60e1('0x71')][_0x60e1('0x4e')];_0x30b05a+=0x1){socket[_0x60e1('0x74')](_0x60e1('0x78'),{'UserId':Number(_0x59875f['query']['ids'][_0x30b05a]),'WhatsappAccountId':Number(_0x59875f[_0x60e1('0x65')]['id'])});}}else{socket[_0x60e1('0x74')](_0x60e1('0x78'),{'UserId':Number(_0x59875f[_0x60e1('0x47')][_0x60e1('0x71')]),'WhatsappAccountId':Number(_0x59875f['params']['id'])});}});}})[_0x60e1('0x23')](respondWithStatusCode(_0x544a44,null))[_0x60e1('0x2c')](handleError(_0x544a44,null));};exports[_0x60e1('0x79')]=function(_0x583677,_0x4e8ce8,_0xe8b49f){var _0xb73a52={};var _0x329476={};var _0x58f65e;var _0x4105b4;return db[_0x60e1('0x43')][_0x60e1('0x6e')]({'where':{'id':_0x583677[_0x60e1('0x65')]['id']}})[_0x60e1('0x23')](handleEntityNotFound(_0x4e8ce8,null))[_0x60e1('0x23')](function(_0x1215d9){if(_0x1215d9){_0x58f65e=_0x1215d9;_0x329476['model']=_['keys'](db['User']['rawAttributes']);_0x329476['query']=_[_0x60e1('0x48')](_0x583677[_0x60e1('0x47')]);_0x329476[_0x60e1('0x49')]=_[_0x60e1('0x4a')](_0x329476['model'],_0x329476[_0x60e1('0x47')]);_0xb73a52[_0x60e1('0x4b')]=_[_0x60e1('0x4a')](_0x329476[_0x60e1('0x4c')],qs[_0x60e1('0x4d')](_0x583677[_0x60e1('0x47')]['fields']));_0xb73a52[_0x60e1('0x4b')]=_0xb73a52[_0x60e1('0x4b')][_0x60e1('0x4e')]?_0xb73a52[_0x60e1('0x4b')]:_0x329476[_0x60e1('0x4c')];_0xb73a52['order']=qs[_0x60e1('0x52')](_0x583677[_0x60e1('0x47')]['sort']);_0xb73a52[_0x60e1('0x53')]=qs[_0x60e1('0x49')](_[_0x60e1('0x54')](_0x583677['query'],_0x329476[_0x60e1('0x49')]));if(_0x583677[_0x60e1('0x47')][_0x60e1('0x55')]){_0xb73a52[_0x60e1('0x53')]=_[_0x60e1('0x56')](_0xb73a52['where'],{'$or':_['map'](_0xb73a52['attributes'],function(_0x419339){var _0x1ccec0={};_0x1ccec0[_0x419339]={'$like':'%'+_0x583677[_0x60e1('0x47')]['filter']+'%'};return _0x1ccec0;})});}_0xb73a52=_['merge']({},_0xb73a52,_0x583677['options']);return _0x58f65e[_0x60e1('0x79')](_0xb73a52);}})[_0x60e1('0x23')](function(_0x5404ea){if(_0x5404ea){_0x4105b4=_0x5404ea[_0x60e1('0x4e')];if(!_0x583677['query']['hasOwnProperty'](_0x60e1('0x50'))){_0xb73a52[_0x60e1('0x32')]=qs['limit'](_0x583677[_0x60e1('0x47')][_0x60e1('0x32')]);_0xb73a52[_0x60e1('0x30')]=qs['offset'](_0x583677[_0x60e1('0x47')][_0x60e1('0x30')]);}return _0x58f65e[_0x60e1('0x79')](_0xb73a52);}})[_0x60e1('0x23')](function(_0xa16d9f){if(_0xa16d9f){return _0xa16d9f?{'count':_0x4105b4,'rows':_0xa16d9f}:null;}})['then'](respondWithResult(_0x4e8ce8,null))[_0x60e1('0x2c')](handleError(_0x4e8ce8,null));};exports[_0x60e1('0x7a')]=function(_0x3e6d05,_0x270e1a){var _0x2d1603=_0x3e6d05[_0x60e1('0x65')]['id'];var _0x335605=_0x3e6d05['body'];var _0x1d33d8=0xc8;var _0x5ecd1d=null;return db[_0x60e1('0x7b')][_0x60e1('0x7c')]({'isolationLevel':db[_0x60e1('0x7b')][_0x60e1('0x7d')][_0x60e1('0x7e')][_0x60e1('0x7f')]},function(_0x2b39c8){return db['WhatsappAccount'][_0x60e1('0x6e')]({'where':{'id':_0x2d1603},'transaction':_0x2b39c8})[_0x60e1('0x23')](function(_0x1a88dd){if(_0x1a88dd){return db[_0x60e1('0x80')][_0x60e1('0x39')]({'where':{'WhatsappAccountId':_0x2d1603},'transaction':_0x2b39c8})['then'](function(){var _0x1ccb60=_[_0x60e1('0x42')](_0x335605,function(_0x4319d1){_0x4319d1[_0x60e1('0x67')]=_0x2d1603;return _0x4319d1;});return db[_0x60e1('0x80')][_0x60e1('0x81')](_0x1ccb60,{'transaction':_0x2b39c8});});}else{_0x1d33d8=0x194;_0x5ecd1d=[];}});})[_0x60e1('0x23')](function(){if(_0x1d33d8!==0x194){return db[_0x60e1('0x80')][_0x60e1('0x82')]({'where':{'WhatsappAccountId':_0x2d1603},'order':'priority'})[_0x60e1('0x23')](function(_0x34ede8){_0x5ecd1d=_0x34ede8;});}})[_0x60e1('0x2c')](function(_0x5b5904){_0x1d33d8=0x1f4;logger[_0x60e1('0x26')](_0x5b5904['stack']);if(_0x5b5904[_0x60e1('0x3f')]){delete _0x5b5904[_0x60e1('0x3f')];}_0x5ecd1d=_0x5b5904;})[_0x60e1('0x83')](function(){if(_0x5ecd1d===null){_0x270e1a['sendStatus'](_0x1d33d8);}else{if(_0x1d33d8===0x1f4){_0x270e1a[_0x60e1('0x2e')](_0x1d33d8)['send'](_0x5ecd1d);}else{_0x270e1a[_0x60e1('0x2e')](_0x1d33d8)[_0x60e1('0x2f')](_0x5ecd1d);}}});};exports[_0x60e1('0x84')]=function(_0x4811cd,_0x922943,_0x4b5f66){var _0x14266c={};var _0x21c6d5={};var _0x930a24;var _0x57cf95;return db[_0x60e1('0x43')][_0x60e1('0x6e')]({'where':{'id':_0x4811cd[_0x60e1('0x65')]['id']}})[_0x60e1('0x23')](handleEntityNotFound(_0x922943,null))[_0x60e1('0x23')](function(_0x1b3174){if(_0x1b3174){_0x930a24=_0x1b3174;_0x21c6d5[_0x60e1('0x4c')]=_[_0x60e1('0x48')](db[_0x60e1('0x80')]['rawAttributes']);_0x21c6d5[_0x60e1('0x47')]=_[_0x60e1('0x48')](_0x4811cd[_0x60e1('0x47')]);_0x21c6d5[_0x60e1('0x49')]=_['intersection'](_0x21c6d5[_0x60e1('0x4c')],_0x21c6d5[_0x60e1('0x47')]);_0x14266c['attributes']=_[_0x60e1('0x4a')](_0x21c6d5['model'],qs[_0x60e1('0x4d')](_0x4811cd[_0x60e1('0x47')][_0x60e1('0x4d')]));_0x14266c['attributes']=_0x14266c[_0x60e1('0x4b')][_0x60e1('0x4e')]?_0x14266c[_0x60e1('0x4b')]:_0x21c6d5[_0x60e1('0x4c')];_0x14266c[_0x60e1('0x51')]=qs[_0x60e1('0x52')](_0x4811cd[_0x60e1('0x47')][_0x60e1('0x52')]);_0x14266c[_0x60e1('0x53')]=qs[_0x60e1('0x49')](_['pick'](_0x4811cd['query'],_0x21c6d5[_0x60e1('0x49')]));if(_0x4811cd[_0x60e1('0x47')][_0x60e1('0x55')]){_0x14266c[_0x60e1('0x53')]=_[_0x60e1('0x56')](_0x14266c[_0x60e1('0x53')],{'$or':_[_0x60e1('0x42')](_0x14266c[_0x60e1('0x4b')],function(_0x3f7c1d){var _0x3eefb6={};_0x3eefb6[_0x3f7c1d]={'$like':'%'+_0x4811cd[_0x60e1('0x47')][_0x60e1('0x55')]+'%'};return _0x3eefb6;})});}_0x14266c=_[_0x60e1('0x56')]({},_0x14266c,_0x4811cd[_0x60e1('0x57')]);return _0x930a24['getApplications'](_0x14266c);}})[_0x60e1('0x23')](function(_0x41be4a){if(_0x41be4a){_0x57cf95=_0x41be4a['length'];if(!_0x4811cd[_0x60e1('0x47')][_0x60e1('0x4f')](_0x60e1('0x50'))){_0x14266c[_0x60e1('0x32')]=qs[_0x60e1('0x32')](_0x4811cd[_0x60e1('0x47')][_0x60e1('0x32')]);_0x14266c[_0x60e1('0x30')]=qs[_0x60e1('0x30')](_0x4811cd[_0x60e1('0x47')]['offset']);}return _0x930a24[_0x60e1('0x84')](_0x14266c);}})[_0x60e1('0x23')](function(_0x3977b6){if(_0x3977b6){return _0x3977b6?{'count':_0x57cf95,'rows':_0x3977b6}:null;}})[_0x60e1('0x23')](respondWithResult(_0x922943,null))[_0x60e1('0x2c')](handleError(_0x922943,null));};exports['notify']=function(_0x738ca3,_0x39b762,_0x4dc514){var _0x38ef0c={'channel':'whatsapp'};var _0x5f3841=[];var _0x393b15=[];var _0x47fdc6={};return db['WhatsappAccount'][_0x60e1('0x5d')]({'where':{'id':_0x738ca3[_0x60e1('0x65')]['id']},'include':[{'model':db[_0x60e1('0x80')],'as':'Applications'}]})[_0x60e1('0x23')](handleEntityNotFound(_0x39b762,null))[_0x60e1('0x23')](function(_0x2f85e1){_0x38ef0c['account']=_0x2f85e1;if(_0x38ef0c['account']&&_0x38ef0c[_0x60e1('0x85')][_0x60e1('0x86')]===_0x60e1('0x87')&&_0x738ca3[_0x60e1('0x5f')]['statuses']){if(_0x738ca3[_0x60e1('0x5f')][_0x60e1('0x88')][_0x60e1('0x4e')]===0x0)return;if(_0x738ca3['body'][_0x60e1('0x88')][0x0]['state']!=='read')return;return db[_0x60e1('0x89')][_0x60e1('0x38')]({'read':!![],'readAt':_0x738ca3[_0x60e1('0x5f')][_0x60e1('0x88')][0x0]['timestamp']},{'where':{'messageId':_0x738ca3[_0x60e1('0x5f')][_0x60e1('0x88')][0x0][_0x60e1('0x8a')]},'individualHooks':!![]})[_0x60e1('0x23')](function(_0x4f46eb){return _0x39b762[_0x60e1('0x2e')](0xc8)[_0x60e1('0x2f')](_0x4f46eb);});}_0x38ef0c['applications']=_[_0x60e1('0x8b')](_0x2f85e1['Applications'],['priority'],[_0x60e1('0x8c')]);if(_0x38ef0c[_0x60e1('0x85')][_0x60e1('0x8d')]){delete _0x38ef0c[_0x60e1('0x85')][_0x60e1('0x8d')];}return db[_0x60e1('0x8e')]['describe']()[_0x60e1('0x23')](function(_0x216d25){if(!_0x216d25){throw new db[(_0x60e1('0x8f'))]['ValidationError'](_0x60e1('0x90'));}_0x5f3841=_['difference'](_['keys'](_0x216d25),['createdAt',_0x60e1('0x91')]);_0x393b15=_[_0x60e1('0x92')](_['keys'](_0x216d25),['createdAt',_0x60e1('0x91'),_0x60e1('0x93'),_0x60e1('0x94')]);_0x38ef0c[_0x60e1('0x5f')]={'mapKey':_0x60e1('0x95')};if(_0x38ef0c['account']&&_0x38ef0c[_0x60e1('0x85')]['type']===_0x60e1('0x96')){_0x38ef0c['body'][_0x60e1('0x97')]=_0x738ca3[_0x60e1('0x5f')]['From']['replace'](_0x60e1('0x98'),'');_0x38ef0c[_0x60e1('0x5f')][_0x60e1('0x5f')]=_0x738ca3[_0x60e1('0x5f')][_0x60e1('0x99')];_0x38ef0c[_0x60e1('0x5f')]['messageId']=_0x738ca3['body'][_0x60e1('0x9a')];}if(_0x38ef0c[_0x60e1('0x85')]&&_0x38ef0c[_0x60e1('0x85')]['type']===_0x60e1('0x87')){_0x38ef0c[_0x60e1('0x5f')]['from']=_0x738ca3[_0x60e1('0x5f')][_0x60e1('0x9b')][0x0][_0x60e1('0x97')];_0x38ef0c['body'][_0x60e1('0x5f')]=_0x738ca3[_0x60e1('0x5f')][_0x60e1('0x9b')][0x0][_0x60e1('0x28')]['body'];_0x38ef0c[_0x60e1('0x5f')][_0x60e1('0x9c')]=_0x738ca3[_0x60e1('0x5f')][_0x60e1('0x9b')][0x0][_0x60e1('0x8a')];}if(_0x38ef0c[_0x60e1('0x5f')]['id']){delete _0x38ef0c[_0x60e1('0x5f')]['id'];}if(_[_0x60e1('0x9d')](_0x38ef0c[_0x60e1('0x5f')][_0x60e1('0x97')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0x60e1('0x9d')](_0x38ef0c[_0x60e1('0x5f')][_0x60e1('0x5f')])||_0x38ef0c[_0x60e1('0x5f')]['body']===''){throw new db['Sequelize'][(_0x60e1('0x9e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x60e1('0x9d')](_0x38ef0c[_0x60e1('0x5f')][_0x60e1('0x9f')])){throw new db[(_0x60e1('0x8f'))][(_0x60e1('0x9e'))](_0x60e1('0xa0')+_0x393b15);}if(!_['includes'](_0x393b15,_0x38ef0c['body'][_0x60e1('0x9f')])){throw new db[(_0x60e1('0x8f'))][(_0x60e1('0x9e'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x393b15);}_0x47fdc6[_0x38ef0c['body'][_0x60e1('0x9f')]]=_0x38ef0c[_0x60e1('0x5f')][_0x60e1('0x97')];return db[_0x60e1('0xa1')][_0x60e1('0x5d')]({'where':{'id':_0x38ef0c[_0x60e1('0x85')][_0x60e1('0x94')]},'include':[{'model':db[_0x60e1('0x8e')],'as':_0x60e1('0xa2'),'where':_0x47fdc6,'limit':0x1,'order':[[_0x60e1('0x91'),'DESC']]}]});})[_0x60e1('0x23')](handleEntityNotFound(_0x39b762,null))[_0x60e1('0x23')](function(_0x4ef1a7){if(_0x4ef1a7){_0x38ef0c['list']=_[_0x60e1('0xa3')](_0x4ef1a7,[_0x60e1('0xa2')]);if(_0x4ef1a7[_0x60e1('0xa2')][_0x60e1('0x4e')]){return _0x4ef1a7[_0x60e1('0xa2')][0x0];}var _0xd79461=_[_0x60e1('0xa4')](_0x38ef0c[_0x60e1('0x5f')],{'firstName':_0x38ef0c['body']['from'],'ListId':_0x4ef1a7['id']});_0xd79461[_0x38ef0c['body'][_0x60e1('0x9f')]]=_0x38ef0c[_0x60e1('0x5f')]['from'];return db['CmContact'][_0x60e1('0x5e')](_0xd79461,{'fields':_0x5f3841,'raw':!![]});}})['then'](handleEntityNotFound(_0x39b762,null))[_0x60e1('0x23')](function(_0x28fd08){if(_0x28fd08){_0x38ef0c[_0x60e1('0xa5')]=_0x28fd08;var _0x50e4f5={'ContactId':_0x28fd08['id'],'phone':_0x38ef0c[_0x60e1('0x5f')][_0x60e1('0x97')],'WhatsappAccountId':_0x738ca3[_0x60e1('0x65')]['id']};var _0xf4a156={'ContactId':_0x28fd08['id'],'WhatsappAccountId':_0x738ca3[_0x60e1('0x65')]['id'],'closed':![]};return db[_0x60e1('0xa6')][_0x60e1('0x5d')]({'where':_0xf4a156})['then'](function(_0x453162){if(_0x453162){return[_0x453162,![]];}return db[_0x60e1('0xa6')][_0x60e1('0x5e')](_0x50e4f5)[_0x60e1('0x23')](function(_0x50551d){return[_0x50551d,!![]];});});}})[_0x60e1('0x73')](function(_0x2c7d6b,_0x394d34){_0x38ef0c[_0x60e1('0xa7')]=_0x2c7d6b[_0x60e1('0x3a')]({'plain':!![]});_0x38ef0c['interaction']['created']=![];if(_0x394d34){if(_0x38ef0c['account'][_0x60e1('0xa8')]){_0x38ef0c[_0x60e1('0xa9')][_0x60e1('0xaa')]({'id':0x0,'priority':_0x38ef0c[_0x60e1('0xa9')][_0x60e1('0x4e')]+0x1,'app':'close','appdata':_0x60e1('0xab'),'interval':'*,*,*,*'});}_0x38ef0c[_0x60e1('0xa7')][_0x60e1('0xac')]=!![];}return db['WhatsappMessage'][_0x60e1('0x5e')]({'phone':_0x38ef0c['body'][_0x60e1('0x97')],'messageId':_0x38ef0c[_0x60e1('0x5f')]['messageId'],'body':_0x38ef0c['body'][_0x60e1('0x5f')],'WhatsappAccountId':_0x738ca3[_0x60e1('0x65')]['id'],'WhatsappInteractionId':_0x2c7d6b['id'],'direction':'in','ContactId':_0x2c7d6b['ContactId'],'AttachmentId':_0x38ef0c[_0x60e1('0x5f')][_0x60e1('0xad')]});})[_0x60e1('0x23')](function(_0x2bc8d6){_0x38ef0c[_0x60e1('0x28')]=_0x2bc8d6;if(!_0x38ef0c[_0x60e1('0xa7')][_0x60e1('0xae')])return;return db['User'][_0x60e1('0x5d')]({'attributes':['id',_0x60e1('0x3f')],'where':{'id':_0x38ef0c[_0x60e1('0xa7')][_0x60e1('0xae')]}});})[_0x60e1('0x23')](function(_0x149d07){if(_0x149d07){_0x38ef0c[_0x60e1('0xa9')][_0x60e1('0xaf')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x149d07[_0x60e1('0x3f')]+','+(_0x38ef0c['account'][_0x60e1('0xb0')]||0xa),'interval':_0x60e1('0xb1')});}if(!_0x38ef0c['interaction'][_0x60e1('0xb2')])return;return db[_0x60e1('0xb3')]['find']({'attributes':['id','name'],'where':{'id':_0x38ef0c[_0x60e1('0xa7')][_0x60e1('0xb2')]}});})[_0x60e1('0x23')](function(_0x4568d0){if(_0x4568d0){_0x38ef0c[_0x60e1('0xa9')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x4568d0[_0x60e1('0x3f')]+','+(_0x38ef0c['account'][_0x60e1('0xb4')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x60e1('0xb5'),_0x38ef0c);})[_0x60e1('0x23')](function(_0x2cfb05){if(_0x2cfb05){var _0x3b96e2=0xc8;var _0x52dc22=_0x60e1('0xb6');logger[_0x60e1('0x29')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x52dc22,_0x3b96e2,_0x60e1('0xb7'));logger[_0x60e1('0xb8')](_0x60e1('0xb9'),_0x52dc22,_0x3b96e2,_0x60e1('0xb7'),JSON['stringify'](_0x2cfb05));if(_0x38ef0c[_0x60e1('0x85')][_0x60e1('0x86')]==='twilio'){return _0x39b762[_0x60e1('0x2e')](_0x3b96e2)[_0x60e1('0x34')]('Content-Type','text/xml')['send'](_0x60e1('0xba'));}else{return _0x39b762[_0x60e1('0x2e')](_0x3b96e2)['json'](_0x2cfb05);}}});})[_0x60e1('0x2c')](handleError(_0x39b762,null));};exports[_0x60e1('0x40')]=function(_0x2e9f46,_0x140323,_0x287b77){var _0x389fba,_0x6a5dcd,_0x43315c;if(_['isNil'](_0x2e9f46[_0x60e1('0x5f')][_0x60e1('0x5f')])||_0x2e9f46[_0x60e1('0x5f')]['body']===''){throw new db[(_0x60e1('0x8f'))][(_0x60e1('0x9e'))](_0x60e1('0xbb'));}if(_[_0x60e1('0x9d')](_0x2e9f46[_0x60e1('0x5f')]['to'])){throw new db[(_0x60e1('0x8f'))][(_0x60e1('0x9e'))](_0x60e1('0xbc'));}_0x389fba=_0x2e9f46['body']['to'];return db[_0x60e1('0x43')][_0x60e1('0x5d')]({'where':{'id':_0x2e9f46['params']['id']},'include':[{'model':db['CmList'],'as':_0x60e1('0xbd'),'include':[{'model':db[_0x60e1('0x8e')],'as':_0x60e1('0xa2'),'where':{'mobile':_0x389fba},'limit':0x1,'order':[[_0x60e1('0x91'),_0x60e1('0xbe')]]}]}]})['then'](handleEntityNotFound(_0x140323,null))[_0x60e1('0x23')](function(_0x423b89){if(_0x423b89&&_0x423b89['List']){_0x6a5dcd=_0x423b89[_0x60e1('0x3a')]({'plain':!![]});if(_0x6a5dcd[_0x60e1('0xbd')]&&_0x6a5dcd[_0x60e1('0xbd')][_0x60e1('0xa2')][_0x60e1('0x4e')]){return _0x6a5dcd['List']['Contacts'][0x0];}return db[_0x60e1('0x8e')][_0x60e1('0x5e')](_[_0x60e1('0xa4')](_0x2e9f46[_0x60e1('0x5f')],{'firstName':_0x389fba,'mobile':_0x389fba,'phone':_0x389fba,'ListId':_0x6a5dcd[_0x60e1('0x94')]}));}})[_0x60e1('0x23')](handleEntityNotFound(_0x140323,null))[_0x60e1('0x23')](function(_0x39ff42){if(_0x39ff42){_0x43315c=_0x39ff42;return db[_0x60e1('0xa6')][_0x60e1('0x5d')]({'where':{'ContactId':_0x43315c['id'],'closed':![],'WhatsappAccountId':_0x6a5dcd['id']}})[_0x60e1('0x23')](function(_0x188813){if(_0x188813){return[_0x188813,![]];}return db[_0x60e1('0xa6')][_0x60e1('0x5e')]({'UserId':_0x2e9f46[_0x60e1('0x61')]['id'],'ContactId':_0x43315c['id'],'WhatsappAccountId':_0x6a5dcd['id'],'phone':_0x389fba,'firstMsgDirection':_0x60e1('0xbf'),'Messages':[_[_0x60e1('0x56')](_0x2e9f46['body'],{'read':![],'body':_0x2e9f46[_0x60e1('0x5f')][_0x60e1('0x5f')],'phone':_0x389fba,'WhatsappAccountId':_0x6a5dcd['id'],'UserId':_0x2e9f46['user']['id'],'ContactId':_0x43315c['id']})]},{'include':[{'model':db[_0x60e1('0x89')],'as':'Messages'}]})['then'](function(_0xdebaea){return[_0xdebaea,!![]];});});}})[_0x60e1('0x73')](function(_0x289779,_0x50d087){if(_0x50d087){return _0x289779;}return db['WhatsappMessage'][_0x60e1('0x5e')](_[_0x60e1('0x56')](_0x2e9f46['body'],{'read':![],'body':_0x2e9f46[_0x60e1('0x5f')][_0x60e1('0x5f')],'phone':_0x389fba,'WhatsappAccountId':_0x6a5dcd['id'],'WhatsappInteractionId':_0x289779['id'],'UserId':_0x2e9f46[_0x60e1('0x61')]['id'],'ContactId':_0x43315c['id']}))['then'](function(_0x764b20){_0x289779[_0x60e1('0xc0')][_0x60e1('0xc1')]=[];_0x289779[_0x60e1('0xc0')][_0x60e1('0xc1')][_0x60e1('0xaa')](_0x764b20[_0x60e1('0xc0')]);return _0x289779;});})[_0x60e1('0x23')](respondWithResult(_0x140323,null))['catch'](handleError(_0x140323,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index ca266e9..92c58d7 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 _0xad2d=['hook','exports','events','WhatsappAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x545e6b,_0x10347d){var _0x5d1d8a=function(_0x2ff576){while(--_0x2ff576){_0x545e6b['push'](_0x545e6b['shift']());}};_0x5d1d8a(++_0x10347d);}(_0xad2d,0xb6));var _0xdad2=function(_0x3977ca,_0x5dc0b8){_0x3977ca=_0x3977ca-0x0;var _0x380e36=_0xad2d[_0x3977ca];return _0x380e36;};'use strict';var EventEmitter=require(_0xdad2('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xdad2('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xdad2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdad2('0x3'),'afterDestroy':_0xdad2('0x4')};function emitEvent(_0x3a6796){return function(_0xa6f486,_0xd33e5b,_0xf27ad2){WhatsappAccountEvents[_0xdad2('0x5')](_0x3a6796+':'+_0xa6f486['id'],_0xa6f486);WhatsappAccountEvents['emit'](_0x3a6796,_0xa6f486);_0xf27ad2(null);};}for(var e in events){if(events[_0xdad2('0x6')](e)){var event=events[e];WhatsappAccount[_0xdad2('0x7')](e,emitEvent(event));}}module[_0xdad2('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x86c7=['WhatsappAccount','save','update','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x41443f,_0x1f0b17){var _0x4e96a1=function(_0x3cfa64){while(--_0x3cfa64){_0x41443f['push'](_0x41443f['shift']());}};_0x4e96a1(++_0x1f0b17);}(_0x86c7,0xe5));var _0x786c=function(_0x24ab64,_0x5b3db1){_0x24ab64=_0x24ab64-0x0;var _0x25f30d=_0x86c7[_0x24ab64];return _0x25f30d;};'use strict';var EventEmitter=require(_0x786c('0x0'));var WhatsappAccount=require(_0x786c('0x1'))['db'][_0x786c('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x786c('0x3'),'afterUpdate':_0x786c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x16365d){return function(_0x12a340,_0x5e41c1,_0xfa87e4){WhatsappAccountEvents['emit'](_0x16365d+':'+_0x12a340['id'],_0x12a340);WhatsappAccountEvents['emit'](_0x16365d,_0x12a340);_0xfa87e4(null);};}for(var e in events){if(events[_0x786c('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x786c('0x6')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index bbc97e7..5767515 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 _0xe4c5=['./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xe4c5,0x164));var _0x5e4c=function(_0x4ea024,_0x33c175){_0x4ea024=_0x4ea024-0x0;var _0x5cc62f=_0xe4c5[_0x4ea024];return _0x5cc62f;};'use strict';var _=require(_0x5e4c('0x0'));var util=require('util');var logger=require(_0x5e4c('0x1'))(_0x5e4c('0x2'));var moment=require(_0x5e4c('0x3'));var BPromise=require(_0x5e4c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e4c('0x5'));var rimraf=require(_0x5e4c('0x6'));var config=require(_0x5e4c('0x7'));var attributes=require(_0x5e4c('0x8'));module[_0x5e4c('0x9')]=function(_0x6a7b,_0x47fc1a){return _0x6a7b[_0x5e4c('0xa')](_0x5e4c('0xb'),attributes,{'tableName':_0x5e4c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf13c=['moment','request-promise','path','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','util','../../config/logger','api'];(function(_0x1fd775,_0x12a1c5){var _0x565b1a=function(_0x32e32a){while(--_0x32e32a){_0x1fd775['push'](_0x1fd775['shift']());}};_0x565b1a(++_0x12a1c5);}(_0xf13c,0x1ad));var _0xcf13=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xf13c[_0x59d89e];return _0x554e93;};'use strict';var _=require('lodash');var util=require(_0xcf13('0x0'));var logger=require(_0xcf13('0x1'))(_0xcf13('0x2'));var moment=require(_0xcf13('0x3'));var BPromise=require('bluebird');var rp=require(_0xcf13('0x4'));var fs=require('fs');var path=require(_0xcf13('0x5'));var rimraf=require('rimraf');var config=require(_0xcf13('0x6'));var attributes=require(_0xcf13('0x7'));module[_0xcf13('0x8')]=function(_0x32b99f,_0x1aa1e3){return _0x32b99f[_0xcf13('0x9')](_0xcf13('0xa'),attributes,{'tableName':_0xcf13('0xb'),'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 e33ff36..0008e1d 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 _0xa9bf=['WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','model','map','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','stringify','error','code'];(function(_0x7b5cdd,_0x8c88d8){var _0x3a29ae=function(_0x17859a){while(--_0x17859a){_0x7b5cdd['push'](_0x7b5cdd['shift']());}};_0x3a29ae(++_0x8c88d8);}(_0xa9bf,0x136));var _0xfa9b=function(_0x170ee8,_0x1b2c0d){_0x170ee8=_0x170ee8-0x0;var _0x57595d=_0xa9bf[_0x170ee8];return _0x57595d;};'use strict';var _=require(_0xfa9b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa9b('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfa9b('0x2'))(_0xfa9b('0x3'));var config=require(_0xfa9b('0x4'));var jayson=require(_0xfa9b('0x5'));var client=jayson[_0xfa9b('0x6')][_0xfa9b('0x7')]({'port':0x232a});config[_0xfa9b('0x8')]=_[_0xfa9b('0x9')](config[_0xfa9b('0x8')],{'host':_0xfa9b('0xa'),'port':0x18eb});var socket=require(_0xfa9b('0xb'))(new Redis(config[_0xfa9b('0x8')]));require('./whatsappAccount.socket')[_0xfa9b('0xc')](socket);function respondWithRpcPromise(_0x2b3a52,_0x3d5046,_0x20d2e7){return new BPromise(function(_0x25fa28,_0x243103){return client[_0xfa9b('0xd')](_0x2b3a52,_0x20d2e7)[_0xfa9b('0xe')](function(_0x4cbad5){logger[_0xfa9b('0xf')]('WhatsappAccount,\x20%s,\x20%s',_0x3d5046,_0xfa9b('0x10'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3d5046,'request\x20sent',JSON[_0xfa9b('0x11')](_0x4cbad5));if(_0x4cbad5[_0xfa9b('0x12')]){if(_0x4cbad5['error'][_0xfa9b('0x13')]===0x1f4){logger['error'](_0xfa9b('0x14'),_0x3d5046,_0x4cbad5['error'][_0xfa9b('0x15')]);return _0x243103(_0x4cbad5[_0xfa9b('0x12')][_0xfa9b('0x15')]);}logger[_0xfa9b('0x12')](_0xfa9b('0x14'),_0x3d5046,_0x4cbad5['error']['message']);return _0x25fa28(_0x4cbad5[_0xfa9b('0x12')]['message']);}else{logger[_0xfa9b('0xf')](_0xfa9b('0x14'),_0x3d5046,_0xfa9b('0x10'));_0x25fa28(_0x4cbad5[_0xfa9b('0x16')][_0xfa9b('0x15')]);}})[_0xfa9b('0x17')](function(_0x417c55){logger[_0xfa9b('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x3d5046,_0x417c55);_0x243103(_0x417c55);});});}exports[_0xfa9b('0x18')]=function(_0x47ce61){var _0x2d7c92=this;return new Promise(function(_0xceca85,_0x2014cd){return db[_0xfa9b('0x19')][_0xfa9b('0x1a')]({'raw':_0x47ce61[_0xfa9b('0x1b')]?_0x47ce61[_0xfa9b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x47ce61[_0xfa9b('0x1b')]?_0x47ce61[_0xfa9b('0x1b')][_0xfa9b('0x1c')]||null:null,'attributes':_0x47ce61[_0xfa9b('0x1b')]?_0x47ce61[_0xfa9b('0x1b')][_0xfa9b('0x1d')]||null:null,'include':_0x47ce61[_0xfa9b('0x1b')]?_0x47ce61['options'][_0xfa9b('0x1e')]?_['map'](_0x47ce61[_0xfa9b('0x1b')]['include'],function(_0x26d052){return{'model':db[_0x26d052[_0xfa9b('0x1f')]],'as':_0x26d052['as'],'attributes':_0x26d052[_0xfa9b('0x1d')],'include':_0x26d052[_0xfa9b('0x1e')]?_['map'](_0x26d052[_0xfa9b('0x1e')],function(_0x3df171){return{'model':db[_0x3df171[_0xfa9b('0x1f')]],'as':_0x3df171['as'],'attributes':_0x3df171[_0xfa9b('0x1d')],'include':_0x3df171['include']?_[_0xfa9b('0x20')](_0x3df171[_0xfa9b('0x1e')],function(_0x2a1096){return{'model':db[_0x2a1096[_0xfa9b('0x1f')]],'as':_0x2a1096['as'],'attributes':_0x2a1096[_0xfa9b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfa9b('0xe')](function(_0x12b498){logger[_0xfa9b('0xf')]('ShowWhatsappAccount',_0x47ce61);logger['debug'](_0xfa9b('0x18'),_0x47ce61,JSON[_0xfa9b('0x11')](_0x12b498));_0xceca85(_0x12b498);})[_0xfa9b('0x17')](function(_0x1f7c79){logger[_0xfa9b('0x12')](_0xfa9b('0x18'),_0x1f7c79[_0xfa9b('0x15')],_0x47ce61);_0x2014cd(_0x2d7c92[_0xfa9b('0x12')](0x1f4,_0x1f7c79[_0xfa9b('0x15')]));});});}; \ No newline at end of file +var _0xbd00=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','redis','defaults','localhost','./whatsappAccount.socket','request','then','info','request\x20sent','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','map','model','debug','lodash','util'];(function(_0x64a845,_0x13b02c){var _0x4ba250=function(_0x3a467d){while(--_0x3a467d){_0x64a845['push'](_0x64a845['shift']());}};_0x4ba250(++_0x13b02c);}(_0xbd00,0x82));var _0x0bd0=function(_0x4f1d02,_0x4a4694){_0x4f1d02=_0x4f1d02-0x0;var _0x52fda1=_0xbd00[_0x4f1d02];return _0x52fda1;};'use strict';var _=require(_0x0bd0('0x0'));var util=require(_0x0bd0('0x1'));var moment=require(_0x0bd0('0x2'));var BPromise=require(_0x0bd0('0x3'));var rs=require(_0x0bd0('0x4'));var fs=require('fs');var Redis=require(_0x0bd0('0x5'));var db=require(_0x0bd0('0x6'))['db'];var utils=require(_0x0bd0('0x7'));var logger=require('../../config/logger')(_0x0bd0('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x0bd0('0x9')]=_[_0x0bd0('0xa')](config['redis'],{'host':_0x0bd0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0bd0('0x9')]));require(_0x0bd0('0xc'))['register'](socket);function respondWithRpcPromise(_0x586f26,_0x502e83,_0xa6c823){return new BPromise(function(_0x27120a,_0x176bf1){return client[_0x0bd0('0xd')](_0x586f26,_0xa6c823)[_0x0bd0('0xe')](function(_0x1d9b88){logger[_0x0bd0('0xf')]('WhatsappAccount,\x20%s,\x20%s',_0x502e83,_0x0bd0('0x10'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x502e83,_0x0bd0('0x10'),JSON[_0x0bd0('0x11')](_0x1d9b88));if(_0x1d9b88[_0x0bd0('0x12')]){if(_0x1d9b88[_0x0bd0('0x12')]['code']===0x1f4){logger[_0x0bd0('0x12')](_0x0bd0('0x13'),_0x502e83,_0x1d9b88[_0x0bd0('0x12')]['message']);return _0x176bf1(_0x1d9b88[_0x0bd0('0x12')][_0x0bd0('0x14')]);}logger['error'](_0x0bd0('0x13'),_0x502e83,_0x1d9b88[_0x0bd0('0x12')][_0x0bd0('0x14')]);return _0x27120a(_0x1d9b88[_0x0bd0('0x12')][_0x0bd0('0x14')]);}else{logger[_0x0bd0('0xf')]('WhatsappAccount,\x20%s,\x20%s',_0x502e83,_0x0bd0('0x10'));_0x27120a(_0x1d9b88[_0x0bd0('0x15')][_0x0bd0('0x14')]);}})[_0x0bd0('0x16')](function(_0x538254){logger[_0x0bd0('0x12')](_0x0bd0('0x13'),_0x502e83,_0x538254);_0x176bf1(_0x538254);});});}exports[_0x0bd0('0x17')]=function(_0x376074){var _0x346005=this;return new Promise(function(_0x21c614,_0x3744dc){return db[_0x0bd0('0x18')][_0x0bd0('0x19')]({'raw':_0x376074[_0x0bd0('0x1a')]?_0x376074[_0x0bd0('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x376074[_0x0bd0('0x1a')]?_0x376074[_0x0bd0('0x1a')][_0x0bd0('0x1b')]||null:null,'attributes':_0x376074[_0x0bd0('0x1a')]?_0x376074[_0x0bd0('0x1a')][_0x0bd0('0x1c')]||null:null,'include':_0x376074['options']?_0x376074[_0x0bd0('0x1a')][_0x0bd0('0x1d')]?_[_0x0bd0('0x1e')](_0x376074['options'][_0x0bd0('0x1d')],function(_0x223b37){return{'model':db[_0x223b37[_0x0bd0('0x1f')]],'as':_0x223b37['as'],'attributes':_0x223b37[_0x0bd0('0x1c')],'include':_0x223b37[_0x0bd0('0x1d')]?_[_0x0bd0('0x1e')](_0x223b37[_0x0bd0('0x1d')],function(_0xbc2c2c){return{'model':db[_0xbc2c2c[_0x0bd0('0x1f')]],'as':_0xbc2c2c['as'],'attributes':_0xbc2c2c[_0x0bd0('0x1c')],'include':_0xbc2c2c[_0x0bd0('0x1d')]?_[_0x0bd0('0x1e')](_0xbc2c2c[_0x0bd0('0x1d')],function(_0x8bd41a){return{'model':db[_0x8bd41a[_0x0bd0('0x1f')]],'as':_0x8bd41a['as'],'attributes':_0x8bd41a[_0x0bd0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0bd0('0xe')](function(_0x571360){logger['info'](_0x0bd0('0x17'),_0x376074);logger[_0x0bd0('0x20')](_0x0bd0('0x17'),_0x376074,JSON[_0x0bd0('0x11')](_0x571360));_0x21c614(_0x571360);})[_0x0bd0('0x16')](function(_0x22cf46){logger[_0x0bd0('0x12')]('ShowWhatsappAccount',_0x22cf46[_0x0bd0('0x14')],_0x376074);_0x3744dc(_0x346005[_0x0bd0('0x12')](0x1f4,_0x22cf46['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index fd71860..974d76c 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 _0xd649=['update','removeListener','register','length','./whatsappAccount.events','save'];(function(_0x41b654,_0x39239c){var _0x55c219=function(_0x1f55c0){while(--_0x1f55c0){_0x41b654['push'](_0x41b654['shift']());}};_0x55c219(++_0x39239c);}(_0xd649,0xc4));var _0x9d64=function(_0x536ff4,_0x2d493c){_0x536ff4=_0x536ff4-0x0;var _0x18a5f8=_0xd649[_0x536ff4];return _0x18a5f8;};'use strict';var WhatsappAccountEvents=require(_0x9d64('0x0'));var events=[_0x9d64('0x1'),'remove',_0x9d64('0x2')];function createListener(_0x198d20,_0x4cae79){return function(_0x519cb1){_0x4cae79['emit'](_0x198d20,_0x519cb1);};}function removeListener(_0x16771d,_0x1c408f){return function(){WhatsappAccountEvents[_0x9d64('0x3')](_0x16771d,_0x1c408f);};}exports[_0x9d64('0x4')]=function(_0x224444){for(var _0x3c33f8=0x0,_0x5a6796=events[_0x9d64('0x5')];_0x3c33f8<_0x5a6796;_0x3c33f8++){var _0x15254a=events[_0x3c33f8];var _0x2040a0=createListener('whatsappAccount:'+_0x15254a,_0x224444);WhatsappAccountEvents['on'](_0x15254a,_0x2040a0);}}; \ No newline at end of file +var _0x7b88=['register','length','whatsappAccount:','./whatsappAccount.events','remove','update','emit','removeListener'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7b88,0x11b));var _0x87b8=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x7b88[_0x82129b];return _0x2ae5dc;};'use strict';var WhatsappAccountEvents=require(_0x87b8('0x0'));var events=['save',_0x87b8('0x1'),_0x87b8('0x2')];function createListener(_0x477f7e,_0x48ee68){return function(_0x3657e9){_0x48ee68[_0x87b8('0x3')](_0x477f7e,_0x3657e9);};}function removeListener(_0x2a7888,_0x4da38b){return function(){WhatsappAccountEvents[_0x87b8('0x4')](_0x2a7888,_0x4da38b);};}exports[_0x87b8('0x5')]=function(_0x3d6c04){for(var _0x2fd41d=0x0,_0x46af68=events[_0x87b8('0x6')];_0x2fd41d<_0x46af68;_0x2fd41d++){var _0x27d044=events[_0x2fd41d];var _0x1c3185=createListener(_0x87b8('0x7')+_0x27d044,_0x3d6c04);WhatsappAccountEvents['on'](_0x27d044,_0x1c3185);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index b875dea..7886f75 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 _0xa2d3=['get','/:id','post','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xa2d3,0x168));var _0x3a2d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa2d3[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x3a2d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3a2d('0x1'));var router=express[_0x3a2d('0x2')]();var fs_extra=require(_0x3a2d('0x3'));var auth=require(_0x3a2d('0x4'));var interaction=require(_0x3a2d('0x5'));var config=require('../../config/environment');var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x3a2d('0x6')](),controller[_0x3a2d('0x7')]);router[_0x3a2d('0x8')](_0x3a2d('0x9'),auth[_0x3a2d('0x6')](),controller['show']);router[_0x3a2d('0xa')]('/',auth[_0x3a2d('0x6')](),controller['create']);router[_0x3a2d('0xb')](_0x3a2d('0x9'),auth['isAuthenticated'](),controller[_0x3a2d('0xc')]);router[_0x3a2d('0xd')](_0x3a2d('0x9'),auth[_0x3a2d('0x6')](),controller[_0x3a2d('0xe')]);module[_0x3a2d('0xf')]=router; \ No newline at end of file +var _0xaa42=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x413b4d,_0xa3459c){var _0x8b810a=function(_0x22d441){while(--_0x22d441){_0x413b4d['push'](_0x413b4d['shift']());}};_0x8b810a(++_0xa3459c);}(_0xaa42,0x19f));var _0x2aa4=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xaa42[_0x1203f];return _0x365f0a;};'use strict';var multer=require(_0x2aa4('0x0'));var util=require(_0x2aa4('0x1'));var path=require(_0x2aa4('0x2'));var timeout=require(_0x2aa4('0x3'));var express=require(_0x2aa4('0x4'));var router=express[_0x2aa4('0x5')]();var fs_extra=require(_0x2aa4('0x6'));var auth=require(_0x2aa4('0x7'));var interaction=require(_0x2aa4('0x8'));var config=require(_0x2aa4('0x9'));var controller=require(_0x2aa4('0xa'));router[_0x2aa4('0xb')]('/',auth[_0x2aa4('0xc')](),controller['index']);router['get'](_0x2aa4('0xd'),auth[_0x2aa4('0xc')](),controller[_0x2aa4('0xe')]);router[_0x2aa4('0xf')]('/',auth[_0x2aa4('0xc')](),controller[_0x2aa4('0x10')]);router[_0x2aa4('0x11')](_0x2aa4('0xd'),auth['isAuthenticated'](),controller[_0x2aa4('0x12')]);router[_0x2aa4('0x13')](_0x2aa4('0xd'),auth[_0x2aa4('0xc')](),controller[_0x2aa4('0x14')]);module[_0x2aa4('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 5771912..2c03813 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 _0x81fa=['exports','noop','STRING','*,*,*,*','sequelize'];(function(_0x3aaa8d,_0x5c334a){var _0x4517c9=function(_0x5eef3d){while(--_0x5eef3d){_0x3aaa8d['push'](_0x3aaa8d['shift']());}};_0x4517c9(++_0x5c334a);}(_0x81fa,0x176));var _0xa81f=function(_0x5aca5d,_0x3cb8a4){_0x5aca5d=_0x5aca5d-0x0;var _0x2d8b86=_0x81fa[_0x5aca5d];return _0x2d8b86;};'use strict';var Sequelize=require(_0xa81f('0x0'));module[_0xa81f('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa81f('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa81f('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa81f('0x4')}}; \ No newline at end of file +var _0x0ceb=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0ceb,0x17b));var _0xb0ce=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0ceb[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xb0ce('0x0'));module[_0xb0ce('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb0ce('0x2')],'allowNull':![],'defaultValue':_0xb0ce('0x3')},'appdata':{'type':Sequelize[_0xb0ce('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb0ce('0x2')],'defaultValue':_0xb0ce('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index c5e911d..f21ca5a 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 _0x6302=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','end','stack','name','send','index','map','WhatsappApplication','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','count','include','rows','catch','params','rawAttributes','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x5da502,_0x538c3c){var _0x1535e1=function(_0x94669a){while(--_0x94669a){_0x5da502['push'](_0x5da502['shift']());}};_0x1535e1(++_0x538c3c);}(_0x6302,0x109));var _0x2630=function(_0x5b83ac,_0x1c4f12){_0x5b83ac=_0x5b83ac-0x0;var _0x585b69=_0x6302[_0x5b83ac];return _0x585b69;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2630('0x0'));var zipdir=require(_0x2630('0x1'));var jsonpatch=require(_0x2630('0x2'));var rp=require(_0x2630('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2630('0x4'));var util=require('util');var path=require('path');var sox=require(_0x2630('0x5'));var csv=require(_0x2630('0x6'));var ejs=require(_0x2630('0x7'));var fs=require('fs');var fs_extra=require(_0x2630('0x8'));var _=require(_0x2630('0x9'));var squel=require(_0x2630('0xa'));var crypto=require(_0x2630('0xb'));var jsforce=require(_0x2630('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2630('0xd'));var Papa=require(_0x2630('0xe'));var Redis=require('ioredis');var authService=require(_0x2630('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2630('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2630('0x11'))(_0x2630('0x12'));var utils=require(_0x2630('0x13'));var config=require(_0x2630('0x14'));var licenseUtil=require(_0x2630('0x15'));var db=require(_0x2630('0x16'))['db'];function respondWithStatusCode(_0x50b8e5,_0x4424c1){_0x4424c1=_0x4424c1||0xcc;return function(_0x35ad63){if(_0x35ad63){return _0x50b8e5[_0x2630('0x17')](_0x4424c1);}return _0x50b8e5[_0x2630('0x18')](_0x4424c1)['end']();};}function respondWithResult(_0x33f40d,_0x467d72){_0x467d72=_0x467d72||0xc8;return function(_0x23179e){if(_0x23179e){return _0x33f40d['status'](_0x467d72)[_0x2630('0x19')](_0x23179e);}};}function respondWithFilteredResult(_0x53b1d2,_0x1e4731){return function(_0x37c8d7){if(_0x37c8d7){var _0x3b1b78=typeof _0x1e4731[_0x2630('0x1a')]===_0x2630('0x1b')&&typeof _0x1e4731[_0x2630('0x1c')]===_0x2630('0x1b');var _0x2c7855=_0x37c8d7['count'];var _0x427b3c=_0x3b1b78?0x0:_0x1e4731['offset'];var _0x4b6fb9=_0x3b1b78?_0x37c8d7['count']:_0x1e4731[_0x2630('0x1a')]+_0x1e4731[_0x2630('0x1c')];var _0x1fd31c;if(_0x4b6fb9>=_0x2c7855){_0x4b6fb9=_0x2c7855;_0x1fd31c=0xc8;}else{_0x1fd31c=0xce;}_0x53b1d2[_0x2630('0x18')](_0x1fd31c);return _0x53b1d2[_0x2630('0x1d')](_0x2630('0x1e'),_0x427b3c+'-'+_0x4b6fb9+'/'+_0x2c7855)[_0x2630('0x19')](_0x37c8d7);}return null;};}function patchUpdates(_0x608d15){return function(_0x13b5d5){try{jsonpatch[_0x2630('0x1f')](_0x13b5d5,_0x608d15,!![]);}catch(_0x713af1){return BPromise[_0x2630('0x20')](_0x713af1);}return _0x13b5d5['save']();};}function saveUpdates(_0x47a037,_0x2c4a50){return function(_0x42f98a){if(_0x42f98a){return _0x42f98a['update'](_0x47a037)[_0x2630('0x21')](function(_0x5c67b7){return _0x5c67b7;});}return null;};}function removeEntity(_0x452a9c,_0x3d303a){return function(_0xafc7c6){if(_0xafc7c6){return _0xafc7c6[_0x2630('0x22')]()['then'](function(){_0x452a9c[_0x2630('0x18')](0xcc)[_0x2630('0x23')]();});}};}function handleEntityNotFound(_0x126ec3,_0x81ced7){return function(_0x3468dc){if(!_0x3468dc){_0x126ec3[_0x2630('0x17')](0x194);}return _0x3468dc;};}function handleError(_0x4ef7fb,_0xb6442a){_0xb6442a=_0xb6442a||0x1f4;return function(_0x4acf70){logger['error'](_0x4acf70[_0x2630('0x24')]);if(_0x4acf70[_0x2630('0x25')]){delete _0x4acf70[_0x2630('0x25')];}_0x4ef7fb['status'](_0xb6442a)[_0x2630('0x26')](_0x4acf70);};}exports[_0x2630('0x27')]=function(_0x3e0f49,_0x4c63a5){var _0x3ad356={},_0x4ad461={},_0x336226={'count':0x0,'rows':[]};var _0x4fe723=_[_0x2630('0x28')](db[_0x2630('0x29')]['rawAttributes'],function(_0x683f3d){return{'name':_0x683f3d['fieldName'],'type':_0x683f3d['type'][_0x2630('0x2a')]};});_0x4ad461[_0x2630('0x2b')]=_['map'](_0x4fe723,_0x2630('0x25'));_0x4ad461[_0x2630('0x2c')]=_[_0x2630('0x2d')](_0x3e0f49[_0x2630('0x2c')]);_0x4ad461[_0x2630('0x2e')]=_[_0x2630('0x2f')](_0x4ad461[_0x2630('0x2b')],_0x4ad461['query']);_0x3ad356[_0x2630('0x30')]=_[_0x2630('0x2f')](_0x4ad461['model'],qs[_0x2630('0x31')](_0x3e0f49['query'][_0x2630('0x31')]));_0x3ad356['attributes']=_0x3ad356['attributes'][_0x2630('0x32')]?_0x3ad356[_0x2630('0x30')]:_0x4ad461[_0x2630('0x2b')];if(!_0x3e0f49['query'][_0x2630('0x33')](_0x2630('0x34'))){_0x3ad356['limit']=qs[_0x2630('0x1c')](_0x3e0f49[_0x2630('0x2c')]['limit']);_0x3ad356[_0x2630('0x1a')]=qs['offset'](_0x3e0f49[_0x2630('0x2c')][_0x2630('0x1a')]);}_0x3ad356['order']=qs[_0x2630('0x35')](_0x3e0f49[_0x2630('0x2c')]['sort']);_0x3ad356[_0x2630('0x36')]=qs[_0x2630('0x2e')](_[_0x2630('0x37')](_0x3e0f49[_0x2630('0x2c')],_0x4ad461[_0x2630('0x2e')]),_0x4fe723);if(_0x3e0f49[_0x2630('0x2c')][_0x2630('0x38')]){_0x3ad356[_0x2630('0x36')]=_[_0x2630('0x39')](_0x3ad356['where'],{'$or':_[_0x2630('0x28')](_0x4fe723,function(_0x52bbe5){if(_0x52bbe5[_0x2630('0x3a')]!==_0x2630('0x3b')){var _0xd67ae9={};_0xd67ae9[_0x52bbe5[_0x2630('0x25')]]={'$like':'%'+_0x3e0f49[_0x2630('0x2c')][_0x2630('0x38')]+'%'};return _0xd67ae9;}})});}_0x3ad356=_['merge']({},_0x3ad356,_0x3e0f49[_0x2630('0x3c')]);var _0x2137f4={'where':_0x3ad356['where']};return db['WhatsappApplication'][_0x2630('0x3d')](_0x2137f4)['then'](function(_0x9e4a91){_0x336226[_0x2630('0x3d')]=_0x9e4a91;if(_0x3e0f49[_0x2630('0x2c')]['includeAll']){_0x3ad356[_0x2630('0x3e')]=[{'all':!![]}];}return db[_0x2630('0x29')]['findAll'](_0x3ad356);})['then'](function(_0x181fec){_0x336226[_0x2630('0x3f')]=_0x181fec;return _0x336226;})[_0x2630('0x21')](respondWithFilteredResult(_0x4c63a5,_0x3ad356))[_0x2630('0x40')](handleError(_0x4c63a5,null));};exports['show']=function(_0x368764,_0x241354){var _0x3d3bf0={'raw':!![],'where':{'id':_0x368764[_0x2630('0x41')]['id']}},_0x45f5b0={};_0x45f5b0[_0x2630('0x2b')]=_[_0x2630('0x2d')](db['WhatsappApplication'][_0x2630('0x42')]);_0x45f5b0[_0x2630('0x2c')]=_[_0x2630('0x2d')](_0x368764[_0x2630('0x2c')]);_0x45f5b0[_0x2630('0x2e')]=_[_0x2630('0x2f')](_0x45f5b0[_0x2630('0x2b')],_0x45f5b0[_0x2630('0x2c')]);_0x3d3bf0['attributes']=_['intersection'](_0x45f5b0[_0x2630('0x2b')],qs[_0x2630('0x31')](_0x368764[_0x2630('0x2c')][_0x2630('0x31')]));_0x3d3bf0[_0x2630('0x30')]=_0x3d3bf0['attributes'][_0x2630('0x32')]?_0x3d3bf0['attributes']:_0x45f5b0[_0x2630('0x2b')];if(_0x368764['query'][_0x2630('0x43')]){_0x3d3bf0[_0x2630('0x3e')]=[{'all':!![]}];}_0x3d3bf0=_[_0x2630('0x39')]({},_0x3d3bf0,_0x368764[_0x2630('0x3c')]);return db[_0x2630('0x29')][_0x2630('0x44')](_0x3d3bf0)[_0x2630('0x21')](handleEntityNotFound(_0x241354,null))[_0x2630('0x21')](respondWithResult(_0x241354,null))['catch'](handleError(_0x241354,null));};exports[_0x2630('0x45')]=function(_0xaf34be,_0x21b87c){return db[_0x2630('0x29')]['create'](_0xaf34be[_0x2630('0x46')],{})[_0x2630('0x21')](respondWithResult(_0x21b87c,0xc9))['catch'](handleError(_0x21b87c,null));};exports['update']=function(_0x23d240,_0x35a0e5){if(_0x23d240['body']['id']){delete _0x23d240[_0x2630('0x46')]['id'];}return db[_0x2630('0x29')][_0x2630('0x44')]({'where':{'id':_0x23d240['params']['id']}})[_0x2630('0x21')](handleEntityNotFound(_0x35a0e5,null))[_0x2630('0x21')](saveUpdates(_0x23d240['body'],null))['then'](respondWithResult(_0x35a0e5,null))['catch'](handleError(_0x35a0e5,null));};exports[_0x2630('0x22')]=function(_0x25efd0,_0x524ebd){return db[_0x2630('0x29')][_0x2630('0x44')]({'where':{'id':_0x25efd0['params']['id']}})[_0x2630('0x21')](handleEntityNotFound(_0x524ebd,null))[_0x2630('0x21')](removeEntity(_0x524ebd,null))[_0x2630('0x40')](handleError(_0x524ebd,null));}; \ No newline at end of file +var _0xb7ac=['reject','save','update','then','error','stack','name','send','index','WhatsappApplication','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','fields','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','apply'];(function(_0x5b50e3,_0xdc2916){var _0x324f08=function(_0x55d1e3){while(--_0x55d1e3){_0x5b50e3['push'](_0x5b50e3['shift']());}};_0x324f08(++_0xdc2916);}(_0xb7ac,0x18a));var _0xcb7a=function(_0x58d1fc,_0x1ce9b5){_0x58d1fc=_0x58d1fc-0x0;var _0x514740=_0xb7ac[_0x58d1fc];return _0x514740;};'use strict';var emlformat=require(_0xcb7a('0x0'));var rimraf=require(_0xcb7a('0x1'));var zipdir=require(_0xcb7a('0x2'));var jsonpatch=require(_0xcb7a('0x3'));var rp=require(_0xcb7a('0x4'));var moment=require('moment');var BPromise=require(_0xcb7a('0x5'));var Mustache=require('mustache');var util=require(_0xcb7a('0x6'));var path=require(_0xcb7a('0x7'));var sox=require('sox');var csv=require(_0xcb7a('0x8'));var ejs=require(_0xcb7a('0x9'));var fs=require('fs');var fs_extra=require(_0xcb7a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcb7a('0xb'));var jsforce=require(_0xcb7a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcb7a('0x8'));var querystring=require(_0xcb7a('0xd'));var Papa=require(_0xcb7a('0xe'));var Redis=require(_0xcb7a('0xf'));var authService=require(_0xcb7a('0x10'));var qs=require(_0xcb7a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcb7a('0x12'));var logger=require(_0xcb7a('0x13'))(_0xcb7a('0x14'));var utils=require('../../config/utils');var config=require(_0xcb7a('0x15'));var licenseUtil=require(_0xcb7a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x260f43,_0x3ec2fe){_0x3ec2fe=_0x3ec2fe||0xcc;return function(_0x29a931){if(_0x29a931){return _0x260f43[_0xcb7a('0x17')](_0x3ec2fe);}return _0x260f43[_0xcb7a('0x18')](_0x3ec2fe)[_0xcb7a('0x19')]();};}function respondWithResult(_0x37459c,_0x1050ca){_0x1050ca=_0x1050ca||0xc8;return function(_0x1669ed){if(_0x1669ed){return _0x37459c['status'](_0x1050ca)[_0xcb7a('0x1a')](_0x1669ed);}};}function respondWithFilteredResult(_0x54b0ce,_0x3b3851){return function(_0x38acef){if(_0x38acef){var _0x7f1071=typeof _0x3b3851[_0xcb7a('0x1b')]==='undefined'&&typeof _0x3b3851[_0xcb7a('0x1c')]===_0xcb7a('0x1d');var _0x28d09d=_0x38acef[_0xcb7a('0x1e')];var _0x118dde=_0x7f1071?0x0:_0x3b3851[_0xcb7a('0x1b')];var _0x119bb2=_0x7f1071?_0x38acef['count']:_0x3b3851[_0xcb7a('0x1b')]+_0x3b3851[_0xcb7a('0x1c')];var _0x1c6630;if(_0x119bb2>=_0x28d09d){_0x119bb2=_0x28d09d;_0x1c6630=0xc8;}else{_0x1c6630=0xce;}_0x54b0ce[_0xcb7a('0x18')](_0x1c6630);return _0x54b0ce['set']('Content-Range',_0x118dde+'-'+_0x119bb2+'/'+_0x28d09d)['json'](_0x38acef);}return null;};}function patchUpdates(_0x25a27e){return function(_0x54de2c){try{jsonpatch[_0xcb7a('0x1f')](_0x54de2c,_0x25a27e,!![]);}catch(_0x112d6e){return BPromise[_0xcb7a('0x20')](_0x112d6e);}return _0x54de2c[_0xcb7a('0x21')]();};}function saveUpdates(_0x45e54b,_0x26f4a4){return function(_0x18da58){if(_0x18da58){return _0x18da58[_0xcb7a('0x22')](_0x45e54b)[_0xcb7a('0x23')](function(_0x120bbc){return _0x120bbc;});}return null;};}function removeEntity(_0x63dd64,_0x5a29a7){return function(_0x5c9191){if(_0x5c9191){return _0x5c9191['destroy']()[_0xcb7a('0x23')](function(){_0x63dd64[_0xcb7a('0x18')](0xcc)[_0xcb7a('0x19')]();});}};}function handleEntityNotFound(_0x28682a,_0x4830ff){return function(_0x527ae8){if(!_0x527ae8){_0x28682a[_0xcb7a('0x17')](0x194);}return _0x527ae8;};}function handleError(_0x282350,_0x2c59d8){_0x2c59d8=_0x2c59d8||0x1f4;return function(_0x558c42){logger[_0xcb7a('0x24')](_0x558c42[_0xcb7a('0x25')]);if(_0x558c42['name']){delete _0x558c42[_0xcb7a('0x26')];}_0x282350[_0xcb7a('0x18')](_0x2c59d8)[_0xcb7a('0x27')](_0x558c42);};}exports[_0xcb7a('0x28')]=function(_0x4680ea,_0x5ba723){var _0x3aa77c={},_0x59c56a={},_0x291580={'count':0x0,'rows':[]};var _0x4ebadb=_['map'](db[_0xcb7a('0x29')][_0xcb7a('0x2a')],function(_0x38be8b){return{'name':_0x38be8b[_0xcb7a('0x2b')],'type':_0x38be8b[_0xcb7a('0x2c')]['key']};});_0x59c56a[_0xcb7a('0x2d')]=_[_0xcb7a('0x2e')](_0x4ebadb,_0xcb7a('0x26'));_0x59c56a[_0xcb7a('0x2f')]=_[_0xcb7a('0x30')](_0x4680ea[_0xcb7a('0x2f')]);_0x59c56a[_0xcb7a('0x31')]=_[_0xcb7a('0x32')](_0x59c56a[_0xcb7a('0x2d')],_0x59c56a[_0xcb7a('0x2f')]);_0x3aa77c[_0xcb7a('0x33')]=_[_0xcb7a('0x32')](_0x59c56a[_0xcb7a('0x2d')],qs['fields'](_0x4680ea[_0xcb7a('0x2f')]['fields']));_0x3aa77c[_0xcb7a('0x33')]=_0x3aa77c[_0xcb7a('0x33')][_0xcb7a('0x34')]?_0x3aa77c[_0xcb7a('0x33')]:_0x59c56a['model'];if(!_0x4680ea[_0xcb7a('0x2f')]['hasOwnProperty'](_0xcb7a('0x35'))){_0x3aa77c[_0xcb7a('0x1c')]=qs[_0xcb7a('0x1c')](_0x4680ea['query'][_0xcb7a('0x1c')]);_0x3aa77c[_0xcb7a('0x1b')]=qs['offset'](_0x4680ea[_0xcb7a('0x2f')][_0xcb7a('0x1b')]);}_0x3aa77c[_0xcb7a('0x36')]=qs[_0xcb7a('0x37')](_0x4680ea['query'][_0xcb7a('0x37')]);_0x3aa77c[_0xcb7a('0x38')]=qs[_0xcb7a('0x31')](_['pick'](_0x4680ea[_0xcb7a('0x2f')],_0x59c56a[_0xcb7a('0x31')]),_0x4ebadb);if(_0x4680ea[_0xcb7a('0x2f')][_0xcb7a('0x39')]){_0x3aa77c[_0xcb7a('0x38')]=_[_0xcb7a('0x3a')](_0x3aa77c['where'],{'$or':_[_0xcb7a('0x2e')](_0x4ebadb,function(_0x2d8d71){if(_0x2d8d71[_0xcb7a('0x2c')]!==_0xcb7a('0x3b')){var _0x4c4dfc={};_0x4c4dfc[_0x2d8d71[_0xcb7a('0x26')]]={'$like':'%'+_0x4680ea[_0xcb7a('0x2f')][_0xcb7a('0x39')]+'%'};return _0x4c4dfc;}})});}_0x3aa77c=_[_0xcb7a('0x3a')]({},_0x3aa77c,_0x4680ea[_0xcb7a('0x3c')]);var _0x52c756={'where':_0x3aa77c[_0xcb7a('0x38')]};return db[_0xcb7a('0x29')][_0xcb7a('0x1e')](_0x52c756)[_0xcb7a('0x23')](function(_0x25395b){_0x291580['count']=_0x25395b;if(_0x4680ea['query']['includeAll']){_0x3aa77c[_0xcb7a('0x3d')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xcb7a('0x3e')](_0x3aa77c);})[_0xcb7a('0x23')](function(_0xe6b453){_0x291580['rows']=_0xe6b453;return _0x291580;})[_0xcb7a('0x23')](respondWithFilteredResult(_0x5ba723,_0x3aa77c))[_0xcb7a('0x3f')](handleError(_0x5ba723,null));};exports[_0xcb7a('0x40')]=function(_0xb33841,_0x5363a9){var _0x11e73d={'raw':!![],'where':{'id':_0xb33841[_0xcb7a('0x41')]['id']}},_0x318147={};_0x318147[_0xcb7a('0x2d')]=_['keys'](db[_0xcb7a('0x29')][_0xcb7a('0x2a')]);_0x318147['query']=_[_0xcb7a('0x30')](_0xb33841['query']);_0x318147[_0xcb7a('0x31')]=_['intersection'](_0x318147[_0xcb7a('0x2d')],_0x318147['query']);_0x11e73d['attributes']=_[_0xcb7a('0x32')](_0x318147[_0xcb7a('0x2d')],qs[_0xcb7a('0x42')](_0xb33841['query'][_0xcb7a('0x42')]));_0x11e73d[_0xcb7a('0x33')]=_0x11e73d[_0xcb7a('0x33')][_0xcb7a('0x34')]?_0x11e73d[_0xcb7a('0x33')]:_0x318147['model'];if(_0xb33841[_0xcb7a('0x2f')]['includeAll']){_0x11e73d[_0xcb7a('0x3d')]=[{'all':!![]}];}_0x11e73d=_[_0xcb7a('0x3a')]({},_0x11e73d,_0xb33841[_0xcb7a('0x3c')]);return db[_0xcb7a('0x29')][_0xcb7a('0x43')](_0x11e73d)[_0xcb7a('0x23')](handleEntityNotFound(_0x5363a9,null))[_0xcb7a('0x23')](respondWithResult(_0x5363a9,null))[_0xcb7a('0x3f')](handleError(_0x5363a9,null));};exports[_0xcb7a('0x44')]=function(_0x445d63,_0x3c1f9a){return db[_0xcb7a('0x29')][_0xcb7a('0x44')](_0x445d63[_0xcb7a('0x45')],{})[_0xcb7a('0x23')](respondWithResult(_0x3c1f9a,0xc9))[_0xcb7a('0x3f')](handleError(_0x3c1f9a,null));};exports['update']=function(_0x440c9e,_0xca7b9b){if(_0x440c9e[_0xcb7a('0x45')]['id']){delete _0x440c9e[_0xcb7a('0x45')]['id'];}return db[_0xcb7a('0x29')][_0xcb7a('0x43')]({'where':{'id':_0x440c9e[_0xcb7a('0x41')]['id']}})['then'](handleEntityNotFound(_0xca7b9b,null))[_0xcb7a('0x23')](saveUpdates(_0x440c9e[_0xcb7a('0x45')],null))[_0xcb7a('0x23')](respondWithResult(_0xca7b9b,null))[_0xcb7a('0x3f')](handleError(_0xca7b9b,null));};exports[_0xcb7a('0x46')]=function(_0x2ce33b,_0x147614){return db[_0xcb7a('0x29')][_0xcb7a('0x43')]({'where':{'id':_0x2ce33b[_0xcb7a('0x41')]['id']}})[_0xcb7a('0x23')](handleEntityNotFound(_0x147614,null))[_0xcb7a('0x23')](removeEntity(_0x147614,null))[_0xcb7a('0x3f')](handleError(_0x147614,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 37bc19d..ddf57fc 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 _0x99e9=['util','../../config/logger','api','moment','request-promise','path','rimraf','./whatsappApplication.attributes','define','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x132a9a,_0x4da489){var _0x9dd201=function(_0x20435d){while(--_0x20435d){_0x132a9a['push'](_0x132a9a['shift']());}};_0x9dd201(++_0x4da489);}(_0x99e9,0xb4));var _0x999e=function(_0x4ded50,_0x4a6af3){_0x4ded50=_0x4ded50-0x0;var _0xa92135=_0x99e9[_0x4ded50];return _0xa92135;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var logger=require(_0x999e('0x1'))(_0x999e('0x2'));var moment=require(_0x999e('0x3'));var BPromise=require('bluebird');var rp=require(_0x999e('0x4'));var fs=require('fs');var path=require(_0x999e('0x5'));var rimraf=require(_0x999e('0x6'));var config=require('../../config/environment');var attributes=require(_0x999e('0x7'));module['exports']=function(_0x25421f,_0x1bda0a){return _0x25421f[_0x999e('0x8')](_0x999e('0x9'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x999e('0xa'),'collate':_0x999e('0xb')});}; \ No newline at end of file +var _0xf23b=['request-promise','path','rimraf','./whatsappApplication.attributes','exports','define','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x3d5a73,_0x2939d2){var _0x7f5050=function(_0x51f456){while(--_0x51f456){_0x3d5a73['push'](_0x3d5a73['shift']());}};_0x7f5050(++_0x2939d2);}(_0xf23b,0x133));var _0xbf23=function(_0x26eb2f,_0x1b7135){_0x26eb2f=_0x26eb2f-0x0;var _0x30509d=_0xf23b[_0x26eb2f];return _0x30509d;};'use strict';var _=require(_0xbf23('0x0'));var util=require(_0xbf23('0x1'));var logger=require(_0xbf23('0x2'))(_0xbf23('0x3'));var moment=require(_0xbf23('0x4'));var BPromise=require('bluebird');var rp=require(_0xbf23('0x5'));var fs=require('fs');var path=require(_0xbf23('0x6'));var rimraf=require(_0xbf23('0x7'));var config=require('../../config/environment');var attributes=require(_0xbf23('0x8'));module[_0xbf23('0x9')]=function(_0xc5e7dd,_0x393a52){return _0xc5e7dd[_0xbf23('0xa')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbf23('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 1764b96..97fe338 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','WhatsappApplication,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x1c09d3,_0x597d63){var _0x4e78e0=function(_0x424c85){while(--_0x424c85){_0x1c09d3['push'](_0x1c09d3['shift']());}};_0x4e78e0(++_0x597d63);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0x5fd1=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x30e9e3,_0x3743a5){var _0x3365d8=function(_0x264ea1){while(--_0x264ea1){_0x30e9e3['push'](_0x30e9e3['shift']());}};_0x3365d8(++_0x3743a5);}(_0x5fd1,0x155));var _0x15fd=function(_0x76c201,_0x49358c){_0x76c201=_0x76c201-0x0;var _0x13ee67=_0x5fd1[_0x76c201];return _0x13ee67;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){return client[_0x15fd('0xa')](_0x2e88bf,_0x534e63)['then'](function(_0x2d2fbb){logger['info'](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x225728,'request\x20sent',JSON[_0x15fd('0xd')](_0x2d2fbb));if(_0x2d2fbb[_0x15fd('0xe')]){if(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0xf')]===0x1f4){logger[_0x15fd('0xe')](_0x15fd('0xb'),_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x1ee117(_0x2d2fbb[_0x15fd('0xe')]['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x210e90(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);}else{logger[_0x15fd('0x11')](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));_0x210e90(_0x2d2fbb[_0x15fd('0x12')]['message']);}})['catch'](function(_0x25f139){logger['error'](_0x15fd('0xb'),_0x225728,_0x25f139);_0x1ee117(_0x25f139);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 8de8545..ee8c77c 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 _0x8375=['post','create','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','delete','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download'];(function(_0x36b250,_0x2eea78){var _0x567ca8=function(_0xe72023){while(--_0xe72023){_0x36b250['push'](_0x36b250['shift']());}};_0x567ca8(++_0x2eea78);}(_0x8375,0xa8));var _0x5837=function(_0x556809,_0x5ed33a){_0x556809=_0x556809-0x0;var _0x54b3df=_0x8375[_0x556809];return _0x54b3df;};'use strict';var multer=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var path=require(_0x5837('0x2'));var timeout=require('connect-timeout');var express=require(_0x5837('0x3'));var router=express[_0x5837('0x4')]();var fs_extra=require(_0x5837('0x5'));var auth=require(_0x5837('0x6'));var interaction=require(_0x5837('0x7'));var config=require(_0x5837('0x8'));var controller=require('./whatsappInteraction.controller');router[_0x5837('0x9')]('/',auth[_0x5837('0xa')](),controller[_0x5837('0xb')]);router[_0x5837('0x9')](_0x5837('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x5837('0x9')](_0x5837('0xd'),auth['isAuthenticated'](),controller[_0x5837('0xe')]);router['get'](_0x5837('0xf'),auth[_0x5837('0xa')](),controller[_0x5837('0x10')]);router[_0x5837('0x9')](_0x5837('0x11'),auth[_0x5837('0xa')](),controller['download']);router[_0x5837('0x12')]('/',auth[_0x5837('0xa')](),controller[_0x5837('0x13')]);router[_0x5837('0x12')](_0x5837('0xf'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x5837('0x14'),auth[_0x5837('0xa')](),interaction[_0x5837('0x15')](_0x5837('0x16'),_0x5837('0x17')),controller[_0x5837('0x18')]);router[_0x5837('0x19')](_0x5837('0xd'),auth[_0x5837('0xa')](),interaction['tracked'](_0x5837('0x16'),_0x5837('0x1a')),controller['update']);router[_0x5837('0x1b')](_0x5837('0xd'),auth[_0x5837('0xa')](),interaction['tracked']('whatsapp','whatsappinteraction:destroy'),controller[_0x5837('0x1c')]);router[_0x5837('0x1b')](_0x5837('0x14'),auth['isAuthenticated'](),controller[_0x5837('0x1d')]);module[_0x5837('0x1e')]=router; \ No newline at end of file +var _0x7046=['whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','whatsapp','addTags','put','/:id','whatsappinteraction:update','update','delete'];(function(_0x540d69,_0x182cab){var _0xafdc12=function(_0x30fec8){while(--_0x30fec8){_0x540d69['push'](_0x540d69['shift']());}};_0xafdc12(++_0x182cab);}(_0x7046,0x144));var _0x6704=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7046[_0xfae23b];return _0x200640;};'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['download']);router[_0x6704('0x11')]('/',auth[_0x6704('0xa')](),controller['create']);router[_0x6704('0x11')](_0x6704('0xe'),auth[_0x6704('0xa')](),controller[_0x6704('0x12')]);router[_0x6704('0x11')](_0x6704('0x13'),auth[_0x6704('0xa')](),interaction[_0x6704('0x14')](_0x6704('0x15'),'whatsappinteraction:addtags'),controller[_0x6704('0x16')]);router[_0x6704('0x17')](_0x6704('0x18'),auth['isAuthenticated'](),interaction[_0x6704('0x14')](_0x6704('0x15'),_0x6704('0x19')),controller[_0x6704('0x1a')]);router[_0x6704('0x1b')]('/:id',auth[_0x6704('0xa')](),interaction[_0x6704('0x14')](_0x6704('0x15'),_0x6704('0x1c')),controller[_0x6704('0x1d')]);router['delete'](_0x6704('0x13'),auth[_0x6704('0xa')](),controller[_0x6704('0x1e')]);module[_0x6704('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index dead325..65eaa4f 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 _0xc933=['INTEGER','sequelize','moment','exports','BOOLEAN','DATE','STRING','out'];(function(_0x549b29,_0x2e2b00){var _0x2b813f=function(_0x43234f){while(--_0x43234f){_0x549b29['push'](_0x549b29['shift']());}};_0x2b813f(++_0x2e2b00);}(_0xc933,0xf9));var _0x3c93=function(_0x3c7b7b,_0x2be772){_0x3c7b7b=_0x3c7b7b-0x0;var _0x2ca4f0=_0xc933[_0x3c7b7b];return _0x2ca4f0;};'use strict';var Sequelize=require(_0x3c93('0x0'));var moment=require(_0x3c93('0x1'));module[_0x3c93('0x2')]={'closed':{'type':Sequelize[_0x3c93('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3c93('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x3c93('0x5')]},'thirdDisposition':{'type':Sequelize[_0x3c93('0x5')]},'note':{'type':Sequelize[_0x3c93('0x5')]},'phone':{'type':Sequelize[_0x3c93('0x5')]},'read1stAt':{'type':Sequelize[_0x3c93('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x3c93('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3c93('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3c93('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x3c93('0x7')]}}; \ No newline at end of file +var _0x315f=['out','ENUM','BOOLEAN','INTEGER','sequelize','exports','STRING','DATE'];(function(_0xb292f9,_0x42a4bc){var _0x366dab=function(_0x3c8359){while(--_0x3c8359){_0xb292f9['push'](_0xb292f9['shift']());}};_0x366dab(++_0x42a4bc);}(_0x315f,0x174));var _0xf315=function(_0x43941d,_0x45fd0d){_0x43941d=_0x43941d-0x0;var _0x27b82a=_0x315f[_0x43941d];return _0x27b82a;};'use strict';var Sequelize=require(_0xf315('0x0'));var moment=require('moment');module[_0xf315('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf315('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xf315('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf315('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf315('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xf315('0x5')]('in',_0xf315('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf315('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xf315('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index ca0ff8a..76f042d 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 _0x0648=['merge','find','catch','create','body','params','describe','addMessage','WhatsappMessage','omit','ids','getMessages','intersection','hasOwnProperty','order','sort','where','pick','WhatsappInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','spread','color','emit','whatsappInteractionTags:save','removeTags','download','join','root','server','files','attachments','format','transcript-%d-%s.zip','push','User','fullname','Contact','lastName','Attachment','createdAt','direction','secret','read','WhatsappAccount','Account','mkdirSync','Owner','N.A.','toString','closed','closedAt','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','value','renderFile','views','transcript-','.pdf','Whatsapp','createPdfFromHTML','unlinkSync','moment','bluebird','util','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','./whatsappInteraction.socket','register','sendStatus','status','end','json','limit','count','offset','set','Content-Range','then','destroy','error','name','index','map','WhatsappInteraction','rawAttributes','type','key','getOptions','findAll','query','user','show','keys','filters','model','attributes','fields','length','includeAll','include'];(function(_0x4ae21b,_0x5d0e84){var _0xa7f05a=function(_0x2a6523){while(--_0x2a6523){_0x4ae21b['push'](_0x4ae21b['shift']());}};_0xa7f05a(++_0x5d0e84);}(_0x0648,0x1a5));var _0x8064=function(_0x3e6258,_0x247fe8){_0x3e6258=_0x3e6258-0x0;var _0x57e095=_0x0648[_0x3e6258];return _0x57e095;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x8064('0x0'));var BPromise=require(_0x8064('0x1'));var util=require(_0x8064('0x2'));var path=require('path');var ejs=require(_0x8064('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x8064('0x4'));var interaction=require(_0x8064('0x5'));var qs=require(_0x8064('0x6'));var pdf=require(_0x8064('0x7'));var logger=require(_0x8064('0x8'))('api');var config=require(_0x8064('0x9'));var db=require(_0x8064('0xa'))['db'];config[_0x8064('0xb')]=_['defaults'](config[_0x8064('0xb')],{'host':_0x8064('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8064('0xb')]));require(_0x8064('0xd'))[_0x8064('0xe')](socket);function respondWithStatusCode(_0x3b4b4b,_0x2e07a2){_0x2e07a2=_0x2e07a2||0xcc;return function(_0x39805f){if(_0x39805f){return _0x3b4b4b[_0x8064('0xf')](_0x2e07a2);}return _0x3b4b4b[_0x8064('0x10')](_0x2e07a2)[_0x8064('0x11')]();};}function respondWithResult(_0x21aa07,_0xc5e340){_0xc5e340=_0xc5e340||0xc8;return function(_0x26558e){if(_0x26558e){return _0x21aa07[_0x8064('0x10')](_0xc5e340)[_0x8064('0x12')](_0x26558e);}};}function respondWithFilteredResult(_0x162e1f,_0x2a718e){return function(_0x51744b){if(_0x51744b){var _0x5bddd3=typeof _0x2a718e['offset']==='undefined'&&typeof _0x2a718e[_0x8064('0x13')]==='undefined';var _0x3b4e52=_0x51744b[_0x8064('0x14')];var _0xb55bc8=_0x5bddd3?0x0:_0x2a718e[_0x8064('0x15')];var _0x5ee9a5=_0x5bddd3?_0x51744b[_0x8064('0x14')]:_0x2a718e[_0x8064('0x15')]+_0x2a718e[_0x8064('0x13')];var _0x3b47d0;if(_0x5ee9a5>=_0x3b4e52){_0x5ee9a5=_0x3b4e52;_0x3b47d0=0xc8;}else{_0x3b47d0=0xce;}_0x162e1f[_0x8064('0x10')](_0x3b47d0);return _0x162e1f[_0x8064('0x16')](_0x8064('0x17'),_0xb55bc8+'-'+_0x5ee9a5+'/'+_0x3b4e52)[_0x8064('0x12')](_0x51744b);}return null;};}function saveUpdates(_0x1e9eea){return function(_0x31a341){if(_0x31a341){return _0x31a341['update'](_0x1e9eea)[_0x8064('0x18')](function(_0x54324d){return _0x54324d;});}return null;};}function removeEntity(_0x4309c4){return function(_0x1c5127){if(_0x1c5127){return _0x1c5127[_0x8064('0x19')]()['then'](function(){_0x4309c4[_0x8064('0x10')](0xcc)[_0x8064('0x11')]();});}};}function handleEntityNotFound(_0xe8bb1e){return function(_0x29ffac){if(!_0x29ffac){_0xe8bb1e[_0x8064('0xf')](0x194);}return _0x29ffac;};}function handleError(_0x48b5d1,_0xfb97d0){_0xfb97d0=_0xfb97d0||0x1f4;return function(_0x2f9f7f){logger[_0x8064('0x1a')](_0x2f9f7f['stack']);if(_0x2f9f7f[_0x8064('0x1b')]){delete _0x2f9f7f[_0x8064('0x1b')];}_0x48b5d1[_0x8064('0x10')](_0xfb97d0)['send'](_0x2f9f7f);};}exports[_0x8064('0x1c')]=function(_0x3274c1,_0x319c94){var _0x8bc6a1={};var _0xd3518d=_[_0x8064('0x1d')](db[_0x8064('0x1e')][_0x8064('0x1f')],function(_0x5a332e){return{'name':_0x5a332e['fieldName'],'type':_0x5a332e[_0x8064('0x20')][_0x8064('0x21')]};});_0x8bc6a1=qs[_0x8064('0x22')](_0xd3518d,_0x3274c1);return interaction[_0x8064('0x23')]('whatsapp',_0x3274c1[_0x8064('0x24')],_0x3274c1[_0x8064('0x25')],_0x8bc6a1,_0xd3518d)[_0x8064('0x18')](respondWithFilteredResult(_0x319c94,_0x8bc6a1))['catch'](handleError(_0x319c94,null));};exports[_0x8064('0x26')]=function(_0x1c0ba8,_0x28c05d){var _0x53bdb5={'raw':![],'where':{'id':_0x1c0ba8['params']['id']}},_0x5e8cbb={};_0x5e8cbb['model']=_['keys'](db['WhatsappInteraction']['rawAttributes']);_0x5e8cbb['query']=_[_0x8064('0x27')](_0x1c0ba8['query']);_0x5e8cbb[_0x8064('0x28')]=_['intersection'](_0x5e8cbb[_0x8064('0x29')],_0x5e8cbb[_0x8064('0x24')]);_0x53bdb5[_0x8064('0x2a')]=_['intersection'](_0x5e8cbb[_0x8064('0x29')],qs[_0x8064('0x2b')](_0x1c0ba8['query'][_0x8064('0x2b')]));_0x53bdb5[_0x8064('0x2a')]=_0x53bdb5[_0x8064('0x2a')][_0x8064('0x2c')]?_0x53bdb5[_0x8064('0x2a')]:_0x5e8cbb[_0x8064('0x29')];if(_0x1c0ba8[_0x8064('0x24')][_0x8064('0x2d')]){_0x53bdb5[_0x8064('0x2e')]=[{'all':!![]}];}_0x53bdb5=_[_0x8064('0x2f')]({},_0x53bdb5,_0x1c0ba8['options']);return db[_0x8064('0x1e')][_0x8064('0x30')](_0x53bdb5)[_0x8064('0x18')](handleEntityNotFound(_0x28c05d,null))[_0x8064('0x18')](respondWithResult(_0x28c05d,null))[_0x8064('0x31')](handleError(_0x28c05d,null));};exports[_0x8064('0x32')]=function(_0x52d41f,_0x582648){return db[_0x8064('0x1e')][_0x8064('0x32')](_0x52d41f[_0x8064('0x33')],{})['then'](respondWithResult(_0x582648,0xc9))[_0x8064('0x31')](handleError(_0x582648,null));};exports['update']=function(_0x5c3fe2,_0x3d8686){if(_0x5c3fe2['body']['id']){delete _0x5c3fe2[_0x8064('0x33')]['id'];}return db[_0x8064('0x1e')]['find']({'where':{'id':_0x5c3fe2[_0x8064('0x34')]['id']}})['then'](handleEntityNotFound(_0x3d8686,null))['then'](saveUpdates(_0x5c3fe2[_0x8064('0x33')],null))[_0x8064('0x18')](respondWithResult(_0x3d8686,null))[_0x8064('0x31')](handleError(_0x3d8686,null));};exports[_0x8064('0x19')]=function(_0x571347,_0x6d1134){return db[_0x8064('0x1e')][_0x8064('0x30')]({'where':{'id':_0x571347[_0x8064('0x34')]['id']}})[_0x8064('0x18')](handleEntityNotFound(_0x6d1134,null))['then'](removeEntity(_0x6d1134,null))['catch'](handleError(_0x6d1134,null));};exports[_0x8064('0x35')]=function(_0x2cdc2d,_0x34612b){return db['WhatsappInteraction'][_0x8064('0x35')]()['then'](respondWithResult(_0x34612b,null))['catch'](handleError(_0x34612b,null));};exports[_0x8064('0x36')]=function(_0x4c38bd,_0x3e1f99){return db[_0x8064('0x37')][_0x8064('0x30')]({'where':{'id':_0x4c38bd['params']['id']}})[_0x8064('0x18')](handleEntityNotFound(_0x3e1f99,null))[_0x8064('0x18')](function(_0x25954a){if(_0x25954a){return _0x25954a[_0x8064('0x36')](_0x4c38bd[_0x8064('0x33')]['ids'],_[_0x8064('0x38')](_0x4c38bd['body'],[_0x8064('0x39'),'id'])||{});}})[_0x8064('0x18')](respondWithResult(_0x3e1f99,null))['catch'](handleError(_0x3e1f99,null));};exports[_0x8064('0x3a')]=function(_0x4f25d3,_0x101487){var _0x737b69={'raw':![],'where':{}};var _0x56a6a4={};var _0x20443d={'count':0x0,'rows':[]};return db[_0x8064('0x1e')]['findOne']({'where':{'id':_0x4f25d3[_0x8064('0x34')]['id']}})['then'](handleEntityNotFound(_0x101487,null))['then'](function(_0xac1481){if(_0xac1481){_0x56a6a4[_0x8064('0x29')]=_[_0x8064('0x27')](db[_0x8064('0x37')][_0x8064('0x1f')]);_0x56a6a4['query']=_[_0x8064('0x27')](_0x4f25d3['query']);_0x56a6a4['filters']=_[_0x8064('0x3b')](_0x56a6a4[_0x8064('0x29')],_0x56a6a4[_0x8064('0x24')]);_0x737b69[_0x8064('0x2a')]=_[_0x8064('0x3b')](_0x56a6a4[_0x8064('0x29')],qs[_0x8064('0x2b')](_0x4f25d3['query'][_0x8064('0x2b')]));_0x737b69[_0x8064('0x2a')]=_0x737b69[_0x8064('0x2a')][_0x8064('0x2c')]?_0x737b69['attributes']:_0x56a6a4['model'];if(!_0x4f25d3[_0x8064('0x24')][_0x8064('0x3c')]('nolimit')){_0x737b69[_0x8064('0x13')]=qs[_0x8064('0x13')](_0x4f25d3[_0x8064('0x24')][_0x8064('0x13')]);_0x737b69[_0x8064('0x15')]=qs['offset'](_0x4f25d3[_0x8064('0x24')][_0x8064('0x15')]);}_0x737b69[_0x8064('0x3d')]=qs[_0x8064('0x3e')](_0x4f25d3['query'][_0x8064('0x3e')]);_0x737b69[_0x8064('0x3f')]=qs[_0x8064('0x28')](_[_0x8064('0x40')](_0x4f25d3[_0x8064('0x24')],_0x56a6a4[_0x8064('0x28')]));_0x737b69[_0x8064('0x3f')][_0x8064('0x41')]=_0xac1481['id'];if(_0x4f25d3[_0x8064('0x24')][_0x8064('0x42')]){_0x737b69[_0x8064('0x3f')]=_[_0x8064('0x2f')](_0x737b69[_0x8064('0x3f')],{'$or':_[_0x8064('0x1d')](_0x737b69[_0x8064('0x2a')],function(_0x2d1c50){var _0x16a65a={};_0x16a65a[_0x2d1c50]={'$like':'%'+_0x4f25d3[_0x8064('0x24')][_0x8064('0x42')]+'%'};return _0x16a65a;})});}if(_0x4f25d3[_0x8064('0x24')][_0x8064('0x43')]){var _0x4c8b6c=_0x4f25d3[_0x8064('0x24')][_0x8064('0x43')][_0x8064('0x44')](',');var _0x2afd49={};_0x2afd49[_0x4c8b6c[0x0]]={'$gte':moment(_0x4c8b6c[0x1])['format'](_0x8064('0x45'))};_0x737b69[_0x8064('0x3f')]=_[_0x8064('0x2f')](_0x737b69['where'],_0x2afd49);}_0x737b69=_[_0x8064('0x2f')]({},_0x737b69,_0x4f25d3['options']);return db[_0x8064('0x37')][_0x8064('0x14')]({'where':_0x737b69[_0x8064('0x3f')]})['then'](function(_0xafb493){_0x20443d[_0x8064('0x14')]=_0xafb493;if(_0x4f25d3[_0x8064('0x24')][_0x8064('0x2d')]){_0x737b69[_0x8064('0x2e')]=[{'all':!![]}];}return db[_0x8064('0x37')][_0x8064('0x23')](_0x737b69);})['then'](function(_0x573359){_0x20443d['rows']=_0x573359;return _0x20443d;});}})[_0x8064('0x18')](respondWithFilteredResult(_0x101487,_0x737b69))['catch'](handleError(_0x101487,null));};exports['addTags']=function(_0x530a35,_0x3bf9a9){return db['WhatsappInteraction'][_0x8064('0x30')]({'where':{'id':_0x530a35[_0x8064('0x34')]['id']}})['then'](handleEntityNotFound(_0x3bf9a9,null))[_0x8064('0x18')](function(_0x32b9ee){if(_0x32b9ee){return _0x32b9ee['setTags'](_0x530a35[_0x8064('0x33')][_0x8064('0x39')],_['omit'](_0x530a35[_0x8064('0x33')],['ids','id'])||{})[_0x8064('0x46')](function(){return db['Tag'][_0x8064('0x23')]({'attributes':['id','name',_0x8064('0x47')],'where':{'id':_0x530a35[_0x8064('0x33')][_0x8064('0x39')]}});})['then'](function(_0x42f3b0){socket[_0x8064('0x48')](_0x8064('0x49'),{'id':Number(_0x530a35['params']['id']),'tags':_0x42f3b0||[]});return{'id':Number(_0x530a35[_0x8064('0x34')]['id']),'tags':_0x42f3b0||[]};});}})['then'](respondWithResult(_0x3bf9a9,null))[_0x8064('0x31')](handleError(_0x3bf9a9,null));};exports[_0x8064('0x4a')]=function(_0x4e37c9,_0x415743){return db[_0x8064('0x1e')][_0x8064('0x30')]({'where':{'id':_0x4e37c9[_0x8064('0x34')]['id']}})[_0x8064('0x18')](handleEntityNotFound(_0x415743,null))[_0x8064('0x18')](function(_0x2a5d4e){if(_0x2a5d4e){return _0x2a5d4e[_0x8064('0x4a')](_0x4e37c9[_0x8064('0x24')]['ids']);}})[_0x8064('0x18')](respondWithStatusCode(_0x415743,null))['catch'](handleError(_0x415743,null));};exports[_0x8064('0x4b')]=function(_0x1b619d,_0x2fd6a0){var _0x20a2a8=moment()['unix']()['toString']();var _0x417ec9=path[_0x8064('0x4c')](config[_0x8064('0x4d')],_0x8064('0x4e'),'files','tmp');var _0x2cd908=path[_0x8064('0x4c')](config['root'],'server',_0x8064('0x4f'),_0x8064('0x50'));var _0x4205df=path[_0x8064('0x4c')](_0x417ec9,_0x20a2a8);var _0x509ad3=util[_0x8064('0x51')](_0x8064('0x52'),_0x1b619d['params']['id'],_0x20a2a8);var _0x136b66=path[_0x8064('0x4c')](_0x417ec9,_0x509ad3);var _0xa557cf=[];_0xa557cf[_0x8064('0x53')]({'model':db['User'],'as':_0x8064('0x54'),'attributes':['id',_0x8064('0x55')],'raw':!![]});_0xa557cf['push']({'model':db['CmContact'],'as':_0x8064('0x56'),'attributes':['id','firstName',_0x8064('0x57')],'raw':!![]});if(_0x1b619d[_0x8064('0x24')][_0x8064('0x50')]){_0xa557cf['push']({'model':db['Attachment'],'as':_0x8064('0x58'),'raw':!![]});}var _0x18f290=[{'model':db[_0x8064('0x37')],'as':'Messages','attributes':['id','body',_0x8064('0x59'),_0x8064('0x5a'),_0x8064('0x5b'),_0x8064('0x5c')],'include':_0xa557cf}];_0x18f290[_0x8064('0x53')]({'model':db[_0x8064('0x5d')],'as':_0x8064('0x5e'),'attributes':['id',_0x8064('0x1b')]});_0x18f290['push']({'model':db[_0x8064('0x54')],'as':'Owner','attributes':['id',_0x8064('0x55')]});return db[_0x8064('0x1e')][_0x8064('0x30')]({'where':{'id':_0x1b619d[_0x8064('0x34')]['id']},'include':_0x18f290})[_0x8064('0x18')](handleEntityNotFound(_0x2fd6a0,null))[_0x8064('0x18')](function(_0x1d35f0){if(_0x1d35f0){var _0x5c96e4=_0x1d35f0['get']({'plain':!![]});fs[_0x8064('0x5f')](_0x4205df);var _0x4f841e={'channel':'Whatsapp','account':_0x5c96e4['Account'][_0x8064('0x1b')],'agent':_0x5c96e4[_0x8064('0x60')]?_0x5c96e4['Owner'][_0x8064('0x55')]:_0x8064('0x61'),'createdAt':moment(_0x5c96e4[_0x8064('0x59')])[_0x8064('0x51')](_0x8064('0x45'))[_0x8064('0x62')](),'closedAt':_0x5c96e4[_0x8064('0x63')]?moment(_0x5c96e4[_0x8064('0x64')])[_0x8064('0x51')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8064('0x62')]():'','disposition':_0x5c96e4['disposition'],'messages':_(_0x5c96e4[_0x8064('0x65')])[_0x8064('0x42')]({'secret':![]})[_0x8064('0x1d')](function(_0x44c804){if(_0x44c804[_0x8064('0x58')]){var _0xcdf77a=path['join'](_0x2cd908,_0x44c804[_0x8064('0x58')][_0x8064('0x66')]);if(fs[_0x8064('0x67')](_0xcdf77a)){fs[_0x8064('0x68')](_0xcdf77a)[_0x8064('0x69')](fs[_0x8064('0x6a')](path['join'](_0x4205df,_0x44c804[_0x8064('0x58')][_0x8064('0x66')])));}}return{'date':moment(_0x44c804['createdAt'])[_0x8064('0x51')](_0x8064('0x45'))[_0x8064('0x62')](),'sender':_0x44c804[_0x8064('0x5a')]===_0x8064('0x6b')?_0x44c804[_0x8064('0x54')]?_0x44c804[_0x8064('0x54')][_0x8064('0x55')]:_0x8064('0x6c'):_0x44c804[_0x8064('0x56')]['firstName']+(_0x44c804[_0x8064('0x56')][_0x8064('0x57')]?'\x20'+_0x44c804['Contact'][_0x8064('0x57')]:''),'body':_0x44c804[_0x8064('0x58')]?_0x44c804['Attachment'][_0x8064('0x66')]:_0x44c804[_0x8064('0x33')],'direction':_0x44c804[_0x8064('0x5a')]==='out'?'A':'C','secret':_0x44c804['secret'],'read':_0x44c804[_0x8064('0x5c')],'attachment':_0x44c804['Attachment']};})[_0x8064('0x6d')]()};return ejs[_0x8064('0x6e')](path[_0x8064('0x4c')](config['root'],'server',_0x8064('0x6f'),'downloadInteraction.ejs'),{'interaction':_0x4f841e})['then'](function(_0x24f329){var _0x1a6722=path[_0x8064('0x4c')](_0x4205df,_0x8064('0x70')+_0x5c96e4['id']+'-'+_0x20a2a8+_0x8064('0x71'));var _0x517c81={'path':_0x1a6722,'channel':_0x8064('0x72'),'interactionId':_0x5c96e4['id']};return pdf[_0x8064('0x73')](_0x24f329,_0x517c81);})['then'](function(){return new BPromise(function(_0x4dd5ea,_0x2dd6fd){zipdir(_0x4205df,{'saveTo':_0x136b66},function(_0x4cca1d,_0x47a644){if(_0x4cca1d)return _0x2dd6fd(_0x4cca1d);return _0x4dd5ea(_0x47a644);});})['then'](function(){return new BPromise(function(_0xb8bc87,_0x5f0f35){rimraf(_0x4205df,function(_0x30ddcf){if(_0x30ddcf)_0x5f0f35(_0x30ddcf);return _0xb8bc87();});});})[_0x8064('0x18')](function(){return _0x2fd6a0[_0x8064('0x4b')](_0x136b66,_0x509ad3,function(_0x1318f6){if(_0x1318f6){console['log']('err',_0x1318f6);}else{fs[_0x8064('0x74')](_0x136b66);}});});});}else{return _0x2fd6a0[_0x8064('0xf')](0xc8);}})['catch'](handleError(_0x2fd6a0,null));}; \ No newline at end of file +var _0xecd1=['WhatsappInteraction','rawAttributes','getOptions','findAll','whatsapp','query','catch','show','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','create','body','find','params','destroy','describe','WhatsappMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','sort','pick','WhatsappInteractionId','filter','where','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','setTags','spread','color','whatsappInteractionTags:save','removeTags','download','unix','toString','files','tmp','join','root','server','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','Contact','out','read','value','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','update','then','end','error','stack','name','send','index','map'];(function(_0x43ed38,_0x507af1){var _0x181497=function(_0x153d8e){while(--_0x153d8e){_0x43ed38['push'](_0x43ed38['shift']());}};_0x181497(++_0x507af1);}(_0xecd1,0x15d));var _0x1ecd=function(_0xa91414,_0x567adf){_0xa91414=_0xa91414-0x0;var _0x49710a=_0xecd1[_0xa91414];return _0x49710a;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x1ecd('0x0'));var util=require(_0x1ecd('0x1'));var path=require(_0x1ecd('0x2'));var ejs=require(_0x1ecd('0x3'));var fs=require('fs');var _=require(_0x1ecd('0x4'));var Redis=require('ioredis');var interaction=require(_0x1ecd('0x5'));var qs=require(_0x1ecd('0x6'));var pdf=require(_0x1ecd('0x7'));var logger=require(_0x1ecd('0x8'))(_0x1ecd('0x9'));var config=require(_0x1ecd('0xa'));var db=require(_0x1ecd('0xb'))['db'];config[_0x1ecd('0xc')]=_[_0x1ecd('0xd')](config['redis'],{'host':_0x1ecd('0xe'),'port':0x18eb});var socket=require(_0x1ecd('0xf'))(new Redis(config[_0x1ecd('0xc')]));require('./whatsappInteraction.socket')[_0x1ecd('0x10')](socket);function respondWithStatusCode(_0x5d7e2b,_0x4a4ccf){_0x4a4ccf=_0x4a4ccf||0xcc;return function(_0x4280ed){if(_0x4280ed){return _0x5d7e2b[_0x1ecd('0x11')](_0x4a4ccf);}return _0x5d7e2b[_0x1ecd('0x12')](_0x4a4ccf)['end']();};}function respondWithResult(_0x38234e,_0x267cb9){_0x267cb9=_0x267cb9||0xc8;return function(_0x9308ab){if(_0x9308ab){return _0x38234e[_0x1ecd('0x12')](_0x267cb9)['json'](_0x9308ab);}};}function respondWithFilteredResult(_0x866b21,_0x43e330){return function(_0x5b4c08){if(_0x5b4c08){var _0x3c743f=typeof _0x43e330[_0x1ecd('0x13')]===_0x1ecd('0x14')&&typeof _0x43e330[_0x1ecd('0x15')]===_0x1ecd('0x14');var _0x310e65=_0x5b4c08[_0x1ecd('0x16')];var _0x5019ab=_0x3c743f?0x0:_0x43e330[_0x1ecd('0x13')];var _0x5370cd=_0x3c743f?_0x5b4c08[_0x1ecd('0x16')]:_0x43e330[_0x1ecd('0x13')]+_0x43e330['limit'];var _0x3a0cd4;if(_0x5370cd>=_0x310e65){_0x5370cd=_0x310e65;_0x3a0cd4=0xc8;}else{_0x3a0cd4=0xce;}_0x866b21[_0x1ecd('0x12')](_0x3a0cd4);return _0x866b21[_0x1ecd('0x17')](_0x1ecd('0x18'),_0x5019ab+'-'+_0x5370cd+'/'+_0x310e65)[_0x1ecd('0x19')](_0x5b4c08);}return null;};}function saveUpdates(_0x183267){return function(_0x13d7ca){if(_0x13d7ca){return _0x13d7ca[_0x1ecd('0x1a')](_0x183267)[_0x1ecd('0x1b')](function(_0x4731f9){return _0x4731f9;});}return null;};}function removeEntity(_0x2bea11){return function(_0x33e78a){if(_0x33e78a){return _0x33e78a['destroy']()[_0x1ecd('0x1b')](function(){_0x2bea11[_0x1ecd('0x12')](0xcc)[_0x1ecd('0x1c')]();});}};}function handleEntityNotFound(_0x350260){return function(_0x1eb08d){if(!_0x1eb08d){_0x350260['sendStatus'](0x194);}return _0x1eb08d;};}function handleError(_0x2bc8aa,_0x8fba98){_0x8fba98=_0x8fba98||0x1f4;return function(_0x21d057){logger[_0x1ecd('0x1d')](_0x21d057[_0x1ecd('0x1e')]);if(_0x21d057[_0x1ecd('0x1f')]){delete _0x21d057[_0x1ecd('0x1f')];}_0x2bc8aa['status'](_0x8fba98)[_0x1ecd('0x20')](_0x21d057);};}exports[_0x1ecd('0x21')]=function(_0x2ee317,_0x7fdad){var _0x3e1fe7={};var _0x1f027b=_[_0x1ecd('0x22')](db[_0x1ecd('0x23')][_0x1ecd('0x24')],function(_0x3373dd){return{'name':_0x3373dd['fieldName'],'type':_0x3373dd['type']['key']};});_0x3e1fe7=qs[_0x1ecd('0x25')](_0x1f027b,_0x2ee317);return interaction[_0x1ecd('0x26')](_0x1ecd('0x27'),_0x2ee317[_0x1ecd('0x28')],_0x2ee317['user'],_0x3e1fe7,_0x1f027b)[_0x1ecd('0x1b')](respondWithFilteredResult(_0x7fdad,_0x3e1fe7))[_0x1ecd('0x29')](handleError(_0x7fdad,null));};exports[_0x1ecd('0x2a')]=function(_0x23d890,_0x1b280e){var _0x2b22e2={'raw':![],'where':{'id':_0x23d890['params']['id']}},_0x3f477c={};_0x3f477c[_0x1ecd('0x2b')]=_[_0x1ecd('0x2c')](db['WhatsappInteraction'][_0x1ecd('0x24')]);_0x3f477c[_0x1ecd('0x28')]=_[_0x1ecd('0x2c')](_0x23d890[_0x1ecd('0x28')]);_0x3f477c[_0x1ecd('0x2d')]=_[_0x1ecd('0x2e')](_0x3f477c[_0x1ecd('0x2b')],_0x3f477c['query']);_0x2b22e2[_0x1ecd('0x2f')]=_[_0x1ecd('0x2e')](_0x3f477c[_0x1ecd('0x2b')],qs['fields'](_0x23d890[_0x1ecd('0x28')][_0x1ecd('0x30')]));_0x2b22e2['attributes']=_0x2b22e2['attributes'][_0x1ecd('0x31')]?_0x2b22e2[_0x1ecd('0x2f')]:_0x3f477c[_0x1ecd('0x2b')];if(_0x23d890['query'][_0x1ecd('0x32')]){_0x2b22e2[_0x1ecd('0x33')]=[{'all':!![]}];}_0x2b22e2=_[_0x1ecd('0x34')]({},_0x2b22e2,_0x23d890['options']);return db[_0x1ecd('0x23')]['find'](_0x2b22e2)[_0x1ecd('0x1b')](handleEntityNotFound(_0x1b280e,null))[_0x1ecd('0x1b')](respondWithResult(_0x1b280e,null))[_0x1ecd('0x29')](handleError(_0x1b280e,null));};exports[_0x1ecd('0x35')]=function(_0x36469b,_0x414a5b){return db[_0x1ecd('0x23')][_0x1ecd('0x35')](_0x36469b[_0x1ecd('0x36')],{})[_0x1ecd('0x1b')](respondWithResult(_0x414a5b,0xc9))[_0x1ecd('0x29')](handleError(_0x414a5b,null));};exports[_0x1ecd('0x1a')]=function(_0xbe1436,_0x34879f){if(_0xbe1436['body']['id']){delete _0xbe1436[_0x1ecd('0x36')]['id'];}return db[_0x1ecd('0x23')][_0x1ecd('0x37')]({'where':{'id':_0xbe1436[_0x1ecd('0x38')]['id']}})[_0x1ecd('0x1b')](handleEntityNotFound(_0x34879f,null))[_0x1ecd('0x1b')](saveUpdates(_0xbe1436[_0x1ecd('0x36')],null))['then'](respondWithResult(_0x34879f,null))[_0x1ecd('0x29')](handleError(_0x34879f,null));};exports[_0x1ecd('0x39')]=function(_0x5d5a7b,_0x2734bf){return db['WhatsappInteraction'][_0x1ecd('0x37')]({'where':{'id':_0x5d5a7b[_0x1ecd('0x38')]['id']}})[_0x1ecd('0x1b')](handleEntityNotFound(_0x2734bf,null))[_0x1ecd('0x1b')](removeEntity(_0x2734bf,null))['catch'](handleError(_0x2734bf,null));};exports[_0x1ecd('0x3a')]=function(_0x1bbb55,_0x55e30a){return db[_0x1ecd('0x23')][_0x1ecd('0x3a')]()['then'](respondWithResult(_0x55e30a,null))[_0x1ecd('0x29')](handleError(_0x55e30a,null));};exports['addMessage']=function(_0x4eeec6,_0x484692){return db[_0x1ecd('0x3b')]['find']({'where':{'id':_0x4eeec6[_0x1ecd('0x38')]['id']}})['then'](handleEntityNotFound(_0x484692,null))[_0x1ecd('0x1b')](function(_0x4ef23b){if(_0x4ef23b){return _0x4ef23b['addMessage'](_0x4eeec6[_0x1ecd('0x36')][_0x1ecd('0x3c')],_[_0x1ecd('0x3d')](_0x4eeec6[_0x1ecd('0x36')],[_0x1ecd('0x3c'),'id'])||{});}})[_0x1ecd('0x1b')](respondWithResult(_0x484692,null))['catch'](handleError(_0x484692,null));};exports['getMessages']=function(_0x1df15a,_0x5729cf){var _0x160f97={'raw':![],'where':{}};var _0xf96bae={};var _0x490f81={'count':0x0,'rows':[]};return db[_0x1ecd('0x23')][_0x1ecd('0x3e')]({'where':{'id':_0x1df15a[_0x1ecd('0x38')]['id']}})['then'](handleEntityNotFound(_0x5729cf,null))[_0x1ecd('0x1b')](function(_0x171e75){if(_0x171e75){_0xf96bae['model']=_['keys'](db['WhatsappMessage'][_0x1ecd('0x24')]);_0xf96bae[_0x1ecd('0x28')]=_[_0x1ecd('0x2c')](_0x1df15a[_0x1ecd('0x28')]);_0xf96bae['filters']=_[_0x1ecd('0x2e')](_0xf96bae[_0x1ecd('0x2b')],_0xf96bae[_0x1ecd('0x28')]);_0x160f97[_0x1ecd('0x2f')]=_[_0x1ecd('0x2e')](_0xf96bae[_0x1ecd('0x2b')],qs[_0x1ecd('0x30')](_0x1df15a[_0x1ecd('0x28')]['fields']));_0x160f97[_0x1ecd('0x2f')]=_0x160f97['attributes'][_0x1ecd('0x31')]?_0x160f97['attributes']:_0xf96bae[_0x1ecd('0x2b')];if(!_0x1df15a[_0x1ecd('0x28')][_0x1ecd('0x3f')](_0x1ecd('0x40'))){_0x160f97[_0x1ecd('0x15')]=qs['limit'](_0x1df15a[_0x1ecd('0x28')][_0x1ecd('0x15')]);_0x160f97[_0x1ecd('0x13')]=qs[_0x1ecd('0x13')](_0x1df15a['query']['offset']);}_0x160f97[_0x1ecd('0x41')]=qs[_0x1ecd('0x42')](_0x1df15a[_0x1ecd('0x28')][_0x1ecd('0x42')]);_0x160f97['where']=qs['filters'](_[_0x1ecd('0x43')](_0x1df15a[_0x1ecd('0x28')],_0xf96bae[_0x1ecd('0x2d')]));_0x160f97['where'][_0x1ecd('0x44')]=_0x171e75['id'];if(_0x1df15a['query'][_0x1ecd('0x45')]){_0x160f97[_0x1ecd('0x46')]=_['merge'](_0x160f97[_0x1ecd('0x46')],{'$or':_['map'](_0x160f97['attributes'],function(_0x18e73d){var _0xadf07c={};_0xadf07c[_0x18e73d]={'$like':'%'+_0x1df15a[_0x1ecd('0x28')][_0x1ecd('0x45')]+'%'};return _0xadf07c;})});}if(_0x1df15a[_0x1ecd('0x28')][_0x1ecd('0x47')]){var _0x15358d=_0x1df15a[_0x1ecd('0x28')][_0x1ecd('0x47')][_0x1ecd('0x48')](',');var _0x37c48f={};_0x37c48f[_0x15358d[0x0]]={'$gte':moment(_0x15358d[0x1])[_0x1ecd('0x49')](_0x1ecd('0x4a'))};_0x160f97[_0x1ecd('0x46')]=_[_0x1ecd('0x34')](_0x160f97[_0x1ecd('0x46')],_0x37c48f);}_0x160f97=_['merge']({},_0x160f97,_0x1df15a[_0x1ecd('0x4b')]);return db[_0x1ecd('0x3b')]['count']({'where':_0x160f97[_0x1ecd('0x46')]})['then'](function(_0xaa4c72){_0x490f81['count']=_0xaa4c72;if(_0x1df15a[_0x1ecd('0x28')]['includeAll']){_0x160f97['include']=[{'all':!![]}];}return db[_0x1ecd('0x3b')][_0x1ecd('0x26')](_0x160f97);})['then'](function(_0x374721){_0x490f81[_0x1ecd('0x4c')]=_0x374721;return _0x490f81;});}})[_0x1ecd('0x1b')](respondWithFilteredResult(_0x5729cf,_0x160f97))[_0x1ecd('0x29')](handleError(_0x5729cf,null));};exports['addTags']=function(_0xc31504,_0x113d66){return db[_0x1ecd('0x23')][_0x1ecd('0x37')]({'where':{'id':_0xc31504['params']['id']}})[_0x1ecd('0x1b')](handleEntityNotFound(_0x113d66,null))[_0x1ecd('0x1b')](function(_0x5c8bd9){if(_0x5c8bd9){return _0x5c8bd9[_0x1ecd('0x4d')](_0xc31504[_0x1ecd('0x36')]['ids'],_['omit'](_0xc31504[_0x1ecd('0x36')],[_0x1ecd('0x3c'),'id'])||{})[_0x1ecd('0x4e')](function(){return db['Tag'][_0x1ecd('0x26')]({'attributes':['id',_0x1ecd('0x1f'),_0x1ecd('0x4f')],'where':{'id':_0xc31504[_0x1ecd('0x36')][_0x1ecd('0x3c')]}});})['then'](function(_0x3287bd){socket['emit'](_0x1ecd('0x50'),{'id':Number(_0xc31504[_0x1ecd('0x38')]['id']),'tags':_0x3287bd||[]});return{'id':Number(_0xc31504[_0x1ecd('0x38')]['id']),'tags':_0x3287bd||[]};});}})[_0x1ecd('0x1b')](respondWithResult(_0x113d66,null))[_0x1ecd('0x29')](handleError(_0x113d66,null));};exports[_0x1ecd('0x51')]=function(_0x552ad9,_0xa7cb56){return db[_0x1ecd('0x23')]['find']({'where':{'id':_0x552ad9[_0x1ecd('0x38')]['id']}})[_0x1ecd('0x1b')](handleEntityNotFound(_0xa7cb56,null))[_0x1ecd('0x1b')](function(_0x45e7b7){if(_0x45e7b7){return _0x45e7b7['removeTags'](_0x552ad9[_0x1ecd('0x28')][_0x1ecd('0x3c')]);}})['then'](respondWithStatusCode(_0xa7cb56,null))[_0x1ecd('0x29')](handleError(_0xa7cb56,null));};exports[_0x1ecd('0x52')]=function(_0x40de25,_0x518a0c){var _0x1f5e73=moment()[_0x1ecd('0x53')]()[_0x1ecd('0x54')]();var _0x49e8b2=path['join'](config['root'],'server',_0x1ecd('0x55'),_0x1ecd('0x56'));var _0x2b144d=path[_0x1ecd('0x57')](config[_0x1ecd('0x58')],_0x1ecd('0x59'),_0x1ecd('0x55'),_0x1ecd('0x5a'));var _0x27578e=path[_0x1ecd('0x57')](_0x49e8b2,_0x1f5e73);var _0x3b2559=util[_0x1ecd('0x49')](_0x1ecd('0x5b'),_0x40de25[_0x1ecd('0x38')]['id'],_0x1f5e73);var _0x250d1c=path[_0x1ecd('0x57')](_0x49e8b2,_0x3b2559);var _0x21adea=[];_0x21adea[_0x1ecd('0x5c')]({'model':db[_0x1ecd('0x5d')],'as':_0x1ecd('0x5d'),'attributes':['id',_0x1ecd('0x5e')],'raw':!![]});_0x21adea[_0x1ecd('0x5c')]({'model':db[_0x1ecd('0x5f')],'as':'Contact','attributes':['id',_0x1ecd('0x60'),_0x1ecd('0x61')],'raw':!![]});if(_0x40de25['query'][_0x1ecd('0x5a')]){_0x21adea['push']({'model':db[_0x1ecd('0x62')],'as':_0x1ecd('0x62'),'raw':!![]});}var _0x1876fc=[{'model':db[_0x1ecd('0x3b')],'as':_0x1ecd('0x63'),'attributes':['id',_0x1ecd('0x36'),_0x1ecd('0x64'),_0x1ecd('0x65'),_0x1ecd('0x66'),'read'],'include':_0x21adea}];_0x1876fc[_0x1ecd('0x5c')]({'model':db[_0x1ecd('0x67')],'as':'Account','attributes':['id',_0x1ecd('0x1f')]});_0x1876fc[_0x1ecd('0x5c')]({'model':db['User'],'as':_0x1ecd('0x68'),'attributes':['id',_0x1ecd('0x5e')]});return db[_0x1ecd('0x23')][_0x1ecd('0x37')]({'where':{'id':_0x40de25[_0x1ecd('0x38')]['id']},'include':_0x1876fc})[_0x1ecd('0x1b')](handleEntityNotFound(_0x518a0c,null))[_0x1ecd('0x1b')](function(_0x5949fc){if(_0x5949fc){var _0x2652b5=_0x5949fc[_0x1ecd('0x69')]({'plain':!![]});fs[_0x1ecd('0x6a')](_0x27578e);var _0x276113={'channel':_0x1ecd('0x6b'),'account':_0x2652b5[_0x1ecd('0x6c')][_0x1ecd('0x1f')],'agent':_0x2652b5[_0x1ecd('0x68')]?_0x2652b5[_0x1ecd('0x68')]['fullname']:_0x1ecd('0x6d'),'createdAt':moment(_0x2652b5[_0x1ecd('0x64')])[_0x1ecd('0x49')](_0x1ecd('0x4a'))[_0x1ecd('0x54')](),'closedAt':_0x2652b5['closed']?moment(_0x2652b5[_0x1ecd('0x6e')])[_0x1ecd('0x49')](_0x1ecd('0x4a'))['toString']():'','disposition':_0x2652b5[_0x1ecd('0x6f')],'messages':_(_0x2652b5['Messages'])[_0x1ecd('0x45')]({'secret':![]})[_0x1ecd('0x22')](function(_0xf5051e){if(_0xf5051e[_0x1ecd('0x62')]){var _0x484c89=path[_0x1ecd('0x57')](_0x2b144d,_0xf5051e[_0x1ecd('0x62')][_0x1ecd('0x70')]);if(fs[_0x1ecd('0x71')](_0x484c89)){fs[_0x1ecd('0x72')](_0x484c89)[_0x1ecd('0x73')](fs[_0x1ecd('0x74')](path[_0x1ecd('0x57')](_0x27578e,_0xf5051e['Attachment']['basename'])));}}return{'date':moment(_0xf5051e[_0x1ecd('0x64')])[_0x1ecd('0x49')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1ecd('0x54')](),'sender':_0xf5051e[_0x1ecd('0x65')]==='out'?_0xf5051e[_0x1ecd('0x5d')]?_0xf5051e[_0x1ecd('0x5d')][_0x1ecd('0x5e')]:'System':_0xf5051e[_0x1ecd('0x75')][_0x1ecd('0x60')]+(_0xf5051e['Contact']['lastName']?'\x20'+_0xf5051e[_0x1ecd('0x75')]['lastName']:''),'body':_0xf5051e[_0x1ecd('0x62')]?_0xf5051e[_0x1ecd('0x62')][_0x1ecd('0x70')]:_0xf5051e['body'],'direction':_0xf5051e['direction']===_0x1ecd('0x76')?'A':'C','secret':_0xf5051e[_0x1ecd('0x66')],'read':_0xf5051e[_0x1ecd('0x77')],'attachment':_0xf5051e[_0x1ecd('0x62')]};})[_0x1ecd('0x78')]()};return ejs['renderFile'](path[_0x1ecd('0x57')](config[_0x1ecd('0x58')],_0x1ecd('0x59'),'views',_0x1ecd('0x79')),{'interaction':_0x276113})[_0x1ecd('0x1b')](function(_0x246a15){var _0x44a4da=path[_0x1ecd('0x57')](_0x27578e,_0x1ecd('0x7a')+_0x2652b5['id']+'-'+_0x1f5e73+_0x1ecd('0x7b'));var _0x5bd9b8={'path':_0x44a4da,'channel':_0x1ecd('0x6b'),'interactionId':_0x2652b5['id']};return pdf[_0x1ecd('0x7c')](_0x246a15,_0x5bd9b8);})[_0x1ecd('0x1b')](function(){return new BPromise(function(_0x16733e,_0x29866c){zipdir(_0x27578e,{'saveTo':_0x250d1c},function(_0x1ac794,_0xf88f1f){if(_0x1ac794)return _0x29866c(_0x1ac794);return _0x16733e(_0xf88f1f);});})['then'](function(){return new BPromise(function(_0x479520,_0x269b6f){rimraf(_0x27578e,function(_0x4ce70e){if(_0x4ce70e)_0x269b6f(_0x4ce70e);return _0x479520();});});})[_0x1ecd('0x1b')](function(){return _0x518a0c[_0x1ecd('0x52')](_0x250d1c,_0x3b2559,function(_0x30a31c){if(_0x30a31c){console[_0x1ecd('0x7d')](_0x1ecd('0x7e'),_0x30a31c);}else{fs[_0x1ecd('0x7f')](_0x250d1c);}});});});}else{return _0x518a0c[_0x1ecd('0x11')](0xc8);}})[_0x1ecd('0x29')](handleError(_0x518a0c,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index e2e32ed..d10c76d 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 _0xb6b1=['emit','catch','hasOwnProperty','hook','events','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','then','setDataValue','map','findAll','unreadMessages','length'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xb6b1,0x17b));var _0x1b6b=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0xb6b1[_0xdd2bfa];return _0x55397e;};'use strict';var EventEmitter=require(_0x1b6b('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x1b6b('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0x1b6b('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x1b6b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1b6b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2a2c45){return function(_0xb1a61e,_0x2c4040,_0xdbbe22){_0xb1a61e['getUsers']({'attributes':['id'],'raw':!![]})[_0x1b6b('0x5')](function(_0x51cfed){_0xb1a61e[_0x1b6b('0x6')]('Users',_0x51cfed[_0x1b6b('0x7')](function(_0x3496b5){return{'id':_0x3496b5['id']};}));return WhatsappMessage[_0x1b6b('0x8')]({'where':{'WhatsappInteractionId':_0xb1a61e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1b6b('0x5')](function(_0x5249cd){_0xb1a61e['setDataValue'](_0x1b6b('0x9'),_0x5249cd[_0x1b6b('0xa')]);WhatsappInteractionEvents[_0x1b6b('0xb')](_0x2a2c45+':'+_0xb1a61e['id'],_0xb1a61e);WhatsappInteractionEvents[_0x1b6b('0xb')](_0x2a2c45,_0xb1a61e);_0xdbbe22(null);})[_0x1b6b('0xc')](_0xdbbe22(null));};}for(var e in events){if(events[_0x1b6b('0xd')](e)){var event=events[e];WhatsappInteraction[_0x1b6b('0xe')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x765b=['map','findAll','emit','catch','hasOwnProperty','exports','../../mysqldb','setMaxListeners','update','remove','then','setDataValue','Users'];(function(_0x1ecfa1,_0x4bce9a){var _0x1a39ca=function(_0x2c5ee3){while(--_0x2c5ee3){_0x1ecfa1['push'](_0x1ecfa1['shift']());}};_0x1a39ca(++_0x4bce9a);}(_0x765b,0x18c));var _0xb765=function(_0x3b711c,_0x4b22dc){_0x3b711c=_0x3b711c-0x0;var _0x2685f0=_0x765b[_0x3b711c];return _0x2685f0;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xb765('0x0'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xb765('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb765('0x2'),'afterDestroy':_0xb765('0x3')};function emitEvent(_0x358e6e){return function(_0x57021a,_0x5759de,_0x58195b){_0x57021a['getUsers']({'attributes':['id'],'raw':!![]})[_0xb765('0x4')](function(_0x5b1baf){_0x57021a[_0xb765('0x5')](_0xb765('0x6'),_0x5b1baf[_0xb765('0x7')](function(_0x57dfcf){return{'id':_0x57dfcf['id']};}));return WhatsappMessage[_0xb765('0x8')]({'where':{'WhatsappInteractionId':_0x57021a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb765('0x4')](function(_0x26ad83){_0x57021a['setDataValue']('unreadMessages',_0x26ad83['length']);WhatsappInteractionEvents[_0xb765('0x9')](_0x358e6e+':'+_0x57021a['id'],_0x57021a);WhatsappInteractionEvents[_0xb765('0x9')](_0x358e6e,_0x57021a);_0x58195b(null);})[_0xb765('0xa')](_0x58195b(null));};}for(var e in events){if(events[_0xb765('0xb')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xb765('0xc')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index db63db7..c1bcaf1 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 _0x2129=['../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x2129,0x1ea));var _0x9212=function(_0x5d962c,_0x4f3c7d){_0x5d962c=_0x5d962c-0x0;var _0x4ad870=_0x2129[_0x5d962c];return _0x4ad870;};'use strict';var _=require('lodash');var util=require(_0x9212('0x0'));var logger=require(_0x9212('0x1'))('api');var moment=require(_0x9212('0x2'));var BPromise=require(_0x9212('0x3'));var rp=require(_0x9212('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9212('0x5'));var attributes=require(_0x9212('0x6'));module[_0x9212('0x7')]=function(_0x32d5c8,_0x400a5e){return _0x32d5c8['define'](_0x9212('0x8'),attributes,{'tableName':_0x9212('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x16b18b,_0x16829b,_0x54835b){if(_0x16b18b[_0x9212('0xa')](_0x9212('0xb'))){_0x16b18b[_0x9212('0xc')]=moment()[_0x9212('0xd')](_0x9212('0xe'));}_0x54835b(null,_0x16b18b);}}});}; \ No newline at end of file +var _0xc0aa=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','WhatsappInteraction','whatsapp_interactions','changed','closedAt','format'];(function(_0xbe8c92,_0x5c130c){var _0x1d1e20=function(_0x205257){while(--_0x205257){_0xbe8c92['push'](_0xbe8c92['shift']());}};_0x1d1e20(++_0x5c130c);}(_0xc0aa,0x15f));var _0xac0a=function(_0x3f73bf,_0x26dd02){_0x3f73bf=_0x3f73bf-0x0;var _0x3a1f30=_0xc0aa[_0x3f73bf];return _0x3a1f30;};'use strict';var _=require('lodash');var util=require(_0xac0a('0x0'));var logger=require('../../config/logger')(_0xac0a('0x1'));var moment=require(_0xac0a('0x2'));var BPromise=require(_0xac0a('0x3'));var rp=require(_0xac0a('0x4'));var fs=require('fs');var path=require(_0xac0a('0x5'));var rimraf=require(_0xac0a('0x6'));var config=require(_0xac0a('0x7'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x3955cd,_0x1ebf58){return _0x3955cd['define'](_0xac0a('0x8'),attributes,{'tableName':_0xac0a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x43c76e,_0x3647da,_0x34b7e6){if(_0x43c76e[_0xac0a('0xa')]('closed')){_0x43c76e[_0xac0a('0xb')]=moment()[_0xac0a('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x34b7e6(null,_0x43c76e);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 931c18c..ebe89b6 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 _0x74dd=['body','options','raw','attributes','limit','catch','find','where','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','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','stringify','error','message','result','UpdateWhatsappInteraction'];(function(_0x5e4807,_0x170570){var _0x46a06a=function(_0x142436){while(--_0x142436){_0x5e4807['push'](_0x5e4807['shift']());}};_0x46a06a(++_0x170570);}(_0x74dd,0x90));var _0xd74d=function(_0x2ef714,_0x49e1c4){_0x2ef714=_0x2ef714-0x0;var _0x252ab0=_0x74dd[_0x2ef714];return _0x252ab0;};'use strict';var _=require(_0xd74d('0x0'));var util=require(_0xd74d('0x1'));var moment=require(_0xd74d('0x2'));var BPromise=require(_0xd74d('0x3'));var rs=require(_0xd74d('0x4'));var fs=require('fs');var Redis=require(_0xd74d('0x5'));var db=require(_0xd74d('0x6'))['db'];var utils=require(_0xd74d('0x7'));var logger=require(_0xd74d('0x8'))(_0xd74d('0x9'));var config=require(_0xd74d('0xa'));var jayson=require(_0xd74d('0xb'));var client=jayson[_0xd74d('0xc')][_0xd74d('0xd')]({'port':0x232a});config[_0xd74d('0xe')]=_[_0xd74d('0xf')](config['redis'],{'host':_0xd74d('0x10'),'port':0x18eb});var socket=require(_0xd74d('0x11'))(new Redis(config['redis']));require(_0xd74d('0x12'))[_0xd74d('0x13')](socket);function respondWithRpcPromise(_0x593280,_0x4ff1d3,_0x243e73){return new BPromise(function(_0x5d9ad2,_0x480b87){return client[_0xd74d('0x14')](_0x593280,_0x243e73)[_0xd74d('0x15')](function(_0xa6909d){logger[_0xd74d('0x16')](_0xd74d('0x17'),_0x4ff1d3,_0xd74d('0x18'));logger[_0xd74d('0x19')](_0xd74d('0x1a'),_0x4ff1d3,_0xd74d('0x18'),JSON[_0xd74d('0x1b')](_0xa6909d));if(_0xa6909d[_0xd74d('0x1c')]){if(_0xa6909d[_0xd74d('0x1c')]['code']===0x1f4){logger[_0xd74d('0x1c')]('WhatsappInteraction,\x20%s,\x20%s',_0x4ff1d3,_0xa6909d[_0xd74d('0x1c')][_0xd74d('0x1d')]);return _0x480b87(_0xa6909d[_0xd74d('0x1c')]['message']);}logger[_0xd74d('0x1c')]('WhatsappInteraction,\x20%s,\x20%s',_0x4ff1d3,_0xa6909d[_0xd74d('0x1c')][_0xd74d('0x1d')]);return _0x5d9ad2(_0xa6909d[_0xd74d('0x1c')][_0xd74d('0x1d')]);}else{logger[_0xd74d('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x4ff1d3,_0xd74d('0x18'));_0x5d9ad2(_0xa6909d[_0xd74d('0x1e')][_0xd74d('0x1d')]);}})['catch'](function(_0x4eb9ba){logger['error'](_0xd74d('0x17'),_0x4ff1d3,_0x4eb9ba);_0x480b87(_0x4eb9ba);});});}exports[_0xd74d('0x1f')]=function(_0x136c87){var _0x247286=this;return new Promise(function(_0x4bbd29,_0x257423){return db['WhatsappInteraction']['update'](_0x136c87[_0xd74d('0x20')],{'raw':_0x136c87[_0xd74d('0x21')]?_0x136c87[_0xd74d('0x21')][_0xd74d('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x136c87[_0xd74d('0x21')]?_0x136c87[_0xd74d('0x21')]['where']||null:null,'attributes':_0x136c87[_0xd74d('0x21')]?_0x136c87[_0xd74d('0x21')][_0xd74d('0x23')]||null:null,'limit':_0x136c87[_0xd74d('0x21')]?_0x136c87[_0xd74d('0x21')][_0xd74d('0x24')]||null:null})[_0xd74d('0x15')](function(_0x4dac59){logger[_0xd74d('0x16')](_0xd74d('0x1f'),_0x136c87);logger[_0xd74d('0x19')](_0xd74d('0x1f'),_0x136c87,JSON[_0xd74d('0x1b')](_0x4dac59));_0x4bbd29(_0x4dac59);})[_0xd74d('0x25')](function(_0x40b23f){logger['error'](_0xd74d('0x1f'),_0x40b23f[_0xd74d('0x1d')],_0x136c87);_0x257423(_0x247286[_0xd74d('0x1c')](0x1f4,_0x40b23f[_0xd74d('0x1d')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x5450ce){return new Promise(function(_0x194217,_0x4d5ee7){return db['WhatsappInteraction'][_0xd74d('0x26')]({'where':_0x5450ce['options']?_0x5450ce['options'][_0xd74d('0x27')]||null:null})[_0xd74d('0x15')](function(_0x4c6a00){if(_0x4c6a00){return _0x4c6a00[_0xd74d('0x28')](_0x5450ce['body'][_0xd74d('0x29')],_['omit'](_0x5450ce[_0xd74d('0x20')],[_0xd74d('0x29'),'id'])||{});}})[_0xd74d('0x2a')](function(_0x4b8561){logger[_0xd74d('0x16')](_0xd74d('0x2b'),_0x5450ce);logger[_0xd74d('0x19')](_0xd74d('0x2b'),_0x5450ce,JSON['stringify'](_0x4b8561));_0x194217(_0x4b8561);})[_0xd74d('0x25')](function(_0x3f025b){logger[_0xd74d('0x1c')]('AddTags',_0x3f025b['message'],_0x5450ce);_0x4d5ee7(_this[_0xd74d('0x1c')](0x1f4,_0x3f025b['message']));});});}; \ No newline at end of file +var _0xd942=['AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','stringify'];(function(_0x45e88b,_0x459427){var _0x19e808=function(_0x5abc24){while(--_0x5abc24){_0x45e88b['push'](_0x45e88b['shift']());}};_0x19e808(++_0x459427);}(_0xd942,0xa7));var _0x2d94=function(_0x3f45f9,_0x484c66){_0x3f45f9=_0x3f45f9-0x0;var _0x3c36b2=_0xd942[_0x3f45f9];return _0x3c36b2;};'use strict';var _=require('lodash');var util=require(_0x2d94('0x0'));var moment=require(_0x2d94('0x1'));var BPromise=require(_0x2d94('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2d94('0x3'));var logger=require(_0x2d94('0x4'))(_0x2d94('0x5'));var config=require(_0x2d94('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2d94('0x7')][_0x2d94('0x8')]({'port':0x232a});config[_0x2d94('0x9')]=_['defaults'](config[_0x2d94('0x9')],{'host':_0x2d94('0xa'),'port':0x18eb});var socket=require(_0x2d94('0xb'))(new Redis(config[_0x2d94('0x9')]));require('./whatsappInteraction.socket')[_0x2d94('0xc')](socket);function respondWithRpcPromise(_0x4f2c9d,_0x38eab0,_0x4092bb){return new BPromise(function(_0xf20d2,_0x57e282){return client['request'](_0x4f2c9d,_0x4092bb)[_0x2d94('0xd')](function(_0x4fc633){logger['info'](_0x2d94('0xe'),_0x38eab0,_0x2d94('0xf'));logger[_0x2d94('0x10')](_0x2d94('0x11'),_0x38eab0,'request\x20sent',JSON['stringify'](_0x4fc633));if(_0x4fc633[_0x2d94('0x12')]){if(_0x4fc633[_0x2d94('0x12')][_0x2d94('0x13')]===0x1f4){logger[_0x2d94('0x12')](_0x2d94('0xe'),_0x38eab0,_0x4fc633[_0x2d94('0x12')][_0x2d94('0x14')]);return _0x57e282(_0x4fc633['error'][_0x2d94('0x14')]);}logger[_0x2d94('0x12')](_0x2d94('0xe'),_0x38eab0,_0x4fc633['error'][_0x2d94('0x14')]);return _0xf20d2(_0x4fc633[_0x2d94('0x12')][_0x2d94('0x14')]);}else{logger[_0x2d94('0x15')](_0x2d94('0xe'),_0x38eab0,_0x2d94('0xf'));_0xf20d2(_0x4fc633[_0x2d94('0x16')][_0x2d94('0x14')]);}})[_0x2d94('0x17')](function(_0x3df34f){logger[_0x2d94('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x38eab0,_0x3df34f);_0x57e282(_0x3df34f);});});}exports[_0x2d94('0x18')]=function(_0x2da636){var _0x415d26=this;return new Promise(function(_0x5480ae,_0x57c88e){return db[_0x2d94('0x19')][_0x2d94('0x1a')](_0x2da636[_0x2d94('0x1b')],{'raw':_0x2da636[_0x2d94('0x1c')]?_0x2da636[_0x2d94('0x1c')][_0x2d94('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2da636[_0x2d94('0x1c')]?_0x2da636[_0x2d94('0x1c')][_0x2d94('0x1e')]||null:null,'attributes':_0x2da636[_0x2d94('0x1c')]?_0x2da636[_0x2d94('0x1c')][_0x2d94('0x1f')]||null:null,'limit':_0x2da636[_0x2d94('0x1c')]?_0x2da636[_0x2d94('0x1c')]['limit']||null:null})['then'](function(_0x5cf274){logger['info'](_0x2d94('0x18'),_0x2da636);logger[_0x2d94('0x10')](_0x2d94('0x18'),_0x2da636,JSON[_0x2d94('0x20')](_0x5cf274));_0x5480ae(_0x5cf274);})[_0x2d94('0x17')](function(_0x1abc27){logger[_0x2d94('0x12')](_0x2d94('0x18'),_0x1abc27['message'],_0x2da636);_0x57c88e(_0x415d26[_0x2d94('0x12')](0x1f4,_0x1abc27[_0x2d94('0x14')]));});});};exports[_0x2d94('0x21')]=function(_0x36e961){return new Promise(function(_0x413200,_0x2f560d){return db[_0x2d94('0x19')][_0x2d94('0x22')]({'where':_0x36e961[_0x2d94('0x1c')]?_0x36e961[_0x2d94('0x1c')][_0x2d94('0x1e')]||null:null})[_0x2d94('0xd')](function(_0x298f29){if(_0x298f29){return _0x298f29[_0x2d94('0x23')](_0x36e961[_0x2d94('0x1b')][_0x2d94('0x24')],_[_0x2d94('0x25')](_0x36e961[_0x2d94('0x1b')],[_0x2d94('0x24'),'id'])||{});}})[_0x2d94('0x26')](function(_0x1020e2){logger['info']('AddTags',_0x36e961);logger[_0x2d94('0x10')](_0x2d94('0x27'),_0x36e961,JSON[_0x2d94('0x20')](_0x1020e2));_0x413200(_0x1020e2);})[_0x2d94('0x17')](function(_0x13702a){logger[_0x2d94('0x12')](_0x2d94('0x27'),_0x13702a[_0x2d94('0x14')],_0x36e961);_0x2f560d(_this[_0x2d94('0x12')](0x1f4,_0x13702a['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index f02693f..d6bca67 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 _0x3b56=['update','removeListener','./whatsappInteraction.events','remove'];(function(_0x2646cc,_0x90000a){var _0x13eecd=function(_0x4799ac){while(--_0x4799ac){_0x2646cc['push'](_0x2646cc['shift']());}};_0x13eecd(++_0x90000a);}(_0x3b56,0xd6));var _0x63b5=function(_0x42e58a,_0x455627){_0x42e58a=_0x42e58a-0x0;var _0x1a9d15=_0x3b56[_0x42e58a];return _0x1a9d15;};'use strict';var WhatsappInteractionEvents=require(_0x63b5('0x0'));var events=['save',_0x63b5('0x1'),_0x63b5('0x2')];function createListener(_0x1c6354,_0x5bc134){return function(_0x161787){_0x5bc134['emit'](_0x1c6354,_0x161787);};}function removeListener(_0x40e9f4,_0x4804d1){return function(){WhatsappInteractionEvents[_0x63b5('0x3')](_0x40e9f4,_0x4804d1);};}exports['register']=function(_0x4892dd){for(var _0x5e7252=0x0,_0x2d7a21=events['length'];_0x5e7252<_0x2d7a21;_0x5e7252++){var _0x1ed7be=events[_0x5e7252];var _0x329d54=createListener('whatsappInteraction:'+_0x1ed7be,_0x4892dd);WhatsappInteractionEvents['on'](_0x1ed7be,_0x329d54);}}; \ No newline at end of file +var _0xf2c0=['save','update','emit','register','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xf2c0,0x15b));var _0x0f2c=function(_0x4b3922,_0x56233d){_0x4b3922=_0x4b3922-0x0;var _0x994cbb=_0xf2c0[_0x4b3922];return _0x994cbb;};'use strict';var WhatsappInteractionEvents=require(_0x0f2c('0x0'));var events=[_0x0f2c('0x1'),'remove',_0x0f2c('0x2')];function createListener(_0x17ded6,_0x21ab36){return function(_0x399ea9){_0x21ab36[_0x0f2c('0x3')](_0x17ded6,_0x399ea9);};}function removeListener(_0x5a8d0d,_0x1fefc9){return function(){WhatsappInteractionEvents['removeListener'](_0x5a8d0d,_0x1fefc9);};}exports[_0x0f2c('0x4')]=function(_0x3bb5fa){for(var _0x5154bc=0x0,_0x5b3d19=events['length'];_0x5154bc<_0x5b3d19;_0x5154bc++){var _0xf5e375=events[_0x5154bc];var _0x136b57=createListener(_0x0f2c('0x5')+_0xf5e375,_0x3bb5fa);WhatsappInteractionEvents['on'](_0xf5e375,_0x136b57);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 9a95b72..9a03aa8 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 _0x2d8c=['Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','/describe','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','reject','delete','/:id','destroy','util','path','connect-timeout','express'];(function(_0x4320ce,_0x49f5f5){var _0x537dae=function(_0x5991ef){while(--_0x5991ef){_0x4320ce['push'](_0x4320ce['shift']());}};_0x537dae(++_0x49f5f5);}(_0x2d8c,0x1d8));var _0xc2d8=function(_0x3792e6,_0x32bd91){_0x3792e6=_0x3792e6-0x0;var _0x441e44=_0x2d8c[_0x3792e6];return _0x441e44;};'use strict';var multer=require('multer');var util=require(_0xc2d8('0x0'));var path=require(_0xc2d8('0x1'));var timeout=require(_0xc2d8('0x2'));var express=require(_0xc2d8('0x3'));var router=express[_0xc2d8('0x4')]();var fs_extra=require(_0xc2d8('0x5'));var auth=require(_0xc2d8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc2d8('0x7'));var controller=require(_0xc2d8('0x8'));router[_0xc2d8('0x9')]('/',auth[_0xc2d8('0xa')](),controller['index']);router[_0xc2d8('0x9')](_0xc2d8('0xb'),auth[_0xc2d8('0xa')](),controller['describe']);router[_0xc2d8('0x9')]('/:id',auth[_0xc2d8('0xa')](),controller[_0xc2d8('0xc')]);router[_0xc2d8('0xd')]('/',auth[_0xc2d8('0xa')](),interaction[_0xc2d8('0xe')](_0xc2d8('0xf'),_0xc2d8('0x10')),controller[_0xc2d8('0x11')]);router[_0xc2d8('0xd')](_0xc2d8('0x12'),controller[_0xc2d8('0x13')]);router[_0xc2d8('0x14')]('/:id',auth[_0xc2d8('0xa')](),controller[_0xc2d8('0x15')]);router[_0xc2d8('0x14')](_0xc2d8('0x16'),auth[_0xc2d8('0xa')](),controller[_0xc2d8('0x17')]);router[_0xc2d8('0x14')]('/:id/reject',auth[_0xc2d8('0xa')](),controller[_0xc2d8('0x18')]);router[_0xc2d8('0x19')](_0xc2d8('0x1a'),auth[_0xc2d8('0xa')](),controller[_0xc2d8('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x9922=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','whatsapp','whatsappmessage:create','post','/:id/status','put','update','/:id/accept','accept','reject','destroy','exports','multer','path','connect-timeout','express','fs-extra'];(function(_0x5a4f65,_0x57c4ee){var _0x3c5d98=function(_0x40760d){while(--_0x40760d){_0x5a4f65['push'](_0x5a4f65['shift']());}};_0x3c5d98(++_0x57c4ee);}(_0x9922,0x1ef));var _0x2992=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9922[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2992('0x0'));var util=require('util');var path=require(_0x2992('0x1'));var timeout=require(_0x2992('0x2'));var express=require(_0x2992('0x3'));var router=express['Router']();var fs_extra=require(_0x2992('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2992('0x5'));var controller=require('./whatsappMessage.controller');router[_0x2992('0x6')]('/',auth[_0x2992('0x7')](),controller[_0x2992('0x8')]);router[_0x2992('0x6')](_0x2992('0x9'),auth['isAuthenticated'](),controller[_0x2992('0xa')]);router[_0x2992('0x6')](_0x2992('0xb'),auth[_0x2992('0x7')](),controller[_0x2992('0xc')]);router['post']('/',auth[_0x2992('0x7')](),interaction[_0x2992('0xd')](_0x2992('0xe'),_0x2992('0xf')),controller['create']);router[_0x2992('0x10')](_0x2992('0x11'),controller['status']);router[_0x2992('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x2992('0x13')]);router[_0x2992('0x12')](_0x2992('0x14'),auth['isAuthenticated'](),controller[_0x2992('0x15')]);router[_0x2992('0x12')]('/:id/reject',auth['isAuthenticated'](),controller[_0x2992('0x16')]);router['delete'](_0x2992('0xb'),auth['isAuthenticated'](),controller[_0x2992('0x17')]);module[_0x2992('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index a94acab..a5c6b66 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 _0x1cbb=['sequelize','exports','TEXT','medium','ENUM','out','STRING','DATE','BOOLEAN'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0x1cbb,0x105));var _0xb1cb=function(_0x2c30b7,_0x3b76a0){_0x2c30b7=_0x2c30b7-0x0;var _0x438569=_0x1cbb[_0x2c30b7];return _0x438569;};'use strict';var Sequelize=require(_0xb1cb('0x0'));module[_0xb1cb('0x1')]={'body':{'type':Sequelize[_0xb1cb('0x2')](_0xb1cb('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb1cb('0x4')]('in',_0xb1cb('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xb1cb('0x6')]},'readAt':{'type':Sequelize[_0xb1cb('0x7')]},'secret':{'type':Sequelize[_0xb1cb('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb1cb('0x6')]},'providerResponse':{'type':Sequelize[_0xb1cb('0x2')]}}; \ No newline at end of file +var _0x94ce=['sequelize','exports','medium','BOOLEAN','out','STRING'];(function(_0x2a05ce,_0x3a3522){var _0x2921be=function(_0x48738d){while(--_0x48738d){_0x2a05ce['push'](_0x2a05ce['shift']());}};_0x2921be(++_0x3a3522);}(_0x94ce,0x6c));var _0xe94c=function(_0x3d1200,_0x462aac){_0x3d1200=_0x3d1200-0x0;var _0x8ca337=_0x94ce[_0x3d1200];return _0x8ca337;};'use strict';var Sequelize=require(_0xe94c('0x0'));module[_0xe94c('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe94c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe94c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe94c('0x4')),'defaultValue':_0xe94c('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe94c('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xe94c('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index dd0cdeb..8457ebd 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 _0xcac7=['limit','Content-Range','apply','reject','save','update','then','stack','name','send','map','WhatsappMessage','rawAttributes','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','params','keys','find','body','destroy','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','interaction','info','[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','Sequelize','QueryTypes','contact','agent','fullname','email','internal','manual','channel','motionChannel','event','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','User','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','fast-json-patch','moment','mustache','util','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','count'];(function(_0x33ed32,_0x1b50ff){var _0x55c3b8=function(_0x566f07){while(--_0x566f07){_0x33ed32['push'](_0x33ed32['shift']());}};_0x55c3b8(++_0x1b50ff);}(_0xcac7,0x1ed));var _0x7cac=function(_0x31a928,_0x3aa6da){_0x31a928=_0x31a928-0x0;var _0x1c447e=_0xcac7[_0x31a928];return _0x1c447e;};'use strict';var emlformat=require(_0x7cac('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7cac('0x1'));var rp=require('request-promise');var moment=require(_0x7cac('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7cac('0x3'));var util=require(_0x7cac('0x4'));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(_0x7cac('0x5'));var _=require(_0x7cac('0x6'));var squel=require(_0x7cac('0x7'));var crypto=require('crypto');var jsforce=require(_0x7cac('0x8'));var deskjs=require(_0x7cac('0x9'));var toCsv=require(_0x7cac('0xa'));var querystring=require(_0x7cac('0xb'));var Papa=require(_0x7cac('0xc'));var Redis=require('ioredis');var authService=require(_0x7cac('0xd'));var qs=require(_0x7cac('0xe'));var as=require(_0x7cac('0xf'));var hardwareService=require(_0x7cac('0x10'));var logger=require(_0x7cac('0x11'))(_0x7cac('0x12'));var utils=require(_0x7cac('0x13'));var config=require(_0x7cac('0x14'));var licenseUtil=require(_0x7cac('0x15'));var db=require(_0x7cac('0x16'))['db'];config['redis']=_['defaults'](config[_0x7cac('0x17')],{'host':_0x7cac('0x18'),'port':0x18eb});var socket=require(_0x7cac('0x19'))(new Redis(config[_0x7cac('0x17')]));require(_0x7cac('0x1a'))['register'](socket);var jayson=require(_0x7cac('0x1b'));var client=jayson[_0x7cac('0x1c')][_0x7cac('0x1d')]({'port':0x232c});var client9002=jayson[_0x7cac('0x1c')][_0x7cac('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2ddd9b,_0x3bb88c,_0x47c929,_0x5141f7){return new BPromise(function(_0xb69fb3,_0x5a493d){var _0x3ed24e=_0x5141f7||client;return _0x3ed24e[_0x7cac('0x1e')](_0x2ddd9b,_0x47c929)['then'](function(_0x426216){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x3bb88c,_0x7cac('0x1f'));logger[_0x7cac('0x20')](_0x7cac('0x21'),_0x3bb88c,_0x7cac('0x1f'),JSON[_0x7cac('0x22')](_0x426216));if(_0x426216[_0x7cac('0x23')]){if(_0x426216['error'][_0x7cac('0x24')]===0x1f4){logger['error'](_0x7cac('0x25'),_0x3bb88c,_0x426216[_0x7cac('0x23')][_0x7cac('0x26')]);return _0x5a493d(_0x426216[_0x7cac('0x23')][_0x7cac('0x26')]);}logger[_0x7cac('0x23')](_0x7cac('0x25'),_0x3bb88c,_0x426216[_0x7cac('0x23')][_0x7cac('0x26')]);return _0xb69fb3(_0x426216[_0x7cac('0x23')][_0x7cac('0x26')]);}else{logger['info'](_0x7cac('0x25'),_0x3bb88c,_0x7cac('0x1f'));_0xb69fb3(_0x426216[_0x7cac('0x27')][_0x7cac('0x26')]);}})[_0x7cac('0x28')](function(_0x352969){logger[_0x7cac('0x23')](_0x7cac('0x25'),_0x3bb88c,_0x352969);_0x5a493d(_0x352969);});});}function respondWithStatusCode(_0x46a155,_0xf05efd){_0xf05efd=_0xf05efd||0xcc;return function(_0x499b40){if(_0x499b40){return _0x46a155[_0x7cac('0x29')](_0xf05efd);}return _0x46a155[_0x7cac('0x2a')](_0xf05efd)['end']();};}function respondWithResult(_0x49fe71,_0x3f15d7){_0x3f15d7=_0x3f15d7||0xc8;return function(_0x5db065){if(_0x5db065){return _0x49fe71[_0x7cac('0x2a')](_0x3f15d7)[_0x7cac('0x2b')](_0x5db065);}};}function respondWithFilteredResult(_0x37c83e,_0x51c692){return function(_0x5ddda3){if(_0x5ddda3){var _0x451dfb=typeof _0x51c692[_0x7cac('0x2c')]===_0x7cac('0x2d')&&typeof _0x51c692['limit']===_0x7cac('0x2d');var _0x1035c3=_0x5ddda3[_0x7cac('0x2e')];var _0x23eff1=_0x451dfb?0x0:_0x51c692[_0x7cac('0x2c')];var _0x98e979=_0x451dfb?_0x5ddda3[_0x7cac('0x2e')]:_0x51c692[_0x7cac('0x2c')]+_0x51c692[_0x7cac('0x2f')];var _0x5023e6;if(_0x98e979>=_0x1035c3){_0x98e979=_0x1035c3;_0x5023e6=0xc8;}else{_0x5023e6=0xce;}_0x37c83e[_0x7cac('0x2a')](_0x5023e6);return _0x37c83e['set'](_0x7cac('0x30'),_0x23eff1+'-'+_0x98e979+'/'+_0x1035c3)[_0x7cac('0x2b')](_0x5ddda3);}return null;};}function patchUpdates(_0x1a4947){return function(_0x150031){try{jsonpatch[_0x7cac('0x31')](_0x150031,_0x1a4947,!![]);}catch(_0x1e6299){return BPromise[_0x7cac('0x32')](_0x1e6299);}return _0x150031[_0x7cac('0x33')]();};}function saveUpdates(_0x10a130,_0x2939d4){return function(_0x4070eb){if(_0x4070eb){return _0x4070eb[_0x7cac('0x34')](_0x10a130)[_0x7cac('0x35')](function(_0x5737ee){return _0x5737ee;});}return null;};}function removeEntity(_0x154aa9,_0x1425cd){return function(_0xb9956c){if(_0xb9956c){return _0xb9956c['destroy']()['then'](function(){_0x154aa9[_0x7cac('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20d73f,_0x5c5372){return function(_0x32ff03){if(!_0x32ff03){_0x20d73f['sendStatus'](0x194);}return _0x32ff03;};}function handleError(_0x5a6b14,_0x344a03){_0x344a03=_0x344a03||0x1f4;return function(_0x2bf3a5){logger[_0x7cac('0x23')](_0x2bf3a5[_0x7cac('0x36')]);if(_0x2bf3a5['name']){delete _0x2bf3a5[_0x7cac('0x37')];}_0x5a6b14[_0x7cac('0x2a')](_0x344a03)[_0x7cac('0x38')](_0x2bf3a5);};}exports['index']=function(_0x1773a7,_0x56131f){var _0x404b32={},_0x9b703b={},_0x462b03={'count':0x0,'rows':[]};var _0x5d90f2=_[_0x7cac('0x39')](db[_0x7cac('0x3a')][_0x7cac('0x3b')],function(_0x40d78a){return{'name':_0x40d78a['fieldName'],'type':_0x40d78a['type']['key']};});_0x9b703b[_0x7cac('0x3c')]=_[_0x7cac('0x39')](_0x5d90f2,'name');_0x9b703b[_0x7cac('0x3d')]=_['keys'](_0x1773a7[_0x7cac('0x3d')]);_0x9b703b[_0x7cac('0x3e')]=_[_0x7cac('0x3f')](_0x9b703b[_0x7cac('0x3c')],_0x9b703b[_0x7cac('0x3d')]);_0x404b32['attributes']=_['intersection'](_0x9b703b['model'],qs[_0x7cac('0x40')](_0x1773a7['query'][_0x7cac('0x40')]));_0x404b32[_0x7cac('0x41')]=_0x404b32['attributes'][_0x7cac('0x42')]?_0x404b32['attributes']:_0x9b703b['model'];if(!_0x1773a7['query']['hasOwnProperty'](_0x7cac('0x43'))){_0x404b32[_0x7cac('0x2f')]=qs[_0x7cac('0x2f')](_0x1773a7[_0x7cac('0x3d')][_0x7cac('0x2f')]);_0x404b32[_0x7cac('0x2c')]=qs[_0x7cac('0x2c')](_0x1773a7[_0x7cac('0x3d')]['offset']);}_0x404b32[_0x7cac('0x44')]=qs[_0x7cac('0x45')](_0x1773a7['query'][_0x7cac('0x45')]);_0x404b32[_0x7cac('0x46')]=qs[_0x7cac('0x3e')](_['pick'](_0x1773a7['query'],_0x9b703b['filters']),_0x5d90f2);if(_0x1773a7['query'][_0x7cac('0x47')]){_0x404b32[_0x7cac('0x46')]=_[_0x7cac('0x48')](_0x404b32[_0x7cac('0x46')],{'$or':_[_0x7cac('0x39')](_0x5d90f2,function(_0x435c8f){if(_0x435c8f[_0x7cac('0x49')]!==_0x7cac('0x4a')){var _0x2ccef5={};_0x2ccef5[_0x435c8f[_0x7cac('0x37')]]={'$like':'%'+_0x1773a7[_0x7cac('0x3d')][_0x7cac('0x47')]+'%'};return _0x2ccef5;}})});}_0x404b32=_[_0x7cac('0x48')]({},_0x404b32,_0x1773a7[_0x7cac('0x4b')]);var _0x3e0db9={'where':_0x404b32[_0x7cac('0x46')]};return db[_0x7cac('0x3a')][_0x7cac('0x2e')](_0x3e0db9)[_0x7cac('0x35')](function(_0x1d627d){_0x462b03[_0x7cac('0x2e')]=_0x1d627d;if(_0x1773a7['query']['includeAll']){_0x404b32[_0x7cac('0x4c')]=[{'all':!![]}];}return db[_0x7cac('0x3a')][_0x7cac('0x4d')](_0x404b32);})[_0x7cac('0x35')](function(_0x4c25b4){_0x462b03[_0x7cac('0x4e')]=_0x4c25b4;return _0x462b03;})[_0x7cac('0x35')](respondWithFilteredResult(_0x56131f,_0x404b32))[_0x7cac('0x28')](handleError(_0x56131f,null));};exports['show']=function(_0x1fd452,_0x5d7b40){var _0xdfdd4={'raw':!![],'where':{'id':_0x1fd452[_0x7cac('0x4f')]['id']}},_0xe75df8={};_0xe75df8['model']=_[_0x7cac('0x50')](db[_0x7cac('0x3a')][_0x7cac('0x3b')]);_0xe75df8[_0x7cac('0x3d')]=_[_0x7cac('0x50')](_0x1fd452['query']);_0xe75df8['filters']=_['intersection'](_0xe75df8[_0x7cac('0x3c')],_0xe75df8[_0x7cac('0x3d')]);_0xdfdd4[_0x7cac('0x41')]=_[_0x7cac('0x3f')](_0xe75df8[_0x7cac('0x3c')],qs[_0x7cac('0x40')](_0x1fd452[_0x7cac('0x3d')][_0x7cac('0x40')]));_0xdfdd4['attributes']=_0xdfdd4[_0x7cac('0x41')][_0x7cac('0x42')]?_0xdfdd4[_0x7cac('0x41')]:_0xe75df8[_0x7cac('0x3c')];if(_0x1fd452[_0x7cac('0x3d')]['includeAll']){_0xdfdd4[_0x7cac('0x4c')]=[{'all':!![]}];}_0xdfdd4=_[_0x7cac('0x48')]({},_0xdfdd4,_0x1fd452[_0x7cac('0x4b')]);return db[_0x7cac('0x3a')][_0x7cac('0x51')](_0xdfdd4)[_0x7cac('0x35')](handleEntityNotFound(_0x5d7b40,null))['then'](respondWithResult(_0x5d7b40,null))[_0x7cac('0x28')](handleError(_0x5d7b40,null));};exports['create']=function(_0x54afc9,_0x136d95){return db[_0x7cac('0x3a')]['create'](_0x54afc9[_0x7cac('0x52')],{})['then'](respondWithResult(_0x136d95,0xc9))[_0x7cac('0x28')](handleError(_0x136d95,null));};exports[_0x7cac('0x34')]=function(_0x1d2959,_0x50319a){if(_0x1d2959[_0x7cac('0x52')]['id']){delete _0x1d2959['body']['id'];}return db[_0x7cac('0x3a')]['find']({'where':{'id':_0x1d2959['params']['id']}})['then'](handleEntityNotFound(_0x50319a,null))['then'](saveUpdates(_0x1d2959[_0x7cac('0x52')],null))['then'](respondWithResult(_0x50319a,null))[_0x7cac('0x28')](handleError(_0x50319a,null));};exports[_0x7cac('0x53')]=function(_0x2acd8d,_0x59db94){return db[_0x7cac('0x3a')][_0x7cac('0x51')]({'where':{'id':_0x2acd8d[_0x7cac('0x4f')]['id']}})[_0x7cac('0x35')](handleEntityNotFound(_0x59db94,null))['then'](removeEntity(_0x59db94,null))[_0x7cac('0x28')](handleError(_0x59db94,null));};exports[_0x7cac('0x54')]=function(_0x2d7d90,_0x1c880b){return db[_0x7cac('0x3a')]['describe']()['then'](respondWithResult(_0x1c880b,null))[_0x7cac('0x28')](handleError(_0x1c880b,null));};var interaction_log=require(_0x7cac('0x11'))(_0x7cac('0x55'));exports[_0x7cac('0x56')]=function(_0xe219d7,_0x159033,_0x55f208){var _0x30569a={'agent':{},'channel':_0x7cac('0x57')};if(_0xe219d7[_0x7cac('0x52')]['id']){delete _0xe219d7[_0x7cac('0x52')]['id'];}_0xe219d7[_0x7cac('0x52')][_0x7cac('0x58')]=!![];_0xe219d7['body'][_0x7cac('0x59')]=moment()[_0x7cac('0x5a')](_0x7cac('0x5b'));_0xe219d7['body'][_0x7cac('0x5c')]=_0xe219d7['body']['UserId']||_0xe219d7[_0x7cac('0x5d')]['id'];_0x30569a['agent']['id']=_0xe219d7[_0x7cac('0x52')][_0x7cac('0x5c')];return db[_0x7cac('0x3a')][_0x7cac('0x51')]({'where':{'id':_0xe219d7['params']['id'],'UserId':null}})[_0x7cac('0x35')](handleEntityNotFound(_0x159033,null))[_0x7cac('0x35')](saveUpdates(_0xe219d7['body'],null))[_0x7cac('0x35')](function(_0x1a4fd2){if(_0x1a4fd2){_0x30569a['message']=_0x1a4fd2[_0x7cac('0x5e')]({'plain':!![]});return db[_0x7cac('0x5f')][_0x7cac('0x51')]({'where':{'id':_0x1a4fd2[_0x7cac('0x60')]}});}return null;})[_0x7cac('0x35')](handleEntityNotFound(_0x159033,null))['then'](function(_0x36d668){if(_0x36d668){return _0x36d668[_0x7cac('0x34')]({'UserId':_0xe219d7['body'][_0x7cac('0x5c')],'read1stAt':_['isNil'](_0x36d668['read1stAt'])?moment()[_0x7cac('0x5a')](_0x7cac('0x5b')):undefined});}return null;})[_0x7cac('0x35')](function(_0x2d010d){if(_0x2d010d){_0x30569a[_0x7cac('0x61')]=_0x2d010d[_0x7cac('0x5e')]({'plain':!![]});interaction_log[_0x7cac('0x62')](_0x7cac('0x63'),_0xe219d7[_0x7cac('0x5d')]['id'],_0xe219d7['user'][_0x7cac('0x37')],_0xe219d7[_0x7cac('0x5d')][_0x7cac('0x64')],_0x30569a[_0x7cac('0x61')]['id'],_0xe219d7[_0x7cac('0x52')]?JSON[_0x7cac('0x22')](_0xe219d7[_0x7cac('0x52')]):_0x7cac('0x65'));return respondWithRpcPromise(_0x7cac('0x66'),_0x7cac('0x67'),_0x30569a);}return null;})['then'](function(_0xb1460b){var _0x5efa3d=_0x7cac('0x68')+_0xb1460b[_0x7cac('0x26')][_0x7cac('0x69')];return db[_0x7cac('0x6a')][_0x7cac('0x3d')](_0x5efa3d,{'type':db[_0x7cac('0x6b')][_0x7cac('0x6c')]['SELECT'],'raw':!![]})['then'](function(_0x23bedf){return _0x23bedf;});})[_0x7cac('0x35')](function(_0x1912f6){if(_0x1912f6){_0x30569a['message'][_0x7cac('0x6d')]=_0x1912f6[0x0];if(!_0xe219d7['body'][_0x7cac('0x5c')])return;return db['User'][_0x7cac('0x51')]({'where':{'id':_0xe219d7[_0x7cac('0x52')][_0x7cac('0x5c')],'role':_0x7cac('0x6e')},'attributes':['id',_0x7cac('0x37'),_0x7cac('0x6f'),_0x7cac('0x70'),_0x7cac('0x71')],'raw':!![]});}return null;})[_0x7cac('0x35')](function(_0x3b2beb){if(!_0x3b2beb)return null;_0x30569a[_0x7cac('0x26')][_0x7cac('0x6e')]=_0x3b2beb;return _0x30569a;})['then'](function(_0x2b5d72){if(_0x2b5d72){if(_0xe219d7[_0x7cac('0x52')][_0x7cac('0x72')]){_0x30569a[_0x7cac('0x26')]['interface']=util[_0x7cac('0x5a')]('SIP/%s',_0xe219d7['user'][_0x7cac('0x37')]);_0x30569a[_0x7cac('0x26')]['channel']=_0x30569a[_0x7cac('0x73')];_0x30569a[_0x7cac('0x26')][_0x7cac('0x74')]=_0x30569a['channel'];_0x30569a[_0x7cac('0x26')][_0x7cac('0x75')]='accept';return respondWithRpcPromise(_0x7cac('0x76'),_0x7cac('0x76'),{'event':'acceptmessage','message':_0x30569a['message']},client9002)[_0x7cac('0x35')](function(){return _0x30569a;});}return _0x30569a;}return null;})[_0x7cac('0x35')](respondWithResult(_0x159033,null))[_0x7cac('0x28')](handleError(_0x159033,null));};var interaction_log=require(_0x7cac('0x11'))(_0x7cac('0x55'));exports[_0x7cac('0x32')]=function(_0x2689be,_0x31c1d4,_0x32cf45){var _0x539f89={'agent':{},'channel':_0x7cac('0x57')};if(_0x2689be[_0x7cac('0x52')]['id']){delete _0x2689be[_0x7cac('0x52')]['id'];}_0x2689be[_0x7cac('0x52')][_0x7cac('0x5c')]=_0x2689be[_0x7cac('0x52')]['UserId']||_0x2689be[_0x7cac('0x5d')]['id'];_0x539f89[_0x7cac('0x6e')]['id']=_0x2689be['body'][_0x7cac('0x5c')];return db['WhatsappMessage'][_0x7cac('0x51')]({'where':{'id':_0x2689be[_0x7cac('0x4f')]['id'],'UserId':null}})[_0x7cac('0x35')](handleEntityNotFound(_0x31c1d4,null))[_0x7cac('0x35')](function(_0x140122){if(_0x140122){_0x539f89[_0x7cac('0x26')]=_0x140122[_0x7cac('0x5e')]({'plain':!![]});return db['WhatsappInteraction'][_0x7cac('0x51')]({'where':{'id':_0x140122[_0x7cac('0x60')]}});}return null;})[_0x7cac('0x35')](handleEntityNotFound(_0x31c1d4,null))[_0x7cac('0x35')](function(_0x36e52c){if(_0x36e52c){_0x539f89[_0x7cac('0x61')]=_0x36e52c[_0x7cac('0x5e')]({'plain':!![]});interaction_log['info'](_0x7cac('0x77'),_0x2689be['user']['id'],_0x2689be[_0x7cac('0x5d')][_0x7cac('0x37')],_0x2689be[_0x7cac('0x5d')][_0x7cac('0x64')],_0x539f89[_0x7cac('0x61')]['id'],_0x2689be['body']?JSON[_0x7cac('0x22')](_0x2689be[_0x7cac('0x52')]):'null');return respondWithRpcPromise(_0x7cac('0x78'),_0x7cac('0x79'),_0x539f89);}return null;})[_0x7cac('0x35')](function(_0x2bcfa9){var _0x2f89fc=_0x7cac('0x68')+_0x2bcfa9[_0x7cac('0x26')][_0x7cac('0x69')];return db[_0x7cac('0x6a')]['query'](_0x2f89fc,{'type':db['Sequelize'][_0x7cac('0x6c')][_0x7cac('0x7a')],'raw':!![]})['then'](function(_0x35ed55){return _0x35ed55;});})[_0x7cac('0x35')](function(_0x419268){if(_0x419268){_0x539f89[_0x7cac('0x26')][_0x7cac('0x6d')]=_0x419268[0x0];if(!_0x2689be[_0x7cac('0x52')][_0x7cac('0x5c')])return;return db[_0x7cac('0x7b')]['find']({'where':{'id':_0x2689be[_0x7cac('0x52')][_0x7cac('0x5c')],'role':'agent'},'attributes':['id','name',_0x7cac('0x6f'),_0x7cac('0x70'),_0x7cac('0x71')],'raw':!![]});}return null;})['then'](function(_0x315c50){if(!_0x315c50)return null;_0x539f89['message'][_0x7cac('0x6e')]=_0x315c50;return _0x539f89;})[_0x7cac('0x35')](function(_0x65002){if(_0x65002){_0x65002['message']['interface']=util[_0x7cac('0x5a')]('SIP/%s',_0x2689be[_0x7cac('0x5d')][_0x7cac('0x37')]);_0x65002['message'][_0x7cac('0x73')]=_0x539f89[_0x7cac('0x73')];_0x65002[_0x7cac('0x26')][_0x7cac('0x74')]=_0x539f89[_0x7cac('0x73')];_0x65002[_0x7cac('0x26')][_0x7cac('0x75')]='reject';respondWithRpcPromise(_0x7cac('0x76'),'EventManager',{'event':_0x7cac('0x7c'),'message':_0x65002[_0x7cac('0x26')]},client9002);return _0x539f89;}return null;})[_0x7cac('0x35')](respondWithResult(_0x31c1d4,null))[_0x7cac('0x28')](handleError(_0x31c1d4,null));};exports[_0x7cac('0x2a')]=function(_0x42b139,_0x3d87c1,_0x13d4f1){if(_0x42b139[_0x7cac('0x52')]['id']){delete _0x42b139[_0x7cac('0x52')]['id'];}var _0x3dfed4;return db[_0x7cac('0x3a')][_0x7cac('0x51')]({'where':{'id':_0x42b139['params']['id']}})[_0x7cac('0x35')](handleEntityNotFound(_0x3d87c1,null))[_0x7cac('0x35')](function(_0x52a521){if(_0x52a521){_0x3dfed4=_0x52a521;return db[_0x7cac('0x7d')]['find']({'where':{'id':_0x52a521[_0x7cac('0x7e')]}});}})[_0x7cac('0x35')](handleEntityNotFound(_0x3d87c1,null))['then'](function(_0x1b30a2){if(_0x1b30a2){logger[_0x7cac('0x20')](_0x7cac('0x7f'),_0x7cac('0x2a'),_0x7cac('0x80'),_0x1b30a2[_0x7cac('0x49')],util[_0x7cac('0x81')](_0x42b139[_0x7cac('0x52')],{'showHidden':![],'depth':null}));switch(_0x1b30a2[_0x7cac('0x49')]){case'twilio':if(_0x42b139[_0x7cac('0x52')][_0x7cac('0x82')]&&_0x42b139[_0x7cac('0x52')]['MessageSid']===_0x3dfed4[_0x7cac('0x83')]&&_0x42b139[_0x7cac('0x52')][_0x7cac('0x84')]&&_0x42b139['body'][_0x7cac('0x84')]===_0x7cac('0x58')){return _0x3dfed4[_0x7cac('0x34')]({'read':!![]});}else{logger[_0x7cac('0x23')](_0x7cac('0x85'),'status',_0x7cac('0x86'),util[_0x7cac('0x81')](_0x42b139['body'],{'showHidden':![],'depth':null}));}break;}return _0x3dfed4;}})[_0x7cac('0x35')](respondWithResult(_0x3d87c1,null))[_0x7cac('0x28')](handleError(_0x3d87c1,null));}; \ No newline at end of file +var _0xead0=['VIRTUAL','WhatsappMessage','count','includeAll','include','rows','show','options','find','create','body','params','describe','whatsapp-interactions','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','agent','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','null','RejectMessage','rejectMessage','SELECT','fullname','email','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','twilio','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','end','status','json','offset','undefined','limit','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x210603,_0x4adbac){var _0x1bcb7d=function(_0x2cdf89){while(--_0x2cdf89){_0x210603['push'](_0x210603['shift']());}};_0x1bcb7d(++_0x4adbac);}(_0xead0,0x1de));var _0x0ead=function(_0x33670a,_0x55e188){_0x33670a=_0x33670a-0x0;var _0x36ad1d=_0xead0[_0x33670a];return _0x36ad1d;};'use strict';var emlformat=require(_0x0ead('0x0'));var rimraf=require(_0x0ead('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ead('0x2'));var rp=require(_0x0ead('0x3'));var moment=require('moment');var BPromise=require(_0x0ead('0x4'));var Mustache=require(_0x0ead('0x5'));var util=require('util');var path=require(_0x0ead('0x6'));var sox=require(_0x0ead('0x7'));var csv=require(_0x0ead('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0ead('0x9'));var _=require(_0x0ead('0xa'));var squel=require(_0x0ead('0xb'));var crypto=require(_0x0ead('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0ead('0xd'));var toCsv=require(_0x0ead('0x8'));var querystring=require(_0x0ead('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0ead('0xf'));var qs=require(_0x0ead('0x10'));var as=require(_0x0ead('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ead('0x12'))(_0x0ead('0x13'));var utils=require(_0x0ead('0x14'));var config=require(_0x0ead('0x15'));var licenseUtil=require(_0x0ead('0x16'));var db=require(_0x0ead('0x17'))['db'];config[_0x0ead('0x18')]=_[_0x0ead('0x19')](config[_0x0ead('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x0ead('0x1a'))(new Redis(config[_0x0ead('0x18')]));require('./whatsappMessage.socket')[_0x0ead('0x1b')](socket);var jayson=require(_0x0ead('0x1c'));var client=jayson[_0x0ead('0x1d')][_0x0ead('0x1e')]({'port':0x232c});var client9002=jayson[_0x0ead('0x1d')][_0x0ead('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x16c2ac,_0x2b2ce6,_0x6bce58,_0x10d6cb){return new BPromise(function(_0x2707bd,_0x4a9c97){var _0x5c4b72=_0x10d6cb||client;return _0x5c4b72[_0x0ead('0x1f')](_0x16c2ac,_0x6bce58)['then'](function(_0x5f3bc6){logger[_0x0ead('0x20')](_0x0ead('0x21'),_0x2b2ce6,_0x0ead('0x22'));logger[_0x0ead('0x23')](_0x0ead('0x24'),_0x2b2ce6,_0x0ead('0x22'),JSON['stringify'](_0x5f3bc6));if(_0x5f3bc6[_0x0ead('0x25')]){if(_0x5f3bc6[_0x0ead('0x25')][_0x0ead('0x26')]===0x1f4){logger[_0x0ead('0x25')](_0x0ead('0x21'),_0x2b2ce6,_0x5f3bc6[_0x0ead('0x25')][_0x0ead('0x27')]);return _0x4a9c97(_0x5f3bc6['error'][_0x0ead('0x27')]);}logger['error'](_0x0ead('0x21'),_0x2b2ce6,_0x5f3bc6['error'][_0x0ead('0x27')]);return _0x2707bd(_0x5f3bc6[_0x0ead('0x25')][_0x0ead('0x27')]);}else{logger['info'](_0x0ead('0x21'),_0x2b2ce6,_0x0ead('0x22'));_0x2707bd(_0x5f3bc6['result'][_0x0ead('0x27')]);}})[_0x0ead('0x28')](function(_0x212faa){logger[_0x0ead('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x2b2ce6,_0x212faa);_0x4a9c97(_0x212faa);});});}function respondWithStatusCode(_0x3b0e06,_0x3462ca){_0x3462ca=_0x3462ca||0xcc;return function(_0x14bcf8){if(_0x14bcf8){return _0x3b0e06[_0x0ead('0x29')](_0x3462ca);}return _0x3b0e06['status'](_0x3462ca)[_0x0ead('0x2a')]();};}function respondWithResult(_0x215945,_0x462921){_0x462921=_0x462921||0xc8;return function(_0x787fb3){if(_0x787fb3){return _0x215945[_0x0ead('0x2b')](_0x462921)[_0x0ead('0x2c')](_0x787fb3);}};}function respondWithFilteredResult(_0x251f07,_0x27c7d2){return function(_0x4bdaef){if(_0x4bdaef){var _0xb148cf=typeof _0x27c7d2[_0x0ead('0x2d')]===_0x0ead('0x2e')&&typeof _0x27c7d2[_0x0ead('0x2f')]===_0x0ead('0x2e');var _0x49a160=_0x4bdaef['count'];var _0x4aa42e=_0xb148cf?0x0:_0x27c7d2[_0x0ead('0x2d')];var _0x451ad4=_0xb148cf?_0x4bdaef['count']:_0x27c7d2[_0x0ead('0x2d')]+_0x27c7d2['limit'];var _0x10d9df;if(_0x451ad4>=_0x49a160){_0x451ad4=_0x49a160;_0x10d9df=0xc8;}else{_0x10d9df=0xce;}_0x251f07[_0x0ead('0x2b')](_0x10d9df);return _0x251f07['set'](_0x0ead('0x30'),_0x4aa42e+'-'+_0x451ad4+'/'+_0x49a160)[_0x0ead('0x2c')](_0x4bdaef);}return null;};}function patchUpdates(_0xc392d5){return function(_0xbe07df){try{jsonpatch['apply'](_0xbe07df,_0xc392d5,!![]);}catch(_0x305e5d){return BPromise[_0x0ead('0x31')](_0x305e5d);}return _0xbe07df[_0x0ead('0x32')]();};}function saveUpdates(_0x21188c,_0x3eaded){return function(_0x180b8f){if(_0x180b8f){return _0x180b8f[_0x0ead('0x33')](_0x21188c)[_0x0ead('0x34')](function(_0x501cf6){return _0x501cf6;});}return null;};}function removeEntity(_0x288ea4,_0x54a0cc){return function(_0xf2158b){if(_0xf2158b){return _0xf2158b[_0x0ead('0x35')]()['then'](function(){_0x288ea4[_0x0ead('0x2b')](0xcc)[_0x0ead('0x2a')]();});}};}function handleEntityNotFound(_0x2390bc,_0x48206d){return function(_0x160943){if(!_0x160943){_0x2390bc[_0x0ead('0x29')](0x194);}return _0x160943;};}function handleError(_0x47162f,_0x343991){_0x343991=_0x343991||0x1f4;return function(_0x31d85e){logger[_0x0ead('0x25')](_0x31d85e[_0x0ead('0x36')]);if(_0x31d85e[_0x0ead('0x37')]){delete _0x31d85e['name'];}_0x47162f[_0x0ead('0x2b')](_0x343991)[_0x0ead('0x38')](_0x31d85e);};}exports[_0x0ead('0x39')]=function(_0x472c66,_0x24c85f){var _0x4ef5cc={},_0x340cc2={},_0x25c3f8={'count':0x0,'rows':[]};var _0x5a82f7=_[_0x0ead('0x3a')](db['WhatsappMessage'][_0x0ead('0x3b')],function(_0x2d4c85){return{'name':_0x2d4c85[_0x0ead('0x3c')],'type':_0x2d4c85[_0x0ead('0x3d')][_0x0ead('0x3e')]};});_0x340cc2['model']=_[_0x0ead('0x3a')](_0x5a82f7,'name');_0x340cc2[_0x0ead('0x3f')]=_[_0x0ead('0x40')](_0x472c66[_0x0ead('0x3f')]);_0x340cc2[_0x0ead('0x41')]=_['intersection'](_0x340cc2[_0x0ead('0x42')],_0x340cc2[_0x0ead('0x3f')]);_0x4ef5cc[_0x0ead('0x43')]=_[_0x0ead('0x44')](_0x340cc2[_0x0ead('0x42')],qs['fields'](_0x472c66[_0x0ead('0x3f')][_0x0ead('0x45')]));_0x4ef5cc[_0x0ead('0x43')]=_0x4ef5cc[_0x0ead('0x43')][_0x0ead('0x46')]?_0x4ef5cc[_0x0ead('0x43')]:_0x340cc2['model'];if(!_0x472c66['query'][_0x0ead('0x47')](_0x0ead('0x48'))){_0x4ef5cc[_0x0ead('0x2f')]=qs[_0x0ead('0x2f')](_0x472c66['query'][_0x0ead('0x2f')]);_0x4ef5cc['offset']=qs[_0x0ead('0x2d')](_0x472c66[_0x0ead('0x3f')]['offset']);}_0x4ef5cc['order']=qs['sort'](_0x472c66[_0x0ead('0x3f')][_0x0ead('0x49')]);_0x4ef5cc[_0x0ead('0x4a')]=qs[_0x0ead('0x41')](_[_0x0ead('0x4b')](_0x472c66[_0x0ead('0x3f')],_0x340cc2[_0x0ead('0x41')]),_0x5a82f7);if(_0x472c66['query'][_0x0ead('0x4c')]){_0x4ef5cc[_0x0ead('0x4a')]=_[_0x0ead('0x4d')](_0x4ef5cc[_0x0ead('0x4a')],{'$or':_[_0x0ead('0x3a')](_0x5a82f7,function(_0x4e29ec){if(_0x4e29ec['type']!==_0x0ead('0x4e')){var _0x16df26={};_0x16df26[_0x4e29ec[_0x0ead('0x37')]]={'$like':'%'+_0x472c66[_0x0ead('0x3f')][_0x0ead('0x4c')]+'%'};return _0x16df26;}})});}_0x4ef5cc=_['merge']({},_0x4ef5cc,_0x472c66['options']);var _0x732edd={'where':_0x4ef5cc[_0x0ead('0x4a')]};return db[_0x0ead('0x4f')][_0x0ead('0x50')](_0x732edd)['then'](function(_0x2a5bc1){_0x25c3f8[_0x0ead('0x50')]=_0x2a5bc1;if(_0x472c66[_0x0ead('0x3f')][_0x0ead('0x51')]){_0x4ef5cc[_0x0ead('0x52')]=[{'all':!![]}];}return db[_0x0ead('0x4f')]['findAll'](_0x4ef5cc);})[_0x0ead('0x34')](function(_0x4ca9c2){_0x25c3f8[_0x0ead('0x53')]=_0x4ca9c2;return _0x25c3f8;})['then'](respondWithFilteredResult(_0x24c85f,_0x4ef5cc))[_0x0ead('0x28')](handleError(_0x24c85f,null));};exports[_0x0ead('0x54')]=function(_0x1a5900,_0x4cf6b0){var _0x50850b={'raw':!![],'where':{'id':_0x1a5900['params']['id']}},_0xe82de7={};_0xe82de7[_0x0ead('0x42')]=_[_0x0ead('0x40')](db[_0x0ead('0x4f')][_0x0ead('0x3b')]);_0xe82de7[_0x0ead('0x3f')]=_['keys'](_0x1a5900[_0x0ead('0x3f')]);_0xe82de7[_0x0ead('0x41')]=_[_0x0ead('0x44')](_0xe82de7[_0x0ead('0x42')],_0xe82de7[_0x0ead('0x3f')]);_0x50850b['attributes']=_['intersection'](_0xe82de7['model'],qs['fields'](_0x1a5900[_0x0ead('0x3f')][_0x0ead('0x45')]));_0x50850b[_0x0ead('0x43')]=_0x50850b[_0x0ead('0x43')][_0x0ead('0x46')]?_0x50850b['attributes']:_0xe82de7['model'];if(_0x1a5900[_0x0ead('0x3f')]['includeAll']){_0x50850b[_0x0ead('0x52')]=[{'all':!![]}];}_0x50850b=_[_0x0ead('0x4d')]({},_0x50850b,_0x1a5900[_0x0ead('0x55')]);return db[_0x0ead('0x4f')][_0x0ead('0x56')](_0x50850b)[_0x0ead('0x34')](handleEntityNotFound(_0x4cf6b0,null))[_0x0ead('0x34')](respondWithResult(_0x4cf6b0,null))[_0x0ead('0x28')](handleError(_0x4cf6b0,null));};exports[_0x0ead('0x57')]=function(_0x1bc727,_0x490bde){return db[_0x0ead('0x4f')][_0x0ead('0x57')](_0x1bc727['body'],{})['then'](respondWithResult(_0x490bde,0xc9))[_0x0ead('0x28')](handleError(_0x490bde,null));};exports[_0x0ead('0x33')]=function(_0x37983a,_0x466e6f){if(_0x37983a['body']['id']){delete _0x37983a[_0x0ead('0x58')]['id'];}return db[_0x0ead('0x4f')][_0x0ead('0x56')]({'where':{'id':_0x37983a['params']['id']}})['then'](handleEntityNotFound(_0x466e6f,null))[_0x0ead('0x34')](saveUpdates(_0x37983a[_0x0ead('0x58')],null))[_0x0ead('0x34')](respondWithResult(_0x466e6f,null))[_0x0ead('0x28')](handleError(_0x466e6f,null));};exports[_0x0ead('0x35')]=function(_0x590d6b,_0x199093){return db[_0x0ead('0x4f')][_0x0ead('0x56')]({'where':{'id':_0x590d6b[_0x0ead('0x59')]['id']}})[_0x0ead('0x34')](handleEntityNotFound(_0x199093,null))[_0x0ead('0x34')](removeEntity(_0x199093,null))[_0x0ead('0x28')](handleError(_0x199093,null));};exports[_0x0ead('0x5a')]=function(_0x45f8d9,_0x30b4a4){return db[_0x0ead('0x4f')][_0x0ead('0x5a')]()[_0x0ead('0x34')](respondWithResult(_0x30b4a4,null))[_0x0ead('0x28')](handleError(_0x30b4a4,null));};var interaction_log=require('../../config/logger')(_0x0ead('0x5b'));exports['accept']=function(_0x1b098a,_0x7b499,_0x54d741){var _0x35efa8={'agent':{},'channel':_0x0ead('0x5c')};if(_0x1b098a[_0x0ead('0x58')]['id']){delete _0x1b098a[_0x0ead('0x58')]['id'];}_0x1b098a[_0x0ead('0x58')][_0x0ead('0x5d')]=!![];_0x1b098a[_0x0ead('0x58')][_0x0ead('0x5e')]=moment()[_0x0ead('0x5f')](_0x0ead('0x60'));_0x1b098a['body']['UserId']=_0x1b098a[_0x0ead('0x58')][_0x0ead('0x61')]||_0x1b098a[_0x0ead('0x62')]['id'];_0x35efa8['agent']['id']=_0x1b098a['body'][_0x0ead('0x61')];return db[_0x0ead('0x4f')]['find']({'where':{'id':_0x1b098a[_0x0ead('0x59')]['id'],'UserId':null}})[_0x0ead('0x34')](handleEntityNotFound(_0x7b499,null))[_0x0ead('0x34')](saveUpdates(_0x1b098a['body'],null))[_0x0ead('0x34')](function(_0x1bcb0f){if(_0x1bcb0f){_0x35efa8[_0x0ead('0x27')]=_0x1bcb0f['get']({'plain':!![]});return db[_0x0ead('0x63')][_0x0ead('0x56')]({'where':{'id':_0x1bcb0f[_0x0ead('0x64')]}});}return null;})[_0x0ead('0x34')](handleEntityNotFound(_0x7b499,null))[_0x0ead('0x34')](function(_0x56b0cb){if(_0x56b0cb){return _0x56b0cb[_0x0ead('0x33')]({'UserId':_0x1b098a[_0x0ead('0x58')][_0x0ead('0x61')],'read1stAt':_[_0x0ead('0x65')](_0x56b0cb[_0x0ead('0x66')])?moment()[_0x0ead('0x5f')](_0x0ead('0x60')):undefined});}return null;})['then'](function(_0x2fb220){if(_0x2fb220){_0x35efa8[_0x0ead('0x67')]=_0x2fb220[_0x0ead('0x68')]({'plain':!![]});interaction_log[_0x0ead('0x20')](_0x0ead('0x69'),_0x1b098a['user']['id'],_0x1b098a[_0x0ead('0x62')][_0x0ead('0x37')],_0x1b098a['user'][_0x0ead('0x6a')],_0x35efa8[_0x0ead('0x67')]['id'],_0x1b098a[_0x0ead('0x58')]?JSON[_0x0ead('0x6b')](_0x1b098a['body']):'null');return respondWithRpcPromise(_0x0ead('0x6c'),'acceptMessage',_0x35efa8);}return null;})[_0x0ead('0x34')](function(_0x4d621a){var _0x1cb699=_0x0ead('0x6d')+_0x4d621a[_0x0ead('0x27')][_0x0ead('0x6e')];return db['sequelize']['query'](_0x1cb699,{'type':db[_0x0ead('0x6f')][_0x0ead('0x70')]['SELECT'],'raw':!![]})[_0x0ead('0x34')](function(_0x2895f7){return _0x2895f7;});})[_0x0ead('0x34')](function(_0x5549b6){if(_0x5549b6){_0x35efa8[_0x0ead('0x27')][_0x0ead('0x71')]=_0x5549b6[0x0];if(!_0x1b098a[_0x0ead('0x58')][_0x0ead('0x61')])return;return db[_0x0ead('0x72')][_0x0ead('0x56')]({'where':{'id':_0x1b098a['body'][_0x0ead('0x61')],'role':_0x0ead('0x73')},'attributes':['id',_0x0ead('0x37'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x1ed32e){if(!_0x1ed32e)return null;_0x35efa8[_0x0ead('0x27')][_0x0ead('0x73')]=_0x1ed32e;return _0x35efa8;})[_0x0ead('0x34')](function(_0x29ec83){if(_0x29ec83){if(_0x1b098a['body'][_0x0ead('0x74')]){_0x35efa8[_0x0ead('0x27')]['interface']=util[_0x0ead('0x5f')](_0x0ead('0x75'),_0x1b098a[_0x0ead('0x62')]['name']);_0x35efa8[_0x0ead('0x27')][_0x0ead('0x76')]=_0x35efa8[_0x0ead('0x76')];_0x35efa8[_0x0ead('0x27')][_0x0ead('0x77')]=_0x35efa8['channel'];_0x35efa8[_0x0ead('0x27')][_0x0ead('0x78')]=_0x0ead('0x79');return respondWithRpcPromise(_0x0ead('0x7a'),_0x0ead('0x7a'),{'event':_0x0ead('0x7b'),'message':_0x35efa8[_0x0ead('0x27')]},client9002)[_0x0ead('0x34')](function(){return _0x35efa8;});}return _0x35efa8;}return null;})['then'](respondWithResult(_0x7b499,null))['catch'](handleError(_0x7b499,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x0ead('0x31')]=function(_0x306cc1,_0x16fed7,_0x44ce6c){var _0x141e1f={'agent':{},'channel':'whatsapp'};if(_0x306cc1[_0x0ead('0x58')]['id']){delete _0x306cc1[_0x0ead('0x58')]['id'];}_0x306cc1[_0x0ead('0x58')]['UserId']=_0x306cc1[_0x0ead('0x58')]['UserId']||_0x306cc1[_0x0ead('0x62')]['id'];_0x141e1f[_0x0ead('0x73')]['id']=_0x306cc1[_0x0ead('0x58')]['UserId'];return db[_0x0ead('0x4f')][_0x0ead('0x56')]({'where':{'id':_0x306cc1[_0x0ead('0x59')]['id'],'UserId':null}})[_0x0ead('0x34')](handleEntityNotFound(_0x16fed7,null))[_0x0ead('0x34')](function(_0x57e8cf){if(_0x57e8cf){_0x141e1f['message']=_0x57e8cf[_0x0ead('0x68')]({'plain':!![]});return db['WhatsappInteraction'][_0x0ead('0x56')]({'where':{'id':_0x57e8cf[_0x0ead('0x64')]}});}return null;})[_0x0ead('0x34')](handleEntityNotFound(_0x16fed7,null))[_0x0ead('0x34')](function(_0x15fb1c){if(_0x15fb1c){_0x141e1f['interaction']=_0x15fb1c[_0x0ead('0x68')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x306cc1[_0x0ead('0x62')]['id'],_0x306cc1[_0x0ead('0x62')][_0x0ead('0x37')],_0x306cc1[_0x0ead('0x62')][_0x0ead('0x6a')],_0x141e1f[_0x0ead('0x67')]['id'],_0x306cc1[_0x0ead('0x58')]?JSON[_0x0ead('0x6b')](_0x306cc1[_0x0ead('0x58')]):_0x0ead('0x7c'));return respondWithRpcPromise(_0x0ead('0x7d'),_0x0ead('0x7e'),_0x141e1f);}return null;})['then'](function(_0x4983b2){var _0x5ac49c=_0x0ead('0x6d')+_0x4983b2[_0x0ead('0x27')][_0x0ead('0x6e')];return db['sequelize'][_0x0ead('0x3f')](_0x5ac49c,{'type':db[_0x0ead('0x6f')][_0x0ead('0x70')][_0x0ead('0x7f')],'raw':!![]})[_0x0ead('0x34')](function(_0x424f38){return _0x424f38;});})[_0x0ead('0x34')](function(_0x5040bd){if(_0x5040bd){_0x141e1f[_0x0ead('0x27')][_0x0ead('0x71')]=_0x5040bd[0x0];if(!_0x306cc1[_0x0ead('0x58')]['UserId'])return;return db[_0x0ead('0x72')]['find']({'where':{'id':_0x306cc1[_0x0ead('0x58')][_0x0ead('0x61')],'role':_0x0ead('0x73')},'attributes':['id',_0x0ead('0x37'),_0x0ead('0x80'),_0x0ead('0x81'),'internal'],'raw':!![]});}return null;})[_0x0ead('0x34')](function(_0x35362d){if(!_0x35362d)return null;_0x141e1f[_0x0ead('0x27')]['agent']=_0x35362d;return _0x141e1f;})[_0x0ead('0x34')](function(_0x4b4254){if(_0x4b4254){_0x4b4254[_0x0ead('0x27')][_0x0ead('0x82')]=util[_0x0ead('0x5f')](_0x0ead('0x75'),_0x306cc1[_0x0ead('0x62')][_0x0ead('0x37')]);_0x4b4254[_0x0ead('0x27')][_0x0ead('0x76')]=_0x141e1f[_0x0ead('0x76')];_0x4b4254[_0x0ead('0x27')][_0x0ead('0x77')]=_0x141e1f['channel'];_0x4b4254[_0x0ead('0x27')][_0x0ead('0x78')]='reject';respondWithRpcPromise(_0x0ead('0x7a'),_0x0ead('0x7a'),{'event':_0x0ead('0x83'),'message':_0x4b4254[_0x0ead('0x27')]},client9002);return _0x141e1f;}return null;})[_0x0ead('0x34')](respondWithResult(_0x16fed7,null))[_0x0ead('0x28')](handleError(_0x16fed7,null));};exports[_0x0ead('0x2b')]=function(_0x29c640,_0x310010,_0x13212d){if(_0x29c640[_0x0ead('0x58')]['id']){delete _0x29c640[_0x0ead('0x58')]['id'];}var _0x5c0919;return db[_0x0ead('0x4f')][_0x0ead('0x56')]({'where':{'id':_0x29c640['params']['id']}})['then'](handleEntityNotFound(_0x310010,null))['then'](function(_0x2179c9){if(_0x2179c9){_0x5c0919=_0x2179c9;return db[_0x0ead('0x84')][_0x0ead('0x56')]({'where':{'id':_0x2179c9[_0x0ead('0x85')]}});}})[_0x0ead('0x34')](handleEntityNotFound(_0x310010,null))[_0x0ead('0x34')](function(_0x19835e){if(_0x19835e){logger['debug']('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x0ead('0x2b'),_0x0ead('0x86'),_0x19835e['type'],util[_0x0ead('0x87')](_0x29c640[_0x0ead('0x58')],{'showHidden':![],'depth':null}));switch(_0x19835e['type']){case'twilio':if(_0x29c640[_0x0ead('0x58')]['MessageSid']&&_0x29c640['body'][_0x0ead('0x88')]===_0x5c0919[_0x0ead('0x89')]&&_0x29c640[_0x0ead('0x58')]['MessageStatus']&&_0x29c640[_0x0ead('0x58')]['MessageStatus']==='read'){return _0x5c0919[_0x0ead('0x33')]({'read':!![]});}else{logger[_0x0ead('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x0ead('0x2b'),_0x0ead('0x8a'),util[_0x0ead('0x87')](_0x29c640[_0x0ead('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x5c0919;}})[_0x0ead('0x34')](respondWithResult(_0x310010,null))['catch'](handleError(_0x310010,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 30956d8..350e09c 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 _0xa74f=['remove','hasOwnProperty','hook','exports','WhatsappMessage','update'];(function(_0x51b4c0,_0x5b1933){var _0x5bf1e9=function(_0x566944){while(--_0x566944){_0x51b4c0['push'](_0x51b4c0['shift']());}};_0x5bf1e9(++_0x5b1933);}(_0xa74f,0x9a));var _0xfa74=function(_0x4a4922,_0x82cb8f){_0x4a4922=_0x4a4922-0x0;var _0x55a8c6=_0xa74f[_0x4a4922];return _0x55a8c6;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0xfa74('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfa74('0x1'),'afterDestroy':_0xfa74('0x2')};function emitEvent(_0x394a1e){return function(_0x25a9b7,_0x5b367b,_0x141625){WhatsappMessageEvents['emit'](_0x394a1e+':'+_0x25a9b7['id'],_0x25a9b7);WhatsappMessageEvents['emit'](_0x394a1e,_0x25a9b7);_0x141625(null);};}for(var e in events){if(events[_0xfa74('0x3')](e)){var event=events[e];WhatsappMessage[_0xfa74('0x4')](e,emitEvent(event));}}module[_0xfa74('0x5')]=WhatsappMessageEvents; \ No newline at end of file +var _0xde2c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage'];(function(_0xb875ee,_0x583042){var _0x4c7f3a=function(_0x1f6661){while(--_0x1f6661){_0xb875ee['push'](_0xb875ee['shift']());}};_0x4c7f3a(++_0x583042);}(_0xde2c,0x7f));var _0xcde2=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0xde2c[_0x2b5513];return _0x578fd2;};'use strict';var EventEmitter=require(_0xcde2('0x0'));var WhatsappMessage=require(_0xcde2('0x1'))['db'][_0xcde2('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xcde2('0x3')](0x0);var events={'afterCreate':_0xcde2('0x4'),'afterUpdate':_0xcde2('0x5'),'afterDestroy':_0xcde2('0x6')};function emitEvent(_0x3a309f){return function(_0x55c175,_0x4353c8,_0x196898){WhatsappMessageEvents[_0xcde2('0x7')](_0x3a309f+':'+_0x55c175['id'],_0x55c175);WhatsappMessageEvents[_0xcde2('0x7')](_0x3a309f,_0x55c175);_0x196898(null);};}for(var e in events){if(events[_0xcde2('0x8')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xcde2('0x9')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 728a1fd..613893b 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 _0x8558=['../../config/logger','api','moment','bluebird','request-promise','node-fetch','rimraf','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','body','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','findOne','then','update','catch','secret','find','WhatsappAccountId','type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','remote','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','text','POST','statuses','message_id','err','finally','utf8mb4','util'];(function(_0x1b33bc,_0x282af6){var _0x23b81c=function(_0x67994a){while(--_0x67994a){_0x1b33bc['push'](_0x1b33bc['shift']());}};_0x23b81c(++_0x282af6);}(_0x8558,0x103));var _0x8855=function(_0x242366,_0x1cb605){_0x242366=_0x242366-0x0;var _0x1f75f3=_0x8558[_0x242366];return _0x1f75f3;};'use strict';var _=require('lodash');var util=require(_0x8855('0x0'));var logger=require(_0x8855('0x1'))(_0x8855('0x2'));var moment=require(_0x8855('0x3'));var BPromise=require(_0x8855('0x4'));var rp=require(_0x8855('0x5'));var fetch=require(_0x8855('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8855('0x7'));var config=require('../../config/environment');var attributes=require(_0x8855('0x8'));module['exports']=function(_0x276ee5,_0x2039d5){return _0x276ee5[_0x8855('0x9')](_0x8855('0xa'),attributes,{'tableName':_0x8855('0xb'),'paranoid':![],'indexes':[{'name':_0x8855('0xc'),'fields':[_0x8855('0xc')]},{'name':'fti_whatsapp_messages','fields':[_0x8855('0xd')],'type':_0x8855('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1713b9,_0xe2cb98,_0x2d9d08){var _0x2e1cd8=_0x276ee5[_0x8855('0xf')];var _0x16c40f=_0x1713b9['get']({'plain':!![]});if(_0x16c40f[_0x8855('0x10')][_0x8855('0x11')]()==='in'||_0x16c40f['direction'][_0x8855('0x11')]()===_0x8855('0x12')&&!_0x16c40f['secret']&&!_[_0x8855('0x13')](_0x16c40f[_0x8855('0x14')])){_0x2e1cd8[_0x8855('0x15')][_0x8855('0x16')]({'where':{'id':_0x16c40f['WhatsappInteractionId']}})[_0x8855('0x17')](function(_0x4c8d10){if(_0x4c8d10){_0x4c8d10[_0x8855('0x18')]({'lastMsgAt':_0x16c40f['createdAt'],'lastMsgDirection':_0x16c40f[_0x8855('0x10')][_0x8855('0x11')]()});}})[_0x8855('0x19')](function(_0x3849a5){console['error'](_0x3849a5);});}if(_0x16c40f[_0x8855('0x10')]==='out'&&!_0x16c40f[_0x8855('0x1a')]){var _0x1d6978;_0x2e1cd8['WhatsappAccount'][_0x8855('0x1b')]({'where':{'id':_0x16c40f[_0x8855('0x1c')]},'raw':!![]})['then'](function(_0x1b1b79){_0x1d6978=_0x1b1b79;if(_0x1d6978&&_0x1d6978[_0x8855('0x1d')]){switch(_0x1d6978['type']){case _0x8855('0x1e'):var _0x2953a4=require(_0x8855('0x1e'));if(_0x1d6978['accountSid']&&_0x1d6978['authToken']&&_0x1d6978['phone']){var _0x53db0b=new _0x2953a4(_0x1d6978[_0x8855('0x1f')],_0x1d6978[_0x8855('0x20')]);_0x53db0b[_0x8855('0x21')][_0x8855('0x22')]({'body':_0x16c40f[_0x8855('0xd')],'to':_0x8855('0x23')+_0x16c40f[_0x8855('0x24')],'from':_0x8855('0x23')+_0x1d6978[_0x8855('0x24')],'statusCallback':_0x1d6978[_0x8855('0x25')]+'/api/whatsapp/messages/'+_0x16c40f['id']+'/status?token='+_0x1d6978[_0x8855('0x26')]})[_0x8855('0x17')](function(_0x27cf6b){if(_0x27cf6b[_0x8855('0x27')]){return _0x1713b9[_0x8855('0x18')]({'messageId':_0x27cf6b[_0x8855('0x27')]});}})[_0x8855('0x19')](function(_0x46b701){logger[_0x8855('0x28')](_0x8855('0x29'),_0x8855('0x2a'),'twilio',util['inspect'](_0x46b701,{'showHidden':![],'depth':null}));});}else{logger[_0x8855('0x28')](_0x8855('0x29'),_0x8855('0x2a'),'twilio',_0x8855('0x2b'));}break;case _0x8855('0x2c'):var _0x44e0b4=_0x1d6978[_0x8855('0x1f')];var _0x1f26a9=_0x1d6978[_0x8855('0x20')];var _0x1774ed=_0x1d6978['baseUrl']+'/whatsapp/v1/'+_0x44e0b4+'/messages/';var _0xba3bad={'to':[_0x16c40f[_0x8855('0x24')]],'message':{'type':_0x8855('0x2d'),'text':_0x16c40f[_0x8855('0xd')]}};var _0x29bf15={'method':_0x8855('0x2e'),'uri':_0x1774ed,'headers':{'Authorization':'Bearer\x20'+_0x1f26a9,'Content-Type':'application/json'},'body':_0xba3bad,'json':!![]};rp(_0x29bf15)['then'](function(_0x71be65){if(_0x71be65[_0x8855('0x2f')][0x0]['message_id']){return _0x1713b9[_0x8855('0x18')]({'messageId':_0x71be65['statuses'][0x0][_0x8855('0x30')]});}})[_0x8855('0x19')](function(_0x36a66c){logger[_0x8855('0x31')]('WhatsappMessage,\x20%s',_0x36a66c);});break;}}})[_0x8855('0x32')](function(){_0x2d9d08();});}else{_0x2d9d08();}}},'charset':_0x8855('0x33'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x2df9=['finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','node-fetch','rimraf','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','secret','isNil','findOne','then','update','createdAt','catch','error','WhatsappAccount','type','twilio','phone','accountSid','messages','whatsapp:','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','authToken','baseUrl','/whatsapp/v1/','/messages/','text','POST','application/json','statuses','message_id','err'];(function(_0x110f5c,_0x36ebfa){var _0x2dc43d=function(_0x22e531){while(--_0x22e531){_0x110f5c['push'](_0x110f5c['shift']());}};_0x2dc43d(++_0x36ebfa);}(_0x2df9,0x14d));var _0x92df=function(_0x315f31,_0x59438e){_0x315f31=_0x315f31-0x0;var _0x120fca=_0x2df9[_0x315f31];return _0x120fca;};'use strict';var _=require(_0x92df('0x0'));var util=require(_0x92df('0x1'));var logger=require(_0x92df('0x2'))(_0x92df('0x3'));var moment=require(_0x92df('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fetch=require(_0x92df('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x92df('0x6'));var config=require(_0x92df('0x7'));var attributes=require('./whatsappMessage.attributes');module[_0x92df('0x8')]=function(_0x2e14a4,_0x45b3fc){return _0x2e14a4[_0x92df('0x9')](_0x92df('0xa'),attributes,{'tableName':_0x92df('0xb'),'paranoid':![],'indexes':[{'name':_0x92df('0xc'),'fields':[_0x92df('0xc')]},{'name':_0x92df('0xd'),'fields':[_0x92df('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x18cd96,_0x1c3d7d,_0x36fa24){var _0x5e9410=_0x2e14a4[_0x92df('0xf')];var _0x4117de=_0x18cd96[_0x92df('0x10')]({'plain':!![]});if(_0x4117de[_0x92df('0x11')]['toLowerCase']()==='in'||_0x4117de[_0x92df('0x11')][_0x92df('0x12')]()===_0x92df('0x13')&&!_0x4117de[_0x92df('0x14')]&&!_[_0x92df('0x15')](_0x4117de['UserId'])){_0x5e9410['WhatsappInteraction'][_0x92df('0x16')]({'where':{'id':_0x4117de['WhatsappInteractionId']}})[_0x92df('0x17')](function(_0x43507){if(_0x43507){_0x43507[_0x92df('0x18')]({'lastMsgAt':_0x4117de[_0x92df('0x19')],'lastMsgDirection':_0x4117de[_0x92df('0x11')][_0x92df('0x12')]()});}})[_0x92df('0x1a')](function(_0x55dab6){console[_0x92df('0x1b')](_0x55dab6);});}if(_0x4117de['direction']===_0x92df('0x13')&&!_0x4117de[_0x92df('0x14')]){var _0x3cb103;_0x5e9410[_0x92df('0x1c')]['find']({'where':{'id':_0x4117de['WhatsappAccountId']},'raw':!![]})['then'](function(_0x3f86e6){_0x3cb103=_0x3f86e6;if(_0x3cb103&&_0x3cb103[_0x92df('0x1d')]){switch(_0x3cb103[_0x92df('0x1d')]){case _0x92df('0x1e'):var _0x7eac6c=require('twilio');if(_0x3cb103['accountSid']&&_0x3cb103['authToken']&&_0x3cb103[_0x92df('0x1f')]){var _0x474ee5=new _0x7eac6c(_0x3cb103[_0x92df('0x20')],_0x3cb103['authToken']);_0x474ee5[_0x92df('0x21')]['create']({'body':_0x4117de[_0x92df('0xe')],'to':_0x92df('0x22')+_0x4117de[_0x92df('0x1f')],'from':_0x92df('0x22')+_0x3cb103[_0x92df('0x1f')],'statusCallback':_0x3cb103['remote']+'/api/whatsapp/messages/'+_0x4117de['id']+'/status?token='+_0x3cb103[_0x92df('0x23')]})[_0x92df('0x17')](function(_0x4b87db){if(_0x4b87db[_0x92df('0x24')]){return _0x18cd96[_0x92df('0x18')]({'messageId':_0x4b87db['sid']});}})[_0x92df('0x1a')](function(_0x5b6abf){logger['error'](_0x92df('0x25'),_0x92df('0x26'),_0x92df('0x1e'),util[_0x92df('0x27')](_0x5b6abf,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x92df('0x25'),_0x92df('0x26'),_0x92df('0x1e'),_0x92df('0x28'));}break;case _0x92df('0x29'):var _0x4e62d3=_0x3cb103[_0x92df('0x20')];var _0x4054bd=_0x3cb103[_0x92df('0x2a')];var _0x189b58=_0x3cb103[_0x92df('0x2b')]+_0x92df('0x2c')+_0x4e62d3+_0x92df('0x2d');var _0x1b4526={'to':[_0x4117de[_0x92df('0x1f')]],'message':{'type':_0x92df('0x2e'),'text':_0x4117de['body']}};var _0x2a0971={'method':_0x92df('0x2f'),'uri':_0x189b58,'headers':{'Authorization':'Bearer\x20'+_0x4054bd,'Content-Type':_0x92df('0x30')},'body':_0x1b4526,'json':!![]};rp(_0x2a0971)[_0x92df('0x17')](function(_0x269827){if(_0x269827[_0x92df('0x31')][0x0][_0x92df('0x32')]){return _0x18cd96[_0x92df('0x18')]({'messageId':_0x269827['statuses'][0x0]['message_id']});}})['catch'](function(_0xe156de){logger[_0x92df('0x33')]('WhatsappMessage,\x20%s',_0xe156de);});break;}}})[_0x92df('0x34')](function(){_0x36fa24();});}else{_0x36fa24();}}},'charset':_0x92df('0x35'),'collate':_0x92df('0x36')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 155a8d2..717b9ba 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 _0xaf0b=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','stringify','util','moment'];(function(_0x330911,_0x70724f){var _0x1b3168=function(_0x432e82){while(--_0x432e82){_0x330911['push'](_0x330911['shift']());}};_0x1b3168(++_0x70724f);}(_0xaf0b,0xfe));var _0xbaf0=function(_0x1b3a58,_0x565fb6){_0x1b3a58=_0x1b3a58-0x0;var _0x30da9e=_0xaf0b[_0x1b3a58];return _0x30da9e;};'use strict';var _=require('lodash');var util=require(_0xbaf0('0x0'));var moment=require(_0xbaf0('0x1'));var BPromise=require(_0xbaf0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbaf0('0x3'));var db=require(_0xbaf0('0x4'))['db'];var utils=require(_0xbaf0('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xbaf0('0x6'));var jayson=require(_0xbaf0('0x7'));var client=jayson[_0xbaf0('0x8')][_0xbaf0('0x9')]({'port':0x232a});config[_0xbaf0('0xa')]=_[_0xbaf0('0xb')](config['redis'],{'host':_0xbaf0('0xc'),'port':0x18eb});var socket=require(_0xbaf0('0xd'))(new Redis(config[_0xbaf0('0xa')]));require('./whatsappMessage.socket')[_0xbaf0('0xe')](socket);function respondWithRpcPromise(_0x2c346f,_0x316307,_0x2af1ec){return new BPromise(function(_0x304aa2,_0x13474f){return client[_0xbaf0('0xf')](_0x2c346f,_0x2af1ec)[_0xbaf0('0x10')](function(_0x5c2cd6){logger[_0xbaf0('0x11')](_0xbaf0('0x12'),_0x316307,_0xbaf0('0x13'));logger[_0xbaf0('0x14')](_0xbaf0('0x15'),_0x316307,_0xbaf0('0x13'),JSON['stringify'](_0x5c2cd6));if(_0x5c2cd6[_0xbaf0('0x16')]){if(_0x5c2cd6['error'][_0xbaf0('0x17')]===0x1f4){logger[_0xbaf0('0x16')](_0xbaf0('0x12'),_0x316307,_0x5c2cd6['error']['message']);return _0x13474f(_0x5c2cd6['error'][_0xbaf0('0x18')]);}logger[_0xbaf0('0x16')](_0xbaf0('0x12'),_0x316307,_0x5c2cd6['error'][_0xbaf0('0x18')]);return _0x304aa2(_0x5c2cd6[_0xbaf0('0x16')][_0xbaf0('0x18')]);}else{logger[_0xbaf0('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x316307,'request\x20sent');_0x304aa2(_0x5c2cd6['result'][_0xbaf0('0x18')]);}})[_0xbaf0('0x19')](function(_0x33f78c){logger[_0xbaf0('0x16')](_0xbaf0('0x12'),_0x316307,_0x33f78c);_0x13474f(_0x33f78c);});});}exports[_0xbaf0('0x1a')]=function(_0x1869cb){var _0x4a4aeb=this;return new Promise(function(_0x245ae4,_0x49d7f5){return db[_0xbaf0('0x1b')][_0xbaf0('0x1c')](_0x1869cb['body'],{'raw':_0x1869cb['options']?_0x1869cb[_0xbaf0('0x1d')][_0xbaf0('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x59c8d9){logger[_0xbaf0('0x11')](_0xbaf0('0x1a'),_0x1869cb);logger['debug']('CreateWhatsappMessage',_0x1869cb,JSON[_0xbaf0('0x1f')](_0x59c8d9));_0x245ae4(_0x59c8d9);})['catch'](function(_0x1d9415){logger[_0xbaf0('0x16')](_0xbaf0('0x1a'),_0x1d9415[_0xbaf0('0x18')],_0x1869cb);_0x49d7f5(_0x4a4aeb[_0xbaf0('0x16')](0x1f4,_0x1d9415[_0xbaf0('0x18')]));});});}; \ No newline at end of file +var _0x324e=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','then','info','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x417aa6,_0x401f42){var _0x46e3bc=function(_0x361de5){while(--_0x361de5){_0x417aa6['push'](_0x417aa6['shift']());}};_0x46e3bc(++_0x401f42);}(_0x324e,0xb5));var _0xe324=function(_0x35f6e1,_0x4781ed){_0x35f6e1=_0x35f6e1-0x0;var _0x521b6d=_0x324e[_0x35f6e1];return _0x521b6d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe324('0x0'));var rs=require(_0xe324('0x1'));var fs=require('fs');var Redis=require(_0xe324('0x2'));var db=require(_0xe324('0x3'))['db'];var utils=require(_0xe324('0x4'));var logger=require(_0xe324('0x5'))(_0xe324('0x6'));var config=require(_0xe324('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe324('0x8')][_0xe324('0x9')]({'port':0x232a});config[_0xe324('0xa')]=_[_0xe324('0xb')](config[_0xe324('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe324('0xc'))(new Redis(config[_0xe324('0xa')]));require('./whatsappMessage.socket')[_0xe324('0xd')](socket);function respondWithRpcPromise(_0x454b59,_0x530c1e,_0x117cd9){return new BPromise(function(_0x2070c3,_0x51a126){return client['request'](_0x454b59,_0x117cd9)[_0xe324('0xe')](function(_0x41f91c){logger[_0xe324('0xf')](_0xe324('0x10'),_0x530c1e,'request\x20sent');logger['debug'](_0xe324('0x11'),_0x530c1e,_0xe324('0x12'),JSON[_0xe324('0x13')](_0x41f91c));if(_0x41f91c[_0xe324('0x14')]){if(_0x41f91c[_0xe324('0x14')][_0xe324('0x15')]===0x1f4){logger[_0xe324('0x14')](_0xe324('0x10'),_0x530c1e,_0x41f91c['error']['message']);return _0x51a126(_0x41f91c['error']['message']);}logger[_0xe324('0x14')](_0xe324('0x10'),_0x530c1e,_0x41f91c[_0xe324('0x14')][_0xe324('0x16')]);return _0x2070c3(_0x41f91c[_0xe324('0x14')][_0xe324('0x16')]);}else{logger['info'](_0xe324('0x10'),_0x530c1e,'request\x20sent');_0x2070c3(_0x41f91c[_0xe324('0x17')]['message']);}})[_0xe324('0x18')](function(_0x369793){logger[_0xe324('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x530c1e,_0x369793);_0x51a126(_0x369793);});});}exports[_0xe324('0x19')]=function(_0x54fc2a){var _0x298834=this;return new Promise(function(_0xc8900e,_0x1a4e7a){return db[_0xe324('0x1a')][_0xe324('0x1b')](_0x54fc2a[_0xe324('0x1c')],{'raw':_0x54fc2a['options']?_0x54fc2a[_0xe324('0x1d')][_0xe324('0x1e')]===undefined?!![]:![]:!![]})[_0xe324('0xe')](function(_0x224942){logger[_0xe324('0xf')](_0xe324('0x19'),_0x54fc2a);logger['debug']('CreateWhatsappMessage',_0x54fc2a,JSON['stringify'](_0x224942));_0xc8900e(_0x224942);})[_0xe324('0x18')](function(_0x1605e9){logger[_0xe324('0x14')](_0xe324('0x19'),_0x1605e9[_0xe324('0x16')],_0x54fc2a);_0x1a4e7a(_0x298834[_0xe324('0x14')](0x1f4,_0x1605e9['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index a881024..d4b73e1 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 _0x758b=['register','length','whatsappMessage:','save','update','removeListener'];(function(_0x3eb9f3,_0x253324){var _0x556e40=function(_0x29896e){while(--_0x29896e){_0x3eb9f3['push'](_0x3eb9f3['shift']());}};_0x556e40(++_0x253324);}(_0x758b,0x13b));var _0xb758=function(_0x5b5eb4,_0x117c87){_0x5b5eb4=_0x5b5eb4-0x0;var _0x42af53=_0x758b[_0x5b5eb4];return _0x42af53;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xb758('0x0'),'remove',_0xb758('0x1')];function createListener(_0x3d8f9f,_0x153ae0){return function(_0x4429a2){_0x153ae0['emit'](_0x3d8f9f,_0x4429a2);};}function removeListener(_0x30be35,_0x3d30f3){return function(){WhatsappMessageEvents[_0xb758('0x2')](_0x30be35,_0x3d30f3);};}exports[_0xb758('0x3')]=function(_0x26b677){for(var _0x585650=0x0,_0x4ed34f=events[_0xb758('0x4')];_0x585650<_0x4ed34f;_0x585650++){var _0xf9cf0d=events[_0x585650];var _0x1e7933=createListener(_0xb758('0x5')+_0xf9cf0d,_0x26b677);WhatsappMessageEvents['on'](_0xf9cf0d,_0x1e7933);}}; \ No newline at end of file +var _0x734d=['length','whatsappMessage:','./whatsappMessage.events','update','emit','removeListener','register'];(function(_0x59ef66,_0xfa809b){var _0x217f7c=function(_0x51836f){while(--_0x51836f){_0x59ef66['push'](_0x59ef66['shift']());}};_0x217f7c(++_0xfa809b);}(_0x734d,0xb1));var _0xd734=function(_0x4ce3b6,_0x1512d6){_0x4ce3b6=_0x4ce3b6-0x0;var _0x3f3bbb=_0x734d[_0x4ce3b6];return _0x3f3bbb;};'use strict';var WhatsappMessageEvents=require(_0xd734('0x0'));var events=['save','remove',_0xd734('0x1')];function createListener(_0x5e4538,_0xdc9fd2){return function(_0x3f2b19){_0xdc9fd2[_0xd734('0x2')](_0x5e4538,_0x3f2b19);};}function removeListener(_0x43c233,_0x5bc16a){return function(){WhatsappMessageEvents[_0xd734('0x3')](_0x43c233,_0x5bc16a);};}exports[_0xd734('0x4')]=function(_0x41b08c){for(var _0x19f555=0x0,_0x38e8ea=events[_0xd734('0x5')];_0x19f555<_0x38e8ea;_0x19f555++){var _0x357c38=events[_0x19f555];var _0x15e0bd=createListener(_0xd734('0x6')+_0x357c38,_0x41b08c);WhatsappMessageEvents['on'](_0x357c38,_0x15e0bd);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 1eea540..5e49b21 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 _0xbfb2=['addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post'];(function(_0xe2426f,_0x1d0811){var _0x3fc130=function(_0xe40528){while(--_0xe40528){_0xe2426f['push'](_0xe2426f['shift']());}};_0x3fc130(++_0x1d0811);}(_0xbfb2,0xf8));var _0x2bfb=function(_0x5827b9,_0x553c42){_0x5827b9=_0x5827b9-0x0;var _0x3ae7f7=_0xbfb2[_0x5827b9];return _0x3ae7f7;};'use strict';var multer=require('multer');var util=require(_0x2bfb('0x0'));var path=require('path');var timeout=require(_0x2bfb('0x1'));var express=require(_0x2bfb('0x2'));var router=express[_0x2bfb('0x3')]();var fs_extra=require(_0x2bfb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2bfb('0x5'));var config=require(_0x2bfb('0x6'));var controller=require(_0x2bfb('0x7'));router['get']('/',auth[_0x2bfb('0x8')](),controller[_0x2bfb('0x9')]);router[_0x2bfb('0xa')](_0x2bfb('0xb'),auth[_0x2bfb('0x8')](),controller[_0x2bfb('0xc')]);router[_0x2bfb('0xa')](_0x2bfb('0xd'),auth[_0x2bfb('0x8')](),controller[_0x2bfb('0xe')]);router[_0x2bfb('0xa')](_0x2bfb('0xf'),auth[_0x2bfb('0x8')](),controller[_0x2bfb('0x10')]);router[_0x2bfb('0xa')](_0x2bfb('0x11'),auth['isAuthenticated'](),controller[_0x2bfb('0x12')]);router[_0x2bfb('0xa')](_0x2bfb('0x13'),auth[_0x2bfb('0x8')](),controller[_0x2bfb('0x14')]);router[_0x2bfb('0x15')]('/',auth[_0x2bfb('0x8')](),controller['create']);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x2bfb('0x16')]);router[_0x2bfb('0x15')]('/:id/users',auth[_0x2bfb('0x8')](),controller[_0x2bfb('0x17')]);router[_0x2bfb('0x18')](_0x2bfb('0xd'),auth[_0x2bfb('0x8')](),controller[_0x2bfb('0x19')]);router[_0x2bfb('0x1a')](_0x2bfb('0xd'),auth['isAuthenticated'](),controller[_0x2bfb('0x1b')]);router[_0x2bfb('0x1a')](_0x2bfb('0x11'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x2bfb('0x1a')](_0x2bfb('0x13'),auth[_0x2bfb('0x8')](),controller[_0x2bfb('0x1c')]);module[_0x2bfb('0x1d')]=router; \ No newline at end of file +var _0x5f6f=['/:id/users','getAgents','post','create','addTeams','put','update','delete','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x3f7f93,_0x252411){var _0x5a512f=function(_0x3d8516){while(--_0x3d8516){_0x3f7f93['push'](_0x3f7f93['shift']());}};_0x5a512f(++_0x252411);}(_0x5f6f,0x1da));var _0xf5f6=function(_0x3c1d98,_0x5e8a76){_0x3c1d98=_0x3c1d98-0x0;var _0x462c73=_0x5f6f[_0x3c1d98];return _0x462c73;};'use strict';var multer=require(_0xf5f6('0x0'));var util=require(_0xf5f6('0x1'));var path=require('path');var timeout=require(_0xf5f6('0x2'));var express=require('express');var router=express[_0xf5f6('0x3')]();var fs_extra=require(_0xf5f6('0x4'));var auth=require(_0xf5f6('0x5'));var interaction=require(_0xf5f6('0x6'));var config=require(_0xf5f6('0x7'));var controller=require(_0xf5f6('0x8'));router[_0xf5f6('0x9')]('/',auth[_0xf5f6('0xa')](),controller[_0xf5f6('0xb')]);router[_0xf5f6('0x9')](_0xf5f6('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xf5f6('0x9')](_0xf5f6('0xd'),auth['isAuthenticated'](),controller[_0xf5f6('0xe')]);router[_0xf5f6('0x9')](_0xf5f6('0xf'),auth[_0xf5f6('0xa')](),controller[_0xf5f6('0x10')]);router[_0xf5f6('0x9')](_0xf5f6('0x11'),auth['isAuthenticated'](),controller[_0xf5f6('0x12')]);router['get'](_0xf5f6('0x13'),auth[_0xf5f6('0xa')](),controller[_0xf5f6('0x14')]);router[_0xf5f6('0x15')]('/',auth['isAuthenticated'](),controller[_0xf5f6('0x16')]);router[_0xf5f6('0x15')](_0xf5f6('0x11'),auth[_0xf5f6('0xa')](),controller[_0xf5f6('0x17')]);router[_0xf5f6('0x15')]('/:id/users',auth[_0xf5f6('0xa')](),controller['addAgents']);router[_0xf5f6('0x18')]('/:id',auth[_0xf5f6('0xa')](),controller[_0xf5f6('0x19')]);router['delete']('/:id',auth[_0xf5f6('0xa')](),controller['destroy']);router[_0xf5f6('0x1a')](_0xf5f6('0x11'),auth[_0xf5f6('0xa')](),controller['removeTeams']);router[_0xf5f6('0x1a')](_0xf5f6('0x13'),auth[_0xf5f6('0xa')](),controller[_0xf5f6('0x1b')]);module[_0xf5f6('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 07ae450..fc1e44c 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 _0x6a24=['STRING','sequelize','exports','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x2246f9,_0x2b80bd){var _0x41427b=function(_0x199a41){while(--_0x199a41){_0x2246f9['push'](_0x2246f9['shift']());}};_0x41427b(++_0x2b80bd);}(_0x6a24,0xd1));var _0x46a2=function(_0x1df9ed,_0x382751){_0x1df9ed=_0x1df9ed-0x0;var _0x94799d=_0x6a24[_0x1df9ed];return _0x94799d;};'use strict';var Sequelize=require(_0x46a2('0x0'));module[_0x46a2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x46a2('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x46a2('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x46a2('0x4')](_0x46a2('0x5'),_0x46a2('0x6'),'roundrobin')},'description':{'type':Sequelize[_0x46a2('0x7')]}}; \ No newline at end of file +var _0xaaa2=['name','INTEGER','ENUM','beepall','sequelize','exports','STRING'];(function(_0x2075a6,_0x5a4b04){var _0x4b4348=function(_0x560adc){while(--_0x560adc){_0x2075a6['push'](_0x2075a6['shift']());}};_0x4b4348(++_0x5a4b04);}(_0xaaa2,0xac));var _0x2aaa=function(_0x16dc92,_0x5f05ef){_0x16dc92=_0x16dc92-0x0;var _0x4074a5=_0xaaa2[_0x16dc92];return _0x4074a5;};'use strict';var Sequelize=require(_0x2aaa('0x0'));module[_0x2aaa('0x1')]={'name':{'type':Sequelize[_0x2aaa('0x2')],'unique':_0x2aaa('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x2aaa('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2aaa('0x5')]('rrmemory',_0x2aaa('0x6'),'roundrobin')},'description':{'type':Sequelize[_0x2aaa('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 192031c..6555f68 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 _0xae0e=['length','model','merge','options','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','find','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','UserWhatsappQueue','hasOwnProperty','nolimit','order','where','pick','WhatsappQueueId','filter','User','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','sort','addTeams','ids','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','Agents','select','field','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','includes','all','union','compact','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','bluebird','squel','ioredis','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','key','getOptions','include','query','findAll','rows','catch','show','keys','filters','intersection','attributes','fields'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xae0e,0x1a9));var _0xeae0=function(_0x9f717f,_0x342977){_0x9f717f=_0x9f717f-0x0;var _0x3c0bec=_0xae0e[_0x9f717f];return _0x3c0bec;};'use strict';var BPromise=require(_0xeae0('0x0'));var util=require('util');var _=require('lodash');var squel=require(_0xeae0('0x1'));var Redis=require(_0xeae0('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xeae0('0x3'))(_0xeae0('0x4'));var config=require('../../config/environment');var db=require(_0xeae0('0x5'))['db'];config['redis']=_[_0xeae0('0x6')](config[_0xeae0('0x7')],{'host':_0xeae0('0x8'),'port':0x18eb});var socket=require(_0xeae0('0x9'))(new Redis(config['redis']));require(_0xeae0('0xa'))[_0xeae0('0xb')](socket);function respondWithStatusCode(_0x1cd7e6,_0xd06c9b){_0xd06c9b=_0xd06c9b||0xcc;return function(_0x57f3b4){if(_0x57f3b4){return _0x1cd7e6[_0xeae0('0xc')](_0xd06c9b);}return _0x1cd7e6[_0xeae0('0xd')](_0xd06c9b)['end']();};}function respondWithResult(_0x10603a,_0x363830){_0x363830=_0x363830||0xc8;return function(_0x1ca927){if(_0x1ca927){return _0x10603a[_0xeae0('0xd')](_0x363830)[_0xeae0('0xe')](_0x1ca927);}};}function respondWithFilteredResult(_0x52807f,_0x148134){return function(_0x48016e){if(_0x48016e){var _0x5748cc=typeof _0x148134[_0xeae0('0xf')]===_0xeae0('0x10')&&typeof _0x148134[_0xeae0('0x11')]==='undefined';var _0x2eea10=_0x48016e[_0xeae0('0x12')];var _0x1f6f42=_0x5748cc?0x0:_0x148134[_0xeae0('0xf')];var _0x469f15=_0x5748cc?_0x48016e[_0xeae0('0x12')]:_0x148134[_0xeae0('0xf')]+_0x148134[_0xeae0('0x11')];var _0x347250;if(_0x469f15>=_0x2eea10){_0x469f15=_0x2eea10;_0x347250=0xc8;}else{_0x347250=0xce;}_0x52807f['status'](_0x347250);return _0x52807f['set']('Content-Range',_0x1f6f42+'-'+_0x469f15+'/'+_0x2eea10)[_0xeae0('0xe')](_0x48016e);}return null;};}function saveUpdates(_0x2a732b){return function(_0x1d66b7){if(_0x1d66b7){return _0x1d66b7[_0xeae0('0x13')](_0x2a732b)[_0xeae0('0x14')](function(_0x16a4da){return _0x16a4da;});}return null;};}function removeEntity(_0x2e4826){return function(_0x26277e){if(_0x26277e){return _0x26277e[_0xeae0('0x15')]()[_0xeae0('0x14')](function(){var _0x8faf9e=_0x26277e[_0xeae0('0x16')]({'plain':!![]});var _0x3fe3bf='WhatsappQueues';return db[_0xeae0('0x17')][_0xeae0('0x15')]({'where':{'type':_0x3fe3bf,'resourceId':_0x8faf9e['id']}})[_0xeae0('0x14')](function(){return _0x26277e;});})['then'](function(){_0x2e4826[_0xeae0('0xd')](0xcc)[_0xeae0('0x18')]();});}};}function handleEntityNotFound(_0x3bdccf){return function(_0x26f656){if(!_0x26f656){_0x3bdccf[_0xeae0('0xc')](0x194);}return _0x26f656;};}function handleError(_0x136c39,_0x4b26ec){_0x4b26ec=_0x4b26ec||0x1f4;return function(_0x5d82eb){logger[_0xeae0('0x19')](_0x5d82eb[_0xeae0('0x1a')]);if(_0x5d82eb[_0xeae0('0x1b')]){delete _0x5d82eb['name'];}_0x136c39[_0xeae0('0xd')](_0x4b26ec)[_0xeae0('0x1c')](_0x5d82eb);};}exports['index']=function(_0xe9ecc4,_0x35e6b4){var _0x281857={};var _0x5dd34a={'count':0x0,'rows':[]};var _0x45c74d=_[_0xeae0('0x1d')](db[_0xeae0('0x1e')][_0xeae0('0x1f')],function(_0x598b94){return{'name':_0x598b94[_0xeae0('0x20')],'type':_0x598b94[_0xeae0('0x21')][_0xeae0('0x22')]};});_0x281857=qs[_0xeae0('0x23')](_0x45c74d,_0xe9ecc4);var _0x5c1838={'where':_0x281857['where']};return db[_0xeae0('0x1e')][_0xeae0('0x12')](_0x5c1838)[_0xeae0('0x14')](function(_0x4913ff){_0x5dd34a[_0xeae0('0x12')]=_0x4913ff;_0x281857[_0xeae0('0x24')]=qs['include'](_0xe9ecc4[_0xeae0('0x25')]);return db['WhatsappQueue'][_0xeae0('0x26')](_0x281857);})[_0xeae0('0x14')](function(_0x5545a9){_0x5dd34a[_0xeae0('0x27')]=_0x5545a9;return _0x5dd34a;})[_0xeae0('0x14')](respondWithFilteredResult(_0x35e6b4,_0x281857))[_0xeae0('0x28')](handleError(_0x35e6b4,null));};exports[_0xeae0('0x29')]=function(_0x3fdea3,_0x1942fd){var _0x2088bd={'raw':!![],'where':{'id':_0x3fdea3['params']['id']}},_0x40f107={};_0x40f107['model']=_[_0xeae0('0x2a')](db[_0xeae0('0x1e')]['rawAttributes']);_0x40f107[_0xeae0('0x25')]=_[_0xeae0('0x2a')](_0x3fdea3['query']);_0x40f107[_0xeae0('0x2b')]=_[_0xeae0('0x2c')](_0x40f107['model'],_0x40f107[_0xeae0('0x25')]);_0x2088bd[_0xeae0('0x2d')]=_['intersection'](_0x40f107['model'],qs[_0xeae0('0x2e')](_0x3fdea3[_0xeae0('0x25')][_0xeae0('0x2e')]));_0x2088bd[_0xeae0('0x2d')]=_0x2088bd[_0xeae0('0x2d')][_0xeae0('0x2f')]?_0x2088bd[_0xeae0('0x2d')]:_0x40f107[_0xeae0('0x30')];if(_0x3fdea3[_0xeae0('0x25')]['includeAll']){_0x2088bd[_0xeae0('0x24')]=[{'all':!![]}];}_0x2088bd=_[_0xeae0('0x31')]({},_0x2088bd,_0x3fdea3[_0xeae0('0x32')]);return db['WhatsappQueue']['find'](_0x2088bd)['then'](handleEntityNotFound(_0x1942fd,null))[_0xeae0('0x14')](respondWithResult(_0x1942fd,null))['catch'](handleError(_0x1942fd,null));};exports['create']=function(_0x213b2b,_0x20604b){return db[_0xeae0('0x1e')]['create'](_0x213b2b['body'],{})[_0xeae0('0x14')](function(_0x25eb31){var _0x46970f=_0x213b2b[_0xeae0('0x33')][_0xeae0('0x16')]({'plain':!![]});if(!_0x46970f)throw new Error(_0xeae0('0x34'));if(_0x46970f[_0xeae0('0x35')]===_0xeae0('0x33')){var _0x265cb9=_0x25eb31[_0xeae0('0x16')]({'plain':!![]});var _0x58810c=_0xeae0('0x36');return db[_0xeae0('0x37')][_0xeae0('0x38')]({'where':{'name':_0x58810c,'userProfileId':_0x46970f['userProfileId']},'raw':!![]})[_0xeae0('0x14')](function(_0x5b60ea){if(_0x5b60ea&&_0x5b60ea['autoAssociation']===0x0){return db[_0xeae0('0x17')][_0xeae0('0x39')]({'name':_0x265cb9['name'],'resourceId':_0x265cb9['id'],'type':_0x5b60ea[_0xeae0('0x1b')],'sectionId':_0x5b60ea['id']},{})[_0xeae0('0x14')](function(){return _0x25eb31;});}else{return _0x25eb31;}})[_0xeae0('0x28')](function(_0x24ffa3){logger[_0xeae0('0x19')](_0xeae0('0x3a'),_0x24ffa3);throw _0x24ffa3;});}return _0x25eb31;})[_0xeae0('0x14')](respondWithResult(_0x20604b,0xc9))[_0xeae0('0x28')](handleError(_0x20604b,null));};exports[_0xeae0('0x13')]=function(_0x5c235d,_0x2e76ac){if(_0x5c235d[_0xeae0('0x3b')]['id']){delete _0x5c235d[_0xeae0('0x3b')]['id'];}return db[_0xeae0('0x1e')]['find']({'where':{'id':_0x5c235d[_0xeae0('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2e76ac,null))[_0xeae0('0x14')](saveUpdates(_0x5c235d[_0xeae0('0x3b')],null))[_0xeae0('0x14')](respondWithResult(_0x2e76ac,null))[_0xeae0('0x28')](handleError(_0x2e76ac,null));};exports[_0xeae0('0x15')]=function(_0x5ef8e7,_0x4f5429){return db[_0xeae0('0x1e')]['find']({'where':{'id':_0x5ef8e7[_0xeae0('0x3c')]['id']}})[_0xeae0('0x14')](handleEntityNotFound(_0x4f5429,null))['then'](removeEntity(_0x4f5429,null))[_0xeae0('0x28')](handleError(_0x4f5429,null));};exports[_0xeae0('0x3d')]=function(_0xdc7d00,_0x5b97e8){return db[_0xeae0('0x1e')][_0xeae0('0x3d')]()['then'](respondWithResult(_0x5b97e8,null))[_0xeae0('0x28')](handleError(_0x5b97e8,null));};exports['getMembers']=function(_0x3ca52b,_0x4efe0d){var _0x4c952f={'raw':!![],'where':{}},_0x5a82b0={},_0x32c904;return db[_0xeae0('0x1e')]['findOne']({'where':{'id':_0x3ca52b[_0xeae0('0x3c')]['id']}})[_0xeae0('0x14')](handleEntityNotFound(_0x4efe0d,null))[_0xeae0('0x14')](function(_0xbc37b9){if(_0xbc37b9){_0x32c904=_0xbc37b9[_0xeae0('0x16')]({'plain':!![]});_0x5a82b0['model']=_[_0xeae0('0x2a')](db[_0xeae0('0x3e')]['rawAttributes']);_0x5a82b0[_0xeae0('0x25')]=_[_0xeae0('0x2a')](_0x3ca52b[_0xeae0('0x25')]);_0x5a82b0['filters']=_[_0xeae0('0x2c')](_0x5a82b0[_0xeae0('0x30')],_0x5a82b0['query']);_0x4c952f['attributes']=_['intersection'](_0x5a82b0[_0xeae0('0x30')],qs['fields'](_0x3ca52b[_0xeae0('0x25')]['fields']));_0x4c952f[_0xeae0('0x2d')]=_0x4c952f[_0xeae0('0x2d')][_0xeae0('0x2f')]?_0x4c952f[_0xeae0('0x2d')]:_0x5a82b0['model'];if(!_0x3ca52b[_0xeae0('0x25')][_0xeae0('0x3f')](_0xeae0('0x40'))){_0x4c952f[_0xeae0('0x11')]=qs[_0xeae0('0x11')](_0x3ca52b[_0xeae0('0x25')][_0xeae0('0x11')]);_0x4c952f['offset']=qs[_0xeae0('0xf')](_0x3ca52b[_0xeae0('0x25')][_0xeae0('0xf')]);}_0x4c952f[_0xeae0('0x41')]=qs['sort'](_0x3ca52b[_0xeae0('0x25')]['sort']);_0x4c952f[_0xeae0('0x42')]=qs['filters'](_[_0xeae0('0x43')](_0x3ca52b[_0xeae0('0x25')],_0x5a82b0[_0xeae0('0x2b')]));_0x4c952f[_0xeae0('0x42')][_0xeae0('0x44')]=_0xbc37b9['id'];if(_0x3ca52b[_0xeae0('0x25')][_0xeae0('0x45')]){_0x4c952f['where']=_[_0xeae0('0x31')](_0x4c952f['where'],{'$or':_[_0xeae0('0x1d')](_0x4c952f[_0xeae0('0x2d')],function(_0x297b12){var _0x26fba9={};_0x26fba9[_0x297b12]={'$like':'%'+_0x3ca52b[_0xeae0('0x25')]['filter']+'%'};return _0x26fba9;})});}_0x4c952f=_[_0xeae0('0x31')]({},_0x4c952f,_0x3ca52b[_0xeae0('0x32')]);return db['UserWhatsappQueue']['findAll'](_0x4c952f);}})['then'](function(_0x57b473){if(_0x57b473){return db[_0xeae0('0x46')]['findAndCountAll']({'where':{'id':_[_0xeae0('0x1d')](_0x57b473,'UserId'),'role':_0xeae0('0x47')},'attributes':['id',_0xeae0('0x1b'),_0xeae0('0x48'),_0xeae0('0x49'),_0xeae0('0x4a')]});}})[_0xeae0('0x14')](function(_0x156aa7){if(_0x156aa7){return{'count':_0x156aa7['count'],'rows':_[_0xeae0('0x1d')](_0x156aa7[_0xeae0('0x27')],function(_0x3a2367){return{'membername':_0x3a2367['name'],'UserId':_0x3a2367['id'],'queue_name':_0x32c904[_0xeae0('0x1b')],'WhatsappQueueId':_0x32c904['id'],'interface':util[_0xeae0('0x4b')](_0xeae0('0x4c'),'SIP',_0x3a2367[_0xeae0('0x1b')]),'penalty':0x0,'paused':_0x3a2367[_0xeae0('0x48')],'createdAt':_0x3a2367['createdAt'],'updatedAt':_0x3a2367[_0xeae0('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xeae0('0x14')](respondWithFilteredResult(_0x4efe0d,_0x4c952f))[_0xeae0('0x28')](handleError(_0x4efe0d,null));};exports[_0xeae0('0x4d')]=function(_0x2347f4,_0x4a5748){var _0xfad3b4={};var _0x438870={};var _0x396311;var _0x305f16;return db[_0xeae0('0x1e')][_0xeae0('0x4e')]({'where':{'id':_0x2347f4[_0xeae0('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4a5748,null))[_0xeae0('0x14')](function(_0x24bf3b){if(_0x24bf3b){_0x396311=_0x24bf3b;_0x438870[_0xeae0('0x30')]=_['keys'](db[_0xeae0('0x4f')]['rawAttributes']);_0x438870['query']=_[_0xeae0('0x2a')](_0x2347f4[_0xeae0('0x25')]);_0x438870[_0xeae0('0x2b')]=_[_0xeae0('0x2c')](_0x438870[_0xeae0('0x30')],_0x438870['query']);_0xfad3b4['attributes']=_[_0xeae0('0x2c')](_0x438870[_0xeae0('0x30')],qs[_0xeae0('0x2e')](_0x2347f4[_0xeae0('0x25')][_0xeae0('0x2e')]));_0xfad3b4[_0xeae0('0x2d')]=_0xfad3b4['attributes'][_0xeae0('0x2f')]?_0xfad3b4[_0xeae0('0x2d')]:_0x438870['model'];_0xfad3b4['order']=qs[_0xeae0('0x50')](_0x2347f4[_0xeae0('0x25')][_0xeae0('0x50')]);_0xfad3b4[_0xeae0('0x42')]=qs['filters'](_[_0xeae0('0x43')](_0x2347f4[_0xeae0('0x25')],_0x438870[_0xeae0('0x2b')]));if(_0x2347f4[_0xeae0('0x25')][_0xeae0('0x45')]){_0xfad3b4[_0xeae0('0x42')]=_[_0xeae0('0x31')](_0xfad3b4['where'],{'$or':_[_0xeae0('0x1d')](_0xfad3b4['attributes'],function(_0x16bcef){var _0x3518f8={};_0x3518f8[_0x16bcef]={'$like':'%'+_0x2347f4[_0xeae0('0x25')][_0xeae0('0x45')]+'%'};return _0x3518f8;})});}_0xfad3b4=_[_0xeae0('0x31')]({},_0xfad3b4,_0x2347f4[_0xeae0('0x32')]);return _0x396311[_0xeae0('0x4d')](_0xfad3b4);}})['then'](function(_0x88f8a3){if(_0x88f8a3){_0x305f16=_0x88f8a3[_0xeae0('0x2f')];if(!_0x2347f4[_0xeae0('0x25')][_0xeae0('0x3f')](_0xeae0('0x40'))){_0xfad3b4['limit']=qs['limit'](_0x2347f4['query'][_0xeae0('0x11')]);_0xfad3b4['offset']=qs[_0xeae0('0xf')](_0x2347f4[_0xeae0('0x25')][_0xeae0('0xf')]);}return _0x396311[_0xeae0('0x4d')](_0xfad3b4);}})[_0xeae0('0x14')](function(_0x5a96f6){if(_0x5a96f6){return _0x5a96f6?{'count':_0x305f16,'rows':_0x5a96f6}:null;}})[_0xeae0('0x14')](respondWithResult(_0x4a5748,null))[_0xeae0('0x28')](handleError(_0x4a5748,null));};exports[_0xeae0('0x51')]=function(_0x4af155,_0x3fe2e4){var _0x15ad72=_0x4af155[_0xeae0('0x3b')][_0xeae0('0x52')];return db[_0xeae0('0x4f')][_0xeae0('0x26')]({'where':{'id':_0x15ad72},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xeae0('0x1b'),'online',_0xeae0('0x53'),_0xeae0('0x54')],'raw':!![]}]})[_0xeae0('0x14')](function(_0x51878d){if(_0x51878d){var _0x23b4b2=_[_0xeae0('0x55')](_0x51878d,function(_0x9b1ba5){var _0x54fe07=_0x9b1ba5['get']({'plain':!![]});return _0x54fe07['Agents'];});return db[_0xeae0('0x1e')][_0xeae0('0x38')]({'where':{'id':_0x4af155[_0xeae0('0x3c')]['id']}})[_0xeae0('0x14')](function(_0x1cea34){return db['sequelize']['transaction'](function(_0x4a59ee){return _0x1cea34['addTeams'](_0x15ad72,{'transaction':_0x4a59ee})[_0xeae0('0x14')](function(){return BPromise[_0xeae0('0x56')](_0x23b4b2,function(_0x3da689){return db[_0xeae0('0x3e')][_0xeae0('0x57')]({'where':{'UserId':_0x3da689['id'],'WhatsappQueueId':_0x4af155[_0xeae0('0x3c')]['id']},'transaction':_0x4a59ee});});})[_0xeae0('0x14')](function(){_0x23b4b2[_0xeae0('0x58')](function(_0x3c6ba9){socket[_0xeae0('0x59')](_0xeae0('0x5a'),{'UserId':_0x3c6ba9['id'],'WhatsappQueueId':_0x1cea34['id']});});});});});}})[_0xeae0('0x14')](respondWithStatusCode(_0x3fe2e4,null))[_0xeae0('0x28')](handleError(_0x3fe2e4,null));};exports[_0xeae0('0x5b')]=function(_0x5a7ed4,_0x2fd838){return db[_0xeae0('0x4f')][_0xeae0('0x26')]({'where':{'id':_0x5a7ed4['query'][_0xeae0('0x52')]},'attributes':['id'],'include':[{'model':db[_0xeae0('0x46')],'as':_0xeae0('0x5c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2fd838,null))[_0xeae0('0x14')](function(_0x453474){var _0x202718=_[_0xeae0('0x1d')](_0x453474,'id');var _0x2811cd=[];var _0x1d981c=[];var _0x22064a=squel[_0xeae0('0x5d')]();_0x22064a[_0xeae0('0x5e')]('tq.TeamId')[_0xeae0('0x5f')](_0xeae0('0x60'),'tq')[_0xeae0('0x61')]('user_has_teams','ut',_0xeae0('0x62'))[_0xeae0('0x42')]('WhatsappQueueId\x20=\x20?',_0x5a7ed4[_0xeae0('0x3c')]['id']);for(var _0x581a54=0x0;_0x581a54<_0x453474[_0xeae0('0x2f')];_0x581a54+=0x1){let _0x2e2e1c=_0x453474[_0x581a54];for(var _0x4b6d2f=0x0;_0x4b6d2f<_0x2e2e1c['Agents'][_0xeae0('0x2f')];_0x4b6d2f+=0x1){let _0x1a43f9=_0x2e2e1c['Agents'][_0x4b6d2f];var _0xbec292=_0x22064a[_0xeae0('0x63')]();_0xbec292[_0xeae0('0x42')](_0xeae0('0x64'),_0x1a43f9['id']);_0x1d981c[_0xeae0('0x65')](db['sequelize'][_0xeae0('0x25')](_0xbec292[_0xeae0('0x66')](),{'type':db[_0xeae0('0x67')][_0xeae0('0x68')]['SELECT']})[_0xeae0('0x14')](function(_0x590bc1){if(_0x590bc1[_0xeae0('0x2f')]===0x1){return _0x1a43f9['id'];}else{var _0x389079=_['every'](_[_0xeae0('0x1d')](_0x590bc1,'TeamId'),function(_0x32e5c2){return _[_0xeae0('0x69')](_0x202718,_0x32e5c2);});if(_0x389079){return _0x1a43f9['id'];}}}));}}return BPromise[_0xeae0('0x6a')](_0x1d981c)[_0xeae0('0x14')](function(_0x582cb0){_0x2811cd=_(_0x2811cd)[_0xeae0('0x6b')](_0x582cb0)[_0xeae0('0x6c')]()['value']();return db[_0xeae0('0x1e')][_0xeae0('0x38')]({'where':{'id':_0x5a7ed4['params']['id']}})[_0xeae0('0x14')](function(_0x1b6306){return db[_0xeae0('0x67')][_0xeae0('0x6d')](function(_0x10ee71){return _0x1b6306[_0xeae0('0x5b')](_0x5a7ed4[_0xeae0('0x25')]['ids'],{'transaction':_0x10ee71})[_0xeae0('0x14')](function(){if(!_[_0xeae0('0x6e')](_0x2811cd)){return _0x1b6306[_0xeae0('0x6f')](_0x2811cd,{'transaction':_0x10ee71});}})[_0xeae0('0x14')](function(){_0x2811cd['forEach'](function(_0x4579a7){socket[_0xeae0('0x59')]('userWhatsappQueue:remove',{'UserId':_0x4579a7,'WhatsappQueueId':_0x1b6306['id']});});});});});});})[_0xeae0('0x14')](respondWithStatusCode(_0x2fd838,null))['catch'](handleError(_0x2fd838,null));};exports[_0xeae0('0x70')]=function(_0x5ec51c,_0x20085e){return db[_0xeae0('0x1e')]['find']({'where':{'id':_0x5ec51c['params']['id']}})[_0xeae0('0x14')](handleEntityNotFound(_0x20085e,null))[_0xeae0('0x14')](function(_0x9b8cd2){if(_0x9b8cd2){return _0x9b8cd2[_0xeae0('0x70')](_0x5ec51c[_0xeae0('0x3b')][_0xeae0('0x52')],_[_0xeae0('0x71')](_0x5ec51c['body'],['ids','id'])||{})[_0xeae0('0x72')](function(_0xb9dc14){for(var _0x46277c=0x0;_0x46277c<_0x5ec51c[_0xeae0('0x3b')][_0xeae0('0x52')][_0xeae0('0x2f')];_0x46277c+=0x1){socket[_0xeae0('0x59')]('userWhatsappQueue:save',{'UserId':Number(_0x5ec51c[_0xeae0('0x3b')][_0xeae0('0x52')][_0x46277c]),'WhatsappQueueId':Number(_0x5ec51c['params']['id'])});}return _0xb9dc14;});}})[_0xeae0('0x14')](respondWithResult(_0x20085e,null))[_0xeae0('0x28')](handleError(_0x20085e,null));};exports[_0xeae0('0x6f')]=function(_0x3cd371,_0x3aa26f){return db[_0xeae0('0x1e')][_0xeae0('0x38')]({'where':{'id':_0x3cd371[_0xeae0('0x3c')]['id']}})[_0xeae0('0x14')](handleEntityNotFound(_0x3aa26f,null))[_0xeae0('0x14')](function(_0x17ef7e){if(_0x17ef7e){return _0x17ef7e[_0xeae0('0x6f')](_0x3cd371[_0xeae0('0x25')]['ids'])[_0xeae0('0x14')](function(){if(_[_0xeae0('0x73')](_0x3cd371[_0xeae0('0x25')][_0xeae0('0x52')])){for(var _0x3ad01a=0x0;_0x3ad01a<_0x3cd371[_0xeae0('0x25')]['ids']['length'];_0x3ad01a+=0x1){socket[_0xeae0('0x59')](_0xeae0('0x74'),{'UserId':Number(_0x3cd371[_0xeae0('0x25')][_0xeae0('0x52')][_0x3ad01a]),'WhatsappQueueId':Number(_0x3cd371[_0xeae0('0x3c')]['id'])});}}else{socket[_0xeae0('0x59')](_0xeae0('0x74'),{'UserId':Number(_0x3cd371[_0xeae0('0x25')][_0xeae0('0x52')]),'WhatsappQueueId':Number(_0x3cd371[_0xeae0('0x3c')]['id'])});}});}})['then'](respondWithStatusCode(_0x3aa26f,null))[_0xeae0('0x28')](handleError(_0x3aa26f,null));};exports[_0xeae0('0x75')]=function(_0x4fcf5f,_0x12765b){var _0xce19c1={};var _0xee8f8f={};var _0x3abdfc;var _0x40320b;return db[_0xeae0('0x1e')][_0xeae0('0x4e')]({'where':{'id':_0x4fcf5f['params']['id']}})[_0xeae0('0x14')](handleEntityNotFound(_0x12765b,null))['then'](function(_0x504bbc){if(_0x504bbc){_0x3abdfc=_0x504bbc;_0xee8f8f[_0xeae0('0x30')]=_['keys'](db[_0xeae0('0x46')][_0xeae0('0x1f')]);_0xee8f8f[_0xeae0('0x25')]=_[_0xeae0('0x2a')](_0x4fcf5f[_0xeae0('0x25')]);_0xee8f8f[_0xeae0('0x2b')]=_[_0xeae0('0x2c')](_0xee8f8f[_0xeae0('0x30')],_0xee8f8f['query']);_0xce19c1[_0xeae0('0x2d')]=_[_0xeae0('0x2c')](_0xee8f8f[_0xeae0('0x30')],qs[_0xeae0('0x2e')](_0x4fcf5f[_0xeae0('0x25')]['fields']));_0xce19c1[_0xeae0('0x2d')]=_0xce19c1['attributes']['length']?_0xce19c1[_0xeae0('0x2d')]:_0xee8f8f['model'];_0xce19c1[_0xeae0('0x41')]=qs[_0xeae0('0x50')](_0x4fcf5f[_0xeae0('0x25')][_0xeae0('0x50')]);_0xce19c1['where']=qs[_0xeae0('0x2b')](_['pick'](_0x4fcf5f[_0xeae0('0x25')],_0xee8f8f[_0xeae0('0x2b')]));if(_0x4fcf5f['query'][_0xeae0('0x45')]){_0xce19c1['where']=_[_0xeae0('0x31')](_0xce19c1[_0xeae0('0x42')],{'$or':_[_0xeae0('0x1d')](_0xce19c1[_0xeae0('0x2d')],function(_0x68cc45){var _0x38c158={};_0x38c158[_0x68cc45]={'$like':'%'+_0x4fcf5f['query'][_0xeae0('0x45')]+'%'};return _0x38c158;})});}_0xce19c1=_[_0xeae0('0x31')]({},_0xce19c1,_0x4fcf5f['options']);return _0x3abdfc[_0xeae0('0x75')](_0xce19c1);}})[_0xeae0('0x14')](function(_0x4b5b14){if(_0x4b5b14){_0x40320b=_0x4b5b14['length'];if(!_0x4fcf5f[_0xeae0('0x25')][_0xeae0('0x3f')](_0xeae0('0x40'))){_0xce19c1[_0xeae0('0x11')]=qs[_0xeae0('0x11')](_0x4fcf5f['query'][_0xeae0('0x11')]);_0xce19c1[_0xeae0('0xf')]=qs['offset'](_0x4fcf5f['query'][_0xeae0('0xf')]);}return _0x3abdfc[_0xeae0('0x75')](_0xce19c1);}})[_0xeae0('0x14')](function(_0x159430){if(_0x159430){return _0x159430?{'count':_0x40320b,'rows':_0x159430}:null;}})['then'](respondWithResult(_0x12765b,null))[_0xeae0('0x28')](handleError(_0x12765b,null));}; \ No newline at end of file +var _0xd919=['addTeams','ids','Team','Agents','online','voicePause','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','compact','value','transaction','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','localhost','./whatsappQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','then','UserProfileResource','error','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','params','keys','filters','intersection','model','attributes','fields','length','merge','options','find','create','body','user','get','role','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','nolimit','order','sort','pick','WhatsappQueueId','filter','User','findAndCountAll','format','SIP','whatsappPause','updatedAt','getTeams'];(function(_0x5a1552,_0x5478df){var _0x88e370=function(_0x5726b8){while(--_0x5726b8){_0x5a1552['push'](_0x5a1552['shift']());}};_0x88e370(++_0x5478df);}(_0xd919,0x181));var _0x9d91=function(_0x3abdf7,_0x5ecbbf){_0x3abdf7=_0x3abdf7-0x0;var _0x49025c=_0xd919[_0x3abdf7];return _0x49025c;};'use strict';var BPromise=require(_0x9d91('0x0'));var util=require('util');var _=require(_0x9d91('0x1'));var squel=require('squel');var Redis=require(_0x9d91('0x2'));var qs=require(_0x9d91('0x3'));var logger=require(_0x9d91('0x4'))('api');var config=require(_0x9d91('0x5'));var db=require('../../mysqldb')['db'];config[_0x9d91('0x6')]=_['defaults'](config['redis'],{'host':_0x9d91('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9d91('0x6')]));require(_0x9d91('0x8'))[_0x9d91('0x9')](socket);function respondWithStatusCode(_0x4375b9,_0x39fa39){_0x39fa39=_0x39fa39||0xcc;return function(_0x11447f){if(_0x11447f){return _0x4375b9[_0x9d91('0xa')](_0x39fa39);}return _0x4375b9['status'](_0x39fa39)[_0x9d91('0xb')]();};}function respondWithResult(_0x167b62,_0x28174d){_0x28174d=_0x28174d||0xc8;return function(_0x344a7d){if(_0x344a7d){return _0x167b62[_0x9d91('0xc')](_0x28174d)[_0x9d91('0xd')](_0x344a7d);}};}function respondWithFilteredResult(_0x41e994,_0xa87610){return function(_0x1faab1){if(_0x1faab1){var _0x2586dc=typeof _0xa87610[_0x9d91('0xe')]==='undefined'&&typeof _0xa87610['limit']===_0x9d91('0xf');var _0x53804f=_0x1faab1[_0x9d91('0x10')];var _0x513ff2=_0x2586dc?0x0:_0xa87610['offset'];var _0x21d0f5=_0x2586dc?_0x1faab1['count']:_0xa87610[_0x9d91('0xe')]+_0xa87610[_0x9d91('0x11')];var _0x342e5a;if(_0x21d0f5>=_0x53804f){_0x21d0f5=_0x53804f;_0x342e5a=0xc8;}else{_0x342e5a=0xce;}_0x41e994['status'](_0x342e5a);return _0x41e994[_0x9d91('0x12')](_0x9d91('0x13'),_0x513ff2+'-'+_0x21d0f5+'/'+_0x53804f)['json'](_0x1faab1);}return null;};}function saveUpdates(_0x280412){return function(_0xd8f9f7){if(_0xd8f9f7){return _0xd8f9f7[_0x9d91('0x14')](_0x280412)['then'](function(_0x1948d5){return _0x1948d5;});}return null;};}function removeEntity(_0x84994a){return function(_0x5665f7){if(_0x5665f7){return _0x5665f7[_0x9d91('0x15')]()[_0x9d91('0x16')](function(){var _0x22cba4=_0x5665f7['get']({'plain':!![]});var _0x53b783='WhatsappQueues';return db[_0x9d91('0x17')][_0x9d91('0x15')]({'where':{'type':_0x53b783,'resourceId':_0x22cba4['id']}})[_0x9d91('0x16')](function(){return _0x5665f7;});})['then'](function(){_0x84994a[_0x9d91('0xc')](0xcc)[_0x9d91('0xb')]();});}};}function handleEntityNotFound(_0x537a46){return function(_0x3ae89a){if(!_0x3ae89a){_0x537a46[_0x9d91('0xa')](0x194);}return _0x3ae89a;};}function handleError(_0xe7767,_0x379158){_0x379158=_0x379158||0x1f4;return function(_0x375208){logger[_0x9d91('0x18')](_0x375208[_0x9d91('0x19')]);if(_0x375208[_0x9d91('0x1a')]){delete _0x375208[_0x9d91('0x1a')];}_0xe7767[_0x9d91('0xc')](_0x379158)[_0x9d91('0x1b')](_0x375208);};}exports['index']=function(_0x2869fb,_0x212f46){var _0x27d718={};var _0xe6b6f0={'count':0x0,'rows':[]};var _0x2309e4=_[_0x9d91('0x1c')](db[_0x9d91('0x1d')][_0x9d91('0x1e')],function(_0xe7c56b){return{'name':_0xe7c56b[_0x9d91('0x1f')],'type':_0xe7c56b[_0x9d91('0x20')][_0x9d91('0x21')]};});_0x27d718=qs[_0x9d91('0x22')](_0x2309e4,_0x2869fb);var _0x38c362={'where':_0x27d718[_0x9d91('0x23')]};return db[_0x9d91('0x1d')]['count'](_0x38c362)[_0x9d91('0x16')](function(_0x2c2abf){_0xe6b6f0[_0x9d91('0x10')]=_0x2c2abf;_0x27d718[_0x9d91('0x24')]=qs[_0x9d91('0x24')](_0x2869fb[_0x9d91('0x25')]);return db[_0x9d91('0x1d')][_0x9d91('0x26')](_0x27d718);})['then'](function(_0x10a332){_0xe6b6f0[_0x9d91('0x27')]=_0x10a332;return _0xe6b6f0;})[_0x9d91('0x16')](respondWithFilteredResult(_0x212f46,_0x27d718))[_0x9d91('0x28')](handleError(_0x212f46,null));};exports['show']=function(_0x506271,_0x58e171){var _0x5268f9={'raw':!![],'where':{'id':_0x506271[_0x9d91('0x29')]['id']}},_0x4bc4ea={};_0x4bc4ea['model']=_[_0x9d91('0x2a')](db[_0x9d91('0x1d')]['rawAttributes']);_0x4bc4ea[_0x9d91('0x25')]=_[_0x9d91('0x2a')](_0x506271['query']);_0x4bc4ea[_0x9d91('0x2b')]=_[_0x9d91('0x2c')](_0x4bc4ea[_0x9d91('0x2d')],_0x4bc4ea[_0x9d91('0x25')]);_0x5268f9[_0x9d91('0x2e')]=_['intersection'](_0x4bc4ea[_0x9d91('0x2d')],qs[_0x9d91('0x2f')](_0x506271[_0x9d91('0x25')][_0x9d91('0x2f')]));_0x5268f9[_0x9d91('0x2e')]=_0x5268f9[_0x9d91('0x2e')][_0x9d91('0x30')]?_0x5268f9[_0x9d91('0x2e')]:_0x4bc4ea[_0x9d91('0x2d')];if(_0x506271[_0x9d91('0x25')]['includeAll']){_0x5268f9[_0x9d91('0x24')]=[{'all':!![]}];}_0x5268f9=_[_0x9d91('0x31')]({},_0x5268f9,_0x506271[_0x9d91('0x32')]);return db['WhatsappQueue'][_0x9d91('0x33')](_0x5268f9)['then'](handleEntityNotFound(_0x58e171,null))[_0x9d91('0x16')](respondWithResult(_0x58e171,null))[_0x9d91('0x28')](handleError(_0x58e171,null));};exports[_0x9d91('0x34')]=function(_0x1d6d5e,_0x1fba3c){return db['WhatsappQueue'][_0x9d91('0x34')](_0x1d6d5e[_0x9d91('0x35')],{})[_0x9d91('0x16')](function(_0x4fd42f){var _0x2d5b20=_0x1d6d5e[_0x9d91('0x36')][_0x9d91('0x37')]({'plain':!![]});if(!_0x2d5b20)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d5b20[_0x9d91('0x38')]===_0x9d91('0x36')){var _0x1baf30=_0x4fd42f[_0x9d91('0x37')]({'plain':!![]});var _0x47c313=_0x9d91('0x39');return db[_0x9d91('0x3a')][_0x9d91('0x33')]({'where':{'name':_0x47c313,'userProfileId':_0x2d5b20[_0x9d91('0x3b')]},'raw':!![]})[_0x9d91('0x16')](function(_0x384365){if(_0x384365&&_0x384365[_0x9d91('0x3c')]===0x0){return db[_0x9d91('0x17')][_0x9d91('0x34')]({'name':_0x1baf30[_0x9d91('0x1a')],'resourceId':_0x1baf30['id'],'type':_0x384365['name'],'sectionId':_0x384365['id']},{})[_0x9d91('0x16')](function(){return _0x4fd42f;});}else{return _0x4fd42f;}})['catch'](function(_0x14638d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14638d);throw _0x14638d;});}return _0x4fd42f;})[_0x9d91('0x16')](respondWithResult(_0x1fba3c,0xc9))[_0x9d91('0x28')](handleError(_0x1fba3c,null));};exports[_0x9d91('0x14')]=function(_0x4250fd,_0x4f0674){if(_0x4250fd[_0x9d91('0x35')]['id']){delete _0x4250fd[_0x9d91('0x35')]['id'];}return db[_0x9d91('0x1d')][_0x9d91('0x33')]({'where':{'id':_0x4250fd[_0x9d91('0x29')]['id']}})[_0x9d91('0x16')](handleEntityNotFound(_0x4f0674,null))[_0x9d91('0x16')](saveUpdates(_0x4250fd['body'],null))[_0x9d91('0x16')](respondWithResult(_0x4f0674,null))[_0x9d91('0x28')](handleError(_0x4f0674,null));};exports['destroy']=function(_0x27933f,_0xebf120){return db[_0x9d91('0x1d')][_0x9d91('0x33')]({'where':{'id':_0x27933f[_0x9d91('0x29')]['id']}})[_0x9d91('0x16')](handleEntityNotFound(_0xebf120,null))[_0x9d91('0x16')](removeEntity(_0xebf120,null))['catch'](handleError(_0xebf120,null));};exports[_0x9d91('0x3d')]=function(_0x570d,_0x24d6a2){return db[_0x9d91('0x1d')][_0x9d91('0x3d')]()['then'](respondWithResult(_0x24d6a2,null))[_0x9d91('0x28')](handleError(_0x24d6a2,null));};exports[_0x9d91('0x3e')]=function(_0x27add4,_0x424474){var _0x232a5a={'raw':!![],'where':{}},_0x35db23={},_0x5d0d83;return db[_0x9d91('0x1d')][_0x9d91('0x3f')]({'where':{'id':_0x27add4['params']['id']}})['then'](handleEntityNotFound(_0x424474,null))[_0x9d91('0x16')](function(_0x4ee2ec){if(_0x4ee2ec){_0x5d0d83=_0x4ee2ec[_0x9d91('0x37')]({'plain':!![]});_0x35db23[_0x9d91('0x2d')]=_[_0x9d91('0x2a')](db[_0x9d91('0x40')][_0x9d91('0x1e')]);_0x35db23[_0x9d91('0x25')]=_['keys'](_0x27add4[_0x9d91('0x25')]);_0x35db23[_0x9d91('0x2b')]=_[_0x9d91('0x2c')](_0x35db23['model'],_0x35db23[_0x9d91('0x25')]);_0x232a5a[_0x9d91('0x2e')]=_[_0x9d91('0x2c')](_0x35db23[_0x9d91('0x2d')],qs['fields'](_0x27add4['query'][_0x9d91('0x2f')]));_0x232a5a[_0x9d91('0x2e')]=_0x232a5a[_0x9d91('0x2e')][_0x9d91('0x30')]?_0x232a5a[_0x9d91('0x2e')]:_0x35db23[_0x9d91('0x2d')];if(!_0x27add4[_0x9d91('0x25')][_0x9d91('0x41')](_0x9d91('0x42'))){_0x232a5a[_0x9d91('0x11')]=qs[_0x9d91('0x11')](_0x27add4[_0x9d91('0x25')][_0x9d91('0x11')]);_0x232a5a[_0x9d91('0xe')]=qs[_0x9d91('0xe')](_0x27add4[_0x9d91('0x25')][_0x9d91('0xe')]);}_0x232a5a[_0x9d91('0x43')]=qs[_0x9d91('0x44')](_0x27add4[_0x9d91('0x25')][_0x9d91('0x44')]);_0x232a5a[_0x9d91('0x23')]=qs[_0x9d91('0x2b')](_[_0x9d91('0x45')](_0x27add4['query'],_0x35db23[_0x9d91('0x2b')]));_0x232a5a['where'][_0x9d91('0x46')]=_0x4ee2ec['id'];if(_0x27add4[_0x9d91('0x25')]['filter']){_0x232a5a['where']=_['merge'](_0x232a5a[_0x9d91('0x23')],{'$or':_[_0x9d91('0x1c')](_0x232a5a[_0x9d91('0x2e')],function(_0x5737ae){var _0x31e33e={};_0x31e33e[_0x5737ae]={'$like':'%'+_0x27add4[_0x9d91('0x25')][_0x9d91('0x47')]+'%'};return _0x31e33e;})});}_0x232a5a=_[_0x9d91('0x31')]({},_0x232a5a,_0x27add4[_0x9d91('0x32')]);return db['UserWhatsappQueue'][_0x9d91('0x26')](_0x232a5a);}})['then'](function(_0x57343e){if(_0x57343e){return db[_0x9d91('0x48')][_0x9d91('0x49')]({'where':{'id':_[_0x9d91('0x1c')](_0x57343e,'UserId'),'role':'agent'},'attributes':['id',_0x9d91('0x1a'),'whatsappPause','updatedAt','createdAt']});}})[_0x9d91('0x16')](function(_0x1e6d0e){if(_0x1e6d0e){return{'count':_0x1e6d0e[_0x9d91('0x10')],'rows':_[_0x9d91('0x1c')](_0x1e6d0e[_0x9d91('0x27')],function(_0x3b4c75){return{'membername':_0x3b4c75['name'],'UserId':_0x3b4c75['id'],'queue_name':_0x5d0d83[_0x9d91('0x1a')],'WhatsappQueueId':_0x5d0d83['id'],'interface':util[_0x9d91('0x4a')]('%s/%s',_0x9d91('0x4b'),_0x3b4c75['name']),'penalty':0x0,'paused':_0x3b4c75[_0x9d91('0x4c')],'createdAt':_0x3b4c75['createdAt'],'updatedAt':_0x3b4c75[_0x9d91('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9d91('0x16')](respondWithFilteredResult(_0x424474,_0x232a5a))['catch'](handleError(_0x424474,null));};exports[_0x9d91('0x4e')]=function(_0x5797b9,_0x4d7874){var _0x2c0ae9={};var _0x4748a0={};var _0x47b77f;var _0x42d3f2;return db['WhatsappQueue'][_0x9d91('0x3f')]({'where':{'id':_0x5797b9['params']['id']}})[_0x9d91('0x16')](handleEntityNotFound(_0x4d7874,null))[_0x9d91('0x16')](function(_0x1afb97){if(_0x1afb97){_0x47b77f=_0x1afb97;_0x4748a0['model']=_[_0x9d91('0x2a')](db['Team'][_0x9d91('0x1e')]);_0x4748a0[_0x9d91('0x25')]=_[_0x9d91('0x2a')](_0x5797b9[_0x9d91('0x25')]);_0x4748a0['filters']=_[_0x9d91('0x2c')](_0x4748a0['model'],_0x4748a0[_0x9d91('0x25')]);_0x2c0ae9[_0x9d91('0x2e')]=_[_0x9d91('0x2c')](_0x4748a0['model'],qs[_0x9d91('0x2f')](_0x5797b9[_0x9d91('0x25')]['fields']));_0x2c0ae9['attributes']=_0x2c0ae9['attributes'][_0x9d91('0x30')]?_0x2c0ae9[_0x9d91('0x2e')]:_0x4748a0['model'];_0x2c0ae9[_0x9d91('0x43')]=qs[_0x9d91('0x44')](_0x5797b9[_0x9d91('0x25')][_0x9d91('0x44')]);_0x2c0ae9[_0x9d91('0x23')]=qs[_0x9d91('0x2b')](_[_0x9d91('0x45')](_0x5797b9[_0x9d91('0x25')],_0x4748a0[_0x9d91('0x2b')]));if(_0x5797b9[_0x9d91('0x25')][_0x9d91('0x47')]){_0x2c0ae9[_0x9d91('0x23')]=_[_0x9d91('0x31')](_0x2c0ae9[_0x9d91('0x23')],{'$or':_['map'](_0x2c0ae9[_0x9d91('0x2e')],function(_0x52d9d4){var _0x3bfea6={};_0x3bfea6[_0x52d9d4]={'$like':'%'+_0x5797b9[_0x9d91('0x25')]['filter']+'%'};return _0x3bfea6;})});}_0x2c0ae9=_[_0x9d91('0x31')]({},_0x2c0ae9,_0x5797b9[_0x9d91('0x32')]);return _0x47b77f['getTeams'](_0x2c0ae9);}})[_0x9d91('0x16')](function(_0x5865bd){if(_0x5865bd){_0x42d3f2=_0x5865bd[_0x9d91('0x30')];if(!_0x5797b9[_0x9d91('0x25')]['hasOwnProperty'](_0x9d91('0x42'))){_0x2c0ae9['limit']=qs[_0x9d91('0x11')](_0x5797b9[_0x9d91('0x25')]['limit']);_0x2c0ae9[_0x9d91('0xe')]=qs[_0x9d91('0xe')](_0x5797b9[_0x9d91('0x25')][_0x9d91('0xe')]);}return _0x47b77f[_0x9d91('0x4e')](_0x2c0ae9);}})[_0x9d91('0x16')](function(_0x83ee48){if(_0x83ee48){return _0x83ee48?{'count':_0x42d3f2,'rows':_0x83ee48}:null;}})[_0x9d91('0x16')](respondWithResult(_0x4d7874,null))['catch'](handleError(_0x4d7874,null));};exports[_0x9d91('0x4f')]=function(_0x2118ea,_0x53f79d){var _0xca79f9=_0x2118ea[_0x9d91('0x35')][_0x9d91('0x50')];return db[_0x9d91('0x51')]['findAll']({'where':{'id':_0xca79f9},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9d91('0x52'),'attributes':['id',_0x9d91('0x1a'),_0x9d91('0x53'),_0x9d91('0x54'),'interface'],'raw':!![]}]})['then'](function(_0x2490f2){if(_0x2490f2){var _0x92683e=_['flatMap'](_0x2490f2,function(_0x3186e5){var _0x1fcc6e=_0x3186e5[_0x9d91('0x37')]({'plain':!![]});return _0x1fcc6e[_0x9d91('0x52')];});return db[_0x9d91('0x1d')][_0x9d91('0x33')]({'where':{'id':_0x2118ea[_0x9d91('0x29')]['id']}})[_0x9d91('0x16')](function(_0x2cafea){return db['sequelize']['transaction'](function(_0x55d394){return _0x2cafea[_0x9d91('0x4f')](_0xca79f9,{'transaction':_0x55d394})[_0x9d91('0x16')](function(){return BPromise[_0x9d91('0x55')](_0x92683e,function(_0x2f59b6){return db[_0x9d91('0x40')][_0x9d91('0x56')]({'where':{'UserId':_0x2f59b6['id'],'WhatsappQueueId':_0x2118ea['params']['id']},'transaction':_0x55d394});});})[_0x9d91('0x16')](function(){_0x92683e['forEach'](function(_0x3b4f7a){socket[_0x9d91('0x57')](_0x9d91('0x58'),{'UserId':_0x3b4f7a['id'],'WhatsappQueueId':_0x2cafea['id']});});});});});}})[_0x9d91('0x16')](respondWithStatusCode(_0x53f79d,null))[_0x9d91('0x28')](handleError(_0x53f79d,null));};exports[_0x9d91('0x59')]=function(_0xb04735,_0x5ef005){return db['Team'][_0x9d91('0x26')]({'where':{'id':_0xb04735[_0x9d91('0x25')][_0x9d91('0x50')]},'attributes':['id'],'include':[{'model':db[_0x9d91('0x48')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9d91('0x16')](handleEntityNotFound(_0x5ef005,null))[_0x9d91('0x16')](function(_0x31a772){var _0x2bce17=_[_0x9d91('0x1c')](_0x31a772,'id');var _0x3de56d=[];var _0x475018=[];var _0x5e2611=squel[_0x9d91('0x5a')]();_0x5e2611['field'](_0x9d91('0x5b'))[_0x9d91('0x5c')](_0x9d91('0x5d'),'tq')[_0x9d91('0x5e')]('user_has_teams','ut',_0x9d91('0x5f'))['where'](_0x9d91('0x60'),_0xb04735[_0x9d91('0x29')]['id']);for(var _0x5a2d48=0x0;_0x5a2d48<_0x31a772[_0x9d91('0x30')];_0x5a2d48+=0x1){let _0x30a24f=_0x31a772[_0x5a2d48];for(var _0x2e1470=0x0;_0x2e1470<_0x30a24f['Agents']['length'];_0x2e1470+=0x1){let _0x1ce78b=_0x30a24f['Agents'][_0x2e1470];var _0x30a4af=_0x5e2611[_0x9d91('0x61')]();_0x30a4af[_0x9d91('0x23')](_0x9d91('0x62'),_0x1ce78b['id']);_0x475018[_0x9d91('0x63')](db[_0x9d91('0x64')][_0x9d91('0x25')](_0x30a4af[_0x9d91('0x65')](),{'type':db[_0x9d91('0x64')][_0x9d91('0x66')][_0x9d91('0x67')]})[_0x9d91('0x16')](function(_0x58b861){if(_0x58b861[_0x9d91('0x30')]===0x1){return _0x1ce78b['id'];}else{var _0xfbb3ee=_[_0x9d91('0x68')](_[_0x9d91('0x1c')](_0x58b861,'TeamId'),function(_0x5b55ce){return _['includes'](_0x2bce17,_0x5b55ce);});if(_0xfbb3ee){return _0x1ce78b['id'];}}}));}}return BPromise['all'](_0x475018)[_0x9d91('0x16')](function(_0x8869c6){_0x3de56d=_(_0x3de56d)['union'](_0x8869c6)[_0x9d91('0x69')]()[_0x9d91('0x6a')]();return db[_0x9d91('0x1d')][_0x9d91('0x33')]({'where':{'id':_0xb04735[_0x9d91('0x29')]['id']}})[_0x9d91('0x16')](function(_0x2ecb6d){return db[_0x9d91('0x64')][_0x9d91('0x6b')](function(_0x5a1127){return _0x2ecb6d[_0x9d91('0x59')](_0xb04735[_0x9d91('0x25')][_0x9d91('0x50')],{'transaction':_0x5a1127})[_0x9d91('0x16')](function(){if(!_[_0x9d91('0x6c')](_0x3de56d)){return _0x2ecb6d[_0x9d91('0x6d')](_0x3de56d,{'transaction':_0x5a1127});}})['then'](function(){_0x3de56d[_0x9d91('0x6e')](function(_0x17a4a6){socket[_0x9d91('0x57')](_0x9d91('0x6f'),{'UserId':_0x17a4a6,'WhatsappQueueId':_0x2ecb6d['id']});});});});});});})[_0x9d91('0x16')](respondWithStatusCode(_0x5ef005,null))['catch'](handleError(_0x5ef005,null));};exports[_0x9d91('0x70')]=function(_0x53b931,_0x51bb0c){return db[_0x9d91('0x1d')][_0x9d91('0x33')]({'where':{'id':_0x53b931[_0x9d91('0x29')]['id']}})[_0x9d91('0x16')](handleEntityNotFound(_0x51bb0c,null))[_0x9d91('0x16')](function(_0xe905fb){if(_0xe905fb){return _0xe905fb[_0x9d91('0x70')](_0x53b931[_0x9d91('0x35')][_0x9d91('0x50')],_[_0x9d91('0x71')](_0x53b931[_0x9d91('0x35')],['ids','id'])||{})['spread'](function(_0x29d65b){for(var _0x2ccac1=0x0;_0x2ccac1<_0x53b931[_0x9d91('0x35')][_0x9d91('0x50')][_0x9d91('0x30')];_0x2ccac1+=0x1){socket[_0x9d91('0x57')](_0x9d91('0x58'),{'UserId':Number(_0x53b931[_0x9d91('0x35')][_0x9d91('0x50')][_0x2ccac1]),'WhatsappQueueId':Number(_0x53b931[_0x9d91('0x29')]['id'])});}return _0x29d65b;});}})[_0x9d91('0x16')](respondWithResult(_0x51bb0c,null))[_0x9d91('0x28')](handleError(_0x51bb0c,null));};exports['removeAgents']=function(_0x794798,_0x394e25){return db[_0x9d91('0x1d')][_0x9d91('0x33')]({'where':{'id':_0x794798[_0x9d91('0x29')]['id']}})[_0x9d91('0x16')](handleEntityNotFound(_0x394e25,null))[_0x9d91('0x16')](function(_0x894597){if(_0x894597){return _0x894597[_0x9d91('0x6d')](_0x794798[_0x9d91('0x25')]['ids'])[_0x9d91('0x16')](function(){if(_[_0x9d91('0x72')](_0x794798['query'][_0x9d91('0x50')])){for(var _0x3a957d=0x0;_0x3a957d<_0x794798[_0x9d91('0x25')][_0x9d91('0x50')][_0x9d91('0x30')];_0x3a957d+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x794798[_0x9d91('0x25')][_0x9d91('0x50')][_0x3a957d]),'WhatsappQueueId':Number(_0x794798[_0x9d91('0x29')]['id'])});}}else{socket['emit'](_0x9d91('0x6f'),{'UserId':Number(_0x794798['query'][_0x9d91('0x50')]),'WhatsappQueueId':Number(_0x794798[_0x9d91('0x29')]['id'])});}});}})[_0x9d91('0x16')](respondWithStatusCode(_0x394e25,null))['catch'](handleError(_0x394e25,null));};exports[_0x9d91('0x73')]=function(_0x23eed5,_0x48ec52){var _0x14207b={};var _0x4f8693={};var _0x5cb402;var _0x24967a;return db[_0x9d91('0x1d')][_0x9d91('0x3f')]({'where':{'id':_0x23eed5[_0x9d91('0x29')]['id']}})[_0x9d91('0x16')](handleEntityNotFound(_0x48ec52,null))[_0x9d91('0x16')](function(_0x2df8f4){if(_0x2df8f4){_0x5cb402=_0x2df8f4;_0x4f8693[_0x9d91('0x2d')]=_['keys'](db[_0x9d91('0x48')][_0x9d91('0x1e')]);_0x4f8693['query']=_[_0x9d91('0x2a')](_0x23eed5[_0x9d91('0x25')]);_0x4f8693[_0x9d91('0x2b')]=_[_0x9d91('0x2c')](_0x4f8693[_0x9d91('0x2d')],_0x4f8693[_0x9d91('0x25')]);_0x14207b[_0x9d91('0x2e')]=_['intersection'](_0x4f8693[_0x9d91('0x2d')],qs[_0x9d91('0x2f')](_0x23eed5['query'][_0x9d91('0x2f')]));_0x14207b[_0x9d91('0x2e')]=_0x14207b[_0x9d91('0x2e')][_0x9d91('0x30')]?_0x14207b[_0x9d91('0x2e')]:_0x4f8693['model'];_0x14207b['order']=qs[_0x9d91('0x44')](_0x23eed5['query']['sort']);_0x14207b[_0x9d91('0x23')]=qs[_0x9d91('0x2b')](_[_0x9d91('0x45')](_0x23eed5['query'],_0x4f8693['filters']));if(_0x23eed5['query'][_0x9d91('0x47')]){_0x14207b[_0x9d91('0x23')]=_[_0x9d91('0x31')](_0x14207b[_0x9d91('0x23')],{'$or':_['map'](_0x14207b[_0x9d91('0x2e')],function(_0xe81e72){var _0x4225de={};_0x4225de[_0xe81e72]={'$like':'%'+_0x23eed5['query']['filter']+'%'};return _0x4225de;})});}_0x14207b=_[_0x9d91('0x31')]({},_0x14207b,_0x23eed5[_0x9d91('0x32')]);return _0x5cb402[_0x9d91('0x73')](_0x14207b);}})['then'](function(_0x2d7d0e){if(_0x2d7d0e){_0x24967a=_0x2d7d0e[_0x9d91('0x30')];if(!_0x23eed5[_0x9d91('0x25')][_0x9d91('0x41')](_0x9d91('0x42'))){_0x14207b[_0x9d91('0x11')]=qs[_0x9d91('0x11')](_0x23eed5[_0x9d91('0x25')][_0x9d91('0x11')]);_0x14207b[_0x9d91('0xe')]=qs['offset'](_0x23eed5['query'][_0x9d91('0xe')]);}return _0x5cb402[_0x9d91('0x73')](_0x14207b);}})[_0x9d91('0x16')](function(_0xe47bf6){if(_0xe47bf6){return _0xe47bf6?{'count':_0x24967a,'rows':_0xe47bf6}:null;}})[_0x9d91('0x16')](respondWithResult(_0x48ec52,null))[_0x9d91('0x28')](handleError(_0x48ec52,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 550150e..14825dd 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 _0xbef4=['exports','events','WhatsappQueue','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x490b45,_0x1ed852){var _0x51f215=function(_0x15f5d9){while(--_0x15f5d9){_0x490b45['push'](_0x490b45['shift']());}};_0x51f215(++_0x1ed852);}(_0xbef4,0xe1));var _0x4bef=function(_0x34fab4,_0x194738){_0x34fab4=_0x34fab4-0x0;var _0x42fa5c=_0xbef4[_0x34fab4];return _0x42fa5c;};'use strict';var EventEmitter=require(_0x4bef('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x4bef('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4bef('0x2')](0x0);var events={'afterCreate':_0x4bef('0x3'),'afterUpdate':'update','afterDestroy':_0x4bef('0x4')};function emitEvent(_0x340481){return function(_0x41fa12,_0x41cf71,_0x27f4ff){WhatsappQueueEvents[_0x4bef('0x5')](_0x340481+':'+_0x41fa12['id'],_0x41fa12);WhatsappQueueEvents['emit'](_0x340481,_0x41fa12);_0x27f4ff(null);};}for(var e in events){if(events[_0x4bef('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x4bef('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xbeed=['hasOwnProperty','exports','events','WhatsappQueue','setMaxListeners','update','remove','emit'];(function(_0x1651f1,_0xd2fd62){var _0x3520ab=function(_0x56cfa0){while(--_0x56cfa0){_0x1651f1['push'](_0x1651f1['shift']());}};_0x3520ab(++_0xd2fd62);}(_0xbeed,0x8a));var _0xdbee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbeed[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xdbee('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xdbee('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xdbee('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdbee('0x3'),'afterDestroy':_0xdbee('0x4')};function emitEvent(_0x544f66){return function(_0x49888f,_0x2a14c7,_0x3a59b2){WhatsappQueueEvents[_0xdbee('0x5')](_0x544f66+':'+_0x49888f['id'],_0x49888f);WhatsappQueueEvents['emit'](_0x544f66,_0x49888f);_0x3a59b2(null);};}for(var e in events){if(events[_0xdbee('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xdbee('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index b21ddc4..9e1a11d 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 _0x484c=['bluebird','request-promise','rimraf','WhatsappQueue','whatsapp_queues','util','moment'];(function(_0x37c65a,_0x4ccee7){var _0x17ae8c=function(_0x8fce42){while(--_0x8fce42){_0x37c65a['push'](_0x37c65a['shift']());}};_0x17ae8c(++_0x4ccee7);}(_0x484c,0x186));var _0xc484=function(_0x3abd41,_0x1523bb){_0x3abd41=_0x3abd41-0x0;var _0x582723=_0x484c[_0x3abd41];return _0x582723;};'use strict';var _=require('lodash');var util=require(_0xc484('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc484('0x1'));var BPromise=require(_0xc484('0x2'));var rp=require(_0xc484('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc484('0x4'));var config=require('../../config/environment');var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x52fa4b,_0x5a724f){return _0x52fa4b['define'](_0xc484('0x5'),attributes,{'tableName':_0xc484('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3c2=['whatsapp_queues','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappQueue'];(function(_0x22cb5f,_0x2cdd63){var _0x274d36=function(_0x421472){while(--_0x421472){_0x22cb5f['push'](_0x22cb5f['shift']());}};_0x274d36(++_0x2cdd63);}(_0xe3c2,0xbf));var _0x2e3c=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xe3c2[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x2e3c('0x0'));var util=require(_0x2e3c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2e3c('0x2'));var rp=require(_0x2e3c('0x3'));var fs=require('fs');var path=require(_0x2e3c('0x4'));var rimraf=require(_0x2e3c('0x5'));var config=require(_0x2e3c('0x6'));var attributes=require('./whatsappQueue.attributes');module[_0x2e3c('0x7')]=function(_0x33825c,_0x459a76){return _0x33825c['define'](_0x2e3c('0x8'),attributes,{'tableName':_0x2e3c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 8ad6de5..0401d50 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 _0xb804=['result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','include','map','model','then','ShowWhatsappQueue','find','lodash','util','bluebird','ioredis','../../config/logger','rpc','jayson/promise','http','redis','localhost','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x26c309,_0x4a4283){var _0x24c110=function(_0x37b5b0){while(--_0x37b5b0){_0x26c309['push'](_0x26c309['shift']());}};_0x24c110(++_0x4a4283);}(_0xb804,0x153));var _0x4b80=function(_0x4808e0,_0x46806c){_0x4808e0=_0x4808e0-0x0;var _0x16d12a=_0xb804[_0x4808e0];return _0x16d12a;};'use strict';var _=require(_0x4b80('0x0'));var util=require(_0x4b80('0x1'));var moment=require('moment');var BPromise=require(_0x4b80('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b80('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4b80('0x4'))(_0x4b80('0x5'));var config=require('../../config/environment');var jayson=require(_0x4b80('0x6'));var client=jayson['client'][_0x4b80('0x7')]({'port':0x232a});config[_0x4b80('0x8')]=_['defaults'](config[_0x4b80('0x8')],{'host':_0x4b80('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b80('0x8')]));require(_0x4b80('0xa'))[_0x4b80('0xb')](socket);function respondWithRpcPromise(_0x69aba5,_0x18de6c,_0x48d42b){return new BPromise(function(_0x312dff,_0x113380){return client[_0x4b80('0xc')](_0x69aba5,_0x48d42b)['then'](function(_0x54f0bc){logger[_0x4b80('0xd')](_0x4b80('0xe'),_0x18de6c,'request\x20sent');logger[_0x4b80('0xf')](_0x4b80('0x10'),_0x18de6c,'request\x20sent',JSON[_0x4b80('0x11')](_0x54f0bc));if(_0x54f0bc[_0x4b80('0x12')]){if(_0x54f0bc[_0x4b80('0x12')][_0x4b80('0x13')]===0x1f4){logger[_0x4b80('0x12')](_0x4b80('0xe'),_0x18de6c,_0x54f0bc[_0x4b80('0x12')][_0x4b80('0x14')]);return _0x113380(_0x54f0bc['error'][_0x4b80('0x14')]);}logger['error'](_0x4b80('0xe'),_0x18de6c,_0x54f0bc[_0x4b80('0x12')]['message']);return _0x312dff(_0x54f0bc[_0x4b80('0x12')][_0x4b80('0x14')]);}else{logger[_0x4b80('0xd')](_0x4b80('0xe'),_0x18de6c,'request\x20sent');_0x312dff(_0x54f0bc[_0x4b80('0x15')][_0x4b80('0x14')]);}})[_0x4b80('0x16')](function(_0x416eee){logger[_0x4b80('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x18de6c,_0x416eee);_0x113380(_0x416eee);});});}exports[_0x4b80('0x17')]=function(_0x5a2e26){var _0x526b7d=this;return new Promise(function(_0x4b2ff7,_0x56d40c){return db[_0x4b80('0x18')][_0x4b80('0x19')]({'raw':_0x5a2e26['options']?_0x5a2e26[_0x4b80('0x1a')][_0x4b80('0x1b')]===undefined?!![]:![]:!![],'where':_0x5a2e26[_0x4b80('0x1a')]?_0x5a2e26[_0x4b80('0x1a')][_0x4b80('0x1c')]||null:null,'attributes':_0x5a2e26[_0x4b80('0x1a')]?_0x5a2e26['options'][_0x4b80('0x1d')]||null:null,'limit':_0x5a2e26[_0x4b80('0x1a')]?_0x5a2e26[_0x4b80('0x1a')]['limit']||null:null,'include':_0x5a2e26[_0x4b80('0x1a')]?_0x5a2e26[_0x4b80('0x1a')][_0x4b80('0x1e')]?_[_0x4b80('0x1f')](_0x5a2e26[_0x4b80('0x1a')][_0x4b80('0x1e')],function(_0x4069e7){return{'model':db[_0x4069e7['model']],'as':_0x4069e7['as'],'attributes':_0x4069e7[_0x4b80('0x1d')],'include':_0x4069e7[_0x4b80('0x1e')]?_[_0x4b80('0x1f')](_0x4069e7[_0x4b80('0x1e')],function(_0x12c9bd){return{'model':db[_0x12c9bd[_0x4b80('0x20')]],'as':_0x12c9bd['as'],'attributes':_0x12c9bd[_0x4b80('0x1d')],'include':_0x12c9bd[_0x4b80('0x1e')]?_[_0x4b80('0x1f')](_0x12c9bd[_0x4b80('0x1e')],function(_0x53176c){return{'model':db[_0x53176c[_0x4b80('0x20')]],'as':_0x53176c['as'],'attributes':_0x53176c['attributes']};}):[]};}):[]};}):[]:[]})[_0x4b80('0x21')](function(_0x4441b6){logger[_0x4b80('0xd')](_0x4b80('0x17'),_0x5a2e26);logger[_0x4b80('0xf')](_0x4b80('0x17'),_0x5a2e26,JSON['stringify'](_0x4441b6));_0x4b2ff7(_0x4441b6);})[_0x4b80('0x16')](function(_0x4f22e0){logger[_0x4b80('0x12')](_0x4b80('0x17'),_0x4f22e0[_0x4b80('0x14')],_0x5a2e26);_0x56d40c(_0x526b7d[_0x4b80('0x12')](0x1f4,_0x4f22e0[_0x4b80('0x14')]));});});};exports[_0x4b80('0x22')]=function(_0x320c45){var _0x4d4e48=this;return new Promise(function(_0x3e60e1,_0x4aae07){return db[_0x4b80('0x18')][_0x4b80('0x23')]({'raw':_0x320c45[_0x4b80('0x1a')]?_0x320c45[_0x4b80('0x1a')][_0x4b80('0x1b')]===undefined?!![]:![]:!![],'where':_0x320c45[_0x4b80('0x1a')]?_0x320c45[_0x4b80('0x1a')][_0x4b80('0x1c')]||null:null,'attributes':_0x320c45[_0x4b80('0x1a')]?_0x320c45[_0x4b80('0x1a')][_0x4b80('0x1d')]||null:null,'include':_0x320c45[_0x4b80('0x1a')]?_0x320c45['options'][_0x4b80('0x1e')]?_['map'](_0x320c45[_0x4b80('0x1a')][_0x4b80('0x1e')],function(_0x45252a){return{'model':db[_0x45252a[_0x4b80('0x20')]],'as':_0x45252a['as'],'attributes':_0x45252a[_0x4b80('0x1d')],'include':_0x45252a[_0x4b80('0x1e')]?_['map'](_0x45252a[_0x4b80('0x1e')],function(_0x186501){return{'model':db[_0x186501[_0x4b80('0x20')]],'as':_0x186501['as'],'attributes':_0x186501[_0x4b80('0x1d')],'include':_0x186501[_0x4b80('0x1e')]?_['map'](_0x186501[_0x4b80('0x1e')],function(_0x1a4ee5){return{'model':db[_0x1a4ee5['model']],'as':_0x1a4ee5['as'],'attributes':_0x1a4ee5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d3293){logger['info'](_0x4b80('0x22'),_0x320c45);logger[_0x4b80('0xf')](_0x4b80('0x22'),_0x320c45,JSON['stringify'](_0x1d3293));_0x3e60e1(_0x1d3293);})['catch'](function(_0x5bd5d2){logger[_0x4b80('0x12')](_0x4b80('0x22'),_0x5bd5d2[_0x4b80('0x14')],_0x320c45);_0x4aae07(_0x4d4e48[_0x4b80('0x12')](0x1f4,_0x5bd5d2[_0x4b80('0x14')]));});});}; \ No newline at end of file +var _0x2f7d=['rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','register','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','raw','options','attributes','limit','include','map','model','GetWhatsappQueue','stringify','WhatsappQueue','find','where','ShowWhatsappQueue','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0xf22003,_0x4daaad){var _0x1af727=function(_0x99db67){while(--_0x99db67){_0xf22003['push'](_0xf22003['shift']());}};_0x1af727(++_0x4daaad);}(_0x2f7d,0x1ab));var _0xd2f7=function(_0x2853bf,_0x58296f){_0x2853bf=_0x2853bf-0x0;var _0x1f76e5=_0x2f7d[_0x2853bf];return _0x1f76e5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd2f7('0x0'));var BPromise=require('bluebird');var rs=require(_0xd2f7('0x1'));var fs=require('fs');var Redis=require(_0xd2f7('0x2'));var db=require(_0xd2f7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2f7('0x4'))(_0xd2f7('0x5'));var config=require(_0xd2f7('0x6'));var jayson=require(_0xd2f7('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xd2f7('0x8')]=_['defaults'](config[_0xd2f7('0x8')],{'host':_0xd2f7('0x9'),'port':0x18eb});var socket=require(_0xd2f7('0xa'))(new Redis(config[_0xd2f7('0x8')]));require('./whatsappQueue.socket')[_0xd2f7('0xb')](socket);function respondWithRpcPromise(_0x205735,_0x59911b,_0x1cec6d){return new BPromise(function(_0x2ca3e0,_0x460fc3){return client['request'](_0x205735,_0x1cec6d)[_0xd2f7('0xc')](function(_0x6db013){logger[_0xd2f7('0xd')](_0xd2f7('0xe'),_0x59911b,_0xd2f7('0xf'));logger[_0xd2f7('0x10')](_0xd2f7('0x11'),_0x59911b,'request\x20sent',JSON['stringify'](_0x6db013));if(_0x6db013[_0xd2f7('0x12')]){if(_0x6db013['error'][_0xd2f7('0x13')]===0x1f4){logger[_0xd2f7('0x12')](_0xd2f7('0xe'),_0x59911b,_0x6db013['error'][_0xd2f7('0x14')]);return _0x460fc3(_0x6db013[_0xd2f7('0x12')]['message']);}logger[_0xd2f7('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x59911b,_0x6db013[_0xd2f7('0x12')]['message']);return _0x2ca3e0(_0x6db013[_0xd2f7('0x12')][_0xd2f7('0x14')]);}else{logger[_0xd2f7('0xd')](_0xd2f7('0xe'),_0x59911b,'request\x20sent');_0x2ca3e0(_0x6db013[_0xd2f7('0x15')][_0xd2f7('0x14')]);}})[_0xd2f7('0x16')](function(_0x470e96){logger[_0xd2f7('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x59911b,_0x470e96);_0x460fc3(_0x470e96);});});}exports['GetWhatsappQueue']=function(_0x27081a){var _0x11dbb5=this;return new Promise(function(_0x3cab78,_0x1102f9){return db['WhatsappQueue']['findAll']({'raw':_0x27081a['options']?_0x27081a['options'][_0xd2f7('0x17')]===undefined?!![]:![]:!![],'where':_0x27081a['options']?_0x27081a['options']['where']||null:null,'attributes':_0x27081a[_0xd2f7('0x18')]?_0x27081a['options'][_0xd2f7('0x19')]||null:null,'limit':_0x27081a['options']?_0x27081a['options'][_0xd2f7('0x1a')]||null:null,'include':_0x27081a['options']?_0x27081a[_0xd2f7('0x18')][_0xd2f7('0x1b')]?_[_0xd2f7('0x1c')](_0x27081a[_0xd2f7('0x18')][_0xd2f7('0x1b')],function(_0x57f9db){return{'model':db[_0x57f9db[_0xd2f7('0x1d')]],'as':_0x57f9db['as'],'attributes':_0x57f9db[_0xd2f7('0x19')],'include':_0x57f9db[_0xd2f7('0x1b')]?_[_0xd2f7('0x1c')](_0x57f9db[_0xd2f7('0x1b')],function(_0x163cc0){return{'model':db[_0x163cc0[_0xd2f7('0x1d')]],'as':_0x163cc0['as'],'attributes':_0x163cc0[_0xd2f7('0x19')],'include':_0x163cc0[_0xd2f7('0x1b')]?_[_0xd2f7('0x1c')](_0x163cc0[_0xd2f7('0x1b')],function(_0x5b1fd5){return{'model':db[_0x5b1fd5[_0xd2f7('0x1d')]],'as':_0x5b1fd5['as'],'attributes':_0x5b1fd5[_0xd2f7('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd2f7('0xc')](function(_0x179afd){logger[_0xd2f7('0xd')](_0xd2f7('0x1e'),_0x27081a);logger[_0xd2f7('0x10')]('GetWhatsappQueue',_0x27081a,JSON[_0xd2f7('0x1f')](_0x179afd));_0x3cab78(_0x179afd);})[_0xd2f7('0x16')](function(_0x5c6f3e){logger[_0xd2f7('0x12')]('GetWhatsappQueue',_0x5c6f3e[_0xd2f7('0x14')],_0x27081a);_0x1102f9(_0x11dbb5['error'](0x1f4,_0x5c6f3e[_0xd2f7('0x14')]));});});};exports['ShowWhatsappQueue']=function(_0x35f030){var _0x288c13=this;return new Promise(function(_0x2e95dc,_0x52f9f0){return db[_0xd2f7('0x20')][_0xd2f7('0x21')]({'raw':_0x35f030['options']?_0x35f030['options'][_0xd2f7('0x17')]===undefined?!![]:![]:!![],'where':_0x35f030[_0xd2f7('0x18')]?_0x35f030['options'][_0xd2f7('0x22')]||null:null,'attributes':_0x35f030[_0xd2f7('0x18')]?_0x35f030[_0xd2f7('0x18')][_0xd2f7('0x19')]||null:null,'include':_0x35f030['options']?_0x35f030[_0xd2f7('0x18')][_0xd2f7('0x1b')]?_['map'](_0x35f030[_0xd2f7('0x18')][_0xd2f7('0x1b')],function(_0x2cd1d8){return{'model':db[_0x2cd1d8[_0xd2f7('0x1d')]],'as':_0x2cd1d8['as'],'attributes':_0x2cd1d8[_0xd2f7('0x19')],'include':_0x2cd1d8['include']?_[_0xd2f7('0x1c')](_0x2cd1d8[_0xd2f7('0x1b')],function(_0x42aaec){return{'model':db[_0x42aaec['model']],'as':_0x42aaec['as'],'attributes':_0x42aaec['attributes'],'include':_0x42aaec[_0xd2f7('0x1b')]?_[_0xd2f7('0x1c')](_0x42aaec[_0xd2f7('0x1b')],function(_0x4ae67d){return{'model':db[_0x4ae67d[_0xd2f7('0x1d')]],'as':_0x4ae67d['as'],'attributes':_0x4ae67d[_0xd2f7('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd2f7('0xc')](function(_0x2adba2){logger['info'](_0xd2f7('0x23'),_0x35f030);logger[_0xd2f7('0x10')](_0xd2f7('0x23'),_0x35f030,JSON['stringify'](_0x2adba2));_0x2e95dc(_0x2adba2);})[_0xd2f7('0x16')](function(_0xb2f1ea){logger[_0xd2f7('0x12')](_0xd2f7('0x23'),_0xb2f1ea[_0xd2f7('0x14')],_0x35f030);_0x52f9f0(_0x288c13['error'](0x1f4,_0xb2f1ea[_0xd2f7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index cd7124f..ff99a8c 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 _0xcdf7=['remove','update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcdf7,0xb2));var _0x7cdf=function(_0x358806,_0x18d03a){_0x358806=_0x358806-0x0;var _0x40e97c=_0xcdf7[_0x358806];return _0x40e97c;};'use strict';var WhatsappQueueEvents=require(_0x7cdf('0x0'));var events=[_0x7cdf('0x1'),_0x7cdf('0x2'),_0x7cdf('0x3')];function createListener(_0x24c63a,_0x4553ee){return function(_0x49fdaa){_0x4553ee[_0x7cdf('0x4')](_0x24c63a,_0x49fdaa);};}function removeListener(_0x4b9847,_0x4d0204){return function(){WhatsappQueueEvents[_0x7cdf('0x5')](_0x4b9847,_0x4d0204);};}exports[_0x7cdf('0x6')]=function(_0x173562){for(var _0x413b0b=0x0,_0x4e584f=events[_0x7cdf('0x7')];_0x413b0b<_0x4e584f;_0x413b0b++){var _0xb726ed=events[_0x413b0b];var _0x46df98=createListener(_0x7cdf('0x8')+_0xb726ed,_0x173562);WhatsappQueueEvents['on'](_0xb726ed,_0x46df98);}}; \ No newline at end of file +var _0x6b5f=['remove','update','emit','removeListener','register','save'];(function(_0x5469e2,_0x1cb459){var _0x5849a2=function(_0x8e818f){while(--_0x8e818f){_0x5469e2['push'](_0x5469e2['shift']());}};_0x5849a2(++_0x1cb459);}(_0x6b5f,0x197));var _0xf6b5=function(_0x612a2a,_0x1a4cdb){_0x612a2a=_0x612a2a-0x0;var _0x25f448=_0x6b5f[_0x612a2a];return _0x25f448;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xf6b5('0x0'),_0xf6b5('0x1'),_0xf6b5('0x2')];function createListener(_0x28c760,_0x22c2a3){return function(_0x85ec8){_0x22c2a3[_0xf6b5('0x3')](_0x28c760,_0x85ec8);};}function removeListener(_0x13e8c7,_0x2cdb4d){return function(){WhatsappQueueEvents[_0xf6b5('0x4')](_0x13e8c7,_0x2cdb4d);};}exports[_0xf6b5('0x5')]=function(_0x22674a){for(var _0x42ef7f=0x0,_0x55c9c5=events['length'];_0x42ef7f<_0x55c9c5;_0x42ef7f++){var _0x2aec35=events[_0x42ef7f];var _0x506c25=createListener('whatsappQueue:'+_0x2aec35,_0x22674a);WhatsappQueueEvents['on'](_0x2aec35,_0x506c25);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index b4f4812..2759c96 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 _0xb6a1=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','describe','/:id'];(function(_0x1dd18a,_0x52c221){var _0x208b81=function(_0x595264){while(--_0x595264){_0x1dd18a['push'](_0x1dd18a['shift']());}};_0x208b81(++_0x52c221);}(_0xb6a1,0x14a));var _0x1b6a=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xb6a1[_0x278e3c];return _0x3e2d9b;};'use strict';var multer=require(_0x1b6a('0x0'));var util=require(_0x1b6a('0x1'));var path=require(_0x1b6a('0x2'));var timeout=require(_0x1b6a('0x3'));var express=require('express');var router=express[_0x1b6a('0x4')]();var fs_extra=require(_0x1b6a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b6a('0x6'));var controller=require(_0x1b6a('0x7'));router[_0x1b6a('0x8')]('/',auth[_0x1b6a('0x9')](),controller['index']);router[_0x1b6a('0x8')]('/describe',auth[_0x1b6a('0x9')](),controller[_0x1b6a('0xa')]);router['get'](_0x1b6a('0xb'),auth[_0x1b6a('0x9')](),controller['show']);router['post']('/',auth[_0x1b6a('0x9')](),controller[_0x1b6a('0xc')]);router[_0x1b6a('0xd')](_0x1b6a('0xb'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0xe')]);router[_0x1b6a('0xf')](_0x1b6a('0xb'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x10')]);module[_0x1b6a('0x11')]=router; \ No newline at end of file +var _0x673f=['/:id','show','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappQueueReport.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x673f,0xa8));var _0xf673=function(_0x467b77,_0x4d7b6a){_0x467b77=_0x467b77-0x0;var _0x39e193=_0x673f[_0x467b77];return _0x39e193;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf673('0x0'));var timeout=require(_0xf673('0x1'));var express=require(_0xf673('0x2'));var router=express[_0xf673('0x3')]();var fs_extra=require(_0xf673('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf673('0x5'));var controller=require(_0xf673('0x6'));router[_0xf673('0x7')]('/',auth['isAuthenticated'](),controller[_0xf673('0x8')]);router[_0xf673('0x7')](_0xf673('0x9'),auth[_0xf673('0xa')](),controller[_0xf673('0xb')]);router[_0xf673('0x7')](_0xf673('0xc'),auth[_0xf673('0xa')](),controller[_0xf673('0xd')]);router['post']('/',auth[_0xf673('0xa')](),controller[_0xf673('0xe')]);router[_0xf673('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xf673('0x10')]);router[_0xf673('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf673('0x12')]);module[_0xf673('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 33200c4..1b15842 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(_0x3b6063,_0x319991){var _0x5c5f2d=function(_0x4b1701){while(--_0x4b1701){_0x3b6063['push'](_0x3b6063['shift']());}};_0x5c5f2d(++_0x319991);}(_0x7a54,0x106));var _0x47a5=function(_0x342652,_0x57d12f){_0x342652=_0x342652-0x0;var _0xcc833c=_0x7a54[_0x342652];return _0xcc833c;};'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(_0x1ac5ea,_0x32151b){var _0x4cc12f=function(_0x3ee58e){while(--_0x3ee58e){_0x1ac5ea['push'](_0x1ac5ea['shift']());}};_0x4cc12f(++_0x32151b);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 43ecfd3..c1b1d66 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 _0xb03e=['destroy','error','stack','name','send','fieldName','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','options','WhatsappQueueReport','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','find','params','describe','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','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then'];(function(_0x31edd7,_0x540292){var _0x304c97=function(_0x36e67f){while(--_0x36e67f){_0x31edd7['push'](_0x31edd7['shift']());}};_0x304c97(++_0x540292);}(_0xb03e,0x1eb));var _0xeb03=function(_0x532dec,_0x2f1706){_0x532dec=_0x532dec-0x0;var _0x431fe9=_0xb03e[_0x532dec];return _0x431fe9;};'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'];function respondWithStatusCode(_0x367d36,_0x384cbe){_0x384cbe=_0x384cbe||0xcc;return function(_0x97f46d){if(_0x97f46d){return _0x367d36[_0xeb03('0x1b')](_0x384cbe);}return _0x367d36[_0xeb03('0x1c')](_0x384cbe)[_0xeb03('0x1d')]();};}function respondWithResult(_0x4d9c8e,_0x212082){_0x212082=_0x212082||0xc8;return function(_0x100bef){if(_0x100bef){return _0x4d9c8e[_0xeb03('0x1c')](_0x212082)[_0xeb03('0x1e')](_0x100bef);}};}function respondWithFilteredResult(_0x52be5b,_0x15f4fe){return function(_0x36f5d8){if(_0x36f5d8){var _0x3f26ef=typeof _0x15f4fe['offset']===_0xeb03('0x1f')&&typeof _0x15f4fe[_0xeb03('0x20')]===_0xeb03('0x1f');var _0x44716c=_0x36f5d8[_0xeb03('0x21')];var _0x1b4cbd=_0x3f26ef?0x0:_0x15f4fe[_0xeb03('0x22')];var _0x8d6725=_0x3f26ef?_0x36f5d8[_0xeb03('0x21')]:_0x15f4fe[_0xeb03('0x22')]+_0x15f4fe[_0xeb03('0x20')];var _0x2c238d;if(_0x8d6725>=_0x44716c){_0x8d6725=_0x44716c;_0x2c238d=0xc8;}else{_0x2c238d=0xce;}_0x52be5b[_0xeb03('0x1c')](_0x2c238d);return _0x52be5b[_0xeb03('0x23')]('Content-Range',_0x1b4cbd+'-'+_0x8d6725+'/'+_0x44716c)[_0xeb03('0x1e')](_0x36f5d8);}return null;};}function patchUpdates(_0x3855dd){return function(_0x413d3e){try{jsonpatch[_0xeb03('0x24')](_0x413d3e,_0x3855dd,!![]);}catch(_0xe5a1c2){return BPromise[_0xeb03('0x25')](_0xe5a1c2);}return _0x413d3e[_0xeb03('0x26')]();};}function saveUpdates(_0x2c795b,_0x3c3d09){return function(_0x5a704b){if(_0x5a704b){return _0x5a704b[_0xeb03('0x27')](_0x2c795b)[_0xeb03('0x28')](function(_0x11ea85){return _0x11ea85;});}return null;};}function removeEntity(_0x300dc0,_0x2f99e6){return function(_0x5dcda3){if(_0x5dcda3){return _0x5dcda3[_0xeb03('0x29')]()[_0xeb03('0x28')](function(){_0x300dc0[_0xeb03('0x1c')](0xcc)[_0xeb03('0x1d')]();});}};}function handleEntityNotFound(_0x3f276a,_0x119697){return function(_0xb04f34){if(!_0xb04f34){_0x3f276a[_0xeb03('0x1b')](0x194);}return _0xb04f34;};}function handleError(_0xbb7ff,_0x4984f6){_0x4984f6=_0x4984f6||0x1f4;return function(_0x832372){logger[_0xeb03('0x2a')](_0x832372[_0xeb03('0x2b')]);if(_0x832372[_0xeb03('0x2c')]){delete _0x832372['name'];}_0xbb7ff['status'](_0x4984f6)[_0xeb03('0x2d')](_0x832372);};}exports['index']=function(_0x31a622,_0x8bd544){var _0x160a37={},_0x5db8bb={},_0xd4c8ec={'count':0x0,'rows':[]};var _0x5de53a=_['map'](db['WhatsappQueueReport']['rawAttributes'],function(_0x421a27){return{'name':_0x421a27[_0xeb03('0x2e')],'type':_0x421a27['type']['key']};});_0x5db8bb['model']=_['map'](_0x5de53a,_0xeb03('0x2c'));_0x5db8bb[_0xeb03('0x2f')]=_[_0xeb03('0x30')](_0x31a622[_0xeb03('0x2f')]);_0x5db8bb[_0xeb03('0x31')]=_['intersection'](_0x5db8bb[_0xeb03('0x32')],_0x5db8bb['query']);_0x160a37[_0xeb03('0x33')]=_[_0xeb03('0x34')](_0x5db8bb[_0xeb03('0x32')],qs[_0xeb03('0x35')](_0x31a622[_0xeb03('0x2f')][_0xeb03('0x35')]));_0x160a37[_0xeb03('0x33')]=_0x160a37[_0xeb03('0x33')]['length']?_0x160a37[_0xeb03('0x33')]:_0x5db8bb['model'];if(!_0x31a622[_0xeb03('0x2f')][_0xeb03('0x36')](_0xeb03('0x37'))){_0x160a37[_0xeb03('0x20')]=qs[_0xeb03('0x20')](_0x31a622[_0xeb03('0x2f')]['limit']);_0x160a37[_0xeb03('0x22')]=qs['offset'](_0x31a622['query']['offset']);}_0x160a37[_0xeb03('0x38')]=qs[_0xeb03('0x39')](_0x31a622[_0xeb03('0x2f')][_0xeb03('0x39')]);_0x160a37[_0xeb03('0x3a')]=qs['filters'](_[_0xeb03('0x3b')](_0x31a622[_0xeb03('0x2f')],_0x5db8bb[_0xeb03('0x31')]),_0x5de53a);if(_0x31a622['query']['filter']){_0x160a37[_0xeb03('0x3a')]=_[_0xeb03('0x3c')](_0x160a37[_0xeb03('0x3a')],{'$or':_['map'](_0x5de53a,function(_0x328f72){if(_0x328f72[_0xeb03('0x3d')]!=='VIRTUAL'){var _0x49edb3={};_0x49edb3[_0x328f72[_0xeb03('0x2c')]]={'$like':'%'+_0x31a622[_0xeb03('0x2f')]['filter']+'%'};return _0x49edb3;}})});}_0x160a37=_[_0xeb03('0x3c')]({},_0x160a37,_0x31a622[_0xeb03('0x3e')]);var _0x3fa3de={'where':_0x160a37[_0xeb03('0x3a')]};return db[_0xeb03('0x3f')][_0xeb03('0x21')](_0x3fa3de)[_0xeb03('0x28')](function(_0x3c1c21){_0xd4c8ec[_0xeb03('0x21')]=_0x3c1c21;if(_0x31a622[_0xeb03('0x2f')][_0xeb03('0x40')]){_0x160a37[_0xeb03('0x41')]=[{'all':!![]}];}return db[_0xeb03('0x3f')][_0xeb03('0x42')](_0x160a37);})[_0xeb03('0x28')](function(_0x6b95dd){_0xd4c8ec[_0xeb03('0x43')]=_0x6b95dd;return _0xd4c8ec;})[_0xeb03('0x28')](respondWithFilteredResult(_0x8bd544,_0x160a37))[_0xeb03('0x44')](handleError(_0x8bd544,null));};exports[_0xeb03('0x45')]=function(_0x43e530,_0x2f83c3){var _0x2879b0={'raw':!![],'where':{'id':_0x43e530['params']['id']}},_0x5bb7d9={};_0x5bb7d9[_0xeb03('0x32')]=_[_0xeb03('0x30')](db[_0xeb03('0x3f')][_0xeb03('0x46')]);_0x5bb7d9[_0xeb03('0x2f')]=_[_0xeb03('0x30')](_0x43e530[_0xeb03('0x2f')]);_0x5bb7d9[_0xeb03('0x31')]=_['intersection'](_0x5bb7d9[_0xeb03('0x32')],_0x5bb7d9[_0xeb03('0x2f')]);_0x2879b0[_0xeb03('0x33')]=_[_0xeb03('0x34')](_0x5bb7d9[_0xeb03('0x32')],qs['fields'](_0x43e530['query'][_0xeb03('0x35')]));_0x2879b0['attributes']=_0x2879b0['attributes']['length']?_0x2879b0[_0xeb03('0x33')]:_0x5bb7d9[_0xeb03('0x32')];if(_0x43e530[_0xeb03('0x2f')][_0xeb03('0x40')]){_0x2879b0[_0xeb03('0x41')]=[{'all':!![]}];}_0x2879b0=_[_0xeb03('0x3c')]({},_0x2879b0,_0x43e530['options']);return db[_0xeb03('0x3f')]['find'](_0x2879b0)['then'](handleEntityNotFound(_0x2f83c3,null))[_0xeb03('0x28')](respondWithResult(_0x2f83c3,null))[_0xeb03('0x44')](handleError(_0x2f83c3,null));};exports[_0xeb03('0x47')]=function(_0x54d7ce,_0x404191){return db[_0xeb03('0x3f')][_0xeb03('0x47')](_0x54d7ce[_0xeb03('0x48')],{})[_0xeb03('0x28')](respondWithResult(_0x404191,0xc9))['catch'](handleError(_0x404191,null));};exports[_0xeb03('0x27')]=function(_0x4dc1f6,_0x13c295){if(_0x4dc1f6[_0xeb03('0x48')]['id']){delete _0x4dc1f6[_0xeb03('0x48')]['id'];}return db[_0xeb03('0x3f')][_0xeb03('0x49')]({'where':{'id':_0x4dc1f6[_0xeb03('0x4a')]['id']}})[_0xeb03('0x28')](handleEntityNotFound(_0x13c295,null))[_0xeb03('0x28')](saveUpdates(_0x4dc1f6[_0xeb03('0x48')],null))[_0xeb03('0x28')](respondWithResult(_0x13c295,null))[_0xeb03('0x44')](handleError(_0x13c295,null));};exports[_0xeb03('0x29')]=function(_0x2f2066,_0x345a98){return db[_0xeb03('0x3f')][_0xeb03('0x49')]({'where':{'id':_0x2f2066[_0xeb03('0x4a')]['id']}})[_0xeb03('0x28')](handleEntityNotFound(_0x345a98,null))[_0xeb03('0x28')](removeEntity(_0x345a98,null))[_0xeb03('0x44')](handleError(_0x345a98,null));};exports[_0xeb03('0x4b')]=function(_0x333fba,_0x1761ab){return db[_0xeb03('0x3f')]['describe']()[_0xeb03('0x28')](respondWithResult(_0x1761ab,null))[_0xeb03('0x44')](handleError(_0x1761ab,null));}; \ No newline at end of file +var _0x8603=['fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','WhatsappQueueReport','rawAttributes'];(function(_0x53c5f0,_0x389849){var _0x5a9986=function(_0x1142a0){while(--_0x1142a0){_0x53c5f0['push'](_0x53c5f0['shift']());}};_0x5a9986(++_0x389849);}(_0x8603,0x190));var _0x3860=function(_0x1578ad,_0x5cdd6c){_0x1578ad=_0x1578ad-0x0;var _0x5b84c2=_0x8603[_0x1578ad];return _0x5b84c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3860('0x10'));var logger=require(_0x3860('0x11'))('api');var utils=require(_0x3860('0x12'));var config=require(_0x3860('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3860('0x14'))['db'];function respondWithStatusCode(_0x8ad61d,_0x2428f6){_0x2428f6=_0x2428f6||0xcc;return function(_0x1ea619){if(_0x1ea619){return _0x8ad61d[_0x3860('0x15')](_0x2428f6);}return _0x8ad61d[_0x3860('0x16')](_0x2428f6)[_0x3860('0x17')]();};}function respondWithResult(_0x12b23b,_0x465d8d){_0x465d8d=_0x465d8d||0xc8;return function(_0x46264d){if(_0x46264d){return _0x12b23b['status'](_0x465d8d)[_0x3860('0x18')](_0x46264d);}};}function respondWithFilteredResult(_0x21eaf1,_0x122e40){return function(_0x37d9ab){if(_0x37d9ab){var _0x1055b3=typeof _0x122e40[_0x3860('0x19')]===_0x3860('0x1a')&&typeof _0x122e40[_0x3860('0x1b')]===_0x3860('0x1a');var _0x3c0d91=_0x37d9ab[_0x3860('0x1c')];var _0x45b799=_0x1055b3?0x0:_0x122e40['offset'];var _0x4863bd=_0x1055b3?_0x37d9ab[_0x3860('0x1c')]:_0x122e40[_0x3860('0x19')]+_0x122e40[_0x3860('0x1b')];var _0x53fc63;if(_0x4863bd>=_0x3c0d91){_0x4863bd=_0x3c0d91;_0x53fc63=0xc8;}else{_0x53fc63=0xce;}_0x21eaf1[_0x3860('0x16')](_0x53fc63);return _0x21eaf1[_0x3860('0x1d')](_0x3860('0x1e'),_0x45b799+'-'+_0x4863bd+'/'+_0x3c0d91)[_0x3860('0x18')](_0x37d9ab);}return null;};}function patchUpdates(_0x20a5b0){return function(_0x45081f){try{jsonpatch[_0x3860('0x1f')](_0x45081f,_0x20a5b0,!![]);}catch(_0x1f8891){return BPromise[_0x3860('0x20')](_0x1f8891);}return _0x45081f[_0x3860('0x21')]();};}function saveUpdates(_0xacd57f,_0x2e0b6e){return function(_0x280ea9){if(_0x280ea9){return _0x280ea9[_0x3860('0x22')](_0xacd57f)[_0x3860('0x23')](function(_0x564efd){return _0x564efd;});}return null;};}function removeEntity(_0xfc10a5,_0x133093){return function(_0x2b91f2){if(_0x2b91f2){return _0x2b91f2[_0x3860('0x24')]()[_0x3860('0x23')](function(){_0xfc10a5['status'](0xcc)[_0x3860('0x17')]();});}};}function handleEntityNotFound(_0x568515,_0x577750){return function(_0xfa9705){if(!_0xfa9705){_0x568515[_0x3860('0x15')](0x194);}return _0xfa9705;};}function handleError(_0x54b5ec,_0x4d9a90){_0x4d9a90=_0x4d9a90||0x1f4;return function(_0x5f42d5){logger[_0x3860('0x25')](_0x5f42d5[_0x3860('0x26')]);if(_0x5f42d5[_0x3860('0x27')]){delete _0x5f42d5[_0x3860('0x27')];}_0x54b5ec[_0x3860('0x16')](_0x4d9a90)[_0x3860('0x28')](_0x5f42d5);};}exports['index']=function(_0x4c4314,_0x389bd0){var _0x1f1809={},_0x5a9af2={},_0x2551f4={'count':0x0,'rows':[]};var _0x3d5143=_[_0x3860('0x29')](db[_0x3860('0x2a')][_0x3860('0x2b')],function(_0x4bbae9){return{'name':_0x4bbae9[_0x3860('0x2c')],'type':_0x4bbae9[_0x3860('0x2d')][_0x3860('0x2e')]};});_0x5a9af2['model']=_[_0x3860('0x29')](_0x3d5143,'name');_0x5a9af2[_0x3860('0x2f')]=_['keys'](_0x4c4314[_0x3860('0x2f')]);_0x5a9af2[_0x3860('0x30')]=_[_0x3860('0x31')](_0x5a9af2['model'],_0x5a9af2[_0x3860('0x2f')]);_0x1f1809[_0x3860('0x32')]=_['intersection'](_0x5a9af2[_0x3860('0x33')],qs['fields'](_0x4c4314[_0x3860('0x2f')][_0x3860('0x34')]));_0x1f1809[_0x3860('0x32')]=_0x1f1809[_0x3860('0x32')][_0x3860('0x35')]?_0x1f1809[_0x3860('0x32')]:_0x5a9af2[_0x3860('0x33')];if(!_0x4c4314['query'][_0x3860('0x36')](_0x3860('0x37'))){_0x1f1809['limit']=qs[_0x3860('0x1b')](_0x4c4314[_0x3860('0x2f')][_0x3860('0x1b')]);_0x1f1809['offset']=qs['offset'](_0x4c4314[_0x3860('0x2f')][_0x3860('0x19')]);}_0x1f1809[_0x3860('0x38')]=qs[_0x3860('0x39')](_0x4c4314['query']['sort']);_0x1f1809[_0x3860('0x3a')]=qs[_0x3860('0x30')](_[_0x3860('0x3b')](_0x4c4314[_0x3860('0x2f')],_0x5a9af2[_0x3860('0x30')]),_0x3d5143);if(_0x4c4314['query'][_0x3860('0x3c')]){_0x1f1809[_0x3860('0x3a')]=_['merge'](_0x1f1809['where'],{'$or':_[_0x3860('0x29')](_0x3d5143,function(_0x148914){if(_0x148914[_0x3860('0x2d')]!==_0x3860('0x3d')){var _0x2b35b2={};_0x2b35b2[_0x148914['name']]={'$like':'%'+_0x4c4314[_0x3860('0x2f')]['filter']+'%'};return _0x2b35b2;}})});}_0x1f1809=_[_0x3860('0x3e')]({},_0x1f1809,_0x4c4314[_0x3860('0x3f')]);var _0x53d443={'where':_0x1f1809[_0x3860('0x3a')]};return db[_0x3860('0x2a')]['count'](_0x53d443)[_0x3860('0x23')](function(_0xc7d34d){_0x2551f4[_0x3860('0x1c')]=_0xc7d34d;if(_0x4c4314[_0x3860('0x2f')]['includeAll']){_0x1f1809[_0x3860('0x40')]=[{'all':!![]}];}return db[_0x3860('0x2a')][_0x3860('0x41')](_0x1f1809);})['then'](function(_0x3a87e5){_0x2551f4['rows']=_0x3a87e5;return _0x2551f4;})[_0x3860('0x23')](respondWithFilteredResult(_0x389bd0,_0x1f1809))[_0x3860('0x42')](handleError(_0x389bd0,null));};exports[_0x3860('0x43')]=function(_0x3f613f,_0x2220c8){var _0x3f4216={'raw':!![],'where':{'id':_0x3f613f[_0x3860('0x44')]['id']}},_0x4e0a44={};_0x4e0a44[_0x3860('0x33')]=_['keys'](db['WhatsappQueueReport'][_0x3860('0x2b')]);_0x4e0a44[_0x3860('0x2f')]=_['keys'](_0x3f613f[_0x3860('0x2f')]);_0x4e0a44[_0x3860('0x30')]=_['intersection'](_0x4e0a44[_0x3860('0x33')],_0x4e0a44[_0x3860('0x2f')]);_0x3f4216[_0x3860('0x32')]=_[_0x3860('0x31')](_0x4e0a44[_0x3860('0x33')],qs[_0x3860('0x34')](_0x3f613f[_0x3860('0x2f')][_0x3860('0x34')]));_0x3f4216[_0x3860('0x32')]=_0x3f4216[_0x3860('0x32')][_0x3860('0x35')]?_0x3f4216[_0x3860('0x32')]:_0x4e0a44[_0x3860('0x33')];if(_0x3f613f['query'][_0x3860('0x45')]){_0x3f4216['include']=[{'all':!![]}];}_0x3f4216=_[_0x3860('0x3e')]({},_0x3f4216,_0x3f613f[_0x3860('0x3f')]);return db[_0x3860('0x2a')][_0x3860('0x46')](_0x3f4216)[_0x3860('0x23')](handleEntityNotFound(_0x2220c8,null))[_0x3860('0x23')](respondWithResult(_0x2220c8,null))[_0x3860('0x42')](handleError(_0x2220c8,null));};exports[_0x3860('0x47')]=function(_0x5a91b2,_0x3cd575){return db[_0x3860('0x2a')][_0x3860('0x47')](_0x5a91b2['body'],{})[_0x3860('0x23')](respondWithResult(_0x3cd575,0xc9))[_0x3860('0x42')](handleError(_0x3cd575,null));};exports[_0x3860('0x22')]=function(_0x3dc957,_0x5ed2db){if(_0x3dc957['body']['id']){delete _0x3dc957[_0x3860('0x48')]['id'];}return db['WhatsappQueueReport'][_0x3860('0x46')]({'where':{'id':_0x3dc957[_0x3860('0x44')]['id']}})[_0x3860('0x23')](handleEntityNotFound(_0x5ed2db,null))['then'](saveUpdates(_0x3dc957[_0x3860('0x48')],null))['then'](respondWithResult(_0x5ed2db,null))[_0x3860('0x42')](handleError(_0x5ed2db,null));};exports['destroy']=function(_0xf9edb4,_0x25d22f){return db[_0x3860('0x2a')]['find']({'where':{'id':_0xf9edb4['params']['id']}})[_0x3860('0x23')](handleEntityNotFound(_0x25d22f,null))[_0x3860('0x23')](removeEntity(_0x25d22f,null))['catch'](handleError(_0x25d22f,null));};exports[_0x3860('0x49')]=function(_0x58237e,_0x3b3bfe){return db[_0x3860('0x2a')][_0x3860('0x49')]()[_0x3860('0x23')](respondWithResult(_0x3b3bfe,null))[_0x3860('0x42')](handleError(_0x3b3bfe,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index d04ca1b..780083e 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 _0xf60e=['report_whatsapp_queue','uniqueid','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport'];(function(_0xea6eb8,_0x6f7317){var _0x2d90c3=function(_0x29dca8){while(--_0x29dca8){_0xea6eb8['push'](_0xea6eb8['shift']());}};_0x2d90c3(++_0x6f7317);}(_0xf60e,0x15e));var _0xef60=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xf60e[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0xef60('0x0'));var util=require(_0xef60('0x1'));var logger=require('../../config/logger')(_0xef60('0x2'));var moment=require(_0xef60('0x3'));var BPromise=require(_0xef60('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xef60('0x5'));var config=require(_0xef60('0x6'));var attributes=require(_0xef60('0x7'));module['exports']=function(_0x4daddd,_0x24c02a){return _0x4daddd[_0xef60('0x8')](_0xef60('0x9'),attributes,{'tableName':_0xef60('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xef60('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x532f=['define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','api','moment','path','./whatsappQueueReport.attributes','exports'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x532f,0x1e8));var _0xf532=function(_0x14e59e,_0x4a5ba7){_0x14e59e=_0x14e59e-0x0;var _0x4e015a=_0x532f[_0x14e59e];return _0x4e015a;};'use strict';var _=require(_0xf532('0x0'));var util=require(_0xf532('0x1'));var logger=require('../../config/logger')(_0xf532('0x2'));var moment=require(_0xf532('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf532('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf532('0x5'));module[_0xf532('0x6')]=function(_0x3878e7,_0x2d5668){return _0x3878e7[_0xf532('0x7')](_0xf532('0x8'),attributes,{'tableName':_0xf532('0x9'),'paranoid':![],'indexes':[{'name':_0xf532('0xa'),'fields':[_0xf532('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index c77637a..d05899f 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 _0x44b0=['WhatsappQueueReport,\x20%s,\x20%s','error','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','debug','UpdateWhatsappQueueReport','update','body','where','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code'];(function(_0x3d0241,_0x290392){var _0x13a724=function(_0x1bdc51){while(--_0x1bdc51){_0x3d0241['push'](_0x3d0241['shift']());}};_0x13a724(++_0x290392);}(_0x44b0,0x16d));var _0x044b=function(_0x598059,_0x37b941){_0x598059=_0x598059-0x0;var _0x2a074e=_0x44b0[_0x598059];return _0x2a074e;};'use strict';var _=require(_0x044b('0x0'));var util=require(_0x044b('0x1'));var moment=require(_0x044b('0x2'));var BPromise=require(_0x044b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x044b('0x4'));var db=require(_0x044b('0x5'))['db'];var utils=require(_0x044b('0x6'));var logger=require(_0x044b('0x7'))(_0x044b('0x8'));var config=require(_0x044b('0x9'));var jayson=require(_0x044b('0xa'));var client=jayson[_0x044b('0xb')][_0x044b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4545f9,_0x14dab1,_0x30a47a){return new BPromise(function(_0x2a6a89,_0x4bd7b7){return client[_0x044b('0xd')](_0x4545f9,_0x30a47a)[_0x044b('0xe')](function(_0x1b1dc0){logger[_0x044b('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x14dab1,'request\x20sent');logger['debug'](_0x044b('0x10'),_0x14dab1,_0x044b('0x11'),JSON[_0x044b('0x12')](_0x1b1dc0));if(_0x1b1dc0['error']){if(_0x1b1dc0['error'][_0x044b('0x13')]===0x1f4){logger['error'](_0x044b('0x14'),_0x14dab1,_0x1b1dc0['error']['message']);return _0x4bd7b7(_0x1b1dc0[_0x044b('0x15')][_0x044b('0x16')]);}logger[_0x044b('0x15')](_0x044b('0x14'),_0x14dab1,_0x1b1dc0['error'][_0x044b('0x16')]);return _0x2a6a89(_0x1b1dc0[_0x044b('0x15')][_0x044b('0x16')]);}else{logger[_0x044b('0xf')](_0x044b('0x14'),_0x14dab1,_0x044b('0x11'));_0x2a6a89(_0x1b1dc0[_0x044b('0x17')][_0x044b('0x16')]);}})['catch'](function(_0x314d78){logger[_0x044b('0x15')](_0x044b('0x14'),_0x14dab1,_0x314d78);_0x4bd7b7(_0x314d78);});});}exports[_0x044b('0x18')]=function(_0x3593ef){var _0x4a060b=this;return new Promise(function(_0x1a0ee9,_0x28ddf6){return db[_0x044b('0x19')][_0x044b('0x1a')](_0x3593ef['body'],{'raw':_0x3593ef[_0x044b('0x1b')]?_0x3593ef[_0x044b('0x1b')][_0x044b('0x1c')]===undefined?!![]:![]:!![]})[_0x044b('0xe')](function(_0xbca905){logger[_0x044b('0xf')](_0x044b('0x18'),_0x3593ef);logger[_0x044b('0x1d')](_0x044b('0x18'),_0x3593ef,JSON[_0x044b('0x12')](_0xbca905));_0x1a0ee9(_0xbca905);})['catch'](function(_0x5d9eb7){logger[_0x044b('0x15')](_0x044b('0x18'),_0x5d9eb7[_0x044b('0x16')],_0x3593ef);_0x28ddf6(_0x4a060b[_0x044b('0x15')](0x1f4,_0x5d9eb7[_0x044b('0x16')]));});});};exports[_0x044b('0x1e')]=function(_0x2c0d10){var _0x5acc2d=this;return new Promise(function(_0x5c5aca,_0x5ac0ad){return db[_0x044b('0x19')][_0x044b('0x1f')](_0x2c0d10[_0x044b('0x20')],{'raw':_0x2c0d10['options']?_0x2c0d10[_0x044b('0x1b')][_0x044b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c0d10[_0x044b('0x1b')]?_0x2c0d10[_0x044b('0x1b')][_0x044b('0x21')]||null:null,'attributes':_0x2c0d10[_0x044b('0x1b')]?_0x2c0d10[_0x044b('0x1b')]['attributes']||null:null,'limit':_0x2c0d10[_0x044b('0x1b')]?_0x2c0d10['options']['limit']||null:null})[_0x044b('0xe')](function(_0x1027f4){logger[_0x044b('0xf')](_0x044b('0x1e'),_0x2c0d10);logger[_0x044b('0x1d')](_0x044b('0x1e'),_0x2c0d10,JSON[_0x044b('0x12')](_0x1027f4));_0x5c5aca(_0x1027f4);})[_0x044b('0x22')](function(_0x440dc){logger[_0x044b('0x15')]('UpdateWhatsappQueueReport',_0x440dc[_0x044b('0x16')],_0x2c0d10);_0x5ac0ad(_0x5acc2d['error'](0x1f4,_0x440dc[_0x044b('0x16')]));});});}; \ No newline at end of file +var _0x4552=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','WhatsappQueueReport,\x20%s,\x20%s','message','catch','WhatsappQueueReport','create','body','options','raw','CreateWhatsappQueueReport','debug','stringify','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','moment','randomstring'];(function(_0x3d1f8e,_0x279486){var _0x3ebcb3=function(_0x544b2e){while(--_0x544b2e){_0x3d1f8e['push'](_0x3d1f8e['shift']());}};_0x3ebcb3(++_0x279486);}(_0x4552,0x1eb));var _0x2455=function(_0x1ac4c8,_0x10941b){_0x1ac4c8=_0x1ac4c8-0x0;var _0x669dd7=_0x4552[_0x1ac4c8];return _0x669dd7;};'use strict';var _=require(_0x2455('0x0'));var util=require(_0x2455('0x1'));var moment=require(_0x2455('0x2'));var BPromise=require('bluebird');var rs=require(_0x2455('0x3'));var fs=require('fs');var Redis=require(_0x2455('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2455('0x5'));var logger=require(_0x2455('0x6'))(_0x2455('0x7'));var config=require('../../config/environment');var jayson=require(_0x2455('0x8'));var client=jayson[_0x2455('0x9')][_0x2455('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x233df6,_0x51955b,_0x516157){return new BPromise(function(_0x581e0d,_0x172186){return client[_0x2455('0xb')](_0x233df6,_0x516157)[_0x2455('0xc')](function(_0x31621f){logger[_0x2455('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x51955b,_0x2455('0xe'));logger['debug'](_0x2455('0xf'),_0x51955b,_0x2455('0xe'),JSON['stringify'](_0x31621f));if(_0x31621f[_0x2455('0x10')]){if(_0x31621f[_0x2455('0x10')]['code']===0x1f4){logger[_0x2455('0x10')](_0x2455('0x11'),_0x51955b,_0x31621f[_0x2455('0x10')][_0x2455('0x12')]);return _0x172186(_0x31621f[_0x2455('0x10')][_0x2455('0x12')]);}logger[_0x2455('0x10')](_0x2455('0x11'),_0x51955b,_0x31621f[_0x2455('0x10')]['message']);return _0x581e0d(_0x31621f[_0x2455('0x10')][_0x2455('0x12')]);}else{logger[_0x2455('0xd')](_0x2455('0x11'),_0x51955b,_0x2455('0xe'));_0x581e0d(_0x31621f['result'][_0x2455('0x12')]);}})[_0x2455('0x13')](function(_0x55e838){logger[_0x2455('0x10')](_0x2455('0x11'),_0x51955b,_0x55e838);_0x172186(_0x55e838);});});}exports['CreateWhatsappQueueReport']=function(_0x5ce741){var _0x1e5e64=this;return new Promise(function(_0x4c9622,_0x45aaef){return db[_0x2455('0x14')][_0x2455('0x15')](_0x5ce741[_0x2455('0x16')],{'raw':_0x5ce741['options']?_0x5ce741[_0x2455('0x17')][_0x2455('0x18')]===undefined?!![]:![]:!![]})[_0x2455('0xc')](function(_0x580bdd){logger[_0x2455('0xd')](_0x2455('0x19'),_0x5ce741);logger[_0x2455('0x1a')](_0x2455('0x19'),_0x5ce741,JSON[_0x2455('0x1b')](_0x580bdd));_0x4c9622(_0x580bdd);})[_0x2455('0x13')](function(_0x4a2a19){logger['error'](_0x2455('0x19'),_0x4a2a19[_0x2455('0x12')],_0x5ce741);_0x45aaef(_0x1e5e64[_0x2455('0x10')](0x1f4,_0x4a2a19['message']));});});};exports[_0x2455('0x1c')]=function(_0x4ebced){var _0x5cdddc=this;return new Promise(function(_0x4d4a17,_0xa1ffc9){return db[_0x2455('0x14')][_0x2455('0x1d')](_0x4ebced['body'],{'raw':_0x4ebced[_0x2455('0x17')]?_0x4ebced[_0x2455('0x17')][_0x2455('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ebced[_0x2455('0x17')]?_0x4ebced[_0x2455('0x17')][_0x2455('0x1e')]||null:null,'attributes':_0x4ebced[_0x2455('0x17')]?_0x4ebced[_0x2455('0x17')][_0x2455('0x1f')]||null:null,'limit':_0x4ebced[_0x2455('0x17')]?_0x4ebced[_0x2455('0x17')][_0x2455('0x20')]||null:null})['then'](function(_0x32267b){logger[_0x2455('0xd')](_0x2455('0x1c'),_0x4ebced);logger[_0x2455('0x1a')](_0x2455('0x1c'),_0x4ebced,JSON[_0x2455('0x1b')](_0x32267b));_0x4d4a17(_0x32267b);})[_0x2455('0x13')](function(_0x1944a9){logger[_0x2455('0x10')](_0x2455('0x1c'),_0x1944a9['message'],_0x4ebced);_0xa1ffc9(_0x5cdddc[_0x2455('0x10')](0x1f4,_0x1944a9[_0x2455('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index c06e436..be26aca 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 _0x4ca0=['isAuthenticated','index','get','describe','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller'];(function(_0x485865,_0x11d29a){var _0x11ef06=function(_0x5745e9){while(--_0x5745e9){_0x485865['push'](_0x485865['shift']());}};_0x11ef06(++_0x11d29a);}(_0x4ca0,0x170));var _0x04ca=function(_0x43c8b8,_0x5e8934){_0x43c8b8=_0x43c8b8-0x0;var _0x413be3=_0x4ca0[_0x43c8b8];return _0x413be3;};'use strict';var multer=require(_0x04ca('0x0'));var util=require(_0x04ca('0x1'));var path=require(_0x04ca('0x2'));var timeout=require(_0x04ca('0x3'));var express=require(_0x04ca('0x4'));var router=express[_0x04ca('0x5')]();var fs_extra=require(_0x04ca('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x04ca('0x7'));var config=require(_0x04ca('0x8'));var controller=require(_0x04ca('0x9'));router['get']('/',auth[_0x04ca('0xa')](),controller[_0x04ca('0xb')]);router[_0x04ca('0xc')]('/describe',auth[_0x04ca('0xa')](),controller[_0x04ca('0xd')]);router['get'](_0x04ca('0xe'),auth[_0x04ca('0xa')](),controller['show']);router[_0x04ca('0xf')]('/',auth[_0x04ca('0xa')](),controller[_0x04ca('0x10')]);router[_0x04ca('0x11')](_0x04ca('0xe'),auth[_0x04ca('0xa')](),controller['update']);router[_0x04ca('0x12')]('/:id',auth[_0x04ca('0xa')](),controller[_0x04ca('0x13')]);module[_0x04ca('0x14')]=router; \ No newline at end of file +var _0x0c08=['post','create','put','delete','destroy','multer','util','path','Router','../../components/interaction/service','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0c08,0x71));var _0x80c0=function(_0x446208,_0xb483fb){_0x446208=_0x446208-0x0;var _0xe49563=_0x0c08[_0x446208];return _0xe49563;};'use strict';var multer=require(_0x80c0('0x0'));var util=require(_0x80c0('0x1'));var path=require(_0x80c0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x80c0('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x80c0('0x4'));var config=require('../../config/environment');var controller=require(_0x80c0('0x5'));router[_0x80c0('0x6')]('/',auth[_0x80c0('0x7')](),controller[_0x80c0('0x8')]);router[_0x80c0('0x6')](_0x80c0('0x9'),auth[_0x80c0('0x7')](),controller[_0x80c0('0xa')]);router[_0x80c0('0x6')](_0x80c0('0xb'),auth['isAuthenticated'](),controller[_0x80c0('0xc')]);router[_0x80c0('0xd')]('/',auth[_0x80c0('0x7')](),controller[_0x80c0('0xe')]);router[_0x80c0('0xf')](_0x80c0('0xb'),auth[_0x80c0('0x7')](),controller['update']);router[_0x80c0('0x10')](_0x80c0('0xb'),auth[_0x80c0('0x7')](),controller[_0x80c0('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 52991a5..101c4a9 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 _0xb4e2=['sequelize','ENUM','DATE'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb4e2,0x1aa));var _0x2b4e=function(_0x352d59,_0x5afd7b){_0x352d59=_0x352d59-0x0;var _0x241060=_0xb4e2[_0x352d59];return _0x241060;};'use strict';var Sequelize=require(_0x2b4e('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2b4e('0x1')]('account','agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x2b4e('0x2')]}}; \ No newline at end of file +var _0xa49b=['exports','STRING','ENUM','account','queue','DATE'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa49b,0x126));var _0xba49=function(_0x118b69,_0x2d1561){_0x118b69=_0x118b69-0x0;var _0x276aa3=_0xa49b[_0x118b69];return _0x276aa3;};'use strict';var Sequelize=require('sequelize');module[_0xba49('0x0')]={'uniqueid':{'type':Sequelize[_0xba49('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xba49('0x2')](_0xba49('0x3'),'agent',_0xba49('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xba49('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 145ebc1..a99c99c 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 _0x21fd=['query','intersection','attributes','length','hasOwnProperty','nolimit','where','filters','pick','merge','filter','options','then','includeAll','include','findAll','rows','catch','show','keys','fields','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','type','model'];(function(_0x356b9e,_0x306f73){var _0x15e910=function(_0x476146){while(--_0x476146){_0x356b9e['push'](_0x356b9e['shift']());}};_0x15e910(++_0x306f73);}(_0x21fd,0x1e2));var _0xd21f=function(_0x195b41,_0x27b02f){_0x195b41=_0x195b41-0x0;var _0x65fa21=_0x21fd[_0x195b41];return _0x65fa21;};'use strict';var emlformat=require(_0xd21f('0x0'));var rimraf=require(_0xd21f('0x1'));var zipdir=require(_0xd21f('0x2'));var jsonpatch=require(_0xd21f('0x3'));var rp=require(_0xd21f('0x4'));var moment=require(_0xd21f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd21f('0x6'));var util=require(_0xd21f('0x7'));var path=require('path');var sox=require(_0xd21f('0x8'));var csv=require(_0xd21f('0x9'));var ejs=require(_0xd21f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd21f('0xb'));var squel=require(_0xd21f('0xc'));var crypto=require(_0xd21f('0xd'));var jsforce=require(_0xd21f('0xe'));var deskjs=require(_0xd21f('0xf'));var toCsv=require(_0xd21f('0x9'));var querystring=require(_0xd21f('0x10'));var Papa=require(_0xd21f('0x11'));var Redis=require(_0xd21f('0x12'));var authService=require(_0xd21f('0x13'));var qs=require(_0xd21f('0x14'));var as=require(_0xd21f('0x15'));var hardwareService=require(_0xd21f('0x16'));var logger=require(_0xd21f('0x17'))(_0xd21f('0x18'));var utils=require(_0xd21f('0x19'));var config=require(_0xd21f('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bbc06,_0x1a1f8f){_0x1a1f8f=_0x1a1f8f||0xcc;return function(_0x31c01b){if(_0x31c01b){return _0x5bbc06[_0xd21f('0x1b')](_0x1a1f8f);}return _0x5bbc06['status'](_0x1a1f8f)[_0xd21f('0x1c')]();};}function respondWithResult(_0x333aa9,_0x2df14e){_0x2df14e=_0x2df14e||0xc8;return function(_0x534f12){if(_0x534f12){return _0x333aa9[_0xd21f('0x1d')](_0x2df14e)['json'](_0x534f12);}};}function respondWithFilteredResult(_0x52a911,_0x1eded1){return function(_0x21f05e){if(_0x21f05e){var _0xb22c4b=typeof _0x1eded1[_0xd21f('0x1e')]===_0xd21f('0x1f')&&typeof _0x1eded1[_0xd21f('0x20')]==='undefined';var _0x167ba4=_0x21f05e['count'];var _0x2e1764=_0xb22c4b?0x0:_0x1eded1[_0xd21f('0x1e')];var _0x242c36=_0xb22c4b?_0x21f05e[_0xd21f('0x21')]:_0x1eded1['offset']+_0x1eded1[_0xd21f('0x20')];var _0x322ed8;if(_0x242c36>=_0x167ba4){_0x242c36=_0x167ba4;_0x322ed8=0xc8;}else{_0x322ed8=0xce;}_0x52a911[_0xd21f('0x1d')](_0x322ed8);return _0x52a911[_0xd21f('0x22')](_0xd21f('0x23'),_0x2e1764+'-'+_0x242c36+'/'+_0x167ba4)['json'](_0x21f05e);}return null;};}function patchUpdates(_0x95bb22){return function(_0x4fac5e){try{jsonpatch[_0xd21f('0x24')](_0x4fac5e,_0x95bb22,!![]);}catch(_0x3cd5bd){return BPromise[_0xd21f('0x25')](_0x3cd5bd);}return _0x4fac5e[_0xd21f('0x26')]();};}function saveUpdates(_0x2a1309,_0x36efcb){return function(_0xe8c535){if(_0xe8c535){return _0xe8c535[_0xd21f('0x27')](_0x2a1309)['then'](function(_0x95bc75){return _0x95bc75;});}return null;};}function removeEntity(_0x66c39b,_0x1cee8e){return function(_0x5e9ff8){if(_0x5e9ff8){return _0x5e9ff8[_0xd21f('0x28')]()['then'](function(){_0x66c39b[_0xd21f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x108142,_0x34cdcc){return function(_0x1dadc3){if(!_0x1dadc3){_0x108142[_0xd21f('0x1b')](0x194);}return _0x1dadc3;};}function handleError(_0x3a63ac,_0x9269d){_0x9269d=_0x9269d||0x1f4;return function(_0x2f7525){logger['error'](_0x2f7525[_0xd21f('0x29')]);if(_0x2f7525[_0xd21f('0x2a')]){delete _0x2f7525[_0xd21f('0x2a')];}_0x3a63ac[_0xd21f('0x1d')](_0x9269d)[_0xd21f('0x2b')](_0x2f7525);};}exports[_0xd21f('0x2c')]=function(_0x3a8fcf,_0x22f98b){var _0x5a0f2d={},_0x2721d2={},_0x417d03={'count':0x0,'rows':[]};var _0x3c9a3a=_[_0xd21f('0x2d')](db[_0xd21f('0x2e')][_0xd21f('0x2f')],function(_0x14fb3c){return{'name':_0x14fb3c['fieldName'],'type':_0x14fb3c[_0xd21f('0x30')]['key']};});_0x2721d2[_0xd21f('0x31')]=_[_0xd21f('0x2d')](_0x3c9a3a,_0xd21f('0x2a'));_0x2721d2[_0xd21f('0x32')]=_['keys'](_0x3a8fcf[_0xd21f('0x32')]);_0x2721d2['filters']=_[_0xd21f('0x33')](_0x2721d2[_0xd21f('0x31')],_0x2721d2['query']);_0x5a0f2d['attributes']=_[_0xd21f('0x33')](_0x2721d2[_0xd21f('0x31')],qs['fields'](_0x3a8fcf[_0xd21f('0x32')]['fields']));_0x5a0f2d[_0xd21f('0x34')]=_0x5a0f2d[_0xd21f('0x34')][_0xd21f('0x35')]?_0x5a0f2d[_0xd21f('0x34')]:_0x2721d2['model'];if(!_0x3a8fcf['query'][_0xd21f('0x36')](_0xd21f('0x37'))){_0x5a0f2d[_0xd21f('0x20')]=qs[_0xd21f('0x20')](_0x3a8fcf[_0xd21f('0x32')][_0xd21f('0x20')]);_0x5a0f2d[_0xd21f('0x1e')]=qs['offset'](_0x3a8fcf[_0xd21f('0x32')]['offset']);}_0x5a0f2d['order']=qs['sort'](_0x3a8fcf[_0xd21f('0x32')]['sort']);_0x5a0f2d[_0xd21f('0x38')]=qs[_0xd21f('0x39')](_[_0xd21f('0x3a')](_0x3a8fcf[_0xd21f('0x32')],_0x2721d2[_0xd21f('0x39')]),_0x3c9a3a);if(_0x3a8fcf[_0xd21f('0x32')]['filter']){_0x5a0f2d['where']=_[_0xd21f('0x3b')](_0x5a0f2d[_0xd21f('0x38')],{'$or':_[_0xd21f('0x2d')](_0x3c9a3a,function(_0x5d01fb){if(_0x5d01fb['type']!=='VIRTUAL'){var _0x3374c0={};_0x3374c0[_0x5d01fb['name']]={'$like':'%'+_0x3a8fcf[_0xd21f('0x32')][_0xd21f('0x3c')]+'%'};return _0x3374c0;}})});}_0x5a0f2d=_[_0xd21f('0x3b')]({},_0x5a0f2d,_0x3a8fcf[_0xd21f('0x3d')]);var _0x270bac={'where':_0x5a0f2d[_0xd21f('0x38')]};return db[_0xd21f('0x2e')][_0xd21f('0x21')](_0x270bac)[_0xd21f('0x3e')](function(_0x3a524e){_0x417d03[_0xd21f('0x21')]=_0x3a524e;if(_0x3a8fcf[_0xd21f('0x32')][_0xd21f('0x3f')]){_0x5a0f2d[_0xd21f('0x40')]=[{'all':!![]}];}return db[_0xd21f('0x2e')][_0xd21f('0x41')](_0x5a0f2d);})['then'](function(_0x237f0a){_0x417d03[_0xd21f('0x42')]=_0x237f0a;return _0x417d03;})[_0xd21f('0x3e')](respondWithFilteredResult(_0x22f98b,_0x5a0f2d))[_0xd21f('0x43')](handleError(_0x22f98b,null));};exports[_0xd21f('0x44')]=function(_0x8665d6,_0x31b217){var _0x118565={'raw':!![],'where':{'id':_0x8665d6['params']['id']}},_0x26e082={};_0x26e082['model']=_[_0xd21f('0x45')](db['WhatsappTransferReport'][_0xd21f('0x2f')]);_0x26e082[_0xd21f('0x32')]=_[_0xd21f('0x45')](_0x8665d6['query']);_0x26e082['filters']=_[_0xd21f('0x33')](_0x26e082[_0xd21f('0x31')],_0x26e082[_0xd21f('0x32')]);_0x118565[_0xd21f('0x34')]=_[_0xd21f('0x33')](_0x26e082[_0xd21f('0x31')],qs[_0xd21f('0x46')](_0x8665d6[_0xd21f('0x32')][_0xd21f('0x46')]));_0x118565[_0xd21f('0x34')]=_0x118565[_0xd21f('0x34')][_0xd21f('0x35')]?_0x118565[_0xd21f('0x34')]:_0x26e082[_0xd21f('0x31')];if(_0x8665d6[_0xd21f('0x32')][_0xd21f('0x3f')]){_0x118565['include']=[{'all':!![]}];}_0x118565=_['merge']({},_0x118565,_0x8665d6[_0xd21f('0x3d')]);return db[_0xd21f('0x2e')][_0xd21f('0x47')](_0x118565)['then'](handleEntityNotFound(_0x31b217,null))[_0xd21f('0x3e')](respondWithResult(_0x31b217,null))[_0xd21f('0x43')](handleError(_0x31b217,null));};exports[_0xd21f('0x48')]=function(_0x307dba,_0x2a2695){return db['WhatsappTransferReport'][_0xd21f('0x48')](_0x307dba[_0xd21f('0x49')],{})['then'](respondWithResult(_0x2a2695,0xc9))['catch'](handleError(_0x2a2695,null));};exports[_0xd21f('0x27')]=function(_0x168544,_0x177ba1){if(_0x168544[_0xd21f('0x49')]['id']){delete _0x168544[_0xd21f('0x49')]['id'];}return db[_0xd21f('0x2e')]['find']({'where':{'id':_0x168544[_0xd21f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x177ba1,null))['then'](saveUpdates(_0x168544[_0xd21f('0x49')],null))[_0xd21f('0x3e')](respondWithResult(_0x177ba1,null))[_0xd21f('0x43')](handleError(_0x177ba1,null));};exports['destroy']=function(_0x2524b0,_0x586b55){return db[_0xd21f('0x2e')]['find']({'where':{'id':_0x2524b0[_0xd21f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x586b55,null))[_0xd21f('0x3e')](removeEntity(_0x586b55,null))[_0xd21f('0x43')](handleError(_0x586b55,null));};exports['describe']=function(_0x3e2f0b,_0x28b485){return db['WhatsappTransferReport'][_0xd21f('0x4b')]()[_0xd21f('0x3e')](respondWithResult(_0x28b485,null))[_0xd21f('0x43')](handleError(_0x28b485,null));}; \ No newline at end of file +var _0xc627=['type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','findAll','catch','show','keys','include','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','end','error','name','map','WhatsappTransferReport','rawAttributes'];(function(_0x224f01,_0x3ef306){var _0x5cd8ce=function(_0x23fd77){while(--_0x23fd77){_0x224f01['push'](_0x224f01['shift']());}};_0x5cd8ce(++_0x3ef306);}(_0xc627,0x1bd));var _0x7c62=function(_0x1e01ae,_0x4e7bc9){_0x1e01ae=_0x1e01ae-0x0;var _0x4ebee2=_0xc627[_0x1e01ae];return _0x4ebee2;};'use strict';var emlformat=require(_0x7c62('0x0'));var rimraf=require(_0x7c62('0x1'));var zipdir=require(_0x7c62('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7c62('0x3'));var BPromise=require(_0x7c62('0x4'));var Mustache=require(_0x7c62('0x5'));var util=require('util');var path=require(_0x7c62('0x6'));var sox=require(_0x7c62('0x7'));var csv=require(_0x7c62('0x8'));var ejs=require(_0x7c62('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7c62('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7c62('0x8'));var querystring=require(_0x7c62('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7c62('0xc'));var as=require(_0x7c62('0xd'));var hardwareService=require(_0x7c62('0xe'));var logger=require(_0x7c62('0xf'))('api');var utils=require(_0x7c62('0x10'));var config=require(_0x7c62('0x11'));var licenseUtil=require(_0x7c62('0x12'));var db=require(_0x7c62('0x13'))['db'];function respondWithStatusCode(_0x4b82c3,_0x28ac5d){_0x28ac5d=_0x28ac5d||0xcc;return function(_0x47268f){if(_0x47268f){return _0x4b82c3[_0x7c62('0x14')](_0x28ac5d);}return _0x4b82c3[_0x7c62('0x15')](_0x28ac5d)['end']();};}function respondWithResult(_0xa3dc24,_0x524602){_0x524602=_0x524602||0xc8;return function(_0x1d8a34){if(_0x1d8a34){return _0xa3dc24[_0x7c62('0x15')](_0x524602)[_0x7c62('0x16')](_0x1d8a34);}};}function respondWithFilteredResult(_0x4e6fc5,_0x287dde){return function(_0x3895c9){if(_0x3895c9){var _0xbcf4e0=typeof _0x287dde[_0x7c62('0x17')]==='undefined'&&typeof _0x287dde[_0x7c62('0x18')]===_0x7c62('0x19');var _0x29d6c5=_0x3895c9[_0x7c62('0x1a')];var _0x150d33=_0xbcf4e0?0x0:_0x287dde[_0x7c62('0x17')];var _0xf41c90=_0xbcf4e0?_0x3895c9['count']:_0x287dde[_0x7c62('0x17')]+_0x287dde['limit'];var _0x116999;if(_0xf41c90>=_0x29d6c5){_0xf41c90=_0x29d6c5;_0x116999=0xc8;}else{_0x116999=0xce;}_0x4e6fc5['status'](_0x116999);return _0x4e6fc5[_0x7c62('0x1b')](_0x7c62('0x1c'),_0x150d33+'-'+_0xf41c90+'/'+_0x29d6c5)['json'](_0x3895c9);}return null;};}function patchUpdates(_0x3b12b9){return function(_0x313c57){try{jsonpatch['apply'](_0x313c57,_0x3b12b9,!![]);}catch(_0x585b8f){return BPromise[_0x7c62('0x1d')](_0x585b8f);}return _0x313c57[_0x7c62('0x1e')]();};}function saveUpdates(_0x4d7653,_0x535638){return function(_0x2bb7c6){if(_0x2bb7c6){return _0x2bb7c6[_0x7c62('0x1f')](_0x4d7653)['then'](function(_0x21d5ad){return _0x21d5ad;});}return null;};}function removeEntity(_0x3b0f79,_0x348ed6){return function(_0x33aaee){if(_0x33aaee){return _0x33aaee['destroy']()['then'](function(){_0x3b0f79['status'](0xcc)[_0x7c62('0x20')]();});}};}function handleEntityNotFound(_0x204337,_0x39d576){return function(_0x48acc6){if(!_0x48acc6){_0x204337[_0x7c62('0x14')](0x194);}return _0x48acc6;};}function handleError(_0x62dadf,_0x308651){_0x308651=_0x308651||0x1f4;return function(_0x2a05f9){logger[_0x7c62('0x21')](_0x2a05f9['stack']);if(_0x2a05f9[_0x7c62('0x22')]){delete _0x2a05f9[_0x7c62('0x22')];}_0x62dadf[_0x7c62('0x15')](_0x308651)['send'](_0x2a05f9);};}exports['index']=function(_0x43a532,_0x43fff9){var _0x5c5e62={},_0x1b068d={},_0x50a928={'count':0x0,'rows':[]};var _0x354de6=_[_0x7c62('0x23')](db[_0x7c62('0x24')][_0x7c62('0x25')],function(_0x13a8ca){return{'name':_0x13a8ca['fieldName'],'type':_0x13a8ca[_0x7c62('0x26')][_0x7c62('0x27')]};});_0x1b068d[_0x7c62('0x28')]=_[_0x7c62('0x23')](_0x354de6,_0x7c62('0x22'));_0x1b068d['query']=_['keys'](_0x43a532[_0x7c62('0x29')]);_0x1b068d[_0x7c62('0x2a')]=_[_0x7c62('0x2b')](_0x1b068d[_0x7c62('0x28')],_0x1b068d[_0x7c62('0x29')]);_0x5c5e62[_0x7c62('0x2c')]=_[_0x7c62('0x2b')](_0x1b068d[_0x7c62('0x28')],qs['fields'](_0x43a532[_0x7c62('0x29')][_0x7c62('0x2d')]));_0x5c5e62[_0x7c62('0x2c')]=_0x5c5e62[_0x7c62('0x2c')][_0x7c62('0x2e')]?_0x5c5e62[_0x7c62('0x2c')]:_0x1b068d[_0x7c62('0x28')];if(!_0x43a532['query'][_0x7c62('0x2f')](_0x7c62('0x30'))){_0x5c5e62['limit']=qs[_0x7c62('0x18')](_0x43a532[_0x7c62('0x29')]['limit']);_0x5c5e62[_0x7c62('0x17')]=qs[_0x7c62('0x17')](_0x43a532[_0x7c62('0x29')]['offset']);}_0x5c5e62[_0x7c62('0x31')]=qs[_0x7c62('0x32')](_0x43a532[_0x7c62('0x29')][_0x7c62('0x32')]);_0x5c5e62[_0x7c62('0x33')]=qs[_0x7c62('0x2a')](_['pick'](_0x43a532[_0x7c62('0x29')],_0x1b068d[_0x7c62('0x2a')]),_0x354de6);if(_0x43a532[_0x7c62('0x29')][_0x7c62('0x34')]){_0x5c5e62[_0x7c62('0x33')]=_[_0x7c62('0x35')](_0x5c5e62['where'],{'$or':_['map'](_0x354de6,function(_0x2483a7){if(_0x2483a7[_0x7c62('0x26')]!==_0x7c62('0x36')){var _0x348c08={};_0x348c08[_0x2483a7['name']]={'$like':'%'+_0x43a532['query']['filter']+'%'};return _0x348c08;}})});}_0x5c5e62=_[_0x7c62('0x35')]({},_0x5c5e62,_0x43a532[_0x7c62('0x37')]);var _0x294c63={'where':_0x5c5e62['where']};return db[_0x7c62('0x24')][_0x7c62('0x1a')](_0x294c63)[_0x7c62('0x38')](function(_0x5a5c51){_0x50a928[_0x7c62('0x1a')]=_0x5a5c51;if(_0x43a532[_0x7c62('0x29')][_0x7c62('0x39')]){_0x5c5e62['include']=[{'all':!![]}];}return db[_0x7c62('0x24')][_0x7c62('0x3a')](_0x5c5e62);})[_0x7c62('0x38')](function(_0x42a9f3){_0x50a928['rows']=_0x42a9f3;return _0x50a928;})[_0x7c62('0x38')](respondWithFilteredResult(_0x43fff9,_0x5c5e62))[_0x7c62('0x3b')](handleError(_0x43fff9,null));};exports[_0x7c62('0x3c')]=function(_0xc76305,_0x37bc2a){var _0x4622ec={'raw':!![],'where':{'id':_0xc76305['params']['id']}},_0x4c4af4={};_0x4c4af4[_0x7c62('0x28')]=_[_0x7c62('0x3d')](db[_0x7c62('0x24')]['rawAttributes']);_0x4c4af4[_0x7c62('0x29')]=_[_0x7c62('0x3d')](_0xc76305[_0x7c62('0x29')]);_0x4c4af4[_0x7c62('0x2a')]=_[_0x7c62('0x2b')](_0x4c4af4['model'],_0x4c4af4['query']);_0x4622ec[_0x7c62('0x2c')]=_['intersection'](_0x4c4af4[_0x7c62('0x28')],qs[_0x7c62('0x2d')](_0xc76305[_0x7c62('0x29')][_0x7c62('0x2d')]));_0x4622ec[_0x7c62('0x2c')]=_0x4622ec[_0x7c62('0x2c')][_0x7c62('0x2e')]?_0x4622ec[_0x7c62('0x2c')]:_0x4c4af4[_0x7c62('0x28')];if(_0xc76305[_0x7c62('0x29')][_0x7c62('0x39')]){_0x4622ec[_0x7c62('0x3e')]=[{'all':!![]}];}_0x4622ec=_[_0x7c62('0x35')]({},_0x4622ec,_0xc76305[_0x7c62('0x37')]);return db[_0x7c62('0x24')][_0x7c62('0x3f')](_0x4622ec)[_0x7c62('0x38')](handleEntityNotFound(_0x37bc2a,null))['then'](respondWithResult(_0x37bc2a,null))[_0x7c62('0x3b')](handleError(_0x37bc2a,null));};exports['create']=function(_0x46d752,_0x4be1c8){return db['WhatsappTransferReport'][_0x7c62('0x40')](_0x46d752[_0x7c62('0x41')],{})[_0x7c62('0x38')](respondWithResult(_0x4be1c8,0xc9))[_0x7c62('0x3b')](handleError(_0x4be1c8,null));};exports[_0x7c62('0x1f')]=function(_0x33052a,_0x2b0c8c){if(_0x33052a['body']['id']){delete _0x33052a['body']['id'];}return db[_0x7c62('0x24')][_0x7c62('0x3f')]({'where':{'id':_0x33052a[_0x7c62('0x42')]['id']}})[_0x7c62('0x38')](handleEntityNotFound(_0x2b0c8c,null))[_0x7c62('0x38')](saveUpdates(_0x33052a[_0x7c62('0x41')],null))[_0x7c62('0x38')](respondWithResult(_0x2b0c8c,null))[_0x7c62('0x3b')](handleError(_0x2b0c8c,null));};exports[_0x7c62('0x43')]=function(_0x4c5821,_0x4566c5){return db[_0x7c62('0x24')][_0x7c62('0x3f')]({'where':{'id':_0x4c5821[_0x7c62('0x42')]['id']}})['then'](handleEntityNotFound(_0x4566c5,null))[_0x7c62('0x38')](removeEntity(_0x4566c5,null))[_0x7c62('0x3b')](handleError(_0x4566c5,null));};exports[_0x7c62('0x44')]=function(_0x509a8c,_0x47819f){return db[_0x7c62('0x24')]['describe']()[_0x7c62('0x38')](respondWithResult(_0x47819f,null))[_0x7c62('0x3b')](handleError(_0x47819f,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index e61414f..a0a3b88 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 _0x547e=['lodash','../../config/logger','moment','bluebird','path','rimraf','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid'];(function(_0x53d8c6,_0x4bfd84){var _0x6149d3=function(_0x5338e9){while(--_0x5338e9){_0x53d8c6['push'](_0x53d8c6['shift']());}};_0x6149d3(++_0x4bfd84);}(_0x547e,0x1c3));var _0xe547=function(_0x7f97a0,_0x41a1f1){_0x7f97a0=_0x7f97a0-0x0;var _0x17721a=_0x547e[_0x7f97a0];return _0x17721a;};'use strict';var _=require(_0xe547('0x0'));var util=require('util');var logger=require(_0xe547('0x1'))('api');var moment=require(_0xe547('0x2'));var BPromise=require(_0xe547('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe547('0x4'));var rimraf=require(_0xe547('0x5'));var config=require('../../config/environment');var attributes=require(_0xe547('0x6'));module[_0xe547('0x7')]=function(_0x31212c,_0x44dbcb){return _0x31212c[_0xe547('0x8')]('WhatsappTransferReport',attributes,{'tableName':_0xe547('0x9'),'paranoid':![],'indexes':[{'name':_0xe547('0xa'),'fields':[_0xe547('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3664=['lodash','util','../../config/logger','moment','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid'];(function(_0x79bc73,_0x1ba45b){var _0x260252=function(_0x4770f8){while(--_0x4770f8){_0x79bc73['push'](_0x79bc73['shift']());}};_0x260252(++_0x1ba45b);}(_0x3664,0x8f));var _0x4366=function(_0x2079c3,_0x3ddf3f){_0x2079c3=_0x2079c3-0x0;var _0x1b280b=_0x3664[_0x2079c3];return _0x1b280b;};'use strict';var _=require(_0x4366('0x0'));var util=require(_0x4366('0x1'));var logger=require(_0x4366('0x2'))('api');var moment=require(_0x4366('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4366('0x4'));var config=require(_0x4366('0x5'));var attributes=require(_0x4366('0x6'));module[_0x4366('0x7')]=function(_0x524d44,_0x4b63a7){return _0x524d44['define'](_0x4366('0x8'),attributes,{'tableName':_0x4366('0x9'),'paranoid':![],'indexes':[{'name':_0x4366('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 0d6bf06..3467857 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 _0x2100=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird'];(function(_0x25483f,_0x43852f){var _0x220d13=function(_0x4a5779){while(--_0x4a5779){_0x25483f['push'](_0x25483f['shift']());}};_0x220d13(++_0x43852f);}(_0x2100,0xb2));var _0x0210=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0x2100[_0x4da356];return _0x321b07;};'use strict';var _=require(_0x0210('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0210('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0210('0x2'));var db=require(_0x0210('0x3'))['db'];var utils=require(_0x0210('0x4'));var logger=require('../../config/logger')(_0x0210('0x5'));var config=require(_0x0210('0x6'));var jayson=require(_0x0210('0x7'));var client=jayson[_0x0210('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c9915,_0x1a62d4,_0x20a0b4){return new BPromise(function(_0x3bb0b2,_0x2e0ef8){return client[_0x0210('0x9')](_0x1c9915,_0x20a0b4)[_0x0210('0xa')](function(_0x2d5064){logger[_0x0210('0xb')](_0x0210('0xc'),_0x1a62d4,_0x0210('0xd'));logger['debug'](_0x0210('0xe'),_0x1a62d4,_0x0210('0xd'),JSON[_0x0210('0xf')](_0x2d5064));if(_0x2d5064[_0x0210('0x10')]){if(_0x2d5064['error'][_0x0210('0x11')]===0x1f4){logger['error'](_0x0210('0xc'),_0x1a62d4,_0x2d5064[_0x0210('0x10')]['message']);return _0x2e0ef8(_0x2d5064[_0x0210('0x10')][_0x0210('0x12')]);}logger['error'](_0x0210('0xc'),_0x1a62d4,_0x2d5064[_0x0210('0x10')][_0x0210('0x12')]);return _0x3bb0b2(_0x2d5064['error']['message']);}else{logger[_0x0210('0xb')](_0x0210('0xc'),_0x1a62d4,_0x0210('0xd'));_0x3bb0b2(_0x2d5064[_0x0210('0x13')][_0x0210('0x12')]);}})['catch'](function(_0x461b9a){logger[_0x0210('0x10')](_0x0210('0xc'),_0x1a62d4,_0x461b9a);_0x2e0ef8(_0x461b9a);});});} \ No newline at end of file +var _0x118f=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x118f,0x102));var _0xf118=function(_0x3b0449,_0x14bba6){_0x3b0449=_0x3b0449-0x0;var _0x3e7b06=_0x118f[_0x3b0449];return _0x3e7b06;};'use strict';var _=require(_0xf118('0x0'));var util=require(_0xf118('0x1'));var moment=require(_0xf118('0x2'));var BPromise=require(_0xf118('0x3'));var rs=require(_0xf118('0x4'));var fs=require('fs');var Redis=require(_0xf118('0x5'));var db=require(_0xf118('0x6'))['db'];var utils=require(_0xf118('0x7'));var logger=require(_0xf118('0x8'))('rpc');var config=require(_0xf118('0x9'));var jayson=require(_0xf118('0xa'));var client=jayson[_0xf118('0xb')][_0xf118('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e3473,_0x35da40,_0x57a26a){return new BPromise(function(_0x3f8439,_0x3b9b0c){return client['request'](_0x3e3473,_0x57a26a)[_0xf118('0xd')](function(_0x2635cb){logger[_0xf118('0xe')](_0xf118('0xf'),_0x35da40,_0xf118('0x10'));logger[_0xf118('0x11')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x35da40,_0xf118('0x10'),JSON[_0xf118('0x12')](_0x2635cb));if(_0x2635cb[_0xf118('0x13')]){if(_0x2635cb['error']['code']===0x1f4){logger[_0xf118('0x13')](_0xf118('0xf'),_0x35da40,_0x2635cb[_0xf118('0x13')]['message']);return _0x3b9b0c(_0x2635cb[_0xf118('0x13')][_0xf118('0x14')]);}logger[_0xf118('0x13')](_0xf118('0xf'),_0x35da40,_0x2635cb[_0xf118('0x13')][_0xf118('0x14')]);return _0x3f8439(_0x2635cb['error']['message']);}else{logger[_0xf118('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x35da40,_0xf118('0x10'));_0x3f8439(_0x2635cb['result']['message']);}})[_0xf118('0x15')](function(_0x4d552c){logger[_0xf118('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x35da40,_0x4d552c);_0x3b9b0c(_0x4d552c);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 49421eb..39e5430 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ec6=['number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','Offline\x20apps:','status','join','None','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','seedDB','default','then','listen','info','start','filter','exitCode'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x380178,_0x18cc9d){_0x380178=_0x380178-0x0;var _0x5a2fa5=_0x0ec6[_0x380178];return _0x5a2fa5;};'use strict';var _=require(_0x60ec('0x0'));var db=require('./mysqldb')['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x60ec('0x1'));var rpc=require(_0x60ec('0x2'));var config=require(_0x60ec('0x3'));var logger=require(_0x60ec('0x4'))(_0x60ec('0x5'));var pm2=require(_0x60ec('0x6'));var pm2Config=require(_0x60ec('0x7'));var schedule=require('./config/schedule');var chat=require(_0x60ec('0x8'));var whatsapp=require(_0x60ec('0x9'));var transcribe=require(_0x60ec('0xa'));var provider=require(_0x60ec('0xb'));function main(){return db['sequelize'][_0x60ec('0xc')]()['then'](function(){if(config[_0x60ec('0xd')]){return seedDb[_0x60ec('0xe')]();}})[_0x60ec('0xf')](function(){return checkLicense[_0x60ec('0xe')]();})[_0x60ec('0xf')](function(){return rpc[_0x60ec('0x10')]();})['then'](function(_0x49fe3b){logger[_0x60ec('0x11')](_0x49fe3b);return chat[_0x60ec('0x12')]();})[_0x60ec('0xf')](function(){return whatsapp[_0x60ec('0x12')]();})[_0x60ec('0xf')](function(){return schedule['start']();})['then'](function(){return transcribe[_0x60ec('0x12')]();})[_0x60ec('0xf')](function(){return provider[_0x60ec('0x12')]();})[_0x60ec('0xf')](function(_0x34c615){logger['info'](_0x34c615);return pm2[_0x60ec('0x12')](pm2Config);})[_0x60ec('0xf')](function(_0x22fdb1){var _0x15045c=_0x22fdb1[_0x60ec('0x13')](function(_0x23298f){return typeof _0x23298f[_0x60ec('0x14')]===_0x60ec('0x15')&&_0x23298f[_0x60ec('0x14')]>=0x0;});if(_0x15045c['length']>0x0){throw new Error(_0x15045c[_0x60ec('0x16')]+_0x60ec('0x17')+_[_0x60ec('0x18')](_0x15045c,function(_0x155bdc){return'\x22'+_0x155bdc[_0x60ec('0x19')][_0x60ec('0x1a')]+'\x22';}));}logger[_0x60ec('0x11')](_0x60ec('0x1b'),_[_0x60ec('0x18')](_[_0x60ec('0x13')](_0x22fdb1,{'status':_0x60ec('0x1c')}),_0x60ec('0x1a'))['join']());logger[_0x60ec('0x11')](_0x60ec('0x1d'),_[_0x60ec('0x18')](_[_0x60ec('0x13')](_0x22fdb1,function(_0x5cace8){return _0x5cace8[_0x60ec('0x1e')]!==_0x60ec('0x1c');}),_0x60ec('0x1a'))[_0x60ec('0x1f')]()||_0x60ec('0x20'));console[_0x60ec('0x21')]('App\x20Ready!');})['catch'](function(_0x588b66){console[_0x60ec('0x21')](_0x60ec('0x22'),_0x588b66);logger[_0x60ec('0x23')](_0x60ec('0x24'),_0x588b66);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x6075=['app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','then','seedDB','default','listen','info','start','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','online','join','Offline\x20apps:','status','None','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger'];(function(_0xa88b33,_0x1c561c){var _0x1daa3c=function(_0x340270){while(--_0x340270){_0xa88b33['push'](_0xa88b33['shift']());}};_0x1daa3c(++_0x1c561c);}(_0x6075,0x191));var _0x5607=function(_0xa76581,_0x322fd6){_0xa76581=_0xa76581-0x0;var _0x2b4914=_0x6075[_0xa76581];return _0x2b4914;};'use strict';var _=require('lodash');var db=require(_0x5607('0x0'))['db'];var seedDb=require(_0x5607('0x1'));var checkLicense=require(_0x5607('0x2'));var rpc=require(_0x5607('0x3'));var config=require(_0x5607('0x4'));var logger=require(_0x5607('0x5'))(_0x5607('0x6'));var pm2=require(_0x5607('0x7'));var pm2Config=require(_0x5607('0x8'));var schedule=require('./config/schedule');var chat=require(_0x5607('0x9'));var whatsapp=require(_0x5607('0xa'));var transcribe=require(_0x5607('0xb'));var provider=require('./config/schedule/cloud-provider');function main(){return db['sequelize'][_0x5607('0xc')]()[_0x5607('0xd')](function(){if(config[_0x5607('0xe')]){return seedDb[_0x5607('0xf')]();}})[_0x5607('0xd')](function(){return checkLicense['default']();})[_0x5607('0xd')](function(){return rpc[_0x5607('0x10')]();})[_0x5607('0xd')](function(_0x4ea43b){logger[_0x5607('0x11')](_0x4ea43b);return chat['start']();})['then'](function(){return whatsapp[_0x5607('0x12')]();})[_0x5607('0xd')](function(){return schedule[_0x5607('0x12')]();})['then'](function(){return transcribe[_0x5607('0x12')]();})[_0x5607('0xd')](function(){return provider[_0x5607('0x12')]();})[_0x5607('0xd')](function(_0xe6368d){logger[_0x5607('0x11')](_0xe6368d);return pm2[_0x5607('0x12')](pm2Config);})[_0x5607('0xd')](function(_0x2daf4c){var _0x4e1167=_0x2daf4c[_0x5607('0x13')](function(_0x275c5d){return typeof _0x275c5d[_0x5607('0x14')]==='number'&&_0x275c5d['exitCode']>=0x0;});if(_0x4e1167[_0x5607('0x15')]>0x0){throw new Error(_0x4e1167['length']+_0x5607('0x16')+_[_0x5607('0x17')](_0x4e1167,function(_0x1fa238){return'\x22'+_0x1fa238[_0x5607('0x18')][_0x5607('0x19')]+'\x22';}));}logger[_0x5607('0x11')]('Online\x20apps:',_[_0x5607('0x17')](_['filter'](_0x2daf4c,{'status':_0x5607('0x1a')}),_0x5607('0x19'))[_0x5607('0x1b')]());logger['info'](_0x5607('0x1c'),_[_0x5607('0x17')](_[_0x5607('0x13')](_0x2daf4c,function(_0x4e66f0){return _0x4e66f0[_0x5607('0x1d')]!==_0x5607('0x1a');}),_0x5607('0x19'))['join']()||_0x5607('0x1e'));console['log']('App\x20Ready!');})[_0x5607('0x1f')](function(_0x564ba2){console[_0x5607('0x20')](_0x5607('0x21'),_0x564ba2);logger[_0x5607('0x22')](_0x5607('0x23'),_0x564ba2);process[_0x5607('0x24')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 5260474..8452d86 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 _0x8f4c=['randomBytes','toString','hex','floor','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','bluebird','session','fullname','name','internal','email','userpic','md5secret','voicePause','chatPause','mailPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','user','findOne','closed','then','status','disposition','unmanaged','json','Unmanaged.','catch','use','headers','startsWith','User','find','authenticate','pass','Wrong\x20credentials.','Bearer','query','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','User\x20object\x20not\x20found.','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','promisify','sign','secret','secrets','options','verify'];(function(_0x9c7b10,_0x198ee2){var _0x3ca6b6=function(_0x2d46db){while(--_0x2d46db){_0x9c7b10['push'](_0x9c7b10['shift']());}};_0x3ca6b6(++_0x198ee2);}(_0x8f4c,0x113));var _0xc8f4=function(_0x488163,_0x51204f){_0x488163=_0x488163-0x0;var _0x1ba13b=_0x8f4c[_0x488163];return _0x1ba13b;};'use strict';var db=require(_0xc8f4('0x0'))['db'];var config=require(_0xc8f4('0x1'));var hardwareConf=require(_0xc8f4('0x2'));var licenseUtil=require(_0xc8f4('0x3'));var encryptor=require(_0xc8f4('0x4'));var _=require(_0xc8f4('0x5'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xc8f4('0x6'));var compose=require(_0xc8f4('0x7'));var basicAuth=require(_0xc8f4('0x8'));var crypto=require('crypto');var BPromise=require(_0xc8f4('0x9'));var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config['secrets'][_0xc8f4('0xa')]});var userAttributes=['id','role',_0xc8f4('0xb'),_0xc8f4('0xc'),_0xc8f4('0xd'),_0xc8f4('0xe'),_0xc8f4('0xf'),'permissions',_0xc8f4('0x10'),_0xc8f4('0x11'),_0xc8f4('0x12'),_0xc8f4('0x13'),'faxPause',_0xc8f4('0x14'),'openchannelPause',_0xc8f4('0x15'),_0xc8f4('0x16'),_0xc8f4('0x17'),_0xc8f4('0x18'),_0xc8f4('0x19'),'allowmessenger',_0xc8f4('0x1a'),_0xc8f4('0x1b'),_0xc8f4('0x1c'),_0xc8f4('0x1d'),_0xc8f4('0x1e'),_0xc8f4('0x1f'),'phoneBarEnableDtmfTone',_0xc8f4('0x20'),_0xc8f4('0x21'),_0xc8f4('0x22'),_0xc8f4('0x23'),_0xc8f4('0x24'),'hotdesk',_0xc8f4('0x25'),'userProfileId','privacyEnabled',_0xc8f4('0x26'),_0xc8f4('0x27'),_0xc8f4('0x28'),_0xc8f4('0x29'),_0xc8f4('0x2a'),_0xc8f4('0x2b'),_0xc8f4('0x2c'),_0xc8f4('0x2d'),_0xc8f4('0x2e'),_0xc8f4('0x2f'),_0xc8f4('0x30'),_0xc8f4('0x31'),_0xc8f4('0x32'),'openchannelAutoanswer',_0xc8f4('0x33'),_0xc8f4('0x34'),_0xc8f4('0x35'),_0xc8f4('0x36'),_0xc8f4('0x37'),_0xc8f4('0x38')];exports[_0xc8f4('0x39')]=function(){return this[_0xc8f4('0x3a')](!![])['use'](function(_0x4463aa,_0x205c41,_0x3195ff){if(_0x4463aa[_0xc8f4('0x3b')]){_0x3195ff();}else{return db['ChatInteraction'][_0xc8f4('0x3c')]({'where':{'id':_0x4463aa['params']['id']},'attributes':['id',_0xc8f4('0x3d'),'disposition'],'raw':!![]})[_0xc8f4('0x3e')](function(_0x3dd717){if(_0x3dd717&&_0x3dd717['closed']){return _0x205c41[_0xc8f4('0x3f')](_0x3dd717[_0xc8f4('0x40')]===_0xc8f4('0x41')?0x195:0x193)[_0xc8f4('0x42')]({'message':_0x3dd717['disposition']===_0xc8f4('0x41')?_0xc8f4('0x43'):'Forbidden.'});}else{_0x3195ff();}})[_0xc8f4('0x44')](function(_0x37957c){_0x3195ff(_0x37957c);});}});};exports[_0xc8f4('0x3a')]=function isAuthenticated(_0x1b70bc){return compose()[_0xc8f4('0x45')](function(_0x385e41,_0x4a25da,_0x45f972){var _0x24bb78;if(_0x385e41[_0xc8f4('0x46')]['authorization']){if(_[_0xc8f4('0x47')](_0x385e41[_0xc8f4('0x46')]['authorization'],'Basic')){var _0x4d6c43=basicAuth(_0x385e41);db[_0xc8f4('0x48')][_0xc8f4('0x49')]({'where':{'name':_0x4d6c43[_0xc8f4('0xc')]}})[_0xc8f4('0x3e')](function(_0x273e73){if(!_0x273e73||!_0x273e73[_0xc8f4('0x4a')](_0x4d6c43[_0xc8f4('0x4b')])){return _0x4a25da[_0xc8f4('0x3f')](0x191)['json']({'message':_0xc8f4('0x4c')});}_0x385e41[_0xc8f4('0x3b')]={'id':_0x273e73['id']};_0x45f972();})[_0xc8f4('0x44')](function(_0x5cb6ce){_0x45f972(_0x5cb6ce);});}else if(_[_0xc8f4('0x47')](_0x385e41[_0xc8f4('0x46')]['authorization'],_0xc8f4('0x4d'))){validateJwt(_0x385e41,_0x4a25da,_0x45f972);}else{if(_0x1b70bc){_0x45f972();}else{return _0x4a25da[_0xc8f4('0x3f')](0x193)[_0xc8f4('0x42')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x385e41[_0xc8f4('0x4e')][_0xc8f4('0x4f')]){try{var _0x126731={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xc8f4('0x50')]()};verifyJwt(_0x385e41[_0xc8f4('0x4e')][_0xc8f4('0x4f')],_0x126731)[_0xc8f4('0x3e')](function(_0x215203){return db[_0xc8f4('0x48')][_0xc8f4('0x49')]({'where':{'id':_0x215203[_0xc8f4('0x51')]}})[_0xc8f4('0x3e')](function(_0x2b0ee1){_0x24bb78=_0x2b0ee1;return db[_0xc8f4('0x52')][_0xc8f4('0x3c')]({'where':{'id':0x1},'attributes':[_0xc8f4('0x53'),_0xc8f4('0x54')],'raw':!![]});})[_0xc8f4('0x3e')](function(_0x453640){if(!_0x24bb78||!_['isEqual'](_0x24bb78[_0xc8f4('0x55')],_0x215203['nonce'])){return _0x4a25da[_0xc8f4('0x3f')](0x191)['json']({'message':_0xc8f4('0x56')});}if(_0x24bb78[_0xc8f4('0x57')]){return _0x4a25da[_0xc8f4('0x3f')](0x191)[_0xc8f4('0x42')]({'message':_0xc8f4('0x58')});}if(_0x24bb78[_0xc8f4('0x59')]){if(_0x453640[_0xc8f4('0x54')]>0x0){if(moment(_0x24bb78['blockedAt'])[_0xc8f4('0x5a')](_0x453640[_0xc8f4('0x54')],_0xc8f4('0x5b'))>moment()){return _0x4a25da[_0xc8f4('0x3f')](0x191)['json']({'message':_0xc8f4('0x58')});}}else{return _0x4a25da[_0xc8f4('0x3f')](0x191)[_0xc8f4('0x42')]({'message':_0xc8f4('0x58')});}}_0x385e41[_0xc8f4('0x3b')]={'id':_0x24bb78['id']};_0x45f972();});})[_0xc8f4('0x44')](function(){return _0x4a25da[_0xc8f4('0x3f')](0x191)[_0xc8f4('0x42')]({'message':_0xc8f4('0x58')});});}catch(_0x30478d){_0x45f972(_0x30478d);}}else if(_0x1b70bc){_0x45f972();}else{return _0x4a25da[_0xc8f4('0x3f')](0x193)[_0xc8f4('0x42')]({'message':'Unknown\x20authorization\x20format'});}})[_0xc8f4('0x45')](function(_0x32e067,_0x405597,_0x275f4a){if(_0x32e067['user']){db['User'][_0xc8f4('0x49')]({'where':{'id':_0x32e067[_0xc8f4('0x3b')]['id']},'attributes':userAttributes})['then'](function(_0x1c0f2e){if(!_0x1c0f2e){return _0x405597[_0xc8f4('0x3f')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x32e067[_0xc8f4('0x3b')]=_0x1c0f2e;_0x275f4a();})[_0xc8f4('0x44')](function(_0x3353f6){_0x275f4a(_0x3353f6);});}else if(_0x1b70bc){_0x275f4a();}else{return _0x405597[_0xc8f4('0x3f')](0x194)[_0xc8f4('0x42')]({'message':_0xc8f4('0x5c')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x705792,_0x8c82a5,_0x28b4d6){return licenseUtil['getLicense']()['then'](function(_0x5a1a99){if(_0x5a1a99['update']){_0x28b4d6();}else{return _0x8c82a5['status'](0x193)[_0xc8f4('0x42')]({'message':_0xc8f4('0x5d')});}})[_0xc8f4('0x44')](function(_0x2781b5){_0x28b4d6(_0x2781b5);});});};exports[_0xc8f4('0x5e')]=function isWebrtcLicence(){return compose()[_0xc8f4('0x45')](function(_0x511129,_0xdd7c1a,_0x33b7ac){return licenseUtil['getLicense']()['then'](function(_0x724f47){if(_0x724f47[_0xc8f4('0x5f')]){_0x33b7ac();}else{return _0xdd7c1a[_0xc8f4('0x3f')](0x193)[_0xc8f4('0x42')]({'message':'Forbidden'});}})['catch'](function(_0xe1dd97){_0x33b7ac(_0xe1dd97);});});};exports[_0xc8f4('0x60')]=function(_0x162316,_0x2bc4db,_0x141f81){_0x162316[_0xc8f4('0x60')]=!![];return _0x141f81();};exports['signToken']=function signToken(_0x5e998e){return signJwt(_0x5e998e);};exports[_0xc8f4('0x61')]=function(_0x447473,_0x199b7d){if(!_0x447473[_0xc8f4('0x3b')]){return _0x199b7d[_0xc8f4('0x3f')](0x194)[_0xc8f4('0x42')]({'message':_0xc8f4('0x62')});}var _0x1798a1={'payload':{'id':_0x447473[_0xc8f4('0x3b')]['id'],'role':_0x447473['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x1798a1)[_0xc8f4('0x3e')](function(_0xc11ff5){_0x199b7d[_0xc8f4('0x63')](_0xc8f4('0x64'),_0xc11ff5);_0x199b7d[_0xc8f4('0x65')](_0xc8f4('0x66'));})[_0xc8f4('0x44')](function(_0x36c304){return _0x199b7d[_0xc8f4('0x3f')](0x1f4)[_0xc8f4('0x67')](_0x36c304);});};exports[_0xc8f4('0x68')]=function(_0x3bca90){if(_[_0xc8f4('0x69')](_0x3bca90['apiKeyNonce'])||_[_0xc8f4('0x69')](_0x3bca90[_0xc8f4('0x6a')])){return null;}else{return createJwt(_0x3bca90);}};exports[_0xc8f4('0x6b')]=function(_0x1602d3){_0x1602d3['apiKeyNonce']=generateNonce();_0x1602d3[_0xc8f4('0x6a')]=generateIssuedAt();return createJwt(_0x1602d3);};exports[_0xc8f4('0x6c')]=function(_0x4b4de3,_0x47995c){var _0x405391=_0x4b4de3['query'][_0xc8f4('0x4f')];if(_0x405391){var _0x29f8f4={'nonce':_0x47995c[_0xc8f4('0x55')],'iat':_0x47995c[_0xc8f4('0x6a')],'audience':hardwareConf[_0xc8f4('0x50')](),'issuer':hardwareConf[_0xc8f4('0x50')]()};return verifyJwt(_0x405391,_0x29f8f4)[_0xc8f4('0x3e')](function(){return generateApiKey(_0x47995c);});}else{throw{'message':_0xc8f4('0x6d')};}};exports[_0xc8f4('0x6e')]=function(_0x305edb){var _0x408d56=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x408d56['test'](_0x305edb))throw new db[(_0xc8f4('0x6f'))][(_0xc8f4('0x70'))](_0xc8f4('0x71'));return;};exports[_0xc8f4('0x72')]=function(_0x4f4b35,_0x423431,_0x4f3e41){var _0x5b52f7=encryptor[_0xc8f4('0x73')](_0x423431)[_0xc8f4('0x74')](',');for(var _0x192bbc=0x0;_0x192bbc<_0x4f3e41;_0x192bbc++){if(!_0x5b52f7[_0x192bbc])break;if(_0x4f4b35[_0xc8f4('0x75')]()===_0x5b52f7[_0x192bbc][_0xc8f4('0x75')]()){var _0x23023d=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x4f3e41);if(_0x4f3e41===0x1){_0x23023d=_0xc8f4('0x76');}throw new db[(_0xc8f4('0x6f'))][(_0xc8f4('0x70'))](_0x23023d);}}return;};exports[_0xc8f4('0x77')]=function(_0x25369e,_0x19a024){var _0x443148=_0x19a024?encryptor['decryptString'](_0x19a024)[_0xc8f4('0x74')](','):[];if(_0x443148[_0xc8f4('0x78')]===0x5){_0x443148['splice'](-0x1,0x1);}_0x443148[_0xc8f4('0x79')](_0x25369e);return encryptor[_0xc8f4('0x7a')](_0x443148[_0xc8f4('0x7b')](','));};function signJwt(_0x5b8bf4){var _0x368798=BPromise[_0xc8f4('0x7c')](jwt[_0xc8f4('0x7d')],{'context':jwt});var _0x4d05cb=_0x5b8bf4[_0xc8f4('0x7e')]||config[_0xc8f4('0x7f')]['session'];return new BPromise(function(_0x52e295,_0x3a44bc){_0x368798(_0x5b8bf4['payload'],_0x4d05cb,_0x5b8bf4[_0xc8f4('0x80')])[_0xc8f4('0x3e')](function(_0x5694eb){_0x52e295(_0x5694eb);})['catch'](function(_0x57ad51){_0x3a44bc(_0x57ad51);});});}function verifyJwt(_0x490b8b,_0x4b619c,_0x4f66d1){var _0x32665c=BPromise['promisify'](jwt[_0xc8f4('0x81')],{'context':jwt});var _0x357e45=_0x4f66d1||config[_0xc8f4('0x7f')][_0xc8f4('0xa')];return new BPromise(function(_0x5ea840,_0x3f2596){_0x32665c(_0x490b8b,_0x357e45,_0x4b619c)[_0xc8f4('0x3e')](function(_0x3ca2ca){_0x5ea840(_0x3ca2ca);})[_0xc8f4('0x44')](function(_0x4ae72e){_0x3f2596(_0x4ae72e);});});}function generateNonce(){return crypto[_0xc8f4('0x82')](0x10)[_0xc8f4('0x83')](_0xc8f4('0x84'));}function generateIssuedAt(){return Math[_0xc8f4('0x85')](Date['now']()/0x3e8)[_0xc8f4('0x83')]();}function createJwt(_0x196231){var _0x4f2bf9={'payload':{'iat':_0x196231[_0xc8f4('0x6a')],'nonce':_0x196231[_0xc8f4('0x55')]},'options':{'algorithm':_0xc8f4('0x86'),'subject':_0x196231['id'][_0xc8f4('0x83')](),'issuer':hardwareConf[_0xc8f4('0x50')](),'audience':hardwareConf[_0xc8f4('0x50')]()}};return signJwt(_0x4f2bf9)['then'](function(_0xc0422a){return{'iat':_0x196231[_0xc8f4('0x6a')],'nonce':_0x196231[_0xc8f4('0x55')],'token':_0xc0422a};});} \ No newline at end of file +var _0x3423=['session','role','fullname','name','internal','email','md5secret','smsPause','openchannelPause','showWebBar','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswer','messengerSoundNotification','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','json','Forbidden.','catch','headers','authorization','startsWith','Basic','User','then','authenticate','pass','status','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','find','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','retrieveApiKey','apiKeyNonce','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','split','length','splice','unshift','encryptString','join','promisify','secret','payload','options','verify','randomBytes','floor','now','toString','HS512','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets'];(function(_0x1ff5d9,_0x2980be){var _0x5f3fc8=function(_0x7179ef){while(--_0x7179ef){_0x1ff5d9['push'](_0x1ff5d9['shift']());}};_0x5f3fc8(++_0x2980be);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require(_0x3342('0x0'));var licenseUtil=require(_0x3342('0x1'));var encryptor=require(_0x3342('0x2'));var _=require(_0x3342('0x3'));var jwt=require(_0x3342('0x4'));var expressJwt=require(_0x3342('0x5'));var compose=require(_0x3342('0x6'));var basicAuth=require(_0x3342('0x7'));var crypto=require(_0x3342('0x8'));var BPromise=require(_0x3342('0x9'));var util=require(_0x3342('0xa'));var moment=require(_0x3342('0xb'));var validateJwt=expressJwt({'secret':config[_0x3342('0xc')][_0x3342('0xd')]});var userAttributes=['id',_0x3342('0xe'),_0x3342('0xf'),_0x3342('0x10'),_0x3342('0x11'),_0x3342('0x12'),'userpic','permissions',_0x3342('0x13'),'voicePause','chatPause','mailPause','faxPause',_0x3342('0x14'),_0x3342('0x15'),'pauseType',_0x3342('0x16'),'lastLoginAt',_0x3342('0x17'),_0x3342('0x18'),'allowmessenger',_0x3342('0x19'),_0x3342('0x1a'),_0x3342('0x1b'),_0x3342('0x1c'),_0x3342('0x1d'),_0x3342('0x1e'),_0x3342('0x1f'),'phoneBarEnableSettings',_0x3342('0x20'),_0x3342('0x21'),'phoneBarRemoteControl',_0x3342('0x22'),_0x3342('0x23'),'interface','userProfileId',_0x3342('0x24'),_0x3342('0x25'),_0x3342('0x26'),_0x3342('0x27'),_0x3342('0x28'),_0x3342('0x29'),_0x3342('0x2a'),_0x3342('0x2b'),_0x3342('0x2c'),'chatAutoanswerDelay',_0x3342('0x2d'),_0x3342('0x2e'),_0x3342('0x2f'),'smsAutoanswerDelay',_0x3342('0x30'),_0x3342('0x31'),'faxAutoanswer',_0x3342('0x32'),_0x3342('0x33'),'whatsappAutoanswerDelay',_0x3342('0x34')];exports['isChatInteractionAuthorized']=function(){return this[_0x3342('0x35')](!![])[_0x3342('0x36')](function(_0xa23053,_0x2dbad1,_0xd2b87d){if(_0xa23053[_0x3342('0x37')]){_0xd2b87d();}else{return db[_0x3342('0x38')][_0x3342('0x39')]({'where':{'id':_0xa23053['params']['id']},'attributes':['id',_0x3342('0x3a'),'disposition'],'raw':!![]})['then'](function(_0x986ab0){if(_0x986ab0&&_0x986ab0['closed']){return _0x2dbad1['status'](_0x986ab0[_0x3342('0x3b')]==='unmanaged'?0x195:0x193)[_0x3342('0x3c')]({'message':_0x986ab0['disposition']==='unmanaged'?'Unmanaged.':_0x3342('0x3d')});}else{_0xd2b87d();}})[_0x3342('0x3e')](function(_0x1dd607){_0xd2b87d(_0x1dd607);});}});};exports['isAuthenticated']=function isAuthenticated(_0xc275a1){return compose()[_0x3342('0x36')](function(_0x1cc542,_0x272a52,_0x4fbfb7){var _0x27e25b;if(_0x1cc542[_0x3342('0x3f')][_0x3342('0x40')]){if(_[_0x3342('0x41')](_0x1cc542[_0x3342('0x3f')][_0x3342('0x40')],_0x3342('0x42'))){var _0x47b2a0=basicAuth(_0x1cc542);db[_0x3342('0x43')]['find']({'where':{'name':_0x47b2a0[_0x3342('0x10')]}})[_0x3342('0x44')](function(_0x508f87){if(!_0x508f87||!_0x508f87[_0x3342('0x45')](_0x47b2a0[_0x3342('0x46')])){return _0x272a52[_0x3342('0x47')](0x191)[_0x3342('0x3c')]({'message':'Wrong\x20credentials.'});}_0x1cc542[_0x3342('0x37')]={'id':_0x508f87['id']};_0x4fbfb7();})[_0x3342('0x3e')](function(_0x311cfe){_0x4fbfb7(_0x311cfe);});}else if(_[_0x3342('0x41')](_0x1cc542[_0x3342('0x3f')][_0x3342('0x40')],_0x3342('0x48'))){validateJwt(_0x1cc542,_0x272a52,_0x4fbfb7);}else{if(_0xc275a1){_0x4fbfb7();}else{return _0x272a52[_0x3342('0x47')](0x193)[_0x3342('0x3c')]({'message':_0x3342('0x49')});}}}else if(_0x1cc542[_0x3342('0x4a')][_0x3342('0x4b')]){try{var _0x5aea96={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x3342('0x4c')]()};verifyJwt(_0x1cc542['query'][_0x3342('0x4b')],_0x5aea96)[_0x3342('0x44')](function(_0x1a74d3){return db[_0x3342('0x43')][_0x3342('0x4d')]({'where':{'id':_0x1a74d3[_0x3342('0x4e')]}})[_0x3342('0x44')](function(_0x5d460c){_0x27e25b=_0x5d460c;return db[_0x3342('0x4f')][_0x3342('0x39')]({'where':{'id':0x1},'attributes':[_0x3342('0x50'),_0x3342('0x51')],'raw':!![]});})[_0x3342('0x44')](function(_0x5bd5eb){if(!_0x27e25b||!_[_0x3342('0x52')](_0x27e25b['apiKeyNonce'],_0x1a74d3[_0x3342('0x53')])){return _0x272a52[_0x3342('0x47')](0x191)[_0x3342('0x3c')]({'message':_0x3342('0x54')});}if(_0x27e25b['disabled']){return _0x272a52[_0x3342('0x47')](0x191)['json']({'message':_0x3342('0x55')});}if(_0x27e25b[_0x3342('0x56')]){if(_0x5bd5eb[_0x3342('0x51')]>0x0){if(moment(_0x27e25b[_0x3342('0x57')])[_0x3342('0x58')](_0x5bd5eb[_0x3342('0x51')],_0x3342('0x59'))>moment()){return _0x272a52['status'](0x191)[_0x3342('0x3c')]({'message':_0x3342('0x55')});}}else{return _0x272a52['status'](0x191)[_0x3342('0x3c')]({'message':_0x3342('0x55')});}}_0x1cc542['user']={'id':_0x27e25b['id']};_0x4fbfb7();});})[_0x3342('0x3e')](function(){return _0x272a52[_0x3342('0x47')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x5acb74){_0x4fbfb7(_0x5acb74);}}else if(_0xc275a1){_0x4fbfb7();}else{return _0x272a52[_0x3342('0x47')](0x193)[_0x3342('0x3c')]({'message':'Unknown\x20authorization\x20format'});}})[_0x3342('0x36')](function(_0x2a1f7e,_0x2944ab,_0x17fd01){if(_0x2a1f7e[_0x3342('0x37')]){db[_0x3342('0x43')][_0x3342('0x4d')]({'where':{'id':_0x2a1f7e[_0x3342('0x37')]['id']},'attributes':userAttributes})['then'](function(_0x5a787b){if(!_0x5a787b){return _0x2944ab[_0x3342('0x47')](0x194)[_0x3342('0x3c')]({'message':_0x3342('0x5a')});}_0x2a1f7e[_0x3342('0x37')]=_0x5a787b;_0x17fd01();})[_0x3342('0x3e')](function(_0x414fcb){_0x17fd01(_0x414fcb);});}else if(_0xc275a1){_0x17fd01();}else{return _0x2944ab['status'](0x194)[_0x3342('0x3c')]({'message':_0x3342('0x5b')});}});};exports[_0x3342('0x5c')]=function canUpdate(){return compose()[_0x3342('0x36')](function(_0x64e352,_0x365d6f,_0x5e2c66){return licenseUtil[_0x3342('0x5d')]()['then'](function(_0x6090bd){if(_0x6090bd[_0x3342('0x5e')]){_0x5e2c66();}else{return _0x365d6f[_0x3342('0x47')](0x193)[_0x3342('0x3c')]({'message':'Forbidden'});}})[_0x3342('0x3e')](function(_0x16e970){_0x5e2c66(_0x16e970);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x3342('0x36')](function(_0x302159,_0x169549,_0x16cebb){return licenseUtil['getLicense']()[_0x3342('0x44')](function(_0x2453a9){if(_0x2453a9['webrtc']){_0x16cebb();}else{return _0x169549[_0x3342('0x47')](0x193)['json']({'message':'Forbidden'});}})[_0x3342('0x3e')](function(_0x706154){_0x16cebb(_0x706154);});});};exports[_0x3342('0x5f')]=function(_0x296cbb,_0x23925e,_0x171387){_0x296cbb[_0x3342('0x5f')]=!![];return _0x171387();};exports['signToken']=function signToken(_0x4e6be0){return signJwt(_0x4e6be0);};exports[_0x3342('0x60')]=function(_0x5a9e40,_0x26251c){if(!_0x5a9e40['user']){return _0x26251c['status'](0x194)['json']({'message':_0x3342('0x61')});}var _0x23f623={'payload':{'id':_0x5a9e40[_0x3342('0x37')]['id'],'role':_0x5a9e40[_0x3342('0x37')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x23f623)[_0x3342('0x44')](function(_0x3a6597){_0x26251c['cookie'](_0x3342('0x62'),_0x3a6597);_0x26251c[_0x3342('0x63')](_0x3342('0x64'));})['catch'](function(_0x189b68){return _0x26251c[_0x3342('0x47')](0x1f4)[_0x3342('0x65')](_0x189b68);});};exports[_0x3342('0x66')]=function(_0x250e6a){if(_['isNil'](_0x250e6a[_0x3342('0x67')])||_[_0x3342('0x68')](_0x250e6a[_0x3342('0x69')])){return null;}else{return createJwt(_0x250e6a);}};exports[_0x3342('0x6a')]=function(_0x16d966){_0x16d966[_0x3342('0x67')]=generateNonce();_0x16d966[_0x3342('0x69')]=generateIssuedAt();return createJwt(_0x16d966);};exports[_0x3342('0x6b')]=function(_0x16a4be,_0x542181){var _0x218181=_0x16a4be['query'][_0x3342('0x4b')];if(_0x218181){var _0x524fb6={'nonce':_0x542181['apiKeyNonce'],'iat':_0x542181['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x3342('0x4c')]()};return verifyJwt(_0x218181,_0x524fb6)[_0x3342('0x44')](function(){return generateApiKey(_0x542181);});}else{throw{'message':_0x3342('0x6c')};}};exports[_0x3342('0x6d')]=function(_0x3d9be7){var _0x163d76=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x163d76[_0x3342('0x6e')](_0x3d9be7))throw new db[(_0x3342('0x6f'))][(_0x3342('0x70'))](_0x3342('0x71'));return;};exports[_0x3342('0x72')]=function(_0x561812,_0x47d138,_0x11719c){var _0x53e54b=encryptor[_0x3342('0x73')](_0x47d138)['split'](',');for(var _0x4c777e=0x0;_0x4c777e<_0x11719c;_0x4c777e++){if(!_0x53e54b[_0x4c777e])break;if(_0x561812[_0x3342('0x74')]()===_0x53e54b[_0x4c777e][_0x3342('0x74')]()){var _0x16e692=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x11719c);if(_0x11719c===0x1){_0x16e692=_0x3342('0x75');}throw new db[(_0x3342('0x6f'))]['ValidationError'](_0x16e692);}}return;};exports[_0x3342('0x76')]=function(_0x219a17,_0x372af5){var _0x4d3660=_0x372af5?encryptor[_0x3342('0x73')](_0x372af5)[_0x3342('0x77')](','):[];if(_0x4d3660[_0x3342('0x78')]===0x5){_0x4d3660[_0x3342('0x79')](-0x1,0x1);}_0x4d3660[_0x3342('0x7a')](_0x219a17);return encryptor[_0x3342('0x7b')](_0x4d3660[_0x3342('0x7c')](','));};function signJwt(_0x57942a){var _0x4bc9a9=BPromise[_0x3342('0x7d')](jwt['sign'],{'context':jwt});var _0x25fa01=_0x57942a[_0x3342('0x7e')]||config[_0x3342('0xc')][_0x3342('0xd')];return new BPromise(function(_0xe9b979,_0x5d8a9d){_0x4bc9a9(_0x57942a[_0x3342('0x7f')],_0x25fa01,_0x57942a[_0x3342('0x80')])['then'](function(_0x14e56b){_0xe9b979(_0x14e56b);})[_0x3342('0x3e')](function(_0x10842c){_0x5d8a9d(_0x10842c);});});}function verifyJwt(_0x2858a6,_0x1ba552,_0x3a82c8){var _0x19fcc5=BPromise[_0x3342('0x7d')](jwt[_0x3342('0x81')],{'context':jwt});var _0x36eec8=_0x3a82c8||config[_0x3342('0xc')][_0x3342('0xd')];return new BPromise(function(_0x3b01a3,_0x58cbdd){_0x19fcc5(_0x2858a6,_0x36eec8,_0x1ba552)['then'](function(_0x146ffc){_0x3b01a3(_0x146ffc);})[_0x3342('0x3e')](function(_0x14193b){_0x58cbdd(_0x14193b);});});}function generateNonce(){return crypto[_0x3342('0x82')](0x10)['toString']('hex');}function generateIssuedAt(){return Math[_0x3342('0x83')](Date[_0x3342('0x84')]()/0x3e8)[_0x3342('0x85')]();}function createJwt(_0x2aed01){var _0xbc9035={'payload':{'iat':_0x2aed01[_0x3342('0x69')],'nonce':_0x2aed01[_0x3342('0x67')]},'options':{'algorithm':_0x3342('0x86'),'subject':_0x2aed01['id'][_0x3342('0x85')](),'issuer':hardwareConf[_0x3342('0x4c')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0xbc9035)[_0x3342('0x44')](function(_0x5e2ff3){return{'iat':_0x2aed01[_0x3342('0x69')],'nonce':_0x2aed01[_0x3342('0x67')],'token':_0x5e2ff3};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 439df8e..a32e923 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 _0x46ab=['checkListsRestrictions','countFilteredContacts','count','User','buildContactsQuery','getFilteredContacts','catch','describe','keys','cf_','map','slice','all','type','lodash','../../mysqldb','skipContactsQuery','getContactsSubquery','resolve','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause','tags','skip'];(function(_0x4ad060,_0xed9033){var _0x181797=function(_0x4cc989){while(--_0x4cc989){_0x4ad060['push'](_0x4ad060['shift']());}};_0x181797(++_0xed9033);}(_0x46ab,0x8a));var _0xb46a=function(_0x1ccaa4,_0x5a85de){_0x1ccaa4=_0x1ccaa4-0x0;var _0x5a768c=_0x46ab[_0x1ccaa4];return _0x5a768c;};'use strict';var _=require(_0xb46a('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xb46a('0x1'))['db'];exports['findAll']=function(_0x305522,_0x54a462,_0x5615af,_0x9ba1ce){var _0x1acdcf={'count':0x0,'rows':[]};var _0x14a642=sqlUtils[_0xb46a('0x2')](_0x54a462,_0x305522);if(_0x14a642){return Promise['resolve'](_0x1acdcf);}var _0x5f1109=sqlUtils[_0xb46a('0x3')]();var _0x403e80={};var _0x14278f=![];var _0x230c65=![];return Promise[_0xb46a('0x4')]()[_0xb46a('0x5')](function(){if(_0x305522[_0xb46a('0x6')]){return sqlUtils[_0xb46a('0x7')](_0x305522[_0xb46a('0x6')],_0x9ba1ce);}else{return sqlUtils[_0xb46a('0x8')](_0x305522,_0x9ba1ce);}})[_0xb46a('0x5')](function(_0x1e1f0e){_0x5f1109[_0xb46a('0x9')](_0x1e1f0e[_0xb46a('0xa')]);_0x5f1109[_0xb46a('0x9')](_0x1e1f0e[_0xb46a('0xb')]);_0x5f1109['where'](_0x1e1f0e[_0xb46a('0xc')]);_0x5f1109[_0xb46a('0x9')](_0x1e1f0e[_0xb46a('0xd')][_0xb46a('0xe')]);_0x403e80=_0x1e1f0e[_0xb46a('0xf')];_0x230c65=_0x1e1f0e['user'][_0xb46a('0x10')];return sqlUtils[_0xb46a('0x11')](_0x54a462,_0x305522,_0x230c65);})[_0xb46a('0x5')](function(_0x417463){_0x5f1109['where'](_0x417463);var _0x2abf05=_0x305522[_0xb46a('0x6')]?_0x403e80['ids']:_0x305522['tag'];_0x14278f=_0x2abf05?!![]:![];return sqlUtils[_0xb46a('0x12')](_0x5f1109,_0x2abf05);})[_0xb46a('0x5')](function(_0x341ffa){_0x1acdcf[_0xb46a('0x13')]=_0x341ffa;if(_0x1acdcf[_0xb46a('0x13')]===0x0){return;}if(_0x305522[_0xb46a('0x14')]){_0x230c65=!![];}return sqlUtils[_0xb46a('0x15')](_0x5f1109,_0x305522[_0xb46a('0xb')],_0x5615af,_0x14278f,_0x403e80[_0xb46a('0xe')],_0x230c65);})[_0xb46a('0x5')](function(_0x322796){if(!_0x322796){return[];}return sqlUtils[_0xb46a('0x16')](_0x322796,_0x305522,_0x5615af);})[_0xb46a('0x5')](function(_0x17c610){_0x1acdcf['rows']=_0x17c610;return _0x1acdcf;})[_0xb46a('0x17')](function(_0x210485){throw _0x210485;});};exports[_0xb46a('0x18')]=function(){var _0x5571cd={};var _0x3608be=[];return db['CmContact'][_0xb46a('0x18')]()['then'](function(_0x490e4a){_0x5571cd=_0x490e4a;var _0x562e2f=Object[_0xb46a('0x19')](_0x5571cd)[_0xb46a('0xc')](function(_0x390507){return _['startsWith'](_0x390507,_0xb46a('0x1a'))?_0x390507:undefined;});var _0x4e5daa=_0x562e2f[_0xb46a('0x1b')](function(_0x5adc40){return db['CmCustomField']['findOne']({'where':{'id':_0x5adc40[_0xb46a('0x1c')](0x3)},'raw':!![]});});return Promise[_0xb46a('0x1d')](_0x4e5daa);})[_0xb46a('0x5')](function(_0x499146){for(var _0x27ab3f=0x0;_0x27ab3f<_0x499146['length'];_0x27ab3f++){if(_0x499146[_0x27ab3f]){var _0x5b7945=_0xb46a('0x1a')+_0x499146[_0x27ab3f]['id'];_0x5571cd[_0x5b7945]['fieldType']=_0x499146[_0x27ab3f][_0xb46a('0x1e')];}}_0x3608be=_[_0xb46a('0x1b')](Object[_0xb46a('0x19')](_0x5571cd),function(_0x2f52ae){return{'name':_0x2f52ae,'type':_0x5571cd[_0x2f52ae][_0xb46a('0x1e')]};});return _0x3608be;})[_0xb46a('0x17')](function(_0x1ed6b7){throw _0x1ed6b7;});}; \ No newline at end of file +var _0xf7dd=['startsWith','cf_','map','slice','all','length','fieldType','type','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','clause','tags','checkListsRestrictions','tag','countFilteredContacts','count','User','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','keys'];(function(_0x3ea28c,_0x614cc8){var _0x35acd7=function(_0x15218c){while(--_0x15218c){_0x3ea28c['push'](_0x3ea28c['shift']());}};_0x35acd7(++_0x614cc8);}(_0xf7dd,0x77));var _0xdf7d=function(_0x1d5cfa,_0x57efb0){_0x1d5cfa=_0x1d5cfa-0x0;var _0x19a273=_0xf7dd[_0x1d5cfa];return _0x19a273;};'use strict';var _=require(_0xdf7d('0x0'));var sqlUtils=require(_0xdf7d('0x1'));var db=require(_0xdf7d('0x2'))['db'];exports[_0xdf7d('0x3')]=function(_0x44aa52,_0xb8f726,_0x573f71,_0x2eb4fc){var _0x3f70f5={'count':0x0,'rows':[]};var _0xaad5f9=sqlUtils[_0xdf7d('0x4')](_0xb8f726,_0x44aa52);if(_0xaad5f9){return Promise[_0xdf7d('0x5')](_0x3f70f5);}var _0x2a3f55=sqlUtils[_0xdf7d('0x6')]();var _0x32b852={};var _0x468aa9=![];var _0x1869be=![];return Promise[_0xdf7d('0x5')]()[_0xdf7d('0x7')](function(){if(_0x44aa52[_0xdf7d('0x8')]){return sqlUtils[_0xdf7d('0x9')](_0x44aa52[_0xdf7d('0x8')],_0x2eb4fc);}else{return sqlUtils[_0xdf7d('0xa')](_0x44aa52,_0x2eb4fc);}})['then'](function(_0x916f37){_0x2a3f55[_0xdf7d('0xb')](_0x916f37[_0xdf7d('0xc')]);_0x2a3f55[_0xdf7d('0xb')](_0x916f37[_0xdf7d('0xd')]);_0x2a3f55[_0xdf7d('0xb')](_0x916f37[_0xdf7d('0xe')]);_0x2a3f55[_0xdf7d('0xb')](_0x916f37['user'][_0xdf7d('0xf')]);_0x32b852=_0x916f37[_0xdf7d('0x10')];_0x1869be=_0x916f37['user']['skip'];return sqlUtils[_0xdf7d('0x11')](_0xb8f726,_0x44aa52,_0x1869be);})[_0xdf7d('0x7')](function(_0x4adca0){_0x2a3f55[_0xdf7d('0xb')](_0x4adca0);var _0x3d2e29=_0x44aa52['search']?_0x32b852['ids']:_0x44aa52[_0xdf7d('0x12')];_0x468aa9=_0x3d2e29?!![]:![];return sqlUtils[_0xdf7d('0x13')](_0x2a3f55,_0x3d2e29);})[_0xdf7d('0x7')](function(_0x239559){_0x3f70f5[_0xdf7d('0x14')]=_0x239559;if(_0x3f70f5[_0xdf7d('0x14')]===0x0){return;}if(_0x44aa52[_0xdf7d('0x15')]){_0x1869be=!![];}return sqlUtils[_0xdf7d('0x16')](_0x2a3f55,_0x44aa52[_0xdf7d('0xd')],_0x573f71,_0x468aa9,_0x32b852[_0xdf7d('0xf')],_0x1869be);})['then'](function(_0x9bad84){if(!_0x9bad84){return[];}return sqlUtils[_0xdf7d('0x17')](_0x9bad84,_0x44aa52,_0x573f71);})[_0xdf7d('0x7')](function(_0x2fdcbb){_0x3f70f5[_0xdf7d('0x18')]=_0x2fdcbb;return _0x3f70f5;})[_0xdf7d('0x19')](function(_0x4dd654){throw _0x4dd654;});};exports[_0xdf7d('0x1a')]=function(){var _0x1d33aa={};var _0x40bb7=[];return db[_0xdf7d('0x1b')][_0xdf7d('0x1a')]()[_0xdf7d('0x7')](function(_0x27be9f){_0x1d33aa=_0x27be9f;var _0x3f5d8f=Object[_0xdf7d('0x1c')](_0x1d33aa)[_0xdf7d('0xe')](function(_0x3b4150){return _[_0xdf7d('0x1d')](_0x3b4150,_0xdf7d('0x1e'))?_0x3b4150:undefined;});var _0x489e07=_0x3f5d8f[_0xdf7d('0x1f')](function(_0x2bfed4){return db['CmCustomField']['findOne']({'where':{'id':_0x2bfed4[_0xdf7d('0x20')](0x3)},'raw':!![]});});return Promise[_0xdf7d('0x21')](_0x489e07);})[_0xdf7d('0x7')](function(_0x1318fa){for(var _0x4d9993=0x0;_0x4d9993<_0x1318fa[_0xdf7d('0x22')];_0x4d9993++){if(_0x1318fa[_0x4d9993]){var _0x4b584a=_0xdf7d('0x1e')+_0x1318fa[_0x4d9993]['id'];_0x1d33aa[_0x4b584a][_0xdf7d('0x23')]=_0x1318fa[_0x4d9993][_0xdf7d('0x24')];}}_0x40bb7=_[_0xdf7d('0x1f')](Object[_0xdf7d('0x1c')](_0x1d33aa),function(_0x3a8820){return{'name':_0x3a8820,'type':_0x1d33aa[_0x3a8820]['type']};});return _0x40bb7;})[_0xdf7d('0x19')](function(_0x3f81c0){throw _0x3f81c0;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index e694b68..4cc7939 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 _0x259c=['uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','email','CompanyId','createdAt','updatedAt','deletedAt','includes','forEach','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','castTo','buildExpression','type','default','text','start','end','Tag','value','map','tags','clause','and','ids','User','user','skip','keys','compact','Contact','push','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','uc.UserId\x20=\x20?','\x20=\x20?','resolve','then','fields','tag','filter','getLists','c.ListId\x20IS\x20NULL','select','group','c.id','limit','offset','having','order','DESC','color','Sequelize','QueryTypes','CmContact','sequelize','query','toString','Tags','COUNT(*)','getSelectedTags','isEmpty','t.id\x20IN\x20?','SELECT','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../../mysqldb','role','agent','search','ListId','autocomplete','true','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0x259c,0x1a3));var _0xc259=function(_0x5575e5,_0x507147){_0x5575e5=_0x5575e5-0x0;var _0x44c9db=_0x259c[_0x5575e5];return _0x44c9db;};'use strict';var _=require(_0xc259('0x0'));var squel=require(_0xc259('0x1'));var as=require(_0xc259('0x2'));var qs=require(_0xc259('0x3'));var utils=require('../interaction/utils');var db=require(_0xc259('0x4'))['db'];function skipContactsQuery(_0x14e742,_0x3e79e2){var _0x40a134=![];if(_0x14e742[_0xc259('0x5')]===_0xc259('0x6')&&!_0x3e79e2[_0xc259('0x7')]&&!_0x3e79e2[_0xc259('0x8')]&&_0x3e79e2[_0xc259('0x9')]!==_0xc259('0xa')){_0x40a134=!![];}return _0x40a134;}function getContactsSubquery(){return squel['select']()[_0xc259('0xb')](_0xc259('0xc'),'c')[_0xc259('0xd')](_0xc259('0xe'));}function applyJoinClauses(_0x53d17c,_0x54dec6){var _0x3ec1b1=_0x54dec6?'c':_0xc259('0xf');_0x53d17c['left_join'](_0xc259('0x10'),'uc',_0xc259('0x11')+_0x3ec1b1+_0xc259('0x12'))[_0xc259('0x13')](_0xc259('0x14'),'ct','ct.CmContactId\x20=\x20'+_0x3ec1b1+_0xc259('0x12'))['left_join']('tools_tags','t',_0xc259('0x15'));return _0x53d17c;}function addFieldsToQuery(_0x12f9e4,_0x277424,_0x36e76c,_0xd61273,_0x3b313f){var _0x58e1f7=_0x3b313f?'c':_0xc259('0xf');if(!_0x277424){_0x277424=['id',_0xc259('0x16'),_0xc259('0x17'),_0xc259('0x18'),_0xc259('0x19'),_0xc259('0x1a'),_0xc259('0x1b'),_0xc259('0x8'),_0xc259('0x1c'),_0xc259('0x1d'),_0xc259('0x1e'),_0xc259('0x1f'),'TagIds'];}else if(!_0x277424[_0xc259('0x20')]('id')){_0x277424['push']('id');}var _0x14f46e=_0x36e76c&&_0x3b313f||!_0x36e76c&&!_0x3b313f;if(_0xd61273){_0x14f46e=_0xd61273&&_0x3b313f||!_0xd61273&&!_0x3b313f;}_0x277424[_0xc259('0x21')](function(_0xa58da4){if(_0xa58da4===_0xc259('0x22')){if(_0x14f46e){_0x12f9e4[_0xc259('0x23')](_0xc259('0x24'),_0xa58da4);}else if(_0x36e76c||_0xd61273){_0x12f9e4[_0xc259('0x23')](_0x58e1f7+'.'+_0xa58da4);}}else{_0x12f9e4[_0xc259('0x23')](_0x58e1f7+'.'+_0xa58da4);}});return _0x12f9e4;}function getSqlClauses(){var _0x309239={'default':squel[_0xc259('0x25')](),'fields':squel[_0xc259('0x25')](),'filter':squel[_0xc259('0x25')](),'tags':{'clause':squel[_0xc259('0x25')](),'ids':null},'user':{'clause':squel[_0xc259('0x25')](),'skip':![]}};return _0x309239;}function parseTagParameter(_0xa91f62){var _0x514f62=squel[_0xc259('0x25')]();if(_0xa91f62){var _0x1e30ca=utils['getSelectedTags'](_0xa91f62);_0x1e30ca[_0xc259('0x21')](function(_0x49b9f1){_0x514f62['or'](_0xc259('0x26'),'%,'+_0x49b9f1+',%');});}return _0x514f62;}function parseSearchFilter(_0x1385bc){var _0x38fa51=squel[_0xc259('0x25')]();if(_0x1385bc){var _0x385a88=_0x1385bc[_0xc259('0x27')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x385a88[_0xc259('0x28')]('\x20')[_0xc259('0x29')]>0x1){_0x38fa51['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc259('0x2a')](_0x385a88,!![]),null);}else{if(qs['isNumeric'](_0x385a88)){_0x38fa51['or'](_0xc259('0x2b'),_0x385a88+'%');_0x38fa51['or'](_0xc259('0x2c'),_0x385a88+'%');_0x38fa51['or']('c.mobile\x20LIKE\x20?',_0x385a88+'%');_0x38fa51['or'](_0xc259('0x2d'),_0x385a88+'%');}else if(qs[_0xc259('0x2e')](_0x385a88)){_0x38fa51['or'](_0xc259('0x2f'),_0x385a88+'%');}else{_0x38fa51['or']('c.firstName\x20LIKE\x20?','%'+_0x385a88+'%');_0x38fa51['or'](_0xc259('0x30'),'%'+_0x385a88+'%');_0x38fa51['or'](_0xc259('0x2f'),'%'+_0x385a88+'%');}}}return _0x38fa51;}function parseAdvancedSearchFilter(_0x340857,_0x472f4b){var _0x26f5e2=getSqlClauses();var _0x3498bd=as[_0xc259('0x31')](_0x340857);var _0x399090=_0x3498bd[_0xc259('0x32')];for(var _0x4f49c0=0x0;_0x4f49c0<_0x3498bd['conditions']['length'];_0x4f49c0++){var _0xf650fb=_0x3498bd[_0xc259('0x33')][_0x4f49c0];var _0x122db5='c';var _0x181f37=_[_0xc259('0x34')](_0x472f4b,[_0xc259('0x35'),_0xf650fb[_0xc259('0x23')]]);if(_0x181f37){if(_0xf650fb[_0xc259('0x23')]===_0xc259('0x36')||_0x181f37['fieldType']==='datetime'){_0xf650fb[_0xc259('0x37')]='DATE';}var _0x3a1628=as[_0xc259('0x38')](_0x122db5,_0x181f37[_0xc259('0x39')],_0xf650fb);_0x26f5e2[_0xc259('0x3a')][_0x399090](_0x3a1628[_0xc259('0x3b')],_0x3a1628['value'][_0xc259('0x3c')],_0x3a1628['value'][_0xc259('0x3d')]);}else{if(_0xf650fb['field']===_0xc259('0x3e')){var _0x653da=_0xf650fb[_0xc259('0x3f')][_0xc259('0x28')](',')[_0xc259('0x40')](function(_0x439f56){return Number(_0x439f56);});var _0x4422b7=parseTagParameter(_0x653da);_0x26f5e2[_0xc259('0x41')][_0xc259('0x42')][_0xc259('0x43')](_0x4422b7);_0x26f5e2[_0xc259('0x41')][_0xc259('0x44')]=_0x653da;}else if(_0xf650fb[_0xc259('0x23')]===_0xc259('0x45')){_0x26f5e2['user'][_0xc259('0x42')][_0xc259('0x43')]('uc.UserId\x20=\x20?',_0xf650fb[_0xc259('0x3f')]);_0x26f5e2[_0xc259('0x46')][_0xc259('0x47')]=!![];}}}return _0x26f5e2;}function parseModelFields(_0x42b37d,_0x217f2f){var _0x27d8ac=squel[_0xc259('0x25')]();var _0x11bf13=_(_0x42b37d)[_0xc259('0x48')]()[_0xc259('0x40')](function(_0x392a36){return _['some'](_0x217f2f,[_0xc259('0x35'),_0x392a36])?_0x392a36:undefined;})[_0xc259('0x49')]()[_0xc259('0x3f')]();if(_0x42b37d[_0xc259('0x4a')]){_0x11bf13['push'](_0xc259('0x4a'));}if(_0x42b37d[_0xc259('0x45')]){_0x11bf13[_0xc259('0x4b')](_0xc259('0x45'));}if(_0x11bf13[_0xc259('0x29')]>0x0){_0x11bf13[_0xc259('0x21')](function(_0xd07e09){if(_0xd07e09===_0xc259('0x8')){_0x27d8ac['and']('c.ListId\x20IN\x20?',[][_0xc259('0x4c')](_0x42b37d[_0xd07e09]));}else if(_0xd07e09===_0xc259('0x4a')){var _0x281e02='%'+_0x42b37d[_0xd07e09]+'%';_0x27d8ac[_0xc259('0x43')](_0xc259('0x4d'),_0x281e02);}else if(_0xd07e09===_0xc259('0x45')){_0x27d8ac[_0xc259('0x43')](_0xc259('0x4e'),_0x42b37d[_0xd07e09]);}else{_0x27d8ac['and']('c.'+_0xd07e09+_0xc259('0x4f'),_0x42b37d[_0xd07e09]);}});}return _0x27d8ac;}function parseQueryParameters(_0x33fcfa,_0x500f21){var _0x498266=getSqlClauses();return Promise[_0xc259('0x50')]()[_0xc259('0x51')](function(){return parseModelFields(_0x33fcfa,_0x500f21);})['then'](function(_0x4070b8){_0x498266[_0xc259('0x52')][_0xc259('0x43')](_0x4070b8);return parseTagParameter(_0x33fcfa[_0xc259('0x53')]);})[_0xc259('0x51')](function(_0xc75013){_0x498266[_0xc259('0x41')][_0xc259('0x42')]['and'](_0xc75013);return parseSearchFilter(_0x33fcfa[_0xc259('0x54')]);})['then'](function(_0x2887f5){_0x498266[_0xc259('0x54')]=_0x2887f5;return _0x498266;});}function checkListsRestrictions(_0x137788,_0x51eba4,_0x5f28a2){var _0xe8ead=squel[_0xc259('0x25')]();return Promise[_0xc259('0x50')]()['then'](function(){if(_0x51eba4[_0xc259('0x7')]&&_0x137788[_0xc259('0x5')]===_0xc259('0x6')&&!_0x5f28a2){return _0x137788[_0xc259('0x55')]({'attributes':['id'],'raw':!![]});}})[_0xc259('0x51')](function(_0x153168){if(_0x153168){if(_0x153168[_0xc259('0x29')]===0x0){_0xe8ead[_0xc259('0x43')](_0xc259('0x56'));}else{_0xe8ead[_0xc259('0x43')]('c.ListId\x20IN\x20?',_[_0xc259('0x40')](_0x153168,'id'));}}})[_0xc259('0x51')](function(){return _0xe8ead;});}function buildContactsQuery(_0x42547f,_0x1c1e9d,_0x44aac6,_0x1e21da,_0x11bdbb,_0x35b651){if(_0x1c1e9d){_0x1c1e9d=_0x44aac6['attributes'];}_0x42547f=addFieldsToQuery(_0x42547f,_0x1c1e9d,_0x1e21da,_0x35b651,!![]);var _0x339011=squel[_0xc259('0x57')]();_0x339011=addFieldsToQuery(_0x339011,_0x1c1e9d,_0x1e21da,_0x35b651,![]);if(_0x1e21da||_0x35b651){_0x42547f=applyJoinClauses(_0x42547f,!![]);_0x42547f[_0xc259('0x58')](_0xc259('0x59'));if(_0x44aac6['limit']){_0x339011[_0xc259('0x5a')](_0x44aac6['limit']);}if(_0x44aac6['offset']){_0x339011[_0xc259('0x5b')](_0x44aac6[_0xc259('0x5b')]);}}else{_0x339011=applyJoinClauses(_0x339011,![]);_0x339011[_0xc259('0x58')]('subqry.id');if(_0x44aac6[_0xc259('0x5a')]){_0x42547f[_0xc259('0x5a')](_0x44aac6[_0xc259('0x5a')]);}if(_0x44aac6['offset']){_0x42547f[_0xc259('0x5b')](_0x44aac6['offset']);}}_0x339011[_0xc259('0x5c')](_0x11bdbb);if(_0x44aac6[_0xc259('0x5d')]){_0x44aac6['order']['forEach'](function(_0x1657b2){_0x42547f[_0xc259('0x5d')]('c.'+_0x1657b2[0x0],_0x1657b2[0x1]==='DESC'?![]:!![]);_0x339011['order']('subqry.'+_0x1657b2[0x0],_0x1657b2[0x1]===_0xc259('0x5e')?![]:!![]);});}_0x339011[_0xc259('0xb')](_0x42547f,'subqry');return _0x339011;}function getFilteredContacts(_0x43811d){var _0x3c065f=[];return db['Tag']['findAll']({'attributes':['id',_0xc259('0x35'),_0xc259('0x5f')],'raw':!![]})[_0xc259('0x51')](function(_0x50e4b4){_0x3c065f=_['keyBy'](_0x50e4b4,'id');var _0x39d917={'type':db[_0xc259('0x60')][_0xc259('0x61')]['SELECT'],'model':db[_0xc259('0x62')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xc259('0x63')][_0xc259('0x64')](_0x43811d[_0xc259('0x65')](),_0x39d917);})[_0xc259('0x51')](function(_0x461703){_0x461703[_0xc259('0x21')](function(_0x396eba){if(_0x396eba[_0xc259('0x22')]){_0x396eba[_0xc259('0x66')]=[];_0x396eba['TagIds']['split'](',')[_0xc259('0x21')](function(_0x4cf090){_0x396eba[_0xc259('0x66')][_0xc259('0x4b')](_0x3c065f[_0x4cf090]);});}delete _0x396eba[_0xc259('0x22')];});return _0x461703;});}function countFilteredContacts(_0x39a6af,_0x413982){var _0xe265aa=_0x39a6af['clone']();_0xe265aa[_0xc259('0x23')](_0xc259('0x67'));_0xe265aa=applyJoinClauses(_0xe265aa,!![]);_0x39a6af[_0xc259('0x58')](_0xc259('0x59'));var _0x40b221=utils[_0xc259('0x68')](_0x413982);if(!_[_0xc259('0x69')](_0x40b221)){_0xe265aa['where'](_0xc259('0x6a'),_0x40b221);}var _0x1c6095={'type':db[_0xc259('0x60')]['QueryTypes'][_0xc259('0x6b')],'raw':!![]};return db[_0xc259('0x63')][_0xc259('0x64')](_0xe265aa[_0xc259('0x65')](),_0x1c6095)[_0xc259('0x51')](function(_0x12b0b1){return _0x12b0b1[0x0][_0xc259('0x67')];});}module[_0xc259('0x6c')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xb5ac=['keyBy','Sequelize','SELECT','CmContact','query','Tags','COUNT(*)','c.id','isEmpty','QueryTypes','sequelize','exports','squel','../parsers/advancedSearch','../../mysqldb','role','search','autocomplete','true','select','from','cm_contacts','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','cm_contact_has_tags','ct.CmContactId\x20=\x20','.id','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','ListId','createdAt','deletedAt','includes','push','forEach','TagIds','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','length','find','name','fieldType','castTo','DATE','buildExpression','default','text','value','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','keys','some','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','agent','getLists','c.ListId\x20IS\x20NULL','map','attributes','group','limit','offset','subqry.id','having','order','subqry.','DESC','color'];(function(_0x236862,_0x571782){var _0x146859=function(_0x20934e){while(--_0x20934e){_0x236862['push'](_0x236862['shift']());}};_0x146859(++_0x571782);}(_0xb5ac,0x76));var _0xcb5a=function(_0x3c5570,_0x113167){_0x3c5570=_0x3c5570-0x0;var _0x2edae8=_0xb5ac[_0x3c5570];return _0x2edae8;};'use strict';var _=require('lodash');var squel=require(_0xcb5a('0x0'));var as=require(_0xcb5a('0x1'));var qs=require('../parsers/qs');var utils=require('../interaction/utils');var db=require(_0xcb5a('0x2'))['db'];function skipContactsQuery(_0x3ff3b1,_0x201c20){var _0xbff35b=![];if(_0x3ff3b1[_0xcb5a('0x3')]==='agent'&&!_0x201c20[_0xcb5a('0x4')]&&!_0x201c20['ListId']&&_0x201c20[_0xcb5a('0x5')]!==_0xcb5a('0x6')){_0xbff35b=!![];}return _0xbff35b;}function getContactsSubquery(){return squel[_0xcb5a('0x7')]()[_0xcb5a('0x8')](_0xcb5a('0x9'),'c')['where'](_0xcb5a('0xa'));}function applyJoinClauses(_0xe4faba,_0x3cee7e){var _0xea119d=_0x3cee7e?'c':_0xcb5a('0xb');_0xe4faba[_0xcb5a('0xc')](_0xcb5a('0xd'),'uc',_0xcb5a('0xe')+_0xea119d+'.id')[_0xcb5a('0xc')](_0xcb5a('0xf'),'ct',_0xcb5a('0x10')+_0xea119d+_0xcb5a('0x11'))[_0xcb5a('0xc')](_0xcb5a('0x12'),'t',_0xcb5a('0x13'));return _0xe4faba;}function addFieldsToQuery(_0x2fba82,_0x277da6,_0x350fb7,_0x115a85,_0x3de582){var _0x56fbb1=_0x3de582?'c':'subqry';if(!_0x277da6){_0x277da6=['id',_0xcb5a('0x14'),_0xcb5a('0x15'),_0xcb5a('0x16'),_0xcb5a('0x17'),_0xcb5a('0x18'),'email',_0xcb5a('0x19'),'CompanyId',_0xcb5a('0x1a'),'updatedAt',_0xcb5a('0x1b'),'TagIds'];}else if(!_0x277da6[_0xcb5a('0x1c')]('id')){_0x277da6[_0xcb5a('0x1d')]('id');}var _0x479fc9=_0x350fb7&&_0x3de582||!_0x350fb7&&!_0x3de582;if(_0x115a85){_0x479fc9=_0x115a85&&_0x3de582||!_0x115a85&&!_0x3de582;}_0x277da6[_0xcb5a('0x1e')](function(_0x2a0af2){if(_0x2a0af2===_0xcb5a('0x1f')){if(_0x479fc9){_0x2fba82['field'](_0xcb5a('0x20'),_0x2a0af2);}else if(_0x350fb7||_0x115a85){_0x2fba82[_0xcb5a('0x21')](_0x56fbb1+'.'+_0x2a0af2);}}else{_0x2fba82['field'](_0x56fbb1+'.'+_0x2a0af2);}});return _0x2fba82;}function getSqlClauses(){var _0xa0df69={'default':squel['expr'](),'fields':squel[_0xcb5a('0x22')](),'filter':squel[_0xcb5a('0x22')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0xcb5a('0x22')](),'skip':![]}};return _0xa0df69;}function parseTagParameter(_0x229023){var _0x438e90=squel['expr']();if(_0x229023){var _0x11d0b5=utils[_0xcb5a('0x23')](_0x229023);_0x11d0b5[_0xcb5a('0x1e')](function(_0xa6547b){_0x438e90['or'](_0xcb5a('0x24'),'%,'+_0xa6547b+',%');});}return _0x438e90;}function parseSearchFilter(_0x3e94f4){var _0x3c1f46=squel[_0xcb5a('0x22')]();if(_0x3e94f4){var _0x1d3ff8=_0x3e94f4[_0xcb5a('0x25')]('\x5c','\x5c\x5c')[_0xcb5a('0x25')](/'/g,'\x27\x27');if(_0x1d3ff8[_0xcb5a('0x26')]('\x20')['length']>0x1){_0x3c1f46['or'](_0xcb5a('0x27'),qs[_0xcb5a('0x28')](_0x1d3ff8,!![]),null);}else{if(qs[_0xcb5a('0x29')](_0x1d3ff8)){_0x3c1f46['or'](_0xcb5a('0x2a'),_0x1d3ff8+'%');_0x3c1f46['or'](_0xcb5a('0x2b'),_0x1d3ff8+'%');_0x3c1f46['or']('c.mobile\x20LIKE\x20?',_0x1d3ff8+'%');_0x3c1f46['or'](_0xcb5a('0x2c'),_0x1d3ff8+'%');}else if(qs['isEmail'](_0x1d3ff8)){_0x3c1f46['or'](_0xcb5a('0x2d'),_0x1d3ff8+'%');}else{_0x3c1f46['or'](_0xcb5a('0x2e'),'%'+_0x1d3ff8+'%');_0x3c1f46['or'](_0xcb5a('0x2f'),'%'+_0x1d3ff8+'%');_0x3c1f46['or'](_0xcb5a('0x2d'),'%'+_0x1d3ff8+'%');}}}return _0x3c1f46;}function parseAdvancedSearchFilter(_0x430d1c,_0x3d464){var _0x1fe07d=getSqlClauses();var _0x35d187=as[_0xcb5a('0x30')](_0x430d1c);var _0x4d5acd=_0x35d187['sqlOperator'];for(var _0x1aa6f4=0x0;_0x1aa6f4<_0x35d187[_0xcb5a('0x31')][_0xcb5a('0x32')];_0x1aa6f4++){var _0x2eee3c=_0x35d187['conditions'][_0x1aa6f4];var _0x25ebda='c';var _0x3425af=_[_0xcb5a('0x33')](_0x3d464,[_0xcb5a('0x34'),_0x2eee3c[_0xcb5a('0x21')]]);if(_0x3425af){if(_0x2eee3c[_0xcb5a('0x21')]==='dateOfBirth'||_0x3425af[_0xcb5a('0x35')]==='datetime'){_0x2eee3c[_0xcb5a('0x36')]=_0xcb5a('0x37');}var _0x358e9d=as[_0xcb5a('0x38')](_0x25ebda,_0x3425af['type'],_0x2eee3c);_0x1fe07d[_0xcb5a('0x39')][_0x4d5acd](_0x358e9d[_0xcb5a('0x3a')],_0x358e9d[_0xcb5a('0x3b')]['start'],_0x358e9d[_0xcb5a('0x3b')]['end']);}else{if(_0x2eee3c['field']==='Tag'){var _0x4c75b3=_0x2eee3c[_0xcb5a('0x3b')]['split'](',')['map'](function(_0x3dd12b){return Number(_0x3dd12b);});var _0x41d9f3=parseTagParameter(_0x4c75b3);_0x1fe07d[_0xcb5a('0x3c')][_0xcb5a('0x3d')][_0xcb5a('0x3e')](_0x41d9f3);_0x1fe07d[_0xcb5a('0x3c')][_0xcb5a('0x3f')]=_0x4c75b3;}else if(_0x2eee3c[_0xcb5a('0x21')]===_0xcb5a('0x40')){_0x1fe07d[_0xcb5a('0x41')][_0xcb5a('0x3d')][_0xcb5a('0x3e')](_0xcb5a('0x42'),_0x2eee3c['value']);_0x1fe07d['user'][_0xcb5a('0x43')]=!![];}}}return _0x1fe07d;}function parseModelFields(_0x4e051f,_0x41b820){var _0x4e9f7e=squel['expr']();var _0x230126=_(_0x4e051f)[_0xcb5a('0x44')]()['map'](function(_0x1d69f0){return _[_0xcb5a('0x45')](_0x41b820,[_0xcb5a('0x34'),_0x1d69f0])?_0x1d69f0:undefined;})['compact']()['value']();if(_0x4e051f['Contact']){_0x230126[_0xcb5a('0x1d')](_0xcb5a('0x46'));}if(_0x4e051f[_0xcb5a('0x40')]){_0x230126[_0xcb5a('0x1d')](_0xcb5a('0x40'));}if(_0x230126[_0xcb5a('0x32')]>0x0){_0x230126[_0xcb5a('0x1e')](function(_0x3b1a7a){if(_0x3b1a7a===_0xcb5a('0x19')){_0x4e9f7e[_0xcb5a('0x3e')](_0xcb5a('0x47'),[][_0xcb5a('0x48')](_0x4e051f[_0x3b1a7a]));}else if(_0x3b1a7a==='Contact'){var _0x4c65e3='%'+_0x4e051f[_0x3b1a7a]+'%';_0x4e9f7e['and'](_0xcb5a('0x49'),_0x4c65e3);}else if(_0x3b1a7a===_0xcb5a('0x40')){_0x4e9f7e[_0xcb5a('0x3e')](_0xcb5a('0x42'),_0x4e051f[_0x3b1a7a]);}else{_0x4e9f7e[_0xcb5a('0x3e')]('c.'+_0x3b1a7a+_0xcb5a('0x4a'),_0x4e051f[_0x3b1a7a]);}});}return _0x4e9f7e;}function parseQueryParameters(_0x410531,_0x576663){var _0xfaf763=getSqlClauses();return Promise[_0xcb5a('0x4b')]()[_0xcb5a('0x4c')](function(){return parseModelFields(_0x410531,_0x576663);})[_0xcb5a('0x4c')](function(_0x2fe897){_0xfaf763[_0xcb5a('0x4d')][_0xcb5a('0x3e')](_0x2fe897);return parseTagParameter(_0x410531[_0xcb5a('0x4e')]);})[_0xcb5a('0x4c')](function(_0x262b6a){_0xfaf763[_0xcb5a('0x3c')][_0xcb5a('0x3d')][_0xcb5a('0x3e')](_0x262b6a);return parseSearchFilter(_0x410531[_0xcb5a('0x4f')]);})[_0xcb5a('0x4c')](function(_0x3303cc){_0xfaf763['filter']=_0x3303cc;return _0xfaf763;});}function checkListsRestrictions(_0x49ded2,_0x3fb78a,_0x45ee85){var _0x2d9b65=squel[_0xcb5a('0x22')]();return Promise[_0xcb5a('0x4b')]()[_0xcb5a('0x4c')](function(){if(_0x3fb78a[_0xcb5a('0x4')]&&_0x49ded2[_0xcb5a('0x3')]===_0xcb5a('0x50')&&!_0x45ee85){return _0x49ded2[_0xcb5a('0x51')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x3f79e0){if(_0x3f79e0){if(_0x3f79e0[_0xcb5a('0x32')]===0x0){_0x2d9b65[_0xcb5a('0x3e')](_0xcb5a('0x52'));}else{_0x2d9b65[_0xcb5a('0x3e')]('c.ListId\x20IN\x20?',_[_0xcb5a('0x53')](_0x3f79e0,'id'));}}})[_0xcb5a('0x4c')](function(){return _0x2d9b65;});}function buildContactsQuery(_0x5888f0,_0x45a4e2,_0x472e4a,_0x319627,_0x2ff00b,_0x4703db){if(_0x45a4e2){_0x45a4e2=_0x472e4a[_0xcb5a('0x54')];}_0x5888f0=addFieldsToQuery(_0x5888f0,_0x45a4e2,_0x319627,_0x4703db,!![]);var _0x1dfe06=squel[_0xcb5a('0x7')]();_0x1dfe06=addFieldsToQuery(_0x1dfe06,_0x45a4e2,_0x319627,_0x4703db,![]);if(_0x319627||_0x4703db){_0x5888f0=applyJoinClauses(_0x5888f0,!![]);_0x5888f0[_0xcb5a('0x55')]('c.id');if(_0x472e4a[_0xcb5a('0x56')]){_0x1dfe06[_0xcb5a('0x56')](_0x472e4a[_0xcb5a('0x56')]);}if(_0x472e4a[_0xcb5a('0x57')]){_0x1dfe06['offset'](_0x472e4a['offset']);}}else{_0x1dfe06=applyJoinClauses(_0x1dfe06,![]);_0x1dfe06['group'](_0xcb5a('0x58'));if(_0x472e4a[_0xcb5a('0x56')]){_0x5888f0[_0xcb5a('0x56')](_0x472e4a[_0xcb5a('0x56')]);}if(_0x472e4a['offset']){_0x5888f0[_0xcb5a('0x57')](_0x472e4a[_0xcb5a('0x57')]);}}_0x1dfe06[_0xcb5a('0x59')](_0x2ff00b);if(_0x472e4a[_0xcb5a('0x5a')]){_0x472e4a[_0xcb5a('0x5a')][_0xcb5a('0x1e')](function(_0x3493d7){_0x5888f0[_0xcb5a('0x5a')]('c.'+_0x3493d7[0x0],_0x3493d7[0x1]==='DESC'?![]:!![]);_0x1dfe06[_0xcb5a('0x5a')](_0xcb5a('0x5b')+_0x3493d7[0x0],_0x3493d7[0x1]===_0xcb5a('0x5c')?![]:!![]);});}_0x1dfe06[_0xcb5a('0x8')](_0x5888f0,_0xcb5a('0xb'));return _0x1dfe06;}function getFilteredContacts(_0x56742b){var _0x516305=[];return db['Tag']['findAll']({'attributes':['id','name',_0xcb5a('0x5d')],'raw':!![]})[_0xcb5a('0x4c')](function(_0x17a143){_0x516305=_[_0xcb5a('0x5e')](_0x17a143,'id');var _0x2e139c={'type':db[_0xcb5a('0x5f')]['QueryTypes'][_0xcb5a('0x60')],'model':db[_0xcb5a('0x61')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0xcb5a('0x62')](_0x56742b['toString'](),_0x2e139c);})[_0xcb5a('0x4c')](function(_0x42e154){_0x42e154[_0xcb5a('0x1e')](function(_0x861ea){if(_0x861ea['TagIds']){_0x861ea[_0xcb5a('0x63')]=[];_0x861ea[_0xcb5a('0x1f')][_0xcb5a('0x26')](',')[_0xcb5a('0x1e')](function(_0x18b837){_0x861ea['Tags'][_0xcb5a('0x1d')](_0x516305[_0x18b837]);});}delete _0x861ea[_0xcb5a('0x1f')];});return _0x42e154;});}function countFilteredContacts(_0x3d7435,_0x118402){var _0x543555=_0x3d7435['clone']();_0x543555['field'](_0xcb5a('0x64'));_0x543555=applyJoinClauses(_0x543555,!![]);_0x3d7435['group'](_0xcb5a('0x65'));var _0x39f23c=utils[_0xcb5a('0x23')](_0x118402);if(!_[_0xcb5a('0x66')](_0x39f23c)){_0x543555['where']('t.id\x20IN\x20?',_0x39f23c);}var _0x20078c={'type':db[_0xcb5a('0x5f')][_0xcb5a('0x67')][_0xcb5a('0x60')],'raw':!![]};return db[_0xcb5a('0x68')]['query'](_0x543555['toString'](),_0x20078c)['then'](function(_0x2e1cc6){return _0x2e1cc6[0x0][_0xcb5a('0x64')];});}module[_0xcb5a('0x69')]={'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 19df0d7..12fc32b 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 _0x7026=['lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher','data','update','write','end','final','binary','close','unlink','decryptFile','createDecipher','encryptString','secret','utf8','base64','crypto','bluebird'];(function(_0x4f8466,_0x1f2f1e){var _0x32ce87=function(_0x3fddfa){while(--_0x3fddfa){_0x4f8466['push'](_0x4f8466['shift']());}};_0x32ce87(++_0x1f2f1e);}(_0x7026,0x17f));var _0x6702=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x7026[_0x36ed48];return _0x51c63a;};'use strict';var crypto=require(_0x6702('0x0'));var fs=require('fs');var BPromise=require(_0x6702('0x1'));var _=require(_0x6702('0x2'));var config=require(_0x6702('0x3'));var logger=require(_0x6702('0x4'))(_0x6702('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x6702('0x6')][_0x6702('0x7')],'algorithm':_0x6702('0x8')};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0x6702('0x9')][_0x6702('0xa')]){var isSupported=isAlgorithmSupported(config[_0x6702('0x9')][_0x6702('0xa')]);if(isSupported){fileOptions[_0x6702('0xa')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x6702('0xb')](',\x20');logger[_0x6702('0xc')](config[_0x6702('0x9')][_0x6702('0xa')],_0x6702('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x5da397){return AES_SUPPORTED_RX['test'](_0x5da397);}function getSupportedCiphers(){return crypto[_0x6702('0xe')]()[_0x6702('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x305832){return getSupportedCiphers()[_0x6702('0x10')](_0x305832)>-0x1;}function combineOptions(_0x3d8be8){var _0x27197b={};for(var _0x3541c9 in fileOptions){if(fileOptions[_0x6702('0x11')](_0x3541c9)){_0x27197b[_0x3541c9]=fileOptions[_0x3541c9];}}if(_0x3d8be8){for(var _0x5eb547 in _0x3d8be8){if(_0x3d8be8[_0x6702('0x11')](_0x5eb547)){_0x27197b[_0x5eb547]=_0x3d8be8[_0x5eb547];}}}return _0x27197b;}exports[_0x6702('0x12')]=function(_0x5bc367,_0x2faaa7,_0xab1d16,_0x58919b){return new BPromise(function(_0x152387,_0x4aed4c){_0x58919b=combineOptions(_0x58919b);var _0x253288=new Buffer(_0xab1d16);var _0x470da8=fs[_0x6702('0x13')](_0x5bc367);var _0x55102f=fs['createWriteStream'](_0x2faaa7);var _0x202195=crypto[_0x6702('0x14')](_0x58919b[_0x6702('0xa')],_0x253288);_0x470da8['on'](_0x6702('0x15'),function(_0x51cf33){var _0x235059=new Buffer(_0x202195[_0x6702('0x16')](_0x51cf33),'binary');_0x55102f[_0x6702('0x17')](_0x235059);});_0x470da8['on'](_0x6702('0x18'),function(){try{var _0x5b9f73=new Buffer(_0x202195[_0x6702('0x19')]('binary'),_0x6702('0x1a'));_0x55102f[_0x6702('0x17')](_0x5b9f73);_0x55102f['end']();_0x55102f['on'](_0x6702('0x1b'),function(){return _0x152387(_0x2faaa7);});}catch(_0x1d97cf){fs[_0x6702('0x1c')](_0x2faaa7);return _0x4aed4c(_0x1d97cf);}});});};exports[_0x6702('0x1d')]=function(_0x256919,_0x4c36e7,_0x43b5a4,_0x520399){return new BPromise(function(_0xe9f175,_0x4dee06){_0x520399=combineOptions(_0x520399);var _0x4836e0=new Buffer(_0x43b5a4);var _0x1f8cb0=fs[_0x6702('0x13')](_0x256919);var _0x3a03d9=fs['createWriteStream'](_0x4c36e7);var _0xc575d2=crypto[_0x6702('0x1e')](_0x520399['algorithm'],_0x4836e0);_0x1f8cb0['on'](_0x6702('0x15'),function(_0x178e06){var _0x537908=new Buffer(_0xc575d2[_0x6702('0x16')](_0x178e06),_0x6702('0x1a'));_0x3a03d9[_0x6702('0x17')](_0x537908);});_0x1f8cb0['on'](_0x6702('0x18'),function(){try{var _0x4aba04=new Buffer(_0xc575d2[_0x6702('0x19')](_0x6702('0x1a')),_0x6702('0x1a'));_0x3a03d9[_0x6702('0x17')](_0x4aba04);_0x3a03d9[_0x6702('0x18')]();_0x3a03d9['on'](_0x6702('0x1b'),function(){return _0xe9f175(_0x4c36e7);});}catch(_0x5cfdfd){fs[_0x6702('0x1c')](_0x4c36e7);return _0x4dee06(_0x5cfdfd);}});});};exports[_0x6702('0x1f')]=function(_0x198bca,_0x4e9730,_0x3b9a78){var _0x4a0481=_0x3b9a78||stringOptions[_0x6702('0xa')];var _0x399905=_0x4e9730||stringOptions[_0x6702('0x20')];var _0x34f523=crypto['createCipher'](_0x4a0481,_0x399905);var _0x52962a=_0x34f523['update'](_0x198bca,_0x6702('0x21'),_0x6702('0x22'));_0x52962a+=_0x34f523[_0x6702('0x19')](_0x6702('0x22'));return _0x52962a;};exports['decryptString']=function(_0x381a2c,_0xcc5c38,_0x52bb56){var _0x4f0523=_0x52bb56||stringOptions[_0x6702('0xa')];var _0x30d672=_0xcc5c38||stringOptions[_0x6702('0x20')];var _0x5e8e2f=crypto[_0x6702('0x1e')](_0x4f0523,_0x30d672);var _0x4c7f11=_0x5e8e2f['update'](_0x381a2c,'base64',_0x6702('0x21'));_0x4c7f11+=_0x5e8e2f[_0x6702('0x19')](_0x6702('0x21'));return _0x4c7f11;}; \ No newline at end of file +var _0x2fb0=['aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createCipher','data','update','write','end','final','binary','close','unlink','createWriteStream','encryptString','secret','utf8','base64','decryptString','createDecipher','bluebird','lodash','../../config/environment','../../config/logger','session','aes-256-ctr'];(function(_0x189c9e,_0x1c3b55){var _0x3f38ca=function(_0x4c05ec){while(--_0x4c05ec){_0x189c9e['push'](_0x189c9e['shift']());}};_0x3f38ca(++_0x1c3b55);}(_0x2fb0,0x192));var _0x02fb=function(_0x12aa2d,_0x352204){_0x12aa2d=_0x12aa2d-0x0;var _0x45a2e3=_0x2fb0[_0x12aa2d];return _0x45a2e3;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x02fb('0x0'));var _=require(_0x02fb('0x1'));var config=require(_0x02fb('0x2'));var logger=require(_0x02fb('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x02fb('0x4')],'algorithm':_0x02fb('0x5')};const fileOptions={'algorithm':_0x02fb('0x6')};if(config[_0x02fb('0x7')]&&config[_0x02fb('0x7')][_0x02fb('0x8')]){var isSupported=isAlgorithmSupported(config[_0x02fb('0x7')][_0x02fb('0x8')]);if(isSupported){fileOptions[_0x02fb('0x8')]=config[_0x02fb('0x7')][_0x02fb('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x02fb('0x9')](',\x20');logger[_0x02fb('0xa')](config[_0x02fb('0x7')][_0x02fb('0x8')],_0x02fb('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x37d367){return AES_SUPPORTED_RX[_0x02fb('0xc')](_0x37d367);}function getSupportedCiphers(){return crypto[_0x02fb('0xd')]()[_0x02fb('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x5533e3){return getSupportedCiphers()['indexOf'](_0x5533e3)>-0x1;}function combineOptions(_0x34c388){var _0x254eb1={};for(var _0x4cfad9 in fileOptions){if(fileOptions[_0x02fb('0xf')](_0x4cfad9)){_0x254eb1[_0x4cfad9]=fileOptions[_0x4cfad9];}}if(_0x34c388){for(var _0x2bb421 in _0x34c388){if(_0x34c388['hasOwnProperty'](_0x2bb421)){_0x254eb1[_0x2bb421]=_0x34c388[_0x2bb421];}}}return _0x254eb1;}exports[_0x02fb('0x10')]=function(_0x38116e,_0x5e6b6e,_0x26c37c,_0x373e56){return new BPromise(function(_0x3b3cdc,_0x5c3dc1){_0x373e56=combineOptions(_0x373e56);var _0x392e72=new Buffer(_0x26c37c);var _0x3a86d6=fs[_0x02fb('0x11')](_0x38116e);var _0x2929e1=fs['createWriteStream'](_0x5e6b6e);var _0x115b28=crypto[_0x02fb('0x12')](_0x373e56['algorithm'],_0x392e72);_0x3a86d6['on'](_0x02fb('0x13'),function(_0x22f090){var _0x258de8=new Buffer(_0x115b28[_0x02fb('0x14')](_0x22f090),'binary');_0x2929e1[_0x02fb('0x15')](_0x258de8);});_0x3a86d6['on'](_0x02fb('0x16'),function(){try{var _0xb0e8ba=new Buffer(_0x115b28[_0x02fb('0x17')](_0x02fb('0x18')),_0x02fb('0x18'));_0x2929e1['write'](_0xb0e8ba);_0x2929e1[_0x02fb('0x16')]();_0x2929e1['on'](_0x02fb('0x19'),function(){return _0x3b3cdc(_0x5e6b6e);});}catch(_0x3e7b3a){fs[_0x02fb('0x1a')](_0x5e6b6e);return _0x5c3dc1(_0x3e7b3a);}});});};exports['decryptFile']=function(_0x5b07f2,_0x2f074f,_0x362c21,_0x5b2e27){return new BPromise(function(_0x52b1ca,_0x433d5a){_0x5b2e27=combineOptions(_0x5b2e27);var _0x484d7c=new Buffer(_0x362c21);var _0x38ea25=fs[_0x02fb('0x11')](_0x5b07f2);var _0x1e0fc7=fs[_0x02fb('0x1b')](_0x2f074f);var _0x4dee77=crypto['createDecipher'](_0x5b2e27[_0x02fb('0x8')],_0x484d7c);_0x38ea25['on'](_0x02fb('0x13'),function(_0x1caad6){var _0x5142c3=new Buffer(_0x4dee77['update'](_0x1caad6),_0x02fb('0x18'));_0x1e0fc7[_0x02fb('0x15')](_0x5142c3);});_0x38ea25['on'](_0x02fb('0x16'),function(){try{var _0x1caf81=new Buffer(_0x4dee77['final']('binary'),_0x02fb('0x18'));_0x1e0fc7[_0x02fb('0x15')](_0x1caf81);_0x1e0fc7[_0x02fb('0x16')]();_0x1e0fc7['on']('close',function(){return _0x52b1ca(_0x2f074f);});}catch(_0x421071){fs[_0x02fb('0x1a')](_0x2f074f);return _0x433d5a(_0x421071);}});});};exports[_0x02fb('0x1c')]=function(_0x3c0c07,_0x1095a9,_0x46e711){var _0x83e8d7=_0x46e711||stringOptions['algorithm'];var _0x29f06d=_0x1095a9||stringOptions[_0x02fb('0x1d')];var _0x3eee42=crypto[_0x02fb('0x12')](_0x83e8d7,_0x29f06d);var _0x2c8ccf=_0x3eee42['update'](_0x3c0c07,_0x02fb('0x1e'),_0x02fb('0x1f'));_0x2c8ccf+=_0x3eee42[_0x02fb('0x17')](_0x02fb('0x1f'));return _0x2c8ccf;};exports[_0x02fb('0x20')]=function(_0x4c959d,_0x10ef1e,_0x4e6120){var _0x3c6f14=_0x4e6120||stringOptions[_0x02fb('0x8')];var _0x37694e=_0x10ef1e||stringOptions[_0x02fb('0x1d')];var _0x5687a0=crypto[_0x02fb('0x21')](_0x3c6f14,_0x37694e);var _0x3b2fe2=_0x5687a0[_0x02fb('0x14')](_0x4c959d,_0x02fb('0x1f'),'utf8');_0x3b2fe2+=_0x5687a0['final']('utf8');return _0x3b2fe2;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 04f504b..b1624bf 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 _0x8be3=['%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','.csv','length','mkdirSync','join','%s%d.%s','csv','%s.%s','writeFileSync','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','Empty','range','num','forEach','push'];(function(_0x589cbe,_0x53b2a7){var _0x5b0548=function(_0x502ce1){while(--_0x502ce1){_0x589cbe['push'](_0x589cbe['shift']());}};_0x5b0548(++_0x53b2a7);}(_0x8be3,0x13a));var _0x38be=function(_0x5a660a,_0x3a388f){_0x5a660a=_0x5a660a-0x0;var _0x53a90b=_0x8be3[_0x5a660a];return _0x53a90b;};'use strict';var util=require(_0x38be('0x0'));var path=require(_0x38be('0x1'));var _=require(_0x38be('0x2'));var csv=require(_0x38be('0x3'));var fs=require('fs');var BPromise=require(_0x38be('0x4'));var zipdir=require(_0x38be('0x5'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x38be('0x6'))[_0x38be('0x7')];var logger=require(_0x38be('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x38be('0x9')][0x2]);var QUERY=process[_0x38be('0x9')][0x3];var PATH=process[_0x38be('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4c6051,_0x25ed24){var _0xd9ae43={'status':_0x4c6051};var _0x70d2b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x25ed24){_0xd9ae43[_0x38be('0xa')]=_0x25ed24;}return db[_0x38be('0xb')][_0x38be('0xc')](_0xd9ae43,_0x70d2b);}function main(){var _0x1bbf82=0x1388;var _0x21f451;logger['info'](util[_0x38be('0xd')](_0x38be('0xe'),EXTRACTED_REPORT_ID,_0x38be('0xf')));return db['Setting'][_0x38be('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x38be('0x11'),_0x38be('0x12')]})[_0x38be('0x13')](function(_0x11bf14){if(_0x11bf14){_0x21f451=_0x11bf14;_0x1bbf82=_0x21f451[_0x38be('0x12')]||0x1388;}})[_0x38be('0x13')](function(){return dbH['sequelize'][_0x38be('0x14')](util[_0x38be('0xd')](_0x38be('0x15'),QUERY),{'type':dbH[_0x38be('0x16')][_0x38be('0x17')]['SELECT']});})['then'](function(_0x4e6d6d){if(!_0x4e6d6d[0x0]['num']){return analyticExtractedReport(_0x38be('0x18'));}var _0x232b9c=[];var _0x1743da=0x0;if(_0x21f451[_0x38be('0x11')]){if(_0x4e6d6d&&_0x4e6d6d['length']){var _0x56f083=_[_0x38be('0x19')](_0x4e6d6d[0x0][_0x38be('0x1a')]/_0x1bbf82);var _0x5d3cc8=Number['isInteger'](_0x4e6d6d[0x0][_0x38be('0x1a')]/_0x1bbf82)?_0x4e6d6d[0x0][_0x38be('0x1a')]%_0x1bbf82:0x0;_0x56f083[_0x38be('0x1b')](function(_0x3330ec){if(_0x3330ec>0x0){_0x1743da+=_0x1bbf82;}_0x232b9c[_0x38be('0x1c')](dbH[_0x38be('0x16')][_0x38be('0x14')](util['format'](_0x38be('0x1d'),QUERY,_0x1bbf82,_0x1743da),{'type':dbH['sequelize']['QueryTypes'][_0x38be('0x1e')]}));});if(_0x5d3cc8>0x0){_0x1743da+=_0x1bbf82;_0x232b9c[_0x38be('0x1c')](dbH[_0x38be('0x16')][_0x38be('0x14')](util[_0x38be('0xd')](_0x38be('0x1d'),QUERY,_0x5d3cc8,_0x1743da),{'type':dbH[_0x38be('0x16')][_0x38be('0x17')][_0x38be('0x1e')]}));}}}else{_0x232b9c[_0x38be('0x1c')](dbH[_0x38be('0x16')][_0x38be('0x14')](QUERY,{'type':dbH[_0x38be('0x16')][_0x38be('0x17')][_0x38be('0x1e')]}));}var _0x3e9a13=path[_0x38be('0x1f')](PATH);var _0x225052=path['basename'](PATH,_0x38be('0x20'));var _0x48b5d3=_0x21f451[_0x38be('0x11')]&&_0x232b9c[_0x38be('0x21')]>0x1;var _0x6d1513=[];if(!fs['existsSync'](path['join'](_0x3e9a13,_0x225052))&&_0x48b5d3){fs[_0x38be('0x22')](path[_0x38be('0x23')](_0x3e9a13,_0x225052));}return BPromise['each'](_0x232b9c,function(_0x4aadaa){_0x6d1513['push'](_0x4aadaa);})[_0x38be('0x13')](function(){for(var _0x2de710=0x0;_0x2de710<_0x6d1513[_0x38be('0x21')];_0x2de710+=0x1){var _0x35ecab;var _0xf3589e=_0x6d1513[_0x2de710];if(_0x48b5d3){_0x35ecab=path[_0x38be('0x23')](_0x3e9a13,_0x225052,util['format'](_0x38be('0x24'),_0x225052,_0x2de710,_0x38be('0x25')));}else{_0x35ecab=path[_0x38be('0x23')](_0x3e9a13,util[_0x38be('0xd')](_0x38be('0x26'),_0x225052,_0x38be('0x25')));}fs[_0x38be('0x27')](_0x35ecab,csv(_0xf3589e));}})['then'](function(){if(_0x48b5d3){return new Promise(function(_0xea6360){zipdir(path['join'](_0x3e9a13,_0x225052),{'saveTo':path[_0x38be('0x23')](_0x3e9a13,util[_0x38be('0xd')](_0x38be('0x26'),_0x225052,_0x38be('0x28')))},function(_0x5899b9,_0x4ac250){rimraf(path[_0x38be('0x23')](_0x3e9a13,_0x225052),function(){});_0xea6360('zip\x20finished');});});}})[_0x38be('0x13')](function(){logger[_0x38be('0x29')](util['format'](_0x38be('0x2a'),EXTRACTED_REPORT_ID,_0x38be('0xf')));return analyticExtractedReport('Completed',_0x48b5d3?util[_0x38be('0xd')](_0x38be('0x26'),_0x225052,_0x48b5d3?_0x38be('0x28'):_0x38be('0x25')):null);});})[_0x38be('0x2b')](function(_0x115414){logger[_0x38be('0x29')](util['format'](_0x38be('0x2c'),EXTRACTED_REPORT_ID,_0x38be('0xf')),util[_0x38be('0x2d')](_0x115414,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x38be('0x2e'));})[_0x38be('0x2f')](function(){process[_0x38be('0x30')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x578e=['query','dirname','existsSync','mkdirSync','join','each','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x578e,0x1ca));var _0xe578=function(_0x329ea0,_0x107160){_0x329ea0=_0x329ea0-0x0;var _0x58fdf8=_0x578e[_0x329ea0];return _0x58fdf8;};'use strict';var util=require(_0xe578('0x0'));var path=require(_0xe578('0x1'));var _=require(_0xe578('0x2'));var csv=require(_0xe578('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xe578('0x4'));var rimraf=require(_0xe578('0x5'));var db=require(_0xe578('0x6'))['db'];var dbH=require(_0xe578('0x6'))[_0xe578('0x7')];var logger=require(_0xe578('0x8'))(_0xe578('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xe578('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xe578('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x213044,_0xa49900){var _0x2ce963={'status':_0x213044};var _0x4b9ca9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xa49900){_0x2ce963['savename']=_0xa49900;}return db[_0xe578('0xb')]['update'](_0x2ce963,_0x4b9ca9);}function main(){var _0x4f7861=0x1388;var _0x5b543a;logger[_0xe578('0xc')](util[_0xe578('0xd')](_0xe578('0xe'),EXTRACTED_REPORT_ID,_0xe578('0xf')));return db[_0xe578('0x10')][_0xe578('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe578('0x12'),_0xe578('0x13')]})[_0xe578('0x14')](function(_0x15e08f){if(_0x15e08f){_0x5b543a=_0x15e08f;_0x4f7861=_0x5b543a['splitSizeCsv']||0x1388;}})[_0xe578('0x14')](function(){return dbH['sequelize']['query'](util[_0xe578('0xd')](_0xe578('0x15'),QUERY),{'type':dbH[_0xe578('0x16')][_0xe578('0x17')][_0xe578('0x18')]});})[_0xe578('0x14')](function(_0x394749){if(!_0x394749[0x0][_0xe578('0x19')]){return analyticExtractedReport(_0xe578('0x1a'));}var _0x18b1c0=[];var _0x75f68d=0x0;if(_0x5b543a[_0xe578('0x12')]){if(_0x394749&&_0x394749[_0xe578('0x1b')]){var _0x399077=_[_0xe578('0x1c')](_0x394749[0x0]['num']/_0x4f7861);var _0x22e273=Number['isInteger'](_0x394749[0x0][_0xe578('0x19')]/_0x4f7861)?_0x394749[0x0][_0xe578('0x19')]%_0x4f7861:0x0;_0x399077[_0xe578('0x1d')](function(_0x385206){if(_0x385206>0x0){_0x75f68d+=_0x4f7861;}_0x18b1c0[_0xe578('0x1e')](dbH['sequelize']['query'](util[_0xe578('0xd')](_0xe578('0x1f'),QUERY,_0x4f7861,_0x75f68d),{'type':dbH[_0xe578('0x16')][_0xe578('0x17')]['SELECT']}));});if(_0x22e273>0x0){_0x75f68d+=_0x4f7861;_0x18b1c0[_0xe578('0x1e')](dbH['sequelize']['query'](util[_0xe578('0xd')](_0xe578('0x1f'),QUERY,_0x22e273,_0x75f68d),{'type':dbH[_0xe578('0x16')][_0xe578('0x17')][_0xe578('0x18')]}));}}}else{_0x18b1c0[_0xe578('0x1e')](dbH[_0xe578('0x16')][_0xe578('0x20')](QUERY,{'type':dbH[_0xe578('0x16')]['QueryTypes']['SELECT']}));}var _0xddf064=path[_0xe578('0x21')](PATH);var _0x40de89=path['basename'](PATH,'.csv');var _0x1a546b=_0x5b543a[_0xe578('0x12')]&&_0x18b1c0[_0xe578('0x1b')]>0x1;var _0x45029f=[];if(!fs[_0xe578('0x22')](path['join'](_0xddf064,_0x40de89))&&_0x1a546b){fs[_0xe578('0x23')](path[_0xe578('0x24')](_0xddf064,_0x40de89));}return BPromise[_0xe578('0x25')](_0x18b1c0,function(_0x419b95){_0x45029f[_0xe578('0x1e')](_0x419b95);})[_0xe578('0x14')](function(){for(var _0x5024a8=0x0;_0x5024a8<_0x45029f['length'];_0x5024a8+=0x1){var _0x4691c4;var _0x2da922=_0x45029f[_0x5024a8];if(_0x1a546b){_0x4691c4=path[_0xe578('0x24')](_0xddf064,_0x40de89,util[_0xe578('0xd')]('%s%d.%s',_0x40de89,_0x5024a8,_0xe578('0x26')));}else{_0x4691c4=path[_0xe578('0x24')](_0xddf064,util[_0xe578('0xd')](_0xe578('0x27'),_0x40de89,_0xe578('0x26')));}fs[_0xe578('0x28')](_0x4691c4,csv(_0x2da922));}})[_0xe578('0x14')](function(){if(_0x1a546b){return new Promise(function(_0x159dcb){zipdir(path[_0xe578('0x24')](_0xddf064,_0x40de89),{'saveTo':path[_0xe578('0x24')](_0xddf064,util['format'](_0xe578('0x27'),_0x40de89,_0xe578('0x29')))},function(_0x378104,_0x9694bc){rimraf(path[_0xe578('0x24')](_0xddf064,_0x40de89),function(){});_0x159dcb(_0xe578('0x2a'));});});}})['then'](function(){logger[_0xe578('0xc')](util['format'](_0xe578('0x2b'),EXTRACTED_REPORT_ID,_0xe578('0xf')));return analyticExtractedReport(_0xe578('0x2c'),_0x1a546b?util[_0xe578('0xd')](_0xe578('0x27'),_0x40de89,_0x1a546b?'zip':_0xe578('0x26')):null);});})[_0xe578('0x2d')](function(_0x302a17){logger[_0xe578('0xc')](util['format'](_0xe578('0x2e'),EXTRACTED_REPORT_ID,_0xe578('0xf')),util['inspect'](_0x302a17,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xe578('0x2f')](function(){process[_0xe578('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 7e35080..0cc9c12 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 _0x901c=['\x20/\x20','footer','Arial','right','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.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','pipe','createWriteStream','finish','error','createPdfFromHTML','catch','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','map','tableHeader','pick','length','auto','body','push','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','before','margin','landscape'];(function(_0x2e914,_0x1c7566){var _0x936e45=function(_0x1b22e4){while(--_0x1b22e4){_0x2e914['push'](_0x2e914['shift']());}};_0x936e45(++_0x1c7566);}(_0x901c,0x14c));var _0xc901=function(_0x193ac0,_0xf42cc3){_0x193ac0=_0x193ac0-0x0;var _0x2134bf=_0x901c[_0x193ac0];return _0x2134bf;};'use strict';var _=require(_0xc901('0x0'));var fs=require('fs');var util=require(_0xc901('0x1'));var path=require(_0xc901('0x2'));var moment=require(_0xc901('0x3'));var htmlToPdfmake=require(_0xc901('0x4'));var PdfPrinter=require(_0xc901('0x5'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require('jsdom')[_0xc901('0x6')];var window=new JSDOM('')[_0xc901('0x7')];var BPromise=require(_0xc901('0x8'));var db=require('../../mysqldb')['db'];var dbH=require(_0xc901('0x9'))[_0xc901('0xa')];var logger=require(_0xc901('0xb'))(_0xc901('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xc901('0xd')][0x2]);var QUERY=process[_0xc901('0xd')][0x3];var PATH=process['argv'][0x4];var NAME=process['argv'][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x30dc91,_0x311787){var _0x458755={'status':_0x30dc91};var _0x2bb94b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x311787){_0x458755[_0xc901('0xe')]=_0x311787;}return db['AnalyticExtractedReport']['update'](_0x458755,_0x2bb94b);}function getHeaders(_0x3acb33){return _[_0xc901('0xf')](_0x3acb33,function(_0x50983a){return{'text':_0x50983a,'style':_0xc901('0x10')};});}function getRows(_0x38abf1,_0x3ac845){return _['map'](_0x3ac845,function(_0x426ccd){return _(_0x426ccd)[_0xc901('0x11')](_0x38abf1)[_0xc901('0xf')](function(_0x524a74){return _0x524a74?_['toString'](_0x524a74):'';})['value']();});}function createTable(_0x5549d4,_0x4b71c6){var _0x15e9a9={'widths':_['fill'](Array(_0x5549d4[_0xc901('0x12')]),0x91),'heights':function(_0x1b3e46){return _0x1b3e46===0x0?_0xc901('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x5e6b28=getHeaders(_0x5549d4);_0x15e9a9[_0xc901('0x14')][_0xc901('0x15')](_0x5e6b28);var _0x34446b=getRows(_0x5549d4,_0x4b71c6);_0x15e9a9[_0xc901('0x14')]=_0x15e9a9['body']['concat'](_0x34446b);return _0x15e9a9;}function createTables(_0x437690){var _0x5f0ab8=[];var _0x1a8c63=_[_0xc901('0x16')](Object[_0xc901('0x17')](_0x437690[0x0]),0x5);_0x1a8c63[_0xc901('0x18')](function(_0x4204c7){_0x5f0ab8[_0xc901('0x15')](createTable(_0x4204c7,_0x437690));});return _0x5f0ab8;}function getPDFDocDefinition(_0x39ce82){var _0x1e67aa=util[_0xc901('0x19')](_0xc901('0x1a'),NAME,EXTRACTED_REPORT[_0xc901('0x1b')],moment(EXTRACTED_REPORT['startDate'])[_0xc901('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0xc901('0x1c')])[_0xc901('0x19')](FORMAT));var _0x142437=[];for(var _0x497fd8=0x0;_0x497fd8<_0x39ce82[_0xc901('0x12')];_0x497fd8++){var _0x2d4ebe=[];if(_0x497fd8===0x0){_0x2d4ebe[_0xc901('0x15')]({'text':_0x1e67aa,'style':'header'});}var _0x3ac3ea={'table':_0x39ce82[_0x497fd8]};if(_0x497fd8>0x0){_0x3ac3ea['pageBreak']=_0xc901('0x1d');_0x3ac3ea[_0xc901('0x1e')]=[0x0,0x46,0x0,0x0];}_0x2d4ebe[_0xc901('0x15')](_0x3ac3ea);_0x142437[_0xc901('0x15')](_0x2d4ebe);}return{'pageSize':'A4','pageOrientation':_0xc901('0x1f'),'content':_0x142437,'footer':function(_0x5cc66f,_0x470775){return{'text':_0x5cc66f['toString']()+_0xc901('0x20')+_0x470775,'style':_0xc901('0x21')};},'defaultStyle':{'font':_0xc901('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xc901('0x23'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3a5966){var _0x5279db=0x1388;var _0x5bfe87;if(!_0x3a5966[0x0][_0xc901('0x24')]){return analyticExtractedReport(_0xc901('0x25'));}return db[_0xc901('0x26')][_0xc901('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc901('0x28'),_0xc901('0x29')]})[_0xc901('0x2a')](function(_0x136e1c){if(_0x136e1c){_0x5bfe87=_0x136e1c;_0x5279db=_0x5bfe87[_0xc901('0x29')]||0x3e8;}})[_0xc901('0x2a')](function(){var _0x12f29d=[];var _0x1af6ee=0x0;if(_0x5bfe87[_0xc901('0x28')]){if(_0x3a5966&&_0x3a5966[_0xc901('0x12')]){var _0x52baa7=_[_0xc901('0x2b')](_0x3a5966[0x0][_0xc901('0x24')]/_0x5279db);var _0x22b151=Number[_0xc901('0x2c')](_0x3a5966[0x0][_0xc901('0x24')]/_0x5279db)?_0x3a5966[0x0]['num']%_0x5279db:0x0;_0x52baa7[_0xc901('0x18')](function(_0x427fcd){if(_0x427fcd>0x0){_0x1af6ee+=_0x5279db;}_0x12f29d[_0xc901('0x15')](dbH[_0xc901('0x2d')][_0xc901('0x2e')](util[_0xc901('0x19')](_0xc901('0x2f'),QUERY,_0x5279db,_0x1af6ee),{'type':dbH[_0xc901('0x2d')][_0xc901('0x30')][_0xc901('0x31')]}));});if(_0x22b151>0x0){_0x1af6ee+=_0x5279db;_0x12f29d[_0xc901('0x15')](dbH[_0xc901('0x2d')][_0xc901('0x2e')](util[_0xc901('0x19')](_0xc901('0x2f'),QUERY,_0x22b151,_0x1af6ee),{'type':dbH['sequelize'][_0xc901('0x30')][_0xc901('0x31')]}));}}}else{_0x12f29d['push'](dbH[_0xc901('0x2d')]['query'](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xc901('0x31')]}));}var _0x338a15=path['dirname'](PATH);var _0x567ec0=path[_0xc901('0x32')](PATH,_0xc901('0x33'));var _0x7a3fe2=_0x5bfe87[_0xc901('0x28')]&&_0x12f29d[_0xc901('0x12')]>0x1;var _0x75f548=[];if(!fs[_0xc901('0x34')](path[_0xc901('0x35')](_0x338a15,_0x567ec0))&&_0x7a3fe2){fs[_0xc901('0x36')](path['join'](_0x338a15,_0x567ec0));}return BPromise[_0xc901('0x37')](_0x12f29d,function(_0x33a74f){_0x75f548['push'](_0x33a74f);})['then'](function(){var _0x23c643=[];for(var _0x1769a2=0x0;_0x1769a2<_0x75f548['length'];_0x1769a2+=0x1){var _0x168961=_0x75f548[_0x1769a2];var _0x5911f4=createTables(_[_0xc901('0x38')](_0x168961));var _0x34534d;var _0x1d7e8b=getPDFDocDefinition(_0x5911f4);var _0x419d30=getPDFPrinter();var _0x3450dd=_0x419d30[_0xc901('0x39')](_0x1d7e8b);if(_0x7a3fe2){_0x34534d=path[_0xc901('0x35')](_0x338a15,_0x567ec0,util['format'](_0xc901('0x3a'),_0x567ec0,_0x1769a2,_0xc901('0x3b')));}else{_0x34534d=path[_0xc901('0x35')](_0x338a15,util[_0xc901('0x19')](_0xc901('0x3c'),_0x567ec0,'pdf'));}_0x23c643[_0xc901('0x15')](writePDFDocument(_0x3450dd,_0x34534d));}return Promise[_0xc901('0x3d')](_0x23c643);})[_0xc901('0x2a')](function(){if(_0x7a3fe2){return new Promise(function(_0x34c3d3){zipdir(path[_0xc901('0x35')](_0x338a15,_0x567ec0),{'saveTo':path['join'](_0x338a15,util[_0xc901('0x19')](_0xc901('0x3c'),_0x567ec0,_0xc901('0x3e')))},function(){rimraf(path[_0xc901('0x35')](_0x338a15,_0x567ec0),function(){});_0x34c3d3(_0xc901('0x3f'));});});}})[_0xc901('0x2a')](function(){if(!_0x7a3fe2)return;rimraf(path['join'](_0x338a15,_0x567ec0),function(){});})[_0xc901('0x2a')](function(){logger[_0xc901('0x40')](util[_0xc901('0x19')](_0xc901('0x41'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xc901('0x42'),_0x7a3fe2?util[_0xc901('0x19')]('%s.%s',_0x567ec0,_0x7a3fe2?_0xc901('0x3e'):_0xc901('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xc901('0x40')](util[_0xc901('0x19')](_0xc901('0x43'),EXTRACTED_REPORT_ID,_0xc901('0x44')));return db[_0xc901('0x45')][_0xc901('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xc901('0x2a')](function(_0x3e966b){EXTRACTED_REPORT=_0x3e966b;return dbH[_0xc901('0x2d')][_0xc901('0x2e')](util[_0xc901('0x19')](_0xc901('0x47'),QUERY),{'type':dbH[_0xc901('0x2d')][_0xc901('0x30')][_0xc901('0x31')]});})[_0xc901('0x2a')](extractReport)['catch'](function(_0x2d2980){logger[_0xc901('0x40')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc901('0x44')),util['inspect'](_0x2d2980,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc901('0x48'));})[_0xc901('0x49')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4646b8=new PdfPrinter({'Arial':{'normal':__dirname+_0xc901('0x4a'),'bold':__dirname+_0xc901('0x4b'),'italics':__dirname+_0xc901('0x4c'),'bolditalics':__dirname+_0xc901('0x4d')}});return _0x4646b8;}function getPDFDocDefinitionFromHTML(_0x2da704,_0x3abf0d){var _0x397d25=util[_0xc901('0x19')](_0xc901('0x4e'),_0x3abf0d[_0xc901('0x4f')],_0x3abf0d[_0xc901('0x50')]);var _0x2e45b5=moment()['format'](_0xc901('0x51'))['toString']();var _0x180bec=htmlToPdfmake(_0x2da704,{'window':window,'tableAutoSize':!![]});return{'content':[_0x180bec],'defaultStyle':{'font':_0xc901('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xc901('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xc901('0x52')}},'header':function(){return[{'text':_0xc901('0x53'),'style':'header'}];},'footer':function(_0x1d5513,_0x47beaa){return[{'text':util[_0xc901('0x19')](_0xc901('0x54'),_0x397d25,_0x1d5513,_0x47beaa,_0x2e45b5),'style':_0xc901('0x21')}];}};}function writePDFDocument(_0x23ea75,_0x579bd7){return new Promise(function(_0x59d628,_0x71a907){var _0x300c22=_0x23ea75[_0xc901('0x55')](fs[_0xc901('0x56')](_0x579bd7));_0x300c22['on'](_0xc901('0x57'),function(){_0x59d628(_0xc901('0x57'));});_0x300c22['on'](_0xc901('0x58'),function(_0x448788){_0x71a907(_0x448788);});_0x23ea75['end']();});}exports[_0xc901('0x59')]=function(_0xd32dbe,_0x29d8c7){var _0x444e3e=getPDFPrinter();var _0x401303=getPDFDocDefinitionFromHTML(_0xd32dbe,_0x29d8c7);var _0x14e2ef=_0x444e3e[_0xc901('0x39')](_0x401303);return writePDFDocument(_0x14e2ef,_0x29d8c7[_0xc901('0x2')])[_0xc901('0x5a')](function(_0x1837ac){throw _0x1837ac;});}; \ No newline at end of file +var _0x933b=['toString','value','fill','length','auto','body','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','push','header','pageBreak','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','split','then','splitSizePdf','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','.pdf','existsSync','join','mkdirSync','each','flatten','%s%d.%s','pdf','all','zip','zip\x20finished','info','%s.%s','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfKitDocument','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick'];(function(_0x434ec8,_0x384565){var _0xac1560=function(_0x1dc1f8){while(--_0x1dc1f8){_0x434ec8['push'](_0x434ec8['shift']());}};_0xac1560(++_0x384565);}(_0x933b,0x1b3));var _0xb933=function(_0x5abae0,_0x4e8b36){_0x5abae0=_0x5abae0-0x0;var _0x4700df=_0x933b[_0x5abae0];return _0x4700df;};'use strict';var _=require(_0xb933('0x0'));var fs=require('fs');var util=require(_0xb933('0x1'));var path=require(_0xb933('0x2'));var moment=require(_0xb933('0x3'));var htmlToPdfmake=require(_0xb933('0x4'));var PdfPrinter=require(_0xb933('0x5'));var zipdir=require(_0xb933('0x6'));var rimraf=require(_0xb933('0x7'));var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0xb933('0x8'));var db=require('../../mysqldb')['db'];var dbH=require(_0xb933('0x9'))[_0xb933('0xa')];var logger=require(_0xb933('0xb'))(_0xb933('0xc'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xb933('0xd')][0x3];var PATH=process[_0xb933('0xd')][0x4];var NAME=process[_0xb933('0xd')][0x5];var FORMAT=_0xb933('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x14edcc,_0x28f9f0){var _0x1fc254={'status':_0x14edcc};var _0x1bd296={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x28f9f0){_0x1fc254[_0xb933('0xf')]=_0x28f9f0;}return db[_0xb933('0x10')]['update'](_0x1fc254,_0x1bd296);}function getHeaders(_0x1e630e){return _[_0xb933('0x11')](_0x1e630e,function(_0x273b04){return{'text':_0x273b04,'style':_0xb933('0x12')};});}function getRows(_0x398780,_0x14216c){return _[_0xb933('0x11')](_0x14216c,function(_0x5cba63){return _(_0x5cba63)[_0xb933('0x13')](_0x398780)['map'](function(_0x42eb4f){return _0x42eb4f?_[_0xb933('0x14')](_0x42eb4f):'';})[_0xb933('0x15')]();});}function createTable(_0x21d280,_0x3bfa6f){var _0x4b1d17={'widths':_[_0xb933('0x16')](Array(_0x21d280[_0xb933('0x17')]),0x91),'heights':function(_0x2033b1){return _0x2033b1===0x0?_0xb933('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xdc6fd9=getHeaders(_0x21d280);_0x4b1d17[_0xb933('0x19')]['push'](_0xdc6fd9);var _0x3c01ec=getRows(_0x21d280,_0x3bfa6f);_0x4b1d17[_0xb933('0x19')]=_0x4b1d17[_0xb933('0x19')][_0xb933('0x1a')](_0x3c01ec);return _0x4b1d17;}function createTables(_0x54993f){var _0x1b5127=[];var _0x3cd161=_[_0xb933('0x1b')](Object[_0xb933('0x1c')](_0x54993f[0x0]),0x5);_0x3cd161[_0xb933('0x1d')](function(_0x40e45e){_0x1b5127['push'](createTable(_0x40e45e,_0x54993f));});return _0x1b5127;}function getPDFDocDefinition(_0xfb45b5){var _0x56c0b9=util[_0xb933('0x1e')](_0xb933('0x1f'),NAME,EXTRACTED_REPORT[_0xb933('0x20')],moment(EXTRACTED_REPORT[_0xb933('0x21')])[_0xb933('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0xb933('0x22')])[_0xb933('0x1e')](FORMAT));var _0x23a5c0=[];for(var _0x217206=0x0;_0x217206<_0xfb45b5[_0xb933('0x17')];_0x217206++){var _0x32490d=[];if(_0x217206===0x0){_0x32490d[_0xb933('0x23')]({'text':_0x56c0b9,'style':_0xb933('0x24')});}var _0x3b3ea0={'table':_0xfb45b5[_0x217206]};if(_0x217206>0x0){_0x3b3ea0[_0xb933('0x25')]='before';_0x3b3ea0[_0xb933('0x26')]=[0x0,0x46,0x0,0x0];}_0x32490d[_0xb933('0x23')](_0x3b3ea0);_0x23a5c0[_0xb933('0x23')](_0x32490d);}return{'pageSize':'A4','pageOrientation':_0xb933('0x27'),'content':_0x23a5c0,'footer':function(_0x47a25c,_0x5cb320){return{'text':_0x47a25c[_0xb933('0x14')]()+_0xb933('0x28')+_0x5cb320,'style':_0xb933('0x29')};},'defaultStyle':{'font':_0xb933('0x2a')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xb933('0x2b')},'footer':{'alignment':_0xb933('0x2c'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x478723){var _0x4e92c6=0x1388;var _0x220d9a;if(!_0x478723[0x0][_0xb933('0x2d')]){return analyticExtractedReport(_0xb933('0x2e'));}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb933('0x2f'),'splitSizePdf']})[_0xb933('0x30')](function(_0x5f0c65){if(_0x5f0c65){_0x220d9a=_0x5f0c65;_0x4e92c6=_0x220d9a[_0xb933('0x31')]||0x3e8;}})[_0xb933('0x30')](function(){var _0x55b438=[];var _0x5cee08=0x0;if(_0x220d9a['split']){if(_0x478723&&_0x478723['length']){var _0x5a89f2=_[_0xb933('0x32')](_0x478723[0x0][_0xb933('0x2d')]/_0x4e92c6);var _0x10a1d4=Number[_0xb933('0x33')](_0x478723[0x0][_0xb933('0x2d')]/_0x4e92c6)?_0x478723[0x0][_0xb933('0x2d')]%_0x4e92c6:0x0;_0x5a89f2[_0xb933('0x1d')](function(_0x2392c5){if(_0x2392c5>0x0){_0x5cee08+=_0x4e92c6;}_0x55b438['push'](dbH[_0xb933('0x34')][_0xb933('0x35')](util[_0xb933('0x1e')](_0xb933('0x36'),QUERY,_0x4e92c6,_0x5cee08),{'type':dbH['sequelize'][_0xb933('0x37')][_0xb933('0x38')]}));});if(_0x10a1d4>0x0){_0x5cee08+=_0x4e92c6;_0x55b438[_0xb933('0x23')](dbH['sequelize'][_0xb933('0x35')](util[_0xb933('0x1e')](_0xb933('0x36'),QUERY,_0x10a1d4,_0x5cee08),{'type':dbH[_0xb933('0x34')]['QueryTypes'][_0xb933('0x38')]}));}}}else{_0x55b438[_0xb933('0x23')](dbH[_0xb933('0x34')]['query'](QUERY,{'type':dbH[_0xb933('0x34')]['QueryTypes'][_0xb933('0x38')]}));}var _0x24d109=path['dirname'](PATH);var _0xd9a09e=path['basename'](PATH,_0xb933('0x39'));var _0x34e462=_0x220d9a[_0xb933('0x2f')]&&_0x55b438['length']>0x1;var _0xe1446=[];if(!fs[_0xb933('0x3a')](path[_0xb933('0x3b')](_0x24d109,_0xd9a09e))&&_0x34e462){fs[_0xb933('0x3c')](path[_0xb933('0x3b')](_0x24d109,_0xd9a09e));}return BPromise[_0xb933('0x3d')](_0x55b438,function(_0x4155ff){_0xe1446[_0xb933('0x23')](_0x4155ff);})[_0xb933('0x30')](function(){var _0x5e4e22=[];for(var _0x30aa1b=0x0;_0x30aa1b<_0xe1446[_0xb933('0x17')];_0x30aa1b+=0x1){var _0x1a695e=_0xe1446[_0x30aa1b];var _0x5c05ae=createTables(_[_0xb933('0x3e')](_0x1a695e));var _0x72ed78;var _0x48256a=getPDFDocDefinition(_0x5c05ae);var _0x723945=getPDFPrinter();var _0x57d3d3=_0x723945['createPdfKitDocument'](_0x48256a);if(_0x34e462){_0x72ed78=path[_0xb933('0x3b')](_0x24d109,_0xd9a09e,util[_0xb933('0x1e')](_0xb933('0x3f'),_0xd9a09e,_0x30aa1b,_0xb933('0x40')));}else{_0x72ed78=path['join'](_0x24d109,util['format']('%s.%s',_0xd9a09e,_0xb933('0x40')));}_0x5e4e22[_0xb933('0x23')](writePDFDocument(_0x57d3d3,_0x72ed78));}return Promise[_0xb933('0x41')](_0x5e4e22);})[_0xb933('0x30')](function(){if(_0x34e462){return new Promise(function(_0x1cc692){zipdir(path['join'](_0x24d109,_0xd9a09e),{'saveTo':path['join'](_0x24d109,util[_0xb933('0x1e')]('%s.%s',_0xd9a09e,_0xb933('0x42')))},function(){rimraf(path[_0xb933('0x3b')](_0x24d109,_0xd9a09e),function(){});_0x1cc692(_0xb933('0x43'));});});}})[_0xb933('0x30')](function(){if(!_0x34e462)return;rimraf(path[_0xb933('0x3b')](_0x24d109,_0xd9a09e),function(){});})['then'](function(){logger[_0xb933('0x44')](util[_0xb933('0x1e')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport('Completed',_0x34e462?util[_0xb933('0x1e')](_0xb933('0x45'),_0xd9a09e,_0x34e462?_0xb933('0x42'):_0xb933('0x40')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xb933('0x44')](util[_0xb933('0x1e')](_0xb933('0x46'),EXTRACTED_REPORT_ID,_0xb933('0x47')));return db[_0xb933('0x10')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xb933('0x30')](function(_0x133371){EXTRACTED_REPORT=_0x133371;return dbH[_0xb933('0x34')][_0xb933('0x35')](util[_0xb933('0x1e')](_0xb933('0x48'),QUERY),{'type':dbH['sequelize'][_0xb933('0x37')][_0xb933('0x38')]});})[_0xb933('0x30')](extractReport)['catch'](function(_0x29c974){logger['info'](util[_0xb933('0x1e')](_0xb933('0x49'),EXTRACTED_REPORT_ID,_0xb933('0x47')),util['inspect'](_0x29c974,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xb933('0x4a')](function(){process[_0xb933('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x265c5a=new PdfPrinter({'Arial':{'normal':__dirname+_0xb933('0x4c'),'bold':__dirname+_0xb933('0x4d'),'italics':__dirname+_0xb933('0x4e'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x265c5a;}function getPDFDocDefinitionFromHTML(_0x131ca3,_0x3d0455){var _0x85a596=util[_0xb933('0x1e')](_0xb933('0x4f'),_0x3d0455['channel'],_0x3d0455[_0xb933('0x50')]);var _0x5b3f55=moment()[_0xb933('0x1e')](_0xb933('0x51'))[_0xb933('0x14')]();var _0x2fc8d2=htmlToPdfmake(_0x131ca3,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2fc8d2],'defaultStyle':{'font':_0xb933('0x2a')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xb933('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xb933('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xb933('0x52')}},'header':function(){return[{'text':_0xb933('0x53'),'style':_0xb933('0x24')}];},'footer':function(_0x1fa477,_0x2e8a61){return[{'text':util['format'](_0xb933('0x54'),_0x85a596,_0x1fa477,_0x2e8a61,_0x5b3f55),'style':_0xb933('0x29')}];}};}function writePDFDocument(_0x3e3f8f,_0x5bbf38){return new Promise(function(_0x3420f8,_0x5eaa1c){var _0xb56b2c=_0x3e3f8f[_0xb933('0x55')](fs[_0xb933('0x56')](_0x5bbf38));_0xb56b2c['on'](_0xb933('0x57'),function(){_0x3420f8(_0xb933('0x57'));});_0xb56b2c['on'](_0xb933('0x58'),function(_0x3f8b36){_0x5eaa1c(_0x3f8b36);});_0x3e3f8f[_0xb933('0x59')]();});}exports['createPdfFromHTML']=function(_0x11eec1,_0x84c413){var _0x505793=getPDFPrinter();var _0x124dd1=getPDFDocDefinitionFromHTML(_0x11eec1,_0x84c413);var _0x408c27=_0x505793[_0xb933('0x5a')](_0x124dd1);return writePDFDocument(_0x408c27,_0x84c413[_0xb933('0x2')])['catch'](function(_0x29d9c4){throw _0x29d9c4;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 0f4025a..f14679c 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 _0x29e5=['mkdirSync','each','%s%d.%s','xlsx','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','util','path','lodash','json2xls','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','range','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','join'];(function(_0xaf541a,_0x3afbf3){var _0x27936b=function(_0x3d4362){while(--_0x3d4362){_0xaf541a['push'](_0xaf541a['shift']());}};_0x27936b(++_0x3afbf3);}(_0x29e5,0x8f));var _0x529e=function(_0x2e186a,_0x3721bc){_0x2e186a=_0x2e186a-0x0;var _0xfbe4da=_0x29e5[_0x2e186a];return _0xfbe4da;};'use strict';var util=require(_0x529e('0x0'));var path=require(_0x529e('0x1'));var _=require(_0x529e('0x2'));var fs=require('fs');var json2xls=require(_0x529e('0x3'));var BPromise=require('bluebird');var zipdir=require(_0x529e('0x4'));var rimraf=require(_0x529e('0x5'));var db=require(_0x529e('0x6'))['db'];var dbH=require(_0x529e('0x6'))[_0x529e('0x7')];var logger=require(_0x529e('0x8'))(_0x529e('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x529e('0xa')][0x2]);var QUERY=process[_0x529e('0xa')][0x3];var PATH=process[_0x529e('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5ad181,_0x168295){var _0xd3e8c8={'status':_0x5ad181};var _0x1c9d00={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x168295){_0xd3e8c8[_0x529e('0xb')]=_0x168295;}return db[_0x529e('0xc')]['update'](_0xd3e8c8,_0x1c9d00);}function main(){var _0x3acbcc=0x1388;var _0x3a89b4;logger[_0x529e('0xd')](util[_0x529e('0xe')](_0x529e('0xf'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0x529e('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x529e('0x11')]})[_0x529e('0x12')](function(_0x49e37e){if(_0x49e37e){_0x3a89b4=_0x49e37e;_0x3acbcc=_0x3a89b4['splitSizeXlsx']||0x1388;}})[_0x529e('0x12')](function(){return dbH['sequelize'][_0x529e('0x13')](util[_0x529e('0xe')](_0x529e('0x14'),QUERY),{'type':dbH['sequelize'][_0x529e('0x15')][_0x529e('0x16')]});})[_0x529e('0x12')](function(_0x2e720f){if(!_0x2e720f[0x0][_0x529e('0x17')]){return analyticExtractedReport(_0x529e('0x18'));}var _0x1187c1=[];var _0x4793fe=0x0;if(_0x3a89b4[_0x529e('0x19')]){if(_0x2e720f&&_0x2e720f['length']){var _0x1640b6=_[_0x529e('0x1a')](_0x2e720f[0x0][_0x529e('0x17')]/_0x3acbcc);var _0x1ec84e=Number[_0x529e('0x1b')](_0x2e720f[0x0][_0x529e('0x17')]/_0x3acbcc)?_0x2e720f[0x0][_0x529e('0x17')]%_0x3acbcc:0x0;_0x1640b6['forEach'](function(_0x4e3033){if(_0x4e3033>0x0){_0x4793fe+=_0x3acbcc;}_0x1187c1['push'](dbH[_0x529e('0x1c')][_0x529e('0x13')](util[_0x529e('0xe')](_0x529e('0x1d'),QUERY,_0x3acbcc,_0x4793fe),{'type':dbH[_0x529e('0x1c')][_0x529e('0x15')][_0x529e('0x16')]}));});if(_0x1ec84e>0x0){_0x4793fe+=_0x3acbcc;_0x1187c1[_0x529e('0x1e')](dbH[_0x529e('0x1c')][_0x529e('0x13')](util[_0x529e('0xe')](_0x529e('0x1d'),QUERY,_0x1ec84e,_0x4793fe),{'type':dbH[_0x529e('0x1c')][_0x529e('0x15')]['SELECT']}));}}}else{_0x1187c1[_0x529e('0x1e')](dbH[_0x529e('0x1c')][_0x529e('0x13')](QUERY,{'type':dbH[_0x529e('0x1c')]['QueryTypes'][_0x529e('0x16')]}));}var _0x5ee005=path[_0x529e('0x1f')](PATH);var _0x3049c4=path['basename'](PATH,'.xlsx');var _0x55056f=_0x3a89b4[_0x529e('0x19')]&&_0x1187c1['length']>0x1;var _0x27398d=[];if(!fs['existsSync'](path[_0x529e('0x20')](_0x5ee005,_0x3049c4))&&_0x55056f){fs[_0x529e('0x21')](path[_0x529e('0x20')](_0x5ee005,_0x3049c4));}return BPromise[_0x529e('0x22')](_0x1187c1,function(_0x1fca56){_0x27398d[_0x529e('0x1e')](_0x1fca56);})[_0x529e('0x12')](function(){for(var _0x12b4aa=0x0;_0x12b4aa<_0x27398d['length'];_0x12b4aa+=0x1){var _0x5adfd1;var _0x1b240b=_0x27398d[_0x12b4aa];if(_0x55056f){_0x5adfd1=path[_0x529e('0x20')](_0x5ee005,_0x3049c4,util[_0x529e('0xe')](_0x529e('0x23'),_0x3049c4,_0x12b4aa,_0x529e('0x24')));}else{_0x5adfd1=path[_0x529e('0x20')](_0x5ee005,util[_0x529e('0xe')]('%s.%s',_0x3049c4,'xlsx'));}fs['writeFileSync'](_0x5adfd1,json2xls(_0x1b240b),'binary');}})[_0x529e('0x12')](function(){if(_0x55056f){return new Promise(function(_0x35f6e8){zipdir(path[_0x529e('0x20')](_0x5ee005,_0x3049c4),{'saveTo':path[_0x529e('0x20')](_0x5ee005,util[_0x529e('0xe')](_0x529e('0x25'),_0x3049c4,_0x529e('0x26')))},function(_0x110751,_0x2c75c8){rimraf(path[_0x529e('0x20')](_0x5ee005,_0x3049c4),function(){});_0x35f6e8('zip\x20finished');});});}})['then'](function(){logger[_0x529e('0xd')](util[_0x529e('0xe')](_0x529e('0x27'),EXTRACTED_REPORT_ID,_0x529e('0x28')));return analyticExtractedReport('Completed',_0x55056f?util['format']('%s.%s',_0x3049c4,_0x55056f?_0x529e('0x26'):_0x529e('0x24')):null);});})['catch'](function(_0x79ef0b){logger[_0x529e('0xd')](util['format'](_0x529e('0x29'),EXTRACTED_REPORT_ID,_0x529e('0x28')),util['inspect'](_0x79ef0b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x529e('0x2a'));})[_0x529e('0x2b')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x0590=['push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','length','existsSync','mkdirSync','join','%s%d.%s','xlsx','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','exit','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','forEach'];(function(_0x4e3d4b,_0x1f528d){var _0x17f2b1=function(_0x4ad3f3){while(--_0x4ad3f3){_0x4e3d4b['push'](_0x4e3d4b['shift']());}};_0x17f2b1(++_0x1f528d);}(_0x0590,0x166));var _0x0059=function(_0x56c723,_0x512a2e){_0x56c723=_0x56c723-0x0;var _0x3bdbb7=_0x0590[_0x56c723];return _0x3bdbb7;};'use strict';var util=require('util');var path=require('path');var _=require(_0x0059('0x0'));var fs=require('fs');var json2xls=require(_0x0059('0x1'));var BPromise=require(_0x0059('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x0059('0x3'));var db=require('../../mysqldb')['db'];var dbH=require(_0x0059('0x4'))[_0x0059('0x5')];var logger=require('../../config/logger')(_0x0059('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0059('0x7')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x0059('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x57b16e,_0xca9f50){var _0x23c5f5={'status':_0x57b16e};var _0x4c001f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xca9f50){_0x23c5f5[_0x0059('0x8')]=_0xca9f50;}return db[_0x0059('0x9')][_0x0059('0xa')](_0x23c5f5,_0x4c001f);}function main(){var _0x47e941=0x1388;var _0x1461c1;logger[_0x0059('0xb')](util[_0x0059('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x0059('0xd')));return db[_0x0059('0xe')][_0x0059('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0059('0x10'),_0x0059('0x11')]})[_0x0059('0x12')](function(_0x192ee1){if(_0x192ee1){_0x1461c1=_0x192ee1;_0x47e941=_0x1461c1['splitSizeXlsx']||0x1388;}})[_0x0059('0x12')](function(){return dbH[_0x0059('0x13')][_0x0059('0x14')](util[_0x0059('0xc')](_0x0059('0x15'),QUERY),{'type':dbH[_0x0059('0x13')]['QueryTypes'][_0x0059('0x16')]});})[_0x0059('0x12')](function(_0x4a1a22){if(!_0x4a1a22[0x0][_0x0059('0x17')]){return analyticExtractedReport(_0x0059('0x18'));}var _0x245d2d=[];var _0x33aadb=0x0;if(_0x1461c1[_0x0059('0x10')]){if(_0x4a1a22&&_0x4a1a22['length']){var _0x451a7c=_['range'](_0x4a1a22[0x0][_0x0059('0x17')]/_0x47e941);var _0x4eafa7=Number['isInteger'](_0x4a1a22[0x0]['num']/_0x47e941)?_0x4a1a22[0x0][_0x0059('0x17')]%_0x47e941:0x0;_0x451a7c[_0x0059('0x19')](function(_0x2dac1d){if(_0x2dac1d>0x0){_0x33aadb+=_0x47e941;}_0x245d2d[_0x0059('0x1a')](dbH[_0x0059('0x13')]['query'](util[_0x0059('0xc')](_0x0059('0x1b'),QUERY,_0x47e941,_0x33aadb),{'type':dbH[_0x0059('0x13')][_0x0059('0x1c')][_0x0059('0x16')]}));});if(_0x4eafa7>0x0){_0x33aadb+=_0x47e941;_0x245d2d[_0x0059('0x1a')](dbH['sequelize']['query'](util[_0x0059('0xc')](_0x0059('0x1b'),QUERY,_0x4eafa7,_0x33aadb),{'type':dbH[_0x0059('0x13')][_0x0059('0x1c')]['SELECT']}));}}}else{_0x245d2d[_0x0059('0x1a')](dbH[_0x0059('0x13')][_0x0059('0x14')](QUERY,{'type':dbH[_0x0059('0x13')][_0x0059('0x1c')][_0x0059('0x16')]}));}var _0x4d40ac=path[_0x0059('0x1d')](PATH);var _0x24f685=path[_0x0059('0x1e')](PATH,_0x0059('0x1f'));var _0x140a13=_0x1461c1[_0x0059('0x10')]&&_0x245d2d[_0x0059('0x20')]>0x1;var _0x317937=[];if(!fs[_0x0059('0x21')](path['join'](_0x4d40ac,_0x24f685))&&_0x140a13){fs[_0x0059('0x22')](path[_0x0059('0x23')](_0x4d40ac,_0x24f685));}return BPromise['each'](_0x245d2d,function(_0x3f2fd6){_0x317937[_0x0059('0x1a')](_0x3f2fd6);})[_0x0059('0x12')](function(){for(var _0x4b6e2e=0x0;_0x4b6e2e<_0x317937[_0x0059('0x20')];_0x4b6e2e+=0x1){var _0xd7529;var _0x17b584=_0x317937[_0x4b6e2e];if(_0x140a13){_0xd7529=path[_0x0059('0x23')](_0x4d40ac,_0x24f685,util[_0x0059('0xc')](_0x0059('0x24'),_0x24f685,_0x4b6e2e,_0x0059('0x25')));}else{_0xd7529=path[_0x0059('0x23')](_0x4d40ac,util[_0x0059('0xc')](_0x0059('0x26'),_0x24f685,_0x0059('0x25')));}fs['writeFileSync'](_0xd7529,json2xls(_0x17b584),'binary');}})[_0x0059('0x12')](function(){if(_0x140a13){return new Promise(function(_0x5a5cfa){zipdir(path['join'](_0x4d40ac,_0x24f685),{'saveTo':path['join'](_0x4d40ac,util['format']('%s.%s',_0x24f685,_0x0059('0x27')))},function(_0x2e68b4,_0x40827a){rimraf(path['join'](_0x4d40ac,_0x24f685),function(){});_0x5a5cfa(_0x0059('0x28'));});});}})[_0x0059('0x12')](function(){logger[_0x0059('0xb')](util[_0x0059('0xc')](_0x0059('0x29'),EXTRACTED_REPORT_ID,_0x0059('0xd')));return analyticExtractedReport(_0x0059('0x2a'),_0x140a13?util[_0x0059('0xc')](_0x0059('0x26'),_0x24f685,_0x140a13?'zip':_0x0059('0x25')):null);});})[_0x0059('0x2b')](function(_0x2ac305){logger[_0x0059('0xb')](util[_0x0059('0xc')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x0059('0xd')),util[_0x0059('0x2c')](_0x2ac305,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0059('0x2d'));})[_0x0059('0x2e')](function(){process[_0x0059('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 78ccee6..4365c2d 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 _0x27f5=['exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extensions','extension','find','push','type','format','context','VoiceExtensionId','inbound','Set','CDR(routeid)=','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','map','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','lodash','util','models','Interval','findAll','then','VoiceExtension','IntervalId','uniq'];(function(_0x47fbd3,_0x56bf75){var _0x3b3491=function(_0x24f009){while(--_0x24f009){_0x47fbd3['push'](_0x47fbd3['shift']());}};_0x3b3491(++_0x56bf75);}(_0x27f5,0x1e1));var _0x527f=function(_0x4f708f,_0x19857c){_0x4f708f=_0x4f708f-0x0;var _0xc14ea8=_0x27f5[_0x4f708f];return _0xc14ea8;};'use strict';var _=require(_0x527f('0x0'));var util=require(_0x527f('0x1'));function rewrite(_0x2fe47c,_0x1e45d5){var _0x13de9c=this;return _0x2fe47c[_0x527f('0x2')][_0x527f('0x3')][_0x527f('0x4')]({'raw':!![]})[_0x527f('0x5')](function(_0x59dd6f){_0x13de9c['intervals']=_0x59dd6f;return _0x2fe47c[_0x527f('0x2')][_0x527f('0x6')]['findAll']({'where':{'IntervalId':_0x1e45d5[_0x527f('0x7')]},'raw':!![]});})[_0x527f('0x5')](function(_0x3316c4){return _0x2fe47c[_0x527f('0x2')]['VoiceExtension'][_0x527f('0x4')]({'where':{'exten':{'$in':_[_0x527f('0x8')](_['map'](_0x3316c4,_0x527f('0x9')))}},'order':[{'raw':_0x527f('0xa')}],'raw':!![]});})[_0x527f('0x5')](function(_0x36de82){var _0x100a36=_[_0x527f('0xb')](_0x36de82,{'priority':'1'});var _0x174b59=_[_0x527f('0xb')](_0x36de82,{'isApp':0x1});var _0x483543=_[_0x527f('0xc')](_0x174b59,_0x527f('0x9'));var _0x2f1c46=[_0x527f('0xd'),_0x527f('0xe')];var _0x2c0582=[];var _0x12b61e=[];for(var _0x157f82 in _0x483543){if(_0x483543['hasOwnProperty'](_0x157f82)){_0x13de9c[_0x527f('0xf')]=0x2;_0x13de9c[_0x527f('0x10')]=[];_0x13de9c[_0x527f('0x11')]=_[_0x527f('0x12')](_0x100a36,{'exten':_0x483543[_0x157f82][0x0][_0x527f('0x9')]});_0x13de9c[_0x527f('0x10')][_0x527f('0x13')]({'type':_0x483543[_0x157f82][0x0][_0x527f('0x14')],'app':'Set','appdata':util[_0x527f('0x15')]('CDR(type)=%s',_0x483543[_0x157f82][0x0][_0x527f('0x14')]),'context':_0x483543[_0x157f82][0x0][_0x527f('0x16')],'exten':_0x483543[_0x157f82][0x0]['exten'],'priority':_0x13de9c[_0x527f('0xf')]++,'VoiceExtensionId':_0x483543[_0x157f82][0x0][_0x527f('0x17')]});if(_0x483543[_0x157f82][0x0][_0x527f('0x14')]===_0x527f('0x18')){_0x13de9c['extensions']['push']({'type':_0x483543[_0x157f82][0x0][_0x527f('0x14')],'app':_0x527f('0x19'),'appdata':_0x527f('0x1a')+_0x483543[_0x157f82][0x0][_0x527f('0x17')],'context':_0x483543[_0x157f82][0x0][_0x527f('0x16')],'exten':_0x483543[_0x157f82][0x0][_0x527f('0x9')],'priority':_0x13de9c[_0x527f('0xf')]++,'VoiceExtensionId':_0x483543[_0x157f82][0x0]['VoiceExtensionId']});}else if(_0x483543[_0x157f82][0x0][_0x527f('0x14')]===_0x527f('0x1b')){if(_0x13de9c[_0x527f('0x11')]){_0x13de9c[_0x527f('0x10')][_0x527f('0x13')]({'type':_0x483543[_0x157f82][0x0]['type'],'app':'Set','appdata':'CDR(destination)='+(_0x13de9c[_0x527f('0x11')][_0x527f('0x1c')]?_0x527f('0x1d')+_0x13de9c['extension'][_0x527f('0x1c')]+'}':_0x527f('0x1e')),'context':_0x483543[_0x157f82][0x0][_0x527f('0x16')],'exten':_0x483543[_0x157f82][0x0][_0x527f('0x9')],'priority':_0x13de9c[_0x527f('0xf')]++,'VoiceExtensionId':_0x483543[_0x157f82][0x0]['VoiceExtensionId']});}_0x13de9c[_0x527f('0x10')][_0x527f('0x13')]({'type':_0x483543[_0x157f82][0x0][_0x527f('0x14')],'app':'Set','appdata':'CDR(routeid)='+_0x483543[_0x157f82][0x0]['VoiceExtensionId'],'context':_0x483543[_0x157f82][0x0]['context'],'exten':_0x483543[_0x157f82][0x0][_0x527f('0x9')],'priority':_0x13de9c['priority']++,'VoiceExtensionId':_0x483543[_0x157f82][0x0][_0x527f('0x17')]});var _0x2073a1=_0x13de9c[_0x527f('0xf')]++;_0x13de9c[_0x527f('0x10')]['push']({'type':_0x483543[_0x157f82][0x0]['type'],'app':_0x527f('0x1f'),'appdata':_0x527f('0x20')+(_0x2073a1+0x2)+'):Goto('+(_0x2073a1+0x1)+')','context':_0x483543[_0x157f82][0x0][_0x527f('0x16')],'exten':_0x483543[_0x157f82][0x0][_0x527f('0x9')],'priority':_0x2073a1,'VoiceExtensionId':_0x483543[_0x157f82][0x0][_0x527f('0x17')]});if(_0x13de9c['extension']){_0x13de9c[_0x527f('0x10')]['push']({'type':_0x483543[_0x157f82][0x0]['type'],'app':_0x527f('0x19'),'appdata':_0x13de9c[_0x527f('0x11')][_0x527f('0x1c')]?_0x527f('0x21')+_0x13de9c['extension'][_0x527f('0x1c')]+'}':'CDR(prefix)=noprefix','context':_0x483543[_0x157f82][0x0]['context'],'exten':_0x483543[_0x157f82][0x0][_0x527f('0x9')],'priority':_0x13de9c[_0x527f('0xf')]++,'VoiceExtensionId':_0x483543[_0x157f82][0x0][_0x527f('0x17')]});}_0x13de9c['extensions']['push']({'type':_0x483543[_0x157f82][0x0][_0x527f('0x14')],'app':_0x527f('0x19'),'appdata':_0x527f('0x22')+_0x483543[_0x157f82][0x0][_0x527f('0x17')],'context':_0x483543[_0x157f82][0x0]['context'],'exten':_0x483543[_0x157f82][0x0][_0x527f('0x9')],'priority':_0x13de9c[_0x527f('0xf')]++,'VoiceExtensionId':_0x483543[_0x157f82][0x0][_0x527f('0x17')]});if(_0x13de9c[_0x527f('0x11')]&&_0x13de9c[_0x527f('0x11')][_0x527f('0x23')]('recordingFormat')&&_0x13de9c[_0x527f('0x11')]['recordingFormat']!=='none'){_0x13de9c[_0x527f('0x10')][_0x527f('0x13')]({'type':_0x483543[_0x157f82][0x0]['type'],'app':'Set','appdata':_0x527f('0x24'),'context':_0x483543[_0x157f82][0x0]['context'],'exten':_0x483543[_0x157f82][0x0][_0x527f('0x9')],'priority':_0x13de9c[_0x527f('0xf')]++,'VoiceExtensionId':_0x483543[_0x157f82][0x0][_0x527f('0x17')]});_0x13de9c[_0x527f('0x10')]['push']({'type':_0x483543[_0x157f82][0x0][_0x527f('0x14')],'app':'Set','appdata':_0x527f('0x25')+_0x13de9c[_0x527f('0x11')]['recordingFormat']||_0x527f('0x26'),'context':_0x483543[_0x157f82][0x0]['context'],'exten':_0x483543[_0x157f82][0x0][_0x527f('0x9')],'priority':_0x13de9c['priority']++,'VoiceExtensionId':_0x483543[_0x157f82][0x0][_0x527f('0x17')]});}}_0x13de9c[_0x527f('0x10')][_0x527f('0x13')]({'type':_0x483543[_0x157f82][0x0][_0x527f('0x14')],'app':_0x527f('0x19'),'appdata':_0x527f('0x27'),'context':_0x483543[_0x157f82][0x0][_0x527f('0x16')],'exten':_0x483543[_0x157f82][0x0][_0x527f('0x9')],'priority':_0x13de9c['priority']++,'VoiceExtensionId':_0x483543[_0x157f82][0x0][_0x527f('0x17')]});_0x13de9c[_0x527f('0x10')][_0x527f('0x13')]({'type':_0x483543[_0x157f82][0x0][_0x527f('0x14')],'app':_0x527f('0x19'),'appdata':_0x527f('0x28'),'context':_0x483543[_0x157f82][0x0][_0x527f('0x16')],'exten':_0x483543[_0x157f82][0x0]['exten'],'priority':_0x13de9c['priority']++,'VoiceExtensionId':_0x483543[_0x157f82][0x0]['VoiceExtensionId']});_0x13de9c[_0x527f('0x10')][_0x527f('0x13')]({'type':_0x483543[_0x157f82][0x0][_0x527f('0x14')],'app':_0x527f('0x19'),'appdata':_0x527f('0x29'),'context':_0x483543[_0x157f82][0x0][_0x527f('0x16')],'exten':_0x483543[_0x157f82][0x0][_0x527f('0x9')],'priority':_0x13de9c['priority']++,'VoiceExtensionId':_0x483543[_0x157f82][0x0]['VoiceExtensionId']});for(var _0xd453ab=0x0,_0x20c508=0x0;_0xd453ab<_0x483543[_0x157f82][_0x527f('0x2a')];_0xd453ab+=0x1,_0x20c508=0x0){var _0x3ade83=_0x483543[_0x157f82][_0xd453ab];if(_0x3ade83[_0x527f('0x14')]){_0x3ade83[_0x527f('0x14')]=_0x3ade83['type'][_0x527f('0x2b')]();}var _0x172bf8=[];var _0x2bedaf=[];delete _0x3ade83['id'];delete _0x3ade83['createdAt'];delete _0x3ade83[_0x527f('0x2c')];var _0x8f3bbe=_0x3ade83[_0x527f('0x2d')]!==_0x527f('0x2e')?[_0x3ade83[_0x527f('0x2d')]]:_0x3ade83[_0x527f('0x7')]?_[_0x527f('0x2f')](_[_0x527f('0xb')](_0x13de9c[_0x527f('0x30')],{'IntervalId':_0x3ade83[_0x527f('0x7')]}),_0x527f('0x2d')):[];if(_0x3ade83['hasOwnProperty'](_0x527f('0x31'))){if(_0x3ade83[_0x527f('0x31')]&&_0x3ade83[_0x527f('0x31')]!=='--'){_0x172bf8[_0x527f('0x13')]({'type':_0x3ade83[_0x527f('0x14')],'app':_0x527f('0x19'),'appdata':_0x527f('0x32')+_0x3ade83['tag'],'context':_0x3ade83[_0x527f('0x16')],'exten':_0x3ade83[_0x527f('0x9')],'priority':_0x8f3bbe['length']+_0x13de9c[_0x527f('0xf')]+_0x20c508++,'VoiceExtensionId':_0x3ade83[_0x527f('0x17')]});}}if(_0x3ade83['type']===_0x527f('0x1b')&&_0x3ade83[_0x527f('0x23')](_0x527f('0x33'))){if(_0x3ade83[_0x527f('0x33')]){_0x172bf8['push']({'type':_0x3ade83['type'],'app':'ExecIf','appdata':_0x527f('0x34')+_0x3ade83[_0x527f('0x33')]+')','context':_0x3ade83[_0x527f('0x16')],'exten':_0x3ade83[_0x527f('0x9')],'priority':_0x8f3bbe[_0x527f('0x2a')]+_0x13de9c[_0x527f('0xf')]+_0x20c508++,'VoiceExtensionId':_0x3ade83['VoiceExtensionId']});}else{_0x172bf8[_0x527f('0x13')]({'type':_0x3ade83[_0x527f('0x14')],'app':_0x527f('0x1f'),'appdata':_0x527f('0x35'),'context':_0x3ade83['context'],'exten':_0x3ade83[_0x527f('0x9')],'priority':_0x8f3bbe[_0x527f('0x2a')]+_0x13de9c['priority']+_0x20c508++,'VoiceExtensionId':_0x3ade83['VoiceExtensionId']});}}if(_0x3ade83[_0x527f('0x23')]('answer')){if(_0x2f1c46[_0x527f('0x36')](_0x3ade83[_0x527f('0x37')][_0x527f('0x2b')]())>=0x0&&_0x3ade83['appType']!==_0x527f('0x38')){if(_0x3ade83[_0x527f('0x39')]){_0x172bf8[_0x527f('0x13')]({'type':_0x3ade83[_0x527f('0x14')],'app':_0x527f('0x1f'),'appdata':_0x527f('0x3a'),'context':_0x3ade83[_0x527f('0x16')],'exten':_0x3ade83[_0x527f('0x9')],'priority':_0x8f3bbe['length']+_0x13de9c[_0x527f('0xf')]+_0x20c508++,'VoiceExtensionId':_0x3ade83[_0x527f('0x17')]});_0x172bf8['push']({'type':_0x3ade83['type'],'app':_0x527f('0x19'),'appdata':_0x527f('0x3b'),'context':_0x3ade83[_0x527f('0x16')],'exten':_0x3ade83[_0x527f('0x9')],'priority':_0x8f3bbe['length']+_0x13de9c[_0x527f('0xf')]+_0x20c508++,'VoiceExtensionId':_0x3ade83[_0x527f('0x17')]});}else{_0x172bf8[_0x527f('0x13')]({'type':_0x3ade83['type'],'app':_0x527f('0x1f'),'appdata':_0x527f('0x3c'),'context':_0x3ade83[_0x527f('0x16')],'exten':_0x3ade83[_0x527f('0x9')],'priority':_0x8f3bbe[_0x527f('0x2a')]+_0x13de9c['priority']+_0x20c508++,'VoiceExtensionId':_0x3ade83[_0x527f('0x17')]});_0x172bf8[_0x527f('0x13')]({'type':_0x3ade83['type'],'app':_0x527f('0x19'),'appdata':_0x527f('0x3d'),'context':_0x3ade83[_0x527f('0x16')],'exten':_0x3ade83[_0x527f('0x9')],'priority':_0x8f3bbe[_0x527f('0x2a')]+_0x13de9c[_0x527f('0xf')]+_0x20c508++,'VoiceExtensionId':_0x3ade83[_0x527f('0x17')]});}}}for(var _0x30a5f8=0x0;_0x30a5f8<_0x8f3bbe[_0x527f('0x2a')];_0x30a5f8+=0x1){var _0x352f67=_0x13de9c[_0x527f('0xf')]+_0x8f3bbe[_0x527f('0x2a')];var _0x34eea0=_0x30a5f8===_0x8f3bbe[_0x527f('0x2a')]-0x1?_0x13de9c['priority']+_0x172bf8[_0x527f('0x2a')]+_0x2bedaf['length']+0x2:_0x13de9c[_0x527f('0xf')]+_0x30a5f8+0x1;_0x172bf8[_0x527f('0x3e')](_0x30a5f8,0x0,{'type':_0x3ade83[_0x527f('0x14')],'app':_0x527f('0x3f'),'appdata':_0x8f3bbe[_0x30a5f8]+'?'+_0x3ade83[_0x527f('0x16')]+_0x527f('0x40')+_0x352f67+':'+_0x3ade83[_0x527f('0x16')]+_0x527f('0x40')+_0x34eea0,'exten':_0x3ade83[_0x527f('0x9')],'context':_0x3ade83['context'],'priority':_0x13de9c['priority']+_0x30a5f8,'VoiceExtensionId':_0x483543[_0x157f82][0x0][_0x527f('0x17')]});}_0x3ade83[_0x527f('0xf')]=_0x172bf8[_0x527f('0x2a')]?_[_0x527f('0x41')](_0x172bf8)[_0x527f('0xf')]+0x1:_0x13de9c[_0x527f('0xf')];_0x13de9c[_0x527f('0xf')]=(_0x2bedaf[_0x527f('0x2a')]?_[_0x527f('0x41')](_0x2bedaf)['priority']:_0x3ade83[_0x527f('0xf')])+0x1;_0x13de9c[_0x527f('0x10')]=_[_0x527f('0x42')](_0x13de9c[_0x527f('0x10')],_0x172bf8,[_0x3ade83],_0x2bedaf);}_0x13de9c['extensions']['push']({'type':_0x483543[_0x157f82][0x0][_0x527f('0x14')],'app':_0x527f('0x43'),'exten':_0x483543[_0x157f82][0x0][_0x527f('0x9')],'context':_0x483543[_0x157f82][0x0][_0x527f('0x16')],'priority':_0x13de9c[_0x527f('0xf')],'VoiceExtensionId':_0x483543[_0x157f82][0x0][_0x527f('0x17')]});_0x2c0582[_0x527f('0x13')](_0x483543[_0x157f82][0x0][_0x527f('0x17')]);_0x12b61e=_[_0x527f('0x42')](_0x12b61e,_0x13de9c[_0x527f('0x10')]);}}return _0x2fe47c[_0x527f('0x44')](function(_0x515f26){return _0x2fe47c[_0x527f('0x2')][_0x527f('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x2c0582}},'transaction':_0x515f26})[_0x527f('0x5')](function(_0x5d74a9){return _0x2fe47c[_0x527f('0x2')][_0x527f('0x6')][_0x527f('0x45')](_['sortBy'](_0x12b61e,_0x527f('0xf')),{'transaction':_0x515f26});});});})['catch'](function(_0xc72d86){console['error'](_0xc72d86);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x29d9=['rewrite','lodash','util','Interval','findAll','then','intervals','models','VoiceExtension','map','exten','filter','groupBy','queue','hasOwnProperty','priority','find','push','type','context','VoiceExtensionId','inbound','extensions','CDR(routeid)=','outbound','extension','Set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','):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','length','createdAt','interval','*,*,*,*','IntervalId','tag','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','toLowerCase','appType','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','bulkCreate','sortBy','catch','error'];(function(_0x516f7c,_0x31d38d){var _0x30bd54=function(_0x4a0e68){while(--_0x4a0e68){_0x516f7c['push'](_0x516f7c['shift']());}};_0x30bd54(++_0x31d38d);}(_0x29d9,0x1e4));var _0x929d=function(_0x503bc0,_0xca86dd){_0x503bc0=_0x503bc0-0x0;var _0x327d98=_0x29d9[_0x503bc0];return _0x327d98;};'use strict';var _=require(_0x929d('0x0'));var util=require(_0x929d('0x1'));function rewrite(_0x494611,_0x422340){var _0x21c107=this;return _0x494611['models'][_0x929d('0x2')][_0x929d('0x3')]({'raw':!![]})[_0x929d('0x4')](function(_0x5cece1){_0x21c107[_0x929d('0x5')]=_0x5cece1;return _0x494611[_0x929d('0x6')][_0x929d('0x7')]['findAll']({'where':{'IntervalId':_0x422340['IntervalId']},'raw':!![]});})[_0x929d('0x4')](function(_0x154bb9){return _0x494611[_0x929d('0x6')]['VoiceExtension']['findAll']({'where':{'exten':{'$in':_['uniq'](_[_0x929d('0x8')](_0x154bb9,_0x929d('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x929d('0x4')](function(_0x82a8c7){var _0x3db3f8=_[_0x929d('0xa')](_0x82a8c7,{'priority':'1'});var _0x443d6d=_[_0x929d('0xa')](_0x82a8c7,{'isApp':0x1});var _0x5d5dd3=_[_0x929d('0xb')](_0x443d6d,_0x929d('0x9'));var _0x30fa21=[_0x929d('0xc'),'playback'];var _0x268854=[];var _0x69e74e=[];for(var _0xb95b34 in _0x5d5dd3){if(_0x5d5dd3[_0x929d('0xd')](_0xb95b34)){_0x21c107[_0x929d('0xe')]=0x2;_0x21c107['extensions']=[];_0x21c107['extension']=_[_0x929d('0xf')](_0x3db3f8,{'exten':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x9')]});_0x21c107['extensions'][_0x929d('0x10')]({'type':_0x5d5dd3[_0xb95b34][0x0]['type'],'app':'Set','appdata':util['format']('CDR(type)=%s',_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x11')]),'context':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x12')],'exten':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x9')],'priority':_0x21c107['priority']++,'VoiceExtensionId':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x13')]});if(_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x11')]===_0x929d('0x14')){_0x21c107[_0x929d('0x15')][_0x929d('0x10')]({'type':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x11')],'app':'Set','appdata':_0x929d('0x16')+_0x5d5dd3[_0xb95b34][0x0]['VoiceExtensionId'],'context':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x12')],'exten':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x9')],'priority':_0x21c107[_0x929d('0xe')]++,'VoiceExtensionId':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x13')]});}else if(_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x11')]===_0x929d('0x17')){if(_0x21c107[_0x929d('0x18')]){_0x21c107[_0x929d('0x15')][_0x929d('0x10')]({'type':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x11')],'app':_0x929d('0x19'),'appdata':_0x929d('0x1a')+(_0x21c107[_0x929d('0x18')][_0x929d('0x1b')]?_0x929d('0x1c')+_0x21c107[_0x929d('0x18')][_0x929d('0x1b')]+'}':_0x929d('0x1d')),'context':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x12')],'exten':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x9')],'priority':_0x21c107[_0x929d('0xe')]++,'VoiceExtensionId':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x13')]});}_0x21c107[_0x929d('0x15')][_0x929d('0x10')]({'type':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x11')],'app':'Set','appdata':'CDR(routeid)='+_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x13')],'context':_0x5d5dd3[_0xb95b34][0x0]['context'],'exten':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x9')],'priority':_0x21c107[_0x929d('0xe')]++,'VoiceExtensionId':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x13')]});var _0x572eb5=_0x21c107[_0x929d('0xe')]++;_0x21c107[_0x929d('0x15')][_0x929d('0x10')]({'type':_0x5d5dd3[_0xb95b34][0x0]['type'],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x572eb5+0x2)+_0x929d('0x1e')+(_0x572eb5+0x1)+')','context':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x12')],'exten':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x9')],'priority':_0x572eb5,'VoiceExtensionId':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x13')]});if(_0x21c107['extension']){_0x21c107[_0x929d('0x15')][_0x929d('0x10')]({'type':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x11')],'app':_0x929d('0x19'),'appdata':_0x21c107[_0x929d('0x18')][_0x929d('0x1b')]?_0x929d('0x1f')+_0x21c107['extension']['cutdigits']+'}':_0x929d('0x20'),'context':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x12')],'exten':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x9')],'priority':_0x21c107['priority']++,'VoiceExtensionId':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x13')]});}_0x21c107['extensions'][_0x929d('0x10')]({'type':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x11')],'app':'Set','appdata':_0x929d('0x21')+_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x13')],'context':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x12')],'exten':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x9')],'priority':_0x21c107[_0x929d('0xe')]++,'VoiceExtensionId':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x13')]});if(_0x21c107[_0x929d('0x18')]&&_0x21c107[_0x929d('0x18')][_0x929d('0xd')](_0x929d('0x22'))&&_0x21c107[_0x929d('0x18')][_0x929d('0x22')]!==_0x929d('0x23')){_0x21c107['extensions'][_0x929d('0x10')]({'type':_0x5d5dd3[_0xb95b34][0x0]['type'],'app':_0x929d('0x19'),'appdata':_0x929d('0x24'),'context':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x12')],'exten':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x9')],'priority':_0x21c107['priority']++,'VoiceExtensionId':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x13')]});_0x21c107[_0x929d('0x15')][_0x929d('0x10')]({'type':_0x5d5dd3[_0xb95b34][0x0]['type'],'app':_0x929d('0x19'),'appdata':_0x929d('0x25')+_0x21c107[_0x929d('0x18')][_0x929d('0x22')]||'wav','context':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x12')],'exten':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x9')],'priority':_0x21c107[_0x929d('0xe')]++,'VoiceExtensionId':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x13')]});}}_0x21c107[_0x929d('0x15')][_0x929d('0x10')]({'type':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x11')],'app':_0x929d('0x19'),'appdata':_0x929d('0x26'),'context':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x12')],'exten':_0x5d5dd3[_0xb95b34][0x0]['exten'],'priority':_0x21c107['priority']++,'VoiceExtensionId':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x13')]});_0x21c107[_0x929d('0x15')][_0x929d('0x10')]({'type':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x11')],'app':_0x929d('0x19'),'appdata':_0x929d('0x27'),'context':_0x5d5dd3[_0xb95b34][0x0]['context'],'exten':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x9')],'priority':_0x21c107[_0x929d('0xe')]++,'VoiceExtensionId':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x13')]});_0x21c107[_0x929d('0x15')]['push']({'type':_0x5d5dd3[_0xb95b34][0x0]['type'],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x12')],'exten':_0x5d5dd3[_0xb95b34][0x0]['exten'],'priority':_0x21c107[_0x929d('0xe')]++,'VoiceExtensionId':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x13')]});for(var _0x3c8c96=0x0,_0x28f2bb=0x0;_0x3c8c96<_0x5d5dd3[_0xb95b34][_0x929d('0x28')];_0x3c8c96+=0x1,_0x28f2bb=0x0){var _0x2f4958=_0x5d5dd3[_0xb95b34][_0x3c8c96];if(_0x2f4958[_0x929d('0x11')]){_0x2f4958[_0x929d('0x11')]=_0x2f4958['type']['toLowerCase']();}var _0x2eb832=[];var _0xefb26c=[];delete _0x2f4958['id'];delete _0x2f4958[_0x929d('0x29')];delete _0x2f4958['updatedAt'];var _0x302f99=_0x2f4958[_0x929d('0x2a')]!==_0x929d('0x2b')?[_0x2f4958['interval']]:_0x2f4958[_0x929d('0x2c')]?_[_0x929d('0x8')](_[_0x929d('0xa')](_0x21c107[_0x929d('0x5')],{'IntervalId':_0x2f4958[_0x929d('0x2c')]}),_0x929d('0x2a')):[];if(_0x2f4958['hasOwnProperty'](_0x929d('0x2d'))){if(_0x2f4958['tag']&&_0x2f4958[_0x929d('0x2d')]!=='--'){_0x2eb832[_0x929d('0x10')]({'type':_0x2f4958['type'],'app':'Set','appdata':'CDR(tag)='+_0x2f4958[_0x929d('0x2d')],'context':_0x2f4958[_0x929d('0x12')],'exten':_0x2f4958[_0x929d('0x9')],'priority':_0x302f99[_0x929d('0x28')]+_0x21c107[_0x929d('0xe')]+_0x28f2bb++,'VoiceExtensionId':_0x2f4958[_0x929d('0x13')]});}}if(_0x2f4958[_0x929d('0x11')]===_0x929d('0x17')&&_0x2f4958[_0x929d('0xd')](_0x929d('0x2e'))){if(_0x2f4958[_0x929d('0x2e')]){_0x2eb832[_0x929d('0x10')]({'type':_0x2f4958[_0x929d('0x11')],'app':_0x929d('0x2f'),'appdata':_0x929d('0x30')+_0x2f4958[_0x929d('0x2e')]+')','context':_0x2f4958[_0x929d('0x12')],'exten':_0x2f4958['exten'],'priority':_0x302f99[_0x929d('0x28')]+_0x21c107[_0x929d('0xe')]+_0x28f2bb++,'VoiceExtensionId':_0x2f4958[_0x929d('0x13')]});}else{_0x2eb832[_0x929d('0x10')]({'type':_0x2f4958[_0x929d('0x11')],'app':'ExecIf','appdata':_0x929d('0x31'),'context':_0x2f4958['context'],'exten':_0x2f4958[_0x929d('0x9')],'priority':_0x302f99[_0x929d('0x28')]+_0x21c107['priority']+_0x28f2bb++,'VoiceExtensionId':_0x2f4958[_0x929d('0x13')]});}}if(_0x2f4958[_0x929d('0xd')]('answer')){if(_0x30fa21[_0x929d('0x32')](_0x2f4958[_0x929d('0x33')][_0x929d('0x34')]())>=0x0&&_0x2f4958[_0x929d('0x35')]!=='custom'){if(_0x2f4958[_0x929d('0x36')]){_0x2eb832[_0x929d('0x10')]({'type':_0x2f4958['type'],'app':'ExecIf','appdata':_0x929d('0x37'),'context':_0x2f4958[_0x929d('0x12')],'exten':_0x2f4958[_0x929d('0x9')],'priority':_0x302f99[_0x929d('0x28')]+_0x21c107[_0x929d('0xe')]+_0x28f2bb++,'VoiceExtensionId':_0x2f4958['VoiceExtensionId']});_0x2eb832[_0x929d('0x10')]({'type':_0x2f4958[_0x929d('0x11')],'app':'Set','appdata':_0x929d('0x38'),'context':_0x2f4958[_0x929d('0x12')],'exten':_0x2f4958['exten'],'priority':_0x302f99['length']+_0x21c107[_0x929d('0xe')]+_0x28f2bb++,'VoiceExtensionId':_0x2f4958[_0x929d('0x13')]});}else{_0x2eb832['push']({'type':_0x2f4958[_0x929d('0x11')],'app':_0x929d('0x2f'),'appdata':_0x929d('0x39'),'context':_0x2f4958[_0x929d('0x12')],'exten':_0x2f4958[_0x929d('0x9')],'priority':_0x302f99['length']+_0x21c107['priority']+_0x28f2bb++,'VoiceExtensionId':_0x2f4958[_0x929d('0x13')]});_0x2eb832[_0x929d('0x10')]({'type':_0x2f4958[_0x929d('0x11')],'app':_0x929d('0x19'),'appdata':_0x929d('0x3a'),'context':_0x2f4958[_0x929d('0x12')],'exten':_0x2f4958['exten'],'priority':_0x302f99['length']+_0x21c107[_0x929d('0xe')]+_0x28f2bb++,'VoiceExtensionId':_0x2f4958[_0x929d('0x13')]});}}}for(var _0x16222b=0x0;_0x16222b<_0x302f99['length'];_0x16222b+=0x1){var _0x2f350b=_0x21c107['priority']+_0x302f99[_0x929d('0x28')];var _0x5a0d41=_0x16222b===_0x302f99[_0x929d('0x28')]-0x1?_0x21c107['priority']+_0x2eb832[_0x929d('0x28')]+_0xefb26c[_0x929d('0x28')]+0x2:_0x21c107[_0x929d('0xe')]+_0x16222b+0x1;_0x2eb832[_0x929d('0x3b')](_0x16222b,0x0,{'type':_0x2f4958['type'],'app':'GotoIfTime','appdata':_0x302f99[_0x16222b]+'?'+_0x2f4958[_0x929d('0x12')]+',${EXTEN},'+_0x2f350b+':'+_0x2f4958['context']+_0x929d('0x3c')+_0x5a0d41,'exten':_0x2f4958['exten'],'context':_0x2f4958[_0x929d('0x12')],'priority':_0x21c107[_0x929d('0xe')]+_0x16222b,'VoiceExtensionId':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x13')]});}_0x2f4958['priority']=_0x2eb832[_0x929d('0x28')]?_[_0x929d('0x3d')](_0x2eb832)[_0x929d('0xe')]+0x1:_0x21c107[_0x929d('0xe')];_0x21c107[_0x929d('0xe')]=(_0xefb26c['length']?_[_0x929d('0x3d')](_0xefb26c)[_0x929d('0xe')]:_0x2f4958['priority'])+0x1;_0x21c107[_0x929d('0x15')]=_[_0x929d('0x3e')](_0x21c107[_0x929d('0x15')],_0x2eb832,[_0x2f4958],_0xefb26c);}_0x21c107[_0x929d('0x15')][_0x929d('0x10')]({'type':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x11')],'app':_0x929d('0x3f'),'exten':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x9')],'context':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x12')],'priority':_0x21c107[_0x929d('0xe')],'VoiceExtensionId':_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x13')]});_0x268854[_0x929d('0x10')](_0x5d5dd3[_0xb95b34][0x0][_0x929d('0x13')]);_0x69e74e=_[_0x929d('0x3e')](_0x69e74e,_0x21c107[_0x929d('0x15')]);}}return _0x494611['transaction'](function(_0x1883ee){return _0x494611[_0x929d('0x6')][_0x929d('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x268854}},'transaction':_0x1883ee})[_0x929d('0x4')](function(_0x59c4ee){return _0x494611[_0x929d('0x6')][_0x929d('0x7')][_0x929d('0x40')](_[_0x929d('0x41')](_0x69e74e,_0x929d('0xe')),{'transaction':_0x1883ee});});});})[_0x929d('0x42')](function(_0x465f6a){console[_0x929d('0x43')](_0x465f6a);});}exports[_0x929d('0x44')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 454140b..b4b0c77 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 _0xf3de=['Lists','dialCheckDuplicateType','always','push','sequelize','VoiceQueueId','query','all','BlackLists','get','onlyIfOpen','CampaignId','Campaign','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CmContact','createReadStream','parse','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','Duplicate\x20Contact','create','keys','then','pick','catch','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','phone','scheduledAt','ContactId','createdAt','field','NOW()','toString','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','fromQuery','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','str','VoiceQueue','findAll','outbound','CmList'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf3de,0x166));var _0xef3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3de[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require(_0xef3d('0x0'));var _=require(_0xef3d('0x1'));var fs=require('fs');var squel=require(_0xef3d('0x2'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0xef3d('0x3'))['db'];var config=require(_0xef3d('0x4'));var logger=require(_0xef3d('0x5'))('api');config[_0xef3d('0x6')]=_[_0xef3d('0x7')](config[_0xef3d('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xef3d('0x6')]));require('../../../api/cmContact/cmContact.socket')[_0xef3d('0x8')](socket);try{if(!process[_0xef3d('0x9')][0x2]||process['argv'][0x2]===_0xef3d('0xa')||process['argv'][0x2]===_0xef3d('0xb')){throw new Error(_0xef3d('0xc'));}var FILEPATH=process[_0xef3d('0x9')][0x2];if(!process['argv'][0x3]||process[_0xef3d('0x9')][0x3]==='undefined'||process['argv'][0x3]==='null'||!process[_0xef3d('0x9')][0x4]||process[_0xef3d('0x9')][0x4]===_0xef3d('0xa')||process[_0xef3d('0x9')][0x4]===_0xef3d('0xb')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xef3d('0xd')](process['argv'][0x3][_0xef3d('0xe')](','),process['argv'][0x4][_0xef3d('0xe')](','));if(!process[_0xef3d('0x9')][0x5]||process['argv'][0x5]===_0xef3d('0xa')||process[_0xef3d('0x9')][0x5]===_0xef3d('0xb')){throw new Error(_0xef3d('0xf'));}var LISTID=process[_0xef3d('0x9')][0x5];var COMPANYID=process[_0xef3d('0x9')][0x6]&&process[_0xef3d('0x9')][0x6]!==_0xef3d('0xa')&&process[_0xef3d('0x9')][0x6]!==_0xef3d('0xb')?process[_0xef3d('0x9')][0x6]:null;var DUPLICATES=process[_0xef3d('0x9')][0x7]&&process[_0xef3d('0x9')][0x7]!==_0xef3d('0xa')&&process[_0xef3d('0x9')][0x7]!==_0xef3d('0xb')?process[_0xef3d('0x9')][0x7]:null;if(!process[_0xef3d('0x9')][0x8]||process[_0xef3d('0x9')][0x8]===_0xef3d('0xa')||process['argv'][0x8]===_0xef3d('0xb')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xef3d('0x9')][0x8];}catch(_0x41bf1f){logger['error'](_0x41bf1f);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(_0x21a54b,_0x4ef0fc,_0x1b3ac6,_0x45da08){var _0x4e670e={'message':_0x4ef0fc};_0x4e670e[_0x21a54b]=!![];if(_0x1b3ac6){_0x4e670e[_0xef3d('0x10')]=_0x1b3ac6;}if(_0x45da08){_0x4e670e[_0xef3d('0x11')]=_0x45da08;}return _0x4e670e;}function isEmail(_0xd995b6){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))*$/[_0xef3d('0x12')](_0xd995b6);}function checkRow(_0x10ef18,_0x4a8f45,_0x35bf66){return new BPromise(function(_0x1ae215,_0x12d8eb){if(_[_0xef3d('0x13')](_0x10ef18)){return _0x12d8eb(handleCheckRowError(_0xef3d('0x14'),_0xef3d('0x15'),null,_0x35bf66));}if(_0x10ef18[_0xef3d('0x16')]&&_0x10ef18['errors'][_0xef3d('0x17')]){var _0x3c9783=_['map'](_0x10ef18['errors'],_0xef3d('0x18'))[_0xef3d('0x19')](';');return _0x12d8eb(handleCheckRowError(_0xef3d('0x14'),_0x3c9783,null,_0x35bf66));}var _0x3994a6={};for(var _0x1ad877 in FIELDS){if(FIELDS[_0xef3d('0x1a')](_0x1ad877)&&FIELDS[_0x1ad877]){_0x3994a6[_0x1ad877]=_0x10ef18[_0xef3d('0x1b')][0x0][FIELDS[_0x1ad877]]||_0x10ef18['data'][0x0]['\ufeff'+FIELDS[_0x1ad877]];}}if(!_0x3994a6[_0xef3d('0x1c')]){return _0x12d8eb(handleCheckRowError(_0xef3d('0x14'),_0xef3d('0x1d'),null,_0x35bf66));}if(!_0x3994a6['phone']){return _0x12d8eb(handleCheckRowError('error',_0xef3d('0x1e'),null,_0x35bf66));}if(_0x3994a6[_0xef3d('0x1f')]){var _0x2afdd4=moment(_0x3994a6[_0xef3d('0x1f')],_0xef3d('0x20'));if(!_0x2afdd4[_0xef3d('0x21')]()){return _0x12d8eb(handleCheckRowError('error',_0xef3d('0x22'),null,_0x35bf66));}}if(_0x3994a6[_0xef3d('0x23')]){if(!isEmail(_0x3994a6['email'])){return _0x12d8eb(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0x35bf66));}}_0x3994a6[_0xef3d('0x24')]=LISTID;_0x3994a6[_0xef3d('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xef3d('0x17')]&&_0x4a8f45){var _0x37c62e={};for(var _0x565623=0x0,_0x3c0462=DUPLICATES[_0xef3d('0x17')];_0x565623<_0x3c0462;_0x565623+=0x1){_0x37c62e[DUPLICATES[_0x565623]]=_0x3994a6[DUPLICATES[_0x565623]];}var _0x489ee3=_[_0xef3d('0x26')](_0x4a8f45,_0x37c62e);if(_0x489ee3){return _0x12d8eb(handleCheckRowError('duplicate',_0xef3d('0x27'),_0x489ee3,_0x35bf66));}}return db['CmContact'][_0xef3d('0x28')](_0x3994a6,{'raw':!![],'hooks':![],'fields':_[_0xef3d('0x29')](_0x3994a6)})[_0xef3d('0x2a')](function(_0x496596){if(DUPLICATES&&DUPLICATES[_0xef3d('0x17')]&&_0x4a8f45){_0x4a8f45['push'](_[_0xef3d('0x2b')](_0x3994a6,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x496596['id'];return _0x1ae215();})[_0xef3d('0x2c')](function(_0x1ce0b0){return _0x12d8eb(handleCheckRowError(_0xef3d('0x14'),'Error\x20while\x20creating\x20contact:\x20'+(_0x1ce0b0['message']||JSON[_0xef3d('0x2d')](_0x1ce0b0)),null,_0x35bf66));});});}function checkHopper(){function _0x4520a1(){return function(_0x3e7bce){logger[_0xef3d('0x14')](_0xef3d('0x2e'),_0xef3d('0x2f'),util[_0xef3d('0x30')](_0x3e7bce,{'showHidden':![],'depth':null}));};}var _0x2f2926=function(_0x2f7713,_0x1ec046){var _0x31f13=squel[_0xef3d('0x31')]()[_0xef3d('0x32')](_0xef3d('0x33'))['fromQuery']([_0xef3d('0x34'),_0xef3d('0x35'),_0xef3d('0x36'),_0xef3d('0x24'),_0x1ec046,_0xef3d('0x37'),'updatedAt'],squel['select']()['field'](_0xef3d('0x34'),_0xef3d('0x34'))[_0xef3d('0x38')](_0xef3d('0x39'),_0xef3d('0x35'))[_0xef3d('0x38')]('id',_0xef3d('0x36'))[_0xef3d('0x38')](LISTID['toString'](),_0xef3d('0x24'))[_0xef3d('0x38')](_0x2f7713['id'][_0xef3d('0x3a')](),_0x1ec046)['field'](_0xef3d('0x39'),'createdAt')[_0xef3d('0x38')]('NOW()',_0xef3d('0x3b'))[_0xef3d('0x3c')](_0xef3d('0x3d'))[_0xef3d('0x3e')](_0xef3d('0x3f'))[_0xef3d('0x3e')]('ListId\x20=\x20?',LISTID['toString']())[_0xef3d('0x3e')](_0xef3d('0x40'))['where'](_0xef3d('0x41'),squel[_0xef3d('0x42')]()[_0xef3d('0x38')](_0xef3d('0x34'))['from']('cm_hopper')[_0xef3d('0x3e')](_0x1ec046+_0xef3d('0x43'),_0x2f7713['id'][_0xef3d('0x3a')]())))['toString']();return _0x31f13;};var _0x48ce31=function(_0x5f49ff,_0x3c027d){var _0xb6d80c=squel[_0xef3d('0x31')]()[_0xef3d('0x32')](_0xef3d('0x33'))[_0xef3d('0x44')]([_0xef3d('0x34'),'scheduledAt',_0xef3d('0x36'),_0xef3d('0x24'),_0x3c027d,_0xef3d('0x37'),'updatedAt'],squel['select']()[_0xef3d('0x38')](_0xef3d('0x34'),_0xef3d('0x34'))['field'](_0xef3d('0x39'),_0xef3d('0x35'))[_0xef3d('0x38')]('id','ContactId')['field'](LISTID[_0xef3d('0x3a')](),_0xef3d('0x24'))[_0xef3d('0x38')](_0x5f49ff['id'][_0xef3d('0x3a')](),_0x3c027d)[_0xef3d('0x38')](_0xef3d('0x39'),_0xef3d('0x37'))[_0xef3d('0x38')]('NOW()',_0xef3d('0x3b'))['from'](_0xef3d('0x3d'))[_0xef3d('0x3e')](_0xef3d('0x3f'))['where']('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel['str'](hopperContacts))['where'](_0xef3d('0x40'))['where'](_0xef3d('0x41'),squel[_0xef3d('0x42')]()[_0xef3d('0x38')](_0xef3d('0x45'))[_0xef3d('0x3c')](_0xef3d('0x46'))[_0xef3d('0x3e')](_0x3c027d+_0xef3d('0x43'),_0x5f49ff['id']['toString']()))[_0xef3d('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xef3d('0x38')](_0xef3d('0x34'))[_0xef3d('0x3c')]('cm_hopper')['where'](_0x3c027d+_0xef3d('0x43'),_0x5f49ff['id'][_0xef3d('0x3a')]())))[_0xef3d('0x3a')]();return _0xb6d80c;};function _0x521465(_0x1c1d07,_0x4528fe){var _0x278eae=squel['insert']()[_0xef3d('0x32')]('cm_hopper')['fromQuery']([_0xef3d('0x34'),_0xef3d('0x35'),_0xef3d('0x36'),_0xef3d('0x24'),_0x4528fe,_0xef3d('0x37'),'updatedAt'],squel[_0xef3d('0x42')]()[_0xef3d('0x38')](_0xef3d('0x34'),_0xef3d('0x34'))[_0xef3d('0x38')](_0xef3d('0x39'),_0xef3d('0x35'))[_0xef3d('0x38')]('id',_0xef3d('0x36'))[_0xef3d('0x38')](LISTID[_0xef3d('0x3a')](),_0xef3d('0x24'))[_0xef3d('0x38')](_0x1c1d07['id'][_0xef3d('0x3a')](),_0x4528fe)[_0xef3d('0x38')](_0xef3d('0x39'),'createdAt')[_0xef3d('0x38')](_0xef3d('0x39'),_0xef3d('0x3b'))[_0xef3d('0x3c')](_0xef3d('0x3d'))['where']('deletedAt\x20IS\x20NULL')[_0xef3d('0x3e')]('ListId\x20=\x20?',LISTID[_0xef3d('0x3a')]())[_0xef3d('0x3e')](_0xef3d('0x47'),squel['str'](hopperContacts))[_0xef3d('0x3e')](_0xef3d('0x40')))[_0xef3d('0x3a')]();return _0x278eae;}function _0xd4fd77(_0x53ba2f,_0xaa2e06){var _0x1205ac=squel[_0xef3d('0x31')]()[_0xef3d('0x32')](_0xef3d('0x48'))[_0xef3d('0x44')](['phone',_0xef3d('0x36'),_0xef3d('0x24'),_0xaa2e06,_0xef3d('0x37'),'updatedAt'],squel['select']()[_0xef3d('0x38')](_0xef3d('0x34'),_0xef3d('0x34'))[_0xef3d('0x38')]('id',_0xef3d('0x36'))['field'](LISTID[_0xef3d('0x3a')](),_0xef3d('0x24'))[_0xef3d('0x38')](_0x53ba2f['id']['toString'](),_0xaa2e06)[_0xef3d('0x38')](_0xef3d('0x39'),'createdAt')[_0xef3d('0x38')](_0xef3d('0x39'),_0xef3d('0x3b'))[_0xef3d('0x3c')](_0xef3d('0x3d'))[_0xef3d('0x3e')](_0xef3d('0x3f'))['where']('ListId\x20=\x20?',LISTID[_0xef3d('0x3a')]())[_0xef3d('0x3e')](_0xef3d('0x47'),squel[_0xef3d('0x49')](hopperContacts))['where'](_0xef3d('0x40')))['toString']();return _0x1205ac;}return db[_0xef3d('0x4a')][_0xef3d('0x4b')]({'where':{'type':_0xef3d('0x4c')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xef3d('0x4d')],'as':_0xef3d('0x4e'),'where':{'id':LISTID}}]})[_0xef3d('0x2a')](function(_0x5da15f){var _0x26cf4e=[];if(_0x5da15f){var _0x309be5;for(var _0x3b3d97=0x0,_0x3bcace;_0x3b3d97<_0x5da15f[_0xef3d('0x17')];_0x3b3d97+=0x1){_0x3bcace=_0x5da15f[_0x3b3d97]['get']({'plain':!![]});switch(_0x3bcace[_0xef3d('0x4f')]){case _0xef3d('0x50'):_0x26cf4e[_0xef3d('0x51')](db[_0xef3d('0x52')]['query'](_0x48ce31(_0x3bcace,_0xef3d('0x53')))[_0xef3d('0x2a')](function(){})[_0xef3d('0x2c')](_0x4520a1()));break;case'onlyIfOpen':_0x26cf4e[_0xef3d('0x51')](db[_0xef3d('0x52')][_0xef3d('0x54')](_0x2f2926(_0x3bcace,_0xef3d('0x53')))[_0xef3d('0x2a')](function(){})[_0xef3d('0x2c')](_0x4520a1()));break;default:_0x26cf4e[_0xef3d('0x51')](db['sequelize'][_0xef3d('0x54')](_0x521465(_0x3bcace,'VoiceQueueId'))['then'](function(){})[_0xef3d('0x2c')](_0x4520a1()));}}}return _0x26cf4e;})[_0xef3d('0x55')]()[_0xef3d('0x2a')](function(){return db[_0xef3d('0x4a')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xef3d('0x56'),'where':{'id':LISTID}}]})[_0xef3d('0x2a')](function(_0x5d2f16){var _0x44f57e=[];if(_0x5d2f16){var _0x4ed67f;for(var _0x18cfd8=0x0,_0x5194ff;_0x18cfd8<_0x5d2f16['length'];_0x18cfd8+=0x1){_0x5194ff=_0x5d2f16[_0x18cfd8][_0xef3d('0x57')]({'plain':!![]});_0x44f57e['push'](db[_0xef3d('0x52')][_0xef3d('0x54')](_0xd4fd77(_0x5194ff,'VoiceQueueId'))['then'](function(){})[_0xef3d('0x2c')](_0x4520a1()));}}return _0x44f57e;})['all']();})[_0xef3d('0x2a')](function(){return db['Campaign'][_0xef3d('0x4b')]({'attributes':['id',_0xef3d('0x4f')],'include':[{'model':db['CmList'],'as':_0xef3d('0x4e'),'where':{'id':LISTID}}]})[_0xef3d('0x2a')](function(_0xf940bf){var _0x3a60=[];if(_0xf940bf){for(var _0x5e880c=0x0,_0x1b2eaa;_0x5e880c<_0xf940bf['length'];_0x5e880c+=0x1){_0x1b2eaa=_0xf940bf[_0x5e880c][_0xef3d('0x57')]({'plain':!![]});switch(_0x1b2eaa[_0xef3d('0x4f')]){case _0xef3d('0x50'):_0x3a60[_0xef3d('0x51')](db[_0xef3d('0x52')][_0xef3d('0x54')](_0x48ce31(_0x1b2eaa,'CampaignId'))[_0xef3d('0x2a')](function(){})[_0xef3d('0x2c')](_0x4520a1()));break;case _0xef3d('0x58'):_0x3a60[_0xef3d('0x51')](db[_0xef3d('0x52')][_0xef3d('0x54')](_0x2f2926(_0x1b2eaa,_0xef3d('0x59')))[_0xef3d('0x2a')](function(){})[_0xef3d('0x2c')](_0x4520a1()));break;default:_0x3a60[_0xef3d('0x51')](db['sequelize']['query'](_0x521465(_0x1b2eaa,_0xef3d('0x59')))['then'](function(){})['catch'](_0x4520a1()));}}}return _0x3a60;})[_0xef3d('0x55')]();})['then'](function(){return db[_0xef3d('0x5a')][_0xef3d('0x4b')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0xef3d('0x2a')](function(_0x1c6131){var _0x27148a=[];if(_0x1c6131){for(var _0x96586b=0x0,_0x53bcb0;_0x96586b<_0x1c6131[_0xef3d('0x17')];_0x96586b+=0x1){_0x53bcb0=_0x1c6131[_0x96586b][_0xef3d('0x57')]({'plain':!![]});_0x27148a[_0xef3d('0x51')](db[_0xef3d('0x52')]['query'](_0xd4fd77(_0x53bcb0,'CampaignId'))[_0xef3d('0x2a')](function(){})[_0xef3d('0x2c')](_0x4520a1()));}}return _0x27148a;})[_0xef3d('0x55')]();})[_0xef3d('0x2c')](function(_0x6f22ef){logger[_0xef3d('0x14')]('cmContact,\x20%s,\x20%s',_0xef3d('0x5b'),_0x6f22ef['message']);});}var processPromises=function(_0x1da332){return BPromise[_0xef3d('0x55')](promises)[_0xef3d('0x2a')](function(_0x22e411){})[_0xef3d('0x2c')](function(_0x532a94){logger[_0xef3d('0x14')](_0xef3d('0x5c'),JSON[_0xef3d('0x2d')](_0x532a94));})[_0xef3d('0x5d')](function(){socket[_0xef3d('0x5e')](_0xef3d('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1da332){return _0x1da332[_0xef3d('0x60')]();}});};var endCsv=function(){return BPromise[_0xef3d('0x61')]()[_0xef3d('0x2a')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0xef3d('0x5e')](_0xef3d('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x157a23){logger[_0xef3d('0x14')](_0xef3d('0x62'),JSON['stringify'](_0x157a23));}finally{process[_0xef3d('0x63')](0x0);}});};process['on'](_0xef3d('0x64'),function(){logger[_0xef3d('0x65')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xef3d('0xe')](',');return db[_0xef3d('0x66')][_0xef3d('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xef3d('0x2a')](function(_0x3def93){var _0x5cf247=fs[_0xef3d('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xef3d('0x68')](_0x5cf247,{'header':!![],'skipEmptyLines':!![],'step':function(_0x541360,_0x42941b){total+=0x1;var _0x40d0cf=total;promises[_0xef3d('0x51')](checkRow(_0x541360,_0x3def93,_0x40d0cf)['then'](function(){success+=0x1;})['catch'](function(_0x5bf518){if(_0x5bf518[_0xef3d('0x14')]){errors+=0x1;delete _0x5bf518[_0xef3d('0x14')];}else if(_0x5bf518[_0xef3d('0x69')]){duplicates+=0x1;delete _0x5bf518[_0xef3d('0x69')];}rows[_0xef3d('0x51')](_0x5bf518);}));if(total%0xc8===0x0){_0x42941b[_0xef3d('0x6a')]();return processPromises(_0x42941b);}},'complete':function(){return processPromises()[_0xef3d('0x2a')](function(){logger[_0xef3d('0x65')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0xe93e88,_0x2d4e53){logger[_0xef3d('0x65')](_0xef3d('0x6b'),JSON[_0xef3d('0x2d')](_0xe93e88));endCsv();}});})[_0xef3d('0x2c')](function(_0x509826){logger[_0xef3d('0x14')](_0xef3d('0x6c'),JSON[_0xef3d('0x2d')](_0x509826));});}main(); \ No newline at end of file +var _0x45aa=['map','message','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','create','keys','then','catch','stringify','checkHopper','inspect','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','select','field','NOW()','toString','updatedAt','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','insert','from','id\x20IN\x20?','str','\x20=\x20?','cm_contacts','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','push','VoiceQueueId','sequelize','query','all','BlackLists','Campaign','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','duplicate','pause','CSV\x20parse\x20error','bluebird','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','../../../api/cmContact/cmContact.socket','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','errors','length'];(function(_0x4a342e,_0x839a34){var _0x2b0981=function(_0x5d1cd1){while(--_0x5d1cd1){_0x4a342e['push'](_0x4a342e['shift']());}};_0x2b0981(++_0x839a34);}(_0x45aa,0x191));var _0xa45a=function(_0x13a8b9,_0xd4f9a5){_0x13a8b9=_0x13a8b9-0x0;var _0x3e27a1=_0x45aa[_0x13a8b9];return _0x3e27a1;};'use strict';var BPromise=require(_0xa45a('0x0'));var util=require('util');var _=require(_0xa45a('0x1'));var fs=require('fs');var squel=require(_0xa45a('0x2'));var Papa=require(_0xa45a('0x3'));var Redis=require(_0xa45a('0x4'));var db=require(_0xa45a('0x5'))['db'];var config=require(_0xa45a('0x6'));var logger=require(_0xa45a('0x7'))(_0xa45a('0x8'));config[_0xa45a('0x9')]=_[_0xa45a('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa45a('0xb'))['register'](socket);try{if(!process[_0xa45a('0xc')][0x2]||process['argv'][0x2]===_0xa45a('0xd')||process[_0xa45a('0xc')][0x2]==='null'){throw new Error(_0xa45a('0xe'));}var FILEPATH=process[_0xa45a('0xc')][0x2];if(!process[_0xa45a('0xc')][0x3]||process[_0xa45a('0xc')][0x3]===_0xa45a('0xd')||process[_0xa45a('0xc')][0x3]==='null'||!process['argv'][0x4]||process[_0xa45a('0xc')][0x4]===_0xa45a('0xd')||process[_0xa45a('0xc')][0x4]===_0xa45a('0xf')){throw new Error(_0xa45a('0x10'));}var FIELDS=_['zipObject'](process[_0xa45a('0xc')][0x3][_0xa45a('0x11')](','),process[_0xa45a('0xc')][0x4]['split'](','));if(!process['argv'][0x5]||process[_0xa45a('0xc')][0x5]==='undefined'||process[_0xa45a('0xc')][0x5]==='null'){throw new Error(_0xa45a('0x12'));}var LISTID=process[_0xa45a('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xa45a('0xc')][0x6]!==_0xa45a('0xd')&&process[_0xa45a('0xc')][0x6]!==_0xa45a('0xf')?process['argv'][0x6]:null;var DUPLICATES=process[_0xa45a('0xc')][0x7]&&process[_0xa45a('0xc')][0x7]!==_0xa45a('0xd')&&process['argv'][0x7]!==_0xa45a('0xf')?process['argv'][0x7]:null;if(!process[_0xa45a('0xc')][0x8]||process[_0xa45a('0xc')][0x8]===_0xa45a('0xd')||process[_0xa45a('0xc')][0x8]===_0xa45a('0xf')){throw new Error(_0xa45a('0x13'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x11089b){logger[_0xa45a('0x14')](_0x11089b);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(_0x1982d9,_0x161798,_0x20ceca,_0x1680a3){var _0x1507fa={'message':_0x161798};_0x1507fa[_0x1982d9]=!![];if(_0x20ceca){_0x1507fa[_0xa45a('0x15')]=_0x20ceca;}if(_0x1680a3){_0x1507fa[_0xa45a('0x16')]=_0x1680a3;}return _0x1507fa;}function isEmail(_0x12d7d3){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))*$/[_0xa45a('0x17')](_0x12d7d3);}function checkRow(_0x1f7b9d,_0x4d2b89,_0x136583){return new BPromise(function(_0x34ab6f,_0x533887){if(_[_0xa45a('0x18')](_0x1f7b9d)){return _0x533887(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x136583));}if(_0x1f7b9d[_0xa45a('0x19')]&&_0x1f7b9d[_0xa45a('0x19')][_0xa45a('0x1a')]){var _0x29a549=_[_0xa45a('0x1b')](_0x1f7b9d[_0xa45a('0x19')],_0xa45a('0x1c'))['join'](';');return _0x533887(handleCheckRowError(_0xa45a('0x14'),_0x29a549,null,_0x136583));}var _0x18b58c={};for(var _0x524e62 in FIELDS){if(FIELDS['hasOwnProperty'](_0x524e62)&&FIELDS[_0x524e62]){_0x18b58c[_0x524e62]=_0x1f7b9d['data'][0x0][FIELDS[_0x524e62]]||_0x1f7b9d[_0xa45a('0x1d')][0x0]['\ufeff'+FIELDS[_0x524e62]];}}if(!_0x18b58c[_0xa45a('0x1e')]){return _0x533887(handleCheckRowError(_0xa45a('0x14'),_0xa45a('0x1f'),null,_0x136583));}if(!_0x18b58c['phone']){return _0x533887(handleCheckRowError(_0xa45a('0x14'),_0xa45a('0x20'),null,_0x136583));}if(_0x18b58c[_0xa45a('0x21')]){var _0x324158=moment(_0x18b58c[_0xa45a('0x21')],_0xa45a('0x22'));if(!_0x324158[_0xa45a('0x23')]()){return _0x533887(handleCheckRowError(_0xa45a('0x14'),_0xa45a('0x24'),null,_0x136583));}}if(_0x18b58c['email']){if(!isEmail(_0x18b58c[_0xa45a('0x25')])){return _0x533887(handleCheckRowError(_0xa45a('0x14'),_0xa45a('0x26'),null,_0x136583));}}_0x18b58c[_0xa45a('0x27')]=LISTID;_0x18b58c[_0xa45a('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x4d2b89){var _0x40e37c={};for(var _0x4ac742=0x0,_0x2db408=DUPLICATES[_0xa45a('0x1a')];_0x4ac742<_0x2db408;_0x4ac742+=0x1){_0x40e37c[DUPLICATES[_0x4ac742]]=_0x18b58c[DUPLICATES[_0x4ac742]];}var _0x15f0c6=_['find'](_0x4d2b89,_0x40e37c);if(_0x15f0c6){return _0x533887(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x15f0c6,_0x136583));}}return db['CmContact'][_0xa45a('0x29')](_0x18b58c,{'raw':!![],'hooks':![],'fields':_[_0xa45a('0x2a')](_0x18b58c)})[_0xa45a('0x2b')](function(_0x3d8815){if(DUPLICATES&&DUPLICATES['length']&&_0x4d2b89){_0x4d2b89['push'](_['pick'](_0x18b58c,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3d8815['id'];return _0x34ab6f();})[_0xa45a('0x2c')](function(_0x1234fc){return _0x533887(handleCheckRowError(_0xa45a('0x14'),'Error\x20while\x20creating\x20contact:\x20'+(_0x1234fc[_0xa45a('0x1c')]||JSON[_0xa45a('0x2d')](_0x1234fc)),null,_0x136583));});});}function checkHopper(){function _0x58488f(){return function(_0x9eac64){logger['error']('cmContact',_0xa45a('0x2e'),util[_0xa45a('0x2f')](_0x9eac64,{'showHidden':![],'depth':null}));};}var _0x1c72ca=function(_0x27127f,_0x3c1da2){var _0x55cd89=squel['insert']()[_0xa45a('0x30')](_0xa45a('0x31'))[_0xa45a('0x32')]([_0xa45a('0x33'),_0xa45a('0x34'),_0xa45a('0x35'),_0xa45a('0x27'),_0x3c1da2,_0xa45a('0x36'),'updatedAt'],squel[_0xa45a('0x37')]()[_0xa45a('0x38')](_0xa45a('0x33'),_0xa45a('0x33'))[_0xa45a('0x38')](_0xa45a('0x39'),_0xa45a('0x34'))[_0xa45a('0x38')]('id',_0xa45a('0x35'))[_0xa45a('0x38')](LISTID[_0xa45a('0x3a')](),_0xa45a('0x27'))[_0xa45a('0x38')](_0x27127f['id'][_0xa45a('0x3a')](),_0x3c1da2)[_0xa45a('0x38')](_0xa45a('0x39'),_0xa45a('0x36'))['field'](_0xa45a('0x39'),_0xa45a('0x3b'))['from']('cm_contacts')[_0xa45a('0x3c')](_0xa45a('0x3d'))[_0xa45a('0x3c')](_0xa45a('0x3e'),LISTID['toString']())['where'](_0xa45a('0x3f'))[_0xa45a('0x3c')](_0xa45a('0x40'),squel[_0xa45a('0x37')]()[_0xa45a('0x38')](_0xa45a('0x33'))['from'](_0xa45a('0x31'))['where'](_0x3c1da2+'\x20=\x20?',_0x27127f['id']['toString']())))['toString']();return _0x55cd89;};var _0x2f5de5=function(_0x5977f4,_0x31d095){var _0x3dbac6=squel[_0xa45a('0x41')]()[_0xa45a('0x30')]('cm_hopper')[_0xa45a('0x32')]([_0xa45a('0x33'),_0xa45a('0x34'),_0xa45a('0x35'),_0xa45a('0x27'),_0x31d095,_0xa45a('0x36'),_0xa45a('0x3b')],squel[_0xa45a('0x37')]()['field'](_0xa45a('0x33'),_0xa45a('0x33'))[_0xa45a('0x38')](_0xa45a('0x39'),_0xa45a('0x34'))[_0xa45a('0x38')]('id','ContactId')['field'](LISTID['toString'](),_0xa45a('0x27'))[_0xa45a('0x38')](_0x5977f4['id'][_0xa45a('0x3a')](),_0x31d095)[_0xa45a('0x38')](_0xa45a('0x39'),_0xa45a('0x36'))[_0xa45a('0x38')](_0xa45a('0x39'),_0xa45a('0x3b'))[_0xa45a('0x42')]('cm_contacts')[_0xa45a('0x3c')]('deletedAt\x20IS\x20NULL')['where'](_0xa45a('0x3e'),LISTID[_0xa45a('0x3a')]())[_0xa45a('0x3c')](_0xa45a('0x43'),squel[_0xa45a('0x44')](hopperContacts))[_0xa45a('0x3c')](_0xa45a('0x3f'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa45a('0x37')]()[_0xa45a('0x38')]('calleridnum')[_0xa45a('0x42')]('cm_hopper_final')[_0xa45a('0x3c')](_0x31d095+_0xa45a('0x45'),_0x5977f4['id'][_0xa45a('0x3a')]()))[_0xa45a('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa45a('0x37')]()[_0xa45a('0x38')](_0xa45a('0x33'))[_0xa45a('0x42')]('cm_hopper')[_0xa45a('0x3c')](_0x31d095+_0xa45a('0x45'),_0x5977f4['id'][_0xa45a('0x3a')]())))[_0xa45a('0x3a')]();return _0x3dbac6;};function _0x355403(_0x24ab30,_0x39c00e){var _0x92bc78=squel[_0xa45a('0x41')]()[_0xa45a('0x30')]('cm_hopper')[_0xa45a('0x32')]([_0xa45a('0x33'),_0xa45a('0x34'),'ContactId',_0xa45a('0x27'),_0x39c00e,_0xa45a('0x36'),_0xa45a('0x3b')],squel[_0xa45a('0x37')]()['field'](_0xa45a('0x33'),_0xa45a('0x33'))['field'](_0xa45a('0x39'),'scheduledAt')[_0xa45a('0x38')]('id',_0xa45a('0x35'))[_0xa45a('0x38')](LISTID[_0xa45a('0x3a')](),'ListId')[_0xa45a('0x38')](_0x24ab30['id']['toString'](),_0x39c00e)['field'](_0xa45a('0x39'),_0xa45a('0x36'))[_0xa45a('0x38')]('NOW()','updatedAt')[_0xa45a('0x42')](_0xa45a('0x46'))[_0xa45a('0x3c')](_0xa45a('0x3d'))['where']('ListId\x20=\x20?',LISTID[_0xa45a('0x3a')]())[_0xa45a('0x3c')](_0xa45a('0x43'),squel['str'](hopperContacts))[_0xa45a('0x3c')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x92bc78;}function _0x907d22(_0xef4c95,_0x64a73f){var _0x5aca8d=squel[_0xa45a('0x41')]()[_0xa45a('0x30')](_0xa45a('0x47'))[_0xa45a('0x32')](['phone','ContactId',_0xa45a('0x27'),_0x64a73f,_0xa45a('0x36'),_0xa45a('0x3b')],squel['select']()['field']('phone',_0xa45a('0x33'))['field']('id',_0xa45a('0x35'))[_0xa45a('0x38')](LISTID[_0xa45a('0x3a')](),_0xa45a('0x27'))[_0xa45a('0x38')](_0xef4c95['id']['toString'](),_0x64a73f)[_0xa45a('0x38')](_0xa45a('0x39'),_0xa45a('0x36'))[_0xa45a('0x38')](_0xa45a('0x39'),_0xa45a('0x3b'))['from'](_0xa45a('0x46'))[_0xa45a('0x3c')](_0xa45a('0x3d'))[_0xa45a('0x3c')](_0xa45a('0x3e'),LISTID['toString']())[_0xa45a('0x3c')](_0xa45a('0x43'),squel[_0xa45a('0x44')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xa45a('0x3a')]();return _0x5aca8d;}return db[_0xa45a('0x48')][_0xa45a('0x49')]({'where':{'type':_0xa45a('0x4a')},'attributes':['id',_0xa45a('0x4b')],'include':[{'model':db[_0xa45a('0x4c')],'as':_0xa45a('0x4d'),'where':{'id':LISTID}}]})['then'](function(_0x1d714b){var _0x4916cd=[];if(_0x1d714b){var _0x55513;for(var _0x4eed15=0x0,_0x373183;_0x4eed15<_0x1d714b[_0xa45a('0x1a')];_0x4eed15+=0x1){_0x373183=_0x1d714b[_0x4eed15][_0xa45a('0x4e')]({'plain':!![]});switch(_0x373183[_0xa45a('0x4b')]){case _0xa45a('0x4f'):_0x4916cd[_0xa45a('0x50')](db['sequelize']['query'](_0x2f5de5(_0x373183,_0xa45a('0x51')))['then'](function(){})['catch'](_0x58488f()));break;case'onlyIfOpen':_0x4916cd['push'](db[_0xa45a('0x52')][_0xa45a('0x53')](_0x1c72ca(_0x373183,_0xa45a('0x51')))['then'](function(){})[_0xa45a('0x2c')](_0x58488f()));break;default:_0x4916cd[_0xa45a('0x50')](db['sequelize'][_0xa45a('0x53')](_0x355403(_0x373183,_0xa45a('0x51')))[_0xa45a('0x2b')](function(){})[_0xa45a('0x2c')](_0x58488f()));}}}return _0x4916cd;})[_0xa45a('0x54')]()['then'](function(){return db[_0xa45a('0x48')][_0xa45a('0x49')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xa45a('0x4c')],'as':_0xa45a('0x55'),'where':{'id':LISTID}}]})['then'](function(_0x42f2ff){var _0xf59283=[];if(_0x42f2ff){var _0x51485e;for(var _0x5539d6=0x0,_0x26f186;_0x5539d6<_0x42f2ff[_0xa45a('0x1a')];_0x5539d6+=0x1){_0x26f186=_0x42f2ff[_0x5539d6][_0xa45a('0x4e')]({'plain':!![]});_0xf59283['push'](db[_0xa45a('0x52')]['query'](_0x907d22(_0x26f186,_0xa45a('0x51')))[_0xa45a('0x2b')](function(){})[_0xa45a('0x2c')](_0x58488f()));}}return _0xf59283;})[_0xa45a('0x54')]();})[_0xa45a('0x2b')](function(){return db[_0xa45a('0x56')]['findAll']({'attributes':['id',_0xa45a('0x4b')],'include':[{'model':db[_0xa45a('0x4c')],'as':_0xa45a('0x4d'),'where':{'id':LISTID}}]})[_0xa45a('0x2b')](function(_0x2dca68){var _0x4da804=[];if(_0x2dca68){for(var _0x18e526=0x0,_0x16d743;_0x18e526<_0x2dca68[_0xa45a('0x1a')];_0x18e526+=0x1){_0x16d743=_0x2dca68[_0x18e526][_0xa45a('0x4e')]({'plain':!![]});switch(_0x16d743[_0xa45a('0x4b')]){case _0xa45a('0x4f'):_0x4da804['push'](db[_0xa45a('0x52')][_0xa45a('0x53')](_0x2f5de5(_0x16d743,_0xa45a('0x57')))['then'](function(){})[_0xa45a('0x2c')](_0x58488f()));break;case _0xa45a('0x58'):_0x4da804[_0xa45a('0x50')](db['sequelize']['query'](_0x1c72ca(_0x16d743,_0xa45a('0x57')))[_0xa45a('0x2b')](function(){})[_0xa45a('0x2c')](_0x58488f()));break;default:_0x4da804[_0xa45a('0x50')](db[_0xa45a('0x52')]['query'](_0x355403(_0x16d743,_0xa45a('0x57')))[_0xa45a('0x2b')](function(){})['catch'](_0x58488f()));}}}return _0x4da804;})[_0xa45a('0x54')]();})[_0xa45a('0x2b')](function(){return db[_0xa45a('0x56')][_0xa45a('0x49')]({'attributes':['id'],'include':[{'model':db[_0xa45a('0x4c')],'as':_0xa45a('0x55'),'where':{'id':LISTID}}]})[_0xa45a('0x2b')](function(_0x16a627){var _0x13c2d6=[];if(_0x16a627){for(var _0x365d39=0x0,_0x27b820;_0x365d39<_0x16a627[_0xa45a('0x1a')];_0x365d39+=0x1){_0x27b820=_0x16a627[_0x365d39]['get']({'plain':!![]});_0x13c2d6[_0xa45a('0x50')](db[_0xa45a('0x52')][_0xa45a('0x53')](_0x907d22(_0x27b820,_0xa45a('0x57')))[_0xa45a('0x2b')](function(){})[_0xa45a('0x2c')](_0x58488f()));}}return _0x13c2d6;})['all']();})[_0xa45a('0x2c')](function(_0x538a02){logger[_0xa45a('0x14')](_0xa45a('0x59'),_0xa45a('0x5a'),_0x538a02[_0xa45a('0x1c')]);});}var processPromises=function(_0x2a6b7a){return BPromise[_0xa45a('0x54')](promises)['then'](function(_0x295805){})['catch'](function(_0x358c14){logger['error'](_0xa45a('0x5b'),JSON[_0xa45a('0x2d')](_0x358c14));})[_0xa45a('0x5c')](function(){socket[_0xa45a('0x5d')](_0xa45a('0x5e')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2a6b7a){return _0x2a6b7a[_0xa45a('0x5f')]();}});};var endCsv=function(){return BPromise[_0xa45a('0x60')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xa45a('0x2b')](function(){socket[_0xa45a('0x5d')](_0xa45a('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xa45a('0x61')](FILEPATH);}catch(_0x30df7b){logger['error'](_0xa45a('0x62'),JSON[_0xa45a('0x2d')](_0x30df7b));}finally{process[_0xa45a('0x63')](0x0);}});};process['on']('SIGINT',function(){logger[_0xa45a('0x64')](_0xa45a('0x65'));endCsv();});function main(){return BPromise[_0xa45a('0x60')]()[_0xa45a('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xa45a('0x11')](',');return db[_0xa45a('0x66')][_0xa45a('0x49')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xa45a('0x2b')](function(_0x55d435){var _0x1442b=fs[_0xa45a('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x1442b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1c1b83,_0x197ebb){total+=0x1;var _0x59b066=total;promises[_0xa45a('0x50')](checkRow(_0x1c1b83,_0x55d435,_0x59b066)[_0xa45a('0x2b')](function(){success+=0x1;})[_0xa45a('0x2c')](function(_0x3f457e){if(_0x3f457e[_0xa45a('0x14')]){errors+=0x1;delete _0x3f457e[_0xa45a('0x14')];}else if(_0x3f457e[_0xa45a('0x68')]){duplicates+=0x1;delete _0x3f457e[_0xa45a('0x68')];}rows['push'](_0x3f457e);}));if(total%0xc8===0x0){_0x197ebb[_0xa45a('0x69')]();return processPromises(_0x197ebb);}},'complete':function(){return processPromises()['then'](function(){logger[_0xa45a('0x64')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x464915,_0x59242c){logger['info'](_0xa45a('0x6a'),JSON[_0xa45a('0x2d')](_0x464915));endCsv();}});})['catch'](function(_0x266b4b){logger[_0xa45a('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xa45a('0x2d')](_0x266b4b));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 93bfd13..366a126 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 _0x75bc=['redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','from','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','AdditionalPhones','then','length','push','split','all','isNil','filter','CmContactHasItem','findOne','update','updated','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','UserId','fields','join','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','cm_hopper_black','updatedAt','cm_contacts.ListId\x20=\x20','.id\x20=\x20','field','toString','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','into','recallme','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','cm_contact_has_items','concat','keys','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','message','errors','code','query','catch','error','campaigns.id','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','voice_queues.id','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','offset','set','spread','main','stringify','send','clone','root','server/files/tmp','.csv','header','ContactItemType','name','_description','data','rows','find','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','voice_queues_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','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()','contactId','contactTypeId','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','map','No\x20agent\x20available','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import'];(function(_0x442db0,_0x206e06){var _0x10f6e8=function(_0x206856){while(--_0x206856){_0x442db0['push'](_0x442db0['shift']());}};_0x10f6e8(++_0x206e06);}(_0x75bc,0xa8));var _0xc75b=function(_0x50d3a3,_0x107a84){_0x50d3a3=_0x50d3a3-0x0;var _0x7df149=_0x75bc[_0x50d3a3];return _0x7df149;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xc75b('0x0'));var Papa=require(_0xc75b('0x1'));var util=require(_0xc75b('0x2'));var BPromise=require(_0xc75b('0x3'));var moment=require(_0xc75b('0x4'));var squel=require(_0xc75b('0x5'));var Redis=require(_0xc75b('0x6'));var db=require(_0xc75b('0x7'))['db'];var config=require(_0xc75b('0x8'));var shared=require(_0xc75b('0x9'));var logger=require(_0xc75b('0xa'))(_0xc75b('0xb'));config[_0xc75b('0xc')]=_[_0xc75b('0xd')](config[_0xc75b('0xc')],{'host':_0xc75b('0xe'),'port':0x18eb});var socket=require(_0xc75b('0xf'))(new Redis(config[_0xc75b('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0xc75b('0x10'));function isEmail(_0x171d81){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))*$/[_0xc75b('0x11')](_0x171d81);}function selectNotIn(_0x28cdb1,_0xda3f,_0x15849d,_0x7d8ee1,_0x15c392){return squel[_0xc75b('0x12')]()['field'](_0xc75b('0x13'))[_0xc75b('0x14')](_0x7d8ee1)['join'](_0xda3f,null,_0xda3f+'.id\x20=\x20'+_0x7d8ee1+'.'+_0x15849d)[_0xc75b('0x15')](_0x7d8ee1+'.'+_0x15849d+_0xc75b('0x16')+_0x28cdb1+'.'+_0x15849d)[_0xc75b('0x15')](_0xda3f+_0xc75b('0x17')+_0x15c392['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x153293,_0xce8457){promisesAdditionalPhones=[];return db[_0xc75b('0x18')]['findAll']({'raw':!![],'attributes':['id',_0xc75b('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xc75b('0x1a')](function(_0x5def98){if(_0x5def98!==null){var _0x4cf360=[];for(var _0x5aaf7f=0x0;_0x5aaf7f<_0x5def98[_0xc75b('0x1b')];_0x5aaf7f++){var _0x3e50a4=_0x5def98[_0x5aaf7f];_0x4cf360[_0xc75b('0x1c')](insertAdditionalPhones(_0x3e50a4));}}Promise['all'](_0x4cf360)[_0xc75b('0x1a')](function(){_0x153293({'val':0x1});});});});}function insertAdditionalPhones(_0x21add8){return new Promise(function(_0x48b278,_0x591cd9){var _0x32c26a=_0x21add8[_0xc75b('0x19')];var _0xe3fafd=_0x32c26a[_0xc75b('0x1d')](';');var _0x5be2e0=[];orderBy=0x0;for(var _0x4a1c25=0x0;_0x4a1c25<_0xe3fafd[_0xc75b('0x1b')];_0x4a1c25++){_0x5be2e0[_0xc75b('0x1c')](splitAdditionalPhone(_0x21add8['id'],_0xe3fafd[_0x4a1c25]));}Promise[_0xc75b('0x1e')](_0x5be2e0)['then'](function(){_0x48b278({'val':_0xe3fafd[_0xc75b('0x1b')]});});});}function splitAdditionalPhone(_0x5d3717,_0x3c7183){return new Promise(function(_0x17bdbd,_0x324bcf){var _0x2ca1c3=_0x3c7183[_0xc75b('0x1d')](':');var _0x573207=_0x2ca1c3[0x0];var _0x2b9932=_0x2ca1c3[0x1];if(!_[_0xc75b('0x1f')](_0x2b9932)){var _0x429a0b=_0x2b9932[_0xc75b('0x1d')]('|');var _0x4d84ee=[];for(var _0x4298ba=0x0;_0x4298ba<_0x429a0b[_0xc75b('0x1b')];_0x4298ba++){if(_0x429a0b[_0x4298ba]!==''){var _0x444f71=_[_0xc75b('0x20')](promisesAdditionalPhones,{'contactId':_0x5d3717,'phone':_0x429a0b[_0x4298ba]});if(_0x444f71[_0xc75b('0x1b')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x5d3717,'contactTypeId':_0x573207,'phone':_0x429a0b[_0x4298ba],'orderBy':orderBy});}}}_0x17bdbd({'ok':0x1});}else _0x17bdbd({'res':0x0});});}function createAdditionalPhone(_0x4e99a8,_0x5ecf22,_0x2f8950,_0x4e71e9){var _0x45eb58='';var _0x3e4a43='';var _0x5b9c0e=_0x2f8950[_0xc75b('0x1d')]('§');_0x45eb58=_0x5b9c0e[0x0];if(_0x5b9c0e[_0xc75b('0x1b')]==0x2)_0x3e4a43=_0x5b9c0e[0x1];return new Promise(function(_0x3c8d1d,_0xc43243){return db[_0xc75b('0x21')][_0xc75b('0x22')]({'where':{'CmContactId':_0x4e99a8,'item':_0x45eb58}})[_0xc75b('0x1a')](function(_0x57b135){if(_0x57b135){return db[_0xc75b('0x21')][_0xc75b('0x23')]({'ItemTypeId':_0x5ecf22,'description':_0x3e4a43,'OrderBy':_0x4e71e9},{'where':{'CmContactId':_0x4e99a8,'item':_0x45eb58}})['then'](function(_0x5b64fa){_0x3c8d1d({'res':_0xc75b('0x24')});});}else{return db[_0xc75b('0x21')]['create']({'CmContactId':_0x4e99a8,'item':_0x45eb58,'description':_0x3e4a43,'ItemTypeId':_0x5ecf22,'OrderBy':_0x4e71e9,'ItemClass':'PHONE'})['then'](function(_0xf94a5a){_0x3c8d1d({'res':'inserted'});});}});});}function insertCmHopper(_0x237bd6,_0x30a84a,_0x1521ab,_0x3029bc,_0x2e692b){var _0x1d549c=[_0xc75b('0x25'),_0xc75b('0x26'),_0xc75b('0x27'),_0xc75b('0x28'),_0x30a84a+'.'+_0x3029bc,_0xc75b('0x29'),_0xc75b('0x2a'),'cm_contacts.priority',_0xc75b('0x2b'),'\x22'+_0x2e692b+'\x22'];return squel[_0xc75b('0x2c')]()['into']('cm_hopper')[_0xc75b('0x2d')]([_0xc75b('0x13'),_0xc75b('0x2e'),_0xc75b('0x2f'),_0xc75b('0x30'),_0x3029bc,_0xc75b('0x31'),'updatedAt',_0xc75b('0x32'),_0xc75b('0x33'),'recallme'],squel[_0xc75b('0x12')]()[_0xc75b('0x34')](_0x1d549c)['from'](_0x30a84a)[_0xc75b('0x35')](_0xc75b('0x36'),null,'cm_contacts.ListId\x20=\x20'+_0x30a84a+_0xc75b('0x37'))['join'](_0x1521ab,null,_0x1521ab+'.id\x20=\x20'+_0x30a84a+'.'+_0x3029bc)[_0xc75b('0x15')](_0x30a84a+'.CmListId\x20=\x20?',_0x237bd6)[_0xc75b('0x15')](_0xc75b('0x38'),NOW)[_0xc75b('0x15')](_0xc75b('0x39'),selectNotIn(_0x30a84a,_0x1521ab,_0x3029bc,_0xc75b('0x3a'),[_0xc75b('0x3b'),_0xc75b('0x3c')]))[_0xc75b('0x15')](_0xc75b('0x39'),selectNotIn(_0x30a84a,_0x1521ab,_0x3029bc,_0xc75b('0x3a'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x2b8d14,_0x37359c,_0x50a451,_0x2ce5a2){var _0xb12d34=[_0xc75b('0x25'),_0xc75b('0x27'),_0xc75b('0x28'),_0x37359c+'.'+_0x2ce5a2,'cm_contacts.createdAt',_0xc75b('0x2a')];return squel[_0xc75b('0x2c')]()['into'](_0xc75b('0x3d'))[_0xc75b('0x2d')]([_0xc75b('0x13'),_0xc75b('0x2f'),_0xc75b('0x30'),_0x2ce5a2,_0xc75b('0x31'),_0xc75b('0x3e')],squel[_0xc75b('0x12')]()[_0xc75b('0x34')](_0xb12d34)[_0xc75b('0x14')](_0x37359c)['join']('cm_contacts',null,_0xc75b('0x3f')+_0x37359c+_0xc75b('0x37'))[_0xc75b('0x35')](_0x50a451,null,_0x50a451+_0xc75b('0x40')+_0x37359c+'.'+_0x2ce5a2)[_0xc75b('0x15')](_0x37359c+'.CmListId\x20=\x20?',_0x2b8d14)[_0xc75b('0x15')](_0xc75b('0x38'),NOW)[_0xc75b('0x15')](_0xc75b('0x39'),squel[_0xc75b('0x12')]()[_0xc75b('0x41')](_0xc75b('0x13'))['from'](_0xc75b('0x3d'))[_0xc75b('0x15')]('ListId\x20=\x20?',_0x2b8d14)['where'](_0x2ce5a2+_0xc75b('0x16')+_0x37359c+'.'+_0x2ce5a2)))[_0xc75b('0x42')]();}function insertTzCmHopper(_0x2e052e,_0x59b23c,_0x3e5212,_0x2dbf79,_0x1dee1a,_0x4d6b23){var _0x5aa1dd=['cm_contacts.phone',_0xc75b('0x43')+_0x4d6b23+_0xc75b('0x44'),_0xc75b('0x27'),_0xc75b('0x28'),_0x59b23c+'.'+_0x2dbf79,_0xc75b('0x29'),_0xc75b('0x2a'),'cm_contacts.priority',_0xc75b('0x2b'),'\x22'+_0x1dee1a+'\x22'];var _0x5ec9d8=squel[_0xc75b('0x2c')]()[_0xc75b('0x45')](_0xc75b('0x3a'))[_0xc75b('0x2d')]([_0xc75b('0x13'),_0xc75b('0x2e'),'ContactId','ListId',_0x2dbf79,_0xc75b('0x31'),_0xc75b('0x3e'),'priority',_0xc75b('0x33'),_0xc75b('0x46')],squel[_0xc75b('0x12')]()[_0xc75b('0x34')](_0x5aa1dd)['from'](_0x59b23c)[_0xc75b('0x35')](_0xc75b('0x36'),null,'cm_contacts.ListId\x20=\x20'+_0x59b23c+'.CmListId')[_0xc75b('0x35')](_0x3e5212,null,_0x3e5212+_0xc75b('0x40')+_0x59b23c+'.'+_0x2dbf79)['join'](_0x4d6b23,null,_0x4d6b23+_0xc75b('0x40')+_0x59b23c+'.'+_0x2dbf79)[_0xc75b('0x15')](_0x59b23c+'.CmListId\x20=\x20?',_0x2e052e)[_0xc75b('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xc75b('0x15')](_0xc75b('0x39'),selectNotIn(_0x59b23c,_0x3e5212,_0x2dbf79,_0xc75b('0x3a'),[_0xc75b('0x3b'),'\x22onlyIfOpen\x22']))[_0xc75b('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x59b23c,_0x3e5212,_0x2dbf79,_0xc75b('0x3a'),[_0xc75b('0x3b')])))[_0xc75b('0x42')]();return _0x5ec9d8;}function insertTzCmHopperBlack(_0x534f13,_0x519d47,_0xc230ca,_0x67446a){var _0x4eddde=[_0xc75b('0x25'),_0xc75b('0x27'),_0xc75b('0x28'),_0x519d47+'.'+_0x67446a,_0xc75b('0x29'),_0xc75b('0x2a')];return squel[_0xc75b('0x2c')]()[_0xc75b('0x45')](_0xc75b('0x3d'))[_0xc75b('0x2d')]([_0xc75b('0x13'),_0xc75b('0x2f'),_0xc75b('0x30'),_0x67446a,_0xc75b('0x31'),'updatedAt'],squel[_0xc75b('0x12')]()[_0xc75b('0x34')](_0x4eddde)[_0xc75b('0x14')](_0x519d47)[_0xc75b('0x35')](_0xc75b('0x36'),null,_0xc75b('0x3f')+_0x519d47+_0xc75b('0x37'))[_0xc75b('0x35')](_0xc230ca,null,_0xc230ca+_0xc75b('0x40')+_0x519d47+'.'+_0x67446a)['where'](_0x519d47+'.CmListId\x20=\x20?',_0x534f13)['where'](_0xc75b('0x38'),NOW)[_0xc75b('0x15')](_0xc75b('0x39'),squel[_0xc75b('0x12')]()[_0xc75b('0x41')](_0xc75b('0x13'))[_0xc75b('0x14')](_0xc75b('0x3d'))[_0xc75b('0x15')](_0xc75b('0x47'),_0x534f13)['where'](_0x67446a+'\x20=\x20'+_0x519d47+'.'+_0x67446a)))[_0xc75b('0x42')]();}function insertCmHopperAdditionalPhones(_0x5b3f8e){var _0x375abb=[_0xc75b('0x48'),_0xc75b('0x49'),_0xc75b('0x4a'),'cm_contact_has_items.createdAt',_0xc75b('0x4b')];return squel[_0xc75b('0x2c')]()[_0xc75b('0x45')]('cm_hopper_additional_phones')[_0xc75b('0x2d')]([_0xc75b('0x4c'),_0xc75b('0x13'),_0xc75b('0x4d'),_0xc75b('0x31'),_0xc75b('0x3e')],squel[_0xc75b('0x12')]()['fields'](_0x375abb)[_0xc75b('0x14')]('cm_hopper')[_0xc75b('0x35')](_0xc75b('0x36'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')['join'](_0xc75b('0x4e'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xc75b('0x15')]('cm_hopper.ListId\x20=\x20?',_0x5b3f8e)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0xc75b('0x42')]();}function insertCmContact(_0x5a8ab5,_0x185fa0,_0x196a8d,_0x54949b){var _0x66d8cd=_[_0xc75b('0x4f')](_[_0xc75b('0x50')](_0x54949b),['ListId',_0xc75b('0x51'),'createdAt',_0xc75b('0x3e'),_0xc75b('0x52')]);return squel[_0xc75b('0x2c')]()['into'](_0xc75b('0x36'))[_0xc75b('0x2d')](_0x66d8cd,squel['select']()['fields'](_0x66d8cd)[_0xc75b('0x14')](_0x185fa0)[_0xc75b('0x15')]('('+_0x196a8d[_0xc75b('0x35')](',')+_0xc75b('0x53'),squel[_0xc75b('0x12')]()[_0xc75b('0x34')](_0x196a8d)[_0xc75b('0x14')]('cm_contacts')[_0xc75b('0x15')](_0xc75b('0x47'),_0x5a8ab5)[_0xc75b('0x15')](_0xc75b('0x54')))['where'](_0xc75b('0x55'),squel[_0xc75b('0x12')]()[_0xc75b('0x41')](_0xc75b('0x56'),_0xc75b('0x57'))[_0xc75b('0x14')](_0x185fa0)['group'](_0x196a8d['join'](','))))[_0xc75b('0x42')]();}function handleStop(){logger[_0xc75b('0x58')](_0xc75b('0x59'));stopped=!![];}function handleUncaughtException(_0x243b47){logger['error'](_0x243b47[_0xc75b('0x5a')]);process['exit'](0x1);}function handleError(_0xb2abd1,_0x11e929){stats[_0xc75b('0x5b')][_0xc75b('0x1c')]({'name':_0x11e929[_0xc75b('0x5c')],'message':_0x11e929[_0xc75b('0x5a')],'row':_0xb2abd1});}function handleQuery(_0xf70bb3){logger['info'](_0xf70bb3);return db['sequelize'][_0xc75b('0x5d')](_0xf70bb3)['spread'](function(_0x11cbca){results[_0xc75b('0x1c')](_0x11cbca);})[_0xc75b('0x5e')](function(_0x2bd85b){logger[_0xc75b('0x5f')](_0x2bd85b[_0xc75b('0x5a')]);});}function updateTzCampaigns(_0x5da9f4){return new Promise(function(_0x28c4d7,_0x2dc382){var _0x19fa2f=squel[_0xc75b('0x12')]()[_0xc75b('0x34')]([_0xc75b('0x60'),'campaigns.dialTimezone'])[_0xc75b('0x14')]('campaigns')[_0xc75b('0x35')](_0xc75b('0x61'),null,_0xc75b('0x62'))[_0xc75b('0x15')](_0xc75b('0x63')+_0x5da9f4);db[_0xc75b('0x64')]['query'](_0x19fa2f[_0xc75b('0x42')]())['spread'](function(_0x300854){var _0x126f61=[];for(var _0x5b4ef9=0x0;_0x5b4ef9<_0x300854[_0xc75b('0x1b')];_0x5b4ef9++){_0x126f61['push'](getTimezoneData(_0x300854[_0x5b4ef9],tmp_campaigns));}BPromise[_0xc75b('0x1e')](_0x126f61)['then'](function(){_0x28c4d7({'val':0x1});});})[_0xc75b('0x5e')](function(_0x54bedb){logger['error'](_0x54bedb[_0xc75b('0x5a')]);_0x28c4d7({'val':0x0});});});}function updateTzVoiceQueues(_0x16d141){return new Promise(function(_0x1cc9eb,_0x2a9438){var _0x5da5f1=squel[_0xc75b('0x12')]()['fields']([_0xc75b('0x65'),'voice_queues.dialTimezone'])[_0xc75b('0x14')](_0xc75b('0x66'))[_0xc75b('0x35')]('voice_queues_has_cm_lists',null,_0xc75b('0x67'))[_0xc75b('0x15')](_0xc75b('0x68')+_0x16d141);db['sequelize']['query'](_0x5da5f1[_0xc75b('0x42')]())['spread'](function(_0x4070c9){var _0xfb5fb2=[];for(var _0x13d199=0x0;_0x13d199<_0x4070c9[_0xc75b('0x1b')];_0x13d199++){_0xfb5fb2[_0xc75b('0x1c')](getTimezoneData(_0x4070c9[_0x13d199],tmp_voice_queues));}BPromise[_0xc75b('0x1e')](_0xfb5fb2)[_0xc75b('0x1a')](function(){_0x1cc9eb({'val':0x1});});})[_0xc75b('0x5e')](function(_0x2ff788){logger['error'](_0x2ff788[_0xc75b('0x5a')]);_0x1cc9eb({'val':0x0});});});}function getTimezoneData(_0x93edbc,_0x127879){return new Promise(function(_0x265c10,_0x542fec){var _0x55a053=shared[_0xc75b('0x69')];var _0x484582=_0x55a053[_0x93edbc[_0xc75b('0x6a')]];if(_['isNil'](_0x484582)){_0x265c10({'ret':0x1});}else{var _0x20fb4a=_0x484582[_0xc75b('0x6b')];var _0x346dea=squel[_0xc75b('0x2c')]()[_0xc75b('0x45')](_0x127879)['set']('id',_0x93edbc['id'])['set'](_0xc75b('0x6c'),_0x20fb4a)[_0xc75b('0x6d')](_0xc75b('0x6a'),_0x93edbc[_0xc75b('0x6a')])[_0xc75b('0x42')]();return db['sequelize'][_0xc75b('0x5d')](_0x346dea)[_0xc75b('0x6e')](function(_0x311c58){_0x265c10({'ret':0x1});})[_0xc75b('0x5e')](function(_0x5f003e){logger['error'](_0x5f003e['message']);_0x542fec({'ret':0x1});});}});}function handleTZQuery(_0xd7e3a3){logger[_0xc75b('0x58')](_0xd7e3a3);return db[_0xc75b('0x64')][_0xc75b('0x5d')](_0xd7e3a3)['spread'](function(_0x58b3e2){})[_0xc75b('0x5e')](function(_0x4b0baf){logger[_0xc75b('0x5f')](_0x4b0baf[_0xc75b('0x5a')]);});}function main(_0x583567,_0x4c6823,_0x4aa1db,_0x3c7e33){logger['info'](_0xc75b('0x6f'),_0x583567,JSON[_0xc75b('0x70')](_0x4c6823));process[_0xc75b('0x71')]('start');var _0x5564cc=_0x4c6823['binding'];var _0x19a188=_[_0xc75b('0x72')](_0x5564cc);var _0xcfc2e0=_0x4c6823['socket_timestamp'];var _0x5128da=path['join'](config[_0xc75b('0x73')],_0xc75b('0x74'),_0xcfc2e0+_0xc75b('0x75'));hasTZ=_[_0xc75b('0x50')](_0x5564cc)['includes'](_0xc75b('0x6a'));var _0x235474=_['keys'](_0x5564cc)[_0xc75b('0x35')]();logger[_0xc75b('0x58')](_0xc75b('0x76'),_0x235474);db[_0xc75b('0x77')]['findAll']({'raw':!![],'attributes':['id',_0xc75b('0x78')]})[_0xc75b('0x1a')](function(_0x4baf2e){for(var _0x1402df=0x0;_0x1402df<_0x4baf2e[_0xc75b('0x1b')];_0x1402df++){if(_0x4baf2e[_0x1402df][_0xc75b('0x78')]in _0x5564cc){contactItemTypes['push'](_0x4baf2e[_0x1402df]);delete _0x19a188[_0x4baf2e[_0x1402df][_0xc75b('0x78')]];hasAdditionalPhones=!![];}for(var _0x426ffa in _0x5564cc){if(_0x4baf2e[_0x1402df]['name']+_0xc75b('0x79')===_0x426ffa){phoneDescriptions[_0xc75b('0x1c')]({'itemTypeId':_0x4baf2e[_0x1402df]['id'],'description':_0x426ffa});delete _0x19a188[_0x426ffa];}}}if(hasAdditionalPhones)_0x19a188[_0xc75b('0x19')]='';var _0x49ad9d=_[_0xc75b('0x50')](_0x19a188)[_0xc75b('0x35')]();logger[_0xc75b('0x58')](_0xc75b('0x76'),_0x49ad9d);fs['writeFileSync'](_0x5128da,_0x49ad9d+'\x0a');Papa['parse'](fs['createReadStream'](_0x583567),{'header':!![],'skipEmptyLines':!![],'step':function(_0x23aea2,_0x26232b){try{for(var _0x354140=0x0,_0x10dd06=[];_0x354140<_0x23aea2[_0xc75b('0x7a')][_0xc75b('0x1b')];_0x354140++){stats[_0xc75b('0x7b')]+=0x1;if(_0x23aea2['errors'][_0x354140]){handleError(_0x23aea2[_0xc75b('0x7a')][_0x354140],_0x23aea2[_0xc75b('0x5b')][_0x354140]);}else{var _0x527933=[];var _0x65d95=[];var _0x5c2f2c={};for(var _0x1f8623 in _0x5564cc){let _0x332459=contactItemTypes[_0xc75b('0x7c')](_0x580998=>_0x580998[_0xc75b('0x78')]===_0x1f8623);let _0x994ac4=contactItemTypes[_0xc75b('0x7c')](_0x53b60c=>_0x53b60c[_0xc75b('0x78')]+'_description'===_0x1f8623);if(_[_0xc75b('0x1f')](_0x332459)&&_[_0xc75b('0x1f')](_0x994ac4)){if(_0x5564cc['hasOwnProperty'](_0x1f8623)){if(_0x23aea2['data'][_0x354140][_0x5564cc[_0x1f8623]]){var _0x377702=_[_0xc75b('0x7d')](_0x23aea2[_0xc75b('0x7a')][_0x354140][_0x5564cc[_0x1f8623]][_0xc75b('0x7e')](/"/g,'\x27'));switch(_0x1f8623){case'scheduledat':var _0xba6fee=moment(_0x377702,_0xc75b('0x10'),!![]);if(_0xba6fee['isValid']()){_0x10dd06['push']('\x22'+_0x377702+'\x22');}else{_0x527933['push'](_0xc75b('0x7f'));}break;case'priority':var _0x5e39b6=parseInt(_0x377702);_0x377702=_[_0xc75b('0x80')](_0x5e39b6)||_0x5e39b6<0x0||_0x5e39b6>0x4?_0x3c7e33?0x3:0x2:_0x5e39b6;_0x10dd06[_0xc75b('0x1c')]('\x22'+_0x377702+'\x22');break;case _0xc75b('0x33'):var _0x15c0f8=parseInt(_0x377702);if(_[_0xc75b('0x81')](_0x15c0f8)&&_[_0xc75b('0x82')](_0x4aa1db,_0x15c0f8)){_0x10dd06['push']('\x22'+_0x15c0f8+'\x22');}else{_0x527933[_0xc75b('0x1c')](_0xc75b('0x83'));}break;case'email':if(isEmail(_0x377702)){_0x10dd06[_0xc75b('0x1c')]('\x22'+_0x377702+'\x22');}else{_0x527933['push'](_0xc75b('0x84'));}break;case _0xc75b('0x85'):var _0x3c70f7=moment(_0x377702,'YYYY-MM-DD',!![]);if(_0x3c70f7[_0xc75b('0x86')]()){_0x10dd06[_0xc75b('0x1c')]('\x22'+_0x377702+'\x22');}else{_0x527933[_0xc75b('0x1c')](_0xc75b('0x87'));}break;case _0xc75b('0x6a'):var _0x5df9ad=shared[_0xc75b('0x69')];var _0xee7290=_0x5df9ad[_0x377702];if(!_[_0xc75b('0x1f')](_0xee7290)){var _0x599222=_0xee7290[_0xc75b('0x6b')];_0x10dd06[_0xc75b('0x1c')]('\x22'+_0x377702+'\x22');_0x10dd06[_0xc75b('0x1c')]('\x22'+_0x599222+'\x22');}break;default:_0x10dd06[_0xc75b('0x1c')]('\x22'+_0x377702+'\x22');}}else{switch(_0x1f8623){case _0xc75b('0x88'):case _0xc75b('0x13'):_0x527933[_0xc75b('0x1c')](_0x1f8623+'\x20not\x20specified');break;default:_0x10dd06[_0xc75b('0x1c')]('\x22\x22');}}}}else{var _0xcc3804='';if(!_[_0xc75b('0x1f')](_0x332459)){if(!_0x5c2f2c['hasOwnProperty'](_0x332459['id'])){if(!_[_0xc75b('0x1f')](_0x23aea2[_0xc75b('0x7a')][_0x354140][_0x5564cc[_0x1f8623]])){var _0x377702=_['trim'](_0x23aea2['data'][_0x354140][_0x5564cc[_0x1f8623]][_0xc75b('0x7e')](/"/g,'\x27'));var _0x355fd4=phoneDescriptions[_0xc75b('0x7c')](_0x48a7bd=>_0x48a7bd[_0xc75b('0x89')]===_0x332459['id']);if(!_['isNil'](_0x355fd4)){var _0x5e554a=_['trim'](_0x23aea2['data'][_0x354140][_0x5564cc[_0x355fd4[_0xc75b('0x8a')]]][_0xc75b('0x7e')](/"/g,'\x27'));if(!_[_0xc75b('0x1f')](_0x5e554a))_0x377702=_0x377702+'§'+_0x5e554a;}if(_0xcc3804=='')_0xcc3804=_0x377702;else _0xcc3804+='|'+_0x377702;}_0x65d95[_0xc75b('0x1c')](_0x332459['id']+':'+_0xcc3804);_0x5c2f2c[_0x332459['id']]=0x1;}}}}if(hasAdditionalPhones){_0x10dd06[_0xc75b('0x1c')]('\x22'+_0x65d95['join'](';')+'\x22');}if(_0x527933[_0xc75b('0x1b')]){handleError(_0x23aea2['data'][_0x354140],{'code':_0xc75b('0x8b'),'message':_0x527933[_0xc75b('0x35')]()});}else{fs[_0xc75b('0x8c')](_0x5128da,_0x10dd06[_0xc75b('0x35')]()+'\x0a');}_0x10dd06=[];}if(!(stats[_0xc75b('0x7b')]%0xc8)){socket[_0xc75b('0x8d')](_0xc75b('0x8e')+_0xcfc2e0,stats);stats[_0xc75b('0x5b')]=[];}}if(stopped){logger[_0xc75b('0x58')](_0xc75b('0x8f'));_0x26232b[_0xc75b('0x90')]();}}catch(_0xa4d2e1){handleError(_0x23aea2['data'][_0x354140],{'code':'SystemError','message':_0xa4d2e1[_0xc75b('0x5a')]});logger['error'](_0xc75b('0x91'),_0xa4d2e1['message']);}},'complete':function(){try{var _0x5c5910=[];var _0x526789=[];var _0x56a662=_0xc75b('0x36');if(_0x4c6823[_0xc75b('0x92')]&&_0x4c6823[_0xc75b('0x92')][_0xc75b('0x1b')]){_0x56a662=_0xc75b('0x93')+_0xcfc2e0;_0x5c5910[_0xc75b('0x1c')]('CREATE\x20TABLE\x20'+_0x56a662+_0xc75b('0x94'));}tmp_campaigns='campaigns_'+_0xcfc2e0;tmp_voice_queues=_0xc75b('0x95')+_0xcfc2e0;_0x526789[_0xc75b('0x1c')](_0xc75b('0x96')+tmp_campaigns+_0xc75b('0x97'));_0x526789[_0xc75b('0x1c')](_0xc75b('0x96')+tmp_voice_queues+_0xc75b('0x97'));BPromise[_0xc75b('0x98')](_0x526789,handleTZQuery)[_0xc75b('0x1a')](function(_0x54f926){updateTzCampaigns(_0x4c6823[_0xc75b('0x30')])['then'](function(_0x2314c6){updateTzVoiceQueues(_0x4c6823[_0xc75b('0x30')])['then'](function(_0x2ae9fe){if(hasTZ)_0x49ad9d=_0x49ad9d['replace']('dialTimezone',_0xc75b('0x99'));var _0x354333=util['format'](_0xc75b('0x9a'),_0x5128da,_0x56a662,_0x49ad9d,_0x4c6823[_0xc75b('0x30')],_0x4c6823[_0xc75b('0x51')]||null,NOW,NOW);if(_['isNil'](_0x5564cc[_0xc75b('0x2e')])){_0x354333+=_0xc75b('0x9b');}_0x5c5910['push'](_0x354333);if(_0x4c6823[_0xc75b('0x92')]&&_0x4c6823[_0xc75b('0x92')][_0xc75b('0x1b')]){_0x5c5910['push'](insertCmContact(_0x4c6823[_0xc75b('0x30')],_0x56a662,_0x4c6823[_0xc75b('0x92')],_0x5564cc));_0x5c5910[_0xc75b('0x1c')]('DROP\x20TABLE\x20'+_0x56a662+';');}BPromise[_0xc75b('0x98')](_0x5c5910,handleQuery)[_0xc75b('0x1a')](function(_0x488fe8){BPromise['all']([handleAdditionalPhones()])[_0xc75b('0x1a')](function(){_0x5c5910=[];for(var _0x11579d=0x0;_0x11579d\x20\x20','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','No\x20agent\x20available','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','defaults','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','then','push','all','AdditionalPhones','split','length','filter','findOne','update','updated','create','PHONE','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','cm_contacts.ListId\x20=\x20','join','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.phone','cm_contacts.id','cm_hopper_black','cm_contacts','.CmListId','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','scheduledat','recallme','\x22onlyIfOpen\x22','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','group','info','Received\x20SIGINT','message','errors','code','sequelize','query','spread'];(function(_0x18b191,_0x4e0684){var _0x43e146=function(_0x4b464e){while(--_0x4b464e){_0x18b191['push'](_0x18b191['shift']());}};_0x43e146(++_0x4e0684);}(_0xdd1f,0x101));var _0xfdd1=function(_0x2f9606,_0x415e64){_0x2f9606=_0x2f9606-0x0;var _0x8a7337=_0xdd1f[_0x2f9606];return _0x8a7337;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xfdd1('0x0'));var Papa=require(_0xfdd1('0x1'));var util=require(_0xfdd1('0x2'));var BPromise=require(_0xfdd1('0x3'));var moment=require(_0xfdd1('0x4'));var squel=require(_0xfdd1('0x5'));var Redis=require(_0xfdd1('0x6'));var db=require(_0xfdd1('0x7'))['db'];var config=require(_0xfdd1('0x8'));var shared=require('../../../config/environment/shared');var logger=require(_0xfdd1('0x9'))('import');config['redis']=_[_0xfdd1('0xa')](config[_0xfdd1('0xb')],{'host':_0xfdd1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfdd1('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xfdd1('0xd')](_0xfdd1('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xfdd1('0xd')](_0xfdd1('0xe'));function isEmail(_0x27ef53){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))*$/[_0xfdd1('0xf')](_0x27ef53);}function selectNotIn(_0x184e8d,_0x3a0874,_0x47ad53,_0x37e49e,_0x55eaac){return squel[_0xfdd1('0x10')]()[_0xfdd1('0x11')](_0xfdd1('0x12'))[_0xfdd1('0x13')](_0x37e49e)['join'](_0x3a0874,null,_0x3a0874+_0xfdd1('0x14')+_0x37e49e+'.'+_0x47ad53)[_0xfdd1('0x15')](_0x37e49e+'.'+_0x47ad53+_0xfdd1('0x16')+_0x184e8d+'.'+_0x47ad53)[_0xfdd1('0x15')](_0x3a0874+_0xfdd1('0x17')+_0x55eaac['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x335e1d,_0x5efe1d){promisesAdditionalPhones=[];return db[_0xfdd1('0x18')][_0xfdd1('0x19')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xfdd1('0x1a')](function(_0x4bd801){if(_0x4bd801!==null){var _0x27a23c=[];for(var _0x2b2b05=0x0;_0x2b2b05<_0x4bd801['length'];_0x2b2b05++){var _0x9d0e5c=_0x4bd801[_0x2b2b05];_0x27a23c[_0xfdd1('0x1b')](insertAdditionalPhones(_0x9d0e5c));}}Promise[_0xfdd1('0x1c')](_0x27a23c)[_0xfdd1('0x1a')](function(){_0x335e1d({'val':0x1});});});});}function insertAdditionalPhones(_0x23d050){return new Promise(function(_0x164506,_0x5c6b93){var _0x1bba46=_0x23d050[_0xfdd1('0x1d')];var _0x104ebf=_0x1bba46[_0xfdd1('0x1e')](';');var _0x320bb8=[];orderBy=0x0;for(var _0x1ddf7b=0x0;_0x1ddf7b<_0x104ebf['length'];_0x1ddf7b++){_0x320bb8['push'](splitAdditionalPhone(_0x23d050['id'],_0x104ebf[_0x1ddf7b]));}Promise[_0xfdd1('0x1c')](_0x320bb8)[_0xfdd1('0x1a')](function(){_0x164506({'val':_0x104ebf['length']});});});}function splitAdditionalPhone(_0x52c32c,_0x57b87a){return new Promise(function(_0xa67410,_0x40e63b){var _0x5b3862=_0x57b87a[_0xfdd1('0x1e')](':');var _0x1509de=_0x5b3862[0x0];var _0xb42540=_0x5b3862[0x1];if(!_['isNil'](_0xb42540)){var _0x3bf683=_0xb42540[_0xfdd1('0x1e')]('|');var _0x322451=[];for(var _0x3aa2c8=0x0;_0x3aa2c8<_0x3bf683[_0xfdd1('0x1f')];_0x3aa2c8++){if(_0x3bf683[_0x3aa2c8]!==''){var _0x210cd4=_[_0xfdd1('0x20')](promisesAdditionalPhones,{'contactId':_0x52c32c,'phone':_0x3bf683[_0x3aa2c8]});if(_0x210cd4[_0xfdd1('0x1f')]==0x0){orderBy++;promisesAdditionalPhones[_0xfdd1('0x1b')]({'contactId':_0x52c32c,'contactTypeId':_0x1509de,'phone':_0x3bf683[_0x3aa2c8],'orderBy':orderBy});}}}_0xa67410({'ok':0x1});}else _0xa67410({'res':0x0});});}function createAdditionalPhone(_0x439689,_0x3178ba,_0x46b79d,_0x4e74c2){var _0x1fcd0a='';var _0x7bae28='';var _0xe75af9=_0x46b79d['split']('§');_0x1fcd0a=_0xe75af9[0x0];if(_0xe75af9[_0xfdd1('0x1f')]==0x2)_0x7bae28=_0xe75af9[0x1];return new Promise(function(_0x4f8e3e,_0xec702d){return db['CmContactHasItem'][_0xfdd1('0x21')]({'where':{'CmContactId':_0x439689,'item':_0x1fcd0a}})[_0xfdd1('0x1a')](function(_0x48cd59){if(_0x48cd59){return db['CmContactHasItem'][_0xfdd1('0x22')]({'ItemTypeId':_0x3178ba,'description':_0x7bae28,'OrderBy':_0x4e74c2},{'where':{'CmContactId':_0x439689,'item':_0x1fcd0a}})[_0xfdd1('0x1a')](function(_0x2bb17e){_0x4f8e3e({'res':_0xfdd1('0x23')});});}else{return db['CmContactHasItem'][_0xfdd1('0x24')]({'CmContactId':_0x439689,'item':_0x1fcd0a,'description':_0x7bae28,'ItemTypeId':_0x3178ba,'OrderBy':_0x4e74c2,'ItemClass':_0xfdd1('0x25')})[_0xfdd1('0x1a')](function(_0xd72082){_0x4f8e3e({'res':'inserted'});});}});});}function insertCmHopper(_0x48a79d,_0x23070,_0xb88e5b,_0x175cab,_0x9ea321){var _0x3e4081=['cm_contacts.phone',_0xfdd1('0x26'),'cm_contacts.id',_0xfdd1('0x27'),_0x23070+'.'+_0x175cab,_0xfdd1('0x28'),_0xfdd1('0x29'),_0xfdd1('0x2a'),_0xfdd1('0x2b'),'\x22'+_0x9ea321+'\x22'];return squel[_0xfdd1('0x2c')]()[_0xfdd1('0x2d')](_0xfdd1('0x2e'))[_0xfdd1('0x2f')](['phone','scheduledat',_0xfdd1('0x30'),_0xfdd1('0x31'),_0x175cab,_0xfdd1('0x32'),_0xfdd1('0x33'),_0xfdd1('0x34'),_0xfdd1('0x35'),'recallme'],squel['select']()[_0xfdd1('0x36')](_0x3e4081)[_0xfdd1('0x13')](_0x23070)['join']('cm_contacts',null,_0xfdd1('0x37')+_0x23070+'.CmListId')[_0xfdd1('0x38')](_0xb88e5b,null,_0xb88e5b+_0xfdd1('0x14')+_0x23070+'.'+_0x175cab)[_0xfdd1('0x15')](_0x23070+_0xfdd1('0x39'),_0x48a79d)['where'](_0xfdd1('0x3a'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x23070,_0xb88e5b,_0x175cab,_0xfdd1('0x2e'),[_0xfdd1('0x3b'),'\x22onlyIfOpen\x22']))[_0xfdd1('0x15')](_0xfdd1('0x3c'),selectNotIn(_0x23070,_0xb88e5b,_0x175cab,_0xfdd1('0x2e'),['\x22always\x22'])))[_0xfdd1('0x3d')]();}function insertCmHopperBlack(_0x51ee7b,_0x2500ec,_0x5e600b,_0x563675){var _0x1a061d=[_0xfdd1('0x3e'),_0xfdd1('0x3f'),_0xfdd1('0x27'),_0x2500ec+'.'+_0x563675,_0xfdd1('0x28'),_0xfdd1('0x29')];return squel[_0xfdd1('0x2c')]()[_0xfdd1('0x2d')](_0xfdd1('0x40'))[_0xfdd1('0x2f')]([_0xfdd1('0x12'),_0xfdd1('0x30'),_0xfdd1('0x31'),_0x563675,_0xfdd1('0x32'),'updatedAt'],squel[_0xfdd1('0x10')]()[_0xfdd1('0x36')](_0x1a061d)[_0xfdd1('0x13')](_0x2500ec)['join'](_0xfdd1('0x41'),null,'cm_contacts.ListId\x20=\x20'+_0x2500ec+_0xfdd1('0x42'))['join'](_0x5e600b,null,_0x5e600b+_0xfdd1('0x14')+_0x2500ec+'.'+_0x563675)[_0xfdd1('0x15')](_0x2500ec+_0xfdd1('0x39'),_0x51ee7b)[_0xfdd1('0x15')](_0xfdd1('0x3a'),NOW)[_0xfdd1('0x15')](_0xfdd1('0x3c'),squel['select']()[_0xfdd1('0x11')](_0xfdd1('0x12'))[_0xfdd1('0x13')]('cm_hopper_black')[_0xfdd1('0x15')](_0xfdd1('0x43'),_0x51ee7b)['where'](_0x563675+_0xfdd1('0x16')+_0x2500ec+'.'+_0x563675)))[_0xfdd1('0x3d')]();}function insertTzCmHopper(_0x145bda,_0x548abb,_0x550c5d,_0x5479c5,_0x37b695,_0x2208c7){var _0x3c781a=['cm_contacts.phone',_0xfdd1('0x44')+_0x2208c7+'.offset-cm_contacts.utcOffset\x20minute)',_0xfdd1('0x3f'),_0xfdd1('0x27'),_0x548abb+'.'+_0x5479c5,_0xfdd1('0x28'),_0xfdd1('0x29'),_0xfdd1('0x2a'),_0xfdd1('0x2b'),'\x22'+_0x37b695+'\x22'];var _0x2df17d=squel[_0xfdd1('0x2c')]()[_0xfdd1('0x2d')](_0xfdd1('0x2e'))[_0xfdd1('0x2f')]([_0xfdd1('0x12'),_0xfdd1('0x45'),_0xfdd1('0x30'),'ListId',_0x5479c5,_0xfdd1('0x32'),_0xfdd1('0x33'),_0xfdd1('0x34'),_0xfdd1('0x35'),_0xfdd1('0x46')],squel[_0xfdd1('0x10')]()[_0xfdd1('0x36')](_0x3c781a)[_0xfdd1('0x13')](_0x548abb)['join'](_0xfdd1('0x41'),null,_0xfdd1('0x37')+_0x548abb+_0xfdd1('0x42'))[_0xfdd1('0x38')](_0x550c5d,null,_0x550c5d+_0xfdd1('0x14')+_0x548abb+'.'+_0x5479c5)['join'](_0x2208c7,null,_0x2208c7+_0xfdd1('0x14')+_0x548abb+'.'+_0x5479c5)[_0xfdd1('0x15')](_0x548abb+_0xfdd1('0x39'),_0x145bda)[_0xfdd1('0x15')](_0xfdd1('0x3a'),NOW)['where'](_0xfdd1('0x3c'),selectNotIn(_0x548abb,_0x550c5d,_0x5479c5,_0xfdd1('0x2e'),[_0xfdd1('0x3b'),_0xfdd1('0x47')]))[_0xfdd1('0x15')](_0xfdd1('0x3c'),selectNotIn(_0x548abb,_0x550c5d,_0x5479c5,'cm_hopper',['\x22always\x22'])))['toString']();return _0x2df17d;}function insertTzCmHopperBlack(_0x5ec0fb,_0x49c60d,_0x3ba77c,_0x43e8e1){var _0x4b237c=[_0xfdd1('0x3e'),_0xfdd1('0x3f'),_0xfdd1('0x27'),_0x49c60d+'.'+_0x43e8e1,_0xfdd1('0x28'),_0xfdd1('0x29')];return squel[_0xfdd1('0x2c')]()[_0xfdd1('0x2d')](_0xfdd1('0x40'))[_0xfdd1('0x2f')]([_0xfdd1('0x12'),_0xfdd1('0x30'),_0xfdd1('0x31'),_0x43e8e1,_0xfdd1('0x32'),_0xfdd1('0x33')],squel['select']()[_0xfdd1('0x36')](_0x4b237c)['from'](_0x49c60d)[_0xfdd1('0x38')](_0xfdd1('0x41'),null,_0xfdd1('0x37')+_0x49c60d+'.CmListId')['join'](_0x3ba77c,null,_0x3ba77c+'.id\x20=\x20'+_0x49c60d+'.'+_0x43e8e1)[_0xfdd1('0x15')](_0x49c60d+_0xfdd1('0x39'),_0x5ec0fb)[_0xfdd1('0x15')](_0xfdd1('0x3a'),NOW)[_0xfdd1('0x15')](_0xfdd1('0x3c'),squel[_0xfdd1('0x10')]()[_0xfdd1('0x11')]('phone')[_0xfdd1('0x13')]('cm_hopper_black')[_0xfdd1('0x15')](_0xfdd1('0x43'),_0x5ec0fb)[_0xfdd1('0x15')](_0x43e8e1+_0xfdd1('0x16')+_0x49c60d+'.'+_0x43e8e1)))['toString']();}function insertCmHopperAdditionalPhones(_0x162d94){var _0x54e1dc=[_0xfdd1('0x48'),'cm_contact_has_items.item',_0xfdd1('0x49'),'cm_contact_has_items.createdAt',_0xfdd1('0x4a')];return squel['insert']()[_0xfdd1('0x2d')]('cm_hopper_additional_phones')['fromQuery']([_0xfdd1('0x4b'),_0xfdd1('0x12'),_0xfdd1('0x4c'),_0xfdd1('0x32'),_0xfdd1('0x33')],squel[_0xfdd1('0x10')]()['fields'](_0x54e1dc)['from'](_0xfdd1('0x2e'))[_0xfdd1('0x38')](_0xfdd1('0x41'),null,_0xfdd1('0x4d'))[_0xfdd1('0x38')]('cm_contact_has_items',null,_0xfdd1('0x4e'))[_0xfdd1('0x15')](_0xfdd1('0x4f'),_0x162d94)[_0xfdd1('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xfdd1('0x3d')]();}function insertCmContact(_0x31ba11,_0x5ef34a,_0xd4df74,_0x265493){var _0x327e85=_['concat'](_[_0xfdd1('0x50')](_0x265493),['ListId',_0xfdd1('0x51'),_0xfdd1('0x32'),_0xfdd1('0x33'),_0xfdd1('0x52')]);return squel[_0xfdd1('0x2c')]()['into'](_0xfdd1('0x41'))[_0xfdd1('0x2f')](_0x327e85,squel[_0xfdd1('0x10')]()[_0xfdd1('0x36')](_0x327e85)[_0xfdd1('0x13')](_0x5ef34a)[_0xfdd1('0x15')]('('+_0xd4df74['join'](',')+_0xfdd1('0x53'),squel[_0xfdd1('0x10')]()[_0xfdd1('0x36')](_0xd4df74)[_0xfdd1('0x13')](_0xfdd1('0x41'))[_0xfdd1('0x15')](_0xfdd1('0x43'),_0x31ba11)[_0xfdd1('0x15')]('deletedAt\x20IS\x20NULL'))[_0xfdd1('0x15')]('id\x20IN\x20?',squel[_0xfdd1('0x10')]()[_0xfdd1('0x11')]('MIN(id)','min_id')['from'](_0x5ef34a)[_0xfdd1('0x54')](_0xd4df74[_0xfdd1('0x38')](','))))['toString']();}function handleStop(){logger[_0xfdd1('0x55')](_0xfdd1('0x56'));stopped=!![];}function handleUncaughtException(_0x202f89){logger['error'](_0x202f89[_0xfdd1('0x57')]);process['exit'](0x1);}function handleError(_0x45ab81,_0x27330e){stats[_0xfdd1('0x58')][_0xfdd1('0x1b')]({'name':_0x27330e[_0xfdd1('0x59')],'message':_0x27330e[_0xfdd1('0x57')],'row':_0x45ab81});}function handleQuery(_0x2ae5de){logger[_0xfdd1('0x55')](_0x2ae5de);return db[_0xfdd1('0x5a')][_0xfdd1('0x5b')](_0x2ae5de)[_0xfdd1('0x5c')](function(_0x49349f){results['push'](_0x49349f);})[_0xfdd1('0x5d')](function(_0x5df70f){logger[_0xfdd1('0x5e')](_0x5df70f[_0xfdd1('0x57')]);});}function updateTzCampaigns(_0x54805e){return new Promise(function(_0x164ec9,_0x9f6bb6){var _0x49dba6=squel[_0xfdd1('0x10')]()[_0xfdd1('0x36')](['campaigns.id','campaigns.dialTimezone'])[_0xfdd1('0x13')](_0xfdd1('0x5f'))[_0xfdd1('0x38')](_0xfdd1('0x60'),null,_0xfdd1('0x61'))[_0xfdd1('0x15')](_0xfdd1('0x62')+_0x54805e);db[_0xfdd1('0x5a')]['query'](_0x49dba6[_0xfdd1('0x3d')]())['spread'](function(_0x504784){var _0x4d44ae=[];for(var _0x315a01=0x0;_0x315a01<_0x504784['length'];_0x315a01++){_0x4d44ae[_0xfdd1('0x1b')](getTimezoneData(_0x504784[_0x315a01],tmp_campaigns));}BPromise[_0xfdd1('0x1c')](_0x4d44ae)[_0xfdd1('0x1a')](function(){_0x164ec9({'val':0x1});});})['catch'](function(_0x56516a){logger[_0xfdd1('0x5e')](_0x56516a[_0xfdd1('0x57')]);_0x164ec9({'val':0x0});});});}function updateTzVoiceQueues(_0x5310bd){return new Promise(function(_0x142b59,_0x589381){var _0xe6b901=squel[_0xfdd1('0x10')]()[_0xfdd1('0x36')](['voice_queues.id','voice_queues.dialTimezone'])['from'](_0xfdd1('0x63'))['join'](_0xfdd1('0x64'),null,_0xfdd1('0x65'))[_0xfdd1('0x15')](_0xfdd1('0x66')+_0x5310bd);db['sequelize'][_0xfdd1('0x5b')](_0xe6b901['toString']())[_0xfdd1('0x5c')](function(_0x1f220e){var _0x2a18f5=[];for(var _0x1eee92=0x0;_0x1eee92<_0x1f220e[_0xfdd1('0x1f')];_0x1eee92++){_0x2a18f5['push'](getTimezoneData(_0x1f220e[_0x1eee92],tmp_voice_queues));}BPromise[_0xfdd1('0x1c')](_0x2a18f5)['then'](function(){_0x142b59({'val':0x1});});})[_0xfdd1('0x5d')](function(_0x364608){logger[_0xfdd1('0x5e')](_0x364608[_0xfdd1('0x57')]);_0x142b59({'val':0x0});});});}function getTimezoneData(_0x527844,_0x31a281){return new Promise(function(_0x54c448,_0x41e8f2){var _0x2a71a4=shared[_0xfdd1('0x67')];var _0x582836=_0x2a71a4[_0x527844[_0xfdd1('0x68')]];if(_[_0xfdd1('0x69')](_0x582836)){_0x54c448({'ret':0x1});}else{var _0x3dfd42=_0x582836[_0xfdd1('0x6a')];var _0x3339b4=squel[_0xfdd1('0x2c')]()[_0xfdd1('0x2d')](_0x31a281)[_0xfdd1('0x6b')]('id',_0x527844['id'])['set'](_0xfdd1('0x6c'),_0x3dfd42)['set']('dialTimezone',_0x527844['dialTimezone'])['toString']();return db[_0xfdd1('0x5a')]['query'](_0x3339b4)[_0xfdd1('0x5c')](function(_0x25769e){_0x54c448({'ret':0x1});})['catch'](function(_0x5bb6ab){logger[_0xfdd1('0x5e')](_0x5bb6ab[_0xfdd1('0x57')]);_0x41e8f2({'ret':0x1});});}});}function handleTZQuery(_0x5f2f14){logger[_0xfdd1('0x55')](_0x5f2f14);return db[_0xfdd1('0x5a')][_0xfdd1('0x5b')](_0x5f2f14)[_0xfdd1('0x5c')](function(_0x525f38){})[_0xfdd1('0x5d')](function(_0x5d76d7){logger[_0xfdd1('0x5e')](_0x5d76d7[_0xfdd1('0x57')]);});}function main(_0x5ace4f,_0x3bcfb0,_0x21bc81,_0x463495){logger[_0xfdd1('0x55')]('main',_0x5ace4f,JSON[_0xfdd1('0x6d')](_0x3bcfb0));process[_0xfdd1('0x6e')](_0xfdd1('0x6f'));var _0x7c2d3c=_0x3bcfb0[_0xfdd1('0x70')];var _0x3babe7=_[_0xfdd1('0x71')](_0x7c2d3c);var _0x2ffe13=_0x3bcfb0[_0xfdd1('0x72')];var _0x4a5d97=path[_0xfdd1('0x38')](config[_0xfdd1('0x73')],_0xfdd1('0x74'),_0x2ffe13+_0xfdd1('0x75'));hasTZ=_[_0xfdd1('0x50')](_0x7c2d3c)['includes'](_0xfdd1('0x68'));var _0x5d3c24=_['keys'](_0x7c2d3c)['join']();logger[_0xfdd1('0x55')](_0xfdd1('0x76'),_0x5d3c24);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0xfdd1('0x77')]})[_0xfdd1('0x1a')](function(_0x472c66){for(var _0x421961=0x0;_0x421961<_0x472c66[_0xfdd1('0x1f')];_0x421961++){if(_0x472c66[_0x421961][_0xfdd1('0x77')]in _0x7c2d3c){contactItemTypes[_0xfdd1('0x1b')](_0x472c66[_0x421961]);delete _0x3babe7[_0x472c66[_0x421961][_0xfdd1('0x77')]];hasAdditionalPhones=!![];}for(var _0x963a63 in _0x7c2d3c){if(_0x472c66[_0x421961]['name']+_0xfdd1('0x78')===_0x963a63){phoneDescriptions[_0xfdd1('0x1b')]({'itemTypeId':_0x472c66[_0x421961]['id'],'description':_0x963a63});delete _0x3babe7[_0x963a63];}}}if(hasAdditionalPhones)_0x3babe7['AdditionalPhones']='';var _0x7eb5d0=_['keys'](_0x3babe7)[_0xfdd1('0x38')]();logger[_0xfdd1('0x55')](_0xfdd1('0x76'),_0x7eb5d0);fs[_0xfdd1('0x79')](_0x4a5d97,_0x7eb5d0+'\x0a');Papa[_0xfdd1('0x7a')](fs['createReadStream'](_0x5ace4f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5877a7,_0x3a4f27){try{for(var _0x546ba0=0x0,_0x1a4b2d=[];_0x546ba0<_0x5877a7[_0xfdd1('0x7b')][_0xfdd1('0x1f')];_0x546ba0++){stats[_0xfdd1('0x7c')]+=0x1;if(_0x5877a7[_0xfdd1('0x58')][_0x546ba0]){handleError(_0x5877a7['data'][_0x546ba0],_0x5877a7[_0xfdd1('0x58')][_0x546ba0]);}else{var _0x7a5dac=[];var _0x308294=[];var _0x41203c={};for(var _0x4f1159 in _0x7c2d3c){let _0x4641d7=contactItemTypes[_0xfdd1('0x7d')](_0x4622d8=>_0x4622d8[_0xfdd1('0x77')]===_0x4f1159);let _0x4d3e7f=contactItemTypes[_0xfdd1('0x7d')](_0xc91125=>_0xc91125[_0xfdd1('0x77')]+'_description'===_0x4f1159);if(_[_0xfdd1('0x69')](_0x4641d7)&&_[_0xfdd1('0x69')](_0x4d3e7f)){if(_0x7c2d3c[_0xfdd1('0x7e')](_0x4f1159)){if(_0x5877a7[_0xfdd1('0x7b')][_0x546ba0][_0x7c2d3c[_0x4f1159]]){var _0x139e15=_['trim'](_0x5877a7[_0xfdd1('0x7b')][_0x546ba0][_0x7c2d3c[_0x4f1159]][_0xfdd1('0x7f')](/"/g,'\x27'));switch(_0x4f1159){case'scheduledat':var _0x20e2ab=moment(_0x139e15,_0xfdd1('0xe'),!![]);if(_0x20e2ab[_0xfdd1('0x80')]()){_0x1a4b2d[_0xfdd1('0x1b')]('\x22'+_0x139e15+'\x22');}else{_0x7a5dac[_0xfdd1('0x1b')](_0xfdd1('0x81'));}break;case _0xfdd1('0x34'):var _0x4c0bcb=parseInt(_0x139e15);_0x139e15=_[_0xfdd1('0x82')](_0x4c0bcb)||_0x4c0bcb<0x0||_0x4c0bcb>0x4?_0x463495?0x3:0x2:_0x4c0bcb;_0x1a4b2d['push']('\x22'+_0x139e15+'\x22');break;case'UserId':var _0x5c2f56=parseInt(_0x139e15);if(_[_0xfdd1('0x83')](_0x5c2f56)&&_[_0xfdd1('0x84')](_0x21bc81,_0x5c2f56)){_0x1a4b2d['push']('\x22'+_0x5c2f56+'\x22');}else{_0x7a5dac[_0xfdd1('0x1b')](_0xfdd1('0x85'));}break;case _0xfdd1('0x86'):if(isEmail(_0x139e15)){_0x1a4b2d[_0xfdd1('0x1b')]('\x22'+_0x139e15+'\x22');}else{_0x7a5dac[_0xfdd1('0x1b')](_0xfdd1('0x87'));}break;case _0xfdd1('0x88'):var _0x5eacb0=moment(_0x139e15,_0xfdd1('0x89'),!![]);if(_0x5eacb0['isValid']()){_0x1a4b2d[_0xfdd1('0x1b')]('\x22'+_0x139e15+'\x22');}else{_0x7a5dac[_0xfdd1('0x1b')](_0xfdd1('0x8a'));}break;case _0xfdd1('0x68'):var _0x417d90=shared['timezones'];var _0x5abbd5=_0x417d90[_0x139e15];if(!_[_0xfdd1('0x69')](_0x5abbd5)){var _0x508464=_0x5abbd5['utcOffset'];_0x1a4b2d[_0xfdd1('0x1b')]('\x22'+_0x139e15+'\x22');_0x1a4b2d[_0xfdd1('0x1b')]('\x22'+_0x508464+'\x22');}break;default:_0x1a4b2d[_0xfdd1('0x1b')]('\x22'+_0x139e15+'\x22');}}else{switch(_0x4f1159){case _0xfdd1('0x8b'):case _0xfdd1('0x12'):_0x7a5dac[_0xfdd1('0x1b')](_0x4f1159+_0xfdd1('0x8c'));break;default:_0x1a4b2d[_0xfdd1('0x1b')]('\x22\x22');}}}}else{var _0xea51b4='';if(!_['isNil'](_0x4641d7)){if(!_0x41203c[_0xfdd1('0x7e')](_0x4641d7['id'])){if(!_[_0xfdd1('0x69')](_0x5877a7[_0xfdd1('0x7b')][_0x546ba0][_0x7c2d3c[_0x4f1159]])){var _0x139e15=_[_0xfdd1('0x8d')](_0x5877a7[_0xfdd1('0x7b')][_0x546ba0][_0x7c2d3c[_0x4f1159]]['replace'](/"/g,'\x27'));var _0x33c2a7=phoneDescriptions[_0xfdd1('0x7d')](_0xcd7d2c=>_0xcd7d2c[_0xfdd1('0x8e')]===_0x4641d7['id']);if(!_[_0xfdd1('0x69')](_0x33c2a7)){var _0x432170=_[_0xfdd1('0x8d')](_0x5877a7[_0xfdd1('0x7b')][_0x546ba0][_0x7c2d3c[_0x33c2a7['description']]][_0xfdd1('0x7f')](/"/g,'\x27'));if(!_['isNil'](_0x432170))_0x139e15=_0x139e15+'§'+_0x432170;}if(_0xea51b4=='')_0xea51b4=_0x139e15;else _0xea51b4+='|'+_0x139e15;}_0x308294['push'](_0x4641d7['id']+':'+_0xea51b4);_0x41203c[_0x4641d7['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1a4b2d[_0xfdd1('0x1b')]('\x22'+_0x308294[_0xfdd1('0x38')](';')+'\x22');}if(_0x7a5dac[_0xfdd1('0x1f')]){handleError(_0x5877a7[_0xfdd1('0x7b')][_0x546ba0],{'code':'SystemRow','message':_0x7a5dac['join']()});}else{fs[_0xfdd1('0x8f')](_0x4a5d97,_0x1a4b2d[_0xfdd1('0x38')]()+'\x0a');}_0x1a4b2d=[];}if(!(stats[_0xfdd1('0x7c')]%0xc8)){socket[_0xfdd1('0x90')]('contact:import:'+_0x2ffe13,stats);stats[_0xfdd1('0x58')]=[];}}if(stopped){logger[_0xfdd1('0x55')]('Abort\x20parser');_0x3a4f27[_0xfdd1('0x91')]();}}catch(_0x2cee2d){handleError(_0x5877a7[_0xfdd1('0x7b')][_0x546ba0],{'code':'SystemError','message':_0x2cee2d[_0xfdd1('0x57')]});logger[_0xfdd1('0x5e')]('step',_0x2cee2d[_0xfdd1('0x57')]);}},'complete':function(){try{var _0x279a3f=[];var _0x58c7dd=[];var _0x1bd670=_0xfdd1('0x41');if(_0x3bcfb0[_0xfdd1('0x92')]&&_0x3bcfb0[_0xfdd1('0x92')]['length']){_0x1bd670='cm_contacts_'+_0x2ffe13;_0x279a3f[_0xfdd1('0x1b')](_0xfdd1('0x93')+_0x1bd670+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0xfdd1('0x94')+_0x2ffe13;tmp_voice_queues=_0xfdd1('0x95')+_0x2ffe13;_0x58c7dd['push'](_0xfdd1('0x93')+tmp_campaigns+_0xfdd1('0x96'));_0x58c7dd[_0xfdd1('0x1b')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0xfdd1('0x96'));BPromise[_0xfdd1('0x97')](_0x58c7dd,handleTZQuery)[_0xfdd1('0x1a')](function(_0x1292f8){updateTzCampaigns(_0x3bcfb0[_0xfdd1('0x31')])[_0xfdd1('0x1a')](function(_0x1e247d){updateTzVoiceQueues(_0x3bcfb0[_0xfdd1('0x31')])[_0xfdd1('0x1a')](function(_0x50df15){if(hasTZ)_0x7eb5d0=_0x7eb5d0[_0xfdd1('0x7f')](_0xfdd1('0x68'),_0xfdd1('0x98'));var _0x944379=util[_0xfdd1('0xd')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x4a5d97,_0x1bd670,_0x7eb5d0,_0x3bcfb0[_0xfdd1('0x31')],_0x3bcfb0[_0xfdd1('0x51')]||null,NOW,NOW);if(_[_0xfdd1('0x69')](_0x7c2d3c['scheduledat'])){_0x944379+=_0xfdd1('0x99');}_0x279a3f[_0xfdd1('0x1b')](_0x944379);if(_0x3bcfb0[_0xfdd1('0x92')]&&_0x3bcfb0['duplicates']['length']){_0x279a3f['push'](insertCmContact(_0x3bcfb0[_0xfdd1('0x31')],_0x1bd670,_0x3bcfb0[_0xfdd1('0x92')],_0x7c2d3c));_0x279a3f[_0xfdd1('0x1b')](_0xfdd1('0x9a')+_0x1bd670+';');}BPromise[_0xfdd1('0x97')](_0x279a3f,handleQuery)['then'](function(_0x58cdae){BPromise[_0xfdd1('0x1c')]([handleAdditionalPhones()])[_0xfdd1('0x1a')](function(){_0x279a3f=[];for(var _0x19658c=0x0;_0x19658c\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','binding','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','YYYYMMDDHHmmss','select','field','from','join','.id\x20=\x20','where','sequelize','select\x20*\x20from\x20','length','isNil','phone','AdditionalPhones','push','all','then','catch','error','message','split','CmContactHasItem','findOne','update','create','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','scheduledat','ListId','createdAt','priority','UserId','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.ListId','cm_contacts.createdAt','cm_hopper_black','fromQuery','updatedAt','fields','cm_contacts','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','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_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','toString','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','errors','code','query','spread','main','send','start','socket_timestamp','root','server/files/tmp','body','ContactItemType','findAll','name','_description','header','writeFileSync','parse','createReadStream','data','rows','find','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified'];(function(_0x3cfe47,_0xedb0b8){var _0x5203f9=function(_0x3b61d6){while(--_0x3b61d6){_0x3cfe47['push'](_0x3cfe47['shift']());}};_0x5203f9(++_0xedb0b8);}(_0xa7db,0xbf));var _0xba7d=function(_0x4fe1d2,_0x41ac9c){_0x4fe1d2=_0x4fe1d2-0x0;var _0x48c808=_0xa7db[_0x4fe1d2];return _0x48c808;};'use strict';var fs=require('fs');var path=require(_0xba7d('0x0'));var _=require(_0xba7d('0x1'));var Papa=require(_0xba7d('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0xba7d('0x3'));var Redis=require(_0xba7d('0x4'));var db=require(_0xba7d('0x5'))['db'];var config=require(_0xba7d('0x6'));var logger=require(_0xba7d('0x7'))('import');config[_0xba7d('0x8')]=_[_0xba7d('0x9')](config[_0xba7d('0x8')],{'host':_0xba7d('0xa'),'port':0x18eb});var socket=require(_0xba7d('0xb'))(new Redis(config[_0xba7d('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0xba7d('0xc'));var tempTableName=_0xba7d('0xd')+moment()[_0xba7d('0xe')](_0xba7d('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x7c24b5){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'](_0x7c24b5);}function selectNotIn(_0x142700,_0x3dcea9,_0x5ebe13,_0x692935,_0x39c6e0){return squel[_0xba7d('0x10')]()[_0xba7d('0x11')]('phone')[_0xba7d('0x12')](_0x692935)[_0xba7d('0x13')](_0x3dcea9,null,_0x3dcea9+_0xba7d('0x14')+_0x692935+'.'+_0x5ebe13)[_0xba7d('0x15')](_0x692935+'.'+_0x5ebe13+'\x20=\x20'+_0x142700+'.'+_0x5ebe13)[_0xba7d('0x15')](_0x3dcea9+'.dialCheckDuplicateType\x20IN\x20('+_0x39c6e0[_0xba7d('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x344028,_0x440bc2){promisesAdditionalPhones=[];promisesContact=[];return db[_0xba7d('0x16')]['query'](_0xba7d('0x17')+tempTableName)['spread'](function(_0x4a9a41){if(_0x4a9a41!==null){var _0x92babd=[];for(var _0x56b2e3=0x0;_0x56b2e3<_0x4a9a41[_0xba7d('0x18')];_0x56b2e3++){var _0x21c17f=_0x4a9a41[_0x56b2e3];if(!_[_0xba7d('0x19')](_0x21c17f[_0xba7d('0x1a')])){if(!_[_0xba7d('0x19')](_0x21c17f[_0xba7d('0x1b')]))_0x92babd[_0xba7d('0x1c')](insertAdditionalPhones(_0x21c17f));promisesContact[_0xba7d('0x1c')]({'contact':_0x21c17f});}}}Promise[_0xba7d('0x1d')](_0x92babd)[_0xba7d('0x1e')](function(){_0x344028({'val':0x1});});})[_0xba7d('0x1f')](function(_0x373e9d){logger[_0xba7d('0x20')](_0x373e9d[_0xba7d('0x21')]);});});}function insertAdditionalPhones(_0x738441){return new Promise(function(_0x3c7240,_0x5e003b){var _0x43935f=_0x738441[_0xba7d('0x1b')];if(_[_0xba7d('0x19')](_0x43935f))_0x5e003b({'val':0x0});else{var _0xd63646=_0x43935f[_0xba7d('0x22')](';');var _0x103f35=[];orderBy=0x0;for(var _0x4b36af=0x0;_0x4b36af<_0xd63646[_0xba7d('0x18')];_0x4b36af++){_0x103f35[_0xba7d('0x1c')](splitAdditionalPhone(_0x738441['id'],_0xd63646[_0x4b36af]));}Promise[_0xba7d('0x1d')](_0x103f35)[_0xba7d('0x1e')](function(){_0x3c7240({'val':_0xd63646[_0xba7d('0x18')]});});}});}function splitAdditionalPhone(_0x3e2be4,_0x37b411){return new Promise(function(_0x4faa59,_0x20cee4){var _0x54e7ff=_0x37b411[_0xba7d('0x22')](':');var _0x3a0724=_0x54e7ff[0x0];var _0x36cbd5=_0x54e7ff[0x1];if(_0x36cbd5!==''){var _0x9bdbef=_0x36cbd5[_0xba7d('0x22')]('|');var _0x359ac2=[];for(var _0x136889=0x0;_0x136889<_0x9bdbef[_0xba7d('0x18')];_0x136889++){if(_0x9bdbef[_0x136889]!==''){var _0x24441c=_['filter'](promisesAdditionalPhones,{'contactId':_0x3e2be4,'phone':_0x9bdbef[_0x136889]});if(_0x24441c['length']==0x0){orderBy++;promisesAdditionalPhones[_0xba7d('0x1c')]({'contactId':_0x3e2be4,'contactTypeId':_0x3a0724,'phone':_0x9bdbef[_0x136889],'orderBy':orderBy});}}}_0x4faa59({'ok':0x1});}else _0x4faa59({'res':0x0});});}function createAdditionalPhone(_0x23c8fe,_0x1664a1,_0x3d3a3d,_0x322a52){var _0x4c39ed='';var _0x244233='';var _0x524fe8=_0x3d3a3d[_0xba7d('0x22')]('§');_0x4c39ed=_0x524fe8[0x0];if(_0x524fe8[_0xba7d('0x18')]==0x2)_0x244233=_0x524fe8[0x1];return new Promise(function(_0x31b841,_0x50e0aa){return db[_0xba7d('0x23')][_0xba7d('0x24')]({'where':{'CmContactId':_0x23c8fe,'item':_0x4c39ed}})[_0xba7d('0x1e')](function(_0x4958a9){if(_0x4958a9){return db[_0xba7d('0x23')][_0xba7d('0x25')]({'ItemTypeId':_0x1664a1,'description':_0x244233,'OrderBy':_0x322a52},{'where':{'CmContactId':_0x23c8fe,'item':_0x4c39ed}})[_0xba7d('0x1e')](function(_0x21f892){_0x31b841({'res':'updated'});});}else{return db['CmContactHasItem'][_0xba7d('0x26')]({'CmContactId':_0x23c8fe,'item':_0x4c39ed,'ItemTypeId':_0x1664a1,'description':_0x244233,'OrderBy':_0x322a52,'ItemClass':'PHONE'})['then'](function(_0x4339d9){_0x31b841({'res':_0xba7d('0x27')});});}});});}function updateContact(_0x2eae97){return new Promise(function(_0x3a3a5a,_0x401e2b){var _0x25a34e=_0x2eae97['id'];delete _0x2eae97['id'];return db[_0xba7d('0x28')][_0xba7d('0x25')](_0x2eae97,{'where':{'id':_0x25a34e}})[_0xba7d('0x1e')](function(_0x40f26a){updatedRows+=0x1;return db[_0xba7d('0x29')][_0xba7d('0x25')]({'phone':_0x2eae97[_0xba7d('0x1a')]},{'where':{'ContactId':_0x25a34e}})[_0xba7d('0x1e')](function(_0x26a22c){_0x3a3a5a({'ret':'OK'});});});});}function insertCmHopper(_0x22d462,_0x1ccbf6,_0x21fe30,_0x5bd7b4,_0x4140fa){var _0xa7f084=[_0xba7d('0x2a'),_0xba7d('0x2b'),_0xba7d('0x2c'),'cm_contacts.ListId',_0x1ccbf6+'.'+_0x5bd7b4,'cm_contacts.createdAt',_0xba7d('0x2d'),_0xba7d('0x2e'),_0xba7d('0x2f'),'\x22'+_0x4140fa+'\x22'];return squel[_0xba7d('0x30')]()[_0xba7d('0x31')]('cm_hopper')['fromQuery']([_0xba7d('0x1a'),_0xba7d('0x32'),'ContactId',_0xba7d('0x33'),_0x5bd7b4,_0xba7d('0x34'),'updatedAt',_0xba7d('0x35'),_0xba7d('0x36'),'recallme'],squel['select']()['fields'](_0xa7f084)['from'](_0x1ccbf6)[_0xba7d('0x13')]('cm_contacts',null,_0xba7d('0x37')+_0x1ccbf6+_0xba7d('0x38'))[_0xba7d('0x13')](_0x21fe30,null,_0x21fe30+'.id\x20=\x20'+_0x1ccbf6+'.'+_0x5bd7b4)[_0xba7d('0x15')](_0x1ccbf6+_0xba7d('0x39'),_0x22d462)[_0xba7d('0x15')](_0xba7d('0x3a'),NOW)[_0xba7d('0x15')](_0xba7d('0x3b'),selectNotIn(_0x1ccbf6,_0x21fe30,_0x5bd7b4,_0xba7d('0x3c'),[_0xba7d('0x3d'),_0xba7d('0x3e')]))[_0xba7d('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1ccbf6,_0x21fe30,_0x5bd7b4,_0xba7d('0x3c'),[_0xba7d('0x3d')])))['toString']();}function insertCmHopperBlack(_0x40bb12,_0x3e5353,_0xb311a5,_0x2e09f9){var _0x1625c1=['cm_contacts.phone','cm_contacts.id',_0xba7d('0x3f'),_0x3e5353+'.'+_0x2e09f9,_0xba7d('0x40'),_0xba7d('0x2d')];return squel[_0xba7d('0x30')]()['into'](_0xba7d('0x41'))[_0xba7d('0x42')]([_0xba7d('0x1a'),'ContactId',_0xba7d('0x33'),_0x2e09f9,'createdAt',_0xba7d('0x43')],squel[_0xba7d('0x10')]()[_0xba7d('0x44')](_0x1625c1)['from'](_0x3e5353)[_0xba7d('0x13')](_0xba7d('0x45'),null,'cm_contacts.ListId\x20=\x20'+_0x3e5353+'.CmListId')[_0xba7d('0x13')](_0xb311a5,null,_0xb311a5+'.id\x20=\x20'+_0x3e5353+'.'+_0x2e09f9)['where'](_0x3e5353+_0xba7d('0x39'),_0x40bb12)[_0xba7d('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xba7d('0x15')](_0xba7d('0x3b'),squel[_0xba7d('0x10')]()[_0xba7d('0x11')](_0xba7d('0x1a'))[_0xba7d('0x12')](_0xba7d('0x41'))[_0xba7d('0x15')](_0xba7d('0x46'),_0x40bb12)[_0xba7d('0x15')](_0x2e09f9+_0xba7d('0x47'),_0x3e5353+'.'+_0x2e09f9)))['toString']();}function insertCmHopperAdditionalPhones(_0x4f8bd4){var _0x58db2f=[_0xba7d('0x48'),_0xba7d('0x49'),'cm_contact_has_items.OrderBy',_0xba7d('0x4a'),_0xba7d('0x4b')];return squel['insert']()[_0xba7d('0x31')](_0xba7d('0x4c'))[_0xba7d('0x42')]([_0xba7d('0x4d'),_0xba7d('0x1a'),_0xba7d('0x4e'),_0xba7d('0x34'),'updatedAt'],squel[_0xba7d('0x10')]()[_0xba7d('0x44')](_0x58db2f)[_0xba7d('0x12')](_0xba7d('0x3c'))['join'](_0xba7d('0x45'),null,_0xba7d('0x4f'))[_0xba7d('0x13')](_0xba7d('0x50'),null,_0xba7d('0x51'))[_0xba7d('0x15')](_0xba7d('0x52'),_0x4f8bd4)[_0xba7d('0x15')](_0xba7d('0x3a'),NOW))[_0xba7d('0x53')]();}function insertCmContact(_0x358163,_0x8f0374,_0x1c08ba,_0x176e89){var _0x6210fb=_['concat'](_[_0xba7d('0x54')](_0x176e89),['ListId',_0xba7d('0x55'),_0xba7d('0x34'),_0xba7d('0x43')]);return squel[_0xba7d('0x30')]()[_0xba7d('0x31')](_0xba7d('0x45'))['fromQuery'](_0x6210fb,squel[_0xba7d('0x10')]()[_0xba7d('0x44')](_0x6210fb)[_0xba7d('0x12')](_0x8f0374)[_0xba7d('0x15')]('('+_0x1c08ba['join'](',')+_0xba7d('0x56'),squel[_0xba7d('0x10')]()[_0xba7d('0x44')](_0x1c08ba)['from'](_0xba7d('0x45'))['where'](_0xba7d('0x46'),_0x358163))[_0xba7d('0x15')](_0xba7d('0x57'),squel[_0xba7d('0x10')]()[_0xba7d('0x11')](_0xba7d('0x58'),'min_id')[_0xba7d('0x12')](_0x8f0374)[_0xba7d('0x59')](_0x1c08ba[_0xba7d('0x13')](','))))[_0xba7d('0x53')]();}function handleStop(){logger[_0xba7d('0x5a')](_0xba7d('0x5b'));stopped=!![];}function handleUncaughtException(_0x38495a){logger[_0xba7d('0x20')](_0x38495a[_0xba7d('0x21')]);process['exit'](0x1);}function handleError(_0x4f1e07,_0x1c24ce){stats[_0xba7d('0x5c')]['push']({'name':_0x1c24ce[_0xba7d('0x5d')],'message':_0x1c24ce['message'],'row':_0x4f1e07});}function handleQuery(_0x6df946){logger[_0xba7d('0x5a')](_0x6df946);return db[_0xba7d('0x16')][_0xba7d('0x5e')](_0x6df946)[_0xba7d('0x5f')](function(_0x1a11ca){results[_0xba7d('0x1c')](_0x1a11ca);})[_0xba7d('0x1f')](function(_0x47180e){logger[_0xba7d('0x20')](_0x47180e[_0xba7d('0x21')]);});}function main(_0x4f3a06,_0xa304b5,_0x5e0dd0,_0x568e06){logger[_0xba7d('0x5a')](_0xba7d('0x60'),_0x4f3a06,JSON['stringify'](_0xa304b5));process[_0xba7d('0x61')](_0xba7d('0x62'));var _0x51c9c4=_0xa304b5['binding'];var _0x2a9d1e=_['clone'](_0x51c9c4);var _0x5eeeb8=_0xa304b5[_0xba7d('0x63')];var _0x1fac87=path[_0xba7d('0x13')](config[_0xba7d('0x64')],_0xba7d('0x65'),_0x5eeeb8+'.csv');logger['info'](_0xba7d('0x66'),_0xa304b5);db[_0xba7d('0x67')][_0xba7d('0x68')]({'raw':!![],'attributes':['id',_0xba7d('0x69')]})[_0xba7d('0x1e')](function(_0x3e5d5d){for(var _0x193bcb=0x0;_0x193bcb<_0x3e5d5d[_0xba7d('0x18')];_0x193bcb++){if(_0x3e5d5d[_0x193bcb]['name']in _0x51c9c4){contactItemTypes['push'](_0x3e5d5d[_0x193bcb]);delete _0x2a9d1e[_0x3e5d5d[_0x193bcb][_0xba7d('0x69')]];hasAdditionalPhones=!![];}for(var _0x2a8a79 in _0x51c9c4){if(_0x3e5d5d[_0x193bcb]['name']+_0xba7d('0x6a')===_0x2a8a79){phoneDescriptions['push']({'itemTypeId':_0x3e5d5d[_0x193bcb]['id'],'description':_0x2a8a79});delete _0x2a9d1e[_0x2a8a79];}}}if(hasAdditionalPhones)_0x2a9d1e[_0xba7d('0x1b')]='';var _0x26948f=_[_0xba7d('0x54')](_0x2a9d1e)[_0xba7d('0x13')]();logger[_0xba7d('0x5a')](_0xba7d('0x6b'),_0x26948f);fs[_0xba7d('0x6c')](_0x1fac87,_0x26948f+'\x0a');Papa[_0xba7d('0x6d')](fs[_0xba7d('0x6e')](_0x4f3a06),{'header':!![],'skipEmptyLines':!![],'step':function(_0x378f8e,_0x533ab7){try{for(var _0x45a681=0x0,_0x9d9dee=[];_0x45a681<_0x378f8e[_0xba7d('0x6f')][_0xba7d('0x18')];_0x45a681++){stats[_0xba7d('0x70')]+=0x1;if(_0x378f8e[_0xba7d('0x5c')][_0x45a681]){handleError(_0x378f8e['data'][_0x45a681],_0x378f8e[_0xba7d('0x5c')][_0x45a681]);}else{var _0x57d399=[];var _0xb0b050=[];var _0x2d6db3={};for(var _0x13ee8d in _0x51c9c4){let _0x5b097f=contactItemTypes[_0xba7d('0x71')](_0x23fbff=>_0x23fbff[_0xba7d('0x69')]===_0x13ee8d);let _0x567c1f=contactItemTypes[_0xba7d('0x71')](_0x5df1bf=>_0x5df1bf['name']+_0xba7d('0x6a')===_0x13ee8d);if(_['isNil'](_0x5b097f)&&_[_0xba7d('0x19')](_0x567c1f)){if(_0x51c9c4['hasOwnProperty'](_0x13ee8d)){if(_0x378f8e[_0xba7d('0x6f')][_0x45a681][_0x51c9c4[_0x13ee8d]]){var _0x1b339c=_[_0xba7d('0x72')](_0x378f8e[_0xba7d('0x6f')][_0x45a681][_0x51c9c4[_0x13ee8d]][_0xba7d('0x73')](/"/g,'\x27'));switch(_0x13ee8d){case'scheduledat':var _0x2051cd=moment(_0x1b339c,_0xba7d('0xc'),!![]);if(_0x2051cd[_0xba7d('0x74')]()){_0x9d9dee[_0xba7d('0x1c')]('\x22'+_0x1b339c+'\x22');}else{_0x57d399[_0xba7d('0x1c')](_0xba7d('0x75'));}break;case'priority':var _0x10335e=parseInt(_0x1b339c);_0x1b339c=_['isNaN'](_0x10335e)||_0x10335e<0x0||_0x10335e>0x4?_0x568e06?0x3:0x2:_0x10335e;_0x9d9dee[_0xba7d('0x1c')]('\x22'+_0x1b339c+'\x22');break;case _0xba7d('0x36'):var _0x475917=parseInt(_0x1b339c);if(_[_0xba7d('0x76')](_0x475917)&&_['includes'](_0x5e0dd0,_0x475917)){_0x9d9dee[_0xba7d('0x1c')]('\x22'+_0x475917+'\x22');}else{_0x57d399[_0xba7d('0x1c')](_0xba7d('0x77'));}break;case _0xba7d('0x78'):if(isEmail(_0x1b339c)){_0x9d9dee[_0xba7d('0x1c')]('\x22'+_0x1b339c+'\x22');}else{_0x57d399[_0xba7d('0x1c')](_0xba7d('0x79'));}break;case _0xba7d('0x7a'):var _0x502156=moment(_0x1b339c,'YYYY-MM-DD',!![]);if(_0x502156[_0xba7d('0x74')]()){_0x9d9dee[_0xba7d('0x1c')]('\x22'+_0x1b339c+'\x22');}else{_0x57d399[_0xba7d('0x1c')](_0xba7d('0x7b'));}break;default:_0x9d9dee[_0xba7d('0x1c')]('\x22'+_0x1b339c+'\x22');}}else{switch(_0x13ee8d){case'firstName':case _0xba7d('0x1a'):_0x57d399[_0xba7d('0x1c')](_0x13ee8d+_0xba7d('0x7c'));break;default:_0x9d9dee[_0xba7d('0x1c')]('\x22\x22');}}}}else{var _0x31bdc7='';if(!_[_0xba7d('0x19')](_0x5b097f)){if(!_0x2d6db3['hasOwnProperty'](_0x5b097f['id'])){for(var _0x527aaa=0x0;_0x527aaa<_0x51c9c4[_0x13ee8d][_0xba7d('0x18')];_0x527aaa++){var _0x1b339c=_[_0xba7d('0x72')](_0x378f8e['data'][_0x45a681][_0x51c9c4[_0x13ee8d][_0x527aaa]][_0xba7d('0x73')](/"/g,'\x27'));var _0x2a591d=phoneDescriptions[_0xba7d('0x71')](_0x5a35c4=>_0x5a35c4[_0xba7d('0x7d')]===_0x5b097f['id']);if(!_[_0xba7d('0x19')](_0x2a591d)){var _0x53df4e=_[_0xba7d('0x72')](_0x378f8e[_0xba7d('0x6f')][_0x45a681][_0x51c9c4[_0x2a591d[_0xba7d('0x7e')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0xba7d('0x19')](_0x53df4e))_0x1b339c=_0x1b339c+'§'+_0x53df4e;}if(_0x31bdc7=='')_0x31bdc7=_0x1b339c;else _0x31bdc7+='|'+_0x1b339c;}_0xb0b050[_0xba7d('0x1c')](_0x5b097f['id']+':'+_0x31bdc7);_0x2d6db3[_0x5b097f['id']]=0x1;}}}}if(hasAdditionalPhones){_0x9d9dee[_0xba7d('0x1c')]('\x22'+_0xb0b050['join'](';')+'\x22');}if(_0x57d399[_0xba7d('0x18')]){handleError(_0x378f8e['data'][_0x45a681],{'code':_0xba7d('0x7f'),'message':_0x57d399[_0xba7d('0x13')]()});}else{fs[_0xba7d('0x80')](_0x1fac87,_0x9d9dee[_0xba7d('0x13')]()+'\x0a');}_0x9d9dee=[];}if(!(stats[_0xba7d('0x70')]%0xc8)){socket[_0xba7d('0x81')]('contact:import:'+_0x5eeeb8,stats);stats['errors']=[];}}if(stopped){logger[_0xba7d('0x5a')](_0xba7d('0x82'));_0x533ab7[_0xba7d('0x83')]();}}catch(_0x13ea9d){handleError(_0x378f8e['data'][_0x45a681],{'code':_0xba7d('0x84'),'message':_0x13ea9d[_0xba7d('0x21')]});logger[_0xba7d('0x20')](_0xba7d('0x85'),_0x13ea9d[_0xba7d('0x21')]);}},'complete':function(){try{var _0x370560=[];var _0x16ee09=tempTableName;_0x370560[_0xba7d('0x1c')]('CREATE\x20TABLE\x20'+_0x16ee09+'\x20LIKE\x20cm_contacts;');logger[_0xba7d('0x5a')]('CIS\x20len',contactItemTypes[_0xba7d('0x18')]);var _0x31b38f=util[_0xba7d('0xe')](_0xba7d('0x86'),_0x1fac87,_0x16ee09,_0x26948f,_0xa304b5[_0xba7d('0x33')],_0xa304b5['CompanyId']||null,NOW,NOW);if(_[_0xba7d('0x19')](_0x51c9c4[_0xba7d('0x32')])){_0x31b38f+=_0xba7d('0x87');}_0x370560[_0xba7d('0x1c')](_0x31b38f);BPromise[_0xba7d('0x88')](_0x370560,handleQuery)['then'](function(_0x3391db){BPromise[_0xba7d('0x1d')]([handleAdditionalPhones()])[_0xba7d('0x1e')](function(){_0x370560=[];for(var _0x8ca1e4=0x0;_0x8ca1e4\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','moment','squel','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','then','catch','error','message','split','filter','CmContactHasItem','findOne','updated','PHONE','inserted','CmContact'];(function(_0x378275,_0x19a8b0){var _0x41955e=function(_0xc6dba4){while(--_0xc6dba4){_0x378275['push'](_0x378275['shift']());}};_0x41955e(++_0x19a8b0);}(_0xa062,0x101));var _0x2a06=function(_0xae2add,_0x1c1106){_0xae2add=_0xae2add-0x0;var _0x1a512a=_0xa062[_0xae2add];return _0x1a512a;};'use strict';var fs=require('fs');var path=require(_0x2a06('0x0'));var _=require(_0x2a06('0x1'));var Papa=require(_0x2a06('0x2'));var util=require('util');var BPromise=require(_0x2a06('0x3'));var moment=require(_0x2a06('0x4'));var squel=require(_0x2a06('0x5'));var Redis=require(_0x2a06('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0x2a06('0x7'));var logger=require('../../../config/logger')('import');config[_0x2a06('0x8')]=_[_0x2a06('0x9')](config[_0x2a06('0x8')],{'host':_0x2a06('0xa'),'port':0x18eb});var socket=require(_0x2a06('0xb'))(new Redis(config[_0x2a06('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0x2a06('0xc'));var tempTableName=_0x2a06('0xd')+moment()['format'](_0x2a06('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0xd2a1a0){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))*$/[_0x2a06('0xf')](_0xd2a1a0);}function selectNotIn(_0x533012,_0x528c65,_0x4b0b28,_0x4d9237,_0x291dd4){return squel[_0x2a06('0x10')]()['field'](_0x2a06('0x11'))[_0x2a06('0x12')](_0x4d9237)[_0x2a06('0x13')](_0x528c65,null,_0x528c65+_0x2a06('0x14')+_0x4d9237+'.'+_0x4b0b28)[_0x2a06('0x15')](_0x4d9237+'.'+_0x4b0b28+_0x2a06('0x16')+_0x533012+'.'+_0x4b0b28)[_0x2a06('0x15')](_0x528c65+'.dialCheckDuplicateType\x20IN\x20('+_0x291dd4['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x43fa64,_0x3a7fcd){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x2a06('0x17')](_0x2a06('0x18')+tempTableName)[_0x2a06('0x19')](function(_0x1ba819){if(_0x1ba819!==null){var _0x65805f=[];for(var _0x3864aa=0x0;_0x3864aa<_0x1ba819[_0x2a06('0x1a')];_0x3864aa++){var _0xe429f2=_0x1ba819[_0x3864aa];if(!_[_0x2a06('0x1b')](_0xe429f2[_0x2a06('0x11')])){if(!_['isNil'](_0xe429f2[_0x2a06('0x1c')]))_0x65805f[_0x2a06('0x1d')](insertAdditionalPhones(_0xe429f2));promisesContact[_0x2a06('0x1d')]({'contact':_0xe429f2});}}}Promise[_0x2a06('0x1e')](_0x65805f)[_0x2a06('0x1f')](function(){_0x43fa64({'val':0x1});});})[_0x2a06('0x20')](function(_0x2b962a){logger[_0x2a06('0x21')](_0x2b962a[_0x2a06('0x22')]);});});}function insertAdditionalPhones(_0x248300){return new Promise(function(_0x249d42,_0x38c6fd){var _0x498415=_0x248300[_0x2a06('0x1c')];if(_[_0x2a06('0x1b')](_0x498415))_0x38c6fd({'val':0x0});else{var _0x24af58=_0x498415[_0x2a06('0x23')](';');var _0x1c7e4e=[];orderBy=0x0;for(var _0x382b4a=0x0;_0x382b4a<_0x24af58['length'];_0x382b4a++){_0x1c7e4e['push'](splitAdditionalPhone(_0x248300['id'],_0x24af58[_0x382b4a]));}Promise[_0x2a06('0x1e')](_0x1c7e4e)['then'](function(){_0x249d42({'val':_0x24af58['length']});});}});}function splitAdditionalPhone(_0x3eef6f,_0x3b97ee){return new Promise(function(_0x21e09c,_0x1d61dc){var _0x1b3673=_0x3b97ee[_0x2a06('0x23')](':');var _0x5c9f1d=_0x1b3673[0x0];var _0x58733f=_0x1b3673[0x1];if(_0x58733f!==''){var _0x371b56=_0x58733f[_0x2a06('0x23')]('|');var _0x2dc7e4=[];for(var _0x72f402=0x0;_0x72f402<_0x371b56[_0x2a06('0x1a')];_0x72f402++){if(_0x371b56[_0x72f402]!==''){var _0x5edc18=_[_0x2a06('0x24')](promisesAdditionalPhones,{'contactId':_0x3eef6f,'phone':_0x371b56[_0x72f402]});if(_0x5edc18[_0x2a06('0x1a')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x3eef6f,'contactTypeId':_0x5c9f1d,'phone':_0x371b56[_0x72f402],'orderBy':orderBy});}}}_0x21e09c({'ok':0x1});}else _0x21e09c({'res':0x0});});}function createAdditionalPhone(_0xfd1407,_0xc7b773,_0x404631,_0x45bafa){var _0x445be8='';var _0x49cf8d='';var _0xf6ae16=_0x404631['split']('§');_0x445be8=_0xf6ae16[0x0];if(_0xf6ae16[_0x2a06('0x1a')]==0x2)_0x49cf8d=_0xf6ae16[0x1];return new Promise(function(_0x2c3b01,_0x40dbc2){return db[_0x2a06('0x25')][_0x2a06('0x26')]({'where':{'CmContactId':_0xfd1407,'item':_0x445be8}})['then'](function(_0x214067){if(_0x214067){return db[_0x2a06('0x25')]['update']({'ItemTypeId':_0xc7b773,'description':_0x49cf8d,'OrderBy':_0x45bafa},{'where':{'CmContactId':_0xfd1407,'item':_0x445be8}})['then'](function(_0x5b48e7){_0x2c3b01({'res':_0x2a06('0x27')});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0xfd1407,'item':_0x445be8,'ItemTypeId':_0xc7b773,'description':_0x49cf8d,'OrderBy':_0x45bafa,'ItemClass':_0x2a06('0x28')})[_0x2a06('0x1f')](function(_0x17fede){_0x2c3b01({'res':_0x2a06('0x29')});});}});});}function updateContact(_0x35b66e){return new Promise(function(_0x45739b,_0x19bb03){var _0x371e25=_0x35b66e['id'];delete _0x35b66e['id'];return db[_0x2a06('0x2a')]['update'](_0x35b66e,{'where':{'id':_0x371e25}})[_0x2a06('0x1f')](function(_0x272c40){updatedRows+=0x1;return db[_0x2a06('0x2b')]['update']({'phone':_0x35b66e['phone']},{'where':{'ContactId':_0x371e25}})[_0x2a06('0x1f')](function(_0x1b0fe8){_0x45739b({'ret':'OK'});});});});}function insertCmHopper(_0x475c73,_0x516e2c,_0x5df66a,_0x386b42,_0x207d98){var _0x3bafb7=[_0x2a06('0x2c'),'cm_contacts.scheduledat',_0x2a06('0x2d'),'cm_contacts.ListId',_0x516e2c+'.'+_0x386b42,_0x2a06('0x2e'),_0x2a06('0x2f'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x207d98+'\x22'];return squel[_0x2a06('0x30')]()[_0x2a06('0x31')](_0x2a06('0x32'))[_0x2a06('0x33')](['phone','scheduledat','ContactId',_0x2a06('0x34'),_0x386b42,_0x2a06('0x35'),_0x2a06('0x36'),_0x2a06('0x37'),_0x2a06('0x38'),_0x2a06('0x39')],squel[_0x2a06('0x10')]()['fields'](_0x3bafb7)['from'](_0x516e2c)[_0x2a06('0x13')](_0x2a06('0x3a'),null,_0x2a06('0x3b')+_0x516e2c+_0x2a06('0x3c'))[_0x2a06('0x13')](_0x5df66a,null,_0x5df66a+_0x2a06('0x14')+_0x516e2c+'.'+_0x386b42)[_0x2a06('0x15')](_0x516e2c+_0x2a06('0x3d'),_0x475c73)[_0x2a06('0x15')](_0x2a06('0x3e'),NOW)[_0x2a06('0x15')](_0x2a06('0x3f'),selectNotIn(_0x516e2c,_0x5df66a,_0x386b42,_0x2a06('0x32'),[_0x2a06('0x40'),_0x2a06('0x41')]))[_0x2a06('0x15')](_0x2a06('0x3f'),selectNotIn(_0x516e2c,_0x5df66a,_0x386b42,_0x2a06('0x32'),['\x22always\x22'])))[_0x2a06('0x42')]();}function insertCmHopperBlack(_0x866956,_0x337742,_0x1e4f98,_0x1f5c2e){var _0x180d35=[_0x2a06('0x2c'),_0x2a06('0x2d'),_0x2a06('0x43'),_0x337742+'.'+_0x1f5c2e,_0x2a06('0x2e'),_0x2a06('0x2f')];return squel[_0x2a06('0x30')]()[_0x2a06('0x31')](_0x2a06('0x44'))[_0x2a06('0x33')]([_0x2a06('0x11'),_0x2a06('0x45'),_0x2a06('0x34'),_0x1f5c2e,_0x2a06('0x35'),_0x2a06('0x36')],squel[_0x2a06('0x10')]()['fields'](_0x180d35)[_0x2a06('0x12')](_0x337742)['join']('cm_contacts',null,_0x2a06('0x3b')+_0x337742+'.CmListId')[_0x2a06('0x13')](_0x1e4f98,null,_0x1e4f98+'.id\x20=\x20'+_0x337742+'.'+_0x1f5c2e)['where'](_0x337742+_0x2a06('0x3d'),_0x866956)[_0x2a06('0x15')](_0x2a06('0x3e'),NOW)[_0x2a06('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x2a06('0x10')]()[_0x2a06('0x46')](_0x2a06('0x11'))[_0x2a06('0x12')]('cm_hopper_black')[_0x2a06('0x15')](_0x2a06('0x47'),_0x866956)[_0x2a06('0x15')](_0x1f5c2e+_0x2a06('0x48'),_0x337742+'.'+_0x1f5c2e)))['toString']();}function insertCmHopperAdditionalPhones(_0x22dd68){var _0x2900e1=['cm_hopper.id',_0x2a06('0x49'),_0x2a06('0x4a'),'cm_contact_has_items.createdAt',_0x2a06('0x4b')];return squel[_0x2a06('0x30')]()[_0x2a06('0x31')](_0x2a06('0x4c'))[_0x2a06('0x33')](['CmHopperId','phone',_0x2a06('0x4d'),'createdAt',_0x2a06('0x36')],squel['select']()['fields'](_0x2900e1)[_0x2a06('0x12')]('cm_hopper')[_0x2a06('0x13')](_0x2a06('0x3a'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x2a06('0x13')](_0x2a06('0x4e'),null,_0x2a06('0x4f'))[_0x2a06('0x15')](_0x2a06('0x50'),_0x22dd68)[_0x2a06('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0x2a06('0x42')]();}function insertCmContact(_0x4e7e73,_0x1c654b,_0x115c83,_0x16be9f){var _0x2f821f=_[_0x2a06('0x51')](_[_0x2a06('0x52')](_0x16be9f),['ListId',_0x2a06('0x53'),_0x2a06('0x35'),_0x2a06('0x36')]);return squel[_0x2a06('0x30')]()[_0x2a06('0x31')](_0x2a06('0x3a'))[_0x2a06('0x33')](_0x2f821f,squel[_0x2a06('0x10')]()[_0x2a06('0x54')](_0x2f821f)['from'](_0x1c654b)['where']('('+_0x115c83['join'](',')+_0x2a06('0x55'),squel[_0x2a06('0x10')]()['fields'](_0x115c83)['from'](_0x2a06('0x3a'))[_0x2a06('0x15')]('ListId\x20=\x20?',_0x4e7e73))[_0x2a06('0x15')](_0x2a06('0x56'),squel[_0x2a06('0x10')]()[_0x2a06('0x46')](_0x2a06('0x57'),'min_id')['from'](_0x1c654b)['group'](_0x115c83[_0x2a06('0x13')](','))))[_0x2a06('0x42')]();}function handleStop(){logger[_0x2a06('0x58')](_0x2a06('0x59'));stopped=!![];}function handleUncaughtException(_0x23f15b){logger[_0x2a06('0x21')](_0x23f15b[_0x2a06('0x22')]);process[_0x2a06('0x5a')](0x1);}function handleError(_0x3e2ab7,_0x2ac21d){stats[_0x2a06('0x5b')][_0x2a06('0x1d')]({'name':_0x2ac21d[_0x2a06('0x5c')],'message':_0x2ac21d[_0x2a06('0x22')],'row':_0x3e2ab7});}function handleQuery(_0x21de54){logger['info'](_0x21de54);return db['sequelize'][_0x2a06('0x17')](_0x21de54)['spread'](function(_0xb80b56){results[_0x2a06('0x1d')](_0xb80b56);})[_0x2a06('0x20')](function(_0x3c8059){logger[_0x2a06('0x21')](_0x3c8059[_0x2a06('0x22')]);});}function main(_0x524629,_0xd7f89a,_0x5156f4,_0x2f187d){logger['info'](_0x2a06('0x5d'),_0x524629,JSON['stringify'](_0xd7f89a));process['send']('start');var _0x56f24c=_0xd7f89a[_0x2a06('0x5e')];var _0x625991=_['clone'](_0x56f24c);var _0x3c13db=_0xd7f89a[_0x2a06('0x5f')];var _0x3e6a2d=path['join'](config[_0x2a06('0x60')],_0x2a06('0x61'),_0x3c13db+_0x2a06('0x62'));logger[_0x2a06('0x58')](_0x2a06('0x63'),_0xd7f89a);db[_0x2a06('0x64')][_0x2a06('0x65')]({'raw':!![],'attributes':['id','name']})[_0x2a06('0x1f')](function(_0x42090b){for(var _0x5cafb1=0x0;_0x5cafb1<_0x42090b[_0x2a06('0x1a')];_0x5cafb1++){if(_0x42090b[_0x5cafb1]['name']in _0x56f24c){contactItemTypes['push'](_0x42090b[_0x5cafb1]);delete _0x625991[_0x42090b[_0x5cafb1]['name']];hasAdditionalPhones=!![];}for(var _0x219588 in _0x56f24c){if(_0x42090b[_0x5cafb1]['name']+_0x2a06('0x66')===_0x219588){phoneDescriptions[_0x2a06('0x1d')]({'itemTypeId':_0x42090b[_0x5cafb1]['id'],'description':_0x219588});delete _0x625991[_0x219588];}}}if(hasAdditionalPhones)_0x625991['AdditionalPhones']='';var _0x55d22e=_[_0x2a06('0x52')](_0x625991)[_0x2a06('0x13')]();logger[_0x2a06('0x58')](_0x2a06('0x67'),_0x55d22e);fs[_0x2a06('0x68')](_0x3e6a2d,_0x55d22e+'\x0a');Papa[_0x2a06('0x69')](fs[_0x2a06('0x6a')](_0x524629),{'header':!![],'skipEmptyLines':!![],'step':function(_0x9135c3,_0x5966a4){try{for(var _0x40d316=0x0,_0x1899c4=[];_0x40d316<_0x9135c3['data']['length'];_0x40d316++){stats['rows']+=0x1;if(_0x9135c3[_0x2a06('0x5b')][_0x40d316]){handleError(_0x9135c3['data'][_0x40d316],_0x9135c3[_0x2a06('0x5b')][_0x40d316]);}else{var _0x481f42=[];var _0x531bb7=[];var _0x22a42a={};for(var _0x4b09d8 in _0x56f24c){let _0xeb42cb=contactItemTypes[_0x2a06('0x6b')](_0x22cef9=>_0x22cef9[_0x2a06('0x6c')]===_0x4b09d8);let _0xf2eb53=contactItemTypes['find'](_0x4612cb=>_0x4612cb[_0x2a06('0x6c')]+'_description'===_0x4b09d8);if(_['isNil'](_0xeb42cb)&&_[_0x2a06('0x1b')](_0xf2eb53)){if(_0x56f24c[_0x2a06('0x6d')](_0x4b09d8)){if(_0x9135c3[_0x2a06('0x6e')][_0x40d316][_0x56f24c[_0x4b09d8]]){var _0x4d7747=_[_0x2a06('0x6f')](_0x9135c3['data'][_0x40d316][_0x56f24c[_0x4b09d8]][_0x2a06('0x70')](/"/g,'\x27'));switch(_0x4b09d8){case _0x2a06('0x71'):var _0x1dcc75=moment(_0x4d7747,_0x2a06('0xc'),!![]);if(_0x1dcc75[_0x2a06('0x72')]()){_0x1899c4[_0x2a06('0x1d')]('\x22'+_0x4d7747+'\x22');}else{_0x481f42[_0x2a06('0x1d')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x28ac88=parseInt(_0x4d7747);_0x4d7747=_['isNaN'](_0x28ac88)||_0x28ac88<0x0||_0x28ac88>0x4?_0x2f187d?0x3:0x2:_0x28ac88;_0x1899c4[_0x2a06('0x1d')]('\x22'+_0x4d7747+'\x22');break;case _0x2a06('0x38'):var _0x31816a=parseInt(_0x4d7747);if(_[_0x2a06('0x73')](_0x31816a)&&_['includes'](_0x5156f4,_0x31816a)){_0x1899c4['push']('\x22'+_0x31816a+'\x22');}else{_0x481f42[_0x2a06('0x1d')]('agent\x20not\x20exists');}break;case _0x2a06('0x74'):if(isEmail(_0x4d7747)){_0x1899c4[_0x2a06('0x1d')]('\x22'+_0x4d7747+'\x22');}else{_0x481f42[_0x2a06('0x1d')](_0x2a06('0x75'));}break;case _0x2a06('0x76'):var _0x11a989=moment(_0x4d7747,_0x2a06('0x77'),!![]);if(_0x11a989[_0x2a06('0x72')]()){_0x1899c4[_0x2a06('0x1d')]('\x22'+_0x4d7747+'\x22');}else{_0x481f42[_0x2a06('0x1d')](_0x2a06('0x78'));}break;default:_0x1899c4[_0x2a06('0x1d')]('\x22'+_0x4d7747+'\x22');}}else{switch(_0x4b09d8){case _0x2a06('0x79'):case _0x2a06('0x11'):_0x481f42[_0x2a06('0x1d')](_0x4b09d8+_0x2a06('0x7a'));break;default:_0x1899c4[_0x2a06('0x1d')]('\x22\x22');}}}}else{var _0x379c2a='';if(!_[_0x2a06('0x1b')](_0xeb42cb)){if(!_0x22a42a[_0x2a06('0x6d')](_0xeb42cb['id'])){for(var _0x3fdbeb=0x0;_0x3fdbeb<_0x56f24c[_0x4b09d8][_0x2a06('0x1a')];_0x3fdbeb++){var _0x4d7747=_[_0x2a06('0x6f')](_0x9135c3[_0x2a06('0x6e')][_0x40d316][_0x56f24c[_0x4b09d8][_0x3fdbeb]][_0x2a06('0x70')](/"/g,'\x27'));var _0x2b2281=phoneDescriptions[_0x2a06('0x6b')](_0x1a4b0e=>_0x1a4b0e['itemTypeId']===_0xeb42cb['id']);if(!_[_0x2a06('0x1b')](_0x2b2281)){var _0x1944f8=_[_0x2a06('0x6f')](_0x9135c3['data'][_0x40d316][_0x56f24c[_0x2b2281['description']][0x0]][_0x2a06('0x70')](/"/g,'\x27'));if(!_['isNil'](_0x1944f8))_0x4d7747=_0x4d7747+'§'+_0x1944f8;}if(_0x379c2a=='')_0x379c2a=_0x4d7747;else _0x379c2a+='|'+_0x4d7747;}_0x531bb7[_0x2a06('0x1d')](_0xeb42cb['id']+':'+_0x379c2a);_0x22a42a[_0xeb42cb['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1899c4[_0x2a06('0x1d')]('\x22'+_0x531bb7[_0x2a06('0x13')](';')+'\x22');}if(_0x481f42[_0x2a06('0x1a')]){handleError(_0x9135c3[_0x2a06('0x6e')][_0x40d316],{'code':_0x2a06('0x7b'),'message':_0x481f42[_0x2a06('0x13')]()});}else{fs['appendFileSync'](_0x3e6a2d,_0x1899c4['join']()+'\x0a');}_0x1899c4=[];}if(!(stats[_0x2a06('0x7c')]%0xc8)){socket[_0x2a06('0x7d')](_0x2a06('0x7e')+_0x3c13db,stats);stats[_0x2a06('0x5b')]=[];}}if(stopped){logger['info'](_0x2a06('0x7f'));_0x5966a4['abort']();}}catch(_0x48e558){handleError(_0x9135c3[_0x2a06('0x6e')][_0x40d316],{'code':_0x2a06('0x80'),'message':_0x48e558[_0x2a06('0x22')]});logger['error']('step',_0x48e558[_0x2a06('0x22')]);}},'complete':function(){try{var _0x5a095d=[];var _0x1b1ef2=tempTableName;_0x5a095d['push'](_0x2a06('0x81')+_0x1b1ef2+_0x2a06('0x82'));logger[_0x2a06('0x58')]('CIS\x20len',contactItemTypes[_0x2a06('0x1a')]);var _0x2af922=util[_0x2a06('0x83')](_0x2a06('0x84'),_0x3e6a2d,_0x1b1ef2,_0x55d22e,_0xd7f89a[_0x2a06('0x34')],_0xd7f89a[_0x2a06('0x53')]||null,NOW,NOW);if(_[_0x2a06('0x1b')](_0x56f24c['scheduledat'])){_0x2af922+=_0x2a06('0x85');}_0x5a095d[_0x2a06('0x1d')](_0x2af922);BPromise[_0x2a06('0x86')](_0x5a095d,handleQuery)['then'](function(_0x30b0e7){BPromise[_0x2a06('0x1e')]([handleAdditionalPhones()])['then'](function(){_0x5a095d=[];for(var _0xf0d1d9=0x0;_0xf0d1d9\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.updatedAt','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','toString','groupBy','findOne','enableEmailPreview','all','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','isEmpty','t.id\x20IN\x20?','Sequelize','QueryTypes','exports','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','getAccountFK','role','agent','search','select','field','color','from','tools_tags','getInteractionFK','user_has_','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','interactions','cm_contacts','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','{OPERATOR}','replace','isNumeric','i.id\x20LIKE\x20?','sms','includes','i.phone\x20LIKE\x20?','fax'];(function(_0x41fcee,_0x35eb45){var _0x27300d=function(_0x36aa5a){while(--_0x36aa5a){_0x41fcee['push'](_0x41fcee['shift']());}};_0x27300d(++_0x35eb45);}(_0x28a8,0x1b9));var _0x828a=function(_0x57041d,_0x3c34ad){_0x57041d=_0x57041d-0x0;var _0x5c5372=_0x28a8[_0x57041d];return _0x5c5372;};'use strict';var _=require('lodash');var squel=require(_0x828a('0x0'));var as=require(_0x828a('0x1'));var qs=require(_0x828a('0x2'));var updateInteraction=require(_0x828a('0x3'))[_0x828a('0x4')];var utils=require(_0x828a('0x5'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x1bb857,_0x2128fe,_0xdb4fa5){var _0x140f6d=![];var _0x21a7bf=utils[_0x828a('0x6')](_0x1bb857);if(_0x2128fe[_0x828a('0x7')]===_0x828a('0x8')&&!_0xdb4fa5[_0x828a('0x9')]&&!_0xdb4fa5[_0x21a7bf]){_0x140f6d=!![];}return _0x140f6d;}function getTagsQuery(){return squel[_0x828a('0xa')]()[_0x828a('0xb')]('id')[_0x828a('0xb')]('name')['field'](_0x828a('0xc'))[_0x828a('0xd')](_0x828a('0xe'));}function getUsersQuery(_0x3b9a48,_0x5a25cd){var _0xb5218a=utils[_0x828a('0xf')](_0x3b9a48);var _0x134d75=_0x828a('0x10')+_0x3b9a48+'_interactions';var _0x1167ea=squel[_0x828a('0xa')]()[_0x828a('0xb')]('u.id')[_0x828a('0xb')](_0x828a('0x11'))[_0x828a('0xb')](_0x828a('0x12')+_0xb5218a)[_0x828a('0xd')](_0x134d75,'ui')[_0x828a('0x13')](_0x828a('0x14'),'u',_0x828a('0x15'));if(_0x5a25cd[_0x828a('0x16')]>0x0){_0x1167ea[_0x828a('0x17')](_0x828a('0x12')+_0xb5218a+_0x828a('0x18'),_[_0x828a('0x19')](_0x5a25cd,'id'));}return _0x1167ea;}function getInteractionsQuery(_0x287101){var _0x31caeb=utils[_0x828a('0x1a')](_0x287101);var _0x171068=utils[_0x828a('0x6')](_0x287101);var _0x4d1078=utils[_0x828a('0xf')](_0x287101);return squel[_0x828a('0xa')]()[_0x828a('0xd')](_0x31caeb[_0x828a('0x1b')],'i')[_0x828a('0x13')](_0x828a('0x1c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x828a('0x1d'))[_0x828a('0x13')](_0x31caeb[_0x828a('0x1e')],'a',_0x828a('0x1f')+_0x171068)[_0x828a('0x13')](_0x31caeb[_0x828a('0x20')],'me',_0x828a('0x21')+_0x4d1078+_0x828a('0x22'))['left_join'](_0x31caeb[_0x828a('0x23')],'it',_0x828a('0x24')+_0x4d1078+'\x20=\x20i.id')['left_join'](_0x828a('0xe'),'t',_0x828a('0x25'));}function getSqlClauses(){var _0x4d15ea={'body':squel[_0x828a('0x26')](),'contact':squel[_0x828a('0x26')](),'default':squel['expr'](),'fields':squel[_0x828a('0x26')](),'filter':squel[_0x828a('0x26')](),'read':squel['expr'](),'tags':{'clause':squel[_0x828a('0x26')](),'ids':null},'user':squel[_0x828a('0x26')]()};return _0x4d15ea;}function parseTagParameter(_0x4d4151){var _0x4b4115=squel[_0x828a('0x26')]();if(_0x4d4151){var _0x5d50b0=utils[_0x828a('0x27')](_0x4d4151);_0x5d50b0[_0x828a('0x28')](function(_0x5b43df){_0x4b4115['or'](_0x828a('0x29'),'%,'+_0x5b43df+',%');});}return _0x4b4115;}function parseReadParameter(_0x2bda33){var _0x1bc8b8='';if(_0x2bda33){_0x1bc8b8=_0x828a('0x2a');if(_0x2bda33==='1'){_0x1bc8b8=_0x1bc8b8['replace'](_0x828a('0x2b'),'=');}else{_0x1bc8b8=_0x1bc8b8[_0x828a('0x2c')](_0x828a('0x2b'),'>');}}return _0x1bc8b8;}function parseSearchFilter(_0x595b44,_0xf2aee9){var _0x3a356e=squel[_0x828a('0x26')]();if(_0xf2aee9){var _0x991b01=_0xf2aee9[_0x828a('0x2c')]('\x5c','\x5c\x5c')[_0x828a('0x2c')](/'/g,'\x27\x27');if(qs[_0x828a('0x2d')](_0x991b01)){_0x3a356e['or'](_0x828a('0x2e'),_0x991b01+'%');if([_0x828a('0x2f'),'whatsapp'][_0x828a('0x30')](_0x595b44)){_0x3a356e['or'](_0x828a('0x31'),_0x991b01+'%');}else if(_0x595b44===_0x828a('0x32')){_0x3a356e['or'](_0x828a('0x33'),_0x991b01+'%');}else if(_0x595b44===_0x828a('0x34')){_0x3a356e['or'](_0x828a('0x35'),_0x991b01+'%');}}else if(_0x595b44===_0x828a('0x36')&&qs[_0x828a('0x37')](_0x991b01)){_0x3a356e['or'](_0x828a('0x38'),_0x991b01+'%');}else{if(_0x595b44===_0x828a('0x36')){_0x3a356e['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x828a('0x39')](_0x991b01,!![]))['or'](_0x828a('0x3a'),qs[_0x828a('0x39')](_0x991b01));}else if(_0x595b44!==_0x828a('0x32')){_0x3a356e['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x828a('0x39')](_0x991b01));}_0x3a356e['or'](_0x828a('0x3b'),qs[_0x828a('0x39')](_0x991b01,!![]),null);}}return _0x3a356e;}function parseAdvancedSearchFilter(_0x86f554,_0x23a268){var _0x37b87f=getSqlClauses();var _0x58335f=as[_0x828a('0x3c')](_0x86f554);var _0x2aee78=_0x58335f[_0x828a('0x3d')];for(var _0x59f9d9=0x0;_0x59f9d9<_0x58335f[_0x828a('0x3e')][_0x828a('0x16')];_0x59f9d9++){var _0x4517c3=_0x58335f[_0x828a('0x3e')][_0x59f9d9];var _0x4481a6='i';var _0x1b6277=_[_0x828a('0x3f')](_0x23a268,[_0x828a('0x40'),_0x4517c3[_0x828a('0xb')]]);if(_0x1b6277){var _0x219398=as[_0x828a('0x41')](_0x4481a6,_0x1b6277[_0x828a('0x42')],_0x4517c3);_0x37b87f[_0x828a('0x43')][_0x2aee78](_0x219398['text'],_0x219398[_0x828a('0x44')][_0x828a('0x45')],_0x219398[_0x828a('0x44')][_0x828a('0x46')]);}else{switch(_0x4517c3[_0x828a('0xb')]){case'unreadMessages':var _0x2e2f7d=parseReadParameter(_0x4517c3[_0x828a('0x44')]);_0x37b87f['read']['and'](_0x2e2f7d);break;case'Contact':if(_0x4517c3[_0x828a('0x47')]==='$substring'){if(_0x4517c3['value'][_0x828a('0x48')]('\x20')[_0x828a('0x16')]>0x1){_0x37b87f[_0x828a('0x49')][_0x2aee78](_0x828a('0x3b'),qs[_0x828a('0x39')](_0x4517c3[_0x828a('0x44')],!![]),null);}else{var _0xacda89='%'+_0x4517c3[_0x828a('0x44')]+'%';_0x37b87f[_0x828a('0x49')][_0x2aee78]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xacda89,_0xacda89,_0xacda89);}}else{_0x1b6277=_[_0x828a('0x3f')](_0x23a268,[_0x828a('0x40'),'ContactId']);_0x4517c3['field']=_0x828a('0x4a');_0x219398=as[_0x828a('0x41')](_0x4481a6,_0x1b6277[_0x828a('0x42')],_0x4517c3);_0x37b87f[_0x828a('0x49')][_0x2aee78](_0x219398['text'],_0x219398[_0x828a('0x44')][_0x828a('0x45')],_0x219398[_0x828a('0x44')][_0x828a('0x46')]);}break;case _0x828a('0x4b'):var _0x27b473=_0x4517c3[_0x828a('0x44')][_0x828a('0x48')](',')[_0x828a('0x19')](function(_0x4f426f){return Number(_0x4f426f);});var _0x2a873c=parseTagParameter(_0x27b473);_0x37b87f[_0x828a('0x4c')][_0x828a('0x4d')][_0x828a('0x4e')](_0x2a873c);_0x37b87f[_0x828a('0x4c')][_0x828a('0x4f')]=_0x27b473;break;case _0x828a('0x50'):if(_0x4517c3[_0x828a('0x47')]===_0x828a('0x51')){_0x37b87f[_0x828a('0x52')][_0x2aee78](_0x828a('0x53'),'%'+_0x4517c3[_0x828a('0x44')]+'%',null);}else{_0x1b6277=_[_0x828a('0x3f')](_0x23a268,[_0x828a('0x40'),_0x828a('0x54')]);_0x4517c3['field']=_0x828a('0x54');_0x219398=as[_0x828a('0x41')](_0x4481a6,_0x1b6277[_0x828a('0x42')],_0x4517c3);_0x37b87f[_0x828a('0x52')][_0x2aee78](_0x219398['text'],_0x219398[_0x828a('0x44')]['start'],_0x219398['value']['end']);}break;case _0x828a('0x55'):case _0x828a('0x56'):_0x219398=as[_0x828a('0x41')]('me',null,_0x4517c3);_0x37b87f[_0x828a('0x55')][_0x2aee78](_0x219398[_0x828a('0x57')],_0x219398[_0x828a('0x44')][_0x828a('0x45')],_0x219398[_0x828a('0x44')][_0x828a('0x46')]);break;}}}return _0x37b87f;}function parseModelFields(_0xf442ac,_0x193597,_0x2e0879){var _0x995c61=utils['getAccountFK'](_0xf442ac);var _0x5d39dd=squel['expr']();var _0x2191e9=_(_0x193597)[_0x828a('0x58')]()['map'](function(_0x4d1b4a){return _[_0x828a('0x59')](_0x2e0879,[_0x828a('0x40'),_0x4d1b4a])?_0x4d1b4a:undefined;})['compact']()[_0x828a('0x44')]();if(_0x2191e9[_0x828a('0x16')]>0x0){_0x2191e9['forEach'](function(_0x13434c){if(_0x13434c===_0x995c61){_0x5d39dd[_0x828a('0x4e')]('i.'+_0x995c61+'\x20IN\x20?',[]['concat'](_0x193597[_0x13434c]));}else if(_0x13434c==='createdAt'){var _0x3115bb=JSON[_0x828a('0x5a')](_0x193597[_0x13434c])[_0x828a('0x5b')];var _0x390639=JSON[_0x828a('0x5a')](_0x193597[_0x13434c])[_0x828a('0x5c')];_0x5d39dd[_0x828a('0x4e')](_0x828a('0x5d'),_0x3115bb,_0x390639);}else{if(_0x193597[_0x13434c]==='null'){_0x5d39dd['and']('i.'+_0x13434c+_0x828a('0x5e'));}else{_0x5d39dd['and']('i.'+_0x13434c+_0x828a('0x5f'),_0x193597[_0x13434c]);}}});}return _0x5d39dd;}function parseQueryParameters(_0x628db7,_0x540119,_0x3e8241){var _0x1e11aa=getSqlClauses();return Promise[_0x828a('0x60')]()[_0x828a('0x61')](function(){return parseModelFields(_0x628db7,_0x540119,_0x3e8241);})[_0x828a('0x61')](function(_0x4cbdbc){_0x1e11aa[_0x828a('0x62')][_0x828a('0x4e')](_0x4cbdbc);return parseReadParameter(_0x540119[_0x828a('0x63')]);})[_0x828a('0x61')](function(_0x1c44c8){_0x1e11aa[_0x828a('0x63')]['and'](_0x1c44c8);return parseTagParameter(_0x540119[_0x828a('0x64')]);})[_0x828a('0x61')](function(_0x5c8cf1){_0x1e11aa['tags'][_0x828a('0x4d')][_0x828a('0x4e')](_0x5c8cf1);return parseSearchFilter(_0x628db7,_0x540119[_0x828a('0x65')]);})[_0x828a('0x61')](function(_0x43e871){_0x1e11aa['filter']=_0x43e871;return _0x1e11aa;});}function checkAccountsRestrictions(_0xfa8fbf,_0x14e597,_0x1fefa9){var _0x5e6b43=utils[_0x828a('0x6')](_0xfa8fbf);var _0x13b04d=_0x828a('0x66')+_['capitalize'](_0xfa8fbf)+(_0xfa8fbf===_0x828a('0x67')?'Websites':'Accounts');var _0x3c066e=squel['expr']();return Promise[_0x828a('0x60')]()['then'](function(){if(_0x1fefa9['search']&&_0x14e597['role']===_0x828a('0x8')){return _0x14e597[_0x13b04d]({'attributes':['id'],'raw':!![]});}})[_0x828a('0x61')](function(_0x1218be){if(_0x1218be){if(_0x1218be[_0x828a('0x16')]===0x0){_0x3c066e[_0x828a('0x4e')]('i.'+_0x5e6b43+_0x828a('0x5e'));}else{_0x3c066e[_0x828a('0x4e')]('i.'+_0x5e6b43+_0x828a('0x18'),_['map'](_0x1218be,'id'));}}else if(!_0x1fefa9[_0x5e6b43]){_0x3c066e[_0x828a('0x4e')]('i.'+_0x5e6b43+'\x20IS\x20NOT\x20NULL');}})[_0x828a('0x61')](function(){return _0x3c066e;});}function getClosedOrderClause(_0x4cbcb5,_0xd62dc0){var _0x225a41='';var _0x185834=[_0x828a('0x68'),_0x828a('0x69'),'i.disposition'];if(_0x4cbcb5===_0x828a('0x36')){_0x185834[_0x828a('0x6a')](_0x828a('0x6b'));}if(_0xd62dc0[_0x828a('0x6c')]==='0'&&_0x4cbcb5===_0x828a('0x36')){_0x225a41='i.substatus';}else{if(_0xd62dc0[_0x828a('0x6c')]==='1'){_0x185834['shift']();}_0x225a41='CONCAT_WS(\x27\x27,\x20'+_0x185834['join'](',\x20')+')';}return _0x225a41;}function getFilteredInteractions(_0x24aaa8,_0x1af4a4,_0x5e7b5a,_0x15ec28){var _0x28241e=utils[_0x828a('0xf')](_0x24aaa8);var _0x2d8f63=_[_0x828a('0x6d')](_0x24aaa8)+_0x828a('0x6e');var _0x442dbb=[];var _0x1dc26b=getTagsQuery();var _0x2ea5f5={'type':db['Sequelize']['QueryTypes'][_0x828a('0x6f')],'raw':!![]};var _0xd21f1e=[];var _0x28e92b=[];return db[_0x828a('0x70')][_0x828a('0x71')](_0x1dc26b['toString'](),_0x2ea5f5)[_0x828a('0x61')](function(_0x597083){_0x442dbb=_[_0x828a('0x72')](_0x597083,'id');_0x2ea5f5=_['merge'](_0x2ea5f5,{'model':db[_0x2d8f63],'mapToModel':!![],'nest':!![]});if(_0x5e7b5a[_0x828a('0x62')]){_0x15ec28['attributes'][_0x828a('0x28')](function(_0x55b1a4){_0x1af4a4[_0x828a('0xb')]('i.'+_0x55b1a4);});}else{_0x1af4a4['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x1af4a4[_0x828a('0xb')](_0x828a('0x73'),_0x828a('0x74'));_0x1af4a4[_0x828a('0xb')](_0x828a('0x75'),_0x828a('0x76'));if(_0x24aaa8===_0x828a('0x36')){_0x1af4a4[_0x828a('0xb')]('a.email',_0x828a('0x77'));_0x1af4a4[_0x828a('0xb')](_0x828a('0x78'),_0x828a('0x79'));_0x1af4a4['field'](_0x828a('0x7a'));_0x1af4a4[_0x828a('0xb')]('i.createdAt');_0x1af4a4[_0x828a('0xb')](_0x828a('0x7b'));_0x1af4a4[_0x828a('0xb')]('i.closed');_0x1af4a4['field'](_0x828a('0x7c'));_0x1af4a4['field'](_0x828a('0x7d'));_0x1af4a4[_0x828a('0xb')]('i.lastMsgAt');_0x1af4a4['field'](_0x828a('0x7e'));_0x1af4a4[_0x828a('0xb')](_0x828a('0x7f'));_0x1af4a4['field']('i.disposition');_0x1af4a4['field'](_0x828a('0x69'));_0x1af4a4[_0x828a('0xb')]('i.thirdDisposition');_0x1af4a4['field'](_0x828a('0x6b'));_0x1af4a4[_0x828a('0xb')](_0x828a('0x80'));_0x1af4a4[_0x828a('0xb')](_0x828a('0x81'));_0x1af4a4['field'](_0x828a('0x82'));_0x1af4a4['field'](_0x828a('0x83'));}else if(_0x24aaa8==='openchannel'){_0x1af4a4[_0x828a('0xb')](_0x828a('0x84'),_0x828a('0x79'));}else{_0x1af4a4[_0x828a('0xb')]('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',_0x828a('0x79'));}if(_0x24aaa8!==_0x828a('0x36')){_0x1af4a4[_0x828a('0xb')]('i.*');}_0x1af4a4['field'](_0x828a('0x85'),_0x828a('0x86'));_0x1af4a4['field']('c.lastName',_0x828a('0x87'));_0x1af4a4[_0x828a('0xb')](_0x828a('0x88'),_0x828a('0x89'));_0x1af4a4[_0x828a('0xb')](_0x828a('0x8a'),_0x828a('0x8b'));_0x1af4a4['field'](_0x828a('0x8c'),'Contact.mobile');_0x1af4a4['field'](_0x828a('0x8d'),_0x828a('0x8e'));_0x1af4a4['field'](_0x828a('0x8f'),_0x828a('0x90'));_0x1af4a4[_0x828a('0xb')](_0x828a('0x91'),_0x828a('0x92'));_0x1af4a4[_0x828a('0xb')](_0x828a('0x93'),_0x828a('0x94'));}if(_0x15ec28[_0x828a('0x95')]){_0x1af4a4['limit'](_0x15ec28[_0x828a('0x95')]);}if(_0x15ec28[_0x828a('0x96')]){_0x1af4a4['offset'](_0x15ec28[_0x828a('0x96')]);}return db[_0x828a('0x70')]['query'](_0x1af4a4[_0x828a('0x97')](),_0x2ea5f5);})['then'](function(_0x121799){_0xd21f1e=_0x121799;var _0x41089f=getUsersQuery(_0x24aaa8,_0xd21f1e);return db['sequelize'][_0x828a('0x71')](_0x41089f['toString'](),_0x2ea5f5);})[_0x828a('0x61')](function(_0x2234f9){_0x28e92b=_[_0x828a('0x98')](_0x2234f9,_0x28241e);if(_0x24aaa8==='mail'){return db['Setting'][_0x828a('0x99')]({'attributes':[_0x828a('0x9a')],'raw':!![]});}})['then'](function(_0x456a15){var _0x3306b0=_0x456a15?_0x456a15[_0x828a('0x9a')]:undefined;var _0x18e30a=_0xd21f1e[_0x828a('0x19')](function(_0x4211d4){return updateInteraction(_0x4211d4,_0x442dbb,_0x28e92b,_0x3306b0);});return Promise[_0x828a('0x9b')](_0x18e30a);});}function countFilteredInteractions(_0x423a10,_0x401a51){var _0x51fd6c=_0x423a10[_0x828a('0x9c')]();_0x51fd6c[_0x828a('0xb')]('COUNT(*)');_0x51fd6c['field'](_0x828a('0x9d'),_0x828a('0x9e'));var _0x41a9d2=utils['getSelectedTags'](_0x401a51);if(!_[_0x828a('0x9f')](_0x41a9d2)){_0x51fd6c['where'](_0x828a('0xa0'),_0x41a9d2);}var _0x3a2ce8={'type':db[_0x828a('0xa1')][_0x828a('0xa2')][_0x828a('0x6f')],'raw':!![]};return db[_0x828a('0x70')][_0x828a('0x71')](_0x51fd6c[_0x828a('0x97')](),_0x3a2ce8);}module[_0x828a('0xa3')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xf0a9=['i.thirdDisposition','i.secondDisposition','i.disposition','unshift','closed','i.substatus','shift','join','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','toString','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','Account.key','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.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.MailAccountId','i.UserId','openchannel','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','Owner.internal','limit','offset','groupBy','findOne','enableEmailPreview','clone','COUNT(*)','getSelectedTags','isEmpty','exports','lodash','squel','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','field','color','from','tools_tags','getInteractionFK','user_has_','select','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','where','map','getInteractionsTables','interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','\x20=\x20i.id','interactionsTags','it.','expr','forEach','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','sms','whatsapp','includes','i.fax\x20LIKE\x20?','mail','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)','fax','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','conditions','length','name','buildExpression','type','default','text','value','end','read','and','Contact','operator','$substring','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','start','tags','clause','ids','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','user','plainBody','keys','some','compact','concat','createdAt','parse','$gte','\x20IS\x20NULL','\x20=\x20?','resolve','fields','then','tag','filter','get','capitalize','chat','Websites','\x20IS\x20NOT\x20NULL'];(function(_0x1a84b1,_0x3ca6d8){var _0x161938=function(_0x44e888){while(--_0x44e888){_0x1a84b1['push'](_0x1a84b1['shift']());}};_0x161938(++_0x3ca6d8);}(_0xf0a9,0x188));var _0x9f0a=function(_0x34bc7f,_0x2345c3){_0x34bc7f=_0x34bc7f-0x0;var _0x7f8b24=_0xf0a9[_0x34bc7f];return _0x7f8b24;};'use strict';var _=require(_0x9f0a('0x0'));var squel=require(_0x9f0a('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x9f0a('0x2'));var updateInteraction=require(_0x9f0a('0x3'))[_0x9f0a('0x4')];var utils=require(_0x9f0a('0x5'));var db=require(_0x9f0a('0x6'))['db'];function skipInteractionsQuery(_0x5be429,_0x1d4ff3,_0xa70c6){var _0x5e5c7c=![];var _0x1eb6c2=utils[_0x9f0a('0x7')](_0x5be429);if(_0x1d4ff3[_0x9f0a('0x8')]===_0x9f0a('0x9')&&!_0xa70c6[_0x9f0a('0xa')]&&!_0xa70c6[_0x1eb6c2]){_0x5e5c7c=!![];}return _0x5e5c7c;}function getTagsQuery(){return squel['select']()[_0x9f0a('0xb')]('id')[_0x9f0a('0xb')]('name')[_0x9f0a('0xb')](_0x9f0a('0xc'))[_0x9f0a('0xd')](_0x9f0a('0xe'));}function getUsersQuery(_0xb3173f,_0x1b3629){var _0x48015c=utils[_0x9f0a('0xf')](_0xb3173f);var _0x3037ed=_0x9f0a('0x10')+_0xb3173f+'_interactions';var _0x38d265=squel[_0x9f0a('0x11')]()[_0x9f0a('0xb')](_0x9f0a('0x12'))[_0x9f0a('0xb')](_0x9f0a('0x13'))[_0x9f0a('0xb')](_0x9f0a('0x14')+_0x48015c)['from'](_0x3037ed,'ui')[_0x9f0a('0x15')](_0x9f0a('0x16'),'u',_0x9f0a('0x17'));if(_0x1b3629['length']>0x0){_0x38d265[_0x9f0a('0x18')]('ui.'+_0x48015c+'\x20IN\x20?',_[_0x9f0a('0x19')](_0x1b3629,'id'));}return _0x38d265;}function getInteractionsQuery(_0x3e4537){var _0x37e2e8=utils[_0x9f0a('0x1a')](_0x3e4537);var _0xb0b1e3=utils[_0x9f0a('0x7')](_0x3e4537);var _0x39c9c4=utils['getInteractionFK'](_0x3e4537);return squel[_0x9f0a('0x11')]()[_0x9f0a('0xd')](_0x37e2e8[_0x9f0a('0x1b')],'i')['left_join']('cm_contacts','c',_0x9f0a('0x1c'))[_0x9f0a('0x15')]('users','o',_0x9f0a('0x1d'))['left_join'](_0x37e2e8[_0x9f0a('0x1e')],'a',_0x9f0a('0x1f')+_0xb0b1e3)[_0x9f0a('0x15')](_0x37e2e8[_0x9f0a('0x20')],'me','me.'+_0x39c9c4+_0x9f0a('0x21'))[_0x9f0a('0x15')](_0x37e2e8[_0x9f0a('0x22')],'it',_0x9f0a('0x23')+_0x39c9c4+_0x9f0a('0x21'))[_0x9f0a('0x15')](_0x9f0a('0xe'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x474590={'body':squel['expr'](),'contact':squel[_0x9f0a('0x24')](),'default':squel[_0x9f0a('0x24')](),'fields':squel[_0x9f0a('0x24')](),'filter':squel[_0x9f0a('0x24')](),'read':squel['expr'](),'tags':{'clause':squel[_0x9f0a('0x24')](),'ids':null},'user':squel[_0x9f0a('0x24')]()};return _0x474590;}function parseTagParameter(_0x1585b0){var _0x1808f3=squel[_0x9f0a('0x24')]();if(_0x1585b0){var _0x2666a0=utils['getSelectedTags'](_0x1585b0);_0x2666a0[_0x9f0a('0x25')](function(_0x5c6ad1){_0x1808f3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5c6ad1+',%');});}return _0x1808f3;}function parseReadParameter(_0x254d6e){var _0x21b223='';if(_0x254d6e){_0x21b223=_0x9f0a('0x26');if(_0x254d6e==='1'){_0x21b223=_0x21b223[_0x9f0a('0x27')](_0x9f0a('0x28'),'=');}else{_0x21b223=_0x21b223[_0x9f0a('0x27')]('{OPERATOR}','>');}}return _0x21b223;}function parseSearchFilter(_0x5032bf,_0x46994b){var _0x1db460=squel[_0x9f0a('0x24')]();if(_0x46994b){var _0x6c0603=_0x46994b['replace']('\x5c','\x5c\x5c')[_0x9f0a('0x27')](/'/g,'\x27\x27');if(qs[_0x9f0a('0x29')](_0x6c0603)){_0x1db460['or']('i.id\x20LIKE\x20?',_0x6c0603+'%');if([_0x9f0a('0x2a'),_0x9f0a('0x2b')][_0x9f0a('0x2c')](_0x5032bf)){_0x1db460['or']('i.phone\x20LIKE\x20?',_0x6c0603+'%');}else if(_0x5032bf==='fax'){_0x1db460['or'](_0x9f0a('0x2d'),_0x6c0603+'%');}else if(_0x5032bf==='openchannel'){_0x1db460['or']('i.from\x20LIKE\x20?',_0x6c0603+'%');}}else if(_0x5032bf===_0x9f0a('0x2e')&&qs[_0x9f0a('0x2f')](_0x6c0603)){_0x1db460['or'](_0x9f0a('0x30'),_0x6c0603+'%');}else{if(_0x5032bf===_0x9f0a('0x2e')){_0x1db460['or'](_0x9f0a('0x31'),qs[_0x9f0a('0x32')](_0x6c0603,!![]))['or'](_0x9f0a('0x33'),qs['getFullTextValue'](_0x6c0603));}else if(_0x5032bf!==_0x9f0a('0x34')){_0x1db460['or'](_0x9f0a('0x35'),qs['getFullTextValue'](_0x6c0603));}_0x1db460['or'](_0x9f0a('0x36'),qs[_0x9f0a('0x32')](_0x6c0603,!![]),null);}}return _0x1db460;}function parseAdvancedSearchFilter(_0x32bf60,_0x144c0b){var _0x1214fe=getSqlClauses();var _0x2d86f7=as[_0x9f0a('0x37')](_0x32bf60);var _0x1d8f3a=_0x2d86f7['sqlOperator'];for(var _0xccf423=0x0;_0xccf423<_0x2d86f7[_0x9f0a('0x38')][_0x9f0a('0x39')];_0xccf423++){var _0x202013=_0x2d86f7[_0x9f0a('0x38')][_0xccf423];var _0x326fef='i';var _0x58d4a6=_['find'](_0x144c0b,[_0x9f0a('0x3a'),_0x202013[_0x9f0a('0xb')]]);if(_0x58d4a6){var _0x539d9d=as[_0x9f0a('0x3b')](_0x326fef,_0x58d4a6[_0x9f0a('0x3c')],_0x202013);_0x1214fe[_0x9f0a('0x3d')][_0x1d8f3a](_0x539d9d[_0x9f0a('0x3e')],_0x539d9d[_0x9f0a('0x3f')]['start'],_0x539d9d['value'][_0x9f0a('0x40')]);}else{switch(_0x202013[_0x9f0a('0xb')]){case'unreadMessages':var _0x379387=parseReadParameter(_0x202013['value']);_0x1214fe[_0x9f0a('0x41')][_0x9f0a('0x42')](_0x379387);break;case _0x9f0a('0x43'):if(_0x202013[_0x9f0a('0x44')]===_0x9f0a('0x45')){if(_0x202013[_0x9f0a('0x3f')][_0x9f0a('0x46')]('\x20')[_0x9f0a('0x39')]>0x1){_0x1214fe[_0x9f0a('0x47')][_0x1d8f3a](_0x9f0a('0x36'),qs[_0x9f0a('0x32')](_0x202013['value'],!![]),null);}else{var _0x3cf874='%'+_0x202013[_0x9f0a('0x3f')]+'%';_0x1214fe[_0x9f0a('0x47')][_0x1d8f3a](_0x9f0a('0x48'),_0x3cf874,_0x3cf874,_0x3cf874);}}else{_0x58d4a6=_[_0x9f0a('0x49')](_0x144c0b,[_0x9f0a('0x3a'),'ContactId']);_0x202013[_0x9f0a('0xb')]=_0x9f0a('0x4a');_0x539d9d=as[_0x9f0a('0x3b')](_0x326fef,_0x58d4a6['type'],_0x202013);_0x1214fe[_0x9f0a('0x47')][_0x1d8f3a](_0x539d9d[_0x9f0a('0x3e')],_0x539d9d[_0x9f0a('0x3f')][_0x9f0a('0x4b')],_0x539d9d[_0x9f0a('0x3f')]['end']);}break;case'Tag':var _0xf10449=_0x202013[_0x9f0a('0x3f')][_0x9f0a('0x46')](',')['map'](function(_0x15fb69){return Number(_0x15fb69);});var _0x5a832c=parseTagParameter(_0xf10449);_0x1214fe[_0x9f0a('0x4c')][_0x9f0a('0x4d')][_0x9f0a('0x42')](_0x5a832c);_0x1214fe['tags'][_0x9f0a('0x4e')]=_0xf10449;break;case _0x9f0a('0x4f'):if(_0x202013[_0x9f0a('0x44')]===_0x9f0a('0x45')){_0x1214fe['user'][_0x1d8f3a](_0x9f0a('0x50'),'%'+_0x202013[_0x9f0a('0x3f')]+'%',null);}else{_0x58d4a6=_['find'](_0x144c0b,[_0x9f0a('0x3a'),_0x9f0a('0x51')]);_0x202013['field']=_0x9f0a('0x51');_0x539d9d=as[_0x9f0a('0x3b')](_0x326fef,_0x58d4a6[_0x9f0a('0x3c')],_0x202013);_0x1214fe[_0x9f0a('0x52')][_0x1d8f3a](_0x539d9d[_0x9f0a('0x3e')],_0x539d9d['value']['start'],_0x539d9d[_0x9f0a('0x3f')][_0x9f0a('0x40')]);}break;case'body':case _0x9f0a('0x53'):_0x539d9d=as['buildExpression']('me',null,_0x202013);_0x1214fe['body'][_0x1d8f3a](_0x539d9d[_0x9f0a('0x3e')],_0x539d9d[_0x9f0a('0x3f')][_0x9f0a('0x4b')],_0x539d9d[_0x9f0a('0x3f')]['end']);break;}}}return _0x1214fe;}function parseModelFields(_0x1fad90,_0x50bf8b,_0xccc2cc){var _0x1ad201=utils[_0x9f0a('0x7')](_0x1fad90);var _0x24e0a4=squel['expr']();var _0x56b7db=_(_0x50bf8b)[_0x9f0a('0x54')]()['map'](function(_0x51994e){return _[_0x9f0a('0x55')](_0xccc2cc,[_0x9f0a('0x3a'),_0x51994e])?_0x51994e:undefined;})[_0x9f0a('0x56')]()[_0x9f0a('0x3f')]();if(_0x56b7db[_0x9f0a('0x39')]>0x0){_0x56b7db[_0x9f0a('0x25')](function(_0x2d33ab){if(_0x2d33ab===_0x1ad201){_0x24e0a4['and']('i.'+_0x1ad201+'\x20IN\x20?',[][_0x9f0a('0x57')](_0x50bf8b[_0x2d33ab]));}else if(_0x2d33ab===_0x9f0a('0x58')){var _0x486d04=JSON[_0x9f0a('0x59')](_0x50bf8b[_0x2d33ab])[_0x9f0a('0x5a')];var _0x4be744=JSON[_0x9f0a('0x59')](_0x50bf8b[_0x2d33ab])['$lte'];_0x24e0a4[_0x9f0a('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x486d04,_0x4be744);}else{if(_0x50bf8b[_0x2d33ab]==='null'){_0x24e0a4['and']('i.'+_0x2d33ab+_0x9f0a('0x5b'));}else{_0x24e0a4['and']('i.'+_0x2d33ab+_0x9f0a('0x5c'),_0x50bf8b[_0x2d33ab]);}}});}return _0x24e0a4;}function parseQueryParameters(_0x519365,_0x43fd1e,_0x1d6bd4){var _0x2f6249=getSqlClauses();return Promise[_0x9f0a('0x5d')]()['then'](function(){return parseModelFields(_0x519365,_0x43fd1e,_0x1d6bd4);})['then'](function(_0x4fb768){_0x2f6249[_0x9f0a('0x5e')][_0x9f0a('0x42')](_0x4fb768);return parseReadParameter(_0x43fd1e[_0x9f0a('0x41')]);})[_0x9f0a('0x5f')](function(_0x464bf4){_0x2f6249[_0x9f0a('0x41')][_0x9f0a('0x42')](_0x464bf4);return parseTagParameter(_0x43fd1e[_0x9f0a('0x60')]);})[_0x9f0a('0x5f')](function(_0x5e6c23){_0x2f6249[_0x9f0a('0x4c')]['clause']['and'](_0x5e6c23);return parseSearchFilter(_0x519365,_0x43fd1e[_0x9f0a('0x61')]);})[_0x9f0a('0x5f')](function(_0x5676c0){_0x2f6249[_0x9f0a('0x61')]=_0x5676c0;return _0x2f6249;});}function checkAccountsRestrictions(_0x34ba61,_0x1ee3ca,_0x43da4f){var _0x104733=utils[_0x9f0a('0x7')](_0x34ba61);var _0x2f556b=_0x9f0a('0x62')+_[_0x9f0a('0x63')](_0x34ba61)+(_0x34ba61===_0x9f0a('0x64')?_0x9f0a('0x65'):'Accounts');var _0x298d2f=squel[_0x9f0a('0x24')]();return Promise[_0x9f0a('0x5d')]()[_0x9f0a('0x5f')](function(){if(_0x43da4f['search']&&_0x1ee3ca[_0x9f0a('0x8')]==='agent'){return _0x1ee3ca[_0x2f556b]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x12e759){if(_0x12e759){if(_0x12e759[_0x9f0a('0x39')]===0x0){_0x298d2f[_0x9f0a('0x42')]('i.'+_0x104733+'\x20IS\x20NULL');}else{_0x298d2f[_0x9f0a('0x42')]('i.'+_0x104733+'\x20IN\x20?',_[_0x9f0a('0x19')](_0x12e759,'id'));}}else if(!_0x43da4f[_0x104733]){_0x298d2f['and']('i.'+_0x104733+_0x9f0a('0x66'));}})[_0x9f0a('0x5f')](function(){return _0x298d2f;});}function getClosedOrderClause(_0x5bcdbb,_0x29bda7){var _0x35ba72='';var _0x1da5ca=[_0x9f0a('0x67'),_0x9f0a('0x68'),_0x9f0a('0x69')];if(_0x5bcdbb===_0x9f0a('0x2e')){_0x1da5ca[_0x9f0a('0x6a')]('i.substatus');}if(_0x29bda7[_0x9f0a('0x6b')]==='0'&&_0x5bcdbb===_0x9f0a('0x2e')){_0x35ba72=_0x9f0a('0x6c');}else{if(_0x29bda7[_0x9f0a('0x6b')]==='1'){_0x1da5ca[_0x9f0a('0x6d')]();}_0x35ba72='CONCAT_WS(\x27\x27,\x20'+_0x1da5ca[_0x9f0a('0x6e')](',\x20')+')';}return _0x35ba72;}function getFilteredInteractions(_0x430893,_0x334d2b,_0x38ea9a,_0x229dc2){var _0x45d07f=utils['getInteractionFK'](_0x430893);var _0x410ec2=_[_0x9f0a('0x63')](_0x430893)+_0x9f0a('0x6f');var _0x3da5a3=[];var _0x200294=getTagsQuery();var _0x416ad3={'type':db[_0x9f0a('0x70')][_0x9f0a('0x71')][_0x9f0a('0x72')],'raw':!![]};var _0x1c695b=[];var _0x87158e=[];return db[_0x9f0a('0x73')][_0x9f0a('0x74')](_0x200294[_0x9f0a('0x75')](),_0x416ad3)[_0x9f0a('0x5f')](function(_0x1715be){_0x3da5a3=_[_0x9f0a('0x76')](_0x1715be,'id');_0x416ad3=_[_0x9f0a('0x77')](_0x416ad3,{'model':db[_0x410ec2],'mapToModel':!![],'nest':!![]});if(_0x38ea9a[_0x9f0a('0x5e')]){_0x229dc2[_0x9f0a('0x78')]['forEach'](function(_0x3bb29d){_0x334d2b['field']('i.'+_0x3bb29d);});}else{_0x334d2b['field'](_0x9f0a('0x79'),_0x9f0a('0x7a'));_0x334d2b[_0x9f0a('0xb')](_0x9f0a('0x7b'),_0x9f0a('0x7c'));_0x334d2b['field']('a.mandatoryDisposition','Account.mandatoryDisposition');if(_0x430893==='mail'){_0x334d2b['field'](_0x9f0a('0x7d'),_0x9f0a('0x7e'));_0x334d2b[_0x9f0a('0xb')](_0x9f0a('0x7f'),_0x9f0a('0x80'));_0x334d2b['field']('i.id');_0x334d2b[_0x9f0a('0xb')]('i.createdAt');_0x334d2b[_0x9f0a('0xb')](_0x9f0a('0x81'));_0x334d2b[_0x9f0a('0xb')](_0x9f0a('0x82'));_0x334d2b['field'](_0x9f0a('0x83'));_0x334d2b[_0x9f0a('0xb')]('i.attach');_0x334d2b[_0x9f0a('0xb')](_0x9f0a('0x84'));_0x334d2b['field'](_0x9f0a('0x85'));_0x334d2b[_0x9f0a('0xb')](_0x9f0a('0x86'));_0x334d2b[_0x9f0a('0xb')](_0x9f0a('0x69'));_0x334d2b['field'](_0x9f0a('0x68'));_0x334d2b[_0x9f0a('0xb')](_0x9f0a('0x67'));_0x334d2b[_0x9f0a('0xb')](_0x9f0a('0x6c'));_0x334d2b['field'](_0x9f0a('0x87'));_0x334d2b['field'](_0x9f0a('0x88'));_0x334d2b[_0x9f0a('0xb')](_0x9f0a('0x89'));_0x334d2b[_0x9f0a('0xb')](_0x9f0a('0x8a'));}else if(_0x430893===_0x9f0a('0x8b')){_0x334d2b['field'](_0x9f0a('0x8c'),_0x9f0a('0x80'));}else{_0x334d2b[_0x9f0a('0xb')]('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',_0x9f0a('0x80'));}if(_0x430893!=='mail'){_0x334d2b[_0x9f0a('0xb')](_0x9f0a('0x8d'));}_0x334d2b[_0x9f0a('0xb')](_0x9f0a('0x8e'),_0x9f0a('0x8f'));_0x334d2b[_0x9f0a('0xb')](_0x9f0a('0x90'),_0x9f0a('0x91'));_0x334d2b[_0x9f0a('0xb')](_0x9f0a('0x92'),_0x9f0a('0x93'));_0x334d2b[_0x9f0a('0xb')](_0x9f0a('0x94'),_0x9f0a('0x95'));_0x334d2b['field'](_0x9f0a('0x96'),_0x9f0a('0x97'));_0x334d2b[_0x9f0a('0xb')](_0x9f0a('0x98'),'Contact.fax');_0x334d2b[_0x9f0a('0xb')]('o.fullname',_0x9f0a('0x99'));_0x334d2b['field']('o.internal',_0x9f0a('0x9a'));_0x334d2b['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x229dc2[_0x9f0a('0x9b')]){_0x334d2b['limit'](_0x229dc2[_0x9f0a('0x9b')]);}if(_0x229dc2[_0x9f0a('0x9c')]){_0x334d2b[_0x9f0a('0x9c')](_0x229dc2[_0x9f0a('0x9c')]);}return db[_0x9f0a('0x73')]['query'](_0x334d2b[_0x9f0a('0x75')](),_0x416ad3);})['then'](function(_0x574e83){_0x1c695b=_0x574e83;var _0x5336fa=getUsersQuery(_0x430893,_0x1c695b);return db['sequelize'][_0x9f0a('0x74')](_0x5336fa[_0x9f0a('0x75')](),_0x416ad3);})['then'](function(_0x3894d5){_0x87158e=_[_0x9f0a('0x9d')](_0x3894d5,_0x45d07f);if(_0x430893===_0x9f0a('0x2e')){return db['Setting'][_0x9f0a('0x9e')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x9f0a('0x5f')](function(_0x3b9468){var _0x33ecc5=_0x3b9468?_0x3b9468[_0x9f0a('0x9f')]:undefined;var _0x4e939f=_0x1c695b[_0x9f0a('0x19')](function(_0x1cb41c){return updateInteraction(_0x1cb41c,_0x3da5a3,_0x87158e,_0x33ecc5);});return Promise['all'](_0x4e939f);});}function countFilteredInteractions(_0x29ae3f,_0x57d20c){var _0x5a004d=_0x29ae3f[_0x9f0a('0xa0')]();_0x5a004d[_0x9f0a('0xb')](_0x9f0a('0xa1'));_0x5a004d[_0x9f0a('0xb')](_0x9f0a('0x79'),'unreadMessages');var _0x447900=utils[_0x9f0a('0xa2')](_0x57d20c);if(!_[_0x9f0a('0xa3')](_0x447900)){_0x5a004d[_0x9f0a('0x18')]('t.id\x20IN\x20?',_0x447900);}var _0x420f61={'type':db[_0x9f0a('0x70')][_0x9f0a('0x71')][_0x9f0a('0x72')],'raw':!![]};return db['sequelize'][_0x9f0a('0x74')](_0x5a004d[_0x9f0a('0x75')](),_0x420f61);}module[_0x9f0a('0xa4')]={'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 ca9ff18..257676c 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 _0x6634=['plainBody','lastMsgText','trimStart','catch','updateInteraction','then','TagIds','Tags','lodash','split','forEach','push','waiting','talking','answered','unmanaged','abandoned','UserId','total','findOne','out','-id'];(function(_0x3e8428,_0x1763d9){var _0x4f408d=function(_0x2b0aac){while(--_0x2b0aac){_0x3e8428['push'](_0x3e8428['shift']());}};_0x4f408d(++_0x1763d9);}(_0x6634,0x110));var _0x4663=function(_0xaa8595,_0xcfe9ac){_0xaa8595=_0xaa8595-0x0;var _0x303a38=_0x6634[_0xaa8595];return _0x303a38;};'use strict';var _=require(_0x4663('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x5ebb77,_0x383181){return new Promise(function(_0x234711,_0xbb323b){try{var _0x5180ab=[];if(_0x383181[_0x5ebb77]){_0x5180ab=_0x383181[_0x5ebb77]['map'](function(_0x3bc6a1){return{'id':_0x3bc6a1['id'],'fullname':_0x3bc6a1['fullname']};});}return _0x234711(_0x5180ab);}catch(_0x3d238c){_0xbb323b(_0x3d238c);}});}function getInteractionTags(_0x3bcd94,_0xbe0ec2){var _0x3829ad=[];if(_0x3bcd94){_0x3bcd94[_0x4663('0x1')](',')[_0x4663('0x2')](function(_0x4108aa){_0x3829ad[_0x4663('0x3')](_0xbe0ec2[_0x4108aa]);});}return _0x3829ad;}function updateWaitingCounter(_0x40d721){if(_0x40d721[_0x4663('0x4')]){_0x40d721[_0x4663('0x4')]-=0x1;}}function updateInteractionCounters(_0x1750e1){_0x1750e1[_0x4663('0x4')]=0x0;_0x1750e1[_0x4663('0x5')]=0x0;_0x1750e1[_0x4663('0x6')]=0x0;_0x1750e1[_0x4663('0x7')]=0x0;_0x1750e1[_0x4663('0x8')]=0x0;_0x1750e1['total']=0x0;if(_0x1750e1['closed']){if(_0x1750e1['disposition']===_0x4663('0x8')){_0x1750e1[_0x4663('0x8')]+=0x1;updateWaitingCounter(_0x1750e1);}if(_0x1750e1[_0x4663('0x9')]){_0x1750e1['answered']+=0x1;if(_0x1750e1['talking']){_0x1750e1[_0x4663('0x5')]-=0x1;}}else{if(_0x1750e1['disposition']){_0x1750e1[_0x4663('0x7')]+=0x1;updateWaitingCounter(_0x1750e1);}}}else{if(!_0x1750e1[_0x4663('0x9')]){_0x1750e1[_0x4663('0x4')]+=0x1;}if(_0x1750e1[_0x4663('0x9')]){_0x1750e1[_0x4663('0x5')]+=0x1;updateWaitingCounter(_0x1750e1);}}_0x1750e1[_0x4663('0xa')]+=0x1;return _0x1750e1;}function getLastMessageText(_0x53a91b){return db['MailMessage'][_0x4663('0xb')]({'where':{'$and':[{'MailInteractionId':_0x53a91b['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x4663('0xc')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x4663('0xd'),'raw':!![]})['then'](function(_0x3bf190){if(_0x3bf190&&_0x3bf190[_0x4663('0xe')]){_0x53a91b[_0x4663('0xf')]=_[_0x4663('0x10')](_0x3bf190['plainBody']);}return _0x53a91b;})[_0x4663('0x11')](function(_0x1189d8){throw _0x1189d8;});}exports[_0x4663('0x12')]=function(_0xe765a6,_0x443b45,_0x591e2c,_0x2dbd22){return new Promise(function(_0x422f2c,_0x17c771){return getInteractionUsers(_0xe765a6['id'],_0x591e2c)[_0x4663('0x13')](function(_0xbc2324){_0xe765a6['Users']=_0xbc2324;return getInteractionTags(_0xe765a6[_0x4663('0x14')],_0x443b45);})[_0x4663('0x13')](function(_0x5e748e){_0xe765a6[_0x4663('0x15')]=_0x5e748e;delete _0xe765a6[_0x4663('0x14')];return updateInteractionCounters(_0xe765a6);})[_0x4663('0x13')](function(_0x100788){if(_0x2dbd22){return getLastMessageText(_0x100788);}else{return _0x100788;}})[_0x4663('0x13')](function(_0x418404){_0x422f2c(_0x418404);})[_0x4663('0x11')](function(_0x188011){_0x17c771(_0x188011);});});}; \ No newline at end of file +var _0xa178=['MailMessage','findOne','plainBody','-id','then','lastMsgText','trimStart','updateInteraction','Users','TagIds','Tags','catch','lodash','../../mysqldb','map','split','forEach','waiting','talking','answered','total','closed','disposition','UserId','unmanaged'];(function(_0x5d8c47,_0x2626ba){var _0x28d478=function(_0x4a80d7){while(--_0x4a80d7){_0x5d8c47['push'](_0x5d8c47['shift']());}};_0x28d478(++_0x2626ba);}(_0xa178,0x1e7));var _0x8a17=function(_0xe809b,_0xe026db){_0xe809b=_0xe809b-0x0;var _0x20aaf2=_0xa178[_0xe809b];return _0x20aaf2;};'use strict';var _=require(_0x8a17('0x0'));var db=require(_0x8a17('0x1'))['db'];function getInteractionUsers(_0x36f829,_0x20d490){return new Promise(function(_0x3161eb,_0x5a0569){try{var _0x55febf=[];if(_0x20d490[_0x36f829]){_0x55febf=_0x20d490[_0x36f829][_0x8a17('0x2')](function(_0x425090){return{'id':_0x425090['id'],'fullname':_0x425090['fullname']};});}return _0x3161eb(_0x55febf);}catch(_0x9a1fac){_0x5a0569(_0x9a1fac);}});}function getInteractionTags(_0x855bb3,_0x1893b8){var _0x3ccb7b=[];if(_0x855bb3){_0x855bb3[_0x8a17('0x3')](',')[_0x8a17('0x4')](function(_0x232dfa){_0x3ccb7b['push'](_0x1893b8[_0x232dfa]);});}return _0x3ccb7b;}function updateWaitingCounter(_0x445526){if(_0x445526[_0x8a17('0x5')]){_0x445526[_0x8a17('0x5')]-=0x1;}}function updateInteractionCounters(_0x437f24){_0x437f24[_0x8a17('0x5')]=0x0;_0x437f24[_0x8a17('0x6')]=0x0;_0x437f24[_0x8a17('0x7')]=0x0;_0x437f24['unmanaged']=0x0;_0x437f24['abandoned']=0x0;_0x437f24[_0x8a17('0x8')]=0x0;if(_0x437f24[_0x8a17('0x9')]){if(_0x437f24[_0x8a17('0xa')]==='abandoned'){_0x437f24['abandoned']+=0x1;updateWaitingCounter(_0x437f24);}if(_0x437f24[_0x8a17('0xb')]){_0x437f24[_0x8a17('0x7')]+=0x1;if(_0x437f24['talking']){_0x437f24['talking']-=0x1;}}else{if(_0x437f24['disposition']){_0x437f24[_0x8a17('0xc')]+=0x1;updateWaitingCounter(_0x437f24);}}}else{if(!_0x437f24[_0x8a17('0xb')]){_0x437f24[_0x8a17('0x5')]+=0x1;}if(_0x437f24[_0x8a17('0xb')]){_0x437f24[_0x8a17('0x6')]+=0x1;updateWaitingCounter(_0x437f24);}}_0x437f24[_0x8a17('0x8')]+=0x1;return _0x437f24;}function getLastMessageText(_0x44401e){return db[_0x8a17('0xd')][_0x8a17('0xe')]({'where':{'$and':[{'MailInteractionId':_0x44401e['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x8a17('0xf')],'order':_0x8a17('0x10'),'raw':!![]})[_0x8a17('0x11')](function(_0x3a3d98){if(_0x3a3d98&&_0x3a3d98[_0x8a17('0xf')]){_0x44401e[_0x8a17('0x12')]=_[_0x8a17('0x13')](_0x3a3d98['plainBody']);}return _0x44401e;})['catch'](function(_0x2c46b7){throw _0x2c46b7;});}exports[_0x8a17('0x14')]=function(_0x20a455,_0x2bb1cd,_0x30ce99,_0xf424d){return new Promise(function(_0x2b31cf,_0x1c6aae){return getInteractionUsers(_0x20a455['id'],_0x30ce99)[_0x8a17('0x11')](function(_0x3edbca){_0x20a455[_0x8a17('0x15')]=_0x3edbca;return getInteractionTags(_0x20a455[_0x8a17('0x16')],_0x2bb1cd);})[_0x8a17('0x11')](function(_0x52c969){_0x20a455[_0x8a17('0x17')]=_0x52c969;delete _0x20a455[_0x8a17('0x16')];return updateInteractionCounters(_0x20a455);})[_0x8a17('0x11')](function(_0x567f6f){if(_0xf424d){return getLastMessageText(_0x567f6f);}else{return _0x567f6f;}})['then'](function(_0x332062){_0x2b31cf(_0x332062);})[_0x8a17('0x18')](function(_0x417c5d){_0x1c6aae(_0x417c5d);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 66ae463..4211516 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 _0x79c0=['then','info','catch','exports','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','Website','Account','InteractionId','upperFirst','chat','websites','_interactions','user_has_','isArray','toLowerCase','toUpperCase','name','role','stringify','null','Interaction','update'];(function(_0x1027d0,_0x500caf){var _0x52aec9=function(_0x34f758){while(--_0x34f758){_0x1027d0['push'](_0x1027d0['shift']());}};_0x52aec9(++_0x500caf);}(_0x79c0,0x17d));var _0x079c=function(_0x569eb4,_0x1e548b){_0x569eb4=_0x569eb4-0x0;var _0x5ae7bf=_0x79c0[_0x569eb4];return _0x5ae7bf;};'use strict';var _=require('lodash');var db=require(_0x079c('0x0'))['db'];var loggers={'openchannel':require(_0x079c('0x1'))(_0x079c('0x2')),'mail':require(_0x079c('0x1'))('mail-interactions'),'fax':require('../../config/logger')(_0x079c('0x3')),'sms':require(_0x079c('0x1'))(_0x079c('0x4')),'chat':require('../../config/logger')(_0x079c('0x5')),'whatsapp':require(_0x079c('0x1'))(_0x079c('0x6'))};function getAccountFK(_0x42bb8b){return _[_0x079c('0x7')](_0x42bb8b)+(_0x42bb8b==='chat'?_0x079c('0x8'):_0x079c('0x9'))+'Id';}function getInteractionFK(_0x4aa0c){return _['capitalize'](_0x4aa0c)+_0x079c('0xa');}function getInteractionId(_0x2e5c63,_0x21db76,_0x230c63){if(_0x2e5c63&&_0x2e5c63[_[_0x079c('0xb')](_0x230c63)+_0x079c('0xa')]){return _0x2e5c63[_[_0x079c('0xb')](_0x230c63)+_0x079c('0xa')];}else if(_0x2e5c63&&_0x2e5c63['id']){return _0x2e5c63['id'];}else if(_0x21db76&&_0x21db76['id']){return _0x21db76['id'];}else{return'unknown';}}function getInteractionsTables(_0x6fe043){return{'accounts':_0x6fe043+'_'+(_0x6fe043===_0x079c('0xc')?_0x079c('0xd'):'accounts'),'interactions':_0x6fe043+_0x079c('0xe'),'interactionsTags':_0x6fe043+'_interaction_has_tags','messages':_0x6fe043+'_messages','userInteractions':_0x079c('0xf')+_0x6fe043+_0x079c('0xe')};}function getSelectedTags(_0x32c065){var _0x174468=[];if(_0x32c065){_0x174468=Array[_0x079c('0x10')](_0x32c065)?_0x32c065:[_0x32c065];}return _0x174468;}function log(_0x24403f,_0x46d21b,_0x23847b,_0xea157b,_0x399b1a,_0x3af43c){loggers[_0x399b1a[_0x079c('0x11')]()][_0x24403f]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3af43c[_0x079c('0x12')](),_0x46d21b?_0x46d21b['id']:null,_0x46d21b?_0x46d21b[_0x079c('0x13')]:null,_0x46d21b?_0x46d21b[_0x079c('0x14')]:null,getInteractionId(_0x23847b,_0xea157b,_0x399b1a),_0x23847b?JSON[_0x079c('0x15')](_0x23847b):_0x079c('0x16'));}function updateUser(_0x205674,_0x498ed2,_0x215303,_0x34ad72,_0x49a0d1){db[_[_0x079c('0xb')](_0x34ad72)+_0x079c('0x17')]['findOne']({'where':{'id':getInteractionId(_0x498ed2,_0x215303,_0x34ad72)}})['then'](function(_0x5f64fb){if(_0x5f64fb){return _0x5f64fb[_0x079c('0x18')]({'UserId':_0x205674?_0x205674['id']:null});}})[_0x079c('0x19')](function(_0x5554ad){if(_0x5554ad){log(_0x079c('0x1a'),_0x205674,_0x498ed2,_0x215303,_0x34ad72,_0x49a0d1);}})[_0x079c('0x1b')](function(){log('error',_0x205674,_0x498ed2,_0x215303,_0x34ad72,_0x49a0d1);});}module[_0x079c('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xc30b=['Interaction','findOne','then','update','catch','error','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','chat','Website','Account','capitalize','InteractionId','upperFirst','unknown','accounts','_interactions','_interaction_has_tags','_messages','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xc30b,0x86));var _0xbc30=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xc30b[_0x29d94e];return _0x106237;};'use strict';var _=require(_0xbc30('0x0'));var db=require(_0xbc30('0x1'))['db'];var loggers={'openchannel':require(_0xbc30('0x2'))(_0xbc30('0x3')),'mail':require('../../config/logger')(_0xbc30('0x4')),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0xbc30('0x2'))(_0xbc30('0x5')),'chat':require('../../config/logger')(_0xbc30('0x6')),'whatsapp':require(_0xbc30('0x2'))('whatsapp-interactions')};function getAccountFK(_0x416226){return _['capitalize'](_0x416226)+(_0x416226===_0xbc30('0x7')?_0xbc30('0x8'):_0xbc30('0x9'))+'Id';}function getInteractionFK(_0xfacb36){return _[_0xbc30('0xa')](_0xfacb36)+_0xbc30('0xb');}function getInteractionId(_0x15e4d4,_0x4d2b16,_0x3ef1fb){if(_0x15e4d4&&_0x15e4d4[_[_0xbc30('0xc')](_0x3ef1fb)+'InteractionId']){return _0x15e4d4[_[_0xbc30('0xc')](_0x3ef1fb)+_0xbc30('0xb')];}else if(_0x15e4d4&&_0x15e4d4['id']){return _0x15e4d4['id'];}else if(_0x4d2b16&&_0x4d2b16['id']){return _0x4d2b16['id'];}else{return _0xbc30('0xd');}}function getInteractionsTables(_0x513144){return{'accounts':_0x513144+'_'+(_0x513144===_0xbc30('0x7')?'websites':_0xbc30('0xe')),'interactions':_0x513144+_0xbc30('0xf'),'interactionsTags':_0x513144+_0xbc30('0x10'),'messages':_0x513144+_0xbc30('0x11'),'userInteractions':'user_has_'+_0x513144+_0xbc30('0xf')};}function getSelectedTags(_0xcdcd05){var _0x12a191=[];if(_0xcdcd05){_0x12a191=Array[_0xbc30('0x12')](_0xcdcd05)?_0xcdcd05:[_0xcdcd05];}return _0x12a191;}function log(_0x46206c,_0x4873f1,_0x21d134,_0x51acb8,_0x3d3a9c,_0x3d38ce){loggers[_0x3d3a9c[_0xbc30('0x13')]()][_0x46206c](_0xbc30('0x14'),_0x3d38ce[_0xbc30('0x15')](),_0x4873f1?_0x4873f1['id']:null,_0x4873f1?_0x4873f1[_0xbc30('0x16')]:null,_0x4873f1?_0x4873f1[_0xbc30('0x17')]:null,getInteractionId(_0x21d134,_0x51acb8,_0x3d3a9c),_0x21d134?JSON[_0xbc30('0x18')](_0x21d134):_0xbc30('0x19'));}function updateUser(_0x3bb1d0,_0x1fd8f3,_0x5b5588,_0x520106,_0x521bb){db[_[_0xbc30('0xc')](_0x520106)+_0xbc30('0x1a')][_0xbc30('0x1b')]({'where':{'id':getInteractionId(_0x1fd8f3,_0x5b5588,_0x520106)}})[_0xbc30('0x1c')](function(_0x231b69){if(_0x231b69){return _0x231b69[_0xbc30('0x1d')]({'UserId':_0x3bb1d0?_0x3bb1d0['id']:null});}})[_0xbc30('0x1c')](function(_0x31f2b5){if(_0x31f2b5){log('info',_0x3bb1d0,_0x1fd8f3,_0x5b5588,_0x520106,_0x521bb);}})[_0xbc30('0x1e')](function(){log(_0xbc30('0x1f'),_0x3bb1d0,_0x1fd8f3,_0x5b5588,_0x520106,_0x521bb);});}module['exports']={'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 3a263f9..cde7cf1 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 _0x1bca=['count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','crypto','util','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','parse','hasOwnProperty','use','License','findOne','then'];(function(_0x3fafbc,_0x19087f){var _0x4d89ef=function(_0x1f469e){while(--_0x1f469e){_0x3fafbc['push'](_0x3fafbc['shift']());}};_0x4d89ef(++_0x19087f);}(_0x1bca,0xd8));var _0xa1bc=function(_0x4cb8dd,_0x4254ab){_0x4cb8dd=_0x4cb8dd-0x0;var _0x4a33d6=_0x1bca[_0x4cb8dd];return _0x4a33d6;};'use strict';var crypto=require(_0xa1bc('0x0'));var util=require(_0xa1bc('0x1'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0xa1bc('0x2'));function getValueFromLicense(_0x29f7c5,_0x557b06){if(_0x29f7c5&&_0x557b06){if(_0x557b06[_0xa1bc('0x3')]&&_0x557b06[_0xa1bc('0x4')]){var _0x49ca93=_0x557b06['data1'];var _0x22cc64=_0x557b06['license'];var _0x4597bc=_0x49ca93[_0xa1bc('0x5')]('-')[0x4];var _0x1b4633=_0x49ca93[_0xa1bc('0x5')]('-')[0x0];var _0xecadf0=crypto[_0xa1bc('0x6')](_0xa1bc('0x7'),util[_0xa1bc('0x8')](_0xa1bc('0x9'),_0x4597bc,_0x49ca93,_0x1b4633));var _0x589902=_0xecadf0[_0xa1bc('0xa')](_0x22cc64,'base64',_0xa1bc('0xb'));_0x589902+=_0xecadf0['final']('utf8');var _0x1d1625=JSON[_0xa1bc('0xc')](_0x589902);return _0x1d1625[_0xa1bc('0xd')](_0x29f7c5)?_0x1d1625[_0x29f7c5]:null;}}return null;}function isLimit(_0x38765e,_0x3c5c74,_0x13c06a,_0x2dc88e){var _0x53b0bf=_0x3c5c74;return compose()[_0xa1bc('0xe')](function(_0x528eae,_0x2e36ea,_0x2bd674){return db[_0xa1bc('0xf')][_0xa1bc('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xa1bc('0x11')](function(_0x1e1412){var _0x19be30=getValueFromLicense(_0x38765e,_0x1e1412);return _0x19be30?_0x19be30:_0x53b0bf;})[_0xa1bc('0x11')](function(_0x4d6ad9){_0x53b0bf=_0x4d6ad9;return _0x13c06a[_0xa1bc('0x12')](_0x2dc88e);})[_0xa1bc('0x11')](function(_0xfe6ef9){if(_0xfe6ef9>=_0x53b0bf){return _0x2e36ea[_0xa1bc('0x13')](0x193)['json']({'message':util[_0xa1bc('0x8')](_0xa1bc('0x14'),_0x38765e)});}_0x2bd674();})[_0xa1bc('0x15')](function(_0xdc0f11){_0x2bd674(_0xdc0f11);});});}function isUserLimit(){return isLimit(_0xa1bc('0x16'),0x1,db[_0xa1bc('0x17')],{'where':{'$or':[{'role':_0xa1bc('0x18')},{'role':_0xa1bc('0x19')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0xb952=['split','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','license'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xb952,0xf4));var _0x2b95=function(_0x47fcc5,_0x639448){_0x47fcc5=_0x47fcc5-0x0;var _0x171bdf=_0xb952[_0x47fcc5];return _0x171bdf;};'use strict';var crypto=require(_0x2b95('0x0'));var util=require(_0x2b95('0x1'));var compose=require(_0x2b95('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x2b95('0x3'));function getValueFromLicense(_0x3924f1,_0x2df142){if(_0x3924f1&&_0x2df142){if(_0x2df142[_0x2b95('0x4')]&&_0x2df142[_0x2b95('0x5')]){var _0x2248b5=_0x2df142[_0x2b95('0x4')];var _0x4f69c6=_0x2df142['license'];var _0x3ce211=_0x2248b5[_0x2b95('0x6')]('-')[0x4];var _0x116c1d=_0x2248b5[_0x2b95('0x6')]('-')[0x0];var _0x5b9c43=crypto['createDecipher']('aes-256-ctr',util['format'](_0x2b95('0x7'),_0x3ce211,_0x2248b5,_0x116c1d));var _0x6ec316=_0x5b9c43[_0x2b95('0x8')](_0x4f69c6,_0x2b95('0x9'),_0x2b95('0xa'));_0x6ec316+=_0x5b9c43[_0x2b95('0xb')](_0x2b95('0xa'));var _0x2fec3d=JSON[_0x2b95('0xc')](_0x6ec316);return _0x2fec3d[_0x2b95('0xd')](_0x3924f1)?_0x2fec3d[_0x3924f1]:null;}}return null;}function isLimit(_0x2b9859,_0x2d279b,_0x3cab36,_0x4e0e44){var _0x13e659=_0x2d279b;return compose()['use'](function(_0xf08094,_0x542adb,_0x1be893){return db[_0x2b95('0xe')][_0x2b95('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x2b95('0x10')](function(_0x245c98){var _0x573e4b=getValueFromLicense(_0x2b9859,_0x245c98);return _0x573e4b?_0x573e4b:_0x13e659;})[_0x2b95('0x10')](function(_0x2c2ebf){_0x13e659=_0x2c2ebf;return _0x3cab36['count'](_0x4e0e44);})[_0x2b95('0x10')](function(_0x178345){if(_0x178345>=_0x13e659){return _0x542adb[_0x2b95('0x11')](0x193)[_0x2b95('0x12')]({'message':util['format'](_0x2b95('0x13'),_0x2b9859)});}_0x1be893();})['catch'](function(_0x86ef01){_0x1be893(_0x86ef01);});});}function isUserLimit(){return isLimit(_0x2b95('0x14'),0x1,db[_0x2b95('0x15')],{'where':{'$or':[{'role':_0x2b95('0x16')},{'role':_0x2b95('0x17')}]}});}exports[_0x2b95('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 82a4421..c1a8d76 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 _0x173d=['operator','$eq','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','lodash','moment','parseSearch','startsWith','and','[$and]','replace','[$or]','split','length','forEach','shift','match','filter','indexOf','conditions','DATE'];(function(_0x117499,_0x4d5c45){var _0x4bcebf=function(_0x4f2ebc){while(--_0x4f2ebc){_0x117499['push'](_0x117499['shift']());}};_0x4bcebf(++_0x4d5c45);}(_0x173d,0x162));var _0xd173=function(_0x1ea20e,_0x238b3d){_0x1ea20e=_0x1ea20e-0x0;var _0x1992d2=_0x173d[_0x1ea20e];return _0x1992d2;};'use strict';var _=require(_0xd173('0x0'));var moment=require(_0xd173('0x1'));exports[_0xd173('0x2')]=function(_0x5df6d6){var _0x40a191={'conditions':[]};_0x40a191['sqlOperator']=_[_0xd173('0x3')](_0x5df6d6,'[$or]')?'or':_0xd173('0x4');var _0x5d22ba=_0x5df6d6['replace'](_0xd173('0x5'),'')[_0xd173('0x6')](_0xd173('0x7'),'')[_0xd173('0x8')]('||');for(var _0x5c327e=0x0;_0x5c327e<_0x5d22ba[_0xd173('0x9')];_0x5c327e++){var _0x1a220d=_0x5d22ba[_0x5c327e]['split'](':=');var _0x2b9fdf=_0x1a220d[0x0];var _0x36bdb3=_0x1a220d['slice'](0x1);_0x36bdb3[_0xd173('0xa')](function(_0x25a94a){var _0x38ec08=_0x25a94a[_0xd173('0x8')]('[')[_0xd173('0xb')]();var _0x285329=_0x25a94a[_0xd173('0xc')](/\[(.*?)\]/g);_0x285329[_0xd173('0xa')](function(_0x5ce4f0){var _0x18552c=_0x5ce4f0[_0xd173('0x8')]('[')[_0xd173('0xd')](function(_0x12bc77){return _0x12bc77[_0xd173('0xe')](']')>-0x1;})['map'](function(_0x557d73){return _0x557d73[_0xd173('0x8')](']')[0x0];})[0x0];_0x40a191[_0xd173('0xf')]['push']({'field':_0x2b9fdf,'operator':_0x38ec08,'value':_0x18552c});});});}return _0x40a191;};exports['buildExpression']=function(_0x358dbe,_0x1d76cf,_0xa44b1b){var _0x1204e4={};if(_0x1d76cf===_0xd173('0x10')){if(_0xa44b1b[_0xd173('0x11')]===_0xd173('0x12')){_0xa44b1b[_0xd173('0x11')]=_0xd173('0x13');_0xa44b1b[_0xd173('0x14')]+=','+_0xa44b1b['value'];}else if(_[_0xd173('0x15')]([_0xd173('0x16'),_0xd173('0x17')],_0xa44b1b[_0xd173('0x11')])){_0xa44b1b['value']=moment(_0xa44b1b['value'])[_0xd173('0x18')](0x1,_0xd173('0x19'))[_0xd173('0x1a')](_0xd173('0x1b'));}}if(_0xa44b1b[_0xd173('0x1c')]){_0x1d76cf=_0xa44b1b[_0xd173('0x1c')];_0x1204e4[_0xd173('0x1d')]=_0xd173('0x1e')+_0x358dbe+'.'+_0xa44b1b[_0xd173('0x1f')]+'\x20AS\x20'+_0xa44b1b[_0xd173('0x1c')]+')\x20'+parseOperator(_0xa44b1b[_0xd173('0x11')]);}else{_0x1204e4[_0xd173('0x1d')]=_0x358dbe+'.'+_0xa44b1b[_0xd173('0x1f')]+'\x20'+parseOperator(_0xa44b1b[_0xd173('0x11')]);}if(_[_0xd173('0x15')](['$ne',_0xd173('0x20')],_0xa44b1b[_0xd173('0x11')]))_0x1204e4['text']='('+_0x1204e4[_0xd173('0x1d')]+_0xd173('0x21')+_0x358dbe+'.'+_0xa44b1b['field']+_0xd173('0x22');_0x1204e4[_0xd173('0x14')]=parseValue(_0x1d76cf,_0xa44b1b[_0xd173('0x11')],_0xa44b1b['value']);return _0x1204e4;};function parseOperator(_0x3d523f){var _0x427cbe;switch(_0x3d523f){case _0xd173('0x23'):_0x427cbe=_0xd173('0x24');break;case _0xd173('0x20'):_0x427cbe=_0xd173('0x25');break;case'$eq':_0x427cbe=_0xd173('0x26');break;case'$ne':_0x427cbe='<>\x20?';break;case _0xd173('0x27'):case _0xd173('0x28'):case _0xd173('0x29'):_0x427cbe=_0xd173('0x2a');break;case'$lt':_0x427cbe=_0xd173('0x2b');break;case _0xd173('0x16'):_0x427cbe=_0xd173('0x2c');break;case _0xd173('0x17'):_0x427cbe=_0xd173('0x2d');break;case _0xd173('0x2e'):_0x427cbe='>=\x20?';break;case _0xd173('0x13'):_0x427cbe=_0xd173('0x2f');break;}return _0x427cbe;}function parseValue(_0x4b3a74,_0x513933,_0x510e4e){var _0x2b9182={'start':undefined,'end':undefined};switch(_0x513933){case _0xd173('0x23'):case _0xd173('0x20'):_0x2b9182['start']=_0x510e4e[_0xd173('0x8')](',');break;case _0xd173('0x27'):_0x2b9182[_0xd173('0x30')]='%'+_0x510e4e+'%';break;case _0xd173('0x28'):_0x2b9182[_0xd173('0x30')]=_0x510e4e+'%';break;case _0xd173('0x29'):_0x2b9182[_0xd173('0x30')]='%'+_0x510e4e;break;case _0xd173('0x13'):var _0x1cb9c9=_0x510e4e[_0xd173('0x8')](',');var _0x510e4e=_0x1cb9c9[_0xd173('0xb')]();var _0x550a6e=_0x1cb9c9[_0xd173('0x31')]();if(_0x4b3a74==='DATE'){_0x510e4e=moment(_0x510e4e)[_0xd173('0x32')](0x0,!![])[_0xd173('0x1a')]();_0x550a6e=moment(_0x550a6e)[_0xd173('0x32')](0x0,!![])[_0xd173('0x18')](0x17,_0xd173('0x33'))[_0xd173('0x18')](0x3b,_0xd173('0x34'))['add'](0x3b,'seconds')[_0xd173('0x1a')]();}_0x2b9182={'start':_0x510e4e,'end':_0x550a6e};break;default:_0x2b9182[_0xd173('0x30')]=_0x510e4e;break;}return _0x2b9182;} \ No newline at end of file +var _0x5ed0=['>\x20?','<=\x20?','>=\x20?','start','pop','utcOffset','add','hours','minutes','seconds','lodash','moment','parseSearch','startsWith','[$or]','[$and]','split','length','slice','forEach','shift','match','indexOf','push','buildExpression','operator','$eq','$between','value','includes','$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt'];(function(_0x1b926c,_0x4d9682){var _0x357c10=function(_0x4e3044){while(--_0x4e3044){_0x1b926c['push'](_0x1b926c['shift']());}};_0x357c10(++_0x4d9682);}(_0x5ed0,0xe2));var _0x05ed=function(_0x2e19cc,_0xf83ff1){_0x2e19cc=_0x2e19cc-0x0;var _0x3be05a=_0x5ed0[_0x2e19cc];return _0x3be05a;};'use strict';var _=require(_0x05ed('0x0'));var moment=require(_0x05ed('0x1'));exports[_0x05ed('0x2')]=function(_0xd88d78){var _0x54d01b={'conditions':[]};_0x54d01b['sqlOperator']=_[_0x05ed('0x3')](_0xd88d78,_0x05ed('0x4'))?'or':'and';var _0x208a08=_0xd88d78['replace'](_0x05ed('0x5'),'')['replace']('[$or]','')[_0x05ed('0x6')]('||');for(var _0x12c6c4=0x0;_0x12c6c4<_0x208a08[_0x05ed('0x7')];_0x12c6c4++){var _0x254624=_0x208a08[_0x12c6c4][_0x05ed('0x6')](':=');var _0x13c03e=_0x254624[0x0];var _0x889b3=_0x254624[_0x05ed('0x8')](0x1);_0x889b3[_0x05ed('0x9')](function(_0x4299df){var _0x40d02a=_0x4299df[_0x05ed('0x6')]('[')[_0x05ed('0xa')]();var _0x37ac08=_0x4299df[_0x05ed('0xb')](/\[(.*?)\]/g);_0x37ac08['forEach'](function(_0x4bf4d8){var _0xb239c9=_0x4bf4d8[_0x05ed('0x6')]('[')['filter'](function(_0x5e25a1){return _0x5e25a1[_0x05ed('0xc')](']')>-0x1;})['map'](function(_0x579716){return _0x579716['split'](']')[0x0];})[0x0];_0x54d01b['conditions'][_0x05ed('0xd')]({'field':_0x13c03e,'operator':_0x40d02a,'value':_0xb239c9});});});}return _0x54d01b;};exports[_0x05ed('0xe')]=function(_0x527b8f,_0x219f83,_0x1c13e1){var _0x127468={};if(_0x219f83==='DATE'){if(_0x1c13e1[_0x05ed('0xf')]===_0x05ed('0x10')){_0x1c13e1[_0x05ed('0xf')]=_0x05ed('0x11');_0x1c13e1[_0x05ed('0x12')]+=','+_0x1c13e1[_0x05ed('0x12')];}else if(_[_0x05ed('0x13')](['$gt',_0x05ed('0x14')],_0x1c13e1[_0x05ed('0xf')])){_0x1c13e1[_0x05ed('0x12')]=moment(_0x1c13e1[_0x05ed('0x12')])['add'](0x1,_0x05ed('0x15'))[_0x05ed('0x16')](_0x05ed('0x17'));}}if(_0x1c13e1[_0x05ed('0x18')]){_0x219f83=_0x1c13e1[_0x05ed('0x18')];_0x127468[_0x05ed('0x19')]=_0x05ed('0x1a')+_0x527b8f+'.'+_0x1c13e1['field']+_0x05ed('0x1b')+_0x1c13e1['castTo']+')\x20'+parseOperator(_0x1c13e1['operator']);}else{_0x127468[_0x05ed('0x19')]=_0x527b8f+'.'+_0x1c13e1[_0x05ed('0x1c')]+'\x20'+parseOperator(_0x1c13e1[_0x05ed('0xf')]);}if(_[_0x05ed('0x13')]([_0x05ed('0x1d'),_0x05ed('0x1e')],_0x1c13e1[_0x05ed('0xf')]))_0x127468[_0x05ed('0x19')]='('+_0x127468['text']+_0x05ed('0x1f')+_0x527b8f+'.'+_0x1c13e1[_0x05ed('0x1c')]+_0x05ed('0x20');_0x127468[_0x05ed('0x12')]=parseValue(_0x219f83,_0x1c13e1[_0x05ed('0xf')],_0x1c13e1[_0x05ed('0x12')]);return _0x127468;};function parseOperator(_0x123dab){var _0x50743e;switch(_0x123dab){case _0x05ed('0x21'):_0x50743e='IN\x20?';break;case _0x05ed('0x1e'):_0x50743e=_0x05ed('0x22');break;case'$eq':_0x50743e=_0x05ed('0x23');break;case _0x05ed('0x1d'):_0x50743e=_0x05ed('0x24');break;case _0x05ed('0x25'):case _0x05ed('0x26'):case _0x05ed('0x27'):_0x50743e=_0x05ed('0x28');break;case _0x05ed('0x29'):_0x50743e=_0x05ed('0x2a');break;case _0x05ed('0x2b'):_0x50743e=_0x05ed('0x2c');break;case'$lte':_0x50743e=_0x05ed('0x2d');break;case'$gte':_0x50743e=_0x05ed('0x2e');break;case _0x05ed('0x11'):_0x50743e='BETWEEN\x20?\x20AND\x20?';break;}return _0x50743e;}function parseValue(_0x310512,_0x33e45c,_0x37d628){var _0x59fac7={'start':undefined,'end':undefined};switch(_0x33e45c){case _0x05ed('0x21'):case'$notIn':_0x59fac7[_0x05ed('0x2f')]=_0x37d628[_0x05ed('0x6')](',');break;case _0x05ed('0x25'):_0x59fac7[_0x05ed('0x2f')]='%'+_0x37d628+'%';break;case _0x05ed('0x26'):_0x59fac7[_0x05ed('0x2f')]=_0x37d628+'%';break;case _0x05ed('0x27'):_0x59fac7['start']='%'+_0x37d628;break;case _0x05ed('0x11'):var _0x542e80=_0x37d628['split'](',');var _0x37d628=_0x542e80['shift']();var _0x30585b=_0x542e80[_0x05ed('0x30')]();if(_0x310512==='DATE'){_0x37d628=moment(_0x37d628)[_0x05ed('0x31')](0x0,!![])[_0x05ed('0x16')]();_0x30585b=moment(_0x30585b)['utcOffset'](0x0,!![])[_0x05ed('0x32')](0x17,_0x05ed('0x33'))[_0x05ed('0x32')](0x3b,_0x05ed('0x34'))['add'](0x3b,_0x05ed('0x35'))[_0x05ed('0x16')]();}_0x59fac7={'start':_0x37d628,'end':_0x30585b};break;default:_0x59fac7[_0x05ed('0x2f')]=_0x37d628;break;}return _0x59fac7;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 891d7db..6a83e98 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 _0x0d9e=['order','sort','where','pick','filters','filter','object','includes','columns','lower','merge','include','includeAll','push','lodash','../../mysqldb','parse','model','raw','fields','split','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','uniqueid','limit','offset','priority','col','unsigned','substr','DESC','ASC','omit','isArray','isString','length','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','{EXPR}','forEach','replace','join','$id','query','map','name','keys','intersection','attributes','hasOwnProperty','nolimit'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0x0d9e,0x18e));var _0xe0d9=function(_0x417db5,_0x33bf59){_0x417db5=_0x417db5-0x0;var _0x1f89be=_0x0d9e[_0x417db5];return _0x1f89be;};'use strict';var _=require(_0xe0d9('0x0'));var sequelize=require('sequelize');var moment=require('moment');var db=require(_0xe0d9('0x1'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x569c26){var _0x53fddd=['ne'];try{var _0x7aee70=JSON[_0xe0d9('0x2')](_0x569c26);var _0x13b341=Object['keys'](_0x7aee70)[0x0];return _0x53fddd['includes'](_0x13b341);}catch(_0x428a21){return![];}}function getOperatorValue(_0x4f02db){var _0x33ff26=JSON[_0xe0d9('0x2')](_0x4f02db);var _0x1bfd71=Object['keys'](_0x33ff26)[0x0];var _0x664900=_0x33ff26[_0x1bfd71];return{['$'+_0x1bfd71]:_0x664900};}function parseIncludeModel(_0x3138ac){var _0x2251d6=JSON[_0xe0d9('0x2')](_0x3138ac);return{'model':db[_0x2251d6[_0xe0d9('0x3')]],'as':_0x2251d6['alias'],'attributes':_0x2251d6['fields'],'raw':_0x2251d6[_0xe0d9('0x4')]};}exports[_0xe0d9('0x5')]=function(_0x2d4357){var _0x5b13d5=null;if(_0x2d4357){_0x5b13d5=_0x2d4357[_0xe0d9('0x6')](',');}return _0x5b13d5;};exports['filters']=function(_0x4512c0,_0x22c5e5){var _0x6fef7e={};if(!_[_0xe0d9('0x7')](_0x4512c0)){_[_0xe0d9('0x8')](_0x4512c0,function(_0x3888c9,_0x431ad5){try{if(_0x22c5e5){var _0x1e42d7=_[_0xe0d9('0x9')](_0x22c5e5,{'name':_0x431ad5})||{};if(hasSequelizeOperator(_0x3888c9)){_0x6fef7e[_0x431ad5]=getOperatorValue(_0x3888c9);}else if(_0x1e42d7[_0xe0d9('0xa')]===_0xe0d9('0xb')&&_[_0xe0d9('0xc')](_0x3888c9)){var _0x403e38=JSON[_0xe0d9('0x2')](_0x3888c9);var _0xc6671={'$gte':moment(moment(_0x403e38[_0xe0d9('0xd')])[_0xe0d9('0xe')](_0xe0d9('0xf')))[_0xe0d9('0x10')]()['format'](),'$lte':moment(moment(_0x403e38[_0xe0d9('0x11')])[_0xe0d9('0xe')](_0xe0d9('0xf')))[_0xe0d9('0x10')]()[_0xe0d9('0x12')](0x1,'s')[_0xe0d9('0xe')]()};_0x6fef7e[_0x431ad5]=_0xc6671;}else if(_0x1e42d7['name']===_0xe0d9('0x13')){_0x6fef7e[_0x431ad5]=_0x3888c9;}else{_0x6fef7e[_0x431ad5]=_['isArray'](_0x3888c9)?_0x3888c9:JSON[_0xe0d9('0x2')](_0x3888c9);}}else{_0x6fef7e[_0x431ad5]=_['isArray'](_0x3888c9)?_0x3888c9:JSON[_0xe0d9('0x2')](_0x3888c9);}}catch(_0x2c1d9e){_0x6fef7e[_0x431ad5]=_0x3888c9[_0xe0d9('0x6')](',');}});}return _0x6fef7e;};exports[_0xe0d9('0x14')]=function(_0x1de545){_0x1de545=parseInt(_0x1de545,0xa);if(!_0x1de545||_0x1de545<0x0){_0x1de545=LIMIT_VALUE;}return _0x1de545;};exports[_0xe0d9('0x15')]=function(_0x503dbd){_0x503dbd=parseInt(_0x503dbd,0xa);if(!_0x503dbd||_0x503dbd<0x0){_0x503dbd=0x0;}return _0x503dbd;};exports['sort']=function(_0x47367f){var _0x3183c5,_0x25a21b=null;if(_0x47367f){_0x3183c5=_0x47367f[_0xe0d9('0x6')](',');_0x25a21b=_['map'](_0x3183c5,function(_0x15304a){if(_0x15304a['indexOf']('-')===0x0){return[_0x15304a===_0xe0d9('0x16')?sequelize['cast'](sequelize[_0xe0d9('0x17')](_0xe0d9('0x16')),_0xe0d9('0x18')):_0x15304a[_0xe0d9('0x19')](0x1),_0xe0d9('0x1a')];}else{return[_0x15304a===_0xe0d9('0x16')?sequelize['cast'](sequelize[_0xe0d9('0x17')](_0xe0d9('0x16')),_0xe0d9('0x18')):_0x15304a,_0xe0d9('0x1b')];}});}return _0x25a21b;};exports[_0xe0d9('0x1c')]=function(_0x4f5e6c,_0x165bd9){if(_['isEmpty'](_0x4f5e6c)){return _0x4f5e6c;}if(_[_0xe0d9('0x1d')](_0x4f5e6c)){for(var _0x365fec=0x0;_0x365fec<_0x4f5e6c['length'];_0x365fec+=0x1){_0x4f5e6c[_0x365fec]=this['omit'](_0x4f5e6c[_0x365fec],_0x165bd9);}return _0x4f5e6c;}if(!_['isObject'](_0x4f5e6c)){return _0x4f5e6c;}if(_[_0xe0d9('0x1e')](_0x165bd9)){_0x165bd9=[_0x165bd9];}if(!_[_0xe0d9('0x1d')](_0x165bd9)){return _0x4f5e6c;}for(var _0x533de2=0x0;_0x533de2<_0x165bd9[_0xe0d9('0x1f')];_0x533de2+=0x1){_['unset'](_0x4f5e6c,_0x165bd9[_0x533de2]);}for(var _0x52d291 in _0x4f5e6c){if(_0x4f5e6c['hasOwnProperty'](_0x52d291)){_0x4f5e6c[_0x52d291]=this['omit'](_0x4f5e6c[_0x52d291],_0x165bd9);}}return _0x4f5e6c;};exports[_0xe0d9('0x20')]=function(_0x4c9fea){return _0x4c9fea[_0xe0d9('0x21')](RegExp(_0xe0d9('0x22')))?!![]:![];};exports[_0xe0d9('0x23')]=function(_0x4caa88){return _0x4caa88['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xe0d9('0x24')]=function(_0x376dbf,_0x519bc8){var _0x277190=[];var _0x419ba5=/[ `!@#$%^&*()_\-?~]/;var _0xc737a2=_0x519bc8?'\x22{EXPR}\x22':_0xe0d9('0x25');_0x376dbf[_0xe0d9('0x6')](/[ ,]+/)[_0xe0d9('0x26')](function(_0x3455ba){_0x3455ba=_0x3455ba[_0xe0d9('0x27')](/([^:]")"+/g,'$1');_0x3455ba='+'+_0x3455ba+'*';var _0x385243=_0x3455ba[_0xe0d9('0x21')](_0x419ba5);if(_0x385243){_0x3455ba='\x22'+_0x3455ba+'\x22';}_0x277190['push'](_0x3455ba);});_0xc737a2=_0xc737a2[_0xe0d9('0x27')](_0xe0d9('0x25'),_0x277190[_0xe0d9('0x28')]('\x20'));return _0xc737a2;};exports['getOptions']=function(_0x4f3acc,_0x47d21d,_0x48a046){var _0xda9f94={},_0x3cbac4={};if(_0x47d21d['query'][_0xe0d9('0x29')]){_0x47d21d['query']['id']=_0x47d21d[_0xe0d9('0x2a')][_0xe0d9('0x29')];delete _0x47d21d[_0xe0d9('0x2a')]['$id'];}_0xda9f94[_0xe0d9('0x3')]=_[_0xe0d9('0x2b')](_0x4f3acc,_0xe0d9('0x2c'));_0xda9f94[_0xe0d9('0x2a')]=_[_0xe0d9('0x2d')](_0x47d21d[_0xe0d9('0x2a')]);_0xda9f94['filters']=_[_0xe0d9('0x2e')](_0xda9f94['model'],_0xda9f94[_0xe0d9('0x2a')]);_0x3cbac4[_0xe0d9('0x2f')]=_[_0xe0d9('0x2e')](_0xda9f94[_0xe0d9('0x3')],this[_0xe0d9('0x5')](_0x47d21d['query'][_0xe0d9('0x5')]));_0x3cbac4[_0xe0d9('0x2f')]=_0x3cbac4[_0xe0d9('0x2f')][_0xe0d9('0x1f')]?_0x3cbac4['attributes']:_0xda9f94[_0xe0d9('0x3')];if(!_0x47d21d['query'][_0xe0d9('0x30')](_0xe0d9('0x31'))){_0x3cbac4['limit']=this[_0xe0d9('0x14')](_0x47d21d[_0xe0d9('0x2a')]['limit']);_0x3cbac4[_0xe0d9('0x15')]=this[_0xe0d9('0x15')](_0x47d21d[_0xe0d9('0x2a')][_0xe0d9('0x15')]);}_0x3cbac4[_0xe0d9('0x32')]=this[_0xe0d9('0x33')](_0x47d21d[_0xe0d9('0x2a')][_0xe0d9('0x33')]);_0x3cbac4[_0xe0d9('0x34')]=this['filters'](_[_0xe0d9('0x35')](_0x47d21d[_0xe0d9('0x2a')],_0xda9f94[_0xe0d9('0x36')]),_0x4f3acc);if(_0x47d21d[_0xe0d9('0x2a')][_0xe0d9('0x37')]){var _0x2227e8=_0x4f3acc;var _0xe3c57c=_0x47d21d[_0xe0d9('0x2a')]['filter'];if(typeof _0xe3c57c===_0xe0d9('0x38')){_0x2227e8=_[_0xe0d9('0x37')](_0x4f3acc,function(_0x5dff95){return _[_0xe0d9('0x39')](_0xe3c57c[_0xe0d9('0x3a')],_0x5dff95[_0xe0d9('0x2c')]);});_0xe3c57c=_0xe3c57c['value'];}_0x3cbac4[_0xe0d9('0x34')]=_['merge'](_0x3cbac4[_0xe0d9('0x34')],{'$or':_['map'](_0x2227e8,function(_0x4cd9b8){if(_0x4cd9b8[_0xe0d9('0xa')]!=='VIRTUAL'){if(_0x48a046){return sequelize[_0xe0d9('0x34')](sequelize['fn']('lower',sequelize[_0xe0d9('0x17')](_0x4cd9b8[_0xe0d9('0x2c')])),{'$like':sequelize['fn'](_0xe0d9('0x3b'),'%'+_0x47d21d[_0xe0d9('0x2a')][_0xe0d9('0x37')]+'%')});}else{var _0x492361={};_0x492361[_0x4cd9b8['name']]={'$like':'%'+_0x47d21d[_0xe0d9('0x2a')][_0xe0d9('0x37')]+'%'};return _0x492361;}}})});}_0x3cbac4=_[_0xe0d9('0x3c')]({},_0x3cbac4,_0x47d21d['options']);return _0x3cbac4;};exports[_0xe0d9('0x3d')]=function(_0x1e26f5){var _0x544d6b=[];if(_0x1e26f5[_0xe0d9('0x3e')]){_0x544d6b[_0xe0d9('0x3f')]({'all':!![]});}else if(_0x1e26f5[_0xe0d9('0x3d')]){if(Array[_0xe0d9('0x1d')](_0x1e26f5[_0xe0d9('0x3d')])){_0x544d6b=Object['keys'](_0x1e26f5[_0xe0d9('0x3d')])[_0xe0d9('0x2b')](function(_0x28cd3b){return parseIncludeModel(_0x1e26f5[_0xe0d9('0x3d')][_0x28cd3b]);});}else{var _0x4af787=parseIncludeModel(_0x1e26f5[_0xe0d9('0x3d')]);_0x544d6b['push'](_0x4af787);}}return _0x544d6b;}; \ No newline at end of file +var _0xcacd=['isEmpty','forOwn','find','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','uniqueid','isArray','limit','offset','sort','map','priority','cast','col','unsigned','DESC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','{EXPR}','forEach','replace','join','getOptions','query','$id','name','intersection','attributes','fields','nolimit','order','filter','object','columns','value','where','merge','type','VIRTUAL','lower','include','push','lodash','parse','includes','keys','model','alias','split','filters'];(function(_0xc163d3,_0x14778a){var _0x3832d3=function(_0xf6f81c){while(--_0xf6f81c){_0xc163d3['push'](_0xc163d3['shift']());}};_0x3832d3(++_0x14778a);}(_0xcacd,0x1bf));var _0xdcac=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xcacd[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xdcac('0x0'));var sequelize=require('sequelize');var moment=require('moment');var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x164f6a){var _0x23084d=['ne'];try{var _0x477049=JSON[_0xdcac('0x1')](_0x164f6a);var _0x3b2cc2=Object['keys'](_0x477049)[0x0];return _0x23084d[_0xdcac('0x2')](_0x3b2cc2);}catch(_0x110ad4){return![];}}function getOperatorValue(_0x208907){var _0x58af9f=JSON[_0xdcac('0x1')](_0x208907);var _0x2491e7=Object[_0xdcac('0x3')](_0x58af9f)[0x0];var _0x598f7e=_0x58af9f[_0x2491e7];return{['$'+_0x2491e7]:_0x598f7e};}function parseIncludeModel(_0x2f59c2){var _0x5574ae=JSON['parse'](_0x2f59c2);return{'model':db[_0x5574ae[_0xdcac('0x4')]],'as':_0x5574ae[_0xdcac('0x5')],'attributes':_0x5574ae['fields'],'raw':_0x5574ae['raw']};}exports['fields']=function(_0x5ac199){var _0x34e756=null;if(_0x5ac199){_0x34e756=_0x5ac199[_0xdcac('0x6')](',');}return _0x34e756;};exports[_0xdcac('0x7')]=function(_0x2f5710,_0x1e85cc){var _0xa22432={};if(!_[_0xdcac('0x8')](_0x2f5710)){_[_0xdcac('0x9')](_0x2f5710,function(_0x59fe4c,_0x21c8e0){try{if(_0x1e85cc){var _0x28d55f=_[_0xdcac('0xa')](_0x1e85cc,{'name':_0x21c8e0})||{};if(hasSequelizeOperator(_0x59fe4c)){_0xa22432[_0x21c8e0]=getOperatorValue(_0x59fe4c);}else if(_0x28d55f['type']===_0xdcac('0xb')&&_[_0xdcac('0xc')](_0x59fe4c)){var _0x452c9d=JSON[_0xdcac('0x1')](_0x59fe4c);var _0x17f077={'$gte':moment(moment(_0x452c9d[_0xdcac('0xd')])[_0xdcac('0xe')](_0xdcac('0xf')))[_0xdcac('0x10')]()[_0xdcac('0xe')](),'$lte':moment(moment(_0x452c9d[_0xdcac('0x11')])['format'](_0xdcac('0xf')))[_0xdcac('0x10')]()[_0xdcac('0x12')](0x1,'s')[_0xdcac('0xe')]()};_0xa22432[_0x21c8e0]=_0x17f077;}else if(_0x28d55f['name']===_0xdcac('0x13')){_0xa22432[_0x21c8e0]=_0x59fe4c;}else{_0xa22432[_0x21c8e0]=_[_0xdcac('0x14')](_0x59fe4c)?_0x59fe4c:JSON[_0xdcac('0x1')](_0x59fe4c);}}else{_0xa22432[_0x21c8e0]=_['isArray'](_0x59fe4c)?_0x59fe4c:JSON[_0xdcac('0x1')](_0x59fe4c);}}catch(_0x2e16a2){_0xa22432[_0x21c8e0]=_0x59fe4c[_0xdcac('0x6')](',');}});}return _0xa22432;};exports[_0xdcac('0x15')]=function(_0x1280b6){_0x1280b6=parseInt(_0x1280b6,0xa);if(!_0x1280b6||_0x1280b6<0x0){_0x1280b6=LIMIT_VALUE;}return _0x1280b6;};exports[_0xdcac('0x16')]=function(_0x1d05db){_0x1d05db=parseInt(_0x1d05db,0xa);if(!_0x1d05db||_0x1d05db<0x0){_0x1d05db=0x0;}return _0x1d05db;};exports[_0xdcac('0x17')]=function(_0x281551){var _0x63900c,_0x27fc80=null;if(_0x281551){_0x63900c=_0x281551[_0xdcac('0x6')](',');_0x27fc80=_[_0xdcac('0x18')](_0x63900c,function(_0x3c327f){if(_0x3c327f['indexOf']('-')===0x0){return[_0x3c327f===_0xdcac('0x19')?sequelize[_0xdcac('0x1a')](sequelize[_0xdcac('0x1b')](_0xdcac('0x19')),_0xdcac('0x1c')):_0x3c327f['substr'](0x1),_0xdcac('0x1d')];}else{return[_0x3c327f===_0xdcac('0x19')?sequelize[_0xdcac('0x1a')](sequelize['col'](_0xdcac('0x19')),'unsigned'):_0x3c327f,'ASC'];}});}return _0x27fc80;};exports[_0xdcac('0x1e')]=function(_0x2b320f,_0x195ca6){if(_[_0xdcac('0x8')](_0x2b320f)){return _0x2b320f;}if(_[_0xdcac('0x14')](_0x2b320f)){for(var _0xc89afd=0x0;_0xc89afd<_0x2b320f[_0xdcac('0x1f')];_0xc89afd+=0x1){_0x2b320f[_0xc89afd]=this[_0xdcac('0x1e')](_0x2b320f[_0xc89afd],_0x195ca6);}return _0x2b320f;}if(!_[_0xdcac('0x20')](_0x2b320f)){return _0x2b320f;}if(_[_0xdcac('0x21')](_0x195ca6)){_0x195ca6=[_0x195ca6];}if(!_[_0xdcac('0x14')](_0x195ca6)){return _0x2b320f;}for(var _0x54c757=0x0;_0x54c757<_0x195ca6[_0xdcac('0x1f')];_0x54c757+=0x1){_[_0xdcac('0x22')](_0x2b320f,_0x195ca6[_0x54c757]);}for(var _0xa47341 in _0x2b320f){if(_0x2b320f[_0xdcac('0x23')](_0xa47341)){_0x2b320f[_0xa47341]=this[_0xdcac('0x1e')](_0x2b320f[_0xa47341],_0x195ca6);}}return _0x2b320f;};exports[_0xdcac('0x24')]=function(_0x26ccca){return _0x26ccca[_0xdcac('0x25')](RegExp(_0xdcac('0x26')))?!![]:![];};exports[_0xdcac('0x27')]=function(_0x3d5d54){return _0x3d5d54[_0xdcac('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0xdcac('0x28')]=function(_0x146a70,_0x2ed086){var _0x1b3892=[];var _0x4e7062=/[ `!@#$%^&*()_\-?~]/;var _0x1327f0=_0x2ed086?'\x22{EXPR}\x22':_0xdcac('0x29');_0x146a70[_0xdcac('0x6')](/[ ,]+/)[_0xdcac('0x2a')](function(_0x595af8){_0x595af8=_0x595af8[_0xdcac('0x2b')](/([^:]")"+/g,'$1');_0x595af8='+'+_0x595af8+'*';var _0x5278bc=_0x595af8[_0xdcac('0x25')](_0x4e7062);if(_0x5278bc){_0x595af8='\x22'+_0x595af8+'\x22';}_0x1b3892['push'](_0x595af8);});_0x1327f0=_0x1327f0[_0xdcac('0x2b')]('{EXPR}',_0x1b3892[_0xdcac('0x2c')]('\x20'));return _0x1327f0;};exports[_0xdcac('0x2d')]=function(_0x49aa8e,_0x552715,_0x2fdafd){var _0xb2d041={},_0x10dd2c={};if(_0x552715[_0xdcac('0x2e')][_0xdcac('0x2f')]){_0x552715['query']['id']=_0x552715[_0xdcac('0x2e')][_0xdcac('0x2f')];delete _0x552715['query']['$id'];}_0xb2d041[_0xdcac('0x4')]=_[_0xdcac('0x18')](_0x49aa8e,_0xdcac('0x30'));_0xb2d041[_0xdcac('0x2e')]=_[_0xdcac('0x3')](_0x552715[_0xdcac('0x2e')]);_0xb2d041[_0xdcac('0x7')]=_[_0xdcac('0x31')](_0xb2d041[_0xdcac('0x4')],_0xb2d041[_0xdcac('0x2e')]);_0x10dd2c[_0xdcac('0x32')]=_[_0xdcac('0x31')](_0xb2d041[_0xdcac('0x4')],this[_0xdcac('0x33')](_0x552715[_0xdcac('0x2e')][_0xdcac('0x33')]));_0x10dd2c['attributes']=_0x10dd2c[_0xdcac('0x32')][_0xdcac('0x1f')]?_0x10dd2c['attributes']:_0xb2d041['model'];if(!_0x552715[_0xdcac('0x2e')][_0xdcac('0x23')](_0xdcac('0x34'))){_0x10dd2c[_0xdcac('0x15')]=this[_0xdcac('0x15')](_0x552715[_0xdcac('0x2e')][_0xdcac('0x15')]);_0x10dd2c[_0xdcac('0x16')]=this[_0xdcac('0x16')](_0x552715[_0xdcac('0x2e')][_0xdcac('0x16')]);}_0x10dd2c[_0xdcac('0x35')]=this[_0xdcac('0x17')](_0x552715[_0xdcac('0x2e')][_0xdcac('0x17')]);_0x10dd2c['where']=this['filters'](_['pick'](_0x552715[_0xdcac('0x2e')],_0xb2d041[_0xdcac('0x7')]),_0x49aa8e);if(_0x552715[_0xdcac('0x2e')]['filter']){var _0x3b4ec4=_0x49aa8e;var _0x1d01f2=_0x552715[_0xdcac('0x2e')][_0xdcac('0x36')];if(typeof _0x1d01f2===_0xdcac('0x37')){_0x3b4ec4=_[_0xdcac('0x36')](_0x49aa8e,function(_0x2a15ff){return _[_0xdcac('0x2')](_0x1d01f2[_0xdcac('0x38')],_0x2a15ff[_0xdcac('0x30')]);});_0x1d01f2=_0x1d01f2[_0xdcac('0x39')];}_0x10dd2c[_0xdcac('0x3a')]=_[_0xdcac('0x3b')](_0x10dd2c['where'],{'$or':_[_0xdcac('0x18')](_0x3b4ec4,function(_0x5c5a26){if(_0x5c5a26[_0xdcac('0x3c')]!==_0xdcac('0x3d')){if(_0x2fdafd){return sequelize[_0xdcac('0x3a')](sequelize['fn'](_0xdcac('0x3e'),sequelize[_0xdcac('0x1b')](_0x5c5a26['name'])),{'$like':sequelize['fn'](_0xdcac('0x3e'),'%'+_0x552715[_0xdcac('0x2e')][_0xdcac('0x36')]+'%')});}else{var _0x354447={};_0x354447[_0x5c5a26[_0xdcac('0x30')]]={'$like':'%'+_0x552715[_0xdcac('0x2e')][_0xdcac('0x36')]+'%'};return _0x354447;}}})});}_0x10dd2c=_[_0xdcac('0x3b')]({},_0x10dd2c,_0x552715['options']);return _0x10dd2c;};exports[_0xdcac('0x3f')]=function(_0x3dffd2){var _0x19b8f8=[];if(_0x3dffd2['includeAll']){_0x19b8f8['push']({'all':!![]});}else if(_0x3dffd2['include']){if(Array[_0xdcac('0x14')](_0x3dffd2[_0xdcac('0x3f')])){_0x19b8f8=Object[_0xdcac('0x3')](_0x3dffd2[_0xdcac('0x3f')])[_0xdcac('0x18')](function(_0xee9550){return parseIncludeModel(_0x3dffd2[_0xdcac('0x3f')][_0xee9550]);});}else{var _0x119d6a=parseIncludeModel(_0x3dffd2['include']);_0x19b8f8[_0xdcac('0x40')](_0x119d6a);}}return _0x19b8f8;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 27cd7ad..953b361 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 _0x9957=['sort','toLowerCase','userpic','online','lastPauseAt','address','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','openchannelStatus','mailStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','omit','pick','value','filterAgentAttributes','name','role','lastLoginAt','whatsappPause','mailStatus','chatStatusTime','openchannelStatusTime','whatsappStatusTime','chatCapacity','mailCapacity','whatsappCurrentCapacity','phoneBarEnableScreenRecordingByAgent','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','every','length','idle','unknown','unavailable','isNil','voiceStatus','pause','chatStatus','faxStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','getRealtimeAgents','busy','getAgentStatus','startCase','Queue','map','findOne','getAgents','all','flatten','uniq','getAgentIdsByQueues','filter','getAgentIdsByStatus','includes','User','findAll','fullname','pauseType','find','globalStatus','catch','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','getUpdatedSortOptions','fullname,internal','internal','substring','indexOf','validateSortParameter'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var db=require(_0x7995('0x2'))['db'];var amiClient=jayson[_0x7995('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0x7995('0x3')][_0x7995('0x4')]({'port':0x232c});function isAgentPaused(_0x1902b4,_0x462a03){var _0x576d89=[_0x1902b4[_0x7995('0x5')],_0x1902b4[_0x7995('0x6')],_0x1902b4[_0x7995('0x7')],_0x1902b4[_0x7995('0x8')],_0x1902b4[_0x7995('0x9')],_0x1902b4[_0x7995('0xa')],_0x1902b4['whatsappPause']];if(!_0x462a03)return _[_0x7995('0xb')](_0x576d89);var _0x1cad37=_['filter'](_0x576d89);return _0x1cad37[_0x7995('0xc')]>0x0&&_0x1cad37[_0x7995('0xc')]<_0x576d89[_0x7995('0xc')]?!![]:![];}function isIdle(_0x35b5fe){return _0x35b5fe===_0x7995('0xd')||_0x35b5fe===_0x7995('0xe')||_0x35b5fe===_0x7995('0xf')||_0x35b5fe==='ringing'||_[_0x7995('0x10')](_0x35b5fe);}function isAgentIdle(_0x41c652){if(_0x41c652['voiceStatus']!==_0x7995('0xd')&&_0x41c652[_0x7995('0xa')]){_0x41c652[_0x7995('0x11')]=_0x7995('0x12');return![];}return _[_0x7995('0xb')]([_0x41c652[_0x7995('0x13')],_0x41c652[_0x7995('0x14')],_0x41c652['mailStatus'],_0x41c652['openchannelStatus'],_0x41c652[_0x7995('0x15')],_0x41c652[_0x7995('0x11')],_0x41c652[_0x7995('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x7995('0x17')](_0x7995('0x18'),{})[_0x7995('0x19')](function(_0x2202ce){if(_0x2202ce[_0x7995('0x1a')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x2eeacc=_0x2202ce['result'];return routingClient[_0x7995('0x17')](_0x7995('0x18'),{})[_0x7995('0x19')](function(_0x291317){if(_0x291317[_0x7995('0x1a')]){throw new Error(_0x7995('0x1b'));}var _0x4faa60=_0x291317['result'];return _[_0x7995('0x1c')]({},_0x2eeacc,_0x4faa60);});})['catch'](function(_0x555f74){throw _0x555f74;});}exports[_0x7995('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x3d463e){var _0x4cbe10=_0x7995('0xe');if(isAgentPaused(_0x3d463e))_0x4cbe10='pause';else if(isAgentPaused(_0x3d463e,!![]))_0x4cbe10='*pause';else if(isAgentIdle(_0x3d463e))_0x4cbe10=_0x7995('0xd');else _0x4cbe10=_0x7995('0x1e');return _0x4cbe10;}exports[_0x7995('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x1a8568,_0x460924){var _0x1c278a=_['isArray'](_0x1a8568)?_0x1a8568:[_0x1a8568];var _0x32a09a=_[_0x7995('0x20')](_0x460924)+_0x7995('0x21');var _0x285437=_[_0x7995('0x22')](_0x1c278a,function(_0x13bc35){return db[_0x32a09a][_0x7995('0x23')]({'where':{'id':_0x13bc35}})[_0x7995('0x19')](function(_0x59405a){if(!_0x59405a)return[];return _0x59405a[_0x7995('0x24')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x7995('0x25')](_0x285437)[_0x7995('0x19')](function(_0x268ce7){var _0x3a3fcf=_(_0x268ce7)[_0x7995('0x26')]()['map']('id')[_0x7995('0x27')]()['value']();return _0x3a3fcf;});}exports[_0x7995('0x28')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x49bc7e,_0xf16cc2,_0x132a42){try{if(_0xf16cc2[_0x7995('0xc')]>0x0){_0x49bc7e=_0x49bc7e['filter'](function(_0x9b2a15){return _0xf16cc2['includes'](_0x9b2a15['id']);});}var _0x456a28=_0x49bc7e[_0x7995('0x29')](function(_0x4253e5){var _0x574574='busy';if(isAgentIdle(_0x4253e5)){_0x574574='idle';}return _0x574574===_0x132a42;});return _[_0x7995('0x22')](_0x456a28,'id');}catch(_0xe6b0b3){throw _0xe6b0b3;}}exports[_0x7995('0x2a')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x2b874d,_0x2e3493,_0x1ca460){return Promise['resolve']()['then'](function(){if(_0x2e3493[_0x7995('0xc')]>0x0){_0x2b874d=_0x2b874d['filter'](function(_0x553671){return _0x2e3493[_0x7995('0x2b')](_0x553671['id']);});}return _0x2b874d;})[_0x7995('0x19')](function(){return db[_0x7995('0x2c')][_0x7995('0x2d')]({'attributes':['id','name',_0x7995('0x2e'),_0x7995('0x5'),'faxPause','mailPause','openchannelPause',_0x7995('0x9'),_0x7995('0xa'),'whatsappPause',_0x7995('0x2f')],'where':{'id':{'$in':_['map'](_0x2b874d,'id')}},'raw':!![]});})[_0x7995('0x19')](function(_0x1cb058){return _0x1cb058[_0x7995('0x22')](function(_0x5014d2){var _0x52d76d=_[_0x7995('0x30')](_0x2b874d,['id',_0x5014d2['id']]);var _0x5e67fe=filterAgentAttributes(_0x52d76d);_['merge'](_0x5014d2,_0x5e67fe);_0x5014d2[_0x7995('0x31')]=getAgentStatus(_0x5014d2);return _0x5014d2;});})[_0x7995('0x19')](function(_0x5212ff){var _0x1baa15=sortAgentsByStatus(_0x5212ff,_0x1ca460);return _[_0x7995('0x22')](_0x1baa15,'id');})[_0x7995('0x32')](function(_0x18667c){throw _0x18667c;});}exports[_0x7995('0x33')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x53002a){var _0x2d4285={'fields':[],'order':null};var _0x242713=_0x53002a[_0x7995('0x34')](',');_0x2d4285[_0x7995('0x35')]=_['filter'](_0x242713,function(_0x2be2c0){if(!_0x2be2c0[_0x7995('0x2b')](_0x7995('0x31'))){return!![];}_0x2d4285[_0x7995('0x36')]=_[_0x7995('0x37')](_0x2be2c0,'-')?_0x7995('0x38'):'ASC';return![];});return _0x2d4285;}exports[_0x7995('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x3be298){if(!_0x3be298){_0x3be298=_0x7995('0x3a');}if(_0x3be298[_0x7995('0x2b')](_0x7995('0x2e'))&&!_0x3be298[_0x7995('0x2b')](_0x7995('0x3b'))){var _0x270c0e=_0x3be298[_0x7995('0x3c')](0x0,_0x3be298[_0x7995('0x3d')](_0x7995('0x2e')));_0x3be298+=','+_0x270c0e+_0x7995('0x3b');}return _0x3be298;}exports[_0x7995('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x53cda2,_0x50a98e){var _0x334dff=_0x53cda2[_0x7995('0x3f')](function(_0x58523e,_0x4b0855){if(_0x58523e[_0x7995('0x31')]===_0x4b0855['globalStatus']){if(_0x58523e['globalStatus']===_0x7995('0x12')){if(_0x50a98e===_0x7995('0x38')){return(_0x58523e[_0x7995('0x2f')]||'')<(_0x4b0855['pauseType']||'')||_0x58523e[_0x7995('0x2e')]['toLowerCase']()>_0x4b0855[_0x7995('0x2e')]['toLowerCase']()?0x1:-0x1;}else{return(_0x58523e['pauseType']||'')<(_0x4b0855[_0x7995('0x2f')]||'')||_0x58523e[_0x7995('0x2e')][_0x7995('0x40')]()>_0x4b0855[_0x7995('0x2e')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x50a98e===_0x7995('0x38')){return _0x58523e[_0x7995('0x2e')][_0x7995('0x40')]()<_0x4b0855[_0x7995('0x2e')]['toLowerCase']()?0x1:-0x1;}else{return _0x58523e['fullname'][_0x7995('0x40')]()<_0x4b0855['fullname'][_0x7995('0x40')]()?-0x1:0x1;}}}else{if(_0x50a98e==='DESC'){return _0x58523e[_0x7995('0x31')]<_0x4b0855['globalStatus']?0x1:-0x1;}else{return _0x58523e[_0x7995('0x31')]<_0x4b0855[_0x7995('0x31')]?-0x1:0x1;}}});return _0x334dff;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x3e9e62){var _0x336ff2=[_0x7995('0x41'),_0x7995('0x42'),'lastLoginAt',_0x7995('0x43'),_0x7995('0x2f'),_0x7995('0x43'),'internal',_0x7995('0x44'),_0x7995('0x5'),_0x7995('0x8'),_0x7995('0x7'),_0x7995('0x9'),'whatsappPause',_0x7995('0x6'),_0x7995('0xa'),'chatCapacity',_0x7995('0x45'),'mailCapacity',_0x7995('0x46'),_0x7995('0x47'),_0x7995('0x48'),_0x7995('0x49'),_0x7995('0x4a'),_0x7995('0x4b'),_0x7995('0x4c'),'whatsappCurrentCapacity',_0x7995('0x4d'),_0x7995('0x13'),_0x7995('0x4e'),'mailStatus',_0x7995('0x15'),_0x7995('0x16'),_0x7995('0x14'),'voiceStatus','chatStatusTime','openchannelStatusTime',_0x7995('0x4f'),_0x7995('0x50'),'whatsappStatusTime',_0x7995('0x51'),_0x7995('0x52'),_0x7995('0x53'),_0x7995('0x54'),_0x7995('0x55'),'phoneBarEnableScreenRecordingByAgent',_0x7995('0x56'),'routealias'];var _0x14fe7f=[_0x7995('0x5'),_0x7995('0x8'),'mailPause','smsPause','whatsappPause','faxPause',_0x7995('0xa'),_0x7995('0x42')];var _0x1a861c=_(_0x3e9e62)[_0x7995('0x57')](_0x14fe7f)[_0x7995('0x58')](_0x336ff2)[_0x7995('0x59')]();return _0x1a861c;}exports[_0x7995('0x5a')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x7995('0x5b'),_0x7995('0x2e'),_0x7995('0x5c'),_0x7995('0x3b'),_0x7995('0x42'),_0x7995('0x31'),_0x7995('0x41'),_0x7995('0x5d'),_0x7995('0x2f'),_0x7995('0x43'),_0x7995('0x6'),_0x7995('0x5'),'mailPause',_0x7995('0x8'),_0x7995('0x9'),_0x7995('0xa'),_0x7995('0x5e'),'chatStatus','faxStatus',_0x7995('0x5f'),_0x7995('0x4e'),_0x7995('0x15'),_0x7995('0x11'),'whatsappStatus',_0x7995('0x60'),_0x7995('0x51'),_0x7995('0x4f'),_0x7995('0x61'),'smsStatusTime','voiceStatusTime',_0x7995('0x62'),_0x7995('0x63'),_0x7995('0x48'),_0x7995('0x64'),_0x7995('0x45'),_0x7995('0x46'),_0x7995('0x47'),_0x7995('0x49'),_0x7995('0x4d'),'mailCurrentCapacity',_0x7995('0x4a'),_0x7995('0x4c'),_0x7995('0x65'),_0x7995('0x66'),'phoneBarEnableAutomaticScreenRecording','destconnectedlinenum',_0x7995('0x67'),_0x7995('0x53'),'routealias',_0x7995('0x55')];}exports[_0x7995('0x68')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x46ed=['map','findOne','getAgents','all','flatten','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','findAll','name','pauseType','find','globalStatus','split','order','startsWith','DESC','ASC','fullname,internal','fullname','validateSortParameter','toLowerCase','sortAgentsByStatus','userpic','online','lastPauseAt','internal','address','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','role','lastLoginAt','faxStatus','mailCurrentCapacity','smsCurrentCapacity','onhold','queue','routealias','lodash','jayson/promise','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','unknown','unavailable','ringing','isNil','voiceStatus','chatStatus','openchannelStatus','smsStatus','whatsappStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','pause','*pause','idle','busy','isArray','startCase','Queue'];(function(_0x2a490f,_0x3cb94b){var _0x4683ff=function(_0x8fe63a){while(--_0x8fe63a){_0x2a490f['push'](_0x2a490f['shift']());}};_0x4683ff(++_0x3cb94b);}(_0x46ed,0x168));var _0xd46e=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x46ed[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xd46e('0x0'));var jayson=require(_0xd46e('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xd46e('0x2')][_0xd46e('0x3')]({'port':0x232a});var routingClient=jayson[_0xd46e('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x2e6b84,_0x4518b8){var _0x54ef98=[_0x2e6b84[_0xd46e('0x4')],_0x2e6b84[_0xd46e('0x5')],_0x2e6b84[_0xd46e('0x6')],_0x2e6b84[_0xd46e('0x7')],_0x2e6b84[_0xd46e('0x8')],_0x2e6b84[_0xd46e('0x9')],_0x2e6b84[_0xd46e('0xa')]];if(!_0x4518b8)return _[_0xd46e('0xb')](_0x54ef98);var _0x31259b=_[_0xd46e('0xc')](_0x54ef98);return _0x31259b[_0xd46e('0xd')]>0x0&&_0x31259b['length']<_0x54ef98[_0xd46e('0xd')]?!![]:![];}function isIdle(_0x81235b){return _0x81235b==='idle'||_0x81235b===_0xd46e('0xe')||_0x81235b===_0xd46e('0xf')||_0x81235b===_0xd46e('0x10')||_[_0xd46e('0x11')](_0x81235b);}function isAgentIdle(_0x1ad723){if(_0x1ad723[_0xd46e('0x12')]!=='idle'&&_0x1ad723[_0xd46e('0x9')]){_0x1ad723['voiceStatus']='pause';return![];}return _[_0xd46e('0xb')]([_0x1ad723[_0xd46e('0x13')],_0x1ad723['faxStatus'],_0x1ad723['mailStatus'],_0x1ad723[_0xd46e('0x14')],_0x1ad723[_0xd46e('0x15')],_0x1ad723[_0xd46e('0x12')],_0x1ad723[_0xd46e('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0xd46e('0x17'),{})[_0xd46e('0x18')](function(_0x417402){if(_0x417402[_0xd46e('0x19')]){throw new Error(_0xd46e('0x1a'));}var _0x47fa8f=_0x417402[_0xd46e('0x1b')];return routingClient[_0xd46e('0x1c')](_0xd46e('0x17'),{})['then'](function(_0x5ddd04){if(_0x5ddd04[_0xd46e('0x19')]){throw new Error(_0xd46e('0x1d'));}var _0x488690=_0x5ddd04['result'];return _[_0xd46e('0x1e')]({},_0x47fa8f,_0x488690);});})[_0xd46e('0x1f')](function(_0x362885){throw _0x362885;});}exports[_0xd46e('0x20')]=getRealtimeAgents;function getAgentStatus(_0x409010){var _0x312d6f=_0xd46e('0xe');if(isAgentPaused(_0x409010))_0x312d6f=_0xd46e('0x21');else if(isAgentPaused(_0x409010,!![]))_0x312d6f=_0xd46e('0x22');else if(isAgentIdle(_0x409010))_0x312d6f=_0xd46e('0x23');else _0x312d6f=_0xd46e('0x24');return _0x312d6f;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x259072,_0x1c83fa){var _0x79aa51=_[_0xd46e('0x25')](_0x259072)?_0x259072:[_0x259072];var _0x128246=_[_0xd46e('0x26')](_0x1c83fa)+_0xd46e('0x27');var _0x8a1be=_[_0xd46e('0x28')](_0x79aa51,function(_0x4cf899){return db[_0x128246][_0xd46e('0x29')]({'where':{'id':_0x4cf899}})['then'](function(_0x4b8f6a){if(!_0x4b8f6a)return[];return _0x4b8f6a[_0xd46e('0x2a')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xd46e('0x2b')](_0x8a1be)[_0xd46e('0x18')](function(_0x42afc7){var _0x247b9f=_(_0x42afc7)[_0xd46e('0x2c')]()[_0xd46e('0x28')]('id')['uniq']()[_0xd46e('0x2d')]();return _0x247b9f;});}exports[_0xd46e('0x2e')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0xddbce9,_0x17db79,_0x96f15c){try{if(_0x17db79[_0xd46e('0xd')]>0x0){_0xddbce9=_0xddbce9['filter'](function(_0x465d54){return _0x17db79[_0xd46e('0x2f')](_0x465d54['id']);});}var _0x2d1afe=_0xddbce9[_0xd46e('0xc')](function(_0x106edc){var _0x423ea3=_0xd46e('0x24');if(isAgentIdle(_0x106edc)){_0x423ea3=_0xd46e('0x23');}return _0x423ea3===_0x96f15c;});return _[_0xd46e('0x28')](_0x2d1afe,'id');}catch(_0x45ea47){throw _0x45ea47;}}exports[_0xd46e('0x30')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x504324,_0x2f4a1b,_0x5ed8dc){return Promise[_0xd46e('0x31')]()[_0xd46e('0x18')](function(){if(_0x2f4a1b[_0xd46e('0xd')]>0x0){_0x504324=_0x504324[_0xd46e('0xc')](function(_0x5ef248){return _0x2f4a1b[_0xd46e('0x2f')](_0x5ef248['id']);});}return _0x504324;})[_0xd46e('0x18')](function(){return db['User'][_0xd46e('0x32')]({'attributes':['id',_0xd46e('0x33'),'fullname',_0xd46e('0x4'),_0xd46e('0x5'),_0xd46e('0x6'),'openchannelPause','smsPause',_0xd46e('0x9'),_0xd46e('0xa'),_0xd46e('0x34')],'where':{'id':{'$in':_[_0xd46e('0x28')](_0x504324,'id')}},'raw':!![]});})[_0xd46e('0x18')](function(_0x423de9){return _0x423de9[_0xd46e('0x28')](function(_0xf8b746){var _0x527a2f=_[_0xd46e('0x35')](_0x504324,['id',_0xf8b746['id']]);var _0x1a1181=filterAgentAttributes(_0x527a2f);_[_0xd46e('0x1e')](_0xf8b746,_0x1a1181);_0xf8b746[_0xd46e('0x36')]=getAgentStatus(_0xf8b746);return _0xf8b746;});})[_0xd46e('0x18')](function(_0x1e0897){var _0x42ddde=sortAgentsByStatus(_0x1e0897,_0x5ed8dc);return _['map'](_0x42ddde,'id');})[_0xd46e('0x1f')](function(_0x357212){throw _0x357212;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x14447e){var _0x96b0f9={'fields':[],'order':null};var _0x12ccf8=_0x14447e[_0xd46e('0x37')](',');_0x96b0f9['fields']=_[_0xd46e('0xc')](_0x12ccf8,function(_0x3ecf34){if(!_0x3ecf34[_0xd46e('0x2f')](_0xd46e('0x36'))){return!![];}_0x96b0f9[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x3ecf34,'-')?_0xd46e('0x3a'):_0xd46e('0x3b');return![];});return _0x96b0f9;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x232e6f){if(!_0x232e6f){_0x232e6f=_0xd46e('0x3c');}if(_0x232e6f[_0xd46e('0x2f')](_0xd46e('0x3d'))&&!_0x232e6f[_0xd46e('0x2f')]('internal')){var _0x964c66=_0x232e6f['substring'](0x0,_0x232e6f['indexOf']('fullname'));_0x232e6f+=','+_0x964c66+'internal';}return _0x232e6f;}exports[_0xd46e('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x54949f,_0x3b76e0){var _0x40720e=_0x54949f['sort'](function(_0x462477,_0x4114e6){if(_0x462477[_0xd46e('0x36')]===_0x4114e6[_0xd46e('0x36')]){if(_0x462477[_0xd46e('0x36')]===_0xd46e('0x21')){if(_0x3b76e0===_0xd46e('0x3a')){return(_0x462477[_0xd46e('0x34')]||'')<(_0x4114e6[_0xd46e('0x34')]||'')||_0x462477[_0xd46e('0x3d')][_0xd46e('0x3f')]()>_0x4114e6['fullname']['toLowerCase']()?0x1:-0x1;}else{return(_0x462477['pauseType']||'')<(_0x4114e6[_0xd46e('0x34')]||'')||_0x462477['fullname'][_0xd46e('0x3f')]()>_0x4114e6[_0xd46e('0x3d')][_0xd46e('0x3f')]()?-0x1:0x1;}}else{if(_0x3b76e0===_0xd46e('0x3a')){return _0x462477[_0xd46e('0x3d')][_0xd46e('0x3f')]()<_0x4114e6[_0xd46e('0x3d')][_0xd46e('0x3f')]()?0x1:-0x1;}else{return _0x462477['fullname'][_0xd46e('0x3f')]()<_0x4114e6['fullname'][_0xd46e('0x3f')]()?-0x1:0x1;}}}else{if(_0x3b76e0===_0xd46e('0x3a')){return _0x462477[_0xd46e('0x36')]<_0x4114e6[_0xd46e('0x36')]?0x1:-0x1;}else{return _0x462477[_0xd46e('0x36')]<_0x4114e6['globalStatus']?-0x1:0x1;}}});return _0x40720e;}exports[_0xd46e('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0xfcd7f9){var _0x2acb83=[_0xd46e('0x41'),_0xd46e('0x42'),'lastLoginAt',_0xd46e('0x43'),_0xd46e('0x34'),_0xd46e('0x43'),_0xd46e('0x44'),_0xd46e('0x45'),'chatPause',_0xd46e('0x7'),_0xd46e('0x6'),_0xd46e('0x8'),_0xd46e('0xa'),_0xd46e('0x5'),_0xd46e('0x9'),_0xd46e('0x46'),_0xd46e('0x47'),'mailCapacity',_0xd46e('0x48'),_0xd46e('0x49'),_0xd46e('0x4a'),_0xd46e('0x4b'),_0xd46e('0x4c'),'mailCurrentCapacity','smsCurrentCapacity',_0xd46e('0x4d'),_0xd46e('0x4e'),_0xd46e('0x13'),'openchannelStatus','mailStatus',_0xd46e('0x15'),_0xd46e('0x16'),'faxStatus',_0xd46e('0x12'),_0xd46e('0x4f'),_0xd46e('0x50'),_0xd46e('0x51'),_0xd46e('0x52'),_0xd46e('0x53'),_0xd46e('0x54'),_0xd46e('0x55'),'queue',_0xd46e('0x56'),_0xd46e('0x57'),_0xd46e('0x58'),_0xd46e('0x59'),'routealias'];var _0x56dd9a=[_0xd46e('0x4'),'openchannelPause',_0xd46e('0x6'),_0xd46e('0x8'),_0xd46e('0xa'),_0xd46e('0x5'),_0xd46e('0x9'),_0xd46e('0x42')];var _0x492329=_(_0xfcd7f9)[_0xd46e('0x5a')](_0x56dd9a)[_0xd46e('0x5b')](_0x2acb83)[_0xd46e('0x2d')]();return _0x492329;}exports['filterAgentAttributes']=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xd46e('0x33'),_0xd46e('0x3d'),_0xd46e('0x5c'),_0xd46e('0x44'),_0xd46e('0x42'),_0xd46e('0x36'),_0xd46e('0x41'),_0xd46e('0x5d'),_0xd46e('0x34'),_0xd46e('0x43'),_0xd46e('0x5'),_0xd46e('0x4'),_0xd46e('0x6'),_0xd46e('0x7'),'smsPause',_0xd46e('0x9'),_0xd46e('0xa'),_0xd46e('0x13'),_0xd46e('0x5e'),'mailStatus',_0xd46e('0x14'),_0xd46e('0x15'),_0xd46e('0x12'),_0xd46e('0x16'),'chatStatusTime',_0xd46e('0x54'),_0xd46e('0x51'),'openchannelStatusTime','smsStatusTime',_0xd46e('0x55'),_0xd46e('0x53'),_0xd46e('0x46'),'faxCapacity','mailCapacity',_0xd46e('0x47'),_0xd46e('0x48'),_0xd46e('0x49'),_0xd46e('0x4b'),_0xd46e('0x4e'),_0xd46e('0x5f'),_0xd46e('0x4c'),_0xd46e('0x60'),_0xd46e('0x4d'),_0xd46e('0x58'),_0xd46e('0x59'),_0xd46e('0x56'),_0xd46e('0x61'),_0xd46e('0x62'),_0xd46e('0x63'),_0xd46e('0x57')];}exports['getRealtimeAgentsQueryFields']=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 77fac75..d272922 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 _0xc4d0=['client','http','available','loggedIn','paused','waiting','busy','inUse','invalid','loggedInDb','notInUse','onHold','ringing','talking','unknown','message','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','startCase','Queues','then','error','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','getRealtimeQueues','voice','inbound','concat','map','get','outbound','pTalking','find','merge','initializeQueues','lodash','jayson/promise','util'];(function(_0x1b7329,_0x226597){var _0x58868c=function(_0x2940e3){while(--_0x2940e3){_0x1b7329['push'](_0x1b7329['shift']());}};_0x58868c(++_0x226597);}(_0xc4d0,0x93));var _0x0c4d=function(_0x1c461e,_0x1b98ff){_0x1c461e=_0x1c461e-0x0;var _0x1dce4f=_0xc4d0[_0x1c461e];return _0x1dce4f;};'use strict';var _=require(_0x0c4d('0x0'));var jayson=require(_0x0c4d('0x1'));var util=require(_0x0c4d('0x2'));var amiClient=jayson[_0x0c4d('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0x0c4d('0x3')][_0x0c4d('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x0c4d('0x5'),_0x0c4d('0x6'),_0x0c4d('0x7'),_0x0c4d('0x8')];var VOICE_QUEUE_ATTRIBUTES=[_0x0c4d('0x9'),_0x0c4d('0xa'),_0x0c4d('0xb'),_0x0c4d('0xc'),_0x0c4d('0xd'),_0x0c4d('0xe'),_0x0c4d('0xf'),'ringInUse',_0x0c4d('0x10'),'unavailable',_0x0c4d('0x11')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking','originated',_0x0c4d('0x12'),'statusMessage','dialActive','dialMethod',_0x0c4d('0x13'),_0x0c4d('0x14'),_0x0c4d('0x15'),_0x0c4d('0x16'),'erlangCallToSecond',_0x0c4d('0x17'),_0x0c4d('0x18'),_0x0c4d('0x19'),_0x0c4d('0x1a'),_0x0c4d('0x1b'),_0x0c4d('0x1c'),_0x0c4d('0x1d'),'predictiveIntervalAnsweredCalls',_0x0c4d('0x1e'),_0x0c4d('0x1f'),_0x0c4d('0x20'),_0x0c4d('0x21')];function getRealtimeQueues(_0xe11b97,_0x13a717){var _0x4a472e=_0x13a717==='voice'?amiClient:routingClient;return _0x4a472e['request'](_[_0x0c4d('0x22')](_0x13a717)+_0x0c4d('0x23'),_0xe11b97)[_0x0c4d('0x24')](function(_0x2269ad){if(_0x2269ad[_0x0c4d('0x25')])throw new Error(util['format'](_0x0c4d('0x26'),_0x13a717));return _0x2269ad['result'];})['catch'](function(_0x589045){throw _0x589045;});}exports[_0x0c4d('0x27')]=getRealtimeQueues;function initializeQueues(_0xaf02d1,_0xf1a19c,_0x30d087,_0x133cfa){var _0x443b92=DEFAULT_QUEUE_ATTRIBUTES;if(_0x30d087===_0x0c4d('0x28')){if(_0x133cfa===_0x0c4d('0x29')){_0x443b92=_0x443b92[_0x0c4d('0x2a')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x133cfa==='outbound'){_0x443b92=_0x443b92[_0x0c4d('0x2a')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0xaf02d1[_0x0c4d('0x2b')](function(_0x208dcc){var _0x1058f9=_0x208dcc[_0x0c4d('0x2c')]({'plain':!![]});_0x1058f9['paused']=0x0;_0x1058f9[_0x0c4d('0xc')]=0x0;_0x1058f9[_0x0c4d('0x6')]=0x0;_0x1058f9[_0x0c4d('0x5')]=0x0;_0x1058f9[_0x0c4d('0x8')]=0x0;if(_0x30d087===_0x0c4d('0x28')){_0x1058f9[_0x0c4d('0x10')]=0x0;_0x1058f9['busy']=0x0;if(_0x133cfa===_0x0c4d('0x2d')){_0x1058f9[_0x0c4d('0x2e')]=0x0;_0x1058f9['originated']=0x0;}}var _0x1304ea=_[_0x0c4d('0x2f')](_0xf1a19c,['id',_0x1058f9['id']]);if(_0x1304ea){_[_0x0c4d('0x30')](_0x1058f9,_['pick'](_0x1304ea,_0x443b92));}return _0x1058f9;});}exports[_0x0c4d('0x31')]=initializeQueues; \ No newline at end of file +var _0xbca2=['onHold','ringing','ringInUse','unavailable','unknown','pTalking','originated','message','statusMessage','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','inbound','concat','outbound','map','get','talking','busy','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn','paused','waiting','invalid','loggedInDb','notInUse'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xbca2,0x132));var _0x2bca=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0xbca2[_0x1ed116];return _0x574066;};'use strict';var _=require(_0x2bca('0x0'));var jayson=require(_0x2bca('0x1'));var util=require(_0x2bca('0x2'));var amiClient=jayson[_0x2bca('0x3')][_0x2bca('0x4')]({'port':0x232a});var routingClient=jayson[_0x2bca('0x3')][_0x2bca('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x2bca('0x5'),_0x2bca('0x6'),_0x2bca('0x7'),_0x2bca('0x8')];var VOICE_QUEUE_ATTRIBUTES=['busy','inUse',_0x2bca('0x9'),_0x2bca('0xa'),_0x2bca('0xb'),_0x2bca('0xc'),_0x2bca('0xd'),_0x2bca('0xe'),'talking',_0x2bca('0xf'),_0x2bca('0x10')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x2bca('0x11'),_0x2bca('0x12'),_0x2bca('0x13'),_0x2bca('0x14'),'dialActive','dialMethod',_0x2bca('0x15'),_0x2bca('0x16'),_0x2bca('0x17'),'erlangCalls',_0x2bca('0x18'),'erlangAbandonmentRate',_0x2bca('0x19'),_0x2bca('0x1a'),_0x2bca('0x1b'),_0x2bca('0x1c'),'predictiveIntervalAvailable',_0x2bca('0x1d'),_0x2bca('0x1e'),_0x2bca('0x1f'),_0x2bca('0x20'),_0x2bca('0x21'),_0x2bca('0x22')];function getRealtimeQueues(_0x13dd6f,_0x31a869){var _0x10c545=_0x31a869===_0x2bca('0x23')?amiClient:routingClient;return _0x10c545['request'](_[_0x2bca('0x24')](_0x31a869)+_0x2bca('0x25'),_0x13dd6f)[_0x2bca('0x26')](function(_0x26807a){if(_0x26807a[_0x2bca('0x27')])throw new Error(util[_0x2bca('0x28')](_0x2bca('0x29'),_0x31a869));return _0x26807a[_0x2bca('0x2a')];})[_0x2bca('0x2b')](function(_0x2cd38f){throw _0x2cd38f;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x12d599,_0x297fd6,_0x1de4c5,_0x26ea9b){var _0x128880=DEFAULT_QUEUE_ATTRIBUTES;if(_0x1de4c5===_0x2bca('0x23')){if(_0x26ea9b===_0x2bca('0x2c')){_0x128880=_0x128880[_0x2bca('0x2d')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x26ea9b===_0x2bca('0x2e')){_0x128880=_0x128880[_0x2bca('0x2d')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x12d599[_0x2bca('0x2f')](function(_0x18de05){var _0x5adc01=_0x18de05[_0x2bca('0x30')]({'plain':!![]});_0x5adc01[_0x2bca('0x7')]=0x0;_0x5adc01[_0x2bca('0xa')]=0x0;_0x5adc01['loggedIn']=0x0;_0x5adc01[_0x2bca('0x5')]=0x0;_0x5adc01[_0x2bca('0x8')]=0x0;if(_0x1de4c5==='voice'){_0x5adc01[_0x2bca('0x31')]=0x0;_0x5adc01[_0x2bca('0x32')]=0x0;if(_0x26ea9b===_0x2bca('0x2e')){_0x5adc01[_0x2bca('0x11')]=0x0;_0x5adc01[_0x2bca('0x12')]=0x0;}}var _0x5f3f75=_['find'](_0x297fd6,['id',_0x5adc01['id']]);if(_0x5f3f75){_['merge'](_0x5adc01,_[_0x2bca('0x33')](_0x5f3f75,_0x128880));}return _0x5adc01;});}exports[_0x2bca('0x34')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index efbff77..9f2e604 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x3ff685,_0x304b9e){var _0x2046c9=function(_0x7a10e9){while(--_0x7a10e9){_0x3ff685['push'](_0x3ff685['shift']());}};_0x2046c9(++_0x304b9e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 6c66bc5..cb62662 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 _0x27d6=['substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','IPv4','internal','head','mac','127.0.0.1','getFirstInterface','cpus','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress'];(function(_0x53de6a,_0x34325a){var _0x29b2d7=function(_0x56ac56){while(--_0x56ac56){_0x53de6a['push'](_0x53de6a['shift']());}};_0x29b2d7(++_0x34325a);}(_0x27d6,0x156));var _0x627d=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x27d6[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0x627d('0x0'));var os=require('os');var crypto=require(_0x627d('0x1'));var machine=require(_0x627d('0x2'));var exec=require(_0x627d('0x3'))[_0x627d('0x4')];var config=require('../environment');function getInterfaces(){var _0x18bb2f=[];var _0x204c0d=os[_0x627d('0x5')]();var _0x1ad73d=_[_0x627d('0x6')](_[_0x627d('0x7')](_0x204c0d));for(var _0x37a848=0x0;_0x37a848<_0x1ad73d[_0x627d('0x8')];_0x37a848++){var _0x34ce01=_0x204c0d[_0x1ad73d[_0x37a848]]['filter'](function(_0x5653ee){return _0x5653ee['family']===_0x627d('0x9')&&_0x5653ee[_0x627d('0xa')]===![];});_0x18bb2f=_0x18bb2f['concat'](_0x34ce01);}return _0x18bb2f;}function getFirstInterface(){var _0x2030bc=_[_0x627d('0xb')](getInterfaces());return{'macAddress':_0x2030bc&&_0x2030bc['mac']?_0x2030bc[_0x627d('0xc')]:'00:00:00:00:00:00','ipAddress':_0x2030bc&&_0x2030bc['address']?_0x2030bc['address']:_0x627d('0xd')};}exports[_0x627d('0xe')]=getFirstInterface;function getCPUhash(){var _0xd207fb=_['orderBy'](os[_0x627d('0xf')]()['map'](function(_0x46bed0){return _0x46bed0['model'];}))[_0x627d('0x10')](':');return crypto[_0x627d('0x11')](_0x627d('0x12'))[_0x627d('0x13')](_0xd207fb)[_0x627d('0x14')](_0x627d('0x15'));}exports[_0x627d('0x16')]=function(){var _0x4f1d75=os[_0x627d('0x17')]();var _0x284d3e=/[0-9a-f-]{36}/;if(config[_0x627d('0x18')]&&_0x284d3e['test'](config[_0x627d('0x18')])){return config[_0x627d('0x18')];}else if(_0x4f1d75==='win32'){return exec(_0x627d('0x19'),{'encoding':_0x627d('0x1a')})[_0x627d('0x1b')]('\x0d\x0a','');}else{var _0x3b73bb=getFirstInterface();var _0x34bb50=getCPUhash();var _0x55295d=_0x34bb50+'|'+os[_0x627d('0x1c')]()+'|'+_0x3b73bb[_0x627d('0x1d')]+'|'+_0x3b73bb['ipAddress'];var _0x27b098=crypto[_0x627d('0x11')](_0x627d('0x12'))[_0x627d('0x13')](_0x55295d)[_0x627d('0x14')](_0x627d('0x15'));return _0x27b098[_0x627d('0x1e')](0x0,0x8)+'-'+_0x27b098['substring'](0x8,0xc)+'-'+_0x27b098['substring'](0xc,0x10)+'-'+_0x27b098['substring'](0x10,0x14)+'-'+_0x27b098[_0x627d('0x1e')](0x14);}}; \ No newline at end of file +var _0xb830=['test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','ipAddress','createHash','substring','lodash','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','keys','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','model','join','md5','digest','hex','getUuid','platform','licenseToken'];(function(_0x1d8119,_0xc98f17){var _0x3e30f6=function(_0x2c7f3e){while(--_0x2c7f3e){_0x1d8119['push'](_0x1d8119['shift']());}};_0x3e30f6(++_0xc98f17);}(_0xb830,0xf6));var _0x0b83=function(_0x24f8a2,_0x1144b5){_0x24f8a2=_0x24f8a2-0x0;var _0x4d7884=_0xb830[_0x24f8a2];return _0x4d7884;};'use strict';var _=require(_0x0b83('0x0'));var os=require('os');var crypto=require(_0x0b83('0x1'));var machine=require(_0x0b83('0x2'));var exec=require(_0x0b83('0x3'))['execSync'];var config=require(_0x0b83('0x4'));function getInterfaces(){var _0x52937d=[];var _0x374b29=os[_0x0b83('0x5')]();var _0x693703=_[_0x0b83('0x6')](_[_0x0b83('0x7')](_0x374b29));for(var _0x2af640=0x0;_0x2af640<_0x693703['length'];_0x2af640++){var _0x338238=_0x374b29[_0x693703[_0x2af640]][_0x0b83('0x8')](function(_0x3efd8d){return _0x3efd8d[_0x0b83('0x9')]==='IPv4'&&_0x3efd8d[_0x0b83('0xa')]===![];});_0x52937d=_0x52937d[_0x0b83('0xb')](_0x338238);}return _0x52937d;}function getFirstInterface(){var _0x142430=_[_0x0b83('0xc')](getInterfaces());return{'macAddress':_0x142430&&_0x142430[_0x0b83('0xd')]?_0x142430[_0x0b83('0xd')]:_0x0b83('0xe'),'ipAddress':_0x142430&&_0x142430['address']?_0x142430[_0x0b83('0xf')]:_0x0b83('0x10')};}exports[_0x0b83('0x11')]=getFirstInterface;function getCPUhash(){var _0x128d77=_[_0x0b83('0x6')](os['cpus']()['map'](function(_0x5eeb42){return _0x5eeb42[_0x0b83('0x12')];}))[_0x0b83('0x13')](':');return crypto['createHash'](_0x0b83('0x14'))['update'](_0x128d77)[_0x0b83('0x15')](_0x0b83('0x16'));}exports[_0x0b83('0x17')]=function(){var _0x941563=os[_0x0b83('0x18')]();var _0x15d9c0=/[0-9a-f-]{36}/;if(config[_0x0b83('0x19')]&&_0x15d9c0[_0x0b83('0x1a')](config[_0x0b83('0x19')])){return config['licenseToken'];}else if(_0x941563===_0x0b83('0x1b')){return exec(_0x0b83('0x1c'),{'encoding':_0x0b83('0x1d')})[_0x0b83('0x1e')]('\x0d\x0a','');}else{var _0x46a70c=getFirstInterface();var _0x4c6439=getCPUhash();var _0x1e348d=_0x4c6439+'|'+os['hostname']()+'|'+_0x46a70c['macAddress']+'|'+_0x46a70c[_0x0b83('0x1f')];var _0x80aa61=crypto[_0x0b83('0x20')]('md5')['update'](_0x1e348d)[_0x0b83('0x15')]('hex');return _0x80aa61[_0x0b83('0x21')](0x0,0x8)+'-'+_0x80aa61['substring'](0x8,0xc)+'-'+_0x80aa61[_0x0b83('0x21')](0xc,0x10)+'-'+_0x80aa61[_0x0b83('0x21')](0x10,0x14)+'-'+_0x80aa61[_0x0b83('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 1a3bc3b..36cd29a 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 _0xba62=['get','data1','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','error','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','moment','request-promise','bluebird','version','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch'];(function(_0x5e93f9,_0x99acd3){var _0x29e222=function(_0x269154){while(--_0x269154){_0x5e93f9['push'](_0x5e93f9['shift']());}};_0x29e222(++_0x99acd3);}(_0xba62,0x109));var _0x2ba6=function(_0x24a654,_0x2ca441){_0x24a654=_0x24a654-0x0;var _0x458651=_0xba62[_0x24a654];return _0x458651;};'use strict';var util=require('util');var moment=require(_0x2ba6('0x0'));var rp=require(_0x2ba6('0x1'));var BPromise=require(_0x2ba6('0x2'));var pkginfo=require('pkginfo')(module,_0x2ba6('0x3'));var db=require(_0x2ba6('0x4'))['db'];var encryptor=require(_0x2ba6('0x5'));var hardware=require('./hardware');var logger=require(_0x2ba6('0x6'))(_0x2ba6('0x7'));var HOST=_0x2ba6('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3a4610){return new BPromise(function(_0x41b9bf,_0x389cd6){var _0x1fe878=util[_0x2ba6('0x9')](_0x2ba6('0xa'),HOST,_0x3a4610,module[_0x2ba6('0xb')][_0x2ba6('0x3')]);if(oldToken){_0x1fe878=util['format'](_0x2ba6('0xc'),HOST,_0x3a4610,module[_0x2ba6('0xb')][_0x2ba6('0x3')],oldToken);}var _0x4aeab1={'uri':_0x1fe878,'method':_0x2ba6('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x4aeab1)['then'](function(_0x32dc06){_0x41b9bf(_0x32dc06);})[_0x2ba6('0xe')](function(_0x463890){_0x389cd6(_0x463890);});});}function manageLicense(_0x261e8d,_0x150c45){var _0x1d02a6=_0x150c45[_0x2ba6('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x1d02a6[_0x2ba6('0x10')]!==_0x261e8d&&!_0x1d02a6['data2']){oldToken=_0x1d02a6[_0x2ba6('0x10')];}httpRequest(_0x261e8d)['then'](function(_0x585c33){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x585c33[_0x2ba6('0x11')]){isOldTokenSent=![];if(!_0x1d02a6[_0x2ba6('0x7')]&&_0x1d02a6[_0x2ba6('0x7')]!=_0x585c33[_0x2ba6('0x7')]||_0x1d02a6[_0x2ba6('0x7')]&&_0x1d02a6['data2']){logger[_0x2ba6('0x12')](_0x2ba6('0x13'));}if(_0x1d02a6[_0x2ba6('0x7')]&&!_0x1d02a6[_0x2ba6('0x14')]&&_0x1d02a6['license']!=_0x585c33[_0x2ba6('0x7')]){logger[_0x2ba6('0x12')](_0x2ba6('0x15'));}if(_0x1d02a6[_0x2ba6('0x7')]&&!_0x1d02a6[_0x2ba6('0x14')]&&_0x1d02a6[_0x2ba6('0x7')]==_0x585c33['license']){return _0x150c45;}return _0x150c45[_0x2ba6('0x16')]({'data1':_0x261e8d,'data2':null,'license':_0x585c33[_0x2ba6('0x7')]});}else{if(_0x585c33[_0x2ba6('0x7')]||_0x1d02a6[_0x2ba6('0x7')]){if(!_0x1d02a6['data2']){if(_0x1d02a6[_0x2ba6('0x10')]==_0x261e8d){GRAY_PERIOD_REASON=_0x2ba6('0x17');logger[_0x2ba6('0x12')](_0x2ba6('0x18'));}else{GRAY_PERIOD_REASON=_0x2ba6('0x19');logger[_0x2ba6('0x12')](_0x2ba6('0x1a'),_0x1d02a6[_0x2ba6('0x10')],_0x261e8d);}logger[_0x2ba6('0x12')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x2ba6('0x1b')](),moment()['format'](_0x2ba6('0x1c')));return _0x150c45[_0x2ba6('0x16')]({'data2':encryptor[_0x2ba6('0x1d')](moment()['format'](_0x2ba6('0x1c')))});}else{if(moment()[_0x2ba6('0x1e')](encryptor['decryptString'](_0x1d02a6['data2']),_0x2ba6('0x1f'))>DAYS){logger[_0x2ba6('0x12')]('DEMO\x20START\x20AT\x20%s',moment()[_0x2ba6('0x9')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x150c45['update']({'data1':_0x261e8d,'data2':null,'license':null});}}}else{if(_0x1d02a6[_0x2ba6('0x10')]!=_0x261e8d){logger[_0x2ba6('0x12')](_0x2ba6('0x1a'),_0x1d02a6['data1'],_0x261e8d);return _0x150c45[_0x2ba6('0x16')]({'data1':_0x261e8d,'data2':null,'license':null});}}}return _0x150c45;})['then'](function(_0x3357cd){_0x150c45=_0x3357cd;})['catch'](function(_0x540bab){logger[_0x2ba6('0x20')](_0x540bab['message']);})[_0x2ba6('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x2ba6('0x22')](),_0x150c45);},TIME);});}function defaultLicense(){var _0x347828=hardware[_0x2ba6('0x22')]();if(_0x347828){return db[_0x2ba6('0x23')][_0x2ba6('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x347828}})[_0x2ba6('0x25')](function(_0x5224aa,_0x54c513){logger['info'](_0x2ba6('0x26'),_0x347828);manageLicense(_0x347828,_0x5224aa);})[_0x2ba6('0xe')](function(_0x111dcd){logger[_0x2ba6('0x20')](_0x111dcd['message']);});}}exports[_0x2ba6('0x27')]=defaultLicense; \ No newline at end of file +var _0xb1de=['data2','then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','catch','data1'];(function(_0x4fb739,_0x2c42d6){var _0x14fa0b=function(_0x4877d4){while(--_0x4877d4){_0x4fb739['push'](_0x4fb739['shift']());}};_0x14fa0b(++_0x2c42d6);}(_0xb1de,0x75));var _0xeb1d=function(_0x34c78d,_0x3ca186){_0x34c78d=_0x34c78d-0x0;var _0x311e59=_0xb1de[_0x34c78d];return _0x311e59;};'use strict';var util=require(_0xeb1d('0x0'));var moment=require(_0xeb1d('0x1'));var rp=require(_0xeb1d('0x2'));var BPromise=require(_0xeb1d('0x3'));var pkginfo=require(_0xeb1d('0x4'))(module,_0xeb1d('0x5'));var db=require(_0xeb1d('0x6'))['db'];var encryptor=require(_0xeb1d('0x7'));var hardware=require(_0xeb1d('0x8'));var logger=require(_0xeb1d('0x9'))(_0xeb1d('0xa'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x33ff8a){return new BPromise(function(_0x5c7e79,_0x1c314a){var _0x3e7460=util[_0xeb1d('0xb')](_0xeb1d('0xc'),HOST,_0x33ff8a,module['exports'][_0xeb1d('0x5')]);if(oldToken){_0x3e7460=util[_0xeb1d('0xb')](_0xeb1d('0xd'),HOST,_0x33ff8a,module[_0xeb1d('0xe')][_0xeb1d('0x5')],oldToken);}var _0xc3c21d={'uri':_0x3e7460,'method':_0xeb1d('0xf'),'timeout':0xea60,'json':!![]};return rp(_0xc3c21d)['then'](function(_0x497ea4){_0x5c7e79(_0x497ea4);})[_0xeb1d('0x10')](function(_0x3b1277){_0x1c314a(_0x3b1277);});});}function manageLicense(_0x4d086b,_0x225cb2){var _0x14d9a8=_0x225cb2['get']({'plain':!![]});if(!isOldTokenSent&&_0x14d9a8[_0xeb1d('0x11')]!==_0x4d086b&&!_0x14d9a8[_0xeb1d('0x12')]){oldToken=_0x14d9a8[_0xeb1d('0x11')];}httpRequest(_0x4d086b)[_0xeb1d('0x13')](function(_0x265593){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x265593[_0xeb1d('0x14')]){isOldTokenSent=![];if(!_0x14d9a8[_0xeb1d('0xa')]&&_0x14d9a8['license']!=_0x265593[_0xeb1d('0xa')]||_0x14d9a8[_0xeb1d('0xa')]&&_0x14d9a8[_0xeb1d('0x12')]){logger[_0xeb1d('0x15')](_0xeb1d('0x16'));}if(_0x14d9a8[_0xeb1d('0xa')]&&!_0x14d9a8[_0xeb1d('0x12')]&&_0x14d9a8[_0xeb1d('0xa')]!=_0x265593[_0xeb1d('0xa')]){logger[_0xeb1d('0x15')](_0xeb1d('0x17'));}if(_0x14d9a8[_0xeb1d('0xa')]&&!_0x14d9a8[_0xeb1d('0x12')]&&_0x14d9a8[_0xeb1d('0xa')]==_0x265593[_0xeb1d('0xa')]){return _0x225cb2;}return _0x225cb2[_0xeb1d('0x18')]({'data1':_0x4d086b,'data2':null,'license':_0x265593[_0xeb1d('0xa')]});}else{if(_0x265593['license']||_0x14d9a8['license']){if(!_0x14d9a8[_0xeb1d('0x12')]){if(_0x14d9a8[_0xeb1d('0x11')]==_0x4d086b){GRAY_PERIOD_REASON=_0xeb1d('0x19');logger[_0xeb1d('0x15')](_0xeb1d('0x1a'));}else{GRAY_PERIOD_REASON=_0xeb1d('0x1b');logger['info'](_0xeb1d('0x1c'),_0x14d9a8[_0xeb1d('0x11')],_0x4d086b);}logger[_0xeb1d('0x15')](_0xeb1d('0x1d'),GRAY_PERIOD_REASON[_0xeb1d('0x1e')](),moment()[_0xeb1d('0xb')](_0xeb1d('0x1f')));return _0x225cb2[_0xeb1d('0x18')]({'data2':encryptor[_0xeb1d('0x20')](moment()['format'](_0xeb1d('0x1f')))});}else{if(moment()[_0xeb1d('0x21')](encryptor[_0xeb1d('0x22')](_0x14d9a8[_0xeb1d('0x12')]),'days')>DAYS){logger[_0xeb1d('0x15')](_0xeb1d('0x23'),moment()[_0xeb1d('0xb')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x225cb2[_0xeb1d('0x18')]({'data1':_0x4d086b,'data2':null,'license':null});}}}else{if(_0x14d9a8[_0xeb1d('0x11')]!=_0x4d086b){logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x14d9a8['data1'],_0x4d086b);return _0x225cb2['update']({'data1':_0x4d086b,'data2':null,'license':null});}}}return _0x225cb2;})['then'](function(_0x3e5b50){_0x225cb2=_0x3e5b50;})[_0xeb1d('0x10')](function(_0x4242dd){logger['error'](_0x4242dd[_0xeb1d('0x24')]);})[_0xeb1d('0x25')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x225cb2);},TIME);});}function defaultLicense(){var _0x28bb09=hardware[_0xeb1d('0x26')]();if(_0x28bb09){return db[_0xeb1d('0x27')][_0xeb1d('0x28')]({'where':{'id':0x1},'defaults':{'data1':_0x28bb09}})[_0xeb1d('0x29')](function(_0x3e00c3,_0x2a7a80){logger['info'](_0xeb1d('0x2a'),_0x28bb09);manageLicense(_0x28bb09,_0x3e00c3);})[_0xeb1d('0x10')](function(_0x1f97e1){logger[_0xeb1d('0x2b')](_0x1f97e1['message']);});}}exports[_0xeb1d('0x2c')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 83b43d8..5969fa3 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 _0xaeee=['License\x20limit\x20reached\x20for\x20telephones','exports','util','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','find','defaults','then','catch','uuid','license','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','format','%s:%s:%s','parse','demo','deadline','add','days','grayReason','machineUuid','changed','disabled','message','User','findAll','role','sequelize','COUNT','col','admin','telephone','telephones','forEach','user','count','pick','countBy','License\x20limit\x20reached\x20for\x20users'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xaeee,0x95));var _0xeaee=function(_0x26350c,_0x5b18a2){_0x26350c=_0x26350c-0x0;var _0x47e1fa=_0xaeee[_0x26350c];return _0x47e1fa;};'use strict';var util=require(_0xeaee('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0xeaee('0x1'));var hardware=require(_0xeaee('0x2'));var encryptor=require(_0xeaee('0x3'));var db=require(_0xeaee('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xeaee('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xeaee('0x6'),'machineUuid':hardware[_0xeaee('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xeaee('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xeaee('0x8'),'machineUuid':hardware[_0xeaee('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x48f440){return new BPromise(function(_0xdb30dc,_0x3d49bc){return db['License'][_0xeaee('0x9')](_[_0xeaee('0xa')](_0x48f440,{'raw':!![],'where':{'id':0x1}}))[_0xeaee('0xb')](function(_0x1a5a58){return checkLicense(_0x1a5a58,null);})[_0xeaee('0xb')](function(_0x45f7e4){_0xdb30dc(_0x45f7e4);return;})[_0xeaee('0xc')](function(_0xe538dd){_0x3d49bc(_0xe538dd);});});}function checkLicense(_0x5a9e83,_0x1e0ea9){if(!_0x5a9e83){demoLicense[_0xeaee('0xd')]=_0x5a9e83['data1'];return demoLicense;}try{var _0x59359e=_0x1e0ea9||_0x5a9e83[_0xeaee('0xe')];if(_['isEmpty'](_0x59359e)){throw new Error(_0xeaee('0xf'));}var _0x6a5cab=_0x5a9e83[_0xeaee('0x10')];var _0x2c64b1=_0x5a9e83[_0xeaee('0x11')];var _0x748368=_0x6a5cab[_0xeaee('0x12')]('-')[0x4];var _0x5b1da0=_0x6a5cab[_0xeaee('0x12')]('-')[0x0];var _0x467609=encryptor[_0xeaee('0x13')](_0x59359e,util[_0xeaee('0x14')](_0xeaee('0x15'),_0x748368,_0x6a5cab,_0x5b1da0));var _0x38a397=JSON[_0xeaee('0x16')](_0x467609);_0x38a397[_0xeaee('0x17')]=![];_0x38a397[_0xeaee('0xd')]=_0x6a5cab;_0x38a397['machineUuid']=hardware[_0xeaee('0x7')]();if(_0x2c64b1){var _0x5932cf=encryptor[_0xeaee('0x13')](_0x2c64b1);_0x38a397['gray']=_0x5932cf;_0x38a397[_0xeaee('0x18')]=moment(_0x5932cf)[_0xeaee('0x19')](0x7,_0xeaee('0x1a'))[_0xeaee('0x14')]();_0x38a397[_0xeaee('0x1b')]=_0x38a397[_0xeaee('0xd')]!=_0x38a397[_0xeaee('0x1c')]?_0xeaee('0x1d'):_0xeaee('0x1e');}return _0x38a397;}catch(_0x5a8d50){breakingLicense[_0xeaee('0xd')]=_0x5a9e83[_0xeaee('0x10')];breakingLicense[_0xeaee('0x1f')]=_0x5a8d50['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2e2681,_0x5955ac){getLicense()['then'](function(_0x50c737){return db[_0xeaee('0x20')][_0xeaee('0x21')]({'attributes':[_0xeaee('0x22'),[db[_0xeaee('0x23')]['fn'](_0xeaee('0x24'),db['sequelize'][_0xeaee('0x25')](_0xeaee('0x22'))),'count']],'group':_0xeaee('0x22'),'where':{'role':{'$or':[_0xeaee('0x26'),'user',_0xeaee('0x27')]}},'raw':!![]})['then'](function(_0x1c87da){var _0x2f6a2c={'user':_0x50c737['users']||0x0,'telephone':_0x50c737[_0xeaee('0x28')]||0x0};_0x1c87da[_0xeaee('0x29')](function(_0x54a1ba){var _0x6f56b9=_0x54a1ba['role']===_0xeaee('0x26')?_0xeaee('0x2a'):_0x54a1ba[_0xeaee('0x22')];_0x2f6a2c[_0x6f56b9]-=_0x54a1ba[_0xeaee('0x2b')];if(_0x2f6a2c[_0x6f56b9]<0x0)_0x2f6a2c[_0x6f56b9]=0x0;});_0x2e2681(_0x2f6a2c);return;});})[_0xeaee('0xc')](function(_0x4e67f6){_0x5955ac(_0x4e67f6);});});}function checkUserLimits(_0x2451e4){return new BPromise(function(_0x4a36c7,_0x2872a5){getLimits()[_0xeaee('0xb')](function(_0x267169){var _0x2df1f9=_[_0xeaee('0x2c')](_[_0xeaee('0x2d')](_0x2451e4,_0xeaee('0x22')),[_0xeaee('0x26'),'user',_0xeaee('0x27')]);var _0x5a0856=(_0x2df1f9[_0xeaee('0x26')]||0x0)+(_0x2df1f9[_0xeaee('0x2a')]||0x0);var _0x1ebfe2=_0x2df1f9[_0xeaee('0x27')]||0x0;if(_0x5a0856>_0x267169['user'])return _0x2872a5(_0xeaee('0x2e'));if(_0x1ebfe2>_0x267169[_0xeaee('0x27')])return _0x2872a5(_0xeaee('0x2f'));return _0x4a36c7();})[_0xeaee('0xc')](function(_0x36d3ed){_0x2872a5(_0x36d3ed);});});}module[_0xeaee('0x30')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xe2d7=['License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','changed','disabled','message','User','role','sequelize','COUNT','col','count','admin','telephone','users','telephones','forEach','user','pick','countBy','License\x20limit\x20reached\x20for\x20users'];(function(_0x1fcb67,_0x70fb6c){var _0x17a001=function(_0x43ae93){while(--_0x43ae93){_0x1fcb67['push'](_0x1fcb67['shift']());}};_0x17a001(++_0x70fb6c);}(_0xe2d7,0x1c4));var _0x7e2d=function(_0x5dd7ab,_0x504414){_0x5dd7ab=_0x5dd7ab-0x0;var _0x18bd60=_0xe2d7[_0x5dd7ab];return _0x18bd60;};'use strict';var util=require(_0x7e2d('0x0'));var _=require(_0x7e2d('0x1'));var moment=require(_0x7e2d('0x2'));var BPromise=require(_0x7e2d('0x3'));var hardware=require(_0x7e2d('0x4'));var encryptor=require(_0x7e2d('0x5'));var db=require(_0x7e2d('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7e2d('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x7e2d('0x8'),'machineUuid':hardware[_0x7e2d('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7e2d('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x7e2d('0xa'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4b4244){return new BPromise(function(_0x185b24,_0x1aa27c){return db[_0x7e2d('0xb')][_0x7e2d('0xc')](_[_0x7e2d('0xd')](_0x4b4244,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0xb6c6b2){return checkLicense(_0xb6c6b2,null);})[_0x7e2d('0xe')](function(_0x556a5f){_0x185b24(_0x556a5f);return;})[_0x7e2d('0xf')](function(_0x350f5b){_0x1aa27c(_0x350f5b);});});}function checkLicense(_0x3e566a,_0x13dc0c){if(!_0x3e566a){demoLicense[_0x7e2d('0x10')]=_0x3e566a[_0x7e2d('0x11')];return demoLicense;}try{var _0x3596e5=_0x13dc0c||_0x3e566a[_0x7e2d('0x12')];if(_[_0x7e2d('0x13')](_0x3596e5)){throw new Error(_0x7e2d('0x14'));}var _0x1e1d0f=_0x3e566a[_0x7e2d('0x11')];var _0x2b5b2a=_0x3e566a['data2'];var _0x3ac78f=_0x1e1d0f[_0x7e2d('0x15')]('-')[0x4];var _0x24e879=_0x1e1d0f[_0x7e2d('0x15')]('-')[0x0];var _0x46700d=encryptor[_0x7e2d('0x16')](_0x3596e5,util[_0x7e2d('0x17')](_0x7e2d('0x18'),_0x3ac78f,_0x1e1d0f,_0x24e879));var _0x5460ba=JSON[_0x7e2d('0x19')](_0x46700d);_0x5460ba[_0x7e2d('0x1a')]=![];_0x5460ba['uuid']=_0x1e1d0f;_0x5460ba[_0x7e2d('0x1b')]=hardware[_0x7e2d('0x9')]();if(_0x2b5b2a){var _0x1f7a6f=encryptor[_0x7e2d('0x16')](_0x2b5b2a);_0x5460ba[_0x7e2d('0x1c')]=_0x1f7a6f;_0x5460ba[_0x7e2d('0x1d')]=moment(_0x1f7a6f)['add'](0x7,'days')[_0x7e2d('0x17')]();_0x5460ba['grayReason']=_0x5460ba['uuid']!=_0x5460ba['machineUuid']?_0x7e2d('0x1e'):_0x7e2d('0x1f');}return _0x5460ba;}catch(_0x4a98a2){breakingLicense['uuid']=_0x3e566a[_0x7e2d('0x11')];breakingLicense[_0x7e2d('0x20')]=_0x4a98a2['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x11d40e,_0x2092ba){getLicense()[_0x7e2d('0xe')](function(_0x249d86){return db[_0x7e2d('0x21')]['findAll']({'attributes':[_0x7e2d('0x22'),[db[_0x7e2d('0x23')]['fn'](_0x7e2d('0x24'),db[_0x7e2d('0x23')][_0x7e2d('0x25')]('role')),_0x7e2d('0x26')]],'group':_0x7e2d('0x22'),'where':{'role':{'$or':[_0x7e2d('0x27'),'user',_0x7e2d('0x28')]}},'raw':!![]})[_0x7e2d('0xe')](function(_0x31710b){var _0x1c0ef9={'user':_0x249d86[_0x7e2d('0x29')]||0x0,'telephone':_0x249d86[_0x7e2d('0x2a')]||0x0};_0x31710b[_0x7e2d('0x2b')](function(_0x3d79cf){var _0x273bae=_0x3d79cf[_0x7e2d('0x22')]===_0x7e2d('0x27')?_0x7e2d('0x2c'):_0x3d79cf['role'];_0x1c0ef9[_0x273bae]-=_0x3d79cf[_0x7e2d('0x26')];if(_0x1c0ef9[_0x273bae]<0x0)_0x1c0ef9[_0x273bae]=0x0;});_0x11d40e(_0x1c0ef9);return;});})[_0x7e2d('0xf')](function(_0x58917f){_0x2092ba(_0x58917f);});});}function checkUserLimits(_0x34eaca){return new BPromise(function(_0x16d93e,_0x4d50ad){getLimits()[_0x7e2d('0xe')](function(_0x47b513){var _0x124813=_[_0x7e2d('0x2d')](_[_0x7e2d('0x2e')](_0x34eaca,_0x7e2d('0x22')),[_0x7e2d('0x27'),_0x7e2d('0x2c'),_0x7e2d('0x28')]);var _0x2212e9=(_0x124813[_0x7e2d('0x27')]||0x0)+(_0x124813[_0x7e2d('0x2c')]||0x0);var _0xa8b044=_0x124813['telephone']||0x0;if(_0x2212e9>_0x47b513[_0x7e2d('0x2c')])return _0x4d50ad(_0x7e2d('0x2f'));if(_0xa8b044>_0x47b513[_0x7e2d('0x28')])return _0x4d50ad(_0x7e2d('0x30'));return _0x16d93e();})[_0x7e2d('0xf')](function(_0x2d2a35){_0x4d50ad(_0x2d2a35);});});}module[_0x7e2d('0x31')]={'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 08f6189..723d77b 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 _0x1893=['myappanuglar-secret','app-id','secret'];(function(_0x14647d,_0x20a244){var _0x3a0cae=function(_0x6f6909){while(--_0x6f6909){_0x14647d['push'](_0x14647d['shift']());}};_0x3a0cae(++_0x20a244);}(_0x1893,0xa2));var _0x3189=function(_0x34d635,_0x2784fc){_0x34d635=_0x34d635-0x0;var _0x3ab288=_0x1893[_0x34d635];return _0x3ab288;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x3189('0x0'),'GOOGLE_ID':_0x3189('0x1'),'GOOGLE_SECRET':_0x3189('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x1893=['myappanuglar-secret','app-id','secret'];(function(_0x56f92d,_0x1d500b){var _0x290941=function(_0x44fb43){while(--_0x44fb43){_0x56f92d['push'](_0x56f92d['shift']());}};_0x290941(++_0x1d500b);}(_0x1893,0xa2));var _0x3189=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0x1893[_0x213518];return _0x1baf75;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x3189('0x0'),'GOOGLE_ID':_0x3189('0x1'),'GOOGLE_SECRET':_0x3189('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 85a72ce..a5c05cc 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x16b6=['../utils/loggers'];(function(_0x3cf740,_0x424282){var _0x3dc83a=function(_0x568ac9){while(--_0x568ac9){_0x3cf740['push'](_0x3cf740['shift']());}};_0x3dc83a(++_0x424282);}(_0x16b6,0x6a));var _0x616b=function(_0x4018b7,_0x5055c8){_0x4018b7=_0x4018b7-0x0;var _0x4eb0bd=_0x16b6[_0x4018b7];return _0x4eb0bd;};'use strict';var fileLogger=require(_0x616b('0x0'))['fileLogger'];module['exports']=fileLogger; \ No newline at end of file +var _0x13c2=['../utils/loggers','exports'];(function(_0x3a1602,_0xfbce10){var _0xeeb50f=function(_0x515304){while(--_0x515304){_0x3a1602['push'](_0x3a1602['shift']());}};_0xeeb50f(++_0xfbce10);}(_0x13c2,0xc2));var _0x213c=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x13c2[_0x220dbb];return _0x2b77de;};'use strict';var fileLogger=require(_0x213c('0x0'))['fileLogger'];module[_0x213c('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 6b95259..a2e6491 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 _0x650c=['legacy-libs','express','join','ami','../../services/agi/index.js','email','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','../../config/environment','resolve'];(function(_0x2e0a0b,_0x2efce7){var _0x5bc68b=function(_0x246bd4){while(--_0x246bd4){_0x2e0a0b['push'](_0x2e0a0b['shift']());}};_0x5bc68b(++_0x2efce7);}(_0x650c,0x8e));var _0xc650=function(_0x4b4a4b,_0xf29d3b){_0x4b4a4b=_0x4b4a4b-0x0;var _0x8ca386=_0x650c[_0x4b4a4b];return _0x8ca386;};'use strict';var path=require('path');var cfg=require(_0xc650('0x0'));var env={'NODE_PATH':path[_0xc650('0x1')](path['join'](cfg['root'],_0xc650('0x2')))};var pm2config={'apps':[{'name':_0xc650('0x3'),'script':path[_0xc650('0x4')](__dirname,'../../services/express/index.js'),'env':env},{'name':_0xc650('0x5'),'script':path[_0xc650('0x4')](__dirname,'../../services/ami/index.js'),'env':env},{'name':'agi','script':path[_0xc650('0x4')](__dirname,_0xc650('0x6')),'env':env},{'name':_0xc650('0x7'),'script':path[_0xc650('0x4')](__dirname,'../../services/email/index.js'),'env':env},{'name':'routing','script':path[_0xc650('0x4')](__dirname,_0xc650('0x8')),'env':env},{'name':_0xc650('0x9'),'script':path[_0xc650('0x4')](__dirname,_0xc650('0xa')),'env':env}]};module[_0xc650('0xb')]=pm2config; \ No newline at end of file +var _0x1e03=['../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','resolve','join','root','legacy-libs','express','../../services/express/index.js','ami','agi','../../services/agi/index.js','email'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1e03,0xaa));var _0x31e0=function(_0x4cd8d5,_0xb981d5){_0x4cd8d5=_0x4cd8d5-0x0;var _0x19995f=_0x1e03[_0x4cd8d5];return _0x19995f;};'use strict';var path=require('path');var cfg=require('../../config/environment');var env={'NODE_PATH':path[_0x31e0('0x0')](path[_0x31e0('0x1')](cfg[_0x31e0('0x2')],_0x31e0('0x3')))};var pm2config={'apps':[{'name':_0x31e0('0x4'),'script':path[_0x31e0('0x1')](__dirname,_0x31e0('0x5')),'env':env},{'name':_0x31e0('0x6'),'script':path['join'](__dirname,'../../services/ami/index.js'),'env':env},{'name':_0x31e0('0x7'),'script':path[_0x31e0('0x1')](__dirname,_0x31e0('0x8')),'env':env},{'name':_0x31e0('0x9'),'script':path[_0x31e0('0x1')](__dirname,_0x31e0('0xa')),'env':env},{'name':'routing','script':path[_0x31e0('0x1')](__dirname,_0x31e0('0xb')),'env':env},{'name':_0x31e0('0xc'),'script':path[_0x31e0('0x1')](__dirname,_0x31e0('0xd')),'env':env}]};module[_0x31e0('0xe')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 271cad0..a338b24 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 _0x9536=['describe','delete','dump','pm2','bluebird','./config','connect','connected','start','disconnect','then','stop','restart','list'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9536,0x18b));var _0x6953=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x9536[_0x21aec3];return _0x288bbc;};'use strict';var pm2=require(_0x6953('0x0'));var BPromise=require(_0x6953('0x1'));var config=require(_0x6953('0x2'));function connect(){return new BPromise(function(_0x32c574,_0xea0b82){return pm2[_0x6953('0x3')](function(_0x5bbd8d){if(_0x5bbd8d){return _0xea0b82(_0x5bbd8d);}return _0x32c574(_0x6953('0x4'));});});};exports[_0x6953('0x5')]=function(_0x49ce72){return connect()['then'](function(){return new BPromise(function(_0x56485a,_0x4867be){return pm2[_0x6953('0x5')](_0x49ce72,function(_0x1f30b5,_0x4d729a){if(_0x1f30b5){return _0x4867be(_0x1f30b5);}pm2[_0x6953('0x6')]();return _0x56485a(_0x4d729a);});});});};exports['stop']=function(_0x207a9b){return connect()[_0x6953('0x7')](function(){return new BPromise(function(_0x56b922,_0xd86e38){return pm2[_0x6953('0x8')](_0x207a9b,function(_0x2ec205,_0x732a02){if(_0x2ec205){return _0xd86e38(_0x2ec205);}pm2['disconnect']();return _0x56b922(_0x732a02);});});});};exports[_0x6953('0x9')]=function(_0x3e17f5){return connect()[_0x6953('0x7')](function(){return new BPromise(function(_0x4ff8c4,_0x3e69f8){return pm2[_0x6953('0x9')](_0x3e17f5,function(_0x31e0de,_0x5724e5){if(_0x31e0de){return _0x3e69f8(_0x31e0de);}pm2[_0x6953('0x6')]();return _0x4ff8c4(_0x5724e5);});});});};exports[_0x6953('0xa')]=function(){return connect()[_0x6953('0x7')](function(){return new BPromise(function(_0x50674e,_0x1ea11e){return pm2['list'](function(_0x47e694,_0x5d40a0){if(_0x47e694){return _0x1ea11e(_0x47e694);}pm2[_0x6953('0x6')]();return _0x50674e(_0x5d40a0);});});});};exports[_0x6953('0xb')]=function(_0x3a9e26){return connect()[_0x6953('0x7')](function(){return new BPromise(function(_0x930e0f,_0x38bbec){return pm2['describe'](_0x3a9e26,function(_0x3d9207,_0x3d1c87){if(_0x3d9207){return _0x38bbec(_0x3d9207);}pm2[_0x6953('0x6')]();return _0x930e0f(_0x3d1c87);});});});};exports[_0x6953('0xc')]=function(_0x328cf0){return connect()[_0x6953('0x7')](function(){return new BPromise(function(_0x45804b,_0x3076e4){return pm2[_0x6953('0xc')](_0x328cf0,function(_0x3e2f03,_0x607a9d){if(_0x3e2f03){return _0x3076e4(_0x3e2f03);}pm2[_0x6953('0x6')]();return _0x45804b(_0x607a9d);});});});};exports[_0x6953('0xd')]=function(){return connect()[_0x6953('0x7')](function(){return new BPromise(function(_0x30d442,_0x25ebdd){return pm2[_0x6953('0xd')](function(_0x10933e){if(_0x10933e){return _0x25ebdd(_0x10933e);}return _0x30d442('saved');});});});}; \ No newline at end of file +var _0x59b1=['disconnect','restart','list','describe','then','delete','dump','bluebird','connect','start','stop'];(function(_0x455239,_0x52b37d){var _0x233bff=function(_0x54400c){while(--_0x54400c){_0x455239['push'](_0x455239['shift']());}};_0x233bff(++_0x52b37d);}(_0x59b1,0x11a));var _0x159b=function(_0x3566c4,_0x34537f){_0x3566c4=_0x3566c4-0x0;var _0x8a2656=_0x59b1[_0x3566c4];return _0x8a2656;};'use strict';var pm2=require('pm2');var BPromise=require(_0x159b('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x1cc7c9,_0x495e50){return pm2[_0x159b('0x1')](function(_0xbf2ff4){if(_0xbf2ff4){return _0x495e50(_0xbf2ff4);}return _0x1cc7c9('connected');});});};exports[_0x159b('0x2')]=function(_0x287119){return connect()['then'](function(){return new BPromise(function(_0x46bcf9,_0x3ea073){return pm2['start'](_0x287119,function(_0x166926,_0x6b161f){if(_0x166926){return _0x3ea073(_0x166926);}pm2['disconnect']();return _0x46bcf9(_0x6b161f);});});});};exports[_0x159b('0x3')]=function(_0x250a31){return connect()['then'](function(){return new BPromise(function(_0x1ff51f,_0x3aa5d4){return pm2['stop'](_0x250a31,function(_0x17071f,_0x244645){if(_0x17071f){return _0x3aa5d4(_0x17071f);}pm2[_0x159b('0x4')]();return _0x1ff51f(_0x244645);});});});};exports[_0x159b('0x5')]=function(_0x32446e){return connect()['then'](function(){return new BPromise(function(_0x4773df,_0x30db77){return pm2[_0x159b('0x5')](_0x32446e,function(_0x468a5a,_0x4d3d6b){if(_0x468a5a){return _0x30db77(_0x468a5a);}pm2['disconnect']();return _0x4773df(_0x4d3d6b);});});});};exports[_0x159b('0x6')]=function(){return connect()['then'](function(){return new BPromise(function(_0x3fa6c9,_0x3f9ecd){return pm2[_0x159b('0x6')](function(_0x1e8834,_0x1d911b){if(_0x1e8834){return _0x3f9ecd(_0x1e8834);}pm2[_0x159b('0x4')]();return _0x3fa6c9(_0x1d911b);});});});};exports[_0x159b('0x7')]=function(_0x34adeb){return connect()[_0x159b('0x8')](function(){return new BPromise(function(_0x5d8c6b,_0x536e47){return pm2[_0x159b('0x7')](_0x34adeb,function(_0x3247e6,_0x182ddf){if(_0x3247e6){return _0x536e47(_0x3247e6);}pm2['disconnect']();return _0x5d8c6b(_0x182ddf);});});});};exports['delete']=function(_0x2bb11d){return connect()[_0x159b('0x8')](function(){return new BPromise(function(_0x3cccfd,_0x1e6d4a){return pm2[_0x159b('0x9')](_0x2bb11d,function(_0x3c9e0b,_0xf1f3b5){if(_0x3c9e0b){return _0x1e6d4a(_0x3c9e0b);}pm2[_0x159b('0x4')]();return _0x3cccfd(_0xf1f3b5);});});});};exports[_0x159b('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x380432,_0x2f9207){return pm2[_0x159b('0xa')](function(_0x32fb91){if(_0x32fb91){return _0x2f9207(_0x32fb91);}return _0x380432('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 941704d..1ad4a45 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 _0x5f4b=['format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../mysqldb','../logger','schedule','redis','defaults','Setting','find','chatTimeout','then','ChatInteraction','findAll','minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','system','timeout'];(function(_0xe65705,_0x2e6f58){var _0x5160cd=function(_0x20f711){while(--_0x20f711){_0xe65705['push'](_0xe65705['shift']());}};_0x5160cd(++_0x2e6f58);}(_0x5f4b,0x1ea));var _0xb5f4=function(_0xdfb218,_0x39ebd4){_0xdfb218=_0xdfb218-0x0;var _0x719961=_0x5f4b[_0xdfb218];return _0x719961;};'use strict';var _=require(_0xb5f4('0x0'));var moment=require(_0xb5f4('0x1'));var Redis=require(_0xb5f4('0x2'));var util=require(_0xb5f4('0x3'));var config=require('../../config/environment');var db=require(_0xb5f4('0x4'))['db'];var logger=require(_0xb5f4('0x5'))(_0xb5f4('0x6'));config[_0xb5f4('0x7')]=_[_0xb5f4('0x8')](config[_0xb5f4('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb5f4('0x7')]));function closeInteractions(){var _0x50938c=0x0;var _0x4bf3d3=[];return db[_0xb5f4('0x9')][_0xb5f4('0xa')]({'raw':!![],'attributes':['id',_0xb5f4('0xb')],'where':{'id':0x1}})[_0xb5f4('0xc')](function(_0x54cbbb){_0x50938c=_0x54cbbb[_0xb5f4('0xb')];if(_0x50938c){return db[_0xb5f4('0xd')][_0xb5f4('0xe')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x54cbbb[_0xb5f4('0xb')],_0xb5f4('0xf'))}}});}else{return[];}})[_0xb5f4('0xc')](function(_0x2cb214){if(_0x2cb214&&_0x2cb214[_0xb5f4('0x10')]){_0x4bf3d3=_[_0xb5f4('0x11')](_0x2cb214||[],'id');logger['info'](_0xb5f4('0x12'),_0x4bf3d3[_0xb5f4('0x13')]());return db[_0xb5f4('0xd')]['update']({'closeReason':_0xb5f4('0x14'),'disposition':_0xb5f4('0x15'),'closed':!![],'closedAt':moment()[_0xb5f4('0x16')](_0xb5f4('0x17'))},{'where':{'id':_0x4bf3d3}});}})[_0xb5f4('0xc')](function(){if(_0x4bf3d3&&_0x4bf3d3['length']){logger[_0xb5f4('0x18')](_0xb5f4('0x19'),_0x4bf3d3[_0xb5f4('0x13')]());for(var _0x4fcf97=0x0;_0x4fcf97<_0x4bf3d3[_0xb5f4('0x10')];_0x4fcf97++){io['emit'](_0xb5f4('0x1a'),{'id':_0x4bf3d3[_0x4fcf97],'closed':!![]});}}})[_0xb5f4('0x1b')](function(_0x2f40fd){logger[_0xb5f4('0x1c')](_0xb5f4('0x1d'),_0x2f40fd?util[_0xb5f4('0x1e')](_0x2f40fd,{'showHidden':![],'depth':null}):'');});}exports[_0xb5f4('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x8e3d=['ChatInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','join','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','socket.io-emitter','Setting','find','chatTimeout','then','findAll','lastMsgAt','subtract','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e3d,0x1ea));var _0xd8e3=function(_0x55cab6,_0xcfb493){_0x55cab6=_0x55cab6-0x0;var _0x556ec1=_0x8e3d[_0x55cab6];return _0x556ec1;};'use strict';var _=require(_0xd8e3('0x0'));var moment=require(_0xd8e3('0x1'));var Redis=require('ioredis');var util=require(_0xd8e3('0x2'));var config=require(_0xd8e3('0x3'));var db=require(_0xd8e3('0x4'))['db'];var logger=require(_0xd8e3('0x5'))(_0xd8e3('0x6'));config[_0xd8e3('0x7')]=_['defaults'](config[_0xd8e3('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xd8e3('0x8'))(new Redis(config[_0xd8e3('0x7')]));function closeInteractions(){var _0xf5a7dd=0x0;var _0x309baa=[];return db[_0xd8e3('0x9')][_0xd8e3('0xa')]({'raw':!![],'attributes':['id',_0xd8e3('0xb')],'where':{'id':0x1}})[_0xd8e3('0xc')](function(_0x4a4c3a){_0xf5a7dd=_0x4a4c3a[_0xd8e3('0xb')];if(_0xf5a7dd){return db['ChatInteraction'][_0xd8e3('0xd')]({'raw':!![],'attributes':['id',_0xd8e3('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xd8e3('0xf')](_0x4a4c3a['chatTimeout'],_0xd8e3('0x10'))}}});}else{return[];}})[_0xd8e3('0xc')](function(_0x131646){if(_0x131646&&_0x131646[_0xd8e3('0x11')]){_0x309baa=_['map'](_0x131646||[],'id');logger[_0xd8e3('0x12')](_0xd8e3('0x13'),_0x309baa['join']());return db[_0xd8e3('0x14')][_0xd8e3('0x15')]({'closeReason':_0xd8e3('0x16'),'disposition':_0xd8e3('0x17'),'closed':!![],'closedAt':moment()[_0xd8e3('0x18')](_0xd8e3('0x19'))},{'where':{'id':_0x309baa}});}})[_0xd8e3('0xc')](function(){if(_0x309baa&&_0x309baa[_0xd8e3('0x11')]){logger[_0xd8e3('0x12')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x309baa[_0xd8e3('0x1a')]());for(var _0x5c0184=0x0;_0x5c0184<_0x309baa[_0xd8e3('0x11')];_0x5c0184++){io[_0xd8e3('0x1b')](_0xd8e3('0x1c'),{'id':_0x309baa[_0x5c0184],'closed':!![]});}}})[_0xd8e3('0x1d')](function(_0x285a46){logger[_0xd8e3('0x1e')](_0xd8e3('0x1f'),_0x285a46?util[_0xd8e3('0x20')](_0x285a46,{'showHidden':![],'depth':null}):'');});}exports[_0xd8e3('0x21')]=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 4ff2ef7..6a16359 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 _0x8aec=['../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x1ab0e6,_0x17ba8d){var _0x248815=function(_0x5d2b40){while(--_0x5d2b40){_0x1ab0e6['push'](_0x1ab0e6['shift']());}};_0x248815(++_0x17ba8d);}(_0x8aec,0x136));var _0xc8ae=function(_0x2f1592,_0x80902e){_0x2f1592=_0x2f1592-0x0;var _0x4af8bf=_0x8aec[_0x2f1592];return _0x4af8bf;};'use strict';function start(){var _0x75c0c7=require(_0xc8ae('0x0'));return _0x75c0c7['startAllRefreshIntervals']();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0x429a=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x5d4adf,_0xac4932){var _0x34ef1a=function(_0xa5b6d2){while(--_0xa5b6d2){_0x5d4adf['push'](_0x5d4adf['shift']());}};_0x34ef1a(++_0xac4932);}(_0x429a,0x183));var _0xa429=function(_0xf168d3,_0x43dcfc){_0xf168d3=_0xf168d3-0x0;var _0x17fb54=_0x429a[_0xf168d3];return _0x17fb54;};'use strict';function start(){var _0x106157=require(_0xa429('0x0'));return _0x106157[_0xa429('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 e02e2f6..2f117ac 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 _0x4ccc=['stop','deleteJob','delete\x20cron','toRun','length','my\x20id','run\x20job','cron','active','isBetween','startAt','endAt','add','start','stop\x20cron','exists','update\x20cron','run','util','lodash','moment','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','format','\x22%s\x22\x20<%s>','name','Smtp','user','bcc','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','basename','extname','zip','existsSync','status','Sent','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','message','attachments','sendIfEmpty','info','request','SendMail','then','error\x20mail','email\x20sent','catch','error','stringify','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','keys','jobs','toString','keyBy','difference'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4ccc,0x1ac));var _0xc4cc=function(_0x4c9585,_0x571a9c){_0x4c9585=_0x4c9585-0x0;var _0x2d7b2c=_0x4ccc[_0x4c9585];return _0x2d7b2c;};'use strict';var fs=require('fs');var util=require(_0xc4cc('0x0'));var path=require('path');var _=require(_0xc4cc('0x1'));var moment=require(_0xc4cc('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xc4cc('0x3'))(_0xc4cc('0x4'));var db=require(_0xc4cc('0x5'))['db'];var analyticCustomReportController=require(_0xc4cc('0x6'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xc4cc('0x7')][_0xc4cc('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3cfd82,_0x4cfb79){return function(){logger['info'](_0xc4cc('0x9'),_0x3cfd82[_0xc4cc('0xa')]);var _0xf5b138=!![];var _0xbf24e7=_0x3cfd82[_0xc4cc('0xb')]['getSmtpOptions']();var _0x43321c={'account':_0xbf24e7,'message':{'from':util[_0xc4cc('0xc')](_0xc4cc('0xd'),_0x3cfd82[_0xc4cc('0xb')][_0xc4cc('0xe')],_0x3cfd82[_0xc4cc('0xb')][_0xc4cc('0xa')]||_0x3cfd82['MailAccount'][_0xc4cc('0xf')][_0xc4cc('0x10')]),'to':_0x3cfd82['email'],'cc':_0x3cfd82['cc'],'bcc':_0x3cfd82[_0xc4cc('0x11')],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x4cfb79[_0xc4cc('0xe')],_0x3cfd82[_0xc4cc('0x12')],_0x3cfd82[_0xc4cc('0x13')])}};var _0x4672d2=path[_0xc4cc('0x14')](__dirname,_0xc4cc('0x15'));var _0x2b8ce6=_0x4cfb79['savename'];var _0x222369=util[_0xc4cc('0xc')](_0xc4cc('0x16'),path[_0xc4cc('0x17')](_0x4cfb79['savename'],path[_0xc4cc('0x18')](_0x4cfb79['savename'])),_0xc4cc('0x19'));var _0x320c69=path[_0xc4cc('0x14')](_0x4672d2,_0x2b8ce6);var _0x4362cd=path['join'](_0x4672d2,_0x222369);if(fs[_0xc4cc('0x1a')](_0x320c69)){_0x4cfb79[_0xc4cc('0x1b')]=_0xc4cc('0x1c');_0x43321c['message']['attachments']=[{'filename':_0x2b8ce6,'path':_0x320c69}];_0x43321c['message'][_0xc4cc('0x1d')]=util['format'](_0xc4cc('0x1e'),JSON['stringify'](_0x4cfb79,null,0x2));}else if(fs[_0xc4cc('0x1a')](_0x4362cd)){_0x4cfb79[_0xc4cc('0x1b')]=_0xc4cc('0x1c');_0x43321c[_0xc4cc('0x1f')][_0xc4cc('0x20')]=[{'filename':_0x222369,'path':_0x4362cd}];}else{_0x43321c['message'][_0xc4cc('0x1d')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x3cfd82[_0xc4cc('0x21')]){_0xf5b138=![];logger[_0xc4cc('0x22')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0xf5b138){return client[_0xc4cc('0x23')](_0xc4cc('0x24'),_0x43321c)[_0xc4cc('0x25')](function(_0xefca08){if(_0xefca08['error']){return logger['error'](_0xc4cc('0x26'),JSON['stringify'](_0xefca08));}return logger[_0xc4cc('0x22')](_0xc4cc('0x27'));})[_0xc4cc('0x28')](function(_0x18a67a){return logger[_0xc4cc('0x29')](_0xc4cc('0x26'),JSON['stringify'](_0x18a67a));});}};}function handleError(){return function(_0x2bb752){return logger[_0xc4cc('0x29')](JSON[_0xc4cc('0x2a')](_0x2bb752));};}function handleResult(_0x18e7a1){return function(_0x57339a){logger['info'](_0xc4cc('0x2b'),JSON[_0xc4cc('0x2a')](_0x57339a));if(_0x18e7a1[_0xc4cc('0xb')]&&_0x18e7a1[_0xc4cc('0xb')][_0xc4cc('0xf')]&&!_[_0xc4cc('0x2c')](_0x18e7a1[_0xc4cc('0xa')])){setTimeout(handleSendEmail(_0x18e7a1,_0x57339a),0x3c*0x3e8);}};}function handleJob(_0x468a61){return function(){try{if(_[_0xc4cc('0x2c')](_0x468a61[_0xc4cc('0x12')])){return logger[_0xc4cc('0x22')](_0xc4cc('0x2d'));}if(_['isNil'](_0x468a61[_0xc4cc('0x13')])){return logger[_0xc4cc('0x22')](_0xc4cc('0x2e'));}var _0xeb61d0={'startDate':moment()['subtract'](_0x468a61[_0xc4cc('0x12')],_0x468a61[_0xc4cc('0x13')])[_0xc4cc('0xc')](_0xc4cc('0x2f')),'endDate':moment()[_0xc4cc('0xc')](_0xc4cc('0x2f')),'type':_0xc4cc('0x30'),'output':_0x468a61[_0xc4cc('0x31')],'name':_0x468a61[_0xc4cc('0xe')]};if(!_[_0xc4cc('0x2c')](_0x468a61[_0xc4cc('0x32')])){logger['info'](_0xc4cc('0x33'),_0x468a61['DefaultReportId']);return analyticDefaultReportController[_0xc4cc('0x34')]({'id':_0x468a61['DefaultReportId']},_0xeb61d0)[_0xc4cc('0x25')](handleResult(_0x468a61))[_0xc4cc('0x28')](handleError());}if(!_[_0xc4cc('0x2c')](_0x468a61[_0xc4cc('0x35')])){logger[_0xc4cc('0x22')](_0xc4cc('0x36'),_0x468a61[_0xc4cc('0x35')]);return analyticCustomReportController[_0xc4cc('0x34')]({'id':_0x468a61[_0xc4cc('0x35')]},_0xeb61d0)['then'](handleResult(_0x468a61))[_0xc4cc('0x28')](handleError());}}catch(_0x2ceb79){logger[_0xc4cc('0x29')](JSON['stringify'](_0x2ceb79));}return logger[_0xc4cc('0x22')](_0xc4cc('0x37'));};}function getJobs(_0x2f76a1){var _0x2d9b9b={};if(_0x2f76a1){_0x2d9b9b['id']=_0x2f76a1;}return db[_0xc4cc('0x38')]['findAll']({'where':_0x2d9b9b,'include':[{'model':db[_0xc4cc('0xb')],'attributes':['id',_0xc4cc('0xe'),_0xc4cc('0xa')],'include':[{'model':db[_0xc4cc('0x39')],'as':_0xc4cc('0xf'),'include':[{'model':db[_0xc4cc('0x3a')],'as':'CloudProvider'}]}]}]})['then'](function(_0x4051bc){var _0x5234e0=_[_0xc4cc('0x3b')](manager[_0xc4cc('0x3c')]);var _0x3fee4f=_['map'](_0x4051bc,function(_0x35591e){return _0x35591e['id'][_0xc4cc('0x3d')]();});var _0x270302=_[_0xc4cc('0x3e')](_0x4051bc,function(_0x301dfd){return _0x301dfd['id'][_0xc4cc('0x3d')]();});var _0x233054=_0x2f76a1?_0x3fee4f:_['difference'](_0x3fee4f,_0x5234e0);var _0x2bab71=_['intersection'](_0x3fee4f,_0x5234e0);var _0x1a2711=_[_0xc4cc('0x3f')](_0x5234e0,_0x3fee4f);var _0x2d08f6;var _0xc7f2ff;for(_0x2d08f6=0x0;_0x2d08f6<_0x1a2711['length']&&!_0x2f76a1;_0x2d08f6+=0x1){_0xc7f2ff=_0x1a2711[_0x2d08f6][_0xc4cc('0x3d')]();if(manager['exists'](_0xc7f2ff)){manager[_0xc4cc('0x40')](_0xc7f2ff);manager[_0xc4cc('0x41')](_0xc7f2ff);logger[_0xc4cc('0x22')](_0xc4cc('0x42'),_0xc7f2ff);}}logger[_0xc4cc('0x22')](_0xc4cc('0x43'),JSON['stringify'](_0x233054));for(_0x2d08f6=0x0;_0x2d08f6<_0x233054[_0xc4cc('0x44')];_0x2d08f6+=0x1){_0xc7f2ff=_0x233054[_0x2d08f6][_0xc4cc('0x3d')]();logger[_0xc4cc('0x22')]('index',_0xc7f2ff);if(_0x2f76a1){logger[_0xc4cc('0x22')](_0xc4cc('0x45'),_0x2f76a1);logger[_0xc4cc('0x22')](JSON[_0xc4cc('0x2a')](_0x270302[_0xc7f2ff]));BPromise['resolve']()[_0xc4cc('0x25')](handleJob(_0x270302[_0xc7f2ff]));logger[_0xc4cc('0x22')](_0xc4cc('0x46'),_0x270302[_0xc7f2ff][_0xc4cc('0xe')],_0x270302[_0xc7f2ff][_0xc4cc('0x47')]);}else if(_0x270302[_0xc7f2ff][_0xc4cc('0x47')]&&_0x270302[_0xc7f2ff][_0xc4cc('0x48')]&&moment()[_0xc4cc('0x49')](_0x270302[_0xc7f2ff][_0xc4cc('0x4a')],_0x270302[_0xc7f2ff][_0xc4cc('0x4b')])){manager[_0xc4cc('0x4c')](_0xc7f2ff,_0x270302[_0xc7f2ff]['cron'],handleJob(_0x270302[_0xc7f2ff]));manager[_0xc4cc('0x4d')](_0xc7f2ff);logger[_0xc4cc('0x22')]('add\x20cron',_0x270302[_0xc7f2ff][_0xc4cc('0xe')],_0x270302[_0xc7f2ff][_0xc4cc('0x47')]);}else if(manager['exists'](_0xc7f2ff)){manager['stop'](_0xc7f2ff);manager['deleteJob'](_0xc7f2ff);logger[_0xc4cc('0x22')](_0xc4cc('0x4e'),_0x270302[_0xc7f2ff][_0xc4cc('0xe')],_0x270302[_0xc7f2ff][_0xc4cc('0x47')]);}}for(_0x2d08f6=0x0,_0xc7f2ff;_0x2d08f6<_0x2bab71[_0xc4cc('0x44')]&&!_0x2f76a1;_0x2d08f6+=0x1){_0xc7f2ff=_0x2bab71[_0x2d08f6]['toString']();if(manager[_0xc4cc('0x4f')](_0xc7f2ff)){if(_0x270302[_0xc7f2ff][_0xc4cc('0x47')]&&_0x270302[_0xc7f2ff]['active']&&moment()['isBetween'](_0x270302[_0xc7f2ff]['startAt'],_0x270302[_0xc7f2ff][_0xc4cc('0x4b')])){manager['update'](_0xc7f2ff,_0x270302[_0xc7f2ff][_0xc4cc('0x47')],handleJob(_0x270302[_0xc7f2ff]));logger[_0xc4cc('0x22')](_0xc4cc('0x50'),_0x270302[_0xc7f2ff]['name'],_0x270302[_0xc7f2ff][_0xc4cc('0x47')]);}else{manager['stop'](_0xc7f2ff);manager[_0xc4cc('0x41')](_0xc7f2ff);logger[_0xc4cc('0x22')](_0xc4cc('0x4e'),_0x270302[_0xc7f2ff][_0xc4cc('0xe')],_0x270302[_0xc7f2ff][_0xc4cc('0x47')]);}}}})[_0xc4cc('0x28')](function(_0x1dc30e){logger[_0xc4cc('0x29')](JSON[_0xc4cc('0x2a')](_0x1dc30e));});}exports[_0xc4cc('0x51')]=function(_0x557702){return getJobs(_0x557702);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x9251=['runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','CloudProvider','jobs','toString','keyBy','difference','length','stop','deleteJob','delete\x20cron','toRun','index','resolve','cron','isBetween','add','start','exists','update','update\x20cron','stop\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','name','Smtp','bcc','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','basename','savename','zip','existsSync','status','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','then','error','error\x20mail','email\x20sent','isNil','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s'];(function(_0x2fd0ec,_0x34a4e0){var _0x1a0601=function(_0x1ee677){while(--_0x1ee677){_0x2fd0ec['push'](_0x2fd0ec['shift']());}};_0x1a0601(++_0x34a4e0);}(_0x9251,0x1ef));var _0x1925=function(_0x14e9f0,_0x287f90){_0x14e9f0=_0x14e9f0-0x0;var _0xa63f7e=_0x9251[_0x14e9f0];return _0xa63f7e;};'use strict';var fs=require('fs');var util=require(_0x1925('0x0'));var path=require(_0x1925('0x1'));var _=require(_0x1925('0x2'));var moment=require(_0x1925('0x3'));var CronJobManager=require(_0x1925('0x4'));var jayson=require(_0x1925('0x5'));var BPromise=require(_0x1925('0x6'));var logger=require(_0x1925('0x7'))(_0x1925('0x8'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x1925('0x9'));var analyticDefaultReportController=require(_0x1925('0xa'));var client=jayson['client'][_0x1925('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4aaaa4,_0x1f60e8){return function(){logger[_0x1925('0xc')](_0x1925('0xd'),_0x4aaaa4[_0x1925('0xe')]);var _0x1323b5=!![];var _0x21fe15=_0x4aaaa4[_0x1925('0xf')][_0x1925('0x10')]();var _0x3d2b5b={'account':_0x21fe15,'message':{'from':util[_0x1925('0x11')]('\x22%s\x22\x20<%s>',_0x4aaaa4[_0x1925('0xf')][_0x1925('0x12')],_0x4aaaa4[_0x1925('0xf')][_0x1925('0xe')]||_0x4aaaa4[_0x1925('0xf')][_0x1925('0x13')]['user']),'to':_0x4aaaa4[_0x1925('0xe')],'cc':_0x4aaaa4['cc'],'bcc':_0x4aaaa4[_0x1925('0x14')],'subject':util[_0x1925('0x11')]('Report\x20%s\x20last\x20%s\x20%s',_0x1f60e8[_0x1925('0x12')],_0x4aaaa4[_0x1925('0x15')],_0x4aaaa4[_0x1925('0x16')])}};var _0x28f1fe=path[_0x1925('0x17')](__dirname,_0x1925('0x18'));var _0x2ca3c2=_0x1f60e8['savename'];var _0x559de6=util['format'](_0x1925('0x19'),path[_0x1925('0x1a')](_0x1f60e8['savename'],path['extname'](_0x1f60e8[_0x1925('0x1b')])),_0x1925('0x1c'));var _0x176235=path[_0x1925('0x17')](_0x28f1fe,_0x2ca3c2);var _0x2ae3a2=path[_0x1925('0x17')](_0x28f1fe,_0x559de6);if(fs[_0x1925('0x1d')](_0x176235)){_0x1f60e8[_0x1925('0x1e')]=_0x1925('0x1f');_0x3d2b5b['message'][_0x1925('0x20')]=[{'filename':_0x2ca3c2,'path':_0x176235}];_0x3d2b5b[_0x1925('0x21')][_0x1925('0x22')]=util[_0x1925('0x11')](_0x1925('0x23'),JSON[_0x1925('0x24')](_0x1f60e8,null,0x2));}else if(fs['existsSync'](_0x2ae3a2)){_0x1f60e8[_0x1925('0x1e')]=_0x1925('0x1f');_0x3d2b5b['message'][_0x1925('0x20')]=[{'filename':_0x559de6,'path':_0x2ae3a2}];}else{_0x3d2b5b[_0x1925('0x21')]['text']=_0x1925('0x25');if(!_0x4aaaa4[_0x1925('0x26')]){_0x1323b5=![];logger[_0x1925('0xc')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x1323b5){return client[_0x1925('0x27')](_0x1925('0x28'),_0x3d2b5b)[_0x1925('0x29')](function(_0x345e74){if(_0x345e74[_0x1925('0x2a')]){return logger[_0x1925('0x2a')](_0x1925('0x2b'),JSON[_0x1925('0x24')](_0x345e74));}return logger['info'](_0x1925('0x2c'));})['catch'](function(_0x5ccb25){return logger['error'](_0x1925('0x2b'),JSON['stringify'](_0x5ccb25));});}};}function handleError(){return function(_0x8f3e4c){return logger[_0x1925('0x2a')](JSON['stringify'](_0x8f3e4c));};}function handleResult(_0x1b62ae){return function(_0x1509ce){logger[_0x1925('0xc')]('data',JSON[_0x1925('0x24')](_0x1509ce));if(_0x1b62ae[_0x1925('0xf')]&&_0x1b62ae[_0x1925('0xf')][_0x1925('0x13')]&&!_[_0x1925('0x2d')](_0x1b62ae[_0x1925('0xe')])){setTimeout(handleSendEmail(_0x1b62ae,_0x1509ce),0x3c*0x3e8);}};}function handleJob(_0x52d9be){return function(){try{if(_[_0x1925('0x2d')](_0x52d9be['subtractNumber'])){return logger[_0x1925('0xc')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x1925('0x2d')](_0x52d9be[_0x1925('0x16')])){return logger[_0x1925('0xc')]('subtractUnit\x20null\x20or\x20undefined');}var _0x5e877f={'startDate':moment()[_0x1925('0x2e')](_0x52d9be['subtractNumber'],_0x52d9be['subtractUnit'])['format'](_0x1925('0x2f')),'endDate':moment()[_0x1925('0x11')](_0x1925('0x2f')),'type':'scheduled','output':_0x52d9be[_0x1925('0x30')],'name':_0x52d9be[_0x1925('0x12')]};if(!_[_0x1925('0x2d')](_0x52d9be[_0x1925('0x31')])){logger[_0x1925('0xc')](_0x1925('0x32'),_0x52d9be['DefaultReportId']);return analyticDefaultReportController[_0x1925('0x33')]({'id':_0x52d9be[_0x1925('0x31')]},_0x5e877f)[_0x1925('0x29')](handleResult(_0x52d9be))[_0x1925('0x34')](handleError());}if(!_[_0x1925('0x2d')](_0x52d9be[_0x1925('0x35')])){logger['info'](_0x1925('0x36'),_0x52d9be['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x52d9be[_0x1925('0x35')]},_0x5e877f)[_0x1925('0x29')](handleResult(_0x52d9be))[_0x1925('0x34')](handleError());}}catch(_0x418ce6){logger['error'](JSON[_0x1925('0x24')](_0x418ce6));}return logger['info'](_0x1925('0x37'));};}function getJobs(_0x503c88){var _0x3a2854={};if(_0x503c88){_0x3a2854['id']=_0x503c88;}return db['Schedule'][_0x1925('0x38')]({'where':_0x3a2854,'include':[{'model':db[_0x1925('0xf')],'attributes':['id',_0x1925('0x12'),_0x1925('0xe')],'include':[{'model':db['MailServerOut'],'as':_0x1925('0x13'),'include':[{'model':db[_0x1925('0x39')],'as':_0x1925('0x39')}]}]}]})[_0x1925('0x29')](function(_0x19bcd5){var _0x3cf863=_['keys'](manager[_0x1925('0x3a')]);var _0x38854b=_['map'](_0x19bcd5,function(_0x22851b){return _0x22851b['id'][_0x1925('0x3b')]();});var _0x80d8a7=_[_0x1925('0x3c')](_0x19bcd5,function(_0x4f16a7){return _0x4f16a7['id'][_0x1925('0x3b')]();});var _0x53c36a=_0x503c88?_0x38854b:_['difference'](_0x38854b,_0x3cf863);var _0x578f5b=_['intersection'](_0x38854b,_0x3cf863);var _0x5c891e=_[_0x1925('0x3d')](_0x3cf863,_0x38854b);var _0x38d9ec;var _0xcc7a88;for(_0x38d9ec=0x0;_0x38d9ec<_0x5c891e[_0x1925('0x3e')]&&!_0x503c88;_0x38d9ec+=0x1){_0xcc7a88=_0x5c891e[_0x38d9ec][_0x1925('0x3b')]();if(manager['exists'](_0xcc7a88)){manager[_0x1925('0x3f')](_0xcc7a88);manager[_0x1925('0x40')](_0xcc7a88);logger[_0x1925('0xc')](_0x1925('0x41'),_0xcc7a88);}}logger[_0x1925('0xc')](_0x1925('0x42'),JSON['stringify'](_0x53c36a));for(_0x38d9ec=0x0;_0x38d9ec<_0x53c36a['length'];_0x38d9ec+=0x1){_0xcc7a88=_0x53c36a[_0x38d9ec]['toString']();logger[_0x1925('0xc')](_0x1925('0x43'),_0xcc7a88);if(_0x503c88){logger['info']('my\x20id',_0x503c88);logger[_0x1925('0xc')](JSON[_0x1925('0x24')](_0x80d8a7[_0xcc7a88]));BPromise[_0x1925('0x44')]()[_0x1925('0x29')](handleJob(_0x80d8a7[_0xcc7a88]));logger[_0x1925('0xc')]('run\x20job',_0x80d8a7[_0xcc7a88][_0x1925('0x12')],_0x80d8a7[_0xcc7a88][_0x1925('0x45')]);}else if(_0x80d8a7[_0xcc7a88]['cron']&&_0x80d8a7[_0xcc7a88]['active']&&moment()[_0x1925('0x46')](_0x80d8a7[_0xcc7a88]['startAt'],_0x80d8a7[_0xcc7a88]['endAt'])){manager[_0x1925('0x47')](_0xcc7a88,_0x80d8a7[_0xcc7a88][_0x1925('0x45')],handleJob(_0x80d8a7[_0xcc7a88]));manager[_0x1925('0x48')](_0xcc7a88);logger[_0x1925('0xc')]('add\x20cron',_0x80d8a7[_0xcc7a88][_0x1925('0x12')],_0x80d8a7[_0xcc7a88][_0x1925('0x45')]);}else if(manager[_0x1925('0x49')](_0xcc7a88)){manager['stop'](_0xcc7a88);manager[_0x1925('0x40')](_0xcc7a88);logger[_0x1925('0xc')]('stop\x20cron',_0x80d8a7[_0xcc7a88]['name'],_0x80d8a7[_0xcc7a88][_0x1925('0x45')]);}}for(_0x38d9ec=0x0,_0xcc7a88;_0x38d9ec<_0x578f5b['length']&&!_0x503c88;_0x38d9ec+=0x1){_0xcc7a88=_0x578f5b[_0x38d9ec][_0x1925('0x3b')]();if(manager[_0x1925('0x49')](_0xcc7a88)){if(_0x80d8a7[_0xcc7a88]['cron']&&_0x80d8a7[_0xcc7a88]['active']&&moment()['isBetween'](_0x80d8a7[_0xcc7a88]['startAt'],_0x80d8a7[_0xcc7a88]['endAt'])){manager[_0x1925('0x4a')](_0xcc7a88,_0x80d8a7[_0xcc7a88][_0x1925('0x45')],handleJob(_0x80d8a7[_0xcc7a88]));logger[_0x1925('0xc')](_0x1925('0x4b'),_0x80d8a7[_0xcc7a88][_0x1925('0x12')],_0x80d8a7[_0xcc7a88][_0x1925('0x45')]);}else{manager[_0x1925('0x3f')](_0xcc7a88);manager['deleteJob'](_0xcc7a88);logger[_0x1925('0xc')](_0x1925('0x4c'),_0x80d8a7[_0xcc7a88]['name'],_0x80d8a7[_0xcc7a88][_0x1925('0x45')]);}}}})[_0x1925('0x34')](function(_0x56f6d3){logger[_0x1925('0x2a')](JSON[_0x1925('0x24')](_0x56f6d3));});}exports[_0x1925('0x4d')]=function(_0x5a549b){return getJobs(_0x5a549b);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index d229499..c162b93 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 _0x317b=['catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','start','lodash','aws-sdk','util','bluebird','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeRegion','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','transcribeName','TranscriptionJobStatus','fileText','COMPLETED','TranscriptionJob','TranscriptFileUri','format','[RECORDING:%d]\x20Get\x20transcript','Transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','length','transcripts','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentiment','bucket','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x317b,0x1c7));var _0xb317=function(_0x32bfc2,_0x2d3929){_0x32bfc2=_0x32bfc2-0x0;var _0x454478=_0x317b[_0x32bfc2];return _0x454478;};var _=require(_0xb317('0x0'));var AWS=require(_0xb317('0x1'));var rp=require('request-promise');var util=require(_0xb317('0x2'));var BPromise=require(_0xb317('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xb317('0x4'))(_0xb317('0x5'));function getTranscriptionJob(_0x423e4e,_0x211f10,_0x2d7cfc,_0x6261e6){return new Promise(function(_0x2904b8,_0x33ed9c){var _0x2161fc=new AWS[(_0xb317('0x6'))]({'accessKeyId':_0x211f10,'secretAccessKey':_0x423e4e,'region':_0x2d7cfc});_0x2161fc['getTranscriptionJob']({'TranscriptionJobName':_0x6261e6},function(_0x31c7d5,_0x6a96e9){if(_0x31c7d5){return _0x33ed9c(_0x31c7d5);}else{return _0x2904b8(_0x6a96e9);}});});}function sentiment(_0x560c44,_0x37a07b,_0x3ce77d,_0x45e4a0,_0xd2deea){return new Promise(function(_0xbffffb,_0x354a87){var _0x48f311=new AWS[(_0xb317('0x7'))]({'accessKeyId':_0x37a07b,'secretAccessKey':_0x560c44,'region':_0x3ce77d});_0x48f311[_0xb317('0x8')]({'Text':_0x45e4a0,'LanguageCode':_0xd2deea['substring'](0x0,0x2)},function(_0x1000d9,_0x494541){if(_0x1000d9){return _0x354a87(_0x1000d9);}else{return _0xbffffb(_0x494541);}});});}function checkTranscribeJob(_0x2369e6,_0x1f9624,_0x458584){var _0x15f3f5;return new BPromise(function(_0x4d99d8,_0xf88e1c){logger['info'](util['format'](_0xb317('0x9'),_0x2369e6['id'],_0x2369e6['transcribeName']));return getTranscriptionJob(_0x458584[_0xb317('0xa')],_0x458584[_0xb317('0xb')],_0x1f9624[_0xb317('0xc')],_0x2369e6['transcribeName'])['then'](function(_0x5f1f1d){logger[_0xb317('0xd')](util['format'](_0xb317('0xe'),_0x2369e6['id'],_0x2369e6[_0xb317('0xf')],_0x5f1f1d['TranscriptionJob'][_0xb317('0x10')]));if(!_0x2369e6[_0xb317('0x11')]){switch(_0x5f1f1d['TranscriptionJob']['TranscriptionJobStatus']){case _0xb317('0x12'):var _0x3083d8={'transcribeStatus':_0x5f1f1d[_0xb317('0x13')][_0xb317('0x10')],'fileUri':_0x5f1f1d[_0xb317('0x13')]['Transcript'][_0xb317('0x14')]};logger[_0xb317('0xd')](util[_0xb317('0x15')](_0xb317('0x16'),_0x2369e6['id']));return rp({'uri':_0x5f1f1d[_0xb317('0x13')][_0xb317('0x17')][_0xb317('0x14')],'json':!![]})[_0xb317('0x18')](function(_0x1fb834){logger[_0xb317('0xd')](util[_0xb317('0x15')](_0xb317('0x19'),_0x2369e6['id']));if(_0x1fb834&&_0x1fb834[_0xb317('0x1a')]&&_0x1fb834[_0xb317('0x1a')]['transcripts']&&_0x1fb834[_0xb317('0x1a')]['transcripts'][_0xb317('0x1b')]){_0x3083d8[_0xb317('0x11')]='';for(var _0x3009fb=0x0;_0x3009fb<_0x1fb834[_0xb317('0x1a')][_0xb317('0x1c')][_0xb317('0x1b')];_0x3009fb++){_0x3083d8[_0xb317('0x11')]+=_0x1fb834[_0xb317('0x1a')]['transcripts'][_0x3009fb][_0xb317('0x1d')]+'';}}return _0x2369e6[_0xb317('0x1e')](_0x3083d8);})[_0xb317('0x18')](function(){logger[_0xb317('0xd')](util[_0xb317('0x15')](_0xb317('0x1f'),_0x2369e6['id']));if(!_0x2369e6['tempSentiment']){throw new db[(_0xb317('0x20'))][(_0xb317('0x21'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1f9624['sentiment']||!_0x1f9624[_0xb317('0x22')]||!_0x1f9624[_0xb317('0x23')]||!_0x1f9624[_0xb317('0x24')]||!_0x1f9624['bucket']){throw new db[(_0xb317('0x20'))][(_0xb317('0x21'))](_0xb317('0x25'));}if(!_0x3083d8[_0xb317('0x11')]){throw new Error(_0xb317('0x26'));}if(_0x1f9624['sentimentAccountId']===_0x458584['id']){return _0x458584;}else{return db[_0xb317('0x27')]['findOne']({'where':{'id':_settings[_0xb317('0x22')]}});}})['then'](function(_0x5e1123){if(!_0x5e1123){throw new db[(_0xb317('0x20'))][(_0xb317('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5e1123[_0xb317('0xa')]||!_0x5e1123[_0xb317('0xb')]){throw new db[(_0xb317('0x20'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x15f3f5=_0x5e1123;logger[_0xb317('0xd')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2369e6['id']));return sentiment(_0x15f3f5['data1'],_0x15f3f5[_0xb317('0xb')],_0x1f9624[_0xb317('0x23')],_0x3083d8[_0xb317('0x11')],_0x1f9624[_0xb317('0x24')]);})['then'](function(_0x297072){logger[_0xb317('0xd')](util[_0xb317('0x15')](_0xb317('0x28'),_0x2369e6['id']));return _0x2369e6['update']({'sentiment':_0x297072[_0xb317('0x29')],'sPositive':_0x297072['SentimentScore'][_0xb317('0x2a')],'sNegative':_0x297072[_0xb317('0x2b')][_0xb317('0x2c')],'sMixed':_0x297072[_0xb317('0x2b')]['Mixed'],'sNeutral':_0x297072[_0xb317('0x2b')][_0xb317('0x2d')]});})[_0xb317('0x18')](function(){logger['info'](util[_0xb317('0x15')](_0xb317('0x1f'),_0x2369e6['id']));_0x4d99d8();});case _0xb317('0x2e'):return _0x2369e6[_0xb317('0x1e')]({'transcribeStatus':'FAILED','failureReason':_0x5f1f1d[_0xb317('0x13')][_0xb317('0x2f')]})[_0xb317('0x18')](function(){logger[_0xb317('0xd')](util[_0xb317('0x15')](_0xb317('0x1f'),_0x2369e6['id']));_0x4d99d8();});default:logger[_0xb317('0xd')](util['format'](_0xb317('0x30'),_0x2369e6['id']));break;}}else{return BPromise['resolve']()[_0xb317('0x18')](function(){if(!_0x2369e6[_0xb317('0x31')]){throw new db[(_0xb317('0x20'))]['ValidationError'](_0xb317('0x32'));}if(!_0x1f9624[_0xb317('0x33')]||!_0x1f9624[_0xb317('0x22')]||!_0x1f9624[_0xb317('0x23')]||!_0x1f9624['language']||!_0x1f9624[_0xb317('0x34')]){throw new db['Sequelize'][(_0xb317('0x21'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2369e6[_0xb317('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x1f9624[_0xb317('0x22')]===_0x458584['id']){return _0x458584;}else{return db['CloudProvider'][_0xb317('0x35')]({'where':{'id':_settings[_0xb317('0x22')]}});}})[_0xb317('0x18')](function(_0x5642b3){if(!_0x5642b3){throw new db['Sequelize'][(_0xb317('0x21'))](_0xb317('0x36'));}if(!_0x5642b3['data1']||!_0x5642b3[_0xb317('0xb')]){throw new db[(_0xb317('0x20'))][(_0xb317('0x21'))](_0xb317('0x37'));}_0x15f3f5=_0x5642b3;logger[_0xb317('0xd')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2369e6['id']));return sentiment(_0x15f3f5[_0xb317('0xa')],_0x15f3f5['data2'],_0x1f9624[_0xb317('0x23')],_0x2369e6[_0xb317('0x11')],_0x1f9624[_0xb317('0x24')]);})[_0xb317('0x18')](function(_0xda2983){logger[_0xb317('0xd')](util[_0xb317('0x15')](_0xb317('0x28'),_0x2369e6['id']));return _0x2369e6[_0xb317('0x1e')]({'sentiment':_0xda2983[_0xb317('0x29')],'sPositive':_0xda2983[_0xb317('0x2b')][_0xb317('0x2a')],'sNegative':_0xda2983[_0xb317('0x2b')]['Negative'],'sMixed':_0xda2983[_0xb317('0x2b')]['Mixed'],'sNeutral':_0xda2983[_0xb317('0x2b')][_0xb317('0x2d')],'transcribeStatus':_0xb317('0x12')});})['then'](function(){logger['info'](util[_0xb317('0x15')](_0xb317('0x1f'),_0x2369e6['id']));_0x4d99d8();});}})[_0xb317('0x38')](function(_0x132964){if(_0x132964){if(!_0x132964[_0xb317('0x39')]||_0x132964['name']!==_0xb317('0x3a')){logger[_0xb317('0x3b')](util[_0xb317('0x15')](_0xb317('0x3c'),_0x2369e6['id']),util['inspect'](_0x132964,{'showHidden':![],'depth':null}));}}_0x4d99d8();});});}function checkTranscribe(){var _0xe343ba;var _0x271de0;var _0x1918b9;return db[_0xb317('0x3d')][_0xb317('0x3e')]({'where':{'transcribeStatus':_0xb317('0x3f')}})['then'](function(_0x3beb94){if(!_0x3beb94||!_0x3beb94[_0xb317('0x1b')]){throw new db[(_0xb317('0x20'))][(_0xb317('0x21'))](_0xb317('0x40'));}_0xe343ba=_0x3beb94;return db[_0xb317('0x41')][_0xb317('0x35')]({'where':{'id':0x1}});})['then'](function(_0x11428f){if(!_0x11428f){throw new db[(_0xb317('0x20'))][(_0xb317('0x21'))](_0xb317('0x42'));}_0x271de0=_0x11428f;if(!_0x271de0[_0xb317('0x5')]||!_0x271de0[_0xb317('0x43')]||!_0x271de0['transcribeRegion']||!_0x271de0['language']||!_0x271de0[_0xb317('0x34')]){throw new db['Sequelize'][(_0xb317('0x21'))](_0xb317('0x44'));}return db[_0xb317('0x27')][_0xb317('0x35')]({'where':{'id':_0x271de0['transcribeAccountId']}});})[_0xb317('0x18')](function(_0x49f860){if(!_0x49f860){throw new db['Sequelize']['ValidationError'](_0xb317('0x36'));}if(!_0x49f860['data1']||!_0x49f860['data2']){throw new db[(_0xb317('0x20'))][(_0xb317('0x21'))](_0xb317('0x37'));}_0x1918b9=_0x49f860;var _0x232ff0=[];_0xe343ba[_0xb317('0x45')](function(_0x2534f7){_0x232ff0[_0xb317('0x46')](checkTranscribeJob(_0x2534f7,_0x271de0,_0x1918b9));});return BPromise[_0xb317('0x47')](_0x232ff0);})[_0xb317('0x38')](function(_0x1a7bc7){if(_0x1a7bc7){if(!_0x1a7bc7[_0xb317('0x39')]||_0x1a7bc7[_0xb317('0x39')]!==_0xb317('0x3a')){logger[_0xb317('0x3b')](util['inspect'](_0x1a7bc7,{'showHidden':![],'depth':null}));}}});}exports[_0xb317('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x2a84=['all','catch','start','lodash','aws-sdk','util','bluebird','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data1','data2','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','Negative','SentimentScore','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','resolve','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Mixed','COMPLETED','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','Transcribe\x20not\x20configured','transcribeAccountId','Cloud\x20Provider\x20not\x20configured','forEach','push'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x2a84,0x170));var _0x42a8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2a84[_0x19e35c];return _0x3e1fe8;};var _=require(_0x42a8('0x0'));var AWS=require(_0x42a8('0x1'));var rp=require('request-promise');var util=require(_0x42a8('0x2'));var BPromise=require(_0x42a8('0x3'));var db=require(_0x42a8('0x4'))['db'];var logger=require('../../config/logger')(_0x42a8('0x5'));function getTranscriptionJob(_0x49dca9,_0xea116f,_0x1dc04a,_0x1b6a6a){return new Promise(function(_0x59505e,_0x593b3a){var _0x4b17b7=new AWS[(_0x42a8('0x6'))]({'accessKeyId':_0xea116f,'secretAccessKey':_0x49dca9,'region':_0x1dc04a});_0x4b17b7[_0x42a8('0x7')]({'TranscriptionJobName':_0x1b6a6a},function(_0x4ff8e0,_0x2aa872){if(_0x4ff8e0){return _0x593b3a(_0x4ff8e0);}else{return _0x59505e(_0x2aa872);}});});}function sentiment(_0x454118,_0x5b93ac,_0x40062e,_0x29fc29,_0x53048e){return new Promise(function(_0x127d12,_0x3467d4){var _0x7a340c=new AWS['Comprehend']({'accessKeyId':_0x5b93ac,'secretAccessKey':_0x454118,'region':_0x40062e});_0x7a340c['detectSentiment']({'Text':_0x29fc29,'LanguageCode':_0x53048e[_0x42a8('0x8')](0x0,0x2)},function(_0x54e4a5,_0x2cffd7){if(_0x54e4a5){return _0x3467d4(_0x54e4a5);}else{return _0x127d12(_0x2cffd7);}});});}function checkTranscribeJob(_0x52c0c3,_0x5441d7,_0x25dcb8){var _0x3133c4;return new BPromise(function(_0x449617,_0xb041a0){logger[_0x42a8('0x9')](util[_0x42a8('0xa')](_0x42a8('0xb'),_0x52c0c3['id'],_0x52c0c3[_0x42a8('0xc')]));return getTranscriptionJob(_0x25dcb8['data1'],_0x25dcb8['data2'],_0x5441d7[_0x42a8('0xd')],_0x52c0c3[_0x42a8('0xc')])[_0x42a8('0xe')](function(_0x542543){logger[_0x42a8('0x9')](util[_0x42a8('0xa')](_0x42a8('0xf'),_0x52c0c3['id'],_0x52c0c3[_0x42a8('0xc')],_0x542543[_0x42a8('0x10')][_0x42a8('0x11')]));if(!_0x52c0c3[_0x42a8('0x12')]){switch(_0x542543[_0x42a8('0x10')][_0x42a8('0x11')]){case'COMPLETED':var _0x509b0a={'transcribeStatus':_0x542543['TranscriptionJob'][_0x42a8('0x11')],'fileUri':_0x542543[_0x42a8('0x10')][_0x42a8('0x13')][_0x42a8('0x14')]};logger[_0x42a8('0x9')](util[_0x42a8('0xa')](_0x42a8('0x15'),_0x52c0c3['id']));return rp({'uri':_0x542543['TranscriptionJob'][_0x42a8('0x13')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x58f83a){logger[_0x42a8('0x9')](util[_0x42a8('0xa')](_0x42a8('0x16'),_0x52c0c3['id']));if(_0x58f83a&&_0x58f83a['results']&&_0x58f83a[_0x42a8('0x17')]['transcripts']&&_0x58f83a['results'][_0x42a8('0x18')][_0x42a8('0x19')]){_0x509b0a[_0x42a8('0x12')]='';for(var _0xe6c44c=0x0;_0xe6c44c<_0x58f83a['results'][_0x42a8('0x18')]['length'];_0xe6c44c++){_0x509b0a[_0x42a8('0x12')]+=_0x58f83a[_0x42a8('0x17')][_0x42a8('0x18')][_0xe6c44c][_0x42a8('0x1a')]+'';}}return _0x52c0c3[_0x42a8('0x1b')](_0x509b0a);})[_0x42a8('0xe')](function(){logger['info'](util[_0x42a8('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x52c0c3['id']));if(!_0x52c0c3[_0x42a8('0x1c')]){throw new db['Sequelize'][(_0x42a8('0x1d'))](_0x42a8('0x1e'));}if(!_0x5441d7[_0x42a8('0x1f')]||!_0x5441d7[_0x42a8('0x20')]||!_0x5441d7[_0x42a8('0x21')]||!_0x5441d7[_0x42a8('0x22')]||!_0x5441d7[_0x42a8('0x23')]){throw new db[(_0x42a8('0x24'))][(_0x42a8('0x1d'))](_0x42a8('0x25'));}if(!_0x509b0a[_0x42a8('0x12')]){throw new Error(_0x42a8('0x26'));}if(_0x5441d7['sentimentAccountId']===_0x25dcb8['id']){return _0x25dcb8;}else{return db[_0x42a8('0x27')][_0x42a8('0x28')]({'where':{'id':_settings[_0x42a8('0x20')]}});}})[_0x42a8('0xe')](function(_0x85793d){if(!_0x85793d){throw new db[(_0x42a8('0x24'))][(_0x42a8('0x1d'))](_0x42a8('0x29'));}if(!_0x85793d[_0x42a8('0x2a')]||!_0x85793d[_0x42a8('0x2b')]){throw new db['Sequelize'][(_0x42a8('0x1d'))]('Cloud\x20Provider\x20not\x20configured');}_0x3133c4=_0x85793d;logger[_0x42a8('0x9')](util[_0x42a8('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x52c0c3['id']));return sentiment(_0x3133c4[_0x42a8('0x2a')],_0x3133c4[_0x42a8('0x2b')],_0x5441d7[_0x42a8('0x21')],_0x509b0a[_0x42a8('0x12')],_0x5441d7[_0x42a8('0x22')]);})['then'](function(_0x2a155e){logger[_0x42a8('0x9')](util['format'](_0x42a8('0x2c'),_0x52c0c3['id']));return _0x52c0c3[_0x42a8('0x1b')]({'sentiment':_0x2a155e[_0x42a8('0x2d')],'sPositive':_0x2a155e['SentimentScore'][_0x42a8('0x2e')],'sNegative':_0x2a155e['SentimentScore'][_0x42a8('0x2f')],'sMixed':_0x2a155e['SentimentScore']['Mixed'],'sNeutral':_0x2a155e[_0x42a8('0x30')][_0x42a8('0x31')]});})[_0x42a8('0xe')](function(){logger[_0x42a8('0x9')](util[_0x42a8('0xa')](_0x42a8('0x32'),_0x52c0c3['id']));_0x449617();});case _0x42a8('0x33'):return _0x52c0c3[_0x42a8('0x1b')]({'transcribeStatus':'FAILED','failureReason':_0x542543['TranscriptionJob'][_0x42a8('0x34')]})[_0x42a8('0xe')](function(){logger[_0x42a8('0x9')](util['format'](_0x42a8('0x32'),_0x52c0c3['id']));_0x449617();});default:logger[_0x42a8('0x9')](util[_0x42a8('0xa')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x52c0c3['id']));break;}}else{return BPromise[_0x42a8('0x35')]()[_0x42a8('0xe')](function(){if(!_0x52c0c3[_0x42a8('0x1c')]){throw new db[(_0x42a8('0x24'))][(_0x42a8('0x1d'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x5441d7[_0x42a8('0x1f')]||!_0x5441d7[_0x42a8('0x20')]||!_0x5441d7[_0x42a8('0x21')]||!_0x5441d7[_0x42a8('0x22')]||!_0x5441d7[_0x42a8('0x23')]){throw new db['Sequelize'][(_0x42a8('0x1d'))](_0x42a8('0x25'));}if(!_0x52c0c3[_0x42a8('0x12')]){throw new Error(_0x42a8('0x26'));}if(_0x5441d7[_0x42a8('0x20')]===_0x25dcb8['id']){return _0x25dcb8;}else{return db['CloudProvider'][_0x42a8('0x28')]({'where':{'id':_settings[_0x42a8('0x20')]}});}})[_0x42a8('0xe')](function(_0x2b8206){if(!_0x2b8206){throw new db[(_0x42a8('0x24'))][(_0x42a8('0x1d'))](_0x42a8('0x29'));}if(!_0x2b8206[_0x42a8('0x2a')]||!_0x2b8206['data2']){throw new db[(_0x42a8('0x24'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x3133c4=_0x2b8206;logger['info'](util['format'](_0x42a8('0x36'),_0x52c0c3['id']));return sentiment(_0x3133c4[_0x42a8('0x2a')],_0x3133c4['data2'],_0x5441d7[_0x42a8('0x21')],_0x52c0c3[_0x42a8('0x12')],_0x5441d7[_0x42a8('0x22')]);})[_0x42a8('0xe')](function(_0x51302c){logger[_0x42a8('0x9')](util[_0x42a8('0xa')](_0x42a8('0x2c'),_0x52c0c3['id']));return _0x52c0c3[_0x42a8('0x1b')]({'sentiment':_0x51302c[_0x42a8('0x2d')],'sPositive':_0x51302c['SentimentScore'][_0x42a8('0x2e')],'sNegative':_0x51302c[_0x42a8('0x30')][_0x42a8('0x2f')],'sMixed':_0x51302c[_0x42a8('0x30')][_0x42a8('0x37')],'sNeutral':_0x51302c[_0x42a8('0x30')]['Neutral'],'transcribeStatus':_0x42a8('0x38')});})['then'](function(){logger[_0x42a8('0x9')](util[_0x42a8('0xa')](_0x42a8('0x32'),_0x52c0c3['id']));_0x449617();});}})['catch'](function(_0x556a0f){if(_0x556a0f){if(!_0x556a0f[_0x42a8('0x39')]||_0x556a0f['name']!==_0x42a8('0x3a')){logger[_0x42a8('0x3b')](util[_0x42a8('0xa')](_0x42a8('0x3c'),_0x52c0c3['id']),util[_0x42a8('0x3d')](_0x556a0f,{'showHidden':![],'depth':null}));}}_0x449617();});});}function checkTranscribe(){var _0x285e64;var _0xc576f8;var _0x17aec8;return db[_0x42a8('0x3e')][_0x42a8('0x3f')]({'where':{'transcribeStatus':_0x42a8('0x40')}})[_0x42a8('0xe')](function(_0x5863ac){if(!_0x5863ac||!_0x5863ac['length']){throw new db[(_0x42a8('0x24'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x285e64=_0x5863ac;return db['Setting'][_0x42a8('0x28')]({'where':{'id':0x1}});})[_0x42a8('0xe')](function(_0x5aae6b){if(!_0x5aae6b){throw new db[(_0x42a8('0x24'))][(_0x42a8('0x1d'))]('Settings\x20not\x20available');}_0xc576f8=_0x5aae6b;if(!_0xc576f8['transcribe']||!_0xc576f8['transcribeAccountId']||!_0xc576f8[_0x42a8('0xd')]||!_0xc576f8[_0x42a8('0x22')]||!_0xc576f8[_0x42a8('0x23')]){throw new db[(_0x42a8('0x24'))][(_0x42a8('0x1d'))](_0x42a8('0x41'));}return db[_0x42a8('0x27')][_0x42a8('0x28')]({'where':{'id':_0xc576f8[_0x42a8('0x42')]}});})[_0x42a8('0xe')](function(_0x142b12){if(!_0x142b12){throw new db['Sequelize']['ValidationError'](_0x42a8('0x29'));}if(!_0x142b12[_0x42a8('0x2a')]||!_0x142b12['data2']){throw new db[(_0x42a8('0x24'))][(_0x42a8('0x1d'))](_0x42a8('0x43'));}_0x17aec8=_0x142b12;var _0x2eeb0c=[];_0x285e64[_0x42a8('0x44')](function(_0x36db51){_0x2eeb0c[_0x42a8('0x45')](checkTranscribeJob(_0x36db51,_0xc576f8,_0x17aec8));});return BPromise[_0x42a8('0x46')](_0x2eeb0c);})[_0x42a8('0x47')](function(_0x2d3443){if(_0x2d3443){if(!_0x2d3443['name']||_0x2d3443[_0x42a8('0x39')]!=='SequelizeValidationError'){logger[_0x42a8('0x3b')](util[_0x42a8('0x3d')](_0x2d3443,{'showHidden':![],'depth':null}));}}});}exports[_0x42a8('0x48')]=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 babaa3a..b36dfe3 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 _0xfd82=['WhatsappInteraction','findAll','lastMsgAt','subtract','hours','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','inspect','start','lodash','moment','ioredis','../../mysqldb','../logger','redis','socket.io-emitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd82,0x138));var _0x2fd8=function(_0x2a7260,_0x51e2b2){_0x2a7260=_0x2a7260-0x0;var _0xf80da=_0xfd82[_0x2a7260];return _0xf80da;};'use strict';var _=require(_0x2fd8('0x0'));var moment=require(_0x2fd8('0x1'));var Redis=require(_0x2fd8('0x2'));var util=require('util');var config=require('../../config/environment');var db=require(_0x2fd8('0x3'))['db'];var logger=require(_0x2fd8('0x4'))('schedule');config[_0x2fd8('0x5')]=_['defaults'](config[_0x2fd8('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x2fd8('0x6'))(new Redis(config[_0x2fd8('0x5')]));function closeInteractions(){var _0x2a0844=[];return db[_0x2fd8('0x7')][_0x2fd8('0x8')]({'raw':!![],'attributes':['id',_0x2fd8('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x2fd8('0xa')](0x18,_0x2fd8('0xb'))}}})['then'](function(_0xad92fb){if(_0xad92fb&&_0xad92fb[_0x2fd8('0xc')]){_0x2a0844=_[_0x2fd8('0xd')](_0xad92fb||[],'id');logger[_0x2fd8('0xe')](_0x2fd8('0xf'),_0x2a0844[_0x2fd8('0x10')]());return db[_0x2fd8('0x7')][_0x2fd8('0x11')]({'closeReason':_0x2fd8('0x12'),'disposition':_0x2fd8('0x13'),'closed':!![],'closedAt':moment()['format'](_0x2fd8('0x14'))},{'where':{'id':_0x2a0844}});}})[_0x2fd8('0x15')](function(){if(_0x2a0844&&_0x2a0844[_0x2fd8('0xc')]){logger[_0x2fd8('0xe')](_0x2fd8('0x16'),_0x2a0844['join']());for(var _0x3f4661=0x0;_0x3f4661<_0x2a0844['length'];_0x3f4661++){io[_0x2fd8('0x17')](_0x2fd8('0x18'),{'id':_0x2a0844[_0x3f4661],'closed':!![]});}}})[_0x2fd8('0x19')](function(_0x1e9cc2){logger[_0x2fd8('0x1a')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x1e9cc2?util[_0x2fd8('0x1b')](_0x1e9cc2,{'showHidden':![],'depth':null}):'');});}exports[_0x2fd8('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xcb1a=['localhost','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','timeout','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../logger','redis','defaults'];(function(_0x5724e6,_0xa6ee67){var _0x4ccb15=function(_0x48a8c2){while(--_0x48a8c2){_0x5724e6['push'](_0x5724e6['shift']());}};_0x4ccb15(++_0xa6ee67);}(_0xcb1a,0xb6));var _0xacb1=function(_0x53568f,_0x4bfd1d){_0x53568f=_0x53568f-0x0;var _0x253f12=_0xcb1a[_0x53568f];return _0x253f12;};'use strict';var _=require(_0xacb1('0x0'));var moment=require(_0xacb1('0x1'));var Redis=require(_0xacb1('0x2'));var util=require(_0xacb1('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0xacb1('0x4'))('schedule');config[_0xacb1('0x5')]=_[_0xacb1('0x6')](config['redis'],{'host':_0xacb1('0x7'),'port':0x18eb});var io=require(_0xacb1('0x8'))(new Redis(config[_0xacb1('0x5')]));function closeInteractions(){var _0x317779=[];return db[_0xacb1('0x9')][_0xacb1('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xacb1('0xb')](0x18,_0xacb1('0xc'))}}})[_0xacb1('0xd')](function(_0x1492f3){if(_0x1492f3&&_0x1492f3[_0xacb1('0xe')]){_0x317779=_[_0xacb1('0xf')](_0x1492f3||[],'id');logger[_0xacb1('0x10')](_0xacb1('0x11'),_0x317779[_0xacb1('0x12')]());return db[_0xacb1('0x9')][_0xacb1('0x13')]({'closeReason':'system','disposition':_0xacb1('0x14'),'closed':!![],'closedAt':moment()[_0xacb1('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x317779}});}})['then'](function(){if(_0x317779&&_0x317779[_0xacb1('0xe')]){logger[_0xacb1('0x10')](_0xacb1('0x16'),_0x317779[_0xacb1('0x12')]());for(var _0x3842b5=0x0;_0x3842b5<_0x317779[_0xacb1('0xe')];_0x3842b5++){io['emit'](_0xacb1('0x17'),{'id':_0x317779[_0x3842b5],'closed':!![]});}}})['catch'](function(_0x312155){logger[_0xacb1('0x18')](_0xacb1('0x19'),_0x312155?util[_0xacb1('0x1a')](_0x312155,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 2ab713d..5a90871 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb1bb=['util','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','destroy','bulkCreate','then','log','finished\x20populating','contacts1','CmHopper','hopper1','CmContact','contacts2','hopper2','catch'];(function(_0xb66c12,_0x24f744){var _0x34a4c7=function(_0x36dca9){while(--_0x36dca9){_0xb66c12['push'](_0xb66c12['shift']());}};_0x34a4c7(++_0x24f744);}(_0xb1bb,0x156));var _0xbb1b=function(_0x5f2f86,_0x1a97ed){_0x5f2f86=_0x5f2f86-0x0;var _0x45aeef=_0xb1bb[_0x5f2f86];return _0x45aeef;};'use strict';var util=require(_0xbb1b('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xbb1b('0x1')+i,'lastName':_0xbb1b('0x2')+i,'phone':0xf879fb460+i,'email':_0xbb1b('0x3')+i+_0xbb1b('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xbb1b('0x5')]({'id':i,'active':![],'scheduledat':Date[_0xbb1b('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xbb1b('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xbb1b('0x5')]({'id':i,'firstName':_0xbb1b('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xbb1b('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xbb1b('0x5')]({'id':i,'active':![],'scheduledat':Date[_0xbb1b('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xbb1b('0x6')](),'updatedAt':Date['now']()});}db['CmContact'][_0xbb1b('0x7')]({'where':{}})['then'](function(){return db['CmContact'][_0xbb1b('0x8')](contacts);})[_0xbb1b('0x9')](function(){console[_0xbb1b('0xa')](_0xbb1b('0xb'),_0xbb1b('0xc'));return db[_0xbb1b('0xd')][_0xbb1b('0x7')]({'where':{}});})[_0xbb1b('0x9')](function(){return db['CmHopper'][_0xbb1b('0x8')](hopper);})[_0xbb1b('0x9')](function(){console['log'](_0xbb1b('0xb'),_0xbb1b('0xe'));return db[_0xbb1b('0xf')][_0xbb1b('0x8')](contacts2);})['then'](function(){console['log'](_0xbb1b('0xb'),_0xbb1b('0x10'));return db['CmHopper'][_0xbb1b('0x8')](hopper2);})[_0xbb1b('0x9')](function(){console[_0xbb1b('0xa')](_0xbb1b('0xb'),_0xbb1b('0x11'));})[_0xbb1b('0x12')](function(_0x2ab4f4){console[_0xbb1b('0xa')](_0x2ab4f4);}); \ No newline at end of file +var _0xb55c=['util','push','Innocenzo','Biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','contacts1','log','finished\x20populating','hopper1','contacts2','CmHopper','hopper2','catch'];(function(_0x2732c0,_0x5adcf1){var _0x3bef7e=function(_0x16a38d){while(--_0x16a38d){_0x2732c0['push'](_0x2732c0['shift']());}};_0x3bef7e(++_0x5adcf1);}(_0xb55c,0x156));var _0xcb55=function(_0xaebd08,_0x1bd66b){_0xaebd08=_0xaebd08-0x0;var _0x1642fa=_0xb55c[_0xaebd08];return _0x1642fa;};'use strict';var util=require(_0xcb55('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xcb55('0x1')]({'id':i,'firstName':_0xcb55('0x2')+i,'lastName':_0xcb55('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xcb55('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xcb55('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xcb55('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xcb55('0x1')]({'id':i,'firstName':_0xcb55('0x2')+i,'lastName':_0xcb55('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xcb55('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xcb55('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xcb55('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xcb55('0x5')]()});}db[_0xcb55('0x6')][_0xcb55('0x7')]({'where':{}})[_0xcb55('0x8')](function(){return db[_0xcb55('0x6')][_0xcb55('0x9')](contacts);})['then'](function(){console['log']('finished\x20populating',_0xcb55('0xa'));return db['CmHopper'][_0xcb55('0x7')]({'where':{}});})[_0xcb55('0x8')](function(){return db['CmHopper'][_0xcb55('0x9')](hopper);})['then'](function(){console[_0xcb55('0xb')](_0xcb55('0xc'),_0xcb55('0xd'));return db[_0xcb55('0x6')][_0xcb55('0x9')](contacts2);})[_0xcb55('0x8')](function(){console[_0xcb55('0xb')](_0xcb55('0xc'),_0xcb55('0xe'));return db[_0xcb55('0xf')][_0xcb55('0x9')](hopper2);})['then'](function(){console[_0xcb55('0xb')]('finished\x20populating',_0xcb55('0x10'));})[_0xcb55('0x11')](function(_0x1c769e){console[_0xcb55('0xb')](_0x1c769e);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index e44bf22..15320ee 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4a1=['agent','password','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','log','catch','util','push','format','%s%s'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xa4a1,0x1c7));var _0x1a4a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa4a1[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x1a4a('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x1a4a('0x1')]({'name':util[_0x1a4a('0x2')](_0x1a4a('0x3'),_0x1a4a('0x4'),i),'fullname':util[_0x1a4a('0x2')](_0x1a4a('0x3'),_0x1a4a('0x4'),i),'email':util[_0x1a4a('0x2')]('%s%s@xcally.com',_0x1a4a('0x4'),i),'role':'agent','password':_0x1a4a('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0x1a4a('0x6'),'ws',_0x1a4a('0x7')],'disallow':['all'],'allow':[_0x1a4a('0x8')],'defaultuser':util[_0x1a4a('0x2')]('%s%s',_0x1a4a('0x4'),i),'encryption':_0x1a4a('0x9'),'avpf':'yes','force_avp':'yes','icesupport':_0x1a4a('0x9'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x1a4a('0xa'),'dtlsprivatekey':_0x1a4a('0xb'),'dtlssetup':_0x1a4a('0xc'),'callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x1a4a('0x2')](_0x1a4a('0x3'),_0x1a4a('0x4'),i),0xfa0+i)});}db[_0x1a4a('0xd')][_0x1a4a('0xe')](users)['then'](function(){console[_0x1a4a('0xf')]('add\x20user');})[_0x1a4a('0x10')](function(_0x2c823c){console[_0x1a4a('0xf')](_0x2c823c);}); \ No newline at end of file +var _0x7687=['password','friend','udp','yes','/etc/pki/tls/certs/motion.crt','actpass','bulkCreate','then','log','add\x20user','catch','util','agent','format','%s%s','%s%s@xcally.com'];(function(_0x1dded0,_0x5de392){var _0xf00e9e=function(_0x221aee){while(--_0x221aee){_0x1dded0['push'](_0x1dded0['shift']());}};_0xf00e9e(++_0x5de392);}(_0x7687,0x17b));var _0x7768=function(_0x23b85e,_0x39b209){_0x23b85e=_0x23b85e-0x0;var _0x329756=_0x7687[_0x23b85e];return _0x329756;};'use strict';var util=require(_0x7768('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format']('%s%s',_0x7768('0x1'),i),'fullname':util[_0x7768('0x2')](_0x7768('0x3'),_0x7768('0x1'),i),'email':util[_0x7768('0x2')](_0x7768('0x4'),_0x7768('0x1'),i),'role':_0x7768('0x1'),'password':_0x7768('0x5'),'internal':0xfa0+i,'type':_0x7768('0x6'),'transport':[_0x7768('0x7'),'ws','wss'],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0x7768('0x2')](_0x7768('0x3'),_0x7768('0x1'),i),'encryption':_0x7768('0x8'),'avpf':'yes','force_avp':_0x7768('0x8'),'icesupport':_0x7768('0x8'),'dtlsenable':_0x7768('0x8'),'dtlsverify':'no','dtlscertfile':_0x7768('0x9'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x7768('0xa'),'callerid':util['format']('\x22%s\x22\x20<%s>',util['format'](_0x7768('0x3'),_0x7768('0x1'),i),0xfa0+i)});}db['User'][_0x7768('0xb')](users)[_0x7768('0xc')](function(){console[_0x7768('0xd')](_0x7768('0xe'));})[_0x7768('0xf')](function(_0x5db302){console['log'](_0x5db302);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 9ef4b92..3e52cd7 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8952=['findAll','IvrCampaigns','resourceId','map','where','Campaign','format','%s:queue:%s','Agents','length','find','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteractions','WhatsappInteraction','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','OpenchannelQueue','Trunk','user','VoiceQueues','FaxQueue','MailQueues','MailQueue','Trunks','agent','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','user:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','setMaxListeners','address','connection','remoteAddress','remotePort','connectedAt','nsp','DISCONNECTED','CONNECTED','util','bluebird','../mysqldb','./environment','name','User','role','telephone','type','ivr','UserProfileSection','then','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','Telephones'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x8952,0x17e));var _0x2895=function(_0x3faa9,_0x153174){_0x3faa9=_0x3faa9-0x0;var _0x11fd4e=_0x8952[_0x3faa9];return _0x11fd4e;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var BPromise=require(_0x2895('0x1'));var db=require(_0x2895('0x2'))['db'];var config=require(_0x2895('0x3'));var queryQueues={'attributes':['id',_0x2895('0x4')],'include':[{'as':'Agents','model':db[_0x2895('0x5')],'attributes':['id',_0x2895('0x4'),_0x2895('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x2895('0x4')],'where':{'role':_0x2895('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x2895('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x2895('0x4'),_0x2895('0x8')],'where':{'type':_0x2895('0x9')}};function getAssociatedResources(_0x294446,_0x384cc6,_0x4952fa){return db[_0x2895('0xa')]['findOne']({'where':{'name':_0x294446,'userProfileId':_0x384cc6},'raw':!![]})[_0x2895('0xb')](function(_0x5af454){if(_0x5af454){if(_0x5af454['autoAssociation']){switch(_0x294446){case'VoiceQueues':case _0x2895('0xc'):case _0x2895('0xd'):case _0x2895('0xe'):case'MailQueues':case _0x2895('0xf'):case _0x2895('0x10'):return db[_0x4952fa]['findAll'](queryQueues);case _0x2895('0x11'):return db[_0x4952fa][_0x2895('0x12')](queryTelephones);case'Trunks':return db[_0x4952fa]['findAll'](queryTrunks);case _0x2895('0x13'):return db[_0x4952fa][_0x2895('0x12')](queryCampaigns);}}else{return db['UserProfileResource'][_0x2895('0x12')]({'attributes':[_0x2895('0x14')],'where':{'sectionId':_0x5af454['id']},'raw':!![]})[_0x2895('0xb')](function(_0x1ae013){if(_0x1ae013){var _0x1d3659={'where':{'id':_[_0x2895('0x15')](_0x1ae013,_0x2895('0x14'))},'raw':!![]};switch(_0x4952fa){case _0x2895('0x5'):_0x1d3659[_0x2895('0x16')][_0x2895('0x6')]=_0x2895('0x7');break;case _0x2895('0x17'):_0x1d3659[_0x2895('0x16')][_0x2895('0x8')]=_0x2895('0x9');break;}return db[_0x4952fa][_0x2895('0x12')](_0x1d3659);}else{return[];}});}}else{return[];}})[_0x2895('0xb')](function(_0x1e8d47){return _0x1e8d47;});}function joinOrLeaveQueues(_0x5a8eab,_0x4b3ba0,_0x493851,_0x442cfa){_0x5a8eab[_0x4b3ba0](util[_0x2895('0x18')](_0x2895('0x19'),_0x493851,_0x442cfa['name']));if(_0x442cfa[_0x2895('0x1a')]){for(var _0x190b79=0x0;_0x190b79<_0x442cfa[_0x2895('0x1a')][_0x2895('0x1b')];_0x190b79+=0x1){_0x5a8eab[_0x4b3ba0](util[_0x2895('0x18')]('user:%s',_0x442cfa[_0x2895('0x1a')][_0x190b79][_0x2895('0x4')]));}}}function joinOrLeave(_0x5671fa,_0x142e58,_0x384357){var _0x6f8ad4;if(_0x5671fa['handshake']['query']['id']){db[_0x2895('0x5')][_0x2895('0x1c')]({'attributes':['id',_0x2895('0x4'),'role',_0x2895('0x1d')],'where':{'id':_0x5671fa[_0x2895('0x1e')]['query']['id']},'include':[{'model':db[_0x2895('0x1f')],'as':_0x2895('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x2895('0x21')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2895('0x22')],'as':_0x2895('0x23'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x2895('0x24'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2895('0x25')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x2895('0xb')](function(_0x381538){if(_0x381538){_0x6f8ad4=_0x381538;_0x5671fa[_0x142e58](util['format']('user:%s',_0x381538[_0x2895('0x4')]));var _0x30dc2f=[];switch(_0x381538[_0x2895('0x6')]){case _0x2895('0x26'):_0x5671fa[_0x142e58](_0x2895('0x27'));_0x5671fa[_0x142e58](_0x2895('0x28'));if(queryQueues[_0x2895('0x29')]('include')){delete queryQueues[_0x2895('0x2a')];}_0x30dc2f[_0x2895('0x2b')](db[_0x2895('0x2c')]['findAll'](queryQueues));_0x30dc2f[_0x2895('0x2b')](db[_0x2895('0x2d')][_0x2895('0x12')](queryQueues));_0x30dc2f[_0x2895('0x2b')](db['FaxQueue'][_0x2895('0x12')](queryQueues));_0x30dc2f[_0x2895('0x2b')](db[_0x2895('0x2e')][_0x2895('0x12')](queryQueues));_0x30dc2f[_0x2895('0x2b')](db['MailQueue']['findAll'](queryQueues));_0x30dc2f[_0x2895('0x2b')](db[_0x2895('0x2f')]['findAll'](queryQueues));_0x30dc2f[_0x2895('0x2b')](db['WhatsappQueue'][_0x2895('0x12')](queryQueues));_0x30dc2f[_0x2895('0x2b')](db['User'][_0x2895('0x12')](queryTelephones));_0x30dc2f['push'](db[_0x2895('0x30')]['findAll'](queryTrunks));_0x30dc2f['push'](db[_0x2895('0x17')][_0x2895('0x12')](queryCampaigns));_0x30dc2f[_0x2895('0x2b')](db['User'][_0x2895('0x12')](queryAgents));break;case _0x2895('0x31'):_0x5671fa[_0x142e58](_0x2895('0x27'));_0x5671fa[_0x142e58](_0x2895('0x28'));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0x32'),_0x381538[_0x2895('0x1d')],_0x2895('0x2c')));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0xc'),_0x381538['userProfileId'],_0x2895('0x2d')));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0xd'),_0x381538[_0x2895('0x1d')],_0x2895('0x33')));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0xe'),_0x381538['userProfileId'],'SmsQueue'));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0x34'),_0x381538[_0x2895('0x1d')],_0x2895('0x35')));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0xf'),_0x381538['userProfileId'],'OpenchannelQueue'));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0x10'),_0x381538['userProfileId'],'WhatsappQueue'));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0x11'),_0x381538[_0x2895('0x1d')],_0x2895('0x5')));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0x36'),_0x381538['userProfileId'],_0x2895('0x30')));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0x13'),_0x381538[_0x2895('0x1d')],'Campaign'));_0x30dc2f[_0x2895('0x2b')](db[_0x2895('0x5')][_0x2895('0x12')](queryAgents));break;case _0x2895('0x37'):_0x5671fa[_0x142e58]('voice:inbound');_0x5671fa[_0x142e58]('voice:outbound');_0x30dc2f[_0x2895('0x2b')](_0x381538[_0x2895('0x38')]({'attributes':['id',_0x2895('0x4')]}));_0x30dc2f[_0x2895('0x2b')](_0x381538[_0x2895('0x39')]({'attributes':['id','name']}));_0x30dc2f['push'](_0x381538[_0x2895('0x3a')]({'attributes':['id',_0x2895('0x4')]}));_0x30dc2f[_0x2895('0x2b')](_0x381538[_0x2895('0x3b')]({'attributes':['id',_0x2895('0x4')]}));_0x30dc2f[_0x2895('0x2b')](_0x381538[_0x2895('0x3c')]({'attributes':['id','name']}));_0x30dc2f[_0x2895('0x2b')](_0x381538[_0x2895('0x3d')]({'attributes':['id',_0x2895('0x4')]}));_0x30dc2f[_0x2895('0x2b')](_0x381538[_0x2895('0x3e')]({'attributes':['id',_0x2895('0x4')]}));break;}return BPromise[_0x2895('0x3f')](_0x30dc2f);}})[_0x2895('0xb')](function(_0x549059){if(_0x549059&&_0x549059[_0x2895('0x1b')]){for(var _0x13ca9c=0x0;_0x13ca9c<_0x549059[_0x2895('0x1b')];_0x13ca9c+=0x1){for(var _0x4cdabd=0x0;_0x4cdabd<_0x549059[_0x13ca9c][_0x2895('0x1b')];_0x4cdabd+=0x1){switch(_0x13ca9c){case 0x0:joinOrLeaveQueues(_0x5671fa,_0x142e58,_0x2895('0x40'),_0x549059[_0x13ca9c][_0x4cdabd]);break;case 0x1:joinOrLeaveQueues(_0x5671fa,_0x142e58,'chat',_0x549059[_0x13ca9c][_0x4cdabd]);break;case 0x2:joinOrLeaveQueues(_0x5671fa,_0x142e58,_0x2895('0x41'),_0x549059[_0x13ca9c][_0x4cdabd]);break;case 0x3:joinOrLeaveQueues(_0x5671fa,_0x142e58,_0x2895('0x42'),_0x549059[_0x13ca9c][_0x4cdabd]);break;case 0x4:joinOrLeaveQueues(_0x5671fa,_0x142e58,_0x2895('0x43'),_0x549059[_0x13ca9c][_0x4cdabd]);break;case 0x5:joinOrLeaveQueues(_0x5671fa,_0x142e58,_0x2895('0x44'),_0x549059[_0x13ca9c][_0x4cdabd]);break;case 0x6:joinOrLeaveQueues(_0x5671fa,_0x142e58,_0x2895('0x45'),_0x549059[_0x13ca9c][_0x4cdabd]);break;case 0x7:if(_0x6f8ad4[_0x2895('0x6')]!==_0x2895('0x37'))_0x5671fa[_0x142e58](util['format'](_0x2895('0x46'),_0x549059[_0x13ca9c][_0x4cdabd][_0x2895('0x4')]));break;case 0x8:if(_0x6f8ad4['role']!=='agent')_0x5671fa[_0x142e58](util['format'](_0x2895('0x47'),_0x549059[_0x13ca9c][_0x4cdabd][_0x2895('0x4')]));break;case 0x9:if(_0x6f8ad4[_0x2895('0x6')]!==_0x2895('0x37'))_0x5671fa[_0x142e58](util[_0x2895('0x18')](_0x2895('0x48'),_0x549059[_0x13ca9c][_0x4cdabd][_0x2895('0x8')],_0x549059[_0x13ca9c][_0x4cdabd][_0x2895('0x4')]));break;case 0xa:_0x5671fa[_0x142e58](util[_0x2895('0x18')](_0x2895('0x49'),_0x549059[_0x13ca9c][_0x4cdabd][_0x2895('0x4')]));break;}}}}})[_0x2895('0xb')](function(){if(_0x142e58===_0x2895('0x4a')){var _0x1481f5=_[_0x2895('0x15')](_0x6f8ad4[_0x2895('0x20')],'id');return _0x6f8ad4[_0x2895('0x4b')](_0x1481f5)[_0x2895('0xb')](function(){for(var _0xbcf98=0x0;_0xbcf98<_0x1481f5[_0x2895('0x1b')];_0xbcf98+=0x1){_0x384357[_0x2895('0x4c')](_0x2895('0x4d'),{'ChatInteractionId':Number(_0x1481f5[_0xbcf98]),'UserId':Number(_0x6f8ad4['id'])});}});}})[_0x2895('0xb')](function(){if(_0x142e58===_0x2895('0x4a')){var _0x1128a1=_[_0x2895('0x15')](_0x6f8ad4[_0x2895('0x4e')],'id');return _0x6f8ad4[_0x2895('0x4f')](_0x1128a1)[_0x2895('0xb')](function(){for(var _0x4128f1=0x0;_0x4128f1<_0x1128a1[_0x2895('0x1b')];_0x4128f1+=0x1){_0x384357['emit'](_0x2895('0x50'),{'MailInteractionId':Number(_0x1128a1[_0x4128f1]),'UserId':Number(_0x6f8ad4['id'])});}});}})[_0x2895('0xb')](function(){if(_0x142e58===_0x2895('0x4a')){var _0x2a34f1=_[_0x2895('0x15')](_0x6f8ad4[_0x2895('0x23')],'id');return _0x6f8ad4['removeFaxInteractions'](_0x2a34f1)[_0x2895('0xb')](function(){for(var _0x5579b3=0x0;_0x5579b3<_0x2a34f1[_0x2895('0x1b')];_0x5579b3+=0x1){_0x384357[_0x2895('0x4c')](_0x2895('0x51'),{'FaxInteractionId':Number(_0x2a34f1[_0x5579b3]),'UserId':Number(_0x6f8ad4['id'])});}});}})[_0x2895('0xb')](function(){if(_0x142e58===_0x2895('0x4a')){var _0x56a2c0=_['map'](_0x6f8ad4[_0x2895('0x24')],'id');return _0x6f8ad4[_0x2895('0x52')](_0x56a2c0)[_0x2895('0xb')](function(){for(var _0x5c76aa=0x0;_0x5c76aa<_0x56a2c0[_0x2895('0x1b')];_0x5c76aa+=0x1){_0x384357['emit'](_0x2895('0x53'),{'SmsInteractionId':Number(_0x56a2c0[_0x5c76aa]),'UserId':Number(_0x6f8ad4['id'])});}});}})['then'](function(){if(_0x142e58==='leave'){var _0x49c4fd=_['map'](_0x6f8ad4[_0x2895('0x54')],'id');return _0x6f8ad4[_0x2895('0x55')](_0x49c4fd)[_0x2895('0xb')](function(){for(var _0x4336c=0x0;_0x4336c<_0x49c4fd[_0x2895('0x1b')];_0x4336c+=0x1){_0x384357[_0x2895('0x4c')](_0x2895('0x56'),{'OpenchannelInteractionId':Number(_0x49c4fd[_0x4336c]),'UserId':Number(_0x6f8ad4['id'])});}});}})['then'](function(){if(_0x142e58===_0x2895('0x4a')){var _0x1e777d=_['map'](_0x6f8ad4[_0x2895('0x57')],'id');return _0x6f8ad4['removeWhatsappInteractions'](_0x1e777d)['then'](function(){for(var _0x2a9194=0x0;_0x2a9194<_0x1e777d[_0x2895('0x1b')];_0x2a9194+=0x1){_0x384357['emit'](_0x2895('0x58'),{'WhatsappInteractionId':Number(_0x1e777d[_0x2a9194]),'UserId':Number(_0x6f8ad4['id'])});}});}})[_0x2895('0x59')](function(_0x35d979){_0x5671fa[_0x2895('0x5a')](_0x35d979);});}}function onDisconnect(_0x52616a,_0x2d3f5b){joinOrLeave(_0x52616a,'leave',_0x2d3f5b);}function onConnect(_0x409e2b){joinOrLeave(_0x409e2b,'join');}exports['default']=function(_0x1af031){_0x1af031['on']('connection',function(_0x3d86dd){_0x3d86dd[_0x2895('0x5b')](0x0);_0x3d86dd[_0x2895('0x5c')]=_0x3d86dd['request'][_0x2895('0x5d')][_0x2895('0x5e')]+':'+_0x3d86dd['request']['connection'][_0x2895('0x5f')];_0x3d86dd[_0x2895('0x60')]=new Date();_0x3d86dd['log']=function(_0x31505c){console['log']('SocketIO\x20'+_0x3d86dd[_0x2895('0x61')][_0x2895('0x4')]+'['+_0x3d86dd[_0x2895('0x5c')]+']',_0x31505c);};_0x3d86dd['on']('disconnect',function(){onDisconnect(_0x3d86dd,_0x1af031);_0x3d86dd[_0x2895('0x5a')](_0x2895('0x62'));});onConnect(_0x3d86dd);_0x3d86dd[_0x2895('0x5a')](_0x2895('0x63'));});}; \ No newline at end of file +var _0x6fc2=['./environment','name','role','agent','telephone','type','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','User','Campaign','where','ivr','Agents','format','user:%s','handshake','find','userProfileId','query','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:inbound','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','chat','sms','mail','openchannel','trunk:%s','leave','removeChatInteractions','emit','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','log','connection','address','request','remotePort','connectedAt','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird'];(function(_0x5f5646,_0x2ef59b){var _0x343f8a=function(_0x261123){while(--_0x261123){_0x5f5646['push'](_0x5f5646['shift']());}};_0x343f8a(++_0x2ef59b);}(_0x6fc2,0x117));var _0x26fc=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x6fc2[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x26fc('0x0'));var util=require(_0x26fc('0x1'));var BPromise=require(_0x26fc('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x26fc('0x3'));var queryQueues={'attributes':['id',_0x26fc('0x4')],'include':[{'as':'Agents','model':db['User'],'attributes':['id','name',_0x26fc('0x5')],'raw':!![],'where':{'role':_0x26fc('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x26fc('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x26fc('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x26fc('0x4')],'where':{'role':_0x26fc('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x26fc('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0x5a452d,_0x1d9522,_0x2ea728){return db[_0x26fc('0x9')]['findOne']({'where':{'name':_0x5a452d,'userProfileId':_0x1d9522},'raw':!![]})[_0x26fc('0xa')](function(_0xe22d78){if(_0xe22d78){if(_0xe22d78[_0x26fc('0xb')]){switch(_0x5a452d){case _0x26fc('0xc'):case _0x26fc('0xd'):case _0x26fc('0xe'):case _0x26fc('0xf'):case _0x26fc('0x10'):case _0x26fc('0x11'):case _0x26fc('0x12'):return db[_0x2ea728][_0x26fc('0x13')](queryQueues);case _0x26fc('0x14'):return db[_0x2ea728][_0x26fc('0x13')](queryTelephones);case _0x26fc('0x15'):return db[_0x2ea728][_0x26fc('0x13')](queryTrunks);case _0x26fc('0x16'):return db[_0x2ea728]['findAll'](queryCampaigns);}}else{return db[_0x26fc('0x17')][_0x26fc('0x13')]({'attributes':[_0x26fc('0x18')],'where':{'sectionId':_0xe22d78['id']},'raw':!![]})[_0x26fc('0xa')](function(_0x41d50a){if(_0x41d50a){var _0x29afb9={'where':{'id':_[_0x26fc('0x19')](_0x41d50a,_0x26fc('0x18'))},'raw':!![]};switch(_0x2ea728){case _0x26fc('0x1a'):_0x29afb9['where'][_0x26fc('0x5')]='telephone';break;case _0x26fc('0x1b'):_0x29afb9[_0x26fc('0x1c')][_0x26fc('0x8')]=_0x26fc('0x1d');break;}return db[_0x2ea728]['findAll'](_0x29afb9);}else{return[];}});}}else{return[];}})[_0x26fc('0xa')](function(_0x2d7e32){return _0x2d7e32;});}function joinOrLeaveQueues(_0x1c00ae,_0x9a9c2,_0xa0ca4f,_0x5f454f){_0x1c00ae[_0x9a9c2](util['format']('%s:queue:%s',_0xa0ca4f,_0x5f454f['name']));if(_0x5f454f['Agents']){for(var _0x4fa549=0x0;_0x4fa549<_0x5f454f[_0x26fc('0x1e')]['length'];_0x4fa549+=0x1){_0x1c00ae[_0x9a9c2](util[_0x26fc('0x1f')](_0x26fc('0x20'),_0x5f454f['Agents'][_0x4fa549][_0x26fc('0x4')]));}}}function joinOrLeave(_0x288c8d,_0x12a7ca,_0x1641f2){var _0x2738ee;if(_0x288c8d[_0x26fc('0x21')]['query']['id']){db[_0x26fc('0x1a')][_0x26fc('0x22')]({'attributes':['id',_0x26fc('0x4'),_0x26fc('0x5'),_0x26fc('0x23')],'where':{'id':_0x288c8d[_0x26fc('0x21')][_0x26fc('0x24')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x26fc('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x26fc('0x26')],'as':_0x26fc('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x26fc('0x28')],'as':_0x26fc('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x26fc('0x2a')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x26fc('0x2b')],'as':_0x26fc('0x2c'),'attributes':['id'],'raw':!![]},{'model':db[_0x26fc('0x2d')],'as':_0x26fc('0x2e'),'attributes':['id'],'raw':!![]}]})[_0x26fc('0xa')](function(_0x14ecff){if(_0x14ecff){_0x2738ee=_0x14ecff;_0x288c8d[_0x12a7ca](util[_0x26fc('0x1f')](_0x26fc('0x20'),_0x14ecff['name']));var _0x5457f5=[];switch(_0x14ecff['role']){case _0x26fc('0x2f'):_0x288c8d[_0x12a7ca]('voice:inbound');_0x288c8d[_0x12a7ca]('voice:outbound');if(queryQueues[_0x26fc('0x30')](_0x26fc('0x31'))){delete queryQueues[_0x26fc('0x31')];}_0x5457f5[_0x26fc('0x32')](db[_0x26fc('0x33')][_0x26fc('0x13')](queryQueues));_0x5457f5[_0x26fc('0x32')](db[_0x26fc('0x34')][_0x26fc('0x13')](queryQueues));_0x5457f5[_0x26fc('0x32')](db['FaxQueue'][_0x26fc('0x13')](queryQueues));_0x5457f5[_0x26fc('0x32')](db[_0x26fc('0x35')][_0x26fc('0x13')](queryQueues));_0x5457f5[_0x26fc('0x32')](db[_0x26fc('0x36')][_0x26fc('0x13')](queryQueues));_0x5457f5['push'](db[_0x26fc('0x37')]['findAll'](queryQueues));_0x5457f5[_0x26fc('0x32')](db[_0x26fc('0x38')][_0x26fc('0x13')](queryQueues));_0x5457f5[_0x26fc('0x32')](db[_0x26fc('0x1a')]['findAll'](queryTelephones));_0x5457f5[_0x26fc('0x32')](db[_0x26fc('0x39')]['findAll'](queryTrunks));_0x5457f5[_0x26fc('0x32')](db['Campaign'][_0x26fc('0x13')](queryCampaigns));_0x5457f5[_0x26fc('0x32')](db[_0x26fc('0x1a')][_0x26fc('0x13')](queryAgents));break;case _0x26fc('0x3a'):_0x288c8d[_0x12a7ca](_0x26fc('0x3b'));_0x288c8d[_0x12a7ca]('voice:outbound');_0x5457f5['push'](getAssociatedResources(_0x26fc('0xc'),_0x14ecff[_0x26fc('0x23')],_0x26fc('0x33')));_0x5457f5[_0x26fc('0x32')](getAssociatedResources('ChatQueues',_0x14ecff[_0x26fc('0x23')],_0x26fc('0x34')));_0x5457f5['push'](getAssociatedResources(_0x26fc('0xe'),_0x14ecff[_0x26fc('0x23')],'FaxQueue'));_0x5457f5[_0x26fc('0x32')](getAssociatedResources(_0x26fc('0xf'),_0x14ecff[_0x26fc('0x23')],'SmsQueue'));_0x5457f5[_0x26fc('0x32')](getAssociatedResources(_0x26fc('0x10'),_0x14ecff['userProfileId'],_0x26fc('0x36')));_0x5457f5['push'](getAssociatedResources(_0x26fc('0x11'),_0x14ecff[_0x26fc('0x23')],_0x26fc('0x37')));_0x5457f5[_0x26fc('0x32')](getAssociatedResources(_0x26fc('0x12'),_0x14ecff[_0x26fc('0x23')],_0x26fc('0x38')));_0x5457f5[_0x26fc('0x32')](getAssociatedResources(_0x26fc('0x14'),_0x14ecff[_0x26fc('0x23')],_0x26fc('0x1a')));_0x5457f5[_0x26fc('0x32')](getAssociatedResources('Trunks',_0x14ecff[_0x26fc('0x23')],_0x26fc('0x39')));_0x5457f5[_0x26fc('0x32')](getAssociatedResources(_0x26fc('0x16'),_0x14ecff[_0x26fc('0x23')],_0x26fc('0x1b')));_0x5457f5[_0x26fc('0x32')](db['User']['findAll'](queryAgents));break;case _0x26fc('0x6'):_0x288c8d[_0x12a7ca](_0x26fc('0x3b'));_0x288c8d[_0x12a7ca]('voice:outbound');_0x5457f5[_0x26fc('0x32')](_0x14ecff[_0x26fc('0x3c')]({'attributes':['id',_0x26fc('0x4')]}));_0x5457f5['push'](_0x14ecff[_0x26fc('0x3d')]({'attributes':['id',_0x26fc('0x4')]}));_0x5457f5[_0x26fc('0x32')](_0x14ecff[_0x26fc('0x3e')]({'attributes':['id',_0x26fc('0x4')]}));_0x5457f5[_0x26fc('0x32')](_0x14ecff[_0x26fc('0x3f')]({'attributes':['id',_0x26fc('0x4')]}));_0x5457f5[_0x26fc('0x32')](_0x14ecff[_0x26fc('0x40')]({'attributes':['id',_0x26fc('0x4')]}));_0x5457f5['push'](_0x14ecff[_0x26fc('0x41')]({'attributes':['id',_0x26fc('0x4')]}));_0x5457f5['push'](_0x14ecff[_0x26fc('0x42')]({'attributes':['id',_0x26fc('0x4')]}));break;}return BPromise[_0x26fc('0x43')](_0x5457f5);}})['then'](function(_0x27f00e){if(_0x27f00e&&_0x27f00e[_0x26fc('0x44')]){for(var _0x202412=0x0;_0x202412<_0x27f00e[_0x26fc('0x44')];_0x202412+=0x1){for(var _0x182bb6=0x0;_0x182bb6<_0x27f00e[_0x202412]['length'];_0x182bb6+=0x1){switch(_0x202412){case 0x0:joinOrLeaveQueues(_0x288c8d,_0x12a7ca,_0x26fc('0x45'),_0x27f00e[_0x202412][_0x182bb6]);break;case 0x1:joinOrLeaveQueues(_0x288c8d,_0x12a7ca,_0x26fc('0x46'),_0x27f00e[_0x202412][_0x182bb6]);break;case 0x2:joinOrLeaveQueues(_0x288c8d,_0x12a7ca,'fax',_0x27f00e[_0x202412][_0x182bb6]);break;case 0x3:joinOrLeaveQueues(_0x288c8d,_0x12a7ca,_0x26fc('0x47'),_0x27f00e[_0x202412][_0x182bb6]);break;case 0x4:joinOrLeaveQueues(_0x288c8d,_0x12a7ca,_0x26fc('0x48'),_0x27f00e[_0x202412][_0x182bb6]);break;case 0x5:joinOrLeaveQueues(_0x288c8d,_0x12a7ca,_0x26fc('0x49'),_0x27f00e[_0x202412][_0x182bb6]);break;case 0x6:joinOrLeaveQueues(_0x288c8d,_0x12a7ca,'whatsapp',_0x27f00e[_0x202412][_0x182bb6]);break;case 0x7:if(_0x2738ee[_0x26fc('0x5')]!==_0x26fc('0x6'))_0x288c8d[_0x12a7ca](util[_0x26fc('0x1f')]('telephone:%s',_0x27f00e[_0x202412][_0x182bb6]['name']));break;case 0x8:if(_0x2738ee[_0x26fc('0x5')]!==_0x26fc('0x6'))_0x288c8d[_0x12a7ca](util[_0x26fc('0x1f')](_0x26fc('0x4a'),_0x27f00e[_0x202412][_0x182bb6][_0x26fc('0x4')]));break;case 0x9:if(_0x2738ee['role']!=='agent')_0x288c8d[_0x12a7ca](util[_0x26fc('0x1f')]('campaign:%s:%s',_0x27f00e[_0x202412][_0x182bb6]['type'],_0x27f00e[_0x202412][_0x182bb6][_0x26fc('0x4')]));break;case 0xa:_0x288c8d[_0x12a7ca](util[_0x26fc('0x1f')](_0x26fc('0x20'),_0x27f00e[_0x202412][_0x182bb6][_0x26fc('0x4')]));break;}}}}})[_0x26fc('0xa')](function(){if(_0x12a7ca===_0x26fc('0x4b')){var _0x6c753=_[_0x26fc('0x19')](_0x2738ee[_0x26fc('0x25')],'id');return _0x2738ee[_0x26fc('0x4c')](_0x6c753)['then'](function(){for(var _0x7e6b58=0x0;_0x7e6b58<_0x6c753[_0x26fc('0x44')];_0x7e6b58+=0x1){_0x1641f2[_0x26fc('0x4d')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x6c753[_0x7e6b58]),'UserId':Number(_0x2738ee['id'])});}});}})[_0x26fc('0xa')](function(){if(_0x12a7ca==='leave'){var _0x5ddde5=_[_0x26fc('0x19')](_0x2738ee['MailInteractions'],'id');return _0x2738ee['removeMailInteractions'](_0x5ddde5)[_0x26fc('0xa')](function(){for(var _0x4fc2e6=0x0;_0x4fc2e6<_0x5ddde5[_0x26fc('0x44')];_0x4fc2e6+=0x1){_0x1641f2[_0x26fc('0x4d')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x5ddde5[_0x4fc2e6]),'UserId':Number(_0x2738ee['id'])});}});}})[_0x26fc('0xa')](function(){if(_0x12a7ca===_0x26fc('0x4b')){var _0x2d4b54=_[_0x26fc('0x19')](_0x2738ee[_0x26fc('0x29')],'id');return _0x2738ee[_0x26fc('0x4e')](_0x2d4b54)['then'](function(){for(var _0x33427c=0x0;_0x33427c<_0x2d4b54['length'];_0x33427c+=0x1){_0x1641f2[_0x26fc('0x4d')](_0x26fc('0x4f'),{'FaxInteractionId':Number(_0x2d4b54[_0x33427c]),'UserId':Number(_0x2738ee['id'])});}});}})[_0x26fc('0xa')](function(){if(_0x12a7ca===_0x26fc('0x4b')){var _0x3db60c=_[_0x26fc('0x19')](_0x2738ee[_0x26fc('0x50')],'id');return _0x2738ee['removeSmsInteractions'](_0x3db60c)[_0x26fc('0xa')](function(){for(var _0x32eff8=0x0;_0x32eff8<_0x3db60c[_0x26fc('0x44')];_0x32eff8+=0x1){_0x1641f2[_0x26fc('0x4d')](_0x26fc('0x51'),{'SmsInteractionId':Number(_0x3db60c[_0x32eff8]),'UserId':Number(_0x2738ee['id'])});}});}})[_0x26fc('0xa')](function(){if(_0x12a7ca==='leave'){var _0x2a4a74=_[_0x26fc('0x19')](_0x2738ee[_0x26fc('0x2c')],'id');return _0x2738ee['removeOpenchannelInteractions'](_0x2a4a74)[_0x26fc('0xa')](function(){for(var _0x213d56=0x0;_0x213d56<_0x2a4a74['length'];_0x213d56+=0x1){_0x1641f2[_0x26fc('0x4d')](_0x26fc('0x52'),{'OpenchannelInteractionId':Number(_0x2a4a74[_0x213d56]),'UserId':Number(_0x2738ee['id'])});}});}})[_0x26fc('0xa')](function(){if(_0x12a7ca===_0x26fc('0x4b')){var _0x1773f0=_[_0x26fc('0x19')](_0x2738ee[_0x26fc('0x2e')],'id');return _0x2738ee['removeWhatsappInteractions'](_0x1773f0)[_0x26fc('0xa')](function(){for(var _0x506b4e=0x0;_0x506b4e<_0x1773f0[_0x26fc('0x44')];_0x506b4e+=0x1){_0x1641f2['emit'](_0x26fc('0x53'),{'WhatsappInteractionId':Number(_0x1773f0[_0x506b4e]),'UserId':Number(_0x2738ee['id'])});}});}})['catch'](function(_0x14e4b7){_0x288c8d[_0x26fc('0x54')](_0x14e4b7);});}}function onDisconnect(_0x49f685,_0x34e013){joinOrLeave(_0x49f685,_0x26fc('0x4b'),_0x34e013);}function onConnect(_0xd06ed7){joinOrLeave(_0xd06ed7,'join');}exports['default']=function(_0x4b2c1d){_0x4b2c1d['on'](_0x26fc('0x55'),function(_0x5f5672){_0x5f5672['setMaxListeners'](0x0);_0x5f5672[_0x26fc('0x56')]=_0x5f5672[_0x26fc('0x57')]['connection']['remoteAddress']+':'+_0x5f5672[_0x26fc('0x57')][_0x26fc('0x55')][_0x26fc('0x58')];_0x5f5672[_0x26fc('0x59')]=new Date();_0x5f5672['log']=function(_0x313cea){console['log'](_0x26fc('0x5a')+_0x5f5672['nsp']['name']+'['+_0x5f5672[_0x26fc('0x56')]+']',_0x313cea);};_0x5f5672['on'](_0x26fc('0x5b'),function(){onDisconnect(_0x5f5672,_0x4b2c1d);_0x5f5672[_0x26fc('0x54')](_0x26fc('0x5c'));});onConnect(_0x5f5672);_0x5f5672['log'](_0x26fc('0x5d'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 7accf91..27d1f6d 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 _0x9646=['newinteraction','closedinteraction','ChatOfflineMessage','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','afterUpdate','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','info','error','code','Trigger,\x20%s','get','channel','motionChannel','event','direction','resolve','then','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','UserId','interface','SIP/%s','name','incomingmessage','outgoingmessage','catch','AfterCreateMessage','offlineMessage','opened','query','SELECT','format','changed','substatus','closed','agent','User','find','fullname','email','internal','default','hasOwnProperty','model','hook','callback','util','../../mysqldb','jayson/promise','../logger','triggers','client','http','Chat','ChatInteraction','afterCreate'];(function(_0xe6e71b,_0x1d96bf){var _0x13aad1=function(_0x26d932){while(--_0x26d932){_0xe6e71b['push'](_0xe6e71b['shift']());}};_0x13aad1(++_0x1d96bf);}(_0x9646,0x8c));var _0x6964=function(_0x1f4e09,_0x1fc591){_0x1f4e09=_0x1f4e09-0x0;var _0x10deec=_0x9646[_0x1f4e09];return _0x10deec;};'use strict';var util=require(_0x6964('0x0'));var db=require(_0x6964('0x1'))['db'];var jayson=require(_0x6964('0x2'));var logger=require(_0x6964('0x3'))(_0x6964('0x4'));var client=jayson[_0x6964('0x5')][_0x6964('0x6')]({'port':0x232a});var triggers=[{'channel':_0x6964('0x7'),'model':_0x6964('0x8'),'event':_0x6964('0x9'),'condition':_0x6964('0xa'),'callback':afterCreate},{'channel':_0x6964('0x7'),'model':_0x6964('0x8'),'event':'afterUpdate','condition':_0x6964('0xb'),'callback':afterUpdate},{'channel':'Chat','model':'ChatMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Chat','model':_0x6964('0xc'),'event':_0x6964('0x9'),'condition':_0x6964('0xd'),'callback':afterCreateOfflineMessage},{'channel':_0x6964('0xe'),'model':_0x6964('0xf'),'event':_0x6964('0x9'),'condition':_0x6964('0xa'),'callback':afterCreate},{'channel':_0x6964('0xe'),'model':_0x6964('0xf'),'event':'afterUpdate','condition':_0x6964('0xb'),'callback':afterUpdate},{'channel':_0x6964('0xe'),'model':_0x6964('0x10'),'event':_0x6964('0x9'),'condition':_0x6964('0xd'),'callback':afterCreateMessage},{'channel':_0x6964('0x11'),'model':_0x6964('0x12'),'event':_0x6964('0x9'),'condition':_0x6964('0xa'),'callback':afterCreate},{'channel':_0x6964('0x11'),'model':_0x6964('0x12'),'event':_0x6964('0x13'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Whatsapp','model':'WhatsappMessage','event':_0x6964('0x9'),'condition':_0x6964('0xd'),'callback':afterCreateMessage},{'channel':_0x6964('0x14'),'model':_0x6964('0x15'),'event':_0x6964('0x9'),'condition':_0x6964('0xa'),'callback':afterCreate},{'channel':_0x6964('0x14'),'model':'FaxInteraction','event':_0x6964('0x13'),'condition':_0x6964('0xb'),'callback':afterUpdate},{'channel':_0x6964('0x14'),'model':_0x6964('0x16'),'event':_0x6964('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x6964('0x17'),'model':'MailInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x6964('0x17'),'model':_0x6964('0x18'),'event':_0x6964('0x13'),'condition':_0x6964('0xb'),'callback':afterUpdate},{'channel':_0x6964('0x17'),'model':'MailMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x6964('0x19'),'model':_0x6964('0x1a'),'event':_0x6964('0x9'),'condition':_0x6964('0xa'),'callback':afterCreate},{'channel':'Openchannel','model':_0x6964('0x1a'),'event':_0x6964('0x13'),'condition':_0x6964('0xb'),'callback':afterUpdate},{'channel':_0x6964('0x19'),'model':_0x6964('0x1b'),'event':_0x6964('0x9'),'condition':_0x6964('0xd'),'callback':afterCreateMessage}];function request(_0xdbf41b){return client[_0x6964('0x1c')](_0x6964('0x1d'),_0xdbf41b)['then'](function(_0x3fab1f){logger[_0x6964('0x1e')]('Trigger,\x20%s',_0x6964('0x1d'),_0x3fab1f);if(_0x3fab1f[_0x6964('0x1f')]){if(_0x3fab1f[_0x6964('0x1f')][_0x6964('0x20')]===0x1f4){logger[_0x6964('0x1f')](_0x6964('0x21'),_0x6964('0x1d'),_0x3fab1f[_0x6964('0x1f')]);}}})['catch'](function(_0x2121a1){logger[_0x6964('0x1f')](_0x6964('0x21'),_0x6964('0x1d'),_0x2121a1);});}function afterCreateMessage(_0x3f9565){return function(_0x511048){_0x511048=_0x511048[_0x6964('0x22')]({'plain':!![]});_0x511048[_0x6964('0x23')]=_0x3f9565;_0x511048[_0x6964('0x24')]=_0x3f9565;_0x511048[_0x6964('0x25')]=_0x511048[_0x6964('0x26')];Promise[_0x6964('0x27')]()[_0x6964('0x28')](function(){if(typeof _0x511048['ContactId']===_0x6964('0x29'))return null;var _0x51d599=_0x6964('0x2a')+_0x511048[_0x6964('0x2b')];return db[_0x6964('0x2c')]['query'](_0x51d599,{'type':db[_0x6964('0x2d')][_0x6964('0x2e')]['SELECT'],'raw':!![]});})[_0x6964('0x28')](function(_0x475f7e){if(_0x475f7e){_0x511048[_0x6964('0x2f')]=_0x475f7e[0x0];}if(typeof _0x511048[_0x6964('0x30')]===_0x6964('0x29'))return;return getAgent(_0x511048[_0x6964('0x30')]);})[_0x6964('0x28')](function(_0x24ae94){if(_0x24ae94){_0x511048[_0x6964('0x31')]=util['format'](_0x6964('0x32'),_0x24ae94[_0x6964('0x33')]);_0x511048['agent']=_0x24ae94;_0x511048['channel']=_0x3f9565;return request({'event':_0x6964('0x34'),'message':_0x511048});}else{return request({'event':_0x6964('0x35'),'message':_0x511048});}})[_0x6964('0x36')](function(_0x168ffe){logger[_0x6964('0x1f')](_0x6964('0x21'),_0x6964('0x37'),_0x168ffe);});};}function afterCreateOfflineMessage(_0x3e6a2c){return function(_0x1cf58f){_0x1cf58f=_0x1cf58f[_0x6964('0x22')]({'plain':!![]});_0x1cf58f[_0x6964('0x23')]=_0x3e6a2c;_0x1cf58f[_0x6964('0x24')]=_0x3e6a2c;_0x1cf58f[_0x6964('0x25')]=_0x6964('0x38');return request({'event':_0x1cf58f[_0x6964('0x25')],'message':_0x1cf58f});};}function afterCreate(_0xcb9b12,_0x42c63d){return function(_0x4fc2a4){_0x4fc2a4=_0x4fc2a4[_0x6964('0x22')]({'plain':!![]});_0x4fc2a4[_0x6964('0x23')]=_0xcb9b12;_0x4fc2a4['motionChannel']=_0xcb9b12;_0x4fc2a4[_0x6964('0x25')]=_0x6964('0x39');Promise['resolve']()[_0x6964('0x28')](function(){var _0x2adac0=_0x6964('0x2a')+_0x4fc2a4[_0x6964('0x2b')];return db[_0x6964('0x2c')][_0x6964('0x3a')](_0x2adac0,{'type':db[_0x6964('0x2d')][_0x6964('0x2e')][_0x6964('0x3b')],'raw':!![]});})['then'](function(_0x26f8ea){if(_0x26f8ea){_0x4fc2a4[_0x6964('0x2f')]=_0x26f8ea[0x0];}if(typeof _0x4fc2a4[_0x6964('0x30')]===_0x6964('0x29'))return;return getAgent(_0x4fc2a4[_0x6964('0x30')]);})[_0x6964('0x28')](function(_0x12d71d){if(_0x12d71d){_0x4fc2a4[_0x6964('0x31')]=util[_0x6964('0x3c')]('SIP/%s',_0x12d71d[_0x6964('0x33')]);_0x4fc2a4['agent']=_0x12d71d;}return request({'event':_0x42c63d,'message':_0x4fc2a4});})['catch'](function(_0x253468){logger[_0x6964('0x1f')](_0x6964('0x21'),'AfterCreate',_0x253468);});};}function afterUpdate(_0x34d3bf){return function(_0x271358){var _0x3db46f=_0x271358['changed']('closed')&&_0x271358['closed'];var _0x5ab76c=_0x271358[_0x6964('0x3d')](_0x6964('0x3e'));if(_0x3db46f||_0x5ab76c){var _0x4d1cb1=_0x3db46f?_0x6964('0xb'):_0x6964('0x3e');var _0x57816a=_0x271358['get']({'plain':!![]});_0x57816a[_0x6964('0x23')]=_0x34d3bf;_0x57816a[_0x6964('0x24')]=_0x34d3bf;_0x57816a[_0x6964('0x25')]=_0x3db46f?_0x6964('0x3f'):_0x6964('0x3e');var _0x5addca='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x57816a[_0x6964('0x2b')];return db[_0x6964('0x2c')]['query'](_0x5addca,{'type':db['Sequelize'][_0x6964('0x2e')][_0x6964('0x3b')],'raw':!![]})[_0x6964('0x28')](function(_0x54ac23){if(_0x54ac23){_0x57816a[_0x6964('0x2f')]=_0x54ac23[0x0];}if(typeof _0x57816a[_0x6964('0x30')]==='undefined')return;return getAgent(_0x57816a[_0x6964('0x30')]);})[_0x6964('0x28')](function(_0x9fed34){if(_0x9fed34){_0x57816a[_0x6964('0x31')]=util[_0x6964('0x3c')](_0x6964('0x32'),_0x9fed34[_0x6964('0x33')]);_0x57816a[_0x6964('0x40')]=_0x9fed34;}return request({'event':_0x4d1cb1,'message':_0x57816a});})['catch'](function(_0x4d49b0){logger[_0x6964('0x1f')](_0x6964('0x21'),'AfterUpdate',_0x4d49b0);});}};}function getAgent(_0x28362a){return db[_0x6964('0x41')][_0x6964('0x42')]({'where':{'id':_0x28362a},'attributes':['id','name',_0x6964('0x43'),_0x6964('0x44'),_0x6964('0x45')],'raw':!![]})[_0x6964('0x28')](function(_0xa4c464){return _0xa4c464;});}exports[_0x6964('0x46')]=function(){for(var _0x4c99d5=0x0;_0x4c99d5=_0x5f00a0[_0xe8d8('0x12')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x13a260(_0xeba82a);})['catch'](function(_0x5b5352){_0x5a9fcc(_0x5b5352);});});}; \ No newline at end of file +var _0x9795=['then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','agent','User','count'];(function(_0x4854d6,_0x2f1264){var _0x3885c0=function(_0x4d564d){while(--_0x4d564d){_0x4854d6['push'](_0x4854d6['shift']());}};_0x3885c0(++_0x2f1264);}(_0x9795,0x17b));var _0x5979=function(_0x515600,_0x6616d3){_0x515600=_0x515600-0x0;var _0x359ba3=_0x9795[_0x515600];return _0x359ba3;};'use strict';var _=require(_0x5979('0x0'));var BPromise=require(_0x5979('0x1'));var db=require(_0x5979('0x2'))['db'];var util=require(_0x5979('0x3'));var channels=[_0x5979('0x4'),_0x5979('0x5'),_0x5979('0x6'),_0x5979('0x7'),_0x5979('0x8'),_0x5979('0x9'),_0x5979('0xa')];exports[_0x5979('0xb')]=function(){return channels;};exports[_0x5979('0xc')]=function(_0x110c62){_0x110c62=_0x110c62['toLowerCase']();return _[_0x5979('0xd')](channels,_0x110c62);};exports[_0x5979('0xe')]=function(_0x3686ba,_0x51a5ed,_0x579ed8,_0x548698){var _0x34ca61={'loginAttempts':_0x51a5ed,'blocked':_0x579ed8};if(!_[_0x5979('0xf')](_0x548698)){_0x34ca61[_0x5979('0x10')]=_0x548698;}return _0x3686ba[_0x5979('0x11')](_0x34ca61);};exports['getLicense']=function(_0x48573e){return new BPromise(function(_0x2f3564,_0x5c17c2){var _0x2852ef=0x0;if(_0x48573e['role']!==_0x5979('0x12')){_0x2f3564(_0x48573e);}db[_0x5979('0x13')][_0x5979('0x14')]({'where':{'role':_0x5979('0x12'),'online':!![],'id':{'$ne':_0x48573e['id']}}})[_0x5979('0x15')](function(_0x41a1f9){_0x2852ef=_0x41a1f9;return util['getLicense']();})['then'](function(_0x2e16f6){if(_0x2e16f6&&_0x2e16f6[_0x5979('0x16')]&&_0x2852ef>=_0x2e16f6[_0x5979('0x16')]){throw Error(_0x5979('0x17'));}_0x2f3564(_0x48573e);})[_0x5979('0x18')](function(_0x4235bd){_0x5c17c2(_0x4235bd);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index c3c6229..8913d77 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Bad\x20Request','Forbidden','Out\x20Of\x20Interval','Not\x20Found','error','stack','statusMessage','status','send','exports','util','../config/logger','api','message','name','Error','inherits','Entity\x20not\x20found'];(function(_0x55febd,_0x271613){var _0x5598bb=function(_0x3caa9b){while(--_0x3caa9b){_0x55febd['push'](_0x55febd['shift']());}};_0x5598bb(++_0x271613);}(_0x7a54,0x106));var _0x47a5=function(_0x515365,_0x1193b2){_0x515365=_0x515365-0x0;var _0x4450e1=_0x7a54[_0x515365];return _0x4450e1;};'use strict';var util=require(_0x47a5('0x0'));var logger=require(_0x47a5('0x1'))(_0x47a5('0x2'));var APIError=function(_0x58157c,_0x1d33e){this[_0x47a5('0x3')]=_0x58157c||'Internal\x20Server\x20Error';this[_0x47a5('0x4')]=_0x1d33e||_0x47a5('0x5');util[_0x47a5('0x6')](APIError,Error);};var APIBadRequestError=function(_0x3717e1){this[_0x47a5('0x3')]=_0x3717e1||'Bad\x20Request';this[_0x47a5('0x4')]='Bad\x20Request';util[_0x47a5('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x30e405){this['message']=_0x30e405||_0x47a5('0x7');this['name']='Not\x20Found';util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x2a0e98){this[_0x47a5('0x3')]=_0x2a0e98||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this[_0x47a5('0x4')]='Out\x20Of\x20Interval';util['inherits'](APIOutOfIntervalError,APIError);};function getStatusCode(_0x1f47f4){switch(_0x1f47f4){case _0x47a5('0x8'):return 0x190;case _0x47a5('0x9'),_0x47a5('0xa'):return 0x193;case _0x47a5('0xb'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0xd308b8){if(_0xd308b8===_0x47a5('0xa'))return _0xd308b8;return null;}function handleError(_0x5beb89){return function(_0x44bd3e){logger[_0x47a5('0xc')](_0x44bd3e[_0x47a5('0xd')]);var _0x711793=getStatusCode(_0x44bd3e[_0x47a5('0x4')]);var _0x620ee9=getCustomStatusMessage(_0x44bd3e[_0x47a5('0x4')]);if(_0x44bd3e[_0x47a5('0x4')])delete _0x44bd3e['name'];if(_0x620ee9)_0x5beb89[_0x47a5('0xe')]=_0x620ee9;return _0x5beb89[_0x47a5('0xf')](_0x711793)[_0x47a5('0x10')](_0x44bd3e);};}module[_0x47a5('0x11')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x814b=['statusMessage','status','send','exports','util','../config/logger','api','message','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error','stack'];(function(_0x5967e6,_0x103c1b){var _0x26706a=function(_0x2944ca){while(--_0x2944ca){_0x5967e6['push'](_0x5967e6['shift']());}};_0x26706a(++_0x103c1b);}(_0x814b,0x1a2));var _0xb814=function(_0x4d230c,_0x3862fd){_0x4d230c=_0x4d230c-0x0;var _0x16b044=_0x814b[_0x4d230c];return _0x16b044;};'use strict';var util=require(_0xb814('0x0'));var logger=require(_0xb814('0x1'))(_0xb814('0x2'));var APIError=function(_0x2f4ece,_0xfbb64b){this[_0xb814('0x3')]=_0x2f4ece||'Internal\x20Server\x20Error';this[_0xb814('0x4')]=_0xfbb64b||_0xb814('0x5');util[_0xb814('0x6')](APIError,Error);};var APIBadRequestError=function(_0x4237bc){this[_0xb814('0x3')]=_0x4237bc||_0xb814('0x7');this['name']=_0xb814('0x7');util[_0xb814('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x5c8539){this[_0xb814('0x3')]=_0x5c8539||_0xb814('0x8');this[_0xb814('0x4')]=_0xb814('0x9');util[_0xb814('0x6')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x21d4a5){this[_0xb814('0x3')]=_0x21d4a5||_0xb814('0xa');this[_0xb814('0x4')]=_0xb814('0xb');util[_0xb814('0x6')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x4b5f14){switch(_0x4b5f14){case _0xb814('0x7'):return 0x190;case'Forbidden',_0xb814('0xb'):return 0x193;case _0xb814('0x9'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x35b10d){if(_0x35b10d===_0xb814('0xb'))return _0x35b10d;return null;}function handleError(_0x2ce718){return function(_0x3bde14){logger[_0xb814('0xc')](_0x3bde14[_0xb814('0xd')]);var _0xa0a2e5=getStatusCode(_0x3bde14[_0xb814('0x4')]);var _0x3f4881=getCustomStatusMessage(_0x3bde14[_0xb814('0x4')]);if(_0x3bde14[_0xb814('0x4')])delete _0x3bde14[_0xb814('0x4')];if(_0x3f4881)_0x2ce718[_0xb814('0xe')]=_0x3f4881;return _0x2ce718[_0xb814('0xf')](_0xa0a2e5)[_0xb814('0x10')](_0x3bde14);};}module[_0xb814('0x11')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index ec83d8d..f1ff38e 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44e0=['exports','404','status','send'];(function(_0x3fcc20,_0x57c31b){var _0x15d3ce=function(_0x575619){while(--_0x575619){_0x3fcc20['push'](_0x3fcc20['shift']());}};_0x15d3ce(++_0x57c31b);}(_0x44e0,0x174));var _0x044e=function(_0x1e5328,_0x537672){_0x1e5328=_0x1e5328-0x0;var _0x39edea=_0x44e0[_0x1e5328];return _0x39edea;};'use strict';module[_0x044e('0x0')][0x194]=function pageNotFound(_0x3f9f10,_0x33d125){var _0x3fb213=_0x044e('0x1');var _0x37a317=0x194;var _0x43483b={'status':_0x37a317};_0x33d125[_0x044e('0x2')](_0x43483b[_0x044e('0x2')]);_0x33d125['render'](_0x3fb213,{},function(_0x53ac1e,_0x55b7c3){if(_0x53ac1e){return _0x33d125[_0x044e('0x2')](_0x43483b[_0x044e('0x2')])['json'](_0x43483b);}_0x33d125[_0x044e('0x3')](_0x55b7c3);});}; \ No newline at end of file +var _0x4f6f=['status','exports','404'];(function(_0x32414e,_0x27c008){var _0x2970a9=function(_0x3b64db){while(--_0x3b64db){_0x32414e['push'](_0x32414e['shift']());}};_0x2970a9(++_0x27c008);}(_0x4f6f,0x17e));var _0xf4f6=function(_0xd67723,_0x1e576f){_0xd67723=_0xd67723-0x0;var _0x53b62b=_0x4f6f[_0xd67723];return _0x53b62b;};'use strict';module[_0xf4f6('0x0')][0x194]=function pageNotFound(_0x3f76a1,_0x1ddee1){var _0x147c2d=_0xf4f6('0x1');var _0x242163=0x194;var _0x4d4fb5={'status':_0x242163};_0x1ddee1[_0xf4f6('0x2')](_0x4d4fb5[_0xf4f6('0x2')]);_0x1ddee1['render'](_0x147c2d,{},function(_0x3681a2,_0x20a802){if(_0x3681a2){return _0x1ddee1['status'](_0x4d4fb5['status'])['json'](_0x4d4fb5);}_0x1ddee1['send'](_0x20a802);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index fbb74c1..8c11b66 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(_0x53bcc3,_0x364374){var _0x47c959=function(_0x40ef7d){while(--_0x40ef7d){_0x53bcc3['push'](_0x53bcc3['shift']());}};_0x47c959(++_0x364374);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0xf34b0a,_0x11e116){var _0x5021e1=function(_0x4eff67){while(--_0x4eff67){_0xf34b0a['push'](_0xf34b0a['shift']());}};_0x5021e1(++_0x11e116);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 4150986..35cb391 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed75=['./errors','setupLoggers','default','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/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/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','/api/chat/proactive_actions','./api/cmCompany','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','/api/cm/custom_fields','/api/actions','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','./api/variable','./api/integration','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Field','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/teams','./api/team','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/mailTransferReport','./api/chatTransferReport','./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/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','/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/version','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','path'];(function(_0x18e3e7,_0x39886c){var _0x211dee=function(_0x1dc34b){while(--_0x1dc34b){_0x18e3e7['push'](_0x18e3e7['shift']());}};_0x211dee(++_0x39886c);}(_0xed75,0x10c));var _0x5ed7=function(_0x437bdb,_0x47d4c9){_0x437bdb=_0x437bdb-0x0;var _0x1bf3c7=_0xed75[_0x437bdb];return _0x1bf3c7;};'use strict';var path=require(_0x5ed7('0x0'));var express=require('express');var errors=require(_0x5ed7('0x1'));var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')[_0x5ed7('0x2')];var clientSideLogs=require('./api/client-side-logs');exports[_0x5ed7('0x3')]=function(_0x6c78a8){return setupLoggers(_0x6c78a8)['then'](function(){_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x5'),require(_0x5ed7('0x6')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x7'),require(_0x5ed7('0x8')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x9'),require(_0x5ed7('0xa')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xb'),require(_0x5ed7('0xc')));_0x6c78a8[_0x5ed7('0x4')]('/api/voice/mohs',require(_0x5ed7('0xd')));_0x6c78a8[_0x5ed7('0x4')]('/api/voice/queues',require(_0x5ed7('0xe')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xf'),require(_0x5ed7('0x10')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x11'),require(_0x5ed7('0x12')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x13'),require('./api/voiceMail'));_0x6c78a8['use'](_0x5ed7('0x14'),require(_0x5ed7('0x15')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x16'),require(_0x5ed7('0x17')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x18'),require(_0x5ed7('0x19')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x1a'),require(_0x5ed7('0x1b')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x1c'),require(_0x5ed7('0x1d')));_0x6c78a8['use'](_0x5ed7('0x1e'),require(_0x5ed7('0x1f')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x20'),require(_0x5ed7('0x21')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x22'),require(_0x5ed7('0x23')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x24'),require(_0x5ed7('0x25')));_0x6c78a8['use'](_0x5ed7('0x26'),require(_0x5ed7('0x27')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x28'),require(_0x5ed7('0x29')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x2a'),require(_0x5ed7('0x2b')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x2c'),require(_0x5ed7('0x2d')));_0x6c78a8[_0x5ed7('0x4')]('/api/mail/messages',require(_0x5ed7('0x2e')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x2f'),require(_0x5ed7('0x30')));_0x6c78a8['use']('/api/mail/reports/queue',require(_0x5ed7('0x31')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x32'),require('./api/dashboard'));_0x6c78a8[_0x5ed7('0x4')]('/api/dashboards/items',require(_0x5ed7('0x33')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x34'),require(_0x5ed7('0x35')));_0x6c78a8['use'](_0x5ed7('0x36'),require(_0x5ed7('0x37')));_0x6c78a8[_0x5ed7('0x4')]('/api/fax/interactions',require(_0x5ed7('0x38')));_0x6c78a8['use']('/api/fax/messages',require(_0x5ed7('0x39')));_0x6c78a8[_0x5ed7('0x4')]('/api/fax/queues',require(_0x5ed7('0x3a')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x3b'),require(_0x5ed7('0x3c')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x3d'),require(_0x5ed7('0x3e')));_0x6c78a8[_0x5ed7('0x4')]('/api/sms/applications',require('./api/smsApplication'));_0x6c78a8[_0x5ed7('0x4')]('/api/sms/interactions',require(_0x5ed7('0x3f')));_0x6c78a8['use'](_0x5ed7('0x40'),require(_0x5ed7('0x41')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x42'),require(_0x5ed7('0x43')));_0x6c78a8['use'](_0x5ed7('0x44'),require(_0x5ed7('0x45')));_0x6c78a8[_0x5ed7('0x4')]('/api/openchannel/applications',require(_0x5ed7('0x46')));_0x6c78a8[_0x5ed7('0x4')]('/api/openchannel/interactions',require(_0x5ed7('0x47')));_0x6c78a8[_0x5ed7('0x4')]('/api/openchannel/messages',require(_0x5ed7('0x48')));_0x6c78a8['use'](_0x5ed7('0x49'),require('./api/openchannelQueue'));_0x6c78a8['use']('/api/chat/websites',require(_0x5ed7('0x4a')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x4b'),require(_0x5ed7('0x4c')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x4d'),require(_0x5ed7('0x4e')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x4f'),require(_0x5ed7('0x50')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x51'),require(_0x5ed7('0x52')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x53'),require(_0x5ed7('0x54')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x55'),require('./api/chatQueue'));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x56'),require('./api/chatGroup'));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x57'),require('./api/chatProactiveAction'));_0x6c78a8[_0x5ed7('0x4')]('/api/cm/companies',require(_0x5ed7('0x58')));_0x6c78a8['use']('/api/cm/contacts',require(_0x5ed7('0x59')));_0x6c78a8['use'](_0x5ed7('0x5a'),require(_0x5ed7('0x5b')));_0x6c78a8['use'](_0x5ed7('0x5c'),require(_0x5ed7('0x5d')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x5e'),require('./api/cmHopperFinal'));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x5f'),require('./api/cmHopperHistory'));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x60'),require('./api/cmCustomField'));_0x6c78a8['use'](_0x5ed7('0x61'),require('./api/action'));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x62'),require(_0x5ed7('0x63')));_0x6c78a8[_0x5ed7('0x4')]('/api/canned_answers',require(_0x5ed7('0x64')));_0x6c78a8['use'](_0x5ed7('0x65'),require(_0x5ed7('0x66')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x67'),require(_0x5ed7('0x68')));_0x6c78a8['use'](_0x5ed7('0x69'),require(_0x5ed7('0x6a')));_0x6c78a8['use'](_0x5ed7('0x6b'),require('./api/pause'));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x6c'),require('./api/cdr'));_0x6c78a8['use'](_0x5ed7('0x6d'),require(_0x5ed7('0x6e')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x6f'),require(_0x5ed7('0x70')));_0x6c78a8['use']('/api/sounds',require(_0x5ed7('0x71')));_0x6c78a8[_0x5ed7('0x4')]('/api/tags',require(_0x5ed7('0x72')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x73'),require(_0x5ed7('0x74')));_0x6c78a8['use']('/api/cm_contact_has_items',require(_0x5ed7('0x75')));_0x6c78a8['use'](_0x5ed7('0x76'),require(_0x5ed7('0x77')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x78'),require(_0x5ed7('0x79')));_0x6c78a8['use'](_0x5ed7('0x7a'),require(_0x5ed7('0x7b')));_0x6c78a8['use']('/api/variables',require(_0x5ed7('0x7c')));_0x6c78a8['use']('/api/integrations',require(_0x5ed7('0x7d')));_0x6c78a8[_0x5ed7('0x4')]('/api/integrations/reports',require(_0x5ed7('0x7e')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x7f'),require('./api/analyticCustomReport'));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x80'),require(_0x5ed7('0x81')));_0x6c78a8[_0x5ed7('0x4')]('/api/analytics/extracted_reports',require(_0x5ed7('0x82')));_0x6c78a8['use']('/api/analytics/metrics',require(_0x5ed7('0x83')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x84'),require(_0x5ed7('0x85')));_0x6c78a8[_0x5ed7('0x4')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x86'),require(_0x5ed7('0x87')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x88'),require(_0x5ed7('0x89')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x8a'),require(_0x5ed7('0x8b')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x8c'),require('./api/intSugarcrmAccount'));_0x6c78a8['use'](_0x5ed7('0x8d'),require(_0x5ed7('0x8e')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x8f'),require(_0x5ed7('0x90')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x91'),require(_0x5ed7('0x92')));_0x6c78a8['use']('/api/integrations/desk/configurations',require(_0x5ed7('0x93')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x94'),require(_0x5ed7('0x95')));_0x6c78a8['use'](_0x5ed7('0x96'),require(_0x5ed7('0x97')));_0x6c78a8[_0x5ed7('0x4')]('/api/integrations/zoho/configurations',require(_0x5ed7('0x98')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x99'),require(_0x5ed7('0x9a')));_0x6c78a8[_0x5ed7('0x4')]('/api/integrations/zendesk/accounts',require(_0x5ed7('0x9b')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x9c'),require(_0x5ed7('0x9d')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x9e'),require('./api/intZendeskField'));_0x6c78a8['use']('/api/integrations/freshdesk/accounts',require(_0x5ed7('0x9f')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xa0'),require(_0x5ed7('0xa1')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xa2'),require(_0x5ed7('0xa3')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xa4'),require(_0x5ed7('0xa5')));_0x6c78a8[_0x5ed7('0x4')]('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0x6c78a8['use'](_0x5ed7('0xa6'),require(_0x5ed7('0xa7')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xa8'),require(_0x5ed7('0xa9')));_0x6c78a8[_0x5ed7('0x4')]('/api/integrations/servicenow/configurations',require(_0x5ed7('0xaa')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xab'),require(_0x5ed7('0xac')));_0x6c78a8[_0x5ed7('0x4')]('/api/integrations/dynamics365/accounts',require(_0x5ed7('0xad')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xae'),require('./api/intDynamics365Configuration'));_0x6c78a8[_0x5ed7('0x4')]('/api/integrations/dynamics365/fields',require(_0x5ed7('0xaf')));_0x6c78a8[_0x5ed7('0x4')]('/api/integrations/freshsales/accounts',require(_0x5ed7('0xb0')));_0x6c78a8[_0x5ed7('0x4')]('/api/integrations/freshsales/configurations',require(_0x5ed7('0xb1')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xb2'),require(_0x5ed7('0xb3')));_0x6c78a8[_0x5ed7('0x4')]('/api/networks',require(_0x5ed7('0xb4')));_0x6c78a8[_0x5ed7('0x4')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x6c78a8[_0x5ed7('0x4')]('/api/chat/internal/messages',require(_0x5ed7('0xb5')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xb6'),require(_0x5ed7('0xb7')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xb8'),require(_0x5ed7('0xb9')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xba'),require(_0x5ed7('0xbb')));_0x6c78a8['use'](_0x5ed7('0xbc'),require(_0x5ed7('0xbd')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xbe'),require(_0x5ed7('0xbf')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xc0'),require(_0x5ed7('0xc1')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xc2'),require(_0x5ed7('0xc3')));_0x6c78a8[_0x5ed7('0x4')]('/api/settings',require('./api/setting'));_0x6c78a8['use']('/api/square/odbc',require(_0x5ed7('0xc4')));_0x6c78a8['use'](_0x5ed7('0xc5'),require(_0x5ed7('0xc6')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xc7'),require('./api/squareRecording'));_0x6c78a8[_0x5ed7('0x4')]('/api/square/messages',require('./api/squareMessage'));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xc8'),require(_0x5ed7('0xc9')));_0x6c78a8[_0x5ed7('0x4')]('/api/license',require('./api/license'));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xca'),require(_0x5ed7('0xcb')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xcc'),require(_0x5ed7('0xcd')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xce'),require('./api/attachment'));_0x6c78a8['use'](_0x5ed7('0xcf'),require('./api/plugin'));_0x6c78a8[_0x5ed7('0x4')]('/api/mail/reports/transfer',require(_0x5ed7('0xd0')));_0x6c78a8[_0x5ed7('0x4')]('/api/chat/reports/transfer',require(_0x5ed7('0xd1')));_0x6c78a8[_0x5ed7('0x4')]('/api/fax/reports/transfer',require(_0x5ed7('0xd2')));_0x6c78a8['use'](_0x5ed7('0xd3'),require(_0x5ed7('0xd4')));_0x6c78a8['use'](_0x5ed7('0xd5'),require(_0x5ed7('0xd6')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xd7'),require(_0x5ed7('0xd8')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xd9'),require(_0x5ed7('0xda')));_0x6c78a8[_0x5ed7('0x4')]('/api/userProfiles',require(_0x5ed7('0xdb')));_0x6c78a8[_0x5ed7('0x4')]('/api/userProfile/sections',require(_0x5ed7('0xdc')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xdd'),require(_0x5ed7('0xde')));_0x6c78a8['use'](_0x5ed7('0xdf'),require(_0x5ed7('0xe0')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xe1'),require(_0x5ed7('0xe2')));_0x6c78a8['use'](_0x5ed7('0xe3'),require(_0x5ed7('0xe4')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xe5'),require(_0x5ed7('0xe6')));_0x6c78a8['use']('/api/whatsapp/messages',require(_0x5ed7('0xe7')));_0x6c78a8['use'](_0x5ed7('0xe8'),require(_0x5ed7('0xe9')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xea'),require('./api/whatsappTransferReport'));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xeb'),require(_0x5ed7('0xec')));_0x6c78a8['use']('/api/cloudProviders',require(_0x5ed7('0xed')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xee'),require('./api/realtime'));_0x6c78a8['use'](_0x5ed7('0xef'),require(_0x5ed7('0xf0')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xf1'),require(_0x5ed7('0xf2')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xf3'),require(_0x5ed7('0xf4')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xf5'),require(_0x5ed7('0xf6')));_0x6c78a8['use'](_0x5ed7('0xf7'),require(_0x5ed7('0xf8')));_0x6c78a8[_0x5ed7('0x4')]('/api/rpc',require(_0x5ed7('0xf9')));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xfa'),require(_0x5ed7('0xfb')));_0x6c78a8['use'](_0x5ed7('0xfc'),require('./api/system'));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0xfd'),require(_0x5ed7('0xfe')));_0x6c78a8['use'](_0x5ed7('0xff'),require(_0x5ed7('0x100')));_0x6c78a8[_0x5ed7('0x4')]('/api/logs',clientSideLogs);_0x6c78a8['use'](_0x5ed7('0x101'),express[_0x5ed7('0x102')](path[_0x5ed7('0x103')](config[_0x5ed7('0x104')],_0x5ed7('0x101'))));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x105'),express['static'](path['join'](config['root'],_0x5ed7('0x105'))));_0x6c78a8[_0x5ed7('0x4')](_0x5ed7('0x106'),express[_0x5ed7('0x102')](path['join'](config[_0x5ed7('0x104')],_0x5ed7('0x106'))));_0x6c78a8[_0x5ed7('0x4')]('/snippet',express[_0x5ed7('0x102')](path[_0x5ed7('0x103')](config['root'],'snippet','3.8.0')));_0x6c78a8['use'](_0x5ed7('0x107'),express[_0x5ed7('0x102')](path[_0x5ed7('0x103')](config[_0x5ed7('0x104')],_0x5ed7('0x108'))));_0x6c78a8['route'](_0x5ed7('0x109'))['get'](errors[0x194]);_0x6c78a8['route']('/*')[_0x5ed7('0x10a')](function(_0xd67982,_0x127b6b){_0x127b6b[_0x5ed7('0x10b')](path['resolve'](_0x6c78a8[_0x5ed7('0x10a')](_0x5ed7('0x10c'))+'/index.html'));});return _0x6c78a8;});}; \ No newline at end of file +var _0xa0d6=['/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','./api/intServicenowField','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/cmList','/api/voice/prefixes','./api/userProfile','./api/userProfileSection','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','static','join','root','/apidoc','/demo','/snippet','snippet','3.8.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','./errors','./utils/client-side-logger','setupLoggers','./api/client-side-logs','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition'];(function(_0x4abcf4,_0x4d80bc){var _0x24c066=function(_0x52ef99){while(--_0x52ef99){_0x4abcf4['push'](_0x4abcf4['shift']());}};_0x24c066(++_0x4d80bc);}(_0xa0d6,0xa4));var _0x6a0d=function(_0x17f6a0,_0x191bc6){_0x17f6a0=_0x17f6a0-0x0;var _0x1860f6=_0xa0d6[_0x17f6a0];return _0x1860f6;};'use strict';var path=require(_0x6a0d('0x0'));var express=require('express');var errors=require(_0x6a0d('0x1'));var config=require('./config/environment');var setupLoggers=require(_0x6a0d('0x2'))[_0x6a0d('0x3')];var clientSideLogs=require(_0x6a0d('0x4'));exports['default']=function(_0x72581e){return setupLoggers(_0x72581e)['then'](function(){_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x6'),require(_0x6a0d('0x7')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x8'),require(_0x6a0d('0x9')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xa'),require(_0x6a0d('0xb')));_0x72581e['use'](_0x6a0d('0xc'),require(_0x6a0d('0xd')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xe'),require(_0x6a0d('0xf')));_0x72581e[_0x6a0d('0x5')]('/api/voice/queues',require('./api/voiceQueue'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x10'),require(_0x6a0d('0x11')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x12'),require(_0x6a0d('0x13')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x14'),require(_0x6a0d('0x15')));_0x72581e[_0x6a0d('0x5')]('/api/voice/mails/messages',require(_0x6a0d('0x16')));_0x72581e['use'](_0x6a0d('0x17'),require(_0x6a0d('0x18')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x19'),require(_0x6a0d('0x1a')));_0x72581e[_0x6a0d('0x5')]('/api/voice/agents/reports',require(_0x6a0d('0x1b')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x1c'),require(_0x6a0d('0x1d')));_0x72581e['use']('/api/members/reports',require('./api/memberReport'));_0x72581e['use']('/api/trunks',require(_0x6a0d('0x1e')));_0x72581e[_0x6a0d('0x5')]('/api/voice/transfers/reports',require(_0x6a0d('0x1f')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x20'),require(_0x6a0d('0x21')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x22'),require(_0x6a0d('0x23')));_0x72581e[_0x6a0d('0x5')]('/api/mail/queues',require(_0x6a0d('0x24')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x25'),require('./api/mailSubstatus'));_0x72581e[_0x6a0d('0x5')]('/api/mail/interactions',require(_0x6a0d('0x26')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x27'),require(_0x6a0d('0x28')));_0x72581e[_0x6a0d('0x5')]('/api/mail/applications',require(_0x6a0d('0x29')));_0x72581e['use']('/api/mail/reports/queue',require(_0x6a0d('0x2a')));_0x72581e['use'](_0x6a0d('0x2b'),require('./api/dashboard'));_0x72581e['use'](_0x6a0d('0x2c'),require(_0x6a0d('0x2d')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x2e'),require(_0x6a0d('0x2f')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x30'),require('./api/faxApplication'));_0x72581e[_0x6a0d('0x5')]('/api/fax/interactions',require(_0x6a0d('0x31')));_0x72581e['use'](_0x6a0d('0x32'),require(_0x6a0d('0x33')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x34'),require(_0x6a0d('0x35')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x36'),require('./api/faxQueueReport'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x37'),require(_0x6a0d('0x38')));_0x72581e[_0x6a0d('0x5')]('/api/sms/applications',require(_0x6a0d('0x39')));_0x72581e[_0x6a0d('0x5')]('/api/sms/interactions',require('./api/smsInteraction'));_0x72581e['use'](_0x6a0d('0x3a'),require(_0x6a0d('0x3b')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x3c'),require(_0x6a0d('0x3d')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x3e'),require(_0x6a0d('0x3f')));_0x72581e[_0x6a0d('0x5')]('/api/openchannel/applications',require(_0x6a0d('0x40')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x41'),require(_0x6a0d('0x42')));_0x72581e[_0x6a0d('0x5')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x72581e['use'](_0x6a0d('0x43'),require('./api/openchannelQueue'));_0x72581e['use']('/api/chat/websites',require(_0x6a0d('0x44')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x45'),require(_0x6a0d('0x46')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x47'),require('./api/chatApplication'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x48'),require(_0x6a0d('0x49')));_0x72581e['use'](_0x6a0d('0x4a'),require('./api/chatMessage'));_0x72581e[_0x6a0d('0x5')]('/api/chat/offline_messages',require(_0x6a0d('0x4b')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x4c'),require(_0x6a0d('0x4d')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x4e'),require(_0x6a0d('0x4f')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x50'),require('./api/chatProactiveAction'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x51'),require('./api/cmCompany'));_0x72581e['use'](_0x6a0d('0x52'),require('./api/cmContact'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x53'),require(_0x6a0d('0x54')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x55'),require(_0x6a0d('0x56')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x57'),require('./api/cmHopperFinal'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x58'),require('./api/cmHopperHistory'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x59'),require(_0x6a0d('0x5a')));_0x72581e[_0x6a0d('0x5')]('/api/actions',require(_0x6a0d('0x5b')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x5c'),require(_0x6a0d('0x5d')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x5e'),require(_0x6a0d('0x5f')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x60'),require(_0x6a0d('0x61')));_0x72581e['use'](_0x6a0d('0x62'),require(_0x6a0d('0x63')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x64'),require(_0x6a0d('0x65')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x66'),require(_0x6a0d('0x67')));_0x72581e[_0x6a0d('0x5')]('/api/cdr',require(_0x6a0d('0x68')));_0x72581e['use']('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x69'),require(_0x6a0d('0x6a')));_0x72581e['use'](_0x6a0d('0x6b'),require(_0x6a0d('0x6c')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x6d'),require('./api/tag'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x6e'),require('./api/contactItemType'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x6f'),require(_0x6a0d('0x70')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x71'),require('./api/cmHopperAdditionalPhone'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x72'),require(_0x6a0d('0x73')));_0x72581e['use'](_0x6a0d('0x74'),require(_0x6a0d('0x75')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x76'),require('./api/variable'));_0x72581e['use']('/api/integrations',require(_0x6a0d('0x77')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x78'),require('./api/integrationReport'));_0x72581e['use'](_0x6a0d('0x79'),require('./api/analyticCustomReport'));_0x72581e[_0x6a0d('0x5')]('/api/analytics/default_reports',require(_0x6a0d('0x7a')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x7b'),require(_0x6a0d('0x7c')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x7d'),require(_0x6a0d('0x7e')));_0x72581e[_0x6a0d('0x5')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x72581e[_0x6a0d('0x5')]('/api/analytics/tree_reports',require(_0x6a0d('0x7f')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x80'),require('./api/intSalesforceAccount'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x81'),require('./api/intSalesforceConfiguration'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x82'),require(_0x6a0d('0x83')));_0x72581e[_0x6a0d('0x5')]('/api/integrations/sugarcrm/accounts',require(_0x6a0d('0x84')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x85'),require(_0x6a0d('0x86')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x87'),require(_0x6a0d('0x88')));_0x72581e[_0x6a0d('0x5')]('/api/integrations/desk/accounts',require(_0x6a0d('0x89')));_0x72581e[_0x6a0d('0x5')]('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x8a'),require('./api/intDeskField'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x8b'),require(_0x6a0d('0x8c')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x8d'),require(_0x6a0d('0x8e')));_0x72581e['use']('/api/integrations/zoho/fields',require(_0x6a0d('0x8f')));_0x72581e['use'](_0x6a0d('0x90'),require(_0x6a0d('0x91')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x92'),require('./api/intZendeskConfiguration'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x93'),require(_0x6a0d('0x94')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x95'),require('./api/intFreshdeskAccount'));_0x72581e[_0x6a0d('0x5')]('/api/integrations/freshdesk/configurations',require(_0x6a0d('0x96')));_0x72581e['use'](_0x6a0d('0x97'),require('./api/intFreshdeskField'));_0x72581e['use'](_0x6a0d('0x98'),require(_0x6a0d('0x99')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x9a'),require('./api/intVtigerConfiguration'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x9b'),require(_0x6a0d('0x9c')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0x9d'),require(_0x6a0d('0x9e')));_0x72581e[_0x6a0d('0x5')]('/api/integrations/servicenow/configurations',require(_0x6a0d('0x9f')));_0x72581e['use']('/api/integrations/servicenow/fields',require(_0x6a0d('0xa0')));_0x72581e[_0x6a0d('0x5')]('/api/integrations/dynamics365/accounts',require(_0x6a0d('0xa1')));_0x72581e['use']('/api/integrations/dynamics365/configurations',require(_0x6a0d('0xa2')));_0x72581e['use'](_0x6a0d('0xa3'),require(_0x6a0d('0xa4')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xa5'),require(_0x6a0d('0xa6')));_0x72581e['use'](_0x6a0d('0xa7'),require(_0x6a0d('0xa8')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xa9'),require(_0x6a0d('0xaa')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xab'),require(_0x6a0d('0xac')));_0x72581e[_0x6a0d('0x5')]('/api/chat/reports/queue',require(_0x6a0d('0xad')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xae'),require('./api/chatInternalMessage'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xaf'),require('./api/jscriptyAnswerReport'));_0x72581e['use'](_0x6a0d('0xb0'),require('./api/jscriptyQuestionReport'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xb1'),require('./api/jscriptySessionReport'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xb2'),require(_0x6a0d('0xb3')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xb4'),require('./api/squareReport'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xb5'),require(_0x6a0d('0xb6')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xb7'),require(_0x6a0d('0xb8')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xb9'),require('./api/setting'));_0x72581e['use'](_0x6a0d('0xba'),require(_0x6a0d('0xbb')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xbc'),require('./api/squareProject'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xbd'),require(_0x6a0d('0xbe')));_0x72581e['use'](_0x6a0d('0xbf'),require('./api/squareMessage'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xc0'),require(_0x6a0d('0xc1')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xc2'),require(_0x6a0d('0xc3')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xc4'),require(_0x6a0d('0xc5')));_0x72581e['use']('/api/migrations',require(_0x6a0d('0xc6')));_0x72581e[_0x6a0d('0x5')]('/api/attachments',require(_0x6a0d('0xc7')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xc8'),require(_0x6a0d('0xc9')));_0x72581e['use']('/api/mail/reports/transfer',require(_0x6a0d('0xca')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xcb'),require(_0x6a0d('0xcc')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xcd'),require(_0x6a0d('0xce')));_0x72581e['use'](_0x6a0d('0xcf'),require(_0x6a0d('0xd0')));_0x72581e['use'](_0x6a0d('0xd1'),require('./api/smsTransferReport'));_0x72581e[_0x6a0d('0x5')]('/api/cm/lists',require(_0x6a0d('0xd2')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xd3'),require('./api/voicePrefix'));_0x72581e['use']('/api/userProfiles',require(_0x6a0d('0xd4')));_0x72581e[_0x6a0d('0x5')]('/api/userProfile/sections',require(_0x6a0d('0xd5')));_0x72581e[_0x6a0d('0x5')]('/api/userProfile/resources',require('./api/userProfileResource'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xd6'),require(_0x6a0d('0xd7')));_0x72581e['use'](_0x6a0d('0xd8'),require(_0x6a0d('0xd9')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xda'),require('./api/whatsappApplication'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xdb'),require(_0x6a0d('0xdc')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xdd'),require(_0x6a0d('0xde')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xdf'),require(_0x6a0d('0xe0')));_0x72581e[_0x6a0d('0x5')]('/api/whatsapp/reports/transfer',require(_0x6a0d('0xe1')));_0x72581e[_0x6a0d('0x5')]('/api/whatsapp/queues',require(_0x6a0d('0xe2')));_0x72581e['use'](_0x6a0d('0xe3'),require(_0x6a0d('0xe4')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xe5'),require(_0x6a0d('0xe6')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xe7'),require(_0x6a0d('0xe8')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xe9'),require('./api/authLocal'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xea'),require(_0x6a0d('0xeb')));_0x72581e['use'](_0x6a0d('0xec'),require(_0x6a0d('0xed')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xee'),require(_0x6a0d('0xef')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xf0'),require(_0x6a0d('0xf1')));_0x72581e[_0x6a0d('0x5')]('/api/version',require('./api/version'));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xf2'),require(_0x6a0d('0xf3')));_0x72581e['use'](_0x6a0d('0xf4'),require(_0x6a0d('0xf5')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xf6'),require('./api/webbar'));_0x72581e['use']('/api/logs',clientSideLogs);_0x72581e['use']('/apidoc',express[_0x6a0d('0xf7')](path[_0x6a0d('0xf8')](config[_0x6a0d('0xf9')],_0x6a0d('0xfa'))));_0x72581e['use']('/www',express[_0x6a0d('0xf7')](path['join'](config[_0x6a0d('0xf9')],'/www')));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xfb'),express[_0x6a0d('0xf7')](path['join'](config[_0x6a0d('0xf9')],'/demo')));_0x72581e['use'](_0x6a0d('0xfc'),express[_0x6a0d('0xf7')](path[_0x6a0d('0xf8')](config[_0x6a0d('0xf9')],_0x6a0d('0xfd'),_0x6a0d('0xfe'))));_0x72581e[_0x6a0d('0x5')](_0x6a0d('0xff'),express[_0x6a0d('0xf7')](path[_0x6a0d('0xf8')](config[_0x6a0d('0xf9')],_0x6a0d('0x100'))));_0x72581e[_0x6a0d('0x101')](_0x6a0d('0x102'))[_0x6a0d('0x103')](errors[0x194]);_0x72581e[_0x6a0d('0x101')]('/*')[_0x6a0d('0x103')](function(_0x1b9e76,_0x22abeb){_0x22abeb[_0x6a0d('0x104')](path[_0x6a0d('0x105')](_0x72581e[_0x6a0d('0x103')](_0x6a0d('0x106'))+_0x6a0d('0x107')));});return _0x72581e;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 2fe2706..7db199d 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6594=['default','RPC\x20listening\x20on\x20','jayson/promise','lodash','listen','merge','../api/user/user.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','port','rpc','localhost','log','../config/triggers'];(function(_0x3300ec,_0x377793){var _0x1e99f4=function(_0x5b5a47){while(--_0x5b5a47){_0x3300ec['push'](_0x3300ec['shift']());}};_0x1e99f4(++_0x377793);}(_0x6594,0x112));var _0x4659=function(_0x3a508a,_0x358c16){_0x3a508a=_0x3a508a-0x0;var _0x5a8c34=_0x6594[_0x3a508a];return _0x5a8c34;};'use strict';var jayson=require(_0x4659('0x0'));var _=require(_0x4659('0x1'));var config=require('../config/environment');exports[_0x4659('0x2')]=function(){return new Promise(function(_0xc97f6,_0x58f687){var _0x5c2dc4={};_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x4')));_0x5c2dc4=_['merge'](_0x5c2dc4,require('../api/voiceExtension/voiceExtension.rpc'));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require('../api/voiceQueue/voiceQueue.rpc'));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x5')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x6')));_0x5c2dc4=_['merge'](_0x5c2dc4,require(_0x4659('0x7')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x8')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require('../api/memberReport/memberReport.rpc'));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x9')));_0x5c2dc4=_['merge'](_0x5c2dc4,require(_0x4659('0xa')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0xb')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require('../api/mailServerIn/mailServerIn.rpc'));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0xc')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require('../api/mailQueue/mailQueue.rpc'));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0xd')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require('../api/mailMessage/mailMessage.rpc'));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0xe')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0xf')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x10')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x11')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x12')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x13')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require('../api/faxQueue/faxQueue.rpc'));_0x5c2dc4=_['merge'](_0x5c2dc4,require(_0x4659('0x14')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require('../api/smsAccount/smsAccount.rpc'));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x15')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x16')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x17')));_0x5c2dc4=_['merge'](_0x5c2dc4,require(_0x4659('0x18')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x19')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x1a')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x1b')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x1c')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x1d')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x1e')));_0x5c2dc4=_['merge'](_0x5c2dc4,require('../api/cmContact/cmContact.rpc'));_0x5c2dc4=_['merge'](_0x5c2dc4,require('../api/cmHopper/cmHopper.rpc'));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x1f')));_0x5c2dc4=_['merge'](_0x5c2dc4,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x20')));_0x5c2dc4=_['merge'](_0x5c2dc4,require(_0x4659('0x21')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x22')));_0x5c2dc4=_['merge'](_0x5c2dc4,require(_0x4659('0x23')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x5c2dc4=_['merge'](_0x5c2dc4,require(_0x4659('0x24')));_0x5c2dc4=_['merge'](_0x5c2dc4,require('../api/trigger/trigger.rpc'));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x25')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x26')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x27')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x28')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x29')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5c2dc4=_['merge'](_0x5c2dc4,require(_0x4659('0x2a')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x2b')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x2c')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x2d')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x2e')));_0x5c2dc4=_['merge'](_0x5c2dc4,require(_0x4659('0x2f')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x30')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x31')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x32')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x33')));_0x5c2dc4=_['merge'](_0x5c2dc4,require(_0x4659('0x34')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require('../api/campaign/campaign.rpc'));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x35')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x36')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x37')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x38')));_0x5c2dc4=_[_0x4659('0x3')](_0x5c2dc4,require(_0x4659('0x39')));_0x5c2dc4=_['merge'](_0x5c2dc4,require(_0x4659('0x3a')));_0x5c2dc4=_['merge'](_0x5c2dc4,require(_0x4659('0x3b')));var _0x191242=jayson['server'](_0x5c2dc4)[_0x4659('0x3c')]();var _0x220e2a=config['rpc'][_0x4659('0x3d')]||config[_0x4659('0x3d')]+0x1;var _0x473c8d=config[_0x4659('0x3e')]['ip']||_0x4659('0x3f');_0x191242['on']('error',function(_0x4be6b6){return _0x58f687(_0x4be6b6);});_0x191242[_0x4659('0x2')](_0x220e2a,_0x473c8d,function(){console[_0x4659('0x40')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x473c8d,_0x220e2a);require(_0x4659('0x41'))[_0x4659('0x42')]();return _0xc97f6(_0x4659('0x43')+_0x473c8d+':'+_0x220e2a);});});}; \ No newline at end of file +var _0x31e5=['../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','port','rpc','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailQueue/mailQueue.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc'];(function(_0x3a75c3,_0x3bccba){var _0xac0f1c=function(_0x5c7b81){while(--_0x5c7b81){_0x3a75c3['push'](_0x3a75c3['shift']());}};_0xac0f1c(++_0x3bccba);}(_0x31e5,0x164));var _0x531e=function(_0x3d9d6b,_0x2922ef){_0x3d9d6b=_0x3d9d6b-0x0;var _0x4c1965=_0x31e5[_0x3d9d6b];return _0x4c1965;};'use strict';var jayson=require(_0x531e('0x0'));var _=require(_0x531e('0x1'));var config=require(_0x531e('0x2'));exports[_0x531e('0x3')]=function(){return new Promise(function(_0x27ed40,_0x204d46){var _0x1fc241={};_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x5')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x6')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require('../api/voiceQueue/voiceQueue.rpc'));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x7')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x8')));_0x1fc241=_['merge'](_0x1fc241,require(_0x531e('0x9')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0xa')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0xb')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0xc')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0xd')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0xe')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0xf')));_0x1fc241=_['merge'](_0x1fc241,require('../api/mailServerIn/mailServerIn.rpc'));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require('../api/mailAccount/mailAccount.rpc'));_0x1fc241=_['merge'](_0x1fc241,require(_0x531e('0x10')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require('../api/mailInteraction/mailInteraction.rpc'));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require('../api/mailMessage/mailMessage.rpc'));_0x1fc241=_['merge'](_0x1fc241,require(_0x531e('0x11')));_0x1fc241=_['merge'](_0x1fc241,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x12')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x13')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x14')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x15')));_0x1fc241=_['merge'](_0x1fc241,require(_0x531e('0x16')));_0x1fc241=_['merge'](_0x1fc241,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x17')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x18')));_0x1fc241=_['merge'](_0x1fc241,require(_0x531e('0x19')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x1a')));_0x1fc241=_['merge'](_0x1fc241,require(_0x531e('0x1b')));_0x1fc241=_['merge'](_0x1fc241,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x1fc241=_['merge'](_0x1fc241,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x1c')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x1d')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x1e')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x1f')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x20')));_0x1fc241=_['merge'](_0x1fc241,require(_0x531e('0x21')));_0x1fc241=_['merge'](_0x1fc241,require(_0x531e('0x22')));_0x1fc241=_['merge'](_0x1fc241,require(_0x531e('0x23')));_0x1fc241=_['merge'](_0x1fc241,require(_0x531e('0x24')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x25')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x26')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x27')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x28')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x29')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require('../api/template/template.rpc'));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x2a')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require('../api/variable/variable.rpc'));_0x1fc241=_['merge'](_0x1fc241,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x2b')));_0x1fc241=_['merge'](_0x1fc241,require(_0x531e('0x2c')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x2d')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x2e')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x2f')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x1fc241=_['merge'](_0x1fc241,require(_0x531e('0x30')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x31')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x32')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x33')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x34')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require('../api/setting/setting.rpc'));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require('../api/squareOdbc/squareOdbc.rpc'));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x35')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require('../api/squareRecording/squareRecording.rpc'));_0x1fc241=_['merge'](_0x1fc241,require(_0x531e('0x36')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require('../api/campaign/campaign.rpc'));_0x1fc241=_['merge'](_0x1fc241,require(_0x531e('0x37')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require('../api/plugin/plugin.rpc'));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x38')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x39')));_0x1fc241=_[_0x531e('0x4')](_0x1fc241,require(_0x531e('0x3a')));_0x1fc241=_['merge'](_0x1fc241,require(_0x531e('0x3b')));var _0x119da3=jayson[_0x531e('0x3c')](_0x1fc241)['http']();var _0x7568d3=config['rpc'][_0x531e('0x3d')]||config[_0x531e('0x3d')]+0x1;var _0x343ca1=config[_0x531e('0x3e')]['ip']||_0x531e('0x3f');_0x119da3['on'](_0x531e('0x40'),function(_0x24ebca){return _0x204d46(_0x24ebca);});_0x119da3[_0x531e('0x3')](_0x7568d3,_0x343ca1,function(){console[_0x531e('0x41')](_0x531e('0x42'),_0x343ca1,_0x7568d3);require('../config/triggers')[_0x531e('0x43')]();return _0x27ed40(_0x531e('0x44')+_0x343ca1+':'+_0x7568d3);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 82671ce..6858f00 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 _0x89fb=['sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','GOTO\x20%s\x20%s\x20%s','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','label','exports','lodash','events','EventEmitter','./reply','./error','call','utf8','setEncoding','headers','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','substr','startsWith','split','length','match','emit','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','write','destroy','inherits','prototype','command','sync','answer','sendRequest','ANSWER','beep','format','noop','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s'];(function(_0x5a14d2,_0x22b89a){var _0xb08187=function(_0x541eeb){while(--_0x541eeb){_0x5a14d2['push'](_0x5a14d2['shift']());}};_0xb08187(++_0x22b89a);}(_0x89fb,0x14b));var _0xb89f=function(_0x3eead9,_0x3ad1b7){_0x3eead9=_0x3eead9-0x0;var _0x53e445=_0x89fb[_0x3eead9];return _0x53e445;};'use strict';var util=require('util');var _=require(_0xb89f('0x0'));var EventEmitter=require(_0xb89f('0x1'))[_0xb89f('0x2')];var AGIReply=require(_0xb89f('0x3'));var AGIError=require(_0xb89f('0x4'));function AGIChannel(_0x599024){var _0x358c4d=this,_0xa626e8=new AGIReply(),_0x3d0629=![],_0x34c4ce={};EventEmitter[_0xb89f('0x5')](_0x358c4d);_0x599024['setEncoding'](_0xb89f('0x6'));_0x599024['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0xa626e8[_0xb89f('0x7')]('utf8');_0xa626e8['on'](_0xb89f('0x8'),function(_0x95385){for(var _0x300c7c in _0x95385){_0x358c4d[_0x300c7c]=_0x95385[_0x300c7c];}_0x358c4d['emit'](_0xb89f('0x9'));});_0xa626e8['on'](_0xb89f('0xa'),function(_0x2f0c38){if(_0x2f0c38[_0xb89f('0xb')]()==_0xb89f('0xc')){_0x358c4d['emit']('hangup');return;}if(_0x2f0c38[_0xb89f('0xd')](0x0,0xb)==_0xb89f('0xe')){_0x3d0629=!![];}if(_0x3d0629){_0x34c4ce['rx']+=_0x2f0c38+'\x0a';if(_0x2f0c38[_0xb89f('0xf')](_0xb89f('0x10'))!=-0x1){_0x3d0629=![];}}else{_0x34c4ce['rx']=_0x2f0c38;}if(_0x3d0629){return;}if(typeof _0x34c4ce['cb']==_0xb89f('0x11')){var _0x5ee4f8=_0x34c4ce['rx'][_0xb89f('0xd')](0x0,0x3),_0xfec2b3=null,_0x453d78=null;_0x5ee4f8=parseInt(_0x5ee4f8);if(isNaN(_0x5ee4f8)){_0x34c4ce['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xb89f('0x12')});return;}if(_0x5ee4f8!=0xc8){_0x34c4ce['cb'](null,{'code':_0x5ee4f8,'result':-0x1,'extra':'KO'});return;}_0xfec2b3=_0x34c4ce['rx'][_0xb89f('0xd')](0x4)[_0xb89f('0x13')]('result=','');if(_0xfec2b3[_0xb89f('0x14')]('\x20')!=-0x1){_0xfec2b3=_0xfec2b3[_0xb89f('0x15')](0x0,_0xfec2b3[_0xb89f('0x14')]('\x20'));}if(_[_0xb89f('0x16')](_0xfec2b3,'-1')){_0xfec2b3=parseInt(_0xfec2b3);}_0x453d78=_0x34c4ce['rx'][_0xb89f('0x17')]('\x20');if(_0x453d78[_0xb89f('0x18')]==0x3){_0x453d78=_0x453d78[0x2][_0xb89f('0xd')](0x1,_0x453d78[0x2]['length']-0x1);}else if(_0x453d78[_0xb89f('0x18')]>0x3){var _0xfc48d=/\((.+)\)/;var _0x236c5b=_0x34c4ce['rx'][_0xb89f('0x19')](_0xfc48d);if(_0x236c5b){_0x453d78=_0x236c5b[0x1];}else{_0x453d78=null;}}else{_0x453d78=null;}_0x34c4ce['cb'](null,{'code':_0x5ee4f8,'result':_0xfec2b3,'extra':_0x453d78});}});_0x599024['on']('error',function(_0x55c865){_0x358c4d[_0xb89f('0x1a')](_0xb89f('0x1b'),new AGIError(_0xb89f('0x1c'),_0x55c865['code']));});_0x599024['on']('close',function(){_0x358c4d[_0xb89f('0x1a')](_0xb89f('0x1d'),new AGIError(_0xb89f('0x1e')));});_0x599024['on'](_0xb89f('0x1f'),function(){_0x358c4d[_0xb89f('0x1a')](_0xb89f('0x1f'),new AGIError(_0xb89f('0x20')));_0x599024['destroy']();});_0x599024['pipe'](_0xa626e8);this['command']=function(_0x4dc31d,_0x5ee95f){var _0x4dc31d=_0x4dc31d||'',_0x5ee95f=typeof _0x5ee95f==_0xb89f('0x11')?_0x5ee95f:new Function();_0x34c4ce={'tx':_0x4dc31d,'rx':'','cb':_0x5ee95f};_0x599024[_0xb89f('0x21')](_0x4dc31d+'\x0a');},this[_0xb89f('0x1d')]=function(){_0x599024[_0xb89f('0x22')]();};}util[_0xb89f('0x23')](AGIChannel,EventEmitter);AGIChannel[_0xb89f('0x24')]['sendRequest']=function(_0x464724){return this[_0xb89f('0x25')][_0xb89f('0x26')](this,_0x464724);};AGIChannel[_0xb89f('0x24')][_0xb89f('0x27')]=function(){return this[_0xb89f('0x28')](_0xb89f('0x29'));};AGIChannel[_0xb89f('0x24')]['getData']=function(_0x20b2b7,_0x136480,_0x723479){_0x20b2b7=_0x20b2b7===undefined?_0xb89f('0x2a'):_0x20b2b7;_0x136480=_0x136480===undefined?'5':_0x136480;_0x723479=_0x723479===undefined?'1':_0x723479;return this[_0xb89f('0x28')](util[_0xb89f('0x2b')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x20b2b7,_0x136480*0x3e8,_0x723479));};AGIChannel[_0xb89f('0x24')][_0xb89f('0x2c')]=function(_0x289d88){_0x289d88=_0x289d88||_0xb89f('0x2d');return this['sendRequest'](util['format']('VERBOSE\x20\x22%s\x22',_0x289d88));};AGIChannel[_0xb89f('0x24')][_0xb89f('0x2e')]=function(_0x3ce71d,_0x3dd8aa){if(_[_0xb89f('0x2f')](_0x3dd8aa)){return this[_0xb89f('0x28')](util[_0xb89f('0x2b')](_0xb89f('0x30'),_0x3ce71d,_0x3dd8aa[_0xb89f('0x31')](',')));}return this['sendRequest'](util[_0xb89f('0x2b')](_0xb89f('0x30'),_0x3ce71d,_0x3dd8aa));};AGIChannel['prototype'][_0xb89f('0x32')]=function(_0x15bb10){return this[_0xb89f('0x28')](util[_0xb89f('0x2b')]('SET\x20CONTEXT\x20%s',_0x15bb10));};AGIChannel[_0xb89f('0x24')][_0xb89f('0x33')]=function(_0x98df76){return this[_0xb89f('0x28')](util['format'](_0xb89f('0x34'),_0x98df76));};AGIChannel['prototype'][_0xb89f('0x35')]=function(_0x1cc704){return this[_0xb89f('0x28')](util['format'](_0xb89f('0x36'),_0x1cc704));};AGIChannel[_0xb89f('0x24')][_0xb89f('0xc')]=function(){return this['sendRequest'](_0xb89f('0x37'));};AGIChannel[_0xb89f('0x24')][_0xb89f('0x38')]=function(_0x3fa6e6,_0x2444d7){var _0x3a27a9=_[_0xb89f('0x39')](_0x2444d7)||_['isNumber'](_0x2444d7)?_0x2444d7[_0xb89f('0x3a')]():_0x2444d7;return this[_0xb89f('0x28')](util[_0xb89f('0x2b')](_0xb89f('0x3b'),_0x3fa6e6,_0x3a27a9?_0x3a27a9['toString']()[_0xb89f('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xb89f('0x3c')]=function(_0x1bea30,_0x5dc041){return this[_0xb89f('0x28')](util[_0xb89f('0x2b')](_0xb89f('0x3d'),_0x1bea30,_0x5dc041));};AGIChannel[_0xb89f('0x24')][_0xb89f('0x3e')]=function(_0x5eb7c3,_0x5d7b55){return this[_0xb89f('0x28')](util[_0xb89f('0x2b')](_0xb89f('0x3f'),_0x5eb7c3,_0x5d7b55));};AGIChannel[_0xb89f('0x24')][_0xb89f('0x40')]=function(_0x3f3074,_0x4ba955){return this[_0xb89f('0x28')](util[_0xb89f('0x2b')](_0xb89f('0x41'),_0x3f3074,_0x4ba955));};AGIChannel[_0xb89f('0x24')]['continueAt']=function(_0x35c6a1,_0x2c58a0,_0x43a951){_0x2c58a0=_0x2c58a0||this['extension'];_0x43a951=_0x43a951||0x1;this[_0xb89f('0x32')](_0x35c6a1);this[_0xb89f('0x33')](_0x2c58a0);this[_0xb89f('0x35')](_0x43a951);return this['noop'](util[_0xb89f('0x2b')](_0xb89f('0x42'),_0x35c6a1,_0x2c58a0,_0x43a951));};AGIChannel['prototype']['getVariable']=function(_0x57e0ab){return this['sendRequest'](util[_0xb89f('0x2b')]('GET\x20VARIABLE\x20\x22%s\x22',_0x57e0ab));};AGIChannel[_0xb89f('0x24')][_0xb89f('0x43')]=function(_0x43e721,_0x121ce4,_0x4f5fa7,_0x2d6735,_0x1f566c,_0x3b6d4a){_0x121ce4=_0x121ce4||_0xb89f('0x44');_0x4f5fa7=_0x4f5fa7||'';_0x2d6735=_0x2d6735===undefined?-0x1:_0x2d6735==='-1'?-0x1:_0x2d6735*0x3e8;_0x1f566c=_0x1f566c===undefined?'':'s='+_0x1f566c;_0x3b6d4a=_0x3b6d4a?_0xb89f('0x45'):'';return this[_0xb89f('0x28')](util[_0xb89f('0x2b')](_0xb89f('0x46'),_0x43e721,_0x121ce4,_0x4f5fa7,_0x2d6735,_0x3b6d4a,_0x1f566c));};AGIChannel[_0xb89f('0x24')][_0xb89f('0x47')]=function(_0x4106d4,_0x14d6ff){_0x14d6ff=_0x14d6ff||'';return this[_0xb89f('0x28')](util['format'](_0xb89f('0x48'),_0x4106d4,_0x14d6ff));};AGIChannel[_0xb89f('0x24')][_0xb89f('0x49')]=function(_0x46370b){return this[_0xb89f('0x2e')](_0xb89f('0x4a'),_0x46370b);};AGIChannel[_0xb89f('0x24')]['wait']=function(_0x4432ac){return this['exec'](_0xb89f('0x4b'),_0x4432ac);};AGIChannel['prototype'][_0xb89f('0x1b')]=function(_0x3715ed,_0x2477fc){this['noop'](util[_0xb89f('0x2b')](_0xb89f('0x4c'),_0x3715ed['id'],_0x3715ed[_0xb89f('0x4d')],_0x2477fc));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xb89f('0x4e')]=AGIChannel; \ No newline at end of file +var _0xaf62=['hangup','substring','520-Invalid','520\x20End\x20of\x20proper','no\x20code','replace','indexOf','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','function','write','prototype','sendRequest','answer','ANSWER','getData','beep','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','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','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','EventEmitter','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase'];(function(_0x55c6be,_0x113560){var _0x3fd017=function(_0x3ff1b9){while(--_0x3ff1b9){_0x55c6be['push'](_0x55c6be['shift']());}};_0x3fd017(++_0x113560);}(_0xaf62,0x174));var _0x2af6=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xaf62[_0x618414];return _0x21c19a;};'use strict';var util=require('util');var _=require(_0x2af6('0x0'));var EventEmitter=require(_0x2af6('0x1'))[_0x2af6('0x2')];var AGIReply=require('./reply');var AGIError=require(_0x2af6('0x3'));function AGIChannel(_0x1330b0){var _0xb10524=this,_0x13a7c7=new AGIReply(),_0x359bb3=![],_0x5d6a21={};EventEmitter[_0x2af6('0x4')](_0xb10524);_0x1330b0[_0x2af6('0x5')](_0x2af6('0x6'));_0x1330b0[_0x2af6('0x7')](0x8*0x3c*0x3c*0x3e8);_0x13a7c7['setEncoding'](_0x2af6('0x6'));_0x13a7c7['on'](_0x2af6('0x8'),function(_0x35b1c0){for(var _0x2be510 in _0x35b1c0){_0xb10524[_0x2be510]=_0x35b1c0[_0x2be510];}_0xb10524[_0x2af6('0x9')](_0x2af6('0xa'));});_0x13a7c7['on'](_0x2af6('0xb'),function(_0x42bbfb){if(_0x42bbfb[_0x2af6('0xc')]()==_0x2af6('0xd')){_0xb10524['emit'](_0x2af6('0xd'));return;}if(_0x42bbfb[_0x2af6('0xe')](0x0,0xb)==_0x2af6('0xf')){_0x359bb3=!![];}if(_0x359bb3){_0x5d6a21['rx']+=_0x42bbfb+'\x0a';if(_0x42bbfb['search'](_0x2af6('0x10'))!=-0x1){_0x359bb3=![];}}else{_0x5d6a21['rx']=_0x42bbfb;}if(_0x359bb3){return;}if(typeof _0x5d6a21['cb']=='function'){var _0x438ee1=_0x5d6a21['rx'][_0x2af6('0xe')](0x0,0x3),_0x3e4f4c=null,_0x5c509a=null;_0x438ee1=parseInt(_0x438ee1);if(isNaN(_0x438ee1)){_0x5d6a21['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x2af6('0x11')});return;}if(_0x438ee1!=0xc8){_0x5d6a21['cb'](null,{'code':_0x438ee1,'result':-0x1,'extra':'KO'});return;}_0x3e4f4c=_0x5d6a21['rx']['substring'](0x4)[_0x2af6('0x12')]('result=','');if(_0x3e4f4c['indexOf']('\x20')!=-0x1){_0x3e4f4c=_0x3e4f4c['substr'](0x0,_0x3e4f4c[_0x2af6('0x13')]('\x20'));}if(_[_0x2af6('0x14')](_0x3e4f4c,'-1')){_0x3e4f4c=parseInt(_0x3e4f4c);}_0x5c509a=_0x5d6a21['rx'][_0x2af6('0x15')]('\x20');if(_0x5c509a[_0x2af6('0x16')]==0x3){_0x5c509a=_0x5c509a[0x2][_0x2af6('0xe')](0x1,_0x5c509a[0x2]['length']-0x1);}else if(_0x5c509a[_0x2af6('0x16')]>0x3){var _0x3b7cfd=/\((.+)\)/;var _0x7f7a06=_0x5d6a21['rx'][_0x2af6('0x17')](_0x3b7cfd);if(_0x7f7a06){_0x5c509a=_0x7f7a06[0x1];}else{_0x5c509a=null;}}else{_0x5c509a=null;}_0x5d6a21['cb'](null,{'code':_0x438ee1,'result':_0x3e4f4c,'extra':_0x5c509a});}});_0x1330b0['on'](_0x2af6('0x18'),function(_0x222d34){_0xb10524[_0x2af6('0x9')](_0x2af6('0x18'),new AGIError('E_AGI_SOCKET_ERROR',_0x222d34[_0x2af6('0x19')]));});_0x1330b0['on'](_0x2af6('0x1a'),function(){_0xb10524[_0x2af6('0x9')](_0x2af6('0x1a'),new AGIError(_0x2af6('0x1b')));});_0x1330b0['on'](_0x2af6('0x1c'),function(){_0xb10524[_0x2af6('0x9')](_0x2af6('0x1c'),new AGIError(_0x2af6('0x1d')));_0x1330b0[_0x2af6('0x1e')]();});_0x1330b0[_0x2af6('0x1f')](_0x13a7c7);this['command']=function(_0x692e62,_0xebe735){var _0x692e62=_0x692e62||'',_0xebe735=typeof _0xebe735==_0x2af6('0x20')?_0xebe735:new Function();_0x5d6a21={'tx':_0x692e62,'rx':'','cb':_0xebe735};_0x1330b0[_0x2af6('0x21')](_0x692e62+'\x0a');},this[_0x2af6('0x1a')]=function(){_0x1330b0[_0x2af6('0x1e')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x2af6('0x22')][_0x2af6('0x23')]=function(_0x564eff){return this['command']['sync'](this,_0x564eff);};AGIChannel['prototype'][_0x2af6('0x24')]=function(){return this['sendRequest'](_0x2af6('0x25'));};AGIChannel[_0x2af6('0x22')][_0x2af6('0x26')]=function(_0x58a7fe,_0x1c7956,_0x265b83){_0x58a7fe=_0x58a7fe===undefined?_0x2af6('0x27'):_0x58a7fe;_0x1c7956=_0x1c7956===undefined?'5':_0x1c7956;_0x265b83=_0x265b83===undefined?'1':_0x265b83;return this[_0x2af6('0x23')](util[_0x2af6('0x28')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x58a7fe,_0x1c7956*0x3e8,_0x265b83));};AGIChannel['prototype'][_0x2af6('0x29')]=function(_0x4059d9){_0x4059d9=_0x4059d9||_0x2af6('0x2a');return this['sendRequest'](util[_0x2af6('0x28')](_0x2af6('0x2b'),_0x4059d9));};AGIChannel[_0x2af6('0x22')][_0x2af6('0x2c')]=function(_0x32a88c,_0x4110f1){if(_[_0x2af6('0x2d')](_0x4110f1)){return this['sendRequest'](util[_0x2af6('0x28')](_0x2af6('0x2e'),_0x32a88c,_0x4110f1[_0x2af6('0x2f')](',')));}return this[_0x2af6('0x23')](util[_0x2af6('0x28')](_0x2af6('0x2e'),_0x32a88c,_0x4110f1));};AGIChannel[_0x2af6('0x22')][_0x2af6('0x30')]=function(_0x59c027){return this['sendRequest'](util[_0x2af6('0x28')](_0x2af6('0x31'),_0x59c027));};AGIChannel[_0x2af6('0x22')][_0x2af6('0x32')]=function(_0x2596db){return this[_0x2af6('0x23')](util['format'](_0x2af6('0x33'),_0x2596db));};AGIChannel[_0x2af6('0x22')][_0x2af6('0x34')]=function(_0x5e6eb8){return this['sendRequest'](util[_0x2af6('0x28')](_0x2af6('0x35'),_0x5e6eb8));};AGIChannel['prototype'][_0x2af6('0xd')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0x2af6('0x22')]['setVariable']=function(_0x96f826,_0x307fae){var _0x54e317=_[_0x2af6('0x36')](_0x307fae)||_[_0x2af6('0x37')](_0x307fae)?_0x307fae['toString']():_0x307fae;return this['sendRequest'](util[_0x2af6('0x28')](_0x2af6('0x38'),_0x96f826,_0x54e317?_0x54e317[_0x2af6('0x39')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x2af6('0x22')][_0x2af6('0x3a')]=function(_0x2008c8,_0x473be1){return this[_0x2af6('0x23')](util[_0x2af6('0x28')]('SAY\x20NUMBER\x20%s\x20%s',_0x2008c8,_0x473be1));};AGIChannel[_0x2af6('0x22')][_0x2af6('0x3b')]=function(_0x4f5434,_0x383a53){return this[_0x2af6('0x23')](util[_0x2af6('0x28')](_0x2af6('0x3c'),_0x4f5434,_0x383a53));};AGIChannel['prototype'][_0x2af6('0x3d')]=function(_0x5d52c3,_0x54fedc){return this[_0x2af6('0x23')](util[_0x2af6('0x28')](_0x2af6('0x3e'),_0x5d52c3,_0x54fedc));};AGIChannel[_0x2af6('0x22')][_0x2af6('0x3f')]=function(_0xe6f744,_0x75728c,_0x4d2e6c){_0x75728c=_0x75728c||this['extension'];_0x4d2e6c=_0x4d2e6c||0x1;this['setContext'](_0xe6f744);this['setExtension'](_0x75728c);this[_0x2af6('0x34')](_0x4d2e6c);return this[_0x2af6('0x29')](util['format']('GOTO\x20%s\x20%s\x20%s',_0xe6f744,_0x75728c,_0x4d2e6c));};AGIChannel['prototype'][_0x2af6('0x40')]=function(_0x236a3e){return this[_0x2af6('0x23')](util[_0x2af6('0x28')](_0x2af6('0x41'),_0x236a3e));};AGIChannel[_0x2af6('0x22')][_0x2af6('0x42')]=function(_0x3cbefe,_0x278cc5,_0xed171,_0x5ca7da,_0x34ade6,_0x149771){_0x278cc5=_0x278cc5||_0x2af6('0x43');_0xed171=_0xed171||'';_0x5ca7da=_0x5ca7da===undefined?-0x1:_0x5ca7da==='-1'?-0x1:_0x5ca7da*0x3e8;_0x34ade6=_0x34ade6===undefined?'':'s='+_0x34ade6;_0x149771=_0x149771?_0x2af6('0x44'):'';return this[_0x2af6('0x23')](util[_0x2af6('0x28')](_0x2af6('0x45'),_0x3cbefe,_0x278cc5,_0xed171,_0x5ca7da,_0x149771,_0x34ade6));};AGIChannel[_0x2af6('0x22')]['streamFile']=function(_0x1a90dc,_0x6be3dc){_0x6be3dc=_0x6be3dc||'';return this[_0x2af6('0x23')](util[_0x2af6('0x28')](_0x2af6('0x46'),_0x1a90dc,_0x6be3dc));};AGIChannel[_0x2af6('0x22')][_0x2af6('0x47')]=function(_0x2e010d){return this[_0x2af6('0x2c')](_0x2af6('0x48'),_0x2e010d);};AGIChannel[_0x2af6('0x22')]['wait']=function(_0x1bf5f6){return this[_0x2af6('0x2c')](_0x2af6('0x49'),_0x1bf5f6);};AGIChannel[_0x2af6('0x22')][_0x2af6('0x18')]=function(_0x452232,_0x218f1e){this[_0x2af6('0x29')](util[_0x2af6('0x28')](_0x2af6('0x4a'),_0x452232['id'],_0x452232[_0x2af6('0x4b')],_0x218f1e));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x2af6('0x4c')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 8dfe39f..747585f 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 _0x7a3a=['name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','apply'];(function(_0x449345,_0x4847b1){var _0x3720a8=function(_0x5c3b90){while(--_0x5c3b90){_0x449345['push'](_0x449345['shift']());}};_0x3720a8(++_0x4847b1);}(_0x7a3a,0x1d3));var _0xa7a3=function(_0x330ed4,_0x55ecbe){_0x330ed4=_0x330ed4-0x0;var _0x8bbc3b=_0x7a3a[_0x330ed4];return _0x8bbc3b;};'use strict';var util=require(_0xa7a3('0x0'));var error={'E_AGI_UNDEFINED':_0xa7a3('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xa7a3('0x2'),'E_AGI_SERVER_CLOSE':_0xa7a3('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xa7a3('0x4'),'E_AGI_SOCKET_ERROR':_0xa7a3('0x5'),'E_AGI_SOCKET_CLOSE':_0xa7a3('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xa7a3('0x7'),'E_AGI_COMMAND_EMPTY':_0xa7a3('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa7a3('0x9'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x238f61){var _0x238f61=_0x238f61||null,_0x1ef4e1=_0x1ef4e1||[],_0x409bc0=0x1,_0x2514ad='';if(!error[_0x238f61]){_0x238f61=_0xa7a3('0xa');}_0x1ef4e1[_0xa7a3('0xb')](error[_0x238f61]);while(arguments[_0x409bc0]){_0x1ef4e1[_0xa7a3('0xb')](arguments[_0x409bc0]);_0x409bc0++;}_0x2514ad=util['format'][_0xa7a3('0xc')](util,_0x1ef4e1);this['message']=_0x2514ad;this[_0xa7a3('0xd')]=_0x238f61;}module[_0xa7a3('0xe')]=AGIError; \ No newline at end of file +var _0x2b4c=['format','apply','message','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x19d4dc,_0x46e8e0){var _0x1cf72f=function(_0x42402c){while(--_0x42402c){_0x19d4dc['push'](_0x19d4dc['shift']());}};_0x1cf72f(++_0x46e8e0);}(_0x2b4c,0xab));var _0xc2b4=function(_0x3be5db,_0x2b1238){_0x3be5db=_0x3be5db-0x0;var _0x5790d3=_0x2b4c[_0x3be5db];return _0x5790d3;};'use strict';var util=require(_0xc2b4('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xc2b4('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xc2b4('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0xc2b4('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xc2b4('0x4'),'E_AGI_SOCKET_ERROR':_0xc2b4('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xc2b4('0x6'),'E_AGI_COMMAND_EMPTY':_0xc2b4('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xc2b4('0x8')};function AGIError(_0x37ff80){var _0x37ff80=_0x37ff80||null,_0x2806fa=_0x2806fa||[],_0x25f154=0x1,_0x2685be='';if(!error[_0x37ff80]){_0x37ff80=_0xc2b4('0x9');}_0x2806fa[_0xc2b4('0xa')](error[_0x37ff80]);while(arguments[_0x25f154]){_0x2806fa[_0xc2b4('0xa')](arguments[_0x25f154]);_0x25f154++;}_0x2685be=util[_0xc2b4('0xb')][_0xc2b4('0xc')](util,_0x2806fa);this[_0xc2b4('0xd')]=_0x2685be;this['name']=_0x37ff80;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index daeaac5..7043aea 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 _0x56be=['subscribe','agi','emit','parse','error','E_AGI_SERVER_ERROR','events','EventEmitter','ioredis','./error','../../config/environment','defaults','redis','localhost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56be,0x92));var _0xe56b=function(_0x50d657,_0x22fda9){_0x50d657=_0x50d657-0x0;var _0x32bb29=_0x56be[_0x50d657];return _0x32bb29;};'use strict';var _=require('lodash');var EventEmitter=require(_0xe56b('0x0'))[_0xe56b('0x1')];var Redis=require(_0xe56b('0x2'));var AGIError=require(_0xe56b('0x3'));var config=require(_0xe56b('0x4'));config['redis']=_[_0xe56b('0x5')](config[_0xe56b('0x6')],{'host':_0xe56b('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xe56b('0x6')]);sub[_0xe56b('0x8')](_0xe56b('0x9'),function(_0x5828db){if(_0x5828db)return eventEmitter[_0xe56b('0xa')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x5828db));});sub['on']('message',function(_0x532bbd,_0x49b341){if(_0x532bbd!==_0xe56b('0x9'))return;try{var _0x343fa5=JSON[_0xe56b('0xb')](_0x49b341);eventEmitter[_0xe56b('0xa')]('projectUpdate',_0x343fa5);}catch(_0x37a9be){eventEmitter['emit'](_0xe56b('0xc'),new AGIError(_0xe56b('0xd'),_0x37a9be));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x37df=['emit','E_AGI_SERVER_ERROR','message','parse','projectUpdate','error','exports','lodash','events','EventEmitter','ioredis','../../config/environment','redis','defaults','localhost','subscribe','agi'];(function(_0x59e4cb,_0x5c953d){var _0x4aadf1=function(_0x425909){while(--_0x425909){_0x59e4cb['push'](_0x59e4cb['shift']());}};_0x4aadf1(++_0x5c953d);}(_0x37df,0x8f));var _0xf37d=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x37df[_0x186376];return _0x2dbdd9;};'use strict';var _=require(_0xf37d('0x0'));var EventEmitter=require(_0xf37d('0x1'))[_0xf37d('0x2')];var Redis=require(_0xf37d('0x3'));var AGIError=require('./error');var config=require(_0xf37d('0x4'));config[_0xf37d('0x5')]=_[_0xf37d('0x6')](config[_0xf37d('0x5')],{'host':_0xf37d('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0xf37d('0x8')](_0xf37d('0x9'),function(_0x359319){if(_0x359319)return eventEmitter[_0xf37d('0xa')]('error',new AGIError(_0xf37d('0xb'),_0x359319));});sub['on'](_0xf37d('0xc'),function(_0x2ad751,_0x49c849){if(_0x2ad751!=='agi')return;try{var _0x3dc661=JSON[_0xf37d('0xd')](_0x49c849);eventEmitter[_0xf37d('0xa')](_0xf37d('0xe'),_0x3dc661);}catch(_0x45bd67){eventEmitter['emit'](_0xf37d('0xf'),new AGIError('E_AGI_SERVER_ERROR',_0x45bd67));}});module[_0xf37d('0x10')]={'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 a31ccd3..1e55bcf 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 _0xc055=['agicommand','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','relations','getVertex','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','vswitch','target'];(function(_0x273ace,_0x3b28bc){var _0x5a5548=function(_0x2d2aaf){while(--_0x2d2aaf){_0x273ace['push'](_0x273ace['shift']());}};_0x5a5548(++_0x3b28bc);}(_0xc055,0x8d));var _0x5c05=function(_0x42e5da,_0x1a7f02){_0x42e5da=_0x42e5da-0x0;var _0x8d741d=_0xc055[_0x42e5da];return _0x8d741d;};'use strict';var _=require(_0x5c05('0x0'));var logger=require(_0x5c05('0x1'))(_0x5c05('0x2'));var verticesWithRetry=[_0x5c05('0x3'),'getdigits','getsecretdigits'];var Graph=function(){this[_0x5c05('0x4')]={};this[_0x5c05('0x5')]={};this[_0x5c05('0x6')]=0x0;};Graph[_0x5c05('0x7')][_0x5c05('0x8')]=function(_0xb951ab){this[_0x5c05('0x4')][_0xb951ab['id']]=_0xb951ab;this[_0x5c05('0x5')][_0xb951ab['id']]=[];};Graph[_0x5c05('0x7')][_0x5c05('0x9')]=function(_0xed1380,_0x41391e,_0x1f22a0){this[_0x5c05('0x5')][_0xed1380]['push']({'target':_0x41391e,'condition':_0x1f22a0});this[_0x5c05('0x6')]+=0x1;};Graph[_0x5c05('0x7')]['size']=function(){return _['size'](this['vertices']);};Graph[_0x5c05('0x7')][_0x5c05('0xa')]=function(){return this[_0x5c05('0x6')];};Graph[_0x5c05('0x7')][_0x5c05('0xb')]=function(_0xba9e3e){return this['vertices'][_0xba9e3e];};Graph[_0x5c05('0x7')][_0x5c05('0xc')]=function(_0x3525b1,_0x3e9450){if(!this[_0x5c05('0x4')][_0x3525b1]){return logger[_0x5c05('0xd')]('no\x20vertex\x20found');}var _0x3fd0f0=_0x3e9450(this[_0x5c05('0x4')][_0x3525b1]);if(!_0x3fd0f0){return logger[_0x5c05('0xd')](_0x5c05('0xe'));}if(this['edges'][_0x3525b1][_0x5c05('0xf')]===0x0){return logger['info'](_0x5c05('0x10'));}for(var _0xa91940=0x0,_0x56b59f=[],_0x940723=![];_0xa91940\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','evtHangup','createSquareReport','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','handleNotFound','production','handleUnpublished','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','connection','close','lodash','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','EventEmitter','defaults','127.0.0.1','nextTick','error','stack','deleted','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','[%s]\x20%s','message','[ERROR]\x20%s'];(function(_0x1a0e37,_0x145256){var _0x383156=function(_0x1d0684){while(--_0x1d0684){_0x1a0e37['push'](_0x1a0e37['shift']());}};_0x383156(++_0x145256);}(_0x0221,0xdb));var _0x1022=function(_0x1726e7,_0x368910){_0x1726e7=_0x1726e7-0x0;var _0x1589c3=_0x0221[_0x1726e7];return _0x1589c3;};'use strict';var _=require(_0x1022('0x0'));var syncho=require('syncho');var util=require(_0x1022('0x1'));var config=require(_0x1022('0x2'));var logger=require(_0x1022('0x3'))(_0x1022('0x4'));var utilLicense=require(_0x1022('0x5'));var rpc=require(_0x1022('0x6'));var Project=require(_0x1022('0x7'));var AGIEmitter=require('./events')[_0x1022('0x8')];var projects=[];config[_0x1022('0x4')]=_[_0x1022('0x9')](config['agi'],{'ip':_0x1022('0xa'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x33c1ea){process[_0x1022('0xb')](function(){syncho(function(){try{setChannelVariables(_0x33c1ea);agiHandler(_0x33c1ea);}catch(_0xbd7337){logger[_0x1022('0xc')](_0xbd7337[_0x1022('0xd')]);}});});}function projectUpdateHandler(_0x57d8ee){try{var _0x1b52dd=_['findIndex'](projects,['id',_0x57d8ee['id']]);if(_0x1b52dd>-0x1){if(_0x57d8ee[_0x1022('0xe')]===!![]){projects['splice'](_0x1b52dd,0x1);}else{projects[_0x1b52dd]=_0x57d8ee;}}else{projects['push'](_0x57d8ee);}}catch(_0x1e2af1){logger[_0x1022('0xc')](_0x1e2af1[_0x1022('0xd')]);}}function listeningHandler(){console[_0x1022('0xf')](_0x1022('0x10'),config['agi']['port']);logger[_0x1022('0x11')](util[_0x1022('0x12')](_0x1022('0x13'),config[_0x1022('0x4')]['ip'],config['agi'][_0x1022('0x14')]));}function errorHandler(_0xaea0f){if(_0xaea0f&&_0xaea0f[_0x1022('0x15')]&&_0xaea0f['message']){logger[_0x1022('0xc')](util['format'](_0x1022('0x16'),_0xaea0f['name'],_0xaea0f[_0x1022('0x17')]));}else{logger['error'](util[_0x1022('0x12')](_0x1022('0x18'),_0xaea0f['stack']));}}function closeHandler(){logger[_0x1022('0x11')](util[_0x1022('0x12')](_0x1022('0x19'),this[_0x1022('0x1a')],this[_0x1022('0x1b')],this[_0x1022('0x1c')],this[_0x1022('0x1d')],this[_0x1022('0x1e')]));try{createSquareReport(this);}catch(_0x42e2d5){logger[_0x1022('0xc')](_0x42e2d5[_0x1022('0xd')]);}}function timeoutHandler(){logger['info'](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x1022('0x1a')],this[_0x1022('0x1b')],this[_0x1022('0x1c')],this['dnid'],this[_0x1022('0x1e')]));}function hangupHandler(){logger[_0x1022('0x11')](util[_0x1022('0x12')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x1022('0x1b')],this[_0x1022('0x1c')],this[_0x1022('0x1d')],this[_0x1022('0x1e')]));this[_0x1022('0x1f')]=!![];}function createSquareReport(_0x4b5994,_0x39a465){rpc[_0x1022('0x20')](_0x4b5994)['then'](function(_0x4ce385){if(_0x39a465){_0x39a465(null,_0x4ce385);}})[_0x1022('0x21')](function(_0x5e3e6d){if(_0x39a465){_0x39a465(null,_0x5e3e6d);}});}function setChannelVariables(_0x16e10a){for(var _0x2082ce in _0x16e10a){if(_0x16e10a[_0x1022('0x22')](_0x2082ce)){if(_0x2082ce[_0x1022('0x23')](_0x1022('0x24'))===0x0){_0x16e10a[_0x2082ce[_0x1022('0x25')](0x4)]=_0x16e10a[_0x2082ce];delete _0x16e10a[_0x2082ce];}}}}function agiHandler(_0x1dda1a){logger['debug'](_0x1022('0x26'),JSON[_0x1022('0x27')](_0x1dda1a,null,0x2));logger[_0x1022('0x11')](util[_0x1022('0x12')](_0x1022('0x28'),_0x1dda1a['arg_1'],_0x1dda1a[_0x1022('0x1b')],_0x1dda1a[_0x1022('0x1c')],_0x1dda1a[_0x1022('0x1d')],_0x1dda1a[_0x1022('0x1e')]));_0x1dda1a['on']('error',errorHandler);_0x1dda1a['on']('close',closeHandler);_0x1dda1a['on'](_0x1022('0x29'),timeoutHandler);_0x1dda1a['evtHangup']=![];_0x1dda1a['on'](_0x1022('0x2a'),hangupHandler);var _0x3096a3=_[_0x1022('0x2b')](projects,['name',_0x1dda1a[_0x1022('0x1a')]]);if(!_0x3096a3)return Project[_0x1022('0x2c')](_0x1dda1a);if(!_0x3096a3[_0x1022('0x2d')])return Project[_0x1022('0x2e')](_0x1dda1a);return Project['initialize'](_0x3096a3,_0x1dda1a);}function main(){var _0x15141d;return utilLicense[_0x1022('0x2f')]()[_0x1022('0x30')](function(_0x2a5647){if(!_0x2a5647)return;if(_0x2a5647[_0x1022('0x31')]){if(_0x2a5647[_0x1022('0x32')]&&_0x2a5647['callysquare']>0x0){logger[_0x1022('0x11')](util[_0x1022('0x12')](_0x1022('0x33'),_0x2a5647[_0x1022('0x32')]));_0x15141d=_0x2a5647[_0x1022('0x32')];}else{logger[_0x1022('0x11')](_0x1022('0x34'));}}else{logger[_0x1022('0x11')](_0x1022('0x35'));_0x15141d=-0x1;}})[_0x1022('0x30')](function(){return Project[_0x1022('0x36')]();})[_0x1022('0x30')](function(_0x139de4){projects=_0x139de4;return;})[_0x1022('0x21')](function(_0x158908){logger[_0x1022('0xc')](_0x1022('0x37'),_0x158908[_0x1022('0xd')]);})[_0x1022('0x38')](function(){var _0x78c4ae=require(_0x1022('0x39'))(config['agi'][_0x1022('0x14')],config['agi']['ip'],_0x15141d);_0x78c4ae['on'](_0x1022('0xc'),errorHandler);_0x78c4ae['on'](_0x1022('0x3a'),listeningHandler);_0x78c4ae['on'](_0x1022('0x3b'),connectionHandler);_0x78c4ae['on'](_0x1022('0x3c'),closeHandler);});}main(); \ No newline at end of file +var _0x8e26=['nextTick','findIndex','deleted','splice','push','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','arg_1','calleridname','dnid','uniqueid','callerid','then','hasOwnProperty','indexOf','substring','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','find','handleNotFound','production','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','catch','finally','listening','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1'];(function(_0x2f6269,_0x30aa0f){var _0x120627=function(_0x40b947){while(--_0x40b947){_0x2f6269['push'](_0x2f6269['shift']());}};_0x120627(++_0x30aa0f);}(_0x8e26,0x149));var _0x68e2=function(_0x39c2b4,_0x28d263){_0x39c2b4=_0x39c2b4-0x0;var _0x53305f=_0x8e26[_0x39c2b4];return _0x53305f;};'use strict';var _=require(_0x68e2('0x0'));var syncho=require(_0x68e2('0x1'));var util=require(_0x68e2('0x2'));var config=require(_0x68e2('0x3'));var logger=require(_0x68e2('0x4'))(_0x68e2('0x5'));var utilLicense=require(_0x68e2('0x6'));var rpc=require(_0x68e2('0x7'));var Project=require(_0x68e2('0x8'));var AGIEmitter=require(_0x68e2('0x9'))[_0x68e2('0xa')];var projects=[];config[_0x68e2('0x5')]=_[_0x68e2('0xb')](config['agi'],{'ip':_0x68e2('0xc'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x36ac2e){process[_0x68e2('0xd')](function(){syncho(function(){try{setChannelVariables(_0x36ac2e);agiHandler(_0x36ac2e);}catch(_0x4161db){logger['error'](_0x4161db['stack']);}});});}function projectUpdateHandler(_0x49ba79){try{var _0x3ba3ff=_[_0x68e2('0xe')](projects,['id',_0x49ba79['id']]);if(_0x3ba3ff>-0x1){if(_0x49ba79[_0x68e2('0xf')]===!![]){projects[_0x68e2('0x10')](_0x3ba3ff,0x1);}else{projects[_0x3ba3ff]=_0x49ba79;}}else{projects[_0x68e2('0x11')](_0x49ba79);}}catch(_0x20e66b){logger[_0x68e2('0x12')](_0x20e66b[_0x68e2('0x13')]);}}function listeningHandler(){console[_0x68e2('0x14')](_0x68e2('0x15'),config[_0x68e2('0x5')][_0x68e2('0x16')]);logger[_0x68e2('0x17')](util[_0x68e2('0x18')](_0x68e2('0x19'),config[_0x68e2('0x5')]['ip'],config['agi']['port']));}function errorHandler(_0x5bddb8){if(_0x5bddb8&&_0x5bddb8[_0x68e2('0x1a')]&&_0x5bddb8[_0x68e2('0x1b')]){logger['error'](util[_0x68e2('0x18')]('[%s]\x20%s',_0x5bddb8['name'],_0x5bddb8[_0x68e2('0x1b')]));}else{logger['error'](util[_0x68e2('0x18')](_0x68e2('0x1c'),_0x5bddb8[_0x68e2('0x13')]));}}function closeHandler(){logger[_0x68e2('0x17')](util[_0x68e2('0x18')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x68e2('0x1d')],this[_0x68e2('0x1e')],this['callerid'],this[_0x68e2('0x1f')],this[_0x68e2('0x20')]));try{createSquareReport(this);}catch(_0x908135){logger[_0x68e2('0x12')](_0x908135[_0x68e2('0x13')]);}}function timeoutHandler(){logger['info'](util[_0x68e2('0x18')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x68e2('0x1d')],this['calleridname'],this[_0x68e2('0x21')],this[_0x68e2('0x1f')],this[_0x68e2('0x20')]));}function hangupHandler(){logger['info'](util[_0x68e2('0x18')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x68e2('0x1e')],this[_0x68e2('0x21')],this['dnid'],this[_0x68e2('0x20')]));this['evtHangup']=!![];}function createSquareReport(_0x56dcd7,_0x2e49cf){rpc['createSquareReport'](_0x56dcd7)[_0x68e2('0x22')](function(_0x494e08){if(_0x2e49cf){_0x2e49cf(null,_0x494e08);}})['catch'](function(_0x40970f){if(_0x2e49cf){_0x2e49cf(null,_0x40970f);}});}function setChannelVariables(_0x411d36){for(var _0x275ce5 in _0x411d36){if(_0x411d36[_0x68e2('0x23')](_0x275ce5)){if(_0x275ce5[_0x68e2('0x24')]('agi_')===0x0){_0x411d36[_0x275ce5[_0x68e2('0x25')](0x4)]=_0x411d36[_0x275ce5];delete _0x411d36[_0x275ce5];}}}}function agiHandler(_0x4247c4){logger[_0x68e2('0x26')](_0x68e2('0x27'),JSON['stringify'](_0x4247c4,null,0x2));logger[_0x68e2('0x17')](util[_0x68e2('0x18')](_0x68e2('0x28'),_0x4247c4['arg_1'],_0x4247c4[_0x68e2('0x1e')],_0x4247c4[_0x68e2('0x21')],_0x4247c4[_0x68e2('0x1f')],_0x4247c4[_0x68e2('0x20')]));_0x4247c4['on'](_0x68e2('0x12'),errorHandler);_0x4247c4['on'](_0x68e2('0x29'),closeHandler);_0x4247c4['on'](_0x68e2('0x2a'),timeoutHandler);_0x4247c4[_0x68e2('0x2b')]=![];_0x4247c4['on'](_0x68e2('0x2c'),hangupHandler);var _0x3aa84a=_[_0x68e2('0x2d')](projects,[_0x68e2('0x1a'),_0x4247c4[_0x68e2('0x1d')]]);if(!_0x3aa84a)return Project[_0x68e2('0x2e')](_0x4247c4);if(!_0x3aa84a[_0x68e2('0x2f')])return Project['handleUnpublished'](_0x4247c4);return Project['initialize'](_0x3aa84a,_0x4247c4);}function main(){var _0x589b90;return utilLicense[_0x68e2('0x30')]()['then'](function(_0x56684c){if(!_0x56684c)return;if(_0x56684c['voice']){if(_0x56684c[_0x68e2('0x31')]&&_0x56684c['callysquare']>0x0){logger[_0x68e2('0x17')](util[_0x68e2('0x18')]('[LICENSE]\x20CHANNELS:\x20%s',_0x56684c['callysquare']));_0x589b90=_0x56684c['callysquare'];}else{logger[_0x68e2('0x17')](_0x68e2('0x32'));}}else{logger[_0x68e2('0x17')](_0x68e2('0x33'));_0x589b90=-0x1;}})[_0x68e2('0x22')](function(){return Project[_0x68e2('0x34')]();})[_0x68e2('0x22')](function(_0x1d6501){projects=_0x1d6501;return;})[_0x68e2('0x35')](function(_0x54134f){logger[_0x68e2('0x12')]('[LICENSE]',_0x54134f[_0x68e2('0x13')]);})[_0x68e2('0x36')](function(){var _0x188267=require('./server')(config[_0x68e2('0x5')]['port'],config['agi']['ip'],_0x589b90);_0x188267['on'](_0x68e2('0x12'),errorHandler);_0x188267['on'](_0x68e2('0x37'),listeningHandler);_0x188267['on'](_0x68e2('0x38'),connectionHandler);_0x188267['on']('close',closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index afb5dd8..d859696 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 _0x666b=['then','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0x666b,0x159));var _0xb666=function(_0x209bb2,_0x3950e6){_0x209bb2=_0x209bb2-0x0;var _0xdbedfe=_0x666b[_0x209bb2];return _0xdbedfe;};'use strict';var BPromise=require(_0xb666('0x0'));var jayson=require(_0xb666('0x1'));var client=jayson[_0xb666('0x2')][_0xb666('0x3')]({'port':0x232b});function request(_0x35180f,_0x57fd10){return new BPromise(function(_0x160b6c,_0x62c79a){return client[_0xb666('0x4')](_0x35180f,_0x57fd10)[_0xb666('0x5')](function(_0x3a1b75){if(_0x3a1b75['error']){return _0x62c79a(_0x3a1b75['error']['message']);}else{return _0x160b6c(_0x3a1b75[_0xb666('0x6')]);}})[_0xb666('0x7')](function(_0x226138){return _0x62c79a(_0x226138);});});}exports[_0xb666('0x8')]=function(_0x5a6fda,_0x5143af){return request(_0xb666('0x9'),{'account':_0x5a6fda,'message':_0x5143af});}; \ No newline at end of file +var _0x73a6=['error','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x73a6,0x16c));var _0x673a=function(_0x33b507,_0xe48ac3){_0x33b507=_0x33b507-0x0;var _0x4d4309=_0x73a6[_0x33b507];return _0x4d4309;};'use strict';var BPromise=require(_0x673a('0x0'));var jayson=require(_0x673a('0x1'));var client=jayson[_0x673a('0x2')][_0x673a('0x3')]({'port':0x232b});function request(_0x4ca334,_0x1e7918){return new BPromise(function(_0x52555c,_0x469933){return client[_0x673a('0x4')](_0x4ca334,_0x1e7918)[_0x673a('0x5')](function(_0x23d3e6){if(_0x23d3e6['error']){return _0x469933(_0x23d3e6[_0x673a('0x6')]['message']);}else{return _0x52555c(_0x23d3e6['result']);}})[_0x673a('0x7')](function(_0x2cf15e){return _0x469933(_0x2cf15e);});});}exports[_0x673a('0x8')]=function(_0x4290c3,_0x23c19c){return request(_0x673a('0x9'),{'account':_0x4290c3,'message':_0x23c19c});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index ec80b24..30e53c3 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 _0xc330=['priority','code','result','response','isUndefined','agicommand\x20not\x20found','stack','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','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','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','moment','xml2json','util','../../config/logger','agi','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','hasOwnProperty','retry','maxRetry','addVertex','length','source','target','mxGraphModel','start','root','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','mxCell','info','arg_1','callerid','dnid','uniqueid','traverseBFS','clear','debug','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension'];(function(_0x1ee7ef,_0x3a02c7){var _0x84066e=function(_0x546ed7){while(--_0x546ed7){_0x1ee7ef['push'](_0x1ee7ef['shift']());}};_0x84066e(++_0x3a02c7);}(_0xc330,0xb8));var _0x0c33=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xc330[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var moment=require(_0x0c33('0x0'));var parser=require(_0x0c33('0x1'));var util=require(_0x0c33('0x2'));var logger=require(_0x0c33('0x3'))(_0x0c33('0x4'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0x0c33('0x5'));var Vertices=require(_0x0c33('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x0c33('0x7')]()[_0x0c33('0x8')](function(_0x3329f5){logger[_0x0c33('0x9')](_0x0c33('0xa'),_0x3329f5['stack']);return[];});}function addVertex(_0x1b15d4,_0x437fc3,_0xfb521f){_0x437fc3['agicommand']=_0xfb521f;if(_0x437fc3[_0x0c33('0xb')](_0x0c33('0xc'))){_0x437fc3[_0x0c33('0xd')]=parseInt(_0x437fc3[_0x0c33('0xc')],0xa);}_0x1b15d4[_0x0c33('0xe')](_['omit'](_0x437fc3,'mxCell'));}function initGraph(_0x3fe639,_0x5adc6d){var _0x52c887=new Graph();for(var _0x11f397 in _0x3fe639){if(_0x3fe639[_0x0c33('0xb')](_0x11f397)){if(_['isArray'](_0x3fe639[_0x11f397])){for(var _0x5ca8ea=0x0;_0x5ca8ea<_0x3fe639[_0x11f397][_0x0c33('0xf')];_0x5ca8ea+=0x1){addVertex(_0x52c887,_0x3fe639[_0x11f397][_0x5ca8ea],_0x11f397);}}else{addVertex(_0x52c887,_0x3fe639[_0x11f397],_0x11f397);}}}for(var _0x4130d2=0x0;_0x4130d2<_0x5adc6d['length'];_0x4130d2+=0x1){if(_0x5adc6d[_0x4130d2][_0x0c33('0x10')]&&_0x5adc6d[_0x4130d2][_0x0c33('0x11')]){_0x52c887['addEdge'](_0x5adc6d[_0x4130d2][_0x0c33('0x10')],_0x5adc6d[_0x4130d2][_0x0c33('0x11')],_0x5adc6d[_0x4130d2]['value']);}}return _0x52c887;}function getRoot(_0x4b87c1){return parser['toJson'](_0x4b87c1,{'object':!![]})[_0x0c33('0x12')]['root'];}function inspect(_0x25b462){return util['inspect'](_0x25b462,{'showHidden':![],'depth':null});}function initialize(_0x130639,_0x2b43ab){var _0x2edbda=getRoot(_0x130639['production']);if(!_0x2edbda||!_0x2edbda[_0x0c33('0x13')])return;var _0x34d728,_0x1fbf04,_0x51a9be;logger['debug'](_0x0c33('0x14'),JSON[_0x0c33('0x15')](_0x2edbda,null,0x2));_0x2b43ab[_0x0c33('0x16')]=moment()[_0x0c33('0x17')](_0x0c33('0x18'));_0x34d728=initGraph(_['omit'](_0x2edbda,'mxCell'),_0x2edbda[_0x0c33('0x19')]);_0x1fbf04=new Vertices(_0x2b43ab,rpc,mailRpc);logger[_0x0c33('0x1a')](util[_0x0c33('0x17')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2b43ab[_0x0c33('0x1b')],_0x2b43ab['calleridname'],_0x2b43ab[_0x0c33('0x1c')],_0x2b43ab[_0x0c33('0x1d')],_0x2b43ab[_0x0c33('0x1e')]));_0x34d728[_0x0c33('0x1f')](_0x2edbda['start']['id'],function(_0x53e3bd){try{_0x53e3bd=_0x1fbf04[_0x0c33('0x20')](_0x53e3bd);logger[_0x0c33('0x21')](_0x0c33('0x22'),JSON['stringify'](_0x53e3bd,null,0x2));if(_0x53e3bd[_0x0c33('0x23')]===_0x0c33('0x24')){logger['info'](_0x0c33('0x25'));_0x2b43ab[_0x0c33('0x26')]=_0x53e3bd[_0x0c33('0x26')]||_0x2b43ab[_0x0c33('0x26')];_0x2b43ab[_0x0c33('0x27')]=_0x53e3bd['extension'];_0x2b43ab['priority']=_0x53e3bd[_0x0c33('0x28')]?_0x53e3bd[_0x0c33('0x28')]-0x1:0x1;return null;}else if(_0x53e3bd&&_0x1fbf04[_0x53e3bd['agicommand']]){_0x51a9be=_0x1fbf04[_0x53e3bd[_0x0c33('0x23')]](_0x53e3bd);logger[_0x0c33('0x1a')]('response',JSON['stringify'](_0x51a9be,null,0x2));if(_0x51a9be&&_0x51a9be[_0x0c33('0x29')]===AGI_CODE_SUCCESS&&_0x51a9be[_0x0c33('0x2a')]!==AGI_RESULT_ERROR&&!_0x2b43ab['evtHangup']){logger[_0x0c33('0x21')](_0x0c33('0x2b'),inspect(_0x51a9be));return _[_0x0c33('0x2c')](_0x51a9be[_0x0c33('0x2a')])?null:_0x51a9be[_0x0c33('0x2a')]['toString']();}else{logger['error'](_0x0c33('0x2b'),inspect(_0x51a9be));return null;}}else{logger[_0x0c33('0x9')](_0x0c33('0x2d'));return null;}}catch(_0x2ee158){logger[_0x0c33('0x9')](_0x2ee158[_0x0c33('0x2e')]);return null;}});if(_0x2edbda['finally']){logger[_0x0c33('0x1a')](util[_0x0c33('0x17')](_0x0c33('0x2f'),_0x2b43ab[_0x0c33('0x1b')],_0x2b43ab['calleridname'],_0x2b43ab[_0x0c33('0x1c')],_0x2b43ab[_0x0c33('0x1d')],_0x2b43ab[_0x0c33('0x1e')]));_0x34d728[_0x0c33('0x1f')](_0x2edbda[_0x0c33('0x30')]['id'],function(_0x41fa03){try{_0x41fa03=_0x1fbf04[_0x0c33('0x20')](_0x41fa03);logger[_0x0c33('0x21')](_0x0c33('0x22'),JSON[_0x0c33('0x15')](_0x41fa03,null,0x2));if(_0x41fa03&&_0x1fbf04[_0x41fa03['agicommand']]){_0x51a9be=_0x1fbf04[_0x41fa03[_0x0c33('0x23')]](_0x41fa03);if(_0x51a9be){logger['debug'](_0x0c33('0x2b'),inspect(_0x51a9be));return _[_0x0c33('0x2c')](_0x51a9be['result'])?null:_0x51a9be[_0x0c33('0x2a')][_0x0c33('0x31')]();}else{logger[_0x0c33('0x9')](_0x0c33('0x2b'),inspect(_0x51a9be));return null;}}else{logger[_0x0c33('0x9')]('agicommand\x20not\x20found');return null;}}catch(_0x46eb19){logger[_0x0c33('0x9')](_0x46eb19[_0x0c33('0x2e')]);return null;}});}logger['info'](util[_0x0c33('0x17')](_0x0c33('0x32'),_0x2b43ab[_0x0c33('0x1b')],_0x2b43ab['calleridname'],_0x2b43ab['callerid'],_0x2b43ab[_0x0c33('0x1d')],_0x2b43ab['uniqueid']));logger[_0x0c33('0x1a')](util[_0x0c33('0x17')](_0x0c33('0x33'),_0x2b43ab[_0x0c33('0x26')],_0x2b43ab['extension'],parseInt(_0x2b43ab[_0x0c33('0x28')],0xa)+0x1));_0x2b43ab[_0x0c33('0x34')](_0x2b43ab[_0x0c33('0x26')],_0x2b43ab[_0x0c33('0x27')],parseInt(_0x2b43ab[_0x0c33('0x28')],0xa)+0x1);_0x2b43ab[_0x0c33('0x35')]();}function handleNotFound(_0x3ec01a){logger[_0x0c33('0x9')](util[_0x0c33('0x17')](_0x0c33('0x36'),_0x3ec01a[_0x0c33('0x1b')]));_0x3ec01a[_0x0c33('0x34')](_0x3ec01a['context'],_0x3ec01a[_0x0c33('0x27')],parseInt(_0x3ec01a[_0x0c33('0x28')],0xa)+0x1);_0x3ec01a['close']();}function handleUnpublished(_0x465682){logger[_0x0c33('0x9')](util[_0x0c33('0x17')](_0x0c33('0x37'),_0x465682[_0x0c33('0x1b')]));_0x465682['continueAt'](_0x465682[_0x0c33('0x26')],_0x465682['extension'],parseInt(_0x465682[_0x0c33('0x28')],0xa)+0x1);_0x465682[_0x0c33('0x35')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xd213=['addEdge','source','target','toJson','mxGraphModel','inspect','production','debug','root','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','callerid','dnid','uniqueid','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','isUndefined','toString','error','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[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\x20found','exports','lodash','moment','xml2json','../../config/logger','agi','./rpc','./graph','./vertices','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','omit','mxCell','isArray','length'];(function(_0xb62013,_0x115b81){var _0x6956fd=function(_0x265125){while(--_0x265125){_0xb62013['push'](_0xb62013['shift']());}};_0x6956fd(++_0x115b81);}(_0xd213,0xa7));var _0x3d21=function(_0x23fab5,_0x36e4ff){_0x23fab5=_0x23fab5-0x0;var _0x49c7b8=_0xd213[_0x23fab5];return _0x49c7b8;};'use strict';var _=require(_0x3d21('0x0'));var moment=require(_0x3d21('0x1'));var parser=require(_0x3d21('0x2'));var util=require('util');var logger=require(_0x3d21('0x3'))(_0x3d21('0x4'));var rpc=require(_0x3d21('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0x3d21('0x6'));var Vertices=require(_0x3d21('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x3d21('0x8')](function(_0x207e40){logger['error'](_0x3d21('0x9'),_0x207e40[_0x3d21('0xa')]);return[];});}function addVertex(_0x192a52,_0x376d80,_0x36448e){_0x376d80[_0x3d21('0xb')]=_0x36448e;if(_0x376d80[_0x3d21('0xc')](_0x3d21('0xd'))){_0x376d80[_0x3d21('0xe')]=parseInt(_0x376d80[_0x3d21('0xd')],0xa);}_0x192a52['addVertex'](_[_0x3d21('0xf')](_0x376d80,_0x3d21('0x10')));}function initGraph(_0x151b98,_0x1a0448){var _0x22c347=new Graph();for(var _0x1f7386 in _0x151b98){if(_0x151b98[_0x3d21('0xc')](_0x1f7386)){if(_[_0x3d21('0x11')](_0x151b98[_0x1f7386])){for(var _0x519d4f=0x0;_0x519d4f<_0x151b98[_0x1f7386][_0x3d21('0x12')];_0x519d4f+=0x1){addVertex(_0x22c347,_0x151b98[_0x1f7386][_0x519d4f],_0x1f7386);}}else{addVertex(_0x22c347,_0x151b98[_0x1f7386],_0x1f7386);}}}for(var _0x2157fb=0x0;_0x2157fb<_0x1a0448[_0x3d21('0x12')];_0x2157fb+=0x1){if(_0x1a0448[_0x2157fb]['source']&&_0x1a0448[_0x2157fb]['target']){_0x22c347[_0x3d21('0x13')](_0x1a0448[_0x2157fb][_0x3d21('0x14')],_0x1a0448[_0x2157fb][_0x3d21('0x15')],_0x1a0448[_0x2157fb]['value']);}}return _0x22c347;}function getRoot(_0x40ff85){return parser[_0x3d21('0x16')](_0x40ff85,{'object':!![]})[_0x3d21('0x17')]['root'];}function inspect(_0x387ef9){return util[_0x3d21('0x18')](_0x387ef9,{'showHidden':![],'depth':null});}function initialize(_0xf10abd,_0x287a87){var _0xd82447=getRoot(_0xf10abd[_0x3d21('0x19')]);if(!_0xd82447||!_0xd82447['start'])return;var _0x458867,_0x15b75c,_0x55096e;logger[_0x3d21('0x1a')](_0x3d21('0x1b'),JSON[_0x3d21('0x1c')](_0xd82447,null,0x2));_0x287a87[_0x3d21('0x1d')]=moment()[_0x3d21('0x1e')](_0x3d21('0x1f'));_0x458867=initGraph(_[_0x3d21('0xf')](_0xd82447,_0x3d21('0x10')),_0xd82447['mxCell']);_0x15b75c=new Vertices(_0x287a87,rpc,mailRpc);logger[_0x3d21('0x20')](util[_0x3d21('0x1e')](_0x3d21('0x21'),_0x287a87[_0x3d21('0x22')],_0x287a87['calleridname'],_0x287a87[_0x3d21('0x23')],_0x287a87[_0x3d21('0x24')],_0x287a87[_0x3d21('0x25')]));_0x458867[_0x3d21('0x26')](_0xd82447['start']['id'],function(_0x4597ef){try{_0x4597ef=_0x15b75c[_0x3d21('0x27')](_0x4597ef);logger[_0x3d21('0x1a')](_0x3d21('0x28'),JSON[_0x3d21('0x1c')](_0x4597ef,null,0x2));if(_0x4597ef['agicommand']===_0x3d21('0x29')){logger[_0x3d21('0x20')](_0x3d21('0x2a'));_0x287a87[_0x3d21('0x2b')]=_0x4597ef[_0x3d21('0x2b')]||_0x287a87[_0x3d21('0x2b')];_0x287a87[_0x3d21('0x2c')]=_0x4597ef[_0x3d21('0x2c')];_0x287a87[_0x3d21('0x2d')]=_0x4597ef[_0x3d21('0x2d')]?_0x4597ef['priority']-0x1:0x1;return null;}else if(_0x4597ef&&_0x15b75c[_0x4597ef[_0x3d21('0xb')]]){_0x55096e=_0x15b75c[_0x4597ef[_0x3d21('0xb')]](_0x4597ef);logger[_0x3d21('0x20')](_0x3d21('0x2e'),JSON[_0x3d21('0x1c')](_0x55096e,null,0x2));if(_0x55096e&&_0x55096e[_0x3d21('0x2f')]===AGI_CODE_SUCCESS&&_0x55096e[_0x3d21('0x30')]!==AGI_RESULT_ERROR&&!_0x287a87[_0x3d21('0x31')]){logger[_0x3d21('0x1a')](_0x3d21('0x2e'),inspect(_0x55096e));return _[_0x3d21('0x32')](_0x55096e[_0x3d21('0x30')])?null:_0x55096e[_0x3d21('0x30')][_0x3d21('0x33')]();}else{logger[_0x3d21('0x34')](_0x3d21('0x2e'),inspect(_0x55096e));return null;}}else{logger[_0x3d21('0x34')](_0x3d21('0x35'));return null;}}catch(_0xc4bcfe){logger[_0x3d21('0x34')](_0xc4bcfe[_0x3d21('0xa')]);return null;}});if(_0xd82447[_0x3d21('0x36')]){logger['info'](util[_0x3d21('0x1e')](_0x3d21('0x37'),_0x287a87[_0x3d21('0x22')],_0x287a87[_0x3d21('0x38')],_0x287a87[_0x3d21('0x23')],_0x287a87[_0x3d21('0x24')],_0x287a87[_0x3d21('0x25')]));_0x458867[_0x3d21('0x26')](_0xd82447[_0x3d21('0x36')]['id'],function(_0x30d3cc){try{_0x30d3cc=_0x15b75c[_0x3d21('0x27')](_0x30d3cc);logger['debug'](_0x3d21('0x28'),JSON[_0x3d21('0x1c')](_0x30d3cc,null,0x2));if(_0x30d3cc&&_0x15b75c[_0x30d3cc[_0x3d21('0xb')]]){_0x55096e=_0x15b75c[_0x30d3cc['agicommand']](_0x30d3cc);if(_0x55096e){logger['debug']('response',inspect(_0x55096e));return _[_0x3d21('0x32')](_0x55096e['result'])?null:_0x55096e[_0x3d21('0x30')]['toString']();}else{logger[_0x3d21('0x34')](_0x3d21('0x2e'),inspect(_0x55096e));return null;}}else{logger[_0x3d21('0x34')]('agicommand\x20not\x20found');return null;}}catch(_0x2df95f){logger['error'](_0x2df95f['stack']);return null;}});}logger['info'](util['format'](_0x3d21('0x39'),_0x287a87[_0x3d21('0x22')],_0x287a87[_0x3d21('0x38')],_0x287a87[_0x3d21('0x23')],_0x287a87[_0x3d21('0x24')],_0x287a87[_0x3d21('0x25')]));logger[_0x3d21('0x20')](util[_0x3d21('0x1e')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x287a87[_0x3d21('0x2b')],_0x287a87[_0x3d21('0x2c')],parseInt(_0x287a87[_0x3d21('0x2d')],0xa)+0x1));_0x287a87[_0x3d21('0x3a')](_0x287a87[_0x3d21('0x2b')],_0x287a87[_0x3d21('0x2c')],parseInt(_0x287a87[_0x3d21('0x2d')],0xa)+0x1);_0x287a87[_0x3d21('0x3b')]();}function handleNotFound(_0x1ab3bf){logger[_0x3d21('0x34')](util[_0x3d21('0x1e')](_0x3d21('0x3c'),_0x1ab3bf['arg_1']));_0x1ab3bf[_0x3d21('0x3a')](_0x1ab3bf['context'],_0x1ab3bf[_0x3d21('0x2c')],parseInt(_0x1ab3bf[_0x3d21('0x2d')],0xa)+0x1);_0x1ab3bf[_0x3d21('0x3b')]();}function handleUnpublished(_0x4b21f9){logger['error'](util[_0x3d21('0x1e')]('Project\x20%s\x20not\x20published',_0x4b21f9[_0x3d21('0x22')]));_0x4b21f9[_0x3d21('0x3a')](_0x4b21f9[_0x3d21('0x2b')],_0x4b21f9[_0x3d21('0x2c')],parseInt(_0x4b21f9[_0x3d21('0x2d')],0xa)+0x1);_0x4b21f9['close']();}module[_0x3d21('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 424e0a3..ccbb377 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 _0x3571=['exports','Transform','call','_localBuffer','prototype','_transform','toString','_inBody','indexOf','substring','length','split','slice','trim','headers','emit','line'];(function(_0x146317,_0x3388e1){var _0x6f0e41=function(_0x15d808){while(--_0x15d808){_0x146317['push'](_0x146317['shift']());}};_0x6f0e41(++_0x3388e1);}(_0x3571,0xde));var _0x1357=function(_0xe84805,_0x2702d9){_0xe84805=_0xe84805-0x0;var _0x398efd=_0x3571[_0xe84805];return _0x398efd;};'use strict';var util=require('util');var Transform=require('stream')[_0x1357('0x0')];function AGIReply(_0x458ff2){Transform[_0x1357('0x1')](this,_0x458ff2);this[_0x1357('0x2')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x1357('0x3')][_0x1357('0x4')]=function(_0x2870c5,_0x4fac50,_0x5134b1){var _0x3feaf7='\x0a',_0x13c95a=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x5842b6=-0x1,_0x2043ee=-0x1,_0x580386='',_0x8ee3e3=0x0,_0x8e7a9b='',_0x150c7d='';this[_0x1357('0x2')]+=_0x2870c5[_0x1357('0x5')]();_0x8e7a9b=this['_localBuffer'];if(!this[_0x1357('0x6')]){_0x8ee3e3=0x0;while(_0x13c95a[_0x8ee3e3]){while((_0x2043ee=_0x8e7a9b[_0x1357('0x7')](_0x13c95a[_0x8ee3e3]))!=-0x1){_0x580386=_0x13c95a[_0x8ee3e3];_0x150c7d=_0x8e7a9b[_0x1357('0x8')](0x0,_0x2043ee);_0x8e7a9b=_0x8e7a9b['substring'](_0x2043ee+_0x580386[_0x1357('0x9')]);var _0x111e90=_0x150c7d[_0x1357('0xa')](_0x3feaf7),_0x53da70=0x0,_0x27ca4d={},_0x515ad9='',_0x55f086='',_0x38b786=-0x1;while(_0x111e90[_0x53da70]){_0x38b786=_0x111e90[_0x53da70][_0x1357('0x7')](':');if(_0x38b786!=-0x1){_0x515ad9=_0x111e90[_0x53da70][_0x1357('0xb')](0x0,_0x38b786)[_0x1357('0xc')]();_0x55f086=_0x111e90[_0x53da70][_0x1357('0xb')](_0x38b786+0x1)['trim']();if(_0x515ad9['length']>0x0){_0x27ca4d[_0x515ad9]=_0x55f086;}}else{}_0x53da70++;}this['emit'](_0x1357('0xd'),_0x27ca4d);this[_0x1357('0x6')]=!![];}_0x8ee3e3++;}this[_0x1357('0x2')]=_0x8e7a9b;}else{while((_0x5842b6=_0x8e7a9b[_0x1357('0x7')](_0x3feaf7))!=-0x1){_0x150c7d=_0x8e7a9b[_0x1357('0x8')](0x0,_0x5842b6);this[_0x1357('0xe')](_0x1357('0xf'),_0x150c7d);_0x8e7a9b=_0x8e7a9b[_0x1357('0x8')](_0x5842b6+_0x3feaf7['length']);}this[_0x1357('0x2')]=_0x8e7a9b;}_0x5134b1();};module[_0x1357('0x10')]=AGIReply; \ No newline at end of file +var _0xb5b1=['indexOf','substring','length','split','trim','emit','line','exports','util','call','inherits','prototype','\x0d\x0a\x0d\x0a','_localBuffer','_inBody'];(function(_0x34c98,_0x1b526f){var _0x520052=function(_0x4ea363){while(--_0x4ea363){_0x34c98['push'](_0x34c98['shift']());}};_0x520052(++_0x1b526f);}(_0xb5b1,0xcb));var _0x1b5b=function(_0x3849d4,_0x394083){_0x3849d4=_0x3849d4-0x0;var _0x5238ed=_0xb5b1[_0x3849d4];return _0x5238ed;};'use strict';var util=require(_0x1b5b('0x0'));var Transform=require('stream')['Transform'];function AGIReply(_0x4b6be3){Transform[_0x1b5b('0x1')](this,_0x4b6be3);this['_localBuffer']='';this['_inBody']=![];}util[_0x1b5b('0x2')](AGIReply,Transform);AGIReply[_0x1b5b('0x3')]['_transform']=function(_0x4ce921,_0x8113bf,_0x7c7b3){var _0x2bc562='\x0a',_0x128b94=['\x0a\x0a',_0x1b5b('0x4')],_0x4f0c42=-0x1,_0x3ccad2=-0x1,_0x31a4e2='',_0x3da5ee=0x0,_0x409f88='',_0x6ead91='';this[_0x1b5b('0x5')]+=_0x4ce921['toString']();_0x409f88=this[_0x1b5b('0x5')];if(!this[_0x1b5b('0x6')]){_0x3da5ee=0x0;while(_0x128b94[_0x3da5ee]){while((_0x3ccad2=_0x409f88[_0x1b5b('0x7')](_0x128b94[_0x3da5ee]))!=-0x1){_0x31a4e2=_0x128b94[_0x3da5ee];_0x6ead91=_0x409f88[_0x1b5b('0x8')](0x0,_0x3ccad2);_0x409f88=_0x409f88['substring'](_0x3ccad2+_0x31a4e2[_0x1b5b('0x9')]);var _0x44d160=_0x6ead91[_0x1b5b('0xa')](_0x2bc562),_0x29c84f=0x0,_0x13c4d9={},_0x130678='',_0x323b6d='',_0x592053=-0x1;while(_0x44d160[_0x29c84f]){_0x592053=_0x44d160[_0x29c84f]['indexOf'](':');if(_0x592053!=-0x1){_0x130678=_0x44d160[_0x29c84f]['slice'](0x0,_0x592053)[_0x1b5b('0xb')]();_0x323b6d=_0x44d160[_0x29c84f]['slice'](_0x592053+0x1)['trim']();if(_0x130678['length']>0x0){_0x13c4d9[_0x130678]=_0x323b6d;}}else{}_0x29c84f++;}this[_0x1b5b('0xc')]('headers',_0x13c4d9);this['_inBody']=!![];}_0x3da5ee++;}this[_0x1b5b('0x5')]=_0x409f88;}else{while((_0x4f0c42=_0x409f88['indexOf'](_0x2bc562))!=-0x1){_0x6ead91=_0x409f88[_0x1b5b('0x8')](0x0,_0x4f0c42);this[_0x1b5b('0xc')](_0x1b5b('0xd'),_0x6ead91);_0x409f88=_0x409f88['substring'](_0x4f0c42+_0x2bc562[_0x1b5b('0x9')]);}this[_0x1b5b('0x5')]=_0x409f88;}_0x7c7b3();};module[_0x1b5b('0xe')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 8987929..1cb1f88 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 _0x26cf=['name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getVariableById','ShowVariable','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','ShowSound','ShowInterval','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','then','getPauseById','ShowPause','LoginUser','PauseUser','UnpauseUser','agentLogout','LogoutUser','moment','jayson/promise','http','request','error','message','result','catch','GetSquareProjects'];(function(_0x589589,_0x58793c){var _0x1f7366=function(_0x24a50c){while(--_0x24a50c){_0x589589['push'](_0x589589['shift']());}};_0x1f7366(++_0x58793c);}(_0x26cf,0x135));var _0xf26c=function(_0x55d9fd,_0x4c9a51){_0x55d9fd=_0x55d9fd-0x0;var _0x68e43f=_0x26cf[_0x55d9fd];return _0x68e43f;};'use strict';var _=require('lodash');var moment=require(_0xf26c('0x0'));var jayson=require(_0xf26c('0x1'));var client=jayson['client'][_0xf26c('0x2')]({'port':0x2329});function request(_0x5357ce,_0x1a6d9c){return new Promise(function(_0x4c414f,_0x314cdf){return client[_0xf26c('0x3')](_0x5357ce,_0x1a6d9c)['then'](function(_0x1c3d77){if(_0x1c3d77[_0xf26c('0x4')]){return _0x314cdf(_0x1c3d77[_0xf26c('0x4')][_0xf26c('0x5')]);}else{return _0x4c414f(_0x1c3d77[_0xf26c('0x6')]);}})[_0xf26c('0x7')](function(_0x4c1dc7){return _0x314cdf(_0x4c1dc7);});});}exports['getSquareProjects']=function(){return request(_0xf26c('0x8'),{'options':{'raw':![],'attributes':['id',_0xf26c('0x9'),_0xf26c('0xa')]}});};exports[_0xf26c('0xb')]=function(_0x3e1c2c){return request(_0xf26c('0xc'),{'options':{'raw':![],'where':{'name':_0x3e1c2c},'attributes':[_0xf26c('0xa')]}});};exports[_0xf26c('0xd')]=function(_0x5ba445){return request(_0xf26c('0xe'),{'options':{'raw':![],'where':{'id':_0x5ba445},'include':[{'model':_0xf26c('0xf'),'as':_0xf26c('0x10'),'include':[{'model':_0xf26c('0x11'),'as':_0xf26c('0x11')}]}],'attributes':['id','name',_0xf26c('0x12')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x2cb8ae){return request('ShowSquareProject',{'options':{'where':{'id':_0x2cb8ae},'attributes':[_0xf26c('0x9')]}});};exports['getVoiceQueueById']=function(_0x55166b){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x55166b},'attributes':[_0xf26c('0x9')]}});};exports[_0xf26c('0x13')]=function(_0x2314b7){return request(_0xf26c('0x14'),{'options':{'where':{'id':_0x2314b7},'attributes':['name']}});};exports['getSquareOdbcById']=function(_0x181db8){return request(_0xf26c('0x15'),{'options':{'where':{'id':_0x181db8},'attributes':['dsn']}});};exports[_0xf26c('0x16')]=function(_0x7cb19e){return request(_0xf26c('0x17'),{'options':{'where':{'id':_0x7cb19e},'attributes':[_0xf26c('0x9')]}});};exports[_0xf26c('0x18')]=function(_0x570bfb){return request(_0xf26c('0x19'),{'options':{'where':{'phone':_0x570bfb[_0xf26c('0x1a')]},'attributes':['id']}});};exports[_0xf26c('0x1b')]=function(_0x36e59d){return request(_0xf26c('0x1c'),{'options':{'where':{'id':_0x36e59d},'attributes':[_0xf26c('0x9')]}});};exports['getSoundById']=function(_0x25a06a){return request(_0xf26c('0x1d'),{'options':{'where':{'id':_0x25a06a},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x15b059){return request(_0xf26c('0x1e'),{'options':{'raw':![],'where':{'id':_0x15b059},'include':[{'model':'Interval','as':'Intervals'}]}});};exports[_0xf26c('0x1f')]=function(_0x265cc3){return request(_0xf26c('0x20'),{'options':{'where':{'id':_0x265cc3},'attributes':['id','name']}});};exports[_0xf26c('0x21')]=function(_0x146991){return request('CreateSmsMessage',{'body':_0x146991});};exports[_0xf26c('0x22')]=function(_0x4e2366){return request(_0xf26c('0x23'),{'body':_0x4e2366});};exports[_0xf26c('0x24')]=function(_0x4f1d4d){return request(_0xf26c('0x25'),{'body':_['merge'](_0x4f1d4d,{'project_name':_0x4f1d4d['arg_1'],'prev_project_name':_0x4f1d4d[_0xf26c('0x26')]||'','is_subproject':_0x4f1d4d[_0xf26c('0x26')]?!![]:![],'leaveAt':moment()[_0xf26c('0x27')](_0xf26c('0x28'))})});};exports[_0xf26c('0x29')]=function(_0x373742){return request('CreateSquareRecording',{'body':_0x373742});};exports['createSquareMessage']=function(_0x2b93d2){return request(_0xf26c('0x2a'),{'body':_0x2b93d2});};exports[_0xf26c('0x2b')]=function(_0x33379b){return request(_0xf26c('0x2c'),{'options':{'raw':![],'where':{'phone':_0x33379b['phone'],'ListId':_0x33379b['ListId']}}})[_0xf26c('0x2d')](function(_0x4bcd8e){if(_0x4bcd8e){return _0x4bcd8e;}return request('CreateCmContact',{'body':_0x33379b});});};exports[_0xf26c('0x2e')]=function(_0x6cd75e){return request(_0xf26c('0x2f'),{'options':{'where':{'id':_0x6cd75e},'attributes':[_0xf26c('0x9')]}});};exports['agentLogin']=function(_0x191377,_0x2545a4){return request(_0xf26c('0x30'),{'body':{'interface':_0x2545a4},'options':{'where':_0x191377}});};exports['agentPause']=function(_0x495a81,_0x4df472,_0x2653ce){return request(_0xf26c('0x31'),{'body':{'type':_0x4df472,'uniqueid':_0x2653ce},'options':{'where':_0x495a81}});};exports['agentUnpause']=function(_0x187ae8){return request(_0xf26c('0x32'),{'body':{},'options':{'where':_0x187ae8}});};exports[_0xf26c('0x33')]=function(_0x1a66ff){return request(_0xf26c('0x34'),{'body':{},'options':{'where':_0x1a66ff}});}; \ No newline at end of file +var _0x3379=['error','result','getSquareProjects','GetSquareProjects','name','production','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getSquareOdbcById','ShowSquareOdbc','getUserById','getContactByPhone','phone','getTrunkById','ShowTrunk','ShowSound','Interval','getSmsAccountById','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage','createCmContact','ListId','CreateCmContact','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','then'];(function(_0x38d367,_0x54d472){var _0x3c4f63=function(_0xbe432f){while(--_0xbe432f){_0x38d367['push'](_0x38d367['shift']());}};_0x3c4f63(++_0x54d472);}(_0x3379,0x115));var _0x9337=function(_0x481111,_0x28d3c5){_0x481111=_0x481111-0x0;var _0x5ee527=_0x3379[_0x481111];return _0x5ee527;};'use strict';var _=require(_0x9337('0x0'));var moment=require(_0x9337('0x1'));var jayson=require(_0x9337('0x2'));var client=jayson[_0x9337('0x3')]['http']({'port':0x2329});function request(_0x369104,_0x39545){return new Promise(function(_0x144317,_0x30dcfe){return client['request'](_0x369104,_0x39545)[_0x9337('0x4')](function(_0x192812){if(_0x192812[_0x9337('0x5')]){return _0x30dcfe(_0x192812[_0x9337('0x5')]['message']);}else{return _0x144317(_0x192812[_0x9337('0x6')]);}})['catch'](function(_0x268943){return _0x30dcfe(_0x268943);});});}exports[_0x9337('0x7')]=function(){return request(_0x9337('0x8'),{'options':{'raw':![],'attributes':['id',_0x9337('0x9'),_0x9337('0xa')]}});};exports['getSquareProject']=function(_0xd9b084){return request(_0x9337('0xb'),{'options':{'raw':![],'where':{'name':_0xd9b084},'attributes':[_0x9337('0xa')]}});};exports[_0x9337('0xc')]=function(_0x26995d){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x26995d},'include':[{'model':_0x9337('0xd'),'as':_0x9337('0xe'),'include':[{'model':_0x9337('0xf'),'as':_0x9337('0xf')}]}],'attributes':['id',_0x9337('0x9'),_0x9337('0x10')],'smtp':!![]}});};exports[_0x9337('0x11')]=function(_0x4f2fc4){return request('ShowSquareProject',{'options':{'where':{'id':_0x4f2fc4},'attributes':[_0x9337('0x9')]}});};exports[_0x9337('0x12')]=function(_0x12f1f1){return request(_0x9337('0x13'),{'options':{'where':{'id':_0x12f1f1},'attributes':['name']}});};exports['getVariableById']=function(_0x13515e){return request('ShowVariable',{'options':{'where':{'id':_0x13515e},'attributes':['name']}});};exports[_0x9337('0x14')]=function(_0x13a207){return request(_0x9337('0x15'),{'options':{'where':{'id':_0x13a207},'attributes':['dsn']}});};exports[_0x9337('0x16')]=function(_0x25633f){return request('ShowUser',{'options':{'where':{'id':_0x25633f},'attributes':['name']}});};exports[_0x9337('0x17')]=function(_0x462196){return request('GetContactByPhone',{'options':{'where':{'phone':_0x462196[_0x9337('0x18')]},'attributes':['id']}});};exports[_0x9337('0x19')]=function(_0x4e9802){return request(_0x9337('0x1a'),{'options':{'where':{'id':_0x4e9802},'attributes':[_0x9337('0x9')]}});};exports['getSoundById']=function(_0x1b8753){return request(_0x9337('0x1b'),{'options':{'where':{'id':_0x1b8753},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x28a237){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x28a237},'include':[{'model':_0x9337('0x1c'),'as':'Intervals'}]}});};exports[_0x9337('0x1d')]=function(_0x5768d5){return request('ShowSmsAccount',{'options':{'where':{'id':_0x5768d5},'attributes':['id',_0x9337('0x9')]}});};exports['createSmsMessage']=function(_0xe4b053){return request('CreateSmsMessage',{'body':_0xe4b053});};exports[_0x9337('0x1e')]=function(_0x332238){return request(_0x9337('0x1f'),{'body':_0x332238});};exports[_0x9337('0x20')]=function(_0x125af7){return request(_0x9337('0x21'),{'body':_['merge'](_0x125af7,{'project_name':_0x125af7['arg_1'],'prev_project_name':_0x125af7[_0x9337('0x22')]||'','is_subproject':_0x125af7[_0x9337('0x22')]?!![]:![],'leaveAt':moment()[_0x9337('0x23')](_0x9337('0x24'))})});};exports['createSquareRecording']=function(_0x453f19){return request('CreateSquareRecording',{'body':_0x453f19});};exports[_0x9337('0x25')]=function(_0x3d4b08){return request(_0x9337('0x26'),{'body':_0x3d4b08});};exports[_0x9337('0x27')]=function(_0x4da717){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x4da717[_0x9337('0x18')],'ListId':_0x4da717[_0x9337('0x28')]}}})[_0x9337('0x4')](function(_0x263ff1){if(_0x263ff1){return _0x263ff1;}return request(_0x9337('0x29'),{'body':_0x4da717});});};exports['getPauseById']=function(_0x333b99){return request('ShowPause',{'options':{'where':{'id':_0x333b99},'attributes':[_0x9337('0x9')]}});};exports['agentLogin']=function(_0x4d5c20,_0x554c47){return request('LoginUser',{'body':{'interface':_0x554c47},'options':{'where':_0x4d5c20}});};exports[_0x9337('0x2a')]=function(_0x3f1006,_0xd4afec,_0x8ca74c){return request(_0x9337('0x2b'),{'body':{'type':_0xd4afec,'uniqueid':_0x8ca74c},'options':{'where':_0x3f1006}});};exports['agentUnpause']=function(_0x47f137){return request(_0x9337('0x2c'),{'body':{},'options':{'where':_0x47f137}});};exports[_0x9337('0x2d')]=function(_0x2e709e){return request(_0x9337('0x2e'),{'body':{},'options':{'where':_0x2e709e}});}; \ 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 ed94efc..98df29c 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 _0x5b5a=['exports','./lex'];(function(_0x314a8c,_0x1c2e8d){var _0x1d4607=function(_0x3df20c){while(--_0x3df20c){_0x314a8c['push'](_0x314a8c['shift']());}};_0x1d4607(++_0x1c2e8d);}(_0x5b5a,0xc3));var _0xa5b5=function(_0x4a9e4a,_0x585df1){_0x4a9e4a=_0x4a9e4a-0x0;var _0xaa903e=_0x5b5a[_0x4a9e4a];return _0xaa903e;};var polly=require('./polly');var lex=require(_0xa5b5('0x0'));module[_0xa5b5('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x0eb2=['./polly','exports'];(function(_0x3ab928,_0x2b990b){var _0xf47692=function(_0x311b8e){while(--_0x311b8e){_0x3ab928['push'](_0x3ab928['shift']());}};_0xf47692(++_0x2b990b);}(_0x0eb2,0x11c));var _0x20eb=function(_0x3c4c6e,_0x59ff43){_0x3c4c6e=_0x3c4c6e-0x0;var _0x1d0ab7=_0x0eb2[_0x3c4c6e];return _0x1d0ab7;};var polly=require(_0x20eb('0x0'));var lex=require('./lex');module[_0x20eb('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 6719c07..22515b4 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 _0x5ff3=['exports'];(function(_0x457bce,_0x3c872c){var _0x2fdef3=function(_0x23f05c){while(--_0x23f05c){_0x457bce['push'](_0x457bce['shift']());}};_0x2fdef3(++_0x3c872c);}(_0x5ff3,0x17d));var _0x35ff=function(_0x8f881b,_0x52540c){_0x8f881b=_0x8f881b-0x0;var _0x120464=_0x5ff3[_0x8f881b];return _0x120464;};'use strict';var lex=require('./lib/api');module[_0x35ff('0x0')]=function(_0x48cbf7,_0x1763a,_0x47c98d,_0x380f54,_0x1bb200,_0x3bd66a){return lex(_0x48cbf7,_0x1763a,_0x47c98d,_0x380f54,_0x1bb200,_0x3bd66a);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x2936e7,_0x2afa91,_0x27405a,_0x305d85,_0x864539,_0x52b5fb){return lex(_0x2936e7,_0x2afa91,_0x27405a,_0x305d85,_0x864539,_0x52b5fb);}; \ 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 15d7d11..2a27d44 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(_0x11dcfe,_0x18ff5f){var _0x2d09e1=function(_0x54a3a2){while(--_0x54a3a2){_0x11dcfe['push'](_0x11dcfe['shift']());}};_0x2d09e1(++_0x18ff5f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x2bf57e,_0x27df65){var _0x5a2e76=function(_0x586211){while(--_0x586211){_0x2bf57e['push'](_0x2bf57e['shift']());}};_0x5a2e76(++_0x27df65);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 328df99..2aaad99 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 _0x1a5f=['./lib/api'];(function(_0x3bf8be,_0x5e8a19){var _0x164183=function(_0x529794){while(--_0x529794){_0x3bf8be['push'](_0x3bf8be['shift']());}};_0x164183(++_0x5e8a19);}(_0x1a5f,0xb3));var _0xf1a5=function(_0x16d69e,_0x36d10e){_0x16d69e=_0x16d69e-0x0;var _0x5418a0=_0x1a5f[_0x16d69e];return _0x5418a0;};'use strict';var polly=require(_0xf1a5('0x0'));module['exports']=function(_0x44cbd6,_0x4bf17f,_0x394121,_0x7cde33,_0x130a99,_0x338826,_0x5f0618){return polly(_0x44cbd6,_0x4bf17f,_0x394121,_0x7cde33,_0x130a99,_0x338826,_0x5f0618);}; \ No newline at end of file +var _0xb3c9=['exports','./lib/api'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xb3c9,0x103));var _0x9b3c=function(_0x363c0f,_0x145279){_0x363c0f=_0x363c0f-0x0;var _0x1d8f41=_0xb3c9[_0x363c0f];return _0x1d8f41;};'use strict';var polly=require(_0x9b3c('0x0'));module[_0x9b3c('0x1')]=function(_0x10ac39,_0x3eeede,_0x4972e8,_0x1b853c,_0x4c015b,_0x36a89b,_0x5afe69){return polly(_0x10ac39,_0x3eeede,_0x4972e8,_0x1b853c,_0x4c015b,_0x36a89b,_0x5afe69);}; \ 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 a7d14e9..96b32b9 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 _0xe00b=['aws-sdk','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','bluebird','randomstring'];(function(_0x1c1b8c,_0x4c253d){var _0x1ee4c4=function(_0xb9bff5){while(--_0xb9bff5){_0x1c1b8c['push'](_0x1c1b8c['shift']());}};_0x1ee4c4(++_0x4c253d);}(_0xe00b,0x9e));var _0xbe00=function(_0x14a308,_0x3ddb27){_0x14a308=_0x14a308-0x0;var _0x36a0a0=_0xe00b[_0x14a308];return _0x36a0a0;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xbe00('0x0'));var rs=require(_0xbe00('0x1'));var AWS=require(_0xbe00('0x2'));function pollyResult(_0x57fd2e,_0x19fa79,_0x1c4885){return new BPromise(function(_0x8be6f0,_0xea8730){_0x57fd2e['synthesizeSpeech'](_0x19fa79,function(_0x20c5d6,_0x42c3ae){if(_0x20c5d6){_0xea8730(_0x20c5d6);}else if(_0x42c3ae){if(_0x42c3ae['AudioStream']instanceof Buffer){fs[_0xbe00('0x3')](_0x1c4885,_0x42c3ae['AudioStream'],function(_0x4e88b5){if(_0x4e88b5){_0xea8730(_0x4e88b5);}else{_0x8be6f0();}});}else{_0xea8730(new Error(_0xbe00('0x4')));}}else{_0xea8730(new Error(_0xbe00('0x5')));}});});}module[_0xbe00('0x6')]=function(_0x420d3e,_0x380158,_0x179b6b,_0x555471,_0x109619,_0x52707a,_0x28a898){var _0x5d4fed=new AWS['Polly']({'accessKeyId':_0x420d3e,'secretAccessKey':_0x380158,'region':_0x179b6b});var _0x507502={'Text':_0x109619,'TextType':_0x52707a||_0xbe00('0x7'),'OutputFormat':'mp3','VoiceId':_0x555471};return pollyResult(_0x5d4fed,_0x507502,_0x28a898);}; \ No newline at end of file +var _0x0fc9=['synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','path','bluebird','randomstring','aws-sdk'];(function(_0x4492af,_0x47e25d){var _0x216729=function(_0x4964c8){while(--_0x4964c8){_0x4492af['push'](_0x4492af['shift']());}};_0x216729(++_0x47e25d);}(_0x0fc9,0xa1));var _0x90fc=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0fc9[_0x6c993a];return _0x27f547;};'use strict';var fs=require('fs');var path=require(_0x90fc('0x0'));var BPromise=require(_0x90fc('0x1'));var rs=require(_0x90fc('0x2'));var AWS=require(_0x90fc('0x3'));function pollyResult(_0x4965da,_0x46e1c8,_0x1d28e2){return new BPromise(function(_0x3831d1,_0x2f92ff){_0x4965da[_0x90fc('0x4')](_0x46e1c8,function(_0x506acc,_0x522590){if(_0x506acc){_0x2f92ff(_0x506acc);}else if(_0x522590){if(_0x522590['AudioStream']instanceof Buffer){fs[_0x90fc('0x5')](_0x1d28e2,_0x522590[_0x90fc('0x6')],function(_0x1dddf0){if(_0x1dddf0){_0x2f92ff(_0x1dddf0);}else{_0x3831d1();}});}else{_0x2f92ff(new Error(_0x90fc('0x7')));}}else{_0x2f92ff(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x90fc('0x8')]=function(_0x5ab053,_0xd8c765,_0x36d1b5,_0x115397,_0x2b7684,_0x237e46,_0x454f38){var _0x350833=new AWS[(_0x90fc('0x9'))]({'accessKeyId':_0x5ab053,'secretAccessKey':_0xd8c765,'region':_0x36d1b5});var _0x3eb206={'Text':_0x2b7684,'TextType':_0x237e46||_0x90fc('0xa'),'OutputFormat':'mp3','VoiceId':_0x115397};return pollyResult(_0x350833,_0x3eb206,_0x454f38);}; \ 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 27f7fc4..1135d0b 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 _0x3d96=['exports'];(function(_0x419a2f,_0x39e70a){var _0x4d9d0a=function(_0x263cf2){while(--_0x263cf2){_0x419a2f['push'](_0x419a2f['shift']());}};_0x4d9d0a(++_0x39e70a);}(_0x3d96,0xc8));var _0x63d9=function(_0x2d551d,_0x51179f){_0x2d551d=_0x2d551d-0x0;var _0x9c833d=_0x3d96[_0x2d551d];return _0x9c833d;};'use strict';var asr=require('./lib/api');module[_0x63d9('0x0')]=function(_0x366080,_0x156149,_0x57d7ee,_0x5a922f){return asr(_0x366080,_0x156149,_0x57d7ee);}; \ No newline at end of file +var _0x7bbb=['exports','./lib/api'];(function(_0x59659d,_0xb17019){var _0x2adbb5=function(_0x22ea94){while(--_0x22ea94){_0x59659d['push'](_0x59659d['shift']());}};_0x2adbb5(++_0xb17019);}(_0x7bbb,0x11b));var _0xb7bb=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x7bbb[_0xb0f7c3];return _0x28ea68;};'use strict';var asr=require(_0xb7bb('0x0'));module[_0xb7bb('0x1')]=function(_0x2ccf8d,_0x59921b,_0x482ffc,_0x583035){return asr(_0x2ccf8d,_0x59921b,_0x482ffc);}; \ 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 7ebcf7f..299775f 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 _0x8f37=['base64','POST','/v1/speech:recognize?key=','8000','url','bluebird','https://speech.googleapis.com','length','string','undefined','lang\x20should\x20be\x20a\x20string','toString'];(function(_0x3aa0f4,_0x49fa72){var _0x3ce03e=function(_0x47d449){while(--_0x47d449){_0x3aa0f4['push'](_0x3aa0f4['shift']());}};_0x3ce03e(++_0x49fa72);}(_0x8f37,0x190));var _0x78f3=function(_0x5ad584,_0x9b7eb1){_0x5ad584=_0x5ad584-0x0;var _0x4b7fb2=_0x8f37[_0x5ad584];return _0x4b7fb2;};'use strict';var url=require(_0x78f3('0x0'));var BPromise=require(_0x78f3('0x1'));var fs=require('fs');var host=_0x78f3('0x2');module['exports']=function(_0x542bc0,_0x2a7d93,_0x3c1fa6){return new BPromise(function(_0x3b0667,_0x539794){var _0x1d59a5;if(typeof _0x542bc0!=='string'||_0x542bc0[_0x78f3('0x3')]===0x0){return _0x539794('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x2a7d93!==_0x78f3('0x4')||_0x2a7d93[_0x78f3('0x3')]===0x0){return _0x539794('key\x20should\x20be\x20a\x20string');}if(typeof _0x3c1fa6!==_0x78f3('0x5')&&(typeof _0x3c1fa6!=='string'||_0x3c1fa6[_0x78f3('0x3')]===0x0)){return _0x539794(_0x78f3('0x6'));}try{_0x1d59a5=fs['readFileSync'](_0x542bc0)[_0x78f3('0x7')](_0x78f3('0x8'));}catch(_0x268525){return _0x539794(_0x268525);}return _0x3b0667({'method':_0x78f3('0x9'),'uri':host+_0x78f3('0xa')+_0x2a7d93,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x78f3('0xb'),'languageCode':_0x3c1fa6},'audio':{'content':_0x1d59a5}},'json':!![]});});}; \ No newline at end of file +var _0xac55=['8000','url','bluebird','https://speech.googleapis.com','exports','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','POST','LINEAR16'];(function(_0x1e7c2b,_0x4ca639){var _0x98b768=function(_0x293317){while(--_0x293317){_0x1e7c2b['push'](_0x1e7c2b['shift']());}};_0x98b768(++_0x4ca639);}(_0xac55,0x1c8));var _0x5ac5=function(_0x230031,_0x3f2174){_0x230031=_0x230031-0x0;var _0x435b0b=_0xac55[_0x230031];return _0x435b0b;};'use strict';var url=require(_0x5ac5('0x0'));var BPromise=require(_0x5ac5('0x1'));var fs=require('fs');var host=_0x5ac5('0x2');module[_0x5ac5('0x3')]=function(_0x5ac30d,_0x17b1d9,_0x13fcc6){return new BPromise(function(_0x192f9d,_0x1cdfec){var _0x3706ee;if(typeof _0x5ac30d!==_0x5ac5('0x4')||_0x5ac30d[_0x5ac5('0x5')]===0x0){return _0x1cdfec('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x17b1d9!=='string'||_0x17b1d9[_0x5ac5('0x5')]===0x0){return _0x1cdfec(_0x5ac5('0x6'));}if(typeof _0x13fcc6!==_0x5ac5('0x7')&&(typeof _0x13fcc6!==_0x5ac5('0x4')||_0x13fcc6[_0x5ac5('0x5')]===0x0)){return _0x1cdfec(_0x5ac5('0x8'));}try{_0x3706ee=fs[_0x5ac5('0x9')](_0x5ac30d)['toString']('base64');}catch(_0x2414f9){return _0x1cdfec(_0x2414f9);}return _0x192f9d({'method':_0x5ac5('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x17b1d9,'body':{'config':{'encoding':_0x5ac5('0xb'),'sampleRateHertz':_0x5ac5('0xc'),'languageCode':_0x13fcc6},'audio':{'content':_0x3706ee}},'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 112b70f..b2c552c 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 _0xb6c2=['exports','./asr'];(function(_0x3016dd,_0x554ed8){var _0x201a50=function(_0x24e1cf){while(--_0x24e1cf){_0x3016dd['push'](_0x3016dd['shift']());}};_0x201a50(++_0x554ed8);}(_0xb6c2,0xcb));var _0x2b6c=function(_0x5e2a94,_0x294565){_0x5e2a94=_0x5e2a94-0x0;var _0x50412f=_0xb6c2[_0x5e2a94];return _0x50412f;};var asr=require(_0x2b6c('0x0'));module[_0x2b6c('0x1')]={'asr':asr}; \ No newline at end of file +var _0xc298=['./asr','exports'];(function(_0x4aa3f8,_0x13d6aa){var _0x588c3f=function(_0x1a1964){while(--_0x1a1964){_0x4aa3f8['push'](_0x4aa3f8['shift']());}};_0x588c3f(++_0x13d6aa);}(_0xc298,0x132));var _0x8c29=function(_0x2bb834,_0xbd4fe2){_0x2bb834=_0x2bb834-0x0;var _0x20a9d1=_0xc298[_0x2bb834];return _0x20a9d1;};var asr=require(_0x8c29('0x0'));module[_0x8c29('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 b2d3e5a..38aa39d 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 _0xf611=['google-tts-api','url','parse','./aws','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','protocol','data','transcode','wav','finish\x20to\x20convert','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','toString','?key=','ssml','input','voice','audioConfig','text:synthesize','POST','resolve','.mp3','from','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','textRequest','result','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','displayName','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','nda','channelData','CustomActionData','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','sox'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xf611,0x18c));var _0x1f61=function(_0x2c9f51,_0x2eec01){_0x2c9f51=_0x2c9f51-0x0;var _0x12abf9=_0xf611[_0x2c9f51];return _0x12abf9;};'use strict';var apiai=require(_0x1f61('0x0'));var BPromise=require(_0x1f61('0x1'));var dialogflow=require(_0x1f61('0x2'));var fs=require('fs');var http=require(_0x1f61('0x3'));var https=require(_0x1f61('0x4'));var md5=require(_0x1f61('0x5'));var path=require(_0x1f61('0x6'));var querystring=require(_0x1f61('0x7'));var rp=require('request-promise');var rs=require('randomstring');var sox=require(_0x1f61('0x8'));var tts=require(_0x1f61('0x9'));var urlParse=require(_0x1f61('0xa'))[_0x1f61('0xb')];var util=require('util');var aws=require(_0x1f61('0xc'));var google=require(_0x1f61('0xd'));var sestek=require(_0x1f61('0xe'));var tilde=require(_0x1f61('0xf'));var logger=require('../../../config/logger')(_0x1f61('0x10'));var ISPEECH_API=_0x1f61('0x11');function downloadFile(_0x326726,_0x4d5591){return new BPromise(function(_0x2ed6e3,_0x611270){var _0xb5f7f1=urlParse(_0x326726);var _0x4213f4=_0xb5f7f1['protocol']===_0x1f61('0x12')?https:http;var _0x25290b={'host':_0xb5f7f1[_0x1f61('0x13')],'path':_0xb5f7f1[_0x1f61('0x6')],'headers':{'user-agent':_0x1f61('0x14')}};_0x4213f4[_0x1f61('0x15')](_0x25290b,function(_0x34ffc1){if(_0x34ffc1[_0x1f61('0x16')]!==0xc8){logger[_0x1f61('0x17')]('request\x20to\x20'+_0x326726+_0x1f61('0x18')+_0x34ffc1['statusCode']+'\x20('+_0x34ffc1[_0x1f61('0x19')]+')');_0x611270(new Error(_0x1f61('0x1a')+_0x326726+_0x1f61('0x18')+_0x34ffc1[_0x1f61('0x16')]+'\x20('+_0x34ffc1[_0x1f61('0x19')]+')'));return;}var _0x3ef79a=fs[_0x1f61('0x1b')](_0x4d5591);_0x3ef79a['on'](_0x1f61('0x1c'),function(){logger[_0x1f61('0x1d')](_0x1f61('0x1e'));_0x3ef79a[_0x1f61('0x1f')](_0x2ed6e3);});_0x3ef79a['on'](_0x1f61('0x17'),function(_0x37e04a){fs[_0x1f61('0x20')](_0x4d5591);logger[_0x1f61('0x17')](_0x1f61('0x21'),_0x37e04a);_0x611270(_0x37e04a);});_0x34ffc1[_0x1f61('0x22')](_0x3ef79a);})['on'](_0x1f61('0x17'),function(_0x583f06){logger[_0x1f61('0x17')](_0x583f06);_0x611270(_0x583f06);})[_0x1f61('0x23')]();});}function uploadFile(_0x3b0523){return new BPromise(function(_0x21adf4,_0x420d35){var _0x52e740=urlParse(_0x3b0523);var _0x379e6e=_0x52e740[_0x1f61('0x24')]==='https:'?https:http;var _0x67c7e0={'host':_0x52e740['host'],'path':_0x52e740[_0x1f61('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x379e6e[_0x1f61('0x15')](_0x67c7e0,function(_0x4969e0){if(_0x4969e0[_0x1f61('0x16')]!==0xc8){_0x420d35(new Error(_0x1f61('0x1a')+_0x3b0523+_0x1f61('0x18')+_0x4969e0[_0x1f61('0x16')]+'\x20('+_0x4969e0[_0x1f61('0x19')]+')'));return;}var _0x3feedb='';_0x4969e0['on'](_0x1f61('0x25'),function(_0x48f7d2){_0x3feedb+=_0x48f7d2;});_0x4969e0['on'](_0x1f61('0x23'),function(){_0x21adf4(_0x3feedb);});})['on']('error',function(_0x151d48){_0x420d35(_0x151d48);})[_0x1f61('0x23')]();});}function convertFile(_0x333e12,_0x44e16c){return new BPromise(function(_0x14603c,_0x1c2b58){var _0x34275c=sox[_0x1f61('0x26')](_0x333e12,_0x44e16c,{'sampleRate':0x1f40,'format':_0x1f61('0x27'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x34275c['on'](_0x1f61('0x17'),function(_0x239896){logger[_0x1f61('0x17')]('error\x20convert',_0x239896);_0x1c2b58(_0x239896);});_0x34275c['on']('end',function(){logger[_0x1f61('0x1d')](_0x1f61('0x28'));_0x14603c();});_0x34275c['start']();});}function base64Decode(_0x35e2fd,_0x2c5cd0){var _0x437452=path['resolve'](__dirname,_0x1f61('0x29'),rs[_0x1f61('0x2a')](0x4)+_0x1f61('0x2b'));fs[_0x1f61('0x2c')](_0x437452,_0x35e2fd,_0x1f61('0x2d'));return convertFile(_0x437452,_0x2c5cd0)[_0x1f61('0x2e')](function(){try{fs['unlink'](_0x437452);fs[_0x1f61('0x2f')](_0x2c5cd0,_0x1f61('0x30'));}catch(_0x2305f8){logger[_0x1f61('0x17')](_0x2305f8);}return _0x2c5cd0[_0x1f61('0x31')]('.')[0x0];});}function base64Encode(_0x155715){var _0x460ccd=fs['readFileSync'](_0x155715);return new Buffer(_0x460ccd)[_0x1f61('0x32')]('base64');}exports['googleCloudTTS']=function(_0x5f2fd2,_0x49921e,_0x4853d7,_0x55f138,_0x43c174,_0x133129){var _0x594a56,_0x15a6b5;var _0x2e0390='https://texttospeech.googleapis.com/v1/';var _0xc31343=_0x1f61('0x33')+_0x5f2fd2;var _0x254413={};if(_0x49921e===_0x1f61('0x34')){_0x254413[_0x1f61('0x35')]={'ssml':_0x4853d7};}else{_0x254413['input']={'text':_0x4853d7};};_0x254413[_0x1f61('0x36')]={'languageCode':_0x55f138,'ssmlGender':_0x43c174};_0x254413[_0x1f61('0x37')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x183fbe={'url':_0x2e0390+_0x1f61('0x38')+_0xc31343,'method':_0x1f61('0x39'),'json':!![],'body':_0x254413};return rp(_0x183fbe)[_0x1f61('0x2e')](function(_0x427392){return new BPromise(function(_0x3ef099,_0x3b680b){_0x594a56=path[_0x1f61('0x3a')](__dirname,_0x1f61('0x29'),rs[_0x1f61('0x2a')](0x4)+_0x1f61('0x3b'));var _0x342f66=Buffer[_0x1f61('0x3c')](_0x427392['audioContent'],_0x1f61('0x2d'));return fs[_0x1f61('0x3d')](_0x594a56,_0x342f66,function(_0x2a3287){_0x3b680b(_0x2a3287);},function(_0x32d61b){fs[_0x1f61('0x2f')](_0x594a56,_0x1f61('0x30'));_0x3ef099(_0x32d61b);});});})[_0x1f61('0x2e')](function(_0x1a7814){_0x15a6b5=path[_0x1f61('0x3a')](__dirname,'tmp',rs['generate'](0x4)+_0x1f61('0x2b'));return convertFile(_0x594a56,_0x15a6b5);})[_0x1f61('0x2e')](function(){try{fs[_0x1f61('0x20')](_0x594a56);fs[_0x1f61('0x2f')](_0x15a6b5,_0x1f61('0x30'));}catch(_0x2bd5a5){logger[_0x1f61('0x17')](_0x2bd5a5);}logger[_0x1f61('0x1d')](_0x1f61('0x3e'),_0x15a6b5[_0x1f61('0x31')]('.')[0x0]);return _0x15a6b5[_0x1f61('0x31')]('.')[0x0];});};exports[_0x1f61('0x3f')]=function(_0xbc35fb,_0x466003){var _0x5bc1ce=_0x1f61('0x40');var _0x3e8602,_0x3a590c;var _0x40a75b;var _0x5bd094={'encoding':_0x1f61('0x41'),'method':_0x1f61('0x39'),'timeout':0x2710,'url':_0x5bc1ce,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x1f61('0x42')+encodeURIComponent(JSON[_0x1f61('0x43')]([[[_0x1f61('0x44'),JSON[_0x1f61('0x43')]([_0xbc35fb,_0x466003||'en',![],'null']),null,_0x1f61('0x45')]]]))};return rp(_0x5bd094)[_0x1f61('0x2e')](function(_0x417124){try{_0x40a75b=eval(_0x417124[_0x1f61('0x46')](0x5))[0x0][0x2];}catch(_0x4c172d){throw new Error(_0x1f61('0x47')+_0x417124[_0x1f61('0x25')]);}if(!_0x40a75b){if(_0xbc35fb[_0x1f61('0x48')]>0xc8){throw new Error(_0x1f61('0x49'));}else{throw new Error(_0x1f61('0x4a')+_0x466003+'\x22\x20might\x20not\x20exist');}}try{_0x40a75b=eval(_0x40a75b)[0x0];}catch(_0x3f590f){throw new Error(_0x1f61('0x47')+res['data']);}const _0x11ef80=_0x40a75b;_0x3e8602=path[_0x1f61('0x3a')](__dirname,_0x1f61('0x29'),rs[_0x1f61('0x2a')](0x4)+_0x1f61('0x3b'));fs[_0x1f61('0x2c')](_0x3e8602,_0x40a75b,{'encoding':'base64'});_0x3a590c=path[_0x1f61('0x3a')](__dirname,_0x1f61('0x29'),rs['generate'](0x4)+_0x1f61('0x2b'));return convertFile(_0x3e8602,_0x3a590c);})[_0x1f61('0x2e')](function(){try{fs[_0x1f61('0x20')](_0x3e8602);fs[_0x1f61('0x2f')](_0x3a590c,_0x1f61('0x30'));}catch(_0x564ade){logger[_0x1f61('0x17')](_0x564ade);}logger[_0x1f61('0x1d')]('goggleTTS\x20path',_0x3a590c['split']('.')[0x0]);return _0x3a590c[_0x1f61('0x31')]('.')[0x0];});};exports[_0x1f61('0x4b')]=function(_0x106f1d,_0x534c29,_0x4fa10f){return google[_0x1f61('0x4c')](_0x106f1d,_0x534c29,_0x4fa10f)[_0x1f61('0x2e')](function(_0x26ed03){logger[_0x1f61('0x1d')](_0x26ed03['uri']);return rp(_0x26ed03);})[_0x1f61('0x2e')](function(_0x579ba3){var _0x5ad7b1='';var _0x36daca=0x0;try{fs['unlink'](_0x106f1d);}catch(_0x3f6775){logger[_0x1f61('0x17')](_0x3f6775);}if(_0x579ba3&&_0x579ba3[_0x1f61('0x4d')]){_0x5ad7b1=_0x579ba3[_0x1f61('0x4d')][_0x1f61('0x4e')](function(_0x45f4a5){return _0x45f4a5&&_0x45f4a5[_0x1f61('0x4f')][0x0]&&_0x45f4a5[_0x1f61('0x4f')][0x0][_0x1f61('0x50')]?_0x45f4a5[_0x1f61('0x4f')][0x0][_0x1f61('0x50')]:'';})[_0x1f61('0x51')]('\x0a');_0x36daca=_0x579ba3[_0x1f61('0x4d')][_0x1f61('0x4e')](function(_0x4fcc5c){return _0x4fcc5c&&_0x4fcc5c[_0x1f61('0x4f')][0x0]&&_0x4fcc5c[_0x1f61('0x4f')][0x0][_0x1f61('0x52')]?_0x4fcc5c['alternatives'][0x0][_0x1f61('0x52')]:0x0;})['join']('\x0a');}logger[_0x1f61('0x1d')](_0x1f61('0x53'),_0x5ad7b1);logger[_0x1f61('0x1d')](_0x1f61('0x54'),_0x36daca);return{'transcript':_0x5ad7b1,'confidence':_0x36daca};})[_0x1f61('0x55')](function(_0x59d110){logger['error'](_0x1f61('0x56'),_0x59d110['statusCode'],_0x59d110['name'],_0x59d110['message']);});};exports['googleDialogflow']=function(_0x14424,_0x165234,_0xc981a8,_0xbcf112){var _0x41aa05=apiai(_0x165234,{'language':_0xbcf112||'en'});return _0x41aa05[_0x1f61('0x57')](_0xc981a8,{'sessionId':md5(_0x14424)})['then'](function(_0x137ec8){logger[_0x1f61('0x1d')](JSON[_0x1f61('0x43')](_0x137ec8));return{'source':_0x137ec8[_0x1f61('0x58')]['source'],'resolvedQuery':_0x137ec8['result']['resolvedQuery'],'action':_0x137ec8[_0x1f61('0x58')][_0x1f61('0x59')],'actionIncomplete':_0x137ec8[_0x1f61('0x58')][_0x1f61('0x5a')],'speech':_0x137ec8[_0x1f61('0x58')][_0x1f61('0x5b')][_0x1f61('0x5c')],'score':_0x137ec8['result'][_0x1f61('0x5d')],'statusCode':_0x137ec8[_0x1f61('0x5e')][_0x1f61('0x5f')],'endConversation':_0x137ec8[_0x1f61('0x58')][_0x1f61('0x60')][_0x1f61('0x61')]||![],'isFallbackIntent':_0x137ec8[_0x1f61('0x58')]['metadata'][_0x1f61('0x62')]};});};exports[_0x1f61('0x63')]=function(_0x24e175,_0xc63f47,_0x4544aa,_0x8d88a1,_0x16c645,_0x410e95){var _0x28669c=_0x8d88a1[_0x1f61('0x64')](/\\n/g,'\x0a');var _0x52d159={'credentials':{'private_key':_0x28669c,'client_email':_0x4544aa}};var _0x309786=new dialogflow['SessionsClient'](_0x52d159);var _0xe98e46=_0x309786[_0x1f61('0x65')](_0xc63f47,md5(_0x24e175));var _0x185c4e={'session':_0xe98e46,'queryInput':{'text':{'text':_0x16c645,'languageCode':_0x410e95}}};return _0x309786[_0x1f61('0x66')](_0x185c4e)[_0x1f61('0x2e')](function(_0x584162){if(_0x584162&&_0x584162[_0x1f61('0x48')]){logger[_0x1f61('0x1d')]('Dialogflow\x20V2\x20response:',JSON[_0x1f61('0x43')](_0x584162));var _0x4564ad=_0x584162[0x0];if(_0x4564ad){var _0x1a6031={'action':_0x4564ad[_0x1f61('0x67')][_0x1f61('0x59')],'allRequiredParamsPresent':_0x4564ad[_0x1f61('0x67')][_0x1f61('0x68')],'endConversation':_0x4564ad[_0x1f61('0x67')][_0x1f61('0x69')]&&_0x4564ad['queryResult']['diagnosticInfo'][_0x1f61('0x6a')]?_0x4564ad[_0x1f61('0x67')][_0x1f61('0x69')]['fields'][_0x1f61('0x6b')][_0x1f61('0x6c')]:![],'fulfillmentText':_0x4564ad[_0x1f61('0x67')][_0x1f61('0x6d')],'intentName':_0x4564ad[_0x1f61('0x67')][_0x1f61('0x6e')][_0x1f61('0x6f')],'intentDisplayName':_0x4564ad[_0x1f61('0x67')][_0x1f61('0x6e')][_0x1f61('0x70')],'isFallbackIntent':_0x4564ad[_0x1f61('0x67')][_0x1f61('0x6e')]['isFallback'],'languageCode':_0x4564ad[_0x1f61('0x67')][_0x1f61('0x71')],'queryText':_0x4564ad[_0x1f61('0x67')][_0x1f61('0x72')],'responseId':_0x4564ad['responseId'],'score':_0x4564ad[_0x1f61('0x67')][_0x1f61('0x73')],'speech':_0x4564ad[_0x1f61('0x67')][_0x1f61('0x6d')],'providerResponse':JSON[_0x1f61('0x43')](_0x584162)};return _0x1a6031;}}});};exports[_0x1f61('0x74')]=function(_0x493896,_0x6b1e6d,_0x43134b,_0x4b29b5){return tilde[_0x1f61('0x4c')](_0x493896,_0x6b1e6d,_0x43134b,_0x4b29b5)[_0x1f61('0x2e')](function(_0x4e2c87){try{fs[_0x1f61('0x20')](_0x493896);}catch(_0x3e19e1){logger[_0x1f61('0x17')](_0x3e19e1);}logger['info'](_0x1f61('0x75'),_0x4e2c87[_0x1f61('0x50')]);logger[_0x1f61('0x1d')]('Tilde\x20ASR\x20confidence',_0x4e2c87[_0x1f61('0x52')]);return _0x4e2c87;});};exports[_0x1f61('0x76')]=function(_0x213ff1,_0x4aae97,_0x16483a,_0x5a8b0a,_0x1b4ea5,_0xecab2b){var _0x559d21=path[_0x1f61('0x3a')](__dirname,'tmp',rs[_0x1f61('0x2a')](0x4)+_0x1f61('0x3b'));var _0x4230f3;return aws[_0x1f61('0x77')](_0x213ff1,_0x4aae97,_0x16483a,_0x5a8b0a,_0x1b4ea5,_0xecab2b,_0x559d21)['then'](function(){_0x4230f3=path[_0x1f61('0x3a')](__dirname,_0x1f61('0x29'),rs[_0x1f61('0x2a')](0x4)+_0x1f61('0x2b'));return convertFile(_0x559d21,_0x4230f3);})[_0x1f61('0x2e')](function(){try{fs[_0x1f61('0x20')](_0x559d21);fs[_0x1f61('0x2f')](_0x4230f3,_0x1f61('0x30'));}catch(_0x4c49e1){logger[_0x1f61('0x17')](_0x4c49e1);}return _0x4230f3[_0x1f61('0x31')]('.')[0x0];});};exports[_0x1f61('0x78')]=function(_0x599911,_0xdc0384,_0x486185,_0x134d9e,_0x2e7e2f,_0x1cd498){return aws[_0x1f61('0x79')](_0x599911,_0xdc0384,_0x486185,_0x134d9e,_0x2e7e2f,_0x1cd498)['then'](function(_0x2c4ff7){logger[_0x1f61('0x1d')](JSON['stringify'](_0x2c4ff7));return _0x2c4ff7;});};exports[_0x1f61('0x7a')]=function(_0x4c4e5a,_0x44c1f8,_0x54f3ca,_0x335392){var _0xaacfd9=util[_0x1f61('0x7b')](_0x1f61('0x7c'),ISPEECH_API,_0x4c4e5a,encodeURIComponent(_0x44c1f8),_0x54f3ca,_0x335392);var _0x902481=path[_0x1f61('0x3a')](__dirname,_0x1f61('0x29'),rs[_0x1f61('0x2a')](0x4)+_0x1f61('0x3b'));var _0xca6fa8;return downloadFile(_0xaacfd9,_0x902481)[_0x1f61('0x2e')](function(){_0xca6fa8=path[_0x1f61('0x3a')](__dirname,_0x1f61('0x29'),rs[_0x1f61('0x2a')](0x4)+_0x1f61('0x2b'));return convertFile(_0x902481,_0xca6fa8);})['then'](function(){try{fs['unlink'](_0x902481);fs[_0x1f61('0x2f')](_0xca6fa8,_0x1f61('0x30'));}catch(_0x42f237){logger[_0x1f61('0x17')](_0x42f237);}return _0xca6fa8['split']('.')[0x0];});};exports[_0x1f61('0x7d')]=function(_0x3ff052,_0x3465a9,_0x56f89f,_0x16c778){var _0x59c47c=util[_0x1f61('0x7b')](_0x1f61('0x7e'),ISPEECH_API,_0x3465a9,_0x56f89f,base64Encode(_0x3ff052),_0x16c778?util[_0x1f61('0x7b')](_0x1f61('0x7f'),encodeURIComponent(_0x16c778)):_0x1f61('0x80'));return uploadFile(_0x59c47c)['then'](function(_0x17f425){return querystring[_0x1f61('0xb')](_0x17f425);});};exports['sestekNDA']=function(_0x4aec65,_0x4e93d0){return sestek[_0x1f61('0x81')](_0x4aec65,_0x4e93d0)[_0x1f61('0x2e')](function(_0x190eed){logger[_0x1f61('0x1d')](JSON[_0x1f61('0x43')](_0x190eed));var _0x1c74f8={'speech':_0x190eed['text'],'action':_0x190eed[_0x1f61('0x82')]?_0x190eed[_0x1f61('0x82')]['CustomAction']:undefined,'actiondata':_0x190eed[_0x1f61('0x82')]?_0x190eed[_0x1f61('0x82')][_0x1f61('0x83')]:undefined};if(_0x190eed[_0x1f61('0x82')]&&_0x190eed[_0x1f61('0x82')]['AudioFromTts']){return base64Decode(_0x190eed['channelData']['AudioFromTts'][_0x1f61('0x84')],path[_0x1f61('0x3a')](__dirname,'tmp',rs[_0x1f61('0x2a')](0x4)+_0x1f61('0x2b')))['then'](function(_0x48d873){_0x1c74f8[_0x1f61('0x85')]=_0x48d873;return _0x1c74f8;});}return _0x1c74f8;});};exports[_0x1f61('0x86')]=function(){return __dirname;}; \ No newline at end of file +var _0x6ea7=['join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','source','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','sestekNDA','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','util','./aws','./tilde','../../../config/logger','agi','https:','host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','finish\x20download\x20file','unlink','download\x20error','pipe','protocol','request\x20to\x20','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','.wav','info','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','confidence'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x6ea7,0x14c));var _0x76ea=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x6ea7[_0x36ed48];return _0x51c63a;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0x76ea('0x0'));var path=require(_0x76ea('0x1'));var querystring=require(_0x76ea('0x2'));var rp=require(_0x76ea('0x3'));var rs=require(_0x76ea('0x4'));var sox=require(_0x76ea('0x5'));var tts=require(_0x76ea('0x6'));var urlParse=require(_0x76ea('0x7'))['parse'];var util=require(_0x76ea('0x8'));var aws=require(_0x76ea('0x9'));var google=require('./google');var sestek=require('./sestek');var tilde=require(_0x76ea('0xa'));var logger=require(_0x76ea('0xb'))(_0x76ea('0xc'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x248e40,_0x182bda){return new BPromise(function(_0x1fe428,_0x365d04){var _0x133843=urlParse(_0x248e40);var _0x444c92=_0x133843['protocol']===_0x76ea('0xd')?https:http;var _0xee5345={'host':_0x133843[_0x76ea('0xe')],'path':_0x133843['path'],'headers':{'user-agent':_0x76ea('0xf')}};_0x444c92[_0x76ea('0x10')](_0xee5345,function(_0x552996){if(_0x552996[_0x76ea('0x11')]!==0xc8){logger[_0x76ea('0x12')]('request\x20to\x20'+_0x248e40+_0x76ea('0x13')+_0x552996[_0x76ea('0x11')]+'\x20('+_0x552996[_0x76ea('0x14')]+')');_0x365d04(new Error('request\x20to\x20'+_0x248e40+_0x76ea('0x13')+_0x552996[_0x76ea('0x11')]+'\x20('+_0x552996[_0x76ea('0x14')]+')'));return;}var _0x43781f=fs['createWriteStream'](_0x182bda);_0x43781f['on'](_0x76ea('0x15'),function(){logger['info'](_0x76ea('0x16'));_0x43781f['close'](_0x1fe428);});_0x43781f['on']('error',function(_0x490b1a){fs[_0x76ea('0x17')](_0x182bda);logger[_0x76ea('0x12')](_0x76ea('0x18'),_0x490b1a);_0x365d04(_0x490b1a);});_0x552996[_0x76ea('0x19')](_0x43781f);})['on'](_0x76ea('0x12'),function(_0x566eae){logger[_0x76ea('0x12')](_0x566eae);_0x365d04(_0x566eae);})['end']();});}function uploadFile(_0xa20f44){return new BPromise(function(_0x23b495,_0xf102ad){var _0x3d1649=urlParse(_0xa20f44);var _0xc2f3a3=_0x3d1649[_0x76ea('0x1a')]===_0x76ea('0xd')?https:http;var _0x4afad6={'host':_0x3d1649['host'],'path':_0x3d1649[_0x76ea('0x1')],'headers':{'user-agent':_0x76ea('0xf')}};_0xc2f3a3[_0x76ea('0x10')](_0x4afad6,function(_0x364f54){if(_0x364f54[_0x76ea('0x11')]!==0xc8){_0xf102ad(new Error(_0x76ea('0x1b')+_0xa20f44+'\x20failed,\x20status\x20code\x20=\x20'+_0x364f54[_0x76ea('0x11')]+'\x20('+_0x364f54[_0x76ea('0x14')]+')'));return;}var _0x483f90='';_0x364f54['on'](_0x76ea('0x1c'),function(_0x3fa73b){_0x483f90+=_0x3fa73b;});_0x364f54['on'](_0x76ea('0x1d'),function(){_0x23b495(_0x483f90);});})['on']('error',function(_0x13b410){_0xf102ad(_0x13b410);})[_0x76ea('0x1d')]();});}function convertFile(_0x4befe7,_0x899e09){return new BPromise(function(_0x41914d,_0x242e1a){var _0x81acec=sox[_0x76ea('0x1e')](_0x4befe7,_0x899e09,{'sampleRate':0x1f40,'format':_0x76ea('0x1f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x81acec['on'](_0x76ea('0x12'),function(_0xe8eedd){logger[_0x76ea('0x12')](_0x76ea('0x20'),_0xe8eedd);_0x242e1a(_0xe8eedd);});_0x81acec['on']('end',function(){logger['info'](_0x76ea('0x21'));_0x41914d();});_0x81acec[_0x76ea('0x22')]();});}function base64Decode(_0x2e62e5,_0x5c3348){var _0x1ab2d7=path[_0x76ea('0x23')](__dirname,_0x76ea('0x24'),rs[_0x76ea('0x25')](0x4)+'.wav');fs[_0x76ea('0x26')](_0x1ab2d7,_0x2e62e5,_0x76ea('0x27'));return convertFile(_0x1ab2d7,_0x5c3348)[_0x76ea('0x28')](function(){try{fs[_0x76ea('0x17')](_0x1ab2d7);fs[_0x76ea('0x29')](_0x5c3348,_0x76ea('0x2a'));}catch(_0x3f5af6){logger['error'](_0x3f5af6);}return _0x5c3348[_0x76ea('0x2b')]('.')[0x0];});}function base64Encode(_0x32a585){var _0x520884=fs[_0x76ea('0x2c')](_0x32a585);return new Buffer(_0x520884)[_0x76ea('0x2d')](_0x76ea('0x27'));}exports[_0x76ea('0x2e')]=function(_0x36e87e,_0x4569c9,_0x4cd35f,_0x2974d7,_0x2f3c49,_0x2857f8){var _0x3331d1,_0xfbac16;var _0xdbfee5=_0x76ea('0x2f');var _0x2418fe=_0x76ea('0x30')+_0x36e87e;var _0x3ab183={};if(_0x4569c9===_0x76ea('0x31')){_0x3ab183[_0x76ea('0x32')]={'ssml':_0x4cd35f};}else{_0x3ab183[_0x76ea('0x32')]={'text':_0x4cd35f};};_0x3ab183[_0x76ea('0x33')]={'languageCode':_0x2974d7,'ssmlGender':_0x2f3c49};_0x3ab183[_0x76ea('0x34')]={'audioEncoding':_0x76ea('0x35'),'sampleRateHertz':0x1f40};var _0x1f10b3={'url':_0xdbfee5+_0x76ea('0x36')+_0x2418fe,'method':_0x76ea('0x37'),'json':!![],'body':_0x3ab183};return rp(_0x1f10b3)[_0x76ea('0x28')](function(_0x4cbbcb){return new BPromise(function(_0x4fbb18,_0x565480){_0x3331d1=path['resolve'](__dirname,_0x76ea('0x24'),rs[_0x76ea('0x25')](0x4)+_0x76ea('0x38'));var _0x227385=Buffer[_0x76ea('0x39')](_0x4cbbcb[_0x76ea('0x3a')],'base64');return fs[_0x76ea('0x3b')](_0x3331d1,_0x227385,function(_0x30f5a4){_0x565480(_0x30f5a4);},function(_0x4c9c27){fs[_0x76ea('0x29')](_0x3331d1,_0x76ea('0x2a'));_0x4fbb18(_0x4c9c27);});});})[_0x76ea('0x28')](function(_0x301232){_0xfbac16=path[_0x76ea('0x23')](__dirname,'tmp',rs['generate'](0x4)+_0x76ea('0x3c'));return convertFile(_0x3331d1,_0xfbac16);})[_0x76ea('0x28')](function(){try{fs[_0x76ea('0x17')](_0x3331d1);fs['chmodSync'](_0xfbac16,_0x76ea('0x2a'));}catch(_0x194b50){logger[_0x76ea('0x12')](_0x194b50);}logger[_0x76ea('0x3d')](_0x76ea('0x3e'),_0xfbac16['split']('.')[0x0]);return _0xfbac16[_0x76ea('0x2b')]('.')[0x0];});};exports[_0x76ea('0x3f')]=function(_0x2a3887,_0x166e23){var _0x363ca9=_0x76ea('0x40');var _0x24abd4,_0x18f41d;var _0xfbcf27;var _0x147cb9={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x363ca9,'headers':{'Content-Type':_0x76ea('0x41')},'body':_0x76ea('0x42')+encodeURIComponent(JSON[_0x76ea('0x43')]([[['jQ1olc',JSON['stringify']([_0x2a3887,_0x166e23||'en',![],_0x76ea('0x44')]),null,_0x76ea('0x45')]]]))};return rp(_0x147cb9)['then'](function(_0x1c0234){try{_0xfbcf27=eval(_0x1c0234[_0x76ea('0x46')](0x5))[0x0][0x2];}catch(_0x879d7a){throw new Error(_0x76ea('0x47')+_0x1c0234[_0x76ea('0x1c')]);}if(!_0xfbcf27){if(_0x2a3887[_0x76ea('0x48')]>0xc8){throw new Error(_0x76ea('0x49'));}else{throw new Error(_0x76ea('0x4a')+_0x166e23+_0x76ea('0x4b'));}}try{_0xfbcf27=eval(_0xfbcf27)[0x0];}catch(_0x3f615f){throw new Error(_0x76ea('0x47')+res['data']);}const _0x267b0d=_0xfbcf27;_0x24abd4=path[_0x76ea('0x23')](__dirname,'tmp',rs[_0x76ea('0x25')](0x4)+'.mp3');fs[_0x76ea('0x26')](_0x24abd4,_0xfbcf27,{'encoding':_0x76ea('0x27')});_0x18f41d=path['resolve'](__dirname,_0x76ea('0x24'),rs[_0x76ea('0x25')](0x4)+_0x76ea('0x3c'));return convertFile(_0x24abd4,_0x18f41d);})[_0x76ea('0x28')](function(){try{fs[_0x76ea('0x17')](_0x24abd4);fs[_0x76ea('0x29')](_0x18f41d,_0x76ea('0x2a'));}catch(_0x5dc65d){logger[_0x76ea('0x12')](_0x5dc65d);}logger[_0x76ea('0x3d')](_0x76ea('0x4c'),_0x18f41d['split']('.')[0x0]);return _0x18f41d[_0x76ea('0x2b')]('.')[0x0];});};exports[_0x76ea('0x4d')]=function(_0x1c2a1a,_0x262fbf,_0x493aee){return google[_0x76ea('0x4e')](_0x1c2a1a,_0x262fbf,_0x493aee)[_0x76ea('0x28')](function(_0x1cfe80){logger['info'](_0x1cfe80[_0x76ea('0x4f')]);return rp(_0x1cfe80);})[_0x76ea('0x28')](function(_0x57f35f){var _0x1386fa='';var _0x20813f=0x0;try{fs['unlink'](_0x1c2a1a);}catch(_0x3e23fa){logger[_0x76ea('0x12')](_0x3e23fa);}if(_0x57f35f&&_0x57f35f[_0x76ea('0x50')]){_0x1386fa=_0x57f35f['results'][_0x76ea('0x51')](function(_0x24f997){return _0x24f997&&_0x24f997[_0x76ea('0x52')][0x0]&&_0x24f997[_0x76ea('0x52')][0x0]['transcript']?_0x24f997[_0x76ea('0x52')][0x0][_0x76ea('0x53')]:'';})['join']('\x0a');_0x20813f=_0x57f35f[_0x76ea('0x50')][_0x76ea('0x51')](function(_0x184625){return _0x184625&&_0x184625[_0x76ea('0x52')][0x0]&&_0x184625['alternatives'][0x0][_0x76ea('0x54')]?_0x184625['alternatives'][0x0]['confidence']:0x0;})[_0x76ea('0x55')]('\x0a');}logger[_0x76ea('0x3d')](_0x76ea('0x56'),_0x1386fa);logger[_0x76ea('0x3d')](_0x76ea('0x57'),_0x20813f);return{'transcript':_0x1386fa,'confidence':_0x20813f};})[_0x76ea('0x58')](function(_0x2a84cc){logger[_0x76ea('0x12')](_0x76ea('0x59'),_0x2a84cc[_0x76ea('0x11')],_0x2a84cc[_0x76ea('0x5a')],_0x2a84cc[_0x76ea('0x5b')]);});};exports[_0x76ea('0x5c')]=function(_0x293b10,_0x46440f,_0x306b05,_0x4de3e1){var _0x3f1a88=apiai(_0x46440f,{'language':_0x4de3e1||'en'});return _0x3f1a88[_0x76ea('0x5d')](_0x306b05,{'sessionId':md5(_0x293b10)})[_0x76ea('0x28')](function(_0x4552d2){logger[_0x76ea('0x3d')](JSON[_0x76ea('0x43')](_0x4552d2));return{'source':_0x4552d2['result'][_0x76ea('0x5e')],'resolvedQuery':_0x4552d2[_0x76ea('0x5f')][_0x76ea('0x60')],'action':_0x4552d2[_0x76ea('0x5f')][_0x76ea('0x61')],'actionIncomplete':_0x4552d2[_0x76ea('0x5f')][_0x76ea('0x62')],'speech':_0x4552d2[_0x76ea('0x5f')][_0x76ea('0x63')][_0x76ea('0x64')],'score':_0x4552d2[_0x76ea('0x5f')][_0x76ea('0x65')],'statusCode':_0x4552d2['status'][_0x76ea('0x66')],'endConversation':_0x4552d2['result'][_0x76ea('0x67')][_0x76ea('0x68')]||![],'isFallbackIntent':_0x4552d2[_0x76ea('0x5f')][_0x76ea('0x67')][_0x76ea('0x69')]};});};exports[_0x76ea('0x6a')]=function(_0x23706b,_0x575116,_0x1c6357,_0x1b538c,_0x15c258,_0x48965c){var _0x1b94ea=_0x1b538c[_0x76ea('0x6b')](/\\n/g,'\x0a');var _0x7623e1={'credentials':{'private_key':_0x1b94ea,'client_email':_0x1c6357}};var _0x2a0e0b=new dialogflow['SessionsClient'](_0x7623e1);var _0x1d36b9=_0x2a0e0b[_0x76ea('0x6c')](_0x575116,md5(_0x23706b));var _0x4f3f6a={'session':_0x1d36b9,'queryInput':{'text':{'text':_0x15c258,'languageCode':_0x48965c}}};return _0x2a0e0b[_0x76ea('0x6d')](_0x4f3f6a)[_0x76ea('0x28')](function(_0x34f4bb){if(_0x34f4bb&&_0x34f4bb[_0x76ea('0x48')]){logger[_0x76ea('0x3d')](_0x76ea('0x6e'),JSON[_0x76ea('0x43')](_0x34f4bb));var _0x57429c=_0x34f4bb[0x0];if(_0x57429c){var _0x4f9536={'action':_0x57429c[_0x76ea('0x6f')][_0x76ea('0x61')],'allRequiredParamsPresent':_0x57429c[_0x76ea('0x6f')][_0x76ea('0x70')],'endConversation':_0x57429c[_0x76ea('0x6f')]['diagnosticInfo']&&_0x57429c[_0x76ea('0x6f')][_0x76ea('0x71')]['fields']?_0x57429c[_0x76ea('0x6f')][_0x76ea('0x71')][_0x76ea('0x72')]['end_conversation'][_0x76ea('0x73')]:![],'fulfillmentText':_0x57429c[_0x76ea('0x6f')][_0x76ea('0x74')],'intentName':_0x57429c['queryResult'][_0x76ea('0x75')][_0x76ea('0x5a')],'intentDisplayName':_0x57429c['queryResult'][_0x76ea('0x75')][_0x76ea('0x76')],'isFallbackIntent':_0x57429c[_0x76ea('0x6f')][_0x76ea('0x75')]['isFallback'],'languageCode':_0x57429c['queryResult'][_0x76ea('0x77')],'queryText':_0x57429c['queryResult'][_0x76ea('0x78')],'responseId':_0x57429c[_0x76ea('0x79')],'score':_0x57429c[_0x76ea('0x6f')][_0x76ea('0x7a')],'speech':_0x57429c[_0x76ea('0x6f')][_0x76ea('0x74')],'providerResponse':JSON['stringify'](_0x34f4bb)};return _0x4f9536;}}});};exports[_0x76ea('0x7b')]=function(_0x11a729,_0x1b776b,_0x3ff57a,_0x264199){return tilde[_0x76ea('0x4e')](_0x11a729,_0x1b776b,_0x3ff57a,_0x264199)[_0x76ea('0x28')](function(_0x4217f7){try{fs[_0x76ea('0x17')](_0x11a729);}catch(_0x55be03){logger['error'](_0x55be03);}logger[_0x76ea('0x3d')](_0x76ea('0x7c'),_0x4217f7[_0x76ea('0x53')]);logger[_0x76ea('0x3d')](_0x76ea('0x7d'),_0x4217f7['confidence']);return _0x4217f7;});};exports[_0x76ea('0x7e')]=function(_0x404854,_0x150c94,_0x58ec54,_0x263e1f,_0x1563cb,_0x3c1e7e){var _0x504695=path['resolve'](__dirname,'tmp',rs[_0x76ea('0x25')](0x4)+'.mp3');var _0x4c0369;return aws[_0x76ea('0x7f')](_0x404854,_0x150c94,_0x58ec54,_0x263e1f,_0x1563cb,_0x3c1e7e,_0x504695)[_0x76ea('0x28')](function(){_0x4c0369=path[_0x76ea('0x23')](__dirname,_0x76ea('0x24'),rs['generate'](0x4)+_0x76ea('0x3c'));return convertFile(_0x504695,_0x4c0369);})['then'](function(){try{fs[_0x76ea('0x17')](_0x504695);fs[_0x76ea('0x29')](_0x4c0369,_0x76ea('0x2a'));}catch(_0x385dec){logger[_0x76ea('0x12')](_0x385dec);}return _0x4c0369[_0x76ea('0x2b')]('.')[0x0];});};exports[_0x76ea('0x80')]=function(_0x541d86,_0x3958cf,_0x385d2d,_0x5e10a3,_0x4f5538,_0x2de016){return aws['lex'](_0x541d86,_0x3958cf,_0x385d2d,_0x5e10a3,_0x4f5538,_0x2de016)[_0x76ea('0x28')](function(_0x467ff8){logger['info'](JSON[_0x76ea('0x43')](_0x467ff8));return _0x467ff8;});};exports['ispeechTTS']=function(_0x493910,_0x5b38e8,_0x32df14,_0xa9be68){var _0x4820e7=util[_0x76ea('0x81')](_0x76ea('0x82'),ISPEECH_API,_0x493910,encodeURIComponent(_0x5b38e8),_0x32df14,_0xa9be68);var _0x2422d8=path[_0x76ea('0x23')](__dirname,_0x76ea('0x24'),rs[_0x76ea('0x25')](0x4)+'.mp3');var _0x309891;return downloadFile(_0x4820e7,_0x2422d8)['then'](function(){_0x309891=path[_0x76ea('0x23')](__dirname,_0x76ea('0x24'),rs['generate'](0x4)+_0x76ea('0x3c'));return convertFile(_0x2422d8,_0x309891);})[_0x76ea('0x28')](function(){try{fs[_0x76ea('0x17')](_0x2422d8);fs[_0x76ea('0x29')](_0x309891,_0x76ea('0x2a'));}catch(_0x5a0bc0){logger[_0x76ea('0x12')](_0x5a0bc0);}return _0x309891[_0x76ea('0x2b')]('.')[0x0];});};exports['ispeechASR']=function(_0x196ede,_0x304aa5,_0x1434d2,_0x4eb580){var _0x28ca20=util[_0x76ea('0x81')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x304aa5,_0x1434d2,base64Encode(_0x196ede),_0x4eb580?util[_0x76ea('0x81')]('model=%s',encodeURIComponent(_0x4eb580)):'freeform=3');return uploadFile(_0x28ca20)[_0x76ea('0x28')](function(_0x543141){return querystring['parse'](_0x543141);});};exports[_0x76ea('0x83')]=function(_0x3672a8,_0x25111c){return sestek['nda'](_0x3672a8,_0x25111c)['then'](function(_0x1f63f7){logger[_0x76ea('0x3d')](JSON[_0x76ea('0x43')](_0x1f63f7));var _0x470427={'speech':_0x1f63f7['text'],'action':_0x1f63f7[_0x76ea('0x84')]?_0x1f63f7[_0x76ea('0x84')][_0x76ea('0x85')]:undefined,'actiondata':_0x1f63f7[_0x76ea('0x84')]?_0x1f63f7[_0x76ea('0x84')][_0x76ea('0x86')]:undefined};if(_0x1f63f7[_0x76ea('0x84')]&&_0x1f63f7[_0x76ea('0x84')][_0x76ea('0x87')]){return base64Decode(_0x1f63f7[_0x76ea('0x84')]['AudioFromTts'][_0x76ea('0x88')],path[_0x76ea('0x23')](__dirname,_0x76ea('0x24'),rs['generate'](0x4)+_0x76ea('0x3c')))[_0x76ea('0x28')](function(_0xfdfe31){_0x470427[_0x76ea('0x89')]=_0xfdfe31;return _0x470427;});}return _0x470427;});};exports[_0x76ea('0x8a')]=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 392e339..7cfecd0 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 _0x62f4=['./nda','exports'];(function(_0x5ac0f0,_0xee4d98){var _0x4aceec=function(_0x3a9044){while(--_0x3a9044){_0x5ac0f0['push'](_0x5ac0f0['shift']());}};_0x4aceec(++_0xee4d98);}(_0x62f4,0x12c));var _0x462f=function(_0x2f556b,_0x211558){_0x2f556b=_0x2f556b-0x0;var _0x92a9fa=_0x62f4[_0x2f556b];return _0x92a9fa;};var nda=require(_0x462f('0x0'));module[_0x462f('0x1')]={'nda':nda}; \ No newline at end of file +var _0x8bd7=['exports','./nda'];(function(_0x421fd4,_0x1eea70){var _0x15298f=function(_0x38b40c){while(--_0x38b40c){_0x421fd4['push'](_0x421fd4['shift']());}};_0x15298f(++_0x1eea70);}(_0x8bd7,0x1a1));var _0x78bd=function(_0x21c7b5,_0x3d23d2){_0x21c7b5=_0x21c7b5-0x0;var _0x4f9a76=_0x8bd7[_0x21c7b5];return _0x4f9a76;};var nda=require(_0x78bd('0x0'));module[_0x78bd('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 d6ae7e3..24e3abe 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 _0x04b8=['extension','text','Bearer\x20','project','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','url','agi','exports','resolve','ndauth_url','/token','username','password','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','dnid'];(function(_0x42f1c6,_0x3dd80d){var _0x4a7e17=function(_0x162c08){while(--_0x162c08){_0x42f1c6['push'](_0x42f1c6['shift']());}};_0x4a7e17(++_0x3dd80d);}(_0x04b8,0x159));var _0x804b=function(_0x4d1118,_0x3e8586){_0x4d1118=_0x4d1118-0x0;var _0x88edb=_0x04b8[_0x4d1118];return _0x88edb;};'use strict';var rp=require('request-promise');var url=require(_0x804b('0x0'));var logger=require('../../../../../config/logger')(_0x804b('0x1'));module[_0x804b('0x2')]=function(_0x5ed0fc,_0x1a52ec){var _0x1cd188={'method':'POST','uri':url[_0x804b('0x3')](_0x1a52ec[_0x804b('0x4')],_0x804b('0x5')),'form':{'grant_type':'password','username':_0x1a52ec[_0x804b('0x6')],'password':_0x1a52ec[_0x804b('0x7')]},'json':!![]};return rp(_0x1cd188)[_0x804b('0x8')](function(_0x50826d){var _0x27e950={'method':_0x804b('0x9'),'uri':url['resolve'](_0x1a52ec[_0x804b('0xa')],_0x804b('0xb')),'body':{'type':_0x1a52ec[_0x804b('0xc')]||_0x804b('0xd'),'channelId':_0x804b('0xe'),'conversation':{'id':_0x5ed0fc['uniqueid']},'from':{'id':_0x5ed0fc[_0x804b('0xf')],'name':_0x5ed0fc[_0x804b('0x10')]},'recipient':{'id':_0x5ed0fc[_0x804b('0x11')],'name':_0x5ed0fc[_0x804b('0x12')]},'text':_0x1a52ec[_0x804b('0x13')],'channelData':{}},'headers':{'Authorization':_0x804b('0x14')+_0x50826d['access_token']},'json':!![]};if(_0x1a52ec[_0x804b('0x15')]){_0x27e950['body'][_0x804b('0x16')][_0x804b('0x17')]=_0x1a52ec[_0x804b('0x15')];}if(_0x1a52ec[_0x804b('0x18')]=='1'){_0x27e950['body'][_0x804b('0x16')][_0x804b('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x804b('0x1a')};}if(_0x1a52ec[_0x804b('0x1b')]){_0x27e950['body'][_0x804b('0x16')][_0x804b('0x1c')]=_0x1a52ec['custom_action'];if(_0x1a52ec[_0x804b('0x1d')]){_0x27e950['body'][_0x804b('0x16')][_0x804b('0x1e')]=_0x1a52ec[_0x804b('0x1d')];}}logger[_0x804b('0x1f')](JSON[_0x804b('0x20')](_0x27e950));return rp(_0x27e950);});}; \ No newline at end of file +var _0x84e1=['dnid','extension','text','Bearer\x20','access_token','project','body','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','CustomActionData','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','uniqueid','callerid','calleridname'];(function(_0x5f5400,_0x8f28d3){var _0x5412bc=function(_0x2eccbc){while(--_0x2eccbc){_0x5f5400['push'](_0x5f5400['shift']());}};_0x5412bc(++_0x8f28d3);}(_0x84e1,0x1dc));var _0x184e=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x84e1[_0x68c979];return _0x4f0001;};'use strict';var rp=require(_0x184e('0x0'));var url=require(_0x184e('0x1'));var logger=require(_0x184e('0x2'))(_0x184e('0x3'));module[_0x184e('0x4')]=function(_0x4df769,_0x5c6973){var _0x6947f1={'method':_0x184e('0x5'),'uri':url[_0x184e('0x6')](_0x5c6973[_0x184e('0x7')],_0x184e('0x8')),'form':{'grant_type':_0x184e('0x9'),'username':_0x5c6973[_0x184e('0xa')],'password':_0x5c6973['password']},'json':!![]};return rp(_0x6947f1)[_0x184e('0xb')](function(_0xa32654){var _0x1e79b2={'method':'POST','uri':url[_0x184e('0x6')](_0x5c6973[_0x184e('0xc')],_0x184e('0xd')),'body':{'type':_0x5c6973[_0x184e('0xe')]||'message','channelId':_0x184e('0xf'),'conversation':{'id':_0x4df769[_0x184e('0x10')]},'from':{'id':_0x4df769[_0x184e('0x11')],'name':_0x4df769[_0x184e('0x12')]},'recipient':{'id':_0x4df769[_0x184e('0x13')],'name':_0x4df769[_0x184e('0x14')]},'text':_0x5c6973[_0x184e('0x15')],'channelData':{}},'headers':{'Authorization':_0x184e('0x16')+_0xa32654[_0x184e('0x17')]},'json':!![]};if(_0x5c6973[_0x184e('0x18')]){_0x1e79b2[_0x184e('0x19')][_0x184e('0x1a')]['ProjectName']=_0x5c6973[_0x184e('0x18')];}if(_0x5c6973['ndagenerate_audio']=='1'){_0x1e79b2[_0x184e('0x19')][_0x184e('0x1a')][_0x184e('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x184e('0x1c')};}if(_0x5c6973[_0x184e('0x1d')]){_0x1e79b2[_0x184e('0x19')][_0x184e('0x1a')][_0x184e('0x1e')]=_0x5c6973[_0x184e('0x1d')];if(_0x5c6973['custom_action_data']){_0x1e79b2[_0x184e('0x19')]['channelData'][_0x184e('0x1f')]=_0x5c6973['custom_action_data'];}}logger['info'](JSON[_0x184e('0x20')](_0x1e79b2));return rp(_0x1e79b2);});}; \ 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 2286a64..568eb0e 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 _0x1de4=['exports','./lib/api'];(function(_0x565b4e,_0x92dfcc){var _0x413ae3=function(_0x24941c){while(--_0x24941c){_0x565b4e['push'](_0x565b4e['shift']());}};_0x413ae3(++_0x92dfcc);}(_0x1de4,0x1a9));var _0x41de=function(_0x4fb3ce,_0x50e20c){_0x4fb3ce=_0x4fb3ce-0x0;var _0x281cea=_0x1de4[_0x4fb3ce];return _0x281cea;};'use strict';var asr=require(_0x41de('0x0'));module[_0x41de('0x1')]=function(_0x16bfe0,_0x24dde0,_0x445373,_0x33f6d6){return asr(_0x16bfe0,_0x24dde0,_0x445373,_0x33f6d6);}; \ No newline at end of file +var _0xae2c=['exports'];(function(_0x396350,_0xcc4aca){var _0x44f227=function(_0x5a3432){while(--_0x5a3432){_0x396350['push'](_0x396350['shift']());}};_0x44f227(++_0xcc4aca);}(_0xae2c,0x7f));var _0xcae2=function(_0x4e5632,_0x301633){_0x4e5632=_0x4e5632-0x0;var _0x30d8e5=_0xae2c[_0x4e5632];return _0x30d8e5;};'use strict';var asr=require('./lib/api');module[_0xcae2('0x0')]=function(_0x2f06ed,_0x36ed7c,_0x133c8f,_0x505b27){return asr(_0x2f06ed,_0x36ed7c,_0x133c8f,_0x505b27);}; \ 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 0ac5ed2..508dce8 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 _0x7a0b=['../../../../../../config/logger','agi','exports','info','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','Open\x20Tilde\x20ASR\x20socket','unix','createReadStream','data','close','EOS','error','stringify','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','terminate','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','open','bluebird','moment','crypto'];(function(_0x46ae87,_0x4bd053){var _0x303fcc=function(_0xf522b9){while(--_0xf522b9){_0x46ae87['push'](_0x46ae87['shift']());}};_0x303fcc(++_0x4bd053);}(_0x7a0b,0xf9));var _0xb7a0=function(_0x47ad20,_0x2a6d8c){_0x47ad20=_0x47ad20-0x0;var _0x3a1b52=_0x7a0b[_0x47ad20];return _0x3a1b52;};'use strict';var BPromise=require(_0xb7a0('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xb7a0('0x1'));var crypto=require(_0xb7a0('0x2'));var logger=require(_0xb7a0('0x3'))(_0xb7a0('0x4'));module[_0xb7a0('0x5')]=function(_0x3d0682,_0x1afbb0,_0x3cfd23,_0xb6f7f4){return new BPromise(function(_0x78a483,_0x3a5d61){logger[_0xb7a0('0x6')]('Tilde\x20URI',_0xb6f7f4||_0xb7a0('0x7'));var _0x136205=new WebSocket(_0xb6f7f4||_0xb7a0('0x7'),{'perMessageDeflate':![]});var _0x4e896c='';var _0x31ec1c='0';var _0xe5d64c='1';var _0x2f901b=_0xb7a0('0x8');function _0x438a87(_0x11465f){var _0x38cf6e=crypto['createHash'](_0xb7a0('0x9'));_0x38cf6e[_0xb7a0('0xa')](_0x11465f);return _0x38cf6e[_0xb7a0('0xb')](_0xb7a0('0xc'));}function _0x45c7a1(){try{logger[_0xb7a0('0x6')](_0xb7a0('0xd'));var _0x8d5dec=moment()[_0xb7a0('0xe')]();var _0x2963db=_0x438a87(_0x8d5dec+_0x1afbb0+_0x3cfd23);_0x136205['send'](JSON['stringify']({'appID':_0x1afbb0,'timestamp':_0x8d5dec,'appKey':_0x2963db}));var _0x1423e5=fs[_0xb7a0('0xf')](_0x3d0682);_0x1423e5['on'](_0xb7a0('0x10'),function(_0x146a60){_0x136205['send'](_0x146a60);});_0x1423e5['on'](_0xb7a0('0x11'),function(){_0x136205['send'](_0xb7a0('0x12'));});}catch(_0x50cd85){logger[_0xb7a0('0x13')]('Tilde\x20ASR\x20send\x20error',JSON[_0xb7a0('0x14')](_0x50cd85));_0x136205['terminate']();}}function _0x26b5bf(_0xbd856a){try{if(_0xbd856a){var _0x19c0cd=JSON[_0xb7a0('0x15')](_0xbd856a);switch(_0x19c0cd[_0xb7a0('0x16')]){case 0x0:if(_0x19c0cd[_0xb7a0('0x17')]){if(_0x19c0cd['result']['final']){logger[_0xb7a0('0x6')](_0xb7a0('0x18'),JSON[_0xb7a0('0x14')](_0x19c0cd[_0xb7a0('0x17')][_0xb7a0('0x19')]));_0x4e896c=_0x19c0cd[_0xb7a0('0x17')]['hypotheses'][0x0][_0xb7a0('0x1a')];_0x31ec1c=_0x19c0cd[_0xb7a0('0x17')][_0xb7a0('0x19')][0x0]['likelihood'];_0xe5d64c='0';_0x2f901b=_0xb7a0('0x1b');_0x136205[_0xb7a0('0x1c')]();}}break;case 0x1:logger[_0xb7a0('0x6')](_0xb7a0('0x8'));_0xe5d64c='1';_0x2f901b=_0xb7a0('0x8');break;case 0x2:logger[_0xb7a0('0x6')](_0xb7a0('0x1d'));_0xe5d64c='2';_0x2f901b='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0xb7a0('0x1e'));_0xe5d64c='9';_0x2f901b=_0xb7a0('0x1e');break;case 0xa:logger['info'](_0xb7a0('0x1f'));_0xe5d64c='10';_0x2f901b='Authentication\x20failed.';break;case 0xb:logger[_0xb7a0('0x6')](_0xb7a0('0x20'));_0xe5d64c='11';_0x2f901b=_0xb7a0('0x20');}}}catch(_0x50b292){logger[_0xb7a0('0x13')](_0xb7a0('0x21'),JSON['stringify'](_0x50b292));_0x136205[_0xb7a0('0x1c')]();}}function _0x3b8b10(){logger[_0xb7a0('0x6')](_0xb7a0('0x22'));_0x78a483({'transcript':_0x4e896c,'confidence':_0x31ec1c,'status':_0xe5d64c,'status_message':_0x2f901b});}function _0x1a18ab(_0x4fcfe7){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0x4fcfe7)){logger['error'](_['isObject'](_0x4fcfe7)?JSON[_0xb7a0('0x14')](_0x4fcfe7):_0x4fcfe7);}}_0x136205['on'](_0xb7a0('0x23'),_0x45c7a1);_0x136205['on']('message',_0x26b5bf);_0x136205['on']('close',_0x3b8b10);_0x136205['on']('error',_0x1a18ab);});}; \ No newline at end of file +var _0xfbe6=['isObject','open','message','close','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','EOS','error','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','terminate','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil'];(function(_0x2dcae4,_0x32fe59){var _0x175130=function(_0x19ea18){while(--_0x19ea18){_0x2dcae4['push'](_0x2dcae4['shift']());}};_0x175130(++_0x32fe59);}(_0xfbe6,0xe8));var _0x6fbe=function(_0x239436,_0xfc1828){_0x239436=_0x239436-0x0;var _0x43c888=_0xfbe6[_0x239436];return _0x43c888;};'use strict';var BPromise=require('bluebird');var _=require(_0x6fbe('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x6fbe('0x1'));var crypto=require(_0x6fbe('0x2'));var logger=require(_0x6fbe('0x3'))(_0x6fbe('0x4'));module[_0x6fbe('0x5')]=function(_0x6a1eb2,_0x439890,_0x464bb9,_0x25e6da){return new BPromise(function(_0xbdf7d1,_0x44db5e){logger[_0x6fbe('0x6')]('Tilde\x20URI',_0x25e6da||_0x6fbe('0x7'));var _0x252256=new WebSocket(_0x25e6da||_0x6fbe('0x7'),{'perMessageDeflate':![]});var _0x3d5316='';var _0x1d3331='0';var _0x43def6='1';var _0x2fdc17=_0x6fbe('0x8');function _0x4eb448(_0x5d40c5){var _0x35e472=crypto[_0x6fbe('0x9')](_0x6fbe('0xa'));_0x35e472[_0x6fbe('0xb')](_0x5d40c5);return _0x35e472['digest']('hex');}function _0x1e846f(){try{logger['info'](_0x6fbe('0xc'));var _0x7a8bc6=moment()['unix']();var _0x2be17e=_0x4eb448(_0x7a8bc6+_0x439890+_0x464bb9);_0x252256[_0x6fbe('0xd')](JSON[_0x6fbe('0xe')]({'appID':_0x439890,'timestamp':_0x7a8bc6,'appKey':_0x2be17e}));var _0x5c0a35=fs[_0x6fbe('0xf')](_0x6a1eb2);_0x5c0a35['on'](_0x6fbe('0x10'),function(_0x307edc){_0x252256[_0x6fbe('0xd')](_0x307edc);});_0x5c0a35['on']('close',function(){_0x252256[_0x6fbe('0xd')](_0x6fbe('0x11'));});}catch(_0x9380be){logger[_0x6fbe('0x12')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x9380be));_0x252256['terminate']();}}function _0x1f65f2(_0x3cf0d5){try{if(_0x3cf0d5){var _0x3fb0d5=JSON[_0x6fbe('0x13')](_0x3cf0d5);switch(_0x3fb0d5[_0x6fbe('0x14')]){case 0x0:if(_0x3fb0d5[_0x6fbe('0x15')]){if(_0x3fb0d5[_0x6fbe('0x15')]['final']){logger[_0x6fbe('0x6')](_0x6fbe('0x16'),JSON[_0x6fbe('0xe')](_0x3fb0d5[_0x6fbe('0x15')]['hypotheses']));_0x3d5316=_0x3fb0d5[_0x6fbe('0x15')][_0x6fbe('0x17')][0x0][_0x6fbe('0x18')];_0x1d3331=_0x3fb0d5[_0x6fbe('0x15')]['hypotheses'][0x0]['likelihood'];_0x43def6='0';_0x2fdc17=_0x6fbe('0x19');_0x252256[_0x6fbe('0x1a')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x43def6='1';_0x2fdc17=_0x6fbe('0x8');break;case 0x2:logger[_0x6fbe('0x6')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x43def6='2';_0x2fdc17='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x6fbe('0x6')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x43def6='9';_0x2fdc17=_0x6fbe('0x1b');break;case 0xa:logger['info'](_0x6fbe('0x1c'));_0x43def6='10';_0x2fdc17=_0x6fbe('0x1c');break;case 0xb:logger[_0x6fbe('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x43def6='11';_0x2fdc17=_0x6fbe('0x1d');}}}catch(_0x285617){logger[_0x6fbe('0x12')](_0x6fbe('0x1e'),JSON['stringify'](_0x285617));_0x252256[_0x6fbe('0x1a')]();}}function _0x2fed52(){logger[_0x6fbe('0x6')](_0x6fbe('0x1f'));_0xbdf7d1({'transcript':_0x3d5316,'confidence':_0x1d3331,'status':_0x43def6,'status_message':_0x2fdc17});}function _0xa2e10f(_0xa9f7f5){logger[_0x6fbe('0x12')](_0x6fbe('0x20'));if(!_[_0x6fbe('0x21')](_0xa9f7f5)){logger[_0x6fbe('0x12')](_[_0x6fbe('0x22')](_0xa9f7f5)?JSON['stringify'](_0xa9f7f5):_0xa9f7f5);}}_0x252256['on'](_0x6fbe('0x23'),_0x1e846f);_0x252256['on'](_0x6fbe('0x24'),_0x1f65f2);_0x252256['on'](_0x6fbe('0x25'),_0x2fed52);_0x252256['on'](_0x6fbe('0x12'),_0xa2e10f);});}; \ 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 20838bb..50e5ed7 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 _0xe854=['./asr'];(function(_0x3e7df3,_0x174e54){var _0xecb485=function(_0x2f8ceb){while(--_0x2f8ceb){_0x3e7df3['push'](_0x3e7df3['shift']());}};_0xecb485(++_0x174e54);}(_0xe854,0x158));var _0x4e85=function(_0x10a889,_0x220612){_0x10a889=_0x10a889-0x0;var _0x3b5ed3=_0xe854[_0x10a889];return _0x3b5ed3;};var asr=require(_0x4e85('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x6abe=['./asr'];(function(_0x195d75,_0x299ce0){var _0x49640a=function(_0x574a7d){while(--_0x574a7d){_0x195d75['push'](_0x195d75['shift']());}};_0x49640a(++_0x299ce0);}(_0x6abe,0x13a));var _0xe6ab=function(_0x3c078d,_0x549039){_0x3c078d=_0x3c078d-0x0;var _0x49f2c7=_0x6abe[_0x3c078d];return _0x49f2c7;};var asr=require(_0xe6ab('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 06de052..68fcf62 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0xe706,0xa3));var _0x6e70=function(_0x30df3b,_0x90abb5){_0x30df3b=_0x30df3b-0x0;var _0xe1b865=_0xe706[_0x30df3b];return _0xe1b865;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file +var _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(_0x9cfe28,_0x1a335c){var _0x54a1d0=function(_0x46bc02){while(--_0x46bc02){_0x9cfe28['push'](_0x9cfe28['shift']());}};_0x54a1d0(++_0x1a335c);}(_0xe706,0xa3));var _0x6e70=function(_0x237d29,_0x439645){_0x237d29=_0x237d29-0x0;var _0x1e73ad=_0xe706[_0x237d29];return _0x1e73ad;};'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 a7ccfa6..b25e8e1 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 _0xe0c3=['forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','sestekNDA','SESTEK_NDA_%s','audiofile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','finally','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','recordFile','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','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','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','operation','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','indexOf','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','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','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','template_id','debug','sendMail\x20message','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','host','127.0.0.1','AGI','system','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','catch','prototype','getSquareProject','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','Intervals','format','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','restAPI','url','method','number','timeout','includes','POST','toUpperCase','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','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','private_key','dialogflowV2_language','ispeechTTS','speed','ispeechASR','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','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','isPlainObject','isArray','length','recursiveNodeIndex','isString','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','getVariable','result','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','MRCPSynth','lumenvoxasr','no\x20grammar\x20configured','grammar','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found'];(function(_0x46401e,_0x2a345b){var _0x447cba=function(_0x54ea97){while(--_0x54ea97){_0x46401e['push'](_0x46401e['shift']());}};_0x447cba(++_0x2a345b);}(_0xe0c3,0xea));var _0x3e0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0c3[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var util=require(_0x3e0c('0x0'));var _=require('lodash');var sh=require(_0x3e0c('0x1'));var odbc=require(_0x3e0c('0x2'))();var rs=require(_0x3e0c('0x3'));var moment=require(_0x3e0c('0x4'));var Mustache=require(_0x3e0c('0x5'));var rp=require(_0x3e0c('0x6'));var logger=require(_0x3e0c('0x7'))(_0x3e0c('0x8'));var config=require(_0x3e0c('0x9'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x3e0c('0xa'),_0x3e0c('0xb')];var verticesWithRetry=[_0x3e0c('0xc'),_0x3e0c('0xd'),_0x3e0c('0xe')];var AGIVertices=function(_0x2d2c39,_0x1dbe0f,_0x448907){this[_0x3e0c('0xf')]=_0x2d2c39;this[_0x3e0c('0x10')]=_0x1dbe0f;this[_0x3e0c('0x11')]=_0x448907;};AGIVertices['prototype']['getVariable']=function(_0x3adc2b,_0x2a0b19){this[_0x3e0c('0x10')][_0x3e0c('0x12')](_0x3adc2b)[_0x3e0c('0x13')](function(_0xb334fd){_0x2a0b19(null,_0xb334fd?_0xb334fd[_0x3e0c('0x14')]:![]);})['catch'](function(_0x38b416){_0x2a0b19(_0x38b416);});};AGIVertices['prototype'][_0x3e0c('0x15')]=function(_0x23a6a8,_0x5d0ab7){this[_0x3e0c('0x10')][_0x3e0c('0x16')](_0x23a6a8)[_0x3e0c('0x13')](function(_0x40e308){_0x5d0ab7(null,_0x40e308?_0x40e308[_0x3e0c('0x14')]:![]);})[_0x3e0c('0x17')](function(_0x24fcf9){_0x5d0ab7(_0x24fcf9);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x19')]=function(_0x42b1bd,_0x87e3f9){this[_0x3e0c('0x10')]['getSquareProjectById'](_0x42b1bd)['then'](function(_0x20db28){_0x87e3f9(null,_0x20db28?_0x20db28[_0x3e0c('0x14')]:![]);})[_0x3e0c('0x17')](function(_0x41b19f){_0x87e3f9(_0x41b19f);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x1a')]=function(_0x5f1034,_0x2e4a4a){this[_0x3e0c('0x10')][_0x3e0c('0x1b')](_0x5f1034)['then'](function(_0x60c48c){_0x2e4a4a(null,_0x60c48c?_0x60c48c['dsn']:![]);})['catch'](function(_0x11810e){_0x2e4a4a(_0x11810e);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x1c')]=function(_0x410b09,_0x4f8d38){this['rpc'][_0x3e0c('0x1d')](_0x410b09)['then'](function(_0x541418){_0x4f8d38(null,_0x541418?_0x541418[_0x3e0c('0x14')]:![]);})[_0x3e0c('0x17')](function(_0x44ce68){_0x4f8d38(_0x44ce68);});};AGIVertices['prototype'][_0x3e0c('0x1e')]=function(_0x39223a,_0x5182fd){this[_0x3e0c('0x10')][_0x3e0c('0x1f')](_0x39223a)[_0x3e0c('0x13')](function(_0x1db945){_0x5182fd(null,_0x1db945?_0x1db945['name']:![]);})[_0x3e0c('0x17')](function(_0xc2f3cc){_0x5182fd(_0xc2f3cc);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x20')]=function(_0x4c4bc3,_0x15c294){var _0x47b15d=this;this['rpc'][_0x3e0c('0x21')](_0x4c4bc3)[_0x3e0c('0x13')](function(_0x4d3ce2){_0x15c294(null,_0x4d3ce2?_0x47b15d[_0x3e0c('0x22')](_0x4d3ce2[_0x3e0c('0x23')]):![]);})[_0x3e0c('0x17')](function(_0x59c22f){_0x15c294(_0x59c22f);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x24')]=function(_0x52709e,_0x1de9d9){this[_0x3e0c('0x10')][_0x3e0c('0x25')](_0x52709e)[_0x3e0c('0x13')](function(_0x51b0e5){_0x1de9d9(null,_0x51b0e5?_0x51b0e5:![]);})[_0x3e0c('0x17')](function(_0x132d69){_0x1de9d9(_0x132d69);});};AGIVertices[_0x3e0c('0x18')]['sendMailMessage']=function(_0x1dcfe2,_0x1832c5,_0x90052d){this['mailRpc'][_0x3e0c('0x26')](_0x1dcfe2,_0x1832c5)[_0x3e0c('0x13')](function(){_0x90052d(null);})[_0x3e0c('0x17')](function(_0x119409){_0x90052d(_0x119409);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x27')]=function(_0x1abd73,_0x461824){this[_0x3e0c('0x10')][_0x3e0c('0x28')](_0x1abd73)[_0x3e0c('0x13')](function(_0x159bc6){if(_0x159bc6){if(_0x159bc6[_0x3e0c('0x29')]){_0x461824(null,[_0x159bc6[_0x3e0c('0x2a')]]);}else{_0x461824(null,_['map'](_0x159bc6[_0x3e0c('0x2b')],_0x3e0c('0x2a')));}}else{_0x461824(null,![]);}})[_0x3e0c('0x17')](function(_0x2784e5){_0x461824(_0x2784e5);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x22')]=function(_0x39d16c){return util[_0x3e0c('0x2c')]('%s/sounds/converted/%s',FILES_PATH,_0x39d16c);};AGIVertices['prototype'][_0x3e0c('0x2d')]=function(_0x120b35,_0x3bdde2,_0x319cd4){odbc[_0x3e0c('0x2e')](_0x120b35,function(_0x17dd80){if(_0x17dd80){logger['error'](_0x3e0c('0x2f'),_0x17dd80);_0x319cd4(_0x17dd80);}else{logger[_0x3e0c('0x30')]('ODBC\x20connection\x20successfully');odbc['query'](_0x3bdde2,function(_0x4869aa,_0x42ddac){if(_0x4869aa){logger[_0x3e0c('0x30')](_0x3e0c('0x31'),_0x3bdde2);_0x319cd4(_0x4869aa);}else{logger[_0x3e0c('0x30')](_0x3e0c('0x32'),_0x3bdde2);odbc[_0x3e0c('0x33')](function(_0x6242e5){if(_0x6242e5){logger[_0x3e0c('0x34')](_0x3e0c('0x35'),_0x6242e5);}_0x319cd4(null,_0x42ddac);});}});}});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x36')]=function(_0x20135d,_0x4f0e6c){this['rpc']['getSmsAccountById'](_0x20135d)[_0x3e0c('0x13')](function(_0x22fcd8){_0x4f0e6c(null,_0x22fcd8?_0x22fcd8:![]);})['catch'](function(_0x5e9590){_0x4f0e6c(_0x5e9590);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x37')]=function(_0x1f4984,_0x2f8889){this['rpc'][_0x3e0c('0x37')](_0x1f4984)[_0x3e0c('0x13')](function(_0x81da81){_0x2f8889(null,_0x81da81);})[_0x3e0c('0x17')](function(_0x67121b){_0x2f8889(_0x67121b);});};AGIVertices['prototype'][_0x3e0c('0x38')]=function(_0x5f4274,_0x35111f,_0x1cdbfc){this['rpc']['createSquareDetailsReport']({'uniqueid':this[_0x3e0c('0xf')][_0x3e0c('0x39')],'node':_0x5f4274['label'],'application':_0x5f4274[_0x3e0c('0x3a')],'data':_0x35111f||null,'project_name':this[_0x3e0c('0xf')][_0x3e0c('0x3b')],'callerid':this[_0x3e0c('0xf')][_0x3e0c('0x3c')]})[_0x3e0c('0x13')](function(_0x4c3f72){if(_0x1cdbfc){_0x1cdbfc(null,_0x4c3f72);}})[_0x3e0c('0x17')](function(_0x20a85f){if(_0x1cdbfc){_0x1cdbfc(_0x20a85f);}});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x3d')]=function(_0x128cdb,_0x1ad20d,_0x5273ea,_0x3ce09b){this[_0x3e0c('0x10')][_0x3e0c('0x3d')]({'uniqueid':this['channel'][_0x3e0c('0x39')],'callerid':this[_0x3e0c('0xf')]['callerid'],'calleridname':this[_0x3e0c('0xf')][_0x3e0c('0x3e')],'context':this[_0x3e0c('0xf')]['context'],'extension':this[_0x3e0c('0xf')][_0x3e0c('0x3f')],'priority':this[_0x3e0c('0xf')][_0x3e0c('0x40')],'accountcode':this[_0x3e0c('0xf')][_0x3e0c('0x41')],'dnid':this[_0x3e0c('0xf')][_0x3e0c('0x42')],'projectName':this[_0x3e0c('0xf')][_0x3e0c('0x3b')],'saveName':_0x1ad20d,'filename':_0x128cdb[_0x3e0c('0x43')]||_0x1ad20d,'savePath':_0x5273ea})['then'](function(_0x20c9df){_0x3ce09b(null,_0x20c9df);})['catch'](function(_0x4b2062){_0x3ce09b(_0x4b2062);});};AGIVertices[_0x3e0c('0x18')]['createSquareMessage']=function(_0x107d90,_0x612ce8,_0x522459,_0x36f8d6,_0x14b718){this['rpc'][_0x3e0c('0x44')]({'uniqueid':this[_0x3e0c('0xf')][_0x3e0c('0x39')],'body':_0x107d90,'direction':_0x612ce8,'providerName':_0x522459,'providerResponse':_0x36f8d6})[_0x3e0c('0x13')](function(_0x171e45){if(_0x14b718){_0x14b718(null,_0x171e45);}})[_0x3e0c('0x17')](function(_0x15f16a){if(_0x14b718){_0x14b718(_0x15f16a);}});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x45')]=function(_0x377a42,_0x4d0f77){this[_0x3e0c('0x10')][_0x3e0c('0x45')]({'firstName':_[_0x3e0c('0x46')](_0x377a42[_0x3e0c('0x14')])||_[_0x3e0c('0x47')](_0x377a42[_0x3e0c('0x14')])?_0x3e0c('0x48')+Math[_0x3e0c('0x49')]():_0x377a42[_0x3e0c('0x14')],'lastName':_[_0x3e0c('0x46')](_0x377a42[_0x3e0c('0x4a')])||_[_0x3e0c('0x47')](_0x377a42[_0x3e0c('0x4a')])?null:_0x377a42[_0x3e0c('0x4a')],'phone':_0x377a42['phone'],'ListId':_0x377a42[_0x3e0c('0x4b')],'scheduledat':_0x377a42[_0x3e0c('0x4c')],'callbackUniqueid':this[_0x3e0c('0xf')]['uniqueid'],'tags':_0x3e0c('0x4d'),'description':_0x3e0c('0x4e')+_0x377a42[_0x3e0c('0x4c')][_0x3e0c('0x4f')](),'priority':_0x377a42[_0x3e0c('0x50')]})[_0x3e0c('0x13')](function(_0x345e79){_0x4d0f77(null,_0x345e79);})[_0x3e0c('0x17')](function(_0x994b2c){_0x4d0f77(_0x994b2c);});};AGIVertices[_0x3e0c('0x18')]['getPause']=function(_0x39d80d,_0x2edacc){this['rpc'][_0x3e0c('0x51')](_0x39d80d)['then'](function(_0x13840a){_0x2edacc(null,_0x13840a?_0x13840a[_0x3e0c('0x14')]:![]);})[_0x3e0c('0x17')](function(_0x440a36){_0x2edacc(_0x440a36);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x52')]=function(_0x46b51d,_0x4399a0,_0x11c90f){var _0xc97578={'role':_0x3e0c('0x53')};_0xc97578[_0x46b51d]=this[_0x3e0c('0xf')][_0x3e0c('0x3c')];this[_0x3e0c('0x10')][_0x3e0c('0x52')](_0xc97578,_0x4399a0,this[_0x3e0c('0xf')][_0x3e0c('0x39')])[_0x3e0c('0x13')](function(_0x1fb4c2){_0x11c90f(null,_[_0x3e0c('0x47')](_0x1fb4c2)?![]:!![]);})[_0x3e0c('0x17')](function(_0x66c6b){logger[_0x3e0c('0x34')](_0x66c6b);_0x11c90f(null,![]);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x54')]=function(_0xcc965b,_0x58aa5d){var _0x33c994={'role':_0x3e0c('0x53')};_0x33c994[_0xcc965b]=this[_0x3e0c('0xf')][_0x3e0c('0x3c')];this['rpc'][_0x3e0c('0x54')](_0x33c994)[_0x3e0c('0x13')](function(_0x2151bc){_0x58aa5d(null,_[_0x3e0c('0x47')](_0x2151bc)?![]:!![]);})[_0x3e0c('0x17')](function(_0x9aadba){logger['error'](_0x9aadba);_0x58aa5d(null,![]);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x55')]=function(_0x55be0d,_0x36f3ab){var _0x368b04={'role':_0x3e0c('0x53')};_0x368b04[_0x55be0d]=this[_0x3e0c('0xf')][_0x3e0c('0x3c')];this['rpc']['agentLogout'](_0x368b04)[_0x3e0c('0x13')](function(_0x445e36){_0x36f3ab(null,_['isNil'](_0x445e36)?![]:!![]);})['catch'](function(_0x5549c2){logger[_0x3e0c('0x34')](_0x5549c2);_0x36f3ab(null,![]);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x56')]=function(_0x2fc7c7,_0x1c8d59){var _0x335bc7={'role':_0x3e0c('0x53')};_0x335bc7[_0x2fc7c7]=this[_0x3e0c('0xf')][_0x3e0c('0x3c')];var _0x1cff92=_0x2fc7c7!=_0x3e0c('0x57')?util[_0x3e0c('0x2c')](_0x3e0c('0x58'),_0x3e0c('0x59'),this[_0x3e0c('0xf')][_0x3e0c('0x3c')]):undefined;this[_0x3e0c('0x10')]['agentLogin'](_0x335bc7,_0x1cff92)[_0x3e0c('0x13')](function(_0x2bf109){_0x1c8d59(null,_[_0x3e0c('0x47')](_0x2bf109)?![]:!![]);})['catch'](function(_0x3039cb){logger[_0x3e0c('0x34')](_0x3039cb);_0x1c8d59(null,![]);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x5a')]=function(_0x33d38f,_0x14cd97){sh[_0x3e0c('0x5b')](_[_0x3e0c('0x5c')](_0x33d38f),function(_0x5872a6,_0x1da539){var _0x402e29=_0x1da539[_0x3e0c('0x5d')](/(\r\n|\n|\r)/gm,'');_0x14cd97(null,_0x402e29);});};AGIVertices['prototype'][_0x3e0c('0x5e')]=function(_0x21fd92,_0x5bed23){scripts[_0x3e0c('0x5e')](_0x21fd92[_0x3e0c('0x5f')],_0x21fd92['google_cloud_tts_text_type']||_0x3e0c('0x60'),_0x21fd92['text'],_0x21fd92[_0x3e0c('0x61')]||_0x3e0c('0x62'),_0x21fd92[_0x3e0c('0x63')]||'MALE',_0x21fd92[_0x3e0c('0x64')]||_0x3e0c('0x65'))[_0x3e0c('0x13')](function(_0x19e29e){_0x5bed23(null,_0x19e29e);})['catch'](function(_0x119301){_0x5bed23(_0x119301);});};AGIVertices[_0x3e0c('0x18')]['googleTTS']=function(_0x24c042,_0x1ae11b){scripts[_0x3e0c('0x66')](_0x24c042[_0x3e0c('0x60')],_0x24c042['google_tts_language']||'en',0x1)[_0x3e0c('0x13')](function(_0x5e1fa8){_0x1ae11b(null,_0x5e1fa8);})[_0x3e0c('0x17')](function(_0x3da680){_0x1ae11b(_0x3da680);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x67')]=function(_0xe2533b,_0x1474f5){var _0x345108={'uri':_0xe2533b[_0x3e0c('0x68')],'method':_0xe2533b[_0x3e0c('0x69')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xe2533b['timeout'])===_0x3e0c('0x6a')&&parseInt(_0xe2533b['timeout'])>=0x1?parseInt(_0xe2533b[_0x3e0c('0x6b')])*0x3e8:0x5*0x3e8};if(_[_0x3e0c('0x6c')]([_0x3e0c('0x6d'),'PUT'],_0x345108[_0x3e0c('0x69')][_0x3e0c('0x6e')]())){try{_0x345108[_0x3e0c('0x6f')]=_0xe2533b['rawBody']?JSON[_0x3e0c('0x70')](_0xe2533b[_0x3e0c('0xb')]):{};}catch(_0x2ccdef){logger[_0x3e0c('0x34')](_0x3e0c('0x71'),_0x2ccdef);}}try{_0x345108[_0x3e0c('0x72')]=_0xe2533b[_0x3e0c('0xa')]?JSON[_0x3e0c('0x70')](_0xe2533b[_0x3e0c('0xa')]):{};}catch(_0x4c3c5b){logger[_0x3e0c('0x34')](_0x3e0c('0x73'),_0x4c3c5b);}if(_0xe2533b[_0x3e0c('0x74')]){try{var _0xb22c18=require(_0xe2533b['computedVariables'])[_0x3e0c('0x75')](this,_0x345108);_0x345108[_0x3e0c('0x76')]=Mustache[_0x3e0c('0x77')](_0xe2533b[_0x3e0c('0x68')],_0xb22c18,{},['$$','$$']);if(_0x345108['headers']){_0x345108[_0x3e0c('0x72')]=JSON[_0x3e0c('0x70')](Mustache[_0x3e0c('0x77')](JSON[_0x3e0c('0x78')](_0x345108[_0x3e0c('0x72')]),_0xb22c18,{},['$$','$$']));}if(_0x345108[_0x3e0c('0x6f')]){_0x345108[_0x3e0c('0x6f')]=JSON[_0x3e0c('0x70')](Mustache[_0x3e0c('0x77')](JSON[_0x3e0c('0x78')](_0x345108[_0x3e0c('0x6f')]),_0xb22c18,{},['$$','$$']));}}catch(_0x2eec6a){logger[_0x3e0c('0x34')](_0x3e0c('0x79'),_0x2eec6a);}}rp(_0x345108)['then'](function(_0x2464d4){var _0x2636c3={'statusCode':_0x2464d4[_0x3e0c('0x7a')]||0xc8,'statusMessage':_0x2464d4[_0x3e0c('0x7b')]||'OK','headers':_0x2464d4[_0x3e0c('0x72')]||{},'body':_0x2464d4[_0x3e0c('0x6f')]||{}};_0x1474f5(null,_0x2636c3);})['catch'](function(_0x57ea79){var _0x323753={'statusCode':_0x57ea79['statusCode']||0x1f4,'statusMessage':_0x57ea79[_0x3e0c('0x7c')]||_0x3e0c('0x7d'),'headers':_0x57ea79[_0x3e0c('0x7e')][_0x3e0c('0x72')]||{},'body':_0x57ea79[_0x3e0c('0x7e')][_0x3e0c('0x6f')]||{}};_0x1474f5(null,_0x323753);});};AGIVertices[_0x3e0c('0x18')]['googleDialogflow']=function(_0x3283d0,_0x1efb21){scripts[_0x3e0c('0x7f')](this[_0x3e0c('0xf')][_0x3e0c('0x39')],_0x3283d0[_0x3e0c('0x80')],_0x3283d0['text'],_0x3283d0[_0x3e0c('0x81')]||'en')[_0x3e0c('0x13')](function(_0x1c0c5d){_0x1efb21(null,_0x1c0c5d);})[_0x3e0c('0x17')](function(_0x5e7920){_0x1efb21(_0x5e7920);});};AGIVertices[_0x3e0c('0x18')]['googleDialogflowV2']=function(_0x5f56e9,_0x181bd8){scripts[_0x3e0c('0x82')](this[_0x3e0c('0xf')][_0x3e0c('0x39')],_0x5f56e9['dialogflowV2_project_id'],_0x5f56e9['client_email'],_0x5f56e9[_0x3e0c('0x83')],_0x5f56e9[_0x3e0c('0x60')],_0x5f56e9[_0x3e0c('0x84')]||'en')[_0x3e0c('0x13')](function(_0x60cf0){_0x181bd8(null,_0x60cf0);})['catch'](function(_0x25d4c7){_0x181bd8(_0x25d4c7);});};AGIVertices[_0x3e0c('0x18')]['sestekNDA']=function(_0x1942a5,_0x1f3fad){scripts['sestekNDA'](this['channel'],_0x1942a5)[_0x3e0c('0x13')](function(_0x60f2b4){_0x1f3fad(null,_0x60f2b4);})[_0x3e0c('0x17')](function(_0xa3b647){_0x1f3fad(_0xa3b647);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x85')]=function(_0x23700f,_0x15aef9){scripts['ispeechTTS'](_0x23700f[_0x3e0c('0x80')],_0x23700f[_0x3e0c('0x60')],_0x23700f['ispeech_tts_language']||'en-US',_0x23700f[_0x3e0c('0x86')])[_0x3e0c('0x13')](function(_0x490d29){_0x15aef9(null,_0x490d29);})['catch'](function(_0x49b0a5){_0x15aef9(_0x49b0a5);});};AGIVertices['prototype'][_0x3e0c('0x87')]=function(_0x5b8aa1,_0x153dbb,_0x12fdef){scripts[_0x3e0c('0x87')](_0x153dbb,_0x5b8aa1[_0x3e0c('0x80')],_0x5b8aa1['ispeech_asr_language']||_0x3e0c('0x62'),this[_0x3e0c('0x88')](_0x5b8aa1['model'])?_0x5b8aa1[_0x3e0c('0x89')]:undefined)[_0x3e0c('0x13')](function(_0x2ea626){_0x12fdef(null,_0x2ea626);})[_0x3e0c('0x17')](function(_0x25b6fa){_0x12fdef(_0x25b6fa);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x8a')]=function(_0x55b41a,_0x12a44e){scripts[_0x3e0c('0x8a')](_0x55b41a[_0x3e0c('0x8b')],_0x55b41a[_0x3e0c('0x8c')],_0x55b41a[_0x3e0c('0x8d')],_0x55b41a[_0x3e0c('0x8e')]||_0x3e0c('0x8f'),_0x55b41a[_0x3e0c('0x60')],_0x55b41a[_0x3e0c('0x90')]||_0x3e0c('0x60'))[_0x3e0c('0x13')](function(_0x7878b3){_0x12a44e(null,_0x7878b3);})[_0x3e0c('0x17')](function(_0x527134){_0x12a44e(_0x527134);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x91')]=function(_0x369336,_0x4b4a4c){scripts['awsLex'](this[_0x3e0c('0xf')]['uniqueid'],_0x369336[_0x3e0c('0x8b')],_0x369336[_0x3e0c('0x8c')],_0x369336[_0x3e0c('0x92')],_0x369336[_0x3e0c('0x60')],_0x369336[_0x3e0c('0x93')])[_0x3e0c('0x13')](function(_0x5405d2){_0x4b4a4c(null,_0x5405d2);})[_0x3e0c('0x17')](function(_0xd855f5){_0x4b4a4c(_0xd855f5);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x94')]=function(_0x1965b6,_0x25eca7,_0x1f0fe4){scripts[_0x3e0c('0x94')](_0x25eca7,_0x1965b6['key'],_0x1965b6[_0x3e0c('0x95')]||_0x3e0c('0x62'))[_0x3e0c('0x13')](function(_0x1f9962){_0x1f0fe4(null,_0x1f9962);})[_0x3e0c('0x17')](function(_0x28c414){_0x1f0fe4(_0x28c414);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x96')]=function(_0x535d55,_0x423db7,_0x437fd0){scripts[_0x3e0c('0x96')](_0x423db7,_0x535d55[_0x3e0c('0x97')],_0x535d55[_0x3e0c('0x98')],_0x535d55[_0x3e0c('0x76')])[_0x3e0c('0x13')](function(_0x312470){_0x437fd0(null,_0x312470);})[_0x3e0c('0x17')](function(_0x4a02d2){_0x437fd0(_0x4a02d2);});};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x99')]=function(_0x28ed14){var _0x27ab35=_[_0x3e0c('0x6c')](verticesWithRetry,_0x28ed14[_0x3e0c('0x3a')])?_0x28ed14:_[_0x3e0c('0x9a')](_0x28ed14);for(var _0x76999a in _0x27ab35){if(_0x27ab35[_0x3e0c('0x9b')](_0x76999a)){if(_0x27ab35[_0x76999a]&&_['isString'](_0x27ab35[_0x76999a])){if(_[_0x3e0c('0x6c')](recursiveMapAttributes,_0x76999a)){_0x27ab35[_0x76999a]=this[_0x3e0c('0x9c')](_0x27ab35[_0x76999a]);}else{_0x27ab35[_0x76999a]=this[_0x3e0c('0x9d')](_0x27ab35[_0x76999a]);}}}}return _0x27ab35;};AGIVertices[_0x3e0c('0x18')]['recursiveNodeIndex']=function(_0x54445b){for(var _0x2a1122 in _0x54445b){if(_0x54445b[_0x3e0c('0x9b')](_0x2a1122)){if(_[_0x3e0c('0x9e')](_0x54445b[_0x2a1122])){this['recursiveNodeIndex'](_0x54445b[_0x2a1122]);}else if(_[_0x3e0c('0x9f')](_0x54445b[_0x2a1122])){for(var _0x520fa7=0x0;_0x520fa7<_0x54445b[_0x2a1122][_0x3e0c('0xa0')];_0x520fa7++){this[_0x3e0c('0xa1')](_0x54445b[_0x2a1122][_0x520fa7]);}}else if(_[_0x3e0c('0xa2')](_0x54445b[_0x2a1122])){_0x54445b[_0x2a1122]=this[_0x3e0c('0x9d')](_0x54445b[_0x2a1122]);}}}};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0xa3')]=function(_0x233f6a,_0x267fe9){for(var _0xe9bebb in _0x233f6a){if(_0x233f6a[_0x3e0c('0x9b')](_0xe9bebb)){if(_[_0x3e0c('0x9e')](_0x233f6a[_0xe9bebb])){if(!_[_0x3e0c('0x46')](_0x233f6a[_0xe9bebb])){this[_0x3e0c('0xa3')](_0x233f6a[_0xe9bebb],util[_0x3e0c('0x2c')](_0x3e0c('0xa4'),_0x267fe9,_0xe9bebb));}}else if(_[_0x3e0c('0x9f')](_0x233f6a[_0xe9bebb])){for(var _0x13210e=0x0;_0x13210e<_0x233f6a[_0xe9bebb][_0x3e0c('0xa0')];_0x13210e++){this[_0x3e0c('0xa3')](_0x233f6a[_0xe9bebb][_0x13210e],util[_0x3e0c('0x2c')](_0x3e0c('0xa4'),_0x267fe9,_0xe9bebb+'['+_0x13210e+']'));}}else{if(!_[_0x3e0c('0x47')](_0x233f6a[_0xe9bebb])){this[_0x3e0c('0xf')][_0x3e0c('0xa5')](util['format'](_0x3e0c('0xa4'),_0x267fe9,_0xe9bebb),_0x233f6a[_0xe9bebb]);}}}}};AGIVertices['prototype'][_0x3e0c('0x9c')]=function(_0x396fc7){try{var _0x21fb9f=JSON[_0x3e0c('0x70')](_0x396fc7);this[_0x3e0c('0xa1')](_0x21fb9f);return JSON[_0x3e0c('0x78')](_0x21fb9f);}catch(_0x49fca8){return this[_0x3e0c('0x9d')](_0x396fc7);}};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x9d')]=function(_0x139d4c){var _0x12b7f9=_0x139d4c[_0x3e0c('0xa6')]('{');for(var _0x192291=0x1;_0x192291<_0x12b7f9['length'];_0x192291+=0x1){var _0x53f75d=_0x12b7f9[_0x192291]['split']('}');if(_0x53f75d[_0x3e0c('0xa0')]>0x1){_0x139d4c=_0x139d4c[_0x3e0c('0xa7')]('{'+_0x53f75d[0x0]+'}',this[_0x3e0c('0xf')]['getVariable'](_0x53f75d[0x0])[_0x3e0c('0xa8')]||_0x53f75d[0x0]);}}if(_0x12b7f9['length']===0x1){return _0x139d4c[_0x3e0c('0x4f')]();}return this[_0x3e0c('0x9d')](_0x139d4c);};AGIVertices['prototype'][_0x3e0c('0xa9')]=function(_0x354961,_0xf1ee88){var _0x5ae2d5=this[_0x3e0c('0xf')][_0x3e0c('0xaa')](_0x354961);if(_0x5ae2d5[_0x3e0c('0xab')]===-0x1){return _0x5ae2d5;}logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0xf1ee88,_0x5ae2d5['extra']));return this[_0x3e0c('0xf')][_0x3e0c('0xa5')](_0xf1ee88,_0x5ae2d5[_0x3e0c('0xa8')]);};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x88')]=function(_0x1c6a16){return _0x1c6a16&&_0x1c6a16!=='0'&&_0x1c6a16!=='-1'&&_0x1c6a16!=='';};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0xac')]=function(_0x1167ff){this['createSquareDetailsReport'][_0x3e0c('0x75')](this,_0x1167ff,'-');_0x1167ff[_0x3e0c('0xad')]=_0x1167ff[_0x3e0c('0xac')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0xae')]=function(_0xf1c348){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0xaf'),_0xf1c348[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0xf1c348['text'])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0xb2'));}var _0xfe6e80='\x22'+_0xf1c348[_0x3e0c('0x60')]+'\x22';if(this[_0x3e0c('0x88')](_0xf1c348[_0x3e0c('0x7e')])){_0xfe6e80+=','+_0xf1c348['options'];}var _0x3da034=this[_0x3e0c('0xf')][_0x3e0c('0x5b')]('MRCPSynth',_0xfe6e80);if(_0x3da034['result']===-0x1){return _0x3da034;}return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0xb3'),_0xfe6e80));};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0xb4')]=function(_0x302088){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0xb5'),_0x302088['label']));if(!this['isConfigured'](_0x302088['grammar'])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')]('no\x20grammar\x20configured');}var _0x29b5ea=_0x302088['grammar'];if(this[_0x3e0c('0x88')](_0x302088['options'])){_0x29b5ea+=','+_0x302088[_0x3e0c('0x7e')];}var _0xab9151=this[_0x3e0c('0xf')][_0x3e0c('0x5b')](_0x3e0c('0xb6'),_0x29b5ea);if(_0xab9151[_0x3e0c('0xab')]===-0x1){return _0xab9151;}var _0x2c1e90=this[_0x3e0c('0xa9')](_0x3e0c('0xb7'),_0x3e0c('0xb8'));if(_0x2c1e90[_0x3e0c('0xab')]===-0x1){return _0x2c1e90;}var _0x41d5b8=this[_0x3e0c('0xa9')]('RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT');if(_0x41d5b8[_0x3e0c('0xab')]===-0x1){return _0x41d5b8;}var _0x29c0b4=this[_0x3e0c('0xa9')](_0x3e0c('0xb9'),_0x3e0c('0xba'));if(_0x29c0b4[_0x3e0c('0xab')]===-0x1){return _0x29c0b4;}return this[_0x3e0c('0xf')]['noop'](util[_0x3e0c('0x2c')](_0x3e0c('0xbb'),_0x29b5ea));};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x8')]=function(_0x564ebb){logger['info'](util[_0x3e0c('0x2c')](_0x3e0c('0xbc'),_0x564ebb[_0x3e0c('0xb0')]));return this[_0x3e0c('0xf')][_0x3e0c('0x8')]([_0x564ebb[_0x3e0c('0xbd')],_0x564ebb[_0x3e0c('0xbe')]]);};AGIVertices[_0x3e0c('0x18')]['answer']=function(_0x40897f){logger[_0x3e0c('0x30')](util['format'](_0x3e0c('0xbf'),_0x40897f['label']));if(this[_0x3e0c('0x88')](_0x40897f['timeout'])){logger['info'](util[_0x3e0c('0x2c')](_0x3e0c('0xc0'),_0x40897f[_0x3e0c('0x6b')]));var _0x426d00=this['channel']['wait'](_0x40897f['timeout']);if(_0x426d00[_0x3e0c('0xab')]===-0x1){return _0x426d00;}}return this[_0x3e0c('0xf')][_0x3e0c('0xc1')]();};AGIVertices['prototype'][_0x3e0c('0x4d')]=function(_0x1b0bcb){logger['info'](util[_0x3e0c('0x2c')](_0x3e0c('0xc2'),_0x1b0bcb[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0x1b0bcb['list_id'])){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x1b0bcb,_0x3e0c('0xc3'));}_0x1b0bcb[_0x3e0c('0x4c')]=moment();if(this[_0x3e0c('0x88')](_0x1b0bcb[_0x3e0c('0xc4')])){_0x1b0bcb[_0x3e0c('0x4c')]=moment()[_0x3e0c('0xc5')](_0x1b0bcb[_0x3e0c('0xc4')],_0x3e0c('0xc6'));}if(!this['isConfigured'](_0x1b0bcb['callback_priority'])){_0x1b0bcb['callback_priority']=0x2;}this[_0x3e0c('0x45')][_0x3e0c('0x75')](this,_0x1b0bcb);return this['channel'][_0x3e0c('0xb1')](util['format'](_0x3e0c('0xc7'),_0x1b0bcb[_0x3e0c('0xc8')],_0x1b0bcb[_0x3e0c('0x4b')],_0x1b0bcb[_0x3e0c('0x4c')]));};AGIVertices[_0x3e0c('0x18')]['custom_app']=function(_0x441251){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0xc9'),_0x441251[_0x3e0c('0xb0')]));var _0x245889=this[_0x3e0c('0xf')][_0x3e0c('0x5b')](_0x441251[_0x3e0c('0xca')],_0x441251[_0x3e0c('0x7e')]);if(_0x245889[_0x3e0c('0xab')]===-0x1){return _0x245889;}return this['channel'][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0xcb'),_0x441251[_0x3e0c('0xca')],_0x441251[_0x3e0c('0x7e')]));};AGIVertices[_0x3e0c('0x18')]['lumenvoxtts']=function(_0x4a3a06){logger['info'](util[_0x3e0c('0x2c')](_0x3e0c('0xcc'),_0x4a3a06[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0x4a3a06[_0x3e0c('0x60')])){return this[_0x3e0c('0xf')]['noop'](_0x3e0c('0xb2'));}var _0x59b603='\x22'+_0x4a3a06[_0x3e0c('0x60')]+'\x22';if(this[_0x3e0c('0x88')](_0x4a3a06[_0x3e0c('0x7e')])){_0x59b603+=','+_0x4a3a06['options'];}var _0x247613=this[_0x3e0c('0xf')][_0x3e0c('0x5b')]('MRCPSynth',_0x59b603);if(_0x247613[_0x3e0c('0xab')]===-0x1){return _0x247613;}return this[_0x3e0c('0xf')]['noop'](util[_0x3e0c('0x2c')](_0x3e0c('0xb3'),_0x59b603));};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0xcd')]=function(_0x315b7a){logger['info'](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x315b7a[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0x315b7a[_0x3e0c('0x60')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0xb2'));}var _0x2145f7='\x22'+_0x315b7a[_0x3e0c('0x60')]+'\x22';if(this[_0x3e0c('0x88')](_0x315b7a[_0x3e0c('0x7e')])){_0x2145f7+=','+_0x315b7a['options'];}var _0x125952=this[_0x3e0c('0xf')]['exec'](_0x3e0c('0xce'),_0x2145f7);if(_0x125952['result']===-0x1){return _0x125952;}return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0xb3'),_0x2145f7));};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0xcf')]=function(_0x2bd7c5){logger[_0x3e0c('0x30')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x2bd7c5[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0x2bd7c5['grammar'])){return this['channel'][_0x3e0c('0xb1')](_0x3e0c('0xd0'));}var _0x5849fb=_0x2bd7c5[_0x3e0c('0xd1')];if(this['isConfigured'](_0x2bd7c5[_0x3e0c('0x7e')])){_0x5849fb+=','+_0x2bd7c5[_0x3e0c('0x7e')];}var _0x459c86=this[_0x3e0c('0xf')][_0x3e0c('0x5b')](_0x3e0c('0xb6'),_0x5849fb);if(_0x459c86['result']===-0x1){return _0x459c86;}var _0x2c2bcf=this[_0x3e0c('0xa9')]('RECOG_CONFIDENCE()',_0x3e0c('0xd2'));if(_0x2c2bcf[_0x3e0c('0xab')]===-0x1){return _0x2c2bcf;}var _0x422e4b=this[_0x3e0c('0xa9')](_0x3e0c('0xd3'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x422e4b[_0x3e0c('0xab')]===-0x1){return _0x422e4b;}var _0x3b51fe=this['getAndSetVariable'](_0x3e0c('0xb9'),_0x3e0c('0xd4'));if(_0x3b51fe['result']===-0x1){return _0x3b51fe;}return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util['format'](_0x3e0c('0xbb'),_0x5849fb));};AGIVertices['prototype'][_0x3e0c('0xd5')]=function(_0x4d7fd8){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0xd6'),_0x4d7fd8['label']));if(!this['isConfigured'](_0x4d7fd8[_0x3e0c('0xd1')])){return this['channel'][_0x3e0c('0xb1')](_0x3e0c('0xd0'));}var _0x475f7c=_0x4d7fd8[_0x3e0c('0xd1')];if(this[_0x3e0c('0x88')](_0x4d7fd8[_0x3e0c('0x7e')])){_0x475f7c+=','+_0x4d7fd8[_0x3e0c('0x7e')];}var _0x216979=this[_0x3e0c('0xf')][_0x3e0c('0x5b')](_0x3e0c('0xb6'),_0x475f7c);if(_0x216979['result']===-0x1){return _0x216979;}var _0x5ddc39=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x3e0c('0xd7'));if(_0x5ddc39[_0x3e0c('0xab')]===-0x1){return _0x5ddc39;}var _0x298c01=this[_0x3e0c('0xa9')](_0x3e0c('0xd3'),'SESTEK_ASR_TRANSCRIPT');if(_0x298c01['result']===-0x1){return _0x298c01;}var _0x327bdb=this[_0x3e0c('0xa9')](_0x3e0c('0xb9'),_0x3e0c('0xd8'));if(_0x327bdb[_0x3e0c('0xab')]===-0x1){return _0x327bdb;}return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0xbb'),_0x475f7c));};AGIVertices['prototype'][_0x3e0c('0xd9')]=function(_0x22569c){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x22569c[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0x22569c[_0x3e0c('0xda')])){return this['channel']['error'](_0x22569c,'no\x20database\x20selected');}var _0x181c15=this['getSquareOdbc'][_0x3e0c('0x75')](this,_0x22569c[_0x3e0c('0xda')]);if(!_0x181c15){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x22569c,_0x3e0c('0xdb'));}if(!this[_0x3e0c('0x88')](_0x22569c['query'])){return this['channel']['error'](_0x22569c,_0x3e0c('0xdc'));}var _0x4b01ae=_0x22569c[_0x3e0c('0xdd')][_0x3e0c('0x5d')](/(\r\n|\n|\r)/gm,'\x20');this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0xde'),_0x4b01ae));var _0x37a348=this[_0x3e0c('0x2d')][_0x3e0c('0x75')](this,_0x181c15,_0x4b01ae);this['createSquareDetailsReport'][_0x3e0c('0x75')](this,_0x22569c,_0x4b01ae);if(!this[_0x3e0c('0x88')](_0x22569c[_0x3e0c('0xdf')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0xe0'));}var _0x369b13=this[_0x3e0c('0xaa')][_0x3e0c('0x75')](this,_0x22569c[_0x3e0c('0xdf')]);if(!_0x369b13){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x22569c,_0x3e0c('0xe1'));}var _0x1eb8f9=this;_0x37a348[_0x3e0c('0xe2')](function(_0x3b3cc7,_0x66440){Object[_0x3e0c('0xe3')](_0x3b3cc7)[_0x3e0c('0xe2')](function(_0xb1b85){_0x1eb8f9['channel'][_0x3e0c('0xa5')](util[_0x3e0c('0x2c')](_0x3e0c('0xe4'),_0x369b13,_0x66440,_0xb1b85),_0x3b3cc7[_0xb1b85]);});});this['channel'][_0x3e0c('0xa5')](util['format'](_0x3e0c('0xe5'),_0x369b13),_0x37a348[_0x3e0c('0xa0')]);return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0xe6'),_0x369b13));};AGIVertices[_0x3e0c('0x18')]['dial']=function(_0x503553){logger['debug'](util[_0x3e0c('0x2c')](_0x3e0c('0xe7'),_0x503553[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0x503553[_0x3e0c('0xe8')])){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x503553,'no\x20user\x20selected');}var _0x4131f3=this[_0x3e0c('0x1c')][_0x3e0c('0x75')](this,_0x503553[_0x3e0c('0xe8')]);if(!_0x4131f3){return this[_0x3e0c('0xf')]['error'](_0x503553,_0x3e0c('0xe9'));}var _0x4b12e9=this['channel'][_0x3e0c('0x5b')](_0x3e0c('0xea'),[util[_0x3e0c('0x2c')](_0x3e0c('0xeb'),_0x4131f3),_0x503553[_0x3e0c('0x6b')],_0x503553[_0x3e0c('0xec')],_0x503553[_0x3e0c('0x68')]]);if(_0x4b12e9[_0x3e0c('0xab')]===-0x1){return _0x4b12e9;}return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0xed'),_0x3e0c('0xea')));};AGIVertices[_0x3e0c('0x18')]['dialogflow']=function(_0x5c6a6b){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0xee'),_0x5c6a6b[_0x3e0c('0xb0')]));if(!this['isConfigured'](_0x5c6a6b[_0x3e0c('0x80')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')]('no\x20key\x20configured');}if(!this[_0x3e0c('0x88')](_0x5c6a6b[_0x3e0c('0x60')])){return this['channel'][_0x3e0c('0xb1')](_0x3e0c('0xb2'));}this[_0x3e0c('0xf')][_0x3e0c('0xef')]=!![];this[_0x3e0c('0x38')](_0x5c6a6b);this[_0x3e0c('0x44')](_0x5c6a6b['text'],'in','','');this[_0x3e0c('0xf')]['noop'](util[_0x3e0c('0x2c')](_0x3e0c('0xf0'),_0x5c6a6b['text']));var _0x51af5f=this['googleDialogflow'][_0x3e0c('0x75')](this,_0x5c6a6b);if(_0x51af5f){for(var _0x3f08d2 in _0x51af5f){if(_0x51af5f[_0x3e0c('0x9b')](_0x3f08d2)){this['channel'][_0x3e0c('0xa5')](util[_0x3e0c('0x2c')]('DIALOGFLOW_%s',_0x3f08d2[_0x3e0c('0x6e')]()),_0x51af5f[_0x3f08d2]);}}this['createSquareMessage'](_0x51af5f[_0x3e0c('0xf1')],_0x3e0c('0xf2'),_0x3e0c('0xf3'),'');return this['channel'][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0xf4'),_0x51af5f[_0x3e0c('0xf1')]));}return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x5c6a6b,_0x3e0c('0xf5'));};AGIVertices['prototype'][_0x3e0c('0xf6')]=function(_0x6d6929){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0xf7'),_0x6d6929['label']));if(!this[_0x3e0c('0x88')](_0x6d6929['dialogflowV2_project_id'])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0xf8'));}if(!this[_0x3e0c('0x88')](_0x6d6929[_0x3e0c('0xf9')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0xfa'));}if(!this[_0x3e0c('0x88')](_0x6d6929['private_key'])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')]('no\x20private_key\x20configured');}if(!this[_0x3e0c('0x88')](_0x6d6929[_0x3e0c('0x84')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')]('no\x20anguage\x20configured');}if(!this[_0x3e0c('0x88')](_0x6d6929[_0x3e0c('0x60')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0xb2'));}this[_0x3e0c('0xf')][_0x3e0c('0xef')]=!![];this[_0x3e0c('0x38')](_0x6d6929);this[_0x3e0c('0x44')](_0x6d6929[_0x3e0c('0x60')],'in','','');this['channel'][_0x3e0c('0xb1')](util['format'](_0x3e0c('0xfb'),_0x6d6929[_0x3e0c('0x60')]));var _0xc337b5=this[_0x3e0c('0x82')][_0x3e0c('0x75')](this,_0x6d6929);if(_0xc337b5){for(var _0x2fd3ad in _0xc337b5){if(_0xc337b5[_0x3e0c('0x9b')](_0x2fd3ad)){if(_0x2fd3ad!==_0x3e0c('0xfc')){this['channel'][_0x3e0c('0xa5')](util[_0x3e0c('0x2c')](_0x3e0c('0xfd'),_0x2fd3ad['toUpperCase']()),_0xc337b5[_0x2fd3ad]);}}}this[_0x3e0c('0x44')](_0xc337b5['speech'],'out',_0x3e0c('0xf6'),_0xc337b5[_0x3e0c('0xfc')]);return this['channel'][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0xfe'),_0xc337b5[_0x3e0c('0xf1')]));}return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x6d6929,_0x3e0c('0xff'));};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x100')]=function(_0x1d8318){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x101'),_0x1d8318[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0x1d8318[_0x3e0c('0x102')])){return this['channel'][_0x3e0c('0xb1')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x3e0c('0x88')](_0x1d8318[_0x3e0c('0x103')])){return this['channel'][_0x3e0c('0xb1')](_0x3e0c('0x104'));}if(!this['isConfigured'](_0x1d8318[_0x3e0c('0x105')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0x106'));}if(!this['isConfigured'](_0x1d8318[_0x3e0c('0x107')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0xb2'));}this[_0x3e0c('0xf')][_0x3e0c('0xef')]=!![];this[_0x3e0c('0x38')](_0x1d8318);this[_0x3e0c('0x44')](_0x1d8318['text'],'in','','');this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0x108'),_0x1d8318[_0x3e0c('0x60')]));var _0x58c76d=this[_0x3e0c('0x109')][_0x3e0c('0x75')](this,_0x1d8318);if(_0x58c76d){for(var _0x157287 in _0x58c76d){if(_0x58c76d[_0x3e0c('0x9b')](_0x157287)){this[_0x3e0c('0xf')]['setVariable'](util[_0x3e0c('0x2c')](_0x3e0c('0x10a'),_0x157287[_0x3e0c('0x6e')]()),_0x58c76d[_0x157287]);}}this['createSquareMessage'](_0x58c76d['speech'],'out',_0x3e0c('0x100'),'');if(_0x58c76d[_0x3e0c('0x10b')]){this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x58c76d[_0x3e0c('0x10b')]));var _0x22c98e=this[_0x3e0c('0xf')]['streamFile'](_0x58c76d[_0x3e0c('0x10b')]);try{fs['unlink'](_0x58c76d['audiofile']+_0x3e0c('0x10c'));}catch(_0x5ec54d){logger[_0x3e0c('0x34')](_0x5ec54d);}return _0x22c98e;}else{return this['channel']['noop'](util['format'](_0x3e0c('0x10d'),_0x58c76d[_0x3e0c('0xf1')]));}}return this['channel']['error'](_0x1d8318,_0x3e0c('0x10e'));};AGIVertices['prototype']['end']=function(_0x1b2be7){logger['info'](util[_0x3e0c('0x2c')]('Enter\x20in\x20END\x20(%s)\x20block',_0x1b2be7['label']));return this[_0x3e0c('0xf')]['noop']('end');};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x10f')]=function(_0x17c72a){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x110'),_0x17c72a[_0x3e0c('0xb0')]));var _0x45f3c7='';if(_0x17c72a[_0x3e0c('0x111')]){if(!this[_0x3e0c('0x88')](_0x17c72a[_0x3e0c('0x111')])){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x17c72a,_0x3e0c('0x112'));}else{var _0x192f3a=parseInt(_0x17c72a[_0x3e0c('0x111')],0xa);if(isNaN(_0x192f3a)){_0x45f3c7=_0x17c72a[_0x3e0c('0x111')];}else{_0x45f3c7=this['getTrunk']['sync'](this,_0x17c72a[_0x3e0c('0x111')]);if(!_0x45f3c7){return this['channel'][_0x3e0c('0x34')](_0x17c72a,'no\x20trunk\x20found');}}}}else if(_0x17c72a[_0x3e0c('0x113')]){_0x45f3c7=_0x17c72a[_0x3e0c('0x113')];}else{return this[_0x3e0c('0xf')]['error'](_0x17c72a,_0x3e0c('0x112'));}var _0x1e0bd6=this[_0x3e0c('0xf')][_0x3e0c('0x5b')](_0x3e0c('0xea'),[util[_0x3e0c('0x2c')](_0x3e0c('0x114'),_0x45f3c7,_0x17c72a[_0x3e0c('0xc8')]),_0x17c72a['timeout'],_0x17c72a[_0x3e0c('0xec')],_0x17c72a[_0x3e0c('0x68')]]);if(_0x1e0bd6[_0x3e0c('0xab')]===-0x1){return _0x1e0bd6;}return this['channel'][_0x3e0c('0xb1')](util['format']('Executed\x20command\x20%s',_0x3e0c('0xea')));};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x115')]=function(_0x83a3c){logger['info'](util[_0x3e0c('0x2c')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x83a3c[_0x3e0c('0xb0')]));return this[_0x3e0c('0xf')]['noop'](_0x3e0c('0x115'));};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0xd')]=function(_0x43a46e){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x43a46e['label']));if(_0x43a46e[_0x3e0c('0xad')]===0x0){return this[_0x3e0c('0xac')](_0x43a46e);}_0x43a46e[_0x3e0c('0xad')]-=0x1;if(!this[_0x3e0c('0x88')](_0x43a46e[_0x3e0c('0x116')])){return this['channel'][_0x3e0c('0x34')](_0x43a46e,'no\x20file\x20audio\x20selected');}var _0x5c2b86=this['getSound'][_0x3e0c('0x75')](this,_0x43a46e[_0x3e0c('0x116')]);if(!_0x5c2b86){return this[_0x3e0c('0xf')]['error'](_0x43a46e,_0x3e0c('0x117'));}if(!this[_0x3e0c('0x88')](_0x43a46e[_0x3e0c('0xdf')])){return this['channel'][_0x3e0c('0x34')](_0x3e0c('0xe0'));}var _0x3941f1=this['channel'][_0x3e0c('0x118')](_0x5c2b86,_0x43a46e[_0x3e0c('0x119')],_0x43a46e[_0x3e0c('0x11a')]);var _0x43f4a8=_0x3941f1[_0x3e0c('0xab')]?_0x3941f1['result'][_0x3e0c('0x4f')]():'';logger[_0x3e0c('0x30')]('test',JSON[_0x3e0c('0x78')](_0x3941f1));if(_0x3941f1[_0x3e0c('0xab')]===-0x1){this[_0x3e0c('0x38')][_0x3e0c('0x75')](this,_0x43a46e,_0x43f4a8);return _0x3941f1;}else if(_0x3941f1['extra']==='timeout'){_0x3941f1['result']=_0x43f4a8[_0x3e0c('0xa0')]>=parseInt(_0x43a46e[_0x3e0c('0x11b')])?'x':'i';}else{_0x3941f1['result']=_0x43f4a8['length']>=parseInt(_0x43a46e[_0x3e0c('0x11b')])&&_0x43f4a8[_0x3e0c('0xa0')]<=parseInt(_0x43a46e['maxdigit'])?'x':'i';}var _0x47e91a=this[_0x3e0c('0xaa')][_0x3e0c('0x75')](this,_0x43a46e[_0x3e0c('0xdf')]);if(!_0x47e91a){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x43a46e,_0x3e0c('0xe1'));}this['channel']['setVariable'](_0x47e91a,_0x43f4a8);if(this[_0x3e0c('0x88')](_0x43a46e[_0x3e0c('0x11c')])){var _0x33ca60=parseInt(_0x43a46e[_0x3e0c('0x11c')],0xa);var _0x15e86e=rs[_0x3e0c('0x11d')]({'charset':'*','length':_0x33ca60});var _0x49a8e6=_0x43f4a8[_0x3e0c('0xa0')];if(_0x49a8e6>0x0){if(_0x49a8e6>_0x33ca60){this[_0x3e0c('0x38')][_0x3e0c('0x75')](this,_0x43a46e,_0x43a46e[_0x3e0c('0x11e')]===_0x3e0c('0x11f')?_0x15e86e+_0x43f4a8[_0x3e0c('0x120')](_0x33ca60):_0x43f4a8[_0x3e0c('0x120')](0x0,_0x49a8e6-_0x33ca60)+_0x15e86e);}else{this[_0x3e0c('0x38')][_0x3e0c('0x75')](this,_0x43a46e,rs['generate']({'charset':'*','length':_0x49a8e6}));}}else{this[_0x3e0c('0x38')]['sync'](this,_0x43a46e,'');}}else{this[_0x3e0c('0x38')][_0x3e0c('0x75')](this,_0x43a46e,_0x43f4a8);}return _0x3941f1;};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0xe')]=function(_0x1de5ae){logger[_0x3e0c('0x30')](util['format'](_0x3e0c('0x121'),_0x1de5ae[_0x3e0c('0xb0')]));return this[_0x3e0c('0xd')](_0x1de5ae);};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x122')]=function(_0xc848fa){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x123'),_0xc848fa[_0x3e0c('0xb0')]));this[_0x3e0c('0x38')][_0x3e0c('0x75')](this,_0xc848fa,_0xc848fa[_0x3e0c('0x124')]);return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0x125'),_0xc848fa['goalname']));};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x126')]=function(_0x5eb9d5){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x127'),_0x5eb9d5['label']));if(!this['isConfigured'](_0x5eb9d5['aws_access_key_id'])||!this[_0x3e0c('0x88')](_0x5eb9d5[_0x3e0c('0x8c')])){return this[_0x3e0c('0xf')]['noop'](_0x3e0c('0x128'));}if(!this[_0x3e0c('0x88')](_0x5eb9d5[_0x3e0c('0x60')])){return this['channel']['noop'](_0x3e0c('0xb2'));}this['channel'][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0x129'),_0x5eb9d5[_0x3e0c('0x60')]));var _0x1f0363=this[_0x3e0c('0x8a')][_0x3e0c('0x75')](this,_0x5eb9d5);if(_0x1f0363){this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')]('aws\x20Polly\x20%s\x20file\x20created',_0x1f0363));var _0x4a9af0=this[_0x3e0c('0xf')]['streamFile'](_0x1f0363);try{fs[_0x3e0c('0x12a')](_0x1f0363+_0x3e0c('0x10c'));}catch(_0xfcf61e){logger[_0x3e0c('0x34')](_0xfcf61e);}return _0x4a9af0;}return this['channel'][_0x3e0c('0x34')](_0x5eb9d5,_0x3e0c('0x12b'));};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x12c')]=function(_0x349dd0){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x12d'),_0x349dd0[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0x349dd0['aws_access_key_id'])||!this[_0x3e0c('0x88')](_0x349dd0['aws_secret_access_key'])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0x128'));}if(!this[_0x3e0c('0x88')](_0x349dd0[_0x3e0c('0x93')])){return this['channel'][_0x3e0c('0xb1')]('no\x20bot\x20name\x20configured');}if(!this[_0x3e0c('0x88')](_0x349dd0[_0x3e0c('0x60')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0xb2'));}this[_0x3e0c('0xf')]['bot']=!![];this[_0x3e0c('0x38')](_0x349dd0);this[_0x3e0c('0x44')](_0x349dd0[_0x3e0c('0x60')],'in','','');this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x349dd0[_0x3e0c('0x60')]));var _0x3f2abe=this[_0x3e0c('0x91')][_0x3e0c('0x75')](this,_0x349dd0);if(_0x3f2abe){for(var _0x5d6132 in _0x3f2abe){if(_0x3f2abe[_0x3e0c('0x9b')](_0x5d6132)&&_[_0x3e0c('0xa2')](_0x3f2abe[_0x5d6132])){this[_0x3e0c('0xf')][_0x3e0c('0xa5')](util[_0x3e0c('0x2c')](_0x3e0c('0x12e'),_0x5d6132[_0x3e0c('0x6e')]()),_0x3f2abe[_0x5d6132]);}}if(_['isNil'](_0x3f2abe[_0x3e0c('0x7c')])){return this['channel'][_0x3e0c('0xb1')](_0x3e0c('0x12f'));}else{this[_0x3e0c('0x44')](_0x3f2abe['message'],_0x3e0c('0xf2'),'amazonlex','');return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0x130'),_0x3f2abe['message']));}}return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x349dd0,_0x3e0c('0x131'));};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x132')]=function(_0x1c264f){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x133'),_0x1c264f[_0x3e0c('0xb0')],_0x1c264f[_0x3e0c('0x6b')]));if(!this['isConfigured'](_0x1c264f[_0x3e0c('0x80')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0x134'));}var _0x5df385=_0x3e0c('0x135');var _0x2f3697=util[_0x3e0c('0x2c')](_0x3e0c('0x136'),FILES_PATH,rs[_0x3e0c('0x11d')](0x4));var _0x3b300d=util['format'](_0x3e0c('0xa4'),_0x2f3697,_0x5df385);var _0x37c5cb=!![];if(_0x1c264f['beep']==='NOBEEP'){_0x37c5cb=![];}var _0x15d9e2=this[_0x3e0c('0xf')]['recordFile'](_0x2f3697,_0x5df385,_0x1c264f[_0x3e0c('0x137')],_0x1c264f['timeout'],undefined,_0x37c5cb);if(_0x15d9e2[_0x3e0c('0xab')]!==-0x1){this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0x138'),_0x3b300d));var _0x397439=this[_0x3e0c('0x94')][_0x3e0c('0x75')](this,_0x1c264f,_0x3b300d);if(_0x397439){for(var _0x3918dd in _0x397439){if(_0x397439[_0x3e0c('0x9b')](_0x3918dd)){this[_0x3e0c('0xf')]['setVariable'](util[_0x3e0c('0x2c')](_0x3e0c('0x139'),_0x3918dd[_0x3e0c('0x6e')]()),_0x397439[_0x3918dd]);}}return this[_0x3e0c('0xf')]['noop'](util[_0x3e0c('0x2c')](_0x3e0c('0x13a'),JSON[_0x3e0c('0x78')](_0x397439)));}}return _0x15d9e2;};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x13b')]=function(_0x438512){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x13c'),_0x438512[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0x438512[_0x3e0c('0x97')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0x13d'));}if(!this[_0x3e0c('0x88')](_0x438512[_0x3e0c('0x98')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0x13e'));}var _0x5369dc=_0x3e0c('0x135');var _0xcf8e84=util[_0x3e0c('0x2c')](_0x3e0c('0x136'),FILES_PATH,rs[_0x3e0c('0x11d')](0x4));var _0x522474=util[_0x3e0c('0x2c')](_0x3e0c('0xa4'),_0xcf8e84,_0x5369dc);var _0xc3ed7c=!![];if(_0x438512[_0x3e0c('0x13f')]==='NOBEEP'){_0xc3ed7c=![];}var _0x521099=this[_0x3e0c('0xf')][_0x3e0c('0x140')](_0xcf8e84,_0x5369dc,_0x438512[_0x3e0c('0x137')],_0x438512['timeout'],undefined,_0xc3ed7c);if(_0x521099[_0x3e0c('0xab')]!==-0x1){this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util['format'](_0x3e0c('0x141'),_0x522474));var _0x1b4672=this[_0x3e0c('0x96')][_0x3e0c('0x75')](this,_0x438512,_0x522474);if(_0x1b4672){for(var _0x56e62b in _0x1b4672){if(_0x1b4672[_0x3e0c('0x9b')](_0x56e62b)){this[_0x3e0c('0xf')]['setVariable'](util[_0x3e0c('0x2c')]('TILDE_ASR_%s',_0x56e62b[_0x3e0c('0x6e')]()),_0x1b4672[_0x56e62b]);}}return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util['format'](_0x3e0c('0x142'),JSON[_0x3e0c('0x78')](_0x1b4672)));}}return _0x521099;};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x143')]=function(_0x5116c1){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x144'),_0x5116c1[_0x3e0c('0xb0')]));return this[_0x3e0c('0xf')][_0x3e0c('0x145')](_0x5116c1[_0x3e0c('0x146')],_0x5116c1[_0x3e0c('0x3f')],_0x5116c1[_0x3e0c('0x40')]);};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x147')]=function(_0x4419b4){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x148'),_0x4419b4['label']));if(!this[_0x3e0c('0x88')](_0x4419b4[_0x3e0c('0x149')])){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x4419b4,_0x3e0c('0x14a'));}try{var _0x4c88d2=eval(_0x4419b4[_0x3e0c('0x149')])?'true':_0x3e0c('0x14b');this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x4419b4['condition'],_0x4c88d2));return{'code':0xc8,'result':_0x4c88d2};}catch(_0x194cb1){return{'code':0xc8,'result':_0x3e0c('0x14b')};}};AGIVertices['prototype'][_0x3e0c('0x14c')]=function(_0x1cc0da){logger[_0x3e0c('0x30')](util['format'](_0x3e0c('0x14d'),_0x1cc0da[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0x1cc0da[_0x3e0c('0x14e')])){return this['channel']['error'](_0x1cc0da,_0x3e0c('0x14f'));}var _0x3c9eba=this[_0x3e0c('0x27')]['sync'](this,_0x1cc0da[_0x3e0c('0x14e')]);if(!_0x3c9eba){return this['channel'][_0x3e0c('0x34')](_0x1cc0da,_0x3e0c('0x150'));}for(var _0x4699f1=0x0;_0x4699f1<_0x3c9eba[_0x3e0c('0xa0')];_0x4699f1+=0x1){var _0x847824=this['channel']['getVariable'](util[_0x3e0c('0x2c')](_0x3e0c('0x151'),_0x3c9eba[_0x4699f1]));if(_0x847824[_0x3e0c('0xab')]===-0x1){return _0x847824;}logger[_0x3e0c('0x30')](util['format']('IFTIME\x20%s\x20%s',_0x3c9eba[_0x4699f1],_0x847824[_0x3e0c('0xa8')]));if(_0x847824[_0x3e0c('0xa8')]===_0x3e0c('0x152')){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')]('IFTIME\x20%s\x20%s',_0x3c9eba[_0x4699f1],_0x3e0c('0x152')));this['channel']['noop'](util['format'](_0x3e0c('0x153'),_0x3c9eba[_0x4699f1],_0x3e0c('0x152')));return{'code':0xc8,'result':_0x3e0c('0x152')};}else{logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x153'),_0x3c9eba[_0x4699f1],_0x3e0c('0x14b')));this[_0x3e0c('0xf')]['noop'](util[_0x3e0c('0x2c')](_0x3e0c('0x153'),_0x3c9eba[_0x4699f1],'false'));}}return{'code':0xc8,'result':_0x3e0c('0x14b')};};AGIVertices[_0x3e0c('0x18')]['hangup']=function(_0x3aee6f){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x3aee6f[_0x3e0c('0xb0')]));return this[_0x3e0c('0xf')][_0x3e0c('0x154')]();};AGIVertices['prototype'][_0x3e0c('0x155')]=function(_0x1b26bf){logger[_0x3e0c('0x30')](util['format'](_0x3e0c('0x156'),_0x1b26bf[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0x1b26bf['key'])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')]('no\x20key\x20configured');}var _0x233139=_0x3e0c('0x135');var _0x584a2d=util[_0x3e0c('0x2c')](_0x3e0c('0x136'),FILES_PATH,rs[_0x3e0c('0x11d')](0x4));var _0x48086e=util[_0x3e0c('0x2c')](_0x3e0c('0xa4'),_0x584a2d,_0x233139);var _0x4c1dbf=!![];if(_0x1b26bf['beep']==='NOBEEP'){_0x4c1dbf=![];}var _0x2fe4a2=this[_0x3e0c('0xf')][_0x3e0c('0x140')](_0x584a2d,_0x233139,_0x1b26bf['intKey'],_0x1b26bf[_0x3e0c('0x6b')],undefined,_0x4c1dbf);if(_0x2fe4a2[_0x3e0c('0xab')]!==-0x1){this['channel'][_0x3e0c('0xb1')](util['format'](_0x3e0c('0x157'),_0x48086e));var _0xc2a0dc=this[_0x3e0c('0x87')][_0x3e0c('0x75')](this,_0x1b26bf,_0x48086e);if(_0xc2a0dc){for(var _0x46da0c in _0xc2a0dc){if(_0xc2a0dc['hasOwnProperty'](_0x46da0c)){this['channel'][_0x3e0c('0xa5')](util[_0x3e0c('0x2c')]('ISPEECH_ASR_%s',_0x46da0c[_0x3e0c('0x6e')]()),_0xc2a0dc[_0x46da0c]);}}return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')]('IspeechASR\x20Result\x20%s',JSON[_0x3e0c('0x78')](_0xc2a0dc)));}}return _0x2fe4a2;};AGIVertices['prototype'][_0x3e0c('0x158')]=function(_0x2100c4){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x159'),_0x2100c4[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0x2100c4['key'])){return this['channel'][_0x3e0c('0xb1')](_0x3e0c('0x134'));}if(!this[_0x3e0c('0x88')](_0x2100c4[_0x3e0c('0x60')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0xb2'));}this[_0x3e0c('0xf')]['noop'](util[_0x3e0c('0x2c')](_0x3e0c('0x15a'),_0x2100c4[_0x3e0c('0x60')]));var _0x23dc44=this[_0x3e0c('0x85')][_0x3e0c('0x75')](this,_0x2100c4);if(_0x23dc44){this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0x157'),_0x23dc44));var _0x55851a=this[_0x3e0c('0xf')][_0x3e0c('0x15b')](_0x23dc44,_0x2100c4[_0x3e0c('0x137')]);try{fs[_0x3e0c('0x12a')](_0x23dc44+_0x3e0c('0x10c'));}catch(_0x5d7df9){logger[_0x3e0c('0x34')](_0x5d7df9);}return _0x55851a;}return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x2100c4,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x3e0c('0x18')]['login']=function(_0x3be33f){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x15c'),_0x3be33f[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0x3be33f[_0x3e0c('0x15d')])){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x3be33f,_0x3e0c('0x15e'));}logger['info'](util[_0x3e0c('0x2c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x3e0c('0x3c')],_0x3be33f[_0x3e0c('0x15d')]));var _0x3d6309=this['agentLogin']['sync'](this,_0x3be33f[_0x3e0c('0x15d')]);if(_0x3d6309){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3e0c('0xf')]['callerid'],_0x3be33f[_0x3e0c('0x15d')]));this[_0x3e0c('0xf')]['noop'](util['format'](_0x3e0c('0x15f'),this[_0x3e0c('0xf')][_0x3e0c('0x3c')],_0x3be33f[_0x3e0c('0x15d')]));return{'code':0xc8,'result':_0x3e0c('0x160')};}else{logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x161'),this['channel']['callerid'],_0x3be33f[_0x3e0c('0x15d')]));this['channel'][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0x161'),this[_0x3e0c('0xf')][_0x3e0c('0x3c')],_0x3be33f[_0x3e0c('0x15d')]));return{'code':0xc8,'result':_0x3e0c('0x162')};}};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x163')]=function(_0x5a0d48){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x164'),_0x5a0d48[_0x3e0c('0xb0')]));if(!this['isConfigured'](_0x5a0d48[_0x3e0c('0x15d')])){return this['channel']['error'](_0x5a0d48,_0x3e0c('0x15e'));}logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x3e0c('0xf')][_0x3e0c('0x3c')],_0x5a0d48['findBy']));var _0x2867de=this[_0x3e0c('0x55')][_0x3e0c('0x75')](this,_0x5a0d48[_0x3e0c('0x15d')]);if(_0x2867de){logger['info'](util[_0x3e0c('0x2c')](_0x3e0c('0x15f'),this['channel'][_0x3e0c('0x3c')],_0x5a0d48[_0x3e0c('0x15d')]));this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0x15f'),this[_0x3e0c('0xf')][_0x3e0c('0x3c')],_0x5a0d48[_0x3e0c('0x15d')]));return{'code':0xc8,'result':_0x3e0c('0x160')};}else{logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x161'),this[_0x3e0c('0xf')][_0x3e0c('0x3c')],_0x5a0d48[_0x3e0c('0x15d')]));this[_0x3e0c('0xf')]['noop'](util[_0x3e0c('0x2c')](_0x3e0c('0x161'),this[_0x3e0c('0xf')][_0x3e0c('0x3c')],_0x5a0d48['findBy']));return{'code':0xc8,'result':_0x3e0c('0x162')};}};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x165')]=function(_0x21694d){logger['info'](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x21694d['label']));if(!this['isConfigured'](_0x21694d[_0x3e0c('0x166')])){return this[_0x3e0c('0xf')]['error'](_0x21694d,'no\x20operation\x20configured');}this[_0x3e0c('0xf')]['noop'](util[_0x3e0c('0x2c')]('math\x20%s',_0x21694d['operation']));var _0x42b2b7=eval(_0x21694d[_0x3e0c('0x166')]);if(!this[_0x3e0c('0x88')](_0x21694d[_0x3e0c('0xdf')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0xe0'));}var _0x1f38ee=this[_0x3e0c('0xaa')][_0x3e0c('0x75')](this,_0x21694d[_0x3e0c('0xdf')]);if(!_0x1f38ee){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x21694d,_0x3e0c('0xe1'));}if(_[_0x3e0c('0x9f')](_0x42b2b7)){var _0x143a41=this;_0x42b2b7[_0x3e0c('0xe2')](function(_0x30d08a,_0x221e19){_0x143a41[_0x3e0c('0xf')][_0x3e0c('0xa5')](util[_0x3e0c('0x2c')](_0x3e0c('0x167'),_0x1f38ee,_0x221e19),_0x30d08a);});return this[_0x3e0c('0xf')]['noop'](util['format']('variable\x20%s[key]\x20set',_0x1f38ee));}else{return this[_0x3e0c('0xf')][_0x3e0c('0xa5')](_0x1f38ee,_0x42b2b7);}};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0xc')]=function(_0x264750){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x168'),_0x264750[_0x3e0c('0xb0')]));if(_0x264750['retry']===0x0){return this[_0x3e0c('0xac')](_0x264750);}_0x264750[_0x3e0c('0xad')]-=0x1;if(!this[_0x3e0c('0x88')](_0x264750['file_id'])){return this['channel']['error'](_0x264750,_0x3e0c('0x169'));}var _0x45bdeb=this[_0x3e0c('0x20')][_0x3e0c('0x75')](this,_0x264750[_0x3e0c('0x116')]);if(!_0x45bdeb){return this['channel']['error'](_0x264750,_0x3e0c('0x117'));}var _0xa6297e=this[_0x3e0c('0xf')][_0x3e0c('0x118')](_0x45bdeb,_0x264750[_0x3e0c('0x119')],_0x264750[_0x3e0c('0x16a')]);var _0x19efa6=_0xa6297e[_0x3e0c('0xab')];if(_0xa6297e[_0x3e0c('0xab')]===-0x1){this[_0x3e0c('0x38')][_0x3e0c('0x75')](this,_0x264750,'-1');return _0xa6297e;}else if(_0xa6297e[_0x3e0c('0xa8')]===_0x3e0c('0x6b')){_0xa6297e[_0x3e0c('0xab')]=_0xa6297e['result']['length']>0x0?_0xa6297e[_0x3e0c('0xab')]:'t';}else if(_[_0x3e0c('0x46')](_0xa6297e[_0x3e0c('0xab')])){_0xa6297e[_0x3e0c('0xab')]='#';_0x19efa6='#';}if(!this['isConfigured'](_0x264750[_0x3e0c('0xdf')])){this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x1c6c2b=this[_0x3e0c('0xaa')][_0x3e0c('0x75')](this,_0x264750['variable_id']);if(!_0x1c6c2b){return this['channel'][_0x3e0c('0x34')](_0x264750,'no\x20variable\x20found');}this[_0x3e0c('0xf')][_0x3e0c('0xa5')](_0x1c6c2b,_0x19efa6);}this[_0x3e0c('0x38')][_0x3e0c('0x75')](this,_0x264750,_0x19efa6);return _0xa6297e;};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0xb1')]=function(_0x1b9a63){logger['info'](util[_0x3e0c('0x2c')](_0x3e0c('0x16b'),_0x1b9a63[_0x3e0c('0xb0')]));return this[_0x3e0c('0xf')]['noop'](_0x1b9a63[_0x3e0c('0x16c')]||_0x1b9a63[_0x3e0c('0xb0')]);};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x16d')]=function(_0x6508fb){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x16e'),_0x6508fb['label']));if(!this[_0x3e0c('0x88')](_0x6508fb[_0x3e0c('0x15d')])){return this['channel']['error'](_0x6508fb,'no\x20find\x20by\x20configured');}logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x16f'),this['channel'][_0x3e0c('0x3c')],_0x6508fb[_0x3e0c('0x15d')]));var _0x2ed0ca=this['getPause'][_0x3e0c('0x75')](this,_0x6508fb[_0x3e0c('0x170')]);var _0x117627=this[_0x3e0c('0x52')][_0x3e0c('0x75')](this,_0x6508fb[_0x3e0c('0x15d')],_0x2ed0ca);if(_0x117627){logger['info'](util[_0x3e0c('0x2c')](_0x3e0c('0x15f'),this[_0x3e0c('0xf')]['callerid'],_0x6508fb[_0x3e0c('0x15d')]));this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0x15f'),this[_0x3e0c('0xf')][_0x3e0c('0x3c')],_0x6508fb[_0x3e0c('0x15d')]));return{'code':0xc8,'result':_0x3e0c('0x160')};}else{logger[_0x3e0c('0x30')](util['format'](_0x3e0c('0x161'),this['channel'][_0x3e0c('0x3c')],_0x6508fb[_0x3e0c('0x15d')]));this[_0x3e0c('0xf')]['noop'](util[_0x3e0c('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3e0c('0xf')][_0x3e0c('0x3c')],_0x6508fb[_0x3e0c('0x15d')]));return{'code':0xc8,'result':_0x3e0c('0x162')};}};AGIVertices[_0x3e0c('0x18')]['playback']=function(_0x53e4e2){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x171'),_0x53e4e2[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0x53e4e2[_0x3e0c('0x116')])){return this[_0x3e0c('0xf')]['error'](_0x53e4e2,_0x3e0c('0x169'));}var _0x4f97cd=this['getSound'][_0x3e0c('0x75')](this,_0x53e4e2[_0x3e0c('0x116')]);if(!_0x4f97cd){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x53e4e2,_0x3e0c('0x117'));}var _0x5990a1=this[_0x3e0c('0xf')][_0x3e0c('0x5b')](_0x3e0c('0x172'),[_0x4f97cd,_0x53e4e2['opts']]);if(_0x5990a1[_0x3e0c('0xab')]===-0x1){return _0x5990a1;}return this['channel'][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0xcb'),_0x3e0c('0x172'),_0x4f97cd));};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x173')]=function(_0x3dc57f){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x174'),_0x3dc57f['label']));if(!this[_0x3e0c('0x88')](_0x3dc57f['queue_id'])){return this['channel'][_0x3e0c('0x34')](_0x3dc57f,_0x3e0c('0x175'));}var _0x4242ec='';var _0x52e4a1=parseInt(_0x3dc57f[_0x3e0c('0x176')],0xa);if(isNaN(_0x52e4a1)){_0x4242ec=_0x3dc57f[_0x3e0c('0x176')];}else{_0x4242ec=this[_0x3e0c('0x15')][_0x3e0c('0x75')](this,_0x3dc57f['queue_id']);if(!_0x4242ec){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x3dc57f,'no\x20queue\x20found');}}var _0x9cb5f4='';if(this[_0x3e0c('0x88')](_0x3dc57f['file_id'])){var _0x94a115=this[_0x3e0c('0x20')][_0x3e0c('0x75')](this,_0x3dc57f[_0x3e0c('0x116')]);if(_0x94a115){_0x9cb5f4=_0x94a115;}}this[_0x3e0c('0x38')][_0x3e0c('0x75')](this,_0x3dc57f,_0x4242ec);if(_0x3dc57f[_0x3e0c('0xec')][_0x3e0c('0x177')]('x')<0x0){_0x3dc57f[_0x3e0c('0xec')]+='x';}if(_0x3dc57f[_0x3e0c('0xec')]['indexOf']('X')<0x0){_0x3dc57f[_0x3e0c('0xec')]+='X';}this[_0x3e0c('0xf')]['setVariable']('XMCS-QUEUE',_0x4242ec?_0x4242ec['toLowerCase']():'');var _0x2f0135=this['channel'][_0x3e0c('0x5b')](_0x3e0c('0x178'),[_0x4242ec,_0x3dc57f[_0x3e0c('0xec')],_0x3dc57f[_0x3e0c('0x68')],_0x9cb5f4,_0x3dc57f[_0x3e0c('0x6b')],_0x3dc57f[_0x3e0c('0x8')],_0x3dc57f[_0x3e0c('0x179')],_0x3dc57f[_0x3e0c('0x17a')],'',_0x3dc57f[_0x3e0c('0x17b')]]);if(_0x2f0135[_0x3e0c('0xab')]===-0x1){return _0x2f0135;}return this['channel']['noop'](util[_0x3e0c('0x2c')](_0x3e0c('0xcb'),_0x3e0c('0x178'),_0x4242ec));};AGIVertices['prototype'][_0x3e0c('0x17c')]=function(_0x54c81d){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x17d'),_0x54c81d[_0x3e0c('0xb0')]));var _0x5640a5=_0x54c81d[_0x3e0c('0x17e')]||_0x3e0c('0x135');var _0x3221f9=util[_0x3e0c('0x2c')]('%s_%s',this[_0x3e0c('0xf')][_0x3e0c('0x39')],rs[_0x3e0c('0x11d')](0x5));var _0x1dd618=util['format'](_0x3e0c('0x17f'),FILES_PATH,_0x3221f9,_0x5640a5);var _0x103307=util[_0x3e0c('0x2c')](_0x3e0c('0x136'),FILES_PATH,_0x3221f9);this[_0x3e0c('0x3d')][_0x3e0c('0x75')](this,_0x54c81d,_0x3221f9,_0x1dd618);this[_0x3e0c('0xf')][_0x3e0c('0xa5')](_0x3e0c('0x180'),_0x3221f9);logger[_0x3e0c('0x30')](_0x3e0c('0x181'),_0x103307,_0x5640a5,_0x54c81d[_0x3e0c('0x182')],_0x54c81d[_0x3e0c('0x6b')]);return this[_0x3e0c('0xf')][_0x3e0c('0x140')](_0x103307,_0x5640a5,_0x54c81d[_0x3e0c('0x182')],_0x54c81d[_0x3e0c('0x6b')],undefined,!![]);};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x183')]=function(_0xd59940){logger['info'](util['format'](_0x3e0c('0x184'),_0xd59940[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0xd59940[_0x3e0c('0x68')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0x185'));}var _0x1c1dc9=this[_0x3e0c('0x67')][_0x3e0c('0x75')](this,_0xd59940);logger['info'](util['format']('Response:',util[_0x3e0c('0x186')](_0x1c1dc9,{'showHidden':![],'depth':null})));if(!this[_0x3e0c('0x88')](_0xd59940['variable_id'])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0x187'));}var _0xae8670=this[_0x3e0c('0xaa')][_0x3e0c('0x75')](this,_0xd59940[_0x3e0c('0xdf')]);if(!_0xae8670){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0xd59940,'no\x20variable\x20found');}this[_0x3e0c('0xf')]['setVariable'](util[_0x3e0c('0x2c')](_0x3e0c('0x188'),_0xae8670),_0x1c1dc9[_0x3e0c('0x7a')]?_0x1c1dc9[_0x3e0c('0x7a')]:_0x3e0c('0x189'));this['channel'][_0x3e0c('0xa5')](util[_0x3e0c('0x2c')](_0x3e0c('0x18a'),_0xae8670),_0x1c1dc9[_0x3e0c('0x7b')]?_0x1c1dc9[_0x3e0c('0x7b')]:'OK');if(_0x1c1dc9[_0x3e0c('0x6f')]){try{this[_0x3e0c('0xa3')](_0x1c1dc9[_0x3e0c('0x6f')],_0xae8670);}catch(_0x437629){logger[_0x3e0c('0x34')](util[_0x3e0c('0x2c')](_0x3e0c('0x18b'),_0xae8670));}}return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util['format'](_0x3e0c('0xe6'),_0xae8670));};AGIVertices[_0x3e0c('0x18')]['saydigits']=function(_0x41a525){logger['info'](util[_0x3e0c('0x2c')](_0x3e0c('0x18c'),_0x41a525[_0x3e0c('0xb0')]));return this['channel'][_0x3e0c('0x18d')](_0x41a525[_0x3e0c('0x18e')][_0x3e0c('0x5d')](/\s+/g,''),_0x41a525[_0x3e0c('0x182')]);};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x18f')]=function(_0x42e21d){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x190'),_0x42e21d[_0x3e0c('0xb0')]));return this[_0x3e0c('0xf')][_0x3e0c('0x191')](_0x42e21d[_0x3e0c('0x6a')][_0x3e0c('0x5d')](/\s+/g,''),_0x42e21d['escape_digits']);};AGIVertices['prototype'][_0x3e0c('0x192')]=function(_0x4791bf){logger[_0x3e0c('0x30')](util['format'](_0x3e0c('0x193'),_0x4791bf[_0x3e0c('0xb0')]));return this[_0x3e0c('0xf')][_0x3e0c('0x194')](_0x4791bf[_0x3e0c('0x60')],_0x4791bf[_0x3e0c('0x182')]);};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x195')]=function(_0x15d7fa){logger['info'](util[_0x3e0c('0x2c')](_0x3e0c('0x196'),_0x15d7fa[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0x15d7fa['account_id'])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')]('no\x20mail\x20account\x20configured');}var _0xad2051=this[_0x3e0c('0x24')][_0x3e0c('0x75')](this,_0x15d7fa[_0x3e0c('0x197')]);if(!_0xad2051||!_0xad2051['Smtp']){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x15d7fa,'no\x20mail\x20account\x20found');}var _0x4a16b6={'from':util['format'](_0x3e0c('0x198'),_0xad2051['name'],_0xad2051[_0x3e0c('0x199')]||_0xad2051[_0x3e0c('0x19a')][_0x3e0c('0x19b')]),'to':_0x15d7fa['to']||'','cc':_0x15d7fa['cc']||'','bcc':_0x15d7fa[_0x3e0c('0x19c')]||'','subject':_0x15d7fa[_0x3e0c('0x19d')],'html':_0x15d7fa['text'],'text':_0x15d7fa[_0x3e0c('0x60')]};if(this[_0x3e0c('0x88')](_0x15d7fa[_0x3e0c('0x19e')])){}logger[_0x3e0c('0x19f')](_0x3e0c('0x1a0'),JSON['stringify'](_0x4a16b6));this['createSquareDetailsReport'][_0x3e0c('0x75')](this,_0x15d7fa,_0x15d7fa[_0x3e0c('0x197')]);this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util['format']('Trying\x20SendMail\x20with\x20account\x20%s',_0xad2051[_0x3e0c('0x14')]));this[_0x3e0c('0x26')][_0x3e0c('0x75')](this,_0xad2051[_0x3e0c('0x1a1')],_0x4a16b6);return this[_0x3e0c('0xf')]['noop'](_0x3e0c('0x1a2'));};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x1a3')]=function(_0x22171d){logger['info'](util[_0x3e0c('0x2c')](_0x3e0c('0x1a4'),_0x22171d[_0x3e0c('0xb0')]));return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0x1a5'));};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x1a6')]=function(_0x144ffa){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x144ffa['label']));if(!this[_0x3e0c('0x88')](_0x144ffa[_0x3e0c('0x1a7')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0x1a8'));}var _0x59b64f=this[_0x3e0c('0x36')]['sync'](this,_0x144ffa['sms_account_id']);if(!_0x59b64f){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x144ffa,_0x3e0c('0x1a9'));}var _0x2ab8ba={'body':_0x144ffa[_0x3e0c('0x1aa')],'phone':_0x144ffa['to']||'','SmsAccountId':_0x59b64f['id']};logger['debug']('sendSMS\x20message',JSON[_0x3e0c('0x78')](_0x2ab8ba));this[_0x3e0c('0x38')][_0x3e0c('0x75')](this,_0x144ffa,_0x144ffa[_0x3e0c('0x1a7')]);this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0x1ab'),_0x59b64f[_0x3e0c('0x14')]));this[_0x3e0c('0x37')][_0x3e0c('0x75')](this,_0x2ab8ba);return this[_0x3e0c('0xf')][_0x3e0c('0xb1')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x1ac')]=function(_0x51a8b3){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x1ad'),_0x51a8b3[_0x3e0c('0xb0')]));if(!this[_0x3e0c('0x88')](_0x51a8b3[_0x3e0c('0xdf')])){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x51a8b3,_0x3e0c('0x1ae'));}var _0x348c58=this[_0x3e0c('0xaa')][_0x3e0c('0x75')](this,_0x51a8b3[_0x3e0c('0xdf')]);if(!_0x348c58){return this['channel'][_0x3e0c('0x34')](_0x51a8b3,'no\x20variable\x20found');}return this[_0x3e0c('0xf')][_0x3e0c('0xa5')](_0x348c58,_0x51a8b3['variable_value']);};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x1af')]=function(_0x69746f){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x1b0'),_0x69746f[_0x3e0c('0xb0')]));this[_0x3e0c('0xf')]['noop'](_0x3e0c('0x1b1'));var _0x5adc7c=this[_0x3e0c('0xf')][_0x3e0c('0xaa')](_0x3e0c('0x1b2'));if(!_[_0x3e0c('0x46')](_0x5adc7c[_0x3e0c('0xa8')])){this[_0x3e0c('0xf')][_0x3e0c('0x39')]=_0x5adc7c['extra'];}if(_0x69746f[_0x3e0c('0xc1')]===_0x3e0c('0x1b3')){this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0x1b4'));return this[_0x3e0c('0xf')][_0x3e0c('0xc1')]();}return this[_0x3e0c('0xf')]['noop'](_0x3e0c('0x1b5'));};AGIVertices[_0x3e0c('0x18')]['subproject']=function(_0x1cedd2){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x1cedd2[_0x3e0c('0xb0')]));if(!this['isConfigured'](_0x1cedd2[_0x3e0c('0x1b6')])){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x1cedd2,_0x3e0c('0x1b7'));}var _0x2a9878=this[_0x3e0c('0x19')]['sync'](this,_0x1cedd2[_0x3e0c('0x1b6')]);if(!this['isConfigured'](_0x2a9878)){return this['channel'][_0x3e0c('0x34')](_0x1cedd2,util['format'](_0x3e0c('0x1b8'),_0x1cedd2['project_id']));}if(_0x2a9878===this[_0x3e0c('0xf')][_0x3e0c('0x3b')]){return this['channel'][_0x3e0c('0x34')](_0x1cedd2,_0x3e0c('0x1b9'));}this[_0x3e0c('0x38')][_0x3e0c('0x75')](this,_0x1cedd2,_0x2a9878);var _0xec63=this[_0x3e0c('0xf')][_0x3e0c('0x5b')]('AGI',util[_0x3e0c('0x2c')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x3e0c('0x8')][_0x3e0c('0x1ba')]||_0x3e0c('0x1bb'),_0x2a9878,this['channel'][_0x3e0c('0x3b')]));if(_0xec63[_0x3e0c('0xab')]===-0x1){return _0xec63;}return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0xcb'),_0x3e0c('0x1bc'),_0x2a9878));};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x1bd')]=function(_0x2ceb76){logger[_0x3e0c('0x30')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x2ceb76[_0x3e0c('0xb0')]));var _0x5a0ff6=this['shellCommand'][_0x3e0c('0x75')](this,_0x2ceb76['command']);this[_0x3e0c('0x38')][_0x3e0c('0x75')](this,_0x2ceb76,_0x2ceb76[_0x3e0c('0xbd')]);if(this[_0x3e0c('0x88')](_0x2ceb76[_0x3e0c('0xdf')])){var _0x5c4dec=this[_0x3e0c('0xaa')][_0x3e0c('0x75')](this,_0x2ceb76[_0x3e0c('0xdf')]);if(_0x5c4dec){this['channel']['setVariable'](_0x5c4dec,_0x5a0ff6);return this['channel'][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x2ceb76[_0x3e0c('0xbd')],_0x5c4dec));}}return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x2ceb76[_0x3e0c('0xbd')]));};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x1be')]=function(_0x372ccf){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x1bf'),_0x372ccf[_0x3e0c('0xb0')]));_0x372ccf[_0x3e0c('0x60')]=_0x372ccf['text'][_0x3e0c('0x5d')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3e0c('0x88')](_0x372ccf[_0x3e0c('0x5f')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')]('no\x20apiKey\x20configured');}if(!this[_0x3e0c('0x88')](_0x372ccf[_0x3e0c('0x60')])){return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](_0x3e0c('0xb2'));}this[_0x3e0c('0xf')]['noop'](util['format'](_0x3e0c('0x1c0'),_0x372ccf[_0x3e0c('0x60')]));var _0x4d8ab5=this[_0x3e0c('0x5e')][_0x3e0c('0x75')](this,_0x372ccf);if(_0x4d8ab5){this[_0x3e0c('0xf')]['noop'](util[_0x3e0c('0x2c')](_0x3e0c('0x1c1'),_0x4d8ab5));var _0x287e69=this['channel'][_0x3e0c('0x15b')](_0x4d8ab5);try{fs[_0x3e0c('0x12a')](_0x4d8ab5+'.wav');}catch(_0x36df6b){logger['error'](_0x36df6b);}return _0x287e69;}return this['channel'][_0x3e0c('0x34')](_0x372ccf,_0x3e0c('0x1c2'));};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x1c3')]=function(_0x5e76ce){logger['info'](util[_0x3e0c('0x2c')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x5e76ce[_0x3e0c('0xb0')]));_0x5e76ce[_0x3e0c('0x60')]=_0x5e76ce[_0x3e0c('0x60')][_0x3e0c('0x5d')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3e0c('0x88')](_0x5e76ce[_0x3e0c('0x60')])){return this[_0x3e0c('0xf')]['noop']('no\x20text\x20configured');}this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x5e76ce['text']));var _0x3fce8a=this['googleTTS'][_0x3e0c('0x75')](this,_0x5e76ce);if(_0x3fce8a){this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x3fce8a));var _0x34a6f5=this[_0x3e0c('0xf')][_0x3e0c('0x15b')](_0x3fce8a);try{fs[_0x3e0c('0x12a')](_0x3fce8a+_0x3e0c('0x10c'));}catch(_0x741a50){logger[_0x3e0c('0x34')](_0x741a50);}return _0x34a6f5;}return this['channel']['error'](_0x5e76ce,_0x3e0c('0x1c4'));};AGIVertices[_0x3e0c('0x18')]['unpause']=function(_0x40a31c){logger['info'](util[_0x3e0c('0x2c')](_0x3e0c('0x1c5'),_0x40a31c[_0x3e0c('0xb0')]));if(!this['isConfigured'](_0x40a31c[_0x3e0c('0x15d')])){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x40a31c,_0x3e0c('0x15e'));}logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x16f'),this[_0x3e0c('0xf')][_0x3e0c('0x3c')],_0x40a31c[_0x3e0c('0x15d')]));var _0x29b5f2=this[_0x3e0c('0x54')][_0x3e0c('0x75')](this,_0x40a31c[_0x3e0c('0x15d')]);if(_0x29b5f2){logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')](_0x3e0c('0x15f'),this[_0x3e0c('0xf')][_0x3e0c('0x3c')],_0x40a31c[_0x3e0c('0x15d')]));this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0x15f'),this[_0x3e0c('0xf')]['callerid'],_0x40a31c['findBy']));return{'code':0xc8,'result':_0x3e0c('0x160')};}else{logger[_0x3e0c('0x30')](util[_0x3e0c('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x3e0c('0x3c')],_0x40a31c[_0x3e0c('0x15d')]));this['channel'][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0x161'),this[_0x3e0c('0xf')]['callerid'],_0x40a31c['findBy']));return{'code':0xc8,'result':_0x3e0c('0x162')};}};AGIVertices[_0x3e0c('0x18')][_0x3e0c('0x1c6')]=function(_0x3e960d){logger[_0x3e0c('0x30')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x3e960d[_0x3e0c('0xb0')]));var _0x29c334=this[_0x3e0c('0xf')][_0x3e0c('0x5b')]('VOICEMAIL',[_0x3e960d['mailbox'],_0x3e960d[_0x3e0c('0x7e')]]);if(_0x29c334[_0x3e0c('0xab')]===-0x1){return _0x29c334;}return this[_0x3e0c('0xf')][_0x3e0c('0xb1')](util[_0x3e0c('0x2c')](_0x3e0c('0xcb'),_0x3e0c('0x1c7'),_0x3e960d[_0x3e0c('0x1c8')]));};AGIVertices[_0x3e0c('0x18')]['vswitch']=function(_0x1d2a39){logger['info'](util[_0x3e0c('0x2c')](_0x3e0c('0x1c9'),_0x1d2a39['label']));if(!this[_0x3e0c('0x88')](_0x1d2a39[_0x3e0c('0xdf')])){return this[_0x3e0c('0xf')]['error'](_0x1d2a39,_0x3e0c('0x1ae'));}var _0xf90f61=this[_0x3e0c('0xaa')][_0x3e0c('0x75')](this,_0x1d2a39['variable_id']);if(!_0xf90f61){return this[_0x3e0c('0xf')][_0x3e0c('0x34')](_0x1d2a39,_0x3e0c('0xe1'));}var _0x124d21=this['channel'][_0x3e0c('0xaa')](_0xf90f61);return{'code':0xc8,'result':_0x124d21[_0x3e0c('0xa8')]?_0x124d21['extra']:'-'};};String[_0x3e0c('0x18')][_0x3e0c('0xa7')]=function(_0x1c304c,_0x27b475){return this['split'](_0x1c304c)[_0x3e0c('0x1ca')](_0x27b475);};module[_0x3e0c('0x1cb')]=AGIVertices; \ No newline at end of file +var _0x9c5a=['getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUserById','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','extension','priority','arg_1','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','MP3','googleTTS','restAPI','url','method','number','timeout','includes','POST','PUT','toUpperCase','body','parse','computedVariables','sync','uri','render','stringify','headers','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','length','saveRestApiResult','isPlainObject','%s.%s','isArray','setVariable','replaceObjectAllVariables','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','retry','mrcpsynth','noop','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','exec','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','command','args','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','no\x20list\x20selected','delay','minutes','callback_priority','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','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','getUser','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','SestekNDA\x20Result\x20%s','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','maxdigit','toString','test','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','.wav','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','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','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','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','odbc','randomstring','moment','mustache','../../config/logger','agi','./scripts','rawHeaders','rawBody','getsecretdigits','channel','mailRpc','prototype','rpc'];(function(_0x19f670,_0x36d23f){var _0x3ffd49=function(_0x5d9e05){while(--_0x5d9e05){_0x19f670['push'](_0x19f670['shift']());}};_0x3ffd49(++_0x36d23f);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x1d8c82,_0x5dc60b){_0x1d8c82=_0x1d8c82-0x0;var _0xc37fc3=_0x9c5a[_0x1d8c82];return _0xc37fc3;};'use strict';var fs=require('fs');var util=require(_0xa9c5('0x0'));var _=require(_0xa9c5('0x1'));var sh=require('shelljs');var odbc=require(_0xa9c5('0x2'))();var rs=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var Mustache=require(_0xa9c5('0x5'));var rp=require('request-promise');var logger=require(_0xa9c5('0x6'))(_0xa9c5('0x7'));var config=require('../../config/environment');var scripts=require(_0xa9c5('0x8'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xa9c5('0x9'),_0xa9c5('0xa')];var verticesWithRetry=['menu','getdigits',_0xa9c5('0xb')];var AGIVertices=function(_0x16f331,_0x52afb2,_0x2e2b3e){this[_0xa9c5('0xc')]=_0x16f331;this['rpc']=_0x52afb2;this[_0xa9c5('0xd')]=_0x2e2b3e;};AGIVertices[_0xa9c5('0xe')]['getVariable']=function(_0x4c55e9,_0x38e106){this[_0xa9c5('0xf')][_0xa9c5('0x10')](_0x4c55e9)[_0xa9c5('0x11')](function(_0x34c948){_0x38e106(null,_0x34c948?_0x34c948[_0xa9c5('0x12')]:![]);})[_0xa9c5('0x13')](function(_0x42d5cf){_0x38e106(_0x42d5cf);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x14')]=function(_0x5915ad,_0x390ca2){this[_0xa9c5('0xf')][_0xa9c5('0x15')](_0x5915ad)[_0xa9c5('0x11')](function(_0x418ca5){_0x390ca2(null,_0x418ca5?_0x418ca5[_0xa9c5('0x12')]:![]);})[_0xa9c5('0x13')](function(_0x40b001){_0x390ca2(_0x40b001);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x16')]=function(_0x4bb57e,_0x2b0d73){this[_0xa9c5('0xf')][_0xa9c5('0x17')](_0x4bb57e)['then'](function(_0x2cda1b){_0x2b0d73(null,_0x2cda1b?_0x2cda1b[_0xa9c5('0x12')]:![]);})[_0xa9c5('0x13')](function(_0x3b8cf7){_0x2b0d73(_0x3b8cf7);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x18')]=function(_0x3b8d4d,_0x1e5ce6){this[_0xa9c5('0xf')][_0xa9c5('0x19')](_0x3b8d4d)[_0xa9c5('0x11')](function(_0x2d95f8){_0x1e5ce6(null,_0x2d95f8?_0x2d95f8['dsn']:![]);})[_0xa9c5('0x13')](function(_0x21ab50){_0x1e5ce6(_0x21ab50);});};AGIVertices['prototype']['getUser']=function(_0xce9af6,_0x366f5c){this[_0xa9c5('0xf')][_0xa9c5('0x1a')](_0xce9af6)[_0xa9c5('0x11')](function(_0xd4b8a1){_0x366f5c(null,_0xd4b8a1?_0xd4b8a1['name']:![]);})['catch'](function(_0x3d4e1b){_0x366f5c(_0x3d4e1b);});};AGIVertices[_0xa9c5('0xe')]['getTrunk']=function(_0x6819b3,_0x424b4c){this[_0xa9c5('0xf')][_0xa9c5('0x1b')](_0x6819b3)[_0xa9c5('0x11')](function(_0x40f08b){_0x424b4c(null,_0x40f08b?_0x40f08b[_0xa9c5('0x12')]:![]);})['catch'](function(_0x4e8a7f){_0x424b4c(_0x4e8a7f);});};AGIVertices[_0xa9c5('0xe')]['getSound']=function(_0x1762ac,_0x830bad){var _0x4caefa=this;this[_0xa9c5('0xf')][_0xa9c5('0x1c')](_0x1762ac)['then'](function(_0x413edf){_0x830bad(null,_0x413edf?_0x4caefa[_0xa9c5('0x1d')](_0x413edf[_0xa9c5('0x1e')]):![]);})[_0xa9c5('0x13')](function(_0x325c65){_0x830bad(_0x325c65);});};AGIVertices['prototype'][_0xa9c5('0x1f')]=function(_0x4cee90,_0x3c3da7){this[_0xa9c5('0xf')][_0xa9c5('0x20')](_0x4cee90)['then'](function(_0xc6d0c1){_0x3c3da7(null,_0xc6d0c1?_0xc6d0c1:![]);})[_0xa9c5('0x13')](function(_0x5bc9bb){_0x3c3da7(_0x5bc9bb);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x21')]=function(_0x431e07,_0x378684,_0x22ee21){this[_0xa9c5('0xd')][_0xa9c5('0x21')](_0x431e07,_0x378684)['then'](function(){_0x22ee21(null);})[_0xa9c5('0x13')](function(_0x3bdf64){_0x22ee21(_0x3bdf64);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x22')]=function(_0x1c617c,_0x2de191){this[_0xa9c5('0xf')][_0xa9c5('0x23')](_0x1c617c)['then'](function(_0x4e3f3e){if(_0x4e3f3e){if(_0x4e3f3e[_0xa9c5('0x24')]){_0x2de191(null,[_0x4e3f3e[_0xa9c5('0x25')]]);}else{_0x2de191(null,_[_0xa9c5('0x26')](_0x4e3f3e[_0xa9c5('0x27')],_0xa9c5('0x25')));}}else{_0x2de191(null,![]);}})[_0xa9c5('0x13')](function(_0x4dfdb5){_0x2de191(_0x4dfdb5);});};AGIVertices['prototype']['getSoundPath']=function(_0x314010){return util[_0xa9c5('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0x314010);};AGIVertices[_0xa9c5('0xe')]['getQueryOdbc']=function(_0x1f5740,_0x1fc8bf,_0x2567be){odbc[_0xa9c5('0x29')](_0x1f5740,function(_0x593be8){if(_0x593be8){logger[_0xa9c5('0x2a')](_0xa9c5('0x2b'),_0x593be8);_0x2567be(_0x593be8);}else{logger[_0xa9c5('0x2c')](_0xa9c5('0x2d'));odbc[_0xa9c5('0x2e')](_0x1fc8bf,function(_0x17ef8e,_0x422f9b){if(_0x17ef8e){logger[_0xa9c5('0x2c')]('Error\x20executing\x20query\x20%s',_0x1fc8bf);_0x2567be(_0x17ef8e);}else{logger[_0xa9c5('0x2c')](_0xa9c5('0x2f'),_0x1fc8bf);odbc[_0xa9c5('0x30')](function(_0x2b95fa){if(_0x2b95fa){logger[_0xa9c5('0x2a')](_0xa9c5('0x31'),_0x2b95fa);}_0x2567be(null,_0x422f9b);});}});}});};AGIVertices['prototype'][_0xa9c5('0x32')]=function(_0x5b7a0a,_0x2fa3e3){this['rpc'][_0xa9c5('0x33')](_0x5b7a0a)[_0xa9c5('0x11')](function(_0x37fb1b){_0x2fa3e3(null,_0x37fb1b?_0x37fb1b:![]);})['catch'](function(_0x12e19c){_0x2fa3e3(_0x12e19c);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x34')]=function(_0x26dd0c,_0x5914d2){this[_0xa9c5('0xf')][_0xa9c5('0x34')](_0x26dd0c)[_0xa9c5('0x11')](function(_0x45668e){_0x5914d2(null,_0x45668e);})[_0xa9c5('0x13')](function(_0x5dc092){_0x5914d2(_0x5dc092);});};AGIVertices[_0xa9c5('0xe')]['createSquareDetailsReport']=function(_0x1de605,_0x397614,_0x2998ad){this[_0xa9c5('0xf')][_0xa9c5('0x35')]({'uniqueid':this[_0xa9c5('0xc')][_0xa9c5('0x36')],'node':_0x1de605[_0xa9c5('0x37')],'application':_0x1de605[_0xa9c5('0x38')],'data':_0x397614||null,'project_name':this[_0xa9c5('0xc')]['arg_1'],'callerid':this[_0xa9c5('0xc')][_0xa9c5('0x39')]})[_0xa9c5('0x11')](function(_0x31611d){if(_0x2998ad){_0x2998ad(null,_0x31611d);}})[_0xa9c5('0x13')](function(_0x3794d2){if(_0x2998ad){_0x2998ad(_0x3794d2);}});};AGIVertices['prototype'][_0xa9c5('0x3a')]=function(_0x2ba81e,_0x557c21,_0x52cfbf,_0x56b8b4){this['rpc']['createSquareRecording']({'uniqueid':this[_0xa9c5('0xc')][_0xa9c5('0x36')],'callerid':this[_0xa9c5('0xc')][_0xa9c5('0x39')],'calleridname':this[_0xa9c5('0xc')][_0xa9c5('0x3b')],'context':this[_0xa9c5('0xc')][_0xa9c5('0x3c')],'extension':this[_0xa9c5('0xc')][_0xa9c5('0x3d')],'priority':this[_0xa9c5('0xc')][_0xa9c5('0x3e')],'accountcode':this[_0xa9c5('0xc')]['accountcode'],'dnid':this[_0xa9c5('0xc')]['dnid'],'projectName':this[_0xa9c5('0xc')][_0xa9c5('0x3f')],'saveName':_0x557c21,'filename':_0x2ba81e['file']||_0x557c21,'savePath':_0x52cfbf})['then'](function(_0xf00970){_0x56b8b4(null,_0xf00970);})[_0xa9c5('0x13')](function(_0xeb0720){_0x56b8b4(_0xeb0720);});};AGIVertices['prototype']['createSquareMessage']=function(_0x2333c4,_0xd03cec,_0x481f9c,_0x8ea192,_0x2c095f){this[_0xa9c5('0xf')][_0xa9c5('0x40')]({'uniqueid':this[_0xa9c5('0xc')][_0xa9c5('0x36')],'body':_0x2333c4,'direction':_0xd03cec,'providerName':_0x481f9c,'providerResponse':_0x8ea192})['then'](function(_0x4cd8e4){if(_0x2c095f){_0x2c095f(null,_0x4cd8e4);}})['catch'](function(_0x4317d8){if(_0x2c095f){_0x2c095f(_0x4317d8);}});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x41')]=function(_0xef4d2,_0x380266){this[_0xa9c5('0xf')]['createCmContact']({'firstName':_[_0xa9c5('0x42')](_0xef4d2[_0xa9c5('0x12')])||_[_0xa9c5('0x43')](_0xef4d2[_0xa9c5('0x12')])?_0xa9c5('0x44')+Math[_0xa9c5('0x45')]():_0xef4d2['name'],'lastName':_['isEmpty'](_0xef4d2[_0xa9c5('0x46')])||_['isNil'](_0xef4d2[_0xa9c5('0x46')])?null:_0xef4d2['lastName'],'phone':_0xef4d2[_0xa9c5('0x47')],'ListId':_0xef4d2[_0xa9c5('0x48')],'scheduledat':_0xef4d2[_0xa9c5('0x49')],'callbackUniqueid':this['channel'][_0xa9c5('0x36')],'tags':_0xa9c5('0x4a'),'description':_0xa9c5('0x4b')+_0xef4d2[_0xa9c5('0x49')]['toString'](),'priority':_0xef4d2['callback_priority']})[_0xa9c5('0x11')](function(_0x2b66ee){_0x380266(null,_0x2b66ee);})[_0xa9c5('0x13')](function(_0x5b4323){_0x380266(_0x5b4323);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x4c')]=function(_0x3d3c04,_0x2e4734){this[_0xa9c5('0xf')][_0xa9c5('0x4d')](_0x3d3c04)[_0xa9c5('0x11')](function(_0x298b3d){_0x2e4734(null,_0x298b3d?_0x298b3d['name']:![]);})[_0xa9c5('0x13')](function(_0x5a9d4f){_0x2e4734(_0x5a9d4f);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x4e')]=function(_0x26bda1,_0x4dfe3a,_0x4d475a){var _0x1dd3b2={'role':'agent'};_0x1dd3b2[_0x26bda1]=this[_0xa9c5('0xc')][_0xa9c5('0x39')];this[_0xa9c5('0xf')][_0xa9c5('0x4e')](_0x1dd3b2,_0x4dfe3a,this['channel'][_0xa9c5('0x36')])[_0xa9c5('0x11')](function(_0x1f6fbc){_0x4d475a(null,_[_0xa9c5('0x43')](_0x1f6fbc)?![]:!![]);})['catch'](function(_0x5538ad){logger[_0xa9c5('0x2a')](_0x5538ad);_0x4d475a(null,![]);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x4f')]=function(_0x1b676e,_0x279a26){var _0x44ac8a={'role':'agent'};_0x44ac8a[_0x1b676e]=this[_0xa9c5('0xc')][_0xa9c5('0x39')];this[_0xa9c5('0xf')][_0xa9c5('0x4f')](_0x44ac8a)[_0xa9c5('0x11')](function(_0x372ab9){_0x279a26(null,_[_0xa9c5('0x43')](_0x372ab9)?![]:!![]);})[_0xa9c5('0x13')](function(_0x456973){logger[_0xa9c5('0x2a')](_0x456973);_0x279a26(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x25c34f,_0x40ade1){var _0x3322cc={'role':_0xa9c5('0x50')};_0x3322cc[_0x25c34f]=this['channel'][_0xa9c5('0x39')];this['rpc'][_0xa9c5('0x51')](_0x3322cc)[_0xa9c5('0x11')](function(_0x325424){_0x40ade1(null,_[_0xa9c5('0x43')](_0x325424)?![]:!![]);})[_0xa9c5('0x13')](function(_0x11bb72){logger[_0xa9c5('0x2a')](_0x11bb72);_0x40ade1(null,![]);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x52')]=function(_0x9a7d4b,_0x446b8a){var _0x26c221={'role':'agent'};_0x26c221[_0x9a7d4b]=this[_0xa9c5('0xc')][_0xa9c5('0x39')];var _0x15eb25=_0x9a7d4b!=_0xa9c5('0x53')?util[_0xa9c5('0x28')](_0xa9c5('0x54'),_0xa9c5('0x55'),this['channel']['callerid']):undefined;this[_0xa9c5('0xf')]['agentLogin'](_0x26c221,_0x15eb25)[_0xa9c5('0x11')](function(_0x2510e4){_0x446b8a(null,_['isNil'](_0x2510e4)?![]:!![]);})[_0xa9c5('0x13')](function(_0x3db169){logger['error'](_0x3db169);_0x446b8a(null,![]);});};AGIVertices['prototype'][_0xa9c5('0x56')]=function(_0x26c805,_0x22af29){sh['exec'](_['trim'](_0x26c805),function(_0xd1ea,_0x3317c3){var _0x4b36a3=_0x3317c3[_0xa9c5('0x57')](/(\r\n|\n|\r)/gm,'');_0x22af29(null,_0x4b36a3);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x58')]=function(_0x3c0c7a,_0x135791){scripts[_0xa9c5('0x58')](_0x3c0c7a['apiKey'],_0x3c0c7a[_0xa9c5('0x59')]||_0xa9c5('0x5a'),_0x3c0c7a[_0xa9c5('0x5a')],_0x3c0c7a[_0xa9c5('0x5b')]||'en-US',_0x3c0c7a[_0xa9c5('0x5c')]||_0xa9c5('0x5d'),_0x3c0c7a['audioEncoding']||_0xa9c5('0x5e'))[_0xa9c5('0x11')](function(_0x12181b){_0x135791(null,_0x12181b);})['catch'](function(_0x11691e){_0x135791(_0x11691e);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x5f')]=function(_0x2e00f5,_0x2d449a){scripts[_0xa9c5('0x5f')](_0x2e00f5[_0xa9c5('0x5a')],_0x2e00f5['google_tts_language']||'en',0x1)[_0xa9c5('0x11')](function(_0x40468b){_0x2d449a(null,_0x40468b);})[_0xa9c5('0x13')](function(_0x3de672){_0x2d449a(_0x3de672);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x60')]=function(_0x39fae1,_0x390d0b){var _0x3f6114={'uri':_0x39fae1[_0xa9c5('0x61')],'method':_0x39fae1[_0xa9c5('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x39fae1['timeout'])===_0xa9c5('0x63')&&parseInt(_0x39fae1[_0xa9c5('0x64')])>=0x1?parseInt(_0x39fae1['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xa9c5('0x65')]([_0xa9c5('0x66'),_0xa9c5('0x67')],_0x3f6114['method'][_0xa9c5('0x68')]())){try{_0x3f6114[_0xa9c5('0x69')]=_0x39fae1[_0xa9c5('0xa')]?JSON[_0xa9c5('0x6a')](_0x39fae1['rawBody']):{};}catch(_0x2bcccf){logger[_0xa9c5('0x2a')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2bcccf);}}try{_0x3f6114['headers']=_0x39fae1['rawHeaders']?JSON['parse'](_0x39fae1['rawHeaders']):{};}catch(_0x4efbde){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4efbde);}if(_0x39fae1[_0xa9c5('0x6b')]){try{var _0x21797e=require(_0x39fae1[_0xa9c5('0x6b')])[_0xa9c5('0x6c')](this,_0x3f6114);_0x3f6114[_0xa9c5('0x6d')]=Mustache['render'](_0x39fae1['url'],_0x21797e,{},['$$','$$']);if(_0x3f6114['headers']){_0x3f6114['headers']=JSON[_0xa9c5('0x6a')](Mustache[_0xa9c5('0x6e')](JSON[_0xa9c5('0x6f')](_0x3f6114[_0xa9c5('0x70')]),_0x21797e,{},['$$','$$']));}if(_0x3f6114['body']){_0x3f6114['body']=JSON[_0xa9c5('0x6a')](Mustache[_0xa9c5('0x6e')](JSON[_0xa9c5('0x6f')](_0x3f6114[_0xa9c5('0x69')]),_0x21797e,{},['$$','$$']));}}catch(_0x1d89ec){logger['error'](_0xa9c5('0x71'),_0x1d89ec);}}rp(_0x3f6114)[_0xa9c5('0x11')](function(_0xd063cf){var _0x58de52={'statusCode':_0xd063cf[_0xa9c5('0x72')]||0xc8,'statusMessage':_0xd063cf[_0xa9c5('0x73')]||'OK','headers':_0xd063cf[_0xa9c5('0x70')]||{},'body':_0xd063cf[_0xa9c5('0x69')]||{}};_0x390d0b(null,_0x58de52);})['catch'](function(_0x34fcea){var _0x22c63b={'statusCode':_0x34fcea['statusCode']||0x1f4,'statusMessage':_0x34fcea['message']||_0xa9c5('0x74'),'headers':_0x34fcea['options']['headers']||{},'body':_0x34fcea[_0xa9c5('0x75')][_0xa9c5('0x69')]||{}};_0x390d0b(null,_0x22c63b);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x76')]=function(_0x22661f,_0x5bc433){scripts[_0xa9c5('0x76')](this['channel'][_0xa9c5('0x36')],_0x22661f[_0xa9c5('0x77')],_0x22661f[_0xa9c5('0x5a')],_0x22661f[_0xa9c5('0x78')]||'en')['then'](function(_0x4b056e){_0x5bc433(null,_0x4b056e);})[_0xa9c5('0x13')](function(_0x532712){_0x5bc433(_0x532712);});};AGIVertices['prototype'][_0xa9c5('0x79')]=function(_0x370bbb,_0x4cdf88){scripts['googleDialogflowV2'](this[_0xa9c5('0xc')][_0xa9c5('0x36')],_0x370bbb[_0xa9c5('0x7a')],_0x370bbb[_0xa9c5('0x7b')],_0x370bbb['private_key'],_0x370bbb['text'],_0x370bbb[_0xa9c5('0x7c')]||'en')[_0xa9c5('0x11')](function(_0x3229ea){_0x4cdf88(null,_0x3229ea);})[_0xa9c5('0x13')](function(_0x2f80d9){_0x4cdf88(_0x2f80d9);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x7d')]=function(_0x538973,_0x23ee99){scripts[_0xa9c5('0x7d')](this['channel'],_0x538973)[_0xa9c5('0x11')](function(_0x2488aa){_0x23ee99(null,_0x2488aa);})['catch'](function(_0x185820){_0x23ee99(_0x185820);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x7e')]=function(_0x2c93e3,_0x21e3ba){scripts[_0xa9c5('0x7e')](_0x2c93e3[_0xa9c5('0x77')],_0x2c93e3[_0xa9c5('0x5a')],_0x2c93e3[_0xa9c5('0x7f')]||_0xa9c5('0x80'),_0x2c93e3[_0xa9c5('0x81')])[_0xa9c5('0x11')](function(_0x29873a){_0x21e3ba(null,_0x29873a);})[_0xa9c5('0x13')](function(_0x359f3f){_0x21e3ba(_0x359f3f);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x82')]=function(_0x5f00ad,_0x425b92,_0x2b56dc){scripts[_0xa9c5('0x82')](_0x425b92,_0x5f00ad['key'],_0x5f00ad[_0xa9c5('0x83')]||_0xa9c5('0x80'),this['isConfigured'](_0x5f00ad[_0xa9c5('0x84')])?_0x5f00ad[_0xa9c5('0x84')]:undefined)[_0xa9c5('0x11')](function(_0x355184){_0x2b56dc(null,_0x355184);})[_0xa9c5('0x13')](function(_0x427666){_0x2b56dc(_0x427666);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x85')]=function(_0xe30a70,_0xb09d88){scripts[_0xa9c5('0x85')](_0xe30a70[_0xa9c5('0x86')],_0xe30a70[_0xa9c5('0x87')],_0xe30a70['aws_polly_region'],_0xe30a70['aws_polly_voice']||_0xa9c5('0x88'),_0xe30a70[_0xa9c5('0x5a')],_0xe30a70['aws_text_type']||_0xa9c5('0x5a'))[_0xa9c5('0x11')](function(_0x409e96){_0xb09d88(null,_0x409e96);})[_0xa9c5('0x13')](function(_0x5d734d){_0xb09d88(_0x5d734d);});};AGIVertices['prototype'][_0xa9c5('0x89')]=function(_0x22c480,_0x457158){scripts['awsLex'](this[_0xa9c5('0xc')][_0xa9c5('0x36')],_0x22c480[_0xa9c5('0x86')],_0x22c480['aws_secret_access_key'],_0x22c480[_0xa9c5('0x8a')],_0x22c480[_0xa9c5('0x5a')],_0x22c480[_0xa9c5('0x8b')])[_0xa9c5('0x11')](function(_0xd2b735){_0x457158(null,_0xd2b735);})[_0xa9c5('0x13')](function(_0xac9d4a){_0x457158(_0xac9d4a);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x8c')]=function(_0x13ac1f,_0x133a2c,_0x39ae69){scripts[_0xa9c5('0x8c')](_0x133a2c,_0x13ac1f[_0xa9c5('0x77')],_0x13ac1f[_0xa9c5('0x8d')]||'en-US')['then'](function(_0x4acddb){_0x39ae69(null,_0x4acddb);})[_0xa9c5('0x13')](function(_0x3bfc19){_0x39ae69(_0x3bfc19);});};AGIVertices['prototype'][_0xa9c5('0x8e')]=function(_0x24c7bd,_0x5646ab,_0x428223){scripts[_0xa9c5('0x8e')](_0x5646ab,_0x24c7bd[_0xa9c5('0x8f')],_0x24c7bd[_0xa9c5('0x90')],_0x24c7bd[_0xa9c5('0x6d')])['then'](function(_0x70d779){_0x428223(null,_0x70d779);})[_0xa9c5('0x13')](function(_0x2e41da){_0x428223(_0x2e41da);});};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x91')]=function(_0x23dbee){var _0x3050a6=_[_0xa9c5('0x65')](verticesWithRetry,_0x23dbee[_0xa9c5('0x38')])?_0x23dbee:_[_0xa9c5('0x92')](_0x23dbee);for(var _0x30b597 in _0x3050a6){if(_0x3050a6[_0xa9c5('0x93')](_0x30b597)){if(_0x3050a6[_0x30b597]&&_[_0xa9c5('0x94')](_0x3050a6[_0x30b597])){if(_['includes'](recursiveMapAttributes,_0x30b597)){_0x3050a6[_0x30b597]=this['replaceObjectAllVariables'](_0x3050a6[_0x30b597]);}else{_0x3050a6[_0x30b597]=this[_0xa9c5('0x95')](_0x3050a6[_0x30b597]);}}}}return _0x3050a6;};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x96')]=function(_0x471c7b){for(var _0x5b9835 in _0x471c7b){if(_0x471c7b[_0xa9c5('0x93')](_0x5b9835)){if(_['isPlainObject'](_0x471c7b[_0x5b9835])){this['recursiveNodeIndex'](_0x471c7b[_0x5b9835]);}else if(_['isArray'](_0x471c7b[_0x5b9835])){for(var _0x171d12=0x0;_0x171d12<_0x471c7b[_0x5b9835][_0xa9c5('0x97')];_0x171d12++){this['recursiveNodeIndex'](_0x471c7b[_0x5b9835][_0x171d12]);}}else if(_[_0xa9c5('0x94')](_0x471c7b[_0x5b9835])){_0x471c7b[_0x5b9835]=this[_0xa9c5('0x95')](_0x471c7b[_0x5b9835]);}}}};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x98')]=function(_0x156f7a,_0x3a98d){for(var _0x193fe0 in _0x156f7a){if(_0x156f7a['hasOwnProperty'](_0x193fe0)){if(_[_0xa9c5('0x99')](_0x156f7a[_0x193fe0])){if(!_['isEmpty'](_0x156f7a[_0x193fe0])){this[_0xa9c5('0x98')](_0x156f7a[_0x193fe0],util[_0xa9c5('0x28')](_0xa9c5('0x9a'),_0x3a98d,_0x193fe0));}}else if(_[_0xa9c5('0x9b')](_0x156f7a[_0x193fe0])){for(var _0x461091=0x0;_0x461091<_0x156f7a[_0x193fe0][_0xa9c5('0x97')];_0x461091++){this[_0xa9c5('0x98')](_0x156f7a[_0x193fe0][_0x461091],util[_0xa9c5('0x28')]('%s.%s',_0x3a98d,_0x193fe0+'['+_0x461091+']'));}}else{if(!_[_0xa9c5('0x43')](_0x156f7a[_0x193fe0])){this['channel'][_0xa9c5('0x9c')](util['format'](_0xa9c5('0x9a'),_0x3a98d,_0x193fe0),_0x156f7a[_0x193fe0]);}}}}};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x9d')]=function(_0x58b949){try{var _0x2a5df5=JSON[_0xa9c5('0x6a')](_0x58b949);this[_0xa9c5('0x96')](_0x2a5df5);return JSON[_0xa9c5('0x6f')](_0x2a5df5);}catch(_0x5c3404){return this['replaceAllVariables'](_0x58b949);}};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x95')]=function(_0x33a649){var _0x41f09e=_0x33a649['split']('{');for(var _0x5361de=0x1;_0x5361de<_0x41f09e[_0xa9c5('0x97')];_0x5361de+=0x1){var _0x3fa107=_0x41f09e[_0x5361de][_0xa9c5('0x9e')]('}');if(_0x3fa107[_0xa9c5('0x97')]>0x1){_0x33a649=_0x33a649[_0xa9c5('0x9f')]('{'+_0x3fa107[0x0]+'}',this[_0xa9c5('0xc')][_0xa9c5('0xa0')](_0x3fa107[0x0])[_0xa9c5('0xa1')]||_0x3fa107[0x0]);}}if(_0x41f09e[_0xa9c5('0x97')]===0x1){return _0x33a649['toString']();}return this[_0xa9c5('0x95')](_0x33a649);};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0xa2')]=function(_0x351c4d,_0x83042){var _0x71cb30=this[_0xa9c5('0xc')][_0xa9c5('0xa0')](_0x351c4d);if(_0x71cb30[_0xa9c5('0xa3')]===-0x1){return _0x71cb30;}logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0xa4'),_0x83042,_0x71cb30[_0xa9c5('0xa1')]));return this[_0xa9c5('0xc')][_0xa9c5('0x9c')](_0x83042,_0x71cb30['extra']);};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0xa5')]=function(_0x1e5ccd){return _0x1e5ccd&&_0x1e5ccd!=='0'&&_0x1e5ccd!=='-1'&&_0x1e5ccd!=='';};AGIVertices['prototype'][_0xa9c5('0xa6')]=function(_0x47ed85){this[_0xa9c5('0x35')][_0xa9c5('0x6c')](this,_0x47ed85,'-');_0x47ed85[_0xa9c5('0xa7')]=_0x47ed85[_0xa9c5('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0xa8')]=function(_0x32f874){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x32f874[_0xa9c5('0x37')]));if(!this[_0xa9c5('0xa5')](_0x32f874[_0xa9c5('0x5a')])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')]('no\x20text\x20configured');}var _0x2b5403='\x22'+_0x32f874[_0xa9c5('0x5a')]+'\x22';if(this[_0xa9c5('0xa5')](_0x32f874[_0xa9c5('0x75')])){_0x2b5403+=','+_0x32f874[_0xa9c5('0x75')];}var _0x49c4a3=this[_0xa9c5('0xc')]['exec'](_0xa9c5('0xaa'),_0x2b5403);if(_0x49c4a3[_0xa9c5('0xa3')]===-0x1){return _0x49c4a3;}return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0xab'),_0x2b5403));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0xac')]=function(_0x1fdc93){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0xad'),_0x1fdc93[_0xa9c5('0x37')]));if(!this[_0xa9c5('0xa5')](_0x1fdc93[_0xa9c5('0xae')])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')]('no\x20grammar\x20configured');}var _0x1d0358=_0x1fdc93[_0xa9c5('0xae')];if(this[_0xa9c5('0xa5')](_0x1fdc93[_0xa9c5('0x75')])){_0x1d0358+=','+_0x1fdc93[_0xa9c5('0x75')];}var _0xdc16e9=this[_0xa9c5('0xc')][_0xa9c5('0xaf')]('MRCPRecog',_0x1d0358);if(_0xdc16e9[_0xa9c5('0xa3')]===-0x1){return _0xdc16e9;}var _0x2f06f3=this['getAndSetVariable'](_0xa9c5('0xb0'),_0xa9c5('0xb1'));if(_0x2f06f3['result']===-0x1){return _0x2f06f3;}var _0x4d2fd7=this[_0xa9c5('0xa2')](_0xa9c5('0xb2'),'MRCP_RECOG_TRANSCRIPT');if(_0x4d2fd7[_0xa9c5('0xa3')]===-0x1){return _0x4d2fd7;}var _0x46cf2e=this[_0xa9c5('0xa2')](_0xa9c5('0xb3'),_0xa9c5('0xb4'));if(_0x46cf2e[_0xa9c5('0xa3')]===-0x1){return _0x46cf2e;}return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x1d0358));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x7')]=function(_0x316728){logger[_0xa9c5('0x2c')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x316728[_0xa9c5('0x37')]));return this[_0xa9c5('0xc')][_0xa9c5('0x7')]([_0x316728[_0xa9c5('0xb5')],_0x316728[_0xa9c5('0xb6')]]);};AGIVertices[_0xa9c5('0xe')]['answer']=function(_0xca4f80){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0xca4f80[_0xa9c5('0x37')]));if(this[_0xa9c5('0xa5')](_0xca4f80['timeout'])){logger[_0xa9c5('0x2c')](util['format'](_0xa9c5('0xb7'),_0xca4f80['timeout']));var _0x52d348=this[_0xa9c5('0xc')][_0xa9c5('0xb8')](_0xca4f80['timeout']);if(_0x52d348['result']===-0x1){return _0x52d348;}}return this[_0xa9c5('0xc')][_0xa9c5('0xb9')]();};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x4a')]=function(_0x5814cd){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x5814cd['label']));if(!this[_0xa9c5('0xa5')](_0x5814cd['list_id'])){return this[_0xa9c5('0xc')]['error'](_0x5814cd,_0xa9c5('0xba'));}_0x5814cd['scheduledAt']=moment();if(this[_0xa9c5('0xa5')](_0x5814cd[_0xa9c5('0xbb')])){_0x5814cd[_0xa9c5('0x49')]=moment()['add'](_0x5814cd[_0xa9c5('0xbb')],_0xa9c5('0xbc'));}if(!this[_0xa9c5('0xa5')](_0x5814cd[_0xa9c5('0xbd')])){_0x5814cd[_0xa9c5('0xbd')]=0x2;}this[_0xa9c5('0x41')][_0xa9c5('0x6c')](this,_0x5814cd);return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0xbe'),_0x5814cd[_0xa9c5('0x47')],_0x5814cd[_0xa9c5('0x48')],_0x5814cd[_0xa9c5('0x49')]));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0xbf')]=function(_0x1e2b13){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0xc0'),_0x1e2b13[_0xa9c5('0x37')]));var _0x1dcebb=this[_0xa9c5('0xc')][_0xa9c5('0xaf')](_0x1e2b13[_0xa9c5('0xc1')],_0x1e2b13['options']);if(_0x1dcebb[_0xa9c5('0xa3')]===-0x1){return _0x1dcebb;}return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')]('Executed\x20command\x20%s\x20%s',_0x1e2b13[_0xa9c5('0xc1')],_0x1e2b13['options']));};AGIVertices[_0xa9c5('0xe')]['lumenvoxtts']=function(_0x3725ff){logger['info'](util[_0xa9c5('0x28')](_0xa9c5('0xc2'),_0x3725ff[_0xa9c5('0x37')]));if(!this[_0xa9c5('0xa5')](_0x3725ff['text'])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0xc3'));}var _0x3e645b='\x22'+_0x3725ff[_0xa9c5('0x5a')]+'\x22';if(this['isConfigured'](_0x3725ff[_0xa9c5('0x75')])){_0x3e645b+=','+_0x3725ff[_0xa9c5('0x75')];}var _0x15d384=this['channel'][_0xa9c5('0xaf')](_0xa9c5('0xaa'),_0x3e645b);if(_0x15d384[_0xa9c5('0xa3')]===-0x1){return _0x15d384;}return this[_0xa9c5('0xc')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x3e645b));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0xc4')]=function(_0x4b3edf){logger[_0xa9c5('0x2c')](util['format'](_0xa9c5('0xc5'),_0x4b3edf['label']));if(!this[_0xa9c5('0xa5')](_0x4b3edf[_0xa9c5('0x5a')])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0xc3'));}var _0xd06ffc='\x22'+_0x4b3edf[_0xa9c5('0x5a')]+'\x22';if(this[_0xa9c5('0xa5')](_0x4b3edf[_0xa9c5('0x75')])){_0xd06ffc+=','+_0x4b3edf[_0xa9c5('0x75')];}var _0x8bfd88=this['channel'][_0xa9c5('0xaf')](_0xa9c5('0xaa'),_0xd06ffc);if(_0x8bfd88[_0xa9c5('0xa3')]===-0x1){return _0x8bfd88;}return this['channel'][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0xab'),_0xd06ffc));};AGIVertices['prototype'][_0xa9c5('0xc6')]=function(_0x3a4750){logger['info'](util[_0xa9c5('0x28')](_0xa9c5('0xc7'),_0x3a4750['label']));if(!this[_0xa9c5('0xa5')](_0x3a4750[_0xa9c5('0xae')])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')]('no\x20grammar\x20configured');}var _0x2cb432=_0x3a4750[_0xa9c5('0xae')];if(this[_0xa9c5('0xa5')](_0x3a4750[_0xa9c5('0x75')])){_0x2cb432+=','+_0x3a4750['options'];}var _0x43f004=this[_0xa9c5('0xc')][_0xa9c5('0xaf')](_0xa9c5('0xc8'),_0x2cb432);if(_0x43f004['result']===-0x1){return _0x43f004;}var _0x4ee92c=this[_0xa9c5('0xa2')]('RECOG_CONFIDENCE()',_0xa9c5('0xc9'));if(_0x4ee92c[_0xa9c5('0xa3')]===-0x1){return _0x4ee92c;}var _0x3dd33c=this['getAndSetVariable'](_0xa9c5('0xb2'),_0xa9c5('0xca'));if(_0x3dd33c[_0xa9c5('0xa3')]===-0x1){return _0x3dd33c;}var _0x293aed=this[_0xa9c5('0xa2')](_0xa9c5('0xb3'),_0xa9c5('0xcb'));if(_0x293aed[_0xa9c5('0xa3')]===-0x1){return _0x293aed;}return this['channel'][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0xcc'),_0x2cb432));};AGIVertices[_0xa9c5('0xe')]['sestekasr']=function(_0x1cda6f){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x1cda6f['label']));if(!this[_0xa9c5('0xa5')](_0x1cda6f[_0xa9c5('0xae')])){return this[_0xa9c5('0xc')]['noop']('no\x20grammar\x20configured');}var _0x46006f=_0x1cda6f[_0xa9c5('0xae')];if(this['isConfigured'](_0x1cda6f[_0xa9c5('0x75')])){_0x46006f+=','+_0x1cda6f['options'];}var _0x3b2282=this[_0xa9c5('0xc')][_0xa9c5('0xaf')](_0xa9c5('0xc8'),_0x46006f);if(_0x3b2282[_0xa9c5('0xa3')]===-0x1){return _0x3b2282;}var _0xb37c8=this[_0xa9c5('0xa2')](_0xa9c5('0xb0'),_0xa9c5('0xcd'));if(_0xb37c8[_0xa9c5('0xa3')]===-0x1){return _0xb37c8;}var _0x354783=this['getAndSetVariable'](_0xa9c5('0xb2'),_0xa9c5('0xce'));if(_0x354783[_0xa9c5('0xa3')]===-0x1){return _0x354783;}var _0x1478c8=this[_0xa9c5('0xa2')](_0xa9c5('0xb3'),_0xa9c5('0xcf'));if(_0x1478c8['result']===-0x1){return _0x1478c8;}return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x46006f));};AGIVertices['prototype'][_0xa9c5('0xd0')]=function(_0x174423){logger['info'](util[_0xa9c5('0x28')](_0xa9c5('0xd1'),_0x174423['label']));if(!this[_0xa9c5('0xa5')](_0x174423[_0xa9c5('0xd2')])){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x174423,_0xa9c5('0xd3'));}var _0x1bf72e=this[_0xa9c5('0x18')][_0xa9c5('0x6c')](this,_0x174423[_0xa9c5('0xd2')]);if(!_0x1bf72e){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x174423,'no\x20odbc\x20database\x20found');}if(!this[_0xa9c5('0xa5')](_0x174423['query'])){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x174423,_0xa9c5('0xd4'));}var _0x2b7039=_0x174423['query'][_0xa9c5('0x57')](/(\r\n|\n|\r)/gm,'\x20');this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')]('query:\x20%s',_0x2b7039));var _0x41caad=this[_0xa9c5('0xd5')][_0xa9c5('0x6c')](this,_0x1bf72e,_0x2b7039);this[_0xa9c5('0x35')]['sync'](this,_0x174423,_0x2b7039);if(!this[_0xa9c5('0xa5')](_0x174423[_0xa9c5('0xd6')])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0xd7'));}var _0x1b6e7d=this[_0xa9c5('0xa0')][_0xa9c5('0x6c')](this,_0x174423[_0xa9c5('0xd6')]);if(!_0x1b6e7d){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x174423,_0xa9c5('0xd8'));}var _0x3971d5=this;_0x41caad[_0xa9c5('0xd9')](function(_0x15eb7d,_0x51640b){Object[_0xa9c5('0xda')](_0x15eb7d)['forEach'](function(_0x4d2280){_0x3971d5[_0xa9c5('0xc')][_0xa9c5('0x9c')](util[_0xa9c5('0x28')](_0xa9c5('0xdb'),_0x1b6e7d,_0x51640b,_0x4d2280),_0x15eb7d[_0x4d2280]);});});this[_0xa9c5('0xc')]['setVariable'](util[_0xa9c5('0x28')]('%s_ROWS_COUNT',_0x1b6e7d),_0x41caad['length']);return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0xdc'),_0x1b6e7d));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0xdd')]=function(_0xf7d0b8){logger[_0xa9c5('0xde')](util[_0xa9c5('0x28')](_0xa9c5('0xdf'),_0xf7d0b8[_0xa9c5('0x37')]));if(!this[_0xa9c5('0xa5')](_0xf7d0b8['sip_id'])){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0xf7d0b8,_0xa9c5('0xe0'));}var _0x2bf1b3=this[_0xa9c5('0xe1')][_0xa9c5('0x6c')](this,_0xf7d0b8[_0xa9c5('0xe2')]);if(!_0x2bf1b3){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0xf7d0b8,_0xa9c5('0xe3'));}var _0x503dcf=this[_0xa9c5('0xc')]['exec'](_0xa9c5('0xe4'),[util[_0xa9c5('0x28')](_0xa9c5('0xe5'),_0x2bf1b3),_0xf7d0b8[_0xa9c5('0x64')],_0xf7d0b8[_0xa9c5('0xe6')],_0xf7d0b8[_0xa9c5('0x61')]]);if(_0x503dcf['result']===-0x1){return _0x503dcf;}return this[_0xa9c5('0xc')]['noop'](util[_0xa9c5('0x28')]('Executed\x20command\x20%s',_0xa9c5('0xe4')));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0xe7')]=function(_0x1a5655){logger['info'](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x1a5655[_0xa9c5('0x37')]));if(!this['isConfigured'](_0x1a5655[_0xa9c5('0x77')])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0xe8'));}if(!this['isConfigured'](_0x1a5655['text'])){return this['channel'][_0xa9c5('0xa9')]('no\x20text\x20configured');}this[_0xa9c5('0xc')][_0xa9c5('0xe9')]=!![];this[_0xa9c5('0x35')](_0x1a5655);this[_0xa9c5('0x40')](_0x1a5655[_0xa9c5('0x5a')],'in','','');this[_0xa9c5('0xc')]['noop'](util[_0xa9c5('0x28')](_0xa9c5('0xea'),_0x1a5655[_0xa9c5('0x5a')]));var _0x240bf4=this['googleDialogflow'][_0xa9c5('0x6c')](this,_0x1a5655);if(_0x240bf4){for(var _0x5e5233 in _0x240bf4){if(_0x240bf4['hasOwnProperty'](_0x5e5233)){this[_0xa9c5('0xc')][_0xa9c5('0x9c')](util['format'](_0xa9c5('0xeb'),_0x5e5233[_0xa9c5('0x68')]()),_0x240bf4[_0x5e5233]);}}this['createSquareMessage'](_0x240bf4[_0xa9c5('0xec')],_0xa9c5('0xed'),_0xa9c5('0xe7'),'');return this['channel'][_0xa9c5('0xa9')](util[_0xa9c5('0x28')]('Dialogflow\x20Result\x20%s',_0x240bf4[_0xa9c5('0xec')]));}return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x1a5655,_0xa9c5('0xee'));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0xef')]=function(_0x2a079f){logger[_0xa9c5('0x2c')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x2a079f['label']));if(!this[_0xa9c5('0xa5')](_0x2a079f['dialogflowV2_project_id'])){return this[_0xa9c5('0xc')]['noop'](_0xa9c5('0xf0'));}if(!this[_0xa9c5('0xa5')](_0x2a079f[_0xa9c5('0x7b')])){return this['channel']['noop'](_0xa9c5('0xf1'));}if(!this[_0xa9c5('0xa5')](_0x2a079f[_0xa9c5('0xf2')])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')]('no\x20private_key\x20configured');}if(!this[_0xa9c5('0xa5')](_0x2a079f['dialogflowV2_language'])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')]('no\x20anguage\x20configured');}if(!this['isConfigured'](_0x2a079f[_0xa9c5('0x5a')])){return this[_0xa9c5('0xc')]['noop'](_0xa9c5('0xc3'));}this[_0xa9c5('0xc')][_0xa9c5('0xe9')]=!![];this[_0xa9c5('0x35')](_0x2a079f);this[_0xa9c5('0x40')](_0x2a079f[_0xa9c5('0x5a')],'in','','');this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util['format'](_0xa9c5('0xf3'),_0x2a079f[_0xa9c5('0x5a')]));var _0x321564=this[_0xa9c5('0x79')][_0xa9c5('0x6c')](this,_0x2a079f);if(_0x321564){for(var _0x511781 in _0x321564){if(_0x321564[_0xa9c5('0x93')](_0x511781)){if(_0x511781!==_0xa9c5('0xf4')){this['channel'][_0xa9c5('0x9c')](util[_0xa9c5('0x28')](_0xa9c5('0xeb'),_0x511781['toUpperCase']()),_0x321564[_0x511781]);}}}this[_0xa9c5('0x40')](_0x321564['speech'],_0xa9c5('0xed'),_0xa9c5('0xef'),_0x321564[_0xa9c5('0xf4')]);return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0xf5'),_0x321564['speech']));}return this['channel'][_0xa9c5('0x2a')](_0x2a079f,_0xa9c5('0xf6'));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0xf7')]=function(_0x4eceb6){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0xf8'),_0x4eceb6[_0xa9c5('0x37')]));if(!this[_0xa9c5('0xa5')](_0x4eceb6['ndauth_url'])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0xf9'));}if(!this[_0xa9c5('0xa5')](_0x4eceb6[_0xa9c5('0xfa')])){return this[_0xa9c5('0xc')]['noop']('no\x20username\x20configured');}if(!this[_0xa9c5('0xa5')](_0x4eceb6[_0xa9c5('0xfb')])){return this[_0xa9c5('0xc')]['noop']('no\x20password\x20configured');}if(!this[_0xa9c5('0xa5')](_0x4eceb6[_0xa9c5('0xfc')])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')]('no\x20text\x20configured');}this[_0xa9c5('0xc')]['bot']=!![];this[_0xa9c5('0x35')](_0x4eceb6);this[_0xa9c5('0x40')](_0x4eceb6['text'],'in','','');this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0xfd'),_0x4eceb6[_0xa9c5('0x5a')]));var _0x5b87a8=this[_0xa9c5('0x7d')]['sync'](this,_0x4eceb6);if(_0x5b87a8){for(var _0x5e0492 in _0x5b87a8){if(_0x5b87a8['hasOwnProperty'](_0x5e0492)){this[_0xa9c5('0xc')]['setVariable'](util[_0xa9c5('0x28')](_0xa9c5('0xfe'),_0x5e0492[_0xa9c5('0x68')]()),_0x5b87a8[_0x5e0492]);}}this[_0xa9c5('0x40')](_0x5b87a8[_0xa9c5('0xec')],_0xa9c5('0xed'),'sesteknda','');if(_0x5b87a8[_0xa9c5('0xff')]){this['channel']['noop'](util[_0xa9c5('0x28')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x5b87a8[_0xa9c5('0xff')]));var _0x3c1566=this[_0xa9c5('0xc')][_0xa9c5('0x100')](_0x5b87a8[_0xa9c5('0xff')]);try{fs['unlink'](_0x5b87a8[_0xa9c5('0xff')]+'.wav');}catch(_0x83d73d){logger['error'](_0x83d73d);}return _0x3c1566;}else{return this[_0xa9c5('0xc')]['noop'](util[_0xa9c5('0x28')](_0xa9c5('0x101'),_0x5b87a8['speech']));}}return this[_0xa9c5('0xc')]['error'](_0x4eceb6,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xa9c5('0xe')]['end']=function(_0x44519f){logger[_0xa9c5('0x2c')](util['format'](_0xa9c5('0x102'),_0x44519f[_0xa9c5('0x37')]));return this[_0xa9c5('0xc')]['noop'](_0xa9c5('0x103'));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x104')]=function(_0x4e918b){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x105'),_0x4e918b[_0xa9c5('0x37')]));var _0xf2c042='';if(_0x4e918b[_0xa9c5('0x106')]){if(!this[_0xa9c5('0xa5')](_0x4e918b[_0xa9c5('0x106')])){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x4e918b,_0xa9c5('0x107'));}else{var _0x4574aa=parseInt(_0x4e918b[_0xa9c5('0x106')],0xa);if(isNaN(_0x4574aa)){_0xf2c042=_0x4e918b['trunk_id'];}else{_0xf2c042=this[_0xa9c5('0x108')][_0xa9c5('0x6c')](this,_0x4e918b[_0xa9c5('0x106')]);if(!_0xf2c042){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x4e918b,_0xa9c5('0x109'));}}}}else if(_0x4e918b[_0xa9c5('0x10a')]){_0xf2c042=_0x4e918b[_0xa9c5('0x10a')];}else{return this[_0xa9c5('0xc')]['error'](_0x4e918b,_0xa9c5('0x107'));}var _0x29899c=this[_0xa9c5('0xc')][_0xa9c5('0xaf')](_0xa9c5('0xe4'),[util[_0xa9c5('0x28')](_0xa9c5('0x10b'),_0xf2c042,_0x4e918b[_0xa9c5('0x47')]),_0x4e918b[_0xa9c5('0x64')],_0x4e918b[_0xa9c5('0xe6')],_0x4e918b['url']]);if(_0x29899c['result']===-0x1){return _0x29899c;}return this[_0xa9c5('0xc')]['noop'](util[_0xa9c5('0x28')](_0xa9c5('0x10c'),_0xa9c5('0xe4')));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x10d')]=function(_0x116aec){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x10e'),_0x116aec[_0xa9c5('0x37')]));return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0x10d'));};AGIVertices[_0xa9c5('0xe')]['getdigits']=function(_0x44c80f){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x44c80f['label']));if(_0x44c80f[_0xa9c5('0xa7')]===0x0){return this['maxRetry'](_0x44c80f);}_0x44c80f[_0xa9c5('0xa7')]-=0x1;if(!this[_0xa9c5('0xa5')](_0x44c80f[_0xa9c5('0x10f')])){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x44c80f,_0xa9c5('0x110'));}var _0x2bad98=this[_0xa9c5('0x111')][_0xa9c5('0x6c')](this,_0x44c80f['file_id']);if(!_0x2bad98){return this[_0xa9c5('0xc')]['error'](_0x44c80f,'no\x20file\x20audio\x20found');}if(!this[_0xa9c5('0xa5')](_0x44c80f[_0xa9c5('0xd6')])){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0xa9c5('0xd7'));}var _0x3b0fe0=this[_0xa9c5('0xc')]['getData'](_0x2bad98,_0x44c80f['response'],_0x44c80f[_0xa9c5('0x112')]);var _0x9ab0c4=_0x3b0fe0[_0xa9c5('0xa3')]?_0x3b0fe0[_0xa9c5('0xa3')][_0xa9c5('0x113')]():'';logger[_0xa9c5('0x2c')](_0xa9c5('0x114'),JSON['stringify'](_0x3b0fe0));if(_0x3b0fe0[_0xa9c5('0xa3')]===-0x1){this[_0xa9c5('0x35')]['sync'](this,_0x44c80f,_0x9ab0c4);return _0x3b0fe0;}else if(_0x3b0fe0['extra']===_0xa9c5('0x64')){_0x3b0fe0[_0xa9c5('0xa3')]=_0x9ab0c4[_0xa9c5('0x97')]>=parseInt(_0x44c80f['mindigit'])?'x':'i';}else{_0x3b0fe0['result']=_0x9ab0c4[_0xa9c5('0x97')]>=parseInt(_0x44c80f[_0xa9c5('0x115')])&&_0x9ab0c4[_0xa9c5('0x97')]<=parseInt(_0x44c80f[_0xa9c5('0x112')])?'x':'i';}var _0x4e625e=this['getVariable'][_0xa9c5('0x6c')](this,_0x44c80f['variable_id']);if(!_0x4e625e){return this['channel'][_0xa9c5('0x2a')](_0x44c80f,_0xa9c5('0xd8'));}this[_0xa9c5('0xc')]['setVariable'](_0x4e625e,_0x9ab0c4);if(this[_0xa9c5('0xa5')](_0x44c80f[_0xa9c5('0x116')])){var _0x24da3d=parseInt(_0x44c80f[_0xa9c5('0x116')],0xa);var _0x2443ea=rs[_0xa9c5('0x117')]({'charset':'*','length':_0x24da3d});var _0x351cf2=_0x9ab0c4[_0xa9c5('0x97')];if(_0x351cf2>0x0){if(_0x351cf2>_0x24da3d){this['createSquareDetailsReport'][_0xa9c5('0x6c')](this,_0x44c80f,_0x44c80f['hiddendigitspos']===_0xa9c5('0x118')?_0x2443ea+_0x9ab0c4[_0xa9c5('0x119')](_0x24da3d):_0x9ab0c4[_0xa9c5('0x119')](0x0,_0x351cf2-_0x24da3d)+_0x2443ea);}else{this[_0xa9c5('0x35')]['sync'](this,_0x44c80f,rs['generate']({'charset':'*','length':_0x351cf2}));}}else{this[_0xa9c5('0x35')]['sync'](this,_0x44c80f,'');}}else{this[_0xa9c5('0x35')][_0xa9c5('0x6c')](this,_0x44c80f,_0x9ab0c4);}return _0x3b0fe0;};AGIVertices[_0xa9c5('0xe')]['getsecretdigits']=function(_0x2a3478){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x11a'),_0x2a3478['label']));return this['getdigits'](_0x2a3478);};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x11b')]=function(_0x4eb084){logger['info'](util['format'](_0xa9c5('0x11c'),_0x4eb084[_0xa9c5('0x37')]));this[_0xa9c5('0x35')][_0xa9c5('0x6c')](this,_0x4eb084,_0x4eb084[_0xa9c5('0x11d')]);return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util['format']('GOAL\x20%s',_0x4eb084[_0xa9c5('0x11d')]));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x11e')]=function(_0x195828){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x11f'),_0x195828[_0xa9c5('0x37')]));if(!this[_0xa9c5('0xa5')](_0x195828[_0xa9c5('0x86')])||!this[_0xa9c5('0xa5')](_0x195828[_0xa9c5('0x87')])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0x120'));}if(!this[_0xa9c5('0xa5')](_0x195828['text'])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0xc3'));}this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x121'),_0x195828['text']));var _0x8d75ef=this[_0xa9c5('0x85')]['sync'](this,_0x195828);if(_0x8d75ef){this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util['format'](_0xa9c5('0x122'),_0x8d75ef));var _0x5d2b81=this[_0xa9c5('0xc')][_0xa9c5('0x100')](_0x8d75ef);try{fs[_0xa9c5('0x123')](_0x8d75ef+'.wav');}catch(_0x4c5367){logger[_0xa9c5('0x2a')](_0x4c5367);}return _0x5d2b81;}return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x195828,_0xa9c5('0x124'));};AGIVertices[_0xa9c5('0xe')]['awslex']=function(_0x215c8a){logger[_0xa9c5('0x2c')](util['format'](_0xa9c5('0x125'),_0x215c8a['label']));if(!this[_0xa9c5('0xa5')](_0x215c8a[_0xa9c5('0x86')])||!this[_0xa9c5('0xa5')](_0x215c8a[_0xa9c5('0x87')])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0x120'));}if(!this[_0xa9c5('0xa5')](_0x215c8a[_0xa9c5('0x8b')])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0x126'));}if(!this[_0xa9c5('0xa5')](_0x215c8a[_0xa9c5('0x5a')])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0xc3'));}this[_0xa9c5('0xc')]['bot']=!![];this[_0xa9c5('0x35')](_0x215c8a);this['createSquareMessage'](_0x215c8a[_0xa9c5('0x5a')],'in','','');this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x127'),_0x215c8a['text']));var _0x1f7c0d=this[_0xa9c5('0x89')]['sync'](this,_0x215c8a);if(_0x1f7c0d){for(var _0x4d07df in _0x1f7c0d){if(_0x1f7c0d[_0xa9c5('0x93')](_0x4d07df)&&_[_0xa9c5('0x94')](_0x1f7c0d[_0x4d07df])){this['channel'][_0xa9c5('0x9c')](util[_0xa9c5('0x28')](_0xa9c5('0x128'),_0x4d07df[_0xa9c5('0x68')]()),_0x1f7c0d[_0x4d07df]);}}if(_['isNil'](_0x1f7c0d['message'])){return this[_0xa9c5('0xc')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this['createSquareMessage'](_0x1f7c0d[_0xa9c5('0x129')],'out','amazonlex','');return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x12a'),_0x1f7c0d[_0xa9c5('0x129')]));}}return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x215c8a,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0xa9c5('0x12b')]=function(_0x4cc922){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x12c'),_0x4cc922[_0xa9c5('0x37')],_0x4cc922[_0xa9c5('0x64')]));if(!this[_0xa9c5('0xa5')](_0x4cc922[_0xa9c5('0x77')])){return this[_0xa9c5('0xc')]['noop'](_0xa9c5('0xe8'));}var _0xbfd60e=_0xa9c5('0x12d');var _0x59a5c5=util[_0xa9c5('0x28')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x4cc192=util['format'](_0xa9c5('0x9a'),_0x59a5c5,_0xbfd60e);var _0x53130b=!![];if(_0x4cc922[_0xa9c5('0x12e')]===_0xa9c5('0x12f')){_0x53130b=![];}var _0x2fbb1f=this[_0xa9c5('0xc')][_0xa9c5('0x130')](_0x59a5c5,_0xbfd60e,_0x4cc922[_0xa9c5('0x131')],_0x4cc922[_0xa9c5('0x64')],undefined,_0x53130b);if(_0x2fbb1f[_0xa9c5('0xa3')]!==-0x1){this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x132'),_0x4cc192));var _0x53f461=this['googleASR']['sync'](this,_0x4cc922,_0x4cc192);if(_0x53f461){for(var _0xdd9306 in _0x53f461){if(_0x53f461[_0xa9c5('0x93')](_0xdd9306)){this['channel'][_0xa9c5('0x9c')](util[_0xa9c5('0x28')]('GOOGLE_ASR_%s',_0xdd9306[_0xa9c5('0x68')]()),_0x53f461[_0xdd9306]);}}return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x133'),JSON[_0xa9c5('0x6f')](_0x53f461)));}}return _0x2fbb1f;};AGIVertices['prototype'][_0xa9c5('0x134')]=function(_0x4deceb){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x135'),_0x4deceb['label']));if(!this[_0xa9c5('0xa5')](_0x4deceb[_0xa9c5('0x8f')])){return this[_0xa9c5('0xc')]['noop'](_0xa9c5('0x136'));}if(!this[_0xa9c5('0xa5')](_0x4deceb[_0xa9c5('0x90')])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0x137'));}var _0x4d91db=_0xa9c5('0x12d');var _0x4b0e78=util[_0xa9c5('0x28')](_0xa9c5('0x138'),FILES_PATH,rs['generate'](0x4));var _0x58277e=util[_0xa9c5('0x28')](_0xa9c5('0x9a'),_0x4b0e78,_0x4d91db);var _0x88c0f8=!![];if(_0x4deceb[_0xa9c5('0x12e')]==='NOBEEP'){_0x88c0f8=![];}var _0x24f5d0=this[_0xa9c5('0xc')][_0xa9c5('0x130')](_0x4b0e78,_0x4d91db,_0x4deceb[_0xa9c5('0x131')],_0x4deceb[_0xa9c5('0x64')],undefined,_0x88c0f8);if(_0x24f5d0['result']!==-0x1){this[_0xa9c5('0xc')]['noop'](util[_0xa9c5('0x28')](_0xa9c5('0x139'),_0x58277e));var _0xb5e1=this[_0xa9c5('0x8e')][_0xa9c5('0x6c')](this,_0x4deceb,_0x58277e);if(_0xb5e1){for(var _0xd530db in _0xb5e1){if(_0xb5e1['hasOwnProperty'](_0xd530db)){this['channel'][_0xa9c5('0x9c')](util['format'](_0xa9c5('0x13a'),_0xd530db[_0xa9c5('0x68')]()),_0xb5e1[_0xd530db]);}}return this[_0xa9c5('0xc')]['noop'](util['format'](_0xa9c5('0x13b'),JSON[_0xa9c5('0x6f')](_0xb5e1)));}}return _0x24f5d0;};AGIVertices['prototype'][_0xa9c5('0x13c')]=function(_0x32c487){logger['info'](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x32c487[_0xa9c5('0x37')]));return this[_0xa9c5('0xc')]['continueAt'](_0x32c487[_0xa9c5('0x3c')],_0x32c487[_0xa9c5('0x3d')],_0x32c487[_0xa9c5('0x3e')]);};AGIVertices[_0xa9c5('0xe')]['gotoif']=function(_0x5ec5bb){logger[_0xa9c5('0x2c')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x5ec5bb[_0xa9c5('0x37')]));if(!this[_0xa9c5('0xa5')](_0x5ec5bb[_0xa9c5('0x13d')])){return this[_0xa9c5('0xc')]['error'](_0x5ec5bb,_0xa9c5('0x13e'));}try{var _0x5ccef2=eval(_0x5ec5bb[_0xa9c5('0x13d')])?_0xa9c5('0x13f'):_0xa9c5('0x140');this['channel']['noop'](util[_0xa9c5('0x28')](_0xa9c5('0x141'),_0x5ec5bb[_0xa9c5('0x13d')],_0x5ccef2));return{'code':0xc8,'result':_0x5ccef2};}catch(_0xc2b21c){return{'code':0xc8,'result':_0xa9c5('0x140')};}};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x142')]=function(_0xb08988){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x143'),_0xb08988[_0xa9c5('0x37')]));if(!this['isConfigured'](_0xb08988[_0xa9c5('0x144')])){return this['channel']['error'](_0xb08988,_0xa9c5('0x145'));}var _0x5ae8ab=this['getIntervals'][_0xa9c5('0x6c')](this,_0xb08988[_0xa9c5('0x144')]);if(!_0x5ae8ab){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0xb08988,_0xa9c5('0x146'));}for(var _0x38e797=0x0;_0x38e797<_0x5ae8ab[_0xa9c5('0x97')];_0x38e797+=0x1){var _0x2365e1=this[_0xa9c5('0xc')][_0xa9c5('0xa0')](util[_0xa9c5('0x28')](_0xa9c5('0x147'),_0x5ae8ab[_0x38e797]));if(_0x2365e1[_0xa9c5('0xa3')]===-0x1){return _0x2365e1;}logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x148'),_0x5ae8ab[_0x38e797],_0x2365e1[_0xa9c5('0xa1')]));if(_0x2365e1[_0xa9c5('0xa1')]==='true'){logger['info'](util[_0xa9c5('0x28')]('IFTIME\x20%s\x20%s',_0x5ae8ab[_0x38e797],_0xa9c5('0x13f')));this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util['format'](_0xa9c5('0x148'),_0x5ae8ab[_0x38e797],_0xa9c5('0x13f')));return{'code':0xc8,'result':_0xa9c5('0x13f')};}else{logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x148'),_0x5ae8ab[_0x38e797],'false'));this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x148'),_0x5ae8ab[_0x38e797],_0xa9c5('0x140')));}}return{'code':0xc8,'result':_0xa9c5('0x140')};};AGIVertices['prototype'][_0xa9c5('0x149')]=function(_0x13688e){logger[_0xa9c5('0x2c')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x13688e[_0xa9c5('0x37')]));return this['channel'][_0xa9c5('0x149')]();};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x14a')]=function(_0x152dc0){logger['info'](util[_0xa9c5('0x28')](_0xa9c5('0x14b'),_0x152dc0[_0xa9c5('0x37')]));if(!this['isConfigured'](_0x152dc0[_0xa9c5('0x77')])){return this['channel'][_0xa9c5('0xa9')](_0xa9c5('0xe8'));}var _0x51ff04=_0xa9c5('0x12d');var _0x5d9fb8=util[_0xa9c5('0x28')](_0xa9c5('0x138'),FILES_PATH,rs[_0xa9c5('0x117')](0x4));var _0x2544ae=util[_0xa9c5('0x28')](_0xa9c5('0x9a'),_0x5d9fb8,_0x51ff04);var _0x42f090=!![];if(_0x152dc0[_0xa9c5('0x12e')]===_0xa9c5('0x12f')){_0x42f090=![];}var _0x581f6a=this[_0xa9c5('0xc')][_0xa9c5('0x130')](_0x5d9fb8,_0x51ff04,_0x152dc0[_0xa9c5('0x131')],_0x152dc0[_0xa9c5('0x64')],undefined,_0x42f090);if(_0x581f6a[_0xa9c5('0xa3')]!==-0x1){this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')]('ispeech\x20%s\x20file\x20created',_0x2544ae));var _0x1e0ce7=this[_0xa9c5('0x82')]['sync'](this,_0x152dc0,_0x2544ae);if(_0x1e0ce7){for(var _0x15be84 in _0x1e0ce7){if(_0x1e0ce7[_0xa9c5('0x93')](_0x15be84)){this[_0xa9c5('0xc')]['setVariable'](util[_0xa9c5('0x28')]('ISPEECH_ASR_%s',_0x15be84[_0xa9c5('0x68')]()),_0x1e0ce7[_0x15be84]);}}return this['channel'][_0xa9c5('0xa9')](util[_0xa9c5('0x28')]('IspeechASR\x20Result\x20%s',JSON[_0xa9c5('0x6f')](_0x1e0ce7)));}}return _0x581f6a;};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x14c')]=function(_0x3dcb4a){logger['info'](util[_0xa9c5('0x28')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x3dcb4a[_0xa9c5('0x37')]));if(!this[_0xa9c5('0xa5')](_0x3dcb4a['key'])){return this['channel'][_0xa9c5('0xa9')]('no\x20key\x20configured');}if(!this[_0xa9c5('0xa5')](_0x3dcb4a['text'])){return this['channel']['noop'](_0xa9c5('0xc3'));}this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x14d'),_0x3dcb4a['text']));var _0xd401c6=this['ispeechTTS'][_0xa9c5('0x6c')](this,_0x3dcb4a);if(_0xd401c6){this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x14e'),_0xd401c6));var _0x3c3edf=this[_0xa9c5('0xc')]['streamFile'](_0xd401c6,_0x3dcb4a['intKey']);try{fs[_0xa9c5('0x123')](_0xd401c6+_0xa9c5('0x14f'));}catch(_0xc2ef07){logger[_0xa9c5('0x2a')](_0xc2ef07);}return _0x3c3edf;}return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x3dcb4a,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x150')]=function(_0x43a097){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x151'),_0x43a097[_0xa9c5('0x37')]));if(!this[_0xa9c5('0xa5')](_0x43a097[_0xa9c5('0x152')])){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x43a097,_0xa9c5('0x153'));}logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xa9c5('0xc')][_0xa9c5('0x39')],_0x43a097['findBy']));var _0x3f305b=this[_0xa9c5('0x52')][_0xa9c5('0x6c')](this,_0x43a097['findBy']);if(_0x3f305b){logger['info'](util['format'](_0xa9c5('0x154'),this[_0xa9c5('0xc')]['callerid'],_0x43a097[_0xa9c5('0x152')]));this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x154'),this[_0xa9c5('0xc')][_0xa9c5('0x39')],_0x43a097[_0xa9c5('0x152')]));return{'code':0xc8,'result':_0xa9c5('0x155')};}else{logger['info'](util[_0xa9c5('0x28')](_0xa9c5('0x156'),this[_0xa9c5('0xc')][_0xa9c5('0x39')],_0x43a097[_0xa9c5('0x152')]));this['channel'][_0xa9c5('0xa9')](util[_0xa9c5('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa9c5('0xc')][_0xa9c5('0x39')],_0x43a097[_0xa9c5('0x152')]));return{'code':0xc8,'result':_0xa9c5('0x157')};}};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x158')]=function(_0x1fadbe){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x159'),_0x1fadbe[_0xa9c5('0x37')]));if(!this[_0xa9c5('0xa5')](_0x1fadbe['findBy'])){return this[_0xa9c5('0xc')]['error'](_0x1fadbe,_0xa9c5('0x153'));}logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x15a'),this['channel']['callerid'],_0x1fadbe[_0xa9c5('0x152')]));var _0x457ddd=this[_0xa9c5('0x51')]['sync'](this,_0x1fadbe[_0xa9c5('0x152')]);if(_0x457ddd){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x154'),this[_0xa9c5('0xc')]['callerid'],_0x1fadbe['findBy']));this[_0xa9c5('0xc')]['noop'](util[_0xa9c5('0x28')](_0xa9c5('0x154'),this['channel'][_0xa9c5('0x39')],_0x1fadbe[_0xa9c5('0x152')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xa9c5('0x28')](_0xa9c5('0x156'),this[_0xa9c5('0xc')]['callerid'],_0x1fadbe[_0xa9c5('0x152')]));this['channel'][_0xa9c5('0xa9')](util[_0xa9c5('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa9c5('0xc')][_0xa9c5('0x39')],_0x1fadbe[_0xa9c5('0x152')]));return{'code':0xc8,'result':_0xa9c5('0x157')};}};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x15b')]=function(_0x14f232){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x15c'),_0x14f232[_0xa9c5('0x37')]));if(!this[_0xa9c5('0xa5')](_0x14f232[_0xa9c5('0x15d')])){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x14f232,_0xa9c5('0x15e'));}this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x15f'),_0x14f232[_0xa9c5('0x15d')]));var _0x229b67=eval(_0x14f232[_0xa9c5('0x15d')]);if(!this['isConfigured'](_0x14f232[_0xa9c5('0xd6')])){return this[_0xa9c5('0xc')]['noop'](_0xa9c5('0xd7'));}var _0xfec8f3=this[_0xa9c5('0xa0')][_0xa9c5('0x6c')](this,_0x14f232[_0xa9c5('0xd6')]);if(!_0xfec8f3){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x14f232,_0xa9c5('0xd8'));}if(_[_0xa9c5('0x9b')](_0x229b67)){var _0x5bfa7c=this;_0x229b67['forEach'](function(_0x2e20fe,_0x3f1612){_0x5bfa7c[_0xa9c5('0xc')][_0xa9c5('0x9c')](util[_0xa9c5('0x28')](_0xa9c5('0x160'),_0xfec8f3,_0x3f1612),_0x2e20fe);});return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util['format'](_0xa9c5('0x161'),_0xfec8f3));}else{return this[_0xa9c5('0xc')]['setVariable'](_0xfec8f3,_0x229b67);}};AGIVertices['prototype'][_0xa9c5('0x162')]=function(_0x31be30){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x163'),_0x31be30[_0xa9c5('0x37')]));if(_0x31be30[_0xa9c5('0xa7')]===0x0){return this[_0xa9c5('0xa6')](_0x31be30);}_0x31be30[_0xa9c5('0xa7')]-=0x1;if(!this[_0xa9c5('0xa5')](_0x31be30[_0xa9c5('0x10f')])){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x31be30,_0xa9c5('0x110'));}var _0x13e520=this['getSound']['sync'](this,_0x31be30['file_id']);if(!_0x13e520){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x31be30,_0xa9c5('0x164'));}var _0x139f2c=this[_0xa9c5('0xc')]['getData'](_0x13e520,_0x31be30[_0xa9c5('0x165')],_0x31be30[_0xa9c5('0x166')]);var _0x1ba14d=_0x139f2c['result'];if(_0x139f2c[_0xa9c5('0xa3')]===-0x1){this[_0xa9c5('0x35')][_0xa9c5('0x6c')](this,_0x31be30,'-1');return _0x139f2c;}else if(_0x139f2c[_0xa9c5('0xa1')]===_0xa9c5('0x64')){_0x139f2c[_0xa9c5('0xa3')]=_0x139f2c[_0xa9c5('0xa3')][_0xa9c5('0x97')]>0x0?_0x139f2c[_0xa9c5('0xa3')]:'t';}else if(_[_0xa9c5('0x42')](_0x139f2c[_0xa9c5('0xa3')])){_0x139f2c[_0xa9c5('0xa3')]='#';_0x1ba14d='#';}if(!this[_0xa9c5('0xa5')](_0x31be30['variable_id'])){this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0xd7'));}else{var _0x4d6b70=this[_0xa9c5('0xa0')]['sync'](this,_0x31be30[_0xa9c5('0xd6')]);if(!_0x4d6b70){return this['channel'][_0xa9c5('0x2a')](_0x31be30,_0xa9c5('0xd8'));}this[_0xa9c5('0xc')][_0xa9c5('0x9c')](_0x4d6b70,_0x1ba14d);}this[_0xa9c5('0x35')]['sync'](this,_0x31be30,_0x1ba14d);return _0x139f2c;};AGIVertices[_0xa9c5('0xe')]['noop']=function(_0x5691dc){logger['info'](util['format'](_0xa9c5('0x167'),_0x5691dc[_0xa9c5('0x37')]));return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0x5691dc[_0xa9c5('0x168')]||_0x5691dc[_0xa9c5('0x37')]);};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x169')]=function(_0x56f183){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x16a'),_0x56f183[_0xa9c5('0x37')]));if(!this[_0xa9c5('0xa5')](_0x56f183[_0xa9c5('0x152')])){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x56f183,'no\x20find\x20by\x20configured');}logger[_0xa9c5('0x2c')](util['format'](_0xa9c5('0x15a'),this['channel'][_0xa9c5('0x39')],_0x56f183['findBy']));var _0x59a91b=this['getPause'][_0xa9c5('0x6c')](this,_0x56f183[_0xa9c5('0x16b')]);var _0x54d2d8=this[_0xa9c5('0x4e')]['sync'](this,_0x56f183['findBy'],_0x59a91b);if(_0x54d2d8){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa9c5('0xc')][_0xa9c5('0x39')],_0x56f183[_0xa9c5('0x152')]));this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa9c5('0xc')][_0xa9c5('0x39')],_0x56f183[_0xa9c5('0x152')]));return{'code':0xc8,'result':_0xa9c5('0x155')};}else{logger[_0xa9c5('0x2c')](util['format'](_0xa9c5('0x156'),this[_0xa9c5('0xc')]['callerid'],_0x56f183[_0xa9c5('0x152')]));this[_0xa9c5('0xc')]['noop'](util[_0xa9c5('0x28')](_0xa9c5('0x154'),this[_0xa9c5('0xc')][_0xa9c5('0x39')],_0x56f183[_0xa9c5('0x152')]));return{'code':0xc8,'result':_0xa9c5('0x157')};}};AGIVertices['prototype'][_0xa9c5('0x16c')]=function(_0x4009d6){logger[_0xa9c5('0x2c')](util['format'](_0xa9c5('0x16d'),_0x4009d6['label']));if(!this[_0xa9c5('0xa5')](_0x4009d6['file_id'])){return this[_0xa9c5('0xc')]['error'](_0x4009d6,_0xa9c5('0x110'));}var _0x51742=this[_0xa9c5('0x111')]['sync'](this,_0x4009d6[_0xa9c5('0x10f')]);if(!_0x51742){return this['channel'][_0xa9c5('0x2a')](_0x4009d6,'no\x20file\x20audio\x20found');}var _0x37d4ca=this['channel'][_0xa9c5('0xaf')]('PLAYBACK',[_0x51742,_0x4009d6[_0xa9c5('0xe6')]]);if(_0x37d4ca[_0xa9c5('0xa3')]===-0x1){return _0x37d4ca;}return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util['format'](_0xa9c5('0x16e'),_0xa9c5('0x16f'),_0x51742));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x170')]=function(_0x356c58){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x171'),_0x356c58[_0xa9c5('0x37')]));if(!this['isConfigured'](_0x356c58[_0xa9c5('0x172')])){return this['channel'][_0xa9c5('0x2a')](_0x356c58,_0xa9c5('0x173'));}var _0x52d970='';var _0x27df11=parseInt(_0x356c58[_0xa9c5('0x172')],0xa);if(isNaN(_0x27df11)){_0x52d970=_0x356c58[_0xa9c5('0x172')];}else{_0x52d970=this[_0xa9c5('0x14')][_0xa9c5('0x6c')](this,_0x356c58[_0xa9c5('0x172')]);if(!_0x52d970){return this['channel'][_0xa9c5('0x2a')](_0x356c58,_0xa9c5('0x174'));}}var _0x44eebf='';if(this[_0xa9c5('0xa5')](_0x356c58[_0xa9c5('0x10f')])){var _0x5632f2=this[_0xa9c5('0x111')]['sync'](this,_0x356c58[_0xa9c5('0x10f')]);if(_0x5632f2){_0x44eebf=_0x5632f2;}}this[_0xa9c5('0x35')][_0xa9c5('0x6c')](this,_0x356c58,_0x52d970);if(_0x356c58[_0xa9c5('0xe6')][_0xa9c5('0x175')]('x')<0x0){_0x356c58[_0xa9c5('0xe6')]+='x';}if(_0x356c58['opts'][_0xa9c5('0x175')]('X')<0x0){_0x356c58[_0xa9c5('0xe6')]+='X';}this['channel']['setVariable'](_0xa9c5('0x176'),_0x52d970?_0x52d970[_0xa9c5('0x177')]():'');var _0x207523=this['channel']['exec'](_0xa9c5('0x178'),[_0x52d970,_0x356c58['opts'],_0x356c58[_0xa9c5('0x61')],_0x44eebf,_0x356c58['timeout'],_0x356c58[_0xa9c5('0x7')],_0x356c58[_0xa9c5('0x179')],_0x356c58[_0xa9c5('0x17a')],'',_0x356c58[_0xa9c5('0x17b')]]);if(_0x207523[_0xa9c5('0xa3')]===-0x1){return _0x207523;}return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x16e'),_0xa9c5('0x178'),_0x52d970));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x17c')]=function(_0x55932f){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x17d'),_0x55932f[_0xa9c5('0x37')]));var _0x178313=_0x55932f[_0xa9c5('0x17e')]||_0xa9c5('0x12d');var _0x2dce09=util['format'](_0xa9c5('0x17f'),this[_0xa9c5('0xc')][_0xa9c5('0x36')],rs[_0xa9c5('0x117')](0x5));var _0x51de53=util[_0xa9c5('0x28')]('%s/recordings/%s.%s',FILES_PATH,_0x2dce09,_0x178313);var _0x2aa9df=util[_0xa9c5('0x28')](_0xa9c5('0x138'),FILES_PATH,_0x2dce09);this[_0xa9c5('0x3a')]['sync'](this,_0x55932f,_0x2dce09,_0x51de53);this[_0xa9c5('0xc')]['setVariable'](_0xa9c5('0x180'),_0x2dce09);logger['info'](_0xa9c5('0x181'),_0x2aa9df,_0x178313,_0x55932f[_0xa9c5('0x182')],_0x55932f[_0xa9c5('0x64')]);return this['channel'][_0xa9c5('0x130')](_0x2aa9df,_0x178313,_0x55932f[_0xa9c5('0x182')],_0x55932f[_0xa9c5('0x64')],undefined,!![]);};AGIVertices[_0xa9c5('0xe')]['restapi']=function(_0x1f1194){logger[_0xa9c5('0x2c')](util['format'](_0xa9c5('0x183'),_0x1f1194[_0xa9c5('0x37')]));if(!this[_0xa9c5('0xa5')](_0x1f1194[_0xa9c5('0x61')])){return this[_0xa9c5('0xc')]['noop'](_0xa9c5('0x184'));}var _0x14eded=this['restAPI'][_0xa9c5('0x6c')](this,_0x1f1194);logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x185'),util[_0xa9c5('0x186')](_0x14eded,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x1f1194['variable_id'])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0x187'));}var _0x32ffa1=this['getVariable']['sync'](this,_0x1f1194[_0xa9c5('0xd6')]);if(!_0x32ffa1){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x1f1194,_0xa9c5('0xd8'));}this[_0xa9c5('0xc')]['setVariable'](util['format'](_0xa9c5('0x188'),_0x32ffa1),_0x14eded[_0xa9c5('0x72')]?_0x14eded['statusCode']:_0xa9c5('0x189'));this[_0xa9c5('0xc')][_0xa9c5('0x9c')](util[_0xa9c5('0x28')](_0xa9c5('0x18a'),_0x32ffa1),_0x14eded[_0xa9c5('0x73')]?_0x14eded[_0xa9c5('0x73')]:'OK');if(_0x14eded[_0xa9c5('0x69')]){try{this[_0xa9c5('0x98')](_0x14eded[_0xa9c5('0x69')],_0x32ffa1);}catch(_0x5f39de){logger[_0xa9c5('0x2a')](util[_0xa9c5('0x28')](_0xa9c5('0x18b'),_0x32ffa1));}}return this['channel'][_0xa9c5('0xa9')](util[_0xa9c5('0x28')]('variable\x20%s\x20set',_0x32ffa1));};AGIVertices[_0xa9c5('0xe')]['saydigits']=function(_0x45df21){logger['info'](util[_0xa9c5('0x28')](_0xa9c5('0x18c'),_0x45df21['label']));return this[_0xa9c5('0xc')][_0xa9c5('0x18d')](_0x45df21[_0xa9c5('0x18e')][_0xa9c5('0x57')](/\s+/g,''),_0x45df21[_0xa9c5('0x182')]);};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x18f')]=function(_0x871c29){logger['info'](util['format'](_0xa9c5('0x190'),_0x871c29[_0xa9c5('0x37')]));return this[_0xa9c5('0xc')]['sayNumber'](_0x871c29['number'][_0xa9c5('0x57')](/\s+/g,''),_0x871c29[_0xa9c5('0x182')]);};AGIVertices['prototype'][_0xa9c5('0x191')]=function(_0x908b65){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x192'),_0x908b65[_0xa9c5('0x37')]));return this[_0xa9c5('0xc')][_0xa9c5('0x193')](_0x908b65[_0xa9c5('0x5a')],_0x908b65[_0xa9c5('0x182')]);};AGIVertices['prototype'][_0xa9c5('0x194')]=function(_0x3b5640){logger['info'](util[_0xa9c5('0x28')](_0xa9c5('0x195'),_0x3b5640[_0xa9c5('0x37')]));if(!this[_0xa9c5('0xa5')](_0x3b5640[_0xa9c5('0x196')])){return this[_0xa9c5('0xc')]['noop']('no\x20mail\x20account\x20configured');}var _0x1e4d3=this[_0xa9c5('0x1f')][_0xa9c5('0x6c')](this,_0x3b5640[_0xa9c5('0x196')]);if(!_0x1e4d3||!_0x1e4d3[_0xa9c5('0x197')]){return this['channel']['error'](_0x3b5640,_0xa9c5('0x198'));}var _0x2eb427={'from':util[_0xa9c5('0x28')]('\x22%s\x22\x20<%s>',_0x1e4d3[_0xa9c5('0x12')],_0x1e4d3[_0xa9c5('0x199')]||_0x1e4d3[_0xa9c5('0x197')][_0xa9c5('0x19a')]),'to':_0x3b5640['to']||'','cc':_0x3b5640['cc']||'','bcc':_0x3b5640[_0xa9c5('0x19b')]||'','subject':_0x3b5640[_0xa9c5('0x19c')],'html':_0x3b5640[_0xa9c5('0x5a')],'text':_0x3b5640[_0xa9c5('0x5a')]};if(this[_0xa9c5('0xa5')](_0x3b5640['template_id'])){}logger['debug'](_0xa9c5('0x19d'),JSON['stringify'](_0x2eb427));this[_0xa9c5('0x35')]['sync'](this,_0x3b5640,_0x3b5640[_0xa9c5('0x196')]);this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x19e'),_0x1e4d3[_0xa9c5('0x12')]));this[_0xa9c5('0x21')][_0xa9c5('0x6c')](this,_0x1e4d3[_0xa9c5('0x19f')],_0x2eb427);return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0x1a0'));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x1a1')]=function(_0x4a922c){logger[_0xa9c5('0x2c')](util['format'](_0xa9c5('0x1a2'),_0x4a922c[_0xa9c5('0x37')]));return this[_0xa9c5('0xc')]['noop'](_0xa9c5('0x1a3'));};AGIVertices[_0xa9c5('0xe')]['sendSMS']=function(_0x30501d){logger['info'](util[_0xa9c5('0x28')](_0xa9c5('0x1a4'),_0x30501d[_0xa9c5('0x37')]));if(!this[_0xa9c5('0xa5')](_0x30501d[_0xa9c5('0x1a5')])){return this['channel'][_0xa9c5('0xa9')](_0xa9c5('0x1a6'));}var _0x35c1be=this[_0xa9c5('0x32')][_0xa9c5('0x6c')](this,_0x30501d[_0xa9c5('0x1a5')]);if(!_0x35c1be){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x30501d,_0xa9c5('0x1a7'));}var _0x532eb4={'body':_0x30501d['sms_text'],'phone':_0x30501d['to']||'','SmsAccountId':_0x35c1be['id']};logger[_0xa9c5('0xde')](_0xa9c5('0x1a8'),JSON[_0xa9c5('0x6f')](_0x532eb4));this[_0xa9c5('0x35')][_0xa9c5('0x6c')](this,_0x30501d,_0x30501d[_0xa9c5('0x1a5')]);this[_0xa9c5('0xc')]['noop'](util['format'](_0xa9c5('0x1a9'),_0x35c1be[_0xa9c5('0x12')]));this['createSmsMessage'][_0xa9c5('0x6c')](this,_0x532eb4);return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0x1aa'));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x1ab')]=function(_0x468cb4){logger['info'](util[_0xa9c5('0x28')](_0xa9c5('0x1ac'),_0x468cb4[_0xa9c5('0x37')]));if(!this[_0xa9c5('0xa5')](_0x468cb4[_0xa9c5('0xd6')])){return this['channel'][_0xa9c5('0x2a')](_0x468cb4,_0xa9c5('0x1ad'));}var _0x30fb9f=this['getVariable'][_0xa9c5('0x6c')](this,_0x468cb4[_0xa9c5('0xd6')]);if(!_0x30fb9f){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x468cb4,_0xa9c5('0xd8'));}return this[_0xa9c5('0xc')][_0xa9c5('0x9c')](_0x30fb9f,_0x468cb4[_0xa9c5('0x1ae')]);};AGIVertices[_0xa9c5('0xe')]['start']=function(_0x39ecc4){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x1af'),_0x39ecc4[_0xa9c5('0x37')]));this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0x1b0'));var _0x23b569=this[_0xa9c5('0xc')]['getVariable'](_0xa9c5('0x1b1'));if(!_[_0xa9c5('0x42')](_0x23b569['extra'])){this[_0xa9c5('0xc')]['uniqueid']=_0x23b569[_0xa9c5('0xa1')];}if(_0x39ecc4[_0xa9c5('0xb9')]==='yes'){this['channel'][_0xa9c5('0xa9')](_0xa9c5('0x1b2'));return this[_0xa9c5('0xc')]['answer']();}return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0x1b3'));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x1b4')]=function(_0x53e506){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x1b5'),_0x53e506['label']));if(!this[_0xa9c5('0xa5')](_0x53e506['project_id'])){return this['channel'][_0xa9c5('0x2a')](_0x53e506,_0xa9c5('0x1b6'));}var _0x3930d1=this['getSquareProject'][_0xa9c5('0x6c')](this,_0x53e506[_0xa9c5('0x1b7')]);if(!this['isConfigured'](_0x3930d1)){return this[_0xa9c5('0xc')]['error'](_0x53e506,util[_0xa9c5('0x28')](_0xa9c5('0x1b8'),_0x53e506[_0xa9c5('0x1b7')]));}if(_0x3930d1===this[_0xa9c5('0xc')][_0xa9c5('0x3f')]){return this[_0xa9c5('0xc')]['error'](_0x53e506,_0xa9c5('0x1b9'));}this[_0xa9c5('0x35')][_0xa9c5('0x6c')](this,_0x53e506,_0x3930d1);var _0x497a84=this[_0xa9c5('0xc')][_0xa9c5('0xaf')](_0xa9c5('0x1ba'),util[_0xa9c5('0x28')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xa9c5('0x7')][_0xa9c5('0x1bb')]||_0xa9c5('0x1bc'),_0x3930d1,this[_0xa9c5('0xc')][_0xa9c5('0x3f')]));if(_0x497a84[_0xa9c5('0xa3')]===-0x1){return _0x497a84;}return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')]('Executed\x20command\x20%s\x20%s',_0xa9c5('0x1ba'),_0x3930d1));};AGIVertices['prototype'][_0xa9c5('0x1bd')]=function(_0x5b5e20){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x1be'),_0x5b5e20[_0xa9c5('0x37')]));var _0xb8cde1=this[_0xa9c5('0x56')][_0xa9c5('0x6c')](this,_0x5b5e20['command']);this[_0xa9c5('0x35')][_0xa9c5('0x6c')](this,_0x5b5e20,_0x5b5e20['command']);if(this[_0xa9c5('0xa5')](_0x5b5e20[_0xa9c5('0xd6')])){var _0x5582c7=this[_0xa9c5('0xa0')][_0xa9c5('0x6c')](this,_0x5b5e20[_0xa9c5('0xd6')]);if(_0x5582c7){this[_0xa9c5('0xc')][_0xa9c5('0x9c')](_0x5582c7,_0xb8cde1);return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x5b5e20[_0xa9c5('0xb5')],_0x5582c7));}}return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x1bf'),_0x5b5e20[_0xa9c5('0xb5')]));};AGIVertices['prototype'][_0xa9c5('0x1c0')]=function(_0x4908e4){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x1c1'),_0x4908e4[_0xa9c5('0x37')]));_0x4908e4['text']=_0x4908e4['text'][_0xa9c5('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x4908e4[_0xa9c5('0x1c2')])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0x1c3'));}if(!this['isConfigured'](_0x4908e4[_0xa9c5('0x5a')])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')](_0xa9c5('0xc3'));}this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util['format'](_0xa9c5('0x1c4'),_0x4908e4[_0xa9c5('0x5a')]));var _0x450611=this[_0xa9c5('0x58')][_0xa9c5('0x6c')](this,_0x4908e4);if(_0x450611){this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x1c5'),_0x450611));var _0x43b746=this[_0xa9c5('0xc')][_0xa9c5('0x100')](_0x450611);try{fs[_0xa9c5('0x123')](_0x450611+_0xa9c5('0x14f'));}catch(_0x247420){logger[_0xa9c5('0x2a')](_0x247420);}return _0x43b746;}return this[_0xa9c5('0xc')]['error'](_0x4908e4,_0xa9c5('0x1c6'));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x1c7')]=function(_0x17f53c){logger['info'](util['format'](_0xa9c5('0x1c8'),_0x17f53c[_0xa9c5('0x37')]));_0x17f53c[_0xa9c5('0x5a')]=_0x17f53c['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa9c5('0xa5')](_0x17f53c['text'])){return this[_0xa9c5('0xc')][_0xa9c5('0xa9')]('no\x20text\x20configured');}this['channel'][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x1c9'),_0x17f53c[_0xa9c5('0x5a')]));var _0x16dd78=this['googleTTS']['sync'](this,_0x17f53c);if(_0x16dd78){this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x1ca'),_0x16dd78));var _0x5a490c=this['channel'][_0xa9c5('0x100')](_0x16dd78);try{fs['unlink'](_0x16dd78+_0xa9c5('0x14f'));}catch(_0x5cfb7e){logger[_0xa9c5('0x2a')](_0x5cfb7e);}return _0x5a490c;}return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x17f53c,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x1cb')]=function(_0x4d3dfc){logger['info'](util[_0xa9c5('0x28')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x4d3dfc['label']));if(!this[_0xa9c5('0xa5')](_0x4d3dfc['findBy'])){return this[_0xa9c5('0xc')]['error'](_0x4d3dfc,_0xa9c5('0x153'));}logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xa9c5('0xc')][_0xa9c5('0x39')],_0x4d3dfc[_0xa9c5('0x152')]));var _0x574fa8=this['agentUnpause'][_0xa9c5('0x6c')](this,_0x4d3dfc[_0xa9c5('0x152')]);if(_0x574fa8){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x154'),this[_0xa9c5('0xc')][_0xa9c5('0x39')],_0x4d3dfc[_0xa9c5('0x152')]));this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x154'),this[_0xa9c5('0xc')][_0xa9c5('0x39')],_0x4d3dfc[_0xa9c5('0x152')]));return{'code':0xc8,'result':_0xa9c5('0x155')};}else{logger['info'](util[_0xa9c5('0x28')](_0xa9c5('0x156'),this[_0xa9c5('0xc')]['callerid'],_0x4d3dfc[_0xa9c5('0x152')]));this[_0xa9c5('0xc')][_0xa9c5('0xa9')](util[_0xa9c5('0x28')](_0xa9c5('0x156'),this[_0xa9c5('0xc')][_0xa9c5('0x39')],_0x4d3dfc[_0xa9c5('0x152')]));return{'code':0xc8,'result':_0xa9c5('0x157')};}};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x1cc')]=function(_0x29f363){logger['info'](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x29f363[_0xa9c5('0x37')]));var _0x349d92=this['channel'][_0xa9c5('0xaf')](_0xa9c5('0x1cd'),[_0x29f363['mailbox'],_0x29f363['options']]);if(_0x349d92[_0xa9c5('0xa3')]===-0x1){return _0x349d92;}return this[_0xa9c5('0xc')]['noop'](util['format']('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x29f363[_0xa9c5('0x1ce')]));};AGIVertices[_0xa9c5('0xe')][_0xa9c5('0x1cf')]=function(_0x26f495){logger[_0xa9c5('0x2c')](util[_0xa9c5('0x28')](_0xa9c5('0x1d0'),_0x26f495[_0xa9c5('0x37')]));if(!this[_0xa9c5('0xa5')](_0x26f495[_0xa9c5('0xd6')])){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x26f495,_0xa9c5('0x1ad'));}var _0xc3f1a6=this[_0xa9c5('0xa0')][_0xa9c5('0x6c')](this,_0x26f495[_0xa9c5('0xd6')]);if(!_0xc3f1a6){return this[_0xa9c5('0xc')][_0xa9c5('0x2a')](_0x26f495,_0xa9c5('0xd8'));}var _0x1d4606=this[_0xa9c5('0xc')][_0xa9c5('0xa0')](_0xc3f1a6);return{'code':0xc8,'result':_0x1d4606[_0xa9c5('0xa1')]?_0x1d4606[_0xa9c5('0xa1')]:'-'};};String[_0xa9c5('0xe')][_0xa9c5('0x9f')]=function(_0x4382f3,_0x3243a9){return this[_0xa9c5('0x9e')](_0x4382f3)[_0xa9c5('0x1d1')](_0x3243a9);};module[_0xa9c5('0x1d2')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 8d5fa29..c33a51e 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 _0x873d=['[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','YYYY-MM-DD\x20HH:mm:ss','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','pauseType','ACW','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','mandatoryDisposition','interface','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','[%s][HANGUP:LINKEDID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','diff','seconds','prototype','updateAcw','lastPauseAt','timer','update','uniqueid','then','info','catch','error','[%s][UPDATE][ERRORS:%s]','startAcw','queue','mandatoryDispositionPause','name','resolve','getAgent','voicePause'];(function(_0x17e306,_0x7adef3){var _0x4278cf=function(_0x403468){while(--_0x403468){_0x17e306['push'](_0x17e306['shift']());}};_0x4278cf(++_0x7adef3);}(_0x873d,0xe0));var _0xd873=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x873d[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0xd873('0x0'));var moment=require(_0xd873('0x1'));var ami=require('../ami');var logger=require(_0xd873('0x2'))(_0xd873('0x3'));var RpcUser=require(_0xd873('0x4'));var RpcVoiceAgentReport=require(_0xd873('0x5'));function Acw(_0x4fb23c){this[_0xd873('0x6')]=_0x4fb23c[_0xd873('0x6')];this['agents']=_0x4fb23c[_0xd873('0x7')];this[_0xd873('0x8')]=_0x4fb23c[_0xd873('0x8')];this[_0xd873('0x9')]={};ami['on']('agentconnect',this[_0xd873('0xa')][_0xd873('0xb')](this));ami['on'](_0xd873('0xc'),this[_0xd873('0xd')][_0xd873('0xb')](this));ami['on'](_0xd873('0xe'),this[_0xd873('0xf')]['bind'](this));ami['on'](_0xd873('0x10'),this['syncAgentRingNoAnswer'][_0xd873('0xb')](this));ami['on'](_0xd873('0x11'),this[_0xd873('0x12')]['bind'](this));ami['on'](_0xd873('0x13'),this[_0xd873('0x14')][_0xd873('0xb')](this));ami['on'](_0xd873('0x15'),this[_0xd873('0x16')][_0xd873('0xb')](this));}function getDiff(_0x2067ac){var _0x410bf0=moment()['milliseconds'](0x0);var _0x56ffd8=moment(_0x2067ac)['milliseconds'](0x0);return _0x410bf0[_0xd873('0x17')](_0x56ffd8,_0xd873('0x18'));}Acw[_0xd873('0x19')][_0xd873('0x1a')]=function(_0x437d95,_0x2cdbb2){var _0x120d8a=this;var _0x166d5b=getDiff(_0x120d8a[_0xd873('0x8')][_0x437d95][_0xd873('0x1b')]);clearTimeout(_0x120d8a[_0xd873('0x8')][_0x437d95][_0xd873('0x1c')]);_0x120d8a[_0xd873('0x8')][_0x437d95]['timer']=![];return RpcVoiceAgentReport[_0xd873('0x1d')]({'acwtime':_0x166d5b},_0x120d8a[_0xd873('0x8')][_0x437d95][_0xd873('0x1e')],_0x437d95)[_0xd873('0x1f')](function(_0x2283f8){logger[_0xd873('0x20')]('[%s][UPDATE][ACWTIME:%s]',_0x2cdbb2,_0x166d5b,_0x2283f8);})[_0xd873('0x21')](function(_0x269bfe){logger[_0xd873('0x22')](_0xd873('0x23'),_0x2cdbb2,_0x269bfe);})['finally'](function(){delete _0x120d8a[_0xd873('0x8')][_0x437d95];});};Acw[_0xd873('0x19')][_0xd873('0x24')]=function(_0x3b770d){try{var _0x294b5a=this;var _0xd94b9b=this[_0xd873('0x9')][_0x3b770d]['interface'];var _0x52db14=this[_0xd873('0x9')][_0x3b770d][_0xd873('0x25')];var _0x481a67=this[_0xd873('0x6')][_0x52db14];var _0x1b6662=![];var _0x4dd51c='ACW';if(_0x481a67['mandatoryDisposition']&&_0x481a67[_0xd873('0x26')][_0xd873('0x27')]){_0x1b6662=!![];_0x4dd51c=_0x481a67[_0xd873('0x26')][_0xd873('0x27')];}if(!_0x294b5a[_0xd873('0x7')][_0xd94b9b]){return Promise[_0xd873('0x28')]();}return RpcUser[_0xd873('0x29')](_0x294b5a[_0xd873('0x7')][_0xd94b9b]['id'])['then'](function(_0x40bf14){if(!_0x40bf14||_0x40bf14[_0xd873('0x2a')]){logger[_0xd873('0x20')](_0xd873('0x2b'),_0x3b770d,_0xd94b9b,_0x52db14);return;}logger[_0xd873('0x20')](_0xd873('0x2c'),_0x3b770d,_0xd94b9b,_0x52db14);var _0xb33630=_0x294b5a['channels'][_0x3b770d][_0xd873('0x2d')]&&_0x294b5a['channels'][_0x3b770d]['destlinkedid']?_0x294b5a[_0xd873('0x9')][_0x3b770d][_0xd873('0x2e')]:_0x3b770d;return RpcUser[_0xd873('0x2f')](_0x294b5a[_0xd873('0x7')][_0xd94b9b],_0x4dd51c,_0xb33630)[_0xd873('0x1f')](function(_0x1b87d9){_0x294b5a[_0xd873('0x6')][_0x52db14][_0xd873('0x30')]-=0x1;_0x294b5a[_0xd873('0x6')][_0x52db14]['paused']+=0x1;return _0x1b87d9;});})['then'](function(_0x4452ee){if(_0x1b6662||!_0x4452ee){return;}_0x294b5a[_0xd873('0x8')][_0xd94b9b]={};logger['info'](_0xd873('0x31'),_0x3b770d,_0x294b5a[_0xd873('0x6')][_0x52db14][_0xd873('0x32')],_0xd94b9b,_0x52db14);_0x294b5a[_0xd873('0x8')][_0xd94b9b][_0xd873('0x1c')]=setTimeout(_0x294b5a[_0xd873('0x33')][_0xd873('0xb')](_0x294b5a,_0xd94b9b),_0x294b5a[_0xd873('0x6')][_0x52db14][_0xd873('0x32')]*0x3e8);_0x294b5a[_0xd873('0x8')][_0xd94b9b][_0xd873('0x1b')]=moment()['format'](_0xd873('0x34'));_0x294b5a[_0xd873('0x8')][_0xd94b9b][_0xd873('0x1e')]=_0x3b770d;_0x294b5a['timers'][_0xd94b9b]['queue']=_0x52db14;_0x294b5a[_0xd873('0x8')][_0xd94b9b]['updateAcw']=_0x294b5a[_0xd873('0x1a')][_0xd873('0xb')](_0x294b5a,_0xd94b9b,_0x3b770d);})[_0xd873('0x21')](function(){logger[_0xd873('0x22')](_0xd873('0x31'),_0x3b770d,_0x294b5a[_0xd873('0x6')][_0x52db14]['acwTimeout'],_0xd94b9b,_0x52db14);})[_0xd873('0x35')](function(){delete _0x294b5a[_0xd873('0x9')][_0x3b770d];});}catch(_0xae204){logger[_0xd873('0x22')](_0xd873('0x36'),_0xae204[_0xd873('0x37')]);}};Acw[_0xd873('0x19')][_0xd873('0x33')]=function(_0x3c5c4a){try{var _0x3f821e=this;if(_0x3f821e[_0xd873('0x8')][_0x3c5c4a]){_0x3f821e[_0xd873('0x8')][_0x3c5c4a][_0xd873('0x1c')]=![];var _0x36218d=_0x3f821e[_0xd873('0x8')][_0x3c5c4a][_0xd873('0x1e')];var _0x9ff001=_0x3f821e[_0xd873('0x8')][_0x3c5c4a][_0xd873('0x25')];var _0x2d2d1c=_0x3f821e[_0xd873('0x6')][_0x9ff001]['acwTimeout'];logger[_0xd873('0x20')](_0xd873('0x38'),_0x36218d,_0x3c5c4a);RpcUser[_0xd873('0x29')](this[_0xd873('0x7')][_0x3c5c4a]['id'])[_0xd873('0x1f')](function(_0x2530c5){if(_0x2530c5[_0xd873('0x39')]===_0xd873('0x3a')){return RpcUser[_0xd873('0x3b')](_0x3f821e['agents'][_0x3c5c4a]);}});RpcVoiceAgentReport['update']({'acwtime':_0x2d2d1c,'agentacw':!![]},_0x36218d,_0x3c5c4a)[_0xd873('0x1f')](function(_0x29b78e){logger[_0xd873('0x20')](_0xd873('0x3c'),_0x36218d,_0x2d2d1c,_0x29b78e);})[_0xd873('0x21')](function(_0x392634){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x36218d,_0x392634);});}else{logger[_0xd873('0x22')](_0xd873('0x3d'),_0x3c5c4a);if(_0x3f821e[_0xd873('0x8')]){logger[_0xd873('0x20')]('[ACW][TIMERS]',JSON[_0xd873('0x3e')](_0x3f821e[_0xd873('0x8')]));}}}catch(_0x1c5106){logger[_0xd873('0x22')](_0xd873('0x3f'),_0x1c5106[_0xd873('0x37')]);}};Acw[_0xd873('0x19')][_0xd873('0xa')]=function(_0x3209c1){try{if(this['voiceQueues'][_0x3209c1[_0xd873('0x25')]]&&(this['voiceQueues'][_0x3209c1['queue']][_0xd873('0x3')]||this[_0xd873('0x6')][_0x3209c1['queue']][_0xd873('0x40')])){if(this[_0xd873('0x7')][_0x3209c1['interface']]){this[_0xd873('0x9')][_0x3209c1[_0xd873('0x1e')]]={'queue':_0x3209c1[_0xd873('0x25')],'interface':_0x3209c1[_0xd873('0x41')],'destlinkedid':_0x3209c1['destlinkedid']};}}}catch(_0x14c7f4){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x14c7f4[_0xd873('0x37')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x436dac){try{if(this['voiceQueues'][_0x436dac['queue']]&&(this[_0xd873('0x6')][_0x436dac[_0xd873('0x25')]][_0xd873('0x3')]||this[_0xd873('0x6')][_0x436dac[_0xd873('0x25')]]['mandatoryDisposition'])){if(this[_0xd873('0x7')][_0x436dac[_0xd873('0x41')]]){this[_0xd873('0x9')][_0x436dac[_0xd873('0x1e')]]={'queue':_0x436dac[_0xd873('0x25')],'interface':_0x436dac[_0xd873('0x41')]};}}}catch(_0x499c81){logger[_0xd873('0x22')](_0xd873('0x42'),_0x499c81[_0xd873('0x37')]);}};Acw['prototype'][_0xd873('0xd')]=function(_0x2309eb){try{if(this['channels'][_0x2309eb[_0xd873('0x1e')]]&&_[_0xd873('0x43')](this[_0xd873('0x9')][_0x2309eb['uniqueid']][_0xd873('0x2d')])){logger[_0xd873('0x20')](_0xd873('0x44'),_0x2309eb[_0xd873('0x1e')]);this[_0xd873('0x24')](_0x2309eb[_0xd873('0x1e')]);}else if(this['channels'][_0x2309eb['linkedid']]&&_[_0xd873('0x43')](this[_0xd873('0x9')][_0x2309eb['linkedid']]['attended'])){logger[_0xd873('0x20')](_0xd873('0x45'),_0x2309eb[_0xd873('0x46')]);this['startAcw'](_0x2309eb[_0xd873('0x46')]);}}catch(_0x4a2d5b){logger['error'](_0xd873('0x47'),_0x4a2d5b['message']);}};Acw[_0xd873('0x19')]['syncHangup']=function(_0x389e0e){try{if(this[_0xd873('0x9')][_0x389e0e['uniqueid']]&&this[_0xd873('0x9')][_0x389e0e[_0xd873('0x1e')]][_0xd873('0x2d')]){logger['info'](_0xd873('0x48'),_0x389e0e['uniqueid']);this[_0xd873('0x24')](_0x389e0e[_0xd873('0x1e')]);}else if(this[_0xd873('0x9')][_0x389e0e['linkedid']]&&this[_0xd873('0x9')][_0x389e0e[_0xd873('0x46')]]['attended']){logger[_0xd873('0x20')](_0xd873('0x49'),_0x389e0e[_0xd873('0x46')]);this[_0xd873('0x24')](_0x389e0e['linkedid']);}}catch(_0x56a50e){logger[_0xd873('0x22')](_0xd873('0x4a'),_0x56a50e[_0xd873('0x37')]);}};Acw[_0xd873('0x19')]['syncAttendedTransfer']=function(_0x4b2e1e){try{if(!_[_0xd873('0x4b')](this[_0xd873('0x9')][_0x4b2e1e[_0xd873('0x4c')]])){this['startAcw'](_0x4b2e1e['transfereeuniqueid']);if(this['channels'][_0x4b2e1e[_0xd873('0x4d')]]){this['channels'][_0x4b2e1e[_0xd873('0x4d')]][_0xd873('0x2d')]=!![];this[_0xd873('0x9')][_0x4b2e1e[_0xd873('0x4e')]]=this[_0xd873('0x9')][_0x4b2e1e[_0xd873('0x4d')]];delete this['channels'][_0x4b2e1e[_0xd873('0x4d')]];}}else if(!_[_0xd873('0x4b')](this['channels'][_0x4b2e1e[_0xd873('0x4e')]])){this['startAcw'](_0x4b2e1e['transfertargetuniqueid']);if(this[_0xd873('0x9')][_0x4b2e1e[_0xd873('0x4f')]]){this['channels'][_0x4b2e1e[_0xd873('0x4f')]][_0xd873('0x2d')]=!![];this[_0xd873('0x9')][_0x4b2e1e[_0xd873('0x4c')]]=this['channels'][_0x4b2e1e[_0xd873('0x4f')]];delete this['channels'][_0x4b2e1e[_0xd873('0x4f')]];}}}catch(_0x272de4){logger[_0xd873('0x22')](_0xd873('0x50'),_0x272de4['message']);}};Acw['prototype'][_0xd873('0x14')]=function(_0x47f907){try{if(this[_0xd873('0x9')][_0x47f907[_0xd873('0x51')]]){logger[_0xd873('0x20')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xd873('0x3e')](_0x47f907[_0xd873('0x51')]));this[_0xd873('0x24')](_0x47f907[_0xd873('0x51')]);}else if(this[_0xd873('0x9')][_0x47f907[_0xd873('0x52')]]){logger[_0xd873('0x20')](_0xd873('0x53'),JSON[_0xd873('0x3e')](_0x47f907[_0xd873('0x52')]));this['startAcw'](_0x47f907['transfererlinkedid']);}}catch(_0x5dd760){logger[_0xd873('0x22')](_0xd873('0x54'),_0x5dd760['message']);}};Acw[_0xd873('0x19')][_0xd873('0x55')]=function(_0x162bcf){try{if(this['voiceQueues'][_0x162bcf[_0xd873('0x25')]]&&this['voiceQueues'][_0x162bcf[_0xd873('0x25')]][_0xd873('0x56')]==='all'){if(this[_0xd873('0x7')][_0x162bcf[_0xd873('0x41')]]){logger[_0xd873('0x20')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x162bcf[_0xd873('0x1e')],_0x162bcf[_0xd873('0x41')],_0x162bcf[_0xd873('0x25')]);return RpcUser[_0xd873('0x2f')](this[_0xd873('0x7')][_0x162bcf[_0xd873('0x41')]],'Auto-Pause',_0x162bcf['uniqueid']);}}}catch(_0x4d70e4){logger[_0xd873('0x22')](_0xd873('0x57'),_0x4d70e4[_0xd873('0x37')]);}};module[_0xd873('0x58')]=Acw; \ No newline at end of file +var _0xd579=['transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','diff','prototype','lastPauseAt','timer','uniqueid','then','catch','[%s][UPDATE][ERRORS:%s]','finally','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','resolve','getAgent','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','error','[ACW][START]\x20%s','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','pauseType','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]'];(function(_0x17e108,_0x3eeaec){var _0x74dec9=function(_0x523555){while(--_0x523555){_0x17e108['push'](_0x17e108['shift']());}};_0x74dec9(++_0x3eeaec);}(_0xd579,0x160));var _0x9d57=function(_0x4582f1,_0x49e8b1){_0x4582f1=_0x4582f1-0x0;var _0xad881a=_0xd579[_0x4582f1];return _0xad881a;};'use strict';var _=require('lodash');var moment=require(_0x9d57('0x0'));var ami=require(_0x9d57('0x1'));var logger=require(_0x9d57('0x2'))(_0x9d57('0x3'));var RpcUser=require(_0x9d57('0x4'));var RpcVoiceAgentReport=require(_0x9d57('0x5'));function Acw(_0x26f47f){this['voiceQueues']=_0x26f47f[_0x9d57('0x6')];this[_0x9d57('0x7')]=_0x26f47f['agents'];this[_0x9d57('0x8')]=_0x26f47f[_0x9d57('0x8')];this[_0x9d57('0x9')]={};ami['on']('agentconnect',this[_0x9d57('0xa')][_0x9d57('0xb')](this));ami['on'](_0x9d57('0xc'),this[_0x9d57('0xd')]['bind'](this));ami['on'](_0x9d57('0xe'),this[_0x9d57('0xf')][_0x9d57('0xb')](this));ami['on'](_0x9d57('0x10'),this[_0x9d57('0x11')][_0x9d57('0xb')](this));ami['on'](_0x9d57('0x12'),this[_0x9d57('0x13')]['bind'](this));ami['on'](_0x9d57('0x14'),this[_0x9d57('0x15')]['bind'](this));ami['on'](_0x9d57('0x16'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x409497){var _0x19897e=moment()['milliseconds'](0x0);var _0x1922c6=moment(_0x409497)['milliseconds'](0x0);return _0x19897e[_0x9d57('0x17')](_0x1922c6,'seconds');}Acw[_0x9d57('0x18')]['updateAcw']=function(_0x490478,_0x5a8430){var _0x7d0d50=this;var _0x1c01d0=getDiff(_0x7d0d50[_0x9d57('0x8')][_0x490478][_0x9d57('0x19')]);clearTimeout(_0x7d0d50[_0x9d57('0x8')][_0x490478]['timer']);_0x7d0d50[_0x9d57('0x8')][_0x490478][_0x9d57('0x1a')]=![];return RpcVoiceAgentReport['update']({'acwtime':_0x1c01d0},_0x7d0d50[_0x9d57('0x8')][_0x490478][_0x9d57('0x1b')],_0x490478)[_0x9d57('0x1c')](function(_0x435526){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x5a8430,_0x1c01d0,_0x435526);})[_0x9d57('0x1d')](function(_0x281799){logger['error'](_0x9d57('0x1e'),_0x5a8430,_0x281799);})[_0x9d57('0x1f')](function(){delete _0x7d0d50[_0x9d57('0x8')][_0x490478];});};Acw['prototype'][_0x9d57('0x20')]=function(_0x5b7e0e){try{var _0x1d3f56=this;var _0x683ae1=this[_0x9d57('0x9')][_0x5b7e0e][_0x9d57('0x21')];var _0x27be50=this[_0x9d57('0x9')][_0x5b7e0e][_0x9d57('0x22')];var _0x1e50f7=this[_0x9d57('0x6')][_0x27be50];var _0x36f421=![];var _0x1a2769=_0x9d57('0x23');if(_0x1e50f7[_0x9d57('0x24')]&&_0x1e50f7[_0x9d57('0x25')][_0x9d57('0x26')]){_0x36f421=!![];_0x1a2769=_0x1e50f7[_0x9d57('0x25')][_0x9d57('0x26')];}if(!_0x1d3f56[_0x9d57('0x7')][_0x683ae1]){return Promise[_0x9d57('0x27')]();}return RpcUser[_0x9d57('0x28')](_0x1d3f56[_0x9d57('0x7')][_0x683ae1]['id'])[_0x9d57('0x1c')](function(_0x363060){if(!_0x363060||_0x363060['voicePause']){logger[_0x9d57('0x29')](_0x9d57('0x2a'),_0x5b7e0e,_0x683ae1,_0x27be50);return;}logger[_0x9d57('0x29')](_0x9d57('0x2b'),_0x5b7e0e,_0x683ae1,_0x27be50);var _0x5b9ae4=_0x1d3f56[_0x9d57('0x9')][_0x5b7e0e][_0x9d57('0x2c')]&&_0x1d3f56['channels'][_0x5b7e0e]['destlinkedid']?_0x1d3f56[_0x9d57('0x9')][_0x5b7e0e][_0x9d57('0x2d')]:_0x5b7e0e;return RpcUser[_0x9d57('0x2e')](_0x1d3f56[_0x9d57('0x7')][_0x683ae1],_0x1a2769,_0x5b9ae4)['then'](function(_0x279a58){_0x1d3f56['voiceQueues'][_0x27be50]['available']-=0x1;_0x1d3f56[_0x9d57('0x6')][_0x27be50][_0x9d57('0x2f')]+=0x1;return _0x279a58;});})['then'](function(_0x4f5ea4){if(_0x36f421||!_0x4f5ea4){return;}_0x1d3f56[_0x9d57('0x8')][_0x683ae1]={};logger[_0x9d57('0x29')](_0x9d57('0x30'),_0x5b7e0e,_0x1d3f56[_0x9d57('0x6')][_0x27be50][_0x9d57('0x31')],_0x683ae1,_0x27be50);_0x1d3f56[_0x9d57('0x8')][_0x683ae1][_0x9d57('0x1a')]=setTimeout(_0x1d3f56['stopAcw'][_0x9d57('0xb')](_0x1d3f56,_0x683ae1),_0x1d3f56[_0x9d57('0x6')][_0x27be50][_0x9d57('0x31')]*0x3e8);_0x1d3f56[_0x9d57('0x8')][_0x683ae1]['lastPauseAt']=moment()[_0x9d57('0x32')](_0x9d57('0x33'));_0x1d3f56[_0x9d57('0x8')][_0x683ae1][_0x9d57('0x1b')]=_0x5b7e0e;_0x1d3f56[_0x9d57('0x8')][_0x683ae1]['queue']=_0x27be50;_0x1d3f56['timers'][_0x683ae1][_0x9d57('0x34')]=_0x1d3f56[_0x9d57('0x34')][_0x9d57('0xb')](_0x1d3f56,_0x683ae1,_0x5b7e0e);})[_0x9d57('0x1d')](function(){logger[_0x9d57('0x35')](_0x9d57('0x30'),_0x5b7e0e,_0x1d3f56[_0x9d57('0x6')][_0x27be50][_0x9d57('0x31')],_0x683ae1,_0x27be50);})[_0x9d57('0x1f')](function(){delete _0x1d3f56['channels'][_0x5b7e0e];});}catch(_0x16e44f){logger[_0x9d57('0x35')](_0x9d57('0x36'),_0x16e44f[_0x9d57('0x37')]);}};Acw['prototype'][_0x9d57('0x38')]=function(_0x595044){try{var _0x1fb056=this;if(_0x1fb056[_0x9d57('0x8')][_0x595044]){_0x1fb056[_0x9d57('0x8')][_0x595044][_0x9d57('0x1a')]=![];var _0x200c92=_0x1fb056[_0x9d57('0x8')][_0x595044][_0x9d57('0x1b')];var _0x469272=_0x1fb056[_0x9d57('0x8')][_0x595044][_0x9d57('0x22')];var _0x3f86a1=_0x1fb056[_0x9d57('0x6')][_0x469272][_0x9d57('0x31')];logger[_0x9d57('0x29')](_0x9d57('0x39'),_0x200c92,_0x595044);RpcUser['getAgent'](this[_0x9d57('0x7')][_0x595044]['id'])[_0x9d57('0x1c')](function(_0x479d72){if(_0x479d72[_0x9d57('0x3a')]===_0x9d57('0x23')){return RpcUser[_0x9d57('0x3b')](_0x1fb056[_0x9d57('0x7')][_0x595044]);}});RpcVoiceAgentReport[_0x9d57('0x3c')]({'acwtime':_0x3f86a1,'agentacw':!![]},_0x200c92,_0x595044)[_0x9d57('0x1c')](function(_0x5c0404){logger[_0x9d57('0x29')](_0x9d57('0x3d'),_0x200c92,_0x3f86a1,_0x5c0404);})[_0x9d57('0x1d')](function(_0x334e93){logger[_0x9d57('0x35')](_0x9d57('0x1e'),_0x200c92,_0x334e93);});}else{logger[_0x9d57('0x35')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x595044);if(_0x1fb056[_0x9d57('0x8')]){logger['info']('[ACW][TIMERS]',JSON[_0x9d57('0x3e')](_0x1fb056[_0x9d57('0x8')]));}}}catch(_0x26cf8e){logger[_0x9d57('0x35')](_0x9d57('0x3f'),_0x26cf8e[_0x9d57('0x37')]);}};Acw[_0x9d57('0x18')][_0x9d57('0xa')]=function(_0x595605){try{if(this[_0x9d57('0x6')][_0x595605['queue']]&&(this[_0x9d57('0x6')][_0x595605[_0x9d57('0x22')]][_0x9d57('0x3')]||this[_0x9d57('0x6')][_0x595605['queue']]['mandatoryDisposition'])){if(this[_0x9d57('0x7')][_0x595605[_0x9d57('0x21')]]){this[_0x9d57('0x9')][_0x595605['uniqueid']]={'queue':_0x595605[_0x9d57('0x22')],'interface':_0x595605[_0x9d57('0x21')],'destlinkedid':_0x595605[_0x9d57('0x2d')]};}}}catch(_0x1ef3b0){logger[_0x9d57('0x35')]('[ACW][syncAgentConnect]\x20%s',_0x1ef3b0[_0x9d57('0x37')]);}};Acw[_0x9d57('0x18')]['syncAgentConnectPreview']=function(_0x240f3a){try{if(this[_0x9d57('0x6')][_0x240f3a[_0x9d57('0x22')]]&&(this[_0x9d57('0x6')][_0x240f3a[_0x9d57('0x22')]][_0x9d57('0x3')]||this['voiceQueues'][_0x240f3a['queue']]['mandatoryDisposition'])){if(this[_0x9d57('0x7')][_0x240f3a['interface']]){this[_0x9d57('0x9')][_0x240f3a['uniqueid']]={'queue':_0x240f3a[_0x9d57('0x22')],'interface':_0x240f3a[_0x9d57('0x21')]};}}}catch(_0xc956de){logger['error'](_0x9d57('0x40'),_0xc956de[_0x9d57('0x37')]);}};Acw[_0x9d57('0x18')][_0x9d57('0xd')]=function(_0x5ea26d){try{if(this[_0x9d57('0x9')][_0x5ea26d[_0x9d57('0x1b')]]&&_[_0x9d57('0x41')](this[_0x9d57('0x9')][_0x5ea26d[_0x9d57('0x1b')]][_0x9d57('0x2c')])){logger[_0x9d57('0x29')]('[%s][HANGUP:UNIQUEID]',_0x5ea26d[_0x9d57('0x1b')]);this[_0x9d57('0x20')](_0x5ea26d[_0x9d57('0x1b')]);}else if(this[_0x9d57('0x9')][_0x5ea26d['linkedid']]&&_[_0x9d57('0x41')](this[_0x9d57('0x9')][_0x5ea26d[_0x9d57('0x42')]][_0x9d57('0x2c')])){logger[_0x9d57('0x29')](_0x9d57('0x43'),_0x5ea26d['linkedid']);this['startAcw'](_0x5ea26d[_0x9d57('0x42')]);}}catch(_0x54a1f1){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x54a1f1[_0x9d57('0x37')]);}};Acw[_0x9d57('0x18')][_0x9d57('0xf')]=function(_0x129805){try{if(this['channels'][_0x129805['uniqueid']]&&this['channels'][_0x129805[_0x9d57('0x1b')]][_0x9d57('0x2c')]){logger[_0x9d57('0x29')](_0x9d57('0x44'),_0x129805[_0x9d57('0x1b')]);this['startAcw'](_0x129805[_0x9d57('0x1b')]);}else if(this[_0x9d57('0x9')][_0x129805[_0x9d57('0x42')]]&&this[_0x9d57('0x9')][_0x129805['linkedid']]['attended']){logger[_0x9d57('0x29')](_0x9d57('0x45'),_0x129805[_0x9d57('0x42')]);this[_0x9d57('0x20')](_0x129805[_0x9d57('0x42')]);}}catch(_0xb89d92){logger[_0x9d57('0x35')](_0x9d57('0x46'),_0xb89d92[_0x9d57('0x37')]);}};Acw[_0x9d57('0x18')][_0x9d57('0x13')]=function(_0x30cc2c){try{if(!_['isNil'](this['channels'][_0x30cc2c[_0x9d57('0x47')]])){this[_0x9d57('0x20')](_0x30cc2c[_0x9d57('0x47')]);if(this[_0x9d57('0x9')][_0x30cc2c[_0x9d57('0x48')]]){this[_0x9d57('0x9')][_0x30cc2c[_0x9d57('0x48')]][_0x9d57('0x2c')]=!![];this['channels'][_0x30cc2c[_0x9d57('0x49')]]=this[_0x9d57('0x9')][_0x30cc2c['secondtransfereruniqueid']];delete this[_0x9d57('0x9')][_0x30cc2c['secondtransfereruniqueid']];}}else if(!_[_0x9d57('0x4a')](this[_0x9d57('0x9')][_0x30cc2c[_0x9d57('0x49')]])){this[_0x9d57('0x20')](_0x30cc2c[_0x9d57('0x49')]);if(this[_0x9d57('0x9')][_0x30cc2c[_0x9d57('0x4b')]]){this[_0x9d57('0x9')][_0x30cc2c[_0x9d57('0x4b')]][_0x9d57('0x2c')]=!![];this[_0x9d57('0x9')][_0x30cc2c[_0x9d57('0x47')]]=this[_0x9d57('0x9')][_0x30cc2c['origtransfereruniqueid']];delete this['channels'][_0x30cc2c[_0x9d57('0x4b')]];}}}catch(_0x616ea2){logger[_0x9d57('0x35')]('[ACW][syncAttendedTransfer]\x20%s',_0x616ea2[_0x9d57('0x37')]);}};Acw['prototype']['syncBlindTransfer']=function(_0x5f529b){try{if(this[_0x9d57('0x9')][_0x5f529b[_0x9d57('0x4c')]]){logger[_0x9d57('0x29')](_0x9d57('0x4d'),JSON[_0x9d57('0x3e')](_0x5f529b[_0x9d57('0x4c')]));this[_0x9d57('0x20')](_0x5f529b[_0x9d57('0x4c')]);}else if(this[_0x9d57('0x9')][_0x5f529b[_0x9d57('0x4e')]]){logger[_0x9d57('0x29')](_0x9d57('0x4f'),JSON['stringify'](_0x5f529b[_0x9d57('0x4e')]));this['startAcw'](_0x5f529b['transfererlinkedid']);}}catch(_0xb10f31){logger[_0x9d57('0x35')](_0x9d57('0x50'),_0xb10f31[_0x9d57('0x37')]);}};Acw[_0x9d57('0x18')][_0x9d57('0x11')]=function(_0x1a60d7){try{if(this[_0x9d57('0x6')][_0x1a60d7[_0x9d57('0x22')]]&&this[_0x9d57('0x6')][_0x1a60d7['queue']][_0x9d57('0x51')]===_0x9d57('0x52')){if(this['agents'][_0x1a60d7[_0x9d57('0x21')]]){logger[_0x9d57('0x29')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x1a60d7[_0x9d57('0x1b')],_0x1a60d7[_0x9d57('0x21')],_0x1a60d7[_0x9d57('0x22')]);return RpcUser['savePause'](this['agents'][_0x1a60d7[_0x9d57('0x21')]],_0x9d57('0x53'),_0x1a60d7[_0x9d57('0x1b')]);}}}catch(_0x43fa88){logger[_0x9d57('0x35')](_0x9d57('0x54'),_0x43fa88[_0x9d57('0x37')]);}};module[_0x9d57('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 48e4fca..92cea0e 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 _0x8641=['actionDeviceStateList','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','ami','asterisk','port','password','Action','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','actionSipShowRegistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then'];(function(_0x559cf8,_0x4c9792){var _0x22ad1b=function(_0x3ccf12){while(--_0x3ccf12){_0x559cf8['push'](_0x559cf8['shift']());}};_0x22ad1b(++_0x4c9792);}(_0x8641,0x12c));var _0x1864=function(_0x5c9939,_0x5f1deb){_0x5c9939=_0x5c9939-0x0;var _0x6ce458=_0x8641[_0x5c9939];return _0x6ce458;};'use strict';var Manager=require(_0x1864('0x0'));var BPromise=require(_0x1864('0x1'));var util=require('util');var logger=require(_0x1864('0x2'))(_0x1864('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0x1864('0x4')][_0x1864('0x5')],config[_0x1864('0x4')]['ip'],config[_0x1864('0x4')]['username'],config[_0x1864('0x4')][_0x1864('0x6')],!![]);ami['keepConnected']();ami[_0x1864('0x7')]=BPromise['promisify'](ami[_0x1864('0x8')]);function error(_0x1d203e){logger[_0x1864('0x9')](util['format'](_0x1864('0xa'),config[_0x1864('0x4')]['username'],config[_0x1864('0x4')]['ip'],config[_0x1864('0x4')]['port'],util['inspect'](_0x1d203e,![],null)));}function close(){logger[_0x1864('0x9')](util[_0x1864('0xb')](_0x1864('0xc'),config[_0x1864('0x4')][_0x1864('0xd')],config[_0x1864('0x4')]['ip'],config[_0x1864('0x4')][_0x1864('0x5')]));}ami[_0x1864('0xe')]=function(){return function(){return ami[_0x1864('0x7')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x1864('0x7')]({'action':_0x1864('0xf')});};};ami[_0x1864('0x10')]=function(){return function(){return ami[_0x1864('0x7')]({'action':_0x1864('0x11')});};};ami[_0x1864('0x12')]=function(){return function(){return ami[_0x1864('0x7')]({'action':_0x1864('0x13')});};};ami[_0x1864('0x14')]=function(){return function(){return ami[_0x1864('0x7')]({'action':_0x1864('0x15')});};};function connect(){logger[_0x1864('0x16')](util[_0x1864('0xb')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x1864('0x4')][_0x1864('0xd')],config[_0x1864('0x4')]['ip'],config[_0x1864('0x4')][_0x1864('0x5')]));ami[_0x1864('0x17')](_0x1864('0x9'),error);ami[_0x1864('0x17')](_0x1864('0x18'),close);}ami['on'](_0x1864('0x19'),connect);ami['on'](_0x1864('0x1a'),function(_0x1ae269){logger[_0x1864('0x16')](util[_0x1864('0xb')](_0x1864('0x1b'),config[_0x1864('0x4')][_0x1864('0xd')],config[_0x1864('0x4')]['ip'],config[_0x1864('0x4')][_0x1864('0x5')],util[_0x1864('0x1c')](_0x1ae269,![],null)));});ami['on'](_0x1864('0x1d'),function(){logger[_0x1864('0x16')](util[_0x1864('0xb')](_0x1864('0x1e'),config['asterisk'][_0x1864('0xd')],config[_0x1864('0x4')]['ip'],config[_0x1864('0x4')][_0x1864('0x5')]));return Promise[_0x1864('0x1f')]()['then'](ami[_0x1864('0xe')]())[_0x1864('0x20')](ami[_0x1864('0x21')]())[_0x1864('0x20')](ami[_0x1864('0x10')]())['then'](ami['actionQueueSummary']())[_0x1864('0x20')](ami[_0x1864('0x14')]())[_0x1864('0x22')](function(_0x11f54a){logger['error'](_0x1864('0x23'),util['inspect'](_0x11f54a,{'showHidden':![],'depth':null}));});});ami['once'](_0x1864('0x9'),error);ami[_0x1864('0x17')]('close',close);module[_0x1864('0x24')]=ami; \ No newline at end of file +var _0x35da=['format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','catch','exports','asterisk-manager','bluebird','util','../../config/environment','asterisk','port','password','keepConnected','promisify','action','error'];(function(_0x52ebba,_0x57b37c){var _0x198068=function(_0x285d96){while(--_0x285d96){_0x52ebba['push'](_0x52ebba['shift']());}};_0x198068(++_0x57b37c);}(_0x35da,0x181));var _0xa35d=function(_0x38ed26,_0x251529){_0x38ed26=_0x38ed26-0x0;var _0x5cc237=_0x35da[_0x38ed26];return _0x5cc237;};'use strict';var Manager=require(_0xa35d('0x0'));var BPromise=require(_0xa35d('0x1'));var util=require(_0xa35d('0x2'));var logger=require('../../config/logger')('ami');var config=require(_0xa35d('0x3'));var ami=new Manager(config[_0xa35d('0x4')][_0xa35d('0x5')],config[_0xa35d('0x4')]['ip'],config['asterisk']['username'],config[_0xa35d('0x4')][_0xa35d('0x6')],!![]);ami[_0xa35d('0x7')]();ami['Action']=BPromise[_0xa35d('0x8')](ami[_0xa35d('0x9')]);function error(_0x2a9092){logger[_0xa35d('0xa')](util[_0xa35d('0xb')](_0xa35d('0xc'),config[_0xa35d('0x4')][_0xa35d('0xd')],config['asterisk']['ip'],config['asterisk']['port'],util[_0xa35d('0xe')](_0x2a9092,![],null)));}function close(){logger[_0xa35d('0xa')](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xa35d('0x4')][_0xa35d('0xd')],config['asterisk']['ip'],config[_0xa35d('0x4')]['port']));}ami[_0xa35d('0xf')]=function(){return function(){return ami[_0xa35d('0x10')]({'action':_0xa35d('0x11')});};};ami[_0xa35d('0x12')]=function(){return function(){return ami['Action']({'action':_0xa35d('0x13')});};};ami[_0xa35d('0x14')]=function(){return function(){return ami[_0xa35d('0x10')]({'action':_0xa35d('0x15')});};};ami[_0xa35d('0x16')]=function(){return function(){return ami[_0xa35d('0x10')]({'action':_0xa35d('0x17')});};};ami[_0xa35d('0x18')]=function(){return function(){return ami[_0xa35d('0x10')]({'action':_0xa35d('0x19')});};};function connect(){logger['info'](util[_0xa35d('0xb')](_0xa35d('0x1a'),config[_0xa35d('0x4')]['username'],config[_0xa35d('0x4')]['ip'],config['asterisk']['port']));ami[_0xa35d('0x1b')]('error',error);ami[_0xa35d('0x1b')](_0xa35d('0x1c'),close);}ami['on']('connect',connect);ami['on'](_0xa35d('0x1d'),function(_0x566922){logger['info'](util[_0xa35d('0xb')](_0xa35d('0x1e'),config[_0xa35d('0x4')][_0xa35d('0xd')],config[_0xa35d('0x4')]['ip'],config['asterisk'][_0xa35d('0x5')],util[_0xa35d('0xe')](_0x566922,![],null)));});ami['on'](_0xa35d('0x1f'),function(){logger['info'](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xa35d('0x4')][_0xa35d('0xd')],config[_0xa35d('0x4')]['ip'],config[_0xa35d('0x4')][_0xa35d('0x5')]));return Promise[_0xa35d('0x20')]()[_0xa35d('0x21')](ami[_0xa35d('0xf')]())['then'](ami[_0xa35d('0x12')]())[_0xa35d('0x21')](ami[_0xa35d('0x14')]())[_0xa35d('0x21')](ami[_0xa35d('0x16')]())[_0xa35d('0x21')](ami[_0xa35d('0x18')]())[_0xa35d('0x22')](function(_0x5d07da){logger['error']('[ami.js][fullybooted]',util[_0xa35d('0xe')](_0x5d07da,{'showHidden':![],'depth':null}));});});ami[_0xa35d('0x1b')](_0xa35d('0xa'),error);ami[_0xa35d('0x1b')](_0xa35d('0x1c'),close);module[_0xa35d('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 1866a29..3c5fcb8 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 _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x4e99e0,_0xd87512){var _0x2378d5=function(_0x3abd12){while(--_0x3abd12){_0x4e99e0['push'](_0x4e99e0['shift']());}};_0x2378d5(++_0xd87512);}(_0xb43b,0x1b2));var _0xbb43=function(_0x58e63d,_0x9b19e9){_0x58e63d=_0x58e63d-0x0;var _0x29abba=_0xb43b[_0x58e63d];return _0x29abba;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0xf4eb=['rpc','error','message','result','exports','jayson/promise','http','request','then','debug','memberReport'];(function(_0x18f3bf,_0x2f81f0){var _0x88488a=function(_0x501968){while(--_0x501968){_0x18f3bf['push'](_0x18f3bf['shift']());}};_0x88488a(++_0x2f81f0);}(_0xf4eb,0xec));var _0xbf4e=function(_0x473862,_0x2125be){_0x473862=_0x473862-0x0;var _0x50d976=_0xf4eb[_0x473862];return _0x50d976;};'use strict';var jayson=require(_0xbf4e('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('ami');var client=jayson['client'][_0xbf4e('0x1')]({'port':0x2329});client['Request']=function(_0x4e7fa7,_0x2e3070){return new BPromise(function(_0x1c7606,_0x32d1d7){return client[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070)[_0xbf4e('0x3')](function(_0x2fcfed){logger[_0xbf4e('0x4')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x2e3070,_0x2fcfed);if(_0x2fcfed['error']){logger['error'](_0xbf4e('0x6'),_0xbf4e('0x5'),_0x4e7fa7,_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')],_0x2e3070);return _0x32d1d7(_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')]);}else{return _0x1c7606(_0x2fcfed[_0xbf4e('0x9')]);}})['catch'](function(_0x4d9a07){logger[_0xbf4e('0x7')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x4d9a07,_0x2e3070);return _0x32d1d7(_0x4d9a07);});});};module[_0xbf4e('0xa')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 504778c..0546f0d 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 _0xc00d=['ifTime','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','length','push','command','iftime\x20%s,%s','interval','then','content','indexOf','true','catch','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','resetActiveCalls','syncCampaigns','undefined','isIVRCampaignActive','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncCampaigns]','dialMethod','progressive','handlePower','Queue','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','\x20Interval\x20is\x20overtime:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','queue','uniqueid','type','ivr','updateOriginated','answertime','outboundAnswerCallsDay','agent','agiafterat','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','droptime','YYYY-MM-DD\x20HH:mm:ss','getSeconds','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','voiceQueue','dialDropMaxRetry','rescheduleContact','add','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','dropreason','CALLEREXIT','countabandonedretry','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','queueCallerAbandonCreateState','additional','dialAbandonedRetryFrequency','minutes','ContactId','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','stateinterface','paused','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD]','MACHINE','Machine','emit','countbusyretry','countcongestionretry','countnoanswerretry','countmachineretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countnosuchnumberretry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','outboundUnknownCallsDay','cause-txt','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','resolve','inUse','ACTIVE','checkDialMethod','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','online','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','loopClearZombieChannels','[uniqueid]','clearZombieChannels','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','launchHandleIvr','handleIvr','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','getCaller','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','isOutboundQueue','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','TrunkBackup','callerid','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','Action','originate','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','OriginateError','endtime','[originate][error]','originate\x20action\x20Error','checkRetriveMax','countagentrejectretry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','Abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalAvailable','available','talking','floor','erlangCalls','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','avgHandleTime','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalHitRate','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','[CatchErlangB]','predictiveIntervalPauses','erlangCallToSecond','milliseconds','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','limitCalls','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','checkContactEmpty','countReScheduled','[countReScheduled]\x20','RUNNING','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\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','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','lodash','moment','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','defaults','redis','socket.io-emitter','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/history','./models/final','./models/queueCallerAbandon','./models/hangup','XCALLY_IP_AGI','127.0.0.1','prototype','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queuesSummary','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','getSettings','previewRecallmeReminderInterval','isUndefined','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','voice:queue:%s','name','voice_queue:save','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','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','---------------------------','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','startProgressive','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','inspect','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','INACTIVE','\x20NOT\x20Active','isIVRCampaign','format','campaign:save','originated','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','reachable','status','unmonitored','checkIsTrunkReachable','Trunk','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','Failure','\x20Intervals\x20is\x20null\x20','isEmpty'];(function(_0x10ea3d,_0xb774ad){var _0x4503e4=function(_0x19040a){while(--_0x19040a){_0x10ea3d['push'](_0x10ea3d['shift']());}};_0x4503e4(++_0xb774ad);}(_0xc00d,0x190));var _0xdc00=function(_0x106768,_0x58f689){_0x106768=_0x106768-0x0;var _0x4829d8=_0xc00d[_0x106768];return _0x4829d8;};'use strict';var util=require(_0xdc00('0x0'));var _=require(_0xdc00('0x1'));var uuid=require('uuid');var moment=require(_0xdc00('0x2'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0xdc00('0x3'));var hopperUtils=require(_0xdc00('0x4'));var ut=require(_0xdc00('0x5'));var config=require(_0xdc00('0x6'));var logger=require(_0xdc00('0x7'))(_0xdc00('0x8'));var loggerBooked=require(_0xdc00('0x7'))(_0xdc00('0x9'));var loggerPredictive=require(_0xdc00('0x7'))(_0xdc00('0xa'));var loggerPredictiveCalls=require(_0xdc00('0x7'))(_0xdc00('0xb'));var loggerSyncQueueSummary=require(_0xdc00('0x7'))('syncQueueSummary');var ami=require(_0xdc00('0xc'));config['redis']=_[_0xdc00('0xd')](config[_0xdc00('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0xdc00('0xf'))(new Redis(config[_0xdc00('0xe')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0xdc00('0x10'));var RpcSetting=require(_0xdc00('0x11'));var Interval=require(_0xdc00('0x12'));var Action=require('./models/action');var History=require(_0xdc00('0x13'));var Final=require(_0xdc00('0x14'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0xdc00('0x15'));var Hangup=require(_0xdc00('0x16'));var ipAgi=process['env'][_0xdc00('0x17')]||_0xdc00('0x18');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xdc00('0x19')]['enqueue']=function(_0x1fb208){this[_0xdc00('0x1a')]=this['tail']?this[_0xdc00('0x1a')]['finally'](_0x1fb208):_0x1fb208();};function Dialer(_0x41b4f6,_0x4c7b02){this[_0xdc00('0x1b')]=new Sequence();this[_0xdc00('0x1c')]=_0x4c7b02;this[_0xdc00('0x1d')]=_0x41b4f6['voiceQueues'];this[_0xdc00('0x1e')]=_0x41b4f6['campaigns'];this[_0xdc00('0x1f')]=_0x41b4f6[_0xdc00('0x1f')];this['trunks']=_0x41b4f6[_0xdc00('0x20')];this[_0xdc00('0x21')]=config[_0xdc00('0x21')]||0x2;this[_0xdc00('0x22')]={};this[_0xdc00('0x23')]={};this[_0xdc00('0x24')]={};this[_0xdc00('0x25')]={};this[_0xdc00('0x26')]={};this[_0xdc00('0x27')]={};this['startProgressive']={};this[_0xdc00('0x28')]={};this[_0xdc00('0x29')]={};this['queueBookedRR']={};this[_0xdc00('0x2a')]={};ami['on']('agentconnect',this[_0xdc00('0x2b')][_0xdc00('0x2c')](this));ami['on'](_0xdc00('0x2d'),this[_0xdc00('0x2e')][_0xdc00('0x2c')](this));ami['on'](_0xdc00('0x2f'),this[_0xdc00('0x30')]['bind'](this));ami['on'](_0xdc00('0x31'),this[_0xdc00('0x32')][_0xdc00('0x2c')](this));ami['on'](_0xdc00('0x33'),this[_0xdc00('0x34')]['bind'](this));ami['on'](_0xdc00('0x35'),this[_0xdc00('0x36')][_0xdc00('0x2c')](this));ami['on'](_0xdc00('0x37'),this[_0xdc00('0x38')][_0xdc00('0x2c')](this));ami['on']('newexten',this[_0xdc00('0x39')]['bind'](this));ami['on'](_0xdc00('0x3a'),this[_0xdc00('0x3b')]['bind'](this));ami['on']('queuemember',this[_0xdc00('0x3c')][_0xdc00('0x2c')](this));ami['on'](_0xdc00('0x3d'),this[_0xdc00('0x3e')][_0xdc00('0x2c')](this));this[_0xdc00('0x3f')]();this['loopClearZombieChannels']();RpcSetting[_0xdc00('0x40')]()['then'](function(_0x460250){previewRecallmeReminderInterval=_0x460250[_0xdc00('0x41')];});}function isNotNull(_0x2f8f98){return _0x2f8f98!==null&&!_[_0xdc00('0x42')](_0x2f8f98);}function msgResponse(_0x409ffe,_0x1bda4d,_0x46b0c7){return{'action':_0x409ffe,'response':_0x1bda4d,'message':_0x46b0c7,'stack':_0x46b0c7};}function emit(_0x53b89c,_0x4620e0,_0x1340e4){io['to'](_0x53b89c)['emit'](_0x4620e0,_0x1340e4);}function emitOutboundVoiceQueueSummary(_0x2b74aa){if(_0x2b74aa['type']===_0xdc00('0x43')){logger[_0xdc00('0x44')](_0xdc00('0x45'),util['inspect'](_0x2b74aa,{'showHidden':![],'depth':null}));emit(util['format'](_0xdc00('0x46'),_0x2b74aa[_0xdc00('0x47')]),_0xdc00('0x48'),_0x2b74aa);}}function checkGetDataPredictive(_0x35d7aa){if(isNotNull(_0x35d7aa)&&!_['isEmpty'](_0x35d7aa)){loggerPredictive[_0xdc00('0x49')](_0xdc00('0x4a'));loggerPredictive[_0xdc00('0x49')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x35d7aa[_0xdc00('0x4b')]);loggerPredictive[_0xdc00('0x49')](_0xdc00('0x4c'),_0x35d7aa[_0xdc00('0x4d')]);loggerPredictive[_0xdc00('0x49')](_0xdc00('0x4e'),_0x35d7aa[_0xdc00('0x4f')]);loggerPredictive[_0xdc00('0x49')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x35d7aa[_0xdc00('0x50')]);loggerPredictive['info'](_0xdc00('0x51'),_0x35d7aa['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0xdc00('0x52'),_0x35d7aa[_0xdc00('0x53')]);loggerPredictive['info'](_0xdc00('0x54'));if(_0x35d7aa[_0xdc00('0x4b')]>0x0){if(!_[_0xdc00('0x42')](_0x35d7aa[_0xdc00('0x53')])&&_0x35d7aa[_0xdc00('0x53')]>0x0){return!![];}loggerPredictive[_0xdc00('0x49')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x35d7aa[_0xdc00('0x55')])&&_0x35d7aa[_0xdc00('0x55')]>0x0){return!![];}loggerPredictive[_0xdc00('0x49')](_0xdc00('0x56'));}else{loggerPredictive[_0xdc00('0x49')](_0xdc00('0x57'));}}else{loggerPredictive['info'](_0xdc00('0x58'));}return![];}function mergeDataErlangB(_0x37add4){return function(_0x26f095){loggerPredictive['info'](_0xdc00('0x59'));loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x26f095['erlangCalls']);loggerPredictive[_0xdc00('0x49')](_0xdc00('0x5a'),_0x26f095['erlangCallToSecond']);loggerPredictive[_0xdc00('0x49')](_0xdc00('0x5b'),_0x26f095[_0xdc00('0x5c')]);loggerPredictive[_0xdc00('0x49')](_0xdc00('0x5d'),_0x26f095[_0xdc00('0x5e')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x26f095[_0xdc00('0x5c')]);loggerPredictive[_0xdc00('0x49')](_0xdc00('0x54'));_[_0xdc00('0x5f')](_0x37add4,_0x26f095);};}function ifInterval(_0x193e55,_0x4ebe71){if(_[_0xdc00('0x42')](_0x4ebe71)){return![];}return utils['getSeconds'](undefined,_0x4ebe71)<_0x193e55*0x3c;}function clearPredictiveAttributes(_0xe923af){if(_0xe923af[_0xdc00('0x60')]){_0xe923af['startProgressive']=undefined;loggerPredictive[_0xdc00('0x44')](_0xe923af[_0xdc00('0x47')],'startProgressive\x20value\x20cleared');}if(_0xe923af[_0xdc00('0x27')]){_0xe923af[_0xdc00('0x27')]=undefined;loggerPredictive[_0xdc00('0x44')](_0xe923af[_0xdc00('0x47')],_0xdc00('0x61'));}if(_0xe923af[_0xdc00('0x62')]){clearInterval(_0xe923af[_0xdc00('0x62')]);_0xe923af[_0xdc00('0x62')]=undefined;loggerPredictive[_0xdc00('0x44')](_0xe923af['name'],_0xdc00('0x63'));}}function loggerCatchPredictive(_0x7c86f,_0x2a4529){return function(_0x274c48){loggerPredictive[_0xdc00('0x64')](_0x2a4529[_0xdc00('0x47')],_0x7c86f);loggerPredictive['error'](_0x274c48['stack']);clearPredictiveAttributes(_0x2a4529);};}function loggerCatch(_0x1741db){return function(_0x4ca51c){logger['error'](_0x1741db,util[_0xdc00('0x65')](_0x4ca51c,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0xccb8d0,_0x8c7d9e,_0x1efe05){return function(_0x3cda5b){utils[_0xdc00('0x66')](_0x8c7d9e,_0x1efe05,0x0);_0x8c7d9e[_0xdc00('0x67')]=0x0;logger['error'](_0xccb8d0,util[_0xdc00('0x65')](_0x3cda5b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x215169){return function(_0x4527c4){if(isNotNull(_0x4527c4)&&isNotNull(_0x4527c4[0x0])){if(_0x4527c4[0x0][_0xdc00('0x68')]>0x0){_0x215169[_0xdc00('0x69')]=utils[_0xdc00('0x6a')][_0xdc00('0x6b')];logger[_0xdc00('0x49')](_0xdc00('0x6c')+_0x215169['name'],_0x4527c4[0x0][_0xdc00('0x68')],_0xdc00('0x6d'));}else{_0x215169['message']=utils[_0xdc00('0x6a')][_0xdc00('0x6e')];logger[_0xdc00('0x49')](_0xdc00('0x6f')+_0x215169[_0xdc00('0x47')]);}}};}function createObjHistory(_0x3cf212,_0x34648b,_0x145d4c,_0x56e510,_0x1e1648){_0x3cf212[_0xdc00('0x69')]=_0x145d4c;var _0x21e274=new Action(_0x3cf212,_0x34648b);var _0x38681f=new History(_0x21e274);_0x38681f[_0xdc00('0x70')]=_0x56e510;_0x38681f[_0xdc00('0x71')]=_0x1e1648;_0x38681f['endtime']=_0x21e274['starttime'];return _0x38681f;}function unlockQueueStatus(_0x49c324,_0x19046a){setTimeout(function(){if(_[_0xdc00('0x42')](_0x49c324['queueStatusComplete'])){loggerBooked[_0xdc00('0x64')]('[unlockQueueStatus][undefined]',_0x19046a);}_0x49c324[_0xdc00('0x72')]=!![];loggerBooked['info'](_0xdc00('0x73'),_0x19046a,JSON[_0xdc00('0x74')](_[_0xdc00('0x75')](_0x49c324,['name','queueStatusComplete'])));},0x1f3);}function checkInterval(_0x3f3b70){return function(){if(!isNotNull(_0x3f3b70[_0xdc00('0x76')])){_0x3f3b70[_0xdc00('0x69')]=utils[_0xdc00('0x6a')][_0xdc00('0x77')];throw _0x3f3b70[_0xdc00('0x47')]+_0xdc00('0x78');}if(!isNotNull(_0x3f3b70['Interval'][_0xdc00('0x79')])){_0x3f3b70['message']=utils['CAMPAIGN_STATUS'][_0xdc00('0x77')];throw _0x3f3b70[_0xdc00('0x47')]+_0xdc00('0x78');}if(!isNotNull(_['isEmpty'](_0x3f3b70[_0xdc00('0x76')][_0xdc00('0x79')]))){_0x3f3b70[_0xdc00('0x69')]=utils[_0xdc00('0x6a')][_0xdc00('0x77')];throw _0x3f3b70[_0xdc00('0x47')]+_0xdc00('0x78');}};}function checkIsIVRCampaignActive(_0x1717e3){return function(){if(!utils['isIVRCampaignActive'](_0x1717e3)){_0x1717e3['message']=utils['CAMPAIGN_STATUS'][_0xdc00('0x7a')];throw _0x1717e3[_0xdc00('0x47')]+_0xdc00('0x7b');}};}function emitCampaignSummary(_0x3cad45){if(utils[_0xdc00('0x7c')](_0x3cad45)){emit(util[_0xdc00('0x7d')]('campaign:ivr:%s',_0x3cad45['name']),_0xdc00('0x7e'),_0x3cad45);}}function loggerCatchQueueSummary(_0xd14a54,_0x211f94){return function(_0xcfb797){clearPredictiveAttributes(_0x211f94);emitCampaignSummary(_0x211f94);loggerSyncQueueSummary[_0xdc00('0x44')](_0xd14a54,util[_0xdc00('0x65')](_0xcfb797,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x31e3bb){if(_0x31e3bb['sendMessageOneNotActive']){if(_0x31e3bb[_0xdc00('0x7f')]===0x0){_0x31e3bb[_0xdc00('0x80')]=![];_0x31e3bb[_0xdc00('0x69')]=utils[_0xdc00('0x6a')][_0xdc00('0x7a')];loggerSyncQueueSummary[_0xdc00('0x44')](_0xdc00('0x81'),_0x31e3bb[_0xdc00('0x47')],'is\x20not\x20active');}else{_0x31e3bb[_0xdc00('0x69')]=utils[_0xdc00('0x6a')][_0xdc00('0x82')];loggerSyncQueueSummary['debug'](_0xdc00('0x81'),_0x31e3bb[_0xdc00('0x47')],_0xdc00('0x83'));}emitCampaignSummary(_0x31e3bb);}}function myreject(_0x1df56c){return function(_0x3b8ef9){return _0x1df56c(msgResponse(_0xdc00('0x84'),_0xdc00('0x85'),JSON['stringify'](_0x3b8ef9)));};}Dialer[_0xdc00('0x19')][_0xdc00('0x86')]=function(_0x1df52c){return!_['isUndefined'](_0x1df52c)&&_0x1df52c&&!_[_0xdc00('0x42')](_0x1df52c['name'])&&!_[_0xdc00('0x42')](_0x1df52c[_0xdc00('0x87')])&&_0x1df52c[_0xdc00('0x87')]&&(this[_0xdc00('0x20')][util['format'](_0xdc00('0x88'),_0x1df52c[_0xdc00('0x47')])]['status']===_0xdc00('0x89')||this['trunks'][util[_0xdc00('0x7d')](_0xdc00('0x88'),_0x1df52c[_0xdc00('0x47')])][_0xdc00('0x8a')]===_0xdc00('0x8b'));};Dialer[_0xdc00('0x19')][_0xdc00('0x8c')]=function(_0x127430){var _0x4e63a1=this;return function(){if(!_0x4e63a1[_0xdc00('0x86')](_0x127430[_0xdc00('0x8d')])){if(!_0x4e63a1[_0xdc00('0x86')](_0x127430['TrunkBackup'])){_0x127430[_0xdc00('0x69')]=utils[_0xdc00('0x6a')][_0xdc00('0x8e')];throw _0x127430[_0xdc00('0x47')]+_0xdc00('0x8f');}}};};Dialer[_0xdc00('0x19')]['checkIfTime']=function(_0x3ac06f,_0x1d0546,_0x4e9f8f,_0x51d203){var _0x82215f=this;return function(){var _0x4f602d=!![];return _0x82215f['ifTimeIvr'](_0x3ac06f,_0x1d0546,_0x4e9f8f,_0x51d203,_0x4f602d);};};Dialer[_0xdc00('0x19')]['checkIfTimeIntervals']=function(_0x4ed859,_0x5c10dc,_0x4fe852,_0xf0943){var _0x44fc7f=this;return function(){var _0x31f551=![];return _0x44fc7f['ifTimeIvr'](_0x4ed859['Intervals'],_0x5c10dc,_0x4fe852,_0xf0943,_0x31f551);};};Dialer['prototype'][_0xdc00('0x90')]=function(_0x223046,_0x2907c7,_0xd8a521,_0x13a322,_0x429fd8){var _0x512d66=[];return new Promise(function(_0x4bfa1c,_0x11cb04){if(!isNotNull(_0x223046)){_0x13a322[_0xdc00('0x69')]=utils[_0xdc00('0x6a')][_0xdc00('0x77')];return _0x11cb04(msgResponse('ifTime',_0xdc00('0x91'),_0xd8a521+_0xdc00('0x92')));}if(_[_0xdc00('0x93')](_0x223046)){_0x13a322[_0xdc00('0x69')]=utils['CAMPAIGN_STATUS']['EMPTY_INTERVAL'];return _0x11cb04(msgResponse(_0xdc00('0x94'),_0xdc00('0x91'),_0xd8a521+_0xdc00('0x95')));}if(_0x2907c7&&_[_0xdc00('0x42')](config[_0xdc00('0x96')][_0x2907c7])){_0x13a322['message']=utils['CAMPAIGN_STATUS'][_0xdc00('0x97')];return _0x11cb04(msgResponse(_0xdc00('0x94'),'Failure',_0xd8a521+_0xdc00('0x98')+_0x2907c7));}if(_['isArray'](_0x223046)){for(var _0x53f93b=0x0;_0x53f93b<_0x223046[_0xdc00('0x99')];_0x53f93b+=0x1){_0x512d66[_0xdc00('0x9a')](ami['Action']({'action':_0xdc00('0x9b'),'command':util[_0xdc00('0x7d')](_0xdc00('0x9c'),_0x223046[_0x53f93b][_0xdc00('0x9d')],!_[_0xdc00('0x42')](config[_0xdc00('0x96')][_0x2907c7])?_0x2907c7:'')})[_0xdc00('0x9e')](function(_0x3301b5){return _0x3301b5[_0xdc00('0x9f')][_0xdc00('0xa0')]('true')>=0x0;})['catch'](myreject(_0x11cb04)));}}else{_0x512d66[_0xdc00('0x9a')](ami['Action']({'action':_0xdc00('0x9b'),'command':util[_0xdc00('0x7d')](_0xdc00('0x9c'),_0x223046,!_['isUndefined'](config['timezones'][_0x2907c7])?_0x2907c7:'')})[_0xdc00('0x9e')](function(_0x222c56){return _0x222c56[_0xdc00('0x9f')][_0xdc00('0xa0')](_0xdc00('0xa1'))>=0x0;})[_0xdc00('0xa2')](myreject(_0x11cb04)));}Promise[_0xdc00('0xa3')](_0x512d66)[_0xdc00('0x9e')](function(_0x472ab2){var _0x55ebdc=_[_0xdc00('0xa4')](_0x472ab2);if(_0x55ebdc){return _0x4bfa1c(_0x55ebdc);}else{_0x13a322[_0xdc00('0x69')]=_0x429fd8?utils[_0xdc00('0x6a')][_0xdc00('0xa5')]:utils['CAMPAIGN_STATUS'][_0xdc00('0xa6')];return _0x11cb04(msgResponse(_0xdc00('0xa7'),'Failure',_0xdc00('0xa8')+_0x429fd8+'\x20'+_0xd8a521+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x223046,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x2907c7));}})[_0xdc00('0xa2')](function(_0x2cf1f9){return _0x11cb04(msgResponse(_0xdc00('0x94'),_0xdc00('0x91'),JSON[_0xdc00('0x74')](_0x2cf1f9)));});});};Dialer[_0xdc00('0x19')][_0xdc00('0x3f')]=function(){var _0x543729=this;return cmHopper[_0xdc00('0xa9')]({'active':![]},{'where':{'active':!![]}})[_0xdc00('0x9e')](function(){setInterval(function(){_0x543729[_0xdc00('0xaa')]();},0x3e8);});};Dialer['prototype']['syncCampaigns']=function(){var _0x3e75a0=this;var _0x109305;for(var _0x4dd65b in this[_0xdc00('0x1e')]){if(typeof this['campaigns'][_0x4dd65b]!==_0xdc00('0xab')){_0x109305=this[_0xdc00('0x1e')][_0x4dd65b];if(utils[_0xdc00('0x7c')](_0x109305)&&utils[_0xdc00('0xac')](_0x109305)){_0x109305[_0xdc00('0x80')]=!![];Promise['resolve']()['then'](checkIsIVRCampaignActive(_0x109305))[_0xdc00('0x9e')](checkInterval(_0x109305))[_0xdc00('0x9e')](_0x3e75a0['checkIsTrunkReachable'](_0x109305))[_0xdc00('0x9e')](_0x3e75a0['checkIfTime'](_0x109305[_0xdc00('0xad')],_0x109305[_0xdc00('0xae')],_0x109305[_0xdc00('0x47')],_0x109305))['then'](_0x3e75a0[_0xdc00('0xaf')](_0x109305['Interval'],_0x109305[_0xdc00('0xae')],_0x109305[_0xdc00('0x47')],_0x109305))[_0xdc00('0x9e')](_0x3e75a0['launchHandleIvr'](_0x109305))[_0xdc00('0xa2')](loggerCatchQueueSummary(_0xdc00('0xb0'),_0x109305));}else{notSendMessagesCampaign(_0x109305);}}}};Dialer[_0xdc00('0x19')]['checkDialMethod']=function(_0x3d0223){if(_0x3d0223['dialMethod']!==_0xdc00('0xa')){clearPredictiveAttributes(_0x3d0223);}switch(_0x3d0223[_0xdc00('0xb1')]){case _0xdc00('0xb2'):this[_0xdc00('0xb3')](_0x3d0223,0x1);break;case'power':this[_0xdc00('0xb3')](_0x3d0223,_0x3d0223['dialPowerLevel']);break;case _0xdc00('0xa'):this[_0xdc00('0xa')](_0x3d0223);break;case'booked':this[_0xdc00('0xb3')](_0x3d0223,0x1);break;default:logger[_0xdc00('0x64')](_0xdc00('0xb4'),_0x3d0223['name'],'method\x20not\x20recognized');}};Dialer[_0xdc00('0x19')][_0xdc00('0x94')]=function(_0x2e86a1,_0x414166){var _0xa0ee5e=_0x2e86a1[_0xdc00('0xae')];var _0x251a03=_0x414166?_0x2e86a1[_0xdc00('0xad')]:_0x2e86a1[_0xdc00('0x76')]['Intervals'];logger[_0xdc00('0xb5')](_0xdc00('0xb6'),_0x251a03,_0xa0ee5e,_0x2e86a1[_0xdc00('0x47')],util[_0xdc00('0x7d')](_0xdc00('0xb7'),_0x2e86a1[_0xdc00('0x47')],_0x2e86a1['id']));var _0x2528de=null;return Interval[_0xdc00('0xb8')](_0x251a03,_0xa0ee5e)['then'](function(_0x42e887){if(_0x42e887===!![]){return _0x42e887;}else{_0x2e86a1[_0xdc00('0x69')]=_0x414166?utils['CAMPAIGN_STATUS'][_0xdc00('0xa5')]:utils[_0xdc00('0x6a')]['OVERTIME_INTERVAL'];_0x2528de=msgResponse(_0xdc00('0xa7'),_0xdc00('0x91'),_0xdc00('0xa8')+_0x414166+'\x20'+_0x2e86a1['name']+_0xdc00('0xb9')+util[_0xdc00('0x65')](_0x251a03,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0xa0ee5e);}if(_0x2528de!==null){logger[_0xdc00('0xb5')](_0xdc00('0xba'),_0x2528de);_0x2528de['isGlobal']=_0x414166;throw _0x2528de;}})[_0xdc00('0xa2')](function(_0x541743){logger['error'](_0xdc00('0xbb'),_0x541743);throw msgResponse(_0xdc00('0x84'),'Error',util[_0xdc00('0x65')](_0x541743,{'showHidden':![],'depth':null}));});};Dialer[_0xdc00('0x19')][_0xdc00('0x2b')]=function(_0x2b0b64){if(this['voiceQueues'][_0x2b0b64[_0xdc00('0xbc')]]){if(this['uniqueId'][_0x2b0b64[_0xdc00('0xbd')]]&&this[_0xdc00('0x25')][_0x2b0b64[_0xdc00('0xbd')]][_0xdc00('0xbe')]!==_0xdc00('0xbf')){this[_0xdc00('0xc0')](this[_0xdc00('0x1d')][_0x2b0b64[_0xdc00('0xbc')]]);this[_0xdc00('0x25')][_0x2b0b64[_0xdc00('0xbd')]][_0xdc00('0xc1')]=moment()[_0xdc00('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xdc00('0x19')]['syncAgentComplete']=function(_0x3f7fe8){var _0x500d7e=this[_0xdc00('0x25')][_0x3f7fe8['uniqueid']];if(this['voiceQueues'][_0x3f7fe8[_0xdc00('0xbc')]]){if(_0x500d7e&&_0x500d7e[_0xdc00('0xbe')]!==_0xdc00('0xbf')){delete this[_0xdc00('0x25')][_0x3f7fe8['uniqueid']];this['voiceQueues'][_0x3f7fe8[_0xdc00('0xbc')]][_0xdc00('0xc2')]+=0x1;var _0x3d57a1=new AgentComplete(_0x500d7e,_0x3f7fe8);if(_0x3f7fe8['reason']===_0xdc00('0xc3')){_0x3d57a1[_0xdc00('0xc4')]=this['voiceQueues'][_0x3f7fe8[_0xdc00('0xbc')]][_0xdc00('0xc5')]&&this[_0xdc00('0x1d')][_0x3f7fe8[_0xdc00('0xbc')]]['dialAgiAfterHangupAgent']?moment()[_0xdc00('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0xdc00('0xc6')](_0x3d57a1)['catch'](loggerCatch(_0xdc00('0xc7')));hopperUtils[_0xdc00('0xc8')](_0x3d57a1)[_0xdc00('0xa2')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xdc00('0x19')]['syncQueueCallerAbandon']=function(_0x113659){var _0x4afc02=this[_0xdc00('0x25')][_0x113659[_0xdc00('0xbd')]];var _0x2769bd=this;var _0x2ef13a=![];var _0x4faa8f;var _0x25129d;if(this[_0xdc00('0x1d')][_0x113659['queue']]){if(_0x4afc02&&_0x4afc02['type']!==_0xdc00('0xbf')){delete this[_0xdc00('0x25')][_0x113659[_0xdc00('0xbd')]];this[_0xdc00('0xc0')](this['voiceQueues'][_0x113659[_0xdc00('0xbc')]]);_0x4afc02[_0xdc00('0xc9')]=moment()[_0xdc00('0x7d')](_0xdc00('0xca'));var _0x448044=new QueueCallerAbandon(_0x4afc02,_0x113659);if(utils[_0xdc00('0xcb')](_0x4afc02[_0xdc00('0xc9')],_0x4afc02[_0xdc00('0xcc')])>=_0x4afc02[_0xdc00('0xcd')]){this['voiceQueues'][_0x113659['queue']][_0xdc00('0x4f')]+=0x1;this[_0xdc00('0x1d')][_0x113659[_0xdc00('0xbc')]][_0xdc00('0xce')]+=0x1;this[_0xdc00('0x1d')][_0x113659['queue']][_0xdc00('0xcf')]+=0x1;_0x448044[_0xdc00('0x70')]=0xa;_0x448044[_0xdc00('0x71')]=_0xdc00('0xd0');_0x448044['dropreason']=_0xdc00('0xd1');_0x448044['agiafterat']=this[_0xdc00('0x1d')][_0x113659[_0xdc00('0xbc')]]['dialQueueProject2']?moment()[_0xdc00('0x7d')](_0xdc00('0xca')):undefined;_0x448044[_0xdc00('0xd2')]+=0x1;_0x448044[_0xdc00('0xd3')]+=0x1;_0x4faa8f=this[_0xdc00('0x1d')][_0x113659[_0xdc00('0xbc')]][_0xdc00('0xd4')];_0x25129d=this[_0xdc00('0x1d')][_0x113659[_0xdc00('0xbc')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0xdc00('0xd5')](_0x448044,_0x448044[_0xdc00('0x70')],_0x4afc02[_0xdc00('0xd6')])[_0xdc00('0x9e')](function(_0x32d9cc){_0x2ef13a=_0x32d9cc['additional']==0x1;if(_0x448044['countdropretry']>=_0x2769bd[_0xdc00('0x1d')][_0x113659[_0xdc00('0xbc')]][_0xdc00('0xd7')]){_0x2769bd['queueCallerAbandonCreateState'](_0x448044,_0x32d9cc['additional']);}else{hopperUtils[_0xdc00('0xd8')]({'active':![],'countdropretry':_0x448044['countdropretry'],'scheduledat':moment()[_0xdc00('0xd9')](_0x2769bd['voiceQueues'][_0x113659['queue']][_0xdc00('0xd4')],'minutes')[_0xdc00('0x7d')](_0xdc00('0xca')),'ContactId':_0x4afc02['ContactId'],'ListId':_0x4afc02[_0xdc00('0xda')],'VoiceQueueId':_0x4afc02[_0xdc00('0xdb')]||undefined,'CampaignId':_0x4afc02[_0xdc00('0xdc')]||undefined})['catch'](loggerCatch(_0xdc00('0xdd')));var _0x3b7758=new History(_0x448044);_0x3b7758[_0xdc00('0x70')]=0xa;_0x3b7758[_0xdc00('0x71')]=_0xdc00('0xd0');_0x3b7758[_0xdc00('0xde')]=moment()[_0xdc00('0x7d')](_0xdc00('0xca'));_0x3b7758['endtime']=_0x3b7758[_0xdc00('0xde')];_0x3b7758['calleridname']=_0x448044[_0xdc00('0xdf')];_0x3b7758[_0xdc00('0xe0')]=_0x448044['calleridnum'];hopperUtils['createHistory'](_0x3b7758)[_0xdc00('0xa2')](loggerCatch(_0xdc00('0xe1')));}})[_0xdc00('0x9e')](function(){if(_0x2ef13a)hopperUtils[_0xdc00('0xe2')](_0x448044,_0x4faa8f,_0x25129d)[_0xdc00('0x9e')](function(){return 0x1;});});}else{this[_0xdc00('0x1d')][_0x113659[_0xdc00('0xbc')]][_0xdc00('0x50')]+=0x1;this[_0xdc00('0x1d')][_0x113659['queue']][_0xdc00('0xe3')]+=0x1;_0x448044[_0xdc00('0x70')]=0xb;_0x448044[_0xdc00('0x71')]='Abandoned';_0x448044[_0xdc00('0xe4')]=_0xdc00('0xe5');_0x448044[_0xdc00('0xe6')]+=0x1;_0x448044[_0xdc00('0xd3')]+=0x1;_0x4faa8f=this['voiceQueues'][_0x113659['queue']]['dialAbandonedRetryFrequency'];_0x25129d=this[_0xdc00('0x1d')][_0x113659[_0xdc00('0xbc')]][_0xdc00('0xe7')];hopperUtils[_0xdc00('0xd5')](_0x448044,_0x448044[_0xdc00('0x70')],_0x4afc02['voiceQueue'])[_0xdc00('0x9e')](function(_0x43242a){if(_0x448044[_0xdc00('0xe6')]>=_0x2769bd[_0xdc00('0x1d')][_0x113659[_0xdc00('0xbc')]][_0xdc00('0xe8')]){_0x2769bd[_0xdc00('0xe9')](_0x448044,_0x43242a[_0xdc00('0xea')]);}else{hopperUtils[_0xdc00('0xd8')]({'active':![],'countabandonedretry':_0x448044[_0xdc00('0xe6')],'scheduledat':moment()[_0xdc00('0xd9')](_0x2769bd[_0xdc00('0x1d')][_0x113659[_0xdc00('0xbc')]][_0xdc00('0xeb')],_0xdc00('0xec'))[_0xdc00('0x7d')](_0xdc00('0xca')),'ContactId':_0x4afc02[_0xdc00('0xed')],'ListId':_0x4afc02['ListId'],'VoiceQueueId':_0x4afc02[_0xdc00('0xdb')]||undefined,'CampaignId':_0x4afc02['CampaignId']||undefined})[_0xdc00('0xa2')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x4a6056=new History(_0x448044);_0x4a6056[_0xdc00('0x70')]=0xb;_0x4a6056[_0xdc00('0x71')]='Abandoned';_0x4a6056['starttime']=moment()[_0xdc00('0x7d')](_0xdc00('0xca'));_0x4a6056['endtime']=_0x4a6056[_0xdc00('0xde')];_0x4a6056[_0xdc00('0xdf')]=_0x448044[_0xdc00('0xdf')];_0x4a6056[_0xdc00('0xe0')]=_0x448044[_0xdc00('0xe0')];hopperUtils[_0xdc00('0xc6')](_0x4a6056)[_0xdc00('0xa2')](loggerCatch(_0xdc00('0xee')));}})[_0xdc00('0x9e')](function(){if(_0x2ef13a)hopperUtils['swapAdditionalPhones'](_0x448044,_0x4faa8f,_0x25129d)[_0xdc00('0x9e')](function(){return 0x1;});});}}}};Dialer[_0xdc00('0x19')]['syncNewExten']=function(_0x59d533){if(this[_0xdc00('0x23')][_0x59d533[_0xdc00('0xbd')]]){this['actions'][_0x59d533[_0xdc00('0xbd')]][_0xdc00('0xef')]=_0x59d533[_0xdc00('0xef')];}if(this[_0xdc00('0x25')][_0x59d533['uniqueid']]){this[_0xdc00('0x25')][_0x59d533['uniqueid']][_0xdc00('0xef')]=_0x59d533['channel'];}};Dialer[_0xdc00('0x19')][_0xdc00('0x3c')]=function(_0xdb099b){if(!this[_0xdc00('0x23')][_0xdb099b[_0xdc00('0xf0')]]){return;}var _0x165ed8=this['voiceQueues'][this[_0xdc00('0x23')][_0xdb099b['actionid']][_0xdc00('0xbc')]][_0xdc00('0xf1')]||_0xdc00('0xf2');if(_0x165ed8===_0xdc00('0xf3')){if(this[_0xdc00('0x23')][_0xdb099b[_0xdc00('0xf0')]]&&_[_0xdc00('0xf4')](this['actions'][_0xdb099b[_0xdc00('0xf0')]][_0xdc00('0xf5')])&&_0xdb099b[_0xdc00('0x8a')]==='1'&&_0xdb099b['paused']==='0'){if(this[_0xdc00('0x1f')][_0xdb099b[_0xdc00('0xf6')]]){if(!this[_0xdc00('0x1f')][_0xdb099b['stateinterface']]['locked']){this[_0xdc00('0x1f')][_0xdb099b['stateinterface']][_0xdc00('0xf5')]=!![];this[_0xdc00('0x23')][_0xdb099b[_0xdc00('0xf0')]]['locked']=!![];this[_0xdc00('0x23')][_0xdb099b[_0xdc00('0xf0')]]['stateinterface']=_0xdb099b[_0xdc00('0xf6')];}}}}else if(_0x165ed8===_0xdc00('0xf2')){if(this[_0xdc00('0x23')][_0xdb099b[_0xdc00('0xf0')]]){if(this[_0xdc00('0x1f')][_0xdb099b[_0xdc00('0xf6')]]){this[_0xdc00('0x23')][_0xdb099b[_0xdc00('0xf0')]][_0xdc00('0xf6')]=_0xdb099b['stateinterface'];if(_[_0xdc00('0xf4')](this[_0xdc00('0x29')][this['actions'][_0xdb099b[_0xdc00('0xf0')]]['queue']])){this[_0xdc00('0x29')][this['actions'][_0xdb099b['actionid']][_0xdc00('0xbc')]]=[];}this['queueBooked'][this[_0xdc00('0x23')][_0xdb099b['actionid']][_0xdc00('0xbc')]][_0xdc00('0x9a')](_[_0xdc00('0x5f')](_[_0xdc00('0x75')](this[_0xdc00('0x23')][_0xdb099b[_0xdc00('0xf0')]],['idHopper',_0xdc00('0xf6')]),{'status':_0xdb099b[_0xdc00('0x8a')],'paused':_0xdb099b[_0xdc00('0xf7')]}));}}}};Dialer[_0xdc00('0x19')][_0xdc00('0x3e')]=function(_0x58b309){if(!this[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]]){return;}var _0x40c43a=this;var _0x2230a7=this['voiceQueues'][this[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]]['queue']];var _0x4de197=_0x2230a7[_0xdc00('0xf1')]||_0xdc00('0xf2');if(_0x4de197===_0xdc00('0xf3')){if(this[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]]&&this[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]][_0xdc00('0xf6')]){this[_0xdc00('0x1c')][_0xdc00('0xf8')](this[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]][_0xdc00('0xf9')],this['actions'][_0x58b309[_0xdc00('0xf0')]][_0xdc00('0xf6')])[_0xdc00('0xa2')](function(_0x161928){logger['error'](_0xdc00('0xfa'),util[_0xdc00('0x65')](_0x161928,{'showHidden':![],'depth':null}));})[_0xdc00('0xfb')](function(){_0x40c43a['updateOriginated'](_0x40c43a[_0xdc00('0x1d')][_0x40c43a[_0xdc00('0x23')][_0x58b309['actionid']][_0xdc00('0xbc')]]);_0x40c43a[_0xdc00('0x1f')][_0x40c43a['actions'][_0x58b309['actionid']][_0xdc00('0xf6')]][_0xdc00('0xf5')]=![];delete _0x40c43a[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]];unlockQueueStatus(_0x2230a7);});}else{this[_0xdc00('0xc0')](this[_0xdc00('0x1d')][this[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]][_0xdc00('0xbc')]]);hopperUtils[_0xdc00('0xd8')]({'active':![],'ContactId':this[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]]['ContactId'],'ListId':this[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]][_0xdc00('0xda')],'VoiceQueueId':this[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]][_0xdc00('0xdb')]||undefined,'CampaignId':this[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]][_0xdc00('0xdc')]||undefined})['catch'](loggerCatch(_0xdc00('0xfc')));delete this[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]];unlockQueueStatus(_0x2230a7);}}else if(_0x4de197==='rrmemory'){var _0x4acb15;if(this[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]]&&!_[_0xdc00('0x93')](this[_0xdc00('0x29')][this[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]][_0xdc00('0xbc')]])){if(this['queueBookedRR'][_0x40c43a[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]][_0xdc00('0xbc')]]){this[_0xdc00('0xfd')][_0x40c43a[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]][_0xdc00('0xbc')]]=this[_0xdc00('0xfd')][this['actions'][_0x58b309[_0xdc00('0xf0')]][_0xdc00('0xbc')]]?this['queueBookedRR'][this[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]]['queue']]:this['queueBooked'][this[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]][_0xdc00('0xbc')]]?this[_0xdc00('0x29')][this['actions'][_0x58b309['actionid']]['queue']][_0xdc00('0xfe')]||0x0:0x0;}this['queueBooked'][this[_0xdc00('0x23')][_0x58b309[_0xdc00('0xf0')]][_0xdc00('0xbc')]][_0xdc00('0xfe')]=this[_0xdc00('0xfd')][this[_0xdc00('0x23')][_0x58b309['actionid']]['queue']];for(var _0x3decd9=0x0;_0x3decd9=_0x129c1e[_0xdc00('0x121')]){_0x4ed7d4[_0xdc00('0x122')](_0x189d39,_0x5b3f4a,_0x375583,_0xdc00('0x123'));}else{if(_0x189d39[_0xdc00('0x120')]>=_0x129c1e['dialMachineMaxRetry']){_0x4ed7d4[_0xdc00('0x124')](_0x189d39,_0x5b3f4a,_0x375583,_0xdc00('0x125'));}else{hopperUtils[_0xdc00('0xd8')]({'active':![],'countmachineretry':_0x189d39['countmachineretry'],'scheduledat':moment()[_0xdc00('0xd9')](_0x129c1e[_0xdc00('0x126')],_0xdc00('0xec'))[_0xdc00('0x7d')](_0xdc00('0xca')),'ContactId':_0x189d39[_0xdc00('0xed')],'ListId':_0x189d39[_0xdc00('0xda')],'VoiceQueueId':_0x189d39['VoiceQueueId']||undefined,'CampaignId':_0x189d39[_0xdc00('0xdc')]||undefined})[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x127')));_0x5b3f4a({'reschedule':0x1});}}});}if(_0x4b0205[_0xdc00('0xbe')]==='ivr'&&this[_0xdc00('0x1e')][_0x4b0205[_0xdc00('0xbc')]][_0xdc00('0x10f')]&&_0x3f3475[_0xdc00('0x110')]==='HANGUP'){delete this[_0xdc00('0x25')][_0x3f3475[_0xdc00('0xbd')]];this[_0xdc00('0xc0')](this[_0xdc00('0x1e')][_0x4b0205['queue']]);_0x3e2162=new Hangup(_0x4b0205,_0x3f3475);_0x3e2162[_0xdc00('0x70')]=0x12;_0x3e2162[_0xdc00('0x71')]=_0xdc00('0x112');_0x3e2162['membername']=_0xdc00('0x114');ami[_0xdc00('0x11c')]('custom:amd',ut['buildObj'](_0x3e2162,_0xdc00('0x117')));this[_0xdc00('0x118')](_0x3e2162,_0xdc00('0x128'),_0xdc00('0x129'));}if(_0x4b0205[_0xdc00('0xbe')]==='ivr'&&this[_0xdc00('0x1e')][_0x4b0205['queue']][_0xdc00('0x10f')]&&_0x3f3475[_0xdc00('0x110')]==='MACHINE'){return new Promise(function(_0x305d99,_0x37f7f2){delete _0x4ed7d4[_0xdc00('0x25')][_0x3f3475['uniqueid']];_0x4ed7d4[_0xdc00('0xc0')](_0x4ed7d4[_0xdc00('0x1e')][_0x4b0205['queue']]);_0x4ed7d4['campaigns'][_0x4b0205[_0xdc00('0xbc')]][_0xdc00('0xc2')]+=0x1;_0x4ed7d4['campaigns'][_0x4b0205['queue']][_0xdc00('0x111')]+=0x1;var _0x5d20fa=_0x4ed7d4[_0xdc00('0x1e')][_0x4b0205[_0xdc00('0xbc')]];var _0x3a5b15=new Hangup(_0x4b0205,_0x3f3475);_0x3a5b15[_0xdc00('0x70')]=0x13;_0x3a5b15['statedesc']=_0xdc00('0x11b');_0x3a5b15[_0xdc00('0x113')]=_0xdc00('0x114');_0x3a5b15[_0xdc00('0x120')]+=0x1;_0x3a5b15['countglobal']+=0x1;_0x3a5b15[_0xdc00('0x117')]=!![];ami[_0xdc00('0x11c')](_0xdc00('0x115'),ut[_0xdc00('0x116')](_0x3a5b15,_0xdc00('0x117')));hopperUtils[_0xdc00('0xc6')](_0x3a5b15)[_0xdc00('0xa2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x3a5b15['countbusyretry']+_0x3a5b15[_0xdc00('0x11e')]+_0x3a5b15[_0xdc00('0x11f')]+_0x3a5b15[_0xdc00('0x12a')]+_0x3a5b15[_0xdc00('0xd2')]+_0x3a5b15[_0xdc00('0xe6')]+_0x3a5b15[_0xdc00('0x120')]+_0x3a5b15['countagentrejectretry']>=_0x5d20fa[_0xdc00('0x121')]){_0x4ed7d4[_0xdc00('0x122')](_0x3a5b15,_0x305d99,_0x37f7f2,'reason19\x20machine....');}else{if(_0x3a5b15['countmachineretry']>=_0x5d20fa['dialMachineMaxRetry']){_0x4ed7d4['createStateFinal'](_0x3a5b15,_0x305d99,_0x37f7f2,_0xdc00('0x125'));}else{hopperUtils[_0xdc00('0xd8')]({'active':![],'countmachineretry':_0x3a5b15['countmachineretry'],'scheduledat':moment()['add'](_0x5d20fa[_0xdc00('0x126')],'minutes')[_0xdc00('0x7d')](_0xdc00('0xca')),'ContactId':_0x3a5b15['ContactId'],'ListId':_0x3a5b15[_0xdc00('0xda')],'VoiceQueueId':_0x3a5b15['VoiceQueueId']||undefined,'CampaignId':_0x3a5b15[_0xdc00('0xdc')]||undefined})[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x127')));_0x305d99({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xdc00('0x38')]=function(_0x258f86){var _0x36ab6f=this[_0xdc00('0x25')][_0x258f86[_0xdc00('0xbd')]];var _0xf6ca7c;if(_0x36ab6f&&_0x36ab6f[_0xdc00('0xbe')]===_0xdc00('0xbf')){delete this[_0xdc00('0x25')][_0x258f86['uniqueid']];this[_0xdc00('0xc0')](this[_0xdc00('0x1e')][_0x36ab6f['queue']]);this[_0xdc00('0x1e')][_0x36ab6f[_0xdc00('0xbc')]][_0xdc00('0x12b')]+=0x1;_0xf6ca7c=new Hangup(_0x36ab6f,_0x258f86);hopperUtils['createHistory'](_0xf6ca7c)[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x12c')));hopperUtils[_0xdc00('0xc8')](_0xf6ca7c)[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x12d')));}if(_0x36ab6f&&_0x36ab6f[_0xdc00('0xbe')]!==_0xdc00('0xbf')&&isNotNull(this[_0xdc00('0x1d')][_0x36ab6f['queue']][_0xdc00('0x12e')])){delete this[_0xdc00('0x25')][_0x258f86[_0xdc00('0xbd')]];this['updateOriginated'](this[_0xdc00('0x1d')][_0x36ab6f['queue']]);this[_0xdc00('0x1d')][_0x36ab6f[_0xdc00('0xbc')]][_0xdc00('0xc2')]+=0x1;this[_0xdc00('0x1d')][_0x36ab6f['queue']][_0xdc00('0x111')]+=0x1;_0xf6ca7c=new Hangup(_0x36ab6f,_0x258f86);_0xf6ca7c[_0xdc00('0x70')]=0x10;_0xf6ca7c[_0xdc00('0x71')]='AnswerAGI';_0xf6ca7c[_0xdc00('0x113')]=_0xdc00('0x12f');hopperUtils['createHistory'](_0xf6ca7c)[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x12c')));hopperUtils[_0xdc00('0xc8')](_0xf6ca7c)[_0xdc00('0xa2')](loggerCatch('[syncHangupIvr]'));}if(_0x36ab6f&&_0x36ab6f[_0xdc00('0xbe')]!=='ivr'&&!isNotNull(this[_0xdc00('0x1d')][_0x36ab6f['queue']][_0xdc00('0x12e')])){delete this[_0xdc00('0x25')][_0x258f86[_0xdc00('0xbd')]];this[_0xdc00('0xc0')](this['voiceQueues'][_0x36ab6f[_0xdc00('0xbc')]]);this[_0xdc00('0x1d')][_0x36ab6f[_0xdc00('0xbc')]][_0xdc00('0x130')]+=0x1;_0xf6ca7c=new Hangup(_0x36ab6f,_0x258f86);_0xf6ca7c['state']=0xc;_0xf6ca7c[_0xdc00('0x71')]=_0x258f86[_0xdc00('0x131')];_0xf6ca7c[_0xdc00('0x113')]='Unknow';hopperUtils[_0xdc00('0xc6')](_0xf6ca7c)[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x12c')));hopperUtils[_0xdc00('0xc8')](_0xf6ca7c)[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x12d')));}};Dialer[_0xdc00('0x19')][_0xdc00('0x34')]=function(_0x11cd74){var _0x5ab9b5=this;if(!_0x5ab9b5['queuesSummary'][_0x11cd74['name']]){_0x5ab9b5[_0xdc00('0x2a')][_0x11cd74['name']]={'running':![]};}else if(_0x5ab9b5[_0xdc00('0x2a')][_0x11cd74['name']][_0xdc00('0x132')]===!![]){return;}else if(_0x5ab9b5[_0xdc00('0x2a')][_0x11cd74[_0xdc00('0x47')]][_0xdc00('0x132')]===![]){_0x5ab9b5[_0xdc00('0x2a')][_0x11cd74[_0xdc00('0x47')]][_0xdc00('0x132')]=!![];}var _0x1a3bd4=_0x5ab9b5[_0xdc00('0x1d')][_0x11cd74[_0xdc00('0x47')]];var _0x41b430=_0x1a3bd4[_0xdc00('0x69')]!==utils['CAMPAIGN_STATUS'][_0xdc00('0x7a')];var _0x1c5caf=utils[_0xdc00('0x133')](_0x1a3bd4);_0x1a3bd4[_0xdc00('0x134')]=utils[_0xdc00('0x135')](_0x1a3bd4,_0x5ab9b5[_0xdc00('0x20')]);Promise[_0xdc00('0x136')]()[_0xdc00('0x9e')](function(){if(_0x1a3bd4[_0xdc00('0x134')]===utils['CAMPAIGN_STATUS'][_0xdc00('0x7a')]){if(_0x41b430){clearPredictiveAttributes(_0x1a3bd4);_0x11cd74[_0xdc00('0x27')]=undefined;_0x11cd74['startProgressive']=undefined;}if(_0x1a3bd4['statusMessage']===utils[_0xdc00('0x6a')][_0xdc00('0x7a')]){_0x11cd74['available']=0x0;_0x11cd74[_0xdc00('0xf7')]=0x0;_0x11cd74[_0xdc00('0x137')]=0x0;_0x11cd74['talking']=0x0;_0x11cd74['pTalking']=0x0;}}else if(_0x1a3bd4[_0xdc00('0x134')]===utils[_0xdc00('0x6a')][_0xdc00('0x138')]&&!_0x1c5caf){return _0x5ab9b5[_0xdc00('0x94')](_0x1a3bd4,!![])[_0xdc00('0x9e')](function(){return _0x5ab9b5[_0xdc00('0x94')](_0x1a3bd4,![]);})[_0xdc00('0x9e')](function(){return _0x5ab9b5[_0xdc00('0x139')](_0x1a3bd4);})['catch'](function(_0xfade73){loggerSyncQueueSummary[_0xdc00('0x44')](_0xdc00('0x13a'),util[_0xdc00('0x65')](_0xfade73,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1a3bd4);});}else{clearPredictiveAttributes(_0x1a3bd4);}})[_0xdc00('0x9e')](function(){var _0x4b9bd4=_0x11cd74[_0xdc00('0x13b')](_0x1a3bd4);if(_0x4b9bd4||_0x1a3bd4[_0xdc00('0x13c')]){_0x1a3bd4[_0xdc00('0x13c')]=![];_0x11cd74[_0xdc00('0x13d')](_0x1a3bd4);Object[_0xdc00('0x13e')](_0x1a3bd4,_0x11cd74);emitOutboundVoiceQueueSummary(_0x11cd74);}_0x5ab9b5[_0xdc00('0x2a')][_0x1a3bd4['name']][_0xdc00('0x132')]=![];})[_0xdc00('0xa2')](function(_0x2a849c){logger[_0xdc00('0x64')](_0xdc00('0x13a'),util[_0xdc00('0x65')](_0x2a849c,{'showHidden':![],'depth':null}));_0x5ab9b5['queuesSummary'][_0x1a3bd4[_0xdc00('0x47')]][_0xdc00('0x132')]=![];});};Dialer[_0xdc00('0x19')][_0xdc00('0x36')]=_[_0xdc00('0x13f')](function(){var _0x5e4765=_[_0xdc00('0x140')](this[_0xdc00('0x1d')],function(_0xe158cb){return _0xe158cb['dialPreviewRecallmeReminder'];});var _0x14a721=_[_0xdc00('0x140')](this[_0xdc00('0x1f')],function(_0x5ba012){return _0x5ba012[_0xdc00('0x141')]&&_0x5ba012[_0xdc00('0x8a')]===_0xdc00('0x89');});if(_0x5e4765[_0xdc00('0x99')]>0x0&&_0x14a721[_0xdc00('0x99')]>0x0){return Promise[_0xdc00('0x136')]()[_0xdc00('0x9e')](cmHopper[_0xdc00('0x142')](_[_0xdc00('0x143')](_0x5e4765,'id'),previewRecallmeReminderInterval,_['map'](_0x14a721,'id')))[_0xdc00('0x9e')](function(_0x5792b7){for(var _0x35cad2=0x0;_0x35cad2<_0x5792b7[_0xdc00('0x99')];_0x35cad2++){var _0x4c94e5=_0x5792b7[_0x35cad2][_0xdc00('0x144')]['name'];if(_0x4c94e5)io['to'](util[_0xdc00('0x7d')](_0xdc00('0x145'),_0x4c94e5))[_0xdc00('0x11c')](_0xdc00('0x146'),{'hopper':_0x5792b7[_0x35cad2]});}})[_0xdc00('0xa2')](function(_0xbb3d86){logger['error']('checkPreviewRecallReminder',_0xbb3d86);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xdc00('0x19')][_0xdc00('0x147')]=function(){var _0x37c232=this;setInterval(function(){_0x37c232['clearZombieChannels'](_0x37c232[_0xdc00('0x25')],_0xdc00('0x148'));_0x37c232[_0xdc00('0x149')](_0x37c232['actions'],'[actions]');},0x32c8);};Dialer['prototype'][_0xdc00('0x149')]=function(_0x2edc57,_0xaf2020){var _0x34fea0=this;for(var _0x3444b0 in _0x2edc57){if(typeof _0x2edc57[_0x3444b0]!==_0xdc00('0xab')){this[_0xdc00('0x1b')]['enqueue'](function(){if(!_[_0xdc00('0xf4')](_0x2edc57[_0x3444b0])){return ami['Action']({'action':_0xdc00('0x8a'),'channel':_0x2edc57[_0x3444b0][_0xdc00('0xef')]})[_0xdc00('0xa2')](function(_0x496108){if(_0x496108[_0xdc00('0x69')]===_0xdc00('0x14a')){setTimeout(function(){if(_0x2edc57[_0x3444b0]&&_0x2edc57[_0x3444b0][_0xdc00('0xbe')]!==_0xdc00('0xbf')){_0x34fea0['updateOriginated'](_0x34fea0[_0xdc00('0x1d')][_0x2edc57[_0x3444b0][_0xdc00('0xbc')]]);logger['error'](_0xdc00('0x14b'),_0xaf2020,_0x3444b0,_0x2edc57[_0x3444b0][_0xdc00('0xbc')]);delete _0x2edc57[_0x3444b0];}if(_0x2edc57[_0x3444b0]&&_0x2edc57[_0x3444b0]['type']===_0xdc00('0xbf')){_0x34fea0[_0xdc00('0xc0')](_0x34fea0[_0xdc00('0x1e')][_0x2edc57[_0x3444b0][_0xdc00('0xbc')]]);logger[_0xdc00('0x64')](_0xdc00('0x14c'),_0xaf2020,_0x3444b0,_0x2edc57[_0x3444b0][_0xdc00('0xbc')]);delete _0x2edc57[_0x3444b0];}},0x2328);}});}});}}};Dialer[_0xdc00('0x19')][_0xdc00('0x14d')]=function(_0x5dd696){return Promise['resolve']()[_0xdc00('0x9e')](voiceQueueRt[_0xdc00('0x14d')](_0x5dd696))[_0xdc00('0xa2')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xdc00('0x19')]['updateOriginated']=function(_0x5042f7){if(!_[_0xdc00('0x42')](_0x5042f7)&&_0x5042f7!==null){if(typeof _0x5042f7[_0xdc00('0x7f')]!==_0xdc00('0xab')){if(_0x5042f7[_0xdc00('0x7f')]>0x0){_0x5042f7[_0xdc00('0x7f')]-=0x1;}else{logger[_0xdc00('0x64')](_0xdc00('0x14e'));}}}else{logger[_0xdc00('0x64')](_0xdc00('0x14f'));}};Dialer[_0xdc00('0x19')][_0xdc00('0x150')]=function(_0x4ef631,_0x4338f4){var _0x324d92=this;return function(_0x34842f){_0x324d92[_0xdc00('0xc0')](_0x4338f4);logger[_0xdc00('0x64')](_0x4ef631,util['inspect'](_0x34842f,{'showHidden':![],'depth':null}));};};Dialer[_0xdc00('0x19')][_0xdc00('0x151')]=function(_0x2d57d5,_0x3f14c1,_0x253665){var _0x23cd53={'state':0x19,'statedesc':_0xdc00('0x152')};this[_0xdc00('0xc0')](_0x3f14c1);this[_0xdc00('0x118')](_[_0xdc00('0x5f')](_0x23cd53,_[_0xdc00('0x75')](_0x253665,[_0xdc00('0xed'),_0xdc00('0xda'),_0xdc00('0x153'),_0xdc00('0xdb'),_0xdc00('0xdc')])),'[emptyContact][createHistory]',_0xdc00('0x154'));logger[_0xdc00('0x64')](_0x2d57d5);};Dialer['prototype']['saveInDb']=function(_0x2f166e,_0x5e3b02,_0x16c213){hopperUtils[_0xdc00('0xc6')](_0x2f166e)[_0xdc00('0xa2')](loggerCatch(_0x5e3b02));hopperUtils['moveContactManagedDialer'](_0x2f166e)[_0xdc00('0xa2')](loggerCatch(_0x16c213));};Dialer[_0xdc00('0x19')]['queueCallerAbandonCreateState']=function(_0x33417d,_0x30eba3){hopperUtils[_0xdc00('0xc6')](_0x33417d)[_0xdc00('0xa2')](loggerCatch(_0xdc00('0xc7')));if(_0x30eba3==0x0){hopperUtils[_0xdc00('0xc8')](_0x33417d)[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x155')));}};Dialer['prototype'][_0xdc00('0x156')]=function(_0x1f3dec){return Promise['resolve']()[_0xdc00('0x9e')](cmHopper['handlePreviewRecallNotifications'](_0x1f3dec['id'],previewRecallmeReminderInterval))[_0xdc00('0x9e')](function(_0x6ed8f6){for(var _0x32d6ca=0x0;_0x32d6ca<_0x6ed8f6[_0xdc00('0x99')];_0x32d6ca++){var _0x389cdb=_0x6ed8f6[_0x32d6ca][_0xdc00('0x144')][_0xdc00('0x47')];if(_0x389cdb)io['to'](util[_0xdc00('0x7d')](_0xdc00('0x145'),_0x389cdb))[_0xdc00('0x11c')](_0xdc00('0x146'),{'hopper':_0x6ed8f6[_0x32d6ca]});}})[_0xdc00('0xa2')](function(){});};Dialer['prototype'][_0xdc00('0x157')]=function(_0x5af915){var _0x2564c5=this;return function(){_0x2564c5[_0xdc00('0x158')](_0x5af915);};};Dialer['prototype'][_0xdc00('0x159')]=function(_0x5e9caf,_0x287e15){var _0x326487=this;var _0x49bf39=uuid['v4']();this[_0xdc00('0x23')][_0x49bf39]=new Action(_0x5e9caf,_0x287e15,_0x49bf39);return new Promise(function(_0x4bd599,_0x4d80d3){if(_[_0xdc00('0x42')](_0x5e9caf)&&typeof _0x5e9caf!==_0xdc00('0x15a')){return _0x4d80d3(msgResponse('originate',_0xdc00('0x91'),_0xdc00('0x15b')));}if(_[_0xdc00('0x42')](_0x287e15[_0xdc00('0x15c')])||_0x287e15['phone']===null){return _0x4d80d3(msgResponse('originate',_0xdc00('0x91'),'contact\x20is\x20undefine'));}var _0xd8d6f8={'XMD-CALLERID':_0x326487['actions'][_0x49bf39][_0xdc00('0x15d')](),'XMD-AGI':_0x5e9caf[_0xdc00('0x12e')]?util[_0xdc00('0x7d')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5e9caf[_0xdc00('0x12e')]):'NONE','XMD-AGIAFTER':_0x5e9caf[_0xdc00('0xc5')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x5e9caf[_0xdc00('0xc5')]):_0xdc00('0x15e'),'XMD-QUEUE':utils['isOutboundQueue'](_0x5e9caf)?util[_0xdc00('0x7d')](_0xdc00('0x15f'),_0x5e9caf[_0xdc00('0x47')],_0x5e9caf[_0xdc00('0x160')]||'',_0x5e9caf[_0xdc00('0x161')]?'c':'',_0x5e9caf[_0xdc00('0xcd')]||0x3):_0xdc00('0x15e'),'XMD-CONTACTID':_0x287e15[_0xdc00('0xed')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x326487['actions'][_0x49bf39]['getCaller'](),'XMD-AMD':_0x5e9caf[_0xdc00('0x10f')]?_0xdc00('0x138'):_0xdc00('0x15e'),'XMD-DESTINATION':_0xdc00('0x10e')};if(_0x5e9caf[_0xdc00('0x10f')]){_0xd8d6f8[_0xdc00('0x162')]=_0x5e9caf[_0xdc00('0x163')]||0x9c4;_0xd8d6f8[_0xdc00('0x164')]=_0x5e9caf['dialAMDGreeting']||0x5dc;_0xd8d6f8[_0xdc00('0x165')]=_0x5e9caf[_0xdc00('0x166')]||0x320;_0xd8d6f8[_0xdc00('0x167')]=_0x5e9caf[_0xdc00('0x168')]||0x1388;_0xd8d6f8[_0xdc00('0x169')]=_0x5e9caf[_0xdc00('0x16a')]||0x64;_0xd8d6f8[_0xdc00('0x16b')]=_0x5e9caf[_0xdc00('0x16c')]||0x32;_0xd8d6f8[_0xdc00('0x16d')]=_0x5e9caf[_0xdc00('0x16e')]||0x3;_0xd8d6f8[_0xdc00('0x16f')]=_0x5e9caf[_0xdc00('0x170')]||0x100;_0xd8d6f8[_0xdc00('0x171')]=_0x5e9caf[_0xdc00('0x172')]||0x1388;}if(utils[_0xdc00('0x173')](_0x5e9caf)){_0xd8d6f8['XMD-VOICEQUEUEID']=_0x287e15[_0xdc00('0xdb')];}else{_0xd8d6f8[_0xdc00('0x174')]=_0x287e15[_0xdc00('0xdc')];}var _0x240c70=utils[_0xdc00('0x175')](_0x287e15[_0xdc00('0x176')]);Object[_0xdc00('0x13e')](_0xd8d6f8,_0x240c70);var _0x4def4a=_0x326487[_0xdc00('0x86')](_0x5e9caf[_0xdc00('0x8d')])?utils[_0xdc00('0x177')](_0x5e9caf[_0xdc00('0x8d')]['callerid'],_0x5e9caf['dialOriginateCallerIdName'],_0x5e9caf['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xdc00('0x178')](_0x5e9caf[_0xdc00('0x179')],_0x5e9caf[_0xdc00('0x17a')]):_0x5e9caf[_0xdc00('0x179')]):utils[_0xdc00('0x177')](_[_0xdc00('0xf4')](_0x5e9caf[_0xdc00('0x17b')])?_0x5e9caf[_0xdc00('0x8d')][_0xdc00('0x17c')]:_0x5e9caf[_0xdc00('0x17b')][_0xdc00('0x17c')],_0x5e9caf[_0xdc00('0x17d')],_0x5e9caf[_0xdc00('0x17a')]>0x0?utils[_0xdc00('0x178')](_0x5e9caf[_0xdc00('0x179')],_0x5e9caf[_0xdc00('0x17a')]):_0x5e9caf['dialOriginateCallerIdNumber']);if(_0x4def4a){_0xd8d6f8[_0xdc00('0x17e')]=_0x326487[_0xdc00('0x23')][_0x49bf39][_0xdc00('0x17f')]=utils[_0xdc00('0x180')](_0x4def4a);_0xd8d6f8[_0xdc00('0x181')]=_0x287e15[_0xdc00('0x15c')];}_0x5e9caf[_0xdc00('0x182')]=_0xd8d6f8;return ami[_0xdc00('0x183')]({'actionid':_0x49bf39,'action':_0xdc00('0x184'),'channel':_0x326487[_0xdc00('0x86')](_0x5e9caf[_0xdc00('0x8d')])?util['format'](_0xdc00('0x185'),_0x5e9caf[_0xdc00('0x8d')]['name'],isNotNull(_0x5e9caf[_0xdc00('0x186')])?_0x5e9caf[_0xdc00('0x186')][_0xdc00('0x187')]()||'':'',_0x5e9caf[_0xdc00('0x188')]>0x0?_0x287e15[_0xdc00('0x15c')][_0xdc00('0x189')](_0x5e9caf['dialCutDigit']):_0x287e15[_0xdc00('0x15c')]):util['format'](_0xdc00('0x185'),_[_0xdc00('0xf4')](_0x5e9caf[_0xdc00('0x17b')])?_0x5e9caf[_0xdc00('0x8d')]['name']:_0x5e9caf['TrunkBackup'][_0xdc00('0x47')],isNotNull(_0x5e9caf['dialPrefix'])?_0x5e9caf['dialPrefix'][_0xdc00('0x187')]()||'':'',_0x5e9caf[_0xdc00('0x188')]>0x0?_0x287e15['phone']['substring'](_0x5e9caf[_0xdc00('0x188')]):_0x287e15[_0xdc00('0x15c')]),'callerid':_0x4def4a,'Exten':'xcally-motion-dialer','Context':_0xdc00('0x18a'),'Priority':'1','variable':_0xd8d6f8,'timeout':(_0x5e9caf['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x49bf39})['then'](function(_0x20258a){return _0x4bd599(_0x20258a);})[_0xdc00('0xa2')](function(_0x82964e){_0x5e9caf['outboundOriginateFailureCallsDay']+=0x1;var _0x11cff2=new History(_0x326487['actions'][_0x49bf39]);logger[_0xdc00('0x64')](util[_0xdc00('0x7d')]('[originateError]:\x20%s',JSON[_0xdc00('0x74')](_0x82964e)));_0x11cff2[_0xdc00('0x70')]=0xe;_0x11cff2[_0xdc00('0x71')]=_0xdc00('0x18b');_0x11cff2[_0xdc00('0xde')]=moment()['format'](_0xdc00('0xca'));_0x11cff2[_0xdc00('0x18c')]=_0x11cff2['starttime'];hopperUtils[_0xdc00('0xc6')](_0x11cff2)[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x18d')));_0x326487[_0xdc00('0xc8')](_0x11cff2)[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x18d')))[_0xdc00('0xfb')](function(){delete _0x326487[_0xdc00('0x23')][_0x49bf39];return _0x4d80d3(msgResponse(_0xdc00('0x184'),_0xdc00('0x85'),_0xdc00('0x18e')));});});});};Dialer[_0xdc00('0x19')][_0xdc00('0x18f')]=function(_0xebe48a,_0x478716,_0x5e04f4){var _0x48f514=new History(_0x478716);if(_0x48f514[_0xdc00('0x11d')]+_0x48f514[_0xdc00('0x11e')]+_0x48f514[_0xdc00('0x11f')]+_0x48f514['countnosuchnumberretry']+_0x48f514[_0xdc00('0xd2')]+_0x48f514[_0xdc00('0xe6')]+_0x48f514[_0xdc00('0x120')]+_0x48f514[_0xdc00('0x190')]>=_0x5e04f4[_0xdc00('0x121')]-0x1){return!![];}switch(_0xebe48a){case 0x3:if(_0x48f514[_0xdc00('0x11f')]>=_0x5e04f4['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0xdc00('0xd8')]({'active':![],'countnoanswerretry':_0x48f514[_0xdc00('0x11f')]+=0x1,'scheduledat':moment()[_0xdc00('0xd9')](_0x5e04f4[_0xdc00('0x191')],'minutes')[_0xdc00('0x7d')](_0xdc00('0xca')),'ContactId':_0x48f514['ContactId'],'ListId':_0x48f514[_0xdc00('0xda')],'VoiceQueueId':_0x48f514[_0xdc00('0xdb')]||undefined,'CampaignId':_0x48f514['CampaignId']||undefined})['catch'](loggerCatch(_0xdc00('0x192')));break;case 0x5:if(_0x48f514[_0xdc00('0x11d')]>=_0x5e04f4[_0xdc00('0x193')]-0x1){return!![];}hopperUtils[_0xdc00('0xd8')]({'active':![],'countbusyretry':_0x48f514[_0xdc00('0x11d')]+=0x1,'scheduledat':moment()[_0xdc00('0xd9')](_0x5e04f4[_0xdc00('0x194')],_0xdc00('0xec'))[_0xdc00('0x7d')](_0xdc00('0xca')),'ContactId':_0x48f514[_0xdc00('0xed')],'ListId':_0x48f514['ListId'],'VoiceQueueId':_0x48f514[_0xdc00('0xdb')]||undefined,'CampaignId':_0x48f514[_0xdc00('0xdc')]||undefined})[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x195')));break;case 0x8:if(_0x48f514[_0xdc00('0x11e')]>=_0x5e04f4[_0xdc00('0x196')]-0x1){return!![];}hopperUtils[_0xdc00('0xd8')]({'active':![],'countcongestionretry':_0x48f514[_0xdc00('0x11e')]+=0x1,'scheduledat':moment()[_0xdc00('0xd9')](_0x5e04f4[_0xdc00('0x197')],_0xdc00('0xec'))[_0xdc00('0x7d')](_0xdc00('0xca')),'ContactId':_0x48f514['ContactId'],'ListId':_0x48f514[_0xdc00('0xda')],'VoiceQueueId':_0x48f514[_0xdc00('0xdb')]||undefined,'CampaignId':_0x48f514['CampaignId']||undefined})[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x198')));break;case 0x0:if(_0x48f514[_0xdc00('0x12a')]>=_0x5e04f4[_0xdc00('0x199')]-0x1){return!![];}else{hopperUtils[_0xdc00('0xd8')]({'active':![],'countnosuchnumberretry':_0x48f514[_0xdc00('0x12a')]+=0x1,'scheduledat':moment()[_0xdc00('0xd9')](_0x5e04f4[_0xdc00('0x19a')],_0xdc00('0xec'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x48f514[_0xdc00('0xed')],'ListId':_0x48f514[_0xdc00('0xda')],'VoiceQueueId':_0x48f514[_0xdc00('0xdb')]||undefined,'CampaignId':_0x48f514[_0xdc00('0xdc')]||undefined})[_0xdc00('0xa2')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x48f514[_0xdc00('0xd2')]>=_0x5e04f4[_0xdc00('0xd7')]-0x1){return!![];}hopperUtils[_0xdc00('0xd8')]({'active':![],'countdropretry':_0x48f514[_0xdc00('0xd2')]+=0x1,'scheduledat':moment()[_0xdc00('0xd9')](_0x5e04f4[_0xdc00('0xd4')],'minutes')[_0xdc00('0x7d')](_0xdc00('0xca')),'ContactId':_0x48f514[_0xdc00('0xed')],'ListId':_0x48f514['ListId'],'VoiceQueueId':_0x48f514[_0xdc00('0xdb')]||undefined,'CampaignId':_0x48f514[_0xdc00('0xdc')]||undefined})[_0xdc00('0xa2')](loggerCatch(_0xdc00('0xdd')));break;case 0xb:if(_0x48f514[_0xdc00('0xe6')]>=_0x5e04f4[_0xdc00('0xe8')]-0x1){return!![];}hopperUtils[_0xdc00('0xd8')]({'active':![],'countabandonedretry':_0x48f514[_0xdc00('0xe6')]+=0x1,'scheduledat':moment()[_0xdc00('0xd9')](_0x5e04f4[_0xdc00('0xeb')],'minutes')[_0xdc00('0x7d')](_0xdc00('0xca')),'ContactId':_0x48f514['ContactId'],'ListId':_0x48f514['ListId'],'VoiceQueueId':_0x48f514[_0xdc00('0xdb')]||undefined,'CampaignId':_0x48f514[_0xdc00('0xdc')]||undefined})['catch'](loggerCatch(_0xdc00('0x19b')));break;case 0x13:if(_0x48f514[_0xdc00('0x120')]>=_0x5e04f4['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x48f514[_0xdc00('0x120')]+=0x1,'scheduledat':moment()[_0xdc00('0xd9')](_0x5e04f4[_0xdc00('0x126')],_0xdc00('0xec'))[_0xdc00('0x7d')](_0xdc00('0xca')),'ContactId':_0x48f514[_0xdc00('0xed')],'ListId':_0x48f514[_0xdc00('0xda')],'VoiceQueueId':_0x48f514[_0xdc00('0xdb')]||undefined,'CampaignId':_0x48f514[_0xdc00('0xdc')]||undefined})['catch'](loggerCatch(_0xdc00('0x127')));break;case 0x14:if(_0x48f514[_0xdc00('0x190')]>=_0x5e04f4[_0xdc00('0x19c')]-0x1){return!![];}hopperUtils[_0xdc00('0xd8')]({'active':![],'countagentrejectretry':_0x48f514[_0xdc00('0x190')]+=0x1,'scheduledat':moment()['add'](_0x5e04f4[_0xdc00('0x19d')],_0xdc00('0xec'))[_0xdc00('0x7d')](_0xdc00('0xca')),'ContactId':_0x48f514[_0xdc00('0xed')],'ListId':_0x48f514['ListId'],'VoiceQueueId':_0x48f514[_0xdc00('0xdb')]||undefined,'CampaignId':_0x48f514[_0xdc00('0xdc')]||undefined})['catch'](loggerCatch(_0xdc00('0x19e')));break;default:return!![];}};Dialer[_0xdc00('0x19')][_0xdc00('0x109')]=function(_0x12d445,_0x1f53dd,_0xb69e2){var _0x186dac=this;var _0x155225=new History(_0x12d445);var _0x1f3b69=![];var _0x28228f;var _0x482792;return new Promise(function(_0xa7b7b8,_0x1dd30a){if(_[_0xdc00('0x42')](_0x1f53dd)&&typeof _0x1f53dd!==_0xdc00('0x15a')){return _0x1dd30a(msgResponse(_0xdc00('0x19f'),_0xdc00('0x91'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0xb69e2)&&typeof _0xb69e2!==_0xdc00('0x15a')){return _0x1dd30a(msgResponse(_0xdc00('0x19f'),'Failure','evt\x20is\x20undefine'));}hopperUtils[_0xdc00('0xd5')](_0x155225,_0xb69e2['reason'],_0x1f53dd)[_0xdc00('0x9e')](function(_0xc121e0){if(_0xc121e0['additional']==0x1)_0x1f3b69=!![];switch(_0xb69e2[_0xdc00('0x1a0')]){case'0':_0x1f53dd['outboundNoSuchCallsDay']+=0x1;_0x155225[_0xdc00('0x70')]=0x0;_0x155225[_0xdc00('0x71')]=_0xdc00('0x1a1');_0x155225['countnosuchnumberretry']+=0x1;_0x155225['countglobal']+=0x1;ami['emit'](_0xdc00('0x1a2'),ut[_0xdc00('0x116')](_0x12d445,_0xdc00('0x1a3')));_0x28228f=_0x1f53dd[_0xdc00('0x19a')];_0x482792=_0x1f53dd[_0xdc00('0xe7')];hopperUtils[_0xdc00('0xc6')](_0x155225)[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x1a4')));if(_0x186dac['checkRetriveMax'](0x0,_0x12d445,_0x1f53dd)&&!_0x1f3b69){if(_0x155225[_0xdc00('0x12a')]>=_0x1f53dd[_0xdc00('0x199')]){_0x186dac[_0xdc00('0x124')](_0x155225,_0xa7b7b8,_0x1dd30a,'reason\x200\x20no\x20such\x20number....');}else{_0x186dac['stateGlobal'](_0x155225,_0xa7b7b8,_0x1dd30a,_0xdc00('0x1a5'));}}break;case'3':_0x1f53dd[_0xdc00('0x1a6')]+=0x1;_0x155225[_0xdc00('0x70')]=0x3;_0x155225[_0xdc00('0x71')]=_0xdc00('0x1a7');_0x155225[_0xdc00('0x11f')]+=0x1;_0x155225[_0xdc00('0xd3')]+=0x1;var _0xab5e47=ut[_0xdc00('0x1a8')](_0x12d445,_0x1f53dd);ami[_0xdc00('0x11c')](_0xdc00('0x1a9'),_0xab5e47);_0x28228f=_0x1f53dd[_0xdc00('0x191')];_0x482792=_0x1f53dd[_0xdc00('0xe7')];hopperUtils[_0xdc00('0xc6')](_0x155225)[_0xdc00('0xa2')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x186dac[_0xdc00('0x18f')](0x3,_0x12d445,_0x1f53dd)&&!_0x1f3b69){if(_0x155225[_0xdc00('0x11f')]>=_0x1f53dd['dialNoAnswerMaxRetry']){_0x186dac[_0xdc00('0x124')](_0x155225,_0xa7b7b8,_0x1dd30a,_0xdc00('0x1aa'));}else{_0x186dac[_0xdc00('0x122')](_0x155225,_0xa7b7b8,_0x1dd30a,_0xdc00('0x1aa'));}}break;case'5':_0x1f53dd[_0xdc00('0x1ab')]+=0x1;_0x155225[_0xdc00('0x70')]=0x5;_0x155225[_0xdc00('0x71')]=_0xdc00('0x1ac');_0x155225['countbusyretry']+=0x1;_0x155225['countglobal']+=0x1;ami[_0xdc00('0x11c')](_0xdc00('0x1ad'),ut[_0xdc00('0x116')](_0x12d445,_0xdc00('0x1ae')));_0x28228f=_0x1f53dd[_0xdc00('0x194')];_0x482792=_0x1f53dd[_0xdc00('0xe7')];hopperUtils[_0xdc00('0xc6')](_0x155225)[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x1af')));if(_0x186dac[_0xdc00('0x18f')](0x5,_0x12d445,_0x1f53dd)&&!_0x1f3b69){if(_0x155225[_0xdc00('0x11d')]>=_0x1f53dd[_0xdc00('0x193')]){_0x186dac[_0xdc00('0x124')](_0x155225,_0xa7b7b8,_0x1dd30a,'reason\x205\x20busy');}else{_0x186dac[_0xdc00('0x122')](_0x155225,_0xa7b7b8,_0x1dd30a,_0xdc00('0x1b0'));}}break;case'8':_0x1f53dd['outboundCongestionCallsDay']+=0x1;_0x155225[_0xdc00('0x70')]=0x8;_0x155225['statedesc']=_0xdc00('0x1b1');_0x155225[_0xdc00('0x11e')]+=0x1;_0x155225[_0xdc00('0xd3')]+=0x1;_0x28228f=_0x1f53dd['dialCongestionRetryFrequency'];_0x482792=_0x1f53dd[_0xdc00('0xe7')];ami[_0xdc00('0x11c')]('custom:agentcongestion',ut['buildObj'](_0x12d445,'congestion'));hopperUtils['createHistory'](_0x155225)[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x1b2')));if(_0x186dac['checkRetriveMax'](0x8,_0x12d445,_0x1f53dd)&&!_0x1f3b69){if(_0x155225[_0xdc00('0x11e')]>=_0x1f53dd['dialCongestionMaxRetry']){_0x186dac[_0xdc00('0x124')](_0x155225,_0xa7b7b8,_0x1dd30a,'reason\x208\x20congestion');}else{_0x186dac['stateGlobal'](_0x155225,_0xa7b7b8,_0x1dd30a,_0xdc00('0x1b3'));}}break;case'11':_0x1f53dd[_0xdc00('0x1b4')]+=0x1;_0x155225[_0xdc00('0x70')]=0xb;_0x155225['statedesc']=_0xdc00('0x1b5');_0x155225[_0xdc00('0xe6')]+=0x1;_0x155225[_0xdc00('0xd3')]+=0x1;_0x28228f=_0x1f53dd[_0xdc00('0xeb')];_0x482792=_0x1f53dd['callAdditionalPhoneAfterMin'];hopperUtils[_0xdc00('0xc6')](_0x155225)[_0xdc00('0xa2')](loggerCatch(_0xdc00('0xee')));if(_0x186dac[_0xdc00('0x18f')](0xb,_0x12d445,_0x1f53dd)&&!_0x1f3b69){if(_0x155225[_0xdc00('0xe6')]>=_0x1f53dd['dialAbandonedMaxRetry']){_0x186dac['createStateFinal'](_0x155225,_0xa7b7b8,_0x1dd30a,'reason\x2011\x20abandoned');}else{_0x186dac[_0xdc00('0x122')](_0x155225,_0xa7b7b8,_0x1dd30a,'reason\x2011\x20abandoned');}}break;case'20':_0x1f53dd['outboundRejectCallsDay']+=0x1;_0x155225[_0xdc00('0x70')]=0x14;_0x155225[_0xdc00('0x71')]=_0xdc00('0x1b6');_0x155225[_0xdc00('0x190')]+=0x1;_0x155225[_0xdc00('0xd3')]+=0x1;_0x28228f=_0x1f53dd[_0xdc00('0x19d')];_0x482792=_0x1f53dd['callAdditionalPhoneAfterMin'];ami[_0xdc00('0x11c')](_0xdc00('0x1b7'),ut['buildObj'](_0x12d445,_0xdc00('0x1b8')));hopperUtils[_0xdc00('0xc6')](_0x155225)[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x1b9')));if(_0x186dac[_0xdc00('0x18f')](0x14,_0x12d445,_0x1f53dd)&&!_0x1f3b69){if(_0x155225[_0xdc00('0x190')]>=_0x1f53dd[_0xdc00('0x19c')]){_0x186dac[_0xdc00('0x124')](_0x155225,_0xa7b7b8,_0x1dd30a,_0xdc00('0x1ba'));}else{_0x186dac['stateGlobal'](_0x155225,_0xa7b7b8,_0x1dd30a,_0xdc00('0x1ba'));}}break;default:_0x1f53dd[_0xdc00('0x130')]+=0x1;_0x155225[_0xdc00('0x70')]=0xc;_0x155225[_0xdc00('0x71')]=_0xb69e2[_0xdc00('0x1a0')];_0x28228f=_0x1f53dd[_0xdc00('0x19d')];_0x482792=_0x1f53dd[_0xdc00('0xe7')];hopperUtils[_0xdc00('0xc6')](_0x155225)['catch'](loggerCatch(_0xdc00('0x1bb')));if(_0x186dac[_0xdc00('0x18f')](_0xb69e2[_0xdc00('0x1a0')],_0x12d445,_0x1f53dd)&&!_0x1f3b69){if(_0x155225['countbusyretry']+_0x155225[_0xdc00('0x11e')]+_0x155225[_0xdc00('0x11f')]+_0x155225['countnosuchnumberretry']+_0x155225[_0xdc00('0xd2')]+_0x155225['countabandonedretry']+_0x155225[_0xdc00('0x120')]+_0x155225[_0xdc00('0x190')]>=_0x1f53dd['dialGlobalMaxRetry']){_0x186dac[_0xdc00('0x122')](_0x155225,_0xa7b7b8,_0x1dd30a,_0xb69e2[_0xdc00('0x1a0')]);}else{_0x186dac[_0xdc00('0x124')](_0x155225,_0xa7b7b8,_0x1dd30a,_0xb69e2['reason']);}}}})['then'](function(){if(_0x1f3b69){hopperUtils[_0xdc00('0xe2')](_0x155225,_0x28228f,_0x482792)['then'](function(){return _0xa7b7b8(0x1);});}});});};Dialer[_0xdc00('0x19')]['stateGlobal']=function(_0x366234,_0x321234,_0xe63639,_0x34c5ce){var _0x56327c=new Final(_0x366234);_0x56327c[_0xdc00('0x70')]=0xf;_0x56327c[_0xdc00('0x71')]=_0xdc00('0x1bc');this['createStateFinal'](_0x56327c,_0x321234,_0xe63639,_0x34c5ce);};Dialer[_0xdc00('0x19')][_0xdc00('0x124')]=function(_0x47f5eb,_0x1ffeb4,_0x184ee7,_0x10812d){hopperUtils[_0xdc00('0xc8')](_0x47f5eb)['then'](function(){return _0x1ffeb4(msgResponse('[callProgressDetecting]',_0xdc00('0x108'),_0x10812d));})[_0xdc00('0xa2')](function(){return _0x184ee7(msgResponse('[moveContactManagedDialer][0]',_0xdc00('0x91'),_0xdc00('0x1bd')));});};Dialer['prototype'][_0xdc00('0xa')]=function(_0xd9d91e){var _0xcdfcc4=_0xd9d91e[_0xdc00('0x1be')]/0x64;var _0x20218b=_0xd9d91e[_0xdc00('0xce')]/(_0xd9d91e[_0xdc00('0xce')]+_0xd9d91e['outboundAnswerCallsDay']);var _0x47a6b6=Math[_0xdc00('0x1bf')](_0xd9d91e['predictiveIntervalAvailable']*(_0xd9d91e[_0xdc00('0x1c0')]/0x64));var _0xeae30b=Math[_0xdc00('0x1bf')](_0xd9d91e[_0xdc00('0x1c1')]*(_0xd9d91e['predictiveIntervalMinThreshold']/0x64));var _0x1d4663=_0xd9d91e[_0xdc00('0x1c2')]+_0xd9d91e[_0xdc00('0x1c3')];var _0x43b8da=Math[_0xdc00('0x1c4')](_0xd9d91e[_0xdc00('0x1c5')]*_0xd9d91e[_0xdc00('0x5c')]*_0xd9d91e['predictiveIntervalHitRate']*_0xd9d91e[_0xdc00('0x1c6')]);if(_['isUndefined'](_0xd9d91e[_0xdc00('0x60')])){if(!_['isUndefined'](_0xd9d91e['startPredictive'])){_0xd9d91e['startPredictive']=undefined;loggerPredictive['error'](_0xdc00('0x1c7'),_0xdc00('0x1c8'));}if(!_[_0xdc00('0x42')](_0xd9d91e['handlePredictive'])){loggerPredictive[_0xdc00('0x64')](_0xdc00('0x1c7'),_0xdc00('0x1c9'));clearInterval(_0xd9d91e[_0xdc00('0x62')]);_0xd9d91e['handlePredictive']=undefined;}_0xd9d91e[_0xdc00('0x60')]=moment()['format'](_0xdc00('0xca'));loggerPredictive[_0xdc00('0x49')](_0xd9d91e[_0xdc00('0x47')],_0xdc00('0x1ca'),_0xd9d91e[_0xdc00('0x60')]);this[_0xdc00('0xb3')](_0xd9d91e,0x1);}else if(ifInterval(_0xd9d91e['dialPredictiveInterval'],_0xd9d91e[_0xdc00('0x60')])){this['handlePower'](_0xd9d91e,0x1);loggerPredictiveCalls[_0xdc00('0x49')](_0xdc00('0x1cb'),_0xd9d91e['startProgressive'],_0xd9d91e[_0xdc00('0x47')]);_0xd9d91e[_0xdc00('0x1c5')]=0x0;_0xd9d91e['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0xcdfcc4<_0x20218b&&_0xd9d91e[_0xdc00('0x1cc')]===_0xdc00('0x1cd')){clearPredictiveAttributes(_0xd9d91e);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x20218b,_0xdc00('0x60'),_0xd9d91e[_0xdc00('0x47')]);}else if(_0x43b8da<_0xd9d91e[_0xdc00('0xcf')]&&_0xd9d91e[_0xdc00('0x1cc')]==='dropRate'){clearPredictiveAttributes(_0xd9d91e);loggerPredictive[_0xdc00('0x49')](_0xdc00('0x1ce'),_0xdc00('0x1cf'),_0x43b8da,'Drop\x20in\x20this\x20interval',_0xd9d91e[_0xdc00('0xcf')],'startProgressive',_0xd9d91e['name']);}else if(!ifInterval(_0xd9d91e[_0xdc00('0x1d0')],_0xd9d91e[_0xdc00('0x60')])&&_['isUndefined'](_0xd9d91e[_0xdc00('0x27')])&&!_[_0xdc00('0x42')](_0xd9d91e['startProgressive'])){_0xd9d91e[_0xdc00('0x27')]=moment()[_0xdc00('0x7d')](_0xdc00('0xca'));loggerPredictive[_0xdc00('0x49')](_0xd9d91e[_0xdc00('0x47')],_0xdc00('0x1d1'),_0xd9d91e['startPredictive']);hopperUtils['avgHandleTime'](_0xd9d91e[_0xdc00('0x1d0')])[_0xdc00('0x9e')](this[_0xdc00('0x1d2')](_0xd9d91e))[_0xdc00('0x9e')](mergeDataErlangB(_0xd9d91e))[_0xdc00('0x9e')](this[_0xdc00('0x1d3')](_0xd9d91e))[_0xdc00('0xa2')](loggerCatchPredictive(_0xdc00('0x1d4'),_0xd9d91e));}else if(!ifInterval(_0xd9d91e['dialPredictiveInterval'],_0xd9d91e[_0xdc00('0x27')])){_0xd9d91e['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0xd9d91e['startPredictive']=moment()[_0xdc00('0x7d')](_0xdc00('0xca'));loggerPredictive[_0xdc00('0x49')](_0xd9d91e[_0xdc00('0x47')],_0xdc00('0x1d5'),_0xd9d91e[_0xdc00('0x27')]);clearInterval(_0xd9d91e[_0xdc00('0x62')]);_0xd9d91e[_0xdc00('0x62')]=undefined;hopperUtils[_0xdc00('0x1d6')](_0xd9d91e[_0xdc00('0x1d0')])[_0xdc00('0x9e')](this['getDataPredictive'](_0xd9d91e))[_0xdc00('0x9e')](mergeDataErlangB(_0xd9d91e))[_0xdc00('0x9e')](this[_0xdc00('0x1d3')](_0xd9d91e))[_0xdc00('0xa2')](loggerCatchPredictive(_0xdc00('0x1d7'),_0xd9d91e));}else if(_0xd9d91e[_0xdc00('0x1c1')]&&_0x1d4663<_0xd9d91e[_0xdc00('0x1c1')]-_0xeae30b){clearPredictiveAttributes(_0xd9d91e);loggerPredictive[_0xdc00('0x49')](_0xd9d91e[_0xdc00('0x47')],_0xdc00('0x1d8'),_0x1d4663,_0xdc00('0x1d9'),_0xd9d91e[_0xdc00('0x1c1')],'-',_0xeae30b,'=',_0xd9d91e[_0xdc00('0x1c1')]-_0xeae30b,')');}else if(_0xd9d91e[_0xdc00('0x1c1')]&&_0x1d4663>_0xd9d91e[_0xdc00('0x1c1')]+_0x47a6b6){clearPredictiveAttributes(_0xd9d91e);loggerPredictive[_0xdc00('0x49')](_0xd9d91e[_0xdc00('0x47')],_0xdc00('0x1d8'),_0x1d4663,_0xdc00('0x1da'),_0xd9d91e[_0xdc00('0x1c1')],'+',_0x47a6b6,'=',_0xd9d91e[_0xdc00('0x1c1')]+_0x47a6b6,')');}};Dialer[_0xdc00('0x19')][_0xdc00('0x1d2')]=function(_0x320da4){var _0x395285=this;return function(_0x3adc7d){return new Promise(function(_0x2c7288,_0xff55a9){_['merge'](_0x320da4,_0x3adc7d[0x0]);if(checkGetDataPredictive(_0x3adc7d[0x0])){var _0x332c01=_0x320da4['predictiveIntervalAvailable']=_0x320da4[_0xdc00('0x1c3')]+_0x320da4[_0xdc00('0x1c2')];var _0x117eb2=_0x320da4[_0xdc00('0x1d0')]*0x3c;var _0x28e35d=_0x3adc7d[0x0]['predictiveIntervalAvgTalktime']+_0x3adc7d[0x0][_0xdc00('0x55')];var _0x3cfb57=(_0x3adc7d[0x0][_0xdc00('0x4d')]+_0x3adc7d[0x0][_0xdc00('0x4f')]+_0x3adc7d[0x0][_0xdc00('0x50')])/_0x3adc7d[0x0][_0xdc00('0x4b')];_0x320da4[_0xdc00('0x1db')]=_0x3cfb57>0x0?_0x3cfb57:0x1;switch(_0x320da4[_0xdc00('0x1cc')]){case _0xdc00('0x1cd'):var _0x35cafd=_0x320da4[_0xdc00('0x1be')]/0x64;return _0x395285[_0xdc00('0x1dc')](_0x332c01,_0x117eb2,_0x28e35d,_0x3cfb57,_0x35cafd)[_0xdc00('0x9e')](function(_0x4099d5){return _0x2c7288(_0x4099d5);});case _0xdc00('0x1dd'):var _0x689108=_0x320da4[_0xdc00('0x1be')]/0x64;return _0x395285[_0xdc00('0x1de')](_0x332c01,_0x117eb2,_0x28e35d,_0x3cfb57,_0x689108)[_0xdc00('0x9e')](function(_0x25607c){return _0x2c7288(_0x25607c);});default:return _0xff55a9(msgResponse('[getDataPredictive]',_0xdc00('0x91'),_0xdc00('0x1df')));}}else{return _0xff55a9(msgResponse(_0xdc00('0x1e0'),_0xdc00('0x91'),_0xdc00('0x1e1')));}});};};Dialer[_0xdc00('0x19')][_0xdc00('0x1e2')]=function(_0x36491b){var _0x316ffe=this;return function(_0x5f4c77){return new Promise(function(_0xf74767,_0x1944f1){_['merge'](_0x36491b,_0x5f4c77[0x0]);if(checkGetDataPredictive(_0x5f4c77[0x0])){loggerPredictive[_0xdc00('0x49')](JSON['stringify'](_0x5f4c77[0x0]));if(_0x36491b[_0xdc00('0x1cc')]===_0xdc00('0x1cd')){return _0x316ffe[_0xdc00('0x14d')](_0x36491b['id'])['then'](function(_0x249d35){var _0x54901f=_0x36491b[_0xdc00('0x1e3')]-_0x249d35[0x0][_0xdc00('0x1e4')];var _0x3c747a=_0x36491b['dialPredictiveInterval']*0x3c;var _0x29d4fc=_0x5f4c77[0x0][_0xdc00('0x53')]+_0x5f4c77[0x0][_0xdc00('0x55')];var _0x43fb69=(_0x5f4c77[0x0][_0xdc00('0x4d')]+_0x5f4c77[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5f4c77[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5f4c77[0x0]['predictiveIntervalTotalCalls'];var _0x3b7857=_0x36491b[_0xdc00('0x1be')]/0x64;_0x36491b['predictiveIntervalPauses']=_0x249d35[0x0][_0xdc00('0x1e4')]||0x0;_0x36491b[_0xdc00('0x1db')]=_0x43fb69>0x0?_0x43fb69:0x1;return _0x316ffe['abandonmentRate'](_0x54901f,_0x3c747a,_0x29d4fc,_0x43fb69,_0x3b7857);})[_0xdc00('0x9e')](function(_0x49469b){return _0xf74767(_0x49469b);})[_0xdc00('0xa2')](function(_0x48e65c){return _0x1944f1(msgResponse(_0xdc00('0x1e5'),'Failure',JSON[_0xdc00('0x74')](_0x48e65c)));});}if(_0x36491b[_0xdc00('0x1cc')]===_0xdc00('0x1dd')){return _0x316ffe['getVoiceQueueRtPauses'](_0x36491b['id'])[_0xdc00('0x9e')](function(_0x22fb30){var _0x4bda57=_0x36491b['loggedIn']-_0x22fb30[0x0][_0xdc00('0x1e4')];var _0x2b5045=_0x36491b[_0xdc00('0x1d0')]*0x3c;var _0x17cb73=_0x5f4c77[0x0][_0xdc00('0x53')]+_0x5f4c77[0x0][_0xdc00('0x55')];var _0x3504dd=(_0x5f4c77[0x0]['predictiveIntervalAnsweredCalls']+_0x5f4c77[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5f4c77[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5f4c77[0x0][_0xdc00('0x4b')];var _0x573a41=_0x36491b[_0xdc00('0x1be')]/0x64;_0x36491b[_0xdc00('0x1e6')]=_0x22fb30[0x0]['outboundQueuePauses']||0x0;_0x36491b[_0xdc00('0x1db')]=_0x3504dd>0x0?_0x3504dd:0x1;return _0x316ffe[_0xdc00('0x1de')](_0x4bda57,_0x2b5045,_0x17cb73,_0x3504dd,_0x573a41);})['then'](function(_0x4839dd){return _0xf74767(_0x4839dd);})['catch'](function(_0x23ae28){return _0x1944f1(msgResponse(_0xdc00('0x1e5'),'Failure',JSON['stringify'](_0x23ae28)));});}}else{return _0x1944f1(msgResponse('[getDataPredictive]','Failure',_0xdc00('0x1e1')));}});};};Dialer[_0xdc00('0x19')][_0xdc00('0x1d3')]=function(_0x31a818){var _0x216e22=this;return function(){var _0x189f59=0x0;var _0x5c904a=Math[_0xdc00('0x1c4')](_0x31a818[_0xdc00('0x1e7')]*0x3e8);if(_0x5c904a>0x0){_0x5c904a=_0x5c904a<0x64?0x64:_0x5c904a;loggerPredictive['info'](_0x31a818[_0xdc00('0x47')],'one\x20call\x20every:',_0x5c904a,_0xdc00('0x1e8'));_0x31a818['handlePredictive']=setInterval(function(){_0x216e22[_0xdc00('0x62')](_0x31a818);loggerPredictiveCalls[_0xdc00('0x49')](_0xdc00('0x1e9'),_0x189f59+=0x1);},_0x5c904a);}else{loggerPredictive[_0xdc00('0x49')](_0x31a818[_0xdc00('0x47')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0xdc00('0x1ea')]=function(_0x346f92,_0x32dd3b){var _0x15c449=this;return function(_0x5dc333){if(_['isEmpty'](_0x5dc333)){if(_[_0xdc00('0xf4')](_0x32dd3b[_0xdc00('0x153')])||!_0x32dd3b[_0xdc00('0x1eb')]){if(_0x346f92[_0xdc00('0xb1')]==='booked'){_0x346f92['queueStatusComplete']=_[_0xdc00('0x42')](_0x346f92[_0xdc00('0x72')])?!![]:_0x346f92[_0xdc00('0x72')];var _0x24aeb1=uuid['v4']();_0x15c449[_0xdc00('0x23')][_0x24aeb1]=new Action(_0x346f92,_0x32dd3b,_0x24aeb1);loggerBooked[_0xdc00('0x49')](_0xdc00('0x1ec'),_0x24aeb1,_0xdc00('0x1ed'),JSON['stringify'](_0x346f92['queueStatusComplete']),_0xdc00('0x1ee'),_0x346f92[_0xdc00('0x47')]);if(_0x346f92[_0xdc00('0x72')]){_0x346f92['queueStatusComplete']=![];_0x15c449[_0xdc00('0x29')][_0x15c449[_0xdc00('0x23')][_0x24aeb1][_0xdc00('0xbc')]]=[];ami[_0xdc00('0x183')]({'actionid':_0x24aeb1,'action':_0xdc00('0x1ef'),'queue':_0x346f92[_0xdc00('0x47')]})['catch'](function(){_0x15c449[_0xdc00('0xc0')](_0x346f92);hopperUtils[_0xdc00('0xd8')]({'active':![],'ContactId':_0x15c449[_0xdc00('0x23')][_0x24aeb1][_0xdc00('0xed')],'ListId':_0x15c449[_0xdc00('0x23')][_0x24aeb1][_0xdc00('0xda')],'VoiceQueueId':_0x15c449['actions'][_0x24aeb1]['VoiceQueueId']||undefined,'CampaignId':_0x15c449['actions'][_0x24aeb1][_0xdc00('0xdc')]||undefined})[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x1f0')));delete _0x15c449[_0xdc00('0x23')][_0x24aeb1];});}else{loggerBooked[_0xdc00('0x49')](_0xdc00('0x1f1'),JSON['stringify'](_0x346f92['queueStatusComplete']),'Queue:\x20',_0x346f92[_0xdc00('0x47')]);_0x15c449[_0xdc00('0xc0')](_0x346f92);hopperUtils[_0xdc00('0xd8')]({'active':![],'ContactId':_0x15c449['actions'][_0x24aeb1][_0xdc00('0xed')],'ListId':_0x15c449[_0xdc00('0x23')][_0x24aeb1][_0xdc00('0xda')],'VoiceQueueId':_0x15c449[_0xdc00('0x23')][_0x24aeb1][_0xdc00('0xdb')]||undefined,'CampaignId':_0x15c449[_0xdc00('0x23')][_0x24aeb1][_0xdc00('0xdc')]||undefined})[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x1f0')));delete _0x15c449['actions'][_0x24aeb1];}}else{return _0x15c449[_0xdc00('0x159')](_0x346f92,_0x32dd3b);}}else{if(utils['getSeconds'](undefined,_0x32dd3b[_0xdc00('0x1f2')])<_0x346f92['dialRecallMeTimeout']*0x3c){if(_0x32dd3b['Agent']&&!_0x32dd3b[_0xdc00('0x144')]['voicePause']){_0x15c449[_0xdc00('0x1c')][_0xdc00('0xf8')](_0x32dd3b['id'])[_0xdc00('0xfb')](function(){_0x15c449[_0xdc00('0xc0')](_0x346f92);});}else{hopperUtils[_0xdc00('0x1f3')]({'active':![]},_0x32dd3b['id'],0x1)['finally'](function(){_0x15c449[_0xdc00('0xc0')](_0x346f92);});}}else{_0x346f92[_0xdc00('0x1f4')]+=0x1;_0x15c449[_0xdc00('0xc0')](_0x346f92);if(_0x346f92[_0xdc00('0x1f5')]){hopperUtils[_0xdc00('0xd8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x32dd3b[_0xdc00('0xed')],'ListId':_0x32dd3b[_0xdc00('0xda')],'VoiceQueueId':_0x32dd3b[_0xdc00('0xdb')]||undefined,'CampaignId':_0x32dd3b[_0xdc00('0xdc')]||undefined})[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x1f6')));hopperUtils['createHistory'](createObjHistory(_0x346f92,_0x32dd3b,utils[_0xdc00('0x6a')]['QUEUE_RECALL'],0x17,'RecallInQueue'))[_0xdc00('0xa2')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x15c449[_0xdc00('0x118')](createObjHistory(_0x346f92,_0x32dd3b,utils['CAMPAIGN_STATUS'][_0xdc00('0x1f7')],0x16,'RecallFailedTimeout'),_0xdc00('0x1f8'),_0xdc00('0x1f9'));}}}}else{_0x346f92[_0xdc00('0x1fa')]+=0x1;_0x15c449[_0xdc00('0x118')](createObjHistory(_0x346f92,_0x32dd3b,utils[_0xdc00('0x6a')][_0xdc00('0x1fb')],0xd,_0xdc00('0x1fc')),_0xdc00('0x1fd'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0xdc00('0x19')]['handleIvr']=function(_0xeea8ea){var _0x3862ef=this;var _0x2bb522=_0xeea8ea[_0xdc00('0x1fe')]-_0xeea8ea[_0xdc00('0x7f')];emitCampaignSummary(_0xeea8ea);if(_0x2bb522>0x0&&_0xeea8ea[_0xdc00('0x67')]==0x0){if(_0x2bb522>this[_0xdc00('0x21')]){_0x2bb522=this[_0xdc00('0x21')];}_0xeea8ea[_0xdc00('0x67')]=0x1;hopperUtils['getContactDialerIvr'](_0xeea8ea,_0x2bb522)['then'](function(_0xeeb59b){_0xeea8ea[_0xdc00('0x67')]=0x0;if(_0xeeb59b){if(!utils['checkContactEmpty'](_0xeeb59b)){_0xeea8ea['message']=utils[_0xdc00('0x6a')][_0xdc00('0x6e')];logger[_0xdc00('0x49')](_0xdc00('0x1ff')+_0xeea8ea[_0xdc00('0x47')]);}else{_0xeea8ea[_0xdc00('0x7f')]+=_0xeeb59b[_0xdc00('0x99')];_0xeea8ea[_0xdc00('0x69')]=utils[_0xdc00('0x6a')]['RUNNING'];for(var _0x5dc41d=0x0;_0x5dc41d<_0xeeb59b[_0xdc00('0x99')];_0x5dc41d+=0x1){_0xeea8ea[_0xdc00('0x200')]+=0x1;if(_[_0xdc00('0xf4')](_0xeeb59b[_0x5dc41d])||_[_0xdc00('0xf4')](_0xeeb59b[_0x5dc41d][_0xdc00('0x176')])||_[_0xdc00('0xf4')](_0xeeb59b[_0x5dc41d]['phone'])){_0x3862ef['emptyContact'](_0xdc00('0x201'),_0xeea8ea,_0xeeb59b[_0x5dc41d]);}else{hopperUtils[_0xdc00('0x202')](_['pick'](_0xeeb59b[_0x5dc41d],[_0xdc00('0xdc'),_0xdc00('0x15c')]))[_0xdc00('0x9e')](_0x3862ef[_0xdc00('0x1ea')](_0xeea8ea,_0xeeb59b[_0x5dc41d]))[_0xdc00('0xa2')](_0x3862ef[_0xdc00('0x150')](_0xdc00('0x203'),_0xeea8ea));}}}}})[_0xdc00('0xa2')](loggerGetContactDialer(_0xdc00('0x204'),_0xeea8ea,_0x2bb522));}};Dialer[_0xdc00('0x19')]['handlePower']=function(_0x1f89b1,_0x2aa6bd){var _0x4fce7a=this;var _0x2f48f4=[];if(_0x2aa6bd<0x1||_0x1f89b1[_0xdc00('0xb1')]===_0xdc00('0x9')){_0x2aa6bd=0x1;}var _0x8e340d=Math[_0xdc00('0x1c4')](_0x1f89b1[_0xdc00('0x1c2')]*_0x2aa6bd)-_0x1f89b1['originated'];if(_0x1f89b1[_0xdc00('0x205')]>0x0){var _0x4186b3=_0x1f89b1[_0xdc00('0x205')]-_0x1f89b1[_0xdc00('0x7f')]-_0x1f89b1[_0xdc00('0x1c3')]-_0x1f89b1[_0xdc00('0x206')];if(_0x8e340d>_0x4186b3){_0x8e340d=_0x4186b3;}}if(_0x8e340d>0x0&&_0x1f89b1['temp']==0x0){if(_0x1f89b1[_0xdc00('0xb1')]===_0xdc00('0x9')){_0x8e340d=0x1;}if(_0x8e340d>this['maxNumberOriginate']){_0x8e340d=this[_0xdc00('0x21')];}for(var _0x5ab703 in this[_0xdc00('0x1f')]){if(typeof this['agents'][_0x5ab703]!==_0xdc00('0xab')){if(this[_0xdc00('0x1f')][_0x5ab703][_0xdc00('0x70')]===_0xdc00('0x207')&&this[_0xdc00('0x1f')][_0x5ab703][_0xdc00('0x8a')]===_0xdc00('0x89')){_0x2f48f4[_0xdc00('0x9a')](this[_0xdc00('0x1f')][_0x5ab703]['id']);}}}_0x1f89b1[_0xdc00('0x67')]=0x1;hopperUtils['getContactDialer'](_0x1f89b1,_0x2f48f4,_0x8e340d)[_0xdc00('0x9e')](function(_0x539d14){_0x1f89b1['temp']=0x0;if(_0x539d14){if(!utils[_0xdc00('0x208')](_0x539d14)){hopperUtils[_0xdc00('0x209')](_0x1f89b1)['then'](sendMessageReschedule(_0x1f89b1))[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x20a')));}else{_0x1f89b1[_0xdc00('0x7f')]+=_0x539d14['length'];_0x1f89b1[_0xdc00('0x69')]=_0x1f89b1[_0xdc00('0xb1')]===_0xdc00('0x9')?utils[_0xdc00('0x6a')]['ACTIVE']:utils[_0xdc00('0x6a')][_0xdc00('0x20b')];for(var _0x5e4c81=0x0;_0x5e4c81<_0x539d14[_0xdc00('0x99')];_0x5e4c81+=0x1){if(_[_0xdc00('0xf4')](_0x539d14[_0x5e4c81])||_[_0xdc00('0xf4')](_0x539d14[_0x5e4c81][_0xdc00('0x176')])||_[_0xdc00('0xf4')](_0x539d14[_0x5e4c81][_0xdc00('0x15c')])){_0x4fce7a['emptyContact']('[actionOriginate]\x20',_0x1f89b1,_0x539d14[_0x5e4c81]);}else{hopperUtils[_0xdc00('0x20c')](_[_0xdc00('0x75')](_0x539d14[_0x5e4c81],[_0xdc00('0xdb'),_0xdc00('0x15c')]))['then'](_0x4fce7a[_0xdc00('0x1ea')](_0x1f89b1,_0x539d14[_0x5e4c81]))[_0xdc00('0xa2')](_0x4fce7a[_0xdc00('0x150')](_0xdc00('0x201'),_0x1f89b1));}}}}})[_0xdc00('0xa2')](loggerGetContactDialer(_0xdc00('0x20d'),_0x1f89b1,_0x8e340d));}};Dialer['prototype'][_0xdc00('0x62')]=function(_0x5edf37){if(_0x5edf37['dialLimitQueue']>0x0){var _0x3a2a1a=_0x5edf37['dialLimitQueue']-_0x5edf37[_0xdc00('0x7f')]-_0x5edf37['talking'];if(_0x3a2a1a>0x0&&_0x5edf37[_0xdc00('0x67')]==0x0){this[_0xdc00('0x20e')](_0x5edf37);}else{loggerPredictiveCalls[_0xdc00('0x49')](_0xdc00('0x20f'));}}else{this['tryOriginatePredictive'](_0x5edf37);}};Dialer['prototype'][_0xdc00('0x20e')]=function(_0x147584){var _0x498a6d=this;var _0x9f1567=[];_0x147584['originated']+=0x1;for(var _0x2562d7 in this['agents']){if(typeof this[_0xdc00('0x1f')][_0x2562d7]!==_0xdc00('0xab')){if(this[_0xdc00('0x1f')][_0x2562d7][_0xdc00('0x70')]===_0xdc00('0x207')&&this[_0xdc00('0x1f')][_0x2562d7][_0xdc00('0x8a')]==='reachable'){_0x9f1567[_0xdc00('0x9a')](this['agents'][_0x2562d7]['id']);}}}_0x147584[_0xdc00('0x67')]=0x1;return this['getContactDialer'](_0x147584['id'],_0x9f1567,0x1,_0x147584[_0xdc00('0x210')],_0x147584)['then'](function(_0x3683c7){_0x147584[_0xdc00('0x67')]=0x1;if(_0x3683c7){if(!utils['checkContactEmpty'](_0x3683c7)){utils[_0xdc00('0x66')](_0x147584,0x1,0x0);return hopperUtils[_0xdc00('0x209')](_0x147584)[_0xdc00('0x9e')](sendMessageReschedule(_0x147584))[_0xdc00('0xa2')](loggerCatch(_0xdc00('0x20a')));}else{_0x147584[_0xdc00('0x69')]=utils['CAMPAIGN_STATUS'][_0xdc00('0x20b')];if(_['isNil'](_0x3683c7[0x0])||_['isNil'](_0x3683c7[0x0][_0xdc00('0x176')])||_['isNil'](_0x3683c7[0x0]['phone'])){_0x498a6d[_0xdc00('0x151')]('[actionOriginate]\x20',_0x147584,_0x3683c7[0x0]);}else{return hopperUtils[_0xdc00('0x20c')](_[_0xdc00('0x75')](_0x3683c7[0x0],['VoiceQueueId',_0xdc00('0x15c')]))[_0xdc00('0x9e')](_0x498a6d[_0xdc00('0x1ea')](_0x147584,_0x3683c7[0x0]))['catch'](_0x498a6d[_0xdc00('0x150')](_0xdc00('0x211'),_0x147584));}}}})[_0xdc00('0xa2')](loggerGetContactDialer(_0xdc00('0x212'),_0x147584,0x1));};Dialer['prototype'][_0xdc00('0x1dc')]=function(_0x2337ab,_0x1c9677,_0x17bd4b,_0x109edc,_0x1bc573,_0x4eeef2){loggerPredictive[_0xdc00('0x49')](_0xdc00('0x213'));loggerPredictive[_0xdc00('0x49')](_0xdc00('0x214'),_0x2337ab);loggerPredictive[_0xdc00('0x49')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1c9677);loggerPredictive[_0xdc00('0x49')]('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',_0x17bd4b);loggerPredictive['info'](_0xdc00('0x215'),_0x109edc);loggerPredictive[_0xdc00('0x49')](_0xdc00('0x216'),_0x1bc573);loggerPredictive['info']('---------------------------');return new Promise(function(_0x186925,_0x554b59){if(_0x2337ab<=0x0||isNaN(_0x2337ab)){return _0x554b59(msgResponse(_0xdc00('0x217'),_0xdc00('0x85'),'m\x20=\x20'+_0x2337ab));}if(_0x17bd4b<=0x0||isNaN(_0x17bd4b)){return _0x554b59(msgResponse('[abandonmentRate]',_0xdc00('0x85'),_0xdc00('0x218')+_0x17bd4b));}if(_0x109edc<=0x0||isNaN(_0x109edc)){return _0x554b59(msgResponse(_0xdc00('0x217'),_0xdc00('0x85'),_0xdc00('0x219')+_0x109edc));}if(_0x1c9677<=0x0||isNaN(_0x1c9677)){return _0x554b59(msgResponse(_0xdc00('0x217'),_0xdc00('0x85'),_0xdc00('0x21a')+_0x1c9677));}if(_0x1bc573<=0x0||isNaN(_0x1bc573)){return _0x554b59(msgResponse(_0xdc00('0x217'),_0xdc00('0x85'),'Amax\x20=\x20'+_0x1bc573));}_0x4eeef2=_0x4eeef2||0x0;var _0x529bf8=0x1/_0x17bd4b;var _0x57a591=0x0;var _0x2f380b=0x0;var _0x231ed2=0x0;var _0x51938b=0x0;for(var _0x124590=0x0;_0x231ed2<_0x1bc573;_0x124590+=0x1){_0x2f380b=_0x124590/_0x1c9677;_0x57a591=(_0x109edc*_0x2f380b+_0x4eeef2)/_0x529bf8;_0x231ed2=utils[_0xdc00('0x21b')](_0x57a591,_0x2337ab);_0x51938b=_0x57a591/_0x2337ab*(0x1-utils[_0xdc00('0x21b')](_0x57a591,_0x2337ab));}return _0x186925({'erlangCalls':_0x124590,'erlangCallToSecond':_0x1c9677/_0x124590,'erlangAbandonmentRate':_0x231ed2,'erlangBusyFactor':_0x51938b});});};Dialer['prototype'][_0xdc00('0x1de')]=function(_0x44d453,_0x3ae68e,_0x5a8ffa,_0x294830,_0x59a259,_0xf81c59){loggerPredictive['info'](_0xdc00('0x21c'));loggerPredictive[_0xdc00('0x49')](_0xdc00('0x214'),_0x44d453);loggerPredictive['info'](_0xdc00('0x21d'),_0x3ae68e);loggerPredictive[_0xdc00('0x49')](_0xdc00('0x21e'),_0x5a8ffa);loggerPredictive['info'](_0xdc00('0x215'),_0x294830);loggerPredictive[_0xdc00('0x49')](_0xdc00('0x21f'),_0x59a259);loggerPredictive['info'](_0xdc00('0x54'));return new Promise(function(_0x15498d,_0x2584b2){if(_0x44d453<=0x0||isNaN(_0x44d453)){return _0x2584b2(msgResponse(_0xdc00('0x220'),_0xdc00('0x85'),_0xdc00('0x221')+_0x44d453));}if(_0x5a8ffa<=0x0||isNaN(_0x5a8ffa)){return _0x2584b2(msgResponse(_0xdc00('0x220'),_0xdc00('0x85'),_0xdc00('0x218')+_0x5a8ffa));}if(_0x294830<=0x0||isNaN(_0x294830)){return _0x2584b2(msgResponse(_0xdc00('0x220'),_0xdc00('0x85'),'p\x20=\x20'+_0x294830));}if(_0x3ae68e<=0x0||isNaN(_0x3ae68e)){return _0x2584b2(msgResponse('[busyFactor]',_0xdc00('0x85'),_0xdc00('0x21a')+_0x3ae68e));}if(_0x59a259<=0x0||isNaN(_0x59a259)){return _0x2584b2(msgResponse('[busyFactor]',_0xdc00('0x85'),_0xdc00('0x222')+_0x59a259));}_0xf81c59=_0xf81c59||0x0;var _0x5685f6=0x1/_0x5a8ffa;var _0x5e78ab=0x0;var _0x511f0b=0x0;var _0xd78bfd=0x0;var _0x5158cd=0x0;for(var _0x42818d=0x0;_0x5158cd<_0x59a259;_0x42818d+=0x1){_0x511f0b=_0x42818d/_0x3ae68e;_0x5e78ab=(_0x294830*_0x511f0b+_0xf81c59)/_0x5685f6;_0xd78bfd=utils[_0xdc00('0x21b')](_0x5e78ab,_0x44d453);_0x5158cd=_0x5e78ab/_0x44d453*(0x1-utils[_0xdc00('0x21b')](_0x5e78ab,_0x44d453));}return _0x15498d({'erlangCalls':_0x42818d,'erlangCallToSecond':_0x3ae68e/_0x42818d,'erlangAbandonmentRate':_0xd78bfd,'erlangBusyFactor':_0x5158cd});});};module[_0xdc00('0x223')]=Dialer; \ No newline at end of file +var _0xc13c=['response','Success','callProgressDetecting','variable','amdstatus','exten','xcally-motion-dialer','outboundAnswerAgiCallsDay','HangupInAMD','membername','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','value','MACHINE','Machine','countmachineretry','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','HANGUP','[syncHangupInAMDIvr]','AMD','countnosuchnumberretry','reason19\x20machine....','dialMachineMaxRetry','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','moveContactManagedDialer','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','inUse','talking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','assign','filter','dialPreviewRecallmeReminder','online','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','enqueue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','UserId','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','handlePreviewRecallNotifications','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','XMD-AMDINITIALSILENCE','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','setXMDContactVariables','Contact','getCallerId','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','TrunkBackup','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originate][error]','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','busy','dialBusyMaxRetry','outboundCongestionCallsDay','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','predictiveIntervalErlangCallsDroppedCalls','dropRate','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','avgHandleTime','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','predictiveIntervalAvailable','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','loggedIn','predictiveIntervalDroppedCallsTimeout','predictiveIntervalPauses','outboundQueuePauses','[CatchErlangB]','erlangCallToSecond','one\x20call\x20every:','milliseconds','[handlePredictive]','checkContactBlack','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','NO_AVAILABLE_CONTACTS','RUNNING','loggerHandler','[actionOriginateIvr]\x20','available','dialLimitQueue','not_inuse','countReScheduled','[actionOriginate]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','[countReScheduled]\x20','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','p\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','lodash','uuid','moment','ioredis','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/interval','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','XCALLY_IP_AGI','127.0.0.1','prototype','tail','sequence','preview','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','queuesSummary','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','syncNewExten','queuemember','syncQueueMember','loopCampaigns','loopClearZombieChannels','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','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','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','merge','getSeconds','startProgressive','name','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','CAMPAIGN_STATUS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','stringify','pick','Interval','\x20INTERVAL_IS_NULL','Intervals','NULL_INTERVAL','INACTIVE','\x20NOT\x20Active','isIVRCampaign','sendMessageOneNotActive','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','reachable','status','unmonitored','checkIsTrunkReachable','Trunk','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','Failure','ifTime','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','interval','then','content','catch','iftime\x20%s,%s','indexOf','true','all','some','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','isIVRCampaignActive','resolve','dialGlobalInterval','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','method\x20not\x20recognized','silly','intervalIftime','OVERTIME_GLOBAL_INTERVAL','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','voiceQueues','uniqueid','ivr','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','queue','outboundAnswerCallsDay','agiafterat','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','[syncAgentComplete]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','countdropretry','callAdditionalPhoneAfterMin','voiceQueue','dialDropMaxRetry','queueCallerAbandonCreateState','additional','add','dialDropRetryFrequency','minutes','ContactId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','Abandoned','CALLEREXIT','countglobal','dialAbandonedMaxRetry','rescheduleContact','countabandonedretry','ListId','actions','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','queueBooked','idHopper','run','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','finally','[booked][RR][finaly]','VoiceQueueId','[unlock3][syncQueueStatusComplete]','getQueue'];(function(_0x231037,_0x1de3a7){var _0x3b6654=function(_0x592f94){while(--_0x592f94){_0x231037['push'](_0x231037['shift']());}};_0x3b6654(++_0x1de3a7);}(_0xc13c,0x113));var _0xcc13=function(_0x28912c,_0x217d87){_0x28912c=_0x28912c-0x0;var _0xc1d854=_0xc13c[_0x28912c];return _0xc1d854;};'use strict';var util=require('util');var _=require(_0xcc13('0x0'));var uuid=require(_0xcc13('0x1'));var moment=require(_0xcc13('0x2'));var rr=require('rr');var Redis=require(_0xcc13('0x3'));var utils=require('./utils');var hopperUtils=require(_0xcc13('0x4'));var ut=require(_0xcc13('0x5'));var config=require(_0xcc13('0x6'));var logger=require(_0xcc13('0x7'))('dialer');var loggerBooked=require(_0xcc13('0x7'))(_0xcc13('0x8'));var loggerPredictive=require(_0xcc13('0x7'))(_0xcc13('0x9'));var loggerPredictiveCalls=require(_0xcc13('0x7'))(_0xcc13('0xa'));var loggerSyncQueueSummary=require(_0xcc13('0x7'))('syncQueueSummary');var ami=require(_0xcc13('0xb'));config[_0xcc13('0xc')]=_[_0xcc13('0xd')](config[_0xcc13('0xc')],{'host':_0xcc13('0xe'),'port':0x18eb});var io=require(_0xcc13('0xf'))(new Redis(config['redis']));var cmHopper=require(_0xcc13('0x10'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Interval=require(_0xcc13('0x11'));var Action=require('./models/action');var History=require('./models/history');var Final=require(_0xcc13('0x12'));var AgentComplete=require(_0xcc13('0x13'));var QueueCallerAbandon=require(_0xcc13('0x14'));var Hangup=require(_0xcc13('0x15'));var ipAgi=process['env'][_0xcc13('0x16')]||_0xcc13('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xcc13('0x18')]['enqueue']=function(_0x1e97a7){this[_0xcc13('0x19')]=this['tail']?this[_0xcc13('0x19')]['finally'](_0x1e97a7):_0x1e97a7();};function Dialer(_0x339fd2,_0x553ee0){this[_0xcc13('0x1a')]=new Sequence();this[_0xcc13('0x1b')]=_0x553ee0;this['voiceQueues']=_0x339fd2['voiceQueues'];this[_0xcc13('0x1c')]=_0x339fd2[_0xcc13('0x1c')];this[_0xcc13('0x1d')]=_0x339fd2[_0xcc13('0x1d')];this['trunks']=_0x339fd2[_0xcc13('0x1e')];this['maxNumberOriginate']=config[_0xcc13('0x1f')]||0x2;this[_0xcc13('0x20')]={};this['actions']={};this[_0xcc13('0x21')]={};this[_0xcc13('0x22')]={};this[_0xcc13('0x23')]={};this[_0xcc13('0x24')]={};this['startProgressive']={};this['ivrOriginated']={};this['queueBooked']={};this['queueBookedRR']={};this[_0xcc13('0x25')]={};ami['on']('agentconnect',this[_0xcc13('0x26')][_0xcc13('0x27')](this));ami['on'](_0xcc13('0x28'),this[_0xcc13('0x29')][_0xcc13('0x27')](this));ami['on']('originateresponse',this[_0xcc13('0x2a')][_0xcc13('0x27')](this));ami['on'](_0xcc13('0x2b'),this[_0xcc13('0x2c')][_0xcc13('0x27')](this));ami['on']('custom:queuesummary',this[_0xcc13('0x2d')][_0xcc13('0x27')](this));ami['on'](_0xcc13('0x2e'),this[_0xcc13('0x2f')][_0xcc13('0x27')](this));ami['on']('hangup',this[_0xcc13('0x30')][_0xcc13('0x27')](this));ami['on'](_0xcc13('0x31'),this[_0xcc13('0x32')][_0xcc13('0x27')](this));ami['on']('varset',this['syncVarSet'][_0xcc13('0x27')](this));ami['on'](_0xcc13('0x33'),this[_0xcc13('0x34')]['bind'](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0xcc13('0x27')](this));this[_0xcc13('0x35')]();this[_0xcc13('0x36')]();RpcSetting['getSettings']()['then'](function(_0x3e55ac){previewRecallmeReminderInterval=_0x3e55ac[_0xcc13('0x37')];});}function isNotNull(_0x94e9b6){return _0x94e9b6!==null&&!_[_0xcc13('0x38')](_0x94e9b6);}function msgResponse(_0x437873,_0x2292fa,_0x168366){return{'action':_0x437873,'response':_0x2292fa,'message':_0x168366,'stack':_0x168366};}function emit(_0x2a007a,_0xaf7a9f,_0x446129){io['to'](_0x2a007a)[_0xcc13('0x39')](_0xaf7a9f,_0x446129);}function emitOutboundVoiceQueueSummary(_0x3ea70e){if(_0x3ea70e[_0xcc13('0x3a')]===_0xcc13('0x3b')){logger[_0xcc13('0x3c')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0xcc13('0x3d')](_0x3ea70e,{'showHidden':![],'depth':null}));emit(util[_0xcc13('0x3e')](_0xcc13('0x3f'),_0x3ea70e['name']),_0xcc13('0x40'),_0x3ea70e);}}function checkGetDataPredictive(_0x28553f){if(isNotNull(_0x28553f)&&!_[_0xcc13('0x41')](_0x28553f)){loggerPredictive[_0xcc13('0x42')](_0xcc13('0x43'));loggerPredictive[_0xcc13('0x42')](_0xcc13('0x44'),_0x28553f['predictiveIntervalTotalCalls']);loggerPredictive[_0xcc13('0x42')](_0xcc13('0x45'),_0x28553f[_0xcc13('0x46')]);loggerPredictive[_0xcc13('0x42')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x28553f['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xcc13('0x42')](_0xcc13('0x47'),_0x28553f['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xcc13('0x42')](_0xcc13('0x48'),_0x28553f[_0xcc13('0x49')]);loggerPredictive['info'](_0xcc13('0x4a'),_0x28553f[_0xcc13('0x4b')]);loggerPredictive[_0xcc13('0x42')](_0xcc13('0x4c'));if(_0x28553f[_0xcc13('0x4d')]>0x0){if(!_[_0xcc13('0x38')](_0x28553f['predictiveIntervalAvgTalktime'])&&_0x28553f[_0xcc13('0x4b')]>0x0){return!![];}loggerPredictive[_0xcc13('0x42')](_0xcc13('0x4e'));if(!_['isUndefined'](_0x28553f[_0xcc13('0x49')])&&_0x28553f[_0xcc13('0x49')]>0x0){return!![];}loggerPredictive[_0xcc13('0x42')](_0xcc13('0x4f'));}else{loggerPredictive[_0xcc13('0x42')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info'](_0xcc13('0x50'));}return![];}function mergeDataErlangB(_0x53fa9e){return function(_0x3ac8ec){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0xcc13('0x42')](_0xcc13('0x51'),_0x3ac8ec[_0xcc13('0x52')]);loggerPredictive[_0xcc13('0x42')](_0xcc13('0x53'),_0x3ac8ec['erlangCallToSecond']);loggerPredictive[_0xcc13('0x42')](_0xcc13('0x54'),_0x3ac8ec[_0xcc13('0x55')]);loggerPredictive[_0xcc13('0x42')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3ac8ec[_0xcc13('0x56')]);loggerPredictive[_0xcc13('0x42')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3ac8ec['erlangAbandonmentRate']);loggerPredictive['info']('---------------------------');_[_0xcc13('0x57')](_0x53fa9e,_0x3ac8ec);};}function ifInterval(_0x469621,_0x481eb4){if(_[_0xcc13('0x38')](_0x481eb4)){return![];}return utils[_0xcc13('0x58')](undefined,_0x481eb4)<_0x469621*0x3c;}function clearPredictiveAttributes(_0x5d50f3){if(_0x5d50f3[_0xcc13('0x59')]){_0x5d50f3[_0xcc13('0x59')]=undefined;loggerPredictive['debug'](_0x5d50f3[_0xcc13('0x5a')],_0xcc13('0x5b'));}if(_0x5d50f3['startPredictive']){_0x5d50f3[_0xcc13('0x24')]=undefined;loggerPredictive[_0xcc13('0x3c')](_0x5d50f3[_0xcc13('0x5a')],_0xcc13('0x5c'));}if(_0x5d50f3[_0xcc13('0x5d')]){clearInterval(_0x5d50f3['handlePredictive']);_0x5d50f3[_0xcc13('0x5d')]=undefined;loggerPredictive[_0xcc13('0x3c')](_0x5d50f3['name'],_0xcc13('0x5e'));}}function loggerCatchPredictive(_0x51651d,_0x11686a){return function(_0x6e116d){loggerPredictive[_0xcc13('0x5f')](_0x11686a[_0xcc13('0x5a')],_0x51651d);loggerPredictive[_0xcc13('0x5f')](_0x6e116d[_0xcc13('0x60')]);clearPredictiveAttributes(_0x11686a);};}function loggerCatch(_0x38adf3){return function(_0x1f23ab){logger[_0xcc13('0x5f')](_0x38adf3,util[_0xcc13('0x3d')](_0x1f23ab,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x4d9412,_0xbdfcb9,_0x162796){return function(_0x577e38){utils[_0xcc13('0x61')](_0xbdfcb9,_0x162796,0x0);_0xbdfcb9[_0xcc13('0x62')]=0x0;logger[_0xcc13('0x5f')](_0x4d9412,util['inspect'](_0x577e38,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3dcb00){return function(_0x223f27){if(isNotNull(_0x223f27)&&isNotNull(_0x223f27[0x0])){if(_0x223f27[0x0][_0xcc13('0x63')]>0x0){_0x3dcb00[_0xcc13('0x64')]=utils['CAMPAIGN_STATUS'][_0xcc13('0x65')];logger[_0xcc13('0x42')](_0xcc13('0x66')+_0x3dcb00[_0xcc13('0x5a')],_0x223f27[0x0][_0xcc13('0x63')],_0xcc13('0x67'));}else{_0x3dcb00[_0xcc13('0x64')]=utils[_0xcc13('0x68')]['NO_AVAILABLE_CONTACTS'];logger[_0xcc13('0x42')](_0xcc13('0x69')+_0x3dcb00[_0xcc13('0x5a')]);}}};}function createObjHistory(_0x3a093a,_0x363762,_0x4db140,_0x59fe31,_0x95471c){_0x3a093a[_0xcc13('0x64')]=_0x4db140;var _0x43f44e=new Action(_0x3a093a,_0x363762);var _0x18c186=new History(_0x43f44e);_0x18c186[_0xcc13('0x6a')]=_0x59fe31;_0x18c186[_0xcc13('0x6b')]=_0x95471c;_0x18c186[_0xcc13('0x6c')]=_0x43f44e[_0xcc13('0x6d')];return _0x18c186;}function unlockQueueStatus(_0x43ee21,_0x1374c6){setTimeout(function(){if(_['isUndefined'](_0x43ee21[_0xcc13('0x6e')])){loggerBooked[_0xcc13('0x5f')](_0xcc13('0x6f'),_0x1374c6);}_0x43ee21[_0xcc13('0x6e')]=!![];loggerBooked[_0xcc13('0x42')]('[booked][unlockQueueStatus]',_0x1374c6,JSON[_0xcc13('0x70')](_[_0xcc13('0x71')](_0x43ee21,['name',_0xcc13('0x6e')])));},0x1f3);}function checkInterval(_0x153319){return function(){if(!isNotNull(_0x153319[_0xcc13('0x72')])){_0x153319[_0xcc13('0x64')]=utils[_0xcc13('0x68')]['NULL_INTERVAL'];throw _0x153319[_0xcc13('0x5a')]+_0xcc13('0x73');}if(!isNotNull(_0x153319[_0xcc13('0x72')][_0xcc13('0x74')])){_0x153319['message']=utils[_0xcc13('0x68')][_0xcc13('0x75')];throw _0x153319[_0xcc13('0x5a')]+_0xcc13('0x73');}if(!isNotNull(_[_0xcc13('0x41')](_0x153319[_0xcc13('0x72')][_0xcc13('0x74')]))){_0x153319[_0xcc13('0x64')]=utils[_0xcc13('0x68')][_0xcc13('0x75')];throw _0x153319[_0xcc13('0x5a')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x1a7b7b){return function(){if(!utils['isIVRCampaignActive'](_0x1a7b7b)){_0x1a7b7b[_0xcc13('0x64')]=utils[_0xcc13('0x68')][_0xcc13('0x76')];throw _0x1a7b7b[_0xcc13('0x5a')]+_0xcc13('0x77');}};}function emitCampaignSummary(_0x315f6c){if(utils[_0xcc13('0x78')](_0x315f6c)){emit(util['format']('campaign:ivr:%s',_0x315f6c['name']),'campaign:save',_0x315f6c);}}function loggerCatchQueueSummary(_0x2680ab,_0x3b1578){return function(_0x1edf9c){clearPredictiveAttributes(_0x3b1578);emitCampaignSummary(_0x3b1578);loggerSyncQueueSummary[_0xcc13('0x3c')](_0x2680ab,util['inspect'](_0x1edf9c,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x38c920){if(_0x38c920['sendMessageOneNotActive']){if(_0x38c920['originated']===0x0){_0x38c920[_0xcc13('0x79')]=![];_0x38c920[_0xcc13('0x64')]=utils[_0xcc13('0x68')][_0xcc13('0x76')];loggerSyncQueueSummary[_0xcc13('0x3c')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x38c920[_0xcc13('0x5a')],_0xcc13('0x7a'));}else{_0x38c920[_0xcc13('0x64')]=utils['CAMPAIGN_STATUS'][_0xcc13('0x7b')];loggerSyncQueueSummary[_0xcc13('0x3c')](_0xcc13('0x7c'),_0x38c920['name'],_0xcc13('0x7d'));}emitCampaignSummary(_0x38c920);}}function myreject(_0xbb0f24){return function(_0x313622){return _0xbb0f24(msgResponse(_0xcc13('0x7e'),_0xcc13('0x7f'),JSON[_0xcc13('0x70')](_0x313622)));};}Dialer[_0xcc13('0x18')][_0xcc13('0x80')]=function(_0x42e538){return!_[_0xcc13('0x38')](_0x42e538)&&_0x42e538&&!_['isUndefined'](_0x42e538[_0xcc13('0x5a')])&&!_[_0xcc13('0x38')](_0x42e538[_0xcc13('0x81')])&&_0x42e538['active']&&(this['trunks'][util[_0xcc13('0x3e')](_0xcc13('0x82'),_0x42e538[_0xcc13('0x5a')])]['status']===_0xcc13('0x83')||this[_0xcc13('0x1e')][util[_0xcc13('0x3e')](_0xcc13('0x82'),_0x42e538[_0xcc13('0x5a')])][_0xcc13('0x84')]===_0xcc13('0x85'));};Dialer[_0xcc13('0x18')][_0xcc13('0x86')]=function(_0xa79f0e){var _0xa6b1b=this;return function(){if(!_0xa6b1b['isTrunkReachable'](_0xa79f0e[_0xcc13('0x87')])){if(!_0xa6b1b[_0xcc13('0x80')](_0xa79f0e['TrunkBackup'])){_0xa79f0e[_0xcc13('0x64')]=utils[_0xcc13('0x68')][_0xcc13('0x88')];throw _0xa79f0e[_0xcc13('0x5a')]+_0xcc13('0x89');}}};};Dialer[_0xcc13('0x18')]['checkIfTime']=function(_0x24605a,_0x171dfa,_0x2c7ce9,_0x4f3b1f){var _0x35af2c=this;return function(){var _0x4a4d08=!![];return _0x35af2c[_0xcc13('0x8a')](_0x24605a,_0x171dfa,_0x2c7ce9,_0x4f3b1f,_0x4a4d08);};};Dialer[_0xcc13('0x18')][_0xcc13('0x8b')]=function(_0x230304,_0x5ece9d,_0x4c454f,_0x46da4f){var _0x1c907a=this;return function(){var _0x115d9f=![];return _0x1c907a[_0xcc13('0x8a')](_0x230304[_0xcc13('0x74')],_0x5ece9d,_0x4c454f,_0x46da4f,_0x115d9f);};};Dialer[_0xcc13('0x18')]['ifTimeIvr']=function(_0x3831ff,_0x51f4f7,_0x1a8a36,_0x2225ad,_0x5812a3){var _0x539538=[];return new Promise(function(_0x29f9e6,_0x513b6f){if(!isNotNull(_0x3831ff)){_0x2225ad['message']=utils[_0xcc13('0x68')][_0xcc13('0x75')];return _0x513b6f(msgResponse('ifTime',_0xcc13('0x8c'),_0x1a8a36+'\x20Intervals\x20is\x20null\x20'));}if(_[_0xcc13('0x41')](_0x3831ff)){_0x2225ad[_0xcc13('0x64')]=utils[_0xcc13('0x68')]['EMPTY_INTERVAL'];return _0x513b6f(msgResponse(_0xcc13('0x8d'),_0xcc13('0x8c'),_0x1a8a36+_0xcc13('0x8e')));}if(_0x51f4f7&&_['isUndefined'](config[_0xcc13('0x8f')][_0x51f4f7])){_0x2225ad[_0xcc13('0x64')]=utils['CAMPAIGN_STATUS'][_0xcc13('0x90')];return _0x513b6f(msgResponse(_0xcc13('0x8d'),'Failure',_0x1a8a36+_0xcc13('0x91')+_0x51f4f7));}if(_[_0xcc13('0x92')](_0x3831ff)){for(var _0x3c82a1=0x0;_0x3c82a1<_0x3831ff[_0xcc13('0x93')];_0x3c82a1+=0x1){_0x539538[_0xcc13('0x94')](ami[_0xcc13('0x95')]({'action':'command','command':util[_0xcc13('0x3e')]('iftime\x20%s,%s',_0x3831ff[_0x3c82a1][_0xcc13('0x96')],!_[_0xcc13('0x38')](config[_0xcc13('0x8f')][_0x51f4f7])?_0x51f4f7:'')})[_0xcc13('0x97')](function(_0x31c570){return _0x31c570[_0xcc13('0x98')]['indexOf']('true')>=0x0;})[_0xcc13('0x99')](myreject(_0x513b6f)));}}else{_0x539538['push'](ami[_0xcc13('0x95')]({'action':'command','command':util['format'](_0xcc13('0x9a'),_0x3831ff,!_[_0xcc13('0x38')](config['timezones'][_0x51f4f7])?_0x51f4f7:'')})['then'](function(_0x1f75d1){return _0x1f75d1['content'][_0xcc13('0x9b')](_0xcc13('0x9c'))>=0x0;})[_0xcc13('0x99')](myreject(_0x513b6f)));}Promise[_0xcc13('0x9d')](_0x539538)[_0xcc13('0x97')](function(_0x21dda1){var _0x5cb87e=_[_0xcc13('0x9e')](_0x21dda1);if(_0x5cb87e){return _0x29f9e6(_0x5cb87e);}else{_0x2225ad[_0xcc13('0x64')]=_0x5812a3?utils[_0xcc13('0x68')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0xcc13('0x68')]['OVERTIME_INTERVAL'];return _0x513b6f(msgResponse(_0xcc13('0x9f'),_0xcc13('0x8c'),_0xcc13('0xa0')+_0x5812a3+'\x20'+_0x1a8a36+_0xcc13('0xa1')+util['inspect'](_0x3831ff,{'showHidden':![],'depth':null})+_0xcc13('0xa2')+_0x51f4f7));}})[_0xcc13('0x99')](function(_0x1f84da){return _0x513b6f(msgResponse(_0xcc13('0x8d'),_0xcc13('0x8c'),JSON[_0xcc13('0x70')](_0x1f84da)));});});};Dialer[_0xcc13('0x18')]['loopCampaigns']=function(){var _0x256640=this;return cmHopper[_0xcc13('0xa3')]({'active':![]},{'where':{'active':!![]}})[_0xcc13('0x97')](function(){setInterval(function(){_0x256640[_0xcc13('0xa4')]();},0x3e8);});};Dialer['prototype'][_0xcc13('0xa4')]=function(){var _0x56da48=this;var _0xe0ae53;for(var _0x13642a in this[_0xcc13('0x1c')]){if(typeof this[_0xcc13('0x1c')][_0x13642a]!==_0xcc13('0xa5')){_0xe0ae53=this[_0xcc13('0x1c')][_0x13642a];if(utils[_0xcc13('0x78')](_0xe0ae53)&&utils[_0xcc13('0xa6')](_0xe0ae53)){_0xe0ae53['sendMessageOneNotActive']=!![];Promise[_0xcc13('0xa7')]()[_0xcc13('0x97')](checkIsIVRCampaignActive(_0xe0ae53))['then'](checkInterval(_0xe0ae53))[_0xcc13('0x97')](_0x56da48[_0xcc13('0x86')](_0xe0ae53))[_0xcc13('0x97')](_0x56da48['checkIfTime'](_0xe0ae53[_0xcc13('0xa8')],_0xe0ae53[_0xcc13('0xa9')],_0xe0ae53[_0xcc13('0x5a')],_0xe0ae53))[_0xcc13('0x97')](_0x56da48[_0xcc13('0x8b')](_0xe0ae53[_0xcc13('0x72')],_0xe0ae53['dialTimezone'],_0xe0ae53[_0xcc13('0x5a')],_0xe0ae53))[_0xcc13('0x97')](_0x56da48['launchHandleIvr'](_0xe0ae53))[_0xcc13('0x99')](loggerCatchQueueSummary(_0xcc13('0xaa'),_0xe0ae53));}else{notSendMessagesCampaign(_0xe0ae53);}}}};Dialer[_0xcc13('0x18')][_0xcc13('0xab')]=function(_0x365a8c){if(_0x365a8c[_0xcc13('0xac')]!==_0xcc13('0x9')){clearPredictiveAttributes(_0x365a8c);}switch(_0x365a8c['dialMethod']){case _0xcc13('0xad'):this[_0xcc13('0xae')](_0x365a8c,0x1);break;case _0xcc13('0xaf'):this['handlePower'](_0x365a8c,_0x365a8c['dialPowerLevel']);break;case _0xcc13('0x9'):this[_0xcc13('0x9')](_0x365a8c);break;case _0xcc13('0x8'):this[_0xcc13('0xae')](_0x365a8c,0x1);break;default:logger[_0xcc13('0x5f')]('Queue',_0x365a8c[_0xcc13('0x5a')],_0xcc13('0xb0'));}};Dialer[_0xcc13('0x18')][_0xcc13('0x8d')]=function(_0x2c2de6,_0x205481){var _0x10aa45=_0x2c2de6[_0xcc13('0xa9')];var _0x2b99b0=_0x205481?_0x2c2de6[_0xcc13('0xa8')]:_0x2c2de6[_0xcc13('0x72')][_0xcc13('0x74')];logger[_0xcc13('0xb1')]('Dialer::ifTime()',_0x2b99b0,_0x10aa45,_0x2c2de6['name'],util[_0xcc13('0x3e')]('Voice\x20Queue\x20%s\x20$s',_0x2c2de6[_0xcc13('0x5a')],_0x2c2de6['id']));var _0x1cf5b2=null;return Interval[_0xcc13('0xb2')](_0x2b99b0,_0x10aa45)[_0xcc13('0x97')](function(_0x7756a5){if(_0x7756a5===!![]){return _0x7756a5;}else{_0x2c2de6['message']=_0x205481?utils[_0xcc13('0x68')][_0xcc13('0xb3')]:utils[_0xcc13('0x68')]['OVERTIME_INTERVAL'];_0x1cf5b2=msgResponse(_0xcc13('0x9f'),'Failure',_0xcc13('0xa0')+_0x205481+'\x20'+_0x2c2de6[_0xcc13('0x5a')]+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x2b99b0,{'showHidden':![],'depth':null})+_0xcc13('0xa2')+_0x10aa45);}if(_0x1cf5b2!==null){logger['silly'](_0xcc13('0xb4'),_0x1cf5b2);_0x1cf5b2['isGlobal']=_0x205481;throw _0x1cf5b2;}})[_0xcc13('0x99')](function(_0x7f262f){logger[_0xcc13('0x5f')](_0xcc13('0xb5'),_0x7f262f);throw msgResponse(_0xcc13('0x7e'),_0xcc13('0x7f'),util[_0xcc13('0x3d')](_0x7f262f,{'showHidden':![],'depth':null}));});};Dialer[_0xcc13('0x18')]['syncAgentConnect']=function(_0x21ea11){if(this[_0xcc13('0xb6')][_0x21ea11['queue']]){if(this[_0xcc13('0x22')][_0x21ea11[_0xcc13('0xb7')]]&&this['uniqueId'][_0x21ea11[_0xcc13('0xb7')]][_0xcc13('0x3a')]!==_0xcc13('0xb8')){this[_0xcc13('0xb9')](this[_0xcc13('0xb6')][_0x21ea11['queue']]);this[_0xcc13('0x22')][_0x21ea11[_0xcc13('0xb7')]]['answertime']=moment()[_0xcc13('0x3e')](_0xcc13('0xba'));}}};Dialer['prototype'][_0xcc13('0x2c')]=function(_0x58a586){var _0x42988b=this[_0xcc13('0x22')][_0x58a586['uniqueid']];if(this[_0xcc13('0xb6')][_0x58a586[_0xcc13('0xbb')]]){if(_0x42988b&&_0x42988b['type']!=='ivr'){delete this[_0xcc13('0x22')][_0x58a586[_0xcc13('0xb7')]];this['voiceQueues'][_0x58a586[_0xcc13('0xbb')]][_0xcc13('0xbc')]+=0x1;var _0x2dfe0e=new AgentComplete(_0x42988b,_0x58a586);if(_0x58a586['reason']==='agent'){_0x2dfe0e[_0xcc13('0xbd')]=this[_0xcc13('0xb6')][_0x58a586[_0xcc13('0xbb')]][_0xcc13('0xbe')]&&this[_0xcc13('0xb6')][_0x58a586[_0xcc13('0xbb')]]['dialAgiAfterHangupAgent']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0xcc13('0xbf')](_0x2dfe0e)[_0xcc13('0x99')](loggerCatch(_0xcc13('0xc0')));hopperUtils['moveContactManagedDialer'](_0x2dfe0e)[_0xcc13('0x99')](loggerCatch(_0xcc13('0xc1')));}}};Dialer[_0xcc13('0x18')][_0xcc13('0x29')]=function(_0x23e3c4){var _0xa76f26=this[_0xcc13('0x22')][_0x23e3c4[_0xcc13('0xb7')]];var _0x4af5d4=this;var _0x6b7cad=![];var _0x2baebb;var _0x571197;if(this['voiceQueues'][_0x23e3c4[_0xcc13('0xbb')]]){if(_0xa76f26&&_0xa76f26[_0xcc13('0x3a')]!==_0xcc13('0xb8')){delete this[_0xcc13('0x22')][_0x23e3c4[_0xcc13('0xb7')]];this[_0xcc13('0xb9')](this[_0xcc13('0xb6')][_0x23e3c4[_0xcc13('0xbb')]]);_0xa76f26['droptime']=moment()[_0xcc13('0x3e')](_0xcc13('0xba'));var _0x34cf07=new QueueCallerAbandon(_0xa76f26,_0x23e3c4);if(utils['getSeconds'](_0xa76f26[_0xcc13('0xc2')],_0xa76f26[_0xcc13('0xc3')])>=_0xa76f26[_0xcc13('0xc4')]){this[_0xcc13('0xb6')][_0x23e3c4[_0xcc13('0xbb')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xcc13('0xb6')][_0x23e3c4['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0xcc13('0xb6')][_0x23e3c4[_0xcc13('0xbb')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x34cf07[_0xcc13('0x6a')]=0xa;_0x34cf07[_0xcc13('0x6b')]=_0xcc13('0xc5');_0x34cf07[_0xcc13('0xc6')]=_0xcc13('0xc7');_0x34cf07[_0xcc13('0xbd')]=this['voiceQueues'][_0x23e3c4['queue']][_0xcc13('0xbe')]?moment()[_0xcc13('0x3e')](_0xcc13('0xba')):undefined;_0x34cf07[_0xcc13('0xc8')]+=0x1;_0x34cf07['countglobal']+=0x1;_0x2baebb=this['voiceQueues'][_0x23e3c4[_0xcc13('0xbb')]]['dialDropRetryFrequency'];_0x571197=this[_0xcc13('0xb6')][_0x23e3c4['queue']][_0xcc13('0xc9')];hopperUtils['verifyAdditionalPhones'](_0x34cf07,_0x34cf07['state'],_0xa76f26[_0xcc13('0xca')])['then'](function(_0x21fe24){_0x6b7cad=_0x21fe24['additional']==0x1;if(_0x34cf07['countdropretry']>=_0x4af5d4[_0xcc13('0xb6')][_0x23e3c4[_0xcc13('0xbb')]][_0xcc13('0xcb')]){_0x4af5d4[_0xcc13('0xcc')](_0x34cf07,_0x21fe24[_0xcc13('0xcd')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x34cf07['countdropretry'],'scheduledat':moment()[_0xcc13('0xce')](_0x4af5d4[_0xcc13('0xb6')][_0x23e3c4['queue']][_0xcc13('0xcf')],_0xcc13('0xd0'))[_0xcc13('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa76f26[_0xcc13('0xd1')],'ListId':_0xa76f26['ListId'],'VoiceQueueId':_0xa76f26['VoiceQueueId']||undefined,'CampaignId':_0xa76f26[_0xcc13('0xd2')]||undefined})['catch'](loggerCatch(_0xcc13('0xd3')));var _0x3b53e7=new History(_0x34cf07);_0x3b53e7[_0xcc13('0x6a')]=0xa;_0x3b53e7[_0xcc13('0x6b')]='Drop';_0x3b53e7[_0xcc13('0x6d')]=moment()['format'](_0xcc13('0xba'));_0x3b53e7[_0xcc13('0x6c')]=_0x3b53e7['starttime'];_0x3b53e7[_0xcc13('0xd4')]=_0x34cf07[_0xcc13('0xd4')];_0x3b53e7['calleridnum']=_0x34cf07[_0xcc13('0xd5')];hopperUtils[_0xcc13('0xbf')](_0x3b53e7)[_0xcc13('0x99')](loggerCatch(_0xcc13('0xd6')));}})['then'](function(){if(_0x6b7cad)hopperUtils[_0xcc13('0xd7')](_0x34cf07,_0x2baebb,_0x571197)['then'](function(){return 0x1;});});}else{this[_0xcc13('0xb6')][_0x23e3c4[_0xcc13('0xbb')]][_0xcc13('0xd8')]+=0x1;this[_0xcc13('0xb6')][_0x23e3c4['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x34cf07[_0xcc13('0x6a')]=0xb;_0x34cf07[_0xcc13('0x6b')]=_0xcc13('0xd9');_0x34cf07[_0xcc13('0xc6')]=_0xcc13('0xda');_0x34cf07['countabandonedretry']+=0x1;_0x34cf07[_0xcc13('0xdb')]+=0x1;_0x2baebb=this[_0xcc13('0xb6')][_0x23e3c4[_0xcc13('0xbb')]]['dialAbandonedRetryFrequency'];_0x571197=this[_0xcc13('0xb6')][_0x23e3c4['queue']][_0xcc13('0xc9')];hopperUtils['verifyAdditionalPhones'](_0x34cf07,_0x34cf07[_0xcc13('0x6a')],_0xa76f26[_0xcc13('0xca')])[_0xcc13('0x97')](function(_0xd38957){if(_0x34cf07['countabandonedretry']>=_0x4af5d4[_0xcc13('0xb6')][_0x23e3c4[_0xcc13('0xbb')]][_0xcc13('0xdc')]){_0x4af5d4['queueCallerAbandonCreateState'](_0x34cf07,_0xd38957['additional']);}else{hopperUtils[_0xcc13('0xdd')]({'active':![],'countabandonedretry':_0x34cf07[_0xcc13('0xde')],'scheduledat':moment()[_0xcc13('0xce')](_0x4af5d4[_0xcc13('0xb6')][_0x23e3c4[_0xcc13('0xbb')]]['dialAbandonedRetryFrequency'],_0xcc13('0xd0'))['format'](_0xcc13('0xba')),'ContactId':_0xa76f26[_0xcc13('0xd1')],'ListId':_0xa76f26[_0xcc13('0xdf')],'VoiceQueueId':_0xa76f26['VoiceQueueId']||undefined,'CampaignId':_0xa76f26[_0xcc13('0xd2')]||undefined})[_0xcc13('0x99')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x5e9431=new History(_0x34cf07);_0x5e9431[_0xcc13('0x6a')]=0xb;_0x5e9431[_0xcc13('0x6b')]=_0xcc13('0xd9');_0x5e9431[_0xcc13('0x6d')]=moment()[_0xcc13('0x3e')](_0xcc13('0xba'));_0x5e9431['endtime']=_0x5e9431['starttime'];_0x5e9431['calleridname']=_0x34cf07['calleridname'];_0x5e9431[_0xcc13('0xd5')]=_0x34cf07[_0xcc13('0xd5')];hopperUtils[_0xcc13('0xbf')](_0x5e9431)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0xcc13('0x97')](function(){if(_0x6b7cad)hopperUtils[_0xcc13('0xd7')](_0x34cf07,_0x2baebb,_0x571197)[_0xcc13('0x97')](function(){return 0x1;});});}}}};Dialer[_0xcc13('0x18')][_0xcc13('0x32')]=function(_0x4ab41a){if(this[_0xcc13('0xe0')][_0x4ab41a[_0xcc13('0xb7')]]){this[_0xcc13('0xe0')][_0x4ab41a[_0xcc13('0xb7')]][_0xcc13('0xe1')]=_0x4ab41a[_0xcc13('0xe1')];}if(this[_0xcc13('0x22')][_0x4ab41a[_0xcc13('0xb7')]]){this[_0xcc13('0x22')][_0x4ab41a[_0xcc13('0xb7')]][_0xcc13('0xe1')]=_0x4ab41a[_0xcc13('0xe1')];}};Dialer['prototype'][_0xcc13('0x34')]=function(_0x3dadaa){if(!this[_0xcc13('0xe0')][_0x3dadaa[_0xcc13('0xe2')]]){return;}var _0x3318f8=this['voiceQueues'][this[_0xcc13('0xe0')][_0x3dadaa[_0xcc13('0xe2')]][_0xcc13('0xbb')]][_0xcc13('0xe3')]||_0xcc13('0xe4');if(_0x3318f8===_0xcc13('0xe5')){if(this['actions'][_0x3dadaa[_0xcc13('0xe2')]]&&_[_0xcc13('0xe6')](this[_0xcc13('0xe0')][_0x3dadaa[_0xcc13('0xe2')]][_0xcc13('0xe7')])&&_0x3dadaa[_0xcc13('0x84')]==='1'&&_0x3dadaa[_0xcc13('0xe8')]==='0'){if(this[_0xcc13('0x1d')][_0x3dadaa[_0xcc13('0xe9')]]){if(!this[_0xcc13('0x1d')][_0x3dadaa['stateinterface']][_0xcc13('0xe7')]){this[_0xcc13('0x1d')][_0x3dadaa[_0xcc13('0xe9')]][_0xcc13('0xe7')]=!![];this['actions'][_0x3dadaa['actionid']][_0xcc13('0xe7')]=!![];this['actions'][_0x3dadaa[_0xcc13('0xe2')]][_0xcc13('0xe9')]=_0x3dadaa[_0xcc13('0xe9')];}}}}else if(_0x3318f8===_0xcc13('0xe4')){if(this[_0xcc13('0xe0')][_0x3dadaa[_0xcc13('0xe2')]]){if(this['agents'][_0x3dadaa[_0xcc13('0xe9')]]){this[_0xcc13('0xe0')][_0x3dadaa[_0xcc13('0xe2')]][_0xcc13('0xe9')]=_0x3dadaa[_0xcc13('0xe9')];if(_[_0xcc13('0xe6')](this[_0xcc13('0xea')][this[_0xcc13('0xe0')][_0x3dadaa[_0xcc13('0xe2')]]['queue']])){this[_0xcc13('0xea')][this['actions'][_0x3dadaa[_0xcc13('0xe2')]][_0xcc13('0xbb')]]=[];}this[_0xcc13('0xea')][this[_0xcc13('0xe0')][_0x3dadaa[_0xcc13('0xe2')]]['queue']][_0xcc13('0x94')](_['merge'](_[_0xcc13('0x71')](this[_0xcc13('0xe0')][_0x3dadaa[_0xcc13('0xe2')]],[_0xcc13('0xeb'),_0xcc13('0xe9')]),{'status':_0x3dadaa['status'],'paused':_0x3dadaa[_0xcc13('0xe8')]}));}}}};Dialer[_0xcc13('0x18')]['syncQueueStatusComplete']=function(_0x1517c4){if(!this['actions'][_0x1517c4[_0xcc13('0xe2')]]){return;}var _0x28d4d8=this;var _0x37eb04=this[_0xcc13('0xb6')][this[_0xcc13('0xe0')][_0x1517c4[_0xcc13('0xe2')]][_0xcc13('0xbb')]];var _0x3a8d0f=_0x37eb04[_0xcc13('0xe3')]||_0xcc13('0xe4');if(_0x3a8d0f===_0xcc13('0xe5')){if(this['actions'][_0x1517c4[_0xcc13('0xe2')]]&&this[_0xcc13('0xe0')][_0x1517c4['actionid']][_0xcc13('0xe9')]){this[_0xcc13('0x1b')][_0xcc13('0xec')](this[_0xcc13('0xe0')][_0x1517c4[_0xcc13('0xe2')]][_0xcc13('0xeb')],this['actions'][_0x1517c4['actionid']][_0xcc13('0xe9')])[_0xcc13('0x99')](function(_0x491280){logger[_0xcc13('0x5f')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xcc13('0x3d')](_0x491280,{'showHidden':![],'depth':null}));})['finally'](function(){_0x28d4d8[_0xcc13('0xb9')](_0x28d4d8[_0xcc13('0xb6')][_0x28d4d8[_0xcc13('0xe0')][_0x1517c4[_0xcc13('0xe2')]][_0xcc13('0xbb')]]);_0x28d4d8['agents'][_0x28d4d8[_0xcc13('0xe0')][_0x1517c4[_0xcc13('0xe2')]][_0xcc13('0xe9')]][_0xcc13('0xe7')]=![];delete _0x28d4d8['actions'][_0x1517c4[_0xcc13('0xe2')]];unlockQueueStatus(_0x37eb04);});}else{this[_0xcc13('0xb9')](this[_0xcc13('0xb6')][this[_0xcc13('0xe0')][_0x1517c4[_0xcc13('0xe2')]]['queue']]);hopperUtils[_0xcc13('0xdd')]({'active':![],'ContactId':this[_0xcc13('0xe0')][_0x1517c4['actionid']]['ContactId'],'ListId':this[_0xcc13('0xe0')][_0x1517c4[_0xcc13('0xe2')]][_0xcc13('0xdf')],'VoiceQueueId':this[_0xcc13('0xe0')][_0x1517c4['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0xcc13('0xe0')][_0x1517c4[_0xcc13('0xe2')]]['CampaignId']||undefined})[_0xcc13('0x99')](loggerCatch(_0xcc13('0xed')));delete this[_0xcc13('0xe0')][_0x1517c4[_0xcc13('0xe2')]];unlockQueueStatus(_0x37eb04);}}else if(_0x3a8d0f==='rrmemory'){var _0xa4c666;if(this[_0xcc13('0xe0')][_0x1517c4[_0xcc13('0xe2')]]&&!_['isEmpty'](this[_0xcc13('0xea')][this['actions'][_0x1517c4[_0xcc13('0xe2')]]['queue']])){if(this[_0xcc13('0xee')][_0x28d4d8[_0xcc13('0xe0')][_0x1517c4[_0xcc13('0xe2')]][_0xcc13('0xbb')]]){this['queueBookedRR'][_0x28d4d8[_0xcc13('0xe0')][_0x1517c4[_0xcc13('0xe2')]][_0xcc13('0xbb')]]=this[_0xcc13('0xee')][this['actions'][_0x1517c4['actionid']][_0xcc13('0xbb')]]?this[_0xcc13('0xee')][this['actions'][_0x1517c4[_0xcc13('0xe2')]][_0xcc13('0xbb')]]:this[_0xcc13('0xea')][this['actions'][_0x1517c4[_0xcc13('0xe2')]][_0xcc13('0xbb')]]?this[_0xcc13('0xea')][this['actions'][_0x1517c4['actionid']]['queue']][_0xcc13('0xef')]||0x0:0x0;}this[_0xcc13('0xea')][this[_0xcc13('0xe0')][_0x1517c4[_0xcc13('0xe2')]][_0xcc13('0xbb')]][_0xcc13('0xef')]=this[_0xcc13('0xee')][this[_0xcc13('0xe0')][_0x1517c4['actionid']]['queue']];for(var _0x66a3b6=0x0;_0x66a3b6=_0x280747[_0xcc13('0x114')]){_0x491385[_0xcc13('0x115')](_0x37ef23,_0x55911f,_0x4bd9b1,'reason19\x20machine....');}else{if(_0x37ef23[_0xcc13('0x10d')]>=_0x280747['dialMachineMaxRetry']){_0x491385[_0xcc13('0x116')](_0x37ef23,_0x55911f,_0x4bd9b1,_0xcc13('0x117'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x37ef23[_0xcc13('0x10d')],'scheduledat':moment()[_0xcc13('0xce')](_0x280747[_0xcc13('0x118')],_0xcc13('0xd0'))[_0xcc13('0x3e')](_0xcc13('0xba')),'ContactId':_0x37ef23['ContactId'],'ListId':_0x37ef23[_0xcc13('0xdf')],'VoiceQueueId':_0x37ef23['VoiceQueueId']||undefined,'CampaignId':_0x37ef23[_0xcc13('0xd2')]||undefined})[_0xcc13('0x99')](loggerCatch('[rescheduleContact][Machine]'));_0x55911f({'reschedule':0x1});}}});}if(_0xb1239a['type']==='ivr'&&this[_0xcc13('0x1c')][_0xb1239a[_0xcc13('0xbb')]][_0xcc13('0x109')]&&_0x12b45b[_0xcc13('0x10a')]===_0xcc13('0x119')){delete this[_0xcc13('0x22')][_0x12b45b[_0xcc13('0xb7')]];this[_0xcc13('0xb9')](this[_0xcc13('0x1c')][_0xb1239a[_0xcc13('0xbb')]]);_0x5c48f6=new Hangup(_0xb1239a,_0x12b45b);_0x5c48f6['state']=0x12;_0x5c48f6['statedesc']=_0xcc13('0x102');_0x5c48f6[_0xcc13('0x103')]='AMD';ami[_0xcc13('0x39')]('custom:amd',ut[_0xcc13('0x105')](_0x5c48f6,'amd'));this['saveInDb'](_0x5c48f6,'[syncHangupInAMDIvr][createHistory]',_0xcc13('0x11a'));}if(_0xb1239a[_0xcc13('0x3a')]==='ivr'&&this[_0xcc13('0x1c')][_0xb1239a[_0xcc13('0xbb')]][_0xcc13('0x109')]&&_0x12b45b['value']===_0xcc13('0x10b')){return new Promise(function(_0x167470,_0x19a875){delete _0x491385['uniqueId'][_0x12b45b[_0xcc13('0xb7')]];_0x491385[_0xcc13('0xb9')](_0x491385[_0xcc13('0x1c')][_0xb1239a[_0xcc13('0xbb')]]);_0x491385['campaigns'][_0xb1239a[_0xcc13('0xbb')]][_0xcc13('0xbc')]+=0x1;_0x491385[_0xcc13('0x1c')][_0xb1239a['queue']][_0xcc13('0x101')]+=0x1;var _0x1b2f21=_0x491385['campaigns'][_0xb1239a[_0xcc13('0xbb')]];var _0x1b7ce8=new Hangup(_0xb1239a,_0x12b45b);_0x1b7ce8[_0xcc13('0x6a')]=0x13;_0x1b7ce8[_0xcc13('0x6b')]=_0xcc13('0x10c');_0x1b7ce8[_0xcc13('0x103')]=_0xcc13('0x11b');_0x1b7ce8[_0xcc13('0x10d')]+=0x1;_0x1b7ce8[_0xcc13('0xdb')]+=0x1;_0x1b7ce8[_0xcc13('0x10e')]=!![];ami[_0xcc13('0x39')](_0xcc13('0x104'),ut[_0xcc13('0x105')](_0x1b7ce8,_0xcc13('0x10e')));hopperUtils['createHistory'](_0x1b7ce8)[_0xcc13('0x99')](loggerCatch(_0xcc13('0x10f')));if(_0x1b7ce8[_0xcc13('0x110')]+_0x1b7ce8[_0xcc13('0x111')]+_0x1b7ce8[_0xcc13('0x112')]+_0x1b7ce8[_0xcc13('0x11c')]+_0x1b7ce8['countdropretry']+_0x1b7ce8[_0xcc13('0xde')]+_0x1b7ce8[_0xcc13('0x10d')]+_0x1b7ce8[_0xcc13('0x113')]>=_0x1b2f21[_0xcc13('0x114')]){_0x491385[_0xcc13('0x115')](_0x1b7ce8,_0x167470,_0x19a875,_0xcc13('0x11d'));}else{if(_0x1b7ce8[_0xcc13('0x10d')]>=_0x1b2f21[_0xcc13('0x11e')]){_0x491385[_0xcc13('0x116')](_0x1b7ce8,_0x167470,_0x19a875,_0xcc13('0x117'));}else{hopperUtils[_0xcc13('0xdd')]({'active':![],'countmachineretry':_0x1b7ce8[_0xcc13('0x10d')],'scheduledat':moment()[_0xcc13('0xce')](_0x1b2f21['dialMachineRetryFrequency'],_0xcc13('0xd0'))[_0xcc13('0x3e')](_0xcc13('0xba')),'ContactId':_0x1b7ce8[_0xcc13('0xd1')],'ListId':_0x1b7ce8['ListId'],'VoiceQueueId':_0x1b7ce8[_0xcc13('0xf7')]||undefined,'CampaignId':_0x1b7ce8[_0xcc13('0xd2')]||undefined})[_0xcc13('0x99')](loggerCatch(_0xcc13('0x11f')));_0x167470({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xcc13('0x30')]=function(_0x3f2822){var _0x4718d6=this[_0xcc13('0x22')][_0x3f2822[_0xcc13('0xb7')]];var _0x40895c;if(_0x4718d6&&_0x4718d6[_0xcc13('0x3a')]===_0xcc13('0xb8')){delete this['uniqueId'][_0x3f2822[_0xcc13('0xb7')]];this[_0xcc13('0xb9')](this['campaigns'][_0x4718d6['queue']]);this['campaigns'][_0x4718d6[_0xcc13('0xbb')]][_0xcc13('0x120')]+=0x1;_0x40895c=new Hangup(_0x4718d6,_0x3f2822);hopperUtils[_0xcc13('0xbf')](_0x40895c)[_0xcc13('0x99')](loggerCatch(_0xcc13('0x121')));hopperUtils[_0xcc13('0x122')](_0x40895c)['catch'](loggerCatch(_0xcc13('0x123')));}if(_0x4718d6&&_0x4718d6[_0xcc13('0x3a')]!=='ivr'&&isNotNull(this[_0xcc13('0xb6')][_0x4718d6[_0xcc13('0xbb')]]['dialQueueProject'])){delete this['uniqueId'][_0x3f2822['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x4718d6[_0xcc13('0xbb')]]);this[_0xcc13('0xb6')][_0x4718d6[_0xcc13('0xbb')]][_0xcc13('0xbc')]+=0x1;this[_0xcc13('0xb6')][_0x4718d6[_0xcc13('0xbb')]][_0xcc13('0x101')]+=0x1;_0x40895c=new Hangup(_0x4718d6,_0x3f2822);_0x40895c[_0xcc13('0x6a')]=0x10;_0x40895c[_0xcc13('0x6b')]=_0xcc13('0x124');_0x40895c[_0xcc13('0x103')]=_0xcc13('0x125');hopperUtils['createHistory'](_0x40895c)['catch'](loggerCatch(_0xcc13('0x121')));hopperUtils['moveContactManagedDialer'](_0x40895c)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x4718d6&&_0x4718d6[_0xcc13('0x3a')]!==_0xcc13('0xb8')&&!isNotNull(this[_0xcc13('0xb6')][_0x4718d6['queue']][_0xcc13('0x126')])){delete this[_0xcc13('0x22')][_0x3f2822[_0xcc13('0xb7')]];this[_0xcc13('0xb9')](this[_0xcc13('0xb6')][_0x4718d6['queue']]);this[_0xcc13('0xb6')][_0x4718d6[_0xcc13('0xbb')]]['outboundUnknownCallsDay']+=0x1;_0x40895c=new Hangup(_0x4718d6,_0x3f2822);_0x40895c[_0xcc13('0x6a')]=0xc;_0x40895c[_0xcc13('0x6b')]=_0x3f2822[_0xcc13('0x127')];_0x40895c[_0xcc13('0x103')]=_0xcc13('0x128');hopperUtils[_0xcc13('0xbf')](_0x40895c)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xcc13('0x122')](_0x40895c)[_0xcc13('0x99')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0xcc13('0x2d')]=function(_0x49b526){var _0x5b17aa=this;if(!_0x5b17aa[_0xcc13('0x25')][_0x49b526['name']]){_0x5b17aa[_0xcc13('0x25')][_0x49b526['name']]={'running':![]};}else if(_0x5b17aa[_0xcc13('0x25')][_0x49b526['name']][_0xcc13('0x129')]===!![]){return;}else if(_0x5b17aa['queuesSummary'][_0x49b526[_0xcc13('0x5a')]]['running']===![]){_0x5b17aa[_0xcc13('0x25')][_0x49b526[_0xcc13('0x5a')]][_0xcc13('0x129')]=!![];}var _0x4bb998=_0x5b17aa[_0xcc13('0xb6')][_0x49b526['name']];var _0x2af165=_0x4bb998['message']!==utils['CAMPAIGN_STATUS'][_0xcc13('0x76')];var _0xa6afbe=utils[_0xcc13('0x12a')](_0x4bb998);_0x4bb998[_0xcc13('0x12b')]=utils[_0xcc13('0x12c')](_0x4bb998,_0x5b17aa['trunks']);Promise[_0xcc13('0xa7')]()[_0xcc13('0x97')](function(){if(_0x4bb998[_0xcc13('0x12b')]===utils[_0xcc13('0x68')][_0xcc13('0x76')]){if(_0x2af165){clearPredictiveAttributes(_0x4bb998);_0x49b526[_0xcc13('0x24')]=undefined;_0x49b526['startProgressive']=undefined;}if(_0x4bb998[_0xcc13('0x12b')]===utils[_0xcc13('0x68')][_0xcc13('0x76')]){_0x49b526['available']=0x0;_0x49b526[_0xcc13('0xe8')]=0x0;_0x49b526[_0xcc13('0x12d')]=0x0;_0x49b526[_0xcc13('0x12e')]=0x0;_0x49b526['pTalking']=0x0;}}else if(_0x4bb998[_0xcc13('0x12b')]===utils[_0xcc13('0x68')][_0xcc13('0x12f')]&&!_0xa6afbe){return _0x5b17aa[_0xcc13('0x8d')](_0x4bb998,!![])[_0xcc13('0x97')](function(){return _0x5b17aa[_0xcc13('0x8d')](_0x4bb998,![]);})[_0xcc13('0x97')](function(){return _0x5b17aa[_0xcc13('0xab')](_0x4bb998);})[_0xcc13('0x99')](function(_0x53ea31){loggerSyncQueueSummary['debug'](_0xcc13('0x130'),util[_0xcc13('0x3d')](_0x53ea31,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x4bb998);});}else{clearPredictiveAttributes(_0x4bb998);}})[_0xcc13('0x97')](function(){var _0x512d27=_0x49b526[_0xcc13('0x131')](_0x4bb998);if(_0x512d27||_0x4bb998[_0xcc13('0x132')]){_0x4bb998[_0xcc13('0x132')]=![];_0x49b526['updateReportFromOutboundQueue'](_0x4bb998);Object[_0xcc13('0x133')](_0x4bb998,_0x49b526);emitOutboundVoiceQueueSummary(_0x49b526);}_0x5b17aa[_0xcc13('0x25')][_0x4bb998[_0xcc13('0x5a')]][_0xcc13('0x129')]=![];})['catch'](function(_0x2c680e){logger[_0xcc13('0x5f')](_0xcc13('0x130'),util[_0xcc13('0x3d')](_0x2c680e,{'showHidden':![],'depth':null}));_0x5b17aa[_0xcc13('0x25')][_0x4bb998[_0xcc13('0x5a')]]['running']=![];});};Dialer[_0xcc13('0x18')]['syncQueueSummaryComplete']=_['throttle'](function(){var _0x24aaf8=_[_0xcc13('0x134')](this['voiceQueues'],function(_0x4a106e){return _0x4a106e[_0xcc13('0x135')];});var _0x3295fb=_[_0xcc13('0x134')](this[_0xcc13('0x1d')],function(_0x55e964){return _0x55e964[_0xcc13('0x136')]&&_0x55e964['status']==='reachable';});if(_0x24aaf8[_0xcc13('0x93')]>0x0&&_0x3295fb['length']>0x0){return Promise['resolve']()['then'](cmHopper['handlePreviewRecallNotifications'](_[_0xcc13('0x137')](_0x24aaf8,'id'),previewRecallmeReminderInterval,_[_0xcc13('0x137')](_0x3295fb,'id')))[_0xcc13('0x97')](function(_0x536cac){for(var _0x40519b=0x0;_0x40519b<_0x536cac[_0xcc13('0x93')];_0x40519b++){var _0x4108c2=_0x536cac[_0x40519b][_0xcc13('0x138')]['name'];if(_0x4108c2)io['to'](util[_0xcc13('0x3e')](_0xcc13('0x139'),_0x4108c2))[_0xcc13('0x39')](_0xcc13('0x13a'),{'hopper':_0x536cac[_0x40519b]});}})[_0xcc13('0x99')](function(_0x2c51f0){logger[_0xcc13('0x5f')](_0xcc13('0x13b'),_0x2c51f0);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xcc13('0x18')][_0xcc13('0x36')]=function(){var _0x20cf6b=this;setInterval(function(){_0x20cf6b[_0xcc13('0x13c')](_0x20cf6b[_0xcc13('0x22')],_0xcc13('0x13d'));_0x20cf6b[_0xcc13('0x13c')](_0x20cf6b[_0xcc13('0xe0')],_0xcc13('0x13e'));},0x32c8);};Dialer[_0xcc13('0x18')]['clearZombieChannels']=function(_0x3d3706,_0x435e71){var _0x24378e=this;for(var _0x2fcf49 in _0x3d3706){if(typeof _0x3d3706[_0x2fcf49]!==_0xcc13('0xa5')){this[_0xcc13('0x1a')][_0xcc13('0x13f')](function(){if(!_['isNil'](_0x3d3706[_0x2fcf49])){return ami[_0xcc13('0x95')]({'action':_0xcc13('0x84'),'channel':_0x3d3706[_0x2fcf49][_0xcc13('0xe1')]})[_0xcc13('0x99')](function(_0x5bce3e){if(_0x5bce3e[_0xcc13('0x64')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3d3706[_0x2fcf49]&&_0x3d3706[_0x2fcf49]['type']!=='ivr'){_0x24378e['updateOriginated'](_0x24378e[_0xcc13('0xb6')][_0x3d3706[_0x2fcf49]['queue']]);logger[_0xcc13('0x5f')](_0xcc13('0x140'),_0x435e71,_0x2fcf49,_0x3d3706[_0x2fcf49][_0xcc13('0xbb')]);delete _0x3d3706[_0x2fcf49];}if(_0x3d3706[_0x2fcf49]&&_0x3d3706[_0x2fcf49][_0xcc13('0x3a')]===_0xcc13('0xb8')){_0x24378e[_0xcc13('0xb9')](_0x24378e[_0xcc13('0x1c')][_0x3d3706[_0x2fcf49][_0xcc13('0xbb')]]);logger[_0xcc13('0x5f')](_0xcc13('0x141'),_0x435e71,_0x2fcf49,_0x3d3706[_0x2fcf49]['queue']);delete _0x3d3706[_0x2fcf49];}},0x2328);}});}});}}};Dialer[_0xcc13('0x18')][_0xcc13('0x142')]=function(_0x10f201){return Promise[_0xcc13('0xa7')]()[_0xcc13('0x97')](voiceQueueRt[_0xcc13('0x142')](_0x10f201))[_0xcc13('0x99')](loggerCatch(_0xcc13('0x143')));};Dialer[_0xcc13('0x18')][_0xcc13('0xb9')]=function(_0x13c8e1){if(!_[_0xcc13('0x38')](_0x13c8e1)&&_0x13c8e1!==null){if(typeof _0x13c8e1[_0xcc13('0x144')]!==_0xcc13('0xa5')){if(_0x13c8e1[_0xcc13('0x144')]>0x0){_0x13c8e1[_0xcc13('0x144')]-=0x1;}else{logger[_0xcc13('0x5f')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xcc13('0x5f')](_0xcc13('0x145'));}};Dialer[_0xcc13('0x18')]['loggerHandler']=function(_0x12cfb8,_0x431aff){var _0x1fc7c4=this;return function(_0x5bef2f){_0x1fc7c4[_0xcc13('0xb9')](_0x431aff);logger[_0xcc13('0x5f')](_0x12cfb8,util['inspect'](_0x5bef2f,{'showHidden':![],'depth':null}));};};Dialer[_0xcc13('0x18')][_0xcc13('0x146')]=function(_0x3fba6a,_0x50a2bc,_0x1f4fa2){var _0x14b8dc={'state':0x19,'statedesc':_0xcc13('0x147')};this[_0xcc13('0xb9')](_0x50a2bc);this[_0xcc13('0x106')](_[_0xcc13('0x57')](_0x14b8dc,_[_0xcc13('0x71')](_0x1f4fa2,[_0xcc13('0xd1'),_0xcc13('0xdf'),_0xcc13('0x148'),_0xcc13('0xf7'),_0xcc13('0xd2')])),_0xcc13('0x149'),'[emptyContact]');logger[_0xcc13('0x5f')](_0x3fba6a);};Dialer[_0xcc13('0x18')][_0xcc13('0x106')]=function(_0x15b2e6,_0x25655c,_0x1c4568){hopperUtils['createHistory'](_0x15b2e6)[_0xcc13('0x99')](loggerCatch(_0x25655c));hopperUtils[_0xcc13('0x122')](_0x15b2e6)[_0xcc13('0x99')](loggerCatch(_0x1c4568));};Dialer[_0xcc13('0x18')]['queueCallerAbandonCreateState']=function(_0x31ab65,_0xe0e0c1){hopperUtils[_0xcc13('0xbf')](_0x31ab65)[_0xcc13('0x99')](loggerCatch(_0xcc13('0xc0')));if(_0xe0e0c1==0x0){hopperUtils['moveContactManagedDialer'](_0x31ab65)[_0xcc13('0x99')](loggerCatch(_0xcc13('0x14a')));}};Dialer[_0xcc13('0x18')][_0xcc13('0x13b')]=function(_0xf80c2f){return Promise[_0xcc13('0xa7')]()['then'](cmHopper[_0xcc13('0x14b')](_0xf80c2f['id'],previewRecallmeReminderInterval))[_0xcc13('0x97')](function(_0x1f86d9){for(var _0x13fafd=0x0;_0x13fafd<_0x1f86d9[_0xcc13('0x93')];_0x13fafd++){var _0x2b8451=_0x1f86d9[_0x13fafd][_0xcc13('0x138')]['name'];if(_0x2b8451)io['to'](util[_0xcc13('0x3e')](_0xcc13('0x139'),_0x2b8451))[_0xcc13('0x39')](_0xcc13('0x13a'),{'hopper':_0x1f86d9[_0x13fafd]});}})[_0xcc13('0x99')](function(){});};Dialer[_0xcc13('0x18')]['launchHandleIvr']=function(_0x1069ff){var _0x19299e=this;return function(){_0x19299e[_0xcc13('0x14c')](_0x1069ff);};};Dialer[_0xcc13('0x18')][_0xcc13('0x14d')]=function(_0x3e2d74,_0x262b4a){var _0x39e0a=this;var _0x45874d=uuid['v4']();this[_0xcc13('0xe0')][_0x45874d]=new Action(_0x3e2d74,_0x262b4a,_0x45874d);return new Promise(function(_0x1e28fe,_0x177f14){if(_[_0xcc13('0x38')](_0x3e2d74)&&typeof _0x3e2d74!==_0xcc13('0x14e')){return _0x177f14(msgResponse(_0xcc13('0x14f'),_0xcc13('0x8c'),_0xcc13('0x150')));}if(_[_0xcc13('0x38')](_0x262b4a[_0xcc13('0x151')])||_0x262b4a[_0xcc13('0x151')]===null){return _0x177f14(msgResponse(_0xcc13('0x14f'),_0xcc13('0x8c'),_0xcc13('0x152')));}var _0xcb29bf={'XMD-CALLERID':_0x39e0a[_0xcc13('0xe0')][_0x45874d][_0xcc13('0x153')](),'XMD-AGI':_0x3e2d74['dialQueueProject']?util[_0xcc13('0x3e')](_0xcc13('0x154'),ipAgi,_0x3e2d74['dialQueueProject']):_0xcc13('0x155'),'XMD-AGIAFTER':_0x3e2d74[_0xcc13('0xbe')]?util['format'](_0xcc13('0x154'),ipAgi,_0x3e2d74[_0xcc13('0xbe')]):_0xcc13('0x155'),'XMD-QUEUE':utils[_0xcc13('0x156')](_0x3e2d74)?util[_0xcc13('0x3e')](_0xcc13('0x157'),_0x3e2d74[_0xcc13('0x5a')],_0x3e2d74[_0xcc13('0x158')]||'',_0x3e2d74['dialAgiAfterHangupAgent']?'c':'',_0x3e2d74[_0xcc13('0xc4')]||0x3):_0xcc13('0x155'),'XMD-CONTACTID':_0x262b4a[_0xcc13('0xd1')],'XMD-CDRTYPE':_0xcc13('0x159'),'CALLERID(all)':_0x39e0a['actions'][_0x45874d][_0xcc13('0x153')](),'XMD-AMD':_0x3e2d74[_0xcc13('0x109')]?_0xcc13('0x12f'):_0xcc13('0x155'),'XMD-DESTINATION':_0xcc13('0x100')};if(_0x3e2d74[_0xcc13('0x109')]){_0xcb29bf[_0xcc13('0x15a')]=_0x3e2d74['dialAMDInitialSilence']||0x9c4;_0xcb29bf['XMD-AMDGREETING']=_0x3e2d74[_0xcc13('0x15b')]||0x5dc;_0xcb29bf[_0xcc13('0x15c')]=_0x3e2d74[_0xcc13('0x15d')]||0x320;_0xcb29bf['XMD-AMDTOTALANALYSISTIME']=_0x3e2d74[_0xcc13('0x15e')]||0x1388;_0xcb29bf[_0xcc13('0x15f')]=_0x3e2d74[_0xcc13('0x160')]||0x64;_0xcb29bf[_0xcc13('0x161')]=_0x3e2d74[_0xcc13('0x162')]||0x32;_0xcb29bf[_0xcc13('0x163')]=_0x3e2d74[_0xcc13('0x164')]||0x3;_0xcb29bf[_0xcc13('0x165')]=_0x3e2d74[_0xcc13('0x166')]||0x100;_0xcb29bf[_0xcc13('0x167')]=_0x3e2d74['dialAMDMaximumWordLength']||0x1388;}if(utils[_0xcc13('0x156')](_0x3e2d74)){_0xcb29bf['XMD-VOICEQUEUEID']=_0x262b4a['VoiceQueueId'];}else{_0xcb29bf['XMD-CAMPAIGNID']=_0x262b4a[_0xcc13('0xd2')];}var _0x1bebba=utils[_0xcc13('0x168')](_0x262b4a[_0xcc13('0x169')]);Object['assign'](_0xcb29bf,_0x1bebba);var _0x47009f=_0x39e0a['isTrunkReachable'](_0x3e2d74[_0xcc13('0x87')])?utils[_0xcc13('0x16a')](_0x3e2d74[_0xcc13('0x87')][_0xcc13('0x16b')],_0x3e2d74[_0xcc13('0x16c')],_0x3e2d74['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xcc13('0x16d')](_0x3e2d74[_0xcc13('0x16e')],_0x3e2d74[_0xcc13('0x16f')]):_0x3e2d74[_0xcc13('0x16e')]):utils[_0xcc13('0x16a')](_[_0xcc13('0xe6')](_0x3e2d74['TrunkBackup'])?_0x3e2d74[_0xcc13('0x87')]['callerid']:_0x3e2d74['TrunkBackup'][_0xcc13('0x16b')],_0x3e2d74['dialOriginateCallerIdName'],_0x3e2d74['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xcc13('0x16d')](_0x3e2d74['dialOriginateCallerIdNumber'],_0x3e2d74[_0xcc13('0x16f')]):_0x3e2d74['dialOriginateCallerIdNumber']);if(_0x47009f){_0xcb29bf['XMD-ORIGINATECALLERIDNAME']=_0x39e0a[_0xcc13('0xe0')][_0x45874d][_0xcc13('0x170')]=utils[_0xcc13('0x171')](_0x47009f);_0xcb29bf[_0xcc13('0x172')]=_0x262b4a[_0xcc13('0x151')];}_0x3e2d74[_0xcc13('0x173')]=_0xcb29bf;return ami[_0xcc13('0x95')]({'actionid':_0x45874d,'action':_0xcc13('0x14f'),'channel':_0x39e0a[_0xcc13('0x80')](_0x3e2d74[_0xcc13('0x87')])?util[_0xcc13('0x3e')](_0xcc13('0x174'),_0x3e2d74[_0xcc13('0x87')][_0xcc13('0x5a')],isNotNull(_0x3e2d74[_0xcc13('0x175')])?_0x3e2d74[_0xcc13('0x175')][_0xcc13('0x176')]()||'':'',_0x3e2d74[_0xcc13('0x177')]>0x0?_0x262b4a[_0xcc13('0x151')][_0xcc13('0x178')](_0x3e2d74[_0xcc13('0x177')]):_0x262b4a[_0xcc13('0x151')]):util[_0xcc13('0x3e')](_0xcc13('0x174'),_['isNil'](_0x3e2d74[_0xcc13('0x179')])?_0x3e2d74[_0xcc13('0x87')][_0xcc13('0x5a')]:_0x3e2d74[_0xcc13('0x179')][_0xcc13('0x5a')],isNotNull(_0x3e2d74[_0xcc13('0x175')])?_0x3e2d74[_0xcc13('0x175')][_0xcc13('0x176')]()||'':'',_0x3e2d74[_0xcc13('0x177')]>0x0?_0x262b4a[_0xcc13('0x151')][_0xcc13('0x178')](_0x3e2d74[_0xcc13('0x177')]):_0x262b4a['phone']),'callerid':_0x47009f,'Exten':_0xcc13('0x100'),'Context':_0xcc13('0x17a'),'Priority':'1','variable':_0xcb29bf,'timeout':(_0x3e2d74[_0xcc13('0x17b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x45874d})[_0xcc13('0x97')](function(_0x126725){return _0x1e28fe(_0x126725);})[_0xcc13('0x99')](function(_0x2df345){_0x3e2d74[_0xcc13('0x17c')]+=0x1;var _0x4a79f7=new History(_0x39e0a[_0xcc13('0xe0')][_0x45874d]);logger[_0xcc13('0x5f')](util[_0xcc13('0x3e')]('[originateError]:\x20%s',JSON[_0xcc13('0x70')](_0x2df345)));_0x4a79f7[_0xcc13('0x6a')]=0xe;_0x4a79f7['statedesc']='OriginateError';_0x4a79f7['starttime']=moment()[_0xcc13('0x3e')](_0xcc13('0xba'));_0x4a79f7[_0xcc13('0x6c')]=_0x4a79f7[_0xcc13('0x6d')];hopperUtils[_0xcc13('0xbf')](_0x4a79f7)['catch'](loggerCatch(_0xcc13('0x17d')));_0x39e0a[_0xcc13('0x122')](_0x4a79f7)[_0xcc13('0x99')](loggerCatch(_0xcc13('0x17d')))[_0xcc13('0xf5')](function(){delete _0x39e0a[_0xcc13('0xe0')][_0x45874d];return _0x177f14(msgResponse(_0xcc13('0x14f'),_0xcc13('0x7f'),'originate\x20action\x20Error'));});});});};Dialer['prototype'][_0xcc13('0x17e')]=function(_0x169162,_0x463195,_0x519178){var _0x5afecc=new History(_0x463195);if(_0x5afecc[_0xcc13('0x110')]+_0x5afecc[_0xcc13('0x111')]+_0x5afecc[_0xcc13('0x112')]+_0x5afecc[_0xcc13('0x11c')]+_0x5afecc[_0xcc13('0xc8')]+_0x5afecc[_0xcc13('0xde')]+_0x5afecc[_0xcc13('0x10d')]+_0x5afecc['countagentrejectretry']>=_0x519178[_0xcc13('0x114')]-0x1){return!![];}switch(_0x169162){case 0x3:if(_0x5afecc[_0xcc13('0x112')]>=_0x519178[_0xcc13('0x17f')]-0x1){return!![];}hopperUtils[_0xcc13('0xdd')]({'active':![],'countnoanswerretry':_0x5afecc[_0xcc13('0x112')]+=0x1,'scheduledat':moment()[_0xcc13('0xce')](_0x519178[_0xcc13('0x180')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5afecc[_0xcc13('0xd1')],'ListId':_0x5afecc[_0xcc13('0xdf')],'VoiceQueueId':_0x5afecc[_0xcc13('0xf7')]||undefined,'CampaignId':_0x5afecc[_0xcc13('0xd2')]||undefined})[_0xcc13('0x99')](loggerCatch(_0xcc13('0x181')));break;case 0x5:if(_0x5afecc['countbusyretry']>=_0x519178['dialBusyMaxRetry']-0x1){return!![];}hopperUtils[_0xcc13('0xdd')]({'active':![],'countbusyretry':_0x5afecc['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x519178[_0xcc13('0x182')],_0xcc13('0xd0'))[_0xcc13('0x3e')](_0xcc13('0xba')),'ContactId':_0x5afecc[_0xcc13('0xd1')],'ListId':_0x5afecc[_0xcc13('0xdf')],'VoiceQueueId':_0x5afecc['VoiceQueueId']||undefined,'CampaignId':_0x5afecc[_0xcc13('0xd2')]||undefined})[_0xcc13('0x99')](loggerCatch(_0xcc13('0x183')));break;case 0x8:if(_0x5afecc[_0xcc13('0x111')]>=_0x519178[_0xcc13('0x184')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x5afecc[_0xcc13('0x111')]+=0x1,'scheduledat':moment()[_0xcc13('0xce')](_0x519178['dialCongestionRetryFrequency'],_0xcc13('0xd0'))[_0xcc13('0x3e')](_0xcc13('0xba')),'ContactId':_0x5afecc['ContactId'],'ListId':_0x5afecc['ListId'],'VoiceQueueId':_0x5afecc[_0xcc13('0xf7')]||undefined,'CampaignId':_0x5afecc[_0xcc13('0xd2')]||undefined})[_0xcc13('0x99')](loggerCatch(_0xcc13('0x185')));break;case 0x0:if(_0x5afecc[_0xcc13('0x11c')]>=_0x519178[_0xcc13('0x186')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x5afecc[_0xcc13('0x11c')]+=0x1,'scheduledat':moment()[_0xcc13('0xce')](_0x519178[_0xcc13('0x187')],_0xcc13('0xd0'))[_0xcc13('0x3e')](_0xcc13('0xba')),'ContactId':_0x5afecc['ContactId'],'ListId':_0x5afecc[_0xcc13('0xdf')],'VoiceQueueId':_0x5afecc[_0xcc13('0xf7')]||undefined,'CampaignId':_0x5afecc[_0xcc13('0xd2')]||undefined})[_0xcc13('0x99')](loggerCatch(_0xcc13('0x188')));}break;case 0xa:if(_0x5afecc[_0xcc13('0xc8')]>=_0x519178[_0xcc13('0xcb')]-0x1){return!![];}hopperUtils[_0xcc13('0xdd')]({'active':![],'countdropretry':_0x5afecc[_0xcc13('0xc8')]+=0x1,'scheduledat':moment()[_0xcc13('0xce')](_0x519178[_0xcc13('0xcf')],'minutes')[_0xcc13('0x3e')](_0xcc13('0xba')),'ContactId':_0x5afecc[_0xcc13('0xd1')],'ListId':_0x5afecc[_0xcc13('0xdf')],'VoiceQueueId':_0x5afecc[_0xcc13('0xf7')]||undefined,'CampaignId':_0x5afecc['CampaignId']||undefined})[_0xcc13('0x99')](loggerCatch(_0xcc13('0xd3')));break;case 0xb:if(_0x5afecc[_0xcc13('0xde')]>=_0x519178[_0xcc13('0xdc')]-0x1){return!![];}hopperUtils[_0xcc13('0xdd')]({'active':![],'countabandonedretry':_0x5afecc[_0xcc13('0xde')]+=0x1,'scheduledat':moment()['add'](_0x519178['dialAbandonedRetryFrequency'],_0xcc13('0xd0'))[_0xcc13('0x3e')](_0xcc13('0xba')),'ContactId':_0x5afecc[_0xcc13('0xd1')],'ListId':_0x5afecc['ListId'],'VoiceQueueId':_0x5afecc[_0xcc13('0xf7')]||undefined,'CampaignId':_0x5afecc[_0xcc13('0xd2')]||undefined})[_0xcc13('0x99')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x5afecc['countmachineretry']>=_0x519178['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x5afecc[_0xcc13('0x10d')]+=0x1,'scheduledat':moment()[_0xcc13('0xce')](_0x519178['dialMachineRetryFrequency'],_0xcc13('0xd0'))[_0xcc13('0x3e')](_0xcc13('0xba')),'ContactId':_0x5afecc[_0xcc13('0xd1')],'ListId':_0x5afecc[_0xcc13('0xdf')],'VoiceQueueId':_0x5afecc[_0xcc13('0xf7')]||undefined,'CampaignId':_0x5afecc[_0xcc13('0xd2')]||undefined})[_0xcc13('0x99')](loggerCatch(_0xcc13('0x11f')));break;case 0x14:if(_0x5afecc[_0xcc13('0x113')]>=_0x519178[_0xcc13('0x189')]-0x1){return!![];}hopperUtils[_0xcc13('0xdd')]({'active':![],'countagentrejectretry':_0x5afecc[_0xcc13('0x113')]+=0x1,'scheduledat':moment()[_0xcc13('0xce')](_0x519178['dialAgentRejectRetryFrequency'],_0xcc13('0xd0'))[_0xcc13('0x3e')](_0xcc13('0xba')),'ContactId':_0x5afecc[_0xcc13('0xd1')],'ListId':_0x5afecc[_0xcc13('0xdf')],'VoiceQueueId':_0x5afecc[_0xcc13('0xf7')]||undefined,'CampaignId':_0x5afecc[_0xcc13('0xd2')]||undefined})[_0xcc13('0x99')](loggerCatch(_0xcc13('0x18a')));break;default:return!![];}};Dialer[_0xcc13('0x18')][_0xcc13('0xfc')]=function(_0x4012a3,_0x39bc1e,_0x3cdf10){var _0x1de30e=this;var _0x371406=new History(_0x4012a3);var _0x346bb9=![];var _0x5b2a57;var _0xc1907f;return new Promise(function(_0x51cfb7,_0x101233){if(_['isUndefined'](_0x39bc1e)&&typeof _0x39bc1e!==_0xcc13('0x14e')){return _0x101233(msgResponse(_0xcc13('0x18b'),_0xcc13('0x8c'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0x3cdf10)&&typeof _0x3cdf10!==_0xcc13('0x14e')){return _0x101233(msgResponse(_0xcc13('0x18b'),_0xcc13('0x8c'),_0xcc13('0x18c')));}hopperUtils['verifyAdditionalPhones'](_0x371406,_0x3cdf10[_0xcc13('0x18d')],_0x39bc1e)[_0xcc13('0x97')](function(_0x5f132c){if(_0x5f132c[_0xcc13('0xcd')]==0x1)_0x346bb9=!![];switch(_0x3cdf10[_0xcc13('0x18d')]){case'0':_0x39bc1e[_0xcc13('0x18e')]+=0x1;_0x371406[_0xcc13('0x6a')]=0x0;_0x371406[_0xcc13('0x6b')]=_0xcc13('0x18f');_0x371406[_0xcc13('0x11c')]+=0x1;_0x371406[_0xcc13('0xdb')]+=0x1;ami[_0xcc13('0x39')](_0xcc13('0x190'),ut['buildObj'](_0x4012a3,_0xcc13('0x191')));_0x5b2a57=_0x39bc1e['dialNoSuchNumberRetryFrequency'];_0xc1907f=_0x39bc1e[_0xcc13('0xc9')];hopperUtils[_0xcc13('0xbf')](_0x371406)[_0xcc13('0x99')](loggerCatch(_0xcc13('0x10f')));if(_0x1de30e[_0xcc13('0x17e')](0x0,_0x4012a3,_0x39bc1e)&&!_0x346bb9){if(_0x371406['countnosuchnumberretry']>=_0x39bc1e[_0xcc13('0x186')]){_0x1de30e[_0xcc13('0x116')](_0x371406,_0x51cfb7,_0x101233,_0xcc13('0x192'));}else{_0x1de30e[_0xcc13('0x115')](_0x371406,_0x51cfb7,_0x101233,_0xcc13('0x192'));}}break;case'3':_0x39bc1e[_0xcc13('0x193')]+=0x1;_0x371406[_0xcc13('0x6a')]=0x3;_0x371406[_0xcc13('0x6b')]=_0xcc13('0x194');_0x371406[_0xcc13('0x112')]+=0x1;_0x371406[_0xcc13('0xdb')]+=0x1;var _0x400674=ut['buildNoAnswerEventPayload'](_0x4012a3,_0x39bc1e);ami[_0xcc13('0x39')]('custom:agentnoanswer',_0x400674);_0x5b2a57=_0x39bc1e['dialNoAnswerRetryFrequency'];_0xc1907f=_0x39bc1e[_0xcc13('0xc9')];hopperUtils['createHistory'](_0x371406)[_0xcc13('0x99')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x1de30e[_0xcc13('0x17e')](0x3,_0x4012a3,_0x39bc1e)&&!_0x346bb9){if(_0x371406['countnoanswerretry']>=_0x39bc1e[_0xcc13('0x17f')]){_0x1de30e[_0xcc13('0x116')](_0x371406,_0x51cfb7,_0x101233,_0xcc13('0x195'));}else{_0x1de30e[_0xcc13('0x115')](_0x371406,_0x51cfb7,_0x101233,_0xcc13('0x195'));}}break;case'5':_0x39bc1e[_0xcc13('0x196')]+=0x1;_0x371406[_0xcc13('0x6a')]=0x5;_0x371406[_0xcc13('0x6b')]='Busy';_0x371406[_0xcc13('0x110')]+=0x1;_0x371406[_0xcc13('0xdb')]+=0x1;ami[_0xcc13('0x39')]('custom:agentbusy',ut['buildObj'](_0x4012a3,_0xcc13('0x197')));_0x5b2a57=_0x39bc1e[_0xcc13('0x182')];_0xc1907f=_0x39bc1e['callAdditionalPhoneAfterMin'];hopperUtils[_0xcc13('0xbf')](_0x371406)[_0xcc13('0x99')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x1de30e[_0xcc13('0x17e')](0x5,_0x4012a3,_0x39bc1e)&&!_0x346bb9){if(_0x371406[_0xcc13('0x110')]>=_0x39bc1e[_0xcc13('0x198')]){_0x1de30e[_0xcc13('0x116')](_0x371406,_0x51cfb7,_0x101233,'reason\x205\x20busy');}else{_0x1de30e['stateGlobal'](_0x371406,_0x51cfb7,_0x101233,'reason\x205\x20busy');}}break;case'8':_0x39bc1e[_0xcc13('0x199')]+=0x1;_0x371406['state']=0x8;_0x371406['statedesc']=_0xcc13('0x19a');_0x371406[_0xcc13('0x111')]+=0x1;_0x371406[_0xcc13('0xdb')]+=0x1;_0x5b2a57=_0x39bc1e['dialCongestionRetryFrequency'];_0xc1907f=_0x39bc1e[_0xcc13('0xc9')];ami[_0xcc13('0x39')]('custom:agentcongestion',ut[_0xcc13('0x105')](_0x4012a3,_0xcc13('0x19b')));hopperUtils['createHistory'](_0x371406)[_0xcc13('0x99')](loggerCatch(_0xcc13('0x19c')));if(_0x1de30e[_0xcc13('0x17e')](0x8,_0x4012a3,_0x39bc1e)&&!_0x346bb9){if(_0x371406[_0xcc13('0x111')]>=_0x39bc1e['dialCongestionMaxRetry']){_0x1de30e[_0xcc13('0x116')](_0x371406,_0x51cfb7,_0x101233,_0xcc13('0x19d'));}else{_0x1de30e[_0xcc13('0x115')](_0x371406,_0x51cfb7,_0x101233,_0xcc13('0x19d'));}}break;case'11':_0x39bc1e[_0xcc13('0x19e')]+=0x1;_0x371406[_0xcc13('0x6a')]=0xb;_0x371406[_0xcc13('0x6b')]=_0xcc13('0xd9');_0x371406[_0xcc13('0xde')]+=0x1;_0x371406[_0xcc13('0xdb')]+=0x1;_0x5b2a57=_0x39bc1e[_0xcc13('0x19f')];_0xc1907f=_0x39bc1e[_0xcc13('0xc9')];hopperUtils['createHistory'](_0x371406)['catch'](loggerCatch(_0xcc13('0x1a0')));if(_0x1de30e[_0xcc13('0x17e')](0xb,_0x4012a3,_0x39bc1e)&&!_0x346bb9){if(_0x371406[_0xcc13('0xde')]>=_0x39bc1e[_0xcc13('0xdc')]){_0x1de30e[_0xcc13('0x116')](_0x371406,_0x51cfb7,_0x101233,'reason\x2011\x20abandoned');}else{_0x1de30e[_0xcc13('0x115')](_0x371406,_0x51cfb7,_0x101233,_0xcc13('0x1a1'));}}break;case'20':_0x39bc1e[_0xcc13('0x1a2')]+=0x1;_0x371406['state']=0x14;_0x371406[_0xcc13('0x6b')]=_0xcc13('0x1a3');_0x371406[_0xcc13('0x113')]+=0x1;_0x371406[_0xcc13('0xdb')]+=0x1;_0x5b2a57=_0x39bc1e['dialAgentRejectRetryFrequency'];_0xc1907f=_0x39bc1e['callAdditionalPhoneAfterMin'];ami[_0xcc13('0x39')](_0xcc13('0x1a4'),ut['buildObj'](_0x4012a3,_0xcc13('0x1a5')));hopperUtils['createHistory'](_0x371406)[_0xcc13('0x99')](loggerCatch(_0xcc13('0x1a6')));if(_0x1de30e[_0xcc13('0x17e')](0x14,_0x4012a3,_0x39bc1e)&&!_0x346bb9){if(_0x371406[_0xcc13('0x113')]>=_0x39bc1e['dialAgentRejectMaxRetry']){_0x1de30e['createStateFinal'](_0x371406,_0x51cfb7,_0x101233,_0xcc13('0x1a7'));}else{_0x1de30e['stateGlobal'](_0x371406,_0x51cfb7,_0x101233,_0xcc13('0x1a7'));}}break;default:_0x39bc1e['outboundUnknownCallsDay']+=0x1;_0x371406[_0xcc13('0x6a')]=0xc;_0x371406[_0xcc13('0x6b')]=_0x3cdf10[_0xcc13('0x18d')];_0x5b2a57=_0x39bc1e['dialAgentRejectRetryFrequency'];_0xc1907f=_0x39bc1e[_0xcc13('0xc9')];hopperUtils[_0xcc13('0xbf')](_0x371406)['catch'](loggerCatch(_0xcc13('0x1a8')));if(_0x1de30e[_0xcc13('0x17e')](_0x3cdf10[_0xcc13('0x18d')],_0x4012a3,_0x39bc1e)&&!_0x346bb9){if(_0x371406[_0xcc13('0x110')]+_0x371406[_0xcc13('0x111')]+_0x371406['countnoanswerretry']+_0x371406['countnosuchnumberretry']+_0x371406[_0xcc13('0xc8')]+_0x371406[_0xcc13('0xde')]+_0x371406[_0xcc13('0x10d')]+_0x371406[_0xcc13('0x113')]>=_0x39bc1e[_0xcc13('0x114')]){_0x1de30e[_0xcc13('0x115')](_0x371406,_0x51cfb7,_0x101233,_0x3cdf10[_0xcc13('0x18d')]);}else{_0x1de30e[_0xcc13('0x116')](_0x371406,_0x51cfb7,_0x101233,_0x3cdf10[_0xcc13('0x18d')]);}}}})[_0xcc13('0x97')](function(){if(_0x346bb9){hopperUtils[_0xcc13('0xd7')](_0x371406,_0x5b2a57,_0xc1907f)[_0xcc13('0x97')](function(){return _0x51cfb7(0x1);});}});});};Dialer['prototype']['stateGlobal']=function(_0x2c83f0,_0x182fc8,_0x50509f,_0x27c27b){var _0x5d5209=new Final(_0x2c83f0);_0x5d5209['state']=0xf;_0x5d5209['statedesc']='Global';this[_0xcc13('0x116')](_0x5d5209,_0x182fc8,_0x50509f,_0x27c27b);};Dialer[_0xcc13('0x18')][_0xcc13('0x116')]=function(_0x3e155b,_0x441a11,_0x4b092f,_0x31cafe){hopperUtils['moveContactManagedDialer'](_0x3e155b)[_0xcc13('0x97')](function(){return _0x441a11(msgResponse(_0xcc13('0x18b'),_0xcc13('0xfb'),_0x31cafe));})[_0xcc13('0x99')](function(){return _0x4b092f(msgResponse(_0xcc13('0x1a9'),_0xcc13('0x8c'),_0xcc13('0x1aa')));});};Dialer[_0xcc13('0x18')]['predictive']=function(_0x15dde1){var _0x43a7f8=_0x15dde1[_0xcc13('0x1ab')]/0x64;var _0x16df7b=_0x15dde1[_0xcc13('0x1ac')]/(_0x15dde1[_0xcc13('0x1ac')]+_0x15dde1[_0xcc13('0xbc')]);var _0xd33391=Math[_0xcc13('0x1ad')](_0x15dde1['predictiveIntervalAvailable']*(_0x15dde1[_0xcc13('0x1ae')]/0x64));var _0x489233=Math[_0xcc13('0x1ad')](_0x15dde1['predictiveIntervalAvailable']*(_0x15dde1[_0xcc13('0x1af')]/0x64));var _0x5a3a9c=_0x15dde1['available']+_0x15dde1[_0xcc13('0x12e')];var _0x2b85ca=Math[_0xcc13('0x1b0')](_0x15dde1[_0xcc13('0x52')]*_0x15dde1[_0xcc13('0x55')]*_0x15dde1[_0xcc13('0x1b1')]*_0x15dde1[_0xcc13('0x1b2')]);if(_[_0xcc13('0x38')](_0x15dde1[_0xcc13('0x59')])){if(!_[_0xcc13('0x38')](_0x15dde1['startPredictive'])){_0x15dde1[_0xcc13('0x24')]=undefined;loggerPredictive[_0xcc13('0x5f')](_0xcc13('0x1b3'),_0xcc13('0x1b4'));}if(!_[_0xcc13('0x38')](_0x15dde1[_0xcc13('0x5d')])){loggerPredictive[_0xcc13('0x5f')](_0xcc13('0x1b3'),_0xcc13('0x1b5'));clearInterval(_0x15dde1[_0xcc13('0x5d')]);_0x15dde1[_0xcc13('0x5d')]=undefined;}_0x15dde1['startProgressive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x15dde1[_0xcc13('0x5a')],_0xcc13('0x1b6'),_0x15dde1[_0xcc13('0x59')]);this['handlePower'](_0x15dde1,0x1);}else if(ifInterval(_0x15dde1[_0xcc13('0x1b7')],_0x15dde1['startProgressive'])){this[_0xcc13('0xae')](_0x15dde1,0x1);loggerPredictiveCalls['info'](_0xcc13('0x1b8'),_0x15dde1['startProgressive'],_0x15dde1[_0xcc13('0x5a')]);_0x15dde1['erlangCalls']=0x0;_0x15dde1['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x43a7f8<_0x16df7b&&_0x15dde1[_0xcc13('0x1b9')]==='dropRate'){clearPredictiveAttributes(_0x15dde1);loggerPredictive[_0xcc13('0x42')](_0xcc13('0x1ba'),_0xcc13('0x1bb'),_0x16df7b,_0xcc13('0x59'),_0x15dde1[_0xcc13('0x5a')]);}else if(_0x2b85ca<_0x15dde1[_0xcc13('0x1bc')]&&_0x15dde1['dialPredictiveOptimization']===_0xcc13('0x1bd')){clearPredictiveAttributes(_0x15dde1);loggerPredictive[_0xcc13('0x42')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xcc13('0x1be'),_0x2b85ca,_0xcc13('0x1bf'),_0x15dde1['predictiveIntervalErlangCallsDroppedCalls'],_0xcc13('0x59'),_0x15dde1[_0xcc13('0x5a')]);}else if(!ifInterval(_0x15dde1[_0xcc13('0x1b7')],_0x15dde1['startProgressive'])&&_[_0xcc13('0x38')](_0x15dde1['startPredictive'])&&!_['isUndefined'](_0x15dde1[_0xcc13('0x59')])){_0x15dde1[_0xcc13('0x24')]=moment()[_0xcc13('0x3e')](_0xcc13('0xba'));loggerPredictive[_0xcc13('0x42')](_0x15dde1[_0xcc13('0x5a')],'started\x20in\x20predictive\x20at',_0x15dde1[_0xcc13('0x24')]);hopperUtils[_0xcc13('0x1c0')](_0x15dde1[_0xcc13('0x1b7')])[_0xcc13('0x97')](this[_0xcc13('0x1c1')](_0x15dde1))[_0xcc13('0x97')](mergeDataErlangB(_0x15dde1))[_0xcc13('0x97')](this[_0xcc13('0x1c2')](_0x15dde1))[_0xcc13('0x99')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x15dde1));}else if(!ifInterval(_0x15dde1['dialPredictiveInterval'],_0x15dde1[_0xcc13('0x24')])){_0x15dde1[_0xcc13('0x1bc')]=0x0;_0x15dde1[_0xcc13('0x24')]=moment()[_0xcc13('0x3e')](_0xcc13('0xba'));loggerPredictive['info'](_0x15dde1['name'],_0xcc13('0x1c3'),_0x15dde1[_0xcc13('0x24')]);clearInterval(_0x15dde1['handlePredictive']);_0x15dde1[_0xcc13('0x5d')]=undefined;hopperUtils['avgHandleTime'](_0x15dde1[_0xcc13('0x1b7')])['then'](this[_0xcc13('0x1c1')](_0x15dde1))[_0xcc13('0x97')](mergeDataErlangB(_0x15dde1))[_0xcc13('0x97')](this[_0xcc13('0x1c2')](_0x15dde1))[_0xcc13('0x99')](loggerCatchPredictive(_0xcc13('0x1c4'),_0x15dde1));}else if(_0x15dde1[_0xcc13('0x1c5')]&&_0x5a3a9c<_0x15dde1['predictiveIntervalAvailable']-_0x489233){clearPredictiveAttributes(_0x15dde1);loggerPredictive['info'](_0x15dde1['name'],_0xcc13('0x1c6'),_0x5a3a9c,_0xcc13('0x1c7'),_0x15dde1['predictiveIntervalAvailable'],'-',_0x489233,'=',_0x15dde1[_0xcc13('0x1c5')]-_0x489233,')');}else if(_0x15dde1['predictiveIntervalAvailable']&&_0x5a3a9c>_0x15dde1['predictiveIntervalAvailable']+_0xd33391){clearPredictiveAttributes(_0x15dde1);loggerPredictive[_0xcc13('0x42')](_0x15dde1[_0xcc13('0x5a')],_0xcc13('0x1c6'),_0x5a3a9c,_0xcc13('0x1c8'),_0x15dde1['predictiveIntervalAvailable'],'+',_0xd33391,'=',_0x15dde1[_0xcc13('0x1c5')]+_0xd33391,')');}};Dialer[_0xcc13('0x18')][_0xcc13('0x1c1')]=function(_0x4283e1){var _0x4b0d02=this;return function(_0x2f7a48){return new Promise(function(_0x5937b7,_0x53feac){_[_0xcc13('0x57')](_0x4283e1,_0x2f7a48[0x0]);if(checkGetDataPredictive(_0x2f7a48[0x0])){var _0x41921c=_0x4283e1[_0xcc13('0x1c5')]=_0x4283e1[_0xcc13('0x12e')]+_0x4283e1['available'];var _0x23c248=_0x4283e1[_0xcc13('0x1b7')]*0x3c;var _0x392923=_0x2f7a48[0x0][_0xcc13('0x4b')]+_0x2f7a48[0x0]['predictiveIntervalAvgHoldtime'];var _0x4bf83d=(_0x2f7a48[0x0]['predictiveIntervalAnsweredCalls']+_0x2f7a48[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2f7a48[0x0][_0xcc13('0xd8')])/_0x2f7a48[0x0][_0xcc13('0x4d')];_0x4283e1['predictiveIntervalHitRate']=_0x4bf83d>0x0?_0x4bf83d:0x1;switch(_0x4283e1['dialPredictiveOptimization']){case _0xcc13('0x1bd'):var _0x40df4f=_0x4283e1[_0xcc13('0x1ab')]/0x64;return _0x4b0d02[_0xcc13('0x1c9')](_0x41921c,_0x23c248,_0x392923,_0x4bf83d,_0x40df4f)[_0xcc13('0x97')](function(_0x19be63){return _0x5937b7(_0x19be63);});case _0xcc13('0x1ca'):var _0x23c738=_0x4283e1['dialPredictiveOptimizationPercentage']/0x64;return _0x4b0d02[_0xcc13('0x1cb')](_0x41921c,_0x23c248,_0x392923,_0x4bf83d,_0x23c738)[_0xcc13('0x97')](function(_0x1af5a1){return _0x5937b7(_0x1af5a1);});default:return _0x53feac(msgResponse(_0xcc13('0x1cc'),_0xcc13('0x8c'),'Unknown\x20Predictive'));}}else{return _0x53feac(msgResponse(_0xcc13('0x1cc'),'Failure',_0xcc13('0x1cd')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x205256){var _0x26c288=this;return function(_0x1aa718){return new Promise(function(_0x8f7180,_0x4f80b9){_[_0xcc13('0x57')](_0x205256,_0x1aa718[0x0]);if(checkGetDataPredictive(_0x1aa718[0x0])){loggerPredictive['info'](JSON[_0xcc13('0x70')](_0x1aa718[0x0]));if(_0x205256['dialPredictiveOptimization']===_0xcc13('0x1bd')){return _0x26c288[_0xcc13('0x142')](_0x205256['id'])['then'](function(_0x2e70db){var _0x4315be=_0x205256[_0xcc13('0x1ce')]-_0x2e70db[0x0]['outboundQueuePauses'];var _0x3f3566=_0x205256['dialPredictiveInterval']*0x3c;var _0xde60f=_0x1aa718[0x0]['predictiveIntervalAvgTalktime']+_0x1aa718[0x0][_0xcc13('0x49')];var _0x5465c7=(_0x1aa718[0x0][_0xcc13('0x46')]+_0x1aa718[0x0][_0xcc13('0x1cf')]+_0x1aa718[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1aa718[0x0][_0xcc13('0x4d')];var _0x3d2d6f=_0x205256[_0xcc13('0x1ab')]/0x64;_0x205256[_0xcc13('0x1d0')]=_0x2e70db[0x0][_0xcc13('0x1d1')]||0x0;_0x205256[_0xcc13('0x1b1')]=_0x5465c7>0x0?_0x5465c7:0x1;return _0x26c288[_0xcc13('0x1c9')](_0x4315be,_0x3f3566,_0xde60f,_0x5465c7,_0x3d2d6f);})[_0xcc13('0x97')](function(_0x260cad){return _0x8f7180(_0x260cad);})[_0xcc13('0x99')](function(_0x4b0b39){return _0x4f80b9(msgResponse('[CatchErlangB]','Failure',JSON[_0xcc13('0x70')](_0x4b0b39)));});}if(_0x205256[_0xcc13('0x1b9')]===_0xcc13('0x1ca')){return _0x26c288[_0xcc13('0x142')](_0x205256['id'])[_0xcc13('0x97')](function(_0x42d907){var _0x8303e2=_0x205256[_0xcc13('0x1ce')]-_0x42d907[0x0]['outboundQueuePauses'];var _0x107291=_0x205256[_0xcc13('0x1b7')]*0x3c;var _0x421da1=_0x1aa718[0x0][_0xcc13('0x4b')]+_0x1aa718[0x0][_0xcc13('0x49')];var _0x15aef8=(_0x1aa718[0x0]['predictiveIntervalAnsweredCalls']+_0x1aa718[0x0][_0xcc13('0x1cf')]+_0x1aa718[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1aa718[0x0][_0xcc13('0x4d')];var _0x291d5d=_0x205256[_0xcc13('0x1ab')]/0x64;_0x205256[_0xcc13('0x1d0')]=_0x42d907[0x0][_0xcc13('0x1d1')]||0x0;_0x205256['predictiveIntervalHitRate']=_0x15aef8>0x0?_0x15aef8:0x1;return _0x26c288[_0xcc13('0x1cb')](_0x8303e2,_0x107291,_0x421da1,_0x15aef8,_0x291d5d);})[_0xcc13('0x97')](function(_0x29e647){return _0x8f7180(_0x29e647);})[_0xcc13('0x99')](function(_0x3ca166){return _0x4f80b9(msgResponse(_0xcc13('0x1d2'),'Failure',JSON[_0xcc13('0x70')](_0x3ca166)));});}}else{return _0x4f80b9(msgResponse(_0xcc13('0x1cc'),_0xcc13('0x8c'),_0xcc13('0x1cd')));}});};};Dialer['prototype'][_0xcc13('0x1c2')]=function(_0x31fe3c){var _0x57eefe=this;return function(){var _0x211072=0x0;var _0x339645=Math[_0xcc13('0x1b0')](_0x31fe3c[_0xcc13('0x1d3')]*0x3e8);if(_0x339645>0x0){_0x339645=_0x339645<0x64?0x64:_0x339645;loggerPredictive[_0xcc13('0x42')](_0x31fe3c[_0xcc13('0x5a')],_0xcc13('0x1d4'),_0x339645,_0xcc13('0x1d5'));_0x31fe3c[_0xcc13('0x5d')]=setInterval(function(){_0x57eefe[_0xcc13('0x5d')](_0x31fe3c);loggerPredictiveCalls['info'](_0xcc13('0x1d6'),_0x211072+=0x1);},_0x339645);}else{loggerPredictive[_0xcc13('0x42')](_0x31fe3c['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xcc13('0x18')][_0xcc13('0x1d7')]=function(_0x59dbc9,_0x1fe7d1){var _0xd33cf7=this;return function(_0x4b3b4d){if(_[_0xcc13('0x41')](_0x4b3b4d)){if(_[_0xcc13('0xe6')](_0x1fe7d1['UserId'])||!_0x1fe7d1['recallme']){if(_0x59dbc9[_0xcc13('0xac')]===_0xcc13('0x8')){_0x59dbc9[_0xcc13('0x6e')]=_[_0xcc13('0x38')](_0x59dbc9[_0xcc13('0x6e')])?!![]:_0x59dbc9[_0xcc13('0x6e')];var _0x2df0d4=uuid['v4']();_0xd33cf7[_0xcc13('0xe0')][_0x2df0d4]=new Action(_0x59dbc9,_0x1fe7d1,_0x2df0d4);loggerBooked[_0xcc13('0x42')]('[booked][checkContactBlack]',_0x2df0d4,_0xcc13('0x1d8'),JSON[_0xcc13('0x70')](_0x59dbc9[_0xcc13('0x6e')]),_0xcc13('0x1d9'),_0x59dbc9[_0xcc13('0x5a')]);if(_0x59dbc9['queueStatusComplete']){_0x59dbc9[_0xcc13('0x6e')]=![];_0xd33cf7[_0xcc13('0xea')][_0xd33cf7[_0xcc13('0xe0')][_0x2df0d4][_0xcc13('0xbb')]]=[];ami[_0xcc13('0x95')]({'actionid':_0x2df0d4,'action':_0xcc13('0x1da'),'queue':_0x59dbc9[_0xcc13('0x5a')]})[_0xcc13('0x99')](function(){_0xd33cf7[_0xcc13('0xb9')](_0x59dbc9);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0xd33cf7[_0xcc13('0xe0')][_0x2df0d4][_0xcc13('0xd1')],'ListId':_0xd33cf7['actions'][_0x2df0d4][_0xcc13('0xdf')],'VoiceQueueId':_0xd33cf7[_0xcc13('0xe0')][_0x2df0d4]['VoiceQueueId']||undefined,'CampaignId':_0xd33cf7[_0xcc13('0xe0')][_0x2df0d4]['CampaignId']||undefined})['catch'](loggerCatch(_0xcc13('0x1db')));delete _0xd33cf7['actions'][_0x2df0d4];});}else{loggerBooked[_0xcc13('0x42')](_0xcc13('0x1dc'),JSON['stringify'](_0x59dbc9[_0xcc13('0x6e')]),_0xcc13('0x1d9'),_0x59dbc9[_0xcc13('0x5a')]);_0xd33cf7['updateOriginated'](_0x59dbc9);hopperUtils[_0xcc13('0xdd')]({'active':![],'ContactId':_0xd33cf7[_0xcc13('0xe0')][_0x2df0d4]['ContactId'],'ListId':_0xd33cf7[_0xcc13('0xe0')][_0x2df0d4][_0xcc13('0xdf')],'VoiceQueueId':_0xd33cf7[_0xcc13('0xe0')][_0x2df0d4][_0xcc13('0xf7')]||undefined,'CampaignId':_0xd33cf7[_0xcc13('0xe0')][_0x2df0d4][_0xcc13('0xd2')]||undefined})[_0xcc13('0x99')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0xd33cf7[_0xcc13('0xe0')][_0x2df0d4];}}else{return _0xd33cf7[_0xcc13('0x14d')](_0x59dbc9,_0x1fe7d1);}}else{if(utils[_0xcc13('0x58')](undefined,_0x1fe7d1[_0xcc13('0x1dd')])<_0x59dbc9[_0xcc13('0x1de')]*0x3c){if(_0x1fe7d1[_0xcc13('0x138')]&&!_0x1fe7d1[_0xcc13('0x138')][_0xcc13('0x1df')]){_0xd33cf7[_0xcc13('0x1b')][_0xcc13('0xec')](_0x1fe7d1['id'])[_0xcc13('0xf5')](function(){_0xd33cf7['updateOriginated'](_0x59dbc9);});}else{hopperUtils['unlockContact']({'active':![]},_0x1fe7d1['id'],0x1)[_0xcc13('0xf5')](function(){_0xd33cf7[_0xcc13('0xb9')](_0x59dbc9);});}}else{_0x59dbc9[_0xcc13('0x1e0')]+=0x1;_0xd33cf7[_0xcc13('0xb9')](_0x59dbc9);if(_0x59dbc9['dialRecallInQueue']){hopperUtils[_0xcc13('0xdd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1fe7d1[_0xcc13('0xd1')],'ListId':_0x1fe7d1[_0xcc13('0xdf')],'VoiceQueueId':_0x1fe7d1[_0xcc13('0xf7')]||undefined,'CampaignId':_0x1fe7d1[_0xcc13('0xd2')]||undefined})['catch'](loggerCatch(_0xcc13('0x1e1')));hopperUtils[_0xcc13('0xbf')](createObjHistory(_0x59dbc9,_0x1fe7d1,utils[_0xcc13('0x68')][_0xcc13('0x1e2')],0x17,_0xcc13('0x1e3')))[_0xcc13('0x99')](loggerCatch(_0xcc13('0x1e4')));}else{_0xd33cf7['saveInDb'](createObjHistory(_0x59dbc9,_0x1fe7d1,utils[_0xcc13('0x68')][_0xcc13('0x1e5')],0x16,'RecallFailedTimeout'),_0xcc13('0x1e6'),'[Originate][HistoryRecallClose]');}}}}else{_0x59dbc9[_0xcc13('0x1e7')]+=0x1;_0xd33cf7[_0xcc13('0x106')](createObjHistory(_0x59dbc9,_0x1fe7d1,utils['CAMPAIGN_STATUS'][_0xcc13('0x1e8')],0xd,_0xcc13('0x1e9')),'[Originate][historyBlacklist]',_0xcc13('0x1ea'));throw _0xcc13('0x1eb');}};};Dialer['prototype'][_0xcc13('0x14c')]=function(_0x333211){var _0x40277e=this;var _0x344238=_0x333211[_0xcc13('0x1ec')]-_0x333211[_0xcc13('0x144')];emitCampaignSummary(_0x333211);if(_0x344238>0x0&&_0x333211[_0xcc13('0x62')]==0x0){if(_0x344238>this[_0xcc13('0x1f')]){_0x344238=this['maxNumberOriginate'];}_0x333211[_0xcc13('0x62')]=0x1;hopperUtils[_0xcc13('0x1ed')](_0x333211,_0x344238)['then'](function(_0x381236){_0x333211['temp']=0x0;if(_0x381236){if(!utils[_0xcc13('0x1ee')](_0x381236)){_0x333211[_0xcc13('0x64')]=utils[_0xcc13('0x68')][_0xcc13('0x1ef')];logger[_0xcc13('0x42')]('[getContactCampaign2][Empty]'+_0x333211[_0xcc13('0x5a')]);}else{_0x333211['originated']+=_0x381236[_0xcc13('0x93')];_0x333211['message']=utils[_0xcc13('0x68')][_0xcc13('0x1f0')];for(var _0x57a64a=0x0;_0x57a64a<_0x381236[_0xcc13('0x93')];_0x57a64a+=0x1){_0x333211['ivrTotalCallsDays']+=0x1;if(_[_0xcc13('0xe6')](_0x381236[_0x57a64a])||_['isNil'](_0x381236[_0x57a64a][_0xcc13('0x169')])||_[_0xcc13('0xe6')](_0x381236[_0x57a64a][_0xcc13('0x151')])){_0x40277e['emptyContact']('[actionOriginate]\x20',_0x333211,_0x381236[_0x57a64a]);}else{hopperUtils['checkIsBlackListIvr'](_['pick'](_0x381236[_0x57a64a],['CampaignId',_0xcc13('0x151')]))[_0xcc13('0x97')](_0x40277e[_0xcc13('0x1d7')](_0x333211,_0x381236[_0x57a64a]))[_0xcc13('0x99')](_0x40277e[_0xcc13('0x1f1')](_0xcc13('0x1f2'),_0x333211));}}}}})[_0xcc13('0x99')](loggerGetContactDialer('[getContactCampaign2]',_0x333211,_0x344238));}};Dialer[_0xcc13('0x18')][_0xcc13('0xae')]=function(_0x3f5f54,_0xc92386){var _0x5d27e9=this;var _0x500366=[];if(_0xc92386<0x1||_0x3f5f54['dialMethod']==='booked'){_0xc92386=0x1;}var _0x3f5c1b=Math[_0xcc13('0x1b0')](_0x3f5f54[_0xcc13('0x1f3')]*_0xc92386)-_0x3f5f54[_0xcc13('0x144')];if(_0x3f5f54[_0xcc13('0x1f4')]>0x0){var _0x5a0372=_0x3f5f54[_0xcc13('0x1f4')]-_0x3f5f54[_0xcc13('0x144')]-_0x3f5f54['talking']-_0x3f5f54['pTalking'];if(_0x3f5c1b>_0x5a0372){_0x3f5c1b=_0x5a0372;}}if(_0x3f5c1b>0x0&&_0x3f5f54[_0xcc13('0x62')]==0x0){if(_0x3f5f54[_0xcc13('0xac')]===_0xcc13('0x8')){_0x3f5c1b=0x1;}if(_0x3f5c1b>this[_0xcc13('0x1f')]){_0x3f5c1b=this[_0xcc13('0x1f')];}for(var _0x243c83 in this['agents']){if(typeof this['agents'][_0x243c83]!==_0xcc13('0xa5')){if(this['agents'][_0x243c83][_0xcc13('0x6a')]===_0xcc13('0x1f5')&&this['agents'][_0x243c83][_0xcc13('0x84')]===_0xcc13('0x83')){_0x500366[_0xcc13('0x94')](this[_0xcc13('0x1d')][_0x243c83]['id']);}}}_0x3f5f54[_0xcc13('0x62')]=0x1;hopperUtils['getContactDialer'](_0x3f5f54,_0x500366,_0x3f5c1b)['then'](function(_0x3cb08c){_0x3f5f54['temp']=0x0;if(_0x3cb08c){if(!utils[_0xcc13('0x1ee')](_0x3cb08c)){hopperUtils[_0xcc13('0x1f6')](_0x3f5f54)['then'](sendMessageReschedule(_0x3f5f54))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x3f5f54[_0xcc13('0x144')]+=_0x3cb08c[_0xcc13('0x93')];_0x3f5f54['message']=_0x3f5f54[_0xcc13('0xac')]==='booked'?utils[_0xcc13('0x68')]['ACTIVE']:utils[_0xcc13('0x68')][_0xcc13('0x1f0')];for(var _0x553f5b=0x0;_0x553f5b<_0x3cb08c[_0xcc13('0x93')];_0x553f5b+=0x1){if(_[_0xcc13('0xe6')](_0x3cb08c[_0x553f5b])||_[_0xcc13('0xe6')](_0x3cb08c[_0x553f5b][_0xcc13('0x169')])||_[_0xcc13('0xe6')](_0x3cb08c[_0x553f5b][_0xcc13('0x151')])){_0x5d27e9[_0xcc13('0x146')](_0xcc13('0x1f7'),_0x3f5f54,_0x3cb08c[_0x553f5b]);}else{hopperUtils[_0xcc13('0x1f8')](_['pick'](_0x3cb08c[_0x553f5b],['VoiceQueueId','phone']))[_0xcc13('0x97')](_0x5d27e9[_0xcc13('0x1d7')](_0x3f5f54,_0x3cb08c[_0x553f5b]))[_0xcc13('0x99')](_0x5d27e9[_0xcc13('0x1f1')](_0xcc13('0x1f7'),_0x3f5f54));}}}}})[_0xcc13('0x99')](loggerGetContactDialer(_0xcc13('0x1f9'),_0x3f5f54,_0x3f5c1b));}};Dialer[_0xcc13('0x18')][_0xcc13('0x5d')]=function(_0x1bb72c){if(_0x1bb72c[_0xcc13('0x1f4')]>0x0){var _0x36b6ff=_0x1bb72c[_0xcc13('0x1f4')]-_0x1bb72c[_0xcc13('0x144')]-_0x1bb72c[_0xcc13('0x12e')];if(_0x36b6ff>0x0&&_0x1bb72c[_0xcc13('0x62')]==0x0){this[_0xcc13('0x1fa')](_0x1bb72c);}else{loggerPredictiveCalls[_0xcc13('0x42')](_0xcc13('0x1fb'));}}else{this['tryOriginatePredictive'](_0x1bb72c);}};Dialer['prototype'][_0xcc13('0x1fa')]=function(_0x40dbf8){var _0x2dbd1b=this;var _0x420705=[];_0x40dbf8['originated']+=0x1;for(var _0x523ee9 in this['agents']){if(typeof this['agents'][_0x523ee9]!==_0xcc13('0xa5')){if(this[_0xcc13('0x1d')][_0x523ee9][_0xcc13('0x6a')]===_0xcc13('0x1f5')&&this[_0xcc13('0x1d')][_0x523ee9][_0xcc13('0x84')]===_0xcc13('0x83')){_0x420705[_0xcc13('0x94')](this[_0xcc13('0x1d')][_0x523ee9]['id']);}}}_0x40dbf8[_0xcc13('0x62')]=0x1;return this['getContactDialer'](_0x40dbf8['id'],_0x420705,0x1,_0x40dbf8[_0xcc13('0x1fc')],_0x40dbf8)['then'](function(_0x47074c){_0x40dbf8[_0xcc13('0x62')]=0x1;if(_0x47074c){if(!utils[_0xcc13('0x1ee')](_0x47074c)){utils['checkContactLowerLimitOriginate'](_0x40dbf8,0x1,0x0);return hopperUtils[_0xcc13('0x1f6')](_0x40dbf8)[_0xcc13('0x97')](sendMessageReschedule(_0x40dbf8))[_0xcc13('0x99')](loggerCatch(_0xcc13('0x1fd')));}else{_0x40dbf8[_0xcc13('0x64')]=utils['CAMPAIGN_STATUS'][_0xcc13('0x1f0')];if(_[_0xcc13('0xe6')](_0x47074c[0x0])||_['isNil'](_0x47074c[0x0][_0xcc13('0x169')])||_['isNil'](_0x47074c[0x0][_0xcc13('0x151')])){_0x2dbd1b[_0xcc13('0x146')](_0xcc13('0x1f7'),_0x40dbf8,_0x47074c[0x0]);}else{return hopperUtils[_0xcc13('0x1f8')](_['pick'](_0x47074c[0x0],[_0xcc13('0xf7'),_0xcc13('0x151')]))[_0xcc13('0x97')](_0x2dbd1b[_0xcc13('0x1d7')](_0x40dbf8,_0x47074c[0x0]))['catch'](_0x2dbd1b['loggerHandler'](_0xcc13('0x1fe'),_0x40dbf8));}}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x40dbf8,0x1));};Dialer[_0xcc13('0x18')][_0xcc13('0x1c9')]=function(_0x3c1edf,_0x579abb,_0x3ae721,_0x5d6eaf,_0x76d831,_0x2dd5ba){loggerPredictive['info'](_0xcc13('0x1ff'));loggerPredictive[_0xcc13('0x42')](_0xcc13('0x200'),_0x3c1edf);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x579abb);loggerPredictive[_0xcc13('0x42')](_0xcc13('0x201'),_0x3ae721);loggerPredictive[_0xcc13('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',_0x5d6eaf);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x76d831);loggerPredictive[_0xcc13('0x42')]('---------------------------');return new Promise(function(_0x343036,_0x32138d){if(_0x3c1edf<=0x0||isNaN(_0x3c1edf)){return _0x32138d(msgResponse(_0xcc13('0x202'),'Error','m\x20=\x20'+_0x3c1edf));}if(_0x3ae721<=0x0||isNaN(_0x3ae721)){return _0x32138d(msgResponse(_0xcc13('0x202'),_0xcc13('0x7f'),'Ts\x20=\x20'+_0x3ae721));}if(_0x5d6eaf<=0x0||isNaN(_0x5d6eaf)){return _0x32138d(msgResponse(_0xcc13('0x202'),_0xcc13('0x7f'),_0xcc13('0x203')+_0x5d6eaf));}if(_0x579abb<=0x0||isNaN(_0x579abb)){return _0x32138d(msgResponse(_0xcc13('0x202'),'Error','interval\x20=\x20'+_0x579abb));}if(_0x76d831<=0x0||isNaN(_0x76d831)){return _0x32138d(msgResponse('[abandonmentRate]',_0xcc13('0x7f'),_0xcc13('0x204')+_0x76d831));}_0x2dd5ba=_0x2dd5ba||0x0;var _0x2d7026=0x1/_0x3ae721;var _0x35c304=0x0;var _0x60387e=0x0;var _0x190b71=0x0;var _0xdf5638=0x0;for(var _0x6a9ba8=0x0;_0x190b71<_0x76d831;_0x6a9ba8+=0x1){_0x60387e=_0x6a9ba8/_0x579abb;_0x35c304=(_0x5d6eaf*_0x60387e+_0x2dd5ba)/_0x2d7026;_0x190b71=utils[_0xcc13('0x205')](_0x35c304,_0x3c1edf);_0xdf5638=_0x35c304/_0x3c1edf*(0x1-utils[_0xcc13('0x205')](_0x35c304,_0x3c1edf));}return _0x343036({'erlangCalls':_0x6a9ba8,'erlangCallToSecond':_0x579abb/_0x6a9ba8,'erlangAbandonmentRate':_0x190b71,'erlangBusyFactor':_0xdf5638});});};Dialer[_0xcc13('0x18')]['busyFactor']=function(_0x3b3675,_0x14d317,_0x3e4bcd,_0x175efe,_0x23077b,_0x286816){loggerPredictive['info'](_0xcc13('0x206'));loggerPredictive[_0xcc13('0x42')]('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',_0x3b3675);loggerPredictive[_0xcc13('0x42')](_0xcc13('0x207'),_0x14d317);loggerPredictive[_0xcc13('0x42')](_0xcc13('0x201'),_0x3e4bcd);loggerPredictive[_0xcc13('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',_0x175efe);loggerPredictive['info'](_0xcc13('0x208'),_0x23077b);loggerPredictive[_0xcc13('0x42')](_0xcc13('0x4c'));return new Promise(function(_0x5d40b1,_0x179667){if(_0x3b3675<=0x0||isNaN(_0x3b3675)){return _0x179667(msgResponse(_0xcc13('0x209'),_0xcc13('0x7f'),_0xcc13('0x20a')+_0x3b3675));}if(_0x3e4bcd<=0x0||isNaN(_0x3e4bcd)){return _0x179667(msgResponse(_0xcc13('0x209'),_0xcc13('0x7f'),_0xcc13('0x20b')+_0x3e4bcd));}if(_0x175efe<=0x0||isNaN(_0x175efe)){return _0x179667(msgResponse(_0xcc13('0x209'),_0xcc13('0x7f'),_0xcc13('0x203')+_0x175efe));}if(_0x14d317<=0x0||isNaN(_0x14d317)){return _0x179667(msgResponse(_0xcc13('0x209'),_0xcc13('0x7f'),_0xcc13('0x20c')+_0x14d317));}if(_0x23077b<=0x0||isNaN(_0x23077b)){return _0x179667(msgResponse('[busyFactor]',_0xcc13('0x7f'),'Umin\x20=\x20'+_0x23077b));}_0x286816=_0x286816||0x0;var _0x1fd203=0x1/_0x3e4bcd;var _0x5d89c0=0x0;var _0x3edce9=0x0;var _0x397cc4=0x0;var _0x3c7dc0=0x0;for(var _0x4af7fa=0x0;_0x3c7dc0<_0x23077b;_0x4af7fa+=0x1){_0x3edce9=_0x4af7fa/_0x14d317;_0x5d89c0=(_0x175efe*_0x3edce9+_0x286816)/_0x1fd203;_0x397cc4=utils[_0xcc13('0x205')](_0x5d89c0,_0x3b3675);_0x3c7dc0=_0x5d89c0/_0x3b3675*(0x1-utils[_0xcc13('0x205')](_0x5d89c0,_0x3b3675));}return _0x5d40b1({'erlangCalls':_0x4af7fa,'erlangCallToSecond':_0x14d317/_0x4af7fa,'erlangAbandonmentRate':_0x397cc4,'erlangBusyFactor':_0x3c7dc0});});};module['exports']=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 360c658..a973443 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 _0xf88e=['\x22%s\x22\x20<%s>','dialCutDigit','substring','voiceQueue','exports','util','lodash','string','isNil','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','format'];(function(_0x5b6cf1,_0x32fdcd){var _0x46278c=function(_0x53fd9b){while(--_0x53fd9b){_0x5b6cf1['push'](_0x5b6cf1['shift']());}};_0x46278c(++_0x32fdcd);}(_0xf88e,0xad));var _0xef88=function(_0x1338bc,_0x3c5b9d){_0x1338bc=_0x1338bc-0x0;var _0x5d5d93=_0xf88e[_0x1338bc];return _0x5d5d93;};'use strict';var util=require(_0xef88('0x0'));var _=require(_0xef88('0x1'));var moment=require('moment');function checkNameSurname(_0x1a005a,_0x235a7a,_0x3d8cd1){var _0x419480='';if(!_['isNil'](_0x235a7a)&&_0xef88('0x2')===typeof _0x235a7a){_0x419480+=_0x235a7a;}if(!_[_0xef88('0x3')](_0x3d8cd1)&&_0xef88('0x2')===typeof _0x3d8cd1){_0x419480+='\x20'+_0x3d8cd1;}if(_0x419480!==''){return _0x419480;}return _0x1a005a;}function Action(_0x4c296b,_0x4b1e4d,_0x1a16e3){this['voiceQueue']=_0x4c296b;this['uniqueid']=_0x1a16e3||undefined;this['name']=checkNameSurname(_0x4b1e4d[_0xef88('0x4')][_0xef88('0x5')],_0x4b1e4d[_0xef88('0x4')][_0xef88('0x6')],_0x4b1e4d[_0xef88('0x4')][_0xef88('0x7')]);this[_0xef88('0x8')]=_0x4b1e4d['phone'];this[_0xef88('0x9')]=_0x4c296b['name'];this['active']=_0x4b1e4d[_0xef88('0xa')]||![];this[_0xef88('0xb')]=_0x4c296b[_0xef88('0xb')];this[_0xef88('0xc')]=_0x4c296b['dialQueueTimeout']||0x3;this[_0xef88('0xd')]=_0x4b1e4d[_0xef88('0xd')];this['countbusyretry']=_0x4b1e4d['countbusyretry'];this['countcongestionretry']=_0x4b1e4d['countcongestionretry'];this[_0xef88('0xe')]=_0x4b1e4d[_0xef88('0xe')];this['countnosuchnumberretry']=_0x4b1e4d[_0xef88('0xf')];this[_0xef88('0x10')]=_0x4b1e4d['countdropretry'];this[_0xef88('0x11')]=_0x4b1e4d['countabandonedretry'];this[_0xef88('0x12')]=_0x4b1e4d[_0xef88('0x12')];this['countagentrejectretry']=_0x4b1e4d[_0xef88('0x13')];this[_0xef88('0x14')]=_0x4b1e4d['ContactId'];this[_0xef88('0x15')]=_0x4b1e4d[_0xef88('0x15')];this[_0xef88('0x16')]=_0x4b1e4d[_0xef88('0x16')];this[_0xef88('0x17')]=_0x4b1e4d[_0xef88('0x17')];this[_0xef88('0x18')]=_0x4b1e4d[_0xef88('0x18')];this[_0xef88('0x19')]=_0x4b1e4d['id'];this[_0xef88('0x1a')]=_0x4b1e4d['Contact'][_0xef88('0x6')]||'';this[_0xef88('0x1b')]=moment()['format'](_0xef88('0x1c'));this[_0xef88('0x1d')]=_0x4b1e4d[_0xef88('0x1d')];this[_0xef88('0x1e')]=_0x4b1e4d[_0xef88('0x1e')];this[_0xef88('0x1f')]=_0x4b1e4d['callbackat'];this[_0xef88('0x20')]=_0x4b1e4d[_0xef88('0x20')];this[_0xef88('0x21')]='';this[_0xef88('0x22')]='';}Action[_0xef88('0x23')]['getCaller']=function(){return util[_0xef88('0x24')](_0xef88('0x25'),this['name'],this['voiceQueue'][_0xef88('0x26')]>0x0?this[_0xef88('0x8')][_0xef88('0x27')](this[_0xef88('0x28')]['dialCutDigit']):this[_0xef88('0x8')]);};Action[_0xef88('0x23')]['getQueue']=function(){return this['queue'];};module[_0xef88('0x29')]=Action; \ No newline at end of file +var _0x54d3=['callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','dialCutDigit','substring','exports','util','moment','isNil','string','voiceQueue','name','Contact','firstName','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xfb0ac9,_0x299fc2){var _0x367369=function(_0x14d5ee){while(--_0x14d5ee){_0xfb0ac9['push'](_0xfb0ac9['shift']());}};_0x367369(++_0x299fc2);}(_0x54d3,0x184));var _0x354d=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x54d3[_0x2a6809];return _0x11c371;};'use strict';var util=require(_0x354d('0x0'));var _=require('lodash');var moment=require(_0x354d('0x1'));function checkNameSurname(_0x3d76d6,_0x11672f,_0x29dd9b){var _0x5199aa='';if(!_[_0x354d('0x2')](_0x11672f)&&_0x354d('0x3')===typeof _0x11672f){_0x5199aa+=_0x11672f;}if(!_[_0x354d('0x2')](_0x29dd9b)&&_0x354d('0x3')===typeof _0x29dd9b){_0x5199aa+='\x20'+_0x29dd9b;}if(_0x5199aa!==''){return _0x5199aa;}return _0x3d76d6;}function Action(_0x2dd9f9,_0x25996e,_0x220f8b){this[_0x354d('0x4')]=_0x2dd9f9;this['uniqueid']=_0x220f8b||undefined;this[_0x354d('0x5')]=checkNameSurname(_0x25996e[_0x354d('0x6')]['phone'],_0x25996e['Contact'][_0x354d('0x7')],_0x25996e[_0x354d('0x6')][_0x354d('0x8')]);this[_0x354d('0x9')]=_0x25996e[_0x354d('0xa')];this[_0x354d('0xb')]=_0x2dd9f9[_0x354d('0x5')];this[_0x354d('0xc')]=_0x25996e[_0x354d('0xc')]||![];this[_0x354d('0xd')]=_0x2dd9f9[_0x354d('0xd')];this['dialQueueTimeout']=_0x2dd9f9[_0x354d('0xe')]||0x3;this[_0x354d('0xf')]=_0x25996e['scheduledat'];this[_0x354d('0x10')]=_0x25996e[_0x354d('0x10')];this[_0x354d('0x11')]=_0x25996e[_0x354d('0x11')];this[_0x354d('0x12')]=_0x25996e['countnoanswerretry'];this[_0x354d('0x13')]=_0x25996e[_0x354d('0x13')];this[_0x354d('0x14')]=_0x25996e[_0x354d('0x14')];this['countabandonedretry']=_0x25996e[_0x354d('0x15')];this[_0x354d('0x16')]=_0x25996e[_0x354d('0x16')];this[_0x354d('0x17')]=_0x25996e['countagentrejectretry'];this[_0x354d('0x18')]=_0x25996e[_0x354d('0x18')];this['ListId']=_0x25996e['ListId'];this['UserId']=_0x25996e[_0x354d('0x19')];this[_0x354d('0x1a')]=_0x25996e[_0x354d('0x1a')];this['CampaignId']=_0x25996e[_0x354d('0x1b')];this['idHopper']=_0x25996e['id'];this[_0x354d('0x1c')]=_0x25996e['Contact']['firstName']||'';this[_0x354d('0x1d')]=moment()[_0x354d('0x1e')](_0x354d('0x1f'));this[_0x354d('0x20')]=_0x25996e[_0x354d('0x20')];this['callbackuniqueid']=_0x25996e[_0x354d('0x21')];this[_0x354d('0x22')]=_0x25996e[_0x354d('0x22')];this['recallme']=_0x25996e[_0x354d('0x23')];this[_0x354d('0x24')]='';this[_0x354d('0x25')]='';}Action[_0x354d('0x26')]['getCaller']=function(){return util[_0x354d('0x1e')]('\x22%s\x22\x20<%s>',this[_0x354d('0x5')],this[_0x354d('0x4')][_0x354d('0x27')]>0x0?this[_0x354d('0x9')][_0x354d('0x28')](this[_0x354d('0x4')][_0x354d('0x27')]):this['number']);};Action[_0x354d('0x26')]['getQueue']=function(){return this['queue'];};module[_0x354d('0x29')]=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 4f78a2a..f441037 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 _0xe7f1=['countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','ringtime','getSeconds','holdtime','talktime','queue','membername','reason','callback','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countglobal','countnoanswerretry'];(function(_0x4871f4,_0x2c1f0){var _0x565f30=function(_0x61e2ed){while(--_0x61e2ed){_0x4871f4['push'](_0x4871f4['shift']());}};_0x565f30(++_0x2c1f0);}(_0xe7f1,0x1a3));var _0x1e7f=function(_0xa2eb3d,_0x1e34e3){_0xa2eb3d=_0xa2eb3d-0x0;var _0x8a0fa3=_0xe7f1[_0xa2eb3d];return _0x8a0fa3;};'use strict';var moment=require('moment');var utils=require('../utils');function AgentComplete(_0x2cdeb0,_0x4ed6be){this[_0x1e7f('0x0')]=0x4;this[_0x1e7f('0x1')]=_0x1e7f('0x2');this[_0x1e7f('0x3')]=_0x2cdeb0[_0x1e7f('0x3')];this[_0x1e7f('0x4')]=_0x2cdeb0[_0x1e7f('0x4')];this[_0x1e7f('0x5')]=_0x2cdeb0[_0x1e7f('0x4')]===_0x1e7f('0x6')?'queue':_0x2cdeb0[_0x1e7f('0x4')];this['countbusyretry']=_0x2cdeb0[_0x1e7f('0x7')];this[_0x1e7f('0x8')]=_0x2cdeb0[_0x1e7f('0x8')];this['countnoanswerretry']=_0x2cdeb0['countnoanswerretry'];this[_0x1e7f('0x9')]=_0x2cdeb0[_0x1e7f('0x7')]+_0x2cdeb0['countcongestionretry']+_0x2cdeb0[_0x1e7f('0xa')]+_0x2cdeb0[_0x1e7f('0xb')]+_0x2cdeb0[_0x1e7f('0xc')]+_0x2cdeb0[_0x1e7f('0xd')]+_0x2cdeb0['countmachineretry']+_0x2cdeb0[_0x1e7f('0xe')];this[_0x1e7f('0xb')]=_0x2cdeb0[_0x1e7f('0xb')];this[_0x1e7f('0xc')]=_0x2cdeb0['countdropretry'];this[_0x1e7f('0xd')]=_0x2cdeb0[_0x1e7f('0xd')];this[_0x1e7f('0xf')]=_0x2cdeb0[_0x1e7f('0xf')];this[_0x1e7f('0xe')]=_0x2cdeb0['countagentrejectretry'];this[_0x1e7f('0x10')]=_0x4ed6be[_0x1e7f('0x10')];this[_0x1e7f('0x11')]=_0x2cdeb0[_0x1e7f('0x12')];this[_0x1e7f('0x13')]=_0x2cdeb0[_0x1e7f('0x14')];this['starttime']=_0x2cdeb0[_0x1e7f('0x15')];this[_0x1e7f('0x16')]=_0x2cdeb0['responsetime'];this[_0x1e7f('0x17')]=_0x2cdeb0[_0x1e7f('0x17')];this[_0x1e7f('0x18')]=moment()[_0x1e7f('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1e7f('0x1a')]=utils[_0x1e7f('0x1b')](_0x2cdeb0[_0x1e7f('0x16')],_0x2cdeb0[_0x1e7f('0x15')]);this[_0x1e7f('0x1c')]=utils['getSeconds'](_0x2cdeb0['answertime'],_0x2cdeb0['responsetime']);this[_0x1e7f('0x1d')]=utils[_0x1e7f('0x1b')](this[_0x1e7f('0x18')],_0x2cdeb0[_0x1e7f('0x17')]);this[_0x1e7f('0x1e')]=_0x4ed6be[_0x1e7f('0x1e')];this[_0x1e7f('0x1f')]=_0x4ed6be[_0x1e7f('0x1f')];this[_0x1e7f('0x20')]=_0x4ed6be[_0x1e7f('0x20')];this[_0x1e7f('0x21')]=_0x2cdeb0['callback'];this['callbackuniqueid']=_0x2cdeb0['callbackuniqueid'];this['callbackat']=_0x2cdeb0['callbackat'];this[_0x1e7f('0x22')]=_0x2cdeb0['recallme'];this[_0x1e7f('0x23')]=_0x2cdeb0[_0x1e7f('0x23')];this[_0x1e7f('0x24')]=_0x2cdeb0[_0x1e7f('0x24')];this[_0x1e7f('0x25')]=_0x2cdeb0[_0x1e7f('0x25')];this[_0x1e7f('0x26')]=_0x2cdeb0[_0x1e7f('0x26')];this[_0x1e7f('0x27')]=_0x2cdeb0[_0x1e7f('0x27')];this[_0x1e7f('0x28')]=_0x2cdeb0[_0x1e7f('0x28')]||'';this[_0x1e7f('0x29')]=_0x2cdeb0[_0x1e7f('0x29')]||'';this[_0x1e7f('0x2a')]=_0x2cdeb0['agiafterat'];}module['exports']=AgentComplete; \ No newline at end of file +var _0x3d5f=['getSeconds','responsetime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','../utils','statedesc','Answer','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0x3d5f,0x152));var _0xf3d5=function(_0x5f0ebb,_0x43d438){_0x5f0ebb=_0x5f0ebb-0x0;var _0x1f3c43=_0x3d5f[_0x5f0ebb];return _0x1f3c43;};'use strict';var moment=require('moment');var utils=require(_0xf3d5('0x0'));function AgentComplete(_0xdbbb42,_0xf797b9){this['state']=0x4;this[_0xf3d5('0x1')]=_0xf3d5('0x2');this[_0xf3d5('0x3')]=_0xdbbb42[_0xf3d5('0x3')];this[_0xf3d5('0x4')]=_0xdbbb42[_0xf3d5('0x4')];this['campaigntype']=_0xdbbb42[_0xf3d5('0x4')]==='outbound'?'queue':_0xdbbb42[_0xf3d5('0x4')];this['countbusyretry']=_0xdbbb42[_0xf3d5('0x5')];this[_0xf3d5('0x6')]=_0xdbbb42[_0xf3d5('0x6')];this[_0xf3d5('0x7')]=_0xdbbb42[_0xf3d5('0x7')];this['countglobal']=_0xdbbb42['countbusyretry']+_0xdbbb42['countcongestionretry']+_0xdbbb42[_0xf3d5('0x7')]+_0xdbbb42[_0xf3d5('0x8')]+_0xdbbb42[_0xf3d5('0x9')]+_0xdbbb42['countabandonedretry']+_0xdbbb42[_0xf3d5('0xa')]+_0xdbbb42[_0xf3d5('0xb')];this['countnosuchnumberretry']=_0xdbbb42[_0xf3d5('0x8')];this[_0xf3d5('0x9')]=_0xdbbb42[_0xf3d5('0x9')];this[_0xf3d5('0xc')]=_0xdbbb42[_0xf3d5('0xc')];this[_0xf3d5('0xa')]=_0xdbbb42[_0xf3d5('0xa')];this[_0xf3d5('0xb')]=_0xdbbb42[_0xf3d5('0xb')];this[_0xf3d5('0xd')]=_0xf797b9[_0xf3d5('0xd')];this[_0xf3d5('0xe')]=_0xdbbb42[_0xf3d5('0xf')];this[_0xf3d5('0x10')]=_0xdbbb42[_0xf3d5('0x11')];this[_0xf3d5('0x12')]=_0xdbbb42['starttime'];this['responsetime']=_0xdbbb42['responsetime'];this[_0xf3d5('0x13')]=_0xdbbb42['answertime'];this[_0xf3d5('0x14')]=moment()['format'](_0xf3d5('0x15'));this['ringtime']=utils[_0xf3d5('0x16')](_0xdbbb42[_0xf3d5('0x17')],_0xdbbb42['starttime']);this[_0xf3d5('0x18')]=utils['getSeconds'](_0xdbbb42[_0xf3d5('0x13')],_0xdbbb42[_0xf3d5('0x17')]);this[_0xf3d5('0x19')]=utils[_0xf3d5('0x16')](this[_0xf3d5('0x14')],_0xdbbb42[_0xf3d5('0x13')]);this[_0xf3d5('0x1a')]=_0xf797b9[_0xf3d5('0x1a')];this[_0xf3d5('0x1b')]=_0xf797b9[_0xf3d5('0x1b')];this[_0xf3d5('0x1c')]=_0xf797b9[_0xf3d5('0x1c')];this['callback']=_0xdbbb42[_0xf3d5('0x1d')];this[_0xf3d5('0x1e')]=_0xdbbb42[_0xf3d5('0x1e')];this[_0xf3d5('0x1f')]=_0xdbbb42[_0xf3d5('0x1f')];this['recallme']=_0xdbbb42[_0xf3d5('0x20')];this['ContactId']=_0xdbbb42[_0xf3d5('0x21')];this[_0xf3d5('0x22')]=_0xdbbb42[_0xf3d5('0x22')];this['UserId']=_0xdbbb42['UserId'];this[_0xf3d5('0x23')]=_0xdbbb42[_0xf3d5('0x23')];this[_0xf3d5('0x24')]=_0xdbbb42[_0xf3d5('0x24')];this['originatecalleridnum']=_0xdbbb42[_0xf3d5('0x25')]||'';this[_0xf3d5('0x26')]=_0xdbbb42[_0xf3d5('0x26')]||'';this[_0xf3d5('0x27')]=_0xdbbb42['agiafterat'];}module['exports']=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 b1d1fcc..9c03dda 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 _0x301b=['calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x327a16,_0x20fd4a){var _0x15fb95=function(_0x2e394c){while(--_0x2e394c){_0x327a16['push'](_0x327a16['shift']());}};_0x15fb95(++_0x20fd4a);}(_0x301b,0xc4));var _0xb301=function(_0x33a092,_0x54f4a1){_0x33a092=_0x33a092-0x0;var _0x48a3b7=_0x301b[_0x33a092];return _0x48a3b7;};'use strict';function Final(_0x11bc9b){this[_0xb301('0x0')]=_0x11bc9b[_0xb301('0x0')];this['scheduledat']=_0x11bc9b[_0xb301('0x1')];this['type']=_0x11bc9b['type'];this[_0xb301('0x2')]=_0x11bc9b[_0xb301('0x3')]===_0xb301('0x4')?_0xb301('0x5'):_0x11bc9b[_0xb301('0x3')];this[_0xb301('0x6')]=_0x11bc9b[_0xb301('0x6')];this[_0xb301('0x7')]=_0x11bc9b[_0xb301('0x7')];this['countnoanswerretry']=_0x11bc9b['countnoanswerretry'];this[_0xb301('0x8')]=_0x11bc9b[_0xb301('0x6')]+_0x11bc9b[_0xb301('0x7')]+_0x11bc9b[_0xb301('0x9')]+_0x11bc9b['countnosuchnumberretry']+_0x11bc9b[_0xb301('0xa')]+_0x11bc9b[_0xb301('0xb')]+_0x11bc9b[_0xb301('0xc')]+_0x11bc9b[_0xb301('0xd')];this['countnosuchnumberretry']=_0x11bc9b['countnosuchnumberretry'];this[_0xb301('0xa')]=_0x11bc9b[_0xb301('0xa')];this['countabandonedretry']=_0x11bc9b[_0xb301('0xb')];this[_0xb301('0xc')]=_0x11bc9b[_0xb301('0xc')];this[_0xb301('0xd')]=_0x11bc9b[_0xb301('0xd')];this['queue']=_0x11bc9b[_0xb301('0x5')];this['calleridname']=_0x11bc9b[_0xb301('0xe')];this[_0xb301('0xf')]=_0x11bc9b['calleridnum'];this[_0xb301('0x10')]=_0x11bc9b[_0xb301('0x10')];this[_0xb301('0x11')]=_0x11bc9b[_0xb301('0x11')];this['endtime']=_0x11bc9b['responsetime'];this['ringtime']=_0x11bc9b[_0xb301('0x12')]||0x0;this[_0xb301('0x13')]=_0x11bc9b[_0xb301('0x13')]||0x0;this[_0xb301('0x14')]=_0x11bc9b[_0xb301('0x14')]||0x0;this[_0xb301('0x15')]=_0x11bc9b[_0xb301('0x15')];this[_0xb301('0x16')]=_0x11bc9b['callbackuniqueid'];this[_0xb301('0x17')]=_0x11bc9b[_0xb301('0x17')];this['recallme']=_0x11bc9b[_0xb301('0x18')];this[_0xb301('0x19')]=_0x11bc9b[_0xb301('0x19')];this[_0xb301('0x1a')]=_0x11bc9b[_0xb301('0x1a')];this[_0xb301('0x1b')]=_0x11bc9b[_0xb301('0x1b')];this[_0xb301('0x1c')]=_0x11bc9b[_0xb301('0x1c')];this[_0xb301('0x1d')]=_0x11bc9b[_0xb301('0x1d')];this[_0xb301('0x1e')]=_0x11bc9b['originatecalleridnum']||'';this[_0xb301('0x1f')]=_0x11bc9b[_0xb301('0x1f')]||'';this['state']=_0x11bc9b[_0xb301('0x20')];this['statedesc']=_0x11bc9b[_0xb301('0x21')];}module[_0xb301('0x22')]=Final; \ No newline at end of file +var _0xbd3a=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','type','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x26fdfa,_0x3ec54b){var _0x5f1773=function(_0x1e5573){while(--_0x1e5573){_0x26fdfa['push'](_0x26fdfa['shift']());}};_0x5f1773(++_0x3ec54b);}(_0xbd3a,0xa8));var _0xabd3=function(_0x4f1d8d,_0x5a4b5c){_0x4f1d8d=_0x4f1d8d-0x0;var _0x49fa3e=_0xbd3a[_0x4f1d8d];return _0x49fa3e;};'use strict';function Final(_0x2f7df7){this['uniqueid']=_0x2f7df7['uniqueid'];this['scheduledat']=_0x2f7df7['scheduledat'];this[_0xabd3('0x0')]=_0x2f7df7[_0xabd3('0x0')];this['campaigntype']=_0x2f7df7[_0xabd3('0x0')]===_0xabd3('0x1')?_0xabd3('0x2'):_0x2f7df7[_0xabd3('0x0')];this['countbusyretry']=_0x2f7df7['countbusyretry'];this[_0xabd3('0x3')]=_0x2f7df7[_0xabd3('0x3')];this[_0xabd3('0x4')]=_0x2f7df7[_0xabd3('0x4')];this[_0xabd3('0x5')]=_0x2f7df7[_0xabd3('0x6')]+_0x2f7df7[_0xabd3('0x3')]+_0x2f7df7['countnoanswerretry']+_0x2f7df7[_0xabd3('0x7')]+_0x2f7df7[_0xabd3('0x8')]+_0x2f7df7[_0xabd3('0x9')]+_0x2f7df7[_0xabd3('0xa')]+_0x2f7df7[_0xabd3('0xb')];this[_0xabd3('0x7')]=_0x2f7df7[_0xabd3('0x7')];this['countdropretry']=_0x2f7df7['countdropretry'];this[_0xabd3('0x9')]=_0x2f7df7[_0xabd3('0x9')];this['countmachineretry']=_0x2f7df7['countmachineretry'];this[_0xabd3('0xb')]=_0x2f7df7['countagentrejectretry'];this['queue']=_0x2f7df7[_0xabd3('0x2')];this[_0xabd3('0xc')]=_0x2f7df7[_0xabd3('0xc')];this[_0xabd3('0xd')]=_0x2f7df7[_0xabd3('0xd')];this[_0xabd3('0xe')]=_0x2f7df7[_0xabd3('0xe')];this[_0xabd3('0xf')]=_0x2f7df7[_0xabd3('0xf')];this['endtime']=_0x2f7df7[_0xabd3('0xf')];this[_0xabd3('0x10')]=_0x2f7df7['ringtime']||0x0;this['holdtime']=_0x2f7df7[_0xabd3('0x11')]||0x0;this[_0xabd3('0x12')]=_0x2f7df7[_0xabd3('0x12')]||0x0;this['callback']=_0x2f7df7['callback'];this[_0xabd3('0x13')]=_0x2f7df7[_0xabd3('0x13')];this[_0xabd3('0x14')]=_0x2f7df7[_0xabd3('0x14')];this[_0xabd3('0x15')]=_0x2f7df7[_0xabd3('0x15')];this[_0xabd3('0x16')]=_0x2f7df7[_0xabd3('0x16')];this[_0xabd3('0x17')]=_0x2f7df7[_0xabd3('0x17')];this['UserId']=_0x2f7df7[_0xabd3('0x18')];this['VoiceQueueId']=_0x2f7df7[_0xabd3('0x19')];this[_0xabd3('0x1a')]=_0x2f7df7[_0xabd3('0x1a')];this[_0xabd3('0x1b')]=_0x2f7df7['originatecalleridnum']||'';this[_0xabd3('0x1c')]=_0x2f7df7[_0xabd3('0x1c')]||'';this[_0xabd3('0x1d')]=_0x2f7df7['state'];this[_0xabd3('0x1e')]=_0x2f7df7[_0xabd3('0x1e')];}module[_0xabd3('0x1f')]=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 dbe083c..88f4f04 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 _0x5493=['format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','endtime','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime'];(function(_0x400281,_0xb7c9bc){var _0x2470e4=function(_0x4893d2){while(--_0x4893d2){_0x400281['push'](_0x400281['shift']());}};_0x2470e4(++_0xb7c9bc);}(_0x5493,0xe3));var _0x3549=function(_0x2be65a,_0x1e22c4){_0x2be65a=_0x2be65a-0x0;var _0x14161b=_0x5493[_0x2be65a];return _0x14161b;};'use strict';var moment=require('moment');var utils=require(_0x3549('0x0'));function Hangup(_0x42279d,_0x1b6f1c){this[_0x3549('0x1')]=0x4;this[_0x3549('0x2')]=_0x3549('0x3');this[_0x3549('0x4')]=_0x42279d[_0x3549('0x4')];this['type']=_0x42279d[_0x3549('0x5')];this[_0x3549('0x6')]=_0x42279d[_0x3549('0x5')]===_0x3549('0x7')?_0x3549('0x8'):_0x42279d[_0x3549('0x5')];this[_0x3549('0x9')]=_0x42279d[_0x3549('0x9')]||![];this[_0x3549('0xa')]=_0x42279d['countbusyretry'];this[_0x3549('0xb')]=_0x42279d['countcongestionretry'];this[_0x3549('0xc')]=_0x42279d[_0x3549('0xc')];this[_0x3549('0xd')]=_0x42279d[_0x3549('0xa')]+_0x42279d['countcongestionretry']+_0x42279d[_0x3549('0xc')]+_0x42279d[_0x3549('0xe')]+_0x42279d[_0x3549('0xf')]+_0x42279d[_0x3549('0x10')]+_0x42279d[_0x3549('0x11')]+_0x42279d[_0x3549('0x12')];this['countnosuchnumberretry']=_0x42279d[_0x3549('0xe')];this[_0x3549('0xf')]=_0x42279d[_0x3549('0xf')];this[_0x3549('0x10')]=_0x42279d[_0x3549('0x10')];this[_0x3549('0x11')]=_0x42279d[_0x3549('0x11')];this[_0x3549('0x12')]=_0x42279d[_0x3549('0x12')];this[_0x3549('0x13')]=_0x1b6f1c[_0x3549('0x13')];this['calleridname']=_0x42279d[_0x3549('0x14')];this[_0x3549('0x15')]=_0x42279d[_0x3549('0x16')];this[_0x3549('0x17')]=_0x42279d['starttime'];this[_0x3549('0x18')]=_0x42279d[_0x3549('0x18')];this['endtime']=moment()[_0x3549('0x19')](_0x3549('0x1a'));this[_0x3549('0x1b')]=utils[_0x3549('0x1c')](_0x42279d[_0x3549('0x18')],_0x42279d[_0x3549('0x17')]);this['holdtime']=0x0;this[_0x3549('0x1d')]=utils[_0x3549('0x1c')](this[_0x3549('0x1e')],_0x42279d['responsetime']);this['queue']=_0x42279d['queue'];this['membername']=_0x3549('0x1f');this[_0x3549('0x20')]=_0x1b6f1c['cause-txt'];this[_0x3549('0x21')]=_0x42279d['callback'];this[_0x3549('0x22')]=_0x42279d['callbackuniqueid'];this[_0x3549('0x23')]=_0x42279d[_0x3549('0x23')];this['recallme']=_0x42279d[_0x3549('0x24')];this[_0x3549('0x25')]=_0x42279d['ContactId'];this[_0x3549('0x26')]=_0x42279d[_0x3549('0x26')];this['UserId']=_0x42279d[_0x3549('0x27')];this[_0x3549('0x28')]=_0x42279d['VoiceQueueId'];this[_0x3549('0x29')]=_0x42279d[_0x3549('0x29')];}module['exports']=Hangup; \ No newline at end of file +var _0xecca=['scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','getSeconds','cause-txt','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','moment','state','statedesc','Answer'];(function(_0x52cfc5,_0x56ffcd){var _0x56a322=function(_0x269adc){while(--_0x269adc){_0x52cfc5['push'](_0x52cfc5['shift']());}};_0x56a322(++_0x56ffcd);}(_0xecca,0x196));var _0xaecc=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xecca[_0x580576];return _0x3f55a0;};'use strict';var moment=require(_0xaecc('0x0'));var utils=require('../utils');function Hangup(_0x176c29,_0x40fb28){this[_0xaecc('0x1')]=0x4;this[_0xaecc('0x2')]=_0xaecc('0x3');this['scheduledat']=_0x176c29[_0xaecc('0x4')];this[_0xaecc('0x5')]=_0x176c29[_0xaecc('0x5')];this[_0xaecc('0x6')]=_0x176c29[_0xaecc('0x5')]===_0xaecc('0x7')?_0xaecc('0x8'):_0x176c29['type'];this[_0xaecc('0x9')]=_0x176c29[_0xaecc('0x9')]||![];this[_0xaecc('0xa')]=_0x176c29[_0xaecc('0xa')];this[_0xaecc('0xb')]=_0x176c29['countcongestionretry'];this['countnoanswerretry']=_0x176c29[_0xaecc('0xc')];this[_0xaecc('0xd')]=_0x176c29['countbusyretry']+_0x176c29['countcongestionretry']+_0x176c29['countnoanswerretry']+_0x176c29[_0xaecc('0xe')]+_0x176c29[_0xaecc('0xf')]+_0x176c29['countabandonedretry']+_0x176c29['countmachineretry']+_0x176c29[_0xaecc('0x10')];this['countnosuchnumberretry']=_0x176c29[_0xaecc('0xe')];this[_0xaecc('0xf')]=_0x176c29[_0xaecc('0xf')];this[_0xaecc('0x11')]=_0x176c29[_0xaecc('0x11')];this[_0xaecc('0x12')]=_0x176c29[_0xaecc('0x12')];this[_0xaecc('0x10')]=_0x176c29['countagentrejectretry'];this[_0xaecc('0x13')]=_0x40fb28[_0xaecc('0x13')];this['calleridname']=_0x176c29[_0xaecc('0x14')];this[_0xaecc('0x15')]=_0x176c29[_0xaecc('0x16')];this[_0xaecc('0x17')]=_0x176c29[_0xaecc('0x17')];this[_0xaecc('0x18')]=_0x176c29[_0xaecc('0x18')];this[_0xaecc('0x19')]=moment()[_0xaecc('0x1a')](_0xaecc('0x1b'));this[_0xaecc('0x1c')]=utils['getSeconds'](_0x176c29[_0xaecc('0x18')],_0x176c29['starttime']);this[_0xaecc('0x1d')]=0x0;this[_0xaecc('0x1e')]=utils[_0xaecc('0x1f')](this[_0xaecc('0x19')],_0x176c29[_0xaecc('0x18')]);this['queue']=_0x176c29[_0xaecc('0x8')];this['membername']='IVR';this['reason']=_0x40fb28[_0xaecc('0x20')];this['callback']=_0x176c29[_0xaecc('0x21')];this['callbackuniqueid']=_0x176c29[_0xaecc('0x22')];this[_0xaecc('0x23')]=_0x176c29[_0xaecc('0x23')];this[_0xaecc('0x24')]=_0x176c29[_0xaecc('0x24')];this['ContactId']=_0x176c29['ContactId'];this[_0xaecc('0x25')]=_0x176c29['ListId'];this['UserId']=_0x176c29[_0xaecc('0x26')];this[_0xaecc('0x27')]=_0x176c29[_0xaecc('0x27')];this['CampaignId']=_0x176c29[_0xaecc('0x28')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index f9cca9b..fc72c01 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 _0x54fe=['countagentrejectretry','calleridname','number','starttime','responsetime','ringtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x54fe,0xad));var _0xe54f=function(_0x32cf0c,_0x55d431){_0x32cf0c=_0x32cf0c-0x0;var _0x5a1d31=_0x54fe[_0x32cf0c];return _0x5a1d31;};'use strict';var utils=require('../utils');function History(_0x3b6717){this[_0xe54f('0x0')]=_0x3b6717[_0xe54f('0x0')];this[_0xe54f('0x1')]=_0x3b6717[_0xe54f('0x1')]||undefined;this[_0xe54f('0x2')]=_0x3b6717[_0xe54f('0x2')];this[_0xe54f('0x3')]=_0x3b6717['type']===_0xe54f('0x4')?_0xe54f('0x5'):_0x3b6717[_0xe54f('0x2')];this[_0xe54f('0x6')]=_0x3b6717['countbusyretry'];this[_0xe54f('0x7')]=_0x3b6717['countcongestionretry'];this[_0xe54f('0x8')]=_0x3b6717[_0xe54f('0x8')];this['countglobal']=_0x3b6717['countbusyretry']+_0x3b6717[_0xe54f('0x7')]+_0x3b6717['countnoanswerretry']+_0x3b6717[_0xe54f('0x9')]+_0x3b6717[_0xe54f('0xa')]+_0x3b6717[_0xe54f('0xb')]+_0x3b6717[_0xe54f('0xc')]+_0x3b6717[_0xe54f('0xd')];this[_0xe54f('0x9')]=_0x3b6717['countnosuchnumberretry'];this[_0xe54f('0xa')]=_0x3b6717[_0xe54f('0xa')];this[_0xe54f('0xb')]=_0x3b6717[_0xe54f('0xb')];this[_0xe54f('0xc')]=_0x3b6717['countmachineretry'];this[_0xe54f('0xd')]=_0x3b6717[_0xe54f('0xd')];this[_0xe54f('0x5')]=_0x3b6717[_0xe54f('0x5')];this[_0xe54f('0xe')]=_0x3b6717['name'];this['calleridnum']=_0x3b6717[_0xe54f('0xf')];this['starttime']=_0x3b6717[_0xe54f('0x10')];this[_0xe54f('0x11')]=_0x3b6717[_0xe54f('0x11')];this['endtime']=_0x3b6717[_0xe54f('0x11')];this[_0xe54f('0x12')]=utils['getSeconds'](_0x3b6717[_0xe54f('0x11')],_0x3b6717['starttime']);this['holdtime']=0x0;this[_0xe54f('0x13')]=0x0;this['callback']=_0x3b6717['callback'];this[_0xe54f('0x14')]=_0x3b6717[_0xe54f('0x14')];this[_0xe54f('0x15')]=_0x3b6717[_0xe54f('0x15')];this[_0xe54f('0x16')]=_0x3b6717[_0xe54f('0x16')];this[_0xe54f('0x17')]=_0x3b6717[_0xe54f('0x17')];this[_0xe54f('0x18')]=_0x3b6717[_0xe54f('0x18')];this['UserId']=_0x3b6717['UserId'];this[_0xe54f('0x19')]=_0x3b6717['VoiceQueueId'];this[_0xe54f('0x1a')]=_0x3b6717['CampaignId'];this[_0xe54f('0x1b')]=_0x3b6717[_0xe54f('0x1b')]||'';this[_0xe54f('0x1c')]=_0x3b6717[_0xe54f('0x1c')]||'';this[_0xe54f('0x1d')]=_0x3b6717[_0xe54f('0x1d')];this[_0xe54f('0x1e')]=_0x3b6717[_0xe54f('0x1e')];}module['exports']=History; \ No newline at end of file +var _0xe859=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','starttime','responsetime','endtime','getSeconds','callback','callbackuniqueid','callbackat'];(function(_0x74b6f,_0x1c1ddd){var _0x513e89=function(_0x41f843){while(--_0x41f843){_0x74b6f['push'](_0x74b6f['shift']());}};_0x513e89(++_0x1c1ddd);}(_0xe859,0x113));var _0x9e85=function(_0x36db37,_0x43677b){_0x36db37=_0x36db37-0x0;var _0x330ad1=_0xe859[_0x36db37];return _0x330ad1;};'use strict';var utils=require(_0x9e85('0x0'));function History(_0x2fd4d5){this[_0x9e85('0x1')]=_0x2fd4d5[_0x9e85('0x1')];this[_0x9e85('0x2')]=_0x2fd4d5['scheduledat']||undefined;this['type']=_0x2fd4d5[_0x9e85('0x3')];this[_0x9e85('0x4')]=_0x2fd4d5[_0x9e85('0x3')]==='outbound'?_0x9e85('0x5'):_0x2fd4d5[_0x9e85('0x3')];this[_0x9e85('0x6')]=_0x2fd4d5[_0x9e85('0x6')];this[_0x9e85('0x7')]=_0x2fd4d5[_0x9e85('0x7')];this[_0x9e85('0x8')]=_0x2fd4d5['countnoanswerretry'];this[_0x9e85('0x9')]=_0x2fd4d5['countbusyretry']+_0x2fd4d5[_0x9e85('0x7')]+_0x2fd4d5[_0x9e85('0x8')]+_0x2fd4d5[_0x9e85('0xa')]+_0x2fd4d5['countdropretry']+_0x2fd4d5[_0x9e85('0xb')]+_0x2fd4d5['countmachineretry']+_0x2fd4d5[_0x9e85('0xc')];this[_0x9e85('0xa')]=_0x2fd4d5['countnosuchnumberretry'];this[_0x9e85('0xd')]=_0x2fd4d5[_0x9e85('0xd')];this[_0x9e85('0xb')]=_0x2fd4d5[_0x9e85('0xb')];this['countmachineretry']=_0x2fd4d5[_0x9e85('0xe')];this['countagentrejectretry']=_0x2fd4d5[_0x9e85('0xc')];this[_0x9e85('0x5')]=_0x2fd4d5[_0x9e85('0x5')];this['calleridname']=_0x2fd4d5['name'];this['calleridnum']=_0x2fd4d5['number'];this['starttime']=_0x2fd4d5[_0x9e85('0xf')];this['responsetime']=_0x2fd4d5[_0x9e85('0x10')];this[_0x9e85('0x11')]=_0x2fd4d5['responsetime'];this['ringtime']=utils[_0x9e85('0x12')](_0x2fd4d5['responsetime'],_0x2fd4d5[_0x9e85('0xf')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0x9e85('0x13')]=_0x2fd4d5[_0x9e85('0x13')];this['callbackuniqueid']=_0x2fd4d5[_0x9e85('0x14')];this[_0x9e85('0x15')]=_0x2fd4d5[_0x9e85('0x15')];this['recallme']=_0x2fd4d5[_0x9e85('0x16')];this[_0x9e85('0x17')]=_0x2fd4d5['ContactId'];this['ListId']=_0x2fd4d5[_0x9e85('0x18')];this[_0x9e85('0x19')]=_0x2fd4d5[_0x9e85('0x19')];this[_0x9e85('0x1a')]=_0x2fd4d5[_0x9e85('0x1a')];this['CampaignId']=_0x2fd4d5[_0x9e85('0x1b')];this['originatecalleridnum']=_0x2fd4d5[_0x9e85('0x1c')]||'';this[_0x9e85('0x1d')]=_0x2fd4d5['originatecalleridname']||'';this[_0x9e85('0x1e')]=_0x2fd4d5['state'];this['statedesc']=_0x2fd4d5[_0x9e85('0x1f')];}module[_0x9e85('0x20')]=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 6a38838..0d035ed 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 _0x4a65=['dropreason','endtime','ringtime','getSeconds','membername','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime'];(function(_0x3bf625,_0x497940){var _0x5e92bb=function(_0x185db8){while(--_0x185db8){_0x3bf625['push'](_0x3bf625['shift']());}};_0x5e92bb(++_0x497940);}(_0x4a65,0x1c3));var _0x54a6=function(_0x15dd79,_0x4080d3){_0x15dd79=_0x15dd79-0x0;var _0x3f85ac=_0x4a65[_0x15dd79];return _0x3f85ac;};'use strict';var utils=require(_0x54a6('0x0'));function QueueCallerAbandon(_0x204a74,_0x23f53e){this[_0x54a6('0x1')]=_0x204a74[_0x54a6('0x1')];this[_0x54a6('0x2')]=_0x204a74[_0x54a6('0x2')];this[_0x54a6('0x3')]=_0x204a74[_0x54a6('0x2')]===_0x54a6('0x4')?_0x54a6('0x5'):_0x204a74[_0x54a6('0x2')];this[_0x54a6('0x6')]=_0x204a74[_0x54a6('0x6')];this[_0x54a6('0x7')]=_0x204a74[_0x54a6('0x7')];this[_0x54a6('0x8')]=_0x204a74[_0x54a6('0x8')];this[_0x54a6('0x9')]=_0x204a74[_0x54a6('0x6')]+_0x204a74[_0x54a6('0x7')]+_0x204a74[_0x54a6('0x8')]+_0x204a74[_0x54a6('0xa')]+_0x204a74[_0x54a6('0xb')]+_0x204a74[_0x54a6('0xc')]+_0x204a74[_0x54a6('0xd')]+_0x204a74[_0x54a6('0xe')];this['countnosuchnumberretry']=_0x204a74[_0x54a6('0xa')];this[_0x54a6('0xb')]=_0x204a74['countdropretry'];this['countabandonedretry']=_0x204a74['countabandonedretry'];this[_0x54a6('0xd')]=_0x204a74[_0x54a6('0xd')];this['countagentrejectretry']=_0x204a74[_0x54a6('0xe')];this[_0x54a6('0xf')]=_0x23f53e[_0x54a6('0xf')];this[_0x54a6('0x10')]=_0x204a74['name'];this[_0x54a6('0x11')]=_0x204a74[_0x54a6('0x12')];this['starttime']=_0x204a74[_0x54a6('0x13')];this[_0x54a6('0x14')]=_0x204a74[_0x54a6('0x14')];this[_0x54a6('0x15')]=_0x204a74[_0x54a6('0x15')];this[_0x54a6('0x16')]=_0x204a74[_0x54a6('0x16')];this[_0x54a6('0x17')]=this[_0x54a6('0x15')];this[_0x54a6('0x18')]=utils[_0x54a6('0x19')](_0x204a74['responsetime'],_0x204a74[_0x54a6('0x13')]);this['holdtime']=utils['getSeconds'](this[_0x54a6('0x15')],_0x204a74[_0x54a6('0x14')]);this['talktime']=0x0;this[_0x54a6('0x5')]=_0x23f53e['queue'];this[_0x54a6('0x1a')]=_0x23f53e[_0x54a6('0x1b')];this[_0x54a6('0x1c')]=_0x23f53e[_0x54a6('0x1c')];this['callback']=_0x204a74['callback'];this['callbackuniqueid']=_0x204a74[_0x54a6('0x1d')];this['callbackat']=_0x204a74[_0x54a6('0x1e')];this['recallme']=_0x204a74[_0x54a6('0x1f')];this['ContactId']=_0x204a74[_0x54a6('0x20')];this[_0x54a6('0x21')]=_0x204a74[_0x54a6('0x21')];this['UserId']=_0x204a74[_0x54a6('0x22')];this[_0x54a6('0x23')]=_0x204a74[_0x54a6('0x23')];this[_0x54a6('0x24')]=_0x204a74[_0x54a6('0x24')];this[_0x54a6('0x25')]=_0x204a74[_0x54a6('0x25')]||'';this['originatecalleridname']=_0x204a74[_0x54a6('0x26')]||'';this[_0x54a6('0x27')]=_0x204a74['agiafterat'];this[_0x54a6('0x28')]=_0x204a74[_0x54a6('0x28')];this[_0x54a6('0x29')]=_0x204a74['statedesc'];}module[_0x54a6('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0x0990=['state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat'];(function(_0x5485aa,_0x13b24f){var _0x12a624=function(_0x205c90){while(--_0x205c90){_0x5485aa['push'](_0x5485aa['shift']());}};_0x12a624(++_0x13b24f);}(_0x0990,0x1c5));var _0x0099=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0x0990[_0x3902c1];return _0x1266cc;};'use strict';var utils=require(_0x0099('0x0'));function QueueCallerAbandon(_0x217663,_0x1f4d9a){this[_0x0099('0x1')]=_0x217663[_0x0099('0x1')];this[_0x0099('0x2')]=_0x217663[_0x0099('0x2')];this[_0x0099('0x3')]=_0x217663['type']===_0x0099('0x4')?_0x0099('0x5'):_0x217663[_0x0099('0x2')];this['countbusyretry']=_0x217663[_0x0099('0x6')];this[_0x0099('0x7')]=_0x217663[_0x0099('0x7')];this[_0x0099('0x8')]=_0x217663[_0x0099('0x8')];this[_0x0099('0x9')]=_0x217663[_0x0099('0x6')]+_0x217663[_0x0099('0x7')]+_0x217663[_0x0099('0x8')]+_0x217663['countnosuchnumberretry']+_0x217663[_0x0099('0xa')]+_0x217663[_0x0099('0xb')]+_0x217663[_0x0099('0xc')]+_0x217663['countagentrejectretry'];this[_0x0099('0xd')]=_0x217663[_0x0099('0xd')];this[_0x0099('0xa')]=_0x217663[_0x0099('0xa')];this[_0x0099('0xb')]=_0x217663[_0x0099('0xb')];this['countmachineretry']=_0x217663[_0x0099('0xc')];this[_0x0099('0xe')]=_0x217663[_0x0099('0xe')];this[_0x0099('0xf')]=_0x1f4d9a[_0x0099('0xf')];this[_0x0099('0x10')]=_0x217663[_0x0099('0x11')];this[_0x0099('0x12')]=_0x217663['number'];this[_0x0099('0x13')]=_0x217663[_0x0099('0x13')];this['responsetime']=_0x217663[_0x0099('0x14')];this[_0x0099('0x15')]=_0x217663['droptime'];this[_0x0099('0x16')]=_0x217663[_0x0099('0x16')];this[_0x0099('0x17')]=this[_0x0099('0x15')];this[_0x0099('0x18')]=utils[_0x0099('0x19')](_0x217663[_0x0099('0x14')],_0x217663['starttime']);this[_0x0099('0x1a')]=utils[_0x0099('0x19')](this[_0x0099('0x15')],_0x217663[_0x0099('0x14')]);this['talktime']=0x0;this['queue']=_0x1f4d9a[_0x0099('0x5')];this[_0x0099('0x1b')]=_0x1f4d9a[_0x0099('0x1c')];this[_0x0099('0x1d')]=_0x1f4d9a[_0x0099('0x1d')];this['callback']=_0x217663[_0x0099('0x1e')];this[_0x0099('0x1f')]=_0x217663[_0x0099('0x1f')];this[_0x0099('0x20')]=_0x217663[_0x0099('0x20')];this['recallme']=_0x217663[_0x0099('0x21')];this['ContactId']=_0x217663[_0x0099('0x22')];this[_0x0099('0x23')]=_0x217663[_0x0099('0x23')];this[_0x0099('0x24')]=_0x217663[_0x0099('0x24')];this[_0x0099('0x25')]=_0x217663[_0x0099('0x25')];this[_0x0099('0x26')]=_0x217663['CampaignId'];this[_0x0099('0x27')]=_0x217663['originatecalleridnum']||'';this[_0x0099('0x28')]=_0x217663[_0x0099('0x28')]||'';this[_0x0099('0x29')]=_0x217663[_0x0099('0x29')];this[_0x0099('0x2a')]=_0x217663[_0x0099('0x2a')];this[_0x0099('0x2b')]=_0x217663['statedesc'];}module[_0x0099('0x2c')]=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 20e7687..f4fd021 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 _0x32f4=['catch','[getContactDialerIvr]','countReScheduled','error','[rescheduleContact]','rescheduleContact','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[verifyAdditionalPhone]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','temp','[getContactDialer]','getContactDialerIvr','dialOrderByScheduledAt'];(function(_0x3e601f,_0x5bdeb6){var _0x48eb80=function(_0x4aabed){while(--_0x4aabed){_0x3e601f['push'](_0x3e601f['shift']());}};_0x48eb80(++_0x5bdeb6);}(_0x32f4,0x154));var _0x432f=function(_0x3269e1,_0x398d4c){_0x3269e1=_0x3269e1-0x0;var _0xce65d5=_0x32f4[_0x3269e1];return _0xce65d5;};'use strict';var util=require(_0x432f('0x0'));var logger=require(_0x432f('0x1'))(_0x432f('0x2'));var cmHopper=require(_0x432f('0x3'));var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x432f('0x4'));var cmHopperHistory=require(_0x432f('0x5'));function inspectError(_0x51a71a){return util[_0x432f('0x6')](_0x51a71a,{'showHidden':![],'depth':null});}function getContactDialer(_0x1eabac,_0x344a29,_0x355b02){return cmHopper[_0x432f('0x7')](_0x1eabac['id'],_0x344a29,_0x355b02,_0x1eabac['dialOrderByScheduledAt'])['catch'](function(_0x2f66fd){_0x1eabac[_0x432f('0x8')]=0x0;logger['error'](_0x432f('0x9'),inspectError(_0x2f66fd));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x1cdcfd,_0x340fe9){return cmHopper[_0x432f('0xa')](_0x1cdcfd['id'],_0x340fe9,_0x1cdcfd[_0x432f('0xb')])[_0x432f('0xc')](function(_0x5d0155){_0x1cdcfd[_0x432f('0x8')]=0x0;logger['error'](_0x432f('0xd'),inspectError(_0x5d0155));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x138967){return cmHopper[_0x432f('0xe')](_0x138967)['catch'](function(_0x457389){logger[_0x432f('0xf')]('[countReScheduled]',inspectError(_0x457389));});}exports[_0x432f('0xe')]=countReScheduled;function rescheduleContact(_0x26aa9a){return cmHopper['rescheduleContact'](_0x26aa9a)['catch'](function(_0x28d9e9){logger[_0x432f('0xf')](_0x432f('0x10'),inspectError(_0x28d9e9));});}exports[_0x432f('0x11')]=rescheduleContact;function unlockContact(_0x419bfe,_0x4f91c5,_0x175ba7){return cmHopper[_0x432f('0x12')](_0x419bfe,_0x4f91c5,_0x175ba7)[_0x432f('0xc')](function(_0x1504db){logger['error'](_0x432f('0x13'),inspectError(_0x1504db));});}exports[_0x432f('0x12')]=unlockContact;function moveContactManagedDialer(_0x42c2d2){return cmHopper[_0x432f('0x14')](_0x42c2d2)[_0x432f('0xc')](function(_0x129582){logger['error'](_0x432f('0x15'),inspectError(_0x129582));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x3d545d){return cmHopperBlack[_0x432f('0x16')](_0x3d545d)[_0x432f('0xc')](function(_0x391fd8){logger[_0x432f('0xf')](_0x432f('0x17'),inspectError(_0x391fd8));});}exports[_0x432f('0x16')]=checkIsBlackList;function checkIsBlackListIvr(_0x1899e6){return cmHopperBlack[_0x432f('0x18')](_0x1899e6)[_0x432f('0xc')](function(_0x40176d){logger[_0x432f('0xf')]('[checkIsBlackListIvr]',inspectError(_0x40176d));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x343d13,_0x5c4deb,_0x28968e){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x343d13,_0x5c4deb,_0x28968e)[_0x432f('0xc')](function(_0x175d1b){logger[_0x432f('0xf')](_0x432f('0x19'),inspectError(_0x175d1b));});}exports[_0x432f('0x1a')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x1e347a,_0x59f352,_0x252b3b){return cmHopperAdditionalPhone[_0x432f('0x1b')](_0x1e347a,_0x59f352,_0x252b3b)['catch'](function(_0x2cbde9){logger[_0x432f('0xf')](_0x432f('0x1c'),inspectError(_0x2cbde9));});}exports[_0x432f('0x1b')]=swapAdditionalPhones;function avgHandleTime(_0x44839){return cmHopperHistory[_0x432f('0x1d')](_0x44839)[_0x432f('0xc')](function(_0x5a3d18){logger[_0x432f('0xf')]('[avgHandleTime]',inspectError(_0x5a3d18));});}exports[_0x432f('0x1d')]=avgHandleTime;function createHistory(_0x573cc5){return cmHopperHistory[_0x432f('0x1e')](_0x573cc5)['catch'](function(_0x3f768b){logger['error'](_0x432f('0x1f'),inspectError(_0x3f768b));});}exports[_0x432f('0x1e')]=createHistory; \ No newline at end of file +var _0x4819=['[unlockContact]','[moveContactManagedDialer]','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','[swapAdditionalPhone]','avgHandleTime','createHistory','[createHistory]','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','temp','error','[getContactDialer]','dialOrderByScheduledAt','[getContactDialerIvr]','getContactDialerIvr','countReScheduled','catch','rescheduleContact','[rescheduleContact]','unlockContact'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0x4819,0xcd));var _0x9481=function(_0xe3a46,_0x4f9273){_0xe3a46=_0xe3a46-0x0;var _0x5bb333=_0x4819[_0xe3a46];return _0x5bb333;};'use strict';var util=require('util');var logger=require(_0x9481('0x0'))(_0x9481('0x1'));var cmHopper=require(_0x9481('0x2'));var cmHopperAdditionalPhone=require(_0x9481('0x3'));var cmHopperBlack=require(_0x9481('0x4'));var cmHopperHistory=require(_0x9481('0x5'));function inspectError(_0x40a703){return util[_0x9481('0x6')](_0x40a703,{'showHidden':![],'depth':null});}function getContactDialer(_0xc39edf,_0x16c617,_0x5ac51c){return cmHopper[_0x9481('0x7')](_0xc39edf['id'],_0x16c617,_0x5ac51c,_0xc39edf['dialOrderByScheduledAt'])['catch'](function(_0x14e05a){_0xc39edf[_0x9481('0x8')]=0x0;logger[_0x9481('0x9')](_0x9481('0xa'),inspectError(_0x14e05a));});}exports[_0x9481('0x7')]=getContactDialer;function getContactDialerIvr(_0x4c7d9c,_0x1818cf){return cmHopper['getContactDialerIvr'](_0x4c7d9c['id'],_0x1818cf,_0x4c7d9c[_0x9481('0xb')])['catch'](function(_0x411d24){_0x4c7d9c[_0x9481('0x8')]=0x0;logger[_0x9481('0x9')](_0x9481('0xc'),inspectError(_0x411d24));});}exports[_0x9481('0xd')]=getContactDialerIvr;function countReScheduled(_0x29515a){return cmHopper[_0x9481('0xe')](_0x29515a)[_0x9481('0xf')](function(_0xed8e9){logger['error']('[countReScheduled]',inspectError(_0xed8e9));});}exports[_0x9481('0xe')]=countReScheduled;function rescheduleContact(_0x150276){return cmHopper[_0x9481('0x10')](_0x150276)[_0x9481('0xf')](function(_0x3d23c2){logger[_0x9481('0x9')](_0x9481('0x11'),inspectError(_0x3d23c2));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0x4220f1,_0x7a7ee,_0x5b1fe6){return cmHopper[_0x9481('0x12')](_0x4220f1,_0x7a7ee,_0x5b1fe6)['catch'](function(_0x34108d){logger[_0x9481('0x9')](_0x9481('0x13'),inspectError(_0x34108d));});}exports[_0x9481('0x12')]=unlockContact;function moveContactManagedDialer(_0x546fce){return cmHopper['moveContactManagedDialer'](_0x546fce)[_0x9481('0xf')](function(_0x50a559){logger['error'](_0x9481('0x14'),inspectError(_0x50a559));});}exports[_0x9481('0x15')]=moveContactManagedDialer;function checkIsBlackList(_0x18c6f5){return cmHopperBlack[_0x9481('0x16')](_0x18c6f5)[_0x9481('0xf')](function(_0x3dc33f){logger['error'](_0x9481('0x17'),inspectError(_0x3dc33f));});}exports[_0x9481('0x16')]=checkIsBlackList;function checkIsBlackListIvr(_0x45f9df){return cmHopperBlack[_0x9481('0x18')](_0x45f9df)[_0x9481('0xf')](function(_0x56da97){logger[_0x9481('0x9')](_0x9481('0x19'),inspectError(_0x56da97));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x2bcf37,_0xd1cd1a,_0x352b3a){return cmHopperAdditionalPhone[_0x9481('0x1a')](_0x2bcf37,_0xd1cd1a,_0x352b3a)[_0x9481('0xf')](function(_0x49ecfa){logger[_0x9481('0x9')](_0x9481('0x1b'),inspectError(_0x49ecfa));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x5eb4f5,_0x12b0c3,_0x299e28){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x5eb4f5,_0x12b0c3,_0x299e28)[_0x9481('0xf')](function(_0x20ff9a){logger[_0x9481('0x9')](_0x9481('0x1c'),inspectError(_0x20ff9a));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x14f03e){return cmHopperHistory[_0x9481('0x1d')](_0x14f03e)[_0x9481('0xf')](function(_0x587706){logger[_0x9481('0x9')]('[avgHandleTime]',inspectError(_0x587706));});}exports[_0x9481('0x1d')]=avgHandleTime;function createHistory(_0xe153ab){return cmHopperHistory[_0x9481('0x1e')](_0xe153ab)[_0x9481('0xf')](function(_0x2e5e63){logger['error'](_0x9481('0x1f'),inspectError(_0x2e5e63));});}exports[_0x9481('0x1e')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index bb2161d..ee82b2c 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 _0xa990=['talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Intervals','NULL_INTERVAL','isEmpty','Interval','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','status','TrunkBackup','includes','INACTIVE','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','\x5cw{0,','pow','replace','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','tags','updatedAt','undefined','description','toUpperCase','XMD-','setXMDContactVariables','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TRUNK_IS_NOT_REACHABLE','dialMethod','isPreviewCampaign','type','isIVRCampaign','outbound','dialActive','isQueueCampaignActive','active','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused'];(function(_0x4660eb,_0x5325ab){var _0x20f73c=function(_0x48f76c){while(--_0x48f76c){_0x4660eb['push'](_0x4660eb['shift']());}};_0x20f73c(++_0x5325ab);}(_0xa990,0x190));var _0x0a99=function(_0x30cfdc,_0x5a0260){_0x30cfdc=_0x30cfdc-0x0;var _0x54e0ac=_0xa990[_0x30cfdc];return _0x54e0ac;};'use strict';var _=require('lodash');var moment=require(_0x0a99('0x0'));var util=require(_0x0a99('0x1'));var logger=require(_0x0a99('0x2'))(_0x0a99('0x3'));var timezones=require(_0x0a99('0x4'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0x0a99('0x5'),'BLACKLIST':_0x0a99('0x6'),'CONTACTS_RESCHEDULED':_0x0a99('0x7'),'DEACTIVATED':_0x0a99('0x8'),'DISACTIVED':_0x0a99('0x9'),'EMPTY_INTERVAL':_0x0a99('0xa'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x0a99('0xb'),'NO_AVAILABLE_CONTACTS':_0x0a99('0xc'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0x0a99('0xd'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x0a99('0xe'),'RECALL_TIMEOUT':_0x0a99('0xf'),'RUNNING':_0x0a99('0x10'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0x0a99('0x11')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x2754d1){return _0x2754d1[_0x0a99('0x12')]==='preview';}exports[_0x0a99('0x13')]=isPreviewCampaign;function isIVRCampaign(_0x2f09c0){return _0x2f09c0[_0x0a99('0x14')]==='ivr';}exports[_0x0a99('0x15')]=isIVRCampaign;function isOutboundQueue(_0x13fb6d){return _0x13fb6d[_0x0a99('0x14')]===_0x0a99('0x16');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x4d70ca){return _0x4d70ca[_0x0a99('0x17')];}exports[_0x0a99('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x3da2d7){return _0x3da2d7[_0x0a99('0x19')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x4b3767,_0x4adf45){var _0x4d5858=moment(_0x4b3767)[_0x0a99('0x1a')](0x0);var _0x5b2b3c=moment(_0x4adf45)[_0x0a99('0x1a')](0x0);return _0x4d5858[_0x0a99('0x1b')](_0x5b2b3c,_0x0a99('0x1c'));}exports[_0x0a99('0x1d')]=getSeconds;function hasQueueCampaignDataChanged(_0x349a5b,_0x4b7521){var _0x42b9e9=![];var _0x463cb5=_0x349a5b['dialMethod']!==_0x4b7521[_0x0a99('0x12')]||_0x349a5b['dialActive']!==_0x4b7521[_0x0a99('0x17')]||_0x349a5b['message']!==_0x4b7521[_0x0a99('0x1e')];var _0x1e1241=_0x349a5b['available']!==_0x4b7521[_0x0a99('0x1f')]||_0x349a5b[_0x0a99('0x20')]!==_0x4b7521[_0x0a99('0x20')]||_0x349a5b[_0x0a99('0x21')]!==_0x4b7521[_0x0a99('0x21')]||_0x349a5b['paused']!==_0x4b7521[_0x0a99('0x22')]||_0x349a5b['talking']!==_0x4b7521[_0x0a99('0x23')]||_0x349a5b['pTalking']!==_0x4b7521[_0x0a99('0x24')]||_0x349a5b[_0x0a99('0x25')]!==_0x4b7521[_0x0a99('0x25')]||_0x349a5b[_0x0a99('0x26')]!==_0x4b7521[_0x0a99('0x26')]||_0x349a5b[_0x0a99('0x27')]!==_0x4b7521[_0x0a99('0x27')];if(_0x349a5b[_0x0a99('0x28')]&&_0x4b7521[_0x0a99('0x28')]){_0x42b9e9=_0x349a5b[_0x0a99('0x28')][_0x0a99('0x29')]!==_0x4b7521[_0x0a99('0x28')]['name']||_0x349a5b['Trunk'][_0x0a99('0x19')]!==_0x4b7521[_0x0a99('0x28')][_0x0a99('0x19')];}return _0x463cb5||_0x1e1241||_0x42b9e9;}exports[_0x0a99('0x2a')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x472ffa){var _0x5489bc=null;var _0x1f6a8f=_0x472ffa[_0x0a99('0x2b')];if(_[_0x0a99('0x2c')](_0x472ffa[_0x0a99('0x2d')])||_[_0x0a99('0x2c')](_0x472ffa['Interval'])||_[_0x0a99('0x2c')](_0x472ffa['Interval'][_0x0a99('0x2e')])){_0x5489bc=CAMPAIGN_STATUS[_0x0a99('0x2f')];}else if(_[_0x0a99('0x30')](_0x472ffa['dialGlobalInterval'])||_['isEmpty'](_0x472ffa[_0x0a99('0x31')][_0x0a99('0x2e')])){_0x5489bc=CAMPAIGN_STATUS[_0x0a99('0x32')];}else if(_0x1f6a8f&&!timezones[_0x1f6a8f]){_0x5489bc=CAMPAIGN_STATUS[_0x0a99('0x33')];}return _0x5489bc;}function checkAnyValidTrunk(_0x1bae46,_0x37f12e){var _0x4a01b4=null;var _0x1315e9=_0x0a99('0x34');var _0x31eca0=[_0x0a99('0x35'),_0x0a99('0x36')];var _0x5c5b40=!![];if(_0x1bae46[_0x0a99('0x28')]&&_0x1bae46[_0x0a99('0x28')][_0x0a99('0x19')]){_0x1315e9+=_0x1bae46[_0x0a99('0x28')][_0x0a99('0x29')];_0x4a01b4=_0x37f12e[_0x1315e9];_0x5c5b40=_0x31eca0['includes'](_0x4a01b4[_0x0a99('0x37')]);}else if(_0x1bae46['TrunkBackup']&&_0x1bae46[_0x0a99('0x38')]['active']){_0x1315e9+=_0x1bae46['TrunkBackup'][_0x0a99('0x29')];_0x4a01b4=_0x37f12e[_0x1315e9];_0x5c5b40=_0x31eca0[_0x0a99('0x39')](_0x4a01b4[_0x0a99('0x37')]);}return _0x5c5b40;}function getQueueCampaignStatusMessage(_0x1c8209,_0x4f83e1){var _0x11e7e7=CAMPAIGN_STATUS[_0x0a99('0x5')];var _0x10d8d9=isPreviewCampaign(_0x1c8209);if(!isQueueCampaignActive(_0x1c8209)){if(_0x10d8d9){_0x11e7e7=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x1c8209[_0x0a99('0x27')]===0x0&&_0x1c8209[_0x0a99('0x23')]===0x0&&_0x1c8209[_0x0a99('0x25')]===0x0&&(_0x1c8209[_0x0a99('0x24')]||0x0)===0x0){_0x11e7e7=CAMPAIGN_STATUS[_0x0a99('0x3a')];}else{_0x11e7e7=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x1c8209[_0x0a99('0x20')]===0x0){_0x11e7e7=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x1c8209,_0x4f83e1)){_0x11e7e7=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x1c8209)){var _0x126659=checkAnyValidQueueCampaignInterval(_0x1c8209);if(_0x126659){_0x11e7e7=_0x126659;}}return _0x11e7e7;}exports[_0x0a99('0x3b')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x3e0ba5){var _0x5b1cef=CAMPAIGN_STATUS['DISACTIVED'];if(_0x3e0ba5[_0x0a99('0x27')]===0x0&&_0x3e0ba5[_0x0a99('0x23')]===0x0&&_0x3e0ba5[_0x0a99('0x25')]===0x0&&(_0x3e0ba5['pTalking']||0x0)===0x0){_0x5b1cef=CAMPAIGN_STATUS[_0x0a99('0x3a')];}return _0x5b1cef;}exports[_0x0a99('0x3c')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x3ff0ec){var _0x5c77e=_0x3ff0ec['match'](/"(.*?)"/);return _0x5c77e?_0x5c77e[0x1]:_0x3ff0ec;}exports[_0x0a99('0x3d')]=extractCalleridName;function getCallerId(_0x102d08,_0x4abd23,_0x5876c3){if(!_[_0x0a99('0x3e')](_0x5876c3)&&typeof _0x5876c3===_0x0a99('0x3f')&&!_[_0x0a99('0x30')](_0x5876c3)){if(!_[_0x0a99('0x3e')](_0x4abd23)&&typeof _0x4abd23===_0x0a99('0x3f')&&!_[_0x0a99('0x30')](_0x4abd23)){return util[_0x0a99('0x40')](_0x0a99('0x41'),_0x4abd23,_0x5876c3);}return util['format'](_0x0a99('0x41'),_0x5876c3,_0x5876c3);}if(!_[_0x0a99('0x3e')](_0x102d08)&&typeof _0x102d08===_0x0a99('0x3f')&&!_[_0x0a99('0x30')](_0x102d08)){return _0x102d08;}return _0x0a99('0x42');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x27f61c,_0x1f8f3d){var _0x55c340;var _0x2b8e7b;var _0x34499d;if(_0x1f8f3d<=0x0){_0x1f8f3d=0x1;}_0x55c340=new RegExp(_0x0a99('0x43')+_0x1f8f3d+'}$');_0x2b8e7b=Math[_0x0a99('0x44')](0xa,_0x1f8f3d-0x1);_0x34499d=Math[_0x0a99('0x44')](0xa,_0x1f8f3d)-0x1;return util[_0x0a99('0x40')]('%s',_[_0x0a99('0x45')](_0x27f61c,_0x55c340,_['random'](_0x2b8e7b,_0x34499d)[_0x0a99('0x46')]()));}exports[_0x0a99('0x47')]=getCallerIdRandom;function decrementOriginate(_0x3ba9f9){if(_0x3ba9f9[_0x0a99('0x27')]&&_0x3ba9f9[_0x0a99('0x27')]>0x0){_0x3ba9f9[_0x0a99('0x27')]-=0x1;}else{logger[_0x0a99('0x48')](_0x0a99('0x49'));}}exports[_0x0a99('0x4a')]=decrementOriginate;function checkContactEmpty(_0x40bbcd){return _0x40bbcd&&_0x40bbcd[_0x0a99('0x4b')]>0x0;}exports[_0x0a99('0x4c')]=checkContactEmpty;function erlangb(_0x27ecc3,_0x2db201){if(_0x2db201===0x0){return 0x0;}var _0x1e7069=0x1;for(var _0x451c25=0x1;_0x451c25<=_0x2db201;_0x451c25+=0x1){_0x1e7069=0x1+_0x1e7069*_0x451c25/_0x27ecc3;}return 0x1/_0x1e7069;}exports[_0x0a99('0x4d')]=erlangb;function checkContactLowerLimitOriginate(_0x2a0005,_0xfb6df6,_0xd3df6c){if(_0xfb6df6>_0xd3df6c){for(var _0x7712e6=0x0;_0x7712e6<_0xfb6df6-_0xd3df6c;_0x7712e6+=0x1){decrementOriginate(_0x2a0005);}}}exports[_0x0a99('0x4e')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x2a291c){var _0x4a9f98={};var _0x553e51=['id',_0x0a99('0x4f'),_0x0a99('0x50'),_0x0a99('0x51')];const _0x4ac76b=0xfa;if(_0x2a291c){for(var _0x4436b3 in _0x2a291c){if(typeof _0x2a291c[_0x4436b3]!==_0x0a99('0x52')){if(!_[_0x0a99('0x2c')](_0x2a291c[_0x4436b3])&&!_0x553e51[_0x0a99('0x39')](_0x4436b3)){if(_0x4436b3===_0x0a99('0x53')&&_0x2a291c[_0x4436b3][_0x0a99('0x4b')]>_0x4ac76b){_0x4a9f98['XMD-'+_0x4436b3[_0x0a99('0x54')]()]=_0x2a291c[_0x4436b3][_0x0a99('0x46')]()['substring'](0x0,_0x4ac76b);}else{_0x4a9f98[_0x0a99('0x55')+_0x4436b3['toUpperCase']()]=_0x2a291c[_0x4436b3];}}}}}return _0x4a9f98;}exports[_0x0a99('0x56')]=setXMDContactVariables; \ No newline at end of file +var _0x03d6=['unmonitored','includes','status','TrunkBackup','ACTIVE','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','getQueueCampaignStatusMessage','match','extractCalleridName','string','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','\x5cw{0,','pow','random','toString','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','tags','updatedAt','undefined','description','XMD-','toUpperCase','substring','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','type','ivr','isIVRCampaign','outbound','isOutboundQueue','isQueueCampaignActive','active','milliseconds','diff','seconds','getSeconds','dialActive','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','dialTimezone','isNil','dialGlobalInterval','Interval','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','SIP/','reachable'];(function(_0x431b0e,_0x9450f1){var _0x3a87cf=function(_0x4bf45e){while(--_0x4bf45e){_0x431b0e['push'](_0x431b0e['shift']());}};_0x3a87cf(++_0x9450f1);}(_0x03d6,0x184));var _0x603d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x03d6[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x603d('0x0'));var moment=require(_0x603d('0x1'));var util=require(_0x603d('0x2'));var logger=require(_0x603d('0x3'))(_0x603d('0x4'));var timezones=require('../../../../config/environment/shared')['timezones'];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0x603d('0x5'),'DEACTIVATED':_0x603d('0x6'),'DISACTIVED':_0x603d('0x7'),'EMPTY_INTERVAL':_0x603d('0x8'),'INACTIVE':_0x603d('0x9'),'NO_AGENTS_LOGGED':_0x603d('0xa'),'NO_AVAILABLE_CONTACTS':_0x603d('0xb'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x603d('0xc'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x603d('0xd'),'RUNNING':_0x603d('0xe'),'UNKNOWN_TIMEZONE':_0x603d('0xf'),'UNREACHABLE_TRUNK':_0x603d('0x10')};exports[_0x603d('0x11')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0xe3be24){return _0xe3be24[_0x603d('0x12')]==='preview';}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x4add0d){return _0x4add0d[_0x603d('0x13')]===_0x603d('0x14');}exports[_0x603d('0x15')]=isIVRCampaign;function isOutboundQueue(_0x570dd6){return _0x570dd6[_0x603d('0x13')]===_0x603d('0x16');}exports[_0x603d('0x17')]=isOutboundQueue;function isQueueCampaignActive(_0x2793b6){return _0x2793b6['dialActive'];}exports[_0x603d('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x3b0ca7){return _0x3b0ca7[_0x603d('0x19')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x3e863f,_0x520af2){var _0x4305b0=moment(_0x3e863f)[_0x603d('0x1a')](0x0);var _0x19e824=moment(_0x520af2)[_0x603d('0x1a')](0x0);return _0x4305b0[_0x603d('0x1b')](_0x19e824,_0x603d('0x1c'));}exports[_0x603d('0x1d')]=getSeconds;function hasQueueCampaignDataChanged(_0x189e3a,_0x4d7d43){var _0x208d8d=![];var _0x23406d=_0x189e3a[_0x603d('0x12')]!==_0x4d7d43['dialMethod']||_0x189e3a[_0x603d('0x1e')]!==_0x4d7d43[_0x603d('0x1e')]||_0x189e3a[_0x603d('0x1f')]!==_0x4d7d43[_0x603d('0x1f')];var _0x2adc20=_0x189e3a['available']!==_0x4d7d43[_0x603d('0x20')]||_0x189e3a['loggedIn']!==_0x4d7d43[_0x603d('0x21')]||_0x189e3a['loggedInDb']!==_0x4d7d43[_0x603d('0x22')]||_0x189e3a[_0x603d('0x23')]!==_0x4d7d43[_0x603d('0x23')]||_0x189e3a[_0x603d('0x24')]!==_0x4d7d43[_0x603d('0x24')]||_0x189e3a[_0x603d('0x25')]!==_0x4d7d43[_0x603d('0x25')]||_0x189e3a['waiting']!==_0x4d7d43[_0x603d('0x26')]||_0x189e3a[_0x603d('0x27')]!==_0x4d7d43[_0x603d('0x27')]||_0x189e3a[_0x603d('0x28')]!==_0x4d7d43[_0x603d('0x28')];if(_0x189e3a[_0x603d('0x29')]&&_0x4d7d43[_0x603d('0x29')]){_0x208d8d=_0x189e3a['Trunk'][_0x603d('0x2a')]!==_0x4d7d43[_0x603d('0x29')]['name']||_0x189e3a[_0x603d('0x29')][_0x603d('0x19')]!==_0x4d7d43[_0x603d('0x29')][_0x603d('0x19')];}return _0x23406d||_0x2adc20||_0x208d8d;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x115763){var _0x2e1f66=null;var _0x9aa48b=_0x115763[_0x603d('0x2b')];if(_[_0x603d('0x2c')](_0x115763[_0x603d('0x2d')])||_[_0x603d('0x2c')](_0x115763[_0x603d('0x2e')])||_[_0x603d('0x2c')](_0x115763[_0x603d('0x2e')]['Intervals'])){_0x2e1f66=CAMPAIGN_STATUS[_0x603d('0x2f')];}else if(_[_0x603d('0x30')](_0x115763[_0x603d('0x2d')])||_[_0x603d('0x30')](_0x115763[_0x603d('0x2e')]['Intervals'])){_0x2e1f66=CAMPAIGN_STATUS[_0x603d('0x31')];}else if(_0x9aa48b&&!timezones[_0x9aa48b]){_0x2e1f66=CAMPAIGN_STATUS['UNKNOWN_TIMEZONE'];}return _0x2e1f66;}function checkAnyValidTrunk(_0x3d6178,_0x5703cb){var _0x8e2a18=null;var _0x1e815f=_0x603d('0x32');var _0x36dc2b=[_0x603d('0x33'),_0x603d('0x34')];var _0xba24fe=!![];if(_0x3d6178['Trunk']&&_0x3d6178[_0x603d('0x29')][_0x603d('0x19')]){_0x1e815f+=_0x3d6178[_0x603d('0x29')]['name'];_0x8e2a18=_0x5703cb[_0x1e815f];_0xba24fe=_0x36dc2b[_0x603d('0x35')](_0x8e2a18[_0x603d('0x36')]);}else if(_0x3d6178[_0x603d('0x37')]&&_0x3d6178['TrunkBackup'][_0x603d('0x19')]){_0x1e815f+=_0x3d6178[_0x603d('0x37')][_0x603d('0x2a')];_0x8e2a18=_0x5703cb[_0x1e815f];_0xba24fe=_0x36dc2b[_0x603d('0x35')](_0x8e2a18['status']);}return _0xba24fe;}function getQueueCampaignStatusMessage(_0x37a516,_0x257e72){var _0x54c66b=CAMPAIGN_STATUS[_0x603d('0x38')];var _0x11a44f=isPreviewCampaign(_0x37a516);if(!isQueueCampaignActive(_0x37a516)){if(_0x11a44f){_0x54c66b=CAMPAIGN_STATUS[_0x603d('0x39')];}else{if(_0x37a516['originated']===0x0&&_0x37a516[_0x603d('0x24')]===0x0&&_0x37a516[_0x603d('0x26')]===0x0&&(_0x37a516[_0x603d('0x25')]||0x0)===0x0){_0x54c66b=CAMPAIGN_STATUS[_0x603d('0x39')];}else{_0x54c66b=CAMPAIGN_STATUS[_0x603d('0x3a')];}}}else if(_0x37a516[_0x603d('0x21')]===0x0){_0x54c66b=CAMPAIGN_STATUS[_0x603d('0x3b')];}else if(!checkAnyValidTrunk(_0x37a516,_0x257e72)){_0x54c66b=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x37a516)){var _0x5515e4=checkAnyValidQueueCampaignInterval(_0x37a516);if(_0x5515e4){_0x54c66b=_0x5515e4;}}return _0x54c66b;}exports[_0x603d('0x3c')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x25ecab){var _0x54c1a9=CAMPAIGN_STATUS[_0x603d('0x3a')];if(_0x25ecab[_0x603d('0x28')]===0x0&&_0x25ecab['talking']===0x0&&_0x25ecab['waiting']===0x0&&(_0x25ecab[_0x603d('0x25')]||0x0)===0x0){_0x54c1a9=CAMPAIGN_STATUS['INACTIVE'];}return _0x54c1a9;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x51e6e2){var _0x5d1bf3=_0x51e6e2[_0x603d('0x3d')](/"(.*?)"/);return _0x5d1bf3?_0x5d1bf3[0x1]:_0x51e6e2;}exports[_0x603d('0x3e')]=extractCalleridName;function getCallerId(_0x33c76f,_0x40c1c3,_0x21efde){if(!_['isUndefined'](_0x21efde)&&typeof _0x21efde===_0x603d('0x3f')&&!_['isEmpty'](_0x21efde)){if(!_[_0x603d('0x40')](_0x40c1c3)&&typeof _0x40c1c3===_0x603d('0x3f')&&!_[_0x603d('0x30')](_0x40c1c3)){return util[_0x603d('0x41')](_0x603d('0x42'),_0x40c1c3,_0x21efde);}return util['format'](_0x603d('0x42'),_0x21efde,_0x21efde);}if(!_[_0x603d('0x40')](_0x33c76f)&&typeof _0x33c76f==='string'&&!_[_0x603d('0x30')](_0x33c76f)){return _0x33c76f;}return _0x603d('0x43');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x4dbc,_0x149823){var _0x3cd07e;var _0x1de497;var _0x21c9ef;if(_0x149823<=0x0){_0x149823=0x1;}_0x3cd07e=new RegExp(_0x603d('0x44')+_0x149823+'}$');_0x1de497=Math[_0x603d('0x45')](0xa,_0x149823-0x1);_0x21c9ef=Math[_0x603d('0x45')](0xa,_0x149823)-0x1;return util[_0x603d('0x41')]('%s',_['replace'](_0x4dbc,_0x3cd07e,_[_0x603d('0x46')](_0x1de497,_0x21c9ef)[_0x603d('0x47')]()));}exports[_0x603d('0x48')]=getCallerIdRandom;function decrementOriginate(_0x4a667b){if(_0x4a667b['originated']&&_0x4a667b['originated']>0x0){_0x4a667b[_0x603d('0x28')]-=0x1;}else{logger['error'](_0x603d('0x49'));}}exports[_0x603d('0x4a')]=decrementOriginate;function checkContactEmpty(_0x3e9665){return _0x3e9665&&_0x3e9665[_0x603d('0x4b')]>0x0;}exports[_0x603d('0x4c')]=checkContactEmpty;function erlangb(_0x5d0fe0,_0x290d27){if(_0x290d27===0x0){return 0x0;}var _0x55f9db=0x1;for(var _0x2d82a1=0x1;_0x2d82a1<=_0x290d27;_0x2d82a1+=0x1){_0x55f9db=0x1+_0x55f9db*_0x2d82a1/_0x5d0fe0;}return 0x1/_0x55f9db;}exports[_0x603d('0x4d')]=erlangb;function checkContactLowerLimitOriginate(_0x4b1f89,_0x5d4469,_0x255296){if(_0x5d4469>_0x255296){for(var _0x406d6d=0x0;_0x406d6d<_0x5d4469-_0x255296;_0x406d6d+=0x1){decrementOriginate(_0x4b1f89);}}}exports[_0x603d('0x4e')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x3f7ea1){var _0x3e2def={};var _0x1d8271=['id',_0x603d('0x4f'),_0x603d('0x50'),_0x603d('0x51')];const _0x152e6c=0xfa;if(_0x3f7ea1){for(var _0x1df4c3 in _0x3f7ea1){if(typeof _0x3f7ea1[_0x1df4c3]!==_0x603d('0x52')){if(!_[_0x603d('0x2c')](_0x3f7ea1[_0x1df4c3])&&!_0x1d8271[_0x603d('0x35')](_0x1df4c3)){if(_0x1df4c3===_0x603d('0x53')&&_0x3f7ea1[_0x1df4c3]['length']>_0x152e6c){_0x3e2def[_0x603d('0x54')+_0x1df4c3[_0x603d('0x55')]()]=_0x3f7ea1[_0x1df4c3][_0x603d('0x47')]()[_0x603d('0x56')](0x0,_0x152e6c);}else{_0x3e2def[_0x603d('0x54')+_0x1df4c3[_0x603d('0x55')]()]=_0x3f7ea1[_0x1df4c3];}}}}}return _0x3e2def;}exports[_0x603d('0x57')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index c10fe2a..be32078 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(_0x38ddcc,_0x4d97d5){var _0x3b1acb=function(_0x384170){while(--_0x384170){_0x38ddcc['push'](_0x38ddcc['shift']());}};_0x3b1acb(++_0x4d97d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_0x242eec,_0x142a6a){var _0x39294d=function(_0x4c5fe9){while(--_0x4c5fe9){_0x242eec['push'](_0x242eec['shift']());}};_0x39294d(++_0x142a6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 3f8f641..7714ab5 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 _0xc6e4=['\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','notify','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','response','reason','AttachmentId','update','[Fax][Message][Error][Updated]','catch','[Fax][Message][Error][NoUpdate1]','updateStatus','logger','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','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','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','../rpc/faxAccount','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc6e4,0x1a5));var _0x4c6e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc6e4[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x4c6e('0x0'));var _=require('lodash');var BPromise=require(_0x4c6e('0x1'));var uuid=require(_0x4c6e('0x2'));var moment=require(_0x4c6e('0x3'));var path=require(_0x4c6e('0x4'));var tiff2pdf=require(_0x4c6e('0x5'));var gs=require(_0x4c6e('0x6'));var logger=require(_0x4c6e('0x7'))(_0x4c6e('0x8'));var ami=require(_0x4c6e('0x9'));var rpcDb=require(_0x4c6e('0xa'));var Channel=require(_0x4c6e('0xb'));var ut=require('./util/util');var Action=require('./action');var faxAccount=require(_0x4c6e('0xc'));var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x2893d5){this[_0x4c6e('0xd')]={};this[_0x4c6e('0xe')]=_0x2893d5[_0x4c6e('0xe')];this[_0x4c6e('0xf')]=_0x2893d5[_0x4c6e('0xf')];this[_0x4c6e('0x10')]={};ami['on'](_0x4c6e('0x11'),this[_0x4c6e('0x12')][_0x4c6e('0x13')](this));ami['on']('varset',this[_0x4c6e('0x14')][_0x4c6e('0x13')](this));ami['on'](_0x4c6e('0x15'),this['syncNewState']['bind'](this));ami['on']('newexten',this['syncNewExten'][_0x4c6e('0x13')](this));ami['on'](_0x4c6e('0x16'),this[_0x4c6e('0x17')][_0x4c6e('0x13')](this));ami['on'](_0x4c6e('0x18'),this[_0x4c6e('0x19')][_0x4c6e('0x13')](this));ami['on'](_0x4c6e('0x1a'),this['syncHangup']['bind'](this));ami['on'](_0x4c6e('0x1b'),this[_0x4c6e('0x1c')][_0x4c6e('0x13')](this));}Fax[_0x4c6e('0x1d')][_0x4c6e('0x12')]=function(_0xe7d750){if(_0xe7d750[_0x4c6e('0x1e')]===_0x4c6e('0x1f')){for(var _0x224bed in this[_0x4c6e('0xe')]){if(this[_0x4c6e('0xe')][_0x4c6e('0x20')](_0x224bed)){if(_0xe7d750[_0x4c6e('0x21')]===this['faxAccounts'][_0x224bed][_0x4c6e('0x22')]){this['channels'][_0xe7d750['uniqueid']]={};this[_0x4c6e('0xd')][_0xe7d750[_0x4c6e('0x23')]][_0x4c6e('0x24')]=_0xe7d750[_0x4c6e('0x24')];this[_0x4c6e('0xd')][_0xe7d750['uniqueid']]['id']=this[_0x4c6e('0xe')][_0x224bed]['id'];this[_0x4c6e('0xd')][_0xe7d750[_0x4c6e('0x23')]][_0x4c6e('0x25')]=this[_0x4c6e('0xe')][_0x224bed][_0x4c6e('0x25')];logger[_0x4c6e('0x26')](_0xe7d750[_0x4c6e('0x23')],_0x4c6e('0x27'));}}}}if(this[_0x4c6e('0x10')][_0xe7d750[_0x4c6e('0x23')]]){this[_0x4c6e('0xd')][_0xe7d750[_0x4c6e('0x23')]]={};this[_0x4c6e('0xd')][_0xe7d750[_0x4c6e('0x23')]][_0x4c6e('0x24')]=_0xe7d750[_0x4c6e('0x24')];logger[_0x4c6e('0x26')](_0xe7d750[_0x4c6e('0x23')],'\x20syncNewchannel\x20');}};Fax[_0x4c6e('0x1d')]['syncVarSet']=function(_0x10dd9f){if(this['channels'][_0x10dd9f[_0x4c6e('0x23')]]){for(var _0x4edc9f in _0x10dd9f[_0x4c6e('0x28')]){if(_0x10dd9f[_0x4c6e('0x28')][_0x4c6e('0x20')](_0x4edc9f)){this[_0x4c6e('0xd')][_0x10dd9f[_0x4c6e('0x23')]][_0x4edc9f]=_0x10dd9f[_0x4c6e('0x29')];}}}};Fax[_0x4c6e('0x1d')][_0x4c6e('0x2a')]=function(_0x5d222e){if(this[_0x4c6e('0xd')][_0x5d222e['uniqueid']]){this[_0x4c6e('0xd')][_0x5d222e[_0x4c6e('0x23')]][_0x4c6e('0x2b')]=_0x5d222e['channelstate'];this[_0x4c6e('0xd')][_0x5d222e[_0x4c6e('0x23')]]['channelstatedesc']=_0x5d222e[_0x4c6e('0x2c')];}};Fax['prototype']['syncNewExten']=function(_0x5e4dc2){if(this[_0x4c6e('0xd')][_0x5e4dc2[_0x4c6e('0x23')]]){for(var _0x9cec22 in _0x5e4dc2['variable']){if(_0x5e4dc2[_0x4c6e('0x28')]['hasOwnProperty'](_0x9cec22)){this[_0x4c6e('0xd')][_0x5e4dc2[_0x4c6e('0x23')]][_0x9cec22]=_0x5e4dc2[_0x4c6e('0x29')];}}}};Fax[_0x4c6e('0x1d')][_0x4c6e('0x17')]=function(_0x2f5095){if(this[_0x4c6e('0xd')][_0x2f5095[_0x4c6e('0x23')]]){this['channels'][_0x2f5095[_0x4c6e('0x23')]][_0x4c6e('0x2d')]=_0x2f5095['operation'];this[_0x4c6e('0xd')][_0x2f5095[_0x4c6e('0x23')]][_0x4c6e('0x2e')]=_0x2f5095[_0x4c6e('0x2e')];this[_0x4c6e('0xd')][_0x2f5095['uniqueid']][_0x4c6e('0x22')]=_0x2f5095['localstationid'];this[_0x4c6e('0xd')][_0x2f5095[_0x4c6e('0x23')]][_0x4c6e('0x2f')]=_0x2f5095[_0x4c6e('0x2f')];logger[_0x4c6e('0x26')](_0x2f5095[_0x4c6e('0x23')],_0x4c6e('0x30'));}};Fax['prototype'][_0x4c6e('0x19')]=function(_0x365427){var _0x5974e4=this;if(this[_0x4c6e('0xd')][_0x365427[_0x4c6e('0x23')]]){var _0x546d79=this[_0x4c6e('0xd')][_0x365427['uniqueid']]['id'];this['channels'][_0x365427[_0x4c6e('0x23')]][_0x4c6e('0x31')]=_0x365427[_0x4c6e('0x31')];this[_0x4c6e('0xd')][_0x365427[_0x4c6e('0x23')]][_0x4c6e('0x32')]=_0x365427[_0x4c6e('0x32')];this[_0x4c6e('0xd')][_0x365427[_0x4c6e('0x23')]][_0x4c6e('0x22')]=_0x365427[_0x4c6e('0x22')];this[_0x4c6e('0xd')][_0x365427[_0x4c6e('0x23')]][_0x4c6e('0x33')]=_0x365427[_0x4c6e('0x33')];this[_0x4c6e('0xd')][_0x365427[_0x4c6e('0x23')]][_0x4c6e('0x34')]=_0x365427[_0x4c6e('0x34')];this[_0x4c6e('0xd')][_0x365427[_0x4c6e('0x23')]][_0x4c6e('0x2f')]=_0x365427['filename'];this['channels'][_0x365427[_0x4c6e('0x23')]][_0x4c6e('0x35')]=_0x365427['calleridnum'];if(this['channels'][_0x365427[_0x4c6e('0x23')]]['pagestransferred']>0x0){tiff2pdf(_0x365427[_0x4c6e('0x2f')],_0x4c6e('0x36'),function(_0x5d426d){logger['info'](_0x365427[_0x4c6e('0x23')],_0x4c6e('0x37'),_0x5d426d['message']);attachment[_0x4c6e('0x38')]({'name':path[_0x4c6e('0x39')](_0x365427[_0x4c6e('0x2f')])['name'],'basename':path['parse'](_0x365427[_0x4c6e('0x2f')])['name']+_0x4c6e('0x3a'),'type':_0x4c6e('0x3b')})[_0x4c6e('0x3c')](function(_0x398d49){faxAccount[_0x4c6e('0x3d')](_0x546d79,{'from':_0x365427[_0x4c6e('0x35')],'mapKey':_0x4c6e('0x8'),'body':path[_0x4c6e('0x39')](_0x365427[_0x4c6e('0x2f')])[_0x4c6e('0x25')]+'.pdf','AttachmentId':_0x398d49['id']})['catch'](function(_0x81fcf3){logger[_0x4c6e('0x3e')](_0x365427[_0x4c6e('0x23')],_0x4c6e('0x3f'),JSON[_0x4c6e('0x40')](_0x81fcf3));});})['catch'](function(_0x561267){logger[_0x4c6e('0x3e')](_0x365427[_0x4c6e('0x23')],_0x4c6e('0x41'),JSON[_0x4c6e('0x40')](_0x561267));});});}logger[_0x4c6e('0x26')](_0x365427['uniqueid'],_0x4c6e('0x41'));}};Fax[_0x4c6e('0x1d')]['syncOriginateResponse']=function(_0x296624){if(this[_0x4c6e('0x10')][_0x296624[_0x4c6e('0x23')]]){_[_0x4c6e('0x42')](this[_0x4c6e('0xd')][_0x296624[_0x4c6e('0x23')]],_['pick'](_0x296624,[_0x4c6e('0x43'),_0x4c6e('0x44')]));}};function updateStatus(_0x45b739){if(_0x45b739[_0x4c6e('0x45')]){faxMessage[_0x4c6e('0x46')](_0x45b739['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x10fe4c){ut['logger'](_0x4c6e('0x47'),_0x10fe4c);})[_0x4c6e('0x48')](function(_0x52d009){ut['logger'](_0x4c6e('0x49'),_0x52d009);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x4c6e('0x1d')][_0x4c6e('0x4a')]=function(_0x420c72,_0x5bca4a,_0x27151c){var _0xa877a0=this;var _0x18ef41={};if(_0x5bca4a){_0x18ef41={'read':_0x5bca4a};}else{_0x18ef41={'failMessage':_0x27151c};}if(this[_0x4c6e('0x10')][_0x420c72][_0x4c6e('0x45')]){faxMessage[_0x4c6e('0x46')](this[_0x4c6e('0x10')][_0x420c72]['AttachmentId'],_0x18ef41)['then'](function(_0x4d8b07){ut[_0x4c6e('0x4b')](_0x4c6e('0x4c'),_0x4d8b07);})[_0x4c6e('0x48')](function(_0x46056c){ut[_0x4c6e('0x4b')](_0x4c6e('0x4d'),_0x46056c);})['finally'](function(){delete _0xa877a0[_0x4c6e('0xd')][_0x420c72];delete _0xa877a0[_0x4c6e('0x10')][_0x420c72];});}else{ut[_0x4c6e('0x4b')](_0x4c6e('0x4e'));delete this[_0x4c6e('0xd')][_0x420c72];delete this['actions'][_0x420c72];}};Fax[_0x4c6e('0x1d')][_0x4c6e('0x4f')]=function(_0x3b4162){var _0x4667b9=this;if(this[_0x4c6e('0xd')][_0x3b4162[_0x4c6e('0x23')]]){if(this[_0x4c6e('0x10')][_0x3b4162[_0x4c6e('0x23')]]){this[_0x4c6e('0xd')][_0x3b4162['uniqueid']]['id']=this[_0x4c6e('0x10')][_0x3b4162[_0x4c6e('0x23')]]['id'];this['channels'][_0x3b4162[_0x4c6e('0x23')]][_0x4c6e('0x25')]=this['actions'][_0x3b4162[_0x4c6e('0x23')]][_0x4c6e('0x25')];}logger['info'](_0x3b4162[_0x4c6e('0x23')],this[_0x4c6e('0x10')][_0x3b4162[_0x4c6e('0x23')]]?_0x4c6e('0x50'):'\x20hangup\x20faxRiceive\x20',JSON[_0x4c6e('0x40')](this[_0x4c6e('0xd')][_0x3b4162[_0x4c6e('0x23')]]));if(this[_0x4c6e('0x10')][_0x3b4162[_0x4c6e('0x23')]]){if(this[_0x4c6e('0xd')][_0x3b4162[_0x4c6e('0x23')]][_0x4c6e('0x51')]>0x0&&this[_0x4c6e('0xd')][_0x3b4162['uniqueid']]['faxstatus']===_0x4c6e('0x52')){this['updateStatus'](_0x3b4162[_0x4c6e('0x23')],!![]);}else{this[_0x4c6e('0x4a')](_0x3b4162['uniqueid'],![],this[_0x4c6e('0xd')][_0x3b4162[_0x4c6e('0x23')]][_0x4c6e('0x53')]?_0x4c6e('0x54')+this[_0x4c6e('0xd')][_0x3b4162[_0x4c6e('0x23')]][_0x4c6e('0x53')]:_0x4c6e('0x55'));}}}};Fax[_0x4c6e('0x1d')]['send']=function(_0x196854){var _0x45974b=this;return new BPromise(function(_0x152c8f,_0x1a0fc9){_0x45974b[_0x4c6e('0x56')](_0x196854,_0x45974b['faxAccounts'][_0x196854[_0x4c6e('0x57')]])[_0x4c6e('0x3c')](function(_0x24358d){ut[_0x4c6e('0x4b')](_0x4c6e('0x58'),_0x24358d);_0x152c8f(ut[_0x4c6e('0x59')]('Fax\x20received'));})[_0x4c6e('0x48')](function(_0x5d807b){ut[_0x4c6e('0x4b')](_0x4c6e('0x5a'),_0x5d807b);updateStatus(_0x196854);_0x1a0fc9(ut[_0x4c6e('0x59')]('Fax\x20failed'));});});};Fax[_0x4c6e('0x1d')][_0x4c6e('0x5b')]=function(_0x151ce6){var _0x1fb741=this;return new BPromise(function(_0x53cbdb,_0x417366){var _0x22cf94=_0x1fb741[_0x4c6e('0x5c')](_0x1fb741[_0x4c6e('0xe')][_0x151ce6[_0x4c6e('0x57')]][_0x4c6e('0x5d')],_0x151ce6);if(_0x22cf94['isValid']){_0x53cbdb(ut[_0x4c6e('0x59')]('Trunk\x20Reachable'));}else{_0x417366(ut['message'](_0x22cf94['message']));}});};function originate(_0x329874,_0x197165,_0x4ced8c){return new BPromise(function(_0x182071,_0x17e293){if(_0x4ced8c){var _0x339c90=util[_0x4c6e('0x5e')](_0x4c6e('0x5f'),path[_0x4c6e('0x39')](_0x329874[_0x4c6e('0x4')])['name'],_0x329874['path']);gs[_0x4c6e('0x60')](_0x339c90)[_0x4c6e('0x3c')](function(){_0x329874[_0x4c6e('0x4')]=util['format'](_0x4c6e('0x61'),path[_0x4c6e('0x39')](_0x329874[_0x4c6e('0x4')])['dir'],path[_0x4c6e('0x39')](_0x329874[_0x4c6e('0x4')])['name']);_0x197165['XMF-PATH']=_0x329874[_0x4c6e('0x4')];ut[_0x4c6e('0x4b')](_0x4c6e('0x62'),'');ami[_0x4c6e('0x63')](ut['variablesAction'](_0x329874,_0x197165))[_0x4c6e('0x3c')](function(_0x27f1c3){_0x182071(_0x27f1c3);})['catch'](function(_0x5f15f9){_0x17e293(_0x5f15f9);});})['catch'](function(_0x22beb6){_0x17e293(_0x22beb6);});}else{ami[_0x4c6e('0x63')](ut[_0x4c6e('0x64')](_0x329874,_0x197165))[_0x4c6e('0x3c')](function(_0x369230){_0x182071(_0x369230);})[_0x4c6e('0x48')](function(_0x496321){_0x17e293(_0x496321);});}});}Fax[_0x4c6e('0x1d')]['execOriginate']=function(_0x5170a7,_0x36fb41){var _0x1e797b=this;return new BPromise(function(_0x52f5de,_0x34090c){var _0x52a670=uuid['v4']();var _0x9625d9=ut['addVariables'](_0x5170a7,_0x36fb41);_0x1e797b[_0x4c6e('0x10')][_0x52a670]=new Action(_0x52a670,_0x36fb41,_0x5170a7);var _0x21661b=_0x1e797b[_0x4c6e('0x10')][_0x52a670];if(path['parse'](_0x5170a7[_0x4c6e('0x4')])[_0x4c6e('0x65')]===_0x4c6e('0x3a')){originate(_0x21661b,_0x9625d9,!![])[_0x4c6e('0x3c')](function(_0x55473a){_0x52f5de(_0x55473a);})[_0x4c6e('0x48')](function(_0x5c7660){_0x34090c(_0x5c7660);});}else{originate(_0x21661b,_0x9625d9,![])[_0x4c6e('0x3c')](function(_0x3d23d6){_0x52f5de(_0x3d23d6);})['catch'](function(_0x32e81f){_0x34090c(_0x32e81f);});}});};Fax[_0x4c6e('0x1d')][_0x4c6e('0x66')]=function(_0x100fc5){return!_['isNil'](_0x100fc5)&&!_[_0x4c6e('0x67')](_0x100fc5[_0x4c6e('0x25')])&&!_[_0x4c6e('0x67')](_0x100fc5[_0x4c6e('0x68')])&&_0x100fc5[_0x4c6e('0x68')]&&!_[_0x4c6e('0x67')](this[_0x4c6e('0xf')][util['format'](_0x4c6e('0x69'),_0x100fc5['name'])])&&!_['isNil'](this['trunks'][util[_0x4c6e('0x5e')](_0x4c6e('0x69'),_0x100fc5[_0x4c6e('0x25')])][_0x4c6e('0x2e')])&&(this[_0x4c6e('0xf')][util['format'](_0x4c6e('0x69'),_0x100fc5[_0x4c6e('0x25')])][_0x4c6e('0x2e')]==='reachable'||this[_0x4c6e('0xf')][util['format'](_0x4c6e('0x69'),_0x100fc5[_0x4c6e('0x25')])][_0x4c6e('0x2e')]===_0x4c6e('0x6a'));};Fax[_0x4c6e('0x1d')][_0x4c6e('0x5c')]=function(_0x3a140c,_0x265cf8){if(!this[_0x4c6e('0x66')](_0x3a140c)){ut[_0x4c6e('0x4b')](_0x4c6e('0x6b'),_['isNil'](_0x3a140c)?'':_0x3a140c[_0x4c6e('0x25')]+_0x4c6e('0x6c'));return{'isValid':![],'message':_0x4c6e('0x6d')};}if(_[_0x4c6e('0x67')](_0x265cf8[_0x4c6e('0x8')])){ut[_0x4c6e('0x4b')](_0x4c6e('0x6e'),JSON['stringify'](_0x265cf8));return{'isValid':![],'message':_0x4c6e('0x6f')};}if(_[_0x4c6e('0x67')](_0x265cf8['path'])){ut[_0x4c6e('0x4b')](_0x4c6e('0x70'),JSON[_0x4c6e('0x40')](_0x265cf8));return{'isValid':![],'message':_0x4c6e('0x71')};}return{'isValid':!![],'message':_0x4c6e('0x72')};};module['exports']=Fax; \ No newline at end of file +var _0x0066=['uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','channelstate','channelstatedesc','operation','status','localstationid','filename','remotestationid','pagestransferred','resolution','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','catch','\x20notify\x20','stringify','error','merge','pick','response','reason','update','AttachmentId','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','send','[Fax][execOriginate][success]','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','%s/%s.tif','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','./util/gs','../../../config/logger','fax','../ami','./channel','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncVarSet','bind','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','prototype','syncNewchannel','context','from-voip-provider','exten'];(function(_0x5e6118,_0x56dfd3){var _0xaf950f=function(_0x1b1c26){while(--_0x1b1c26){_0x5e6118['push'](_0x5e6118['shift']());}};_0xaf950f(++_0x56dfd3);}(_0x0066,0x195));var _0x6006=function(_0x320aef,_0x4485be){_0x320aef=_0x320aef-0x0;var _0x18c643=_0x0066[_0x320aef];return _0x18c643;};'use strict';var util=require(_0x6006('0x0'));var _=require(_0x6006('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require(_0x6006('0x2'));var logger=require(_0x6006('0x3'))(_0x6006('0x4'));var ami=require(_0x6006('0x5'));var rpcDb=require('./rpcDb');var Channel=require(_0x6006('0x6'));var ut=require('./util/util');var Action=require('./action');var faxAccount=require(_0x6006('0x7'));var attachment=require(_0x6006('0x8'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x592940){this[_0x6006('0x9')]={};this[_0x6006('0xa')]=_0x592940[_0x6006('0xa')];this[_0x6006('0xb')]=_0x592940[_0x6006('0xb')];this[_0x6006('0xc')]={};ami['on'](_0x6006('0xd'),this['syncNewchannel']['bind'](this));ami['on']('varset',this[_0x6006('0xe')][_0x6006('0xf')](this));ami['on']('newstate',this[_0x6006('0x10')][_0x6006('0xf')](this));ami['on'](_0x6006('0x11'),this[_0x6006('0x12')][_0x6006('0xf')](this));ami['on'](_0x6006('0x13'),this[_0x6006('0x14')]['bind'](this));ami['on'](_0x6006('0x15'),this[_0x6006('0x16')][_0x6006('0xf')](this));ami['on'](_0x6006('0x17'),this[_0x6006('0x18')][_0x6006('0xf')](this));ami['on'](_0x6006('0x19'),this['syncOriginateResponse'][_0x6006('0xf')](this));}Fax[_0x6006('0x1a')][_0x6006('0x1b')]=function(_0x533a02){if(_0x533a02[_0x6006('0x1c')]===_0x6006('0x1d')){for(var _0x473fe3 in this[_0x6006('0xa')]){if(this[_0x6006('0xa')]['hasOwnProperty'](_0x473fe3)){if(_0x533a02[_0x6006('0x1e')]===this[_0x6006('0xa')][_0x473fe3]['localstationid']){this[_0x6006('0x9')][_0x533a02['uniqueid']]={};this[_0x6006('0x9')][_0x533a02[_0x6006('0x1f')]][_0x6006('0x20')]=_0x533a02['channel'];this[_0x6006('0x9')][_0x533a02['uniqueid']]['id']=this['faxAccounts'][_0x473fe3]['id'];this[_0x6006('0x9')][_0x533a02[_0x6006('0x1f')]]['name']=this[_0x6006('0xa')][_0x473fe3][_0x6006('0x21')];logger[_0x6006('0x22')](_0x533a02[_0x6006('0x1f')],_0x6006('0x23'));}}}}if(this['actions'][_0x533a02[_0x6006('0x1f')]]){this[_0x6006('0x9')][_0x533a02[_0x6006('0x1f')]]={};this[_0x6006('0x9')][_0x533a02['uniqueid']][_0x6006('0x20')]=_0x533a02[_0x6006('0x20')];logger[_0x6006('0x22')](_0x533a02[_0x6006('0x1f')],_0x6006('0x23'));}};Fax[_0x6006('0x1a')]['syncVarSet']=function(_0x34d264){if(this['channels'][_0x34d264['uniqueid']]){for(var _0x2a9d80 in _0x34d264[_0x6006('0x24')]){if(_0x34d264['variable'][_0x6006('0x25')](_0x2a9d80)){this[_0x6006('0x9')][_0x34d264[_0x6006('0x1f')]][_0x2a9d80]=_0x34d264[_0x6006('0x26')];}}}};Fax[_0x6006('0x1a')][_0x6006('0x10')]=function(_0x28434d){if(this['channels'][_0x28434d['uniqueid']]){this[_0x6006('0x9')][_0x28434d[_0x6006('0x1f')]]['channelstate']=_0x28434d[_0x6006('0x27')];this[_0x6006('0x9')][_0x28434d[_0x6006('0x1f')]][_0x6006('0x28')]=_0x28434d[_0x6006('0x28')];}};Fax['prototype']['syncNewExten']=function(_0x2191ab){if(this[_0x6006('0x9')][_0x2191ab[_0x6006('0x1f')]]){for(var _0x37eb3a in _0x2191ab[_0x6006('0x24')]){if(_0x2191ab[_0x6006('0x24')][_0x6006('0x25')](_0x37eb3a)){this[_0x6006('0x9')][_0x2191ab[_0x6006('0x1f')]][_0x37eb3a]=_0x2191ab[_0x6006('0x26')];}}}};Fax['prototype'][_0x6006('0x14')]=function(_0x2d44d5){if(this['channels'][_0x2d44d5[_0x6006('0x1f')]]){this[_0x6006('0x9')][_0x2d44d5[_0x6006('0x1f')]][_0x6006('0x29')]=_0x2d44d5[_0x6006('0x29')];this[_0x6006('0x9')][_0x2d44d5['uniqueid']]['status']=_0x2d44d5[_0x6006('0x2a')];this['channels'][_0x2d44d5[_0x6006('0x1f')]][_0x6006('0x2b')]=_0x2d44d5['localstationid'];this[_0x6006('0x9')][_0x2d44d5[_0x6006('0x1f')]][_0x6006('0x2c')]=_0x2d44d5[_0x6006('0x2c')];logger[_0x6006('0x22')](_0x2d44d5[_0x6006('0x1f')],'\x20syncFaxStatus\x20');}};Fax[_0x6006('0x1a')][_0x6006('0x16')]=function(_0x54e59e){var _0x2c2725=this;if(this[_0x6006('0x9')][_0x54e59e[_0x6006('0x1f')]]){var _0x522be7=this[_0x6006('0x9')][_0x54e59e[_0x6006('0x1f')]]['id'];this[_0x6006('0x9')][_0x54e59e[_0x6006('0x1f')]][_0x6006('0x2d')]=_0x54e59e['remotestationid'];this['channels'][_0x54e59e[_0x6006('0x1f')]][_0x6006('0x2e')]=_0x54e59e[_0x6006('0x2e')];this['channels'][_0x54e59e[_0x6006('0x1f')]][_0x6006('0x2b')]=_0x54e59e[_0x6006('0x2b')];this[_0x6006('0x9')][_0x54e59e[_0x6006('0x1f')]]['resolution']=_0x54e59e[_0x6006('0x2f')];this[_0x6006('0x9')][_0x54e59e['uniqueid']]['transferrate']=_0x54e59e['transferrate'];this[_0x6006('0x9')][_0x54e59e[_0x6006('0x1f')]][_0x6006('0x2c')]=_0x54e59e[_0x6006('0x2c')];this[_0x6006('0x9')][_0x54e59e['uniqueid']]['calleridnum']=_0x54e59e[_0x6006('0x30')];if(this['channels'][_0x54e59e['uniqueid']][_0x6006('0x2e')]>0x0){tiff2pdf(_0x54e59e[_0x6006('0x2c')],_0x6006('0x31'),function(_0x12f366){logger['info'](_0x54e59e['uniqueid'],_0x6006('0x32'),_0x12f366[_0x6006('0x33')]);attachment[_0x6006('0x34')]({'name':path[_0x6006('0x35')](_0x54e59e[_0x6006('0x2c')])[_0x6006('0x21')],'basename':path['parse'](_0x54e59e[_0x6006('0x2c')])[_0x6006('0x21')]+_0x6006('0x36'),'type':_0x6006('0x37')})[_0x6006('0x38')](function(_0x4e2eb9){faxAccount['notify'](_0x522be7,{'from':_0x54e59e[_0x6006('0x30')],'mapKey':_0x6006('0x4'),'body':path[_0x6006('0x35')](_0x54e59e[_0x6006('0x2c')])[_0x6006('0x21')]+'.pdf','AttachmentId':_0x4e2eb9['id']})[_0x6006('0x39')](function(_0x9e03ee){logger['error'](_0x54e59e[_0x6006('0x1f')],_0x6006('0x3a'),JSON[_0x6006('0x3b')](_0x9e03ee));});})[_0x6006('0x39')](function(_0x1017d1){logger[_0x6006('0x3c')](_0x54e59e[_0x6006('0x1f')],'\x20receiveFax\x20',JSON[_0x6006('0x3b')](_0x1017d1));});});}logger[_0x6006('0x22')](_0x54e59e[_0x6006('0x1f')],'\x20receiveFax\x20');}};Fax['prototype']['syncOriginateResponse']=function(_0x35582f){if(this[_0x6006('0xc')][_0x35582f['uniqueid']]){_[_0x6006('0x3d')](this[_0x6006('0x9')][_0x35582f['uniqueid']],_[_0x6006('0x3e')](_0x35582f,[_0x6006('0x3f'),_0x6006('0x40')]));}};function updateStatus(_0x1da951){if(_0x1da951['AttachmentId']){faxMessage[_0x6006('0x41')](_0x1da951[_0x6006('0x42')],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x325975){ut[_0x6006('0x43')](_0x6006('0x44'),_0x325975);})[_0x6006('0x39')](function(_0x32aa7e){ut[_0x6006('0x43')](_0x6006('0x45'),_0x32aa7e);});}else{ut[_0x6006('0x43')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x6006('0x1a')]['updateStatus']=function(_0x20f19e,_0x26bae9,_0x128734){var _0x20d8ac=this;var _0x5d6d99={};if(_0x26bae9){_0x5d6d99={'read':_0x26bae9};}else{_0x5d6d99={'failMessage':_0x128734};}if(this['actions'][_0x20f19e][_0x6006('0x42')]){faxMessage['update'](this[_0x6006('0xc')][_0x20f19e]['AttachmentId'],_0x5d6d99)[_0x6006('0x38')](function(_0x581dd0){ut[_0x6006('0x43')](_0x6006('0x46'),_0x581dd0);})['catch'](function(_0x11ef82){ut[_0x6006('0x43')](_0x6006('0x47'),_0x11ef82);})[_0x6006('0x48')](function(){delete _0x20d8ac[_0x6006('0x9')][_0x20f19e];delete _0x20d8ac[_0x6006('0xc')][_0x20f19e];});}else{ut[_0x6006('0x43')](_0x6006('0x49'));delete this['channels'][_0x20f19e];delete this[_0x6006('0xc')][_0x20f19e];}};Fax[_0x6006('0x1a')][_0x6006('0x18')]=function(_0x4be124){var _0x1ba42c=this;if(this[_0x6006('0x9')][_0x4be124[_0x6006('0x1f')]]){if(this[_0x6006('0xc')][_0x4be124['uniqueid']]){this[_0x6006('0x9')][_0x4be124['uniqueid']]['id']=this[_0x6006('0xc')][_0x4be124[_0x6006('0x1f')]]['id'];this[_0x6006('0x9')][_0x4be124['uniqueid']][_0x6006('0x21')]=this[_0x6006('0xc')][_0x4be124[_0x6006('0x1f')]][_0x6006('0x21')];}logger[_0x6006('0x22')](_0x4be124[_0x6006('0x1f')],this['actions'][_0x4be124[_0x6006('0x1f')]]?_0x6006('0x4a'):_0x6006('0x4b'),JSON['stringify'](this[_0x6006('0x9')][_0x4be124['uniqueid']]));if(this[_0x6006('0xc')][_0x4be124[_0x6006('0x1f')]]){if(this['channels'][_0x4be124[_0x6006('0x1f')]][_0x6006('0x4c')]>0x0&&this[_0x6006('0x9')][_0x4be124['uniqueid']][_0x6006('0x13')]===_0x6006('0x4d')){this[_0x6006('0x4e')](_0x4be124[_0x6006('0x1f')],!![]);}else{this[_0x6006('0x4e')](_0x4be124[_0x6006('0x1f')],![],this[_0x6006('0x9')][_0x4be124[_0x6006('0x1f')]][_0x6006('0x4f')]?_0x6006('0x50')+this[_0x6006('0x9')][_0x4be124[_0x6006('0x1f')]][_0x6006('0x4f')]:'SENDING\x20FAILED');}}}};Fax[_0x6006('0x1a')][_0x6006('0x51')]=function(_0x124206){var _0x2dd97e=this;return new BPromise(function(_0x5f3ff7,_0x53ad8d){_0x2dd97e['execOriginate'](_0x124206,_0x2dd97e[_0x6006('0xa')][_0x124206['FaxAccountId']])[_0x6006('0x38')](function(_0x4d0f5f){ut[_0x6006('0x43')](_0x6006('0x52'),_0x4d0f5f);_0x5f3ff7(ut[_0x6006('0x33')]('Fax\x20received'));})['catch'](function(_0x1d1d10){ut[_0x6006('0x43')]('[Fax][execOriginate][failure]',_0x1d1d10);updateStatus(_0x124206);_0x53ad8d(ut[_0x6006('0x33')]('Fax\x20failed'));});});};Fax[_0x6006('0x1a')]['checkAfterSend']=function(_0x286927){var _0x46a0b0=this;return new BPromise(function(_0x386cbc,_0x112973){var _0x3121fb=_0x46a0b0[_0x6006('0x53')](_0x46a0b0[_0x6006('0xa')][_0x286927['FaxAccountId']]['Trunk'],_0x286927);if(_0x3121fb[_0x6006('0x54')]){_0x386cbc(ut['message'](_0x6006('0x55')));}else{_0x112973(ut[_0x6006('0x33')](_0x3121fb['message']));}});};function originate(_0x260bb5,_0x5540fa,_0x521e4e){return new BPromise(function(_0x1d2a79,_0x341f44){if(_0x521e4e){var _0x37d001=util[_0x6006('0x56')](_0x6006('0x57'),path[_0x6006('0x35')](_0x260bb5[_0x6006('0x58')])[_0x6006('0x21')],_0x260bb5[_0x6006('0x58')]);gs['execute'](_0x37d001)['then'](function(){_0x260bb5[_0x6006('0x58')]=util['format'](_0x6006('0x59'),path[_0x6006('0x35')](_0x260bb5[_0x6006('0x58')])['dir'],path[_0x6006('0x35')](_0x260bb5[_0x6006('0x58')])['name']);_0x5540fa['XMF-PATH']=_0x260bb5['path'];ut['logger'](_0x6006('0x5a'),'');ami[_0x6006('0x5b')](ut[_0x6006('0x5c')](_0x260bb5,_0x5540fa))[_0x6006('0x38')](function(_0xb3363c){_0x1d2a79(_0xb3363c);})['catch'](function(_0x584993){_0x341f44(_0x584993);});})['catch'](function(_0x491662){_0x341f44(_0x491662);});}else{ami['Action'](ut[_0x6006('0x5c')](_0x260bb5,_0x5540fa))[_0x6006('0x38')](function(_0x3daed8){_0x1d2a79(_0x3daed8);})[_0x6006('0x39')](function(_0x2ff360){_0x341f44(_0x2ff360);});}});}Fax[_0x6006('0x1a')][_0x6006('0x5d')]=function(_0x437d95,_0x21c742){var _0x2f43de=this;return new BPromise(function(_0xd54b4a,_0x306f2f){var _0x7bee30=uuid['v4']();var _0x42ce1e=ut[_0x6006('0x5e')](_0x437d95,_0x21c742);_0x2f43de['actions'][_0x7bee30]=new Action(_0x7bee30,_0x21c742,_0x437d95);var _0x40812e=_0x2f43de[_0x6006('0xc')][_0x7bee30];if(path[_0x6006('0x35')](_0x437d95[_0x6006('0x58')])[_0x6006('0x5f')]==='.pdf'){originate(_0x40812e,_0x42ce1e,!![])[_0x6006('0x38')](function(_0x11d7b7){_0xd54b4a(_0x11d7b7);})['catch'](function(_0x12d5f6){_0x306f2f(_0x12d5f6);});}else{originate(_0x40812e,_0x42ce1e,![])['then'](function(_0x52e8bc){_0xd54b4a(_0x52e8bc);})[_0x6006('0x39')](function(_0x13ac1a){_0x306f2f(_0x13ac1a);});}});};Fax[_0x6006('0x1a')][_0x6006('0x60')]=function(_0x308509){return!_[_0x6006('0x61')](_0x308509)&&!_['isNil'](_0x308509[_0x6006('0x21')])&&!_['isNil'](_0x308509['active'])&&_0x308509[_0x6006('0x62')]&&!_[_0x6006('0x61')](this[_0x6006('0xb')][util[_0x6006('0x56')](_0x6006('0x63'),_0x308509[_0x6006('0x21')])])&&!_[_0x6006('0x61')](this[_0x6006('0xb')][util[_0x6006('0x56')]('SIP/%s',_0x308509[_0x6006('0x21')])]['status'])&&(this['trunks'][util['format'](_0x6006('0x63'),_0x308509['name'])][_0x6006('0x2a')]===_0x6006('0x64')||this[_0x6006('0xb')][util['format'](_0x6006('0x63'),_0x308509[_0x6006('0x21')])][_0x6006('0x2a')]==='unmonitored');};Fax[_0x6006('0x1a')][_0x6006('0x53')]=function(_0x2e323c,_0x9a8888){if(!this['isTrunkReachable'](_0x2e323c)){ut[_0x6006('0x43')](_0x6006('0x65'),_['isNil'](_0x2e323c)?'':_0x2e323c['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x6006('0x66')};}if(_[_0x6006('0x61')](_0x9a8888['fax'])){ut['logger'](_0x6006('0x67'),JSON[_0x6006('0x3b')](_0x9a8888));return{'isValid':![],'message':_0x6006('0x68')};}if(_[_0x6006('0x61')](_0x9a8888['path'])){ut[_0x6006('0x43')](_0x6006('0x69'),JSON[_0x6006('0x3b')](_0x9a8888));return{'isValid':![],'message':_0x6006('0x6a')};}return{'isValid':!![],'message':_0x6006('0x6b')};};module[_0x6006('0x6c')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 828e896..114bf71 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 _0xf55f=['notify','resolve','catch','util','preview','lodash','../rpc/faxAccount','error','inspect'];(function(_0x523b93,_0x5a4411){var _0x3b0c80=function(_0x114004){while(--_0x114004){_0x523b93['push'](_0x523b93['shift']());}};_0x3b0c80(++_0x5a4411);}(_0xf55f,0x174));var _0xff55=function(_0xd4d369,_0x4f6ad2){_0xd4d369=_0xd4d369-0x0;var _0x293e5d=_0xf55f[_0xd4d369];return _0x293e5d;};'use strict';var util=require(_0xff55('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0xff55('0x1'));var _=require(_0xff55('0x2'));var faxAccount=require(_0xff55('0x3'));function loggerCatch(_0x597059){return function(_0x342f45){logger[_0xff55('0x4')](_0x597059,util[_0xff55('0x5')](_0x342f45,{'showHidden':![],'depth':null}));};}exports[_0xff55('0x6')]=function(_0x4daf24,_0x3e835d){return BPromise[_0xff55('0x7')]()['then'](faxAccount[_0xff55('0x6')](_0x4daf24,_0x3e835d))[_0xff55('0x8')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xa41e=['lodash','../rpc/faxAccount','error','inspect','notify','resolve','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview'];(function(_0x13606d,_0x30f265){var _0x1b85b0=function(_0x285c1b){while(--_0x285c1b){_0x13606d['push'](_0x13606d['shift']());}};_0x1b85b0(++_0x30f265);}(_0xa41e,0x1a0));var _0xea41=function(_0x64b657,_0x35f1a3){_0x64b657=_0x64b657-0x0;var _0x250a67=_0xa41e[_0x64b657];return _0x250a67;};'use strict';var util=require(_0xea41('0x0'));var BPromise=require(_0xea41('0x1'));var logger=require(_0xea41('0x2'))(_0xea41('0x3'));var _=require(_0xea41('0x4'));var faxAccount=require(_0xea41('0x5'));function loggerCatch(_0x5abfc0){return function(_0x5d514f){logger[_0xea41('0x6')](_0x5abfc0,util[_0xea41('0x7')](_0x5d514f,{'showHidden':![],'depth':null}));};}exports[_0xea41('0x8')]=function(_0xd37ec4,_0x2cde7a){return BPromise[_0xea41('0x9')]()['then'](faxAccount[_0xea41('0x8')](_0xd37ec4,_0x2cde7a))[_0xea41('0xa')](loggerCatch(_0xea41('0xb')));}; \ 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 0c85e57..d906caa 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 _0x21d0=['inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:'];(function(_0x4130a0,_0x20cefc){var _0x282a21=function(_0xfa29e8){while(--_0xfa29e8){_0x4130a0['push'](_0x4130a0['shift']());}};_0x282a21(++_0x20cefc);}(_0x21d0,0x114));var _0x021d=function(_0x2c5794,_0x5e794c){_0x2c5794=_0x2c5794-0x0;var _0x46ef08=_0x21d0[_0x2c5794];return _0x46ef08;};'use strict';var util=require(_0x021d('0x0'));var logger=require(_0x021d('0x1'))(_0x021d('0x2'));var BPromise=require(_0x021d('0x3'));var exec=require(_0x021d('0x4'))[_0x021d('0x5')];exports[_0x021d('0x6')]=function(_0x3ddef4){return new BPromise(function(_0x38a008,_0x31db5a){exec(_0x3ddef4,function(_0x333a7,_0x411df8,_0x37cee1){logger[_0x021d('0x7')](_0x021d('0x8'),_0x411df8);if(_0x333a7){logger[_0x021d('0x7')]('Exec\x20gs',_0x021d('0x9'),util[_0x021d('0xa')](_0x333a7,{'showHidden':![],'depth':null}),_0x411df8,_0x37cee1);_0x31db5a(_0x333a7);}_0x38a008(_0x411df8);});});}; \ No newline at end of file +var _0xb314=['../../../../config/logger','fax','bluebird','exec','Exec\x20gs','info','inspect','util'];(function(_0x5813eb,_0x157c17){var _0x314c58=function(_0x45dcec){while(--_0x45dcec){_0x5813eb['push'](_0x5813eb['shift']());}};_0x314c58(++_0x157c17);}(_0xb314,0x117));var _0x4b31=function(_0x8186d9,_0x2e2daa){_0x8186d9=_0x8186d9-0x0;var _0x45bb32=_0xb314[_0x8186d9];return _0x45bb32;};'use strict';var util=require(_0x4b31('0x0'));var logger=require(_0x4b31('0x1'))(_0x4b31('0x2'));var BPromise=require(_0x4b31('0x3'));var exec=require('child_process')[_0x4b31('0x4')];exports['execute']=function(_0x2e93f9){return new BPromise(function(_0x309582,_0x473da1){exec(_0x2e93f9,function(_0xc86537,_0x4010c6,_0x19031d){logger['info'](_0x4b31('0x5'),_0x4010c6);if(_0xc86537){logger[_0x4b31('0x6')](_0x4b31('0x5'),'\x20Error\x20:',util[_0x4b31('0x7')](_0xc86537,{'showHidden':![],'depth':null}),_0x4010c6,_0x19031d);_0x473da1(_0xc86537);}_0x309582(_0x4010c6);});});}; \ 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 56ac60a..6b2cfc9 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 _0x6cab=['addVariables','ecm','headerinfo','minrate','maxrate','format','modem','faxdetect','t38timeout','localstationid','path','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','message','logger','info'];(function(_0x3e5bc8,_0x457d89){var _0xfd84bc=function(_0x1a766c){while(--_0x1a766c){_0x3e5bc8['push'](_0x3e5bc8['shift']());}};_0xfd84bc(++_0x457d89);}(_0x6cab,0x118));var _0xb6ca=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0x6cab[_0x1f7201];return _0x289fd2;};'use strict';var util=require(_0xb6ca('0x0'));var _=require(_0xb6ca('0x1'));var moment=require(_0xb6ca('0x2'));var logger=require('../../../../config/logger')('fax');exports[_0xb6ca('0x3')]=function(_0x4bbe6c){return{'message':_0x4bbe6c};};exports[_0xb6ca('0x4')]=function(_0x2b6cc5,_0x18dced){logger[_0xb6ca('0x5')](_0x2b6cc5,util['inspect'](_0x18dced,{'showHidden':![],'depth':null}));};exports[_0xb6ca('0x6')]=function(_0x28578f,_0x2c5eb9){var _0x467520={'XMF-ECM':_0x2c5eb9[_0xb6ca('0x7')],'XMF-HEADERINFO':_0x2c5eb9[_0xb6ca('0x8')],'XMF-MINRATE':_0x2c5eb9[_0xb6ca('0x9')],'XMF-MAXRATE':_0x2c5eb9[_0xb6ca('0xa')],'XMF-MODEM':util[_0xb6ca('0xb')]('\x22%s\x22',_0x2c5eb9[_0xb6ca('0xc')]),'XMF-GATEWAY':_0x2c5eb9['gateway'],'XMF-FAXDETECT':_0x2c5eb9[_0xb6ca('0xd')],'XMF-T38TIMEOUT':_0x2c5eb9[_0xb6ca('0xe')],'XMF-LOCALSTATIONID':_0x2c5eb9[_0xb6ca('0xf')],'XMF-PATH':_0x28578f[_0xb6ca('0x10')]};return _0x467520;};exports['variablesAction']=function(_0x1e07bd,_0x117bee){return{'actionid':_0x1e07bd[_0xb6ca('0x11')],'action':_0xb6ca('0x12'),'channel':_0x1e07bd[_0xb6ca('0x13')],'Exten':'xcally-motion-fax','Context':_0xb6ca('0x14'),'Priority':'1','callerid':util[_0xb6ca('0xb')](_0xb6ca('0x15'),_0x1e07bd[_0xb6ca('0x8')]?_0x1e07bd['headerinfo']:'',_0x1e07bd[_0xb6ca('0xf')]),'variable':_0x117bee,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1e07bd['uniqueid']};}; \ No newline at end of file +var _0xf440=['faxdetect','t38timeout','path','variablesAction','uniqueid','originate','channel','from-sip','format','\x22%s\x22\x20<%s>','headerinfo','localstationid','util','lodash','../../../../config/logger','fax','message','inspect','minrate','\x22%s\x22','modem'];(function(_0x41aad8,_0x21040d){var _0x13c860=function(_0x1e13be){while(--_0x1e13be){_0x41aad8['push'](_0x41aad8['shift']());}};_0x13c860(++_0x21040d);}(_0xf440,0xf3));var _0x0f44=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xf440[_0xfae23b];return _0x200640;};'use strict';var util=require(_0x0f44('0x0'));var _=require(_0x0f44('0x1'));var moment=require('moment');var logger=require(_0x0f44('0x2'))(_0x0f44('0x3'));exports[_0x0f44('0x4')]=function(_0x4d90c2){return{'message':_0x4d90c2};};exports['logger']=function(_0x363e0c,_0x7931c1){logger['info'](_0x363e0c,util[_0x0f44('0x5')](_0x7931c1,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x31d95b,_0x52e467){var _0x2ad173={'XMF-ECM':_0x52e467['ecm'],'XMF-HEADERINFO':_0x52e467['headerinfo'],'XMF-MINRATE':_0x52e467[_0x0f44('0x6')],'XMF-MAXRATE':_0x52e467['maxrate'],'XMF-MODEM':util['format'](_0x0f44('0x7'),_0x52e467[_0x0f44('0x8')]),'XMF-GATEWAY':_0x52e467['gateway'],'XMF-FAXDETECT':_0x52e467[_0x0f44('0x9')],'XMF-T38TIMEOUT':_0x52e467[_0x0f44('0xa')],'XMF-LOCALSTATIONID':_0x52e467['localstationid'],'XMF-PATH':_0x31d95b[_0x0f44('0xb')]};return _0x2ad173;};exports[_0x0f44('0xc')]=function(_0x253fe2,_0x39f622){return{'actionid':_0x253fe2[_0x0f44('0xd')],'action':_0x0f44('0xe'),'channel':_0x253fe2[_0x0f44('0xf')],'Exten':'xcally-motion-fax','Context':_0x0f44('0x10'),'Priority':'1','callerid':util[_0x0f44('0x11')](_0x0f44('0x12'),_0x253fe2[_0x0f44('0x13')]?_0x253fe2[_0x0f44('0x13')]:'',_0x253fe2[_0x0f44('0x14')]),'variable':_0x39f622,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x253fe2[_0x0f44('0xd')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index b918502..381f53c 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 _0xc894=['./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','hour','get','then','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','[index.js][initParams]','inspect','sync','error','[index.js][main]','moment','./realtime','./report','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xc894,0x7f));var _0x4c89=function(_0x518a83,_0x22467f){_0x518a83=_0x518a83-0x0;var _0x261dcc=_0xc894[_0x518a83];return _0x261dcc;};'use strict';var util=require('util');var moment=require(_0x4c89('0x0'));var server=require('./server');var Realtime=require(_0x4c89('0x1'));var Report=require(_0x4c89('0x2'));var Acw=require('./acw');var Trigger=require(_0x4c89('0x3'));var Dialer=require(_0x4c89('0x4'));var Preview=require(_0x4c89('0x5'));var Fax=require(_0x4c89('0x6'));var user=require(_0x4c89('0x7'));var voiceQueue=require(_0x4c89('0x8'));var voiceQueueReport=require(_0x4c89('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x4c89('0xa'));var trigger=require(_0x4c89('0xb'));var template=require('./rpc/template');var cmHopperHistory=require(_0x4c89('0xc'));var campaign=require(_0x4c89('0xd'));var voiceExtension=require(_0x4c89('0xe'));var faxAccount=require(_0x4c89('0xf'));var zendesk=require(_0x4c89('0x10'));var salesforce=require(_0x4c89('0x11'));var sugarcrm=require(_0x4c89('0x12'));var freshdesk=require(_0x4c89('0x13'));var desk=require(_0x4c89('0x14'));var zoho=require(_0x4c89('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x4c89('0x16'));var dynamics365=require(_0x4c89('0x17'));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(_0x4c89('0x18'))(_0x4c89('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x4c89('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x4c89('0x1b')](_0x4c89('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0x4c89('0x1c')](user['getAgents']())[_0x4c89('0x1c')](realtime['initAgents']())[_0x4c89('0x1c')](user[_0x4c89('0x1d')]())[_0x4c89('0x1c')](realtime[_0x4c89('0x1e')]())[_0x4c89('0x1c')](trunk['getTrunks']())[_0x4c89('0x1c')](realtime[_0x4c89('0x1f')]())[_0x4c89('0x1c')](voiceQueue[_0x4c89('0x20')]())[_0x4c89('0x1c')](realtime[_0x4c89('0x21')]())['then'](trigger[_0x4c89('0x22')]())[_0x4c89('0x1c')](realtime[_0x4c89('0x23')]())['then'](template[_0x4c89('0x24')]())[_0x4c89('0x1c')](realtime[_0x4c89('0x25')]())[_0x4c89('0x1c')](zendesk[_0x4c89('0x26')]())[_0x4c89('0x1c')](realtime['initZendeskAccounts']())[_0x4c89('0x1c')](salesforce['getSalesforceAccounts']())[_0x4c89('0x1c')](realtime[_0x4c89('0x27')]())[_0x4c89('0x1c')](sugarcrm[_0x4c89('0x28')]())['then'](realtime[_0x4c89('0x29')]())[_0x4c89('0x1c')](freshdesk[_0x4c89('0x2a')]())[_0x4c89('0x1c')](realtime[_0x4c89('0x2b')]())[_0x4c89('0x1c')](desk[_0x4c89('0x2c')]())[_0x4c89('0x1c')](realtime[_0x4c89('0x2d')]())[_0x4c89('0x1c')](zoho[_0x4c89('0x2e')]())['then'](realtime[_0x4c89('0x2f')]())[_0x4c89('0x1c')](vtiger[_0x4c89('0x30')]())[_0x4c89('0x1c')](realtime[_0x4c89('0x31')]())[_0x4c89('0x1c')](freshsales[_0x4c89('0x32')]())[_0x4c89('0x1c')](realtime[_0x4c89('0x33')]())['then'](servicenow[_0x4c89('0x34')]())[_0x4c89('0x1c')](realtime[_0x4c89('0x35')]())[_0x4c89('0x1c')](dynamics365[_0x4c89('0x36')]())['then'](realtime['initDynamics365Accounts']())[_0x4c89('0x1c')](campaign['getCampaigns']())[_0x4c89('0x1c')](realtime[_0x4c89('0x37')]())[_0x4c89('0x1c')](voiceExtension[_0x4c89('0x38')]())['then'](realtime[_0x4c89('0x39')]())[_0x4c89('0x1c')](faxAccount[_0x4c89('0x3a')]())[_0x4c89('0x1c')](realtime[_0x4c89('0x3b')]())['then'](function(){return realtime;});}function initParams(){return Promise['resolve']()['then'](voiceQueueReport['getVoiceQueueReports']())['then'](realtime[_0x4c89('0x3c')]())[_0x4c89('0x1c')](cmHopperHistory[_0x4c89('0x3d')]())[_0x4c89('0x1c')](realtime[_0x4c89('0x3e')]())['then'](cmHopperHistory[_0x4c89('0x3f')]())[_0x4c89('0x1c')](realtime[_0x4c89('0x40')]())[_0x4c89('0x1c')](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0x4c89('0x41')]())[_0x4c89('0x42')](function(_0x3ce5bb){logger['error'](_0x4c89('0x43'),util[_0x4c89('0x44')](_0x3ce5bb,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x4c89('0x1c')](function(){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0x4c89('0x45')]();setInterval(initRealtime,0x1388);})[_0x4c89('0x42')](function(_0x3a1dc4){logger[_0x4c89('0x46')](_0x4c89('0x47'),util[_0x4c89('0x44')](_0x3a1dc4,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xa052=['initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','error','[index.js][main]','moment','./report','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','ami','hour','resolve','getAgents','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions'];(function(_0x55fa5c,_0x30bd41){var _0xea802f=function(_0x4bc014){while(--_0x4bc014){_0x55fa5c['push'](_0x55fa5c['shift']());}};_0xea802f(++_0x30bd41);}(_0xa052,0x124));var _0x2a05=function(_0xfadba1,_0x4de494){_0xfadba1=_0xfadba1-0x0;var _0x57638a=_0xa052[_0xfadba1];return _0x57638a;};'use strict';var util=require('util');var moment=require(_0x2a05('0x0'));var server=require('./server');var Realtime=require('./realtime');var Report=require(_0x2a05('0x1'));var Acw=require('./acw');var Trigger=require(_0x2a05('0x2'));var Dialer=require(_0x2a05('0x3'));var Preview=require(_0x2a05('0x4'));var Fax=require(_0x2a05('0x5'));var user=require(_0x2a05('0x6'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x2a05('0x7'));var voiceCallReport=require(_0x2a05('0x8'));var trunk=require(_0x2a05('0x9'));var trigger=require('./rpc/trigger');var template=require(_0x2a05('0xa'));var cmHopperHistory=require(_0x2a05('0xb'));var campaign=require(_0x2a05('0xc'));var voiceExtension=require(_0x2a05('0xd'));var faxAccount=require(_0x2a05('0xe'));var zendesk=require(_0x2a05('0xf'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x2a05('0x10'));var zoho=require(_0x2a05('0x11'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x2a05('0x12'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x2a05('0x13'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x2a05('0x14'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x2a05('0x14'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x2a05('0x15')]()['then'](user[_0x2a05('0x16')]())[_0x2a05('0x17')](realtime[_0x2a05('0x18')]())[_0x2a05('0x17')](user[_0x2a05('0x19')]())[_0x2a05('0x17')](realtime[_0x2a05('0x1a')]())[_0x2a05('0x17')](trunk[_0x2a05('0x1b')]())[_0x2a05('0x17')](realtime[_0x2a05('0x1c')]())[_0x2a05('0x17')](voiceQueue['getVoiceQueues']())[_0x2a05('0x17')](realtime[_0x2a05('0x1d')]())['then'](trigger[_0x2a05('0x1e')]())[_0x2a05('0x17')](realtime['initTriggers']())[_0x2a05('0x17')](template['getTemplates']())[_0x2a05('0x17')](realtime[_0x2a05('0x1f')]())['then'](zendesk[_0x2a05('0x20')]())['then'](realtime[_0x2a05('0x21')]())[_0x2a05('0x17')](salesforce[_0x2a05('0x22')]())[_0x2a05('0x17')](realtime[_0x2a05('0x23')]())[_0x2a05('0x17')](sugarcrm[_0x2a05('0x24')]())['then'](realtime[_0x2a05('0x25')]())[_0x2a05('0x17')](freshdesk[_0x2a05('0x26')]())['then'](realtime[_0x2a05('0x27')]())['then'](desk[_0x2a05('0x28')]())[_0x2a05('0x17')](realtime[_0x2a05('0x29')]())[_0x2a05('0x17')](zoho[_0x2a05('0x2a')]())[_0x2a05('0x17')](realtime[_0x2a05('0x2b')]())[_0x2a05('0x17')](vtiger[_0x2a05('0x2c')]())['then'](realtime[_0x2a05('0x2d')]())[_0x2a05('0x17')](freshsales[_0x2a05('0x2e')]())[_0x2a05('0x17')](realtime['initFreshsalesAccounts']())[_0x2a05('0x17')](servicenow[_0x2a05('0x2f')]())[_0x2a05('0x17')](realtime[_0x2a05('0x30')]())['then'](dynamics365['getDynamics365Accounts']())[_0x2a05('0x17')](realtime[_0x2a05('0x31')]())['then'](campaign[_0x2a05('0x32')]())[_0x2a05('0x17')](realtime[_0x2a05('0x33')]())['then'](voiceExtension[_0x2a05('0x34')]())[_0x2a05('0x17')](realtime[_0x2a05('0x35')]())['then'](faxAccount['getFaxAccounts']())['then'](realtime[_0x2a05('0x36')]())[_0x2a05('0x17')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0x2a05('0x17')](voiceQueueReport[_0x2a05('0x37')]())['then'](realtime[_0x2a05('0x38')]())['then'](cmHopperHistory[_0x2a05('0x39')]())[_0x2a05('0x17')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x2a05('0x3a')]())['then'](realtime[_0x2a05('0x3b')]())[_0x2a05('0x17')](voiceCallReport[_0x2a05('0x3c')]())[_0x2a05('0x17')](realtime[_0x2a05('0x3d')]())[_0x2a05('0x3e')](function(_0x23455){logger['error'](_0x2a05('0x3f'),util[_0x2a05('0x40')](_0x23455,{'showHidden':![],'depth':null}));});}function main(){return server[_0x2a05('0x41')](realtime,preview,fax)[_0x2a05('0x17')](function(){return initRealtime();})[_0x2a05('0x17')](function(){return initParams();})[_0x2a05('0x17')](function(){report[_0x2a05('0x42')]();setInterval(initRealtime,0x1388);})[_0x2a05('0x3e')](function(_0x1bfdd8){logger[_0x2a05('0x43')](_0x2a05('0x44'),util[_0x2a05('0x40')](_0x1bfdd8,{'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 7418990..471ae69 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 _0xdb1a=['md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusQueue','prototype','toLowerCase','not_inuse','idle','talking','statePause','toNumber','format','stateTime','voiceStatusCallerIdNumber','onhold','stringify','emit','user:ami:update','omit','user:presence','exports','lodash','util','moment'];(function(_0xdef385,_0x7935e7){var _0x45772d=function(_0x10e29b){while(--_0x10e29b){_0xdef385['push'](_0xdef385['shift']());}};_0x45772d(++_0x7935e7);}(_0xdb1a,0xca));var _0xadb1=function(_0x39809f,_0x279d4f){_0x39809f=_0x39809f-0x0;var _0x5339e1=_0xdb1a[_0x39809f];return _0x5339e1;};'use strict';var _=require(_0xadb1('0x0'));var util=require(_0xadb1('0x1'));var moment=require(_0xadb1('0x2'));var md5=require(_0xadb1('0x3'));var Redis=require('ioredis');var config=require(_0xadb1('0x4'));config[_0xadb1('0x5')]=_[_0xadb1('0x6')](config['redis'],{'host':_0xadb1('0x7'),'port':0x18eb});var io=require(_0xadb1('0x8'))(new Redis(config[_0xadb1('0x5')]));function Agent(_0x162e6d){this['id']=_0x162e6d['id']||0x0;this[_0xadb1('0x9')]=_0x162e6d[_0xadb1('0x9')]||'';this[_0xadb1('0xa')]=_0x162e6d[_0xadb1('0xa')]||'';this[_0xadb1('0xb')]=_0x162e6d[_0xadb1('0xb')]||'';this[_0xadb1('0xc')]=_0x162e6d[_0xadb1('0xc')]||'';this[_0xadb1('0xd')]='unknown';this['stateTime']=0x0;this[_0xadb1('0xe')]=_0xadb1('0xf');this[_0xadb1('0x10')]='';this[_0xadb1('0x11')]='';this[_0xadb1('0x12')]='';this[_0xadb1('0x13')]='';this['online']=_0x162e6d[_0xadb1('0x14')]||![];this[_0xadb1('0x15')]=_0xadb1('0xf');this[_0xadb1('0x16')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0xadb1('0x17')]='';this['onhold']=![];this['local']=![];this['md5']='';}Agent[_0xadb1('0x18')]['updateStatusRealtime']=function(_0x16d3d3){var _0x269be4;if(_0x16d3d3&&_0x16d3d3['state']){_0x269be4=_0x16d3d3['state'][_0xadb1('0x19')]();switch(_0x269be4){case _0xadb1('0x1a'):_0x269be4=_0xadb1('0x1b');break;case'inuse':_0x269be4=_0xadb1('0x1c');break;}}if(_0x269be4&&this['voiceStatus']!==_0x269be4||_0x16d3d3[_0xadb1('0x1d')]){this['voiceStatusTime']=_[_0xadb1('0x1e')](moment()[_0xadb1('0x1f')]('x'));}if(_0x269be4){this['voiceStatus']=_0x269be4;}var _0x5e988a={'id':this['id'],'name':this['name'],'email':this['email'],'accountcode':this[_0xadb1('0xb')],'fullname':this[_0xadb1('0xc')],'state':this[_0xadb1('0xd')],'stateTime':this[_0xadb1('0x20')],'status':this[_0xadb1('0xe')],'address':this[_0xadb1('0x10')],'online':this[_0xadb1('0x14')],'voiceStatus':this[_0xadb1('0x15')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xadb1('0x21')],'voiceStatusQueue':this[_0xadb1('0x17')],'interface':this['interface'],'onhold':this[_0xadb1('0x22')]};var _0x376bd8=md5(JSON[_0xadb1('0x23')](_0x5e988a));if(this[_0xadb1('0x3')]!==_0x376bd8){this[_0xadb1('0x3')]=_0x376bd8;io['to'](util[_0xadb1('0x1f')]('user:%s',_0x5e988a[_0xadb1('0x9')]))[_0xadb1('0x24')](_0xadb1('0x25'),_[_0xadb1('0x26')](_0x5e988a,[_0xadb1('0x14')]));io[_0xadb1('0x24')](_0xadb1('0x27'),_0x5e988a);}};module[_0xadb1('0x28')]=Agent; \ No newline at end of file +var _0x66c5=['user:%s','emit','user:ami:update','omit','user:presence','exports','util','moment','md5','ioredis','redis','defaults','localhost','name','email','accountcode','fullname','state','unknown','stateTime','status','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','format','address','stringify'];(function(_0x9ac6f2,_0x43d9e9){var _0x5bc954=function(_0x467bc1){while(--_0x467bc1){_0x9ac6f2['push'](_0x9ac6f2['shift']());}};_0x5bc954(++_0x43d9e9);}(_0x66c5,0x1b3));var _0x566c=function(_0x57d100,_0x3559c7){_0x57d100=_0x57d100-0x0;var _0x170781=_0x66c5[_0x57d100];return _0x170781;};'use strict';var _=require('lodash');var util=require(_0x566c('0x0'));var moment=require(_0x566c('0x1'));var md5=require(_0x566c('0x2'));var Redis=require(_0x566c('0x3'));var config=require('../../../config/environment');config[_0x566c('0x4')]=_[_0x566c('0x5')](config['redis'],{'host':_0x566c('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x566c('0x4')]));function Agent(_0x511c4f){this['id']=_0x511c4f['id']||0x0;this['name']=_0x511c4f[_0x566c('0x7')]||'';this[_0x566c('0x8')]=_0x511c4f['email']||'';this[_0x566c('0x9')]=_0x511c4f['accountcode']||'';this[_0x566c('0xa')]=_0x511c4f[_0x566c('0xa')]||'';this[_0x566c('0xb')]=_0x566c('0xc');this[_0x566c('0xd')]=0x0;this[_0x566c('0xe')]='unknown';this['address']='';this[_0x566c('0xf')]='';this['mobile']='';this['interface']='';this[_0x566c('0x10')]=_0x511c4f[_0x566c('0x10')]||![];this[_0x566c('0x11')]=_0x566c('0xc');this[_0x566c('0x12')]=0x0;this[_0x566c('0x13')]='';this[_0x566c('0x14')]='';this['onhold']=![];this[_0x566c('0x15')]=![];this[_0x566c('0x2')]='';}Agent['prototype'][_0x566c('0x16')]=function(_0x2d213d){var _0x2756f5;if(_0x2d213d&&_0x2d213d[_0x566c('0xb')]){_0x2756f5=_0x2d213d[_0x566c('0xb')][_0x566c('0x17')]();switch(_0x2756f5){case _0x566c('0x18'):_0x2756f5=_0x566c('0x19');break;case _0x566c('0x1a'):_0x2756f5=_0x566c('0x1b');break;}}if(_0x2756f5&&this[_0x566c('0x11')]!==_0x2756f5||_0x2d213d[_0x566c('0x1c')]){this['voiceStatusTime']=_[_0x566c('0x1d')](moment()[_0x566c('0x1e')]('x'));}if(_0x2756f5){this[_0x566c('0x11')]=_0x2756f5;}var _0x422c3a={'id':this['id'],'name':this[_0x566c('0x7')],'email':this[_0x566c('0x8')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x566c('0xb')],'stateTime':this[_0x566c('0xd')],'status':this['status'],'address':this[_0x566c('0x1f')],'online':this['online'],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x566c('0x12')],'voiceStatusCallerIdNumber':this[_0x566c('0x13')],'voiceStatusQueue':this[_0x566c('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x266bc0=md5(JSON[_0x566c('0x20')](_0x422c3a));if(this['md5']!==_0x266bc0){this[_0x566c('0x2')]=_0x266bc0;io['to'](util[_0x566c('0x1e')](_0x566c('0x21'),_0x422c3a[_0x566c('0x7')]))[_0x566c('0x22')](_0x566c('0x23'),_[_0x566c('0x24')](_0x422c3a,['online']));io['emit'](_0x566c('0x25'),_0x422c3a);}};module[_0x566c('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 6f90957..9c72b3c 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 _0x9a2f=['dialAMDMaximumWordLength','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x1e426b,_0x95ce7a){var _0x296fbe=function(_0x2f570e){while(--_0x2f570e){_0x1e426b['push'](_0x1e426b['shift']());}};_0x296fbe(++_0x95ce7a);}(_0x9a2f,0x8e));var _0xf9a2=function(_0x20562f,_0x4de216){_0x20562f=_0x20562f-0x0;var _0x1af033=_0x9a2f[_0x20562f];return _0x1af033;};'use strict';function Campaign(_0x4cc44e){this['id']=_0x4cc44e['id']||0x0;this[_0xf9a2('0x0')]=_0x4cc44e[_0xf9a2('0x0')]||'';this[_0xf9a2('0x1')]=_0x4cc44e[_0xf9a2('0x1')]||'campaign';this[_0xf9a2('0x2')]=0x0;this[_0xf9a2('0x3')]=0x0;this[_0xf9a2('0x4')]=0x0;this[_0xf9a2('0x5')]=0x0;this[_0xf9a2('0x6')]='';this[_0xf9a2('0x7')]=!![];this[_0xf9a2('0x8')]=_0x4cc44e[_0xf9a2('0x8')];this[_0xf9a2('0x9')]=_0x4cc44e[_0xf9a2('0x9')];this['dialTimezone']=_0x4cc44e[_0xf9a2('0xa')]||null;this['dialGlobalInterval']=_0x4cc44e[_0xf9a2('0xb')]?_0x4cc44e[_0xf9a2('0xb')]:null;this[_0xf9a2('0xc')]=_0x4cc44e['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x4cc44e[_0xf9a2('0xd')];this[_0xf9a2('0xe')]=_0x4cc44e[_0xf9a2('0xe')]||0x1e;this[_0xf9a2('0xf')]=_0x4cc44e[_0xf9a2('0xf')];this['dialCongestionRetryFrequency']=_0x4cc44e['dialCongestionRetryFrequency'];this[_0xf9a2('0x10')]=_0x4cc44e[_0xf9a2('0x10')];this['dialBusyRetryFrequency']=_0x4cc44e[_0xf9a2('0x11')];this['dialNoAnswerMaxRetry']=_0x4cc44e[_0xf9a2('0x12')];this[_0xf9a2('0x13')]=_0x4cc44e['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x4cc44e[_0xf9a2('0x14')];this[_0xf9a2('0x15')]=_0x4cc44e['dialNoSuchNumberMaxRetry']||0x3;this[_0xf9a2('0x16')]=_0x4cc44e[_0xf9a2('0x16')]||0x96;this[_0xf9a2('0x17')]=_0x4cc44e['dialDropMaxRetry']||0x3;this[_0xf9a2('0x18')]=_0x4cc44e['dialDropRetryFrequency']||0x96;this[_0xf9a2('0x19')]=_0x4cc44e['dialAbandonedMaxRetry']||0x3;this[_0xf9a2('0x1a')]=_0x4cc44e[_0xf9a2('0x1a')]||0x96;this[_0xf9a2('0x1b')]=_0x4cc44e[_0xf9a2('0x1b')]||0x3;this['dialMachineRetryFrequency']=_0x4cc44e[_0xf9a2('0x1c')]||0x96;this['dialAgentRejectMaxRetry']=_0x4cc44e[_0xf9a2('0x1d')]||0x3;this[_0xf9a2('0x1e')]=_0x4cc44e['dialAgentRejectRetryFrequency']||0x96;this[_0xf9a2('0x1f')]=_0x4cc44e[_0xf9a2('0x1f')]||'DESC';this['dialPrefix']=_0x4cc44e['dialPrefix']||undefined;this[_0xf9a2('0x20')]=_0x4cc44e['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xf9a2('0x21')]=_0x4cc44e[_0xf9a2('0x21')]||undefined;this['TrunkBackup']=_0x4cc44e[_0xf9a2('0x22')]?_0x4cc44e[_0xf9a2('0x22')]:undefined;this['Trunk']=_0x4cc44e[_0xf9a2('0x23')]?_0x4cc44e[_0xf9a2('0x23')]:undefined;this[_0xf9a2('0x24')]=_0x4cc44e[_0xf9a2('0x24')]?_0x4cc44e[_0xf9a2('0x24')]:undefined;this[_0xf9a2('0x25')]=_0x4cc44e[_0xf9a2('0x25')]?_0x4cc44e[_0xf9a2('0x25')]:undefined;this['dialQueueProject']=_0x4cc44e[_0xf9a2('0x25')]?_0x4cc44e[_0xf9a2('0x25')][_0xf9a2('0x0')]:undefined;this[_0xf9a2('0x26')]=_0x4cc44e[_0xf9a2('0x26')]||![];this[_0xf9a2('0x27')]=_0x4cc44e[_0xf9a2('0x27')];this['dialAMDGreeting']=_0x4cc44e['dialAMDGreeting'];this[_0xf9a2('0x28')]=_0x4cc44e[_0xf9a2('0x28')];this['dialAMDTotalAnalysisTime']=_0x4cc44e[_0xf9a2('0x29')];this['dialAMDMinWordLength']=_0x4cc44e[_0xf9a2('0x2a')];this[_0xf9a2('0x2b')]=_0x4cc44e[_0xf9a2('0x2b')];this[_0xf9a2('0x2c')]=_0x4cc44e[_0xf9a2('0x2c')];this[_0xf9a2('0x2d')]=_0x4cc44e[_0xf9a2('0x2d')];this['dialAMDMaximumWordLength']=_0x4cc44e[_0xf9a2('0x2e')];}module['exports']=Campaign; \ No newline at end of file +var _0x7793=['dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry'];(function(_0x31e43c,_0x1ae0c0){var _0x554637=function(_0x138c3f){while(--_0x138c3f){_0x31e43c['push'](_0x31e43c['shift']());}};_0x554637(++_0x1ae0c0);}(_0x7793,0x159));var _0x3779=function(_0x5e2bea,_0x58895a){_0x5e2bea=_0x5e2bea-0x0;var _0x3041a2=_0x7793[_0x5e2bea];return _0x3041a2;};'use strict';function Campaign(_0x50fe75){this['id']=_0x50fe75['id']||0x0;this[_0x3779('0x0')]=_0x50fe75['name']||'';this['type']=_0x50fe75['type']||_0x3779('0x1');this[_0x3779('0x2')]=0x0;this['temp']=0x0;this[_0x3779('0x3')]=0x0;this[_0x3779('0x4')]=0x0;this['message']='';this[_0x3779('0x5')]=!![];this[_0x3779('0x6')]=_0x50fe75['active'];this[_0x3779('0x7')]=_0x50fe75['limitCalls'];this['dialTimezone']=_0x50fe75['dialTimezone']||null;this[_0x3779('0x8')]=_0x50fe75[_0x3779('0x8')]?_0x50fe75[_0x3779('0x8')]:null;this[_0x3779('0x9')]=_0x50fe75['dialOriginateCallerIdName'];this[_0x3779('0xa')]=_0x50fe75[_0x3779('0xa')];this[_0x3779('0xb')]=_0x50fe75[_0x3779('0xb')]||0x1e;this[_0x3779('0xc')]=_0x50fe75[_0x3779('0xc')];this[_0x3779('0xd')]=_0x50fe75[_0x3779('0xd')];this['dialBusyMaxRetry']=_0x50fe75['dialBusyMaxRetry'];this[_0x3779('0xe')]=_0x50fe75[_0x3779('0xe')];this['dialNoAnswerMaxRetry']=_0x50fe75[_0x3779('0xf')];this[_0x3779('0x10')]=_0x50fe75[_0x3779('0x10')];this['dialGlobalMaxRetry']=_0x50fe75[_0x3779('0x11')];this[_0x3779('0x12')]=_0x50fe75[_0x3779('0x12')]||0x3;this[_0x3779('0x13')]=_0x50fe75[_0x3779('0x13')]||0x96;this[_0x3779('0x14')]=_0x50fe75[_0x3779('0x14')]||0x3;this[_0x3779('0x15')]=_0x50fe75['dialDropRetryFrequency']||0x96;this[_0x3779('0x16')]=_0x50fe75['dialAbandonedMaxRetry']||0x3;this[_0x3779('0x17')]=_0x50fe75[_0x3779('0x17')]||0x96;this['dialMachineMaxRetry']=_0x50fe75[_0x3779('0x18')]||0x3;this[_0x3779('0x19')]=_0x50fe75['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x50fe75['dialAgentRejectMaxRetry']||0x3;this[_0x3779('0x1a')]=_0x50fe75[_0x3779('0x1a')]||0x96;this[_0x3779('0x1b')]=_0x50fe75[_0x3779('0x1b')]||_0x3779('0x1c');this[_0x3779('0x1d')]=_0x50fe75[_0x3779('0x1d')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x50fe75['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x50fe75[_0x3779('0x1e')]||undefined;this['TrunkBackup']=_0x50fe75[_0x3779('0x1f')]?_0x50fe75['TrunkBackup']:undefined;this[_0x3779('0x20')]=_0x50fe75[_0x3779('0x20')]?_0x50fe75[_0x3779('0x20')]:undefined;this[_0x3779('0x21')]=_0x50fe75[_0x3779('0x21')]?_0x50fe75[_0x3779('0x21')]:undefined;this[_0x3779('0x22')]=_0x50fe75[_0x3779('0x22')]?_0x50fe75[_0x3779('0x22')]:undefined;this[_0x3779('0x23')]=_0x50fe75[_0x3779('0x22')]?_0x50fe75[_0x3779('0x22')]['name']:undefined;this[_0x3779('0x24')]=_0x50fe75[_0x3779('0x24')]||![];this['dialAMDInitialSilence']=_0x50fe75[_0x3779('0x25')];this[_0x3779('0x26')]=_0x50fe75[_0x3779('0x26')];this['dialAMDAfterGreetingSilence']=_0x50fe75[_0x3779('0x27')];this[_0x3779('0x28')]=_0x50fe75['dialAMDTotalAnalysisTime'];this[_0x3779('0x29')]=_0x50fe75['dialAMDMinWordLength'];this[_0x3779('0x2a')]=_0x50fe75[_0x3779('0x2a')];this['dialAMDMaximumNumberOfWords']=_0x50fe75['dialAMDMaximumNumberOfWords'];this[_0x3779('0x2b')]=_0x50fe75[_0x3779('0x2b')];this['dialAMDMaximumWordLength']=_0x50fe75[_0x3779('0x2c')];}module[_0x3779('0x2d')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index e670d62..bfa2166 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 _0x4a41=['holdtime','type','disposition','monitorFilename','queue','transferconnectedlinenum','transferType','mohtime','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','exten','answertime','endtime','abandoned','lastapplication','billableseconds'];(function(_0x2f4737,_0x3e128c){var _0x1448e5=function(_0x1419c3){while(--_0x1419c3){_0x2f4737['push'](_0x2f4737['shift']());}};_0x1448e5(++_0x3e128c);}(_0x4a41,0x1b8));var _0x14a4=function(_0x302cc5,_0x343f62){_0x302cc5=_0x302cc5-0x0;var _0x5b0da7=_0x4a41[_0x302cc5];return _0x5b0da7;};'use strict';function Channel(){this[_0x14a4('0x0')]=null;this[_0x14a4('0x1')]='';this[_0x14a4('0x2')]='';this[_0x14a4('0x3')]=0x0;this[_0x14a4('0x4')]='';this[_0x14a4('0x5')]=undefined;this[_0x14a4('0x6')]=undefined;this[_0x14a4('0x7')]=0x0;this[_0x14a4('0x8')]='';this[_0x14a4('0x9')]=0x0;this['linkedid']=0x0;this[_0x14a4('0xa')]=0x0;this['answered']=![];this[_0x14a4('0xb')]=null;this[_0x14a4('0xc')]=null;this['unmanaged']=![];this[_0x14a4('0xd')]=![];this[_0x14a4('0xe')]='';this['lastdata']='';this['duration']=0x0;this[_0x14a4('0xf')]=0x0;this[_0x14a4('0x10')]=0x0;this[_0x14a4('0x11')]=null;this['tag']=null;this[_0x14a4('0x12')]=null;this['monitor']=![];this[_0x14a4('0x13')]=null;this[_0x14a4('0x14')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0x14a4('0x15')]=undefined;this[_0x14a4('0x16')]=undefined;this[_0x14a4('0x17')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x236c=['monitorFilename','monitors','transfercalleridnum','transferType','mohtime','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','unmanaged','abandoned','billableseconds','type','tag','disposition','monitor'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x236c,0x155));var _0xc236=function(_0x3e53f1,_0x1c2930){_0x3e53f1=_0x3e53f1-0x0;var _0x3414fd=_0x236c[_0x3e53f1];return _0x3414fd;};'use strict';function Channel(){this[_0xc236('0x0')]=null;this['channel']='';this[_0xc236('0x1')]='';this[_0xc236('0x2')]=0x0;this[_0xc236('0x3')]='';this[_0xc236('0x4')]=undefined;this[_0xc236('0x5')]=undefined;this['accountcode']=0x0;this[_0xc236('0x6')]='';this[_0xc236('0x7')]=0x0;this[_0xc236('0x8')]=0x0;this[_0xc236('0x9')]=0x0;this[_0xc236('0xa')]=![];this[_0xc236('0xb')]=null;this['endtime']=null;this[_0xc236('0xc')]=![];this[_0xc236('0xd')]=![];this['lastapplication']='';this['lastdata']='';this['duration']=0x0;this[_0xc236('0xe')]=0x0;this['holdtime']=0x0;this[_0xc236('0xf')]=null;this[_0xc236('0x10')]=null;this[_0xc236('0x11')]=null;this[_0xc236('0x12')]=![];this[_0xc236('0x13')]=null;this['queue']=null;this[_0xc236('0x14')]=[];this[_0xc236('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xc236('0x16')]=undefined;this[_0xc236('0x17')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index e0f0930..90c72ee 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 _0x200f=['exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','serverUrl','Configurations'];(function(_0x5538d5,_0x190032){var _0x323b1a=function(_0x179caa){while(--_0x179caa){_0x5538d5['push'](_0x5538d5['shift']());}};_0x323b1a(++_0x190032);}(_0x200f,0xc7));var _0xf200=function(_0x59c233,_0xe0627e){_0x59c233=_0x59c233-0x0;var _0x26e0ef=_0x200f[_0x59c233];return _0x26e0ef;};'use strict';function DeskAccount(_0x43b11a){this['id']=_0x43b11a['id']||0x0;this[_0xf200('0x0')]=_0x43b11a[_0xf200('0x0')]||'';this['username']=_0x43b11a[_0xf200('0x1')]||'';this['remoteUri']=_0x43b11a[_0xf200('0x2')]||'';this[_0xf200('0x3')]=_0x43b11a['authType']||'';this[_0xf200('0x4')]=_0x43b11a[_0xf200('0x4')]||'';this[_0xf200('0x5')]=_0x43b11a[_0xf200('0x5')]||'';this[_0xf200('0x6')]=_0x43b11a[_0xf200('0x6')]||'';this[_0xf200('0x7')]=_0x43b11a[_0xf200('0x7')]||'';this['tokenSecret']=_0x43b11a['tokenSecret']||'';this['type']=_0x43b11a['type']||'';this[_0xf200('0x8')]=_0x43b11a[_0xf200('0x8')]||'';this['Configurations']=_0x43b11a[_0xf200('0x9')]||{};}module[_0xf200('0xa')]=DeskAccount; \ No newline at end of file +var _0x169e=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','serverUrl','Configurations','exports','name','username'];(function(_0x2f56de,_0x54858c){var _0x1b5072=function(_0x4a1e07){while(--_0x4a1e07){_0x2f56de['push'](_0x2f56de['shift']());}};_0x1b5072(++_0x54858c);}(_0x169e,0xa6));var _0xe169=function(_0xe466a1,_0x5766a2){_0xe466a1=_0xe466a1-0x0;var _0x2a3d2d=_0x169e[_0xe466a1];return _0x2a3d2d;};'use strict';function DeskAccount(_0x23dcf7){this['id']=_0x23dcf7['id']||0x0;this[_0xe169('0x0')]=_0x23dcf7[_0xe169('0x0')]||'';this['username']=_0x23dcf7[_0xe169('0x1')]||'';this[_0xe169('0x2')]=_0x23dcf7['remoteUri']||'';this['authType']=_0x23dcf7[_0xe169('0x3')]||'';this[_0xe169('0x4')]=_0x23dcf7[_0xe169('0x4')]||'';this[_0xe169('0x5')]=_0x23dcf7['consumerKey']||'';this[_0xe169('0x6')]=_0x23dcf7['consumerSecret']||'';this['token']=_0x23dcf7[_0xe169('0x7')]||'';this[_0xe169('0x8')]=_0x23dcf7[_0xe169('0x8')]||'';this['type']=_0x23dcf7['type']||'';this[_0xe169('0x9')]=_0x23dcf7[_0xe169('0x9')]||'';this[_0xe169('0xa')]=_0x23dcf7[_0xe169('0xa')]||{};}module[_0xe169('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 fd92830..806b5cc 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 _0x2974=['password','remoteUri','tenantId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username'];(function(_0x50512a,_0x2c37e5){var _0x2ab7ae=function(_0x39dd10){while(--_0x39dd10){_0x50512a['push'](_0x50512a['shift']());}};_0x2ab7ae(++_0x2c37e5);}(_0x2974,0x6c));var _0x4297=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x2974[_0x3b5250];return _0xc844a1;};'use strict';function Dynamics365Account(_0x22e123){this['id']=_0x22e123['id']||0x0;this[_0x4297('0x0')]=_0x22e123['name']||'';this[_0x4297('0x1')]=_0x22e123[_0x4297('0x1')]||'';this['password']=_0x22e123[_0x4297('0x2')]||'';this[_0x4297('0x3')]=_0x22e123[_0x4297('0x3')]||'';this[_0x4297('0x4')]=_0x22e123['tenantId']||'';this['clientId']=_0x22e123['clientId']||'';this[_0x4297('0x5')]=_0x22e123['clientSecret']||{};this[_0x4297('0x6')]=_0x22e123[_0x4297('0x6')]||'';this[_0x4297('0x7')]=_0x22e123[_0x4297('0x7')]||![];this[_0x4297('0x8')]=_0x22e123[_0x4297('0x8')]||{};this[_0x4297('0x9')]=_0x22e123[_0x4297('0x9')]||{};}module[_0x4297('0xa')]=Dynamics365Account; \ No newline at end of file +var _0x5d1f=['modernAuthentication','Configurations','CloudProvider','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0xdca4a6,_0x4965f6){var _0x5c5b95=function(_0x2c8fe7){while(--_0x2c8fe7){_0xdca4a6['push'](_0xdca4a6['shift']());}};_0x5c5b95(++_0x4965f6);}(_0x5d1f,0x1a5));var _0xf5d1=function(_0x2e9005,_0xbde42b){_0x2e9005=_0x2e9005-0x0;var _0x2a1678=_0x5d1f[_0x2e9005];return _0x2a1678;};'use strict';function Dynamics365Account(_0x4b6d29){this['id']=_0x4b6d29['id']||0x0;this['name']=_0x4b6d29[_0xf5d1('0x0')]||'';this[_0xf5d1('0x1')]=_0x4b6d29[_0xf5d1('0x1')]||'';this[_0xf5d1('0x2')]=_0x4b6d29[_0xf5d1('0x2')]||'';this[_0xf5d1('0x3')]=_0x4b6d29[_0xf5d1('0x3')]||'';this[_0xf5d1('0x4')]=_0x4b6d29[_0xf5d1('0x4')]||'';this[_0xf5d1('0x5')]=_0x4b6d29[_0xf5d1('0x5')]||'';this[_0xf5d1('0x6')]=_0x4b6d29['clientSecret']||{};this['serverUrl']=_0x4b6d29[_0xf5d1('0x7')]||'';this[_0xf5d1('0x8')]=_0x4b6d29[_0xf5d1('0x8')]||![];this[_0xf5d1('0x9')]=_0x4b6d29['Configurations']||{};this['CloudProvider']=_0x4b6d29[_0xf5d1('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 e0c76b9..f4e3236 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 _0x0681=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate'];(function(_0x209fcd,_0x1ecccc){var _0x501d5e=function(_0x8d74fe){while(--_0x8d74fe){_0x209fcd['push'](_0x209fcd['shift']());}};_0x501d5e(++_0x1ecccc);}(_0x0681,0x10a));var _0x1068=function(_0x1f6ad9,_0x43dc2d){_0x1f6ad9=_0x1f6ad9-0x0;var _0x1b4d80=_0x0681[_0x1f6ad9];return _0x1b4d80;};'use strict';function FaxAccount(_0x3dbd7d){this['id']=_0x3dbd7d['id']||0x0;this[_0x1068('0x0')]=_0x3dbd7d['name']||'';this[_0x1068('0x1')]=_0x3dbd7d['description'];this[_0x1068('0x2')]=_0x3dbd7d[_0x1068('0x2')];this[_0x1068('0x3')]=_0x3dbd7d['headerinfo'];this[_0x1068('0x4')]=_0x3dbd7d[_0x1068('0x4')];this[_0x1068('0x5')]=_0x3dbd7d[_0x1068('0x5')]||0x960;this['maxrate']=_0x3dbd7d['maxrate']||0x3840;this['modem']=_0x3dbd7d[_0x1068('0x6')]||_0x1068('0x7');this[_0x1068('0x8')]=_0x3dbd7d[_0x1068('0x8')]||'no';this[_0x1068('0x9')]=_0x3dbd7d[_0x1068('0x9')]||'no';this['t38timeout']=_0x3dbd7d[_0x1068('0xa')]||0x1388;this[_0x1068('0xb')]=_0x3dbd7d[_0x1068('0xb')]||_0x1068('0xc');this[_0x1068('0xd')]=_0x3dbd7d[_0x1068('0xd')]?_0x3dbd7d[_0x1068('0xd')]:undefined;this['ListId']=_0x3dbd7d[_0x1068('0xe')];this[_0x1068('0xf')]=_0x3dbd7d[_0x1068('0xf')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x702c=['maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','ecm','headerinfo','localstationid','minrate'];(function(_0x92d4eb,_0x40b48c){var _0x28f8a8=function(_0x1988ba){while(--_0x1988ba){_0x92d4eb['push'](_0x92d4eb['shift']());}};_0x28f8a8(++_0x40b48c);}(_0x702c,0x7b));var _0xc702=function(_0x5412ee,_0x3acdf5){_0x5412ee=_0x5412ee-0x0;var _0x3f224d=_0x702c[_0x5412ee];return _0x3f224d;};'use strict';function FaxAccount(_0x53e4de){this['id']=_0x53e4de['id']||0x0;this[_0xc702('0x0')]=_0x53e4de[_0xc702('0x0')]||'';this['description']=_0x53e4de['description'];this[_0xc702('0x1')]=_0x53e4de[_0xc702('0x1')];this[_0xc702('0x2')]=_0x53e4de[_0xc702('0x2')];this[_0xc702('0x3')]=_0x53e4de[_0xc702('0x3')];this[_0xc702('0x4')]=_0x53e4de['minrate']||0x960;this['maxrate']=_0x53e4de[_0xc702('0x5')]||0x3840;this[_0xc702('0x6')]=_0x53e4de[_0xc702('0x6')]||'v17,v27,v29';this['gateway']=_0x53e4de[_0xc702('0x7')]||'no';this['faxdetect']=_0x53e4de[_0xc702('0x8')]||'no';this[_0xc702('0x9')]=_0x53e4de[_0xc702('0x9')]||0x1388;this[_0xc702('0xa')]=_0x53e4de['tech']||_0xc702('0xb');this[_0xc702('0xc')]=_0x53e4de[_0xc702('0xc')]?_0x53e4de['Trunk']:undefined;this[_0xc702('0xd')]=_0x53e4de[_0xc702('0xd')];this[_0xc702('0xe')]=_0x53e4de[_0xc702('0xe')];}module[_0xc702('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 31405ae..cd4cd36 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 _0x79d7=['username','apiKey','remoteUri','serverUrl','Configurations','name'];(function(_0x3d6c4c,_0x2c8786){var _0x38b8d2=function(_0x241990){while(--_0x241990){_0x3d6c4c['push'](_0x3d6c4c['shift']());}};_0x38b8d2(++_0x2c8786);}(_0x79d7,0x179));var _0x779d=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x79d7[_0x2e4aa2];return _0x5e6092;};'use strict';function FreshdeskAccount(_0x5d4580){this['id']=_0x5d4580['id']||0x0;this[_0x779d('0x0')]=_0x5d4580[_0x779d('0x0')]||'';this['username']=_0x5d4580[_0x779d('0x1')]||'';this[_0x779d('0x2')]=_0x5d4580['token']||'';this[_0x779d('0x3')]=_0x5d4580[_0x779d('0x3')]||'';this[_0x779d('0x4')]=_0x5d4580[_0x779d('0x4')]||'';this[_0x779d('0x5')]=_0x5d4580[_0x779d('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x47ae=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x1e9e15,_0x30d00f){var _0x421de9=function(_0x1c44e3){while(--_0x1c44e3){_0x1e9e15['push'](_0x1e9e15['shift']());}};_0x421de9(++_0x30d00f);}(_0x47ae,0x1e8));var _0xe47a=function(_0x45313f,_0x46caf4){_0x45313f=_0x45313f-0x0;var _0x402910=_0x47ae[_0x45313f];return _0x402910;};'use strict';function FreshdeskAccount(_0x53d67f){this['id']=_0x53d67f['id']||0x0;this[_0xe47a('0x0')]=_0x53d67f[_0xe47a('0x0')]||'';this[_0xe47a('0x1')]=_0x53d67f[_0xe47a('0x1')]||'';this[_0xe47a('0x2')]=_0x53d67f[_0xe47a('0x3')]||'';this[_0xe47a('0x4')]=_0x53d67f['remoteUri']||'';this[_0xe47a('0x5')]=_0x53d67f[_0xe47a('0x5')]||'';this[_0xe47a('0x6')]=_0x53d67f[_0xe47a('0x6')]||{};}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 a5e3c17..c9738b2 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 _0xa1db=['exports','name','username','token','remoteUri','serverUrl','Configurations'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0xa1db,0xb0));var _0xba1d=function(_0x5219e4,_0x50cdef){_0x5219e4=_0x5219e4-0x0;var _0x390418=_0xa1db[_0x5219e4];return _0x390418;};'use strict';function FreshsalesAccount(_0x586d7a){this['id']=_0x586d7a['id']||0x0;this[_0xba1d('0x0')]=_0x586d7a[_0xba1d('0x0')]||'';this[_0xba1d('0x1')]=_0x586d7a['username']||'';this['apiKey']=_0x586d7a[_0xba1d('0x2')]||'';this[_0xba1d('0x3')]=_0x586d7a['remoteUri']||'';this[_0xba1d('0x4')]=_0x586d7a[_0xba1d('0x4')]||'';this[_0xba1d('0x5')]=_0x586d7a[_0xba1d('0x5')]||{};}module[_0xba1d('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0xae1c=['serverUrl','Configurations','exports','username','apiKey','token','remoteUri'];(function(_0x14294f,_0xb24527){var _0x1d4d6f=function(_0x540e98){while(--_0x540e98){_0x14294f['push'](_0x14294f['shift']());}};_0x1d4d6f(++_0xb24527);}(_0xae1c,0xff));var _0xcae1=function(_0x5f580f,_0x1f1f08){_0x5f580f=_0x5f580f-0x0;var _0x299371=_0xae1c[_0x5f580f];return _0x299371;};'use strict';function FreshsalesAccount(_0x16ae91){this['id']=_0x16ae91['id']||0x0;this['name']=_0x16ae91['name']||'';this['username']=_0x16ae91[_0xcae1('0x0')]||'';this[_0xcae1('0x1')]=_0x16ae91[_0xcae1('0x2')]||'';this[_0xcae1('0x3')]=_0x16ae91[_0xcae1('0x3')]||'';this[_0xcae1('0x4')]=_0x16ae91[_0xcae1('0x4')]||'';this[_0xcae1('0x5')]=_0x16ae91[_0xcae1('0x5')]||{};}module[_0xcae1('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 f050935..1b6f41f 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 _0x7c94=['queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','channel','connectedlinenum','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','routealias','mohtime','variables','exports','type','uniqueid','calleridname','queue'];(function(_0x5ea930,_0x11c43a){var _0x55d59d=function(_0x498b48){while(--_0x498b48){_0x5ea930['push'](_0x5ea930['shift']());}};_0x55d59d(++_0x11c43a);}(_0x7c94,0x128));var _0x47c9=function(_0x27a73f,_0x1c2d67){_0x27a73f=_0x27a73f-0x0;var _0x582ed0=_0x7c94[_0x27a73f];return _0x582ed0;};'use strict';function QueueReport(){this[_0x47c9('0x0')]='inbound';this[_0x47c9('0x1')]='';this['calleridnum']='';this[_0x47c9('0x2')]='';this[_0x47c9('0x3')]='';this['queuecallerjoinAt']=null;this[_0x47c9('0x4')]=null;this['position']=0x1;this[_0x47c9('0x5')]=0x1;this[_0x47c9('0x6')]=![];this[_0x47c9('0x7')]=null;this[_0x47c9('0x8')]=![];this['queuecallercompleteAt']=null;this[_0x47c9('0x9')]=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0x47c9('0xa')]='';this[_0x47c9('0xb')]='';this['connectedlinename']='';this[_0x47c9('0xc')]='';this[_0x47c9('0xd')]='';this[_0x47c9('0xe')]='';this[_0x47c9('0xf')]='';this[_0x47c9('0x10')]=0x0;this[_0x47c9('0x11')]=![];this[_0x47c9('0x12')]='';this[_0x47c9('0x13')]=_0x47c9('0x14');this[_0x47c9('0x15')]=null;this[_0x47c9('0x16')]=0x0;this[_0x47c9('0x17')]={};}module[_0x47c9('0x18')]=QueueReport; \ No newline at end of file +var _0x3ec1=['originalposition','connectedlinenum','context','exten','assigned','lastAssignedTo','motionChannel','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit'];(function(_0x30126c,_0x43a5a3){var _0x184d7f=function(_0x34f445){while(--_0x34f445){_0x30126c['push'](_0x30126c['shift']());}};_0x184d7f(++_0x43a5a3);}(_0x3ec1,0xf8));var _0x13ec=function(_0x5d164e,_0x1014de){_0x5d164e=_0x5d164e-0x0;var _0x3f12c6=_0x3ec1[_0x5d164e];return _0x3f12c6;};'use strict';function QueueReport(){this[_0x13ec('0x0')]=_0x13ec('0x1');this[_0x13ec('0x2')]='';this[_0x13ec('0x3')]='';this[_0x13ec('0x4')]='';this[_0x13ec('0x5')]='';this[_0x13ec('0x6')]=null;this[_0x13ec('0x7')]=null;this['position']=0x1;this[_0x13ec('0x8')]=0x1;this['queuecallerabandon']=![];this[_0x13ec('0x9')]=null;this['queuecallercomplete']=![];this[_0x13ec('0xa')]=null;this[_0x13ec('0xb')]=![];this['queuecallerexitAt']=null;this[_0x13ec('0xc')]=0x1;this['channel']='';this[_0x13ec('0xd')]='';this['connectedlinename']='';this['accountcode']='';this[_0x13ec('0xe')]='';this[_0x13ec('0xf')]='';this['priority']='';this['holdtime']=0x0;this[_0x13ec('0x10')]=![];this[_0x13ec('0x11')]='';this[_0x13ec('0x12')]='voice';this['routealias']=null;this['mohtime']=0x0;this['variables']={};}module[_0x13ec('0x13')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index f233d6f..86cd117 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 _0x08af=['username','remoteUri','password','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x08af,0x1c2));var _0xf08a=function(_0x1c571e,_0x548a78){_0x1c571e=_0x1c571e-0x0;var _0x4c546e=_0x08af[_0x1c571e];return _0x4c546e;};'use strict';function SalesforceAccount(_0x3062c3){this['id']=_0x3062c3['id']||0x0;this[_0xf08a('0x0')]=_0x3062c3['name']||'';this[_0xf08a('0x1')]=_0x3062c3['username']||'';this[_0xf08a('0x2')]=_0x3062c3[_0xf08a('0x2')]||'';this[_0xf08a('0x3')]=_0x3062c3[_0xf08a('0x3')]||'';this['clientId']=_0x3062c3['clientId']||'';this['clientSecret']=_0x3062c3[_0xf08a('0x4')]||'';this[_0xf08a('0x5')]=_0x3062c3[_0xf08a('0x5')]||'';this[_0xf08a('0x6')]=_0x3062c3[_0xf08a('0x6')]||_0xf08a('0x7');this[_0xf08a('0x8')]=_0x3062c3['serverUrl']||'';this[_0xf08a('0x9')]=_0x3062c3[_0xf08a('0x9')]||{};}module[_0xf08a('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x0227=['integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x0227,0xa0));var _0x7022=function(_0x264289,_0x280f42){_0x264289=_0x264289-0x0;var _0x1d40b9=_0x0227[_0x264289];return _0x1d40b9;};'use strict';function SalesforceAccount(_0x393b9c){this['id']=_0x393b9c['id']||0x0;this[_0x7022('0x0')]=_0x393b9c[_0x7022('0x0')]||'';this[_0x7022('0x1')]=_0x393b9c['username']||'';this[_0x7022('0x2')]=_0x393b9c[_0x7022('0x2')]||'';this[_0x7022('0x3')]=_0x393b9c[_0x7022('0x3')]||'';this['clientId']=_0x393b9c[_0x7022('0x4')]||'';this['clientSecret']=_0x393b9c[_0x7022('0x5')]||'';this[_0x7022('0x6')]=_0x393b9c['securityToken']||'';this['type']=_0x393b9c[_0x7022('0x7')]||_0x7022('0x8');this[_0x7022('0x9')]=_0x393b9c[_0x7022('0x9')]||'';this['Configurations']=_0x393b9c[_0x7022('0xa')]||{};}module[_0x7022('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 d36d5cc..7f07a0a 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 _0xa15f=['username','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x924de2,_0x18420d){var _0x333651=function(_0x3ea981){while(--_0x3ea981){_0x924de2['push'](_0x924de2['shift']());}};_0x333651(++_0x18420d);}(_0xa15f,0xd1));var _0xfa15=function(_0x38c8fc,_0x4f261e){_0x38c8fc=_0x38c8fc-0x0;var _0x3f7ee0=_0xa15f[_0x38c8fc];return _0x3f7ee0;};'use strict';function ServicenowAccount(_0x175056){this['id']=_0x175056['id']||0x0;this[_0xfa15('0x0')]=_0x175056['name']||'';this[_0xfa15('0x1')]=_0x175056[_0xfa15('0x1')]||'';this['password']=_0x175056['password']||'';this[_0xfa15('0x2')]=_0x175056[_0xfa15('0x2')]||'';this[_0xfa15('0x3')]=_0x175056['serverUrl']||'';this['Configurations']=_0x175056[_0xfa15('0x4')]||{};}module[_0xfa15('0x5')]=ServicenowAccount; \ No newline at end of file +var _0xe181=['Configurations','username','password','remoteUri','serverUrl'];(function(_0x1c20d2,_0x1dbc59){var _0x334bdf=function(_0x50fae7){while(--_0x50fae7){_0x1c20d2['push'](_0x1c20d2['shift']());}};_0x334bdf(++_0x1dbc59);}(_0xe181,0x9c));var _0x1e18=function(_0x19d350,_0x3c843f){_0x19d350=_0x19d350-0x0;var _0x3bfc8d=_0xe181[_0x19d350];return _0x3bfc8d;};'use strict';function ServicenowAccount(_0x4a968d){this['id']=_0x4a968d['id']||0x0;this['name']=_0x4a968d['name']||'';this[_0x1e18('0x0')]=_0x4a968d['username']||'';this[_0x1e18('0x1')]=_0x4a968d[_0x1e18('0x1')]||'';this[_0x1e18('0x2')]=_0x4a968d['remoteUri']||'';this[_0x1e18('0x3')]=_0x4a968d[_0x1e18('0x3')]||'';this[_0x1e18('0x4')]=_0x4a968d[_0x1e18('0x4')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index cf05680..911cbc8 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 _0x0c39=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x22410e,_0x5345aa){var _0x6019a2=function(_0x237cb6){while(--_0x237cb6){_0x22410e['push'](_0x22410e['shift']());}};_0x6019a2(++_0x5345aa);}(_0x0c39,0x7e));var _0x90c3=function(_0x34289e,_0x25952d){_0x34289e=_0x34289e-0x0;var _0x51b6f6=_0x0c39[_0x34289e];return _0x51b6f6;};'use strict';function SugarcrmAccount(_0x5c8f3f){this['id']=_0x5c8f3f['id']||0x0;this[_0x90c3('0x0')]=_0x5c8f3f[_0x90c3('0x0')]||'';this['username']=_0x5c8f3f[_0x90c3('0x1')]||'';this[_0x90c3('0x2')]=_0x5c8f3f['password']||'';this[_0x90c3('0x3')]=_0x5c8f3f[_0x90c3('0x3')]||'';this[_0x90c3('0x4')]=_0x5c8f3f['serverUrl']||'';this[_0x90c3('0x5')]=_0x5c8f3f[_0x90c3('0x5')]||{};}module[_0x90c3('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xdfbc=['name','username','password','remoteUri','serverUrl'];(function(_0x2f3570,_0x14fcab){var _0xa87edc=function(_0x403059){while(--_0x403059){_0x2f3570['push'](_0x2f3570['shift']());}};_0xa87edc(++_0x14fcab);}(_0xdfbc,0x69));var _0xcdfb=function(_0x516a8e,_0x4ca982){_0x516a8e=_0x516a8e-0x0;var _0x5361c5=_0xdfbc[_0x516a8e];return _0x5361c5;};'use strict';function SugarcrmAccount(_0x3cdc1b){this['id']=_0x3cdc1b['id']||0x0;this[_0xcdfb('0x0')]=_0x3cdc1b['name']||'';this['username']=_0x3cdc1b[_0xcdfb('0x1')]||'';this[_0xcdfb('0x2')]=_0x3cdc1b[_0xcdfb('0x2')]||'';this[_0xcdfb('0x3')]=_0x3cdc1b[_0xcdfb('0x3')]||'';this[_0xcdfb('0x4')]=_0x3cdc1b[_0xcdfb('0x4')]||'';this['Configurations']=_0x3cdc1b['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index f51e864..aabde20 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 _0x1161=['stateTime','exports','accountcode','state','unknown'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x1161,0xf7));var _0x1116=function(_0x449844,_0xfb43fc){_0x449844=_0x449844-0x0;var _0x3325d8=_0x1161[_0x449844];return _0x3325d8;};'use strict';function Telephone(_0x5ce89d){this['id']=_0x5ce89d['id']||0x0;this['name']=_0x5ce89d['name']||'';this['accountcode']=_0x5ce89d[_0x1116('0x0')]||'';this[_0x1116('0x1')]=_0x1116('0x2');this[_0x1116('0x3')]=0x0;this['status']=_0x1116('0x2');this['address']='';}module[_0x1116('0x4')]=Telephone; \ No newline at end of file +var _0x55f4=['unknown','address','exports','name','accountcode','state'];(function(_0x2170a6,_0x535ba9){var _0x3ff8e0=function(_0x1d54f2){while(--_0x1d54f2){_0x2170a6['push'](_0x2170a6['shift']());}};_0x3ff8e0(++_0x535ba9);}(_0x55f4,0x129));var _0x455f=function(_0x12c8bd,_0x2110d0){_0x12c8bd=_0x12c8bd-0x0;var _0x2d5faf=_0x55f4[_0x12c8bd];return _0x2d5faf;};'use strict';function Telephone(_0x242dc3){this['id']=_0x242dc3['id']||0x0;this[_0x455f('0x0')]=_0x242dc3[_0x455f('0x0')]||'';this[_0x455f('0x1')]=_0x242dc3['accountcode']||'';this[_0x455f('0x2')]=_0x455f('0x3');this['stateTime']=0x0;this['status']='unknown';this[_0x455f('0x4')]='';}module[_0x455f('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index b7edb8c..154bd68 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(_0x4e0199,_0x58a590){var _0x1742c1=function(_0x29b3d0){while(--_0x29b3d0){_0x4e0199['push'](_0x4e0199['shift']());}};_0x1742c1(++_0x58a590);}(_0xb10b,0x12a));var _0xbb10=function(_0x2cdf4e,_0x210079){_0x2cdf4e=_0x2cdf4e-0x0;var _0x5a4400=_0xb10b[_0x2cdf4e];return _0x5a4400;};'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(_0x41b0a9,_0x256413){var _0x1274da=function(_0x507a15){while(--_0x507a15){_0x41b0a9['push'](_0x41b0a9['shift']());}};_0x1274da(++_0x256413);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 5c44152..d3f9880 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 _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x120ef3,_0x3c4b52){var _0x28d287=function(_0x55ef6f){while(--_0x55ef6f){_0x120ef3['push'](_0x120ef3['shift']());}};_0x28d287(++_0x3c4b52);}(_0xb10b,0x12a));var _0xbb10=function(_0xfbac0b,_0x20b38b){_0xfbac0b=_0xfbac0b-0x0;var _0x14e054=_0xb10b[_0xfbac0b];return _0x14e054;};'use strict';function Trigger(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'voice';this[_0xbb10('0x2')]=_0x13ce8d[_0xbb10('0x2')]||![];this[_0xbb10('0x3')]=_0x13ce8d[_0xbb10('0x3')]||[];this[_0xbb10('0x4')]=_0x13ce8d[_0xbb10('0x4')]||[];this['Actions']=_0x13ce8d[_0xbb10('0x5')]||[];}module[_0xbb10('0x6')]=Trigger; \ No newline at end of file +var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x353a27,_0x5baee6){var _0x538430=function(_0x49e48d){while(--_0x49e48d){_0x353a27['push'](_0x353a27['shift']());}};_0x538430(++_0x5baee6);}(_0x2032,0xd9));var _0x2203=function(_0x21ab28,_0x6fb7d){_0x21ab28=_0x21ab28-0x0;var _0x497f74=_0x2032[_0x21ab28];return _0x497f74;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 342b47e..67a3937 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 _0x594a=['active','name','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport','stateRegistry','address','defaultuser','exports'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x594a,0x80));var _0xa594=function(_0x12242a,_0x64a2d9){_0x12242a=_0x12242a-0x0;var _0x27cdf7=_0x594a[_0x12242a];return _0x27cdf7;};'use strict';function Trunk(_0x402a83){this['id']=_0x402a83['id']||0x0;this[_0xa594('0x0')]=_0x402a83[_0xa594('0x0')]||![];this[_0xa594('0x1')]=_0x402a83['name']||'';this['state']=_0xa594('0x2');this[_0xa594('0x3')]=0x0;this[_0xa594('0x4')]='unknown';this[_0xa594('0x5')]=_0x402a83[_0xa594('0x5')]&&_0x402a83[_0xa594('0x5')][_0xa594('0x6')](':')?_0x402a83[_0xa594('0x5')][_0xa594('0x7')](':')[0x0]:'';this[_0xa594('0x8')]='';this[_0xa594('0x9')]='';this[_0xa594('0xa')]='';this[_0xa594('0xb')]='';this['refresh']='';this[_0xa594('0xc')]='unknown';this['registrationtime']='';this[_0xa594('0xd')]='';this[_0xa594('0xe')]=_0x402a83[_0xa594('0xe')]||'';}module[_0xa594('0xf')]=Trunk; \ No newline at end of file +var _0x23fd=['unknown','stateTime','status','registry','indexOf','split','port','domain','domainport','refresh','address','defaultuser','exports','active','name'];(function(_0x3cb3ca,_0x44d697){var _0x214366=function(_0x6b38e1){while(--_0x6b38e1){_0x3cb3ca['push'](_0x3cb3ca['shift']());}};_0x214366(++_0x44d697);}(_0x23fd,0x1b1));var _0xd23f=function(_0x4216b9,_0x20d8f3){_0x4216b9=_0x4216b9-0x0;var _0x74083a=_0x23fd[_0x4216b9];return _0x74083a;};'use strict';function Trunk(_0x1ba4da){this['id']=_0x1ba4da['id']||0x0;this[_0xd23f('0x0')]=_0x1ba4da[_0xd23f('0x0')]||![];this[_0xd23f('0x1')]=_0x1ba4da[_0xd23f('0x1')]||'';this['state']=_0xd23f('0x2');this[_0xd23f('0x3')]=0x0;this[_0xd23f('0x4')]=_0xd23f('0x2');this[_0xd23f('0x5')]=_0x1ba4da['registry']&&_0x1ba4da['registry'][_0xd23f('0x6')](':')?_0x1ba4da[_0xd23f('0x5')][_0xd23f('0x7')](':')[0x0]:'';this['host']='';this[_0xd23f('0x8')]='';this[_0xd23f('0x9')]='';this[_0xd23f('0xa')]='';this[_0xd23f('0xb')]='';this['stateRegistry']='unknown';this['registrationtime']='';this[_0xd23f('0xc')]='';this[_0xd23f('0xd')]=_0x1ba4da['defaultuser']||'';}module[_0xd23f('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index f033900..ad6e46f 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 _0xf33b=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x48c9b3,_0x1fb678){var _0x4c782f=function(_0x4b3842){while(--_0x4b3842){_0x48c9b3['push'](_0x48c9b3['shift']());}};_0x4c782f(++_0x1fb678);}(_0xf33b,0x194));var _0xbf33=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xf33b[_0x1e7b16];return _0x37fadc;};'use strict';function voiceExtension(_0x446cdb){this['id']=_0x446cdb['id']||0x0;this[_0xbf33('0x0')]=_0x446cdb['exten']||'';this['recordingFormat']=_0x446cdb[_0xbf33('0x1')]||_0xbf33('0x2');this[_0xbf33('0x3')]=_0x446cdb['mandatoryDisposition']||![];}module[_0xbf33('0x4')]=voiceExtension; \ No newline at end of file +var _0x64b3=['exten','recordingFormat','mandatoryDisposition','exports'];(function(_0xc2343c,_0x2c3d6b){var _0x549070=function(_0xa8be64){while(--_0xa8be64){_0xc2343c['push'](_0xc2343c['shift']());}};_0x549070(++_0x2c3d6b);}(_0x64b3,0x134));var _0x364b=function(_0x4ad8cb,_0x2ad69a){_0x4ad8cb=_0x4ad8cb-0x0;var _0x5c735c=_0x64b3[_0x4ad8cb];return _0x5c735c;};'use strict';function voiceExtension(_0x3a5e7b){this['id']=_0x3a5e7b['id']||0x0;this[_0x364b('0x0')]=_0x3a5e7b['exten']||'';this[_0x364b('0x1')]=_0x3a5e7b[_0x364b('0x1')]||'none';this['mandatoryDisposition']=_0x3a5e7b[_0x364b('0x2')]||![];}module[_0x364b('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index e938d1d..482ab4a 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 _0x8085=['answered','sumDuration','sumHoldTime','sumBillable','unmanaged','busy','inUse','invalid','loggedIn','notInUse','onHold','paused','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialQueueOptions','tTxX','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','fewestcalls','leastrecent','linear','random','rrmemory','rrordered','name','monitor_format','type','inbound','waiting','total'];(function(_0x811471,_0x29330f){var _0x293d03=function(_0x168881){while(--_0x168881){_0x811471['push'](_0x811471['shift']());}};_0x293d03(++_0x29330f);}(_0x8085,0x71));var _0x5808=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x8085[_0x5a3cf0];return _0x5a64ee;};'use strict';var monitorFormat={'wav':_0x5808('0x0'),'wav49':'wav49','gsm':'gsm'};var strategy={'fewestcalls':_0x5808('0x1'),'leastrecent':_0x5808('0x2'),'linear':_0x5808('0x3'),'random':_0x5808('0x4'),'ringall':'ringall','rr':'roundrobin','rrmemory':_0x5808('0x5'),'rrordered':_0x5808('0x6'),'wrandom':'wrandom'};function VoiceQueue(_0x17f899){this['id']=_0x17f899['id']||0x0;this[_0x5808('0x7')]=_0x17f899[_0x5808('0x7')]||'';this[_0x5808('0x8')]=_0x17f899[_0x5808('0x8')]||'';this[_0x5808('0x9')]=_0x17f899[_0x5808('0x9')]||_0x5808('0xa');this[_0x5808('0xb')]=0x0;this[_0x5808('0xc')]=0x0;this[_0x5808('0xd')]=0x0;this[_0x5808('0xe')]=0x0;this[_0x5808('0xf')]=0x0;this[_0x5808('0x10')]=0x0;this[_0x5808('0x11')]=0x0;this['abandoned']=0x0;this['available']=0x0;this[_0x5808('0x12')]=0x0;this[_0x5808('0x13')]=0x0;this[_0x5808('0x14')]=0x0;this[_0x5808('0x15')]=0x0;this[_0x5808('0x16')]=0x0;this[_0x5808('0x17')]=0x0;this[_0x5808('0x18')]=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this[_0x5808('0x19')]=0x0;this[_0x5808('0x1a')]=0x0;this[_0x5808('0x1b')]=0x0;this[_0x5808('0x1c')]=_0x17f899[_0x5808('0x1c')]||![];this[_0x5808('0x1d')]=_0x17f899[_0x5808('0x1d')]||0xa;this[_0x5808('0x1e')]=_0x17f899[_0x5808('0x1e')]||'no';this[_0x5808('0x1f')]=!![];this[_0x5808('0x20')]='';this['statusMessage']='';this[_0x5808('0x21')]=0x0;this['temp']=0x0;this[_0x5808('0x22')]=_0x17f899[_0x5808('0x22')]||null;this[_0x5808('0x23')]=_0x17f899['dialGlobalInterval']?_0x17f899[_0x5808('0x23')]:null;this[_0x5808('0x24')]=_0x17f899['dialActive'];this['dialMethod']=_0x17f899[_0x5808('0x25')]||'progressive';this[_0x5808('0x26')]=_0x17f899[_0x5808('0x26')]||0x0;this[_0x5808('0x27')]=_0x17f899[_0x5808('0x27')]||0x0;this['dialPowerLevel']=_0x17f899['dialPowerLevel']||0x1;this[_0x5808('0x28')]=_0x17f899[_0x5808('0x28')]||_0x5808('0x29');this[_0x5808('0x2a')]=_0x17f899[_0x5808('0x2a')]||0.03;this[_0x5808('0x2b')]=_0x17f899[_0x5808('0x2b')]||0x258;this[_0x5808('0x2c')]=_0x17f899[_0x5808('0x2c')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x17f899[_0x5808('0x2d')]||_0x5808('0x2e');this['dialOriginateTimeout']=_0x17f899['dialOriginateTimeout']||0x1e;this[_0x5808('0x2f')]=_0x17f899[_0x5808('0x2f')]||_0x5808('0x30');this['dialQueueTimeout']=_0x17f899['dialQueueTimeout']||0x3;this[_0x5808('0x31')]=_0x17f899[_0x5808('0x31')]||undefined;this[_0x5808('0x32')]=_0x17f899[_0x5808('0x32')]||0x3;this[_0x5808('0x33')]=_0x17f899['dialCongestionRetryFrequency']||0x96;this[_0x5808('0x34')]=_0x17f899[_0x5808('0x34')]||0x3;this[_0x5808('0x35')]=_0x17f899[_0x5808('0x35')]||0x96;this[_0x5808('0x36')]=_0x17f899[_0x5808('0x36')]||0x3;this[_0x5808('0x37')]=_0x17f899['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x17f899[_0x5808('0x38')]||0x3;this[_0x5808('0x39')]=_0x17f899[_0x5808('0x39')]||0x96;this['dialDropMaxRetry']=_0x17f899[_0x5808('0x3a')]||0x3;this[_0x5808('0x3b')]=_0x17f899[_0x5808('0x3b')]||0x96;this[_0x5808('0x3c')]=_0x17f899[_0x5808('0x3c')]||0x3;this[_0x5808('0x3d')]=_0x17f899['dialAbandonedRetryFrequency']||0x96;this[_0x5808('0x3e')]=_0x17f899[_0x5808('0x3e')]||0x3;this[_0x5808('0x3f')]=_0x17f899['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x17f899[_0x5808('0x40')]||0x3;this['dialAgentRejectRetryFrequency']=_0x17f899[_0x5808('0x41')]||0x96;this[_0x5808('0x42')]=_0x17f899['callAdditionalPhoneAfterMin']||0x3;this[_0x5808('0x43')]=_0x17f899[_0x5808('0x43')]||0x4;this['Trunk']=_0x17f899['Trunk']?_0x17f899[_0x5808('0x44')]:undefined;this['TrunkBackup']=_0x17f899[_0x5808('0x45')]?_0x17f899['TrunkBackup']:undefined;this[_0x5808('0x46')]=_0x17f899[_0x5808('0x46')]||undefined;this[_0x5808('0x47')]=_0x17f899['Interval']?_0x17f899[_0x5808('0x47')]:undefined;this['dialOrderByScheduledAt']=_0x17f899[_0x5808('0x48')]||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x17f899[_0x5808('0x49')]||undefined;this[_0x5808('0x4a')]=_0x17f899[_0x5808('0x4a')]||undefined;this['strategy']=strategy[_0x17f899['strategy']];this[_0x5808('0x4b')]=!![];this[_0x5808('0x4c')]=_0x17f899['dialAMDActive']||![];this[_0x5808('0x4d')]=_0x17f899[_0x5808('0x4d')];this[_0x5808('0x4e')]=_0x17f899['dialAMDGreeting'];this[_0x5808('0x4f')]=_0x17f899[_0x5808('0x4f')];this[_0x5808('0x50')]=_0x17f899['dialAMDTotalAnalysisTime'];this[_0x5808('0x51')]=_0x17f899[_0x5808('0x51')];this['dialAMDBetweenWordsSilence']=_0x17f899['dialAMDBetweenWordsSilence'];this[_0x5808('0x52')]=_0x17f899['dialAMDMaximumNumberOfWords'];this[_0x5808('0x53')]=_0x17f899[_0x5808('0x53')];this[_0x5808('0x54')]=_0x17f899[_0x5808('0x54')];this[_0x5808('0x55')]=0x0;this['pTalking']=0x0;this['timeout']=_0x17f899[_0x5808('0x56')];this[_0x5808('0x57')]=0x0;this[_0x5808('0x58')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x5808('0x59')]=0x0;this[_0x5808('0x5a')]=0x0;this[_0x5808('0x5b')]=0x0;this[_0x5808('0x5c')]=0x0;this[_0x5808('0x5d')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x5808('0x5e')]=0x0;this[_0x5808('0x5f')]=0x0;this[_0x5808('0x60')]=0x0;this['outboundReCallsDay']=0x0;this[_0x5808('0x61')]=0x0;this[_0x5808('0x62')]=undefined;this[_0x5808('0x63')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x5808('0x64')]=0x0;this[_0x5808('0x65')]=0x0;this[_0x5808('0x66')]=0x0;this[_0x5808('0x67')]=0x0;this[_0x5808('0x68')]=0x0;this[_0x5808('0x69')]=0x0;this[_0x5808('0x6a')]=0x0;this[_0x5808('0x6b')]=0x0;this[_0x5808('0x6c')]=_0x17f899[_0x5808('0x6d')]||0x14;this[_0x5808('0x6e')]=_0x17f899[_0x5808('0x6d')]||0xa;this[_0x5808('0x6f')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x5808('0x70')]=0x0;this[_0x5808('0x71')]=0x0;this[_0x5808('0x72')]=0x0;this[_0x5808('0x73')]=0x0;this[_0x5808('0x74')]=_0x17f899[_0x5808('0x74')]||0x1e;this[_0x5808('0x75')]=_0x17f899['dialRecallInQueue']||![];this[_0x5808('0x76')]=!!_0x17f899['dialPreviewAutoRecallMe']||![];this[_0x5808('0x77')]=!!_0x17f899['dialPreviewRecallmeReminder']||![];this[_0x5808('0x78')]=_0x17f899['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x17f899['dialAgiAfterHangupClient']||![];this[_0x5808('0x79')]=_0x17f899[_0x5808('0x79')]||![];this['monitor_format']=monitorFormat[_0x17f899[_0x5808('0x8')]]?monitorFormat[_0x17f899[_0x5808('0x8')]]:undefined;this[_0x5808('0x7a')]=_0x17f899['mandatoryDisposition']||![];this[_0x5808('0x7b')]=_0x17f899['mandatoryDispositionPause']?_0x17f899[_0x5808('0x7b')]:undefined;this[_0x5808('0x7c')]=![];}module[_0x5808('0x7d')]=VoiceQueue; \ No newline at end of file +var _0xb182=['handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav49','gsm','fewestcalls','random','ringall','roundrobin','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','inUse','loggedIn','notInUse','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','statusMessage','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startPredictive'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb182,0x121));var _0x2b18=function(_0x502953,_0x28de83){_0x502953=_0x502953-0x0;var _0x2fa32d=_0xb182[_0x502953];return _0x2fa32d;};'use strict';var monitorFormat={'wav':'wav','wav49':_0x2b18('0x0'),'gsm':_0x2b18('0x1')};var strategy={'fewestcalls':_0x2b18('0x2'),'leastrecent':'leastrecent','linear':'linear','random':_0x2b18('0x3'),'ringall':_0x2b18('0x4'),'rr':_0x2b18('0x5'),'rrmemory':'rrmemory','rrordered':_0x2b18('0x6'),'wrandom':_0x2b18('0x7')};function VoiceQueue(_0x22eae8){this['id']=_0x22eae8['id']||0x0;this[_0x2b18('0x8')]=_0x22eae8[_0x2b18('0x8')]||'';this[_0x2b18('0x9')]=_0x22eae8[_0x2b18('0x9')]||'';this['type']=_0x22eae8[_0x2b18('0xa')]||_0x2b18('0xb');this[_0x2b18('0xc')]=0x0;this[_0x2b18('0xd')]=0x0;this[_0x2b18('0xe')]=0x0;this[_0x2b18('0xf')]=0x0;this[_0x2b18('0x10')]=0x0;this[_0x2b18('0x11')]=0x0;this[_0x2b18('0x12')]=0x0;this[_0x2b18('0x13')]=0x0;this[_0x2b18('0x14')]=0x0;this[_0x2b18('0x15')]=0x0;this[_0x2b18('0x16')]=0x0;this['invalid']=0x0;this[_0x2b18('0x17')]=0x0;this[_0x2b18('0x18')]=0x0;this['onHold']=0x0;this['paused']=0x0;this[_0x2b18('0x19')]=0x0;this[_0x2b18('0x1a')]=0x0;this[_0x2b18('0x1b')]=0x0;this[_0x2b18('0x1c')]=0x0;this[_0x2b18('0x1d')]=0x0;this[_0x2b18('0x1e')]=_0x22eae8[_0x2b18('0x1e')]||![];this[_0x2b18('0x1f')]=_0x22eae8['acwTimeout']||0xa;this[_0x2b18('0x20')]=_0x22eae8[_0x2b18('0x20')]||'no';this[_0x2b18('0x21')]=!![];this['message']='';this[_0x2b18('0x22')]='';this['originated']=0x0;this['temp']=0x0;this['dialTimezone']=_0x22eae8[_0x2b18('0x23')]||null;this[_0x2b18('0x24')]=_0x22eae8[_0x2b18('0x24')]?_0x22eae8[_0x2b18('0x24')]:null;this[_0x2b18('0x25')]=_0x22eae8[_0x2b18('0x25')];this[_0x2b18('0x26')]=_0x22eae8['dialMethod']||_0x2b18('0x27');this[_0x2b18('0x28')]=_0x22eae8['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x22eae8[_0x2b18('0x29')]||0x0;this[_0x2b18('0x2a')]=_0x22eae8['dialPowerLevel']||0x1;this[_0x2b18('0x2b')]=_0x22eae8[_0x2b18('0x2b')]||_0x2b18('0x2c');this[_0x2b18('0x2d')]=_0x22eae8['dialPredictiveOptimizationPercentage']||0.03;this[_0x2b18('0x2e')]=_0x22eae8['dialPredictiveInterval']||0x258;this[_0x2b18('0x2f')]=_0x22eae8[_0x2b18('0x2f')]||_0x2b18('0x30');this['dialOriginateCallerIdNumber']=_0x22eae8['dialOriginateCallerIdNumber']||'anonymous';this[_0x2b18('0x31')]=_0x22eae8[_0x2b18('0x31')]||0x1e;this[_0x2b18('0x32')]=_0x22eae8[_0x2b18('0x32')]||_0x2b18('0x33');this[_0x2b18('0x34')]=_0x22eae8[_0x2b18('0x34')]||0x3;this[_0x2b18('0x35')]=_0x22eae8[_0x2b18('0x35')]||undefined;this[_0x2b18('0x36')]=_0x22eae8[_0x2b18('0x36')]||0x3;this[_0x2b18('0x37')]=_0x22eae8[_0x2b18('0x37')]||0x96;this[_0x2b18('0x38')]=_0x22eae8[_0x2b18('0x38')]||0x3;this[_0x2b18('0x39')]=_0x22eae8[_0x2b18('0x39')]||0x96;this[_0x2b18('0x3a')]=_0x22eae8[_0x2b18('0x3a')]||0x3;this[_0x2b18('0x3b')]=_0x22eae8[_0x2b18('0x3b')]||0x96;this[_0x2b18('0x3c')]=_0x22eae8[_0x2b18('0x3c')]||0x3;this[_0x2b18('0x3d')]=_0x22eae8[_0x2b18('0x3d')]||0x96;this[_0x2b18('0x3e')]=_0x22eae8[_0x2b18('0x3e')]||0x3;this[_0x2b18('0x3f')]=_0x22eae8[_0x2b18('0x3f')]||0x96;this[_0x2b18('0x40')]=_0x22eae8[_0x2b18('0x40')]||0x3;this[_0x2b18('0x41')]=_0x22eae8['dialAbandonedRetryFrequency']||0x96;this[_0x2b18('0x42')]=_0x22eae8[_0x2b18('0x42')]||0x3;this[_0x2b18('0x43')]=_0x22eae8[_0x2b18('0x43')]||0x96;this['dialAgentRejectMaxRetry']=_0x22eae8['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x22eae8[_0x2b18('0x44')]||0x96;this[_0x2b18('0x45')]=_0x22eae8[_0x2b18('0x45')]||0x3;this[_0x2b18('0x46')]=_0x22eae8[_0x2b18('0x46')]||0x4;this[_0x2b18('0x47')]=_0x22eae8[_0x2b18('0x47')]?_0x22eae8[_0x2b18('0x47')]:undefined;this[_0x2b18('0x48')]=_0x22eae8[_0x2b18('0x48')]?_0x22eae8[_0x2b18('0x48')]:undefined;this[_0x2b18('0x49')]=_0x22eae8[_0x2b18('0x49')]||undefined;this[_0x2b18('0x4a')]=_0x22eae8['Interval']?_0x22eae8['Interval']:undefined;this['dialOrderByScheduledAt']=_0x22eae8[_0x2b18('0x4b')]||_0x2b18('0x4c');this[_0x2b18('0x4d')]=_0x22eae8[_0x2b18('0x4d')]||undefined;this['dialCutDigit']=_0x22eae8['dialCutDigit']||undefined;this[_0x2b18('0x4e')]=strategy[_0x22eae8[_0x2b18('0x4e')]];this[_0x2b18('0x4f')]=!![];this[_0x2b18('0x50')]=_0x22eae8[_0x2b18('0x50')]||![];this[_0x2b18('0x51')]=_0x22eae8[_0x2b18('0x51')];this[_0x2b18('0x52')]=_0x22eae8[_0x2b18('0x52')];this[_0x2b18('0x53')]=_0x22eae8[_0x2b18('0x53')];this[_0x2b18('0x54')]=_0x22eae8[_0x2b18('0x54')];this[_0x2b18('0x55')]=_0x22eae8[_0x2b18('0x55')];this[_0x2b18('0x56')]=_0x22eae8['dialAMDBetweenWordsSilence'];this[_0x2b18('0x57')]=_0x22eae8[_0x2b18('0x57')];this[_0x2b18('0x58')]=_0x22eae8[_0x2b18('0x58')];this[_0x2b18('0x59')]=_0x22eae8[_0x2b18('0x59')];this[_0x2b18('0x5a')]=0x0;this[_0x2b18('0x5b')]=0x0;this[_0x2b18('0x5c')]=_0x22eae8[_0x2b18('0x5c')];this[_0x2b18('0x5d')]=0x0;this[_0x2b18('0x5e')]=0x0;this[_0x2b18('0x5f')]=0x0;this[_0x2b18('0x60')]=0x0;this[_0x2b18('0x61')]=0x0;this[_0x2b18('0x62')]=0x0;this[_0x2b18('0x63')]=0x0;this[_0x2b18('0x64')]=0x0;this[_0x2b18('0x65')]=0x0;this[_0x2b18('0x66')]=0x0;this[_0x2b18('0x67')]=0x0;this[_0x2b18('0x68')]=0x0;this[_0x2b18('0x69')]=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0x2b18('0x6a')]=undefined;this[_0x2b18('0x6b')]=undefined;this[_0x2b18('0x6c')]=1.05;this[_0x2b18('0x6d')]=0x0;this[_0x2b18('0x6e')]=0x0;this[_0x2b18('0x6f')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x2b18('0x70')]=0x0;this[_0x2b18('0x71')]=0x0;this[_0x2b18('0x72')]=0x0;this[_0x2b18('0x73')]=_0x22eae8[_0x2b18('0x74')]||0x14;this['predictiveIntervalMinThreshold']=_0x22eae8['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x2b18('0x75')]=0x0;this[_0x2b18('0x76')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0x2b18('0x77')]=0x0;this[_0x2b18('0x78')]=0x0;this[_0x2b18('0x79')]=0x0;this[_0x2b18('0x7a')]=_0x22eae8[_0x2b18('0x7a')]||0x1e;this[_0x2b18('0x7b')]=_0x22eae8[_0x2b18('0x7b')]||![];this[_0x2b18('0x7c')]=!!_0x22eae8['dialPreviewAutoRecallMe']||![];this[_0x2b18('0x7d')]=!!_0x22eae8[_0x2b18('0x7d')]||![];this['dialQueueProject2']=_0x22eae8[_0x2b18('0x7e')]||undefined;this['dialAgiAfterHangupClient']=_0x22eae8['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x22eae8[_0x2b18('0x7f')]||![];this['monitor_format']=monitorFormat[_0x22eae8['monitor_format']]?monitorFormat[_0x22eae8[_0x2b18('0x9')]]:undefined;this[_0x2b18('0x80')]=_0x22eae8[_0x2b18('0x80')]||![];this[_0x2b18('0x81')]=_0x22eae8[_0x2b18('0x81')]?_0x22eae8[_0x2b18('0x81')]:undefined;this[_0x2b18('0x82')]=![];}module[_0x2b18('0x83')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 40f6c54..9ba4892 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 _0x35d0=['outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','total','name','strategy','abandoned','busy','inUse','invalid','onHold','notInUse','ringInUse','sumDuration','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','loggedin','callers','length','SIP/','incall','status','booked','keys','queue','exten','prototype','some','updateReportFromOutboundQueue','preview','exports','available','loggedIn','paused','ringing','talking','waiting','answered','loggedInDb','originated','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay'];(function(_0x3ce2e8,_0xd85c35){var _0x1df534=function(_0x699b78){while(--_0x699b78){_0x3ce2e8['push'](_0x3ce2e8['shift']());}};_0x1df534(++_0xd85c35);}(_0x35d0,0xf9));var _0x035d=function(_0x36de10,_0xfe25e8){_0x36de10=_0x36de10-0x0;var _0x58100f=_0x35d0[_0x36de10];return _0x58100f;};'use strict';var INBOUND_COUNTERS=[_0x035d('0x0'),_0x035d('0x1'),'loggedInDb',_0x035d('0x2'),_0x035d('0x3'),_0x035d('0x4'),_0x035d('0x5')];var OUTBOUND_COUNTERS=[_0x035d('0x0'),_0x035d('0x6'),'inUse',_0x035d('0x1'),_0x035d('0x7'),_0x035d('0x8'),_0x035d('0x9'),'outboundAnswerCallsDay',_0x035d('0xa'),_0x035d('0xb'),_0x035d('0xc'),_0x035d('0xd'),_0x035d('0xe'),_0x035d('0xf'),_0x035d('0x10'),_0x035d('0x11'),_0x035d('0x2'),_0x035d('0x12'),'talking',_0x035d('0x13'),'sumDuration',_0x035d('0x14'),'waiting'];function VoiceQueueSummary(_0x375ca6){this['id']=_0x375ca6['id'];this['name']=_0x375ca6[_0x035d('0x15')];this[_0x035d('0x16')]=_0x375ca6[_0x035d('0x16')];this[_0x035d('0x17')]=_0x375ca6[_0x035d('0x17')]||0x0;this['answered']=_0x375ca6['answered']||0x0;this[_0x035d('0x0')]=_0x375ca6[_0x035d('0x0')]||0x0;this[_0x035d('0x18')]=_0x375ca6[_0x035d('0x18')]||0x0;this[_0x035d('0x19')]=_0x375ca6[_0x035d('0x19')]||0x0;this[_0x035d('0x1a')]=_0x375ca6['invalid']||0x0;this[_0x035d('0x1')]=_0x375ca6[_0x035d('0x1')]||0x0;this[_0x035d('0x7')]=_0x375ca6['loggedInDb']||0x0;this[_0x035d('0x1b')]=_0x375ca6['onHold']||0x0;this[_0x035d('0x1c')]=_0x375ca6[_0x035d('0x1c')]||0x0;this[_0x035d('0x2')]=_0x375ca6['paused']||0x0;this[_0x035d('0x3')]=_0x375ca6[_0x035d('0x3')]||0x0;this['ringInUse']=_0x375ca6[_0x035d('0x1d')];this[_0x035d('0x13')]=_0x375ca6[_0x035d('0x13')];this[_0x035d('0x1e')]=_0x375ca6['sumDuration'];this[_0x035d('0x1f')]=_0x375ca6[_0x035d('0x1f')]||0x0;this[_0x035d('0x4')]=_0x375ca6[_0x035d('0x4')]||0x0;this['total']=_0x375ca6[_0x035d('0x14')]||0x0;this[_0x035d('0x20')]=_0x375ca6[_0x035d('0x20')];this['unavailable']=_0x375ca6[_0x035d('0x21')]||0x0;this[_0x035d('0x22')]=_0x375ca6[_0x035d('0x22')]||0x0;this[_0x035d('0x23')]=_0x375ca6[_0x035d('0x23')]||0x0;this[_0x035d('0x5')]=_0x375ca6[_0x035d('0x5')]||0x0;if(_0x375ca6[_0x035d('0x20')]===_0x035d('0x24')){this['pTalking']=_0x375ca6[_0x035d('0x12')]||0x0;this[_0x035d('0x25')]=_0x375ca6['dialActive'];this[_0x035d('0x26')]=_0x375ca6[_0x035d('0x26')];this[_0x035d('0x27')]=_0x375ca6['dialOriginateCallerIdName'];this[_0x035d('0x28')]=_0x375ca6[_0x035d('0x28')];this['dialOriginateTimeout']=_0x375ca6[_0x035d('0x29')];this[_0x035d('0x2a')]=_0x375ca6['dialPrefix'];this[_0x035d('0x2b')]=_0x375ca6[_0x035d('0x2b')];this[_0x035d('0x2c')]=_0x375ca6[_0x035d('0x2c')];this[_0x035d('0x2d')]=_0x375ca6[_0x035d('0x2d')];this[_0x035d('0xa')]=_0x375ca6[_0x035d('0xa')];this[_0x035d('0xb')]=_0x375ca6[_0x035d('0xb')];this[_0x035d('0xc')]=_0x375ca6['outboundCongestionCallsDay'];this[_0x035d('0x2e')]=_0x375ca6[_0x035d('0x2e')];this['outboundDropCallsDayCallersExit']=_0x375ca6['outboundDropCallsDayCallersExit'];this[_0x035d('0x2f')]=_0x375ca6[_0x035d('0x2f')];this[_0x035d('0xd')]=_0x375ca6[_0x035d('0xd')];this[_0x035d('0xe')]=_0x375ca6[_0x035d('0xe')];this['outboundOriginateFailureCallsDay']=_0x375ca6[_0x035d('0x30')];this['outboundReCallsDay']=_0x375ca6[_0x035d('0xf')];this[_0x035d('0x10')]=_0x375ca6[_0x035d('0x10')];this[_0x035d('0x11')]=_0x375ca6['outboundUnknownCallsDay'];this['predictiveIntervalAnsweredCalls']=_0x375ca6[_0x035d('0x31')];this[_0x035d('0x32')]=_0x375ca6[_0x035d('0x32')];this[_0x035d('0x33')]=_0x375ca6[_0x035d('0x33')];this['predictiveIntervalDroppedCallsCallersExit']=_0x375ca6[_0x035d('0x34')];this[_0x035d('0x35')]=_0x375ca6[_0x035d('0x35')];this[_0x035d('0x36')]=_0x375ca6[_0x035d('0x36')];this[_0x035d('0x37')]=_0x375ca6[_0x035d('0x37')];this[_0x035d('0x38')]=_0x375ca6[_0x035d('0x38')];this[_0x035d('0x39')]=_0x375ca6[_0x035d('0x39')];this['predictiveIntervalPauses']=_0x375ca6[_0x035d('0x3a')];this[_0x035d('0x3b')]=_0x375ca6[_0x035d('0x3b')];this['predictiveIntervalTotalCalls']=_0x375ca6[_0x035d('0x3c')];this[_0x035d('0x8')]=_0x375ca6[_0x035d('0x8')];this[_0x035d('0x3d')]=_0x375ca6['erlangCalls'];this[_0x035d('0x3e')]=_0x375ca6['erlangCallToSecond'];this[_0x035d('0x3f')]=_0x375ca6['erlangAbandonmentRate'];this['erlangBusyFactor']=_0x375ca6[_0x035d('0x40')];this[_0x035d('0x41')]=_0x375ca6[_0x035d('0x41')];this[_0x035d('0x42')]=_0x375ca6[_0x035d('0x42')];this[_0x035d('0x43')]=_0x375ca6[_0x035d('0x43')];this[_0x035d('0x44')]=_0x375ca6[_0x035d('0x44')];}if(_0x375ca6[_0x035d('0x45')]){this[_0x035d('0x45')]={'id':_0x375ca6[_0x035d('0x45')]['id'],'name':_0x375ca6['Trunk'][_0x035d('0x15')],'active':_0x375ca6['Trunk'][_0x035d('0x46')],'callerid':_0x375ca6[_0x035d('0x45')][_0x035d('0x47')]};}}VoiceQueueSummary['prototype']['createReport']=function(_0x5c2645,_0x492996,_0x4fa495,_0x46f9e5){this[_0x035d('0x7')]=0x0;this['talking']=0x0;this['paused']=0x0;this[_0x035d('0x22')]=0x0;this[_0x035d('0x1c')]=0x0;this['inUse']=0x0;this[_0x035d('0x18')]=0x0;this[_0x035d('0x1a')]=0x0;this[_0x035d('0x21')]=0x0;this[_0x035d('0x3')]=0x0;this[_0x035d('0x1d')]=0x0;this[_0x035d('0x1b')]=0x0;if(_0x4fa495){if(_0x4fa495['available']){this[_0x035d('0x0')]=Number(_0x4fa495['available']);}if(_0x4fa495[_0x035d('0x48')]){this[_0x035d('0x1')]=Number(_0x4fa495[_0x035d('0x48')]);}if(_0x4fa495[_0x035d('0x49')]){this[_0x035d('0x5')]=Number(_0x4fa495[_0x035d('0x49')]);}}for(var _0xe41860=0x0;_0xe41860<_0x5c2645[_0x035d('0x4a')];_0xe41860++){var _0x50bcee=_0x492996[_0x035d('0x4b')+_0x5c2645[_0xe41860][_0x035d('0x15')]];if(_0x50bcee&&_0x50bcee['online']){this['loggedInDb']+=0x1;}if(_0x5c2645[_0xe41860][_0x035d('0x4c')]==='1'){this[_0x035d('0x4')]+=0x1;}if(_0x5c2645[_0xe41860][_0x035d('0x2')]==='1'&&!['2','7','8']['includes'](_0x5c2645[_0xe41860][_0x035d('0x4d')])){this[_0x035d('0x2')]+=0x1;}switch(_0x5c2645[_0xe41860]['status']){case'0':this[_0x035d('0x22')]+=0x1;break;case'1':this[_0x035d('0x1c')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0x035d('0x18')]+=0x1;break;case'4':this[_0x035d('0x1a')]+=0x1;break;case'5':this[_0x035d('0x21')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0x035d('0x1d')]+=0x1;break;case'8':this[_0x035d('0x1b')]+=0x1;break;}}if(this[_0x035d('0x26')]===_0x035d('0x4e')){var _0x83871b=Object[_0x035d('0x4f')](_0x46f9e5);for(var _0x21632d=0x0;_0x21632d<_0x83871b[_0x035d('0x4a')];_0x21632d++){var _0x37a1f1=_0x83871b[_0x21632d];var _0x44d44a=_0x46f9e5[_0x37a1f1];if(_0x44d44a[_0x035d('0x50')]===this[_0x035d('0x15')]&&_0x44d44a[_0x035d('0x20')]==='dialer'&&_0x44d44a[_0x035d('0x51')]==='xcally-motion-preview'){this[_0x035d('0x4')]+=0x1;}}if(this[_0x035d('0x4')]>this[_0x035d('0x19')]){this['talking']=this['inUse'];}this[_0x035d('0x12')]=0x0;}return this;};VoiceQueueSummary[_0x035d('0x52')]['compareToInboundQueue']=function(_0x30159c){var _0x449399=![];if(_0x30159c){_0x449399=INBOUND_COUNTERS['some'](function(_0x22d609){return this[_0x22d609]!==_0x30159c[_0x22d609];},this);}return _0x449399;};VoiceQueueSummary[_0x035d('0x52')]['compareToOutboundQueue']=function(_0x37f35c){var _0x29e34e=![];var _0x52134a=![];var _0x18f69e=![];if(_0x37f35c){_0x29e34e=this[_0x035d('0x26')]!==_0x37f35c['dialMethod']||this['dialActive']!==_0x37f35c[_0x035d('0x25')]||this[_0x035d('0x43')]!==_0x37f35c[_0x035d('0x43')]||this[_0x035d('0x44')]!==_0x37f35c[_0x035d('0x44')];_0x52134a=OUTBOUND_COUNTERS[_0x035d('0x53')](function(_0x5bca63){return this[_0x5bca63]!==_0x37f35c[_0x5bca63];},this);if(this[_0x035d('0x45')]&&_0x37f35c['Trunk']){_0x18f69e=this[_0x035d('0x45')]['name']!==_0x37f35c[_0x035d('0x45')][_0x035d('0x15')]||this[_0x035d('0x45')][_0x035d('0x46')]!==_0x37f35c[_0x035d('0x45')][_0x035d('0x46')];}}return _0x29e34e||_0x52134a||_0x18f69e;};VoiceQueueSummary[_0x035d('0x52')][_0x035d('0x54')]=function(_0x2dbfd8){this[_0x035d('0x6')]=_0x2dbfd8[_0x035d('0x6')];this[_0x035d('0x43')]=_0x2dbfd8[_0x035d('0x43')];this[_0x035d('0x44')]=_0x2dbfd8['statusMessage'];this['originated']=_0x2dbfd8[_0x035d('0x8')];this[_0x035d('0x9')]=_0x2dbfd8[_0x035d('0x9')];this[_0x035d('0x2d')]=_0x2dbfd8[_0x035d('0x2d')];this[_0x035d('0xa')]=_0x2dbfd8['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x2dbfd8['outboundBusyCallsDay'];this[_0x035d('0xc')]=_0x2dbfd8['outboundCongestionCallsDay'];this[_0x035d('0xd')]=_0x2dbfd8[_0x035d('0xd')];this[_0x035d('0xe')]=_0x2dbfd8[_0x035d('0xe')];this[_0x035d('0xf')]=_0x2dbfd8[_0x035d('0xf')];this['outboundRejectCallsDay']=_0x2dbfd8[_0x035d('0x10')];this['outboundUnknownCallsDay']=_0x2dbfd8[_0x035d('0x11')];this[_0x035d('0x13')]=_0x2dbfd8[_0x035d('0x13')];this[_0x035d('0x1e')]=_0x2dbfd8[_0x035d('0x1e')];this[_0x035d('0x14')]=_0x2dbfd8[_0x035d('0x14')];if(this[_0x035d('0x26')]===_0x035d('0x55')){this[_0x035d('0x12')]=_0x2dbfd8[_0x035d('0x12')];}};module[_0x035d('0x56')]=VoiceQueueSummary; \ No newline at end of file +var _0x4986=['prototype','loggedin','callers','length','SIP/','online','incall','includes','status','booked','keys','queue','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','exports','available','loggedIn','loggedInDb','talking','waiting','answered','inUse','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','paused','pTalking','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringing','ringInUse','sumBillable','sumDuration','sumHoldTime','type','unavailable','unknown','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid'];(function(_0x2b6600,_0x24c497){var _0x912ee2=function(_0x5d6484){while(--_0x5d6484){_0x2b6600['push'](_0x2b6600['shift']());}};_0x912ee2(++_0x24c497);}(_0x4986,0x6e));var _0x6498=function(_0x4b29a3,_0x5a0f00){_0x4b29a3=_0x4b29a3-0x0;var _0x4cca63=_0x4986[_0x4b29a3];return _0x4cca63;};'use strict';var INBOUND_COUNTERS=[_0x6498('0x0'),_0x6498('0x1'),_0x6498('0x2'),'paused','ringing',_0x6498('0x3'),_0x6498('0x4')];var OUTBOUND_COUNTERS=['available',_0x6498('0x5'),_0x6498('0x6'),_0x6498('0x1'),_0x6498('0x2'),_0x6498('0x7'),_0x6498('0x8'),_0x6498('0x9'),'outboundBlacklistCallsDay','outboundBusyCallsDay',_0x6498('0xa'),_0x6498('0xb'),_0x6498('0xc'),_0x6498('0xd'),_0x6498('0xe'),'outboundUnknownCallsDay',_0x6498('0xf'),_0x6498('0x10'),_0x6498('0x3'),'sumBillable','sumDuration',_0x6498('0x11'),'waiting'];function VoiceQueueSummary(_0x1b6f28){this['id']=_0x1b6f28['id'];this[_0x6498('0x12')]=_0x1b6f28[_0x6498('0x12')];this[_0x6498('0x13')]=_0x1b6f28[_0x6498('0x13')];this[_0x6498('0x14')]=_0x1b6f28[_0x6498('0x14')]||0x0;this['answered']=_0x1b6f28['answered']||0x0;this[_0x6498('0x0')]=_0x1b6f28[_0x6498('0x0')]||0x0;this[_0x6498('0x15')]=_0x1b6f28[_0x6498('0x15')]||0x0;this[_0x6498('0x6')]=_0x1b6f28['inUse']||0x0;this[_0x6498('0x16')]=_0x1b6f28[_0x6498('0x16')]||0x0;this[_0x6498('0x1')]=_0x1b6f28[_0x6498('0x1')]||0x0;this[_0x6498('0x2')]=_0x1b6f28[_0x6498('0x2')]||0x0;this[_0x6498('0x17')]=_0x1b6f28['onHold']||0x0;this[_0x6498('0x18')]=_0x1b6f28[_0x6498('0x18')]||0x0;this[_0x6498('0xf')]=_0x1b6f28[_0x6498('0xf')]||0x0;this[_0x6498('0x19')]=_0x1b6f28['ringing']||0x0;this['ringInUse']=_0x1b6f28[_0x6498('0x1a')];this[_0x6498('0x1b')]=_0x1b6f28[_0x6498('0x1b')];this[_0x6498('0x1c')]=_0x1b6f28[_0x6498('0x1c')];this[_0x6498('0x1d')]=_0x1b6f28[_0x6498('0x1d')]||0x0;this[_0x6498('0x3')]=_0x1b6f28[_0x6498('0x3')]||0x0;this[_0x6498('0x11')]=_0x1b6f28[_0x6498('0x11')]||0x0;this[_0x6498('0x1e')]=_0x1b6f28[_0x6498('0x1e')];this[_0x6498('0x1f')]=_0x1b6f28['unavailable']||0x0;this['unknown']=_0x1b6f28[_0x6498('0x20')]||0x0;this['unmanaged']=_0x1b6f28[_0x6498('0x21')]||0x0;this[_0x6498('0x4')]=_0x1b6f28[_0x6498('0x4')]||0x0;if(_0x1b6f28[_0x6498('0x1e')]==='outbound'){this['pTalking']=_0x1b6f28[_0x6498('0x10')]||0x0;this['dialActive']=_0x1b6f28[_0x6498('0x22')];this[_0x6498('0x23')]=_0x1b6f28[_0x6498('0x23')];this[_0x6498('0x24')]=_0x1b6f28[_0x6498('0x24')];this[_0x6498('0x25')]=_0x1b6f28[_0x6498('0x25')];this[_0x6498('0x26')]=_0x1b6f28[_0x6498('0x26')];this[_0x6498('0x27')]=_0x1b6f28[_0x6498('0x27')];this[_0x6498('0x28')]=_0x1b6f28[_0x6498('0x28')];this['outboundAnswerAgiCallsDay']=_0x1b6f28[_0x6498('0x29')];this[_0x6498('0x9')]=_0x1b6f28['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x1b6f28['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x1b6f28[_0x6498('0x2a')];this[_0x6498('0xa')]=_0x1b6f28[_0x6498('0xa')];this[_0x6498('0x2b')]=_0x1b6f28['outboundDropCallsDayACS'];this[_0x6498('0x2c')]=_0x1b6f28['outboundDropCallsDayCallersExit'];this['outboundDropCallsDayTimeout']=_0x1b6f28['outboundDropCallsDayTimeout'];this['outboundNoAnswerCallsDay']=_0x1b6f28[_0x6498('0xb')];this[_0x6498('0xc')]=_0x1b6f28['outboundNoSuchCallsDay'];this[_0x6498('0x2d')]=_0x1b6f28['outboundOriginateFailureCallsDay'];this[_0x6498('0xd')]=_0x1b6f28[_0x6498('0xd')];this['outboundRejectCallsDay']=_0x1b6f28['outboundRejectCallsDay'];this[_0x6498('0x2e')]=_0x1b6f28['outboundUnknownCallsDay'];this[_0x6498('0x2f')]=_0x1b6f28[_0x6498('0x2f')];this['predictiveIntervalAvgHoldtime']=_0x1b6f28[_0x6498('0x30')];this['predictiveIntervalAvgTalktime']=_0x1b6f28[_0x6498('0x31')];this[_0x6498('0x32')]=_0x1b6f28[_0x6498('0x32')];this[_0x6498('0x33')]=_0x1b6f28[_0x6498('0x33')];this[_0x6498('0x34')]=_0x1b6f28[_0x6498('0x34')];this['predictiveIntervalErlangCallsDroppedCalls']=_0x1b6f28[_0x6498('0x35')];this['predictiveIntervalHitRate']=_0x1b6f28[_0x6498('0x36')];this['predictiveIntervalMultiplicativeFactor']=_0x1b6f28[_0x6498('0x37')];this['predictiveIntervalPauses']=_0x1b6f28[_0x6498('0x38')];this[_0x6498('0x39')]=_0x1b6f28[_0x6498('0x39')];this[_0x6498('0x3a')]=_0x1b6f28[_0x6498('0x3a')];this[_0x6498('0x7')]=_0x1b6f28[_0x6498('0x7')];this['erlangCalls']=_0x1b6f28[_0x6498('0x3b')];this[_0x6498('0x3c')]=_0x1b6f28[_0x6498('0x3c')];this[_0x6498('0x3d')]=_0x1b6f28[_0x6498('0x3d')];this[_0x6498('0x3e')]=_0x1b6f28[_0x6498('0x3e')];this[_0x6498('0x3f')]=_0x1b6f28['startPredictive'];this[_0x6498('0x40')]=_0x1b6f28[_0x6498('0x40')];this[_0x6498('0x41')]=_0x1b6f28['message'];this[_0x6498('0x42')]=_0x1b6f28[_0x6498('0x42')];}if(_0x1b6f28[_0x6498('0x43')]){this[_0x6498('0x43')]={'id':_0x1b6f28[_0x6498('0x43')]['id'],'name':_0x1b6f28[_0x6498('0x43')][_0x6498('0x12')],'active':_0x1b6f28[_0x6498('0x43')][_0x6498('0x44')],'callerid':_0x1b6f28[_0x6498('0x43')][_0x6498('0x45')]};}}VoiceQueueSummary[_0x6498('0x46')]['createReport']=function(_0x4d05d2,_0x5b4348,_0x2b98dd,_0x1ceb5d){this[_0x6498('0x2')]=0x0;this[_0x6498('0x3')]=0x0;this[_0x6498('0xf')]=0x0;this[_0x6498('0x20')]=0x0;this[_0x6498('0x18')]=0x0;this['inUse']=0x0;this[_0x6498('0x15')]=0x0;this[_0x6498('0x16')]=0x0;this[_0x6498('0x1f')]=0x0;this[_0x6498('0x19')]=0x0;this[_0x6498('0x1a')]=0x0;this[_0x6498('0x17')]=0x0;if(_0x2b98dd){if(_0x2b98dd['available']){this[_0x6498('0x0')]=Number(_0x2b98dd[_0x6498('0x0')]);}if(_0x2b98dd['loggedin']){this['loggedIn']=Number(_0x2b98dd[_0x6498('0x47')]);}if(_0x2b98dd[_0x6498('0x48')]){this[_0x6498('0x4')]=Number(_0x2b98dd['callers']);}}for(var _0x4fb005=0x0;_0x4fb005<_0x4d05d2[_0x6498('0x49')];_0x4fb005++){var _0x4ade23=_0x5b4348[_0x6498('0x4a')+_0x4d05d2[_0x4fb005][_0x6498('0x12')]];if(_0x4ade23&&_0x4ade23[_0x6498('0x4b')]){this[_0x6498('0x2')]+=0x1;}if(_0x4d05d2[_0x4fb005][_0x6498('0x4c')]==='1'){this[_0x6498('0x3')]+=0x1;}if(_0x4d05d2[_0x4fb005]['paused']==='1'&&!['2','7','8'][_0x6498('0x4d')](_0x4d05d2[_0x4fb005][_0x6498('0x4e')])){this[_0x6498('0xf')]+=0x1;}switch(_0x4d05d2[_0x4fb005][_0x6498('0x4e')]){case'0':this['unknown']+=0x1;break;case'1':this[_0x6498('0x18')]+=0x1;break;case'2':this[_0x6498('0x6')]+=0x1;break;case'3':this[_0x6498('0x15')]+=0x1;break;case'4':this[_0x6498('0x16')]+=0x1;break;case'5':this[_0x6498('0x1f')]+=0x1;break;case'6':this[_0x6498('0x19')]+=0x1;break;case'7':this[_0x6498('0x1a')]+=0x1;break;case'8':this[_0x6498('0x17')]+=0x1;break;}}if(this['dialMethod']===_0x6498('0x4f')){var _0x1bbb6f=Object[_0x6498('0x50')](_0x1ceb5d);for(var _0x30d30b=0x0;_0x30d30b<_0x1bbb6f[_0x6498('0x49')];_0x30d30b++){var _0x1f44b8=_0x1bbb6f[_0x30d30b];var _0x4bfcb5=_0x1ceb5d[_0x1f44b8];if(_0x4bfcb5[_0x6498('0x51')]===this[_0x6498('0x12')]&&_0x4bfcb5[_0x6498('0x1e')]===_0x6498('0x52')&&_0x4bfcb5[_0x6498('0x53')]===_0x6498('0x54')){this[_0x6498('0x3')]+=0x1;}}if(this[_0x6498('0x3')]>this[_0x6498('0x6')]){this[_0x6498('0x3')]=this[_0x6498('0x6')];}this[_0x6498('0x10')]=0x0;}return this;};VoiceQueueSummary[_0x6498('0x46')][_0x6498('0x55')]=function(_0x47e90c){var _0x147937=![];if(_0x47e90c){_0x147937=INBOUND_COUNTERS[_0x6498('0x56')](function(_0x3d531c){return this[_0x3d531c]!==_0x47e90c[_0x3d531c];},this);}return _0x147937;};VoiceQueueSummary[_0x6498('0x46')][_0x6498('0x57')]=function(_0x24083a){var _0x5ab08c=![];var _0x552a9e=![];var _0x26580e=![];if(_0x24083a){_0x5ab08c=this['dialMethod']!==_0x24083a[_0x6498('0x23')]||this[_0x6498('0x22')]!==_0x24083a[_0x6498('0x22')]||this[_0x6498('0x41')]!==_0x24083a[_0x6498('0x41')]||this['statusMessage']!==_0x24083a[_0x6498('0x42')];_0x552a9e=OUTBOUND_COUNTERS[_0x6498('0x56')](function(_0x3ed025){return this[_0x3ed025]!==_0x24083a[_0x3ed025];},this);if(this[_0x6498('0x43')]&&_0x24083a['Trunk']){_0x26580e=this['Trunk'][_0x6498('0x12')]!==_0x24083a['Trunk'][_0x6498('0x12')]||this[_0x6498('0x43')][_0x6498('0x44')]!==_0x24083a[_0x6498('0x43')][_0x6498('0x44')];}}return _0x5ab08c||_0x552a9e||_0x26580e;};VoiceQueueSummary[_0x6498('0x46')][_0x6498('0x58')]=function(_0x11e978){this['answered']=_0x11e978[_0x6498('0x5')];this[_0x6498('0x41')]=_0x11e978[_0x6498('0x41')];this[_0x6498('0x42')]=_0x11e978['statusMessage'];this[_0x6498('0x7')]=_0x11e978['originated'];this[_0x6498('0x8')]=_0x11e978['outboundAbandonedCallsDay'];this[_0x6498('0x9')]=_0x11e978[_0x6498('0x9')];this['outboundBlacklistCallsDay']=_0x11e978['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x11e978[_0x6498('0x2a')];this[_0x6498('0xa')]=_0x11e978['outboundCongestionCallsDay'];this[_0x6498('0xb')]=_0x11e978[_0x6498('0xb')];this['outboundNoSuchCallsDay']=_0x11e978['outboundNoSuchCallsDay'];this[_0x6498('0xd')]=_0x11e978[_0x6498('0xd')];this[_0x6498('0xe')]=_0x11e978[_0x6498('0xe')];this[_0x6498('0x2e')]=_0x11e978[_0x6498('0x2e')];this[_0x6498('0x1b')]=_0x11e978[_0x6498('0x1b')];this[_0x6498('0x1c')]=_0x11e978['sumDuration'];this['total']=_0x11e978[_0x6498('0x11')];if(this[_0x6498('0x23')]==='preview'){this[_0x6498('0x10')]=_0x11e978[_0x6498('0x10')];}};module[_0x6498('0x59')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 47d9801..a2173cc 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 _0x76a4=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x76a4,0xe9));var _0x476a=function(_0x10a45d,_0x5981cc){_0x10a45d=_0x10a45d-0x0;var _0x24ede4=_0x76a4[_0x10a45d];return _0x24ede4;};'use strict';function VtigerAccount(_0x1d50d9){this['id']=_0x1d50d9['id']||0x0;this[_0x476a('0x0')]=_0x1d50d9[_0x476a('0x0')]||'';this[_0x476a('0x1')]=_0x1d50d9[_0x476a('0x1')]||'';this[_0x476a('0x2')]=_0x1d50d9[_0x476a('0x2')]||'';this[_0x476a('0x3')]=_0x1d50d9[_0x476a('0x3')]||'';this[_0x476a('0x4')]=_0x1d50d9[_0x476a('0x4')]||'';this[_0x476a('0x5')]=_0x1d50d9[_0x476a('0x5')]||{};}module[_0x476a('0x6')]=VtigerAccount; \ No newline at end of file +var _0xd997=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x162c83,_0x125a02){var _0x3a8d4f=function(_0x159887){while(--_0x159887){_0x162c83['push'](_0x162c83['shift']());}};_0x3a8d4f(++_0x125a02);}(_0xd997,0x18d));var _0x7d99=function(_0x22ac18,_0x1515d4){_0x22ac18=_0x22ac18-0x0;var _0x4da78f=_0xd997[_0x22ac18];return _0x4da78f;};'use strict';function VtigerAccount(_0x3e3f45){this['id']=_0x3e3f45['id']||0x0;this[_0x7d99('0x0')]=_0x3e3f45[_0x7d99('0x0')]||'';this['username']=_0x3e3f45[_0x7d99('0x1')]||'';this[_0x7d99('0x2')]=_0x3e3f45[_0x7d99('0x2')]||'';this[_0x7d99('0x3')]=_0x3e3f45[_0x7d99('0x3')]||'';this[_0x7d99('0x4')]=_0x3e3f45[_0x7d99('0x4')]||'';this[_0x7d99('0x5')]=_0x3e3f45[_0x7d99('0x5')]||{};}module[_0x7d99('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index a7bf44b..3e6f0a4 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 _0x6436=['authType','type','integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x6436,0x127));var _0x6643=function(_0x61188d,_0x413b40){_0x61188d=_0x61188d-0x0;var _0x26b821=_0x6436[_0x61188d];return _0x26b821;};'use strict';function ZendeskAccount(_0x2015bf){this['id']=_0x2015bf['id']||0x0;this[_0x6643('0x0')]=_0x2015bf[_0x6643('0x0')]||'';this['username']=_0x2015bf[_0x6643('0x1')]||'';this[_0x6643('0x2')]=_0x2015bf[_0x6643('0x2')]||'';this[_0x6643('0x3')]=_0x2015bf['token']||'';this[_0x6643('0x4')]=_0x2015bf[_0x6643('0x4')]||'';this['authType']=_0x2015bf[_0x6643('0x5')]||'';this[_0x6643('0x6')]=_0x2015bf[_0x6643('0x6')]||_0x6643('0x7');this[_0x6643('0x8')]=_0x2015bf[_0x6643('0x8')]||'';this[_0x6643('0x9')]=_0x2015bf[_0x6643('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x1751=['password','token','remoteUri','type','serverUrl','Configurations','exports','name','username'];(function(_0x39b9b3,_0x3e9a66){var _0x4977c8=function(_0x2610c9){while(--_0x2610c9){_0x39b9b3['push'](_0x39b9b3['shift']());}};_0x4977c8(++_0x3e9a66);}(_0x1751,0x8e));var _0x1175=function(_0x422361,_0x6832f9){_0x422361=_0x422361-0x0;var _0x40824d=_0x1751[_0x422361];return _0x40824d;};'use strict';function ZendeskAccount(_0xe8815c){this['id']=_0xe8815c['id']||0x0;this['name']=_0xe8815c[_0x1175('0x0')]||'';this['username']=_0xe8815c[_0x1175('0x1')]||'';this[_0x1175('0x2')]=_0xe8815c[_0x1175('0x2')]||'';this[_0x1175('0x3')]=_0xe8815c[_0x1175('0x3')]||'';this[_0x1175('0x4')]=_0xe8815c[_0x1175('0x4')]||'';this['authType']=_0xe8815c['authType']||'';this['type']=_0xe8815c[_0x1175('0x5')]||'integrationTab';this[_0x1175('0x6')]=_0xe8815c[_0x1175('0x6')]||'';this[_0x1175('0x7')]=_0xe8815c['Configurations']||{};}module[_0x1175('0x8')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 6f091fc..c7653f5 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 _0x144f=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x21fd74,_0xdbd0f){var _0x19e4c1=function(_0x13feac){while(--_0x13feac){_0x21fd74['push'](_0x21fd74['shift']());}};_0x19e4c1(++_0xdbd0f);}(_0x144f,0x144));var _0xf144=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x144f[_0x2283dc];return _0x16db90;};'use strict';function ZohoAccount(_0x5348c6){this['id']=_0x5348c6['id']||0x0;this['name']=_0x5348c6[_0xf144('0x0')]||'';this[_0xf144('0x1')]=_0x5348c6[_0xf144('0x1')]||'';this[_0xf144('0x2')]=_0x5348c6[_0xf144('0x2')]||'';this['zone']=_0x5348c6[_0xf144('0x3')]||'';this['clientId']=_0x5348c6[_0xf144('0x4')]||'';this[_0xf144('0x5')]=_0x5348c6['clientSecret']||'';this['serverUrl']=_0x5348c6[_0xf144('0x6')]||'';this['code']=_0x5348c6[_0xf144('0x7')]||'';this[_0xf144('0x8')]=_0x5348c6[_0xf144('0x8')]||'';this[_0xf144('0x9')]=_0x5348c6[_0xf144('0x9')]||{};}module[_0xf144('0xa')]=ZohoAccount; \ No newline at end of file +var _0x3eb8=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','host','zone','clientId'];(function(_0x1ee9a1,_0x5f1434){var _0x21270f=function(_0x303251){while(--_0x303251){_0x1ee9a1['push'](_0x1ee9a1['shift']());}};_0x21270f(++_0x5f1434);}(_0x3eb8,0xc4));var _0x83eb=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x3eb8[_0x39e84d];return _0x1991bc;};'use strict';function ZohoAccount(_0x3b1dc5){this['id']=_0x3b1dc5['id']||0x0;this[_0x83eb('0x0')]=_0x3b1dc5[_0x83eb('0x0')]||'';this['description']=_0x3b1dc5['description']||'';this[_0x83eb('0x1')]=_0x3b1dc5[_0x83eb('0x1')]||'';this[_0x83eb('0x2')]=_0x3b1dc5['zone']||'';this[_0x83eb('0x3')]=_0x3b1dc5[_0x83eb('0x3')]||'';this[_0x83eb('0x4')]=_0x3b1dc5[_0x83eb('0x4')]||'';this[_0x83eb('0x5')]=_0x3b1dc5[_0x83eb('0x5')]||'';this['code']=_0x3b1dc5[_0x83eb('0x6')]||'';this[_0x83eb('0x7')]=_0x3b1dc5[_0x83eb('0x7')]||'';this[_0x83eb('0x8')]=_0x3b1dc5['Configurations']||{};}module[_0x83eb('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 15f6dad..54eb75e 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 _0x1eba=['channelAgent','format','SIP/%s','calleridname','Contact','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','getCaller','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','Agent','name'];(function(_0x22dca5,_0xa27c32){var _0xaf2820=function(_0x45ffc6){while(--_0x45ffc6){_0x22dca5['push'](_0x22dca5['shift']());}};_0xaf2820(++_0xa27c32);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x1eba[_0x1abb09];return _0xea1c07;};'use strict';var util=require(_0xa1eb('0x0'));var _=require(_0xa1eb('0x1'));var moment=require(_0xa1eb('0x2'));function checkNameSurname(_0x2158d5,_0x3ef7ee,_0x5865fc){var _0x56c5f2='';if(!_[_0xa1eb('0x3')](_0x3ef7ee)&&_0xa1eb('0x4')===typeof _0x3ef7ee){_0x56c5f2+=_0x3ef7ee;}if(!_[_0xa1eb('0x3')](_0x5865fc)&&_0xa1eb('0x4')===typeof _0x5865fc){_0x56c5f2+='\x20'+_0x5865fc;}if(_0x56c5f2!==''){return _0x56c5f2;}return _0x2158d5;}function Action(_0x138789,_0x2933d0,_0x1d0d67,_0x2bfbb0,_0x39a5a3){this[_0xa1eb('0x5')]=_0x1d0d67||undefined;this[_0xa1eb('0x6')]=_0x138789['id'];this[_0xa1eb('0x7')]=_0x2933d0['name'];this[_0xa1eb('0x8')]=_0x2933d0['type'];this[_0xa1eb('0x9')]='queue';this[_0xa1eb('0xa')]=![];this['membername']=_[_0xa1eb('0x3')](_0x138789['Agent'])?undefined:_0x138789[_0xa1eb('0xb')][_0xa1eb('0xc')];this[_0xa1eb('0xd')]=this['membername']?util[_0xa1eb('0xe')](_0xa1eb('0xf'),this['membername']):_0x2bfbb0||undefined;this[_0xa1eb('0x10')]=checkNameSurname(_0x138789['Contact']['phone'],_0x138789[_0xa1eb('0x11')]['firstName'],_0x138789[_0xa1eb('0x11')][_0xa1eb('0x12')]);this[_0xa1eb('0x13')]=_0x138789[_0xa1eb('0x13')]||![];this[_0xa1eb('0x14')]=_0x138789[_0xa1eb('0x15')];this[_0xa1eb('0x16')]=_0x138789[_0xa1eb('0x16')];this[_0xa1eb('0x17')]=_0x138789['countbusyretry']||0x0;this[_0xa1eb('0x18')]=_0x138789['countcongestionretry']||0x0;this[_0xa1eb('0x19')]=_0x138789[_0xa1eb('0x19')]||0x0;this[_0xa1eb('0x1a')]=(_0x138789[_0xa1eb('0x17')]||0x0)+(_0x138789['countcongestionretry']||0x0)+(_0x138789[_0xa1eb('0x19')]||0x0)+(_0x138789[_0xa1eb('0x1b')]||0x0)+(_0x138789[_0xa1eb('0x1c')]||0x0)+(_0x138789[_0xa1eb('0x1d')]||0x0)+(_0x138789[_0xa1eb('0x1e')]||0x0)+(_0x138789[_0xa1eb('0x1f')]||0x0);this[_0xa1eb('0x1b')]=_0x138789[_0xa1eb('0x1b')]||0x0;this['countdropretry']=_0x138789[_0xa1eb('0x1c')]||0x0;this['countabandonedretry']=_0x138789[_0xa1eb('0x1d')]||0x0;this[_0xa1eb('0x1e')]=_0x138789[_0xa1eb('0x1e')]||0x0;this[_0xa1eb('0x1f')]=_0x138789['countagentrejectretry']||0x0;this['callback']=_0x138789[_0xa1eb('0x20')];this[_0xa1eb('0x21')]=_0x138789['callbackuniqueid'];this[_0xa1eb('0x22')]=_0x138789[_0xa1eb('0x22')];this[_0xa1eb('0x23')]=_0x138789[_0xa1eb('0x23')];this[_0xa1eb('0x24')]=_0x138789[_0xa1eb('0x24')];this[_0xa1eb('0x25')]=_0x138789[_0xa1eb('0x25')];this[_0xa1eb('0x26')]=_[_0xa1eb('0x3')](_0x138789[_0xa1eb('0xb')])?_0x138789[_0xa1eb('0x26')]:_0x138789['Agent']['id'];this[_0xa1eb('0x27')]=_0x138789[_0xa1eb('0x27')];this['originatecalleridnum']='';this[_0xa1eb('0x28')]='';}Action['prototype'][_0xa1eb('0x29')]=function(){return util[_0xa1eb('0xe')]('\x22%s\x22\x20<%s>',this[_0xa1eb('0x10')],this[_0xa1eb('0x2a')]);};module[_0xa1eb('0x2b')]=Action; \ No newline at end of file +var _0xb03e=['format','SIP/%s','calleridname','Contact','phone','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','number','exports','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','membername','Agent','channelAgent'];(function(_0x47a5bd,_0x508329){var _0x5c2184=function(_0x40ddea){while(--_0x40ddea){_0x47a5bd['push'](_0x47a5bd['shift']());}};_0x5c2184(++_0x508329);}(_0xb03e,0x1eb));var _0xeb03=function(_0x1637c3,_0x2beeca){_0x1637c3=_0x1637c3-0x0;var _0x3c164a=_0xb03e[_0x1637c3];return _0x3c164a;};'use strict';var util=require('util');var _=require(_0xeb03('0x0'));var moment=require(_0xeb03('0x1'));function checkNameSurname(_0x868905,_0x3c5e68,_0x1c58b5){var _0x2db660='';if(!_[_0xeb03('0x2')](_0x3c5e68)&&_0xeb03('0x3')===typeof _0x3c5e68){_0x2db660+=_0x3c5e68;}if(!_[_0xeb03('0x2')](_0x1c58b5)&&_0xeb03('0x3')===typeof _0x1c58b5){_0x2db660+='\x20'+_0x1c58b5;}if(_0x2db660!==''){return _0x2db660;}return _0x868905;}function Action(_0x88925b,_0xee2291,_0x4e1cea,_0x3b58a2,_0x3d3322){this[_0xeb03('0x4')]=_0x4e1cea||undefined;this[_0xeb03('0x5')]=_0x88925b['id'];this[_0xeb03('0x6')]=_0xee2291[_0xeb03('0x7')];this['type']=_0xee2291[_0xeb03('0x8')];this[_0xeb03('0x9')]=_0xeb03('0x6');this['dialAnswer']=![];this[_0xeb03('0xa')]=_['isNil'](_0x88925b[_0xeb03('0xb')])?undefined:_0x88925b[_0xeb03('0xb')][_0xeb03('0x7')];this[_0xeb03('0xc')]=this[_0xeb03('0xa')]?util[_0xeb03('0xd')](_0xeb03('0xe'),this[_0xeb03('0xa')]):_0x3b58a2||undefined;this[_0xeb03('0xf')]=checkNameSurname(_0x88925b[_0xeb03('0x10')][_0xeb03('0x11')],_0x88925b[_0xeb03('0x10')]['firstName'],_0x88925b[_0xeb03('0x10')][_0xeb03('0x12')]);this[_0xeb03('0x13')]=_0x88925b[_0xeb03('0x13')]||![];this['calleridnum']=_0x88925b[_0xeb03('0x11')];this[_0xeb03('0x14')]=_0x88925b[_0xeb03('0x14')];this['countbusyretry']=_0x88925b[_0xeb03('0x15')]||0x0;this[_0xeb03('0x16')]=_0x88925b[_0xeb03('0x16')]||0x0;this[_0xeb03('0x17')]=_0x88925b[_0xeb03('0x17')]||0x0;this[_0xeb03('0x18')]=(_0x88925b[_0xeb03('0x15')]||0x0)+(_0x88925b[_0xeb03('0x16')]||0x0)+(_0x88925b[_0xeb03('0x17')]||0x0)+(_0x88925b[_0xeb03('0x19')]||0x0)+(_0x88925b[_0xeb03('0x1a')]||0x0)+(_0x88925b[_0xeb03('0x1b')]||0x0)+(_0x88925b[_0xeb03('0x1c')]||0x0)+(_0x88925b[_0xeb03('0x1d')]||0x0);this['countnosuchnumberretry']=_0x88925b[_0xeb03('0x19')]||0x0;this[_0xeb03('0x1a')]=_0x88925b[_0xeb03('0x1a')]||0x0;this[_0xeb03('0x1b')]=_0x88925b[_0xeb03('0x1b')]||0x0;this[_0xeb03('0x1c')]=_0x88925b[_0xeb03('0x1c')]||0x0;this[_0xeb03('0x1d')]=_0x88925b[_0xeb03('0x1d')]||0x0;this['callback']=_0x88925b[_0xeb03('0x1e')];this[_0xeb03('0x1f')]=_0x88925b[_0xeb03('0x1f')];this[_0xeb03('0x20')]=_0x88925b[_0xeb03('0x20')];this['recallme']=_0x88925b[_0xeb03('0x21')];this[_0xeb03('0x22')]=_0x88925b[_0xeb03('0x22')];this[_0xeb03('0x23')]=_0x88925b[_0xeb03('0x23')];this[_0xeb03('0x24')]=_[_0xeb03('0x2')](_0x88925b[_0xeb03('0xb')])?_0x88925b[_0xeb03('0x24')]:_0x88925b['Agent']['id'];this[_0xeb03('0x25')]=_0x88925b[_0xeb03('0x25')];this[_0xeb03('0x26')]='';this[_0xeb03('0x27')]='';}Action['prototype']['getCaller']=function(){return util[_0xeb03('0xd')]('\x22%s\x22\x20<%s>',this[_0xeb03('0xf')],this[_0xeb03('0x28')]);};module[_0xeb03('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 49ef71f..92367dc 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(_0x4e51c0,_0x250823){var _0x1acead=function(_0x5a52aa){while(--_0x5a52aa){_0x4e51c0['push'](_0x4e51c0['shift']());}};_0x1acead(++_0x250823);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x37e9ea,_0x32c508){var _0x7599ec=function(_0x2c03f4){while(--_0x2c03f4){_0x37e9ea['push'](_0x37e9ea['shift']());}};_0x7599ec(++_0x32c508);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 672531c..0af2955 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 _0x3ba6=['[createHistory]\x20','resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContact','[rescheduleContactInQueue]\x20','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','createHistory','catch'];(function(_0x2e87e4,_0x591ef7){var _0x3c9855=function(_0x5e43e0){while(--_0x5e43e0){_0x2e87e4['push'](_0x2e87e4['shift']());}};_0x3c9855(++_0x591ef7);}(_0x3ba6,0x95));var _0x63ba=function(_0x3e0dc4,_0x13971b){_0x3e0dc4=_0x3e0dc4-0x0;var _0x586111=_0x3ba6[_0x3e0dc4];return _0x586111;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x63ba('0x0'))(_0x63ba('0x1'));var cmHopper=require(_0x63ba('0x2'));var cmHopperHistory=require(_0x63ba('0x3'));var cmHopperBlack=require(_0x63ba('0x4'));var agentReportPreview=require(_0x63ba('0x5'));var voiceQueueReport=require(_0x63ba('0x6'));function loggerCatch(_0x453f88){return function(_0x4d35d1){logger[_0x63ba('0x7')](_0x453f88,util['inspect'](_0x4d35d1,{'showHidden':![],'depth':null}));};}function create(_0x8bb949){return cmHopperHistory[_0x63ba('0x8')](_0x8bb949)[_0x63ba('0x9')](loggerCatch(_0x63ba('0xa')));}function createAgent(_0x486503){return BPromise[_0x63ba('0xb')]()[_0x63ba('0xc')](agentReportPreview['createHistory'](_0x486503))[_0x63ba('0x9')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x325ac9){return cmHopper[_0x63ba('0xd')](_0x325ac9,!![])['catch'](loggerCatch(_0x63ba('0xe')));}exports['checkIsBlackList']=function(_0x49e4fa){return cmHopperBlack['checkIsBlackList'](_0x49e4fa)[_0x63ba('0x9')](loggerCatch(_0x63ba('0xf')));};exports[_0x63ba('0x10')]=function(_0x28327b){return BPromise[_0x63ba('0xb')]()['then'](cmHopper[_0x63ba('0x10')](_0x28327b))[_0x63ba('0x9')](loggerCatch(_0x63ba('0x11')));};exports[_0x63ba('0x8')]=function(_0x29a0ac,_0x98da8c){create(_0x29a0ac)[_0x63ba('0x9')](loggerCatch(_0x98da8c));moveContact(_0x29a0ac)[_0x63ba('0x9')](loggerCatch(_0x98da8c));};exports['createAgentHistory']=function(_0x2256ff,_0x58495e){createAgent(_0x2256ff)[_0x63ba('0x9')](loggerCatch(_0x58495e));};exports[_0x63ba('0x12')]=function(_0x4247a8,_0xf4912a){create(_0x4247a8)[_0x63ba('0x9')](loggerCatch(_0xf4912a));};exports['createCustomerFinal']=function(_0x4f157e,_0x3c010e){moveContact(_0x4f157e)[_0x63ba('0x9')](loggerCatch(_0x3c010e));};exports['rescheduleContact']=function(_0x337e71,_0x67eab0,_0x1b28a0){if(_0x67eab0){_0x337e71[_0x63ba('0x13')]=null;}if(_0x1b28a0){_0x337e71['active']=![];}return cmHopper['rescheduleContact'](_0x337e71)[_0x63ba('0x9')](loggerCatch(_0x63ba('0x14')));};exports[_0x63ba('0x15')]=function(_0xab9700){return cmHopper[_0x63ba('0x15')](_0xab9700)[_0x63ba('0x9')](loggerCatch(_0x63ba('0x16')));};exports[_0x63ba('0x17')]=function(_0x4fea8a){return cmHopper[_0x63ba('0x17')]({'UserId':null},_0x4fea8a,0x1)[_0x63ba('0x9')](loggerCatch(_0x63ba('0x18')));};exports[_0x63ba('0x19')]=function(_0x434ef8){return cmHopper[_0x63ba('0x17')]({'active':![]},_0x434ef8,0x1)[_0x63ba('0x9')](loggerCatch(_0x63ba('0x1a')));};exports[_0x63ba('0x1b')]=function(_0x5b5bf5){var _0x40f9ab={};_0x40f9ab[_0x63ba('0x1c')]=_0x5b5bf5[_0x63ba('0x1c')];_0x40f9ab[_0x63ba('0x1d')]=_0x5b5bf5['uniqueid'];_0x40f9ab[_0x63ba('0x1e')]=_0x5b5bf5['calleridnum'];_0x40f9ab[_0x63ba('0x1f')]=_0x5b5bf5['calleridname'];_0x40f9ab['queue']=_0x5b5bf5[_0x63ba('0x20')];_0x40f9ab[_0x63ba('0x21')]=_0x5b5bf5[_0x63ba('0x22')];_0x40f9ab[_0x63ba('0x23')]=_0x5b5bf5[_0x63ba('0x22')];_0x40f9ab[_0x63ba('0x24')]=0x1;_0x40f9ab[_0x63ba('0x25')]=_0x5b5bf5[_0x63ba('0x26')];_0x40f9ab['connectedlinename']=_0x5b5bf5['membername'];_0x40f9ab[_0x63ba('0x27')]=_0x63ba('0x28');_0x40f9ab['exten']=_0x63ba('0x29');_0x40f9ab[_0x63ba('0x2a')]=0x0;_0x40f9ab[_0x63ba('0x2b')]=0x1;_0x40f9ab[_0x63ba('0x2c')]=_0x5b5bf5[_0x63ba('0x2d')];_0x40f9ab[_0x63ba('0x2e')]=_0x63ba('0x2f');return BPromise['resolve']()['then'](voiceQueueReport['create'](_0x40f9ab))['catch'](loggerCatch(_0x63ba('0x30')));};exports['getContactRecallMe']=function(_0x477cb1,_0x2430c2){return BPromise[_0x63ba('0xb')]()[_0x63ba('0xc')](cmHopper[_0x63ba('0x31')](_0x477cb1,_0x2430c2))[_0x63ba('0x9')](loggerCatch(_0x63ba('0x32')));};exports['rescheduleContactInQueue']=function(_0x5244c1){return cmHopper[_0x63ba('0x33')](_0x5244c1,!![],!![])[_0x63ba('0x9')](loggerCatch(_0x63ba('0x34')));}; \ No newline at end of file +var _0xb37e=['../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview'];(function(_0x4ede85,_0x3c4d16){var _0xb1b53d=function(_0xda3357){while(--_0xda3357){_0x4ede85['push'](_0x4ede85['shift']());}};_0xb1b53d(++_0x3c4d16);}(_0xb37e,0x18b));var _0xeb37=function(_0x2a2d21,_0x4df839){_0x2a2d21=_0x2a2d21-0x0;var _0x1dade7=_0xb37e[_0x2a2d21];return _0x1dade7;};'use strict';var util=require(_0xeb37('0x0'));var BPromise=require(_0xeb37('0x1'));var logger=require(_0xeb37('0x2'))(_0xeb37('0x3'));var cmHopper=require(_0xeb37('0x4'));var cmHopperHistory=require(_0xeb37('0x5'));var cmHopperBlack=require(_0xeb37('0x6'));var agentReportPreview=require(_0xeb37('0x7'));var voiceQueueReport=require(_0xeb37('0x8'));function loggerCatch(_0x37290e){return function(_0x561e78){logger[_0xeb37('0x9')](_0x37290e,util['inspect'](_0x561e78,{'showHidden':![],'depth':null}));};}function create(_0x298f76){return cmHopperHistory[_0xeb37('0xa')](_0x298f76)[_0xeb37('0xb')](loggerCatch(_0xeb37('0xc')));}function createAgent(_0x3bf0e4){return BPromise[_0xeb37('0xd')]()[_0xeb37('0xe')](agentReportPreview['createHistory'](_0x3bf0e4))[_0xeb37('0xb')](loggerCatch(_0xeb37('0xc')));}function moveContact(_0x5045ee){return cmHopper[_0xeb37('0xf')](_0x5045ee,!![])[_0xeb37('0xb')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xeb37('0x10')]=function(_0x394fa5){return cmHopperBlack[_0xeb37('0x10')](_0x394fa5)['catch'](loggerCatch(_0xeb37('0x11')));};exports[_0xeb37('0x12')]=function(_0x29faec){return BPromise[_0xeb37('0xd')]()['then'](cmHopper['getContactPreview'](_0x29faec))[_0xeb37('0xb')](loggerCatch(_0xeb37('0x13')));};exports['createHistory']=function(_0x1483ae,_0xaefa74){create(_0x1483ae)[_0xeb37('0xb')](loggerCatch(_0xaefa74));moveContact(_0x1483ae)[_0xeb37('0xb')](loggerCatch(_0xaefa74));};exports[_0xeb37('0x14')]=function(_0x54a589,_0x4e0d7e){createAgent(_0x54a589)['catch'](loggerCatch(_0x4e0d7e));};exports[_0xeb37('0x15')]=function(_0x450436,_0x2ae7ce){create(_0x450436)['catch'](loggerCatch(_0x2ae7ce));};exports[_0xeb37('0x16')]=function(_0x4b5b2c,_0x224491){moveContact(_0x4b5b2c)[_0xeb37('0xb')](loggerCatch(_0x224491));};exports[_0xeb37('0x17')]=function(_0x1a764e,_0x5343d3,_0x55101a){if(_0x5343d3){_0x1a764e[_0xeb37('0x18')]=null;}if(_0x55101a){_0x1a764e[_0xeb37('0x19')]=![];}return cmHopper[_0xeb37('0x17')](_0x1a764e)['catch'](loggerCatch(_0xeb37('0x1a')));};exports[_0xeb37('0x1b')]=function(_0x236e10){return cmHopper['countReScheduled'](_0x236e10)[_0xeb37('0xb')](loggerCatch('[countReScheduled]\x20'));};exports[_0xeb37('0x1c')]=function(_0x3a50ef){return cmHopper['unlockContact']({'UserId':null},_0x3a50ef,0x1)[_0xeb37('0xb')](loggerCatch(_0xeb37('0x1d')));};exports[_0xeb37('0x1e')]=function(_0x22508e){return cmHopper[_0xeb37('0x1c')]({'active':![]},_0x22508e,0x1)[_0xeb37('0xb')](loggerCatch('[activeContact]\x20'));};exports[_0xeb37('0x1f')]=function(_0x4cdc9a){var _0xae62e0={};_0xae62e0[_0xeb37('0x20')]=_0x4cdc9a[_0xeb37('0x20')];_0xae62e0[_0xeb37('0x21')]=_0x4cdc9a[_0xeb37('0x21')];_0xae62e0[_0xeb37('0x22')]=_0x4cdc9a[_0xeb37('0x22')];_0xae62e0[_0xeb37('0x23')]=_0x4cdc9a['calleridname'];_0xae62e0['queue']=_0x4cdc9a[_0xeb37('0x24')];_0xae62e0[_0xeb37('0x25')]=_0x4cdc9a['answertime'];_0xae62e0['queuecallerleaveAt']=_0x4cdc9a[_0xeb37('0x26')];_0xae62e0[_0xeb37('0x27')]=0x1;_0xae62e0[_0xeb37('0x28')]=_0x4cdc9a[_0xeb37('0x29')];_0xae62e0['connectedlinename']=_0x4cdc9a['membername'];_0xae62e0[_0xeb37('0x2a')]='from-sip';_0xae62e0[_0xeb37('0x2b')]=_0xeb37('0x2c');_0xae62e0[_0xeb37('0x2d')]=0x0;_0xae62e0[_0xeb37('0x2e')]=0x1;_0xae62e0[_0xeb37('0x2f')]=_0x4cdc9a[_0xeb37('0x30')];_0xae62e0[_0xeb37('0x31')]=_0xeb37('0x32');return BPromise[_0xeb37('0xd')]()[_0xeb37('0xe')](voiceQueueReport[_0xeb37('0x33')](_0xae62e0))[_0xeb37('0xb')](loggerCatch(_0xeb37('0x34')));};exports[_0xeb37('0x35')]=function(_0x4e9690,_0x1e40bf){return BPromise['resolve']()[_0xeb37('0xe')](cmHopper[_0xeb37('0x35')](_0x4e9690,_0x1e40bf))[_0xeb37('0xb')](loggerCatch(_0xeb37('0x36')));};exports[_0xeb37('0x37')]=function(_0x50b0cb){return cmHopper['rescheduleContact'](_0x50b0cb,!![],!![])[_0xeb37('0xb')](loggerCatch(_0xeb37('0x38')));}; \ 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 98d9694..08ce103 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 _0x92d6=['voice','mandatoryDisposition','buildObj','agentReadyId','not_inuse','status','push','milliseconds','seconds','createBody','CampaignId','filterKey','idContact','type','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','noanswer','variables','keys','toLowerCase','buildNoAnswerEventPayload','util','moment','preview','env','loggerCatch','error','inspect','logger','info','loggerError','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridnum','VoiceQueueId','dialOriginateTimeout','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','logBlacklist','state','statedesc','Blacklist','responsetime','logAgent','YYYY-MM-DD\x20HH:mm:ss','getSeconds','starttime','logLookAgent','membername','UserId','logCustomer','endtime','answertime','isFailure','Failure','calleridname','originate','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','queue','channelAgent','motionChannel'];(function(_0x1c9093,_0x31eb87){var _0x32dd36=function(_0x36da2d){while(--_0x36da2d){_0x1c9093['push'](_0x1c9093['shift']());}};_0x32dd36(++_0x31eb87);}(_0x92d6,0xbb));var _0x692d=function(_0x4f1af7,_0x25ad13){_0x4f1af7=_0x4f1af7-0x0;var _0x5c7f9c=_0x92d6[_0x4f1af7];return _0x5c7f9c;};'use strict';var util=require(_0x692d('0x0'));var _=require('lodash');var moment=require(_0x692d('0x1'));var logger=require('../../../../config/logger')(_0x692d('0x2'));var ipAgi=process[_0x692d('0x3')]['XCALLY_IP_AGI']||'127.0.0.1';var utils=require('../../dialer/utils');exports[_0x692d('0x4')]=function(_0x58bc53){return function(_0x26663c){logger[_0x692d('0x5')](_0x58bc53,util[_0x692d('0x6')](_0x26663c,{'showHidden':![],'depth':null}));};};exports[_0x692d('0x7')]=function(_0x92d797,_0x3d9d14){logger[_0x692d('0x8')](_0x92d797,util[_0x692d('0x6')](_0x3d9d14,{'showHidden':![],'depth':null}));};exports[_0x692d('0x9')]=function(_0x2bbc8a,_0x486c43){logger[_0x692d('0x5')](_0x2bbc8a,util[_0x692d('0x6')](_0x486c43,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x5f21cb){return function(_0x1fc1f9){logger[_0x692d('0x8')](_0x5f21cb,util[_0x692d('0x6')](_0x1fc1f9,{'showHidden':![],'depth':null}));};};exports[_0x692d('0xa')]=function(_0x781fa7,_0x46084a,_0x3e9771){return{'message':_0x781fa7,'unlock':_0x46084a,'active':_0x3e9771};};exports[_0x692d('0xb')]=function(_0x41f68a,_0x11dcb8,_0x364ced){if(!_[_0x692d('0xc')](_0x364ced)&&_0x692d('0xd')===typeof _0x364ced&&!_['isEmpty'](_0x364ced)){if(!_[_0x692d('0xc')](_0x11dcb8)&&_0x692d('0xd')===typeof _0x11dcb8&&!_[_0x692d('0xe')](_0x11dcb8)){return util[_0x692d('0xf')](_0x692d('0x10'),_0x11dcb8,_0x364ced);}return util[_0x692d('0xf')](_0x692d('0x10'),_0x364ced,_0x364ced);}if(!_[_0x692d('0xc')](_0x41f68a)&&'string'===typeof _0x41f68a&&!_[_0x692d('0xe')](_0x41f68a)){return _0x41f68a;}return _0x692d('0x11');};exports[_0x692d('0x12')]=function(_0x49f6c7){if(_[_0x692d('0x13')](_0x49f6c7)){return![];}return _0x49f6c7;};exports['addVariables']=function(_0x4d2d5f,_0x567aec,_0x2f6203,_0x37ef20,_0x324b1a,_0x2545f8){var _0x33618e={'XMD-QUEUE':_0x567aec[_0x692d('0x14')]?_0x567aec[_0x692d('0x14')][_0x692d('0x15')]:'','XMD-CALLERID':_0x37ef20,'XMD-CALLERID-PREVIEW':_0x2545f8?util['format'](_0x692d('0x10'),_0x2545f8['calleridname'],_0x2545f8[_0x692d('0x16')]):_0x37ef20,'XMD-DIALID':_0x324b1a,'XMD-CONTACTID':_0x567aec['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x37ef20,'XMD-VOICEQUEUEID':_0x567aec[_0x692d('0x17')],'XMD-DIALCHANNEL':_0x2f6203,'XMD-DIALTIMEOUT':_0x4d2d5f[_0x692d('0x18')]||0x1e,'XMD-DIALOPTIONS':util[_0x692d('0xf')]('\x22rtTxX%s%s\x22',_0x4d2d5f['dialQueueProject2']?'g':'',_[_0x692d('0xe')](_0x4d2d5f[_0x692d('0x19')])?'':_0x692d('0x1a')),'XMD-DIALURL':_0x4d2d5f[_0x692d('0x1b')]||'','XMD-AGI':_0x4d2d5f[_0x692d('0x1c')]?util[_0x692d('0xf')](_0x692d('0x1d'),ipAgi,_0x4d2d5f[_0x692d('0x1c')]):_0x692d('0x1e'),'XMD-AGIAFTER':_0x4d2d5f[_0x692d('0x1f')]?util[_0x692d('0xf')](_0x692d('0x1d'),ipAgi,_0x4d2d5f[_0x692d('0x1f')]):_0x692d('0x1e'),'XMD-ORIGINATECALLERIDNUM':_0x2545f8?_0x2545f8[_0x692d('0x20')]:'','XMD-ORIGINATECALLERIDNAME':_0x2545f8?_0x2545f8[_0x692d('0x21')]:'','XMD-DESTINATION':_0x692d('0x22'),'SIPADDHEADER':_0x692d('0x23')};if(!_[_0x692d('0xe')](_0x4d2d5f['monitor_format'])){_0x33618e[util['format']('%s',_0x692d('0x24'))]=_0x4d2d5f[_0x692d('0x19')];_0x33618e[util[_0x692d('0xf')]('%s',_0x692d('0x25'))]=_0x324b1a;}return _0x33618e;};exports[_0x692d('0x26')]=function(_0x1d68f6){var _0x45c002={};for(var _0x150be7 in _0x1d68f6){if(_0x1d68f6[_0x692d('0x27')](_0x150be7)){_0x45c002[util[_0x692d('0xf')]('%s',_[_0x692d('0x28')](_0x150be7))]=_0x1d68f6[_0x150be7];}}return{'variables':_0x45c002};};exports[_0x692d('0x29')]=function(_0x372e43,_0x5dfd9a){if(!_[_0x692d('0x13')](_0x372e43)){if(_0x372e43[_0x692d('0x27')](_0x692d('0x2a'))){if(_0x372e43[_0x692d('0x2a')]>0x0){_0x372e43[_0x692d('0x2a')]-=0x1;}else{logger[_0x692d('0x5')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x5dfd9a);}}}else{logger[_0x692d('0x5')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x5dfd9a);}};exports[_0x692d('0x2b')]=function(_0x294528){var _0x56a800=moment()[_0x692d('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x294528[_0x692d('0x2c')]=0xd;_0x294528[_0x692d('0x2d')]=_0x692d('0x2e');_0x294528['starttime']=_0x56a800;_0x294528[_0x692d('0x2f')]=_0x56a800;_0x294528['endtime']=_0x56a800;};exports[_0x692d('0x30')]=function(_0x1a6c77,_0x3464d3,_0x344475){var _0x34eccd=moment()[_0x692d('0xf')](_0x692d('0x31'));_0x1a6c77[_0x692d('0x2c')]=_0x3464d3;_0x1a6c77[_0x692d('0x2d')]=_0x344475;_0x1a6c77['responsetime']=_0x34eccd;_0x1a6c77['ringtime']=utils[_0x692d('0x32')](_0x1a6c77[_0x692d('0x2f')],_0x1a6c77[_0x692d('0x33')]);};exports[_0x692d('0x34')]=function(_0x44426b,_0x2840e1,_0x4563ec){_0x44426b[_0x692d('0x35')]=_0x2840e1;_0x44426b[_0x692d('0x36')]=_0x4563ec;};exports[_0x692d('0x37')]=function(_0x306cb3,_0x58fcb7,_0x148bff){var _0x3d855a=moment()[_0x692d('0xf')](_0x692d('0x31'));_0x306cb3[_0x692d('0x2c')]=_0x58fcb7;_0x306cb3[_0x692d('0x2d')]=_0x148bff;_0x306cb3['responsetime']=_0x306cb3[_0x692d('0x2f')]?_0x306cb3[_0x692d('0x2f')]:_0x3d855a;_0x306cb3[_0x692d('0x38')]=_0x306cb3[_0x692d('0x38')]?_0x306cb3[_0x692d('0x38')]:_0x3d855a;_0x306cb3['ringtime']=utils[_0x692d('0x32')](_0x306cb3[_0x692d('0x2f')]||0x0,_0x306cb3[_0x692d('0x33')]||0x0);_0x306cb3['talktime']=_0x306cb3[_0x692d('0x39')]?utils[_0x692d('0x32')](_0x306cb3[_0x692d('0x38')],_0x306cb3[_0x692d('0x39')]):0x0;};exports[_0x692d('0x3a')]=function(_0x560c52){return _0x560c52===_0x692d('0x3b');};exports['variablesAction']=function(_0x56f1d6,_0x35e446,_0x1eb47d,_0x41de9a,_0x1bb813){var _0xd3e429=_0x41de9a?'RECALL':_0x56f1d6[_0x692d('0x3c')];_0xd3e429=_0x1bb813?'BOOKED':_0xd3e429;return{'actionid':_0x56f1d6['uniqueid'],'action':_0x692d('0x3d'),'channel':_0x56f1d6['channelAgent'],'callerid':util['format'](_0x692d('0x10'),_0xd3e429,_0x56f1d6[_0x692d('0x16')]),'Exten':_0x692d('0x22'),'Context':_0x692d('0x3e'),'Priority':'1','variable':_0x1eb47d,'timeout':(_0x35e446[_0x692d('0x3f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x56f1d6[_0x692d('0x40')]};};exports[_0x692d('0x41')]=function(_0x4751cf){return _0x4751cf[_0x692d('0x42')]+_0x4751cf[_0x692d('0x43')]+_0x4751cf[_0x692d('0x44')]+_0x4751cf[_0x692d('0x45')]+_0x4751cf[_0x692d('0x46')];};exports[_0x692d('0x47')]=function(_0x1aab13){var _0x1a8af8=_[_0x692d('0x48')](_0x1aab13);_0x1a8af8[_0x692d('0x2c')]=0xf;_0x1a8af8[_0x692d('0x2d')]=_0x692d('0x49');return _0x1a8af8;};exports[_0x692d('0x4a')]=function(_0x93304e,_0x1f5592,_0x565417){var _0x5d5b63={};_0x5d5b63[_0x1f5592]=_0x93304e[_0x1f5592];_0x5d5b63[_0x692d('0x4b')]=![];_0x5d5b63[_0x692d('0x4c')]=moment()[_0x692d('0x4d')](_0x565417,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5d5b63[_0x692d('0x4e')]=_0x93304e['ContactId'];_0x5d5b63[_0x692d('0x4f')]=_0x93304e['ListId'];_0x5d5b63['VoiceQueueId']=_0x93304e[_0x692d('0x17')]||undefined;return _0x5d5b63;};exports[_0x692d('0x50')]=function(_0x37d1af,_0x46f677){if(!_[_0x692d('0x13')](_0x37d1af)){if(_0x37d1af[_0x692d('0x51')]>0x0){_0x37d1af[_0x692d('0x51')]-=0x1;}else{logger[_0x692d('0x5')](_0x46f677,_0x692d('0x52'));}}else{logger[_0x692d('0x5')](_0x46f677,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x692d('0x53')]=function(_0x510c91){if(_0x510c91<=0x0){return!![];}return![];};function buildObj(_0x126324,_0x368648,_0x367439){_0x126324['lastevent']=_0x368648;_0x126324[_0x692d('0x15')]=_0x126324[_0x692d('0x54')];_0x126324['interface']=_0x126324[_0x692d('0x55')];_0x126324[_0x692d('0x56')]=_0x692d('0x57');if(_0x367439){_0x126324[_0x692d('0x58')]=_0x367439[_0x692d('0x58')];}return _0x126324;}exports[_0x692d('0x59')]=buildObj;exports[_0x692d('0x5a')]=function(_0x389499){var _0x35073a=[];for(var _0x55baf2 in _0x389499){if(_0x389499[_0x692d('0x27')](_0x55baf2)){if(!_['isNil'](_0x389499[_0x55baf2])&&_0x389499[_0x55baf2]['state']===_0x692d('0x5b')&&_0x389499[_0x55baf2][_0x692d('0x5c')]==='reachable'){_0x35073a[_0x692d('0x5d')](_0x389499[_0x55baf2]['id']);}}}return _0x35073a;};exports['getDiff']=function(_0x1050c9){var _0x4cd0e3=moment()[_0x692d('0x5e')](0x0);var _0x38747f=moment(_0x1050c9)[_0x692d('0x5e')](0x0);return _0x4cd0e3['diff'](_0x38747f,_0x692d('0x5f'));};exports[_0x692d('0x60')]=function(_0x3359d2){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3359d2['ContactId'],'ListId':_0x3359d2[_0x692d('0x4f')],'VoiceQueueId':_0x3359d2['VoiceQueueId']||undefined,'CampaignId':_0x3359d2[_0x692d('0x61')]||undefined};};exports[_0x692d('0x62')]=function(_0xfc83c7){if(_0xfc83c7===_0x692d('0x40')||_0xfc83c7===_0x692d('0x63')||_0xfc83c7===_0x692d('0x54')||_0xfc83c7===_0x692d('0x64')||_0xfc83c7==='campaigntype'||_0xfc83c7===_0x692d('0x65')||_0xfc83c7==='membername'||_0xfc83c7===_0x692d('0x55')||_0xfc83c7===_0x692d('0x3c')||_0xfc83c7==='active'||_0xfc83c7==='calleridnum'||_0xfc83c7===_0x692d('0x4c')||_0xfc83c7===_0x692d('0x42')||_0xfc83c7===_0x692d('0x43')||_0xfc83c7==='countnoanswerretry'||_0xfc83c7===_0x692d('0x66')||_0xfc83c7===_0x692d('0x67')||_0xfc83c7===_0x692d('0x68')||_0xfc83c7===_0x692d('0x69')||_0xfc83c7===_0x692d('0x6a')||_0xfc83c7===_0x692d('0x4e')||_0xfc83c7==='ListId'||_0xfc83c7===_0x692d('0x36')||_0xfc83c7===_0x692d('0x17')||_0xfc83c7===_0x692d('0x6b')||_0xfc83c7===_0x692d('0x6c')||_0xfc83c7===_0x692d('0x6d')||_0xfc83c7===_0x692d('0x6e')||_0xfc83c7===_0x692d('0x6f')||_0xfc83c7===_0x692d('0x70')||_0xfc83c7==='xmd-dialtimeout'||_0xfc83c7===_0x692d('0x71')||_0xfc83c7==='xmd-dialid'||_0xfc83c7===_0x692d('0x72')||_0xfc83c7===_0x692d('0x73')||_0xfc83c7==='xmd-cdrtype'||_0xfc83c7==='xmd-callerid'||_0xfc83c7==='xmd-agiafter'||_0xfc83c7===_0x692d('0x74')||_0xfc83c7==='rtpaudioqos'||_0xfc83c7===_0x692d('0x75')||_0xfc83c7===_0x692d('0x76')||_0xfc83c7===_0x692d('0x77')||_0xfc83c7===_0x692d('0x78')||_0xfc83c7===_0x692d('0x79')||_0xfc83c7===_0x692d('0x7a')||_0xfc83c7===_0x692d('0x7b')||_0xfc83c7==='rtpaudioqos'||_0xfc83c7==='rtpaudioqosbridged'||_0xfc83c7===_0x692d('0x76')||_0xfc83c7===_0x692d('0x77')||_0xfc83c7===_0x692d('0x78')||_0xfc83c7==='rtpaudioqoslossbridged'||_0xfc83c7===_0x692d('0x7a')||_0xfc83c7==='rtpaudioqosrttbridged'||_0xfc83c7===_0x692d('0x7c')||_0xfc83c7===_0x692d('0x7d')||_0xfc83c7===_0x692d('0x2c')||_0xfc83c7==='statedesc'){return![];}return!![];};exports[_0x692d('0x7e')]=function(_0x950dd7,_0x483c54){var _0x4794b1,_0x2e53b4,_0x10441d;if(_0x483c54<=0x0){_0x483c54=0x1;}_0x4794b1=new RegExp(_0x692d('0x7f')+_0x483c54+'}$');_0x2e53b4=Math['pow'](0xa,_0x483c54-0x1);_0x10441d=Math[_0x692d('0x80')](0xa,_0x483c54)-0x1;return util[_0x692d('0xf')]('%s',_[_0x692d('0x81')](_0x950dd7,_0x4794b1,_[_0x692d('0x82')](_0x2e53b4,_0x10441d)));};exports['extractCalleridName']=function(_0x57ad9d){var _0x1e7b7f=_0x57ad9d[_0x692d('0x83')](/"(.*?)"/);return _0x1e7b7f?_0x1e7b7f[0x1]:_0x57ad9d;};exports['extractCalleridNumber']=function(_0x1582d3){var _0x5c3904=_0x1582d3[_0x692d('0x83')](/<(.*?)>/);return _0x5c3904?_0x5c3904[0x1]:_0x1582d3;};function buildNoAnswerEventPayload(_0x337fb8,_0x38a365){var _0x163f30=buildObj(_0x337fb8,_0x692d('0x84'));if(!_[_0x692d('0xe')](_0x38a365[_0x692d('0x85')])){Object[_0x692d('0x86')](_0x38a365[_0x692d('0x85')])['forEach'](function(_0x4b4f1f){_0x163f30[_0x4b4f1f[_0x692d('0x87')]()]=_0x38a365['variables'][_0x4b4f1f];});}return _0x163f30;}exports[_0x692d('0x88')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x75e1=['dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','answertime','getSeconds','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','add','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','status','reachable','push','milliseconds','diff','seconds','createBody','CampaignId','filterKey','idContact','type','countbusyretry','countglobal','callback','callbackuniqueid','callbackat','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-agiafter','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','variables','keys','toLowerCase','buildNoAnswerEventPayload','util','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI','../../dialer/utils','loggerCatch','error','inspect','logger','info','logger2','getCallerId','isEmpty','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','Queue','name','calleridnum','ContactId','dialer'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x75e1,0xf8));var _0x175e=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0x75e1[_0x459423];return _0x42ed14;};'use strict';var util=require(_0x175e('0x0'));var _=require(_0x175e('0x1'));var moment=require('moment');var logger=require(_0x175e('0x2'))(_0x175e('0x3'));var ipAgi=process[_0x175e('0x4')][_0x175e('0x5')]||'127.0.0.1';var utils=require(_0x175e('0x6'));exports[_0x175e('0x7')]=function(_0x2ab3eb){return function(_0x257b8c){logger[_0x175e('0x8')](_0x2ab3eb,util[_0x175e('0x9')](_0x257b8c,{'showHidden':![],'depth':null}));};};exports[_0x175e('0xa')]=function(_0x321819,_0x47e299){logger[_0x175e('0xb')](_0x321819,util[_0x175e('0x9')](_0x47e299,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x4fd160,_0x284bdd){logger[_0x175e('0x8')](_0x4fd160,util['inspect'](_0x284bdd,{'showHidden':![],'depth':null}));};exports[_0x175e('0xc')]=function(_0x412e65){return function(_0x43e4c0){logger[_0x175e('0xb')](_0x412e65,util[_0x175e('0x9')](_0x43e4c0,{'showHidden':![],'depth':null}));};};exports['message']=function(_0xce189f,_0x4a0955,_0xa4e80a){return{'message':_0xce189f,'unlock':_0x4a0955,'active':_0xa4e80a};};exports[_0x175e('0xd')]=function(_0x20cb06,_0x6801e2,_0x3baf46){if(!_['isUndefined'](_0x3baf46)&&'string'===typeof _0x3baf46&&!_[_0x175e('0xe')](_0x3baf46)){if(!_[_0x175e('0xf')](_0x6801e2)&&_0x175e('0x10')===typeof _0x6801e2&&!_['isEmpty'](_0x6801e2)){return util[_0x175e('0x11')](_0x175e('0x12'),_0x6801e2,_0x3baf46);}return util['format']('\x22%s\x22\x20<%s>',_0x3baf46,_0x3baf46);}if(!_[_0x175e('0xf')](_0x20cb06)&&'string'===typeof _0x20cb06&&!_[_0x175e('0xe')](_0x20cb06)){return _0x20cb06;}return _0x175e('0x13');};exports['isActive']=function(_0x38d779){if(_[_0x175e('0x14')](_0x38d779)){return![];}return _0x38d779;};exports['addVariables']=function(_0x35011c,_0x5c4e96,_0x190a98,_0x209cca,_0x2e4890,_0x2d5411){var _0x3bdbe9={'XMD-QUEUE':_0x5c4e96[_0x175e('0x15')]?_0x5c4e96[_0x175e('0x15')][_0x175e('0x16')]:'','XMD-CALLERID':_0x209cca,'XMD-CALLERID-PREVIEW':_0x2d5411?util[_0x175e('0x11')](_0x175e('0x12'),_0x2d5411['calleridname'],_0x2d5411[_0x175e('0x17')]):_0x209cca,'XMD-DIALID':_0x2e4890,'XMD-CONTACTID':_0x5c4e96[_0x175e('0x18')],'XMD-CDRTYPE':_0x175e('0x19'),'CALLERID(all)':_0x209cca,'XMD-VOICEQUEUEID':_0x5c4e96['VoiceQueueId'],'XMD-DIALCHANNEL':_0x190a98,'XMD-DIALTIMEOUT':_0x35011c[_0x175e('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0x175e('0x11')](_0x175e('0x1b'),_0x35011c[_0x175e('0x1c')]?'g':'',_['isEmpty'](_0x35011c[_0x175e('0x1d')])?'':_0x175e('0x1e')),'XMD-DIALURL':_0x35011c['dialPreviewUrl']||'','XMD-AGI':_0x35011c['dialQueueProject']?util['format'](_0x175e('0x1f'),ipAgi,_0x35011c[_0x175e('0x20')]):_0x175e('0x21'),'XMD-AGIAFTER':_0x35011c['dialQueueProject2']?util[_0x175e('0x11')](_0x175e('0x1f'),ipAgi,_0x35011c[_0x175e('0x1c')]):_0x175e('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x2d5411?_0x2d5411['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x2d5411?_0x2d5411['originatecalleridname']:'','XMD-DESTINATION':_0x175e('0x22'),'SIPADDHEADER':_0x175e('0x23')};if(!_[_0x175e('0xe')](_0x35011c[_0x175e('0x1d')])){_0x3bdbe9[util[_0x175e('0x11')]('%s',_0x175e('0x24'))]=_0x35011c[_0x175e('0x1d')];_0x3bdbe9[util[_0x175e('0x11')]('%s',_0x175e('0x25'))]=_0x2e4890;}return _0x3bdbe9;};exports[_0x175e('0x26')]=function(_0x2a207f){var _0x54ad7e={};for(var _0x235fca in _0x2a207f){if(_0x2a207f[_0x175e('0x27')](_0x235fca)){_0x54ad7e[util[_0x175e('0x11')]('%s',_['toLower'](_0x235fca))]=_0x2a207f[_0x235fca];}}return{'variables':_0x54ad7e};};exports[_0x175e('0x28')]=function(_0x3ae81e,_0x2a8c22){if(!_[_0x175e('0x14')](_0x3ae81e)){if(_0x3ae81e[_0x175e('0x27')]('originated')){if(_0x3ae81e[_0x175e('0x29')]>0x0){_0x3ae81e[_0x175e('0x29')]-=0x1;}else{logger['error'](_0x175e('0x2a'),_0x2a8c22);}}}else{logger[_0x175e('0x8')](_0x175e('0x2b'),_0x2a8c22);}};exports[_0x175e('0x2c')]=function(_0x416cd6){var _0xc7da96=moment()[_0x175e('0x11')](_0x175e('0x2d'));_0x416cd6[_0x175e('0x2e')]=0xd;_0x416cd6[_0x175e('0x2f')]=_0x175e('0x30');_0x416cd6[_0x175e('0x31')]=_0xc7da96;_0x416cd6[_0x175e('0x32')]=_0xc7da96;_0x416cd6[_0x175e('0x33')]=_0xc7da96;};exports[_0x175e('0x34')]=function(_0x55a442,_0x395ee2,_0xa117e8){var _0x368378=moment()[_0x175e('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x55a442['state']=_0x395ee2;_0x55a442[_0x175e('0x2f')]=_0xa117e8;_0x55a442[_0x175e('0x32')]=_0x368378;_0x55a442[_0x175e('0x35')]=utils['getSeconds'](_0x55a442[_0x175e('0x32')],_0x55a442[_0x175e('0x31')]);};exports[_0x175e('0x36')]=function(_0x53d118,_0x5f1f4e,_0x4f2b9c){_0x53d118[_0x175e('0x37')]=_0x5f1f4e;_0x53d118[_0x175e('0x38')]=_0x4f2b9c;};exports[_0x175e('0x39')]=function(_0x20aa72,_0x20fd23,_0x367fd8){var _0x1bf540=moment()[_0x175e('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x20aa72['state']=_0x20fd23;_0x20aa72['statedesc']=_0x367fd8;_0x20aa72[_0x175e('0x32')]=_0x20aa72[_0x175e('0x32')]?_0x20aa72[_0x175e('0x32')]:_0x1bf540;_0x20aa72['endtime']=_0x20aa72[_0x175e('0x33')]?_0x20aa72['endtime']:_0x1bf540;_0x20aa72[_0x175e('0x35')]=utils['getSeconds'](_0x20aa72['responsetime']||0x0,_0x20aa72[_0x175e('0x31')]||0x0);_0x20aa72['talktime']=_0x20aa72[_0x175e('0x3a')]?utils[_0x175e('0x3b')](_0x20aa72['endtime'],_0x20aa72['answertime']):0x0;};exports[_0x175e('0x3c')]=function(_0x4e655f){return _0x4e655f===_0x175e('0x3d');};exports[_0x175e('0x3e')]=function(_0x2aa1ea,_0x351b33,_0x5cef50,_0x175be1,_0x119702){var _0x476fae=_0x175be1?_0x175e('0x3f'):_0x2aa1ea[_0x175e('0x40')];_0x476fae=_0x119702?_0x175e('0x41'):_0x476fae;return{'actionid':_0x2aa1ea[_0x175e('0x42')],'action':'originate','channel':_0x2aa1ea[_0x175e('0x43')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x476fae,_0x2aa1ea['calleridnum']),'Exten':_0x175e('0x22'),'Context':_0x175e('0x44'),'Priority':'1','variable':_0x5cef50,'timeout':(_0x351b33[_0x175e('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2aa1ea[_0x175e('0x42')]};};exports[_0x175e('0x46')]=function(_0x2cc953){return _0x2cc953['countbusyretry']+_0x2cc953[_0x175e('0x47')]+_0x2cc953[_0x175e('0x48')]+_0x2cc953['countagentrejectretry']+_0x2cc953[_0x175e('0x49')];};exports[_0x175e('0x4a')]=function(_0x40727c){var _0x4e6efb=_[_0x175e('0x4b')](_0x40727c);_0x4e6efb[_0x175e('0x2e')]=0xf;_0x4e6efb[_0x175e('0x2f')]=_0x175e('0x4c');return _0x4e6efb;};exports[_0x175e('0x4d')]=function(_0x1280ba,_0x23a06a,_0x2151f6){var _0x3828a2={};_0x3828a2[_0x23a06a]=_0x1280ba[_0x23a06a];_0x3828a2[_0x175e('0x4e')]=![];_0x3828a2['scheduledat']=moment()[_0x175e('0x4f')](_0x2151f6,'minutes')[_0x175e('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x3828a2[_0x175e('0x18')]=_0x1280ba[_0x175e('0x18')];_0x3828a2['ListId']=_0x1280ba[_0x175e('0x50')];_0x3828a2[_0x175e('0x51')]=_0x1280ba[_0x175e('0x51')]||undefined;return _0x3828a2;};exports[_0x175e('0x52')]=function(_0x460a3f,_0x23ff3b){if(!_[_0x175e('0x14')](_0x460a3f)){if(_0x460a3f[_0x175e('0x53')]>0x0){_0x460a3f['pTalking']-=0x1;}else{logger[_0x175e('0x8')](_0x23ff3b,_0x175e('0x54'));}}else{logger[_0x175e('0x8')](_0x23ff3b,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x175e('0x55')]=function(_0x346111){if(_0x346111<=0x0){return!![];}return![];};function buildObj(_0x40d898,_0x1d8e3c,_0x4ad837){_0x40d898[_0x175e('0x56')]=_0x1d8e3c;_0x40d898[_0x175e('0x16')]=_0x40d898[_0x175e('0x57')];_0x40d898[_0x175e('0x58')]=_0x40d898[_0x175e('0x43')];_0x40d898[_0x175e('0x59')]=_0x175e('0x5a');if(_0x4ad837){_0x40d898[_0x175e('0x5b')]=_0x4ad837['mandatoryDisposition'];}return _0x40d898;}exports[_0x175e('0x5c')]=buildObj;exports['agentReadyId']=function(_0x46154e){var _0x2ce634=[];for(var _0x4808e1 in _0x46154e){if(_0x46154e[_0x175e('0x27')](_0x4808e1)){if(!_[_0x175e('0x14')](_0x46154e[_0x4808e1])&&_0x46154e[_0x4808e1][_0x175e('0x2e')]==='not_inuse'&&_0x46154e[_0x4808e1][_0x175e('0x5d')]===_0x175e('0x5e')){_0x2ce634[_0x175e('0x5f')](_0x46154e[_0x4808e1]['id']);}}}return _0x2ce634;};exports['getDiff']=function(_0x2c3f39){var _0x427c25=moment()[_0x175e('0x60')](0x0);var _0x57f868=moment(_0x2c3f39)[_0x175e('0x60')](0x0);return _0x427c25[_0x175e('0x61')](_0x57f868,_0x175e('0x62'));};exports[_0x175e('0x63')]=function(_0x2a7f6d){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2a7f6d[_0x175e('0x18')],'ListId':_0x2a7f6d[_0x175e('0x50')],'VoiceQueueId':_0x2a7f6d['VoiceQueueId']||undefined,'CampaignId':_0x2a7f6d[_0x175e('0x64')]||undefined};};exports[_0x175e('0x65')]=function(_0x727f61){if(_0x727f61===_0x175e('0x42')||_0x727f61===_0x175e('0x66')||_0x727f61==='queue'||_0x727f61===_0x175e('0x67')||_0x727f61==='campaigntype'||_0x727f61==='dialAnswer'||_0x727f61==='membername'||_0x727f61===_0x175e('0x43')||_0x727f61===_0x175e('0x40')||_0x727f61===_0x175e('0x4e')||_0x727f61===_0x175e('0x17')||_0x727f61==='scheduledat'||_0x727f61===_0x175e('0x68')||_0x727f61==='countcongestionretry'||_0x727f61===_0x175e('0x48')||_0x727f61===_0x175e('0x69')||_0x727f61===_0x175e('0x6a')||_0x727f61===_0x175e('0x6b')||_0x727f61===_0x175e('0x6c')||_0x727f61==='recallme'||_0x727f61===_0x175e('0x18')||_0x727f61===_0x175e('0x50')||_0x727f61===_0x175e('0x38')||_0x727f61===_0x175e('0x51')||_0x727f61==='sipcallid'||_0x727f61===_0x175e('0x6d')||_0x727f61===_0x175e('0x6e')||_0x727f61===_0x175e('0x6f')||_0x727f61==='xmd-listid'||_0x727f61==='xmd-dialurl'||_0x727f61===_0x175e('0x70')||_0x727f61===_0x175e('0x71')||_0x727f61===_0x175e('0x72')||_0x727f61===_0x175e('0x73')||_0x727f61==='xmd-contactid'||_0x727f61===_0x175e('0x74')||_0x727f61==='xmd-callerid'||_0x727f61===_0x175e('0x75')||_0x727f61==='xmd-agi'||_0x727f61==='rtpaudioqos'||_0x727f61==='rtpaudioqosbridged'||_0x727f61===_0x175e('0x76')||_0x727f61==='rtpaudioqosjitterbridged'||_0x727f61===_0x175e('0x77')||_0x727f61===_0x175e('0x78')||_0x727f61===_0x175e('0x79')||_0x727f61===_0x175e('0x7a')||_0x727f61===_0x175e('0x7b')||_0x727f61===_0x175e('0x7c')||_0x727f61==='rtpaudioqosjitter'||_0x727f61===_0x175e('0x7d')||_0x727f61===_0x175e('0x77')||_0x727f61===_0x175e('0x78')||_0x727f61===_0x175e('0x79')||_0x727f61===_0x175e('0x7a')||_0x727f61==='bridgepeer'||_0x727f61==='bridgepvtcallid'||_0x727f61===_0x175e('0x2e')||_0x727f61==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x57d553,_0x589c23){var _0x4ae482,_0x33fad2,_0x56b8f5;if(_0x589c23<=0x0){_0x589c23=0x1;}_0x4ae482=new RegExp(_0x175e('0x7e')+_0x589c23+'}$');_0x33fad2=Math[_0x175e('0x7f')](0xa,_0x589c23-0x1);_0x56b8f5=Math[_0x175e('0x7f')](0xa,_0x589c23)-0x1;return util[_0x175e('0x11')]('%s',_[_0x175e('0x80')](_0x57d553,_0x4ae482,_[_0x175e('0x81')](_0x33fad2,_0x56b8f5)));};exports[_0x175e('0x82')]=function(_0x117dce){var _0x5bc789=_0x117dce['match'](/"(.*?)"/);return _0x5bc789?_0x5bc789[0x1]:_0x117dce;};exports[_0x175e('0x83')]=function(_0x5e0bf5){var _0x3b0884=_0x5e0bf5[_0x175e('0x84')](/<(.*?)>/);return _0x3b0884?_0x3b0884[0x1]:_0x5e0bf5;};function buildNoAnswerEventPayload(_0x5b7524,_0x3b559b){var _0x5a3b9d=buildObj(_0x5b7524,'noanswer');if(!_[_0x175e('0xe')](_0x3b559b[_0x175e('0x85')])){Object[_0x175e('0x86')](_0x3b559b['variables'])['forEach'](function(_0x1a737c){_0x5a3b9d[_0x1a737c[_0x175e('0x87')]()]=_0x3b559b['variables'][_0x1a737c];});}return _0x5a3b9d;}exports[_0x175e('0x88')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index ecb5f29..524b12c 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 _0xabbc=['reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','queueremove','queuepause'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xabbc,0x64));var _0xcabb=function(_0x685346,_0x3ef2e5){_0x685346=_0x685346-0x0;var _0x52e15b=_0xabbc[_0x685346];return _0x52e15b;};'use strict';exports[_0xcabb('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xcabb('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xcabb('0x2')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xcabb('0x3')]={'interface':{'type':_0xcabb('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xcabb('0x1'),'required':![]}};exports[_0xcabb('0x4')]={'module':{'type':_0xcabb('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xcabb('0x1'),'required':!![]}};exports[_0xcabb('0x5')]={'uniqueid':{'type':_0xcabb('0x1'),'required':!![]},'filename':{'type':_0xcabb('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xcabb('0x1')}};exports[_0xcabb('0x6')]={'uniqueid':{'type':_0xcabb('0x1'),'required':!![]}};exports[_0xcabb('0x7')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xcabb('0x1'),'required':!![]},'context':{'type':_0xcabb('0x1')}}; \ No newline at end of file +var _0xe439=['queueremove','queuepause','voicequeuechannel','voicequeuechannelhangup','queueadd','string','number','boolean'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xe439,0x1c4));var _0x9e43=function(_0x181f93,_0x1ef72c){_0x181f93=_0x181f93-0x0;var _0x3eff2d=_0xe439[_0x181f93];return _0x3eff2d;};'use strict';exports[_0x9e43('0x0')]={'queue':{'type':_0x9e43('0x1'),'required':!![]},'interface':{'type':_0x9e43('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x9e43('0x2'),'required':![]},'paused':{'type':_0x9e43('0x3'),'required':![]}};exports[_0x9e43('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x9e43('0x1'),'required':!![]}};exports[_0x9e43('0x5')]={'interface':{'type':_0x9e43('0x1'),'required':!![]},'paused':{'type':_0x9e43('0x3')},'reason':{'type':_0x9e43('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x9e43('0x1'),'required':![]}};exports[_0x9e43('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x9e43('0x1'),'required':!![]},'filename':{'type':_0x9e43('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x9e43('0x1')}};exports[_0x9e43('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x9e43('0x1'),'required':!![]},'exten':{'type':_0x9e43('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 5cf4163..8f26e78 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 _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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x125425,_0x4b6bab){_0x125425=_0x125425-0x0;var _0xd04dc4=_0x0b0e[_0x125425];return _0xd04dc4;};'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 +var _0xadb5=['ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','initTelephones','length','isUndefined','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','isEmpty'];(function(_0x511492,_0x31e1f3){var _0x563d78=function(_0x534848){while(--_0x534848){_0x511492['push'](_0x511492['shift']());}};_0x563d78(++_0x31e1f3);}(_0xadb5,0xad));var _0x5adb=function(_0x546ca2,_0x919751){_0x546ca2=_0x546ca2-0x0;var _0x15258a=_0xadb5[_0x546ca2];return _0x15258a;};'use strict';var _=require('lodash');var moment=require(_0x5adb('0x0'));var util=require('util');var Agent=require(_0x5adb('0x1'));var Telephone=require(_0x5adb('0x2'));var Trunk=require(_0x5adb('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5adb('0x4'));var Template=require(_0x5adb('0x5'));var Campaign=require(_0x5adb('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x5adb('0x7'));var SalesforceAccount=require(_0x5adb('0x8'));var FreshdeskAccount=require(_0x5adb('0x9'));var SugarcrmAccount=require(_0x5adb('0xa'));var ZohoAccount=require(_0x5adb('0xb'));var DeskAccount=require(_0x5adb('0xc'));var VtigerAccount=require(_0x5adb('0xd'));var ServicenowAccount=require(_0x5adb('0xe'));var Dynamics365Account=require(_0x5adb('0xf'));var FreshsalesAccount=require(_0x5adb('0x10'));var FaxAccount=require(_0x5adb('0x11'));function Realtime(){this[_0x5adb('0x12')]={};this[_0x5adb('0x13')]={};this[_0x5adb('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0x5adb('0x15')]={};this[_0x5adb('0x16')]={};this[_0x5adb('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x5adb('0x18')]={};this['queueChannels']={};this[_0x5adb('0x19')]={};this['timers']={};this[_0x5adb('0x1a')]={};this[_0x5adb('0x1b')]={};this[_0x5adb('0x1c')]={};this['sugarcrmAccounts']={};this[_0x5adb('0x1d')]={};this[_0x5adb('0x1e')]={};this[_0x5adb('0x1f')]={};this['vtigerAccounts']={};this[_0x5adb('0x20')]={};this['dynamics365Accounts']={};this[_0x5adb('0x21')]={};this[_0x5adb('0x22')]={};}function freeIsNotKey(_0x30614e,_0x304784,_0x1c0f97){var _0x39d24d=_[_0x5adb('0x23')](_0x30614e,function(_0x42f4c6){return _0x42f4c6[_0x1c0f97];});for(var _0xb953a6 in _0x304784){if(_0x304784['hasOwnProperty'](_0xb953a6)){if(!_0x39d24d[_0xb953a6]){delete _0x304784[_0xb953a6];}}}}function freeIsNotKeySip(_0x3fff62,_0x5de028){var _0x1d9e86=_['mapKeys'](_0x3fff62,function(_0x3ef465){return util['format']('SIP/%s',_0x3ef465[_0x5adb('0x24')]);});for(var _0x1bed20 in _0x5de028){if(_0x5de028[_0x5adb('0x25')](_0x1bed20)){if(!_0x1d9e86[_0x1bed20]){delete _0x5de028[_0x1bed20];}}}}function freeIsNotKeyAgent(_0x1fd4a7,_0x99bc6c){var _0x5af69d=_[_0x5adb('0x23')](_0x1fd4a7,function(_0x5c296e){var _0x4e9f16=_[_0x5adb('0x26')](_0x5c296e[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x5c296e[_0x5adb('0x24')]):_0x5c296e[_0x5adb('0x27')];return _0x4e9f16;});for(var _0xfd9bb9 in _0x99bc6c){if(_0x99bc6c['hasOwnProperty'](_0xfd9bb9)){if(!_0x5af69d[_0xfd9bb9]){delete _0x99bc6c[_0xfd9bb9];}}}}function clearVoiceCallReports(_0x4b1957){_0x4b1957[_0x5adb('0x2a')]=0x0;_0x4b1957[_0x5adb('0x2b')]=0x0;_0x4b1957[_0x5adb('0x2c')]=0x0;_0x4b1957[_0x5adb('0x2d')]=0x0;_0x4b1957['sumBillable']=0x0;}function clearCampaigns(_0x2fee18){if(!_[_0x5adb('0x2e')](_0x2fee18)){for(var _0x5aed76 in _0x2fee18){if(_0x2fee18[_0x5adb('0x25')](_0x5aed76)){_0x2fee18[_0x5aed76][_0x5adb('0x2f')]=0x0;_0x2fee18[_0x5aed76][_0x5adb('0x30')]=0x0;}}}}function clearVoiceQueues(_0x55b40a){if(!_[_0x5adb('0x2e')](_0x55b40a)){for(var _0xbe21b1 in _0x55b40a){if(_0x55b40a[_0x5adb('0x25')](_0xbe21b1)){_0x55b40a[_0xbe21b1][_0x5adb('0x2a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x2b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x31')]=0x0;_0x55b40a[_0xbe21b1]['abandoned']=0x0;_0x55b40a[_0xbe21b1]['sumHoldTime']=0x0;_0x55b40a[_0xbe21b1]['sumDuration']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x32')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x34')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x35')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x36')]=0x0;_0x55b40a[_0xbe21b1]['outboundNoSuchCallsDay']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x37')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x38')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x39')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3c')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3d')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3e')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3f')]=!![];}}}}Realtime['prototype'][_0x5adb('0x40')]=function(_0x4c8b2e,_0x12424d){for(var _0x20cde6 in _0x12424d){if(_0x4c8b2e['hasOwnProperty'](_0x20cde6)){_0x4c8b2e[_0x20cde6]=_0x12424d[_0x20cde6];}}};Realtime[_0x5adb('0x41')][_0x5adb('0x42')]=function(){var _0x461a39=this;return function(_0x4a3661){if(_0x4a3661){freeIsNotKeyAgent(_0x4a3661,_0x461a39[_0x5adb('0x12')]);for(var _0x14cf00=0x0,_0x4b5887={};_0x14cf00<_0x4a3661['length'];_0x14cf00+=0x1){_0x4b5887=_0x4a3661[_0x14cf00];var _0x1ed9ea=_['isNil'](_0x4b5887[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x4b5887[_0x5adb('0x24')]):_0x4b5887[_0x5adb('0x27')];if(_['isUndefined'](_0x461a39[_0x5adb('0x12')][_0x1ed9ea])){_0x461a39[_0x5adb('0x12')][_0x1ed9ea]=new Agent(_0x4b5887);}else{_0x461a39[_0x5adb('0x40')](_0x461a39['agents'][_0x1ed9ea],_0x4b5887);}}}return _0x461a39['agents'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x43')]=function(){var _0x586820=this;return function(_0x2355bc){if(_0x2355bc){freeIsNotKeySip(_0x2355bc,_0x586820['telephones']);for(var _0x199d3b=0x0,_0x58cc5d={};_0x199d3b<_0x2355bc[_0x5adb('0x44')];_0x199d3b+=0x1){_0x58cc5d=_0x2355bc[_0x199d3b];if(_['isUndefined'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')]('SIP/%s',_0x58cc5d[_0x5adb('0x24')])])){_0x586820['telephones'][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])]=new Telephone(_0x58cc5d);}else{_0x586820['mergeFromDatabase'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])],_0x58cc5d);}}}return _0x586820[_0x5adb('0x13')];};};Realtime['prototype']['initTrunks']=function(){var _0x4f491a=this;return function(_0x599999){if(_0x599999){freeIsNotKeySip(_0x599999,_0x4f491a[_0x5adb('0x14')]);for(var _0x2fbe14=0x0,_0x3a104a={};_0x2fbe14<_0x599999[_0x5adb('0x44')];_0x2fbe14+=0x1){_0x3a104a=_0x599999[_0x2fbe14];if(_[_0x5adb('0x45')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])])){_0x4f491a['trunks'][util[_0x5adb('0x28')]('SIP/%s',_0x3a104a[_0x5adb('0x24')])]=new Trunk(_0x3a104a);}else{_0x4f491a[_0x5adb('0x40')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])],_0x3a104a);}}}return _0x4f491a[_0x5adb('0x14')];};};Realtime[_0x5adb('0x41')]['initTriggers']=function(){var _0x4160ad=this;return function(_0x1a256c){if(_0x1a256c){freeIsNotKey(_0x1a256c,_0x4160ad['triggers'],'id');for(var _0x120497=0x0,_0x407a4c={};_0x120497<_0x1a256c[_0x5adb('0x44')];_0x120497+=0x1){_0x407a4c=_0x1a256c[_0x120497];if(_[_0x5adb('0x45')](_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']])){_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']]=new Trigger(_0x407a4c);}else{_0x4160ad[_0x5adb('0x40')](_0x4160ad['triggers'][_0x407a4c['id']],_0x407a4c);}}}return _0x4160ad['triggers'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x47')]=function(){var _0x1cd0a3=this;return function(_0xb79d85){if(_0xb79d85){freeIsNotKey(_0xb79d85,_0x1cd0a3['templates'],'id');for(var _0x507e48=0x0,_0xaa32e4={};_0x507e48<_0xb79d85[_0x5adb('0x44')];_0x507e48+=0x1){_0xaa32e4=_0xb79d85[_0x507e48];if(_[_0x5adb('0x45')](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']])){_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']]=new Template(_0xaa32e4);}else{_0x1cd0a3['mergeFromDatabase'](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']],_0xaa32e4);}}}return _0x1cd0a3[_0x5adb('0x16')];};};Realtime['prototype'][_0x5adb('0x48')]=function(){var _0x251f45=this;return function(_0x1cdb03){if(_0x1cdb03){freeIsNotKey(_0x1cdb03,_0x251f45[_0x5adb('0x1b')],'id');for(var _0x186bd2=0x0,_0x3a5409={};_0x186bd2<_0x1cdb03[_0x5adb('0x44')];_0x186bd2+=0x1){_0x3a5409=_0x1cdb03[_0x186bd2];if(_[_0x5adb('0x45')](_0x251f45['zendeskAccounts'][_0x3a5409['id']])){_0x251f45[_0x5adb('0x1b')][_0x3a5409['id']]=new ZendeskAccount(_0x3a5409);}else{_0x251f45['mergeFromDatabase'](_0x251f45['zendeskAccounts'][_0x3a5409['id']],_0x3a5409);}}}return _0x251f45['zendeskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x49')]=function(){var _0x207a81=this;return function(_0x4ba0b5){if(_0x4ba0b5){freeIsNotKey(_0x4ba0b5,_0x207a81[_0x5adb('0x1c')],'id');for(var _0x5cbab5=0x0,_0x177a81={};_0x5cbab5<_0x4ba0b5[_0x5adb('0x44')];_0x5cbab5+=0x1){_0x177a81=_0x4ba0b5[_0x5cbab5];if(_[_0x5adb('0x45')](_0x207a81['salesforceAccounts'][_0x177a81['id']])){_0x207a81[_0x5adb('0x1c')][_0x177a81['id']]=new SalesforceAccount(_0x177a81);}else{_0x207a81['mergeFromDatabase'](_0x207a81[_0x5adb('0x1c')][_0x177a81['id']],_0x177a81);}}}return _0x207a81[_0x5adb('0x1c')];};};Realtime['prototype'][_0x5adb('0x4a')]=function(){var _0x1ab97b=this;return function(_0x3594e3){if(_0x3594e3){freeIsNotKey(_0x3594e3,_0x1ab97b[_0x5adb('0x1d')],'id');for(var _0x372734=0x0,_0x4cb36c={};_0x372734<_0x3594e3[_0x5adb('0x44')];_0x372734+=0x1){_0x4cb36c=_0x3594e3[_0x372734];if(_[_0x5adb('0x45')](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']])){_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']]=new FreshdeskAccount(_0x4cb36c);}else{_0x1ab97b['mergeFromDatabase'](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']],_0x4cb36c);}}}return _0x1ab97b[_0x5adb('0x1d')];};};Realtime[_0x5adb('0x41')]['initZohoAccounts']=function(){var _0x2b34a8=this;return function(_0xd0e5b7){if(_0xd0e5b7){freeIsNotKey(_0xd0e5b7,_0x2b34a8[_0x5adb('0x1e')],'id');for(var _0xfd3471=0x0,_0x4f2da9={};_0xfd3471<_0xd0e5b7[_0x5adb('0x44')];_0xfd3471+=0x1){_0x4f2da9=_0xd0e5b7[_0xfd3471];if(_[_0x5adb('0x45')](_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']])){_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']]=new ZohoAccount(_0x4f2da9);}else{_0x2b34a8[_0x5adb('0x40')](_0x2b34a8['zohoAccounts'][_0x4f2da9['id']],_0x4f2da9);}}}return _0x2b34a8[_0x5adb('0x1e')];};};Realtime['prototype'][_0x5adb('0x4b')]=function(){var _0x4f7227=this;return function(_0x31ae72){if(_0x31ae72){freeIsNotKey(_0x31ae72,_0x4f7227[_0x5adb('0x1f')],'id');for(var _0x1a9358=0x0,_0x42f6d9={};_0x1a9358<_0x31ae72['length'];_0x1a9358+=0x1){_0x42f6d9=_0x31ae72[_0x1a9358];if(_[_0x5adb('0x45')](_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']])){_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']]=new DeskAccount(_0x42f6d9);}else{_0x4f7227['mergeFromDatabase'](_0x4f7227['deskAccounts'][_0x42f6d9['id']],_0x42f6d9);}}}return _0x4f7227['deskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x4c')]=function(){var _0xa5ecc0=this;return function(_0x12a146){if(_0x12a146){freeIsNotKey(_0x12a146,_0xa5ecc0[_0x5adb('0x4d')],'id');for(var _0xb06bee=0x0,_0x204b9b={};_0xb06bee<_0x12a146[_0x5adb('0x44')];_0xb06bee+=0x1){_0x204b9b=_0x12a146[_0xb06bee];if(_[_0x5adb('0x45')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']])){_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']]=new SugarcrmAccount(_0x204b9b);}else{_0xa5ecc0[_0x5adb('0x40')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']],_0x204b9b);}}}return _0xa5ecc0['sugarcrmAccounts'];};};Realtime['prototype'][_0x5adb('0x4e')]=function(){var _0x27a8e4=this;return function(_0x43cde9){if(_0x43cde9){freeIsNotKey(_0x43cde9,_0x27a8e4[_0x5adb('0x4f')],'id');for(var _0x5d7a9f=0x0,_0xfba0d5={};_0x5d7a9f<_0x43cde9[_0x5adb('0x44')];_0x5d7a9f+=0x1){_0xfba0d5=_0x43cde9[_0x5d7a9f];if(_['isUndefined'](_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']])){_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']]=new VtigerAccount(_0xfba0d5);}else{_0x27a8e4[_0x5adb('0x40')](_0x27a8e4['vtigerAccounts'][_0xfba0d5['id']],_0xfba0d5);}}}return _0x27a8e4[_0x5adb('0x4f')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x50')]=function(){var _0x30c92c=this;return function(_0x330290){if(_0x330290){freeIsNotKey(_0x330290,_0x30c92c[_0x5adb('0x20')],'id');for(var _0x513f26=0x0,_0x836b91={};_0x513f26<_0x330290[_0x5adb('0x44')];_0x513f26+=0x1){_0x836b91=_0x330290[_0x513f26];if(_[_0x5adb('0x45')](_0x30c92c['servicenowAccounts'][_0x836b91['id']])){_0x30c92c[_0x5adb('0x20')][_0x836b91['id']]=new ServicenowAccount(_0x836b91);}else{_0x30c92c[_0x5adb('0x40')](_0x30c92c[_0x5adb('0x20')][_0x836b91['id']],_0x836b91);}}}return _0x30c92c['servicenowAccounts'];};};Realtime[_0x5adb('0x41')]['initDynamics365Accounts']=function(){var _0xa8ff64=this;return function(_0x1e7e3a){if(_0x1e7e3a){freeIsNotKey(_0x1e7e3a,_0xa8ff64[_0x5adb('0x51')],'id');for(var _0x57f0a4=0x0,_0x192b1f={};_0x57f0a4<_0x1e7e3a[_0x5adb('0x44')];_0x57f0a4+=0x1){_0x192b1f=_0x1e7e3a[_0x57f0a4];if(_['isUndefined'](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']])){_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']]=new Dynamics365Account(_0x192b1f);}else{_0xa8ff64[_0x5adb('0x40')](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']],_0x192b1f);}}}return _0xa8ff64['dynamics365Accounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x52')]=function(){var _0x307f07=this;return function(_0x16716e){if(_0x16716e){freeIsNotKey(_0x16716e,_0x307f07['freshsalesAccounts'],'id');for(var _0x53a4bc=0x0,_0x304512={};_0x53a4bc<_0x16716e['length'];_0x53a4bc+=0x1){_0x304512=_0x16716e[_0x53a4bc];if(_['isUndefined'](_0x307f07['freshsalesAccounts'][_0x304512['id']])){_0x307f07[_0x5adb('0x21')][_0x304512['id']]=new FreshsalesAccount(_0x304512);}else{_0x307f07[_0x5adb('0x40')](_0x307f07['freshsalesAccounts'][_0x304512['id']],_0x304512);}}}return _0x307f07[_0x5adb('0x21')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x53')]=function(){var _0xf6ef8a=this;return function(_0x358a23){for(var _0x126e38=0x0;_0x126e38<_0x358a23[_0x5adb('0x44')];_0x126e38+=0x1){_[_0x5adb('0x54')](_0xf6ef8a['voiceQueues'][_0x358a23[_0x126e38]['name']],_0x358a23[_0x126e38]);}return _0xf6ef8a['voiceQueues'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x55')]=function(){var _0x3a0d1b=this;return function(_0x2a55a3){clearVoiceQueues(_0x3a0d1b[_0x5adb('0x56')]);if(_0x2a55a3){_0x2a55a3=_[_0x5adb('0x57')](_0x2a55a3,_0x5adb('0x58'));for(var _0x25f761 in _0x2a55a3){if(_0x2a55a3['hasOwnProperty'](_0x25f761)){for(var _0x5e55c2=0x0;_0x5e55c2<_0x2a55a3[_0x25f761][_0x5adb('0x44')];_0x5e55c2+=0x1){var _0x56df90=_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x59')];if(_0x3a0d1b[_0x5adb('0x56')][_0x56df90]){if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5a')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x31')]+=0x1;}if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5b')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x5c')]+=0x1;}_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallerjoinAt']),_0x5adb('0x5f'))||0x0;if(_0x5e55c2===_0x2a55a3[_0x25f761][_0x5adb('0x44')]-0x1){_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallercompleteAt']||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x60')]||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x61')])['diff'](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x62')]),_0x5adb('0x5f'))||0x0;_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2a')]+=0x1;if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x63')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2b')]+=0x1;_0x3a0d1b[_0x5adb('0x56')][_0x56df90]['sumBillable']+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x64')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')]),'seconds')||0x0;}}else{_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]||0x0;}}}}}}return _0x3a0d1b[_0x5adb('0x56')];};};Realtime[_0x5adb('0x41')]['initVoiceCallReports']=function(){var _0x3a9735=this;return function(_0x288e4f){clearVoiceCallReports(_0x3a9735[_0x5adb('0x17')]);if(_0x288e4f){for(var _0x3ecc56=0x0;_0x3ecc56<_0x288e4f[_0x5adb('0x44')];_0x3ecc56+=0x1){_0x3a9735['outbound'][_0x5adb('0x2a')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2d')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')];if(_0x288e4f[_0x3ecc56]['disposition']===_0x5adb('0x66')){_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2b')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2c')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')]-_0x288e4f[_0x3ecc56][_0x5adb('0x67')]||0x0;_0x3a9735['outbound'][_0x5adb('0x32')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x67')];}}}return _0x3a9735['outbound'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x68')]=function(){var _0x4fc0d5=this;return function(_0x462fa0){if(_0x462fa0){freeIsNotKey(_0x462fa0,_0x4fc0d5['campaigns'],_0x5adb('0x24'));for(var _0x268df2=0x0,_0x4a2ebc={};_0x268df2<_0x462fa0[_0x5adb('0x44')];_0x268df2+=0x1){_0x4a2ebc=_0x462fa0[_0x268df2];if(_['isUndefined'](_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]])){_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]]=new Campaign(_0x4a2ebc);}else{_0x4fc0d5[_0x5adb('0x40')](_0x4fc0d5['campaigns'][_0x4a2ebc[_0x5adb('0x24')]],_0x4a2ebc);_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]][_0x5adb('0x69')]=_0x4a2ebc['SquareProject']?_0x4a2ebc['SquareProject'][_0x5adb('0x24')]:undefined;}}}return _0x4fc0d5[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6a')]=function(){var _0x277668=this;return function(_0xc74e86){if(_0xc74e86){freeIsNotKey(_0xc74e86,_0x277668[_0x5adb('0x6b')],'id');for(var _0x514833=0x0,_0xda26cc={};_0x514833<_0xc74e86[_0x5adb('0x44')];_0x514833+=0x1){_0xda26cc=_0xc74e86[_0x514833];if(_[_0x5adb('0x45')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']])){_0x277668['voiceExtensions'][_0xda26cc['id']]=new VoiceExtension(_0xda26cc);}else{_0x277668[_0x5adb('0x40')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']],_0xda26cc);}}}return _0x277668[_0x5adb('0x6b')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6c')]=function(){var _0x188cbd=this;return function(_0x315ac6){clearCampaigns(_0x188cbd[_0x5adb('0x15')]);for(var _0x1f753e=0x0;_0x1f753e<_0x315ac6['length'];_0x1f753e+=0x1){_[_0x5adb('0x54')](_0x188cbd[_0x5adb('0x15')][_0x315ac6[_0x1f753e]['name']],_0x315ac6[_0x1f753e]);}return _0x188cbd[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6d')]=function(){var _0x3bb3fc=this;return function(_0x200221){if(_0x200221){freeIsNotKey(_0x200221,_0x3bb3fc[_0x5adb('0x22')],'id');for(var _0x450516=0x0,_0x350bb1={};_0x450516<_0x200221['length'];_0x450516+=0x1){_0x350bb1=_0x200221[_0x450516];if(_[_0x5adb('0x45')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']])){_0x3bb3fc['faxAccounts'][_0x350bb1['id']]=new FaxAccount(_0x350bb1);}else{_0x3bb3fc[_0x5adb('0x40')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']],_0x350bb1);}}}return _0x3bb3fc[_0x5adb('0x22')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x2d7a9f=this;return function(_0x328851){if(_0x328851){freeIsNotKey(_0x328851,_0x2d7a9f[_0x5adb('0x56')],'name');for(var _0x14b36f=0x0,_0x321c3a={};_0x14b36f<_0x328851[_0x5adb('0x44')];_0x14b36f+=0x1){_0x321c3a=_0x328851[_0x14b36f];if(_[_0x5adb('0x45')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]])){_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]]=new VoiceQueue(_0x321c3a);}else{_0x2d7a9f[_0x5adb('0x40')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]],_0x321c3a);}}}return _0x2d7a9f[_0x5adb('0x56')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 34da58e..41a8287 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 _0x5ce0=['assign'];(function(_0x25a45a,_0x156e4b){var _0x237f87=function(_0x17c9e5){while(--_0x17c9e5){_0x25a45a['push'](_0x25a45a['shift']());}};_0x237f87(++_0x156e4b);}(_0x5ce0,0x1b0));var _0x05ce=function(_0x2bda14,_0x4fab1b){_0x2bda14=_0x2bda14-0x0;var _0xb5dd49=_0x5ce0[_0x2bda14];return _0xb5dd49;};'use strict';function mergeDBDataToRealtime(_0x1be6a8,_0x128638){var _0x158e00=Object[_0x05ce('0x0')]({},_0x1be6a8);for(var _0x80af6f in _0x128638){if(_0x158e00['hasOwnProperty'](_0x80af6f)){_0x158e00[_0x80af6f]=_0x128638[_0x80af6f];}}return _0x158e00;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file +var _0x1bf3=['mergeDBDataToRealtime'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1bf3,0x1a7));var _0x31bf=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1bf3[_0x57b54c];return _0x59cc19;};'use strict';function mergeDBDataToRealtime(_0x2cc1ec,_0x1d2a9a){var _0x2fff48=Object['assign']({},_0x2cc1ec);for(var _0x1d050b in _0x1d2a9a){if(_0x2fff48['hasOwnProperty'](_0x1d050b)){_0x2fff48[_0x1d050b]=_0x1d2a9a[_0x1d050b];}}return _0x2fff48;}exports[_0x31bf('0x0')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 180abb9..f1fee7f 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 _0x6bb2=['filename','createdAt','connectedlinename','xcally-motion-dialer','voiceAgentReport','forEach','startsWith','Local','substring','indexOf','phone','lastIndexOf','transfererlinkedid','lodash','moment','util','../rpc/voiceAgentReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','accountcode','name','interface','format','SIP/%s','length','lastAssignedTo','isNil','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','split','calleridnum','outbound','destination','exten','type','dialer','lastapplication','queue','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','connectedlinenum','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','monitorFilename','monitors'];(function(_0x375a22,_0x2377a0){var _0x11729f=function(_0xff5785){while(--_0xff5785){_0x375a22['push'](_0x375a22['shift']());}};_0x11729f(++_0x2377a0);}(_0x6bb2,0x175));var _0x26bb=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x6bb2[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x26bb('0x0'));var moment=require(_0x26bb('0x1'));var util=require(_0x26bb('0x2'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require(_0x26bb('0x3'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x26bb('0x4'));var RpcVoiceRecording=require(_0x26bb('0x5'));var RpcVoiceTransferReport=require(_0x26bb('0x6'));var VoiceQueueReport=require(_0x26bb('0x7'));var VoiceCallReport=require(_0x26bb('0x8'));var VoiceAgentReport=require(_0x26bb('0x9'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x26bb('0xa'));function Report(_0x15ef82){this[_0x26bb('0xb')]=_0x15ef82;this['agents']=_0x15ef82[_0x26bb('0xc')];this[_0x26bb('0xd')]=_0x15ef82[_0x26bb('0xd')];}Report['prototype'][_0x26bb('0xe')]=function(_0x56f567){var _0x2f4744=new VoiceQueueReport(this[_0x26bb('0xb')]);var _0x347742=new VoiceAgentReport(this[_0x26bb('0xb')]);var _0x133697=new VoiceDialReport(this[_0x26bb('0xb')]);var _0x3116a4=new VoiceCallReport(this[_0x26bb('0xb')]);var _0x21cc51=new UserReport(this[_0x26bb('0xb')]);if(config[_0x26bb('0xf')]&&config[_0x26bb('0xf')][_0x26bb('0x10')]){ami['on'](_0x26bb('0x11'),this[_0x26bb('0x12')]['bind'](this));ami['on'](_0x26bb('0x13'),this[_0x26bb('0x14')][_0x26bb('0x15')](this));ami['on'](_0x26bb('0x16'),this['voiceAgentReport'][_0x26bb('0x15')](this));ami['on']('custom:voiceDialReport',this[_0x26bb('0x17')][_0x26bb('0x15')](this));ami['on'](_0x26bb('0x18'),this[_0x26bb('0x19')][_0x26bb('0x15')](this));ami['on'](_0x26bb('0x1a'),this[_0x26bb('0x1b')][_0x26bb('0x15')](this));}};Report[_0x26bb('0x1c')][_0x26bb('0x1d')]=function(_0x579fad){var _0x3624f9;_0x3624f9=_[_0x26bb('0x1e')](this[_0x26bb('0xc')],function(_0x5ee0ae){return _0x5ee0ae[_0x26bb('0x1f')]==_0x579fad||_0x5ee0ae[_0x26bb('0x20')]==_0x579fad;});if(_['isNil'](_0x3624f9)){var _0x3a00af=_[_0x26bb('0x1e')](this[_0x26bb('0xd')],function(_0xdf6629){return _0xdf6629[_0x26bb('0x1f')]==_0x579fad||_0xdf6629[_0x26bb('0x20')]==_0x579fad;});if(_0x3a00af){_0x3624f9=_[_0x26bb('0x1e')](this[_0x26bb('0xc')],function(_0x4bd59b){return _0x4bd59b[_0x26bb('0x21')]==util[_0x26bb('0x22')](_0x26bb('0x23'),_0x3a00af[_0x26bb('0x20')]);});}}return _0x3624f9;};Report[_0x26bb('0x1c')][_0x26bb('0x12')]=function(_0x576da8){for(var _0x55a5e3=0x0;_0x55a5e3<_0x576da8[_0x26bb('0x24')];_0x55a5e3+=0x1){var _0x47b41e=this[_0x26bb('0x1d')](_0x576da8[_0x55a5e3]['connectedlinenum']);if(_0x47b41e){_0x576da8[_0x55a5e3][_0x26bb('0x1f')]=_0x47b41e[_0x26bb('0x1f')];_0x576da8[_0x55a5e3]['assigned']=!![];_0x576da8[_0x55a5e3][_0x26bb('0x25')]=_0x47b41e[_0x26bb('0x20')];_0x576da8[_0x55a5e3][_0x26bb('0x21')]=_[_0x26bb('0x26')](_0x47b41e['interface'])?util[_0x26bb('0x22')]('SIP/%s',_0x47b41e[_0x26bb('0x20')]):_0x47b41e[_0x26bb('0x21')];if(_0x576da8[_0x55a5e3][_0x26bb('0x27')]){_0x576da8[_0x55a5e3][_0x26bb('0x28')]=moment()[_0x26bb('0x22')](_0x26bb('0x29'));}if(_0x576da8[_0x55a5e3][_0x26bb('0x2a')]){_0x576da8[_0x55a5e3][_0x26bb('0x2b')]=moment()[_0x26bb('0x22')](_0x26bb('0x29'));}RpcMemberReport[_0x26bb('0x12')](_0x576da8[_0x55a5e3]);}RpcVoiceQueueReport[_0x26bb('0x2c')](_0x576da8[_0x55a5e3]);}};function extractCalleridNumber(_0x4bdf65){var _0x4ea165=_0x4bdf65[_0x26bb('0x2d')](/<(.*?)>/);return _0x4ea165?_0x4ea165[0x1]:_0x4bdf65;}Report[_0x26bb('0x1c')][_0x26bb('0x2e')]=function(_0x4cf35c){for(var _0x11667a=0x0;_0x11667a',_0x9ad40d[_0x26bb('0x44')],_0x9ad40d[_0x26bb('0x30')]);}if(RpcVoiceTransferReport[_0x26bb('0x45')][_0x9ad40d['linkedid']]){var _0x53447b=RpcVoiceTransferReport[_0x26bb('0x45')][_0x9ad40d[_0x26bb('0x46')]];_0x53447b[_0x26bb('0x47')]=_0x9ad40d[_0x26bb('0x48')];RpcVoiceTransferReport[_0x26bb('0x19')](_0x53447b);delete RpcVoiceTransferReport[_0x26bb('0x45')][_0x9ad40d[_0x26bb('0x46')]];}if(_['isNil'](_0x9ad40d[_0x26bb('0x34')])){_0x9ad40d[_0x26bb('0x34')]=this['getCallType'](_0x9ad40d);}if(_[_0x26bb('0x26')](_0x9ad40d[_0x26bb('0x49')])){var _0x19fdec=_0x9ad40d[_0x26bb('0x40')][_0x26bb('0x2f')]('-')[0x0];var _0x173173=this[_0x26bb('0xc')][_0x19fdec];if(!_0x173173)_0x173173=this['getAgentByInternal'](_0x9ad40d[_0x26bb('0x1f')]);if(_0x173173){_0x9ad40d[_0x26bb('0x49')]=_0x173173['id'];_0x9ad40d[_0x26bb('0x4a')]=_0x173173[_0x26bb('0x20')];}}RpcVoiceCallReport[_0x26bb('0x2c')](_0x9ad40d);if(_0x9ad40d['monitor']){for(var _0x2f8760=0x0;_0x2f8760<_0x9ad40d['monitors'][_0x26bb('0x24')];_0x2f8760+=0x1){_0x9ad40d[_0x26bb('0x4b')]=_0x9ad40d[_0x26bb('0x4c')][_0x2f8760][_0x26bb('0x4d')];_0x9ad40d[_0x26bb('0x4e')]=_0x9ad40d[_0x26bb('0x4c')][_0x2f8760]['createdAt'];if(_0x9ad40d[_0x26bb('0x33')]==_0x26bb('0x3c')){_0x9ad40d[_0x26bb('0x30')]=_0x9ad40d['connectedlinenum'];_0x9ad40d['calleridname']=_0x9ad40d['connectedlinename'];_0x9ad40d[_0x26bb('0x43')]=_0x9ad40d[_0x26bb('0x1f')];_0x9ad40d[_0x26bb('0x4f')]=_0x9ad40d[_0x26bb('0x4a')];_0x9ad40d[_0x26bb('0x33')]=_0x9ad40d['originatecalleridnum'];}else if(_0x9ad40d['exten']==_0x26bb('0x50')){_0x9ad40d[_0x26bb('0x30')]=_0x9ad40d['destination'];_0x9ad40d[_0x26bb('0x33')]=_0x9ad40d['originatecalleridnum'];}RpcVoiceRecording['create'](_0x9ad40d);}}};Report['prototype'][_0x26bb('0x51')]=function(_0x5a7b77){if(_['isArray'](_0x5a7b77)){_0x5a7b77[_0x26bb('0x52')](function(_0x55f129){RpcVoiceAgentReport['create'](_0x55f129);});}else{RpcVoiceAgentReport[_0x26bb('0x2c')](_0x5a7b77);}};Report[_0x26bb('0x1c')][_0x26bb('0x17')]=function(_0xc55fb9){RpcVoiceDialReport[_0x26bb('0x2c')](_0xc55fb9);var _0x110104;var _0xc05685;var _0x14c367=_0xc55fb9['channel'];if(_[_0x26bb('0x53')](_0x14c367,_0x26bb('0x54'))){_0xc05685=_0x14c367[_0x26bb('0x55')](_0x14c367[_0x26bb('0x56')]('/')+0x1,_0x14c367['indexOf']('@'));_0x110104=_[_0x26bb('0x1e')](this['agents'],function(_0xe7c9ad){return _0xe7c9ad['mobile']==_0xc05685||_0xe7c9ad[_0x26bb('0x57')]==_0xc05685||_0xe7c9ad[_0x26bb('0x1f')]==_0xc05685;});}else{_0xc05685=_0x14c367['substring'](_0x14c367[_0x26bb('0x56')]('/')+0x1,_0x14c367[_0x26bb('0x58')]('-'));_0x110104=this[_0x26bb('0x1d')](_0xc05685);}if(_0x110104){_0xc55fb9[_0x26bb('0x21')]=_[_0x26bb('0x26')](_0x110104[_0x26bb('0x21')])?util[_0x26bb('0x22')](_0x26bb('0x23'),_0x110104['name']):_0x110104[_0x26bb('0x21')];_0xc55fb9[_0x26bb('0x4a')]=_0x110104['name'];_0xc55fb9['accountcode']=_0x110104['accountcode'];RpcMemberReport[_0x26bb('0x17')](_0xc55fb9);}};Report[_0x26bb('0x1c')][_0x26bb('0x19')]=function(_0x1e3a04){RpcVoiceTransferReport[_0x26bb('0x45')][_0x1e3a04[_0x26bb('0x59')]]=_0x1e3a04;};Report['prototype'][_0x26bb('0x1b')]=function(_0x40b2be){RpcVoiceTransferReport[_0x26bb('0x1b')](_0x40b2be);};module['exports']=Report; \ No newline at end of file +var _0x08b5=['connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','create','monitor','monitors','monitorFilename','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','forEach','startsWith','Local','substring','indexOf','lastIndexOf','transfererlinkedid','attendedTransfer','exports','moment','util','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','prototype','findAgent','find','name','isNil','accountcode','interface','format','SIP/%s','length','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','match','getAgentByInternal','keys','getCallType','split','outbound','internal','destination','type','dialer','queue','lastdata','context','from-voip-provider','callerid','from-sip','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','ANSWERED'];(function(_0x55a286,_0x5ada6f){var _0x40009f=function(_0x477f8b){while(--_0x477f8b){_0x55a286['push'](_0x55a286['shift']());}};_0x40009f(++_0x5ada6f);}(_0x08b5,0x17f));var _0x508b=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x08b5[_0x4709c0];return _0x13348b;};'use strict';var _=require('lodash');var moment=require(_0x508b('0x0'));var util=require(_0x508b('0x1'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require(_0x508b('0x2'));var RpcVoiceCallReport=require(_0x508b('0x3'));var RpcVoiceDialReport=require(_0x508b('0x4'));var RpcMemberReport=require(_0x508b('0x5'));var RpcVoiceQueueReport=require(_0x508b('0x6'));var RpcVoiceRecording=require(_0x508b('0x7'));var RpcVoiceTransferReport=require(_0x508b('0x8'));var VoiceQueueReport=require(_0x508b('0x9'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x508b('0xa'));var VoiceDialReport=require(_0x508b('0xb'));var UserReport=require(_0x508b('0xc'));function Report(_0x410d6f){this[_0x508b('0xd')]=_0x410d6f;this[_0x508b('0xe')]=_0x410d6f['agents'];this['telephones']=_0x410d6f[_0x508b('0xf')];}Report['prototype'][_0x508b('0x10')]=function(_0x75866c){var _0x19a5c6=new VoiceQueueReport(this['realtime']);var _0x48c9b5=new VoiceAgentReport(this['realtime']);var _0x74d25f=new VoiceDialReport(this[_0x508b('0xd')]);var _0x30922d=new VoiceCallReport(this[_0x508b('0xd')]);var _0x28303e=new UserReport(this['realtime']);if(config['xdr']&&config[_0x508b('0x11')][_0x508b('0x12')]){ami['on']('custom:voiceQueueReport',this[_0x508b('0x13')][_0x508b('0x14')](this));ami['on'](_0x508b('0x15'),this['voiceCallReport'][_0x508b('0x14')](this));ami['on']('custom:voiceAgentReport',this[_0x508b('0x16')]['bind'](this));ami['on']('custom:voiceDialReport',this[_0x508b('0x17')][_0x508b('0x14')](this));ami['on'](_0x508b('0x18'),this[_0x508b('0x19')][_0x508b('0x14')](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0x508b('0x14')](this));}};Report[_0x508b('0x1a')][_0x508b('0x1b')]=function(_0x1eff77){var _0xcd224d;_0xcd224d=_[_0x508b('0x1c')](this['agents'],function(_0x3c20bb){return _0x3c20bb['accountcode']==_0x1eff77||_0x3c20bb[_0x508b('0x1d')]==_0x1eff77;});if(_[_0x508b('0x1e')](_0xcd224d)){var _0x491810=_['find'](this[_0x508b('0xf')],function(_0x5231d8){return _0x5231d8[_0x508b('0x1f')]==_0x1eff77||_0x5231d8[_0x508b('0x1d')]==_0x1eff77;});if(_0x491810){_0xcd224d=_[_0x508b('0x1c')](this[_0x508b('0xe')],function(_0x3db9f2){return _0x3db9f2[_0x508b('0x20')]==util[_0x508b('0x21')](_0x508b('0x22'),_0x491810['name']);});}}return _0xcd224d;};Report['prototype'][_0x508b('0x13')]=function(_0x3b4e15){for(var _0x44e11f=0x0;_0x44e11f<_0x3b4e15[_0x508b('0x23')];_0x44e11f+=0x1){var _0x103f63=this[_0x508b('0x1b')](_0x3b4e15[_0x44e11f]['connectedlinenum']);if(_0x103f63){_0x3b4e15[_0x44e11f][_0x508b('0x1f')]=_0x103f63[_0x508b('0x1f')];_0x3b4e15[_0x44e11f][_0x508b('0x24')]=!![];_0x3b4e15[_0x44e11f][_0x508b('0x25')]=_0x103f63[_0x508b('0x1d')];_0x3b4e15[_0x44e11f][_0x508b('0x20')]=_[_0x508b('0x1e')](_0x103f63[_0x508b('0x20')])?util[_0x508b('0x21')](_0x508b('0x22'),_0x103f63['name']):_0x103f63[_0x508b('0x20')];if(_0x3b4e15[_0x44e11f][_0x508b('0x26')]){_0x3b4e15[_0x44e11f][_0x508b('0x27')]=moment()[_0x508b('0x21')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3b4e15[_0x44e11f]['queuecallerexit']){_0x3b4e15[_0x44e11f]['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x508b('0x13')](_0x3b4e15[_0x44e11f]);}RpcVoiceQueueReport['create'](_0x3b4e15[_0x44e11f]);}};function extractCalleridNumber(_0x559515){var _0x5000e3=_0x559515[_0x508b('0x28')](/<(.*?)>/);return _0x5000e3?_0x5000e3[0x1]:_0x559515;}Report[_0x508b('0x1a')][_0x508b('0x29')]=function(_0x56c6c9){for(var _0x25d0ee=0x0;_0x25d0ee0x0?!![]:![];if(!_0x59004b){return this[_0xd1b5('0x1b')](this[_0xd1b5('0x17')][_0xd1b5('0x70')]);}};VoiceQueueReport['prototype'][_0xd1b5('0x71')]=function(_0x3073ba){var _0x231e37=this[_0xd1b5('0x17')]['id'];if(this['summary'][_0xd1b5('0x66')][_0x231e37]&&this[_0xd1b5('0x17')][_0xd1b5('0x66')][_0x231e37][_0x3073ba[_0xd1b5('0x72')]]){this[_0xd1b5('0x17')][_0xd1b5('0x66')][_0x231e37][_0x3073ba['actionid']][_0xd1b5('0x13')][_0xd1b5('0x73')](_0x3073ba);}};VoiceQueueReport[_0xd1b5('0xc')]['syncQueueSummary']=function(_0x1d8484){var _0x432acf=this;try{if(this['isNotNull'](_0x1d8484)&&this['isNotNull'](_0x1d8484[_0xd1b5('0x74')])){logger[_0xd1b5('0x4f')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xd1b5('0x45')](_0x1d8484,{'showHidden':![],'depth':null}));var _0x11be4a=this[_0xd1b5('0x49')][_0x1d8484[_0xd1b5('0x74')]];if(_0x11be4a){logger[_0xd1b5('0x4f')](_0xd1b5('0x75'),_0x11be4a[_0xd1b5('0x5f')]);this[_0xd1b5('0x17')][_0xd1b5('0x63')][_0x11be4a[_0xd1b5('0x5f')]]={'summaryEvent':_0x1d8484};this[_0xd1b5('0x17')][_0xd1b5('0x6f')]+=0x1;return ami[_0xd1b5('0x62')]({'action':'queuestatus','queue':_0x11be4a[_0xd1b5('0x5f')]})[_0xd1b5('0x76')](function(_0x494034){if(!_0x432acf[_0xd1b5('0x17')]['queuestatus'][_0x1d8484[_0xd1b5('0x72')]]){_0x432acf[_0xd1b5('0x17')][_0xd1b5('0x66')][_0x1d8484['actionid']]={};}_0x432acf['summary'][_0xd1b5('0x66')][_0x1d8484['actionid']][_0x494034[_0xd1b5('0x72')]]={'queue':_0x11be4a[_0xd1b5('0x5f')],'agents':[]};})[_0xd1b5('0x40')](function(_0x25df53){throw _0x25df53;});}}}catch(_0x5eb2e8){logger[_0xd1b5('0x43')](_0xd1b5('0x67'),util[_0xd1b5('0x45')](_0x5eb2e8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd1b5('0xc')][_0xd1b5('0x1b')]=function(_0x1bd0bd){if(this[_0xd1b5('0x17')]['statusRequests']>0x0){this[_0xd1b5('0x17')][_0xd1b5('0x70')]=_0x1bd0bd;return;}logger[_0xd1b5('0x4f')](_0xd1b5('0x77'),util['inspect'](_0x1bd0bd,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami[_0xd1b5('0x4d')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0xd1b5('0xc')]['syncQueueCallerJoin']=function(_0x104197){try{if(this[_0xd1b5('0x78')](_0x104197)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x104197['uniqueid'],util['inspect'](_0x104197,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xd1b5('0x11')][_0x104197[_0xd1b5('0x52')]])){this[_0xd1b5('0x11')][_0x104197[_0xd1b5('0x52')]]=[];}if(_['isUndefined'](this[_0xd1b5('0x14')][_0x104197[_0xd1b5('0x52')]])){this[_0xd1b5('0x14')][_0x104197[_0xd1b5('0x52')]]={};}var _0x53fcb4=new QueueReport();_0x53fcb4['queue']=_0x104197[_0xd1b5('0x74')];_0x53fcb4[_0xd1b5('0x5c')]=this[_0xd1b5('0x49')][_0x53fcb4[_0xd1b5('0x74')]]&&this[_0xd1b5('0x49')][_0x53fcb4['queue']][_0xd1b5('0x5c')]?this[_0xd1b5('0x49')][_0x53fcb4['queue']]['type']||_0xd1b5('0x5d'):_0xd1b5('0x5d');_0x53fcb4[_0xd1b5('0x79')]=moment()[_0xd1b5('0x53')](_0xd1b5('0x7a'));_0x53fcb4['position']=_0x104197[_0xd1b5('0x7b')];_0x53fcb4[_0xd1b5('0x7c')]=_0x104197[_0xd1b5('0x7c')];_0x53fcb4[_0xd1b5('0x52')]=_0x104197['uniqueid'];_0x53fcb4[_0xd1b5('0x7d')]=this[_0xd1b5('0x14')][_0x104197[_0xd1b5('0x52')]]['routealias'];logger[_0xd1b5('0x7e')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x53fcb4[_0xd1b5('0x74')],_0x53fcb4[_0xd1b5('0x5c')]);Object[_0xd1b5('0x6d')](_0x53fcb4,_['pick'](_0x104197,_[_0xd1b5('0x7f')](_0x53fcb4)));this['queueReports'][_0x104197['uniqueid']][_0xd1b5('0x73')](_0x53fcb4);this[_0xd1b5('0x14')][_0x104197[_0xd1b5('0x52')]]=_0x53fcb4;this[_0xd1b5('0x4e')](_0x53fcb4,_0xd1b5('0x80'));}}catch(_0x4ab85f){logger[_0xd1b5('0x43')](_0xd1b5('0x81'),_0x104197['uniqueid'],util['inspect'](_0x4ab85f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd1b5('0x21')]=function(_0x39b09a){try{if(this[_0xd1b5('0x78')](_0x39b09a)){logger[_0xd1b5('0x4f')](_0xd1b5('0x82'),_0x39b09a[_0xd1b5('0x52')],util[_0xd1b5('0x45')](_0x39b09a,{'showHidden':![],'depth':null}));if(this[_0xd1b5('0x11')][_0x39b09a[_0xd1b5('0x52')]]){var _0xea850e=_['last'](this[_0xd1b5('0x11')][_0x39b09a[_0xd1b5('0x52')]]);_0xea850e[_0xd1b5('0x3b')]=![];_0xea850e[_0xd1b5('0x83')]=null;_0xea850e['holdtime']=_0x39b09a['holdtime'];_0xea850e[_0xd1b5('0x84')]=_0x39b09a[_0xd1b5('0x84')];_0xea850e[_0xd1b5('0x20')]=!![];_0xea850e[_0xd1b5('0x85')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xea850e[_0xd1b5('0x58')]=_0xd1b5('0x86');_0xea850e['lastAssignedTo']=null;logger[_0xd1b5('0x7e')](_0xd1b5('0x87'),_0xea850e[_0xd1b5('0x74')],_0xea850e[_0xd1b5('0x5c')]);this[_0xd1b5('0x14')][_0x39b09a[_0xd1b5('0x52')]]=_0xea850e;this[_0xd1b5('0x4b')](_0xea850e,_0xd1b5('0x20'));}}}catch(_0xcf3568){logger[_0xd1b5('0x43')](_0xd1b5('0x82'),_0x39b09a[_0xd1b5('0x52')],util[_0xd1b5('0x45')](_0xcf3568,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd1b5('0xc')][_0xd1b5('0x23')]=function(_0x2c5891){try{if(this[_0xd1b5('0x78')](_0x2c5891)){logger[_0xd1b5('0x4f')](_0xd1b5('0x88'),_0x2c5891[_0xd1b5('0x52')],util['inspect'](_0x2c5891,{'showHidden':![],'depth':null}));if(this[_0xd1b5('0x11')][_0x2c5891[_0xd1b5('0x52')]]){var _0x30fed2=_[_0xd1b5('0x89')](this[_0xd1b5('0x11')][_0x2c5891['uniqueid']]);_0x30fed2['queuecallerleaveAt']=moment()[_0xd1b5('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x30fed2['connectedlinenum']=_0x2c5891[_0xd1b5('0x8a')];_0x30fed2[_0xd1b5('0x8b')]=_0x2c5891[_0xd1b5('0x8b')];logger[_0xd1b5('0x7e')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x30fed2['queue'],_0x30fed2[_0xd1b5('0x5c')],_0x2c5891[_0xd1b5('0x8a')],_0x2c5891['connectedlinename']);this[_0xd1b5('0x14')][_0x2c5891[_0xd1b5('0x52')]]=_0x30fed2;this[_0xd1b5('0x4e')](_0x30fed2,'queuecallerleave');}}}catch(_0x59e0ed){logger[_0xd1b5('0x43')]('[%s][voiceQueueReport][queuecallerleave]',_0x2c5891[_0xd1b5('0x52')],util[_0xd1b5('0x45')](_0x59e0ed,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd1b5('0x27')]=function(_0x491a09){try{if(this[_0xd1b5('0x78')](_0x491a09)){logger[_0xd1b5('0x4f')]('[%s][voiceQueueReport][agentconnect]',_0x491a09[_0xd1b5('0x52')],util[_0xd1b5('0x45')](_0x491a09,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x491a09[_0xd1b5('0x52')]]){var _0x315a39=_[_0xd1b5('0x89')](this['queueReports'][_0x491a09[_0xd1b5('0x52')]]);_0x315a39[_0xd1b5('0x3b')]=!![];_0x315a39[_0xd1b5('0x58')]='COMPLETEDBYAGENT';logger[_0xd1b5('0x7e')](_0xd1b5('0x8c'),_0x315a39['queue'],_0x315a39[_0xd1b5('0x5c')]);}}}catch(_0x5ac1f6){logger[_0xd1b5('0x43')](_0xd1b5('0x8d'),_0x491a09[_0xd1b5('0x52')],util[_0xd1b5('0x45')](_0x5ac1f6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd1b5('0xc')]['syncAgentComplete']=function(_0x1d5a5d){try{if(this[_0xd1b5('0x78')](_0x1d5a5d)){logger[_0xd1b5('0x4f')](_0xd1b5('0x8e'),_0x1d5a5d[_0xd1b5('0x52')],util[_0xd1b5('0x45')](_0x1d5a5d,{'showHidden':![],'depth':null}));if(this[_0xd1b5('0x11')][_0x1d5a5d['uniqueid']]){var _0x16a48d=_[_0xd1b5('0x89')](this[_0xd1b5('0x11')][_0x1d5a5d[_0xd1b5('0x52')]]);_0x16a48d[_0xd1b5('0x20')]=![];_0x16a48d['queuecallerabandonAt']=null;_0x16a48d['assigned']=!![];_0x16a48d[_0xd1b5('0x8f')]=_0x1d5a5d[_0xd1b5('0x90')];_0x16a48d[_0xd1b5('0x91')]=_0x1d5a5d[_0xd1b5('0x91')];_0x16a48d[_0xd1b5('0x3b')]=!![];_0x16a48d[_0xd1b5('0x3a')]=![];_0x16a48d[_0xd1b5('0x92')]=null;if(!_0x16a48d[_0xd1b5('0x93')]){if(_0x1d5a5d['reason']==_0xd1b5('0x93')){_0x16a48d[_0xd1b5('0x58')]=_0xd1b5('0x94');logger[_0xd1b5('0x7e')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x16a48d[_0xd1b5('0x74')],_0x16a48d['type']);}else{if(_[_0xd1b5('0x95')](_0x1d5a5d['channel'][_0xd1b5('0x96')](),_0xd1b5('0x97'))){if(this[_0xd1b5('0x11')][_0x1d5a5d[_0xd1b5('0x98')]]){var _0x2d0b9c=_[_0xd1b5('0x89')](this[_0xd1b5('0x11')][_0x1d5a5d[_0xd1b5('0x98')]]);_0x2d0b9c[_0xd1b5('0x3b')]=![];_0x2d0b9c[_0xd1b5('0x3a')]=!![];_0x2d0b9c[_0xd1b5('0x92')]=moment(_0x16a48d[_0xd1b5('0x79')])[_0xd1b5('0x99')](_0x1d5a5d[_0xd1b5('0x91')],_0xd1b5('0x9a'))[_0xd1b5('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d0b9c[_0xd1b5('0x58')]='FORWARDTRANSFER';_0x2d0b9c[_0xd1b5('0x93')]=!![];_0x2d0b9c[_0xd1b5('0x9b')]=_0xd1b5('0x9c');_0x2d0b9c['transferexten']=_0x1d5a5d[_0xd1b5('0x9d')];_0x2d0b9c[_0xd1b5('0x9e')]=_0x1d5a5d[_0xd1b5('0x52')];logger[_0xd1b5('0x7e')](_0xd1b5('0x9f'),_0x2d0b9c['queue'],_0x2d0b9c[_0xd1b5('0x5c')]);var _0x469db5=this[_0xd1b5('0x11')][_0x1d5a5d[_0xd1b5('0x98')]];this[_0xd1b5('0x11')][_0x1d5a5d['linkedid']]=this[_0xd1b5('0x11')][_0x1d5a5d[_0xd1b5('0x52')]];this[_0xd1b5('0x11')][_0x1d5a5d[_0xd1b5('0x52')]]=_0x469db5;}}else{_0x16a48d[_0xd1b5('0x58')]=_0xd1b5('0xa0')+_0x1d5a5d[_0xd1b5('0xa1')][_0xd1b5('0xa2')]();logger[_0xd1b5('0x7e')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x16a48d[_0xd1b5('0x74')],_0x16a48d['type'],_0x16a48d[_0xd1b5('0x58')]);}}}this[_0xd1b5('0x14')][_0x1d5a5d[_0xd1b5('0x52')]]=_0x16a48d;}}}catch(_0x5d1827){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x1d5a5d[_0xd1b5('0x52')],util[_0xd1b5('0x45')](_0x5d1827,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd1b5('0xc')]['syncVarSet']=function(_0x46dde5){try{if(this['isNotNull'](_0x46dde5)){logger['debug'](_0xd1b5('0xa3'),_0x46dde5['uniqueid'],util[_0xd1b5('0x45')](_0x46dde5,{'showHidden':![],'depth':null}));this[_0xd1b5('0xa4')](_0x46dde5[_0xd1b5('0x52')],_[_0xd1b5('0x7f')](_0x46dde5['variable'])[0x0],_0x46dde5[_0xd1b5('0xa5')]);if(this[_0xd1b5('0x11')][_0x46dde5[_0xd1b5('0x52')]]){var _0x399f9f=_['last'](this['queueReports'][_0x46dde5[_0xd1b5('0x52')]]);if(_0x399f9f){if(this['isNotNull'](_0x46dde5[_0xd1b5('0xa6')])&&this[_0xd1b5('0x78')](_0x46dde5[_0xd1b5('0xa6')][_0xd1b5('0x66')])){switch(_0x46dde5[_0xd1b5('0xa5')]){case'CONTINUE':_0x399f9f[_0xd1b5('0x3a')]=![];_0x399f9f[_0xd1b5('0x92')]=null;break;case _0xd1b5('0xa7'):_0x399f9f[_0xd1b5('0xa8')]=_0xd1b5('0xa9');_0x399f9f[_0xd1b5('0x3a')]=!![];_0x399f9f[_0xd1b5('0x92')]=moment()[_0xd1b5('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x399f9f[_0xd1b5('0xaa')]=moment()[_0xd1b5('0x53')](_0xd1b5('0x7a'));logger[_0xd1b5('0x4f')](_0xd1b5('0xab'),_0x46dde5['uniqueid'],util['inspect'](_0x399f9f,{'showHidden':![],'depth':null}));ami[_0xd1b5('0x4d')](_0xd1b5('0xac'),_0x399f9f);break;default:_0x399f9f['queuecallerexit']=!![];_0x399f9f['queuecallerexitAt']=moment()[_0xd1b5('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x399f9f['queuecallerleaveAt']=moment()[_0xd1b5('0x53')]('YYYY-MM-DD\x20HH:mm:ss');}_0x399f9f[_0xd1b5('0x20')]=![];_0x399f9f[_0xd1b5('0x85')]=null;_0x399f9f[_0xd1b5('0x58')]=_0x46dde5[_0xd1b5('0xa5')];this[_0xd1b5('0x14')][_0x46dde5['uniqueid']]=_0x399f9f;this[_0xd1b5('0x4b')](_0x399f9f,'varset');}else if(this['isNotNull'](_0x46dde5['variable'])&&this[_0xd1b5('0x78')](_0x46dde5['variable'][_0xd1b5('0xad')])){if(!_0x399f9f[_0xd1b5('0x20')]){_0x399f9f[_0xd1b5('0x3a')]=!![];_0x399f9f[_0xd1b5('0x92')]=moment()[_0xd1b5('0x53')](_0xd1b5('0x7a'));_0x399f9f[_0xd1b5('0x58')]=_0xd1b5('0xae');_0x399f9f[_0xd1b5('0xaa')]=moment()[_0xd1b5('0x53')](_0xd1b5('0x7a'));this[_0xd1b5('0x14')][_0x46dde5[_0xd1b5('0x52')]]=_0x399f9f;}}logger[_0xd1b5('0x7e')](_0xd1b5('0xaf'),_0x46dde5['uniqueid'],_0x399f9f[_0xd1b5('0x74')],_0x399f9f[_0xd1b5('0x5c')],_[_0xd1b5('0x7f')](_0x46dde5[_0xd1b5('0xa6')])[0x0],_0x46dde5[_0xd1b5('0xa5')]);_0x399f9f[_0xd1b5('0x18')]=this['variables'][_0x46dde5[_0xd1b5('0x52')]];}}}}catch(_0x1503c0){logger[_0xd1b5('0x43')](_0xd1b5('0xa3'),_0x46dde5[_0xd1b5('0x52')],util[_0xd1b5('0x45')](_0x1503c0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd1b5('0xa4')]=function(_0x314e3e,_0x1629f0,_0x37746c){var _0x12006a=['rtpaudioqos','rtpaudioqosbridged',_0xd1b5('0xb0'),'rtpaudioqosjitterbridged',_0xd1b5('0xb1'),_0xd1b5('0xb2'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0xd1b5('0xb3'),_0xd1b5('0xb4'),_0xd1b5('0xb5'),_0xd1b5('0xb6'),_0xd1b5('0xb7'),_0xd1b5('0xb8'),_0xd1b5('0xb9'),_0xd1b5('0xba'),_0xd1b5('0x90'),_0xd1b5('0xbb'),_0xd1b5('0xbc')];if(!_[_0xd1b5('0x3d')](_0x1629f0)&&!_['includes'](_0x12006a,_0x1629f0)){if(_[_0xd1b5('0x60')](this[_0xd1b5('0x18')][_0x314e3e])){this[_0xd1b5('0x18')][_0x314e3e]={};}this[_0xd1b5('0x18')][_0x314e3e][_0x1629f0]=_0x37746c;}};VoiceQueueReport[_0xd1b5('0xc')]['handleHangup']=function(_0x3e80ae,_0x339f3e,_0x4f57ba){try{var _0x2a96be={};if(this['queueReports'][_0x3e80ae]){for(var _0xfd4388=0x0;_0xfd43880x0?!![]:![];if(!_0x12aa83){return this[_0xebd4('0x1c')](this['summary'][_0xebd4('0x74')]);}};VoiceQueueReport[_0xebd4('0xc')][_0xebd4('0x75')]=function(_0x15e0bf){var _0x43c0d0=this[_0xebd4('0x16')]['id'];if(this[_0xebd4('0x16')][_0xebd4('0x66')][_0x43c0d0]&&this['summary']['queuestatus'][_0x43c0d0][_0x15e0bf[_0xebd4('0x65')]]){this['summary'][_0xebd4('0x66')][_0x43c0d0][_0x15e0bf[_0xebd4('0x65')]][_0xebd4('0x6c')][_0xebd4('0x76')](_0x15e0bf);}};VoiceQueueReport[_0xebd4('0xc')]['syncQueueSummary']=function(_0x250ac3){var _0x18cad7=this;try{if(this[_0xebd4('0x5f')](_0x250ac3)&&this[_0xebd4('0x5f')](_0x250ac3[_0xebd4('0x58')])){logger['debug'](_0xebd4('0x77'),util['inspect'](_0x250ac3,{'showHidden':![],'depth':null}));var _0x392a48=this[_0xebd4('0x14')][_0x250ac3[_0xebd4('0x58')]];if(_0x392a48){logger[_0xebd4('0x5c')](_0xebd4('0x78'),_0x392a48[_0xebd4('0x69')]);this[_0xebd4('0x16')][_0xebd4('0x61')][_0x392a48[_0xebd4('0x69')]]={'summaryEvent':_0x250ac3};this[_0xebd4('0x16')][_0xebd4('0x73')]+=0x1;return ami[_0xebd4('0x42')]({'action':_0xebd4('0x66'),'queue':_0x392a48['name']})[_0xebd4('0x64')](function(_0x3f2836){if(!_0x18cad7[_0xebd4('0x16')][_0xebd4('0x66')][_0x250ac3['actionid']]){_0x18cad7[_0xebd4('0x16')]['queuestatus'][_0x250ac3[_0xebd4('0x65')]]={};}_0x18cad7[_0xebd4('0x16')][_0xebd4('0x66')][_0x250ac3[_0xebd4('0x65')]][_0x3f2836[_0xebd4('0x65')]]={'queue':_0x392a48[_0xebd4('0x69')],'agents':[]};})[_0xebd4('0x62')](function(_0x3a1d70){throw _0x3a1d70;});}}}catch(_0x3ab5da){logger[_0xebd4('0x44')](_0xebd4('0x67'),util[_0xebd4('0x46')](_0x3ab5da,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xebd4('0xc')][_0xebd4('0x1c')]=function(_0x512461){if(this[_0xebd4('0x16')][_0xebd4('0x73')]>0x0){this['summary'][_0xebd4('0x74')]=_0x512461;return;}logger['debug'](_0xebd4('0x79'),util['inspect'](_0x512461,{'showHidden':![],'depth':null}));this[_0xebd4('0x16')]=initializeSummary();ami['emit']('custom:queuesummarycomplete',{});};VoiceQueueReport['prototype'][_0xebd4('0x21')]=function(_0x4b1122){try{if(this['isNotNull'](_0x4b1122)){logger[_0xebd4('0x5c')](_0xebd4('0x7a'),_0x4b1122[_0xebd4('0x50')],util[_0xebd4('0x46')](_0x4b1122,{'showHidden':![],'depth':null}));if(_[_0xebd4('0x60')](this[_0xebd4('0x11')][_0x4b1122[_0xebd4('0x50')]])){this[_0xebd4('0x11')][_0x4b1122['uniqueid']]=[];}if(_[_0xebd4('0x60')](this['channels'][_0x4b1122[_0xebd4('0x50')]])){this[_0xebd4('0x13')][_0x4b1122[_0xebd4('0x50')]]={};}var _0x5f4849=new QueueReport();_0x5f4849[_0xebd4('0x58')]=_0x4b1122[_0xebd4('0x58')];_0x5f4849[_0xebd4('0x5b')]=this[_0xebd4('0x14')][_0x5f4849[_0xebd4('0x58')]]&&this[_0xebd4('0x14')][_0x5f4849[_0xebd4('0x58')]][_0xebd4('0x5b')]?this[_0xebd4('0x14')][_0x5f4849[_0xebd4('0x58')]][_0xebd4('0x5b')]||_0xebd4('0x70'):_0xebd4('0x70');_0x5f4849[_0xebd4('0x7b')]=moment()[_0xebd4('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x5f4849[_0xebd4('0x7c')]=_0x4b1122[_0xebd4('0x7c')];_0x5f4849[_0xebd4('0x7d')]=_0x4b1122[_0xebd4('0x7d')];_0x5f4849[_0xebd4('0x50')]=_0x4b1122[_0xebd4('0x50')];_0x5f4849['routealias']=this[_0xebd4('0x13')][_0x4b1122[_0xebd4('0x50')]]['routealias'];logger[_0xebd4('0x7e')](_0xebd4('0x7f'),_0x5f4849['queue'],_0x5f4849[_0xebd4('0x5b')]);Object[_0xebd4('0x6f')](_0x5f4849,_['pick'](_0x4b1122,_['keys'](_0x5f4849)));this[_0xebd4('0x11')][_0x4b1122[_0xebd4('0x50')]][_0xebd4('0x76')](_0x5f4849);this[_0xebd4('0x13')][_0x4b1122[_0xebd4('0x50')]]=_0x5f4849;this[_0xebd4('0x4d')](_0x5f4849,'queuecallerjoin');}}catch(_0x22628f){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x4b1122['uniqueid'],util['inspect'](_0x22628f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xebd4('0x23')]=function(_0x5a9e3d){try{if(this[_0xebd4('0x5f')](_0x5a9e3d)){logger[_0xebd4('0x5c')](_0xebd4('0x80'),_0x5a9e3d[_0xebd4('0x50')],util['inspect'](_0x5a9e3d,{'showHidden':![],'depth':null}));if(this[_0xebd4('0x11')][_0x5a9e3d[_0xebd4('0x50')]]){var _0x50ee8e=_[_0xebd4('0x81')](this[_0xebd4('0x11')][_0x5a9e3d[_0xebd4('0x50')]]);_0x50ee8e['queuecallercomplete']=![];_0x50ee8e[_0xebd4('0x82')]=null;_0x50ee8e[_0xebd4('0x83')]=_0x5a9e3d[_0xebd4('0x83')];_0x50ee8e[_0xebd4('0x84')]=_0x5a9e3d['originalposition'];_0x50ee8e['queuecallerabandon']=!![];_0x50ee8e[_0xebd4('0x85')]=moment()[_0xebd4('0x51')](_0xebd4('0x86'));_0x50ee8e[_0xebd4('0x56')]=_0xebd4('0x87');_0x50ee8e[_0xebd4('0x88')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x50ee8e[_0xebd4('0x58')],_0x50ee8e[_0xebd4('0x5b')]);this[_0xebd4('0x13')][_0x5a9e3d[_0xebd4('0x50')]]=_0x50ee8e;this[_0xebd4('0x4a')](_0x50ee8e,_0xebd4('0x22'));}}}catch(_0x176063){logger['error'](_0xebd4('0x80'),_0x5a9e3d['uniqueid'],util[_0xebd4('0x46')](_0x176063,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xebd4('0xc')]['syncQueueCallerLeave']=function(_0x462292){try{if(this[_0xebd4('0x5f')](_0x462292)){logger[_0xebd4('0x5c')](_0xebd4('0x89'),_0x462292[_0xebd4('0x50')],util[_0xebd4('0x46')](_0x462292,{'showHidden':![],'depth':null}));if(this[_0xebd4('0x11')][_0x462292[_0xebd4('0x50')]]){var _0x3252e5=_[_0xebd4('0x81')](this[_0xebd4('0x11')][_0x462292[_0xebd4('0x50')]]);_0x3252e5[_0xebd4('0x8a')]=moment()['format'](_0xebd4('0x86'));_0x3252e5[_0xebd4('0x8b')]=_0x462292[_0xebd4('0x8b')];_0x3252e5[_0xebd4('0x8c')]=_0x462292[_0xebd4('0x8c')];logger['info'](_0xebd4('0x8d'),_0x3252e5['queue'],_0x3252e5[_0xebd4('0x5b')],_0x462292[_0xebd4('0x8b')],_0x462292['connectedlinename']);this[_0xebd4('0x13')][_0x462292[_0xebd4('0x50')]]=_0x3252e5;this['emitVoiceQueueChannelSave'](_0x3252e5,_0xebd4('0x24'));}}}catch(_0xc97cb1){logger[_0xebd4('0x44')](_0xebd4('0x89'),_0x462292[_0xebd4('0x50')],util[_0xebd4('0x46')](_0xc97cb1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xebd4('0xc')][_0xebd4('0x8e')]=function(_0x2c1e70){try{if(this[_0xebd4('0x5f')](_0x2c1e70)){logger[_0xebd4('0x5c')](_0xebd4('0x8f'),_0x2c1e70[_0xebd4('0x50')],util[_0xebd4('0x46')](_0x2c1e70,{'showHidden':![],'depth':null}));if(this[_0xebd4('0x11')][_0x2c1e70['uniqueid']]){var _0x19a05f=_[_0xebd4('0x81')](this[_0xebd4('0x11')][_0x2c1e70['uniqueid']]);_0x19a05f[_0xebd4('0x3e')]=!![];_0x19a05f['queuecallerexitreason']=_0xebd4('0x90');logger[_0xebd4('0x7e')](_0xebd4('0x91'),_0x19a05f[_0xebd4('0x58')],_0x19a05f[_0xebd4('0x5b')]);}}}catch(_0x375571){logger[_0xebd4('0x44')](_0xebd4('0x8f'),_0x2c1e70[_0xebd4('0x50')],util[_0xebd4('0x46')](_0x375571,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xebd4('0xc')][_0xebd4('0x27')]=function(_0x21af31){try{if(this[_0xebd4('0x5f')](_0x21af31)){logger[_0xebd4('0x5c')](_0xebd4('0x92'),_0x21af31[_0xebd4('0x50')],util['inspect'](_0x21af31,{'showHidden':![],'depth':null}));if(this[_0xebd4('0x11')][_0x21af31[_0xebd4('0x50')]]){var _0x52017f=_[_0xebd4('0x81')](this[_0xebd4('0x11')][_0x21af31[_0xebd4('0x50')]]);_0x52017f[_0xebd4('0x22')]=![];_0x52017f[_0xebd4('0x85')]=null;_0x52017f[_0xebd4('0x93')]=!![];_0x52017f[_0xebd4('0x88')]=_0x21af31[_0xebd4('0x94')];_0x52017f[_0xebd4('0x83')]=_0x21af31['holdtime'];_0x52017f[_0xebd4('0x3e')]=!![];_0x52017f[_0xebd4('0x3d')]=![];_0x52017f[_0xebd4('0x95')]=null;if(!_0x52017f[_0xebd4('0x96')]){if(_0x21af31[_0xebd4('0x97')]==_0xebd4('0x96')){_0x52017f[_0xebd4('0x56')]='COMPLETED';logger[_0xebd4('0x7e')](_0xebd4('0x98'),_0x52017f[_0xebd4('0x58')],_0x52017f[_0xebd4('0x5b')]);}else{if(_[_0xebd4('0x99')](_0x21af31[_0xebd4('0x9a')][_0xebd4('0x9b')](),_0xebd4('0x9c'))){if(this[_0xebd4('0x11')][_0x21af31[_0xebd4('0x9d')]]){var _0x555374=_[_0xebd4('0x81')](this[_0xebd4('0x11')][_0x21af31[_0xebd4('0x9d')]]);_0x555374['queuecallercomplete']=![];_0x555374[_0xebd4('0x3d')]=!![];_0x555374[_0xebd4('0x95')]=moment(_0x52017f[_0xebd4('0x7b')])[_0xebd4('0x9e')](_0x21af31[_0xebd4('0x83')],_0xebd4('0x9f'))[_0xebd4('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x555374[_0xebd4('0x56')]='FORWARDTRANSFER';_0x555374[_0xebd4('0x96')]=!![];_0x555374[_0xebd4('0xa0')]='FORWARD';_0x555374[_0xebd4('0xa1')]=_0x21af31[_0xebd4('0xa2')];_0x555374['transferuniqueid']=_0x21af31['uniqueid'];logger[_0xebd4('0x7e')](_0xebd4('0xa3'),_0x555374[_0xebd4('0x58')],_0x555374[_0xebd4('0x5b')]);var _0x536b00=this['queueReports'][_0x21af31[_0xebd4('0x9d')]];this['queueReports'][_0x21af31[_0xebd4('0x9d')]]=this[_0xebd4('0x11')][_0x21af31[_0xebd4('0x50')]];this[_0xebd4('0x11')][_0x21af31['uniqueid']]=_0x536b00;}}else{_0x52017f['queuecallerexitreason']=_0xebd4('0xa4')+_0x21af31[_0xebd4('0x97')][_0xebd4('0xa5')]();logger[_0xebd4('0x7e')](_0xebd4('0xa6'),_0x52017f[_0xebd4('0x58')],_0x52017f['type'],_0x52017f['queuecallerexitreason']);}}}this[_0xebd4('0x13')][_0x21af31['uniqueid']]=_0x52017f;}}}catch(_0x267697){logger[_0xebd4('0x44')](_0xebd4('0x92'),_0x21af31[_0xebd4('0x50')],util['inspect'](_0x267697,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xebd4('0xc')][_0xebd4('0x2a')]=function(_0x41ed5e){try{if(this['isNotNull'](_0x41ed5e)){logger[_0xebd4('0x5c')](_0xebd4('0xa7'),_0x41ed5e[_0xebd4('0x50')],util[_0xebd4('0x46')](_0x41ed5e,{'showHidden':![],'depth':null}));this[_0xebd4('0xa8')](_0x41ed5e[_0xebd4('0x50')],_[_0xebd4('0xa9')](_0x41ed5e[_0xebd4('0xaa')])[0x0],_0x41ed5e[_0xebd4('0xab')]);if(this[_0xebd4('0x11')][_0x41ed5e['uniqueid']]){var _0x5acac8=_[_0xebd4('0x81')](this['queueReports'][_0x41ed5e[_0xebd4('0x50')]]);if(_0x5acac8){if(this['isNotNull'](_0x41ed5e['variable'])&&this['isNotNull'](_0x41ed5e[_0xebd4('0xaa')][_0xebd4('0x66')])){switch(_0x41ed5e['value']){case _0xebd4('0xac'):_0x5acac8['queuecallerexit']=![];_0x5acac8['queuecallerexitAt']=null;break;case _0xebd4('0xad'):_0x5acac8[_0xebd4('0xae')]=_0xebd4('0xaf');_0x5acac8[_0xebd4('0x3d')]=!![];_0x5acac8[_0xebd4('0x95')]=moment()[_0xebd4('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x5acac8[_0xebd4('0x8a')]=moment()[_0xebd4('0x51')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xebd4('0x5c')](_0xebd4('0xb0'),_0x41ed5e[_0xebd4('0x50')],util['inspect'](_0x5acac8,{'showHidden':![],'depth':null}));ami[_0xebd4('0x4c')](_0xebd4('0xb1'),_0x5acac8);break;default:_0x5acac8['queuecallerexit']=!![];_0x5acac8[_0xebd4('0x95')]=moment()[_0xebd4('0x51')](_0xebd4('0x86'));_0x5acac8[_0xebd4('0x8a')]=moment()[_0xebd4('0x51')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5acac8[_0xebd4('0x22')]=![];_0x5acac8['queuecallerabandonAt']=null;_0x5acac8['queuecallerexitreason']=_0x41ed5e[_0xebd4('0xab')];this[_0xebd4('0x13')][_0x41ed5e[_0xebd4('0x50')]]=_0x5acac8;this[_0xebd4('0x4a')](_0x5acac8,_0xebd4('0x29'));}else if(this[_0xebd4('0x5f')](_0x41ed5e[_0xebd4('0xaa')])&&this[_0xebd4('0x5f')](_0x41ed5e['variable'][_0xebd4('0xb2')])){if(!_0x5acac8[_0xebd4('0x22')]){_0x5acac8['queuecallerexit']=!![];_0x5acac8['queuecallerexitAt']=moment()[_0xebd4('0x51')](_0xebd4('0x86'));_0x5acac8['queuecallerexitreason']=_0xebd4('0xb3');_0x5acac8[_0xebd4('0x8a')]=moment()[_0xebd4('0x51')](_0xebd4('0x86'));this[_0xebd4('0x13')][_0x41ed5e[_0xebd4('0x50')]]=_0x5acac8;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x41ed5e['uniqueid'],_0x5acac8[_0xebd4('0x58')],_0x5acac8[_0xebd4('0x5b')],_[_0xebd4('0xa9')](_0x41ed5e[_0xebd4('0xaa')])[0x0],_0x41ed5e[_0xebd4('0xab')]);_0x5acac8['variables']=this[_0xebd4('0x17')][_0x41ed5e[_0xebd4('0x50')]];}}}}catch(_0x2c1257){logger[_0xebd4('0x44')](_0xebd4('0xa7'),_0x41ed5e[_0xebd4('0x50')],util[_0xebd4('0x46')](_0x2c1257,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xebd4('0xc')][_0xebd4('0xa8')]=function(_0x576927,_0x53d8a8,_0x1fa7a5){var _0x2893a0=[_0xebd4('0xb4'),_0xebd4('0xb5'),_0xebd4('0xb6'),_0xebd4('0xb7'),'rtpaudioqosloss',_0xebd4('0xb8'),_0xebd4('0xb9'),_0xebd4('0xba'),_0xebd4('0xbb'),_0xebd4('0xbc'),_0xebd4('0xbd'),_0xebd4('0xbe'),'membercalls',_0xebd4('0xbf'),_0xebd4('0xc0'),'memberlastcall',_0xebd4('0x94'),_0xebd4('0xc1'),_0xebd4('0xc2')];if(!_[_0xebd4('0x41')](_0x53d8a8)&&!_[_0xebd4('0xc3')](_0x2893a0,_0x53d8a8)){if(_[_0xebd4('0x60')](this[_0xebd4('0x17')][_0x576927])){this[_0xebd4('0x17')][_0x576927]={};}this[_0xebd4('0x17')][_0x576927][_0x53d8a8]=_0x1fa7a5;}};VoiceQueueReport[_0xebd4('0xc')]['handleHangup']=function(_0x5592d5,_0x5c9db6,_0xb433c5){try{var _0x278510={};if(this['queueReports'][_0x5592d5]){for(var _0x30d733=0x0;_0x30d733=0x0?moment(_0x25f7e4[_0x76e5('0x16')])[_0x76e5('0xe')](_0x25f7e4[_0x76e5('0x17')],_0x76e5('0xf')):null,'data1':_0x76e5('0x18'),'data2':_0x25f7e4[_0x76e5('0x13')],'data3':_0x25f7e4['exten'],'data4':_0x25f7e4[_0x76e5('0x19')]||null,'role':_0x76e5('0x12'),'internal':_0x25f7e4[_0x76e5('0x13')]?_[_0x76e5('0x1a')](_0x25f7e4[_0x76e5('0x13')]):undefined,'uniqueid':_0x25f7e4[_0x76e5('0x14')]},'log':_0x76e5('0x6')});}; \ No newline at end of file +var _0x5eb4=['queue','agent','toNumber','accountcode','uniqueid','CreateMemberReport','voiceDialReport','voice','membername','endtime','starttime','moment','lodash','util','../client','queuecallercompleteAt','queuecallerexitAt','Request','lastAssignedTo','isNil','format','TALKING','diff','queuecallerleaveAt','seconds','inbound','exten'];(function(_0x1c470d,_0x81d66b){var _0x12141b=function(_0x45bfd3){while(--_0x45bfd3){_0x1c470d['push'](_0x1c470d['shift']());}};_0x12141b(++_0x81d66b);}(_0x5eb4,0x16a));var _0x45eb=function(_0x551c76,_0x36bd42){_0x551c76=_0x551c76-0x0;var _0x4622f5=_0x5eb4[_0x551c76];return _0x4622f5;};'use strict';var moment=require(_0x45eb('0x0'));var _=require(_0x45eb('0x1'));var util=require(_0x45eb('0x2'));var client=require(_0x45eb('0x3'));exports['voiceQueueReport']=function(_0x2da81e){var _0x90b4da=_0x2da81e[_0x45eb('0x4')]||_0x2da81e[_0x45eb('0x5')];return client[_0x45eb('0x6')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x2da81e[_0x45eb('0x7')],'interface':_[_0x45eb('0x8')](_0x2da81e['interface'])?util[_0x45eb('0x9')]('SIP/%s',_0x2da81e['lastAssignedTo']):_0x2da81e['interface'],'type':_0x45eb('0xa'),'enterAt':_0x2da81e['queuecallerleaveAt'],'exitAt':_0x90b4da,'duration':moment(_0x90b4da)[_0x45eb('0xb')](_0x2da81e[_0x45eb('0xc')],_0x45eb('0xd')),'data1':_0x45eb('0xe'),'data2':_0x2da81e['calleridnum'],'data3':_0x2da81e[_0x45eb('0xf')],'data4':null,'data5':_0x2da81e[_0x45eb('0x10')],'role':_0x45eb('0x11'),'internal':_0x2da81e['accountcode']?_[_0x45eb('0x12')](_0x2da81e[_0x45eb('0x13')]):undefined,'uniqueid':_0x2da81e[_0x45eb('0x14')]},'log':_0x45eb('0x15')});};exports[_0x45eb('0x16')]=function(_0x1723bc){return client['Request'](_0x45eb('0x15'),{'body':{'channel':_0x45eb('0x17'),'membername':_0x1723bc[_0x45eb('0x18')],'interface':_0x1723bc['interface'],'type':_0x45eb('0xa'),'enterAt':_0x1723bc['starttime'],'exitAt':_0x1723bc[_0x45eb('0x19')],'duration':moment(_0x1723bc[_0x45eb('0x19')])['diff'](_0x1723bc[_0x45eb('0x1a')],_0x45eb('0xd'))>=0x0?moment(_0x1723bc[_0x45eb('0x19')])['diff'](_0x1723bc['starttime'],_0x45eb('0xd')):null,'data1':'outbound','data2':_0x1723bc['accountcode'],'data3':_0x1723bc[_0x45eb('0xf')],'data4':_0x1723bc['dialstring']||null,'role':_0x45eb('0x11'),'internal':_0x1723bc[_0x45eb('0x13')]?_[_0x45eb('0x12')](_0x1723bc[_0x45eb('0x13')]):undefined,'uniqueid':_0x1723bc['uniqueid']},'log':_0x45eb('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 392d150..ccde689 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 _0x3a41=['stopRecordingOnTransfer','previewRecallmeReminderInterval','../client','getSettings','Request','ShowSetting'];(function(_0x456a6f,_0x1e2dfd){var _0x202004=function(_0x8be1b7){while(--_0x8be1b7){_0x456a6f['push'](_0x456a6f['shift']());}};_0x202004(++_0x1e2dfd);}(_0x3a41,0x86));var _0x13a4=function(_0x7b28fe,_0x14b077){_0x7b28fe=_0x7b28fe-0x0;var _0x3eea1b=_0x3a41[_0x7b28fe];return _0x3eea1b;};'use strict';var client=require(_0x13a4('0x0'));exports[_0x13a4('0x1')]=function(){return client[_0x13a4('0x2')](_0x13a4('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x13a4('0x4'),_0x13a4('0x5')]},'log':'GetSettings'});}; \ No newline at end of file +var _0xd1eb=['getSettings','Request','stopRecordingOnTransfer','../client'];(function(_0x350cd0,_0x5b49f9){var _0x3f24a5=function(_0x3ab74e){while(--_0x3ab74e){_0x350cd0['push'](_0x350cd0['shift']());}};_0x3f24a5(++_0x5b49f9);}(_0xd1eb,0xc3));var _0xbd1e=function(_0x4a13e6,_0x2f2bfc){_0x4a13e6=_0x4a13e6-0x0;var _0x49febe=_0xd1eb[_0x4a13e6];return _0x49febe;};'use strict';var client=require(_0xbd1e('0x0'));exports[_0xbd1e('0x1')]=function(){return client[_0xbd1e('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xbd1e('0x3'),'previewRecallmeReminderInterval']},'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 8dbce0e..b459e63 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 _0x0a97=['GetTemplate','name','html','../client','getTemplates','Request'];(function(_0x4cb283,_0xa40f9e){var _0x3b0573=function(_0x1f7672){while(--_0x1f7672){_0x4cb283['push'](_0x4cb283['shift']());}};_0x3b0573(++_0xa40f9e);}(_0x0a97,0x1a7));var _0x70a9=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x0a97[_0x2f9467];return _0x39894c;};'use strict';var client=require(_0x70a9('0x0'));exports[_0x70a9('0x1')]=function(_0x2415f5){return function(_0x2f02af){return client[_0x70a9('0x2')](_0x70a9('0x3'),{'options':{'raw':!![],'attributes':['id',_0x70a9('0x4'),_0x70a9('0x5')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0xa92a=['Request','GetTemplate','html','../client'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xa92a,0x1c7));var _0xaa92=function(_0x1044e5,_0x498e01){_0x1044e5=_0x1044e5-0x0;var _0x5ad0dd=_0xa92a[_0x1044e5];return _0x5ad0dd;};'use strict';var client=require(_0xaa92('0x0'));exports['getTemplates']=function(_0x5eb0f2){return function(_0x28aff2){return client[_0xaa92('0x1')](_0xaa92('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0xaa92('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index bba4a87..13e50fd 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 _0x0cfd=['data5','data7','../client','getTriggers','Request','GetTrigger','channel','status','Condition','AllConditions','operator','value','field','Action','Actions','action','data1','data2','data3','data4'];(function(_0x5b2ced,_0x29cd3a){var _0x1ec63b=function(_0x5e0906){while(--_0x5e0906){_0x5b2ced['push'](_0x5b2ced['shift']());}};_0x1ec63b(++_0x29cd3a);}(_0x0cfd,0xf2));var _0xd0cf=function(_0x52e1ff,_0x22a521){_0x52e1ff=_0x52e1ff-0x0;var _0x2f4db0=_0x0cfd[_0x52e1ff];return _0x2f4db0;};'use strict';var client=require(_0xd0cf('0x0'));exports[_0xd0cf('0x1')]=function(_0x31cc62){return function(_0x2c735a){return client[_0xd0cf('0x2')](_0xd0cf('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xd0cf('0x4'),_0xd0cf('0x5')],'include':[{'model':_0xd0cf('0x6'),'as':_0xd0cf('0x7'),'attributes':['id','field',_0xd0cf('0x8'),_0xd0cf('0x9')]},{'model':'Condition','as':'AnyConditions','attributes':['id',_0xd0cf('0xa'),_0xd0cf('0x8'),_0xd0cf('0x9')]},{'model':_0xd0cf('0xb'),'as':_0xd0cf('0xc'),'attributes':['id',_0xd0cf('0xd'),_0xd0cf('0xe'),_0xd0cf('0xf'),_0xd0cf('0x10'),_0xd0cf('0x11'),_0xd0cf('0x12'),'data6',_0xd0cf('0x13')]}]},'log':_0xd0cf('0x3')});};}; \ No newline at end of file +var _0x8ab7=['data7','GetTrigger','getTriggers','channel','Condition','field','operator','AnyConditions','value','Actions','action','data1','data3','data4','data5','data6'];(function(_0x2f260e,_0x239e29){var _0x5e9222=function(_0x3bcb71){while(--_0x3bcb71){_0x2f260e['push'](_0x2f260e['shift']());}};_0x5e9222(++_0x239e29);}(_0x8ab7,0x142));var _0x78ab=function(_0x347a76,_0x13d2fe){_0x347a76=_0x347a76-0x0;var _0x138e49=_0x8ab7[_0x347a76];return _0x138e49;};'use strict';var client=require('../client');exports[_0x78ab('0x0')]=function(_0x6ca270){return function(_0x3aceb7){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id','name',_0x78ab('0x1'),'status'],'include':[{'model':_0x78ab('0x2'),'as':'AllConditions','attributes':['id',_0x78ab('0x3'),_0x78ab('0x4'),'value']},{'model':_0x78ab('0x2'),'as':_0x78ab('0x5'),'attributes':['id',_0x78ab('0x3'),'operator',_0x78ab('0x6')]},{'model':'Action','as':_0x78ab('0x7'),'attributes':['id',_0x78ab('0x8'),_0x78ab('0x9'),'data2',_0x78ab('0xa'),_0x78ab('0xb'),_0x78ab('0xc'),_0x78ab('0xd'),_0x78ab('0xe')]}]},'log':_0x78ab('0xf')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 9ae3052..daf6bcd 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 _0xd20f=['getTrunks','name','registry','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd20f,0xbf));var _0xfd20=function(_0x51f142,_0x3c9b07){_0x51f142=_0x51f142-0x0;var _0x5c9810=_0xd20f[_0x51f142];return _0x5c9810;};'use strict';var client=require(_0xfd20('0x0'));exports[_0xfd20('0x1')]=function(_0x4fa3cc){return function(_0x300d05){return client['Request']('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xfd20('0x2'),_0xfd20('0x3'),'defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xd847=['name','registry','defaultuser','GetTrunk','../client','getTrunks'];(function(_0x160c68,_0x59b748){var _0x1b29ab=function(_0x51f5b2){while(--_0x51f5b2){_0x160c68['push'](_0x160c68['shift']());}};_0x1b29ab(++_0x59b748);}(_0xd847,0x18a));var _0x7d84=function(_0x44f097,_0x1385a9){_0x44f097=_0x44f097-0x0;var _0x5f10a7=_0xd847[_0x44f097];return _0x5f10a7;};'use strict';var client=require(_0x7d84('0x0'));exports[_0x7d84('0x1')]=function(_0x3e5e53){return function(_0x1d94dd){return client['Request']('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x7d84('0x2'),_0x7d84('0x3'),_0x7d84('0x4')]},'log':_0x7d84('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 17cc3a4..6d76a01 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x2715cf,_0x517bb2){var _0x1bdcb8=function(_0x5dec7b){while(--_0x5dec7b){_0x2715cf['push'](_0x2715cf['shift']());}};_0x1bdcb8(++_0x517bb2);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file +var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x4a88c9,_0x1d0aed){var _0x1663ea=function(_0x13bda0){while(--_0x13bda0){_0x4a88c9['push'](_0x4a88c9['shift']());}};_0x1663ea(++_0x1d0aed);}(_0x70e0,0x17b));var _0x070e=function(_0x58228a,_0x162385){_0x58228a=_0x58228a-0x0;var _0x3d1960=_0x70e0[_0x58228a];return _0x3d1960;};'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 f4bd94c..4f7ef64 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 _0x4e07=['create','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x5cce5a,_0x298d54){var _0x354e33=function(_0xb372cf){while(--_0xb372cf){_0x5cce5a['push'](_0x5cce5a['shift']());}};_0x354e33(++_0x298d54);}(_0x4e07,0xbd));var _0x74e0=function(_0x3c2f3f,_0x3042e2){_0x3c2f3f=_0x3c2f3f-0x0;var _0x32b6eb=_0x4e07[_0x3c2f3f];return _0x32b6eb;};'use strict';var client=require(_0x74e0('0x0'));exports[_0x74e0('0x1')]=function(_0x109cc1){return client['Request'](_0x74e0('0x2'),{'body':_0x109cc1,'log':'CreateVoiceAgentReport'});};exports[_0x74e0('0x3')]=function(_0x2798c5,_0x18d797,_0x45a744){return client['Request'](_0x74e0('0x4'),{'body':_0x2798c5,'options':{'where':{'uniqueid':_0x18d797,'interface':_0x45a744,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x7c1d=['Request','UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport','update'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7c1d,0x16a));var _0xd7c1=function(_0x55806b,_0x3cb555){_0x55806b=_0x55806b-0x0;var _0x4cc875=_0x7c1d[_0x55806b];return _0x4cc875;};'use strict';var client=require(_0xd7c1('0x0'));exports[_0xd7c1('0x1')]=function(_0x2b60bf){return client['Request']('CreateVoiceAgentReport',{'body':_0x2b60bf,'log':_0xd7c1('0x2')});};exports[_0xd7c1('0x3')]=function(_0x3040d6,_0x3e4251,_0x157cba){return client[_0xd7c1('0x4')](_0xd7c1('0x5'),{'body':_0x3040d6,'options':{'where':{'uniqueid':_0x3e4251,'interface':_0x157cba,'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 74ab1c2..59aac73 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 _0x4a52=['GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','billableseconds'];(function(_0x50056e,_0x55e7ee){var _0x4adc4c=function(_0x4b6618){while(--_0x4b6618){_0x50056e['push'](_0x50056e['shift']());}};_0x4adc4c(++_0x55e7ee);}(_0x4a52,0x151));var _0x24a5=function(_0x5ad707,_0x29dc6f){_0x5ad707=_0x5ad707-0x0;var _0xa8a153=_0x4a52[_0x5ad707];return _0xa8a153;};'use strict';var moment=require('moment');var util=require(_0x24a5('0x0'));var _=require(_0x24a5('0x1'));var client=require(_0x24a5('0x2'));exports[_0x24a5('0x3')]=function(_0xfaae6){return client[_0x24a5('0x4')](_0x24a5('0x5'),{'body':_[_0x24a5('0x6')](_0xfaae6,{'source':_0xfaae6[_0x24a5('0x7')],'destinationcontext':_0xfaae6['context'],'callerid':_0xfaae6[_0x24a5('0x8')],'amaflags':_0x24a5('0x9')}),'log':_0x24a5('0x5')});};exports[_0x24a5('0xa')]=function(){return function(){return client[_0x24a5('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x24a5('0xb')],'createdAt':{'$between':[moment()[_0x24a5('0xc')](_0x24a5('0xd'))[_0x24a5('0xe')](_0x24a5('0xf')),moment()[_0x24a5('0x10')]('day')['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x24a5('0x11'),'disposition',_0x24a5('0x12'),_0x24a5('0x13')]},'log':_0x24a5('0x14')});};}; \ No newline at end of file +var _0xf2a6=['type','duration','billableseconds','moment','util','lodash','../client','CreateVoiceCallReport','calleridnum','context','getVoiceCallReports','Request','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf'];(function(_0x17ebb6,_0x465af7){var _0x32ec22=function(_0x160ff0){while(--_0x160ff0){_0x17ebb6['push'](_0x17ebb6['shift']());}};_0x32ec22(++_0x465af7);}(_0xf2a6,0x1de));var _0x6f2a=function(_0x19874e,_0x424eaa){_0x19874e=_0x19874e-0x0;var _0x432c57=_0xf2a6[_0x19874e];return _0x432c57;};'use strict';var moment=require(_0x6f2a('0x0'));var util=require(_0x6f2a('0x1'));var _=require(_0x6f2a('0x2'));var client=require(_0x6f2a('0x3'));exports['create']=function(_0x5dfc5d){return client['Request'](_0x6f2a('0x4'),{'body':_['merge'](_0x5dfc5d,{'source':_0x5dfc5d[_0x6f2a('0x5')],'destinationcontext':_0x5dfc5d[_0x6f2a('0x6')],'callerid':_0x5dfc5d['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0x6f2a('0x4')});};exports[_0x6f2a('0x7')]=function(){return function(){return client[_0x6f2a('0x8')](_0x6f2a('0x9'),{'options':{'where':{'type':[_0x6f2a('0xa')],'createdAt':{'$between':[moment()[_0x6f2a('0xb')](_0x6f2a('0xc'))[_0x6f2a('0xd')](_0x6f2a('0xe')),moment()[_0x6f2a('0xf')](_0x6f2a('0xc'))['format'](_0x6f2a('0xe'))]}},'attributes':[_0x6f2a('0x10'),'disposition',_0x6f2a('0x11'),_0x6f2a('0x12')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 8a67b00..35b1631 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 _0x2148=['../client','CreateVoiceDialReport'];(function(_0x536eca,_0x18b615){var _0x28f35f=function(_0x34bbbe){while(--_0x34bbbe){_0x536eca['push'](_0x536eca['shift']());}};_0x28f35f(++_0x18b615);}(_0x2148,0xba));var _0x8214=function(_0x2df1f2,_0x58d388){_0x2df1f2=_0x2df1f2-0x0;var _0x38652b=_0x2148[_0x2df1f2];return _0x38652b;};'use strict';var client=require(_0x8214('0x0'));exports['create']=function(_0x1d57dd){return client['Request'](_0x8214('0x1'),{'body':_0x1d57dd,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x82db=['CreateVoiceDialReport','create','Request'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0x82db,0x1cf));var _0xb82d=function(_0x238681,_0x3b0528){_0x238681=_0x238681-0x0;var _0x10adc3=_0x82db[_0x238681];return _0x10adc3;};'use strict';var client=require('../client');exports[_0xb82d('0x0')]=function(_0x4e817b){return client[_0xb82d('0x1')]('CreateVoiceDialReport',{'body':_0x4e817b,'log':_0xb82d('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index a976187..6dc8258 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 _0x657b=['../client','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x11f249,_0x4ca4a8){var _0x5c3656=function(_0x27c9f8){while(--_0x27c9f8){_0x11f249['push'](_0x11f249['shift']());}};_0x5c3656(++_0x4ca4a8);}(_0x657b,0x131));var _0xb657=function(_0x1caa8c,_0x3ee02f){_0x1caa8c=_0x1caa8c-0x0;var _0x48e5b0=_0x657b[_0x1caa8c];return _0x48e5b0;};'use strict';var client=require(_0xb657('0x0'));exports[_0xb657('0x1')]=function(){return function(){return client[_0xb657('0x2')](_0xb657('0x3'),{'options':{'raw':!![],'attributes':['id',_0xb657('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xb657('0x1')});};}; \ No newline at end of file +var _0x58a7=['recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58a7,0xf7));var _0x758a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x58a7[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x758a('0x0'));exports[_0x758a('0x1')]=function(){return function(){return client[_0x758a('0x2')](_0x758a('0x3'),{'options':{'raw':!![],'attributes':['id',_0x758a('0x4'),_0x758a('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x758a('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index f48bbfa..cf9515d 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 _0x318e=['dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','callerid','active','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','../client','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry'];(function(_0x582b0f,_0x35a9de){var _0x4658f0=function(_0x106924){while(--_0x106924){_0x582b0f['push'](_0x582b0f['shift']());}};_0x4658f0(++_0x35a9de);}(_0x318e,0x6f));var _0xe318=function(_0x1a8f5f,_0x50fe7e){_0x1a8f5f=_0x1a8f5f-0x0;var _0x502071=_0x318e[_0x1a8f5f];return _0x502071;};'use strict';var client=require(_0xe318('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0xe318('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xe318('0x2'),_0xe318('0x3'),_0xe318('0x4'),_0xe318('0x5'),_0xe318('0x6'),_0xe318('0x7'),_0xe318('0x8'),_0xe318('0x9'),'dialLimitQueue',_0xe318('0xa'),_0xe318('0xb'),_0xe318('0xc'),_0xe318('0xd'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout',_0xe318('0xe'),'dialQueueTimeout',_0xe318('0xf'),_0xe318('0x10'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0xe318('0x11'),_0xe318('0x12'),_0xe318('0x13'),_0xe318('0x14'),'dialTimezone',_0xe318('0x15'),_0xe318('0x16'),_0xe318('0x17'),_0xe318('0x18'),_0xe318('0x19'),_0xe318('0x1a'),'dialAMDAfterGreetingSilence',_0xe318('0x1b'),_0xe318('0x1c'),_0xe318('0x1d'),_0xe318('0x1e'),'dialAMDSilenceThreshold',_0xe318('0x1f'),'timeout',_0xe318('0x20'),_0xe318('0x21'),_0xe318('0x22'),_0xe318('0x23'),_0xe318('0x24'),_0xe318('0x25'),_0xe318('0x5'),_0xe318('0x26'),_0xe318('0x27'),_0xe318('0x28'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency',_0xe318('0x29'),_0xe318('0x2a'),_0xe318('0x2b'),_0xe318('0x2c'),_0xe318('0x2d'),_0xe318('0x2e'),_0xe318('0x2f'),_0xe318('0x30'),_0xe318('0x31'),_0xe318('0x32'),_0xe318('0x33'),_0xe318('0x34'),_0xe318('0x35')],'include':[{'model':_0xe318('0x36'),'as':_0xe318('0x36'),'attributes':['id',_0xe318('0x37'),_0xe318('0x38'),_0xe318('0x39')]},{'model':'Pause','as':_0xe318('0x3a'),'attributes':['id',_0xe318('0x37')]},{'model':_0xe318('0x36'),'as':_0xe318('0x3b'),'attributes':['id','name',_0xe318('0x38'),_0xe318('0x39')]},{'model':_0xe318('0x3c'),'as':'Interval','attributes':['id','name'],'include':[{'model':_0xe318('0x3c'),'as':_0xe318('0x3d'),'attributes':['id',_0xe318('0x37'),_0xe318('0x3e')]}]}]},'log':_0xe318('0x3f')});};}; \ No newline at end of file +var _0xb8e8=['mandatoryDispositionPause','active','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','Pause'];(function(_0x59a6ac,_0x5be681){var _0x76c846=function(_0x5bd431){while(--_0x5bd431){_0x59a6ac['push'](_0x59a6ac['shift']());}};_0x76c846(++_0x5be681);}(_0xb8e8,0x172));var _0x8b8e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb8e8[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0x8b8e('0x0'));exports[_0x8b8e('0x1')]=function(){return function(){return client[_0x8b8e('0x2')](_0x8b8e('0x3'),{'options':{'raw':![],'attributes':['id',_0x8b8e('0x4'),_0x8b8e('0x5'),_0x8b8e('0x6'),_0x8b8e('0x7'),_0x8b8e('0x8'),_0x8b8e('0x9'),_0x8b8e('0xa'),'dialMethod','dialLimitChannel',_0x8b8e('0xb'),_0x8b8e('0xc'),'dialPredictiveOptimization',_0x8b8e('0xd'),_0x8b8e('0xe'),'dialOriginateCallerIdName',_0x8b8e('0xf'),_0x8b8e('0x10'),_0x8b8e('0x11'),'dialQueueTimeout','dialQueueProject',_0x8b8e('0x12'),'dialCongestionRetryFrequency',_0x8b8e('0x13'),_0x8b8e('0x14'),'dialNoAnswerMaxRetry',_0x8b8e('0x15'),_0x8b8e('0x16'),_0x8b8e('0x17'),'dialGlobalInterval',_0x8b8e('0x18'),_0x8b8e('0x19'),_0x8b8e('0x1a'),_0x8b8e('0x1b'),'dialAMDGreeting',_0x8b8e('0x1c'),_0x8b8e('0x1d'),_0x8b8e('0x1e'),_0x8b8e('0x1f'),_0x8b8e('0x20'),_0x8b8e('0x21'),_0x8b8e('0x22'),_0x8b8e('0x23'),_0x8b8e('0x24'),'dialRecallInQueue',_0x8b8e('0x25'),_0x8b8e('0x26'),_0x8b8e('0x27'),'dialQueueProject2','monitor_format',_0x8b8e('0x28'),_0x8b8e('0x29'),_0x8b8e('0x2a'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency',_0x8b8e('0x2b'),_0x8b8e('0x2c'),'dialAbandonedMaxRetry',_0x8b8e('0x2d'),_0x8b8e('0x2e'),_0x8b8e('0x2f'),_0x8b8e('0x30'),_0x8b8e('0x31'),'mandatoryDisposition',_0x8b8e('0x32'),_0x8b8e('0x33'),_0x8b8e('0x34'),_0x8b8e('0x35')],'include':[{'model':'Trunk','as':_0x8b8e('0x36'),'attributes':['id',_0x8b8e('0x4'),_0x8b8e('0x37'),'active']},{'model':_0x8b8e('0x38'),'as':_0x8b8e('0x39'),'attributes':['id','name']},{'model':_0x8b8e('0x36'),'as':'TrunkBackup','attributes':['id',_0x8b8e('0x4'),_0x8b8e('0x37'),_0x8b8e('0x3a')]},{'model':_0x8b8e('0x3b'),'as':_0x8b8e('0x3b'),'attributes':['id',_0x8b8e('0x4')],'include':[{'model':_0x8b8e('0x3b'),'as':'Intervals','attributes':['id',_0x8b8e('0x4'),_0x8b8e('0x3c')]}]}]},'log':_0x8b8e('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index b9f10ec..cb97d40 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(_0x384049,_0x4bcf0a){var _0x2f9572=function(_0x3a6f84){while(--_0x3a6f84){_0x384049['push'](_0x384049['shift']());}};_0x2f9572(++_0x4bcf0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x1eb31c,_0x3afd06){var _0x5df7a0=function(_0xc07fb3){while(--_0xc07fb3){_0x1eb31c['push'](_0x1eb31c['shift']());}};_0x5df7a0(++_0x3afd06);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 69a7a3f..d503521 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 _0x9163=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x1b2408,_0x1048e1){var _0x17198e=function(_0xce6d4d){while(--_0xce6d4d){_0x1b2408['push'](_0x1b2408['shift']());}};_0x17198e(++_0x1048e1);}(_0x9163,0x10a));var _0x3916=function(_0x109a90,_0x489fcc){_0x109a90=_0x109a90-0x0;var _0x58dffc=_0x9163[_0x109a90];return _0x58dffc;};'use strict';var client=require(_0x3916('0x0'));exports[_0x3916('0x1')]=function(_0x43efd6){return function(){return client[_0x3916('0x2')](_0x3916('0x3'),{'options':{'where':{'VoiceQueueId':_0x43efd6,'paused':!![]},'raw':!![]},'log':_0x3916('0x1')});};}; \ No newline at end of file +var _0x5fbb=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses','../client'];(function(_0x29d5e3,_0x3e8755){var _0x525e8a=function(_0x54f505){while(--_0x54f505){_0x29d5e3['push'](_0x29d5e3['shift']());}};_0x525e8a(++_0x3e8755);}(_0x5fbb,0x12b));var _0xb5fb=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5fbb[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require(_0xb5fb('0x0'));exports['getVoiceQueueRtPauses']=function(_0x499d8b){return function(){return client[_0xb5fb('0x1')](_0xb5fb('0x2'),{'options':{'where':{'VoiceQueueId':_0x499d8b,'paused':!![]},'raw':!![]},'log':_0xb5fb('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 0adf0b3..1a765e0 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(_0x461e7b,_0xa8056){var _0x1e9900=function(_0x202535){while(--_0x202535){_0x461e7b['push'](_0x461e7b['shift']());}};_0x1e9900(++_0xa8056);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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(_0x34c95b,_0x382d3e){var _0xb0cef=function(_0x3df8ae){while(--_0x3df8ae){_0x34c95b['push'](_0x34c95b['shift']());}};_0xb0cef(++_0x382d3e);}(_0x7a54,0x106));var _0x47a5=function(_0x5701ec,_0x35a9da){_0x5701ec=_0x5701ec-0x0;var _0x2fe223=_0x7a54[_0x5701ec];return _0x2fe223;};'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 d0c60c6..2328522 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 _0x6f16=['transfererexten','transfereecalleridnum','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode'];(function(_0x3704a8,_0x8b933b){var _0xe2ce57=function(_0x46d8eb){while(--_0x46d8eb){_0x3704a8['push'](_0x3704a8['shift']());}};_0xe2ce57(++_0x8b933b);}(_0x6f16,0x18f));var _0x66f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f16[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x66f1('0x0'));exports[_0x66f1('0x1')]={};exports[_0x66f1('0x2')]=function(_0x4f19f8){return client[_0x66f1('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x4f19f8[_0x66f1('0x4')],'transfererchannel':_0x4f19f8[_0x66f1('0x5')],'transferercalleridnum':_0x4f19f8[_0x66f1('0x6')],'transferercalleridname':_0x4f19f8[_0x66f1('0x7')],'transfererconnectedlinenum':_0x4f19f8[_0x66f1('0x8')],'transfererconnectedlinename':_0x4f19f8[_0x66f1('0x9')],'transfereraccountcode':_0x4f19f8[_0x66f1('0xa')],'transferercontext':_0x4f19f8['transferercontext'],'transfererexten':_0x4f19f8[_0x66f1('0xb')],'transfererlinkedid':_0x4f19f8['transfererlinkedid'],'transfereechannel':_0x4f19f8['transfereechannel'],'transfereecalleridnum':_0x4f19f8[_0x66f1('0xc')],'transfereecalleridname':_0x4f19f8['transfereecalleridname'],'transfereeconnectedlinenum':_0x4f19f8[_0x66f1('0xd')],'transfereeconnectedlinename':_0x4f19f8['transfereeconnectedlinename'],'transfereeaccountcode':_0x4f19f8[_0x66f1('0xe')],'transfereecontext':_0x4f19f8[_0x66f1('0xf')],'transfereeexten':_0x4f19f8[_0x66f1('0x10')],'transfereelinkedid':_0x4f19f8[_0x66f1('0x11')],'isexternal':_0x4f19f8[_0x66f1('0x12')],'context':_0x4f19f8[_0x66f1('0x13')],'extension':_0x4f19f8[_0x66f1('0x14')],'type':_0x66f1('0x15')},'log':_0x66f1('0x16')});};exports[_0x66f1('0x17')]=function(_0x4d6f3a){return client[_0x66f1('0x3')](_0x66f1('0x16'),{'body':{'result':_0x4d6f3a[_0x66f1('0x4')],'transfererchannel':_0x4d6f3a[_0x66f1('0x18')],'transferercalleridnum':_0x4d6f3a[_0x66f1('0x19')],'transferercalleridname':_0x4d6f3a['origtransferercalleridname'],'transfererconnectedlinenum':_0x4d6f3a['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x4d6f3a['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4d6f3a[_0x66f1('0x1a')],'transferercontext':_0x4d6f3a[_0x66f1('0x1b')],'transfererexten':_0x4d6f3a['secondtransfererexten'],'transfererlinkedid':_0x4d6f3a[_0x66f1('0x1c')],'transfereechannel':_0x4d6f3a[_0x66f1('0x1d')],'transfereecalleridnum':_0x4d6f3a[_0x66f1('0x1e')],'transfereecalleridname':_0x4d6f3a[_0x66f1('0x1f')],'transfereeconnectedlinenum':_0x4d6f3a[_0x66f1('0x20')],'transfereeconnectedlinename':_0x4d6f3a[_0x66f1('0x21')],'transfereeaccountcode':_0x4d6f3a[_0x66f1('0x22')],'transfereecontext':_0x4d6f3a[_0x66f1('0x23')],'transfereeexten':_0x4d6f3a[_0x66f1('0x24')],'transfereelinkedid':_0x4d6f3a[_0x66f1('0x25')],'isexternal':_0x4d6f3a[_0x66f1('0x12')],'context':_0x4d6f3a[_0x66f1('0x26')],'extension':_0x4d6f3a[_0x66f1('0x27')],'type':_0x66f1('0x28')},'log':_0x66f1('0x16')});}; \ No newline at end of file +var _0x185b=['secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransferercalleridnum','origtransferercalleridname'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x185b,0xab));var _0xb185=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x185b[_0x2070da];return _0x4f9fe1;};'use strict';var client=require(_0xb185('0x0'));exports[_0xb185('0x1')]={};exports['blindTransfer']=function(_0x2ac066){return client[_0xb185('0x2')](_0xb185('0x3'),{'body':{'result':_0x2ac066[_0xb185('0x4')],'transfererchannel':_0x2ac066['transfererchannel'],'transferercalleridnum':_0x2ac066[_0xb185('0x5')],'transferercalleridname':_0x2ac066[_0xb185('0x6')],'transfererconnectedlinenum':_0x2ac066[_0xb185('0x7')],'transfererconnectedlinename':_0x2ac066[_0xb185('0x8')],'transfereraccountcode':_0x2ac066[_0xb185('0x9')],'transferercontext':_0x2ac066[_0xb185('0xa')],'transfererexten':_0x2ac066['transfererexten'],'transfererlinkedid':_0x2ac066[_0xb185('0xb')],'transfereechannel':_0x2ac066[_0xb185('0xc')],'transfereecalleridnum':_0x2ac066['transfereecalleridnum'],'transfereecalleridname':_0x2ac066['transfereecalleridname'],'transfereeconnectedlinenum':_0x2ac066['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x2ac066[_0xb185('0xd')],'transfereeaccountcode':_0x2ac066['transfereeaccountcode'],'transfereecontext':_0x2ac066[_0xb185('0xe')],'transfereeexten':_0x2ac066[_0xb185('0xf')],'transfereelinkedid':_0x2ac066[_0xb185('0x10')],'isexternal':_0x2ac066[_0xb185('0x11')],'context':_0x2ac066[_0xb185('0x12')],'extension':_0x2ac066[_0xb185('0x13')],'type':_0xb185('0x14')},'log':_0xb185('0x3')});};exports[_0xb185('0x15')]=function(_0x37117c){return client['Request'](_0xb185('0x3'),{'body':{'result':_0x37117c[_0xb185('0x4')],'transfererchannel':_0x37117c['origtransfererchannel'],'transferercalleridnum':_0x37117c[_0xb185('0x16')],'transferercalleridname':_0x37117c[_0xb185('0x17')],'transfererconnectedlinenum':_0x37117c['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x37117c[_0xb185('0x18')],'transfereraccountcode':_0x37117c[_0xb185('0x19')],'transferercontext':_0x37117c['secondtransferercontext'],'transfererexten':_0x37117c['secondtransfererexten'],'transfererlinkedid':_0x37117c[_0xb185('0x1a')],'transfereechannel':_0x37117c[_0xb185('0x1b')],'transfereecalleridnum':_0x37117c[_0xb185('0x1c')],'transfereecalleridname':_0x37117c[_0xb185('0x1d')],'transfereeconnectedlinenum':_0x37117c[_0xb185('0x1e')],'transfereeconnectedlinename':_0x37117c[_0xb185('0x1f')],'transfereeaccountcode':_0x37117c[_0xb185('0x20')],'transfereecontext':_0x37117c[_0xb185('0x21')],'transfereeexten':_0x37117c[_0xb185('0x22')],'transfereelinkedid':_0x37117c[_0xb185('0x23')],'isexternal':_0x37117c[_0xb185('0x11')],'context':_0x37117c[_0xb185('0x24')],'extension':_0x37117c[_0xb185('0x25')],'type':_0xb185('0x26')},'log':_0xb185('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index a8bd89a..9acc250 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x5e0c35,_0x5b184c){var _0x530d87=function(_0x55a944){while(--_0x55a944){_0x5e0c35['push'](_0x5e0c35['shift']());}};_0x530d87(++_0x5b184c);}(_0xb10b,0x12a));var _0xbb10=function(_0x223b71,_0x597bfb){_0x223b71=_0x223b71-0x0;var _0x4131e4=_0xb10b[_0x223b71];return _0x4131e4;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file +var _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x261a8d,_0x2a1384){var _0x1d8c99=function(_0x537dc7){while(--_0x537dc7){_0x261a8d['push'](_0x261a8d['shift']());}};_0x1d8c99(++_0x2a1384);}(_0x7a54,0x106));var _0x47a5=function(_0x1253f8,_0x44417f){_0x1253f8=_0x1253f8-0x0;var _0x357383=_0x7a54[_0x1253f8];return _0x357383;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 4880a33..8437377 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 _0x584e=['[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','name','action','toLowerCase','merge','lodash','ioredis','util','../../../../config/environment','../../rpc/cmContact','redis','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','data3','split','phone','map','routeId','destcalleridnum','calleridnum','mobile','fax','ListId','createdAt','updatedAt','union','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','','destcalleridname','Unknown','resolve','push'];(function(_0x588de6,_0x445aff){var _0x1d7121=function(_0x12764d){while(--_0x12764d){_0x588de6['push'](_0x588de6['shift']());}};_0x1d7121(++_0x445aff);}(_0x584e,0xa3));var _0xe584=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0x584e[_0x29df9a];return _0x3a8e96;};'use strict';var _=require(_0xe584('0x0'));var BPromise=require('bluebird');var Redis=require(_0xe584('0x1'));var util=require(_0xe584('0x2'));var config=require(_0xe584('0x3'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0xe584('0x4'));config[_0xe584('0x5')]=_['defaults'](config[_0xe584('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe584('0x5')]));function emit(_0x5092ec,_0x23a456,_0x3fde0e,_0x4a989a,_0x5be9a1){logger[_0xe584('0x6')](_0xe584('0x7'),_0x5092ec,_0x23a456['id'],_0x3fde0e,_0x4a989a,JSON[_0xe584('0x8')](_0x5be9a1));io['to'](_0x3fde0e)[_0xe584('0x9')](_0x4a989a,_0x5be9a1);}exports[_0xe584('0xa')]=function(_0xe517e9,_0xc61471,_0x121b55,_0x1e0f62){var _0x4c4248,_0xdb8ab4;var _0x14bb9f={};var _0x4357ba;var _0x59cd06=Number(_0x121b55[_0xe584('0xb')]);var _0x2a5813=_0x121b55[_0xe584('0xc')]?Boolean(Number(_0x121b55[_0xe584('0xc')])):![];var _0x29aeaa;var _0x47828a=![];if(!_[_0xe584('0xd')](_0x121b55[_0xe584('0xe')])){if(_0x121b55[_0xe584('0xe')]=='1')_0x47828a=!![];}if(!_0x47828a){if(_0x1e0f62[_0xe584('0xf')]){_0x14bb9f['id']=_0x1e0f62['xmd-contactid'];}}if(!_0x14bb9f['id']){_0x14bb9f['ListId']=_0x59cd06;_0x29aeaa=_0x121b55[_0xe584('0x10')]&&_0x121b55['data3']!=='0'?_0x121b55[_0xe584('0x10')][_0xe584('0x11')](','):[_0xe584('0x12')];_0x14bb9f['$or']=_[_0xe584('0x13')](_0x29aeaa,function(_0x3ac1c7){var _0xe8c888={};_0xe8c888[_0x3ac1c7]=_0x1e0f62[_0xe584('0x14')]?_0x1e0f62[_0xe584('0x15')]:_0x1e0f62[_0xe584('0x16')];return _0xe8c888;});_0x4357ba=_0x1e0f62[_0xe584('0x14')]?_0x1e0f62['destcalleridnum']:_0x1e0f62['calleridnum'];}var _0x43ecb1=['id','firstName','lastName',_0xe584('0x12'),_0xe584('0x17'),_0xe584('0x18'),_0xe584('0x19'),_0xe584('0x1a'),'scheduledAt',_0xe584('0x1b')];var _0x3f9a92=_[_0xe584('0x1c')](_0x43ecb1,_0x29aeaa);BPromise['resolve']()[_0xe584('0x1d')](cmContactRpc['getContacts']({'attributes':_0x3f9a92,'where':_0x14bb9f,'phone':_0x4357ba}))[_0xe584('0x1d')](function(_0x134f95){_0xdb8ab4=_0x134f95;if(!_[_0xe584('0x1e')](_0xdb8ab4)){if(_0xdb8ab4[_0xe584('0x1f')]===0x1){_0x4c4248=_0xdb8ab4[0x0];logger['info'](_0xe584('0x20'),_0x1e0f62[_0xe584('0x21')],_0xc61471['id'],_0x4c4248['id']);}else{logger[_0xe584('0x6')](_0xe584('0x22'),_0x1e0f62[_0xe584('0x21')],_0xc61471['id'],_[_0xe584('0x13')](_0xdb8ab4,'id')[_0xe584('0x23')](','));}return;}else{logger[_0xe584('0x6')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x1e0f62['uniqueid'],_0xc61471['id']);var _0x33d163={'ListId':_0x59cd06};var _0x4aa812=_0x121b55['data4']&&_0x121b55[_0xe584('0x24')]!=='0'?_0x121b55[_0xe584('0x24')]:_0xe584('0x12');if(_0x2a5813){logger[_0xe584('0x6')](_0xe584('0x25'),_0x1e0f62['uniqueid'],_0xc61471['id']);_0x33d163[_0x4aa812]=_[_0xe584('0xd')](_0x1e0f62[_0xe584('0x14')])?_0x1e0f62['calleridnum']:_0x1e0f62[_0xe584('0x15')];if(_[_0xe584('0xd')](_0x1e0f62[_0xe584('0x14')])){_0x33d163[_0xe584('0x26')]=_0x1e0f62[_0xe584('0x27')]&&_0x1e0f62[_0xe584('0x27')]!==_0xe584('0x28')?_0x1e0f62[_0xe584('0x27')]:'Unknown';}else{_0x33d163[_0xe584('0x26')]=_0x1e0f62[_0xe584('0x29')]&&_0x1e0f62[_0xe584('0x29')]!==_0xe584('0x28')?_0x1e0f62[_0xe584('0x29')]:_0xe584('0x2a');}return BPromise[_0xe584('0x2b')]()['then'](cmContactRpc['createContact'](_0x33d163))[_0xe584('0x1d')](function(_0x361e23){_0x4c4248=_0x361e23;_0xdb8ab4[_0xe584('0x2c')](_0x361e23);if(_0x4c4248){logger[_0xe584('0x6')](_0xe584('0x2d'),_0x1e0f62[_0xe584('0x21')],_0xc61471['id'],_0x4c4248['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x1e0f62[_0xe584('0x21')],_0xc61471['id']);_0x33d163[_0x4aa812]=_['isNil'](_0x1e0f62[_0xe584('0x14')])?_0x1e0f62[_0xe584('0x16')]:_0x1e0f62[_0xe584('0x15')];if(_[_0xe584('0xd')](_0x1e0f62[_0xe584('0x14')])){_0x33d163['firstName']=_0x1e0f62[_0xe584('0x27')]&&_0x1e0f62[_0xe584('0x27')]!==_0xe584('0x28')?_0x1e0f62[_0xe584('0x27')]:_0xe584('0x2a');}else{_0x33d163['firstName']=_0x1e0f62[_0xe584('0x29')]&&_0x1e0f62[_0xe584('0x29')]!==_0xe584('0x28')?_0x1e0f62[_0xe584('0x29')]:_0xe584('0x2a');}_0x4c4248=_0x33d163;_0xdb8ab4[_0xe584('0x2c')](_0x33d163);return;}}})[_0xe584('0x1d')](function(){if(_0xe517e9){emit(_0x1e0f62[_0xe584('0x21')],_0xc61471,util[_0xe584('0x2e')](_0xe584('0x2f'),_0xe517e9[_0xe584('0x30')]),util[_0xe584('0x2e')]('trigger:%s',_0x121b55[_0xe584('0x31')][_0xe584('0x32')]()),{'evt':_[_0xe584('0x33')](_0x1e0f62,{'autoCreate':_0x2a5813}),'contact':_0x4c4248===undefined?{}:_0x4c4248,'contacts':_0xdb8ab4[_0xe584('0x1f')]===0x0?undefined:_0xdb8ab4});}});}; \ No newline at end of file +var _0x1472=['ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','stringify','emit','data1','data2','isNil','data5','xmd-contactid','data3','phone','$or','routeId','destcalleridnum','calleridnum','firstName','lastName','fax','ListId','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','format','trigger:%s','toLowerCase','merge','length','lodash','bluebird'];(function(_0x1526a9,_0x48fb64){var _0x9f4049=function(_0x13271a){while(--_0x13271a){_0x1526a9['push'](_0x1526a9['shift']());}};_0x9f4049(++_0x48fb64);}(_0x1472,0x166));var _0x2147=function(_0x3f2228,_0x3b27d5){_0x3f2228=_0x3f2228-0x0;var _0x285ae4=_0x1472[_0x3f2228];return _0x285ae4;};'use strict';var _=require(_0x2147('0x0'));var BPromise=require(_0x2147('0x1'));var Redis=require(_0x2147('0x2'));var util=require(_0x2147('0x3'));var config=require(_0x2147('0x4'));var logger=require(_0x2147('0x5'))(_0x2147('0x6'));var cmContactRpc=require(_0x2147('0x7'));config['redis']=_['defaults'](config[_0x2147('0x8')],{'host':_0x2147('0x9'),'port':0x18eb});var io=require(_0x2147('0xa'))(new Redis(config['redis']));function emit(_0x4b8324,_0x160f19,_0x4b8310,_0x4286f8,_0x1d759e){logger[_0x2147('0xb')]('[CM][%s][%s]',_0x4b8324,_0x160f19['id'],_0x4b8310,_0x4286f8,JSON[_0x2147('0xc')](_0x1d759e));io['to'](_0x4b8310)[_0x2147('0xd')](_0x4286f8,_0x1d759e);}exports['exec']=function(_0x39d26a,_0x9b5369,_0x1f8bbc,_0x2809f2){var _0x357f5a,_0x4e4e5e;var _0x23e3ef={};var _0x4d9fcc;var _0x352b6f=Number(_0x1f8bbc[_0x2147('0xe')]);var _0x11a373=_0x1f8bbc[_0x2147('0xf')]?Boolean(Number(_0x1f8bbc[_0x2147('0xf')])):![];var _0x2b1c3a;var _0x365c1c=![];if(!_[_0x2147('0x10')](_0x1f8bbc['data5'])){if(_0x1f8bbc[_0x2147('0x11')]=='1')_0x365c1c=!![];}if(!_0x365c1c){if(_0x2809f2[_0x2147('0x12')]){_0x23e3ef['id']=_0x2809f2['xmd-contactid'];}}if(!_0x23e3ef['id']){_0x23e3ef['ListId']=_0x352b6f;_0x2b1c3a=_0x1f8bbc[_0x2147('0x13')]&&_0x1f8bbc[_0x2147('0x13')]!=='0'?_0x1f8bbc[_0x2147('0x13')]['split'](','):[_0x2147('0x14')];_0x23e3ef[_0x2147('0x15')]=_['map'](_0x2b1c3a,function(_0x35c26b){var _0x3ad5e6={};_0x3ad5e6[_0x35c26b]=_0x2809f2[_0x2147('0x16')]?_0x2809f2[_0x2147('0x17')]:_0x2809f2['calleridnum'];return _0x3ad5e6;});_0x4d9fcc=_0x2809f2[_0x2147('0x16')]?_0x2809f2[_0x2147('0x17')]:_0x2809f2[_0x2147('0x18')];}var _0x125943=['id',_0x2147('0x19'),_0x2147('0x1a'),_0x2147('0x14'),'mobile',_0x2147('0x1b'),_0x2147('0x1c'),_0x2147('0x1d'),_0x2147('0x1e'),_0x2147('0x1f')];var _0x3b2053=_[_0x2147('0x20')](_0x125943,_0x2b1c3a);BPromise[_0x2147('0x21')]()[_0x2147('0x22')](cmContactRpc[_0x2147('0x23')]({'attributes':_0x3b2053,'where':_0x23e3ef,'phone':_0x4d9fcc}))[_0x2147('0x22')](function(_0x36d29a){_0x4e4e5e=_0x36d29a;if(!_[_0x2147('0x24')](_0x4e4e5e)){if(_0x4e4e5e['length']===0x1){_0x357f5a=_0x4e4e5e[0x0];logger[_0x2147('0xb')](_0x2147('0x25'),_0x2809f2[_0x2147('0x26')],_0x9b5369['id'],_0x357f5a['id']);}else{logger[_0x2147('0xb')](_0x2147('0x27'),_0x2809f2[_0x2147('0x26')],_0x9b5369['id'],_[_0x2147('0x28')](_0x4e4e5e,'id')[_0x2147('0x29')](','));}return;}else{logger[_0x2147('0xb')](_0x2147('0x2a'),_0x2809f2[_0x2147('0x26')],_0x9b5369['id']);var _0x1a6128={'ListId':_0x352b6f};var _0x564552=_0x1f8bbc[_0x2147('0x2b')]&&_0x1f8bbc['data4']!=='0'?_0x1f8bbc[_0x2147('0x2b')]:_0x2147('0x14');if(_0x11a373){logger[_0x2147('0xb')](_0x2147('0x2c'),_0x2809f2['uniqueid'],_0x9b5369['id']);_0x1a6128[_0x564552]=_[_0x2147('0x10')](_0x2809f2[_0x2147('0x16')])?_0x2809f2[_0x2147('0x18')]:_0x2809f2[_0x2147('0x17')];if(_[_0x2147('0x10')](_0x2809f2[_0x2147('0x16')])){_0x1a6128[_0x2147('0x19')]=_0x2809f2[_0x2147('0x2d')]&&_0x2809f2[_0x2147('0x2d')]!==_0x2147('0x2e')?_0x2809f2[_0x2147('0x2d')]:_0x2147('0x2f');}else{_0x1a6128[_0x2147('0x19')]=_0x2809f2[_0x2147('0x30')]&&_0x2809f2[_0x2147('0x30')]!==''?_0x2809f2[_0x2147('0x30')]:'Unknown';}return BPromise['resolve']()[_0x2147('0x22')](cmContactRpc[_0x2147('0x31')](_0x1a6128))[_0x2147('0x22')](function(_0x5b9ecd){_0x357f5a=_0x5b9ecd;_0x4e4e5e[_0x2147('0x32')](_0x5b9ecd);if(_0x357f5a){logger[_0x2147('0xb')](_0x2147('0x33'),_0x2809f2[_0x2147('0x26')],_0x9b5369['id'],_0x357f5a['id']);}return;});}else{logger[_0x2147('0xb')](_0x2147('0x34'),_0x2809f2[_0x2147('0x26')],_0x9b5369['id']);_0x1a6128[_0x564552]=_[_0x2147('0x10')](_0x2809f2[_0x2147('0x16')])?_0x2809f2['calleridnum']:_0x2809f2[_0x2147('0x17')];if(_[_0x2147('0x10')](_0x2809f2[_0x2147('0x16')])){_0x1a6128['firstName']=_0x2809f2[_0x2147('0x2d')]&&_0x2809f2[_0x2147('0x2d')]!==_0x2147('0x2e')?_0x2809f2[_0x2147('0x2d')]:_0x2147('0x2f');}else{_0x1a6128[_0x2147('0x19')]=_0x2809f2[_0x2147('0x30')]&&_0x2809f2['destcalleridname']!==_0x2147('0x2e')?_0x2809f2['destcalleridname']:_0x2147('0x2f');}_0x357f5a=_0x1a6128;_0x4e4e5e[_0x2147('0x32')](_0x1a6128);return;}}})[_0x2147('0x22')](function(){if(_0x39d26a){emit(_0x2809f2[_0x2147('0x26')],_0x9b5369,util['format'](_0x2147('0x35'),_0x39d26a[_0x2147('0x36')]),util[_0x2147('0x37')](_0x2147('0x38'),_0x1f8bbc['action'][_0x2147('0x39')]()),{'evt':_[_0x2147('0x3a')](_0x2809f2,{'autoCreate':_0x11a373}),'contact':_0x357f5a===undefined?{}:_0x357f5a,'contacts':_0x4e4e5e[_0x2147('0x3b')]===0x0?undefined:_0x4e4e5e});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 3368f09..c8fa56e 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 _0x87f1=['../../../config/environment','trigger','redis','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','accounts','deskAccounts','custom:agentcalled','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','custom:dialend','syncAgentDial','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','stringify','clone','motionChannel','undefined','voice','debug','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','isNil','data3','uriLocation','data4','windowWidth','data5','800','data6','600','winapp','winApplication','winArguments','name','format','user:%s','trigger:%s','integration','exec','queue','routeId','script','buildUri','parse','query','replace','channel','AllConditions','every','checkConditions','AnyConditions','evt','inspect','account','chat','value','upperFirst','AccountId','operator','interaction','event','membername','lastevent','mailSubstatus','substatus','offlineMessage','exports','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact'];(function(_0x455504,_0x18aabb){var _0x58d338=function(_0x108baa){while(--_0x108baa){_0x455504['push'](_0x455504['shift']());}};_0x58d338(++_0x18aabb);}(_0x87f1,0x170));var _0x187f=function(_0x39d2a7,_0x336009){_0x39d2a7=_0x39d2a7-0x0;var _0x2f577c=_0x87f1[_0x39d2a7];return _0x2f577c;};'use strict';var util=require('util');var _=require(_0x187f('0x0'));var url=require(_0x187f('0x1'));var Mustache=require(_0x187f('0x2'));var Redis=require(_0x187f('0x3'));var urlforward=require(_0x187f('0x4'));var integration=require(_0x187f('0x5'));var cmContact=require(_0x187f('0x6'));var script=require('./script');var config=require(_0x187f('0x7'));var logger=require('../../../config/logger')(_0x187f('0x8'));var ami=require('../ami');config[_0x187f('0x9')]=_['defaults'](config[_0x187f('0x9')],{'host':_0x187f('0xa'),'port':0x18eb});var io=require(_0x187f('0xb'))(new Redis(config[_0x187f('0x9')]));var operators={'equals':function(_0x207047,_0x20456c){return _0x207047==_0x20456c;},'not_equals':function(_0x570b6e,_0x3009ae){return _0x570b6e!=_0x3009ae;}};var barAndWebActions=[_0x187f('0xc'),'url','winapp'];function Trigger(_0x1b088d){this[_0x187f('0xd')]=_0x1b088d[_0x187f('0xd')];this[_0x187f('0xe')]=_0x1b088d[_0x187f('0xe')];this[_0x187f('0xf')]=_0x1b088d[_0x187f('0xf')];this[_0x187f('0x10')]=_0x1b088d[_0x187f('0x10')];this[_0x187f('0x11')]=_0x1b088d['voiceExtensions'];this['zendeskAccounts']=_0x1b088d[_0x187f('0x12')];this[_0x187f('0x13')]=_0x1b088d[_0x187f('0x13')];this[_0x187f('0x14')]=_0x1b088d[_0x187f('0x14')];this[_0x187f('0x15')]=_0x1b088d[_0x187f('0x15')];this['zohoAccounts']=_0x1b088d[_0x187f('0x16')];this['deskAccounts']=_0x1b088d['deskAccounts'];this[_0x187f('0x17')]=_0x1b088d[_0x187f('0x17')];this['servicenowAccounts']=_0x1b088d[_0x187f('0x18')];this['dynamics365Accounts']=_0x1b088d['dynamics365Accounts'];this[_0x187f('0x19')]=_0x1b088d[_0x187f('0x19')];this[_0x187f('0x1a')]={'zendesk':this[_0x187f('0x12')],'salesforce':this['salesforceAccounts'],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x187f('0x15')],'zoho':this[_0x187f('0x16')],'desk':this[_0x187f('0x1b')],'vtiger':this['vtigerAccounts'],'dynamics365':this['dynamics365Accounts'],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x187f('0x18')]};ami['on'](_0x187f('0x1c'),this['syncCustomEvent'][_0x187f('0x1d')](this));ami['on'](_0x187f('0x1e'),this[_0x187f('0x1f')]['bind'](this));ami['on'](_0x187f('0x20'),this['syncCustomEvent'][_0x187f('0x1d')](this));ami['on'](_0x187f('0x21'),this[_0x187f('0x1f')]['bind'](this));ami['on'](_0x187f('0x22'),this[_0x187f('0x1f')][_0x187f('0x1d')](this));ami['on'](_0x187f('0x23'),this[_0x187f('0x1f')]['bind'](this));ami['on']('custom:agentbusy',this[_0x187f('0x1f')][_0x187f('0x1d')](this));ami['on'](_0x187f('0x24'),this[_0x187f('0x1f')][_0x187f('0x1d')](this));ami['on'](_0x187f('0x25'),this[_0x187f('0x1f')][_0x187f('0x1d')](this));ami['on'](_0x187f('0x26'),this['syncCustomEvent'][_0x187f('0x1d')](this));ami['on'](_0x187f('0x27'),this['syncCustomEvent'][_0x187f('0x1d')](this));ami['on'](_0x187f('0x28'),this[_0x187f('0x1f')][_0x187f('0x1d')](this));ami['on'](_0x187f('0x29'),this['syncAgentDial'][_0x187f('0x1d')](this));ami['on'](_0x187f('0x2a'),this['syncAgentDial'][_0x187f('0x1d')](this));ami['on'](_0x187f('0x2b'),this[_0x187f('0x2c')]['bind'](this));ami['on']('custom:newinteraction',this[_0x187f('0x1f')][_0x187f('0x1d')](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0x187f('0x1d')](this));ami['on'](_0x187f('0x2d'),this[_0x187f('0x1f')][_0x187f('0x1d')](this));ami['on'](_0x187f('0x2e'),this[_0x187f('0x1f')][_0x187f('0x1d')](this));ami['on'](_0x187f('0x2f'),this[_0x187f('0x1f')][_0x187f('0x1d')](this));ami['on'](_0x187f('0x30'),this[_0x187f('0x1f')][_0x187f('0x1d')](this));ami['on'](_0x187f('0x31'),this['syncCustomEvent']['bind'](this));ami['on'](_0x187f('0x32'),this[_0x187f('0x1f')][_0x187f('0x1d')](this));}Trigger[_0x187f('0x33')][_0x187f('0x34')]=function(_0xb9d36,_0x393882,_0x4f106b){logger['info'](_0xb9d36,_0x393882,JSON[_0x187f('0x35')](_0x4f106b));io['to'](_0xb9d36)[_0x187f('0x34')](_0x393882,_0x4f106b);};Trigger['prototype'][_0x187f('0x1f')]=function(_0xd8caa9){var _0x5d4c77=_[_0x187f('0x36')](_0xd8caa9);if(typeof _0x5d4c77[_0x187f('0x37')]===_0x187f('0x38')){_0x5d4c77[_0x187f('0x37')]=_0x187f('0x39');}logger[_0x187f('0x3a')](_0x187f('0x1f'),util['inspect'](_0x5d4c77,{'showHidden':!![],'depth':null}));this[_0x187f('0x3b')](_0x5d4c77);};Trigger[_0x187f('0x33')][_0x187f('0x2c')]=function(_0x48af52){if(this[_0x187f('0xe')][_0x48af52[_0x187f('0x3c')]]){this[_0x187f('0x1f')](_0x48af52);}};Trigger[_0x187f('0x33')]['checkTriggers']=function(_0x41112c){var _0x25ed35;for(var _0xd15dd4 in this[_0x187f('0xd')]){if(this[_0x187f('0xd')][_0x187f('0x3d')](_0xd15dd4)){if(this[_0x187f('0xd')][_0xd15dd4][_0x187f('0x3e')]){_0x25ed35=this[_0x187f('0x3f')](this[_0x187f('0xd')][_0xd15dd4],_0x41112c);if(_0x25ed35){_[_0x187f('0x40')](_0x41112c,_0x41112c[_0x187f('0x41')]);for(var _0x1b340b=0x0,_0x13384a,_0xeb8193,_0x16fe20;_0x1b340b0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x204992,_0x294337){var _0x4cada1=function(_0x55909f){while(--_0x55909f){_0x204992['push'](_0x204992['shift']());}};_0x4cada1(++_0x294337);}(_0x814b,0x1a2));var _0xb814=function(_0x5e2862,_0x4760eb){_0x5e2862=_0x5e2862-0x0;var _0x8dcad4=_0x814b[_0x5e2862];return _0x8dcad4;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 5eb42df..9a5364f 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 _0xd839=['internalemailaddress','toUpperCase',']\x20Agent\x20found\x20','userId','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','includes','string','type','nameField','indexOf','ticketType','POST','incidents','getString','Subjects','Fields','phonecall','callDirection','queue','phonecalls','/contacts(','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','modernAuthentication','data7','serverUrl','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','tenantId','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','remoteUri','CloudProvider','data2','resolve','data5','clientId','username','password','clientSecret','then','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','userEmail','email'];(function(_0xba15c0,_0x38e2aa){var _0x4b458a=function(_0x4348ab){while(--_0x4348ab){_0xba15c0['push'](_0xba15c0['shift']());}};_0x4b458a(++_0x38e2aa);}(_0xd839,0xa8));var _0x9d83=function(_0x5cb769,_0x2f9405){_0x5cb769=_0x5cb769-0x0;var _0x52818d=_0xd839[_0x5cb769];return _0x52818d;};'use strict';var _=require('lodash');var rp=require(_0x9d83('0x0'));var util=require(_0x9d83('0x1'));var intUtil=require(_0x9d83('0x2'));var md5=require('md5');var Redis=require('ioredis');var logger=require('../../../../config/logger')(_0x9d83('0x3'));var config=require(_0x9d83('0x4'));config[_0x9d83('0x5')]=_[_0x9d83('0x6')](config['redis'],{'host':_0x9d83('0x7'),'port':0x18eb});var io=require(_0x9d83('0x8'))(new Redis(config['redis']));function getAuthToken(_0x2c5e01,_0x476773,_0x90bf0){if(_0x2c5e01['modernAuthentication']){_0x2c5e01[_0x9d83('0x9')]=_0x2c5e01[_0x9d83('0xa')]['data7'];_0x2c5e01['tenantId']=_0x2c5e01['CloudProvider'][_0x9d83('0xb')];return Promise[_0x9d83('0xc')](_0x2c5e01[_0x9d83('0xa')][_0x9d83('0xd')]);}var _0xd19413={'method':'POST','uri':_0x476773,'form':{'client_id':_0x2c5e01[_0x9d83('0xe')],'resource':_0x2c5e01[_0x9d83('0x9')],'username':_0x2c5e01[_0x9d83('0xf')],'password':_0x2c5e01[_0x9d83('0x10')],'grant_type':_0x9d83('0x10'),'client_secret':_0x2c5e01[_0x9d83('0x11')]},'json':!![]};return rp(_0xd19413)[_0x9d83('0x12')](function(_0x14c6ea){return _0x14c6ea['access_token'];})[_0x9d83('0x13')](function(_0x4b0a07){logger[_0x9d83('0x14')]('['+[_0x90bf0['toUpperCase']()]+_0x9d83('0x15'));return _0x4b0a07[_0x9d83('0x16')];});}function getUser(_0x591f34,_0x5e08cf,_0xd19f7d,_0x5dafd0,_0x5d9225,_0x5d28c9){return new Promise(function(_0x47670a,_0x4916fc){return getAuthToken(_0x5e08cf,_0x5dafd0,_0x5d28c9)[_0x9d83('0x12')](function(_0x331b4e){var _0x21533c={'method':_0x9d83('0x17'),'uri':_0x5d9225+_0x9d83('0x18'),'headers':{'Authorization':_0x9d83('0x19')+_0x331b4e,'OData-Version':_0x9d83('0x1a')},'json':!![]};return rp(_0x21533c);})['then'](function(_0x56c6fd){var _0x3c8027=_0x56c6fd[_0x9d83('0x1b')];var _0x13bf90=![];var _0x1a2677=null;if(!_['isNil'](_0xd19f7d)){if(intUtil['validateEmail'](_0xd19f7d['email'])){_0x591f34[_0x9d83('0x1c')]=_0xd19f7d[_0x9d83('0x1d')];for(_0x1a2677=0x0;_0x1a2677<_0x3c8027['length'];_0x1a2677++){if(_0x3c8027[_0x1a2677][_0x9d83('0x1e')]===_0xd19f7d['email']&&!_0x3c8027[_0x1a2677]['isdisabled']){_0x13bf90=!![];logger['info']('['+[_0x5d28c9[_0x9d83('0x1f')]()]+_0x9d83('0x20')+_0x3c8027[_0x1a2677]['systemuserid']+'!');_0x591f34[_0x9d83('0x21')]=_0x3c8027[_0x1a2677][_0x9d83('0x22')];}}}}if(!_0x13bf90){logger[_0x9d83('0x23')]('['+[_0x5d28c9[_0x9d83('0x1f')]()]+_0x9d83('0x24'));_0x591f34['userEmail']=_0x5e08cf[_0x9d83('0xf')];for(_0x1a2677=0x0;_0x1a2677<_0x3c8027[_0x9d83('0x25')];_0x1a2677++){if(_0x3c8027[_0x1a2677][_0x9d83('0x1e')]===_0x5e08cf['username']){_0x591f34['userId']=_0x3c8027[_0x1a2677][_0x9d83('0x22')];}}}_0x47670a(_0x591f34);})[_0x9d83('0x13')](function(_0x3dd105){_0x4916fc(_0x3dd105[_0x9d83('0x16')]);});});}function createEndUser(_0x585a7d,_0x3ecb9e,_0x587878,_0x21d5c5,_0x596014,_0x32d5fa,_0x3a156a){return new Promise(function(_0xf01726,_0x2080fc){return getAuthToken(_0x3ecb9e,_0x587878,_0x32d5fa)[_0x9d83('0x12')](function(_0x2bdf78){var _0x21a663=_0x32d5fa[_0x9d83('0x26')]()===_0x9d83('0x27')?_0x596014[_0x9d83('0x28')]:_0x596014[_0x9d83('0x29')];var _0x1c0c68={'method':'POST','uri':_0x21d5c5+'contacts','body':{'fullname':_0x21a663,'firstname':_0x21a663,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x9d83('0x2a')+_0x585a7d[_0x9d83('0x21')]+')'},'headers':{'Authorization':_0x9d83('0x19')+_0x2bdf78,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x1c0c68[_0x9d83('0x2b')][_0x3a156a]=_0x21a663;return rp(_0x1c0c68);})['then'](function(_0xe34ae6){var _0x238ecb=_0xe34ae6[_0x9d83('0x2c')][_0x9d83('0x2d')];var _0x564388=_0x238ecb[_0x9d83('0x2e')](_0x238ecb[_0x9d83('0x2f')]('(')+0x1,_0x238ecb[_0x9d83('0x2f')](')'));_0x585a7d[_0x9d83('0x30')]=_0x564388;_0xf01726(_0x585a7d);})['catch'](function(_0x3b7475){_0x2080fc(_0x3b7475[_0x9d83('0x16')]);});});}function getEndUser(_0x326d64,_0x27ea14,_0x31310c,_0x5222c0,_0x250014,_0x1a8ead,_0x3da303,_0x3081bb){var _0x208fe7=_0x1a8ead[_0x9d83('0x26')]()===_0x9d83('0x27')?_0x250014[_0x9d83('0x28')]:_0x250014['calleridnum'];return getAuthToken(_0x27ea14,_0x31310c,_0x1a8ead)['then'](function(_0xe2b9e1){_0x3081bb=_0x3081bb?_0x3081bb:_0x9d83('0x31');var _0x39f2cf={'method':_0x9d83('0x17'),'uri':_0x5222c0+_0x9d83('0x32')+_0x3081bb+_0x9d83('0x33')+_0x3081bb+_0x9d83('0x34')+_0x208fe7[_0x9d83('0x35')]('+',_0x9d83('0x36'))+'\x27','headers':{'Authorization':_0x9d83('0x19')+_0xe2b9e1,'If-None-Match':null,'OData-Version':_0x9d83('0x1a')},'json':!![]};return rp(_0x39f2cf);})['then'](function(_0x1cb5b3){var _0x4abd6a=![];if(!_0x1cb5b3)return _0x4abd6a;var _0x297a54=_0x1cb5b3['value'];for(var _0x577b31=0x0;_0x577b31<_0x297a54[_0x9d83('0x25')];_0x577b31++){if(_0x297a54[_0x577b31][_0x3081bb]===_0x208fe7){_0x4abd6a=!![];_0x326d64[_0x9d83('0x30')]=_0x297a54[_0x577b31]['contactid'];}}return _0x4abd6a;})[_0x9d83('0x12')](function(_0x789c63){if(_0x789c63)return _0x326d64;if(_0x3da303==='nothing'){logger['info']('['+[_0x1a8ead[_0x9d83('0x1f')]()]+_0x9d83('0x37'));return _0x326d64;}return createEndUser(_0x326d64,_0x27ea14,_0x31310c,_0x5222c0,_0x250014,_0x1a8ead,_0x3081bb)[_0x9d83('0x12')](function(_0x668fcd){logger[_0x9d83('0x23')]('['+[_0x1a8ead[_0x9d83('0x1f')]()]+']\x20Enduser\x20created!',_0x668fcd['enduserId']);return _0x668fcd;});});}function getCustomFields(_0x397eb7,_0x35cf9c,_0x2949af){var _0xf71870={};if(_0x397eb7[_0x9d83('0x25')]>0x0){_['forEach'](_0x397eb7,function(_0x595a68){if(_[_0x9d83('0x38')]([_0x9d83('0x39'),'picklist'],_0x595a68[_0x9d83('0x3a')])&&_0x595a68[_0x9d83('0x3b')]&&!_0x595a68['customField']){var _0x12a8c9=_0x595a68['idField'][_0x9d83('0x26')]();var _0x388fe4=_0x12a8c9[_0x9d83('0x2e')](0x0,_0x12a8c9['indexOf']('_'));var _0x396039=_0x12a8c9['substring'](_0x12a8c9[_0x9d83('0x3c')]('_')+0x1);if(_0x388fe4===_0x2949af){_0xf71870[_0x396039]=_0x595a68['content'];}}});}return _0xf71870;}function getTicket(_0x38e7df,_0x43758b,_0x4fa28a,_0x585025,_0xfce720,_0x431390,_0xa69c16){return new Promise(function(_0x5e3182,_0x97e751){var _0x123f15;return getAuthToken(_0x43758b,_0x4fa28a,_0xa69c16)[_0x9d83('0x12')](function(_0x495422){if(_0x431390[_0x9d83('0x3d')]==='incident'){_0x123f15={'method':_0x9d83('0x3e'),'uri':_0x585025+_0x9d83('0x3f'),'body':Object['assign']({},{'title':intUtil[_0x9d83('0x40')](_0x431390[_0x9d83('0x41')],_0xfce720,'\x20'),'description':intUtil['getString'](_0x431390['Descriptions'],_0xfce720,'\x0a'),'customerid_contact@odata.bind':_0x38e7df[_0x9d83('0x30')]?'/contacts('+_0x38e7df['enduserId']+')':undefined,'ownerid@odata.bind':_0x9d83('0x2a')+_0x38e7df['userId']+')','caseorigincode':'1'},getCustomFields(_0x431390[_0x9d83('0x42')],_0xfce720,_0x431390[_0x9d83('0x3d')])),'headers':{'Authorization':_0x9d83('0x19')+_0x495422,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x431390[_0x9d83('0x3d')]===_0x9d83('0x43')){var _0x3276c0=_0x38e7df[_0x9d83('0x30')]?[{'partyid_systemuser@odata.bind':_0x9d83('0x2a')+_0x38e7df[_0x9d83('0x21')]+')','participationtypemask':_0x38e7df[_0x9d83('0x44')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x38e7df[_0x9d83('0x30')]+')','participationtypemask':_0x38e7df[_0x9d83('0x44')]===_0x9d83('0x45')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x38e7df[_0x9d83('0x21')]+')','participationtypemask':_0x38e7df[_0x9d83('0x44')]===_0x9d83('0x45')?0x2:0x1}];_0x123f15={'method':'POST','uri':_0x585025+_0x9d83('0x46'),'body':Object['assign']({},{'subject':intUtil[_0x9d83('0x40')](_0x431390[_0x9d83('0x41')],_0xfce720,'\x20'),'phonenumber':String(_0xfce720[_0x9d83('0x29')]),'description':intUtil[_0x9d83('0x40')](_0x431390['Descriptions'],_0xfce720,'\x0a'),'regardingobjectid_contact@odata.bind':_0x38e7df[_0x9d83('0x30')]?_0x9d83('0x47')+_0x38e7df[_0x9d83('0x30')]+')':undefined,'ownerid@odata.bind':_0x9d83('0x2a')+_0x38e7df['userId']+')','directioncode':_0x38e7df[_0x9d83('0x44')]==='queue'?![]:!![],'phonecall_activity_parties':_0x3276c0},getCustomFields(_0x431390['Fields'],_0xfce720,_0x431390[_0x9d83('0x3d')])),'headers':{'Authorization':_0x9d83('0x19')+_0x495422,'OData-Version':_0x9d83('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x123f15);})['then'](function(_0xa1cf58){var _0x106abb=_0xa1cf58[_0x9d83('0x2c')]['odata-entityid'];var _0x537310=_0x106abb[_0x9d83('0x2e')](_0x106abb[_0x9d83('0x2f')]('(')+0x1,_0x106abb[_0x9d83('0x2f')](')'));_0x38e7df['ticketId']=_0x537310;_0x5e3182(_0x38e7df);})[_0x9d83('0x13')](function(_0x55fec2){_0x97e751(_0x55fec2['message']);});});}function emit(_0x5ae048,_0x5a3505,_0x51ddec,_0x5c4b13){var _0x4d6374={'uri':util[_0x9d83('0x48')](_0x9d83('0x49'),_0x5ae048,_0x51ddec,_0x5c4b13)};io['to'](util[_0x9d83('0x48')](_0x9d83('0x4a'),_0x5a3505))['emit'](_0x9d83('0x4b'),_0x4d6374);}exports['cs']=function(_0x4588c8,_0x42986b,_0x17db6f,_0x903c2f,_0x49efa3,_0xc7024f,_0x1f3066,_0x59846a){var _0x589f77={};_0xc7024f['remoteUri']=_0xc7024f[_0x9d83('0x4c')]?intUtil['stripTrailingSlash'](_0xc7024f[_0x9d83('0xa')][_0x9d83('0x4d')]):intUtil['stripTrailingSlash'](_0xc7024f[_0x9d83('0x9')]);_0xc7024f[_0x9d83('0x4e')]=intUtil[_0x9d83('0x4f')](_0xc7024f[_0x9d83('0x4e')]);_0x589f77[_0x9d83('0x44')]=_0x59846a===_0x9d83('0x45')||_0x59846a===_0x9d83('0x50')?'queue':'outbound';var _0x32a1e5=_0xc7024f['modernAuthentication']?util[_0x9d83('0x48')](_0x9d83('0x51'),_0xc7024f[_0x9d83('0xa')]['data7']):util[_0x9d83('0x48')](_0x9d83('0x51'),_0xc7024f[_0x9d83('0x9')]);var _0x227da3=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0xc7024f[_0x9d83('0x52')]);var _0x5879b1=util[_0x9d83('0x48')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xc7024f['serverUrl'],_0x42986b['uniqueid'],md5(_0x42986b[_0x9d83('0x53')]));if(_0x49efa3&&_0x49efa3[_0x9d83('0x54')]){logger[_0x9d83('0x23')](_0x9d83('0x55'),_0x9d83('0x56'));_0x42986b[_0x9d83('0x57')]=_0x5879b1;}else if(_0x1f3066&&_0x1f3066['recordingFormat']&&_0x1f3066[_0x9d83('0x58')]!==_0x9d83('0x59')){logger['info'](_0x9d83('0x5a'),_0x9d83('0x56'));_0x42986b['recordingURL']=_0x5879b1;}else{_0x42986b[_0x9d83('0x57')]='';}return getUser(_0x589f77,_0xc7024f,_0x903c2f,_0x227da3,_0x32a1e5,_0x59846a)[_0x9d83('0x12')](function(_0x1ad38d){logger[_0x9d83('0x23')]('['+_0x59846a['toUpperCase']()+_0x9d83('0x5b'),_0x1ad38d[_0x9d83('0x21')]);logger[_0x9d83('0x23')]('['+_0x59846a[_0x9d83('0x1f')]()+']\x20The\x20User\x20email\x20is:',_0x1ad38d[_0x9d83('0x1c')]);return getEndUser(_0x1ad38d,_0xc7024f,_0x227da3,_0x32a1e5,_0x42986b,_0x59846a,_0x17db6f[_0x9d83('0x5c')],_0x17db6f['additionalSearchContact']);})[_0x9d83('0x12')](function(_0x2a0085){logger[_0x9d83('0x23')]('['+_0x59846a[_0x9d83('0x1f')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x2a0085[_0x9d83('0x30')]);logger[_0x9d83('0x23')]('['+_0x59846a[_0x9d83('0x1f')]()+_0x9d83('0x5d'),_0x42986b[_0x9d83('0x29')]);return getTicket(_0x2a0085,_0xc7024f,_0x227da3,_0x32a1e5,_0x42986b,_0x17db6f,_0x59846a);})[_0x9d83('0x12')](function(_0x5a1718){logger[_0x9d83('0x23')](util[_0x9d83('0x48')]('['+_0x59846a['toUpperCase']()+_0x9d83('0x5e'),_0x17db6f[_0x9d83('0x3d')],_0x5a1718[_0x9d83('0x5f')]));logger[_0x9d83('0x23')](util['format']('['+_0x59846a[_0x9d83('0x1f')]()+']\x20Call\x20direction:\x20%s',_0x59846a));if(_0x59846a!==_0x9d83('0x50')&&_0x17db6f[_0x9d83('0x60')]){logger[_0x9d83('0x23')]('['+_0x59846a['toUpperCase']()+']',_0x9d83('0x61'));emit(_0xc7024f[_0x9d83('0x9')],_0x903c2f['name'],_0x17db6f['ticketType'],_0x5a1718[_0x9d83('0x5f')]);}})[_0x9d83('0x13')](function(_0x26599e){logger[_0x9d83('0x14')]('['+_0x59846a[_0x9d83('0x1f')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x26599e[_0x9d83('0x16')]);console[_0x9d83('0x14')](_0x9d83('0x62'),_0x26599e);});}; \ No newline at end of file +var _0xb1de=['uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','unmanaged','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','defaults','localhost','socket.io-emitter','redis','modernAuthentication','CloudProvider','data7','tenantId','data2','resolve','data5','POST','remoteUri','username','password','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','toLowerCase','outbound','destcalleridnum','contacts','/systemusers(','Bearer\x20','body','odata-entityid','substring','lastIndexOf','enduserId','calleridnum','telephone1','contacts?$select=','\x20eq\x20\x27','%2b','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','includes','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','Subjects','getString','Descriptions','/contacts(','userId','Fields','callDirection','queue','phonecalls','headers','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x40e35a,_0x1d610a){var _0x5f0637=function(_0x45e78e){while(--_0x45e78e){_0x40e35a['push'](_0x40e35a['shift']());}};_0x5f0637(++_0x1d610a);}(_0xb1de,0x166));var _0xeb1d=function(_0x2f90fa,_0x37724d){_0x2f90fa=_0x2f90fa-0x0;var _0x384458=_0xb1de[_0x2f90fa];return _0x384458;};'use strict';var _=require(_0xeb1d('0x0'));var rp=require(_0xeb1d('0x1'));var util=require(_0xeb1d('0x2'));var intUtil=require(_0xeb1d('0x3'));var md5=require(_0xeb1d('0x4'));var Redis=require('ioredis');var logger=require(_0xeb1d('0x5'))(_0xeb1d('0x6'));var config=require(_0xeb1d('0x7'));config['redis']=_[_0xeb1d('0x8')](config['redis'],{'host':_0xeb1d('0x9'),'port':0x18eb});var io=require(_0xeb1d('0xa'))(new Redis(config[_0xeb1d('0xb')]));function getAuthToken(_0x4d0f6a,_0x17e641,_0x4a7e5c){if(_0x4d0f6a[_0xeb1d('0xc')]){_0x4d0f6a['remoteUri']=_0x4d0f6a[_0xeb1d('0xd')][_0xeb1d('0xe')];_0x4d0f6a[_0xeb1d('0xf')]=_0x4d0f6a[_0xeb1d('0xd')][_0xeb1d('0x10')];return Promise[_0xeb1d('0x11')](_0x4d0f6a[_0xeb1d('0xd')][_0xeb1d('0x12')]);}var _0x29d76f={'method':_0xeb1d('0x13'),'uri':_0x17e641,'form':{'client_id':_0x4d0f6a['clientId'],'resource':_0x4d0f6a[_0xeb1d('0x14')],'username':_0x4d0f6a[_0xeb1d('0x15')],'password':_0x4d0f6a[_0xeb1d('0x16')],'grant_type':_0xeb1d('0x16'),'client_secret':_0x4d0f6a['clientSecret']},'json':!![]};return rp(_0x29d76f)['then'](function(_0x315ef5){return _0x315ef5[_0xeb1d('0x17')];})[_0xeb1d('0x18')](function(_0x1f9fb9){logger[_0xeb1d('0x19')]('['+[_0x4a7e5c[_0xeb1d('0x1a')]()]+_0xeb1d('0x1b'));return _0x1f9fb9[_0xeb1d('0x1c')];});}function getUser(_0x4b7e18,_0x2f8380,_0x839119,_0x1e6e74,_0x3a206c,_0x250db7){return new Promise(function(_0x27efbf,_0x1d68bd){return getAuthToken(_0x2f8380,_0x1e6e74,_0x250db7)[_0xeb1d('0x1d')](function(_0x138ece){var _0x5afbc5={'method':_0xeb1d('0x1e'),'uri':_0x3a206c+_0xeb1d('0x1f'),'headers':{'Authorization':'Bearer\x20'+_0x138ece,'OData-Version':_0xeb1d('0x20')},'json':!![]};return rp(_0x5afbc5);})[_0xeb1d('0x1d')](function(_0x39eddf){var _0x472305=_0x39eddf[_0xeb1d('0x21')];var _0x3e5cee=![];var _0x54c886=null;if(!_['isNil'](_0x839119)){if(intUtil['validateEmail'](_0x839119[_0xeb1d('0x22')])){_0x4b7e18[_0xeb1d('0x23')]=_0x839119['email'];for(_0x54c886=0x0;_0x54c886<_0x472305[_0xeb1d('0x24')];_0x54c886++){if(_0x472305[_0x54c886][_0xeb1d('0x25')]===_0x839119[_0xeb1d('0x22')]&&!_0x472305[_0x54c886][_0xeb1d('0x26')]){_0x3e5cee=!![];logger[_0xeb1d('0x27')]('['+[_0x250db7[_0xeb1d('0x1a')]()]+_0xeb1d('0x28')+_0x472305[_0x54c886][_0xeb1d('0x29')]+'!');_0x4b7e18['userId']=_0x472305[_0x54c886][_0xeb1d('0x29')];}}}}if(!_0x3e5cee){logger[_0xeb1d('0x27')]('['+[_0x250db7[_0xeb1d('0x1a')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4b7e18[_0xeb1d('0x23')]=_0x2f8380[_0xeb1d('0x15')];for(_0x54c886=0x0;_0x54c886<_0x472305[_0xeb1d('0x24')];_0x54c886++){if(_0x472305[_0x54c886]['internalemailaddress']===_0x2f8380['username']){_0x4b7e18['userId']=_0x472305[_0x54c886][_0xeb1d('0x29')];}}}_0x27efbf(_0x4b7e18);})[_0xeb1d('0x18')](function(_0x507f88){_0x1d68bd(_0x507f88[_0xeb1d('0x1c')]);});});}function createEndUser(_0x2f07d3,_0x2b087b,_0xe234e9,_0x2140ab,_0x180150,_0x3a4331,_0x279473){return new Promise(function(_0x3cb7f3,_0x43baed){return getAuthToken(_0x2b087b,_0xe234e9,_0x3a4331)[_0xeb1d('0x1d')](function(_0x3593ea){var _0x50f07f=_0x3a4331[_0xeb1d('0x2a')]()===_0xeb1d('0x2b')?_0x180150[_0xeb1d('0x2c')]:_0x180150['calleridnum'];var _0x2e70ed={'method':'POST','uri':_0x2140ab+_0xeb1d('0x2d'),'body':{'fullname':_0x50f07f,'firstname':_0x50f07f,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xeb1d('0x2e')+_0x2f07d3['userId']+')'},'headers':{'Authorization':_0xeb1d('0x2f')+_0x3593ea,'OData-Version':_0xeb1d('0x20')},'json':!![],'resolveWithFullResponse':!![]};_0x2e70ed[_0xeb1d('0x30')][_0x279473]=_0x50f07f;return rp(_0x2e70ed);})['then'](function(_0x20a89f){var _0x117e56=_0x20a89f['headers'][_0xeb1d('0x31')];var _0x361d56=_0x117e56[_0xeb1d('0x32')](_0x117e56[_0xeb1d('0x33')]('(')+0x1,_0x117e56[_0xeb1d('0x33')](')'));_0x2f07d3[_0xeb1d('0x34')]=_0x361d56;_0x3cb7f3(_0x2f07d3);})['catch'](function(_0x53c6b0){_0x43baed(_0x53c6b0[_0xeb1d('0x1c')]);});});}function getEndUser(_0x26d8fe,_0x1abeab,_0x898e60,_0x47d99c,_0x1a2aeb,_0x2e225d,_0x5448a6,_0x16512d){var _0x88824b=_0x2e225d[_0xeb1d('0x2a')]()===_0xeb1d('0x2b')?_0x1a2aeb[_0xeb1d('0x2c')]:_0x1a2aeb[_0xeb1d('0x35')];return getAuthToken(_0x1abeab,_0x898e60,_0x2e225d)[_0xeb1d('0x1d')](function(_0x556cc7){_0x16512d=_0x16512d?_0x16512d:_0xeb1d('0x36');var _0x50a01f={'method':'GET','uri':_0x47d99c+_0xeb1d('0x37')+_0x16512d+'&$filter='+_0x16512d+_0xeb1d('0x38')+_0x88824b['replace']('+',_0xeb1d('0x39'))+'\x27','headers':{'Authorization':_0xeb1d('0x2f')+_0x556cc7,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x50a01f);})[_0xeb1d('0x1d')](function(_0x5c9169){var _0x51a5eb=![];if(!_0x5c9169)return _0x51a5eb;var _0x801bcf=_0x5c9169[_0xeb1d('0x21')];for(var _0x32a510=0x0;_0x32a510<_0x801bcf[_0xeb1d('0x24')];_0x32a510++){if(_0x801bcf[_0x32a510][_0x16512d]===_0x88824b){_0x51a5eb=!![];_0x26d8fe[_0xeb1d('0x34')]=_0x801bcf[_0x32a510][_0xeb1d('0x3a')];}}return _0x51a5eb;})[_0xeb1d('0x1d')](function(_0x343bfe){if(_0x343bfe)return _0x26d8fe;if(_0x5448a6==='nothing'){logger[_0xeb1d('0x27')]('['+[_0x2e225d['toUpperCase']()]+_0xeb1d('0x3b'));return _0x26d8fe;}return createEndUser(_0x26d8fe,_0x1abeab,_0x898e60,_0x47d99c,_0x1a2aeb,_0x2e225d,_0x16512d)['then'](function(_0x4c6916){logger[_0xeb1d('0x27')]('['+[_0x2e225d['toUpperCase']()]+']\x20Enduser\x20created!',_0x4c6916['enduserId']);return _0x4c6916;});});}function getCustomFields(_0x2f52f6,_0x2fe2c9,_0x363c1e){var _0xad7c42={};if(_0x2f52f6[_0xeb1d('0x24')]>0x0){_['forEach'](_0x2f52f6,function(_0x5262a8){if(_[_0xeb1d('0x3c')]([_0xeb1d('0x3d'),_0xeb1d('0x3e')],_0x5262a8[_0xeb1d('0x3f')])&&_0x5262a8[_0xeb1d('0x40')]&&!_0x5262a8[_0xeb1d('0x41')]){var _0x2d81f1=_0x5262a8[_0xeb1d('0x42')]['toLowerCase']();var _0x549152=_0x2d81f1[_0xeb1d('0x32')](0x0,_0x2d81f1[_0xeb1d('0x43')]('_'));var _0x47ee2d=_0x2d81f1[_0xeb1d('0x32')](_0x2d81f1['indexOf']('_')+0x1);if(_0x549152===_0x363c1e){_0xad7c42[_0x47ee2d]=_0x5262a8[_0xeb1d('0x44')];}}});}return _0xad7c42;}function getTicket(_0x310315,_0x23b424,_0x43274f,_0x3a3822,_0x2f1be9,_0x44b231,_0x46f689){return new Promise(function(_0x577482,_0x6a402a){var _0x45ee2b;return getAuthToken(_0x23b424,_0x43274f,_0x46f689)['then'](function(_0x1b1dca){if(_0x44b231[_0xeb1d('0x45')]===_0xeb1d('0x46')){_0x45ee2b={'method':_0xeb1d('0x13'),'uri':_0x3a3822+_0xeb1d('0x47'),'body':Object[_0xeb1d('0x48')]({},{'title':intUtil['getString'](_0x44b231[_0xeb1d('0x49')],_0x2f1be9,'\x20'),'description':intUtil[_0xeb1d('0x4a')](_0x44b231[_0xeb1d('0x4b')],_0x2f1be9,'\x0a'),'customerid_contact@odata.bind':_0x310315[_0xeb1d('0x34')]?_0xeb1d('0x4c')+_0x310315[_0xeb1d('0x34')]+')':undefined,'ownerid@odata.bind':_0xeb1d('0x2e')+_0x310315[_0xeb1d('0x4d')]+')','caseorigincode':'1'},getCustomFields(_0x44b231[_0xeb1d('0x4e')],_0x2f1be9,_0x44b231[_0xeb1d('0x45')])),'headers':{'Authorization':_0xeb1d('0x2f')+_0x1b1dca,'OData-Version':_0xeb1d('0x20')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x44b231[_0xeb1d('0x45')]==='phonecall'){var _0x566f7e=_0x310315[_0xeb1d('0x34')]?[{'partyid_systemuser@odata.bind':_0xeb1d('0x2e')+_0x310315[_0xeb1d('0x4d')]+')','participationtypemask':_0x310315[_0xeb1d('0x4f')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x310315['enduserId']+')','participationtypemask':_0x310315[_0xeb1d('0x4f')]===_0xeb1d('0x50')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xeb1d('0x2e')+_0x310315[_0xeb1d('0x4d')]+')','participationtypemask':_0x310315[_0xeb1d('0x4f')]===_0xeb1d('0x50')?0x2:0x1}];_0x45ee2b={'method':'POST','uri':_0x3a3822+_0xeb1d('0x51'),'body':Object[_0xeb1d('0x48')]({},{'subject':intUtil[_0xeb1d('0x4a')](_0x44b231['Subjects'],_0x2f1be9,'\x20'),'phonenumber':String(_0x2f1be9[_0xeb1d('0x35')]),'description':intUtil['getString'](_0x44b231[_0xeb1d('0x4b')],_0x2f1be9,'\x0a'),'regardingobjectid_contact@odata.bind':_0x310315[_0xeb1d('0x34')]?_0xeb1d('0x4c')+_0x310315['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x310315[_0xeb1d('0x4d')]+')','directioncode':_0x310315[_0xeb1d('0x4f')]===_0xeb1d('0x50')?![]:!![],'phonecall_activity_parties':_0x566f7e},getCustomFields(_0x44b231['Fields'],_0x2f1be9,_0x44b231['ticketType'])),'headers':{'Authorization':_0xeb1d('0x2f')+_0x1b1dca,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x45ee2b);})[_0xeb1d('0x1d')](function(_0xa938c0){var _0x4a7299=_0xa938c0[_0xeb1d('0x52')][_0xeb1d('0x31')];var _0x48da76=_0x4a7299[_0xeb1d('0x32')](_0x4a7299[_0xeb1d('0x33')]('(')+0x1,_0x4a7299[_0xeb1d('0x33')](')'));_0x310315[_0xeb1d('0x53')]=_0x48da76;_0x577482(_0x310315);})['catch'](function(_0x273bbe){_0x6a402a(_0x273bbe[_0xeb1d('0x1c')]);});});}function emit(_0x53da28,_0x28db96,_0x337dce,_0xd421cb){var _0xd67163={'uri':util[_0xeb1d('0x54')](_0xeb1d('0x55'),_0x53da28,_0x337dce,_0xd421cb)};io['to'](util[_0xeb1d('0x54')](_0xeb1d('0x56'),_0x28db96))[_0xeb1d('0x57')](_0xeb1d('0x58'),_0xd67163);}exports['cs']=function(_0x2892fd,_0x83d899,_0x2b7808,_0x4dbbbc,_0x47c67b,_0x26dff9,_0x387eb0,_0x575b20){var _0x4c8067={};_0x26dff9[_0xeb1d('0x14')]=_0x26dff9[_0xeb1d('0xc')]?intUtil[_0xeb1d('0x59')](_0x26dff9[_0xeb1d('0xd')][_0xeb1d('0xe')]):intUtil[_0xeb1d('0x59')](_0x26dff9[_0xeb1d('0x14')]);_0x26dff9[_0xeb1d('0x5a')]=intUtil[_0xeb1d('0x59')](_0x26dff9['serverUrl']);_0x4c8067[_0xeb1d('0x4f')]=_0x575b20===_0xeb1d('0x50')||_0x575b20==='unmanaged'?_0xeb1d('0x50'):_0xeb1d('0x2b');var _0x51c5d0=_0x26dff9[_0xeb1d('0xc')]?util[_0xeb1d('0x54')](_0xeb1d('0x5b'),_0x26dff9[_0xeb1d('0xd')][_0xeb1d('0xe')]):util[_0xeb1d('0x54')]('%s/api/data/v9.0/',_0x26dff9[_0xeb1d('0x14')]);var _0x5d5173=util[_0xeb1d('0x54')](_0xeb1d('0x5c'),_0x26dff9[_0xeb1d('0xf')]);var _0x2156a3=util[_0xeb1d('0x54')](_0xeb1d('0x5d'),_0x26dff9['serverUrl'],_0x83d899[_0xeb1d('0x5e')],md5(_0x83d899[_0xeb1d('0x5e')]));if(_0x47c67b&&_0x47c67b[_0xeb1d('0x5f')]){logger[_0xeb1d('0x27')](_0xeb1d('0x60'),'Recording\x20is\x20enabled!');_0x83d899[_0xeb1d('0x61')]=_0x2156a3;}else if(_0x387eb0&&_0x387eb0['recordingFormat']&&_0x387eb0[_0xeb1d('0x62')]!=='none'){logger[_0xeb1d('0x27')](_0xeb1d('0x63'),_0xeb1d('0x64'));_0x83d899[_0xeb1d('0x61')]=_0x2156a3;}else{_0x83d899['recordingURL']='';}return getUser(_0x4c8067,_0x26dff9,_0x4dbbbc,_0x5d5173,_0x51c5d0,_0x575b20)[_0xeb1d('0x1d')](function(_0x3cd24a){logger[_0xeb1d('0x27')]('['+_0x575b20[_0xeb1d('0x1a')]()+_0xeb1d('0x65'),_0x3cd24a[_0xeb1d('0x4d')]);logger['info']('['+_0x575b20[_0xeb1d('0x1a')]()+_0xeb1d('0x66'),_0x3cd24a['userEmail']);return getEndUser(_0x3cd24a,_0x26dff9,_0x5d5173,_0x51c5d0,_0x83d899,_0x575b20,_0x2b7808[_0xeb1d('0x67')],_0x2b7808[_0xeb1d('0x68')]);})[_0xeb1d('0x1d')](function(_0xaee921){logger[_0xeb1d('0x27')]('['+_0x575b20[_0xeb1d('0x1a')]()+_0xeb1d('0x69'),_0xaee921[_0xeb1d('0x34')]);logger[_0xeb1d('0x27')]('['+_0x575b20[_0xeb1d('0x1a')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x83d899['calleridnum']);return getTicket(_0xaee921,_0x26dff9,_0x5d5173,_0x51c5d0,_0x83d899,_0x2b7808,_0x575b20);})['then'](function(_0x3b62c1){logger[_0xeb1d('0x27')](util[_0xeb1d('0x54')]('['+_0x575b20[_0xeb1d('0x1a')]()+_0xeb1d('0x6a'),_0x2b7808[_0xeb1d('0x45')],_0x3b62c1[_0xeb1d('0x53')]));logger['info'](util[_0xeb1d('0x54')]('['+_0x575b20[_0xeb1d('0x1a')]()+']\x20Call\x20direction:\x20%s',_0x575b20));if(_0x575b20!==_0xeb1d('0x6b')&&_0x2b7808[_0xeb1d('0x6c')]){logger[_0xeb1d('0x27')]('['+_0x575b20[_0xeb1d('0x1a')]()+']',_0xeb1d('0x6d'));emit(_0x26dff9[_0xeb1d('0x14')],_0x4dbbbc[_0xeb1d('0x6e')],_0x2b7808['ticketType'],_0x3b62c1[_0xeb1d('0x53')]);}})[_0xeb1d('0x18')](function(_0x5c8f4f){logger[_0xeb1d('0x19')]('['+_0x575b20[_0xeb1d('0x1a')]()+_0xeb1d('0x6f'),_0x5c8f4f[_0xeb1d('0x1c')]);console[_0xeb1d('0x19')](_0xeb1d('0x70'),_0x5c8f4f);});}; \ 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 375ef4a..0e04182 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 _0x7201=['lodash','request-promise','md5','util','../../../../config/environment','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','getString','Subjects','
','Tags','name','Fields','custom_fields','mapValues','keyBy','format','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','toString','[HTTP]','stringify','GET','map','forEach','string','picklist','customField','nameField','content','includes','idField','variable','variableName','push','type','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','uniqueid','recordingURL','Authorization','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','[QUEUE]','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','Ticket\x20created!','monitor_format','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridnum','error'];(function(_0x3b5adc,_0x4fd715){var _0x55b1d8=function(_0x2eff86){while(--_0x2eff86){_0x3b5adc['push'](_0x3b5adc['shift']());}};_0x55b1d8(++_0x4fd715);}(_0x7201,0x174));var _0x1720=function(_0x31e737,_0x50eca7){_0x31e737=_0x31e737-0x0;var _0x23a699=_0x7201[_0x31e737];return _0x23a699;};'use strict';var _=require(_0x1720('0x0'));var rp=require(_0x1720('0x1'));var md5=require(_0x1720('0x2'));var util=require(_0x1720('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x1720('0x4'));var logger=require('../../../../config/logger')(_0x1720('0x5'));config[_0x1720('0x6')]=_[_0x1720('0x7')](config[_0x1720('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x1720('0x8'))(new Redis(config[_0x1720('0x6')]));var headers={'Content-Type':_0x1720('0x9'),'Accept':_0x1720('0x9')};function emit(_0x42a3db,_0x4f441d,_0x2a1d42){io['to'](_0x42a3db)[_0x1720('0xa')](_0x4f441d,_0x2a1d42);}function getTicket(_0x23b6cb,_0x240ac7,_0x3b8291,_0xf4dc64,_0x28f306){logger[_0x1720('0xb')](_0x1720('0xc'));var _0x127e0b=_[_0x1720('0xd')]({'responder_id':_0x240ac7['id'],'requester_id':_0x3b8291['id'],'name':util['format'](_0x1720('0xe'),_0x28f306[_0x1720('0xf')]),'phone':_0x28f306['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x1720('0x10')](_0xf4dc64[_0x1720('0x11')],_0x28f306,'\x20'),'description':intUtil['getString'](_0xf4dc64['Descriptions'],_0x28f306,_0x1720('0x12')),'tags':getTags(_0xf4dc64[_0x1720('0x13')],_0x1720('0x14'))},getCustomFields(_0xf4dc64[_0x1720('0x15')],_0x28f306));_0x127e0b[_0x1720('0x16')]=_[_0x1720('0x17')](_[_0x1720('0x18')](_0x127e0b['custom_fields'],'id'),'value');return request({'uri':util[_0x1720('0x19')](_0x1720('0x1a'),_0x23b6cb[_0x1720('0x1b')]),'method':_0x1720('0x1c'),'body':_0x127e0b})[_0x1720('0x1d')](function(_0x27a216){logger[_0x1720('0xb')]('Ticket\x20created!');return _0x27a216;});}function getUser(_0x21b303,_0x27695c){if(intUtil[_0x1720('0x1e')](_0x27695c)){return request({'uri':util[_0x1720('0x19')](_0x1720('0x1f'),_0x21b303['remoteUri']),'qs':{'email':_0x27695c}})[_0x1720('0x1d')](function(_0x1d13cf){if(_0x1d13cf[_0x1720('0x20')]){logger['info'](_0x1720('0x21'));return _[_0x1720('0x22')](_0x1d13cf,function(_0x56c583){return _0x56c583[_0x1720('0x23')][_0x1720('0x24')]===_0x27695c;});}else{logger[_0x1720('0xb')](_0x1720('0x25'));return request({'uri':util[_0x1720('0x19')](_0x1720('0x26'),_0x21b303['remoteUri'])})[_0x1720('0x1d')](function(_0x2066ac){logger[_0x1720('0xb')](_0x1720('0x27'));return _0x2066ac;});}});}else{logger[_0x1720('0xb')](_0x1720('0x28'));return request({'uri':util[_0x1720('0x19')](_0x1720('0x26'),_0x21b303[_0x1720('0x1b')])})[_0x1720('0x1d')](function(_0x5f2cba){logger[_0x1720('0xb')]('Admin\x20account\x20selected.');return _0x5f2cba;});}}function getEndUser(_0x2755bc,_0x1ce6ba,_0x5718af){logger[_0x1720('0xb')](_0x1720('0x29'),_0x5718af);return request({'uri':util[_0x1720('0x19')](_0x1720('0x2a'),_0x2755bc['remoteUri']),'qs':{'phone':_0x5718af}})[_0x1720('0x1d')](function(_0x27fa75){if(_0x27fa75[_0x1720('0x20')]){logger[_0x1720('0xb')](_0x1720('0x2b'));return _[_0x1720('0x22')](_0x27fa75,{'phone':_0x5718af});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x1720('0x19')](_0x1720('0x2a'),_0x2755bc[_0x1720('0x1b')]),'method':_0x1720('0x1c'),'body':{'name':_0x1ce6ba,'phone':_0x5718af}})[_0x1720('0x1d')](function(_0x56d1db){logger['info'](_0x1720('0x2c'));return _0x56d1db;});}});}function getAuth(_0x269e36){return util[_0x1720('0x19')](_0x1720('0x2d'),new Buffer(_0x269e36[_0x1720('0x2e')]+':X')[_0x1720('0x2f')]('base64'));}function request(_0x5b87c1){logger['debug'](_0x1720('0x30'),JSON[_0x1720('0x31')](_0x5b87c1));return rp(_['defaults'](_0x5b87c1,{'method':_0x1720('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x42d87c,_0x4aecc3){var _0x2255ed=[];if(_0x42d87c&&_0x42d87c['length']>0x0){_0x2255ed=_[_0x1720('0x33')](_0x42d87c,_0x4aecc3);}return _0x2255ed;}function getCustomFields(_0x19aa8c,_0x5cebbf){var _0x59830d=[];var _0x3865f6={'custom_fields':[]};if(_0x19aa8c[_0x1720('0x20')]>0x0){_[_0x1720('0x34')](_0x19aa8c,function(_0x4df7ad){if(_['includes']([_0x1720('0x35'),_0x1720('0x36')],_0x4df7ad['type'])&&_0x4df7ad['nameField']&&!_0x4df7ad[_0x1720('0x37')]){_0x3865f6[_0x4df7ad[_0x1720('0x38')]['toLowerCase']()]=_0x4df7ad[_0x1720('0x39')][_0x1720('0x2f')]();}else if(_[_0x1720('0x3a')]([_0x1720('0x35'),_0x1720('0x36')],_0x4df7ad['type'])&&_0x4df7ad[_0x1720('0x3b')]&&_0x4df7ad[_0x1720('0x37')]){_0x3865f6[_0x1720('0x16')]['push']({'id':_0x4df7ad['idField'],'value':_0x4df7ad['content'][_0x1720('0x2f')]()});}else if(_0x4df7ad['type']===_0x1720('0x3c')&&_0x4df7ad[_0x1720('0x3d')]&&_0x4df7ad[_0x1720('0x3b')]&&_0x4df7ad[_0x1720('0x37')]){_0x5cebbf[_0x4df7ad[_0x1720('0x3d')]]&&_0x3865f6[_0x1720('0x16')][_0x1720('0x3e')]({'id':_0x4df7ad['idField'],'value':_0x5cebbf[_0x4df7ad[_0x1720('0x3d')]][_0x1720('0x2f')]()});}else if(_0x4df7ad[_0x1720('0x3f')]==='customVariable'&&_0x4df7ad[_0x1720('0x40')]&&_0x4df7ad['Variable'][_0x1720('0x14')]&&_0x4df7ad[_0x1720('0x3b')]&&_0x4df7ad['customField']){_0x5cebbf[_0x4df7ad[_0x1720('0x40')]['name']['toLowerCase']()]&&_0x3865f6[_0x1720('0x16')][_0x1720('0x3e')]({'id':_0x4df7ad[_0x1720('0x3b')],'value':_0x5cebbf[_0x4df7ad[_0x1720('0x40')][_0x1720('0x14')][_0x1720('0x41')]()][_0x1720('0x2f')]()});}});}return _0x3865f6;}exports[_0x1720('0x42')]=function(_0x2929da,_0x16a1be,_0x28865d,_0x5e78d8,_0x8ab53a,_0x10f199){var _0x5aefcf,_0x5530e9;_0x10f199[_0x1720('0x1b')]=intUtil[_0x1720('0x43')](_0x10f199[_0x1720('0x1b')]);_0x10f199['serverUrl']=intUtil[_0x1720('0x43')](_0x10f199[_0x1720('0x44')]);if(_0x8ab53a&&_0x8ab53a['monitor_format']){logger[_0x1720('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x16a1be['recordingURL']=util[_0x1720('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x10f199['serverUrl'],_0x16a1be['uniqueid'],md5(_0x16a1be[_0x1720('0x45')]));}else{_0x16a1be[_0x1720('0x46')]='';}headers[_0x1720('0x47')]=getAuth(_0x10f199);return getUser(_0x10f199,_0x5e78d8[_0x1720('0x24')])[_0x1720('0x1d')](function(_0x5abeb3){_0x5aefcf=_0x5abeb3;logger[_0x1720('0xb')]('The\x20User\x20ID\x20is:',_0x5aefcf['id']);return getEndUser(_0x10f199,_0x16a1be[_0x1720('0xf')],_0x16a1be['calleridnum']);})[_0x1720('0x1d')](function(_0x6c9274){_0x5530e9=_0x6c9274;logger[_0x1720('0xb')](_0x1720('0x48'),_0x5530e9['id']);return getTicket(_0x10f199,_0x5aefcf,_0x5530e9,_0x28865d,_0x16a1be);})[_0x1720('0x1d')](function(_0x3e86d6){if(_0x3e86d6&&_0x3e86d6['id']){logger['info']('Ticket\x20created!');logger['info'](_0x1720('0x49'),_0x3e86d6['id']);logger[_0x1720('0xb')]('[QUEUE]',_0x1720('0x4a'));emit(util[_0x1720('0x19')](_0x1720('0x4b'),_0x5e78d8[_0x1720('0x14')]),_0x1720('0x4c'),{'uri':util[_0x1720('0x19')](_0x1720('0x4d'),_0x10f199[_0x1720('0x1b')],_0x3e86d6['id'])});}})[_0x1720('0x4e')](function(_0x2c3e4e){logger['error'](_0x1720('0x4f'),JSON[_0x1720('0x31')](_0x2c3e4e));});};exports[_0x1720('0x50')]=function(_0x15edf9,_0x14467d,_0x19156d,_0x17b7ee,_0x5bb27b,_0x2a090d,_0x4440cb){var _0x5bffe9,_0x1e8343;_0x2a090d['remoteUri']=intUtil[_0x1720('0x43')](_0x2a090d[_0x1720('0x1b')]);_0x2a090d['serverUrl']=intUtil['stripTrailingSlash'](_0x2a090d['serverUrl']);if(_0x4440cb&&_0x4440cb[_0x1720('0x51')]&&_0x4440cb[_0x1720('0x51')]!=='none'){logger[_0x1720('0xb')](_0x1720('0x52'),_0x1720('0x53'));_0x14467d['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a090d[_0x1720('0x44')],_0x14467d[_0x1720('0x45')],md5(_0x14467d['uniqueid']));}headers['Authorization']=getAuth(_0x2a090d);return getUser(_0x2a090d,_0x17b7ee[_0x1720('0x24')])[_0x1720('0x1d')](function(_0x316baa){_0x5bffe9=_0x316baa;logger[_0x1720('0xb')](_0x1720('0x54'),_0x5bffe9['id']);return getEndUser(_0x2a090d,_0x14467d[_0x1720('0x55')],_0x14467d['destcalleridnum']);})['then'](function(_0x4f9a56){_0x1e8343=_0x4f9a56;logger['info'](_0x1720('0x48'),_0x1e8343['id']);return getTicket(_0x2a090d,_0x5bffe9,_0x1e8343,_0x19156d,_0x14467d);})[_0x1720('0x1d')](function(_0x8f03a3){if(_0x8f03a3&&_0x8f03a3['id']){logger[_0x1720('0xb')](_0x1720('0x56'));logger[_0x1720('0xb')](_0x1720('0x49'),_0x8f03a3['id']);logger[_0x1720('0xb')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x1720('0x19')](_0x1720('0x4b'),_0x17b7ee[_0x1720('0x14')]),_0x1720('0x4c'),{'uri':util[_0x1720('0x19')](_0x1720('0x4d'),_0x2a090d[_0x1720('0x1b')],_0x8f03a3['id'])});}})[_0x1720('0x4e')](function(_0x379a5f){logger['error'](_0x1720('0x52'),JSON['stringify'](_0x379a5f));});};exports['unmanaged']=function(_0x1262ac,_0x568a32,_0x3e8f77,_0x2610f7,_0x3bbac8,_0x455e58){var _0x229f99,_0x3a4947;_0x455e58['remoteUri']=intUtil[_0x1720('0x43')](_0x455e58[_0x1720('0x1b')]);_0x455e58[_0x1720('0x44')]=intUtil[_0x1720('0x43')](_0x455e58[_0x1720('0x44')]);if(_0x3bbac8&&_0x3bbac8[_0x1720('0x57')]){logger[_0x1720('0xb')]('['+_0x568a32[_0x1720('0x58')][_0x1720('0x59')]()+']',_0x1720('0x53'));_0x568a32['recordingURL']=util[_0x1720('0x19')](_0x1720('0x5a'),_0x455e58[_0x1720('0x44')],_0x568a32['uniqueid'],md5(_0x568a32[_0x1720('0x45')]));}else{_0x568a32['recordingURL']='';}headers[_0x1720('0x47')]=getAuth(_0x455e58);return getUser(_0x455e58,'')[_0x1720('0x1d')](function(_0x500e69){_0x229f99=_0x500e69;logger[_0x1720('0xb')](_0x1720('0x54'),_0x229f99['id']);return getEndUser(_0x455e58,_0x568a32['calleridname'],_0x568a32[_0x1720('0x5b')]);})[_0x1720('0x1d')](function(_0x1b0f29){_0x3a4947=_0x1b0f29;logger[_0x1720('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3a4947['id']);return getTicket(_0x455e58,_0x229f99,_0x3a4947,_0x3e8f77,_0x568a32);})[_0x1720('0x1d')](function(_0x31f362){if(_0x31f362){logger[_0x1720('0xb')](_0x1720('0x56'));logger['info'](_0x1720('0x49'),_0x31f362['id']);}})[_0x1720('0x4e')](function(_0x41396c){logger[_0x1720('0x5c')]('['+_0x568a32['lastevent'][_0x1720('0x59')]()+']',JSON[_0x1720('0x31')](_0x41396c));});}; \ No newline at end of file +var _0x5973=['%s/api/v2/contacts','length','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','map','forEach','includes','picklist','nameField','customField','toLowerCase','toString','string','type','idField','push','content','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridnum','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','recordingFormat','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','[OUTBOUND]','unmanaged','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','Subjects','getString','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone'];(function(_0x287872,_0x9ae0c7){var _0x5cd069=function(_0x29fd7f){while(--_0x29fd7f){_0x287872['push'](_0x287872['shift']());}};_0x5cd069(++_0x9ae0c7);}(_0x5973,0xf3));var _0x3597=function(_0x4d84cb,_0x4c81e3){_0x4d84cb=_0x4d84cb-0x0;var _0x40c301=_0x5973[_0x4d84cb];return _0x40c301;};'use strict';var _=require(_0x3597('0x0'));var rp=require(_0x3597('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0x3597('0x2'));var intUtil=require(_0x3597('0x3'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x3597('0x4'));config[_0x3597('0x5')]=_[_0x3597('0x6')](config[_0x3597('0x5')],{'host':_0x3597('0x7'),'port':0x18eb});var io=require(_0x3597('0x8'))(new Redis(config[_0x3597('0x5')]));var headers={'Content-Type':_0x3597('0x9'),'Accept':_0x3597('0x9')};function emit(_0x33cdaf,_0x5a9b1a,_0x4f9c73){io['to'](_0x33cdaf)[_0x3597('0xa')](_0x5a9b1a,_0x4f9c73);}function getTicket(_0x5edd2c,_0x56fd42,_0x27cd72,_0x43cde3,_0x144d8c){logger[_0x3597('0xb')](_0x3597('0xc'));var _0x378a2a=_[_0x3597('0xd')]({'responder_id':_0x56fd42['id'],'requester_id':_0x27cd72['id'],'name':util[_0x3597('0xe')](_0x3597('0xf'),_0x144d8c[_0x3597('0x10')]),'phone':_0x144d8c['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x43cde3[_0x3597('0x11')],_0x144d8c,'\x20'),'description':intUtil[_0x3597('0x12')](_0x43cde3['Descriptions'],_0x144d8c,_0x3597('0x13')),'tags':getTags(_0x43cde3[_0x3597('0x14')],_0x3597('0x15'))},getCustomFields(_0x43cde3[_0x3597('0x16')],_0x144d8c));_0x378a2a[_0x3597('0x17')]=_[_0x3597('0x18')](_[_0x3597('0x19')](_0x378a2a[_0x3597('0x17')],'id'),_0x3597('0x1a'));return request({'uri':util[_0x3597('0xe')](_0x3597('0x1b'),_0x5edd2c[_0x3597('0x1c')]),'method':_0x3597('0x1d'),'body':_0x378a2a})[_0x3597('0x1e')](function(_0x27931a){logger[_0x3597('0xb')](_0x3597('0x1f'));return _0x27931a;});}function getUser(_0x512683,_0x3d79fb){if(intUtil[_0x3597('0x20')](_0x3d79fb)){return request({'uri':util[_0x3597('0xe')](_0x3597('0x21'),_0x512683[_0x3597('0x1c')]),'qs':{'email':_0x3d79fb}})[_0x3597('0x1e')](function(_0x5e43af){if(_0x5e43af['length']){logger[_0x3597('0xb')](_0x3597('0x22'));return _[_0x3597('0x23')](_0x5e43af,function(_0x2e95a1){return _0x2e95a1[_0x3597('0x24')][_0x3597('0x25')]===_0x3d79fb;});}else{logger[_0x3597('0xb')](_0x3597('0x26'));return request({'uri':util['format'](_0x3597('0x27'),_0x512683[_0x3597('0x1c')])})[_0x3597('0x1e')](function(_0x3a2cf4){logger[_0x3597('0xb')](_0x3597('0x28'));return _0x3a2cf4;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x3597('0x27'),_0x512683[_0x3597('0x1c')])})[_0x3597('0x1e')](function(_0x1cf02a){logger[_0x3597('0xb')]('Admin\x20account\x20selected.');return _0x1cf02a;});}}function getEndUser(_0x16bdba,_0x4158cf,_0x7e8d9d){logger[_0x3597('0xb')](_0x3597('0x29'),_0x7e8d9d);return request({'uri':util[_0x3597('0xe')](_0x3597('0x2a'),_0x16bdba['remoteUri']),'qs':{'phone':_0x7e8d9d}})['then'](function(_0x1ec301){if(_0x1ec301[_0x3597('0x2b')]){logger[_0x3597('0xb')]('Enduser\x20found!');return _['find'](_0x1ec301,{'phone':_0x7e8d9d});}else{logger[_0x3597('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x3597('0xe')](_0x3597('0x2a'),_0x16bdba[_0x3597('0x1c')]),'method':_0x3597('0x1d'),'body':{'name':_0x4158cf,'phone':_0x7e8d9d}})[_0x3597('0x1e')](function(_0x4fb854){logger['info'](_0x3597('0x2c'));return _0x4fb854;});}});}function getAuth(_0x422c56){return util['format'](_0x3597('0x2d'),new Buffer(_0x422c56[_0x3597('0x2e')]+':X')['toString'](_0x3597('0x2f')));}function request(_0x30d3ab){logger[_0x3597('0x30')](_0x3597('0x31'),JSON[_0x3597('0x32')](_0x30d3ab));return rp(_[_0x3597('0x6')](_0x30d3ab,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x324f5f,_0x28304c){var _0x4b173f=[];if(_0x324f5f&&_0x324f5f[_0x3597('0x2b')]>0x0){_0x4b173f=_[_0x3597('0x33')](_0x324f5f,_0x28304c);}return _0x4b173f;}function getCustomFields(_0x118a2a,_0x3acdb2){var _0xc9ca9d=[];var _0x428b37={'custom_fields':[]};if(_0x118a2a[_0x3597('0x2b')]>0x0){_[_0x3597('0x34')](_0x118a2a,function(_0x329c27){if(_[_0x3597('0x35')](['string',_0x3597('0x36')],_0x329c27['type'])&&_0x329c27[_0x3597('0x37')]&&!_0x329c27[_0x3597('0x38')]){_0x428b37[_0x329c27['nameField'][_0x3597('0x39')]()]=_0x329c27['content'][_0x3597('0x3a')]();}else if(_[_0x3597('0x35')]([_0x3597('0x3b'),'picklist'],_0x329c27[_0x3597('0x3c')])&&_0x329c27[_0x3597('0x3d')]&&_0x329c27['customField']){_0x428b37[_0x3597('0x17')][_0x3597('0x3e')]({'id':_0x329c27['idField'],'value':_0x329c27[_0x3597('0x3f')][_0x3597('0x3a')]()});}else if(_0x329c27[_0x3597('0x3c')]===_0x3597('0x40')&&_0x329c27[_0x3597('0x41')]&&_0x329c27[_0x3597('0x3d')]&&_0x329c27['customField']){_0x3acdb2[_0x329c27[_0x3597('0x41')]]&&_0x428b37[_0x3597('0x17')][_0x3597('0x3e')]({'id':_0x329c27[_0x3597('0x3d')],'value':_0x3acdb2[_0x329c27['variableName']][_0x3597('0x3a')]()});}else if(_0x329c27['type']===_0x3597('0x42')&&_0x329c27['Variable']&&_0x329c27[_0x3597('0x43')][_0x3597('0x15')]&&_0x329c27[_0x3597('0x3d')]&&_0x329c27[_0x3597('0x38')]){_0x3acdb2[_0x329c27[_0x3597('0x43')][_0x3597('0x15')]['toLowerCase']()]&&_0x428b37[_0x3597('0x17')][_0x3597('0x3e')]({'id':_0x329c27[_0x3597('0x3d')],'value':_0x3acdb2[_0x329c27['Variable'][_0x3597('0x15')][_0x3597('0x39')]()][_0x3597('0x3a')]()});}});}return _0x428b37;}exports[_0x3597('0x44')]=function(_0x38c28b,_0x49a6af,_0x8e6c66,_0x153d1d,_0xaddeb1,_0x1304fe){var _0x1ca773,_0x4ef3cc;_0x1304fe['remoteUri']=intUtil[_0x3597('0x45')](_0x1304fe[_0x3597('0x1c')]);_0x1304fe[_0x3597('0x46')]=intUtil[_0x3597('0x45')](_0x1304fe[_0x3597('0x46')]);if(_0xaddeb1&&_0xaddeb1[_0x3597('0x47')]){logger[_0x3597('0xb')](_0x3597('0x48'),_0x3597('0x49'));_0x49a6af[_0x3597('0x4a')]=util['format'](_0x3597('0x4b'),_0x1304fe[_0x3597('0x46')],_0x49a6af[_0x3597('0x4c')],md5(_0x49a6af['uniqueid']));}else{_0x49a6af[_0x3597('0x4a')]='';}headers[_0x3597('0x4d')]=getAuth(_0x1304fe);return getUser(_0x1304fe,_0x153d1d['email'])[_0x3597('0x1e')](function(_0x24e99d){_0x1ca773=_0x24e99d;logger['info']('The\x20User\x20ID\x20is:',_0x1ca773['id']);return getEndUser(_0x1304fe,_0x49a6af[_0x3597('0x10')],_0x49a6af[_0x3597('0x4e')]);})[_0x3597('0x1e')](function(_0x1906af){_0x4ef3cc=_0x1906af;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4ef3cc['id']);return getTicket(_0x1304fe,_0x1ca773,_0x4ef3cc,_0x8e6c66,_0x49a6af);})[_0x3597('0x1e')](function(_0x444e12){if(_0x444e12&&_0x444e12['id']){logger[_0x3597('0xb')](_0x3597('0x1f'));logger[_0x3597('0xb')](_0x3597('0x4f'),_0x444e12['id']);logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x3597('0x50'),_0x153d1d[_0x3597('0x15')]),_0x3597('0x51'),{'uri':util[_0x3597('0xe')](_0x3597('0x52'),_0x1304fe['remoteUri'],_0x444e12['id'])});}})['catch'](function(_0x1618cf){logger[_0x3597('0x53')]('[QUEUE]',JSON[_0x3597('0x32')](_0x1618cf));});};exports['outbound']=function(_0x597689,_0x4e6214,_0x4d502b,_0x5180cc,_0x696c28,_0xe2c5b5,_0x345488){var _0x3dbb40,_0x488400;_0xe2c5b5[_0x3597('0x1c')]=intUtil[_0x3597('0x45')](_0xe2c5b5['remoteUri']);_0xe2c5b5[_0x3597('0x46')]=intUtil[_0x3597('0x45')](_0xe2c5b5[_0x3597('0x46')]);if(_0x345488&&_0x345488[_0x3597('0x54')]&&_0x345488[_0x3597('0x54')]!=='none'){logger[_0x3597('0xb')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4e6214[_0x3597('0x4a')]=util[_0x3597('0xe')](_0x3597('0x4b'),_0xe2c5b5['serverUrl'],_0x4e6214[_0x3597('0x4c')],md5(_0x4e6214[_0x3597('0x4c')]));}headers['Authorization']=getAuth(_0xe2c5b5);return getUser(_0xe2c5b5,_0x5180cc['email'])['then'](function(_0x5a0d4a){_0x3dbb40=_0x5a0d4a;logger[_0x3597('0xb')](_0x3597('0x55'),_0x3dbb40['id']);return getEndUser(_0xe2c5b5,_0x4e6214[_0x3597('0x56')],_0x4e6214[_0x3597('0x57')]);})[_0x3597('0x1e')](function(_0x364f55){_0x488400=_0x364f55;logger[_0x3597('0xb')](_0x3597('0x58'),_0x488400['id']);return getTicket(_0xe2c5b5,_0x3dbb40,_0x488400,_0x4d502b,_0x4e6214);})[_0x3597('0x1e')](function(_0x4950e1){if(_0x4950e1&&_0x4950e1['id']){logger['info'](_0x3597('0x1f'));logger[_0x3597('0xb')](_0x3597('0x4f'),_0x4950e1['id']);logger['info']('[OUTBOUND]',_0x3597('0x59'));emit(util['format'](_0x3597('0x50'),_0x5180cc[_0x3597('0x15')]),_0x3597('0x51'),{'uri':util[_0x3597('0xe')](_0x3597('0x52'),_0xe2c5b5[_0x3597('0x1c')],_0x4950e1['id'])});}})[_0x3597('0x5a')](function(_0x5d8a6c){logger['error'](_0x3597('0x5b'),JSON[_0x3597('0x32')](_0x5d8a6c));});};exports[_0x3597('0x5c')]=function(_0x256262,_0x18686e,_0x5589f4,_0x26768a,_0x1973ac,_0x510e7b){var _0x21539e,_0xc8be59;_0x510e7b[_0x3597('0x1c')]=intUtil[_0x3597('0x45')](_0x510e7b['remoteUri']);_0x510e7b['serverUrl']=intUtil[_0x3597('0x45')](_0x510e7b[_0x3597('0x46')]);if(_0x1973ac&&_0x1973ac[_0x3597('0x47')]){logger[_0x3597('0xb')]('['+_0x18686e['lastevent']['toUpperCase']()+']',_0x3597('0x49'));_0x18686e[_0x3597('0x4a')]=util[_0x3597('0xe')](_0x3597('0x4b'),_0x510e7b[_0x3597('0x46')],_0x18686e[_0x3597('0x4c')],md5(_0x18686e[_0x3597('0x4c')]));}else{_0x18686e[_0x3597('0x4a')]='';}headers[_0x3597('0x4d')]=getAuth(_0x510e7b);return getUser(_0x510e7b,'')[_0x3597('0x1e')](function(_0x2dcb6c){_0x21539e=_0x2dcb6c;logger[_0x3597('0xb')](_0x3597('0x55'),_0x21539e['id']);return getEndUser(_0x510e7b,_0x18686e['calleridname'],_0x18686e[_0x3597('0x4e')]);})[_0x3597('0x1e')](function(_0x25f58f){_0xc8be59=_0x25f58f;logger[_0x3597('0xb')](_0x3597('0x58'),_0xc8be59['id']);return getTicket(_0x510e7b,_0x21539e,_0xc8be59,_0x5589f4,_0x18686e);})[_0x3597('0x1e')](function(_0x13553f){if(_0x13553f){logger[_0x3597('0xb')](_0x3597('0x1f'));logger[_0x3597('0xb')](_0x3597('0x4f'),_0x13553f['id']);}})[_0x3597('0x5a')](function(_0x4cfc84){logger[_0x3597('0x53')]('['+_0x18686e[_0x3597('0x5d')][_0x3597('0x5e')]()+']',JSON[_0x3597('0x32')](_0x4cfc84));});}; \ 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 afb8c9d..cbfbeaa 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 _0x1810=['Contact','add','headers','ticketId','task','/contacts/','user:%s','emit','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','User\x20found:','userId','userEmail','error','/api/lookup?q=','find','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x1810,0xc8));var _0x0181=function(_0x30791a,_0x4db565){_0x30791a=_0x30791a-0x0;var _0x5393e6=_0x1810[_0x30791a];return _0x5393e6;};'use strict';var _=require(_0x0181('0x0'));var rp=require(_0x0181('0x1'));var md5=require('md5');var util=require(_0x0181('0x2'));var moment=require(_0x0181('0x3'));var Promise=require(_0x0181('0x4'));var Redis=require(_0x0181('0x5'));var intUtil=require(_0x0181('0x6'));var config=require(_0x0181('0x7'));var logger=require(_0x0181('0x8'))(_0x0181('0x9'));config[_0x0181('0xa')]=_[_0x0181('0xb')](config['redis'],{'host':_0x0181('0xc'),'port':0x18eb});var io=require(_0x0181('0xd'))(new Redis(config[_0x0181('0xa')]));function getAdminId(_0x540458,_0x281808,_0x5948b7,_0xe8a97f){return new Promise(function(_0x5cefb5,_0x4625fa){var _0x3d41cf=![];var _0x475cf2={'method':_0x0181('0xe'),'uri':_0xe8a97f+_0x0181('0xf'),'json':!![]};_0x475cf2['headers']=_0x5948b7;logger[_0x0181('0x10')](_0x0181('0x11'));return rp(_0x475cf2)[_0x0181('0x12')](function(_0x56bab6){if(_0x56bab6){var _0x2dabfe=_0x56bab6[_0x0181('0x13')];var _0x5aaf3a=null;for(_0x5aaf3a=0x0;_0x5aaf3a<_0x2dabfe[_0x0181('0x14')];_0x5aaf3a++){if(_0x2dabfe[_0x5aaf3a][_0x0181('0x15')]===_0x540458[_0x0181('0x16')]){_0x540458[_0x0181('0x17')]=_0x2dabfe[_0x5aaf3a]['id'];_0x3d41cf=!![];}}if(_0x3d41cf){logger[_0x0181('0x10')](_0x0181('0x18'),_0x540458['adminId']);_0x5cefb5(_0x540458);}else{_0x4625fa({'statusCode':0x194,'message':_0x0181('0x19')});}}else{_0x4625fa({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x0181('0x1a')](function(_0x308029){logger['error']('['+[_0x281808[_0x0181('0x1b')]()]+']',_0x308029[_0x0181('0x1c')]);_0x4625fa(_0x308029);});});}function getUser(_0x3fb90d,_0xadd1ea,_0x2475dd){return function(_0xfabff8){return new Promise(function(_0x1e4b0e,_0x267789){var _0x38d785={'method':_0x0181('0xe'),'uri':_0x2475dd+_0x0181('0xf'),'json':!![]};_0x38d785['headers']=_0xadd1ea;logger['info'](_0x0181('0x1d'));return rp(_0x38d785)[_0x0181('0x12')](function(_0x150dec){if(_0x150dec){var _0x340db9=_0x150dec['users'];var _0x1c34d9=![];var _0x2e567b=null;if(_0xfabff8[_0x0181('0x1e')]!==null){logger[_0x0181('0x10')](_0x0181('0x1f'),_0xfabff8[_0x0181('0x1e')]);_0xfabff8['userEmail']=_0xfabff8[_0x0181('0x1e')];for(_0x2e567b=0x0;_0x2e567b<_0x340db9[_0x0181('0x14')];_0x2e567b++){if(_0x340db9[_0x2e567b][_0x0181('0x15')]===_0xfabff8[_0x0181('0x1e')]){_0x1c34d9=!![];_0xfabff8['userId']=_0x340db9[_0x2e567b]['id'];logger['info'](_0x0181('0x20'),_0xfabff8[_0x0181('0x21')]);}}}if(!_0x1c34d9){logger['info']('Admin\x20selected');_0xfabff8[_0x0181('0x22')]=_0xfabff8[_0x0181('0x16')];_0xfabff8[_0x0181('0x21')]=_0xfabff8[_0x0181('0x17')];_0x1c34d9=!![];}if(_0x1c34d9){_0x1e4b0e(_0xfabff8);}else{_0x267789({'statusCode':0x194,'message':_0x0181('0x19')});}}else{_0x267789({'statusCode':0x194,'message':_0x0181('0x19')});}})[_0x0181('0x1a')](function(_0x325df5){logger[_0x0181('0x23')]('['+[_0x3fb90d[_0x0181('0x1b')]()]+']',_0x325df5[_0x0181('0x1c')]);_0x267789(_0x325df5);});});};}function searchContact(_0x2866cc,_0x10a465,_0x4ecd2e,_0x4784fb){return new Promise(function(_0x1c0d39,_0x4a2825){var _0x208708={'method':_0x0181('0xe'),'headers':_0x10a465,'uri':_0x2866cc+_0x0181('0x24')+_0x4784fb+'&f='+_0x4ecd2e+'&entities=contact','json':!![]};rp(_0x208708)[_0x0181('0x12')](function(_0x5cf97e){var _0x1a9733=_[_0x0181('0x25')](_0x5cf97e['contacts'][_0x0181('0x26')],[_0x4ecd2e,_0x4784fb]);_0x1c0d39(_0x1a9733);})['catch'](function(_0x18c99e){_0x4a2825(_0x18c99e);});});}function getEndUser(_0x47d510,_0x3fd9c3,_0x5eafdc){return function(_0x100a0d){return new Promise(function(_0x24ebbb,_0x2f7cb3){logger[_0x0181('0x10')](util[_0x0181('0x27')]('Searching\x20contact\x20with\x20phone\x20%s',_0x100a0d[_0x0181('0x28')]));searchContact(_0x5eafdc,_0x3fd9c3,_0x0181('0x29'),_0x100a0d[_0x0181('0x28')])[_0x0181('0x12')](function(_0x1b1b58){if(_0x1b1b58){_0x100a0d[_0x0181('0x2a')]=_0x1b1b58['id'];logger[_0x0181('0x10')](_0x0181('0x2b'),_0x100a0d[_0x0181('0x2a')]);return _0x24ebbb(_0x100a0d);}searchContact(_0x5eafdc,_0x3fd9c3,_0x0181('0x2c'),_0x100a0d[_0x0181('0x28')])[_0x0181('0x12')](function(_0x5bb108){if(_0x5bb108){_0x100a0d['endUserId']=_0x5bb108['id'];logger[_0x0181('0x10')]('Contact\x20found\x20work_number:',_0x100a0d[_0x0181('0x2a')]);return _0x24ebbb(_0x100a0d);}createEndUser(_0x100a0d,_0x47d510,_0x3fd9c3,_0x5eafdc)[_0x0181('0x12')](function(_0x3d1580){logger['info'](_0x0181('0x2d'),_0x3d1580['endUserId']);return _0x24ebbb(_0x3d1580);});});})[_0x0181('0x1a')](function(_0x78aa33){_0x2f7cb3(_0x78aa33);});});};}function createEndUser(_0x7eacc3,_0x3f6385,_0x4cfbe4,_0x3807bc){return new Promise(function(_0x573ee0,_0x294ab2){var _0x5bd186=moment();var _0x5cf236={'method':_0x0181('0x2e'),'uri':_0x3807bc+'/api/contacts','body':{'contact':{'last_name':_0x7eacc3[_0x0181('0x28')],'work_number':_0x7eacc3['contactNumber'],'mobile_number':_0x7eacc3[_0x0181('0x28')],'owner_id':_0x7eacc3['userId'],'created_at':_0x5bd186['format'](_0x0181('0x2f'))}},'json':!![]};_0x5cf236['headers']=_0x4cfbe4;logger['info'](_0x0181('0x30'));return rp(_0x5cf236)[_0x0181('0x12')](function(_0x159d7f){_0x7eacc3[_0x0181('0x2a')]=_0x159d7f[_0x0181('0x31')]['id'];_0x573ee0(_0x7eacc3);})['catch'](function(_0x470086){logger[_0x0181('0x23')]('['+[_0x3f6385[_0x0181('0x1b')]()]+']',_0x470086[_0x0181('0x1c')]);_0x294ab2(_0x470086[_0x0181('0x1c')]);});});}function getTicket(_0x44eca1,_0x3b0547,_0x5cbdad,_0x3f4363,_0x198a33){return function(_0x527d37){logger[_0x0181('0x10')](_0x0181('0x32'));return new Promise(function(_0x41fcf0,_0x727ddb){var _0x3bdb15=moment();var _0x17bbd6={'method':_0x0181('0x2e'),'uri':_0x5cbdad+_0x0181('0x33'),'body':{'title':intUtil[_0x0181('0x34')](_0x3f4363[_0x0181('0x35')],_0x198a33,'\x20'),'description':intUtil['getString'](_0x3f4363[_0x0181('0x36')],_0x198a33,'\x0a'),'owner_id':_0x527d37[_0x0181('0x21')],'creater_id':_0x527d37[_0x0181('0x17')],'targetable_id':_0x527d37[_0x0181('0x2a')],'targetable_type':_0x0181('0x37'),'created_at':_0x3bdb15[_0x0181('0x27')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x3bdb15[_0x0181('0x38')](0x1e,'m')['format'](_0x0181('0x2f'))},'json':!![]};_0x17bbd6[_0x0181('0x39')]=_0x3b0547;return rp(_0x17bbd6)[_0x0181('0x12')](function(_0x327d89){_0x527d37[_0x0181('0x3a')]=_0x327d89[_0x0181('0x3b')]['id'];logger[_0x0181('0x10')]('Task\x20created:',_0x527d37['ticketId']);_0x41fcf0(_0x527d37);})[_0x0181('0x1a')](function(_0x1151e9){logger[_0x0181('0x23')]('['+[_0x44eca1['toUpperCase']()]+']',_0x1151e9[_0x0181('0x1c')]);_0x727ddb(_0x1151e9['message']);});});};}function emit(_0x2f8c2c,_0xb748c7,_0x127501){var _0x556353={'uri':_0x2f8c2c+_0x0181('0x3c')+_0x127501};io['to'](util[_0x0181('0x27')](_0x0181('0x3d'),_0xb748c7))[_0x0181('0x3e')]('trigger:browser:url',_0x556353);}exports['cs']=function(_0xa53b1c,_0x5d19f7,_0x1a6d68,_0x2c410a,_0x26a812,_0x140fce,_0x41441d,_0x46d8eb){var _0x1b9eae={};var _0x36c755={'Authorization':'Token\x20token='+_0x140fce[_0x0181('0x3f')]};_0x140fce[_0x0181('0x40')]=intUtil[_0x0181('0x41')](_0x140fce[_0x0181('0x40')]);_0x140fce[_0x0181('0x42')]=intUtil['stripTrailingSlash'](_0x140fce[_0x0181('0x42')]);var _0x587201=_0x140fce[_0x0181('0x40')];_0x1b9eae[_0x0181('0x16')]=_0x140fce[_0x0181('0x43')];_0x1b9eae[_0x0181('0x28')]=_0x46d8eb[_0x0181('0x44')]()===_0x0181('0x45')?_0x5d19f7[_0x0181('0x46')]:_0x5d19f7[_0x0181('0x47')];_0x1b9eae['callDirection']=_0x46d8eb==='queue'||_0x46d8eb===_0x0181('0x48')?_0x0181('0x49'):'outbound';if(_0x2c410a){_0x1b9eae['agentEmail']=_0x2c410a[_0x0181('0x15')];}var _0xeedf29=util['format'](_0x0181('0x4a'),_0x140fce['serverUrl'],_0x5d19f7[_0x0181('0x4b')],md5(_0x5d19f7['uniqueid']));if(_0x26a812&&_0x26a812[_0x0181('0x4c')]){logger[_0x0181('0x10')]('[QUEUE]','Recording\x20is\x20enabled!');_0x5d19f7[_0x0181('0x4d')]=_0xeedf29;}else if(_0x41441d&&_0x41441d['recordingFormat']&&_0x41441d[_0x0181('0x4e')]!==_0x0181('0x4f')){logger[_0x0181('0x10')](_0x0181('0x50'),'Recording\x20is\x20enabled!');_0x5d19f7[_0x0181('0x4d')]=_0xeedf29;}else{_0x5d19f7[_0x0181('0x4d')]='';}return getAdminId(_0x1b9eae,_0x46d8eb,_0x36c755,_0x587201)[_0x0181('0x12')](getUser(_0x46d8eb,_0x36c755,_0x587201))[_0x0181('0x12')](getEndUser(_0x46d8eb,_0x36c755,_0x587201))[_0x0181('0x12')](getTicket(_0x46d8eb,_0x36c755,_0x587201,_0x1a6d68,_0x5d19f7))[_0x0181('0x12')](function(_0x4fdc67){logger[_0x0181('0x10')](util[_0x0181('0x27')]('The\x20ticket\x20ID\x20is:\x20%s',_0x4fdc67[_0x0181('0x3a')]));if(_0x46d8eb!==_0x0181('0x48')){logger[_0x0181('0x10')]('['+[_0x46d8eb[_0x0181('0x1b')]()]+']',_0x0181('0x51'));emit(_0x587201,_0x2c410a[_0x0181('0x52')],_0x4fdc67['endUserId']);}})[_0x0181('0x1a')](function(_0x36b8fe){logger[_0x0181('0x23')]('['+[_0x46d8eb[_0x0181('0x1b')]()]+_0x0181('0x53'),util[_0x0181('0x54')](_0x36b8fe,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9395=['username','toLowerCase','outbound','destcalleridnum','calleridnum','unmanaged','queue','uniqueid','monitor_format','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','info','Getting\x20admin\x20information','then','length','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','headers','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','User\x20found:','userId','Admin\x20selected','userEmail','/api/lookup?q=','&f=','&entities=contact','find','contacts','catch','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','endUserId','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','POST','getString','Descriptions','task','Task\x20created:','ticketId','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl'];(function(_0x4123f2,_0x227240){var _0x51c7de=function(_0x1e202f){while(--_0x1e202f){_0x4123f2['push'](_0x4123f2['shift']());}};_0x51c7de(++_0x227240);}(_0x9395,0xb4));var _0x5939=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9395[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x5939('0x0'));var util=require(_0x5939('0x1'));var moment=require(_0x5939('0x2'));var Promise=require(_0x5939('0x3'));var Redis=require(_0x5939('0x4'));var intUtil=require(_0x5939('0x5'));var config=require(_0x5939('0x6'));var logger=require(_0x5939('0x7'))(_0x5939('0x8'));config[_0x5939('0x9')]=_[_0x5939('0xa')](config['redis'],{'host':_0x5939('0xb'),'port':0x18eb});var io=require(_0x5939('0xc'))(new Redis(config['redis']));function getAdminId(_0xf56c44,_0x329039,_0x5859ed,_0x151806){return new Promise(function(_0x285028,_0x4c49a3){var _0x3aab78=![];var _0x3f8bb4={'method':_0x5939('0xd'),'uri':_0x151806+_0x5939('0xe'),'json':!![]};_0x3f8bb4['headers']=_0x5859ed;logger[_0x5939('0xf')](_0x5939('0x10'));return rp(_0x3f8bb4)[_0x5939('0x11')](function(_0xf55d6e){if(_0xf55d6e){var _0x46206a=_0xf55d6e['users'];var _0x3795d4=null;for(_0x3795d4=0x0;_0x3795d4<_0x46206a[_0x5939('0x12')];_0x3795d4++){if(_0x46206a[_0x3795d4]['email']===_0xf56c44[_0x5939('0x13')]){_0xf56c44['adminId']=_0x46206a[_0x3795d4]['id'];_0x3aab78=!![];}}if(_0x3aab78){logger[_0x5939('0xf')]('Admin\x20found:',_0xf56c44[_0x5939('0x14')]);_0x285028(_0xf56c44);}else{_0x4c49a3({'statusCode':0x194,'message':_0x5939('0x15')});}}else{_0x4c49a3({'statusCode':0x194,'message':_0x5939('0x15')});}})['catch'](function(_0x14f592){logger[_0x5939('0x16')]('['+[_0x329039[_0x5939('0x17')]()]+']',_0x14f592[_0x5939('0x18')]);_0x4c49a3(_0x14f592);});});}function getUser(_0x19f2c9,_0x5a8e24,_0x2cd436){return function(_0x494902){return new Promise(function(_0x134fa6,_0x792e0f){var _0x1f20dc={'method':'GET','uri':_0x2cd436+_0x5939('0xe'),'json':!![]};_0x1f20dc[_0x5939('0x19')]=_0x5a8e24;logger[_0x5939('0xf')](_0x5939('0x1a'));return rp(_0x1f20dc)[_0x5939('0x11')](function(_0x2ea6d4){if(_0x2ea6d4){var _0x495c70=_0x2ea6d4['users'];var _0x5e32a3=![];var _0x318ba3=null;if(_0x494902[_0x5939('0x1b')]!==null){logger[_0x5939('0xf')](_0x5939('0x1c'),_0x494902[_0x5939('0x1b')]);_0x494902['userEmail']=_0x494902[_0x5939('0x1b')];for(_0x318ba3=0x0;_0x318ba3<_0x495c70[_0x5939('0x12')];_0x318ba3++){if(_0x495c70[_0x318ba3]['email']===_0x494902[_0x5939('0x1b')]){_0x5e32a3=!![];_0x494902['userId']=_0x495c70[_0x318ba3]['id'];logger['info'](_0x5939('0x1d'),_0x494902[_0x5939('0x1e')]);}}}if(!_0x5e32a3){logger['info'](_0x5939('0x1f'));_0x494902[_0x5939('0x20')]=_0x494902['adminEmail'];_0x494902[_0x5939('0x1e')]=_0x494902[_0x5939('0x14')];_0x5e32a3=!![];}if(_0x5e32a3){_0x134fa6(_0x494902);}else{_0x792e0f({'statusCode':0x194,'message':_0x5939('0x15')});}}else{_0x792e0f({'statusCode':0x194,'message':_0x5939('0x15')});}})['catch'](function(_0x53f2b2){logger[_0x5939('0x16')]('['+[_0x19f2c9['toUpperCase']()]+']',_0x53f2b2[_0x5939('0x18')]);_0x792e0f(_0x53f2b2);});});};}function searchContact(_0x59870a,_0x2ea30c,_0x591ebb,_0x1b03b8){return new Promise(function(_0x79471f,_0x485477){var _0x56b600={'method':'GET','headers':_0x2ea30c,'uri':_0x59870a+_0x5939('0x21')+_0x1b03b8+_0x5939('0x22')+_0x591ebb+_0x5939('0x23'),'json':!![]};rp(_0x56b600)[_0x5939('0x11')](function(_0x4c9d4a){var _0x2508cf=_[_0x5939('0x24')](_0x4c9d4a[_0x5939('0x25')][_0x5939('0x25')],[_0x591ebb,_0x1b03b8]);_0x79471f(_0x2508cf);})[_0x5939('0x26')](function(_0x51b0d2){_0x485477(_0x51b0d2);});});}function getEndUser(_0x32f951,_0x5d58f4,_0x10d540){return function(_0x5bed15){return new Promise(function(_0x3200fc,_0x510996){logger[_0x5939('0xf')](util[_0x5939('0x27')](_0x5939('0x28'),_0x5bed15[_0x5939('0x29')]));searchContact(_0x10d540,_0x5d58f4,_0x5939('0x2a'),_0x5bed15[_0x5939('0x29')])[_0x5939('0x11')](function(_0x518005){if(_0x518005){_0x5bed15['endUserId']=_0x518005['id'];logger['info'](_0x5939('0x2b'),_0x5bed15['endUserId']);return _0x3200fc(_0x5bed15);}searchContact(_0x10d540,_0x5d58f4,_0x5939('0x2c'),_0x5bed15[_0x5939('0x29')])['then'](function(_0x38ff84){if(_0x38ff84){_0x5bed15['endUserId']=_0x38ff84['id'];logger[_0x5939('0xf')](_0x5939('0x2d'),_0x5bed15[_0x5939('0x2e')]);return _0x3200fc(_0x5bed15);}createEndUser(_0x5bed15,_0x32f951,_0x5d58f4,_0x10d540)[_0x5939('0x11')](function(_0x2eab6b){logger[_0x5939('0xf')](_0x5939('0x2f'),_0x2eab6b[_0x5939('0x2e')]);return _0x3200fc(_0x2eab6b);});});})[_0x5939('0x26')](function(_0x5019d6){_0x510996(_0x5019d6);});});};}function createEndUser(_0x49aa6f,_0x1726ed,_0x285376,_0x50687){return new Promise(function(_0x29a787,_0x2818fe){var _0x576458=moment();var _0x350867={'method':'POST','uri':_0x50687+_0x5939('0x30'),'body':{'contact':{'last_name':_0x49aa6f['contactNumber'],'work_number':_0x49aa6f[_0x5939('0x29')],'mobile_number':_0x49aa6f[_0x5939('0x29')],'owner_id':_0x49aa6f[_0x5939('0x1e')],'created_at':_0x576458[_0x5939('0x27')](_0x5939('0x31'))}},'json':!![]};_0x350867[_0x5939('0x19')]=_0x285376;logger[_0x5939('0xf')](_0x5939('0x32'));return rp(_0x350867)['then'](function(_0x3a36e0){_0x49aa6f['endUserId']=_0x3a36e0[_0x5939('0x33')]['id'];_0x29a787(_0x49aa6f);})[_0x5939('0x26')](function(_0x4085d4){logger[_0x5939('0x16')]('['+[_0x1726ed[_0x5939('0x17')]()]+']',_0x4085d4[_0x5939('0x18')]);_0x2818fe(_0x4085d4[_0x5939('0x18')]);});});}function getTicket(_0x1bb835,_0x356570,_0x23ae57,_0x5d7b79,_0x14c205){return function(_0x36670d){logger[_0x5939('0xf')]('Creating\x20new\x20task');return new Promise(function(_0x319a8b,_0xa53de7){var _0x59015e=moment();var _0x36b3b8={'method':_0x5939('0x34'),'uri':_0x23ae57+'/api/tasks','body':{'title':intUtil[_0x5939('0x35')](_0x5d7b79['Subjects'],_0x14c205,'\x20'),'description':intUtil[_0x5939('0x35')](_0x5d7b79[_0x5939('0x36')],_0x14c205,'\x0a'),'owner_id':_0x36670d[_0x5939('0x1e')],'creater_id':_0x36670d['adminId'],'targetable_id':_0x36670d['endUserId'],'targetable_type':'Contact','created_at':_0x59015e['format'](_0x5939('0x31')),'due_date':_0x59015e['add'](0x1e,'m')[_0x5939('0x27')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x36b3b8[_0x5939('0x19')]=_0x356570;return rp(_0x36b3b8)['then'](function(_0x118b39){_0x36670d['ticketId']=_0x118b39[_0x5939('0x37')]['id'];logger['info'](_0x5939('0x38'),_0x36670d[_0x5939('0x39')]);_0x319a8b(_0x36670d);})[_0x5939('0x26')](function(_0x5ae158){logger[_0x5939('0x16')]('['+[_0x1bb835[_0x5939('0x17')]()]+']',_0x5ae158[_0x5939('0x18')]);_0xa53de7(_0x5ae158[_0x5939('0x18')]);});});};}function emit(_0x47f903,_0x4b497c,_0x192b36){var _0x28b98c={'uri':_0x47f903+'/contacts/'+_0x192b36};io['to'](util[_0x5939('0x27')]('user:%s',_0x4b497c))['emit'](_0x5939('0x3a'),_0x28b98c);}exports['cs']=function(_0x325bf,_0xcf149b,_0x16dc97,_0x20c0cd,_0x2f3a27,_0x1975f2,_0x4bd95a,_0x5c8365){var _0x25a6ea={};var _0x46d71d={'Authorization':_0x5939('0x3b')+_0x1975f2['apiKey']};_0x1975f2[_0x5939('0x3c')]=intUtil[_0x5939('0x3d')](_0x1975f2[_0x5939('0x3c')]);_0x1975f2[_0x5939('0x3e')]=intUtil[_0x5939('0x3d')](_0x1975f2[_0x5939('0x3e')]);var _0x5ce6ad=_0x1975f2[_0x5939('0x3c')];_0x25a6ea['adminEmail']=_0x1975f2[_0x5939('0x3f')];_0x25a6ea['contactNumber']=_0x5c8365[_0x5939('0x40')]()===_0x5939('0x41')?_0xcf149b[_0x5939('0x42')]:_0xcf149b[_0x5939('0x43')];_0x25a6ea['callDirection']=_0x5c8365==='queue'||_0x5c8365===_0x5939('0x44')?_0x5939('0x45'):_0x5939('0x41');if(_0x20c0cd){_0x25a6ea[_0x5939('0x1b')]=_0x20c0cd['email'];}var _0x38a96e=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1975f2[_0x5939('0x3e')],_0xcf149b['uniqueid'],md5(_0xcf149b[_0x5939('0x46')]));if(_0x2f3a27&&_0x2f3a27[_0x5939('0x47')]){logger[_0x5939('0xf')]('[QUEUE]','Recording\x20is\x20enabled!');_0xcf149b['recordingURL']=_0x38a96e;}else if(_0x4bd95a&&_0x4bd95a[_0x5939('0x48')]&&_0x4bd95a[_0x5939('0x48')]!==_0x5939('0x49')){logger[_0x5939('0xf')](_0x5939('0x4a'),_0x5939('0x4b'));_0xcf149b['recordingURL']=_0x38a96e;}else{_0xcf149b[_0x5939('0x4c')]='';}return getAdminId(_0x25a6ea,_0x5c8365,_0x46d71d,_0x5ce6ad)['then'](getUser(_0x5c8365,_0x46d71d,_0x5ce6ad))[_0x5939('0x11')](getEndUser(_0x5c8365,_0x46d71d,_0x5ce6ad))[_0x5939('0x11')](getTicket(_0x5c8365,_0x46d71d,_0x5ce6ad,_0x16dc97,_0xcf149b))[_0x5939('0x11')](function(_0x52beca){logger[_0x5939('0xf')](util[_0x5939('0x27')]('The\x20ticket\x20ID\x20is:\x20%s',_0x52beca[_0x5939('0x39')]));if(_0x5c8365!=='unmanaged'){logger[_0x5939('0xf')]('['+[_0x5c8365[_0x5939('0x17')]()]+']',_0x5939('0x4d'));emit(_0x5ce6ad,_0x20c0cd[_0x5939('0x4e')],_0x52beca['endUserId']);}})['catch'](function(_0x2aed43){logger[_0x5939('0x16')]('['+[_0x5c8365[_0x5939('0x17')]()]+_0x5939('0x4f'),util[_0x5939('0x50')](_0x2aed43,{'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 f8d5f5e..52f3234 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 _0xc1dc=['freshdesk','zoho','desk','vtiger','dynamics365','exec','includes','data1','toLowerCase','data2','find','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','salesforce','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','sugarcrm'];(function(_0x169a99,_0x351618){var _0x26032a=function(_0x550fe5){while(--_0x550fe5){_0x169a99['push'](_0x169a99['shift']());}};_0x26032a(++_0x351618);}(_0xc1dc,0xcb));var _0xcc1d=function(_0x1ab9e3,_0x23cb4e){_0x1ab9e3=_0x1ab9e3-0x0;var _0x5c00bb=_0xc1dc[_0x1ab9e3];return _0x5c00bb;};'use strict';var _=require(_0xcc1d('0x0'));var util=require(_0xcc1d('0x1'));var zendesk=require(_0xcc1d('0x2'));var salesforce=require(_0xcc1d('0x3'));var sugarcrm=require(_0xcc1d('0x4'));var freshdesk=require(_0xcc1d('0x5'));var zoho=require(_0xcc1d('0x6'));var desk=require(_0xcc1d('0x7'));var vtiger=require(_0xcc1d('0x8'));var servicenow=require(_0xcc1d('0x9'));var dynamics365=require(_0xcc1d('0xa'));var freshsales=require('./freshsales');var integrations=[_0xcc1d('0xb'),'salesforce',_0xcc1d('0xc'),_0xcc1d('0xd'),_0xcc1d('0xe'),_0xcc1d('0xf'),_0xcc1d('0x10'),_0xcc1d('0x11'),'freshsales','servicenow'];exports[_0xcc1d('0x12')]=function(_0x2e6f88,_0xef9dc5,_0xb8dffb,_0x5e544e,_0xf490a4,_0x3b3694){if(_0xb8dffb){if(_[_0xcc1d('0x13')](integrations,_0x2e6f88[_0xcc1d('0x14')]['toLowerCase']())){try{var _0x1943a5=null;var _0x25f30c='';var _0x41ad46=_0xb8dffb[_0x2e6f88[_0xcc1d('0x14')][_0xcc1d('0x15')]()];if(_0x41ad46){var _0x4bcb24=_0x41ad46[_0x2e6f88[_0xcc1d('0x16')]];if(_0x4bcb24){var _0x16bca1=_[_0xcc1d('0x17')](_0x4bcb24['Configurations'],{'id':parseInt(_0x2e6f88['data3'],0xa)});if(_0x16bca1){if(_0x5e544e){if(_0xf490a4&&_0xef9dc5['queue']){_0x25f30c='queue';}else if(_0xef9dc5[_0xcc1d('0x18')]){_0x25f30c=_0xcc1d('0x19');}else{console[_0xcc1d('0x1a')](_0xcc1d('0x1b'),_0xef9dc5);}}else{_0x25f30c=_0xcc1d('0x1c');}switch(_0x2e6f88[_0xcc1d('0x14')][_0xcc1d('0x15')]()){case _0xcc1d('0xb'):zendesk[_0x25f30c](_0x2e6f88,_0xef9dc5,_0x16bca1,_0x5e544e,_0xf490a4,_0x4bcb24,_0x3b3694);break;case _0xcc1d('0x1d'):salesforce[_0x25f30c](_0x2e6f88,_0xef9dc5,_0x16bca1,_0x5e544e,_0xf490a4,_0x4bcb24,_0x3b3694);break;case _0xcc1d('0xc'):sugarcrm[_0x25f30c](_0x2e6f88,_0xef9dc5,_0x16bca1,_0x5e544e,_0xf490a4,_0x4bcb24,_0x3b3694);break;case'freshdesk':freshdesk[_0x25f30c](_0x2e6f88,_0xef9dc5,_0x16bca1,_0x5e544e,_0xf490a4,_0x4bcb24,_0x3b3694);break;case'zoho':zoho[_0x25f30c](_0x2e6f88,_0xef9dc5,_0x16bca1,_0x5e544e,_0xf490a4,_0x4bcb24,_0x3b3694);break;case _0xcc1d('0xf'):desk[_0x25f30c](_0x2e6f88,_0xef9dc5,_0x16bca1,_0x5e544e,_0xf490a4,_0x4bcb24,_0x3b3694);break;case _0xcc1d('0x10'):vtiger[_0x25f30c](_0x2e6f88,_0xef9dc5,_0x16bca1,_0x5e544e,_0xf490a4,_0x4bcb24,_0x3b3694);break;case'freshsales':freshsales['cs'](_0x2e6f88,_0xef9dc5,_0x16bca1,_0x5e544e,_0xf490a4,_0x4bcb24,_0x3b3694,_0x25f30c);break;case'servicenow':servicenow['cs'](_0x2e6f88,_0xef9dc5,_0x16bca1,_0x5e544e,_0xf490a4,_0x4bcb24,_0x3b3694,_0x25f30c);break;case _0xcc1d('0x11'):dynamics365['cs'](_0x2e6f88,_0xef9dc5,_0x16bca1,_0x5e544e,_0xf490a4,_0x4bcb24,_0x3b3694,_0x25f30c);break;default:console['log']('unknown\x20integration');}}else{_0x1943a5=require(_0xcc1d('0x1e'))(_0x2e6f88['data1']['toLowerCase']());_0x1943a5[_0xcc1d('0x1f')](_0xcc1d('0x20'),util[_0xcc1d('0x21')](_0xcc1d('0x22'),_0x2e6f88[_0xcc1d('0x14')]['toLowerCase'](),_0x2e6f88['data3']));}}else{_0x1943a5=require(_0xcc1d('0x1e'))(_0x2e6f88[_0xcc1d('0x14')][_0xcc1d('0x15')]());_0x1943a5[_0xcc1d('0x1f')](_0xcc1d('0x20'),util[_0xcc1d('0x21')](_0xcc1d('0x23'),_0x2e6f88[_0xcc1d('0x14')]['toLowerCase'](),_0x2e6f88[_0xcc1d('0x16')]));}}else{}}catch(_0x4a9033){console['error'](_0x4a9033);}}}}; \ No newline at end of file +var _0x7fbc=['zendesk','salesforce','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','find','queue','routeId','outbound','EVENT\x20UNKNOWN','unmanaged','log','unknown\x20integration','error','[EXEC]','format','data3','lodash','util','./sugarcrm','./zoho','./desk','./vtiger','./dynamics365','./freshsales'];(function(_0x9cb19f,_0x35f63a){var _0x3ad398=function(_0x5d9ea0){while(--_0x5d9ea0){_0x9cb19f['push'](_0x9cb19f['shift']());}};_0x3ad398(++_0x35f63a);}(_0x7fbc,0xdf));var _0xc7fb=function(_0x1dcc18,_0x5ef3b9){_0x1dcc18=_0x1dcc18-0x0;var _0x17b7ab=_0x7fbc[_0x1dcc18];return _0x17b7ab;};'use strict';var _=require(_0xc7fb('0x0'));var util=require(_0xc7fb('0x1'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0xc7fb('0x2'));var freshdesk=require('./freshdesk');var zoho=require(_0xc7fb('0x3'));var desk=require(_0xc7fb('0x4'));var vtiger=require(_0xc7fb('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0xc7fb('0x6'));var freshsales=require(_0xc7fb('0x7'));var integrations=[_0xc7fb('0x8'),_0xc7fb('0x9'),'sugarcrm',_0xc7fb('0xa'),_0xc7fb('0xb'),_0xc7fb('0xc'),_0xc7fb('0xd'),_0xc7fb('0xe'),_0xc7fb('0xf'),_0xc7fb('0x10')];exports[_0xc7fb('0x11')]=function(_0xf42fc5,_0x779582,_0x3309ab,_0x2eb105,_0xe4bdb1,_0x2d565c){if(_0x3309ab){if(_[_0xc7fb('0x12')](integrations,_0xf42fc5[_0xc7fb('0x13')]['toLowerCase']())){try{var _0x350dd8=null;var _0x13476d='';var _0x367639=_0x3309ab[_0xf42fc5[_0xc7fb('0x13')][_0xc7fb('0x14')]()];if(_0x367639){var _0x27765e=_0x367639[_0xf42fc5['data2']];if(_0x27765e){var _0xaf119f=_[_0xc7fb('0x15')](_0x27765e['Configurations'],{'id':parseInt(_0xf42fc5['data3'],0xa)});if(_0xaf119f){if(_0x2eb105){if(_0xe4bdb1&&_0x779582[_0xc7fb('0x16')]){_0x13476d=_0xc7fb('0x16');}else if(_0x779582[_0xc7fb('0x17')]){_0x13476d=_0xc7fb('0x18');}else{console['log'](_0xc7fb('0x19'),_0x779582);}}else{_0x13476d=_0xc7fb('0x1a');}switch(_0xf42fc5[_0xc7fb('0x13')][_0xc7fb('0x14')]()){case _0xc7fb('0x8'):zendesk[_0x13476d](_0xf42fc5,_0x779582,_0xaf119f,_0x2eb105,_0xe4bdb1,_0x27765e,_0x2d565c);break;case _0xc7fb('0x9'):salesforce[_0x13476d](_0xf42fc5,_0x779582,_0xaf119f,_0x2eb105,_0xe4bdb1,_0x27765e,_0x2d565c);break;case'sugarcrm':sugarcrm[_0x13476d](_0xf42fc5,_0x779582,_0xaf119f,_0x2eb105,_0xe4bdb1,_0x27765e,_0x2d565c);break;case _0xc7fb('0xa'):freshdesk[_0x13476d](_0xf42fc5,_0x779582,_0xaf119f,_0x2eb105,_0xe4bdb1,_0x27765e,_0x2d565c);break;case _0xc7fb('0xb'):zoho[_0x13476d](_0xf42fc5,_0x779582,_0xaf119f,_0x2eb105,_0xe4bdb1,_0x27765e,_0x2d565c);break;case _0xc7fb('0xc'):desk[_0x13476d](_0xf42fc5,_0x779582,_0xaf119f,_0x2eb105,_0xe4bdb1,_0x27765e,_0x2d565c);break;case _0xc7fb('0xd'):vtiger[_0x13476d](_0xf42fc5,_0x779582,_0xaf119f,_0x2eb105,_0xe4bdb1,_0x27765e,_0x2d565c);break;case'freshsales':freshsales['cs'](_0xf42fc5,_0x779582,_0xaf119f,_0x2eb105,_0xe4bdb1,_0x27765e,_0x2d565c,_0x13476d);break;case _0xc7fb('0x10'):servicenow['cs'](_0xf42fc5,_0x779582,_0xaf119f,_0x2eb105,_0xe4bdb1,_0x27765e,_0x2d565c,_0x13476d);break;case _0xc7fb('0xe'):dynamics365['cs'](_0xf42fc5,_0x779582,_0xaf119f,_0x2eb105,_0xe4bdb1,_0x27765e,_0x2d565c,_0x13476d);break;default:console[_0xc7fb('0x1b')](_0xc7fb('0x1c'));}}else{_0x350dd8=require('../../../../config/logger')(_0xf42fc5['data1']['toLowerCase']());_0x350dd8[_0xc7fb('0x1d')](_0xc7fb('0x1e'),util[_0xc7fb('0x1f')]('%s\x20configuration\x20#%s\x20not\x20found',_0xf42fc5[_0xc7fb('0x13')][_0xc7fb('0x14')](),_0xf42fc5[_0xc7fb('0x20')]));}}else{_0x350dd8=require('../../../../config/logger')(_0xf42fc5[_0xc7fb('0x13')][_0xc7fb('0x14')]());_0x350dd8['error']('[EXEC]',util[_0xc7fb('0x1f')]('%s\x20account\x20#%s\x20not\x20found',_0xf42fc5[_0xc7fb('0x13')][_0xc7fb('0x14')](),_0xf42fc5['data2']));}}else{}}catch(_0x31fba9){console[_0xc7fb('0x1d')](_0x31fba9);}}}}; \ 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 1d54422..784219b 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 _0xa1cd=['Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsRecurrence','contact','account','WhatId','Case','endUserType','ContactId','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','execute','length','Agent\x20%s\x20found.','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','additionalSearchAccount','Account','Contact','first','Name','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','LastName','','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','format','Company','No\x20Company','Caller\x20-\x20%s','create','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','securityToken','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','queue','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','instanceUrl','[OUTBOUND]','unmanaged','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/logger','salesforce','redis','defaults','localhost','emit','getString'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xa1cd,0xf4));var _0xda1c=function(_0x80c9b3,_0x2f6e9f){_0x80c9b3=_0x80c9b3-0x0;var _0xf92381=_0xa1cd[_0x80c9b3];return _0xf92381;};'use strict';var _=require(_0xda1c('0x0'));var rp=require(_0xda1c('0x1'));var moment=require(_0xda1c('0x2'));var BPromise=require(_0xda1c('0x3'));var md5=require(_0xda1c('0x4'));var jsforce=require(_0xda1c('0x5'));var util=require(_0xda1c('0x6'));var Redis=require(_0xda1c('0x7'));var intUtil=require(_0xda1c('0x8'));var config=require('../../../../config/environment');var logger=require(_0xda1c('0x9'))(_0xda1c('0xa'));config[_0xda1c('0xb')]=_[_0xda1c('0xc')](config[_0xda1c('0xb')],{'host':_0xda1c('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xda1c('0xb')]));function emit(_0x55cfd3,_0x2b2fcd,_0x3adede){io['to'](_0x55cfd3)[_0xda1c('0xe')](_0x2b2fcd,_0x3adede);}function getTicket(_0x13b44d,_0x39923b,_0x19da64,_0xeb418c,_0x72c01e,_0x5cbe10,_0x316e5a,_0x12bf92){var _0x2d8afc=Object['assign']({},{'OwnerId':_0x39923b['id'],'Subject':intUtil[_0xda1c('0xf')](_0xeb418c[_0xda1c('0x10')],_0x72c01e,'\x20'),'Description':intUtil[_0xda1c('0xf')](_0xeb418c[_0xda1c('0x11')],_0x72c01e,'\x0a')},getCustomFields(_0x5cbe10,_0x72c01e));if(_0x19da64){if(_0xeb418c[_0xda1c('0x12')]===_0xda1c('0x13')){_0x2d8afc[_0xda1c('0x14')]=moment[_0xda1c('0x15')]();_0x2d8afc['IsReminderSet']=![];_0x2d8afc[_0xda1c('0x16')]=![];if(_0x19da64['endUserType']===_0xda1c('0x17')||_0x19da64['endUserType']==='lead'){_0x2d8afc['WhoId']=_0x19da64['id'];}else if(_0x19da64['endUserType']===_0xda1c('0x18')){_0x2d8afc[_0xda1c('0x19')]=_0x19da64['id'];}}else if(_0xeb418c[_0xda1c('0x12')]===_0xda1c('0x1a')){if(_0x19da64[_0xda1c('0x1b')]===_0xda1c('0x17')){_0x2d8afc[_0xda1c('0x1c')]=_0x19da64['id'];}else if(_0x19da64[_0xda1c('0x1b')]===_0xda1c('0x18')){_0x2d8afc[_0xda1c('0x1d')]=_0x19da64['id'];}else if(_0x19da64[_0xda1c('0x1b')]===_0xda1c('0x1e')&&_0xeb418c[_0xda1c('0x1f')]){_0x2d8afc[_0xeb418c[_0xda1c('0x1f')]]=_0x19da64['id'];}else{logger[_0xda1c('0x20')](_0xda1c('0x21'));}}}return _0x316e5a[_0xda1c('0x22')](_0xeb418c['ticketType'])['create'](_0x2d8afc);}function getUser(_0x2674d9,_0x38c9ab,_0x1ff5cb){if(!_[_0xda1c('0x23')](_0x38c9ab)&&intUtil[_0xda1c('0x24')](_0x38c9ab)){var _0xa514ea={'Email':_0x38c9ab};var _0x1c89c7={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1ff5cb['sobject'](_0xda1c('0x25'))[_0xda1c('0x26')](_0xa514ea,_0x1c89c7)[_0xda1c('0x27')]()['then'](function(_0x4a61bc){if(_0x4a61bc[_0xda1c('0x28')]){var _0x356f44=_[_0xda1c('0x26')](_0x4a61bc,function(_0x1a1a0f){return _0x1a1a0f['Email']===_0x38c9ab;});if(_0x356f44){logger[_0xda1c('0x20')](_0xda1c('0x29'),_0x38c9ab);return BPromise['resolve']({'id':_0x356f44['Id'],'name':_0x356f44['Name']});}}else{logger[_0xda1c('0x20')](_0xda1c('0x2a'),_0x38c9ab);return _0x1ff5cb[_0xda1c('0x2b')]()[_0xda1c('0x2c')](function(_0x26b1cf){return BPromise[_0xda1c('0x2d')]({'id':_0x26b1cf[_0xda1c('0x2e')],'name':_0x26b1cf[_0xda1c('0x2f')]});});}});}else{logger[_0xda1c('0x20')](_0xda1c('0x2a'),_0x38c9ab);return _0x1ff5cb[_0xda1c('0x2b')]()['then'](function(_0x476083){return BPromise['resolve']({'id':_0x476083['user_id'],'name':_0x476083[_0xda1c('0x2f')]});});}}function getEndUser(_0x192061,_0xa7d3a6,_0x1984ed,_0x2a1e8a,_0x5067c3){var _0x1c4a41={'$or':{'Phone':_0x2a1e8a}};var _0x3d19d9={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xda1c('0x2d')]()[_0xda1c('0x2c')](function(){logger['info'](_0xda1c('0x30'),_0x2a1e8a,_0xa7d3a6[_0xda1c('0x31')]);switch(_0xa7d3a6['moduleSearch']){case _0xda1c('0x32'):var _0x577d23=_[_0xda1c('0x33')](_0x1c4a41);if(_0xa7d3a6[_0xda1c('0x34')]){var _0xa65104={};_0xa65104[_0xa7d3a6[_0xda1c('0x34')]]=_0x2a1e8a;_[_0xda1c('0x35')](_0x577d23[_0xda1c('0x36')],_0xa65104);}return _0x5067c3[_0xda1c('0x22')]('Contact')[_0xda1c('0x26')](_0x577d23,_0x3d19d9)[_0xda1c('0x27')]()[_0xda1c('0x2c')](function(_0x2212e0){if(_0x2212e0&&_0x2212e0[_0xda1c('0x28')]){return _0x2212e0;}else{var _0x3980c7=_[_0xda1c('0x33')](_0x1c4a41);if(_0xa7d3a6[_0xda1c('0x37')]){var _0x11f6cd={};_0x11f6cd[_0xa7d3a6[_0xda1c('0x37')]]=_0x2a1e8a;_[_0xda1c('0x35')](_0x3980c7[_0xda1c('0x36')],_0x11f6cd);}return _0x5067c3[_0xda1c('0x22')](_0xda1c('0x38'))[_0xda1c('0x26')](_0x3980c7,_0x3d19d9);}});case'account_contact_lead':var _0x441116=_[_0xda1c('0x33')](_0x1c4a41);if(_0xa7d3a6[_0xda1c('0x39')]){var _0xa65104={};_0xa65104[_0xa7d3a6[_0xda1c('0x39')]]=_0x2a1e8a;_['merge'](_0x441116[_0xda1c('0x36')],_0xa65104);}return _0x5067c3[_0xda1c('0x22')](_0xda1c('0x3a'))[_0xda1c('0x26')](_0x441116,_0x3d19d9)['execute']()[_0xda1c('0x2c')](function(_0x403d6e){if(_0x403d6e&&_0x403d6e['length']){return _0x403d6e;}else{var _0x435e7d=_[_0xda1c('0x33')](_0x1c4a41);if(_0xa7d3a6[_0xda1c('0x34')]){var _0x4d8ca6={};_0x4d8ca6[_0xa7d3a6['additionalSearchContact']]=_0x2a1e8a;_[_0xda1c('0x35')](_0x435e7d[_0xda1c('0x36')],_0x4d8ca6);}return _0x5067c3[_0xda1c('0x22')](_0xda1c('0x3b'))[_0xda1c('0x26')](_0x435e7d,_0x3d19d9)['then'](function(_0x54e922){if(_0x54e922&&_0x54e922['length']){return _0x54e922;}else{var _0x273a16=_['cloneDeep'](_0x1c4a41);if(_0xa7d3a6['additionalSearchLead']){var _0x30a41a={};_0x30a41a[_0xa7d3a6[_0xda1c('0x37')]]=_0x2a1e8a;_['merge'](_0x273a16[_0xda1c('0x36')],_0x30a41a);}return _0x5067c3[_0xda1c('0x22')](_0xda1c('0x38'))[_0xda1c('0x26')](_0x273a16,_0x3d19d9);}});}});case _0xda1c('0x17'):var _0x577d23=_['cloneDeep'](_0x1c4a41);if(_0xa7d3a6[_0xda1c('0x34')]){var _0xa65104={};_0xa65104[_0xa7d3a6['additionalSearchContact']]=_0x2a1e8a;_['merge'](_0x577d23[_0xda1c('0x36')],_0xa65104);}return _0x5067c3['sobject']('Contact')[_0xda1c('0x26')](_0x577d23,_0x3d19d9)['execute']();case _0xda1c('0x1e'):var _0x2143f6=_[_0xda1c('0x33')](_0x1c4a41);if(_0xa7d3a6[_0xda1c('0x37')]){var _0xa65104={};_0xa65104[_0xa7d3a6[_0xda1c('0x37')]]=_0x2a1e8a;_[_0xda1c('0x35')](_0x2143f6[_0xda1c('0x36')],_0xa65104);}return _0x5067c3['sobject']('Lead')[_0xda1c('0x26')](_0x2143f6,_0x3d19d9);case _0xda1c('0x18'):var _0x441116=_[_0xda1c('0x33')](_0x1c4a41);if(_0xa7d3a6[_0xda1c('0x39')]){var _0xa65104={};_0xa65104[_0xa7d3a6[_0xda1c('0x39')]]=_0x2a1e8a;_[_0xda1c('0x35')](_0x441116[_0xda1c('0x36')],_0xa65104);}return _0x5067c3[_0xda1c('0x22')](_0xda1c('0x3a'))[_0xda1c('0x26')](_0x441116,_0x3d19d9);default:return null;}})[_0xda1c('0x2c')](function(_0x146f2c){if(_0x146f2c&&_0x146f2c[_0xda1c('0x28')]){var _0x5838e8=_[_0xda1c('0x3c')](_0x146f2c);if(_0x5838e8){return BPromise[_0xda1c('0x2d')]({'id':_0x5838e8['Id'],'name':_0x5838e8[_0xda1c('0x3d')],'phone':_0x5838e8['Phone'],'endUserType':_0x5838e8['attributes']['type']['toLowerCase']()});}}})[_0xda1c('0x2c')](function(_0xf08f73){if(_0xf08f73){logger[_0xda1c('0x20')](_0xda1c('0x3e'),_0xf08f73['endUserType'],_0x2a1e8a);return BPromise['resolve'](_0xf08f73);}else{logger[_0xda1c('0x20')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x2a1e8a);var _0x52e887={'Phone':_0x2a1e8a};if(_0xa7d3a6['moduleCreate']){if(_0xa7d3a6[_0xda1c('0x3f')]===_0xda1c('0x17')){logger[_0xda1c('0x20')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x2a1e8a,_0xa7d3a6[_0xda1c('0x3f')]);_0x52e887[_0xda1c('0x40')]=_0x1984ed!==_0xda1c('0x41')?_0x1984ed:util['format']('Caller\x20-\x20%s',_0x2a1e8a);}else if(_0xa7d3a6[_0xda1c('0x3f')]===_0xda1c('0x1e')){logger[_0xda1c('0x20')](_0xda1c('0x42'),_0x2a1e8a,_0xa7d3a6[_0xda1c('0x3f')]);_0x52e887[_0xda1c('0x40')]=_0x1984ed!==_0xda1c('0x41')?_0x1984ed:util[_0xda1c('0x43')]('Caller\x20-\x20%s',_0x2a1e8a);_0x52e887[_0xda1c('0x44')]=_0xda1c('0x45');}else if(_0xa7d3a6[_0xda1c('0x3f')]==='account'){logger[_0xda1c('0x20')](_0xda1c('0x42'),_0x2a1e8a,_0xa7d3a6[_0xda1c('0x3f')]);_0x52e887['Name']=_0x1984ed!==_0xda1c('0x41')?_0x1984ed:util[_0xda1c('0x43')](_0xda1c('0x46'),_0x2a1e8a);}else{return null;}}return _0x5067c3['sobject'](_['upperFirst'](_0xa7d3a6['moduleCreate']))[_0xda1c('0x47')](_0x52e887)[_0xda1c('0x2c')](function(_0x3b66c7){return BPromise[_0xda1c('0x2d')]({'id':_0x3b66c7['id'],'endUserType':_0xa7d3a6[_0xda1c('0x3f')]});});}});}function getCustomFields(_0x2b971e,_0x25a1a5){var _0xddcf91={};if(_0x2b971e[_0xda1c('0x28')]>0x0){_['forEach'](_0x2b971e,function(_0x3ba732){if(_[_0xda1c('0x48')]([_0xda1c('0x49'),_0xda1c('0x4a')],_0x3ba732[_0xda1c('0x4b')])&&_0x3ba732[_0xda1c('0x4c')]){_0xddcf91[_0x3ba732[_0xda1c('0x4c')]]=_0x3ba732[_0xda1c('0x4d')][_0xda1c('0x4e')]();}else if(_0x3ba732[_0xda1c('0x4b')]===_0xda1c('0x4f')&&_0x3ba732[_0xda1c('0x50')]&&_0x3ba732[_0xda1c('0x4c')]){_0x25a1a5[_0x3ba732[_0xda1c('0x50')]]&&(_0xddcf91[_0x3ba732[_0xda1c('0x4c')]]=_0x25a1a5[_0x3ba732[_0xda1c('0x50')]][_0xda1c('0x4e')]());}else if(_0x3ba732[_0xda1c('0x4b')]===_0xda1c('0x51')&&_0x3ba732['Variable']&&_0x3ba732['Variable']['name']&&_0x3ba732[_0xda1c('0x4c')]){_0x25a1a5[_0x3ba732[_0xda1c('0x52')][_0xda1c('0x53')][_0xda1c('0x54')]()]&&(_0xddcf91[_0x3ba732[_0xda1c('0x4c')]]=_0x25a1a5[_0x3ba732[_0xda1c('0x52')]['name'][_0xda1c('0x54')]()][_0xda1c('0x4e')]());}});}return _0xddcf91;}function getConnection(_0x55720f){var _0x3cb63c=_0x55720f[_0xda1c('0x55')]['concat'](_0x55720f[_0xda1c('0x56')]);var _0x45deab=new jsforce['Connection']({'oauth2':{'loginUrl':_0x55720f['remoteUri']||_0xda1c('0x57'),'clientId':_0x55720f[_0xda1c('0x58')],'clientSecret':_0x55720f[_0xda1c('0x59')]}});return _0x45deab['login'](_0x55720f[_0xda1c('0x5a')],_0x3cb63c)[_0xda1c('0x2c')](function(){logger[_0xda1c('0x20')](_0xda1c('0x5b'));return _0x45deab;});}exports['queue']=function(_0x36dc05,_0x107723,_0x93412c,_0x397603,_0x394dc6,_0x4bb780){var _0x1cd838,_0x58b9f7,_0x1a61b3,_0x47f167;_0x4bb780[_0xda1c('0x5c')]=intUtil['stripTrailingSlash'](_0x4bb780[_0xda1c('0x5c')]);_0x4bb780['remoteUri']=intUtil[_0xda1c('0x5d')](_0x4bb780[_0xda1c('0x5e')]);if(_0x394dc6&&_0x394dc6[_0xda1c('0x5f')]){logger[_0xda1c('0x20')](_0xda1c('0x60'),'Recording\x20is\x20enabled!');_0x107723[_0xda1c('0x61')]=util['format'](_0xda1c('0x62'),_0x4bb780[_0xda1c('0x5c')],_0x107723[_0xda1c('0x63')],md5(_0x107723['uniqueid']));}else{_0x107723['recordingURL']='';}return getConnection(_0x4bb780)['then'](function(_0x62cd7f){_0x47f167=_0x62cd7f;return getUser(_0x4bb780,_0x397603[_0xda1c('0x64')],_0x47f167);})[_0xda1c('0x2c')](function(_0x5c2223){_0x1cd838=_0x5c2223;return getEndUser(_0x4bb780,_0x93412c,_0x107723[_0xda1c('0x65')],_0x107723['calleridnum'],_0x47f167);})['then'](function(_0x505a34){_0x58b9f7=_0x505a34;return getTicket(_0x4bb780,_0x1cd838,_0x58b9f7,_0x93412c,_0x107723,_0x93412c['Fields'],_0x47f167,_0xda1c('0x66'));})[_0xda1c('0x2c')](function(_0x265e36){_0x1a61b3=_0x265e36;logger[_0xda1c('0x20')](_0xda1c('0x67'),_0x1a61b3['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1a61b3['id'],_0x397603[_0xda1c('0x53')],_0x4bb780[_0xda1c('0x4b')]);switch(_0x4bb780[_0xda1c('0x4b')]){case'integrationTab':emit(util[_0xda1c('0x43')](_0xda1c('0x68'),_0x397603[_0xda1c('0x53')]),'trigger:salesforce:display',{'recordId':_0x1a61b3['id']});break;case _0xda1c('0x69'):emit(util[_0xda1c('0x43')](_0xda1c('0x68'),_0x397603[_0xda1c('0x53')]),_0xda1c('0x6a'),{'uri':util[_0xda1c('0x43')](_0xda1c('0x6b'),_0x47f167['instanceUrl'],_0x1a61b3['id'])});break;default:logger[_0xda1c('0x6c')](_0xda1c('0x6d'));}})[_0xda1c('0x6e')](function(_0x2d5c59){logger[_0xda1c('0x6c')](_0xda1c('0x60'),_0x2d5c59);});};exports[_0xda1c('0x6f')]=function(_0x9c714,_0x203123,_0x5e8ed0,_0x58b788,_0x5b74bd,_0x338793,_0x2437bb){var _0xa09c48,_0xb7eb79,_0x538d9f,_0xc5209f;_0x338793[_0xda1c('0x5c')]=intUtil[_0xda1c('0x5d')](_0x338793[_0xda1c('0x5c')]);_0x338793[_0xda1c('0x5e')]=intUtil['stripTrailingSlash'](_0x338793[_0xda1c('0x5e')]);if(_0x2437bb&&_0x2437bb[_0xda1c('0x70')]&&_0x2437bb[_0xda1c('0x70')]!==_0xda1c('0x71')){logger[_0xda1c('0x20')]('[OUTBOUND]',_0xda1c('0x72'));_0x203123[_0xda1c('0x61')]=util[_0xda1c('0x43')](_0xda1c('0x62'),_0x338793[_0xda1c('0x5c')],_0x203123[_0xda1c('0x63')],md5(_0x203123[_0xda1c('0x63')]));}return getConnection(_0x338793)[_0xda1c('0x2c')](function(_0x42d1b3){_0xc5209f=_0x42d1b3;return getUser(_0x338793,_0x58b788['email'],_0xc5209f);})[_0xda1c('0x2c')](function(_0x32d31f){_0xa09c48=_0x32d31f;return getEndUser(_0x338793,_0x5e8ed0,_0x203123[_0xda1c('0x73')],_0x203123[_0xda1c('0x74')],_0xc5209f);})[_0xda1c('0x2c')](function(_0x4ab636){_0xb7eb79=_0x4ab636;return getTicket(_0x338793,_0xa09c48,_0xb7eb79,_0x5e8ed0,_0x203123,_0x5e8ed0[_0xda1c('0x75')],_0xc5209f,_0xda1c('0x6f'));})[_0xda1c('0x2c')](function(_0x2817f5){_0x538d9f=_0x2817f5;logger['info'](_0xda1c('0x76'),_0x538d9f['id']);logger[_0xda1c('0x20')](_0xda1c('0x77'),_0x538d9f['id'],_0x58b788['name'],_0x338793['type']);switch(_0x338793[_0xda1c('0x4b')]){case _0xda1c('0x78'):emit(util[_0xda1c('0x43')]('user:%s',_0x58b788[_0xda1c('0x53')]),_0xda1c('0x79'),{'recordId':_0x538d9f['id']});break;case _0xda1c('0x69'):emit(util[_0xda1c('0x43')]('user:%s',_0x58b788[_0xda1c('0x53')]),_0xda1c('0x6a'),{'uri':util[_0xda1c('0x43')](_0xda1c('0x6b'),_0xc5209f[_0xda1c('0x7a')],_0x538d9f['id'])});break;default:logger[_0xda1c('0x6c')](_0xda1c('0x7b'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xda1c('0x6e')](function(_0x284f66){logger['error'](_0xda1c('0x7b'),_0x284f66);});};exports[_0xda1c('0x7c')]=function(_0x18b16d,_0x276551,_0x57fcb0,_0x2b7a8d,_0x291ae3,_0x1373b4){var _0x5026c9,_0xa1a36,_0x55a01d,_0x51a926;_0x1373b4['serverUrl']=intUtil[_0xda1c('0x5d')](_0x1373b4[_0xda1c('0x5c')]);_0x1373b4[_0xda1c('0x5e')]=intUtil[_0xda1c('0x5d')](_0x1373b4[_0xda1c('0x5e')]);if(_0x291ae3&&_0x291ae3[_0xda1c('0x5f')]){logger['info']('['+_0x276551[_0xda1c('0x7d')][_0xda1c('0x7e')]()+']',_0xda1c('0x72'));_0x276551[_0xda1c('0x61')]=util[_0xda1c('0x43')](_0xda1c('0x62'),_0x1373b4[_0xda1c('0x5c')],_0x276551[_0xda1c('0x63')],md5(_0x276551[_0xda1c('0x63')]));}else{_0x276551[_0xda1c('0x61')]='';}return getConnection(_0x1373b4)[_0xda1c('0x2c')](function(_0x4c2c1a){_0x51a926=_0x4c2c1a;if(!_[_0xda1c('0x23')](_0x2b7a8d)){return getUser(_0x1373b4,_0x2b7a8d[_0xda1c('0x53')],_0x51a926);}else{return getUser(_0x1373b4,null,_0x51a926);}})[_0xda1c('0x2c')](function(_0x5c7514){_0x5026c9=_0x5c7514;return getEndUser(_0x1373b4,_0x57fcb0,_0x276551[_0xda1c('0x65')],_0x276551[_0xda1c('0x7f')],_0x51a926);})[_0xda1c('0x2c')](function(_0x4d0039){_0xa1a36=_0x4d0039;return getTicket(_0x1373b4,_0x5026c9,_0xa1a36,_0x57fcb0,_0x276551,_0x57fcb0[_0xda1c('0x75')],_0x51a926);})[_0xda1c('0x2c')](function(_0x1dd0f4){_0x55a01d=_0x1dd0f4;logger['info']('['+_0x276551[_0xda1c('0x7d')][_0xda1c('0x7e')]()+_0xda1c('0x80'),_0x55a01d['id']);logger['info']('['+_0x276551[_0xda1c('0x7d')][_0xda1c('0x7e')]()+_0xda1c('0x81'),_0x1373b4[_0xda1c('0x4b')]);})[_0xda1c('0x6e')](function(_0x5aa687){logger[_0xda1c('0x6c')]('['+_0x276551[_0xda1c('0x7d')][_0xda1c('0x7e')]()+']',_0x5aa687);});}; \ No newline at end of file +var _0xebf2=['clientId','clientSecret','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','Fields','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','error','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.','request-promise','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','endUserType','contact','lead','WhoId','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','display_name','identity','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact_lead','additionalSearchContact','merge','$or','execute','length','cloneDeep','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','account','first','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','No\x20Company','format','upperFirst','create','forEach','includes','string','picklist','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xebf2,0x1a7));var _0x2ebf=function(_0x1e72f5,_0x322bfa){_0x1e72f5=_0x1e72f5-0x0;var _0x4b59e2=_0xebf2[_0x1e72f5];return _0x4b59e2;};'use strict';var _=require('lodash');var rp=require(_0x2ebf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x2ebf('0x1'));var jsforce=require(_0x2ebf('0x2'));var util=require(_0x2ebf('0x3'));var Redis=require('ioredis');var intUtil=require(_0x2ebf('0x4'));var config=require(_0x2ebf('0x5'));var logger=require(_0x2ebf('0x6'))(_0x2ebf('0x7'));config[_0x2ebf('0x8')]=_[_0x2ebf('0x9')](config[_0x2ebf('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x2ebf('0xa'))(new Redis(config[_0x2ebf('0x8')]));function emit(_0x416a5f,_0x1bfcf2,_0x49ef78){io['to'](_0x416a5f)[_0x2ebf('0xb')](_0x1bfcf2,_0x49ef78);}function getTicket(_0x37aa71,_0x2fb1f7,_0x24be45,_0x24a1ba,_0x5b9061,_0x3d5450,_0x5e09b5,_0x30a6be){var _0x5b6e7d=Object[_0x2ebf('0xc')]({},{'OwnerId':_0x2fb1f7['id'],'Subject':intUtil[_0x2ebf('0xd')](_0x24a1ba[_0x2ebf('0xe')],_0x5b9061,'\x20'),'Description':intUtil[_0x2ebf('0xd')](_0x24a1ba[_0x2ebf('0xf')],_0x5b9061,'\x0a')},getCustomFields(_0x3d5450,_0x5b9061));if(_0x24be45){if(_0x24a1ba[_0x2ebf('0x10')]===_0x2ebf('0x11')){_0x5b6e7d[_0x2ebf('0x12')]=moment[_0x2ebf('0x13')]();_0x5b6e7d[_0x2ebf('0x14')]=![];_0x5b6e7d['IsRecurrence']=![];if(_0x24be45[_0x2ebf('0x15')]===_0x2ebf('0x16')||_0x24be45['endUserType']===_0x2ebf('0x17')){_0x5b6e7d[_0x2ebf('0x18')]=_0x24be45['id'];}else if(_0x24be45[_0x2ebf('0x15')]==='account'){_0x5b6e7d[_0x2ebf('0x19')]=_0x24be45['id'];}}else if(_0x24a1ba[_0x2ebf('0x10')]===_0x2ebf('0x1a')){if(_0x24be45[_0x2ebf('0x15')]===_0x2ebf('0x16')){_0x5b6e7d[_0x2ebf('0x1b')]=_0x24be45['id'];}else if(_0x24be45[_0x2ebf('0x15')]==='account'){_0x5b6e7d[_0x2ebf('0x1c')]=_0x24be45['id'];}else if(_0x24be45[_0x2ebf('0x15')]===_0x2ebf('0x17')&&_0x24a1ba[_0x2ebf('0x1d')]){_0x5b6e7d[_0x24a1ba[_0x2ebf('0x1d')]]=_0x24be45['id'];}else{logger[_0x2ebf('0x1e')](_0x2ebf('0x1f'));}}}return _0x5e09b5[_0x2ebf('0x20')](_0x24a1ba[_0x2ebf('0x10')])['create'](_0x5b6e7d);}function getUser(_0x29d03f,_0x77200e,_0x160ddd){if(!_[_0x2ebf('0x21')](_0x77200e)&&intUtil[_0x2ebf('0x22')](_0x77200e)){var _0x3e8ad4={'Email':_0x77200e};var _0xdeb91f={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x160ddd[_0x2ebf('0x20')](_0x2ebf('0x23'))[_0x2ebf('0x24')](_0x3e8ad4,_0xdeb91f)['execute']()['then'](function(_0x56fed6){if(_0x56fed6['length']){var _0x506027=_[_0x2ebf('0x24')](_0x56fed6,function(_0x20615a){return _0x20615a[_0x2ebf('0x25')]===_0x77200e;});if(_0x506027){logger[_0x2ebf('0x1e')](_0x2ebf('0x26'),_0x77200e);return BPromise[_0x2ebf('0x27')]({'id':_0x506027['Id'],'name':_0x506027[_0x2ebf('0x28')]});}}else{logger[_0x2ebf('0x1e')](_0x2ebf('0x29'),_0x77200e);return _0x160ddd['identity']()[_0x2ebf('0x2a')](function(_0x24cd83){return BPromise[_0x2ebf('0x27')]({'id':_0x24cd83['user_id'],'name':_0x24cd83[_0x2ebf('0x2b')]});});}});}else{logger[_0x2ebf('0x1e')](_0x2ebf('0x29'),_0x77200e);return _0x160ddd[_0x2ebf('0x2c')]()[_0x2ebf('0x2a')](function(_0xf5a279){return BPromise['resolve']({'id':_0xf5a279[_0x2ebf('0x2d')],'name':_0xf5a279['display_name']});});}}function getEndUser(_0x4049df,_0x1b9997,_0x403c5d,_0x5324a6,_0x581b45){var _0x172ec1={'$or':{'Phone':_0x5324a6}};var _0xed8a41={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x2ebf('0x27')]()[_0x2ebf('0x2a')](function(){logger[_0x2ebf('0x1e')](_0x2ebf('0x2e'),_0x5324a6,_0x1b9997['moduleSearch']);switch(_0x1b9997['moduleSearch']){case _0x2ebf('0x2f'):var _0x2ce998=_['cloneDeep'](_0x172ec1);if(_0x1b9997[_0x2ebf('0x30')]){var _0x21a5d4={};_0x21a5d4[_0x1b9997['additionalSearchContact']]=_0x5324a6;_[_0x2ebf('0x31')](_0x2ce998[_0x2ebf('0x32')],_0x21a5d4);}return _0x581b45[_0x2ebf('0x20')]('Contact')['find'](_0x2ce998,_0xed8a41)[_0x2ebf('0x33')]()[_0x2ebf('0x2a')](function(_0x439f3a){if(_0x439f3a&&_0x439f3a[_0x2ebf('0x34')]){return _0x439f3a;}else{var _0x1e5e53=_[_0x2ebf('0x35')](_0x172ec1);if(_0x1b9997[_0x2ebf('0x36')]){var _0x1f896a={};_0x1f896a[_0x1b9997['additionalSearchLead']]=_0x5324a6;_[_0x2ebf('0x31')](_0x1e5e53[_0x2ebf('0x32')],_0x1f896a);}return _0x581b45[_0x2ebf('0x20')](_0x2ebf('0x37'))[_0x2ebf('0x24')](_0x1e5e53,_0xed8a41);}});case _0x2ebf('0x38'):var _0x1c458a=_[_0x2ebf('0x35')](_0x172ec1);if(_0x1b9997[_0x2ebf('0x39')]){var _0x21a5d4={};_0x21a5d4[_0x1b9997[_0x2ebf('0x39')]]=_0x5324a6;_['merge'](_0x1c458a['$or'],_0x21a5d4);}return _0x581b45[_0x2ebf('0x20')](_0x2ebf('0x3a'))[_0x2ebf('0x24')](_0x1c458a,_0xed8a41)[_0x2ebf('0x33')]()[_0x2ebf('0x2a')](function(_0x4afd04){if(_0x4afd04&&_0x4afd04[_0x2ebf('0x34')]){return _0x4afd04;}else{var _0x4c4575=_[_0x2ebf('0x35')](_0x172ec1);if(_0x1b9997[_0x2ebf('0x30')]){var _0x2d5c63={};_0x2d5c63[_0x1b9997['additionalSearchContact']]=_0x5324a6;_[_0x2ebf('0x31')](_0x4c4575[_0x2ebf('0x32')],_0x2d5c63);}return _0x581b45[_0x2ebf('0x20')](_0x2ebf('0x3b'))['find'](_0x4c4575,_0xed8a41)['then'](function(_0x424f6a){if(_0x424f6a&&_0x424f6a['length']){return _0x424f6a;}else{var _0x528fae=_[_0x2ebf('0x35')](_0x172ec1);if(_0x1b9997[_0x2ebf('0x36')]){var _0x13a35b={};_0x13a35b[_0x1b9997[_0x2ebf('0x36')]]=_0x5324a6;_['merge'](_0x528fae['$or'],_0x13a35b);}return _0x581b45[_0x2ebf('0x20')]('Lead')[_0x2ebf('0x24')](_0x528fae,_0xed8a41);}});}});case _0x2ebf('0x16'):var _0x2ce998=_['cloneDeep'](_0x172ec1);if(_0x1b9997[_0x2ebf('0x30')]){var _0x21a5d4={};_0x21a5d4[_0x1b9997[_0x2ebf('0x30')]]=_0x5324a6;_[_0x2ebf('0x31')](_0x2ce998['$or'],_0x21a5d4);}return _0x581b45[_0x2ebf('0x20')](_0x2ebf('0x3b'))[_0x2ebf('0x24')](_0x2ce998,_0xed8a41)[_0x2ebf('0x33')]();case _0x2ebf('0x17'):var _0x5c331b=_['cloneDeep'](_0x172ec1);if(_0x1b9997[_0x2ebf('0x36')]){var _0x21a5d4={};_0x21a5d4[_0x1b9997[_0x2ebf('0x36')]]=_0x5324a6;_[_0x2ebf('0x31')](_0x5c331b[_0x2ebf('0x32')],_0x21a5d4);}return _0x581b45[_0x2ebf('0x20')](_0x2ebf('0x37'))[_0x2ebf('0x24')](_0x5c331b,_0xed8a41);case _0x2ebf('0x3c'):var _0x1c458a=_[_0x2ebf('0x35')](_0x172ec1);if(_0x1b9997[_0x2ebf('0x39')]){var _0x21a5d4={};_0x21a5d4[_0x1b9997['additionalSearchAccount']]=_0x5324a6;_[_0x2ebf('0x31')](_0x1c458a['$or'],_0x21a5d4);}return _0x581b45[_0x2ebf('0x20')](_0x2ebf('0x3a'))[_0x2ebf('0x24')](_0x1c458a,_0xed8a41);default:return null;}})[_0x2ebf('0x2a')](function(_0x3d282d){if(_0x3d282d&&_0x3d282d[_0x2ebf('0x34')]){var _0x24e19c=_[_0x2ebf('0x3d')](_0x3d282d);if(_0x24e19c){return BPromise[_0x2ebf('0x27')]({'id':_0x24e19c['Id'],'name':_0x24e19c[_0x2ebf('0x28')],'phone':_0x24e19c[_0x2ebf('0x3e')],'endUserType':_0x24e19c[_0x2ebf('0x3f')][_0x2ebf('0x40')]['toLowerCase']()});}}})[_0x2ebf('0x2a')](function(_0x45b010){if(_0x45b010){logger['info'](_0x2ebf('0x41'),_0x45b010['endUserType'],_0x5324a6);return BPromise['resolve'](_0x45b010);}else{logger[_0x2ebf('0x1e')](_0x2ebf('0x42'),_0x5324a6);var _0x30bd06={'Phone':_0x5324a6};if(_0x1b9997['moduleCreate']){if(_0x1b9997[_0x2ebf('0x43')]==='contact'){logger[_0x2ebf('0x1e')](_0x2ebf('0x44'),_0x5324a6,_0x1b9997[_0x2ebf('0x43')]);_0x30bd06[_0x2ebf('0x45')]=_0x403c5d!==_0x2ebf('0x46')?_0x403c5d:util['format']('Caller\x20-\x20%s',_0x5324a6);}else if(_0x1b9997[_0x2ebf('0x43')]==='lead'){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5324a6,_0x1b9997[_0x2ebf('0x43')]);_0x30bd06['LastName']=_0x403c5d!==_0x2ebf('0x46')?_0x403c5d:util['format'](_0x2ebf('0x47'),_0x5324a6);_0x30bd06['Company']=_0x2ebf('0x48');}else if(_0x1b9997[_0x2ebf('0x43')]===_0x2ebf('0x3c')){logger[_0x2ebf('0x1e')](_0x2ebf('0x44'),_0x5324a6,_0x1b9997['moduleCreate']);_0x30bd06['Name']=_0x403c5d!==''?_0x403c5d:util[_0x2ebf('0x49')](_0x2ebf('0x47'),_0x5324a6);}else{return null;}}return _0x581b45[_0x2ebf('0x20')](_[_0x2ebf('0x4a')](_0x1b9997[_0x2ebf('0x43')]))[_0x2ebf('0x4b')](_0x30bd06)[_0x2ebf('0x2a')](function(_0x5252bc){return BPromise[_0x2ebf('0x27')]({'id':_0x5252bc['id'],'endUserType':_0x1b9997[_0x2ebf('0x43')]});});}});}function getCustomFields(_0x1a64e1,_0x1fbaa5){var _0xe909ab={};if(_0x1a64e1[_0x2ebf('0x34')]>0x0){_[_0x2ebf('0x4c')](_0x1a64e1,function(_0x440f05){if(_[_0x2ebf('0x4d')]([_0x2ebf('0x4e'),_0x2ebf('0x4f')],_0x440f05['type'])&&_0x440f05[_0x2ebf('0x50')]){_0xe909ab[_0x440f05[_0x2ebf('0x50')]]=_0x440f05['content'][_0x2ebf('0x51')]();}else if(_0x440f05[_0x2ebf('0x40')]===_0x2ebf('0x52')&&_0x440f05[_0x2ebf('0x53')]&&_0x440f05['idField']){_0x1fbaa5[_0x440f05[_0x2ebf('0x53')]]&&(_0xe909ab[_0x440f05[_0x2ebf('0x50')]]=_0x1fbaa5[_0x440f05[_0x2ebf('0x53')]][_0x2ebf('0x51')]());}else if(_0x440f05[_0x2ebf('0x40')]===_0x2ebf('0x54')&&_0x440f05['Variable']&&_0x440f05[_0x2ebf('0x55')][_0x2ebf('0x56')]&&_0x440f05[_0x2ebf('0x50')]){_0x1fbaa5[_0x440f05[_0x2ebf('0x55')][_0x2ebf('0x56')][_0x2ebf('0x57')]()]&&(_0xe909ab[_0x440f05[_0x2ebf('0x50')]]=_0x1fbaa5[_0x440f05[_0x2ebf('0x55')][_0x2ebf('0x56')][_0x2ebf('0x57')]()][_0x2ebf('0x51')]());}});}return _0xe909ab;}function getConnection(_0x52ae46){var _0x246256=_0x52ae46[_0x2ebf('0x58')][_0x2ebf('0x59')](_0x52ae46[_0x2ebf('0x5a')]);var _0x180162=new jsforce[(_0x2ebf('0x5b'))]({'oauth2':{'loginUrl':_0x52ae46[_0x2ebf('0x5c')]||'https://login.salesforce.com','clientId':_0x52ae46[_0x2ebf('0x5d')],'clientSecret':_0x52ae46[_0x2ebf('0x5e')]}});return _0x180162['login'](_0x52ae46['username'],_0x246256)['then'](function(){logger[_0x2ebf('0x1e')](_0x2ebf('0x5f'));return _0x180162;});}exports[_0x2ebf('0x60')]=function(_0x515cbb,_0x30b05a,_0x401078,_0x93efca,_0x3329df,_0x569fda){var _0x23c2ab,_0x4ab492,_0x3ec6e3,_0x390eeb;_0x569fda[_0x2ebf('0x61')]=intUtil[_0x2ebf('0x62')](_0x569fda['serverUrl']);_0x569fda[_0x2ebf('0x5c')]=intUtil[_0x2ebf('0x62')](_0x569fda['remoteUri']);if(_0x3329df&&_0x3329df[_0x2ebf('0x63')]){logger['info'](_0x2ebf('0x64'),_0x2ebf('0x65'));_0x30b05a[_0x2ebf('0x66')]=util[_0x2ebf('0x49')](_0x2ebf('0x67'),_0x569fda[_0x2ebf('0x61')],_0x30b05a[_0x2ebf('0x68')],md5(_0x30b05a[_0x2ebf('0x68')]));}else{_0x30b05a['recordingURL']='';}return getConnection(_0x569fda)[_0x2ebf('0x2a')](function(_0x3937fa){_0x390eeb=_0x3937fa;return getUser(_0x569fda,_0x93efca[_0x2ebf('0x69')],_0x390eeb);})[_0x2ebf('0x2a')](function(_0x2f86a3){_0x23c2ab=_0x2f86a3;return getEndUser(_0x569fda,_0x401078,_0x30b05a[_0x2ebf('0x6a')],_0x30b05a['calleridnum'],_0x390eeb);})[_0x2ebf('0x2a')](function(_0x295d58){_0x4ab492=_0x295d58;return getTicket(_0x569fda,_0x23c2ab,_0x4ab492,_0x401078,_0x30b05a,_0x401078['Fields'],_0x390eeb,_0x2ebf('0x60'));})[_0x2ebf('0x2a')](function(_0x527a8f){_0x3ec6e3=_0x527a8f;logger[_0x2ebf('0x1e')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x3ec6e3['id']);logger[_0x2ebf('0x1e')](_0x2ebf('0x6b'),_0x3ec6e3['id'],_0x93efca[_0x2ebf('0x56')],_0x569fda[_0x2ebf('0x40')]);switch(_0x569fda[_0x2ebf('0x40')]){case _0x2ebf('0x6c'):emit(util[_0x2ebf('0x49')](_0x2ebf('0x6d'),_0x93efca[_0x2ebf('0x56')]),_0x2ebf('0x6e'),{'recordId':_0x3ec6e3['id']});break;case'newTab':emit(util[_0x2ebf('0x49')](_0x2ebf('0x6d'),_0x93efca[_0x2ebf('0x56')]),_0x2ebf('0x6f'),{'uri':util[_0x2ebf('0x49')](_0x2ebf('0x70'),_0x390eeb[_0x2ebf('0x71')],_0x3ec6e3['id'])});break;default:logger['error'](_0x2ebf('0x72'));}})[_0x2ebf('0x73')](function(_0x1e708c){logger['error'](_0x2ebf('0x64'),_0x1e708c);});};exports[_0x2ebf('0x74')]=function(_0x384b93,_0x4aca55,_0x7f177d,_0x4b1feb,_0x4769f3,_0x4c8f41,_0x3d0e7b){var _0x5df1b2,_0x12cb78,_0x581740,_0x460adb;_0x4c8f41[_0x2ebf('0x61')]=intUtil[_0x2ebf('0x62')](_0x4c8f41['serverUrl']);_0x4c8f41[_0x2ebf('0x5c')]=intUtil[_0x2ebf('0x62')](_0x4c8f41[_0x2ebf('0x5c')]);if(_0x3d0e7b&&_0x3d0e7b[_0x2ebf('0x75')]&&_0x3d0e7b[_0x2ebf('0x75')]!==_0x2ebf('0x76')){logger[_0x2ebf('0x1e')]('[OUTBOUND]',_0x2ebf('0x65'));_0x4aca55[_0x2ebf('0x66')]=util[_0x2ebf('0x49')](_0x2ebf('0x67'),_0x4c8f41[_0x2ebf('0x61')],_0x4aca55[_0x2ebf('0x68')],md5(_0x4aca55[_0x2ebf('0x68')]));}return getConnection(_0x4c8f41)['then'](function(_0x125eb1){_0x460adb=_0x125eb1;return getUser(_0x4c8f41,_0x4b1feb[_0x2ebf('0x69')],_0x460adb);})[_0x2ebf('0x2a')](function(_0x1805ba){_0x5df1b2=_0x1805ba;return getEndUser(_0x4c8f41,_0x7f177d,_0x4aca55['destcalleridname'],_0x4aca55['destcalleridnum'],_0x460adb);})[_0x2ebf('0x2a')](function(_0x9e24b0){_0x12cb78=_0x9e24b0;return getTicket(_0x4c8f41,_0x5df1b2,_0x12cb78,_0x7f177d,_0x4aca55,_0x7f177d[_0x2ebf('0x77')],_0x460adb,'outbound');})['then'](function(_0x1cf8fc){_0x581740=_0x1cf8fc;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x581740['id']);logger[_0x2ebf('0x1e')](_0x2ebf('0x78'),_0x581740['id'],_0x4b1feb[_0x2ebf('0x56')],_0x4c8f41[_0x2ebf('0x40')]);switch(_0x4c8f41['type']){case _0x2ebf('0x6c'):emit(util['format'](_0x2ebf('0x6d'),_0x4b1feb[_0x2ebf('0x56')]),'trigger:salesforce:display',{'recordId':_0x581740['id']});break;case _0x2ebf('0x79'):emit(util['format'](_0x2ebf('0x6d'),_0x4b1feb['name']),_0x2ebf('0x6f'),{'uri':util[_0x2ebf('0x49')](_0x2ebf('0x70'),_0x460adb[_0x2ebf('0x71')],_0x581740['id'])});break;default:logger[_0x2ebf('0x7a')](_0x2ebf('0x7b'),_0x2ebf('0x7c'));}})[_0x2ebf('0x73')](function(_0x43ede2){logger[_0x2ebf('0x7a')]('[OUTBOUND]',_0x43ede2);});};exports[_0x2ebf('0x7d')]=function(_0xd6df05,_0x50465a,_0x3b5443,_0x40e335,_0x25cad7,_0x3b38de){var _0x2dc315,_0xb1106,_0x3cc20c,_0x447eee;_0x3b38de['serverUrl']=intUtil['stripTrailingSlash'](_0x3b38de['serverUrl']);_0x3b38de['remoteUri']=intUtil[_0x2ebf('0x62')](_0x3b38de[_0x2ebf('0x5c')]);if(_0x25cad7&&_0x25cad7['monitor_format']){logger[_0x2ebf('0x1e')]('['+_0x50465a['lastevent'][_0x2ebf('0x7e')]()+']',_0x2ebf('0x65'));_0x50465a[_0x2ebf('0x66')]=util[_0x2ebf('0x49')](_0x2ebf('0x67'),_0x3b38de['serverUrl'],_0x50465a[_0x2ebf('0x68')],md5(_0x50465a['uniqueid']));}else{_0x50465a['recordingURL']='';}return getConnection(_0x3b38de)['then'](function(_0x4bf4c9){_0x447eee=_0x4bf4c9;if(!_['isNil'](_0x40e335)){return getUser(_0x3b38de,_0x40e335[_0x2ebf('0x56')],_0x447eee);}else{return getUser(_0x3b38de,null,_0x447eee);}})['then'](function(_0x18ec1){_0x2dc315=_0x18ec1;return getEndUser(_0x3b38de,_0x3b5443,_0x50465a[_0x2ebf('0x6a')],_0x50465a['calleridnum'],_0x447eee);})[_0x2ebf('0x2a')](function(_0x2c6144){_0xb1106=_0x2c6144;return getTicket(_0x3b38de,_0x2dc315,_0xb1106,_0x3b5443,_0x50465a,_0x3b5443['Fields'],_0x447eee);})[_0x2ebf('0x2a')](function(_0x4fe39b){_0x3cc20c=_0x4fe39b;logger[_0x2ebf('0x1e')]('['+_0x50465a[_0x2ebf('0x7f')][_0x2ebf('0x7e')]()+_0x2ebf('0x80'),_0x3cc20c['id']);logger['info']('['+_0x50465a[_0x2ebf('0x7f')]['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x3b38de['type']);})[_0x2ebf('0x73')](function(_0x4e6595){logger[_0x2ebf('0x7a')]('['+_0x50465a[_0x2ebf('0x7f')][_0x2ebf('0x7e')]()+']',_0x4e6595);});}; \ 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 c24b724..ee88a3c 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 _0x24f8=['customField','nameField','toLowerCase','content','idField','toString','variable','variableName','customVariable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','number','POST','label','?sysparm_query=name%3D','label_entry','incident','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','forEach','all','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','%s/api/now/table/','isNil','email','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','length','result','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','adminId','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','true','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','then','],\x20getEndUser\x20crm','includes','picklist','type'];(function(_0x3a5c97,_0x4b25ed){var _0x3fc576=function(_0xd3c6d0){while(--_0xd3c6d0){_0x3a5c97['push'](_0x3a5c97['shift']());}};_0x3fc576(++_0x4b25ed);}(_0x24f8,0x1ef));var _0x824f=function(_0x3ec1da,_0x1e36f5){_0x3ec1da=_0x3ec1da-0x0;var _0x472358=_0x24f8[_0x3ec1da];return _0x472358;};'use strict';var _=require(_0x824f('0x0'));var Promise=require(_0x824f('0x1'));var rp=require('request-promise');var util=require(_0x824f('0x2'));var md5=require('md5');var Redis=require('ioredis');var intUtil=require(_0x824f('0x3'));var config=require(_0x824f('0x4'));var logger=require(_0x824f('0x5'))('servicenow');config['redis']=_[_0x824f('0x6')](config[_0x824f('0x7')],{'host':_0x824f('0x8'),'port':0x18eb});var io=require(_0x824f('0x9'))(new Redis(config[_0x824f('0x7')]));function getAdminUser(_0x5cfdcf,_0x151cab,_0x20c104,_0x582c7b,_0x40523c,_0x556e6b){return new Promise(function(_0x435b5c,_0x18a7fa){var _0x5ba12f={'method':'GET','uri':_0x582c7b+_0x824f('0xa')+'&'+_0x40523c+'&'+_0x556e6b,'auth':_0x151cab,'json':!![]};return rp(_0x5ba12f)['then'](function(_0x56bc9c){if(_0x56bc9c['result'][_0x824f('0xb')]>0x0){_0x20c104['adminId']=_0x56bc9c[_0x824f('0xc')][0x0][_0x824f('0xd')];}logger['info']('['+[_0x5cfdcf[_0x824f('0xe')]()]+_0x824f('0xf'),_0x20c104);_0x435b5c(_0x20c104);})[_0x824f('0x10')](function(_0x519048){logger[_0x824f('0x11')]('['+[_0x5cfdcf[_0x824f('0xe')]()]+']',_0x519048[_0x824f('0x12')]);_0x18a7fa(_0x519048['message']);});});}function getUser(_0x55251f,_0x297dc9,_0x1539cc,_0x2dc360,_0x3083c8){return function(_0x218307){logger[_0x824f('0x13')]('['+[_0x55251f[_0x824f('0xe')]()]+_0x824f('0x14'),_0x218307);return new Promise(function(_0x1224b0,_0x285ef1){if(intUtil[_0x824f('0x15')](_0x218307[_0x824f('0x16')])){var _0x279d06={'method':_0x824f('0x17'),'uri':_0x1539cc+_0x824f('0x18')+_0x218307['userEmail']+'&'+_0x2dc360+'&'+_0x3083c8,'auth':_0x297dc9,'json':!![]};logger['info']('['+[_0x55251f[_0x824f('0xe')]()]+_0x824f('0x19'),_0x279d06);return rp(_0x279d06)['then'](function(_0x2f7be6){logger[_0x824f('0x13')]('['+[_0x55251f[_0x824f('0xe')]()]+_0x824f('0x1a'),_0x2f7be6);if(_0x2f7be6[_0x824f('0xc')][_0x824f('0xb')]>0x0&&String(_0x2f7be6[_0x824f('0xc')][0x0][_0x824f('0x1b')])==='true'){_0x218307['userId']=_0x2f7be6[_0x824f('0xc')][0x0][_0x824f('0xd')];}else{_0x218307[_0x824f('0x1c')]=_0x218307[_0x824f('0x1d')];_0x218307['userEmail']=_0x218307[_0x824f('0x1e')];}logger[_0x824f('0x13')]('['+[_0x55251f['toUpperCase']()]+_0x824f('0x1f'),_0x218307);_0x1224b0(_0x218307);})[_0x824f('0x10')](function(_0x3e6347){logger[_0x824f('0x11')]('['+[_0x55251f[_0x824f('0xe')]()]+']',_0x3e6347['message']);_0x285ef1(_0x3e6347['message']);});}else{logger[_0x824f('0x13')]('['+[_0x55251f[_0x824f('0xe')]()]+']\x20using\x20admin\x20profile');_0x218307[_0x824f('0x1c')]=_0x218307[_0x824f('0x1d')];_0x218307[_0x824f('0x16')]=_0x218307['adminEmail'];_0x1224b0(_0x218307);}});};}function createEndUser(_0x36671e,_0x5c9d6c,_0xb4c6ee,_0x2ca7b1,_0x3f8d7c){logger['info']('['+[_0x36671e['toUpperCase']()]+_0x824f('0x20'),_0xb4c6ee);return new Promise(function(_0x27c491,_0x2a0614){var _0x53033d={'method':'POST','uri':_0x2ca7b1+_0x824f('0x21')+_0x3f8d7c,'body':{'user_name':_0xb4c6ee[_0x824f('0x22')],'roles':_0x824f('0x23'),'first_name':_0xb4c6ee[_0x824f('0x22')],'active':_0x824f('0x24'),'date_format':'System','phone':_0xb4c6ee[_0x824f('0x22')]},'auth':_0x5c9d6c,'json':!![]};return rp(_0x53033d)['then'](function(_0x364b89){logger[_0x824f('0x13')]('['+[_0x36671e[_0x824f('0xe')]()]+_0x824f('0x25'),_0x364b89[_0x824f('0xc')]);_0xb4c6ee[_0x824f('0x26')]=_0x364b89[_0x824f('0xc')][_0x824f('0xd')];_0x27c491(_0xb4c6ee);})['catch'](function(_0x381706){logger[_0x824f('0x11')]('['+[_0x36671e[_0x824f('0xe')]()]+']',_0x381706[_0x824f('0x12')]);_0x2a0614(_0x381706[_0x824f('0x12')]);});});}function getEndUser(_0x21be81,_0xfd2ab0,_0x7884dc,_0x2fe08e,_0x4b4bbc){return function(_0x42a86f){logger['info']('['+[_0x21be81[_0x824f('0xe')]()]+'],\x20getEndUser\x20input\x20crm',_0x42a86f);return new Promise(function(_0x34cc4e,_0x5d6053){var _0x2005b1={'method':_0x824f('0x17'),'uri':_0x7884dc+_0x824f('0x27')+_0x42a86f[_0x824f('0x22')]+'&'+_0x2fe08e+'&'+_0x4b4bbc,'auth':_0xfd2ab0,'json':!![]};return rp(_0x2005b1)[_0x824f('0x28')](function(_0x192ec8){if(_0x192ec8[_0x824f('0xc')][_0x824f('0xb')]>0x0){_0x42a86f[_0x824f('0x26')]=_0x192ec8[_0x824f('0xc')][0x0][_0x824f('0xd')];logger[_0x824f('0x13')]('['+[_0x21be81['toUpperCase']()]+_0x824f('0x29'),_0x42a86f);_0x34cc4e(_0x42a86f);}else{return createEndUser(_0x21be81,_0xfd2ab0,_0x42a86f,_0x7884dc,_0x2fe08e)[_0x824f('0x28')](function(_0x2b7725){logger['info']('['+[_0x21be81[_0x824f('0xe')]()]+'],\x20createEndUser\x20crm',_0x2b7725);_0x34cc4e(_0x2b7725);});}})['catch'](function(_0x1b5521){logger[_0x824f('0x11')]('['+[_0x21be81[_0x824f('0xe')]()]+']',_0x1b5521[_0x824f('0x12')]);_0x5d6053(_0x1b5521[_0x824f('0x12')]);});});};}function getCustomFields(_0x4e2349,_0x15f71d){var _0x5ca010={};if(_0x4e2349['length']>0x0){_['forEach'](_0x4e2349,function(_0xb4d719){if(_[_0x824f('0x2a')](['string',_0x824f('0x2b')],_0xb4d719[_0x824f('0x2c')])&&_0xb4d719['nameField']&&!_0xb4d719[_0x824f('0x2d')]){_0x5ca010[_0xb4d719[_0x824f('0x2e')][_0x824f('0x2f')]()]=_0xb4d719[_0x824f('0x30')]['toString']();}else if(_[_0x824f('0x2a')](['string',_0x824f('0x2b')],_0xb4d719[_0x824f('0x2c')])&&_0xb4d719[_0x824f('0x31')]&&_0xb4d719[_0x824f('0x2d')]){_0x5ca010[_0xb4d719[_0x824f('0x31')]['toLowerCase']()]=_0xb4d719[_0x824f('0x30')][_0x824f('0x32')]();}else if(_0xb4d719[_0x824f('0x2c')]===_0x824f('0x33')&&_0xb4d719['variableName']&&_0xb4d719[_0x824f('0x31')]&&_0xb4d719['customField']){_0x5ca010[_0xb4d719[_0x824f('0x31')][_0x824f('0x2f')]()]=_0x15f71d[_0xb4d719[_0x824f('0x34')]][_0x824f('0x32')]();}else if(_0xb4d719[_0x824f('0x2c')]===_0x824f('0x35')&&_0xb4d719['Variable']&&_0xb4d719['Variable'][_0x824f('0x36')]&&_0xb4d719[_0x824f('0x31')]&&_0xb4d719[_0x824f('0x2d')]){_0x5ca010[_0xb4d719[_0x824f('0x31')]['toLowerCase']()]=_0x15f71d[_0xb4d719['Variable'][_0x824f('0x36')][_0x824f('0x2f')]()][_0x824f('0x32')]();}});}return _0x5ca010;}function getTicket(_0x455fc7,_0x5910a0,_0x51bbac,_0x32e314,_0x5ce64c,_0xb355d9){return function(_0x41fa92){logger[_0x824f('0x13')]('['+[_0x455fc7[_0x824f('0xe')]()]+_0x824f('0x37'),_0x41fa92);return new Promise(function(_0x58b5c3,_0x1857db){var _0x5117a3=_0x455fc7[_0x824f('0x2f')]()===_0x824f('0x38')?_0x41fa92[_0x824f('0x1c')]:_0x41fa92[_0x824f('0x26')];var _0x1bb709={'method':'POST','uri':_0x51bbac+'incident'+'?'+_0xb355d9,'body':Object[_0x824f('0x39')]({},{'active':_0x824f('0x24'),'caller_id':_0x5117a3,'assigned_to':_0x41fa92[_0x824f('0x1c')],'short_description':intUtil[_0x824f('0x3a')](_0x32e314['Subjects'],_0x5ce64c,'\x20'),'description':intUtil[_0x824f('0x3a')](_0x32e314[_0x824f('0x3b')],_0x5ce64c,'\x0a')},getCustomFields(_0x32e314[_0x824f('0x3c')],_0x5ce64c)),'auth':_0x5910a0,'json':!![]};return rp(_0x1bb709)[_0x824f('0x28')](function(_0xd5f372){logger[_0x824f('0x13')]('['+[_0x455fc7[_0x824f('0xe')]()]+_0x824f('0x3d'),_0xd5f372['result']);_0x41fa92['ticketId']=_0xd5f372[_0x824f('0xc')][_0x824f('0xd')];_0x41fa92['ticketNumber']=_0xd5f372['result'][_0x824f('0x3e')];logger[_0x824f('0x13')]('['+[_0x455fc7['toUpperCase']()]+']\x20getTicket\x20crm',_0x41fa92);_0x58b5c3(_0x41fa92);})['catch'](function(_0x194538){logger[_0x824f('0x11')]('['+[_0x455fc7[_0x824f('0xe')]()]+']',_0x194538[_0x824f('0x12')]);_0x1857db(_0x194538[_0x824f('0x12')]);});});};}function createRemoteTag(_0x1a2518,_0x10b560,_0x28145a,_0x4e5b6c){return new Promise(function(_0xdb5ae8,_0x45e273){var _0x583222={'method':_0x824f('0x3f'),'uri':_0x28145a+_0x824f('0x40')+'?'+_0x4e5b6c,'body':{'short_description':_0x1a2518,'global':!![],'active':!![],'name':_0x1a2518},'auth':_0x10b560,'json':!![]};return rp(_0x583222)[_0x824f('0x28')](function(_0x3dc19a){var _0x2d90a3=_0x3dc19a[_0x824f('0xc')][_0x824f('0xd')];_0xdb5ae8(_0x2d90a3);});});}function getRemoteTag(_0x4871f1,_0x31af26,_0x43d8af,_0x470c99,_0x2d4489){return new Promise(function(_0xac7132,_0x2729de){var _0x142e2d={'method':_0x824f('0x17'),'uri':_0x43d8af+_0x824f('0x40')+_0x824f('0x41')+_0x4871f1+'&'+_0x470c99,'auth':_0x31af26,'json':!![]};return rp(_0x142e2d)['then'](function(_0x36815f){if(_0x36815f[_0x824f('0xc')][_0x824f('0xb')]>0x0){var _0x488c1c=_0x36815f[_0x824f('0xc')][0x0][_0x824f('0xd')];_0xac7132(_0x488c1c);}else{return createRemoteTag(_0x4871f1,_0x31af26,_0x43d8af,_0x470c99)[_0x824f('0x28')](function(_0x4fade0){_0xac7132(_0x4fade0);});}});});}function assignTagToIncident(_0x3ab752,_0x528c1a,_0x49ec74,_0x5de19d,_0x246901){return new Promise(function(_0x3d5dda,_0x58e981){var _0x2ec641={'method':_0x824f('0x3f'),'uri':_0x49ec74+_0x824f('0x42')+'?'+_0x246901,'body':{'label':_0x3ab752,'table':_0x824f('0x43'),'id_type':_0x824f('0x44'),'table_key':_0x5de19d[_0x824f('0x45')],'title':_0x824f('0x46')+_0x5de19d['ticketNumber'],'id_display':_0x5de19d[_0x824f('0x47')]},'auth':_0x528c1a,'json':!![]};return rp(_0x2ec641)['then'](function(_0x1eafbd){_0x3d5dda();})[_0x824f('0x10')](function(){_0x3d5dda();});});}function manageTags(_0x24c36c,_0x7636a1,_0x1f3694,_0x3d5ccf,_0x12990f,_0xf2333f,_0x3270f4){return new Promise(function(_0x18ffb7,_0x518482){var _0x218312=[];_0x7636a1['forEach'](function(_0x46bff9){_0x218312[_0x824f('0x48')](getRemoteTag(_0x46bff9,_0x1f3694,_0x3d5ccf,_0xf2333f,_0x3270f4));});return Promise['all'](_0x218312)[_0x824f('0x28')](function(_0x8151f){if(_0x8151f[_0x824f('0xb')]){logger[_0x824f('0x13')]('['+[_0x24c36c[_0x824f('0xe')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x8151f);var _0x333b5b=[];_0x8151f[_0x824f('0x49')](function(_0xbc49e9){_0x333b5b[_0x824f('0x48')](assignTagToIncident(_0xbc49e9,_0x1f3694,_0x3d5ccf,_0x12990f,_0xf2333f));});return Promise[_0x824f('0x4a')](_0x333b5b)[_0x824f('0x28')](function(){_0x18ffb7();})[_0x824f('0x10')](function(){_0x18ffb7();});}else{_0x18ffb7();}});});}function getTags(_0x3d98f2,_0x14a791,_0x3895d4,_0x287e3b,_0x10fd06,_0x157418){return function(_0x2b608d){return new Promise(function(_0x39f7ec,_0x28bc26){var _0x193665=[];var _0x246de2=_0x287e3b[_0x824f('0x4b')];if(_0x246de2&&_0x246de2[_0x824f('0xb')]>0x0){_0x193665=_['map'](_0x246de2,_0x824f('0x36'));}if(_0x193665[_0x824f('0xb')]>0x0){return manageTags(_0x3d98f2,_0x193665,_0x14a791,_0x3895d4,_0x2b608d,_0x10fd06,_0x157418)[_0x824f('0x28')](function(){_0x39f7ec(_0x2b608d);});}else{_0x39f7ec(_0x2b608d);}});};}function emit(_0x419c06,_0x175552,_0x27140a){var _0x516226='%26sysparm_record_target%3Dincident'+_0x824f('0x4c')+_0x824f('0x4d')+_0x824f('0x4e');var _0x3d229d={'uri':_0x419c06+_0x824f('0x4f')+_0x27140a+_0x516226};io['to'](util[_0x824f('0x50')](_0x824f('0x51'),_0x175552))[_0x824f('0x52')]('trigger:browser:url',_0x3d229d);}exports['cs']=function(_0x297bf9,_0x21cd9a,_0x36ef26,_0x4afc41,_0x268469,_0x55a7e1,_0x2e0d34,_0x18150b){var _0x47b062={};var _0xc6b5a3={'user':_0x55a7e1[_0x824f('0x53')],'pass':_0x55a7e1[_0x824f('0x54')]};var _0x1363f8=_0x824f('0x55');var _0x1ad7ee=_0x824f('0x56');_0x55a7e1[_0x824f('0x57')]=intUtil['stripTrailingSlash'](_0x55a7e1['remoteUri']);_0x55a7e1[_0x824f('0x58')]=intUtil['stripTrailingSlash'](_0x55a7e1[_0x824f('0x58')]);var _0x6a726e=util[_0x824f('0x50')](_0x824f('0x59'),_0x55a7e1[_0x824f('0x57')]);_0x47b062[_0x824f('0x16')]=!_[_0x824f('0x5a')](_0x4afc41)?_0x4afc41[_0x824f('0x5b')]:null;_0x47b062[_0x824f('0x1e')]=_0x55a7e1[_0x824f('0x5b')];_0x47b062['endUserNumber']=_0x18150b[_0x824f('0x2f')]()===_0x824f('0x38')?_0x21cd9a['destcalleridnum']:_0x21cd9a['calleridnum'];_0x47b062[_0x824f('0x5c')]=_0x18150b===_0x824f('0x5d')||_0x18150b==='unmanaged'?'queue':_0x824f('0x38');var _0x36d2e6=util[_0x824f('0x50')](_0x824f('0x5e'),_0x55a7e1[_0x824f('0x58')],_0x21cd9a[_0x824f('0x5f')],md5(_0x21cd9a[_0x824f('0x5f')]));if(_0x268469&&_0x268469[_0x824f('0x60')]){logger[_0x824f('0x13')](_0x824f('0x61'),_0x824f('0x62'));_0x21cd9a[_0x824f('0x63')]=_0x36d2e6;}else if(_0x2e0d34&&_0x2e0d34[_0x824f('0x64')]&&_0x2e0d34[_0x824f('0x64')]!==_0x824f('0x65')){logger[_0x824f('0x13')](_0x824f('0x66'),_0x824f('0x62'));_0x21cd9a['recordingURL']=_0x36d2e6;}else{_0x21cd9a[_0x824f('0x63')]='';}return getAdminUser(_0x18150b,_0xc6b5a3,_0x47b062,_0x6a726e,_0x1ad7ee,_0x1363f8)[_0x824f('0x28')](getUser(_0x18150b,_0xc6b5a3,_0x6a726e,_0x1ad7ee,_0x1363f8))['then'](getEndUser(_0x18150b,_0xc6b5a3,_0x6a726e,_0x1ad7ee,_0x1363f8))[_0x824f('0x28')](getTicket(_0x18150b,_0xc6b5a3,_0x6a726e,_0x36ef26,_0x21cd9a,_0x1ad7ee))['then'](function(_0x175f7c){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x175f7c[_0x824f('0x45')]));logger[_0x824f('0x13')](util['format'](_0x824f('0x67'),_0x18150b));if(_0x18150b!==_0x824f('0x68')){logger[_0x824f('0x13')]('['+[_0x18150b[_0x824f('0xe')]()]+']',_0x824f('0x69'));emit(_0x55a7e1['remoteUri'],_0x4afc41['name'],_0x175f7c[_0x824f('0x45')]);}})[_0x824f('0x10')](function(_0x3f3859){logger['error']('['+[_0x18150b['toUpperCase']()]+_0x824f('0x6a'),util[_0x824f('0x6b')](_0x3f3859,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xfa21=['email','destcalleridnum','callDirection','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','lodash','request-promise','md5','ioredis','./util','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','],\x20getAdminUser\x20crm','error','toUpperCase','message','info','],\x20getUser\x20input\x20crm','userEmail','],\x20getUser\x20rp\x20obj','active','true','userId','sys_id','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','POST','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','catch','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl'];(function(_0x4e49dd,_0xda8495){var _0x4c6300=function(_0x401b4c){while(--_0x401b4c){_0x4e49dd['push'](_0x4e49dd['shift']());}};_0x4c6300(++_0xda8495);}(_0xfa21,0xe6));var _0x1fa2=function(_0x587f4b,_0x223d12){_0x587f4b=_0x587f4b-0x0;var _0x135f1d=_0xfa21[_0x587f4b];return _0x135f1d;};'use strict';var _=require(_0x1fa2('0x0'));var Promise=require('bluebird');var rp=require(_0x1fa2('0x1'));var util=require('util');var md5=require(_0x1fa2('0x2'));var Redis=require(_0x1fa2('0x3'));var intUtil=require(_0x1fa2('0x4'));var config=require('../../../../config/environment');var logger=require(_0x1fa2('0x5'))(_0x1fa2('0x6'));config[_0x1fa2('0x7')]=_[_0x1fa2('0x8')](config[_0x1fa2('0x7')],{'host':_0x1fa2('0x9'),'port':0x18eb});var io=require(_0x1fa2('0xa'))(new Redis(config[_0x1fa2('0x7')]));function getAdminUser(_0x55cd3a,_0x20f4d1,_0x120da8,_0x576760,_0x3b0194,_0x5cde41){return new Promise(function(_0x2c8f5c,_0xb5ebbf){var _0x3f5f04={'method':_0x1fa2('0xb'),'uri':_0x576760+_0x1fa2('0xc')+'&'+_0x3b0194+'&'+_0x5cde41,'auth':_0x20f4d1,'json':!![]};return rp(_0x3f5f04)[_0x1fa2('0xd')](function(_0x469cbd){if(_0x469cbd[_0x1fa2('0xe')][_0x1fa2('0xf')]>0x0){_0x120da8[_0x1fa2('0x10')]=_0x469cbd[_0x1fa2('0xe')][0x0]['sys_id'];}logger['info']('['+[_0x55cd3a['toUpperCase']()]+_0x1fa2('0x11'),_0x120da8);_0x2c8f5c(_0x120da8);})['catch'](function(_0x5502b5){logger[_0x1fa2('0x12')]('['+[_0x55cd3a[_0x1fa2('0x13')]()]+']',_0x5502b5[_0x1fa2('0x14')]);_0xb5ebbf(_0x5502b5[_0x1fa2('0x14')]);});});}function getUser(_0x30fe7c,_0x386729,_0x29fdcc,_0x3968a2,_0x412ce0){return function(_0x47c0a2){logger[_0x1fa2('0x15')]('['+[_0x30fe7c[_0x1fa2('0x13')]()]+_0x1fa2('0x16'),_0x47c0a2);return new Promise(function(_0x5eb334,_0x472fcd){if(intUtil['validateEmail'](_0x47c0a2['userEmail'])){var _0x5959ce={'method':_0x1fa2('0xb'),'uri':_0x29fdcc+'sys_user?sysparm_query=email%3D'+_0x47c0a2[_0x1fa2('0x17')]+'&'+_0x3968a2+'&'+_0x412ce0,'auth':_0x386729,'json':!![]};logger['info']('['+[_0x30fe7c[_0x1fa2('0x13')]()]+_0x1fa2('0x18'),_0x5959ce);return rp(_0x5959ce)[_0x1fa2('0xd')](function(_0x3030ad){logger['info']('['+[_0x30fe7c[_0x1fa2('0x13')]()]+'],\x20getUser\x20entity',_0x3030ad);if(_0x3030ad[_0x1fa2('0xe')]['length']>0x0&&String(_0x3030ad[_0x1fa2('0xe')][0x0][_0x1fa2('0x19')])===_0x1fa2('0x1a')){_0x47c0a2[_0x1fa2('0x1b')]=_0x3030ad[_0x1fa2('0xe')][0x0][_0x1fa2('0x1c')];}else{_0x47c0a2[_0x1fa2('0x1b')]=_0x47c0a2[_0x1fa2('0x10')];_0x47c0a2[_0x1fa2('0x17')]=_0x47c0a2[_0x1fa2('0x1d')];}logger['info']('['+[_0x30fe7c[_0x1fa2('0x13')]()]+_0x1fa2('0x1e'),_0x47c0a2);_0x5eb334(_0x47c0a2);})['catch'](function(_0x778621){logger[_0x1fa2('0x12')]('['+[_0x30fe7c[_0x1fa2('0x13')]()]+']',_0x778621[_0x1fa2('0x14')]);_0x472fcd(_0x778621[_0x1fa2('0x14')]);});}else{logger['info']('['+[_0x30fe7c['toUpperCase']()]+_0x1fa2('0x1f'));_0x47c0a2[_0x1fa2('0x1b')]=_0x47c0a2[_0x1fa2('0x10')];_0x47c0a2[_0x1fa2('0x17')]=_0x47c0a2[_0x1fa2('0x1d')];_0x5eb334(_0x47c0a2);}});};}function createEndUser(_0x519b2d,_0x2eae5f,_0x29edd9,_0x59cb09,_0x14ec97){logger[_0x1fa2('0x15')]('['+[_0x519b2d['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x29edd9);return new Promise(function(_0x232eb2,_0x655a1){var _0x5f11fa={'method':_0x1fa2('0x20'),'uri':_0x59cb09+'sys_user?'+_0x14ec97,'body':{'user_name':_0x29edd9[_0x1fa2('0x21')],'roles':_0x1fa2('0x22'),'first_name':_0x29edd9[_0x1fa2('0x21')],'active':'true','date_format':_0x1fa2('0x23'),'phone':_0x29edd9[_0x1fa2('0x21')]},'auth':_0x2eae5f,'json':!![]};return rp(_0x5f11fa)['then'](function(_0x2fee29){logger[_0x1fa2('0x15')]('['+[_0x519b2d[_0x1fa2('0x13')]()]+_0x1fa2('0x24'),_0x2fee29[_0x1fa2('0xe')]);_0x29edd9[_0x1fa2('0x25')]=_0x2fee29[_0x1fa2('0xe')][_0x1fa2('0x1c')];_0x232eb2(_0x29edd9);})[_0x1fa2('0x26')](function(_0x1a122c){logger[_0x1fa2('0x12')]('['+[_0x519b2d[_0x1fa2('0x13')]()]+']',_0x1a122c[_0x1fa2('0x14')]);_0x655a1(_0x1a122c['message']);});});}function getEndUser(_0x5e724e,_0xe42555,_0x7f68da,_0x388295,_0x48f8d1){return function(_0x1e79f7){logger[_0x1fa2('0x15')]('['+[_0x5e724e[_0x1fa2('0x13')]()]+_0x1fa2('0x27'),_0x1e79f7);return new Promise(function(_0x3567cb,_0x3902e9){var _0x454aca={'method':'GET','uri':_0x7f68da+'sys_user?sysparm_query=phone%3D'+_0x1e79f7['endUserNumber']+'&'+_0x388295+'&'+_0x48f8d1,'auth':_0xe42555,'json':!![]};return rp(_0x454aca)[_0x1fa2('0xd')](function(_0x141a55){if(_0x141a55['result'][_0x1fa2('0xf')]>0x0){_0x1e79f7[_0x1fa2('0x25')]=_0x141a55['result'][0x0][_0x1fa2('0x1c')];logger[_0x1fa2('0x15')]('['+[_0x5e724e['toUpperCase']()]+_0x1fa2('0x28'),_0x1e79f7);_0x3567cb(_0x1e79f7);}else{return createEndUser(_0x5e724e,_0xe42555,_0x1e79f7,_0x7f68da,_0x388295)[_0x1fa2('0xd')](function(_0x177fd4){logger['info']('['+[_0x5e724e['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x177fd4);_0x3567cb(_0x177fd4);});}})[_0x1fa2('0x26')](function(_0x1283a5){logger[_0x1fa2('0x12')]('['+[_0x5e724e['toUpperCase']()]+']',_0x1283a5[_0x1fa2('0x14')]);_0x3902e9(_0x1283a5[_0x1fa2('0x14')]);});});};}function getCustomFields(_0x1f8d9f,_0x7544df){var _0x517e7e={};if(_0x1f8d9f[_0x1fa2('0xf')]>0x0){_[_0x1fa2('0x29')](_0x1f8d9f,function(_0x5a9632){if(_[_0x1fa2('0x2a')](['string',_0x1fa2('0x2b')],_0x5a9632[_0x1fa2('0x2c')])&&_0x5a9632[_0x1fa2('0x2d')]&&!_0x5a9632[_0x1fa2('0x2e')]){_0x517e7e[_0x5a9632[_0x1fa2('0x2d')][_0x1fa2('0x2f')]()]=_0x5a9632[_0x1fa2('0x30')][_0x1fa2('0x31')]();}else if(_[_0x1fa2('0x2a')](['string',_0x1fa2('0x2b')],_0x5a9632[_0x1fa2('0x2c')])&&_0x5a9632[_0x1fa2('0x32')]&&_0x5a9632['customField']){_0x517e7e[_0x5a9632[_0x1fa2('0x32')]['toLowerCase']()]=_0x5a9632[_0x1fa2('0x30')][_0x1fa2('0x31')]();}else if(_0x5a9632[_0x1fa2('0x2c')]==='variable'&&_0x5a9632[_0x1fa2('0x33')]&&_0x5a9632[_0x1fa2('0x32')]&&_0x5a9632[_0x1fa2('0x2e')]){_0x517e7e[_0x5a9632['idField'][_0x1fa2('0x2f')]()]=_0x7544df[_0x5a9632[_0x1fa2('0x33')]][_0x1fa2('0x31')]();}else if(_0x5a9632[_0x1fa2('0x2c')]===_0x1fa2('0x34')&&_0x5a9632[_0x1fa2('0x35')]&&_0x5a9632['Variable'][_0x1fa2('0x36')]&&_0x5a9632['idField']&&_0x5a9632['customField']){_0x517e7e[_0x5a9632[_0x1fa2('0x32')]['toLowerCase']()]=_0x7544df[_0x5a9632[_0x1fa2('0x35')][_0x1fa2('0x36')][_0x1fa2('0x2f')]()][_0x1fa2('0x31')]();}});}return _0x517e7e;}function getTicket(_0x12ccde,_0xcc944b,_0x3cede1,_0x203b38,_0x23b50d,_0x30a253){return function(_0x50ce96){logger[_0x1fa2('0x15')]('['+[_0x12ccde[_0x1fa2('0x13')]()]+_0x1fa2('0x37'),_0x50ce96);return new Promise(function(_0x47a2c8,_0xd65ba6){var _0x64cc4f=_0x12ccde[_0x1fa2('0x2f')]()==='outbound'?_0x50ce96[_0x1fa2('0x1b')]:_0x50ce96[_0x1fa2('0x25')];var _0x10fe17={'method':_0x1fa2('0x20'),'uri':_0x3cede1+_0x1fa2('0x38')+'?'+_0x30a253,'body':Object[_0x1fa2('0x39')]({},{'active':'true','caller_id':_0x64cc4f,'assigned_to':_0x50ce96[_0x1fa2('0x1b')],'short_description':intUtil[_0x1fa2('0x3a')](_0x203b38['Subjects'],_0x23b50d,'\x20'),'description':intUtil[_0x1fa2('0x3a')](_0x203b38[_0x1fa2('0x3b')],_0x23b50d,'\x0a')},getCustomFields(_0x203b38[_0x1fa2('0x3c')],_0x23b50d)),'auth':_0xcc944b,'json':!![]};return rp(_0x10fe17)[_0x1fa2('0xd')](function(_0x5eaa79){logger[_0x1fa2('0x15')]('['+[_0x12ccde[_0x1fa2('0x13')]()]+_0x1fa2('0x3d'),_0x5eaa79['result']);_0x50ce96[_0x1fa2('0x3e')]=_0x5eaa79[_0x1fa2('0xe')][_0x1fa2('0x1c')];_0x50ce96[_0x1fa2('0x3f')]=_0x5eaa79[_0x1fa2('0xe')][_0x1fa2('0x40')];logger[_0x1fa2('0x15')]('['+[_0x12ccde['toUpperCase']()]+_0x1fa2('0x41'),_0x50ce96);_0x47a2c8(_0x50ce96);})[_0x1fa2('0x26')](function(_0x4a22c1){logger['error']('['+[_0x12ccde['toUpperCase']()]+']',_0x4a22c1[_0x1fa2('0x14')]);_0xd65ba6(_0x4a22c1[_0x1fa2('0x14')]);});});};}function createRemoteTag(_0x189db5,_0x5c946c,_0x1eecc3,_0x304951){return new Promise(function(_0x1cf66a,_0x3a2f72){var _0x1d0d51={'method':'POST','uri':_0x1eecc3+_0x1fa2('0x42')+'?'+_0x304951,'body':{'short_description':_0x189db5,'global':!![],'active':!![],'name':_0x189db5},'auth':_0x5c946c,'json':!![]};return rp(_0x1d0d51)[_0x1fa2('0xd')](function(_0x45f278){var _0xa21d44=_0x45f278[_0x1fa2('0xe')][_0x1fa2('0x1c')];_0x1cf66a(_0xa21d44);});});}function getRemoteTag(_0x142dd6,_0x4e0b12,_0xe1466c,_0x26b87e,_0x4e63ea){return new Promise(function(_0x58feee,_0x194a6e){var _0x11b6f0={'method':_0x1fa2('0xb'),'uri':_0xe1466c+'label'+_0x1fa2('0x43')+_0x142dd6+'&'+_0x26b87e,'auth':_0x4e0b12,'json':!![]};return rp(_0x11b6f0)[_0x1fa2('0xd')](function(_0x373788){if(_0x373788[_0x1fa2('0xe')][_0x1fa2('0xf')]>0x0){var _0x56a1c7=_0x373788['result'][0x0][_0x1fa2('0x1c')];_0x58feee(_0x56a1c7);}else{return createRemoteTag(_0x142dd6,_0x4e0b12,_0xe1466c,_0x26b87e)[_0x1fa2('0xd')](function(_0x10987a){_0x58feee(_0x10987a);});}});});}function assignTagToIncident(_0x5f58e9,_0x5ab98a,_0x12e0b6,_0x163abb,_0x2323b2){return new Promise(function(_0x3da647,_0x4cbe6f){var _0x19fe76={'method':_0x1fa2('0x20'),'uri':_0x12e0b6+_0x1fa2('0x44')+'?'+_0x2323b2,'body':{'label':_0x5f58e9,'table':'incident','id_type':'Incident','table_key':_0x163abb[_0x1fa2('0x3e')],'title':'Incident\x20-\x20'+_0x163abb['ticketNumber'],'id_display':_0x163abb[_0x1fa2('0x3f')]},'auth':_0x5ab98a,'json':!![]};return rp(_0x19fe76)[_0x1fa2('0xd')](function(_0x23423f){_0x3da647();})[_0x1fa2('0x26')](function(){_0x3da647();});});}function manageTags(_0xee7c8f,_0x1674f7,_0x4f76cb,_0x2ff266,_0x39e2c4,_0x32cb27,_0x125102){return new Promise(function(_0x16a46b,_0x23d1cf){var _0x50cb73=[];_0x1674f7[_0x1fa2('0x29')](function(_0x5cfb3b){_0x50cb73[_0x1fa2('0x45')](getRemoteTag(_0x5cfb3b,_0x4f76cb,_0x2ff266,_0x32cb27,_0x125102));});return Promise[_0x1fa2('0x46')](_0x50cb73)['then'](function(_0x7f199){if(_0x7f199[_0x1fa2('0xf')]){logger[_0x1fa2('0x15')]('['+[_0xee7c8f[_0x1fa2('0x13')]()]+_0x1fa2('0x47'),_0x7f199);var _0x184b83=[];_0x7f199[_0x1fa2('0x29')](function(_0x452d60){_0x184b83[_0x1fa2('0x45')](assignTagToIncident(_0x452d60,_0x4f76cb,_0x2ff266,_0x39e2c4,_0x32cb27));});return Promise[_0x1fa2('0x46')](_0x184b83)['then'](function(){_0x16a46b();})['catch'](function(){_0x16a46b();});}else{_0x16a46b();}});});}function getTags(_0x48aeee,_0x34e336,_0x3c4b66,_0x4c3669,_0x3a6a78,_0x117821){return function(_0x562686){return new Promise(function(_0x5a3657,_0x177b7f){var _0x5262c2=[];var _0x3fce60=_0x4c3669['Tags'];if(_0x3fce60&&_0x3fce60[_0x1fa2('0xf')]>0x0){_0x5262c2=_[_0x1fa2('0x48')](_0x3fce60,_0x1fa2('0x36'));}if(_0x5262c2[_0x1fa2('0xf')]>0x0){return manageTags(_0x48aeee,_0x5262c2,_0x34e336,_0x3c4b66,_0x562686,_0x3a6a78,_0x117821)['then'](function(){_0x5a3657(_0x562686);});}else{_0x5a3657(_0x562686);}});};}function emit(_0x17db50,_0x2010da,_0x3bba29){var _0x10e536=_0x1fa2('0x49')+_0x1fa2('0x4a')+_0x1fa2('0x4b')+_0x1fa2('0x4c');var _0x5aca57={'uri':_0x17db50+_0x1fa2('0x4d')+_0x3bba29+_0x10e536};io['to'](util[_0x1fa2('0x4e')](_0x1fa2('0x4f'),_0x2010da))[_0x1fa2('0x50')](_0x1fa2('0x51'),_0x5aca57);}exports['cs']=function(_0x35bb82,_0x183a69,_0x23c2dc,_0x2132e6,_0x429e35,_0x1cbe36,_0x152ef5,_0x3fdcf2){var _0x3e12fc={};var _0x2bd896={'user':_0x1cbe36[_0x1fa2('0x52')],'pass':_0x1cbe36[_0x1fa2('0x53')]};var _0x4f5529='sysparm_limit=1';var _0x536200=_0x1fa2('0x54');_0x1cbe36[_0x1fa2('0x55')]=intUtil['stripTrailingSlash'](_0x1cbe36['remoteUri']);_0x1cbe36['serverUrl']=intUtil[_0x1fa2('0x56')](_0x1cbe36[_0x1fa2('0x57')]);var _0x2e791d=util[_0x1fa2('0x4e')]('%s/api/now/table/',_0x1cbe36[_0x1fa2('0x55')]);_0x3e12fc[_0x1fa2('0x17')]=!_['isNil'](_0x2132e6)?_0x2132e6[_0x1fa2('0x58')]:null;_0x3e12fc[_0x1fa2('0x1d')]=_0x1cbe36[_0x1fa2('0x58')];_0x3e12fc[_0x1fa2('0x21')]=_0x3fdcf2[_0x1fa2('0x2f')]()==='outbound'?_0x183a69[_0x1fa2('0x59')]:_0x183a69['calleridnum'];_0x3e12fc[_0x1fa2('0x5a')]=_0x3fdcf2===_0x1fa2('0x5b')||_0x3fdcf2==='unmanaged'?_0x1fa2('0x5b'):_0x1fa2('0x5c');var _0x33dcba=util['format'](_0x1fa2('0x5d'),_0x1cbe36[_0x1fa2('0x57')],_0x183a69['uniqueid'],md5(_0x183a69[_0x1fa2('0x5e')]));if(_0x429e35&&_0x429e35[_0x1fa2('0x5f')]){logger[_0x1fa2('0x15')](_0x1fa2('0x60'),_0x1fa2('0x61'));_0x183a69[_0x1fa2('0x62')]=_0x33dcba;}else if(_0x152ef5&&_0x152ef5[_0x1fa2('0x63')]&&_0x152ef5['recordingFormat']!==_0x1fa2('0x64')){logger[_0x1fa2('0x15')](_0x1fa2('0x65'),'Recording\x20is\x20enabled!');_0x183a69[_0x1fa2('0x62')]=_0x33dcba;}else{_0x183a69[_0x1fa2('0x62')]='';}return getAdminUser(_0x3fdcf2,_0x2bd896,_0x3e12fc,_0x2e791d,_0x536200,_0x4f5529)[_0x1fa2('0xd')](getUser(_0x3fdcf2,_0x2bd896,_0x2e791d,_0x536200,_0x4f5529))[_0x1fa2('0xd')](getEndUser(_0x3fdcf2,_0x2bd896,_0x2e791d,_0x536200,_0x4f5529))[_0x1fa2('0xd')](getTicket(_0x3fdcf2,_0x2bd896,_0x2e791d,_0x23c2dc,_0x183a69,_0x536200))[_0x1fa2('0xd')](function(_0x16b3c8){logger[_0x1fa2('0x15')](util['format'](_0x1fa2('0x66'),_0x16b3c8[_0x1fa2('0x3e')]));logger[_0x1fa2('0x15')](util[_0x1fa2('0x4e')](_0x1fa2('0x67'),_0x3fdcf2));if(_0x3fdcf2!==_0x1fa2('0x68')){logger[_0x1fa2('0x15')]('['+[_0x3fdcf2[_0x1fa2('0x13')]()]+']',_0x1fa2('0x69'));emit(_0x1cbe36[_0x1fa2('0x55')],_0x2132e6[_0x1fa2('0x36')],_0x16b3c8[_0x1fa2('0x3e')]);}})['catch'](function(_0x3a2d51){logger[_0x1fa2('0x12')]('['+[_0x3fdcf2[_0x1fa2('0x13')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0x3a2d51,{'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 da27f72..a114b41 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 _0x0aaa=['The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','error','[QUEUE]','outbound','uri','%s/service/v4_1/rest.php','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Fields','Outbound','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','lastevent','toUpperCase','Recording\x20is\x20enabled!','bluebird','md5','util','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','idField','set_entry','JSON','Calls','format','Basic\x20%s','base64','stringify','isNil','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','name_value_list','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\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','entry_list','debug','[HTTP]','merge','string','customField','nameField','toLowerCase','content','toString','type','custom_fields','push','variable','variableName','customVariable','Variable','username','password','xCALLY\x20Motion\x20integration','sessionID','queue','remoteUri','stripTrailingSlash','serverUrl','monitor_format','recordingURL','uniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0aaa,0x1f4));var _0xa0aa=function(_0x53fe97,_0x544271){_0x53fe97=_0x53fe97-0x0;var _0x5c49a2=_0x0aaa[_0x53fe97];return _0x5c49a2;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0xa0aa('0x0'));var md5=require(_0xa0aa('0x1'));var util=require(_0xa0aa('0x2'));var Redis=require('ioredis');var intUtil=require(_0xa0aa('0x3'));var config=require(_0xa0aa('0x4'));var logger=require('../../../../config/logger')(_0xa0aa('0x5'));config[_0xa0aa('0x6')]=_[_0xa0aa('0x7')](config[_0xa0aa('0x6')],{'host':_0xa0aa('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa0aa('0x6')]));var def={'method':_0xa0aa('0x9'),'json':!![]};function emit(_0x42a606,_0x60b398,_0x4115cb){io['to'](_0x42a606)[_0xa0aa('0xa')](_0x60b398,_0x4115cb);}function getTicket(_0x13aa06,_0x9924b9,_0x59eed5,_0xb3ce6f,_0x1d206c,_0x52ebd0,_0x22109c,_0x114597){logger[_0xa0aa('0xb')](_0xa0aa('0xc'));var _0x72af4b=new Date();var _0x3315e3=[{'name':_0xa0aa('0xd'),'value':intUtil[_0xa0aa('0xe')](_0xb3ce6f[_0xa0aa('0xf')],_0x1d206c,'\x20')},{'name':_0xa0aa('0x10'),'value':_0x9924b9['id']},{'name':_0xa0aa('0x11'),'value':_0x9924b9['id']},{'name':'description','value':intUtil[_0xa0aa('0xe')](_0xb3ce6f['Descriptions'],_0x1d206c,'\x0a')},{'name':_0xa0aa('0x12'),'value':_0x72af4b[_0xa0aa('0x13')]()[_0xa0aa('0x14')](0x0,0x13)[_0xa0aa('0x15')]('T','\x20')},{'name':_0xa0aa('0x16'),'value':'0'},{'name':_0xa0aa('0x17'),'value':'15'},{'name':_0xa0aa('0x18'),'value':_0x59eed5['id']},{'name':_0xa0aa('0x19'),'value':_0xa0aa('0x1a')},{'name':_0xa0aa('0x1b'),'value':_0x59eed5[_0xa0aa('0xd')]},{'name':'direction','value':_0x114597}];if(_0x52ebd0[_0xa0aa('0x1c')]){_['forEach'](_0x52ebd0,function(_0x56904b){if(_0x1d206c[_0x56904b['variableName']]){_0x3315e3['push']({'name':_0x56904b[_0xa0aa('0x1d')],'value':_0x1d206c[_0x56904b['variableName']]});}});}return request({'form':{'method':_0xa0aa('0x1e'),'input_type':_0xa0aa('0x1f'),'response_type':_0xa0aa('0x1f'),'rest_data':JSON['stringify']({'session':_0x22109c['id'],'module_name':_0xa0aa('0x20'),'name_value_list':_0x3315e3})}});}function getAuth(_0x41f80c){return util[_0xa0aa('0x21')](_0xa0aa('0x22'),new Buffer(_0x41f80c['apiKey']+':X')['toString'](_0xa0aa('0x23')));}function getServerInfo(_0x32666c){return request({'form':{'method':'get_server_info','input_type':_0xa0aa('0x1f'),'response_type':_0xa0aa('0x1f'),'rest_data':JSON[_0xa0aa('0x24')]({'session':_0x32666c['id']})}});}function getUser(_0x39b4f1,_0x2878a9,_0x28d113){if(!_[_0xa0aa('0x25')](_0x2878a9)){logger['info']('Getting\x20agent\x20with\x20name',_0x2878a9);return request({'form':{'method':'get_entry_list','input_type':_0xa0aa('0x1f'),'response_type':_0xa0aa('0x1f'),'rest_data':JSON[_0xa0aa('0x24')]({'session':_0x28d113['id'],'module_name':_0xa0aa('0x26'),'query':util[_0xa0aa('0x21')](_0xa0aa('0x27'),_0x2878a9),'order_by':'','offset':'0','select_fields':['id',_0xa0aa('0xd'),_0xa0aa('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa0aa('0x29')](function(_0x3313f1){if(_0x3313f1['entry_list'][_0xa0aa('0x1c')]){var _0x5ee17d=_[_0xa0aa('0x2a')](_0x3313f1['entry_list'],function(_0x1179bd){return _0x1179bd[_0xa0aa('0x2b')][_0xa0aa('0x28')][_0xa0aa('0x2c')]===_0x2878a9;});if(_0x5ee17d){logger[_0xa0aa('0xb')](_0xa0aa('0x2d'));return BPromise[_0xa0aa('0x2e')]({'id':_0x5ee17d[_0xa0aa('0x2b')]['id'][_0xa0aa('0x2c')],'name':_0x5ee17d[_0xa0aa('0x2b')]['name'][_0xa0aa('0x2c')]});}}logger[_0xa0aa('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xa0aa('0x2e')]({'id':_0x28d113[_0xa0aa('0x2b')][_0xa0aa('0x2f')]['value'],'name':_0x28d113[_0xa0aa('0x2b')][_0xa0aa('0x28')][_0xa0aa('0x2c')]});});}else{logger[_0xa0aa('0xb')](_0xa0aa('0x30'));return BPromise['resolve']({'id':_0x28d113[_0xa0aa('0x2b')][_0xa0aa('0x2f')][_0xa0aa('0x2c')],'name':_0x28d113[_0xa0aa('0x2b')][_0xa0aa('0x28')][_0xa0aa('0x2c')]});}}function getEndUser(_0x40d5ea,_0x52d2fc,_0x1b8ac7,_0x143cf3){logger[_0xa0aa('0xb')](_0xa0aa('0x31'),_0x1b8ac7);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0xa0aa('0x1f'),'rest_data':JSON[_0xa0aa('0x24')]({'session':_0x143cf3['id'],'module_name':_0xa0aa('0x1a'),'query':util['format'](_0xa0aa('0x32'),_0x1b8ac7),'order_by':'','offset':'0','select_fields':['id',_0xa0aa('0xd'),_0xa0aa('0x33')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa0aa('0x29')](function(_0x4a0964){if(_0x4a0964['entry_list']['length']){var _0x4ca5b6=_[_0xa0aa('0x2a')](_0x4a0964['entry_list'],function(_0x6640c3){return _0x6640c3['name_value_list'][_0xa0aa('0x33')][_0xa0aa('0x2c')]===_0x1b8ac7;});if(_0x4ca5b6){logger[_0xa0aa('0xb')]('Enduser\x20found!');return BPromise[_0xa0aa('0x2e')]({'id':_0x4ca5b6[_0xa0aa('0x2b')]['id'][_0xa0aa('0x2c')],'name':_0x4ca5b6[_0xa0aa('0x2b')][_0xa0aa('0xd')]['value'],'phone':_0x4ca5b6[_0xa0aa('0x2b')][_0xa0aa('0x33')]['value']});}}else{logger[_0xa0aa('0xb')](_0xa0aa('0x34'));return request({'form':{'method':_0xa0aa('0x1e'),'input_type':'JSON','response_type':_0xa0aa('0x1f'),'rest_data':JSON['stringify']({'session':_0x143cf3['id'],'module_name':_0xa0aa('0x1a'),'name_value_list':[{'name':_0xa0aa('0x35'),'value':_0x52d2fc!==_0xa0aa('0x36')?_0x52d2fc:util['format'](_0xa0aa('0x37'),_0x1b8ac7)},{'name':_0xa0aa('0x33'),'value':_0x1b8ac7}]})}})[_0xa0aa('0x29')](function(_0x2f294c){logger[_0xa0aa('0xb')](_0xa0aa('0x38'));return BPromise[_0xa0aa('0x2e')]({'id':_0x2f294c['id'],'name':_0x2f294c[_0xa0aa('0x39')][_0xa0aa('0x35')][_0xa0aa('0x2c')],'phone':_0x2f294c[_0xa0aa('0x39')][_0xa0aa('0x33')][_0xa0aa('0x2c')]});});}});}function request(_0x3efca8){logger[_0xa0aa('0x3a')](_0xa0aa('0x3b'),JSON[_0xa0aa('0x24')](_0x3efca8));return rp(_[_0xa0aa('0x3c')](def,_0x3efca8));}function getTags(_0x468f29,_0x4eb582){var _0x42cabe=[];if(_0x468f29&&_0x468f29[_0xa0aa('0x1c')]>0x0){_0x42cabe=_['map'](_0x468f29,_0x4eb582);}return _0x42cabe;}function getCustomFields(_0x5d9b77,_0x16005f){var _0x165841=[];var _0x43c88e={'custom_fields':[]};if(_0x5d9b77[_0xa0aa('0x1c')]>0x0){_['forEach'](_0x5d9b77,function(_0x4a99af){if(_0x4a99af['type']===_0xa0aa('0x3d')&&_0x4a99af['nameField']&&!_0x4a99af[_0xa0aa('0x3e')]){_0x43c88e[_0x4a99af[_0xa0aa('0x3f')][_0xa0aa('0x40')]()]=_0x4a99af[_0xa0aa('0x41')][_0xa0aa('0x42')]();}else if(_0x4a99af[_0xa0aa('0x43')]===_0xa0aa('0x3d')&&_0x4a99af['idField']&&_0x4a99af['customField']){_0x43c88e[_0xa0aa('0x44')][_0xa0aa('0x45')]({'id':_0x4a99af[_0xa0aa('0x1d')],'value':_0x4a99af[_0xa0aa('0x41')][_0xa0aa('0x42')]()});}else if(_0x4a99af[_0xa0aa('0x43')]===_0xa0aa('0x46')&&_0x4a99af[_0xa0aa('0x47')]&&_0x4a99af['idField']&&_0x4a99af[_0xa0aa('0x3e')]){_0x16005f[_0x4a99af['variableName']]&&_0x43c88e[_0xa0aa('0x44')][_0xa0aa('0x45')]({'id':_0x4a99af[_0xa0aa('0x1d')],'value':_0x16005f[_0x4a99af['variableName']]['toString']()});}else if(_0x4a99af[_0xa0aa('0x43')]===_0xa0aa('0x48')&&_0x4a99af[_0xa0aa('0x49')]&&_0x4a99af[_0xa0aa('0x49')]['name']&&_0x4a99af[_0xa0aa('0x1d')]&&_0x4a99af['customField']){_0x16005f[_0x4a99af[_0xa0aa('0x49')][_0xa0aa('0xd')][_0xa0aa('0x40')]()]&&_0x43c88e[_0xa0aa('0x44')][_0xa0aa('0x45')]({'id':_0x4a99af[_0xa0aa('0x1d')],'value':_0x16005f[_0x4a99af[_0xa0aa('0x49')][_0xa0aa('0xd')]['toLowerCase']()][_0xa0aa('0x42')]()});}});}return _0x43c88e;}function getConnection(_0x4c2863){return request({'method':_0xa0aa('0x9'),'form':{'method':'login','input_type':_0xa0aa('0x1f'),'response_type':_0xa0aa('0x1f'),'rest_data':JSON[_0xa0aa('0x24')]({'user_auth':{'user_name':_0x4c2863[_0xa0aa('0x4a')],'password':_0x4c2863[_0xa0aa('0x4b')],'encryption':'PLAIN'},'application':_0xa0aa('0x4c')})}})[_0xa0aa('0x29')](function(_0x73d5cd){var _0x1dc44a=_0x73d5cd;if(_0x1dc44a['id']){def[_0xa0aa('0x4d')]=_0x1dc44a['id'];return BPromise[_0xa0aa('0x2e')](_0x1dc44a);}else{throw new Error(util[_0xa0aa('0x21')]('Account\x20%d\x20is\x20not\x20valid',_0x4c2863['id']));}});}function setRelationship(_0x909ce7,_0x53a6f6,_0x58f392,_0x1b5304){return request({'form':{'method':'set_relationship','input_type':_0xa0aa('0x1f'),'response_type':_0xa0aa('0x1f'),'rest_data':JSON['stringify']({'session':_0x909ce7['id'],'module_name':_0xa0aa('0x20'),'module_id':_0x58f392['id'],'link_field_name':_0x1b5304,'related_ids':[_0x53a6f6['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xa0aa('0x4e')]=function(_0x41708f,_0x582f05,_0x43f8fc,_0x4a864c,_0x12cf43,_0x1cd0ff){var _0x33a555,_0x1c7d0b,_0x92ddfd,_0x18f7ba;_0x1cd0ff[_0xa0aa('0x4f')]=intUtil['stripTrailingSlash'](_0x1cd0ff[_0xa0aa('0x4f')]);_0x1cd0ff['serverUrl']=intUtil[_0xa0aa('0x50')](_0x1cd0ff[_0xa0aa('0x51')]);def['uri']=util['format']('%s/service/v4_1/rest.php',_0x1cd0ff[_0xa0aa('0x4f')]);if(_0x12cf43&&_0x12cf43[_0xa0aa('0x52')]){logger[_0xa0aa('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x582f05[_0xa0aa('0x53')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1cd0ff[_0xa0aa('0x51')],_0x582f05[_0xa0aa('0x54')],md5(_0x582f05[_0xa0aa('0x54')]));}else{_0x582f05[_0xa0aa('0x53')]='';}return getConnection(_0x1cd0ff)['then'](function(_0x216a81){_0x18f7ba=_0x216a81;return getUser(_0x1cd0ff,_0x4a864c[_0xa0aa('0xd')],_0x18f7ba);})[_0xa0aa('0x29')](function(_0x17a8e9){_0x33a555=_0x17a8e9;logger[_0xa0aa('0xb')](_0xa0aa('0x55'),_0x33a555['id']);return getEndUser(_0x1cd0ff,_0x582f05[_0xa0aa('0x56')],_0x582f05[_0xa0aa('0x57')],_0x18f7ba);})[_0xa0aa('0x29')](function(_0x47b939){_0x1c7d0b=_0x47b939;logger['info'](_0xa0aa('0x58'),_0x1c7d0b['id']);return getTicket(_0x1cd0ff,_0x33a555,_0x1c7d0b,_0x43f8fc,_0x582f05,_0x43f8fc['Fields'],_0x18f7ba,_0xa0aa('0x59'));})[_0xa0aa('0x29')](function(_0x3063e8){_0x92ddfd=_0x3063e8;logger[_0xa0aa('0xb')](_0xa0aa('0x5a'));logger[_0xa0aa('0xb')](_0xa0aa('0x5b'),_0x92ddfd['id']);return setRelationship(_0x18f7ba,_0x33a555,_0x92ddfd,_0xa0aa('0x5c'));})[_0xa0aa('0x29')](function(){return setRelationship(_0x18f7ba,_0x1c7d0b,_0x92ddfd,_0xa0aa('0x5d'));})['then'](function(){return getServerInfo(_0x18f7ba);})[_0xa0aa('0x29')](function(_0x10b3a2){var _0x4e384c=parseInt(_0x10b3a2[_0xa0aa('0x5e')][_0xa0aa('0x5f')](0x0));var _0x336a15=util[_0xa0aa('0x21')](_0xa0aa('0x60'),_0x1cd0ff[_0xa0aa('0x4f')],_0x92ddfd['id']);if(_0x4e384c>0x6){_0x336a15=util['format'](_0xa0aa('0x61'),_0x1cd0ff[_0xa0aa('0x4f')],_0x92ddfd['id']);}logger[_0xa0aa('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa0aa('0x21')](_0xa0aa('0x62'),_0x4a864c['name']),_0xa0aa('0x63'),{'uri':_0x336a15});})[_0xa0aa('0x64')](function(_0x5880e4){logger[_0xa0aa('0x65')](_0xa0aa('0x66'),JSON['stringify'](_0x5880e4));});};exports[_0xa0aa('0x67')]=function(_0x3cec0a,_0x15611d,_0x2ea68d,_0x15e539,_0x42851e,_0x3f407d,_0xc8ca19){var _0x1fb8ff,_0x146f86,_0x5b79d6,_0x2a10b3;_0x3f407d[_0xa0aa('0x4f')]=intUtil[_0xa0aa('0x50')](_0x3f407d[_0xa0aa('0x4f')]);_0x3f407d[_0xa0aa('0x51')]=intUtil[_0xa0aa('0x50')](_0x3f407d[_0xa0aa('0x51')]);def[_0xa0aa('0x68')]=util[_0xa0aa('0x21')](_0xa0aa('0x69'),_0x3f407d[_0xa0aa('0x4f')]);if(_0xc8ca19&&_0xc8ca19[_0xa0aa('0x6a')]&&_0xc8ca19['recordingFormat']!=='none'){logger[_0xa0aa('0xb')](_0xa0aa('0x6b'),'Recording\x20is\x20enabled!');_0x15611d['recordingURL']=util['format'](_0xa0aa('0x6c'),_0x3f407d['serverUrl'],_0x15611d[_0xa0aa('0x54')],md5(_0x15611d[_0xa0aa('0x54')]));}return getConnection(_0x3f407d)[_0xa0aa('0x29')](function(_0x15e519){_0x2a10b3=_0x15e519;return getUser(_0x3f407d,_0x15e539[_0xa0aa('0xd')],_0x2a10b3);})[_0xa0aa('0x29')](function(_0x3b613b){_0x1fb8ff=_0x3b613b;logger[_0xa0aa('0xb')](_0xa0aa('0x55'),_0x1fb8ff['id']);return getEndUser(_0x3f407d,_0x15611d[_0xa0aa('0x6d')],_0x15611d[_0xa0aa('0x6e')],_0x2a10b3);})[_0xa0aa('0x29')](function(_0x537f16){_0x146f86=_0x537f16;logger['info'](_0xa0aa('0x58'),_0x146f86['id']);return getTicket(_0x3f407d,_0x1fb8ff,_0x146f86,_0x2ea68d,_0x15611d,_0x2ea68d[_0xa0aa('0x6f')],_0x2a10b3,_0xa0aa('0x70'));})['then'](function(_0x3a504c){_0x5b79d6=_0x3a504c;logger[_0xa0aa('0xb')](_0xa0aa('0x5a'));logger[_0xa0aa('0xb')](_0xa0aa('0x5b'),_0x5b79d6['id']);return setRelationship(_0x2a10b3,_0x1fb8ff,_0x5b79d6,_0xa0aa('0x5c'));})[_0xa0aa('0x29')](function(){return setRelationship(_0x2a10b3,_0x146f86,_0x5b79d6,_0xa0aa('0x5d'));})['then'](function(){return getServerInfo(_0x2a10b3);})[_0xa0aa('0x29')](function(_0x346c55){var _0x3cadd9=parseInt(_0x346c55['version'][_0xa0aa('0x5f')](0x0));var _0x50815d=util[_0xa0aa('0x21')](_0xa0aa('0x60'),_0x3f407d[_0xa0aa('0x4f')],_0x5b79d6['id']);if(_0x3cadd9>0x6){_0x50815d=util[_0xa0aa('0x21')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x3f407d[_0xa0aa('0x4f')],_0x5b79d6['id']);}logger[_0xa0aa('0xb')](_0xa0aa('0x6b'),_0xa0aa('0x71'));emit(util[_0xa0aa('0x21')](_0xa0aa('0x62'),_0x15e539['name']),'trigger:browser:url',{'uri':_0x50815d});})[_0xa0aa('0x64')](function(_0x404923){logger['error'](_0xa0aa('0x6b'),JSON[_0xa0aa('0x24')](_0x404923));});};exports['unmanaged']=function(_0x4da5a7,_0x5c3510,_0x1bc0d4,_0xaea3fa,_0x38aa14,_0xb860c7){var _0x534a1f,_0x2d3df0,_0x4069a3,_0x3522a1;_0xb860c7[_0xa0aa('0x4f')]=intUtil[_0xa0aa('0x50')](_0xb860c7[_0xa0aa('0x4f')]);_0xb860c7[_0xa0aa('0x51')]=intUtil[_0xa0aa('0x50')](_0xb860c7[_0xa0aa('0x51')]);def[_0xa0aa('0x68')]=util[_0xa0aa('0x21')](_0xa0aa('0x69'),_0xb860c7['remoteUri']);if(_0x38aa14&&_0x38aa14[_0xa0aa('0x52')]){logger['info']('['+_0x5c3510[_0xa0aa('0x72')][_0xa0aa('0x73')]()+']',_0xa0aa('0x74'));_0x5c3510['recordingURL']=util['format'](_0xa0aa('0x6c'),_0xb860c7['serverUrl'],_0x5c3510[_0xa0aa('0x54')],md5(_0x5c3510[_0xa0aa('0x54')]));}else{_0x5c3510[_0xa0aa('0x53')]='';}return getConnection(_0xb860c7)[_0xa0aa('0x29')](function(_0x5bebaf){_0x3522a1=_0x5bebaf;if(!_[_0xa0aa('0x25')](_0xaea3fa)){return getUser(_0xb860c7,_0xaea3fa['name'],_0x3522a1);}else{return getUser(_0xb860c7,null,_0x3522a1);}})['then'](function(_0x19105f){_0x534a1f=_0x19105f;logger[_0xa0aa('0xb')](_0xa0aa('0x55'),_0x534a1f['id']);return getEndUser(_0xb860c7,_0x5c3510[_0xa0aa('0x56')],_0x5c3510[_0xa0aa('0x57')],_0x3522a1);})[_0xa0aa('0x29')](function(_0x4f71e3){_0x2d3df0=_0x4f71e3;logger[_0xa0aa('0xb')](_0xa0aa('0x58'),_0x2d3df0['id']);return getTicket(_0xb860c7,_0x534a1f,_0x2d3df0,_0x1bc0d4,_0x5c3510,_0x1bc0d4[_0xa0aa('0x6f')],_0x3522a1,_0xa0aa('0x59'));})[_0xa0aa('0x29')](function(_0xe33eb5){_0x4069a3=_0xe33eb5;logger[_0xa0aa('0xb')]('Ticket\x20created!');logger[_0xa0aa('0xb')]('The\x20Ticket\x20ID\x20is:',_0x4069a3['id']);return setRelationship(_0x3522a1,_0x534a1f,_0x4069a3,_0xa0aa('0x5c'));})['then'](function(){return setRelationship(_0x3522a1,_0x2d3df0,_0x4069a3,_0xa0aa('0x5d'));})[_0xa0aa('0x29')](function(){return getServerInfo(_0x3522a1);})[_0xa0aa('0x64')](function(_0x40c1e0){logger[_0xa0aa('0x65')]('['+_0x5c3510[_0xa0aa('0x72')][_0xa0aa('0x73')]()+']',JSON['stringify'](_0x40c1e0));});}; \ No newline at end of file +var _0x24ac=['socket.io-emitter','POST','emit','info','name','getString','Subjects','assigned_user_id','created_by','Descriptions','toISOString','slice','replace','duration_minutes','parent_id','parent_type','Contacts','direction','variableName','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','length','find','entry_list','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','get_entry_list','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','type','string','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','uri','%s/service/v4_1/rest.php','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','users','charAt','catch','unmanaged','monitor_format','lastevent','toUpperCase','isNil','calleridname','bluebird','md5','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost'];(function(_0x760e06,_0x279300){var _0x5a73fd=function(_0x473ef0){while(--_0x473ef0){_0x760e06['push'](_0x760e06['shift']());}};_0x5a73fd(++_0x279300);}(_0x24ac,0x1d9));var _0xc24a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24ac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0xc24a('0x0'));var md5=require(_0xc24a('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xc24a('0x2'));var logger=require(_0xc24a('0x3'))(_0xc24a('0x4'));config[_0xc24a('0x5')]=_['defaults'](config[_0xc24a('0x5')],{'host':_0xc24a('0x6'),'port':0x18eb});var io=require(_0xc24a('0x7'))(new Redis(config[_0xc24a('0x5')]));var def={'method':_0xc24a('0x8'),'json':!![]};function emit(_0x221fc6,_0x346771,_0x330f8f){io['to'](_0x221fc6)[_0xc24a('0x9')](_0x346771,_0x330f8f);}function getTicket(_0x581f1c,_0x59fbd3,_0x57c3d1,_0x467832,_0x4b566e,_0x7d7d6c,_0x115de8,_0x4dc010){logger[_0xc24a('0xa')]('Creating\x20new\x20ticket...');var _0x169a32=new Date();var _0x89a114=[{'name':_0xc24a('0xb'),'value':intUtil[_0xc24a('0xc')](_0x467832[_0xc24a('0xd')],_0x4b566e,'\x20')},{'name':_0xc24a('0xe'),'value':_0x59fbd3['id']},{'name':_0xc24a('0xf'),'value':_0x59fbd3['id']},{'name':'description','value':intUtil[_0xc24a('0xc')](_0x467832[_0xc24a('0x10')],_0x4b566e,'\x0a')},{'name':'date_start','value':_0x169a32[_0xc24a('0x11')]()[_0xc24a('0x12')](0x0,0x13)[_0xc24a('0x13')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xc24a('0x14'),'value':'15'},{'name':_0xc24a('0x15'),'value':_0x57c3d1['id']},{'name':_0xc24a('0x16'),'value':_0xc24a('0x17')},{'name':'parent_name','value':_0x57c3d1[_0xc24a('0xb')]},{'name':_0xc24a('0x18'),'value':_0x4dc010}];if(_0x7d7d6c['length']){_['forEach'](_0x7d7d6c,function(_0x1b6bbd){if(_0x4b566e[_0x1b6bbd['variableName']]){_0x89a114['push']({'name':_0x1b6bbd['idField'],'value':_0x4b566e[_0x1b6bbd[_0xc24a('0x19')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xc24a('0x1a'),'response_type':_0xc24a('0x1a'),'rest_data':JSON[_0xc24a('0x1b')]({'session':_0x115de8['id'],'module_name':_0xc24a('0x1c'),'name_value_list':_0x89a114})}});}function getAuth(_0x396780){return util[_0xc24a('0x1d')](_0xc24a('0x1e'),new Buffer(_0x396780[_0xc24a('0x1f')]+':X')[_0xc24a('0x20')]('base64'));}function getServerInfo(_0x374770){return request({'form':{'method':_0xc24a('0x21'),'input_type':_0xc24a('0x1a'),'response_type':_0xc24a('0x1a'),'rest_data':JSON[_0xc24a('0x1b')]({'session':_0x374770['id']})}});}function getUser(_0x3d9089,_0x2d1223,_0x2f4a68){if(!_['isNil'](_0x2d1223)){logger['info'](_0xc24a('0x22'),_0x2d1223);return request({'form':{'method':'get_entry_list','input_type':_0xc24a('0x1a'),'response_type':_0xc24a('0x1a'),'rest_data':JSON[_0xc24a('0x1b')]({'session':_0x2f4a68['id'],'module_name':_0xc24a('0x23'),'query':util[_0xc24a('0x1d')](_0xc24a('0x24'),_0x2d1223),'order_by':'','offset':'0','select_fields':['id',_0xc24a('0xb'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc24a('0x25')](function(_0x4f42f6){if(_0x4f42f6['entry_list'][_0xc24a('0x26')]){var _0x5719f6=_[_0xc24a('0x27')](_0x4f42f6[_0xc24a('0x28')],function(_0x350134){return _0x350134[_0xc24a('0x29')][_0xc24a('0x2a')][_0xc24a('0x2b')]===_0x2d1223;});if(_0x5719f6){logger[_0xc24a('0xa')](_0xc24a('0x2c'));return BPromise[_0xc24a('0x2d')]({'id':_0x5719f6[_0xc24a('0x29')]['id']['value'],'name':_0x5719f6[_0xc24a('0x29')]['name'][_0xc24a('0x2b')]});}}logger[_0xc24a('0xa')](_0xc24a('0x2e'));return BPromise[_0xc24a('0x2d')]({'id':_0x2f4a68[_0xc24a('0x29')][_0xc24a('0x2f')][_0xc24a('0x2b')],'name':_0x2f4a68[_0xc24a('0x29')][_0xc24a('0x2a')][_0xc24a('0x2b')]});});}else{logger[_0xc24a('0xa')](_0xc24a('0x30'));return BPromise[_0xc24a('0x2d')]({'id':_0x2f4a68[_0xc24a('0x29')][_0xc24a('0x2f')]['value'],'name':_0x2f4a68[_0xc24a('0x29')]['user_name'][_0xc24a('0x2b')]});}}function getEndUser(_0x3e3504,_0x2068d5,_0x21d816,_0x52e0ac){logger[_0xc24a('0xa')]('Searching\x20enduser\x20with\x20phone',_0x21d816);return request({'form':{'method':_0xc24a('0x31'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x52e0ac['id'],'module_name':'Contacts','query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x21d816),'order_by':'','offset':'0','select_fields':['id',_0xc24a('0xb'),_0xc24a('0x32')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc24a('0x25')](function(_0x203b9a){if(_0x203b9a[_0xc24a('0x28')][_0xc24a('0x26')]){var _0x36c79b=_[_0xc24a('0x27')](_0x203b9a[_0xc24a('0x28')],function(_0x200331){return _0x200331[_0xc24a('0x29')][_0xc24a('0x32')][_0xc24a('0x2b')]===_0x21d816;});if(_0x36c79b){logger[_0xc24a('0xa')]('Enduser\x20found!');return BPromise[_0xc24a('0x2d')]({'id':_0x36c79b[_0xc24a('0x29')]['id'][_0xc24a('0x2b')],'name':_0x36c79b[_0xc24a('0x29')][_0xc24a('0xb')][_0xc24a('0x2b')],'phone':_0x36c79b['name_value_list'][_0xc24a('0x32')][_0xc24a('0x2b')]});}}else{logger[_0xc24a('0xa')](_0xc24a('0x33'));return request({'form':{'method':_0xc24a('0x34'),'input_type':_0xc24a('0x1a'),'response_type':_0xc24a('0x1a'),'rest_data':JSON[_0xc24a('0x1b')]({'session':_0x52e0ac['id'],'module_name':_0xc24a('0x17'),'name_value_list':[{'name':_0xc24a('0x35'),'value':_0x2068d5!==_0xc24a('0x36')?_0x2068d5:util[_0xc24a('0x1d')](_0xc24a('0x37'),_0x21d816)},{'name':_0xc24a('0x32'),'value':_0x21d816}]})}})[_0xc24a('0x25')](function(_0x17282c){logger[_0xc24a('0xa')](_0xc24a('0x38'));return BPromise['resolve']({'id':_0x17282c['id'],'name':_0x17282c[_0xc24a('0x28')][_0xc24a('0x35')][_0xc24a('0x2b')],'phone':_0x17282c[_0xc24a('0x28')]['phone_home'][_0xc24a('0x2b')]});});}});}function request(_0x485322){logger[_0xc24a('0x39')](_0xc24a('0x3a'),JSON[_0xc24a('0x1b')](_0x485322));return rp(_[_0xc24a('0x3b')](def,_0x485322));}function getTags(_0x3a14ff,_0x182b39){var _0x507b8f=[];if(_0x3a14ff&&_0x3a14ff[_0xc24a('0x26')]>0x0){_0x507b8f=_[_0xc24a('0x3c')](_0x3a14ff,_0x182b39);}return _0x507b8f;}function getCustomFields(_0x239084,_0xaebbc9){var _0x6c5f8a=[];var _0x599daf={'custom_fields':[]};if(_0x239084[_0xc24a('0x26')]>0x0){_[_0xc24a('0x3d')](_0x239084,function(_0x12344f){if(_0x12344f[_0xc24a('0x3e')]===_0xc24a('0x3f')&&_0x12344f[_0xc24a('0x40')]&&!_0x12344f[_0xc24a('0x41')]){_0x599daf[_0x12344f[_0xc24a('0x40')][_0xc24a('0x42')]()]=_0x12344f[_0xc24a('0x43')][_0xc24a('0x20')]();}else if(_0x12344f['type']===_0xc24a('0x3f')&&_0x12344f[_0xc24a('0x44')]&&_0x12344f['customField']){_0x599daf[_0xc24a('0x45')][_0xc24a('0x46')]({'id':_0x12344f['idField'],'value':_0x12344f['content'][_0xc24a('0x20')]()});}else if(_0x12344f[_0xc24a('0x3e')]===_0xc24a('0x47')&&_0x12344f['variableName']&&_0x12344f['idField']&&_0x12344f['customField']){_0xaebbc9[_0x12344f[_0xc24a('0x19')]]&&_0x599daf[_0xc24a('0x45')]['push']({'id':_0x12344f[_0xc24a('0x44')],'value':_0xaebbc9[_0x12344f[_0xc24a('0x19')]][_0xc24a('0x20')]()});}else if(_0x12344f[_0xc24a('0x3e')]==='customVariable'&&_0x12344f['Variable']&&_0x12344f[_0xc24a('0x48')][_0xc24a('0xb')]&&_0x12344f[_0xc24a('0x44')]&&_0x12344f['customField']){_0xaebbc9[_0x12344f[_0xc24a('0x48')][_0xc24a('0xb')][_0xc24a('0x42')]()]&&_0x599daf['custom_fields']['push']({'id':_0x12344f[_0xc24a('0x44')],'value':_0xaebbc9[_0x12344f[_0xc24a('0x48')][_0xc24a('0xb')][_0xc24a('0x42')]()][_0xc24a('0x20')]()});}});}return _0x599daf;}function getConnection(_0x556629){return request({'method':_0xc24a('0x8'),'form':{'method':_0xc24a('0x49'),'input_type':_0xc24a('0x1a'),'response_type':_0xc24a('0x1a'),'rest_data':JSON[_0xc24a('0x1b')]({'user_auth':{'user_name':_0x556629[_0xc24a('0x4a')],'password':_0x556629[_0xc24a('0x4b')],'encryption':_0xc24a('0x4c')},'application':_0xc24a('0x4d')})}})['then'](function(_0x3b6842){var _0x520cc7=_0x3b6842;if(_0x520cc7['id']){def[_0xc24a('0x4e')]=_0x520cc7['id'];return BPromise[_0xc24a('0x2d')](_0x520cc7);}else{throw new Error(util[_0xc24a('0x1d')](_0xc24a('0x4f'),_0x556629['id']));}});}function setRelationship(_0xae519b,_0x51d7bd,_0xca9675,_0x27a58a){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':_0xc24a('0x1a'),'rest_data':JSON[_0xc24a('0x1b')]({'session':_0xae519b['id'],'module_name':_0xc24a('0x1c'),'module_id':_0xca9675['id'],'link_field_name':_0x27a58a,'related_ids':[_0x51d7bd['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xc24a('0x50')]=function(_0x95be29,_0x4ede13,_0x55acdc,_0x4c4f0b,_0x447713,_0x5936cc){var _0x1e1ef9,_0x2c5488,_0x545c0f,_0x511fba;_0x5936cc[_0xc24a('0x51')]=intUtil[_0xc24a('0x52')](_0x5936cc[_0xc24a('0x51')]);_0x5936cc[_0xc24a('0x53')]=intUtil['stripTrailingSlash'](_0x5936cc[_0xc24a('0x53')]);def['uri']=util[_0xc24a('0x1d')]('%s/service/v4_1/rest.php',_0x5936cc[_0xc24a('0x51')]);if(_0x447713&&_0x447713['monitor_format']){logger[_0xc24a('0xa')](_0xc24a('0x54'),_0xc24a('0x55'));_0x4ede13[_0xc24a('0x56')]=util['format'](_0xc24a('0x57'),_0x5936cc['serverUrl'],_0x4ede13['uniqueid'],md5(_0x4ede13[_0xc24a('0x58')]));}else{_0x4ede13['recordingURL']='';}return getConnection(_0x5936cc)[_0xc24a('0x25')](function(_0x25d86d){_0x511fba=_0x25d86d;return getUser(_0x5936cc,_0x4c4f0b[_0xc24a('0xb')],_0x511fba);})[_0xc24a('0x25')](function(_0x2bb740){_0x1e1ef9=_0x2bb740;logger['info'](_0xc24a('0x59'),_0x1e1ef9['id']);return getEndUser(_0x5936cc,_0x4ede13['calleridname'],_0x4ede13[_0xc24a('0x5a')],_0x511fba);})['then'](function(_0x1d415d){_0x2c5488=_0x1d415d;logger[_0xc24a('0xa')](_0xc24a('0x5b'),_0x2c5488['id']);return getTicket(_0x5936cc,_0x1e1ef9,_0x2c5488,_0x55acdc,_0x4ede13,_0x55acdc[_0xc24a('0x5c')],_0x511fba,_0xc24a('0x5d'));})[_0xc24a('0x25')](function(_0x4ee7e5){_0x545c0f=_0x4ee7e5;logger[_0xc24a('0xa')]('Ticket\x20created!');logger[_0xc24a('0xa')]('The\x20Ticket\x20ID\x20is:',_0x545c0f['id']);return setRelationship(_0x511fba,_0x1e1ef9,_0x545c0f,'users');})[_0xc24a('0x25')](function(){return setRelationship(_0x511fba,_0x2c5488,_0x545c0f,_0xc24a('0x5e'));})[_0xc24a('0x25')](function(){return getServerInfo(_0x511fba);})[_0xc24a('0x25')](function(_0x4c86a1){var _0x4c3284=parseInt(_0x4c86a1[_0xc24a('0x5f')]['charAt'](0x0));var _0x488cc0=util['format'](_0xc24a('0x60'),_0x5936cc[_0xc24a('0x51')],_0x545c0f['id']);if(_0x4c3284>0x6){_0x488cc0=util['format'](_0xc24a('0x61'),_0x5936cc['remoteUri'],_0x545c0f['id']);}logger['info']('[QUEUE]',_0xc24a('0x62'));emit(util[_0xc24a('0x1d')](_0xc24a('0x63'),_0x4c4f0b['name']),_0xc24a('0x64'),{'uri':_0x488cc0});})['catch'](function(_0x55a899){logger[_0xc24a('0x65')](_0xc24a('0x54'),JSON['stringify'](_0x55a899));});};exports[_0xc24a('0x66')]=function(_0x293ee3,_0x230acc,_0x47d93a,_0x35f068,_0x516a59,_0x548350,_0x40db8e){var _0x41deb3,_0xd54a82,_0x3a9488,_0x1fad7f;_0x548350[_0xc24a('0x51')]=intUtil['stripTrailingSlash'](_0x548350[_0xc24a('0x51')]);_0x548350['serverUrl']=intUtil[_0xc24a('0x52')](_0x548350[_0xc24a('0x53')]);def[_0xc24a('0x67')]=util[_0xc24a('0x1d')](_0xc24a('0x68'),_0x548350[_0xc24a('0x51')]);if(_0x40db8e&&_0x40db8e[_0xc24a('0x69')]&&_0x40db8e[_0xc24a('0x69')]!=='none'){logger['info'](_0xc24a('0x6a'),'Recording\x20is\x20enabled!');_0x230acc['recordingURL']=util[_0xc24a('0x1d')](_0xc24a('0x57'),_0x548350[_0xc24a('0x53')],_0x230acc[_0xc24a('0x58')],md5(_0x230acc[_0xc24a('0x58')]));}return getConnection(_0x548350)[_0xc24a('0x25')](function(_0x4f51c8){_0x1fad7f=_0x4f51c8;return getUser(_0x548350,_0x35f068['name'],_0x1fad7f);})[_0xc24a('0x25')](function(_0x1bc1ed){_0x41deb3=_0x1bc1ed;logger[_0xc24a('0xa')](_0xc24a('0x59'),_0x41deb3['id']);return getEndUser(_0x548350,_0x230acc[_0xc24a('0x6b')],_0x230acc[_0xc24a('0x6c')],_0x1fad7f);})[_0xc24a('0x25')](function(_0x3e63f5){_0xd54a82=_0x3e63f5;logger[_0xc24a('0xa')](_0xc24a('0x5b'),_0xd54a82['id']);return getTicket(_0x548350,_0x41deb3,_0xd54a82,_0x47d93a,_0x230acc,_0x47d93a[_0xc24a('0x5c')],_0x1fad7f,_0xc24a('0x6d'));})[_0xc24a('0x25')](function(_0x29fc0c){_0x3a9488=_0x29fc0c;logger['info'](_0xc24a('0x6e'));logger[_0xc24a('0xa')]('The\x20Ticket\x20ID\x20is:',_0x3a9488['id']);return setRelationship(_0x1fad7f,_0x41deb3,_0x3a9488,_0xc24a('0x6f'));})[_0xc24a('0x25')](function(){return setRelationship(_0x1fad7f,_0xd54a82,_0x3a9488,_0xc24a('0x5e'));})[_0xc24a('0x25')](function(){return getServerInfo(_0x1fad7f);})['then'](function(_0x29c739){var _0x556fac=parseInt(_0x29c739['version'][_0xc24a('0x70')](0x0));var _0x2d7fe2=util[_0xc24a('0x1d')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x548350['remoteUri'],_0x3a9488['id']);if(_0x556fac>0x6){_0x2d7fe2=util[_0xc24a('0x1d')](_0xc24a('0x61'),_0x548350['remoteUri'],_0x3a9488['id']);}logger[_0xc24a('0xa')](_0xc24a('0x6a'),_0xc24a('0x62'));emit(util[_0xc24a('0x1d')](_0xc24a('0x63'),_0x35f068[_0xc24a('0xb')]),_0xc24a('0x64'),{'uri':_0x2d7fe2});})[_0xc24a('0x71')](function(_0xb0b9af){logger[_0xc24a('0x65')](_0xc24a('0x6a'),JSON['stringify'](_0xb0b9af));});};exports[_0xc24a('0x72')]=function(_0x31126e,_0x329bc8,_0x1e0852,_0x4cb3ad,_0xfe673c,_0x5affa6){var _0x1717bc,_0x42e34d,_0x107d5e,_0x1a1361;_0x5affa6['remoteUri']=intUtil[_0xc24a('0x52')](_0x5affa6[_0xc24a('0x51')]);_0x5affa6['serverUrl']=intUtil[_0xc24a('0x52')](_0x5affa6['serverUrl']);def['uri']=util[_0xc24a('0x1d')]('%s/service/v4_1/rest.php',_0x5affa6[_0xc24a('0x51')]);if(_0xfe673c&&_0xfe673c[_0xc24a('0x73')]){logger[_0xc24a('0xa')]('['+_0x329bc8[_0xc24a('0x74')][_0xc24a('0x75')]()+']',_0xc24a('0x55'));_0x329bc8[_0xc24a('0x56')]=util[_0xc24a('0x1d')](_0xc24a('0x57'),_0x5affa6[_0xc24a('0x53')],_0x329bc8['uniqueid'],md5(_0x329bc8[_0xc24a('0x58')]));}else{_0x329bc8[_0xc24a('0x56')]='';}return getConnection(_0x5affa6)[_0xc24a('0x25')](function(_0x1656db){_0x1a1361=_0x1656db;if(!_[_0xc24a('0x76')](_0x4cb3ad)){return getUser(_0x5affa6,_0x4cb3ad[_0xc24a('0xb')],_0x1a1361);}else{return getUser(_0x5affa6,null,_0x1a1361);}})[_0xc24a('0x25')](function(_0x248da0){_0x1717bc=_0x248da0;logger[_0xc24a('0xa')](_0xc24a('0x59'),_0x1717bc['id']);return getEndUser(_0x5affa6,_0x329bc8[_0xc24a('0x77')],_0x329bc8['calleridnum'],_0x1a1361);})[_0xc24a('0x25')](function(_0x4aef75){_0x42e34d=_0x4aef75;logger[_0xc24a('0xa')](_0xc24a('0x5b'),_0x42e34d['id']);return getTicket(_0x5affa6,_0x1717bc,_0x42e34d,_0x1e0852,_0x329bc8,_0x1e0852['Fields'],_0x1a1361,'Inbound');})[_0xc24a('0x25')](function(_0x3ea719){_0x107d5e=_0x3ea719;logger[_0xc24a('0xa')](_0xc24a('0x6e'));logger[_0xc24a('0xa')]('The\x20Ticket\x20ID\x20is:',_0x107d5e['id']);return setRelationship(_0x1a1361,_0x1717bc,_0x107d5e,_0xc24a('0x6f'));})['then'](function(){return setRelationship(_0x1a1361,_0x42e34d,_0x107d5e,'contacts');})[_0xc24a('0x25')](function(){return getServerInfo(_0x1a1361);})[_0xc24a('0x71')](function(_0x36846){logger['error']('['+_0x329bc8[_0xc24a('0x74')]['toUpperCase']()+']',JSON[_0xc24a('0x1b')](_0x36846));});}; \ 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 517570e..0090870 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 _0x168b=['toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','format','key','keyContent','%s:\x20%s','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','string','push','content','type','variable','variableName'];(function(_0x21c21c,_0x5b9ae7){var _0x5b1696=function(_0x300ac0){while(--_0x300ac0){_0x21c21c['push'](_0x21c21c['shift']());}};_0x5b1696(++_0x5b9ae7);}(_0x168b,0x1ee));var _0xb168=function(_0x1ccdf4,_0x3fb494){_0x1ccdf4=_0x1ccdf4-0x0;var _0x448045=_0x168b[_0x1ccdf4];return _0x448045;};'use strict';var _=require(_0xb168('0x0'));var util=require(_0xb168('0x1'));exports[_0xb168('0x2')]=function(_0x560930,_0x4ecee0,_0x317d36){var _0x5707cd=[];if(_0x560930[_0xb168('0x3')]>0x0){var _0x3d690f=_['sortBy'](_0x560930,['id']);for(var _0xb41edb=0x0;_0xb41edb<_0x3d690f['length'];_0xb41edb++){var _0x501b61=_0x3d690f[_0xb41edb];if(_0x501b61['type']===_0xb168('0x4')){_0x5707cd[_0xb168('0x5')](_0x501b61[_0xb168('0x6')]);}else if(_0x501b61[_0xb168('0x7')]===_0xb168('0x8')&&_0x501b61[_0xb168('0x9')]){_0x4ecee0[_0x501b61[_0xb168('0x9')]]&&_0x5707cd['push'](_0x4ecee0[_0x501b61[_0xb168('0x9')]][_0xb168('0xa')]());}else if(_0x501b61['type']===_0xb168('0xb')&&_0x501b61[_0xb168('0xc')]&&_0x501b61[_0xb168('0xc')][_0xb168('0xd')]){_0x4ecee0[_0x501b61[_0xb168('0xc')][_0xb168('0xd')][_0xb168('0xe')]()]&&_0x5707cd['push'](_0x4ecee0[_0x501b61[_0xb168('0xc')][_0xb168('0xd')]['toLowerCase']()]['toString']());}else if(_0x501b61['type']===_0xb168('0xf')){if(_0x501b61[_0xb168('0x10')]==='string'&&_0x501b61['key']){_0x5707cd[_0xb168('0x5')](util[_0xb168('0x11')]('%s:\x20%s',_0x501b61[_0xb168('0x12')],_0x501b61[_0xb168('0x13')]));}else if(_0x501b61[_0xb168('0x10')]===_0xb168('0x8')&&_0x501b61[_0xb168('0x9')]&&_0x501b61[_0xb168('0x12')]){_0x4ecee0[_0x501b61[_0xb168('0x9')]]&&_0x5707cd['push'](util[_0xb168('0x11')](_0xb168('0x14'),_0x501b61[_0xb168('0x12')],_0x4ecee0[_0x501b61[_0xb168('0x9')]]));}else if(_0x501b61[_0xb168('0x10')]===_0xb168('0xb')&&_0x501b61[_0xb168('0xc')]&&_0x501b61[_0xb168('0xc')]['name']&&_0x501b61[_0xb168('0x12')]){_0x4ecee0[_0x501b61[_0xb168('0xc')][_0xb168('0xd')][_0xb168('0xe')]()]&&_0x5707cd[_0xb168('0x5')](util[_0xb168('0x11')](_0xb168('0x14'),_0x501b61[_0xb168('0x12')],_0x4ecee0[_0x501b61['Variable']['name']['toLowerCase']()]));}}}}return _0x5707cd['join'](_0x317d36);};exports[_0xb168('0x15')]=function(_0x12da4b){var _0x4bb006=_0x12da4b[_0xb168('0x16')](-0x1);if(_0x4bb006==='/'){_0x12da4b=_0x12da4b[_0xb168('0x17')](0x0,_0x12da4b[_0xb168('0x18')](_0x4bb006));}return _0x12da4b;};exports[_0xb168('0x19')]=function(_0x1f2e99){if(!_[_0xb168('0x1a')](_0x1f2e99)&&_0x1f2e99!==''){var _0xca3fd8=/^(([^<>()\[\]\\.,;:\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 _0xca3fd8[_0xb168('0x1b')](String(_0x1f2e99)[_0xb168('0xe')]());}else{return![];}}; \ No newline at end of file +var _0xb316=['variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','string','push','content','variable'];(function(_0x2c2857,_0x36e298){var _0x38d065=function(_0xba059f){while(--_0xba059f){_0x2c2857['push'](_0x2c2857['shift']());}};_0x38d065(++_0x36e298);}(_0xb316,0x1e4));var _0x6b31=function(_0x1a3ceb,_0x3acf0d){_0x1a3ceb=_0x1a3ceb-0x0;var _0x58e57e=_0xb316[_0x1a3ceb];return _0x58e57e;};'use strict';var _=require(_0x6b31('0x0'));var util=require(_0x6b31('0x1'));exports[_0x6b31('0x2')]=function(_0x24f6ad,_0x2407de,_0x39ab91){var _0x275f04=[];if(_0x24f6ad[_0x6b31('0x3')]>0x0){var _0xc167d9=_[_0x6b31('0x4')](_0x24f6ad,['id']);for(var _0x1adc36=0x0;_0x1adc36<_0xc167d9[_0x6b31('0x3')];_0x1adc36++){var _0x26a203=_0xc167d9[_0x1adc36];if(_0x26a203[_0x6b31('0x5')]===_0x6b31('0x6')){_0x275f04[_0x6b31('0x7')](_0x26a203[_0x6b31('0x8')]);}else if(_0x26a203[_0x6b31('0x5')]===_0x6b31('0x9')&&_0x26a203[_0x6b31('0xa')]){_0x2407de[_0x26a203[_0x6b31('0xa')]]&&_0x275f04[_0x6b31('0x7')](_0x2407de[_0x26a203[_0x6b31('0xa')]][_0x6b31('0xb')]());}else if(_0x26a203[_0x6b31('0x5')]===_0x6b31('0xc')&&_0x26a203[_0x6b31('0xd')]&&_0x26a203[_0x6b31('0xd')][_0x6b31('0xe')]){_0x2407de[_0x26a203[_0x6b31('0xd')]['name'][_0x6b31('0xf')]()]&&_0x275f04[_0x6b31('0x7')](_0x2407de[_0x26a203['Variable'][_0x6b31('0xe')][_0x6b31('0xf')]()][_0x6b31('0xb')]());}else if(_0x26a203['type']===_0x6b31('0x10')){if(_0x26a203[_0x6b31('0x11')]===_0x6b31('0x6')&&_0x26a203[_0x6b31('0x12')]){_0x275f04[_0x6b31('0x7')](util[_0x6b31('0x13')](_0x6b31('0x14'),_0x26a203[_0x6b31('0x12')],_0x26a203[_0x6b31('0x15')]));}else if(_0x26a203[_0x6b31('0x11')]==='variable'&&_0x26a203[_0x6b31('0xa')]&&_0x26a203[_0x6b31('0x12')]){_0x2407de[_0x26a203[_0x6b31('0xa')]]&&_0x275f04['push'](util[_0x6b31('0x13')](_0x6b31('0x14'),_0x26a203['key'],_0x2407de[_0x26a203[_0x6b31('0xa')]]));}else if(_0x26a203[_0x6b31('0x11')]==='customVariable'&&_0x26a203[_0x6b31('0xd')]&&_0x26a203[_0x6b31('0xd')][_0x6b31('0xe')]&&_0x26a203[_0x6b31('0x12')]){_0x2407de[_0x26a203[_0x6b31('0xd')][_0x6b31('0xe')]['toLowerCase']()]&&_0x275f04[_0x6b31('0x7')](util['format'](_0x6b31('0x14'),_0x26a203[_0x6b31('0x12')],_0x2407de[_0x26a203[_0x6b31('0xd')]['name'][_0x6b31('0xf')]()]));}}}}return _0x275f04[_0x6b31('0x16')](_0x39ab91);};exports['stripTrailingSlash']=function(_0x205748){var _0x4ae42b=_0x205748['slice'](-0x1);if(_0x4ae42b==='/'){_0x205748=_0x205748['substring'](0x0,_0x205748['lastIndexOf'](_0x4ae42b));}return _0x205748;};exports[_0x6b31('0x17')]=function(_0x23b322){if(!_[_0x6b31('0x18')](_0x23b322)&&_0x23b322!==''){var _0x283567=/^(([^<>()\[\]\\.,;:\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 _0x283567[_0x6b31('0x19')](String(_0x23b322)[_0x6b31('0xf')]());}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 0d3f590..59a0b11 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x2a26a8,_0xd6b224){var _0x25b98b=function(_0x3b1905){while(--_0x3b1905){_0x2a26a8['push'](_0x2a26a8['shift']());}};_0x25b98b(++_0xd6b224);}(_0xe706,0xa3));var _0x6e70=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xe706[_0x34021d];return _0x16597b;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x5f04d0,_0x2d5fb6){var _0x59d756=function(_0x24cacb){while(--_0x24cacb){_0x5f04d0['push'](_0x5f04d0['shift']());}};_0x59d756(++_0x2d5fb6);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 7275989..f3e7ffd 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 _0x8a4c=['picklist','type','nameField','content','idField','push','variable','variableName','customField','customVariable','Variable','name','toLowerCase','custom_fields','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\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','trigger:browser:url','%s/agent/tickets/%s','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','Subjects','getString','Descriptions','Fields','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','then','count','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user','%s/users/me.json','Admin\x20account\x20selected.','type:user\x20role:end-user\x20phone:%s','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','map','forEach','includes','string'];(function(_0x2bb784,_0x4088cb){var _0x1c3321=function(_0x8b8136){while(--_0x8b8136){_0x2bb784['push'](_0x2bb784['shift']());}};_0x1c3321(++_0x4088cb);}(_0x8a4c,0x10d));var _0xc8a4=function(_0x28c939,_0x110e29){_0x28c939=_0x28c939-0x0;var _0x527fe9=_0x8a4c[_0x28c939];return _0x527fe9;};'use strict';var _=require(_0xc8a4('0x0'));var rp=require(_0xc8a4('0x1'));var md5=require(_0xc8a4('0x2'));var util=require('util');var Redis=require(_0xc8a4('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xc8a4('0x4'))(_0xc8a4('0x5'));config[_0xc8a4('0x6')]=_[_0xc8a4('0x7')](config[_0xc8a4('0x6')],{'host':_0xc8a4('0x8'),'port':0x18eb});var io=require(_0xc8a4('0x9'))(new Redis(config[_0xc8a4('0x6')]));function emit(_0x1f48f2,_0x40fe89,_0x539360){io['to'](_0x1f48f2)['emit'](_0x40fe89,_0x539360);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x4d2eea,_0x98faa6,_0x3bb83e,_0x2b624c,_0x40fde3){logger[_0xc8a4('0xa')](_0xc8a4('0xb'));return request({'uri':util[_0xc8a4('0xc')](_0xc8a4('0xd'),_0x4d2eea[_0xc8a4('0xe')]),'method':_0xc8a4('0xf'),'body':{'ticket':_[_0xc8a4('0x10')]({'requester_id':_0x3bb83e['id'],'submitter_id':_0x98faa6?_0x98faa6['id']:undefined,'assignee_id':_0x98faa6?_0x98faa6['id']:undefined,'tags':getTags(_0x2b624c[_0xc8a4('0x11')],'name'),'subject':intUtil['getString'](_0x2b624c[_0xc8a4('0x12')],_0x40fde3,'\x20'),'description':intUtil[_0xc8a4('0x13')](_0x2b624c['Descriptions'],_0x40fde3,'\x0a'),'comment':{'public':![],'body':intUtil[_0xc8a4('0x13')](_0x2b624c[_0xc8a4('0x14')],_0x40fde3,'\x0a')}},getCustomFields(_0x2b624c[_0xc8a4('0x15')],_0x40fde3))}})['then'](function(_0x694cc4){logger[_0xc8a4('0xa')](_0xc8a4('0x16'));return _0x694cc4[_0xc8a4('0x17')];});}function getUser(_0x199f36,_0x56c9bb){if(intUtil['validateEmail'](_0x56c9bb)){logger['info'](_0xc8a4('0x18'),_0x56c9bb);return request({'uri':util[_0xc8a4('0xc')](_0xc8a4('0x19'),_0x199f36['remoteUri']),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x56c9bb)}})[_0xc8a4('0x1a')](function(_0x319bad){if(_0x319bad[_0xc8a4('0x1b')]){logger['info']('Agent\x20found!');return _[_0xc8a4('0x1c')](_0x319bad[_0xc8a4('0x1d')],{'email':_0x56c9bb,'role':'agent'});}else{logger[_0xc8a4('0xa')](_0xc8a4('0x1e'));return request({'uri':util[_0xc8a4('0xc')]('%s/users/me.json',_0x199f36['remoteUri'])})[_0xc8a4('0x1a')](function(_0x4912c9){logger[_0xc8a4('0xa')]('Admin\x20account\x20selected.');return _0x4912c9[_0xc8a4('0x1f')];});}});}else{logger[_0xc8a4('0xa')](_0xc8a4('0x1e'));return request({'uri':util[_0xc8a4('0xc')](_0xc8a4('0x20'),_0x199f36['remoteUri'])})['then'](function(_0x5e793f){logger[_0xc8a4('0xa')](_0xc8a4('0x21'));return _0x5e793f[_0xc8a4('0x1f')];});}}function getEndUser(_0x2d40b2,_0x1b698d,_0x199ec8){logger[_0xc8a4('0xa')]('Searching\x20enduser\x20with\x20phone',_0x199ec8);return request({'uri':util[_0xc8a4('0xc')](_0xc8a4('0x19'),_0x2d40b2[_0xc8a4('0xe')]),'qs':{'query':util[_0xc8a4('0xc')](_0xc8a4('0x22'),_0x199ec8)}})[_0xc8a4('0x1a')](function(_0x26919f){var _0x4eb52d;if(_0x26919f[_0xc8a4('0x1d')][_0xc8a4('0x23')]){_0x26919f['results']=_['filter'](_0x26919f[_0xc8a4('0x1d')],{'suspended':![],'role':'end-user'});if(_0x26919f[_0xc8a4('0x1d')]['length']){_0x4eb52d=_[_0xc8a4('0x24')](_0x26919f[_0xc8a4('0x1d')]);}}if(_0x4eb52d){logger[_0xc8a4('0xa')](_0xc8a4('0x25'));return _0x4eb52d;}else{logger[_0xc8a4('0xa')](_0xc8a4('0x26'));return request({'uri':util[_0xc8a4('0xc')](_0xc8a4('0x27'),_0x2d40b2[_0xc8a4('0xe')]),'method':_0xc8a4('0xf'),'body':{'user':{'role':_0xc8a4('0x28'),'name':util[_0xc8a4('0xc')]('Caller\x20-\x20%s',_0x1b698d||_0x199ec8),'phone':_0x199ec8}}})[_0xc8a4('0x1a')](function(_0x4c2558){logger[_0xc8a4('0xa')](_0xc8a4('0x29'));return _0x4c2558[_0xc8a4('0x1f')];});}});}function getAuth(_0x34590e){var _0x1e01be;if(_0x34590e[_0xc8a4('0x2a')]===_0xc8a4('0x2b')){_0x1e01be=util['format'](_0xc8a4('0x2c'),_0x34590e[_0xc8a4('0x2d')],_0x34590e[_0xc8a4('0x2b')]);}else if(_0x34590e[_0xc8a4('0x2a')]===_0xc8a4('0x2e')){_0x1e01be=util[_0xc8a4('0xc')](_0xc8a4('0x2f'),_0x34590e['username'],_0x34590e[_0xc8a4('0x2e')]);}return util[_0xc8a4('0xc')](_0xc8a4('0x30'),new Buffer(_0x1e01be)[_0xc8a4('0x31')](_0xc8a4('0x32')));}function request(_0xb86721){logger[_0xc8a4('0x33')](_0xc8a4('0x34'),JSON[_0xc8a4('0x35')](_0xb86721));return rp(_[_0xc8a4('0x7')](_0xb86721,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x41d8f3,_0x323f25){var _0x577391=[];if(_0x41d8f3&&_0x41d8f3[_0xc8a4('0x23')]>0x0){_0x577391=_[_0xc8a4('0x36')](_0x41d8f3,_0x323f25);}return _0x577391;}function getCustomFields(_0x1d5e1b,_0x3b2276){var _0x14313b=[];var _0x337556={'custom_fields':[]};if(_0x1d5e1b['length']>0x0){_[_0xc8a4('0x37')](_0x1d5e1b,function(_0x476def){if(_[_0xc8a4('0x38')]([_0xc8a4('0x39'),_0xc8a4('0x3a')],_0x476def[_0xc8a4('0x3b')])&&_0x476def[_0xc8a4('0x3c')]&&!_0x476def['customField']){_0x337556[_0x476def[_0xc8a4('0x3c')]['toLowerCase']()]=_0x476def[_0xc8a4('0x3d')][_0xc8a4('0x31')]();}else if(_[_0xc8a4('0x38')]([_0xc8a4('0x39'),_0xc8a4('0x3a')],_0x476def['type'])&&_0x476def[_0xc8a4('0x3e')]&&_0x476def['customField']){_0x337556['custom_fields'][_0xc8a4('0x3f')]({'id':_0x476def[_0xc8a4('0x3e')],'value':_0x476def[_0xc8a4('0x3d')][_0xc8a4('0x31')]()});}else if(_0x476def['type']===_0xc8a4('0x40')&&_0x476def[_0xc8a4('0x41')]&&_0x476def[_0xc8a4('0x3e')]&&_0x476def[_0xc8a4('0x42')]){_0x3b2276[_0x476def['variableName']]&&_0x337556['custom_fields'][_0xc8a4('0x3f')]({'id':_0x476def[_0xc8a4('0x3e')],'value':_0x3b2276[_0x476def[_0xc8a4('0x41')]][_0xc8a4('0x31')]()});}else if(_0x476def[_0xc8a4('0x3b')]===_0xc8a4('0x43')&&_0x476def['Variable']&&_0x476def[_0xc8a4('0x44')][_0xc8a4('0x45')]&&_0x476def[_0xc8a4('0x3e')]&&_0x476def['customField']){_0x3b2276[_0x476def['Variable'][_0xc8a4('0x45')][_0xc8a4('0x46')]()]&&_0x337556[_0xc8a4('0x47')][_0xc8a4('0x3f')]({'id':_0x476def[_0xc8a4('0x3e')],'value':_0x3b2276[_0x476def['Variable']['name'][_0xc8a4('0x46')]()][_0xc8a4('0x31')]()});}});}return _0x337556;}exports['queue']=function(_0x420150,_0x591da1,_0x3a7612,_0x4c927b,_0x525fb5,_0x3627ea){var _0x86e983,_0x5e69bb;_0x3627ea[_0xc8a4('0xe')]=intUtil[_0xc8a4('0x48')](_0x3627ea[_0xc8a4('0xe')]);_0x3627ea[_0xc8a4('0x49')]=intUtil[_0xc8a4('0x48')](_0x3627ea[_0xc8a4('0x49')]);if(_0x525fb5&&_0x525fb5[_0xc8a4('0x4a')]){logger['info'](_0xc8a4('0x4b'),'Recording\x20is\x20enabled!');_0x591da1[_0xc8a4('0x4c')]=util[_0xc8a4('0xc')](_0xc8a4('0x4d'),_0x3627ea[_0xc8a4('0x49')],_0x591da1[_0xc8a4('0x4e')],md5(_0x591da1[_0xc8a4('0x4e')]));}else{_0x591da1[_0xc8a4('0x4c')]='';}headers[_0xc8a4('0x4f')]=getAuth(_0x3627ea);return getUser(_0x3627ea,_0x4c927b[_0xc8a4('0x50')])[_0xc8a4('0x1a')](function(_0x51f5df){_0x86e983=_0x51f5df;logger[_0xc8a4('0xa')](_0xc8a4('0x51'),_0x86e983['id']);return getEndUser(_0x3627ea,_0x591da1[_0xc8a4('0x52')],_0x591da1[_0xc8a4('0x53')]);})[_0xc8a4('0x1a')](function(_0x5881ee){_0x5e69bb=_0x5881ee;logger[_0xc8a4('0xa')]('The\x20Enduser\x20ID\x20is:',_0x5e69bb['id']);return getTicket(_0x3627ea,_0x86e983,_0x5e69bb,_0x3a7612,_0x591da1);})['then'](function(_0x14392b){if(_0x14392b){logger[_0xc8a4('0xa')](_0xc8a4('0x54'),_0x14392b['id']);switch(_0x3627ea[_0xc8a4('0x3b')]){case'integrationTab':logger[_0xc8a4('0xa')](_0xc8a4('0x4b'),_0xc8a4('0x55'));return request({'uri':util[_0xc8a4('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x3627ea['remoteUri'],_0x86e983['id'],_0x14392b['id']),'method':_0xc8a4('0xf')});case _0xc8a4('0x56'):logger[_0xc8a4('0xa')](_0xc8a4('0x4b'),_0xc8a4('0x57'));emit(util[_0xc8a4('0xc')](_0xc8a4('0x58'),_0x4c927b[_0xc8a4('0x45')]),'trigger:browser:url',{'uri':util[_0xc8a4('0xc')]('%s/agent/tickets/%s',_0x3627ea[_0xc8a4('0xe')]['replace'](_0xc8a4('0x59'),''),_0x14392b['id'])});break;default:logger[_0xc8a4('0x5a')](_0xc8a4('0x4b'),_0xc8a4('0x5b'));}}})['catch'](function(_0x3d29c6){logger[_0xc8a4('0x5a')](_0xc8a4('0x5c'),util[_0xc8a4('0x5d')](_0x3d29c6,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x3a85a6,_0x110259,_0x58f9a0,_0x156520,_0x10be3d,_0x14929e,_0x586391){var _0x174369,_0xe81f54;_0x14929e[_0xc8a4('0xe')]=intUtil['stripTrailingSlash'](_0x14929e[_0xc8a4('0xe')]);_0x14929e['serverUrl']=intUtil[_0xc8a4('0x48')](_0x14929e[_0xc8a4('0x49')]);if(_0x586391&&_0x586391[_0xc8a4('0x5e')]&&_0x586391[_0xc8a4('0x5e')]!==_0xc8a4('0x5f')){logger[_0xc8a4('0xa')](_0xc8a4('0x60'),'Recording\x20is\x20enabled!');_0x110259[_0xc8a4('0x4c')]=util[_0xc8a4('0xc')](_0xc8a4('0x4d'),_0x14929e[_0xc8a4('0x49')],_0x110259[_0xc8a4('0x4e')],md5(_0x110259[_0xc8a4('0x4e')]));}headers[_0xc8a4('0x4f')]=getAuth(_0x14929e);return getUser(_0x14929e,_0x156520[_0xc8a4('0x50')])[_0xc8a4('0x1a')](function(_0x5328dd){_0x174369=_0x5328dd;logger[_0xc8a4('0xa')](_0xc8a4('0x51'),_0x174369['id']);return getEndUser(_0x14929e,_0x110259['destcalleridname'],_0x110259['destcalleridnum']);})['then'](function(_0x39c3b9){_0xe81f54=_0x39c3b9;logger[_0xc8a4('0xa')](_0xc8a4('0x61'),_0xe81f54['id']);return getTicket(_0x14929e,_0x174369,_0xe81f54,_0x58f9a0,_0x110259);})['then'](function(_0x3866af){if(_0x3866af){logger[_0xc8a4('0xa')](_0xc8a4('0x54'),_0x3866af['id']);switch(_0x14929e[_0xc8a4('0x3b')]){case _0xc8a4('0x62'):logger[_0xc8a4('0xa')](_0xc8a4('0x60'),_0xc8a4('0x55'));return request({'uri':util[_0xc8a4('0xc')](_0xc8a4('0x63'),_0x14929e[_0xc8a4('0xe')],_0x174369['id'],_0x3866af['id']),'method':_0xc8a4('0xf')});case _0xc8a4('0x56'):logger[_0xc8a4('0xa')](_0xc8a4('0x60'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xc8a4('0x58'),_0x156520[_0xc8a4('0x45')]),_0xc8a4('0x64'),{'uri':util['format'](_0xc8a4('0x65'),_0x14929e[_0xc8a4('0xe')]['replace']('/api/v2',''),_0x3866af['id'])});break;default:logger[_0xc8a4('0x5a')]('[OUTBOUND]',_0xc8a4('0x5b'));}}})[_0xc8a4('0x66')](function(_0x100bee){logger[_0xc8a4('0x5a')](_0xc8a4('0x67'),util[_0xc8a4('0x5d')](_0x100bee,{'showHidden':!![],'depth':null}));});};exports[_0xc8a4('0x68')]=function(_0x2520df,_0x4b10dd,_0x5c7b0b,_0x59e12c,_0x265180,_0x4e9a27){var _0x24df67,_0x3d30c5;_0x4e9a27[_0xc8a4('0xe')]=intUtil[_0xc8a4('0x48')](_0x4e9a27[_0xc8a4('0xe')]);_0x4e9a27[_0xc8a4('0x49')]=intUtil[_0xc8a4('0x48')](_0x4e9a27[_0xc8a4('0x49')]);if(_0x265180&&_0x265180['monitor_format']){logger['info']('['+_0x4b10dd[_0xc8a4('0x69')][_0xc8a4('0x6a')]()+']',_0xc8a4('0x6b'));_0x4b10dd[_0xc8a4('0x4c')]=util[_0xc8a4('0xc')](_0xc8a4('0x4d'),_0x4e9a27[_0xc8a4('0x49')],_0x4b10dd['uniqueid'],md5(_0x4b10dd[_0xc8a4('0x4e')]));}else{_0x4b10dd[_0xc8a4('0x4c')]='';}headers[_0xc8a4('0x4f')]=getAuth(_0x4e9a27);return getUser(_0x4e9a27)[_0xc8a4('0x1a')](function(_0x3ac3a6){_0x24df67=_0x3ac3a6;logger[_0xc8a4('0xa')](_0xc8a4('0x51'),_0x24df67['id']);return getEndUser(_0x4e9a27,_0x4b10dd['calleridname'],_0x4b10dd['calleridnum']);})[_0xc8a4('0x1a')](function(_0x2c8f30){_0x3d30c5=_0x2c8f30;logger[_0xc8a4('0xa')](_0xc8a4('0x61'),_0x3d30c5['id']);return getTicket(_0x4e9a27,_0x24df67,_0x3d30c5,_0x5c7b0b,_0x4b10dd);})['then'](function(_0x145095){if(_0x145095){logger[_0xc8a4('0xa')](_0xc8a4('0x54'),_0x145095['id']);}})[_0xc8a4('0x66')](function(_0x2d6594){logger['error']('['+_0x4b10dd[_0xc8a4('0x69')][_0xc8a4('0x6a')]()+']'+_0xc8a4('0x6c'),util[_0xc8a4('0x5d')](_0x2d6594,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x5427=['../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','Tags','name','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','toString','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','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:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','[QUEUE]','user:%s','trigger:browser:url','replace','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','./util'];(function(_0x14fd3e,_0x1949ae){var _0x3958d5=function(_0x280aaf){while(--_0x280aaf){_0x14fd3e['push'](_0x14fd3e['shift']());}};_0x3958d5(++_0x1949ae);}(_0x5427,0x6b));var _0x7542=function(_0x5c3b24,_0x1c030d){_0x5c3b24=_0x5c3b24-0x0;var _0x40e59c=_0x5427[_0x5c3b24];return _0x40e59c;};'use strict';var _=require(_0x7542('0x0'));var rp=require(_0x7542('0x1'));var md5=require(_0x7542('0x2'));var util=require(_0x7542('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7542('0x4'));var config=require(_0x7542('0x5'));var logger=require(_0x7542('0x6'))(_0x7542('0x7'));config[_0x7542('0x8')]=_[_0x7542('0x9')](config[_0x7542('0x8')],{'host':_0x7542('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x4a45da,_0x8c3ce4,_0x362bdf){io['to'](_0x4a45da)[_0x7542('0xb')](_0x8c3ce4,_0x362bdf);}var headers={'Content-Type':_0x7542('0xc'),'Accept':_0x7542('0xc')};function getTicket(_0x3a5847,_0x179110,_0x40efa2,_0x58c84c,_0x3cfa6f){logger[_0x7542('0xd')](_0x7542('0xe'));return request({'uri':util[_0x7542('0xf')]('%s/tickets.json',_0x3a5847[_0x7542('0x10')]),'method':_0x7542('0x11'),'body':{'ticket':_[_0x7542('0x12')]({'requester_id':_0x40efa2['id'],'submitter_id':_0x179110?_0x179110['id']:undefined,'assignee_id':_0x179110?_0x179110['id']:undefined,'tags':getTags(_0x58c84c[_0x7542('0x13')],_0x7542('0x14')),'subject':intUtil[_0x7542('0x15')](_0x58c84c['Subjects'],_0x3cfa6f,'\x20'),'description':intUtil[_0x7542('0x15')](_0x58c84c[_0x7542('0x16')],_0x3cfa6f,'\x0a'),'comment':{'public':![],'body':intUtil[_0x7542('0x15')](_0x58c84c[_0x7542('0x16')],_0x3cfa6f,'\x0a')}},getCustomFields(_0x58c84c[_0x7542('0x17')],_0x3cfa6f))}})[_0x7542('0x18')](function(_0x4024be){logger['info'](_0x7542('0x19'));return _0x4024be[_0x7542('0x1a')];});}function getUser(_0x2af535,_0x4297d9){if(intUtil[_0x7542('0x1b')](_0x4297d9)){logger[_0x7542('0xd')](_0x7542('0x1c'),_0x4297d9);return request({'uri':util[_0x7542('0xf')]('%s/search.json',_0x2af535[_0x7542('0x10')]),'qs':{'query':util[_0x7542('0xf')](_0x7542('0x1d'),_0x4297d9)}})[_0x7542('0x18')](function(_0x359f19){if(_0x359f19['count']){logger['info'](_0x7542('0x1e'));return _[_0x7542('0x1f')](_0x359f19[_0x7542('0x20')],{'email':_0x4297d9,'role':_0x7542('0x21')});}else{logger[_0x7542('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x7542('0xf')]('%s/users/me.json',_0x2af535[_0x7542('0x10')])})[_0x7542('0x18')](function(_0x27b105){logger[_0x7542('0xd')](_0x7542('0x22'));return _0x27b105[_0x7542('0x23')];});}});}else{logger[_0x7542('0xd')](_0x7542('0x24'));return request({'uri':util['format']('%s/users/me.json',_0x2af535[_0x7542('0x10')])})['then'](function(_0x2b8c84){logger[_0x7542('0xd')](_0x7542('0x22'));return _0x2b8c84[_0x7542('0x23')];});}}function getEndUser(_0x2a7848,_0xa96703,_0x5a4ca0){logger[_0x7542('0xd')](_0x7542('0x25'),_0x5a4ca0);return request({'uri':util[_0x7542('0xf')](_0x7542('0x26'),_0x2a7848['remoteUri']),'qs':{'query':util['format'](_0x7542('0x27'),_0x5a4ca0)}})['then'](function(_0xe9a0a8){var _0xce822e;if(_0xe9a0a8['results'][_0x7542('0x28')]){_0xe9a0a8['results']=_[_0x7542('0x29')](_0xe9a0a8[_0x7542('0x20')],{'suspended':![],'role':_0x7542('0x2a')});if(_0xe9a0a8[_0x7542('0x20')][_0x7542('0x28')]){_0xce822e=_['first'](_0xe9a0a8[_0x7542('0x20')]);}}if(_0xce822e){logger[_0x7542('0xd')]('Enduser\x20found!');return _0xce822e;}else{logger['info'](_0x7542('0x2b'));return request({'uri':util[_0x7542('0xf')]('%s/users.json',_0x2a7848[_0x7542('0x10')]),'method':'POST','body':{'user':{'role':_0x7542('0x2a'),'name':util[_0x7542('0xf')](_0x7542('0x2c'),_0xa96703||_0x5a4ca0),'phone':_0x5a4ca0}}})['then'](function(_0x2347e5){logger['info'](_0x7542('0x2d'));return _0x2347e5[_0x7542('0x23')];});}});}function getAuth(_0x594ab8){var _0x136df6;if(_0x594ab8[_0x7542('0x2e')]===_0x7542('0x2f')){_0x136df6=util[_0x7542('0xf')](_0x7542('0x30'),_0x594ab8[_0x7542('0x31')],_0x594ab8[_0x7542('0x2f')]);}else if(_0x594ab8[_0x7542('0x2e')]===_0x7542('0x32')){_0x136df6=util[_0x7542('0xf')](_0x7542('0x33'),_0x594ab8[_0x7542('0x31')],_0x594ab8[_0x7542('0x32')]);}return util[_0x7542('0xf')]('Basic\x20%s',new Buffer(_0x136df6)[_0x7542('0x34')]('base64'));}function request(_0x203f8a){logger[_0x7542('0x35')](_0x7542('0x36'),JSON[_0x7542('0x37')](_0x203f8a));return rp(_[_0x7542('0x9')](_0x203f8a,{'method':_0x7542('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x4fdc2d,_0x36eaea){var _0xfaa085=[];if(_0x4fdc2d&&_0x4fdc2d['length']>0x0){_0xfaa085=_[_0x7542('0x39')](_0x4fdc2d,_0x36eaea);}return _0xfaa085;}function getCustomFields(_0x49152b,_0x3b3ce0){var _0x12bbda=[];var _0x510a24={'custom_fields':[]};if(_0x49152b['length']>0x0){_[_0x7542('0x3a')](_0x49152b,function(_0x4e1d2b){if(_[_0x7542('0x3b')]([_0x7542('0x3c'),_0x7542('0x3d')],_0x4e1d2b[_0x7542('0x3e')])&&_0x4e1d2b[_0x7542('0x3f')]&&!_0x4e1d2b[_0x7542('0x40')]){_0x510a24[_0x4e1d2b[_0x7542('0x3f')]['toLowerCase']()]=_0x4e1d2b[_0x7542('0x41')][_0x7542('0x34')]();}else if(_['includes']([_0x7542('0x3c'),_0x7542('0x3d')],_0x4e1d2b[_0x7542('0x3e')])&&_0x4e1d2b[_0x7542('0x42')]&&_0x4e1d2b[_0x7542('0x40')]){_0x510a24[_0x7542('0x43')][_0x7542('0x44')]({'id':_0x4e1d2b['idField'],'value':_0x4e1d2b['content'][_0x7542('0x34')]()});}else if(_0x4e1d2b['type']===_0x7542('0x45')&&_0x4e1d2b[_0x7542('0x46')]&&_0x4e1d2b[_0x7542('0x42')]&&_0x4e1d2b[_0x7542('0x40')]){_0x3b3ce0[_0x4e1d2b[_0x7542('0x46')]]&&_0x510a24[_0x7542('0x43')][_0x7542('0x44')]({'id':_0x4e1d2b[_0x7542('0x42')],'value':_0x3b3ce0[_0x4e1d2b[_0x7542('0x46')]][_0x7542('0x34')]()});}else if(_0x4e1d2b['type']===_0x7542('0x47')&&_0x4e1d2b[_0x7542('0x48')]&&_0x4e1d2b[_0x7542('0x48')][_0x7542('0x14')]&&_0x4e1d2b[_0x7542('0x42')]&&_0x4e1d2b[_0x7542('0x40')]){_0x3b3ce0[_0x4e1d2b[_0x7542('0x48')][_0x7542('0x14')][_0x7542('0x49')]()]&&_0x510a24[_0x7542('0x43')][_0x7542('0x44')]({'id':_0x4e1d2b[_0x7542('0x42')],'value':_0x3b3ce0[_0x4e1d2b[_0x7542('0x48')][_0x7542('0x14')][_0x7542('0x49')]()][_0x7542('0x34')]()});}});}return _0x510a24;}exports[_0x7542('0x4a')]=function(_0x210c6e,_0x16769e,_0x2fc404,_0x44ad0e,_0x5e7e2e,_0x829afb){var _0x4f4de1,_0x312730;_0x829afb[_0x7542('0x10')]=intUtil[_0x7542('0x4b')](_0x829afb['remoteUri']);_0x829afb[_0x7542('0x4c')]=intUtil['stripTrailingSlash'](_0x829afb[_0x7542('0x4c')]);if(_0x5e7e2e&&_0x5e7e2e[_0x7542('0x4d')]){logger[_0x7542('0xd')]('[QUEUE]',_0x7542('0x4e'));_0x16769e[_0x7542('0x4f')]=util[_0x7542('0xf')](_0x7542('0x50'),_0x829afb['serverUrl'],_0x16769e[_0x7542('0x51')],md5(_0x16769e[_0x7542('0x51')]));}else{_0x16769e[_0x7542('0x4f')]='';}headers[_0x7542('0x52')]=getAuth(_0x829afb);return getUser(_0x829afb,_0x44ad0e[_0x7542('0x53')])[_0x7542('0x18')](function(_0x52fede){_0x4f4de1=_0x52fede;logger[_0x7542('0xd')](_0x7542('0x54'),_0x4f4de1['id']);return getEndUser(_0x829afb,_0x16769e[_0x7542('0x55')],_0x16769e[_0x7542('0x56')]);})[_0x7542('0x18')](function(_0x52edbf){_0x312730=_0x52edbf;logger[_0x7542('0xd')](_0x7542('0x57'),_0x312730['id']);return getTicket(_0x829afb,_0x4f4de1,_0x312730,_0x2fc404,_0x16769e);})[_0x7542('0x18')](function(_0x558a18){if(_0x558a18){logger[_0x7542('0xd')](_0x7542('0x58'),_0x558a18['id']);switch(_0x829afb[_0x7542('0x3e')]){case _0x7542('0x59'):logger['info']('[QUEUE]',_0x7542('0x5a'));return request({'uri':util[_0x7542('0xf')](_0x7542('0x5b'),_0x829afb['remoteUri'],_0x4f4de1['id'],_0x558a18['id']),'method':_0x7542('0x11')});case _0x7542('0x5c'):logger[_0x7542('0xd')](_0x7542('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7542('0xf')](_0x7542('0x5e'),_0x44ad0e[_0x7542('0x14')]),_0x7542('0x5f'),{'uri':util[_0x7542('0xf')]('%s/agent/tickets/%s',_0x829afb['remoteUri'][_0x7542('0x60')](_0x7542('0x61'),''),_0x558a18['id'])});break;default:logger[_0x7542('0x62')](_0x7542('0x5d'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x7542('0x63')](function(_0x1fa6a3){logger[_0x7542('0x62')](_0x7542('0x64'),util[_0x7542('0x65')](_0x1fa6a3,{'showHidden':!![],'depth':null}));});};exports[_0x7542('0x66')]=function(_0x190593,_0x582505,_0x2e66c8,_0x1f483b,_0x207134,_0xcc4b4d,_0x1f18fa){var _0x6946dc,_0x39cb5b;_0xcc4b4d[_0x7542('0x10')]=intUtil['stripTrailingSlash'](_0xcc4b4d['remoteUri']);_0xcc4b4d[_0x7542('0x4c')]=intUtil['stripTrailingSlash'](_0xcc4b4d[_0x7542('0x4c')]);if(_0x1f18fa&&_0x1f18fa[_0x7542('0x67')]&&_0x1f18fa[_0x7542('0x67')]!==_0x7542('0x68')){logger[_0x7542('0xd')](_0x7542('0x69'),'Recording\x20is\x20enabled!');_0x582505[_0x7542('0x4f')]=util[_0x7542('0xf')](_0x7542('0x50'),_0xcc4b4d[_0x7542('0x4c')],_0x582505[_0x7542('0x51')],md5(_0x582505[_0x7542('0x51')]));}headers[_0x7542('0x52')]=getAuth(_0xcc4b4d);return getUser(_0xcc4b4d,_0x1f483b['email'])[_0x7542('0x18')](function(_0x4d92ab){_0x6946dc=_0x4d92ab;logger[_0x7542('0xd')]('The\x20User\x20ID\x20is:',_0x6946dc['id']);return getEndUser(_0xcc4b4d,_0x582505[_0x7542('0x6a')],_0x582505['destcalleridnum']);})[_0x7542('0x18')](function(_0x340650){_0x39cb5b=_0x340650;logger[_0x7542('0xd')](_0x7542('0x57'),_0x39cb5b['id']);return getTicket(_0xcc4b4d,_0x6946dc,_0x39cb5b,_0x2e66c8,_0x582505);})[_0x7542('0x18')](function(_0x5db339){if(_0x5db339){logger[_0x7542('0xd')]('The\x20Ticket\x20ID\x20is:',_0x5db339['id']);switch(_0xcc4b4d[_0x7542('0x3e')]){case _0x7542('0x59'):logger[_0x7542('0xd')](_0x7542('0x69'),_0x7542('0x5a'));return request({'uri':util[_0x7542('0xf')](_0x7542('0x5b'),_0xcc4b4d[_0x7542('0x10')],_0x6946dc['id'],_0x5db339['id']),'method':_0x7542('0x11')});case'newTab':logger[_0x7542('0xd')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7542('0xf')](_0x7542('0x5e'),_0x1f483b[_0x7542('0x14')]),_0x7542('0x5f'),{'uri':util[_0x7542('0xf')](_0x7542('0x6b'),_0xcc4b4d[_0x7542('0x10')][_0x7542('0x60')](_0x7542('0x61'),''),_0x5db339['id'])});break;default:logger[_0x7542('0x62')](_0x7542('0x69'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x7542('0x63')](function(_0x2962b3){logger[_0x7542('0x62')](_0x7542('0x6c'),util[_0x7542('0x65')](_0x2962b3,{'showHidden':!![],'depth':null}));});};exports[_0x7542('0x6d')]=function(_0x54e547,_0x19a04c,_0x34c61c,_0x4122f7,_0x6021fb,_0x3d5c48){var _0x538b81,_0x1846fc;_0x3d5c48['remoteUri']=intUtil[_0x7542('0x4b')](_0x3d5c48[_0x7542('0x10')]);_0x3d5c48[_0x7542('0x4c')]=intUtil[_0x7542('0x4b')](_0x3d5c48[_0x7542('0x4c')]);if(_0x6021fb&&_0x6021fb[_0x7542('0x4d')]){logger[_0x7542('0xd')]('['+_0x19a04c[_0x7542('0x6e')][_0x7542('0x6f')]()+']',_0x7542('0x4e'));_0x19a04c['recordingURL']=util[_0x7542('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3d5c48[_0x7542('0x4c')],_0x19a04c[_0x7542('0x51')],md5(_0x19a04c[_0x7542('0x51')]));}else{_0x19a04c[_0x7542('0x4f')]='';}headers[_0x7542('0x52')]=getAuth(_0x3d5c48);return getUser(_0x3d5c48)[_0x7542('0x18')](function(_0x286ad7){_0x538b81=_0x286ad7;logger[_0x7542('0xd')]('The\x20User\x20ID\x20is:',_0x538b81['id']);return getEndUser(_0x3d5c48,_0x19a04c[_0x7542('0x55')],_0x19a04c[_0x7542('0x56')]);})[_0x7542('0x18')](function(_0x20c3e2){_0x1846fc=_0x20c3e2;logger[_0x7542('0xd')](_0x7542('0x57'),_0x1846fc['id']);return getTicket(_0x3d5c48,_0x538b81,_0x1846fc,_0x34c61c,_0x19a04c);})[_0x7542('0x18')](function(_0x26ae3a){if(_0x26ae3a){logger[_0x7542('0xd')](_0x7542('0x58'),_0x26ae3a['id']);}})[_0x7542('0x63')](function(_0x4f927f){logger[_0x7542('0x62')]('['+_0x19a04c[_0x7542('0x6e')][_0x7542('0x6f')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x7542('0x65')](_0x4f927f,{'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 a9269ef..ae60811 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 _0xbdd7=['first_name','last_name','code','SUCCESS','details','Error:\x20','moduleSearch','contact_lead','Contacts','Leads','contact','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','/crm/v2/Leads/search?criteria=((Phone:equals:','administrator','getString','Subjects','Descriptions','enduserType','Who_Id','Full_Name','Last_Name','First_Name','$se_module','talktime','Call_Duration','mm:ss','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','lastevent','Called','complete','connect','rejected','Call_Result','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/downloads?type=uniqueid&token=','destcalleridname','destcalleridnum','unmanaged','calleridnum','toUpperCase','lodash','request-promise','md5','./util','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','stringify','length','forEach','includes','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','refreshToken','clientSecret','refresh_token','then','add','expires_in','seconds','error','Failing\x20creating\x20the\x20access_token','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','info','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','catch','data','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xbdd7,0xed));var _0x7bdd=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbdd7[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7bdd('0x0'));var rp=require(_0x7bdd('0x1'));var md5=require(_0x7bdd('0x2'));var util=require('util');var intUtil=require(_0x7bdd('0x3'));var moment=require('moment');var Redis=require(_0x7bdd('0x4'));var BPromise=require('bluebird');var config=require(_0x7bdd('0x5'));var logger=require(_0x7bdd('0x6'))(_0x7bdd('0x7'));config[_0x7bdd('0x8')]=_['defaults'](config[_0x7bdd('0x8')],{'host':_0x7bdd('0x9'),'port':0x18eb});var io=require(_0x7bdd('0xa'))(new Redis(config[_0x7bdd('0x8')]));function emit(_0x48f7b1,_0x3e61bd,_0x3e4ffb){io['to'](_0x48f7b1)[_0x7bdd('0xb')](_0x3e61bd,_0x3e4ffb);}function request(_0x58b3c6){logger['debug']('[HTTP]',JSON[_0x7bdd('0xc')](_0x58b3c6));return rp(_0x58b3c6);}function getCustomFields(_0x55a2bf,_0x2404fe){var _0x402079={};if(_0x55a2bf[_0x7bdd('0xd')]>0x0){_[_0x7bdd('0xe')](_0x55a2bf,function(_0x204e3b){if(_[_0x7bdd('0xf')]([_0x7bdd('0x10'),_0x7bdd('0x11')],_0x204e3b[_0x7bdd('0x12')])&&_0x204e3b[_0x7bdd('0x13')]){_0x402079[_0x204e3b[_0x7bdd('0x13')]]=_0x204e3b['content'][_0x7bdd('0x14')]();}else if(_0x204e3b[_0x7bdd('0x12')]===_0x7bdd('0x15')&&_0x204e3b['variableName']&&_0x204e3b[_0x7bdd('0x13')]&&_0x2404fe[_0x204e3b[_0x7bdd('0x16')]]){_0x402079[_0x204e3b['idField']]=_0x2404fe[_0x204e3b[_0x7bdd('0x16')]][_0x7bdd('0x14')]();}else if(_0x204e3b[_0x7bdd('0x12')]===_0x7bdd('0x17')&&_0x204e3b[_0x7bdd('0x18')]&&_0x204e3b['Variable'][_0x7bdd('0x19')]&&_0x204e3b[_0x7bdd('0x13')]&&_0x2404fe[_0x204e3b['Variable']['name'][_0x7bdd('0x1a')]()]){_0x402079[_0x204e3b[_0x7bdd('0x13')]]=_0x2404fe[_0x204e3b[_0x7bdd('0x18')][_0x7bdd('0x19')][_0x7bdd('0x1a')]()][_0x7bdd('0x14')]();}});}return _0x402079;}function getName(_0xb5aa20){if(_0xb5aa20[_0x7bdd('0x1b')]('\x20')>0x0){var _0xe37d18=_0xb5aa20[_0x7bdd('0x1c')](/ (.+)/);if(_0xe37d18[0x1]){return _0xe37d18;}}return[_0xb5aa20,_0xb5aa20];}var accountsTokens={};function getAccessToken(_0x293061){return new Promise(function(_0x6c5ea,_0x68126d){if(!_[_0x7bdd('0x1d')](accountsTokens[_0x293061['id']])&&!_[_0x7bdd('0x1d')](accountsTokens[_0x293061['id']][_0x7bdd('0x1e')])){if(moment()[_0x7bdd('0x1f')](accountsTokens[_0x293061['id']]['expires_in'])){_0x6c5ea(accountsTokens[_0x293061['id']][_0x7bdd('0x1e')]);}}var _0x146df2;switch(_0x293061[_0x7bdd('0x20')]){case'US':_0x146df2=_0x7bdd('0x21');break;case'AU':_0x146df2=_0x7bdd('0x22');break;case'EU':_0x146df2='https://accounts.zoho.eu';break;case'IN':_0x146df2=_0x7bdd('0x23');break;case'CN':_0x146df2=_0x7bdd('0x24');break;default:_0x146df2=_0x7bdd('0x25');break;}var _0x1f175c={'method':'POST','uri':_0x146df2+'/oauth/v2/token','qs':{'refresh_token':_0x293061[_0x7bdd('0x26')],'client_id':_0x293061['clientId'],'client_secret':_0x293061[_0x7bdd('0x27')],'grant_type':_0x7bdd('0x28')},'json':!![]};return rp(_0x1f175c)[_0x7bdd('0x29')](function(_0x1cf906){accountsTokens[_0x293061['id']]={'access_token':_0x1cf906[_0x7bdd('0x1e')],'expires_in':moment()[_0x7bdd('0x2a')](_0x1cf906[_0x7bdd('0x2b')],_0x7bdd('0x2c'))};_0x6c5ea(_0x1cf906[_0x7bdd('0x1e')]);})['catch'](function(_0x160675){logger[_0x7bdd('0x2d')](_0x7bdd('0x2e'),_0x160675['stack']);_0x68126d(_0x160675);});});}function getUser(_0x1ac61c,_0xa60527,_0x200e89,_0x540ac5){logger['info'](_0x7bdd('0x2f'));return request({'method':_0x7bdd('0x30'),'uri':util[_0x7bdd('0x31')](_0x7bdd('0x32'),_0xa60527),'qs':{'type':_0x7bdd('0x33')},'headers':{'Authorization':_0x7bdd('0x34')+_0x1ac61c},'json':!![]})[_0x7bdd('0x29')](function(_0x583444){if(_0x583444[_0x7bdd('0x35')]){var _0x3f417c=-0x1;if(_[_0x7bdd('0x36')](_0x583444[_0x7bdd('0x35')])){if(!_['isNil'](_0x540ac5)){_0x3f417c=_[_0x7bdd('0x37')](_0x583444[_0x7bdd('0x35')],function(_0xe798c9){return _0xe798c9[_0x7bdd('0x38')]===_0x540ac5;});}if(_0x3f417c>=0x0){logger['info'](_0x7bdd('0x39'));}else{logger[_0x7bdd('0x3a')](_0x7bdd('0x3b'));_0x3f417c=_[_0x7bdd('0x37')](_0x583444[_0x7bdd('0x35')],function(_0x1f493c){return _0x1f493c[_0x7bdd('0x3c')][_0x7bdd('0x19')]===_0x7bdd('0x3d');});}return _0x583444[_0x7bdd('0x35')][_0x3f417c];}else{if(_0x583444[_0x7bdd('0x3e')][_0x7bdd('0x3c')][_0x7bdd('0x19')]===_0x7bdd('0x3d')){logger[_0x7bdd('0x3a')]('Using\x20the\x20admin\x20account!');user=_0x583444[_0x7bdd('0x3e')];return user;}else{logger[_0x7bdd('0x2d')]('The\x20failing\x20result\x20is',JSON[_0x7bdd('0xc')](_0x583444));throw new Error(_0x7bdd('0x3f')+JSON[_0x7bdd('0xc')](_0x583444));}}}else{logger['error'](_0x7bdd('0x40'),JSON['stringify'](_0x583444));throw new Error(_0x7bdd('0x3f')+JSON[_0x7bdd('0xc')](_0x583444));}})[_0x7bdd('0x41')](function(_0x1ba664){console['error'](_0x1ba664);});}function getZohoUser(_0x5b3dd5,_0x289b07){return new BPromise(function(_0x5f4cba,_0x451cd0){request(_0x5b3dd5)[_0x7bdd('0x29')](function(_0x252e98){var _0x4259f8=null;if(_0x252e98){_0x4259f8=_0x252e98[_0x7bdd('0x42')][0x0];_0x4259f8['enduserType']=_0x289b07;}_0x5f4cba(_0x4259f8);})[_0x7bdd('0x41')](function(_0x4386bd){_0x451cd0(_0x4386bd);});});}function createEndUser(_0x25d9ce,_0x53bfc6,_0x23d4b6,_0x24d5b6,_0x1151f2,_0xb15dd8){var _0x23d4b6=getName(_0x23d4b6);return request({'method':_0x7bdd('0x43'),'uri':_0x7bdd('0x44')+_0x53bfc6+_0x7bdd('0x45')+_[_0x7bdd('0x46')](_0xb15dd8[_0x7bdd('0x47')])+'s','body':{'data':[{'Last_Name':_0x23d4b6[0x1],'First_Name':_0x23d4b6[0x0],'Phone':_0x24d5b6,'Owner':{'name':!_[_0x7bdd('0x1d')](_0x1151f2['role'][_0x7bdd('0x19')])?_0x1151f2[_0x7bdd('0x48')][_0x7bdd('0x19')]:!_[_0x7bdd('0x1d')](_0x1151f2[_0x7bdd('0x49')])?_0x1151f2[_0x7bdd('0x49')]+'\x20'+_0x1151f2[_0x7bdd('0x4a')]:_0x1151f2[_0x7bdd('0x4a')],'id':_0x1151f2['id']}}]},'headers':{'Authorization':_0x7bdd('0x34')+_0x25d9ce},'json':!![]})['then'](function(_0x444cb5){if(_0x444cb5&&_0x444cb5[_0x7bdd('0x42')][0x0][_0x7bdd('0x4b')]===_0x7bdd('0x4c')){var _0x2cad5a=_0x444cb5[_0x7bdd('0x42')][0x0][_0x7bdd('0x4d')];_0x2cad5a['enduserType']=_[_0x7bdd('0x46')](_0xb15dd8['moduleCreate'])+'s';return _0x2cad5a;}logger[_0x7bdd('0x2d')](_0x7bdd('0x40'),JSON[_0x7bdd('0xc')](data));throw new Error(_0x7bdd('0x4e')+JSON['stringify'](data));})[_0x7bdd('0x41')](function(_0x47290d){console['log']('CREATE\x20ERROR',_0x47290d);});}function getEndUser(_0x654344,_0x446892,_0x2682a1,_0x16c8d3,_0x285b91,_0x5735df,_0x3e14c7){var _0x5cf53c={'method':_0x7bdd('0x30'),'uri':'','headers':{'Authorization':_0x7bdd('0x34')+_0x654344},'json':!![]};switch(_0x3e14c7[_0x7bdd('0x4f')]){case _0x7bdd('0x50'):_0x5cf53c['uri']=_0x7bdd('0x44')+_0x446892+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x285b91+'))';return getZohoUser(_0x5cf53c,_0x7bdd('0x51'))['then'](function(_0x2d8cf1){if(_0x2d8cf1)return _0x2d8cf1;_0x5cf53c['uri']=_0x7bdd('0x44')+_0x446892+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x285b91+'))';return getZohoUser(_0x5cf53c,_0x7bdd('0x52'))[_0x7bdd('0x29')](function(_0x3e03d3){if(_0x3e03d3)return _0x3e03d3;if(_0x3e14c7['moduleCreate']!='nothing'){return createEndUser(_0x654344,_0x446892,_0x16c8d3,_0x285b91,_0x5735df,_0x3e14c7);}else{return{};}});});break;case _0x7bdd('0x53'):_0x5cf53c[_0x7bdd('0x54')]=_0x7bdd('0x44')+_0x446892+_0x7bdd('0x55')+_0x285b91+'))';return getZohoUser(_0x5cf53c,_0x7bdd('0x51'))['then'](function(_0x40b266){if(_0x40b266)return _0x40b266;if(_0x3e14c7[_0x7bdd('0x47')]!=_0x7bdd('0x56')){return createEndUser(_0x654344,_0x446892,_0x16c8d3,_0x285b91,_0x5735df,_0x3e14c7);}else{return{};}});break;case'lead':_0x5cf53c['uri']=_0x7bdd('0x44')+_0x446892+_0x7bdd('0x57')+_0x285b91+'))';return getZohoUser(_0x5cf53c,_0x7bdd('0x52'))[_0x7bdd('0x29')](function(_0xb14745){if(_0xb14745)return _0xb14745;if(_0x3e14c7[_0x7bdd('0x47')]!=_0x7bdd('0x56')){return createEndUser(_0x654344,_0x446892,_0x16c8d3,_0x285b91,_0x5735df,_0x3e14c7);}else{return{};}});break;}}function getCall(_0x5ef67c,_0x4251ab,_0x6d5855,_0x238e9c,_0x296917,_0xa4ca85,_0x2678e3,_0x205095){logger['info']('Creating\x20new\x20call...');var _0x24e8f8={};_0x24e8f8['Owner']={'name':!_['isNil'](_0x238e9c['role'][_0x7bdd('0x19')])&&!_[_0x7bdd('0x1d')](_0x238e9c['profile']['name'])&&_0x238e9c[_0x7bdd('0x3c')][_0x7bdd('0x19')]===_0x7bdd('0x58')?_0x238e9c[_0x7bdd('0x48')][_0x7bdd('0x19')]:!_[_0x7bdd('0x1d')](_0x238e9c[_0x7bdd('0x49')])?_0x238e9c[_0x7bdd('0x49')]+'\x20'+_0x238e9c[_0x7bdd('0x4a')]:_0x238e9c[_0x7bdd('0x4a')],'id':_0x238e9c['id']};_0x24e8f8['Subject']=intUtil[_0x7bdd('0x59')](_0xa4ca85[_0x7bdd('0x5a')],_0x2678e3,'\x20');_0x24e8f8['Description']=intUtil[_0x7bdd('0x59')](_0xa4ca85[_0x7bdd('0x5b')],_0x2678e3,'\x0a');if(_0x296917[_0x7bdd('0x5c')]==='Contacts'){_0x24e8f8[_0x7bdd('0x5d')]={'name':!_[_0x7bdd('0x1d')](_0x296917[_0x7bdd('0x5e')])?_0x296917['Full_Name']:!_[_0x7bdd('0x1d')](_0x296917['First_Name'])?_0x296917['First_Name']+'\x20'+_0x296917['Last_Name']:_0x296917[_0x7bdd('0x5f')],'id':_0x296917['id']};}if(_0x296917['enduserType']===_0x7bdd('0x52')){_0x24e8f8['What_Id']={'name':!_['isNil'](_0x296917[_0x7bdd('0x5e')])?_0x296917[_0x7bdd('0x5e')]:!_[_0x7bdd('0x1d')](_0x296917[_0x7bdd('0x60')])?_0x296917[_0x7bdd('0x60')]+'\x20'+_0x296917[_0x7bdd('0x5f')]:_0x296917[_0x7bdd('0x5f')],'id':_0x296917['id']};_0x24e8f8[_0x7bdd('0x61')]=_[_0x7bdd('0x46')](_0x296917[_0x7bdd('0x5c')]);}if(_0x2678e3[_0x7bdd('0x62')]){_0x24e8f8[_0x7bdd('0x63')]=moment['utc'](parseInt(_0x2678e3[_0x7bdd('0x62')])*0x3e8)[_0x7bdd('0x31')](_0x7bdd('0x64'));}else if(_0x2678e3[_0x7bdd('0x65')]&&_0x2678e3[_0x7bdd('0x66')]){_0x24e8f8[_0x7bdd('0x63')]=moment[_0x7bdd('0x67')](moment(_0x2678e3[_0x7bdd('0x66')],_0x7bdd('0x68'))[_0x7bdd('0x69')](moment(_0x2678e3['starttime'],_0x7bdd('0x68'))))[_0x7bdd('0x31')](_0x7bdd('0x64'));}switch(_0x2678e3[_0x7bdd('0x6a')]){case'called':_0x24e8f8['Call_Result']=_0x7bdd('0x6b');break;case _0x7bdd('0x6c'):case _0x7bdd('0x6d'):_0x24e8f8['Call_Result']='Answered';break;case _0x7bdd('0x6e'):_0x24e8f8['Call_Result']='Rejected';break;case'abandoned':_0x24e8f8[_0x7bdd('0x6f')]=_0x7bdd('0x70');break;case _0x7bdd('0x71'):_0x24e8f8[_0x7bdd('0x6f')]=_0x7bdd('0x72');default:}_0x24e8f8[_0x7bdd('0x73')]=(_0x205095===_0x7bdd('0x74')?moment(_0x2678e3[_0x7bdd('0x75')])[_0x7bdd('0x31')](_0x7bdd('0x68')):moment(_0x2678e3[_0x7bdd('0x76')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x7bdd('0x31')]('YYYY-MM-DDTHH:mm:ss');_0x24e8f8[_0x7bdd('0x77')]=_0x205095||_0x7bdd('0x78');_0x24e8f8=_[_0x7bdd('0x79')](_0x24e8f8,getCustomFields(_0xa4ca85['Fields'],_0x2678e3));return request({'method':_0x7bdd('0x43'),'uri':_0x7bdd('0x44')+_0x4251ab+_0x7bdd('0x7a'),'headers':{'Authorization':_0x7bdd('0x34')+_0x5ef67c},'body':{'data':[_0x24e8f8]},'json':!![]})['then'](function(_0x415af9){if(_0x415af9&&_0x415af9[_0x7bdd('0x42')][0x0][_0x7bdd('0x4b')]===_0x7bdd('0x4c')){logger[_0x7bdd('0x3a')](_0x7bdd('0x7b'));return{'id':_0x415af9['data'][0x0]['details']['id']};}})[_0x7bdd('0x41')](function(_0x351fdf){logger[_0x7bdd('0x3a')](_0x7bdd('0x7c'),_0x351fdf['stack']);console[_0x7bdd('0x7d')]('err',_0x351fdf);});}exports[_0x7bdd('0x7e')]=function(_0x10388a,_0x5d5921,_0xc9d7e3,_0x42198b,_0x968d78,_0x448b1b){var _0x59cd17,_0x260e46,_0x281af3;_0x448b1b[_0x7bdd('0x7f')]=intUtil[_0x7bdd('0x80')](_0x448b1b[_0x7bdd('0x7f')]);_0x448b1b[_0x7bdd('0x81')]=intUtil['stripTrailingSlash'](_0x448b1b['serverUrl']);if(_0x968d78&&_0x968d78[_0x7bdd('0x82')]){logger[_0x7bdd('0x3a')](_0x7bdd('0x83'),_0x7bdd('0x84'));_0x5d5921[_0x7bdd('0x85')]=_0x448b1b[_0x7bdd('0x81')]+_0x7bdd('0x86')+_0x5d5921[_0x7bdd('0x87')]+'/downloads?type=uniqueid&token='+md5(_0x5d5921[_0x7bdd('0x87')]);}else{_0x5d5921[_0x7bdd('0x85')]='';}var _0x4ee041=_0x448b1b[_0x7bdd('0x7f')]===_0x7bdd('0x88')?'eu':_0x7bdd('0x89');return getAccessToken(_0x448b1b)['then'](function(_0x1af5ca){_0x281af3=_0x1af5ca;return getUser(_0x281af3,_0x4ee041,_0x448b1b,_0x42198b['email']);})[_0x7bdd('0x29')](function(_0x5c7f15){_0x59cd17=_0x5c7f15;logger[_0x7bdd('0x3a')](_0x7bdd('0x8a'),_0x59cd17['id']);return getEndUser(_0x281af3,_0x4ee041,_0x448b1b,_0x5d5921[_0x7bdd('0x8b')],_0x5d5921['calleridnum'],_0x59cd17,_0xc9d7e3);})[_0x7bdd('0x29')](function(_0x33153b){_0x260e46=_0x33153b;return getCall(_0x281af3,_0x4ee041,_0x448b1b,_0x59cd17,_0x260e46,_0xc9d7e3,_0x5d5921,_0x7bdd('0x78'));})[_0x7bdd('0x29')](function(_0xf12c38){if(_0xf12c38){logger[_0x7bdd('0x3a')](_0x7bdd('0x8c'),_0xf12c38['id']);logger['info'](_0x7bdd('0x83'),_0x7bdd('0x8d'));emit(util[_0x7bdd('0x31')](_0x7bdd('0x8e'),_0x42198b[_0x7bdd('0x19')]),_0x7bdd('0x8f'),{'uri':_0x7bdd('0x90')+_0x448b1b['host']+_0x7bdd('0x91')+_0xf12c38['id']});}})[_0x7bdd('0x41')](function(_0x50be7a){logger[_0x7bdd('0x2d')]('[QUEUE]',JSON[_0x7bdd('0xc')](_0x50be7a));});};exports[_0x7bdd('0x74')]=function(_0x1bc270,_0x456e90,_0x10e65a,_0x3d820c,_0x507f6f,_0x21c2bf,_0x5bfbf4){var _0x214fbc,_0x10c2c2,_0x217e91;_0x21c2bf[_0x7bdd('0x7f')]=intUtil['stripTrailingSlash'](_0x21c2bf[_0x7bdd('0x7f')]);_0x21c2bf[_0x7bdd('0x81')]=intUtil[_0x7bdd('0x80')](_0x21c2bf['serverUrl']);if(_0x5bfbf4&&_0x5bfbf4[_0x7bdd('0x92')]&&_0x5bfbf4[_0x7bdd('0x92')]!==_0x7bdd('0x93')){logger[_0x7bdd('0x3a')](_0x7bdd('0x94'),_0x7bdd('0x84'));_0x456e90[_0x7bdd('0x85')]=_0x21c2bf[_0x7bdd('0x81')]+_0x7bdd('0x86')+_0x456e90[_0x7bdd('0x87')]+_0x7bdd('0x95')+md5(_0x456e90[_0x7bdd('0x87')]);}var _0xd21adc=_0x21c2bf['host']===_0x7bdd('0x88')?'eu':_0x7bdd('0x89');return getAccessToken(_0x21c2bf)['then'](function(_0x50ccef){_0x217e91=_0x50ccef;return getUser(_0x217e91,_0xd21adc,_0x21c2bf,_0x3d820c[_0x7bdd('0x38')]);})['then'](function(_0x307fbd){_0x214fbc=_0x307fbd;logger[_0x7bdd('0x3a')]('The\x20User\x20ID\x20is:',_0x214fbc['id']);return getEndUser(_0x217e91,_0xd21adc,_0x21c2bf,_0x456e90[_0x7bdd('0x96')],_0x456e90[_0x7bdd('0x97')],_0x214fbc,_0x10e65a);})['then'](function(_0x14b04c){_0x10c2c2=_0x14b04c;return getCall(_0x217e91,_0xd21adc,_0x21c2bf,_0x214fbc,_0x10c2c2,_0x10e65a,_0x456e90,'Outbound');})[_0x7bdd('0x29')](function(_0x58c27a){if(_0x58c27a){logger[_0x7bdd('0x3a')]('The\x20Call\x20ID\x20is:',_0x58c27a['id']);logger['info']('[OUTBOUND]',_0x7bdd('0x8d'));emit(util[_0x7bdd('0x31')](_0x7bdd('0x8e'),_0x3d820c[_0x7bdd('0x19')]),_0x7bdd('0x8f'),{'uri':'https://crm.'+_0x21c2bf[_0x7bdd('0x7f')]+_0x7bdd('0x91')+_0x58c27a['id']});}})[_0x7bdd('0x41')](function(_0x11872d){logger[_0x7bdd('0x2d')](_0x7bdd('0x94'),JSON['stringify'](_0x11872d));});};exports[_0x7bdd('0x98')]=function(_0x4ba922,_0x521fa0,_0x318170,_0x952718,_0xa1e95a,_0x5c14d2){var _0x15e34c,_0x3f80cc,_0x1e56ad;_0x5c14d2[_0x7bdd('0x7f')]=intUtil[_0x7bdd('0x80')](_0x5c14d2['host']);_0x5c14d2['serverUrl']=intUtil[_0x7bdd('0x80')](_0x5c14d2['serverUrl']);if(_0xa1e95a&&_0xa1e95a[_0x7bdd('0x82')]){logger[_0x7bdd('0x3a')]('['+_0x521fa0['lastevent']['toUpperCase']()+']',_0x7bdd('0x84'));_0x521fa0[_0x7bdd('0x85')]=_0x5c14d2['serverUrl']+'/api/voice/recordings/'+_0x521fa0[_0x7bdd('0x87')]+_0x7bdd('0x95')+md5(_0x521fa0[_0x7bdd('0x87')]);}else{_0x521fa0[_0x7bdd('0x85')]='';}var _0x57553f=_0x5c14d2[_0x7bdd('0x7f')]===_0x7bdd('0x88')?'eu':'com';return getAccessToken(_0x5c14d2)[_0x7bdd('0x29')](function(_0x2dbb22){_0x1e56ad=_0x2dbb22;return getUser(_0x1e56ad,_0x57553f,_0x5c14d2);})[_0x7bdd('0x29')](function(_0x1eec15){_0x15e34c=_0x1eec15;logger[_0x7bdd('0x3a')](_0x7bdd('0x8a'),_0x15e34c['id']);return getEndUser(_0x1e56ad,_0x57553f,_0x5c14d2,_0x521fa0[_0x7bdd('0x8b')],_0x521fa0[_0x7bdd('0x99')],_0x15e34c,_0x318170);})[_0x7bdd('0x29')](function(_0x25353a){_0x3f80cc=_0x25353a;return getCall(_0x1e56ad,_0x57553f,_0x5c14d2,_0x15e34c,_0x3f80cc,_0x318170,_0x521fa0,_0x7bdd('0x78'));})[_0x7bdd('0x29')](function(_0x4c93a8){if(_0x4c93a8){logger[_0x7bdd('0x3a')](_0x7bdd('0x8c'),_0x4c93a8['id']);}})[_0x7bdd('0x41')](function(_0x388111){logger[_0x7bdd('0x2d')]('['+_0x521fa0[_0x7bdd('0x6a')][_0x7bdd('0x9a')]()+']',JSON[_0x7bdd('0xc')](_0x388111));});}; \ No newline at end of file +var _0x2a60=['Call_Type','Inbound','merge','Fields','/crm/v2/Calls','code','Call\x20created!','details','err','stack','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','destcalleridname','destcalleridnum','user:%s','trigger:browser:url','toUpperCase','calleridnum','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','zoho','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','length','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','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','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','error','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','SUCCESS','Error:\x20','log','CREATE\x20ERROR','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','Contacts','Leads','Creating\x20new\x20call...','Owner','administrator','Description','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','mm:ss','answertime','utc','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','Called','connect','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt'];(function(_0x2f345a,_0x6b793a){var _0x3de554=function(_0x5962b7){while(--_0x5962b7){_0x2f345a['push'](_0x2f345a['shift']());}};_0x3de554(++_0x6b793a);}(_0x2a60,0xc9));var _0x02a6=function(_0x4770b1,_0x40319f){_0x4770b1=_0x4770b1-0x0;var _0x5817cf=_0x2a60[_0x4770b1];return _0x5817cf;};'use strict';var _=require(_0x02a6('0x0'));var rp=require(_0x02a6('0x1'));var md5=require(_0x02a6('0x2'));var util=require(_0x02a6('0x3'));var intUtil=require(_0x02a6('0x4'));var moment=require(_0x02a6('0x5'));var Redis=require(_0x02a6('0x6'));var BPromise=require(_0x02a6('0x7'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x02a6('0x8'));config[_0x02a6('0x9')]=_[_0x02a6('0xa')](config[_0x02a6('0x9')],{'host':_0x02a6('0xb'),'port':0x18eb});var io=require(_0x02a6('0xc'))(new Redis(config[_0x02a6('0x9')]));function emit(_0x13205d,_0x291323,_0x1f0151){io['to'](_0x13205d)[_0x02a6('0xd')](_0x291323,_0x1f0151);}function request(_0x4ba291){logger['debug'](_0x02a6('0xe'),JSON['stringify'](_0x4ba291));return rp(_0x4ba291);}function getCustomFields(_0x5a048e,_0x3a5657){var _0xc87c40={};if(_0x5a048e[_0x02a6('0xf')]>0x0){_[_0x02a6('0x10')](_0x5a048e,function(_0x26b81b){if(_[_0x02a6('0x11')]([_0x02a6('0x12'),_0x02a6('0x13')],_0x26b81b[_0x02a6('0x14')])&&_0x26b81b[_0x02a6('0x15')]){_0xc87c40[_0x26b81b['idField']]=_0x26b81b[_0x02a6('0x16')][_0x02a6('0x17')]();}else if(_0x26b81b[_0x02a6('0x14')]===_0x02a6('0x18')&&_0x26b81b['variableName']&&_0x26b81b[_0x02a6('0x15')]&&_0x3a5657[_0x26b81b[_0x02a6('0x19')]]){_0xc87c40[_0x26b81b[_0x02a6('0x15')]]=_0x3a5657[_0x26b81b['variableName']][_0x02a6('0x17')]();}else if(_0x26b81b[_0x02a6('0x14')]==='customVariable'&&_0x26b81b['Variable']&&_0x26b81b[_0x02a6('0x1a')]['name']&&_0x26b81b[_0x02a6('0x15')]&&_0x3a5657[_0x26b81b[_0x02a6('0x1a')][_0x02a6('0x1b')][_0x02a6('0x1c')]()]){_0xc87c40[_0x26b81b[_0x02a6('0x15')]]=_0x3a5657[_0x26b81b['Variable'][_0x02a6('0x1b')][_0x02a6('0x1c')]()]['toString']();}});}return _0xc87c40;}function getName(_0x242e68){if(_0x242e68['indexOf']('\x20')>0x0){var _0x24f29f=_0x242e68[_0x02a6('0x1d')](/ (.+)/);if(_0x24f29f[0x1]){return _0x24f29f;}}return[_0x242e68,_0x242e68];}var accountsTokens={};function getAccessToken(_0x455ac2){return new Promise(function(_0x3d6811,_0xdd1342){if(!_['isNil'](accountsTokens[_0x455ac2['id']])&&!_[_0x02a6('0x1e')](accountsTokens[_0x455ac2['id']][_0x02a6('0x1f')])){if(moment()[_0x02a6('0x20')](accountsTokens[_0x455ac2['id']][_0x02a6('0x21')])){_0x3d6811(accountsTokens[_0x455ac2['id']][_0x02a6('0x1f')]);}}var _0x3d3bcc;switch(_0x455ac2[_0x02a6('0x22')]){case'US':_0x3d3bcc=_0x02a6('0x23');break;case'AU':_0x3d3bcc=_0x02a6('0x24');break;case'EU':_0x3d3bcc='https://accounts.zoho.eu';break;case'IN':_0x3d3bcc=_0x02a6('0x25');break;case'CN':_0x3d3bcc=_0x02a6('0x26');break;default:_0x3d3bcc=_0x02a6('0x27');break;}var _0x59459f={'method':_0x02a6('0x28'),'uri':_0x3d3bcc+_0x02a6('0x29'),'qs':{'refresh_token':_0x455ac2[_0x02a6('0x2a')],'client_id':_0x455ac2[_0x02a6('0x2b')],'client_secret':_0x455ac2[_0x02a6('0x2c')],'grant_type':_0x02a6('0x2d')},'json':!![]};return rp(_0x59459f)[_0x02a6('0x2e')](function(_0x14d519){accountsTokens[_0x455ac2['id']]={'access_token':_0x14d519[_0x02a6('0x1f')],'expires_in':moment()[_0x02a6('0x2f')](_0x14d519['expires_in'],_0x02a6('0x30'))};_0x3d6811(_0x14d519['access_token']);})[_0x02a6('0x31')](function(_0xa606e2){logger['error'](_0x02a6('0x32'),_0xa606e2['stack']);_0xdd1342(_0xa606e2);});});}function getUser(_0x325159,_0x13fc15,_0x37b719,_0x264c76){logger[_0x02a6('0x33')](_0x02a6('0x34'));return request({'method':_0x02a6('0x35'),'uri':util[_0x02a6('0x36')](_0x02a6('0x37'),_0x13fc15),'qs':{'type':_0x02a6('0x38')},'headers':{'Authorization':_0x02a6('0x39')+_0x325159},'json':!![]})[_0x02a6('0x2e')](function(_0x5f5004){if(_0x5f5004[_0x02a6('0x3a')]){var _0x1b12c6=-0x1;if(_[_0x02a6('0x3b')](_0x5f5004[_0x02a6('0x3a')])){if(!_[_0x02a6('0x1e')](_0x264c76)){_0x1b12c6=_[_0x02a6('0x3c')](_0x5f5004[_0x02a6('0x3a')],function(_0x4bc978){return _0x4bc978[_0x02a6('0x3d')]===_0x264c76;});}if(_0x1b12c6>=0x0){logger[_0x02a6('0x33')]('Agent\x20found!');}else{logger[_0x02a6('0x33')](_0x02a6('0x3e'));_0x1b12c6=_[_0x02a6('0x3c')](_0x5f5004[_0x02a6('0x3a')],function(_0x47bda9){return _0x47bda9[_0x02a6('0x3f')][_0x02a6('0x1b')]===_0x02a6('0x40');});}return _0x5f5004[_0x02a6('0x3a')][_0x1b12c6];}else{if(_0x5f5004[_0x02a6('0x41')][_0x02a6('0x3f')][_0x02a6('0x1b')]===_0x02a6('0x40')){logger[_0x02a6('0x33')](_0x02a6('0x3e'));user=_0x5f5004[_0x02a6('0x41')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x5f5004));throw new Error(_0x02a6('0x42')+JSON[_0x02a6('0x43')](_0x5f5004));}}}else{logger[_0x02a6('0x44')]('The\x20failing\x20result\x20is',JSON[_0x02a6('0x43')](_0x5f5004));throw new Error(_0x02a6('0x42')+JSON[_0x02a6('0x43')](_0x5f5004));}})[_0x02a6('0x31')](function(_0x2a7b3b){console[_0x02a6('0x44')](_0x2a7b3b);});}function getZohoUser(_0x4d0a72,_0x1d9dee){return new BPromise(function(_0x23b330,_0x71d2e0){request(_0x4d0a72)[_0x02a6('0x2e')](function(_0x35fddb){var _0x39e9d7=null;if(_0x35fddb){_0x39e9d7=_0x35fddb[_0x02a6('0x45')][0x0];_0x39e9d7[_0x02a6('0x46')]=_0x1d9dee;}_0x23b330(_0x39e9d7);})[_0x02a6('0x31')](function(_0x10a613){_0x71d2e0(_0x10a613);});});}function createEndUser(_0x5cf3e8,_0x869172,_0x1d7b1f,_0x1285ff,_0x1cd3ff,_0x5027a4){var _0x1d7b1f=getName(_0x1d7b1f);return request({'method':_0x02a6('0x28'),'uri':_0x02a6('0x47')+_0x869172+_0x02a6('0x48')+_[_0x02a6('0x49')](_0x5027a4[_0x02a6('0x4a')])+'s','body':{'data':[{'Last_Name':_0x1d7b1f[0x1],'First_Name':_0x1d7b1f[0x0],'Phone':_0x1285ff,'Owner':{'name':!_['isNil'](_0x1cd3ff[_0x02a6('0x4b')][_0x02a6('0x1b')])?_0x1cd3ff[_0x02a6('0x4b')][_0x02a6('0x1b')]:!_[_0x02a6('0x1e')](_0x1cd3ff[_0x02a6('0x4c')])?_0x1cd3ff[_0x02a6('0x4c')]+'\x20'+_0x1cd3ff[_0x02a6('0x4d')]:_0x1cd3ff[_0x02a6('0x4d')],'id':_0x1cd3ff['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5cf3e8},'json':!![]})[_0x02a6('0x2e')](function(_0x5e9671){if(_0x5e9671&&_0x5e9671[_0x02a6('0x45')][0x0]['code']===_0x02a6('0x4e')){var _0x50f619=_0x5e9671[_0x02a6('0x45')][0x0]['details'];_0x50f619[_0x02a6('0x46')]=_[_0x02a6('0x49')](_0x5027a4[_0x02a6('0x4a')])+'s';return _0x50f619;}logger[_0x02a6('0x44')]('The\x20failing\x20result\x20is',JSON[_0x02a6('0x43')](data));throw new Error(_0x02a6('0x4f')+JSON[_0x02a6('0x43')](data));})[_0x02a6('0x31')](function(_0x331581){console[_0x02a6('0x50')](_0x02a6('0x51'),_0x331581);});}function getEndUser(_0x90e0e9,_0x44f56d,_0x1735cf,_0x1bfad5,_0x3259fe,_0x94f5fb,_0x27dfd4){var _0x207175={'method':_0x02a6('0x35'),'uri':'','headers':{'Authorization':_0x02a6('0x39')+_0x90e0e9},'json':!![]};switch(_0x27dfd4['moduleSearch']){case _0x02a6('0x52'):_0x207175[_0x02a6('0x53')]='https://www.zohoapis.'+_0x44f56d+_0x02a6('0x54')+_0x3259fe+'))';return getZohoUser(_0x207175,'Contacts')[_0x02a6('0x2e')](function(_0x3c60ec){if(_0x3c60ec)return _0x3c60ec;_0x207175[_0x02a6('0x53')]=_0x02a6('0x47')+_0x44f56d+_0x02a6('0x55')+_0x3259fe+'))';return getZohoUser(_0x207175,'Leads')[_0x02a6('0x2e')](function(_0x3642fd){if(_0x3642fd)return _0x3642fd;if(_0x27dfd4['moduleCreate']!=_0x02a6('0x56')){return createEndUser(_0x90e0e9,_0x44f56d,_0x1bfad5,_0x3259fe,_0x94f5fb,_0x27dfd4);}else{return{};}});});break;case _0x02a6('0x57'):_0x207175[_0x02a6('0x53')]='https://www.zohoapis.'+_0x44f56d+_0x02a6('0x54')+_0x3259fe+'))';return getZohoUser(_0x207175,_0x02a6('0x58'))['then'](function(_0x20ea87){if(_0x20ea87)return _0x20ea87;if(_0x27dfd4['moduleCreate']!=_0x02a6('0x56')){return createEndUser(_0x90e0e9,_0x44f56d,_0x1bfad5,_0x3259fe,_0x94f5fb,_0x27dfd4);}else{return{};}});break;case'lead':_0x207175[_0x02a6('0x53')]=_0x02a6('0x47')+_0x44f56d+_0x02a6('0x55')+_0x3259fe+'))';return getZohoUser(_0x207175,_0x02a6('0x59'))['then'](function(_0x12f383){if(_0x12f383)return _0x12f383;if(_0x27dfd4['moduleCreate']!=_0x02a6('0x56')){return createEndUser(_0x90e0e9,_0x44f56d,_0x1bfad5,_0x3259fe,_0x94f5fb,_0x27dfd4);}else{return{};}});break;}}function getCall(_0x2f4482,_0x3475b5,_0x32d477,_0x1eff89,_0x5c2368,_0x3cbe83,_0x2a39fe,_0x328401){logger[_0x02a6('0x33')](_0x02a6('0x5a'));var _0x4ef01e={};_0x4ef01e[_0x02a6('0x5b')]={'name':!_[_0x02a6('0x1e')](_0x1eff89[_0x02a6('0x4b')][_0x02a6('0x1b')])&&!_['isNil'](_0x1eff89[_0x02a6('0x3f')][_0x02a6('0x1b')])&&_0x1eff89[_0x02a6('0x3f')][_0x02a6('0x1b')]===_0x02a6('0x5c')?_0x1eff89[_0x02a6('0x4b')]['name']:!_['isNil'](_0x1eff89[_0x02a6('0x4c')])?_0x1eff89[_0x02a6('0x4c')]+'\x20'+_0x1eff89[_0x02a6('0x4d')]:_0x1eff89[_0x02a6('0x4d')],'id':_0x1eff89['id']};_0x4ef01e['Subject']=intUtil['getString'](_0x3cbe83['Subjects'],_0x2a39fe,'\x20');_0x4ef01e[_0x02a6('0x5d')]=intUtil[_0x02a6('0x5e')](_0x3cbe83[_0x02a6('0x5f')],_0x2a39fe,'\x0a');if(_0x5c2368[_0x02a6('0x46')]===_0x02a6('0x58')){_0x4ef01e[_0x02a6('0x60')]={'name':!_['isNil'](_0x5c2368['Full_Name'])?_0x5c2368[_0x02a6('0x61')]:!_[_0x02a6('0x1e')](_0x5c2368[_0x02a6('0x62')])?_0x5c2368['First_Name']+'\x20'+_0x5c2368[_0x02a6('0x63')]:_0x5c2368[_0x02a6('0x63')],'id':_0x5c2368['id']};}if(_0x5c2368[_0x02a6('0x46')]==='Leads'){_0x4ef01e[_0x02a6('0x64')]={'name':!_[_0x02a6('0x1e')](_0x5c2368[_0x02a6('0x61')])?_0x5c2368[_0x02a6('0x61')]:!_[_0x02a6('0x1e')](_0x5c2368[_0x02a6('0x62')])?_0x5c2368[_0x02a6('0x62')]+'\x20'+_0x5c2368[_0x02a6('0x63')]:_0x5c2368[_0x02a6('0x63')],'id':_0x5c2368['id']};_0x4ef01e[_0x02a6('0x65')]=_['startCase'](_0x5c2368[_0x02a6('0x46')]);}if(_0x2a39fe[_0x02a6('0x66')]){_0x4ef01e[_0x02a6('0x67')]=moment['utc'](parseInt(_0x2a39fe[_0x02a6('0x66')])*0x3e8)['format'](_0x02a6('0x68'));}else if(_0x2a39fe[_0x02a6('0x69')]&&_0x2a39fe['endtime']){_0x4ef01e[_0x02a6('0x67')]=moment[_0x02a6('0x6a')](moment(_0x2a39fe[_0x02a6('0x6b')],_0x02a6('0x6c'))['diff'](moment(_0x2a39fe[_0x02a6('0x6d')],_0x02a6('0x6c'))))[_0x02a6('0x36')](_0x02a6('0x68'));}switch(_0x2a39fe[_0x02a6('0x6e')]){case _0x02a6('0x6f'):_0x4ef01e[_0x02a6('0x70')]=_0x02a6('0x71');break;case'complete':case _0x02a6('0x72'):_0x4ef01e['Call_Result']='Answered';break;case _0x02a6('0x73'):_0x4ef01e['Call_Result']=_0x02a6('0x74');break;case _0x02a6('0x75'):_0x4ef01e[_0x02a6('0x70')]=_0x02a6('0x76');break;case _0x02a6('0x77'):_0x4ef01e[_0x02a6('0x70')]=_0x02a6('0x78');default:}_0x4ef01e[_0x02a6('0x79')]=(_0x328401==='outbound'?moment(_0x2a39fe['starttime'])['format'](_0x02a6('0x6c')):moment(_0x2a39fe[_0x02a6('0x7a')])[_0x02a6('0x36')](_0x02a6('0x6c')))||moment()[_0x02a6('0x36')](_0x02a6('0x6c'));_0x4ef01e[_0x02a6('0x7b')]=_0x328401||_0x02a6('0x7c');_0x4ef01e=_[_0x02a6('0x7d')](_0x4ef01e,getCustomFields(_0x3cbe83[_0x02a6('0x7e')],_0x2a39fe));return request({'method':_0x02a6('0x28'),'uri':'https://www.zohoapis.'+_0x3475b5+_0x02a6('0x7f'),'headers':{'Authorization':_0x02a6('0x39')+_0x2f4482},'body':{'data':[_0x4ef01e]},'json':!![]})[_0x02a6('0x2e')](function(_0x13f532){if(_0x13f532&&_0x13f532['data'][0x0][_0x02a6('0x80')]==='SUCCESS'){logger[_0x02a6('0x33')](_0x02a6('0x81'));return{'id':_0x13f532[_0x02a6('0x45')][0x0][_0x02a6('0x82')]['id']};}})[_0x02a6('0x31')](function(_0x3114d2){logger[_0x02a6('0x33')](_0x02a6('0x83'),_0x3114d2[_0x02a6('0x84')]);console['log']('err',_0x3114d2);});}exports[_0x02a6('0x85')]=function(_0x319621,_0x3a1252,_0x24360a,_0x4bafe3,_0x3850b3,_0xf70dd7){var _0x32b330,_0x4e068,_0x4a3a9b;_0xf70dd7[_0x02a6('0x86')]=intUtil[_0x02a6('0x87')](_0xf70dd7[_0x02a6('0x86')]);_0xf70dd7[_0x02a6('0x88')]=intUtil[_0x02a6('0x87')](_0xf70dd7[_0x02a6('0x88')]);if(_0x3850b3&&_0x3850b3[_0x02a6('0x89')]){logger['info'](_0x02a6('0x8a'),_0x02a6('0x8b'));_0x3a1252[_0x02a6('0x8c')]=_0xf70dd7[_0x02a6('0x88')]+_0x02a6('0x8d')+_0x3a1252['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x3a1252['uniqueid']);}else{_0x3a1252[_0x02a6('0x8c')]='';}var _0x5d556d=_0xf70dd7['host']==='zoho.eu'?'eu':_0x02a6('0x8e');return getAccessToken(_0xf70dd7)[_0x02a6('0x2e')](function(_0x2a8f36){_0x4a3a9b=_0x2a8f36;return getUser(_0x4a3a9b,_0x5d556d,_0xf70dd7,_0x4bafe3[_0x02a6('0x3d')]);})['then'](function(_0x5ce355){_0x32b330=_0x5ce355;logger[_0x02a6('0x33')](_0x02a6('0x8f'),_0x32b330['id']);return getEndUser(_0x4a3a9b,_0x5d556d,_0xf70dd7,_0x3a1252[_0x02a6('0x90')],_0x3a1252['calleridnum'],_0x32b330,_0x24360a);})[_0x02a6('0x2e')](function(_0x4b98a1){_0x4e068=_0x4b98a1;return getCall(_0x4a3a9b,_0x5d556d,_0xf70dd7,_0x32b330,_0x4e068,_0x24360a,_0x3a1252,_0x02a6('0x7c'));})[_0x02a6('0x2e')](function(_0x441681){if(_0x441681){logger[_0x02a6('0x33')](_0x02a6('0x91'),_0x441681['id']);logger[_0x02a6('0x33')](_0x02a6('0x8a'),_0x02a6('0x92'));emit(util[_0x02a6('0x36')]('user:%s',_0x4bafe3[_0x02a6('0x1b')]),'trigger:browser:url',{'uri':_0x02a6('0x93')+_0xf70dd7[_0x02a6('0x86')]+_0x02a6('0x94')+_0x441681['id']});}})[_0x02a6('0x31')](function(_0x2b79e4){logger[_0x02a6('0x44')]('[QUEUE]',JSON[_0x02a6('0x43')](_0x2b79e4));});};exports[_0x02a6('0x95')]=function(_0x45c1cb,_0x2c82bf,_0x13ef11,_0x1f31b5,_0x2f085d,_0x4a206a,_0x56450c){var _0x5372eb,_0x4ad010,_0x3793b2;_0x4a206a[_0x02a6('0x86')]=intUtil['stripTrailingSlash'](_0x4a206a[_0x02a6('0x86')]);_0x4a206a[_0x02a6('0x88')]=intUtil['stripTrailingSlash'](_0x4a206a[_0x02a6('0x88')]);if(_0x56450c&&_0x56450c[_0x02a6('0x96')]&&_0x56450c[_0x02a6('0x96')]!==_0x02a6('0x97')){logger[_0x02a6('0x33')](_0x02a6('0x98'),_0x02a6('0x8b'));_0x2c82bf['recordingURL']=_0x4a206a[_0x02a6('0x88')]+'/api/voice/recordings/'+_0x2c82bf[_0x02a6('0x99')]+_0x02a6('0x9a')+md5(_0x2c82bf[_0x02a6('0x99')]);}var _0x37bb88=_0x4a206a['host']===_0x02a6('0x9b')?'eu':_0x02a6('0x8e');return getAccessToken(_0x4a206a)[_0x02a6('0x2e')](function(_0x3b3c4e){_0x3793b2=_0x3b3c4e;return getUser(_0x3793b2,_0x37bb88,_0x4a206a,_0x1f31b5[_0x02a6('0x3d')]);})[_0x02a6('0x2e')](function(_0x1b242b){_0x5372eb=_0x1b242b;logger[_0x02a6('0x33')](_0x02a6('0x8f'),_0x5372eb['id']);return getEndUser(_0x3793b2,_0x37bb88,_0x4a206a,_0x2c82bf[_0x02a6('0x9c')],_0x2c82bf[_0x02a6('0x9d')],_0x5372eb,_0x13ef11);})['then'](function(_0x359a29){_0x4ad010=_0x359a29;return getCall(_0x3793b2,_0x37bb88,_0x4a206a,_0x5372eb,_0x4ad010,_0x13ef11,_0x2c82bf,'Outbound');})[_0x02a6('0x2e')](function(_0x34c7a6){if(_0x34c7a6){logger[_0x02a6('0x33')](_0x02a6('0x91'),_0x34c7a6['id']);logger[_0x02a6('0x33')](_0x02a6('0x98'),_0x02a6('0x92'));emit(util[_0x02a6('0x36')](_0x02a6('0x9e'),_0x1f31b5[_0x02a6('0x1b')]),_0x02a6('0x9f'),{'uri':_0x02a6('0x93')+_0x4a206a[_0x02a6('0x86')]+_0x02a6('0x94')+_0x34c7a6['id']});}})[_0x02a6('0x31')](function(_0x4340da){logger[_0x02a6('0x44')](_0x02a6('0x98'),JSON[_0x02a6('0x43')](_0x4340da));});};exports['unmanaged']=function(_0xa11852,_0x3ac17f,_0xab586,_0x18a726,_0xdbaef7,_0x422ad5){var _0x43ae77,_0x576f67,_0x280a8d;_0x422ad5[_0x02a6('0x86')]=intUtil[_0x02a6('0x87')](_0x422ad5[_0x02a6('0x86')]);_0x422ad5[_0x02a6('0x88')]=intUtil[_0x02a6('0x87')](_0x422ad5['serverUrl']);if(_0xdbaef7&&_0xdbaef7[_0x02a6('0x89')]){logger[_0x02a6('0x33')]('['+_0x3ac17f[_0x02a6('0x6e')][_0x02a6('0xa0')]()+']','Recording\x20is\x20enabled!');_0x3ac17f[_0x02a6('0x8c')]=_0x422ad5['serverUrl']+_0x02a6('0x8d')+_0x3ac17f[_0x02a6('0x99')]+_0x02a6('0x9a')+md5(_0x3ac17f['uniqueid']);}else{_0x3ac17f['recordingURL']='';}var _0x276683=_0x422ad5[_0x02a6('0x86')]===_0x02a6('0x9b')?'eu':'com';return getAccessToken(_0x422ad5)[_0x02a6('0x2e')](function(_0x4b8345){_0x280a8d=_0x4b8345;return getUser(_0x280a8d,_0x276683,_0x422ad5);})[_0x02a6('0x2e')](function(_0x1f84b1){_0x43ae77=_0x1f84b1;logger[_0x02a6('0x33')](_0x02a6('0x8f'),_0x43ae77['id']);return getEndUser(_0x280a8d,_0x276683,_0x422ad5,_0x3ac17f[_0x02a6('0x90')],_0x3ac17f[_0x02a6('0xa1')],_0x43ae77,_0xab586);})[_0x02a6('0x2e')](function(_0x19b45a){_0x576f67=_0x19b45a;return getCall(_0x280a8d,_0x276683,_0x422ad5,_0x43ae77,_0x576f67,_0xab586,_0x3ac17f,_0x02a6('0x7c'));})['then'](function(_0x43eb69){if(_0x43eb69){logger[_0x02a6('0x33')](_0x02a6('0x91'),_0x43eb69['id']);}})[_0x02a6('0x31')](function(_0x420504){logger['error']('['+_0x3ac17f[_0x02a6('0x6e')]['toUpperCase']()+']',JSON[_0x02a6('0x43')](_0x420504));});}; \ 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 dcff839..e729cab 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 _0xb6e5=['shelljs','mustache','../../../../config/logger','trigger','data2','Script','render','data3','exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util'];(function(_0x2cea33,_0x44daf6){var _0x4ecc61=function(_0x4157fe){while(--_0x4157fe){_0x2cea33['push'](_0x2cea33['shift']());}};_0x4ecc61(++_0x44daf6);}(_0xb6e5,0x1b2));var _0x5b6e=function(_0x4eeaf0,_0x288378){_0x4eeaf0=_0x4eeaf0-0x0;var _0x47d3db=_0xb6e5[_0x4eeaf0];return _0x47d3db;};'use strict';var util=require(_0x5b6e('0x0'));var sh=require(_0x5b6e('0x1'));var Mustache=require(_0x5b6e('0x2'));var logger=require(_0x5b6e('0x3'))(_0x5b6e('0x4'));exports['exec']=function(_0x15262a,_0x247bee){var _0x74b633=_0x15262a[_0x5b6e('0x5')]?_0x15262a['data2']:_0x5b6e('0x6');var _0x2ec465=_0x15262a['data3']?Mustache[_0x5b6e('0x7')](_0x15262a[_0x5b6e('0x8')],_0x247bee):_0x247bee;sh[_0x5b6e('0x9')](_0x2ec465,function(_0x357733,_0x449137,_0xece097){if(_0x357733!==0x0){logger[_0x5b6e('0xa')](util[_0x5b6e('0xb')](_0x5b6e('0xc'),_0x74b633,_0x2ec465,_0x357733,_0xece097));}else{logger[_0x5b6e('0xd')](util[_0x5b6e('0xb')](_0x5b6e('0xe'),_0x74b633,_0x2ec465,_0x449137));}});}; \ No newline at end of file +var _0xa400=['shelljs','mustache','exec','data2','data3','render','error','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0x43d0d1,_0x558634){var _0xfe7111=function(_0x1c1679){while(--_0x1c1679){_0x43d0d1['push'](_0x43d0d1['shift']());}};_0xfe7111(++_0x558634);}(_0xa400,0xcf));var _0x0a40=function(_0xc60220,_0x1eba66){_0xc60220=_0xc60220-0x0;var _0x1be75c=_0xa400[_0xc60220];return _0x1be75c;};'use strict';var util=require('util');var sh=require(_0x0a40('0x0'));var Mustache=require(_0x0a40('0x1'));var logger=require('../../../../config/logger')('trigger');exports[_0x0a40('0x2')]=function(_0x35ba3f,_0x1a529f){var _0x169bd1=_0x35ba3f[_0x0a40('0x3')]?_0x35ba3f[_0x0a40('0x3')]:'Script';var _0x4a3699=_0x35ba3f[_0x0a40('0x4')]?Mustache[_0x0a40('0x5')](_0x35ba3f[_0x0a40('0x4')],_0x1a529f):_0x1a529f;sh[_0x0a40('0x2')](_0x4a3699,function(_0x1aa9f0,_0x46d642,_0xce56b3){if(_0x1aa9f0!==0x0){logger[_0x0a40('0x6')](util[_0x0a40('0x7')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x169bd1,_0x4a3699,_0x1aa9f0,_0xce56b3));}else{logger['info'](util[_0x0a40('0x7')](_0x0a40('0x8'),_0x169bd1,_0x4a3699,_0x46d642));}});}; \ 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 a3ed523..fed961d 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 _0x7720=['toUpperCase','GET','DELETE','POST','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','data1','then','isNil',',\x20request\x20body:\x20','body','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','lodash','../../../../config/logger','exec','data2','data5','headers','data6','parse','render','error','stack'];(function(_0x2225c2,_0x538702){var _0x4a8ea9=function(_0x421e3a){while(--_0x421e3a){_0x2225c2['push'](_0x2225c2['shift']());}};_0x4a8ea9(++_0x538702);}(_0x7720,0xae));var _0x0772=function(_0x3d04b5,_0x51811e){_0x3d04b5=_0x3d04b5-0x0;var _0x335984=_0x7720[_0x3d04b5];return _0x335984;};'use strict';var rp=require(_0x0772('0x0'));var util=require('util');var _=require(_0x0772('0x1'));var Mustache=require('mustache');var logger=require(_0x0772('0x2'))('trigger');exports[_0x0772('0x3')]=function(_0x337bc3,_0x251095){var _0x29c6d6,_0xcc9728;var _0x27f169={'method':_0x337bc3['data1']['toUpperCase'](),'uri':Mustache['render'](_0x337bc3[_0x0772('0x4')],_0x251095),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x337bc3['data5'])==='number'&&parseInt(_0x337bc3[_0x0772('0x5')])>=0x1&&parseInt(_0x337bc3[_0x0772('0x5')])<=0xa?parseInt(_0x337bc3[_0x0772('0x5')])*0x3e8:0x5*0x3e8};try{_0x27f169[_0x0772('0x6')]=_0x337bc3[_0x0772('0x7')]?JSON[_0x0772('0x8')](Mustache[_0x0772('0x9')](_0x337bc3[_0x0772('0x7')],_0x251095)):{};}catch(_0x2edcae){logger[_0x0772('0xa')](_0x2edcae[_0x0772('0xb')]);}switch(_0x337bc3['data1'][_0x0772('0xc')]()){case _0x0772('0xd'):case _0x0772('0xe'):_0x29c6d6=null;_0x27f169['qs']=_0x251095;break;case _0x0772('0xf'):case'PUT':if(_0x337bc3[_0x0772('0x10')]){try{_0x29c6d6=JSON['parse'](Mustache[_0x0772('0x9')](_0x337bc3[_0x0772('0x10')],_0x251095));_0x27f169['body']=_0x29c6d6;}catch(_0x16df22){logger['error'](_0x16df22[_0x0772('0xb')]);logger[_0x0772('0xa')](_0x0772('0x11'));}}else{_0x29c6d6=_0x251095;_0x27f169['body']=_0x29c6d6;}break;}logger[_0x0772('0x12')](util[_0x0772('0x13')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x337bc3[_0x0772('0x14')],_0x337bc3[_0x0772('0x4')],JSON['stringify'](_0x27f169)));rp(_0x27f169)[_0x0772('0x15')](function(_0x544212){_0x29c6d6=!_[_0x0772('0x16')](_0x29c6d6)?_0x0772('0x17')+_0x29c6d6:'';_0xcc9728=typeof _0x544212[_0x0772('0x18')]==='object'?JSON[_0x0772('0x19')](_0x544212[_0x0772('0x18')]):_0x544212[_0x0772('0x18')];logger[_0x0772('0x12')](util['format'](_0x0772('0x1a'),_0x337bc3[_0x0772('0x14')],_0x337bc3[_0x0772('0x4')],_0x544212[_0x0772('0x1b')],_0xcc9728));})['catch'](function(_0x7c5978){logger['error'](util[_0x0772('0x13')](_0x0772('0x1c'),_0x337bc3[_0x0772('0x14')],_0x337bc3['data2'],_0x7c5978[_0x0772('0x1b')],_0x7c5978[_0x0772('0x1d')],_0x7c5978[_0x0772('0x1e')]));});}; \ No newline at end of file +var _0xb6ee=['toUpperCase','render','data2','number','data5','headers','data6','parse','error','data1','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','format','name','message','util','lodash','mustache','../../../../config/logger','trigger','exec'];(function(_0x1271ec,_0xb178d1){var _0x1f6ed2=function(_0x2c32f3){while(--_0x2c32f3){_0x1271ec['push'](_0x1271ec['shift']());}};_0x1f6ed2(++_0xb178d1);}(_0xb6ee,0x7a));var _0xeb6e=function(_0x37b31d,_0x3151b5){_0x37b31d=_0x37b31d-0x0;var _0x237fa7=_0xb6ee[_0x37b31d];return _0x237fa7;};'use strict';var rp=require('request-promise');var util=require(_0xeb6e('0x0'));var _=require(_0xeb6e('0x1'));var Mustache=require(_0xeb6e('0x2'));var logger=require(_0xeb6e('0x3'))(_0xeb6e('0x4'));exports[_0xeb6e('0x5')]=function(_0x15d1e8,_0x286525){var _0x5c1532,_0x477de0;var _0x45518a={'method':_0x15d1e8['data1'][_0xeb6e('0x6')](),'uri':Mustache[_0xeb6e('0x7')](_0x15d1e8[_0xeb6e('0x8')],_0x286525),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x15d1e8['data5'])===_0xeb6e('0x9')&&parseInt(_0x15d1e8[_0xeb6e('0xa')])>=0x1&&parseInt(_0x15d1e8[_0xeb6e('0xa')])<=0xa?parseInt(_0x15d1e8['data5'])*0x3e8:0x5*0x3e8};try{_0x45518a[_0xeb6e('0xb')]=_0x15d1e8[_0xeb6e('0xc')]?JSON[_0xeb6e('0xd')](Mustache[_0xeb6e('0x7')](_0x15d1e8['data6'],_0x286525)):{};}catch(_0x2282bf){logger[_0xeb6e('0xe')](_0x2282bf['stack']);}switch(_0x15d1e8[_0xeb6e('0xf')][_0xeb6e('0x6')]()){case'GET':case'DELETE':_0x5c1532=null;_0x45518a['qs']=_0x286525;break;case'POST':case'PUT':if(_0x15d1e8[_0xeb6e('0x10')]){try{_0x5c1532=JSON[_0xeb6e('0xd')](Mustache[_0xeb6e('0x7')](_0x15d1e8['data7'],_0x286525));_0x45518a[_0xeb6e('0x11')]=_0x5c1532;}catch(_0x2005c7){logger[_0xeb6e('0xe')](_0x2005c7[_0xeb6e('0x12')]);logger['error'](_0xeb6e('0x13'));}}else{_0x5c1532=_0x286525;_0x45518a[_0xeb6e('0x11')]=_0x5c1532;}break;}logger[_0xeb6e('0x14')](util['format'](_0xeb6e('0x15'),_0x15d1e8[_0xeb6e('0xf')],_0x15d1e8['data2'],JSON[_0xeb6e('0x16')](_0x45518a)));rp(_0x45518a)[_0xeb6e('0x17')](function(_0x1cbe6f){_0x5c1532=!_[_0xeb6e('0x18')](_0x5c1532)?_0xeb6e('0x19')+_0x5c1532:'';_0x477de0=typeof _0x1cbe6f[_0xeb6e('0x11')]==='object'?JSON[_0xeb6e('0x16')](_0x1cbe6f['body']):_0x1cbe6f[_0xeb6e('0x11')];logger[_0xeb6e('0x14')](util['format'](_0xeb6e('0x1a'),_0x15d1e8[_0xeb6e('0xf')],_0x15d1e8[_0xeb6e('0x8')],_0x1cbe6f[_0xeb6e('0x1b')],_0x477de0));})[_0xeb6e('0x1c')](function(_0x420821){logger['error'](util[_0xeb6e('0x1d')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x15d1e8['data1'],_0x15d1e8[_0xeb6e('0x8')],_0x420821['statusCode'],_0x420821[_0xeb6e('0x1e')],_0x420821[_0xeb6e('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 3094a33..bb64b16 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 _0x54f1=['message','result','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x54f1,0x1f2));var _0x154f=function(_0x52be66,_0x3d55a1){_0x52be66=_0x52be66-0x0;var _0x34087a=_0x54f1[_0x52be66];return _0x34087a;};'use strict';var jayson=require(_0x154f('0x0'));var BPromise=require(_0x154f('0x1'));var logger=require(_0x154f('0x2'))(_0x154f('0x3'));var client=jayson[_0x154f('0x4')][_0x154f('0x5')]({'port':0x2329});client[_0x154f('0x6')]=function(_0x4e2d2d,_0x6c4e69){return new BPromise(function(_0x3c617f,_0x50a3db){return client[_0x154f('0x7')](_0x4e2d2d,_0x6c4e69)[_0x154f('0x8')](function(_0x45d0ad){logger[_0x154f('0x9')](_0x154f('0xa'),_0x154f('0x3'),_0x4e2d2d,_0x6c4e69,_0x45d0ad);if(_0x45d0ad[_0x154f('0xb')]){logger[_0x154f('0xb')]('rpc',_0x154f('0x3'),_0x4e2d2d,_0x45d0ad[_0x154f('0xb')]['message'],_0x6c4e69);return _0x50a3db(_0x45d0ad[_0x154f('0xb')][_0x154f('0xc')]);}else{return _0x3c617f(_0x45d0ad[_0x154f('0xd')]);}})['catch'](function(_0x4d1e5c){logger['error']('rpc',_0x154f('0x3'),_0x4e2d2d,_0x4d1e5c,_0x6c4e69);return _0x50a3db(_0x4d1e5c);});});};module[_0x154f('0xe')]=client; \ No newline at end of file +var _0x780c=['message','result','exports','bluebird','routing','http','Request','request','rpc','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x780c,0xfd));var _0xc780=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x780c[_0x5a9c0c];return _0x53c77d;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xc780('0x0'));var logger=require('../../config/logger')(_0xc780('0x1'));var client=jayson['client'][_0xc780('0x2')]({'port':0x2329});client[_0xc780('0x3')]=function(_0x15b4ea,_0x435419){return new BPromise(function(_0x5d09ff,_0x53c792){return client[_0xc780('0x4')](_0x15b4ea,_0x435419)['then'](function(_0x438b61){logger['debug'](_0xc780('0x5'),_0xc780('0x1'),_0x15b4ea,_0x435419,_0x438b61);if(_0x438b61[_0xc780('0x6')]){logger['error'](_0xc780('0x5'),'routing',_0x15b4ea,_0x438b61[_0xc780('0x6')][_0xc780('0x7')],_0x435419);return _0x53c792(_0x438b61[_0xc780('0x6')][_0xc780('0x7')]);}else{return _0x5d09ff(_0x438b61[_0xc780('0x8')]);}})['catch'](function(_0x33db47){logger[_0xc780('0x6')]('rpc',_0xc780('0x1'),_0x15b4ea,_0x33db47,_0x435419);return _0x53c792(_0x33db47);});});};module[_0xc780('0x9')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index cfd57be..51b9bca 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 _0x433e=['catch','error','./server','./realtime','./lib/email','./rpc/mailAccount','../../config/logger','then','getMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency'];(function(_0x272dc8,_0x1f7592){var _0x42602a=function(_0x2e01ff){while(--_0x2e01ff){_0x272dc8['push'](_0x272dc8['shift']());}};_0x42602a(++_0x1f7592);}(_0x433e,0x13a));var _0xe433=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x433e[_0x20a584];return _0x4b41a8;};'use strict';var server=require(_0xe433('0x0'));var Realtime=require(_0xe433('0x1'));var EmailChannel=require(_0xe433('0x2'));var mailAccount=require(_0xe433('0x3'));var setting=require('./rpc/setting');var logger=require(_0xe433('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0xe433('0x5')](mailAccount[_0xe433('0x6')]())[_0xe433('0x5')](realtime['initMailAccounts']())[_0xe433('0x5')](function(){email['refresh'](realtime[_0xe433('0x7')]);return realtime;});}function main(){return server[_0xe433('0x8')](realtime,email)[_0xe433('0x5')](function(){return initRealtime();})['then'](function(){return setting[_0xe433('0x9')]();})[_0xe433('0x5')](function(_0xf8c825){return setInterval(initRealtime,_0xf8c825[_0xe433('0xa')]*0x3e8);})[_0xe433('0xb')](function(_0x5be2e8){logger[_0xe433('0xc')]('Email\x20service\x20initialization',_0x5be2e8);});}main(); \ No newline at end of file +var _0xbbd3=['./lib/email','email','resolve','then','getMailAccounts','initMailAccounts','refresh','listen','loginMailFrequency','catch','error','Email\x20service\x20initialization','./realtime'];(function(_0x5a8b43,_0x41a0aa){var _0x383129=function(_0x40ae38){while(--_0x40ae38){_0x5a8b43['push'](_0x5a8b43['shift']());}};_0x383129(++_0x41a0aa);}(_0xbbd3,0x19f));var _0x3bbd=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xbbd3[_0x9c2427];return _0x51984f;};'use strict';var server=require('./server');var Realtime=require(_0x3bbd('0x0'));var EmailChannel=require(_0x3bbd('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var logger=require('../../config/logger')(_0x3bbd('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x3bbd('0x3')]()[_0x3bbd('0x4')](mailAccount[_0x3bbd('0x5')]())[_0x3bbd('0x4')](realtime[_0x3bbd('0x6')]())[_0x3bbd('0x4')](function(){email[_0x3bbd('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x3bbd('0x8')](realtime,email)[_0x3bbd('0x4')](function(){return initRealtime();})[_0x3bbd('0x4')](function(){return setting['getSettings']();})[_0x3bbd('0x4')](function(_0x4e8ef4){return setInterval(initRealtime,_0x4e8ef4[_0x3bbd('0x9')]*0x3e8);})[_0x3bbd('0xa')](function(_0x4223e1){logger[_0x3bbd('0xb')](_0x3bbd('0xc'),_0x4223e1);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index e5ab38c..833fb71 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 _0x2b3e=['lastSync','sendMail','verifySmtp','Smtp','verify','then','verified','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','emit','key','active','Imap','stringify','mailAccount:update','prototype','refresh','hasOwnProperty','provider','custom','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','isNil','status','disabled','messageStatus','handleImapBox','connected','name','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch'];(function(_0x5cec1e,_0x4c67ff){var _0x551158=function(_0xdb5313){while(--_0xdb5313){_0x5cec1e['push'](_0x5cec1e['shift']());}};_0x551158(++_0x4c67ff);}(_0x2b3e,0x7b));var _0xe2b3=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x2b3e[_0x3054be];return _0x3df150;};'use strict';var _=require(_0xe2b3('0x0'));var moment=require('moment');var BPromise=require(_0xe2b3('0x1'));var md5=require(_0xe2b3('0x2'));var Redis=require(_0xe2b3('0x3'));var config=require(_0xe2b3('0x4'));var logger=require(_0xe2b3('0x5'))(_0xe2b3('0x6'));config[_0xe2b3('0x7')]=_['defaults'](config[_0xe2b3('0x7')],{'host':_0xe2b3('0x8'),'port':0x18eb});var io=require(_0xe2b3('0x9'))(new Redis(config[_0xe2b3('0x7')]));var EmailImap=require(_0xe2b3('0xa'));var EmailSmtp=require(_0xe2b3('0xb'));var mailAccount=require(_0xe2b3('0xc'));var md5Accounts={};function EmailChannel(_0x3e58fb){logger[_0xe2b3('0xd')]('start\x20email\x20channel');this[_0xe2b3('0xe')]=_0x3e58fb[_0xe2b3('0xe')];this[_0xe2b3('0xf')]={};this[_0xe2b3('0x10')]=new EmailSmtp();}EmailChannel['prototype'][_0xe2b3('0x11')]=function(_0x2f1f14){var _0x17b3b4=this[_0xe2b3('0xe')][_0x2f1f14];var _0x139d31={'id':_0x17b3b4['id'],'name':_0x17b3b4['name'],'key':_0x17b3b4[_0xe2b3('0x12')],'active':_0x17b3b4[_0xe2b3('0x13')],'Imap':{'status':_0x17b3b4[_0xe2b3('0x14')]['status'],'messageStatus':_0x17b3b4[_0xe2b3('0x14')]['messageStatus'],'total':_0x17b3b4[_0xe2b3('0x14')]['total']}};if(_['isNil'](md5Accounts[_0x2f1f14])){md5Accounts[_0x2f1f14]={};}var _0x599e49=md5(JSON[_0xe2b3('0x15')](_0x139d31));if(md5Accounts[_0x2f1f14][_0xe2b3('0x2')]!==_0x599e49){md5Accounts[_0x2f1f14]['md5']=_0x599e49;io[_0xe2b3('0x11')](_0xe2b3('0x16'),_0x139d31);}};EmailChannel[_0xe2b3('0x17')][_0xe2b3('0x18')]=function(_0x4cdf04){for(var _0x44dfb0 in _0x4cdf04){if(_0x4cdf04[_0xe2b3('0x19')](_0x44dfb0)){if(_0x4cdf04[_0x44dfb0][_0xe2b3('0x14')]&&_0x4cdf04[_0x44dfb0]['active']){var _0x3af8b1=_0x4cdf04[_0x44dfb0][_0xe2b3('0x14')];if(!_0x3af8b1['service']&&_0x4cdf04[_0x44dfb0][_0xe2b3('0x1a')]!==_0xe2b3('0x1b'))_0x3af8b1['service']=_0x4cdf04[_0x44dfb0]['provider'];if(!this[_0xe2b3('0xf')][_0xe2b3('0x19')](_0x3af8b1['id'])){this['imapAccounts'][_0x3af8b1['id']]=new EmailImap(_0x3af8b1,_0x4cdf04[_0x44dfb0][_0xe2b3('0x6')]);this[_0xe2b3('0xf')][_0x3af8b1['id']]['on'](_0xe2b3('0x1c'),this['handleImapBox'][_0xe2b3('0x1d')](this,_0x44dfb0));this[_0xe2b3('0xf')][_0x3af8b1['id']]['on'](_0xe2b3('0x6'),this[_0xe2b3('0x1e')][_0xe2b3('0x1d')](this,_0x44dfb0));this[_0xe2b3('0xf')][_0x3af8b1['id']]['on'](_0xe2b3('0x1f'),this[_0xe2b3('0x20')]['bind'](this,_0x44dfb0));this[_0xe2b3('0xf')][_0x3af8b1['id']]['on'](_0xe2b3('0x21'),this[_0xe2b3('0x22')]['bind'](this,_0x44dfb0));}}else{if(_[_0xe2b3('0x23')](this[_0xe2b3('0xe')][_0x44dfb0][_0xe2b3('0x14')])){this['mailAccounts'][_0x44dfb0][_0xe2b3('0x14')]={};}this[_0xe2b3('0xe')][_0x44dfb0]['Imap'][_0xe2b3('0x24')]=_0xe2b3('0x25');this[_0xe2b3('0xe')][_0x44dfb0][_0xe2b3('0x14')][_0xe2b3('0x26')]='';this[_0xe2b3('0x11')](_0x44dfb0);}}}};EmailChannel['prototype'][_0xe2b3('0x27')]=function(_0x224e10,_0x22279f){if(this[_0xe2b3('0xe')][_0x224e10]){this[_0xe2b3('0xe')][_0x224e10][_0xe2b3('0x14')][_0xe2b3('0x24')]=_0xe2b3('0x28');this['mailAccounts'][_0x224e10][_0xe2b3('0x14')][_0xe2b3('0x26')]=_0x22279f[_0xe2b3('0x29')];if(_0x22279f[_0xe2b3('0x2a')]){this[_0xe2b3('0xe')][_0x224e10]['Imap'][_0xe2b3('0x2b')]=_0x22279f[_0xe2b3('0x2a')]['total'];}return this[_0xe2b3('0x11')](_0x224e10);}};EmailChannel[_0xe2b3('0x17')][_0xe2b3('0x1e')]=function(_0x492d47,_0xe46539){logger[_0xe2b3('0xd')](_0xe2b3('0x2c'),_0xe46539[_0xe2b3('0x2d')],_0xe46539[_0xe2b3('0x2e')],_0xe46539[_0xe2b3('0x2f')],_0x492d47);if(this[_0xe2b3('0xe')][_0x492d47]){return mailAccount[_0xe2b3('0x30')](_0x492d47,_0xe46539)['then'](function(_0x6b0b7){if(_0x6b0b7){logger[_0xe2b3('0xd')](_0xe2b3('0x31'));}})[_0xe2b3('0x32')](function(_0x16fcfa){logger[_0xe2b3('0x21')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xe2b3('0x15')](_0x16fcfa));});}};EmailChannel['prototype'][_0xe2b3('0x20')]=function(_0x1346bb){if(this[_0xe2b3('0xe')][_0x1346bb]&&this[_0xe2b3('0xe')][_0x1346bb][_0xe2b3('0x14')]){if(this[_0xe2b3('0xf')][this[_0xe2b3('0xe')][_0x1346bb][_0xe2b3('0x14')]['id']]){delete this['imapAccounts'][this[_0xe2b3('0xe')][_0x1346bb][_0xe2b3('0x14')]['id']];}this[_0xe2b3('0xe')][_0x1346bb][_0xe2b3('0x14')][_0xe2b3('0x33')]=moment();this[_0xe2b3('0x11')](_0x1346bb);}};EmailChannel[_0xe2b3('0x17')][_0xe2b3('0x22')]=function(_0x29c1ae,_0x189ef3){if(this[_0xe2b3('0xe')][_0x29c1ae]){this[_0xe2b3('0xe')][_0x29c1ae][_0xe2b3('0x14')]['status']='error';this['mailAccounts'][_0x29c1ae]['Imap'][_0xe2b3('0x26')]=_0x189ef3;return this['emit'](_0x29c1ae);}};EmailChannel[_0xe2b3('0x17')][_0xe2b3('0x34')]=function(_0x55d8b6,_0x427064){return this[_0xe2b3('0x10')]['send'](_0x55d8b6,_0x427064);};EmailChannel[_0xe2b3('0x17')][_0xe2b3('0x35')]=function(_0x5a5ab9){var _0x3f0044=this;if(this[_0xe2b3('0xe')][_0x5a5ab9['id']]){if(_[_0xe2b3('0x23')](this['mailAccounts'][_0x5a5ab9['id']]['Smtp'])){this[_0xe2b3('0xe')][_0x5a5ab9['id']][_0xe2b3('0x36')]={};}this['mailAccounts'][_0x5a5ab9['id']][_0xe2b3('0x36')][_0xe2b3('0x33')]=moment();return new BPromise(function(_0x23d766,_0x561425){return _0x3f0044['smtp'][_0xe2b3('0x37')](_0x5a5ab9)[_0xe2b3('0x38')](function(_0x3e774b){_0x3f0044[_0xe2b3('0xe')][_0x5a5ab9['id']][_0xe2b3('0x36')][_0xe2b3('0x24')]=_0xe2b3('0x39');_0x3f0044[_0xe2b3('0xe')][_0x5a5ab9['id']][_0xe2b3('0x36')]['messageStatus']='';_0x3f0044[_0xe2b3('0x11')](_0x5a5ab9['id']);_0x23d766(_0x3e774b);})['catch'](function(_0x22a59e){_0x3f0044['mailAccounts'][_0x5a5ab9['id']][_0xe2b3('0x36')][_0xe2b3('0x24')]='error';_0x3f0044[_0xe2b3('0xe')][_0x5a5ab9['id']][_0xe2b3('0x36')][_0xe2b3('0x26')]=_0x22a59e;_0x3f0044[_0xe2b3('0x11')](_0x5a5ab9['id']);_0x561425(_0x22a59e);});});}return this[_0xe2b3('0x10')][_0xe2b3('0x37')](_0x5a5ab9);};module['exports']=EmailChannel; \ No newline at end of file +var _0xca28=['mailAccounts','imapAccounts','smtp','emit','name','key','active','status','Imap','messageStatus','total','isNil','stringify','md5','mailAccount:update','prototype','hasOwnProperty','service','provider','custom','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail','send','Smtp','verify','verified','exports','bluebird','ioredis','../../../config/logger','email','redis','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel'];(function(_0x5d3abb,_0x41852f){var _0x298e72=function(_0x47a746){while(--_0x47a746){_0x5d3abb['push'](_0x5d3abb['shift']());}};_0x298e72(++_0x41852f);}(_0xca28,0x66));var _0x8ca2=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xca28[_0x334841];return _0x5beb4b;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x8ca2('0x0'));var md5=require('md5');var Redis=require(_0x8ca2('0x1'));var config=require('../../../config/environment');var logger=require(_0x8ca2('0x2'))(_0x8ca2('0x3'));config['redis']=_['defaults'](config[_0x8ca2('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x8ca2('0x5'))(new Redis(config[_0x8ca2('0x4')]));var EmailImap=require(_0x8ca2('0x6'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x8ca2('0x7'));var md5Accounts={};function EmailChannel(_0x1949c9){logger[_0x8ca2('0x8')](_0x8ca2('0x9'));this['mailAccounts']=_0x1949c9[_0x8ca2('0xa')];this[_0x8ca2('0xb')]={};this[_0x8ca2('0xc')]=new EmailSmtp();}EmailChannel['prototype'][_0x8ca2('0xd')]=function(_0x328da9){var _0x4b81c8=this['mailAccounts'][_0x328da9];var _0x29f4d3={'id':_0x4b81c8['id'],'name':_0x4b81c8[_0x8ca2('0xe')],'key':_0x4b81c8[_0x8ca2('0xf')],'active':_0x4b81c8[_0x8ca2('0x10')],'Imap':{'status':_0x4b81c8['Imap'][_0x8ca2('0x11')],'messageStatus':_0x4b81c8[_0x8ca2('0x12')][_0x8ca2('0x13')],'total':_0x4b81c8[_0x8ca2('0x12')][_0x8ca2('0x14')]}};if(_[_0x8ca2('0x15')](md5Accounts[_0x328da9])){md5Accounts[_0x328da9]={};}var _0x38619a=md5(JSON[_0x8ca2('0x16')](_0x29f4d3));if(md5Accounts[_0x328da9][_0x8ca2('0x17')]!==_0x38619a){md5Accounts[_0x328da9][_0x8ca2('0x17')]=_0x38619a;io['emit'](_0x8ca2('0x18'),_0x29f4d3);}};EmailChannel[_0x8ca2('0x19')]['refresh']=function(_0x450f56){for(var _0x3a58c4 in _0x450f56){if(_0x450f56[_0x8ca2('0x1a')](_0x3a58c4)){if(_0x450f56[_0x3a58c4][_0x8ca2('0x12')]&&_0x450f56[_0x3a58c4]['active']){var _0x48867a=_0x450f56[_0x3a58c4][_0x8ca2('0x12')];if(!_0x48867a[_0x8ca2('0x1b')]&&_0x450f56[_0x3a58c4][_0x8ca2('0x1c')]!==_0x8ca2('0x1d'))_0x48867a[_0x8ca2('0x1b')]=_0x450f56[_0x3a58c4][_0x8ca2('0x1c')];if(!this['imapAccounts'][_0x8ca2('0x1a')](_0x48867a['id'])){this[_0x8ca2('0xb')][_0x48867a['id']]=new EmailImap(_0x48867a,_0x450f56[_0x3a58c4]['email']);this['imapAccounts'][_0x48867a['id']]['on'](_0x8ca2('0x1e'),this[_0x8ca2('0x1f')][_0x8ca2('0x20')](this,_0x3a58c4));this[_0x8ca2('0xb')][_0x48867a['id']]['on'](_0x8ca2('0x3'),this[_0x8ca2('0x21')][_0x8ca2('0x20')](this,_0x3a58c4));this[_0x8ca2('0xb')][_0x48867a['id']]['on'](_0x8ca2('0x22'),this[_0x8ca2('0x23')][_0x8ca2('0x20')](this,_0x3a58c4));this[_0x8ca2('0xb')][_0x48867a['id']]['on'](_0x8ca2('0x24'),this['handleImapError'][_0x8ca2('0x20')](this,_0x3a58c4));}}else{if(_[_0x8ca2('0x15')](this['mailAccounts'][_0x3a58c4][_0x8ca2('0x12')])){this['mailAccounts'][_0x3a58c4][_0x8ca2('0x12')]={};}this[_0x8ca2('0xa')][_0x3a58c4][_0x8ca2('0x12')][_0x8ca2('0x11')]=_0x8ca2('0x25');this[_0x8ca2('0xa')][_0x3a58c4][_0x8ca2('0x12')][_0x8ca2('0x13')]='';this[_0x8ca2('0xd')](_0x3a58c4);}}}};EmailChannel[_0x8ca2('0x19')][_0x8ca2('0x1f')]=function(_0xd10934,_0x43e35f){if(this[_0x8ca2('0xa')][_0xd10934]){this[_0x8ca2('0xa')][_0xd10934][_0x8ca2('0x12')][_0x8ca2('0x11')]=_0x8ca2('0x26');this[_0x8ca2('0xa')][_0xd10934][_0x8ca2('0x12')]['messageStatus']=_0x43e35f[_0x8ca2('0xe')];if(_0x43e35f[_0x8ca2('0x27')]){this[_0x8ca2('0xa')][_0xd10934]['Imap']['total']=_0x43e35f[_0x8ca2('0x27')]['total'];}return this[_0x8ca2('0xd')](_0xd10934);}};EmailChannel[_0x8ca2('0x19')]['handleImapEmail']=function(_0x35b167,_0x143705){logger[_0x8ca2('0x8')](_0x8ca2('0x28'),_0x143705[_0x8ca2('0x29')],_0x143705[_0x8ca2('0x2a')],_0x143705['from'],_0x35b167);if(this[_0x8ca2('0xa')][_0x35b167]){return mailAccount[_0x8ca2('0x2b')](_0x35b167,_0x143705)[_0x8ca2('0x2c')](function(_0x39bd75){if(_0x39bd75){logger[_0x8ca2('0x8')](_0x8ca2('0x2d'));}})[_0x8ca2('0x2e')](function(_0x5c84ab){logger[_0x8ca2('0x24')](_0x8ca2('0x2f'),JSON[_0x8ca2('0x16')](_0x5c84ab));});}};EmailChannel['prototype'][_0x8ca2('0x23')]=function(_0x3a099b){if(this[_0x8ca2('0xa')][_0x3a099b]&&this['mailAccounts'][_0x3a099b]['Imap']){if(this['imapAccounts'][this[_0x8ca2('0xa')][_0x3a099b][_0x8ca2('0x12')]['id']]){delete this['imapAccounts'][this[_0x8ca2('0xa')][_0x3a099b][_0x8ca2('0x12')]['id']];}this[_0x8ca2('0xa')][_0x3a099b][_0x8ca2('0x12')][_0x8ca2('0x30')]=moment();this['emit'](_0x3a099b);}};EmailChannel[_0x8ca2('0x19')][_0x8ca2('0x31')]=function(_0x386099,_0x4eefa8){if(this[_0x8ca2('0xa')][_0x386099]){this[_0x8ca2('0xa')][_0x386099][_0x8ca2('0x12')]['status']=_0x8ca2('0x24');this[_0x8ca2('0xa')][_0x386099][_0x8ca2('0x12')][_0x8ca2('0x13')]=_0x4eefa8;return this[_0x8ca2('0xd')](_0x386099);}};EmailChannel[_0x8ca2('0x19')][_0x8ca2('0x32')]=function(_0x217c43,_0x11b203){return this[_0x8ca2('0xc')][_0x8ca2('0x33')](_0x217c43,_0x11b203);};EmailChannel['prototype']['verifySmtp']=function(_0x3668e6){var _0x48c670=this;if(this[_0x8ca2('0xa')][_0x3668e6['id']]){if(_['isNil'](this[_0x8ca2('0xa')][_0x3668e6['id']]['Smtp'])){this[_0x8ca2('0xa')][_0x3668e6['id']]['Smtp']={};}this[_0x8ca2('0xa')][_0x3668e6['id']][_0x8ca2('0x34')]['lastSync']=moment();return new BPromise(function(_0x245855,_0x3b2835){return _0x48c670['smtp'][_0x8ca2('0x35')](_0x3668e6)[_0x8ca2('0x2c')](function(_0x4dbca4){_0x48c670[_0x8ca2('0xa')][_0x3668e6['id']][_0x8ca2('0x34')][_0x8ca2('0x11')]=_0x8ca2('0x36');_0x48c670['mailAccounts'][_0x3668e6['id']][_0x8ca2('0x34')]['messageStatus']='';_0x48c670['emit'](_0x3668e6['id']);_0x245855(_0x4dbca4);})[_0x8ca2('0x2e')](function(_0x53c14a){_0x48c670[_0x8ca2('0xa')][_0x3668e6['id']][_0x8ca2('0x34')][_0x8ca2('0x11')]=_0x8ca2('0x24');_0x48c670[_0x8ca2('0xa')][_0x3668e6['id']][_0x8ca2('0x34')][_0x8ca2('0x13')]=_0x53c14a;_0x48c670[_0x8ca2('0xd')](_0x3668e6['id']);_0x3b2835(_0x53c14a);});});}return this[_0x8ca2('0xc')][_0x8ca2('0x35')](_0x3668e6);};module[_0x8ca2('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 6c1c956..4658fb7 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 _0x1d41=['handleFetchError','handleFetchEnd','closeBox','handleCloseBox','handleFetchMessage','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','simpleParser','iconv','Iconv','events','EventEmitter','email','mailbox','account','getAccount','once','ready','handleReady','bind','end','handleEnd','handleError','connect','prototype','connTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','password','authentication','anonymous@xcally.com','host','port','tls','autotls','openBox','handleOpenBox','emit','box','readUnseen','UNSEEN','handleReadUnseen','length','error'];(function(_0x488b85,_0x10ec23){var _0x59d07d=function(_0x16838b){while(--_0x16838b){_0x488b85['push'](_0x488b85['shift']());}};_0x59d07d(++_0x10ec23);}(_0x1d41,0xc0));var _0x11d4=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x1d41[_0x2ca2d0];return _0x521c23;};'use strict';var _=require(_0x11d4('0x0'));var util=require(_0x11d4('0x1'));var Imap=require(_0x11d4('0x2'));var simpleParser=require('mailparser')[_0x11d4('0x3')];var Iconv=require(_0x11d4('0x4'))[_0x11d4('0x5')];var EventEmitter=require(_0x11d4('0x6'))[_0x11d4('0x7')];var utils=require('./utils');var logger=require('../../../config/logger')(_0x11d4('0x8'));function EmailImap(_0x361dee,_0x4d9c8f){this[_0x11d4('0x9')]=_0x361dee['mailbox'];this[_0x11d4('0xa')]=this[_0x11d4('0xb')](_0x361dee,_0x4d9c8f);this[_0x11d4('0x2')]=new Imap(this['account']);this[_0x11d4('0x2')][_0x11d4('0xc')](_0x11d4('0xd'),this[_0x11d4('0xe')][_0x11d4('0xf')](this));this[_0x11d4('0x2')][_0x11d4('0xc')](_0x11d4('0x10'),this[_0x11d4('0x11')]['bind'](this));this[_0x11d4('0x2')]['on']('error',this[_0x11d4('0x12')]['bind'](this));this[_0x11d4('0x2')][_0x11d4('0x13')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x11d4('0x14')][_0x11d4('0xb')]=function(_0x5c8bbe,_0x27b034){var _0x19eb92={'connTimeout':_0x5c8bbe[_0x11d4('0x15')]?_0x5c8bbe[_0x11d4('0x15')]*0x3e8:0x2710,'authTimeout':_0x5c8bbe['authTimeout']?_0x5c8bbe['authTimeout']*0x3e8:0x1388};if(_0x5c8bbe[_0x11d4('0x16')]){_0x19eb92[_0x11d4('0x17')]=_0x5c8bbe['user'];if(_0x5c8bbe[_0x11d4('0x18')]){_0x19eb92[_0x11d4('0x19')]=utils[_0x11d4('0x1a')](_0x5c8bbe[_0x11d4('0x1b')]['data5'],_0x5c8bbe['user']);}else{_0x19eb92[_0x11d4('0x1c')]=_0x5c8bbe[_0x11d4('0x1c')];}}else{if(_0x5c8bbe[_0x11d4('0x1d')]){_0x19eb92[_0x11d4('0x17')]=_0x5c8bbe['user'];_0x19eb92[_0x11d4('0x1c')]=_0x5c8bbe['password'];}}_0x19eb92[_0x11d4('0x8')]=_0x27b034||_0x5c8bbe[_0x11d4('0x17')]||_0x11d4('0x1e');_0x19eb92[_0x11d4('0x1f')]=_0x5c8bbe[_0x11d4('0x1f')];_0x19eb92['port']=_0x5c8bbe[_0x11d4('0x20')]||0x3e1;if(_0x5c8bbe[_0x11d4('0x21')]){_0x19eb92[_0x11d4('0x21')]=!![];}else{_0x19eb92[_0x11d4('0x21')]=![];_0x19eb92[_0x11d4('0x22')]='required';}return _0x19eb92;};EmailImap[_0x11d4('0x14')][_0x11d4('0xe')]=function(){this[_0x11d4('0x2')][_0x11d4('0x23')](this['mailbox'],![],this['handleOpenBox'][_0x11d4('0xf')](this));};EmailImap[_0x11d4('0x14')][_0x11d4('0x24')]=function(_0x260edb,_0x3ec088){if(_0x260edb){this['handleError'](_0x260edb,!![]);}else{this[_0x11d4('0x25')](_0x11d4('0x26'),_0x3ec088);this[_0x11d4('0x27')]();}};EmailImap[_0x11d4('0x14')]['handleCloseBox']=function(_0x1549f2){if(_0x1549f2){this['handleError'](_0x1549f2,!![]);}else{this['imap'][_0x11d4('0x10')]();}};EmailImap[_0x11d4('0x14')][_0x11d4('0x27')]=function(){this[_0x11d4('0x2')]['search']([_0x11d4('0x28')],this[_0x11d4('0x29')][_0x11d4('0xf')](this));};EmailImap[_0x11d4('0x14')]['handleReadUnseen']=function(_0xfe5bb1,_0xddc96c){if(_0xfe5bb1){this[_0x11d4('0x12')](_0xfe5bb1,!![]);}else{if(_0xddc96c[_0x11d4('0x2a')]){try{var _0x5d047a=this[_0x11d4('0x2')]['fetch'](_0xddc96c,{'bodies':'','markSeen':!![]});_0x5d047a['on']('message',this['handleFetchMessage'][_0x11d4('0xf')](this));_0x5d047a['once'](_0x11d4('0x2b'),this[_0x11d4('0x2c')][_0x11d4('0xf')](this));_0x5d047a['once'](_0x11d4('0x10'),this[_0x11d4('0x2d')][_0x11d4('0xf')](this));}catch(_0x6bcc5d){logger[_0x11d4('0x2b')](_0x6bcc5d);}}else{this['imap'][_0x11d4('0x2e')](!![],this[_0x11d4('0x2f')][_0x11d4('0xf')](this));}}};EmailImap[_0x11d4('0x14')][_0x11d4('0x30')]=function(_0x13ad72){_0x13ad72['on'](_0x11d4('0x31'),this[_0x11d4('0x32')][_0x11d4('0xf')](this));_0x13ad72['once']('attributes',this[_0x11d4('0x33')][_0x11d4('0xf')](this));_0x13ad72[_0x11d4('0xc')](_0x11d4('0x10'),this[_0x11d4('0x34')][_0x11d4('0xf')](this));};EmailImap[_0x11d4('0x14')][_0x11d4('0x32')]=function(_0x3c32a0){simpleParser(_0x3c32a0,{'Iconv':Iconv},this[_0x11d4('0x35')]['bind'](this));};EmailImap[_0x11d4('0x14')][_0x11d4('0x33')]=function(){};EmailImap[_0x11d4('0x14')][_0x11d4('0x34')]=function(){};EmailImap['prototype'][_0x11d4('0x35')]=function(_0x37cf64,_0x4330e8){if(_0x37cf64){logger['error'](_0x37cf64);}else{var _0x494b0a=this;utils['parser'](this['account'],_0x4330e8,function(_0x349018){_0x494b0a[_0x11d4('0x25')](_0x11d4('0x8'),_0x349018);});}};EmailImap[_0x11d4('0x14')]['handleFetchEnd']=function(){this[_0x11d4('0x2')][_0x11d4('0x2e')](!![],this['handleCloseBox']['bind'](this));};EmailImap['prototype'][_0x11d4('0x2c')]=function(_0x135731){this[_0x11d4('0x12')](_0x135731);this['imap'][_0x11d4('0x2e')](!![],this[_0x11d4('0x2f')]['bind'](this));};EmailImap[_0x11d4('0x14')][_0x11d4('0x11')]=function(){this[_0x11d4('0x25')](_0x11d4('0x10'));};EmailImap[_0x11d4('0x14')][_0x11d4('0x12')]=function(_0xce2fe9,_0x3b4cd6){logger[_0x11d4('0x2b')](_0x11d4('0x12'),this[_0x11d4('0xa')][_0x11d4('0x8')],JSON[_0x11d4('0x36')](_0xce2fe9));var _0x534148='';if(_0xce2fe9){if(_0xce2fe9[_0x11d4('0x37')]){_0x534148=_0xce2fe9[_0x11d4('0x37')];}else{for(var _0x2beb95 in _0xce2fe9){if(_0xce2fe9[_0x11d4('0x38')](_0x2beb95)){_0x534148+=_[_0x11d4('0x39')](_0x2beb95)+':\x20'+_0xce2fe9[_0x2beb95]+'\x0a';}}}}if(_0x3b4cd6){this[_0x11d4('0x2')]['end']();}else{this[_0x11d4('0x25')]('error',_0x534148);this['emit'](_0x11d4('0x10'));}};module[_0x11d4('0x3a')]=EmailImap; \ No newline at end of file +var _0x6d29=['handleError','connect','inherits','prototype','user','generateXOAuth2Token','CloudProvider','password','authentication','anonymous@xcally.com','host','port','tls','required','handleReady','openBox','mailbox','handleOpenBox','emit','box','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchError','handleEnd','textCode','hasOwnProperty','upperFirst','exports','lodash','util','mailparser','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','account','getAccount','once','ready','bind','imap','error'];(function(_0x234346,_0x4f31ba){var _0x1550ae=function(_0x553026){while(--_0x553026){_0x234346['push'](_0x234346['shift']());}};_0x1550ae(++_0x4f31ba);}(_0x6d29,0x157));var _0x96d2=function(_0x31a9d1,_0x283ae9){_0x31a9d1=_0x31a9d1-0x0;var _0x127d8e=_0x6d29[_0x31a9d1];return _0x127d8e;};'use strict';var _=require(_0x96d2('0x0'));var util=require(_0x96d2('0x1'));var Imap=require('imap');var simpleParser=require(_0x96d2('0x2'))[_0x96d2('0x3')];var Iconv=require(_0x96d2('0x4'))[_0x96d2('0x5')];var EventEmitter=require('events')[_0x96d2('0x6')];var utils=require(_0x96d2('0x7'));var logger=require(_0x96d2('0x8'))(_0x96d2('0x9'));function EmailImap(_0x4c50de,_0x1fe97a){this['mailbox']=_0x4c50de['mailbox'];this[_0x96d2('0xa')]=this[_0x96d2('0xb')](_0x4c50de,_0x1fe97a);this['imap']=new Imap(this[_0x96d2('0xa')]);this['imap'][_0x96d2('0xc')](_0x96d2('0xd'),this['handleReady'][_0x96d2('0xe')](this));this[_0x96d2('0xf')][_0x96d2('0xc')]('end',this['handleEnd'][_0x96d2('0xe')](this));this[_0x96d2('0xf')]['on'](_0x96d2('0x10'),this[_0x96d2('0x11')]['bind'](this));this['imap'][_0x96d2('0x12')]();}util[_0x96d2('0x13')](EmailImap,EventEmitter);EmailImap[_0x96d2('0x14')][_0x96d2('0xb')]=function(_0x2b6646,_0x212032){var _0x19dca2={'connTimeout':_0x2b6646['connTimeout']?_0x2b6646['connTimeout']*0x3e8:0x2710,'authTimeout':_0x2b6646['authTimeout']?_0x2b6646['authTimeout']*0x3e8:0x1388};if(_0x2b6646['service']){_0x19dca2[_0x96d2('0x15')]=_0x2b6646[_0x96d2('0x15')];if(_0x2b6646['modernAuthentication']){_0x19dca2['xoauth2']=utils[_0x96d2('0x16')](_0x2b6646[_0x96d2('0x17')]['data5'],_0x2b6646[_0x96d2('0x15')]);}else{_0x19dca2[_0x96d2('0x18')]=_0x2b6646['password'];}}else{if(_0x2b6646[_0x96d2('0x19')]){_0x19dca2[_0x96d2('0x15')]=_0x2b6646[_0x96d2('0x15')];_0x19dca2[_0x96d2('0x18')]=_0x2b6646[_0x96d2('0x18')];}}_0x19dca2[_0x96d2('0x9')]=_0x212032||_0x2b6646[_0x96d2('0x15')]||_0x96d2('0x1a');_0x19dca2[_0x96d2('0x1b')]=_0x2b6646[_0x96d2('0x1b')];_0x19dca2[_0x96d2('0x1c')]=_0x2b6646[_0x96d2('0x1c')]||0x3e1;if(_0x2b6646[_0x96d2('0x1d')]){_0x19dca2['tls']=!![];}else{_0x19dca2[_0x96d2('0x1d')]=![];_0x19dca2['autotls']=_0x96d2('0x1e');}return _0x19dca2;};EmailImap[_0x96d2('0x14')][_0x96d2('0x1f')]=function(){this[_0x96d2('0xf')][_0x96d2('0x20')](this[_0x96d2('0x21')],![],this[_0x96d2('0x22')][_0x96d2('0xe')](this));};EmailImap['prototype'][_0x96d2('0x22')]=function(_0x1677ef,_0x94c9f7){if(_0x1677ef){this[_0x96d2('0x11')](_0x1677ef,!![]);}else{this[_0x96d2('0x23')](_0x96d2('0x24'),_0x94c9f7);this[_0x96d2('0x25')]();}};EmailImap[_0x96d2('0x14')][_0x96d2('0x26')]=function(_0x2af47a){if(_0x2af47a){this['handleError'](_0x2af47a,!![]);}else{this[_0x96d2('0xf')][_0x96d2('0x27')]();}};EmailImap[_0x96d2('0x14')]['readUnseen']=function(){this['imap'][_0x96d2('0x28')]([_0x96d2('0x29')],this[_0x96d2('0x2a')]['bind'](this));};EmailImap['prototype'][_0x96d2('0x2a')]=function(_0x452d3f,_0x10495e){if(_0x452d3f){this[_0x96d2('0x11')](_0x452d3f,!![]);}else{if(_0x10495e[_0x96d2('0x2b')]){try{var _0x39f80a=this[_0x96d2('0xf')][_0x96d2('0x2c')](_0x10495e,{'bodies':'','markSeen':!![]});_0x39f80a['on'](_0x96d2('0x2d'),this[_0x96d2('0x2e')][_0x96d2('0xe')](this));_0x39f80a[_0x96d2('0xc')](_0x96d2('0x10'),this['handleFetchError'][_0x96d2('0xe')](this));_0x39f80a[_0x96d2('0xc')]('end',this[_0x96d2('0x2f')][_0x96d2('0xe')](this));}catch(_0x315ef6){logger[_0x96d2('0x10')](_0x315ef6);}}else{this[_0x96d2('0xf')][_0x96d2('0x30')](!![],this[_0x96d2('0x26')][_0x96d2('0xe')](this));}}};EmailImap[_0x96d2('0x14')]['handleFetchMessage']=function(_0x5f46ba){_0x5f46ba['on']('body',this['handleMessageBody']['bind'](this));_0x5f46ba[_0x96d2('0xc')](_0x96d2('0x31'),this[_0x96d2('0x32')][_0x96d2('0xe')](this));_0x5f46ba[_0x96d2('0xc')](_0x96d2('0x27'),this[_0x96d2('0x33')][_0x96d2('0xe')](this));};EmailImap[_0x96d2('0x14')]['handleMessageBody']=function(_0x4be0dd){simpleParser(_0x4be0dd,{'Iconv':Iconv},this['handleSimpleParser'][_0x96d2('0xe')](this));};EmailImap[_0x96d2('0x14')][_0x96d2('0x32')]=function(){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap[_0x96d2('0x14')][_0x96d2('0x34')]=function(_0x2a2941,_0x7f0222){if(_0x2a2941){logger[_0x96d2('0x10')](_0x2a2941);}else{var _0x260d57=this;utils[_0x96d2('0x35')](this[_0x96d2('0xa')],_0x7f0222,function(_0xadfc2d){_0x260d57[_0x96d2('0x23')](_0x96d2('0x9'),_0xadfc2d);});}};EmailImap['prototype'][_0x96d2('0x2f')]=function(){this['imap'][_0x96d2('0x30')](!![],this[_0x96d2('0x26')][_0x96d2('0xe')](this));};EmailImap[_0x96d2('0x14')][_0x96d2('0x36')]=function(_0x1e9a13){this['handleError'](_0x1e9a13);this['imap'][_0x96d2('0x30')](!![],this[_0x96d2('0x26')]['bind'](this));};EmailImap[_0x96d2('0x14')][_0x96d2('0x37')]=function(){this[_0x96d2('0x23')](_0x96d2('0x27'));};EmailImap[_0x96d2('0x14')]['handleError']=function(_0x3cb9a3,_0x12e1ca){logger[_0x96d2('0x10')](_0x96d2('0x11'),this[_0x96d2('0xa')][_0x96d2('0x9')],JSON['stringify'](_0x3cb9a3));var _0x177abf='';if(_0x3cb9a3){if(_0x3cb9a3['textCode']){_0x177abf=_0x3cb9a3[_0x96d2('0x38')];}else{for(var _0x206d6b in _0x3cb9a3){if(_0x3cb9a3[_0x96d2('0x39')](_0x206d6b)){_0x177abf+=_[_0x96d2('0x3a')](_0x206d6b)+':\x20'+_0x3cb9a3[_0x206d6b]+'\x0a';}}}}if(_0x12e1ca){this[_0x96d2('0xf')]['end']();}else{this[_0x96d2('0x23')](_0x96d2('0x10'),_0x177abf);this[_0x96d2('0x23')]('end');}};module[_0x96d2('0x3b')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index a369374..558784a 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 _0x05a7=['createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send'];(function(_0x3974c6,_0x57f0f4){var _0x37db7e=function(_0x256d67){while(--_0x256d67){_0x3974c6['push'](_0x3974c6['shift']());}};_0x37db7e(++_0x57f0f4);}(_0x05a7,0x68));var _0x705a=function(_0xcdf809,_0x2881f0){_0xcdf809=_0xcdf809-0x0;var _0x4d4d70=_0x05a7[_0xcdf809];return _0x4d4d70;};'use strict';var nodemailer=require(_0x705a('0x0'));var inlineBase64=require(_0x705a('0x1'));function EmailSmtp(){}EmailSmtp[_0x705a('0x2')][_0x705a('0x3')]=function(_0xcca65d,_0x5c6e02){return new Promise(function(_0x1ba91d,_0x1bf63d){var _0x502cbf=nodemailer[_0x705a('0x4')](_0xcca65d);_0x502cbf[_0x705a('0x5')](_0x705a('0x6'),inlineBase64());_0x502cbf[_0x705a('0x7')](_0x5c6e02,function(_0x362a45,_0x25a118){if(_0x362a45){_0x1bf63d(_0x362a45[_0x705a('0x8')]());}else{_0x1ba91d(_0x25a118);}});});};EmailSmtp[_0x705a('0x2')][_0x705a('0x9')]=function(_0x35d741){return new Promise(function(_0x503ff3,_0x49120c){var _0x466968=nodemailer['createTransport'](_0x35d741);_0x466968['verify'](function(_0x542546,_0xad76ad){if(_0x542546){_0x49120c(_0x542546[_0x705a('0x8')]());}else{if(_0xad76ad){_0x503ff3(_0xad76ad);}else{_0x49120c(_0x705a('0xa'));}}});});};module[_0x705a('0xb')]=EmailSmtp; \ No newline at end of file +var _0x8b57=['prototype','send','createTransport','compile','sendMail','toString','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64'];(function(_0x1f1ccc,_0x322e45){var _0x404b73=function(_0xfbb781){while(--_0xfbb781){_0x1f1ccc['push'](_0x1f1ccc['shift']());}};_0x404b73(++_0x322e45);}(_0x8b57,0xe4));var _0x78b5=function(_0x17d497,_0x1a6570){_0x17d497=_0x17d497-0x0;var _0x113f0c=_0x8b57[_0x17d497];return _0x113f0c;};'use strict';var nodemailer=require(_0x78b5('0x0'));var inlineBase64=require(_0x78b5('0x1'));function EmailSmtp(){}EmailSmtp[_0x78b5('0x2')][_0x78b5('0x3')]=function(_0x1b348f,_0x56e384){return new Promise(function(_0x542aad,_0xa7ceb9){var _0x3a1c9a=nodemailer[_0x78b5('0x4')](_0x1b348f);_0x3a1c9a['use'](_0x78b5('0x5'),inlineBase64());_0x3a1c9a[_0x78b5('0x6')](_0x56e384,function(_0x5e6da6,_0x26cddb){if(_0x5e6da6){_0xa7ceb9(_0x5e6da6[_0x78b5('0x7')]());}else{_0x542aad(_0x26cddb);}});});};EmailSmtp['prototype']['verify']=function(_0x5b394d){return new Promise(function(_0x56aeab,_0x44da87){var _0x24557f=nodemailer[_0x78b5('0x4')](_0x5b394d);_0x24557f['verify'](function(_0x5b0946,_0x5e2ba8){if(_0x5b0946){_0x44da87(_0x5b0946[_0x78b5('0x7')]());}else{if(_0x5e2ba8){_0x56aeab(_0x5e2ba8);}else{_0x44da87(_0x78b5('0x8'));}}});});};module[_0x78b5('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 e14f18d..af62903 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 _0x0169=['first','BodyHTML','Attachments','Title','Data','

Empty\x20message

','auth=Bearer\x20','utf-8','toString','base64','lodash','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','substring','name','indexOf','split','length','join','Anonymous','isEmpty','html','test','replace','includes','','body','textAsHtml','email','message','originCc','originTo','bcc','attach','type','attachment','format','now','root','server/files/attachments/','writeFileSync','content','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','inReplyTo','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'];(function(_0x4fa6e9,_0x44cbc2){var _0x282a92=function(_0x3f4d74){while(--_0x3f4d74){_0x4fa6e9['push'](_0x4fa6e9['shift']());}};_0x282a92(++_0x44cbc2);}(_0x0169,0x12e));var _0x9016=function(_0x1aad21,_0x58c2fd){_0x1aad21=_0x1aad21-0x0;var _0xcf485f=_0x0169[_0x1aad21];return _0xcf485f;};'use strict';var _=require(_0x9016('0x0'));var moment=require('moment');var random=require(_0x9016('0x1'));var fs=require('fs');var path=require(_0x9016('0x2'));var util=require(_0x9016('0x3'));var tnef=require(_0x9016('0x4'));var logger=require(_0x9016('0x5'))('email');var config=require(_0x9016('0x6'));function getAddress(_0x1487ac){var _0x5715a6=_[_0x9016('0x7')](_0x1487ac[_0x9016('0x8')]);return _0x5715a6&&_0x5715a6[_0x9016('0x9')]?_0x5715a6[_0x9016('0x9')]:_0x9016('0xa')+random[_0x9016('0xb')](0x6)+_0x9016('0xc');}function getFirstName(_0x45dbbd){var _0x74fc56=_[_0x9016('0x7')](_0x45dbbd[_0x9016('0x8')]);if(_0x74fc56&&_0x74fc56['name']){if(_0x74fc56['name']==_0x74fc56[_0x9016('0x9')]){return _0x74fc56['name'][_0x9016('0xd')](0x0,_0x74fc56[_0x9016('0xe')][_0x9016('0xf')]('@'));}var _0x35949b=_0x74fc56[_0x9016('0xe')][_0x9016('0x10')](/\s+/);return _0x35949b[_0x9016('0x11')]>0x1?_0x35949b['slice'](0x0,-0x1)[_0x9016('0x12')]('\x20'):_0x74fc56['name'];}return _0x9016('0x13');}function getLastName(_0x7e3877){var _0xf64b5e=_[_0x9016('0x7')](_0x7e3877[_0x9016('0x8')]);if(_0xf64b5e&&_0xf64b5e[_0x9016('0xe')]){var _0x38628c=_0xf64b5e['name'][_0x9016('0x10')](/\s+/);return _0x38628c[_0x9016('0x11')]>0x1?_0x38628c['pop']():'';}return'';}function getMails(_0x1d896a,_0x4d2303){var _0x45c091='';for(var _0x21d09c=0x0;_0x21d09c<_0x4d2303[_0x9016('0x8')][_0x9016('0x11')];_0x21d09c+=0x1){if(_0x4d2303['value'][_0x21d09c]['address']!==_0x1d896a){if(!_[_0x9016('0x14')](_0x45c091)){_0x45c091+=',';}_0x45c091+=_0x4d2303[_0x9016('0x8')][_0x21d09c][_0x9016('0xe')]||_0x4d2303[_0x9016('0x8')][_0x21d09c][_0x9016('0x9')]||'';_0x45c091+='\x20<';_0x45c091+=_0x4d2303[_0x9016('0x8')][_0x21d09c][_0x9016('0x9')]?_0x4d2303[_0x9016('0x8')][_0x21d09c][_0x9016('0x9')]:_0x9016('0xa')+random['generate'](0x6)+_0x9016('0xc');_0x45c091+='>';}}return _0x45c091;}function parseEmail(_0x1e5b66,_0x472f53,_0x252845){if(_0x472f53[_0x9016('0x15')]){var _0x581819=/)<[^<]*)*<\/script>/gi;while(_0x581819[_0x9016('0x16')](_0x472f53[_0x9016('0x15')])){_0x472f53[_0x9016('0x15')]=_0x472f53['html'][_0x9016('0x17')](_0x581819,'');}if(_0x472f53[_0x9016('0x15')][_0x9016('0x18')](_0x9016('0x19'))){var _0x50b9c5=[];_0x472f53[_0x9016('0x1a')][_0x9016('0x1b')](_0x18bdf7=>{_0x50b9c5[_0x9016('0x1c')](_0x18bdf7[_0x9016('0x1d')]);});var _0x551ee2=/]+>/g;var _0x11b0c7=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x10ef4b=_0x472f53['html']['replace'](_0x11b0c7,'_SRC');var _0x41da36=_0x10ef4b['replace'](_0x551ee2,_0x9016('0x1e'));for(let _0x37dc0b=0x0;_0x37dc0b<_0x50b9c5[_0x9016('0x11')];_0x37dc0b++){var _0x1cc585=_0x41da36[_0x9016('0x17')]('_IMG','\x20[Attachment:\x20'+_0x50b9c5[_0x37dc0b]+_0x9016('0x1f'));_0x41da36=_0x1cc585;}_0x472f53[_0x9016('0x15')]=_0x41da36;}_0x252845[_0x9016('0x20')]=_0x472f53['html'];}else{_0x252845[_0x9016('0x20')]=_0x472f53[_0x9016('0x21')];}if(_0x252845[_0x9016('0x20')]){_0x252845[_0x9016('0x20')]=_0x252845[_0x9016('0x20')]['replace'](/0x0){var _0x247244=[_0x9016('0x31'),'X-Auto-Response-Suppress:\x20All',_0x9016('0x32')];for(var _0x49d731=0x0;_0x49d731<_0x472f53['headerLines'][_0x9016('0x11')];_0x49d731++){var _0x185130=_['indexOf'](_0x247244,_0x472f53['headerLines'][_0x49d731][_0x9016('0x33')]);if(_0x185130>=0x0){_0x252845[_0x9016('0x34')]=!![];}}}return _0x252845;}exports[_0x9016('0x35')]=function(_0xa0c129,_0x32f276,_0x16c938){var _0x30234e={'from':getAddress(_0x32f276[_0x9016('0x36')]),'firstName':getFirstName(_0x32f276[_0x9016('0x36')]),'lastName':getLastName(_0x32f276['from']),'mapKey':_0x9016('0x22'),'message':{'from':getMails(_0xa0c129[_0x9016('0x22')],_0x32f276[_0x9016('0x36')]),'to':_0xa0c129[_0x9016('0x22')],'cc':'','subject':_0x32f276[_0x9016('0x37')]||'','messageId':_0x32f276['messageId'],'inReplyTo':_0x32f276[_0x9016('0x38')],'sentAt':moment(_0x32f276['date'])['format'](_0x9016('0x39')),'attach':![],'attachments':[]}};if(!_0x32f276['html']&&!_0x32f276[_0x9016('0x21')]){var _0x450c1f=_[_0x9016('0x3a')](_0x32f276[_0x9016('0x1a')],{'contentType':_0x9016('0x3b')});if(_0x450c1f[_0x9016('0x11')]){logger[_0x9016('0x3c')](util[_0x9016('0x2a')](_0x9016('0x3d'),_0x32f276['messageId']));tnef[_0x9016('0x3e')](_[_0x9016('0x3f')](_0x450c1f)[_0x9016('0x2f')],function(_0x3bd8e4,_0x20c6b1){if(_0x20c6b1){_0x32f276['html']=_0x20c6b1[_0x9016('0x40')]||'

Empty\x20message

';if(_0x20c6b1['Attachments']){for(var _0x48e75e=0x0;_0x48e75e<_0x20c6b1['Attachments']['length'];_0x48e75e++){var _0x52c485=_0x20c6b1[_0x9016('0x41')][_0x48e75e];_0x30234e['message'][_0x9016('0x1a')][_0x9016('0x1c')]({'filename':_0x52c485[_0x9016('0x42')],'content':Buffer[_0x9016('0x36')](_0x52c485[_0x9016('0x43')])});}}}_0x16c938(parseEmail(_0xa0c129,_0x32f276,_0x30234e));});}else{_0x32f276[_0x9016('0x15')]=_0x9016('0x44');_0x16c938(parseEmail(_0xa0c129,_0x32f276,_0x30234e));}}else{_0x16c938(parseEmail(_0xa0c129,_0x32f276,_0x30234e));}};exports['generateXOAuth2Token']=function(_0x2b82c5,_0x41a2d2){var _0x47d62d=['user='+(_0x41a2d2||''),_0x9016('0x45')+_0x2b82c5,'',''];return Buffer[_0x9016('0x36')](_0x47d62d['join'](''),_0x9016('0x46'))[_0x9016('0x47')](_0x9016('0x48'));}; \ No newline at end of file +var _0x85b5=['email','value','address','generate','name','substring','split','length','slice','join','Anonymous','head','isEmpty','anonymous','@xcally.com','html','test','includes','attachments','push','replace','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','utf-8','toString','base64','moment','path','util','../../../config/logger'];(function(_0x53f56d,_0x5225db){var _0x4e7726=function(_0x1578b0){while(--_0x1578b0){_0x53f56d['push'](_0x53f56d['shift']());}};_0x4e7726(++_0x5225db);}(_0x85b5,0x110));var _0x585b=function(_0x5afec3,_0x255c8c){_0x5afec3=_0x5afec3-0x0;var _0x3b4f7b=_0x85b5[_0x5afec3];return _0x3b4f7b;};'use strict';var _=require('lodash');var moment=require(_0x585b('0x0'));var random=require('randomstring');var fs=require('fs');var path=require(_0x585b('0x1'));var util=require(_0x585b('0x2'));var tnef=require('node-tnef');var logger=require(_0x585b('0x3'))(_0x585b('0x4'));var config=require('../../../config/environment');function getAddress(_0x4df663){var _0x21c2da=_['head'](_0x4df663[_0x585b('0x5')]);return _0x21c2da&&_0x21c2da[_0x585b('0x6')]?_0x21c2da['address']:'anonymous'+random[_0x585b('0x7')](0x6)+'@xcally.com';}function getFirstName(_0x2c84d9){var _0x2b5325=_['head'](_0x2c84d9[_0x585b('0x5')]);if(_0x2b5325&&_0x2b5325['name']){if(_0x2b5325[_0x585b('0x8')]==_0x2b5325['address']){return _0x2b5325['name'][_0x585b('0x9')](0x0,_0x2b5325[_0x585b('0x8')]['indexOf']('@'));}var _0x1a7f33=_0x2b5325[_0x585b('0x8')][_0x585b('0xa')](/\s+/);return _0x1a7f33[_0x585b('0xb')]>0x1?_0x1a7f33[_0x585b('0xc')](0x0,-0x1)[_0x585b('0xd')]('\x20'):_0x2b5325['name'];}return _0x585b('0xe');}function getLastName(_0x202741){var _0x19fead=_[_0x585b('0xf')](_0x202741[_0x585b('0x5')]);if(_0x19fead&&_0x19fead[_0x585b('0x8')]){var _0x15e837=_0x19fead[_0x585b('0x8')][_0x585b('0xa')](/\s+/);return _0x15e837[_0x585b('0xb')]>0x1?_0x15e837['pop']():'';}return'';}function getMails(_0x3856bf,_0x51d106){var _0x234e85='';for(var _0x2b8dbc=0x0;_0x2b8dbc<_0x51d106[_0x585b('0x5')][_0x585b('0xb')];_0x2b8dbc+=0x1){if(_0x51d106[_0x585b('0x5')][_0x2b8dbc]['address']!==_0x3856bf){if(!_[_0x585b('0x10')](_0x234e85)){_0x234e85+=',';}_0x234e85+=_0x51d106[_0x585b('0x5')][_0x2b8dbc][_0x585b('0x8')]||_0x51d106[_0x585b('0x5')][_0x2b8dbc]['address']||'';_0x234e85+='\x20<';_0x234e85+=_0x51d106[_0x585b('0x5')][_0x2b8dbc][_0x585b('0x6')]?_0x51d106[_0x585b('0x5')][_0x2b8dbc][_0x585b('0x6')]:_0x585b('0x11')+random[_0x585b('0x7')](0x6)+_0x585b('0x12');_0x234e85+='>';}}return _0x234e85;}function parseEmail(_0x371674,_0x3f4374,_0x43c7ee){if(_0x3f4374[_0x585b('0x13')]){var _0x119376=/)<[^<]*)*<\/script>/gi;while(_0x119376[_0x585b('0x14')](_0x3f4374[_0x585b('0x13')])){_0x3f4374['html']=_0x3f4374[_0x585b('0x13')]['replace'](_0x119376,'');}if(_0x3f4374[_0x585b('0x13')][_0x585b('0x15')]('{_0x5e8671[_0x585b('0x17')](_0x3aebda['filename']);});var _0x3bb04e=/]+>/g;var _0x9c00c0=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x40a669=_0x3f4374[_0x585b('0x13')][_0x585b('0x18')](_0x9c00c0,'_SRC');var _0x173268=_0x40a669['replace'](_0x3bb04e,_0x585b('0x19'));for(let _0x301fb0=0x0;_0x301fb0<_0x5e8671[_0x585b('0xb')];_0x301fb0++){var _0x19bb00=_0x173268[_0x585b('0x18')](_0x585b('0x19'),_0x585b('0x1a')+_0x5e8671[_0x301fb0]+_0x585b('0x1b'));_0x173268=_0x19bb00;}_0x3f4374['html']=_0x173268;}_0x43c7ee[_0x585b('0x1c')]=_0x3f4374['html'];}else{_0x43c7ee[_0x585b('0x1c')]=_0x3f4374[_0x585b('0x1d')];}if(_0x43c7ee[_0x585b('0x1c')]){_0x43c7ee['body']=_0x43c7ee['body']['replace'](/0x0){var _0x5c288b=[_0x585b('0x2d'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x16bbd1=0x0;_0x16bbd1<_0x3f4374[_0x585b('0x2c')]['length'];_0x16bbd1++){var _0x3e008c=_['indexOf'](_0x5c288b,_0x3f4374[_0x585b('0x2c')][_0x16bbd1][_0x585b('0x2e')]);if(_0x3e008c>=0x0){_0x43c7ee[_0x585b('0x2f')]=!![];}}}return _0x43c7ee;}exports[_0x585b('0x30')]=function(_0x567583,_0x544bd3,_0x320831){var _0x4dab2f={'from':getAddress(_0x544bd3['from']),'firstName':getFirstName(_0x544bd3['from']),'lastName':getLastName(_0x544bd3[_0x585b('0x31')]),'mapKey':_0x585b('0x4'),'message':{'from':getMails(_0x567583[_0x585b('0x4')],_0x544bd3[_0x585b('0x31')]),'to':_0x567583[_0x585b('0x4')],'cc':'','subject':_0x544bd3[_0x585b('0x32')]||'','messageId':_0x544bd3[_0x585b('0x33')],'inReplyTo':_0x544bd3[_0x585b('0x34')],'sentAt':moment(_0x544bd3[_0x585b('0x35')])[_0x585b('0x36')](_0x585b('0x37')),'attach':![],'attachments':[]}};if(!_0x544bd3['html']&&!_0x544bd3[_0x585b('0x1d')]){var _0x12c58e=_[_0x585b('0x38')](_0x544bd3[_0x585b('0x16')],{'contentType':_0x585b('0x39')});if(_0x12c58e[_0x585b('0xb')]){logger[_0x585b('0x3a')](util['format'](_0x585b('0x3b'),_0x544bd3[_0x585b('0x33')]));tnef[_0x585b('0x3c')](_[_0x585b('0x3d')](_0x12c58e)[_0x585b('0x2b')],function(_0x8e1959,_0x608d41){if(_0x608d41){_0x544bd3[_0x585b('0x13')]=_0x608d41['BodyHTML']||_0x585b('0x3e');if(_0x608d41[_0x585b('0x3f')]){for(var _0x22f792=0x0;_0x22f792<_0x608d41['Attachments'][_0x585b('0xb')];_0x22f792++){var _0x484cb2=_0x608d41[_0x585b('0x3f')][_0x22f792];_0x4dab2f[_0x585b('0x1f')][_0x585b('0x16')][_0x585b('0x17')]({'filename':_0x484cb2[_0x585b('0x40')],'content':Buffer[_0x585b('0x31')](_0x484cb2[_0x585b('0x41')])});}}}_0x320831(parseEmail(_0x567583,_0x544bd3,_0x4dab2f));});}else{_0x544bd3[_0x585b('0x13')]='

Empty\x20message

';_0x320831(parseEmail(_0x567583,_0x544bd3,_0x4dab2f));}}else{_0x320831(parseEmail(_0x567583,_0x544bd3,_0x4dab2f));}};exports['generateXOAuth2Token']=function(_0xbba6c0,_0x4c1bf2){var _0x2ef6ff=['user='+(_0x4c1bf2||''),'auth=Bearer\x20'+_0xbba6c0,'',''];return Buffer[_0x585b('0x31')](_0x2ef6ff[_0x585b('0xd')](''),_0x585b('0x42'))[_0x585b('0x43')](_0x585b('0x44'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 6aa61d8..38c23fd 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 _0x507e=['active','Imap','Smtp','name','Service'];(function(_0xaf35a2,_0x394d33){var _0x1a1124=function(_0x59eedc){while(--_0x59eedc){_0xaf35a2['push'](_0xaf35a2['shift']());}};_0x1a1124(++_0x394d33);}(_0x507e,0x157));var _0xe507=function(_0x164760,_0x5874b0){_0x164760=_0x164760-0x0;var _0x8b91b2=_0x507e[_0x164760];return _0x8b91b2;};'use strict';var _=require('lodash');function MailAccount(_0x27ba5b){this['id']=_0x27ba5b['id']||0x0;this[_0xe507('0x0')]=_0x27ba5b[_0xe507('0x0')]||_0xe507('0x1');this['key']=_0x27ba5b['key']||'SERV';this[_0xe507('0x2')]=_0x27ba5b[_0xe507('0x2')]||![];this[_0xe507('0x3')]=_0x27ba5b[_0xe507('0x3')]||[];this[_0xe507('0x4')]=_0x27ba5b['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xdcac=['active','Imap','Smtp','exports','lodash','name','Service','key','SERV'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdcac,0x9d));var _0xcdca=function(_0x582b2d,_0x5e5f2e){_0x582b2d=_0x582b2d-0x0;var _0xe02b84=_0xdcac[_0x582b2d];return _0xe02b84;};'use strict';var _=require(_0xcdca('0x0'));function MailAccount(_0x5dac0a){this['id']=_0x5dac0a['id']||0x0;this[_0xcdca('0x1')]=_0x5dac0a['name']||_0xcdca('0x2');this[_0xcdca('0x3')]=_0x5dac0a[_0xcdca('0x3')]||_0xcdca('0x4');this[_0xcdca('0x5')]=_0x5dac0a[_0xcdca('0x5')]||![];this[_0xcdca('0x6')]=_0x5dac0a[_0xcdca('0x6')]||[];this[_0xcdca('0x7')]=_0x5dac0a[_0xcdca('0x7')]||[];}module[_0xcdca('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index abce524..8dca543 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 _0x8bfd=['mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','../model/mailAccount'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x8bfd,0xdb));var _0xd8bf=function(_0x33ff0c,_0x448c2a){_0x33ff0c=_0x33ff0c-0x0;var _0x44bdc2=_0x8bfd[_0x33ff0c];return _0x44bdc2;};'use strict';var _=require('lodash');var MailAccount=require(_0xd8bf('0x0'));var Realtime=function(){this[_0xd8bf('0x1')]={};};function freeIsNotKey(_0x119044,_0x2ae744,_0x36d795){var _0x377662=_[_0xd8bf('0x2')](_0x119044,function(_0x5c5003,_0xc31dea){return _0x5c5003[_0x36d795];});for(var _0x2a7f9a in _0x2ae744){if(_0x2ae744[_0xd8bf('0x3')](_0x2a7f9a)){if(!_0x377662[_0x2a7f9a]){delete _0x2ae744[_0x2a7f9a];}}}}Realtime[_0xd8bf('0x4')][_0xd8bf('0x5')]=function(_0x86ca3b,_0x4288e2){for(var _0x9b05f7 in _0x4288e2){if(_0x86ca3b[_0xd8bf('0x3')](_0x9b05f7)){_0x86ca3b[_0x9b05f7]=_0x4288e2[_0x9b05f7];}}};Realtime[_0xd8bf('0x4')][_0xd8bf('0x6')]=function(){var _0x788ee8=this;return function(_0x251f32){if(_0x251f32){freeIsNotKey(_0x251f32,_0x788ee8[_0xd8bf('0x1')],'id');for(var _0x4af394=0x0,_0x1078cc={},_0x30659b={};_0x4af394<_0x251f32[_0xd8bf('0x7')];_0x4af394+=0x1){_0x1078cc=_0x251f32[_0x4af394];if(_[_0xd8bf('0x8')](_0x788ee8['mailAccounts'][_0x1078cc['id']])){_0x788ee8[_0xd8bf('0x1')][_0x1078cc['id']]=new MailAccount(_0x1078cc);}else{_[_0xd8bf('0x9')](_0x788ee8['mailAccounts'][_0x1078cc['id']],_0x1078cc);}}}return _0x788ee8[_0xd8bf('0x1')];};};module[_0xd8bf('0xa')]=Realtime; \ No newline at end of file +var _0x22a3=['exports','lodash','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','mailAccounts','merge'];(function(_0x1bb812,_0x23eacc){var _0x372adb=function(_0x5ad456){while(--_0x5ad456){_0x1bb812['push'](_0x1bb812['shift']());}};_0x372adb(++_0x23eacc);}(_0x22a3,0x64));var _0x322a=function(_0x85cb49,_0x50a08a){_0x85cb49=_0x85cb49-0x0;var _0x52f463=_0x22a3[_0x85cb49];return _0x52f463;};'use strict';var _=require(_0x322a('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x327cac,_0x3451ea,_0x508d11){var _0x3c2ebe=_[_0x322a('0x1')](_0x327cac,function(_0x3d8f00,_0x2486cd){return _0x3d8f00[_0x508d11];});for(var _0x1115fe in _0x3451ea){if(_0x3451ea[_0x322a('0x2')](_0x1115fe)){if(!_0x3c2ebe[_0x1115fe]){delete _0x3451ea[_0x1115fe];}}}}Realtime[_0x322a('0x3')][_0x322a('0x4')]=function(_0x2baf30,_0x22d3ae){for(var _0x11e3da in _0x22d3ae){if(_0x2baf30[_0x322a('0x2')](_0x11e3da)){_0x2baf30[_0x11e3da]=_0x22d3ae[_0x11e3da];}}};Realtime['prototype'][_0x322a('0x5')]=function(){var _0x3c60dc=this;return function(_0x198c54){if(_0x198c54){freeIsNotKey(_0x198c54,_0x3c60dc['mailAccounts'],'id');for(var _0x1a1440=0x0,_0x5f1d61={},_0x289534={};_0x1a1440<_0x198c54[_0x322a('0x6')];_0x1a1440+=0x1){_0x5f1d61=_0x198c54[_0x1a1440];if(_[_0x322a('0x7')](_0x3c60dc[_0x322a('0x8')][_0x5f1d61['id']])){_0x3c60dc[_0x322a('0x8')][_0x5f1d61['id']]=new MailAccount(_0x5f1d61);}else{_[_0x322a('0x9')](_0x3c60dc[_0x322a('0x8')][_0x5f1d61['id']],_0x5f1d61);}}}return _0x3c60dc[_0x322a('0x8')];};};module[_0x322a('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 7c42df2..4eb4447 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 _0x9931=['NotifyMailAccount','getMailAccounts','GetMailAccount','name','provider','service','email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','getMailAccount','notify','Request'];(function(_0x58e31b,_0x441684){var _0x4fe9e7=function(_0x5217a9){while(--_0x5217a9){_0x58e31b['push'](_0x58e31b['shift']());}};_0x4fe9e7(++_0x441684);}(_0x9931,0x1b6));var _0x1993=function(_0x2f078c,_0x45806c){_0x2f078c=_0x2f078c-0x0;var _0x57b267=_0x9931[_0x2f078c];return _0x57b267;};'use strict';var client=require('../client');exports[_0x1993('0x0')]=function(){return function(){return client['Request'](_0x1993('0x1'),{'options':{'attributes':['id',_0x1993('0x2'),_0x1993('0x3'),_0x1993('0x4'),_0x1993('0x5'),_0x1993('0x6'),_0x1993('0x7'),_0x1993('0x8'),_0x1993('0x9')],'raw':![],'include':[{'model':_0x1993('0xa'),'as':_0x1993('0xb'),'include':[{'model':_0x1993('0xc'),'attributes':['id',_0x1993('0x2'),_0x1993('0x4'),_0x1993('0xd'),_0x1993('0xe')],'as':_0x1993('0xc')}]},{'model':'MailServerOut','as':'Smtp','include':[{'model':_0x1993('0xc'),'attributes':['id',_0x1993('0x2'),_0x1993('0x4'),_0x1993('0xd'),_0x1993('0xe')],'as':_0x1993('0xc')}]}]},'log':_0x1993('0xf')});};};exports[_0x1993('0x10')]=function(_0x380a5b,_0x19443b){return client[_0x1993('0x11')](_0x1993('0x12'),{'account':{'id':_0x380a5b},'body':_0x19443b,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x7a3e=['active','key','ListId','MailServerIn','Imap','CloudProvider','service','data5','MailServerOut','Smtp','type','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','name','provider'];(function(_0x59079a,_0x53c526){var _0x6857=function(_0x575e94){while(--_0x575e94){_0x59079a['push'](_0x59079a['shift']());}};_0x6857(++_0x53c526);}(_0x7a3e,0x18a));var _0xe7a3=function(_0x49dd1e,_0x1eba54){_0x49dd1e=_0x49dd1e-0x0;var _0x346e40=_0x7a3e[_0x49dd1e];return _0x346e40;};'use strict';var client=require(_0xe7a3('0x0'));exports[_0xe7a3('0x1')]=function(){return function(){return client[_0xe7a3('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0xe7a3('0x3'),_0xe7a3('0x4'),'service','email',_0xe7a3('0x5'),_0xe7a3('0x6'),_0xe7a3('0x7'),'TemplateId'],'raw':![],'include':[{'model':_0xe7a3('0x8'),'as':_0xe7a3('0x9'),'include':[{'model':_0xe7a3('0xa'),'attributes':['id',_0xe7a3('0x3'),_0xe7a3('0xb'),'type',_0xe7a3('0xc')],'as':_0xe7a3('0xa')}]},{'model':_0xe7a3('0xd'),'as':_0xe7a3('0xe'),'include':[{'model':'CloudProvider','attributes':['id',_0xe7a3('0x3'),_0xe7a3('0xb'),_0xe7a3('0xf'),_0xe7a3('0xc')],'as':_0xe7a3('0xa')}]}]},'log':_0xe7a3('0x10')});};};exports[_0xe7a3('0x11')]=function(_0x2906ce,_0x1193c4){return client[_0xe7a3('0x2')](_0xe7a3('0x12'),{'account':{'id':_0x2906ce},'body':_0x1193c4,'log':_0xe7a3('0x12')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 973489a..937e32f 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 _0x9a52=['Request','ShowSetting','loginMailFrequency','../client'];(function(_0x329753,_0x2e8ed4){var _0x129010=function(_0x25bc30){while(--_0x25bc30){_0x329753['push'](_0x329753['shift']());}};_0x129010(++_0x2e8ed4);}(_0x9a52,0x97));var _0x29a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a52[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x29a5('0x0'));exports['getSettings']=function(){return client[_0x29a5('0x1')](_0x29a5('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x29a5('0x3')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x2d2c=['../client','getSettings','Request','ShowSetting','GetSettings'];(function(_0x12de21,_0x1b5f05){var _0x3f02a9=function(_0x34ffee){while(--_0x34ffee){_0x12de21['push'](_0x12de21['shift']());}};_0x3f02a9(++_0x1b5f05);}(_0x2d2c,0xbe));var _0xc2d2=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0x2d2c[_0x1dbaf7];return _0x593f05;};'use strict';var client=require(_0xc2d2('0x0'));exports[_0xc2d2('0x1')]=function(){return client[_0xc2d2('0x2')](_0xc2d2('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xc2d2('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index a895bfa..0a6086c 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_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 +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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 a75aac8..5546644 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 _0xd9b3=['socket.io','redis','defaults','localhost','default','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','http','express','ioredis','createServer','timeout','port'];(function(_0x46af56,_0x4614ae){var _0x5c3dac=function(_0x34e2bf){while(--_0x34e2bf){_0x46af56['push'](_0x46af56['shift']());}};_0x5c3dac(++_0x4614ae);}(_0xd9b3,0xbd));var _0x3d9b=function(_0x209a5b,_0x55f47d){_0x209a5b=_0x209a5b-0x0;var _0x17bd8b=_0xd9b3[_0x209a5b];return _0x17bd8b;};'use strict';var _=require('lodash');var http=require(_0x3d9b('0x0'));var express=require(_0x3d9b('0x1'));var sticky=require('sticky-session');var Redis=require(_0x3d9b('0x2'));var config=require('../../config/environment');var app=express();var server=http[_0x3d9b('0x3')](app);server[_0x3d9b('0x4')]=0xdbba0;if(sticky['listen'](server,config[_0x3d9b('0x5')])){var socketio=require(_0x3d9b('0x6'))(server,{'transports':['websocket','polling']});config[_0x3d9b('0x7')]=_[_0x3d9b('0x8')](config[_0x3d9b('0x7')],{'host':_0x3d9b('0x9'),'port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config[_0x3d9b('0x7')]),'subClient':new Redis(config['redis'])}));require('../../config/triggers')['default']();require('../../config/socketio')[_0x3d9b('0xa')](socketio);require('../../config/express')[_0x3d9b('0xa')](app);require(_0x3d9b('0xb'))[_0x3d9b('0xa')](app);}else{server[_0x3d9b('0xc')](_0x3d9b('0xd'),function(){console['log'](_0x3d9b('0xe'),config[_0x3d9b('0x5')]);});}exports=module['exports']=app; \ No newline at end of file +var _0xa721=['timeout','port','socket.io','websocket','polling','redis','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer'];(function(_0x4acfa7,_0x21db2d){var _0x5a6cdd=function(_0x3c0012){while(--_0x3c0012){_0x4acfa7['push'](_0x4acfa7['shift']());}};_0x5a6cdd(++_0x21db2d);}(_0xa721,0x101));var _0x1a72=function(_0x5084b5,_0x3048d1){_0x5084b5=_0x5084b5-0x0;var _0x2e7c67=_0xa721[_0x5084b5];return _0x2e7c67;};'use strict';var _=require(_0x1a72('0x0'));var http=require(_0x1a72('0x1'));var express=require(_0x1a72('0x2'));var sticky=require(_0x1a72('0x3'));var Redis=require(_0x1a72('0x4'));var config=require(_0x1a72('0x5'));var app=express();var server=http[_0x1a72('0x6')](app);server[_0x1a72('0x7')]=0xdbba0;if(sticky['listen'](server,config[_0x1a72('0x8')])){var socketio=require(_0x1a72('0x9'))(server,{'transports':[_0x1a72('0xa'),_0x1a72('0xb')]});config['redis']=_['defaults'](config[_0x1a72('0xc')],{'host':'localhost','port':0x18eb});socketio[_0x1a72('0xd')](require(_0x1a72('0xe'))({'pubClient':new Redis(config[_0x1a72('0xc')]),'subClient':new Redis(config[_0x1a72('0xc')])}));require(_0x1a72('0xf'))[_0x1a72('0x10')]();require(_0x1a72('0x11'))[_0x1a72('0x10')](socketio);require(_0x1a72('0x12'))[_0x1a72('0x10')](app);require(_0x1a72('0x13'))['default'](app);}else{server['once'](_0x1a72('0x14'),function(){console[_0x1a72('0x15')](_0x1a72('0x16'),config[_0x1a72('0x8')]);});}exports=module[_0x1a72('0x17')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 8e9d8e2..8bc87e0 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 _0x0911=['exports','bluebird','../../config/logger','routing','client','http','request','then','debug','rpc','error','message','result','catch'];(function(_0x56e439,_0x45a057){var _0x43f140=function(_0x311d5c){while(--_0x311d5c){_0x56e439['push'](_0x56e439['shift']());}};_0x43f140(++_0x45a057);}(_0x0911,0xef));var _0x1091=function(_0x16ed87,_0x1be1a2){_0x16ed87=_0x16ed87-0x0;var _0xc1a1d8=_0x0911[_0x16ed87];return _0xc1a1d8;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x1091('0x0'));var logger=require(_0x1091('0x1'))(_0x1091('0x2'));var client=jayson[_0x1091('0x3')][_0x1091('0x4')]({'port':0x2329});client['Request']=function(_0x52c17b,_0x248d27){return new BPromise(function(_0x32383f,_0x15490f){return client[_0x1091('0x5')](_0x52c17b,_0x248d27)[_0x1091('0x6')](function(_0xbd0800){logger[_0x1091('0x7')](_0x1091('0x8'),_0x1091('0x2'),_0x52c17b,_0x248d27,_0xbd0800);if(_0xbd0800[_0x1091('0x9')]){logger[_0x1091('0x9')](_0x1091('0x8'),'routing',_0x52c17b,_0xbd0800[_0x1091('0x9')][_0x1091('0xa')],_0x248d27);return _0x15490f(_0xbd0800[_0x1091('0x9')][_0x1091('0xa')]);}else{return _0x32383f(_0xbd0800[_0x1091('0xb')]);}})[_0x1091('0xc')](function(_0x5e57b0){logger[_0x1091('0x9')](_0x1091('0x8'),_0x1091('0x2'),_0x52c17b,_0x5e57b0,_0x248d27);return _0x15490f(_0x5e57b0);});});};module[_0x1091('0xd')]=client; \ No newline at end of file +var _0x4ef5=['routing','http','Request','request','then','debug','rpc','error','message','result','catch','exports','../../config/logger'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0x4ef5,0x8e));var _0x54ef=function(_0x3d5a9a,_0x4e700c){_0x3d5a9a=_0x3d5a9a-0x0;var _0x42d65c=_0x4ef5[_0x3d5a9a];return _0x42d65c;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x54ef('0x0'))(_0x54ef('0x1'));var client=jayson['client'][_0x54ef('0x2')]({'port':0x2329});client[_0x54ef('0x3')]=function(_0x3828ee,_0x536c15){return new BPromise(function(_0x1648e6,_0x4e5fc1){return client[_0x54ef('0x4')](_0x3828ee,_0x536c15)[_0x54ef('0x5')](function(_0x2a085e){logger[_0x54ef('0x6')](_0x54ef('0x7'),_0x54ef('0x1'),_0x3828ee,_0x536c15,_0x2a085e);if(_0x2a085e['error']){logger[_0x54ef('0x8')](_0x54ef('0x7'),_0x54ef('0x1'),_0x3828ee,_0x2a085e[_0x54ef('0x8')]['message'],_0x536c15);return _0x4e5fc1(_0x2a085e[_0x54ef('0x8')][_0x54ef('0x9')]);}else{return _0x1648e6(_0x2a085e[_0x54ef('0xa')]);}})[_0x54ef('0xb')](function(_0x5628af){logger[_0x54ef('0x8')](_0x54ef('0x7'),'routing',_0x3828ee,_0x5628af,_0x536c15);return _0x4e5fc1(_0x5628af);});});};module[_0x54ef('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index a6ffae3..b8290c8 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 _0xd217=['getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','resolve','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues'];(function(_0x1662d6,_0x2f862c){var _0x1df372=function(_0x14b53e){while(--_0x14b53e){_0x1662d6['push'](_0x1662d6['shift']());}};_0x1df372(++_0x2f862c);}(_0xd217,0x8e));var _0x7d21=function(_0x457e25,_0x1c19f2){_0x457e25=_0x457e25-0x0;var _0x2fc407=_0xd217[_0x457e25];return _0x2fc407;};'use strict';var BPromise=require(_0x7d21('0x0'));var server=require(_0x7d21('0x1'));var Realtime=require(_0x7d21('0x2'));var user=require(_0x7d21('0x3'));var interval=require(_0x7d21('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x7d21('0x5'));var smsQueue=require(_0x7d21('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x7d21('0x7'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x7d21('0x8')]()[_0x7d21('0x9')](user['getAgents']())[_0x7d21('0x9')](realtime[_0x7d21('0xa')]())[_0x7d21('0x9')](interval[_0x7d21('0xb')]())[_0x7d21('0x9')](realtime[_0x7d21('0xc')]())[_0x7d21('0x9')](openchannelQueue[_0x7d21('0xd')]())['then'](realtime['initOpenchannelQueues']())[_0x7d21('0x9')](chatQueue[_0x7d21('0xe')]())[_0x7d21('0x9')](realtime[_0x7d21('0xf')]())[_0x7d21('0x9')](smsQueue[_0x7d21('0x10')]())['then'](realtime[_0x7d21('0x11')]())[_0x7d21('0x9')](mailQueue['getMailQueues']())[_0x7d21('0x9')](realtime[_0x7d21('0x12')]())['then'](faxQueue[_0x7d21('0x13')]())[_0x7d21('0x9')](realtime[_0x7d21('0x14')]())[_0x7d21('0x9')](whatsappQueue[_0x7d21('0x15')]())[_0x7d21('0x9')](realtime[_0x7d21('0x16')]())[_0x7d21('0x9')](function(){return realtime;});}function main(){return server[_0x7d21('0x17')](realtime)[_0x7d21('0x9')](function(_0x259936){return initRealtime();})[_0x7d21('0x9')](function(_0x574056){return setInterval(initRealtime,0x1388);})[_0x7d21('0x18')](function(_0x5be5e3){console[_0x7d21('0x19')](_0x5be5e3);});}main(); \ No newline at end of file +var _0xfada=['initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents'];(function(_0x27ad02,_0x5dcbff){var _0x4cbc84=function(_0x6f5da3){while(--_0x6f5da3){_0x27ad02['push'](_0x27ad02['shift']());}};_0x4cbc84(++_0x5dcbff);}(_0xfada,0xd7));var _0xafad=function(_0x210213,_0x2a1aa6){_0x210213=_0x210213-0x0;var _0x12b438=_0xfada[_0x210213];return _0x12b438;};'use strict';var BPromise=require(_0xafad('0x0'));var server=require('./server');var Realtime=require(_0xafad('0x1'));var user=require(_0xafad('0x2'));var interval=require(_0xafad('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xafad('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xafad('0x5'));var whatsappQueue=require(_0xafad('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xafad('0x7')]()[_0xafad('0x8')](user[_0xafad('0x9')]())[_0xafad('0x8')](realtime[_0xafad('0xa')]())[_0xafad('0x8')](interval[_0xafad('0xb')]())[_0xafad('0x8')](realtime[_0xafad('0xc')]())[_0xafad('0x8')](openchannelQueue[_0xafad('0xd')]())[_0xafad('0x8')](realtime[_0xafad('0xe')]())[_0xafad('0x8')](chatQueue['getChatQueues']())[_0xafad('0x8')](realtime[_0xafad('0xf')]())[_0xafad('0x8')](smsQueue[_0xafad('0x10')]())[_0xafad('0x8')](realtime[_0xafad('0x11')]())[_0xafad('0x8')](mailQueue[_0xafad('0x12')]())['then'](realtime[_0xafad('0x13')]())[_0xafad('0x8')](faxQueue['getFaxQueues']())[_0xafad('0x8')](realtime[_0xafad('0x14')]())[_0xafad('0x8')](whatsappQueue[_0xafad('0x15')]())[_0xafad('0x8')](realtime[_0xafad('0x16')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0xafad('0x8')](function(_0x31d91a){return initRealtime();})[_0xafad('0x8')](function(_0x97e25b){return setInterval(initRealtime,0x1388);})[_0xafad('0x17')](function(_0x150b9b){console[_0xafad('0x18')](_0x150b9b);});}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 c72af10..ba7f250 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0xc7a0cb,_0x389964){var _0x10ce8e=function(_0x3a6dcf){while(--_0x3a6dcf){_0xc7a0cb['push'](_0xc7a0cb['shift']());}};_0x10ce8e(++_0x389964);}(_0x5fc3,0xa8));var _0x35fc=function(_0x401ccd,_0x140815){_0x401ccd=_0x401ccd-0x0;var _0x5a57ad=_0x5fc3[_0x401ccd];return _0x5a57ad;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0x1261[_0x41d432];return _0x1650f9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 295ae8d..d72d7ca 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 _0xa170=['error','message','result','SendMail','bluebird','jayson/promise','client','http','request'];(function(_0x54bb04,_0x3aaec2){var _0xf7a4f4=function(_0x352481){while(--_0x352481){_0x54bb04['push'](_0x54bb04['shift']());}};_0xf7a4f4(++_0x3aaec2);}(_0xa170,0x1ab));var _0x0a17=function(_0x329735,_0x463550){_0x329735=_0x329735-0x0;var _0x3540cb=_0xa170[_0x329735];return _0x3540cb;};'use strict';var BPromise=require(_0x0a17('0x0'));var jayson=require(_0x0a17('0x1'));var client=jayson[_0x0a17('0x2')][_0x0a17('0x3')]({'port':0x232b});function request(_0x29cb7d,_0x25de42){return new BPromise(function(_0x4b2d68,_0x31e735){return client[_0x0a17('0x4')](_0x29cb7d,_0x25de42)['then'](function(_0x33e876){if(_0x33e876[_0x0a17('0x5')]){return _0x31e735(_0x33e876[_0x0a17('0x5')][_0x0a17('0x6')]);}else{return _0x4b2d68(_0x33e876[_0x0a17('0x7')]);}})['catch'](function(_0x581722){return _0x31e735(_0x581722);});});}exports['sendMailMessage']=function(_0x2418a8,_0x5b9447){return request(_0x0a17('0x8'),{'account':_0x2418a8,'message':_0x5b9447});}; \ No newline at end of file +var _0xe79e=['then','error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x4c40aa,_0x1f3e0c){var _0x4f7708=function(_0x35ae17){while(--_0x35ae17){_0x4c40aa['push'](_0x4c40aa['shift']());}};_0x4f7708(++_0x1f3e0c);}(_0xe79e,0xa9));var _0xee79=function(_0x497ba1,_0xba4f7f){_0x497ba1=_0x497ba1-0x0;var _0x16474a=_0xe79e[_0x497ba1];return _0x16474a;};'use strict';var BPromise=require(_0xee79('0x0'));var jayson=require(_0xee79('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x478e69,_0x3dffb5){return new BPromise(function(_0x290aca,_0x4f4313){return client['request'](_0x478e69,_0x3dffb5)[_0xee79('0x2')](function(_0x55e22a){if(_0x55e22a[_0xee79('0x3')]){return _0x4f4313(_0x55e22a[_0xee79('0x3')][_0xee79('0x4')]);}else{return _0x290aca(_0x55e22a[_0xee79('0x5')]);}})[_0xee79('0x6')](function(_0x3f23a4){return _0x4f4313(_0x3f23a4);});});}exports[_0xee79('0x7')]=function(_0x141bf1,_0x17c45d){return request(_0xee79('0x8'),{'account':_0x141bf1,'message':_0x17c45d});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 2cdbb19..7176a5d 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 _0x6a95=['Capacity','maxcapacity','idle','mail','openchannel','fax','sms','whatsapp','length','StatusTime','toNumber','Status','chatStatusTime','faxStatusTime','smsStatusTime','smsCurrentCapacity','busyQueue','smsWaitingInteractions','stringify','exports','lodash','md5','moment','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity'];(function(_0x3ba536,_0xcbbd0b){var _0x2a3e71=function(_0x38b3ce){while(--_0x38b3ce){_0x3ba536['push'](_0x3ba536['shift']());}};_0x2a3e71(++_0xcbbd0b);}(_0x6a95,0x1db));var _0x56a9=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x6a95[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x56a9('0x0'));var md5=require(_0x56a9('0x1'));var moment=require(_0x56a9('0x2'));var Redis=require(_0x56a9('0x3'));var config=require(_0x56a9('0x4'));config[_0x56a9('0x5')]=_[_0x56a9('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x56a9('0x7'))(new Redis(config[_0x56a9('0x5')]));function Agent(_0x1b42ac){this['id']=_0x1b42ac['id']||0x0;this[_0x56a9('0x8')]=_0x1b42ac[_0x56a9('0x8')]||'';this[_0x56a9('0x9')]=_0x1b42ac[_0x56a9('0x9')]||!![];this['voicePause']=_0x1b42ac['voicePause']||![];this[_0x56a9('0xa')]=_0x1b42ac[_0x56a9('0xa')]||![];this['mailPause']=_0x1b42ac[_0x56a9('0xb')]||![];this[_0x56a9('0xc')]=_0x1b42ac[_0x56a9('0xc')]||![];this[_0x56a9('0xd')]=_0x1b42ac[_0x56a9('0xd')]||![];this[_0x56a9('0xe')]=_0x1b42ac[_0x56a9('0xe')]||![];this[_0x56a9('0xf')]=_0x56a9('0x10');this['chatStatusTime']=0x0;this[_0x56a9('0x11')]=_0x1b42ac['chatCapacity']||0x0;this[_0x56a9('0x12')]=0x0;this[_0x56a9('0x13')]=_0x56a9('0x10');this[_0x56a9('0x14')]=0x0;this[_0x56a9('0x15')]=_0x1b42ac[_0x56a9('0x15')]||0x0;this[_0x56a9('0x16')]=0x0;this[_0x56a9('0x17')]=_0x56a9('0x10');this['faxStatusTime']=0x0;this['faxCapacity']=_0x1b42ac[_0x56a9('0x18')]||0x0;this[_0x56a9('0x19')]=0x0;this[_0x56a9('0x1a')]=_0x56a9('0x10');this['smsStatusTime']=0x0;this[_0x56a9('0x1b')]=_0x1b42ac['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']=_0x56a9('0x10');this[_0x56a9('0x1c')]=0x0;this[_0x56a9('0x1d')]=_0x1b42ac[_0x56a9('0x1d')]||0x0;this[_0x56a9('0x1e')]=0x0;this[_0x56a9('0x1f')]=_0x56a9('0x10');this[_0x56a9('0x20')]=0x0;this[_0x56a9('0x21')]=_0x1b42ac[_0x56a9('0x21')]||0x0;this[_0x56a9('0x22')]=0x0;this[_0x56a9('0x23')]=![];this['busyQueue']=undefined;this['md5']='';this[_0x56a9('0x24')]={};this[_0x56a9('0x25')]={};this[_0x56a9('0x26')]={};this[_0x56a9('0x27')]={};this['smsWaitingInteractions']={};this[_0x56a9('0x28')]={};this[_0x56a9('0x29')]();}Agent[_0x56a9('0x2a')][_0x56a9('0x2b')]=function(_0x5a82e0){if(this[_0x5a82e0+_0x56a9('0x2c')]>0x0){if(this[_0x5a82e0+_0x56a9('0x2d')]>0x0&&this[_0x5a82e0+_0x56a9('0x2c')]>=this[_0x5a82e0+_0x56a9('0x2d')]){return _0x56a9('0x2e');}else{return'working';}}else{return _0x56a9('0x2f');}};Agent[_0x56a9('0x2a')][_0x56a9('0x29')]=function(){var _0x5e3052=[_0x56a9('0x30'),'chat',_0x56a9('0x31'),_0x56a9('0x32'),_0x56a9('0x33'),_0x56a9('0x34')];for(var _0x45f38c=0x0;_0x45f38c<_0x5e3052[_0x56a9('0x35')];_0x45f38c+=0x1){var _0x1133e6=this[_0x56a9('0x2b')](_0x5e3052[_0x45f38c]);if(this[_0x5e3052[_0x45f38c]+'Status']!==_0x1133e6){this[_0x5e3052[_0x45f38c]+_0x56a9('0x36')]=_[_0x56a9('0x37')](moment()['format']('x'));}this[_0x5e3052[_0x45f38c]+_0x56a9('0x38')]=_0x1133e6;}var _0x4f9be1={'id':this['id'],'name':this['name'],'online':this[_0x56a9('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0x56a9('0xa')],'mailPause':this[_0x56a9('0xb')],'smsPause':this[_0x56a9('0xd')],'faxPause':this[_0x56a9('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x56a9('0xf')],'chatStatusTime':this[_0x56a9('0x39')],'chatCapacity':this[_0x56a9('0x11')],'chatCurrentCapacity':this[_0x56a9('0x12')],'mailStatus':this[_0x56a9('0x13')],'mailStatusTime':this[_0x56a9('0x14')],'mailCapacity':this[_0x56a9('0x15')],'mailCurrentCapacity':this[_0x56a9('0x16')],'faxStatus':this[_0x56a9('0x17')],'faxStatusTime':this[_0x56a9('0x3a')],'faxCapacity':this[_0x56a9('0x18')],'faxCurrentCapacity':this[_0x56a9('0x19')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x56a9('0x3b')],'smsCapacity':this[_0x56a9('0x1b')],'smsCurrentCapacity':this[_0x56a9('0x3c')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x56a9('0x1c')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x56a9('0x20')],'openchannelCapacity':this[_0x56a9('0x21')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0x56a9('0x3d')],'chatWaitingInteractions':this[_0x56a9('0x24')],'faxWaitingInteractions':this[_0x56a9('0x25')],'mailWaitingInteractions':this[_0x56a9('0x26')],'openchannelWaitingInteractions':this[_0x56a9('0x27')],'smsWaitingInteractions':this[_0x56a9('0x3e')],'whatsappWaitingInteractions':this[_0x56a9('0x28')]};var _0x3f8bd0=md5(JSON[_0x56a9('0x3f')](_0x4f9be1));if(this[_0x56a9('0x1')]!==_0x3f8bd0){this['md5']=_0x3f8bd0;io['emit']('user:routing:update',_['omit'](_0x4f9be1,[_0x56a9('0x9')]));}};module[_0x56a9('0x40')]=Agent; \ No newline at end of file +var _0x160f=['faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','chatWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','mail','chat','fax','sms','whatsapp','length','toNumber','format','Status','chatPause','whatsappStatus','busy','stringify','emit','user:routing:update','exports','lodash','md5','moment','ioredis','redis','defaults','localhost','socket.io-emitter','name','voicePause','mailPause','faxPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','unknown','faxStatusTime','faxCapacity'];(function(_0x996bc8,_0x291e01){var _0x20b0ea=function(_0x5ba992){while(--_0x5ba992){_0x996bc8['push'](_0x996bc8['shift']());}};_0x20b0ea(++_0x291e01);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var md5=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));var Redis=require(_0xf160('0x3'));var config=require('../../../config/environment');config[_0xf160('0x4')]=_[_0xf160('0x5')](config[_0xf160('0x4')],{'host':_0xf160('0x6'),'port':0x18eb});var io=require(_0xf160('0x7'))(new Redis(config[_0xf160('0x4')]));function Agent(_0x4a6f3d){this['id']=_0x4a6f3d['id']||0x0;this[_0xf160('0x8')]=_0x4a6f3d[_0xf160('0x8')]||'';this['online']=_0x4a6f3d['online']||!![];this[_0xf160('0x9')]=_0x4a6f3d['voicePause']||![];this['chatPause']=_0x4a6f3d['chatPause']||![];this[_0xf160('0xa')]=_0x4a6f3d[_0xf160('0xa')]||![];this[_0xf160('0xb')]=_0x4a6f3d[_0xf160('0xb')]||![];this['smsPause']=_0x4a6f3d['smsPause']||![];this[_0xf160('0xc')]=_0x4a6f3d[_0xf160('0xc')]||![];this[_0xf160('0xd')]='unknown';this[_0xf160('0xe')]=0x0;this[_0xf160('0xf')]=_0x4a6f3d[_0xf160('0xf')]||0x0;this[_0xf160('0x10')]=0x0;this[_0xf160('0x11')]='unknown';this[_0xf160('0x12')]=0x0;this['mailCapacity']=_0x4a6f3d[_0xf160('0x13')]||0x0;this[_0xf160('0x14')]=0x0;this[_0xf160('0x15')]=_0xf160('0x16');this[_0xf160('0x17')]=0x0;this[_0xf160('0x18')]=_0x4a6f3d[_0xf160('0x18')]||0x0;this[_0xf160('0x19')]=0x0;this[_0xf160('0x1a')]='unknown';this[_0xf160('0x1b')]=0x0;this[_0xf160('0x1c')]=_0x4a6f3d[_0xf160('0x1c')]||0x0;this[_0xf160('0x1d')]=0x0;this['whatsappStatus']=_0xf160('0x16');this['whatsappStatusTime']=0x0;this[_0xf160('0x1e')]=_0x4a6f3d[_0xf160('0x1e')]||0x0;this[_0xf160('0x1f')]=0x0;this[_0xf160('0x20')]=_0xf160('0x16');this[_0xf160('0x21')]=0x0;this[_0xf160('0x22')]=_0x4a6f3d[_0xf160('0x22')]||0x0;this[_0xf160('0x23')]=0x0;this['busy']=![];this[_0xf160('0x24')]=undefined;this[_0xf160('0x1')]='';this[_0xf160('0x25')]={};this['faxWaitingInteractions']={};this[_0xf160('0x26')]={};this[_0xf160('0x27')]={};this[_0xf160('0x28')]={};this[_0xf160('0x29')]={};this[_0xf160('0x2a')]();}Agent[_0xf160('0x2b')][_0xf160('0x2c')]=function(_0x5a72d1){if(this[_0x5a72d1+_0xf160('0x2d')]>0x0){if(this[_0x5a72d1+_0xf160('0x2e')]>0x0&&this[_0x5a72d1+_0xf160('0x2d')]>=this[_0x5a72d1+_0xf160('0x2e')]){return'maxcapacity';}else{return _0xf160('0x2f');}}else{return _0xf160('0x30');}};Agent['prototype']['updateRealtime']=function(){var _0x168a09=[_0xf160('0x31'),_0xf160('0x32'),'openchannel',_0xf160('0x33'),_0xf160('0x34'),_0xf160('0x35')];for(var _0x2e2b00=0x0;_0x2e2b00<_0x168a09[_0xf160('0x36')];_0x2e2b00+=0x1){var _0x193e1e=this['getChannelStatus'](_0x168a09[_0x2e2b00]);if(this[_0x168a09[_0x2e2b00]+'Status']!==_0x193e1e){this[_0x168a09[_0x2e2b00]+'StatusTime']=_[_0xf160('0x37')](moment()[_0xf160('0x38')]('x'));}this[_0x168a09[_0x2e2b00]+_0xf160('0x39')]=_0x193e1e;}var _0x26e06b={'id':this['id'],'name':this[_0xf160('0x8')],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0xf160('0x3a')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0xf160('0xb')],'openchannelPause':this[_0xf160('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xf160('0xe')],'chatCapacity':this[_0xf160('0xf')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xf160('0x14')],'faxStatus':this[_0xf160('0x15')],'faxStatusTime':this[_0xf160('0x17')],'faxCapacity':this[_0xf160('0x18')],'faxCurrentCapacity':this[_0xf160('0x19')],'smsStatus':this[_0xf160('0x1a')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xf160('0x3b')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xf160('0x1f')],'openchannelStatus':this[_0xf160('0x20')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xf160('0x22')],'openchannelCurrentCapacity':this[_0xf160('0x23')],'busy':this[_0xf160('0x3c')],'busyQueue':this[_0xf160('0x24')],'chatWaitingInteractions':this[_0xf160('0x25')],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0xf160('0x26')],'openchannelWaitingInteractions':this[_0xf160('0x27')],'smsWaitingInteractions':this[_0xf160('0x28')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x2dfe7b=md5(JSON[_0xf160('0x3d')](_0x26e06b));if(this[_0xf160('0x1')]!==_0x2dfe7b){this[_0xf160('0x1')]=_0x2dfe7b;io[_0xf160('0x3e')](_0xf160('0x3f'),_['omit'](_0x26e06b,['online']));}};module[_0xf160('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 1614ec6..797482c 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 _0x1c0f=['updateRealtime','_rr','map','Agents','length','online','available','loggedIn','chat:queue:%s','emit','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting'];(function(_0x68e445,_0x5aa12b){var _0x483915=function(_0x18107c){while(--_0x18107c){_0x68e445['push'](_0x68e445['shift']());}};_0x483915(++_0x5aa12b);}(_0x1c0f,0xc1));var _0xf1c0=function(_0xd80b93,_0x3f4dca){_0xd80b93=_0xd80b93-0x0;var _0x441b85=_0x1c0f[_0xd80b93];return _0x441b85;};'use strict';var _=require(_0xf1c0('0x0'));var md5=require(_0xf1c0('0x1'));var util=require(_0xf1c0('0x2'));var Redis=require('ioredis');var config=require(_0xf1c0('0x3'));config[_0xf1c0('0x4')]=_[_0xf1c0('0x5')](config[_0xf1c0('0x4')],{'host':_0xf1c0('0x6'),'port':0x18eb});var io=require(_0xf1c0('0x7'))(new Redis(config[_0xf1c0('0x4')]));function ChatQueue(_0x4a0538){this['id']=_0x4a0538['id']||0x0;this[_0xf1c0('0x8')]=_0x4a0538['name']||'';this[_0xf1c0('0x9')]=_0x4a0538[_0xf1c0('0x9')]||0xa;this[_0xf1c0('0xa')]=_0x4a0538['strategy']||_0xf1c0('0xb');this['Agents']=_0x4a0538['Agents'];this[_0xf1c0('0xc')]={};this[_0xf1c0('0xd')]=0x0;this[_0xf1c0('0x1')]='';this[_0xf1c0('0xe')]();this[_0xf1c0('0xf')]();}ChatQueue['prototype'][_0xf1c0('0xe')]=function(){var _0x13ded5=this[_0xf1c0('0xc')][_0xf1c0('0x10')];this['mapAgentsId']=_[_0xf1c0('0x11')](this[_0xf1c0('0x12')],'id');this[_0xf1c0('0xc')]['_rr']=_0x13ded5;};ChatQueue['prototype'][_0xf1c0('0xf')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x17d905=0x0;_0x17d905=0x0?this[_0xf1c0('0x15')]:0x0;var _0x401f28={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf1c0('0x16')],'name':this[_0xf1c0('0x8')],'paused':this['paused'],'waiting':this[_0xf1c0('0xd')]};var _0x1f8d8d=md5(JSON['stringify'](_0x401f28));if(this[_0xf1c0('0x1')]!==_0x1f8d8d){this[_0xf1c0('0x1')]=_0x1f8d8d;io['to'](util['format'](_0xf1c0('0x17'),_0x401f28[_0xf1c0('0x8')]))[_0xf1c0('0x18')]('chat_queue:save',_0x401f28);}};module[_0xf1c0('0x19')]=ChatQueue; \ No newline at end of file +var _0x8b39=['timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','map','prototype','loggedIn','paused','length','chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name'];(function(_0x29e35f,_0x4859ef){var _0x266b74=function(_0xc09e1){while(--_0xc09e1){_0x29e35f['push'](_0x29e35f['shift']());}};_0x266b74(++_0x4859ef);}(_0x8b39,0x14c));var _0x98b3=function(_0x2f7538,_0x1292b4){_0x2f7538=_0x2f7538-0x0;var _0x266ffd=_0x8b39[_0x2f7538];return _0x266ffd;};'use strict';var _=require(_0x98b3('0x0'));var md5=require(_0x98b3('0x1'));var util=require(_0x98b3('0x2'));var Redis=require(_0x98b3('0x3'));var config=require(_0x98b3('0x4'));config[_0x98b3('0x5')]=_[_0x98b3('0x6')](config['redis'],{'host':_0x98b3('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x98b3('0x5')]));function ChatQueue(_0x21af31){this['id']=_0x21af31['id']||0x0;this[_0x98b3('0x8')]=_0x21af31[_0x98b3('0x8')]||'';this[_0x98b3('0x9')]=_0x21af31[_0x98b3('0x9')]||0xa;this[_0x98b3('0xa')]=_0x21af31['strategy']||_0x98b3('0xb');this[_0x98b3('0xc')]=_0x21af31['Agents'];this['mapAgentsId']={};this[_0x98b3('0xd')]=0x0;this[_0x98b3('0x1')]='';this[_0x98b3('0xe')]();this[_0x98b3('0xf')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x5df6be=this[_0x98b3('0x10')][_0x98b3('0x11')];this[_0x98b3('0x10')]=_[_0x98b3('0x12')](this[_0x98b3('0xc')],'id');this[_0x98b3('0x10')][_0x98b3('0x11')]=_0x5df6be;};ChatQueue[_0x98b3('0x13')]['updateRealtime']=function(){this[_0x98b3('0x14')]=0x0;this[_0x98b3('0x15')]=0x0;for(var _0x30951b=0x0;_0x30951b=0x0?this[_0x98b3('0x18')]:0x0;var _0x3b0da2={'id':this['id'],'available':this[_0x98b3('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x98b3('0x8')],'paused':this[_0x98b3('0x15')],'waiting':this[_0x98b3('0xd')]};var _0x2beaf4=md5(JSON[_0x98b3('0x19')](_0x3b0da2));if(this[_0x98b3('0x1')]!==_0x2beaf4){this['md5']=_0x2beaf4;io['to'](util[_0x98b3('0x1a')](_0x98b3('0x1b'),_0x3b0da2[_0x98b3('0x8')]))[_0x98b3('0x1c')](_0x98b3('0x1d'),_0x3b0da2);}};module[_0x98b3('0x1e')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index fead935..926e37f 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 _0xb9cd=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','updateRouting','mapAgentsId','_rr','prototype','loggedIn','paused','length','available','stringify','format','fax:queue:%s','emit','exports','lodash','md5','ioredis','../../../config/environment','defaults','redis'];(function(_0x2ab3c5,_0x35a3ef){var _0x2733aa=function(_0x338802){while(--_0x338802){_0x2ab3c5['push'](_0x2ab3c5['shift']());}};_0x2733aa(++_0x35a3ef);}(_0xb9cd,0xbe));var _0xdb9c=function(_0x41e8c4,_0x30d9ff){_0x41e8c4=_0x41e8c4-0x0;var _0x54ffbe=_0xb9cd[_0x41e8c4];return _0x54ffbe;};'use strict';var _=require(_0xdb9c('0x0'));var md5=require(_0xdb9c('0x1'));var util=require('util');var Redis=require(_0xdb9c('0x2'));var config=require(_0xdb9c('0x3'));config['redis']=_[_0xdb9c('0x4')](config[_0xdb9c('0x5')],{'host':_0xdb9c('0x6'),'port':0x18eb});var io=require(_0xdb9c('0x7'))(new Redis(config[_0xdb9c('0x5')]));function FaxQueue(_0x320690){this['id']=_0x320690['id']||0x0;this[_0xdb9c('0x8')]=_0x320690[_0xdb9c('0x8')]||'';this[_0xdb9c('0x9')]=_0x320690[_0xdb9c('0x9')]||0xa;this['strategy']=_0x320690[_0xdb9c('0xa')]||_0xdb9c('0xb');this['Agents']=_0x320690[_0xdb9c('0xc')];this['mapAgentsId']={};this[_0xdb9c('0xd')]=0x0;this[_0xdb9c('0x1')]='';this['updateRouting']();this[_0xdb9c('0xe')]();}FaxQueue['prototype'][_0xdb9c('0xf')]=function(){var _0x5c64a1=this[_0xdb9c('0x10')]['_rr'];this[_0xdb9c('0x10')]=_['map'](this[_0xdb9c('0xc')],'id');this[_0xdb9c('0x10')][_0xdb9c('0x11')]=_0x5c64a1;};FaxQueue[_0xdb9c('0x12')][_0xdb9c('0xe')]=function(){this[_0xdb9c('0x13')]=0x0;this[_0xdb9c('0x14')]=0x0;for(var _0x29b1a2=0x0;_0x29b1a2=0x0?this[_0xdb9c('0x16')]:0x0;var _0x248d03={'id':this['id'],'available':this[_0xdb9c('0x16')],'loggedIn':this[_0xdb9c('0x13')],'name':this['name'],'paused':this[_0xdb9c('0x14')],'waiting':this['waiting']};var _0x3d3522=md5(JSON[_0xdb9c('0x17')](_0x248d03));if(this[_0xdb9c('0x1')]!==_0x3d3522){this[_0xdb9c('0x1')]=_0x3d3522;io['to'](util[_0xdb9c('0x18')](_0xdb9c('0x19'),_0x248d03[_0xdb9c('0x8')]))[_0xdb9c('0x1a')]('fax_queue:save',_0x248d03);}};module[_0xdb9c('0x1b')]=FaxQueue; \ No newline at end of file +var _0x06f8=['online','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length'];(function(_0x40a04e,_0x324a25){var _0x2e355a=function(_0x3f32d8){while(--_0x3f32d8){_0x40a04e['push'](_0x40a04e['shift']());}};_0x2e355a(++_0x324a25);}(_0x06f8,0xf9));var _0x806f=function(_0x149882,_0x39b6be){_0x149882=_0x149882-0x0;var _0x43c6ee=_0x06f8[_0x149882];return _0x43c6ee;};'use strict';var _=require(_0x806f('0x0'));var md5=require(_0x806f('0x1'));var util=require(_0x806f('0x2'));var Redis=require('ioredis');var config=require(_0x806f('0x3'));config[_0x806f('0x4')]=_[_0x806f('0x5')](config[_0x806f('0x4')],{'host':_0x806f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x806f('0x4')]));function FaxQueue(_0x1dc5ed){this['id']=_0x1dc5ed['id']||0x0;this[_0x806f('0x7')]=_0x1dc5ed[_0x806f('0x7')]||'';this[_0x806f('0x8')]=_0x1dc5ed[_0x806f('0x8')]||0xa;this[_0x806f('0x9')]=_0x1dc5ed[_0x806f('0x9')]||_0x806f('0xa');this[_0x806f('0xb')]=_0x1dc5ed[_0x806f('0xb')];this[_0x806f('0xc')]={};this[_0x806f('0xd')]=0x0;this[_0x806f('0x1')]='';this[_0x806f('0xe')]();this[_0x806f('0xf')]();}FaxQueue[_0x806f('0x10')][_0x806f('0xe')]=function(){var _0xad9f9f=this[_0x806f('0xc')][_0x806f('0x11')];this[_0x806f('0xc')]=_['map'](this[_0x806f('0xb')],'id');this[_0x806f('0xc')][_0x806f('0x11')]=_0xad9f9f;};FaxQueue[_0x806f('0x10')][_0x806f('0xf')]=function(){this[_0x806f('0x12')]=0x0;this[_0x806f('0x13')]=0x0;for(var _0x2473ac=0x0;_0x2473ac=0x0?this['available']:0x0;var _0xd7689e={'id':this['id'],'available':this['available'],'loggedIn':this[_0x806f('0x12')],'name':this[_0x806f('0x7')],'paused':this[_0x806f('0x13')],'waiting':this[_0x806f('0xd')]};var _0x5cabaf=md5(JSON[_0x806f('0x18')](_0xd7689e));if(this['md5']!==_0x5cabaf){this[_0x806f('0x1')]=_0x5cabaf;io['to'](util[_0x806f('0x19')](_0x806f('0x1a'),_0xd7689e[_0x806f('0x7')]))[_0x806f('0x1b')](_0x806f('0x1c'),_0xd7689e);}};module[_0x806f('0x1d')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index d425722..487f2a6 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 _0xb9f4=['name','Intervals'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xb9f4,0xb4));var _0x4b9f=function(_0x3e62c9,_0x175a01){_0x3e62c9=_0x3e62c9-0x0;var _0x5954de=_0xb9f4[_0x3e62c9];return _0x5954de;};'use strict';function Interval(_0xaddf17){this['id']=_0xaddf17['id']||0x0;this[_0x4b9f('0x0')]=_0xaddf17[_0x4b9f('0x0')]||'';this[_0x4b9f('0x1')]=_0xaddf17[_0x4b9f('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0xb2c1=['Intervals','exports','name'];(function(_0x2e35a6,_0x5ef737){var _0x450c20=function(_0x4c68cf){while(--_0x4c68cf){_0x2e35a6['push'](_0x2e35a6['shift']());}};_0x450c20(++_0x5ef737);}(_0xb2c1,0x13d));var _0x1b2c=function(_0x31a37b,_0x826249){_0x31a37b=_0x31a37b-0x0;var _0x49ae16=_0xb2c1[_0x31a37b];return _0x49ae16;};'use strict';function Interval(_0x1b03ba){this['id']=_0x1b03ba['id']||0x0;this[_0x1b2c('0x0')]=_0x1b03ba[_0x1b2c('0x0')]||'';this[_0x1b2c('0x1')]=_0x1b03ba['Intervals']||{};}module[_0x1b2c('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 639793c..e1f2fd5 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 _0x9503=['paused','length','mailPause','available','stringify','format','mail_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','map','loggedIn'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0x9503,0x116));var _0x3950=function(_0x1fc86a,_0x54613a){_0x1fc86a=_0x1fc86a-0x0;var _0x357919=_0x9503[_0x1fc86a];return _0x357919;};'use strict';var _=require(_0x3950('0x0'));var md5=require(_0x3950('0x1'));var util=require(_0x3950('0x2'));var Redis=require(_0x3950('0x3'));var config=require('../../../config/environment');config[_0x3950('0x4')]=_[_0x3950('0x5')](config[_0x3950('0x4')],{'host':_0x3950('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x1a5859){this['id']=_0x1a5859['id']||0x0;this['name']=_0x1a5859[_0x3950('0x7')]||'';this[_0x3950('0x8')]=_0x1a5859['timeout']||0xa;this[_0x3950('0x9')]=_0x1a5859[_0x3950('0x9')]||_0x3950('0xa');this[_0x3950('0xb')]=_0x1a5859[_0x3950('0xb')];this[_0x3950('0xc')]={};this[_0x3950('0xd')]=0x0;this[_0x3950('0x1')]='';this['updateRouting']();this[_0x3950('0xe')]();}MailQueue[_0x3950('0xf')]['updateRouting']=function(){var _0x2f1bb8=this['mapAgentsId'][_0x3950('0x10')];this[_0x3950('0xc')]=_[_0x3950('0x11')](this[_0x3950('0xb')],'id');this[_0x3950('0xc')][_0x3950('0x10')]=_0x2f1bb8;};MailQueue['prototype']['updateRealtime']=function(){this[_0x3950('0x12')]=0x0;this[_0x3950('0x13')]=0x0;for(var _0x559bc0=0x0;_0x559bc0=0x0?this[_0x3950('0x16')]:0x0;var _0x35f9a0={'id':this['id'],'available':this[_0x3950('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x3950('0x7')],'paused':this[_0x3950('0x13')],'waiting':this[_0x3950('0xd')]};var _0x3191ba=md5(JSON[_0x3950('0x17')](_0x35f9a0));if(this[_0x3950('0x1')]!==_0x3191ba){this[_0x3950('0x1')]=_0x3191ba;io['to'](util[_0x3950('0x18')]('mail:queue:%s',_0x35f9a0['name']))['emit'](_0x3950('0x19'),_0x35f9a0);}};module[_0x3950('0x1a')]=MailQueue; \ No newline at end of file +var _0x822e=['length','online','available','paused','waiting','stringify','format','mail:queue:%s','exports','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','prototype','loggedIn'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0x822e,0xbf));var _0xe822=function(_0x56139f,_0x306c82){_0x56139f=_0x56139f-0x0;var _0x205bc6=_0x822e[_0x56139f];return _0x205bc6;};'use strict';var _=require(_0xe822('0x0'));var md5=require(_0xe822('0x1'));var util=require(_0xe822('0x2'));var Redis=require(_0xe822('0x3'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xe822('0x4')],{'host':_0xe822('0x5'),'port':0x18eb});var io=require(_0xe822('0x6'))(new Redis(config['redis']));function MailQueue(_0x5df0d3){this['id']=_0x5df0d3['id']||0x0;this[_0xe822('0x7')]=_0x5df0d3['name']||'';this[_0xe822('0x8')]=_0x5df0d3[_0xe822('0x8')]||0xa;this[_0xe822('0x9')]=_0x5df0d3[_0xe822('0x9')]||'beepall';this[_0xe822('0xa')]=_0x5df0d3['Agents'];this[_0xe822('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0xe822('0xc')]();this[_0xe822('0xd')]();}MailQueue['prototype']['updateRouting']=function(){var _0x2df98b=this[_0xe822('0xb')][_0xe822('0xe')];this[_0xe822('0xb')]=_['map'](this[_0xe822('0xa')],'id');this['mapAgentsId'][_0xe822('0xe')]=_0x2df98b;};MailQueue[_0xe822('0xf')][_0xe822('0xd')]=function(){this[_0xe822('0x10')]=0x0;this['paused']=0x0;for(var _0x2360d6=0x0;_0x2360d6=0x0?this[_0xe822('0x13')]:0x0;var _0xc2cf59={'id':this['id'],'available':this[_0xe822('0x13')],'loggedIn':this['loggedIn'],'name':this[_0xe822('0x7')],'paused':this[_0xe822('0x14')],'waiting':this[_0xe822('0x15')]};var _0x5436c4=md5(JSON[_0xe822('0x16')](_0xc2cf59));if(this[_0xe822('0x1')]!==_0x5436c4){this['md5']=_0x5436c4;io['to'](util[_0xe822('0x17')](_0xe822('0x18'),_0xc2cf59[_0xe822('0x7')]))['emit']('mail_queue:save',_0xc2cf59);}};module[_0xe822('0x19')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 248f025..35a99a9 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 _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x326f,0xd1));var _0xf326=function(_0x23f948,_0x5e15d6){_0x23f948=_0x23f948-0x0;var _0x150a1c=_0x326f[_0x23f948];return _0x150a1c;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x556634,_0x520958){var _0x4429fd=function(_0x1e7eb9){while(--_0x1e7eb9){_0x556634['push'](_0x556634['shift']());}};_0x4429fd(++_0x520958);}(_0xadb5,0xad));var _0x5adb=function(_0xb0e50b,_0x4e4be6){_0xb0e50b=_0xb0e50b-0x0;var _0x5c6047=_0xadb5[_0xb0e50b];return _0x5c6047;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 59db0b2..d20b46b 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 _0x8eeb=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','length','online','smsPause','paused','available','md5','format','sms:queue:%s','sms_queue:save','lodash','util','ioredis','redis','defaults'];(function(_0x4191ed,_0xe481ab){var _0x4be14f=function(_0x4ad2d9){while(--_0x4ad2d9){_0x4191ed['push'](_0x4191ed['shift']());}};_0x4be14f(++_0xe481ab);}(_0x8eeb,0x183));var _0xb8ee=function(_0x111611,_0x3a7a46){_0x111611=_0x111611-0x0;var _0x4ed794=_0x8eeb[_0x111611];return _0x4ed794;};'use strict';var _=require(_0xb8ee('0x0'));var md5=require('md5');var util=require(_0xb8ee('0x1'));var Redis=require(_0xb8ee('0x2'));var config=require('../../../config/environment');config[_0xb8ee('0x3')]=_[_0xb8ee('0x4')](config[_0xb8ee('0x3')],{'host':_0xb8ee('0x5'),'port':0x18eb});var io=require(_0xb8ee('0x6'))(new Redis(config['redis']));function SmsQueue(_0x35fad5){this['id']=_0x35fad5['id']||0x0;this['name']=_0x35fad5[_0xb8ee('0x7')]||'';this[_0xb8ee('0x8')]=_0x35fad5[_0xb8ee('0x8')]||0xa;this[_0xb8ee('0x9')]=_0x35fad5['strategy']||_0xb8ee('0xa');this[_0xb8ee('0xb')]=_0x35fad5[_0xb8ee('0xb')];this['mapAgentsId']={};this[_0xb8ee('0xc')]=0x0;this['md5']='';this[_0xb8ee('0xd')]();this[_0xb8ee('0xe')]();}SmsQueue[_0xb8ee('0xf')][_0xb8ee('0xd')]=function(){var _0x19c828=this[_0xb8ee('0x10')][_0xb8ee('0x11')];this[_0xb8ee('0x10')]=_['map'](this[_0xb8ee('0xb')],'id');this[_0xb8ee('0x10')][_0xb8ee('0x11')]=_0x19c828;};SmsQueue[_0xb8ee('0xf')][_0xb8ee('0xe')]=function(){this[_0xb8ee('0x12')]=0x0;this['paused']=0x0;for(var _0x237f49=0x0;_0x237f49=0x0?this[_0xb8ee('0x17')]:0x0;var _0x4d9a82={'id':this['id'],'available':this[_0xb8ee('0x17')],'loggedIn':this[_0xb8ee('0x12')],'name':this['name'],'paused':this[_0xb8ee('0x16')],'waiting':this[_0xb8ee('0xc')]};var _0xcd3f98=md5(JSON['stringify'](_0x4d9a82));if(this[_0xb8ee('0x18')]!==_0xcd3f98){this[_0xb8ee('0x18')]=_0xcd3f98;io['to'](util[_0xb8ee('0x19')](_0xb8ee('0x1a'),_0x4d9a82[_0xb8ee('0x7')]))['emit'](_0xb8ee('0x1b'),_0x4d9a82);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x87f8=['updateRouting','updateRealtime','prototype','map','paused','length','loggedIn','smsPause','available','waiting','stringify','sms:queue:%s','sms_queue:save','exports','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','md5'];(function(_0x5028a9,_0x2cf5d4){var _0x3c6c52=function(_0x3bf0bc){while(--_0x3bf0bc){_0x5028a9['push'](_0x5028a9['shift']());}};_0x3c6c52(++_0x2cf5d4);}(_0x87f8,0x152));var _0x887f=function(_0x299475,_0x40302e){_0x299475=_0x299475-0x0;var _0x28355a=_0x87f8[_0x299475];return _0x28355a;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require(_0x887f('0x0'));var config=require(_0x887f('0x1'));config['redis']=_[_0x887f('0x2')](config['redis'],{'host':_0x887f('0x3'),'port':0x18eb});var io=require(_0x887f('0x4'))(new Redis(config[_0x887f('0x5')]));function SmsQueue(_0x2d4cec){this['id']=_0x2d4cec['id']||0x0;this['name']=_0x2d4cec[_0x887f('0x6')]||'';this[_0x887f('0x7')]=_0x2d4cec[_0x887f('0x7')]||0xa;this[_0x887f('0x8')]=_0x2d4cec[_0x887f('0x8')]||_0x887f('0x9');this[_0x887f('0xa')]=_0x2d4cec['Agents'];this[_0x887f('0xb')]={};this['waiting']=0x0;this[_0x887f('0xc')]='';this[_0x887f('0xd')]();this[_0x887f('0xe')]();}SmsQueue[_0x887f('0xf')]['updateRouting']=function(){var _0x12383f=this[_0x887f('0xb')]['_rr'];this['mapAgentsId']=_[_0x887f('0x10')](this[_0x887f('0xa')],'id');this[_0x887f('0xb')]['_rr']=_0x12383f;};SmsQueue[_0x887f('0xf')][_0x887f('0xe')]=function(){this['loggedIn']=0x0;this[_0x887f('0x11')]=0x0;for(var _0x58152e=0x0;_0x58152e=0x0?this[_0x887f('0x15')]:0x0;var _0x3d3b0c={'id':this['id'],'available':this[_0x887f('0x15')],'loggedIn':this[_0x887f('0x13')],'name':this[_0x887f('0x6')],'paused':this[_0x887f('0x11')],'waiting':this[_0x887f('0x16')]};var _0x3964d6=md5(JSON[_0x887f('0x17')](_0x3d3b0c));if(this[_0x887f('0xc')]!==_0x3964d6){this[_0x887f('0xc')]=_0x3964d6;io['to'](util['format'](_0x887f('0x18'),_0x3d3b0c[_0x887f('0x6')]))['emit'](_0x887f('0x19'),_0x3d3b0c);}};module[_0x887f('0x1a')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 11fd479..90fd0c0 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 _0x5fff=['whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','redis','defaults','localhost','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','_rr','map','mapAgentsId','prototype','loggedIn','paused','length','whatsappPause','available','name','stringify','format'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x5fff,0x126));var _0xf5ff=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x5fff[_0x344a3f];return _0x264712;};'use strict';var _=require(_0xf5ff('0x0'));var md5=require(_0xf5ff('0x1'));var util=require(_0xf5ff('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xf5ff('0x3')]=_[_0xf5ff('0x4')](config[_0xf5ff('0x3')],{'host':_0xf5ff('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x554dc9){this['id']=_0x554dc9['id']||0x0;this['name']=_0x554dc9['name']||'';this[_0xf5ff('0x6')]=_0x554dc9[_0xf5ff('0x6')]||0xa;this[_0xf5ff('0x7')]=_0x554dc9['strategy']||_0xf5ff('0x8');this[_0xf5ff('0x9')]=_0x554dc9[_0xf5ff('0x9')];this['mapAgentsId']={};this[_0xf5ff('0xa')]=0x0;this[_0xf5ff('0x1')]='';this[_0xf5ff('0xb')]();this[_0xf5ff('0xc')]();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x3853e9=this['mapAgentsId'][_0xf5ff('0xd')];this['mapAgentsId']=_[_0xf5ff('0xe')](this[_0xf5ff('0x9')],'id');this[_0xf5ff('0xf')][_0xf5ff('0xd')]=_0x3853e9;};WhatsappQueue[_0xf5ff('0x10')]['updateRealtime']=function(){this[_0xf5ff('0x11')]=0x0;this[_0xf5ff('0x12')]=0x0;for(var _0x15f01e=0x0;_0x15f01e=0x0?this['available']:0x0;var _0x675684={'id':this['id'],'available':this[_0xf5ff('0x15')],'loggedIn':this[_0xf5ff('0x11')],'name':this[_0xf5ff('0x16')],'paused':this[_0xf5ff('0x12')],'waiting':this[_0xf5ff('0xa')]};var _0x4cd882=md5(JSON[_0xf5ff('0x17')](_0x675684));if(this[_0xf5ff('0x1')]!==_0x4cd882){this[_0xf5ff('0x1')]=_0x4cd882;io['to'](util[_0xf5ff('0x18')](_0xf5ff('0x19'),_0x675684[_0xf5ff('0x16')]))[_0xf5ff('0x1a')](_0xf5ff('0x1b'),_0x675684);}};module[_0xf5ff('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0xff8c=['beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','paused','length','available','loggedIn','name','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','md5','redis','localhost','socket.io-emitter','timeout','strategy'];(function(_0xd4e399,_0x4a8481){var _0x1186c9=function(_0x48aa19){while(--_0x48aa19){_0xd4e399['push'](_0xd4e399['shift']());}};_0x1186c9(++_0x4a8481);}(_0xff8c,0x1cd));var _0xcff8=function(_0x3bd139,_0x52a505){_0x3bd139=_0x3bd139-0x0;var _0xa9342a=_0xff8c[_0x3bd139];return _0xa9342a;};'use strict';var _=require(_0xcff8('0x0'));var md5=require(_0xcff8('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xcff8('0x2')],{'host':_0xcff8('0x3'),'port':0x18eb});var io=require(_0xcff8('0x4'))(new Redis(config['redis']));function WhatsappQueue(_0x49d880){this['id']=_0x49d880['id']||0x0;this['name']=_0x49d880['name']||'';this[_0xcff8('0x5')]=_0x49d880[_0xcff8('0x5')]||0xa;this['strategy']=_0x49d880[_0xcff8('0x6')]||_0xcff8('0x7');this[_0xcff8('0x8')]=_0x49d880[_0xcff8('0x8')];this[_0xcff8('0x9')]={};this[_0xcff8('0xa')]=0x0;this['md5']='';this['updateRouting']();this[_0xcff8('0xb')]();}WhatsappQueue[_0xcff8('0xc')][_0xcff8('0xd')]=function(){var _0x377624=this[_0xcff8('0x9')][_0xcff8('0xe')];this[_0xcff8('0x9')]=_[_0xcff8('0xf')](this[_0xcff8('0x8')],'id');this[_0xcff8('0x9')][_0xcff8('0xe')]=_0x377624;};WhatsappQueue[_0xcff8('0xc')][_0xcff8('0xb')]=function(){this['loggedIn']=0x0;this[_0xcff8('0x10')]=0x0;for(var _0x9c060c=0x0;_0x9c060c=0x0?this[_0xcff8('0x12')]:0x0;var _0x16f85a={'id':this['id'],'available':this[_0xcff8('0x12')],'loggedIn':this[_0xcff8('0x13')],'name':this[_0xcff8('0x14')],'paused':this['paused'],'waiting':this[_0xcff8('0xa')]};var _0x5d0168=md5(JSON[_0xcff8('0x15')](_0x16f85a));if(this['md5']!==_0x5d0168){this[_0xcff8('0x1')]=_0x5d0168;io['to'](util[_0xcff8('0x16')](_0xcff8('0x17'),_0x16f85a[_0xcff8('0x14')]))[_0xcff8('0x18')](_0xcff8('0x19'),_0x16f85a);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 30a762f..25b0784 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(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x25ec4c,_0x23a06d){var _0xff5b36=function(_0x376547){while(--_0x376547){_0x25ec4c['push'](_0x25ec4c['shift']());}};_0xff5b36(++_0x23a06d);}(_0xb10b,0x12a));var _0xbb10=function(_0x3b3947,_0x1c5e57){_0x3b3947=_0x3b3947-0x0;var _0x4113d7=_0xb10b[_0x3b3947];return _0x4113d7;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index bf7fe29..d256883 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 _0xae81=['update','UpdateChatInteraction','updateChatInteraction','addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x3cbec3,_0x175d31){var _0x1c80fc=function(_0x42c76a){while(--_0x42c76a){_0x3cbec3['push'](_0x3cbec3['shift']());}};_0x1c80fc(++_0x175d31);}(_0xae81,0xcb));var _0x1ae8=function(_0x1b1b3e,_0xef1d88){_0x1b1b3e=_0x1b1b3e-0x0;var _0x380ba9=_0xae81[_0x1b1b3e];return _0x380ba9;};'use strict';var client=require('../client');exports[_0x1ae8('0x0')]=function(_0x96c70d,_0x272869){return client['Request'](_0x1ae8('0x1'),{'body':_0x272869,'options':{'where':{'id':_0x96c70d}},'log':_0x1ae8('0x2')});};exports[_0x1ae8('0x3')]=function(_0x411839,_0x2a0d63){return client[_0x1ae8('0x4')](_0x1ae8('0x5'),{'body':_0x2a0d63,'options':{'where':{'id':_0x411839}},'log':_0x1ae8('0x6')});}; \ No newline at end of file +var _0xcef8=['updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','Request','UpdateChatInteraction'];(function(_0x533a4d,_0xdd2035){var _0x13225f=function(_0x1152a6){while(--_0x1152a6){_0x533a4d['push'](_0x533a4d['shift']());}};_0x13225f(++_0xdd2035);}(_0xcef8,0x162));var _0x8cef=function(_0x29ceb7,_0x464552){_0x29ceb7=_0x29ceb7-0x0;var _0x26e370=_0xcef8[_0x29ceb7];return _0x26e370;};'use strict';var client=require(_0x8cef('0x0'));exports['update']=function(_0xed6f11,_0x4220c4){return client[_0x8cef('0x1')](_0x8cef('0x2'),{'body':_0x4220c4,'options':{'where':{'id':_0xed6f11}},'log':_0x8cef('0x3')});};exports[_0x8cef('0x4')]=function(_0x4e2a88,_0x280679){return client[_0x8cef('0x1')](_0x8cef('0x5'),{'body':_0x280679,'options':{'where':{'id':_0x4e2a88}},'log':_0x8cef('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index c92d737..15bb000 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 _0x6c6a=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x1d555d,_0x2c4523){var _0x4d43de=function(_0x136346){while(--_0x136346){_0x1d555d['push'](_0x1d555d['shift']());}};_0x4d43de(++_0x2c4523);}(_0x6c6a,0x92));var _0xa6c6=function(_0x599341,_0x4eba7d){_0x599341=_0x599341-0x0;var _0x1e55d6=_0x6c6a[_0x599341];return _0x1e55d6;};'use strict';var client=require(_0xa6c6('0x0'));exports[_0xa6c6('0x1')]=function(_0x163692){return client[_0xa6c6('0x2')](_0xa6c6('0x3'),{'body':_0x163692,'log':_0xa6c6('0x4')});}; \ No newline at end of file +var _0x876d=['Request','CreateChatMessage','createChatMessage','create'];(function(_0xdb5d69,_0x54897a){var _0x5defd4=function(_0x1a429d){while(--_0x1a429d){_0xdb5d69['push'](_0xdb5d69['shift']());}};_0x5defd4(++_0x54897a);}(_0x876d,0x12b));var _0xd876=function(_0x38c625,_0x53cbb9){_0x38c625=_0x38c625-0x0;var _0x3eb8a4=_0x876d[_0x38c625];return _0x3eb8a4;};'use strict';var client=require('../client');exports[_0xd876('0x0')]=function(_0x5219b2){return client[_0xd876('0x1')](_0xd876('0x2'),{'body':_0x5219b2,'log':_0xd876('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 442b183..0006511 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 _0x2171=['name','online','chatPause','getChatQueues','Request','GetChatQueue','strategy','Agents'];(function(_0x4072d0,_0x2c84bd){var _0x2fc971=function(_0xf56f8d){while(--_0xf56f8d){_0x4072d0['push'](_0x4072d0['shift']());}};_0x2fc971(++_0x2c84bd);}(_0x2171,0x143));var _0x1217=function(_0xb30538,_0x1fab33){_0xb30538=_0xb30538-0x0;var _0x581df1=_0x2171[_0xb30538];return _0x581df1;};'use strict';var client=require('../client');exports[_0x1217('0x0')]=function(){return function(){return client[_0x1217('0x1')](_0x1217('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x1217('0x3')],'include':[{'model':'User','as':_0x1217('0x4'),'attributes':['id',_0x1217('0x5'),_0x1217('0x6'),_0x1217('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x1134=['getChatQueues','GetChatQueue','name','strategy','User','chatPause','../client'];(function(_0x5460c6,_0x1bab97){var _0x2c4673=function(_0x6f65b6){while(--_0x6f65b6){_0x5460c6['push'](_0x5460c6['shift']());}};_0x2c4673(++_0x1bab97);}(_0x1134,0x19c));var _0x4113=function(_0x4a671a,_0x1172e7){_0x4a671a=_0x4a671a-0x0;var _0x20ec01=_0x1134[_0x4a671a];return _0x20ec01;};'use strict';var client=require(_0x4113('0x0'));exports[_0x4113('0x1')]=function(){return function(){return client['Request'](_0x4113('0x2'),{'options':{'raw':![],'attributes':['id',_0x4113('0x3'),'timeout',_0x4113('0x4')],'include':[{'model':_0x4113('0x5'),'as':'Agents','attributes':['id',_0x4113('0x3'),'online',_0x4113('0x6')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 38e91f6..9d027fe 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 _0x0a9a=['update','DESC','UpdateChatQueueReport','create','Request','CreateChatQueueReport'];(function(_0x5e90ec,_0x44d724){var _0x3459d3=function(_0x3b7017){while(--_0x3b7017){_0x5e90ec['push'](_0x5e90ec['shift']());}};_0x3459d3(++_0x44d724);}(_0x0a9a,0x183));var _0xa0a9=function(_0x390699,_0x3afd85){_0x390699=_0x390699-0x0;var _0x1cace9=_0x0a9a[_0x390699];return _0x1cace9;};'use strict';var client=require('../client');exports[_0xa0a9('0x0')]=function(_0x51baa8){return client[_0xa0a9('0x1')](_0xa0a9('0x2'),{'body':_0x51baa8,'log':_0xa0a9('0x2')});};exports[_0xa0a9('0x3')]=function(_0x4ba993,_0x317a94){return client[_0xa0a9('0x1')]('UpdateChatQueueReport',{'body':_0x317a94,'options':{'where':{'uniqueid':_0x4ba993},'order':[['id',_0xa0a9('0x4')]],'limit':0x1},'log':_0xa0a9('0x5')});}; \ No newline at end of file +var _0xf3cd=['DESC','UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport'];(function(_0x554637,_0x474aab){var _0x258da8=function(_0x5c52b6){while(--_0x5c52b6){_0x554637['push'](_0x554637['shift']());}};_0x258da8(++_0x474aab);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2678d6,_0x4e2001){_0x2678d6=_0x2678d6-0x0;var _0x475503=_0xf3cd[_0x2678d6];return _0x475503;};'use strict';var client=require(_0xdf3c('0x0'));exports[_0xdf3c('0x1')]=function(_0x31e5a5){return client[_0xdf3c('0x2')](_0xdf3c('0x3'),{'body':_0x31e5a5,'log':_0xdf3c('0x3')});};exports['update']=function(_0x401518,_0x71b446){return client[_0xdf3c('0x2')]('UpdateChatQueueReport',{'body':_0x71b446,'options':{'where':{'uniqueid':_0x401518},'order':[['id',_0xdf3c('0x4')]],'limit':0x1},'log':_0xdf3c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 20e4921..448aa68 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x23c6f2,_0x4e033c){var _0x4c270b=function(_0x4913f0){while(--_0x4913f0){_0x23c6f2['push'](_0x23c6f2['shift']());}};_0x4c270b(++_0x4e033c);}(_0x7a54,0x106));var _0x47a5=function(_0xa2b2a5,_0x50b415){_0xa2b2a5=_0xa2b2a5-0x0;var _0x58f06c=_0x7a54[_0xa2b2a5];return _0x58f06c;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x198457,_0x5bb489){var _0x23b71a=function(_0x5f8ab1){while(--_0x5f8ab1){_0x198457['push'](_0x198457['shift']());}};_0x23b71a(++_0x5bb489);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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 d532643..7a874a5 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 _0x50e9=['create','CreateFaxMessage','createFaxMessage'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x50e9,0x18f));var _0x950e=function(_0x5c5c96,_0x128b62){_0x5c5c96=_0x5c5c96-0x0;var _0x21a083=_0x50e9[_0x5c5c96];return _0x21a083;};'use strict';var client=require('../client');exports[_0x950e('0x0')]=function(_0x2d2c07){return client['Request'](_0x950e('0x1'),{'body':_0x2d2c07,'log':_0x950e('0x2')});}; \ No newline at end of file +var _0x8c55=['Request','CreateFaxMessage','createFaxMessage'];(function(_0x55c8d7,_0x2a4369){var _0x523dce=function(_0x1879e2){while(--_0x1879e2){_0x55c8d7['push'](_0x55c8d7['shift']());}};_0x523dce(++_0x2a4369);}(_0x8c55,0x69));var _0x58c5=function(_0x16b121,_0x222254){_0x16b121=_0x16b121-0x0;var _0x56ce9e=_0x8c55[_0x16b121];return _0x56ce9e;};'use strict';var client=require('../client');exports['create']=function(_0x551a8c){return client[_0x58c5('0x0')](_0x58c5('0x1'),{'body':_0x551a8c,'log':_0x58c5('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 1b8a789..011a1f3 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 _0x2287=['name','online','getFaxQueues','../client','timeout','strategy','User','Agents'];(function(_0x5cf334,_0x1a1756){var _0x40bc8c=function(_0x244dc1){while(--_0x244dc1){_0x5cf334['push'](_0x5cf334['shift']());}};_0x40bc8c(++_0x1a1756);}(_0x2287,0x10b));var _0x7228=function(_0x1f80f0,_0x4f4158){_0x1f80f0=_0x1f80f0-0x0;var _0xbf089d=_0x2287[_0x1f80f0];return _0xbf089d;};'use strict';var client=require(_0x7228('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0x7228('0x1'),_0x7228('0x2')],'include':[{'model':_0x7228('0x3'),'as':_0x7228('0x4'),'attributes':['id',_0x7228('0x5'),_0x7228('0x6'),'faxPause']}]},'log':_0x7228('0x7')});};}; \ No newline at end of file +var _0xb899=['faxPause','../client','GetFaxQueue','name','timeout','strategy','User','online'];(function(_0x2112ae,_0xeb3641){var _0x15dcae=function(_0x21742d){while(--_0x21742d){_0x2112ae['push'](_0x2112ae['shift']());}};_0x15dcae(++_0xeb3641);}(_0xb899,0x91));var _0x9b89=function(_0xd9a32a,_0x52810e){_0xd9a32a=_0xd9a32a-0x0;var _0x1ffeda=_0xb899[_0xd9a32a];return _0x1ffeda;};'use strict';var client=require(_0x9b89('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request'](_0x9b89('0x1'),{'options':{'raw':![],'attributes':['id',_0x9b89('0x2'),_0x9b89('0x3'),_0x9b89('0x4')],'include':[{'model':_0x9b89('0x5'),'as':'Agents','attributes':['id',_0x9b89('0x2'),_0x9b89('0x6'),_0x9b89('0x7')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 70100d3..535ef72 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 _0xed7f=['DESC','../client','create','Request','CreateFaxQueueReport','UpdateFaxQueueReport'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xed7f,0x133));var _0xfed7=function(_0x2b395a,_0x35db69){_0x2b395a=_0x2b395a-0x0;var _0x1beba0=_0xed7f[_0x2b395a];return _0x1beba0;};'use strict';var client=require(_0xfed7('0x0'));exports[_0xfed7('0x1')]=function(_0x4fc6c5){return client[_0xfed7('0x2')](_0xfed7('0x3'),{'body':_0x4fc6c5,'log':_0xfed7('0x3')});};exports['update']=function(_0x254b2c,_0x2577e8){return client[_0xfed7('0x2')](_0xfed7('0x4'),{'body':_0x2577e8,'options':{'where':{'uniqueid':_0x254b2c},'order':[['id',_0xfed7('0x5')]],'limit':0x1},'log':_0xfed7('0x4')});}; \ No newline at end of file +var _0x47f7=['update','Request','UpdateFaxQueueReport','DESC','../client','create','CreateFaxQueueReport'];(function(_0x5108f9,_0x249e0d){var _0x33f35e=function(_0x36ae09){while(--_0x36ae09){_0x5108f9['push'](_0x5108f9['shift']());}};_0x33f35e(++_0x249e0d);}(_0x47f7,0x1c4));var _0x747f=function(_0x2e1862,_0x1503a8){_0x2e1862=_0x2e1862-0x0;var _0x4655d4=_0x47f7[_0x2e1862];return _0x4655d4;};'use strict';var client=require(_0x747f('0x0'));exports[_0x747f('0x1')]=function(_0x479b6d){return client['Request'](_0x747f('0x2'),{'body':_0x479b6d,'log':_0x747f('0x2')});};exports[_0x747f('0x3')]=function(_0x55697a,_0x41d82d){return client[_0x747f('0x4')](_0x747f('0x5'),{'body':_0x41d82d,'options':{'where':{'uniqueid':_0x55697a},'order':[['id',_0x747f('0x6')]],'limit':0x1},'log':_0x747f('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 3cdfeb6..b785645 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 _0x284f=['name','Intervals','interval','../client','getIntervals'];(function(_0x1a2165,_0x54cf82){var _0x4ddabc=function(_0x3c86ab){while(--_0x3c86ab){_0x1a2165['push'](_0x1a2165['shift']());}};_0x4ddabc(++_0x54cf82);}(_0x284f,0x85));var _0xf284=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x284f[_0x565ed7];return _0x183ad7;};'use strict';var client=require(_0xf284('0x0'));exports[_0xf284('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xf284('0x2')],'include':[{'model':'Interval','as':_0xf284('0x3'),'attributes':['id',_0xf284('0x2'),_0xf284('0x4')]}]},'log':_0xf284('0x1')});};}; \ No newline at end of file +var _0x1b2e=['name','Interval','Intervals','../client','getIntervals','Request'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0x1b2e,0xf9));var _0xe1b2=function(_0x278b26,_0x4f1387){_0x278b26=_0x278b26-0x0;var _0xf59782=_0x1b2e[_0x278b26];return _0xf59782;};'use strict';var client=require(_0xe1b2('0x0'));exports[_0xe1b2('0x1')]=function(){return function(){return client[_0xe1b2('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe1b2('0x3')],'include':[{'model':_0xe1b2('0x4'),'as':_0xe1b2('0x5'),'attributes':['id',_0xe1b2('0x3'),'interval']}]},'log':_0xe1b2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index ab6e236..ac77efc 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 _0x0120=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client'];(function(_0x3945bc,_0x307ce0){var _0x29ece8=function(_0x4bc338){while(--_0x4bc338){_0x3945bc['push'](_0x3945bc['shift']());}};_0x29ece8(++_0x307ce0);}(_0x0120,0x6f));var _0x0012=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x0120[_0xefd519];return _0x4bb882;};'use strict';var client=require(_0x0012('0x0'));exports[_0x0012('0x1')]=function(_0x3d23e7,_0xb8d57c){return client[_0x0012('0x2')](_0x0012('0x3'),{'body':_0xb8d57c,'options':{'where':{'id':_0x3d23e7}},'log':_0x0012('0x4')});};exports[_0x0012('0x5')]=function(_0x357f77,_0x302029){return client[_0x0012('0x2')](_0x0012('0x6'),{'body':_0x302029,'options':{'where':{'id':_0x357f77}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x57ca=['UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','update','Request'];(function(_0x2e0032,_0x483067){var _0x1a83a6=function(_0x32fe77){while(--_0x32fe77){_0x2e0032['push'](_0x2e0032['shift']());}};_0x1a83a6(++_0x483067);}(_0x57ca,0x108));var _0xa57c=function(_0x327040,_0x6f7206){_0x327040=_0x327040-0x0;var _0x201070=_0x57ca[_0x327040];return _0x201070;};'use strict';var client=require('../client');exports[_0xa57c('0x0')]=function(_0x4ad696,_0x4b1712){return client[_0xa57c('0x1')](_0xa57c('0x2'),{'body':_0x4b1712,'options':{'where':{'id':_0x4ad696}},'log':_0xa57c('0x3')});};exports[_0xa57c('0x4')]=function(_0x1da469,_0x48be2d){return client[_0xa57c('0x1')](_0xa57c('0x5'),{'body':_0x48be2d,'options':{'where':{'id':_0x1da469}},'log':_0xa57c('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index d0686d7..770ab12 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 _0xb564=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x3220bb,_0x342a03){var _0x23415c=function(_0x56cc05){while(--_0x56cc05){_0x3220bb['push'](_0x3220bb['shift']());}};_0x23415c(++_0x342a03);}(_0xb564,0x11c));var _0x4b56=function(_0x503f69,_0x412e56){_0x503f69=_0x503f69-0x0;var _0xe99672=_0xb564[_0x503f69];return _0xe99672;};'use strict';var client=require(_0x4b56('0x0'));exports[_0x4b56('0x1')]=function(_0x1714df){return client[_0x4b56('0x2')](_0x4b56('0x3'),{'body':_0x1714df,'log':_0x4b56('0x4')});}; \ No newline at end of file +var _0xef17=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x458f22,_0x45d568){var _0x2ffddc=function(_0x37fc21){while(--_0x37fc21){_0x458f22['push'](_0x458f22['shift']());}};_0x2ffddc(++_0x45d568);}(_0xef17,0x185));var _0x7ef1=function(_0x3aef77,_0x3aaa61){_0x3aef77=_0x3aef77-0x0;var _0x154179=_0xef17[_0x3aef77];return _0x154179;};'use strict';var client=require(_0x7ef1('0x0'));exports[_0x7ef1('0x1')]=function(_0xfbb5fe){return client[_0x7ef1('0x2')](_0x7ef1('0x3'),{'body':_0xfbb5fe,'log':_0x7ef1('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 6b6bdd1..8aaac7f 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 _0x4c3d=['Agents','mailPause','getMailQueues','../client','Request','GetMailQueue','name','timeout','User'];(function(_0x554578,_0x50908c){var _0x574707=function(_0xb065ae){while(--_0xb065ae){_0x554578['push'](_0x554578['shift']());}};_0x574707(++_0x50908c);}(_0x4c3d,0x123));var _0xd4c3=function(_0x5d4094,_0xd61ecc){_0x5d4094=_0x5d4094-0x0;var _0x431c64=_0x4c3d[_0x5d4094];return _0x431c64;};'use strict';var client=require(_0xd4c3('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xd4c3('0x1')](_0xd4c3('0x2'),{'options':{'raw':![],'attributes':['id',_0xd4c3('0x3'),_0xd4c3('0x4'),'strategy'],'include':[{'model':_0xd4c3('0x5'),'as':_0xd4c3('0x6'),'attributes':['id',_0xd4c3('0x3'),'online',_0xd4c3('0x7')]}]},'log':_0xd4c3('0x8')});};}; \ No newline at end of file +var _0xe60e=['name','timeout','User','online','mailPause','getMailQueues','../client','Request','GetMailQueue'];(function(_0x55f4a4,_0x20e524){var _0x2c453a=function(_0x1eb1e9){while(--_0x1eb1e9){_0x55f4a4['push'](_0x55f4a4['shift']());}};_0x2c453a(++_0x20e524);}(_0xe60e,0x8d));var _0xee60=function(_0x4d96d8,_0x31e935){_0x4d96d8=_0x4d96d8-0x0;var _0x43ed07=_0xe60e[_0x4d96d8];return _0x43ed07;};'use strict';var client=require(_0xee60('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xee60('0x1')](_0xee60('0x2'),{'options':{'raw':![],'attributes':['id',_0xee60('0x3'),_0xee60('0x4'),'strategy'],'include':[{'model':_0xee60('0x5'),'as':'Agents','attributes':['id',_0xee60('0x3'),_0xee60('0x6'),_0xee60('0x7')]}]},'log':_0xee60('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 6a45627..e4bb5ea 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 _0xf40b=['UpdateMailQueueReport','create','Request','CreateMailQueueReport','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf40b,0xb0));var _0xbf40=function(_0x14d08c,_0x5b7091){_0x14d08c=_0x14d08c-0x0;var _0x5f5bd9=_0xf40b[_0x14d08c];return _0x5f5bd9;};'use strict';var client=require('../client');exports[_0xbf40('0x0')]=function(_0x31cc68){return client[_0xbf40('0x1')](_0xbf40('0x2'),{'body':_0x31cc68,'log':'CreateMailQueueReport'});};exports[_0xbf40('0x3')]=function(_0x2a92dc,_0x118fce){return client[_0xbf40('0x1')](_0xbf40('0x4'),{'body':_0x118fce,'options':{'where':{'uniqueid':_0x2a92dc},'order':[['id','DESC']],'limit':0x1},'log':_0xbf40('0x4')});}; \ No newline at end of file +var _0xa941=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','create'];(function(_0x2b20f2,_0x134796){var _0x46f2a9=function(_0x5c299c){while(--_0x5c299c){_0x2b20f2['push'](_0x2b20f2['shift']());}};_0x46f2a9(++_0x134796);}(_0xa941,0xa1));var _0x1a94=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa941[_0x122ef9];return _0x42fba0;};'use strict';var client=require('../client');exports[_0x1a94('0x0')]=function(_0x167f21){return client[_0x1a94('0x1')]('CreateMailQueueReport',{'body':_0x167f21,'log':_0x1a94('0x2')});};exports[_0x1a94('0x3')]=function(_0x747814,_0x3ce103){return client['Request'](_0x1a94('0x4'),{'body':_0x3ce103,'options':{'where':{'uniqueid':_0x747814},'order':[['id',_0x1a94('0x5')]],'limit':0x1},'log':_0x1a94('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index e0aab52..3ea5d8f 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 _0x861d=['update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x4fd236,_0x32e3c6){var _0x126379=function(_0x4f497c){while(--_0x4f497c){_0x4fd236['push'](_0x4fd236['shift']());}};_0x126379(++_0x32e3c6);}(_0x861d,0x126));var _0xd861=function(_0x1a8be3,_0xa1d303){_0x1a8be3=_0x1a8be3-0x0;var _0xac9769=_0x861d[_0x1a8be3];return _0xac9769;};'use strict';var client=require('../client');exports[_0xd861('0x0')]=function(_0x19175f,_0x16cc02){return client[_0xd861('0x1')](_0xd861('0x2'),{'body':_0x16cc02,'options':{'where':{'id':_0x19175f}},'log':_0xd861('0x3')});};exports[_0xd861('0x4')]=function(_0xd81cea,_0x536c72){return client[_0xd861('0x1')](_0xd861('0x5'),{'body':_0x536c72,'options':{'where':{'id':_0xd81cea}},'log':_0xd861('0x6')});}; \ No newline at end of file +var _0xcc83=['addTagsToChatInteraction','../client','update','addTags','Request'];(function(_0x3572ca,_0x128844){var _0x410d60=function(_0x115fa9){while(--_0x115fa9){_0x3572ca['push'](_0x3572ca['shift']());}};_0x410d60(++_0x128844);}(_0xcc83,0xce));var _0x3cc8=function(_0x906e88,_0x2b5046){_0x906e88=_0x906e88-0x0;var _0x551acb=_0xcc83[_0x906e88];return _0x551acb;};'use strict';var client=require(_0x3cc8('0x0'));exports[_0x3cc8('0x1')]=function(_0x47d8fd,_0x100a37){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x100a37,'options':{'where':{'id':_0x47d8fd}},'log':'updateOpenchannelInteraction'});};exports[_0x3cc8('0x2')]=function(_0x25b133,_0x2eeb08){return client[_0x3cc8('0x3')]('AddTagsToOpenchannelInteraction',{'body':_0x2eeb08,'options':{'where':{'id':_0x25b133}},'log':_0x3cc8('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index f0775ba..b3c24d1 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 _0x948c=['CreateOpenchannelMessage','createOpenchannelMessage','create','Request'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x948c,0x1de));var _0xc948=function(_0x4e5e6c,_0x959eb4){_0x4e5e6c=_0x4e5e6c-0x0;var _0xcf9053=_0x948c[_0x4e5e6c];return _0xcf9053;};'use strict';var client=require('../client');exports[_0xc948('0x0')]=function(_0x40960c){return client[_0xc948('0x1')](_0xc948('0x2'),{'body':_0x40960c,'log':_0xc948('0x3')});}; \ No newline at end of file +var _0xbc9a=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create'];(function(_0x528fe7,_0x2948ec){var _0x282b9d=function(_0x1a3cbc){while(--_0x1a3cbc){_0x528fe7['push'](_0x528fe7['shift']());}};_0x282b9d(++_0x2948ec);}(_0xbc9a,0xa2));var _0xabc9=function(_0x37d317,_0x46dcc1){_0x37d317=_0x37d317-0x0;var _0x2c757f=_0xbc9a[_0x37d317];return _0x2c757f;};'use strict';var client=require(_0xabc9('0x0'));exports[_0xabc9('0x1')]=function(_0x464ab6){return client['Request'](_0xabc9('0x2'),{'body':_0x464ab6,'log':_0xabc9('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index e122dad..e801bb2 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 _0x97d1=['strategy','Agents','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name'];(function(_0x4fcd9f,_0x4b9567){var _0x40d9ab=function(_0x379dfe){while(--_0x379dfe){_0x4fcd9f['push'](_0x4fcd9f['shift']());}};_0x40d9ab(++_0x4b9567);}(_0x97d1,0xa6));var _0x197d=function(_0x2958f8,_0x1b8fda){_0x2958f8=_0x2958f8-0x0;var _0x1a02c0=_0x97d1[_0x2958f8];return _0x1a02c0;};'use strict';var client=require(_0x197d('0x0'));exports[_0x197d('0x1')]=function(){return function(){return client[_0x197d('0x2')](_0x197d('0x3'),{'options':{'raw':![],'attributes':['id',_0x197d('0x4'),'timeout',_0x197d('0x5')],'include':[{'model':'User','as':_0x197d('0x6'),'attributes':['id',_0x197d('0x4'),_0x197d('0x7'),_0x197d('0x8')]}]},'log':_0x197d('0x1')});};}; \ No newline at end of file +var _0x8c77=['Agents','../client','GetOpenchannelQueue','name','timeout','User'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c77,0xcd));var _0x78c7=function(_0x38a60b,_0x744abf){_0x38a60b=_0x38a60b-0x0;var _0x2ff5ca=_0x8c77[_0x38a60b];return _0x2ff5ca;};'use strict';var client=require(_0x78c7('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client['Request'](_0x78c7('0x1'),{'options':{'raw':![],'attributes':['id',_0x78c7('0x2'),_0x78c7('0x3'),'strategy'],'include':[{'model':_0x78c7('0x4'),'as':_0x78c7('0x5'),'attributes':['id','name','online','openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 72e9d04..10cf656 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 _0xd136=['update','Request','UpdateOpenchannelQueueReport','DESC','create','CreateOpenchannelQueueReport'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd136,0x94));var _0x6d13=function(_0x19f143,_0x3ea600){_0x19f143=_0x19f143-0x0;var _0x24ca52=_0xd136[_0x19f143];return _0x24ca52;};'use strict';var client=require('../client');exports[_0x6d13('0x0')]=function(_0x44e53c){return client['Request'](_0x6d13('0x1'),{'body':_0x44e53c,'log':_0x6d13('0x1')});};exports[_0x6d13('0x2')]=function(_0x2a3702,_0xec09ab){return client[_0x6d13('0x3')](_0x6d13('0x4'),{'body':_0xec09ab,'options':{'where':{'uniqueid':_0x2a3702},'order':[['id',_0x6d13('0x5')]],'limit':0x1},'log':_0x6d13('0x4')});}; \ No newline at end of file +var _0x4c48=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','Request'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x4c48,0x1e4));var _0x84c4=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0x4c48[_0x421cf8];return _0x145c48;};'use strict';var client=require('../client');exports['create']=function(_0x6a2824){return client[_0x84c4('0x0')](_0x84c4('0x1'),{'body':_0x6a2824,'log':_0x84c4('0x1')});};exports[_0x84c4('0x2')]=function(_0x5524db,_0x5302e8){return client[_0x84c4('0x0')](_0x84c4('0x3'),{'body':_0x5302e8,'options':{'where':{'uniqueid':_0x5524db},'order':[['id',_0x84c4('0x4')]],'limit':0x1},'log':_0x84c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 0944fba..0bb2b6b 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 _0x455d=['Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x3c9851,_0x456a06){var _0x13a106=function(_0x136163){while(--_0x136163){_0x3c9851['push'](_0x3c9851['shift']());}};_0x13a106(++_0x456a06);}(_0x455d,0x190));var _0xd455=function(_0x32aa5f,_0x465220){_0x32aa5f=_0x32aa5f-0x0;var _0x58c80a=_0x455d[_0x32aa5f];return _0x58c80a;};'use strict';var client=require('../client');exports['update']=function(_0x1f4dd1,_0x191e5a){return client[_0xd455('0x0')]('UpdateSmsInteraction',{'body':_0x191e5a,'options':{'where':{'id':_0x1f4dd1}},'log':_0xd455('0x1')});};exports[_0xd455('0x2')]=function(_0x325e88,_0xbe452a){return client[_0xd455('0x0')](_0xd455('0x3'),{'body':_0xbe452a,'options':{'where':{'id':_0x325e88}},'log':_0xd455('0x4')});}; \ No newline at end of file +var _0xab3f=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xab3f,0x72));var _0xfab3=function(_0x35468b,_0x4f6083){_0x35468b=_0x35468b-0x0;var _0x45ab9a=_0xab3f[_0x35468b];return _0x45ab9a;};'use strict';var client=require(_0xfab3('0x0'));exports['update']=function(_0x2a6f4b,_0x2b1bc5){return client[_0xfab3('0x1')](_0xfab3('0x2'),{'body':_0x2b1bc5,'options':{'where':{'id':_0x2a6f4b}},'log':_0xfab3('0x3')});};exports[_0xfab3('0x4')]=function(_0x394308,_0x4387f8){return client[_0xfab3('0x1')](_0xfab3('0x5'),{'body':_0x4387f8,'options':{'where':{'id':_0x394308}},'log':_0xfab3('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index e8c9596..585b59f 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 _0x0a9d=['Request','CreateSmsMessage','createSmsMessage','create'];(function(_0x5295a5,_0x2f106a){var _0x499291=function(_0x5e2f29){while(--_0x5e2f29){_0x5295a5['push'](_0x5295a5['shift']());}};_0x499291(++_0x2f106a);}(_0x0a9d,0x12b));var _0xd0a9=function(_0x559e06,_0x267c2e){_0x559e06=_0x559e06-0x0;var _0x101168=_0x0a9d[_0x559e06];return _0x101168;};'use strict';var client=require('../client');exports[_0xd0a9('0x0')]=function(_0x434af9){return client[_0xd0a9('0x1')](_0xd0a9('0x2'),{'body':_0x434af9,'log':_0xd0a9('0x3')});}; \ No newline at end of file +var _0xafbe=['createSmsMessage','create','Request'];(function(_0x2824f6,_0x380bae){var _0x559287=function(_0x7cc2d7){while(--_0x7cc2d7){_0x2824f6['push'](_0x2824f6['shift']());}};_0x559287(++_0x380bae);}(_0xafbe,0x17e));var _0xeafb=function(_0x302d1a,_0x387081){_0x302d1a=_0x302d1a-0x0;var _0xd82ca=_0xafbe[_0x302d1a];return _0xd82ca;};'use strict';var client=require('../client');exports[_0xeafb('0x0')]=function(_0x589fe8){return client[_0xeafb('0x1')]('CreateSmsMessage',{'body':_0x589fe8,'log':_0xeafb('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index d3abc74..cce4df8 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 _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x50d822,_0x2e46cb){var _0x3ad15e=function(_0x420652){while(--_0x420652){_0x50d822['push'](_0x50d822['shift']());}};_0x3ad15e(++_0x2e46cb);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x1d81d5,_0x49dfdc){var _0x14fb98=function(_0x1204c9){while(--_0x1204c9){_0x1d81d5['push'](_0x1d81d5['shift']());}};_0x14fb98(++_0x49dfdc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x36436d,_0x20292c){_0x36436d=_0x36436d-0x0;var _0x34615d=_0xcb91[_0x36436d];return _0x34615d;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'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 b8b1f2a..9ccf48a 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 _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x4cab1e,_0xfc5cde){var _0x1a8cd8=function(_0x2ce2b6){while(--_0x2ce2b6){_0x4cab1e['push'](_0x4cab1e['shift']());}};_0x1a8cd8(++_0xfc5cde);}(_0x008c,0x188));var _0xc008=function(_0x50dd2d,_0x2ed7d5){_0x50dd2d=_0x50dd2d-0x0;var _0x7b56fc=_0x008c[_0x50dd2d];return _0x7b56fc;};'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 +var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x3f9480,_0x4ead6b){var _0x2a616d=function(_0x567cfb){while(--_0x567cfb){_0x3f9480['push'](_0x3f9480['shift']());}};_0x2a616d(++_0x4ead6b);}(_0x70e0,0x17b));var _0x070e=function(_0x21042d,_0x155df2){_0x21042d=_0x21042d-0x0;var _0x168f79=_0x70e0[_0x21042d];return _0x168f79;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 3e0fff5..46dbe95 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(_0x481e15,_0x11d1ea){var _0x1dfc8f=function(_0x35a508){while(--_0x35a508){_0x481e15['push'](_0x481e15['shift']());}};_0x1dfc8f(++_0x11d1ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x33d25a,_0x5c4416){var _0x3ad46a=function(_0x503c4c){while(--_0x503c4c){_0x33d25a['push'](_0x33d25a['shift']());}};_0x3ad46a(++_0x5c4416);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 9c11651..6317966 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 _0xf95f=['../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction'];(function(_0x5169ca,_0x2356e5){var _0x13f00d=function(_0xd31006){while(--_0xd31006){_0x5169ca['push'](_0x5169ca['shift']());}};_0x13f00d(++_0x2356e5);}(_0xf95f,0x142));var _0xff95=function(_0x4d66fb,_0x98e5a6){_0x4d66fb=_0x4d66fb-0x0;var _0x2460ff=_0xf95f[_0x4d66fb];return _0x2460ff;};'use strict';var client=require(_0xff95('0x0'));exports[_0xff95('0x1')]=function(_0x203af2,_0x7eb2d1){return client[_0xff95('0x2')](_0xff95('0x3'),{'body':_0x7eb2d1,'options':{'where':{'id':_0x203af2}},'log':_0xff95('0x4')});};exports[_0xff95('0x5')]=function(_0x1e81fe,_0x498f22){return client[_0xff95('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x498f22,'options':{'where':{'id':_0x1e81fe}},'log':_0xff95('0x6')});}; \ No newline at end of file +var _0x81c6=['update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x913581,_0x59fd75){var _0x5b695a=function(_0x5b4919){while(--_0x5b4919){_0x913581['push'](_0x913581['shift']());}};_0x5b695a(++_0x59fd75);}(_0x81c6,0x1d5));var _0x681c=function(_0x5ad00b,_0x22c334){_0x5ad00b=_0x5ad00b-0x0;var _0x2aab79=_0x81c6[_0x5ad00b];return _0x2aab79;};'use strict';var client=require('../client');exports[_0x681c('0x0')]=function(_0x5e54d4,_0x59c03c){return client['Request'](_0x681c('0x1'),{'body':_0x59c03c,'options':{'where':{'id':_0x5e54d4}},'log':_0x681c('0x2')});};exports[_0x681c('0x3')]=function(_0x5566e5,_0x44c18e){return client[_0x681c('0x4')](_0x681c('0x5'),{'body':_0x44c18e,'options':{'where':{'id':_0x5566e5}},'log':_0x681c('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 40b86d2..16761da 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 _0x4281=['CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x15fd79,_0x3a8eb1){var _0x468594=function(_0x3bd387){while(--_0x3bd387){_0x15fd79['push'](_0x15fd79['shift']());}};_0x468594(++_0x3a8eb1);}(_0x4281,0xf2));var _0x1428=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0x4281[_0xd0a847];return _0x2536ec;};'use strict';var client=require(_0x1428('0x0'));exports[_0x1428('0x1')]=function(_0x205770){return client['Request'](_0x1428('0x2'),{'body':_0x205770,'log':_0x1428('0x3')});}; \ No newline at end of file +var _0x5f8f=['createWhatsappMessage','create'];(function(_0x374954,_0x18dc36){var _0x42073e=function(_0x1cb45f){while(--_0x1cb45f){_0x374954['push'](_0x374954['shift']());}};_0x42073e(++_0x18dc36);}(_0x5f8f,0x1cd));var _0xf5f8=function(_0x3bd9f7,_0x184d25){_0x3bd9f7=_0x3bd9f7-0x0;var _0x46a7ba=_0x5f8f[_0x3bd9f7];return _0x46a7ba;};'use strict';var client=require('../client');exports[_0xf5f8('0x0')]=function(_0xcf1197){return client['Request']('CreateWhatsappMessage',{'body':_0xcf1197,'log':_0xf5f8('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index c080501..127d7ea 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 _0x1159=['../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','User','online','whatsappPause'];(function(_0x160dde,_0x508298){var _0x3b521c=function(_0x2ba7eb){while(--_0x2ba7eb){_0x160dde['push'](_0x160dde['shift']());}};_0x3b521c(++_0x508298);}(_0x1159,0x10e));var _0x9115=function(_0x440776,_0x5de3de){_0x440776=_0x440776-0x0;var _0x3c1bea=_0x1159[_0x440776];return _0x3c1bea;};'use strict';var client=require(_0x9115('0x0'));exports[_0x9115('0x1')]=function(){return function(){return client[_0x9115('0x2')](_0x9115('0x3'),{'options':{'raw':![],'attributes':['id',_0x9115('0x4'),_0x9115('0x5'),_0x9115('0x6')],'include':[{'model':_0x9115('0x7'),'as':'Agents','attributes':['id',_0x9115('0x4'),_0x9115('0x8'),_0x9115('0x9')]}]},'log':_0x9115('0x1')});};}; \ No newline at end of file +var _0x4635=['getWhatsappQueues','Request','GetWhatsappQueue','timeout','strategy','User','Agents','online'];(function(_0x4c6d19,_0x149f70){var _0x40b6c7=function(_0x258143){while(--_0x258143){_0x4c6d19['push'](_0x4c6d19['shift']());}};_0x40b6c7(++_0x149f70);}(_0x4635,0xd0));var _0x5463=function(_0x254be3,_0x3baf49){_0x254be3=_0x254be3-0x0;var _0x2f3361=_0x4635[_0x254be3];return _0x2f3361;};'use strict';var client=require('../client');exports[_0x5463('0x0')]=function(){return function(){return client[_0x5463('0x1')](_0x5463('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x5463('0x3'),_0x5463('0x4')],'include':[{'model':_0x5463('0x5'),'as':_0x5463('0x6'),'attributes':['id','name',_0x5463('0x7'),'whatsappPause']}]},'log':_0x5463('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 4a6dd95..84c02c0 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 _0x2120=['UpdateWhatsappQueueReport','../client','Request','CreateWhatsappQueueReport','update','DESC'];(function(_0x1da5d2,_0x112bfb){var _0x348662=function(_0x3a8372){while(--_0x3a8372){_0x1da5d2['push'](_0x1da5d2['shift']());}};_0x348662(++_0x112bfb);}(_0x2120,0x145));var _0x0212=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0x2120[_0x1e2321];return _0x1d346d;};'use strict';var client=require(_0x0212('0x0'));exports['create']=function(_0x4bd9c6){return client[_0x0212('0x1')](_0x0212('0x2'),{'body':_0x4bd9c6,'log':_0x0212('0x2')});};exports[_0x0212('0x3')]=function(_0x10cf24,_0x150e8c){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x150e8c,'options':{'where':{'uniqueid':_0x10cf24},'order':[['id',_0x0212('0x4')]],'limit':0x1},'log':_0x0212('0x5')});}; \ No newline at end of file +var _0xab11=['UpdateWhatsappQueueReport','create','CreateWhatsappQueueReport','Request'];(function(_0x178619,_0x8acdca){var _0x5d16a0=function(_0x3092e3){while(--_0x3092e3){_0x178619['push'](_0x178619['shift']());}};_0x5d16a0(++_0x8acdca);}(_0xab11,0x10d));var _0x1ab1=function(_0x49be97,_0x3dbc43){_0x49be97=_0x49be97-0x0;var _0x3b16be=_0xab11[_0x49be97];return _0x3b16be;};'use strict';var client=require('../client');exports[_0x1ab1('0x0')]=function(_0x1265e0){return client['Request'](_0x1ab1('0x1'),{'body':_0x1265e0,'log':_0x1ab1('0x1')});};exports['update']=function(_0x2c9c38,_0x4630ea){return client[_0x1ab1('0x2')](_0x1ab1('0x3'),{'body':_0x4630ea,'options':{'where':{'uniqueid':_0x2c9c38},'order':[['id','DESC']],'limit':0x1},'log':_0x1ab1('0x3')});}; \ 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 f4aae9f..4fc6030 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 _0xac23=['seq-queue','../../../../config/logger','./strategy','string','number','timeout\x20is\x20a\x20number','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','map','message','join','find','agents','timeout','createQueue','atimeout','channel','START:%s','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','stop','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xac23,0xb6));var _0x3ac2=function(_0x258919,_0x1754e6){_0x258919=_0x258919-0x0;var _0xfbd68b=_0xac23[_0x258919];return _0xfbd68b;};'use strict';var schema=require(_0x3ac2('0x0'));var _=require(_0x3ac2('0x1'));var util=require(_0x3ac2('0x2'));var seqqueue=require(_0x3ac2('0x3'));var logger=require(_0x3ac2('0x4'))('routing');var strategy=require(_0x3ac2('0x5'));var queue=schema({'name':{'type':_0x3ac2('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x3ac2('0x7'),'message':_0x3ac2('0x8')}});function writeLog(_0x2eb429,_0x5832d7,_0x4f32b6){return logger['info'](util['format'](_0x3ac2('0x9'),_0x2eb429,_0x5832d7[_0x3ac2('0xa')],_0x4f32b6));}function handleFindAgent(_0x241ae9){return function(_0x5af26d){return _0x5af26d['name'][_0x3ac2('0xb')]()===_0x241ae9[_0x3ac2('0xb')]();};}exports[_0x3ac2('0xc')]=function(_0x7e9e4c,_0x31ee3e,_0x3aed29,_0x347432){return function(_0x5511a1){try{var _0x5ecfb8={'name':_0x31ee3e[0x0],'timeout':_0x31ee3e[0x1]};var _0xed97a=queue[_0x3ac2('0x0')](_0x5ecfb8,{'typecast':!![]});if(_0xed97a[_0x3ac2('0xd')]){logger[_0x3ac2('0xe')]('[%s][AGENT]\x20%s',_0x7e9e4c,_[_0x3ac2('0xf')](_0xed97a,_0x3ac2('0x10'))[_0x3ac2('0x11')](',\x20'));_0x5511a1['stop']();}else{var _0xaef8fd=_[_0x3ac2('0x12')](_0x3aed29[_0x3ac2('0x13')],handleFindAgent(_0x5ecfb8[_0x3ac2('0xa')]));if(_0xaef8fd){var _0x125aa9=(_0x5ecfb8[_0x3ac2('0x14')]||0xa)*0x3e8;var _0x2d1e5c,_0x38c3c5;var _0x143bdc=seqqueue[_0x3ac2('0x15')](_0x125aa9);_0x143bdc['id']=_0x7e9e4c;_0x143bdc[_0x3ac2('0x16')]=_0x125aa9;_0x143bdc['channel']=_0x347432[_0x3ac2('0x17')];writeLog(_0x7e9e4c,_0xaef8fd,util['format'](_0x3ac2('0x18'),_0x125aa9));_0x3aed29['rules'][_0x7e9e4c]['on'](_0x3ac2('0x19'),function(){logger[_0x3ac2('0x1a')](_0x3ac2('0x1b'),_0x7e9e4c);clearTimeout(_0x38c3c5);_0x38c3c5=undefined;_0x143bdc[_0x3ac2('0x1c')]();if(_0x3aed29[_0x3ac2('0x1d')][_0x7e9e4c]){delete _0x3aed29['rules'][_0x7e9e4c];}_0x5511a1['stop']();});_0x3aed29[_0x3ac2('0x1d')][_0x7e9e4c]['on'](_0x3ac2('0x1e'),function(){if(_0x3aed29[_0x3ac2('0x1d')][_0x7e9e4c]){delete _0x3aed29['rules'][_0x7e9e4c];}});_0x38c3c5=setTimeout(function(){logger[_0x3ac2('0x1a')](_0x3ac2('0x1f'),_0x7e9e4c);clearTimeout(_0x38c3c5);_0x143bdc[_0x3ac2('0x1c')]();_0x5511a1[_0x3ac2('0x20')]();},_0x125aa9);strategy['agent'](_0x143bdc,_0xaef8fd,_0x3aed29,_0x347432);}else{logger[_0x3ac2('0xe')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x7e9e4c,_0x5ecfb8['name']);_0x5511a1[_0x3ac2('0x21')]();}}}catch(_0x124bc){console[_0x3ac2('0x22')](_0x124bc);logger[_0x3ac2('0xe')](_0x3ac2('0x23'),_0x7e9e4c,_0x124bc[_0x3ac2('0x24')]);_0x5511a1[_0x3ac2('0x21')]();}};}; \ No newline at end of file +var _0x0476=['timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x54559f,_0x36cfe5){var _0x13dbe7=function(_0x21b576){while(--_0x21b576){_0x54559f['push'](_0x54559f['shift']());}};_0x13dbe7(++_0x36cfe5);}(_0x0476,0x184));var _0x6047=function(_0x17b0d4,_0x377add){_0x17b0d4=_0x17b0d4-0x0;var _0x2d02c7=_0x0476[_0x17b0d4];return _0x2d02c7;};'use strict';var schema=require(_0x6047('0x0'));var _=require(_0x6047('0x1'));var util=require(_0x6047('0x2'));var seqqueue=require(_0x6047('0x3'));var logger=require('../../../../config/logger')(_0x6047('0x4'));var strategy=require(_0x6047('0x5'));var queue=schema({'name':{'type':_0x6047('0x6'),'required':!![],'message':_0x6047('0x7')},'timeout':{'type':'number','message':_0x6047('0x8')}});function writeLog(_0x44287d,_0x526015,_0x322975){return logger[_0x6047('0x9')](util[_0x6047('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x44287d,_0x526015[_0x6047('0xb')],_0x322975));}function handleFindAgent(_0x464501){return function(_0x3f4067){return _0x3f4067[_0x6047('0xb')][_0x6047('0xc')]()===_0x464501[_0x6047('0xc')]();};}exports[_0x6047('0xd')]=function(_0x49feed,_0x5abf9b,_0x110520,_0x2df906){return function(_0x24fed4){try{var _0x348918={'name':_0x5abf9b[0x0],'timeout':_0x5abf9b[0x1]};var _0x4409d3=queue[_0x6047('0x0')](_0x348918,{'typecast':!![]});if(_0x4409d3[_0x6047('0xe')]){logger[_0x6047('0xf')](_0x6047('0x10'),_0x49feed,_[_0x6047('0x11')](_0x4409d3,'message')['join'](',\x20'));_0x24fed4[_0x6047('0x12')]();}else{var _0x297b81=_[_0x6047('0x13')](_0x110520[_0x6047('0x14')],handleFindAgent(_0x348918[_0x6047('0xb')]));if(_0x297b81){var _0x22678b=(_0x348918[_0x6047('0x15')]||0xa)*0x3e8;var _0xb35add,_0x4b3a70;var _0x57c2c0=seqqueue[_0x6047('0x16')](_0x22678b);_0x57c2c0['id']=_0x49feed;_0x57c2c0[_0x6047('0x17')]=_0x22678b;_0x57c2c0[_0x6047('0x18')]=_0x2df906['channel'];writeLog(_0x49feed,_0x297b81,util[_0x6047('0xa')](_0x6047('0x19'),_0x22678b));_0x110520[_0x6047('0x1a')][_0x49feed]['on'](_0x6047('0x1b'),function(){logger[_0x6047('0x9')](_0x6047('0x1c'),_0x49feed);clearTimeout(_0x4b3a70);_0x4b3a70=undefined;_0x57c2c0[_0x6047('0x1d')]();if(_0x110520[_0x6047('0x1a')][_0x49feed]){delete _0x110520[_0x6047('0x1a')][_0x49feed];}_0x24fed4[_0x6047('0x12')]();});_0x110520[_0x6047('0x1a')][_0x49feed]['on'](_0x6047('0x1e'),function(){if(_0x110520[_0x6047('0x1a')][_0x49feed]){delete _0x110520[_0x6047('0x1a')][_0x49feed];}});_0x4b3a70=setTimeout(function(){logger[_0x6047('0x9')](_0x6047('0x1f'),_0x49feed);clearTimeout(_0x4b3a70);_0x57c2c0['close']();_0x24fed4[_0x6047('0x20')]();},_0x22678b);strategy['agent'](_0x57c2c0,_0x297b81,_0x110520,_0x2df906);}else{logger[_0x6047('0xf')](_0x6047('0x21'),_0x49feed,_0x348918[_0x6047('0xb')]);_0x24fed4[_0x6047('0x12')]();}}}catch(_0x38a7e9){console['log'](_0x38a7e9);logger[_0x6047('0xf')](_0x6047('0x22'),_0x49feed,_0x38a7e9[_0x6047('0x23')]);_0x24fed4[_0x6047('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index e29288b..11ba7c3 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 _0x8330=['info','[%s][AMAZONLEX]\x20%s','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','AccountId','upperFirst','InteractionId','created','body','getMustacheRender','Message','then','error','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','next','providerName','providerResponse','create','dialogState','catch','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction'];(function(_0x701b36,_0xfc90e3){var _0x252a1d=function(_0xd8ba0f){while(--_0xd8ba0f){_0x701b36['push'](_0x701b36['shift']());}};_0x252a1d(++_0xfc90e3);}(_0x8330,0x1b6));var _0x0833=function(_0x991a42,_0xe5161d){_0x991a42=_0x991a42-0x0;var _0x3c04ed=_0x8330[_0x991a42];return _0x3c04ed;};'use strict';var _=require(_0x0833('0x0'));var moment=require('moment');var AWS=require(_0x0833('0x1'));var utils=require(_0x0833('0x2'));var logger=require(_0x0833('0x3'))(_0x0833('0x4'));var rpc={'chatMessage':require(_0x0833('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x0833('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x0833('0x7')),'whatsappMessage':require(_0x0833('0x8'))};exports[_0x0833('0x9')]=function(_0x49bc18,_0x753b5e){return function(_0x497bce){try{if(!_[_0x0833('0xa')](this[_0x0833('0xb')]['UserId'])){logger[_0x0833('0xc')](_0x0833('0xd'),_0x49bc18,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x497bce['next']();}var _0x1b6186={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x0833('0xe')),'direction':_0x0833('0xf')};if(this[_0x0833('0x10')]==='sms'||this[_0x0833('0x10')]===_0x0833('0x11')){_0x1b6186['phone']=this[_0x0833('0xb')][_0x0833('0x12')];}var _0x6fbed0=this[_0x0833('0x10')];if(_0x6fbed0===_0x0833('0x13')){_0x1b6186[_0x0833('0x14')]=this['account']['id'];}else{_0x1b6186[_['upperFirst'](_0x6fbed0)+_0x0833('0x15')]=this['account']['id'];}_0x1b6186[_[_0x0833('0x16')](_0x6fbed0)+_0x0833('0x17')]=this['interaction']['id'];if(this[_0x0833('0xb')][_0x0833('0x18')]){var _0x2f0022=_0x753b5e[0x4];if(!_['isEmpty'](_0x2f0022)){_0x1b6186[_0x0833('0x19')]=utils[_0x0833('0x1a')](_0x2f0022,this);return rpc[_0x6fbed0+_0x0833('0x1b')]['create'](_0x1b6186)[_0x0833('0x1c')](function(_0x1214d8){logger[_0x0833('0xc')](_0x0833('0xd'),_0x49bc18,_0x1b6186[_0x0833('0x19')]);})['catch'](function(_0x50369f){logger[_0x0833('0x1d')](_0x0833('0xd'),_0x49bc18,JSON[_0x0833('0x1e')](_0x50369f));})[_0x0833('0x1f')](function(){logger[_0x0833('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x49bc18);_0x497bce[_0x0833('0x20')]();});}else{logger[_0x0833('0xc')](_0x0833('0x21'),_0x49bc18);_0x497bce['stop']();}}else{var _0x359510=this;var _0x4c77f5=new AWS[(_0x0833('0x22'))]({'accessKeyId':_0x753b5e[0x0],'secretAccessKey':_0x753b5e[0x1],'region':_0x753b5e[0x2]});var _0x139537={'botAlias':_0x0833('0x23'),'botName':_0x753b5e[0x3],'inputText':this[_0x0833('0x24')]['body'],'userId':this[_0x0833('0x10')]+':'+this['interaction']['id'][_0x0833('0x25')]()};_0x4c77f5[_0x0833('0x26')](_0x139537,function(_0x122af8,_0x1464a0){if(_0x122af8){logger[_0x0833('0x1d')](_0x0833('0xd'),_0x49bc18,_0x122af8['message']);_0x497bce[_0x0833('0x27')]();}else if(_0x1464a0&&_0x1464a0[_0x0833('0x24')]){_0x359510[_0x0833('0x19')]['amazonlex']=_0x1464a0;_0x1b6186[_0x0833('0x19')]=_0x1464a0[_0x0833('0x24')];_0x1b6186[_0x0833('0x28')]='amazonlex';_0x1b6186[_0x0833('0x29')]=JSON[_0x0833('0x1e')](_0x1464a0);return rpc[_0x6fbed0+_0x0833('0x1b')][_0x0833('0x2a')](_0x1b6186)[_0x0833('0x1c')](function(_0x5a1d68){logger[_0x0833('0xc')](_0x0833('0xd'),_0x49bc18,_0x1b6186['body']);if(_0x1464a0[_0x0833('0x2b')]=='Failed'){_0x497bce[_0x0833('0x27')]();}else{_0x497bce[_0x0833('0x20')]();}})[_0x0833('0x2c')](function(_0x448138){logger[_0x0833('0x1d')](_0x0833('0xd'),_0x49bc18,JSON['stringify'](_0x448138));_0x497bce['next']();});}else{_0x497bce[_0x0833('0x27')]();}});}}catch(_0x36e259){logger[_0x0833('0x1d')](_0x0833('0xd'),_0x49bc18,JSON['stringify'](_0x36e259));_0x497bce['stop']();}};}; \ No newline at end of file +var _0x826b=['InteractionId','created','isEmpty','body','getMustacheRender','create','then','catch','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','postText','error','amazonlex','providerName','providerResponse','dialogState','stringify','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','AccountId','account'];(function(_0x415275,_0x180e37){var _0x3a65b7=function(_0x459d26){while(--_0x459d26){_0x415275['push'](_0x415275['shift']());}};_0x3a65b7(++_0x180e37);}(_0x826b,0x18d));var _0xb826=function(_0xc4e346,_0x4fdcf4){_0xc4e346=_0xc4e346-0x0;var _0x2c60ac=_0x826b[_0xc4e346];return _0x2c60ac;};'use strict';var _=require(_0xb826('0x0'));var moment=require(_0xb826('0x1'));var AWS=require('aws-sdk');var utils=require(_0xb826('0x2'));var logger=require(_0xb826('0x3'))('routing');var rpc={'chatMessage':require(_0xb826('0x4')),'openchannelMessage':require(_0xb826('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xb826('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xb826('0x7'))};exports[_0xb826('0x8')]=function(_0x263994,_0x16a7c1){return function(_0x58b80d){try{if(!_[_0xb826('0x9')](this[_0xb826('0xa')][_0xb826('0xb')])){logger[_0xb826('0xc')](_0xb826('0xd'),_0x263994,_0xb826('0xe'));return _0x58b80d[_0xb826('0xf')]();}var _0x59cf5a={'ContactId':this[_0xb826('0x10')]['id'],'sentAt':moment()['format'](_0xb826('0x11')),'direction':_0xb826('0x12')};if(this['channel']==='sms'||this[_0xb826('0x13')]===_0xb826('0x14')){_0x59cf5a[_0xb826('0x15')]=this['interaction'][_0xb826('0x15')];}var _0x384dc8=this[_0xb826('0x13')];if(_0x384dc8===_0xb826('0x16')){_0x59cf5a[_0xb826('0x17')]=this['account']['id'];}else{_0x59cf5a[_['upperFirst'](_0x384dc8)+_0xb826('0x18')]=this[_0xb826('0x19')]['id'];}_0x59cf5a[_['upperFirst'](_0x384dc8)+_0xb826('0x1a')]=this[_0xb826('0xa')]['id'];if(this['interaction'][_0xb826('0x1b')]){var _0x1284a5=_0x16a7c1[0x4];if(!_[_0xb826('0x1c')](_0x1284a5)){_0x59cf5a[_0xb826('0x1d')]=utils[_0xb826('0x1e')](_0x1284a5,this);return rpc[_0x384dc8+'Message'][_0xb826('0x1f')](_0x59cf5a)[_0xb826('0x20')](function(_0xddd233){logger[_0xb826('0xc')]('[%s][AMAZONLEX]\x20%s',_0x263994,_0x59cf5a[_0xb826('0x1d')]);})[_0xb826('0x21')](function(_0x3a04ba){logger['error']('[%s][AMAZONLEX]\x20%s',_0x263994,JSON['stringify'](_0x3a04ba));})[_0xb826('0x22')](function(){logger[_0xb826('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x263994);_0x58b80d[_0xb826('0x23')]();});}else{logger['info'](_0xb826('0x24'),_0x263994);_0x58b80d[_0xb826('0x23')]();}}else{var _0xd05528=this;var _0x313ccd=new AWS[(_0xb826('0x25'))]({'accessKeyId':_0x16a7c1[0x0],'secretAccessKey':_0x16a7c1[0x1],'region':_0x16a7c1[0x2]});var _0xf043fe={'botAlias':_0xb826('0x26'),'botName':_0x16a7c1[0x3],'inputText':this[_0xb826('0x27')]['body'],'userId':this['channel']+':'+this[_0xb826('0xa')]['id']['toString']()};_0x313ccd[_0xb826('0x28')](_0xf043fe,function(_0x633627,_0xa5c4e8){if(_0x633627){logger[_0xb826('0x29')](_0xb826('0xd'),_0x263994,_0x633627['message']);_0x58b80d[_0xb826('0xf')]();}else if(_0xa5c4e8&&_0xa5c4e8['message']){_0xd05528[_0xb826('0x1d')][_0xb826('0x2a')]=_0xa5c4e8;_0x59cf5a[_0xb826('0x1d')]=_0xa5c4e8[_0xb826('0x27')];_0x59cf5a[_0xb826('0x2b')]=_0xb826('0x2a');_0x59cf5a[_0xb826('0x2c')]=JSON['stringify'](_0xa5c4e8);return rpc[_0x384dc8+'Message'][_0xb826('0x1f')](_0x59cf5a)[_0xb826('0x20')](function(_0x5d3c10){logger[_0xb826('0xc')](_0xb826('0xd'),_0x263994,_0x59cf5a[_0xb826('0x1d')]);if(_0xa5c4e8[_0xb826('0x2d')]=='Failed'){_0x58b80d[_0xb826('0xf')]();}else{_0x58b80d[_0xb826('0x23')]();}})[_0xb826('0x21')](function(_0x15d755){logger[_0xb826('0x29')](_0xb826('0xd'),_0x263994,JSON[_0xb826('0x2e')](_0x15d755));_0x58b80d[_0xb826('0xf')]();});}else{_0x58b80d['next']();}});}}catch(_0x4e31fa){logger[_0xb826('0x29')](_0xb826('0xd'),_0x263994,JSON['stringify'](_0x4e31fa));_0x58b80d[_0xb826('0x23')]();}};}; \ 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 2bbfd24..145160e 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 _0x5eed=['created','interaction','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','format','out','getMustacheRender','message','from','phone','read','subject','Re:\x20','upperFirst','account','InteractionId','Message','inReplyTo','messageId','','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','create','then','stringify','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','catch','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','autoreplyExecuted','stop','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/faxInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil'];(function(_0xefa16c,_0x7bad6b){var _0xf01061=function(_0x3c6626){while(--_0x3c6626){_0xefa16c['push'](_0xefa16c['shift']());}};_0xf01061(++_0x7bad6b);}(_0x5eed,0x19e));var _0xd5ee=function(_0x27f9a0,_0x3d4324){_0x27f9a0=_0x27f9a0-0x0;var _0x500bc9=_0x5eed[_0x27f9a0];return _0x500bc9;};'use strict';var _=require('lodash');var moment=require(_0xd5ee('0x0'));var utils=require(_0xd5ee('0x1'));var logger=require(_0xd5ee('0x2'))(_0xd5ee('0x3'));var rpc={'chatMessage':require(_0xd5ee('0x4')),'openchannelMessage':require(_0xd5ee('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xd5ee('0x6')),'whatsappMessage':require(_0xd5ee('0x7')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0xd5ee('0x8')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xd5ee('0x9'));exports[_0xd5ee('0xa')]=function(_0x39f242,_0x3e9adf,_0x2ae6e4,_0x5752f0){return function(_0x1a68fe){try{var _0x58949b=this[_0xd5ee('0xb')];if(_0x58949b===_0xd5ee('0xc')&&_0x5752f0[_0xd5ee('0xd')][_0xd5ee('0xe')]){logger[_0xd5ee('0xf')](_0xd5ee('0x10'),_0x39f242,_0xd5ee('0x11'));return _0x1a68fe[_0xd5ee('0x12')]();}if(_0x3e9adf[0x0]==='1'&&(_[_0xd5ee('0x13')](this['interaction'][_0xd5ee('0x14')])||!this[_0xd5ee('0x15')][_0xd5ee('0x14')])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x39f242,_0xd5ee('0x16'));return _0x1a68fe[_0xd5ee('0x12')]();}if(_0x3e9adf[0x0]==='2'&&this['interaction']['autoreplyExecuted']){logger[_0xd5ee('0xf')](_0xd5ee('0x17'),_0x39f242,'One\x20Time\x20already\x20sent');return _0x1a68fe[_0xd5ee('0x12')]();}var _0x424fc2={'ContactId':this['contact']['id'],'sentAt':moment()[_0xd5ee('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xd5ee('0x19')};if(this[_0xd5ee('0xb')]==='mail'){_0x424fc2[_0xd5ee('0xd')]=utils[_0xd5ee('0x1a')](_0x3e9adf[0x2],this);}else{_0x424fc2[_0xd5ee('0xd')]=utils['getMustacheRender'](_0x3e9adf[0x1],this);}if(this['message']){_0x424fc2['to']=this[_0xd5ee('0x1b')][_0xd5ee('0x1c')]||'';if(this[_0xd5ee('0xb')]===_0xd5ee('0xc')&&_0x3e9adf[0x1]==='1'){_0x424fc2['cc']=this[_0xd5ee('0x1b')]['cc']||'';}_0x424fc2[_0xd5ee('0x1c')]=this['message']['to']||'';_0x424fc2[_0xd5ee('0x1d')]=this['message'][_0xd5ee('0x1d')]||'';_0x424fc2[_0xd5ee('0x1e')]=!![];if(this['message'][_0xd5ee('0x1f')]){_0x424fc2[_0xd5ee('0x1f')]='';_0x424fc2[_0xd5ee('0x1f')]+=_['startsWith'](this[_0xd5ee('0x1b')][_0xd5ee('0x1f')],'Re:')?'':_0xd5ee('0x20');_0x424fc2[_0xd5ee('0x1f')]+=this[_0xd5ee('0x1b')][_0xd5ee('0x1f')];}}if(this[_0xd5ee('0xb')]==='chat'){_0x424fc2['ChatWebsiteId']=this['account']['id'];}else{_0x424fc2[_[_0xd5ee('0x21')](this[_0xd5ee('0xb')])+'AccountId']=this[_0xd5ee('0x22')]['id'];}_0x424fc2[_['upperFirst'](this[_0xd5ee('0xb')])+_0xd5ee('0x23')]=this[_0xd5ee('0x15')]['id'];var _0x53be16=this[_0xd5ee('0x15')];if(rpc[this[_0xd5ee('0xb')]+_0xd5ee('0x24')]){if(this['channel']===_0xd5ee('0xc')){_0x424fc2[_0xd5ee('0x25')]=this[_0xd5ee('0x1b')][_0xd5ee('0x26')];_0x424fc2['html']=_0xd5ee('0x27')+_['replace'](_0x424fc2[_0xd5ee('0xd')],_0xd5ee('0x28'),_0xd5ee('0x29'))+_0xd5ee('0x2a');_0x424fc2[_0xd5ee('0x2b')]={'Auto-Submitted':_0xd5ee('0x2c'),'X-Auto-Response-Suppress':_0xd5ee('0x2d'),'Precedence':_0xd5ee('0x2e')};return mailRpc[_0xd5ee('0x2f')](this[_0xd5ee('0x22')][_0xd5ee('0x30')],_0x424fc2)['then'](function(_0x4abb99){logger[_0xd5ee('0xf')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x39f242);_0x424fc2[_0xd5ee('0x26')]=_0x4abb99[_0xd5ee('0x1b')][_0xd5ee('0x26')];return rpc[_0x58949b+'Message'][_0xd5ee('0x31')](_0x424fc2);})[_0xd5ee('0x32')](function(_0x319c02){logger['info'](_0xd5ee('0x10'),_0x39f242,JSON[_0xd5ee('0x33')](_0x319c02));})['catch'](function(_0x175304){logger['error'](_0xd5ee('0x34'),_0x39f242,JSON[_0xd5ee('0x33')](_0x175304));})[_0xd5ee('0x35')](function(){Promise[_0xd5ee('0x36')]()[_0xd5ee('0x32')](function(){if(_0x3e9adf[0x0]!=='2'||_0x53be16['autoreplyExecuted'])return;return rpc[_0x58949b+_0xd5ee('0x37')][_0xd5ee('0x38')](_0x53be16['id'],{'autoreplyExecuted':!![]})[_0xd5ee('0x32')](function(_0xea2425){logger[_0xd5ee('0xf')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x39f242,JSON[_0xd5ee('0x33')](_0xea2425));})[_0xd5ee('0x39')](function(_0x3bfc54){logger[_0xd5ee('0x3a')](_0xd5ee('0x3b'),_0x39f242,JSON[_0xd5ee('0x33')](_0x3bfc54));});})[_0xd5ee('0x32')](function(){_0x1a68fe[_0xd5ee('0x12')]();});});}else{return rpc[this[_0xd5ee('0xb')]+'Message'][_0xd5ee('0x31')](_0x424fc2)['then'](function(){logger[_0xd5ee('0xf')]('[%s][AUTOREPLY]\x20%s',_0x39f242,_0x424fc2[_0xd5ee('0xd')]);})[_0xd5ee('0x39')](function(_0x39eeeb){logger[_0xd5ee('0x3a')]('[%s][AUTOREPLY]\x20%s',_0x39f242,JSON['stringify'](_0x39eeeb));})[_0xd5ee('0x35')](function(){Promise[_0xd5ee('0x36')]()[_0xd5ee('0x32')](function(){if(_0x3e9adf[0x0]!=='2'||_0x53be16[_0xd5ee('0x3c')])return;return rpc[_0x58949b+_0xd5ee('0x37')]['update'](_0x53be16['id'],{'autoreplyExecuted':!![]})[_0xd5ee('0x32')](function(_0xccba03){logger[_0xd5ee('0xf')](_0xd5ee('0x17'),_0x39f242,JSON[_0xd5ee('0x33')](_0xccba03));})[_0xd5ee('0x39')](function(_0x3ce266){logger['error'](_0xd5ee('0x3b'),_0x39f242,JSON['stringify'](_0x3ce266));});})[_0xd5ee('0x32')](function(){_0x1a68fe[_0xd5ee('0x12')]();});});}}}catch(_0x45be0c){logger['error'](_0xd5ee('0x10'),_0x39f242,JSON[_0xd5ee('0x33')](_0x45be0c));_0x1a68fe[_0xd5ee('0x3d')]();}};}; \ No newline at end of file +var _0x26d6=['create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','update','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','Autoreply\x20already\x20sent','interaction','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','Message','messageId','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT'];(function(_0x1828a6,_0xc3cbcd){var _0x97447b=function(_0x341598){while(--_0x341598){_0x1828a6['push'](_0x1828a6['shift']());}};_0x97447b(++_0xc3cbcd);}(_0x26d6,0x11d));var _0x626d=function(_0x4d183d,_0x123de0){_0x4d183d=_0x4d183d-0x0;var _0x431236=_0x26d6[_0x4d183d];return _0x431236;};'use strict';var _=require(_0x626d('0x0'));var moment=require(_0x626d('0x1'));var utils=require(_0x626d('0x2'));var logger=require(_0x626d('0x3'))(_0x626d('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x626d('0x5')),'mailMessage':require(_0x626d('0x6')),'smsMessage':require(_0x626d('0x7')),'faxMessage':require(_0x626d('0x8')),'whatsappMessage':require(_0x626d('0x9')),'chatInteraction':require(_0x626d('0xa')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x626d('0xb')),'whatsappInteraction':require(_0x626d('0xc'))};var mailRpc=require(_0x626d('0xd'));exports[_0x626d('0xe')]=function(_0x1dfe53,_0x1478d9,_0x55ea26,_0xef12c2){return function(_0x11a547){try{var _0x3392ba=this[_0x626d('0xf')];if(_0x3392ba===_0x626d('0x10')&&_0xef12c2[_0x626d('0x11')]['isAutoreply']){logger[_0x626d('0x12')](_0x626d('0x13'),_0x1dfe53,_0x626d('0x14'));return _0x11a547[_0x626d('0x15')]();}if(_0x1478d9[0x0]==='1'&&(_[_0x626d('0x16')](this['interaction'][_0x626d('0x17')])||!this['interaction']['created'])){logger['info'](_0x626d('0x13'),_0x1dfe53,_0x626d('0x18'));return _0x11a547[_0x626d('0x15')]();}if(_0x1478d9[0x0]==='2'&&this[_0x626d('0x19')][_0x626d('0x1a')]){logger[_0x626d('0x12')](_0x626d('0x1b'),_0x1dfe53,'One\x20Time\x20already\x20sent');return _0x11a547[_0x626d('0x15')]();}var _0x4311c5={'ContactId':this['contact']['id'],'sentAt':moment()[_0x626d('0x1c')](_0x626d('0x1d')),'direction':_0x626d('0x1e')};if(this[_0x626d('0xf')]===_0x626d('0x10')){_0x4311c5[_0x626d('0x11')]=utils[_0x626d('0x1f')](_0x1478d9[0x2],this);}else{_0x4311c5['body']=utils['getMustacheRender'](_0x1478d9[0x1],this);}if(this[_0x626d('0x20')]){_0x4311c5['to']=this[_0x626d('0x20')]['from']||'';if(this[_0x626d('0xf')]===_0x626d('0x10')&&_0x1478d9[0x1]==='1'){_0x4311c5['cc']=this[_0x626d('0x20')]['cc']||'';}_0x4311c5[_0x626d('0x21')]=this[_0x626d('0x20')]['to']||'';_0x4311c5[_0x626d('0x22')]=this['message'][_0x626d('0x22')]||'';_0x4311c5['read']=!![];if(this['message'][_0x626d('0x23')]){_0x4311c5[_0x626d('0x23')]='';_0x4311c5[_0x626d('0x23')]+=_[_0x626d('0x24')](this[_0x626d('0x20')][_0x626d('0x23')],_0x626d('0x25'))?'':_0x626d('0x26');_0x4311c5[_0x626d('0x23')]+=this[_0x626d('0x20')]['subject'];}}if(this['channel']===_0x626d('0x27')){_0x4311c5[_0x626d('0x28')]=this[_0x626d('0x29')]['id'];}else{_0x4311c5[_['upperFirst'](this[_0x626d('0xf')])+_0x626d('0x2a')]=this[_0x626d('0x29')]['id'];}_0x4311c5[_[_0x626d('0x2b')](this[_0x626d('0xf')])+_0x626d('0x2c')]=this[_0x626d('0x19')]['id'];var _0x473026=this[_0x626d('0x19')];if(rpc[this[_0x626d('0xf')]+_0x626d('0x2d')]){if(this[_0x626d('0xf')]===_0x626d('0x10')){_0x4311c5['inReplyTo']=this[_0x626d('0x20')][_0x626d('0x2e')];_0x4311c5[_0x626d('0x2f')]=_0x626d('0x30')+_[_0x626d('0x31')](_0x4311c5[_0x626d('0x11')],_0x626d('0x32'),']+(>|$)/g,''),'priorityTrue':_0x84ed4[0x1],'priorityFalse':_0x84ed4[0x2]};var _0x1cf7e0=gotoif[_0xc98f('0x0')](_0x578c07,{'typecast':!![]});if(_0x1cf7e0[_0xc98f('0xc')]){logger[_0xc98f('0xd')]('[%s][GOTOIF]\x20%s',_0x22a09c,_['map'](_0x1cf7e0,_0xc98f('0xe'))['join'](',\x20'));_0xdef90f['stop']();}else{try{var _0x2eaa69=eval('('+_0x578c07[_0xc98f('0xf')]+')');var _0x3a8e21=_0x2eaa69?_0x578c07[_0xc98f('0x10')]:_0x578c07[_0xc98f('0x11')];logger[_0xc98f('0x12')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x22a09c,_0x578c07[_0xc98f('0xf')],_0x2eaa69,_0x3a8e21||_0xc98f('0x13'));if(_0x3a8e21){var _0x2ff8ba=_[_0xc98f('0x14')](_0xdef90f[_0xc98f('0x15')](),{'p':_0x3a8e21});if(_0x2ff8ba>=0x0){logger[_0xc98f('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x22a09c,_0x3a8e21||_0xc98f('0x13'),_0x2ff8ba);_0xdef90f['next'](_0x2ff8ba);}else{logger[_0xc98f('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x22a09c,_0x3a8e21||_0xc98f('0x13'));_0xdef90f[_0xc98f('0x16')]();}}else{_0xdef90f[_0xc98f('0x13')]();}}catch(_0x1af13a){logger['error'](_0xc98f('0x17'),_0x22a09c,_0x1af13a[_0xc98f('0xe')]);_0xdef90f[_0xc98f('0x16')]();}}}catch(_0x4aefb4){logger[_0xc98f('0xd')]('[%s][GOTOIF]\x20%s',_0x22a09c,JSON[_0xc98f('0x18')](_0x4aefb4));_0xdef90f[_0xc98f('0x16')]();}};}; \ No newline at end of file +var _0x239a=['priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','error','[%s][GOTOIF]\x20%s','map','message','join','condition'];(function(_0x192467,_0x20a200){var _0x4f8fbc=function(_0x320269){while(--_0x320269){_0x192467['push'](_0x192467['shift']());}};_0x4f8fbc(++_0x20a200);}(_0x239a,0x119));var _0xa239=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x239a[_0x321bb2];return _0x9c12ed;};'use strict';var schema=require(_0xa239('0x0'));var _=require(_0xa239('0x1'));var htmlToText=require(_0xa239('0x2'));var utils=require(_0xa239('0x3'));var logger=require(_0xa239('0x4'))(_0xa239('0x5'));var gotoif=schema({'condition':{'type':_0xa239('0x6'),'required':!![],'message':_0xa239('0x7')},'priorityTrue':{'type':_0xa239('0x8'),'message':_0xa239('0x9')},'priorityFalse':{'type':_0xa239('0x8'),'message':_0xa239('0xa')}});exports[_0xa239('0xb')]=function(_0x14258c,_0x44af0c){return function(_0x216979){try{var _0x4d970a={'condition':htmlToText['fromString'](utils[_0xa239('0xc')](_0x44af0c[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x44af0c[0x1],'priorityFalse':_0x44af0c[0x2]};var _0xfd1bc0=gotoif['validate'](_0x4d970a,{'typecast':!![]});if(_0xfd1bc0['length']){logger[_0xa239('0xd')](_0xa239('0xe'),_0x14258c,_[_0xa239('0xf')](_0xfd1bc0,_0xa239('0x10'))[_0xa239('0x11')](',\x20'));_0x216979['stop']();}else{try{var _0x5d30e5=eval('('+_0x4d970a[_0xa239('0x12')]+')');var _0x2c7797=_0x5d30e5?_0x4d970a[_0xa239('0x13')]:_0x4d970a[_0xa239('0x14')];logger[_0xa239('0x15')](_0xa239('0x16'),_0x14258c,_0x4d970a[_0xa239('0x12')],_0x5d30e5,_0x2c7797||'next');if(_0x2c7797){var _0x51f605=_[_0xa239('0x17')](_0x216979[_0xa239('0x18')](),{'p':_0x2c7797});if(_0x51f605>=0x0){logger['info'](_0xa239('0x19'),_0x14258c,_0x2c7797||_0xa239('0x1a'),_0x51f605);_0x216979[_0xa239('0x1a')](_0x51f605);}else{logger[_0xa239('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x14258c,_0x2c7797||_0xa239('0x1a'));_0x216979[_0xa239('0x1b')]();}}else{_0x216979['next']();}}catch(_0x1fe138){logger[_0xa239('0xd')](_0xa239('0x1c'),_0x14258c,_0x1fe138[_0xa239('0x10')]);_0x216979[_0xa239('0x1b')]();}}}catch(_0x8cecac){logger['error'](_0xa239('0xe'),_0x14258c,JSON[_0xa239('0x1d')](_0x8cecac));_0x216979[_0xa239('0x1b')]();}};}; \ 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 9514334..2426ea1 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 _0xaef6=['[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','stop','info'];(function(_0x20e882,_0x16185c){var _0x3e0dbe=function(_0x3d0129){while(--_0x3d0129){_0x20e882['push'](_0x20e882['shift']());}};_0x3e0dbe(++_0x16185c);}(_0xaef6,0x15d));var _0x6aef=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xaef6[_0x57b54c];return _0x59cc19;};'use strict';var schema=require(_0x6aef('0x0'));var _=require(_0x6aef('0x1'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0x6aef('0x2'),'required':!![],'message':_0x6aef('0x3')}});exports[_0x6aef('0x4')]=function(_0x2bcf6b,_0x39c27f){return function(_0x409b07){try{var _0x574802={'priority':_0x39c27f[0x0]};var _0x5e03ca=gotop[_0x6aef('0x0')](_0x574802,{'typecast':!![]});if(_0x5e03ca[_0x6aef('0x5')]){logger[_0x6aef('0x6')](_0x6aef('0x7'),_0x2bcf6b,_[_0x6aef('0x8')](_0x5e03ca,_0x6aef('0x9'))['join'](',\x20'));_0x409b07[_0x6aef('0xa')]();}else{logger[_0x6aef('0xb')](_0x6aef('0xc'),_0x2bcf6b,_0x574802['priority']);if(_0x574802[_0x6aef('0xd')]){var _0x3c3f05=_[_0x6aef('0xe')](_0x409b07[_0x6aef('0xf')](),{'p':_0x574802[_0x6aef('0xd')]});if(_0x3c3f05>=0x0){logger[_0x6aef('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2bcf6b,_0x574802['priority']||'next',_0x3c3f05);_0x409b07[_0x6aef('0x10')](_0x3c3f05);}else{logger[_0x6aef('0xb')](_0x6aef('0x11'),_0x2bcf6b,_0x574802[_0x6aef('0xd')]||_0x6aef('0x10'));_0x409b07['stop']();}}else{_0x409b07[_0x6aef('0x10')]();}}}catch(_0x4fe05f){logger['error'](_0x6aef('0x7'),_0x2bcf6b,JSON[_0x6aef('0x12')](_0x4fe05f));_0x409b07['stop']();}};}; \ No newline at end of file +var _0x3e72=['validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop'];(function(_0x4b09ae,_0x3a2e8e){var _0xcf2f6c=function(_0x21c7d1){while(--_0x21c7d1){_0x4b09ae['push'](_0x4b09ae['shift']());}};_0xcf2f6c(++_0x3a2e8e);}(_0x3e72,0x118));var _0x23e7=function(_0x5ce8b9,_0x5cded8){_0x5ce8b9=_0x5ce8b9-0x0;var _0xe34be0=_0x3e72[_0x5ce8b9];return _0xe34be0;};'use strict';var schema=require(_0x23e7('0x0'));var _=require('lodash');var logger=require(_0x23e7('0x1'))(_0x23e7('0x2'));var gotop=schema({'priority':{'type':_0x23e7('0x3'),'required':!![],'message':_0x23e7('0x4')}});exports[_0x23e7('0x5')]=function(_0x44c06e,_0x5ed590){return function(_0x1fa1ce){try{var _0x74a964={'priority':_0x5ed590[0x0]};var _0x3ed5cd=gotop[_0x23e7('0x0')](_0x74a964,{'typecast':!![]});if(_0x3ed5cd[_0x23e7('0x6')]){logger[_0x23e7('0x7')](_0x23e7('0x8'),_0x44c06e,_[_0x23e7('0x9')](_0x3ed5cd,_0x23e7('0xa'))[_0x23e7('0xb')](',\x20'));_0x1fa1ce['stop']();}else{logger[_0x23e7('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x44c06e,_0x74a964[_0x23e7('0xd')]);if(_0x74a964[_0x23e7('0xd')]){var _0x1ed0d1=_[_0x23e7('0xe')](_0x1fa1ce[_0x23e7('0xf')](),{'p':_0x74a964[_0x23e7('0xd')]});if(_0x1ed0d1>=0x0){logger[_0x23e7('0xc')](_0x23e7('0x10'),_0x44c06e,_0x74a964[_0x23e7('0xd')]||_0x23e7('0x11'),_0x1ed0d1);_0x1fa1ce[_0x23e7('0x11')](_0x1ed0d1);}else{logger[_0x23e7('0xc')](_0x23e7('0x12'),_0x44c06e,_0x74a964[_0x23e7('0xd')]||_0x23e7('0x11'));_0x1fa1ce[_0x23e7('0x13')]();}}else{_0x1fa1ce[_0x23e7('0x11')]();}}}catch(_0x5c2cc4){logger['error']('[%s][GOTOP]\x20%s',_0x44c06e,JSON['stringify'](_0x5c2cc4));_0x1fa1ce[_0x23e7('0x13')]();}};}; \ 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 c1f383e..b52c3d4 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 _0x75ea=['contact','channel','chat','AccountId','upperFirst','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','catch','error','stop','stringify','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender'];(function(_0x480492,_0x2c2d42){var _0x322988=function(_0x446fbb){while(--_0x446fbb){_0x480492['push'](_0x480492['shift']());}};_0x322988(++_0x2c2d42);}(_0x75ea,0x7d));var _0xa75e=function(_0x22ee9f,_0x557c89){_0x22ee9f=_0x22ee9f-0x0;var _0xf944c7=_0x75ea[_0x22ee9f];return _0xf944c7;};'use strict';var _=require(_0xa75e('0x0'));var utils=require(_0xa75e('0x1'));var logger=require('../../../../config/logger')(_0xa75e('0x2'));var rpc={'chatMessage':require(_0xa75e('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xa75e('0x4')),'smsMessage':require(_0xa75e('0x5')),'faxMessage':require(_0xa75e('0x6')),'whatsappMessage':require(_0xa75e('0x7'))};exports[_0xa75e('0x8')]=function(_0x4d6703,_0x2a3364){return function(_0x1f9627){try{var _0x1f666f={'body':utils[_0xa75e('0x9')](_0x2a3364[0x0],this),'ContactId':this[_0xa75e('0xa')]['id']};if(this[_0xa75e('0xb')]===_0xa75e('0xc')){_0x1f666f['ChatWebsiteId']=this['account']['id'];}else{_0x1f666f[_['upperFirst'](this['channel'])+_0xa75e('0xd')]=this['account']['id'];}_0x1f666f[_[_0xa75e('0xe')](this['channel'])+_0xa75e('0xf')]=this[_0xa75e('0x10')]['id'];if(rpc[this['channel']+_0xa75e('0x11')]){return rpc[this[_0xa75e('0xb')]+_0xa75e('0x11')][_0xa75e('0x12')](_0x1f666f)[_0xa75e('0x13')](function(_0x3d01eb){logger[_0xa75e('0x14')](_0xa75e('0x15'),_0x4d6703,_0x1f666f[_0xa75e('0x16')]);_0x1f9627['next']();})[_0xa75e('0x17')](function(_0x5ae4fe){logger[_0xa75e('0x18')](_0xa75e('0x15'),_0x4d6703,JSON['stringify'](_0x5ae4fe));_0x1f9627[_0xa75e('0x19')]();});}}catch(_0x3179e2){logger[_0xa75e('0x18')]('[%s][MESSAGE]\x20%s',_0x4d6703,JSON[_0xa75e('0x1a')](_0x3179e2));_0x1f9627[_0xa75e('0x19')]();}};}; \ No newline at end of file +var _0x1c8a=['info','body','next','catch','error','[%s][MESSAGE]\x20%s','stop','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','channel','chat','account','upperFirst','InteractionId','Message','create','then'];(function(_0x412faa,_0x6d5ea8){var _0x204402=function(_0x1ddbe0){while(--_0x1ddbe0){_0x412faa['push'](_0x412faa['shift']());}};_0x204402(++_0x6d5ea8);}(_0x1c8a,0x140));var _0xa1c8=function(_0x468c37,_0x310b3a){_0x468c37=_0x468c37-0x0;var _0x373091=_0x1c8a[_0x468c37];return _0x373091;};'use strict';var _=require(_0xa1c8('0x0'));var utils=require(_0xa1c8('0x1'));var logger=require(_0xa1c8('0x2'))(_0xa1c8('0x3'));var rpc={'chatMessage':require(_0xa1c8('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xa1c8('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xa1c8('0x6')),'whatsappMessage':require(_0xa1c8('0x7'))};exports[_0xa1c8('0x8')]=function(_0x559330,_0x331282){return function(_0x14b85c){try{var _0x14d2f0={'body':utils['getMustacheRender'](_0x331282[0x0],this),'ContactId':this[_0xa1c8('0x9')]['id']};if(this[_0xa1c8('0xa')]===_0xa1c8('0xb')){_0x14d2f0['ChatWebsiteId']=this[_0xa1c8('0xc')]['id'];}else{_0x14d2f0[_[_0xa1c8('0xd')](this[_0xa1c8('0xa')])+'AccountId']=this['account']['id'];}_0x14d2f0[_[_0xa1c8('0xd')](this['channel'])+_0xa1c8('0xe')]=this['interaction']['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0xa1c8('0xa')]+_0xa1c8('0xf')][_0xa1c8('0x10')](_0x14d2f0)[_0xa1c8('0x11')](function(_0x644e9c){logger[_0xa1c8('0x12')]('[%s][MESSAGE]\x20%s',_0x559330,_0x14d2f0[_0xa1c8('0x13')]);_0x14b85c[_0xa1c8('0x14')]();})[_0xa1c8('0x15')](function(_0x3797fe){logger[_0xa1c8('0x16')](_0xa1c8('0x17'),_0x559330,JSON['stringify'](_0x3797fe));_0x14b85c[_0xa1c8('0x18')]();});}}catch(_0x51b1c3){logger[_0xa1c8('0x16')](_0xa1c8('0x17'),_0x559330,JSON[_0xa1c8('0x19')](_0x51b1c3));_0x14b85c['stop']();}};}; \ 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 9652653..88af881 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 _0x2a96=['stringify','stop','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x4ef9c2,_0x21a661){var _0x54770f=function(_0x34fa3b){while(--_0x34fa3b){_0x4ef9c2['push'](_0x4ef9c2['shift']());}};_0x54770f(++_0x21a661);}(_0x2a96,0x1ca));var _0x62a9=function(_0x4a848a,_0x2e09e1){_0x4a848a=_0x4a848a-0x0;var _0x396f47=_0x2a96[_0x4a848a];return _0x396f47;};'use strict';var utils=require('./utils');var logger=require(_0x62a9('0x0'))(_0x62a9('0x1'));exports[_0x62a9('0x2')]=function(_0x710b0,_0x24cac5){return function(_0x26d8e2){try{logger[_0x62a9('0x3')](_0x62a9('0x4'),_0x710b0,utils[_0x62a9('0x5')](_0x24cac5[0x0],this));_0x26d8e2['next']();}catch(_0x54914b){logger['error']('[%s][NOOP]\x20%s',_0x710b0,JSON[_0x62a9('0x6')](_0x54914b));_0x26d8e2[_0x62a9('0x7')]();}};}; \ No newline at end of file +var _0x0d29=['next','error','[%s][NOOP]\x20%s','stringify','stop','./utils','../../../../config/logger','routing','consequence','info','getMustacheRender'];(function(_0x2608cc,_0x550602){var _0x671ece=function(_0x35a8ee){while(--_0x35a8ee){_0x2608cc['push'](_0x2608cc['shift']());}};_0x671ece(++_0x550602);}(_0x0d29,0x1bd));var _0x90d2=function(_0x568b4a,_0x4f0a51){_0x568b4a=_0x568b4a-0x0;var _0xd4b3cd=_0x0d29[_0x568b4a];return _0xd4b3cd;};'use strict';var utils=require(_0x90d2('0x0'));var logger=require(_0x90d2('0x1'))(_0x90d2('0x2'));exports[_0x90d2('0x3')]=function(_0x37e22f,_0x3e6463){return function(_0x446622){try{logger[_0x90d2('0x4')]('[%s][NOOP]\x20%s',_0x37e22f,utils[_0x90d2('0x5')](_0x3e6463[0x0],this));_0x446622[_0x90d2('0x6')]();}catch(_0x3247a5){logger[_0x90d2('0x7')](_0x90d2('0x8'),_0x37e22f,JSON[_0x90d2('0x9')](_0x3247a5));_0x446622[_0x90d2('0xa')]();}};}; \ 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 a78b177..a6cc3ab 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 _0xd2c0=['create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','info','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','catch','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','find','timeout','createQueue','atimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','localhost','socket.io-emitter','redis','queue_id','account','queue','emit','clone','capitalize','InteractionId','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','contact','list','upperFirst','channel','QueueId','interaction','message','chat','AccountId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error'];(function(_0x5bf708,_0x4e03f0){var _0x33f087=function(_0x19c6c0){while(--_0x19c6c0){_0x5bf708['push'](_0x5bf708['shift']());}};_0x33f087(++_0x4e03f0);}(_0xd2c0,0x116));var _0x0d2c=function(_0x335b60,_0x50bdf8){_0x335b60=_0x335b60-0x0;var _0x930d32=_0xd2c0[_0x335b60];return _0x930d32;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x0d2c('0x0'));var seqqueue=require(_0x0d2c('0x1'));var moment=require(_0x0d2c('0x2'));var Redis=require(_0x0d2c('0x3'));var config=require(_0x0d2c('0x4'));var logger=require(_0x0d2c('0x5'))(_0x0d2c('0x6'));var strategy=require(_0x0d2c('0x7'));config['redis']=_[_0x0d2c('0x8')](config['redis'],{'host':_0x0d2c('0x9'),'port':0x18eb});var io=require(_0x0d2c('0xa'))(new Redis(config[_0x0d2c('0xb')]));var attributes=['id',_0x0d2c('0xc'),_0x0d2c('0xd'),_0x0d2c('0xe'),'from','joinAt'];function emit(_0x2e81f,_0x3e6fd5,_0x575650){io['to'](_0x2e81f)[_0x0d2c('0xf')](_0x3e6fd5,_0x575650);}function emitChannelQueueInteraction(_0x14ba11,_0x224b9c,_0xa70266,_0xb0ea98,_0x5d387f,_0x316e5e,_0x2af388,_0x56efe2){var _0x53049f=_[_0x0d2c('0x10')](_0xa70266);_0x53049f['queue_id']=_0x56efe2;_0x53049f[_0x0d2c('0xe')]=_0x224b9c;_0x53049f[_0x0d2c('0xd')]=_0xb0ea98;_0x53049f['id']=_0x5d387f;if(_0x316e5e){attributes['push'](_[_0x0d2c('0x11')](_0x14ba11)+_0x0d2c('0x12'));_0x2af388[util[_0x0d2c('0x13')](_0x0d2c('0x14'),_0x14ba11)][_0x5d387f]=_['pick'](_0x53049f,attributes);}else{delete _0x2af388[util[_0x0d2c('0x13')](_0x0d2c('0x14'),_0x14ba11)][_0x5d387f];}emit(util[_0x0d2c('0x13')]('%s:queue:%s',_0x14ba11,_0x224b9c),util[_0x0d2c('0x13')](_0x0d2c('0x15'),_0x14ba11,_0x316e5e?'save':_0x0d2c('0x16')),_[_0x0d2c('0x17')](_0x53049f,attributes));}var rpc={'openchannelQueueReport':require(_0x0d2c('0x18')),'mailQueueReport':require(_0x0d2c('0x19')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x0d2c('0x1a')),'faxQueueReport':require(_0x0d2c('0x1b')),'whatsappQueueReport':require(_0x0d2c('0x1c')),'chatInteraction':require(_0x0d2c('0x1d')),'faxInteraction':require('../../rpc/faxInteraction'),'mailInteraction':require(_0x0d2c('0x1e')),'openchannelInteraction':require(_0x0d2c('0x1f')),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require(_0x0d2c('0x20'))};var queue=schema({'name':{'type':_0x0d2c('0x21'),'required':!![],'message':_0x0d2c('0x22')},'timeout':{'type':_0x0d2c('0x23'),'message':_0x0d2c('0x24')}});function startRouting(_0xfe0f6b,_0x31add1,_0x5e7a49,_0x595acc){if(_0xfe0f6b&&_0x31add1&&_0x5e7a49){_0x31add1[_0x0d2c('0x25')]+=0x1;var _0x4157be={'uniqueid':_0xfe0f6b,'from':_0x5e7a49[_0x0d2c('0x26')]?_0x5e7a49[_0x0d2c('0x26')][_0x0d2c('0x27')]:'','joinAt':moment()[_0x0d2c('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5e7a49[_0x0d2c('0x28')]?_0x5e7a49[_0x0d2c('0x28')]['id']:null,'ListId':_0x5e7a49[_0x0d2c('0x29')]?_0x5e7a49[_0x0d2c('0x29')]['id']:null};_0x4157be[_[_0x0d2c('0x2a')](_0x5e7a49[_0x0d2c('0x2b')])+_0x0d2c('0x2c')]=_0x31add1['id']||null;_0x4157be[_[_0x0d2c('0x2a')](_0x5e7a49[_0x0d2c('0x2b')])+'InteractionId']=_0x5e7a49[_0x0d2c('0x2d')]?_0x5e7a49[_0x0d2c('0x2d')]['id']:null;_0x4157be[_[_0x0d2c('0x2a')](_0x5e7a49['channel'])+'MessageId']=_0x5e7a49[_0x0d2c('0x2e')]?_0x5e7a49['message']['id']:null;_0x4157be[_[_0x0d2c('0x2a')](_0x5e7a49[_0x0d2c('0x2b')])+(_0x5e7a49[_0x0d2c('0x2b')]!==_0x0d2c('0x2f')?_0x0d2c('0x30'):'WebsiteId')]=_0x5e7a49['account']?_0x5e7a49['account']['id']:null;logger['info'](util[_0x0d2c('0x13')](_0x0d2c('0x31'),_0xfe0f6b,_0x31add1[_0x0d2c('0x32')]));emitChannelQueueInteraction(_0x5e7a49[_0x0d2c('0x2b')],_0x31add1['name'],_0x4157be,_0x5e7a49['account'][_0x0d2c('0x32')],_0x5e7a49[_0x0d2c('0x2e')]['id'],!![],_0x595acc,_0x31add1['id']);if(rpc[_0x5e7a49[_0x0d2c('0x2b')]+_0x0d2c('0x33')]){return rpc[_0x5e7a49['channel']+_0x0d2c('0x33')][_0x0d2c('0x34')](_0x4157be)['catch'](function(_0x500f1a){logger[_0x0d2c('0x35')](_0x0d2c('0x36'),_0x500f1a);});}}}function stopRouting(_0xf6d622,_0x1e1c71,_0x547619,_0x4138dc){if(_0xf6d622&&_0x1e1c71){_0x1e1c71[_0x0d2c('0x25')]-=0x1;var _0x3a360c={'leaveAt':moment()['format'](_0x0d2c('0x37')),'acceptAt':moment()[_0x0d2c('0x13')](_0x0d2c('0x37')),'reason':'accepted'};logger[_0x0d2c('0x38')](util[_0x0d2c('0x13')](_0x0d2c('0x39'),_0xf6d622,_0x1e1c71['name']));emitChannelQueueInteraction(_0x547619['channel'],_0x1e1c71[_0x0d2c('0x32')],_0x547619[_0x0d2c('0x26')],_0x547619['account'][_0x0d2c('0x32')],_0x547619[_0x0d2c('0x2e')]['id'],![],_0x4138dc,_0x1e1c71['id']);return rpc[_0x547619[_0x0d2c('0x2b')]+_0x0d2c('0x3a')][_0x0d2c('0x3b')](_0x547619[_0x0d2c('0x2d')]['id'],{'queueId':_0x1e1c71['id']})['then'](function(){if(rpc[_0x547619[_0x0d2c('0x2b')]+_0x0d2c('0x33')]){return rpc[_0x547619[_0x0d2c('0x2b')]+_0x0d2c('0x33')][_0x0d2c('0x3b')](_0xf6d622,_0x3a360c)[_0x0d2c('0x3c')](function(_0x12be24){logger['error']('update\x20queue\x20report',_0x12be24);});}});}}function endRouting(_0x5b37d4,_0x292636,_0x307b4d,_0x15061b){if(_0x5b37d4&&_0x292636){_0x292636[_0x0d2c('0x25')]-=0x1;var _0x2e8d5f={'leaveAt':moment()[_0x0d2c('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x0d2c('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger['info'](util[_0x0d2c('0x13')](_0x0d2c('0x3d'),_0x5b37d4,_0x292636['name']));emitChannelQueueInteraction(_0x307b4d[_0x0d2c('0x2b')],_0x292636[_0x0d2c('0x32')],_0x307b4d[_0x0d2c('0x26')],_0x307b4d[_0x0d2c('0xd')]['name'],_0x307b4d[_0x0d2c('0x2e')]['id'],![],_0x15061b);if(rpc[_0x307b4d[_0x0d2c('0x2b')]+_0x0d2c('0x33')]){return rpc[_0x307b4d[_0x0d2c('0x2b')]+_0x0d2c('0x33')][_0x0d2c('0x3b')](_0x5b37d4,_0x2e8d5f)['catch'](function(_0x5b3c8e){logger[_0x0d2c('0x35')]('update\x20queue\x20report',_0x5b3c8e);});}}}function handleFindQueue(_0x395989){return function(_0x289fca){return _0x289fca['name'][_0x0d2c('0x3e')]()===_0x395989[_0x0d2c('0x3e')]();};}exports[_0x0d2c('0x3f')]=function(_0x8dd41b,_0x33788e,_0x3a1de0,_0x198623){return function(_0x2ca775){try{var _0x10b1f5={'name':_0x33788e[0x0],'timeout':_0x33788e[0x1]};var _0x96c287=queue[_0x0d2c('0x40')](_0x10b1f5,{'typecast':!![]});if(_0x96c287[_0x0d2c('0x41')]){logger[_0x0d2c('0x35')](_0x0d2c('0x42'),_0x8dd41b,_[_0x0d2c('0x43')](_0x96c287,_0x0d2c('0x2e'))[_0x0d2c('0x44')](',\x20'));_0x2ca775['stop']();}else{var _0x7a4e1e=_[_0x0d2c('0x45')](_0x3a1de0[_0x198623['channel']+'Queues'],handleFindQueue(_0x10b1f5['name']));if(_0x7a4e1e){startRouting(_0x8dd41b,_0x7a4e1e,_0x198623,_0x3a1de0);var _0x15d3a1=(_0x7a4e1e[_0x0d2c('0x46')]||0xa)*0x3e8;var _0x48d8e1=(_0x10b1f5[_0x0d2c('0x46')]||0x14)*0x3e8;var _0x26c1a4;if(_0x15d3a1>_0x48d8e1){_0x48d8e1=_0x15d3a1;}var _0xdbf089=seqqueue[_0x0d2c('0x47')](_0x15d3a1);_0xdbf089['id']=_0x8dd41b;_0xdbf089[_0x0d2c('0x48')]=_0x15d3a1;_0xdbf089['qtimeout']=_0x48d8e1;_0xdbf089[_0x0d2c('0x2b')]=_0x198623['channel'];_0x3a1de0[_0x0d2c('0x49')][_0x8dd41b]['on']('end',function(){logger[_0x0d2c('0x38')](_0x0d2c('0x4a'),_0x8dd41b);stopRouting(_0x8dd41b,_0x7a4e1e,_0x198623,_0x3a1de0);clearTimeout(_0x26c1a4);_0x26c1a4=undefined;_0xdbf089[_0x0d2c('0x4b')](!![]);if(_0x3a1de0[_0x0d2c('0x49')][_0x8dd41b]){delete _0x3a1de0[_0x0d2c('0x49')][_0x8dd41b];}_0x2ca775[_0x0d2c('0x4c')]();});_0x3a1de0[_0x0d2c('0x49')][_0x8dd41b]['on']('complete',function(){if(_0x3a1de0[_0x0d2c('0x49')][_0x8dd41b]){delete _0x3a1de0[_0x0d2c('0x49')][_0x8dd41b];}});_0x26c1a4=setTimeout(function(){logger[_0x0d2c('0x38')](_0x0d2c('0x4d'),_0x8dd41b);endRouting(_0x8dd41b,_0x7a4e1e,_0x198623,_0x3a1de0);clearTimeout(_0x26c1a4);_0xdbf089[_0x0d2c('0x4b')](!![]);_0x2ca775[_0x0d2c('0x4e')]();},_0x48d8e1);switch(_0x7a4e1e[_0x0d2c('0x4f')]){case _0x0d2c('0x50'):strategy[_0x0d2c('0x50')](_0xdbf089,_0x7a4e1e,_0x3a1de0,_0x198623);break;default:strategy[_0x0d2c('0x51')](_0xdbf089,_0x7a4e1e,_0x3a1de0,_0x198623);}}else{logger[_0x0d2c('0x35')](_0x0d2c('0x52'),_0x8dd41b,_0x10b1f5[_0x0d2c('0x32')]);_0x2ca775[_0x0d2c('0x4c')]();}}}catch(_0x3e9e9a){logger[_0x0d2c('0x35')](_0x0d2c('0x42'),_0x8dd41b,_0x3e9e9a['stack']);_0x2ca775[_0x0d2c('0x4c')]();}};}; \ No newline at end of file +var _0xb609=['../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','interaction','MessageId','message','chat','WebsiteId','name','create','catch','error','YYYY-MM-DD\x20HH:mm:ss','info','[%s][STOP:QUEUE][NAME:%s]','Interaction','then','QueueReport','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','find','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','seq-queue','moment','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','account','queue','from','joinAt','emit','queue_id','push','%sQueuesWaitingInteractions','pick','format','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport'];(function(_0x357fe8,_0x5379d6){var _0x228861=function(_0x5e59cf){while(--_0x5e59cf){_0x357fe8['push'](_0x357fe8['shift']());}};_0x228861(++_0x5379d6);}(_0xb609,0x12f));var _0x9b60=function(_0x64f407,_0x1c4136){_0x64f407=_0x64f407-0x0;var _0x15b1dd=_0xb609[_0x64f407];return _0x15b1dd;};'use strict';var schema=require(_0x9b60('0x0'));var _=require(_0x9b60('0x1'));var util=require('util');var seqqueue=require(_0x9b60('0x2'));var moment=require(_0x9b60('0x3'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x9b60('0x4'))(_0x9b60('0x5'));var strategy=require(_0x9b60('0x6'));config[_0x9b60('0x7')]=_['defaults'](config[_0x9b60('0x7')],{'host':_0x9b60('0x8'),'port':0x18eb});var io=require(_0x9b60('0x9'))(new Redis(config[_0x9b60('0x7')]));var attributes=['id','queue_id',_0x9b60('0xa'),_0x9b60('0xb'),_0x9b60('0xc'),_0x9b60('0xd')];function emit(_0x4de68a,_0xf4dbaf,_0x2af510){io['to'](_0x4de68a)[_0x9b60('0xe')](_0xf4dbaf,_0x2af510);}function emitChannelQueueInteraction(_0x2482be,_0x4245d5,_0x1b87b2,_0x475477,_0x43607f,_0x5609dd,_0x629a7a,_0x5b39d2){var _0x17a97c=_['clone'](_0x1b87b2);_0x17a97c[_0x9b60('0xf')]=_0x5b39d2;_0x17a97c['queue']=_0x4245d5;_0x17a97c[_0x9b60('0xa')]=_0x475477;_0x17a97c['id']=_0x43607f;if(_0x5609dd){attributes[_0x9b60('0x10')](_['capitalize'](_0x2482be)+'InteractionId');_0x629a7a[util['format'](_0x9b60('0x11'),_0x2482be)][_0x43607f]=_[_0x9b60('0x12')](_0x17a97c,attributes);}else{delete _0x629a7a[util[_0x9b60('0x13')]('%sQueuesWaitingInteractions',_0x2482be)][_0x43607f];}emit(util['format']('%s:queue:%s',_0x2482be,_0x4245d5),util[_0x9b60('0x13')]('%s_queue_waiting_interaction:%s',_0x2482be,_0x5609dd?_0x9b60('0x14'):_0x9b60('0x15')),_[_0x9b60('0x12')](_0x17a97c,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x9b60('0x16')),'chatQueueReport':require(_0x9b60('0x17')),'smsQueueReport':require(_0x9b60('0x18')),'faxQueueReport':require(_0x9b60('0x19')),'whatsappQueueReport':require(_0x9b60('0x1a')),'chatInteraction':require(_0x9b60('0x1b')),'faxInteraction':require(_0x9b60('0x1c')),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require(_0x9b60('0x1d')),'smsInteraction':require(_0x9b60('0x1e')),'whatsappInteraction':require(_0x9b60('0x1f'))};var queue=schema({'name':{'type':_0x9b60('0x20'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x9b60('0x21'),'message':_0x9b60('0x22')}});function startRouting(_0x2c83e4,_0x5118e5,_0x24ef92,_0x27d74f){if(_0x2c83e4&&_0x5118e5&&_0x24ef92){_0x5118e5[_0x9b60('0x23')]+=0x1;var _0x29511d={'uniqueid':_0x2c83e4,'from':_0x24ef92['body']?_0x24ef92[_0x9b60('0x24')][_0x9b60('0xc')]:'','joinAt':moment()[_0x9b60('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x24ef92[_0x9b60('0x25')]?_0x24ef92['contact']['id']:null,'ListId':_0x24ef92[_0x9b60('0x26')]?_0x24ef92[_0x9b60('0x26')]['id']:null};_0x29511d[_[_0x9b60('0x27')](_0x24ef92[_0x9b60('0x28')])+'QueueId']=_0x5118e5['id']||null;_0x29511d[_['upperFirst'](_0x24ef92[_0x9b60('0x28')])+'InteractionId']=_0x24ef92[_0x9b60('0x29')]?_0x24ef92[_0x9b60('0x29')]['id']:null;_0x29511d[_[_0x9b60('0x27')](_0x24ef92[_0x9b60('0x28')])+_0x9b60('0x2a')]=_0x24ef92[_0x9b60('0x2b')]?_0x24ef92[_0x9b60('0x2b')]['id']:null;_0x29511d[_['upperFirst'](_0x24ef92[_0x9b60('0x28')])+(_0x24ef92[_0x9b60('0x28')]!==_0x9b60('0x2c')?'AccountId':_0x9b60('0x2d'))]=_0x24ef92[_0x9b60('0xa')]?_0x24ef92[_0x9b60('0xa')]['id']:null;logger['info'](util[_0x9b60('0x13')]('[%s][START:QUEUE][NAME:%s]',_0x2c83e4,_0x5118e5['name']));emitChannelQueueInteraction(_0x24ef92[_0x9b60('0x28')],_0x5118e5['name'],_0x29511d,_0x24ef92[_0x9b60('0xa')][_0x9b60('0x2e')],_0x24ef92[_0x9b60('0x2b')]['id'],!![],_0x27d74f,_0x5118e5['id']);if(rpc[_0x24ef92['channel']+'QueueReport']){return rpc[_0x24ef92['channel']+'QueueReport'][_0x9b60('0x2f')](_0x29511d)[_0x9b60('0x30')](function(_0x3e3dc7){logger[_0x9b60('0x31')]('create\x20queue\x20report',_0x3e3dc7);});}}}function stopRouting(_0x38d052,_0x5ae8e3,_0x30b3fd,_0x10adac){if(_0x38d052&&_0x5ae8e3){_0x5ae8e3[_0x9b60('0x23')]-=0x1;var _0x3126fd={'leaveAt':moment()['format'](_0x9b60('0x32')),'acceptAt':moment()[_0x9b60('0x13')](_0x9b60('0x32')),'reason':'accepted'};logger[_0x9b60('0x33')](util[_0x9b60('0x13')](_0x9b60('0x34'),_0x38d052,_0x5ae8e3[_0x9b60('0x2e')]));emitChannelQueueInteraction(_0x30b3fd[_0x9b60('0x28')],_0x5ae8e3[_0x9b60('0x2e')],_0x30b3fd['body'],_0x30b3fd[_0x9b60('0xa')][_0x9b60('0x2e')],_0x30b3fd[_0x9b60('0x2b')]['id'],![],_0x10adac,_0x5ae8e3['id']);return rpc[_0x30b3fd['channel']+_0x9b60('0x35')]['update'](_0x30b3fd[_0x9b60('0x29')]['id'],{'queueId':_0x5ae8e3['id']})[_0x9b60('0x36')](function(){if(rpc[_0x30b3fd['channel']+'QueueReport']){return rpc[_0x30b3fd['channel']+_0x9b60('0x37')][_0x9b60('0x38')](_0x38d052,_0x3126fd)[_0x9b60('0x30')](function(_0x47421c){logger[_0x9b60('0x31')](_0x9b60('0x39'),_0x47421c);});}});}}function endRouting(_0x1f19da,_0x5015fc,_0xfcc8d2,_0x571be8){if(_0x1f19da&&_0x5015fc){_0x5015fc[_0x9b60('0x23')]-=0x1;var _0x33c302={'leaveAt':moment()['format'](_0x9b60('0x32')),'exitAt':moment()['format'](_0x9b60('0x32')),'reason':_0x9b60('0x3a')};logger[_0x9b60('0x33')](util[_0x9b60('0x13')](_0x9b60('0x3b'),_0x1f19da,_0x5015fc[_0x9b60('0x2e')]));emitChannelQueueInteraction(_0xfcc8d2['channel'],_0x5015fc[_0x9b60('0x2e')],_0xfcc8d2[_0x9b60('0x24')],_0xfcc8d2[_0x9b60('0xa')][_0x9b60('0x2e')],_0xfcc8d2['message']['id'],![],_0x571be8);if(rpc[_0xfcc8d2[_0x9b60('0x28')]+'QueueReport']){return rpc[_0xfcc8d2[_0x9b60('0x28')]+'QueueReport'][_0x9b60('0x38')](_0x1f19da,_0x33c302)[_0x9b60('0x30')](function(_0x1bc439){logger[_0x9b60('0x31')]('update\x20queue\x20report',_0x1bc439);});}}}function handleFindQueue(_0xd079c7){return function(_0x523480){return _0x523480[_0x9b60('0x2e')][_0x9b60('0x3c')]()===_0xd079c7[_0x9b60('0x3c')]();};}exports[_0x9b60('0x3d')]=function(_0x20e010,_0x3ad62a,_0x4e2d26,_0x5d0715){return function(_0x58a37e){try{var _0x56b42d={'name':_0x3ad62a[0x0],'timeout':_0x3ad62a[0x1]};var _0xc7c402=queue[_0x9b60('0x0')](_0x56b42d,{'typecast':!![]});if(_0xc7c402[_0x9b60('0x3e')]){logger[_0x9b60('0x31')](_0x9b60('0x3f'),_0x20e010,_[_0x9b60('0x40')](_0xc7c402,_0x9b60('0x2b'))[_0x9b60('0x41')](',\x20'));_0x58a37e['stop']();}else{var _0x3e2c3c=_[_0x9b60('0x42')](_0x4e2d26[_0x5d0715[_0x9b60('0x28')]+'Queues'],handleFindQueue(_0x56b42d[_0x9b60('0x2e')]));if(_0x3e2c3c){startRouting(_0x20e010,_0x3e2c3c,_0x5d0715,_0x4e2d26);var _0x5da25d=(_0x3e2c3c[_0x9b60('0x3a')]||0xa)*0x3e8;var _0x429d14=(_0x56b42d[_0x9b60('0x3a')]||0x14)*0x3e8;var _0x2e2e81;if(_0x5da25d>_0x429d14){_0x429d14=_0x5da25d;}var _0x1f6bdd=seqqueue[_0x9b60('0x43')](_0x5da25d);_0x1f6bdd['id']=_0x20e010;_0x1f6bdd[_0x9b60('0x44')]=_0x5da25d;_0x1f6bdd[_0x9b60('0x45')]=_0x429d14;_0x1f6bdd[_0x9b60('0x28')]=_0x5d0715[_0x9b60('0x28')];_0x4e2d26['rules'][_0x20e010]['on'](_0x9b60('0x46'),function(){logger[_0x9b60('0x33')](_0x9b60('0x47'),_0x20e010);stopRouting(_0x20e010,_0x3e2c3c,_0x5d0715,_0x4e2d26);clearTimeout(_0x2e2e81);_0x2e2e81=undefined;_0x1f6bdd[_0x9b60('0x48')](!![]);if(_0x4e2d26['rules'][_0x20e010]){delete _0x4e2d26[_0x9b60('0x49')][_0x20e010];}_0x58a37e[_0x9b60('0x4a')]();});_0x4e2d26[_0x9b60('0x49')][_0x20e010]['on'](_0x9b60('0x4b'),function(){if(_0x4e2d26[_0x9b60('0x49')][_0x20e010]){delete _0x4e2d26[_0x9b60('0x49')][_0x20e010];}});_0x2e2e81=setTimeout(function(){logger[_0x9b60('0x33')](_0x9b60('0x4c'),_0x20e010);endRouting(_0x20e010,_0x3e2c3c,_0x5d0715,_0x4e2d26);clearTimeout(_0x2e2e81);_0x1f6bdd[_0x9b60('0x48')](!![]);_0x58a37e[_0x9b60('0x4d')]();},_0x429d14);switch(_0x3e2c3c['strategy']){case _0x9b60('0x4e'):strategy[_0x9b60('0x4e')](_0x1f6bdd,_0x3e2c3c,_0x4e2d26,_0x5d0715);break;default:strategy[_0x9b60('0x4f')](_0x1f6bdd,_0x3e2c3c,_0x4e2d26,_0x5d0715);}}else{logger[_0x9b60('0x31')](_0x9b60('0x50'),_0x20e010,_0x56b42d[_0x9b60('0x2e')]);_0x58a37e['stop']();}}}catch(_0x52b929){logger['error'](_0x9b60('0x3f'),_0x20e010,_0x52b929[_0x9b60('0x51')]);_0x58a37e['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 266c381..eb3cf46 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 _0xe107=['./util','../../../../../config/logger','routing','notificationId','squeue','agent','push','handleRun','bind','drained','handleDrained','prototype','handleTimeout','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','realtime','agents','channel','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','removeWaitingNotification','STOP','TIMEOUT','exports','lodash'];(function(_0xee7e2e,_0x4bf4b3){var _0x53e8cb=function(_0x587687){while(--_0x587687){_0xee7e2e['push'](_0xee7e2e['shift']());}};_0x53e8cb(++_0x4bf4b3);}(_0xe107,0xb3));var _0x7e10=function(_0x48db14,_0x4717de){_0x48db14=_0x48db14-0x0;var _0x17c93f=_0xe107[_0x48db14];return _0x17c93f;};'use strict';var _=require(_0x7e10('0x0'));var uuid=require('uuid');var util=require(_0x7e10('0x1'));var logger=require(_0x7e10('0x2'))(_0x7e10('0x3'));var Agent=function(_0x570b2a,_0x31212d,_0x56db00,_0x4db676){this[_0x7e10('0x4')]=uuid['v4']();this[_0x7e10('0x5')]=_0x570b2a;this[_0x7e10('0x6')]=_0x31212d;this['realtime']=_0x56db00;this['routing']=_0x4db676;this[_0x7e10('0x5')][_0x7e10('0x7')](this[_0x7e10('0x8')][_0x7e10('0x9')](this),this['handleTimeout']['bind'](this));this[_0x7e10('0x5')]['on']('timeout',this['handleTimeout'][_0x7e10('0x9')](this));this[_0x7e10('0x5')]['on'](_0x7e10('0xa'),this[_0x7e10('0xb')][_0x7e10('0x9')](this));};Agent['prototype'][_0x7e10('0x7')]=function(){this['squeue'][_0x7e10('0x7')](this[_0x7e10('0x8')][_0x7e10('0x9')](this),this['handleTimeout'][_0x7e10('0x9')](this));};Agent[_0x7e10('0xc')][_0x7e10('0xb')]=function(){this[_0x7e10('0xd')](!![]);};Agent[_0x7e10('0xc')][_0x7e10('0x8')]=function(){logger[_0x7e10('0xe')](_0x7e10('0xf'),this['squeue']['id'],this[_0x7e10('0x6')]['id']);if(_[_0x7e10('0x10')](this['realtime']['agents'][this[_0x7e10('0x6')]['id']])){logger['debug'](_0x7e10('0x11'),this[_0x7e10('0x5')]['id'],this[_0x7e10('0x6')]['id']);setTimeout(this[_0x7e10('0x7')]['bind'](this),0x3e8);}else{if(this[_0x7e10('0x3')][_0x7e10('0x12')]||util[_0x7e10('0x13')](this['squeue']['id'],this[_0x7e10('0x14')][_0x7e10('0x15')][this[_0x7e10('0x6')]['id']],this[_0x7e10('0x5')][_0x7e10('0x16')],![])){this['realtime'][_0x7e10('0x15')][this[_0x7e10('0x6')]['id']]['busy']=!![];this[_0x7e10('0x14')][_0x7e10('0x15')][this[_0x7e10('0x6')]['id']][_0x7e10('0x17')]=undefined;util['saveWaitingNotification'](this[_0x7e10('0x14')],this[_0x7e10('0x3')],this[_0x7e10('0x6')],this[_0x7e10('0x5')][_0x7e10('0x16')]);util[_0x7e10('0x18')](this[_0x7e10('0x4')],this[_0x7e10('0x5')]['id'],this['realtime']['agents'][this[_0x7e10('0x6')]['id']],null,this[_0x7e10('0x3')]);util[_0x7e10('0x19')](this[_0x7e10('0x5')]['id'],this['realtime']['agents'][this[_0x7e10('0x6')]['id']],_0x7e10('0x1a')+(this[_0x7e10('0x3')][_0x7e10('0x12')]?_0x7e10('0x1b'):''));}else{logger[_0x7e10('0xe')](_0x7e10('0x1c'),this[_0x7e10('0x5')]['id'],this[_0x7e10('0x6')]['id']);setTimeout(this[_0x7e10('0x7')][_0x7e10('0x9')](this),0x3e8);}}};Agent['prototype'][_0x7e10('0xd')]=function(_0x884343){if(_['isNil'](this['realtime'][_0x7e10('0x15')][this[_0x7e10('0x6')]['id']])){return logger['debug'](_0x7e10('0x11'),this['squeue']['id'],this[_0x7e10('0x6')]['id']);}else{logger[_0x7e10('0xe')](_0x7e10('0x1d'),this[_0x7e10('0x5')]['id'],this[_0x7e10('0x6')]['id']);util[_0x7e10('0x1e')](this['notificationId'],this[_0x7e10('0x5')]['id'],this['realtime'][_0x7e10('0x15')][this[_0x7e10('0x6')]['id']],null,this[_0x7e10('0x3')]);this[_0x7e10('0x14')][_0x7e10('0x15')][this[_0x7e10('0x6')]['id']][_0x7e10('0x1f')]=![];this[_0x7e10('0x14')][_0x7e10('0x15')][this['agent']['id']][_0x7e10('0x17')]=undefined;util[_0x7e10('0x20')](this[_0x7e10('0x14')],this[_0x7e10('0x3')],this[_0x7e10('0x6')],this['squeue'][_0x7e10('0x16')]);util[_0x7e10('0x19')](this[_0x7e10('0x5')]['id'],this[_0x7e10('0x14')]['agents'][this['agent']['id']],_0x884343?_0x7e10('0x21'):_0x7e10('0x22'));}if(!_0x884343){setTimeout(this[_0x7e10('0x7')][_0x7e10('0x9')](this),0x3e8);}};function agent(_0x5a4376,_0x9ab8fd,_0x13503f,_0x5b65e5){return new Agent(_0x5a4376,_0x9ab8fd,_0x13503f,_0x5b65e5);}module[_0x7e10('0x23')]=agent; \ No newline at end of file +var _0x54ef=['[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agent','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','saveWaitingNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','squeue','push','bind','handleTimeout','drained','prototype','handleRun','handleDrained','debug'];(function(_0x131687,_0x3d710a){var _0x1e6346=function(_0x58a9d6){while(--_0x58a9d6){_0x131687['push'](_0x131687['shift']());}};_0x1e6346(++_0x3d710a);}(_0x54ef,0x112));var _0xf54e=function(_0x597c60,_0x48dad4){_0x597c60=_0x597c60-0x0;var _0x418147=_0x54ef[_0x597c60];return _0x418147;};'use strict';var _=require(_0xf54e('0x0'));var uuid=require(_0xf54e('0x1'));var util=require(_0xf54e('0x2'));var logger=require('../../../../../config/logger')(_0xf54e('0x3'));var Agent=function(_0x18b7d6,_0x18b1cf,_0x42b9b2,_0x8b6bb6){this[_0xf54e('0x4')]=uuid['v4']();this[_0xf54e('0x5')]=_0x18b7d6;this['agent']=_0x18b1cf;this['realtime']=_0x42b9b2;this[_0xf54e('0x3')]=_0x8b6bb6;this[_0xf54e('0x5')][_0xf54e('0x6')](this['handleRun'][_0xf54e('0x7')](this),this['handleTimeout'][_0xf54e('0x7')](this));this[_0xf54e('0x5')]['on']('timeout',this[_0xf54e('0x8')][_0xf54e('0x7')](this));this[_0xf54e('0x5')]['on'](_0xf54e('0x9'),this['handleDrained'][_0xf54e('0x7')](this));};Agent[_0xf54e('0xa')][_0xf54e('0x6')]=function(){this[_0xf54e('0x5')]['push'](this[_0xf54e('0xb')]['bind'](this),this['handleTimeout'][_0xf54e('0x7')](this));};Agent[_0xf54e('0xa')][_0xf54e('0xc')]=function(){this[_0xf54e('0x8')](!![]);};Agent['prototype'][_0xf54e('0xb')]=function(){logger[_0xf54e('0xd')](_0xf54e('0xe'),this[_0xf54e('0x5')]['id'],this['agent']['id']);if(_[_0xf54e('0xf')](this[_0xf54e('0x10')][_0xf54e('0x11')][this['agent']['id']])){logger['debug'](_0xf54e('0x12'),this[_0xf54e('0x5')]['id'],this[_0xf54e('0x13')]['id']);setTimeout(this[_0xf54e('0x6')][_0xf54e('0x7')](this),0x3e8);}else{if(this[_0xf54e('0x3')][_0xf54e('0x14')]||util[_0xf54e('0x15')](this[_0xf54e('0x5')]['id'],this[_0xf54e('0x10')][_0xf54e('0x11')][this['agent']['id']],this['squeue'][_0xf54e('0x16')],![])){this['realtime'][_0xf54e('0x11')][this[_0xf54e('0x13')]['id']][_0xf54e('0x17')]=!![];this[_0xf54e('0x10')][_0xf54e('0x11')][this[_0xf54e('0x13')]['id']][_0xf54e('0x18')]=undefined;util[_0xf54e('0x19')](this[_0xf54e('0x10')],this[_0xf54e('0x3')],this[_0xf54e('0x13')],this['squeue'][_0xf54e('0x16')]);util['showNotification'](this[_0xf54e('0x4')],this[_0xf54e('0x5')]['id'],this[_0xf54e('0x10')][_0xf54e('0x11')][this[_0xf54e('0x13')]['id']],null,this[_0xf54e('0x3')]);util[_0xf54e('0x1a')](this[_0xf54e('0x5')]['id'],this[_0xf54e('0x10')][_0xf54e('0x11')][this[_0xf54e('0x13')]['id']],_0xf54e('0x1b')+(this[_0xf54e('0x3')]['forcedOwnership']?_0xf54e('0x1c'):''));}else{logger['debug'](_0xf54e('0x1d'),this['squeue']['id'],this[_0xf54e('0x13')]['id']);setTimeout(this[_0xf54e('0x6')][_0xf54e('0x7')](this),0x3e8);}}};Agent[_0xf54e('0xa')][_0xf54e('0x8')]=function(_0x3993e4){if(_[_0xf54e('0xf')](this['realtime']['agents'][this[_0xf54e('0x13')]['id']])){return logger[_0xf54e('0xd')](_0xf54e('0x12'),this[_0xf54e('0x5')]['id'],this[_0xf54e('0x13')]['id']);}else{logger[_0xf54e('0xd')](_0xf54e('0x1e'),this[_0xf54e('0x5')]['id'],this[_0xf54e('0x13')]['id']);util[_0xf54e('0x1f')](this['notificationId'],this['squeue']['id'],this[_0xf54e('0x10')][_0xf54e('0x11')][this['agent']['id']],null,this[_0xf54e('0x3')]);this[_0xf54e('0x10')][_0xf54e('0x11')][this[_0xf54e('0x13')]['id']]['busy']=![];this['realtime']['agents'][this[_0xf54e('0x13')]['id']][_0xf54e('0x18')]=undefined;util[_0xf54e('0x20')](this[_0xf54e('0x10')],this[_0xf54e('0x3')],this[_0xf54e('0x13')],this['squeue']['channel']);util['writeLog'](this[_0xf54e('0x5')]['id'],this[_0xf54e('0x10')]['agents'][this['agent']['id']],_0x3993e4?_0xf54e('0x21'):_0xf54e('0x22'));}if(!_0x3993e4){setTimeout(this[_0xf54e('0x6')]['bind'](this),0x3e8);}};function agent(_0x14ecc8,_0x44a437,_0x50aeca,_0x38d7a0){return new Agent(_0x14ecc8,_0x44a437,_0x50aeca,_0x38d7a0);}module[_0xf54e('0x23')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index a441c5c..f1b3c85 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 _0xd19b=['debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','name','saveWaitingNotification','Agents','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','queue','realtime','squeue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','length','isNil','agents'];(function(_0x558472,_0x27ffcf){var _0x37e917=function(_0x5759cd){while(--_0x5759cd){_0x558472['push'](_0x558472['shift']());}};_0x37e917(++_0x27ffcf);}(_0xd19b,0x1a9));var _0xbd19=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xd19b[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require('lodash');var uuid=require(_0xbd19('0x0'));var util=require(_0xbd19('0x1'));var logger=require(_0xbd19('0x2'))(_0xbd19('0x3'));var Beepall=function(_0x2093d9,_0x5a8253,_0x5ad93b,_0x29ef11){this[_0xbd19('0x4')]=uuid['v4']();this['squeue']=_0x2093d9;this[_0xbd19('0x5')]=_0x5a8253;this[_0xbd19('0x6')]=_0x5ad93b;this[_0xbd19('0x3')]=_0x29ef11;this[_0xbd19('0x7')][_0xbd19('0x8')](this[_0xbd19('0x9')][_0xbd19('0xa')](this),this[_0xbd19('0xb')][_0xbd19('0xa')](this));this['squeue']['on'](_0xbd19('0xc'),this[_0xbd19('0xb')][_0xbd19('0xa')](this));this[_0xbd19('0x7')]['on'](_0xbd19('0xd'),this[_0xbd19('0xe')][_0xbd19('0xa')](this));};Beepall['prototype']['push']=function(){this[_0xbd19('0x7')][_0xbd19('0x8')](this[_0xbd19('0x9')]['bind'](this),this[_0xbd19('0xb')][_0xbd19('0xa')](this));};Beepall['prototype']['handleDrained']=function(){this[_0xbd19('0xb')](!![]);};Beepall[_0xbd19('0xf')][_0xbd19('0x9')]=function(){var _0x360be1=!![];if(!_['isNil'](this[_0xbd19('0x5')])&&!_['isNil'](this[_0xbd19('0x5')]['Agents'])&&this[_0xbd19('0x5')]['Agents']['length']>0x0){for(var _0x29aee2=0x0,_0x10f8b9;_0x29aee20x0){for(var _0x173505=0x0,_0x558ae5;_0x1735050x0&&_0xd1deac[_0x2d8e20+_0x3e4d('0x21')]>=_0xd1deac[_0x2d8e20+_0x3e4d('0x20')]){writeLog(_0x50eb69,_0xd1deac,_0x2d8e20[_0x3e4d('0x22')]()+_0x3e4d('0x23'));return![];}}return!![];};exports['showNotification']=function(_0xca562d,_0xb7a5a1,_0x10ee62,_0x15dec3,_0x2fe863){return sendNotification(!![],_0xca562d,_0xb7a5a1,_0x10ee62,_0x15dec3,_0x2fe863);};exports[_0x3e4d('0x24')]=function(_0x2e999b,_0xd65dd9,_0x582d89,_0x2973ed,_0x440e79){return sendNotification(![],_0x2e999b,_0xd65dd9,_0x582d89,_0x2973ed,_0x440e79);};exports[_0x3e4d('0x25')]=function(_0x3b25ab,_0x4d5e39,_0x388834){var _0x86d99e=_0x4d5e39['interaction'][_0x3e4d('0x26')];if(!_0x86d99e&&_0x388834){_0x86d99e=_0x388834['id'];}var _0x7338fd=_['some'](_0x3b25ab[_0x4d5e39[_0x3e4d('0x27')]+_0x3e4d('0x28')],function(_0x3bd00a){var _0x5d711a=_[_0x3e4d('0x29')](_0x4d5e39[_0x3e4d('0x27')])+_0x3e4d('0x2a');return _0x3bd00a[_0x5d711a]===_0x4d5e39[_0x3e4d('0x2b')]['id'];});if(!_0x7338fd&&_0x86d99e&&_0x3b25ab[_0x3e4d('0x2c')][_0x86d99e]){_0x7338fd=_['some'](_0x3b25ab[_0x3e4d('0x2c')][_0x86d99e][_0x4d5e39['channel']+_0x3e4d('0x2d')],function(_0x478e8e){return _0x478e8e['id']===_0x4d5e39[_0x3e4d('0x2b')]['id'];});}return _0x7338fd;};exports[_0x3e4d('0x2e')]=function(_0x49c16d,_0x5d7525,_0x32ccea,_0x2ef1bd){if(_0x32ccea&&_0x32ccea['id']&&_0x49c16d[_0x3e4d('0x2c')]&&_0x49c16d[_0x3e4d('0x2c')][_0x32ccea['id']]){_0x49c16d[_0x3e4d('0x2c')][_0x32ccea['id']][_0x2ef1bd+'WaitingInteractions'][_0x5d7525[_0x3e4d('0x2f')]['id']]={'id':_0x5d7525[_0x3e4d('0x2b')]['id']};}};exports[_0x3e4d('0x30')]=function(_0x453381,_0xca3ed9,_0x49b47c,_0xde401){if(_0x49b47c&&_0x49b47c['id']&&_0x453381[_0x3e4d('0x2c')]&&_0x453381[_0x3e4d('0x2c')][_0x49b47c['id']]){delete _0x453381['agents'][_0x49b47c['id']][_0xde401+_0x3e4d('0x2d')][_0xca3ed9[_0x3e4d('0x2f')]['id']];}};exports['writeLog']=writeLog; \ No newline at end of file +var _0x1a4a=['\x20MAXCAPACITY','showNotification','hideNotification','interaction','UserId','some','capitalize','InteractionId','agents','channel','WaitingInteractions','saveWaitingNotification','writeLog','lodash','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','localhost','socket.io-emitter','split','\x20interaction','account','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','format','[%s][QUEUE]\x20%s','message','user:%s','name','emit','notification:%s','save','remove','debug','busy','BUSY','online','OFFLINE','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase'];(function(_0xaf25ae,_0x2001c1){var _0x49732d=function(_0x5b764d){while(--_0x5b764d){_0xaf25ae['push'](_0xaf25ae['shift']());}};_0x49732d(++_0x2001c1);}(_0x1a4a,0x102));var _0xa1a4=function(_0x34948b,_0x1a2913){_0x34948b=_0x34948b-0x0;var _0x26acc6=_0x1a4a[_0x34948b];return _0x26acc6;};'use strict';var _=require(_0xa1a4('0x0'));var util=require('util');var utils=require('../utils');var Redis=require(_0xa1a4('0x1'));var config=require(_0xa1a4('0x2'));var logger=require(_0xa1a4('0x3'))(_0xa1a4('0x4'));config[_0xa1a4('0x5')]=_['defaults'](config[_0xa1a4('0x5')],{'host':_0xa1a4('0x6'),'port':0x18eb});var io=require(_0xa1a4('0x7'))(new Redis(config[_0xa1a4('0x5')]));function sendNotification(_0x1f2175,_0x224f1e,_0x31b140,_0x1afecf,_0x5ba90a,_0x799fab){var _0x1be282=_0x799fab||{};var _0x343a13=_0x31b140[_0xa1a4('0x8')]('.');var _0x5ac02b={'uniqueid':_0x224f1e,'channel':_0x343a13[0x0],'id':_0x343a13[0x1],'title':_0x343a13[0x0]+_0xa1a4('0x9'),'interactionId':_0x343a13[0x2],'queue':_0x5ba90a?_0x5ba90a['name']:null,'sound':_0x1be282[_0xa1a4('0xa')]['notificationSound'],'shake':_0x1be282[_0xa1a4('0xa')][_0xa1a4('0xb')]};try{if(!_0x1be282['body']){_0x1be282['body']={};}if(_0x5ba90a){_0x1be282[_0xa1a4('0xc')][_0xa1a4('0xd')]=_0x5ba90a;}else if(_0x1be282[_0xa1a4('0xc')]['queue']){delete _0x1be282['body'][_0xa1a4('0xd')];}_0x5ac02b[_0xa1a4('0xe')]=utils[_0xa1a4('0xf')](_0x1be282['account'][_0xa1a4('0x10')],_0x1be282);}catch(_0x599d89){_0x5ac02b[_0xa1a4('0xe')]='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0xa1a4('0x11')](_0xa1a4('0x12'),_0x224f1e,_0x599d89[_0xa1a4('0x13')]));}io['to'](util[_0xa1a4('0x11')](_0xa1a4('0x14'),_0x1afecf[_0xa1a4('0x15')]))[_0xa1a4('0x16')](util['format'](_0xa1a4('0x17'),_0x1f2175?_0xa1a4('0x18'):_0xa1a4('0x19')),_0x5ac02b);}function writeLog(_0x32699f,_0x28be12,_0x5f5754){return logger[_0xa1a4('0x1a')](util['format']('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x32699f,_0x28be12[_0xa1a4('0x15')],_0x5f5754));}exports['isAgentAvailable']=function(_0x1abea1,_0x10d3f2,_0x310d98,_0x491307){if(_0x10d3f2[_0xa1a4('0x1b')]){writeLog(_0x1abea1,_0x10d3f2,_0xa1a4('0x1c'));return![];}if(!_0x10d3f2[_0xa1a4('0x1d')]){writeLog(_0x1abea1,_0x10d3f2,_0xa1a4('0x1e'));return![];}if(_0x10d3f2[_0x310d98+'Pause']){writeLog(_0x1abea1,_0x10d3f2,_0xa1a4('0x1f'));return![];}if(_0x491307&&_0x10d3f2[_0xa1a4('0x20')](_0x310d98+_0xa1a4('0x21'))&&_0x10d3f2[_0xa1a4('0x20')](_0x310d98+_0xa1a4('0x22'))){if(_0x10d3f2[_0x310d98+_0xa1a4('0x21')]>0x0&&_0x10d3f2[_0x310d98+_0xa1a4('0x22')]>=_0x10d3f2[_0x310d98+'Capacity']){writeLog(_0x1abea1,_0x10d3f2,_0x310d98[_0xa1a4('0x23')]()+_0xa1a4('0x24'));return![];}}return!![];};exports[_0xa1a4('0x25')]=function(_0x1d2c23,_0x43f21f,_0x94b5be,_0x4af672,_0x5cf8c7){return sendNotification(!![],_0x1d2c23,_0x43f21f,_0x94b5be,_0x4af672,_0x5cf8c7);};exports[_0xa1a4('0x26')]=function(_0x5d1b75,_0x347ad0,_0x1cf5e0,_0x5268bc,_0x539a25){return sendNotification(![],_0x5d1b75,_0x347ad0,_0x1cf5e0,_0x5268bc,_0x539a25);};exports['checkWaitingNotifications']=function(_0x313db1,_0x4ccf6b,_0x437508){var _0x2be5d9=_0x4ccf6b[_0xa1a4('0x27')][_0xa1a4('0x28')];if(!_0x2be5d9&&_0x437508){_0x2be5d9=_0x437508['id'];}var _0x20c49e=_[_0xa1a4('0x29')](_0x313db1[_0x4ccf6b['channel']+'QueuesWaitingInteractions'],function(_0x4142aa){var _0x495cc8=_[_0xa1a4('0x2a')](_0x4ccf6b['channel'])+_0xa1a4('0x2b');return _0x4142aa[_0x495cc8]===_0x4ccf6b[_0xa1a4('0x27')]['id'];});if(!_0x20c49e&&_0x2be5d9&&_0x313db1[_0xa1a4('0x2c')][_0x2be5d9]){_0x20c49e=_['some'](_0x313db1[_0xa1a4('0x2c')][_0x2be5d9][_0x4ccf6b[_0xa1a4('0x2d')]+_0xa1a4('0x2e')],function(_0x5afa13){return _0x5afa13['id']===_0x4ccf6b['interaction']['id'];});}return _0x20c49e;};exports[_0xa1a4('0x2f')]=function(_0x1ceb0b,_0x59fe8a,_0x5ec77d,_0xe1b00a){if(_0x5ec77d&&_0x5ec77d['id']&&_0x1ceb0b[_0xa1a4('0x2c')]&&_0x1ceb0b['agents'][_0x5ec77d['id']]){_0x1ceb0b[_0xa1a4('0x2c')][_0x5ec77d['id']][_0xe1b00a+_0xa1a4('0x2e')][_0x59fe8a['message']['id']]={'id':_0x59fe8a[_0xa1a4('0x27')]['id']};}};exports['removeWaitingNotification']=function(_0xa1eaa2,_0x2061fb,_0x4446e1,_0x2973b2){if(_0x4446e1&&_0x4446e1['id']&&_0xa1eaa2[_0xa1a4('0x2c')]&&_0xa1eaa2[_0xa1a4('0x2c')][_0x4446e1['id']]){delete _0xa1eaa2[_0xa1a4('0x2c')][_0x4446e1['id']][_0x2973b2+_0xa1a4('0x2e')][_0x2061fb[_0xa1a4('0x13')]['id']];}};exports[_0xa1a4('0x30')]=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 32a3420..787b190 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 _0x60c4=['validate','length','error','[%s][SYSTEM]\x20%s','message','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','shelljs','lodash','./utils','../../../../config/logger','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x1340e4,_0x221da3){var _0x28771b=function(_0x2095bb){while(--_0x2095bb){_0x1340e4['push'](_0x1340e4['shift']());}};_0x28771b(++_0x221da3);}(_0x60c4,0x10e));var _0x460c=function(_0x307f8a,_0x313ba6){_0x307f8a=_0x307f8a-0x0;var _0x5d09ff=_0x60c4[_0x307f8a];return _0x5d09ff;};'use strict';var schema=require('validate');var sh=require(_0x460c('0x0'));var _=require(_0x460c('0x1'));var utils=require(_0x460c('0x2'));var logger=require(_0x460c('0x3'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0x460c('0x4')}});exports['consequence']=function(_0x416967,_0x5e7edc){return function(_0x47317a){try{var _0x235a8b={'command':_0x5e7edc[0x0]};var _0x4e11f5=system[_0x460c('0x5')](_0x235a8b,{'typecast':!![]});if(_0x4e11f5[_0x460c('0x6')]){logger[_0x460c('0x7')](_0x460c('0x8'),_0x416967,_['map'](_0x4e11f5,_0x460c('0x9'))['join'](',\x20'));logger[_0x460c('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x416967);_0x47317a['next']();}else{var _0xeb9285=this;var _0x306496=utils[_0x460c('0xb')](_0x5e7edc[0x0],this);logger[_0x460c('0xa')](_0x460c('0xc'),_0x416967,_0x306496);sh[_0x460c('0xd')](_[_0x460c('0xe')](_0x306496),function(_0x4c791f,_0x45a0f8){logger[_0x460c('0xa')](_0x460c('0xf'),_0x416967,_0x4c791f);if(_0x4c791f==0x0){var _0x4b4293=_0x45a0f8['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x460c('0x10')](_0x5e7edc[0x1])||_[_0x460c('0x11')](_0x5e7edc[0x1])){logger['info'](_0x460c('0x12'),_0x416967);_0xeb9285[_0x460c('0x13')][_0x5e7edc[0x1]]=_0x4b4293;}else{logger[_0x460c('0xa')](_0x460c('0x14'),_0x416967,_0x5e7edc[0x1],_0x4b4293);_0xeb9285[_0x460c('0x13')][_0x5e7edc[0x1]]=_0x4b4293;}}_0x47317a[_0x460c('0x15')]();});}}catch(_0x4f7443){logger[_0x460c('0x7')](_0x460c('0x8'),_0x416967,_[_0x460c('0x16')](_0x4f7443)?JSON[_0x460c('0x17')](_0x4f7443):_0x4f7443);logger[_0x460c('0xa')](_0x460c('0x18'),_0x416967);_0x47317a[_0x460c('0x15')]();}};}; \ No newline at end of file +var _0x29d4=['trim','replace','isNil','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','error','isObject','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','lodash','./utils','../../../../config/logger','routing','string','consequence','length','[%s][SYSTEM]\x20%s','message','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s'];(function(_0x57dcf4,_0x394b84){var _0x5e5122=function(_0x2787d4){while(--_0x2787d4){_0x57dcf4['push'](_0x57dcf4['shift']());}};_0x5e5122(++_0x394b84);}(_0x29d4,0x1a1));var _0x429d=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x29d4[_0x18a79d];return _0x4f8848;};'use strict';var schema=require(_0x429d('0x0'));var sh=require('shelljs');var _=require(_0x429d('0x1'));var utils=require(_0x429d('0x2'));var logger=require(_0x429d('0x3'))(_0x429d('0x4'));var system=schema({'command':{'type':_0x429d('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x429d('0x6')]=function(_0x3f43f5,_0x36a3d8){return function(_0x5e2a9c){try{var _0x1c55aa={'command':_0x36a3d8[0x0]};var _0xa71445=system[_0x429d('0x0')](_0x1c55aa,{'typecast':!![]});if(_0xa71445[_0x429d('0x7')]){logger['error'](_0x429d('0x8'),_0x3f43f5,_['map'](_0xa71445,_0x429d('0x9'))[_0x429d('0xa')](',\x20'));logger[_0x429d('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x3f43f5);_0x5e2a9c[_0x429d('0xc')]();}else{var _0x8c7cb6=this;var _0x5993cc=utils[_0x429d('0xd')](_0x36a3d8[0x0],this);logger[_0x429d('0xb')](_0x429d('0xe'),_0x3f43f5,_0x5993cc);sh['exec'](_[_0x429d('0xf')](_0x5993cc),function(_0x1f7a35,_0x1d933b){logger[_0x429d('0xb')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x3f43f5,_0x1f7a35);if(_0x1f7a35==0x0){var _0x1c542c=_0x1d933b[_0x429d('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x429d('0x11')](_0x36a3d8[0x1])||_['isEmpty'](_0x36a3d8[0x1])){logger[_0x429d('0xb')](_0x429d('0x12'),_0x3f43f5);_0x8c7cb6['body'][_0x36a3d8[0x1]]=_0x1c542c;}else{logger[_0x429d('0xb')](_0x429d('0x13'),_0x3f43f5,_0x36a3d8[0x1],_0x1c542c);_0x8c7cb6[_0x429d('0x14')][_0x36a3d8[0x1]]=_0x1c542c;}}_0x5e2a9c[_0x429d('0xc')]();});}}catch(_0x8c8a15){logger[_0x429d('0x15')]('[%s][SYSTEM]\x20%s',_0x3f43f5,_[_0x429d('0x16')](_0x8c8a15)?JSON['stringify'](_0x8c8a15):_0x8c8a15);logger[_0x429d('0xb')](_0x429d('0x17'),_0x3f43f5);_0x5e2a9c[_0x429d('0xc')]();}};}; \ 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 766fbf8..7c4e8d6 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 _0x3894=['consequence','length','error','[%s][TAG]\x20%s','message','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','info','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0xbcce26,_0x9be74c){var _0x2f9253=function(_0x3531be){while(--_0x3531be){_0xbcce26['push'](_0xbcce26['shift']());}};_0x2f9253(++_0x9be74c);}(_0x3894,0x114));var _0x4389=function(_0x11dfbb,_0x1f4c8a){_0x11dfbb=_0x11dfbb-0x0;var _0x22d016=_0x3894[_0x11dfbb];return _0x22d016;};'use strict';var schema=require(_0x4389('0x0'));var _=require(_0x4389('0x1'));var rpc={'chatInteraction':require(_0x4389('0x2')),'openchannelInteraction':require(_0x4389('0x3')),'smsInteraction':require(_0x4389('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x4389('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x4389('0x6'))(_0x4389('0x7'));var tag=schema({'tag':{'type':_0x4389('0x8'),'required':!![],'message':_0x4389('0x9')}});exports[_0x4389('0xa')]=function(_0x336804,_0x530073,_0x4e9148,_0x55225c){return function(_0x544aad){try{var _0x1985c1={'tag':_0x530073[0x0]};var _0x27331b=tag[_0x4389('0x0')](_0x1985c1,{'typecast':!![]});if(_0x27331b[_0x4389('0xb')]){logger[_0x4389('0xc')](_0x4389('0xd'),_0x336804,_['map'](_0x27331b,_0x4389('0xe'))['join'](',\x20'));logger['info'](_0x4389('0xf'),_0x336804);_0x544aad[_0x4389('0x10')]();}else{var _0x558bc4={'ids':[_0x530073[0x0]]};if(rpc[_0x55225c[_0x4389('0x11')]+_0x4389('0x12')]){rpc[_0x55225c[_0x4389('0x11')]+_0x4389('0x12')]['addTags'](_0x55225c[_0x4389('0x13')]['id'],_0x558bc4)[_0x4389('0x14')](function(_0x509f0f){logger[_0x4389('0x15')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x336804,_0x530073[0x1],_0x55225c[_0x4389('0x11')],_0x55225c[_0x4389('0x13')]['id']);})[_0x4389('0x16')](function(_0x474c66){logger[_0x4389('0xc')](_0x4389('0xd'),_0x336804,JSON[_0x4389('0x17')](_0x474c66));logger[_0x4389('0x15')](_0x4389('0xf'),_0x336804);})[_0x4389('0x18')](function(){_0x544aad[_0x4389('0x10')]();});}}}catch(_0x1483c6){logger['error'](_0x4389('0xd'),_0x336804,_[_0x4389('0x19')](_0x1483c6)?JSON['stringify'](_0x1483c6):_0x1483c6);logger[_0x4389('0x15')](_0x4389('0xf'),_0x336804);_0x544aad['next']();}};}; \ No newline at end of file +var _0x6be5=['../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][TAG]\x20%s','map','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','channel','catch','stringify','finally','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction'];(function(_0x47beed,_0x33c360){var _0x572e2a=function(_0x22d7b5){while(--_0x22d7b5){_0x47beed['push'](_0x47beed['shift']());}};_0x572e2a(++_0x33c360);}(_0x6be5,0x109));var _0x56be=function(_0x1ddcc4,_0x1d6d92){_0x1ddcc4=_0x1ddcc4-0x0;var _0xaae43a=_0x6be5[_0x1ddcc4];return _0xaae43a;};'use strict';var schema=require('validate');var _=require(_0x56be('0x0'));var rpc={'chatInteraction':require(_0x56be('0x1')),'openchannelInteraction':require(_0x56be('0x2')),'smsInteraction':require(_0x56be('0x3')),'mailInteraction':require(_0x56be('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x56be('0x5'))('routing');var tag=schema({'tag':{'type':_0x56be('0x6'),'required':!![],'message':_0x56be('0x7')}});exports[_0x56be('0x8')]=function(_0x361361,_0x55b4d0,_0x3ab0bd,_0x1c2271){return function(_0x3403b4){try{var _0x1a9c5a={'tag':_0x55b4d0[0x0]};var _0x11e922=tag[_0x56be('0x9')](_0x1a9c5a,{'typecast':!![]});if(_0x11e922[_0x56be('0xa')]){logger[_0x56be('0xb')](_0x56be('0xc'),_0x361361,_[_0x56be('0xd')](_0x11e922,'message')['join'](',\x20'));logger[_0x56be('0xe')](_0x56be('0xf'),_0x361361);_0x3403b4[_0x56be('0x10')]();}else{var _0x58fd83={'ids':[_0x55b4d0[0x0]]};if(rpc[_0x1c2271['channel']+_0x56be('0x11')]){rpc[_0x1c2271['channel']+_0x56be('0x11')][_0x56be('0x12')](_0x1c2271[_0x56be('0x13')]['id'],_0x58fd83)[_0x56be('0x14')](function(_0x4a6c3a){logger[_0x56be('0xe')](_0x56be('0x15'),_0x361361,_0x55b4d0[0x1],_0x1c2271[_0x56be('0x16')],_0x1c2271[_0x56be('0x13')]['id']);})[_0x56be('0x17')](function(_0x3f50d8){logger['error']('[%s][TAG]\x20%s',_0x361361,JSON[_0x56be('0x18')](_0x3f50d8));logger['info'](_0x56be('0xf'),_0x361361);})[_0x56be('0x19')](function(){_0x3403b4[_0x56be('0x10')]();});}}}catch(_0x5d2114){logger[_0x56be('0xb')]('[%s][TAG]\x20%s',_0x361361,_[_0x56be('0x1a')](_0x5d2114)?JSON[_0x56be('0x18')](_0x5d2114):_0x5d2114);logger[_0x56be('0xe')](_0x56be('0xf'),_0x361361);_0x3403b4[_0x56be('0x10')]();}};}; \ 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 7f9f180..275b187 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 _0x7a7a=['isObject','stop','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','?params=','urlOnRing','title','method','login','params','stringify','utf8','POST','then','logged','channelId=','&serviceId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s'];(function(_0x2b8388,_0x1aa6dc){var _0x41ba83=function(_0x982abf){while(--_0x982abf){_0x2b8388['push'](_0x2b8388['shift']());}};_0x41ba83(++_0x1aa6dc);}(_0x7a7a,0x1c4));var _0xa7a7=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x7a7a[_0x1caf6a];return _0x1bf493;};'use strict';var rp=require(_0xa7a7('0x0'));var logger=require(_0xa7a7('0x1'))(_0xa7a7('0x2'));var _=require(_0xa7a7('0x3'));var arr=[];exports[_0xa7a7('0x4')]=function(_0x3eaa40,_0x507b03){return function(_0x260c8f){var _0x14cb71=_0x507b03[0xa];var _0x378965=_0x507b03[0xb];var _0x3905ed=_0x507b03[0xc];var _0x3c108a=_0x507b03[0xd];var _0xb0f457=_0x507b03[0xe];var _0x4beeff=_0x507b03[0xf][_0xa7a7('0x5')](/\n/g,_0xa7a7('0x6'));var _0x5f2d45=_0x507b03[0x10][_0xa7a7('0x5')](/\n/g,'\x20');if(!arr[_0xa7a7('0x7')](_0x378965)){arr[_0xa7a7('0x8')](_0x378965);var _0x3217ec=_0x507b03[0x3];var _0x5d5dac=_0x507b03[0x4];var _0x1ad37b=_0x507b03[0x1];var _0x5c7353=_0x507b03[0x0];var _0x41ded7={};_0x41ded7['urlOnAnswer']=_0x507b03[0x8]+_0xa7a7('0x9')+_0x3905ed+'|'+_0x14cb71+'|'+_0x3c108a+'|'+_0x378965+'|'+_0xb0f457;_0x41ded7[_0xa7a7('0xa')]=_0x507b03[0x7]+_0xa7a7('0x9')+_0x3905ed+'|'+_0x14cb71+'|'+_0x3c108a+'|'+_0x378965+'|'+_0xb0f457+'|'+_0x4beeff+'|'+_0x5f2d45;_0x41ded7[_0xa7a7('0xb')]=_0x507b03[0x9];var _0x533ab3={};_0x533ab3['jsonrpc']='2.0';_0x533ab3[_0xa7a7('0xc')]=_0xa7a7('0xd');var _0x1311c6=[];_0x1311c6['push'](_0x507b03[0x2]);_0x1311c6[_0xa7a7('0x8')](_0x507b03[0x5]);_0x1311c6[_0xa7a7('0x8')](_0x507b03[0x6]);_0x533ab3[_0xa7a7('0xe')]=_0x1311c6;_0x533ab3['id']=0x1;var _0x5e588e=JSON[_0xa7a7('0xf')](_0x533ab3);var _0x13486e={'encoding':_0xa7a7('0x10'),'method':_0xa7a7('0x11'),'timeout':0x2710,'url':_0x3217ec,'headers':{'Content-Type':'application/json-rpc'},'body':_0x5e588e};return rp(_0x13486e)[_0xa7a7('0x12')](function(_0x8a0775){const _0xd46036=JSON['parse'](_0x8a0775);if(!_0xd46036['result'][_0xa7a7('0x13')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x25bac8=_0x378965;var _0x4a73f1=_0xa7a7('0x14')+_0x1ad37b+_0xa7a7('0x15')+_0x5c7353+_0xa7a7('0x16')+_0x25bac8+_0xa7a7('0x17')+JSON['stringify'](_0x41ded7);var _0x41fe4a=_0x5d5dac+'?'+_0x4a73f1;return rp(_0x41fe4a);})[_0xa7a7('0x12')](function(_0x530353){logger['info'](_0xa7a7('0x18'),_0x3eaa40,_0x530353);_0x260c8f['stop']();})[_0xa7a7('0x19')](function(_0x806610){logger[_0xa7a7('0x1a')](_0xa7a7('0x1b'),_0x3eaa40,_[_0xa7a7('0x1c')](_0x806610)?JSON[_0xa7a7('0xf')](_0x806610):_0x806610);_0x260c8f[_0xa7a7('0x1d')]();});}else{logger[_0xa7a7('0x1e')](_0xa7a7('0x1f'),_0x3eaa40);_0x260c8f['next']();}};}; \ No newline at end of file +var _0x0c7c=['routing','lodash','consequence','replace','\x20-\x20','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','login','stringify','utf8','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger'];(function(_0x5316fa,_0x30ca54){var _0x11d369=function(_0x516ee2){while(--_0x516ee2){_0x5316fa['push'](_0x5316fa['shift']());}};_0x11d369(++_0x30ca54);}(_0x0c7c,0x65));var _0xc0c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c7c[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require('request-promise');var logger=require(_0xc0c7('0x0'))(_0xc0c7('0x1'));var _=require(_0xc0c7('0x2'));var arr=[];exports[_0xc0c7('0x3')]=function(_0x37cade,_0x1fc043){return function(_0x24020c){var _0x499bc7=_0x1fc043[0xa];var _0x2235ee=_0x1fc043[0xb];var _0x37f818=_0x1fc043[0xc];var _0x1f2842=_0x1fc043[0xd];var _0x2bca5e=_0x1fc043[0xe];var _0x1574bd=_0x1fc043[0xf][_0xc0c7('0x4')](/\n/g,_0xc0c7('0x5'));var _0x52ba73=_0x1fc043[0x10][_0xc0c7('0x4')](/\n/g,'\x20');if(!arr['includes'](_0x2235ee)){arr[_0xc0c7('0x6')](_0x2235ee);var _0x3cab3b=_0x1fc043[0x3];var _0x5154aa=_0x1fc043[0x4];var _0x1f1510=_0x1fc043[0x1];var _0x4b624c=_0x1fc043[0x0];var _0x52abbe={};_0x52abbe[_0xc0c7('0x7')]=_0x1fc043[0x8]+_0xc0c7('0x8')+_0x37f818+'|'+_0x499bc7+'|'+_0x1f2842+'|'+_0x2235ee+'|'+_0x2bca5e;_0x52abbe[_0xc0c7('0x9')]=_0x1fc043[0x7]+_0xc0c7('0x8')+_0x37f818+'|'+_0x499bc7+'|'+_0x1f2842+'|'+_0x2235ee+'|'+_0x2bca5e+'|'+_0x1574bd+'|'+_0x52ba73;_0x52abbe[_0xc0c7('0xa')]=_0x1fc043[0x9];var _0x4967e4={};_0x4967e4[_0xc0c7('0xb')]='2.0';_0x4967e4['method']=_0xc0c7('0xc');var _0x3a2b28=[];_0x3a2b28[_0xc0c7('0x6')](_0x1fc043[0x2]);_0x3a2b28[_0xc0c7('0x6')](_0x1fc043[0x5]);_0x3a2b28[_0xc0c7('0x6')](_0x1fc043[0x6]);_0x4967e4['params']=_0x3a2b28;_0x4967e4['id']=0x1;var _0x5efcd7=JSON[_0xc0c7('0xd')](_0x4967e4);var _0x484124={'encoding':_0xc0c7('0xe'),'method':_0xc0c7('0xf'),'timeout':0x2710,'url':_0x3cab3b,'headers':{'Content-Type':_0xc0c7('0x10')},'body':_0x5efcd7};return rp(_0x484124)[_0xc0c7('0x11')](function(_0x2233c5){const _0x2bc79e=JSON[_0xc0c7('0x12')](_0x2233c5);if(!_0x2bc79e[_0xc0c7('0x13')][_0xc0c7('0x14')]){throw new Error(_0xc0c7('0x15'));}var _0x59db29=_0x2235ee;var _0x28fd4f=_0xc0c7('0x16')+_0x1f1510+_0xc0c7('0x17')+_0x4b624c+_0xc0c7('0x18')+_0x59db29+_0xc0c7('0x19')+JSON[_0xc0c7('0xd')](_0x52abbe);var _0x55e9bd=_0x5154aa+'?'+_0x28fd4f;return rp(_0x55e9bd);})[_0xc0c7('0x11')](function(_0x2c79db){logger['info'](_0xc0c7('0x1a'),_0x37cade,_0x2c79db);_0x24020c[_0xc0c7('0x1b')]();})[_0xc0c7('0x1c')](function(_0x1fc8e0){logger['error'](_0xc0c7('0x1d'),_0x37cade,_[_0xc0c7('0x1e')](_0x1fc8e0)?JSON['stringify'](_0x1fc8e0):_0x1fc8e0);_0x24020c[_0xc0c7('0x1b')]();});}else{logger[_0xc0c7('0x1f')](_0xc0c7('0x20'),_0x37cade);_0x24020c[_0xc0c7('0x21')]();}};}; \ 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 57ce5dd..5a5a156 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 _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x3b5995,_0x118d41){var _0x13b2fa=function(_0xad6ee6){while(--_0xad6ee6){_0x3b5995['push'](_0x3b5995['shift']());}};_0x13b2fa(++_0x118d41);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x3f25f2,_0x45b7b4){var _0x4afdea=function(_0x19ead1){while(--_0x19ead1){_0x3f25f2['push'](_0x3f25f2['shift']());}};_0x4afdea(++_0x45b7b4);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index dfe03be..5065b5a 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 _0x39d7=['message','interaction','checkWaitingNotifications','isArray','applications','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','amazonlex','tag','TagId','tvox','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','stack','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','paused','mailQueues','loggedIn','name','waiting','openchannelQueues','smsQueues','available','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','./applications/utils','../../../config/logger','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel'];(function(_0x35c4c9,_0x2cdabb){var _0x36e68b=function(_0x2cdb8e){while(--_0x2cdb8e){_0x35c4c9['push'](_0x35c4c9['shift']());}};_0x36e68b(++_0x2cdabb);}(_0x39d7,0x12d));var _0x739d=function(_0x265e7d,_0x54bb25){_0x265e7d=_0x265e7d-0x0;var _0x3df500=_0x39d7[_0x265e7d];return _0x3df500;};'use strict';var _=require(_0x739d('0x0'));var util=require(_0x739d('0x1'));var path=require(_0x739d('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x739d('0x3'));var utils=require(_0x739d('0x4'));var sUtils=require('./applications/strategy/util');var logger=require(_0x739d('0x5'))('routing');var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x739d('0x6')),'chatQueueReport':require(_0x739d('0x7')),'smsQueueReport':require(_0x739d('0x8')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x739d('0x9'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x5f12cd,_0x2c8dbd,_0x5866b5){return util[_0x739d('0xa')](_0x739d('0xb'),_0x5f12cd,_0x2c8dbd||0x0,_0x5866b5||0x0);}function getIntervals(_0x148601,_0x55d2d9){var _0x508911=[];if(!_[_0x739d('0xc')](_0x55d2d9[_0x739d('0xd')])&&!_[_0x739d('0xc')](_0x148601[_0x55d2d9[_0x739d('0xd')]])&&!_[_0x739d('0xc')](_0x148601[_0x55d2d9[_0x739d('0xd')]][_0x739d('0xe')])){_0x508911=_[_0x739d('0xf')](_0x148601[_0x55d2d9[_0x739d('0xd')]][_0x739d('0xe')],_0x739d('0x10'));}else if(!_[_0x739d('0xc')](_0x55d2d9[_0x739d('0x10')])){_0x508911=[_0x55d2d9[_0x739d('0x10')]];}return _0x508911;}exports[_0x739d('0x11')]=function(_0x305bfc){_0x305bfc[_0x739d('0x12')]={};return new BPromise(function(_0x4c06af,_0x234f5d){var _0x1dd380={'Start':function(_0x1f168f){var _0x152325=this;return new Promise(function(_0x48fd2a,_0x1873f8){if(_0x1f168f){try{var _0x2d6359=[];var _0x4869bd=getId(_0x1f168f[_0x739d('0x13')],_0x1f168f[_0x739d('0x14')]?_0x1f168f[_0x739d('0x14')]['id']:0x0,_0x1f168f[_0x739d('0x15')]?_0x1f168f[_0x739d('0x15')]['id']:0x0);var _0x157d83=sUtils[_0x739d('0x16')](_0x305bfc,_0x1f168f);if(_0x1f168f['transfer']||!_0x157d83&&_0x1f168f['applications']&&_[_0x739d('0x17')](_0x1f168f[_0x739d('0x18')])&&_0x1f168f[_0x739d('0x18')][_0x739d('0x19')]){for(var _0x503358=0x0;_0x503358<_0x1f168f['applications']['length'];_0x503358+=0x1){var _0x1ff78a=_0x1f168f['applications'][_0x503358];if(fs[_0x739d('0x1a')](path[_0x739d('0x1b')](__dirname,_0x739d('0x18'),_0x1ff78a[_0x739d('0x1c')]+'.js'))){var _0x5172ff=[];switch(_0x1ff78a[_0x739d('0x1c')][_0x739d('0x1d')]()){case _0x739d('0x1e'):var _0x50c293=_0x1ff78a[_0x739d('0x1f')][_0x739d('0x20')](',');if(_0x1f168f[_0x739d('0x13')]===_0x739d('0x21')){_0x5172ff[_0x739d('0x22')](_0x50c293[0x0]);_0x5172ff[_0x739d('0x22')](_0x50c293[0x1]);_0x5172ff[_0x739d('0x22')](_0x50c293['slice'](0x2,_0x50c293[_0x739d('0x19')])[_0x739d('0x1b')](','));}else{_0x5172ff[_0x739d('0x22')](_0x50c293[0x0]);_0x5172ff['push'](_0x50c293[_0x739d('0x23')](0x1,_0x50c293[_0x739d('0x19')])['join'](','));}break;case _0x739d('0x24'):var _0x166c18=_0x1ff78a['appdata']['split'](',');_0x5172ff['push'](_0x166c18[0x0]);_0x5172ff[_0x739d('0x22')](_0x166c18[0x1]);_0x5172ff[_0x739d('0x22')](_0x166c18['slice'](0x2,_0x166c18[_0x739d('0x19')])[_0x739d('0x1b')](','));break;case'dialogflowv2':var _0x2224e1=_0x1ff78a['appdata']['split'](',');_0x5172ff[_0x739d('0x22')](_0x2224e1[0x0]);_0x5172ff[_0x739d('0x22')](_0x2224e1[0x1]);_0x5172ff[_0x739d('0x22')](_0x2224e1[0x2]);_0x5172ff[_0x739d('0x22')](_0x2224e1[0x3]);_0x5172ff['push'](_0x2224e1[_0x739d('0x23')](0x4,_0x2224e1[_0x739d('0x19')])[_0x739d('0x1b')](','));break;case _0x739d('0x25'):var _0x2a32c9=_0x1ff78a['appdata'][_0x739d('0x20')](',');_0x5172ff[_0x739d('0x22')](_0x2a32c9[0x0]);_0x5172ff[_0x739d('0x22')](_0x2a32c9[0x1]);_0x5172ff[_0x739d('0x22')](_0x2a32c9[0x2]);_0x5172ff[_0x739d('0x22')](_0x2a32c9[0x3]);_0x5172ff[_0x739d('0x22')](_0x2a32c9[_0x739d('0x23')](0x4,_0x2a32c9[_0x739d('0x19')])[_0x739d('0x1b')](','));break;case'message':_0x5172ff[_0x739d('0x22')](_0x1ff78a[_0x739d('0x1f')]);break;case _0x739d('0x26'):_0x5172ff['push'](_0x1ff78a[_0x739d('0x27')]);_0x5172ff[_0x739d('0x22')](_0x1ff78a[_0x739d('0x1f')]);break;case _0x739d('0x28'):var _0x96f382=utils[_0x739d('0x29')](_0x1f168f['account'][_0x739d('0x2a')],_0x1f168f);var _0x48dee6=_0x1ff78a[_0x739d('0x1f')][_0x739d('0x20')](',');_0x5172ff['push'](_0x48dee6[0x0]);_0x5172ff[_0x739d('0x22')](_0x48dee6[0x1]);_0x5172ff[_0x739d('0x22')](_0x48dee6[0x2]);_0x5172ff['push'](_0x48dee6[0x3]);_0x5172ff['push'](_0x48dee6[0x4]);_0x5172ff[_0x739d('0x22')](_0x48dee6[0x5]);_0x5172ff[_0x739d('0x22')](_0x48dee6[0x6]);_0x5172ff[_0x739d('0x22')](_0x48dee6[0x7]);_0x5172ff[_0x739d('0x22')](_0x48dee6[0x8]);_0x5172ff[_0x739d('0x22')](_0x48dee6[0x9]);_0x5172ff[_0x739d('0x22')](_0x48dee6[0xa]);_0x5172ff[_0x739d('0x22')](_0x1f168f[_0x739d('0x15')]['id']);_0x5172ff['push'](_0x1f168f['message']['id']);_0x5172ff['push'](_0x1ff78a[_0x739d('0x2b')]);_0x5172ff[_0x739d('0x22')](_0x1f168f['interaction'][_0x739d('0x2c')]);_0x5172ff[_0x739d('0x22')](_0x1f168f[_0x739d('0x2d')][_0x739d('0x2d')]);_0x5172ff['push'](_0x96f382);break;default:_0x5172ff=_['isNil'](_0x1ff78a[_0x739d('0x1f')])?[]:_0x1ff78a[_0x739d('0x1f')][_0x739d('0x20')](',');}var _0x6faa50={'id':util['format'](_0x739d('0x2e'),_0x4869bd,_0x1ff78a['id'],_0x1ff78a[_0x739d('0x1c')]),'condition':require(_0x739d('0x2f'))[_0x739d('0x30')](_0x4869bd,getIntervals(_0x305bfc[_0x739d('0x31')],_0x1ff78a),_0x305bfc),'consequence':require(_0x739d('0x32')+_0x1ff78a[_0x739d('0x1c')])[_0x739d('0x33')](_0x4869bd,_0x5172ff,_0x305bfc,_0x1f168f),'p':_0x1ff78a[_0x739d('0x34')]||0x0};logger[_0x739d('0x35')](_0x739d('0x36'),_0x6faa50['id'],'on\x20interval',getIntervals(_0x305bfc[_0x739d('0x31')],_0x1ff78a)['join'](_0x739d('0x37')));_0x2d6359['push'](_0x6faa50);}else{logger[_0x739d('0x38')](_0x739d('0x39'),path[_0x739d('0x1b')](__dirname,_0x739d('0x18'),_0x1ff78a[_0x739d('0x1c')]+_0x739d('0x3a')));}}_0x305bfc[_0x739d('0x12')][_0x4869bd]=new RuleEngine(_0x2d6359);_0x305bfc[_0x739d('0x12')][_0x4869bd][_0x739d('0x3b')](_0x1f168f,function(_0x1859fe){logger[_0x739d('0x35')](_0x739d('0x3c'),JSON[_0x739d('0x3d')](_0x1859fe[_0x739d('0x3e')]));if(_0x305bfc['rules'][_0x4869bd]){_0x305bfc[_0x739d('0x12')][_0x4869bd][_0x739d('0x3f')](_0x739d('0x40'));}});return _0x48fd2a({'code':0xc8,'message':_0x1f168f});}else{if(_0x157d83){logger[_0x739d('0x35')](util['format'](_0x739d('0x41'),_0x4869bd));}else{logger[_0x739d('0x35')]('No\x20applications\x20to\x20execute');}return _0x48fd2a({'code':0xc8,'message':_0x1f168f});}}catch(_0x20941f){logger[_0x739d('0x38')](_0x20941f['stack']);return _0x1873f8(_0x152325[_0x739d('0x38')](0x1f4,_0x20941f));}}return _0x1873f8(_0x739d('0x42'));});},'AcceptMessage':function(_0x4bcece){var _0x5744c2=this;return new Promise(function(_0x3fa752,_0x5319cf){if(_0x4bcece[_0x739d('0x43')]&&_0x4bcece['agent']['id']){if(_0x305bfc[_0x739d('0x44')][_0x4bcece['agent']['id']]){_0x305bfc['agents'][_0x4bcece[_0x739d('0x43')]['id']][_0x739d('0x45')]=![];_0x305bfc['agents'][_0x4bcece['agent']['id']][_0x739d('0x46')]=undefined;}}if(_0x4bcece[_0x739d('0x14')]&&_0x4bcece[_0x739d('0x14')]['id']){try{var _0x148d82=getId(_0x4bcece['channel'],_0x4bcece[_0x739d('0x14')]?_0x4bcece[_0x739d('0x14')]['id']:0x0,_0x4bcece[_0x739d('0x15')]?_0x4bcece[_0x739d('0x15')]['id']:0x0);if(_0x305bfc['rules'][_0x148d82]){_0x305bfc['rules'][_0x148d82][_0x739d('0x3f')](_0x739d('0x47'));if(rpc[_0x4bcece[_0x739d('0x13')]+'QueueReport']){rpc[_0x4bcece[_0x739d('0x13')]+_0x739d('0x48')][_0x739d('0x49')](_0x148d82,{'UserId':_0x4bcece[_0x739d('0x14')][_0x739d('0x4a')]})[_0x739d('0x4b')](function(){logger[_0x739d('0x38')]('error\x20update\x20queue\x20report');});}}return _0x3fa752({'code':0xc8,'message':_0x4bcece});}catch(_0x21c0e8){logger[_0x739d('0x38')](_0x21c0e8[_0x739d('0x4c')]);return _0x5319cf(_0x5744c2[_0x739d('0x38')](0x1f4,_0x21c0e8));}}logger[_0x739d('0x38')](_0x739d('0x4d'));return _0x5319cf(_0x5744c2['error'](0x1f4,_0x739d('0x4d')));});},'RejectMessage':function(_0xa2bf7c){var _0xfcf3bb=this;return new Promise(function(_0x10f6a9,_0x1327e1){if(_0xa2bf7c[_0x739d('0x43')]&&_0xa2bf7c[_0x739d('0x43')]['id']){try{if(_0x305bfc[_0x739d('0x44')][_0xa2bf7c['agent']['id']]){_0x305bfc[_0x739d('0x44')][_0xa2bf7c[_0x739d('0x43')]['id']]['busy']=![];_0x305bfc[_0x739d('0x44')][_0xa2bf7c[_0x739d('0x43')]['id']]['busyQueue']=undefined;}return _0x10f6a9({'code':0xc8,'message':_0xa2bf7c});}catch(_0x4fb4a7){logger[_0x739d('0x38')](_0x4fb4a7[_0x739d('0x4c')]);return _0x1327e1(_0xfcf3bb['error'](0x1f4,_0x4fb4a7));}}logger[_0x739d('0x38')](_0x739d('0x4d'));return _0x1327e1(_0xfcf3bb[_0x739d('0x38')](0x1f4,_0x739d('0x4d')));});},'AbandonInteraction':function(_0x474898){var _0x53f136=this;return new Promise(function(_0x53e26f,_0x1ac64b){if(_0x474898['channel']&&_0x474898[_0x739d('0x15')]&&_0x474898[_0x739d('0x15')]['id']){try{var _0x540c6d=getId(_0x474898['channel'],_0x474898[_0x739d('0x14')]?_0x474898['message']['id']:0x0,_0x474898[_0x739d('0x15')]?_0x474898['interaction']['id']:0x0);if(_0x305bfc[_0x739d('0x12')][_0x540c6d]){_0x305bfc[_0x739d('0x12')][_0x540c6d][_0x739d('0x3f')](_0x739d('0x47'));}return _0x53e26f({'code':0xc8,'message':_0x474898});}catch(_0x6ed396){logger[_0x739d('0x38')](_0x6ed396['stack']);return _0x1ac64b(_0x53f136[_0x739d('0x38')](0x1f4,_0x6ed396));}}logger[_0x739d('0x38')](_0x739d('0x4d'));return _0x1ac64b(_0x53f136[_0x739d('0x38')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x3043b0){var _0x24a41a=this;return new Promise(function(_0x2b5a97,_0x231f1a){if(_0x305bfc['agents']['hasOwnProperty'](_0x3043b0['id'])){for(var _0x27110c in _0x3043b0[_0x739d('0x4e')]){if(_0x3043b0[_0x739d('0x4e')][_0x739d('0x4f')](_0x27110c)){if(_0x305bfc[_0x739d('0x44')][_0x3043b0['id']][_0x739d('0x4f')](_0x27110c+_0x739d('0x50'))){_0x305bfc[_0x739d('0x44')][_0x3043b0['id']][_0x27110c+'CurrentCapacity']=parseInt(_0x3043b0['capacity'][_0x27110c],0xa);}}}_0x305bfc['agents'][_0x3043b0['id']][_0x739d('0x51')]();return _0x2b5a97({'code':0xc8,'message':_0x305bfc['agents'][_0x3043b0['id']]});}else{return _0x231f1a(_0x24a41a[_0x739d('0x38')](0x1f4,_0x739d('0x52')));}});},'Agents':function(_0x57d5e1){return new Promise(function(_0x4b070b){var _0x3942a7=_['values'](_0x305bfc['agents']);if(_0x57d5e1&&_0x57d5e1['id']){var _0x59bd20=_[_0x739d('0x53')](_0x3942a7,function(_0x3a9cee){return _0x3a9cee['id']===_0x57d5e1['id'];});_0x4b070b(_0x59bd20);}else{_0x4b070b({'count':_0x3942a7['length'],'rows':_0x3942a7});}});},'ChatQueues':function(){return new Promise(function(_0x10cb3c){var _0x33078e=[];for(var _0x1390a2 in _0x305bfc[_0x739d('0x54')]){if(_0x305bfc[_0x739d('0x54')][_0x739d('0x4f')](_0x1390a2)){var _0x554702=_0x305bfc[_0x739d('0x54')][_0x1390a2];var _0x229392={'id':_0x554702['id'],'available':_0x554702['available'],'loggedIn':_0x554702['loggedIn'],'name':_0x554702['name'],'paused':_0x554702[_0x739d('0x55')],'waiting':_0x554702['waiting']};_0x33078e[_0x739d('0x22')](_0x229392);}}_0x10cb3c({'count':_0x33078e['length'],'rows':_0x33078e});});},'MailQueues':function(){return new Promise(function(_0x1ff841){var _0x3d139a=[];for(var _0x251b55 in _0x305bfc[_0x739d('0x56')]){if(_0x305bfc['mailQueues'][_0x739d('0x4f')](_0x251b55)){var _0x230423=_0x305bfc[_0x739d('0x56')][_0x251b55];var _0xbc196={'id':_0x230423['id'],'available':_0x230423['available'],'loggedIn':_0x230423[_0x739d('0x57')],'name':_0x230423[_0x739d('0x58')],'paused':_0x230423[_0x739d('0x55')],'waiting':_0x230423[_0x739d('0x59')]};_0x3d139a[_0x739d('0x22')](_0xbc196);}}_0x1ff841({'count':_0x3d139a[_0x739d('0x19')],'rows':_0x3d139a});});},'OpenchannelQueues':function(){return new Promise(function(_0xc0a29){var _0x4790b9=[];for(var _0x15036f in _0x305bfc[_0x739d('0x5a')]){if(_0x305bfc[_0x739d('0x5a')][_0x739d('0x4f')](_0x15036f)){var _0x133485=_0x305bfc[_0x739d('0x5a')][_0x15036f];var _0x757a90={'id':_0x133485['id'],'available':_0x133485['available'],'loggedIn':_0x133485['loggedIn'],'name':_0x133485[_0x739d('0x58')],'paused':_0x133485[_0x739d('0x55')],'waiting':_0x133485['waiting']};_0x4790b9[_0x739d('0x22')](_0x757a90);}}_0xc0a29({'count':_0x4790b9[_0x739d('0x19')],'rows':_0x4790b9});});},'SmsQueues':function(){return new Promise(function(_0x1b032d){var _0x4ebfc2=[];for(var _0x1d91c1 in _0x305bfc[_0x739d('0x5b')]){if(_0x305bfc['smsQueues'][_0x739d('0x4f')](_0x1d91c1)){var _0x1c6dea=_0x305bfc['smsQueues'][_0x1d91c1];var _0x5e7552={'id':_0x1c6dea['id'],'available':_0x1c6dea[_0x739d('0x5c')],'loggedIn':_0x1c6dea[_0x739d('0x57')],'name':_0x1c6dea[_0x739d('0x58')],'paused':_0x1c6dea[_0x739d('0x55')],'waiting':_0x1c6dea[_0x739d('0x59')]};_0x4ebfc2['push'](_0x5e7552);}}_0x1b032d({'count':_0x4ebfc2[_0x739d('0x19')],'rows':_0x4ebfc2});});},'FaxQueues':function(){return new Promise(function(_0x4330d7){var _0x60c67b=[];for(var _0x3ec60c in _0x305bfc[_0x739d('0x5d')]){if(_0x305bfc['faxQueues'][_0x739d('0x4f')](_0x3ec60c)){var _0x4b85eb=_0x305bfc[_0x739d('0x5d')][_0x3ec60c];var _0x428bb0={'id':_0x4b85eb['id'],'available':_0x4b85eb[_0x739d('0x5c')],'loggedIn':_0x4b85eb[_0x739d('0x57')],'name':_0x4b85eb[_0x739d('0x58')],'paused':_0x4b85eb['paused'],'waiting':_0x4b85eb[_0x739d('0x59')]};_0x60c67b[_0x739d('0x22')](_0x428bb0);}}_0x4330d7({'count':_0x60c67b[_0x739d('0x19')],'rows':_0x60c67b});});},'WhatsappQueues':function(){return new Promise(function(_0x1c25c0){var _0x4dff9f=[];for(var _0x2bc1c2 in _0x305bfc[_0x739d('0x5e')]){if(_0x305bfc['whatsappQueues']['hasOwnProperty'](_0x2bc1c2)){var _0x450e8c=_0x305bfc['whatsappQueues'][_0x2bc1c2];var _0x483f42={'id':_0x450e8c['id'],'available':_0x450e8c['available'],'loggedIn':_0x450e8c['loggedIn'],'name':_0x450e8c[_0x739d('0x58')],'paused':_0x450e8c[_0x739d('0x55')],'waiting':_0x450e8c[_0x739d('0x59')]};_0x4dff9f[_0x739d('0x22')](_0x483f42);}}_0x1c25c0({'count':_0x4dff9f['length'],'rows':_0x4dff9f});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0xe52a70){var _0x29d63f=_[_0x739d('0x5f')](_0x305bfc[_0x739d('0x60')]);_0xe52a70({'count':_0x29d63f[_0x739d('0x19')],'rows':_0x29d63f});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0xf753c4){var _0x29af61=_[_0x739d('0x5f')](_0x305bfc[_0x739d('0x61')]);_0xf753c4({'count':_0x29af61['length'],'rows':_0x29af61});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x593a2e){var _0x2351ac=_[_0x739d('0x5f')](_0x305bfc[_0x739d('0x62')]);_0x593a2e({'count':_0x2351ac[_0x739d('0x19')],'rows':_0x2351ac});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2e78f5){var _0x129b08=_[_0x739d('0x5f')](_0x305bfc[_0x739d('0x63')]);_0x2e78f5({'count':_0x129b08[_0x739d('0x19')],'rows':_0x129b08});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x68db23){var _0x208e6f=_[_0x739d('0x5f')](_0x305bfc[_0x739d('0x64')]);_0x68db23({'count':_0x208e6f[_0x739d('0x19')],'rows':_0x208e6f});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x31c3e7){var _0x2b53d3=_[_0x739d('0x5f')](_0x305bfc['whatsappQueuesWaitingInteractions']);_0x31c3e7({'count':_0x2b53d3[_0x739d('0x19')],'rows':_0x2b53d3});});}};var _0x463087=jayson[_0x739d('0x65')](_0x1dd380)[_0x739d('0x66')]();_0x463087['on'](_0x739d('0x38'),function(_0x163967){logger[_0x739d('0x38')](JSON['stringify'](_0x163967));return _0x234f5d(_0x163967);});_0x463087['listen'](0x232c,_0x739d('0x67'),function(){console[_0x739d('0x68')](_0x739d('0x69'),0x232c);return _0x4c06af(_0x739d('0x6a')+0x232c);});});}; \ No newline at end of file +var _0x49c1=['stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','agents','agent','busyQueue','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','find','chatQueues','available','loggedIn','name','paused','mailQueues','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','./applications/strategy/util','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','transfer','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','dialogflowv2','tag','tvox','account','notificationTemplate','ChatWebsiteId','ContactId','body','format','./interval','condition','consequence','priority','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','info','Applications\x20executed'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x49c1,0xef));var _0x149c=function(_0x4c667f,_0x335204){_0x4c667f=_0x4c667f-0x0;var _0xe099b0=_0x49c1[_0x4c667f];return _0xe099b0;};'use strict';var _=require(_0x149c('0x0'));var util=require('util');var path=require(_0x149c('0x1'));var fs=require('fs');var jayson=require(_0x149c('0x2'));var BPromise=require(_0x149c('0x3'));var utils=require('./applications/utils');var sUtils=require(_0x149c('0x4'));var logger=require(_0x149c('0x5'))('routing');var rpc={'openchannelQueueReport':require(_0x149c('0x6')),'mailQueueReport':require(_0x149c('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x149c('0x8')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x149c('0x9'))};var RuleEngine=require(_0x149c('0xa'));function getId(_0x51f682,_0x4396bb,_0xfe0da6){return util['format'](_0x149c('0xb'),_0x51f682,_0x4396bb||0x0,_0xfe0da6||0x0);}function getIntervals(_0x350050,_0x486451){var _0x3dc08d=[];if(!_[_0x149c('0xc')](_0x486451[_0x149c('0xd')])&&!_[_0x149c('0xc')](_0x350050[_0x486451['IntervalId']])&&!_[_0x149c('0xc')](_0x350050[_0x486451[_0x149c('0xd')]][_0x149c('0xe')])){_0x3dc08d=_[_0x149c('0xf')](_0x350050[_0x486451[_0x149c('0xd')]][_0x149c('0xe')],_0x149c('0x10'));}else if(!_[_0x149c('0xc')](_0x486451['interval'])){_0x3dc08d=[_0x486451[_0x149c('0x10')]];}return _0x3dc08d;}exports[_0x149c('0x11')]=function(_0x4aee29){_0x4aee29[_0x149c('0x12')]={};return new BPromise(function(_0x4e6cbc,_0x112d99){var _0x1d2a83={'Start':function(_0x177800){var _0x471e93=this;return new Promise(function(_0x3d851a,_0x30f8c1){if(_0x177800){try{var _0x3659eb=[];var _0x3e966f=getId(_0x177800[_0x149c('0x13')],_0x177800['message']?_0x177800[_0x149c('0x14')]['id']:0x0,_0x177800[_0x149c('0x15')]?_0x177800[_0x149c('0x15')]['id']:0x0);var _0x1bcd3d=sUtils[_0x149c('0x16')](_0x4aee29,_0x177800);if(_0x177800[_0x149c('0x17')]||!_0x1bcd3d&&_0x177800[_0x149c('0x18')]&&_[_0x149c('0x19')](_0x177800['applications'])&&_0x177800[_0x149c('0x18')]['length']){for(var _0x5d57c7=0x0;_0x5d57c7<_0x177800['applications'][_0x149c('0x1a')];_0x5d57c7+=0x1){var _0x14194d=_0x177800[_0x149c('0x18')][_0x5d57c7];if(fs[_0x149c('0x1b')](path[_0x149c('0x1c')](__dirname,_0x149c('0x18'),_0x14194d[_0x149c('0x1d')]+'.js'))){var _0x398203=[];switch(_0x14194d[_0x149c('0x1d')][_0x149c('0x1e')]()){case _0x149c('0x1f'):var _0x2cdd54=_0x14194d[_0x149c('0x20')][_0x149c('0x21')](',');if(_0x177800[_0x149c('0x13')]==='mail'){_0x398203[_0x149c('0x22')](_0x2cdd54[0x0]);_0x398203[_0x149c('0x22')](_0x2cdd54[0x1]);_0x398203['push'](_0x2cdd54[_0x149c('0x23')](0x2,_0x2cdd54[_0x149c('0x1a')])[_0x149c('0x1c')](','));}else{_0x398203[_0x149c('0x22')](_0x2cdd54[0x0]);_0x398203['push'](_0x2cdd54[_0x149c('0x23')](0x1,_0x2cdd54[_0x149c('0x1a')])[_0x149c('0x1c')](','));}break;case _0x149c('0x24'):var _0x149705=_0x14194d[_0x149c('0x20')][_0x149c('0x21')](',');_0x398203['push'](_0x149705[0x0]);_0x398203['push'](_0x149705[0x1]);_0x398203[_0x149c('0x22')](_0x149705[_0x149c('0x23')](0x2,_0x149705[_0x149c('0x1a')])['join'](','));break;case _0x149c('0x25'):var _0xcac130=_0x14194d[_0x149c('0x20')][_0x149c('0x21')](',');_0x398203['push'](_0xcac130[0x0]);_0x398203[_0x149c('0x22')](_0xcac130[0x1]);_0x398203[_0x149c('0x22')](_0xcac130[0x2]);_0x398203[_0x149c('0x22')](_0xcac130[0x3]);_0x398203[_0x149c('0x22')](_0xcac130[_0x149c('0x23')](0x4,_0xcac130['length'])[_0x149c('0x1c')](','));break;case'amazonlex':var _0x3b222a=_0x14194d[_0x149c('0x20')][_0x149c('0x21')](',');_0x398203[_0x149c('0x22')](_0x3b222a[0x0]);_0x398203[_0x149c('0x22')](_0x3b222a[0x1]);_0x398203[_0x149c('0x22')](_0x3b222a[0x2]);_0x398203[_0x149c('0x22')](_0x3b222a[0x3]);_0x398203['push'](_0x3b222a[_0x149c('0x23')](0x4,_0x3b222a['length'])[_0x149c('0x1c')](','));break;case'message':_0x398203[_0x149c('0x22')](_0x14194d['appdata']);break;case _0x149c('0x26'):_0x398203[_0x149c('0x22')](_0x14194d['TagId']);_0x398203['push'](_0x14194d[_0x149c('0x20')]);break;case _0x149c('0x27'):var _0x59d3ec=utils['getMustacheRender'](_0x177800[_0x149c('0x28')][_0x149c('0x29')],_0x177800);var _0x125261=_0x14194d[_0x149c('0x20')][_0x149c('0x21')](',');_0x398203[_0x149c('0x22')](_0x125261[0x0]);_0x398203['push'](_0x125261[0x1]);_0x398203[_0x149c('0x22')](_0x125261[0x2]);_0x398203[_0x149c('0x22')](_0x125261[0x3]);_0x398203[_0x149c('0x22')](_0x125261[0x4]);_0x398203[_0x149c('0x22')](_0x125261[0x5]);_0x398203['push'](_0x125261[0x6]);_0x398203[_0x149c('0x22')](_0x125261[0x7]);_0x398203[_0x149c('0x22')](_0x125261[0x8]);_0x398203[_0x149c('0x22')](_0x125261[0x9]);_0x398203[_0x149c('0x22')](_0x125261[0xa]);_0x398203['push'](_0x177800['interaction']['id']);_0x398203[_0x149c('0x22')](_0x177800[_0x149c('0x14')]['id']);_0x398203['push'](_0x14194d[_0x149c('0x2a')]);_0x398203['push'](_0x177800[_0x149c('0x15')][_0x149c('0x2b')]);_0x398203[_0x149c('0x22')](_0x177800[_0x149c('0x2c')][_0x149c('0x2c')]);_0x398203['push'](_0x59d3ec);break;default:_0x398203=_[_0x149c('0xc')](_0x14194d[_0x149c('0x20')])?[]:_0x14194d['appdata']['split'](',');}var _0x25b7e6={'id':util[_0x149c('0x2d')]('%s:%s:%s',_0x3e966f,_0x14194d['id'],_0x14194d[_0x149c('0x1d')]),'condition':require(_0x149c('0x2e'))[_0x149c('0x2f')](_0x3e966f,getIntervals(_0x4aee29['intervals'],_0x14194d),_0x4aee29),'consequence':require('./applications/'+_0x14194d[_0x149c('0x1d')])[_0x149c('0x30')](_0x3e966f,_0x398203,_0x4aee29,_0x177800),'p':_0x14194d[_0x149c('0x31')]||0x0};logger['info'](_0x149c('0x32'),_0x25b7e6['id'],'on\x20interval',getIntervals(_0x4aee29['intervals'],_0x14194d)[_0x149c('0x1c')](_0x149c('0x33')));_0x3659eb[_0x149c('0x22')](_0x25b7e6);}else{logger[_0x149c('0x34')](_0x149c('0x35'),path[_0x149c('0x1c')](__dirname,'applications',_0x14194d[_0x149c('0x1d')]+_0x149c('0x36')));}}_0x4aee29[_0x149c('0x12')][_0x3e966f]=new RuleEngine(_0x3659eb);_0x4aee29[_0x149c('0x12')][_0x3e966f][_0x149c('0x37')](_0x177800,function(_0x1835db){logger[_0x149c('0x38')](_0x149c('0x39'),JSON[_0x149c('0x3a')](_0x1835db[_0x149c('0x3b')]));if(_0x4aee29['rules'][_0x3e966f]){_0x4aee29[_0x149c('0x12')][_0x3e966f][_0x149c('0x3c')](_0x149c('0x3d'));}});return _0x3d851a({'code':0xc8,'message':_0x177800});}else{if(_0x1bcd3d){logger[_0x149c('0x38')](util[_0x149c('0x2d')]('Skipped\x20routing\x20for\x20%s',_0x3e966f));}else{logger['info'](_0x149c('0x3e'));}return _0x3d851a({'code':0xc8,'message':_0x177800});}}catch(_0x568b5b){logger[_0x149c('0x34')](_0x568b5b[_0x149c('0x3f')]);return _0x30f8c1(_0x471e93['error'](0x1f4,_0x568b5b));}}return _0x30f8c1('routing\x20is\x20empty');});},'AcceptMessage':function(_0x470f64){var _0x24fbe9=this;return new Promise(function(_0x54ab08,_0x145d2a){if(_0x470f64['agent']&&_0x470f64['agent']['id']){if(_0x4aee29[_0x149c('0x40')][_0x470f64[_0x149c('0x41')]['id']]){_0x4aee29['agents'][_0x470f64['agent']['id']]['busy']=![];_0x4aee29[_0x149c('0x40')][_0x470f64[_0x149c('0x41')]['id']][_0x149c('0x42')]=undefined;}}if(_0x470f64[_0x149c('0x14')]&&_0x470f64['message']['id']){try{var _0x583092=getId(_0x470f64[_0x149c('0x13')],_0x470f64[_0x149c('0x14')]?_0x470f64['message']['id']:0x0,_0x470f64[_0x149c('0x15')]?_0x470f64[_0x149c('0x15')]['id']:0x0);if(_0x4aee29['rules'][_0x583092]){_0x4aee29['rules'][_0x583092]['emit']('end');if(rpc[_0x470f64[_0x149c('0x13')]+_0x149c('0x43')]){rpc[_0x470f64[_0x149c('0x13')]+'QueueReport'][_0x149c('0x44')](_0x583092,{'UserId':_0x470f64['message'][_0x149c('0x45')]})['catch'](function(){logger[_0x149c('0x34')](_0x149c('0x46'));});}}return _0x54ab08({'code':0xc8,'message':_0x470f64});}catch(_0x45c59d){logger[_0x149c('0x34')](_0x45c59d[_0x149c('0x3f')]);return _0x145d2a(_0x24fbe9[_0x149c('0x34')](0x1f4,_0x45c59d));}}logger['error'](_0x149c('0x47'));return _0x145d2a(_0x24fbe9[_0x149c('0x34')](0x1f4,_0x149c('0x47')));});},'RejectMessage':function(_0x4ad160){var _0xb5e39f=this;return new Promise(function(_0x4341cb,_0x98687c){if(_0x4ad160[_0x149c('0x41')]&&_0x4ad160[_0x149c('0x41')]['id']){try{if(_0x4aee29[_0x149c('0x40')][_0x4ad160[_0x149c('0x41')]['id']]){_0x4aee29[_0x149c('0x40')][_0x4ad160[_0x149c('0x41')]['id']]['busy']=![];_0x4aee29[_0x149c('0x40')][_0x4ad160[_0x149c('0x41')]['id']][_0x149c('0x42')]=undefined;}return _0x4341cb({'code':0xc8,'message':_0x4ad160});}catch(_0x5c1967){logger['error'](_0x5c1967[_0x149c('0x3f')]);return _0x98687c(_0xb5e39f[_0x149c('0x34')](0x1f4,_0x5c1967));}}logger['error'](_0x149c('0x47'));return _0x98687c(_0xb5e39f[_0x149c('0x34')](0x1f4,_0x149c('0x47')));});},'AbandonInteraction':function(_0x902d3){var _0x533188=this;return new Promise(function(_0x54301e,_0x313094){if(_0x902d3['channel']&&_0x902d3['interaction']&&_0x902d3[_0x149c('0x15')]['id']){try{var _0x5182e2=getId(_0x902d3[_0x149c('0x13')],_0x902d3[_0x149c('0x14')]?_0x902d3['message']['id']:0x0,_0x902d3['interaction']?_0x902d3[_0x149c('0x15')]['id']:0x0);if(_0x4aee29['rules'][_0x5182e2]){_0x4aee29[_0x149c('0x12')][_0x5182e2]['emit'](_0x149c('0x48'));}return _0x54301e({'code':0xc8,'message':_0x902d3});}catch(_0x3e494b){logger['error'](_0x3e494b[_0x149c('0x3f')]);return _0x313094(_0x533188[_0x149c('0x34')](0x1f4,_0x3e494b));}}logger[_0x149c('0x34')]('message\x20is\x20empty');return _0x313094(_0x533188[_0x149c('0x34')](0x1f4,_0x149c('0x47')));});},'AgentCapacity':function(_0x4ee8bf){var _0x147f44=this;return new Promise(function(_0x36b9f9,_0x31e488){if(_0x4aee29[_0x149c('0x40')][_0x149c('0x49')](_0x4ee8bf['id'])){for(var _0x24d972 in _0x4ee8bf[_0x149c('0x4a')]){if(_0x4ee8bf['capacity'][_0x149c('0x49')](_0x24d972)){if(_0x4aee29['agents'][_0x4ee8bf['id']]['hasOwnProperty'](_0x24d972+'CurrentCapacity')){_0x4aee29['agents'][_0x4ee8bf['id']][_0x24d972+_0x149c('0x4b')]=parseInt(_0x4ee8bf[_0x149c('0x4a')][_0x24d972],0xa);}}}_0x4aee29['agents'][_0x4ee8bf['id']][_0x149c('0x4c')]();return _0x36b9f9({'code':0xc8,'message':_0x4aee29[_0x149c('0x40')][_0x4ee8bf['id']]});}else{return _0x31e488(_0x147f44['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x301c18){return new Promise(function(_0x210541){var _0x401771=_[_0x149c('0x4d')](_0x4aee29[_0x149c('0x40')]);if(_0x301c18&&_0x301c18['id']){var _0x5df9e5=_[_0x149c('0x4e')](_0x401771,function(_0x204a49){return _0x204a49['id']===_0x301c18['id'];});_0x210541(_0x5df9e5);}else{_0x210541({'count':_0x401771['length'],'rows':_0x401771});}});},'ChatQueues':function(){return new Promise(function(_0x4cc469){var _0x36759c=[];for(var _0x19efbf in _0x4aee29[_0x149c('0x4f')]){if(_0x4aee29[_0x149c('0x4f')][_0x149c('0x49')](_0x19efbf)){var _0x4d2b4b=_0x4aee29[_0x149c('0x4f')][_0x19efbf];var _0x4e2021={'id':_0x4d2b4b['id'],'available':_0x4d2b4b[_0x149c('0x50')],'loggedIn':_0x4d2b4b[_0x149c('0x51')],'name':_0x4d2b4b[_0x149c('0x52')],'paused':_0x4d2b4b[_0x149c('0x53')],'waiting':_0x4d2b4b['waiting']};_0x36759c[_0x149c('0x22')](_0x4e2021);}}_0x4cc469({'count':_0x36759c[_0x149c('0x1a')],'rows':_0x36759c});});},'MailQueues':function(){return new Promise(function(_0x5c7a5e){var _0x3adc36=[];for(var _0x1d9502 in _0x4aee29[_0x149c('0x54')]){if(_0x4aee29[_0x149c('0x54')]['hasOwnProperty'](_0x1d9502)){var _0x20704d=_0x4aee29['mailQueues'][_0x1d9502];var _0xae1c70={'id':_0x20704d['id'],'available':_0x20704d[_0x149c('0x50')],'loggedIn':_0x20704d[_0x149c('0x51')],'name':_0x20704d[_0x149c('0x52')],'paused':_0x20704d[_0x149c('0x53')],'waiting':_0x20704d['waiting']};_0x3adc36['push'](_0xae1c70);}}_0x5c7a5e({'count':_0x3adc36[_0x149c('0x1a')],'rows':_0x3adc36});});},'OpenchannelQueues':function(){return new Promise(function(_0x45c752){var _0x249467=[];for(var _0x4844b6 in _0x4aee29['openchannelQueues']){if(_0x4aee29[_0x149c('0x55')][_0x149c('0x49')](_0x4844b6)){var _0x4f341a=_0x4aee29[_0x149c('0x55')][_0x4844b6];var _0x5847dc={'id':_0x4f341a['id'],'available':_0x4f341a[_0x149c('0x50')],'loggedIn':_0x4f341a[_0x149c('0x51')],'name':_0x4f341a[_0x149c('0x52')],'paused':_0x4f341a['paused'],'waiting':_0x4f341a[_0x149c('0x56')]};_0x249467[_0x149c('0x22')](_0x5847dc);}}_0x45c752({'count':_0x249467[_0x149c('0x1a')],'rows':_0x249467});});},'SmsQueues':function(){return new Promise(function(_0x1e1975){var _0x76beb9=[];for(var _0xf1988d in _0x4aee29['smsQueues']){if(_0x4aee29[_0x149c('0x57')]['hasOwnProperty'](_0xf1988d)){var _0x4647ea=_0x4aee29[_0x149c('0x57')][_0xf1988d];var _0x2bd18c={'id':_0x4647ea['id'],'available':_0x4647ea['available'],'loggedIn':_0x4647ea[_0x149c('0x51')],'name':_0x4647ea[_0x149c('0x52')],'paused':_0x4647ea[_0x149c('0x53')],'waiting':_0x4647ea[_0x149c('0x56')]};_0x76beb9['push'](_0x2bd18c);}}_0x1e1975({'count':_0x76beb9['length'],'rows':_0x76beb9});});},'FaxQueues':function(){return new Promise(function(_0x19e450){var _0x44f63b=[];for(var _0x4dc05d in _0x4aee29[_0x149c('0x58')]){if(_0x4aee29[_0x149c('0x58')][_0x149c('0x49')](_0x4dc05d)){var _0x484c99=_0x4aee29[_0x149c('0x58')][_0x4dc05d];var _0x408f13={'id':_0x484c99['id'],'available':_0x484c99[_0x149c('0x50')],'loggedIn':_0x484c99[_0x149c('0x51')],'name':_0x484c99[_0x149c('0x52')],'paused':_0x484c99['paused'],'waiting':_0x484c99['waiting']};_0x44f63b[_0x149c('0x22')](_0x408f13);}}_0x19e450({'count':_0x44f63b['length'],'rows':_0x44f63b});});},'WhatsappQueues':function(){return new Promise(function(_0x254d16){var _0x243caa=[];for(var _0x5aaa17 in _0x4aee29[_0x149c('0x59')]){if(_0x4aee29['whatsappQueues'][_0x149c('0x49')](_0x5aaa17)){var _0x1e75b6=_0x4aee29[_0x149c('0x59')][_0x5aaa17];var _0x7148e2={'id':_0x1e75b6['id'],'available':_0x1e75b6[_0x149c('0x50')],'loggedIn':_0x1e75b6[_0x149c('0x51')],'name':_0x1e75b6[_0x149c('0x52')],'paused':_0x1e75b6[_0x149c('0x53')],'waiting':_0x1e75b6[_0x149c('0x56')]};_0x243caa[_0x149c('0x22')](_0x7148e2);}}_0x254d16({'count':_0x243caa['length'],'rows':_0x243caa});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x54c339){var _0x125f88=_[_0x149c('0x4d')](_0x4aee29[_0x149c('0x5a')]);_0x54c339({'count':_0x125f88['length'],'rows':_0x125f88});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x28e93e){var _0x285ce5=_[_0x149c('0x4d')](_0x4aee29['mailQueuesWaitingInteractions']);_0x28e93e({'count':_0x285ce5[_0x149c('0x1a')],'rows':_0x285ce5});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x38b5a5){var _0x6a8ce3=_[_0x149c('0x4d')](_0x4aee29[_0x149c('0x5b')]);_0x38b5a5({'count':_0x6a8ce3[_0x149c('0x1a')],'rows':_0x6a8ce3});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x25255a){var _0xea1d03=_[_0x149c('0x4d')](_0x4aee29[_0x149c('0x5c')]);_0x25255a({'count':_0xea1d03[_0x149c('0x1a')],'rows':_0xea1d03});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3b6985){var _0x5e3edf=_[_0x149c('0x4d')](_0x4aee29['faxQueuesWaitingInteractions']);_0x3b6985({'count':_0x5e3edf[_0x149c('0x1a')],'rows':_0x5e3edf});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x2db03b){var _0x420458=_['values'](_0x4aee29[_0x149c('0x5d')]);_0x2db03b({'count':_0x420458[_0x149c('0x1a')],'rows':_0x420458});});}};var _0x2a1707=jayson['server'](_0x1d2a83)[_0x149c('0x5e')]();_0x2a1707['on'](_0x149c('0x34'),function(_0x346736){logger[_0x149c('0x34')](JSON[_0x149c('0x3a')](_0x346736));return _0x112d99(_0x346736);});_0x2a1707[_0x149c('0x11')](0x232c,_0x149c('0x5f'),function(){console[_0x149c('0x60')](_0x149c('0x61'),0x232c);return _0x4e6cbc(_0x149c('0x62')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 881af07..39b879b 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 _0x6bce=['when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','join','lodash','../../../utils/iftime','iftime','../../../config/logger','routing','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','map','some','info','\x20|\x20'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x6bce,0x1d1));var _0xe6bc=function(_0x366655,_0x4d032){_0x366655=_0x366655-0x0;var _0x11e076=_0x6bce[_0x366655];return _0x11e076;};'use strict';var _=require(_0xe6bc('0x0'));var iftime=require(_0xe6bc('0x1'))[_0xe6bc('0x2')];var logger=require(_0xe6bc('0x3'))(_0xe6bc('0x4'));exports['condition']=function(_0x4bb3c4,_0x5c365e,_0x5b16ff){return function(_0x519170){if(_0x5b16ff['rules']&&!_0x5b16ff['rules'][_0x4bb3c4]){logger['info'](_0xe6bc('0x5'),_0x4bb3c4);return _0x519170[_0xe6bc('0x6')]();}var _0x46c01b=_0x5c365e[_0xe6bc('0x7')](function(_0x4a9bf0){return iftime(_0x4a9bf0);});var _0x3bf55f=_[_0xe6bc('0x8')](_0x46c01b);if(_0x3bf55f){logger[_0xe6bc('0x9')]('[%s][INTERVAL\x20VALID]\x20%s\x20%s',_0x4bb3c4,_0x5c365e['join'](_0xe6bc('0xa')),_0x3bf55f);_0x519170[_0xe6bc('0xb')](_0x3bf55f);}else{logger[_0xe6bc('0x9')](_0xe6bc('0xc'),_0x4bb3c4,_0x5c365e[_0xe6bc('0xd')](_0xe6bc('0xa')));_0x519170['stop']();}};}; \ No newline at end of file +var _0x312e=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','some','\x20|\x20','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','join','stop','../../../utils/iftime','iftime','../../../config/logger','routing','rules','info'];(function(_0x2a4284,_0xf6a40f){var _0x28cd6f=function(_0x110244){while(--_0x110244){_0x2a4284['push'](_0x2a4284['shift']());}};_0x28cd6f(++_0xf6a40f);}(_0x312e,0xd7));var _0xe312=function(_0x38be7c,_0xa2935){_0x38be7c=_0x38be7c-0x0;var _0xa350b7=_0x312e[_0x38be7c];return _0xa350b7;};'use strict';var _=require('lodash');var iftime=require(_0xe312('0x0'))[_0xe312('0x1')];var logger=require(_0xe312('0x2'))(_0xe312('0x3'));exports['condition']=function(_0x1c6588,_0x562a58,_0x5c747a){return function(_0x100b59){if(_0x5c747a[_0xe312('0x4')]&&!_0x5c747a[_0xe312('0x4')][_0x1c6588]){logger[_0xe312('0x5')](_0xe312('0x6'),_0x1c6588);return _0x100b59['stop']();}var _0x4e06fa=_0x562a58['map'](function(_0x22572e){return iftime(_0x22572e);});var _0x1213d5=_[_0xe312('0x7')](_0x4e06fa);if(_0x1213d5){logger[_0xe312('0x5')]('[%s][INTERVAL\x20VALID]\x20%s\x20%s',_0x1c6588,_0x562a58['join'](_0xe312('0x8')),_0x1213d5);_0x100b59[_0xe312('0x9')](_0x1213d5);}else{logger[_0xe312('0x5')](_0xe312('0xa'),_0x1c6588,_0x562a58[_0xe312('0xb')](_0xe312('0x8')));_0x100b59[_0xe312('0xc')]();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index d213384..97fe2b0 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 _0x593e=['answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','agentcompleteAt','agentconnectAt','complete','isNil','transfereruniqueid','[%s][agents][blindtransfer]','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','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','type','acw','acwtime','agentacw','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','talktime','[%s][agents][agentconnect]','connect','answered_elsewhere'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x593e,0xcb));var _0xe593=function(_0x4f53fc,_0x3b1e35){_0x4f53fc=_0x4f53fc-0x0;var _0x55da5e=_0x593e[_0x4f53fc];return _0x55da5e;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var utils=require(_0xe593('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x28f28c,_0x43dabb){utils[_0xe593('0x3')](util[_0xe593('0x4')](_0xe593('0x5'),_0x28f28c['uniqueid'],_0x28f28c[_0xe593('0x6')],_0x28f28c[_0xe593('0x7')],_0x28f28c[_0xe593('0x8')],_0x28f28c[_0xe593('0x9')],_0x28f28c[_0xe593('0xa')],_0x28f28c[_0xe593('0xb')],_0x28f28c[_0xe593('0xc')]));if(_0x28f28c[_0xe593('0x7')]){utils[_0xe593('0xd')](_0x28f28c[_0xe593('0x7')])['then'](function(_0x38c470){if(_0x38c470){_0x28f28c[_0xe593('0xe')]=_0x38c470[_0xe593('0xe')];_0x28f28c['agentacw']=_0x28f28c['agentcomplete']?_0x38c470[_0xe593('0xf')]:![];_0x28f28c[_0xe593('0x10')]=_0x28f28c[_0xe593('0x11')]?_0x38c470['acwTimeout']:0x0;}utils[_0xe593('0x12')](_0xe593('0x13'),_0x28f28c);});}else{utils[_0xe593('0x12')](_0xe593('0x13'),_0x28f28c);}if(_0x43dabb){delete transfers[_0x28f28c[_0xe593('0x14')]];}else{delete agents[_0x28f28c[_0xe593('0x15')]];}}exports[_0xe593('0x16')]=function(_0xa4d5e9){try{utils[_0xe593('0x17')](util[_0xe593('0x4')]('[%s][agents][agentcalled]',_0xa4d5e9[_0xe593('0x14')]),_0xa4d5e9);agents[_0xa4d5e9[_0xe593('0x15')]]=_0xa4d5e9;agents[_0xa4d5e9['destuniqueid']][_0xe593('0x18')]=utils[_0xe593('0x19')]();agents[_0xa4d5e9['destuniqueid']][_0xe593('0xc')]=_0xe593('0x1a');agents[_0xa4d5e9[_0xe593('0x15')]][_0xe593('0xb')]=null;agents[_0xa4d5e9[_0xe593('0x15')]][_0xe593('0x1b')]=null;utils['info'](util[_0xe593('0x4')](_0xe593('0x1c'),_0xa4d5e9['uniqueid'],agents[_0xa4d5e9[_0xe593('0x15')]][_0xe593('0x8')],_0xa4d5e9['destuniqueid']));}catch(_0x1c94aa){utils[_0xe593('0x1d')](util[_0xe593('0x4')](_0xe593('0x1e'),_0xa4d5e9[_0xe593('0x14')]),_0x1c94aa);}};exports[_0xe593('0x1f')]=function(_0x3d2a51){try{if(!_['isNil'](agents[_0x3d2a51['destuniqueid']])){utils[_0xe593('0x17')](util['format']('[%s][agents][agentringnoanswer]',_0x3d2a51[_0xe593('0x14')]),_0x3d2a51);utils[_0xe593('0x3')](util['format'](_0xe593('0x20'),_0x3d2a51['uniqueid'],agents[_0x3d2a51[_0xe593('0x15')]][_0xe593('0x8')],_0x3d2a51[_0xe593('0x15')]));agents[_0x3d2a51[_0xe593('0x15')]][_0xe593('0x1f')]=!![];agents[_0x3d2a51[_0xe593('0x15')]][_0xe593('0x21')]=utils[_0xe593('0x19')]();agents[_0x3d2a51['destuniqueid']][_0xe593('0xc')]=_0xe593('0x22');agents[_0x3d2a51['destuniqueid']]['reason']=_0xe593('0x22');agents[_0x3d2a51[_0xe593('0x15')]][_0xe593('0x23')]=_0x3d2a51[_0xe593('0x24')]?parseInt(_0x3d2a51[_0xe593('0x24')])/0x3e8:0x0;agents[_0x3d2a51[_0xe593('0x15')]]['talktime']=0x0;unanswered[_0xe593('0x25')](_0x3d2a51['destuniqueid']);}}catch(_0x1dacf6){utils[_0xe593('0x1d')](util['format'](_0xe593('0x26'),_0x3d2a51['uniqueid']),_0x1dacf6);}};exports[_0xe593('0x27')]=function(_0x1c147b){try{_[_0xe593('0x28')](agents,function(_0x501e54,_0x1ae8d9){if(_0x501e54[_0xe593('0x14')]==_0x1c147b[_0xe593('0x14')]&&!_[_0xe593('0x29')](unanswered,_0x501e54[_0xe593('0x15')])){utils[_0xe593('0x17')](util[_0xe593('0x4')]('[%s][agents][queuecallerabandon]',_0x1c147b[_0xe593('0x14')]),_0x1c147b);utils[_0xe593('0x3')](util['format'](_0xe593('0x2a'),_0x1c147b['uniqueid'],_0x501e54[_0xe593('0x8')],_0x501e54[_0xe593('0x15')]));_0x501e54[_0xe593('0x1f')]=!![];_0x501e54[_0xe593('0x21')]=utils[_0xe593('0x19')]();_0x501e54[_0xe593('0xc')]=_0xe593('0x2b');_0x501e54[_0xe593('0x2c')]=_0xe593('0x2b');_0x501e54[_0xe593('0x23')]=_0x1c147b['holdtime'];_0x501e54[_0xe593('0x2d')]=0x0;writeDB(_0x501e54);}});}catch(_0x2c0a30){utils[_0xe593('0x1d')](util['format']('[%s][agents][queuecallerabandon]',_0x1c147b[_0xe593('0x14')]),_0x2c0a30);}};exports['agentconnect']=function(_0x232bf1){try{if(agents[_0x232bf1[_0xe593('0x15')]]){utils[_0xe593('0x17')](util[_0xe593('0x4')](_0xe593('0x2e'),_0x232bf1[_0xe593('0x14')]),_0x232bf1);utils[_0xe593('0x3')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x232bf1[_0xe593('0x14')],agents[_0x232bf1['destuniqueid']][_0xe593('0x8')],_0x232bf1['destuniqueid']));agents[_0x232bf1[_0xe593('0x15')]]['agentconnectAt']=utils['now']();agents[_0x232bf1[_0xe593('0x15')]][_0xe593('0xb')]=_0x232bf1[_0xe593('0xb')];agents[_0x232bf1['destuniqueid']]['connectedlinename']=_0x232bf1['connectedlinename'];agents[_0x232bf1[_0xe593('0x15')]]['holdtime']=_0x232bf1[_0xe593('0x24')];agents[_0x232bf1[_0xe593('0x15')]][_0xe593('0xc')]=_0xe593('0x2f');_['forIn'](agents,function(_0x196325,_0x53ed3c){if(_0x196325[_0xe593('0x15')]!=_0x232bf1['destuniqueid']&&_0x196325['uniqueid']==_0x232bf1['uniqueid']){_0x196325[_0xe593('0x2d')]=0x0;_0x196325['holdtime']=_0x232bf1[_0xe593('0x24')];_0x196325[_0xe593('0x1f')]=!![];_0x196325[_0xe593('0x21')]=utils['now']();_0x196325[_0xe593('0xc')]=_0xe593('0x30');_0x196325[_0xe593('0x2c')]=_0xe593('0x30');_0x196325[_0xe593('0x31')]=_0x232bf1[_0xe593('0x15')];_0x196325[_0xe593('0x32')]=_0x232bf1[_0xe593('0x8')];writeDB(_0x196325);}});}}catch(_0x4b36e1){utils[_0xe593('0x1d')](util[_0xe593('0x4')](_0xe593('0x2e'),_0x232bf1[_0xe593('0x14')]),_0x4b36e1);}};exports[_0xe593('0x33')]=function(_0x4d3018){try{if(!_['isNil'](agents[_0x4d3018[_0xe593('0x15')]])){utils[_0xe593('0x17')](util[_0xe593('0x4')]('[%s][agents][agentcomplete]',_0x4d3018[_0xe593('0x14')]),_0x4d3018);utils[_0xe593('0x3')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x4d3018[_0xe593('0x14')],agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x8')],_0x4d3018['destuniqueid']));agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x33')]=!![];agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x34')]=utils['now']();agents[_0x4d3018['destuniqueid']]['talktime']=utils['diffTime'](agents[_0x4d3018[_0xe593('0x15')]]['agentcompleteAt'],agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x35')]);agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x2c')]=_0x4d3018[_0xe593('0x2c')];agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0xc')]=_0xe593('0x36');writeDB(agents[_0x4d3018['destuniqueid']]);}}catch(_0x3dbb46){utils[_0xe593('0x1d')](util[_0xe593('0x4')]('[%s][agents][agentcomplete]',_0x4d3018[_0xe593('0x14')]),_0x3dbb46);}};exports['blindtransfer']=function(_0x39ec9e){try{if(!_[_0xe593('0x37')](agents[_0x39ec9e[_0xe593('0x38')]])){utils['debug'](util['format'](_0xe593('0x39'),_0x39ec9e[_0xe593('0x14')]),_0x39ec9e);utils['info'](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x39ec9e['uniqueid'],agents[_0x39ec9e['transfereruniqueid']][_0xe593('0x8')],agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x14')]));agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x3a')]=!![];agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x3b')]=_0xe593('0x3c');agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x3d')]=_0x39ec9e[_0xe593('0x3e')];agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x3f')]=agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x14')];}}catch(_0x46544d){utils['error'](util[_0xe593('0x4')](_0xe593('0x39'),_0x39ec9e[_0xe593('0x14')]),_0x46544d);}};exports[_0xe593('0x40')]=function(_0x1204d8){try{utils[_0xe593('0x17')](util[_0xe593('0x4')](_0xe593('0x41'),_0x1204d8[_0xe593('0x42')]),_0x1204d8);if(_0x1204d8[_0xe593('0x42')]==_0x1204d8[_0xe593('0x43')]){if(!_[_0xe593('0x37')](agents[_0x1204d8[_0xe593('0x44')]])){utils[_0xe593('0x3')](util[_0xe593('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x1204d8[_0xe593('0x42')],agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x8')]));agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x3a')]=!![];agents[_0x1204d8['secondtransfereruniqueid']]['transfertype']=_0xe593('0x45');agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x3d')]=_0x1204d8[_0xe593('0x46')];agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x3f')]=_0x1204d8[_0xe593('0x42')];}if(_0x1204d8['transfereeuniqueid']&&agents[_0x1204d8['transfereeuniqueid']]){agents[_0x1204d8[_0xe593('0x47')]][_0xe593('0x48')]=0x1;transfers[_0x1204d8['transfereeuniqueid']]=_[_0xe593('0x49')](agents[_0x1204d8[_0xe593('0x47')]]);transfers[_0x1204d8[_0xe593('0x47')]][_0xe593('0xa')]=agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0xa')];transfers[_0x1204d8[_0xe593('0x47')]][_0xe593('0x4a')]=agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x4a')];transfers[_0x1204d8['transfereeuniqueid']][_0xe593('0x18')]=utils[_0xe593('0x19')]();transfers[_0x1204d8[_0xe593('0x47')]][_0xe593('0x35')]=utils[_0xe593('0x19')]();transfers[_0x1204d8[_0xe593('0x47')]][_0xe593('0x23')]=0x0;transfers[_0x1204d8['transfereeuniqueid']][_0xe593('0x48')]=0x2;}}else if(_0x1204d8[_0xe593('0x44')]==_0x1204d8[_0xe593('0x4b')]){if(!_[_0xe593('0x37')](agents[_0x1204d8['origtransfereruniqueid']])){utils[_0xe593('0x3')](util[_0xe593('0x4')](_0xe593('0x4c'),_0x1204d8[_0xe593('0x42')],agents[_0x1204d8[_0xe593('0x42')]]['membername']));agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0x3a')]=!![];agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0x3b')]=_0xe593('0x45');agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0x3d')]=_0x1204d8[_0xe593('0x4d')];agents[_0x1204d8['origtransfereruniqueid']][_0xe593('0x3f')]=_0x1204d8[_0xe593('0x44')];}if(_0x1204d8[_0xe593('0x4e')]&&agents[_0x1204d8[_0xe593('0x4e')]]){agents[_0x1204d8[_0xe593('0x4e')]][_0xe593('0x48')]=0x1;transfers[_0x1204d8[_0xe593('0x4e')]]=_[_0xe593('0x49')](agents[_0x1204d8[_0xe593('0x4e')]]);transfers[_0x1204d8[_0xe593('0x4e')]]['calleridnum']=agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0xa')];transfers[_0x1204d8[_0xe593('0x4e')]]['calleridname']=agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0x4a')];transfers[_0x1204d8[_0xe593('0x4e')]][_0xe593('0x18')]=utils[_0xe593('0x19')]();transfers[_0x1204d8['transfertargetuniqueid']][_0xe593('0x35')]=utils[_0xe593('0x19')]();transfers[_0x1204d8['transfertargetuniqueid']][_0xe593('0x23')]=0x0;transfers[_0x1204d8[_0xe593('0x4e')]][_0xe593('0x48')]=0x2;}}}catch(_0x3486b3){utils['error'](util[_0xe593('0x4')](_0xe593('0x41'),_0x1204d8[_0xe593('0x42')]),_0x3486b3);}};exports['hangup']=function(_0x43dcb0){try{utils[_0xe593('0x17')](util[_0xe593('0x4')]('[%s][agents][hangup]',_0x43dcb0[_0xe593('0x14')]),_0x43dcb0);if(agents[_0x43dcb0[_0xe593('0x14')]]&&agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')]===_0xe593('0x22')){if(_0x43dcb0['cause']==='21'){agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')]=_0xe593('0x4f');agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]=_0xe593('0x4f');}utils[_0xe593('0x3')](util[_0xe593('0x4')](_0xe593('0x50'),_0x43dcb0[_0xe593('0x14')],agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x8')],agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')],agents[_0x43dcb0['uniqueid']][_0xe593('0xc')]));writeDB(agents[_0x43dcb0[_0xe593('0x14')]]);var _0x9427d6=unanswered[_0xe593('0x51')](_0x43dcb0[_0xe593('0x14')]);if(_0x9427d6>-0x1){unanswered[_0xe593('0x52')](_0x9427d6,0x1);}}if(transfers[_0x43dcb0[_0xe593('0x14')]]){transfers[_0x43dcb0[_0xe593('0x14')]]['agentcomplete']=!![];transfers[_0x43dcb0['uniqueid']]['agentcompleteAt']=utils[_0xe593('0x19')]();transfers[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2d')]=utils['diffTime'](transfers[_0x43dcb0['uniqueid']][_0xe593('0x34')],transfers[_0x43dcb0['uniqueid']][_0xe593('0x35')]);transfers[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')]='agent';transfers[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]=_0xe593('0x36');utils[_0xe593('0x3')](util[_0xe593('0x4')](_0xe593('0x50'),_0x43dcb0[_0xe593('0x14')],transfers[_0x43dcb0['uniqueid']][_0xe593('0x8')],transfers[_0x43dcb0[_0xe593('0x14')]]['reason'],transfers[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]));writeDB(transfers[_0x43dcb0[_0xe593('0x14')]],!![]);}if(agents[_0x43dcb0['uniqueid']]&&agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x35')]){agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x33')]=!![];agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x34')]=utils['now']();agents[_0x43dcb0['uniqueid']][_0xe593('0x2d')]=utils['diffTime'](agents[_0x43dcb0['uniqueid']]['agentcompleteAt'],agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x35')]);agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')]=agents[_0x43dcb0[_0xe593('0x14')]]['transfer']?'transfer':_0xe593('0x53');agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]=_0xe593('0x36');utils['info'](util[_0xe593('0x4')](_0xe593('0x50'),_0x43dcb0[_0xe593('0x14')],agents[_0x43dcb0['uniqueid']][_0xe593('0x8')],agents[_0x43dcb0[_0xe593('0x14')]]['reason'],agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]));writeDB(agents[_0x43dcb0['uniqueid']]);}}catch(_0x5bb9e2){utils['error'](util['format']('[%s][agents][hangup]',_0x43dcb0['uniqueid']),_0x5bb9e2);}}; \ No newline at end of file +var _0xb43b=['type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','agentcalled','format','destuniqueid','connectedlinenum','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','[%s][agents][agentcalled]','agentringnoanswer','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','reason','timeout','ringtime','talktime','push','error','forIn','membername','agentringnoanswerAt','now','abandoned','holdtime','[%s][agents][queuecallerabandon]','agentconnect','debug','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transferuniqueid','origtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','calleridnum','lastevent','getVoiceQueueByName','then'];(function(_0xca2c3c,_0x53ce03){var _0x2f9e00=function(_0x6631f0){while(--_0x6631f0){_0xca2c3c['push'](_0xca2c3c['shift']());}};_0x2f9e00(++_0x53ce03);}(_0xb43b,0x1b2));var _0xbb43=function(_0x5a9cf0,_0x1a8f6c){_0x5a9cf0=_0x5a9cf0-0x0;var _0x414271=_0xb43b[_0x5a9cf0];return _0x414271;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x1bdcfc,_0x1995f8){utils[_0xbb43('0x2')](util['format'](_0xbb43('0x3'),_0x1bdcfc[_0xbb43('0x4')],_0x1bdcfc[_0xbb43('0x5')],_0x1bdcfc[_0xbb43('0x6')],_0x1bdcfc['membername'],_0x1bdcfc['interface'],_0x1bdcfc[_0xbb43('0x7')],_0x1bdcfc['connectedlinenum'],_0x1bdcfc[_0xbb43('0x8')]));if(_0x1bdcfc[_0xbb43('0x6')]){utils[_0xbb43('0x9')](_0x1bdcfc[_0xbb43('0x6')])[_0xbb43('0xa')](function(_0x4a06f3){if(_0x4a06f3){_0x1bdcfc[_0xbb43('0xb')]=_0x4a06f3[_0xbb43('0xb')];_0x1bdcfc['agentacw']=_0x1bdcfc[_0xbb43('0xc')]?_0x4a06f3[_0xbb43('0xd')]:![];_0x1bdcfc[_0xbb43('0xe')]=_0x1bdcfc[_0xbb43('0xf')]?_0x4a06f3[_0xbb43('0x10')]:0x0;}utils[_0xbb43('0x11')]('CreateVoiceAgentReport',_0x1bdcfc);});}else{utils[_0xbb43('0x11')](_0xbb43('0x12'),_0x1bdcfc);}if(_0x1995f8){delete transfers[_0x1bdcfc['uniqueid']];}else{delete agents[_0x1bdcfc['destuniqueid']];}}exports[_0xbb43('0x13')]=function(_0x4a3714){try{utils['debug'](util[_0xbb43('0x14')]('[%s][agents][agentcalled]',_0x4a3714[_0xbb43('0x4')]),_0x4a3714);agents[_0x4a3714[_0xbb43('0x15')]]=_0x4a3714;agents[_0x4a3714['destuniqueid']]['agentcalledAt']=utils['now']();agents[_0x4a3714[_0xbb43('0x15')]][_0xbb43('0x8')]='called';agents[_0x4a3714['destuniqueid']][_0xbb43('0x16')]=null;agents[_0x4a3714['destuniqueid']]['connectedlinename']=null;utils[_0xbb43('0x2')](util[_0xbb43('0x14')](_0xbb43('0x17'),_0x4a3714['uniqueid'],agents[_0x4a3714[_0xbb43('0x15')]]['membername'],_0x4a3714[_0xbb43('0x15')]));}catch(_0x8e6429){utils['error'](util['format'](_0xbb43('0x18'),_0x4a3714[_0xbb43('0x4')]),_0x8e6429);}};exports[_0xbb43('0x19')]=function(_0x2bf2d4){try{if(!_['isNil'](agents[_0x2bf2d4[_0xbb43('0x15')]])){utils['debug'](util[_0xbb43('0x14')]('[%s][agents][agentringnoanswer]',_0x2bf2d4[_0xbb43('0x4')]),_0x2bf2d4);utils['info'](util[_0xbb43('0x14')](_0xbb43('0x1a'),_0x2bf2d4['uniqueid'],agents[_0x2bf2d4[_0xbb43('0x15')]]['membername'],_0x2bf2d4[_0xbb43('0x15')]));agents[_0x2bf2d4[_0xbb43('0x15')]][_0xbb43('0x19')]=!![];agents[_0x2bf2d4['destuniqueid']]['agentringnoanswerAt']=utils['now']();agents[_0x2bf2d4[_0xbb43('0x15')]][_0xbb43('0x8')]='timeout';agents[_0x2bf2d4[_0xbb43('0x15')]][_0xbb43('0x1b')]=_0xbb43('0x1c');agents[_0x2bf2d4[_0xbb43('0x15')]]['holdtime']=_0x2bf2d4['ringtime']?parseInt(_0x2bf2d4[_0xbb43('0x1d')])/0x3e8:0x0;agents[_0x2bf2d4[_0xbb43('0x15')]][_0xbb43('0x1e')]=0x0;unanswered[_0xbb43('0x1f')](_0x2bf2d4[_0xbb43('0x15')]);}}catch(_0x40b04b){utils[_0xbb43('0x20')](util[_0xbb43('0x14')]('[%s][agents][agentringnoanswer]',_0x2bf2d4[_0xbb43('0x4')]),_0x40b04b);}};exports['queuecallerabandon']=function(_0x31fbc8){try{_[_0xbb43('0x21')](agents,function(_0x34f5b2,_0x1880cd){if(_0x34f5b2['uniqueid']==_0x31fbc8[_0xbb43('0x4')]&&!_['includes'](unanswered,_0x34f5b2['destuniqueid'])){utils['debug'](util[_0xbb43('0x14')]('[%s][agents][queuecallerabandon]',_0x31fbc8[_0xbb43('0x4')]),_0x31fbc8);utils[_0xbb43('0x2')](util[_0xbb43('0x14')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x31fbc8[_0xbb43('0x4')],_0x34f5b2[_0xbb43('0x22')],_0x34f5b2[_0xbb43('0x15')]));_0x34f5b2[_0xbb43('0x19')]=!![];_0x34f5b2[_0xbb43('0x23')]=utils[_0xbb43('0x24')]();_0x34f5b2[_0xbb43('0x8')]=_0xbb43('0x25');_0x34f5b2['reason']=_0xbb43('0x25');_0x34f5b2[_0xbb43('0x26')]=_0x31fbc8[_0xbb43('0x26')];_0x34f5b2[_0xbb43('0x1e')]=0x0;writeDB(_0x34f5b2);}});}catch(_0x4015ec){utils[_0xbb43('0x20')](util[_0xbb43('0x14')](_0xbb43('0x27'),_0x31fbc8[_0xbb43('0x4')]),_0x4015ec);}};exports[_0xbb43('0x28')]=function(_0x21346a){try{if(agents[_0x21346a[_0xbb43('0x15')]]){utils[_0xbb43('0x29')](util[_0xbb43('0x14')](_0xbb43('0x2a'),_0x21346a[_0xbb43('0x4')]),_0x21346a);utils['info'](util[_0xbb43('0x14')](_0xbb43('0x2b'),_0x21346a['uniqueid'],agents[_0x21346a[_0xbb43('0x15')]][_0xbb43('0x22')],_0x21346a[_0xbb43('0x15')]));agents[_0x21346a['destuniqueid']]['agentconnectAt']=utils['now']();agents[_0x21346a[_0xbb43('0x15')]][_0xbb43('0x16')]=_0x21346a['connectedlinenum'];agents[_0x21346a['destuniqueid']][_0xbb43('0x2c')]=_0x21346a[_0xbb43('0x2c')];agents[_0x21346a[_0xbb43('0x15')]][_0xbb43('0x26')]=_0x21346a[_0xbb43('0x1d')];agents[_0x21346a['destuniqueid']][_0xbb43('0x8')]=_0xbb43('0x2d');_[_0xbb43('0x21')](agents,function(_0x3340aa,_0x22fccc){if(_0x3340aa['destuniqueid']!=_0x21346a[_0xbb43('0x15')]&&_0x3340aa['uniqueid']==_0x21346a[_0xbb43('0x4')]){_0x3340aa[_0xbb43('0x1e')]=0x0;_0x3340aa['holdtime']=_0x21346a[_0xbb43('0x1d')];_0x3340aa['agentringnoanswer']=!![];_0x3340aa[_0xbb43('0x23')]=utils[_0xbb43('0x24')]();_0x3340aa[_0xbb43('0x8')]=_0xbb43('0x2e');_0x3340aa['reason']=_0xbb43('0x2e');_0x3340aa[_0xbb43('0x2f')]=_0x21346a['destuniqueid'];_0x3340aa[_0xbb43('0x30')]=_0x21346a['membername'];writeDB(_0x3340aa);}});}}catch(_0x42b965){utils[_0xbb43('0x20')](util[_0xbb43('0x14')](_0xbb43('0x2a'),_0x21346a[_0xbb43('0x4')]),_0x42b965);}};exports[_0xbb43('0xc')]=function(_0x4bf8ed){try{if(!_[_0xbb43('0x31')](agents[_0x4bf8ed['destuniqueid']])){utils[_0xbb43('0x29')](util[_0xbb43('0x14')](_0xbb43('0x32'),_0x4bf8ed[_0xbb43('0x4')]),_0x4bf8ed);utils['info'](util[_0xbb43('0x14')](_0xbb43('0x33'),_0x4bf8ed[_0xbb43('0x4')],agents[_0x4bf8ed[_0xbb43('0x15')]][_0xbb43('0x22')],_0x4bf8ed[_0xbb43('0x15')]));agents[_0x4bf8ed[_0xbb43('0x15')]][_0xbb43('0xc')]=!![];agents[_0x4bf8ed['destuniqueid']][_0xbb43('0x34')]=utils[_0xbb43('0x24')]();agents[_0x4bf8ed['destuniqueid']][_0xbb43('0x1e')]=utils['diffTime'](agents[_0x4bf8ed['destuniqueid']]['agentcompleteAt'],agents[_0x4bf8ed['destuniqueid']][_0xbb43('0x35')]);agents[_0x4bf8ed['destuniqueid']][_0xbb43('0x1b')]=_0x4bf8ed['reason'];agents[_0x4bf8ed[_0xbb43('0x15')]][_0xbb43('0x8')]=_0xbb43('0x36');writeDB(agents[_0x4bf8ed['destuniqueid']]);}}catch(_0x186cd6){utils['error'](util[_0xbb43('0x14')](_0xbb43('0x32'),_0x4bf8ed[_0xbb43('0x4')]),_0x186cd6);}};exports[_0xbb43('0x37')]=function(_0x417ad9){try{if(!_[_0xbb43('0x31')](agents[_0x417ad9[_0xbb43('0x38')]])){utils['debug'](util[_0xbb43('0x14')](_0xbb43('0x39'),_0x417ad9[_0xbb43('0x4')]),_0x417ad9);utils[_0xbb43('0x2')](util['format'](_0xbb43('0x3a'),_0x417ad9[_0xbb43('0x4')],agents[_0x417ad9[_0xbb43('0x38')]][_0xbb43('0x22')],agents[_0x417ad9['transfereruniqueid']][_0xbb43('0x4')]));agents[_0x417ad9[_0xbb43('0x38')]][_0xbb43('0x3b')]=!![];agents[_0x417ad9['transfereruniqueid']][_0xbb43('0x3c')]=_0xbb43('0x3d');agents[_0x417ad9[_0xbb43('0x38')]][_0xbb43('0x3e')]=_0x417ad9[_0xbb43('0x3f')];agents[_0x417ad9['transfereruniqueid']]['transferuniqueid']=agents[_0x417ad9[_0xbb43('0x38')]]['uniqueid'];}}catch(_0xf5d5c){utils[_0xbb43('0x20')](util['format'](_0xbb43('0x39'),_0x417ad9[_0xbb43('0x4')]),_0xf5d5c);}};exports[_0xbb43('0x40')]=function(_0x1a4367){try{utils[_0xbb43('0x29')](util['format'](_0xbb43('0x41'),_0x1a4367['origtransfereruniqueid']),_0x1a4367);if(_0x1a4367['origtransfereruniqueid']==_0x1a4367[_0xbb43('0x42')]){if(!_[_0xbb43('0x31')](agents[_0x1a4367[_0xbb43('0x43')]])){utils[_0xbb43('0x2')](util[_0xbb43('0x14')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x1a4367['origtransfereruniqueid'],agents[_0x1a4367[_0xbb43('0x43')]][_0xbb43('0x22')]));agents[_0x1a4367[_0xbb43('0x43')]][_0xbb43('0x3b')]=!![];agents[_0x1a4367[_0xbb43('0x43')]][_0xbb43('0x3c')]=_0xbb43('0x44');agents[_0x1a4367[_0xbb43('0x43')]][_0xbb43('0x3e')]=_0x1a4367['origtransfererexten'];agents[_0x1a4367[_0xbb43('0x43')]][_0xbb43('0x45')]=_0x1a4367[_0xbb43('0x46')];}if(_0x1a4367[_0xbb43('0x47')]&&agents[_0x1a4367[_0xbb43('0x47')]]){agents[_0x1a4367[_0xbb43('0x47')]][_0xbb43('0x48')]=0x1;transfers[_0x1a4367[_0xbb43('0x47')]]=_[_0xbb43('0x49')](agents[_0x1a4367['transfereeuniqueid']]);transfers[_0x1a4367['transfereeuniqueid']][_0xbb43('0x7')]=agents[_0x1a4367[_0xbb43('0x43')]][_0xbb43('0x7')];transfers[_0x1a4367[_0xbb43('0x47')]][_0xbb43('0x4a')]=agents[_0x1a4367[_0xbb43('0x43')]][_0xbb43('0x4a')];transfers[_0x1a4367['transfereeuniqueid']][_0xbb43('0x4b')]=utils['now']();transfers[_0x1a4367['transfereeuniqueid']][_0xbb43('0x35')]=utils[_0xbb43('0x24')]();transfers[_0x1a4367[_0xbb43('0x47')]][_0xbb43('0x26')]=0x0;transfers[_0x1a4367[_0xbb43('0x47')]][_0xbb43('0x48')]=0x2;}}else if(_0x1a4367[_0xbb43('0x43')]==_0x1a4367[_0xbb43('0x4c')]){if(!_['isNil'](agents[_0x1a4367['origtransfereruniqueid']])){utils[_0xbb43('0x2')](util[_0xbb43('0x14')](_0xbb43('0x4d'),_0x1a4367[_0xbb43('0x46')],agents[_0x1a4367[_0xbb43('0x46')]][_0xbb43('0x22')]));agents[_0x1a4367[_0xbb43('0x46')]][_0xbb43('0x3b')]=!![];agents[_0x1a4367[_0xbb43('0x46')]]['transfertype']=_0xbb43('0x44');agents[_0x1a4367[_0xbb43('0x46')]][_0xbb43('0x3e')]=_0x1a4367[_0xbb43('0x4e')];agents[_0x1a4367[_0xbb43('0x46')]][_0xbb43('0x45')]=_0x1a4367['secondtransfereruniqueid'];}if(_0x1a4367[_0xbb43('0x4f')]&&agents[_0x1a4367[_0xbb43('0x4f')]]){agents[_0x1a4367[_0xbb43('0x4f')]][_0xbb43('0x48')]=0x1;transfers[_0x1a4367[_0xbb43('0x4f')]]=_['clone'](agents[_0x1a4367[_0xbb43('0x4f')]]);transfers[_0x1a4367[_0xbb43('0x4f')]][_0xbb43('0x7')]=agents[_0x1a4367[_0xbb43('0x46')]][_0xbb43('0x7')];transfers[_0x1a4367[_0xbb43('0x4f')]][_0xbb43('0x4a')]=agents[_0x1a4367[_0xbb43('0x46')]][_0xbb43('0x4a')];transfers[_0x1a4367[_0xbb43('0x4f')]]['agentcalledAt']=utils[_0xbb43('0x24')]();transfers[_0x1a4367['transfertargetuniqueid']][_0xbb43('0x35')]=utils[_0xbb43('0x24')]();transfers[_0x1a4367[_0xbb43('0x4f')]][_0xbb43('0x26')]=0x0;transfers[_0x1a4367[_0xbb43('0x4f')]]['agententerreason']=0x2;}}}catch(_0x59a665){utils[_0xbb43('0x20')](util[_0xbb43('0x14')]('[%s][agents][attendedtransfer]',_0x1a4367[_0xbb43('0x46')]),_0x59a665);}};exports[_0xbb43('0x50')]=function(_0x41d26a){try{utils[_0xbb43('0x29')](util[_0xbb43('0x14')](_0xbb43('0x51'),_0x41d26a[_0xbb43('0x4')]),_0x41d26a);if(agents[_0x41d26a[_0xbb43('0x4')]]&&agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x1b')]===_0xbb43('0x1c')){if(_0x41d26a[_0xbb43('0x52')]==='21'){agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x1b')]='rejected';agents[_0x41d26a['uniqueid']][_0xbb43('0x8')]=_0xbb43('0x53');}utils[_0xbb43('0x2')](util['format'](_0xbb43('0x54'),_0x41d26a[_0xbb43('0x4')],agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x22')],agents[_0x41d26a[_0xbb43('0x4')]]['reason'],agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x8')]));writeDB(agents[_0x41d26a[_0xbb43('0x4')]]);var _0x4c1405=unanswered[_0xbb43('0x55')](_0x41d26a[_0xbb43('0x4')]);if(_0x4c1405>-0x1){unanswered[_0xbb43('0x56')](_0x4c1405,0x1);}}if(transfers[_0x41d26a[_0xbb43('0x4')]]){transfers[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0xc')]=!![];transfers[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x34')]=utils[_0xbb43('0x24')]();transfers[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x1e')]=utils['diffTime'](transfers[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x34')],transfers[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x35')]);transfers[_0x41d26a[_0xbb43('0x4')]]['reason']='agent';transfers[_0x41d26a['uniqueid']][_0xbb43('0x8')]=_0xbb43('0x36');utils[_0xbb43('0x2')](util[_0xbb43('0x14')](_0xbb43('0x54'),_0x41d26a[_0xbb43('0x4')],transfers[_0x41d26a[_0xbb43('0x4')]]['membername'],transfers[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x1b')],transfers[_0x41d26a[_0xbb43('0x4')]]['lastevent']));writeDB(transfers[_0x41d26a[_0xbb43('0x4')]],!![]);}if(agents[_0x41d26a['uniqueid']]&&agents[_0x41d26a[_0xbb43('0x4')]]['agentconnectAt']){agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0xc')]=!![];agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x34')]=utils[_0xbb43('0x24')]();agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x1e')]=utils[_0xbb43('0x57')](agents[_0x41d26a['uniqueid']][_0xbb43('0x34')],agents[_0x41d26a[_0xbb43('0x4')]]['agentconnectAt']);agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x1b')]=agents[_0x41d26a[_0xbb43('0x4')]]['transfer']?_0xbb43('0x3b'):_0xbb43('0x58');agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x8')]=_0xbb43('0x36');utils[_0xbb43('0x2')](util['format'](_0xbb43('0x54'),_0x41d26a['uniqueid'],agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x22')],agents[_0x41d26a['uniqueid']][_0xbb43('0x1b')],agents[_0x41d26a[_0xbb43('0x4')]]['lastevent']));writeDB(agents[_0x41d26a['uniqueid']]);}}catch(_0x337154){utils[_0xbb43('0x20')](util[_0xbb43('0x14')](_0xbb43('0x51'),_0x41d26a[_0xbb43('0x4')]),_0x337154);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 4ff9340..670e63c 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 _0x37c4=['lastdata','lodash','util','./utils','NO\x20ANSWER','ANSWERED','FAILED','info','format','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','[%s][calls][newchannel]','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','debug','[%s][calls][newstate]','isNil','systemanswertime','channelstate','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','destinationchannel','answertime','toNumber','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','transfertargetchannel','origtransfererchannel','userfield','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','now','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','mohtime','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','xmd-contactid','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','lastIndexOf','includes','hangup','noop','execif','gotoif'];(function(_0x2731f0,_0x126b1b){var _0x36a180=function(_0x44d1a9){while(--_0x44d1a9){_0x2731f0['push'](_0x2731f0['shift']());}};_0x36a180(++_0x126b1b);}(_0x37c4,0x1a5));var _0x437c=function(_0x4258f1,_0x17257f){_0x4258f1=_0x4258f1-0x0;var _0x1d9863=_0x37c4[_0x4258f1];return _0x1d9863;};'use strict';var _=require(_0x437c('0x0'));var util=require(_0x437c('0x1'));var utils=require(_0x437c('0x2'));var dispositions=['NO\x20ANSWER','FAILED','FAILED',_0x437c('0x3'),_0x437c('0x3'),_0x437c('0x3'),_0x437c('0x4'),'BUSY',_0x437c('0x5'),_0x437c('0x5'),_0x437c('0x5')];var channels={};function writeDB(_0x5330eb){utils[_0x437c('0x6')](util[_0x437c('0x7')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x5330eb[_0x437c('0x8')],_0x5330eb[_0x437c('0x9')],_0x5330eb[_0x437c('0xa')],_0x5330eb[_0x437c('0xb')],_0x5330eb[_0x437c('0xc')],_0x5330eb[_0x437c('0xd')],_0x5330eb[_0x437c('0xe')],_0x5330eb[_0x437c('0xf')]));if(_0x5330eb[_0x437c('0x10')]){utils[_0x437c('0x11')](_0x5330eb[_0x437c('0x10')])[_0x437c('0x12')](function(_0xe1188f){if(_0xe1188f){_0x5330eb[_0x437c('0x13')]=_0xe1188f['id'];}utils[_0x437c('0x14')](_0x437c('0x15'),_0x5330eb);});}else{utils[_0x437c('0x14')](_0x437c('0x15'),_0x5330eb);}if(channels[_0x5330eb['uniqueid']]){delete channels[_0x5330eb['uniqueid']];}}exports[_0x437c('0x16')]=function(_0x2bb0fd){try{utils['debug'](util[_0x437c('0x7')](_0x437c('0x17'),_0x2bb0fd[_0x437c('0x8')]),_0x2bb0fd);if(_0x2bb0fd[_0x437c('0x8')]==_0x2bb0fd['linkedid']&&_0x2bb0fd['channel']!=_0x437c('0x18')){utils[_0x437c('0x6')](util[_0x437c('0x7')](_0x437c('0x19'),_0x2bb0fd[_0x437c('0x8')],_0x2bb0fd[_0x437c('0x1a')],_0x2bb0fd[_0x437c('0x1b')]));channels[_0x2bb0fd[_0x437c('0x8')]]={'uniqueid':_0x2bb0fd[_0x437c('0x8')],'accountcode':_0x2bb0fd['accountcode'],'source':_0x2bb0fd['calleridnum'],'destination':_0x2bb0fd[_0x437c('0x1b')],'destinationcontext':_0x2bb0fd[_0x437c('0x1a')],'channel':_0x2bb0fd[_0x437c('0x9')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x437c('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x3f089f){utils[_0x437c('0x1c')](util[_0x437c('0x7')](_0x437c('0x17'),_0x2bb0fd[_0x437c('0x8')]),_0x3f089f);}};exports[_0x437c('0x1d')]=function(_0x24106a){try{utils[_0x437c('0x1e')](util[_0x437c('0x7')](_0x437c('0x1f'),_0x24106a['uniqueid']),_0x24106a);if(!_['isNil'](channels[_0x24106a[_0x437c('0x8')]])&&_0x24106a['channelstate']==0x6){utils['info'](util[_0x437c('0x7')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x24106a[_0x437c('0x8')],_0x24106a[_0x437c('0x1a')],_0x24106a[_0x437c('0x9')]));if(_[_0x437c('0x20')](channels[_0x24106a[_0x437c('0x8')]][_0x437c('0x21')])){channels[_0x24106a[_0x437c('0x8')]][_0x437c('0x21')]=utils['now']();}}else if(!_[_0x437c('0x20')](channels[_0x24106a['linkedid']])&&_0x24106a[_0x437c('0x22')]==0x6&&_0x24106a['context']!='transfer'){utils[_0x437c('0x6')](util[_0x437c('0x7')](_0x437c('0x23'),_0x24106a[_0x437c('0x8')],_0x24106a['linkedid'],_0x24106a['context'],_0x24106a['channel']));channels[_0x24106a[_0x437c('0x24')]][_0x437c('0x10')]=_0x24106a[_0x437c('0x10')];channels[_0x24106a[_0x437c('0x24')]][_0x437c('0x25')]=_0x24106a['channel'];if(_[_0x437c('0x20')](channels[_0x24106a[_0x437c('0x24')]][_0x437c('0x26')])){channels[_0x24106a['linkedid']][_0x437c('0x26')]=utils['now']();}channels[_0x24106a[_0x437c('0x24')]]['disposition']=dispositions[_[_0x437c('0x27')](_0x24106a[_0x437c('0x22')])]||'ANSWERED';}}catch(_0x3e4608){utils['error'](util[_0x437c('0x7')](_0x437c('0x1f'),_0x24106a[_0x437c('0x8')]),_0x3e4608);}};exports['hangup']=function(_0x337c43){try{if(!_[_0x437c('0x20')](channels[_0x337c43[_0x437c('0x8')]])){utils[_0x437c('0x1e')](util[_0x437c('0x7')](_0x437c('0x28'),_0x337c43[_0x437c('0x8')]),_0x337c43);if(_[_0x437c('0x20')](channels[_0x337c43[_0x437c('0x8')]]['callerid'])){channels[_0x337c43['uniqueid']][_0x437c('0x29')]=_0x337c43[_0x437c('0x2a')]+'\x20<'+_0x337c43['calleridnum']+'>';}utils['info'](util['format'](_0x437c('0x2b'),_0x337c43['uniqueid'],channels[_0x337c43[_0x437c('0x8')]]['callerid'],_0x337c43[_0x437c('0x2c')]));channels[_0x337c43[_0x437c('0x8')]][_0x437c('0x2d')]=utils['now']();channels[_0x337c43[_0x437c('0x8')]][_0x437c('0x2e')]=utils[_0x437c('0x2f')](channels[_0x337c43[_0x437c('0x8')]]['endtime'],channels[_0x337c43[_0x437c('0x8')]][_0x437c('0x30')]);channels[_0x337c43[_0x437c('0x8')]][_0x437c('0x31')]=channels[_0x337c43[_0x437c('0x8')]]['answertime']?utils[_0x437c('0x2f')](channels[_0x337c43[_0x437c('0x8')]][_0x437c('0x2d')],channels[_0x337c43[_0x437c('0x8')]]['answertime']):0x0;writeDB(channels[_0x337c43[_0x437c('0x8')]]);}}catch(_0x4df73d){utils[_0x437c('0x1c')](util[_0x437c('0x7')](_0x437c('0x28'),_0x337c43[_0x437c('0x8')]),_0x4df73d);}};exports['attendedtransfer']=function(_0x336e3c){try{if(!_[_0x437c('0x20')](channels[_0x336e3c[_0x437c('0x32')]])){utils[_0x437c('0x1e')](util[_0x437c('0x7')]('[%s][calls][attendedtransfer]',_0x336e3c[_0x437c('0x33')]),_0x336e3c);if(channels[_0x336e3c['localtwolinkedid']][_0x437c('0x9')]==_0x336e3c[_0x437c('0x34')]){utils[_0x437c('0x6')](util[_0x437c('0x7')](_0x437c('0x35'),_0x336e3c[_0x437c('0x33')],_0x336e3c[_0x437c('0x32')],_0x336e3c[_0x437c('0x36')]));channels[_0x336e3c[_0x437c('0x32')]][_0x437c('0x25')]=_0x336e3c['secondtransfererchannel'];channels[_0x336e3c[_0x437c('0x32')]]['userfield']='_attended';}else if(channels[_0x336e3c[_0x437c('0x32')]][_0x437c('0x9')]=_0x336e3c[_0x437c('0x37')]){utils[_0x437c('0x6')](util[_0x437c('0x7')](_0x437c('0x35'),_0x336e3c[_0x437c('0x33')],_0x336e3c[_0x437c('0x32')],_0x336e3c[_0x437c('0x38')]));channels[_0x336e3c[_0x437c('0x32')]]['destinationchannel']=_0x336e3c['origtransfererchannel'];channels[_0x336e3c['localtwolinkedid']][_0x437c('0x39')]='_attended';}}}catch(_0x512b15){utils[_0x437c('0x1c')](util[_0x437c('0x7')](_0x437c('0x3a'),_0x336e3c['origtransfereruniqueid']),_0x512b15);}};exports[_0x437c('0x3b')]=function(_0x40073c){try{if(!_['isNil'](channels[_0x40073c['uniqueid']])){utils[_0x437c('0x1e')](util[_0x437c('0x7')](_0x437c('0x3c'),_0x40073c['uniqueid']),_0x40073c);channels[_0x40073c[_0x437c('0x8')]][_0x437c('0x3d')]=utils[_0x437c('0x3e')]();utils[_0x437c('0x6')](util[_0x437c('0x7')](_0x437c('0x3f'),_0x40073c[_0x437c('0x8')],channels[_0x40073c[_0x437c('0x8')]][_0x437c('0x3d')]));}}catch(_0x3c3250){utils['error'](util[_0x437c('0x7')](_0x437c('0x3c'),_0x40073c[_0x437c('0x8')]),_0x3c3250);}};exports['musiconholdstop']=function(_0x505501){try{if(!_['isNil'](channels[_0x505501[_0x437c('0x8')]])){utils[_0x437c('0x1e')](util[_0x437c('0x7')]('[%s][calls][musiconholdstop]',_0x505501[_0x437c('0x8')]),_0x505501);if(!_[_0x437c('0x20')](channels[_0x505501['uniqueid']]['musiconholdstartAt'])){channels[_0x505501[_0x437c('0x8')]][_0x437c('0x40')]+=utils[_0x437c('0x2f')](utils[_0x437c('0x3e')](),channels[_0x505501[_0x437c('0x8')]]['musiconholdstartAt']);utils[_0x437c('0x6')](util[_0x437c('0x7')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x505501[_0x437c('0x8')],channels[_0x505501['uniqueid']][_0x437c('0x40')]));delete channels[_0x505501[_0x437c('0x8')]][_0x437c('0x3d')];}}}catch(_0x1e8e66){utils[_0x437c('0x1c')](util[_0x437c('0x7')](_0x437c('0x41'),_0x505501['uniqueid']),_0x1e8e66);}};exports[_0x437c('0x42')]=function(_0xd4d5e3){try{if(!_[_0x437c('0x20')](channels[_0xd4d5e3[_0x437c('0x8')]])){utils[_0x437c('0x1e')](util[_0x437c('0x7')](_0x437c('0x43'),_0xd4d5e3[_0x437c('0x8')]),_0xd4d5e3);if(!_[_0x437c('0x20')](_0xd4d5e3[_0x437c('0x44')][_0x437c('0x45')])){utils[_0x437c('0x6')](util[_0x437c('0x7')](_0x437c('0x46'),_0xd4d5e3['uniqueid'],_0xd4d5e3[_0x437c('0x47')]));channels[_0xd4d5e3[_0x437c('0x8')]][_0x437c('0x48')]=_0xd4d5e3[_0x437c('0x47')];}if(!_[_0x437c('0x20')](_0xd4d5e3[_0x437c('0x44')]['xmd-phone'])){utils[_0x437c('0x6')](util[_0x437c('0x7')](_0x437c('0x49'),_0xd4d5e3['uniqueid'],_0xd4d5e3[_0x437c('0x47')]));channels[_0xd4d5e3[_0x437c('0x8')]][_0x437c('0x4a')]=_0xd4d5e3[_0x437c('0x47')];channels[_0xd4d5e3['uniqueid']]['callerid']='\x22'+_0xd4d5e3[_0x437c('0x47')]+_0x437c('0x4b')+_0xd4d5e3['value']+'>';}if(!_[_0x437c('0x20')](_0xd4d5e3[_0x437c('0x44')][_0x437c('0x4c')])||!_['isNil'](_0xd4d5e3[_0x437c('0x44')][_0x437c('0x4d')])){utils[_0x437c('0x6')](util[_0x437c('0x7')](_0x437c('0x4e'),_0xd4d5e3['uniqueid'],!_[_0x437c('0x20')](_0xd4d5e3['variable'][_0x437c('0x4c')])?_0x437c('0x4c'):_0x437c('0x4d'),_0xd4d5e3[_0x437c('0x47')]));channels[_0xd4d5e3[_0x437c('0x8')]][_0x437c('0x29')]=_0xd4d5e3[_0x437c('0x47')];}if(!_[_0x437c('0x20')](_0xd4d5e3['variable']['xmd-queue'])||!_[_0x437c('0x20')](_0xd4d5e3[_0x437c('0x44')][_0x437c('0x4f')])){utils['info'](util[_0x437c('0x7')](_0x437c('0x4e'),_0xd4d5e3[_0x437c('0x8')],!_[_0x437c('0x20')](_0xd4d5e3[_0x437c('0x44')][_0x437c('0x50')])?_0x437c('0x50'):_0x437c('0x4f'),_0xd4d5e3['value']));channels[_0xd4d5e3[_0x437c('0x8')]][_0x437c('0x51')]='Queue';channels[_0xd4d5e3[_0x437c('0x8')]]['lastdata']=_0xd4d5e3[_0x437c('0x47')];channels[_0xd4d5e3[_0x437c('0x8')]][_0x437c('0xa')]=!![];}if(!_[_0x437c('0x20')](_0xd4d5e3[_0x437c('0x44')][_0x437c('0x52')])){utils[_0x437c('0x6')](util[_0x437c('0x7')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0xd4d5e3[_0x437c('0x8')],_0xd4d5e3['value']));channels[_0xd4d5e3[_0x437c('0x8')]][_0x437c('0x53')]=_0xd4d5e3['value'];}if(!_[_0x437c('0x20')](_0xd4d5e3[_0x437c('0x44')]['xmd-cdrtype'])){utils[_0x437c('0x6')](util['format'](_0x437c('0x54'),_0xd4d5e3['uniqueid'],_0xd4d5e3['value']));channels[_0xd4d5e3[_0x437c('0x8')]][_0x437c('0x55')]=_0xd4d5e3[_0x437c('0x47')];}if(!_[_0x437c('0x20')](_0xd4d5e3[_0x437c('0x44')][_0x437c('0x56')])){utils[_0x437c('0x6')](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0xd4d5e3[_0x437c('0x8')],_0xd4d5e3[_0x437c('0x47')]));channels[_0xd4d5e3[_0x437c('0x8')]][_0x437c('0x57')]=_0xd4d5e3[_0x437c('0x47')];}if(!_['isNil'](_0xd4d5e3['variable']['sipcallid'])){utils[_0x437c('0x6')](util[_0x437c('0x7')](_0x437c('0x58'),_0xd4d5e3[_0x437c('0x8')],_0xd4d5e3[_0x437c('0x47')]));channels[_0xd4d5e3[_0x437c('0x8')]][_0x437c('0x59')]=_0xd4d5e3[_0x437c('0x47')];}}}catch(_0x432685){utils[_0x437c('0x1c')](util[_0x437c('0x7')](_0x437c('0x43'),_0xd4d5e3[_0x437c('0x8')]),_0x432685);}};exports[_0x437c('0x5a')]=function(_0x42ce73){try{if(!_[_0x437c('0x20')](channels[_0x42ce73[_0x437c('0x8')]])){utils['debug'](util[_0x437c('0x7')](_0x437c('0x5b'),_0x42ce73[_0x437c('0x8')]),_0x42ce73);utils[_0x437c('0x6')](util[_0x437c('0x7')](_0x437c('0x5c'),_0x42ce73[_0x437c('0x8')],_0x42ce73[_0x437c('0x5d')],_0x42ce73[_0x437c('0x5e')]));if(_0x42ce73[_0x437c('0x5d')]['toLowerCase']()==_0x437c('0x5f')&&_[_0x437c('0x60')](_0x42ce73[_0x437c('0x5e')][_0x437c('0x61')](),'cdr')){var _0x4f0d91=_0x42ce73[_0x437c('0x5e')]['split']('=');var _0xc9e44b=_0x4f0d91[0x0]['substring'](_0x4f0d91[0x0]['lastIndexOf']('(')+0x1,_0x4f0d91[0x0][_0x437c('0x62')](')'));var _0x2c990f=_0x4f0d91[0x1];channels[_0x42ce73[_0x437c('0x8')]][_0xc9e44b]=_0x2c990f;}if(!_[_0x437c('0x63')]([_0x437c('0x64'),_0x437c('0x65'),_0x437c('0x66'),'set',_0x437c('0x67')],_0x42ce73[_0x437c('0x5d')][_0x437c('0x61')]())){channels[_0x42ce73[_0x437c('0x8')]]['lastapplication']=_0x42ce73[_0x437c('0x5d')];channels[_0x42ce73[_0x437c('0x8')]][_0x437c('0x68')]=_0x42ce73[_0x437c('0x5e')];}}}catch(_0x4af0de){utils[_0x437c('0x1c')](util['format'](_0x437c('0x5b'),_0x42ce73[_0x437c('0x8')]),_0x4af0de);}}; \ No newline at end of file +var _0xac6d=['xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','lastIndexOf','noop','execif','NO\x20ANSWER','ANSWERED','FAILED','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','accountcode','UserId','CreateVoiceCallReport','newchannel','debug','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','[%s][calls][newchannel]','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','_attended','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s'];(function(_0x200276,_0x3a39b5){var _0x496325=function(_0x36551d){while(--_0x36551d){_0x200276['push'](_0x200276['shift']());}};_0x496325(++_0x3a39b5);}(_0xac6d,0xce));var _0xdac6=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xac6d[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var dispositions=[_0xdac6('0x0'),'FAILED','FAILED',_0xdac6('0x0'),_0xdac6('0x0'),_0xdac6('0x0'),_0xdac6('0x1'),'BUSY',_0xdac6('0x2'),_0xdac6('0x2'),'FAILED'];var channels={};function writeDB(_0x59dd8a){utils[_0xdac6('0x3')](util[_0xdac6('0x4')](_0xdac6('0x5'),_0x59dd8a[_0xdac6('0x6')],_0x59dd8a['channel'],_0x59dd8a[_0xdac6('0x7')],_0x59dd8a[_0xdac6('0x8')],_0x59dd8a[_0xdac6('0x9')],_0x59dd8a[_0xdac6('0xa')],_0x59dd8a[_0xdac6('0xb')],_0x59dd8a['lastevent']));if(_0x59dd8a[_0xdac6('0xc')]){utils['getUserByInternal'](_0x59dd8a[_0xdac6('0xc')])['then'](function(_0x1e42b8){if(_0x1e42b8){_0x59dd8a[_0xdac6('0xd')]=_0x1e42b8['id'];}utils['request'](_0xdac6('0xe'),_0x59dd8a);});}else{utils['request'](_0xdac6('0xe'),_0x59dd8a);}if(channels[_0x59dd8a[_0xdac6('0x6')]]){delete channels[_0x59dd8a[_0xdac6('0x6')]];}}exports[_0xdac6('0xf')]=function(_0x4ce42b){try{utils[_0xdac6('0x10')](util[_0xdac6('0x4')]('[%s][calls][newchannel]',_0x4ce42b[_0xdac6('0x6')]),_0x4ce42b);if(_0x4ce42b[_0xdac6('0x6')]==_0x4ce42b[_0xdac6('0x11')]&&_0x4ce42b[_0xdac6('0x12')]!=_0xdac6('0x13')){utils[_0xdac6('0x3')](util['format'](_0xdac6('0x14'),_0x4ce42b[_0xdac6('0x6')],_0x4ce42b[_0xdac6('0x15')],_0x4ce42b[_0xdac6('0x16')]));channels[_0x4ce42b[_0xdac6('0x6')]]={'uniqueid':_0x4ce42b[_0xdac6('0x6')],'accountcode':_0x4ce42b['accountcode'],'source':_0x4ce42b['calleridnum'],'destination':_0x4ce42b[_0xdac6('0x16')],'destinationcontext':_0x4ce42b[_0xdac6('0x15')],'channel':_0x4ce42b['channel'],'starttime':utils[_0xdac6('0x17')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xdac6('0x0'),'amaflags':_0xdac6('0x18')};}}catch(_0x2e87e2){utils[_0xdac6('0x19')](util[_0xdac6('0x4')](_0xdac6('0x1a'),_0x4ce42b[_0xdac6('0x6')]),_0x2e87e2);}};exports['newstate']=function(_0x4cd09a){try{utils['debug'](util[_0xdac6('0x4')](_0xdac6('0x1b'),_0x4cd09a[_0xdac6('0x6')]),_0x4cd09a);if(!_['isNil'](channels[_0x4cd09a[_0xdac6('0x6')]])&&_0x4cd09a[_0xdac6('0x1c')]==0x6){utils[_0xdac6('0x3')](util[_0xdac6('0x4')](_0xdac6('0x1d'),_0x4cd09a['uniqueid'],_0x4cd09a[_0xdac6('0x15')],_0x4cd09a['channel']));if(_[_0xdac6('0x1e')](channels[_0x4cd09a[_0xdac6('0x6')]]['systemanswertime'])){channels[_0x4cd09a['uniqueid']][_0xdac6('0x1f')]=utils['now']();}}else if(!_['isNil'](channels[_0x4cd09a[_0xdac6('0x11')]])&&_0x4cd09a[_0xdac6('0x1c')]==0x6&&_0x4cd09a[_0xdac6('0x15')]!='transfer'){utils[_0xdac6('0x3')](util[_0xdac6('0x4')](_0xdac6('0x20'),_0x4cd09a[_0xdac6('0x6')],_0x4cd09a['linkedid'],_0x4cd09a['context'],_0x4cd09a[_0xdac6('0x12')]));channels[_0x4cd09a[_0xdac6('0x11')]][_0xdac6('0xc')]=_0x4cd09a[_0xdac6('0xc')];channels[_0x4cd09a[_0xdac6('0x11')]][_0xdac6('0x21')]=_0x4cd09a[_0xdac6('0x12')];if(_[_0xdac6('0x1e')](channels[_0x4cd09a[_0xdac6('0x11')]][_0xdac6('0x22')])){channels[_0x4cd09a[_0xdac6('0x11')]][_0xdac6('0x22')]=utils[_0xdac6('0x17')]();}channels[_0x4cd09a[_0xdac6('0x11')]]['disposition']=dispositions[_[_0xdac6('0x23')](_0x4cd09a[_0xdac6('0x1c')])]||'ANSWERED';}}catch(_0x5b1623){utils[_0xdac6('0x19')](util[_0xdac6('0x4')](_0xdac6('0x1b'),_0x4cd09a['uniqueid']),_0x5b1623);}};exports[_0xdac6('0x24')]=function(_0x22f6c6){try{if(!_['isNil'](channels[_0x22f6c6[_0xdac6('0x6')]])){utils[_0xdac6('0x10')](util[_0xdac6('0x4')]('[%s][calls][hangup]',_0x22f6c6[_0xdac6('0x6')]),_0x22f6c6);if(_[_0xdac6('0x1e')](channels[_0x22f6c6['uniqueid']][_0xdac6('0x25')])){channels[_0x22f6c6['uniqueid']][_0xdac6('0x25')]=_0x22f6c6[_0xdac6('0x26')]+'\x20<'+_0x22f6c6['calleridnum']+'>';}utils[_0xdac6('0x3')](util[_0xdac6('0x4')](_0xdac6('0x27'),_0x22f6c6[_0xdac6('0x6')],channels[_0x22f6c6[_0xdac6('0x6')]]['callerid'],_0x22f6c6[_0xdac6('0x28')]));channels[_0x22f6c6[_0xdac6('0x6')]][_0xdac6('0x29')]=utils['now']();channels[_0x22f6c6['uniqueid']][_0xdac6('0x2a')]=utils[_0xdac6('0x2b')](channels[_0x22f6c6[_0xdac6('0x6')]][_0xdac6('0x29')],channels[_0x22f6c6[_0xdac6('0x6')]][_0xdac6('0x2c')]);channels[_0x22f6c6[_0xdac6('0x6')]]['billableseconds']=channels[_0x22f6c6['uniqueid']]['answertime']?utils[_0xdac6('0x2b')](channels[_0x22f6c6[_0xdac6('0x6')]]['endtime'],channels[_0x22f6c6[_0xdac6('0x6')]][_0xdac6('0x22')]):0x0;writeDB(channels[_0x22f6c6['uniqueid']]);}}catch(_0x10e659){utils[_0xdac6('0x19')](util[_0xdac6('0x4')]('[%s][calls][hangup]',_0x22f6c6[_0xdac6('0x6')]),_0x10e659);}};exports['attendedtransfer']=function(_0x456b0b){try{if(!_[_0xdac6('0x1e')](channels[_0x456b0b[_0xdac6('0x2d')]])){utils[_0xdac6('0x10')](util[_0xdac6('0x4')](_0xdac6('0x2e'),_0x456b0b[_0xdac6('0x2f')]),_0x456b0b);if(channels[_0x456b0b[_0xdac6('0x2d')]][_0xdac6('0x12')]==_0x456b0b[_0xdac6('0x30')]){utils[_0xdac6('0x3')](util[_0xdac6('0x4')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x456b0b['origtransfereruniqueid'],_0x456b0b[_0xdac6('0x2d')],_0x456b0b[_0xdac6('0x31')]));channels[_0x456b0b['localtwolinkedid']][_0xdac6('0x21')]=_0x456b0b['secondtransfererchannel'];channels[_0x456b0b[_0xdac6('0x2d')]][_0xdac6('0x32')]=_0xdac6('0x33');}else if(channels[_0x456b0b[_0xdac6('0x2d')]][_0xdac6('0x12')]=_0x456b0b['transfertargetchannel']){utils['info'](util[_0xdac6('0x4')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x456b0b[_0xdac6('0x2f')],_0x456b0b[_0xdac6('0x2d')],_0x456b0b[_0xdac6('0x34')]));channels[_0x456b0b['localtwolinkedid']]['destinationchannel']=_0x456b0b[_0xdac6('0x34')];channels[_0x456b0b[_0xdac6('0x2d')]][_0xdac6('0x32')]=_0xdac6('0x33');}}}catch(_0x53c6b1){utils[_0xdac6('0x19')](util[_0xdac6('0x4')](_0xdac6('0x2e'),_0x456b0b['origtransfereruniqueid']),_0x53c6b1);}};exports['musiconholdstart']=function(_0x590361){try{if(!_[_0xdac6('0x1e')](channels[_0x590361['uniqueid']])){utils[_0xdac6('0x10')](util[_0xdac6('0x4')](_0xdac6('0x35'),_0x590361[_0xdac6('0x6')]),_0x590361);channels[_0x590361[_0xdac6('0x6')]][_0xdac6('0x36')]=utils['now']();utils[_0xdac6('0x3')](util['format'](_0xdac6('0x37'),_0x590361[_0xdac6('0x6')],channels[_0x590361[_0xdac6('0x6')]][_0xdac6('0x36')]));}}catch(_0x1abbca){utils['error'](util[_0xdac6('0x4')](_0xdac6('0x35'),_0x590361[_0xdac6('0x6')]),_0x1abbca);}};exports[_0xdac6('0x38')]=function(_0x4cf471){try{if(!_[_0xdac6('0x1e')](channels[_0x4cf471['uniqueid']])){utils[_0xdac6('0x10')](util['format'](_0xdac6('0x39'),_0x4cf471[_0xdac6('0x6')]),_0x4cf471);if(!_[_0xdac6('0x1e')](channels[_0x4cf471[_0xdac6('0x6')]][_0xdac6('0x36')])){channels[_0x4cf471[_0xdac6('0x6')]]['mohtime']+=utils['diffTime'](utils[_0xdac6('0x17')](),channels[_0x4cf471[_0xdac6('0x6')]]['musiconholdstartAt']);utils[_0xdac6('0x3')](util[_0xdac6('0x4')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x4cf471[_0xdac6('0x6')],channels[_0x4cf471['uniqueid']]['mohtime']));delete channels[_0x4cf471['uniqueid']]['musiconholdstartAt'];}}}catch(_0x10e197){utils[_0xdac6('0x19')](util[_0xdac6('0x4')](_0xdac6('0x39'),_0x4cf471[_0xdac6('0x6')]),_0x10e197);}};exports[_0xdac6('0x3a')]=function(_0x4ca5fa){try{if(!_[_0xdac6('0x1e')](channels[_0x4ca5fa[_0xdac6('0x6')]])){utils['debug'](util[_0xdac6('0x4')](_0xdac6('0x3b'),_0x4ca5fa[_0xdac6('0x6')]),_0x4ca5fa);if(!_[_0xdac6('0x1e')](_0x4ca5fa[_0xdac6('0x3c')][_0xdac6('0x3d')])){utils['info'](util[_0xdac6('0x4')](_0xdac6('0x3e'),_0x4ca5fa[_0xdac6('0x6')],_0x4ca5fa[_0xdac6('0x3f')]));channels[_0x4ca5fa[_0xdac6('0x6')]][_0xdac6('0x40')]=_0x4ca5fa[_0xdac6('0x3f')];}if(!_[_0xdac6('0x1e')](_0x4ca5fa[_0xdac6('0x3c')]['xmd-phone'])){utils[_0xdac6('0x3')](util['format'](_0xdac6('0x41'),_0x4ca5fa['uniqueid'],_0x4ca5fa['value']));channels[_0x4ca5fa['uniqueid']]['destination']=_0x4ca5fa[_0xdac6('0x3f')];channels[_0x4ca5fa['uniqueid']][_0xdac6('0x25')]='\x22'+_0x4ca5fa[_0xdac6('0x3f')]+_0xdac6('0x42')+_0x4ca5fa['value']+'>';}if(!_['isNil'](_0x4ca5fa[_0xdac6('0x3c')][_0xdac6('0x43')])||!_['isNil'](_0x4ca5fa[_0xdac6('0x3c')][_0xdac6('0x44')])){utils[_0xdac6('0x3')](util['format'](_0xdac6('0x45'),_0x4ca5fa[_0xdac6('0x6')],!_[_0xdac6('0x1e')](_0x4ca5fa['variable'][_0xdac6('0x43')])?_0xdac6('0x43'):'xmd-callerid',_0x4ca5fa[_0xdac6('0x3f')]));channels[_0x4ca5fa[_0xdac6('0x6')]][_0xdac6('0x25')]=_0x4ca5fa[_0xdac6('0x3f')];}if(!_[_0xdac6('0x1e')](_0x4ca5fa[_0xdac6('0x3c')][_0xdac6('0x46')])||!_[_0xdac6('0x1e')](_0x4ca5fa[_0xdac6('0x3c')][_0xdac6('0x47')])){utils[_0xdac6('0x3')](util[_0xdac6('0x4')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4ca5fa[_0xdac6('0x6')],!_[_0xdac6('0x1e')](_0x4ca5fa[_0xdac6('0x3c')][_0xdac6('0x46')])?_0xdac6('0x46'):'xmcs-queue',_0x4ca5fa['value']));channels[_0x4ca5fa[_0xdac6('0x6')]][_0xdac6('0x48')]=_0xdac6('0x49');channels[_0x4ca5fa[_0xdac6('0x6')]][_0xdac6('0x4a')]=_0x4ca5fa['value'];channels[_0x4ca5fa[_0xdac6('0x6')]][_0xdac6('0x7')]=!![];}if(!_[_0xdac6('0x1e')](_0x4ca5fa[_0xdac6('0x3c')]['xmd-contactid'])){utils['info'](util[_0xdac6('0x4')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x4ca5fa[_0xdac6('0x6')],_0x4ca5fa['value']));channels[_0x4ca5fa[_0xdac6('0x6')]][_0xdac6('0x4b')]=_0x4ca5fa['value'];}if(!_[_0xdac6('0x1e')](_0x4ca5fa[_0xdac6('0x3c')]['xmd-cdrtype'])){utils['info'](util[_0xdac6('0x4')](_0xdac6('0x4c'),_0x4ca5fa[_0xdac6('0x6')],_0x4ca5fa[_0xdac6('0x3f')]));channels[_0x4ca5fa[_0xdac6('0x6')]]['type']=_0x4ca5fa[_0xdac6('0x3f')];}if(!_[_0xdac6('0x1e')](_0x4ca5fa[_0xdac6('0x3c')]['outboundrouteid'])){utils['info'](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x4ca5fa[_0xdac6('0x6')],_0x4ca5fa['value']));channels[_0x4ca5fa[_0xdac6('0x6')]][_0xdac6('0x4d')]=_0x4ca5fa[_0xdac6('0x3f')];}if(!_[_0xdac6('0x1e')](_0x4ca5fa[_0xdac6('0x3c')][_0xdac6('0x4e')])){utils[_0xdac6('0x3')](util['format'](_0xdac6('0x4f'),_0x4ca5fa[_0xdac6('0x6')],_0x4ca5fa[_0xdac6('0x3f')]));channels[_0x4ca5fa['uniqueid']]['sipcallid']=_0x4ca5fa[_0xdac6('0x3f')];}}}catch(_0x4d5cb4){utils[_0xdac6('0x19')](util[_0xdac6('0x4')]('[%s][calls][varset]',_0x4ca5fa[_0xdac6('0x6')]),_0x4d5cb4);}};exports[_0xdac6('0x50')]=function(_0xb7142){try{if(!_['isNil'](channels[_0xb7142[_0xdac6('0x6')]])){utils[_0xdac6('0x10')](util['format'](_0xdac6('0x51'),_0xb7142['uniqueid']),_0xb7142);utils[_0xdac6('0x3')](util[_0xdac6('0x4')](_0xdac6('0x52'),_0xb7142[_0xdac6('0x6')],_0xb7142[_0xdac6('0x53')],_0xb7142[_0xdac6('0x54')]));if(_0xb7142[_0xdac6('0x53')][_0xdac6('0x55')]()==_0xdac6('0x56')&&_[_0xdac6('0x57')](_0xb7142[_0xdac6('0x54')]['toLowerCase'](),_0xdac6('0x58'))){var _0x4ba2ef=_0xb7142[_0xdac6('0x54')]['split']('=');var _0x40b184=_0x4ba2ef[0x0]['substring'](_0x4ba2ef[0x0]['lastIndexOf']('(')+0x1,_0x4ba2ef[0x0][_0xdac6('0x59')](')'));var _0x6fac4a=_0x4ba2ef[0x1];channels[_0xb7142[_0xdac6('0x6')]][_0x40b184]=_0x6fac4a;}if(!_['includes']([_0xdac6('0x24'),_0xdac6('0x5a'),_0xdac6('0x5b'),'set','gotoif'],_0xb7142[_0xdac6('0x53')][_0xdac6('0x55')]())){channels[_0xb7142[_0xdac6('0x6')]]['lastapplication']=_0xb7142[_0xdac6('0x53')];channels[_0xb7142['uniqueid']][_0xdac6('0x4a')]=_0xb7142[_0xdac6('0x54')];}}}catch(_0x594f56){utils[_0xdac6('0x19')](util[_0xdac6('0x4')](_0xdac6('0x51'),_0xb7142[_0xdac6('0x6')]),_0x594f56);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 2ea98c5..28037f9 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 _0xfc91=['[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','info','[core]\x20fullybooted','[core]\x20error','managerevent','./utils','connect'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xfc91,0x1b6));var _0x1fc9=function(_0x497c96,_0x14c29f){_0x497c96=_0x497c96-0x0;var _0x3d236b=_0xfc91[_0x497c96];return _0x3d236b;};'use strict';var utils=require(_0x1fc9('0x0'));exports[_0x1fc9('0x1')]=function(){utils['info'](_0x1fc9('0x2'));};exports[_0x1fc9('0x3')]=function(){utils['info'](_0x1fc9('0x4'));};exports[_0x1fc9('0x5')]=function(){utils[_0x1fc9('0x6')](_0x1fc9('0x7'));};exports['error']=function(_0x37b366){utils['error'](_0x1fc9('0x8'),_0x37b366);};exports['close']=function(){utils['info']('[core]\x20close');};exports[_0x1fc9('0x9')]=function(_0xf8ae03){}; \ No newline at end of file +var _0x72a4=['close','[core]\x20close','managerevent','connect','info','[core]\x20connected','[core]\x20shutdown','fullybooted','error'];(function(_0x4cd071,_0x5c95e9){var _0x4a7f7c=function(_0x4a2c71){while(--_0x4a2c71){_0x4cd071['push'](_0x4cd071['shift']());}};_0x4a7f7c(++_0x5c95e9);}(_0x72a4,0x1c5));var _0x472a=function(_0x188926,_0x1b2429){_0x188926=_0x188926-0x0;var _0x17f4bf=_0x72a4[_0x188926];return _0x17f4bf;};'use strict';var utils=require('./utils');exports[_0x472a('0x0')]=function(){utils[_0x472a('0x1')](_0x472a('0x2'));};exports['shutdown']=function(){utils[_0x472a('0x1')](_0x472a('0x3'));};exports[_0x472a('0x4')]=function(){utils[_0x472a('0x1')]('[core]\x20fullybooted');};exports[_0x472a('0x5')]=function(_0x376148){utils[_0x472a('0x5')]('[core]\x20error',_0x376148);};exports[_0x472a('0x6')]=function(){utils[_0x472a('0x1')](_0x472a('0x7'));};exports[_0x472a('0x8')]=function(_0x488788){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index aad5e90..bdf7701 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 _0xf6a6=['[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','[%s][dials][hangup]','lodash','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','dialstatus','newexten','debug','[%s][dials][newexten]','application','toLowerCase','startsWith','appdata','cdr(routeid)','split','error','varset','isNil','outboundrouteid','value','dialbegin','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup'];(function(_0x440253,_0x4abf6e){var _0x1d19a6=function(_0x545a55){while(--_0x545a55){_0x440253['push'](_0x440253['shift']());}};_0x1d19a6(++_0x4abf6e);}(_0xf6a6,0x99));var _0x6f6a=function(_0x59b2b4,_0x40b89b){_0x59b2b4=_0x59b2b4-0x0;var _0x2bdef8=_0xf6a6[_0x59b2b4];return _0x2bdef8;};'use strict';var _=require(_0x6f6a('0x0'));var util=require(_0x6f6a('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x5883da){utils[_0x6f6a('0x2')](util[_0x6f6a('0x3')](_0x6f6a('0x4'),_0x5883da[_0x6f6a('0x5')],_0x5883da[_0x6f6a('0x6')],_0x5883da[_0x6f6a('0x7')],_0x5883da[_0x6f6a('0x8')],_0x5883da['connectedlinenum'],_0x5883da[_0x6f6a('0x9')]));utils['request']('CreateVoiceDialReport',_0x5883da);delete dials[_0x5883da['uniqueid']];}exports[_0x6f6a('0xa')]=function(_0x2681f4){try{utils[_0x6f6a('0xb')](util[_0x6f6a('0x3')](_0x6f6a('0xc'),_0x2681f4[_0x6f6a('0x5')]),_0x2681f4);utils[_0x6f6a('0x2')](util[_0x6f6a('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x2681f4[_0x6f6a('0x5')],_0x2681f4[_0x6f6a('0xd')],_0x2681f4['appdata']));if(_0x2681f4[_0x6f6a('0xd')][_0x6f6a('0xe')]()=='set'&&_[_0x6f6a('0xf')](_0x2681f4[_0x6f6a('0x10')]['toLowerCase'](),_0x6f6a('0x11'))){var _0x325404=_0x2681f4[_0x6f6a('0x10')][_0x6f6a('0x12')]('=');dials[_0x2681f4[_0x6f6a('0x5')]]={'routeId':_0x325404[0x1]};}}catch(_0x25b481){utils[_0x6f6a('0x13')](util[_0x6f6a('0x3')](_0x6f6a('0xc'),_0x2681f4[_0x6f6a('0x5')]),_0x25b481);}};exports[_0x6f6a('0x14')]=function(_0x1915a3){try{utils['debug'](util[_0x6f6a('0x3')]('[%s][dials][varset]',_0x1915a3[_0x6f6a('0x5')]),_0x1915a3);if(!_[_0x6f6a('0x15')](_0x1915a3['variable'][_0x6f6a('0x16')])){utils[_0x6f6a('0x2')](util[_0x6f6a('0x3')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x1915a3['uniqueid'],_0x1915a3[_0x6f6a('0x17')]));dials[_0x1915a3['uniqueid']]={'routeId':_0x1915a3['value']};}}catch(_0x1de13d){utils[_0x6f6a('0x13')](util[_0x6f6a('0x3')]('[%s][dials][varset]',_0x1915a3['uniqueid']),_0x1de13d);}};exports[_0x6f6a('0x18')]=function(_0x54fec3){try{if(!_['isNil'](dials[_0x54fec3[_0x6f6a('0x5')]])){utils[_0x6f6a('0xb')](util['format']('[%s][dials][dialbegin]',_0x54fec3[_0x6f6a('0x5')]),_0x54fec3);dials[_0x54fec3[_0x6f6a('0x5')]]=_[_0x6f6a('0x19')](dials[_0x54fec3[_0x6f6a('0x5')]],_0x54fec3);dials[_0x54fec3['uniqueid']]['starttime']=utils[_0x6f6a('0x1a')]();dials[_0x54fec3[_0x6f6a('0x5')]][_0x6f6a('0x1b')]=_0x6f6a('0x1c');utils[_0x6f6a('0x2')](util[_0x6f6a('0x3')](_0x6f6a('0x1d'),_0x54fec3['uniqueid'],dials[_0x54fec3[_0x6f6a('0x5')]][_0x6f6a('0x1e')]));}}catch(_0x274bdb){utils['error'](util['format']('[%s][dials][dialbegin]',_0x54fec3[_0x6f6a('0x5')]),_0x274bdb);}};exports[_0x6f6a('0x1f')]=function(_0x115886){try{if(!_[_0x6f6a('0x15')](dials[_0x115886[_0x6f6a('0x5')]])){utils[_0x6f6a('0xb')](util[_0x6f6a('0x3')]('[%s][dials][dialend]',_0x115886[_0x6f6a('0x5')]),_0x115886);dials[_0x115886[_0x6f6a('0x5')]][_0x6f6a('0x9')]=_0x115886[_0x6f6a('0x9')];if(_0x115886['dialstatus']==_0x6f6a('0x20')){dials[_0x115886[_0x6f6a('0x5')]]=_[_0x6f6a('0x19')](dials[_0x115886['uniqueid']],_0x115886);dials[_0x115886[_0x6f6a('0x5')]][_0x6f6a('0x21')]=utils[_0x6f6a('0x1a')]();dials[_0x115886[_0x6f6a('0x5')]][_0x6f6a('0x1b')]=_0x6f6a('0x22');utils[_0x6f6a('0x2')](util[_0x6f6a('0x3')](_0x6f6a('0x23'),_0x115886[_0x6f6a('0x5')],_0x115886[_0x6f6a('0x9')],dials[_0x115886[_0x6f6a('0x5')]][_0x6f6a('0x21')]));}else{utils[_0x6f6a('0x2')](util[_0x6f6a('0x3')](_0x6f6a('0x24'),_0x115886[_0x6f6a('0x5')],_0x115886[_0x6f6a('0x9')]));}}}catch(_0x1247a7){utils[_0x6f6a('0x13')](util[_0x6f6a('0x3')](_0x6f6a('0x25'),_0x115886[_0x6f6a('0x5')]),_0x1247a7);}};exports[_0x6f6a('0x26')]=function(_0x1886b9){try{if(!_[_0x6f6a('0x15')](dials[_0x1886b9['uniqueid']])){utils[_0x6f6a('0xb')](util[_0x6f6a('0x3')]('[%s][dials][hangup]',_0x1886b9[_0x6f6a('0x5')]),_0x1886b9);utils[_0x6f6a('0x2')](util[_0x6f6a('0x3')](_0x6f6a('0x27'),_0x1886b9['uniqueid'],_0x1886b9[_0x6f6a('0x8')],_0x1886b9[_0x6f6a('0x28')],_0x1886b9[_0x6f6a('0x29')]));dials[_0x1886b9[_0x6f6a('0x5')]]=_[_0x6f6a('0x19')](dials[_0x1886b9[_0x6f6a('0x5')]],{'endtime':utils[_0x6f6a('0x1a')](),'lastevent':_0x6f6a('0x2a')});dials[_0x1886b9['uniqueid']][_0x6f6a('0x2b')]=utils[_0x6f6a('0x2c')](dials[_0x1886b9[_0x6f6a('0x5')]][_0x6f6a('0x2d')],dials[_0x1886b9[_0x6f6a('0x5')]][_0x6f6a('0x1e')]);dials[_0x1886b9[_0x6f6a('0x5')]][_0x6f6a('0x2e')]=utils[_0x6f6a('0x2c')](dials[_0x1886b9['uniqueid']][_0x6f6a('0x21')]||dials[_0x1886b9[_0x6f6a('0x5')]][_0x6f6a('0x2d')],dials[_0x1886b9[_0x6f6a('0x5')]]['starttime']);dials[_0x1886b9[_0x6f6a('0x5')]]['billableseconds']=dials[_0x1886b9[_0x6f6a('0x5')]][_0x6f6a('0x21')]?utils[_0x6f6a('0x2c')](dials[_0x1886b9[_0x6f6a('0x5')]]['endtime'],dials[_0x1886b9[_0x6f6a('0x5')]]['answertime']):0x0;writeDB(dials[_0x1886b9[_0x6f6a('0x5')]]);}}catch(_0x3dbd37){utils[_0x6f6a('0x13')](util[_0x6f6a('0x3')](_0x6f6a('0x2f'),_0x1886b9[_0x6f6a('0x5')]),_0x3dbd37);}}; \ No newline at end of file +var _0x0021=['variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','calleridname','cause-txt','duration','diffTime','holdtime','endtime','billableseconds','lodash','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','debug','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil'];(function(_0x38043a,_0x1728d4){var _0x5ca8ff=function(_0x2c41ee){while(--_0x2c41ee){_0x38043a['push'](_0x38043a['shift']());}};_0x5ca8ff(++_0x1728d4);}(_0x0021,0x7d));var _0x1002=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x0021[_0x49d41c];return _0xb64c5f;};'use strict';var _=require(_0x1002('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x1ff873){utils[_0x1002('0x1')](util['format'](_0x1002('0x2'),_0x1ff873['uniqueid'],_0x1ff873['channel'],_0x1ff873[_0x1002('0x3')],_0x1ff873[_0x1002('0x4')],_0x1ff873['connectedlinenum'],_0x1ff873[_0x1002('0x5')]));utils[_0x1002('0x6')](_0x1002('0x7'),_0x1ff873);delete dials[_0x1ff873[_0x1002('0x8')]];}exports[_0x1002('0x9')]=function(_0x12d0f1){try{utils[_0x1002('0xa')](util[_0x1002('0xb')](_0x1002('0xc'),_0x12d0f1[_0x1002('0x8')]),_0x12d0f1);utils['info'](util[_0x1002('0xb')](_0x1002('0xd'),_0x12d0f1[_0x1002('0x8')],_0x12d0f1[_0x1002('0xe')],_0x12d0f1['appdata']));if(_0x12d0f1[_0x1002('0xe')][_0x1002('0xf')]()==_0x1002('0x10')&&_[_0x1002('0x11')](_0x12d0f1[_0x1002('0x12')]['toLowerCase'](),_0x1002('0x13'))){var _0x365b09=_0x12d0f1[_0x1002('0x12')][_0x1002('0x14')]('=');dials[_0x12d0f1[_0x1002('0x8')]]={'routeId':_0x365b09[0x1]};}}catch(_0x3cb41f){utils[_0x1002('0x15')](util[_0x1002('0xb')](_0x1002('0xc'),_0x12d0f1['uniqueid']),_0x3cb41f);}};exports[_0x1002('0x16')]=function(_0x5044d8){try{utils[_0x1002('0xa')](util[_0x1002('0xb')](_0x1002('0x17'),_0x5044d8['uniqueid']),_0x5044d8);if(!_[_0x1002('0x18')](_0x5044d8[_0x1002('0x19')][_0x1002('0x1a')])){utils[_0x1002('0x1')](util[_0x1002('0xb')](_0x1002('0x1b'),_0x5044d8['uniqueid'],_0x5044d8[_0x1002('0x1c')]));dials[_0x5044d8['uniqueid']]={'routeId':_0x5044d8[_0x1002('0x1c')]};}}catch(_0x12852d){utils[_0x1002('0x15')](util[_0x1002('0xb')]('[%s][dials][varset]',_0x5044d8[_0x1002('0x8')]),_0x12852d);}};exports[_0x1002('0x1d')]=function(_0x4c8f85){try{if(!_[_0x1002('0x18')](dials[_0x4c8f85[_0x1002('0x8')]])){utils[_0x1002('0xa')](util[_0x1002('0xb')](_0x1002('0x1e'),_0x4c8f85[_0x1002('0x8')]),_0x4c8f85);dials[_0x4c8f85['uniqueid']]=_[_0x1002('0x1f')](dials[_0x4c8f85[_0x1002('0x8')]],_0x4c8f85);dials[_0x4c8f85[_0x1002('0x8')]][_0x1002('0x20')]=utils[_0x1002('0x21')]();dials[_0x4c8f85[_0x1002('0x8')]][_0x1002('0x22')]=_0x1002('0x23');utils[_0x1002('0x1')](util[_0x1002('0xb')](_0x1002('0x24'),_0x4c8f85[_0x1002('0x8')],dials[_0x4c8f85[_0x1002('0x8')]][_0x1002('0x20')]));}}catch(_0x2d4994){utils[_0x1002('0x15')](util[_0x1002('0xb')](_0x1002('0x1e'),_0x4c8f85[_0x1002('0x8')]),_0x2d4994);}};exports['dialend']=function(_0x300bcc){try{if(!_[_0x1002('0x18')](dials[_0x300bcc[_0x1002('0x8')]])){utils['debug'](util['format']('[%s][dials][dialend]',_0x300bcc['uniqueid']),_0x300bcc);dials[_0x300bcc[_0x1002('0x8')]][_0x1002('0x5')]=_0x300bcc['dialstatus'];if(_0x300bcc[_0x1002('0x5')]=='ANSWER'){dials[_0x300bcc[_0x1002('0x8')]]=_[_0x1002('0x1f')](dials[_0x300bcc['uniqueid']],_0x300bcc);dials[_0x300bcc[_0x1002('0x8')]]['answertime']=utils['now']();dials[_0x300bcc[_0x1002('0x8')]][_0x1002('0x22')]='connect';utils['info'](util['format'](_0x1002('0x25'),_0x300bcc['uniqueid'],_0x300bcc[_0x1002('0x5')],dials[_0x300bcc[_0x1002('0x8')]][_0x1002('0x26')]));}else{utils['info'](util[_0x1002('0xb')](_0x1002('0x27'),_0x300bcc[_0x1002('0x8')],_0x300bcc[_0x1002('0x5')]));}}}catch(_0x32443b){utils[_0x1002('0x15')](util[_0x1002('0xb')](_0x1002('0x28'),_0x300bcc[_0x1002('0x8')]),_0x32443b);}};exports[_0x1002('0x29')]=function(_0x3aa95a){try{if(!_[_0x1002('0x18')](dials[_0x3aa95a[_0x1002('0x8')]])){utils['debug'](util['format'](_0x1002('0x2a'),_0x3aa95a[_0x1002('0x8')]),_0x3aa95a);utils[_0x1002('0x1')](util[_0x1002('0xb')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x3aa95a[_0x1002('0x8')],_0x3aa95a[_0x1002('0x4')],_0x3aa95a[_0x1002('0x2b')],_0x3aa95a[_0x1002('0x2c')]));dials[_0x3aa95a['uniqueid']]=_[_0x1002('0x1f')](dials[_0x3aa95a[_0x1002('0x8')]],{'endtime':utils[_0x1002('0x21')](),'lastevent':'complete'});dials[_0x3aa95a[_0x1002('0x8')]][_0x1002('0x2d')]=utils[_0x1002('0x2e')](dials[_0x3aa95a[_0x1002('0x8')]]['endtime'],dials[_0x3aa95a['uniqueid']]['starttime']);dials[_0x3aa95a[_0x1002('0x8')]][_0x1002('0x2f')]=utils['diffTime'](dials[_0x3aa95a['uniqueid']][_0x1002('0x26')]||dials[_0x3aa95a[_0x1002('0x8')]][_0x1002('0x30')],dials[_0x3aa95a[_0x1002('0x8')]][_0x1002('0x20')]);dials[_0x3aa95a[_0x1002('0x8')]][_0x1002('0x31')]=dials[_0x3aa95a['uniqueid']][_0x1002('0x26')]?utils[_0x1002('0x2e')](dials[_0x3aa95a['uniqueid']][_0x1002('0x30')],dials[_0x3aa95a[_0x1002('0x8')]][_0x1002('0x26')]):0x0;writeDB(dials[_0x3aa95a[_0x1002('0x8')]]);}}catch(_0xa30dde){utils['error'](util['format']('[%s][dials][hangup]',_0x3aa95a[_0x1002('0x8')]),_0xa30dde);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 4d2d520..8d1e20a 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 _0x2732=['[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','origtransfereruniqueid','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','production','local','port','asterisk','username','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./recordings.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','device','format','[%s][index][devicestatechange]','agentcalled','debug','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon'];(function(_0x348816,_0x219408){var _0x5517cb=function(_0x470dda){while(--_0x470dda){_0x348816['push'](_0x348816['shift']());}};_0x5517cb(++_0x219408);}(_0x2732,0xe6));var _0x2273=function(_0x38aaa7,_0x314aa9){_0x38aaa7=_0x38aaa7-0x0;var _0x3af440=_0x2732[_0x38aaa7];return _0x3af440;};var AsteriskManager=require(_0x2273('0x0'));var config=require(_0x2273('0x1'));var utils=require(_0x2273('0x2'));var util=require(_0x2273('0x3'));var isXDREnabled=config[_0x2273('0x4')]&&config['xdr'][_0x2273('0x5')]?!config[_0x2273('0x4')][_0x2273('0x5')]:!![];var isProduction=config['env']===_0x2273('0x6')||![];var isLocalAsterisk=config[_0x2273('0x4')]&&config[_0x2273('0x4')][_0x2273('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x2273('0x8')],config[_0x2273('0x9')]['ip'],config[_0x2273('0x9')][_0x2273('0xa')],config[_0x2273('0x9')]['password'],!![]);ami[_0x2273('0xb')]();if(!isXDREnabled){utils[_0x2273('0xc')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x2273('0xc')](_0x2273('0xd'));}else{var agents=require(_0x2273('0xe'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0x2273('0xf'));var members=require('./members.controller');var dials=require(_0x2273('0x10'));var transfers=require(_0x2273('0x11'));var core=require('./core.controller');ami['on']('connect',core[_0x2273('0x12')]);ami['on'](_0x2273('0x13'),core[_0x2273('0x13')]);ami['on'](_0x2273('0x14'),core[_0x2273('0x14')]);ami['on']('error',core[_0x2273('0x15')]);ami['on'](_0x2273('0x16'),core[_0x2273('0x16')]);ami['on']('managerevent',core[_0x2273('0x17')]);ami['on'](_0x2273('0x18'),function(_0x6ce19a){try{utils['debug'](util['format']('[%s][index][devicestatechange]',_0x6ce19a[_0x2273('0x19')]),_0x6ce19a);members[_0x2273('0x18')](_0x6ce19a);}catch(_0x4ba8c5){utils['error'](util[_0x2273('0x1a')](_0x2273('0x1b'),_0x6ce19a['device']),_0x4ba8c5);}});ami['on'](_0x2273('0x1c'),function(_0x592193){try{utils[_0x2273('0x1d')](util[_0x2273('0x1a')](_0x2273('0x1e'),_0x592193[_0x2273('0x1f')]),_0x592193);agents[_0x2273('0x1c')](_0x592193);}catch(_0x4c7c9f){utils[_0x2273('0x15')](util[_0x2273('0x1a')](_0x2273('0x1e'),_0x592193['uniqueid']),_0x4c7c9f);}});ami['on']('agentringnoanswer',function(_0x28a134){try{utils[_0x2273('0x1d')](util[_0x2273('0x1a')](_0x2273('0x20'),_0x28a134[_0x2273('0x1f')]),_0x28a134);agents['agentringnoanswer'](_0x28a134);}catch(_0x145d49){utils['error'](util[_0x2273('0x1a')](_0x2273('0x20'),_0x28a134[_0x2273('0x1f')]),_0x145d49);}});ami['on']('agentconnect',function(_0x4361e3){try{utils['debug'](util[_0x2273('0x1a')](_0x2273('0x21'),_0x4361e3[_0x2273('0x1f')]),_0x4361e3);agents[_0x2273('0x22')](_0x4361e3);queues['agentconnect'](_0x4361e3);}catch(_0x527b4b){utils['error'](util['format'](_0x2273('0x21'),_0x4361e3['uniqueid']),_0x527b4b);}});ami['on'](_0x2273('0x23'),function(_0x32df84){try{utils[_0x2273('0x1d')](util['format'](_0x2273('0x24'),_0x32df84['uniqueid']),_0x32df84);agents[_0x2273('0x23')](_0x32df84);queues[_0x2273('0x23')](_0x32df84);members[_0x2273('0x23')](_0x32df84);}catch(_0x456c34){utils[_0x2273('0x15')](util['format'](_0x2273('0x24'),_0x32df84['uniqueid']),_0x456c34);}});ami['on'](_0x2273('0x25'),function(_0x22ec29){try{utils[_0x2273('0x1d')](util['format'](_0x2273('0x26'),_0x22ec29[_0x2273('0x1f')]),_0x22ec29);agents['queuecallerabandon'](_0x22ec29);queues['queuecallerabandon'](_0x22ec29);}catch(_0x212b17){utils[_0x2273('0x15')](util[_0x2273('0x1a')](_0x2273('0x26'),_0x22ec29['uniqueid']),_0x212b17);}});ami['on'](_0x2273('0x27'),function(_0x189c16){try{utils['debug'](util[_0x2273('0x1a')]('[%s][index][queuecallerjoin]',_0x189c16[_0x2273('0x1f')]),_0x189c16);queues[_0x2273('0x27')](_0x189c16);recordings[_0x2273('0x27')](_0x189c16);}catch(_0x133979){utils[_0x2273('0x15')](util[_0x2273('0x1a')](_0x2273('0x28'),_0x189c16[_0x2273('0x1f')]),_0x133979);}});ami['on']('queuecallerleave',function(_0xbbe52b){try{utils['debug'](util[_0x2273('0x1a')](_0x2273('0x29'),_0xbbe52b['uniqueid']),_0xbbe52b);queues[_0x2273('0x2a')](_0xbbe52b);}catch(_0x4b809f){utils[_0x2273('0x15')](util['format'](_0x2273('0x29'),_0xbbe52b[_0x2273('0x1f')]),_0x4b809f);}});ami['on'](_0x2273('0x2b'),function(_0x240a58){try{utils[_0x2273('0x1d')](util['format']('[%s][index][musiconholdstart]',_0x240a58['uniqueid']),_0x240a58);queues[_0x2273('0x2b')](_0x240a58);calls[_0x2273('0x2b')](_0x240a58);}catch(_0x502a93){utils[_0x2273('0x15')](util['format']('[%s][index][musiconholdstart]',_0x240a58['uniqueid']),_0x502a93);}});ami['on'](_0x2273('0x2c'),function(_0x2fa631){try{utils[_0x2273('0x1d')](util[_0x2273('0x1a')](_0x2273('0x2d'),_0x2fa631[_0x2273('0x1f')]),_0x2fa631);queues['musiconholdstop'](_0x2fa631);calls[_0x2273('0x2c')](_0x2fa631);}catch(_0x23ba60){utils[_0x2273('0x15')](util[_0x2273('0x1a')](_0x2273('0x2d'),_0x2fa631[_0x2273('0x1f')]),_0x23ba60);}});ami['on']('newstate',function(_0xe33d3a){try{utils[_0x2273('0x1d')](util[_0x2273('0x1a')](_0x2273('0x2e'),_0xe33d3a[_0x2273('0x1f')]),_0xe33d3a);calls[_0x2273('0x2f')](_0xe33d3a);recordings[_0x2273('0x2f')](_0xe33d3a);}catch(_0x45cd98){utils['error'](util[_0x2273('0x1a')](_0x2273('0x2e'),_0xe33d3a['uniqueid']),_0x45cd98);}});ami['on'](_0x2273('0x30'),function(_0xeae54){try{utils['debug'](util[_0x2273('0x1a')]('[%s][index][hangup]',_0xeae54[_0x2273('0x1f')]),_0xeae54);calls[_0x2273('0x30')](_0xeae54);recordings[_0x2273('0x30')](_0xeae54);dials[_0x2273('0x30')](_0xeae54);agents[_0x2273('0x30')](_0xeae54);queues[_0x2273('0x30')](_0xeae54);}catch(_0x3226e0){utils['error'](util[_0x2273('0x1a')](_0x2273('0x31'),_0xeae54[_0x2273('0x1f')]),_0x3226e0);}});ami['on'](_0x2273('0x32'),function(_0x507bb4){try{utils[_0x2273('0x1d')](util[_0x2273('0x1a')](_0x2273('0x33'),_0x507bb4['uniqueid']),_0x507bb4);members[_0x2273('0x32')](_0x507bb4);}catch(_0x5d54c2){utils[_0x2273('0x15')](util['format']('[%s][index][cdr]',_0x507bb4[_0x2273('0x1f')]),_0x5d54c2);}});ami['on'](_0x2273('0x34'),function(_0x17998a){try{utils[_0x2273('0x1d')](util[_0x2273('0x1a')]('[%s][index][blindtransfer]',_0x17998a[_0x2273('0x1f')]),_0x17998a);queues[_0x2273('0x34')](_0x17998a);agents['blindtransfer'](_0x17998a);transfers['blindtransfer'](_0x17998a);}catch(_0x3de1b6){utils[_0x2273('0x15')](util[_0x2273('0x1a')]('[%s][index][blindtransfer]',_0x17998a[_0x2273('0x1f')]),_0x3de1b6);}});ami['on']('attendedtransfer',function(_0x177cfb){try{utils['debug'](util[_0x2273('0x1a')]('[%s][index][attendedtransfer]',_0x177cfb[_0x2273('0x35')]),_0x177cfb);queues[_0x2273('0x36')](_0x177cfb);transfers[_0x2273('0x36')](_0x177cfb);agents[_0x2273('0x36')](_0x177cfb);calls[_0x2273('0x36')](_0x177cfb);}catch(_0x491ea9){utils[_0x2273('0x15')](util[_0x2273('0x1a')](_0x2273('0x37'),_0x177cfb[_0x2273('0x35')]),_0x491ea9);}});ami['on'](_0x2273('0x38'),function(_0x2da6b1){try{utils['debug'](util[_0x2273('0x1a')](_0x2273('0x39'),_0x2da6b1[_0x2273('0x1f')]),_0x2da6b1);queues[_0x2273('0x38')](_0x2da6b1);recordings[_0x2273('0x38')](_0x2da6b1);calls['varset'](_0x2da6b1);dials[_0x2273('0x38')](_0x2da6b1);}catch(_0x1133f4){utils[_0x2273('0x15')](util[_0x2273('0x1a')](_0x2273('0x39'),_0x2da6b1[_0x2273('0x1f')]),_0x1133f4);}});ami['on']('newexten',function(_0x3defa2){try{utils[_0x2273('0x1d')](util['format'](_0x2273('0x3a'),_0x3defa2['uniqueid']),_0x3defa2);calls['newexten'](_0x3defa2);recordings[_0x2273('0x3b')](_0x3defa2);dials[_0x2273('0x3b')](_0x3defa2);}catch(_0x1d7671){utils[_0x2273('0x15')](util[_0x2273('0x1a')](_0x2273('0x3a'),_0x3defa2['uniqueid']),_0x1d7671);}});ami['on'](_0x2273('0x3c'),function(_0x32ccb3){try{utils[_0x2273('0x1d')](util[_0x2273('0x1a')]('[%s][index][newchannel]',_0x32ccb3['uniqueid']),_0x32ccb3);calls[_0x2273('0x3c')](_0x32ccb3);recordings['newchannel'](_0x32ccb3);}catch(_0x275438){utils['error'](util[_0x2273('0x1a')](_0x2273('0x3d'),_0x32ccb3[_0x2273('0x1f')]),_0x275438);}});ami['on'](_0x2273('0x3e'),function(_0x9c9a25){try{utils[_0x2273('0x1d')](util[_0x2273('0x1a')](_0x2273('0x3f'),_0x9c9a25[_0x2273('0x1f')]),_0x9c9a25);dials['dialbegin'](_0x9c9a25);}catch(_0x7aa614){utils[_0x2273('0x15')](util[_0x2273('0x1a')](_0x2273('0x40'),_0x9c9a25[_0x2273('0x1f')]),_0x7aa614);}});ami['on'](_0x2273('0x41'),function(_0xf5429e){try{utils[_0x2273('0x1d')](util[_0x2273('0x1a')](_0x2273('0x42'),_0xf5429e['uniqueid']),_0xf5429e);dials[_0x2273('0x41')](_0xf5429e);}catch(_0x3502cc){utils['error'](util[_0x2273('0x1a')]('[%s][index][dialend]',_0xf5429e[_0x2273('0x1f')]),_0x3502cc);}});} \ No newline at end of file +var _0x1bd1=['origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','xdr','env','production','asterisk','port','username','password','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','device','devicestatechange','agentcalled','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]'];(function(_0x5b080b,_0xe34631){var _0x3d724c=function(_0x3175ac){while(--_0x3175ac){_0x5b080b['push'](_0x5b080b['shift']());}};_0x3d724c(++_0xe34631);}(_0x1bd1,0x123));var _0x11bd=function(_0x46e510,_0x5897ad){_0x46e510=_0x46e510-0x0;var _0x5bf74c=_0x1bd1[_0x46e510];return _0x5bf74c;};var AsteriskManager=require(_0x11bd('0x0'));var config=require(_0x11bd('0x1'));var utils=require(_0x11bd('0x2'));var util=require('util');var isXDREnabled=config[_0x11bd('0x3')]&&config['xdr']['disabled']?!config['xdr']['disabled']:!![];var isProduction=config[_0x11bd('0x4')]===_0x11bd('0x5')||![];var isLocalAsterisk=config[_0x11bd('0x3')]&&config[_0x11bd('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config[_0x11bd('0x6')][_0x11bd('0x7')],config[_0x11bd('0x6')]['ip'],config[_0x11bd('0x6')][_0x11bd('0x8')],config['asterisk'][_0x11bd('0x9')],!![]);ami['keepConnected']();if(!isXDREnabled){utils['info'](_0x11bd('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x11bd('0xb')](_0x11bd('0xc'));}else{var agents=require(_0x11bd('0xd'));var calls=require(_0x11bd('0xe'));var queues=require(_0x11bd('0xf'));var recordings=require(_0x11bd('0x10'));var members=require(_0x11bd('0x11'));var dials=require('./dials.controller');var transfers=require(_0x11bd('0x12'));var core=require(_0x11bd('0x13'));ami['on'](_0x11bd('0x14'),core[_0x11bd('0x14')]);ami['on'](_0x11bd('0x15'),core[_0x11bd('0x15')]);ami['on'](_0x11bd('0x16'),core['fullybooted']);ami['on']('error',core[_0x11bd('0x17')]);ami['on'](_0x11bd('0x18'),core[_0x11bd('0x18')]);ami['on']('managerevent',core[_0x11bd('0x19')]);ami['on']('devicestatechange',function(_0x59978e){try{utils[_0x11bd('0x1a')](util[_0x11bd('0x1b')](_0x11bd('0x1c'),_0x59978e[_0x11bd('0x1d')]),_0x59978e);members[_0x11bd('0x1e')](_0x59978e);}catch(_0x5d6448){utils[_0x11bd('0x17')](util[_0x11bd('0x1b')](_0x11bd('0x1c'),_0x59978e[_0x11bd('0x1d')]),_0x5d6448);}});ami['on'](_0x11bd('0x1f'),function(_0x3baea6){try{utils[_0x11bd('0x1a')](util[_0x11bd('0x1b')]('[%s][index][agentcalled]',_0x3baea6['uniqueid']),_0x3baea6);agents[_0x11bd('0x1f')](_0x3baea6);}catch(_0x232811){utils[_0x11bd('0x17')](util[_0x11bd('0x1b')]('[%s][index][agentcalled]',_0x3baea6[_0x11bd('0x20')]),_0x232811);}});ami['on']('agentringnoanswer',function(_0x232f11){try{utils[_0x11bd('0x1a')](util[_0x11bd('0x1b')]('[%s][index][agentringnoanswer]',_0x232f11[_0x11bd('0x20')]),_0x232f11);agents[_0x11bd('0x21')](_0x232f11);}catch(_0x1c0522){utils[_0x11bd('0x17')](util[_0x11bd('0x1b')](_0x11bd('0x22'),_0x232f11[_0x11bd('0x20')]),_0x1c0522);}});ami['on'](_0x11bd('0x23'),function(_0x2c5785){try{utils[_0x11bd('0x1a')](util[_0x11bd('0x1b')](_0x11bd('0x24'),_0x2c5785['uniqueid']),_0x2c5785);agents[_0x11bd('0x23')](_0x2c5785);queues[_0x11bd('0x23')](_0x2c5785);}catch(_0xa08420){utils['error'](util['format']('[%s][index][agentconnect]',_0x2c5785[_0x11bd('0x20')]),_0xa08420);}});ami['on'](_0x11bd('0x25'),function(_0x181fdc){try{utils[_0x11bd('0x1a')](util[_0x11bd('0x1b')](_0x11bd('0x26'),_0x181fdc[_0x11bd('0x20')]),_0x181fdc);agents['agentcomplete'](_0x181fdc);queues[_0x11bd('0x25')](_0x181fdc);members['agentcomplete'](_0x181fdc);}catch(_0x161cb1){utils[_0x11bd('0x17')](util['format'](_0x11bd('0x26'),_0x181fdc[_0x11bd('0x20')]),_0x161cb1);}});ami['on'](_0x11bd('0x27'),function(_0x2cd9c4){try{utils[_0x11bd('0x1a')](util[_0x11bd('0x1b')](_0x11bd('0x28'),_0x2cd9c4[_0x11bd('0x20')]),_0x2cd9c4);agents['queuecallerabandon'](_0x2cd9c4);queues[_0x11bd('0x27')](_0x2cd9c4);}catch(_0x410f2a){utils[_0x11bd('0x17')](util[_0x11bd('0x1b')](_0x11bd('0x28'),_0x2cd9c4[_0x11bd('0x20')]),_0x410f2a);}});ami['on'](_0x11bd('0x29'),function(_0x1098f1){try{utils[_0x11bd('0x1a')](util[_0x11bd('0x1b')]('[%s][index][queuecallerjoin]',_0x1098f1[_0x11bd('0x20')]),_0x1098f1);queues[_0x11bd('0x29')](_0x1098f1);recordings['queuecallerjoin'](_0x1098f1);}catch(_0x2fbe36){utils[_0x11bd('0x17')](util[_0x11bd('0x1b')](_0x11bd('0x2a'),_0x1098f1['uniqueid']),_0x2fbe36);}});ami['on'](_0x11bd('0x2b'),function(_0x485915){try{utils[_0x11bd('0x1a')](util[_0x11bd('0x1b')](_0x11bd('0x2c'),_0x485915[_0x11bd('0x20')]),_0x485915);queues[_0x11bd('0x2b')](_0x485915);}catch(_0x3cb2ab){utils[_0x11bd('0x17')](util[_0x11bd('0x1b')](_0x11bd('0x2c'),_0x485915[_0x11bd('0x20')]),_0x3cb2ab);}});ami['on'](_0x11bd('0x2d'),function(_0x1c4b40){try{utils[_0x11bd('0x1a')](util[_0x11bd('0x1b')]('[%s][index][musiconholdstart]',_0x1c4b40['uniqueid']),_0x1c4b40);queues['musiconholdstart'](_0x1c4b40);calls[_0x11bd('0x2d')](_0x1c4b40);}catch(_0xad0a08){utils['error'](util[_0x11bd('0x1b')](_0x11bd('0x2e'),_0x1c4b40[_0x11bd('0x20')]),_0xad0a08);}});ami['on']('musiconholdstop',function(_0x2b25a3){try{utils[_0x11bd('0x1a')](util[_0x11bd('0x1b')](_0x11bd('0x2f'),_0x2b25a3[_0x11bd('0x20')]),_0x2b25a3);queues[_0x11bd('0x30')](_0x2b25a3);calls['musiconholdstop'](_0x2b25a3);}catch(_0xc6b819){utils['error'](util[_0x11bd('0x1b')]('[%s][index][musiconholdstop]',_0x2b25a3[_0x11bd('0x20')]),_0xc6b819);}});ami['on'](_0x11bd('0x31'),function(_0x5049d4){try{utils[_0x11bd('0x1a')](util[_0x11bd('0x1b')](_0x11bd('0x32'),_0x5049d4[_0x11bd('0x20')]),_0x5049d4);calls['newstate'](_0x5049d4);recordings['newstate'](_0x5049d4);}catch(_0x46dded){utils[_0x11bd('0x17')](util['format'](_0x11bd('0x32'),_0x5049d4['uniqueid']),_0x46dded);}});ami['on'](_0x11bd('0x33'),function(_0x11e2f4){try{utils[_0x11bd('0x1a')](util[_0x11bd('0x1b')](_0x11bd('0x34'),_0x11e2f4[_0x11bd('0x20')]),_0x11e2f4);calls['hangup'](_0x11e2f4);recordings[_0x11bd('0x33')](_0x11e2f4);dials[_0x11bd('0x33')](_0x11e2f4);agents[_0x11bd('0x33')](_0x11e2f4);queues[_0x11bd('0x33')](_0x11e2f4);}catch(_0x38f07e){utils['error'](util[_0x11bd('0x1b')]('[%s][index][hangup]',_0x11e2f4[_0x11bd('0x20')]),_0x38f07e);}});ami['on'](_0x11bd('0x35'),function(_0x32d52d){try{utils['debug'](util[_0x11bd('0x1b')](_0x11bd('0x36'),_0x32d52d[_0x11bd('0x20')]),_0x32d52d);members[_0x11bd('0x35')](_0x32d52d);}catch(_0x4dd9de){utils[_0x11bd('0x17')](util[_0x11bd('0x1b')](_0x11bd('0x36'),_0x32d52d[_0x11bd('0x20')]),_0x4dd9de);}});ami['on'](_0x11bd('0x37'),function(_0x3ad982){try{utils[_0x11bd('0x1a')](util[_0x11bd('0x1b')](_0x11bd('0x38'),_0x3ad982['uniqueid']),_0x3ad982);queues[_0x11bd('0x37')](_0x3ad982);agents[_0x11bd('0x37')](_0x3ad982);transfers['blindtransfer'](_0x3ad982);}catch(_0x16a3f9){utils['error'](util['format']('[%s][index][blindtransfer]',_0x3ad982[_0x11bd('0x20')]),_0x16a3f9);}});ami['on'](_0x11bd('0x39'),function(_0xf1a37){try{utils[_0x11bd('0x1a')](util[_0x11bd('0x1b')](_0x11bd('0x3a'),_0xf1a37[_0x11bd('0x3b')]),_0xf1a37);queues[_0x11bd('0x39')](_0xf1a37);transfers['attendedtransfer'](_0xf1a37);agents['attendedtransfer'](_0xf1a37);calls[_0x11bd('0x39')](_0xf1a37);}catch(_0x300cab){utils[_0x11bd('0x17')](util[_0x11bd('0x1b')](_0x11bd('0x3a'),_0xf1a37[_0x11bd('0x3b')]),_0x300cab);}});ami['on']('varset',function(_0x31099c){try{utils[_0x11bd('0x1a')](util[_0x11bd('0x1b')]('[%s][index][varset]',_0x31099c[_0x11bd('0x20')]),_0x31099c);queues[_0x11bd('0x3c')](_0x31099c);recordings[_0x11bd('0x3c')](_0x31099c);calls[_0x11bd('0x3c')](_0x31099c);dials[_0x11bd('0x3c')](_0x31099c);}catch(_0x4769bc){utils[_0x11bd('0x17')](util[_0x11bd('0x1b')](_0x11bd('0x3d'),_0x31099c[_0x11bd('0x20')]),_0x4769bc);}});ami['on'](_0x11bd('0x3e'),function(_0x2aff64){try{utils[_0x11bd('0x1a')](util['format'](_0x11bd('0x3f'),_0x2aff64[_0x11bd('0x20')]),_0x2aff64);calls[_0x11bd('0x3e')](_0x2aff64);recordings['newexten'](_0x2aff64);dials[_0x11bd('0x3e')](_0x2aff64);}catch(_0x168e3f){utils[_0x11bd('0x17')](util['format'](_0x11bd('0x3f'),_0x2aff64[_0x11bd('0x20')]),_0x168e3f);}});ami['on'](_0x11bd('0x40'),function(_0x52e636){try{utils[_0x11bd('0x1a')](util[_0x11bd('0x1b')](_0x11bd('0x41'),_0x52e636[_0x11bd('0x20')]),_0x52e636);calls[_0x11bd('0x40')](_0x52e636);recordings[_0x11bd('0x40')](_0x52e636);}catch(_0x394b6d){utils['error'](util[_0x11bd('0x1b')](_0x11bd('0x41'),_0x52e636[_0x11bd('0x20')]),_0x394b6d);}});ami['on'](_0x11bd('0x42'),function(_0x525cae){try{utils['debug'](util[_0x11bd('0x1b')](_0x11bd('0x43'),_0x525cae[_0x11bd('0x20')]),_0x525cae);dials[_0x11bd('0x42')](_0x525cae);}catch(_0x4a1ab4){utils[_0x11bd('0x17')](util[_0x11bd('0x1b')]('[%s]dialbegin',_0x525cae[_0x11bd('0x20')]),_0x4a1ab4);}});ami['on'](_0x11bd('0x44'),function(_0x41729b){try{utils[_0x11bd('0x1a')](util[_0x11bd('0x1b')]('[%s][index][dialend]',_0x41729b[_0x11bd('0x20')]),_0x41729b);dials[_0x11bd('0x44')](_0x41729b);}catch(_0x2ad38b){utils[_0x11bd('0x17')](util[_0x11bd('0x1b')](_0x11bd('0x45'),_0x41729b[_0x11bd('0x20')]),_0x2ad38b);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 6f1c86e..98f1bba 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 _0xac7f=['info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','getUserByInterface','then','internal','getUserByName','split','name','request','CreateMemberReport','catch','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','isNil','exitAt','duration','diffTime','enterAt','error','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','data1','type','data2','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','source','lodash','./utils','Local/_attended@transfer','Queue:'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xac7f,0x1e2));var _0xfac7=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xac7f[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xfac7('0x0'));var util=require('util');var utils=require(_0xfac7('0x1'));var members={};var exclude=[_0xfac7('0x2'),_0xfac7('0x3')];function writeDB(_0x50e61a){utils[_0xfac7('0x4')](util[_0xfac7('0x5')](_0xfac7('0x6'),_0x50e61a[_0xfac7('0x7')],_0x50e61a[_0xfac7('0x8')],_0x50e61a[_0xfac7('0x9')],_0x50e61a['data2'],_0x50e61a[_0xfac7('0xa')],_0x50e61a['type']));if(_0x50e61a[_0xfac7('0x8')]){utils[_0xfac7('0xb')](_0x50e61a['interface'])[_0xfac7('0xc')](function(_0x1a5768){if(_0x1a5768){_0x50e61a[_0xfac7('0xa')]=_0x1a5768['name'];_0x50e61a[_0xfac7('0xd')]=_0x1a5768[_0xfac7('0xd')];utils['request']('CreateMemberReport',_0x50e61a);}else{utils[_0xfac7('0xe')](_0x50e61a[_0xfac7('0x8')][_0xfac7('0xf')]('/')[0x1])[_0xfac7('0xc')](function(_0x25990e){if(_0x25990e){_0x50e61a['membername']=_0x25990e[_0xfac7('0x10')];_0x50e61a[_0xfac7('0xd')]=_0x25990e[_0xfac7('0xd')];utils[_0xfac7('0x11')](_0xfac7('0x12'),_0x50e61a);}});}})[_0xfac7('0x13')](function(_0x4a97d3){utils['error'](util[_0xfac7('0x5')]('[%s][members][writeDB]',_0x50e61a[_0xfac7('0x7')]),_0x4a97d3);});}delete members[_0x50e61a[_0xfac7('0x8')]];}function startsWith(_0x54d738,_0x1ff0f4){return _[_0xfac7('0x14')](_0x54d738,function(_0x4b7479){return _[_0xfac7('0x15')](_0x1ff0f4,_0x4b7479);});}exports[_0xfac7('0x16')]=function(_0x132eac){try{utils[_0xfac7('0x17')](util['format'](_0xfac7('0x18'),members[_0x132eac[_0xfac7('0x19')]]?members[_0x132eac[_0xfac7('0x19')]][_0xfac7('0x7')]:_0x132eac[_0xfac7('0x19')]),_0x132eac);utils[_0xfac7('0x4')](util[_0xfac7('0x5')](_0xfac7('0x1a'),members[_0x132eac[_0xfac7('0x19')]]?members[_0x132eac['device']]['uniqueid']:_0x132eac[_0xfac7('0x19')],_0x132eac[_0xfac7('0x1b')],_0x132eac['device']));switch(_0x132eac[_0xfac7('0x1b')]){case _0xfac7('0x1c'):case _0xfac7('0x1d'):if(!startsWith(exclude,_0x132eac[_0xfac7('0x19')])){members[_0x132eac[_0xfac7('0x19')]]={'channel':_0xfac7('0x1e'),'interface':_0x132eac[_0xfac7('0x19')],'type':_0xfac7('0x1f'),'enterAt':utils[_0xfac7('0x20')](),'role':_0xfac7('0x21')};}break;case'NOT_INUSE':if(!_[_0xfac7('0x22')](members[_0x132eac[_0xfac7('0x19')]])){members[_0x132eac[_0xfac7('0x19')]][_0xfac7('0x23')]=utils[_0xfac7('0x20')]();members[_0x132eac['device']][_0xfac7('0x24')]=utils[_0xfac7('0x25')](members[_0x132eac[_0xfac7('0x19')]][_0xfac7('0x23')],members[_0x132eac[_0xfac7('0x19')]][_0xfac7('0x26')]);if(members[_0x132eac['device']][_0xfac7('0x7')]){writeDB(members[_0x132eac[_0xfac7('0x19')]]);}}break;default:break;}}catch(_0x5b2cc0){utils[_0xfac7('0x27')](util[_0xfac7('0x5')](_0xfac7('0x18'),members[_0x132eac[_0xfac7('0x19')]]?members[_0x132eac[_0xfac7('0x19')]][_0xfac7('0x7')]:_0x132eac['device']),_0x5b2cc0);}};exports[_0xfac7('0x28')]=function(_0x49b341){try{if(!_[_0xfac7('0x22')](members[_0x49b341['interface']])){utils[_0xfac7('0x17')](util[_0xfac7('0x5')](_0xfac7('0x29'),_0x49b341['uniqueid']),_0x49b341);utils[_0xfac7('0x4')](util[_0xfac7('0x5')](_0xfac7('0x2a'),_0x49b341[_0xfac7('0x7')],_0x49b341[_0xfac7('0x8')],_0x49b341[_0xfac7('0x2b')]));members[_0x49b341[_0xfac7('0x8')]]=_[_0xfac7('0x2c')](members[_0x49b341[_0xfac7('0x8')]],{'data4':_0x49b341['queue'],'uniqueid':_0x49b341[_0xfac7('0x7')]});}}catch(_0x101f8c){utils['error'](util[_0xfac7('0x5')](_0xfac7('0x29'),_0x49b341[_0xfac7('0x7')]),_0x101f8c);}};exports[_0xfac7('0x2d')]=function(_0x188ae1){try{utils[_0xfac7('0x17')](util[_0xfac7('0x5')]('[%s][members][cdr]',_0x188ae1['uniqueid']),_0x188ae1);if(_0x188ae1[_0xfac7('0x9')]){var _0x51ec48=_0x188ae1['channel']['split']('-')[0x0];if(!_[_0xfac7('0x22')](members[_0x51ec48])){members[_0x51ec48]=_[_0xfac7('0x2c')](members[_0x51ec48],{'data1':members[_0x51ec48][_0xfac7('0x2e')]||_0x188ae1[_0xfac7('0x2f')],'data2':members[_0x51ec48][_0xfac7('0x30')]||_0x188ae1['source'],'data3':members[_0x51ec48][_0xfac7('0x31')]||_0x188ae1[_0xfac7('0x32')],'uniqueid':members[_0x51ec48][_0xfac7('0x7')]||_0x188ae1['uniqueid']});utils[_0xfac7('0x4')](util['format'](_0xfac7('0x33'),_0x188ae1[_0xfac7('0x7')],members[_0x51ec48][_0xfac7('0x2e')],members[_0x51ec48][_0xfac7('0x30')],members[_0x51ec48][_0xfac7('0x31')]));if(members[_0x51ec48][_0xfac7('0x23')]){writeDB(members[_0x51ec48]);}}}if(_0x188ae1[_0xfac7('0x34')]){var _0x42c1a5=_0x188ae1[_0xfac7('0x34')][_0xfac7('0xf')]('-')[0x0];if(!_[_0xfac7('0x22')](members[_0x42c1a5])){members[_0x42c1a5]=_[_0xfac7('0x2c')](members[_0x42c1a5],{'data1':members[_0x42c1a5][_0xfac7('0x2e')]||_0x188ae1[_0xfac7('0x2f')],'data2':members[_0x42c1a5][_0xfac7('0x30')]||_0x188ae1[_0xfac7('0x35')],'data3':members[_0x42c1a5]['data3']||_0x188ae1['destination'],'uniqueid':members[_0x42c1a5][_0xfac7('0x7')]||_0x188ae1['uniqueid']});utils[_0xfac7('0x4')](util[_0xfac7('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x188ae1[_0xfac7('0x7')],members[_0x42c1a5][_0xfac7('0x2e')],members[_0x42c1a5][_0xfac7('0x30')],members[_0x42c1a5][_0xfac7('0x31')]));if(members[_0x42c1a5][_0xfac7('0x23')]){writeDB(members[_0x42c1a5]);}}}}catch(_0x58792b){utils['error'](util[_0xfac7('0x5')]('[%s][members][cdr]',_0x188ae1['uniqueid']),_0x58792b);}}; \ No newline at end of file +var _0x3340=['devicestatechange','debug','[%s][members][devicestatechange]','device','state','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','duration','diffTime','agentcomplete','[%s][members][agentcomplete]','queue','assign','[%s][members][cdr]','data1','data2','source','data3','exitAt','destinationchannel','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','type','getUserByInterface','then','membername','name','internal','getUserByName','split','request','catch','error','[%s][members][writeDB]','some'];(function(_0x833f29,_0x56ae23){var _0x130367=function(_0x36aa3e){while(--_0x36aa3e){_0x833f29['push'](_0x833f29['shift']());}};_0x130367(++_0x56ae23);}(_0x3340,0x179));var _0x0334=function(_0x2ab935,_0x31f422){_0x2ab935=_0x2ab935-0x0;var _0x1ae2f=_0x3340[_0x2ab935];return _0x1ae2f;};'use strict';var _=require('lodash');var util=require(_0x0334('0x0'));var utils=require(_0x0334('0x1'));var members={};var exclude=[_0x0334('0x2'),_0x0334('0x3')];function writeDB(_0x8e9f3d){utils[_0x0334('0x4')](util[_0x0334('0x5')](_0x0334('0x6'),_0x8e9f3d[_0x0334('0x7')],_0x8e9f3d[_0x0334('0x8')],_0x8e9f3d[_0x0334('0x9')],_0x8e9f3d['data2'],_0x8e9f3d['membername'],_0x8e9f3d[_0x0334('0xa')]));if(_0x8e9f3d[_0x0334('0x8')]){utils[_0x0334('0xb')](_0x8e9f3d['interface'])[_0x0334('0xc')](function(_0x584ee2){if(_0x584ee2){_0x8e9f3d[_0x0334('0xd')]=_0x584ee2[_0x0334('0xe')];_0x8e9f3d[_0x0334('0xf')]=_0x584ee2[_0x0334('0xf')];utils['request']('CreateMemberReport',_0x8e9f3d);}else{utils[_0x0334('0x10')](_0x8e9f3d[_0x0334('0x8')][_0x0334('0x11')]('/')[0x1])['then'](function(_0x276639){if(_0x276639){_0x8e9f3d[_0x0334('0xd')]=_0x276639[_0x0334('0xe')];_0x8e9f3d[_0x0334('0xf')]=_0x276639['internal'];utils[_0x0334('0x12')]('CreateMemberReport',_0x8e9f3d);}});}})[_0x0334('0x13')](function(_0x4f7f16){utils[_0x0334('0x14')](util[_0x0334('0x5')](_0x0334('0x15'),_0x8e9f3d[_0x0334('0x7')]),_0x4f7f16);});}delete members[_0x8e9f3d[_0x0334('0x8')]];}function startsWith(_0x3003bf,_0x84230c){return _[_0x0334('0x16')](_0x3003bf,function(_0x756286){return _['startsWith'](_0x84230c,_0x756286);});}exports[_0x0334('0x17')]=function(_0x4bf73c){try{utils[_0x0334('0x18')](util[_0x0334('0x5')](_0x0334('0x19'),members[_0x4bf73c['device']]?members[_0x4bf73c[_0x0334('0x1a')]]['uniqueid']:_0x4bf73c[_0x0334('0x1a')]),_0x4bf73c);utils[_0x0334('0x4')](util[_0x0334('0x5')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x4bf73c[_0x0334('0x1a')]]?members[_0x4bf73c[_0x0334('0x1a')]][_0x0334('0x7')]:_0x4bf73c[_0x0334('0x1a')],_0x4bf73c[_0x0334('0x1b')],_0x4bf73c[_0x0334('0x1a')]));switch(_0x4bf73c['state']){case'INUSE':case _0x0334('0x1c'):if(!startsWith(exclude,_0x4bf73c[_0x0334('0x1a')])){members[_0x4bf73c['device']]={'channel':_0x0334('0x1d'),'interface':_0x4bf73c[_0x0334('0x1a')],'type':_0x0334('0x1e'),'enterAt':utils[_0x0334('0x1f')](),'role':_0x0334('0x20')};}break;case _0x0334('0x21'):if(!_[_0x0334('0x22')](members[_0x4bf73c[_0x0334('0x1a')]])){members[_0x4bf73c['device']]['exitAt']=utils[_0x0334('0x1f')]();members[_0x4bf73c[_0x0334('0x1a')]][_0x0334('0x23')]=utils[_0x0334('0x24')](members[_0x4bf73c[_0x0334('0x1a')]]['exitAt'],members[_0x4bf73c[_0x0334('0x1a')]]['enterAt']);if(members[_0x4bf73c[_0x0334('0x1a')]][_0x0334('0x7')]){writeDB(members[_0x4bf73c[_0x0334('0x1a')]]);}}break;default:break;}}catch(_0x6fe169){utils[_0x0334('0x14')](util['format'](_0x0334('0x19'),members[_0x4bf73c[_0x0334('0x1a')]]?members[_0x4bf73c[_0x0334('0x1a')]][_0x0334('0x7')]:_0x4bf73c[_0x0334('0x1a')]),_0x6fe169);}};exports[_0x0334('0x25')]=function(_0xc6e239){try{if(!_[_0x0334('0x22')](members[_0xc6e239[_0x0334('0x8')]])){utils[_0x0334('0x18')](util[_0x0334('0x5')](_0x0334('0x26'),_0xc6e239[_0x0334('0x7')]),_0xc6e239);utils[_0x0334('0x4')](util[_0x0334('0x5')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0xc6e239[_0x0334('0x7')],_0xc6e239[_0x0334('0x8')],_0xc6e239[_0x0334('0x27')]));members[_0xc6e239[_0x0334('0x8')]]=_[_0x0334('0x28')](members[_0xc6e239[_0x0334('0x8')]],{'data4':_0xc6e239[_0x0334('0x27')],'uniqueid':_0xc6e239[_0x0334('0x7')]});}}catch(_0x453b38){utils[_0x0334('0x14')](util[_0x0334('0x5')]('[%s][members][agentcomplete]',_0xc6e239[_0x0334('0x7')]),_0x453b38);}};exports['cdr']=function(_0x3d867d){try{utils[_0x0334('0x18')](util['format'](_0x0334('0x29'),_0x3d867d[_0x0334('0x7')]),_0x3d867d);if(_0x3d867d[_0x0334('0x9')]){var _0x294d62=_0x3d867d['channel'][_0x0334('0x11')]('-')[0x0];if(!_['isNil'](members[_0x294d62])){members[_0x294d62]=_['assign'](members[_0x294d62],{'data1':members[_0x294d62][_0x0334('0x2a')]||_0x3d867d['type'],'data2':members[_0x294d62][_0x0334('0x2b')]||_0x3d867d[_0x0334('0x2c')],'data3':members[_0x294d62][_0x0334('0x2d')]||_0x3d867d['destination'],'uniqueid':members[_0x294d62][_0x0334('0x7')]||_0x3d867d[_0x0334('0x7')]});utils[_0x0334('0x4')](util[_0x0334('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x3d867d['uniqueid'],members[_0x294d62][_0x0334('0x2a')],members[_0x294d62][_0x0334('0x2b')],members[_0x294d62]['data3']));if(members[_0x294d62][_0x0334('0x2e')]){writeDB(members[_0x294d62]);}}}if(_0x3d867d['destinationchannel']){var _0x12cdd2=_0x3d867d[_0x0334('0x2f')]['split']('-')[0x0];if(!_[_0x0334('0x22')](members[_0x12cdd2])){members[_0x12cdd2]=_[_0x0334('0x28')](members[_0x12cdd2],{'data1':members[_0x12cdd2]['data1']||_0x3d867d[_0x0334('0xa')],'data2':members[_0x12cdd2][_0x0334('0x2b')]||_0x3d867d['source'],'data3':members[_0x12cdd2]['data3']||_0x3d867d[_0x0334('0x30')],'uniqueid':members[_0x12cdd2][_0x0334('0x7')]||_0x3d867d[_0x0334('0x7')]});utils[_0x0334('0x4')](util[_0x0334('0x5')](_0x0334('0x31'),_0x3d867d[_0x0334('0x7')],members[_0x12cdd2][_0x0334('0x2a')],members[_0x12cdd2]['data2'],members[_0x12cdd2][_0x0334('0x2d')]));if(members[_0x12cdd2]['exitAt']){writeDB(members[_0x12cdd2]);}}}}catch(_0x1cf65d){utils[_0x0334('0x14')](util['format'](_0x0334('0x29'),_0x3d867d[_0x0334('0x7')]),_0x1cf65d);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 473b42f..f675864 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 _0xa0b5=['position','assign','now','error','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][hangup]','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','diffTime','queuecallerjoinAt','count','connectedlinename','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','membername','[%s][queues][agentconnect]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','secondtransfererexten','secondtransfereruniqueid','transfertargetlinkedid','queuecallerenterreason','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','queue','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s'];(function(_0x14d896,_0x53578b){var _0x28679a=function(_0x14921f){while(--_0x14921f){_0x14d896['push'](_0x14d896['shift']());}};_0x28679a(++_0x53578b);}(_0xa0b5,0x1d2));var _0x5a0b=function(_0x2d50fd,_0x449036){_0x2d50fd=_0x2d50fd-0x0;var _0x381d53=_0xa0b5[_0x2d50fd];return _0x381d53;};'use strict';var _=require('lodash');var util=require(_0x5a0b('0x0'));var utils=require('./utils');var queues={};function writeDB(_0x3740ee){utils[_0x5a0b('0x1')](util[_0x5a0b('0x2')](_0x5a0b('0x3'),_0x3740ee[_0x5a0b('0x4')],_0x3740ee['channel'],_0x3740ee['queue'],_0x3740ee[_0x5a0b('0x5')],_0x3740ee[_0x5a0b('0x6')],_0x3740ee[_0x5a0b('0x7')],_0x3740ee[_0x5a0b('0x8')]));if(_0x3740ee['queue']){utils[_0x5a0b('0x9')](_0x3740ee[_0x5a0b('0xa')])[_0x5a0b('0xb')](function(_0x48c6d8){if(_0x48c6d8){_0x3740ee[_0x5a0b('0xc')]=_0x48c6d8[_0x5a0b('0xc')];}utils[_0x5a0b('0xd')](_0x5a0b('0xe'),_0x3740ee);});}else{utils[_0x5a0b('0xd')](_0x5a0b('0xe'),_0x3740ee);}if(_0x3740ee[_0x5a0b('0xf')]){delete queues[_0x3740ee[_0x5a0b('0xf')]];}else{delete queues[_0x3740ee[_0x5a0b('0x4')]];}}exports['queuecallerjoin']=function(_0x12edac){try{utils[_0x5a0b('0x10')](util[_0x5a0b('0x2')](_0x5a0b('0x11'),_0x12edac['uniqueid']),_0x12edac);utils['info'](util[_0x5a0b('0x2')](_0x5a0b('0x12'),_0x12edac[_0x5a0b('0x4')],_0x12edac[_0x5a0b('0xa')],_0x12edac[_0x5a0b('0x13')]));queues[_0x12edac[_0x5a0b('0x4')]]=_[_0x5a0b('0x14')](_0x12edac,{'originalposition':_0x12edac[_0x5a0b('0x13')],'queuecallerjoinAt':utils[_0x5a0b('0x15')](),'mohtime':0x0});}catch(_0x3c5bad){utils[_0x5a0b('0x16')](util[_0x5a0b('0x2')](_0x5a0b('0x11'),_0x12edac[_0x5a0b('0x4')]),_0x3c5bad);}};exports['hangup']=function(_0x2c9e32){try{if(!_[_0x5a0b('0x17')](queues[_0x2c9e32[_0x5a0b('0x4')]])){utils[_0x5a0b('0x10')](util['format']('[%s][queues][hangup]',_0x2c9e32[_0x5a0b('0x4')]),_0x2c9e32);if(queues[_0x2c9e32[_0x5a0b('0x4')]][_0x5a0b('0x18')]){if(!queues[_0x2c9e32[_0x5a0b('0x4')]][_0x5a0b('0x19')]&&!queues[_0x2c9e32[_0x5a0b('0x4')]][_0x5a0b('0x1a')]){queues[_0x2c9e32['uniqueid']][_0x5a0b('0x1b')]=!![];queues[_0x2c9e32[_0x5a0b('0x4')]][_0x5a0b('0x1c')]=utils[_0x5a0b('0x15')]();queues[_0x2c9e32[_0x5a0b('0x4')]][_0x5a0b('0x8')]=_0x5a0b('0x1d');}utils['info'](util[_0x5a0b('0x2')](_0x5a0b('0x1e'),_0x2c9e32['uniqueid'],queues[_0x2c9e32[_0x5a0b('0x4')]][_0x5a0b('0x1f')],queues[_0x2c9e32['uniqueid']][_0x5a0b('0x8')]));writeDB(queues[_0x2c9e32['uniqueid']]);}else if(queues[_0x2c9e32[_0x5a0b('0x4')]][_0x5a0b('0xf')]){utils[_0x5a0b('0x1')](util['format'](_0x5a0b('0x20'),_0x2c9e32['uniqueid'],queues[_0x2c9e32[_0x5a0b('0x4')]]['name'],queues[_0x2c9e32['uniqueid']][_0x5a0b('0xf')]));queues[queues[_0x2c9e32[_0x5a0b('0x4')]][_0x5a0b('0xf')]]=queues[_0x2c9e32['uniqueid']];queues[queues[_0x2c9e32[_0x5a0b('0x4')]][_0x5a0b('0xf')]]['queuecallerenterreason']=0x2;delete queues[_0x2c9e32[_0x5a0b('0x4')]];}}}catch(_0xebe125){utils[_0x5a0b('0x16')](util[_0x5a0b('0x2')](_0x5a0b('0x21'),_0x2c9e32[_0x5a0b('0x4')]),_0xebe125);}};exports['varset']=function(_0x3bca3d){try{utils[_0x5a0b('0x10')](util[_0x5a0b('0x2')](_0x5a0b('0x22'),_0x3bca3d[_0x5a0b('0x4')]),_0x3bca3d);if(!_[_0x5a0b('0x17')](_0x3bca3d[_0x5a0b('0x23')][_0x5a0b('0x24')])&&_0x3bca3d[_0x5a0b('0x25')][_0x5a0b('0x26')]()!=='CONTINUE'){if(!_[_0x5a0b('0x17')](queues[_0x3bca3d[_0x5a0b('0x4')]])){queues[_0x3bca3d[_0x5a0b('0x4')]][_0x5a0b('0x19')]=![];queues[_0x3bca3d[_0x5a0b('0x4')]][_0x5a0b('0x27')]=null;queues[_0x3bca3d[_0x5a0b('0x4')]][_0x5a0b('0x1a')]=!![];queues[_0x3bca3d[_0x5a0b('0x4')]][_0x5a0b('0x28')]=utils[_0x5a0b('0x15')]();queues[_0x3bca3d[_0x5a0b('0x4')]][_0x5a0b('0x8')]=_0x3bca3d[_0x5a0b('0x25')]['toUpperCase']();utils[_0x5a0b('0x1')](util[_0x5a0b('0x2')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x3bca3d[_0x5a0b('0x4')],queues[_0x3bca3d[_0x5a0b('0x4')]][_0x5a0b('0x1f')],_0x3bca3d['value'],queues[_0x3bca3d[_0x5a0b('0x4')]][_0x5a0b('0x8')]));writeDB(queues[_0x3bca3d[_0x5a0b('0x4')]]);}}else if(!_[_0x5a0b('0x17')](_0x3bca3d[_0x5a0b('0x23')]['queueposition'])){if(!_[_0x5a0b('0x17')](queues[_0x3bca3d[_0x5a0b('0x4')]])&&!queues[_0x3bca3d[_0x5a0b('0x4')]][_0x5a0b('0x19')]){queues[_0x3bca3d['uniqueid']][_0x5a0b('0x19')]=![];queues[_0x3bca3d['uniqueid']][_0x5a0b('0x27')]=null;queues[_0x3bca3d[_0x5a0b('0x4')]][_0x5a0b('0x1a')]=!![];queues[_0x3bca3d[_0x5a0b('0x4')]]['queuecallerexitAt']=utils[_0x5a0b('0x15')]();queues[_0x3bca3d[_0x5a0b('0x4')]][_0x5a0b('0x8')]='EXITWITHKEY';utils[_0x5a0b('0x1')](util['format'](_0x5a0b('0x29'),_0x3bca3d[_0x5a0b('0x4')],queues[_0x3bca3d[_0x5a0b('0x4')]][_0x5a0b('0x1f')],_0x3bca3d['value'],queues[_0x3bca3d[_0x5a0b('0x4')]][_0x5a0b('0x8')]));}}}catch(_0xf850b8){utils['error'](util[_0x5a0b('0x2')](_0x5a0b('0x22'),_0x3bca3d['uniqueid']),_0xf850b8);}};exports['queuecallerabandon']=function(_0x34fb57){try{if(!_[_0x5a0b('0x17')](queues[_0x34fb57['uniqueid']])){utils['debug'](util[_0x5a0b('0x2')]('[%s][queues][queuecallerabandon]',_0x34fb57[_0x5a0b('0x4')]),_0x34fb57);queues[_0x34fb57[_0x5a0b('0x4')]][_0x5a0b('0x1a')]=![];queues[_0x34fb57[_0x5a0b('0x4')]][_0x5a0b('0x28')]=null;queues[_0x34fb57[_0x5a0b('0x4')]][_0x5a0b('0x19')]=!![];queues[_0x34fb57[_0x5a0b('0x4')]][_0x5a0b('0x27')]=utils[_0x5a0b('0x15')]();queues[_0x34fb57[_0x5a0b('0x4')]]['queuecallerexitreason']=_0x5a0b('0x2a');utils['info'](util[_0x5a0b('0x2')](_0x5a0b('0x2b'),_0x34fb57[_0x5a0b('0x4')],queues[_0x34fb57['uniqueid']][_0x5a0b('0x1f')],queues[_0x34fb57['uniqueid']][_0x5a0b('0x8')]));}}catch(_0x5e511e){utils[_0x5a0b('0x16')](util[_0x5a0b('0x2')](_0x5a0b('0x2c'),_0x34fb57[_0x5a0b('0x4')]),_0x5e511e);}};exports[_0x5a0b('0x2d')]=function(_0x1a815e){try{if(!_[_0x5a0b('0x17')](queues[_0x1a815e[_0x5a0b('0x4')]])){utils[_0x5a0b('0x10')](util['format'](_0x5a0b('0x2e'),_0x1a815e[_0x5a0b('0x4')]),_0x1a815e);utils[_0x5a0b('0x1')](util[_0x5a0b('0x2')](_0x5a0b('0x2f'),_0x1a815e[_0x5a0b('0x4')],queues[_0x1a815e[_0x5a0b('0x4')]][_0x5a0b('0x1f')],_0x1a815e[_0x5a0b('0x30')],_0x1a815e['connectedlinename']));queues[_0x1a815e['uniqueid']][_0x5a0b('0x2d')]=!![];queues[_0x1a815e['uniqueid']][_0x5a0b('0x18')]=utils[_0x5a0b('0x15')]();queues[_0x1a815e[_0x5a0b('0x4')]]['holdtime']=utils[_0x5a0b('0x31')](queues[_0x1a815e['uniqueid']][_0x5a0b('0x18')],queues[_0x1a815e['uniqueid']][_0x5a0b('0x32')]);queues[_0x1a815e[_0x5a0b('0x4')]][_0x5a0b('0x13')]=_0x1a815e['position'];queues[_0x1a815e[_0x5a0b('0x4')]][_0x5a0b('0x33')]=_0x1a815e['count'];queues[_0x1a815e[_0x5a0b('0x4')]][_0x5a0b('0x30')]=_0x1a815e['connectedlinenum'];queues[_0x1a815e[_0x5a0b('0x4')]]['connectedlinename']=_0x1a815e[_0x5a0b('0x34')];}}catch(_0x2e38cf){utils['error'](util[_0x5a0b('0x2')](_0x5a0b('0x2e'),_0x1a815e[_0x5a0b('0x4')]),_0x2e38cf);}};exports['agentconnect']=function(_0x209709){try{if(!_[_0x5a0b('0x17')](queues[_0x209709[_0x5a0b('0x4')]])){utils['debug'](util[_0x5a0b('0x2')]('[%s][queues][agentconnect]',_0x209709[_0x5a0b('0x4')]),_0x209709);utils[_0x5a0b('0x1')](util[_0x5a0b('0x2')](_0x5a0b('0x35'),_0x209709[_0x5a0b('0x4')],queues[_0x209709[_0x5a0b('0x4')]][_0x5a0b('0x1f')],_0x209709['membername'],_0x209709[_0x5a0b('0x36')]));queues[_0x209709[_0x5a0b('0x4')]][_0x5a0b('0x19')]=![];queues[_0x209709['uniqueid']][_0x5a0b('0x19')]=![];queues[_0x209709[_0x5a0b('0x4')]][_0x5a0b('0x27')]=null;queues[_0x209709[_0x5a0b('0x4')]]['queuecallerexit']=![];queues[_0x209709[_0x5a0b('0x4')]]['queuecallerexitreason']=null;queues[_0x209709[_0x5a0b('0x4')]]['queuecallerexitAt']=null;queues[_0x209709['uniqueid']]['assigned']=!![];queues[_0x209709['uniqueid']][_0x5a0b('0x7')]=_0x209709['destaccountcode'];queues[_0x209709['uniqueid']][_0x5a0b('0x5')]=_0x209709[_0x5a0b('0x37')];}}catch(_0x5f20ac){utils[_0x5a0b('0x16')](util[_0x5a0b('0x2')](_0x5a0b('0x38'),_0x209709[_0x5a0b('0x4')]),_0x5f20ac);}};exports['agentcomplete']=function(_0x298cf7){try{if(!_[_0x5a0b('0x17')](queues[_0x298cf7[_0x5a0b('0x4')]])){if(queues[_0x298cf7['uniqueid']]['queuecallerleaveAt']){utils[_0x5a0b('0x10')](util[_0x5a0b('0x2')]('[%s][queues][agentcomplete]',_0x298cf7[_0x5a0b('0x4')]),_0x298cf7);queues[_0x298cf7[_0x5a0b('0x4')]][_0x5a0b('0x19')]=![];queues[_0x298cf7['uniqueid']]['queuecallerabandon']=![];queues[_0x298cf7['uniqueid']][_0x5a0b('0x27')]=null;queues[_0x298cf7['uniqueid']][_0x5a0b('0x1a')]=![];queues[_0x298cf7['uniqueid']][_0x5a0b('0x28')]=null;queues[_0x298cf7[_0x5a0b('0x4')]]['assigned']=!![];queues[_0x298cf7[_0x5a0b('0x4')]][_0x5a0b('0x5')]=_0x298cf7['membername'];queues[_0x298cf7[_0x5a0b('0x4')]]['queuecallercomplete']=!![];queues[_0x298cf7[_0x5a0b('0x4')]][_0x5a0b('0x1c')]=utils['now']();if(_0x298cf7[_0x5a0b('0x39')]==_0x5a0b('0x3a')){if(!queues[_0x298cf7[_0x5a0b('0x4')]]['transfer']){queues[_0x298cf7[_0x5a0b('0x4')]]['queuecallerexitreason']=_0x5a0b('0x3b');}}else{queues[_0x298cf7[_0x5a0b('0x4')]][_0x5a0b('0x8')]=_0x5a0b('0x3c')+_0x298cf7[_0x5a0b('0x39')][_0x5a0b('0x26')]();}utils[_0x5a0b('0x1')](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x298cf7[_0x5a0b('0x4')],queues[_0x298cf7[_0x5a0b('0x4')]][_0x5a0b('0x1f')],_0x298cf7[_0x5a0b('0x37')],queues[_0x298cf7[_0x5a0b('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x298cf7[_0x5a0b('0x4')]]);}}}catch(_0x5d2f8d){utils[_0x5a0b('0x16')](util['format'](_0x5a0b('0x3d'),_0x298cf7[_0x5a0b('0x4')]),_0x5d2f8d);}};exports['blindtransfer']=function(_0x540db9){try{if(!_[_0x5a0b('0x17')](queues[_0x540db9[_0x5a0b('0x3e')]])){utils['debug'](util[_0x5a0b('0x2')]('[%s][queues][blindtransfer]',_0x540db9['uniqueid']),_0x540db9);queues[_0x540db9[_0x5a0b('0x3e')]][_0x5a0b('0x3a')]=!![];queues[_0x540db9[_0x5a0b('0x3e')]][_0x5a0b('0x3f')]='BLIND';queues[_0x540db9[_0x5a0b('0x3e')]][_0x5a0b('0x40')]=_0x540db9[_0x5a0b('0x41')];queues[_0x540db9['transfereeuniqueid']][_0x5a0b('0x42')]=_0x540db9[_0x5a0b('0x3e')];queues[_0x540db9[_0x5a0b('0x3e')]][_0x5a0b('0x8')]=_0x5a0b('0x43');utils['info'](util['format'](_0x5a0b('0x44'),_0x540db9[_0x5a0b('0x4')],queues[_0x540db9['transfereeuniqueid']][_0x5a0b('0x1f')],_0x540db9[_0x5a0b('0x3e')],_0x540db9[_0x5a0b('0x41')]));}}catch(_0x245988){utils[_0x5a0b('0x16')](util[_0x5a0b('0x2')](_0x5a0b('0x45'),_0x540db9[_0x5a0b('0x4')]),_0x245988);}};exports[_0x5a0b('0x46')]=function(_0x1876f8){try{utils[_0x5a0b('0x10')](util['format'](_0x5a0b('0x47'),_0x1876f8[_0x5a0b('0x48')]),_0x1876f8);if(_0x1876f8[_0x5a0b('0x48')]==_0x1876f8[_0x5a0b('0x49')]){if(!_['isNil'](queues[_0x1876f8[_0x5a0b('0x4a')]])){utils[_0x5a0b('0x1')](util[_0x5a0b('0x2')](_0x5a0b('0x4b'),_0x1876f8['origtransfereruniqueid'],queues[_0x1876f8[_0x5a0b('0x4a')]]['name'],_0x1876f8[_0x5a0b('0x4c')]));queues[_0x1876f8[_0x5a0b('0x4a')]][_0x5a0b('0x3a')]=!![];queues[_0x1876f8['secondtransfererlinkedid']]['transfertype']='ATTENDED';queues[_0x1876f8[_0x5a0b('0x4a')]][_0x5a0b('0x40')]=_0x1876f8[_0x5a0b('0x4c')];queues[_0x1876f8['secondtransfererlinkedid']][_0x5a0b('0x42')]=_0x1876f8[_0x5a0b('0x48')];queues[_0x1876f8[_0x5a0b('0x4a')]]['queuecallerexitreason']=_0x5a0b('0x4d');}if(!_[_0x5a0b('0x17')](queues[_0x1876f8[_0x5a0b('0x49')]])){if(_0x1876f8[_0x5a0b('0x4e')]&&queues[_0x1876f8[_0x5a0b('0x4e')]]){queues[_0x1876f8[_0x5a0b('0x4e')]]['queuecallerenterreason']=0x1;queues[_0x1876f8[_0x5a0b('0x3e')]]=_[_0x5a0b('0x4f')](queues[_0x1876f8['transfereelinkedid']]);queues[_0x1876f8[_0x5a0b('0x3e')]][_0x5a0b('0xf')]=_0x1876f8[_0x5a0b('0x50')];queues[_0x1876f8[_0x5a0b('0x3e')]]['queuecallerenterreason']=0x2;queues[_0x1876f8['transfereeuniqueid']][_0x5a0b('0x6')]=queues[_0x1876f8[_0x5a0b('0x4a')]][_0x5a0b('0x6')];queues[_0x1876f8[_0x5a0b('0x3e')]][_0x5a0b('0x51')]=queues[_0x1876f8[_0x5a0b('0x4a')]][_0x5a0b('0x51')];queues[_0x1876f8['transfereeuniqueid']][_0x5a0b('0x32')]=utils['now']();queues[_0x1876f8['transfereeuniqueid']]['queuecallerleaveAt']=utils['now']();queues[_0x1876f8[_0x5a0b('0x3e')]][_0x5a0b('0x52')]=0x0;queues[_0x1876f8[_0x5a0b('0x3e')]][_0x5a0b('0x53')]=0x0;utils[_0x5a0b('0x1')](util[_0x5a0b('0x2')](_0x5a0b('0x54'),_0x1876f8[_0x5a0b('0x48')],queues[_0x1876f8[_0x5a0b('0x3e')]][_0x5a0b('0x1f')],queues[_0x1876f8[_0x5a0b('0x3e')]][_0x5a0b('0x6')],queues[_0x1876f8['transfereeuniqueid']][_0x5a0b('0x51')]));}else{utils[_0x5a0b('0x1')](util[_0x5a0b('0x2')](_0x5a0b('0x55'),_0x1876f8['origtransfereruniqueid'],queues[_0x1876f8[_0x5a0b('0x49')]][_0x5a0b('0x1f')],_0x1876f8[_0x5a0b('0x4a')]));queues[_0x1876f8[_0x5a0b('0x49')]][_0x5a0b('0xf')]=_0x1876f8[_0x5a0b('0x4a')];}}}else if(_0x1876f8['secondtransfereruniqueid']==_0x1876f8[_0x5a0b('0x4a')]){if(!_[_0x5a0b('0x17')](queues[_0x1876f8['origtransfererlinkedid']])){utils['info'](util[_0x5a0b('0x2')](_0x5a0b('0x56'),_0x1876f8['origtransfereruniqueid'],queues[_0x1876f8[_0x5a0b('0x49')]]['name'],_0x1876f8['secondtransfereruniqueid'],_0x1876f8['secondtransfererexten']));queues[_0x1876f8[_0x5a0b('0x49')]][_0x5a0b('0x3a')]=!![];queues[_0x1876f8['origtransfererlinkedid']][_0x5a0b('0x3f')]=_0x5a0b('0x57');queues[_0x1876f8['origtransfererlinkedid']][_0x5a0b('0x40')]=_0x1876f8[_0x5a0b('0x58')];queues[_0x1876f8[_0x5a0b('0x49')]][_0x5a0b('0x42')]=_0x1876f8[_0x5a0b('0x59')];queues[_0x1876f8['origtransfererlinkedid']]['queuecallerexitreason']=_0x5a0b('0x4d');}if(!_[_0x5a0b('0x17')](queues[_0x1876f8['secondtransfererlinkedid']])){if(_0x1876f8[_0x5a0b('0x5a')]&&queues[_0x1876f8['transfertargetlinkedid']]){queues[_0x1876f8[_0x5a0b('0x5a')]]['queuecallerenterreason']=0x1;queues[_0x1876f8['transfertargetuniqueid']]=_[_0x5a0b('0x4f')](queues[_0x1876f8[_0x5a0b('0x5a')]]);queues[_0x1876f8[_0x5a0b('0x50')]][_0x5a0b('0xf')]=_0x1876f8['transfertargetuniqueid'];queues[_0x1876f8[_0x5a0b('0x50')]][_0x5a0b('0x5b')]=0x2;queues[_0x1876f8[_0x5a0b('0x50')]][_0x5a0b('0x6')]=queues[_0x1876f8['origtransfererlinkedid']][_0x5a0b('0x6')];queues[_0x1876f8[_0x5a0b('0x50')]][_0x5a0b('0x51')]=queues[_0x1876f8[_0x5a0b('0x49')]][_0x5a0b('0x51')];queues[_0x1876f8[_0x5a0b('0x50')]][_0x5a0b('0x32')]=utils[_0x5a0b('0x15')]();queues[_0x1876f8[_0x5a0b('0x50')]]['queuecallerleaveAt']=utils[_0x5a0b('0x15')]();queues[_0x1876f8[_0x5a0b('0x50')]]['holdtime']=0x0;queues[_0x1876f8[_0x5a0b('0x50')]][_0x5a0b('0x53')]=0x0;utils[_0x5a0b('0x1')](util[_0x5a0b('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x1876f8[_0x5a0b('0x48')],queues[_0x1876f8[_0x5a0b('0x50')]][_0x5a0b('0x1f')],queues[_0x1876f8['transfertargetuniqueid']][_0x5a0b('0xf')],queues[_0x1876f8[_0x5a0b('0x50')]][_0x5a0b('0x6')],queues[_0x1876f8['transfertargetuniqueid']]['calleridname']));}else{utils[_0x5a0b('0x1')](util[_0x5a0b('0x2')](_0x5a0b('0x55'),_0x1876f8[_0x5a0b('0x48')],queues[_0x1876f8[_0x5a0b('0x4a')]]['name'],_0x1876f8[_0x5a0b('0x49')]));queues[_0x1876f8[_0x5a0b('0x4a')]][_0x5a0b('0xf')]=_0x1876f8[_0x5a0b('0x49')];}}}}catch(_0x54e401){utils[_0x5a0b('0x16')](util['format'](_0x5a0b('0x47'),_0x1876f8[_0x5a0b('0x48')]),_0x54e401);}};exports['musiconholdstart']=function(_0x1cbfc8){try{if(!_[_0x5a0b('0x17')](queues[_0x1cbfc8[_0x5a0b('0x4')]])){utils['debug'](util[_0x5a0b('0x2')](_0x5a0b('0x5c'),_0x1cbfc8['uniqueid']),_0x1cbfc8);queues[_0x1cbfc8[_0x5a0b('0x4')]][_0x5a0b('0x5d')]=utils[_0x5a0b('0x15')]();utils[_0x5a0b('0x1')](util[_0x5a0b('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x1cbfc8['uniqueid'],queues[_0x1cbfc8[_0x5a0b('0x4')]]['name'],queues[_0x1cbfc8[_0x5a0b('0x4')]][_0x5a0b('0x5d')]));}}catch(_0x2ba68a){utils['error'](util[_0x5a0b('0x2')](_0x5a0b('0x5c'),_0x1cbfc8[_0x5a0b('0x4')]),_0x2ba68a);}};exports[_0x5a0b('0x5e')]=function(_0x3cf7ad){try{if(!_[_0x5a0b('0x17')](queues[_0x3cf7ad[_0x5a0b('0x4')]])){if(!_[_0x5a0b('0x17')](queues[_0x3cf7ad[_0x5a0b('0x4')]][_0x5a0b('0x5d')])){utils[_0x5a0b('0x10')](util[_0x5a0b('0x2')](_0x5a0b('0x5f'),_0x3cf7ad[_0x5a0b('0x4')]),_0x3cf7ad);queues[_0x3cf7ad[_0x5a0b('0x4')]][_0x5a0b('0x53')]+=utils[_0x5a0b('0x31')](utils['now'](),queues[_0x3cf7ad[_0x5a0b('0x4')]][_0x5a0b('0x5d')]);utils[_0x5a0b('0x1')](util[_0x5a0b('0x2')](_0x5a0b('0x60'),_0x3cf7ad[_0x5a0b('0x4')],queues[_0x3cf7ad[_0x5a0b('0x4')]]['name'],queues[_0x3cf7ad[_0x5a0b('0x4')]]['mohtime']));delete queues[_0x3cf7ad[_0x5a0b('0x4')]][_0x5a0b('0x5d')];}}}catch(_0x4dcede){utils[_0x5a0b('0x16')](util[_0x5a0b('0x2')](_0x5a0b('0x5f'),_0x3cf7ad[_0x5a0b('0x4')]),_0x4dcede);}}; \ No newline at end of file +var _0x4d2c=['reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','transferexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','hangup','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','isNil','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','error','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','queuecallerjoinAt','position','count','connectedlinename','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','agentcomplete'];(function(_0x258323,_0x483093){var _0x49e0e1=function(_0x4950dd){while(--_0x4950dd){_0x258323['push'](_0x258323['shift']());}};_0x49e0e1(++_0x483093);}(_0x4d2c,0x1ed));var _0xc4d2=function(_0x34cea1,_0x16d860){_0x34cea1=_0x34cea1-0x0;var _0x2d796a=_0x4d2c[_0x34cea1];return _0x2d796a;};'use strict';var _=require(_0xc4d2('0x0'));var util=require(_0xc4d2('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x1d4384){utils[_0xc4d2('0x2')](util[_0xc4d2('0x3')](_0xc4d2('0x4'),_0x1d4384[_0xc4d2('0x5')],_0x1d4384[_0xc4d2('0x6')],_0x1d4384[_0xc4d2('0x7')],_0x1d4384[_0xc4d2('0x8')],_0x1d4384[_0xc4d2('0x9')],_0x1d4384[_0xc4d2('0xa')],_0x1d4384[_0xc4d2('0xb')]));if(_0x1d4384[_0xc4d2('0x7')]){utils[_0xc4d2('0xc')](_0x1d4384[_0xc4d2('0x7')])[_0xc4d2('0xd')](function(_0x370735){if(_0x370735){_0x1d4384['type']=_0x370735['type'];}utils[_0xc4d2('0xe')](_0xc4d2('0xf'),_0x1d4384);});}else{utils[_0xc4d2('0xe')](_0xc4d2('0xf'),_0x1d4384);}if(_0x1d4384[_0xc4d2('0x10')]){delete queues[_0x1d4384['transfereduniqueid']];}else{delete queues[_0x1d4384[_0xc4d2('0x5')]];}}exports[_0xc4d2('0x11')]=function(_0x38026d){try{utils[_0xc4d2('0x12')](util['format'](_0xc4d2('0x13'),_0x38026d[_0xc4d2('0x5')]),_0x38026d);utils[_0xc4d2('0x2')](util[_0xc4d2('0x3')](_0xc4d2('0x14'),_0x38026d[_0xc4d2('0x5')],_0x38026d[_0xc4d2('0x7')],_0x38026d['position']));queues[_0x38026d[_0xc4d2('0x5')]]=_[_0xc4d2('0x15')](_0x38026d,{'originalposition':_0x38026d['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x6e4c9e){utils['error'](util[_0xc4d2('0x3')](_0xc4d2('0x13'),_0x38026d[_0xc4d2('0x5')]),_0x6e4c9e);}};exports[_0xc4d2('0x16')]=function(_0x12825e){try{if(!_['isNil'](queues[_0x12825e[_0xc4d2('0x5')]])){utils[_0xc4d2('0x12')](util['format']('[%s][queues][hangup]',_0x12825e[_0xc4d2('0x5')]),_0x12825e);if(queues[_0x12825e[_0xc4d2('0x5')]][_0xc4d2('0x17')]){if(!queues[_0x12825e['uniqueid']][_0xc4d2('0x18')]&&!queues[_0x12825e['uniqueid']]['queuecallerexit']){queues[_0x12825e[_0xc4d2('0x5')]][_0xc4d2('0x19')]=!![];queues[_0x12825e['uniqueid']][_0xc4d2('0x1a')]=utils[_0xc4d2('0x1b')]();queues[_0x12825e[_0xc4d2('0x5')]][_0xc4d2('0xb')]=_0xc4d2('0x1c');}utils[_0xc4d2('0x2')](util[_0xc4d2('0x3')](_0xc4d2('0x1d'),_0x12825e[_0xc4d2('0x5')],queues[_0x12825e[_0xc4d2('0x5')]][_0xc4d2('0x1e')],queues[_0x12825e[_0xc4d2('0x5')]][_0xc4d2('0xb')]));writeDB(queues[_0x12825e['uniqueid']]);}else if(queues[_0x12825e[_0xc4d2('0x5')]][_0xc4d2('0x10')]){utils[_0xc4d2('0x2')](util[_0xc4d2('0x3')](_0xc4d2('0x1f'),_0x12825e[_0xc4d2('0x5')],queues[_0x12825e[_0xc4d2('0x5')]]['name'],queues[_0x12825e['uniqueid']]['transfereduniqueid']));queues[queues[_0x12825e['uniqueid']][_0xc4d2('0x10')]]=queues[_0x12825e[_0xc4d2('0x5')]];queues[queues[_0x12825e[_0xc4d2('0x5')]][_0xc4d2('0x10')]][_0xc4d2('0x20')]=0x2;delete queues[_0x12825e[_0xc4d2('0x5')]];}}}catch(_0x3c38b7){utils['error'](util[_0xc4d2('0x3')](_0xc4d2('0x21'),_0x12825e[_0xc4d2('0x5')]),_0x3c38b7);}};exports[_0xc4d2('0x22')]=function(_0x191611){try{utils['debug'](util[_0xc4d2('0x3')](_0xc4d2('0x23'),_0x191611[_0xc4d2('0x5')]),_0x191611);if(!_[_0xc4d2('0x24')](_0x191611[_0xc4d2('0x25')][_0xc4d2('0x26')])&&_0x191611['value'][_0xc4d2('0x27')]()!==_0xc4d2('0x28')){if(!_[_0xc4d2('0x24')](queues[_0x191611['uniqueid']])){queues[_0x191611['uniqueid']][_0xc4d2('0x18')]=![];queues[_0x191611[_0xc4d2('0x5')]][_0xc4d2('0x29')]=null;queues[_0x191611[_0xc4d2('0x5')]][_0xc4d2('0x2a')]=!![];queues[_0x191611[_0xc4d2('0x5')]][_0xc4d2('0x2b')]=utils[_0xc4d2('0x1b')]();queues[_0x191611[_0xc4d2('0x5')]]['queuecallerexitreason']=_0x191611[_0xc4d2('0x2c')][_0xc4d2('0x27')]();utils['info'](util[_0xc4d2('0x3')](_0xc4d2('0x2d'),_0x191611[_0xc4d2('0x5')],queues[_0x191611[_0xc4d2('0x5')]][_0xc4d2('0x1e')],_0x191611[_0xc4d2('0x2c')],queues[_0x191611[_0xc4d2('0x5')]][_0xc4d2('0xb')]));writeDB(queues[_0x191611['uniqueid']]);}}else if(!_[_0xc4d2('0x24')](_0x191611[_0xc4d2('0x25')][_0xc4d2('0x2e')])){if(!_[_0xc4d2('0x24')](queues[_0x191611[_0xc4d2('0x5')]])&&!queues[_0x191611[_0xc4d2('0x5')]][_0xc4d2('0x18')]){queues[_0x191611[_0xc4d2('0x5')]][_0xc4d2('0x18')]=![];queues[_0x191611[_0xc4d2('0x5')]][_0xc4d2('0x29')]=null;queues[_0x191611['uniqueid']][_0xc4d2('0x2a')]=!![];queues[_0x191611[_0xc4d2('0x5')]]['queuecallerexitAt']=utils[_0xc4d2('0x1b')]();queues[_0x191611[_0xc4d2('0x5')]][_0xc4d2('0xb')]='EXITWITHKEY';utils['info'](util[_0xc4d2('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x191611[_0xc4d2('0x5')],queues[_0x191611[_0xc4d2('0x5')]][_0xc4d2('0x1e')],_0x191611[_0xc4d2('0x2c')],queues[_0x191611['uniqueid']][_0xc4d2('0xb')]));}}}catch(_0x2a7d37){utils[_0xc4d2('0x2f')](util[_0xc4d2('0x3')](_0xc4d2('0x23'),_0x191611[_0xc4d2('0x5')]),_0x2a7d37);}};exports[_0xc4d2('0x18')]=function(_0x1c1a58){try{if(!_[_0xc4d2('0x24')](queues[_0x1c1a58[_0xc4d2('0x5')]])){utils[_0xc4d2('0x12')](util[_0xc4d2('0x3')]('[%s][queues][queuecallerabandon]',_0x1c1a58[_0xc4d2('0x5')]),_0x1c1a58);queues[_0x1c1a58[_0xc4d2('0x5')]][_0xc4d2('0x2a')]=![];queues[_0x1c1a58[_0xc4d2('0x5')]][_0xc4d2('0x2b')]=null;queues[_0x1c1a58[_0xc4d2('0x5')]][_0xc4d2('0x18')]=!![];queues[_0x1c1a58[_0xc4d2('0x5')]]['queuecallerabandonAt']=utils[_0xc4d2('0x1b')]();queues[_0x1c1a58[_0xc4d2('0x5')]][_0xc4d2('0xb')]=_0xc4d2('0x30');utils[_0xc4d2('0x2')](util[_0xc4d2('0x3')](_0xc4d2('0x31'),_0x1c1a58['uniqueid'],queues[_0x1c1a58['uniqueid']][_0xc4d2('0x1e')],queues[_0x1c1a58[_0xc4d2('0x5')]][_0xc4d2('0xb')]));}}catch(_0x3b8471){utils[_0xc4d2('0x2f')](util[_0xc4d2('0x3')](_0xc4d2('0x32'),_0x1c1a58['uniqueid']),_0x3b8471);}};exports[_0xc4d2('0x33')]=function(_0x5cb7f3){try{if(!_[_0xc4d2('0x24')](queues[_0x5cb7f3['uniqueid']])){utils[_0xc4d2('0x12')](util['format']('[%s][queues][queuecallerleave]',_0x5cb7f3[_0xc4d2('0x5')]),_0x5cb7f3);utils[_0xc4d2('0x2')](util['format'](_0xc4d2('0x34'),_0x5cb7f3[_0xc4d2('0x5')],queues[_0x5cb7f3[_0xc4d2('0x5')]][_0xc4d2('0x1e')],_0x5cb7f3[_0xc4d2('0x35')],_0x5cb7f3['connectedlinename']));queues[_0x5cb7f3[_0xc4d2('0x5')]][_0xc4d2('0x33')]=!![];queues[_0x5cb7f3[_0xc4d2('0x5')]][_0xc4d2('0x17')]=utils[_0xc4d2('0x1b')]();queues[_0x5cb7f3[_0xc4d2('0x5')]][_0xc4d2('0x36')]=utils['diffTime'](queues[_0x5cb7f3[_0xc4d2('0x5')]][_0xc4d2('0x17')],queues[_0x5cb7f3[_0xc4d2('0x5')]][_0xc4d2('0x37')]);queues[_0x5cb7f3[_0xc4d2('0x5')]][_0xc4d2('0x38')]=_0x5cb7f3[_0xc4d2('0x38')];queues[_0x5cb7f3[_0xc4d2('0x5')]][_0xc4d2('0x39')]=_0x5cb7f3['count'];queues[_0x5cb7f3[_0xc4d2('0x5')]][_0xc4d2('0x35')]=_0x5cb7f3[_0xc4d2('0x35')];queues[_0x5cb7f3[_0xc4d2('0x5')]][_0xc4d2('0x3a')]=_0x5cb7f3[_0xc4d2('0x3a')];}}catch(_0xf2c79c){utils['error'](util[_0xc4d2('0x3')](_0xc4d2('0x3b'),_0x5cb7f3['uniqueid']),_0xf2c79c);}};exports[_0xc4d2('0x3c')]=function(_0x4289d3){try{if(!_[_0xc4d2('0x24')](queues[_0x4289d3['uniqueid']])){utils[_0xc4d2('0x12')](util[_0xc4d2('0x3')]('[%s][queues][agentconnect]',_0x4289d3[_0xc4d2('0x5')]),_0x4289d3);utils[_0xc4d2('0x2')](util['format'](_0xc4d2('0x3d'),_0x4289d3['uniqueid'],queues[_0x4289d3[_0xc4d2('0x5')]]['name'],_0x4289d3[_0xc4d2('0x3e')],_0x4289d3[_0xc4d2('0x3f')]));queues[_0x4289d3[_0xc4d2('0x5')]][_0xc4d2('0x18')]=![];queues[_0x4289d3['uniqueid']][_0xc4d2('0x18')]=![];queues[_0x4289d3['uniqueid']][_0xc4d2('0x29')]=null;queues[_0x4289d3['uniqueid']]['queuecallerexit']=![];queues[_0x4289d3[_0xc4d2('0x5')]]['queuecallerexitreason']=null;queues[_0x4289d3['uniqueid']]['queuecallerexitAt']=null;queues[_0x4289d3[_0xc4d2('0x5')]][_0xc4d2('0x40')]=!![];queues[_0x4289d3['uniqueid']][_0xc4d2('0xa')]=_0x4289d3['destaccountcode'];queues[_0x4289d3['uniqueid']]['lastAssignedTo']=_0x4289d3[_0xc4d2('0x3e')];}}catch(_0x769ea0){utils[_0xc4d2('0x2f')](util['format'](_0xc4d2('0x41'),_0x4289d3['uniqueid']),_0x769ea0);}};exports[_0xc4d2('0x42')]=function(_0x541198){try{if(!_[_0xc4d2('0x24')](queues[_0x541198[_0xc4d2('0x5')]])){if(queues[_0x541198['uniqueid']][_0xc4d2('0x17')]){utils['debug'](util[_0xc4d2('0x3')]('[%s][queues][agentcomplete]',_0x541198[_0xc4d2('0x5')]),_0x541198);queues[_0x541198[_0xc4d2('0x5')]][_0xc4d2('0x18')]=![];queues[_0x541198[_0xc4d2('0x5')]][_0xc4d2('0x18')]=![];queues[_0x541198[_0xc4d2('0x5')]][_0xc4d2('0x29')]=null;queues[_0x541198[_0xc4d2('0x5')]]['queuecallerexit']=![];queues[_0x541198[_0xc4d2('0x5')]][_0xc4d2('0x2b')]=null;queues[_0x541198['uniqueid']][_0xc4d2('0x40')]=!![];queues[_0x541198[_0xc4d2('0x5')]][_0xc4d2('0x8')]=_0x541198['membername'];queues[_0x541198[_0xc4d2('0x5')]]['queuecallercomplete']=!![];queues[_0x541198[_0xc4d2('0x5')]][_0xc4d2('0x1a')]=utils[_0xc4d2('0x1b')]();if(_0x541198[_0xc4d2('0x43')]==_0xc4d2('0x44')){if(!queues[_0x541198['uniqueid']][_0xc4d2('0x44')]){queues[_0x541198[_0xc4d2('0x5')]][_0xc4d2('0xb')]=_0xc4d2('0x45');}}else{queues[_0x541198[_0xc4d2('0x5')]]['queuecallerexitreason']=_0xc4d2('0x46')+_0x541198[_0xc4d2('0x43')][_0xc4d2('0x27')]();}utils[_0xc4d2('0x2')](util[_0xc4d2('0x3')](_0xc4d2('0x47'),_0x541198[_0xc4d2('0x5')],queues[_0x541198[_0xc4d2('0x5')]][_0xc4d2('0x1e')],_0x541198[_0xc4d2('0x3e')],queues[_0x541198[_0xc4d2('0x5')]][_0xc4d2('0xb')]));writeDB(queues[_0x541198['uniqueid']]);}}}catch(_0x53d6c6){utils[_0xc4d2('0x2f')](util['format'](_0xc4d2('0x48'),_0x541198[_0xc4d2('0x5')]),_0x53d6c6);}};exports[_0xc4d2('0x49')]=function(_0x34a8c1){try{if(!_[_0xc4d2('0x24')](queues[_0x34a8c1[_0xc4d2('0x4a')]])){utils[_0xc4d2('0x12')](util['format'](_0xc4d2('0x4b'),_0x34a8c1[_0xc4d2('0x5')]),_0x34a8c1);queues[_0x34a8c1[_0xc4d2('0x4a')]][_0xc4d2('0x44')]=!![];queues[_0x34a8c1[_0xc4d2('0x4a')]][_0xc4d2('0x4c')]=_0xc4d2('0x4d');queues[_0x34a8c1[_0xc4d2('0x4a')]]['transferexten']=_0x34a8c1[_0xc4d2('0x4e')];queues[_0x34a8c1[_0xc4d2('0x4a')]][_0xc4d2('0x4f')]=_0x34a8c1[_0xc4d2('0x4a')];queues[_0x34a8c1['transfereeuniqueid']][_0xc4d2('0xb')]=_0xc4d2('0x50');utils[_0xc4d2('0x2')](util[_0xc4d2('0x3')](_0xc4d2('0x51'),_0x34a8c1[_0xc4d2('0x5')],queues[_0x34a8c1[_0xc4d2('0x4a')]]['name'],_0x34a8c1[_0xc4d2('0x4a')],_0x34a8c1[_0xc4d2('0x4e')]));}}catch(_0x316c0e){utils[_0xc4d2('0x2f')](util[_0xc4d2('0x3')](_0xc4d2('0x4b'),_0x34a8c1[_0xc4d2('0x5')]),_0x316c0e);}};exports[_0xc4d2('0x52')]=function(_0x45acff){try{utils[_0xc4d2('0x12')](util['format']('[%s][queues][attendedtransfer]',_0x45acff['origtransfereruniqueid']),_0x45acff);if(_0x45acff[_0xc4d2('0x53')]==_0x45acff['origtransfererlinkedid']){if(!_[_0xc4d2('0x24')](queues[_0x45acff['secondtransfererlinkedid']])){utils[_0xc4d2('0x2')](util[_0xc4d2('0x3')](_0xc4d2('0x54'),_0x45acff[_0xc4d2('0x53')],queues[_0x45acff[_0xc4d2('0x55')]][_0xc4d2('0x1e')],_0x45acff[_0xc4d2('0x56')]));queues[_0x45acff[_0xc4d2('0x55')]][_0xc4d2('0x44')]=!![];queues[_0x45acff[_0xc4d2('0x55')]][_0xc4d2('0x4c')]='ATTENDED';queues[_0x45acff[_0xc4d2('0x55')]][_0xc4d2('0x57')]=_0x45acff[_0xc4d2('0x56')];queues[_0x45acff[_0xc4d2('0x55')]][_0xc4d2('0x4f')]=_0x45acff[_0xc4d2('0x53')];queues[_0x45acff[_0xc4d2('0x55')]][_0xc4d2('0xb')]=_0xc4d2('0x58');}if(!_['isNil'](queues[_0x45acff[_0xc4d2('0x59')]])){if(_0x45acff[_0xc4d2('0x5a')]&&queues[_0x45acff[_0xc4d2('0x5a')]]){queues[_0x45acff[_0xc4d2('0x5a')]][_0xc4d2('0x20')]=0x1;queues[_0x45acff[_0xc4d2('0x4a')]]=_[_0xc4d2('0x5b')](queues[_0x45acff[_0xc4d2('0x5a')]]);queues[_0x45acff[_0xc4d2('0x4a')]][_0xc4d2('0x10')]=_0x45acff[_0xc4d2('0x5c')];queues[_0x45acff[_0xc4d2('0x4a')]][_0xc4d2('0x20')]=0x2;queues[_0x45acff[_0xc4d2('0x4a')]][_0xc4d2('0x9')]=queues[_0x45acff[_0xc4d2('0x55')]][_0xc4d2('0x9')];queues[_0x45acff['transfereeuniqueid']]['calleridname']=queues[_0x45acff[_0xc4d2('0x55')]][_0xc4d2('0x5d')];queues[_0x45acff['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0xc4d2('0x1b')]();queues[_0x45acff[_0xc4d2('0x4a')]]['queuecallerleaveAt']=utils[_0xc4d2('0x1b')]();queues[_0x45acff['transfereeuniqueid']][_0xc4d2('0x36')]=0x0;queues[_0x45acff[_0xc4d2('0x4a')]][_0xc4d2('0x5e')]=0x0;utils[_0xc4d2('0x2')](util[_0xc4d2('0x3')](_0xc4d2('0x5f'),_0x45acff['origtransfereruniqueid'],queues[_0x45acff[_0xc4d2('0x4a')]]['name'],queues[_0x45acff[_0xc4d2('0x4a')]][_0xc4d2('0x9')],queues[_0x45acff[_0xc4d2('0x4a')]]['calleridname']));}else{utils[_0xc4d2('0x2')](util['format'](_0xc4d2('0x60'),_0x45acff[_0xc4d2('0x53')],queues[_0x45acff['origtransfererlinkedid']]['name'],_0x45acff['secondtransfererlinkedid']));queues[_0x45acff[_0xc4d2('0x59')]][_0xc4d2('0x10')]=_0x45acff[_0xc4d2('0x55')];}}}else if(_0x45acff[_0xc4d2('0x61')]==_0x45acff[_0xc4d2('0x55')]){if(!_[_0xc4d2('0x24')](queues[_0x45acff['origtransfererlinkedid']])){utils[_0xc4d2('0x2')](util[_0xc4d2('0x3')](_0xc4d2('0x62'),_0x45acff[_0xc4d2('0x53')],queues[_0x45acff['origtransfererlinkedid']][_0xc4d2('0x1e')],_0x45acff[_0xc4d2('0x61')],_0x45acff['secondtransfererexten']));queues[_0x45acff[_0xc4d2('0x59')]][_0xc4d2('0x44')]=!![];queues[_0x45acff[_0xc4d2('0x59')]][_0xc4d2('0x4c')]=_0xc4d2('0x63');queues[_0x45acff[_0xc4d2('0x59')]][_0xc4d2('0x57')]=_0x45acff[_0xc4d2('0x64')];queues[_0x45acff['origtransfererlinkedid']][_0xc4d2('0x4f')]=_0x45acff['secondtransfereruniqueid'];queues[_0x45acff[_0xc4d2('0x59')]]['queuecallerexitreason']=_0xc4d2('0x58');}if(!_[_0xc4d2('0x24')](queues[_0x45acff[_0xc4d2('0x55')]])){if(_0x45acff[_0xc4d2('0x65')]&&queues[_0x45acff[_0xc4d2('0x65')]]){queues[_0x45acff[_0xc4d2('0x65')]][_0xc4d2('0x20')]=0x1;queues[_0x45acff[_0xc4d2('0x5c')]]=_[_0xc4d2('0x5b')](queues[_0x45acff[_0xc4d2('0x65')]]);queues[_0x45acff[_0xc4d2('0x5c')]]['transfereduniqueid']=_0x45acff[_0xc4d2('0x5c')];queues[_0x45acff[_0xc4d2('0x5c')]][_0xc4d2('0x20')]=0x2;queues[_0x45acff[_0xc4d2('0x5c')]][_0xc4d2('0x9')]=queues[_0x45acff[_0xc4d2('0x59')]][_0xc4d2('0x9')];queues[_0x45acff['transfertargetuniqueid']][_0xc4d2('0x5d')]=queues[_0x45acff[_0xc4d2('0x59')]]['calleridname'];queues[_0x45acff[_0xc4d2('0x5c')]][_0xc4d2('0x37')]=utils[_0xc4d2('0x1b')]();queues[_0x45acff[_0xc4d2('0x5c')]][_0xc4d2('0x17')]=utils[_0xc4d2('0x1b')]();queues[_0x45acff[_0xc4d2('0x5c')]][_0xc4d2('0x36')]=0x0;queues[_0x45acff[_0xc4d2('0x5c')]]['mohtime']=0x0;utils['info'](util[_0xc4d2('0x3')](_0xc4d2('0x66'),_0x45acff[_0xc4d2('0x53')],queues[_0x45acff['transfertargetuniqueid']][_0xc4d2('0x1e')],queues[_0x45acff[_0xc4d2('0x5c')]][_0xc4d2('0x10')],queues[_0x45acff[_0xc4d2('0x5c')]]['calleridnum'],queues[_0x45acff[_0xc4d2('0x5c')]][_0xc4d2('0x5d')]));}else{utils[_0xc4d2('0x2')](util[_0xc4d2('0x3')](_0xc4d2('0x60'),_0x45acff[_0xc4d2('0x53')],queues[_0x45acff[_0xc4d2('0x55')]]['name'],_0x45acff[_0xc4d2('0x59')]));queues[_0x45acff[_0xc4d2('0x55')]][_0xc4d2('0x10')]=_0x45acff[_0xc4d2('0x59')];}}}}catch(_0x274d94){utils[_0xc4d2('0x2f')](util[_0xc4d2('0x3')](_0xc4d2('0x67'),_0x45acff[_0xc4d2('0x53')]),_0x274d94);}};exports[_0xc4d2('0x68')]=function(_0x5236e5){try{if(!_['isNil'](queues[_0x5236e5[_0xc4d2('0x5')]])){utils[_0xc4d2('0x12')](util['format'](_0xc4d2('0x69'),_0x5236e5['uniqueid']),_0x5236e5);queues[_0x5236e5[_0xc4d2('0x5')]][_0xc4d2('0x6a')]=utils[_0xc4d2('0x1b')]();utils[_0xc4d2('0x2')](util[_0xc4d2('0x3')](_0xc4d2('0x6b'),_0x5236e5[_0xc4d2('0x5')],queues[_0x5236e5[_0xc4d2('0x5')]][_0xc4d2('0x1e')],queues[_0x5236e5[_0xc4d2('0x5')]]['musiconholdstartAt']));}}catch(_0x2315ab){utils['error'](util[_0xc4d2('0x3')](_0xc4d2('0x69'),_0x5236e5[_0xc4d2('0x5')]),_0x2315ab);}};exports[_0xc4d2('0x6c')]=function(_0x2edbec){try{if(!_[_0xc4d2('0x24')](queues[_0x2edbec[_0xc4d2('0x5')]])){if(!_[_0xc4d2('0x24')](queues[_0x2edbec[_0xc4d2('0x5')]]['musiconholdstartAt'])){utils[_0xc4d2('0x12')](util[_0xc4d2('0x3')](_0xc4d2('0x6d'),_0x2edbec[_0xc4d2('0x5')]),_0x2edbec);queues[_0x2edbec[_0xc4d2('0x5')]][_0xc4d2('0x5e')]+=utils[_0xc4d2('0x6e')](utils[_0xc4d2('0x1b')](),queues[_0x2edbec[_0xc4d2('0x5')]][_0xc4d2('0x6a')]);utils[_0xc4d2('0x2')](util['format'](_0xc4d2('0x6f'),_0x2edbec[_0xc4d2('0x5')],queues[_0x2edbec[_0xc4d2('0x5')]][_0xc4d2('0x1e')],queues[_0x2edbec[_0xc4d2('0x5')]][_0xc4d2('0x5e')]));delete queues[_0x2edbec[_0xc4d2('0x5')]][_0xc4d2('0x6a')];}}}catch(_0x4894b4){utils[_0xc4d2('0x2f')](util[_0xc4d2('0x3')](_0xc4d2('0x6d'),_0x2edbec[_0xc4d2('0x5')]),_0x4894b4);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 19121a1..795a6d9 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 _0xf005=['[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','./utils','info','[%s][recordings][writeDB]','uniqueid','accountcode','then','membername','CreateVoiceRecording','request','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','context','exten','error','newstate','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','value','replace','.wav49','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','outbound','connectedlinename','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','[%s][recordings][newexten]','[%s][recordings][queuecallerjoin]'];(function(_0x791fde,_0x3e11a0){var _0x31692e=function(_0x1e3418){while(--_0x1e3418){_0x791fde['push'](_0x791fde['shift']());}};_0x31692e(++_0x3e11a0);}(_0xf005,0xb0));var _0x5f00=function(_0x545563,_0x6e631c){_0x545563=_0x545563-0x0;var _0x4200df=_0xf005[_0x545563];return _0x4200df;};'use strict';var _=require(_0x5f00('0x0'));var util=require('util');var utils=require(_0x5f00('0x1'));var recordings={};function writeDB(_0x302f56){utils[_0x5f00('0x2')](util['format'](_0x5f00('0x3'),_0x302f56[_0x5f00('0x4')]));if(_0x302f56[_0x5f00('0x5')]){utils['getUserByInternal'](_0x302f56[_0x5f00('0x5')])[_0x5f00('0x6')](function(_0x218ecf){if(_0x218ecf){_0x302f56[_0x5f00('0x7')]=_0x218ecf['name'];_0x302f56['UserId']=_0x218ecf['id'];}utils['request'](_0x5f00('0x8'),_0x302f56);});}else{utils[_0x5f00('0x9')]('CreateVoiceRecording',_0x302f56);}}exports[_0x5f00('0xa')]=function(_0x2365a7){try{utils[_0x5f00('0xb')](util[_0x5f00('0xc')](_0x5f00('0xd'),_0x2365a7['uniqueid']),_0x2365a7);if(_0x2365a7[_0x5f00('0x4')]==_0x2365a7[_0x5f00('0xe')]){utils['info'](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x2365a7['uniqueid'],_0x2365a7[_0x5f00('0xf')],_0x2365a7[_0x5f00('0x10')]));recordings[_0x2365a7[_0x5f00('0x4')]]={'uniqueid':_0x2365a7['uniqueid'],'accountcode':_0x2365a7['accountcode'],'exten':_0x2365a7[_0x5f00('0x10')],'context':_0x2365a7[_0x5f00('0xf')],'channel':_0x2365a7['channel'],'monitors':[]};}}catch(_0x2d3a78){utils[_0x5f00('0x11')](util[_0x5f00('0xc')]('[%s][recordings][newchannel]',_0x2365a7[_0x5f00('0x4')]),_0x2d3a78);}};exports[_0x5f00('0x12')]=function(_0x10166e){try{utils[_0x5f00('0xb')](util[_0x5f00('0xc')]('[%s][recordings][newstate]',_0x10166e[_0x5f00('0x4')]),_0x10166e);if(!_['isNil'](recordings[_0x10166e[_0x5f00('0x4')]])&&_0x10166e[_0x5f00('0x13')]==0x6){utils['info'](util[_0x5f00('0xc')](_0x5f00('0x14'),_0x10166e[_0x5f00('0x4')],_0x10166e['context'],_0x10166e[_0x5f00('0x15')]));}else if(!_[_0x5f00('0x16')](recordings[_0x10166e['linkedid']])&&_0x10166e['channelstate']==0x6&&_0x10166e[_0x5f00('0xf')]!=_0x5f00('0x17')){utils['info'](util[_0x5f00('0xc')](_0x5f00('0x18'),_0x10166e[_0x5f00('0x4')],_0x10166e[_0x5f00('0xe')],_0x10166e[_0x5f00('0xf')],_0x10166e[_0x5f00('0x15')]));recordings[_0x10166e[_0x5f00('0xe')]]['accountcode']=_0x10166e[_0x5f00('0x5')];}}catch(_0x23b2f0){utils[_0x5f00('0x11')](util[_0x5f00('0xc')](_0x5f00('0x19'),_0x10166e[_0x5f00('0x4')]),_0x23b2f0);}};exports[_0x5f00('0x1a')]=function(_0x2754b4){try{if(!_[_0x5f00('0x16')](_0x2754b4[_0x5f00('0x1b')])&&!_[_0x5f00('0x16')](_0x2754b4['variable'][_0x5f00('0x1c')])){utils['debug'](util[_0x5f00('0xc')]('[%s][recordings][varset]',_0x2754b4[_0x5f00('0x4')]),_0x2754b4);utils[_0x5f00('0x2')](util[_0x5f00('0xc')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x2754b4[_0x5f00('0x4')],_0x2754b4[_0x5f00('0x1b')],_0x2754b4[_0x5f00('0x1d')]));if(_['endsWith'](_0x2754b4['value'],'.wav49')){_0x2754b4['value']=_0x2754b4[_0x5f00('0x1d')][_0x5f00('0x1e')](_0x5f00('0x1f'),'.WAV');}if(recordings[_0x2754b4['linkedid']]){var _0x4242a5=_['find'](recordings[_0x2754b4['linkedid']]['monitors'],{'value':_0x2754b4[_0x5f00('0x1d')]});if(_[_0x5f00('0x16')](_0x4242a5)){recordings[_0x2754b4['linkedid']][_0x5f00('0x20')]['push']({'value':_0x2754b4[_0x5f00('0x1d')]});}}}}catch(_0x22ace3){utils[_0x5f00('0x11')](util['format']('[%s][recordings][varset]',_0x2754b4['uniqueid']),_0x22ace3);}};exports[_0x5f00('0x21')]=function(_0x2d242a){try{if(!_['isNil'](recordings[_0x2d242a[_0x5f00('0x4')]])){utils['debug'](util[_0x5f00('0xc')](_0x5f00('0x22'),_0x2d242a[_0x5f00('0x4')]),_0x2d242a);utils[_0x5f00('0x2')](util[_0x5f00('0xc')](_0x5f00('0x23'),_0x2d242a['uniqueid'],_0x2d242a[_0x5f00('0x24')],_0x2d242a[_0x5f00('0x25')],_0x2d242a[_0x5f00('0x26')]));recordings[_0x2d242a[_0x5f00('0x4')]]['calleridnum']=_0x2d242a[_0x5f00('0x24')];recordings[_0x2d242a['uniqueid']][_0x5f00('0x25')]=_0x2d242a[_0x5f00('0x25')];recordings[_0x2d242a[_0x5f00('0x4')]][_0x5f00('0x27')]=_0x2d242a[_0x5f00('0x27')];recordings[_0x2d242a[_0x5f00('0x4')]]['connectedlinename']=_0x2d242a['connectedlinename'];if(recordings[_0x2d242a[_0x5f00('0x4')]]['type']==_0x5f00('0x28')&&recordings[_0x2d242a[_0x5f00('0x4')]][_0x5f00('0x5')]){recordings[_0x2d242a[_0x5f00('0x4')]][_0x5f00('0x27')]=recordings[_0x2d242a[_0x5f00('0x4')]][_0x5f00('0x5')];recordings[_0x2d242a[_0x5f00('0x4')]][_0x5f00('0x29')]='';}recordings[_0x2d242a[_0x5f00('0x4')]][_0x5f00('0x20')][_0x5f00('0x2a')](function(_0x5ccb7a){var _0x1d9691=_[_0x5f00('0x2b')](recordings[_0x2d242a[_0x5f00('0x4')]]);_0x1d9691[_0x5f00('0x1d')]=_0x5ccb7a[_0x5f00('0x1d')];writeDB(_0x1d9691);});delete recordings[_0x2d242a[_0x5f00('0x4')]];}}catch(_0x328087){utils[_0x5f00('0x11')](util[_0x5f00('0xc')](_0x5f00('0x22'),_0x2d242a[_0x5f00('0x4')]),_0x328087);}};exports[_0x5f00('0x2c')]=function(_0x337cab){try{if(!_[_0x5f00('0x16')](recordings[_0x337cab['uniqueid']])){utils[_0x5f00('0xb')](util[_0x5f00('0xc')]('[%s][recordings][newexten]',_0x337cab[_0x5f00('0x4')]),_0x337cab);utils[_0x5f00('0x2')](util[_0x5f00('0xc')](_0x5f00('0x2d'),_0x337cab[_0x5f00('0x4')],_0x337cab[_0x5f00('0x2e')],_0x337cab[_0x5f00('0x2f')]));if(_0x337cab[_0x5f00('0x2e')][_0x5f00('0x30')]()==_0x5f00('0x31')&&_[_0x5f00('0x32')](_0x337cab['appdata'][_0x5f00('0x30')](),_0x5f00('0x33'))){var _0x193f3a=_0x337cab[_0x5f00('0x2f')]['split']('=');var _0xdca3f9=_0x193f3a[0x0][_0x5f00('0x34')](_0x193f3a[0x0][_0x5f00('0x35')]('(')+0x1,_0x193f3a[0x0]['lastIndexOf'](')'));var _0x133338=_0x193f3a[0x1];recordings[_0x337cab[_0x5f00('0x4')]][_0xdca3f9]=_0x133338;}}}catch(_0x13f18f){utils[_0x5f00('0x11')](util[_0x5f00('0xc')](_0x5f00('0x36'),_0x337cab[_0x5f00('0x4')]),_0x13f18f);}};exports['queuecallerjoin']=function(_0x525442){try{if(!_['isNil'](recordings[_0x525442[_0x5f00('0x4')]])){utils[_0x5f00('0xb')](util[_0x5f00('0xc')](_0x5f00('0x37'),_0x525442[_0x5f00('0x4')]),_0x525442);utils[_0x5f00('0x2')](util[_0x5f00('0xc')](_0x5f00('0x38'),_0x525442['uniqueid'],_0x525442[_0x5f00('0x39')]));recordings[_0x525442[_0x5f00('0x4')]][_0x5f00('0x39')]=_0x525442[_0x5f00('0x39')];}}catch(_0x195c45){utils[_0x5f00('0x11')](util[_0x5f00('0xc')](_0x5f00('0x37'),_0x525442['uniqueid']),_0x195c45);}}; \ No newline at end of file +var _0xd90b=['appdata','set','toLowerCase','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash','util','./utils','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','membername','name','UserId','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','info','context','exten','channel','error','newstate','isNil','channelstate','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','replace','.wav49','.WAV','find','monitors','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','type','forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application'];(function(_0x188d8d,_0x3289e2){var _0x4132e4=function(_0x4ae987){while(--_0x4ae987){_0x188d8d['push'](_0x188d8d['shift']());}};_0x4132e4(++_0x3289e2);}(_0xd90b,0x1a7));var _0xbd90=function(_0x280e13,_0x2c7144){_0x280e13=_0x280e13-0x0;var _0x3d20b1=_0xd90b[_0x280e13];return _0x3d20b1;};'use strict';var _=require(_0xbd90('0x0'));var util=require(_0xbd90('0x1'));var utils=require(_0xbd90('0x2'));var recordings={};function writeDB(_0x689f7e){utils['info'](util[_0xbd90('0x3')](_0xbd90('0x4'),_0x689f7e[_0xbd90('0x5')]));if(_0x689f7e[_0xbd90('0x6')]){utils[_0xbd90('0x7')](_0x689f7e[_0xbd90('0x6')])['then'](function(_0x40f73e){if(_0x40f73e){_0x689f7e[_0xbd90('0x8')]=_0x40f73e[_0xbd90('0x9')];_0x689f7e[_0xbd90('0xa')]=_0x40f73e['id'];}utils[_0xbd90('0xb')]('CreateVoiceRecording',_0x689f7e);});}else{utils[_0xbd90('0xb')]('CreateVoiceRecording',_0x689f7e);}}exports[_0xbd90('0xc')]=function(_0x333059){try{utils[_0xbd90('0xd')](util[_0xbd90('0x3')](_0xbd90('0xe'),_0x333059[_0xbd90('0x5')]),_0x333059);if(_0x333059[_0xbd90('0x5')]==_0x333059[_0xbd90('0xf')]){utils[_0xbd90('0x10')](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x333059['uniqueid'],_0x333059[_0xbd90('0x11')],_0x333059[_0xbd90('0x12')]));recordings[_0x333059['uniqueid']]={'uniqueid':_0x333059[_0xbd90('0x5')],'accountcode':_0x333059[_0xbd90('0x6')],'exten':_0x333059[_0xbd90('0x12')],'context':_0x333059[_0xbd90('0x11')],'channel':_0x333059[_0xbd90('0x13')],'monitors':[]};}}catch(_0x31726a){utils[_0xbd90('0x14')](util['format'](_0xbd90('0xe'),_0x333059[_0xbd90('0x5')]),_0x31726a);}};exports[_0xbd90('0x15')]=function(_0x3172b){try{utils['debug'](util['format']('[%s][recordings][newstate]',_0x3172b['uniqueid']),_0x3172b);if(!_[_0xbd90('0x16')](recordings[_0x3172b['uniqueid']])&&_0x3172b[_0xbd90('0x17')]==0x6){utils['info'](util[_0xbd90('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x3172b[_0xbd90('0x5')],_0x3172b[_0xbd90('0x11')],_0x3172b[_0xbd90('0x13')]));}else if(!_[_0xbd90('0x16')](recordings[_0x3172b[_0xbd90('0xf')]])&&_0x3172b['channelstate']==0x6&&_0x3172b[_0xbd90('0x11')]!='transfer'){utils[_0xbd90('0x10')](util['format']('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x3172b[_0xbd90('0x5')],_0x3172b[_0xbd90('0xf')],_0x3172b[_0xbd90('0x11')],_0x3172b[_0xbd90('0x13')]));recordings[_0x3172b[_0xbd90('0xf')]][_0xbd90('0x6')]=_0x3172b[_0xbd90('0x6')];}}catch(_0x4dbe90){utils[_0xbd90('0x14')](util[_0xbd90('0x3')]('[%s][recordings][newstate]',_0x3172b[_0xbd90('0x5')]),_0x4dbe90);}};exports[_0xbd90('0x18')]=function(_0x57bb32){try{if(!_[_0xbd90('0x16')](_0x57bb32[_0xbd90('0x19')])&&!_[_0xbd90('0x16')](_0x57bb32['variable'][_0xbd90('0x1a')])){utils['debug'](util[_0xbd90('0x3')](_0xbd90('0x1b'),_0x57bb32[_0xbd90('0x5')]),_0x57bb32);utils[_0xbd90('0x10')](util[_0xbd90('0x3')](_0xbd90('0x1c'),_0x57bb32[_0xbd90('0x5')],_0x57bb32['variable'],_0x57bb32[_0xbd90('0x1d')]));if(_['endsWith'](_0x57bb32[_0xbd90('0x1d')],'.wav49')){_0x57bb32[_0xbd90('0x1d')]=_0x57bb32[_0xbd90('0x1d')][_0xbd90('0x1e')](_0xbd90('0x1f'),_0xbd90('0x20'));}if(recordings[_0x57bb32[_0xbd90('0xf')]]){var _0x31fdea=_[_0xbd90('0x21')](recordings[_0x57bb32[_0xbd90('0xf')]][_0xbd90('0x22')],{'value':_0x57bb32[_0xbd90('0x1d')]});if(_['isNil'](_0x31fdea)){recordings[_0x57bb32['linkedid']]['monitors']['push']({'value':_0x57bb32[_0xbd90('0x1d')]});}}}}catch(_0x3ec183){utils[_0xbd90('0x14')](util[_0xbd90('0x3')](_0xbd90('0x1b'),_0x57bb32[_0xbd90('0x5')]),_0x3ec183);}};exports[_0xbd90('0x23')]=function(_0x43a1fc){try{if(!_[_0xbd90('0x16')](recordings[_0x43a1fc[_0xbd90('0x5')]])){utils['debug'](util[_0xbd90('0x3')]('[%s][recordings][hangup]',_0x43a1fc[_0xbd90('0x5')]),_0x43a1fc);utils[_0xbd90('0x10')](util[_0xbd90('0x3')](_0xbd90('0x24'),_0x43a1fc[_0xbd90('0x5')],_0x43a1fc[_0xbd90('0x25')],_0x43a1fc[_0xbd90('0x26')],_0x43a1fc[_0xbd90('0x27')]));recordings[_0x43a1fc['uniqueid']]['calleridnum']=_0x43a1fc[_0xbd90('0x25')];recordings[_0x43a1fc[_0xbd90('0x5')]][_0xbd90('0x26')]=_0x43a1fc[_0xbd90('0x26')];recordings[_0x43a1fc[_0xbd90('0x5')]]['connectedlinenum']=_0x43a1fc[_0xbd90('0x28')];recordings[_0x43a1fc[_0xbd90('0x5')]]['connectedlinename']=_0x43a1fc['connectedlinename'];if(recordings[_0x43a1fc[_0xbd90('0x5')]][_0xbd90('0x29')]=='outbound'&&recordings[_0x43a1fc[_0xbd90('0x5')]]['accountcode']){recordings[_0x43a1fc[_0xbd90('0x5')]][_0xbd90('0x28')]=recordings[_0x43a1fc[_0xbd90('0x5')]]['accountcode'];recordings[_0x43a1fc['uniqueid']]['connectedlinename']='';}recordings[_0x43a1fc[_0xbd90('0x5')]]['monitors'][_0xbd90('0x2a')](function(_0x5c759e){var _0x9f4586=_[_0xbd90('0x2b')](recordings[_0x43a1fc[_0xbd90('0x5')]]);_0x9f4586['value']=_0x5c759e[_0xbd90('0x1d')];writeDB(_0x9f4586);});delete recordings[_0x43a1fc['uniqueid']];}}catch(_0xdad796){utils[_0xbd90('0x14')](util[_0xbd90('0x3')](_0xbd90('0x2c'),_0x43a1fc[_0xbd90('0x5')]),_0xdad796);}};exports[_0xbd90('0x2d')]=function(_0x3be35e){try{if(!_[_0xbd90('0x16')](recordings[_0x3be35e[_0xbd90('0x5')]])){utils[_0xbd90('0xd')](util['format'](_0xbd90('0x2e'),_0x3be35e[_0xbd90('0x5')]),_0x3be35e);utils[_0xbd90('0x10')](util['format'](_0xbd90('0x2f'),_0x3be35e[_0xbd90('0x5')],_0x3be35e[_0xbd90('0x30')],_0x3be35e[_0xbd90('0x31')]));if(_0x3be35e[_0xbd90('0x30')]['toLowerCase']()==_0xbd90('0x32')&&_['startsWith'](_0x3be35e[_0xbd90('0x31')][_0xbd90('0x33')](),_0xbd90('0x34'))){var _0x4f1478=_0x3be35e[_0xbd90('0x31')][_0xbd90('0x35')]('=');var _0x855cc4=_0x4f1478[0x0][_0xbd90('0x36')](_0x4f1478[0x0]['lastIndexOf']('(')+0x1,_0x4f1478[0x0][_0xbd90('0x37')](')'));var _0x5d75a8=_0x4f1478[0x1];recordings[_0x3be35e[_0xbd90('0x5')]][_0x855cc4]=_0x5d75a8;}}}catch(_0x3c985d){utils[_0xbd90('0x14')](util[_0xbd90('0x3')](_0xbd90('0x2e'),_0x3be35e[_0xbd90('0x5')]),_0x3c985d);}};exports[_0xbd90('0x38')]=function(_0x1050ea){try{if(!_[_0xbd90('0x16')](recordings[_0x1050ea[_0xbd90('0x5')]])){utils[_0xbd90('0xd')](util[_0xbd90('0x3')](_0xbd90('0x39'),_0x1050ea[_0xbd90('0x5')]),_0x1050ea);utils[_0xbd90('0x10')](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x1050ea[_0xbd90('0x5')],_0x1050ea[_0xbd90('0x3a')]));recordings[_0x1050ea[_0xbd90('0x5')]][_0xbd90('0x3a')]=_0x1050ea[_0xbd90('0x3a')];}}catch(_0x3b4466){utils[_0xbd90('0x14')](util[_0xbd90('0x3')](_0xbd90('0x39'),_0x1050ea['uniqueid']),_0x3b4466);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 71b3125..2f12cee 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 _0xaedf=['origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','blind','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended'];(function(_0x5063c7,_0x12ae20){var _0x3cc5d5=function(_0xa76f4f){while(--_0xa76f4f){_0x5063c7['push'](_0x5063c7['shift']());}};_0x3cc5d5(++_0x12ae20);}(_0xaedf,0x13e));var _0xfaed=function(_0x4e66b8,_0x3b188a){_0x4e66b8=_0x4e66b8-0x0;var _0x33f321=_0xaedf[_0x4e66b8];return _0x33f321;};'use strict';var _=require(_0xfaed('0x0'));var util=require('util');var utils=require(_0xfaed('0x1'));function writeDB(_0x3bf0a4){utils['info'](util[_0xfaed('0x2')](_0xfaed('0x3'),_0x3bf0a4[_0xfaed('0x4')]===_0xfaed('0x5')?_0x3bf0a4[_0xfaed('0x6')]:_0x3bf0a4[_0xfaed('0x7')],_0x3bf0a4[_0xfaed('0x4')]));utils['request'](_0xfaed('0x8'),_0x3bf0a4);}exports['blindtransfer']=function(_0x27f84e){try{utils[_0xfaed('0x9')](util[_0xfaed('0x2')]('[%s][transfers][blindtransfer]',_0x27f84e[_0xfaed('0x7')]),_0x27f84e);utils['info'](util[_0xfaed('0x2')](_0xfaed('0xa'),_0x27f84e[_0xfaed('0x7')],_0x27f84e[_0xfaed('0xb')],_0x27f84e['transferercalleridname'],_0x27f84e['transfereecalleridnum'],_0x27f84e['transfereecalleridname']));_0x27f84e[_0xfaed('0x4')]=_0xfaed('0xc');writeDB(_0x27f84e);}catch(_0x1bf825){utils[_0xfaed('0xd')](util['format'](_0xfaed('0xe'),_0x27f84e[_0xfaed('0x7')]),_0x1bf825);}};exports[_0xfaed('0xf')]=function(_0xe896b){try{utils[_0xfaed('0x9')](util[_0xfaed('0x2')]('[%s][transfers][attendedtransfer]',_0xe896b['origtransfereruniqueid']),_0xe896b);utils['info'](util[_0xfaed('0x2')](_0xfaed('0x10'),_0xe896b['origtransfereruniqueid'],_0xe896b[_0xfaed('0x11')],_0xe896b[_0xfaed('0x12')],_0xe896b[_0xfaed('0x13')],_0xe896b[_0xfaed('0x14')]));_0xe896b=_['assign'](_0xe896b,{'transfererchannel':_0xe896b[_0xfaed('0x15')],'transferercalleridnum':_0xe896b[_0xfaed('0x11')],'transferercalleridname':_0xe896b['origtransferercalleridname'],'transfererconnectedlinenum':_0xe896b[_0xfaed('0x16')],'transfererconnectedlinename':_0xe896b[_0xfaed('0x17')],'transfereraccountcode':_0xe896b[_0xfaed('0x18')],'transferercontext':_0xe896b[_0xfaed('0x19')],'transfererexten':_0xe896b[_0xfaed('0x1a')],'transfererlinkedid':_0xe896b['origtransfererlinkedid'],'context':_0xe896b[_0xfaed('0x1b')],'extension':_0xe896b[_0xfaed('0x1c')],'type':_0xfaed('0x5')});if(_[_0xfaed('0x1d')](_0xe896b[_0xfaed('0x1e')])){_0xe896b=_[_0xfaed('0x1f')](_0xe896b,{'transfereechannel':_0xe896b['transfertargetchannel'],'transfereecalleridnum':_0xe896b[_0xfaed('0x13')],'transfereecalleridname':_0xe896b[_0xfaed('0x14')],'transfereeconnectedlinenum':_0xe896b['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xe896b['transfertargetconnectedlinename'],'transfereeaccountcode':_0xe896b['transfertargetaccountcode'],'transfereecontext':_0xe896b[_0xfaed('0x20')],'transfereeexten':_0xe896b[_0xfaed('0x21')],'transfereelinkedid':_0xe896b[_0xfaed('0x22')]});}writeDB(_0xe896b);}catch(_0x3c7a5d){utils[_0xfaed('0xd')](util[_0xfaed('0x2')](_0xfaed('0x23'),_0xe896b['origtransfereruniqueid']),_0x3c7a5d);}}; \ No newline at end of file +var _0x9b64=['secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','origtransferercalleridname'];(function(_0x58efa6,_0x2c00bd){var _0x5d643c=function(_0x1d1ef2){while(--_0x1d1ef2){_0x58efa6['push'](_0x58efa6['shift']());}};_0x5d643c(++_0x2c00bd);}(_0x9b64,0x10c));var _0x49b6=function(_0x4cea31,_0x54ef05){_0x4cea31=_0x4cea31-0x0;var _0x30bf16=_0x9b64[_0x4cea31];return _0x30bf16;};'use strict';var _=require(_0x49b6('0x0'));var util=require(_0x49b6('0x1'));var utils=require(_0x49b6('0x2'));function writeDB(_0x900a53){utils[_0x49b6('0x3')](util[_0x49b6('0x4')](_0x49b6('0x5'),_0x900a53[_0x49b6('0x6')]==='attended'?_0x900a53[_0x49b6('0x7')]:_0x900a53['uniqueid'],_0x900a53[_0x49b6('0x6')]));utils['request'](_0x49b6('0x8'),_0x900a53);}exports[_0x49b6('0x9')]=function(_0x47027c){try{utils[_0x49b6('0xa')](util[_0x49b6('0x4')](_0x49b6('0xb'),_0x47027c[_0x49b6('0xc')]),_0x47027c);utils[_0x49b6('0x3')](util[_0x49b6('0x4')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x47027c[_0x49b6('0xc')],_0x47027c[_0x49b6('0xd')],_0x47027c['transferercalleridname'],_0x47027c[_0x49b6('0xe')],_0x47027c[_0x49b6('0xf')]));_0x47027c[_0x49b6('0x6')]=_0x49b6('0x10');writeDB(_0x47027c);}catch(_0x7dbf79){utils[_0x49b6('0x11')](util[_0x49b6('0x4')](_0x49b6('0xb'),_0x47027c[_0x49b6('0xc')]),_0x7dbf79);}};exports[_0x49b6('0x12')]=function(_0x54dfcb){try{utils[_0x49b6('0xa')](util[_0x49b6('0x4')](_0x49b6('0x13'),_0x54dfcb[_0x49b6('0x7')]),_0x54dfcb);utils[_0x49b6('0x3')](util['format'](_0x49b6('0x14'),_0x54dfcb[_0x49b6('0x7')],_0x54dfcb[_0x49b6('0x15')],_0x54dfcb['origtransferercalleridname'],_0x54dfcb[_0x49b6('0x16')],_0x54dfcb[_0x49b6('0x17')]));_0x54dfcb=_['assign'](_0x54dfcb,{'transfererchannel':_0x54dfcb[_0x49b6('0x18')],'transferercalleridnum':_0x54dfcb[_0x49b6('0x15')],'transferercalleridname':_0x54dfcb[_0x49b6('0x19')],'transfererconnectedlinenum':_0x54dfcb[_0x49b6('0x1a')],'transfererconnectedlinename':_0x54dfcb[_0x49b6('0x1b')],'transfereraccountcode':_0x54dfcb[_0x49b6('0x1c')],'transferercontext':_0x54dfcb['secondtransferercontext'],'transfererexten':_0x54dfcb['secondtransfererexten'],'transfererlinkedid':_0x54dfcb[_0x49b6('0x1d')],'context':_0x54dfcb[_0x49b6('0x1e')],'extension':_0x54dfcb[_0x49b6('0x1f')],'type':_0x49b6('0x20')});if(_[_0x49b6('0x21')](_0x54dfcb[_0x49b6('0x22')])){_0x54dfcb=_[_0x49b6('0x23')](_0x54dfcb,{'transfereechannel':_0x54dfcb[_0x49b6('0x24')],'transfereecalleridnum':_0x54dfcb[_0x49b6('0x16')],'transfereecalleridname':_0x54dfcb[_0x49b6('0x17')],'transfereeconnectedlinenum':_0x54dfcb[_0x49b6('0x25')],'transfereeconnectedlinename':_0x54dfcb[_0x49b6('0x26')],'transfereeaccountcode':_0x54dfcb[_0x49b6('0x27')],'transfereecontext':_0x54dfcb['transfertargetcontext'],'transfereeexten':_0x54dfcb[_0x49b6('0x28')],'transfereelinkedid':_0x54dfcb[_0x49b6('0x29')]});}writeDB(_0x54dfcb);}catch(_0x36fc0e){utils[_0x49b6('0x11')](util['format']('[%s][transfers][attendedtransfer]',_0x54dfcb[_0x49b6('0x7')]),_0x36fc0e);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index be512fd..87587fa 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 _0xbddb=['diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds'];(function(_0x3421ac,_0x3228b5){var _0x16c2d2=function(_0xad864f){while(--_0xad864f){_0x3421ac['push'](_0x3421ac['shift']());}};_0x16c2d2(++_0x3228b5);}(_0xbddb,0x1bf));var _0xbbdd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbddb[_0x2641f9];return _0x585741;};'use strict';var BPromise=require(_0xbbdd('0x0'));var jayson=require(_0xbbdd('0x1'));var moment=require(_0xbbdd('0x2'));var util=require(_0xbbdd('0x3'));var client=jayson[_0xbbdd('0x4')][_0xbbdd('0x5')]({'port':0x2329});var logger=require(_0xbbdd('0x6'))(_0xbbdd('0x7'));exports[_0xbbdd('0x8')]=function(_0x3268c5,_0xbb768d){logger['info'](_0x3268c5,_0xbb768d?util[_0xbbdd('0x9')](_0xbb768d,{'showHidden':![],'depth':null}):'');};exports[_0xbbdd('0xa')]=function(_0x40d924,_0x3c61fb){logger[_0xbbdd('0xa')](_0x40d924,_0x3c61fb?util[_0xbbdd('0x9')](_0x3c61fb,{'showHidden':![],'depth':null}):'');};exports[_0xbbdd('0xb')]=function(_0x22f744,_0x2cbdb7){logger[_0xbbdd('0xb')](_0x22f744,_0x2cbdb7?util['inspect'](_0x2cbdb7,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x4c877b,_0x22b8ff){return client[_0xbbdd('0xc')](_0x4c877b,{'body':_0x22b8ff})[_0xbbdd('0xd')](function(_0x53311b){logger[_0xbbdd('0xa')](_0xbbdd('0xe'),_0x4c877b,_0x53311b?util['inspect'](_0x53311b,{'showHidden':![],'depth':null}):'');})[_0xbbdd('0xf')](function(_0x12aeb1){logger[_0xbbdd('0xb')](_0xbbdd('0xe'),_0x4c877b,_0x12aeb1?util[_0xbbdd('0x9')](_0x12aeb1,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2a6640){return client[_0xbbdd('0xc')](_0xbbdd('0x10'),{'options':{'raw':!![],'attributes':['id',_0xbbdd('0x11'),_0xbbdd('0x12'),'interface'],'where':_0x2a6640,'limit':0x1}})[_0xbbdd('0xd')](function(_0x351e28){logger['debug']('[utils][getUser]\x20where:%s',JSON[_0xbbdd('0x13')](_0x2a6640),_0x351e28?util[_0xbbdd('0x9')](_0x351e28,{'showHidden':![],'depth':null}):'');return _0x351e28[_0xbbdd('0x14')]['length']?_0x351e28[_0xbbdd('0x14')][0x0]:null;});}exports[_0xbbdd('0x15')]=function(_0x5ee2f0){return new BPromise(function(_0x15607e,_0x5855d5){if(_0x5ee2f0){return getUser({'internal':_0x5ee2f0})[_0xbbdd('0xd')](function(_0x573cdb){logger[_0xbbdd('0x8')](_0xbbdd('0x16'),_0x5ee2f0,_0x573cdb?_0xbbdd('0x17'):_0xbbdd('0x18'));return _0x15607e(_0x573cdb);})[_0xbbdd('0xf')](function(_0x2ba7b5){logger[_0xbbdd('0xb')](_0xbbdd('0x19'),_0x2ba7b5?util[_0xbbdd('0x9')](_0x2ba7b5,{'showHidden':![],'depth':null}):'');return _0x15607e(null);});}return _0x15607e(null);});};exports[_0xbbdd('0x1a')]=function(_0x237e11){return new BPromise(function(_0x509cd3,_0x32fd8d){if(_0x237e11){return getUser({'interface':_0x237e11})[_0xbbdd('0xd')](function(_0x337429){logger['info'](_0xbbdd('0x1b'),_0x237e11,_0x337429?_0xbbdd('0x17'):_0xbbdd('0x18'));return _0x509cd3(_0x337429);})['catch'](function(_0x436baa){logger['error'](_0xbbdd('0x1c'),_0x436baa?util[_0xbbdd('0x9')](_0x436baa,{'showHidden':![],'depth':null}):'');return _0x509cd3(null);});}return _0x509cd3(null);});};exports[_0xbbdd('0x1d')]=function(_0x282b9f){return new BPromise(function(_0x57891e,_0x53d567){if(_0x282b9f){return getUser({'name':_0x282b9f})[_0xbbdd('0xd')](function(_0xe0a0d4){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x282b9f,_0xe0a0d4?_0xbbdd('0x17'):'notfound');return _0x57891e(_0xe0a0d4);})[_0xbbdd('0xf')](function(_0x348b22){logger[_0xbbdd('0xb')](_0xbbdd('0x1e'),_0x348b22?util['inspect'](_0x348b22,{'showHidden':![],'depth':null}):'');return _0x57891e(null);});}return _0x57891e(null);});};exports[_0xbbdd('0x1f')]=function(_0x3ad2d2){return new BPromise(function(_0x207fc8,_0x37e97a){if(_0x3ad2d2){return client[_0xbbdd('0xc')](_0xbbdd('0x20'),{'options':{'raw':!![],'attributes':['id',_0xbbdd('0x12'),_0xbbdd('0x21'),'acw',_0xbbdd('0x22')],'where':{'name':_0x3ad2d2},'limit':0x1}})[_0xbbdd('0xd')](function(_0x3d3fb9){logger[_0xbbdd('0xa')](_0xbbdd('0x23'),_0x3ad2d2,_0x3d3fb9?util[_0xbbdd('0x9')](_0x3d3fb9,{'showHidden':![],'depth':null}):'');logger[_0xbbdd('0x8')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x3ad2d2,_0x3d3fb9?'found':_0xbbdd('0x18'));return _0x207fc8(_0x3d3fb9[_0xbbdd('0x14')]['length']?_0x3d3fb9[_0xbbdd('0x14')][0x0]:null);})['catch'](function(_0x374b13){logger['error']('[utils][getVoiceQueueByName]',_0x374b13?util['inspect'](_0x374b13,{'showHidden':![],'depth':null}):'');return _0x207fc8(null);});}return _0x207fc8(null);});};exports[_0xbbdd('0x24')]=function(_0x38e5f1,_0x3ceb6e){return moment(_0x38e5f1)[_0xbbdd('0x25')](_0x3ceb6e,'seconds')[_0xbbdd('0x26')](_0xbbdd('0x27'));};exports[_0xbbdd('0x28')]=function(_0x566f14,_0x3ec6d7){return moment(_0x566f14)[_0xbbdd('0x29')](_0x3ec6d7,_0xbbdd('0x2a'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xbbdd('0x2b')]=function(_0x502bb2,_0x3c8097){return moment(_0x502bb2)[_0xbbdd('0x2c')](moment(_0x3c8097),_0xbbdd('0x2a'));};exports[_0xbbdd('0x2d')]=function(_0x233623,_0x332326){return parseInt(_0x233623,0xa)+parseInt(_0x332326,0xa);};exports[_0xbbdd('0x2e')]=function(){return moment()['format'](_0xbbdd('0x27'));};exports[_0xbbdd('0x2f')]=function(_0x40d64b,_0x4322f3){if(_0x4322f3){return moment(_0x40d64b)['isAfter'](_0x4322f3);}return!![];};exports[_0xbbdd('0x30')]=function(_0x4a2d5f,_0x2e6ae6){if(_0x2e6ae6){return moment(_0x4a2d5f)['isBefore'](_0x2e6ae6);}else if(_0x4a2d5f){return!![];}return![];}; \ No newline at end of file +var _0xff85=['addTime','add','seconds','format','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','diff','sumTime','now','isAfter','isBefore','moment','util','http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','internal','name','interface','[utils][getUser]\x20where:%s','stringify','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','getUserByName','[utils][getUserByName]','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s'];(function(_0x12553d,_0x160725){var _0x166267=function(_0x49f7ae){while(--_0x49f7ae){_0x12553d['push'](_0x12553d['shift']());}};_0x166267(++_0x160725);}(_0xff85,0x1da));var _0x5ff8=function(_0x3ba48e,_0x3ba43b){_0x3ba48e=_0x3ba48e-0x0;var _0x993fcf=_0xff85[_0x3ba48e];return _0x993fcf;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0x5ff8('0x0'));var util=require(_0x5ff8('0x1'));var client=jayson['client'][_0x5ff8('0x2')]({'port':0x2329});var logger=require('../../config/logger')(_0x5ff8('0x3'));exports[_0x5ff8('0x4')]=function(_0x355171,_0x3dfb01){logger[_0x5ff8('0x4')](_0x355171,_0x3dfb01?util[_0x5ff8('0x5')](_0x3dfb01,{'showHidden':![],'depth':null}):'');};exports[_0x5ff8('0x6')]=function(_0x5abc4e,_0x21543d){logger[_0x5ff8('0x6')](_0x5abc4e,_0x21543d?util[_0x5ff8('0x5')](_0x21543d,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0xd06160,_0x3a01a4){logger[_0x5ff8('0x7')](_0xd06160,_0x3a01a4?util[_0x5ff8('0x5')](_0x3a01a4,{'showHidden':![],'depth':null}):'');};exports[_0x5ff8('0x8')]=function(_0xa7292b,_0x44136e){return client[_0x5ff8('0x8')](_0xa7292b,{'body':_0x44136e})[_0x5ff8('0x9')](function(_0x56090d){logger['debug']('[utils][request]\x20name:%s',_0xa7292b,_0x56090d?util['inspect'](_0x56090d,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x5e0b63){logger['error'](_0x5ff8('0xa'),_0xa7292b,_0x5e0b63?util[_0x5ff8('0x5')](_0x5e0b63,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5c0989){return client[_0x5ff8('0x8')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x5ff8('0xb'),_0x5ff8('0xc'),_0x5ff8('0xd')],'where':_0x5c0989,'limit':0x1}})[_0x5ff8('0x9')](function(_0x559531){logger[_0x5ff8('0x6')](_0x5ff8('0xe'),JSON[_0x5ff8('0xf')](_0x5c0989),_0x559531?util[_0x5ff8('0x5')](_0x559531,{'showHidden':![],'depth':null}):'');return _0x559531['result'][_0x5ff8('0x10')]?_0x559531[_0x5ff8('0x11')][0x0]:null;});}exports[_0x5ff8('0x12')]=function(_0x241514){return new BPromise(function(_0x30f00f,_0x6d495f){if(_0x241514){return getUser({'internal':_0x241514})[_0x5ff8('0x9')](function(_0x19ba23){logger['info'](_0x5ff8('0x13'),_0x241514,_0x19ba23?_0x5ff8('0x14'):_0x5ff8('0x15'));return _0x30f00f(_0x19ba23);})[_0x5ff8('0x16')](function(_0x23caed){logger[_0x5ff8('0x7')](_0x5ff8('0x17'),_0x23caed?util[_0x5ff8('0x5')](_0x23caed,{'showHidden':![],'depth':null}):'');return _0x30f00f(null);});}return _0x30f00f(null);});};exports['getUserByInterface']=function(_0x580070){return new BPromise(function(_0x22d25f,_0x17917e){if(_0x580070){return getUser({'interface':_0x580070})[_0x5ff8('0x9')](function(_0xaba1f3){logger[_0x5ff8('0x4')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x580070,_0xaba1f3?_0x5ff8('0x14'):'notfound');return _0x22d25f(_0xaba1f3);})['catch'](function(_0x42f59a){logger['error']('[utils][getUserByInterface]',_0x42f59a?util['inspect'](_0x42f59a,{'showHidden':![],'depth':null}):'');return _0x22d25f(null);});}return _0x22d25f(null);});};exports[_0x5ff8('0x18')]=function(_0x46ca2c){return new BPromise(function(_0x508bf5,_0xc362f){if(_0x46ca2c){return getUser({'name':_0x46ca2c})[_0x5ff8('0x9')](function(_0x1ee2a8){logger[_0x5ff8('0x4')]('[utils][getUserByName]\x20name:%s\x20%s',_0x46ca2c,_0x1ee2a8?_0x5ff8('0x14'):'notfound');return _0x508bf5(_0x1ee2a8);})[_0x5ff8('0x16')](function(_0x4d97fd){logger[_0x5ff8('0x7')](_0x5ff8('0x19'),_0x4d97fd?util['inspect'](_0x4d97fd,{'showHidden':![],'depth':null}):'');return _0x508bf5(null);});}return _0x508bf5(null);});};exports['getVoiceQueueByName']=function(_0x276509){return new BPromise(function(_0x4e7638,_0x4fcf2f){if(_0x276509){return client[_0x5ff8('0x8')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x5ff8('0xc'),_0x5ff8('0x1a'),_0x5ff8('0x1b'),_0x5ff8('0x1c')],'where':{'name':_0x276509},'limit':0x1}})['then'](function(_0x16adf1){logger[_0x5ff8('0x6')](_0x5ff8('0x1d'),_0x276509,_0x16adf1?util[_0x5ff8('0x5')](_0x16adf1,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x276509,_0x16adf1?_0x5ff8('0x14'):_0x5ff8('0x15'));return _0x4e7638(_0x16adf1[_0x5ff8('0x11')][_0x5ff8('0x10')]?_0x16adf1['result'][0x0]:null);})[_0x5ff8('0x16')](function(_0x2d02d0){logger[_0x5ff8('0x7')]('[utils][getVoiceQueueByName]',_0x2d02d0?util[_0x5ff8('0x5')](_0x2d02d0,{'showHidden':![],'depth':null}):'');return _0x4e7638(null);});}return _0x4e7638(null);});};exports[_0x5ff8('0x1e')]=function(_0x5e7eab,_0x327467){return moment(_0x5e7eab)[_0x5ff8('0x1f')](_0x327467,_0x5ff8('0x20'))[_0x5ff8('0x21')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x5ff8('0x22')]=function(_0x501791,_0x29db44){return moment(_0x501791)[_0x5ff8('0x23')](_0x29db44,_0x5ff8('0x20'))['format'](_0x5ff8('0x24'));};exports['diffTime']=function(_0x3fb66a,_0x2a3a35){return moment(_0x3fb66a)[_0x5ff8('0x25')](moment(_0x2a3a35),_0x5ff8('0x20'));};exports[_0x5ff8('0x26')]=function(_0x14869c,_0x2214cb){return parseInt(_0x14869c,0xa)+parseInt(_0x2214cb,0xa);};exports[_0x5ff8('0x27')]=function(){return moment()[_0x5ff8('0x21')](_0x5ff8('0x24'));};exports[_0x5ff8('0x28')]=function(_0x56a32e,_0x4432d1){if(_0x4432d1){return moment(_0x56a32e)[_0x5ff8('0x28')](_0x4432d1);}return!![];};exports[_0x5ff8('0x29')]=function(_0x274d10,_0x19f920){if(_0x19f920){return moment(_0x274d10)[_0x5ff8('0x29')](_0x19f920);}else if(_0x274d10){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 1b43389..d9a2e7b 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 _0x6143=['%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','agent_id','agent_name','test','url','setupLoggers','fs-extra','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','/var','log','join','client','role','name','ensureDir','then','catch','user','no-user','timestamp','error','api','auth','set','client-side-logger','use','logger','isEmpty','body','\x20body=%s','method','x-forwarded-for','headers','connection','remoteAddress','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device'];(function(_0x3d961a,_0x48d991){var _0x18302d=function(_0x5e5bd0){while(--_0x5e5bd0){_0x3d961a['push'](_0x3d961a['shift']());}};_0x18302d(++_0x48d991);}(_0x6143,0xcf));var _0x3614=function(_0x336edd,_0x523704){_0x336edd=_0x336edd-0x0;var _0x85f85=_0x6143[_0x336edd];return _0x85f85;};var fs=require(_0x3614('0x0'));var _=require(_0x3614('0x1'));var ewinston=require(_0x3614('0x2'));var path=require(_0x3614('0x3'));var util=require(_0x3614('0x4'));var fileLogger=require(_0x3614('0x5'))[_0x3614('0x6')];var safeTemplate=require(_0x3614('0x7'))[_0x3614('0x8')];var maskSensitiveData=require(_0x3614('0x9'))[_0x3614('0xa')];function ClientSideLogger(){function _0x361e39(_0x458e7a){var _0x5f0294=path['join'](_0x3614('0xb'),_0x3614('0xc'),'xcally');var _0xe525c7=path[_0x3614('0xd')](_0x3614('0xe'),_0x458e7a[_0x3614('0xf')]+'-'+_0x458e7a[_0x3614('0x10')]);return fs[_0x3614('0x11')](path[_0x3614('0xd')](_0x5f0294,_0xe525c7))[_0x3614('0x12')](function(){var _0x902ddb=fileLogger(_0x3614('0xe'),path[_0x3614('0xd')](_0x5f0294,_0xe525c7));return _0x902ddb;})[_0x3614('0x13')](function(_0x3aef5e){throw _0x3aef5e;});}this[_0x3614('0xc')]=function(_0x334857,_0x1aca63,_0x762e19,_0x50ca92){return _0x361e39(_0x334857[_0x3614('0x14')])[_0x3614('0x12')](function(_0x3b5a04){var _0x556fab=_0x3b5a04[_0x1aca63];return _0x556fab;})[_0x3614('0x12')](function(_0x4177e7){var _0x3650c8=_0x334857[_0x3614('0x14')]?_0x334857[_0x3614('0x14')]['id']:_0x3614('0x15');var _0x210bfb=_0x50ca92['data'];var _0x1d5078=_0x50ca92[_0x3614('0x16')];var _0x5a96d2=new Date(Number(_0x1d5078));return _0x4177e7(_0x3650c8,_0x5a96d2,_0x762e19,_0x210bfb);})[_0x3614('0x13')](function(_0x1b0ca1){fileLogger('client')[_0x3614('0x17')](_0x1b0ca1);});};}function setupLoggers(_0x4fda18){return new Promise(function(_0x430acf){var _0x315e80=new ClientSideLogger();var _0x32fd5c=fileLogger(_0x3614('0x18'));var _0x18216a=fileLogger(_0x3614('0x19'));_0x4fda18[_0x3614('0x1a')](_0x3614('0x1b'),_0x315e80);_0x4fda18[_0x3614('0x1c')](ewinston[_0x3614('0x1d')]({'winstonInstance':_0x32fd5c,'meta':![],'statusLevels':!![],'msg':function(_0x5a09f0,_0x4fb6a3){var _0x3ed0b3='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x3614('0x1e')](_0x5a09f0[_0x3614('0x1f')])){_0x3ed0b3+=_0x3614('0x20');var _0x4343e7=_0x5a09f0[_0x3614('0x1f')];maskSensitiveData(_0x4343e7);}return safeTemplate(util['format'](_0x3ed0b3,_0x5a09f0[_0x3614('0x21')],_0x5a09f0['headers'][_0x3614('0x22')]?_0x5a09f0[_0x3614('0x23')][_0x3614('0x22')]:_0x5a09f0[_0x3614('0x24')][_0x3614('0x25')]||_0x5a09f0['ip'],_0x5a09f0['url'],_0x4fb6a3[_0x3614('0x26')],_0x4fb6a3[_0x3614('0x27')],_0x5a09f0[_0x3614('0x14')]?_0x5a09f0['user']['id']:null,_0x5a09f0['user']?_0x5a09f0[_0x3614('0x14')][_0x3614('0x10')]:null,_0x5a09f0[_0x3614('0x14')]?_0x5a09f0[_0x3614('0x14')][_0x3614('0xf')]:null,_0x4343e7?util[_0x3614('0x28')](_0x4343e7,![],null):''));}}));_0x4fda18[_0x3614('0x1c')](ewinston[_0x3614('0x1d')]({'winstonInstance':_0x18216a,'meta':![],'statusLevels':!![],'msg':function(_0x452290,_0x46aca9){var _0x129fb1=_0x3614('0x29');if(_0x452290[_0x3614('0x1f')]&&_0x452290[_0x3614('0x1f')][_0x3614('0x2a')]&&_0x452290[_0x3614('0x1f')]['agent_id']){_0x129fb1=_0x3614('0x2b');}return util[_0x3614('0x2c')](_0x129fb1,_0x452290[_0x3614('0x21')],_0x452290['headers'][_0x3614('0x22')]?_0x452290[_0x3614('0x23')][_0x3614('0x22')]:_0x452290['connection'][_0x3614('0x25')]||_0x452290['ip'],_0x452290['url'],_0x46aca9[_0x3614('0x26')],_0x46aca9[_0x3614('0x27')],_0x452290[_0x3614('0x14')]?_0x452290[_0x3614('0x14')]['id']:null,_0x452290[_0x3614('0x14')]?_0x452290[_0x3614('0x14')][_0x3614('0x10')]:null,_0x452290[_0x3614('0x14')]?_0x452290[_0x3614('0x14')][_0x3614('0xf')]:null,_0x452290[_0x3614('0x1f')]&&_0x452290[_0x3614('0x1f')][_0x3614('0x2a')]?_0x452290[_0x3614('0x1f')][_0x3614('0x2a')]:'other',_0x452290[_0x3614('0x1f')]&&_0x452290[_0x3614('0x1f')][_0x3614('0x2d')]?_0x452290[_0x3614('0x1f')][_0x3614('0x2d')]:'',_0x452290[_0x3614('0x1f')]&&_0x452290[_0x3614('0x1f')][_0x3614('0x2e')]?_0x452290[_0x3614('0x1f')]['agent_name']:'');},'ignoreRoute':function(_0x327ee4){var _0x3721af=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3721af[_0x3614('0x2f')](_0x327ee4[_0x3614('0x30')]);}}));return _0x430acf();});}exports[_0x3614('0x31')]=setupLoggers; \ No newline at end of file +var _0xbdbd=['lodash','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','log','xcally','client','role','name','then','catch','user','no-user','data','error','api','set','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','%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)','other','agent_name','setupLoggers','fs-extra'];(function(_0x7196fe,_0x563248){var _0x24f66d=function(_0x56c47c){while(--_0x56c47c){_0x7196fe['push'](_0x7196fe['shift']());}};_0x24f66d(++_0x563248);}(_0xbdbd,0xb3));var _0xdbdb=function(_0x2f5022,_0x5ba251){_0x2f5022=_0x2f5022-0x0;var _0xcdf166=_0xbdbd[_0x2f5022];return _0xcdf166;};var fs=require(_0xdbdb('0x0'));var _=require(_0xdbdb('0x1'));var ewinston=require('express-winston');var path=require(_0xdbdb('0x2'));var util=require(_0xdbdb('0x3'));var fileLogger=require(_0xdbdb('0x4'))[_0xdbdb('0x5')];var safeTemplate=require(_0xdbdb('0x6'))[_0xdbdb('0x7')];var maskSensitiveData=require(_0xdbdb('0x8'))[_0xdbdb('0x9')];function ClientSideLogger(){function _0x30213d(_0x138278){var _0x14f729=path[_0xdbdb('0xa')]('/var',_0xdbdb('0xb'),_0xdbdb('0xc'));var _0x58b2cc=path[_0xdbdb('0xa')](_0xdbdb('0xd'),_0x138278[_0xdbdb('0xe')]+'-'+_0x138278[_0xdbdb('0xf')]);return fs['ensureDir'](path['join'](_0x14f729,_0x58b2cc))[_0xdbdb('0x10')](function(){var _0x352fcf=fileLogger(_0xdbdb('0xd'),path[_0xdbdb('0xa')](_0x14f729,_0x58b2cc));return _0x352fcf;})[_0xdbdb('0x11')](function(_0x5d6790){throw _0x5d6790;});}this[_0xdbdb('0xb')]=function(_0x37d7,_0x116eb7,_0x49d188,_0x59927c){return _0x30213d(_0x37d7['user'])[_0xdbdb('0x10')](function(_0x13b32a){var _0x2d6e96=_0x13b32a[_0x116eb7];return _0x2d6e96;})[_0xdbdb('0x10')](function(_0x210e7f){var _0x59a8ac=_0x37d7[_0xdbdb('0x12')]?_0x37d7['user']['id']:_0xdbdb('0x13');var _0x1e70c0=_0x59927c[_0xdbdb('0x14')];var _0x4a4b39=_0x59927c['timestamp'];var _0x396f43=new Date(Number(_0x4a4b39));return _0x210e7f(_0x59a8ac,_0x396f43,_0x49d188,_0x1e70c0);})[_0xdbdb('0x11')](function(_0x4ea806){fileLogger(_0xdbdb('0xd'))[_0xdbdb('0x15')](_0x4ea806);});};}function setupLoggers(_0x33447f){return new Promise(function(_0x3e7636){var _0x13bdcb=new ClientSideLogger();var _0x53a7bf=fileLogger(_0xdbdb('0x16'));var _0x43114e=fileLogger('auth');_0x33447f[_0xdbdb('0x17')]('client-side-logger',_0x13bdcb);_0x33447f[_0xdbdb('0x18')](ewinston[_0xdbdb('0x19')]({'winstonInstance':_0x53a7bf,'meta':![],'statusLevels':!![],'msg':function(_0x33c1ce,_0x597afb){var _0x1c7cdd=_0xdbdb('0x1a');if(!_['isEmpty'](_0x33c1ce[_0xdbdb('0x1b')])){_0x1c7cdd+=_0xdbdb('0x1c');var _0x42d2e1=_0x33c1ce[_0xdbdb('0x1b')];maskSensitiveData(_0x42d2e1);}return safeTemplate(util[_0xdbdb('0x1d')](_0x1c7cdd,_0x33c1ce[_0xdbdb('0x1e')],_0x33c1ce[_0xdbdb('0x1f')][_0xdbdb('0x20')]?_0x33c1ce[_0xdbdb('0x1f')][_0xdbdb('0x20')]:_0x33c1ce[_0xdbdb('0x21')][_0xdbdb('0x22')]||_0x33c1ce['ip'],_0x33c1ce[_0xdbdb('0x23')],_0x597afb[_0xdbdb('0x24')],_0x597afb[_0xdbdb('0x25')],_0x33c1ce[_0xdbdb('0x12')]?_0x33c1ce['user']['id']:null,_0x33c1ce[_0xdbdb('0x12')]?_0x33c1ce['user']['name']:null,_0x33c1ce[_0xdbdb('0x12')]?_0x33c1ce['user'][_0xdbdb('0xe')]:null,_0x42d2e1?util['inspect'](_0x42d2e1,![],null):''));}}));_0x33447f[_0xdbdb('0x18')](ewinston[_0xdbdb('0x19')]({'winstonInstance':_0x43114e,'meta':![],'statusLevels':!![],'msg':function(_0x40e6ec,_0x3b7b53){var _0x4a3ecc=_0xdbdb('0x26');if(_0x40e6ec[_0xdbdb('0x1b')]&&_0x40e6ec[_0xdbdb('0x1b')][_0xdbdb('0x27')]&&_0x40e6ec[_0xdbdb('0x1b')][_0xdbdb('0x28')]){_0x4a3ecc=_0xdbdb('0x29');}return util[_0xdbdb('0x1d')](_0x4a3ecc,_0x40e6ec['method'],_0x40e6ec[_0xdbdb('0x1f')]['x-forwarded-for']?_0x40e6ec[_0xdbdb('0x1f')][_0xdbdb('0x20')]:_0x40e6ec[_0xdbdb('0x21')][_0xdbdb('0x22')]||_0x40e6ec['ip'],_0x40e6ec[_0xdbdb('0x23')],_0x3b7b53[_0xdbdb('0x24')],_0x3b7b53[_0xdbdb('0x25')],_0x40e6ec['user']?_0x40e6ec[_0xdbdb('0x12')]['id']:null,_0x40e6ec[_0xdbdb('0x12')]?_0x40e6ec[_0xdbdb('0x12')][_0xdbdb('0xf')]:null,_0x40e6ec['user']?_0x40e6ec[_0xdbdb('0x12')][_0xdbdb('0xe')]:null,_0x40e6ec[_0xdbdb('0x1b')]&&_0x40e6ec[_0xdbdb('0x1b')][_0xdbdb('0x27')]?_0x40e6ec['body'][_0xdbdb('0x27')]:_0xdbdb('0x2a'),_0x40e6ec[_0xdbdb('0x1b')]&&_0x40e6ec['body'][_0xdbdb('0x28')]?_0x40e6ec[_0xdbdb('0x1b')][_0xdbdb('0x28')]:'',_0x40e6ec[_0xdbdb('0x1b')]&&_0x40e6ec[_0xdbdb('0x1b')]['agent_name']?_0x40e6ec[_0xdbdb('0x1b')][_0xdbdb('0x2b')]:'');},'ignoreRoute':function(_0x3856dc){var _0x3b74db=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3b74db['test'](_0x3856dc[_0xdbdb('0x23')]);}}));return _0x3e7636();});}exports[_0xdbdb('0x2c')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 20e0b38..97fd0e7 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8c8=['isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','monthsShort','circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','isBetween','timeCompare','format','ddd','includes','dowCompare','date','max','min','domCompare','MMM','monthCompare','guess','test','isMoment','padStart','length','lodash','moment-timezone','map','source','join','Date\x20not\x20valid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa8c8,0x1da));var _0x8a8c=function(_0x4c7cb7,_0x45a318){_0x4c7cb7=_0x4c7cb7-0x0;var _0x17f77f=_0xa8c8[_0x4c7cb7];return _0x17f77f;};var _=require(_0x8a8c('0x0'));var moment=require(_0x8a8c('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][_0x8a8c('0x2')](function(_0x46582f){return _0x46582f[_0x8a8c('0x3')];})[_0x8a8c('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE=_0x8a8c('0x5');function throwIfDateNotValid(_0x395a1f){if(!_0x395a1f[_0x8a8c('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x46b4db){var _0x192049=_0x46b4db[_0x8a8c('0x7')](':')[_0x8a8c('0x2')](function(_0xc79ef4){return parseInt(_0xc79ef4,0xa);});var _0x555ca0=_0x192049[0x0];var _0x287150=_0x192049[0x1];if(_0x555ca0<0x0||_0x555ca0>0x17||_0x287150<0x0||_0x287150>0x3b){throw new Error(EINVALID_DATE);}return[_0x555ca0,_0x287150];}function circularDoWInterval(_0x1bff27,_0x184c2f){if(_0x1bff27===_0x184c2f){return[_0x1bff27];}else{var _0x5da737=moment[_0x8a8c('0x8')]();moment[_0x8a8c('0x8')]('en');var _0xaa66d6=moment[_0x8a8c('0x9')]()['map'](function(_0xdce604){return _0xdce604[_0x8a8c('0xa')]();});moment[_0x8a8c('0x8')](_0x5da737);var _0x4adf94=_0xaa66d6['indexOf'](_0x1bff27);var _0x1535fa=_0xaa66d6[_0x8a8c('0xb')](_0x184c2f);if(_0x1535fa>_0x4adf94){return _0xaa66d6[_0x8a8c('0xc')](_0x4adf94,_0x1535fa+0x1);}else{var _0xaf640f=_0xaa66d6[_0x8a8c('0xc')](0x0,_0x1535fa+0x1);var _0xb76cd8=_0xaa66d6[_0x8a8c('0xc')](_0x4adf94);return _0xb76cd8[_0x8a8c('0xd')](_0xaf640f);}}}module[_0x8a8c('0xe')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x1184f2,_0x36aec1){if(_0x1184f2===_0x36aec1){return[_0x1184f2];}else{var _0x3e032c=moment[_0x8a8c('0x8')]();moment['locale']('en');var _0x352501=moment[_0x8a8c('0xf')]()['map'](function(_0x3aa85e){return _0x3aa85e[_0x8a8c('0xa')]();});moment[_0x8a8c('0x8')](_0x3e032c);var _0x5d61cc=_0x352501[_0x8a8c('0xb')](_0x1184f2);var _0x493d66=_0x352501[_0x8a8c('0xb')](_0x36aec1);if(_0x493d66>_0x5d61cc){return _0x352501[_0x8a8c('0xc')](_0x5d61cc,_0x493d66+0x1);}else{var _0x520d44=_0x352501[_0x8a8c('0xc')](0x0,_0x493d66+0x1);var _0x16c3cc=_0x352501[_0x8a8c('0xc')](_0x5d61cc);return _0x16c3cc[_0x8a8c('0xd')](_0x520d44);}}}module[_0x8a8c('0xe')][_0x8a8c('0x10')]=circularMonthInterval;function parseDom(_0x121e09){var _0x47c18a=parseInt(_0x121e09,0xa);if(_0x47c18a<0x1||_0x47c18a>0x1f){throw new Error(EINVALID_DATE);}return _0x47c18a;}function timeCompare(_0x26cf04,_0x59bf8e,_0x5ecaa8){var _0xbe75fa=_0x26cf04['clone']();var _0x1353c6=extractTime(_0x59bf8e);var _0x4a2dd0=_0x1353c6[0x0];var _0x3c6f9d=_0x1353c6[0x1];var _0x36c027=_0x26cf04[_0x8a8c('0x11')]()[_0x8a8c('0x12')](_0x4a2dd0)[_0x8a8c('0x13')](_0x3c6f9d);throwIfDateNotValid(_0x36c027);var _0x52efff=extractTime(_0x5ecaa8);var _0x5cead5=_0x52efff[0x0];var _0x449126=_0x52efff[0x1];var _0x3331b0=_0x26cf04[_0x8a8c('0x11')]()[_0x8a8c('0x12')](_0x5cead5)[_0x8a8c('0x13')](_0x449126);throwIfDateNotValid(_0x3331b0);if(_0x3331b0[_0x8a8c('0x14')](_0x36c027)){var _0x528b3b=_0xbe75fa[_0x8a8c('0x11')]()[_0x8a8c('0x15')](_0x8a8c('0x16'));var _0x29d0cf=_0xbe75fa['clone']()['endOf'](_0x8a8c('0x16'));return _0xbe75fa[_0x8a8c('0x17')](_0x36c027,_0x29d0cf,undefined,'[]')||_0xbe75fa[_0x8a8c('0x17')](_0x528b3b,_0x3331b0,undefined,'[]');}else{return _0xbe75fa['isBetween'](_0x36c027,_0x3331b0,undefined,'[]');}}module[_0x8a8c('0xe')][_0x8a8c('0x18')]=timeCompare;function dowCompare(_0x30d310,_0x4e703e,_0x26926d){var _0x42a680=_0x30d310[_0x8a8c('0x8')]('en')[_0x8a8c('0x19')](_0x8a8c('0x1a'))[_0x8a8c('0xa')]();return circularDoWInterval(_0x4e703e,_0x26926d)[_0x8a8c('0x1b')](_0x42a680);}module[_0x8a8c('0xe')][_0x8a8c('0x1c')]=dowCompare;function domCompare(_0x9c7fd,_0x1720bc,_0x586b68){var _0x1aba37=_0x9c7fd[_0x8a8c('0x1d')]();if(_0x1720bc===_0x586b68){return _0x1aba37===_0x1720bc;}else{var _0x5e6328=_0x9c7fd['daysInMonth']();var _0x36cb29=_0x1720bc<_0x586b68;let _0x1c3fa0=![];var _0x3f4a92=0x0;var _0x373bcd=0x0;if(_0x36cb29){_0x3f4a92=Math[_0x8a8c('0x1e')](0x1,_0x1720bc);_0x373bcd=Math[_0x8a8c('0x1f')](_0x586b68,_0x5e6328);_0x1c3fa0=_0x1aba37>=_0x3f4a92&&_0x1aba37<=_0x373bcd;}else{_0x3f4a92=Math['min'](_0x1720bc,_0x5e6328);_0x373bcd=Math[_0x8a8c('0x1e')](0x1,_0x586b68);_0x1c3fa0=_0x1aba37>=_0x3f4a92||_0x1aba37<=_0x373bcd;}return _0x1c3fa0;}}module[_0x8a8c('0xe')][_0x8a8c('0x20')]=domCompare;function monthCompare(_0x3f46c7,_0x43680a,_0x49507){var _0x3d9ac3=_0x3f46c7[_0x8a8c('0x8')]('en')[_0x8a8c('0x19')](_0x8a8c('0x21'))[_0x8a8c('0xa')]();return circularMonthInterval(_0x43680a,_0x49507)['includes'](_0x3d9ac3);}module[_0x8a8c('0xe')][_0x8a8c('0x22')]=monthCompare;function iftime(_0x197b4a,_0xf645aa=moment['tz'][_0x8a8c('0x23')](),_0x3f6046=moment()){if(!validateRx[_0x8a8c('0x24')](_0x197b4a)){throw new Error(EINVALID_STRING);}else{var _0x477fd0=(moment[_0x8a8c('0x25')](_0x3f6046)?_0x3f6046[_0x8a8c('0x11')]():moment(_0x3f6046))['tz'](_0xf645aa)[_0x8a8c('0x8')]('en');throwIfDateNotValid(_0x477fd0);var _0x51b4c6=_0x197b4a[_0x8a8c('0x7')](',');var _0x56554a=_0x51b4c6[0x0];var _0x289a80=_0x51b4c6[0x1];var _0x57befe=_0x51b4c6[0x2];var _0x3dfedc=_0x51b4c6[0x3];let _0x55210f=!![];if(_0x56554a!=='*'){var _0x21c029=_0x56554a[_0x8a8c('0x7')]('-');var _0x52d6fd=_[_0x8a8c('0x26')](_0x21c029[0x0],0x5,'0');var _0x5076c8=_0x21c029['length']===0x2?_[_0x8a8c('0x26')](_0x21c029[0x1],0x5,'0'):_0x52d6fd;_0x55210f=timeCompare(_0x477fd0,_0x52d6fd,_0x5076c8);}let _0x1b4b14=!![];if(_0x289a80!=='*'){var _0x11dcfe=_0x289a80[_0x8a8c('0x7')]('-');var _0x30d34a=_0x11dcfe[0x0];var _0x49d52b=_0x11dcfe['length']===0x2?_0x11dcfe[0x1]:_0x30d34a;_0x1b4b14=dowCompare(_0x477fd0,_0x30d34a,_0x49d52b);}let _0x543778=!![];if(_0x57befe!=='*'){var _0x1a613b=_0x57befe[_0x8a8c('0x7')]('-');var _0xf4a212=parseDom(_0x1a613b[0x0]);var _0x2f9004=_0x1a613b[_0x8a8c('0x27')]===0x2?parseDom(_0x1a613b[0x1]):_0xf4a212;_0x543778=domCompare(_0x477fd0,_0xf4a212,_0x2f9004);}let _0xd5f99=!![];if(_0x3dfedc!=='*'){var _0x429d06=_0x3dfedc[_0x8a8c('0x7')]('-');var _0x3c7abf=_0x429d06[0x0];var _0x51e6c9=_0x429d06[_0x8a8c('0x27')]===0x2?_0x429d06[0x1]:_0x429d06[0x0];_0xd5f99=monthCompare(_0x477fd0,_0x3c7abf,_0x51e6c9);}return _0x55210f&&_0x1b4b14&&_0x543778&&_0xd5f99;}}module[_0x8a8c('0xe')]['iftime']=iftime; \ No newline at end of file +var _0xc6f0=['iftime','moment-timezone','source','join','Interval\x20string\x20not\x20valid','isValid','split','map','locale','toLowerCase','indexOf','slice','concat','exports','clone','minutes','isBefore','day','endOf','isBetween','timeCompare','format','ddd','includes','dowCompare','daysInMonth','max','min','MMM','monthCompare','guess','test','padStart','length'];(function(_0x1c1cca,_0x3e5159){var _0x2f84d7=function(_0x43fc4b){while(--_0x43fc4b){_0x1c1cca['push'](_0x1c1cca['shift']());}};_0x2f84d7(++_0x3e5159);}(_0xc6f0,0xef));var _0x0c6f=function(_0x15a26f,_0x4e8151){_0x15a26f=_0x15a26f-0x0;var _0xf158d=_0xc6f0[_0x15a26f];return _0xf158d;};var _=require('lodash');var moment=require(_0x0c6f('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x5b4c50){return _0x5b4c50[_0x0c6f('0x1')];})[_0x0c6f('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x0c6f('0x3');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x206e8b){if(!_0x206e8b[_0x0c6f('0x4')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x3cb0ac){var _0x4b8b31=_0x3cb0ac[_0x0c6f('0x5')](':')[_0x0c6f('0x6')](function(_0x30ad27){return parseInt(_0x30ad27,0xa);});var _0x65579e=_0x4b8b31[0x0];var _0x3c3c5b=_0x4b8b31[0x1];if(_0x65579e<0x0||_0x65579e>0x17||_0x3c3c5b<0x0||_0x3c3c5b>0x3b){throw new Error(EINVALID_DATE);}return[_0x65579e,_0x3c3c5b];}function circularDoWInterval(_0x4a98b7,_0x42dea5){if(_0x4a98b7===_0x42dea5){return[_0x4a98b7];}else{var _0x2de092=moment[_0x0c6f('0x7')]();moment[_0x0c6f('0x7')]('en');var _0x4da3f6=moment['weekdaysShort']()[_0x0c6f('0x6')](function(_0x205aeb){return _0x205aeb[_0x0c6f('0x8')]();});moment['locale'](_0x2de092);var _0x26cd12=_0x4da3f6[_0x0c6f('0x9')](_0x4a98b7);var _0x588daa=_0x4da3f6[_0x0c6f('0x9')](_0x42dea5);if(_0x588daa>_0x26cd12){return _0x4da3f6[_0x0c6f('0xa')](_0x26cd12,_0x588daa+0x1);}else{var _0x31d012=_0x4da3f6[_0x0c6f('0xa')](0x0,_0x588daa+0x1);var _0x5a7599=_0x4da3f6[_0x0c6f('0xa')](_0x26cd12);return _0x5a7599[_0x0c6f('0xb')](_0x31d012);}}}module[_0x0c6f('0xc')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x1dabb2,_0x3da63b){if(_0x1dabb2===_0x3da63b){return[_0x1dabb2];}else{var _0x366829=moment[_0x0c6f('0x7')]();moment[_0x0c6f('0x7')]('en');var _0x49f4ae=moment['monthsShort']()[_0x0c6f('0x6')](function(_0x550d0d){return _0x550d0d[_0x0c6f('0x8')]();});moment[_0x0c6f('0x7')](_0x366829);var _0x242122=_0x49f4ae[_0x0c6f('0x9')](_0x1dabb2);var _0x208ef6=_0x49f4ae['indexOf'](_0x3da63b);if(_0x208ef6>_0x242122){return _0x49f4ae[_0x0c6f('0xa')](_0x242122,_0x208ef6+0x1);}else{var _0x2f3dd4=_0x49f4ae['slice'](0x0,_0x208ef6+0x1);var _0x16ce13=_0x49f4ae['slice'](_0x242122);return _0x16ce13['concat'](_0x2f3dd4);}}}module['exports']['circularMonthInterval']=circularMonthInterval;function parseDom(_0x49ffd1){var _0x14ba83=parseInt(_0x49ffd1,0xa);if(_0x14ba83<0x1||_0x14ba83>0x1f){throw new Error(EINVALID_DATE);}return _0x14ba83;}function timeCompare(_0x2650ab,_0x293da8,_0x3046af){var _0x150af5=_0x2650ab[_0x0c6f('0xd')]();var _0x5a998a=extractTime(_0x293da8);var _0x1e41ea=_0x5a998a[0x0];var _0xc8057d=_0x5a998a[0x1];var _0xfbf2f8=_0x2650ab[_0x0c6f('0xd')]()['hours'](_0x1e41ea)['minutes'](_0xc8057d);throwIfDateNotValid(_0xfbf2f8);var _0x367c3d=extractTime(_0x3046af);var _0x3eebb5=_0x367c3d[0x0];var _0x83d05a=_0x367c3d[0x1];var _0x45eb2e=_0x2650ab[_0x0c6f('0xd')]()['hours'](_0x3eebb5)[_0x0c6f('0xe')](_0x83d05a);throwIfDateNotValid(_0x45eb2e);if(_0x45eb2e[_0x0c6f('0xf')](_0xfbf2f8)){var _0x13f52c=_0x150af5[_0x0c6f('0xd')]()['startOf'](_0x0c6f('0x10'));var _0x491c86=_0x150af5['clone']()[_0x0c6f('0x11')](_0x0c6f('0x10'));return _0x150af5[_0x0c6f('0x12')](_0xfbf2f8,_0x491c86,undefined,'[]')||_0x150af5[_0x0c6f('0x12')](_0x13f52c,_0x45eb2e,undefined,'[]');}else{return _0x150af5[_0x0c6f('0x12')](_0xfbf2f8,_0x45eb2e,undefined,'[]');}}module['exports'][_0x0c6f('0x13')]=timeCompare;function dowCompare(_0x363f1b,_0x5bcd33,_0x54a3cf){var _0x1940bf=_0x363f1b[_0x0c6f('0x7')]('en')[_0x0c6f('0x14')](_0x0c6f('0x15'))[_0x0c6f('0x8')]();return circularDoWInterval(_0x5bcd33,_0x54a3cf)[_0x0c6f('0x16')](_0x1940bf);}module['exports'][_0x0c6f('0x17')]=dowCompare;function domCompare(_0x59d099,_0x4f7aa3,_0xaaa735){var _0x5951e9=_0x59d099['date']();if(_0x4f7aa3===_0xaaa735){return _0x5951e9===_0x4f7aa3;}else{var _0x1ad125=_0x59d099[_0x0c6f('0x18')]();var _0x23afb2=_0x4f7aa3<_0xaaa735;let _0x19bd4b=![];var _0x3819f3=0x0;var _0x1d2c0f=0x0;if(_0x23afb2){_0x3819f3=Math[_0x0c6f('0x19')](0x1,_0x4f7aa3);_0x1d2c0f=Math['min'](_0xaaa735,_0x1ad125);_0x19bd4b=_0x5951e9>=_0x3819f3&&_0x5951e9<=_0x1d2c0f;}else{_0x3819f3=Math[_0x0c6f('0x1a')](_0x4f7aa3,_0x1ad125);_0x1d2c0f=Math[_0x0c6f('0x19')](0x1,_0xaaa735);_0x19bd4b=_0x5951e9>=_0x3819f3||_0x5951e9<=_0x1d2c0f;}return _0x19bd4b;}}module[_0x0c6f('0xc')]['domCompare']=domCompare;function monthCompare(_0x4fd7c0,_0x27e66b,_0x456e93){var _0x155fdd=_0x4fd7c0['locale']('en')[_0x0c6f('0x14')](_0x0c6f('0x1b'))['toLowerCase']();return circularMonthInterval(_0x27e66b,_0x456e93)[_0x0c6f('0x16')](_0x155fdd);}module['exports'][_0x0c6f('0x1c')]=monthCompare;function iftime(_0x4c27ed,_0x2c093f=moment['tz'][_0x0c6f('0x1d')](),_0x2a8bc3=moment()){if(!validateRx[_0x0c6f('0x1e')](_0x4c27ed)){throw new Error(EINVALID_STRING);}else{var _0x34e349=(moment['isMoment'](_0x2a8bc3)?_0x2a8bc3['clone']():moment(_0x2a8bc3))['tz'](_0x2c093f)[_0x0c6f('0x7')]('en');throwIfDateNotValid(_0x34e349);var _0x2724e7=_0x4c27ed['split'](',');var _0x9a1c45=_0x2724e7[0x0];var _0x105fa3=_0x2724e7[0x1];var _0x190beb=_0x2724e7[0x2];var _0x12bb0d=_0x2724e7[0x3];let _0x22670d=!![];if(_0x9a1c45!=='*'){var _0x1aaf8d=_0x9a1c45[_0x0c6f('0x5')]('-');var _0x5ba23c=_[_0x0c6f('0x1f')](_0x1aaf8d[0x0],0x5,'0');var _0x178e6b=_0x1aaf8d[_0x0c6f('0x20')]===0x2?_['padStart'](_0x1aaf8d[0x1],0x5,'0'):_0x5ba23c;_0x22670d=timeCompare(_0x34e349,_0x5ba23c,_0x178e6b);}let _0x9995ec=!![];if(_0x105fa3!=='*'){var _0x21ba8c=_0x105fa3[_0x0c6f('0x5')]('-');var _0x6679c6=_0x21ba8c[0x0];var _0x491229=_0x21ba8c[_0x0c6f('0x20')]===0x2?_0x21ba8c[0x1]:_0x6679c6;_0x9995ec=dowCompare(_0x34e349,_0x6679c6,_0x491229);}let _0x1ca14c=!![];if(_0x190beb!=='*'){var _0x30b0b7=_0x190beb[_0x0c6f('0x5')]('-');var _0x5e816a=parseDom(_0x30b0b7[0x0]);var _0x53fa0d=_0x30b0b7['length']===0x2?parseDom(_0x30b0b7[0x1]):_0x5e816a;_0x1ca14c=domCompare(_0x34e349,_0x5e816a,_0x53fa0d);}let _0x308173=!![];if(_0x12bb0d!=='*'){var _0x1aa807=_0x12bb0d[_0x0c6f('0x5')]('-');var _0x392b55=_0x1aa807[0x0];var _0xbe9846=_0x1aa807[_0x0c6f('0x20')]===0x2?_0x1aa807[0x1]:_0x1aa807[0x0];_0x308173=monthCompare(_0x34e349,_0x392b55,_0xbe9846);}return _0x22670d&&_0x9995ec&&_0x1ca14c&&_0x308173;}}module[_0x0c6f('0xc')][_0x0c6f('0x21')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 4429d62..bb5b793 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x26b7=['toUpperCase','meta','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','%s-%s','error','File','consoleLogger','fileLogger','moment','winston','../config/environment','debugLevel','toLowerCase','info','red','bold\x20yellow','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','addColors','format','%s-%s.log','message','{{{','}}}','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level'];(function(_0x3e0eee,_0x5ea422){var _0xaf9897=function(_0x59a0c7){while(--_0x59a0c7){_0x3e0eee['push'](_0x3e0eee['shift']());}};_0xaf9897(++_0x5ea422);}(_0x26b7,0x175));var _0x726b=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x26b7[_0x53ccf2];return _0x5a2964;};'use strict';var path=require('path');var util=require('util');var moment=require(_0x726b('0x0'));var winston=require(_0x726b('0x1'));var config=require(_0x726b('0x2'));var debugLevel=config[_0x726b('0x3')]?config['debugLevel'][_0x726b('0x4')]():_0x726b('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x726b('0x6'),'warn':_0x726b('0x7'),'info':'white','print':_0x726b('0x8'),'success':_0x726b('0x9'),'http':_0x726b('0xa'),'verbose':_0x726b('0xb'),'debug':_0x726b('0xc'),'silly':'bold\x20cyan'};winston[_0x726b('0xd')](XC_LOG_COLORS);function getLogFileName(_0x126aa3,_0xe096dd,_0x1f3cce){var _0x237224=_0x126aa3||'/var/log/xcally';return path['join'](_0x237224,util[_0x726b('0xe')](_0x726b('0xf'),_0xe096dd,_0x1f3cce));}function formatter(_0x556826,_0x1430d7){_0x1430d7[_0x726b('0x10')]=_0x1430d7[_0x726b('0x10')]['replace'](/@@{/g,_0x726b('0x11'))['replace'](/}@@/g,_0x726b('0x12'))[_0x726b('0x13')](/@{/g,'{{')[_0x726b('0x13')](/}@/g,'}}');return util['format'](_0x726b('0x14'),moment()['format'](_0x726b('0x15')),_0x1430d7[_0x726b('0x16')][_0x726b('0x17')](),_0x556826,_0x1430d7[_0x726b('0x10')]);}function fileFormat(_0x6701e1,_0x26817f){_0x26817f[_0x726b('0x10')]=_0x26817f[_0x726b('0x10')][_0x726b('0x13')](/@@{/g,_0x726b('0x11'))[_0x726b('0x13')](/}@@/g,_0x726b('0x12'))[_0x726b('0x13')](/@{/g,'{{')[_0x726b('0x13')](/}@/g,'}}');var _0x493a5f=_0x26817f[_0x726b('0x18')]&&Object['keys'](_0x26817f[_0x726b('0x18')])[_0x726b('0x19')]?'\x0a\x09'+JSON['stringify'](_0x26817f[_0x726b('0x18')]):'';return util[_0x726b('0xe')](_0x726b('0x1a'),moment()['format'](_0x726b('0x15')),_0x26817f['level'][_0x726b('0x17')](),_0x6701e1,_0x26817f['message'],_0x493a5f);}function consoleLogger(){var _0x2c3ce5=new winston[(_0x726b('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x726b('0x1c'))][(_0x726b('0x1d'))]({'level':_0x726b('0x1e'),'json':![],'formatter':function(_0x2b6dc4){return formatter('',_0x2b6dc4);}})]});return _0x2c3ce5;}function fileLogger(_0x29f2f5,_0x1faeba){var _0x28779d=new winston[(_0x726b('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x726b('0x1c'))]['File']({'name':util['format'](_0x726b('0x1f'),_0x29f2f5,'error'),'filename':getLogFileName(_0x1faeba,_0x29f2f5,_0x726b('0x20')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xe07978){return fileFormat(_0x29f2f5,_0xe07978);}}),new winston[(_0x726b('0x1c'))][(_0x726b('0x21'))]({'name':util[_0x726b('0xe')]('%s-%s',_0x29f2f5,debugLevel),'filename':getLogFileName(_0x1faeba,_0x29f2f5,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5b30ef){return fileFormat(_0x29f2f5,_0x5b30ef);}}),new winston[(_0x726b('0x1c'))][(_0x726b('0x1d'))]({'level':_0x726b('0x1e'),'json':![],'formatter':function(_0x38302b){return fileFormat(_0x29f2f5,_0x38302b);}})]});return _0x28779d;}exports[_0x726b('0x22')]=consoleLogger;exports[_0x726b('0x23')]=fileLogger; \ No newline at end of file +var _0x7d4d=['toUpperCase','meta','keys','level','transports','warn','Logger','File','%s-%s','error','Console','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','}}}','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xceda91,_0x3155d6){var _0x4d42b3=function(_0x477f1f){while(--_0x477f1f){_0xceda91['push'](_0xceda91['shift']());}};_0x4d42b3(++_0x3155d6);}(_0x7d4d,0xcb));var _0xd7d4=function(_0x19115e,_0x507bab){_0x19115e=_0x19115e-0x0;var _0x45bbd4=_0x7d4d[_0x19115e];return _0x45bbd4;};'use strict';var path=require(_0xd7d4('0x0'));var util=require(_0xd7d4('0x1'));var moment=require(_0xd7d4('0x2'));var winston=require(_0xd7d4('0x3'));var config=require(_0xd7d4('0x4'));var debugLevel=config[_0xd7d4('0x5')]?config[_0xd7d4('0x5')][_0xd7d4('0x6')]():_0xd7d4('0x7');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':_0xd7d4('0x8'),'error':_0xd7d4('0x9'),'warn':_0xd7d4('0xa'),'info':_0xd7d4('0xb'),'print':_0xd7d4('0xc'),'success':_0xd7d4('0xd'),'http':_0xd7d4('0xe'),'verbose':'bold\x20magenta','debug':'bold\x20blue','silly':_0xd7d4('0xf')};winston[_0xd7d4('0x10')](XC_LOG_COLORS);function getLogFileName(_0x592502,_0xf3f6fb,_0x22e64a){var _0x2cd17b=_0x592502||_0xd7d4('0x11');return path[_0xd7d4('0x12')](_0x2cd17b,util[_0xd7d4('0x13')](_0xd7d4('0x14'),_0xf3f6fb,_0x22e64a));}function formatter(_0x25621f,_0x1ba402){_0x1ba402['message']=_0x1ba402[_0xd7d4('0x15')][_0xd7d4('0x16')](/@@{/g,'{{{')[_0xd7d4('0x16')](/}@@/g,_0xd7d4('0x17'))[_0xd7d4('0x16')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xd7d4('0x13')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xd7d4('0x13')](_0xd7d4('0x18')),_0x1ba402['level'][_0xd7d4('0x19')](),_0x25621f,_0x1ba402[_0xd7d4('0x15')]);}function fileFormat(_0x5e8613,_0x259614){_0x259614[_0xd7d4('0x15')]=_0x259614[_0xd7d4('0x15')][_0xd7d4('0x16')](/@@{/g,'{{{')['replace'](/}@@/g,_0xd7d4('0x17'))[_0xd7d4('0x16')](/@{/g,'{{')[_0xd7d4('0x16')](/}@/g,'}}');var _0x4433cf=_0x259614[_0xd7d4('0x1a')]&&Object[_0xd7d4('0x1b')](_0x259614[_0xd7d4('0x1a')])['length']?'\x0a\x09'+JSON['stringify'](_0x259614[_0xd7d4('0x1a')]):'';return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0xd7d4('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),_0x259614[_0xd7d4('0x1c')][_0xd7d4('0x19')](),_0x5e8613,_0x259614[_0xd7d4('0x15')],_0x4433cf);}function consoleLogger(){var _0x4c052d=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xd7d4('0x1d'))]['Console']({'level':_0xd7d4('0x1e'),'json':![],'formatter':function(_0x2d6e23){return formatter('',_0x2d6e23);}})]});return _0x4c052d;}function fileLogger(_0xb1af7f,_0x3cbdfe){var _0x407f53=new winston[(_0xd7d4('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xd7d4('0x20'))]({'name':util[_0xd7d4('0x13')](_0xd7d4('0x21'),_0xb1af7f,_0xd7d4('0x22')),'filename':getLogFileName(_0x3cbdfe,_0xb1af7f,_0xd7d4('0x22')),'level':_0xd7d4('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x446ed4){return fileFormat(_0xb1af7f,_0x446ed4);}}),new winston[(_0xd7d4('0x1d'))][(_0xd7d4('0x20'))]({'name':util[_0xd7d4('0x13')](_0xd7d4('0x21'),_0xb1af7f,debugLevel),'filename':getLogFileName(_0x3cbdfe,_0xb1af7f,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x515480){return fileFormat(_0xb1af7f,_0x515480);}}),new winston[(_0xd7d4('0x1d'))][(_0xd7d4('0x23'))]({'level':_0xd7d4('0x1e'),'json':![],'formatter':function(_0x32e467){return fileFormat(_0xb1af7f,_0x32e467);}})]});return _0x407f53;}exports[_0xd7d4('0x24')]=consoleLogger;exports[_0xd7d4('0x25')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 3b07c65..4bc64ac 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 _0xda2d=['@@{','replace','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','key','user','pass','accountSid','localstationid','dsn','secret','oldPassword','isPlainObject','isArray','isString'];(function(_0x1f3445,_0x36a853){var _0x1c070b=function(_0x3d9f2d){while(--_0x3d9f2d){_0x1f3445['push'](_0x1f3445['shift']());}};_0x1c070b(++_0x36a853);}(_0xda2d,0x102));var _0xdda2=function(_0x510263,_0x326e7e){_0x510263=_0x510263-0x0;var _0x204ba5=_0xda2d[_0x510263];return _0x204ba5;};var _=require('lodash');var sensitiveFields=[_0xdda2('0x0'),_0xdda2('0x1'),_0xdda2('0x2'),_0xdda2('0x3'),_0xdda2('0x4'),'lastName','street','phone',_0xdda2('0x5'),_0xdda2('0x6'),_0xdda2('0x7'),_0xdda2('0x8'),_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb'),_0xdda2('0xc'),_0xdda2('0xd'),_0xdda2('0xe'),'channelSecret',_0xdda2('0xf'),_0xdda2('0x10'),'authToken',_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0x13'),_0xdda2('0x14'),_0xdda2('0x15'),_0xdda2('0x16'),_0xdda2('0x17'),_0xdda2('0x18'),'privateKey','accesskeyid','secretaccesskey',_0xdda2('0x19'),_0xdda2('0x1a'),_0xdda2('0x1b'),_0xdda2('0x1c'),_0xdda2('0x1d'),_0xdda2('0x1e'),_0xdda2('0x1f'),'registry',_0xdda2('0x20')];function maskSensitiveData(_0x4b0220){const _0xbef148=/(?!^)[\s\S](?!$)/g;if(_[_0xdda2('0x21')](_0x4b0220)){for(const _0x3553d5 in _0x4b0220){if(_[_0xdda2('0x22')](_0x4b0220[_0x3553d5])){for(let _0x1922b1=0x0;_0x1922b1<_0x4b0220[_0x3553d5]['length'];_0x1922b1++){maskSensitiveData(_0x4b0220[_0x3553d5][_0x1922b1]);}}else if(_['isPlainObject'](_0x4b0220[_0x3553d5])){maskSensitiveData(_0x4b0220[_0x3553d5]);}else if(_[_0xdda2('0x23')](_0x4b0220[_0x3553d5])){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5]['replace'](/{{{/g,_0xdda2('0x24'))[_0xdda2('0x25')](/}}}/g,_0xdda2('0x26'))[_0xdda2('0x25')](/{{/g,'@{')[_0xdda2('0x25')](/}}/g,'}@');if(_[_0xdda2('0x27')](sensitiveFields,_0x3553d5)){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5][_0xdda2('0x25')](_0xbef148,'*');}}}}}module[_0xdda2('0x28')][_0xdda2('0x29')]=maskSensitiveData; \ No newline at end of file +var _0xadb5=['exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum'];(function(_0x3cffbf,_0x32aaf5){var _0x348c54=function(_0x45b524){while(--_0x45b524){_0x3cffbf['push'](_0x3cffbf['shift']());}};_0x348c54(++_0x32aaf5);}(_0xadb5,0xad));var _0x5adb=function(_0x19edee,_0x4f31f4){_0x19edee=_0x19edee-0x0;var _0x5c4299=_0xadb5[_0x19edee];return _0x5c4299;};var _=require('lodash');var sensitiveFields=[_0x5adb('0x0'),'password',_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3'),'lastName',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'fax',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'membername','calleridname',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'clientEmail',_0x5adb('0x18'),'accesskeyid',_0x5adb('0x19'),'key',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'localstationid',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'oldPassword'];function maskSensitiveData(_0x2312de){const _0x518823=/(?!^)[\s\S](?!$)/g;if(_[_0x5adb('0x20')](_0x2312de)){for(const _0x42a482 in _0x2312de){if(_[_0x5adb('0x21')](_0x2312de[_0x42a482])){for(let _0x304784=0x0;_0x304784<_0x2312de[_0x42a482][_0x5adb('0x22')];_0x304784++){maskSensitiveData(_0x2312de[_0x42a482][_0x304784]);}}else if(_[_0x5adb('0x20')](_0x2312de[_0x42a482])){maskSensitiveData(_0x2312de[_0x42a482]);}else if(_[_0x5adb('0x23')](_0x2312de[_0x42a482])){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](/{{{/g,_0x5adb('0x25'))['replace'](/}}}/g,_0x5adb('0x26'))['replace'](/{{/g,'@{')[_0x5adb('0x24')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x42a482)){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](_0x518823,'*');}}}}}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 1591f6c..84f676e 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 _0x757a=['isArray','map','isPlainObject','reduce','exports','safeTemplate','{\x20{\x20','string','replace'];(function(_0xa81d76,_0x3b397c){var _0x48a088=function(_0x499b7b){while(--_0x499b7b){_0xa81d76['push'](_0xa81d76['shift']());}};_0x48a088(++_0x3b397c);}(_0x757a,0xde));var _0xa757=function(_0x3f1ea0,_0x2851c9){_0x3f1ea0=_0x3f1ea0-0x0;var _0x1323da=_0x757a[_0x3f1ea0];return _0x1323da;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x24afaf){return _0x24afaf==='{{'?_0xa757('0x0'):'\x20}\x20}';}function safeTemplate(_0x5c03c3){var _0x5709ed=_0x5c03c3;if(typeof _0x5c03c3===_0xa757('0x1')){_0x5709ed=_0x5c03c3[_0xa757('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xa757('0x3')](_0x5c03c3)){_0x5709ed=_0x5c03c3[_0xa757('0x4')](function(_0x32630d){return safeTemplate(_0x32630d);});}else if(_[_0xa757('0x5')](_0x5c03c3)){_0x5709ed=Object['keys'](_0x5c03c3)[_0xa757('0x6')](function(_0x4343b6,_0x53be0e){_0x4343b6[_0x53be0e]=safeTemplate(_0x5c03c3[_0x53be0e]);return _0x4343b6;},{});}return _0x5709ed;}module[_0xa757('0x7')][_0xa757('0x8')]=safeTemplate; \ No newline at end of file +var _0xf4f4=['replace','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','\x20}\x20}','string'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x1a2674,_0x247245){_0x1a2674=_0x1a2674-0x0;var _0x14ca43=_0xf4f4[_0x1a2674];return _0x14ca43;};var _=require(_0x4f4f('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x230375){return _0x230375==='{{'?'{\x20{\x20':_0x4f4f('0x1');}function safeTemplate(_0x304b11){var _0x19aa05=_0x304b11;if(typeof _0x304b11===_0x4f4f('0x2')){_0x19aa05=_0x304b11[_0x4f4f('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x304b11)){_0x19aa05=_0x304b11[_0x4f4f('0x4')](function(_0x593952){return safeTemplate(_0x593952);});}else if(_[_0x4f4f('0x5')](_0x304b11)){_0x19aa05=Object[_0x4f4f('0x6')](_0x304b11)[_0x4f4f('0x7')](function(_0x1ff75a,_0x3c4877){_0x1ff75a[_0x3c4877]=safeTemplate(_0x304b11[_0x3c4877]);return _0x1ff75a;},{});}return _0x19aa05;}module[_0x4f4f('0x8')][_0x4f4f('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 4e38275..3f4147e 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 _0x696b=['apps','findIndex','env','NODE_PATH','string','pathExists','then','updated','writeJSON','exports','fs-extra','path','../config/environment','root','resolve','server/app.json','legacy-libs','isArray'];(function(_0xbc1650,_0x2c3729){var _0x1e2cb4=function(_0x1ced2e){while(--_0x1ced2e){_0xbc1650['push'](_0xbc1650['shift']());}};_0x1e2cb4(++_0x2c3729);}(_0x696b,0x76));var _0xb696=function(_0x10ad6b,_0x24a0ad){_0x10ad6b=_0x10ad6b-0x0;var _0x345e32=_0x696b[_0x10ad6b];return _0x345e32;};var fs=require(_0xb696('0x0'));var path=require(_0xb696('0x1'));var config=require(_0xb696('0x2'));var root=config[_0xb696('0x3')];var APP_JSON_PATH=path[_0xb696('0x4')](root,_0xb696('0x5'));var NODEPATH=path[_0xb696('0x4')](root,_0xb696('0x6'));function setLegacyLibsNodeEnvPath(_0x5e11c8){let _0x10fe16=![];if(Array[_0xb696('0x7')](_0x5e11c8[_0xb696('0x8')])){var _0x11e87f=_0x5e11c8[_0xb696('0x8')][_0xb696('0x9')](function(_0x44de4d){return _0x44de4d['name']==='motion2';});if(_0x11e87f>-0x1){var _0x3b76c8=_0x5e11c8[_0xb696('0x8')][_0x11e87f];if(typeof _0x3b76c8[_0xb696('0xa')][_0xb696('0xb')]!==_0xb696('0xc')){_0x3b76c8[_0xb696('0xa')][_0xb696('0xb')]=NODEPATH;_0x10fe16=!![];}}return{'appConfig':_0x5e11c8,'updated':_0x10fe16};}}function updateAppConfig(_0x2bd2e6){return fs[_0xb696('0xd')](APP_JSON_PATH)[_0xb696('0xe')](function(_0x470a9b){if(_0x470a9b){return fs['readJSON'](APP_JSON_PATH)[_0xb696('0xe')](function(_0x24cfdd){var _0x27c533=setLegacyLibsNodeEnvPath(_0x24cfdd);if(_0x27c533[_0xb696('0xf')]){_0x2bd2e6['info']('Updating\x20app.json');return fs[_0xb696('0x10')](APP_JSON_PATH,_0x24cfdd,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise['resolve']();}});}module[_0xb696('0x11')]=updateAppConfig; \ No newline at end of file +var _0xf9eb=['string','pathExists','then','readJSON','info','Updating\x20app.json','fs-extra','path','root','resolve','legacy-libs','apps','findIndex','name','env','NODE_PATH'];(function(_0x54d2fb,_0x31fd9e){var _0x10cb87=function(_0x1a8716){while(--_0x1a8716){_0x54d2fb['push'](_0x54d2fb['shift']());}};_0x10cb87(++_0x31fd9e);}(_0xf9eb,0x86));var _0xbf9e=function(_0x2e6ea9,_0x1b9d9e){_0x2e6ea9=_0x2e6ea9-0x0;var _0x1f8081=_0xf9eb[_0x2e6ea9];return _0x1f8081;};var fs=require(_0xbf9e('0x0'));var path=require(_0xbf9e('0x1'));var config=require('../config/environment');var root=config[_0xbf9e('0x2')];var APP_JSON_PATH=path[_0xbf9e('0x3')](root,'server/app.json');var NODEPATH=path[_0xbf9e('0x3')](root,_0xbf9e('0x4'));function setLegacyLibsNodeEnvPath(_0x537cf0){let _0x2ab6e4=![];if(Array['isArray'](_0x537cf0['apps'])){var _0x55d903=_0x537cf0[_0xbf9e('0x5')][_0xbf9e('0x6')](function(_0x5cabc9){return _0x5cabc9[_0xbf9e('0x7')]==='motion2';});if(_0x55d903>-0x1){var _0x76a278=_0x537cf0[_0xbf9e('0x5')][_0x55d903];if(typeof _0x76a278[_0xbf9e('0x8')][_0xbf9e('0x9')]!==_0xbf9e('0xa')){_0x76a278[_0xbf9e('0x8')][_0xbf9e('0x9')]=NODEPATH;_0x2ab6e4=!![];}}return{'appConfig':_0x537cf0,'updated':_0x2ab6e4};}}function updateAppConfig(_0x1a30f1){return fs[_0xbf9e('0xb')](APP_JSON_PATH)[_0xbf9e('0xc')](function(_0x4576b5){if(_0x4576b5){return fs[_0xbf9e('0xd')](APP_JSON_PATH)[_0xbf9e('0xc')](function(_0x386297){var _0x3ec888=setLegacyLibsNodeEnvPath(_0x386297);if(_0x3ec888['updated']){_0x1a30f1[_0xbf9e('0xe')](_0xbf9e('0xf'));return fs['writeJSON'](APP_JSON_PATH,_0x386297,{'spaces':0x2});}else{return Promise[_0xbf9e('0x3')]();}});}else{return Promise[_0xbf9e('0x3')]();}});}module['exports']=updateAppConfig; \ No newline at end of file -- 1.7.1